'use strict';

var assert53 = require('assert');
var fs29 = require('fs');
var path3 = require('path');
var os11 = require('os');
var util4 = require('util');
var Url = require('url');
var process7 = require('process');
var tty = require('tty');
var childProcess = require('child_process');
var crypto2 = require('crypto');
var fs9 = require('fs/promises');
var esbuild = require('esbuild');
var miniflare = require('miniflare');
var async_hooks = require('async_hooks');
var console$1 = require('console');
var S = require('readline');
var buffer = require('buffer');
var module$1 = require('module');
var Stream = require('stream');
var http = require('http');
var https = require('https');
var zlib = require('zlib');
var web = require('stream/web');
var events = require('events');
var net = require('net');
var domain = require('domain');
var promises = require('timers/promises');
var consumers = require('stream/consumers');
var string_decoder = require('string_decoder');
var blake3Wasm = require('blake3-wasm');
var workerd = require('workerd');

function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }

function _interopNamespace(e) {
  if (e && e.__esModule) return e;
  var n = Object.create(null);
  if (e) {
    Object.keys(e).forEach(function (k) {
      if (k !== 'default') {
        var d = Object.getOwnPropertyDescriptor(e, k);
        Object.defineProperty(n, k, d.get ? d : {
          enumerable: true,
          get: function () { return e[k]; }
        });
      }
    });
  }
  n.default = e;
  return Object.freeze(n);
}

var assert53__default = /*#__PURE__*/_interopDefault(assert53);
var fs29__namespace = /*#__PURE__*/_interopNamespace(fs29);
var path3__namespace = /*#__PURE__*/_interopNamespace(path3);
var os11__namespace = /*#__PURE__*/_interopNamespace(os11);
var util4__namespace = /*#__PURE__*/_interopNamespace(util4);
var Url__default = /*#__PURE__*/_interopDefault(Url);
var process7__default = /*#__PURE__*/_interopDefault(process7);
var tty__default = /*#__PURE__*/_interopDefault(tty);
var childProcess__default = /*#__PURE__*/_interopDefault(childProcess);
var crypto2__default = /*#__PURE__*/_interopDefault(crypto2);
var fs9__default = /*#__PURE__*/_interopDefault(fs9);
var esbuild__namespace = /*#__PURE__*/_interopNamespace(esbuild);
var async_hooks__namespace = /*#__PURE__*/_interopNamespace(async_hooks);
var S__default = /*#__PURE__*/_interopDefault(S);
var Stream__namespace = /*#__PURE__*/_interopNamespace(Stream);
var http__namespace = /*#__PURE__*/_interopNamespace(http);
var https__namespace = /*#__PURE__*/_interopNamespace(https);
var zlib__namespace = /*#__PURE__*/_interopNamespace(zlib);
var events__default = /*#__PURE__*/_interopDefault(events);
var net__default = /*#__PURE__*/_interopDefault(net);
var domain__namespace = /*#__PURE__*/_interopNamespace(domain);

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 __name = (target, value) => __defProp(target, "name", { value, configurable: true });
var __require = /* @__PURE__ */ ((x7) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x7, {
  get: (a7, b11) => (typeof require !== "undefined" ? require : a7)[b11]
}) : x7)(function(x7) {
  if (typeof require !== "undefined") return require.apply(this, arguments);
  throw Error('Dynamic require of "' + x7 + '" is not supported');
});
var __esm = (fn2, res) => function __init() {
  return fn2 && (res = (0, fn2[__getOwnPropNames(fn2)[0]])(fn2 = 0)), res;
};
var __commonJS = (cb2, mod) => function __require3() {
  return mod || (0, cb2[__getOwnPropNames(cb2)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
};
var __export = (target, all3) => {
  for (var name2 in all3)
    __defProp(target, name2, { get: all3[name2], 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 __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget);
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// import_meta_url.js
var import_meta_url;
var init_import_meta_url = __esm({
  "import_meta_url.js"() {
    import_meta_url = __require("url").pathToFileURL(__filename);
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/_shims/registry.mjs
function setShims(shims, options = { auto: false }) {
  if (auto) {
    throw new Error(`you must \`import 'cloudflare/shims/${shims.kind}'\` before importing anything else from cloudflare`);
  }
  if (kind) {
    throw new Error(`can't \`import 'cloudflare/shims/${shims.kind}'\` after \`import 'cloudflare/shims/${kind}'\``);
  }
  auto = options.auto;
  kind = shims.kind;
  fetch2 = shims.fetch;
  shims.Request;
  shims.Response;
  shims.Headers;
  FormData2 = shims.FormData;
  shims.Blob;
  File2 = shims.File;
  shims.ReadableStream;
  getMultipartRequestOptions = shims.getMultipartRequestOptions;
  getDefaultAgent = shims.getDefaultAgent;
  fileFromPath = shims.fileFromPath;
  isFsReadStream = shims.isFsReadStream;
}
var auto, kind, fetch2, FormData2, File2, getMultipartRequestOptions, getDefaultAgent, fileFromPath, isFsReadStream;
var init_registry = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/_shims/registry.mjs"() {
    init_import_meta_url();
    auto = false;
    kind = void 0;
    fetch2 = void 0;
    FormData2 = void 0;
    File2 = void 0;
    getMultipartRequestOptions = void 0;
    getDefaultAgent = void 0;
    fileFromPath = void 0;
    isFsReadStream = void 0;
    __name(setShims, "setShims");
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/_shims/MultipartBody.mjs
var MultipartBody;
var init_MultipartBody = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/_shims/MultipartBody.mjs"() {
    init_import_meta_url();
    MultipartBody = class {
      static {
        __name(this, "MultipartBody");
      }
      constructor(body) {
        this.body = body;
      }
      get [Symbol.toStringTag]() {
        return "MultipartBody";
      }
    };
  }
});

// ../workers-utils/dist/chunk-R45BP2X6.mjs
var INHERIT_SYMBOL, SERVICE_TAG_PREFIX, ENVIRONMENT_TAG_PREFIX, PATH_TO_DEPLOY_CONFIG, JSON_CONFIG_FORMATS;
var init_chunk_R45BP2X6 = __esm({
  "../workers-utils/dist/chunk-R45BP2X6.mjs"() {
    init_import_meta_url();
    INHERIT_SYMBOL = Symbol.for("inherit_binding");
    SERVICE_TAG_PREFIX = "cf:service=";
    ENVIRONMENT_TAG_PREFIX = "cf:environment=";
    PATH_TO_DEPLOY_CONFIG = ".wrangler/deploy/config.json";
    JSON_CONFIG_FORMATS = ["json", "jsonc"];
  }
});

// ../workers-utils/dist/chunk-UC4C7ZX3.mjs
var __create2, __defProp2, __getOwnPropDesc2, __getOwnPropNames2, __getProtoOf2, __hasOwnProp2, __name2, __require2, __commonJS2, __export2, __copyProps2, __reExport2, __toESM2;
var init_chunk_UC4C7ZX3 = __esm({
  "../workers-utils/dist/chunk-UC4C7ZX3.mjs"() {
    init_import_meta_url();
    __create2 = Object.create;
    __defProp2 = Object.defineProperty;
    __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
    __getOwnPropNames2 = Object.getOwnPropertyNames;
    __getProtoOf2 = Object.getPrototypeOf;
    __hasOwnProp2 = Object.prototype.hasOwnProperty;
    __name2 = /* @__PURE__ */ __name((target, value) => __defProp2(target, "name", { value, configurable: true }), "__name");
    __require2 = /* @__PURE__ */ ((x7) => typeof __require !== "undefined" ? __require : typeof Proxy !== "undefined" ? new Proxy(x7, {
      get: /* @__PURE__ */ __name((a7, b11) => (typeof __require !== "undefined" ? __require : a7)[b11], "get")
    }) : x7)(function(x7) {
      if (typeof __require !== "undefined") return __require.apply(this, arguments);
      throw Error('Dynamic require of "' + x7 + '" is not supported');
    });
    __commonJS2 = /* @__PURE__ */ __name((cb2, mod) => /* @__PURE__ */ __name(function __require22() {
      return mod || (0, cb2[__getOwnPropNames2(cb2)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
    }, "__require2"), "__commonJS");
    __export2 = /* @__PURE__ */ __name((target, all3) => {
      for (var name2 in all3)
        __defProp2(target, name2, { get: all3[name2], enumerable: true });
    }, "__export");
    __copyProps2 = /* @__PURE__ */ __name((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: /* @__PURE__ */ __name(() => from[key], "get"), enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
      }
      return to;
    }, "__copyProps");
    __reExport2 = /* @__PURE__ */ __name((target, mod, secondTarget) => (__copyProps2(target, mod, "default"), secondTarget && __copyProps2(secondTarget, mod, "default")), "__reExport");
    __toESM2 = /* @__PURE__ */ __name((mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __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.
      isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target,
      mod
    )), "__toESM");
  }
});
function isCompatDate(str) {
  return /^\d{4}-\d{2}-\d{2}$/.test(str);
}
function formatCompatibilityDate(date) {
  const compatDate = date.toISOString().slice(0, 10);
  assert53__default.default(isCompatDate(compatDate));
  return compatDate;
}
function getTodaysCompatDate() {
  return formatCompatibilityDate(/* @__PURE__ */ new Date());
}
function assertNever(_value) {
}
function mapWorkerMetadataBindings(bindings) {
  return bindings.filter((binding) => binding.type !== "secret_text").reduce((configObj, binding) => {
    switch (binding.type) {
      case "plain_text":
        {
          configObj.vars = {
            ...configObj.vars ?? {},
            [binding.name]: binding.text
          };
        }
        break;
      case "json":
        {
          configObj.vars = {
            ...configObj.vars ?? {},
            name: binding.name,
            json: binding.json
          };
        }
        break;
      case "kv_namespace":
        {
          configObj.kv_namespaces = [
            ...configObj.kv_namespaces ?? [],
            { id: binding.namespace_id, binding: binding.name }
          ];
        }
        break;
      case "durable_object_namespace":
        {
          configObj.durable_objects = {
            bindings: [
              ...configObj.durable_objects?.bindings ?? [],
              {
                name: binding.name,
                class_name: binding.class_name,
                script_name: binding.script_name,
                environment: binding.environment
              }
            ]
          };
        }
        break;
      case "d1":
        {
          configObj.d1_databases = [
            ...configObj.d1_databases ?? [],
            {
              binding: binding.name,
              database_id: binding.id
            }
          ];
        }
        break;
      case "browser":
        {
          configObj.browser = {
            binding: binding.name
          };
        }
        break;
      case "ai":
        {
          configObj.ai = {
            binding: binding.name
          };
        }
        break;
      case "images":
        {
          configObj.images = {
            binding: binding.name
          };
        }
        break;
      case "stream":
        {
          configObj.stream = {
            binding: binding.name
          };
        }
        break;
      case "media":
        {
          configObj.media = {
            binding: binding.name
          };
        }
        break;
      case "r2_bucket":
        {
          configObj.r2_buckets = [
            ...configObj.r2_buckets ?? [],
            {
              binding: binding.name,
              bucket_name: binding.bucket_name,
              jurisdiction: binding.jurisdiction
            }
          ];
        }
        break;
      case "secrets_store_secret":
        {
          configObj.secrets_store_secrets = [
            ...configObj.secrets_store_secrets ?? [],
            {
              binding: binding.name,
              store_id: binding.store_id,
              secret_name: binding.secret_name
            }
          ];
        }
        break;
      case "unsafe_hello_world": {
        configObj.unsafe_hello_world = [
          ...configObj.unsafe_hello_world ?? [],
          {
            binding: binding.name,
            enable_timer: binding.enable_timer
          }
        ];
        break;
      }
      case "flagship": {
        configObj.flagship = [
          ...configObj.flagship ?? [],
          {
            binding: binding.name,
            app_id: binding.app_id
          }
        ];
        break;
      }
      case "service":
        {
          configObj.services = [
            ...configObj.services ?? [],
            {
              binding: binding.name,
              service: binding.service,
              environment: binding.environment,
              entrypoint: binding.entrypoint
            }
          ];
        }
        break;
      case "analytics_engine":
        {
          configObj.analytics_engine_datasets = [
            ...configObj.analytics_engine_datasets ?? [],
            { binding: binding.name, dataset: binding.dataset }
          ];
        }
        break;
      case "dispatch_namespace":
        {
          configObj.dispatch_namespaces = [
            ...configObj.dispatch_namespaces ?? [],
            {
              binding: binding.name,
              namespace: binding.namespace,
              ...binding.outbound && {
                outbound: {
                  service: binding.outbound.worker.service,
                  environment: binding.outbound.worker.environment,
                  parameters: binding.outbound.params?.map((p7) => p7.name) ?? []
                }
              }
            }
          ];
        }
        break;
      case "logfwdr":
        {
          configObj.logfwdr = {
            bindings: [
              ...configObj.logfwdr?.bindings ?? [],
              { name: binding.name, destination: binding.destination }
            ]
          };
        }
        break;
      case "wasm_module":
        {
          configObj.wasm_modules = {
            ...configObj.wasm_modules ?? {},
            [binding.name]: binding.part
          };
        }
        break;
      case "text_blob":
        {
          configObj.text_blobs = {
            ...configObj.text_blobs ?? {},
            [binding.name]: binding.part
          };
        }
        break;
      case "data_blob":
        {
          configObj.data_blobs = {
            ...configObj.data_blobs ?? {},
            [binding.name]: binding.part
          };
        }
        break;
      case "secret_text":
        break;
      case "version_metadata": {
        {
          configObj.version_metadata = {
            binding: binding.name
          };
        }
        break;
      }
      case "send_email": {
        configObj.send_email = [
          ...configObj.send_email ?? [],
          {
            name: binding.name,
            destination_address: binding.destination_address,
            allowed_destination_addresses: binding.allowed_destination_addresses,
            allowed_sender_addresses: binding.allowed_sender_addresses
          }
        ];
        break;
      }
      case "queue":
        configObj.queues ??= { producers: [] };
        configObj.queues.producers = [
          ...configObj.queues.producers ?? [],
          {
            binding: binding.name,
            queue: binding.queue_name,
            delivery_delay: binding.delivery_delay
          }
        ];
        break;
      case "vectorize":
        configObj.vectorize = [
          ...configObj.vectorize ?? [],
          {
            binding: binding.name,
            index_name: binding.index_name
          }
        ];
        break;
      case "ai_search_namespace":
        configObj.ai_search_namespaces = [
          ...configObj.ai_search_namespaces ?? [],
          {
            binding: binding.name,
            namespace: binding.namespace
          }
        ];
        break;
      case "ai_search":
        configObj.ai_search = [
          ...configObj.ai_search ?? [],
          {
            binding: binding.name,
            instance_name: binding.instance_name
          }
        ];
        break;
      case "hyperdrive":
        configObj.hyperdrive = [
          ...configObj.hyperdrive ?? [],
          {
            binding: binding.name,
            id: binding.id
          }
        ];
        break;
      case "mtls_certificate":
        configObj.mtls_certificates = [
          ...configObj.mtls_certificates ?? [],
          {
            binding: binding.name,
            certificate_id: binding.certificate_id
          }
        ];
        break;
      case "pipelines":
        configObj.pipelines = [
          ...configObj.pipelines ?? [],
          {
            binding: binding.name,
            pipeline: binding.pipeline
          }
        ];
        break;
      case "assets":
        configObj.assets = {
          binding: binding.name
          // Note: we currently don't get all the assets information from the
          //      API, so here we are only able to set the name of the binding
          //      hopefully in the future we can properly fully support the binding
        };
        break;
      case "inherit":
        configObj.unsafe = {
          bindings: [...configObj.unsafe?.bindings ?? [], binding],
          metadata: configObj.unsafe?.metadata ?? void 0
        };
        break;
      case "workflow":
        {
          configObj.workflows = [
            ...configObj.workflows ?? [],
            {
              binding: binding.name,
              name: binding.workflow_name,
              class_name: binding.class_name,
              script_name: binding.script_name
            }
          ];
        }
        break;
      case "worker_loader":
        {
          configObj.worker_loaders = [
            ...configObj.worker_loaders ?? [],
            {
              binding: binding.name
            }
          ];
        }
        break;
      case "ratelimit":
        {
          configObj.ratelimits = [
            ...configObj.ratelimits ?? [],
            {
              name: binding.name,
              namespace_id: binding.namespace_id,
              simple: {
                limit: binding.simple.limit,
                period: binding.simple.period
              }
            }
          ];
        }
        break;
      case "vpc_service":
        {
          configObj.vpc_services = [
            ...configObj.vpc_services ?? [],
            {
              binding: binding.name,
              service_id: binding.service_id
            }
          ];
        }
        break;
      case "vpc_network":
        {
          if (binding.tunnel_id !== void 0) {
            configObj.vpc_networks = [
              ...configObj.vpc_networks ?? [],
              { binding: binding.name, tunnel_id: binding.tunnel_id }
            ];
          } else if (binding.network_id !== void 0) {
            configObj.vpc_networks = [
              ...configObj.vpc_networks ?? [],
              { binding: binding.name, network_id: binding.network_id }
            ];
          }
        }
        break;
      default: {
        configObj.unsafe = {
          bindings: [...configObj.unsafe?.bindings ?? [], binding],
          metadata: configObj.unsafe?.metadata ?? void 0
        };
      }
    }
    return configObj;
  }, {});
}
function convertWorkerToWranglerConfig(config) {
  const mappedBindings = mapWorkerMetadataBindings(config.bindings);
  const durableObjectClassNames = config.bindings.filter(
    (binding) => binding.type === "durable_object_namespace" && binding.script_name === config.name
  ).map(
    (durableObject) => durableObject.class_name
  );
  const allRoutes = [
    ...config.routes.map((r10) => ({
      pattern: r10.pattern,
      zone_name: r10.zone_name
    })),
    ...config.domains.map((c8) => ({
      pattern: c8.hostname,
      zone_name: c8.zone_name,
      custom_domain: true
    }))
  ];
  return {
    name: config.name,
    main: config.entrypoint,
    workers_dev: config.subdomain.enabled,
    preview_urls: config.subdomain.previews_enabled,
    compatibility_date: config.compatibility_date ?? getTodaysCompatDate(),
    compatibility_flags: config.compatibility_flags,
    ...allRoutes.length ? { routes: allRoutes } : {},
    placement: config.placement?.mode === "smart" ? { mode: "smart" } : void 0,
    limits: config.limits,
    ...durableObjectClassNames.length && config.migration_tag ? {
      migrations: [
        {
          tag: config.migration_tag,
          new_classes: durableObjectClassNames
        }
      ]
    } : {},
    ...config.schedules.length ? {
      triggers: {
        crons: config.schedules.map((scheduled) => scheduled.cron)
      }
    } : {},
    tail_consumers: config.tail_consumers ?? void 0,
    observability: config.observability,
    ...mappedBindings
  };
}
function constructWranglerConfig(workerOrWorkers) {
  let workers;
  if (Array.isArray(workerOrWorkers)) {
    workers = workerOrWorkers;
  } else {
    workers = [workerOrWorkers];
  }
  const topLevelEnv = workers.find(
    (w7) => !w7.tags?.some((t13) => t13.startsWith(ENVIRONMENT_TAG_PREFIX))
  );
  const workerName = topLevelEnv?.name ?? workers[0].name;
  const entrypoint = topLevelEnv?.entrypoint ?? workers[0].entrypoint;
  let combinedConfig;
  if (topLevelEnv) {
    combinedConfig = convertWorkerToWranglerConfig(topLevelEnv);
  } else {
    combinedConfig = {
      name: workerName,
      main: entrypoint
    };
  }
  for (const env6 of workers) {
    const serviceTag = env6.tags?.find(
      (t13) => t13 === `${SERVICE_TAG_PREFIX}${workerName}`
    );
    const envTag = env6.tags?.find((t13) => t13.startsWith(ENVIRONMENT_TAG_PREFIX));
    if (serviceTag !== `${SERVICE_TAG_PREFIX}${workerName}` || envTag === void 0) {
      continue;
    }
    const [_5, envName] = envTag.split("=");
    combinedConfig.env ??= {};
    combinedConfig.env[envName] = convertWorkerToWranglerConfig(env6);
  }
  return combinedConfig;
}
var init_chunk_WGJ43SKK = __esm({
  "../workers-utils/dist/chunk-WGJ43SKK.mjs"() {
    init_import_meta_url();
    init_chunk_R45BP2X6();
    init_chunk_UC4C7ZX3();
    __name(isCompatDate, "isCompatDate");
    __name2(isCompatDate, "isCompatDate");
    __name(formatCompatibilityDate, "formatCompatibilityDate");
    __name2(formatCompatibilityDate, "formatCompatibilityDate");
    __name(getTodaysCompatDate, "getTodaysCompatDate");
    __name2(getTodaysCompatDate, "getTodaysCompatDate");
    __name(assertNever, "assertNever");
    __name2(assertNever, "assertNever");
    __name(mapWorkerMetadataBindings, "mapWorkerMetadataBindings");
    __name2(mapWorkerMetadataBindings, "mapWorkerMetadataBindings");
    __name(convertWorkerToWranglerConfig, "convertWorkerToWranglerConfig");
    __name2(convertWorkerToWranglerConfig, "convertWorkerToWranglerConfig");
    __name(constructWranglerConfig, "constructWranglerConfig");
    __name2(constructWranglerConfig, "constructWranglerConfig");
  }
});
var init_chunk_A2RWTLF4 = __esm({
  "../workers-utils/dist/chunk-A2RWTLF4.mjs"() {
    init_import_meta_url();
    init_chunk_UC4C7ZX3();
    (class {
      static {
        __name(this, "MetricsRegistry");
      }
      static {
        __name2(this, "MetricsRegistry");
      }
      counters = [];
      /**
       * Create and register a new counter metric.
       *
       * @param name - The metric name (e.g. "service_request_total")
       * @param help - A human-readable description of the metric
       * @returns A Counter that can be incremented
       */
      createCounter(name2, help) {
        const entry = { name: name2, help, value: 0 };
        this.counters.push(entry);
        return {
          inc: /* @__PURE__ */ __name2(() => {
            entry.value++;
          }, "inc"),
          add: /* @__PURE__ */ __name2((amount) => {
            if (amount < 0) {
              throw new Error("Counter value cannot decrease");
            }
            entry.value += amount;
          }, "add")
        };
      }
      /**
       * Serialize all registered metrics in Prometheus text exposition format.
       *
       * @see https://prometheus.io/docs/instrumenting/exposition_formats/#text-based-format
       */
      metrics() {
        return this.counters.map((c8) => {
          let result = "";
          if (c8.help.length > 0) {
            result += `# HELP ${c8.name} ${c8.help}
`;
          }
          result += `# TYPE ${c8.name} counter
`;
          result += `${c8.name} ${c8.value}
`;
          return result;
        }).join("");
      }
    });
  }
});
function createFatalError(message, isJson, code, telemetryMessage) {
  if (isJson) {
    return new JsonFriendlyFatalError(
      JSON.stringify(message),
      code,
      telemetryMessage
    );
  } else {
    return new FatalError(`${message}`, code, telemetryMessage);
  }
}
function createScanner(text, ignoreTrivia = false) {
  const len = text.length;
  let pos = 0, value = "", tokenOffset = 0, token = 16, lineNumber = 0, lineStartOffset = 0, tokenLineStartOffset = 0, prevTokenLineStartOffset = 0, scanError = 0;
  function scanHexDigits(count, exact) {
    let digits2 = 0;
    let value2 = 0;
    while (digits2 < count || !exact) {
      let ch2 = text.charCodeAt(pos);
      if (ch2 >= 48 && ch2 <= 57) {
        value2 = value2 * 16 + ch2 - 48;
      } else if (ch2 >= 65 && ch2 <= 70) {
        value2 = value2 * 16 + ch2 - 65 + 10;
      } else if (ch2 >= 97 && ch2 <= 102) {
        value2 = value2 * 16 + ch2 - 97 + 10;
      } else {
        break;
      }
      pos++;
      digits2++;
    }
    if (digits2 < count) {
      value2 = -1;
    }
    return value2;
  }
  __name(scanHexDigits, "scanHexDigits");
  __name2(scanHexDigits, "scanHexDigits");
  function setPosition(newPosition) {
    pos = newPosition;
    value = "";
    tokenOffset = 0;
    token = 16;
    scanError = 0;
  }
  __name(setPosition, "setPosition");
  __name2(setPosition, "setPosition");
  function scanNumber() {
    let start = pos;
    if (text.charCodeAt(pos) === 48) {
      pos++;
    } else {
      pos++;
      while (pos < text.length && isDigit(text.charCodeAt(pos))) {
        pos++;
      }
    }
    if (pos < text.length && text.charCodeAt(pos) === 46) {
      pos++;
      if (pos < text.length && isDigit(text.charCodeAt(pos))) {
        pos++;
        while (pos < text.length && isDigit(text.charCodeAt(pos))) {
          pos++;
        }
      } else {
        scanError = 3;
        return text.substring(start, pos);
      }
    }
    let end = pos;
    if (pos < text.length && (text.charCodeAt(pos) === 69 || text.charCodeAt(pos) === 101)) {
      pos++;
      if (pos < text.length && text.charCodeAt(pos) === 43 || text.charCodeAt(pos) === 45) {
        pos++;
      }
      if (pos < text.length && isDigit(text.charCodeAt(pos))) {
        pos++;
        while (pos < text.length && isDigit(text.charCodeAt(pos))) {
          pos++;
        }
        end = pos;
      } else {
        scanError = 3;
      }
    }
    return text.substring(start, end);
  }
  __name(scanNumber, "scanNumber");
  __name2(scanNumber, "scanNumber");
  function scanString() {
    let result = "", start = pos;
    while (true) {
      if (pos >= len) {
        result += text.substring(start, pos);
        scanError = 2;
        break;
      }
      const ch2 = text.charCodeAt(pos);
      if (ch2 === 34) {
        result += text.substring(start, pos);
        pos++;
        break;
      }
      if (ch2 === 92) {
        result += text.substring(start, pos);
        pos++;
        if (pos >= len) {
          scanError = 2;
          break;
        }
        const ch22 = text.charCodeAt(pos++);
        switch (ch22) {
          case 34:
            result += '"';
            break;
          case 92:
            result += "\\";
            break;
          case 47:
            result += "/";
            break;
          case 98:
            result += "\b";
            break;
          case 102:
            result += "\f";
            break;
          case 110:
            result += "\n";
            break;
          case 114:
            result += "\r";
            break;
          case 116:
            result += "	";
            break;
          case 117:
            const ch3 = scanHexDigits(4, true);
            if (ch3 >= 0) {
              result += String.fromCharCode(ch3);
            } else {
              scanError = 4;
            }
            break;
          default:
            scanError = 5;
        }
        start = pos;
        continue;
      }
      if (ch2 >= 0 && ch2 <= 31) {
        if (isLineBreak(ch2)) {
          result += text.substring(start, pos);
          scanError = 2;
          break;
        } else {
          scanError = 6;
        }
      }
      pos++;
    }
    return result;
  }
  __name(scanString, "scanString");
  __name2(scanString, "scanString");
  function scanNext() {
    value = "";
    scanError = 0;
    tokenOffset = pos;
    lineStartOffset = lineNumber;
    prevTokenLineStartOffset = tokenLineStartOffset;
    if (pos >= len) {
      tokenOffset = len;
      return token = 17;
    }
    let code = text.charCodeAt(pos);
    if (isWhiteSpace(code)) {
      do {
        pos++;
        value += String.fromCharCode(code);
        code = text.charCodeAt(pos);
      } while (isWhiteSpace(code));
      return token = 15;
    }
    if (isLineBreak(code)) {
      pos++;
      value += String.fromCharCode(code);
      if (code === 13 && text.charCodeAt(pos) === 10) {
        pos++;
        value += "\n";
      }
      lineNumber++;
      tokenLineStartOffset = pos;
      return token = 14;
    }
    switch (code) {
      // tokens: []{}:,
      case 123:
        pos++;
        return token = 1;
      case 125:
        pos++;
        return token = 2;
      case 91:
        pos++;
        return token = 3;
      case 93:
        pos++;
        return token = 4;
      case 58:
        pos++;
        return token = 6;
      case 44:
        pos++;
        return token = 5;
      // strings
      case 34:
        pos++;
        value = scanString();
        return token = 10;
      // comments
      case 47:
        const start = pos - 1;
        if (text.charCodeAt(pos + 1) === 47) {
          pos += 2;
          while (pos < len) {
            if (isLineBreak(text.charCodeAt(pos))) {
              break;
            }
            pos++;
          }
          value = text.substring(start, pos);
          return token = 12;
        }
        if (text.charCodeAt(pos + 1) === 42) {
          pos += 2;
          const safeLength = len - 1;
          let commentClosed = false;
          while (pos < safeLength) {
            const ch2 = text.charCodeAt(pos);
            if (ch2 === 42 && text.charCodeAt(pos + 1) === 47) {
              pos += 2;
              commentClosed = true;
              break;
            }
            pos++;
            if (isLineBreak(ch2)) {
              if (ch2 === 13 && text.charCodeAt(pos) === 10) {
                pos++;
              }
              lineNumber++;
              tokenLineStartOffset = pos;
            }
          }
          if (!commentClosed) {
            pos++;
            scanError = 1;
          }
          value = text.substring(start, pos);
          return token = 13;
        }
        value += String.fromCharCode(code);
        pos++;
        return token = 16;
      // numbers
      case 45:
        value += String.fromCharCode(code);
        pos++;
        if (pos === len || !isDigit(text.charCodeAt(pos))) {
          return token = 16;
        }
      // found a minus, followed by a number so
      // we fall through to proceed with scanning
      // numbers
      case 48:
      case 49:
      case 50:
      case 51:
      case 52:
      case 53:
      case 54:
      case 55:
      case 56:
      case 57:
        value += scanNumber();
        return token = 11;
      // literals and unknown symbols
      default:
        while (pos < len && isUnknownContentCharacter(code)) {
          pos++;
          code = text.charCodeAt(pos);
        }
        if (tokenOffset !== pos) {
          value = text.substring(tokenOffset, pos);
          switch (value) {
            case "true":
              return token = 8;
            case "false":
              return token = 9;
            case "null":
              return token = 7;
          }
          return token = 16;
        }
        value += String.fromCharCode(code);
        pos++;
        return token = 16;
    }
  }
  __name(scanNext, "scanNext");
  __name2(scanNext, "scanNext");
  function isUnknownContentCharacter(code) {
    if (isWhiteSpace(code) || isLineBreak(code)) {
      return false;
    }
    switch (code) {
      case 125:
      case 93:
      case 123:
      case 91:
      case 34:
      case 58:
      case 44:
      case 47:
        return false;
    }
    return true;
  }
  __name(isUnknownContentCharacter, "isUnknownContentCharacter");
  __name2(isUnknownContentCharacter, "isUnknownContentCharacter");
  function scanNextNonTrivia() {
    let result;
    do {
      result = scanNext();
    } while (result >= 12 && result <= 15);
    return result;
  }
  __name(scanNextNonTrivia, "scanNextNonTrivia");
  __name2(scanNextNonTrivia, "scanNextNonTrivia");
  return {
    setPosition,
    getPosition: /* @__PURE__ */ __name2(() => pos, "getPosition"),
    scan: ignoreTrivia ? scanNextNonTrivia : scanNext,
    getToken: /* @__PURE__ */ __name2(() => token, "getToken"),
    getTokenValue: /* @__PURE__ */ __name2(() => value, "getTokenValue"),
    getTokenOffset: /* @__PURE__ */ __name2(() => tokenOffset, "getTokenOffset"),
    getTokenLength: /* @__PURE__ */ __name2(() => pos - tokenOffset, "getTokenLength"),
    getTokenStartLine: /* @__PURE__ */ __name2(() => lineStartOffset, "getTokenStartLine"),
    getTokenStartCharacter: /* @__PURE__ */ __name2(() => tokenOffset - prevTokenLineStartOffset, "getTokenStartCharacter"),
    getTokenError: /* @__PURE__ */ __name2(() => scanError, "getTokenError")
  };
}
function isWhiteSpace(ch2) {
  return ch2 === 32 || ch2 === 9;
}
function isLineBreak(ch2) {
  return ch2 === 10 || ch2 === 13;
}
function isDigit(ch2) {
  return ch2 >= 48 && ch2 <= 57;
}
function format(documentText, range, options) {
  let initialIndentLevel;
  let formatText;
  let formatTextStart;
  let rangeStart;
  let rangeEnd;
  if (range) {
    rangeStart = range.offset;
    rangeEnd = rangeStart + range.length;
    formatTextStart = rangeStart;
    while (formatTextStart > 0 && !isEOL(documentText, formatTextStart - 1)) {
      formatTextStart--;
    }
    let endOffset = rangeEnd;
    while (endOffset < documentText.length && !isEOL(documentText, endOffset)) {
      endOffset++;
    }
    formatText = documentText.substring(formatTextStart, endOffset);
    initialIndentLevel = computeIndentLevel(formatText, options);
  } else {
    formatText = documentText;
    initialIndentLevel = 0;
    formatTextStart = 0;
    rangeStart = 0;
    rangeEnd = documentText.length;
  }
  const eol = getEOL(options, documentText);
  let numberLineBreaks = 0;
  let indentLevel = 0;
  let indentValue;
  if (options.insertSpaces) {
    indentValue = repeat(" ", options.tabSize || 4);
  } else {
    indentValue = "	";
  }
  let scanner = createScanner(formatText, false);
  let hasError = false;
  function newLinesAndIndent() {
    if (numberLineBreaks > 1) {
      return repeat(eol, numberLineBreaks) + repeat(indentValue, initialIndentLevel + indentLevel);
    } else {
      return eol + repeat(indentValue, initialIndentLevel + indentLevel);
    }
  }
  __name(newLinesAndIndent, "newLinesAndIndent");
  __name2(newLinesAndIndent, "newLinesAndIndent");
  function scanNext() {
    let token = scanner.scan();
    numberLineBreaks = 0;
    while (token === 15 || token === 14) {
      if (token === 14 && options.keepLines) {
        numberLineBreaks += 1;
      } else if (token === 14) {
        numberLineBreaks = 1;
      }
      token = scanner.scan();
    }
    hasError = token === 16 || scanner.getTokenError() !== 0;
    return token;
  }
  __name(scanNext, "scanNext");
  __name2(scanNext, "scanNext");
  const editOperations = [];
  function addEdit(text, startOffset, endOffset) {
    if (!hasError && (!range || startOffset < rangeEnd && endOffset > rangeStart) && documentText.substring(startOffset, endOffset) !== text) {
      editOperations.push({ offset: startOffset, length: endOffset - startOffset, content: text });
    }
  }
  __name(addEdit, "addEdit");
  __name2(addEdit, "addEdit");
  let firstToken = scanNext();
  if (options.keepLines && numberLineBreaks > 0) {
    addEdit(repeat(eol, numberLineBreaks), 0, 0);
  }
  if (firstToken !== 17) {
    let firstTokenStart = scanner.getTokenOffset() + formatTextStart;
    let initialIndent = repeat(indentValue, initialIndentLevel);
    addEdit(initialIndent, formatTextStart, firstTokenStart);
  }
  while (firstToken !== 17) {
    let firstTokenEnd = scanner.getTokenOffset() + scanner.getTokenLength() + formatTextStart;
    let secondToken = scanNext();
    let replaceContent = "";
    let needsLineBreak = false;
    while (numberLineBreaks === 0 && (secondToken === 12 || secondToken === 13)) {
      let commentTokenStart = scanner.getTokenOffset() + formatTextStart;
      addEdit(" ", firstTokenEnd, commentTokenStart);
      firstTokenEnd = scanner.getTokenOffset() + scanner.getTokenLength() + formatTextStart;
      needsLineBreak = secondToken === 12;
      replaceContent = needsLineBreak ? newLinesAndIndent() : "";
      secondToken = scanNext();
    }
    if (secondToken === 2) {
      if (firstToken !== 1) {
        indentLevel--;
      }
      if (options.keepLines && numberLineBreaks > 0 || !options.keepLines && firstToken !== 1) {
        replaceContent = newLinesAndIndent();
      } else if (options.keepLines) {
        replaceContent = " ";
      }
    } else if (secondToken === 4) {
      if (firstToken !== 3) {
        indentLevel--;
      }
      if (options.keepLines && numberLineBreaks > 0 || !options.keepLines && firstToken !== 3) {
        replaceContent = newLinesAndIndent();
      } else if (options.keepLines) {
        replaceContent = " ";
      }
    } else {
      switch (firstToken) {
        case 3:
        case 1:
          indentLevel++;
          if (options.keepLines && numberLineBreaks > 0 || !options.keepLines) {
            replaceContent = newLinesAndIndent();
          } else {
            replaceContent = " ";
          }
          break;
        case 5:
          if (options.keepLines && numberLineBreaks > 0 || !options.keepLines) {
            replaceContent = newLinesAndIndent();
          } else {
            replaceContent = " ";
          }
          break;
        case 12:
          replaceContent = newLinesAndIndent();
          break;
        case 13:
          if (numberLineBreaks > 0) {
            replaceContent = newLinesAndIndent();
          } else if (!needsLineBreak) {
            replaceContent = " ";
          }
          break;
        case 6:
          if (options.keepLines && numberLineBreaks > 0) {
            replaceContent = newLinesAndIndent();
          } else if (!needsLineBreak) {
            replaceContent = " ";
          }
          break;
        case 10:
          if (options.keepLines && numberLineBreaks > 0) {
            replaceContent = newLinesAndIndent();
          } else if (secondToken === 6 && !needsLineBreak) {
            replaceContent = "";
          }
          break;
        case 7:
        case 8:
        case 9:
        case 11:
        case 2:
        case 4:
          if (options.keepLines && numberLineBreaks > 0) {
            replaceContent = newLinesAndIndent();
          } else {
            if ((secondToken === 12 || secondToken === 13) && !needsLineBreak) {
              replaceContent = " ";
            } else if (secondToken !== 5 && secondToken !== 17) {
              hasError = true;
            }
          }
          break;
        case 16:
          hasError = true;
          break;
      }
      if (numberLineBreaks > 0 && (secondToken === 12 || secondToken === 13)) {
        replaceContent = newLinesAndIndent();
      }
    }
    if (secondToken === 17) {
      if (options.keepLines && numberLineBreaks > 0) {
        replaceContent = newLinesAndIndent();
      } else {
        replaceContent = options.insertFinalNewline ? eol : "";
      }
    }
    const secondTokenStart = scanner.getTokenOffset() + formatTextStart;
    addEdit(replaceContent, firstTokenEnd, secondTokenStart);
    firstToken = secondToken;
  }
  return editOperations;
}
function repeat(s7, count) {
  let result = "";
  for (let i7 = 0; i7 < count; i7++) {
    result += s7;
  }
  return result;
}
function computeIndentLevel(content, options) {
  let i7 = 0;
  let nChars = 0;
  const tabSize = options.tabSize || 4;
  while (i7 < content.length) {
    let ch2 = content.charAt(i7);
    if (ch2 === " ") {
      nChars++;
    } else if (ch2 === "	") {
      nChars += tabSize;
    } else {
      break;
    }
    i7++;
  }
  return Math.floor(nChars / tabSize);
}
function getEOL(options, text) {
  for (let i7 = 0; i7 < text.length; i7++) {
    const ch2 = text.charAt(i7);
    if (ch2 === "\r") {
      if (i7 + 1 < text.length && text.charAt(i7 + 1) === "\n") {
        return "\r\n";
      }
      return "\r";
    } else if (ch2 === "\n") {
      return "\n";
    }
  }
  return options && options.eol || "\n";
}
function isEOL(text, offset) {
  return "\r\n".indexOf(text.charAt(offset)) !== -1;
}
function parse(text, errors = [], options = ParseOptions.DEFAULT) {
  let currentProperty = null;
  let currentParent = [];
  const previousParents = [];
  function onValue(value) {
    if (Array.isArray(currentParent)) {
      currentParent.push(value);
    } else if (currentProperty !== null) {
      currentParent[currentProperty] = value;
    }
  }
  __name(onValue, "onValue");
  __name2(onValue, "onValue");
  const visitor = {
    onObjectBegin: /* @__PURE__ */ __name2(() => {
      const object = {};
      onValue(object);
      previousParents.push(currentParent);
      currentParent = object;
      currentProperty = null;
    }, "onObjectBegin"),
    onObjectProperty: /* @__PURE__ */ __name2((name2) => {
      currentProperty = name2;
    }, "onObjectProperty"),
    onObjectEnd: /* @__PURE__ */ __name2(() => {
      currentParent = previousParents.pop();
    }, "onObjectEnd"),
    onArrayBegin: /* @__PURE__ */ __name2(() => {
      const array = [];
      onValue(array);
      previousParents.push(currentParent);
      currentParent = array;
      currentProperty = null;
    }, "onArrayBegin"),
    onArrayEnd: /* @__PURE__ */ __name2(() => {
      currentParent = previousParents.pop();
    }, "onArrayEnd"),
    onLiteralValue: onValue,
    onError: /* @__PURE__ */ __name2((error2, offset, length) => {
      errors.push({ error: error2, offset, length });
    }, "onError")
  };
  visit(text, visitor, options);
  return currentParent[0];
}
function parseTree(text, errors = [], options = ParseOptions.DEFAULT) {
  let currentParent = { type: "array", offset: -1, length: -1, children: [], parent: void 0 };
  function ensurePropertyComplete(endOffset) {
    if (currentParent.type === "property") {
      currentParent.length = endOffset - currentParent.offset;
      currentParent = currentParent.parent;
    }
  }
  __name(ensurePropertyComplete, "ensurePropertyComplete");
  __name2(ensurePropertyComplete, "ensurePropertyComplete");
  function onValue(valueNode) {
    currentParent.children.push(valueNode);
    return valueNode;
  }
  __name(onValue, "onValue");
  __name2(onValue, "onValue");
  const visitor = {
    onObjectBegin: /* @__PURE__ */ __name2((offset) => {
      currentParent = onValue({ type: "object", offset, length: -1, parent: currentParent, children: [] });
    }, "onObjectBegin"),
    onObjectProperty: /* @__PURE__ */ __name2((name2, offset, length) => {
      currentParent = onValue({ type: "property", offset, length: -1, parent: currentParent, children: [] });
      currentParent.children.push({ type: "string", value: name2, offset, length, parent: currentParent });
    }, "onObjectProperty"),
    onObjectEnd: /* @__PURE__ */ __name2((offset, length) => {
      ensurePropertyComplete(offset + length);
      currentParent.length = offset + length - currentParent.offset;
      currentParent = currentParent.parent;
      ensurePropertyComplete(offset + length);
    }, "onObjectEnd"),
    onArrayBegin: /* @__PURE__ */ __name2((offset, length) => {
      currentParent = onValue({ type: "array", offset, length: -1, parent: currentParent, children: [] });
    }, "onArrayBegin"),
    onArrayEnd: /* @__PURE__ */ __name2((offset, length) => {
      currentParent.length = offset + length - currentParent.offset;
      currentParent = currentParent.parent;
      ensurePropertyComplete(offset + length);
    }, "onArrayEnd"),
    onLiteralValue: /* @__PURE__ */ __name2((value, offset, length) => {
      onValue({ type: getNodeType(value), offset, length, parent: currentParent, value });
      ensurePropertyComplete(offset + length);
    }, "onLiteralValue"),
    onSeparator: /* @__PURE__ */ __name2((sep6, offset, length) => {
      if (currentParent.type === "property") {
        if (sep6 === ":") {
          currentParent.colonOffset = offset;
        } else if (sep6 === ",") {
          ensurePropertyComplete(offset);
        }
      }
    }, "onSeparator"),
    onError: /* @__PURE__ */ __name2((error2, offset, length) => {
      errors.push({ error: error2, offset, length });
    }, "onError")
  };
  visit(text, visitor, options);
  const result = currentParent.children[0];
  if (result) {
    delete result.parent;
  }
  return result;
}
function findNodeAtLocation(root, path210) {
  if (!root) {
    return void 0;
  }
  let node2 = root;
  for (let segment of path210) {
    if (typeof segment === "string") {
      if (node2.type !== "object" || !Array.isArray(node2.children)) {
        return void 0;
      }
      let found = false;
      for (const propertyNode of node2.children) {
        if (Array.isArray(propertyNode.children) && propertyNode.children[0].value === segment && propertyNode.children.length === 2) {
          node2 = propertyNode.children[1];
          found = true;
          break;
        }
      }
      if (!found) {
        return void 0;
      }
    } else {
      const index = segment;
      if (node2.type !== "array" || index < 0 || !Array.isArray(node2.children) || index >= node2.children.length) {
        return void 0;
      }
      node2 = node2.children[index];
    }
  }
  return node2;
}
function visit(text, visitor, options = ParseOptions.DEFAULT) {
  const _scanner = createScanner(text, false);
  const _jsonPath = [];
  function toNoArgVisit(visitFunction) {
    return visitFunction ? () => visitFunction(_scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter()) : () => true;
  }
  __name(toNoArgVisit, "toNoArgVisit");
  __name2(toNoArgVisit, "toNoArgVisit");
  function toNoArgVisitWithPath(visitFunction) {
    return visitFunction ? () => visitFunction(_scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter(), () => _jsonPath.slice()) : () => true;
  }
  __name(toNoArgVisitWithPath, "toNoArgVisitWithPath");
  __name2(toNoArgVisitWithPath, "toNoArgVisitWithPath");
  function toOneArgVisit(visitFunction) {
    return visitFunction ? (arg) => visitFunction(arg, _scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter()) : () => true;
  }
  __name(toOneArgVisit, "toOneArgVisit");
  __name2(toOneArgVisit, "toOneArgVisit");
  function toOneArgVisitWithPath(visitFunction) {
    return visitFunction ? (arg) => visitFunction(arg, _scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter(), () => _jsonPath.slice()) : () => true;
  }
  __name(toOneArgVisitWithPath, "toOneArgVisitWithPath");
  __name2(toOneArgVisitWithPath, "toOneArgVisitWithPath");
  const onObjectBegin = toNoArgVisitWithPath(visitor.onObjectBegin), onObjectProperty = toOneArgVisitWithPath(visitor.onObjectProperty), onObjectEnd = toNoArgVisit(visitor.onObjectEnd), onArrayBegin = toNoArgVisitWithPath(visitor.onArrayBegin), onArrayEnd = toNoArgVisit(visitor.onArrayEnd), onLiteralValue = toOneArgVisitWithPath(visitor.onLiteralValue), onSeparator = toOneArgVisit(visitor.onSeparator), onComment = toNoArgVisit(visitor.onComment), onError = toOneArgVisit(visitor.onError);
  const disallowComments = options && options.disallowComments;
  const allowTrailingComma = options && options.allowTrailingComma;
  function scanNext() {
    while (true) {
      const token = _scanner.scan();
      switch (_scanner.getTokenError()) {
        case 4:
          handleError2(
            14
            /* ParseErrorCode.InvalidUnicode */
          );
          break;
        case 5:
          handleError2(
            15
            /* ParseErrorCode.InvalidEscapeCharacter */
          );
          break;
        case 3:
          handleError2(
            13
            /* ParseErrorCode.UnexpectedEndOfNumber */
          );
          break;
        case 1:
          if (!disallowComments) {
            handleError2(
              11
              /* ParseErrorCode.UnexpectedEndOfComment */
            );
          }
          break;
        case 2:
          handleError2(
            12
            /* ParseErrorCode.UnexpectedEndOfString */
          );
          break;
        case 6:
          handleError2(
            16
            /* ParseErrorCode.InvalidCharacter */
          );
          break;
      }
      switch (token) {
        case 12:
        case 13:
          if (disallowComments) {
            handleError2(
              10
              /* ParseErrorCode.InvalidCommentToken */
            );
          } else {
            onComment();
          }
          break;
        case 16:
          handleError2(
            1
            /* ParseErrorCode.InvalidSymbol */
          );
          break;
        case 15:
        case 14:
          break;
        default:
          return token;
      }
    }
  }
  __name(scanNext, "scanNext");
  __name2(scanNext, "scanNext");
  function handleError2(error2, skipUntilAfter = [], skipUntil22 = []) {
    onError(error2);
    if (skipUntilAfter.length + skipUntil22.length > 0) {
      let token = _scanner.getToken();
      while (token !== 17) {
        if (skipUntilAfter.indexOf(token) !== -1) {
          scanNext();
          break;
        } else if (skipUntil22.indexOf(token) !== -1) {
          break;
        }
        token = scanNext();
      }
    }
  }
  __name(handleError2, "handleError");
  __name2(handleError2, "handleError");
  function parseString22(isValue) {
    const value = _scanner.getTokenValue();
    if (isValue) {
      onLiteralValue(value);
    } else {
      onObjectProperty(value);
      _jsonPath.push(value);
    }
    scanNext();
    return true;
  }
  __name(parseString22, "parseString2");
  __name2(parseString22, "parseString");
  function parseLiteral() {
    switch (_scanner.getToken()) {
      case 11:
        const tokenValue = _scanner.getTokenValue();
        let value = Number(tokenValue);
        if (isNaN(value)) {
          handleError2(
            2
            /* ParseErrorCode.InvalidNumberFormat */
          );
          value = 0;
        }
        onLiteralValue(value);
        break;
      case 7:
        onLiteralValue(null);
        break;
      case 8:
        onLiteralValue(true);
        break;
      case 9:
        onLiteralValue(false);
        break;
      default:
        return false;
    }
    scanNext();
    return true;
  }
  __name(parseLiteral, "parseLiteral");
  __name2(parseLiteral, "parseLiteral");
  function parseProperty() {
    if (_scanner.getToken() !== 10) {
      handleError2(3, [], [
        2,
        5
        /* SyntaxKind.CommaToken */
      ]);
      return false;
    }
    parseString22(false);
    if (_scanner.getToken() === 6) {
      onSeparator(":");
      scanNext();
      if (!parseValue22()) {
        handleError2(4, [], [
          2,
          5
          /* SyntaxKind.CommaToken */
        ]);
      }
    } else {
      handleError2(5, [], [
        2,
        5
        /* SyntaxKind.CommaToken */
      ]);
    }
    _jsonPath.pop();
    return true;
  }
  __name(parseProperty, "parseProperty");
  __name2(parseProperty, "parseProperty");
  function parseObject() {
    onObjectBegin();
    scanNext();
    let needsComma = false;
    while (_scanner.getToken() !== 2 && _scanner.getToken() !== 17) {
      if (_scanner.getToken() === 5) {
        if (!needsComma) {
          handleError2(4, [], []);
        }
        onSeparator(",");
        scanNext();
        if (_scanner.getToken() === 2 && allowTrailingComma) {
          break;
        }
      } else if (needsComma) {
        handleError2(6, [], []);
      }
      if (!parseProperty()) {
        handleError2(4, [], [
          2,
          5
          /* SyntaxKind.CommaToken */
        ]);
      }
      needsComma = true;
    }
    onObjectEnd();
    if (_scanner.getToken() !== 2) {
      handleError2(7, [
        2
        /* SyntaxKind.CloseBraceToken */
      ], []);
    } else {
      scanNext();
    }
    return true;
  }
  __name(parseObject, "parseObject");
  __name2(parseObject, "parseObject");
  function parseArray22() {
    onArrayBegin();
    scanNext();
    let isFirstElement = true;
    let needsComma = false;
    while (_scanner.getToken() !== 4 && _scanner.getToken() !== 17) {
      if (_scanner.getToken() === 5) {
        if (!needsComma) {
          handleError2(4, [], []);
        }
        onSeparator(",");
        scanNext();
        if (_scanner.getToken() === 4 && allowTrailingComma) {
          break;
        }
      } else if (needsComma) {
        handleError2(6, [], []);
      }
      if (isFirstElement) {
        _jsonPath.push(0);
        isFirstElement = false;
      } else {
        _jsonPath[_jsonPath.length - 1]++;
      }
      if (!parseValue22()) {
        handleError2(4, [], [
          4,
          5
          /* SyntaxKind.CommaToken */
        ]);
      }
      needsComma = true;
    }
    onArrayEnd();
    if (!isFirstElement) {
      _jsonPath.pop();
    }
    if (_scanner.getToken() !== 4) {
      handleError2(8, [
        4
        /* SyntaxKind.CloseBracketToken */
      ], []);
    } else {
      scanNext();
    }
    return true;
  }
  __name(parseArray22, "parseArray2");
  __name2(parseArray22, "parseArray");
  function parseValue22() {
    switch (_scanner.getToken()) {
      case 3:
        return parseArray22();
      case 1:
        return parseObject();
      case 10:
        return parseString22(true);
      default:
        return parseLiteral();
    }
  }
  __name(parseValue22, "parseValue2");
  __name2(parseValue22, "parseValue");
  scanNext();
  if (_scanner.getToken() === 17) {
    if (options.allowEmptyContent) {
      return true;
    }
    handleError2(4, [], []);
    return false;
  }
  if (!parseValue22()) {
    handleError2(4, [], []);
    return false;
  }
  if (_scanner.getToken() !== 17) {
    handleError2(9, [], []);
  }
  return true;
}
function getNodeType(value) {
  switch (typeof value) {
    case "boolean":
      return "boolean";
    case "number":
      return "number";
    case "string":
      return "string";
    case "object": {
      if (!value) {
        return "null";
      } else if (Array.isArray(value)) {
        return "array";
      }
      return "object";
    }
    default:
      return "null";
  }
}
function setProperty(text, originalPath, value, options) {
  const path210 = originalPath.slice();
  const errors = [];
  const root = parseTree(text, errors);
  let parent = void 0;
  let lastSegment = void 0;
  while (path210.length > 0) {
    lastSegment = path210.pop();
    parent = findNodeAtLocation(root, path210);
    if (parent === void 0 && value !== void 0) {
      if (typeof lastSegment === "string") {
        value = { [lastSegment]: value };
      } else {
        value = [value];
      }
    } else {
      break;
    }
  }
  if (!parent) {
    if (value === void 0) {
      throw new Error("Can not delete in empty document");
    }
    return withFormatting(text, { offset: root ? root.offset : 0, length: root ? root.length : 0, content: JSON.stringify(value) }, options);
  } else if (parent.type === "object" && typeof lastSegment === "string" && Array.isArray(parent.children)) {
    const existing = findNodeAtLocation(parent, [lastSegment]);
    if (existing !== void 0) {
      if (value === void 0) {
        if (!existing.parent) {
          throw new Error("Malformed AST");
        }
        const propertyIndex = parent.children.indexOf(existing.parent);
        let removeBegin;
        let removeEnd = existing.parent.offset + existing.parent.length;
        if (propertyIndex > 0) {
          let previous = parent.children[propertyIndex - 1];
          removeBegin = previous.offset + previous.length;
        } else {
          removeBegin = parent.offset + 1;
          if (parent.children.length > 1) {
            let next = parent.children[1];
            removeEnd = next.offset;
          }
        }
        return withFormatting(text, { offset: removeBegin, length: removeEnd - removeBegin, content: "" }, options);
      } else {
        return withFormatting(text, { offset: existing.offset, length: existing.length, content: JSON.stringify(value) }, options);
      }
    } else {
      if (value === void 0) {
        return [];
      }
      const newProperty = `${JSON.stringify(lastSegment)}: ${JSON.stringify(value)}`;
      const index = options.getInsertionIndex ? options.getInsertionIndex(parent.children.map((p7) => p7.children[0].value)) : parent.children.length;
      let edit;
      if (index > 0) {
        let previous = parent.children[index - 1];
        edit = { offset: previous.offset + previous.length, length: 0, content: "," + newProperty };
      } else if (parent.children.length === 0) {
        edit = { offset: parent.offset + 1, length: 0, content: newProperty };
      } else {
        edit = { offset: parent.offset + 1, length: 0, content: newProperty + "," };
      }
      return withFormatting(text, edit, options);
    }
  } else if (parent.type === "array" && typeof lastSegment === "number" && Array.isArray(parent.children)) {
    const insertIndex = lastSegment;
    if (insertIndex === -1) {
      const newProperty = `${JSON.stringify(value)}`;
      let edit;
      if (parent.children.length === 0) {
        edit = { offset: parent.offset + 1, length: 0, content: newProperty };
      } else {
        const previous = parent.children[parent.children.length - 1];
        edit = { offset: previous.offset + previous.length, length: 0, content: "," + newProperty };
      }
      return withFormatting(text, edit, options);
    } else if (value === void 0 && parent.children.length >= 0) {
      const removalIndex = lastSegment;
      const toRemove = parent.children[removalIndex];
      let edit;
      if (parent.children.length === 1) {
        edit = { offset: parent.offset + 1, length: parent.length - 2, content: "" };
      } else if (parent.children.length - 1 === removalIndex) {
        let previous = parent.children[removalIndex - 1];
        let offset = previous.offset + previous.length;
        let parentEndOffset = parent.offset + parent.length;
        edit = { offset, length: parentEndOffset - 2 - offset, content: "" };
      } else {
        edit = { offset: toRemove.offset, length: parent.children[removalIndex + 1].offset - toRemove.offset, content: "" };
      }
      return withFormatting(text, edit, options);
    } else if (value !== void 0) {
      let edit;
      const newProperty = `${JSON.stringify(value)}`;
      if (!options.isArrayInsertion && parent.children.length > lastSegment) {
        const toModify = parent.children[lastSegment];
        edit = { offset: toModify.offset, length: toModify.length, content: newProperty };
      } else if (parent.children.length === 0 || lastSegment === 0) {
        edit = { offset: parent.offset + 1, length: 0, content: parent.children.length === 0 ? newProperty : newProperty + "," };
      } else {
        const index = lastSegment > parent.children.length ? parent.children.length : lastSegment;
        const previous = parent.children[index - 1];
        edit = { offset: previous.offset + previous.length, length: 0, content: "," + newProperty };
      }
      return withFormatting(text, edit, options);
    } else {
      throw new Error(`Can not ${value === void 0 ? "remove" : options.isArrayInsertion ? "insert" : "modify"} Array index ${insertIndex} as length is not sufficient`);
    }
  } else {
    throw new Error(`Can not add ${typeof lastSegment !== "number" ? "index" : "property"} to parent of type ${parent.type}`);
  }
}
function withFormatting(text, edit, options) {
  if (!options.formattingOptions) {
    return [edit];
  }
  let newText = applyEdit(text, edit);
  let begin = edit.offset;
  let end = edit.offset + edit.content.length;
  if (edit.length === 0 || edit.content.length === 0) {
    while (begin > 0 && !isEOL(newText, begin - 1)) {
      begin--;
    }
    while (end < newText.length && !isEOL(newText, end)) {
      end++;
    }
  }
  const edits = format(newText, { offset: begin, length: end - begin }, { ...options.formattingOptions, keepLines: false });
  for (let i7 = edits.length - 1; i7 >= 0; i7--) {
    const edit2 = edits[i7];
    newText = applyEdit(newText, edit2);
    begin = Math.min(begin, edit2.offset);
    end = Math.max(end, edit2.offset + edit2.length);
    end += edit2.content.length - edit2.length;
  }
  const editLength = text.length - (newText.length - end) - begin;
  return [{ offset: begin, length: editLength, content: newText.substring(begin, end) }];
}
function applyEdit(text, edit) {
  return text.substring(0, edit.offset) + edit.content + text.substring(edit.offset + edit.length);
}
function printParseErrorCode(code) {
  switch (code) {
    case 1:
      return "InvalidSymbol";
    case 2:
      return "InvalidNumberFormat";
    case 3:
      return "PropertyNameExpected";
    case 4:
      return "ValueExpected";
    case 5:
      return "ColonExpected";
    case 6:
      return "CommaExpected";
    case 7:
      return "CloseBraceExpected";
    case 8:
      return "CloseBracketExpected";
    case 9:
      return "EndOfFileExpected";
    case 10:
      return "InvalidCommentToken";
    case 11:
      return "UnexpectedEndOfComment";
    case 12:
      return "UnexpectedEndOfString";
    case 13:
      return "UnexpectedEndOfNumber";
    case 14:
      return "InvalidUnicode";
    case 15:
      return "InvalidEscapeCharacter";
    case 16:
      return "InvalidCharacter";
  }
  return "<unknown ParseErrorCode>";
}
function format2(documentText, range, options) {
  return format(documentText, range, options);
}
function modify(text, path210, value, options) {
  return setProperty(text, path210, value, options);
}
function applyEdits(text, edits) {
  let sortedEdits = edits.slice(0).sort((a7, b11) => {
    const diff = a7.offset - b11.offset;
    if (diff === 0) {
      return a7.length - b11.length;
    }
    return diff;
  });
  let lastModifiedOffset = text.length;
  for (let i7 = sortedEdits.length - 1; i7 >= 0; i7--) {
    let e10 = sortedEdits[i7];
    if (e10.offset + e10.length <= lastModifiedOffset) {
      text = applyEdit(text, e10);
    } else {
      throw new Error("Overlapping edit");
    }
    lastModifiedOffset = e10.offset;
  }
  return text;
}
function getLineColFromPtr(string, ptr) {
  let lines = string.slice(0, ptr).split(/\r\n|\n|\r/g);
  return [lines.length, lines.pop().length + 1];
}
function makeCodeBlock(string, line, column) {
  let lines = string.split(/\r\n|\n|\r/g);
  let codeblock = "";
  let numberLen = (Math.log10(line + 1) | 0) + 1;
  for (let i7 = line - 1; i7 <= line + 1; i7++) {
    let l8 = lines[i7 - 1];
    if (!l8)
      continue;
    codeblock += i7.toString().padEnd(numberLen, " ");
    codeblock += ":  ";
    codeblock += l8;
    codeblock += "\n";
    if (i7 === line) {
      codeblock += " ".repeat(numberLen + column + 2);
      codeblock += "^\n";
    }
  }
  return codeblock;
}
function isEscaped(str, ptr) {
  let i7 = 0;
  while (str[ptr - ++i7] === "\\")
    ;
  return --i7 && i7 % 2;
}
function indexOfNewline(str, start = 0, end = str.length) {
  let idx = str.indexOf("\n", start);
  if (str[idx - 1] === "\r")
    idx--;
  return idx <= end ? idx : -1;
}
function skipComment(str, ptr) {
  for (let i7 = ptr; i7 < str.length; i7++) {
    let c8 = str[i7];
    if (c8 === "\n")
      return i7;
    if (c8 === "\r" && str[i7 + 1] === "\n")
      return i7 + 1;
    if (c8 < " " && c8 !== "	" || c8 === "\x7F") {
      throw new TomlError("control characters are not allowed in comments", {
        toml: str,
        ptr
      });
    }
  }
  return str.length;
}
function skipVoid(str, ptr, banNewLines, banComments) {
  let c8;
  while ((c8 = str[ptr]) === " " || c8 === "	" || !banNewLines && (c8 === "\n" || c8 === "\r" && str[ptr + 1] === "\n"))
    ptr++;
  return banComments || c8 !== "#" ? ptr : skipVoid(str, skipComment(str, ptr), banNewLines);
}
function skipUntil(str, ptr, sep6, end, banNewLines = false) {
  if (!end) {
    ptr = indexOfNewline(str, ptr);
    return ptr < 0 ? str.length : ptr;
  }
  for (let i7 = ptr; i7 < str.length; i7++) {
    let c8 = str[i7];
    if (c8 === "#") {
      i7 = indexOfNewline(str, i7);
    } else if (c8 === sep6) {
      return i7 + 1;
    } else if (c8 === end || banNewLines && (c8 === "\n" || c8 === "\r" && str[i7 + 1] === "\n")) {
      return i7;
    }
  }
  throw new TomlError("cannot find end of structure", {
    toml: str,
    ptr
  });
}
function getStringEnd(str, seek) {
  let first = str[seek];
  let target = first === str[seek + 1] && str[seek + 1] === str[seek + 2] ? str.slice(seek, seek + 3) : first;
  seek += target.length - 1;
  do
    seek = str.indexOf(target, ++seek);
  while (seek > -1 && first !== "'" && isEscaped(str, seek));
  if (seek > -1) {
    seek += target.length;
    if (target.length > 1) {
      if (str[seek] === first)
        seek++;
      if (str[seek] === first)
        seek++;
    }
  }
  return seek;
}
function parseString(str, ptr = 0, endPtr = str.length) {
  let isLiteral = str[ptr] === "'";
  let isMultiline = str[ptr++] === str[ptr] && str[ptr] === str[ptr + 1];
  if (isMultiline) {
    endPtr -= 2;
    if (str[ptr += 2] === "\r")
      ptr++;
    if (str[ptr] === "\n")
      ptr++;
  }
  let tmp = 0;
  let isEscape;
  let parsed = "";
  let sliceStart = ptr;
  while (ptr < endPtr - 1) {
    let c8 = str[ptr++];
    if (c8 === "\n" || c8 === "\r" && str[ptr] === "\n") {
      if (!isMultiline) {
        throw new TomlError("newlines are not allowed in strings", {
          toml: str,
          ptr: ptr - 1
        });
      }
    } else if (c8 < " " && c8 !== "	" || c8 === "\x7F") {
      throw new TomlError("control characters are not allowed in strings", {
        toml: str,
        ptr: ptr - 1
      });
    }
    if (isEscape) {
      isEscape = false;
      if (c8 === "u" || c8 === "U") {
        let code = str.slice(ptr, ptr += c8 === "u" ? 4 : 8);
        if (!ESCAPE_REGEX.test(code)) {
          throw new TomlError("invalid unicode escape", {
            toml: str,
            ptr: tmp
          });
        }
        try {
          parsed += String.fromCodePoint(parseInt(code, 16));
        } catch {
          throw new TomlError("invalid unicode escape", {
            toml: str,
            ptr: tmp
          });
        }
      } else if (isMultiline && (c8 === "\n" || c8 === " " || c8 === "	" || c8 === "\r")) {
        ptr = skipVoid(str, ptr - 1, true);
        if (str[ptr] !== "\n" && str[ptr] !== "\r") {
          throw new TomlError("invalid escape: only line-ending whitespace may be escaped", {
            toml: str,
            ptr: tmp
          });
        }
        ptr = skipVoid(str, ptr);
      } else if (c8 in ESC_MAP) {
        parsed += ESC_MAP[c8];
      } else {
        throw new TomlError("unrecognized escape sequence", {
          toml: str,
          ptr: tmp
        });
      }
      sliceStart = ptr;
    } else if (!isLiteral && c8 === "\\") {
      tmp = ptr - 1;
      isEscape = true;
      parsed += str.slice(sliceStart, tmp);
    }
  }
  return parsed + str.slice(sliceStart, endPtr - 1);
}
function parseValue(value, toml, ptr, integersAsBigInt) {
  if (value === "true")
    return true;
  if (value === "false")
    return false;
  if (value === "-inf")
    return -Infinity;
  if (value === "inf" || value === "+inf")
    return Infinity;
  if (value === "nan" || value === "+nan" || value === "-nan")
    return NaN;
  if (value === "-0")
    return integersAsBigInt ? 0n : 0;
  let isInt = INT_REGEX.test(value);
  if (isInt || FLOAT_REGEX.test(value)) {
    if (LEADING_ZERO.test(value)) {
      throw new TomlError("leading zeroes are not allowed", {
        toml,
        ptr
      });
    }
    value = value.replace(/_/g, "");
    let numeric = +value;
    if (isNaN(numeric)) {
      throw new TomlError("invalid number", {
        toml,
        ptr
      });
    }
    if (isInt) {
      if ((isInt = !Number.isSafeInteger(numeric)) && !integersAsBigInt) {
        throw new TomlError("integer value cannot be represented losslessly", {
          toml,
          ptr
        });
      }
      if (isInt || integersAsBigInt === true)
        numeric = BigInt(value);
    }
    return numeric;
  }
  const date = new TomlDate(value);
  if (!date.isValid()) {
    throw new TomlError("invalid value", {
      toml,
      ptr
    });
  }
  return date;
}
function sliceAndTrimEndOf(str, startPtr, endPtr, allowNewLines) {
  let value = str.slice(startPtr, endPtr);
  let commentIdx = value.indexOf("#");
  if (commentIdx > -1) {
    skipComment(str, commentIdx);
    value = value.slice(0, commentIdx);
  }
  let trimmed = value.trimEnd();
  if (!allowNewLines) {
    let newlineIdx = value.indexOf("\n", trimmed.length);
    if (newlineIdx > -1) {
      throw new TomlError("newlines are not allowed in inline tables", {
        toml: str,
        ptr: startPtr + newlineIdx
      });
    }
  }
  return [trimmed, commentIdx];
}
function extractValue(str, ptr, end, depth, integersAsBigInt) {
  if (depth === 0) {
    throw new TomlError("document contains excessively nested structures. aborting.", {
      toml: str,
      ptr
    });
  }
  let c8 = str[ptr];
  if (c8 === "[" || c8 === "{") {
    let [value, endPtr2] = c8 === "[" ? parseArray(str, ptr, depth, integersAsBigInt) : parseInlineTable(str, ptr, depth, integersAsBigInt);
    let newPtr = end ? skipUntil(str, endPtr2, ",", end) : endPtr2;
    if (endPtr2 - newPtr && end === "}") {
      let nextNewLine = indexOfNewline(str, endPtr2, newPtr);
      if (nextNewLine > -1) {
        throw new TomlError("newlines are not allowed in inline tables", {
          toml: str,
          ptr: nextNewLine
        });
      }
    }
    return [value, newPtr];
  }
  let endPtr;
  if (c8 === '"' || c8 === "'") {
    endPtr = getStringEnd(str, ptr);
    let parsed = parseString(str, ptr, endPtr);
    if (end) {
      endPtr = skipVoid(str, endPtr, end !== "]");
      if (str[endPtr] && str[endPtr] !== "," && str[endPtr] !== end && str[endPtr] !== "\n" && str[endPtr] !== "\r") {
        throw new TomlError("unexpected character encountered", {
          toml: str,
          ptr: endPtr
        });
      }
      endPtr += +(str[endPtr] === ",");
    }
    return [parsed, endPtr];
  }
  endPtr = skipUntil(str, ptr, ",", end);
  let slice = sliceAndTrimEndOf(str, ptr, endPtr - +(str[endPtr - 1] === ","), end === "]");
  if (!slice[0]) {
    throw new TomlError("incomplete key-value declaration: no value specified", {
      toml: str,
      ptr
    });
  }
  if (end && slice[1] > -1) {
    endPtr = skipVoid(str, ptr + slice[1]);
    endPtr += +(str[endPtr] === ",");
  }
  return [
    parseValue(slice[0], str, ptr, integersAsBigInt),
    endPtr
  ];
}
function parseKey(str, ptr, end = "=") {
  let dot = ptr - 1;
  let parsed = [];
  let endPtr = str.indexOf(end, ptr);
  if (endPtr < 0) {
    throw new TomlError("incomplete key-value: cannot find end of key", {
      toml: str,
      ptr
    });
  }
  do {
    let c8 = str[ptr = ++dot];
    if (c8 !== " " && c8 !== "	") {
      if (c8 === '"' || c8 === "'") {
        if (c8 === str[ptr + 1] && c8 === str[ptr + 2]) {
          throw new TomlError("multiline strings are not allowed in keys", {
            toml: str,
            ptr
          });
        }
        let eos = getStringEnd(str, ptr);
        if (eos < 0) {
          throw new TomlError("unfinished string encountered", {
            toml: str,
            ptr
          });
        }
        dot = str.indexOf(".", eos);
        let strEnd = str.slice(eos, dot < 0 || dot > endPtr ? endPtr : dot);
        let newLine = indexOfNewline(strEnd);
        if (newLine > -1) {
          throw new TomlError("newlines are not allowed in keys", {
            toml: str,
            ptr: ptr + dot + newLine
          });
        }
        if (strEnd.trimStart()) {
          throw new TomlError("found extra tokens after the string part", {
            toml: str,
            ptr: eos
          });
        }
        if (endPtr < eos) {
          endPtr = str.indexOf(end, eos);
          if (endPtr < 0) {
            throw new TomlError("incomplete key-value: cannot find end of key", {
              toml: str,
              ptr
            });
          }
        }
        parsed.push(parseString(str, ptr, eos));
      } else {
        dot = str.indexOf(".", ptr);
        let part = str.slice(ptr, dot < 0 || dot > endPtr ? endPtr : dot);
        if (!KEY_PART_RE.test(part)) {
          throw new TomlError("only letter, numbers, dashes and underscores are allowed in keys", {
            toml: str,
            ptr
          });
        }
        parsed.push(part.trimEnd());
      }
    }
  } while (dot + 1 && dot < endPtr);
  return [parsed, skipVoid(str, endPtr + 1, true, true)];
}
function parseInlineTable(str, ptr, depth, integersAsBigInt) {
  let res = {};
  let seen = /* @__PURE__ */ new Set();
  let c8;
  let comma = 0;
  ptr++;
  while ((c8 = str[ptr++]) !== "}" && c8) {
    let err = { toml: str, ptr: ptr - 1 };
    if (c8 === "\n") {
      throw new TomlError("newlines are not allowed in inline tables", err);
    } else if (c8 === "#") {
      throw new TomlError("inline tables cannot contain comments", err);
    } else if (c8 === ",") {
      throw new TomlError("expected key-value, found comma", err);
    } else if (c8 !== " " && c8 !== "	") {
      let k7;
      let t13 = res;
      let hasOwn2 = false;
      let [key, keyEndPtr] = parseKey(str, ptr - 1);
      for (let i7 = 0; i7 < key.length; i7++) {
        if (i7)
          t13 = hasOwn2 ? t13[k7] : t13[k7] = {};
        k7 = key[i7];
        if ((hasOwn2 = Object.hasOwn(t13, k7)) && (typeof t13[k7] !== "object" || seen.has(t13[k7]))) {
          throw new TomlError("trying to redefine an already defined value", {
            toml: str,
            ptr
          });
        }
        if (!hasOwn2 && k7 === "__proto__") {
          Object.defineProperty(t13, k7, { enumerable: true, configurable: true, writable: true });
        }
      }
      if (hasOwn2) {
        throw new TomlError("trying to redefine an already defined value", {
          toml: str,
          ptr
        });
      }
      let [value, valueEndPtr] = extractValue(str, keyEndPtr, "}", depth - 1, integersAsBigInt);
      seen.add(value);
      t13[k7] = value;
      ptr = valueEndPtr;
      comma = str[ptr - 1] === "," ? ptr - 1 : 0;
    }
  }
  if (comma) {
    throw new TomlError("trailing commas are not allowed in inline tables", {
      toml: str,
      ptr: comma
    });
  }
  if (!c8) {
    throw new TomlError("unfinished table encountered", {
      toml: str,
      ptr
    });
  }
  return [res, ptr];
}
function parseArray(str, ptr, depth, integersAsBigInt) {
  let res = [];
  let c8;
  ptr++;
  while ((c8 = str[ptr++]) !== "]" && c8) {
    if (c8 === ",") {
      throw new TomlError("expected value, found comma", {
        toml: str,
        ptr: ptr - 1
      });
    } else if (c8 === "#")
      ptr = skipComment(str, ptr);
    else if (c8 !== " " && c8 !== "	" && c8 !== "\n" && c8 !== "\r") {
      let e10 = extractValue(str, ptr - 1, "]", depth - 1, integersAsBigInt);
      res.push(e10[0]);
      ptr = e10[1];
    }
  }
  if (!c8) {
    throw new TomlError("unfinished array encountered", {
      toml: str,
      ptr
    });
  }
  return [res, ptr];
}
function peekTable(key, table, meta, type) {
  let t13 = table;
  let m7 = meta;
  let k7;
  let hasOwn2 = false;
  let state2;
  for (let i7 = 0; i7 < key.length; i7++) {
    if (i7) {
      t13 = hasOwn2 ? t13[k7] : t13[k7] = {};
      m7 = (state2 = m7[k7]).c;
      if (type === 0 && (state2.t === 1 || state2.t === 2)) {
        return null;
      }
      if (state2.t === 2) {
        let l8 = t13.length - 1;
        t13 = t13[l8];
        m7 = m7[l8].c;
      }
    }
    k7 = key[i7];
    if ((hasOwn2 = Object.hasOwn(t13, k7)) && m7[k7]?.t === 0 && m7[k7]?.d) {
      return null;
    }
    if (!hasOwn2) {
      if (k7 === "__proto__") {
        Object.defineProperty(t13, k7, { enumerable: true, configurable: true, writable: true });
        Object.defineProperty(m7, k7, { enumerable: true, configurable: true, writable: true });
      }
      m7[k7] = {
        t: i7 < key.length - 1 && type === 2 ? 3 : type,
        d: false,
        i: 0,
        c: {}
      };
    }
  }
  state2 = m7[k7];
  if (state2.t !== type && !(type === 1 && state2.t === 3)) {
    return null;
  }
  if (type === 2) {
    if (!state2.d) {
      state2.d = true;
      t13[k7] = [];
    }
    t13[k7].push(t13 = {});
    state2.c[state2.i++] = state2 = { t: 1, d: false, i: 0, c: {} };
  }
  if (state2.d) {
    return null;
  }
  state2.d = true;
  if (type === 1) {
    t13 = hasOwn2 ? t13[k7] : t13[k7] = {};
  } else if (type === 0 && hasOwn2) {
    return null;
  }
  return [k7, t13, state2.c];
}
function parse3(toml, { maxDepth = 1e3, integersAsBigInt } = {}) {
  let res = {};
  let meta = {};
  let tbl = res;
  let m7 = meta;
  for (let ptr = skipVoid(toml, 0); ptr < toml.length; ) {
    if (toml[ptr] === "[") {
      let isTableArray = toml[++ptr] === "[";
      let k7 = parseKey(toml, ptr += +isTableArray, "]");
      if (isTableArray) {
        if (toml[k7[1] - 1] !== "]") {
          throw new TomlError("expected end of table declaration", {
            toml,
            ptr: k7[1] - 1
          });
        }
        k7[1]++;
      }
      let p7 = peekTable(
        k7[0],
        res,
        meta,
        isTableArray ? 2 : 1
        /* Type.EXPLICIT */
      );
      if (!p7) {
        throw new TomlError("trying to redefine an already defined table or value", {
          toml,
          ptr
        });
      }
      m7 = p7[2];
      tbl = p7[1];
      ptr = k7[1];
    } else {
      let k7 = parseKey(toml, ptr);
      let p7 = peekTable(
        k7[0],
        tbl,
        m7,
        0
        /* Type.DOTTED */
      );
      if (!p7) {
        throw new TomlError("trying to redefine an already defined table or value", {
          toml,
          ptr
        });
      }
      let v8 = extractValue(toml, k7[1], void 0, maxDepth, integersAsBigInt);
      p7[1][p7[0]] = v8[0];
      ptr = v8[1];
    }
    ptr = skipVoid(toml, ptr, true);
    if (toml[ptr] && toml[ptr] !== "\n" && toml[ptr] !== "\r") {
      throw new TomlError("each key-value declaration must be followed by an end-of-line", {
        toml,
        ptr
      });
    }
    ptr = skipVoid(toml, ptr);
  }
  return res;
}
function extendedTypeOf(obj) {
  let type = typeof obj;
  if (type === "object") {
    if (Array.isArray(obj))
      return "array";
    if (obj instanceof Date)
      return "date";
  }
  return type;
}
function isArrayOfTables(obj) {
  for (let i7 = 0; i7 < obj.length; i7++) {
    if (extendedTypeOf(obj[i7]) !== "object")
      return false;
  }
  return obj.length != 0;
}
function formatString(s7) {
  return JSON.stringify(s7).replace(/\x7f/g, "\\u007f");
}
function stringifyValue(val2, type, depth, numberAsFloat) {
  if (depth === 0) {
    throw new Error("Could not stringify the object: maximum object depth exceeded");
  }
  if (type === "number") {
    if (isNaN(val2))
      return "nan";
    if (val2 === Infinity)
      return "inf";
    if (val2 === -Infinity)
      return "-inf";
    if (numberAsFloat && Number.isInteger(val2))
      return val2.toFixed(1);
    return val2.toString();
  }
  if (type === "bigint" || type === "boolean") {
    return val2.toString();
  }
  if (type === "string") {
    return formatString(val2);
  }
  if (type === "date") {
    if (isNaN(val2.getTime())) {
      throw new TypeError("cannot serialize invalid date");
    }
    return val2.toISOString();
  }
  if (type === "object") {
    return stringifyInlineTable(val2, depth, numberAsFloat);
  }
  if (type === "array") {
    return stringifyArray(val2, depth, numberAsFloat);
  }
}
function stringifyInlineTable(obj, depth, numberAsFloat) {
  let keys = Object.keys(obj);
  if (keys.length === 0)
    return "{}";
  let res = "{ ";
  for (let i7 = 0; i7 < keys.length; i7++) {
    let k7 = keys[i7];
    if (i7)
      res += ", ";
    res += BARE_KEY.test(k7) ? k7 : formatString(k7);
    res += " = ";
    res += stringifyValue(obj[k7], extendedTypeOf(obj[k7]), depth - 1, numberAsFloat);
  }
  return res + " }";
}
function stringifyArray(array, depth, numberAsFloat) {
  if (array.length === 0)
    return "[]";
  let res = "[ ";
  for (let i7 = 0; i7 < array.length; i7++) {
    if (i7)
      res += ", ";
    if (array[i7] === null || array[i7] === void 0) {
      throw new TypeError("arrays cannot contain null or undefined values");
    }
    res += stringifyValue(array[i7], extendedTypeOf(array[i7]), depth - 1, numberAsFloat);
  }
  return res + " ]";
}
function stringifyArrayTable(array, key, depth, numberAsFloat) {
  if (depth === 0) {
    throw new Error("Could not stringify the object: maximum object depth exceeded");
  }
  let res = "";
  for (let i7 = 0; i7 < array.length; i7++) {
    res += `${res && "\n"}[[${key}]]
`;
    res += stringifyTable(0, array[i7], key, depth, numberAsFloat);
  }
  return res;
}
function stringifyTable(tableKey, obj, prefix, depth, numberAsFloat) {
  if (depth === 0) {
    throw new Error("Could not stringify the object: maximum object depth exceeded");
  }
  let preamble = "";
  let tables = "";
  let keys = Object.keys(obj);
  for (let i7 = 0; i7 < keys.length; i7++) {
    let k7 = keys[i7];
    if (obj[k7] !== null && obj[k7] !== void 0) {
      let type = extendedTypeOf(obj[k7]);
      if (type === "symbol" || type === "function") {
        throw new TypeError(`cannot serialize values of type '${type}'`);
      }
      let key = BARE_KEY.test(k7) ? k7 : formatString(k7);
      if (type === "array" && isArrayOfTables(obj[k7])) {
        tables += (tables && "\n") + stringifyArrayTable(obj[k7], prefix ? `${prefix}.${key}` : key, depth - 1, numberAsFloat);
      } else if (type === "object") {
        let tblKey = prefix ? `${prefix}.${key}` : key;
        tables += (tables && "\n") + stringifyTable(tblKey, obj[k7], tblKey, depth - 1, numberAsFloat);
      } else {
        preamble += key;
        preamble += " = ";
        preamble += stringifyValue(obj[k7], type, depth, numberAsFloat);
        preamble += "\n";
      }
    }
  }
  if (tableKey && (preamble || !tables))
    preamble = preamble ? `[${tableKey}]
${preamble}` : `[${tableKey}]`;
  return preamble && tables ? `${preamble}
${tables}` : preamble || tables;
}
function stringify(obj, { maxDepth = 1e3, numbersAsFloat = false } = {}) {
  if (extendedTypeOf(obj) !== "object") {
    throw new TypeError("stringify can only be called with an object");
  }
  let str = stringifyTable(0, obj, "", maxDepth, numbersAsFloat);
  if (str[str.length - 1] !== "\n")
    return str + "\n";
  return str;
}
function parseTOML(tomlContent, filePath) {
  try {
    return dist_default.parse(tomlContent);
  } catch (err) {
    if (!(err instanceof TomlError)) {
      throw err;
    }
    const location = {
      lineText: tomlContent.split("\n")[err.line - 1],
      line: err.line,
      column: err.column - 1,
      file: filePath,
      fileText: tomlContent
    };
    throw new ParseError({
      text: err.message.substring(0, err.message.indexOf("\n")),
      location,
      telemetryMessage: "TOML parse error"
    });
  }
}
function parsePackageJSON(input, file22) {
  return parseJSON(input, file22);
}
function parseJSON(input, file22) {
  return parseJSONC(input, file22, {
    allowEmptyContent: false,
    allowTrailingComma: false,
    disallowComments: true
  });
}
function parseJSONC(input, file22, options = { allowTrailingComma: true }) {
  const errors = [];
  const data = parse2(input, errors, options);
  if (errors.length) {
    throw new ParseError({
      text: printParseErrorCode(errors[0].error),
      location: {
        ...indexLocation({ file: file22, fileText: input }, errors[0].offset + 1),
        length: errors[0].length
      },
      telemetryMessage: "JSON(C) parse error"
    });
  }
  return data;
}
function readFileSyncToBuffer(file22) {
  try {
    return fs29.readFileSync(file22);
  } catch (err) {
    const { message } = err;
    throw new ParseError({
      text: `Could not read file: ${file22}`,
      notes: [
        {
          text: message.replace(file22, path3.resolve(file22))
        }
      ]
    });
  }
}
function readFileSync(file22) {
  try {
    const buffer = fs29.readFileSync(file22);
    return removeBOMAndValidate(buffer, file22);
  } catch (err) {
    if (err instanceof ParseError) {
      throw err;
    }
    const { message } = err;
    throw new ParseError({
      text: `Could not read file: ${file22}`,
      notes: [
        {
          text: message.replace(file22, path3.resolve(file22))
        }
      ],
      telemetryMessage: "Could not read file"
    });
  }
}
function indexLocation(file22, index) {
  let lineText, line = 0, column = 0, cursor = 0;
  const { fileText = "" } = file22;
  for (const row of fileText.split("\n")) {
    line++;
    cursor += row.length + 1;
    if (cursor >= index) {
      lineText = row;
      column = row.length - (cursor - index);
      break;
    }
  }
  return { lineText, line, column, ...file22 };
}
function searchLocation(file22, query) {
  let lineText, length, line = 0, column = 0;
  const queryText = String(query);
  const { fileText = "" } = file22;
  for (const content of fileText.split("\n")) {
    line++;
    const index = content.indexOf(queryText);
    if (index >= 0) {
      lineText = content;
      column = index;
      length = queryText.length;
      break;
    }
  }
  return { lineText, line, column, length, ...file22 };
}
function parseHumanDuration(s7) {
  const unitsMap = new Map(Object.entries(units));
  s7 = s7.trim().toLowerCase();
  let base = 1;
  for (const [name2, _5] of unitsMap) {
    if (s7.endsWith(name2)) {
      s7 = s7.substring(0, s7.length - name2.length);
      base = unitsMap.get(name2) || 1;
      break;
    }
  }
  return Number(s7) * base;
}
function parseNonHyphenedUuid(uuid) {
  if (uuid == null || uuid.includes("-")) {
    return uuid;
  }
  if (uuid.length != 32) {
    return null;
  }
  const uuid_parts = [];
  uuid_parts.push(uuid.slice(0, 8));
  uuid_parts.push(uuid.slice(8, 12));
  uuid_parts.push(uuid.slice(12, 16));
  uuid_parts.push(uuid.slice(16, 20));
  uuid_parts.push(uuid.slice(20));
  let hyphenated = "";
  uuid_parts.forEach((part) => hyphenated += part + "-");
  return hyphenated.slice(0, 36);
}
function parseByteSize(s7, base = void 0) {
  const match3 = s7.match(
    /^(\d*\.*\d*)\s*([kKmMgGtTpP]{0,1})([i]{0,1}[bB]{0,1})$/
  );
  if (!match3) {
    return NaN;
  }
  const size = match3[1];
  if (size.length === 0 || isNaN(Number(size))) {
    return NaN;
  }
  const unit = match3[2].toLowerCase();
  const sizeUnits = {
    k: 1,
    m: 2,
    g: 3,
    t: 4,
    p: 5
  };
  if (unit.length !== 0 && !(unit in sizeUnits)) {
    return NaN;
  }
  const binary = match3[3].toLowerCase() == "ib";
  if (binary && unit.length === 0) {
    return NaN;
  }
  const pow = sizeUnits[unit] || 0;
  return Math.floor(
    Number(size) * Math.pow(base ?? (binary ? 1024 : 1e3), pow)
  );
}
function removeBOMAndValidate(buffer, file22) {
  for (const bom of UNSUPPORTED_BOMS) {
    if (buffer.length >= bom.buffer.length && buffer.subarray(0, bom.buffer.length).equals(bom.buffer)) {
      throw new ParseError({
        text: `Configuration file contains ${bom.encoding} byte order marker`,
        notes: [
          {
            text: `The file "${file22}" appears to be encoded as ${bom.encoding}. Please save the file as UTF-8 without BOM.`
          }
        ],
        location: { file: file22, line: 1, column: 0 },
        telemetryMessage: `${bom.encoding} BOM detected`
      });
    }
  }
  const content = buffer.toString("utf-8");
  if (content.charCodeAt(0) === 65279) {
    return content.slice(1);
  }
  return content;
}
function absolute(input, root) {
  return path3.isAbsolute(input) ? input : path3.resolve(root || ".", input);
}
function up(base, options) {
  let { last, cwd: cwd2 } = options || {};
  let tmp = absolute(base, cwd2);
  let root = absolute(last || "/", cwd2);
  let prev, arr = [];
  while (prev !== root) {
    arr.push(tmp);
    tmp = path3.dirname(prev = tmp);
    if (tmp === prev) break;
  }
  return arr;
}
function file(name2, options) {
  let dir2, tmp;
  let start = options && options.cwd || "";
  for (dir2 of up(start, options)) {
    try {
      tmp = path3.join(dir2, name2);
      if (fs29.statSync(tmp).isFile()) return tmp;
    } catch {
    }
  }
}
function dedent(templ) {
  var values = [];
  for (var _i2 = 1; _i2 < arguments.length; _i2++) {
    values[_i2 - 1] = arguments[_i2];
  }
  var strings = Array.from(typeof templ === "string" ? [templ] : templ);
  strings[strings.length - 1] = strings[strings.length - 1].replace(/\r?\n([\t ]*)$/, "");
  var indentLengths = strings.reduce(function(arr, str) {
    var matches = str.match(/\n([\t ]+|(?!\s).)/g);
    if (matches) {
      return arr.concat(matches.map(function(match3) {
        var _a5, _b2;
        return (_b2 = (_a5 = match3.match(/[\t ]/g)) === null || _a5 === void 0 ? void 0 : _a5.length) !== null && _b2 !== void 0 ? _b2 : 0;
      }));
    }
    return arr;
  }, []);
  if (indentLengths.length) {
    var pattern_1 = new RegExp("\n[	 ]{" + Math.min.apply(Math, indentLengths) + "}", "g");
    strings = strings.map(function(str) {
      return str.replace(pattern_1, "\n");
    });
  }
  strings[0] = strings[0].replace(/^\r?\n/, "");
  var string = strings[0];
  values.forEach(function(value, i7) {
    var endentations = string.match(/(?:^|\n)( *)$/);
    var endentation = endentations ? endentations[1] : "";
    var indentedValue = value;
    if (typeof value === "string" && value.includes("\n")) {
      indentedValue = String(value).split("\n").map(function(str, i22) {
        return i22 === 0 ? str : "" + endentation + str;
      }).join("\n");
    }
    string += indentedValue + strings[i7 + 1];
  });
  return string;
}
function resolveWranglerConfigPath({
  config,
  script
}, options) {
  if (config !== void 0) {
    return {
      userConfigPath: config,
      configPath: config,
      deployConfigPath: void 0,
      redirected: false
    };
  }
  const leafPath = script !== void 0 ? path3__namespace.default.dirname(script) : process.cwd();
  return findWranglerConfig(leafPath, options);
}
function findWranglerConfig(referencePath = process.cwd(), { useRedirectIfAvailable = false } = {}) {
  const userConfigPath = file(`wrangler.json`, { cwd: referencePath }) ?? file(`wrangler.jsonc`, { cwd: referencePath }) ?? file(`wrangler.toml`, { cwd: referencePath });
  if (!useRedirectIfAvailable) {
    return {
      userConfigPath,
      configPath: userConfigPath,
      deployConfigPath: void 0,
      redirected: false
    };
  }
  const { configPath, deployConfigPath, redirected } = findRedirectedWranglerConfig(referencePath, userConfigPath);
  return {
    userConfigPath,
    configPath,
    deployConfigPath,
    redirected
  };
}
function findRedirectedWranglerConfig(cwd2, userConfigPath) {
  const deployConfigPath = file(PATH_TO_DEPLOY_CONFIG, { cwd: cwd2 });
  if (deployConfigPath === void 0) {
    return { configPath: userConfigPath, deployConfigPath, redirected: false };
  }
  let redirectedConfigPath;
  const deployConfigFile = readFileSync(deployConfigPath);
  try {
    const deployConfig = parseJSONC(deployConfigFile, deployConfigPath);
    redirectedConfigPath = deployConfig.configPath && path3__namespace.default.resolve(path3__namespace.default.dirname(deployConfigPath), deployConfig.configPath);
  } catch (e10) {
    throw new UserError(
      `Failed to parse the deploy configuration file at ${path3__namespace.default.relative(".", deployConfigPath)}`,
      { cause: e10 }
    );
  }
  if (!redirectedConfigPath) {
    throw new UserError(esm_default`
			A deploy configuration file was found at "${path3__namespace.default.relative(".", deployConfigPath)}".
			But this is not valid - the required "configPath" property was not found.
			Instead this file contains:
			\`\`\`
			${deployConfigFile}
			\`\`\`
		`);
  }
  if (!fs29.existsSync(redirectedConfigPath)) {
    throw new UserError(esm_default`
				There is a deploy configuration at "${path3__namespace.default.relative(".", deployConfigPath)}".
				But the redirected configuration path it points to, "${path3__namespace.default.relative(".", redirectedConfigPath)}", does not exist.
			`);
  }
  if (userConfigPath) {
    if (path3__namespace.default.join(path3__namespace.default.dirname(userConfigPath), PATH_TO_DEPLOY_CONFIG) !== deployConfigPath) {
      throw new UserError(esm_default`
					Found both a user configuration file at "${path3__namespace.default.relative(".", userConfigPath)}"
					and a deploy configuration file at "${path3__namespace.default.relative(".", deployConfigPath)}".
					But these do not share the same base path so it is not clear which should be used.
				`);
    }
  }
  return {
    configPath: redirectedConfigPath,
    deployConfigPath,
    redirected: true
  };
}
function isRedirectedRawConfig(rawConfig, configPath, userConfigPath) {
  return configPath !== void 0 && configPath !== userConfigPath;
}
function configFormat(configPath) {
  if (configPath?.endsWith("toml")) {
    return "toml";
  }
  if (configPath?.endsWith("jsonc")) {
    return "jsonc";
  }
  if (configPath?.endsWith("json")) {
    return "json";
  }
  return "none";
}
function configFileName(configPath) {
  const format32 = configFormat(configPath);
  switch (format32) {
    case "toml":
      return "wrangler.toml";
    case "json":
      return "wrangler.json";
    case "jsonc":
      return "wrangler.jsonc";
    default:
      return "Wrangler configuration";
  }
}
function formatConfigSnippet(snippet, configPath, formatted = true) {
  const format32 = configFormat(configPath);
  if (format32 === "toml") {
    return dist_default.stringify(snippet);
  } else {
    return formatted ? JSON.stringify(snippet, null, 2) : JSON.stringify(snippet);
  }
}
function isDirectory(path210) {
  return fs29__namespace.default.statSync(path210, { throwIfNoEntry: false })?.isDirectory() ?? false;
}
function removeDir(dirPath, { fireAndForget = false } = {}) {
  const result = fs29__namespace.default.promises.rm(dirPath, {
    recursive: true,
    force: true,
    maxRetries: 5,
    retryDelay: 100
  });
  if (fireAndForget) {
    void result.catch(() => {
    });
  } else {
    return result;
  }
}
function removeDirSync(dirPath) {
  fs29__namespace.default.rmSync(dirPath, {
    recursive: true,
    force: true,
    maxRetries: 5,
    retryDelay: 100
  });
}
var UserError, FatalError, CommandLineArgsError, JsonFriendlyFatalError, MissingConfigError, CharacterCodes, ParseOptions, ScanError, SyntaxKind, parse2, ParseErrorCode, TomlError, DATE_TIME_RE, TomlDate, INT_REGEX, FLOAT_REGEX, LEADING_ZERO, ESCAPE_REGEX, ESC_MAP, KEY_PART_RE, BARE_KEY, dist_default, ParseError, APIError, units, UNSUPPORTED_BOMS, esm_default, parseRawConfigFile; exports.experimental_readRawConfig = void 0;
var init_chunk_YEDWOTIW = __esm({
  "../workers-utils/dist/chunk-YEDWOTIW.mjs"() {
    init_import_meta_url();
    init_chunk_R45BP2X6();
    init_chunk_UC4C7ZX3();
    UserError = class extends Error {
      static {
        __name(this, "UserError");
      }
      static {
        __name2(this, "UserError");
      }
      telemetryMessage;
      constructor(message, options) {
        super(message, options);
        Object.setPrototypeOf(this, new.target.prototype);
        this.telemetryMessage = options?.telemetryMessage === true ? message : options?.telemetryMessage;
      }
    };
    (class extends UserError {
      static {
        __name(this, "DeprecationError");
      }
      static {
        __name2(this, "DeprecationError");
      }
      constructor(message, options) {
        super(`Deprecation:
${message}`, options);
      }
    });
    FatalError = class extends UserError {
      static {
        __name(this, "FatalError");
      }
      constructor(message, code, options) {
        super(message, options);
        this.code = code;
      }
      static {
        __name2(this, "FatalError");
      }
    };
    CommandLineArgsError = class extends UserError {
      static {
        __name(this, "CommandLineArgsError");
      }
      static {
        __name2(this, "CommandLineArgsError");
      }
    };
    JsonFriendlyFatalError = class extends FatalError {
      static {
        __name(this, "JsonFriendlyFatalError");
      }
      constructor(message, code, options) {
        super(message, code, options);
        this.code = code;
      }
      static {
        __name2(this, "JsonFriendlyFatalError");
      }
    };
    MissingConfigError = class extends Error {
      static {
        __name(this, "MissingConfigError");
      }
      static {
        __name2(this, "MissingConfigError");
      }
      telemetryMessage;
      constructor(key) {
        super(`Missing config value for ${key}`);
        this.telemetryMessage = `Missing config value for ${key}`;
      }
    };
    __name(createFatalError, "createFatalError");
    __name2(createFatalError, "createFatalError");
    __name(createScanner, "createScanner");
    __name2(createScanner, "createScanner");
    __name(isWhiteSpace, "isWhiteSpace");
    __name2(isWhiteSpace, "isWhiteSpace");
    __name(isLineBreak, "isLineBreak");
    __name2(isLineBreak, "isLineBreak");
    __name(isDigit, "isDigit");
    __name2(isDigit, "isDigit");
    (function(CharacterCodes22) {
      CharacterCodes22[CharacterCodes22["lineFeed"] = 10] = "lineFeed";
      CharacterCodes22[CharacterCodes22["carriageReturn"] = 13] = "carriageReturn";
      CharacterCodes22[CharacterCodes22["space"] = 32] = "space";
      CharacterCodes22[CharacterCodes22["_0"] = 48] = "_0";
      CharacterCodes22[CharacterCodes22["_1"] = 49] = "_1";
      CharacterCodes22[CharacterCodes22["_2"] = 50] = "_2";
      CharacterCodes22[CharacterCodes22["_3"] = 51] = "_3";
      CharacterCodes22[CharacterCodes22["_4"] = 52] = "_4";
      CharacterCodes22[CharacterCodes22["_5"] = 53] = "_5";
      CharacterCodes22[CharacterCodes22["_6"] = 54] = "_6";
      CharacterCodes22[CharacterCodes22["_7"] = 55] = "_7";
      CharacterCodes22[CharacterCodes22["_8"] = 56] = "_8";
      CharacterCodes22[CharacterCodes22["_9"] = 57] = "_9";
      CharacterCodes22[CharacterCodes22["a"] = 97] = "a";
      CharacterCodes22[CharacterCodes22["b"] = 98] = "b";
      CharacterCodes22[CharacterCodes22["c"] = 99] = "c";
      CharacterCodes22[CharacterCodes22["d"] = 100] = "d";
      CharacterCodes22[CharacterCodes22["e"] = 101] = "e";
      CharacterCodes22[CharacterCodes22["f"] = 102] = "f";
      CharacterCodes22[CharacterCodes22["g"] = 103] = "g";
      CharacterCodes22[CharacterCodes22["h"] = 104] = "h";
      CharacterCodes22[CharacterCodes22["i"] = 105] = "i";
      CharacterCodes22[CharacterCodes22["j"] = 106] = "j";
      CharacterCodes22[CharacterCodes22["k"] = 107] = "k";
      CharacterCodes22[CharacterCodes22["l"] = 108] = "l";
      CharacterCodes22[CharacterCodes22["m"] = 109] = "m";
      CharacterCodes22[CharacterCodes22["n"] = 110] = "n";
      CharacterCodes22[CharacterCodes22["o"] = 111] = "o";
      CharacterCodes22[CharacterCodes22["p"] = 112] = "p";
      CharacterCodes22[CharacterCodes22["q"] = 113] = "q";
      CharacterCodes22[CharacterCodes22["r"] = 114] = "r";
      CharacterCodes22[CharacterCodes22["s"] = 115] = "s";
      CharacterCodes22[CharacterCodes22["t"] = 116] = "t";
      CharacterCodes22[CharacterCodes22["u"] = 117] = "u";
      CharacterCodes22[CharacterCodes22["v"] = 118] = "v";
      CharacterCodes22[CharacterCodes22["w"] = 119] = "w";
      CharacterCodes22[CharacterCodes22["x"] = 120] = "x";
      CharacterCodes22[CharacterCodes22["y"] = 121] = "y";
      CharacterCodes22[CharacterCodes22["z"] = 122] = "z";
      CharacterCodes22[CharacterCodes22["A"] = 65] = "A";
      CharacterCodes22[CharacterCodes22["B"] = 66] = "B";
      CharacterCodes22[CharacterCodes22["C"] = 67] = "C";
      CharacterCodes22[CharacterCodes22["D"] = 68] = "D";
      CharacterCodes22[CharacterCodes22["E"] = 69] = "E";
      CharacterCodes22[CharacterCodes22["F"] = 70] = "F";
      CharacterCodes22[CharacterCodes22["G"] = 71] = "G";
      CharacterCodes22[CharacterCodes22["H"] = 72] = "H";
      CharacterCodes22[CharacterCodes22["I"] = 73] = "I";
      CharacterCodes22[CharacterCodes22["J"] = 74] = "J";
      CharacterCodes22[CharacterCodes22["K"] = 75] = "K";
      CharacterCodes22[CharacterCodes22["L"] = 76] = "L";
      CharacterCodes22[CharacterCodes22["M"] = 77] = "M";
      CharacterCodes22[CharacterCodes22["N"] = 78] = "N";
      CharacterCodes22[CharacterCodes22["O"] = 79] = "O";
      CharacterCodes22[CharacterCodes22["P"] = 80] = "P";
      CharacterCodes22[CharacterCodes22["Q"] = 81] = "Q";
      CharacterCodes22[CharacterCodes22["R"] = 82] = "R";
      CharacterCodes22[CharacterCodes22["S"] = 83] = "S";
      CharacterCodes22[CharacterCodes22["T"] = 84] = "T";
      CharacterCodes22[CharacterCodes22["U"] = 85] = "U";
      CharacterCodes22[CharacterCodes22["V"] = 86] = "V";
      CharacterCodes22[CharacterCodes22["W"] = 87] = "W";
      CharacterCodes22[CharacterCodes22["X"] = 88] = "X";
      CharacterCodes22[CharacterCodes22["Y"] = 89] = "Y";
      CharacterCodes22[CharacterCodes22["Z"] = 90] = "Z";
      CharacterCodes22[CharacterCodes22["asterisk"] = 42] = "asterisk";
      CharacterCodes22[CharacterCodes22["backslash"] = 92] = "backslash";
      CharacterCodes22[CharacterCodes22["closeBrace"] = 125] = "closeBrace";
      CharacterCodes22[CharacterCodes22["closeBracket"] = 93] = "closeBracket";
      CharacterCodes22[CharacterCodes22["colon"] = 58] = "colon";
      CharacterCodes22[CharacterCodes22["comma"] = 44] = "comma";
      CharacterCodes22[CharacterCodes22["dot"] = 46] = "dot";
      CharacterCodes22[CharacterCodes22["doubleQuote"] = 34] = "doubleQuote";
      CharacterCodes22[CharacterCodes22["minus"] = 45] = "minus";
      CharacterCodes22[CharacterCodes22["openBrace"] = 123] = "openBrace";
      CharacterCodes22[CharacterCodes22["openBracket"] = 91] = "openBracket";
      CharacterCodes22[CharacterCodes22["plus"] = 43] = "plus";
      CharacterCodes22[CharacterCodes22["slash"] = 47] = "slash";
      CharacterCodes22[CharacterCodes22["formFeed"] = 12] = "formFeed";
      CharacterCodes22[CharacterCodes22["tab"] = 9] = "tab";
    })(CharacterCodes || (CharacterCodes = {}));
    __name(format, "format");
    __name2(format, "format");
    __name(repeat, "repeat");
    __name2(repeat, "repeat");
    __name(computeIndentLevel, "computeIndentLevel");
    __name2(computeIndentLevel, "computeIndentLevel");
    __name(getEOL, "getEOL");
    __name2(getEOL, "getEOL");
    __name(isEOL, "isEOL");
    __name2(isEOL, "isEOL");
    (function(ParseOptions22) {
      ParseOptions22.DEFAULT = {
        allowTrailingComma: false
      };
    })(ParseOptions || (ParseOptions = {}));
    __name(parse, "parse");
    __name2(parse, "parse");
    __name(parseTree, "parseTree");
    __name2(parseTree, "parseTree");
    __name(findNodeAtLocation, "findNodeAtLocation");
    __name2(findNodeAtLocation, "findNodeAtLocation");
    __name(visit, "visit");
    __name2(visit, "visit");
    __name(getNodeType, "getNodeType");
    __name2(getNodeType, "getNodeType");
    __name(setProperty, "setProperty");
    __name2(setProperty, "setProperty");
    __name(withFormatting, "withFormatting");
    __name2(withFormatting, "withFormatting");
    __name(applyEdit, "applyEdit");
    __name2(applyEdit, "applyEdit");
    (function(ScanError22) {
      ScanError22[ScanError22["None"] = 0] = "None";
      ScanError22[ScanError22["UnexpectedEndOfComment"] = 1] = "UnexpectedEndOfComment";
      ScanError22[ScanError22["UnexpectedEndOfString"] = 2] = "UnexpectedEndOfString";
      ScanError22[ScanError22["UnexpectedEndOfNumber"] = 3] = "UnexpectedEndOfNumber";
      ScanError22[ScanError22["InvalidUnicode"] = 4] = "InvalidUnicode";
      ScanError22[ScanError22["InvalidEscapeCharacter"] = 5] = "InvalidEscapeCharacter";
      ScanError22[ScanError22["InvalidCharacter"] = 6] = "InvalidCharacter";
    })(ScanError || (ScanError = {}));
    (function(SyntaxKind22) {
      SyntaxKind22[SyntaxKind22["OpenBraceToken"] = 1] = "OpenBraceToken";
      SyntaxKind22[SyntaxKind22["CloseBraceToken"] = 2] = "CloseBraceToken";
      SyntaxKind22[SyntaxKind22["OpenBracketToken"] = 3] = "OpenBracketToken";
      SyntaxKind22[SyntaxKind22["CloseBracketToken"] = 4] = "CloseBracketToken";
      SyntaxKind22[SyntaxKind22["CommaToken"] = 5] = "CommaToken";
      SyntaxKind22[SyntaxKind22["ColonToken"] = 6] = "ColonToken";
      SyntaxKind22[SyntaxKind22["NullKeyword"] = 7] = "NullKeyword";
      SyntaxKind22[SyntaxKind22["TrueKeyword"] = 8] = "TrueKeyword";
      SyntaxKind22[SyntaxKind22["FalseKeyword"] = 9] = "FalseKeyword";
      SyntaxKind22[SyntaxKind22["StringLiteral"] = 10] = "StringLiteral";
      SyntaxKind22[SyntaxKind22["NumericLiteral"] = 11] = "NumericLiteral";
      SyntaxKind22[SyntaxKind22["LineCommentTrivia"] = 12] = "LineCommentTrivia";
      SyntaxKind22[SyntaxKind22["BlockCommentTrivia"] = 13] = "BlockCommentTrivia";
      SyntaxKind22[SyntaxKind22["LineBreakTrivia"] = 14] = "LineBreakTrivia";
      SyntaxKind22[SyntaxKind22["Trivia"] = 15] = "Trivia";
      SyntaxKind22[SyntaxKind22["Unknown"] = 16] = "Unknown";
      SyntaxKind22[SyntaxKind22["EOF"] = 17] = "EOF";
    })(SyntaxKind || (SyntaxKind = {}));
    parse2 = parse;
    (function(ParseErrorCode22) {
      ParseErrorCode22[ParseErrorCode22["InvalidSymbol"] = 1] = "InvalidSymbol";
      ParseErrorCode22[ParseErrorCode22["InvalidNumberFormat"] = 2] = "InvalidNumberFormat";
      ParseErrorCode22[ParseErrorCode22["PropertyNameExpected"] = 3] = "PropertyNameExpected";
      ParseErrorCode22[ParseErrorCode22["ValueExpected"] = 4] = "ValueExpected";
      ParseErrorCode22[ParseErrorCode22["ColonExpected"] = 5] = "ColonExpected";
      ParseErrorCode22[ParseErrorCode22["CommaExpected"] = 6] = "CommaExpected";
      ParseErrorCode22[ParseErrorCode22["CloseBraceExpected"] = 7] = "CloseBraceExpected";
      ParseErrorCode22[ParseErrorCode22["CloseBracketExpected"] = 8] = "CloseBracketExpected";
      ParseErrorCode22[ParseErrorCode22["EndOfFileExpected"] = 9] = "EndOfFileExpected";
      ParseErrorCode22[ParseErrorCode22["InvalidCommentToken"] = 10] = "InvalidCommentToken";
      ParseErrorCode22[ParseErrorCode22["UnexpectedEndOfComment"] = 11] = "UnexpectedEndOfComment";
      ParseErrorCode22[ParseErrorCode22["UnexpectedEndOfString"] = 12] = "UnexpectedEndOfString";
      ParseErrorCode22[ParseErrorCode22["UnexpectedEndOfNumber"] = 13] = "UnexpectedEndOfNumber";
      ParseErrorCode22[ParseErrorCode22["InvalidUnicode"] = 14] = "InvalidUnicode";
      ParseErrorCode22[ParseErrorCode22["InvalidEscapeCharacter"] = 15] = "InvalidEscapeCharacter";
      ParseErrorCode22[ParseErrorCode22["InvalidCharacter"] = 16] = "InvalidCharacter";
    })(ParseErrorCode || (ParseErrorCode = {}));
    __name(printParseErrorCode, "printParseErrorCode");
    __name2(printParseErrorCode, "printParseErrorCode");
    __name(format2, "format2");
    __name2(format2, "format");
    __name(modify, "modify");
    __name2(modify, "modify");
    __name(applyEdits, "applyEdits");
    __name2(applyEdits, "applyEdits");
    __name(getLineColFromPtr, "getLineColFromPtr");
    __name2(getLineColFromPtr, "getLineColFromPtr");
    __name(makeCodeBlock, "makeCodeBlock");
    __name2(makeCodeBlock, "makeCodeBlock");
    TomlError = class extends Error {
      static {
        __name(this, "TomlError");
      }
      static {
        __name2(this, "TomlError");
      }
      line;
      column;
      codeblock;
      constructor(message, options) {
        const [line, column] = getLineColFromPtr(options.toml, options.ptr);
        const codeblock = makeCodeBlock(options.toml, line, column);
        super(`Invalid TOML document: ${message}

${codeblock}`, options);
        this.line = line;
        this.column = column;
        this.codeblock = codeblock;
      }
    };
    __name(isEscaped, "isEscaped");
    __name2(isEscaped, "isEscaped");
    __name(indexOfNewline, "indexOfNewline");
    __name2(indexOfNewline, "indexOfNewline");
    __name(skipComment, "skipComment");
    __name2(skipComment, "skipComment");
    __name(skipVoid, "skipVoid");
    __name2(skipVoid, "skipVoid");
    __name(skipUntil, "skipUntil");
    __name2(skipUntil, "skipUntil");
    __name(getStringEnd, "getStringEnd");
    __name2(getStringEnd, "getStringEnd");
    DATE_TIME_RE = /^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}:\d{2}(?:\.\d+)?)?(Z|[-+]\d{2}:\d{2})?$/i;
    TomlDate = class _TomlDate extends Date {
      static {
        __name(this, "_TomlDate");
      }
      static {
        __name2(this, "TomlDate");
      }
      #hasDate = false;
      #hasTime = false;
      #offset = null;
      constructor(date) {
        let hasDate = true;
        let hasTime = true;
        let offset = "Z";
        if (typeof date === "string") {
          let match3 = date.match(DATE_TIME_RE);
          if (match3) {
            if (!match3[1]) {
              hasDate = false;
              date = `0000-01-01T${date}`;
            }
            hasTime = !!match3[2];
            hasTime && date[10] === " " && (date = date.replace(" ", "T"));
            if (match3[2] && +match3[2] > 23) {
              date = "";
            } else {
              offset = match3[3] || null;
              date = date.toUpperCase();
              if (!offset && hasTime)
                date += "Z";
            }
          } else {
            date = "";
          }
        }
        super(date);
        if (!isNaN(this.getTime())) {
          this.#hasDate = hasDate;
          this.#hasTime = hasTime;
          this.#offset = offset;
        }
      }
      isDateTime() {
        return this.#hasDate && this.#hasTime;
      }
      isLocal() {
        return !this.#hasDate || !this.#hasTime || !this.#offset;
      }
      isDate() {
        return this.#hasDate && !this.#hasTime;
      }
      isTime() {
        return this.#hasTime && !this.#hasDate;
      }
      isValid() {
        return this.#hasDate || this.#hasTime;
      }
      toISOString() {
        let iso = super.toISOString();
        if (this.isDate())
          return iso.slice(0, 10);
        if (this.isTime())
          return iso.slice(11, 23);
        if (this.#offset === null)
          return iso.slice(0, -1);
        if (this.#offset === "Z")
          return iso;
        let offset = +this.#offset.slice(1, 3) * 60 + +this.#offset.slice(4, 6);
        offset = this.#offset[0] === "-" ? offset : -offset;
        let offsetDate = new Date(this.getTime() - offset * 6e4);
        return offsetDate.toISOString().slice(0, -1) + this.#offset;
      }
      static wrapAsOffsetDateTime(jsDate, offset = "Z") {
        let date = new _TomlDate(jsDate);
        date.#offset = offset;
        return date;
      }
      static wrapAsLocalDateTime(jsDate) {
        let date = new _TomlDate(jsDate);
        date.#offset = null;
        return date;
      }
      static wrapAsLocalDate(jsDate) {
        let date = new _TomlDate(jsDate);
        date.#hasTime = false;
        date.#offset = null;
        return date;
      }
      static wrapAsLocalTime(jsDate) {
        let date = new _TomlDate(jsDate);
        date.#hasDate = false;
        date.#offset = null;
        return date;
      }
    };
    INT_REGEX = /^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/;
    FLOAT_REGEX = /^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/;
    LEADING_ZERO = /^[+-]?0[0-9_]/;
    ESCAPE_REGEX = /^[0-9a-f]{4,8}$/i;
    ESC_MAP = {
      b: "\b",
      t: "	",
      n: "\n",
      f: "\f",
      r: "\r",
      '"': '"',
      "\\": "\\"
    };
    __name(parseString, "parseString");
    __name2(parseString, "parseString");
    __name(parseValue, "parseValue");
    __name2(parseValue, "parseValue");
    __name(sliceAndTrimEndOf, "sliceAndTrimEndOf");
    __name2(sliceAndTrimEndOf, "sliceAndTrimEndOf");
    __name(extractValue, "extractValue");
    __name2(extractValue, "extractValue");
    KEY_PART_RE = /^[a-zA-Z0-9-_]+[ \t]*$/;
    __name(parseKey, "parseKey");
    __name2(parseKey, "parseKey");
    __name(parseInlineTable, "parseInlineTable");
    __name2(parseInlineTable, "parseInlineTable");
    __name(parseArray, "parseArray");
    __name2(parseArray, "parseArray");
    __name(peekTable, "peekTable");
    __name2(peekTable, "peekTable");
    __name(parse3, "parse3");
    __name2(parse3, "parse");
    BARE_KEY = /^[a-z0-9-_]+$/i;
    __name(extendedTypeOf, "extendedTypeOf");
    __name2(extendedTypeOf, "extendedTypeOf");
    __name(isArrayOfTables, "isArrayOfTables");
    __name2(isArrayOfTables, "isArrayOfTables");
    __name(formatString, "formatString");
    __name2(formatString, "formatString");
    __name(stringifyValue, "stringifyValue");
    __name2(stringifyValue, "stringifyValue");
    __name(stringifyInlineTable, "stringifyInlineTable");
    __name2(stringifyInlineTable, "stringifyInlineTable");
    __name(stringifyArray, "stringifyArray");
    __name2(stringifyArray, "stringifyArray");
    __name(stringifyArrayTable, "stringifyArrayTable");
    __name2(stringifyArrayTable, "stringifyArrayTable");
    __name(stringifyTable, "stringifyTable");
    __name2(stringifyTable, "stringifyTable");
    __name(stringify, "stringify");
    __name2(stringify, "stringify");
    dist_default = { parse: parse3, stringify, TomlDate, TomlError };
    ParseError = class extends UserError {
      static {
        __name(this, "ParseError");
      }
      static {
        __name2(this, "ParseError");
      }
      text;
      notes;
      location;
      kind;
      constructor({ text, notes, location, kind: kind2, telemetryMessage }) {
        super(text, { telemetryMessage });
        this.name = this.constructor.name;
        this.text = text;
        this.notes = notes ?? [];
        this.location = location;
        this.kind = kind2 ?? "error";
      }
    };
    APIError = class extends ParseError {
      static {
        __name(this, "APIError");
      }
      static {
        __name2(this, "APIError");
      }
      #status;
      code;
      accountTag;
      constructor({ status: status2, ...rest }) {
        super(rest);
        this.name = this.constructor.name;
        this.#status = status2;
      }
      get status() {
        return this.#status;
      }
      isGatewayError() {
        if (this.#status !== void 0) {
          return [524].includes(this.#status);
        }
        return false;
      }
      isRetryable() {
        return String(this.#status).startsWith("5");
      }
      // Allow `APIError`s to be marked as handled.
      #reportable = true;
      get reportable() {
        return this.#reportable;
      }
      preventReport() {
        this.#reportable = false;
      }
    };
    __name(parseTOML, "parseTOML");
    __name2(parseTOML, "parseTOML");
    __name(parsePackageJSON, "parsePackageJSON");
    __name2(parsePackageJSON, "parsePackageJSON");
    __name(parseJSON, "parseJSON");
    __name2(parseJSON, "parseJSON");
    __name(parseJSONC, "parseJSONC");
    __name2(parseJSONC, "parseJSONC");
    __name(readFileSyncToBuffer, "readFileSyncToBuffer");
    __name2(readFileSyncToBuffer, "readFileSyncToBuffer");
    __name(readFileSync, "readFileSync");
    __name2(readFileSync, "readFileSync");
    __name(indexLocation, "indexLocation");
    __name2(indexLocation, "indexLocation");
    __name(searchLocation, "searchLocation");
    __name2(searchLocation, "searchLocation");
    units = {
      nanoseconds: 1e-9,
      nanosecond: 1e-9,
      microseconds: 1e-6,
      microsecond: 1e-6,
      milliseconds: 1e-3,
      millisecond: 1e-3,
      seconds: 1,
      second: 1,
      minutes: 60,
      minute: 60,
      hours: 3600,
      hour: 3600,
      days: 86400,
      day: 86400,
      weeks: 604800,
      week: 604800,
      month: 18144e3,
      year: 220752e3,
      nsecs: 1e-9,
      nsec: 1e-9,
      usecs: 1e-6,
      usec: 1e-6,
      msecs: 1e-3,
      msec: 1e-3,
      secs: 1,
      sec: 1,
      mins: 60,
      min: 60,
      ns: 1e-9,
      us: 1e-6,
      ms: 1e-3,
      mo: 18144e3,
      yr: 220752e3,
      s: 1,
      m: 60,
      h: 3600,
      d: 86400,
      w: 604800,
      y: 220752e3
    };
    __name(parseHumanDuration, "parseHumanDuration");
    __name2(parseHumanDuration, "parseHumanDuration");
    __name(parseNonHyphenedUuid, "parseNonHyphenedUuid");
    __name2(parseNonHyphenedUuid, "parseNonHyphenedUuid");
    __name(parseByteSize, "parseByteSize");
    __name2(parseByteSize, "parseByteSize");
    UNSUPPORTED_BOMS = [
      {
        buffer: Buffer.from([0, 0, 254, 255]),
        encoding: "UTF-32 BE"
      },
      {
        buffer: Buffer.from([255, 254, 0, 0]),
        encoding: "UTF-32 LE"
      },
      {
        buffer: Buffer.from([254, 255]),
        encoding: "UTF-16 BE"
      },
      {
        buffer: Buffer.from([255, 254]),
        encoding: "UTF-16 LE"
      }
    ];
    __name(removeBOMAndValidate, "removeBOMAndValidate");
    __name2(removeBOMAndValidate, "removeBOMAndValidate");
    __name(absolute, "absolute");
    __name2(absolute, "absolute");
    __name(up, "up");
    __name2(up, "up");
    __name(file, "file");
    __name2(file, "file");
    __name(dedent, "dedent");
    __name2(dedent, "dedent");
    esm_default = dedent;
    __name(resolveWranglerConfigPath, "resolveWranglerConfigPath");
    __name2(resolveWranglerConfigPath, "resolveWranglerConfigPath");
    __name(findWranglerConfig, "findWranglerConfig");
    __name2(findWranglerConfig, "findWranglerConfig");
    __name(findRedirectedWranglerConfig, "findRedirectedWranglerConfig");
    __name2(findRedirectedWranglerConfig, "findRedirectedWranglerConfig");
    __name(isRedirectedRawConfig, "isRedirectedRawConfig");
    __name2(isRedirectedRawConfig, "isRedirectedRawConfig");
    __name(configFormat, "configFormat");
    __name2(configFormat, "configFormat");
    __name(configFileName, "configFileName");
    __name2(configFileName, "configFileName");
    __name(formatConfigSnippet, "formatConfigSnippet");
    __name2(formatConfigSnippet, "formatConfigSnippet");
    parseRawConfigFile = /* @__PURE__ */ __name2((configPath) => {
      if (configPath.endsWith(".toml")) {
        return parseTOML(readFileSync(configPath), configPath);
      }
      if (configPath.endsWith(".json") || configPath.endsWith(".jsonc")) {
        return parseJSONC(readFileSync(configPath), configPath);
      }
      return {};
    }, "parseRawConfigFile");
    exports.experimental_readRawConfig = /* @__PURE__ */ __name2((args, options = {}) => {
      const { configPath, userConfigPath, deployConfigPath, redirected } = resolveWranglerConfigPath(args, options);
      const rawConfig = parseRawConfigFile(configPath ?? "");
      return {
        rawConfig,
        configPath,
        userConfigPath,
        deployConfigPath,
        redirected
      };
    }, "experimental_readRawConfig");
    __name(isDirectory, "isDirectory");
    __name2(isDirectory, "isDirectory");
    __name(removeDir, "removeDir");
    __name2(removeDir, "removeDir");
    __name(removeDirSync, "removeDirSync");
    __name2(removeDirSync, "removeDirSync");
  }
});
function setErrorMap(map2) {
  overrideErrorMap = map2;
}
function getErrorMap() {
  return overrideErrorMap;
}
function addIssueToContext(ctx, issueData) {
  const issue = makeIssue({
    issueData,
    data: ctx.data,
    path: ctx.path,
    errorMaps: [
      ctx.common.contextualErrorMap,
      ctx.schemaErrorMap,
      getErrorMap(),
      errorMap
      // then global default map
    ].filter((x7) => !!x7)
  });
  ctx.common.issues.push(issue);
}
function processCreateParams(params) {
  if (!params)
    return {};
  const { errorMap: errorMap22, invalid_type_error, required_error, description } = params;
  if (errorMap22 && (invalid_type_error || required_error)) {
    throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
  }
  if (errorMap22)
    return { errorMap: errorMap22, description };
  const customMap = /* @__PURE__ */ __name2((iss, ctx) => {
    if (iss.code !== "invalid_type")
      return { message: ctx.defaultError };
    if (typeof ctx.data === "undefined") {
      return { message: required_error !== null && required_error !== void 0 ? required_error : ctx.defaultError };
    }
    return { message: invalid_type_error !== null && invalid_type_error !== void 0 ? invalid_type_error : ctx.defaultError };
  }, "customMap");
  return { errorMap: customMap, description };
}
function isValidIP(ip, version5) {
  if ((version5 === "v4" || !version5) && ipv4Regex.test(ip)) {
    return true;
  }
  if ((version5 === "v6" || !version5) && ipv6Regex.test(ip)) {
    return true;
  }
  return false;
}
function floatSafeRemainder(val2, step) {
  const valDecCount = (val2.toString().split(".")[1] || "").length;
  const stepDecCount = (step.toString().split(".")[1] || "").length;
  const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;
  const valInt = parseInt(val2.toFixed(decCount).replace(".", ""));
  const stepInt = parseInt(step.toFixed(decCount).replace(".", ""));
  return valInt % stepInt / Math.pow(10, decCount);
}
function deepPartialify(schema) {
  if (schema instanceof ZodObject) {
    const newShape = {};
    for (const key in schema.shape) {
      const fieldSchema = schema.shape[key];
      newShape[key] = ZodOptional.create(deepPartialify(fieldSchema));
    }
    return new ZodObject({
      ...schema._def,
      shape: /* @__PURE__ */ __name2(() => newShape, "shape")
    });
  } else if (schema instanceof ZodArray) {
    return new ZodArray({
      ...schema._def,
      type: deepPartialify(schema.element)
    });
  } else if (schema instanceof ZodOptional) {
    return ZodOptional.create(deepPartialify(schema.unwrap()));
  } else if (schema instanceof ZodNullable) {
    return ZodNullable.create(deepPartialify(schema.unwrap()));
  } else if (schema instanceof ZodTuple) {
    return ZodTuple.create(schema.items.map((item) => deepPartialify(item)));
  } else {
    return schema;
  }
}
function mergeValues(a7, b11) {
  const aType = getParsedType(a7);
  const bType = getParsedType(b11);
  if (a7 === b11) {
    return { valid: true, data: a7 };
  } else if (aType === ZodParsedType.object && bType === ZodParsedType.object) {
    const bKeys = util.objectKeys(b11);
    const sharedKeys = util.objectKeys(a7).filter((key) => bKeys.indexOf(key) !== -1);
    const newObj = { ...a7, ...b11 };
    for (const key of sharedKeys) {
      const sharedValue = mergeValues(a7[key], b11[key]);
      if (!sharedValue.valid) {
        return { valid: false };
      }
      newObj[key] = sharedValue.data;
    }
    return { valid: true, data: newObj };
  } else if (aType === ZodParsedType.array && bType === ZodParsedType.array) {
    if (a7.length !== b11.length) {
      return { valid: false };
    }
    const newArray = [];
    for (let index = 0; index < a7.length; index++) {
      const itemA = a7[index];
      const itemB = b11[index];
      const sharedValue = mergeValues(itemA, itemB);
      if (!sharedValue.valid) {
        return { valid: false };
      }
      newArray.push(sharedValue.data);
    }
    return { valid: true, data: newArray };
  } else if (aType === ZodParsedType.date && bType === ZodParsedType.date && +a7 === +b11) {
    return { valid: true, data: a7 };
  } else {
    return { valid: false };
  }
}
function createZodEnum(values, params) {
  return new ZodEnum({
    values,
    typeName: ZodFirstPartyTypeKind.ZodEnum,
    ...processCreateParams(params)
  });
}
function isValidWorkflowName(name2) {
  if (typeof name2 !== "string") {
    return false;
  }
  if (name2.length > MAX_WORKFLOW_NAME_LENGTH) {
    return false;
  }
  return ALLOWED_WORKFLOW_NAME_REGEX.test(name2);
}
function getGlobalWranglerConfigPath() {
  const configDir = mod_esm_default(".wrangler").config();
  const legacyConfigDir = path3__namespace.default.join(os11__namespace.default.homedir(), ".wrangler");
  if (isDirectory(legacyConfigDir)) {
    return legacyConfigDir;
  } else {
    return configDir;
  }
}
function getBooleanEnvironmentVariableFactory(options) {
  return () => {
    if (!(options.variableName in process.env) || process.env[options.variableName] === void 0) {
      return typeof options.defaultValue === "function" ? options.defaultValue() : options.defaultValue;
    }
    switch (process.env[options.variableName]?.toLowerCase()) {
      case "true":
        return true;
      case "false":
        return false;
      default:
        throw new UserError(
          `Expected ${options.variableName} to be "true" or "false", but got ${JSON.stringify(
            process.env[options.variableName]
          )}`
        );
    }
  };
}
function getEnvironmentVariableFactory({
  variableName,
  deprecatedName,
  choices,
  defaultValue
}) {
  let hasWarned = false;
  return () => {
    if (variableName in process.env) {
      return getProcessEnv(variableName, choices);
    }
    if (deprecatedName && deprecatedName in process.env) {
      if (!hasWarned) {
        hasWarned = true;
        console.warn(
          `Using "${deprecatedName}" environment variable. This is deprecated. Please use "${variableName}", instead.`
        );
      }
      return getProcessEnv(deprecatedName, choices);
    }
    return defaultValue?.();
  };
}
function getProcessEnv(variableName, choices) {
  assertOneOf(choices, process.env[variableName]);
  return process.env[variableName];
}
function assertOneOf(choices, value) {
  if (Array.isArray(choices) && !choices.includes(value)) {
    throw new UserError(
      `Expected ${JSON.stringify(value)} to be one of ${JSON.stringify(choices)}`
    );
  }
}
function getComplianceRegionSubdomain(complianceConfig) {
  return getCloudflareComplianceRegion(complianceConfig) === "fedramp_high" ? ".fed" : "";
}
function getStagingSubdomain() {
  return getCloudflareApiEnvironmentFromEnv() === "staging" ? ".staging" : "";
}
function indentText(str) {
  return str.split("\n").map(
    (line, index) => (index === 0 ? line : `  ${line}`).replace(/^\s*$/, "")
  ).join("\n");
}
function deprecated(diagnostics, config, fieldPath, message, remove, title = "Deprecation", type = "warning") {
  const BOLD = "\x1B[1m";
  const NORMAL = "\x1B[0m";
  const diagnosticMessage = `${BOLD}${title}${NORMAL}: "${fieldPath}":
${message}`;
  const result = unwindPropertyPath(config, fieldPath);
  if (result !== void 0 && result.field in result.container) {
    diagnostics[`${type}s`].push(diagnosticMessage);
    if (remove) {
      delete result.container[result.field];
    }
  }
}
function experimental(diagnostics, config, fieldPath) {
  const result = unwindPropertyPath(config, fieldPath);
  if (result !== void 0 && result.field in result.container && !("WRANGLER_DISABLE_EXPERIMENTAL_WARNING" in process.env)) {
    diagnostics.warnings.push(
      `"${fieldPath}" fields are experimental and may change or break at any time.`
    );
  }
}
function inheritable(diagnostics, topLevelEnv, rawEnv, field, validate3, defaultValue, transformFn = (v8) => v8) {
  validate3(diagnostics, field, rawEnv[field], topLevelEnv);
  return (
    // `rawEnv === topLevelEnv` is a special case where the user has provided an environment name
    // but that named environment is not actually defined in the configuration.
    // In that case we have reused the topLevelEnv as the rawEnv,
    // and so we need to process the `transformFn()` anyway rather than just using the field in the `rawEnv`.
    (rawEnv !== topLevelEnv ? rawEnv[field] : void 0) ?? transformFn(topLevelEnv?.[field]) ?? defaultValue
  );
}
function inheritableInWranglerEnvironments(diagnostics, useServiceEnvironments2, topLevelEnv, rawEnv, field, validate3, transformFn = (v8) => v8, defaultValue) {
  const usingServiceEnvironments = useServiceEnvironments2 && topLevelEnv !== void 0;
  return usingServiceEnvironments ? notAllowedInNamedServiceEnvironment(
    diagnostics,
    topLevelEnv,
    rawEnv,
    field
  ) : inheritable(
    diagnostics,
    topLevelEnv,
    rawEnv,
    field,
    validate3,
    defaultValue,
    transformFn
  );
}
function notAllowedInNamedServiceEnvironment(diagnostics, topLevelEnv, rawEnv, field) {
  if (field in rawEnv) {
    diagnostics.errors.push(
      `The "${field}" field is not allowed in named service environments.
Please remove the field from this environment.`
    );
  }
  return topLevelEnv[field];
}
function notInheritable(diagnostics, topLevelEnv, rawConfig, rawEnv, envName, field, validate3, defaultValue) {
  if (rawEnv[field] !== void 0) {
    validate3(diagnostics, field, rawEnv[field], topLevelEnv);
  } else {
    if (rawConfig?.[field] !== void 0) {
      diagnostics.warnings.push(
        `"${field}" exists at the top level, but not on "env.${envName}".
This is not what you probably want, since "${field}" is not inherited by environments.
Please add "${field}" to "env.${envName}".`
      );
    }
  }
  return rawEnv[field] ?? defaultValue;
}
function unwindPropertyPath(root, path410) {
  let container = root;
  const parts = path410.split(".");
  for (let i7 = 0; i7 < parts.length - 1; i7++) {
    if (!hasProperty(container, parts[i7])) {
      return;
    }
    container = container[parts[i7]];
  }
  return { container, field: parts[parts.length - 1] };
}
function isValidR2BucketName(name2) {
  return typeof name2 === "string" && /^[a-z0-9][a-z0-9-]{1,61}[a-z0-9]$/.test(name2);
}
function getBindingTypeFriendlyName(bindingType) {
  if (bindingType in bindingTypeFriendlyNames) {
    return bindingTypeFriendlyNames[bindingType];
  }
  if (bindingType.startsWith("unsafe_")) {
    return "Unsafe Metadata";
  }
  return bindingType;
}
function isPagesConfig(rawConfig) {
  return rawConfig.pages_build_output_dir !== void 0;
}
function normalizeAndValidateConfig(rawConfig, configPath, userConfigPath, args, preserveOriginalMain = false) {
  const diagnostics = new Diagnostics(
    `Processing ${configPath ? path3__namespace.default.relative(process.cwd(), configPath) : "wrangler"} configuration:`
  );
  validateOptionalProperty(
    diagnostics,
    "",
    "legacy_env",
    rawConfig.legacy_env,
    "boolean"
  );
  validateOptionalProperty(
    diagnostics,
    "",
    "send_metrics",
    rawConfig.send_metrics,
    "boolean"
  );
  validateOptionalProperty(
    diagnostics,
    "",
    "keep_vars",
    rawConfig.keep_vars,
    "boolean"
  );
  validateOptionalProperty(
    diagnostics,
    "",
    "pages_build_output_dir",
    rawConfig.pages_build_output_dir,
    "string"
  );
  validateOptionalProperty(
    diagnostics,
    "",
    "$schema",
    rawConfig.$schema,
    "string"
  );
  const useServiceEnvironments2 = !(args["legacy-env"] ?? rawConfig.legacy_env ?? true);
  if (useServiceEnvironments2) {
    diagnostics.warnings.push(
      "Service environments are deprecated, and will be removed in the future. DO NOT USE IN PRODUCTION."
    );
  }
  const isDispatchNamespace = typeof args["dispatch-namespace"] === "string" && args["dispatch-namespace"].trim() !== "";
  const topLevelEnv = normalizeAndValidateEnvironment(
    diagnostics,
    configPath,
    rawConfig,
    isDispatchNamespace,
    preserveOriginalMain
  );
  const isRedirectedConfig = isRedirectedRawConfig(
    rawConfig,
    configPath,
    userConfigPath
  );
  const definedEnvironments = Object.keys(rawConfig.env ?? {});
  if (isRedirectedConfig && definedEnvironments.length > 0) {
    diagnostics.errors.push(
      dedent`
				Redirected configurations cannot include environments but the following have been found:\n${definedEnvironments.map((env6) => `	- ${env6}`).join("\n")}


				Such configurations are generated by tools, meaning that one of the tools
				your application is using is generating the incorrect configuration.
				Report this issue to the tool's author so that this can be fixed there.
				`
    );
  }
  const envName = args.env ?? getCloudflareEnv();
  assert53__default.default(envName === void 0 || typeof envName === "string");
  let activeEnv = topLevelEnv;
  if (envName) {
    if (isRedirectedConfig) {
      if (!isPagesConfig(rawConfig) && rawConfig.targetEnvironment && rawConfig.targetEnvironment !== envName) {
        const via = args.env !== void 0 ? "via the `--env/-e` CLI argument" : "via the CLOUDFLARE_ENV environment variable";
        throw new Error(dedent`
					You have specified the environment "${envName}" ${via}.
					This does not match the target environment "${rawConfig.targetEnvironment}" that was used when building the application.
					Perhaps you need to re-run the custom build of the project with "${envName}" as the selected environment?
				`);
      }
    } else {
      const envDiagnostics = new Diagnostics(
        `"env.${envName}" environment configuration`
      );
      const rawEnv = rawConfig.env?.[envName];
      if (rawEnv !== void 0) {
        activeEnv = normalizeAndValidateEnvironment(
          envDiagnostics,
          configPath,
          rawEnv,
          isDispatchNamespace,
          preserveOriginalMain,
          envName,
          topLevelEnv,
          useServiceEnvironments2,
          rawConfig
        );
        diagnostics.addChild(envDiagnostics);
      } else if (!isPagesConfig(rawConfig)) {
        activeEnv = normalizeAndValidateEnvironment(
          envDiagnostics,
          configPath,
          topLevelEnv,
          // in this case reuse the topLevelEnv to ensure that nonInherited fields are not removed
          isDispatchNamespace,
          preserveOriginalMain,
          envName,
          topLevelEnv,
          useServiceEnvironments2,
          rawConfig
        );
        const envNames = rawConfig.env ? `The available configured environment names are: ${JSON.stringify(
          Object.keys(rawConfig.env)
        )}
` : "";
        const message = `No environment found in configuration with name "${envName}".
Before using \`--env=${envName}\` there should be an equivalent environment section in the configuration.
${envNames}
Consider adding an environment configuration section to the ${configFileName(configPath)} file:
\`\`\`
[env.` + envName + "]\n```\n";
        if (envNames.length > 0) {
          diagnostics.errors.push(message);
        } else {
          diagnostics.warnings.push(message);
        }
      }
    }
  }
  const config = {
    configPath,
    userConfigPath,
    topLevelName: isRedirectedConfig ? rawConfig.topLevelName : rawConfig.name,
    definedEnvironments: isRedirectedConfig ? rawConfig.definedEnvironments : definedEnvironments,
    targetEnvironment: isRedirectedConfig ? rawConfig.targetEnvironment : envName,
    pages_build_output_dir: normalizeAndValidatePagesBuildOutputDir(
      configPath,
      rawConfig.pages_build_output_dir
    ),
    /** Legacy_env is wrangler environments, as opposed to service environments. Wrangler environments is not legacy.  */
    legacy_env: !useServiceEnvironments2,
    send_metrics: rawConfig.send_metrics,
    keep_vars: rawConfig.keep_vars,
    ...activeEnv,
    dev: normalizeAndValidateDev(diagnostics, rawConfig.dev ?? {}, args),
    site: normalizeAndValidateSite(
      diagnostics,
      configPath,
      rawConfig,
      activeEnv.main
    ),
    alias: normalizeAndValidateAliases(diagnostics, configPath, rawConfig),
    wasm_modules: normalizeAndValidateModulePaths(
      diagnostics,
      configPath,
      "wasm_modules",
      rawConfig.wasm_modules
    ),
    text_blobs: normalizeAndValidateModulePaths(
      diagnostics,
      configPath,
      "text_blobs",
      rawConfig.text_blobs
    ),
    data_blobs: normalizeAndValidateModulePaths(
      diagnostics,
      configPath,
      "data_blobs",
      rawConfig.data_blobs
    )
  };
  validateBindingsHaveUniqueNames(diagnostics, config);
  validateAdditionalProperties(
    diagnostics,
    "top-level",
    Object.keys(rawConfig),
    [...Object.keys(config), "env", "$schema"]
  );
  applyPythonConfig(config, args);
  return { config, diagnostics };
}
function applyPythonConfig(config, args) {
  const mainModule = args.script ?? config.main;
  if (typeof mainModule === "string" && mainModule.endsWith(".py")) {
    config.no_bundle = true;
    if (!config.rules.some((rule) => rule.type === "PythonModule")) {
      config.rules.push({ type: "PythonModule", globs: ["**/*.py"] });
    }
    if (!config.compatibility_flags.includes("python_workers")) {
      throw new UserError(
        "The `python_workers` compatibility flag is required to use Python."
      );
    }
  }
}
function normalizeAndValidateBuild(diagnostics, rawEnv, rawBuild, configPath) {
  const { command: command2, cwd: cwd2, watch_dir = "./src", ...rest } = rawBuild;
  validateAdditionalProperties(diagnostics, "build", Object.keys(rest), []);
  validateOptionalProperty(diagnostics, "build", "command", command2, "string");
  validateOptionalProperty(diagnostics, "build", "cwd", cwd2, "string");
  if (Array.isArray(watch_dir)) {
    validateTypedArray(diagnostics, "build.watch_dir", watch_dir, "string");
  } else {
    validateOptionalProperty(
      diagnostics,
      "build",
      "watch_dir",
      watch_dir,
      "string"
    );
  }
  return {
    command: command2,
    watch_dir: (
      // - `watch_dir` only matters when `command` is defined, so we apply
      // a default only when `command` is defined
      // - `configPath` will always be defined since `build` can only
      // be configured in the Wrangler configuration file, but who knows, that may
      // change in the future, so we do a check anyway
      command2 && configPath ? Array.isArray(watch_dir) ? watch_dir.map(
        (dir2) => path3__namespace.default.relative(
          process.cwd(),
          path3__namespace.default.join(path3__namespace.default.dirname(configPath), `${dir2}`)
        )
      ) : path3__namespace.default.relative(
        process.cwd(),
        path3__namespace.default.join(path3__namespace.default.dirname(configPath), `${watch_dir}`)
      ) : watch_dir
    ),
    cwd: cwd2
  };
}
function normalizeAndValidateMainField(configPath, rawMain) {
  const configDir = path3__namespace.default.dirname(configPath ?? "wrangler.toml");
  if (rawMain !== void 0) {
    if (typeof rawMain === "string") {
      const directory = path3__namespace.default.resolve(configDir);
      return path3__namespace.default.resolve(directory, rawMain);
    } else {
      return rawMain;
    }
  } else {
    return;
  }
}
function normalizeAndValidateBaseDirField(configPath, rawDir) {
  const configDir = path3__namespace.default.dirname(configPath ?? "wrangler.toml");
  if (rawDir !== void 0) {
    if (typeof rawDir === "string") {
      const directory = path3__namespace.default.resolve(configDir);
      return path3__namespace.default.resolve(directory, rawDir);
    } else {
      return rawDir;
    }
  } else {
    return;
  }
}
function normalizeAndValidatePagesBuildOutputDir(configPath, rawPagesDir) {
  const configDir = path3__namespace.default.dirname(configPath ?? "wrangler.toml");
  if (rawPagesDir !== void 0) {
    if (typeof rawPagesDir === "string") {
      const directory = path3__namespace.default.resolve(configDir);
      return path3__namespace.default.resolve(directory, rawPagesDir);
    } else {
      return rawPagesDir;
    }
  } else {
    return;
  }
}
function normalizeAndValidateDev(diagnostics, rawDev, args) {
  assert53__default.default(typeof args === "object" && args !== null && !Array.isArray(args));
  const {
    localProtocol: localProtocolArg,
    upstreamProtocol: upstreamProtocolArg,
    remote: remoteArg,
    enableContainers: enableContainersArg,
    generateTypes: generateTypesArg
  } = args;
  assert53__default.default(
    localProtocolArg === void 0 || localProtocolArg === "http" || localProtocolArg === "https"
  );
  assert53__default.default(
    upstreamProtocolArg === void 0 || upstreamProtocolArg === "http" || upstreamProtocolArg === "https"
  );
  assert53__default.default(remoteArg === void 0 || typeof remoteArg === "boolean");
  assert53__default.default(
    enableContainersArg === void 0 || typeof enableContainersArg === "boolean"
  );
  assert53__default.default(
    generateTypesArg === void 0 || typeof generateTypesArg === "boolean"
  );
  const {
    // On Windows, when specifying `localhost` as the socket hostname, `workerd`
    // will only listen on the IPv4 loopback `127.0.0.1`, not the IPv6 `::1`:
    // https://github.com/cloudflare/workerd/issues/1408
    // On Node 17+, `fetch()` will only try to fetch the IPv6 address.
    // For now, on Windows, we default to listening on IPv4 only and using
    // `127.0.0.1` when sending control requests to `workerd` (e.g. with the
    // `ProxyController`).
    ip = process.platform === "win32" ? "127.0.0.1" : "localhost",
    port,
    inspector_port,
    inspector_ip,
    local_protocol = localProtocolArg ?? "http",
    // In remote mode upstream_protocol must be https, otherwise it defaults to local_protocol.
    upstream_protocol = upstreamProtocolArg ?? remoteArg ? "https" : local_protocol,
    host,
    enable_containers = enableContainersArg ?? true,
    container_engine,
    generate_types = generateTypesArg ?? false,
    ...rest
  } = rawDev;
  validateAdditionalProperties(diagnostics, "dev", Object.keys(rest), []);
  validateOptionalProperty(diagnostics, "dev", "ip", ip, "string");
  validateOptionalProperty(diagnostics, "dev", "port", port, "number");
  validateOptionalProperty(
    diagnostics,
    "dev",
    "inspector_port",
    inspector_port,
    "number"
  );
  validateOptionalProperty(
    diagnostics,
    "dev",
    "inspector_ip",
    inspector_ip,
    "string"
  );
  validateOptionalProperty(
    diagnostics,
    "dev",
    "local_protocol",
    local_protocol,
    "string",
    ["http", "https"]
  );
  validateOptionalProperty(
    diagnostics,
    "dev",
    "upstream_protocol",
    upstream_protocol,
    "string",
    ["http", "https"]
  );
  validateOptionalProperty(diagnostics, "dev", "host", host, "string");
  validateOptionalProperty(
    diagnostics,
    "dev",
    "enable_containers",
    enable_containers,
    "boolean"
  );
  validateOptionalProperty(
    diagnostics,
    "dev",
    "container_engine",
    container_engine,
    "string"
  );
  validateOptionalProperty(
    diagnostics,
    "dev",
    "generate_types",
    generate_types,
    "boolean"
  );
  return {
    ip,
    port,
    inspector_port,
    inspector_ip,
    local_protocol,
    upstream_protocol,
    host,
    enable_containers,
    container_engine,
    generate_types
  };
}
function normalizeAndValidateAssets(diagnostics, topLevelEnv, rawEnv) {
  return inheritable(
    diagnostics,
    topLevelEnv,
    rawEnv,
    "assets",
    validateAssetsConfig,
    void 0
  );
}
function normalizeAndValidateSite(diagnostics, configPath, rawConfig, mainEntryPoint) {
  if (rawConfig?.site !== void 0) {
    const { bucket, include = [], exclude = [], ...rest } = rawConfig.site;
    validateAdditionalProperties(diagnostics, "site", Object.keys(rest), [
      "entry-point"
    ]);
    validateRequiredProperty(diagnostics, "site", "bucket", bucket, "string");
    validateTypedArray(diagnostics, "sites.include", include, "string");
    validateTypedArray(diagnostics, "sites.exclude", exclude, "string");
    validateOptionalProperty(
      diagnostics,
      "site",
      "entry-point",
      rawConfig.site["entry-point"],
      "string"
    );
    deprecated(
      diagnostics,
      rawConfig,
      `site.entry-point`,
      `Delete the \`site.entry-point\` field, then add the top level \`main\` field to your configuration file:
\`\`\`
main = "${path3__namespace.default.join(
        String(rawConfig.site["entry-point"]) || "workers-site",
        path3__namespace.default.extname(String(rawConfig.site["entry-point"]) || "workers-site") ? "" : "index.js"
      )}"
\`\`\``,
      false,
      void 0,
      "warning"
    );
    let siteEntryPoint = rawConfig.site["entry-point"];
    if (!mainEntryPoint && !siteEntryPoint) {
      diagnostics.warnings.push(
        `Because you've defined a [site] configuration, we're defaulting to "workers-site" for the deprecated \`site.entry-point\`field.
Add the top level \`main\` field to your configuration file:
\`\`\`
main = "workers-site/index.js"
\`\`\``
      );
      siteEntryPoint = "workers-site";
    } else if (mainEntryPoint && siteEntryPoint) {
      diagnostics.errors.push(
        `Don't define both the \`main\` and \`site.entry-point\` fields in your configuration.
They serve the same purpose: to point to the entry-point of your worker.
Delete the deprecated \`site.entry-point\` field from your config.`
      );
    }
    if (configPath && siteEntryPoint) {
      siteEntryPoint = path3__namespace.default.relative(
        process.cwd(),
        path3__namespace.default.join(path3__namespace.default.dirname(configPath), siteEntryPoint)
      );
    }
    return {
      bucket,
      "entry-point": siteEntryPoint,
      include,
      exclude
    };
  }
  return void 0;
}
function normalizeAndValidateAliases(diagnostics, configPath, rawConfig) {
  if (rawConfig?.alias === void 0) {
    return void 0;
  }
  if (["string", "boolean", "number"].includes(typeof rawConfig?.alias) || typeof rawConfig?.alias !== "object") {
    diagnostics.errors.push(
      `Expected alias to be an object, but got ${typeof rawConfig?.alias}`
    );
    return void 0;
  }
  let isValid22 = true;
  for (const [key, value] of Object.entries(rawConfig?.alias)) {
    if (typeof value !== "string") {
      diagnostics.errors.push(
        `Expected alias["${key}"] to be a string, but got ${typeof value}`
      );
      isValid22 = false;
    }
  }
  if (isValid22) {
    return rawConfig.alias;
  }
  return;
}
function normalizeAndValidateModulePaths(diagnostics, configPath, field, rawMapping) {
  if (rawMapping === void 0) {
    return void 0;
  }
  const mapping = {};
  for (const [name2, filePath] of Object.entries(rawMapping)) {
    if (isString(diagnostics, `${field}['${name2}']`, filePath, void 0)) {
      if (configPath) {
        mapping[name2] = configPath ? path3__namespace.default.relative(
          process.cwd(),
          path3__namespace.default.join(path3__namespace.default.dirname(configPath), filePath)
        ) : filePath;
      }
    }
  }
  return mapping;
}
function isValidRouteValue(item) {
  if (!item) {
    return false;
  }
  if (typeof item === "string") {
    return true;
  }
  if (typeof item === "object") {
    if (!hasProperty(item, "pattern") || typeof item.pattern !== "string") {
      return false;
    }
    const otherKeys = Object.keys(item).length - 1;
    const hasZoneId = hasProperty(item, "zone_id") && typeof item.zone_id === "string";
    const hasZoneName = hasProperty(item, "zone_name") && typeof item.zone_name === "string";
    const hasCustomDomainFlag = hasProperty(item, "custom_domain") && typeof item.custom_domain === "boolean";
    if (otherKeys === 2 && hasCustomDomainFlag && (hasZoneId || hasZoneName)) {
      return true;
    } else if (otherKeys === 1 && (hasZoneId || hasZoneName || hasCustomDomainFlag)) {
      return true;
    }
  }
  return false;
}
function mutateEmptyStringAccountIDValue(diagnostics, rawEnv) {
  if (rawEnv.account_id === "") {
    diagnostics.warnings.push(
      `The "account_id" field in your configuration is an empty string and will be ignored.
Please remove the "account_id" field from your configuration.`
    );
    rawEnv.account_id = void 0;
  }
  return rawEnv;
}
function mutateEmptyStringRouteValue(diagnostics, rawEnv) {
  if (rawEnv["route"] === "") {
    diagnostics.warnings.push(
      `The "route" field in your configuration is an empty string and will be ignored.
Please remove the "route" field from your configuration.`
    );
    rawEnv["route"] = void 0;
  }
  return rawEnv;
}
function normalizeAndValidateRoute(diagnostics, topLevelEnv, rawEnv) {
  return inheritable(
    diagnostics,
    topLevelEnv,
    mutateEmptyStringRouteValue(diagnostics, rawEnv),
    "route",
    isRoute,
    void 0
  );
}
function validateRoutes(diagnostics, topLevelEnv, rawEnv) {
  return inheritable(
    diagnostics,
    topLevelEnv,
    rawEnv,
    "routes",
    all(isRouteArray, isMutuallyExclusiveWith(rawEnv, "route")),
    void 0
  );
}
function normalizeAndValidatePlacement(diagnostics, topLevelEnv, rawEnv) {
  if (rawEnv.placement) {
    const placement = rawEnv.placement;
    const hasHint = "hint" in placement;
    const hasRegion = "region" in placement;
    const hasHost = "host" in placement;
    const hasHostname = "hostname" in placement;
    const hasTargetedFields = hasRegion || hasHost || hasHostname;
    if (hasHint && hasTargetedFields) {
      diagnostics.errors.push(
        `"placement" cannot have both "hint" (smart format) and "region"/"host"/"hostname" (targeted format) fields`
      );
      return inheritable(
        diagnostics,
        topLevelEnv,
        rawEnv,
        "placement",
        () => true,
        void 0
      );
    }
    if (hasHint) {
      validateRequiredProperty(
        diagnostics,
        "placement",
        "mode",
        placement.mode,
        "string",
        ["off", "smart"]
      );
      const mode = placement.mode;
      const hint = placement.hint;
      if (hint !== void 0 && typeof hint !== "string") {
        diagnostics.errors.push(
          `"placement.hint" must be a string when "placement.mode" is "${mode}"`
        );
      }
      if (hint && mode !== "smart") {
        diagnostics.errors.push(
          `"placement.hint" can only be set when "placement.mode" is "smart"`
        );
      }
    } else if (hasTargetedFields) {
      validateOptionalProperty(
        diagnostics,
        "placement",
        "mode",
        placement.mode,
        "string",
        ["off", "targeted"]
      );
      if (hasRegion) {
        validateOptionalProperty(
          diagnostics,
          "placement",
          "region",
          placement.region,
          "string"
        );
      }
      if (hasHost) {
        validateOptionalProperty(
          diagnostics,
          "placement",
          "host",
          placement.host,
          "string"
        );
      }
      if (hasHostname) {
        validateOptionalProperty(
          diagnostics,
          "placement",
          "hostname",
          placement.hostname,
          "string"
        );
      }
      const fieldsPresent = [hasRegion, hasHost, hasHostname].filter(Boolean);
      if (fieldsPresent.length > 1) {
        const presentFields = [];
        if (hasRegion) {
          presentFields.push("region");
        }
        if (hasHost) {
          presentFields.push("host");
        }
        if (hasHostname) {
          presentFields.push("hostname");
        }
        diagnostics.errors.push(
          `"placement" fields ${presentFields.map((f8) => `"${f8}"`).join(", ")} are mutually exclusive. Only one can be specified.`
        );
      }
    } else {
      validateRequiredProperty(
        diagnostics,
        "placement",
        "mode",
        placement.mode,
        "string",
        ["off", "smart", "targeted"]
      );
    }
  }
  return inheritable(
    diagnostics,
    topLevelEnv,
    rawEnv,
    "placement",
    () => true,
    void 0
  );
}
function validateTailConsumer(diagnostics, field, value) {
  if (typeof value !== "object" || value === null) {
    diagnostics.errors.push(
      `"${field}" should be an object but got ${JSON.stringify(value)}.`
    );
    return false;
  }
  let isValid22 = true;
  isValid22 = isValid22 && validateRequiredProperty(
    diagnostics,
    field,
    "service",
    value.service,
    "string"
  );
  isValid22 = isValid22 && validateOptionalProperty(
    diagnostics,
    field,
    "environment",
    value.environment,
    "string"
  );
  return isValid22;
}
function validateStreamingTailConsumer(diagnostics, field, value) {
  if (typeof value !== "object" || value === null || Array.isArray(value)) {
    diagnostics.errors.push(
      `"${field}" should be an object but got ${JSON.stringify(value)}.`
    );
    return false;
  }
  return validateRequiredProperty(
    diagnostics,
    field,
    "service",
    value.service,
    "string"
  );
}
function normalizeAndValidateEnvironment(diagnostics, configPath, rawEnv, isDispatchNamespace, preserveOriginalMain, envName = "top level", topLevelEnv, useServiceEnvironments2, rawConfig) {
  deprecated(
    diagnostics,
    rawEnv,
    // @ts-expect-error Removed from the config type
    "node_compat",
    `The "node_compat" field is no longer supported as of Wrangler v4. Instead, use the \`nodejs_compat\` compatibility flag. This includes the functionality from legacy \`node_compat\` polyfills and natively implemented Node.js APIs. See https://developers.cloudflare.com/workers/runtime-apis/nodejs for more information.`,
    true,
    "Removed",
    "error"
  );
  experimental(diagnostics, rawEnv, "unsafe");
  experimental(diagnostics, rawEnv, "secrets");
  const route = normalizeAndValidateRoute(diagnostics, topLevelEnv, rawEnv);
  const account_id = inheritableInWranglerEnvironments(
    diagnostics,
    useServiceEnvironments2,
    topLevelEnv,
    mutateEmptyStringAccountIDValue(diagnostics, rawEnv),
    "account_id",
    isString,
    void 0,
    void 0
  );
  const routes = validateRoutes(diagnostics, topLevelEnv, rawEnv);
  const workers_dev = inheritable(
    diagnostics,
    topLevelEnv,
    rawEnv,
    "workers_dev",
    isBoolean,
    void 0
  );
  const preview_urls = inheritable(
    diagnostics,
    topLevelEnv,
    rawEnv,
    "preview_urls",
    isBoolean,
    void 0
  );
  const build5 = normalizeAndValidateBuild(
    diagnostics,
    rawEnv,
    rawEnv.build ?? topLevelEnv?.build ?? {},
    configPath
  );
  const environment = {
    // Inherited fields
    account_id,
    compatibility_date: inheritable(
      diagnostics,
      topLevelEnv,
      rawEnv,
      "compatibility_date",
      validateCompatibilityDate,
      void 0
    ),
    compatibility_flags: inheritable(
      diagnostics,
      topLevelEnv,
      rawEnv,
      "compatibility_flags",
      isStringArray,
      []
    ),
    jsx_factory: inheritable(
      diagnostics,
      topLevelEnv,
      rawEnv,
      "jsx_factory",
      isString,
      "React.createElement"
    ),
    jsx_fragment: inheritable(
      diagnostics,
      topLevelEnv,
      rawEnv,
      "jsx_fragment",
      isString,
      "React.Fragment"
    ),
    tsconfig: validateAndNormalizeTsconfig(
      diagnostics,
      topLevelEnv,
      rawEnv,
      configPath
    ),
    rules: validateAndNormalizeRules(diagnostics, topLevelEnv, rawEnv, envName),
    name: inheritableInWranglerEnvironments(
      diagnostics,
      useServiceEnvironments2,
      topLevelEnv,
      rawEnv,
      "name",
      isDispatchNamespace ? isString : isValidName,
      appendEnvName(envName),
      void 0
    ),
    main: preserveOriginalMain ? inheritable(
      diagnostics,
      topLevelEnv,
      rawEnv,
      "main",
      isString,
      void 0
    ) : normalizeAndValidateMainField(
      configPath,
      inheritable(
        diagnostics,
        topLevelEnv,
        rawEnv,
        "main",
        isString,
        void 0
      )
    ),
    find_additional_modules: inheritable(
      diagnostics,
      topLevelEnv,
      rawEnv,
      "find_additional_modules",
      isBoolean,
      void 0
    ),
    preserve_file_names: inheritable(
      diagnostics,
      topLevelEnv,
      rawEnv,
      "preserve_file_names",
      isBoolean,
      void 0
    ),
    base_dir: normalizeAndValidateBaseDirField(
      configPath,
      inheritable(
        diagnostics,
        topLevelEnv,
        rawEnv,
        "base_dir",
        isString,
        void 0
      )
    ),
    route,
    routes,
    triggers: inheritable(
      diagnostics,
      topLevelEnv,
      rawEnv,
      "triggers",
      validateTriggers,
      { crons: void 0 }
    ),
    assets: normalizeAndValidateAssets(diagnostics, topLevelEnv, rawEnv),
    limits: normalizeAndValidateLimits(diagnostics, topLevelEnv, rawEnv),
    placement: normalizeAndValidatePlacement(diagnostics, topLevelEnv, rawEnv),
    build: build5,
    workers_dev,
    preview_urls,
    // Not inherited fields
    vars: notInheritable(
      diagnostics,
      topLevelEnv,
      rawConfig,
      rawEnv,
      envName,
      "vars",
      validateVars(envName),
      {}
    ),
    secrets: notInheritable(
      diagnostics,
      topLevelEnv,
      rawConfig,
      rawEnv,
      envName,
      "secrets",
      validateSecrets(envName),
      void 0
    ),
    define: notInheritable(
      diagnostics,
      topLevelEnv,
      rawConfig,
      rawEnv,
      envName,
      "define",
      validateDefines(envName),
      {}
    ),
    durable_objects: notInheritable(
      diagnostics,
      topLevelEnv,
      rawConfig,
      rawEnv,
      envName,
      "durable_objects",
      validateBindingsProperty(envName, validateDurableObjectBinding),
      {
        bindings: []
      }
    ),
    workflows: notInheritable(
      diagnostics,
      topLevelEnv,
      rawConfig,
      rawEnv,
      envName,
      "workflows",
      all(
        validateBindingArray(envName, validateWorkflowBinding),
        validateUniqueNameProperty
      ),
      []
    ),
    migrations: inheritable(
      diagnostics,
      topLevelEnv,
      rawEnv,
      "migrations",
      validateMigrations,
      []
    ),
    kv_namespaces: notInheritable(
      diagnostics,
      topLevelEnv,
      rawConfig,
      rawEnv,
      envName,
      "kv_namespaces",
      validateBindingArray(envName, validateKVBinding),
      []
    ),
    cloudchamber: notInheritable(
      diagnostics,
      topLevelEnv,
      rawConfig,
      rawEnv,
      envName,
      "cloudchamber",
      validateCloudchamberConfig,
      {}
    ),
    containers: notInheritable(
      diagnostics,
      topLevelEnv,
      rawConfig,
      rawEnv,
      envName,
      "containers",
      validateContainerApp(envName, rawEnv.name, configPath),
      void 0
    ),
    send_email: notInheritable(
      diagnostics,
      topLevelEnv,
      rawConfig,
      rawEnv,
      envName,
      "send_email",
      validateBindingArray(envName, validateSendEmailBinding),
      []
    ),
    queues: notInheritable(
      diagnostics,
      topLevelEnv,
      rawConfig,
      rawEnv,
      envName,
      "queues",
      validateQueues(envName),
      { producers: [], consumers: [] }
    ),
    r2_buckets: notInheritable(
      diagnostics,
      topLevelEnv,
      rawConfig,
      rawEnv,
      envName,
      "r2_buckets",
      validateBindingArray(envName, validateR2Binding),
      []
    ),
    d1_databases: notInheritable(
      diagnostics,
      topLevelEnv,
      rawConfig,
      rawEnv,
      envName,
      "d1_databases",
      validateBindingArray(envName, validateD1Binding),
      []
    ),
    vectorize: notInheritable(
      diagnostics,
      topLevelEnv,
      rawConfig,
      rawEnv,
      envName,
      "vectorize",
      validateBindingArray(envName, validateVectorizeBinding),
      []
    ),
    ai_search_namespaces: notInheritable(
      diagnostics,
      topLevelEnv,
      rawConfig,
      rawEnv,
      envName,
      "ai_search_namespaces",
      validateBindingArray(envName, validateAISearchNamespaceBinding),
      []
    ),
    ai_search: notInheritable(
      diagnostics,
      topLevelEnv,
      rawConfig,
      rawEnv,
      envName,
      "ai_search",
      validateBindingArray(envName, validateAISearchBinding),
      []
    ),
    hyperdrive: notInheritable(
      diagnostics,
      topLevelEnv,
      rawConfig,
      rawEnv,
      envName,
      "hyperdrive",
      validateBindingArray(envName, validateHyperdriveBinding),
      []
    ),
    services: notInheritable(
      diagnostics,
      topLevelEnv,
      rawConfig,
      rawEnv,
      envName,
      "services",
      validateBindingArray(envName, validateServiceBinding),
      []
    ),
    analytics_engine_datasets: notInheritable(
      diagnostics,
      topLevelEnv,
      rawConfig,
      rawEnv,
      envName,
      "analytics_engine_datasets",
      validateBindingArray(envName, validateAnalyticsEngineBinding),
      []
    ),
    dispatch_namespaces: notInheritable(
      diagnostics,
      topLevelEnv,
      rawConfig,
      rawEnv,
      envName,
      "dispatch_namespaces",
      validateBindingArray(envName, validateWorkerNamespaceBinding),
      []
    ),
    mtls_certificates: notInheritable(
      diagnostics,
      topLevelEnv,
      rawConfig,
      rawEnv,
      envName,
      "mtls_certificates",
      validateBindingArray(envName, validateMTlsCertificateBinding),
      []
    ),
    tail_consumers: notInheritable(
      diagnostics,
      topLevelEnv,
      rawConfig,
      rawEnv,
      envName,
      "tail_consumers",
      validateTailConsumers,
      void 0
    ),
    streaming_tail_consumers: notInheritable(
      diagnostics,
      topLevelEnv,
      rawConfig,
      rawEnv,
      envName,
      "streaming_tail_consumers",
      validateStreamingTailConsumers,
      void 0
    ),
    unsafe: notInheritable(
      diagnostics,
      topLevelEnv,
      rawConfig,
      rawEnv,
      envName,
      "unsafe",
      validateUnsafeSettings(envName),
      {}
    ),
    browser: notInheritable(
      diagnostics,
      topLevelEnv,
      rawConfig,
      rawEnv,
      envName,
      "browser",
      validateNamedSimpleBinding(envName),
      void 0
    ),
    ai: notInheritable(
      diagnostics,
      topLevelEnv,
      rawConfig,
      rawEnv,
      envName,
      "ai",
      validateAIBinding(envName),
      void 0
    ),
    images: notInheritable(
      diagnostics,
      topLevelEnv,
      rawConfig,
      rawEnv,
      envName,
      "images",
      validateNamedSimpleBinding(envName),
      void 0
    ),
    stream: notInheritable(
      diagnostics,
      topLevelEnv,
      rawConfig,
      rawEnv,
      envName,
      "stream",
      validateNamedSimpleBinding(envName),
      void 0
    ),
    media: notInheritable(
      diagnostics,
      topLevelEnv,
      rawConfig,
      rawEnv,
      envName,
      "media",
      validateNamedSimpleBinding(envName),
      void 0
    ),
    pipelines: notInheritable(
      diagnostics,
      topLevelEnv,
      rawConfig,
      rawEnv,
      envName,
      "pipelines",
      validateBindingArray(envName, validatePipelineBinding),
      []
    ),
    secrets_store_secrets: notInheritable(
      diagnostics,
      topLevelEnv,
      rawConfig,
      rawEnv,
      envName,
      "secrets_store_secrets",
      validateBindingArray(envName, validateSecretsStoreSecretBinding),
      []
    ),
    unsafe_hello_world: notInheritable(
      diagnostics,
      topLevelEnv,
      rawConfig,
      rawEnv,
      envName,
      "unsafe_hello_world",
      validateBindingArray(envName, validateHelloWorldBinding),
      []
    ),
    flagship: notInheritable(
      diagnostics,
      topLevelEnv,
      rawConfig,
      rawEnv,
      envName,
      "flagship",
      validateBindingArray(envName, validateFlagshipBinding),
      []
    ),
    worker_loaders: notInheritable(
      diagnostics,
      topLevelEnv,
      rawConfig,
      rawEnv,
      envName,
      "worker_loaders",
      validateBindingArray(envName, validateWorkerLoaderBinding),
      []
    ),
    ratelimits: notInheritable(
      diagnostics,
      topLevelEnv,
      rawConfig,
      rawEnv,
      envName,
      "ratelimits",
      validateBindingArray(envName, validateRateLimitBinding),
      []
    ),
    vpc_services: notInheritable(
      diagnostics,
      topLevelEnv,
      rawConfig,
      rawEnv,
      envName,
      "vpc_services",
      validateBindingArray(envName, validateVpcServiceBinding),
      []
    ),
    vpc_networks: notInheritable(
      diagnostics,
      topLevelEnv,
      rawConfig,
      rawEnv,
      envName,
      "vpc_networks",
      validateBindingArray(envName, validateVpcNetworkBinding),
      []
    ),
    version_metadata: notInheritable(
      diagnostics,
      topLevelEnv,
      rawConfig,
      rawEnv,
      envName,
      "version_metadata",
      validateVersionMetadataBinding(envName),
      void 0
    ),
    logfwdr: inheritable(
      diagnostics,
      topLevelEnv,
      rawEnv,
      "logfwdr",
      validateCflogfwdrObject(envName),
      {
        bindings: []
      }
    ),
    no_bundle: inheritable(
      diagnostics,
      topLevelEnv,
      rawEnv,
      "no_bundle",
      isBoolean,
      void 0
    ),
    minify: inheritable(
      diagnostics,
      topLevelEnv,
      rawEnv,
      "minify",
      isBoolean,
      void 0
    ),
    keep_names: inheritable(
      diagnostics,
      topLevelEnv,
      rawEnv,
      "keep_names",
      isBoolean,
      void 0
    ),
    first_party_worker: inheritable(
      diagnostics,
      topLevelEnv,
      rawEnv,
      "first_party_worker",
      isBoolean,
      void 0
    ),
    logpush: inheritable(
      diagnostics,
      topLevelEnv,
      rawEnv,
      "logpush",
      isBoolean,
      void 0
    ),
    upload_source_maps: inheritable(
      diagnostics,
      topLevelEnv,
      rawEnv,
      "upload_source_maps",
      isBoolean,
      void 0
    ),
    observability: inheritable(
      diagnostics,
      topLevelEnv,
      rawEnv,
      "observability",
      validateObservability,
      void 0
    ),
    cache: inheritable(
      diagnostics,
      topLevelEnv,
      rawEnv,
      "cache",
      validateCache,
      void 0
    ),
    compliance_region: inheritable(
      diagnostics,
      topLevelEnv,
      rawEnv,
      "compliance_region",
      isOneOf("public", "fedramp_high"),
      void 0
    ),
    python_modules: inheritable(
      diagnostics,
      topLevelEnv,
      rawEnv,
      "python_modules",
      validatePythonModules,
      { exclude: ["**/*.pyc"] }
    ),
    previews: inheritable(
      diagnostics,
      topLevelEnv,
      rawEnv,
      "previews",
      validatePreviewsConfig(envName),
      void 0
    )
  };
  warnIfDurableObjectsHaveNoMigrations(
    diagnostics,
    environment.durable_objects,
    environment.migrations,
    configPath
  );
  if (envName !== "top level") {
    validateAdditionalProperties(
      diagnostics,
      "env." + envName,
      Object.keys(rawEnv),
      Object.keys(environment)
    );
  }
  return environment;
}
function validateAndNormalizeTsconfig(diagnostics, topLevelEnv, rawEnv, configPath) {
  const tsconfig = inheritable(
    diagnostics,
    topLevelEnv,
    rawEnv,
    "tsconfig",
    isString,
    void 0
  );
  return configPath && tsconfig ? path3__namespace.default.relative(
    process.cwd(),
    path3__namespace.default.join(path3__namespace.default.dirname(configPath), tsconfig)
  ) : tsconfig;
}
function validateContainerApp(envName, topLevelName, configPath) {
  return (diagnostics, field, value, config) => {
    if (!value) {
      return true;
    }
    if (!Array.isArray(value)) {
      diagnostics.errors.push(
        `"containers" field should be an array, but got ${JSON.stringify(value)}`
      );
      return false;
    }
    for (const containerAppOptional of value) {
      if (!isOptionalProperty(value, "name", "string")) {
        diagnostics.errors.push(
          `Field "name", when present, should be a string, but got ${JSON.stringify(value)}`
        );
      }
      validateRequiredProperty(
        diagnostics,
        field,
        "class_name",
        containerAppOptional.class_name,
        "string"
      );
      validateOptionalProperty(
        diagnostics,
        field,
        "name",
        containerAppOptional.name,
        "string"
      );
      if (!containerAppOptional.name) {
        if (!topLevelName || !isOptionalProperty(containerAppOptional, "class_name", "string")) {
          diagnostics.errors.push(
            `Must have either a top level "name" and "containers.class_name" field defined, or have field "containers.name" defined.`
          );
        }
        let name2 = `${topLevelName}-${containerAppOptional.class_name}`;
        name2 += config === void 0 ? "" : `-${envName}`;
        containerAppOptional.name = name2.toLowerCase().replace(/ /g, "-");
      }
      if (!containerAppOptional.configuration?.image && !containerAppOptional.image) {
        diagnostics.errors.push(
          `"containers.image" field must be defined for each container app. This should be the path to your Dockerfile or an image URI pointing to the Cloudflare registry.`
        );
      }
      if ("configuration" in containerAppOptional) {
        diagnostics.warnings.push(
          `"containers.configuration" is deprecated. Use top level "containers" fields instead. "configuration.image" should be "image", limits should be set via "instance_type".`
        );
        if (typeof containerAppOptional.configuration !== "object" || Array.isArray(containerAppOptional.configuration)) {
          diagnostics.errors.push(
            `"containers.configuration" should be an object`
          );
        }
        if (containerAppOptional.instance_type && (containerAppOptional.configuration.disk !== void 0 || containerAppOptional.configuration.vcpu !== void 0 || containerAppOptional.configuration.memory_mib !== void 0)) {
          diagnostics.errors.push(
            `Cannot set custom limits via "containers.configuration" and use preset "instance_type" limits at the same time.`
          );
        }
      }
      validateOptionalProperty(
        diagnostics,
        field,
        "image_build_context",
        containerAppOptional.image_build_context,
        "string"
      );
      let resolvedImage = containerAppOptional.image ?? containerAppOptional.configuration?.image;
      let resolvedBuildContextPath = void 0;
      try {
        if (isDockerfile(resolvedImage, configPath)) {
          const baseDir = configPath ? path3__namespace.default.dirname(configPath) : process.cwd();
          resolvedImage = path3__namespace.default.resolve(baseDir, resolvedImage);
          resolvedBuildContextPath = containerAppOptional.image_build_context ? path3__namespace.default.resolve(baseDir, containerAppOptional.image_build_context) : path3__namespace.default.dirname(resolvedImage);
        }
      } catch (err) {
        if (err instanceof Error && err.message) {
          diagnostics.errors.push(err.message);
        } else {
          throw err;
        }
      }
      containerAppOptional.image = resolvedImage;
      containerAppOptional.image_build_context = resolvedBuildContextPath;
      if (containerAppOptional.rollout_step_percentage !== void 0) {
        const rolloutStep = containerAppOptional.rollout_step_percentage;
        if (typeof rolloutStep === "number") {
          const allowedSingleValues = [5, 10, 20, 25, 50, 100];
          if (!allowedSingleValues.includes(rolloutStep)) {
            diagnostics.errors.push(
              `"containers.rollout_step_percentage" must be one of [5, 10, 20, 25, 50, 100], but got ${rolloutStep}`
            );
          }
        } else if (Array.isArray(rolloutStep)) {
          const nonNumber = [];
          const outOfRange = [];
          let index = 0;
          let ascending = true;
          for (const step of rolloutStep) {
            if (typeof step !== "number") {
              nonNumber.push(step);
            } else {
              if (step < 10 || step > 100) {
                outOfRange.push(step);
              }
              if (ascending && index > 0 && step < rolloutStep[index - 1]) {
                diagnostics.errors.push(
                  `"containers.rollout_step_percentage" array elements must be in ascending order, but got "${rolloutStep}"`
                );
                ascending = false;
              }
              if (index === rolloutStep.length - 1 && step !== 100) {
                diagnostics.errors.push(
                  `The final step in "containers.rollout_step_percentage" must be 100, but got "${step}"`
                );
              }
              index++;
            }
          }
          if (nonNumber.length) {
            diagnostics.errors.push(
              `"containers.rollout_step_percentage" array elements must be numbers, but got "${nonNumber.join(", ")}"`
            );
          }
          if (outOfRange.length) {
            diagnostics.errors.push(
              `"containers.rollout_step_percentage" array elements must be between 10 and 100, but got "${outOfRange.join(", ")}"`
            );
          }
        } else {
          diagnostics.errors.push(
            `"containers.rollout_step_percentage" must be a number or array of numbers, but got "${rolloutStep}"`
          );
        }
      }
      validateOptionalProperty(
        diagnostics,
        field,
        "rollout_kind",
        containerAppOptional.rollout_kind,
        "string",
        ["full_auto", "full_manual", "none"]
      );
      if (!isOptionalProperty(
        containerAppOptional,
        "rollout_active_grace_period",
        "number"
      ) || containerAppOptional.rollout_active_grace_period < 0) {
        diagnostics.errors.push(
          `"containers.rollout_active_grace_period" field should be a positive number but got "${containerAppOptional.rollout_active_grace_period}"`
        );
      }
      validateOptionalProperty(
        diagnostics,
        field,
        "max_instances",
        containerAppOptional.max_instances,
        "number"
      );
      if (containerAppOptional.max_instances !== void 0 && containerAppOptional.max_instances < 0) {
        diagnostics.errors.push(
          `"containers.max_instances" field should be a positive number, but got ${containerAppOptional.max_instances}`
        );
      }
      if (containerAppOptional.rollout_step_percentage !== void 0 && containerAppOptional.max_instances !== void 0 && Array.isArray(containerAppOptional.rollout_step_percentage)) {
        const rolloutStepsCount = containerAppOptional.rollout_step_percentage.length;
        if (rolloutStepsCount > containerAppOptional.max_instances) {
          diagnostics.errors.push(
            `"containers.rollout_step_percentage" cannot have more steps (${rolloutStepsCount}) than "max_instances" (${containerAppOptional.max_instances})`
          );
        }
      }
      validateOptionalProperty(
        diagnostics,
        field,
        "image_vars",
        containerAppOptional.image_vars,
        "object"
      );
      validateOptionalProperty(
        diagnostics,
        field,
        "scheduling_policy",
        containerAppOptional.scheduling_policy,
        "string",
        ["regional", "moon", "default"]
      );
      if ("instances" in containerAppOptional) {
        diagnostics.warnings.push(
          `"containers.instances" is deprecated. Use "containers.max_instances" instead.`
        );
      }
      if ("durable_objects" in containerAppOptional) {
        diagnostics.warnings.push(
          `"containers.durable_objects" is deprecated. Use the "class_name" field instead.`
        );
      }
      if ("unsafe" in containerAppOptional) {
        if (containerAppOptional.unsafe && typeof containerAppOptional.unsafe !== "object" || Array.isArray(containerAppOptional.unsafe)) {
          diagnostics.errors.push(
            `The field "containers.unsafe" should be an object but got ${JSON.stringify(
              typeof containerAppOptional.unsafe
            )}.`
          );
        }
      }
      validateAdditionalProperties(
        diagnostics,
        field,
        Object.keys(containerAppOptional),
        [
          "name",
          "instances",
          "max_instances",
          "image",
          "image_build_context",
          "image_vars",
          "class_name",
          "scheduling_policy",
          "instance_type",
          "wrangler_ssh",
          "authorized_keys",
          "trusted_user_ca_keys",
          "configuration",
          "constraints",
          "affinities",
          "rollout_step_percentage",
          "rollout_kind",
          "durable_objects",
          "rollout_active_grace_period",
          "unsafe"
        ]
      );
      if ("configuration" in containerAppOptional) {
        validateAdditionalProperties(
          diagnostics,
          `${field}.configuration`,
          Object.keys(containerAppOptional.configuration),
          ["image", "secrets", "labels", "disk", "vcpu", "memory_mib"]
        );
      }
      if ("wrangler_ssh" in containerAppOptional) {
        if (!isRequiredProperty(
          containerAppOptional.wrangler_ssh,
          "enabled",
          "boolean"
        )) {
          diagnostics.errors.push(
            `${field}.wrangler_ssh.enabled must be a boolean`
          );
        }
        if (!isOptionalProperty(
          containerAppOptional.wrangler_ssh,
          "port",
          "number"
        ) || containerAppOptional.wrangler_ssh.port < 1 || containerAppOptional.wrangler_ssh.port > 65535) {
          diagnostics.errors.push(
            `${field}.wrangler_ssh.port must be a number between 1 and 65535 inclusive`
          );
        }
      }
      if ("authorized_keys" in containerAppOptional) {
        if (!Array.isArray(containerAppOptional.authorized_keys)) {
          diagnostics.errors.push(`${field}.authorized_keys must be an array`);
        } else {
          for (const index in containerAppOptional.authorized_keys) {
            const fieldPath = `${field}.authorized_keys[${index}]`;
            const key = containerAppOptional.authorized_keys[index];
            if (!isRequiredProperty(key, "name", "string")) {
              diagnostics.errors.push(`${fieldPath}.name must be a string`);
            }
            if (!isRequiredProperty(key, "public_key", "string")) {
              diagnostics.errors.push(
                `${fieldPath}.public_key must be a string`
              );
            }
            if (!key.public_key.toLowerCase().startsWith("ssh-ed25519")) {
              diagnostics.errors.push(
                `${fieldPath}.public_key is a unsupported key type. Please provide a ED25519 public key.`
              );
            }
          }
        }
      }
      if ("trusted_user_ca_keys" in containerAppOptional) {
        if (!Array.isArray(containerAppOptional.trusted_user_ca_keys)) {
          diagnostics.errors.push(
            `${field}.trusted_user_ca_keys must be an array`
          );
        } else {
          for (const index in containerAppOptional.trusted_user_ca_keys) {
            const fieldPath = `${field}.trusted_user_ca_keys[${index}]`;
            const key = containerAppOptional.trusted_user_ca_keys[index];
            if (!isOptionalProperty(key, "name", "string")) {
              diagnostics.errors.push(`${fieldPath}.name must be a string`);
            }
            if (!isRequiredProperty(key, "public_key", "string")) {
              diagnostics.errors.push(
                `${fieldPath}.public_key must be a string`
              );
            }
            if (!key.public_key.toLowerCase().startsWith("ssh-ed25519")) {
              diagnostics.errors.push(
                `${fieldPath}.public_key is a unsupported key type. Please provide a ED25519 public key.`
              );
            }
          }
        }
      }
      if (validateOptionalProperty(
        diagnostics,
        field,
        "constraints",
        containerAppOptional.constraints,
        "object"
      ) && containerAppOptional.constraints) {
        const constraints = containerAppOptional.constraints;
        if ("tier" in constraints) {
          diagnostics.warnings.push(
            `"constraints.tier" has been deprecated in favor of "constraints.tiers". Please update your configuration to use "constraints.tiers" instead.`
          );
          if ("tiers" in constraints) {
            diagnostics.errors.push(
              `${field}.constraints.tier and ${field}.constraints.tiers cannot both be set`
            );
          }
        }
        validateOptionalTypedArray(
          diagnostics,
          `${field}.constraints.tiers`,
          constraints.tiers,
          "number"
        );
      }
      if (typeof containerAppOptional.instance_type === "string") {
        validateOptionalProperty(
          diagnostics,
          field,
          "instance_type",
          containerAppOptional.instance_type,
          "string",
          ALLOWED_INSTANCE_TYPES
        );
        if (containerAppOptional.instance_type === "dev") {
          diagnostics.warnings.push(
            `The "dev" instance_type has been renamed to "lite" and will be removed in a subsequent version. Please update your configuration to use "lite" instead.`
          );
        }
        if (containerAppOptional.instance_type === "standard") {
          diagnostics.warnings.push(
            `The "standard" instance_type has been renamed to "standard-1" and will be removed in a subsequent version. Please update your configuration to use "standard-1" instead.`
          );
        }
      } else if (validateOptionalProperty(
        diagnostics,
        field,
        "instance_type",
        containerAppOptional.instance_type,
        "object"
      ) && containerAppOptional.instance_type) {
        const instanceTypeProperties = ["vcpu", "memory_mib", "disk_mb"];
        instanceTypeProperties.forEach((key) => {
          if (!isOptionalProperty(
            containerAppOptional.instance_type,
            key,
            "number"
          )) {
            diagnostics.errors.push(
              `"containers.instance_type.${key}", when present, should be a number.`
            );
          }
        });
        validateAdditionalProperties(
          diagnostics,
          `${field}.instance_type`,
          Object.keys(containerAppOptional.instance_type),
          instanceTypeProperties
        );
      }
    }
    if (diagnostics.errors.length > 0) {
      return false;
    }
    return true;
  };
}
function validateWorkerNamespaceOutbound(diagnostics, field, value) {
  if (typeof value !== "object" || value === null) {
    diagnostics.errors.push(
      `"${field}" should be an object, but got ${JSON.stringify(value)}`
    );
    return false;
  }
  let isValid22 = true;
  isValid22 = isValid22 && validateRequiredProperty(
    diagnostics,
    field,
    "service",
    value.service,
    "string"
  );
  isValid22 = isValid22 && validateOptionalProperty(
    diagnostics,
    field,
    "environment",
    value.environment,
    "string"
  );
  isValid22 = isValid22 && validateOptionalTypedArray(
    diagnostics,
    `${field}.parameters`,
    value.parameters,
    "string"
  );
  return isValid22;
}
function validateQueues(envName) {
  return (diagnostics, field, value, config) => {
    if (value === void 0) {
      return true;
    }
    const fieldPath = config === void 0 ? `${field}` : `env.${envName}.${field}`;
    if (typeof value !== "object" || Array.isArray(value) || value === null) {
      diagnostics.errors.push(
        `The field "${fieldPath}" should be an object but got ${JSON.stringify(
          value
        )}.`
      );
      return false;
    }
    let isValid22 = true;
    if (!validateAdditionalProperties(
      diagnostics,
      fieldPath,
      Object.keys(value),
      ["consumers", "producers"]
    )) {
      isValid22 = false;
    }
    if (hasProperty(value, "consumers")) {
      const consumers = value.consumers;
      if (!Array.isArray(consumers)) {
        diagnostics.errors.push(
          `The field "${fieldPath}.consumers" should be an array but got ${JSON.stringify(
            consumers
          )}.`
        );
        isValid22 = false;
      }
      for (let i7 = 0; i7 < consumers.length; i7++) {
        const consumer = consumers[i7];
        const consumerPath = `${fieldPath}.consumers[${i7}]`;
        if (!validateConsumer(diagnostics, consumerPath, consumer, config)) {
          isValid22 = false;
        }
      }
    }
    if (hasProperty(value, "producers")) {
      if (!validateBindingArray(envName, validateQueueBinding)(
        diagnostics,
        `${field}.producers`,
        value.producers,
        config
      )) {
        isValid22 = false;
      }
    }
    return isValid22;
  };
}
function normalizeAndValidateLimits(diagnostics, topLevelEnv, rawEnv) {
  if (rawEnv.limits) {
    validateOptionalProperty(
      diagnostics,
      "limits",
      "cpu_ms",
      rawEnv.limits.cpu_ms,
      "number"
    );
    validateOptionalProperty(
      diagnostics,
      "limits",
      "subrequests",
      rawEnv.limits.subrequests,
      "number"
    );
  }
  return inheritable(
    diagnostics,
    topLevelEnv,
    rawEnv,
    "limits",
    () => true,
    void 0
  );
}
function warnIfDurableObjectsHaveNoMigrations(diagnostics, durableObjects, migrations, configPath) {
  if (Array.isArray(durableObjects.bindings) && durableObjects.bindings.length > 0) {
    const exportedDurableObjects = (durableObjects.bindings || []).filter(
      (binding) => !binding.script_name
    );
    if (exportedDurableObjects.length > 0 && migrations.length === 0) {
      if (!exportedDurableObjects.some(
        (exportedDurableObject) => typeof exportedDurableObject.class_name !== "string"
      )) {
        const durableObjectClassnames = exportedDurableObjects.map(
          (durable) => durable.class_name
        );
        diagnostics.warnings.push(dedent`
				In your ${configFileName(configPath)} file, you have configured \`durable_objects\` exported by this Worker (${durableObjectClassnames.join(", ")}), but no \`migrations\` for them. This may not work as expected until you add a \`migrations\` section to your ${configFileName(configPath)} file. Add the following configuration:

				\`\`\`
				${formatConfigSnippet(
          {
            migrations: [
              { tag: "v1", new_sqlite_classes: durableObjectClassnames }
            ]
          },
          configPath
        )}
				\`\`\`

				Refer to https://developers.cloudflare.com/durable-objects/reference/durable-objects-migrations/ for more details.`);
      }
    }
  }
}
function isRemoteValid(targetObject, fieldPath, diagnostics) {
  if (!isOptionalProperty(targetObject, "remote", "boolean")) {
    diagnostics.errors.push(
      `"${fieldPath}" should, optionally, have a boolean "remote" field but got ${JSON.stringify(
        targetObject
      )}.`
    );
    return false;
  }
  return true;
}
function isDockerfile(imagePath, configPath) {
  const baseDir = configPath ? path3__namespace.default.dirname(configPath) : process.cwd();
  const maybeDockerfile = path3__namespace.default.resolve(baseDir, imagePath);
  if (fs29__namespace.default.existsSync(maybeDockerfile)) {
    if (isDirectory(maybeDockerfile)) {
      throw new UserError(
        `${imagePath} is a directory, you should specify a path to the Dockerfile`
      );
    }
    return true;
  }
  const errorPrefix = `The image "${imagePath}" does not appear to be a valid path to a Dockerfile, or a valid image registry path:
`;
  try {
    new URL(`https://${imagePath}`);
  } catch (e22) {
    if (e22 instanceof Error) {
      throw new UserError(errorPrefix + e22.message);
    }
    throw e22;
  }
  const imageParts = imagePath.split("/");
  if (!imageParts[imageParts.length - 1]?.includes(":")) {
    throw new UserError(
      errorPrefix + `If this is an image registry path, it needs to include at least a tag ':' (e.g: docker.io/httpd:1)`
    );
  }
  if (imagePath.includes("://")) {
    throw new UserError(
      errorPrefix + `Image reference should not include the protocol part (e.g: docker.io/httpd:1, not https://docker.io/httpd:1)`
    );
  }
  return false;
}
function validatePagesConfig(config, envNames, projectName) {
  if (!config.pages_build_output_dir) {
    throw new FatalError(`Attempting to validate Pages configuration file, but "pages_build_output_dir" field was not found.
		"pages_build_output_dir" is required for Pages projects.`);
  }
  const diagnostics = new Diagnostics(
    `Running configuration file validation for Pages:`
  );
  validateMainField(config, diagnostics);
  validateProjectName(projectName, diagnostics);
  validatePagesEnvironmentNames(envNames, diagnostics);
  validateUnsupportedFields(config, diagnostics);
  validateDurableObjectBinding2(config, diagnostics);
  return diagnostics;
}
function validateMainField(config, diagnostics) {
  if (config.main !== void 0) {
    diagnostics.errors.push(
      `Configuration file cannot contain both both "main" and "pages_build_output_dir" configuration keys.
Please use "main" if you are deploying a Worker, or "pages_build_output_dir" if you are deploying a Pages project.`
    );
  }
}
function validateProjectName(name2, diagnostics) {
  if (name2 === void 0 || name2.trim() === "") {
    diagnostics.errors.push(
      `Missing top-level field "name" in configuration file.
Pages requires the name of your project to be configured at the top-level of your Wrangler configuration file. This is because, in Pages, environments target the same project.`
    );
  }
}
function validatePagesEnvironmentNames(envNames, diagnostics) {
  if (!envNames?.length) {
    return;
  }
  const unsupportedPagesEnvNames = envNames.filter(
    (name2) => name2 !== "preview" && name2 !== "production"
  );
  if (unsupportedPagesEnvNames.length > 0) {
    diagnostics.errors.push(
      `Configuration file contains the following environment names that are not supported by Pages projects:
${unsupportedPagesEnvNames.map((name2) => `"${name2}"`).join()}.
The supported named-environments for Pages are "preview" and "production".`
    );
  }
}
function validateUnsupportedFields(config, diagnostics) {
  const unsupportedFields = new Set(Object.keys(config));
  for (const field of supportedPagesConfigFields) {
    if (field === "queues" && config.queues?.consumers?.length) {
      continue;
    }
    unsupportedFields.delete(field);
  }
  for (const field of unsupportedFields) {
    if (config[field] === void 0 || JSON.stringify(config[field]) === JSON.stringify(exports.unstable_defaultWranglerConfig[field])) {
      unsupportedFields.delete(field);
    }
  }
  if (unsupportedFields.size > 0) {
    const fields = Array.from(unsupportedFields.keys());
    fields.forEach((field) => {
      if (field === "queues" && config.queues?.consumers?.length) {
        diagnostics.errors.push(
          `Configuration file for Pages projects does not support "queues.consumers"`
        );
      } else {
        diagnostics.errors.push(
          `Configuration file for Pages projects does not support "${field}"`
        );
      }
    });
  }
}
function validateDurableObjectBinding2(config, diagnostics) {
  if (config.durable_objects.bindings.length > 0) {
    const invalidBindings = config.durable_objects.bindings.filter(
      (binding) => !isRequiredProperty(binding, "script_name", "string")
    );
    if (invalidBindings.length > 0) {
      diagnostics.errors.push(
        `Durable Objects bindings should specify a "script_name".
Pages requires Durable Object bindings to specify the name of the Worker where the Durable Object is defined.`
      );
    }
  }
}
var require_XDGAppPaths, require_XDG, require_OSPaths, require_node, require_mod_cjs, require_node2, require_mod_cjs2, require_node3, require_mod_cjs3; exports.unstable_defaultWranglerConfig = void 0; exports.experimental_patchConfig = void 0; var getJSONPath, PatchConfigError, util, objectUtil, ZodParsedType, getParsedType, ZodIssueCode, quotelessJson, ZodError, errorMap, overrideErrorMap, makeIssue, EMPTY_PATH, ParseStatus, INVALID, DIRTY, OK, isAborted, isDirty, isValid, isAsync, errorUtil, ParseInputLazyPath, handleResult, ZodType, cuidRegex, cuid2Regex, ulidRegex, uuidRegex, emailRegex, emojiRegex, ipv4Regex, ipv6Regex, datetimeRegex, ZodString, ZodNumber, ZodBigInt, ZodBoolean, ZodDate, ZodSymbol, ZodUndefined, ZodNull, ZodAny, ZodUnknown, ZodNever, ZodVoid, ZodArray, ZodObject, ZodUnion, getDiscriminator, ZodDiscriminatedUnion, ZodIntersection, ZodTuple, ZodRecord, ZodMap, ZodSet, ZodFunction, ZodLazy, ZodLiteral, ZodEnum, ZodNativeEnum, ZodPromise, ZodEffects, ZodOptional, ZodNullable, ZodDefault, ZodCatch, ZodNaN, BRAND, ZodBranded, ZodPipeline, ZodReadonly, custom, late, ZodFirstPartyTypeKind, instanceOfType, stringType, numberType, nanType, bigIntType, booleanType, dateType, symbolType, undefinedType, nullType, anyType, unknownType, neverType, voidType, arrayType, objectType, strictObjectType, unionType, discriminatedUnionType, intersectionType, tupleType, recordType, mapType, setType, functionType, lazyType, literalType, enumType, nativeEnumType, promiseType, effectsType, optionalType, nullableType, preprocessType, pipelineType, ostring, onumber, oboolean, coerce, NEVER, z, MAX_WORKFLOW_NAME_LENGTH, ALLOWED_STRING_ID_PATTERN, ALLOWED_WORKFLOW_INSTANCE_ID_REGEX, ALLOWED_WORKFLOW_NAME_REGEX, mod_esm_exports, import_mod_cjs, mod_esm_default, getC3CommandFromEnv, getWranglerSendMetricsFromEnv, getWranglerSendErrorReportsFromEnv, getCloudflareApiEnvironmentFromEnv, COMPLIANCE_REGION_CONFIG_PUBLIC, COMPLIANCE_REGION_CONFIG_UNKNOWN, getCloudflareComplianceRegionFromEnv, getCloudflareComplianceRegion, getCloudflareApiBaseUrlFromEnv, getCloudflareApiBaseUrl, getSanitizeLogs, getOutputFileDirectoryFromEnv, getOutputFilePathFromEnv, getCIMatchTag, getCIOverrideName, getCIOverrideNetworkModeHost, getCIGeneratePreviewAlias, getWorkersCIBranchName, getBuildConditionsFromEnv, getBuildPlatformFromEnv, getRegistryPath, getD1ExtraLocationChoices, getDockerPath, getSubdomainMixedStateCheckDisabled, getCloudflareLoadDevVarsFromDotEnv, getCloudflareIncludeProcessEnvFromEnv, getTraceHeader, getDisableConfigWatching, getWranglerHideBanner, getCloudflareEnv, getOpenNextDeployFromEnv, getLocalExplorerEnabledFromEnv, getBrowserRenderingHeadfulFromEnv, getWranglerCacheDirFromEnv, getCloudflaredPathFromEnv, Diagnostics, appendEnvName, isString, isValidName, isValidDateTimeStringFormat, isStringArray, isOneOf, all, isMutuallyExclusiveWith, isBoolean, validateRequiredProperty, validateAtLeastOnePropertyRequired, validateOptionalProperty, validateTypedArray, validateOptionalTypedArray, isRequiredProperty, isOptionalProperty, hasProperty, validateAdditionalProperties, getBindingNames, isBindingList, isNamespaceList, isRecord, validateUniqueNameProperty, bucketFormatMessage, friendlyBindingNames, bindingTypeFriendlyNames, ENGLISH, ALLOWED_INSTANCE_TYPES, isRoute, isRouteArray, validateTailConsumers, validateStreamingTailConsumers, validateAndNormalizeRules, validateTriggers, validateRules, validateRule, validateDefines, validateVars, validateSecrets, validateBindingsProperty, validateUnsafeSettings, validateDurableObjectBinding, workflowNameFormatMessage, validateWorkflowBinding, validateCflogfwdrObject, validateCflogfwdrBinding, validateAssetsConfig, validateNamedSimpleBinding, validateAIBinding, validateVersionMetadataBinding, validateUnsafeBinding, validateBindingArray, validateCloudchamberConfig, validateKVBinding, validateSendEmailBinding, validateQueueBinding, validateR2Binding, validateD1Binding, validateVectorizeBinding, validateAISearchNamespaceBinding, validateAISearchBinding, validateHyperdriveBinding, validateVpcServiceBinding, validateVpcNetworkBinding, validateBindingsHaveUniqueNames, validateServiceBinding, validateAnalyticsEngineBinding, validateWorkerNamespaceBinding, validateMTlsCertificateBinding, validateConsumer, validateCompatibilityDate, validatePipelineBinding, validateSecretsStoreSecretBinding, validateHelloWorldBinding, validateFlagshipBinding, validateWorkerLoaderBinding, validateRateLimitBinding, validatePreviewsConfig, validateMigrations, validateObservability, validateCache, validatePythonModules, supportedPagesConfigFields;
var init_dist = __esm({
  "../workers-utils/dist/index.mjs"() {
    init_import_meta_url();
    init_chunk_WGJ43SKK();
    init_chunk_A2RWTLF4();
    init_chunk_YEDWOTIW();
    init_chunk_YEDWOTIW();
    init_chunk_R45BP2X6();
    init_chunk_UC4C7ZX3();
    require_XDGAppPaths = __commonJS2({
      "../../node_modules/.pnpm/xdg-app-paths@8.3.0/node_modules/xdg-app-paths/dist/cjs/lib/XDGAppPaths.js"(exports) {
        exports.__esModule = true;
        exports.Adapt = void 0;
        function isBoolean22(t22) {
          return typeOf(t22) === "boolean";
        }
        __name(isBoolean22, "isBoolean2");
        __name2(isBoolean22, "isBoolean");
        function isObject5(t22) {
          return typeOf(t22) === "object";
        }
        __name(isObject5, "isObject");
        __name2(isObject5, "isObject");
        function isString22(t22) {
          return typeOf(t22) === "string";
        }
        __name(isString22, "isString2");
        __name2(isString22, "isString");
        function typeOf(t22) {
          return typeof t22;
        }
        __name(typeOf, "typeOf");
        __name2(typeOf, "typeOf");
        function Adapt(adapter_) {
          var meta = adapter_.meta, path410 = adapter_.path, xdg = adapter_.xdg;
          var XDGAppPaths_ = /* @__PURE__ */ function() {
            function XDGAppPaths_2(options_) {
              if (options_ === void 0) {
                options_ = {};
              }
              var _a5, _b2, _c3;
              function XDGAppPaths(options2) {
                if (options2 === void 0) {
                  options2 = {};
                }
                return new XDGAppPaths_2(options2);
              }
              __name(XDGAppPaths, "XDGAppPaths");
              __name2(XDGAppPaths, "XDGAppPaths");
              var options = isObject5(options_) ? options_ : { name: options_ };
              var suffix = (_a5 = options.suffix) !== null && _a5 !== void 0 ? _a5 : "";
              var isolated_ = (_b2 = options.isolated) !== null && _b2 !== void 0 ? _b2 : true;
              var namePriorityList = [
                options.name,
                meta.pkgMainFilename(),
                meta.mainFilename()
              ];
              var nameFallback = "$eval";
              var name2 = path410.parse(((_c3 = namePriorityList.find(function(e22) {
                return isString22(e22);
              })) !== null && _c3 !== void 0 ? _c3 : nameFallback) + suffix).name;
              XDGAppPaths.$name = /* @__PURE__ */ __name2(/* @__PURE__ */ __name(function $name() {
                return name2;
              }, "$name"), "$name");
              XDGAppPaths.$isolated = /* @__PURE__ */ __name2(/* @__PURE__ */ __name(function $isolated() {
                return isolated_;
              }, "$isolated"), "$isolated");
              function isIsolated(dirOptions) {
                var _a22;
                dirOptions = dirOptions !== null && dirOptions !== void 0 ? dirOptions : { isolated: isolated_ };
                var isolated = isBoolean22(dirOptions) ? dirOptions : (_a22 = dirOptions.isolated) !== null && _a22 !== void 0 ? _a22 : isolated_;
                return isolated;
              }
              __name(isIsolated, "isIsolated");
              __name2(isIsolated, "isIsolated");
              function finalPathSegment(dirOptions) {
                return isIsolated(dirOptions) ? name2 : "";
              }
              __name(finalPathSegment, "finalPathSegment");
              __name2(finalPathSegment, "finalPathSegment");
              XDGAppPaths.cache = /* @__PURE__ */ __name2(/* @__PURE__ */ __name(function cache5(dirOptions) {
                return path410.join(xdg.cache(), finalPathSegment(dirOptions));
              }, "cache"), "cache");
              XDGAppPaths.config = /* @__PURE__ */ __name2(/* @__PURE__ */ __name(function config(dirOptions) {
                return path410.join(xdg.config(), finalPathSegment(dirOptions));
              }, "config"), "config");
              XDGAppPaths.data = /* @__PURE__ */ __name2(/* @__PURE__ */ __name(function data(dirOptions) {
                return path410.join(xdg.data(), finalPathSegment(dirOptions));
              }, "data"), "data");
              XDGAppPaths.runtime = /* @__PURE__ */ __name2(/* @__PURE__ */ __name(function runtime(dirOptions) {
                return xdg.runtime() ? path410.join(xdg.runtime(), finalPathSegment(dirOptions)) : void 0;
              }, "runtime"), "runtime");
              XDGAppPaths.state = /* @__PURE__ */ __name2(/* @__PURE__ */ __name(function state2(dirOptions) {
                return path410.join(xdg.state(), finalPathSegment(dirOptions));
              }, "state"), "state");
              XDGAppPaths.configDirs = /* @__PURE__ */ __name2(/* @__PURE__ */ __name(function configDirs(dirOptions) {
                return xdg.configDirs().map(function(s7) {
                  return path410.join(s7, finalPathSegment(dirOptions));
                });
              }, "configDirs"), "configDirs");
              XDGAppPaths.dataDirs = /* @__PURE__ */ __name2(/* @__PURE__ */ __name(function dataDirs(dirOptions) {
                return xdg.dataDirs().map(function(s7) {
                  return path410.join(s7, finalPathSegment(dirOptions));
                });
              }, "dataDirs"), "dataDirs");
              return XDGAppPaths;
            }
            __name(XDGAppPaths_2, "XDGAppPaths_2");
            __name2(XDGAppPaths_2, "XDGAppPaths_");
            return XDGAppPaths_2;
          }();
          return { XDGAppPaths: new XDGAppPaths_() };
        }
        __name(Adapt, "Adapt");
        __name2(Adapt, "Adapt");
        exports.Adapt = Adapt;
      }
    });
    require_XDG = __commonJS2({
      "../../node_modules/.pnpm/xdg-portable@10.6.0/node_modules/xdg-portable/dist/cjs/lib/XDG.js"(exports) {
        var __spreadArray2 = exports && exports.__spreadArray || function(to, from) {
          for (var i7 = 0, il = from.length, j7 = to.length; i7 < il; i7++, j7++)
            to[j7] = from[i7];
          return to;
        };
        exports.__esModule = true;
        exports.Adapt = void 0;
        function Adapt(adapter_) {
          var env6 = adapter_.env, osPaths = adapter_.osPaths, path410 = adapter_.path;
          var isMacOS = /^darwin$/i.test(adapter_.process.platform);
          var isWinOS = /^win/i.test(adapter_.process.platform);
          function baseDir() {
            return osPaths.home() || osPaths.temp();
          }
          __name(baseDir, "baseDir");
          __name2(baseDir, "baseDir");
          function valOrPath(val2, pathSegments) {
            return val2 || path410.join.apply(path410, pathSegments);
          }
          __name(valOrPath, "valOrPath");
          __name2(valOrPath, "valOrPath");
          var linux = /* @__PURE__ */ __name2(function() {
            var cache5 = /* @__PURE__ */ __name2(function() {
              return valOrPath(env6.get("XDG_CACHE_HOME"), [baseDir(), ".cache"]);
            }, "cache");
            var config = /* @__PURE__ */ __name2(function() {
              return valOrPath(env6.get("XDG_CONFIG_HOME"), [baseDir(), ".config"]);
            }, "config");
            var data = /* @__PURE__ */ __name2(function() {
              return valOrPath(env6.get("XDG_DATA_HOME"), [baseDir(), ".local", "share"]);
            }, "data");
            var runtime = /* @__PURE__ */ __name2(function() {
              return env6.get("XDG_RUNTIME_DIR") || void 0;
            }, "runtime");
            var state2 = /* @__PURE__ */ __name2(function() {
              return valOrPath(env6.get("XDG_STATE_HOME"), [baseDir(), ".local", "state"]);
            }, "state");
            return { cache: cache5, config, data, runtime, state: state2 };
          }, "linux");
          var macos = /* @__PURE__ */ __name2(function() {
            var cache5 = /* @__PURE__ */ __name2(function() {
              return valOrPath(env6.get("XDG_CACHE_HOME"), [baseDir(), "Library", "Caches"]);
            }, "cache");
            var config = /* @__PURE__ */ __name2(function() {
              return valOrPath(env6.get("XDG_CONFIG_HOME"), [baseDir(), "Library", "Preferences"]);
            }, "config");
            var data = /* @__PURE__ */ __name2(function() {
              return valOrPath(env6.get("XDG_DATA_HOME"), [baseDir(), "Library", "Application Support"]);
            }, "data");
            var runtime = /* @__PURE__ */ __name2(function() {
              return env6.get("XDG_RUNTIME_DIR") || void 0;
            }, "runtime");
            var state2 = /* @__PURE__ */ __name2(function() {
              return valOrPath(env6.get("XDG_STATE_HOME"), [baseDir(), "Library", "State"]);
            }, "state");
            return { cache: cache5, config, data, runtime, state: state2 };
          }, "macos");
          var windows = /* @__PURE__ */ __name2(function() {
            function appData() {
              return valOrPath(env6.get("APPDATA"), [baseDir(), "AppData", "Roaming"]);
            }
            __name(appData, "appData");
            __name2(appData, "appData");
            function localAppData() {
              return valOrPath(env6.get("LOCALAPPDATA"), [baseDir(), "AppData", "Local"]);
            }
            __name(localAppData, "localAppData");
            __name2(localAppData, "localAppData");
            var cache5 = /* @__PURE__ */ __name2(function() {
              return valOrPath(env6.get("XDG_CACHE_HOME"), [localAppData(), "xdg.cache"]);
            }, "cache");
            var config = /* @__PURE__ */ __name2(function() {
              return valOrPath(env6.get("XDG_CONFIG_HOME"), [appData(), "xdg.config"]);
            }, "config");
            var data = /* @__PURE__ */ __name2(function() {
              return valOrPath(env6.get("XDG_DATA_HOME"), [appData(), "xdg.data"]);
            }, "data");
            var runtime = /* @__PURE__ */ __name2(function() {
              return env6.get("XDG_RUNTIME_DIR") || void 0;
            }, "runtime");
            var state2 = /* @__PURE__ */ __name2(function() {
              return valOrPath(env6.get("XDG_STATE_HOME"), [localAppData(), "xdg.state"]);
            }, "state");
            return { cache: cache5, config, data, runtime, state: state2 };
          }, "windows");
          var XDG_ = /* @__PURE__ */ function() {
            function XDG_2() {
              function XDG() {
                return new XDG_2();
              }
              __name(XDG, "XDG");
              __name2(XDG, "XDG");
              var extension = isMacOS ? macos() : isWinOS ? windows() : linux();
              XDG.cache = extension.cache;
              XDG.config = extension.config;
              XDG.data = extension.data;
              XDG.runtime = extension.runtime;
              XDG.state = extension.state;
              XDG.configDirs = /* @__PURE__ */ __name2(/* @__PURE__ */ __name(function configDirs() {
                var pathList = env6.get("XDG_CONFIG_DIRS");
                return __spreadArray2([extension.config()], pathList ? pathList.split(path410.delimiter) : []);
              }, "configDirs"), "configDirs");
              XDG.dataDirs = /* @__PURE__ */ __name2(/* @__PURE__ */ __name(function dataDirs() {
                var pathList = env6.get("XDG_DATA_DIRS");
                return __spreadArray2([extension.data()], pathList ? pathList.split(path410.delimiter) : []);
              }, "dataDirs"), "dataDirs");
              return XDG;
            }
            __name(XDG_2, "XDG_2");
            __name2(XDG_2, "XDG_");
            return XDG_2;
          }();
          return { XDG: new XDG_() };
        }
        __name(Adapt, "Adapt");
        __name2(Adapt, "Adapt");
        exports.Adapt = Adapt;
      }
    });
    require_OSPaths = __commonJS2({
      "../../node_modules/.pnpm/os-paths@7.4.0/node_modules/os-paths/dist/cjs/lib/OSPaths.js"(exports) {
        var __spreadArray2 = exports && exports.__spreadArray || function(to, from) {
          for (var i7 = 0, il = from.length, j7 = to.length; i7 < il; i7++, j7++)
            to[j7] = from[i7];
          return to;
        };
        exports.__esModule = true;
        exports.Adapt = void 0;
        function isEmpty(s7) {
          return !s7;
        }
        __name(isEmpty, "isEmpty");
        __name2(isEmpty, "isEmpty");
        function Adapt(adapter_) {
          var env6 = adapter_.env, os22 = adapter_.os, path410 = adapter_.path;
          var isWinOS = /^win/i.test(adapter_.process.platform);
          function normalizePath2(path_) {
            return path_ ? adapter_.path.normalize(adapter_.path.join(path_, ".")) : void 0;
          }
          __name(normalizePath2, "normalizePath");
          __name2(normalizePath2, "normalizePath");
          function home() {
            var posix2 = /* @__PURE__ */ __name2(function() {
              return normalizePath2((typeof os22.homedir === "function" ? os22.homedir() : void 0) || env6.get("HOME"));
            }, "posix");
            var windows = /* @__PURE__ */ __name2(function() {
              var priorityList = [
                typeof os22.homedir === "function" ? os22.homedir() : void 0,
                env6.get("USERPROFILE"),
                env6.get("HOME"),
                env6.get("HOMEDRIVE") || env6.get("HOMEPATH") ? path410.join(env6.get("HOMEDRIVE") || "", env6.get("HOMEPATH") || "") : void 0
              ];
              return normalizePath2(priorityList.find(function(v8) {
                return !isEmpty(v8);
              }));
            }, "windows");
            return isWinOS ? windows() : posix2();
          }
          __name(home, "home");
          __name2(home, "home");
          function temp() {
            function joinPathToBase(base, segments) {
              return base ? path410.join.apply(path410, __spreadArray2([base], segments)) : void 0;
            }
            __name(joinPathToBase, "joinPathToBase");
            __name2(joinPathToBase, "joinPathToBase");
            function posix2() {
              var fallback = "/tmp";
              var priorityList = [
                typeof os22.tmpdir === "function" ? os22.tmpdir() : void 0,
                env6.get("TMPDIR"),
                env6.get("TEMP"),
                env6.get("TMP")
              ];
              return normalizePath2(priorityList.find(function(v8) {
                return !isEmpty(v8);
              })) || fallback;
            }
            __name(posix2, "posix");
            __name2(posix2, "posix");
            function windows() {
              var fallback = "C:\\Temp";
              var priorityListLazy = [
                typeof os22.tmpdir === "function" ? os22.tmpdir : function() {
                  return void 0;
                },
                function() {
                  return env6.get("TEMP");
                },
                function() {
                  return env6.get("TMP");
                },
                function() {
                  return joinPathToBase(env6.get("LOCALAPPDATA"), ["Temp"]);
                },
                function() {
                  return joinPathToBase(home(), ["AppData", "Local", "Temp"]);
                },
                function() {
                  return joinPathToBase(env6.get("ALLUSERSPROFILE"), ["Temp"]);
                },
                function() {
                  return joinPathToBase(env6.get("SystemRoot"), ["Temp"]);
                },
                function() {
                  return joinPathToBase(env6.get("windir"), ["Temp"]);
                },
                function() {
                  return joinPathToBase(env6.get("SystemDrive"), ["\\", "Temp"]);
                }
              ];
              var v8 = priorityListLazy.find(function(v22) {
                return v22 && !isEmpty(v22());
              });
              return v8 && normalizePath2(v8()) || fallback;
            }
            __name(windows, "windows");
            __name2(windows, "windows");
            return isWinOS ? windows() : posix2();
          }
          __name(temp, "temp");
          __name2(temp, "temp");
          var OSPaths_ = /* @__PURE__ */ function() {
            function OSPaths_2() {
              function OSPaths() {
                return new OSPaths_2();
              }
              __name(OSPaths, "OSPaths");
              __name2(OSPaths, "OSPaths");
              OSPaths.home = home;
              OSPaths.temp = temp;
              return OSPaths;
            }
            __name(OSPaths_2, "OSPaths_2");
            __name2(OSPaths_2, "OSPaths_");
            return OSPaths_2;
          }();
          return { OSPaths: new OSPaths_() };
        }
        __name(Adapt, "Adapt");
        __name2(Adapt, "Adapt");
        exports.Adapt = Adapt;
      }
    });
    require_node = __commonJS2({
      "../../node_modules/.pnpm/os-paths@7.4.0/node_modules/os-paths/dist/cjs/platform-adapters/node.js"(exports) {
        var __createBinding2 = exports && exports.__createBinding || (Object.create ? function(o7, m7, k7, k22) {
          if (k22 === void 0) k22 = k7;
          Object.defineProperty(o7, k22, { enumerable: true, get: /* @__PURE__ */ __name2(function() {
            return m7[k7];
          }, "get") });
        } : function(o7, m7, k7, k22) {
          if (k22 === void 0) k22 = k7;
          o7[k22] = m7[k7];
        });
        var __setModuleDefault2 = exports && exports.__setModuleDefault || (Object.create ? function(o7, v8) {
          Object.defineProperty(o7, "default", { enumerable: true, value: v8 });
        } : function(o7, v8) {
          o7["default"] = v8;
        });
        var __importStar2 = exports && exports.__importStar || function(mod) {
          if (mod && mod.__esModule) return mod;
          var result = {};
          if (mod != null) {
            for (var k7 in mod) if (k7 !== "default" && Object.prototype.hasOwnProperty.call(mod, k7)) __createBinding2(result, mod, k7);
          }
          __setModuleDefault2(result, mod);
          return result;
        };
        exports.__esModule = true;
        exports.adapter = void 0;
        var os22 = __importStar2(__require2("os"));
        var path410 = __importStar2(__require2("path"));
        exports.adapter = {
          atImportPermissions: { env: true },
          env: {
            get: /* @__PURE__ */ __name2(function(s7) {
              return process.env[s7];
            }, "get")
          },
          os: os22,
          path: path410,
          process
        };
      }
    });
    require_mod_cjs = __commonJS2({
      "../../node_modules/.pnpm/os-paths@7.4.0/node_modules/os-paths/dist/cjs/mod.cjs.js"(exports, module2) {
        var OSPaths_js_1 = require_OSPaths();
        var node_js_1 = require_node();
        module2.exports = OSPaths_js_1.Adapt(node_js_1.adapter).OSPaths;
      }
    });
    require_node2 = __commonJS2({
      "../../node_modules/.pnpm/xdg-portable@10.6.0/node_modules/xdg-portable/dist/cjs/platform-adapters/node.js"(exports) {
        var __createBinding2 = exports && exports.__createBinding || (Object.create ? function(o7, m7, k7, k22) {
          if (k22 === void 0) k22 = k7;
          Object.defineProperty(o7, k22, { enumerable: true, get: /* @__PURE__ */ __name2(function() {
            return m7[k7];
          }, "get") });
        } : function(o7, m7, k7, k22) {
          if (k22 === void 0) k22 = k7;
          o7[k22] = m7[k7];
        });
        var __setModuleDefault2 = exports && exports.__setModuleDefault || (Object.create ? function(o7, v8) {
          Object.defineProperty(o7, "default", { enumerable: true, value: v8 });
        } : function(o7, v8) {
          o7["default"] = v8;
        });
        var __importStar2 = exports && exports.__importStar || function(mod) {
          if (mod && mod.__esModule) return mod;
          var result = {};
          if (mod != null) {
            for (var k7 in mod) if (k7 !== "default" && Object.prototype.hasOwnProperty.call(mod, k7)) __createBinding2(result, mod, k7);
          }
          __setModuleDefault2(result, mod);
          return result;
        };
        var __importDefault2 = exports && exports.__importDefault || function(mod) {
          return mod && mod.__esModule ? mod : { "default": mod };
        };
        exports.__esModule = true;
        exports.adapter = void 0;
        var path410 = __importStar2(__require2("path"));
        var os_paths_1 = __importDefault2(require_mod_cjs());
        exports.adapter = {
          atImportPermissions: { env: true },
          env: {
            get: /* @__PURE__ */ __name2(function(s7) {
              return process.env[s7];
            }, "get")
          },
          osPaths: os_paths_1["default"],
          path: path410,
          process
        };
      }
    });
    require_mod_cjs2 = __commonJS2({
      "../../node_modules/.pnpm/xdg-portable@10.6.0/node_modules/xdg-portable/dist/cjs/mod.cjs.js"(exports, module2) {
        var XDG_js_1 = require_XDG();
        var node_js_1 = require_node2();
        module2.exports = XDG_js_1.Adapt(node_js_1.adapter).XDG;
      }
    });
    require_node3 = __commonJS2({
      "../../node_modules/.pnpm/xdg-app-paths@8.3.0/node_modules/xdg-app-paths/dist/cjs/platform-adapters/node.js"(exports) {
        var __createBinding2 = exports && exports.__createBinding || (Object.create ? function(o7, m7, k7, k22) {
          if (k22 === void 0) k22 = k7;
          Object.defineProperty(o7, k22, { enumerable: true, get: /* @__PURE__ */ __name2(function() {
            return m7[k7];
          }, "get") });
        } : function(o7, m7, k7, k22) {
          if (k22 === void 0) k22 = k7;
          o7[k22] = m7[k7];
        });
        var __setModuleDefault2 = exports && exports.__setModuleDefault || (Object.create ? function(o7, v8) {
          Object.defineProperty(o7, "default", { enumerable: true, value: v8 });
        } : function(o7, v8) {
          o7["default"] = v8;
        });
        var __importStar2 = exports && exports.__importStar || function(mod) {
          if (mod && mod.__esModule) return mod;
          var result = {};
          if (mod != null) {
            for (var k7 in mod) if (k7 !== "default" && Object.prototype.hasOwnProperty.call(mod, k7)) __createBinding2(result, mod, k7);
          }
          __setModuleDefault2(result, mod);
          return result;
        };
        var __importDefault2 = exports && exports.__importDefault || function(mod) {
          return mod && mod.__esModule ? mod : { "default": mod };
        };
        exports.__esModule = true;
        exports.adapter = void 0;
        var path410 = __importStar2(__require2("path"));
        var xdg_portable_1 = __importDefault2(require_mod_cjs2());
        exports.adapter = {
          atImportPermissions: { env: true, read: true },
          meta: {
            mainFilename: /* @__PURE__ */ __name2(function() {
              var requireMain = typeof __require2 !== "undefined" && __require2 !== null && __require2.main ? __require2.main : { filename: void 0 };
              var requireMainFilename = requireMain.filename;
              var filename = (requireMainFilename !== process.execArgv[0] ? requireMainFilename : void 0) || (typeof process._eval === "undefined" ? process.argv[1] : void 0);
              return filename;
            }, "mainFilename"),
            pkgMainFilename: /* @__PURE__ */ __name2(function() {
              return process.pkg ? process.execPath : void 0;
            }, "pkgMainFilename")
          },
          path: path410,
          process,
          xdg: xdg_portable_1["default"]
        };
      }
    });
    require_mod_cjs3 = __commonJS2({
      "../../node_modules/.pnpm/xdg-app-paths@8.3.0/node_modules/xdg-app-paths/dist/cjs/mod.cjs.js"(exports, module2) {
        var XDGAppPaths_js_1 = require_XDGAppPaths();
        var node_js_1 = require_node3();
        module2.exports = XDGAppPaths_js_1.Adapt(node_js_1.adapter).XDGAppPaths;
      }
    });
    exports.unstable_defaultWranglerConfig = {
      /* COMPUTED_FIELDS */
      configPath: void 0,
      userConfigPath: void 0,
      topLevelName: void 0,
      definedEnvironments: void 0,
      targetEnvironment: void 0,
      /*====================================================*/
      /*      Fields supported by both Workers & Pages      */
      /*====================================================*/
      /* TOP-LEVEL ONLY FIELDS */
      pages_build_output_dir: void 0,
      send_metrics: void 0,
      dev: {
        ip: process.platform === "win32" ? "127.0.0.1" : "localhost",
        port: void 0,
        // the default of 8787 is set at runtime
        inspector_port: void 0,
        // the default of 9229 is set at runtime
        inspector_ip: void 0,
        // the default of 127.0.0.1 is set at runtime
        local_protocol: "http",
        upstream_protocol: "http",
        host: void 0,
        // Note this one is also workers only
        enable_containers: true,
        container_engine: void 0,
        generate_types: false
      },
      /** INHERITABLE ENVIRONMENT FIELDS **/
      name: void 0,
      compatibility_date: void 0,
      compatibility_flags: [],
      limits: void 0,
      placement: void 0,
      /** NON-INHERITABLE ENVIRONMENT FIELDS **/
      vars: {},
      durable_objects: { bindings: [] },
      kv_namespaces: [],
      queues: {
        producers: [],
        consumers: []
        // WORKERS SUPPORT ONLY!!
      },
      r2_buckets: [],
      d1_databases: [],
      vectorize: [],
      ai_search_namespaces: [],
      ai_search: [],
      hyperdrive: [],
      workflows: [],
      secrets_store_secrets: [],
      services: [],
      analytics_engine_datasets: [],
      ai: void 0,
      images: void 0,
      stream: void 0,
      media: void 0,
      version_metadata: void 0,
      unsafe_hello_world: [],
      flagship: [],
      ratelimits: [],
      worker_loaders: [],
      /*====================================================*/
      /*           Fields supported by Workers only         */
      /*====================================================*/
      /* TOP-LEVEL ONLY FIELDS */
      legacy_env: true,
      site: void 0,
      wasm_modules: void 0,
      text_blobs: void 0,
      data_blobs: void 0,
      keep_vars: void 0,
      alias: void 0,
      /** INHERITABLE ENVIRONMENT FIELDS **/
      account_id: void 0,
      main: void 0,
      find_additional_modules: void 0,
      preserve_file_names: void 0,
      base_dir: void 0,
      workers_dev: void 0,
      preview_urls: void 0,
      route: void 0,
      routes: void 0,
      tsconfig: void 0,
      jsx_factory: "React.createElement",
      jsx_fragment: "React.Fragment",
      migrations: [],
      triggers: {
        crons: void 0
      },
      rules: [],
      build: { command: void 0, watch_dir: "./src", cwd: void 0 },
      no_bundle: void 0,
      minify: void 0,
      keep_names: void 0,
      dispatch_namespaces: [],
      first_party_worker: void 0,
      logfwdr: { bindings: [] },
      logpush: void 0,
      upload_source_maps: void 0,
      assets: void 0,
      observability: { enabled: true },
      cache: void 0,
      /** The default here is undefined so that we can delegate to the CLOUDFLARE_COMPLIANCE_REGION environment variable. */
      compliance_region: void 0,
      python_modules: { exclude: ["**/*.pyc"] },
      previews: void 0,
      /** NON-INHERITABLE ENVIRONMENT FIELDS **/
      define: {},
      cloudchamber: {},
      containers: void 0,
      send_email: [],
      browser: void 0,
      unsafe: {},
      mtls_certificates: [],
      tail_consumers: void 0,
      streaming_tail_consumers: void 0,
      pipelines: [],
      vpc_services: [],
      vpc_networks: []
    };
    exports.experimental_patchConfig = /* @__PURE__ */ __name2((configPath, patch, isArrayInsertion = true) => {
      let configString = readFileSync(configPath);
      if (configPath.endsWith("toml")) {
        if (configString.includes("#")) {
          throw new PatchConfigError(
            "cannot patch .toml config if comments are present"
          );
        } else {
          configString = JSON.stringify(parseTOML(configString));
        }
      }
      const patchPaths = [];
      getJSONPath(patch, patchPaths, isArrayInsertion);
      for (const patchPath of patchPaths) {
        const value = patchPath.pop();
        const edit = modify(configString, patchPath, value, {
          isArrayInsertion
        });
        configString = applyEdits(configString, edit);
      }
      const formatEdit = format2(configString, void 0, {});
      configString = applyEdits(configString, formatEdit);
      if (configPath.endsWith(".toml")) {
        configString = dist_default.stringify(parseJSONC(configString));
      }
      fs29.writeFileSync(configPath, configString);
      return configString;
    }, "experimental_patchConfig");
    getJSONPath = /* @__PURE__ */ __name2((obj, allPaths, isArrayInsertion, prevPath = []) => {
      for (const [k7, v8] of Object.entries(obj)) {
        const currentPath = [...prevPath, k7];
        if (Array.isArray(v8)) {
          v8.forEach((x7, i7) => {
            if (isArrayInsertion) {
              allPaths.push([...currentPath, -1, x7]);
            } else if (typeof x7 === "object" && x7 !== null) {
              getJSONPath(x7, allPaths, isArrayInsertion, [...currentPath, i7]);
            } else {
              allPaths.push([...currentPath, i7, x7]);
            }
          });
        } else if (typeof v8 === "object" && v8 !== null) {
          getJSONPath(v8, allPaths, isArrayInsertion, currentPath);
        } else {
          allPaths.push([...currentPath, v8]);
        }
      }
    }, "getJSONPath");
    PatchConfigError = class extends Error {
      static {
        __name(this, "PatchConfigError");
      }
      static {
        __name2(this, "PatchConfigError");
      }
    };
    (function(util22) {
      util22.assertEqual = (val2) => val2;
      function assertIs(_arg) {
      }
      __name(assertIs, "assertIs");
      __name2(assertIs, "assertIs");
      util22.assertIs = assertIs;
      function assertNever22(_x2) {
        throw new Error();
      }
      __name(assertNever22, "assertNever2");
      __name2(assertNever22, "assertNever");
      util22.assertNever = assertNever22;
      util22.arrayToEnum = (items) => {
        const obj = {};
        for (const item of items) {
          obj[item] = item;
        }
        return obj;
      };
      util22.getValidEnumValues = (obj) => {
        const validKeys = util22.objectKeys(obj).filter((k7) => typeof obj[obj[k7]] !== "number");
        const filtered = {};
        for (const k7 of validKeys) {
          filtered[k7] = obj[k7];
        }
        return util22.objectValues(filtered);
      };
      util22.objectValues = (obj) => {
        return util22.objectKeys(obj).map(function(e22) {
          return obj[e22];
        });
      };
      util22.objectKeys = typeof Object.keys === "function" ? (obj) => Object.keys(obj) : (object) => {
        const keys = [];
        for (const key in object) {
          if (Object.prototype.hasOwnProperty.call(object, key)) {
            keys.push(key);
          }
        }
        return keys;
      };
      util22.find = (arr, checker) => {
        for (const item of arr) {
          if (checker(item))
            return item;
        }
        return void 0;
      };
      util22.isInteger = typeof Number.isInteger === "function" ? (val2) => Number.isInteger(val2) : (val2) => typeof val2 === "number" && isFinite(val2) && Math.floor(val2) === val2;
      function joinValues(array, separator = " | ") {
        return array.map((val2) => typeof val2 === "string" ? `'${val2}'` : val2).join(separator);
      }
      __name(joinValues, "joinValues");
      __name2(joinValues, "joinValues");
      util22.joinValues = joinValues;
      util22.jsonStringifyReplacer = (_22, value) => {
        if (typeof value === "bigint") {
          return value.toString();
        }
        return value;
      };
    })(util || (util = {}));
    (function(objectUtil22) {
      objectUtil22.mergeShapes = (first, second) => {
        return {
          ...first,
          ...second
          // second overwrites first
        };
      };
    })(objectUtil || (objectUtil = {}));
    ZodParsedType = util.arrayToEnum([
      "string",
      "nan",
      "number",
      "integer",
      "float",
      "boolean",
      "date",
      "bigint",
      "symbol",
      "function",
      "undefined",
      "null",
      "array",
      "object",
      "unknown",
      "promise",
      "void",
      "never",
      "map",
      "set"
    ]);
    getParsedType = /* @__PURE__ */ __name2((data) => {
      const t22 = typeof data;
      switch (t22) {
        case "undefined":
          return ZodParsedType.undefined;
        case "string":
          return ZodParsedType.string;
        case "number":
          return isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;
        case "boolean":
          return ZodParsedType.boolean;
        case "function":
          return ZodParsedType.function;
        case "bigint":
          return ZodParsedType.bigint;
        case "symbol":
          return ZodParsedType.symbol;
        case "object":
          if (Array.isArray(data)) {
            return ZodParsedType.array;
          }
          if (data === null) {
            return ZodParsedType.null;
          }
          if (data.then && typeof data.then === "function" && data.catch && typeof data.catch === "function") {
            return ZodParsedType.promise;
          }
          if (typeof Map !== "undefined" && data instanceof Map) {
            return ZodParsedType.map;
          }
          if (typeof Set !== "undefined" && data instanceof Set) {
            return ZodParsedType.set;
          }
          if (typeof Date !== "undefined" && data instanceof Date) {
            return ZodParsedType.date;
          }
          return ZodParsedType.object;
        default:
          return ZodParsedType.unknown;
      }
    }, "getParsedType");
    ZodIssueCode = util.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"
    ]);
    quotelessJson = /* @__PURE__ */ __name2((obj) => {
      const json = JSON.stringify(obj, null, 2);
      return json.replace(/"([^"]+)":/g, "$1:");
    }, "quotelessJson");
    ZodError = class extends Error {
      static {
        __name(this, "ZodError");
      }
      static {
        __name2(this, "ZodError");
      }
      constructor(issues) {
        super();
        this.issues = [];
        this.addIssue = (sub) => {
          this.issues = [...this.issues, sub];
        };
        this.addIssues = (subs = []) => {
          this.issues = [...this.issues, ...subs];
        };
        const actualProto = new.target.prototype;
        if (Object.setPrototypeOf) {
          Object.setPrototypeOf(this, actualProto);
        } else {
          this.__proto__ = actualProto;
        }
        this.name = "ZodError";
        this.issues = issues;
      }
      get errors() {
        return this.issues;
      }
      format(_mapper) {
        const mapper = _mapper || function(issue) {
          return issue.message;
        };
        const fieldErrors = { _errors: [] };
        const processError = /* @__PURE__ */ __name2((error2) => {
          for (const issue of error2.issues) {
            if (issue.code === "invalid_union") {
              issue.unionErrors.map(processError);
            } else if (issue.code === "invalid_return_type") {
              processError(issue.returnTypeError);
            } else if (issue.code === "invalid_arguments") {
              processError(issue.argumentsError);
            } else if (issue.path.length === 0) {
              fieldErrors._errors.push(mapper(issue));
            } else {
              let curr = fieldErrors;
              let i7 = 0;
              while (i7 < issue.path.length) {
                const el = issue.path[i7];
                const terminal = i7 === issue.path.length - 1;
                if (!terminal) {
                  curr[el] = curr[el] || { _errors: [] };
                } else {
                  curr[el] = curr[el] || { _errors: [] };
                  curr[el]._errors.push(mapper(issue));
                }
                curr = curr[el];
                i7++;
              }
            }
          }
        }, "processError");
        processError(this);
        return fieldErrors;
      }
      toString() {
        return this.message;
      }
      get message() {
        return JSON.stringify(this.issues, util.jsonStringifyReplacer, 2);
      }
      get isEmpty() {
        return this.issues.length === 0;
      }
      flatten(mapper = (issue) => issue.message) {
        const fieldErrors = {};
        const formErrors = [];
        for (const sub of this.issues) {
          if (sub.path.length > 0) {
            fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || [];
            fieldErrors[sub.path[0]].push(mapper(sub));
          } else {
            formErrors.push(mapper(sub));
          }
        }
        return { formErrors, fieldErrors };
      }
      get formErrors() {
        return this.flatten();
      }
    };
    ZodError.create = (issues) => {
      const error2 = new ZodError(issues);
      return error2;
    };
    errorMap = /* @__PURE__ */ __name2((issue, _ctx) => {
      let message;
      switch (issue.code) {
        case ZodIssueCode.invalid_type:
          if (issue.received === ZodParsedType.undefined) {
            message = "Required";
          } else {
            message = `Expected ${issue.expected}, received ${issue.received}`;
          }
          break;
        case ZodIssueCode.invalid_literal:
          message = `Invalid literal value, expected ${JSON.stringify(issue.expected, util.jsonStringifyReplacer)}`;
          break;
        case ZodIssueCode.unrecognized_keys:
          message = `Unrecognized key(s) in object: ${util.joinValues(issue.keys, ", ")}`;
          break;
        case ZodIssueCode.invalid_union:
          message = `Invalid input`;
          break;
        case ZodIssueCode.invalid_union_discriminator:
          message = `Invalid discriminator value. Expected ${util.joinValues(issue.options)}`;
          break;
        case ZodIssueCode.invalid_enum_value:
          message = `Invalid enum value. Expected ${util.joinValues(issue.options)}, received '${issue.received}'`;
          break;
        case ZodIssueCode.invalid_arguments:
          message = `Invalid function arguments`;
          break;
        case ZodIssueCode.invalid_return_type:
          message = `Invalid function return type`;
          break;
        case ZodIssueCode.invalid_date:
          message = `Invalid date`;
          break;
        case ZodIssueCode.invalid_string:
          if (typeof issue.validation === "object") {
            if ("includes" in issue.validation) {
              message = `Invalid input: must include "${issue.validation.includes}"`;
              if (typeof issue.validation.position === "number") {
                message = `${message} at one or more positions greater than or equal to ${issue.validation.position}`;
              }
            } else if ("startsWith" in issue.validation) {
              message = `Invalid input: must start with "${issue.validation.startsWith}"`;
            } else if ("endsWith" in issue.validation) {
              message = `Invalid input: must end with "${issue.validation.endsWith}"`;
            } else {
              util.assertNever(issue.validation);
            }
          } else if (issue.validation !== "regex") {
            message = `Invalid ${issue.validation}`;
          } else {
            message = "Invalid";
          }
          break;
        case ZodIssueCode.too_small:
          if (issue.type === "array")
            message = `Array must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `more than`} ${issue.minimum} element(s)`;
          else if (issue.type === "string")
            message = `String must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`;
          else if (issue.type === "number")
            message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;
          else if (issue.type === "date")
            message = `Date must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${new Date(Number(issue.minimum))}`;
          else
            message = "Invalid input";
          break;
        case ZodIssueCode.too_big:
          if (issue.type === "array")
            message = `Array must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `less than`} ${issue.maximum} element(s)`;
          else if (issue.type === "string")
            message = `String must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`;
          else if (issue.type === "number")
            message = `Number must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;
          else if (issue.type === "bigint")
            message = `BigInt must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;
          else if (issue.type === "date")
            message = `Date must be ${issue.exact ? `exactly` : issue.inclusive ? `smaller than or equal to` : `smaller than`} ${new Date(Number(issue.maximum))}`;
          else
            message = "Invalid input";
          break;
        case ZodIssueCode.custom:
          message = `Invalid input`;
          break;
        case ZodIssueCode.invalid_intersection_types:
          message = `Intersection results could not be merged`;
          break;
        case ZodIssueCode.not_multiple_of:
          message = `Number must be a multiple of ${issue.multipleOf}`;
          break;
        case ZodIssueCode.not_finite:
          message = "Number must be finite";
          break;
        default:
          message = _ctx.defaultError;
          util.assertNever(issue);
      }
      return { message };
    }, "errorMap");
    overrideErrorMap = errorMap;
    __name(setErrorMap, "setErrorMap");
    __name2(setErrorMap, "setErrorMap");
    __name(getErrorMap, "getErrorMap");
    __name2(getErrorMap, "getErrorMap");
    makeIssue = /* @__PURE__ */ __name2((params) => {
      const { data, path: path410, errorMaps, issueData } = params;
      const fullPath = [...path410, ...issueData.path || []];
      const fullIssue = {
        ...issueData,
        path: fullPath
      };
      let errorMessage = "";
      const maps = errorMaps.filter((m7) => !!m7).slice().reverse();
      for (const map2 of maps) {
        errorMessage = map2(fullIssue, { data, defaultError: errorMessage }).message;
      }
      return {
        ...issueData,
        path: fullPath,
        message: issueData.message || errorMessage
      };
    }, "makeIssue");
    EMPTY_PATH = [];
    __name(addIssueToContext, "addIssueToContext");
    __name2(addIssueToContext, "addIssueToContext");
    ParseStatus = class _ParseStatus {
      static {
        __name(this, "_ParseStatus");
      }
      static {
        __name2(this, "ParseStatus");
      }
      constructor() {
        this.value = "valid";
      }
      dirty() {
        if (this.value === "valid")
          this.value = "dirty";
      }
      abort() {
        if (this.value !== "aborted")
          this.value = "aborted";
      }
      static mergeArray(status2, results) {
        const arrayValue = [];
        for (const s7 of results) {
          if (s7.status === "aborted")
            return INVALID;
          if (s7.status === "dirty")
            status2.dirty();
          arrayValue.push(s7.value);
        }
        return { status: status2.value, value: arrayValue };
      }
      static async mergeObjectAsync(status2, pairs) {
        const syncPairs = [];
        for (const pair of pairs) {
          syncPairs.push({
            key: await pair.key,
            value: await pair.value
          });
        }
        return _ParseStatus.mergeObjectSync(status2, syncPairs);
      }
      static mergeObjectSync(status2, pairs) {
        const finalObject = {};
        for (const pair of pairs) {
          const { key, value } = pair;
          if (key.status === "aborted")
            return INVALID;
          if (value.status === "aborted")
            return INVALID;
          if (key.status === "dirty")
            status2.dirty();
          if (value.status === "dirty")
            status2.dirty();
          if (key.value !== "__proto__" && (typeof value.value !== "undefined" || pair.alwaysSet)) {
            finalObject[key.value] = value.value;
          }
        }
        return { status: status2.value, value: finalObject };
      }
    };
    INVALID = Object.freeze({
      status: "aborted"
    });
    DIRTY = /* @__PURE__ */ __name2((value) => ({ status: "dirty", value }), "DIRTY");
    OK = /* @__PURE__ */ __name2((value) => ({ status: "valid", value }), "OK");
    isAborted = /* @__PURE__ */ __name2((x7) => x7.status === "aborted", "isAborted");
    isDirty = /* @__PURE__ */ __name2((x7) => x7.status === "dirty", "isDirty");
    isValid = /* @__PURE__ */ __name2((x7) => x7.status === "valid", "isValid");
    isAsync = /* @__PURE__ */ __name2((x7) => typeof Promise !== "undefined" && x7 instanceof Promise, "isAsync");
    (function(errorUtil22) {
      errorUtil22.errToObj = (message) => typeof message === "string" ? { message } : message || {};
      errorUtil22.toString = (message) => typeof message === "string" ? message : message === null || message === void 0 ? void 0 : message.message;
    })(errorUtil || (errorUtil = {}));
    ParseInputLazyPath = class {
      static {
        __name(this, "ParseInputLazyPath");
      }
      static {
        __name2(this, "ParseInputLazyPath");
      }
      constructor(parent, value, path410, key) {
        this._cachedPath = [];
        this.parent = parent;
        this.data = value;
        this._path = path410;
        this._key = key;
      }
      get path() {
        if (!this._cachedPath.length) {
          if (this._key instanceof Array) {
            this._cachedPath.push(...this._path, ...this._key);
          } else {
            this._cachedPath.push(...this._path, this._key);
          }
        }
        return this._cachedPath;
      }
    };
    handleResult = /* @__PURE__ */ __name2((ctx, result) => {
      if (isValid(result)) {
        return { success: true, data: result.value };
      } else {
        if (!ctx.common.issues.length) {
          throw new Error("Validation failed but no issues detected.");
        }
        return {
          success: false,
          get error() {
            if (this._error)
              return this._error;
            const error2 = new ZodError(ctx.common.issues);
            this._error = error2;
            return this._error;
          }
        };
      }
    }, "handleResult");
    __name(processCreateParams, "processCreateParams");
    __name2(processCreateParams, "processCreateParams");
    ZodType = class {
      static {
        __name(this, "ZodType");
      }
      static {
        __name2(this, "ZodType");
      }
      constructor(def) {
        this.spa = this.safeParseAsync;
        this._def = def;
        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);
      }
      get description() {
        return this._def.description;
      }
      _getType(input) {
        return getParsedType(input.data);
      }
      _getOrReturnCtx(input, ctx) {
        return ctx || {
          common: input.parent.common,
          data: input.data,
          parsedType: getParsedType(input.data),
          schemaErrorMap: this._def.errorMap,
          path: input.path,
          parent: input.parent
        };
      }
      _processInputParams(input) {
        return {
          status: new ParseStatus(),
          ctx: {
            common: input.parent.common,
            data: input.data,
            parsedType: getParsedType(input.data),
            schemaErrorMap: this._def.errorMap,
            path: input.path,
            parent: input.parent
          }
        };
      }
      _parseSync(input) {
        const result = this._parse(input);
        if (isAsync(result)) {
          throw new Error("Synchronous parse encountered promise.");
        }
        return result;
      }
      _parseAsync(input) {
        const result = this._parse(input);
        return Promise.resolve(result);
      }
      parse(data, params) {
        const result = this.safeParse(data, params);
        if (result.success)
          return result.data;
        throw result.error;
      }
      safeParse(data, params) {
        var _a5;
        const ctx = {
          common: {
            issues: [],
            async: (_a5 = params === null || params === void 0 ? void 0 : params.async) !== null && _a5 !== void 0 ? _a5 : false,
            contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap
          },
          path: (params === null || params === void 0 ? void 0 : params.path) || [],
          schemaErrorMap: this._def.errorMap,
          parent: null,
          data,
          parsedType: getParsedType(data)
        };
        const result = this._parseSync({ data, path: ctx.path, parent: ctx });
        return handleResult(ctx, result);
      }
      async parseAsync(data, params) {
        const result = await this.safeParseAsync(data, params);
        if (result.success)
          return result.data;
        throw result.error;
      }
      async safeParseAsync(data, params) {
        const ctx = {
          common: {
            issues: [],
            contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap,
            async: true
          },
          path: (params === null || params === void 0 ? void 0 : params.path) || [],
          schemaErrorMap: this._def.errorMap,
          parent: null,
          data,
          parsedType: getParsedType(data)
        };
        const maybeAsyncResult2 = this._parse({ data, path: ctx.path, parent: ctx });
        const result = await (isAsync(maybeAsyncResult2) ? maybeAsyncResult2 : Promise.resolve(maybeAsyncResult2));
        return handleResult(ctx, result);
      }
      refine(check, message) {
        const getIssueProperties = /* @__PURE__ */ __name2((val2) => {
          if (typeof message === "string" || typeof message === "undefined") {
            return { message };
          } else if (typeof message === "function") {
            return message(val2);
          } else {
            return message;
          }
        }, "getIssueProperties");
        return this._refinement((val2, ctx) => {
          const result = check(val2);
          const setError = /* @__PURE__ */ __name2(() => ctx.addIssue({
            code: ZodIssueCode.custom,
            ...getIssueProperties(val2)
          }), "setError");
          if (typeof Promise !== "undefined" && result instanceof Promise) {
            return result.then((data) => {
              if (!data) {
                setError();
                return false;
              } else {
                return true;
              }
            });
          }
          if (!result) {
            setError();
            return false;
          } else {
            return true;
          }
        });
      }
      refinement(check, refinementData) {
        return this._refinement((val2, ctx) => {
          if (!check(val2)) {
            ctx.addIssue(typeof refinementData === "function" ? refinementData(val2, ctx) : refinementData);
            return false;
          } else {
            return true;
          }
        });
      }
      _refinement(refinement) {
        return new ZodEffects({
          schema: this,
          typeName: ZodFirstPartyTypeKind.ZodEffects,
          effect: { type: "refinement", refinement }
        });
      }
      superRefine(refinement) {
        return this._refinement(refinement);
      }
      optional() {
        return ZodOptional.create(this, this._def);
      }
      nullable() {
        return ZodNullable.create(this, this._def);
      }
      nullish() {
        return this.nullable().optional();
      }
      array() {
        return ZodArray.create(this, this._def);
      }
      promise() {
        return ZodPromise.create(this, this._def);
      }
      or(option) {
        return ZodUnion.create([this, option], this._def);
      }
      and(incoming) {
        return ZodIntersection.create(this, incoming, this._def);
      }
      transform(transform) {
        return new ZodEffects({
          ...processCreateParams(this._def),
          schema: this,
          typeName: ZodFirstPartyTypeKind.ZodEffects,
          effect: { type: "transform", transform }
        });
      }
      default(def) {
        const defaultValueFunc = typeof def === "function" ? def : () => def;
        return new ZodDefault({
          ...processCreateParams(this._def),
          innerType: this,
          defaultValue: defaultValueFunc,
          typeName: ZodFirstPartyTypeKind.ZodDefault
        });
      }
      brand() {
        return new ZodBranded({
          typeName: ZodFirstPartyTypeKind.ZodBranded,
          type: this,
          ...processCreateParams(this._def)
        });
      }
      catch(def) {
        const catchValueFunc = typeof def === "function" ? def : () => def;
        return new ZodCatch({
          ...processCreateParams(this._def),
          innerType: this,
          catchValue: catchValueFunc,
          typeName: ZodFirstPartyTypeKind.ZodCatch
        });
      }
      describe(description) {
        const This = this.constructor;
        return new This({
          ...this._def,
          description
        });
      }
      pipe(target) {
        return ZodPipeline.create(this, target);
      }
      readonly() {
        return ZodReadonly.create(this);
      }
      isOptional() {
        return this.safeParse(void 0).success;
      }
      isNullable() {
        return this.safeParse(null).success;
      }
    };
    cuidRegex = /^c[^\s-]{8,}$/i;
    cuid2Regex = /^[a-z][a-z0-9]*$/;
    ulidRegex = /[0-9A-HJKMNP-TV-Z]{26}/;
    uuidRegex = /^[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;
    emailRegex = /^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;
    emojiRegex = /^(\p{Extended_Pictographic}|\p{Emoji_Component})+$/u;
    ipv4Regex = /^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/;
    ipv6Regex = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/;
    datetimeRegex = /* @__PURE__ */ __name2((args) => {
      if (args.precision) {
        if (args.offset) {
          return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`);
        } else {
          return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}Z$`);
        }
      } else if (args.precision === 0) {
        if (args.offset) {
          return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$`);
        } else {
          return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$`);
        }
      } else {
        if (args.offset) {
          return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$`);
        } else {
          return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$`);
        }
      }
    }, "datetimeRegex");
    __name(isValidIP, "isValidIP");
    __name2(isValidIP, "isValidIP");
    ZodString = class _ZodString extends ZodType {
      static {
        __name(this, "_ZodString");
      }
      static {
        __name2(this, "ZodString");
      }
      constructor() {
        super(...arguments);
        this._regex = (regex2, validation2, message) => this.refinement((data) => regex2.test(data), {
          validation: validation2,
          code: ZodIssueCode.invalid_string,
          ...errorUtil.errToObj(message)
        });
        this.nonempty = (message) => this.min(1, errorUtil.errToObj(message));
        this.trim = () => new _ZodString({
          ...this._def,
          checks: [...this._def.checks, { kind: "trim" }]
        });
        this.toLowerCase = () => new _ZodString({
          ...this._def,
          checks: [...this._def.checks, { kind: "toLowerCase" }]
        });
        this.toUpperCase = () => new _ZodString({
          ...this._def,
          checks: [...this._def.checks, { kind: "toUpperCase" }]
        });
      }
      _parse(input) {
        if (this._def.coerce) {
          input.data = String(input.data);
        }
        const parsedType = this._getType(input);
        if (parsedType !== ZodParsedType.string) {
          const ctx2 = this._getOrReturnCtx(input);
          addIssueToContext(
            ctx2,
            {
              code: ZodIssueCode.invalid_type,
              expected: ZodParsedType.string,
              received: ctx2.parsedType
            }
            //
          );
          return INVALID;
        }
        const status2 = new ParseStatus();
        let ctx = void 0;
        for (const check of this._def.checks) {
          if (check.kind === "min") {
            if (input.data.length < check.value) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext(ctx, {
                code: ZodIssueCode.too_small,
                minimum: check.value,
                type: "string",
                inclusive: true,
                exact: false,
                message: check.message
              });
              status2.dirty();
            }
          } else if (check.kind === "max") {
            if (input.data.length > check.value) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext(ctx, {
                code: ZodIssueCode.too_big,
                maximum: check.value,
                type: "string",
                inclusive: true,
                exact: false,
                message: check.message
              });
              status2.dirty();
            }
          } else if (check.kind === "length") {
            const tooBig = input.data.length > check.value;
            const tooSmall = input.data.length < check.value;
            if (tooBig || tooSmall) {
              ctx = this._getOrReturnCtx(input, ctx);
              if (tooBig) {
                addIssueToContext(ctx, {
                  code: ZodIssueCode.too_big,
                  maximum: check.value,
                  type: "string",
                  inclusive: true,
                  exact: true,
                  message: check.message
                });
              } else if (tooSmall) {
                addIssueToContext(ctx, {
                  code: ZodIssueCode.too_small,
                  minimum: check.value,
                  type: "string",
                  inclusive: true,
                  exact: true,
                  message: check.message
                });
              }
              status2.dirty();
            }
          } else if (check.kind === "email") {
            if (!emailRegex.test(input.data)) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext(ctx, {
                validation: "email",
                code: ZodIssueCode.invalid_string,
                message: check.message
              });
              status2.dirty();
            }
          } else if (check.kind === "emoji") {
            if (!emojiRegex.test(input.data)) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext(ctx, {
                validation: "emoji",
                code: ZodIssueCode.invalid_string,
                message: check.message
              });
              status2.dirty();
            }
          } else if (check.kind === "uuid") {
            if (!uuidRegex.test(input.data)) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext(ctx, {
                validation: "uuid",
                code: ZodIssueCode.invalid_string,
                message: check.message
              });
              status2.dirty();
            }
          } else if (check.kind === "cuid") {
            if (!cuidRegex.test(input.data)) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext(ctx, {
                validation: "cuid",
                code: ZodIssueCode.invalid_string,
                message: check.message
              });
              status2.dirty();
            }
          } else if (check.kind === "cuid2") {
            if (!cuid2Regex.test(input.data)) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext(ctx, {
                validation: "cuid2",
                code: ZodIssueCode.invalid_string,
                message: check.message
              });
              status2.dirty();
            }
          } else if (check.kind === "ulid") {
            if (!ulidRegex.test(input.data)) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext(ctx, {
                validation: "ulid",
                code: ZodIssueCode.invalid_string,
                message: check.message
              });
              status2.dirty();
            }
          } else if (check.kind === "url") {
            try {
              new URL(input.data);
            } catch (_a5) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext(ctx, {
                validation: "url",
                code: ZodIssueCode.invalid_string,
                message: check.message
              });
              status2.dirty();
            }
          } else if (check.kind === "regex") {
            check.regex.lastIndex = 0;
            const testResult = check.regex.test(input.data);
            if (!testResult) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext(ctx, {
                validation: "regex",
                code: ZodIssueCode.invalid_string,
                message: check.message
              });
              status2.dirty();
            }
          } else if (check.kind === "trim") {
            input.data = input.data.trim();
          } else if (check.kind === "includes") {
            if (!input.data.includes(check.value, check.position)) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext(ctx, {
                code: ZodIssueCode.invalid_string,
                validation: { includes: check.value, position: check.position },
                message: check.message
              });
              status2.dirty();
            }
          } else if (check.kind === "toLowerCase") {
            input.data = input.data.toLowerCase();
          } else if (check.kind === "toUpperCase") {
            input.data = input.data.toUpperCase();
          } else if (check.kind === "startsWith") {
            if (!input.data.startsWith(check.value)) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext(ctx, {
                code: ZodIssueCode.invalid_string,
                validation: { startsWith: check.value },
                message: check.message
              });
              status2.dirty();
            }
          } else if (check.kind === "endsWith") {
            if (!input.data.endsWith(check.value)) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext(ctx, {
                code: ZodIssueCode.invalid_string,
                validation: { endsWith: check.value },
                message: check.message
              });
              status2.dirty();
            }
          } else if (check.kind === "datetime") {
            const regex2 = datetimeRegex(check);
            if (!regex2.test(input.data)) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext(ctx, {
                code: ZodIssueCode.invalid_string,
                validation: "datetime",
                message: check.message
              });
              status2.dirty();
            }
          } else if (check.kind === "ip") {
            if (!isValidIP(input.data, check.version)) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext(ctx, {
                validation: "ip",
                code: ZodIssueCode.invalid_string,
                message: check.message
              });
              status2.dirty();
            }
          } else {
            util.assertNever(check);
          }
        }
        return { status: status2.value, value: input.data };
      }
      _addCheck(check) {
        return new _ZodString({
          ...this._def,
          checks: [...this._def.checks, check]
        });
      }
      email(message) {
        return this._addCheck({ kind: "email", ...errorUtil.errToObj(message) });
      }
      url(message) {
        return this._addCheck({ kind: "url", ...errorUtil.errToObj(message) });
      }
      emoji(message) {
        return this._addCheck({ kind: "emoji", ...errorUtil.errToObj(message) });
      }
      uuid(message) {
        return this._addCheck({ kind: "uuid", ...errorUtil.errToObj(message) });
      }
      cuid(message) {
        return this._addCheck({ kind: "cuid", ...errorUtil.errToObj(message) });
      }
      cuid2(message) {
        return this._addCheck({ kind: "cuid2", ...errorUtil.errToObj(message) });
      }
      ulid(message) {
        return this._addCheck({ kind: "ulid", ...errorUtil.errToObj(message) });
      }
      ip(options) {
        return this._addCheck({ kind: "ip", ...errorUtil.errToObj(options) });
      }
      datetime(options) {
        var _a5;
        if (typeof options === "string") {
          return this._addCheck({
            kind: "datetime",
            precision: null,
            offset: false,
            message: options
          });
        }
        return this._addCheck({
          kind: "datetime",
          precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision,
          offset: (_a5 = options === null || options === void 0 ? void 0 : options.offset) !== null && _a5 !== void 0 ? _a5 : false,
          ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)
        });
      }
      regex(regex2, message) {
        return this._addCheck({
          kind: "regex",
          regex: regex2,
          ...errorUtil.errToObj(message)
        });
      }
      includes(value, options) {
        return this._addCheck({
          kind: "includes",
          value,
          position: options === null || options === void 0 ? void 0 : options.position,
          ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)
        });
      }
      startsWith(value, message) {
        return this._addCheck({
          kind: "startsWith",
          value,
          ...errorUtil.errToObj(message)
        });
      }
      endsWith(value, message) {
        return this._addCheck({
          kind: "endsWith",
          value,
          ...errorUtil.errToObj(message)
        });
      }
      min(minLength, message) {
        return this._addCheck({
          kind: "min",
          value: minLength,
          ...errorUtil.errToObj(message)
        });
      }
      max(maxLength, message) {
        return this._addCheck({
          kind: "max",
          value: maxLength,
          ...errorUtil.errToObj(message)
        });
      }
      length(len, message) {
        return this._addCheck({
          kind: "length",
          value: len,
          ...errorUtil.errToObj(message)
        });
      }
      get isDatetime() {
        return !!this._def.checks.find((ch2) => ch2.kind === "datetime");
      }
      get isEmail() {
        return !!this._def.checks.find((ch2) => ch2.kind === "email");
      }
      get isURL() {
        return !!this._def.checks.find((ch2) => ch2.kind === "url");
      }
      get isEmoji() {
        return !!this._def.checks.find((ch2) => ch2.kind === "emoji");
      }
      get isUUID() {
        return !!this._def.checks.find((ch2) => ch2.kind === "uuid");
      }
      get isCUID() {
        return !!this._def.checks.find((ch2) => ch2.kind === "cuid");
      }
      get isCUID2() {
        return !!this._def.checks.find((ch2) => ch2.kind === "cuid2");
      }
      get isULID() {
        return !!this._def.checks.find((ch2) => ch2.kind === "ulid");
      }
      get isIP() {
        return !!this._def.checks.find((ch2) => ch2.kind === "ip");
      }
      get minLength() {
        let min = null;
        for (const ch2 of this._def.checks) {
          if (ch2.kind === "min") {
            if (min === null || ch2.value > min)
              min = ch2.value;
          }
        }
        return min;
      }
      get maxLength() {
        let max = null;
        for (const ch2 of this._def.checks) {
          if (ch2.kind === "max") {
            if (max === null || ch2.value < max)
              max = ch2.value;
          }
        }
        return max;
      }
    };
    ZodString.create = (params) => {
      var _a5;
      return new ZodString({
        checks: [],
        typeName: ZodFirstPartyTypeKind.ZodString,
        coerce: (_a5 = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a5 !== void 0 ? _a5 : false,
        ...processCreateParams(params)
      });
    };
    __name(floatSafeRemainder, "floatSafeRemainder");
    __name2(floatSafeRemainder, "floatSafeRemainder");
    ZodNumber = class _ZodNumber extends ZodType {
      static {
        __name(this, "_ZodNumber");
      }
      static {
        __name2(this, "ZodNumber");
      }
      constructor() {
        super(...arguments);
        this.min = this.gte;
        this.max = this.lte;
        this.step = this.multipleOf;
      }
      _parse(input) {
        if (this._def.coerce) {
          input.data = Number(input.data);
        }
        const parsedType = this._getType(input);
        if (parsedType !== ZodParsedType.number) {
          const ctx2 = this._getOrReturnCtx(input);
          addIssueToContext(ctx2, {
            code: ZodIssueCode.invalid_type,
            expected: ZodParsedType.number,
            received: ctx2.parsedType
          });
          return INVALID;
        }
        let ctx = void 0;
        const status2 = new ParseStatus();
        for (const check of this._def.checks) {
          if (check.kind === "int") {
            if (!util.isInteger(input.data)) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext(ctx, {
                code: ZodIssueCode.invalid_type,
                expected: "integer",
                received: "float",
                message: check.message
              });
              status2.dirty();
            }
          } else if (check.kind === "min") {
            const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value;
            if (tooSmall) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext(ctx, {
                code: ZodIssueCode.too_small,
                minimum: check.value,
                type: "number",
                inclusive: check.inclusive,
                exact: false,
                message: check.message
              });
              status2.dirty();
            }
          } else if (check.kind === "max") {
            const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value;
            if (tooBig) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext(ctx, {
                code: ZodIssueCode.too_big,
                maximum: check.value,
                type: "number",
                inclusive: check.inclusive,
                exact: false,
                message: check.message
              });
              status2.dirty();
            }
          } else if (check.kind === "multipleOf") {
            if (floatSafeRemainder(input.data, check.value) !== 0) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext(ctx, {
                code: ZodIssueCode.not_multiple_of,
                multipleOf: check.value,
                message: check.message
              });
              status2.dirty();
            }
          } else if (check.kind === "finite") {
            if (!Number.isFinite(input.data)) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext(ctx, {
                code: ZodIssueCode.not_finite,
                message: check.message
              });
              status2.dirty();
            }
          } else {
            util.assertNever(check);
          }
        }
        return { status: status2.value, value: input.data };
      }
      gte(value, message) {
        return this.setLimit("min", value, true, errorUtil.toString(message));
      }
      gt(value, message) {
        return this.setLimit("min", value, false, errorUtil.toString(message));
      }
      lte(value, message) {
        return this.setLimit("max", value, true, errorUtil.toString(message));
      }
      lt(value, message) {
        return this.setLimit("max", value, false, errorUtil.toString(message));
      }
      setLimit(kind2, value, inclusive, message) {
        return new _ZodNumber({
          ...this._def,
          checks: [
            ...this._def.checks,
            {
              kind: kind2,
              value,
              inclusive,
              message: errorUtil.toString(message)
            }
          ]
        });
      }
      _addCheck(check) {
        return new _ZodNumber({
          ...this._def,
          checks: [...this._def.checks, check]
        });
      }
      int(message) {
        return this._addCheck({
          kind: "int",
          message: errorUtil.toString(message)
        });
      }
      positive(message) {
        return this._addCheck({
          kind: "min",
          value: 0,
          inclusive: false,
          message: errorUtil.toString(message)
        });
      }
      negative(message) {
        return this._addCheck({
          kind: "max",
          value: 0,
          inclusive: false,
          message: errorUtil.toString(message)
        });
      }
      nonpositive(message) {
        return this._addCheck({
          kind: "max",
          value: 0,
          inclusive: true,
          message: errorUtil.toString(message)
        });
      }
      nonnegative(message) {
        return this._addCheck({
          kind: "min",
          value: 0,
          inclusive: true,
          message: errorUtil.toString(message)
        });
      }
      multipleOf(value, message) {
        return this._addCheck({
          kind: "multipleOf",
          value,
          message: errorUtil.toString(message)
        });
      }
      finite(message) {
        return this._addCheck({
          kind: "finite",
          message: errorUtil.toString(message)
        });
      }
      safe(message) {
        return this._addCheck({
          kind: "min",
          inclusive: true,
          value: Number.MIN_SAFE_INTEGER,
          message: errorUtil.toString(message)
        })._addCheck({
          kind: "max",
          inclusive: true,
          value: Number.MAX_SAFE_INTEGER,
          message: errorUtil.toString(message)
        });
      }
      get minValue() {
        let min = null;
        for (const ch2 of this._def.checks) {
          if (ch2.kind === "min") {
            if (min === null || ch2.value > min)
              min = ch2.value;
          }
        }
        return min;
      }
      get maxValue() {
        let max = null;
        for (const ch2 of this._def.checks) {
          if (ch2.kind === "max") {
            if (max === null || ch2.value < max)
              max = ch2.value;
          }
        }
        return max;
      }
      get isInt() {
        return !!this._def.checks.find((ch2) => ch2.kind === "int" || ch2.kind === "multipleOf" && util.isInteger(ch2.value));
      }
      get isFinite() {
        let max = null, min = null;
        for (const ch2 of this._def.checks) {
          if (ch2.kind === "finite" || ch2.kind === "int" || ch2.kind === "multipleOf") {
            return true;
          } else if (ch2.kind === "min") {
            if (min === null || ch2.value > min)
              min = ch2.value;
          } else if (ch2.kind === "max") {
            if (max === null || ch2.value < max)
              max = ch2.value;
          }
        }
        return Number.isFinite(min) && Number.isFinite(max);
      }
    };
    ZodNumber.create = (params) => {
      return new ZodNumber({
        checks: [],
        typeName: ZodFirstPartyTypeKind.ZodNumber,
        coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,
        ...processCreateParams(params)
      });
    };
    ZodBigInt = class _ZodBigInt extends ZodType {
      static {
        __name(this, "_ZodBigInt");
      }
      static {
        __name2(this, "ZodBigInt");
      }
      constructor() {
        super(...arguments);
        this.min = this.gte;
        this.max = this.lte;
      }
      _parse(input) {
        if (this._def.coerce) {
          input.data = BigInt(input.data);
        }
        const parsedType = this._getType(input);
        if (parsedType !== ZodParsedType.bigint) {
          const ctx2 = this._getOrReturnCtx(input);
          addIssueToContext(ctx2, {
            code: ZodIssueCode.invalid_type,
            expected: ZodParsedType.bigint,
            received: ctx2.parsedType
          });
          return INVALID;
        }
        let ctx = void 0;
        const status2 = new ParseStatus();
        for (const check of this._def.checks) {
          if (check.kind === "min") {
            const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value;
            if (tooSmall) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext(ctx, {
                code: ZodIssueCode.too_small,
                type: "bigint",
                minimum: check.value,
                inclusive: check.inclusive,
                message: check.message
              });
              status2.dirty();
            }
          } else if (check.kind === "max") {
            const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value;
            if (tooBig) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext(ctx, {
                code: ZodIssueCode.too_big,
                type: "bigint",
                maximum: check.value,
                inclusive: check.inclusive,
                message: check.message
              });
              status2.dirty();
            }
          } else if (check.kind === "multipleOf") {
            if (input.data % check.value !== BigInt(0)) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext(ctx, {
                code: ZodIssueCode.not_multiple_of,
                multipleOf: check.value,
                message: check.message
              });
              status2.dirty();
            }
          } else {
            util.assertNever(check);
          }
        }
        return { status: status2.value, value: input.data };
      }
      gte(value, message) {
        return this.setLimit("min", value, true, errorUtil.toString(message));
      }
      gt(value, message) {
        return this.setLimit("min", value, false, errorUtil.toString(message));
      }
      lte(value, message) {
        return this.setLimit("max", value, true, errorUtil.toString(message));
      }
      lt(value, message) {
        return this.setLimit("max", value, false, errorUtil.toString(message));
      }
      setLimit(kind2, value, inclusive, message) {
        return new _ZodBigInt({
          ...this._def,
          checks: [
            ...this._def.checks,
            {
              kind: kind2,
              value,
              inclusive,
              message: errorUtil.toString(message)
            }
          ]
        });
      }
      _addCheck(check) {
        return new _ZodBigInt({
          ...this._def,
          checks: [...this._def.checks, check]
        });
      }
      positive(message) {
        return this._addCheck({
          kind: "min",
          value: BigInt(0),
          inclusive: false,
          message: errorUtil.toString(message)
        });
      }
      negative(message) {
        return this._addCheck({
          kind: "max",
          value: BigInt(0),
          inclusive: false,
          message: errorUtil.toString(message)
        });
      }
      nonpositive(message) {
        return this._addCheck({
          kind: "max",
          value: BigInt(0),
          inclusive: true,
          message: errorUtil.toString(message)
        });
      }
      nonnegative(message) {
        return this._addCheck({
          kind: "min",
          value: BigInt(0),
          inclusive: true,
          message: errorUtil.toString(message)
        });
      }
      multipleOf(value, message) {
        return this._addCheck({
          kind: "multipleOf",
          value,
          message: errorUtil.toString(message)
        });
      }
      get minValue() {
        let min = null;
        for (const ch2 of this._def.checks) {
          if (ch2.kind === "min") {
            if (min === null || ch2.value > min)
              min = ch2.value;
          }
        }
        return min;
      }
      get maxValue() {
        let max = null;
        for (const ch2 of this._def.checks) {
          if (ch2.kind === "max") {
            if (max === null || ch2.value < max)
              max = ch2.value;
          }
        }
        return max;
      }
    };
    ZodBigInt.create = (params) => {
      var _a5;
      return new ZodBigInt({
        checks: [],
        typeName: ZodFirstPartyTypeKind.ZodBigInt,
        coerce: (_a5 = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a5 !== void 0 ? _a5 : false,
        ...processCreateParams(params)
      });
    };
    ZodBoolean = class extends ZodType {
      static {
        __name(this, "ZodBoolean");
      }
      static {
        __name2(this, "ZodBoolean");
      }
      _parse(input) {
        if (this._def.coerce) {
          input.data = Boolean(input.data);
        }
        const parsedType = this._getType(input);
        if (parsedType !== ZodParsedType.boolean) {
          const ctx = this._getOrReturnCtx(input);
          addIssueToContext(ctx, {
            code: ZodIssueCode.invalid_type,
            expected: ZodParsedType.boolean,
            received: ctx.parsedType
          });
          return INVALID;
        }
        return OK(input.data);
      }
    };
    ZodBoolean.create = (params) => {
      return new ZodBoolean({
        typeName: ZodFirstPartyTypeKind.ZodBoolean,
        coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,
        ...processCreateParams(params)
      });
    };
    ZodDate = class _ZodDate extends ZodType {
      static {
        __name(this, "_ZodDate");
      }
      static {
        __name2(this, "ZodDate");
      }
      _parse(input) {
        if (this._def.coerce) {
          input.data = new Date(input.data);
        }
        const parsedType = this._getType(input);
        if (parsedType !== ZodParsedType.date) {
          const ctx2 = this._getOrReturnCtx(input);
          addIssueToContext(ctx2, {
            code: ZodIssueCode.invalid_type,
            expected: ZodParsedType.date,
            received: ctx2.parsedType
          });
          return INVALID;
        }
        if (isNaN(input.data.getTime())) {
          const ctx2 = this._getOrReturnCtx(input);
          addIssueToContext(ctx2, {
            code: ZodIssueCode.invalid_date
          });
          return INVALID;
        }
        const status2 = new ParseStatus();
        let ctx = void 0;
        for (const check of this._def.checks) {
          if (check.kind === "min") {
            if (input.data.getTime() < check.value) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext(ctx, {
                code: ZodIssueCode.too_small,
                message: check.message,
                inclusive: true,
                exact: false,
                minimum: check.value,
                type: "date"
              });
              status2.dirty();
            }
          } else if (check.kind === "max") {
            if (input.data.getTime() > check.value) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext(ctx, {
                code: ZodIssueCode.too_big,
                message: check.message,
                inclusive: true,
                exact: false,
                maximum: check.value,
                type: "date"
              });
              status2.dirty();
            }
          } else {
            util.assertNever(check);
          }
        }
        return {
          status: status2.value,
          value: new Date(input.data.getTime())
        };
      }
      _addCheck(check) {
        return new _ZodDate({
          ...this._def,
          checks: [...this._def.checks, check]
        });
      }
      min(minDate, message) {
        return this._addCheck({
          kind: "min",
          value: minDate.getTime(),
          message: errorUtil.toString(message)
        });
      }
      max(maxDate, message) {
        return this._addCheck({
          kind: "max",
          value: maxDate.getTime(),
          message: errorUtil.toString(message)
        });
      }
      get minDate() {
        let min = null;
        for (const ch2 of this._def.checks) {
          if (ch2.kind === "min") {
            if (min === null || ch2.value > min)
              min = ch2.value;
          }
        }
        return min != null ? new Date(min) : null;
      }
      get maxDate() {
        let max = null;
        for (const ch2 of this._def.checks) {
          if (ch2.kind === "max") {
            if (max === null || ch2.value < max)
              max = ch2.value;
          }
        }
        return max != null ? new Date(max) : null;
      }
    };
    ZodDate.create = (params) => {
      return new ZodDate({
        checks: [],
        coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,
        typeName: ZodFirstPartyTypeKind.ZodDate,
        ...processCreateParams(params)
      });
    };
    ZodSymbol = class extends ZodType {
      static {
        __name(this, "ZodSymbol");
      }
      static {
        __name2(this, "ZodSymbol");
      }
      _parse(input) {
        const parsedType = this._getType(input);
        if (parsedType !== ZodParsedType.symbol) {
          const ctx = this._getOrReturnCtx(input);
          addIssueToContext(ctx, {
            code: ZodIssueCode.invalid_type,
            expected: ZodParsedType.symbol,
            received: ctx.parsedType
          });
          return INVALID;
        }
        return OK(input.data);
      }
    };
    ZodSymbol.create = (params) => {
      return new ZodSymbol({
        typeName: ZodFirstPartyTypeKind.ZodSymbol,
        ...processCreateParams(params)
      });
    };
    ZodUndefined = class extends ZodType {
      static {
        __name(this, "ZodUndefined");
      }
      static {
        __name2(this, "ZodUndefined");
      }
      _parse(input) {
        const parsedType = this._getType(input);
        if (parsedType !== ZodParsedType.undefined) {
          const ctx = this._getOrReturnCtx(input);
          addIssueToContext(ctx, {
            code: ZodIssueCode.invalid_type,
            expected: ZodParsedType.undefined,
            received: ctx.parsedType
          });
          return INVALID;
        }
        return OK(input.data);
      }
    };
    ZodUndefined.create = (params) => {
      return new ZodUndefined({
        typeName: ZodFirstPartyTypeKind.ZodUndefined,
        ...processCreateParams(params)
      });
    };
    ZodNull = class extends ZodType {
      static {
        __name(this, "ZodNull");
      }
      static {
        __name2(this, "ZodNull");
      }
      _parse(input) {
        const parsedType = this._getType(input);
        if (parsedType !== ZodParsedType.null) {
          const ctx = this._getOrReturnCtx(input);
          addIssueToContext(ctx, {
            code: ZodIssueCode.invalid_type,
            expected: ZodParsedType.null,
            received: ctx.parsedType
          });
          return INVALID;
        }
        return OK(input.data);
      }
    };
    ZodNull.create = (params) => {
      return new ZodNull({
        typeName: ZodFirstPartyTypeKind.ZodNull,
        ...processCreateParams(params)
      });
    };
    ZodAny = class extends ZodType {
      static {
        __name(this, "ZodAny");
      }
      static {
        __name2(this, "ZodAny");
      }
      constructor() {
        super(...arguments);
        this._any = true;
      }
      _parse(input) {
        return OK(input.data);
      }
    };
    ZodAny.create = (params) => {
      return new ZodAny({
        typeName: ZodFirstPartyTypeKind.ZodAny,
        ...processCreateParams(params)
      });
    };
    ZodUnknown = class extends ZodType {
      static {
        __name(this, "ZodUnknown");
      }
      static {
        __name2(this, "ZodUnknown");
      }
      constructor() {
        super(...arguments);
        this._unknown = true;
      }
      _parse(input) {
        return OK(input.data);
      }
    };
    ZodUnknown.create = (params) => {
      return new ZodUnknown({
        typeName: ZodFirstPartyTypeKind.ZodUnknown,
        ...processCreateParams(params)
      });
    };
    ZodNever = class extends ZodType {
      static {
        __name(this, "ZodNever");
      }
      static {
        __name2(this, "ZodNever");
      }
      _parse(input) {
        const ctx = this._getOrReturnCtx(input);
        addIssueToContext(ctx, {
          code: ZodIssueCode.invalid_type,
          expected: ZodParsedType.never,
          received: ctx.parsedType
        });
        return INVALID;
      }
    };
    ZodNever.create = (params) => {
      return new ZodNever({
        typeName: ZodFirstPartyTypeKind.ZodNever,
        ...processCreateParams(params)
      });
    };
    ZodVoid = class extends ZodType {
      static {
        __name(this, "ZodVoid");
      }
      static {
        __name2(this, "ZodVoid");
      }
      _parse(input) {
        const parsedType = this._getType(input);
        if (parsedType !== ZodParsedType.undefined) {
          const ctx = this._getOrReturnCtx(input);
          addIssueToContext(ctx, {
            code: ZodIssueCode.invalid_type,
            expected: ZodParsedType.void,
            received: ctx.parsedType
          });
          return INVALID;
        }
        return OK(input.data);
      }
    };
    ZodVoid.create = (params) => {
      return new ZodVoid({
        typeName: ZodFirstPartyTypeKind.ZodVoid,
        ...processCreateParams(params)
      });
    };
    ZodArray = class _ZodArray extends ZodType {
      static {
        __name(this, "_ZodArray");
      }
      static {
        __name2(this, "ZodArray");
      }
      _parse(input) {
        const { ctx, status: status2 } = this._processInputParams(input);
        const def = this._def;
        if (ctx.parsedType !== ZodParsedType.array) {
          addIssueToContext(ctx, {
            code: ZodIssueCode.invalid_type,
            expected: ZodParsedType.array,
            received: ctx.parsedType
          });
          return INVALID;
        }
        if (def.exactLength !== null) {
          const tooBig = ctx.data.length > def.exactLength.value;
          const tooSmall = ctx.data.length < def.exactLength.value;
          if (tooBig || tooSmall) {
            addIssueToContext(ctx, {
              code: tooBig ? ZodIssueCode.too_big : ZodIssueCode.too_small,
              minimum: tooSmall ? def.exactLength.value : void 0,
              maximum: tooBig ? def.exactLength.value : void 0,
              type: "array",
              inclusive: true,
              exact: true,
              message: def.exactLength.message
            });
            status2.dirty();
          }
        }
        if (def.minLength !== null) {
          if (ctx.data.length < def.minLength.value) {
            addIssueToContext(ctx, {
              code: ZodIssueCode.too_small,
              minimum: def.minLength.value,
              type: "array",
              inclusive: true,
              exact: false,
              message: def.minLength.message
            });
            status2.dirty();
          }
        }
        if (def.maxLength !== null) {
          if (ctx.data.length > def.maxLength.value) {
            addIssueToContext(ctx, {
              code: ZodIssueCode.too_big,
              maximum: def.maxLength.value,
              type: "array",
              inclusive: true,
              exact: false,
              message: def.maxLength.message
            });
            status2.dirty();
          }
        }
        if (ctx.common.async) {
          return Promise.all([...ctx.data].map((item, i7) => {
            return def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, i7));
          })).then((result2) => {
            return ParseStatus.mergeArray(status2, result2);
          });
        }
        const result = [...ctx.data].map((item, i7) => {
          return def.type._parseSync(new ParseInputLazyPath(ctx, item, ctx.path, i7));
        });
        return ParseStatus.mergeArray(status2, result);
      }
      get element() {
        return this._def.type;
      }
      min(minLength, message) {
        return new _ZodArray({
          ...this._def,
          minLength: { value: minLength, message: errorUtil.toString(message) }
        });
      }
      max(maxLength, message) {
        return new _ZodArray({
          ...this._def,
          maxLength: { value: maxLength, message: errorUtil.toString(message) }
        });
      }
      length(len, message) {
        return new _ZodArray({
          ...this._def,
          exactLength: { value: len, message: errorUtil.toString(message) }
        });
      }
      nonempty(message) {
        return this.min(1, message);
      }
    };
    ZodArray.create = (schema, params) => {
      return new ZodArray({
        type: schema,
        minLength: null,
        maxLength: null,
        exactLength: null,
        typeName: ZodFirstPartyTypeKind.ZodArray,
        ...processCreateParams(params)
      });
    };
    __name(deepPartialify, "deepPartialify");
    __name2(deepPartialify, "deepPartialify");
    ZodObject = class _ZodObject extends ZodType {
      static {
        __name(this, "_ZodObject");
      }
      static {
        __name2(this, "ZodObject");
      }
      constructor() {
        super(...arguments);
        this._cached = null;
        this.nonstrict = this.passthrough;
        this.augment = this.extend;
      }
      _getCached() {
        if (this._cached !== null)
          return this._cached;
        const shape = this._def.shape();
        const keys = util.objectKeys(shape);
        return this._cached = { shape, keys };
      }
      _parse(input) {
        const parsedType = this._getType(input);
        if (parsedType !== ZodParsedType.object) {
          const ctx2 = this._getOrReturnCtx(input);
          addIssueToContext(ctx2, {
            code: ZodIssueCode.invalid_type,
            expected: ZodParsedType.object,
            received: ctx2.parsedType
          });
          return INVALID;
        }
        const { status: status2, ctx } = this._processInputParams(input);
        const { shape, keys: shapeKeys } = this._getCached();
        const extraKeys = [];
        if (!(this._def.catchall instanceof ZodNever && this._def.unknownKeys === "strip")) {
          for (const key in ctx.data) {
            if (!shapeKeys.includes(key)) {
              extraKeys.push(key);
            }
          }
        }
        const pairs = [];
        for (const key of shapeKeys) {
          const keyValidator = shape[key];
          const value = ctx.data[key];
          pairs.push({
            key: { status: "valid", value: key },
            value: keyValidator._parse(new ParseInputLazyPath(ctx, value, ctx.path, key)),
            alwaysSet: key in ctx.data
          });
        }
        if (this._def.catchall instanceof ZodNever) {
          const unknownKeys = this._def.unknownKeys;
          if (unknownKeys === "passthrough") {
            for (const key of extraKeys) {
              pairs.push({
                key: { status: "valid", value: key },
                value: { status: "valid", value: ctx.data[key] }
              });
            }
          } else if (unknownKeys === "strict") {
            if (extraKeys.length > 0) {
              addIssueToContext(ctx, {
                code: ZodIssueCode.unrecognized_keys,
                keys: extraKeys
              });
              status2.dirty();
            }
          } else if (unknownKeys === "strip") ;
          else {
            throw new Error(`Internal ZodObject error: invalid unknownKeys value.`);
          }
        } else {
          const catchall = this._def.catchall;
          for (const key of extraKeys) {
            const value = ctx.data[key];
            pairs.push({
              key: { status: "valid", value: key },
              value: catchall._parse(
                new ParseInputLazyPath(ctx, value, ctx.path, key)
                //, ctx.child(key), value, getParsedType(value)
              ),
              alwaysSet: key in ctx.data
            });
          }
        }
        if (ctx.common.async) {
          return Promise.resolve().then(async () => {
            const syncPairs = [];
            for (const pair of pairs) {
              const key = await pair.key;
              syncPairs.push({
                key,
                value: await pair.value,
                alwaysSet: pair.alwaysSet
              });
            }
            return syncPairs;
          }).then((syncPairs) => {
            return ParseStatus.mergeObjectSync(status2, syncPairs);
          });
        } else {
          return ParseStatus.mergeObjectSync(status2, pairs);
        }
      }
      get shape() {
        return this._def.shape();
      }
      strict(message) {
        errorUtil.errToObj;
        return new _ZodObject({
          ...this._def,
          unknownKeys: "strict",
          ...message !== void 0 ? {
            errorMap: /* @__PURE__ */ __name2((issue, ctx) => {
              var _a5, _b2, _c3, _d2;
              const defaultError = (_c3 = (_b2 = (_a5 = this._def).errorMap) === null || _b2 === void 0 ? void 0 : _b2.call(_a5, issue, ctx).message) !== null && _c3 !== void 0 ? _c3 : ctx.defaultError;
              if (issue.code === "unrecognized_keys")
                return {
                  message: (_d2 = errorUtil.errToObj(message).message) !== null && _d2 !== void 0 ? _d2 : defaultError
                };
              return {
                message: defaultError
              };
            }, "errorMap")
          } : {}
        });
      }
      strip() {
        return new _ZodObject({
          ...this._def,
          unknownKeys: "strip"
        });
      }
      passthrough() {
        return new _ZodObject({
          ...this._def,
          unknownKeys: "passthrough"
        });
      }
      // const AugmentFactory =
      //   <Def extends ZodObjectDef>(def: Def) =>
      //   <Augmentation extends ZodRawShape>(
      //     augmentation: Augmentation
      //   ): ZodObject<
      //     extendShape<ReturnType<Def["shape"]>, Augmentation>,
      //     Def["unknownKeys"],
      //     Def["catchall"]
      //   > => {
      //     return new ZodObject({
      //       ...def,
      //       shape: () => ({
      //         ...def.shape(),
      //         ...augmentation,
      //       }),
      //     }) as any;
      //   };
      extend(augmentation) {
        return new _ZodObject({
          ...this._def,
          shape: /* @__PURE__ */ __name2(() => ({
            ...this._def.shape(),
            ...augmentation
          }), "shape")
        });
      }
      /**
       * Prior to zod@1.0.12 there was a bug in the
       * inferred type of merged objects. Please
       * upgrade if you are experiencing issues.
       */
      merge(merging) {
        const merged = new _ZodObject({
          unknownKeys: merging._def.unknownKeys,
          catchall: merging._def.catchall,
          shape: /* @__PURE__ */ __name2(() => ({
            ...this._def.shape(),
            ...merging._def.shape()
          }), "shape"),
          typeName: ZodFirstPartyTypeKind.ZodObject
        });
        return merged;
      }
      // merge<
      //   Incoming extends AnyZodObject,
      //   Augmentation extends Incoming["shape"],
      //   NewOutput extends {
      //     [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation
      //       ? Augmentation[k]["_output"]
      //       : k extends keyof Output
      //       ? Output[k]
      //       : never;
      //   },
      //   NewInput extends {
      //     [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation
      //       ? Augmentation[k]["_input"]
      //       : k extends keyof Input
      //       ? Input[k]
      //       : never;
      //   }
      // >(
      //   merging: Incoming
      // ): ZodObject<
      //   extendShape<T, ReturnType<Incoming["_def"]["shape"]>>,
      //   Incoming["_def"]["unknownKeys"],
      //   Incoming["_def"]["catchall"],
      //   NewOutput,
      //   NewInput
      // > {
      //   const merged: any = new ZodObject({
      //     unknownKeys: merging._def.unknownKeys,
      //     catchall: merging._def.catchall,
      //     shape: () =>
      //       objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
      //     typeName: ZodFirstPartyTypeKind.ZodObject,
      //   }) as any;
      //   return merged;
      // }
      setKey(key, schema) {
        return this.augment({ [key]: schema });
      }
      // merge<Incoming extends AnyZodObject>(
      //   merging: Incoming
      // ): //ZodObject<T & Incoming["_shape"], UnknownKeys, Catchall> = (merging) => {
      // ZodObject<
      //   extendShape<T, ReturnType<Incoming["_def"]["shape"]>>,
      //   Incoming["_def"]["unknownKeys"],
      //   Incoming["_def"]["catchall"]
      // > {
      //   // const mergedShape = objectUtil.mergeShapes(
      //   //   this._def.shape(),
      //   //   merging._def.shape()
      //   // );
      //   const merged: any = new ZodObject({
      //     unknownKeys: merging._def.unknownKeys,
      //     catchall: merging._def.catchall,
      //     shape: () =>
      //       objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
      //     typeName: ZodFirstPartyTypeKind.ZodObject,
      //   }) as any;
      //   return merged;
      // }
      catchall(index) {
        return new _ZodObject({
          ...this._def,
          catchall: index
        });
      }
      pick(mask) {
        const shape = {};
        util.objectKeys(mask).forEach((key) => {
          if (mask[key] && this.shape[key]) {
            shape[key] = this.shape[key];
          }
        });
        return new _ZodObject({
          ...this._def,
          shape: /* @__PURE__ */ __name2(() => shape, "shape")
        });
      }
      omit(mask) {
        const shape = {};
        util.objectKeys(this.shape).forEach((key) => {
          if (!mask[key]) {
            shape[key] = this.shape[key];
          }
        });
        return new _ZodObject({
          ...this._def,
          shape: /* @__PURE__ */ __name2(() => shape, "shape")
        });
      }
      /**
       * @deprecated
       */
      deepPartial() {
        return deepPartialify(this);
      }
      partial(mask) {
        const newShape = {};
        util.objectKeys(this.shape).forEach((key) => {
          const fieldSchema = this.shape[key];
          if (mask && !mask[key]) {
            newShape[key] = fieldSchema;
          } else {
            newShape[key] = fieldSchema.optional();
          }
        });
        return new _ZodObject({
          ...this._def,
          shape: /* @__PURE__ */ __name2(() => newShape, "shape")
        });
      }
      required(mask) {
        const newShape = {};
        util.objectKeys(this.shape).forEach((key) => {
          if (mask && !mask[key]) {
            newShape[key] = this.shape[key];
          } else {
            const fieldSchema = this.shape[key];
            let newField = fieldSchema;
            while (newField instanceof ZodOptional) {
              newField = newField._def.innerType;
            }
            newShape[key] = newField;
          }
        });
        return new _ZodObject({
          ...this._def,
          shape: /* @__PURE__ */ __name2(() => newShape, "shape")
        });
      }
      keyof() {
        return createZodEnum(util.objectKeys(this.shape));
      }
    };
    ZodObject.create = (shape, params) => {
      return new ZodObject({
        shape: /* @__PURE__ */ __name2(() => shape, "shape"),
        unknownKeys: "strip",
        catchall: ZodNever.create(),
        typeName: ZodFirstPartyTypeKind.ZodObject,
        ...processCreateParams(params)
      });
    };
    ZodObject.strictCreate = (shape, params) => {
      return new ZodObject({
        shape: /* @__PURE__ */ __name2(() => shape, "shape"),
        unknownKeys: "strict",
        catchall: ZodNever.create(),
        typeName: ZodFirstPartyTypeKind.ZodObject,
        ...processCreateParams(params)
      });
    };
    ZodObject.lazycreate = (shape, params) => {
      return new ZodObject({
        shape,
        unknownKeys: "strip",
        catchall: ZodNever.create(),
        typeName: ZodFirstPartyTypeKind.ZodObject,
        ...processCreateParams(params)
      });
    };
    ZodUnion = class extends ZodType {
      static {
        __name(this, "ZodUnion");
      }
      static {
        __name2(this, "ZodUnion");
      }
      _parse(input) {
        const { ctx } = this._processInputParams(input);
        const options = this._def.options;
        function handleResults(results) {
          for (const result of results) {
            if (result.result.status === "valid") {
              return result.result;
            }
          }
          for (const result of results) {
            if (result.result.status === "dirty") {
              ctx.common.issues.push(...result.ctx.common.issues);
              return result.result;
            }
          }
          const unionErrors = results.map((result) => new ZodError(result.ctx.common.issues));
          addIssueToContext(ctx, {
            code: ZodIssueCode.invalid_union,
            unionErrors
          });
          return INVALID;
        }
        __name(handleResults, "handleResults");
        __name2(handleResults, "handleResults");
        if (ctx.common.async) {
          return Promise.all(options.map(async (option) => {
            const childCtx = {
              ...ctx,
              common: {
                ...ctx.common,
                issues: []
              },
              parent: null
            };
            return {
              result: await option._parseAsync({
                data: ctx.data,
                path: ctx.path,
                parent: childCtx
              }),
              ctx: childCtx
            };
          })).then(handleResults);
        } else {
          let dirty = void 0;
          const issues = [];
          for (const option of options) {
            const childCtx = {
              ...ctx,
              common: {
                ...ctx.common,
                issues: []
              },
              parent: null
            };
            const result = option._parseSync({
              data: ctx.data,
              path: ctx.path,
              parent: childCtx
            });
            if (result.status === "valid") {
              return result;
            } else if (result.status === "dirty" && !dirty) {
              dirty = { result, ctx: childCtx };
            }
            if (childCtx.common.issues.length) {
              issues.push(childCtx.common.issues);
            }
          }
          if (dirty) {
            ctx.common.issues.push(...dirty.ctx.common.issues);
            return dirty.result;
          }
          const unionErrors = issues.map((issues2) => new ZodError(issues2));
          addIssueToContext(ctx, {
            code: ZodIssueCode.invalid_union,
            unionErrors
          });
          return INVALID;
        }
      }
      get options() {
        return this._def.options;
      }
    };
    ZodUnion.create = (types13, params) => {
      return new ZodUnion({
        options: types13,
        typeName: ZodFirstPartyTypeKind.ZodUnion,
        ...processCreateParams(params)
      });
    };
    getDiscriminator = /* @__PURE__ */ __name2((type) => {
      if (type instanceof ZodLazy) {
        return getDiscriminator(type.schema);
      } else if (type instanceof ZodEffects) {
        return getDiscriminator(type.innerType());
      } else if (type instanceof ZodLiteral) {
        return [type.value];
      } else if (type instanceof ZodEnum) {
        return type.options;
      } else if (type instanceof ZodNativeEnum) {
        return Object.keys(type.enum);
      } else if (type instanceof ZodDefault) {
        return getDiscriminator(type._def.innerType);
      } else if (type instanceof ZodUndefined) {
        return [void 0];
      } else if (type instanceof ZodNull) {
        return [null];
      } else {
        return null;
      }
    }, "getDiscriminator");
    ZodDiscriminatedUnion = class _ZodDiscriminatedUnion extends ZodType {
      static {
        __name(this, "_ZodDiscriminatedUnion");
      }
      static {
        __name2(this, "ZodDiscriminatedUnion");
      }
      _parse(input) {
        const { ctx } = this._processInputParams(input);
        if (ctx.parsedType !== ZodParsedType.object) {
          addIssueToContext(ctx, {
            code: ZodIssueCode.invalid_type,
            expected: ZodParsedType.object,
            received: ctx.parsedType
          });
          return INVALID;
        }
        const discriminator = this.discriminator;
        const discriminatorValue = ctx.data[discriminator];
        const option = this.optionsMap.get(discriminatorValue);
        if (!option) {
          addIssueToContext(ctx, {
            code: ZodIssueCode.invalid_union_discriminator,
            options: Array.from(this.optionsMap.keys()),
            path: [discriminator]
          });
          return INVALID;
        }
        if (ctx.common.async) {
          return option._parseAsync({
            data: ctx.data,
            path: ctx.path,
            parent: ctx
          });
        } else {
          return option._parseSync({
            data: ctx.data,
            path: ctx.path,
            parent: ctx
          });
        }
      }
      get discriminator() {
        return this._def.discriminator;
      }
      get options() {
        return this._def.options;
      }
      get optionsMap() {
        return this._def.optionsMap;
      }
      /**
       * The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor.
       * However, it only allows a union of objects, all of which need to share a discriminator property. This property must
       * have a different value for each object in the union.
       * @param discriminator the name of the discriminator property
       * @param types an array of object schemas
       * @param params
       */
      static create(discriminator, options, params) {
        const optionsMap = /* @__PURE__ */ new Map();
        for (const type of options) {
          const discriminatorValues = getDiscriminator(type.shape[discriminator]);
          if (!discriminatorValues) {
            throw new Error(`A discriminator value for key \`${discriminator}\` could not be extracted from all schema options`);
          }
          for (const value of discriminatorValues) {
            if (optionsMap.has(value)) {
              throw new Error(`Discriminator property ${String(discriminator)} has duplicate value ${String(value)}`);
            }
            optionsMap.set(value, type);
          }
        }
        return new _ZodDiscriminatedUnion({
          typeName: ZodFirstPartyTypeKind.ZodDiscriminatedUnion,
          discriminator,
          options,
          optionsMap,
          ...processCreateParams(params)
        });
      }
    };
    __name(mergeValues, "mergeValues");
    __name2(mergeValues, "mergeValues");
    ZodIntersection = class extends ZodType {
      static {
        __name(this, "ZodIntersection");
      }
      static {
        __name2(this, "ZodIntersection");
      }
      _parse(input) {
        const { status: status2, ctx } = this._processInputParams(input);
        const handleParsed = /* @__PURE__ */ __name2((parsedLeft, parsedRight) => {
          if (isAborted(parsedLeft) || isAborted(parsedRight)) {
            return INVALID;
          }
          const merged = mergeValues(parsedLeft.value, parsedRight.value);
          if (!merged.valid) {
            addIssueToContext(ctx, {
              code: ZodIssueCode.invalid_intersection_types
            });
            return INVALID;
          }
          if (isDirty(parsedLeft) || isDirty(parsedRight)) {
            status2.dirty();
          }
          return { status: status2.value, value: merged.data };
        }, "handleParsed");
        if (ctx.common.async) {
          return Promise.all([
            this._def.left._parseAsync({
              data: ctx.data,
              path: ctx.path,
              parent: ctx
            }),
            this._def.right._parseAsync({
              data: ctx.data,
              path: ctx.path,
              parent: ctx
            })
          ]).then(([left2, right2]) => handleParsed(left2, right2));
        } else {
          return handleParsed(this._def.left._parseSync({
            data: ctx.data,
            path: ctx.path,
            parent: ctx
          }), this._def.right._parseSync({
            data: ctx.data,
            path: ctx.path,
            parent: ctx
          }));
        }
      }
    };
    ZodIntersection.create = (left2, right2, params) => {
      return new ZodIntersection({
        left: left2,
        right: right2,
        typeName: ZodFirstPartyTypeKind.ZodIntersection,
        ...processCreateParams(params)
      });
    };
    ZodTuple = class _ZodTuple extends ZodType {
      static {
        __name(this, "_ZodTuple");
      }
      static {
        __name2(this, "ZodTuple");
      }
      _parse(input) {
        const { status: status2, ctx } = this._processInputParams(input);
        if (ctx.parsedType !== ZodParsedType.array) {
          addIssueToContext(ctx, {
            code: ZodIssueCode.invalid_type,
            expected: ZodParsedType.array,
            received: ctx.parsedType
          });
          return INVALID;
        }
        if (ctx.data.length < this._def.items.length) {
          addIssueToContext(ctx, {
            code: ZodIssueCode.too_small,
            minimum: this._def.items.length,
            inclusive: true,
            exact: false,
            type: "array"
          });
          return INVALID;
        }
        const rest = this._def.rest;
        if (!rest && ctx.data.length > this._def.items.length) {
          addIssueToContext(ctx, {
            code: ZodIssueCode.too_big,
            maximum: this._def.items.length,
            inclusive: true,
            exact: false,
            type: "array"
          });
          status2.dirty();
        }
        const items = [...ctx.data].map((item, itemIndex) => {
          const schema = this._def.items[itemIndex] || this._def.rest;
          if (!schema)
            return null;
          return schema._parse(new ParseInputLazyPath(ctx, item, ctx.path, itemIndex));
        }).filter((x7) => !!x7);
        if (ctx.common.async) {
          return Promise.all(items).then((results) => {
            return ParseStatus.mergeArray(status2, results);
          });
        } else {
          return ParseStatus.mergeArray(status2, items);
        }
      }
      get items() {
        return this._def.items;
      }
      rest(rest) {
        return new _ZodTuple({
          ...this._def,
          rest
        });
      }
    };
    ZodTuple.create = (schemas, params) => {
      if (!Array.isArray(schemas)) {
        throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
      }
      return new ZodTuple({
        items: schemas,
        typeName: ZodFirstPartyTypeKind.ZodTuple,
        rest: null,
        ...processCreateParams(params)
      });
    };
    ZodRecord = class _ZodRecord extends ZodType {
      static {
        __name(this, "_ZodRecord");
      }
      static {
        __name2(this, "ZodRecord");
      }
      get keySchema() {
        return this._def.keyType;
      }
      get valueSchema() {
        return this._def.valueType;
      }
      _parse(input) {
        const { status: status2, ctx } = this._processInputParams(input);
        if (ctx.parsedType !== ZodParsedType.object) {
          addIssueToContext(ctx, {
            code: ZodIssueCode.invalid_type,
            expected: ZodParsedType.object,
            received: ctx.parsedType
          });
          return INVALID;
        }
        const pairs = [];
        const keyType = this._def.keyType;
        const valueType = this._def.valueType;
        for (const key in ctx.data) {
          pairs.push({
            key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, key)),
            value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key))
          });
        }
        if (ctx.common.async) {
          return ParseStatus.mergeObjectAsync(status2, pairs);
        } else {
          return ParseStatus.mergeObjectSync(status2, pairs);
        }
      }
      get element() {
        return this._def.valueType;
      }
      static create(first, second, third) {
        if (second instanceof ZodType) {
          return new _ZodRecord({
            keyType: first,
            valueType: second,
            typeName: ZodFirstPartyTypeKind.ZodRecord,
            ...processCreateParams(third)
          });
        }
        return new _ZodRecord({
          keyType: ZodString.create(),
          valueType: first,
          typeName: ZodFirstPartyTypeKind.ZodRecord,
          ...processCreateParams(second)
        });
      }
    };
    ZodMap = class extends ZodType {
      static {
        __name(this, "ZodMap");
      }
      static {
        __name2(this, "ZodMap");
      }
      get keySchema() {
        return this._def.keyType;
      }
      get valueSchema() {
        return this._def.valueType;
      }
      _parse(input) {
        const { status: status2, ctx } = this._processInputParams(input);
        if (ctx.parsedType !== ZodParsedType.map) {
          addIssueToContext(ctx, {
            code: ZodIssueCode.invalid_type,
            expected: ZodParsedType.map,
            received: ctx.parsedType
          });
          return INVALID;
        }
        const keyType = this._def.keyType;
        const valueType = this._def.valueType;
        const pairs = [...ctx.data.entries()].map(([key, value], index) => {
          return {
            key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, [index, "key"])),
            value: valueType._parse(new ParseInputLazyPath(ctx, value, ctx.path, [index, "value"]))
          };
        });
        if (ctx.common.async) {
          const finalMap = /* @__PURE__ */ new Map();
          return Promise.resolve().then(async () => {
            for (const pair of pairs) {
              const key = await pair.key;
              const value = await pair.value;
              if (key.status === "aborted" || value.status === "aborted") {
                return INVALID;
              }
              if (key.status === "dirty" || value.status === "dirty") {
                status2.dirty();
              }
              finalMap.set(key.value, value.value);
            }
            return { status: status2.value, value: finalMap };
          });
        } else {
          const finalMap = /* @__PURE__ */ new Map();
          for (const pair of pairs) {
            const key = pair.key;
            const value = pair.value;
            if (key.status === "aborted" || value.status === "aborted") {
              return INVALID;
            }
            if (key.status === "dirty" || value.status === "dirty") {
              status2.dirty();
            }
            finalMap.set(key.value, value.value);
          }
          return { status: status2.value, value: finalMap };
        }
      }
    };
    ZodMap.create = (keyType, valueType, params) => {
      return new ZodMap({
        valueType,
        keyType,
        typeName: ZodFirstPartyTypeKind.ZodMap,
        ...processCreateParams(params)
      });
    };
    ZodSet = class _ZodSet extends ZodType {
      static {
        __name(this, "_ZodSet");
      }
      static {
        __name2(this, "ZodSet");
      }
      _parse(input) {
        const { status: status2, ctx } = this._processInputParams(input);
        if (ctx.parsedType !== ZodParsedType.set) {
          addIssueToContext(ctx, {
            code: ZodIssueCode.invalid_type,
            expected: ZodParsedType.set,
            received: ctx.parsedType
          });
          return INVALID;
        }
        const def = this._def;
        if (def.minSize !== null) {
          if (ctx.data.size < def.minSize.value) {
            addIssueToContext(ctx, {
              code: ZodIssueCode.too_small,
              minimum: def.minSize.value,
              type: "set",
              inclusive: true,
              exact: false,
              message: def.minSize.message
            });
            status2.dirty();
          }
        }
        if (def.maxSize !== null) {
          if (ctx.data.size > def.maxSize.value) {
            addIssueToContext(ctx, {
              code: ZodIssueCode.too_big,
              maximum: def.maxSize.value,
              type: "set",
              inclusive: true,
              exact: false,
              message: def.maxSize.message
            });
            status2.dirty();
          }
        }
        const valueType = this._def.valueType;
        function finalizeSet(elements2) {
          const parsedSet = /* @__PURE__ */ new Set();
          for (const element of elements2) {
            if (element.status === "aborted")
              return INVALID;
            if (element.status === "dirty")
              status2.dirty();
            parsedSet.add(element.value);
          }
          return { status: status2.value, value: parsedSet };
        }
        __name(finalizeSet, "finalizeSet");
        __name2(finalizeSet, "finalizeSet");
        const elements = [...ctx.data.values()].map((item, i7) => valueType._parse(new ParseInputLazyPath(ctx, item, ctx.path, i7)));
        if (ctx.common.async) {
          return Promise.all(elements).then((elements2) => finalizeSet(elements2));
        } else {
          return finalizeSet(elements);
        }
      }
      min(minSize, message) {
        return new _ZodSet({
          ...this._def,
          minSize: { value: minSize, message: errorUtil.toString(message) }
        });
      }
      max(maxSize, message) {
        return new _ZodSet({
          ...this._def,
          maxSize: { value: maxSize, message: errorUtil.toString(message) }
        });
      }
      size(size, message) {
        return this.min(size, message).max(size, message);
      }
      nonempty(message) {
        return this.min(1, message);
      }
    };
    ZodSet.create = (valueType, params) => {
      return new ZodSet({
        valueType,
        minSize: null,
        maxSize: null,
        typeName: ZodFirstPartyTypeKind.ZodSet,
        ...processCreateParams(params)
      });
    };
    ZodFunction = class _ZodFunction extends ZodType {
      static {
        __name(this, "_ZodFunction");
      }
      static {
        __name2(this, "ZodFunction");
      }
      constructor() {
        super(...arguments);
        this.validate = this.implement;
      }
      _parse(input) {
        const { ctx } = this._processInputParams(input);
        if (ctx.parsedType !== ZodParsedType.function) {
          addIssueToContext(ctx, {
            code: ZodIssueCode.invalid_type,
            expected: ZodParsedType.function,
            received: ctx.parsedType
          });
          return INVALID;
        }
        function makeArgsIssue(args, error2) {
          return makeIssue({
            data: args,
            path: ctx.path,
            errorMaps: [
              ctx.common.contextualErrorMap,
              ctx.schemaErrorMap,
              getErrorMap(),
              errorMap
            ].filter((x7) => !!x7),
            issueData: {
              code: ZodIssueCode.invalid_arguments,
              argumentsError: error2
            }
          });
        }
        __name(makeArgsIssue, "makeArgsIssue");
        __name2(makeArgsIssue, "makeArgsIssue");
        function makeReturnsIssue(returns, error2) {
          return makeIssue({
            data: returns,
            path: ctx.path,
            errorMaps: [
              ctx.common.contextualErrorMap,
              ctx.schemaErrorMap,
              getErrorMap(),
              errorMap
            ].filter((x7) => !!x7),
            issueData: {
              code: ZodIssueCode.invalid_return_type,
              returnTypeError: error2
            }
          });
        }
        __name(makeReturnsIssue, "makeReturnsIssue");
        __name2(makeReturnsIssue, "makeReturnsIssue");
        const params = { errorMap: ctx.common.contextualErrorMap };
        const fn2 = ctx.data;
        if (this._def.returns instanceof ZodPromise) {
          const me2 = this;
          return OK(async function(...args) {
            const error2 = new ZodError([]);
            const parsedArgs = await me2._def.args.parseAsync(args, params).catch((e22) => {
              error2.addIssue(makeArgsIssue(args, e22));
              throw error2;
            });
            const result = await Reflect.apply(fn2, this, parsedArgs);
            const parsedReturns = await me2._def.returns._def.type.parseAsync(result, params).catch((e22) => {
              error2.addIssue(makeReturnsIssue(result, e22));
              throw error2;
            });
            return parsedReturns;
          });
        } else {
          const me2 = this;
          return OK(function(...args) {
            const parsedArgs = me2._def.args.safeParse(args, params);
            if (!parsedArgs.success) {
              throw new ZodError([makeArgsIssue(args, parsedArgs.error)]);
            }
            const result = Reflect.apply(fn2, this, parsedArgs.data);
            const parsedReturns = me2._def.returns.safeParse(result, params);
            if (!parsedReturns.success) {
              throw new ZodError([makeReturnsIssue(result, parsedReturns.error)]);
            }
            return parsedReturns.data;
          });
        }
      }
      parameters() {
        return this._def.args;
      }
      returnType() {
        return this._def.returns;
      }
      args(...items) {
        return new _ZodFunction({
          ...this._def,
          args: ZodTuple.create(items).rest(ZodUnknown.create())
        });
      }
      returns(returnType) {
        return new _ZodFunction({
          ...this._def,
          returns: returnType
        });
      }
      implement(func) {
        const validatedFunc = this.parse(func);
        return validatedFunc;
      }
      strictImplement(func) {
        const validatedFunc = this.parse(func);
        return validatedFunc;
      }
      static create(args, returns, params) {
        return new _ZodFunction({
          args: args ? args : ZodTuple.create([]).rest(ZodUnknown.create()),
          returns: returns || ZodUnknown.create(),
          typeName: ZodFirstPartyTypeKind.ZodFunction,
          ...processCreateParams(params)
        });
      }
    };
    ZodLazy = class extends ZodType {
      static {
        __name(this, "ZodLazy");
      }
      static {
        __name2(this, "ZodLazy");
      }
      get schema() {
        return this._def.getter();
      }
      _parse(input) {
        const { ctx } = this._processInputParams(input);
        const lazySchema = this._def.getter();
        return lazySchema._parse({ data: ctx.data, path: ctx.path, parent: ctx });
      }
    };
    ZodLazy.create = (getter, params) => {
      return new ZodLazy({
        getter,
        typeName: ZodFirstPartyTypeKind.ZodLazy,
        ...processCreateParams(params)
      });
    };
    ZodLiteral = class extends ZodType {
      static {
        __name(this, "ZodLiteral");
      }
      static {
        __name2(this, "ZodLiteral");
      }
      _parse(input) {
        if (input.data !== this._def.value) {
          const ctx = this._getOrReturnCtx(input);
          addIssueToContext(ctx, {
            received: ctx.data,
            code: ZodIssueCode.invalid_literal,
            expected: this._def.value
          });
          return INVALID;
        }
        return { status: "valid", value: input.data };
      }
      get value() {
        return this._def.value;
      }
    };
    ZodLiteral.create = (value, params) => {
      return new ZodLiteral({
        value,
        typeName: ZodFirstPartyTypeKind.ZodLiteral,
        ...processCreateParams(params)
      });
    };
    __name(createZodEnum, "createZodEnum");
    __name2(createZodEnum, "createZodEnum");
    ZodEnum = class _ZodEnum extends ZodType {
      static {
        __name(this, "_ZodEnum");
      }
      static {
        __name2(this, "ZodEnum");
      }
      _parse(input) {
        if (typeof input.data !== "string") {
          const ctx = this._getOrReturnCtx(input);
          const expectedValues = this._def.values;
          addIssueToContext(ctx, {
            expected: util.joinValues(expectedValues),
            received: ctx.parsedType,
            code: ZodIssueCode.invalid_type
          });
          return INVALID;
        }
        if (this._def.values.indexOf(input.data) === -1) {
          const ctx = this._getOrReturnCtx(input);
          const expectedValues = this._def.values;
          addIssueToContext(ctx, {
            received: ctx.data,
            code: ZodIssueCode.invalid_enum_value,
            options: expectedValues
          });
          return INVALID;
        }
        return OK(input.data);
      }
      get options() {
        return this._def.values;
      }
      get enum() {
        const enumValues = {};
        for (const val2 of this._def.values) {
          enumValues[val2] = val2;
        }
        return enumValues;
      }
      get Values() {
        const enumValues = {};
        for (const val2 of this._def.values) {
          enumValues[val2] = val2;
        }
        return enumValues;
      }
      get Enum() {
        const enumValues = {};
        for (const val2 of this._def.values) {
          enumValues[val2] = val2;
        }
        return enumValues;
      }
      extract(values) {
        return _ZodEnum.create(values);
      }
      exclude(values) {
        return _ZodEnum.create(this.options.filter((opt) => !values.includes(opt)));
      }
    };
    ZodEnum.create = createZodEnum;
    ZodNativeEnum = class extends ZodType {
      static {
        __name(this, "ZodNativeEnum");
      }
      static {
        __name2(this, "ZodNativeEnum");
      }
      _parse(input) {
        const nativeEnumValues = util.getValidEnumValues(this._def.values);
        const ctx = this._getOrReturnCtx(input);
        if (ctx.parsedType !== ZodParsedType.string && ctx.parsedType !== ZodParsedType.number) {
          const expectedValues = util.objectValues(nativeEnumValues);
          addIssueToContext(ctx, {
            expected: util.joinValues(expectedValues),
            received: ctx.parsedType,
            code: ZodIssueCode.invalid_type
          });
          return INVALID;
        }
        if (nativeEnumValues.indexOf(input.data) === -1) {
          const expectedValues = util.objectValues(nativeEnumValues);
          addIssueToContext(ctx, {
            received: ctx.data,
            code: ZodIssueCode.invalid_enum_value,
            options: expectedValues
          });
          return INVALID;
        }
        return OK(input.data);
      }
      get enum() {
        return this._def.values;
      }
    };
    ZodNativeEnum.create = (values, params) => {
      return new ZodNativeEnum({
        values,
        typeName: ZodFirstPartyTypeKind.ZodNativeEnum,
        ...processCreateParams(params)
      });
    };
    ZodPromise = class extends ZodType {
      static {
        __name(this, "ZodPromise");
      }
      static {
        __name2(this, "ZodPromise");
      }
      unwrap() {
        return this._def.type;
      }
      _parse(input) {
        const { ctx } = this._processInputParams(input);
        if (ctx.parsedType !== ZodParsedType.promise && ctx.common.async === false) {
          addIssueToContext(ctx, {
            code: ZodIssueCode.invalid_type,
            expected: ZodParsedType.promise,
            received: ctx.parsedType
          });
          return INVALID;
        }
        const promisified = ctx.parsedType === ZodParsedType.promise ? ctx.data : Promise.resolve(ctx.data);
        return OK(promisified.then((data) => {
          return this._def.type.parseAsync(data, {
            path: ctx.path,
            errorMap: ctx.common.contextualErrorMap
          });
        }));
      }
    };
    ZodPromise.create = (schema, params) => {
      return new ZodPromise({
        type: schema,
        typeName: ZodFirstPartyTypeKind.ZodPromise,
        ...processCreateParams(params)
      });
    };
    ZodEffects = class extends ZodType {
      static {
        __name(this, "ZodEffects");
      }
      static {
        __name2(this, "ZodEffects");
      }
      innerType() {
        return this._def.schema;
      }
      sourceType() {
        return this._def.schema._def.typeName === ZodFirstPartyTypeKind.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
      }
      _parse(input) {
        const { status: status2, ctx } = this._processInputParams(input);
        const effect = this._def.effect || null;
        const checkCtx = {
          addIssue: /* @__PURE__ */ __name2((arg) => {
            addIssueToContext(ctx, arg);
            if (arg.fatal) {
              status2.abort();
            } else {
              status2.dirty();
            }
          }, "addIssue"),
          get path() {
            return ctx.path;
          }
        };
        checkCtx.addIssue = checkCtx.addIssue.bind(checkCtx);
        if (effect.type === "preprocess") {
          const processed = effect.transform(ctx.data, checkCtx);
          if (ctx.common.issues.length) {
            return {
              status: "dirty",
              value: ctx.data
            };
          }
          if (ctx.common.async) {
            return Promise.resolve(processed).then((processed2) => {
              return this._def.schema._parseAsync({
                data: processed2,
                path: ctx.path,
                parent: ctx
              });
            });
          } else {
            return this._def.schema._parseSync({
              data: processed,
              path: ctx.path,
              parent: ctx
            });
          }
        }
        if (effect.type === "refinement") {
          const executeRefinement = /* @__PURE__ */ __name2((acc) => {
            const result = effect.refinement(acc, checkCtx);
            if (ctx.common.async) {
              return Promise.resolve(result);
            }
            if (result instanceof Promise) {
              throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");
            }
            return acc;
          }, "executeRefinement");
          if (ctx.common.async === false) {
            const inner = this._def.schema._parseSync({
              data: ctx.data,
              path: ctx.path,
              parent: ctx
            });
            if (inner.status === "aborted")
              return INVALID;
            if (inner.status === "dirty")
              status2.dirty();
            executeRefinement(inner.value);
            return { status: status2.value, value: inner.value };
          } else {
            return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((inner) => {
              if (inner.status === "aborted")
                return INVALID;
              if (inner.status === "dirty")
                status2.dirty();
              return executeRefinement(inner.value).then(() => {
                return { status: status2.value, value: inner.value };
              });
            });
          }
        }
        if (effect.type === "transform") {
          if (ctx.common.async === false) {
            const base = this._def.schema._parseSync({
              data: ctx.data,
              path: ctx.path,
              parent: ctx
            });
            if (!isValid(base))
              return base;
            const result = effect.transform(base.value, checkCtx);
            if (result instanceof Promise) {
              throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);
            }
            return { status: status2.value, value: result };
          } else {
            return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((base) => {
              if (!isValid(base))
                return base;
              return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({ status: status2.value, value: result }));
            });
          }
        }
        util.assertNever(effect);
      }
    };
    ZodEffects.create = (schema, effect, params) => {
      return new ZodEffects({
        schema,
        typeName: ZodFirstPartyTypeKind.ZodEffects,
        effect,
        ...processCreateParams(params)
      });
    };
    ZodEffects.createWithPreprocess = (preprocess, schema, params) => {
      return new ZodEffects({
        schema,
        effect: { type: "preprocess", transform: preprocess },
        typeName: ZodFirstPartyTypeKind.ZodEffects,
        ...processCreateParams(params)
      });
    };
    ZodOptional = class extends ZodType {
      static {
        __name(this, "ZodOptional");
      }
      static {
        __name2(this, "ZodOptional");
      }
      _parse(input) {
        const parsedType = this._getType(input);
        if (parsedType === ZodParsedType.undefined) {
          return OK(void 0);
        }
        return this._def.innerType._parse(input);
      }
      unwrap() {
        return this._def.innerType;
      }
    };
    ZodOptional.create = (type, params) => {
      return new ZodOptional({
        innerType: type,
        typeName: ZodFirstPartyTypeKind.ZodOptional,
        ...processCreateParams(params)
      });
    };
    ZodNullable = class extends ZodType {
      static {
        __name(this, "ZodNullable");
      }
      static {
        __name2(this, "ZodNullable");
      }
      _parse(input) {
        const parsedType = this._getType(input);
        if (parsedType === ZodParsedType.null) {
          return OK(null);
        }
        return this._def.innerType._parse(input);
      }
      unwrap() {
        return this._def.innerType;
      }
    };
    ZodNullable.create = (type, params) => {
      return new ZodNullable({
        innerType: type,
        typeName: ZodFirstPartyTypeKind.ZodNullable,
        ...processCreateParams(params)
      });
    };
    ZodDefault = class extends ZodType {
      static {
        __name(this, "ZodDefault");
      }
      static {
        __name2(this, "ZodDefault");
      }
      _parse(input) {
        const { ctx } = this._processInputParams(input);
        let data = ctx.data;
        if (ctx.parsedType === ZodParsedType.undefined) {
          data = this._def.defaultValue();
        }
        return this._def.innerType._parse({
          data,
          path: ctx.path,
          parent: ctx
        });
      }
      removeDefault() {
        return this._def.innerType;
      }
    };
    ZodDefault.create = (type, params) => {
      return new ZodDefault({
        innerType: type,
        typeName: ZodFirstPartyTypeKind.ZodDefault,
        defaultValue: typeof params.default === "function" ? params.default : () => params.default,
        ...processCreateParams(params)
      });
    };
    ZodCatch = class extends ZodType {
      static {
        __name(this, "ZodCatch");
      }
      static {
        __name2(this, "ZodCatch");
      }
      _parse(input) {
        const { ctx } = this._processInputParams(input);
        const newCtx = {
          ...ctx,
          common: {
            ...ctx.common,
            issues: []
          }
        };
        const result = this._def.innerType._parse({
          data: newCtx.data,
          path: newCtx.path,
          parent: {
            ...newCtx
          }
        });
        if (isAsync(result)) {
          return result.then((result2) => {
            return {
              status: "valid",
              value: result2.status === "valid" ? result2.value : this._def.catchValue({
                get error() {
                  return new ZodError(newCtx.common.issues);
                },
                input: newCtx.data
              })
            };
          });
        } else {
          return {
            status: "valid",
            value: result.status === "valid" ? result.value : this._def.catchValue({
              get error() {
                return new ZodError(newCtx.common.issues);
              },
              input: newCtx.data
            })
          };
        }
      }
      removeCatch() {
        return this._def.innerType;
      }
    };
    ZodCatch.create = (type, params) => {
      return new ZodCatch({
        innerType: type,
        typeName: ZodFirstPartyTypeKind.ZodCatch,
        catchValue: typeof params.catch === "function" ? params.catch : () => params.catch,
        ...processCreateParams(params)
      });
    };
    ZodNaN = class extends ZodType {
      static {
        __name(this, "ZodNaN");
      }
      static {
        __name2(this, "ZodNaN");
      }
      _parse(input) {
        const parsedType = this._getType(input);
        if (parsedType !== ZodParsedType.nan) {
          const ctx = this._getOrReturnCtx(input);
          addIssueToContext(ctx, {
            code: ZodIssueCode.invalid_type,
            expected: ZodParsedType.nan,
            received: ctx.parsedType
          });
          return INVALID;
        }
        return { status: "valid", value: input.data };
      }
    };
    ZodNaN.create = (params) => {
      return new ZodNaN({
        typeName: ZodFirstPartyTypeKind.ZodNaN,
        ...processCreateParams(params)
      });
    };
    BRAND = Symbol("zod_brand");
    ZodBranded = class extends ZodType {
      static {
        __name(this, "ZodBranded");
      }
      static {
        __name2(this, "ZodBranded");
      }
      _parse(input) {
        const { ctx } = this._processInputParams(input);
        const data = ctx.data;
        return this._def.type._parse({
          data,
          path: ctx.path,
          parent: ctx
        });
      }
      unwrap() {
        return this._def.type;
      }
    };
    ZodPipeline = class _ZodPipeline extends ZodType {
      static {
        __name(this, "_ZodPipeline");
      }
      static {
        __name2(this, "ZodPipeline");
      }
      _parse(input) {
        const { status: status2, ctx } = this._processInputParams(input);
        if (ctx.common.async) {
          const handleAsync = /* @__PURE__ */ __name2(async () => {
            const inResult = await this._def.in._parseAsync({
              data: ctx.data,
              path: ctx.path,
              parent: ctx
            });
            if (inResult.status === "aborted")
              return INVALID;
            if (inResult.status === "dirty") {
              status2.dirty();
              return DIRTY(inResult.value);
            } else {
              return this._def.out._parseAsync({
                data: inResult.value,
                path: ctx.path,
                parent: ctx
              });
            }
          }, "handleAsync");
          return handleAsync();
        } else {
          const inResult = this._def.in._parseSync({
            data: ctx.data,
            path: ctx.path,
            parent: ctx
          });
          if (inResult.status === "aborted")
            return INVALID;
          if (inResult.status === "dirty") {
            status2.dirty();
            return {
              status: "dirty",
              value: inResult.value
            };
          } else {
            return this._def.out._parseSync({
              data: inResult.value,
              path: ctx.path,
              parent: ctx
            });
          }
        }
      }
      static create(a7, b11) {
        return new _ZodPipeline({
          in: a7,
          out: b11,
          typeName: ZodFirstPartyTypeKind.ZodPipeline
        });
      }
    };
    ZodReadonly = class extends ZodType {
      static {
        __name(this, "ZodReadonly");
      }
      static {
        __name2(this, "ZodReadonly");
      }
      _parse(input) {
        const result = this._def.innerType._parse(input);
        if (isValid(result)) {
          result.value = Object.freeze(result.value);
        }
        return result;
      }
    };
    ZodReadonly.create = (type, params) => {
      return new ZodReadonly({
        innerType: type,
        typeName: ZodFirstPartyTypeKind.ZodReadonly,
        ...processCreateParams(params)
      });
    };
    custom = /* @__PURE__ */ __name2((check, params = {}, fatal) => {
      if (check)
        return ZodAny.create().superRefine((data, ctx) => {
          var _a5, _b2;
          if (!check(data)) {
            const p7 = typeof params === "function" ? params(data) : typeof params === "string" ? { message: params } : params;
            const _fatal = (_b2 = (_a5 = p7.fatal) !== null && _a5 !== void 0 ? _a5 : fatal) !== null && _b2 !== void 0 ? _b2 : true;
            const p22 = typeof p7 === "string" ? { message: p7 } : p7;
            ctx.addIssue({ code: "custom", ...p22, fatal: _fatal });
          }
        });
      return ZodAny.create();
    }, "custom");
    late = {
      object: ZodObject.lazycreate
    };
    (function(ZodFirstPartyTypeKind22) {
      ZodFirstPartyTypeKind22["ZodString"] = "ZodString";
      ZodFirstPartyTypeKind22["ZodNumber"] = "ZodNumber";
      ZodFirstPartyTypeKind22["ZodNaN"] = "ZodNaN";
      ZodFirstPartyTypeKind22["ZodBigInt"] = "ZodBigInt";
      ZodFirstPartyTypeKind22["ZodBoolean"] = "ZodBoolean";
      ZodFirstPartyTypeKind22["ZodDate"] = "ZodDate";
      ZodFirstPartyTypeKind22["ZodSymbol"] = "ZodSymbol";
      ZodFirstPartyTypeKind22["ZodUndefined"] = "ZodUndefined";
      ZodFirstPartyTypeKind22["ZodNull"] = "ZodNull";
      ZodFirstPartyTypeKind22["ZodAny"] = "ZodAny";
      ZodFirstPartyTypeKind22["ZodUnknown"] = "ZodUnknown";
      ZodFirstPartyTypeKind22["ZodNever"] = "ZodNever";
      ZodFirstPartyTypeKind22["ZodVoid"] = "ZodVoid";
      ZodFirstPartyTypeKind22["ZodArray"] = "ZodArray";
      ZodFirstPartyTypeKind22["ZodObject"] = "ZodObject";
      ZodFirstPartyTypeKind22["ZodUnion"] = "ZodUnion";
      ZodFirstPartyTypeKind22["ZodDiscriminatedUnion"] = "ZodDiscriminatedUnion";
      ZodFirstPartyTypeKind22["ZodIntersection"] = "ZodIntersection";
      ZodFirstPartyTypeKind22["ZodTuple"] = "ZodTuple";
      ZodFirstPartyTypeKind22["ZodRecord"] = "ZodRecord";
      ZodFirstPartyTypeKind22["ZodMap"] = "ZodMap";
      ZodFirstPartyTypeKind22["ZodSet"] = "ZodSet";
      ZodFirstPartyTypeKind22["ZodFunction"] = "ZodFunction";
      ZodFirstPartyTypeKind22["ZodLazy"] = "ZodLazy";
      ZodFirstPartyTypeKind22["ZodLiteral"] = "ZodLiteral";
      ZodFirstPartyTypeKind22["ZodEnum"] = "ZodEnum";
      ZodFirstPartyTypeKind22["ZodEffects"] = "ZodEffects";
      ZodFirstPartyTypeKind22["ZodNativeEnum"] = "ZodNativeEnum";
      ZodFirstPartyTypeKind22["ZodOptional"] = "ZodOptional";
      ZodFirstPartyTypeKind22["ZodNullable"] = "ZodNullable";
      ZodFirstPartyTypeKind22["ZodDefault"] = "ZodDefault";
      ZodFirstPartyTypeKind22["ZodCatch"] = "ZodCatch";
      ZodFirstPartyTypeKind22["ZodPromise"] = "ZodPromise";
      ZodFirstPartyTypeKind22["ZodBranded"] = "ZodBranded";
      ZodFirstPartyTypeKind22["ZodPipeline"] = "ZodPipeline";
      ZodFirstPartyTypeKind22["ZodReadonly"] = "ZodReadonly";
    })(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));
    instanceOfType = /* @__PURE__ */ __name2((cls, params = {
      message: `Input not instance of ${cls.name}`
    }) => custom((data) => data instanceof cls, params), "instanceOfType");
    stringType = ZodString.create;
    numberType = ZodNumber.create;
    nanType = ZodNaN.create;
    bigIntType = ZodBigInt.create;
    booleanType = ZodBoolean.create;
    dateType = ZodDate.create;
    symbolType = ZodSymbol.create;
    undefinedType = ZodUndefined.create;
    nullType = ZodNull.create;
    anyType = ZodAny.create;
    unknownType = ZodUnknown.create;
    neverType = ZodNever.create;
    voidType = ZodVoid.create;
    arrayType = ZodArray.create;
    objectType = ZodObject.create;
    strictObjectType = ZodObject.strictCreate;
    unionType = ZodUnion.create;
    discriminatedUnionType = ZodDiscriminatedUnion.create;
    intersectionType = ZodIntersection.create;
    tupleType = ZodTuple.create;
    recordType = ZodRecord.create;
    mapType = ZodMap.create;
    setType = ZodSet.create;
    functionType = ZodFunction.create;
    lazyType = ZodLazy.create;
    literalType = ZodLiteral.create;
    enumType = ZodEnum.create;
    nativeEnumType = ZodNativeEnum.create;
    promiseType = ZodPromise.create;
    effectsType = ZodEffects.create;
    optionalType = ZodOptional.create;
    nullableType = ZodNullable.create;
    preprocessType = ZodEffects.createWithPreprocess;
    pipelineType = ZodPipeline.create;
    ostring = /* @__PURE__ */ __name2(() => stringType().optional(), "ostring");
    onumber = /* @__PURE__ */ __name2(() => numberType().optional(), "onumber");
    oboolean = /* @__PURE__ */ __name2(() => booleanType().optional(), "oboolean");
    coerce = {
      string: /* @__PURE__ */ __name2((arg) => ZodString.create({ ...arg, coerce: true }), "string"),
      number: /* @__PURE__ */ __name2((arg) => ZodNumber.create({ ...arg, coerce: true }), "number"),
      boolean: /* @__PURE__ */ __name2((arg) => ZodBoolean.create({
        ...arg,
        coerce: true
      }), "boolean"),
      bigint: /* @__PURE__ */ __name2((arg) => ZodBigInt.create({ ...arg, coerce: true }), "bigint"),
      date: /* @__PURE__ */ __name2((arg) => ZodDate.create({ ...arg, coerce: true }), "date")
    };
    NEVER = INVALID;
    z = /* @__PURE__ */ Object.freeze({
      __proto__: null,
      defaultErrorMap: errorMap,
      setErrorMap,
      getErrorMap,
      makeIssue,
      EMPTY_PATH,
      addIssueToContext,
      ParseStatus,
      INVALID,
      DIRTY,
      OK,
      isAborted,
      isDirty,
      isValid,
      isAsync,
      get util() {
        return util;
      },
      get objectUtil() {
        return objectUtil;
      },
      ZodParsedType,
      getParsedType,
      ZodType,
      ZodString,
      ZodNumber,
      ZodBigInt,
      ZodBoolean,
      ZodDate,
      ZodSymbol,
      ZodUndefined,
      ZodNull,
      ZodAny,
      ZodUnknown,
      ZodNever,
      ZodVoid,
      ZodArray,
      ZodObject,
      ZodUnion,
      ZodDiscriminatedUnion,
      ZodIntersection,
      ZodTuple,
      ZodRecord,
      ZodMap,
      ZodSet,
      ZodFunction,
      ZodLazy,
      ZodLiteral,
      ZodEnum,
      ZodNativeEnum,
      ZodPromise,
      ZodEffects,
      ZodTransformer: ZodEffects,
      ZodOptional,
      ZodNullable,
      ZodDefault,
      ZodCatch,
      ZodNaN,
      BRAND,
      ZodBranded,
      ZodPipeline,
      ZodReadonly,
      custom,
      Schema: ZodType,
      ZodSchema: ZodType,
      late,
      get ZodFirstPartyTypeKind() {
        return ZodFirstPartyTypeKind;
      },
      coerce,
      any: anyType,
      array: arrayType,
      bigint: bigIntType,
      boolean: booleanType,
      date: dateType,
      discriminatedUnion: discriminatedUnionType,
      effect: effectsType,
      "enum": enumType,
      "function": functionType,
      "instanceof": instanceOfType,
      intersection: intersectionType,
      lazy: lazyType,
      literal: literalType,
      map: mapType,
      nan: nanType,
      nativeEnum: nativeEnumType,
      never: neverType,
      "null": nullType,
      nullable: nullableType,
      number: numberType,
      object: objectType,
      oboolean,
      onumber,
      optional: optionalType,
      ostring,
      pipeline: pipelineType,
      preprocess: preprocessType,
      promise: promiseType,
      record: recordType,
      set: setType,
      strictObject: strictObjectType,
      string: stringType,
      symbol: symbolType,
      transformer: effectsType,
      tuple: tupleType,
      "undefined": undefinedType,
      union: unionType,
      unknown: unknownType,
      "void": voidType,
      NEVER,
      ZodIssueCode,
      quotelessJson,
      ZodError
    });
    MAX_WORKFLOW_NAME_LENGTH = 64;
    ALLOWED_STRING_ID_PATTERN = "^[a-zA-Z0-9_][a-zA-Z0-9-_]*$";
    ALLOWED_WORKFLOW_INSTANCE_ID_REGEX = new RegExp(
      ALLOWED_STRING_ID_PATTERN
    );
    ALLOWED_WORKFLOW_NAME_REGEX = ALLOWED_WORKFLOW_INSTANCE_ID_REGEX;
    __name(isValidWorkflowName, "isValidWorkflowName");
    __name2(isValidWorkflowName, "isValidWorkflowName");
    z.object({
      retries: z.object({
        delay: z.number().gte(0).or(z.string()),
        limit: z.number().gte(0),
        backoff: z.enum(["constant", "linear", "exponential"]).optional()
      }).strict().optional(),
      timeout: z.number().gte(0).or(z.string()).optional()
    }).strict();
    mod_esm_exports = {};
    __export2(mod_esm_exports, {
      default: /* @__PURE__ */ __name(() => mod_esm_default, "default")
    });
    import_mod_cjs = __toESM2(require_mod_cjs3(), 1);
    __reExport2(mod_esm_exports, __toESM2(require_mod_cjs3(), 1));
    mod_esm_default = import_mod_cjs.default;
    __name(getGlobalWranglerConfigPath, "getGlobalWranglerConfigPath");
    __name2(getGlobalWranglerConfigPath, "getGlobalWranglerConfigPath");
    __name(getBooleanEnvironmentVariableFactory, "getBooleanEnvironmentVariableFactory");
    __name2(getBooleanEnvironmentVariableFactory, "getBooleanEnvironmentVariableFactory");
    __name(getEnvironmentVariableFactory, "getEnvironmentVariableFactory");
    __name2(getEnvironmentVariableFactory, "getEnvironmentVariableFactory");
    __name(getProcessEnv, "getProcessEnv");
    __name2(getProcessEnv, "getProcessEnv");
    __name(assertOneOf, "assertOneOf");
    __name2(assertOneOf, "assertOneOf");
    getC3CommandFromEnv = getEnvironmentVariableFactory({
      variableName: "WRANGLER_C3_COMMAND",
      defaultValue: /* @__PURE__ */ __name2(() => "create cloudflare", "defaultValue")
    });
    getWranglerSendMetricsFromEnv = getBooleanEnvironmentVariableFactory({
      variableName: "WRANGLER_SEND_METRICS"
    });
    getWranglerSendErrorReportsFromEnv = getBooleanEnvironmentVariableFactory({
      variableName: "WRANGLER_SEND_ERROR_REPORTS"
    });
    getCloudflareApiEnvironmentFromEnv = getEnvironmentVariableFactory(
      {
        variableName: "WRANGLER_API_ENVIRONMENT",
        defaultValue: /* @__PURE__ */ __name2(() => "production", "defaultValue"),
        choices: ["production", "staging"]
      }
    );
    COMPLIANCE_REGION_CONFIG_PUBLIC = {
      compliance_region: "public"
    };
    COMPLIANCE_REGION_CONFIG_UNKNOWN = {
      compliance_region: void 0
    };
    getCloudflareComplianceRegionFromEnv = getEnvironmentVariableFactory({
      variableName: "CLOUDFLARE_COMPLIANCE_REGION",
      choices: ["public", "fedramp_high"]
    });
    getCloudflareComplianceRegion = /* @__PURE__ */ __name2((complianceConfig) => {
      const complianceRegionFromEnv = getCloudflareComplianceRegionFromEnv();
      if (complianceRegionFromEnv !== void 0 && complianceConfig?.compliance_region !== void 0 && complianceRegionFromEnv !== complianceConfig.compliance_region) {
        throw new UserError(dedent`
			The compliance region has been set to different values in two places:
			 - \`CLOUDFLARE_COMPLIANCE_REGION\` environment variable: \`${complianceRegionFromEnv}\`
			 - \`compliance_region\` configuration property: \`${complianceConfig.compliance_region}\`
			`);
      }
      return complianceRegionFromEnv || complianceConfig?.compliance_region || "public";
    }, "getCloudflareComplianceRegion");
    getCloudflareApiBaseUrlFromEnv = getEnvironmentVariableFactory({
      variableName: "CLOUDFLARE_API_BASE_URL",
      deprecatedName: "CF_API_BASE_URL"
    });
    getCloudflareApiBaseUrl = /* @__PURE__ */ __name2((complianceConfig) => getCloudflareApiBaseUrlFromEnv() ?? `https://api${getComplianceRegionSubdomain(complianceConfig)}${getStagingSubdomain()}.cloudflare.com/client/v4`, "getCloudflareApiBaseUrl");
    __name(getComplianceRegionSubdomain, "getComplianceRegionSubdomain");
    __name2(getComplianceRegionSubdomain, "getComplianceRegionSubdomain");
    __name(getStagingSubdomain, "getStagingSubdomain");
    __name2(getStagingSubdomain, "getStagingSubdomain");
    getSanitizeLogs = getBooleanEnvironmentVariableFactory({
      variableName: "WRANGLER_LOG_SANITIZE",
      defaultValue: true
    });
    getOutputFileDirectoryFromEnv = getEnvironmentVariableFactory({
      variableName: "WRANGLER_OUTPUT_FILE_DIRECTORY"
    });
    getOutputFilePathFromEnv = getEnvironmentVariableFactory({
      variableName: "WRANGLER_OUTPUT_FILE_PATH"
    });
    getCIMatchTag = getEnvironmentVariableFactory({
      variableName: "WRANGLER_CI_MATCH_TAG"
    });
    getCIOverrideName = getEnvironmentVariableFactory({
      variableName: "WRANGLER_CI_OVERRIDE_NAME"
    });
    getCIOverrideNetworkModeHost = getEnvironmentVariableFactory({
      variableName: "WRANGLER_CI_OVERRIDE_NETWORK_MODE_HOST"
    });
    getCIGeneratePreviewAlias = getEnvironmentVariableFactory({
      variableName: "WRANGLER_CI_GENERATE_PREVIEW_ALIAS",
      defaultValue: /* @__PURE__ */ __name2(() => "false", "defaultValue"),
      choices: ["true", "false"]
    });
    getWorkersCIBranchName = getEnvironmentVariableFactory({
      variableName: "WORKERS_CI_BRANCH"
    });
    getBuildConditionsFromEnv = getEnvironmentVariableFactory({
      variableName: "WRANGLER_BUILD_CONDITIONS"
    });
    getBuildPlatformFromEnv = getEnvironmentVariableFactory({
      variableName: "WRANGLER_BUILD_PLATFORM"
    });
    getRegistryPath = getEnvironmentVariableFactory({
      variableName: "WRANGLER_REGISTRY_PATH",
      defaultValue() {
        return path3__namespace.default.join(getGlobalWranglerConfigPath(), "registry");
      }
    });
    getD1ExtraLocationChoices = getEnvironmentVariableFactory({
      variableName: "WRANGLER_D1_EXTRA_LOCATION_CHOICES"
    });
    getDockerPath = getEnvironmentVariableFactory({
      variableName: "WRANGLER_DOCKER_BIN",
      defaultValue() {
        return "docker";
      }
    });
    getSubdomainMixedStateCheckDisabled = getBooleanEnvironmentVariableFactory({
      variableName: "WRANGLER_DISABLE_SUBDOMAIN_MIXED_STATE_CHECK",
      defaultValue: false
    });
    getCloudflareLoadDevVarsFromDotEnv = getBooleanEnvironmentVariableFactory({
      variableName: "CLOUDFLARE_LOAD_DEV_VARS_FROM_DOT_ENV",
      defaultValue: true
    });
    getCloudflareIncludeProcessEnvFromEnv = getBooleanEnvironmentVariableFactory({
      variableName: "CLOUDFLARE_INCLUDE_PROCESS_ENV",
      defaultValue: false
    });
    getTraceHeader = getEnvironmentVariableFactory({
      variableName: "WRANGLER_TRACE_ID"
    });
    getDisableConfigWatching = getBooleanEnvironmentVariableFactory({
      variableName: "WRANGLER_CI_DISABLE_CONFIG_WATCHING",
      defaultValue: false
    });
    getWranglerHideBanner = getBooleanEnvironmentVariableFactory({
      variableName: "WRANGLER_HIDE_BANNER",
      defaultValue: false
    });
    getCloudflareEnv = getEnvironmentVariableFactory({
      variableName: "CLOUDFLARE_ENV"
    });
    getOpenNextDeployFromEnv = getEnvironmentVariableFactory({
      variableName: "OPEN_NEXT_DEPLOY"
    });
    getLocalExplorerEnabledFromEnv = getBooleanEnvironmentVariableFactory({
      variableName: "X_LOCAL_EXPLORER",
      defaultValue: true
    });
    getBrowserRenderingHeadfulFromEnv = getBooleanEnvironmentVariableFactory({
      variableName: "X_BROWSER_HEADFUL",
      defaultValue: false
    });
    getWranglerCacheDirFromEnv = getEnvironmentVariableFactory({
      variableName: "WRANGLER_CACHE_DIR"
    });
    getCloudflaredPathFromEnv = getEnvironmentVariableFactory({
      variableName: "CLOUDFLARED_PATH"
    });
    Diagnostics = class {
      static {
        __name(this, "Diagnostics");
      }
      /**
       * Create a new Diagnostics object.
       * @param description A general description of this collection of messages.
       */
      constructor(description) {
        this.description = description;
      }
      static {
        __name2(this, "Diagnostics");
      }
      errors = [];
      warnings = [];
      children = [];
      /** Set to true when an unexpected/unknown field is encountered during validation. */
      hasUnexpectedFields = false;
      /**
       * Merge the given `diagnostics` into this as a child.
       */
      addChild(diagnostics) {
        if (diagnostics.hasErrors() || diagnostics.hasWarnings()) {
          this.children.push(diagnostics);
        }
      }
      /** Does this or any of its children have errors. */
      hasErrors() {
        if (this.errors.length > 0) {
          return true;
        } else {
          return this.children.some((child) => child.hasErrors());
        }
      }
      /** Does this or any of its children have unexpected fields. */
      hasUnexpectedFieldsInTree() {
        if (this.hasUnexpectedFields) {
          return true;
        } else {
          return this.children.some((child) => child.hasUnexpectedFieldsInTree());
        }
      }
      /** Render the errors of this and all its children. */
      renderErrors() {
        return this.render("errors");
      }
      /** Does this or any of its children have warnings. */
      hasWarnings() {
        if (this.warnings.length > 0) {
          return true;
        } else {
          return this.children.some((child) => child.hasWarnings());
        }
      }
      /** Render the warnings of this and all its children. */
      renderWarnings() {
        return this.render("warnings");
      }
      render(field) {
        const hasMethod = field === "errors" ? "hasErrors" : "hasWarnings";
        return indentText(
          `${this.description}
` + // Output all the fields (errors or warnings) at this level
          this[field].map((message) => `- ${indentText(message)}`).join("\n") + // Output all the child diagnostics at the next level
          this.children.map(
            (child) => child[hasMethod]() ? "\n- " + child.render(field) : ""
          ).filter((output) => output !== "").join("\n")
        );
      }
    };
    __name(indentText, "indentText");
    __name2(indentText, "indentText");
    __name(deprecated, "deprecated");
    __name2(deprecated, "deprecated");
    __name(experimental, "experimental");
    __name2(experimental, "experimental");
    __name(inheritable, "inheritable");
    __name2(inheritable, "inheritable");
    __name(inheritableInWranglerEnvironments, "inheritableInWranglerEnvironments");
    __name2(inheritableInWranglerEnvironments, "inheritableInWranglerEnvironments");
    appendEnvName = /* @__PURE__ */ __name2((envName) => (fieldValue) => fieldValue ? `${fieldValue}-${envName}` : void 0, "appendEnvName");
    __name(notAllowedInNamedServiceEnvironment, "notAllowedInNamedServiceEnvironment");
    __name2(notAllowedInNamedServiceEnvironment, "notAllowedInNamedServiceEnvironment");
    __name(notInheritable, "notInheritable");
    __name2(notInheritable, "notInheritable");
    __name(unwindPropertyPath, "unwindPropertyPath");
    __name2(unwindPropertyPath, "unwindPropertyPath");
    isString = /* @__PURE__ */ __name2((diagnostics, field, value) => {
      if (value !== void 0 && typeof value !== "string") {
        diagnostics.errors.push(
          `Expected "${field}" to be of type string but got ${JSON.stringify(
            value
          )}.`
        );
        return false;
      }
      return true;
    }, "isString");
    isValidName = /* @__PURE__ */ __name2((diagnostics, field, value) => {
      if (typeof value === "string" && /^$|^[a-z0-9_][a-z0-9-_]*$/.test(value) || value === void 0) {
        return true;
      } else {
        diagnostics.errors.push(
          `Expected "${field}" to be of type string, alphanumeric and lowercase with dashes only but got ${JSON.stringify(
            value
          )}.`
        );
        return false;
      }
    }, "isValidName");
    isValidDateTimeStringFormat = /* @__PURE__ */ __name2((diagnostics, field, value) => {
      let isValid22 = true;
      if (value.includes("\u2013") || // en-dash
      value.includes("\u2014")) {
        diagnostics.errors.push(
          `"${field}" field should use ISO-8601 accepted hyphens (-) rather than en-dashes (\u2013) or em-dashes (\u2014).`
        );
        isValid22 = false;
      }
      const data = new Date(value.replaceAll(/–|—/g, "-"));
      if (isNaN(data.getTime())) {
        diagnostics.errors.push(
          `"${field}" field should be a valid ISO-8601 date (YYYY-MM-DD), but got ${JSON.stringify(value)}.`
        );
        isValid22 = false;
      }
      return isValid22;
    }, "isValidDateTimeStringFormat");
    isStringArray = /* @__PURE__ */ __name2((diagnostics, field, value) => {
      if (value !== void 0 && (!Array.isArray(value) || value.some((item) => typeof item !== "string"))) {
        diagnostics.errors.push(
          `Expected "${field}" to be of type string array but got ${JSON.stringify(
            value
          )}.`
        );
        return false;
      }
      return true;
    }, "isStringArray");
    isOneOf = /* @__PURE__ */ __name2((...choices) => (diagnostics, field, value) => {
      if (value !== void 0 && !choices.some((choice) => value === choice)) {
        diagnostics.errors.push(
          `Expected "${field}" field to be one of ${JSON.stringify(
            choices
          )} but got ${JSON.stringify(value)}.`
        );
        return false;
      }
      return true;
    }, "isOneOf");
    all = /* @__PURE__ */ __name2((...validations) => {
      return (diagnostics, field, value, config) => {
        let passedValidations = true;
        for (const validate3 of validations) {
          if (!validate3(diagnostics, field, value, config)) {
            passedValidations = false;
          }
        }
        return passedValidations;
      };
    }, "all");
    isMutuallyExclusiveWith = /* @__PURE__ */ __name2((container, ...fields) => {
      return (diagnostics, field, value) => {
        if (value === void 0) {
          return true;
        }
        for (const exclusiveWith of fields) {
          if (container[exclusiveWith] !== void 0) {
            diagnostics.errors.push(
              `Expected exactly one of the following fields ${JSON.stringify([
                field,
                ...fields
              ])}.`
            );
            return false;
          }
        }
        return true;
      };
    }, "isMutuallyExclusiveWith");
    isBoolean = /* @__PURE__ */ __name2((diagnostics, field, value) => {
      if (value !== void 0 && typeof value !== "boolean") {
        diagnostics.errors.push(
          `Expected "${field}" to be of type boolean but got ${JSON.stringify(
            value
          )}.`
        );
        return false;
      }
      return true;
    }, "isBoolean");
    validateRequiredProperty = /* @__PURE__ */ __name2((diagnostics, container, key, value, type, choices) => {
      if (container) {
        container += ".";
      }
      if (value === void 0) {
        diagnostics.errors.push(`"${container}${key}" is a required field.`);
        return false;
      } else if (typeof value !== type) {
        diagnostics.errors.push(
          `Expected "${container}${key}" to be of type ${type} but got ${JSON.stringify(
            value
          )}.`
        );
        return false;
      } else if (choices) {
        if (!isOneOf(...choices)(diagnostics, `${container}${key}`, value, void 0)) {
          return false;
        }
      }
      return true;
    }, "validateRequiredProperty");
    validateAtLeastOnePropertyRequired = /* @__PURE__ */ __name2((diagnostics, container, properties) => {
      const containerPath = container ? `${container}.` : "";
      if (properties.every((property) => property.value === void 0)) {
        diagnostics.errors.push(
          `${properties.map(({ key }) => `"${containerPath}${key}"`).join(" or ")} is required.`
        );
        return false;
      }
      const errors = [];
      for (const prop of properties) {
        if (typeof prop.value === prop.type) {
          return true;
        }
        errors.push(
          `Expected "${containerPath}${prop.key}" to be of type ${prop.type} but got ${JSON.stringify(
            prop.value
          )}.`
        );
      }
      diagnostics.errors.push(...errors);
      return false;
    }, "validateAtLeastOnePropertyRequired");
    validateOptionalProperty = /* @__PURE__ */ __name2((diagnostics, container, key, value, type, choices) => {
      if (value !== void 0) {
        return validateRequiredProperty(
          diagnostics,
          container,
          key,
          value,
          type,
          choices
        );
      }
      return true;
    }, "validateOptionalProperty");
    validateTypedArray = /* @__PURE__ */ __name2((diagnostics, container, value, type) => {
      let isValid22 = true;
      if (!Array.isArray(value)) {
        diagnostics.errors.push(
          `Expected "${container}" to be an array of ${type}s but got ${JSON.stringify(
            value
          )}`
        );
        isValid22 = false;
      } else {
        for (let i7 = 0; i7 < value.length; i7++) {
          isValid22 = validateRequiredProperty(
            diagnostics,
            container,
            `[${i7}]`,
            value[i7],
            type
          ) && isValid22;
        }
      }
      return isValid22;
    }, "validateTypedArray");
    validateOptionalTypedArray = /* @__PURE__ */ __name2((diagnostics, container, value, type) => {
      if (value !== void 0) {
        return validateTypedArray(diagnostics, container, value, type);
      }
      return true;
    }, "validateOptionalTypedArray");
    isRequiredProperty = /* @__PURE__ */ __name2((target, property, type, choices) => hasProperty(target, property) && typeof target[property] === type && (choices === void 0 || choices.includes(target[property])), "isRequiredProperty");
    isOptionalProperty = /* @__PURE__ */ __name2((target, property, type) => !hasProperty(target, property) || typeof target[property] === type, "isOptionalProperty");
    hasProperty = /* @__PURE__ */ __name2((target, property) => property in target, "hasProperty");
    validateAdditionalProperties = /* @__PURE__ */ __name2((diagnostics, fieldPath, restProps, knownProps) => {
      const restPropSet = new Set(restProps);
      for (const knownProp of knownProps) {
        restPropSet.delete(knownProp);
      }
      if (restPropSet.size > 0) {
        const fields = Array.from(restPropSet.keys()).map((field) => `"${field}"`);
        diagnostics.warnings.push(
          `Unexpected fields found in ${fieldPath} field: ${fields}`
        );
        diagnostics.hasUnexpectedFields = true;
        return false;
      }
      return true;
    }, "validateAdditionalProperties");
    getBindingNames = /* @__PURE__ */ __name2((value) => {
      if (typeof value !== "object" || value === null) {
        return [];
      }
      if (isBindingList(value)) {
        return value.bindings.map(({ name: name2 }) => name2);
      } else if (isNamespaceList(value)) {
        return value.map(({ binding }) => binding);
      } else if (isRecord(value)) {
        if (value["binding"] !== void 0) {
          return [value["binding"]];
        }
        return Object.keys(value).filter((k7) => value[k7] !== void 0);
      } else {
        return [];
      }
    }, "getBindingNames");
    isBindingList = /* @__PURE__ */ __name2((value) => isRecord(value) && "bindings" in value && Array.isArray(value.bindings) && value.bindings.every(
      (binding) => isRecord(binding) && "name" in binding && typeof binding.name === "string"
    ), "isBindingList");
    isNamespaceList = /* @__PURE__ */ __name2((value) => Array.isArray(value) && value.every(
      (entry) => isRecord(entry) && "binding" in entry && typeof entry.binding === "string"
    ), "isNamespaceList");
    isRecord = /* @__PURE__ */ __name2((value) => typeof value === "object" && value !== null && !Array.isArray(value), "isRecord");
    validateUniqueNameProperty = /* @__PURE__ */ __name2((diagnostics, field, value) => {
      if (Array.isArray(value)) {
        const nameCount = /* @__PURE__ */ new Map();
        Object.entries(value).forEach(([_22, entry]) => {
          nameCount.set(entry.name, (nameCount.get(entry.name) ?? 0) + 1);
        });
        const duplicates = Array.from(nameCount.entries()).filter(([_22, count]) => count > 1).map(([name2]) => name2);
        if (duplicates.length > 0) {
          const list = duplicates.join('", "');
          diagnostics.errors.push(
            `"${field}" bindings must have unique "name" values; duplicate(s) found: "${list}"`
          );
          return false;
        }
      }
      return true;
    }, "validateUniqueNameProperty");
    __name(isValidR2BucketName, "isValidR2BucketName");
    __name2(isValidR2BucketName, "isValidR2BucketName");
    bucketFormatMessage = `Bucket names must begin and end with an alphanumeric character, only contain lowercase letters, numbers, and hyphens, and be between 3 and 63 characters long.`;
    friendlyBindingNames = {
      data_blobs: "Data Blob",
      durable_objects: "Durable Object",
      kv_namespaces: "KV Namespace",
      send_email: "Send Email",
      queues: "Queue",
      d1_databases: "D1 Database",
      vectorize: "Vectorize Index",
      ai_search_namespaces: "AI Search Namespace",
      ai_search: "AI Search Instance",
      hyperdrive: "Hyperdrive Config",
      r2_buckets: "R2 Bucket",
      logfwdr: "logfwdr",
      services: "Worker",
      analytics_engine_datasets: "Analytics Engine Dataset",
      text_blobs: "Text Blob",
      browser: "Browser",
      ai: "AI",
      images: "Images",
      stream: "Stream",
      media: "Media",
      version_metadata: "Worker Version Metadata",
      unsafe: "Unsafe Metadata",
      vars: "Environment Variable",
      wasm_modules: "Wasm Module",
      dispatch_namespaces: "Dispatch Namespace",
      mtls_certificates: "mTLS Certificate",
      workflows: "Workflow",
      pipelines: "Pipeline",
      secrets_store_secrets: "Secrets Store Secret",
      ratelimits: "Rate Limit",
      assets: "Assets",
      unsafe_hello_world: "Hello World",
      flagship: "Flagship",
      worker_loaders: "Worker Loader",
      vpc_services: "VPC Service",
      vpc_networks: "VPC Network"
    };
    bindingTypeFriendlyNames = {
      // The 3 binding types below are all rendered as "Environment Variable" to preserve existing behaviour (friendlyBindingNames.vars)
      plain_text: "Environment Variable",
      secret_text: "Environment Variable",
      json: "Environment Variable",
      kv_namespace: "KV Namespace",
      send_email: "Send Email",
      wasm_module: "Wasm Module",
      text_blob: "Text Blob",
      browser: "Browser",
      ai: "AI",
      images: "Images",
      stream: "Stream",
      version_metadata: "Worker Version Metadata",
      data_blob: "Data Blob",
      durable_object_namespace: "Durable Object",
      workflow: "Workflow",
      queue: "Queue",
      r2_bucket: "R2 Bucket",
      d1: "D1 Database",
      vectorize: "Vectorize Index",
      ai_search_namespace: "AI Search Namespace",
      ai_search: "AI Search Instance",
      hyperdrive: "Hyperdrive Config",
      service: "Worker",
      fetcher: "Service Binding",
      analytics_engine: "Analytics Engine Dataset",
      dispatch_namespace: "Dispatch Namespace",
      mtls_certificate: "mTLS Certificate",
      pipeline: "Pipeline",
      secrets_store_secret: "Secrets Store Secret",
      logfwdr: "logfwdr",
      unsafe_hello_world: "Hello World",
      flagship: "Flagship",
      ratelimit: "Rate Limit",
      worker_loader: "Worker Loader",
      vpc_service: "VPC Service",
      vpc_network: "VPC Network",
      media: "Media",
      assets: "Assets",
      inherit: "Inherited"
    };
    __name(getBindingTypeFriendlyName, "getBindingTypeFriendlyName");
    __name2(getBindingTypeFriendlyName, "getBindingTypeFriendlyName");
    ENGLISH = new Intl.ListFormat("en-US");
    ALLOWED_INSTANCE_TYPES = [
      "lite",
      "basic",
      "standard-1",
      "standard-2",
      "standard-3",
      "standard-4",
      "dev",
      // legacy
      "standard"
      // legacy
    ];
    __name(isPagesConfig, "isPagesConfig");
    __name2(isPagesConfig, "isPagesConfig");
    __name(normalizeAndValidateConfig, "normalizeAndValidateConfig");
    __name2(normalizeAndValidateConfig, "normalizeAndValidateConfig");
    __name(applyPythonConfig, "applyPythonConfig");
    __name2(applyPythonConfig, "applyPythonConfig");
    __name(normalizeAndValidateBuild, "normalizeAndValidateBuild");
    __name2(normalizeAndValidateBuild, "normalizeAndValidateBuild");
    __name(normalizeAndValidateMainField, "normalizeAndValidateMainField");
    __name2(normalizeAndValidateMainField, "normalizeAndValidateMainField");
    __name(normalizeAndValidateBaseDirField, "normalizeAndValidateBaseDirField");
    __name2(normalizeAndValidateBaseDirField, "normalizeAndValidateBaseDirField");
    __name(normalizeAndValidatePagesBuildOutputDir, "normalizeAndValidatePagesBuildOutputDir");
    __name2(normalizeAndValidatePagesBuildOutputDir, "normalizeAndValidatePagesBuildOutputDir");
    __name(normalizeAndValidateDev, "normalizeAndValidateDev");
    __name2(normalizeAndValidateDev, "normalizeAndValidateDev");
    __name(normalizeAndValidateAssets, "normalizeAndValidateAssets");
    __name2(normalizeAndValidateAssets, "normalizeAndValidateAssets");
    __name(normalizeAndValidateSite, "normalizeAndValidateSite");
    __name2(normalizeAndValidateSite, "normalizeAndValidateSite");
    __name(normalizeAndValidateAliases, "normalizeAndValidateAliases");
    __name2(normalizeAndValidateAliases, "normalizeAndValidateAliases");
    __name(normalizeAndValidateModulePaths, "normalizeAndValidateModulePaths");
    __name2(normalizeAndValidateModulePaths, "normalizeAndValidateModulePaths");
    __name(isValidRouteValue, "isValidRouteValue");
    __name2(isValidRouteValue, "isValidRouteValue");
    __name(mutateEmptyStringAccountIDValue, "mutateEmptyStringAccountIDValue");
    __name2(mutateEmptyStringAccountIDValue, "mutateEmptyStringAccountIDValue");
    __name(mutateEmptyStringRouteValue, "mutateEmptyStringRouteValue");
    __name2(mutateEmptyStringRouteValue, "mutateEmptyStringRouteValue");
    isRoute = /* @__PURE__ */ __name2((diagnostics, field, value) => {
      if (value !== void 0 && !isValidRouteValue(value)) {
        diagnostics.errors.push(
          `Expected "${field}" to be either a string, or an object with shape { pattern, custom_domain, zone_id | zone_name }, but got ${JSON.stringify(
            value
          )}.`
        );
        return false;
      }
      return true;
    }, "isRoute");
    isRouteArray = /* @__PURE__ */ __name2((diagnostics, field, value) => {
      if (value === void 0) {
        return true;
      }
      if (!Array.isArray(value)) {
        diagnostics.errors.push(
          `Expected "${field}" to be an array but got ${JSON.stringify(value)}.`
        );
        return false;
      }
      const invalidRoutes = [];
      for (const item of value) {
        if (!isValidRouteValue(item)) {
          invalidRoutes.push(item);
        }
      }
      if (invalidRoutes.length > 0) {
        diagnostics.errors.push(
          `Expected "${field}" to be an array of either strings or objects with the shape { pattern, custom_domain, zone_id | zone_name }, but these weren't valid: ${JSON.stringify(
            invalidRoutes,
            null,
            2
          )}.`
        );
      }
      return invalidRoutes.length === 0;
    }, "isRouteArray");
    __name(normalizeAndValidateRoute, "normalizeAndValidateRoute");
    __name2(normalizeAndValidateRoute, "normalizeAndValidateRoute");
    __name(validateRoutes, "validateRoutes");
    __name2(validateRoutes, "validateRoutes");
    __name(normalizeAndValidatePlacement, "normalizeAndValidatePlacement");
    __name2(normalizeAndValidatePlacement, "normalizeAndValidatePlacement");
    __name(validateTailConsumer, "validateTailConsumer");
    __name2(validateTailConsumer, "validateTailConsumer");
    validateTailConsumers = /* @__PURE__ */ __name2((diagnostics, field, value) => {
      if (!value) {
        return true;
      }
      if (!Array.isArray(value)) {
        diagnostics.errors.push(
          `Expected "${field}" to be an array but got ${JSON.stringify(value)}.`
        );
        return false;
      }
      let isValid22 = true;
      for (let i7 = 0; i7 < value.length; i7++) {
        isValid22 = validateTailConsumer(diagnostics, `${field}[${i7}]`, value[i7]) && isValid22;
      }
      return isValid22;
    }, "validateTailConsumers");
    __name(validateStreamingTailConsumer, "validateStreamingTailConsumer");
    __name2(validateStreamingTailConsumer, "validateStreamingTailConsumer");
    validateStreamingTailConsumers = /* @__PURE__ */ __name2((diagnostics, field, value) => {
      if (!value) {
        return true;
      }
      if (!Array.isArray(value)) {
        diagnostics.errors.push(
          `Expected "${field}" to be an array but got ${JSON.stringify(value)}.`
        );
        return false;
      }
      let isValid22 = true;
      for (let i7 = 0; i7 < value.length; i7++) {
        isValid22 = validateStreamingTailConsumer(diagnostics, `${field}[${i7}]`, value[i7]) && isValid22;
      }
      return isValid22;
    }, "validateStreamingTailConsumers");
    __name(normalizeAndValidateEnvironment, "normalizeAndValidateEnvironment");
    __name2(normalizeAndValidateEnvironment, "normalizeAndValidateEnvironment");
    __name(validateAndNormalizeTsconfig, "validateAndNormalizeTsconfig");
    __name2(validateAndNormalizeTsconfig, "validateAndNormalizeTsconfig");
    validateAndNormalizeRules = /* @__PURE__ */ __name2((diagnostics, topLevelEnv, rawEnv, envName) => {
      return inheritable(
        diagnostics,
        topLevelEnv,
        rawEnv,
        "rules",
        validateRules(envName),
        []
      );
    }, "validateAndNormalizeRules");
    validateTriggers = /* @__PURE__ */ __name2((diagnostics, triggersFieldName, triggersValue) => {
      if (triggersValue === void 0 || triggersValue === null) {
        return true;
      }
      if (typeof triggersValue !== "object") {
        diagnostics.errors.push(
          `Expected "${triggersFieldName}" to be of type object but got ${JSON.stringify(
            triggersValue
          )}.`
        );
        return false;
      }
      let isValid22 = true;
      if ("crons" in triggersValue && !Array.isArray(triggersValue.crons)) {
        diagnostics.errors.push(
          `Expected "${triggersFieldName}.crons" to be of type array, but got ${JSON.stringify(triggersValue)}.`
        );
        isValid22 = false;
      }
      isValid22 = validateAdditionalProperties(
        diagnostics,
        triggersFieldName,
        Object.keys(triggersValue),
        ["crons"]
      ) && isValid22;
      return isValid22;
    }, "validateTriggers");
    validateRules = /* @__PURE__ */ __name2((envName) => (diagnostics, field, envValue, config) => {
      if (!envValue) {
        return true;
      }
      const fieldPath = config === void 0 ? `${field}` : `env.${envName}.${field}`;
      if (!Array.isArray(envValue)) {
        diagnostics.errors.push(
          `The field "${fieldPath}" should be an array but got ${JSON.stringify(
            envValue
          )}.`
        );
        return false;
      }
      let isValid22 = true;
      for (let i7 = 0; i7 < envValue.length; i7++) {
        isValid22 = validateRule(diagnostics, `${fieldPath}[${i7}]`, envValue[i7], config) && isValid22;
      }
      return isValid22;
    }, "validateRules");
    validateRule = /* @__PURE__ */ __name2((diagnostics, field, value) => {
      if (typeof value !== "object" || value === null) {
        diagnostics.errors.push(
          `"${field}" should be an object but got ${JSON.stringify(value)}.`
        );
        return false;
      }
      let isValid22 = true;
      const rule = value;
      if (!isRequiredProperty(rule, "type", "string", [
        "ESModule",
        "CommonJS",
        "CompiledWasm",
        "Text",
        "Data"
      ])) {
        diagnostics.errors.push(
          `bindings should have a string "type" field, which contains one of "ESModule", "CommonJS", "CompiledWasm", "Text", or "Data".`
        );
        isValid22 = false;
      }
      isValid22 = validateTypedArray(diagnostics, `${field}.globs`, rule.globs, "string") && isValid22;
      if (!isOptionalProperty(rule, "fallthrough", "boolean")) {
        diagnostics.errors.push(
          `the field "fallthrough", when present, should be a boolean.`
        );
        isValid22 = false;
      }
      return isValid22;
    }, "validateRule");
    validateDefines = /* @__PURE__ */ __name2((envName) => (diagnostics, field, value, config) => {
      let isValid22 = true;
      const fieldPath = config === void 0 ? `${field}` : `env.${envName}.${field}`;
      if (typeof value === "object" && value !== null) {
        for (const varName in value) {
          if (typeof value[varName] !== "string") {
            diagnostics.errors.push(
              `The field "${fieldPath}.${varName}" should be a string but got ${JSON.stringify(
                value[varName]
              )}.`
            );
            isValid22 = false;
          }
        }
      } else {
        if (value !== void 0) {
          diagnostics.errors.push(
            `The field "${fieldPath}" should be an object but got ${JSON.stringify(
              value
            )}.
`
          );
          isValid22 = false;
        }
      }
      const configDefines = Object.keys(config?.define ?? {});
      if (configDefines.length > 0) {
        if (typeof value === "object" && value !== null) {
          const configEnvDefines = config === void 0 ? [] : Object.keys(value);
          for (const varName of configDefines) {
            if (!(varName in value)) {
              diagnostics.warnings.push(
                `"define.${varName}" exists at the top level, but not on "${fieldPath}".
This is not what you probably want, since "define" configuration is not inherited by environments.
Please add "define.${varName}" to "env.${envName}".`
              );
            }
          }
          for (const varName of configEnvDefines) {
            if (!configDefines.includes(varName)) {
              diagnostics.warnings.push(
                `"${varName}" exists on "env.${envName}", but not on the top level.
This is not what you probably want, since "define" configuration within environments can only override existing top level "define" configuration
Please remove "${fieldPath}.${varName}", or add "define.${varName}".`
              );
            }
          }
        }
      }
      return isValid22;
    }, "validateDefines");
    validateVars = /* @__PURE__ */ __name2((envName) => (diagnostics, field, value, config) => {
      let isValid22 = true;
      const fieldPath = config === void 0 ? `${field}` : `env.${envName}.${field}`;
      if (value !== void 0) {
        if (typeof value !== "object" || value === null) {
          diagnostics.errors.push(
            `The field "${fieldPath}" should be an object but got ${JSON.stringify(
              value
            )}.
`
          );
          isValid22 = false;
        } else {
          for (const [varName, varValue] of Object.entries(value)) {
            if (varValue instanceof Date) {
              diagnostics.errors.push(
                `The field "${fieldPath}.${varName}" is a TOML date, which is not supported. Please use a string instead, e.g. ${varName} = "2025-12-19".`
              );
              isValid22 = false;
            }
          }
        }
      }
      const configVars = Object.keys(config?.vars ?? {});
      if (configVars.length > 0) {
        if (typeof value === "object" && value !== null) {
          for (const varName of configVars) {
            if (!(varName in value)) {
              diagnostics.warnings.push(
                `"vars.${varName}" exists at the top level, but not on "${fieldPath}".
This is not what you probably want, since "vars" configuration is not inherited by environments.
Please add "vars.${varName}" to "env.${envName}".`
              );
            }
          }
        }
      }
      return isValid22;
    }, "validateVars");
    validateSecrets = /* @__PURE__ */ __name2((envName) => (diagnostics, field, value, config) => {
      const fieldPath = config === void 0 ? `${field}` : `env.${envName}.${field}`;
      if (value === void 0) {
        return true;
      }
      if (typeof value !== "object" || value === null || Array.isArray(value)) {
        diagnostics.errors.push(
          `The field "${fieldPath}" should be an object but got ${JSON.stringify(value)}.`
        );
        return false;
      }
      let isValid22 = true;
      validateAdditionalProperties(diagnostics, fieldPath, Object.keys(value), [
        "required"
      ]);
      isValid22 = validateOptionalTypedArray(
        diagnostics,
        `${fieldPath}.required`,
        value.required,
        "string"
      ) && isValid22;
      return isValid22;
    }, "validateSecrets");
    validateBindingsProperty = /* @__PURE__ */ __name2((envName, validateBinding) => (diagnostics, field, value, config) => {
      let isValid22 = true;
      const fieldPath = config === void 0 ? `${field}` : `env.${envName}.${field}`;
      if (value !== void 0) {
        if (typeof value !== "object" || value === null || Array.isArray(value)) {
          diagnostics.errors.push(
            `The field "${fieldPath}" should be an object but got ${JSON.stringify(
              value
            )}.`
          );
          isValid22 = false;
        } else if (!hasProperty(value, "bindings")) {
          diagnostics.errors.push(
            `The field "${fieldPath}" is missing the required "bindings" property.`
          );
          isValid22 = false;
        } else if (!Array.isArray(value.bindings)) {
          diagnostics.errors.push(
            `The field "${fieldPath}.bindings" should be an array but got ${JSON.stringify(
              value.bindings
            )}.`
          );
          isValid22 = false;
        } else {
          for (let i7 = 0; i7 < value.bindings.length; i7++) {
            const binding = value.bindings[i7];
            const bindingDiagnostics = new Diagnostics(
              `"${fieldPath}.bindings[${i7}]": ${JSON.stringify(binding)}`
            );
            isValid22 = validateBinding(
              bindingDiagnostics,
              `${fieldPath}.bindings[${i7}]`,
              binding,
              config
            ) && isValid22;
            diagnostics.addChild(bindingDiagnostics);
          }
        }
        const configBindingNames = getBindingNames(
          config?.[field]
        );
        if (isValid22 && configBindingNames.length > 0) {
          const envBindingNames = new Set(getBindingNames(value));
          const missingBindings = configBindingNames.filter(
            (name2) => !envBindingNames.has(name2)
          );
          if (missingBindings.length > 0) {
            diagnostics.warnings.push(
              `The following bindings are at the top level, but not on "env.${envName}".
This is not what you probably want, since "${field}" configuration is not inherited by environments.
Please add a binding for each to "${fieldPath}.bindings":
` + missingBindings.map((name2) => `- ${name2}`).join("\n")
            );
          }
        }
      }
      return isValid22;
    }, "validateBindingsProperty");
    validateUnsafeSettings = /* @__PURE__ */ __name2((envName) => (diagnostics, field, value, config) => {
      const fieldPath = config === void 0 ? `${field}` : `env.${envName}.${field}`;
      if (typeof value !== "object" || value === null || Array.isArray(value)) {
        diagnostics.errors.push(
          `The field "${fieldPath}" should be an object but got ${JSON.stringify(
            value
          )}.`
        );
        return false;
      }
      if (hasProperty(value, "bindings") && value.bindings !== void 0) {
        const validateBindingsFn = validateBindingsProperty(
          envName,
          validateUnsafeBinding
        );
        const valid = validateBindingsFn(diagnostics, field, value, config);
        if (!valid) {
          return false;
        }
      }
      if (hasProperty(value, "metadata") && value.metadata !== void 0 && (typeof value.metadata !== "object" || value.metadata === null || Array.isArray(value.metadata))) {
        diagnostics.errors.push(
          `The field "${fieldPath}.metadata" should be an object but got ${JSON.stringify(
            value.metadata
          )}.`
        );
        return false;
      }
      if (hasProperty(value, "capnp") && value.capnp !== void 0) {
        if (typeof value.capnp !== "object" || value.capnp === null || Array.isArray(value.capnp)) {
          diagnostics.errors.push(
            `The field "${fieldPath}.capnp" should be an object but got ${JSON.stringify(
              value.capnp
            )}.`
          );
          return false;
        }
        if (hasProperty(value.capnp, "compiled_schema")) {
          if (hasProperty(value.capnp, "base_path") || hasProperty(value.capnp, "source_schemas")) {
            diagnostics.errors.push(
              `The field "${fieldPath}.capnp" cannot contain both "compiled_schema" and one of "base_path" or "source_schemas".`
            );
            return false;
          }
          if (typeof value.capnp.compiled_schema !== "string") {
            diagnostics.errors.push(
              `The field "${fieldPath}.capnp.compiled_schema", when present, should be a string but got ${JSON.stringify(
                value.capnp.compiled_schema
              )}.`
            );
            return false;
          }
        } else {
          if (!isRequiredProperty(value.capnp, "base_path", "string")) {
            diagnostics.errors.push(
              `The field "${fieldPath}.capnp.base_path", when present, should be a string but got ${JSON.stringify(
                value.capnp.base_path
              )}`
            );
          }
          if (!validateTypedArray(
            diagnostics,
            `${fieldPath}.capnp.source_schemas`,
            value.capnp.source_schemas,
            "string"
          )) {
            return false;
          }
        }
      }
      validateAdditionalProperties(diagnostics, field, Object.keys(value), [
        "bindings",
        "metadata",
        "capnp"
      ]);
      return true;
    }, "validateUnsafeSettings");
    validateDurableObjectBinding = /* @__PURE__ */ __name2((diagnostics, field, value) => {
      if (typeof value !== "object" || value === null) {
        diagnostics.errors.push(
          `Expected "${field}" to be an object but got ${JSON.stringify(value)}`
        );
        return false;
      }
      let isValid22 = true;
      if (!isRequiredProperty(value, "name", "string")) {
        diagnostics.errors.push(`binding should have a string "name" field.`);
        isValid22 = false;
      }
      if (!isRequiredProperty(value, "class_name", "string")) {
        diagnostics.errors.push(`binding should have a string "class_name" field.`);
        isValid22 = false;
      }
      if (!isOptionalProperty(value, "script_name", "string")) {
        diagnostics.errors.push(
          `the field "script_name", when present, should be a string.`
        );
        isValid22 = false;
      }
      if (!isOptionalProperty(value, "environment", "string")) {
        diagnostics.errors.push(
          `the field "environment", when present, should be a string.`
        );
        isValid22 = false;
      }
      if ("environment" in value && !("script_name" in value)) {
        diagnostics.errors.push(
          `binding should have a "script_name" field if "environment" is present.`
        );
        isValid22 = false;
      }
      if (!isRemoteValid(value, field, diagnostics)) {
        isValid22 = false;
      }
      validateAdditionalProperties(diagnostics, field, Object.keys(value), [
        "class_name",
        "environment",
        "name",
        "script_name"
      ]);
      return isValid22;
    }, "validateDurableObjectBinding");
    workflowNameFormatMessage = `Workflow names must be 1-64 characters long, start with a letter, number, or underscore, and may only contain letters, numbers, underscores, or hyphens.`;
    validateWorkflowBinding = /* @__PURE__ */ __name2((diagnostics, field, value) => {
      if (typeof value !== "object" || value === null) {
        diagnostics.errors.push(
          `"workflows" bindings should be objects, but got ${JSON.stringify(value)}`
        );
        return false;
      }
      let isValid22 = true;
      if (!isRequiredProperty(value, "binding", "string")) {
        diagnostics.errors.push(
          `"${field}" bindings should have a string "binding" field but got ${JSON.stringify(
            value
          )}.`
        );
        isValid22 = false;
      }
      if (!isRequiredProperty(value, "name", "string")) {
        diagnostics.errors.push(
          `"${field}" bindings should have a string "name" field but got ${JSON.stringify(
            value
          )}.`
        );
        isValid22 = false;
      } else if (!isValidWorkflowName(value.name)) {
        diagnostics.errors.push(
          `"${field}" binding "name" field is invalid. ${workflowNameFormatMessage}`
        );
        isValid22 = false;
      }
      if (!isRequiredProperty(value, "class_name", "string")) {
        diagnostics.errors.push(
          `"${field}" bindings should have a string "class_name" field but got ${JSON.stringify(
            value
          )}.`
        );
        isValid22 = false;
      }
      if (!isOptionalProperty(value, "script_name", "string")) {
        diagnostics.errors.push(
          `"${field}" bindings should, optionally, have a string "script_name" field but got ${JSON.stringify(
            value
          )}.`
        );
        isValid22 = false;
      }
      if (!isOptionalProperty(value, "remote", "boolean")) {
        diagnostics.errors.push(
          `"${field}" bindings should, optionally, have a boolean "remote" field but got ${JSON.stringify(
            value
          )}.`
        );
        isValid22 = false;
      }
      if (hasProperty(value, "limits") && value.limits !== void 0) {
        if (typeof value.limits !== "object" || value.limits === null || Array.isArray(value.limits)) {
          diagnostics.errors.push(
            `"${field}" bindings should, optionally, have an object "limits" field but got ${JSON.stringify(
              value
            )}.`
          );
          isValid22 = false;
        } else {
          const limits = value.limits;
          if (limits.steps !== void 0) {
            if (typeof limits.steps !== "number" || !Number.isInteger(limits.steps) || limits.steps < 1) {
              diagnostics.errors.push(
                `"${field}" bindings "limits.steps" field must be a positive integer but got ${JSON.stringify(
                  limits.steps
                )}.`
              );
              isValid22 = false;
            } else if (limits.steps > 25e3) {
              diagnostics.warnings.push(
                `"${field}" has a step limit of ${limits.steps}, which exceeds the production maximum of 25,000. This configuration may not work when deployed.`
              );
            }
          }
          validateAdditionalProperties(
            diagnostics,
            `${field}.limits`,
            Object.keys(limits),
            ["steps"]
          );
        }
      }
      validateAdditionalProperties(diagnostics, field, Object.keys(value), [
        "binding",
        "name",
        "class_name",
        "script_name",
        "remote",
        "limits"
      ]);
      return isValid22;
    }, "validateWorkflowBinding");
    validateCflogfwdrObject = /* @__PURE__ */ __name2((envName) => (diagnostics, field, value, topLevelEnv) => {
      const bindingsValidation = validateBindingsProperty(
        envName,
        validateCflogfwdrBinding
      );
      if (!bindingsValidation(diagnostics, field, value, topLevelEnv)) {
        return false;
      }
      const v8 = value;
      if (v8?.schema !== void 0) {
        diagnostics.errors.push(
          `"${field}" binding "schema" property has been replaced with the "unsafe.capnp" object, which expects a "base_path" and an array of "source_schemas" to compile, or a "compiled_schema" property.`
        );
        return false;
      }
      return true;
    }, "validateCflogfwdrObject");
    validateCflogfwdrBinding = /* @__PURE__ */ __name2((diagnostics, field, value) => {
      if (typeof value !== "object" || value === null) {
        diagnostics.errors.push(
          `Expected "${field}" to be an object but got ${JSON.stringify(value)}`
        );
        return false;
      }
      let isValid22 = true;
      if (!isRequiredProperty(value, "name", "string")) {
        diagnostics.errors.push(`binding should have a string "name" field.`);
        isValid22 = false;
      }
      if (!isRequiredProperty(value, "destination", "string")) {
        diagnostics.errors.push(
          `binding should have a string "destination" field.`
        );
        isValid22 = false;
      }
      validateAdditionalProperties(diagnostics, field, Object.keys(value), [
        "destination",
        "name"
      ]);
      return isValid22;
    }, "validateCflogfwdrBinding");
    validateAssetsConfig = /* @__PURE__ */ __name2((diagnostics, field, value) => {
      if (value === void 0) {
        return true;
      }
      if (typeof value !== "object" || value === null) {
        diagnostics.errors.push(
          `"${field}" should be an object, but got value ${JSON.stringify(
            field
          )} of type ${typeof value}`
        );
        return false;
      }
      let isValid22 = true;
      isValid22 = validateOptionalProperty(
        diagnostics,
        field,
        "directory",
        value.directory,
        "string"
      ) && isValid22;
      isValid22 = validateOptionalProperty(
        diagnostics,
        field,
        "binding",
        value.binding,
        "string"
      ) && isValid22;
      isValid22 = validateOptionalProperty(
        diagnostics,
        field,
        "html_handling",
        value.html_handling,
        "string",
        [
          "auto-trailing-slash",
          "force-trailing-slash",
          "drop-trailing-slash",
          "none"
        ]
      ) && isValid22;
      isValid22 = validateOptionalProperty(
        diagnostics,
        field,
        "not_found_handling",
        value.not_found_handling,
        "string",
        ["single-page-application", "404-page", "none"]
      ) && isValid22;
      if (value.run_worker_first !== void 0) {
        if (typeof value.run_worker_first === "boolean") {
          isValid22 = validateOptionalProperty(
            diagnostics,
            field,
            "run_worker_first",
            value.run_worker_first,
            "boolean"
          ) && isValid22;
        } else if (Array.isArray(value.run_worker_first)) {
          isValid22 = validateOptionalTypedArray(
            diagnostics,
            "assets.run_worker_first",
            value.run_worker_first,
            "string"
          ) && isValid22;
        } else {
          diagnostics.errors.push(
            `The field "${field}.run_worker_first" should be an array of strings or a boolean, but got ${JSON.stringify(
              value.run_worker_first
            )}.`
          );
          isValid22 = false;
        }
      }
      isValid22 = validateAdditionalProperties(diagnostics, field, Object.keys(value), [
        "directory",
        "binding",
        "html_handling",
        "not_found_handling",
        "run_worker_first"
      ]) && isValid22;
      return isValid22;
    }, "validateAssetsConfig");
    validateNamedSimpleBinding = /* @__PURE__ */ __name2((envName) => (diagnostics, field, value, config) => {
      const fieldPath = config === void 0 ? `${field}` : `env.${envName}.${field}`;
      if (typeof value !== "object" || value === null || Array.isArray(value)) {
        diagnostics.errors.push(
          `The field "${fieldPath}" should be an object but got ${JSON.stringify(
            value
          )}.`
        );
        return false;
      }
      let isValid22 = true;
      if (!isRequiredProperty(value, "binding", "string")) {
        diagnostics.errors.push(`binding should have a string "binding" field.`);
        isValid22 = false;
      }
      if (!isRemoteValid(value, field, diagnostics)) {
        isValid22 = false;
      }
      validateAdditionalProperties(diagnostics, field, Object.keys(value), [
        "binding",
        "remote"
      ]);
      return isValid22;
    }, "validateNamedSimpleBinding");
    validateAIBinding = /* @__PURE__ */ __name2((envName) => (diagnostics, field, value, config) => {
      const fieldPath = config === void 0 ? `${field}` : `env.${envName}.${field}`;
      if (typeof value !== "object" || value === null || Array.isArray(value)) {
        diagnostics.errors.push(
          `The field "${fieldPath}" should be an object but got ${JSON.stringify(
            value
          )}.`
        );
        return false;
      }
      let isValid22 = true;
      if (!isRequiredProperty(value, "binding", "string")) {
        diagnostics.errors.push(`binding should have a string "binding" field.`);
        isValid22 = false;
      }
      if (!isRemoteValid(value, field, diagnostics)) {
        isValid22 = false;
      }
      return isValid22;
    }, "validateAIBinding");
    validateVersionMetadataBinding = /* @__PURE__ */ __name2((envName) => (diagnostics, field, value, config) => {
      const fieldPath = config === void 0 ? `${field}` : `env.${envName}.${field}`;
      if (typeof value !== "object" || value === null || Array.isArray(value)) {
        diagnostics.errors.push(
          `The field "${fieldPath}" should be an object but got ${JSON.stringify(
            value
          )}.`
        );
        return false;
      }
      let isValid22 = true;
      if (!isRequiredProperty(value, "binding", "string")) {
        diagnostics.errors.push(`binding should have a string "binding" field.`);
        isValid22 = false;
      }
      return isValid22;
    }, "validateVersionMetadataBinding");
    validateUnsafeBinding = /* @__PURE__ */ __name2((diagnostics, field, value) => {
      if (typeof value !== "object" || value === null) {
        diagnostics.errors.push(
          `Expected ${field} to be an object but got ${JSON.stringify(value)}.`
        );
        return false;
      }
      let isValid22 = true;
      if (!isRequiredProperty(value, "name", "string")) {
        diagnostics.errors.push(`binding should have a string "name" field.`);
        isValid22 = false;
      }
      if (isRequiredProperty(value, "type", "string")) {
        const safeBindings = [
          "plain_text",
          "secret_text",
          "json",
          "wasm_module",
          "data_blob",
          "text_blob",
          "browser",
          "ai",
          "ai_search_namespace",
          "ai_search",
          "kv_namespace",
          "durable_object_namespace",
          "d1_database",
          "r2_bucket",
          "service",
          "logfwdr",
          "mtls_certificate",
          "pipeline",
          "worker_loader",
          "vpc_service",
          "flagship",
          "vpc_network",
          "stream",
          "media"
        ];
        if (safeBindings.includes(value.type)) {
          diagnostics.warnings.push(
            `The binding type "${value.type}" is directly supported by wrangler.
Consider migrating this unsafe binding to a format for '${value.type}' bindings that is supported by wrangler for optimal support.
For more details, see https://developers.cloudflare.com/workers/cli-wrangler/configuration`
          );
        }
        if (value.type === "metadata" && isRequiredProperty(value, "name", "string")) {
          diagnostics.warnings.push(
            "The deployment object in the metadata binding is now deprecated. Please switch using the version_metadata binding for access to version specific fields: https://developers.cloudflare.com/workers/runtime-apis/bindings/version-metadata"
          );
        }
      } else {
        diagnostics.errors.push(`binding should have a string "type" field.`);
        isValid22 = false;
      }
      return isValid22;
    }, "validateUnsafeBinding");
    validateBindingArray = /* @__PURE__ */ __name2((envName, validateBinding) => (diagnostics, field, envValue, config) => {
      if (envValue === void 0) {
        return true;
      }
      const fieldPath = config === void 0 ? `${field}` : `env.${envName}.${field}`;
      if (!Array.isArray(envValue)) {
        diagnostics.errors.push(
          `The field "${fieldPath}" should be an array but got ${JSON.stringify(
            envValue
          )}.`
        );
        return false;
      }
      let isValid22 = true;
      for (let i7 = 0; i7 < envValue.length; i7++) {
        isValid22 = validateBinding(
          diagnostics,
          `${fieldPath}[${i7}]`,
          envValue[i7],
          config
        ) && isValid22;
      }
      const configValue = config?.[field];
      if (Array.isArray(configValue)) {
        const configBindingNames = configValue.map((value) => value.binding);
        if (configBindingNames.length > 0) {
          const envBindingNames = new Set(envValue.map((value) => value.binding));
          for (const configBindingName of configBindingNames) {
            if (!envBindingNames.has(configBindingName)) {
              diagnostics.warnings.push(
                `There is a ${field} binding with name "${configBindingName}" at the top level, but not on "env.${envName}".
This is not what you probably want, since "${field}" configuration is not inherited by environments.
Please add a binding for "${configBindingName}" to "env.${envName}.${field}.bindings".`
              );
            }
          }
        }
      }
      return isValid22;
    }, "validateBindingArray");
    __name(validateContainerApp, "validateContainerApp");
    __name2(validateContainerApp, "validateContainerApp");
    validateCloudchamberConfig = /* @__PURE__ */ __name2((diagnostics, field, value) => {
      if (typeof value !== "object" || value === null || Array.isArray(value)) {
        diagnostics.errors.push(
          `"cloudchamber" should be an object, but got ${JSON.stringify(value)}`
        );
        return false;
      }
      const optionalAttrsByType = {
        string: ["memory", "image", "location"],
        boolean: ["ipv4"],
        number: ["vcpu"]
      };
      let isValid22 = true;
      Object.entries(optionalAttrsByType).forEach(([attrType, attrNames]) => {
        attrNames.forEach((key) => {
          if (!isOptionalProperty(value, key, attrType)) {
            diagnostics.errors.push(
              `"${field}" bindings should, optionally, have a ${attrType} "${key}" field but got ${JSON.stringify(
                value
              )}.`
            );
            isValid22 = false;
          }
        });
      });
      if ("instance_type" in value && value.instance_type !== void 0) {
        if (typeof value.instance_type !== "string" || !ALLOWED_INSTANCE_TYPES.includes(value.instance_type)) {
          diagnostics.errors.push(
            `"instance_type" should be one of 'lite', 'basic', 'standard-1', 'standard-2', 'standard-3', or 'standard-4', but got ${value.instance_type}`
          );
        }
        if ("memory" in value && value.memory !== void 0 || "vcpu" in value && value.vcpu !== void 0) {
          diagnostics.errors.push(
            `"${field}" configuration should not set either "memory" or "vcpu" with "instance_type"`
          );
        }
      }
      return isValid22;
    }, "validateCloudchamberConfig");
    validateKVBinding = /* @__PURE__ */ __name2((diagnostics, field, value) => {
      if (typeof value !== "object" || value === null) {
        diagnostics.errors.push(
          `"kv_namespaces" bindings should be objects, but got ${JSON.stringify(
            value
          )}`
        );
        return false;
      }
      let isValid22 = true;
      if (!isRequiredProperty(value, "binding", "string")) {
        diagnostics.errors.push(
          `"${field}" bindings should have a string "binding" field but got ${JSON.stringify(
            value
          )}.`
        );
        isValid22 = false;
      }
      if (!isOptionalProperty(value, "id", "string") || value.id !== void 0 && value.id.length === 0) {
        diagnostics.errors.push(
          `"${field}" bindings should have a string "id" field but got ${JSON.stringify(
            value
          )}.`
        );
        isValid22 = false;
      }
      if (!isOptionalProperty(value, "preview_id", "string")) {
        diagnostics.errors.push(
          `"${field}" bindings should, optionally, have a string "preview_id" field but got ${JSON.stringify(
            value
          )}.`
        );
        isValid22 = false;
      }
      if (!isRemoteValid(value, field, diagnostics)) {
        isValid22 = false;
      }
      validateAdditionalProperties(diagnostics, field, Object.keys(value), [
        "binding",
        "id",
        "preview_id",
        "remote"
      ]);
      return isValid22;
    }, "validateKVBinding");
    validateSendEmailBinding = /* @__PURE__ */ __name2((diagnostics, field, value) => {
      if (typeof value !== "object" || value === null) {
        diagnostics.errors.push(
          `"send_email" bindings should be objects, but got ${JSON.stringify(
            value
          )}`
        );
        return false;
      }
      let isValid22 = true;
      if (!isRequiredProperty(value, "name", "string")) {
        diagnostics.errors.push(
          `"${field}" bindings should have a string "name" field but got ${JSON.stringify(
            value
          )}.`
        );
        isValid22 = false;
      }
      if (!isOptionalProperty(value, "destination_address", "string")) {
        diagnostics.errors.push(
          `"${field}" bindings should, optionally, have a string "destination_address" field but got ${JSON.stringify(
            value
          )}.`
        );
        isValid22 = false;
      }
      if (!isOptionalProperty(value, "allowed_destination_addresses", "object")) {
        diagnostics.errors.push(
          `"${field}" bindings should, optionally, have a []string "allowed_destination_addresses" field but got ${JSON.stringify(
            value
          )}.`
        );
        isValid22 = false;
      }
      if (!isOptionalProperty(value, "allowed_sender_addresses", "object")) {
        diagnostics.errors.push(
          `"${field}" bindings should, optionally, have a []string "allowed_sender_addresses" field but got ${JSON.stringify(
            value
          )}.`
        );
        isValid22 = false;
      }
      if ("destination_address" in value && "allowed_destination_addresses" in value) {
        diagnostics.errors.push(
          `"${field}" bindings should have either a "destination_address" or "allowed_destination_addresses" field, but not both.`
        );
        isValid22 = false;
      }
      if (!isRemoteValid(value, field, diagnostics)) {
        isValid22 = false;
      }
      validateAdditionalProperties(diagnostics, field, Object.keys(value), [
        "allowed_sender_addresses",
        "allowed_destination_addresses",
        "destination_address",
        "name",
        "binding",
        "remote"
      ]);
      return isValid22;
    }, "validateSendEmailBinding");
    validateQueueBinding = /* @__PURE__ */ __name2((diagnostics, field, value) => {
      if (typeof value !== "object" || value === null) {
        diagnostics.errors.push(
          `"queue" bindings should be objects, but got ${JSON.stringify(value)}`
        );
        return false;
      }
      if (!validateAdditionalProperties(diagnostics, field, Object.keys(value), [
        "binding",
        "queue",
        "delivery_delay",
        "remote"
      ])) {
        return false;
      }
      let isValid22 = true;
      if (!isRequiredProperty(value, "binding", "string")) {
        diagnostics.errors.push(
          `"${field}" bindings should have a string "binding" field but got ${JSON.stringify(
            value
          )}.`
        );
        isValid22 = false;
      }
      if (!isRequiredProperty(value, "queue", "string") || value.queue.length === 0) {
        diagnostics.errors.push(
          `"${field}" bindings should have a string "queue" field but got ${JSON.stringify(
            value
          )}.`
        );
        isValid22 = false;
      }
      const options = [{ key: "delivery_delay", type: "number" }];
      for (const optionalOpt of options) {
        if (!isOptionalProperty(value, optionalOpt.key, optionalOpt.type)) {
          diagnostics.errors.push(
            `"${field}" should, optionally, have a ${optionalOpt.type} "${optionalOpt.key}" field but got ${JSON.stringify(value)}.`
          );
          isValid22 = false;
        }
      }
      if (!isRemoteValid(value, field, diagnostics)) {
        isValid22 = false;
      }
      return isValid22;
    }, "validateQueueBinding");
    validateR2Binding = /* @__PURE__ */ __name2((diagnostics, field, value) => {
      if (typeof value !== "object" || value === null) {
        diagnostics.errors.push(
          `"r2_buckets" bindings should be objects, but got ${JSON.stringify(
            value
          )}`
        );
        return false;
      }
      let isValid22 = true;
      if (!isRequiredProperty(value, "binding", "string")) {
        diagnostics.errors.push(
          `"${field}" bindings should have a string "binding" field but got ${JSON.stringify(
            value
          )}.`
        );
        isValid22 = false;
      }
      if (!isOptionalProperty(value, "bucket_name", "string") || value.bucket_name !== void 0 && value.bucket_name.length === 0) {
        diagnostics.errors.push(
          `"${field}" bindings should have a string "bucket_name" field but got ${JSON.stringify(
            value
          )}.`
        );
        isValid22 = false;
      }
      if (isValid22 && hasProperty(value, "bucket_name") && !isValidR2BucketName(value.bucket_name)) {
        diagnostics.errors.push(
          `${field}.bucket_name=${JSON.stringify(value.bucket_name)} is invalid. ${bucketFormatMessage}`
        );
        isValid22 = false;
      }
      if (!isOptionalProperty(value, "preview_bucket_name", "string")) {
        diagnostics.errors.push(
          `"${field}" bindings should, optionally, have a string "preview_bucket_name" field but got ${JSON.stringify(
            value
          )}.`
        );
        isValid22 = false;
      }
      if (isValid22 && hasProperty(value, "preview_bucket_name") && !isValidR2BucketName(value.preview_bucket_name)) {
        diagnostics.errors.push(
          `${field}.preview_bucket_name= ${JSON.stringify(value.preview_bucket_name)} is invalid. ${bucketFormatMessage}`
        );
        isValid22 = false;
      }
      if (!isOptionalProperty(value, "jurisdiction", "string")) {
        diagnostics.errors.push(
          `"${field}" bindings should, optionally, have a string "jurisdiction" field but got ${JSON.stringify(
            value
          )}.`
        );
        isValid22 = false;
      }
      if (!isRemoteValid(value, field, diagnostics)) {
        isValid22 = false;
      }
      validateAdditionalProperties(diagnostics, field, Object.keys(value), [
        "binding",
        "bucket_name",
        "preview_bucket_name",
        "jurisdiction",
        "remote"
      ]);
      return isValid22;
    }, "validateR2Binding");
    validateD1Binding = /* @__PURE__ */ __name2((diagnostics, field, value) => {
      if (typeof value !== "object" || value === null) {
        diagnostics.errors.push(
          `"d1_databases" bindings should be objects, but got ${JSON.stringify(
            value
          )}`
        );
        return false;
      }
      let isValid22 = true;
      if (!isRequiredProperty(value, "binding", "string")) {
        diagnostics.errors.push(
          `"${field}" bindings should have a string "binding" field but got ${JSON.stringify(
            value
          )}.`
        );
        isValid22 = false;
      }
      if (!isOptionalProperty(value, "database_id", "string")) {
        diagnostics.errors.push(
          `"${field}" bindings must have a "database_id" field but got ${JSON.stringify(
            value
          )}.`
        );
        isValid22 = false;
      }
      if (!isOptionalProperty(value, "preview_database_id", "string")) {
        diagnostics.errors.push(
          `"${field}" bindings should, optionally, have a string "preview_database_id" field but got ${JSON.stringify(
            value
          )}.`
        );
        isValid22 = false;
      }
      if (!isRemoteValid(value, field, diagnostics)) {
        isValid22 = false;
      }
      validateAdditionalProperties(diagnostics, field, Object.keys(value), [
        "binding",
        "database_id",
        "database_internal_env",
        "database_name",
        "migrations_dir",
        "migrations_table",
        "preview_database_id",
        "remote"
      ]);
      return isValid22;
    }, "validateD1Binding");
    validateVectorizeBinding = /* @__PURE__ */ __name2((diagnostics, field, value) => {
      if (typeof value !== "object" || value === null) {
        diagnostics.errors.push(
          `"vectorize" bindings should be objects, but got ${JSON.stringify(value)}`
        );
        return false;
      }
      let isValid22 = true;
      if (!isRequiredProperty(value, "binding", "string")) {
        diagnostics.errors.push(
          `"${field}" bindings should have a string "binding" field but got ${JSON.stringify(
            value
          )}.`
        );
        isValid22 = false;
      }
      if (!isRequiredProperty(value, "index_name", "string")) {
        diagnostics.errors.push(
          `"${field}" bindings must have an "index_name" field but got ${JSON.stringify(
            value
          )}.`
        );
        isValid22 = false;
      }
      if (!isRemoteValid(value, field, diagnostics)) {
        isValid22 = false;
      }
      validateAdditionalProperties(diagnostics, field, Object.keys(value), [
        "binding",
        "index_name",
        "remote"
      ]);
      return isValid22;
    }, "validateVectorizeBinding");
    validateAISearchNamespaceBinding = /* @__PURE__ */ __name2((diagnostics, field, value) => {
      if (typeof value !== "object" || value === null) {
        diagnostics.errors.push(
          `"ai_search_namespaces" bindings should be objects, but got ${JSON.stringify(value)}`
        );
        return false;
      }
      let isValid22 = true;
      if (!isRequiredProperty(value, "binding", "string")) {
        diagnostics.errors.push(
          `"${field}" bindings should have a string "binding" field but got ${JSON.stringify(value)}.`
        );
        isValid22 = false;
      }
      if (!isRequiredProperty(value, "namespace", "string")) {
        diagnostics.errors.push(
          `"${field}" bindings must have a "namespace" field but got ${JSON.stringify(value)}.`
        );
        isValid22 = false;
      }
      if (!isRemoteValid(value, field, diagnostics)) {
        isValid22 = false;
      }
      validateAdditionalProperties(diagnostics, field, Object.keys(value), [
        "binding",
        "namespace",
        "remote"
      ]);
      return isValid22;
    }, "validateAISearchNamespaceBinding");
    validateAISearchBinding = /* @__PURE__ */ __name2((diagnostics, field, value) => {
      if (typeof value !== "object" || value === null) {
        diagnostics.errors.push(
          `"ai_search" bindings should be objects, but got ${JSON.stringify(value)}`
        );
        return false;
      }
      let isValid22 = true;
      if (!isRequiredProperty(value, "binding", "string")) {
        diagnostics.errors.push(
          `"${field}" bindings should have a string "binding" field but got ${JSON.stringify(value)}.`
        );
        isValid22 = false;
      }
      if (!isRequiredProperty(value, "instance_name", "string")) {
        diagnostics.errors.push(
          `"${field}" bindings must have an "instance_name" field but got ${JSON.stringify(value)}.`
        );
        isValid22 = false;
      }
      if (!isRemoteValid(value, field, diagnostics)) {
        isValid22 = false;
      }
      validateAdditionalProperties(diagnostics, field, Object.keys(value), [
        "binding",
        "instance_name",
        "remote"
      ]);
      return isValid22;
    }, "validateAISearchBinding");
    validateHyperdriveBinding = /* @__PURE__ */ __name2((diagnostics, field, value) => {
      if (typeof value !== "object" || value === null) {
        diagnostics.errors.push(
          `"hyperdrive" bindings should be objects, but got ${JSON.stringify(
            value
          )}`
        );
        return false;
      }
      let isValid22 = true;
      if (!isRequiredProperty(value, "binding", "string")) {
        diagnostics.errors.push(
          `"${field}" bindings should have a string "binding" field but got ${JSON.stringify(
            value
          )}.`
        );
        isValid22 = false;
      }
      if (!isRequiredProperty(value, "id", "string")) {
        diagnostics.errors.push(
          `"${field}" bindings must have a "id" field but got ${JSON.stringify(
            value
          )}.`
        );
        isValid22 = false;
      }
      validateAdditionalProperties(diagnostics, field, Object.keys(value), [
        "binding",
        "id",
        "localConnectionString"
      ]);
      return isValid22;
    }, "validateHyperdriveBinding");
    validateVpcServiceBinding = /* @__PURE__ */ __name2((diagnostics, field, value) => {
      if (typeof value !== "object" || value === null) {
        diagnostics.errors.push(
          `"vpc_services" bindings should be objects, but got ${JSON.stringify(
            value
          )}`
        );
        return false;
      }
      let isValid22 = true;
      if (!isRequiredProperty(value, "binding", "string")) {
        diagnostics.errors.push(
          `"${field}" bindings should have a string "binding" field but got ${JSON.stringify(
            value
          )}.`
        );
        isValid22 = false;
      }
      if (!isRequiredProperty(value, "service_id", "string")) {
        diagnostics.errors.push(
          `"${field}" bindings must have a "service_id" field but got ${JSON.stringify(
            value
          )}.`
        );
        isValid22 = false;
      }
      validateAdditionalProperties(diagnostics, field, Object.keys(value), [
        "binding",
        "service_id",
        "remote"
      ]);
      return isValid22;
    }, "validateVpcServiceBinding");
    validateVpcNetworkBinding = /* @__PURE__ */ __name2((diagnostics, field, value) => {
      if (typeof value !== "object" || value === null) {
        diagnostics.errors.push(
          `"vpc_networks" bindings should be objects, but got ${JSON.stringify(
            value
          )}`
        );
        return false;
      }
      let isValid22 = true;
      if (!isRequiredProperty(value, "binding", "string")) {
        diagnostics.errors.push(
          `"${field}" bindings should have a string "binding" field but got ${JSON.stringify(
            value
          )}.`
        );
        isValid22 = false;
      }
      const hasTunnelId = hasProperty(value, "tunnel_id");
      const hasNetworkId = hasProperty(value, "network_id");
      if (hasTunnelId && hasNetworkId) {
        diagnostics.errors.push(
          `"${field}" bindings must have either a "tunnel_id" or "network_id", but not both.`
        );
        isValid22 = false;
      } else if (!hasTunnelId && !hasNetworkId) {
        diagnostics.errors.push(
          `"${field}" bindings must have either a "tunnel_id" or "network_id" field but got ${JSON.stringify(
            value
          )}.`
        );
        isValid22 = false;
      } else if (hasTunnelId && typeof value.tunnel_id !== "string") {
        diagnostics.errors.push(
          `"${field}" bindings must have a string "tunnel_id" field but got ${JSON.stringify(
            value
          )}.`
        );
        isValid22 = false;
      } else if (hasNetworkId && typeof value.network_id !== "string") {
        diagnostics.errors.push(
          `"${field}" bindings must have a string "network_id" field but got ${JSON.stringify(
            value
          )}.`
        );
        isValid22 = false;
      }
      validateAdditionalProperties(diagnostics, field, Object.keys(value), [
        "binding",
        "tunnel_id",
        "network_id",
        "remote"
      ]);
      return isValid22;
    }, "validateVpcNetworkBinding");
    validateBindingsHaveUniqueNames = /* @__PURE__ */ __name2((diagnostics, config) => {
      let hasDuplicates = false;
      const bindingNamesArray = Object.entries(friendlyBindingNames);
      const bindingsGroupedByType = Object.fromEntries(
        bindingNamesArray.map(([bindingType, binding]) => [
          binding,
          getBindingNames(
            bindingType === "queues" ? config[bindingType]?.producers : config[bindingType]
          )
        ])
      );
      bindingsGroupedByType["Secret"] = config.secrets?.required ?? [];
      const bindingsGroupedByName = {};
      for (const bindingType in bindingsGroupedByType) {
        const bindingNames = bindingsGroupedByType[bindingType];
        for (const bindingName of bindingNames) {
          if (!(bindingName in bindingsGroupedByName)) {
            bindingsGroupedByName[bindingName] = [];
          }
          if (bindingName === "ASSETS" && isPagesConfig(config)) {
            diagnostics.errors.push(
              `The name 'ASSETS' is reserved in Pages projects. Please use a different name for your ${bindingType} binding.`
            );
          }
          bindingsGroupedByName[bindingName].push(bindingType);
        }
      }
      for (const bindingName in bindingsGroupedByName) {
        const bindingTypes = bindingsGroupedByName[bindingName];
        if (bindingTypes.length < 2) {
          continue;
        }
        hasDuplicates = true;
        const sameType = bindingTypes.filter((type, i7) => bindingTypes.indexOf(type) !== i7).filter(
          (type, i7, duplicateBindingTypes) => duplicateBindingTypes.indexOf(type) === i7
        );
        const differentTypes = bindingTypes.filter(
          (type, i7) => bindingTypes.indexOf(type) === i7
        );
        if (differentTypes.length > 1) {
          diagnostics.errors.push(
            `${bindingName} assigned to ${ENGLISH.format(differentTypes)} bindings.`
          );
        }
        sameType.forEach((bindingType) => {
          diagnostics.errors.push(
            `${bindingName} assigned to multiple ${bindingType} bindings.`
          );
        });
      }
      if (hasDuplicates) {
        const problem = "Bindings must have unique names, so that they can all be referenced in the worker.";
        const resolution = "Please change your bindings to have unique names.";
        diagnostics.errors.push(`${problem}
${resolution}`);
      }
      return !hasDuplicates;
    }, "validateBindingsHaveUniqueNames");
    validateServiceBinding = /* @__PURE__ */ __name2((diagnostics, field, value) => {
      if (typeof value !== "object" || value === null) {
        diagnostics.errors.push(
          `"services" bindings should be objects, but got ${JSON.stringify(value)}`
        );
        return false;
      }
      let isValid22 = true;
      if (!isRequiredProperty(value, "binding", "string")) {
        diagnostics.errors.push(
          `"${field}" bindings should have a string "binding" field but got ${JSON.stringify(
            value
          )}.`
        );
        isValid22 = false;
      }
      if (!isRequiredProperty(value, "service", "string")) {
        diagnostics.errors.push(
          `"${field}" bindings should have a string "service" field but got ${JSON.stringify(
            value
          )}.`
        );
        isValid22 = false;
      }
      if (!isOptionalProperty(value, "environment", "string")) {
        diagnostics.errors.push(
          `"${field}" bindings should have a string "environment" field but got ${JSON.stringify(
            value
          )}.`
        );
        isValid22 = false;
      }
      if (!isOptionalProperty(value, "entrypoint", "string")) {
        diagnostics.errors.push(
          `"${field}" bindings should have a string "entrypoint" field but got ${JSON.stringify(
            value
          )}.`
        );
        isValid22 = false;
      }
      if (!isRemoteValid(value, field, diagnostics)) {
        isValid22 = false;
      }
      return isValid22;
    }, "validateServiceBinding");
    validateAnalyticsEngineBinding = /* @__PURE__ */ __name2((diagnostics, field, value) => {
      if (typeof value !== "object" || value === null) {
        diagnostics.errors.push(
          `"analytics_engine" bindings should be objects, but got ${JSON.stringify(
            value
          )}`
        );
        return false;
      }
      let isValid22 = true;
      if (!isRequiredProperty(value, "binding", "string")) {
        diagnostics.errors.push(
          `"${field}" bindings should have a string "binding" field but got ${JSON.stringify(
            value
          )}.`
        );
        isValid22 = false;
      }
      if (!isOptionalProperty(value, "dataset", "string") || value.dataset?.length === 0) {
        diagnostics.errors.push(
          `"${field}" bindings should, optionally, have a string "dataset" field but got ${JSON.stringify(
            value
          )}.`
        );
        isValid22 = false;
      }
      validateAdditionalProperties(diagnostics, field, Object.keys(value), [
        "binding",
        "dataset"
      ]);
      return isValid22;
    }, "validateAnalyticsEngineBinding");
    validateWorkerNamespaceBinding = /* @__PURE__ */ __name2((diagnostics, field, value) => {
      if (typeof value !== "object" || value === null) {
        diagnostics.errors.push(
          `"${field}" binding should be objects, but got ${JSON.stringify(value)}`
        );
        return false;
      }
      let isValid22 = true;
      if (!isRequiredProperty(value, "binding", "string")) {
        diagnostics.errors.push(
          `"${field}" should have a string "binding" field but got ${JSON.stringify(
            value
          )}.`
        );
        isValid22 = false;
      }
      if (!isRequiredProperty(value, "namespace", "string")) {
        diagnostics.errors.push(
          `"${field}" should have a string "namespace" field but got ${JSON.stringify(
            value
          )}.`
        );
        isValid22 = false;
      }
      if (hasProperty(value, "outbound")) {
        if (!validateWorkerNamespaceOutbound(
          diagnostics,
          `${field}.outbound`,
          value.outbound ?? {}
        )) {
          diagnostics.errors.push(`"${field}" has an invalid outbound definition.`);
          isValid22 = false;
        }
      }
      if (!isRemoteValid(value, field, diagnostics)) {
        isValid22 = false;
      }
      return isValid22;
    }, "validateWorkerNamespaceBinding");
    __name(validateWorkerNamespaceOutbound, "validateWorkerNamespaceOutbound");
    __name2(validateWorkerNamespaceOutbound, "validateWorkerNamespaceOutbound");
    validateMTlsCertificateBinding = /* @__PURE__ */ __name2((diagnostics, field, value) => {
      if (typeof value !== "object" || value === null) {
        diagnostics.errors.push(
          `"mtls_certificates" bindings should be objects, but got ${JSON.stringify(
            value
          )}`
        );
        return false;
      }
      let isValid22 = true;
      if (!isRequiredProperty(value, "binding", "string")) {
        diagnostics.errors.push(
          `"${field}" bindings should have a string "binding" field but got ${JSON.stringify(
            value
          )}.`
        );
        isValid22 = false;
      }
      if (!isRequiredProperty(value, "certificate_id", "string") || value.certificate_id.length === 0) {
        diagnostics.errors.push(
          `"${field}" bindings should have a string "certificate_id" field but got ${JSON.stringify(
            value
          )}.`
        );
        isValid22 = false;
      }
      validateAdditionalProperties(diagnostics, field, Object.keys(value), [
        "binding",
        "certificate_id",
        "remote"
      ]);
      if (!isRemoteValid(value, field, diagnostics)) {
        isValid22 = false;
      }
      return isValid22;
    }, "validateMTlsCertificateBinding");
    __name(validateQueues, "validateQueues");
    __name2(validateQueues, "validateQueues");
    validateConsumer = /* @__PURE__ */ __name2((diagnostics, field, value, _config) => {
      if (typeof value !== "object" || value === null) {
        diagnostics.errors.push(
          `"${field}" should be a objects, but got ${JSON.stringify(value)}`
        );
        return false;
      }
      let isValid22 = true;
      if (!validateAdditionalProperties(diagnostics, field, Object.keys(value), [
        "queue",
        "type",
        "max_batch_size",
        "max_batch_timeout",
        "max_retries",
        "dead_letter_queue",
        "max_concurrency",
        "visibility_timeout_ms",
        "retry_delay"
      ])) {
        isValid22 = false;
      }
      if (!isRequiredProperty(value, "queue", "string")) {
        diagnostics.errors.push(
          `"${field}" should have a string "queue" field but got ${JSON.stringify(
            value
          )}.`
        );
      }
      if ("type" in value && value.type !== void 0 && value.type !== "worker") {
        diagnostics.errors.push(
          `"${field}.type" has an invalid value "${value.type}". Only "worker" consumers can be configured in your Wrangler configuration.`
        );
        isValid22 = false;
      }
      const options = [
        { key: "type", type: "string" },
        { key: "max_batch_size", type: "number" },
        { key: "max_batch_timeout", type: "number" },
        { key: "max_retries", type: "number" },
        { key: "dead_letter_queue", type: "string" },
        { key: "max_concurrency", type: "number" },
        { key: "visibility_timeout_ms", type: "number" },
        { key: "retry_delay", type: "number" }
      ];
      for (const optionalOpt of options) {
        if (!isOptionalProperty(value, optionalOpt.key, optionalOpt.type)) {
          diagnostics.errors.push(
            `"${field}" should, optionally, have a ${optionalOpt.type} "${optionalOpt.key}" field but got ${JSON.stringify(value)}.`
          );
          isValid22 = false;
        }
      }
      return isValid22;
    }, "validateConsumer");
    validateCompatibilityDate = /* @__PURE__ */ __name2((diagnostics, field, value) => {
      if (value === void 0) {
        return true;
      }
      if (typeof value !== "string") {
        diagnostics.errors.push(
          `Expected "${field}" to be of type string but got ${JSON.stringify(value)}.`
        );
        return false;
      }
      return isValidDateTimeStringFormat(diagnostics, field, value);
    }, "validateCompatibilityDate");
    validatePipelineBinding = /* @__PURE__ */ __name2((diagnostics, field, value) => {
      if (typeof value !== "object" || value === null) {
        diagnostics.errors.push(
          `"pipeline" bindings should be objects, but got ${JSON.stringify(value)}`
        );
        return false;
      }
      let isValid22 = true;
      if (!isRequiredProperty(value, "binding", "string")) {
        diagnostics.errors.push(
          `"${field}" bindings must have a string "binding" field but got ${JSON.stringify(
            value
          )}.`
        );
        isValid22 = false;
      }
      if (!isRequiredProperty(value, "pipeline", "string")) {
        diagnostics.errors.push(
          `"${field}" bindings must have a string "pipeline" field but got ${JSON.stringify(
            value
          )}.`
        );
        isValid22 = false;
      }
      if (!isRemoteValid(value, field, diagnostics)) {
        isValid22 = false;
      }
      validateAdditionalProperties(diagnostics, field, Object.keys(value), [
        "binding",
        "pipeline",
        "remote"
      ]);
      return isValid22;
    }, "validatePipelineBinding");
    validateSecretsStoreSecretBinding = /* @__PURE__ */ __name2((diagnostics, field, value) => {
      if (typeof value !== "object" || value === null) {
        diagnostics.errors.push(
          `"secrets_store_secrets" bindings should be objects, but got ${JSON.stringify(value)}`
        );
        return false;
      }
      let isValid22 = true;
      if (!isRequiredProperty(value, "binding", "string")) {
        diagnostics.errors.push(
          `"${field}" bindings must have a string "binding" field but got ${JSON.stringify(
            value
          )}.`
        );
        isValid22 = false;
      }
      if (!isRequiredProperty(value, "store_id", "string")) {
        diagnostics.errors.push(
          `"${field}" bindings must have a string "store_id" field but got ${JSON.stringify(
            value
          )}.`
        );
        isValid22 = false;
      }
      if (!isRequiredProperty(value, "secret_name", "string")) {
        diagnostics.errors.push(
          `"${field}" bindings must have a string "secret_name" field but got ${JSON.stringify(
            value
          )}.`
        );
        isValid22 = false;
      }
      validateAdditionalProperties(diagnostics, field, Object.keys(value), [
        "binding",
        "store_id",
        "secret_name"
      ]);
      return isValid22;
    }, "validateSecretsStoreSecretBinding");
    validateHelloWorldBinding = /* @__PURE__ */ __name2((diagnostics, field, value) => {
      if (typeof value !== "object" || value === null) {
        diagnostics.errors.push(
          `"unsafe_hello_world" bindings should be objects, but got ${JSON.stringify(value)}`
        );
        return false;
      }
      let isValid22 = true;
      if (!isRequiredProperty(value, "binding", "string")) {
        diagnostics.errors.push(
          `"${field}" bindings must have a string "binding" field but got ${JSON.stringify(
            value
          )}.`
        );
        isValid22 = false;
      }
      if (!isOptionalProperty(value, "enable_timer", "boolean")) {
        diagnostics.errors.push(
          `"${field}" bindings must have a boolean "enable_timer" field but got ${JSON.stringify(
            value
          )}.`
        );
        isValid22 = false;
      }
      validateAdditionalProperties(diagnostics, field, Object.keys(value), [
        "binding",
        "enable_timer"
      ]);
      return isValid22;
    }, "validateHelloWorldBinding");
    validateFlagshipBinding = /* @__PURE__ */ __name2((diagnostics, field, value) => {
      if (typeof value !== "object" || value === null) {
        diagnostics.errors.push(
          `"flagship" bindings should be objects, but got ${JSON.stringify(value)}`
        );
        return false;
      }
      let isValid22 = true;
      if (!isRequiredProperty(value, "binding", "string")) {
        diagnostics.errors.push(
          `"${field}" bindings must have a string "binding" field but got ${JSON.stringify(
            value
          )}.`
        );
        isValid22 = false;
      }
      if (!isRequiredProperty(value, "app_id", "string")) {
        diagnostics.errors.push(
          `"${field}" bindings must have a string "app_id" field but got ${JSON.stringify(
            value
          )}.`
        );
        isValid22 = false;
      }
      validateAdditionalProperties(diagnostics, field, Object.keys(value), [
        "binding",
        "app_id",
        "remote"
      ]);
      if (!isRemoteValid(value, field, diagnostics)) {
        isValid22 = false;
      }
      return isValid22;
    }, "validateFlagshipBinding");
    validateWorkerLoaderBinding = /* @__PURE__ */ __name2((diagnostics, field, value) => {
      if (typeof value !== "object" || value === null) {
        diagnostics.errors.push(
          `"worker_loader" bindings should be objects, but got ${JSON.stringify(value)}`
        );
        return false;
      }
      let isValid22 = true;
      if (!isRequiredProperty(value, "binding", "string")) {
        diagnostics.errors.push(
          `"${field}" bindings must have a string "binding" field but got ${JSON.stringify(
            value
          )}.`
        );
        isValid22 = false;
      }
      validateAdditionalProperties(diagnostics, field, Object.keys(value), [
        "binding"
      ]);
      return isValid22;
    }, "validateWorkerLoaderBinding");
    validateRateLimitBinding = /* @__PURE__ */ __name2((diagnostics, field, value) => {
      if (typeof value !== "object" || value === null) {
        diagnostics.errors.push(
          `"ratelimits" bindings should be objects, but got ${JSON.stringify(value)}`
        );
        return false;
      }
      let isValid22 = true;
      if (!isRequiredProperty(value, "name", "string")) {
        diagnostics.errors.push(
          `"${field}" bindings must have a string "name" field but got ${JSON.stringify(
            value
          )}.`
        );
        isValid22 = false;
      }
      if (!isRequiredProperty(value, "namespace_id", "string")) {
        diagnostics.errors.push(
          `"${field}" bindings must have a string "namespace_id" field but got ${JSON.stringify(
            value
          )}.`
        );
        isValid22 = false;
      }
      if (!hasProperty(value, "simple") || typeof value.simple !== "object" || value.simple === null) {
        diagnostics.errors.push(
          `"${field}" bindings must have a "simple" configuration object but got ${JSON.stringify(
            value
          )}.`
        );
        isValid22 = false;
      } else {
        if (!isRequiredProperty(value.simple, "limit", "number")) {
          diagnostics.errors.push(
            `"${field}" bindings "simple.limit" must be a number but got ${JSON.stringify(
              value.simple
            )}.`
          );
          isValid22 = false;
        }
        if (!isRequiredProperty(value.simple, "period", "number")) {
          diagnostics.errors.push(
            `"${field}" bindings "simple.period" is required and must be a number but got ${JSON.stringify(
              value.simple
            )}.`
          );
          isValid22 = false;
        } else if (![10, 60].includes(value.simple.period)) {
          diagnostics.errors.push(
            `"${field}" bindings "simple.period" must be either 10 or 60 but got ${JSON.stringify(
              value.simple.period
            )}.`
          );
          isValid22 = false;
        }
        validateAdditionalProperties(
          diagnostics,
          `${field}.simple`,
          Object.keys(value.simple),
          ["limit", "period"]
        );
      }
      validateAdditionalProperties(diagnostics, field, Object.keys(value), [
        "name",
        "namespace_id",
        "simple"
      ]);
      return isValid22;
    }, "validateRateLimitBinding");
    __name(normalizeAndValidateLimits, "normalizeAndValidateLimits");
    __name2(normalizeAndValidateLimits, "normalizeAndValidateLimits");
    validatePreviewsConfig = /* @__PURE__ */ __name2((envName) => (diagnostics, field, value) => {
      if (value === void 0) {
        return true;
      }
      if (typeof value !== "object" || value === null || Array.isArray(value)) {
        diagnostics.errors.push(
          `The field "${field}" should be an object but got ${JSON.stringify(
            value
          )}.`
        );
        return false;
      }
      const previews = value;
      let isValid22 = true;
      isValid22 = validateAdditionalProperties(diagnostics, field, Object.keys(previews), [
        "vars",
        "define",
        "durable_objects",
        "workflows",
        "kv_namespaces",
        "send_email",
        "queues",
        "d1_databases",
        "r2_buckets",
        "vectorize",
        "hyperdrive",
        "services",
        "analytics_engine_datasets",
        "dispatch_namespaces",
        "mtls_certificates",
        "tail_consumers",
        "streaming_tail_consumers",
        "unsafe",
        "browser",
        "ai",
        "images",
        "stream",
        "media",
        "pipelines",
        "secrets_store_secrets",
        "unsafe_hello_world",
        "worker_loaders",
        "ratelimits",
        "vpc_services",
        "version_metadata",
        "logpush",
        "observability",
        "limits"
      ]) && isValid22;
      isValid22 = validateVars(envName)(
        diagnostics,
        `${field}.vars`,
        previews.vars,
        void 0
      ) && isValid22;
      isValid22 = validateDefines(envName)(
        diagnostics,
        `${field}.define`,
        previews.define,
        void 0
      ) && isValid22;
      isValid22 = validateBindingsProperty(envName, validateDurableObjectBinding)(
        diagnostics,
        `${field}.durable_objects`,
        previews.durable_objects,
        void 0
      ) && isValid22;
      isValid22 = all(
        validateBindingArray(envName, validateWorkflowBinding),
        validateUniqueNameProperty
      )(diagnostics, `${field}.workflows`, previews.workflows, void 0) && isValid22;
      isValid22 = validateBindingArray(envName, validateKVBinding)(
        diagnostics,
        `${field}.kv_namespaces`,
        previews.kv_namespaces,
        void 0
      ) && isValid22;
      isValid22 = validateBindingArray(envName, validateSendEmailBinding)(
        diagnostics,
        `${field}.send_email`,
        previews.send_email,
        void 0
      ) && isValid22;
      isValid22 = validateQueues(envName)(
        diagnostics,
        `${field}.queues`,
        previews.queues,
        void 0
      ) && isValid22;
      isValid22 = validateBindingArray(envName, validateD1Binding)(
        diagnostics,
        `${field}.d1_databases`,
        previews.d1_databases,
        void 0
      ) && isValid22;
      isValid22 = validateBindingArray(envName, validateR2Binding)(
        diagnostics,
        `${field}.r2_buckets`,
        previews.r2_buckets,
        void 0
      ) && isValid22;
      isValid22 = validateBindingArray(envName, validateVectorizeBinding)(
        diagnostics,
        `${field}.vectorize`,
        previews.vectorize,
        void 0
      ) && isValid22;
      isValid22 = validateBindingArray(envName, validateHyperdriveBinding)(
        diagnostics,
        `${field}.hyperdrive`,
        previews.hyperdrive,
        void 0
      ) && isValid22;
      isValid22 = validateBindingArray(envName, validateServiceBinding)(
        diagnostics,
        `${field}.services`,
        previews.services,
        void 0
      ) && isValid22;
      isValid22 = validateBindingArray(envName, validateAnalyticsEngineBinding)(
        diagnostics,
        `${field}.analytics_engine_datasets`,
        previews.analytics_engine_datasets,
        void 0
      ) && isValid22;
      isValid22 = validateBindingArray(envName, validateWorkerNamespaceBinding)(
        diagnostics,
        `${field}.dispatch_namespaces`,
        previews.dispatch_namespaces,
        void 0
      ) && isValid22;
      isValid22 = validateBindingArray(envName, validateMTlsCertificateBinding)(
        diagnostics,
        `${field}.mtls_certificates`,
        previews.mtls_certificates,
        void 0
      ) && isValid22;
      isValid22 = validateTailConsumers(
        diagnostics,
        `${field}.tail_consumers`,
        previews.tail_consumers,
        void 0
      ) && isValid22;
      isValid22 = validateStreamingTailConsumers(
        diagnostics,
        `${field}.streaming_tail_consumers`,
        previews.streaming_tail_consumers,
        void 0
      ) && isValid22;
      if (previews.unsafe !== void 0) {
        isValid22 = validateUnsafeSettings(envName)(
          diagnostics,
          `${field}.unsafe`,
          previews.unsafe,
          void 0
        ) && isValid22;
      }
      if (previews.browser !== void 0) {
        isValid22 = validateNamedSimpleBinding(envName)(
          diagnostics,
          `${field}.browser`,
          previews.browser,
          void 0
        ) && isValid22;
      }
      if (previews.ai !== void 0) {
        isValid22 = validateAIBinding(envName)(
          diagnostics,
          `${field}.ai`,
          previews.ai,
          void 0
        ) && isValid22;
      }
      if (previews.images !== void 0) {
        isValid22 = validateNamedSimpleBinding(envName)(
          diagnostics,
          `${field}.images`,
          previews.images,
          void 0
        ) && isValid22;
      }
      if (previews.stream !== void 0) {
        isValid22 = validateNamedSimpleBinding(envName)(
          diagnostics,
          `${field}.stream`,
          previews.stream,
          void 0
        ) && isValid22;
      }
      if (previews.media !== void 0) {
        isValid22 = validateNamedSimpleBinding(envName)(
          diagnostics,
          `${field}.media`,
          previews.media,
          void 0
        ) && isValid22;
      }
      isValid22 = validateBindingArray(envName, validatePipelineBinding)(
        diagnostics,
        `${field}.pipelines`,
        previews.pipelines,
        void 0
      ) && isValid22;
      isValid22 = validateBindingArray(envName, validateSecretsStoreSecretBinding)(
        diagnostics,
        `${field}.secrets_store_secrets`,
        previews.secrets_store_secrets,
        void 0
      ) && isValid22;
      isValid22 = validateBindingArray(envName, validateHelloWorldBinding)(
        diagnostics,
        `${field}.unsafe_hello_world`,
        previews.unsafe_hello_world,
        void 0
      ) && isValid22;
      isValid22 = validateBindingArray(envName, validateWorkerLoaderBinding)(
        diagnostics,
        `${field}.worker_loaders`,
        previews.worker_loaders,
        void 0
      ) && isValid22;
      isValid22 = validateBindingArray(envName, validateRateLimitBinding)(
        diagnostics,
        `${field}.ratelimits`,
        previews.ratelimits,
        void 0
      ) && isValid22;
      isValid22 = validateBindingArray(envName, validateVpcServiceBinding)(
        diagnostics,
        `${field}.vpc_services`,
        previews.vpc_services,
        void 0
      ) && isValid22;
      if (previews.version_metadata !== void 0) {
        isValid22 = validateVersionMetadataBinding(envName)(
          diagnostics,
          `${field}.version_metadata`,
          previews.version_metadata,
          void 0
        ) && isValid22;
      }
      isValid22 = isBoolean(diagnostics, `${field}.logpush`, previews.logpush, void 0) && isValid22;
      isValid22 = validateObservability(
        diagnostics,
        `${field}.observability`,
        previews.observability,
        void 0
      ) && isValid22;
      if (previews.limits) {
        isValid22 = validateOptionalProperty(
          diagnostics,
          `${field}.limits`,
          "cpu_ms",
          previews.limits.cpu_ms,
          "number"
        ) && isValid22;
        isValid22 = validateOptionalProperty(
          diagnostics,
          `${field}.limits`,
          "subrequests",
          previews.limits.subrequests,
          "number"
        ) && isValid22;
      }
      return isValid22;
    }, "validatePreviewsConfig");
    validateMigrations = /* @__PURE__ */ __name2((diagnostics, field, value) => {
      const rawMigrations = value ?? [];
      if (!Array.isArray(rawMigrations)) {
        diagnostics.errors.push(
          `The optional "${field}" field should be an array, but got ${JSON.stringify(
            rawMigrations
          )}`
        );
        return false;
      }
      let valid = true;
      for (let i7 = 0; i7 < rawMigrations.length; i7++) {
        const {
          tag,
          new_classes,
          new_sqlite_classes,
          renamed_classes,
          deleted_classes,
          transferred_classes,
          ...rest
        } = rawMigrations[i7];
        valid = validateAdditionalProperties(
          diagnostics,
          "migrations",
          Object.keys(rest),
          []
        ) && valid;
        valid = validateRequiredProperty(
          diagnostics,
          `migrations[${i7}]`,
          `tag`,
          tag,
          "string"
        ) && valid;
        valid = validateOptionalTypedArray(
          diagnostics,
          `migrations[${i7}].new_classes`,
          new_classes,
          "string"
        ) && valid;
        valid = validateOptionalTypedArray(
          diagnostics,
          `migrations[${i7}].new_sqlite_classes`,
          new_sqlite_classes,
          "string"
        ) && valid;
        if (renamed_classes !== void 0) {
          if (!Array.isArray(renamed_classes)) {
            diagnostics.errors.push(
              `Expected "migrations[${i7}].renamed_classes" to be an array of "{from: string, to: string}" objects but got ${JSON.stringify(
                renamed_classes
              )}.`
            );
            valid = false;
          } else if (renamed_classes.some(
            (c8) => typeof c8 !== "object" || !isRequiredProperty(c8, "from", "string") || !isRequiredProperty(c8, "to", "string")
          )) {
            diagnostics.errors.push(
              `Expected "migrations[${i7}].renamed_classes" to be an array of "{from: string, to: string}" objects but got ${JSON.stringify(
                renamed_classes
              )}.`
            );
            valid = false;
          }
        }
        if (transferred_classes !== void 0) {
          if (!Array.isArray(transferred_classes)) {
            diagnostics.errors.push(
              `Expected "migrations[${i7}].transferred_classes" to be an array of "{from: string, from_script: string, to: string}" objects but got ${JSON.stringify(
                transferred_classes
              )}.`
            );
            valid = false;
          } else if (transferred_classes.some(
            (c8) => typeof c8 !== "object" || !isRequiredProperty(c8, "from", "string") || !isRequiredProperty(c8, "from_script", "string") || !isRequiredProperty(c8, "to", "string")
          )) {
            diagnostics.errors.push(
              `Expected "migrations[${i7}].transferred_classes" to be an array of "{from: string, from_script: string, to: string}" objects but got ${JSON.stringify(
                transferred_classes
              )}.`
            );
            valid = false;
          }
        }
        valid = validateOptionalTypedArray(
          diagnostics,
          `migrations[${i7}].deleted_classes`,
          deleted_classes,
          "string"
        ) && valid;
      }
      return valid;
    }, "validateMigrations");
    validateObservability = /* @__PURE__ */ __name2((diagnostics, field, value) => {
      if (value === void 0) {
        return true;
      }
      if (typeof value !== "object") {
        diagnostics.errors.push(
          `"${field}" should be an object but got ${JSON.stringify(value)}.`
        );
        return false;
      }
      const val2 = value;
      let isValid22 = true;
      isValid22 = validateAtLeastOnePropertyRequired(diagnostics, field, [
        {
          key: "enabled",
          value: val2.enabled,
          type: "boolean"
        },
        {
          key: "logs.enabled",
          value: val2.logs?.enabled,
          type: "boolean"
        },
        {
          key: "traces.enabled",
          value: val2.traces?.enabled,
          type: "boolean"
        }
      ]) && isValid22;
      isValid22 = validateOptionalProperty(
        diagnostics,
        field,
        "head_sampling_rate",
        val2.head_sampling_rate,
        "number"
      ) && isValid22;
      isValid22 = validateOptionalProperty(diagnostics, field, "logs", val2.logs, "object") && isValid22;
      isValid22 = validateOptionalProperty(
        diagnostics,
        field,
        "traces",
        val2.traces,
        "object"
      ) && isValid22;
      isValid22 = validateAdditionalProperties(diagnostics, field, Object.keys(val2), [
        "enabled",
        "head_sampling_rate",
        "logs",
        "traces"
      ]) && isValid22;
      if (typeof val2.logs === "object") {
        isValid22 = validateOptionalProperty(
          diagnostics,
          field,
          "logs.enabled",
          val2.logs.enabled,
          "boolean"
        ) && isValid22;
        isValid22 = validateOptionalProperty(
          diagnostics,
          field,
          "logs.head_sampling_rate",
          val2.logs.head_sampling_rate,
          "number"
        ) && isValid22;
        isValid22 = validateOptionalProperty(
          diagnostics,
          field,
          "logs.invocation_logs",
          val2.logs.invocation_logs,
          "boolean"
        ) && isValid22;
        isValid22 = validateOptionalTypedArray(
          diagnostics,
          "logs.destinations",
          val2.logs?.destinations,
          "string"
        ) && isValid22;
        isValid22 = validateOptionalProperty(
          diagnostics,
          field,
          "logs.persist",
          val2.logs.persist,
          "boolean"
        ) && isValid22;
        isValid22 = validateAdditionalProperties(diagnostics, field, Object.keys(val2.logs), [
          "enabled",
          "head_sampling_rate",
          "invocation_logs",
          "destinations",
          "persist"
        ]) && isValid22;
      }
      if (typeof val2.traces === "object") {
        isValid22 = validateOptionalProperty(
          diagnostics,
          field,
          "traces.enabled",
          val2.traces.enabled,
          "boolean"
        ) && isValid22;
        isValid22 = validateOptionalProperty(
          diagnostics,
          field,
          "traces.head_sampling_rate",
          val2.traces.head_sampling_rate,
          "number"
        ) && isValid22;
        isValid22 = validateOptionalTypedArray(
          diagnostics,
          "traces.destinations",
          val2.traces?.destinations,
          "string"
        ) && isValid22;
        isValid22 = validateOptionalProperty(
          diagnostics,
          field,
          "traces.persist",
          val2.traces.persist,
          "boolean"
        ) && isValid22;
        isValid22 = validateAdditionalProperties(
          diagnostics,
          field,
          Object.keys(val2.traces),
          ["enabled", "head_sampling_rate", "destinations", "persist"]
        ) && isValid22;
      }
      const samplingRate = val2?.head_sampling_rate;
      if (samplingRate && (samplingRate < 0 || samplingRate > 1)) {
        diagnostics.errors.push(
          `"${field}.head_sampling_rate" must be a value between 0 and 1.`
        );
      }
      return isValid22;
    }, "validateObservability");
    validateCache = /* @__PURE__ */ __name2((diagnostics, field, value) => {
      if (value === void 0) {
        return true;
      }
      if (typeof value !== "object" || value === null) {
        diagnostics.errors.push(
          `"${field}" should be an object but got ${JSON.stringify(value)}.`
        );
        return false;
      }
      const val2 = value;
      let isValid22 = true;
      isValid22 = validateRequiredProperty(
        diagnostics,
        field,
        "enabled",
        val2.enabled,
        "boolean"
      ) && isValid22;
      isValid22 = validateAdditionalProperties(diagnostics, field, Object.keys(val2), [
        "enabled"
      ]) && isValid22;
      return isValid22;
    }, "validateCache");
    __name(warnIfDurableObjectsHaveNoMigrations, "warnIfDurableObjectsHaveNoMigrations");
    __name2(warnIfDurableObjectsHaveNoMigrations, "warnIfDurableObjectsHaveNoMigrations");
    validatePythonModules = /* @__PURE__ */ __name2((diagnostics, field, value, topLevelEnv) => {
      if (value === void 0) {
        return true;
      }
      if (typeof value !== "object" || value === null || Array.isArray(value)) {
        diagnostics.errors.push(
          `"${field}" should be an object but got ${JSON.stringify(value)}.`
        );
        return false;
      }
      const val2 = value;
      if (!("exclude" in val2)) {
        return false;
      }
      if (!isStringArray(diagnostics, `${field}.exclude`, val2.exclude, topLevelEnv)) {
        return false;
      }
      return true;
    }, "validatePythonModules");
    __name(isRemoteValid, "isRemoteValid");
    __name2(isRemoteValid, "isRemoteValid");
    __name(isDockerfile, "isDockerfile");
    __name2(isDockerfile, "isDockerfile");
    supportedPagesConfigFields = [
      "pages_build_output_dir",
      "name",
      "compatibility_date",
      "compatibility_flags",
      "send_metrics",
      "no_bundle",
      "limits",
      "placement",
      "vars",
      "durable_objects",
      "kv_namespaces",
      "queues",
      // `producers` ONLY
      "r2_buckets",
      "d1_databases",
      "vectorize",
      "hyperdrive",
      "services",
      "analytics_engine_datasets",
      "ai",
      "version_metadata",
      "dev",
      "mtls_certificates",
      "browser",
      "upload_source_maps",
      // normalizeAndValidateConfig() sets these values
      "configPath",
      "userConfigPath",
      "topLevelName",
      "definedEnvironments",
      "targetEnvironment"
    ];
    __name(validatePagesConfig, "validatePagesConfig");
    __name2(validatePagesConfig, "validatePagesConfig");
    __name(validateMainField, "validateMainField");
    __name2(validateMainField, "validateMainField");
    __name(validateProjectName, "validateProjectName");
    __name2(validateProjectName, "validateProjectName");
    __name(validatePagesEnvironmentNames, "validatePagesEnvironmentNames");
    __name2(validatePagesEnvironmentNames, "validatePagesEnvironmentNames");
    __name(validateUnsupportedFields, "validateUnsupportedFields");
    __name2(validateUnsupportedFields, "validateUnsupportedFields");
    __name(validateDurableObjectBinding2, "validateDurableObjectBinding2");
    __name2(validateDurableObjectBinding2, "validateDurableObjectBinding");
  }
});

// ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/yerror.js
var YError;
var init_yerror = __esm({
  "../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/yerror.js"() {
    init_import_meta_url();
    YError = class _YError extends Error {
      static {
        __name(this, "YError");
      }
      constructor(msg) {
        super(msg || "yargs error");
        this.name = "YError";
        if (Error.captureStackTrace) {
          Error.captureStackTrace(this, _YError);
        }
      }
    };
  }
});

// ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/utils/apply-extends.js
function applyExtends(config, cwd2, mergeExtends, _shim) {
  shim = _shim;
  let defaultConfig = {};
  if (Object.prototype.hasOwnProperty.call(config, "extends")) {
    if (typeof config.extends !== "string")
      return defaultConfig;
    const isPath = /\.json|\..*rc$/.test(config.extends);
    let pathToDefault = null;
    if (!isPath) {
      try {
        pathToDefault = __require.resolve(config.extends);
      } catch (_err) {
        return config;
      }
    } else {
      pathToDefault = getPathToDefaultConfig(cwd2, config.extends);
    }
    checkForCircularExtends(pathToDefault);
    previouslyVisitedConfigs.push(pathToDefault);
    defaultConfig = isPath ? JSON.parse(shim.readFileSync(pathToDefault, "utf8")) : __require(config.extends);
    delete config.extends;
    defaultConfig = applyExtends(defaultConfig, shim.path.dirname(pathToDefault), mergeExtends, shim);
  }
  previouslyVisitedConfigs = [];
  return mergeExtends ? mergeDeep(defaultConfig, config) : Object.assign({}, defaultConfig, config);
}
function checkForCircularExtends(cfgPath) {
  if (previouslyVisitedConfigs.indexOf(cfgPath) > -1) {
    throw new YError(`Circular extended configurations: '${cfgPath}'.`);
  }
}
function getPathToDefaultConfig(cwd2, pathToExtend) {
  return shim.path.resolve(cwd2, pathToExtend);
}
function mergeDeep(config1, config2) {
  const target = {};
  function isObject5(obj) {
    return obj && typeof obj === "object" && !Array.isArray(obj);
  }
  __name(isObject5, "isObject");
  Object.assign(target, config1);
  for (const key of Object.keys(config2)) {
    if (isObject5(config2[key]) && isObject5(target[key])) {
      target[key] = mergeDeep(config1[key], config2[key]);
    } else {
      target[key] = config2[key];
    }
  }
  return target;
}
var previouslyVisitedConfigs, shim;
var init_apply_extends = __esm({
  "../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/utils/apply-extends.js"() {
    init_import_meta_url();
    init_yerror();
    previouslyVisitedConfigs = [];
    __name(applyExtends, "applyExtends");
    __name(checkForCircularExtends, "checkForCircularExtends");
    __name(getPathToDefaultConfig, "getPathToDefaultConfig");
    __name(mergeDeep, "mergeDeep");
  }
});

// ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/utils/process-argv.js
function getProcessArgvBinIndex() {
  if (isBundledElectronApp())
    return 0;
  return 1;
}
function isBundledElectronApp() {
  return isElectronApp() && !process.defaultApp;
}
function isElectronApp() {
  return !!process.versions.electron;
}
function hideBin(argv) {
  return argv.slice(getProcessArgvBinIndex() + 1);
}
function getProcessArgvBin() {
  return process.argv[getProcessArgvBinIndex()];
}
var init_process_argv = __esm({
  "../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/utils/process-argv.js"() {
    init_import_meta_url();
    __name(getProcessArgvBinIndex, "getProcessArgvBinIndex");
    __name(isBundledElectronApp, "isBundledElectronApp");
    __name(isElectronApp, "isElectronApp");
    __name(hideBin, "hideBin");
    __name(getProcessArgvBin, "getProcessArgvBin");
  }
});

// ../../node_modules/.pnpm/yargs-parser@21.1.1/node_modules/yargs-parser/build/lib/string-utils.js
function camelCase(str) {
  const isCamelCase = str !== str.toLowerCase() && str !== str.toUpperCase();
  if (!isCamelCase) {
    str = str.toLowerCase();
  }
  if (str.indexOf("-") === -1 && str.indexOf("_") === -1) {
    return str;
  } else {
    let camelcase = "";
    let nextChrUpper = false;
    const leadingHyphens = str.match(/^-+/);
    for (let i7 = leadingHyphens ? leadingHyphens[0].length : 0; i7 < str.length; i7++) {
      let chr = str.charAt(i7);
      if (nextChrUpper) {
        nextChrUpper = false;
        chr = chr.toUpperCase();
      }
      if (i7 !== 0 && (chr === "-" || chr === "_")) {
        nextChrUpper = true;
      } else if (chr !== "-" && chr !== "_") {
        camelcase += chr;
      }
    }
    return camelcase;
  }
}
function decamelize(str, joinString) {
  const lowercase = str.toLowerCase();
  joinString = joinString || "-";
  let notCamelcase = "";
  for (let i7 = 0; i7 < str.length; i7++) {
    const chrLower = lowercase.charAt(i7);
    const chrString = str.charAt(i7);
    if (chrLower !== chrString && i7 > 0) {
      notCamelcase += `${joinString}${lowercase.charAt(i7)}`;
    } else {
      notCamelcase += chrString;
    }
  }
  return notCamelcase;
}
function looksLikeNumber(x7) {
  if (x7 === null || x7 === void 0)
    return false;
  if (typeof x7 === "number")
    return true;
  if (/^0x[0-9a-f]+$/i.test(x7))
    return true;
  if (/^0[^.]/.test(x7))
    return false;
  return /^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x7);
}
var init_string_utils = __esm({
  "../../node_modules/.pnpm/yargs-parser@21.1.1/node_modules/yargs-parser/build/lib/string-utils.js"() {
    init_import_meta_url();
    __name(camelCase, "camelCase");
    __name(decamelize, "decamelize");
    __name(looksLikeNumber, "looksLikeNumber");
  }
});

// ../../node_modules/.pnpm/yargs-parser@21.1.1/node_modules/yargs-parser/build/lib/tokenize-arg-string.js
function tokenizeArgString(argString) {
  if (Array.isArray(argString)) {
    return argString.map((e10) => typeof e10 !== "string" ? e10 + "" : e10);
  }
  argString = argString.trim();
  let i7 = 0;
  let prevC = null;
  let c8 = null;
  let opening = null;
  const args = [];
  for (let ii = 0; ii < argString.length; ii++) {
    prevC = c8;
    c8 = argString.charAt(ii);
    if (c8 === " " && !opening) {
      if (!(prevC === " ")) {
        i7++;
      }
      continue;
    }
    if (c8 === opening) {
      opening = null;
    } else if ((c8 === "'" || c8 === '"') && !opening) {
      opening = c8;
    }
    if (!args[i7])
      args[i7] = "";
    args[i7] += c8;
  }
  return args;
}
var init_tokenize_arg_string = __esm({
  "../../node_modules/.pnpm/yargs-parser@21.1.1/node_modules/yargs-parser/build/lib/tokenize-arg-string.js"() {
    init_import_meta_url();
    __name(tokenizeArgString, "tokenizeArgString");
  }
});

// ../../node_modules/.pnpm/yargs-parser@21.1.1/node_modules/yargs-parser/build/lib/yargs-parser-types.js
var DefaultValuesForTypeKey;
var init_yargs_parser_types = __esm({
  "../../node_modules/.pnpm/yargs-parser@21.1.1/node_modules/yargs-parser/build/lib/yargs-parser-types.js"() {
    init_import_meta_url();
    (function(DefaultValuesForTypeKey2) {
      DefaultValuesForTypeKey2["BOOLEAN"] = "boolean";
      DefaultValuesForTypeKey2["STRING"] = "string";
      DefaultValuesForTypeKey2["NUMBER"] = "number";
      DefaultValuesForTypeKey2["ARRAY"] = "array";
    })(DefaultValuesForTypeKey || (DefaultValuesForTypeKey = {}));
  }
});

// ../../node_modules/.pnpm/yargs-parser@21.1.1/node_modules/yargs-parser/build/lib/yargs-parser.js
function combineAliases(aliases2) {
  const aliasArrays = [];
  const combined = /* @__PURE__ */ Object.create(null);
  let change = true;
  Object.keys(aliases2).forEach(function(key) {
    aliasArrays.push([].concat(aliases2[key], key));
  });
  while (change) {
    change = false;
    for (let i7 = 0; i7 < aliasArrays.length; i7++) {
      for (let ii = i7 + 1; ii < aliasArrays.length; ii++) {
        const intersect = aliasArrays[i7].filter(function(v8) {
          return aliasArrays[ii].indexOf(v8) !== -1;
        });
        if (intersect.length) {
          aliasArrays[i7] = aliasArrays[i7].concat(aliasArrays[ii]);
          aliasArrays.splice(ii, 1);
          change = true;
          break;
        }
      }
    }
  }
  aliasArrays.forEach(function(aliasArray) {
    aliasArray = aliasArray.filter(function(v8, i7, self2) {
      return self2.indexOf(v8) === i7;
    });
    const lastAlias = aliasArray.pop();
    if (lastAlias !== void 0 && typeof lastAlias === "string") {
      combined[lastAlias] = aliasArray;
    }
  });
  return combined;
}
function increment(orig) {
  return orig !== void 0 ? orig + 1 : 1;
}
function sanitizeKey(key) {
  if (key === "__proto__")
    return "___proto___";
  return key;
}
function stripQuotes(val2) {
  return typeof val2 === "string" && (val2[0] === "'" || val2[0] === '"') && val2[val2.length - 1] === val2[0] ? val2.substring(1, val2.length - 1) : val2;
}
var mixin, YargsParser;
var init_yargs_parser = __esm({
  "../../node_modules/.pnpm/yargs-parser@21.1.1/node_modules/yargs-parser/build/lib/yargs-parser.js"() {
    init_import_meta_url();
    init_tokenize_arg_string();
    init_yargs_parser_types();
    init_string_utils();
    YargsParser = class {
      static {
        __name(this, "YargsParser");
      }
      constructor(_mixin) {
        mixin = _mixin;
      }
      parse(argsInput, options) {
        const opts = Object.assign({
          alias: void 0,
          array: void 0,
          boolean: void 0,
          config: void 0,
          configObjects: void 0,
          configuration: void 0,
          coerce: void 0,
          count: void 0,
          default: void 0,
          envPrefix: void 0,
          narg: void 0,
          normalize: void 0,
          string: void 0,
          number: void 0,
          __: void 0,
          key: void 0
        }, options);
        const args = tokenizeArgString(argsInput);
        const inputIsString = typeof argsInput === "string";
        const aliases2 = combineAliases(Object.assign(/* @__PURE__ */ Object.create(null), opts.alias));
        const configuration = Object.assign({
          "boolean-negation": true,
          "camel-case-expansion": true,
          "combine-arrays": false,
          "dot-notation": true,
          "duplicate-arguments-array": true,
          "flatten-duplicate-arrays": true,
          "greedy-arrays": true,
          "halt-at-non-option": false,
          "nargs-eats-options": false,
          "negation-prefix": "no-",
          "parse-numbers": true,
          "parse-positional-numbers": true,
          "populate--": false,
          "set-placeholder-key": false,
          "short-option-groups": true,
          "strip-aliased": false,
          "strip-dashed": false,
          "unknown-options-as-args": false
        }, opts.configuration);
        const defaults3 = Object.assign(/* @__PURE__ */ Object.create(null), opts.default);
        const configObjects = opts.configObjects || [];
        const envPrefix = opts.envPrefix;
        const notFlagsOption = configuration["populate--"];
        const notFlagsArgv = notFlagsOption ? "--" : "_";
        const newAliases = /* @__PURE__ */ Object.create(null);
        const defaulted = /* @__PURE__ */ Object.create(null);
        const __ = opts.__ || mixin.format;
        const flags2 = {
          aliases: /* @__PURE__ */ Object.create(null),
          arrays: /* @__PURE__ */ Object.create(null),
          bools: /* @__PURE__ */ Object.create(null),
          strings: /* @__PURE__ */ Object.create(null),
          numbers: /* @__PURE__ */ Object.create(null),
          counts: /* @__PURE__ */ Object.create(null),
          normalize: /* @__PURE__ */ Object.create(null),
          configs: /* @__PURE__ */ Object.create(null),
          nargs: /* @__PURE__ */ Object.create(null),
          coercions: /* @__PURE__ */ Object.create(null),
          keys: []
        };
        const negative = /^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/;
        const negatedBoolean = new RegExp("^--" + configuration["negation-prefix"] + "(.+)");
        [].concat(opts.array || []).filter(Boolean).forEach(function(opt) {
          const key = typeof opt === "object" ? opt.key : opt;
          const assignment = Object.keys(opt).map(function(key2) {
            const arrayFlagKeys = {
              boolean: "bools",
              string: "strings",
              number: "numbers"
            };
            return arrayFlagKeys[key2];
          }).filter(Boolean).pop();
          if (assignment) {
            flags2[assignment][key] = true;
          }
          flags2.arrays[key] = true;
          flags2.keys.push(key);
        });
        [].concat(opts.boolean || []).filter(Boolean).forEach(function(key) {
          flags2.bools[key] = true;
          flags2.keys.push(key);
        });
        [].concat(opts.string || []).filter(Boolean).forEach(function(key) {
          flags2.strings[key] = true;
          flags2.keys.push(key);
        });
        [].concat(opts.number || []).filter(Boolean).forEach(function(key) {
          flags2.numbers[key] = true;
          flags2.keys.push(key);
        });
        [].concat(opts.count || []).filter(Boolean).forEach(function(key) {
          flags2.counts[key] = true;
          flags2.keys.push(key);
        });
        [].concat(opts.normalize || []).filter(Boolean).forEach(function(key) {
          flags2.normalize[key] = true;
          flags2.keys.push(key);
        });
        if (typeof opts.narg === "object") {
          Object.entries(opts.narg).forEach(([key, value]) => {
            if (typeof value === "number") {
              flags2.nargs[key] = value;
              flags2.keys.push(key);
            }
          });
        }
        if (typeof opts.coerce === "object") {
          Object.entries(opts.coerce).forEach(([key, value]) => {
            if (typeof value === "function") {
              flags2.coercions[key] = value;
              flags2.keys.push(key);
            }
          });
        }
        if (typeof opts.config !== "undefined") {
          if (Array.isArray(opts.config) || typeof opts.config === "string") {
            [].concat(opts.config).filter(Boolean).forEach(function(key) {
              flags2.configs[key] = true;
            });
          } else if (typeof opts.config === "object") {
            Object.entries(opts.config).forEach(([key, value]) => {
              if (typeof value === "boolean" || typeof value === "function") {
                flags2.configs[key] = value;
              }
            });
          }
        }
        extendAliases(opts.key, aliases2, opts.default, flags2.arrays);
        Object.keys(defaults3).forEach(function(key) {
          (flags2.aliases[key] || []).forEach(function(alias) {
            defaults3[alias] = defaults3[key];
          });
        });
        let error2 = null;
        checkConfiguration();
        let notFlags = [];
        const argv = Object.assign(/* @__PURE__ */ Object.create(null), { _: [] });
        const argvReturn = {};
        for (let i7 = 0; i7 < args.length; i7++) {
          const arg = args[i7];
          const truncatedArg = arg.replace(/^-{3,}/, "---");
          let broken;
          let key;
          let letters;
          let m7;
          let next;
          let value;
          if (arg !== "--" && /^-/.test(arg) && isUnknownOptionAsArg(arg)) {
            pushPositional(arg);
          } else if (truncatedArg.match(/^---+(=|$)/)) {
            pushPositional(arg);
            continue;
          } else if (arg.match(/^--.+=/) || !configuration["short-option-groups"] && arg.match(/^-.+=/)) {
            m7 = arg.match(/^--?([^=]+)=([\s\S]*)$/);
            if (m7 !== null && Array.isArray(m7) && m7.length >= 3) {
              if (checkAllAliases(m7[1], flags2.arrays)) {
                i7 = eatArray(i7, m7[1], args, m7[2]);
              } else if (checkAllAliases(m7[1], flags2.nargs) !== false) {
                i7 = eatNargs(i7, m7[1], args, m7[2]);
              } else {
                setArg(m7[1], m7[2], true);
              }
            }
          } else if (arg.match(negatedBoolean) && configuration["boolean-negation"]) {
            m7 = arg.match(negatedBoolean);
            if (m7 !== null && Array.isArray(m7) && m7.length >= 2) {
              key = m7[1];
              setArg(key, checkAllAliases(key, flags2.arrays) ? [false] : false);
            }
          } else if (arg.match(/^--.+/) || !configuration["short-option-groups"] && arg.match(/^-[^-]+/)) {
            m7 = arg.match(/^--?(.+)/);
            if (m7 !== null && Array.isArray(m7) && m7.length >= 2) {
              key = m7[1];
              if (checkAllAliases(key, flags2.arrays)) {
                i7 = eatArray(i7, key, args);
              } else if (checkAllAliases(key, flags2.nargs) !== false) {
                i7 = eatNargs(i7, key, args);
              } else {
                next = args[i7 + 1];
                if (next !== void 0 && (!next.match(/^-/) || next.match(negative)) && !checkAllAliases(key, flags2.bools) && !checkAllAliases(key, flags2.counts)) {
                  setArg(key, next);
                  i7++;
                } else if (/^(true|false)$/.test(next)) {
                  setArg(key, next);
                  i7++;
                } else {
                  setArg(key, defaultValue(key));
                }
              }
            }
          } else if (arg.match(/^-.\..+=/)) {
            m7 = arg.match(/^-([^=]+)=([\s\S]*)$/);
            if (m7 !== null && Array.isArray(m7) && m7.length >= 3) {
              setArg(m7[1], m7[2]);
            }
          } else if (arg.match(/^-.\..+/) && !arg.match(negative)) {
            next = args[i7 + 1];
            m7 = arg.match(/^-(.\..+)/);
            if (m7 !== null && Array.isArray(m7) && m7.length >= 2) {
              key = m7[1];
              if (next !== void 0 && !next.match(/^-/) && !checkAllAliases(key, flags2.bools) && !checkAllAliases(key, flags2.counts)) {
                setArg(key, next);
                i7++;
              } else {
                setArg(key, defaultValue(key));
              }
            }
          } else if (arg.match(/^-[^-]+/) && !arg.match(negative)) {
            letters = arg.slice(1, -1).split("");
            broken = false;
            for (let j7 = 0; j7 < letters.length; j7++) {
              next = arg.slice(j7 + 2);
              if (letters[j7 + 1] && letters[j7 + 1] === "=") {
                value = arg.slice(j7 + 3);
                key = letters[j7];
                if (checkAllAliases(key, flags2.arrays)) {
                  i7 = eatArray(i7, key, args, value);
                } else if (checkAllAliases(key, flags2.nargs) !== false) {
                  i7 = eatNargs(i7, key, args, value);
                } else {
                  setArg(key, value);
                }
                broken = true;
                break;
              }
              if (next === "-") {
                setArg(letters[j7], next);
                continue;
              }
              if (/[A-Za-z]/.test(letters[j7]) && /^-?\d+(\.\d*)?(e-?\d+)?$/.test(next) && checkAllAliases(next, flags2.bools) === false) {
                setArg(letters[j7], next);
                broken = true;
                break;
              }
              if (letters[j7 + 1] && letters[j7 + 1].match(/\W/)) {
                setArg(letters[j7], next);
                broken = true;
                break;
              } else {
                setArg(letters[j7], defaultValue(letters[j7]));
              }
            }
            key = arg.slice(-1)[0];
            if (!broken && key !== "-") {
              if (checkAllAliases(key, flags2.arrays)) {
                i7 = eatArray(i7, key, args);
              } else if (checkAllAliases(key, flags2.nargs) !== false) {
                i7 = eatNargs(i7, key, args);
              } else {
                next = args[i7 + 1];
                if (next !== void 0 && (!/^(-|--)[^-]/.test(next) || next.match(negative)) && !checkAllAliases(key, flags2.bools) && !checkAllAliases(key, flags2.counts)) {
                  setArg(key, next);
                  i7++;
                } else if (/^(true|false)$/.test(next)) {
                  setArg(key, next);
                  i7++;
                } else {
                  setArg(key, defaultValue(key));
                }
              }
            }
          } else if (arg.match(/^-[0-9]$/) && arg.match(negative) && checkAllAliases(arg.slice(1), flags2.bools)) {
            key = arg.slice(1);
            setArg(key, defaultValue(key));
          } else if (arg === "--") {
            notFlags = args.slice(i7 + 1);
            break;
          } else if (configuration["halt-at-non-option"]) {
            notFlags = args.slice(i7);
            break;
          } else {
            pushPositional(arg);
          }
        }
        applyEnvVars(argv, true);
        applyEnvVars(argv, false);
        setConfig(argv);
        setConfigObjects();
        applyDefaultsAndAliases(argv, flags2.aliases, defaults3, true);
        applyCoercions(argv);
        if (configuration["set-placeholder-key"])
          setPlaceholderKeys(argv);
        Object.keys(flags2.counts).forEach(function(key) {
          if (!hasKey(argv, key.split(".")))
            setArg(key, 0);
        });
        if (notFlagsOption && notFlags.length)
          argv[notFlagsArgv] = [];
        notFlags.forEach(function(key) {
          argv[notFlagsArgv].push(key);
        });
        if (configuration["camel-case-expansion"] && configuration["strip-dashed"]) {
          Object.keys(argv).filter((key) => key !== "--" && key.includes("-")).forEach((key) => {
            delete argv[key];
          });
        }
        if (configuration["strip-aliased"]) {
          [].concat(...Object.keys(aliases2).map((k7) => aliases2[k7])).forEach((alias) => {
            if (configuration["camel-case-expansion"] && alias.includes("-")) {
              delete argv[alias.split(".").map((prop) => camelCase(prop)).join(".")];
            }
            delete argv[alias];
          });
        }
        function pushPositional(arg) {
          const maybeCoercedNumber = maybeCoerceNumber("_", arg);
          if (typeof maybeCoercedNumber === "string" || typeof maybeCoercedNumber === "number") {
            argv._.push(maybeCoercedNumber);
          }
        }
        __name(pushPositional, "pushPositional");
        function eatNargs(i7, key, args2, argAfterEqualSign) {
          let ii;
          let toEat = checkAllAliases(key, flags2.nargs);
          toEat = typeof toEat !== "number" || isNaN(toEat) ? 1 : toEat;
          if (toEat === 0) {
            if (!isUndefined(argAfterEqualSign)) {
              error2 = Error(__("Argument unexpected for: %s", key));
            }
            setArg(key, defaultValue(key));
            return i7;
          }
          let available = isUndefined(argAfterEqualSign) ? 0 : 1;
          if (configuration["nargs-eats-options"]) {
            if (args2.length - (i7 + 1) + available < toEat) {
              error2 = Error(__("Not enough arguments following: %s", key));
            }
            available = toEat;
          } else {
            for (ii = i7 + 1; ii < args2.length; ii++) {
              if (!args2[ii].match(/^-[^0-9]/) || args2[ii].match(negative) || isUnknownOptionAsArg(args2[ii]))
                available++;
              else
                break;
            }
            if (available < toEat)
              error2 = Error(__("Not enough arguments following: %s", key));
          }
          let consumed = Math.min(available, toEat);
          if (!isUndefined(argAfterEqualSign) && consumed > 0) {
            setArg(key, argAfterEqualSign);
            consumed--;
          }
          for (ii = i7 + 1; ii < consumed + i7 + 1; ii++) {
            setArg(key, args2[ii]);
          }
          return i7 + consumed;
        }
        __name(eatNargs, "eatNargs");
        function eatArray(i7, key, args2, argAfterEqualSign) {
          let argsToSet = [];
          let next = argAfterEqualSign || args2[i7 + 1];
          const nargsCount = checkAllAliases(key, flags2.nargs);
          if (checkAllAliases(key, flags2.bools) && !/^(true|false)$/.test(next)) {
            argsToSet.push(true);
          } else if (isUndefined(next) || isUndefined(argAfterEqualSign) && /^-/.test(next) && !negative.test(next) && !isUnknownOptionAsArg(next)) {
            if (defaults3[key] !== void 0) {
              const defVal = defaults3[key];
              argsToSet = Array.isArray(defVal) ? defVal : [defVal];
            }
          } else {
            if (!isUndefined(argAfterEqualSign)) {
              argsToSet.push(processValue(key, argAfterEqualSign, true));
            }
            for (let ii = i7 + 1; ii < args2.length; ii++) {
              if (!configuration["greedy-arrays"] && argsToSet.length > 0 || nargsCount && typeof nargsCount === "number" && argsToSet.length >= nargsCount)
                break;
              next = args2[ii];
              if (/^-/.test(next) && !negative.test(next) && !isUnknownOptionAsArg(next))
                break;
              i7 = ii;
              argsToSet.push(processValue(key, next, inputIsString));
            }
          }
          if (typeof nargsCount === "number" && (nargsCount && argsToSet.length < nargsCount || isNaN(nargsCount) && argsToSet.length === 0)) {
            error2 = Error(__("Not enough arguments following: %s", key));
          }
          setArg(key, argsToSet);
          return i7;
        }
        __name(eatArray, "eatArray");
        function setArg(key, val2, shouldStripQuotes = inputIsString) {
          if (/-/.test(key) && configuration["camel-case-expansion"]) {
            const alias = key.split(".").map(function(prop) {
              return camelCase(prop);
            }).join(".");
            addNewAlias(key, alias);
          }
          const value = processValue(key, val2, shouldStripQuotes);
          const splitKey = key.split(".");
          setKey(argv, splitKey, value);
          if (flags2.aliases[key]) {
            flags2.aliases[key].forEach(function(x7) {
              const keyProperties = x7.split(".");
              setKey(argv, keyProperties, value);
            });
          }
          if (splitKey.length > 1 && configuration["dot-notation"]) {
            (flags2.aliases[splitKey[0]] || []).forEach(function(x7) {
              let keyProperties = x7.split(".");
              const a7 = [].concat(splitKey);
              a7.shift();
              keyProperties = keyProperties.concat(a7);
              if (!(flags2.aliases[key] || []).includes(keyProperties.join("."))) {
                setKey(argv, keyProperties, value);
              }
            });
          }
          if (checkAllAliases(key, flags2.normalize) && !checkAllAliases(key, flags2.arrays)) {
            const keys = [key].concat(flags2.aliases[key] || []);
            keys.forEach(function(key2) {
              Object.defineProperty(argvReturn, key2, {
                enumerable: true,
                get() {
                  return val2;
                },
                set(value2) {
                  val2 = typeof value2 === "string" ? mixin.normalize(value2) : value2;
                }
              });
            });
          }
        }
        __name(setArg, "setArg");
        function addNewAlias(key, alias) {
          if (!(flags2.aliases[key] && flags2.aliases[key].length)) {
            flags2.aliases[key] = [alias];
            newAliases[alias] = true;
          }
          if (!(flags2.aliases[alias] && flags2.aliases[alias].length)) {
            addNewAlias(alias, key);
          }
        }
        __name(addNewAlias, "addNewAlias");
        function processValue(key, val2, shouldStripQuotes) {
          if (shouldStripQuotes) {
            val2 = stripQuotes(val2);
          }
          if (checkAllAliases(key, flags2.bools) || checkAllAliases(key, flags2.counts)) {
            if (typeof val2 === "string")
              val2 = val2 === "true";
          }
          let value = Array.isArray(val2) ? val2.map(function(v8) {
            return maybeCoerceNumber(key, v8);
          }) : maybeCoerceNumber(key, val2);
          if (checkAllAliases(key, flags2.counts) && (isUndefined(value) || typeof value === "boolean")) {
            value = increment();
          }
          if (checkAllAliases(key, flags2.normalize) && checkAllAliases(key, flags2.arrays)) {
            if (Array.isArray(val2))
              value = val2.map((val3) => {
                return mixin.normalize(val3);
              });
            else
              value = mixin.normalize(val2);
          }
          return value;
        }
        __name(processValue, "processValue");
        function maybeCoerceNumber(key, value) {
          if (!configuration["parse-positional-numbers"] && key === "_")
            return value;
          if (!checkAllAliases(key, flags2.strings) && !checkAllAliases(key, flags2.bools) && !Array.isArray(value)) {
            const shouldCoerceNumber = looksLikeNumber(value) && configuration["parse-numbers"] && Number.isSafeInteger(Math.floor(parseFloat(`${value}`)));
            if (shouldCoerceNumber || !isUndefined(value) && checkAllAliases(key, flags2.numbers)) {
              value = Number(value);
            }
          }
          return value;
        }
        __name(maybeCoerceNumber, "maybeCoerceNumber");
        function setConfig(argv2) {
          const configLookup = /* @__PURE__ */ Object.create(null);
          applyDefaultsAndAliases(configLookup, flags2.aliases, defaults3);
          Object.keys(flags2.configs).forEach(function(configKey) {
            const configPath = argv2[configKey] || configLookup[configKey];
            if (configPath) {
              try {
                let config = null;
                const resolvedConfigPath = mixin.resolve(mixin.cwd(), configPath);
                const resolveConfig2 = flags2.configs[configKey];
                if (typeof resolveConfig2 === "function") {
                  try {
                    config = resolveConfig2(resolvedConfigPath);
                  } catch (e10) {
                    config = e10;
                  }
                  if (config instanceof Error) {
                    error2 = config;
                    return;
                  }
                } else {
                  config = mixin.require(resolvedConfigPath);
                }
                setConfigObject(config);
              } catch (ex) {
                if (ex.name === "PermissionDenied")
                  error2 = ex;
                else if (argv2[configKey])
                  error2 = Error(__("Invalid JSON config file: %s", configPath));
              }
            }
          });
        }
        __name(setConfig, "setConfig");
        function setConfigObject(config, prev) {
          Object.keys(config).forEach(function(key) {
            const value = config[key];
            const fullKey = prev ? prev + "." + key : key;
            if (typeof value === "object" && value !== null && !Array.isArray(value) && configuration["dot-notation"]) {
              setConfigObject(value, fullKey);
            } else {
              if (!hasKey(argv, fullKey.split(".")) || checkAllAliases(fullKey, flags2.arrays) && configuration["combine-arrays"]) {
                setArg(fullKey, value);
              }
            }
          });
        }
        __name(setConfigObject, "setConfigObject");
        function setConfigObjects() {
          if (typeof configObjects !== "undefined") {
            configObjects.forEach(function(configObject) {
              setConfigObject(configObject);
            });
          }
        }
        __name(setConfigObjects, "setConfigObjects");
        function applyEnvVars(argv2, configOnly) {
          if (typeof envPrefix === "undefined")
            return;
          const prefix = typeof envPrefix === "string" ? envPrefix : "";
          const env6 = mixin.env();
          Object.keys(env6).forEach(function(envVar) {
            if (prefix === "" || envVar.lastIndexOf(prefix, 0) === 0) {
              const keys = envVar.split("__").map(function(key, i7) {
                if (i7 === 0) {
                  key = key.substring(prefix.length);
                }
                return camelCase(key);
              });
              if ((configOnly && flags2.configs[keys.join(".")] || !configOnly) && !hasKey(argv2, keys)) {
                setArg(keys.join("."), env6[envVar]);
              }
            }
          });
        }
        __name(applyEnvVars, "applyEnvVars");
        function applyCoercions(argv2) {
          let coerce6;
          const applied = /* @__PURE__ */ new Set();
          Object.keys(argv2).forEach(function(key) {
            if (!applied.has(key)) {
              coerce6 = checkAllAliases(key, flags2.coercions);
              if (typeof coerce6 === "function") {
                try {
                  const value = maybeCoerceNumber(key, coerce6(argv2[key]));
                  [].concat(flags2.aliases[key] || [], key).forEach((ali) => {
                    applied.add(ali);
                    argv2[ali] = value;
                  });
                } catch (err) {
                  error2 = err;
                }
              }
            }
          });
        }
        __name(applyCoercions, "applyCoercions");
        function setPlaceholderKeys(argv2) {
          flags2.keys.forEach((key) => {
            if (~key.indexOf("."))
              return;
            if (typeof argv2[key] === "undefined")
              argv2[key] = void 0;
          });
          return argv2;
        }
        __name(setPlaceholderKeys, "setPlaceholderKeys");
        function applyDefaultsAndAliases(obj, aliases3, defaults4, canLog = false) {
          Object.keys(defaults4).forEach(function(key) {
            if (!hasKey(obj, key.split("."))) {
              setKey(obj, key.split("."), defaults4[key]);
              if (canLog)
                defaulted[key] = true;
              (aliases3[key] || []).forEach(function(x7) {
                if (hasKey(obj, x7.split(".")))
                  return;
                setKey(obj, x7.split("."), defaults4[key]);
              });
            }
          });
        }
        __name(applyDefaultsAndAliases, "applyDefaultsAndAliases");
        function hasKey(obj, keys) {
          let o7 = obj;
          if (!configuration["dot-notation"])
            keys = [keys.join(".")];
          keys.slice(0, -1).forEach(function(key2) {
            o7 = o7[key2] || {};
          });
          const key = keys[keys.length - 1];
          if (typeof o7 !== "object")
            return false;
          else
            return key in o7;
        }
        __name(hasKey, "hasKey");
        function setKey(obj, keys, value) {
          let o7 = obj;
          if (!configuration["dot-notation"])
            keys = [keys.join(".")];
          keys.slice(0, -1).forEach(function(key2) {
            key2 = sanitizeKey(key2);
            if (typeof o7 === "object" && o7[key2] === void 0) {
              o7[key2] = {};
            }
            if (typeof o7[key2] !== "object" || Array.isArray(o7[key2])) {
              if (Array.isArray(o7[key2])) {
                o7[key2].push({});
              } else {
                o7[key2] = [o7[key2], {}];
              }
              o7 = o7[key2][o7[key2].length - 1];
            } else {
              o7 = o7[key2];
            }
          });
          const key = sanitizeKey(keys[keys.length - 1]);
          const isTypeArray = checkAllAliases(keys.join("."), flags2.arrays);
          const isValueArray = Array.isArray(value);
          let duplicate = configuration["duplicate-arguments-array"];
          if (!duplicate && checkAllAliases(key, flags2.nargs)) {
            duplicate = true;
            if (!isUndefined(o7[key]) && flags2.nargs[key] === 1 || Array.isArray(o7[key]) && o7[key].length === flags2.nargs[key]) {
              o7[key] = void 0;
            }
          }
          if (value === increment()) {
            o7[key] = increment(o7[key]);
          } else if (Array.isArray(o7[key])) {
            if (duplicate && isTypeArray && isValueArray) {
              o7[key] = configuration["flatten-duplicate-arrays"] ? o7[key].concat(value) : (Array.isArray(o7[key][0]) ? o7[key] : [o7[key]]).concat([value]);
            } else if (!duplicate && Boolean(isTypeArray) === Boolean(isValueArray)) {
              o7[key] = value;
            } else {
              o7[key] = o7[key].concat([value]);
            }
          } else if (o7[key] === void 0 && isTypeArray) {
            o7[key] = isValueArray ? value : [value];
          } else if (duplicate && !(o7[key] === void 0 || checkAllAliases(key, flags2.counts) || checkAllAliases(key, flags2.bools))) {
            o7[key] = [o7[key], value];
          } else {
            o7[key] = value;
          }
        }
        __name(setKey, "setKey");
        function extendAliases(...args2) {
          args2.forEach(function(obj) {
            Object.keys(obj || {}).forEach(function(key) {
              if (flags2.aliases[key])
                return;
              flags2.aliases[key] = [].concat(aliases2[key] || []);
              flags2.aliases[key].concat(key).forEach(function(x7) {
                if (/-/.test(x7) && configuration["camel-case-expansion"]) {
                  const c8 = camelCase(x7);
                  if (c8 !== key && flags2.aliases[key].indexOf(c8) === -1) {
                    flags2.aliases[key].push(c8);
                    newAliases[c8] = true;
                  }
                }
              });
              flags2.aliases[key].concat(key).forEach(function(x7) {
                if (x7.length > 1 && /[A-Z]/.test(x7) && configuration["camel-case-expansion"]) {
                  const c8 = decamelize(x7, "-");
                  if (c8 !== key && flags2.aliases[key].indexOf(c8) === -1) {
                    flags2.aliases[key].push(c8);
                    newAliases[c8] = true;
                  }
                }
              });
              flags2.aliases[key].forEach(function(x7) {
                flags2.aliases[x7] = [key].concat(flags2.aliases[key].filter(function(y5) {
                  return x7 !== y5;
                }));
              });
            });
          });
        }
        __name(extendAliases, "extendAliases");
        function checkAllAliases(key, flag) {
          const toCheck = [].concat(flags2.aliases[key] || [], key);
          const keys = Object.keys(flag);
          const setAlias = toCheck.find((key2) => keys.includes(key2));
          return setAlias ? flag[setAlias] : false;
        }
        __name(checkAllAliases, "checkAllAliases");
        function hasAnyFlag(key) {
          const flagsKeys = Object.keys(flags2);
          const toCheck = [].concat(flagsKeys.map((k7) => flags2[k7]));
          return toCheck.some(function(flag) {
            return Array.isArray(flag) ? flag.includes(key) : flag[key];
          });
        }
        __name(hasAnyFlag, "hasAnyFlag");
        function hasFlagsMatching(arg, ...patterns) {
          const toCheck = [].concat(...patterns);
          return toCheck.some(function(pattern) {
            const match3 = arg.match(pattern);
            return match3 && hasAnyFlag(match3[1]);
          });
        }
        __name(hasFlagsMatching, "hasFlagsMatching");
        function hasAllShortFlags(arg) {
          if (arg.match(negative) || !arg.match(/^-[^-]+/)) {
            return false;
          }
          let hasAllFlags = true;
          let next;
          const letters = arg.slice(1).split("");
          for (let j7 = 0; j7 < letters.length; j7++) {
            next = arg.slice(j7 + 2);
            if (!hasAnyFlag(letters[j7])) {
              hasAllFlags = false;
              break;
            }
            if (letters[j7 + 1] && letters[j7 + 1] === "=" || next === "-" || /[A-Za-z]/.test(letters[j7]) && /^-?\d+(\.\d*)?(e-?\d+)?$/.test(next) || letters[j7 + 1] && letters[j7 + 1].match(/\W/)) {
              break;
            }
          }
          return hasAllFlags;
        }
        __name(hasAllShortFlags, "hasAllShortFlags");
        function isUnknownOptionAsArg(arg) {
          return configuration["unknown-options-as-args"] && isUnknownOption(arg);
        }
        __name(isUnknownOptionAsArg, "isUnknownOptionAsArg");
        function isUnknownOption(arg) {
          arg = arg.replace(/^-{3,}/, "--");
          if (arg.match(negative)) {
            return false;
          }
          if (hasAllShortFlags(arg)) {
            return false;
          }
          const flagWithEquals = /^-+([^=]+?)=[\s\S]*$/;
          const normalFlag = /^-+([^=]+?)$/;
          const flagEndingInHyphen = /^-+([^=]+?)-$/;
          const flagEndingInDigits = /^-+([^=]+?\d+)$/;
          const flagEndingInNonWordCharacters = /^-+([^=]+?)\W+.*$/;
          return !hasFlagsMatching(arg, flagWithEquals, negatedBoolean, normalFlag, flagEndingInHyphen, flagEndingInDigits, flagEndingInNonWordCharacters);
        }
        __name(isUnknownOption, "isUnknownOption");
        function defaultValue(key) {
          if (!checkAllAliases(key, flags2.bools) && !checkAllAliases(key, flags2.counts) && `${key}` in defaults3) {
            return defaults3[key];
          } else {
            return defaultForType(guessType2(key));
          }
        }
        __name(defaultValue, "defaultValue");
        function defaultForType(type) {
          const def = {
            [DefaultValuesForTypeKey.BOOLEAN]: true,
            [DefaultValuesForTypeKey.STRING]: "",
            [DefaultValuesForTypeKey.NUMBER]: void 0,
            [DefaultValuesForTypeKey.ARRAY]: []
          };
          return def[type];
        }
        __name(defaultForType, "defaultForType");
        function guessType2(key) {
          let type = DefaultValuesForTypeKey.BOOLEAN;
          if (checkAllAliases(key, flags2.strings))
            type = DefaultValuesForTypeKey.STRING;
          else if (checkAllAliases(key, flags2.numbers))
            type = DefaultValuesForTypeKey.NUMBER;
          else if (checkAllAliases(key, flags2.bools))
            type = DefaultValuesForTypeKey.BOOLEAN;
          else if (checkAllAliases(key, flags2.arrays))
            type = DefaultValuesForTypeKey.ARRAY;
          return type;
        }
        __name(guessType2, "guessType");
        function isUndefined(num) {
          return num === void 0;
        }
        __name(isUndefined, "isUndefined");
        function checkConfiguration() {
          Object.keys(flags2.counts).find((key) => {
            if (checkAllAliases(key, flags2.arrays)) {
              error2 = Error(__("Invalid configuration: %s, opts.count excludes opts.array.", key));
              return true;
            } else if (checkAllAliases(key, flags2.nargs)) {
              error2 = Error(__("Invalid configuration: %s, opts.count excludes opts.narg.", key));
              return true;
            }
            return false;
          });
        }
        __name(checkConfiguration, "checkConfiguration");
        return {
          aliases: Object.assign({}, flags2.aliases),
          argv: Object.assign(argvReturn, argv),
          configuration,
          defaulted: Object.assign({}, defaulted),
          error: error2,
          newAliases: Object.assign({}, newAliases)
        };
      }
    };
    __name(combineAliases, "combineAliases");
    __name(increment, "increment");
    __name(sanitizeKey, "sanitizeKey");
    __name(stripQuotes, "stripQuotes");
  }
});
var _a, _b, _c, minNodeVersion, nodeVersion, env, parser, yargsParser, lib_default;
var init_lib = __esm({
  "../../node_modules/.pnpm/yargs-parser@21.1.1/node_modules/yargs-parser/build/lib/index.js"() {
    init_import_meta_url();
    init_string_utils();
    init_yargs_parser();
    minNodeVersion = process && process.env && process.env.YARGS_MIN_NODE_VERSION ? Number(process.env.YARGS_MIN_NODE_VERSION) : 12;
    nodeVersion = (_b = (_a = process === null || process === void 0 ? void 0 : process.versions) === null || _a === void 0 ? void 0 : _a.node) !== null && _b !== void 0 ? _b : (_c = process === null || process === void 0 ? void 0 : process.version) === null || _c === void 0 ? void 0 : _c.slice(1);
    if (nodeVersion) {
      const major = Number(nodeVersion.match(/^([^.]+)/)[1]);
      if (major < minNodeVersion) {
        throw Error(`yargs parser supports a minimum Node.js version of ${minNodeVersion}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);
      }
    }
    env = process ? process.env : {};
    parser = new YargsParser({
      cwd: process.cwd,
      env: /* @__PURE__ */ __name(() => {
        return env;
      }, "env"),
      format: util4.format,
      normalize: path3.normalize,
      resolve: path3.resolve,
      // TODO: figure  out a  way to combine ESM and CJS coverage, such  that
      // we can exercise all the lines below:
      require: /* @__PURE__ */ __name((path84) => {
        if (typeof __require !== "undefined") {
          return __require(path84);
        } else if (path84.match(/\.json$/)) {
          return JSON.parse(fs29.readFileSync(path84, "utf8"));
        } else {
          throw Error("only .json config files are supported in ESM");
        }
      }, "require")
    });
    yargsParser = /* @__PURE__ */ __name(function Parser(args, opts) {
      const result = parser.parse(args.slice(), opts);
      return result.argv;
    }, "Parser");
    yargsParser.detailed = function(args, opts) {
      return parser.parse(args.slice(), opts);
    };
    yargsParser.camelCase = camelCase;
    yargsParser.decamelize = decamelize;
    yargsParser.looksLikeNumber = looksLikeNumber;
    lib_default = yargsParser;
  }
});

// ../../node_modules/.pnpm/cliui@8.0.1/node_modules/cliui/build/lib/index.js
function addBorder(col, ts, style) {
  if (col.border) {
    if (/[.']-+[.']/.test(ts)) {
      return "";
    }
    if (ts.trim().length !== 0) {
      return style;
    }
    return "  ";
  }
  return "";
}
function _minWidth(col) {
  const padding = col.padding || [];
  const minWidth = 1 + (padding[left] || 0) + (padding[right] || 0);
  if (col.border) {
    return minWidth + 4;
  }
  return minWidth;
}
function getWindowWidth() {
  if (typeof process === "object" && process.stdout && process.stdout.columns) {
    return process.stdout.columns;
  }
  return 80;
}
function alignRight(str, width) {
  str = str.trim();
  const strWidth = mixin2.stringWidth(str);
  if (strWidth < width) {
    return " ".repeat(width - strWidth) + str;
  }
  return str;
}
function alignCenter(str, width) {
  str = str.trim();
  const strWidth = mixin2.stringWidth(str);
  if (strWidth >= width) {
    return str;
  }
  return " ".repeat(width - strWidth >> 1) + str;
}
function cliui(opts, _mixin) {
  mixin2 = _mixin;
  return new UI({
    width: (opts === null || opts === void 0 ? void 0 : opts.width) || getWindowWidth(),
    wrap: opts === null || opts === void 0 ? void 0 : opts.wrap
  });
}
var align, top, right, bottom, left, UI, mixin2;
var init_lib2 = __esm({
  "../../node_modules/.pnpm/cliui@8.0.1/node_modules/cliui/build/lib/index.js"() {
    init_import_meta_url();
    align = {
      right: alignRight,
      center: alignCenter
    };
    top = 0;
    right = 1;
    bottom = 2;
    left = 3;
    UI = class {
      static {
        __name(this, "UI");
      }
      constructor(opts) {
        var _a5;
        this.width = opts.width;
        this.wrap = (_a5 = opts.wrap) !== null && _a5 !== void 0 ? _a5 : true;
        this.rows = [];
      }
      span(...args) {
        const cols = this.div(...args);
        cols.span = true;
      }
      resetOutput() {
        this.rows = [];
      }
      div(...args) {
        if (args.length === 0) {
          this.div("");
        }
        if (this.wrap && this.shouldApplyLayoutDSL(...args) && typeof args[0] === "string") {
          return this.applyLayoutDSL(args[0]);
        }
        const cols = args.map((arg) => {
          if (typeof arg === "string") {
            return this.colFromString(arg);
          }
          return arg;
        });
        this.rows.push(cols);
        return cols;
      }
      shouldApplyLayoutDSL(...args) {
        return args.length === 1 && typeof args[0] === "string" && /[\t\n]/.test(args[0]);
      }
      applyLayoutDSL(str) {
        const rows = str.split("\n").map((row) => row.split("	"));
        let leftColumnWidth = 0;
        rows.forEach((columns) => {
          if (columns.length > 1 && mixin2.stringWidth(columns[0]) > leftColumnWidth) {
            leftColumnWidth = Math.min(Math.floor(this.width * 0.5), mixin2.stringWidth(columns[0]));
          }
        });
        rows.forEach((columns) => {
          this.div(...columns.map((r10, i7) => {
            return {
              text: r10.trim(),
              padding: this.measurePadding(r10),
              width: i7 === 0 && columns.length > 1 ? leftColumnWidth : void 0
            };
          }));
        });
        return this.rows[this.rows.length - 1];
      }
      colFromString(text) {
        return {
          text,
          padding: this.measurePadding(text)
        };
      }
      measurePadding(str) {
        const noAnsi = mixin2.stripAnsi(str);
        return [0, noAnsi.match(/\s*$/)[0].length, 0, noAnsi.match(/^\s*/)[0].length];
      }
      toString() {
        const lines = [];
        this.rows.forEach((row) => {
          this.rowToString(row, lines);
        });
        return lines.filter((line) => !line.hidden).map((line) => line.text).join("\n");
      }
      rowToString(row, lines) {
        this.rasterize(row).forEach((rrow, r10) => {
          let str = "";
          rrow.forEach((col, c8) => {
            const { width } = row[c8];
            const wrapWidth = this.negatePadding(row[c8]);
            let ts = col;
            if (wrapWidth > mixin2.stringWidth(col)) {
              ts += " ".repeat(wrapWidth - mixin2.stringWidth(col));
            }
            if (row[c8].align && row[c8].align !== "left" && this.wrap) {
              const fn2 = align[row[c8].align];
              ts = fn2(ts, wrapWidth);
              if (mixin2.stringWidth(ts) < wrapWidth) {
                ts += " ".repeat((width || 0) - mixin2.stringWidth(ts) - 1);
              }
            }
            const padding = row[c8].padding || [0, 0, 0, 0];
            if (padding[left]) {
              str += " ".repeat(padding[left]);
            }
            str += addBorder(row[c8], ts, "| ");
            str += ts;
            str += addBorder(row[c8], ts, " |");
            if (padding[right]) {
              str += " ".repeat(padding[right]);
            }
            if (r10 === 0 && lines.length > 0) {
              str = this.renderInline(str, lines[lines.length - 1]);
            }
          });
          lines.push({
            text: str.replace(/ +$/, ""),
            span: row.span
          });
        });
        return lines;
      }
      // if the full 'source' can render in
      // the target line, do so.
      renderInline(source, previousLine) {
        const match3 = source.match(/^ */);
        const leadingWhitespace = match3 ? match3[0].length : 0;
        const target = previousLine.text;
        const targetTextWidth = mixin2.stringWidth(target.trimRight());
        if (!previousLine.span) {
          return source;
        }
        if (!this.wrap) {
          previousLine.hidden = true;
          return target + source;
        }
        if (leadingWhitespace < targetTextWidth) {
          return source;
        }
        previousLine.hidden = true;
        return target.trimRight() + " ".repeat(leadingWhitespace - targetTextWidth) + source.trimLeft();
      }
      rasterize(row) {
        const rrows = [];
        const widths = this.columnWidths(row);
        let wrapped;
        row.forEach((col, c8) => {
          col.width = widths[c8];
          if (this.wrap) {
            wrapped = mixin2.wrap(col.text, this.negatePadding(col), { hard: true }).split("\n");
          } else {
            wrapped = col.text.split("\n");
          }
          if (col.border) {
            wrapped.unshift("." + "-".repeat(this.negatePadding(col) + 2) + ".");
            wrapped.push("'" + "-".repeat(this.negatePadding(col) + 2) + "'");
          }
          if (col.padding) {
            wrapped.unshift(...new Array(col.padding[top] || 0).fill(""));
            wrapped.push(...new Array(col.padding[bottom] || 0).fill(""));
          }
          wrapped.forEach((str, r10) => {
            if (!rrows[r10]) {
              rrows.push([]);
            }
            const rrow = rrows[r10];
            for (let i7 = 0; i7 < c8; i7++) {
              if (rrow[i7] === void 0) {
                rrow.push("");
              }
            }
            rrow.push(str);
          });
        });
        return rrows;
      }
      negatePadding(col) {
        let wrapWidth = col.width || 0;
        if (col.padding) {
          wrapWidth -= (col.padding[left] || 0) + (col.padding[right] || 0);
        }
        if (col.border) {
          wrapWidth -= 4;
        }
        return wrapWidth;
      }
      columnWidths(row) {
        if (!this.wrap) {
          return row.map((col) => {
            return col.width || mixin2.stringWidth(col.text);
          });
        }
        let unset = row.length;
        let remainingWidth = this.width;
        const widths = row.map((col) => {
          if (col.width) {
            unset--;
            remainingWidth -= col.width;
            return col.width;
          }
          return void 0;
        });
        const unsetWidth = unset ? Math.floor(remainingWidth / unset) : 0;
        return widths.map((w7, i7) => {
          if (w7 === void 0) {
            return Math.max(unsetWidth, _minWidth(row[i7]));
          }
          return w7;
        });
      }
    };
    __name(addBorder, "addBorder");
    __name(_minWidth, "_minWidth");
    __name(getWindowWidth, "getWindowWidth");
    __name(alignRight, "alignRight");
    __name(alignCenter, "alignCenter");
    __name(cliui, "cliui");
  }
});

// ../../node_modules/.pnpm/cliui@8.0.1/node_modules/cliui/build/lib/string-utils.js
function stripAnsi(str) {
  return str.replace(ansi, "");
}
function wrap(str, width) {
  const [start, end] = str.match(ansi) || ["", ""];
  str = stripAnsi(str);
  let wrapped = "";
  for (let i7 = 0; i7 < str.length; i7++) {
    if (i7 !== 0 && i7 % width === 0) {
      wrapped += "\n";
    }
    wrapped += str.charAt(i7);
  }
  if (start && end) {
    wrapped = `${start}${wrapped}${end}`;
  }
  return wrapped;
}
var ansi;
var init_string_utils2 = __esm({
  "../../node_modules/.pnpm/cliui@8.0.1/node_modules/cliui/build/lib/string-utils.js"() {
    init_import_meta_url();
    ansi = new RegExp("\x1B(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)", "g");
    __name(stripAnsi, "stripAnsi");
    __name(wrap, "wrap");
  }
});

// ../../node_modules/.pnpm/cliui@8.0.1/node_modules/cliui/index.mjs
function ui(opts) {
  return cliui(opts, {
    stringWidth: /* @__PURE__ */ __name((str) => {
      return [...str].length;
    }, "stringWidth"),
    stripAnsi,
    wrap
  });
}
var init_cliui = __esm({
  "../../node_modules/.pnpm/cliui@8.0.1/node_modules/cliui/index.mjs"() {
    init_import_meta_url();
    init_lib2();
    init_string_utils2();
    __name(ui, "ui");
  }
});
function sync_default(start, callback) {
  let dir2 = path3.resolve(".", start);
  let tmp, stats = fs29.statSync(dir2);
  if (!stats.isDirectory()) {
    dir2 = path3.dirname(dir2);
  }
  while (true) {
    tmp = callback(dir2, fs29.readdirSync(dir2));
    if (tmp) return path3.resolve(dir2, tmp);
    dir2 = path3.dirname(tmp = dir2);
    if (tmp === dir2) break;
  }
}
var init_sync = __esm({
  "../../node_modules/.pnpm/escalade@3.2.0/node_modules/escalade/sync/index.mjs"() {
    init_import_meta_url();
    __name(sync_default, "default");
  }
});
var node_default;
var init_node = __esm({
  "../../node_modules/.pnpm/y18n@5.0.8/node_modules/y18n/build/lib/platform-shims/node.js"() {
    init_import_meta_url();
    node_default = {
      fs: {
        readFileSync: fs29.readFileSync,
        writeFile: fs29.writeFile
      },
      format: util4.format,
      resolve: path3.resolve,
      exists: /* @__PURE__ */ __name((file3) => {
        try {
          return fs29.statSync(file3).isFile();
        } catch (err) {
          return false;
        }
      }, "exists")
    };
  }
});

// ../../node_modules/.pnpm/y18n@5.0.8/node_modules/y18n/build/lib/index.js
function y18n(opts, _shim) {
  shim2 = _shim;
  const y18n3 = new Y18N(opts);
  return {
    __: y18n3.__.bind(y18n3),
    __n: y18n3.__n.bind(y18n3),
    setLocale: y18n3.setLocale.bind(y18n3),
    getLocale: y18n3.getLocale.bind(y18n3),
    updateLocale: y18n3.updateLocale.bind(y18n3),
    locale: y18n3.locale
  };
}
var shim2, Y18N;
var init_lib3 = __esm({
  "../../node_modules/.pnpm/y18n@5.0.8/node_modules/y18n/build/lib/index.js"() {
    init_import_meta_url();
    Y18N = class {
      static {
        __name(this, "Y18N");
      }
      constructor(opts) {
        opts = opts || {};
        this.directory = opts.directory || "./locales";
        this.updateFiles = typeof opts.updateFiles === "boolean" ? opts.updateFiles : true;
        this.locale = opts.locale || "en";
        this.fallbackToLanguage = typeof opts.fallbackToLanguage === "boolean" ? opts.fallbackToLanguage : true;
        this.cache = /* @__PURE__ */ Object.create(null);
        this.writeQueue = [];
      }
      __(...args) {
        if (typeof arguments[0] !== "string") {
          return this._taggedLiteral(arguments[0], ...arguments);
        }
        const str = args.shift();
        let cb2 = /* @__PURE__ */ __name(function() {
        }, "cb");
        if (typeof args[args.length - 1] === "function")
          cb2 = args.pop();
        cb2 = cb2 || function() {
        };
        if (!this.cache[this.locale])
          this._readLocaleFile();
        if (!this.cache[this.locale][str] && this.updateFiles) {
          this.cache[this.locale][str] = str;
          this._enqueueWrite({
            directory: this.directory,
            locale: this.locale,
            cb: cb2
          });
        } else {
          cb2();
        }
        return shim2.format.apply(shim2.format, [this.cache[this.locale][str] || str].concat(args));
      }
      __n() {
        const args = Array.prototype.slice.call(arguments);
        const singular = args.shift();
        const plural2 = args.shift();
        const quantity = args.shift();
        let cb2 = /* @__PURE__ */ __name(function() {
        }, "cb");
        if (typeof args[args.length - 1] === "function")
          cb2 = args.pop();
        if (!this.cache[this.locale])
          this._readLocaleFile();
        let str = quantity === 1 ? singular : plural2;
        if (this.cache[this.locale][singular]) {
          const entry = this.cache[this.locale][singular];
          str = entry[quantity === 1 ? "one" : "other"];
        }
        if (!this.cache[this.locale][singular] && this.updateFiles) {
          this.cache[this.locale][singular] = {
            one: singular,
            other: plural2
          };
          this._enqueueWrite({
            directory: this.directory,
            locale: this.locale,
            cb: cb2
          });
        } else {
          cb2();
        }
        const values = [str];
        if (~str.indexOf("%d"))
          values.push(quantity);
        return shim2.format.apply(shim2.format, values.concat(args));
      }
      setLocale(locale) {
        this.locale = locale;
      }
      getLocale() {
        return this.locale;
      }
      updateLocale(obj) {
        if (!this.cache[this.locale])
          this._readLocaleFile();
        for (const key in obj) {
          if (Object.prototype.hasOwnProperty.call(obj, key)) {
            this.cache[this.locale][key] = obj[key];
          }
        }
      }
      _taggedLiteral(parts, ...args) {
        let str = "";
        parts.forEach(function(part, i7) {
          const arg = args[i7 + 1];
          str += part;
          if (typeof arg !== "undefined") {
            str += "%s";
          }
        });
        return this.__.apply(this, [str].concat([].slice.call(args, 1)));
      }
      _enqueueWrite(work) {
        this.writeQueue.push(work);
        if (this.writeQueue.length === 1)
          this._processWriteQueue();
      }
      _processWriteQueue() {
        const _this = this;
        const work = this.writeQueue[0];
        const directory = work.directory;
        const locale = work.locale;
        const cb2 = work.cb;
        const languageFile = this._resolveLocaleFile(directory, locale);
        const serializedLocale = JSON.stringify(this.cache[locale], null, 2);
        shim2.fs.writeFile(languageFile, serializedLocale, "utf-8", function(err) {
          _this.writeQueue.shift();
          if (_this.writeQueue.length > 0)
            _this._processWriteQueue();
          cb2(err);
        });
      }
      _readLocaleFile() {
        let localeLookup = {};
        const languageFile = this._resolveLocaleFile(this.directory, this.locale);
        try {
          if (shim2.fs.readFileSync) {
            localeLookup = JSON.parse(shim2.fs.readFileSync(languageFile, "utf-8"));
          }
        } catch (err) {
          if (err instanceof SyntaxError) {
            err.message = "syntax error in " + languageFile;
          }
          if (err.code === "ENOENT")
            localeLookup = {};
          else
            throw err;
        }
        this.cache[this.locale] = localeLookup;
      }
      _resolveLocaleFile(directory, locale) {
        let file3 = shim2.resolve(directory, "./", locale + ".json");
        if (this.fallbackToLanguage && !this._fileExistsSync(file3) && ~locale.lastIndexOf("_")) {
          const languageFile = shim2.resolve(directory, "./", locale.split("_")[0] + ".json");
          if (this._fileExistsSync(languageFile))
            file3 = languageFile;
        }
        return file3;
      }
      _fileExistsSync(file3) {
        return shim2.exists(file3);
      }
    };
    __name(y18n, "y18n");
  }
});

// ../../node_modules/.pnpm/y18n@5.0.8/node_modules/y18n/index.mjs
var y18n2, y18n_default;
var init_y18n = __esm({
  "../../node_modules/.pnpm/y18n@5.0.8/node_modules/y18n/index.mjs"() {
    init_import_meta_url();
    init_node();
    init_lib3();
    y18n2 = /* @__PURE__ */ __name((opts) => {
      return y18n(opts, node_default);
    }, "y18n");
    y18n_default = y18n2;
  }
});
var REQUIRE_ERROR, REQUIRE_DIRECTORY_ERROR, __dirname2, mainFilename, esm_default2;
var init_esm = __esm({
  "../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/lib/platform-shims/esm.mjs"() {
    init_import_meta_url();
    init_cliui();
    init_sync();
    init_lib();
    init_process_argv();
    init_yerror();
    init_y18n();
    REQUIRE_ERROR = "require is not supported by ESM";
    REQUIRE_DIRECTORY_ERROR = "loading a directory of commands is not supported yet for ESM";
    try {
      __dirname2 = Url.fileURLToPath(import_meta_url);
    } catch (e10) {
      __dirname2 = process.cwd();
    }
    mainFilename = __dirname2.substring(0, __dirname2.lastIndexOf("node_modules"));
    esm_default2 = {
      assert: {
        notStrictEqual: assert53.notStrictEqual,
        strictEqual: assert53.strictEqual
      },
      cliui: ui,
      findUp: sync_default,
      getEnv: /* @__PURE__ */ __name((key) => {
        return process.env[key];
      }, "getEnv"),
      inspect: util4.inspect,
      getCallerFile: /* @__PURE__ */ __name(() => {
        throw new YError(REQUIRE_DIRECTORY_ERROR);
      }, "getCallerFile"),
      getProcessArgvBin,
      mainFilename: mainFilename || process.cwd(),
      Parser: lib_default,
      path: {
        basename: path3.basename,
        dirname: path3.dirname,
        extname: path3.extname,
        relative: path3.relative,
        resolve: path3.resolve
      },
      process: {
        argv: /* @__PURE__ */ __name(() => process.argv, "argv"),
        cwd: process.cwd,
        emitWarning: /* @__PURE__ */ __name((warning, type) => process.emitWarning(warning, type), "emitWarning"),
        execPath: /* @__PURE__ */ __name(() => process.execPath, "execPath"),
        exit: process.exit,
        nextTick: process.nextTick,
        stdColumns: typeof process.stdout.columns !== "undefined" ? process.stdout.columns : null
      },
      readFileSync: fs29.readFileSync,
      require: /* @__PURE__ */ __name(() => {
        throw new YError(REQUIRE_ERROR);
      }, "require"),
      requireDirectory: /* @__PURE__ */ __name(() => {
        throw new YError(REQUIRE_DIRECTORY_ERROR);
      }, "requireDirectory"),
      stringWidth: /* @__PURE__ */ __name((str) => {
        return [...str].length;
      }, "stringWidth"),
      y18n: y18n_default({
        directory: path3.resolve(__dirname2, "../../../locales"),
        updateFiles: false
      })
    };
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/core/symbols.js
var require_symbols = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/core/symbols.js"(exports, module2) {
    init_import_meta_url();
    module2.exports = {
      kClose: Symbol("close"),
      kDestroy: Symbol("destroy"),
      kDispatch: Symbol("dispatch"),
      kUrl: Symbol("url"),
      kWriting: Symbol("writing"),
      kResuming: Symbol("resuming"),
      kQueue: Symbol("queue"),
      kConnect: Symbol("connect"),
      kConnecting: Symbol("connecting"),
      kKeepAliveDefaultTimeout: Symbol("default keep alive timeout"),
      kKeepAliveMaxTimeout: Symbol("max keep alive timeout"),
      kKeepAliveTimeoutThreshold: Symbol("keep alive timeout threshold"),
      kKeepAliveTimeoutValue: Symbol("keep alive timeout"),
      kKeepAlive: Symbol("keep alive"),
      kHeadersTimeout: Symbol("headers timeout"),
      kBodyTimeout: Symbol("body timeout"),
      kServerName: Symbol("server name"),
      kLocalAddress: Symbol("local address"),
      kHost: Symbol("host"),
      kNoRef: Symbol("no ref"),
      kBodyUsed: Symbol("used"),
      kBody: Symbol("abstracted request body"),
      kRunning: Symbol("running"),
      kBlocking: Symbol("blocking"),
      kPending: Symbol("pending"),
      kSize: Symbol("size"),
      kBusy: Symbol("busy"),
      kQueued: Symbol("queued"),
      kFree: Symbol("free"),
      kConnected: Symbol("connected"),
      kClosed: Symbol("closed"),
      kNeedDrain: Symbol("need drain"),
      kReset: Symbol("reset"),
      kDestroyed: Symbol.for("nodejs.stream.destroyed"),
      kResume: Symbol("resume"),
      kOnError: Symbol("on error"),
      kMaxHeadersSize: Symbol("max headers size"),
      kRunningIdx: Symbol("running index"),
      kPendingIdx: Symbol("pending index"),
      kError: Symbol("error"),
      kClients: Symbol("clients"),
      kClient: Symbol("client"),
      kParser: Symbol("parser"),
      kOnDestroyed: Symbol("destroy callbacks"),
      kPipelining: Symbol("pipelining"),
      kSocket: Symbol("socket"),
      kHostHeader: Symbol("host header"),
      kConnector: Symbol("connector"),
      kStrictContentLength: Symbol("strict content length"),
      kMaxRedirections: Symbol("maxRedirections"),
      kMaxRequests: Symbol("maxRequestsPerClient"),
      kProxy: Symbol("proxy agent options"),
      kCounter: Symbol("socket request counter"),
      kMaxResponseSize: Symbol("max response size"),
      kHTTP2Session: Symbol("http2Session"),
      kHTTP2SessionState: Symbol("http2Session state"),
      kRetryHandlerDefaultRetry: Symbol("retry agent default retry"),
      kConstruct: Symbol("constructable"),
      kListeners: Symbol("listeners"),
      kHTTPContext: Symbol("http context"),
      kMaxConcurrentStreams: Symbol("max concurrent streams"),
      kHTTP2InitialWindowSize: Symbol("http2 initial window size"),
      kHTTP2ConnectionWindowSize: Symbol("http2 connection window size"),
      kEnableConnectProtocol: Symbol("http2session connect protocol"),
      kRemoteSettings: Symbol("http2session remote settings"),
      kHTTP2Stream: Symbol("http2session client stream"),
      kPingInterval: Symbol("ping interval"),
      kNoProxyAgent: Symbol("no proxy agent"),
      kHttpProxyAgent: Symbol("http proxy agent"),
      kHttpsProxyAgent: Symbol("https proxy agent"),
      kSocks5ProxyAgent: Symbol("socks5 proxy agent")
    };
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/util/timers.js
var require_timers = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/util/timers.js"(exports, module2) {
    init_import_meta_url();
    var fastNow = 0;
    var RESOLUTION_MS = 1e3;
    var TICK_MS = (RESOLUTION_MS >> 1) - 1;
    var fastNowTimeout;
    var kFastTimer = Symbol("kFastTimer");
    var fastTimers = [];
    var NOT_IN_LIST = -2;
    var TO_BE_CLEARED = -1;
    var PENDING = 0;
    var ACTIVE = 1;
    function onTick() {
      fastNow += TICK_MS;
      let idx = 0;
      let len = fastTimers.length;
      while (idx < len) {
        const timer = fastTimers[idx];
        if (timer._state === PENDING) {
          timer._idleStart = fastNow - TICK_MS;
          timer._state = ACTIVE;
        } else if (timer._state === ACTIVE && fastNow >= timer._idleStart + timer._idleTimeout) {
          timer._state = TO_BE_CLEARED;
          timer._idleStart = -1;
          timer._onTimeout(timer._timerArg);
        }
        if (timer._state === TO_BE_CLEARED) {
          timer._state = NOT_IN_LIST;
          if (--len !== 0) {
            fastTimers[idx] = fastTimers[len];
          }
        } else {
          ++idx;
        }
      }
      fastTimers.length = len;
      if (fastTimers.length !== 0) {
        refreshTimeout();
      }
    }
    __name(onTick, "onTick");
    function refreshTimeout() {
      if (fastNowTimeout?.refresh) {
        fastNowTimeout.refresh();
      } else {
        clearTimeout(fastNowTimeout);
        fastNowTimeout = setTimeout(onTick, TICK_MS);
        fastNowTimeout?.unref();
      }
    }
    __name(refreshTimeout, "refreshTimeout");
    var FastTimer = class {
      static {
        __name(this, "FastTimer");
      }
      [kFastTimer] = true;
      /**
       * The state of the timer, which can be one of the following:
       * - NOT_IN_LIST (-2)
       * - TO_BE_CLEARED (-1)
       * - PENDING (0)
       * - ACTIVE (1)
       *
       * @type {-2|-1|0|1}
       * @private
       */
      _state = NOT_IN_LIST;
      /**
       * The number of milliseconds to wait before calling the callback.
       *
       * @type {number}
       * @private
       */
      _idleTimeout = -1;
      /**
       * The time in milliseconds when the timer was started. This value is used to
       * calculate when the timer should expire.
       *
       * @type {number}
       * @default -1
       * @private
       */
      _idleStart = -1;
      /**
       * The function to be executed when the timer expires.
       * @type {Function}
       * @private
       */
      _onTimeout;
      /**
       * The argument to be passed to the callback when the timer expires.
       *
       * @type {*}
       * @private
       */
      _timerArg;
      /**
       * @constructor
       * @param {Function} callback A function to be executed after the timer
       * expires.
       * @param {number} delay The time, in milliseconds that the timer should wait
       * before the specified function or code is executed.
       * @param {*} arg
       */
      constructor(callback, delay, arg) {
        this._onTimeout = callback;
        this._idleTimeout = delay;
        this._timerArg = arg;
        this.refresh();
      }
      /**
       * Sets the timer's start time to the current time, and reschedules the timer
       * to call its callback at the previously specified duration adjusted to the
       * current time.
       * Using this on a timer that has already called its callback will reactivate
       * the timer.
       *
       * @returns {void}
       */
      refresh() {
        if (this._state === NOT_IN_LIST) {
          fastTimers.push(this);
        }
        if (!fastNowTimeout || fastTimers.length === 1) {
          refreshTimeout();
        }
        this._state = PENDING;
      }
      /**
       * The `clear` method cancels the timer, preventing it from executing.
       *
       * @returns {void}
       * @private
       */
      clear() {
        this._state = TO_BE_CLEARED;
        this._idleStart = -1;
      }
    };
    module2.exports = {
      /**
       * The setTimeout() method sets a timer which executes a function once the
       * timer expires.
       * @param {Function} callback A function to be executed after the timer
       * expires.
       * @param {number} delay The time, in milliseconds that the timer should
       * wait before the specified function or code is executed.
       * @param {*} [arg] An optional argument to be passed to the callback function
       * when the timer expires.
       * @returns {NodeJS.Timeout|FastTimer}
       */
      setTimeout(callback, delay, arg) {
        return delay <= RESOLUTION_MS ? setTimeout(callback, delay, arg) : new FastTimer(callback, delay, arg);
      },
      /**
       * The clearTimeout method cancels an instantiated Timer previously created
       * by calling setTimeout.
       *
       * @param {NodeJS.Timeout|FastTimer} timeout
       */
      clearTimeout(timeout2) {
        if (timeout2[kFastTimer]) {
          timeout2.clear();
        } else {
          clearTimeout(timeout2);
        }
      },
      /**
       * The setFastTimeout() method sets a fastTimer which executes a function once
       * the timer expires.
       * @param {Function} callback A function to be executed after the timer
       * expires.
       * @param {number} delay The time, in milliseconds that the timer should
       * wait before the specified function or code is executed.
       * @param {*} [arg] An optional argument to be passed to the callback function
       * when the timer expires.
       * @returns {FastTimer}
       */
      setFastTimeout(callback, delay, arg) {
        return new FastTimer(callback, delay, arg);
      },
      /**
       * The clearTimeout method cancels an instantiated FastTimer previously
       * created by calling setFastTimeout.
       *
       * @param {FastTimer} timeout
       */
      clearFastTimeout(timeout2) {
        timeout2.clear();
      },
      /**
       * The now method returns the value of the internal fast timer clock.
       *
       * @returns {number}
       */
      now() {
        return fastNow;
      },
      /**
       * Trigger the onTick function to process the fastTimers array.
       * Exported for testing purposes only.
       * Marking as deprecated to discourage any use outside of testing.
       * @deprecated
       * @param {number} [delay=0] The delay in milliseconds to add to the now value.
       */
      tick(delay = 0) {
        fastNow += delay - RESOLUTION_MS + 1;
        onTick();
        onTick();
      },
      /**
       * Reset FastTimers.
       * Exported for testing purposes only.
       * Marking as deprecated to discourage any use outside of testing.
       * @deprecated
       */
      reset() {
        fastNow = 0;
        fastTimers.length = 0;
        clearTimeout(fastNowTimeout);
        fastNowTimeout = null;
      },
      /**
       * Exporting for testing purposes only.
       * Marking as deprecated to discourage any use outside of testing.
       * @deprecated
       */
      kFastTimer
    };
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/core/errors.js
var require_errors = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/core/errors.js"(exports, module2) {
    init_import_meta_url();
    var kUndiciError = Symbol.for("undici.error.UND_ERR");
    var UndiciError = class extends Error {
      static {
        __name(this, "UndiciError");
      }
      constructor(message, options) {
        super(message, options);
        this.name = "UndiciError";
        this.code = "UND_ERR";
      }
      static [Symbol.hasInstance](instance) {
        return instance && instance[kUndiciError] === true;
      }
      get [kUndiciError]() {
        return true;
      }
    };
    var kConnectTimeoutError = Symbol.for("undici.error.UND_ERR_CONNECT_TIMEOUT");
    var ConnectTimeoutError = class extends UndiciError {
      static {
        __name(this, "ConnectTimeoutError");
      }
      constructor(message) {
        super(message);
        this.name = "ConnectTimeoutError";
        this.message = message || "Connect Timeout Error";
        this.code = "UND_ERR_CONNECT_TIMEOUT";
      }
      static [Symbol.hasInstance](instance) {
        return instance && instance[kConnectTimeoutError] === true;
      }
      get [kConnectTimeoutError]() {
        return true;
      }
    };
    var kHeadersTimeoutError = Symbol.for("undici.error.UND_ERR_HEADERS_TIMEOUT");
    var HeadersTimeoutError = class extends UndiciError {
      static {
        __name(this, "HeadersTimeoutError");
      }
      constructor(message) {
        super(message);
        this.name = "HeadersTimeoutError";
        this.message = message || "Headers Timeout Error";
        this.code = "UND_ERR_HEADERS_TIMEOUT";
      }
      static [Symbol.hasInstance](instance) {
        return instance && instance[kHeadersTimeoutError] === true;
      }
      get [kHeadersTimeoutError]() {
        return true;
      }
    };
    var kHeadersOverflowError = Symbol.for("undici.error.UND_ERR_HEADERS_OVERFLOW");
    var HeadersOverflowError = class extends UndiciError {
      static {
        __name(this, "HeadersOverflowError");
      }
      constructor(message) {
        super(message);
        this.name = "HeadersOverflowError";
        this.message = message || "Headers Overflow Error";
        this.code = "UND_ERR_HEADERS_OVERFLOW";
      }
      static [Symbol.hasInstance](instance) {
        return instance && instance[kHeadersOverflowError] === true;
      }
      get [kHeadersOverflowError]() {
        return true;
      }
    };
    var kBodyTimeoutError = Symbol.for("undici.error.UND_ERR_BODY_TIMEOUT");
    var BodyTimeoutError = class extends UndiciError {
      static {
        __name(this, "BodyTimeoutError");
      }
      constructor(message) {
        super(message);
        this.name = "BodyTimeoutError";
        this.message = message || "Body Timeout Error";
        this.code = "UND_ERR_BODY_TIMEOUT";
      }
      static [Symbol.hasInstance](instance) {
        return instance && instance[kBodyTimeoutError] === true;
      }
      get [kBodyTimeoutError]() {
        return true;
      }
    };
    var kInvalidArgumentError = Symbol.for("undici.error.UND_ERR_INVALID_ARG");
    var InvalidArgumentError = class extends UndiciError {
      static {
        __name(this, "InvalidArgumentError");
      }
      constructor(message) {
        super(message);
        this.name = "InvalidArgumentError";
        this.message = message || "Invalid Argument Error";
        this.code = "UND_ERR_INVALID_ARG";
      }
      static [Symbol.hasInstance](instance) {
        return instance && instance[kInvalidArgumentError] === true;
      }
      get [kInvalidArgumentError]() {
        return true;
      }
    };
    var kInvalidReturnValueError = Symbol.for("undici.error.UND_ERR_INVALID_RETURN_VALUE");
    var InvalidReturnValueError = class extends UndiciError {
      static {
        __name(this, "InvalidReturnValueError");
      }
      constructor(message) {
        super(message);
        this.name = "InvalidReturnValueError";
        this.message = message || "Invalid Return Value Error";
        this.code = "UND_ERR_INVALID_RETURN_VALUE";
      }
      static [Symbol.hasInstance](instance) {
        return instance && instance[kInvalidReturnValueError] === true;
      }
      get [kInvalidReturnValueError]() {
        return true;
      }
    };
    var kAbortError = Symbol.for("undici.error.UND_ERR_ABORT");
    var AbortError2 = class extends UndiciError {
      static {
        __name(this, "AbortError");
      }
      constructor(message) {
        super(message);
        this.name = "AbortError";
        this.message = message || "The operation was aborted";
        this.code = "UND_ERR_ABORT";
      }
      static [Symbol.hasInstance](instance) {
        return instance && instance[kAbortError] === true;
      }
      get [kAbortError]() {
        return true;
      }
    };
    var kRequestAbortedError = Symbol.for("undici.error.UND_ERR_ABORTED");
    var RequestAbortedError = class extends AbortError2 {
      static {
        __name(this, "RequestAbortedError");
      }
      constructor(message) {
        super(message);
        this.name = "AbortError";
        this.message = message || "Request aborted";
        this.code = "UND_ERR_ABORTED";
      }
      static [Symbol.hasInstance](instance) {
        return instance && instance[kRequestAbortedError] === true;
      }
      get [kRequestAbortedError]() {
        return true;
      }
    };
    var kInformationalError = Symbol.for("undici.error.UND_ERR_INFO");
    var InformationalError = class extends UndiciError {
      static {
        __name(this, "InformationalError");
      }
      constructor(message) {
        super(message);
        this.name = "InformationalError";
        this.message = message || "Request information";
        this.code = "UND_ERR_INFO";
      }
      static [Symbol.hasInstance](instance) {
        return instance && instance[kInformationalError] === true;
      }
      get [kInformationalError]() {
        return true;
      }
    };
    var kRequestContentLengthMismatchError = Symbol.for("undici.error.UND_ERR_REQ_CONTENT_LENGTH_MISMATCH");
    var RequestContentLengthMismatchError = class extends UndiciError {
      static {
        __name(this, "RequestContentLengthMismatchError");
      }
      constructor(message) {
        super(message);
        this.name = "RequestContentLengthMismatchError";
        this.message = message || "Request body length does not match content-length header";
        this.code = "UND_ERR_REQ_CONTENT_LENGTH_MISMATCH";
      }
      static [Symbol.hasInstance](instance) {
        return instance && instance[kRequestContentLengthMismatchError] === true;
      }
      get [kRequestContentLengthMismatchError]() {
        return true;
      }
    };
    var kResponseContentLengthMismatchError = Symbol.for("undici.error.UND_ERR_RES_CONTENT_LENGTH_MISMATCH");
    var ResponseContentLengthMismatchError = class extends UndiciError {
      static {
        __name(this, "ResponseContentLengthMismatchError");
      }
      constructor(message) {
        super(message);
        this.name = "ResponseContentLengthMismatchError";
        this.message = message || "Response body length does not match content-length header";
        this.code = "UND_ERR_RES_CONTENT_LENGTH_MISMATCH";
      }
      static [Symbol.hasInstance](instance) {
        return instance && instance[kResponseContentLengthMismatchError] === true;
      }
      get [kResponseContentLengthMismatchError]() {
        return true;
      }
    };
    var kClientDestroyedError = Symbol.for("undici.error.UND_ERR_DESTROYED");
    var ClientDestroyedError = class extends UndiciError {
      static {
        __name(this, "ClientDestroyedError");
      }
      constructor(message) {
        super(message);
        this.name = "ClientDestroyedError";
        this.message = message || "The client is destroyed";
        this.code = "UND_ERR_DESTROYED";
      }
      static [Symbol.hasInstance](instance) {
        return instance && instance[kClientDestroyedError] === true;
      }
      get [kClientDestroyedError]() {
        return true;
      }
    };
    var kClientClosedError = Symbol.for("undici.error.UND_ERR_CLOSED");
    var ClientClosedError = class extends UndiciError {
      static {
        __name(this, "ClientClosedError");
      }
      constructor(message) {
        super(message);
        this.name = "ClientClosedError";
        this.message = message || "The client is closed";
        this.code = "UND_ERR_CLOSED";
      }
      static [Symbol.hasInstance](instance) {
        return instance && instance[kClientClosedError] === true;
      }
      get [kClientClosedError]() {
        return true;
      }
    };
    var kSocketError = Symbol.for("undici.error.UND_ERR_SOCKET");
    var SocketError = class extends UndiciError {
      static {
        __name(this, "SocketError");
      }
      constructor(message, socket) {
        super(message);
        this.name = "SocketError";
        this.message = message || "Socket error";
        this.code = "UND_ERR_SOCKET";
        this.socket = socket;
      }
      static [Symbol.hasInstance](instance) {
        return instance && instance[kSocketError] === true;
      }
      get [kSocketError]() {
        return true;
      }
    };
    var kNotSupportedError = Symbol.for("undici.error.UND_ERR_NOT_SUPPORTED");
    var NotSupportedError = class extends UndiciError {
      static {
        __name(this, "NotSupportedError");
      }
      constructor(message) {
        super(message);
        this.name = "NotSupportedError";
        this.message = message || "Not supported error";
        this.code = "UND_ERR_NOT_SUPPORTED";
      }
      static [Symbol.hasInstance](instance) {
        return instance && instance[kNotSupportedError] === true;
      }
      get [kNotSupportedError]() {
        return true;
      }
    };
    var kBalancedPoolMissingUpstreamError = Symbol.for("undici.error.UND_ERR_BPL_MISSING_UPSTREAM");
    var BalancedPoolMissingUpstreamError = class extends UndiciError {
      static {
        __name(this, "BalancedPoolMissingUpstreamError");
      }
      constructor(message) {
        super(message);
        this.name = "MissingUpstreamError";
        this.message = message || "No upstream has been added to the BalancedPool";
        this.code = "UND_ERR_BPL_MISSING_UPSTREAM";
      }
      static [Symbol.hasInstance](instance) {
        return instance && instance[kBalancedPoolMissingUpstreamError] === true;
      }
      get [kBalancedPoolMissingUpstreamError]() {
        return true;
      }
    };
    var kHTTPParserError = Symbol.for("undici.error.UND_ERR_HTTP_PARSER");
    var HTTPParserError = class extends Error {
      static {
        __name(this, "HTTPParserError");
      }
      constructor(message, code, data) {
        super(message);
        this.name = "HTTPParserError";
        this.code = code ? `HPE_${code}` : void 0;
        this.data = data ? data.toString() : void 0;
      }
      static [Symbol.hasInstance](instance) {
        return instance && instance[kHTTPParserError] === true;
      }
      get [kHTTPParserError]() {
        return true;
      }
    };
    var kResponseExceededMaxSizeError = Symbol.for("undici.error.UND_ERR_RES_EXCEEDED_MAX_SIZE");
    var ResponseExceededMaxSizeError = class extends UndiciError {
      static {
        __name(this, "ResponseExceededMaxSizeError");
      }
      constructor(message) {
        super(message);
        this.name = "ResponseExceededMaxSizeError";
        this.message = message || "Response content exceeded max size";
        this.code = "UND_ERR_RES_EXCEEDED_MAX_SIZE";
      }
      static [Symbol.hasInstance](instance) {
        return instance && instance[kResponseExceededMaxSizeError] === true;
      }
      get [kResponseExceededMaxSizeError]() {
        return true;
      }
    };
    var kRequestRetryError = Symbol.for("undici.error.UND_ERR_REQ_RETRY");
    var RequestRetryError = class extends UndiciError {
      static {
        __name(this, "RequestRetryError");
      }
      constructor(message, code, { headers, data }) {
        super(message);
        this.name = "RequestRetryError";
        this.message = message || "Request retry error";
        this.code = "UND_ERR_REQ_RETRY";
        this.statusCode = code;
        this.data = data;
        this.headers = headers;
      }
      static [Symbol.hasInstance](instance) {
        return instance && instance[kRequestRetryError] === true;
      }
      get [kRequestRetryError]() {
        return true;
      }
    };
    var kResponseError = Symbol.for("undici.error.UND_ERR_RESPONSE");
    var ResponseError = class extends UndiciError {
      static {
        __name(this, "ResponseError");
      }
      constructor(message, code, { headers, body }) {
        super(message);
        this.name = "ResponseError";
        this.message = message || "Response error";
        this.code = "UND_ERR_RESPONSE";
        this.statusCode = code;
        this.body = body;
        this.headers = headers;
      }
      static [Symbol.hasInstance](instance) {
        return instance && instance[kResponseError] === true;
      }
      get [kResponseError]() {
        return true;
      }
    };
    var kSecureProxyConnectionError = Symbol.for("undici.error.UND_ERR_PRX_TLS");
    var SecureProxyConnectionError = class extends UndiciError {
      static {
        __name(this, "SecureProxyConnectionError");
      }
      constructor(cause, message, options = {}) {
        super(message, { cause, ...options });
        this.name = "SecureProxyConnectionError";
        this.message = message || "Secure Proxy Connection failed";
        this.code = "UND_ERR_PRX_TLS";
        this.cause = cause;
      }
      static [Symbol.hasInstance](instance) {
        return instance && instance[kSecureProxyConnectionError] === true;
      }
      get [kSecureProxyConnectionError]() {
        return true;
      }
    };
    var kMaxOriginsReachedError = Symbol.for("undici.error.UND_ERR_MAX_ORIGINS_REACHED");
    var MaxOriginsReachedError = class extends UndiciError {
      static {
        __name(this, "MaxOriginsReachedError");
      }
      constructor(message) {
        super(message);
        this.name = "MaxOriginsReachedError";
        this.message = message || "Maximum allowed origins reached";
        this.code = "UND_ERR_MAX_ORIGINS_REACHED";
      }
      static [Symbol.hasInstance](instance) {
        return instance && instance[kMaxOriginsReachedError] === true;
      }
      get [kMaxOriginsReachedError]() {
        return true;
      }
    };
    var Socks5ProxyError = class extends UndiciError {
      static {
        __name(this, "Socks5ProxyError");
      }
      constructor(message, code) {
        super(message);
        this.name = "Socks5ProxyError";
        this.message = message || "SOCKS5 proxy error";
        this.code = code || "UND_ERR_SOCKS5";
      }
    };
    var kMessageSizeExceededError = Symbol.for("undici.error.UND_ERR_WS_MESSAGE_SIZE_EXCEEDED");
    var MessageSizeExceededError = class extends UndiciError {
      static {
        __name(this, "MessageSizeExceededError");
      }
      constructor(message) {
        super(message);
        this.name = "MessageSizeExceededError";
        this.message = message || "Max decompressed message size exceeded";
        this.code = "UND_ERR_WS_MESSAGE_SIZE_EXCEEDED";
      }
      static [Symbol.hasInstance](instance) {
        return instance && instance[kMessageSizeExceededError] === true;
      }
      get [kMessageSizeExceededError]() {
        return true;
      }
    };
    module2.exports = {
      AbortError: AbortError2,
      HTTPParserError,
      UndiciError,
      HeadersTimeoutError,
      HeadersOverflowError,
      BodyTimeoutError,
      RequestContentLengthMismatchError,
      ConnectTimeoutError,
      InvalidArgumentError,
      InvalidReturnValueError,
      RequestAbortedError,
      ClientDestroyedError,
      ClientClosedError,
      InformationalError,
      SocketError,
      NotSupportedError,
      ResponseContentLengthMismatchError,
      BalancedPoolMissingUpstreamError,
      ResponseExceededMaxSizeError,
      RequestRetryError,
      ResponseError,
      SecureProxyConnectionError,
      MaxOriginsReachedError,
      Socks5ProxyError,
      MessageSizeExceededError
    };
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/core/constants.js
var require_constants = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/core/constants.js"(exports, module2) {
    init_import_meta_url();
    var wellknownHeaderNames = (
      /** @type {const} */
      [
        "Accept",
        "Accept-Encoding",
        "Accept-Language",
        "Accept-Ranges",
        "Access-Control-Allow-Credentials",
        "Access-Control-Allow-Headers",
        "Access-Control-Allow-Methods",
        "Access-Control-Allow-Origin",
        "Access-Control-Expose-Headers",
        "Access-Control-Max-Age",
        "Access-Control-Request-Headers",
        "Access-Control-Request-Method",
        "Age",
        "Allow",
        "Alt-Svc",
        "Alt-Used",
        "Authorization",
        "Cache-Control",
        "Clear-Site-Data",
        "Connection",
        "Content-Disposition",
        "Content-Encoding",
        "Content-Language",
        "Content-Length",
        "Content-Location",
        "Content-Range",
        "Content-Security-Policy",
        "Content-Security-Policy-Report-Only",
        "Content-Type",
        "Cookie",
        "Cross-Origin-Embedder-Policy",
        "Cross-Origin-Opener-Policy",
        "Cross-Origin-Resource-Policy",
        "Date",
        "Device-Memory",
        "Downlink",
        "ECT",
        "ETag",
        "Expect",
        "Expect-CT",
        "Expires",
        "Forwarded",
        "From",
        "Host",
        "If-Match",
        "If-Modified-Since",
        "If-None-Match",
        "If-Range",
        "If-Unmodified-Since",
        "Keep-Alive",
        "Last-Modified",
        "Link",
        "Location",
        "Max-Forwards",
        "Origin",
        "Permissions-Policy",
        "Pragma",
        "Proxy-Authenticate",
        "Proxy-Authorization",
        "RTT",
        "Range",
        "Referer",
        "Referrer-Policy",
        "Refresh",
        "Retry-After",
        "Sec-WebSocket-Accept",
        "Sec-WebSocket-Extensions",
        "Sec-WebSocket-Key",
        "Sec-WebSocket-Protocol",
        "Sec-WebSocket-Version",
        "Server",
        "Server-Timing",
        "Service-Worker-Allowed",
        "Service-Worker-Navigation-Preload",
        "Set-Cookie",
        "SourceMap",
        "Strict-Transport-Security",
        "Supports-Loading-Mode",
        "TE",
        "Timing-Allow-Origin",
        "Trailer",
        "Transfer-Encoding",
        "Upgrade",
        "Upgrade-Insecure-Requests",
        "User-Agent",
        "Vary",
        "Via",
        "WWW-Authenticate",
        "X-Content-Type-Options",
        "X-DNS-Prefetch-Control",
        "X-Frame-Options",
        "X-Permitted-Cross-Domain-Policies",
        "X-Powered-By",
        "X-Requested-With",
        "X-XSS-Protection"
      ]
    );
    var headerNameLowerCasedRecord = {};
    Object.setPrototypeOf(headerNameLowerCasedRecord, null);
    var wellknownHeaderNameBuffers = {};
    Object.setPrototypeOf(wellknownHeaderNameBuffers, null);
    function getHeaderNameAsBuffer(header) {
      let buffer = wellknownHeaderNameBuffers[header];
      if (buffer === void 0) {
        buffer = Buffer.from(header);
      }
      return buffer;
    }
    __name(getHeaderNameAsBuffer, "getHeaderNameAsBuffer");
    for (let i7 = 0; i7 < wellknownHeaderNames.length; ++i7) {
      const key = wellknownHeaderNames[i7];
      const lowerCasedKey = key.toLowerCase();
      headerNameLowerCasedRecord[key] = headerNameLowerCasedRecord[lowerCasedKey] = lowerCasedKey;
    }
    module2.exports = {
      wellknownHeaderNames,
      headerNameLowerCasedRecord,
      getHeaderNameAsBuffer
    };
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/core/tree.js
var require_tree = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/core/tree.js"(exports, module2) {
    init_import_meta_url();
    var {
      wellknownHeaderNames,
      headerNameLowerCasedRecord
    } = require_constants();
    var TstNode = class _TstNode {
      static {
        __name(this, "TstNode");
      }
      /** @type {any} */
      value = null;
      /** @type {null | TstNode} */
      left = null;
      /** @type {null | TstNode} */
      middle = null;
      /** @type {null | TstNode} */
      right = null;
      /** @type {number} */
      code;
      /**
       * @param {string} key
       * @param {any} value
       * @param {number} index
       */
      constructor(key, value, index) {
        if (index === void 0 || index >= key.length) {
          throw new TypeError("Unreachable");
        }
        const code = this.code = key.charCodeAt(index);
        if (code > 127) {
          throw new TypeError("key must be ascii string");
        }
        if (key.length !== ++index) {
          this.middle = new _TstNode(key, value, index);
        } else {
          this.value = value;
        }
      }
      /**
       * @param {string} key
       * @param {any} value
       * @returns {void}
       */
      add(key, value) {
        const length = key.length;
        if (length === 0) {
          throw new TypeError("Unreachable");
        }
        let index = 0;
        let node2 = this;
        while (true) {
          const code = key.charCodeAt(index);
          if (code > 127) {
            throw new TypeError("key must be ascii string");
          }
          if (node2.code === code) {
            if (length === ++index) {
              node2.value = value;
              break;
            } else if (node2.middle !== null) {
              node2 = node2.middle;
            } else {
              node2.middle = new _TstNode(key, value, index);
              break;
            }
          } else if (node2.code < code) {
            if (node2.left !== null) {
              node2 = node2.left;
            } else {
              node2.left = new _TstNode(key, value, index);
              break;
            }
          } else if (node2.right !== null) {
            node2 = node2.right;
          } else {
            node2.right = new _TstNode(key, value, index);
            break;
          }
        }
      }
      /**
       * @param {Uint8Array} key
       * @returns {TstNode | null}
       */
      search(key) {
        const keylength = key.length;
        let index = 0;
        let node2 = this;
        while (node2 !== null && index < keylength) {
          let code = key[index];
          if (code <= 90 && code >= 65) {
            code |= 32;
          }
          while (node2 !== null) {
            if (code === node2.code) {
              if (keylength === ++index) {
                return node2;
              }
              node2 = node2.middle;
              break;
            }
            node2 = node2.code < code ? node2.left : node2.right;
          }
        }
        return null;
      }
    };
    var TernarySearchTree = class {
      static {
        __name(this, "TernarySearchTree");
      }
      /** @type {TstNode | null} */
      node = null;
      /**
       * @param {string} key
       * @param {any} value
       * @returns {void}
       * */
      insert(key, value) {
        if (this.node === null) {
          this.node = new TstNode(key, value, 0);
        } else {
          this.node.add(key, value);
        }
      }
      /**
       * @param {Uint8Array} key
       * @returns {any}
       */
      lookup(key) {
        return this.node?.search(key)?.value ?? null;
      }
    };
    var tree = new TernarySearchTree();
    for (let i7 = 0; i7 < wellknownHeaderNames.length; ++i7) {
      const key = headerNameLowerCasedRecord[wellknownHeaderNames[i7]];
      tree.insert(key, key);
    }
    module2.exports = {
      TernarySearchTree,
      tree
    };
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/core/util.js
var require_util = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/core/util.js"(exports, module2) {
    init_import_meta_url();
    var assert61 = __require("assert");
    var { kDestroyed, kBodyUsed, kListeners, kBody } = require_symbols();
    var { IncomingMessage } = __require("http");
    var stream2 = __require("stream");
    var net3 = __require("net");
    var { stringify: stringify4 } = __require("querystring");
    var { EventEmitter: EE } = __require("events");
    var timers = require_timers();
    var { InvalidArgumentError, ConnectTimeoutError } = require_errors();
    var { headerNameLowerCasedRecord } = require_constants();
    var { tree } = require_tree();
    var [nodeMajor, nodeMinor] = process.versions.node.split(".", 2).map((v8) => Number(v8));
    var BodyAsyncIterable = class {
      static {
        __name(this, "BodyAsyncIterable");
      }
      constructor(body) {
        this[kBody] = body;
        this[kBodyUsed] = false;
      }
      async *[Symbol.asyncIterator]() {
        assert61(!this[kBodyUsed], "disturbed");
        this[kBodyUsed] = true;
        yield* this[kBody];
      }
    };
    function noop() {
    }
    __name(noop, "noop");
    function wrapRequestBody(body) {
      if (isStream2(body)) {
        if (bodyLength(body) === 0) {
          body.on("data", function() {
            assert61(false);
          });
        }
        if (typeof body.readableDidRead !== "boolean") {
          body[kBodyUsed] = false;
          EE.prototype.on.call(body, "data", function() {
            this[kBodyUsed] = true;
          });
        }
        return body;
      } else if (body && typeof body.pipeTo === "function") {
        return new BodyAsyncIterable(body);
      } else if (body && isFormDataLike(body)) {
        return body;
      } else if (body && typeof body !== "string" && !ArrayBuffer.isView(body) && isIterable(body)) {
        return new BodyAsyncIterable(body);
      } else {
        return body;
      }
    }
    __name(wrapRequestBody, "wrapRequestBody");
    function isStream2(obj) {
      return obj && typeof obj === "object" && typeof obj.pipe === "function" && typeof obj.on === "function";
    }
    __name(isStream2, "isStream");
    function isBlobLike2(object) {
      if (object === null) {
        return false;
      } else if (object instanceof Blob) {
        return true;
      } else if (typeof object !== "object") {
        return false;
      } else {
        const sTag = object[Symbol.toStringTag];
        return (sTag === "Blob" || sTag === "File") && ("stream" in object && typeof object.stream === "function" || "arrayBuffer" in object && typeof object.arrayBuffer === "function");
      }
    }
    __name(isBlobLike2, "isBlobLike");
    function pathHasQueryOrFragment(url4) {
      return url4.includes("?") || url4.includes("#");
    }
    __name(pathHasQueryOrFragment, "pathHasQueryOrFragment");
    function serializePathWithQuery(url4, queryParams) {
      if (pathHasQueryOrFragment(url4)) {
        throw new Error('Query params cannot be passed when url already contains "?" or "#".');
      }
      const stringified = stringify4(queryParams);
      if (stringified) {
        url4 += "?" + stringified;
      }
      return url4;
    }
    __name(serializePathWithQuery, "serializePathWithQuery");
    function isValidPort(port) {
      const value = parseInt(port, 10);
      return value === Number(port) && value >= 0 && value <= 65535;
    }
    __name(isValidPort, "isValidPort");
    function isHttpOrHttpsPrefixed(value) {
      return value != null && value[0] === "h" && value[1] === "t" && value[2] === "t" && value[3] === "p" && (value[4] === ":" || value[4] === "s" && value[5] === ":");
    }
    __name(isHttpOrHttpsPrefixed, "isHttpOrHttpsPrefixed");
    function parseURL3(url4) {
      if (typeof url4 === "string") {
        url4 = new URL(url4);
        if (!isHttpOrHttpsPrefixed(url4.origin || url4.protocol)) {
          throw new InvalidArgumentError("Invalid URL protocol: the URL must start with `http:` or `https:`.");
        }
        return url4;
      }
      if (!url4 || typeof url4 !== "object") {
        throw new InvalidArgumentError("Invalid URL: The URL argument must be a non-null object.");
      }
      if (!(url4 instanceof URL)) {
        if (url4.port != null && url4.port !== "" && isValidPort(url4.port) === false) {
          throw new InvalidArgumentError("Invalid URL: port must be a valid integer or a string representation of an integer.");
        }
        if (url4.path != null && typeof url4.path !== "string") {
          throw new InvalidArgumentError("Invalid URL path: the path must be a string or null/undefined.");
        }
        if (url4.pathname != null && typeof url4.pathname !== "string") {
          throw new InvalidArgumentError("Invalid URL pathname: the pathname must be a string or null/undefined.");
        }
        if (url4.hostname != null && typeof url4.hostname !== "string") {
          throw new InvalidArgumentError("Invalid URL hostname: the hostname must be a string or null/undefined.");
        }
        if (url4.origin != null && typeof url4.origin !== "string") {
          throw new InvalidArgumentError("Invalid URL origin: the origin must be a string or null/undefined.");
        }
        if (!isHttpOrHttpsPrefixed(url4.origin || url4.protocol)) {
          throw new InvalidArgumentError("Invalid URL protocol: the URL must start with `http:` or `https:`.");
        }
        const port = url4.port != null ? url4.port : url4.protocol === "https:" ? 443 : 80;
        let origin = url4.origin != null ? url4.origin : `${url4.protocol || ""}//${url4.hostname || ""}:${port}`;
        let path84 = url4.path != null ? url4.path : `${url4.pathname || ""}${url4.search || ""}`;
        if (origin[origin.length - 1] === "/") {
          origin = origin.slice(0, origin.length - 1);
        }
        if (path84 && path84[0] !== "/") {
          path84 = `/${path84}`;
        }
        return new URL(`${origin}${path84}`);
      }
      if (!isHttpOrHttpsPrefixed(url4.origin || url4.protocol)) {
        throw new InvalidArgumentError("Invalid URL protocol: the URL must start with `http:` or `https:`.");
      }
      return url4;
    }
    __name(parseURL3, "parseURL");
    function parseOrigin(url4) {
      url4 = parseURL3(url4);
      if (url4.pathname !== "/" || url4.search || url4.hash) {
        throw new InvalidArgumentError("invalid url");
      }
      return url4;
    }
    __name(parseOrigin, "parseOrigin");
    function getHostname(host) {
      if (host[0] === "[") {
        const idx2 = host.indexOf("]");
        assert61(idx2 !== -1);
        return host.substring(1, idx2);
      }
      const idx = host.indexOf(":");
      if (idx === -1) return host;
      return host.substring(0, idx);
    }
    __name(getHostname, "getHostname");
    function getServerName(host) {
      if (!host) {
        return null;
      }
      assert61(typeof host === "string");
      const servername = getHostname(host);
      if (net3.isIP(servername)) {
        return "";
      }
      return servername;
    }
    __name(getServerName, "getServerName");
    function deepClone(obj) {
      return JSON.parse(JSON.stringify(obj));
    }
    __name(deepClone, "deepClone");
    function isAsyncIterable(obj) {
      return !!(obj != null && typeof obj[Symbol.asyncIterator] === "function");
    }
    __name(isAsyncIterable, "isAsyncIterable");
    function isIterable(obj) {
      return !!(obj != null && (typeof obj[Symbol.iterator] === "function" || typeof obj[Symbol.asyncIterator] === "function"));
    }
    __name(isIterable, "isIterable");
    function hasSafeIterator(obj) {
      const prototype = Object.getPrototypeOf(obj);
      const ownIterator = Object.prototype.hasOwnProperty.call(obj, Symbol.iterator);
      return ownIterator || prototype != null && prototype !== Object.prototype && typeof obj[Symbol.iterator] === "function";
    }
    __name(hasSafeIterator, "hasSafeIterator");
    function bodyLength(body) {
      if (body == null) {
        return 0;
      } else if (isStream2(body)) {
        const state2 = body._readableState;
        return state2 && state2.objectMode === false && state2.ended === true && Number.isFinite(state2.length) ? state2.length : null;
      } else if (isBlobLike2(body)) {
        return body.size != null ? body.size : null;
      } else if (isBuffer(body)) {
        return body.byteLength;
      }
      return null;
    }
    __name(bodyLength, "bodyLength");
    function isDestroyed(body) {
      return body && !!(body.destroyed || body[kDestroyed] || stream2.isDestroyed?.(body));
    }
    __name(isDestroyed, "isDestroyed");
    function destroy(stream3, err) {
      if (stream3 == null || !isStream2(stream3) || isDestroyed(stream3)) {
        return;
      }
      if (typeof stream3.destroy === "function") {
        if (Object.getPrototypeOf(stream3).constructor === IncomingMessage) {
          stream3.socket = null;
        }
        stream3.destroy(err);
      } else if (err) {
        queueMicrotask(() => {
          stream3.emit("error", err);
        });
      }
      if (stream3.destroyed !== true) {
        stream3[kDestroyed] = true;
      }
    }
    __name(destroy, "destroy");
    var KEEPALIVE_TIMEOUT_EXPR = /timeout=(\d+)/;
    function parseKeepAliveTimeout(val2) {
      const m7 = val2.match(KEEPALIVE_TIMEOUT_EXPR);
      return m7 ? parseInt(m7[1], 10) * 1e3 : null;
    }
    __name(parseKeepAliveTimeout, "parseKeepAliveTimeout");
    function headerNameToString(value) {
      return typeof value === "string" ? headerNameLowerCasedRecord[value] ?? value.toLowerCase() : tree.lookup(value) ?? value.toString("latin1").toLowerCase();
    }
    __name(headerNameToString, "headerNameToString");
    function bufferToLowerCasedHeaderName(value) {
      return tree.lookup(value) ?? value.toString("latin1").toLowerCase();
    }
    __name(bufferToLowerCasedHeaderName, "bufferToLowerCasedHeaderName");
    function parseHeaders3(headers, obj) {
      if (obj === void 0) obj = {};
      for (let i7 = 0; i7 < headers.length; i7 += 2) {
        const key = headerNameToString(headers[i7]);
        let val2 = obj[key];
        if (val2) {
          if (typeof val2 === "string") {
            val2 = [val2];
            obj[key] = val2;
          }
          val2.push(headers[i7 + 1].toString("latin1"));
        } else {
          const headersValue = headers[i7 + 1];
          if (typeof headersValue === "string") {
            obj[key] = headersValue;
          } else {
            obj[key] = Array.isArray(headersValue) ? headersValue.map((x7) => x7.toString("latin1")) : headersValue.toString("latin1");
          }
        }
      }
      return obj;
    }
    __name(parseHeaders3, "parseHeaders");
    function parseRawHeaders(headers) {
      const headersLength = headers.length;
      const ret = new Array(headersLength);
      let key;
      let val2;
      for (let n9 = 0; n9 < headersLength; n9 += 2) {
        key = headers[n9];
        val2 = headers[n9 + 1];
        typeof key !== "string" && (key = key.toString());
        typeof val2 !== "string" && (val2 = val2.toString("latin1"));
        ret[n9] = key;
        ret[n9 + 1] = val2;
      }
      return ret;
    }
    __name(parseRawHeaders, "parseRawHeaders");
    function encodeRawHeaders(headers) {
      if (!Array.isArray(headers)) {
        throw new TypeError("expected headers to be an array");
      }
      return headers.map((x7) => Buffer.from(x7));
    }
    __name(encodeRawHeaders, "encodeRawHeaders");
    function isBuffer(buffer) {
      return buffer instanceof Uint8Array || Buffer.isBuffer(buffer);
    }
    __name(isBuffer, "isBuffer");
    function assertRequestHandler(handler, method, upgrade) {
      if (!handler || typeof handler !== "object") {
        throw new InvalidArgumentError("handler must be an object");
      }
      if (typeof handler.onRequestStart === "function") {
        return;
      }
      if (typeof handler.onConnect !== "function") {
        throw new InvalidArgumentError("invalid onConnect method");
      }
      if (typeof handler.onError !== "function") {
        throw new InvalidArgumentError("invalid onError method");
      }
      if (typeof handler.onBodySent !== "function" && handler.onBodySent !== void 0) {
        throw new InvalidArgumentError("invalid onBodySent method");
      }
      if (upgrade || method === "CONNECT") {
        if (typeof handler.onUpgrade !== "function") {
          throw new InvalidArgumentError("invalid onUpgrade method");
        }
      } else {
        if (typeof handler.onHeaders !== "function") {
          throw new InvalidArgumentError("invalid onHeaders method");
        }
        if (typeof handler.onData !== "function") {
          throw new InvalidArgumentError("invalid onData method");
        }
        if (typeof handler.onComplete !== "function") {
          throw new InvalidArgumentError("invalid onComplete method");
        }
      }
    }
    __name(assertRequestHandler, "assertRequestHandler");
    function isDisturbed(body) {
      return !!(body && (stream2.isDisturbed(body) || body[kBodyUsed]));
    }
    __name(isDisturbed, "isDisturbed");
    function getSocketInfo(socket) {
      return {
        localAddress: socket.localAddress,
        localPort: socket.localPort,
        remoteAddress: socket.remoteAddress,
        remotePort: socket.remotePort,
        remoteFamily: socket.remoteFamily,
        timeout: socket.timeout,
        bytesWritten: socket.bytesWritten,
        bytesRead: socket.bytesRead
      };
    }
    __name(getSocketInfo, "getSocketInfo");
    function ReadableStreamFrom(iterable) {
      let iterator;
      return new ReadableStream(
        {
          start() {
            iterator = iterable[Symbol.asyncIterator]();
          },
          pull(controller) {
            return iterator.next().then(({ done, value }) => {
              if (done) {
                return queueMicrotask(() => {
                  controller.close();
                  controller.byobRequest?.respond(0);
                });
              } else {
                const buf = Buffer.isBuffer(value) ? value : Buffer.from(value);
                if (buf.byteLength) {
                  return controller.enqueue(new Uint8Array(buf));
                } else {
                  return this.pull(controller);
                }
              }
            });
          },
          cancel() {
            return iterator.return();
          },
          type: "bytes"
        }
      );
    }
    __name(ReadableStreamFrom, "ReadableStreamFrom");
    function isFormDataLike(object) {
      return object && typeof object === "object" && typeof object.append === "function" && typeof object.delete === "function" && typeof object.get === "function" && typeof object.getAll === "function" && typeof object.has === "function" && typeof object.set === "function" && object[Symbol.toStringTag] === "FormData";
    }
    __name(isFormDataLike, "isFormDataLike");
    function addAbortListener(signal, listener) {
      if ("addEventListener" in signal) {
        signal.addEventListener("abort", listener, { once: true });
        return () => signal.removeEventListener("abort", listener);
      }
      signal.once("abort", listener);
      return () => signal.removeListener("abort", listener);
    }
    __name(addAbortListener, "addAbortListener");
    var validTokenChars = new Uint8Array([
      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-9:;<=>?)
      0,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      // 64-79 (@A-O)
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      0,
      0,
      0,
      1,
      1,
      // 80-95 (P-Z[\]^_)
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      // 96-111 (`a-o)
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      0,
      1,
      0,
      1,
      0,
      // 112-127 (p-z{|}~)
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      // 128-143
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      // 144-159
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      // 160-175
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      // 176-191
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      // 192-207
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      // 208-223
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      // 224-239
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0
      // 240-255
    ]);
    function isTokenCharCode(c8) {
      return validTokenChars[c8] === 1;
    }
    __name(isTokenCharCode, "isTokenCharCode");
    var tokenRegExp = /^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/;
    function isValidHTTPToken(characters) {
      if (characters.length >= 12) return tokenRegExp.test(characters);
      if (characters.length === 0) return false;
      for (let i7 = 0; i7 < characters.length; i7++) {
        if (validTokenChars[characters.charCodeAt(i7)] !== 1) {
          return false;
        }
      }
      return true;
    }
    __name(isValidHTTPToken, "isValidHTTPToken");
    var headerCharRegex = /[^\t\x20-\x7e\x80-\xff]/;
    function isValidHeaderValue(characters) {
      return !headerCharRegex.test(characters);
    }
    __name(isValidHeaderValue, "isValidHeaderValue");
    var rangeHeaderRegex = /^bytes (\d+)-(\d+)\/(\d+)?$/;
    function parseRangeHeader(range) {
      if (range == null || range === "") return { start: 0, end: null, size: null };
      const m7 = range ? range.match(rangeHeaderRegex) : null;
      return m7 ? {
        start: parseInt(m7[1]),
        end: m7[2] ? parseInt(m7[2]) : null,
        size: m7[3] ? parseInt(m7[3]) : null
      } : null;
    }
    __name(parseRangeHeader, "parseRangeHeader");
    function addListener(obj, name2, listener) {
      const listeners = obj[kListeners] ??= [];
      listeners.push([name2, listener]);
      obj.on(name2, listener);
      return obj;
    }
    __name(addListener, "addListener");
    function removeAllListeners(obj) {
      if (obj[kListeners] != null) {
        for (const [name2, listener] of obj[kListeners]) {
          obj.removeListener(name2, listener);
        }
        obj[kListeners] = null;
      }
      return obj;
    }
    __name(removeAllListeners, "removeAllListeners");
    function errorRequest(client, request4, err) {
      try {
        request4.onError(err);
        assert61(request4.aborted);
      } catch (err2) {
        client.emit("error", err2);
      }
    }
    __name(errorRequest, "errorRequest");
    var setupConnectTimeout = process.platform === "win32" ? (socketWeakRef, opts) => {
      if (!opts.timeout) {
        return noop;
      }
      let s1 = null;
      let s22 = null;
      const fastTimer = timers.setFastTimeout(() => {
        s1 = setImmediate(() => {
          s22 = setImmediate(() => onConnectTimeout(socketWeakRef.deref(), opts));
        });
      }, opts.timeout);
      return () => {
        timers.clearFastTimeout(fastTimer);
        clearImmediate(s1);
        clearImmediate(s22);
      };
    } : (socketWeakRef, opts) => {
      if (!opts.timeout) {
        return noop;
      }
      let s1 = null;
      const fastTimer = timers.setFastTimeout(() => {
        s1 = setImmediate(() => {
          onConnectTimeout(socketWeakRef.deref(), opts);
        });
      }, opts.timeout);
      return () => {
        timers.clearFastTimeout(fastTimer);
        clearImmediate(s1);
      };
    };
    function onConnectTimeout(socket, opts) {
      if (socket == null) {
        return;
      }
      let message = "Connect Timeout Error";
      if (Array.isArray(socket.autoSelectFamilyAttemptedAddresses)) {
        message += ` (attempted addresses: ${socket.autoSelectFamilyAttemptedAddresses.join(", ")},`;
      } else {
        message += ` (attempted address: ${opts.hostname}:${opts.port},`;
      }
      message += ` timeout: ${opts.timeout}ms)`;
      destroy(socket, new ConnectTimeoutError(message));
    }
    __name(onConnectTimeout, "onConnectTimeout");
    function getProtocolFromUrlString(urlString) {
      if (urlString[0] === "h" && urlString[1] === "t" && urlString[2] === "t" && urlString[3] === "p") {
        switch (urlString[4]) {
          case ":":
            return "http:";
          case "s":
            if (urlString[5] === ":") {
              return "https:";
            }
        }
      }
      return urlString.slice(0, urlString.indexOf(":") + 1);
    }
    __name(getProtocolFromUrlString, "getProtocolFromUrlString");
    var kEnumerableProperty = /* @__PURE__ */ Object.create(null);
    kEnumerableProperty.enumerable = true;
    var normalizedMethodRecordsBase = {
      delete: "DELETE",
      DELETE: "DELETE",
      get: "GET",
      GET: "GET",
      head: "HEAD",
      HEAD: "HEAD",
      options: "OPTIONS",
      OPTIONS: "OPTIONS",
      post: "POST",
      POST: "POST",
      put: "PUT",
      PUT: "PUT"
    };
    var normalizedMethodRecords = {
      ...normalizedMethodRecordsBase,
      patch: "patch",
      PATCH: "PATCH"
    };
    Object.setPrototypeOf(normalizedMethodRecordsBase, null);
    Object.setPrototypeOf(normalizedMethodRecords, null);
    module2.exports = {
      kEnumerableProperty,
      isDisturbed,
      isBlobLike: isBlobLike2,
      parseOrigin,
      parseURL: parseURL3,
      getServerName,
      isStream: isStream2,
      isIterable,
      hasSafeIterator,
      isAsyncIterable,
      isDestroyed,
      headerNameToString,
      bufferToLowerCasedHeaderName,
      addListener,
      removeAllListeners,
      errorRequest,
      parseRawHeaders,
      encodeRawHeaders,
      parseHeaders: parseHeaders3,
      parseKeepAliveTimeout,
      destroy,
      bodyLength,
      deepClone,
      ReadableStreamFrom,
      isBuffer,
      assertRequestHandler,
      getSocketInfo,
      isFormDataLike,
      pathHasQueryOrFragment,
      serializePathWithQuery,
      addAbortListener,
      isValidHTTPToken,
      isValidHeaderValue,
      isTokenCharCode,
      parseRangeHeader,
      normalizedMethodRecordsBase,
      normalizedMethodRecords,
      isValidPort,
      isHttpOrHttpsPrefixed,
      nodeMajor,
      nodeMinor,
      safeHTTPMethods: Object.freeze(["GET", "HEAD", "OPTIONS", "TRACE"]),
      wrapRequestBody,
      setupConnectTimeout,
      getProtocolFromUrlString
    };
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/util/stats.js
var require_stats = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/util/stats.js"(exports, module2) {
    init_import_meta_url();
    var {
      kConnected,
      kPending,
      kRunning,
      kSize,
      kFree,
      kQueued
    } = require_symbols();
    var ClientStats = class {
      static {
        __name(this, "ClientStats");
      }
      constructor(client) {
        this.connected = client[kConnected];
        this.pending = client[kPending];
        this.running = client[kRunning];
        this.size = client[kSize];
      }
    };
    var PoolStats = class {
      static {
        __name(this, "PoolStats");
      }
      constructor(pool) {
        this.connected = pool[kConnected];
        this.free = pool[kFree];
        this.pending = pool[kPending];
        this.queued = pool[kQueued];
        this.running = pool[kRunning];
        this.size = pool[kSize];
      }
    };
    module2.exports = { ClientStats, PoolStats };
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/core/diagnostics.js
var require_diagnostics = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/core/diagnostics.js"(exports, module2) {
    init_import_meta_url();
    var diagnosticsChannel = __require("diagnostics_channel");
    var util5 = __require("util");
    var undiciDebugLog = util5.debuglog("undici");
    var fetchDebuglog = util5.debuglog("fetch");
    var websocketDebuglog = util5.debuglog("websocket");
    var channels = {
      // Client
      beforeConnect: diagnosticsChannel.channel("undici:client:beforeConnect"),
      connected: diagnosticsChannel.channel("undici:client:connected"),
      connectError: diagnosticsChannel.channel("undici:client:connectError"),
      sendHeaders: diagnosticsChannel.channel("undici:client:sendHeaders"),
      // Request
      create: diagnosticsChannel.channel("undici:request:create"),
      bodySent: diagnosticsChannel.channel("undici:request:bodySent"),
      bodyChunkSent: diagnosticsChannel.channel("undici:request:bodyChunkSent"),
      bodyChunkReceived: diagnosticsChannel.channel("undici:request:bodyChunkReceived"),
      headers: diagnosticsChannel.channel("undici:request:headers"),
      trailers: diagnosticsChannel.channel("undici:request:trailers"),
      error: diagnosticsChannel.channel("undici:request:error"),
      // WebSocket
      open: diagnosticsChannel.channel("undici:websocket:open"),
      close: diagnosticsChannel.channel("undici:websocket:close"),
      socketError: diagnosticsChannel.channel("undici:websocket:socket_error"),
      ping: diagnosticsChannel.channel("undici:websocket:ping"),
      pong: diagnosticsChannel.channel("undici:websocket:pong"),
      // ProxyAgent
      proxyConnected: diagnosticsChannel.channel("undici:proxy:connected")
    };
    var isTrackingClientEvents = false;
    function trackClientEvents(debugLog = undiciDebugLog) {
      if (isTrackingClientEvents) {
        return;
      }
      if (channels.beforeConnect.hasSubscribers || channels.connected.hasSubscribers || channels.connectError.hasSubscribers || channels.sendHeaders.hasSubscribers) {
        isTrackingClientEvents = true;
        return;
      }
      isTrackingClientEvents = true;
      diagnosticsChannel.subscribe(
        "undici:client:beforeConnect",
        (evt) => {
          const {
            connectParams: { version: version5, protocol, port, host }
          } = evt;
          debugLog(
            "connecting to %s%s using %s%s",
            host,
            port ? `:${port}` : "",
            protocol,
            version5
          );
        }
      );
      diagnosticsChannel.subscribe(
        "undici:client:connected",
        (evt) => {
          const {
            connectParams: { version: version5, protocol, port, host }
          } = evt;
          debugLog(
            "connected to %s%s using %s%s",
            host,
            port ? `:${port}` : "",
            protocol,
            version5
          );
        }
      );
      diagnosticsChannel.subscribe(
        "undici:client:connectError",
        (evt) => {
          const {
            connectParams: { version: version5, protocol, port, host },
            error: error2
          } = evt;
          debugLog(
            "connection to %s%s using %s%s errored - %s",
            host,
            port ? `:${port}` : "",
            protocol,
            version5,
            error2.message
          );
        }
      );
      diagnosticsChannel.subscribe(
        "undici:client:sendHeaders",
        (evt) => {
          const {
            request: { method, path: path84, origin }
          } = evt;
          debugLog("sending request to %s %s%s", method, origin, path84);
        }
      );
    }
    __name(trackClientEvents, "trackClientEvents");
    var isTrackingRequestEvents = false;
    function trackRequestEvents(debugLog = undiciDebugLog) {
      if (isTrackingRequestEvents) {
        return;
      }
      if (channels.headers.hasSubscribers || channels.trailers.hasSubscribers || channels.error.hasSubscribers) {
        isTrackingRequestEvents = true;
        return;
      }
      isTrackingRequestEvents = true;
      diagnosticsChannel.subscribe(
        "undici:request:headers",
        (evt) => {
          const {
            request: { method, path: path84, origin },
            response: { statusCode }
          } = evt;
          debugLog(
            "received response to %s %s%s - HTTP %d",
            method,
            origin,
            path84,
            statusCode
          );
        }
      );
      diagnosticsChannel.subscribe(
        "undici:request:trailers",
        (evt) => {
          const {
            request: { method, path: path84, origin }
          } = evt;
          debugLog("trailers received from %s %s%s", method, origin, path84);
        }
      );
      diagnosticsChannel.subscribe(
        "undici:request:error",
        (evt) => {
          const {
            request: { method, path: path84, origin },
            error: error2
          } = evt;
          debugLog(
            "request to %s %s%s errored - %s",
            method,
            origin,
            path84,
            error2.message
          );
        }
      );
    }
    __name(trackRequestEvents, "trackRequestEvents");
    var isTrackingWebSocketEvents = false;
    function trackWebSocketEvents(debugLog = websocketDebuglog) {
      if (isTrackingWebSocketEvents) {
        return;
      }
      if (channels.open.hasSubscribers || channels.close.hasSubscribers || channels.socketError.hasSubscribers || channels.ping.hasSubscribers || channels.pong.hasSubscribers) {
        isTrackingWebSocketEvents = true;
        return;
      }
      isTrackingWebSocketEvents = true;
      diagnosticsChannel.subscribe(
        "undici:websocket:open",
        (evt) => {
          const {
            address: { address, port }
          } = evt;
          debugLog("connection opened %s%s", address, port ? `:${port}` : "");
        }
      );
      diagnosticsChannel.subscribe(
        "undici:websocket:close",
        (evt) => {
          const { websocket, code, reason } = evt;
          debugLog(
            "closed connection to %s - %s %s",
            websocket.url,
            code,
            reason
          );
        }
      );
      diagnosticsChannel.subscribe(
        "undici:websocket:socket_error",
        (err) => {
          debugLog("connection errored - %s", err.message);
        }
      );
      diagnosticsChannel.subscribe(
        "undici:websocket:ping",
        (evt) => {
          debugLog("ping received");
        }
      );
      diagnosticsChannel.subscribe(
        "undici:websocket:pong",
        (evt) => {
          debugLog("pong received");
        }
      );
    }
    __name(trackWebSocketEvents, "trackWebSocketEvents");
    if (undiciDebugLog.enabled || fetchDebuglog.enabled) {
      trackClientEvents(fetchDebuglog.enabled ? fetchDebuglog : undiciDebugLog);
      trackRequestEvents(fetchDebuglog.enabled ? fetchDebuglog : undiciDebugLog);
    }
    if (websocketDebuglog.enabled) {
      trackClientEvents(undiciDebugLog.enabled ? undiciDebugLog : websocketDebuglog);
      trackWebSocketEvents(websocketDebuglog);
    }
    module2.exports = {
      channels
    };
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/core/request.js
var require_request = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/core/request.js"(exports, module2) {
    init_import_meta_url();
    var {
      InvalidArgumentError,
      NotSupportedError
    } = require_errors();
    var assert61 = __require("assert");
    var {
      isValidHTTPToken,
      isValidHeaderValue,
      isStream: isStream2,
      destroy,
      isBuffer,
      isFormDataLike,
      isIterable,
      hasSafeIterator,
      isBlobLike: isBlobLike2,
      serializePathWithQuery,
      assertRequestHandler,
      getServerName,
      normalizedMethodRecords,
      getProtocolFromUrlString
    } = require_util();
    var { channels } = require_diagnostics();
    var { headerNameLowerCasedRecord } = require_constants();
    var invalidPathRegex = /[^\u0021-\u00ff]/;
    var kHandler = Symbol("handler");
    var Request7 = class {
      static {
        __name(this, "Request");
      }
      constructor(origin, {
        path: path84,
        method,
        body,
        headers,
        query,
        idempotent,
        blocking,
        upgrade,
        headersTimeout,
        bodyTimeout,
        reset,
        expectContinue,
        servername,
        throwOnError,
        maxRedirections,
        typeOfService
      }, handler) {
        if (typeof path84 !== "string") {
          throw new InvalidArgumentError("path must be a string");
        } else if (path84[0] !== "/" && !(path84.startsWith("http://") || path84.startsWith("https://")) && method !== "CONNECT") {
          throw new InvalidArgumentError("path must be an absolute URL or start with a slash");
        } else if (invalidPathRegex.test(path84)) {
          throw new InvalidArgumentError("invalid request path");
        }
        if (typeof method !== "string") {
          throw new InvalidArgumentError("method must be a string");
        } else if (normalizedMethodRecords[method] === void 0 && !isValidHTTPToken(method)) {
          throw new InvalidArgumentError("invalid request method");
        }
        if (upgrade && typeof upgrade !== "string") {
          throw new InvalidArgumentError("upgrade must be a string");
        }
        if (upgrade && !isValidHeaderValue(upgrade)) {
          throw new InvalidArgumentError("invalid upgrade header");
        }
        if (headersTimeout != null && (!Number.isFinite(headersTimeout) || headersTimeout < 0)) {
          throw new InvalidArgumentError("invalid headersTimeout");
        }
        if (bodyTimeout != null && (!Number.isFinite(bodyTimeout) || bodyTimeout < 0)) {
          throw new InvalidArgumentError("invalid bodyTimeout");
        }
        if (reset != null && typeof reset !== "boolean") {
          throw new InvalidArgumentError("invalid reset");
        }
        if (expectContinue != null && typeof expectContinue !== "boolean") {
          throw new InvalidArgumentError("invalid expectContinue");
        }
        if (throwOnError != null) {
          throw new InvalidArgumentError("invalid throwOnError");
        }
        if (maxRedirections != null && maxRedirections !== 0) {
          throw new InvalidArgumentError("maxRedirections is not supported, use the redirect interceptor");
        }
        if (typeOfService != null && (!Number.isInteger(typeOfService) || typeOfService < 0 || typeOfService > 255)) {
          throw new InvalidArgumentError("typeOfService must be an integer between 0 and 255");
        }
        this.headersTimeout = headersTimeout;
        this.bodyTimeout = bodyTimeout;
        this.method = method;
        this.typeOfService = typeOfService ?? 0;
        this.abort = null;
        if (body == null) {
          this.body = null;
        } else if (isStream2(body)) {
          this.body = body;
          const rState = this.body._readableState;
          if (!rState || !rState.autoDestroy) {
            this.endHandler = /* @__PURE__ */ __name(function autoDestroy() {
              destroy(this);
            }, "autoDestroy");
            this.body.on("end", this.endHandler);
          }
          this.errorHandler = (err) => {
            if (this.abort) {
              this.abort(err);
            } else {
              this.error = err;
            }
          };
          this.body.on("error", this.errorHandler);
        } else if (isBuffer(body)) {
          this.body = body.byteLength ? body : null;
        } else if (ArrayBuffer.isView(body)) {
          this.body = body.buffer.byteLength ? Buffer.from(body.buffer, body.byteOffset, body.byteLength) : null;
        } else if (body instanceof ArrayBuffer) {
          this.body = body.byteLength ? Buffer.from(body) : null;
        } else if (typeof body === "string") {
          this.body = body.length ? Buffer.from(body) : null;
        } else if (isFormDataLike(body) || isIterable(body) || isBlobLike2(body)) {
          this.body = body;
        } else {
          throw new InvalidArgumentError("body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable");
        }
        this.completed = false;
        this.aborted = false;
        this.upgrade = upgrade || null;
        this.path = query ? serializePathWithQuery(path84, query) : path84;
        this.origin = origin;
        this.protocol = getProtocolFromUrlString(origin);
        this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent;
        this.blocking = blocking ?? this.method !== "HEAD";
        this.reset = reset == null ? null : reset;
        this.host = null;
        this.contentLength = null;
        this.contentType = null;
        this.headers = [];
        this.expectContinue = expectContinue != null ? expectContinue : false;
        if (Array.isArray(headers)) {
          if (headers.length % 2 !== 0) {
            throw new InvalidArgumentError("headers array must be even");
          }
          for (let i7 = 0; i7 < headers.length; i7 += 2) {
            processHeader(this, headers[i7], headers[i7 + 1]);
          }
        } else if (headers && typeof headers === "object") {
          if (hasSafeIterator(headers)) {
            for (const header of headers) {
              if (!Array.isArray(header) || header.length !== 2) {
                throw new InvalidArgumentError("headers must be in key-value pair format");
              }
              processHeader(this, header[0], header[1]);
            }
          } else {
            const keys = Object.keys(headers);
            for (let i7 = 0; i7 < keys.length; ++i7) {
              processHeader(this, keys[i7], headers[keys[i7]]);
            }
          }
        } else if (headers != null) {
          throw new InvalidArgumentError("headers must be an object or an array");
        }
        assertRequestHandler(handler, method, upgrade);
        this.servername = servername || getServerName(this.host) || null;
        this[kHandler] = handler;
        if (channels.create.hasSubscribers) {
          channels.create.publish({ request: this });
        }
      }
      onBodySent(chunk) {
        if (channels.bodyChunkSent.hasSubscribers) {
          channels.bodyChunkSent.publish({ request: this, chunk });
        }
        if (this[kHandler].onBodySent) {
          try {
            return this[kHandler].onBodySent(chunk);
          } catch (err) {
            this.abort(err);
          }
        }
      }
      onRequestSent() {
        if (channels.bodySent.hasSubscribers) {
          channels.bodySent.publish({ request: this });
        }
        if (this[kHandler].onRequestSent) {
          try {
            return this[kHandler].onRequestSent();
          } catch (err) {
            this.abort(err);
          }
        }
      }
      onConnect(abort) {
        assert61(!this.aborted);
        assert61(!this.completed);
        if (this.error) {
          abort(this.error);
        } else {
          this.abort = abort;
          return this[kHandler].onConnect(abort);
        }
      }
      onResponseStarted() {
        return this[kHandler].onResponseStarted?.();
      }
      onHeaders(statusCode, headers, resume, statusText) {
        assert61(!this.aborted);
        assert61(!this.completed);
        if (channels.headers.hasSubscribers) {
          channels.headers.publish({ request: this, response: { statusCode, headers, statusText } });
        }
        try {
          return this[kHandler].onHeaders(statusCode, headers, resume, statusText);
        } catch (err) {
          this.abort(err);
        }
      }
      onData(chunk) {
        assert61(!this.aborted);
        assert61(!this.completed);
        if (channels.bodyChunkReceived.hasSubscribers) {
          channels.bodyChunkReceived.publish({ request: this, chunk });
        }
        try {
          return this[kHandler].onData(chunk);
        } catch (err) {
          this.abort(err);
          return false;
        }
      }
      onUpgrade(statusCode, headers, socket) {
        assert61(!this.aborted);
        assert61(!this.completed);
        return this[kHandler].onUpgrade(statusCode, headers, socket);
      }
      onComplete(trailers) {
        this.onFinally();
        assert61(!this.aborted);
        assert61(!this.completed);
        this.completed = true;
        if (channels.trailers.hasSubscribers) {
          channels.trailers.publish({ request: this, trailers });
        }
        try {
          return this[kHandler].onComplete(trailers);
        } catch (err) {
          this.onError(err);
        }
      }
      onError(error2) {
        this.onFinally();
        if (channels.error.hasSubscribers) {
          channels.error.publish({ request: this, error: error2 });
        }
        if (this.aborted) {
          return;
        }
        this.aborted = true;
        return this[kHandler].onError(error2);
      }
      onFinally() {
        if (this.errorHandler) {
          this.body.off("error", this.errorHandler);
          this.errorHandler = null;
        }
        if (this.endHandler) {
          this.body.off("end", this.endHandler);
          this.endHandler = null;
        }
      }
      addHeader(key, value) {
        processHeader(this, key, value);
        return this;
      }
    };
    function processHeader(request4, key, val2) {
      if (val2 && (typeof val2 === "object" && !Array.isArray(val2))) {
        throw new InvalidArgumentError(`invalid ${key} header`);
      } else if (val2 === void 0) {
        return;
      }
      let headerName = headerNameLowerCasedRecord[key];
      if (headerName === void 0) {
        headerName = key.toLowerCase();
        if (headerNameLowerCasedRecord[headerName] === void 0 && !isValidHTTPToken(headerName)) {
          throw new InvalidArgumentError("invalid header key");
        }
      }
      if (Array.isArray(val2)) {
        const arr = [];
        for (let i7 = 0; i7 < val2.length; i7++) {
          if (typeof val2[i7] === "string") {
            if (!isValidHeaderValue(val2[i7])) {
              throw new InvalidArgumentError(`invalid ${key} header`);
            }
            arr.push(val2[i7]);
          } else if (val2[i7] === null) {
            arr.push("");
          } else if (typeof val2[i7] === "object") {
            throw new InvalidArgumentError(`invalid ${key} header`);
          } else {
            arr.push(`${val2[i7]}`);
          }
        }
        val2 = arr;
      } else if (typeof val2 === "string") {
        if (!isValidHeaderValue(val2)) {
          throw new InvalidArgumentError(`invalid ${key} header`);
        }
      } else if (val2 === null) {
        val2 = "";
      } else {
        val2 = `${val2}`;
      }
      if (headerName === "host") {
        if (request4.host !== null) {
          throw new InvalidArgumentError("duplicate host header");
        }
        if (typeof val2 !== "string") {
          throw new InvalidArgumentError("invalid host header");
        }
        request4.host = val2;
      } else if (headerName === "content-length") {
        if (request4.contentLength !== null) {
          throw new InvalidArgumentError("duplicate content-length header");
        }
        request4.contentLength = parseInt(val2, 10);
        if (!Number.isFinite(request4.contentLength)) {
          throw new InvalidArgumentError("invalid content-length header");
        }
      } else if (request4.contentType === null && headerName === "content-type") {
        request4.contentType = val2;
        request4.headers.push(key, val2);
      } else if (headerName === "transfer-encoding" || headerName === "keep-alive" || headerName === "upgrade") {
        throw new InvalidArgumentError(`invalid ${headerName} header`);
      } else if (headerName === "connection") {
        const value = typeof val2 === "string" ? val2.toLowerCase() : null;
        if (value !== "close" && value !== "keep-alive") {
          throw new InvalidArgumentError("invalid connection header");
        }
        if (value === "close") {
          request4.reset = true;
        }
      } else if (headerName === "expect") {
        throw new NotSupportedError("expect header not supported");
      } else {
        request4.headers.push(key, val2);
      }
    }
    __name(processHeader, "processHeader");
    module2.exports = Request7;
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/handler/wrap-handler.js
var require_wrap_handler = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/handler/wrap-handler.js"(exports, module2) {
    init_import_meta_url();
    var { InvalidArgumentError } = require_errors();
    module2.exports = class WrapHandler {
      static {
        __name(this, "WrapHandler");
      }
      #handler;
      constructor(handler) {
        this.#handler = handler;
      }
      static wrap(handler) {
        return handler.onRequestStart ? handler : new WrapHandler(handler);
      }
      // Unwrap Interface
      onConnect(abort, context2) {
        return this.#handler.onConnect?.(abort, context2);
      }
      onResponseStarted() {
        return this.#handler.onResponseStarted?.();
      }
      onHeaders(statusCode, rawHeaders, resume, statusMessage) {
        return this.#handler.onHeaders?.(statusCode, rawHeaders, resume, statusMessage);
      }
      onUpgrade(statusCode, rawHeaders, socket) {
        return this.#handler.onUpgrade?.(statusCode, rawHeaders, socket);
      }
      onData(data) {
        return this.#handler.onData?.(data);
      }
      onComplete(trailers) {
        return this.#handler.onComplete?.(trailers);
      }
      onError(err) {
        if (!this.#handler.onError) {
          throw err;
        }
        return this.#handler.onError?.(err);
      }
      // Wrap Interface
      onRequestStart(controller, context2) {
        this.#handler.onConnect?.((reason) => controller.abort(reason), context2);
      }
      onRequestUpgrade(controller, statusCode, headers, socket) {
        const rawHeaders = [];
        for (const [key, val2] of Object.entries(headers)) {
          rawHeaders.push(Buffer.from(key, "latin1"), toRawHeaderValue(val2));
        }
        this.#handler.onUpgrade?.(statusCode, rawHeaders, socket);
      }
      onResponseStart(controller, statusCode, headers, statusMessage) {
        const rawHeaders = [];
        for (const [key, val2] of Object.entries(headers)) {
          rawHeaders.push(Buffer.from(key, "latin1"), toRawHeaderValue(val2));
        }
        if (this.#handler.onHeaders?.(statusCode, rawHeaders, () => controller.resume(), statusMessage) === false) {
          controller.pause();
        }
      }
      onResponseData(controller, data) {
        if (this.#handler.onData?.(data) === false) {
          controller.pause();
        }
      }
      onResponseEnd(controller, trailers) {
        const rawTrailers = [];
        for (const [key, val2] of Object.entries(trailers)) {
          rawTrailers.push(Buffer.from(key, "latin1"), toRawHeaderValue(val2));
        }
        this.#handler.onComplete?.(rawTrailers);
      }
      onResponseError(controller, err) {
        if (!this.#handler.onError) {
          throw new InvalidArgumentError("invalid onError method");
        }
        this.#handler.onError?.(err);
      }
    };
    function toRawHeaderValue(value) {
      return Array.isArray(value) ? value.map((item) => Buffer.from(item, "latin1")) : Buffer.from(value, "latin1");
    }
    __name(toRawHeaderValue, "toRawHeaderValue");
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/dispatcher/dispatcher.js
var require_dispatcher = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/dispatcher/dispatcher.js"(exports, module2) {
    init_import_meta_url();
    var EventEmitter5 = __require("events");
    var WrapHandler = require_wrap_handler();
    var wrapInterceptor = /* @__PURE__ */ __name((dispatch) => (opts, handler) => dispatch(opts, WrapHandler.wrap(handler)), "wrapInterceptor");
    var Dispatcher2 = class extends EventEmitter5 {
      static {
        __name(this, "Dispatcher");
      }
      dispatch() {
        throw new Error("not implemented");
      }
      close() {
        throw new Error("not implemented");
      }
      destroy() {
        throw new Error("not implemented");
      }
      compose(...args) {
        const interceptors = Array.isArray(args[0]) ? args[0] : args;
        let dispatch = this.dispatch.bind(this);
        for (const interceptor of interceptors) {
          if (interceptor == null) {
            continue;
          }
          if (typeof interceptor !== "function") {
            throw new TypeError(`invalid interceptor, expected function received ${typeof interceptor}`);
          }
          dispatch = interceptor(dispatch);
          dispatch = wrapInterceptor(dispatch);
          if (dispatch == null || typeof dispatch !== "function" || dispatch.length !== 2) {
            throw new TypeError("invalid interceptor");
          }
        }
        return new Proxy(this, {
          get: /* @__PURE__ */ __name((target, key) => key === "dispatch" ? dispatch : target[key], "get")
        });
      }
    };
    module2.exports = Dispatcher2;
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/handler/unwrap-handler.js
var require_unwrap_handler = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/handler/unwrap-handler.js"(exports, module2) {
    init_import_meta_url();
    var { parseHeaders: parseHeaders3 } = require_util();
    var { InvalidArgumentError } = require_errors();
    var kResume = Symbol("resume");
    var UnwrapController = class {
      static {
        __name(this, "UnwrapController");
      }
      #paused = false;
      #reason = null;
      #aborted = false;
      #abort;
      [kResume] = null;
      constructor(abort) {
        this.#abort = abort;
      }
      pause() {
        this.#paused = true;
      }
      resume() {
        if (this.#paused) {
          this.#paused = false;
          this[kResume]?.();
        }
      }
      abort(reason) {
        if (!this.#aborted) {
          this.#aborted = true;
          this.#reason = reason;
          this.#abort(reason);
        }
      }
      get aborted() {
        return this.#aborted;
      }
      get reason() {
        return this.#reason;
      }
      get paused() {
        return this.#paused;
      }
    };
    module2.exports = class UnwrapHandler {
      static {
        __name(this, "UnwrapHandler");
      }
      #handler;
      #controller;
      constructor(handler) {
        this.#handler = handler;
      }
      static unwrap(handler) {
        return !handler.onRequestStart ? handler : new UnwrapHandler(handler);
      }
      onConnect(abort, context2) {
        this.#controller = new UnwrapController(abort);
        this.#handler.onRequestStart?.(this.#controller, context2);
      }
      onResponseStarted() {
        return this.#handler.onResponseStarted?.();
      }
      onUpgrade(statusCode, rawHeaders, socket) {
        this.#handler.onRequestUpgrade?.(this.#controller, statusCode, parseHeaders3(rawHeaders), socket);
      }
      onHeaders(statusCode, rawHeaders, resume, statusMessage) {
        this.#controller[kResume] = resume;
        this.#handler.onResponseStart?.(this.#controller, statusCode, parseHeaders3(rawHeaders), statusMessage);
        return !this.#controller.paused;
      }
      onData(data) {
        this.#handler.onResponseData?.(this.#controller, data);
        return !this.#controller.paused;
      }
      onComplete(rawTrailers) {
        this.#handler.onResponseEnd?.(this.#controller, parseHeaders3(rawTrailers));
      }
      onError(err) {
        if (!this.#handler.onResponseError) {
          throw new InvalidArgumentError("invalid onError method");
        }
        this.#handler.onResponseError?.(this.#controller, err);
      }
    };
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/dispatcher/dispatcher-base.js
var require_dispatcher_base = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/dispatcher/dispatcher-base.js"(exports, module2) {
    init_import_meta_url();
    var Dispatcher2 = require_dispatcher();
    var UnwrapHandler = require_unwrap_handler();
    var {
      ClientDestroyedError,
      ClientClosedError,
      InvalidArgumentError
    } = require_errors();
    var { kDestroy, kClose, kClosed, kDestroyed, kDispatch } = require_symbols();
    var kOnDestroyed = Symbol("onDestroyed");
    var kOnClosed = Symbol("onClosed");
    var DispatcherBase = class extends Dispatcher2 {
      static {
        __name(this, "DispatcherBase");
      }
      /** @type {boolean} */
      [kDestroyed] = false;
      /** @type {Array<Function|null} */
      [kOnDestroyed] = null;
      /** @type {boolean} */
      [kClosed] = false;
      /** @type {Array<Function>|null} */
      [kOnClosed] = null;
      /** @returns {boolean} */
      get destroyed() {
        return this[kDestroyed];
      }
      /** @returns {boolean} */
      get closed() {
        return this[kClosed];
      }
      close(callback) {
        if (callback === void 0) {
          return new Promise((resolve32, reject) => {
            this.close((err, data) => {
              return err ? reject(err) : resolve32(data);
            });
          });
        }
        if (typeof callback !== "function") {
          throw new InvalidArgumentError("invalid callback");
        }
        if (this[kDestroyed]) {
          const err = new ClientDestroyedError();
          queueMicrotask(() => callback(err, null));
          return;
        }
        if (this[kClosed]) {
          if (this[kOnClosed]) {
            this[kOnClosed].push(callback);
          } else {
            queueMicrotask(() => callback(null, null));
          }
          return;
        }
        this[kClosed] = true;
        this[kOnClosed] ??= [];
        this[kOnClosed].push(callback);
        const onClosed = /* @__PURE__ */ __name(() => {
          const callbacks = this[kOnClosed];
          this[kOnClosed] = null;
          for (let i7 = 0; i7 < callbacks.length; i7++) {
            callbacks[i7](null, null);
          }
        }, "onClosed");
        this[kClose]().then(() => this.destroy()).then(() => queueMicrotask(onClosed));
      }
      destroy(err, callback) {
        if (typeof err === "function") {
          callback = err;
          err = null;
        }
        if (callback === void 0) {
          return new Promise((resolve32, reject) => {
            this.destroy(err, (err2, data) => {
              return err2 ? reject(err2) : resolve32(data);
            });
          });
        }
        if (typeof callback !== "function") {
          throw new InvalidArgumentError("invalid callback");
        }
        if (this[kDestroyed]) {
          if (this[kOnDestroyed]) {
            this[kOnDestroyed].push(callback);
          } else {
            queueMicrotask(() => callback(null, null));
          }
          return;
        }
        if (!err) {
          err = new ClientDestroyedError();
        }
        this[kDestroyed] = true;
        this[kOnDestroyed] ??= [];
        this[kOnDestroyed].push(callback);
        const onDestroyed = /* @__PURE__ */ __name(() => {
          const callbacks = this[kOnDestroyed];
          this[kOnDestroyed] = null;
          for (let i7 = 0; i7 < callbacks.length; i7++) {
            callbacks[i7](null, null);
          }
        }, "onDestroyed");
        this[kDestroy](err).then(() => queueMicrotask(onDestroyed));
      }
      dispatch(opts, handler) {
        if (!handler || typeof handler !== "object") {
          throw new InvalidArgumentError("handler must be an object");
        }
        handler = UnwrapHandler.unwrap(handler);
        try {
          if (!opts || typeof opts !== "object") {
            throw new InvalidArgumentError("opts must be an object.");
          }
          if (this[kDestroyed] || this[kOnDestroyed]) {
            throw new ClientDestroyedError();
          }
          if (this[kClosed]) {
            throw new ClientClosedError();
          }
          return this[kDispatch](opts, handler);
        } catch (err) {
          if (typeof handler.onError !== "function") {
            throw err;
          }
          handler.onError(err);
          return false;
        }
      }
    };
    module2.exports = DispatcherBase;
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/core/connect.js
var require_connect = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/core/connect.js"(exports, module2) {
    init_import_meta_url();
    var net3 = __require("net");
    var assert61 = __require("assert");
    var util5 = require_util();
    var { InvalidArgumentError } = require_errors();
    var tls;
    var SessionCache = class WeakSessionCache {
      static {
        __name(this, "WeakSessionCache");
      }
      constructor(maxCachedSessions) {
        this._maxCachedSessions = maxCachedSessions;
        this._sessionCache = /* @__PURE__ */ new Map();
        this._sessionRegistry = new FinalizationRegistry((key) => {
          if (this._sessionCache.size < this._maxCachedSessions) {
            return;
          }
          const ref = this._sessionCache.get(key);
          if (ref !== void 0 && ref.deref() === void 0) {
            this._sessionCache.delete(key);
          }
        });
      }
      get(sessionKey) {
        const ref = this._sessionCache.get(sessionKey);
        return ref ? ref.deref() : null;
      }
      set(sessionKey, session) {
        if (this._maxCachedSessions === 0) {
          return;
        }
        this._sessionCache.set(sessionKey, new WeakRef(session));
        this._sessionRegistry.register(session, sessionKey);
      }
    };
    function buildConnector({ allowH2, useH2c, maxCachedSessions, socketPath, timeout: timeout2, session: customSession, ...opts }) {
      if (maxCachedSessions != null && (!Number.isInteger(maxCachedSessions) || maxCachedSessions < 0)) {
        throw new InvalidArgumentError("maxCachedSessions must be a positive integer or zero");
      }
      const options = { path: socketPath, ...opts };
      const sessionCache = new SessionCache(maxCachedSessions == null ? 100 : maxCachedSessions);
      timeout2 = timeout2 == null ? 1e4 : timeout2;
      allowH2 = allowH2 != null ? allowH2 : false;
      return /* @__PURE__ */ __name(function connect({ hostname: hostname2, host, protocol, port, servername, localAddress, httpSocket }, callback) {
        let socket;
        if (protocol === "https:") {
          if (!tls) {
            tls = __require("tls");
          }
          servername = servername || options.servername || util5.getServerName(host) || null;
          const sessionKey = servername || hostname2;
          assert61(sessionKey);
          const session = customSession || sessionCache.get(sessionKey) || null;
          port = port || 443;
          socket = tls.connect({
            highWaterMark: 16384,
            // TLS in node can't have bigger HWM anyway...
            ...options,
            servername,
            session,
            localAddress,
            ALPNProtocols: allowH2 ? ["http/1.1", "h2"] : ["http/1.1"],
            socket: httpSocket,
            // upgrade socket connection
            port,
            host: hostname2
          });
          socket.on("session", function(session2) {
            sessionCache.set(sessionKey, session2);
          });
        } else {
          assert61(!httpSocket, "httpSocket can only be sent on TLS update");
          port = port || 80;
          socket = net3.connect({
            highWaterMark: 64 * 1024,
            // Same as nodejs fs streams.
            ...options,
            localAddress,
            port,
            host: hostname2
          });
          if (useH2c === true) {
            socket.alpnProtocol = "h2";
          }
        }
        if (options.keepAlive == null || options.keepAlive) {
          const keepAliveInitialDelay = options.keepAliveInitialDelay === void 0 ? 6e4 : options.keepAliveInitialDelay;
          socket.setKeepAlive(true, keepAliveInitialDelay);
        }
        const clearConnectTimeout = util5.setupConnectTimeout(new WeakRef(socket), { timeout: timeout2, hostname: hostname2, port });
        socket.setNoDelay(true).once(protocol === "https:" ? "secureConnect" : "connect", function() {
          queueMicrotask(clearConnectTimeout);
          if (callback) {
            const cb2 = callback;
            callback = null;
            cb2(null, this);
          }
        }).on("error", function(err) {
          queueMicrotask(clearConnectTimeout);
          if (callback) {
            const cb2 = callback;
            callback = null;
            cb2(err);
          }
        });
        return socket;
      }, "connect");
    }
    __name(buildConnector, "buildConnector");
    module2.exports = buildConnector;
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/llhttp/utils.js
var require_utils = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/llhttp/utils.js"(exports) {
    init_import_meta_url();
    Object.defineProperty(exports, "__esModule", { value: true });
    exports.enumToMap = enumToMap;
    function enumToMap(obj, filter2 = [], exceptions = []) {
      const emptyFilter = (filter2?.length ?? 0) === 0;
      const emptyExceptions = (exceptions?.length ?? 0) === 0;
      return Object.fromEntries(Object.entries(obj).filter(([, value]) => {
        return typeof value === "number" && (emptyFilter || filter2.includes(value)) && (emptyExceptions || !exceptions.includes(value));
      }));
    }
    __name(enumToMap, "enumToMap");
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/llhttp/constants.js
var require_constants2 = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/llhttp/constants.js"(exports) {
    init_import_meta_url();
    Object.defineProperty(exports, "__esModule", { value: true });
    exports.SPECIAL_HEADERS = exports.MINOR = exports.MAJOR = exports.HTAB_SP_VCHAR_OBS_TEXT = exports.QUOTED_STRING = exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS = exports.TOKEN = exports.HEX = exports.URL_CHAR = exports.USERINFO_CHARS = exports.MARK = exports.ALPHANUM = exports.NUM = exports.HEX_MAP = exports.NUM_MAP = exports.ALPHA = exports.STATUSES_HTTP = exports.H_METHOD_MAP = exports.METHOD_MAP = exports.METHODS_RTSP = exports.METHODS_ICE = exports.METHODS_HTTP = exports.HEADER_STATE = exports.FINISH = exports.STATUSES = exports.METHODS = exports.LENIENT_FLAGS = exports.FLAGS = exports.TYPE = exports.ERROR = void 0;
    var utils_1 = require_utils();
    exports.ERROR = {
      OK: 0,
      INTERNAL: 1,
      STRICT: 2,
      CR_EXPECTED: 25,
      LF_EXPECTED: 3,
      UNEXPECTED_CONTENT_LENGTH: 4,
      UNEXPECTED_SPACE: 30,
      CLOSED_CONNECTION: 5,
      INVALID_METHOD: 6,
      INVALID_URL: 7,
      INVALID_CONSTANT: 8,
      INVALID_VERSION: 9,
      INVALID_HEADER_TOKEN: 10,
      INVALID_CONTENT_LENGTH: 11,
      INVALID_CHUNK_SIZE: 12,
      INVALID_STATUS: 13,
      INVALID_EOF_STATE: 14,
      INVALID_TRANSFER_ENCODING: 15,
      CB_MESSAGE_BEGIN: 16,
      CB_HEADERS_COMPLETE: 17,
      CB_MESSAGE_COMPLETE: 18,
      CB_CHUNK_HEADER: 19,
      CB_CHUNK_COMPLETE: 20,
      PAUSED: 21,
      PAUSED_UPGRADE: 22,
      PAUSED_H2_UPGRADE: 23,
      USER: 24,
      CB_URL_COMPLETE: 26,
      CB_STATUS_COMPLETE: 27,
      CB_METHOD_COMPLETE: 32,
      CB_VERSION_COMPLETE: 33,
      CB_HEADER_FIELD_COMPLETE: 28,
      CB_HEADER_VALUE_COMPLETE: 29,
      CB_CHUNK_EXTENSION_NAME_COMPLETE: 34,
      CB_CHUNK_EXTENSION_VALUE_COMPLETE: 35,
      CB_RESET: 31,
      CB_PROTOCOL_COMPLETE: 38
    };
    exports.TYPE = {
      BOTH: 0,
      // default
      REQUEST: 1,
      RESPONSE: 2
    };
    exports.FLAGS = {
      CONNECTION_KEEP_ALIVE: 1 << 0,
      CONNECTION_CLOSE: 1 << 1,
      CONNECTION_UPGRADE: 1 << 2,
      CHUNKED: 1 << 3,
      UPGRADE: 1 << 4,
      CONTENT_LENGTH: 1 << 5,
      SKIPBODY: 1 << 6,
      TRAILING: 1 << 7,
      // 1 << 8 is unused
      TRANSFER_ENCODING: 1 << 9
    };
    exports.LENIENT_FLAGS = {
      HEADERS: 1 << 0,
      CHUNKED_LENGTH: 1 << 1,
      KEEP_ALIVE: 1 << 2,
      TRANSFER_ENCODING: 1 << 3,
      VERSION: 1 << 4,
      DATA_AFTER_CLOSE: 1 << 5,
      OPTIONAL_LF_AFTER_CR: 1 << 6,
      OPTIONAL_CRLF_AFTER_CHUNK: 1 << 7,
      OPTIONAL_CR_BEFORE_LF: 1 << 8,
      SPACES_AFTER_CHUNK_SIZE: 1 << 9
    };
    exports.METHODS = {
      "DELETE": 0,
      "GET": 1,
      "HEAD": 2,
      "POST": 3,
      "PUT": 4,
      /* pathological */
      "CONNECT": 5,
      "OPTIONS": 6,
      "TRACE": 7,
      /* WebDAV */
      "COPY": 8,
      "LOCK": 9,
      "MKCOL": 10,
      "MOVE": 11,
      "PROPFIND": 12,
      "PROPPATCH": 13,
      "SEARCH": 14,
      "UNLOCK": 15,
      "BIND": 16,
      "REBIND": 17,
      "UNBIND": 18,
      "ACL": 19,
      /* subversion */
      "REPORT": 20,
      "MKACTIVITY": 21,
      "CHECKOUT": 22,
      "MERGE": 23,
      /* upnp */
      "M-SEARCH": 24,
      "NOTIFY": 25,
      "SUBSCRIBE": 26,
      "UNSUBSCRIBE": 27,
      /* RFC-5789 */
      "PATCH": 28,
      "PURGE": 29,
      /* CalDAV */
      "MKCALENDAR": 30,
      /* RFC-2068, section 19.6.1.2 */
      "LINK": 31,
      "UNLINK": 32,
      /* icecast */
      "SOURCE": 33,
      /* RFC-7540, section 11.6 */
      "PRI": 34,
      /* RFC-2326 RTSP */
      "DESCRIBE": 35,
      "ANNOUNCE": 36,
      "SETUP": 37,
      "PLAY": 38,
      "PAUSE": 39,
      "TEARDOWN": 40,
      "GET_PARAMETER": 41,
      "SET_PARAMETER": 42,
      "REDIRECT": 43,
      "RECORD": 44,
      /* RAOP */
      "FLUSH": 45,
      /* DRAFT https://www.ietf.org/archive/id/draft-ietf-httpbis-safe-method-w-body-02.html */
      "QUERY": 46
    };
    exports.STATUSES = {
      CONTINUE: 100,
      SWITCHING_PROTOCOLS: 101,
      PROCESSING: 102,
      EARLY_HINTS: 103,
      RESPONSE_IS_STALE: 110,
      // Unofficial
      REVALIDATION_FAILED: 111,
      // Unofficial
      DISCONNECTED_OPERATION: 112,
      // Unofficial
      HEURISTIC_EXPIRATION: 113,
      // Unofficial
      MISCELLANEOUS_WARNING: 199,
      // Unofficial
      OK: 200,
      CREATED: 201,
      ACCEPTED: 202,
      NON_AUTHORITATIVE_INFORMATION: 203,
      NO_CONTENT: 204,
      RESET_CONTENT: 205,
      PARTIAL_CONTENT: 206,
      MULTI_STATUS: 207,
      ALREADY_REPORTED: 208,
      TRANSFORMATION_APPLIED: 214,
      // Unofficial
      IM_USED: 226,
      MISCELLANEOUS_PERSISTENT_WARNING: 299,
      // Unofficial
      MULTIPLE_CHOICES: 300,
      MOVED_PERMANENTLY: 301,
      FOUND: 302,
      SEE_OTHER: 303,
      NOT_MODIFIED: 304,
      USE_PROXY: 305,
      SWITCH_PROXY: 306,
      // No longer used
      TEMPORARY_REDIRECT: 307,
      PERMANENT_REDIRECT: 308,
      BAD_REQUEST: 400,
      UNAUTHORIZED: 401,
      PAYMENT_REQUIRED: 402,
      FORBIDDEN: 403,
      NOT_FOUND: 404,
      METHOD_NOT_ALLOWED: 405,
      NOT_ACCEPTABLE: 406,
      PROXY_AUTHENTICATION_REQUIRED: 407,
      REQUEST_TIMEOUT: 408,
      CONFLICT: 409,
      GONE: 410,
      LENGTH_REQUIRED: 411,
      PRECONDITION_FAILED: 412,
      PAYLOAD_TOO_LARGE: 413,
      URI_TOO_LONG: 414,
      UNSUPPORTED_MEDIA_TYPE: 415,
      RANGE_NOT_SATISFIABLE: 416,
      EXPECTATION_FAILED: 417,
      IM_A_TEAPOT: 418,
      PAGE_EXPIRED: 419,
      // Unofficial
      ENHANCE_YOUR_CALM: 420,
      // Unofficial
      MISDIRECTED_REQUEST: 421,
      UNPROCESSABLE_ENTITY: 422,
      LOCKED: 423,
      FAILED_DEPENDENCY: 424,
      TOO_EARLY: 425,
      UPGRADE_REQUIRED: 426,
      PRECONDITION_REQUIRED: 428,
      TOO_MANY_REQUESTS: 429,
      REQUEST_HEADER_FIELDS_TOO_LARGE_UNOFFICIAL: 430,
      // Unofficial
      REQUEST_HEADER_FIELDS_TOO_LARGE: 431,
      LOGIN_TIMEOUT: 440,
      // Unofficial
      NO_RESPONSE: 444,
      // Unofficial
      RETRY_WITH: 449,
      // Unofficial
      BLOCKED_BY_PARENTAL_CONTROL: 450,
      // Unofficial
      UNAVAILABLE_FOR_LEGAL_REASONS: 451,
      CLIENT_CLOSED_LOAD_BALANCED_REQUEST: 460,
      // Unofficial
      INVALID_X_FORWARDED_FOR: 463,
      // Unofficial
      REQUEST_HEADER_TOO_LARGE: 494,
      // Unofficial
      SSL_CERTIFICATE_ERROR: 495,
      // Unofficial
      SSL_CERTIFICATE_REQUIRED: 496,
      // Unofficial
      HTTP_REQUEST_SENT_TO_HTTPS_PORT: 497,
      // Unofficial
      INVALID_TOKEN: 498,
      // Unofficial
      CLIENT_CLOSED_REQUEST: 499,
      // Unofficial
      INTERNAL_SERVER_ERROR: 500,
      NOT_IMPLEMENTED: 501,
      BAD_GATEWAY: 502,
      SERVICE_UNAVAILABLE: 503,
      GATEWAY_TIMEOUT: 504,
      HTTP_VERSION_NOT_SUPPORTED: 505,
      VARIANT_ALSO_NEGOTIATES: 506,
      INSUFFICIENT_STORAGE: 507,
      LOOP_DETECTED: 508,
      BANDWIDTH_LIMIT_EXCEEDED: 509,
      NOT_EXTENDED: 510,
      NETWORK_AUTHENTICATION_REQUIRED: 511,
      WEB_SERVER_UNKNOWN_ERROR: 520,
      // Unofficial
      WEB_SERVER_IS_DOWN: 521,
      // Unofficial
      CONNECTION_TIMEOUT: 522,
      // Unofficial
      ORIGIN_IS_UNREACHABLE: 523,
      // Unofficial
      TIMEOUT_OCCURED: 524,
      // Unofficial
      SSL_HANDSHAKE_FAILED: 525,
      // Unofficial
      INVALID_SSL_CERTIFICATE: 526,
      // Unofficial
      RAILGUN_ERROR: 527,
      // Unofficial
      SITE_IS_OVERLOADED: 529,
      // Unofficial
      SITE_IS_FROZEN: 530,
      // Unofficial
      IDENTITY_PROVIDER_AUTHENTICATION_ERROR: 561,
      // Unofficial
      NETWORK_READ_TIMEOUT: 598,
      // Unofficial
      NETWORK_CONNECT_TIMEOUT: 599
      // Unofficial
    };
    exports.FINISH = {
      SAFE: 0,
      SAFE_WITH_CB: 1,
      UNSAFE: 2
    };
    exports.HEADER_STATE = {
      GENERAL: 0,
      CONNECTION: 1,
      CONTENT_LENGTH: 2,
      TRANSFER_ENCODING: 3,
      UPGRADE: 4,
      CONNECTION_KEEP_ALIVE: 5,
      CONNECTION_CLOSE: 6,
      CONNECTION_UPGRADE: 7,
      TRANSFER_ENCODING_CHUNKED: 8
    };
    exports.METHODS_HTTP = [
      exports.METHODS.DELETE,
      exports.METHODS.GET,
      exports.METHODS.HEAD,
      exports.METHODS.POST,
      exports.METHODS.PUT,
      exports.METHODS.CONNECT,
      exports.METHODS.OPTIONS,
      exports.METHODS.TRACE,
      exports.METHODS.COPY,
      exports.METHODS.LOCK,
      exports.METHODS.MKCOL,
      exports.METHODS.MOVE,
      exports.METHODS.PROPFIND,
      exports.METHODS.PROPPATCH,
      exports.METHODS.SEARCH,
      exports.METHODS.UNLOCK,
      exports.METHODS.BIND,
      exports.METHODS.REBIND,
      exports.METHODS.UNBIND,
      exports.METHODS.ACL,
      exports.METHODS.REPORT,
      exports.METHODS.MKACTIVITY,
      exports.METHODS.CHECKOUT,
      exports.METHODS.MERGE,
      exports.METHODS["M-SEARCH"],
      exports.METHODS.NOTIFY,
      exports.METHODS.SUBSCRIBE,
      exports.METHODS.UNSUBSCRIBE,
      exports.METHODS.PATCH,
      exports.METHODS.PURGE,
      exports.METHODS.MKCALENDAR,
      exports.METHODS.LINK,
      exports.METHODS.UNLINK,
      exports.METHODS.PRI,
      // TODO(indutny): should we allow it with HTTP?
      exports.METHODS.SOURCE,
      exports.METHODS.QUERY
    ];
    exports.METHODS_ICE = [
      exports.METHODS.SOURCE
    ];
    exports.METHODS_RTSP = [
      exports.METHODS.OPTIONS,
      exports.METHODS.DESCRIBE,
      exports.METHODS.ANNOUNCE,
      exports.METHODS.SETUP,
      exports.METHODS.PLAY,
      exports.METHODS.PAUSE,
      exports.METHODS.TEARDOWN,
      exports.METHODS.GET_PARAMETER,
      exports.METHODS.SET_PARAMETER,
      exports.METHODS.REDIRECT,
      exports.METHODS.RECORD,
      exports.METHODS.FLUSH,
      // For AirPlay
      exports.METHODS.GET,
      exports.METHODS.POST
    ];
    exports.METHOD_MAP = (0, utils_1.enumToMap)(exports.METHODS);
    exports.H_METHOD_MAP = Object.fromEntries(Object.entries(exports.METHODS).filter(([k7]) => k7.startsWith("H")));
    exports.STATUSES_HTTP = [
      exports.STATUSES.CONTINUE,
      exports.STATUSES.SWITCHING_PROTOCOLS,
      exports.STATUSES.PROCESSING,
      exports.STATUSES.EARLY_HINTS,
      exports.STATUSES.RESPONSE_IS_STALE,
      exports.STATUSES.REVALIDATION_FAILED,
      exports.STATUSES.DISCONNECTED_OPERATION,
      exports.STATUSES.HEURISTIC_EXPIRATION,
      exports.STATUSES.MISCELLANEOUS_WARNING,
      exports.STATUSES.OK,
      exports.STATUSES.CREATED,
      exports.STATUSES.ACCEPTED,
      exports.STATUSES.NON_AUTHORITATIVE_INFORMATION,
      exports.STATUSES.NO_CONTENT,
      exports.STATUSES.RESET_CONTENT,
      exports.STATUSES.PARTIAL_CONTENT,
      exports.STATUSES.MULTI_STATUS,
      exports.STATUSES.ALREADY_REPORTED,
      exports.STATUSES.TRANSFORMATION_APPLIED,
      exports.STATUSES.IM_USED,
      exports.STATUSES.MISCELLANEOUS_PERSISTENT_WARNING,
      exports.STATUSES.MULTIPLE_CHOICES,
      exports.STATUSES.MOVED_PERMANENTLY,
      exports.STATUSES.FOUND,
      exports.STATUSES.SEE_OTHER,
      exports.STATUSES.NOT_MODIFIED,
      exports.STATUSES.USE_PROXY,
      exports.STATUSES.SWITCH_PROXY,
      exports.STATUSES.TEMPORARY_REDIRECT,
      exports.STATUSES.PERMANENT_REDIRECT,
      exports.STATUSES.BAD_REQUEST,
      exports.STATUSES.UNAUTHORIZED,
      exports.STATUSES.PAYMENT_REQUIRED,
      exports.STATUSES.FORBIDDEN,
      exports.STATUSES.NOT_FOUND,
      exports.STATUSES.METHOD_NOT_ALLOWED,
      exports.STATUSES.NOT_ACCEPTABLE,
      exports.STATUSES.PROXY_AUTHENTICATION_REQUIRED,
      exports.STATUSES.REQUEST_TIMEOUT,
      exports.STATUSES.CONFLICT,
      exports.STATUSES.GONE,
      exports.STATUSES.LENGTH_REQUIRED,
      exports.STATUSES.PRECONDITION_FAILED,
      exports.STATUSES.PAYLOAD_TOO_LARGE,
      exports.STATUSES.URI_TOO_LONG,
      exports.STATUSES.UNSUPPORTED_MEDIA_TYPE,
      exports.STATUSES.RANGE_NOT_SATISFIABLE,
      exports.STATUSES.EXPECTATION_FAILED,
      exports.STATUSES.IM_A_TEAPOT,
      exports.STATUSES.PAGE_EXPIRED,
      exports.STATUSES.ENHANCE_YOUR_CALM,
      exports.STATUSES.MISDIRECTED_REQUEST,
      exports.STATUSES.UNPROCESSABLE_ENTITY,
      exports.STATUSES.LOCKED,
      exports.STATUSES.FAILED_DEPENDENCY,
      exports.STATUSES.TOO_EARLY,
      exports.STATUSES.UPGRADE_REQUIRED,
      exports.STATUSES.PRECONDITION_REQUIRED,
      exports.STATUSES.TOO_MANY_REQUESTS,
      exports.STATUSES.REQUEST_HEADER_FIELDS_TOO_LARGE_UNOFFICIAL,
      exports.STATUSES.REQUEST_HEADER_FIELDS_TOO_LARGE,
      exports.STATUSES.LOGIN_TIMEOUT,
      exports.STATUSES.NO_RESPONSE,
      exports.STATUSES.RETRY_WITH,
      exports.STATUSES.BLOCKED_BY_PARENTAL_CONTROL,
      exports.STATUSES.UNAVAILABLE_FOR_LEGAL_REASONS,
      exports.STATUSES.CLIENT_CLOSED_LOAD_BALANCED_REQUEST,
      exports.STATUSES.INVALID_X_FORWARDED_FOR,
      exports.STATUSES.REQUEST_HEADER_TOO_LARGE,
      exports.STATUSES.SSL_CERTIFICATE_ERROR,
      exports.STATUSES.SSL_CERTIFICATE_REQUIRED,
      exports.STATUSES.HTTP_REQUEST_SENT_TO_HTTPS_PORT,
      exports.STATUSES.INVALID_TOKEN,
      exports.STATUSES.CLIENT_CLOSED_REQUEST,
      exports.STATUSES.INTERNAL_SERVER_ERROR,
      exports.STATUSES.NOT_IMPLEMENTED,
      exports.STATUSES.BAD_GATEWAY,
      exports.STATUSES.SERVICE_UNAVAILABLE,
      exports.STATUSES.GATEWAY_TIMEOUT,
      exports.STATUSES.HTTP_VERSION_NOT_SUPPORTED,
      exports.STATUSES.VARIANT_ALSO_NEGOTIATES,
      exports.STATUSES.INSUFFICIENT_STORAGE,
      exports.STATUSES.LOOP_DETECTED,
      exports.STATUSES.BANDWIDTH_LIMIT_EXCEEDED,
      exports.STATUSES.NOT_EXTENDED,
      exports.STATUSES.NETWORK_AUTHENTICATION_REQUIRED,
      exports.STATUSES.WEB_SERVER_UNKNOWN_ERROR,
      exports.STATUSES.WEB_SERVER_IS_DOWN,
      exports.STATUSES.CONNECTION_TIMEOUT,
      exports.STATUSES.ORIGIN_IS_UNREACHABLE,
      exports.STATUSES.TIMEOUT_OCCURED,
      exports.STATUSES.SSL_HANDSHAKE_FAILED,
      exports.STATUSES.INVALID_SSL_CERTIFICATE,
      exports.STATUSES.RAILGUN_ERROR,
      exports.STATUSES.SITE_IS_OVERLOADED,
      exports.STATUSES.SITE_IS_FROZEN,
      exports.STATUSES.IDENTITY_PROVIDER_AUTHENTICATION_ERROR,
      exports.STATUSES.NETWORK_READ_TIMEOUT,
      exports.STATUSES.NETWORK_CONNECT_TIMEOUT
    ];
    exports.ALPHA = [];
    for (let i7 = "A".charCodeAt(0); i7 <= "Z".charCodeAt(0); i7++) {
      exports.ALPHA.push(String.fromCharCode(i7));
      exports.ALPHA.push(String.fromCharCode(i7 + 32));
    }
    exports.NUM_MAP = {
      0: 0,
      1: 1,
      2: 2,
      3: 3,
      4: 4,
      5: 5,
      6: 6,
      7: 7,
      8: 8,
      9: 9
    };
    exports.HEX_MAP = {
      0: 0,
      1: 1,
      2: 2,
      3: 3,
      4: 4,
      5: 5,
      6: 6,
      7: 7,
      8: 8,
      9: 9,
      A: 10,
      B: 11,
      C: 12,
      D: 13,
      E: 14,
      F: 15,
      a: 10,
      b: 11,
      c: 12,
      d: 13,
      e: 14,
      f: 15
    };
    exports.NUM = [
      "0",
      "1",
      "2",
      "3",
      "4",
      "5",
      "6",
      "7",
      "8",
      "9"
    ];
    exports.ALPHANUM = exports.ALPHA.concat(exports.NUM);
    exports.MARK = ["-", "_", ".", "!", "~", "*", "'", "(", ")"];
    exports.USERINFO_CHARS = exports.ALPHANUM.concat(exports.MARK).concat(["%", ";", ":", "&", "=", "+", "$", ","]);
    exports.URL_CHAR = [
      "!",
      '"',
      "$",
      "%",
      "&",
      "'",
      "(",
      ")",
      "*",
      "+",
      ",",
      "-",
      ".",
      "/",
      ":",
      ";",
      "<",
      "=",
      ">",
      "@",
      "[",
      "\\",
      "]",
      "^",
      "_",
      "`",
      "{",
      "|",
      "}",
      "~"
    ].concat(exports.ALPHANUM);
    exports.HEX = exports.NUM.concat(["a", "b", "c", "d", "e", "f", "A", "B", "C", "D", "E", "F"]);
    exports.TOKEN = [
      "!",
      "#",
      "$",
      "%",
      "&",
      "'",
      "*",
      "+",
      "-",
      ".",
      "^",
      "_",
      "`",
      "|",
      "~"
    ].concat(exports.ALPHANUM);
    exports.HEADER_CHARS = ["	"];
    for (let i7 = 32; i7 <= 255; i7++) {
      if (i7 !== 127) {
        exports.HEADER_CHARS.push(i7);
      }
    }
    exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS.filter((c8) => c8 !== 44);
    exports.QUOTED_STRING = ["	", " "];
    for (let i7 = 33; i7 <= 255; i7++) {
      if (i7 !== 34 && i7 !== 92) {
        exports.QUOTED_STRING.push(i7);
      }
    }
    exports.HTAB_SP_VCHAR_OBS_TEXT = ["	", " "];
    for (let i7 = 33; i7 <= 126; i7++) {
      exports.HTAB_SP_VCHAR_OBS_TEXT.push(i7);
    }
    for (let i7 = 128; i7 <= 255; i7++) {
      exports.HTAB_SP_VCHAR_OBS_TEXT.push(i7);
    }
    exports.MAJOR = exports.NUM_MAP;
    exports.MINOR = exports.MAJOR;
    exports.SPECIAL_HEADERS = {
      "connection": exports.HEADER_STATE.CONNECTION,
      "content-length": exports.HEADER_STATE.CONTENT_LENGTH,
      "proxy-connection": exports.HEADER_STATE.CONNECTION,
      "transfer-encoding": exports.HEADER_STATE.TRANSFER_ENCODING,
      "upgrade": exports.HEADER_STATE.UPGRADE
    };
    exports.default = {
      ERROR: exports.ERROR,
      TYPE: exports.TYPE,
      FLAGS: exports.FLAGS,
      LENIENT_FLAGS: exports.LENIENT_FLAGS,
      METHODS: exports.METHODS,
      STATUSES: exports.STATUSES,
      FINISH: exports.FINISH,
      HEADER_STATE: exports.HEADER_STATE,
      ALPHA: exports.ALPHA,
      NUM_MAP: exports.NUM_MAP,
      HEX_MAP: exports.HEX_MAP,
      NUM: exports.NUM,
      ALPHANUM: exports.ALPHANUM,
      MARK: exports.MARK,
      USERINFO_CHARS: exports.USERINFO_CHARS,
      URL_CHAR: exports.URL_CHAR,
      HEX: exports.HEX,
      TOKEN: exports.TOKEN,
      HEADER_CHARS: exports.HEADER_CHARS,
      CONNECTION_TOKEN_CHARS: exports.CONNECTION_TOKEN_CHARS,
      QUOTED_STRING: exports.QUOTED_STRING,
      HTAB_SP_VCHAR_OBS_TEXT: exports.HTAB_SP_VCHAR_OBS_TEXT,
      MAJOR: exports.MAJOR,
      MINOR: exports.MINOR,
      SPECIAL_HEADERS: exports.SPECIAL_HEADERS,
      METHODS_HTTP: exports.METHODS_HTTP,
      METHODS_ICE: exports.METHODS_ICE,
      METHODS_RTSP: exports.METHODS_RTSP,
      METHOD_MAP: exports.METHOD_MAP,
      H_METHOD_MAP: exports.H_METHOD_MAP,
      STATUSES_HTTP: exports.STATUSES_HTTP
    };
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/llhttp/llhttp-wasm.js
var require_llhttp_wasm = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/llhttp/llhttp-wasm.js"(exports, module2) {
    init_import_meta_url();
    var { Buffer: Buffer8 } = __require("buffer");
    var wasmBase64 = " ";
    var wasmBuffer;
    Object.defineProperty(module2, "exports", {
      get: /* @__PURE__ */ __name(() => {
        return wasmBuffer ? wasmBuffer : wasmBuffer = Buffer8.from(wasmBase64, "base64");
      }, "get")
    });
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/llhttp/llhttp_simd-wasm.js
var require_llhttp_simd_wasm = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/llhttp/llhttp_simd-wasm.js"(exports, module2) {
    init_import_meta_url();
    var { Buffer: Buffer8 } = __require("buffer");
    var wasmBase64 = " ";
    var wasmBuffer;
    Object.defineProperty(module2, "exports", {
      get: /* @__PURE__ */ __name(() => {
        return wasmBuffer ? wasmBuffer : wasmBuffer = Buffer8.from(wasmBase64, "base64");
      }, "get")
    });
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/web/fetch/constants.js
var require_constants3 = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/web/fetch/constants.js"(exports, module2) {
    init_import_meta_url();
    var corsSafeListedMethods = (
      /** @type {const} */
      ["GET", "HEAD", "POST"]
    );
    var corsSafeListedMethodsSet = new Set(corsSafeListedMethods);
    var nullBodyStatus = (
      /** @type {const} */
      [101, 204, 205, 304]
    );
    var redirectStatus = (
      /** @type {const} */
      [301, 302, 303, 307, 308]
    );
    var redirectStatusSet = new Set(redirectStatus);
    var badPorts = (
      /** @type {const} */
      [
        "1",
        "7",
        "9",
        "11",
        "13",
        "15",
        "17",
        "19",
        "20",
        "21",
        "22",
        "23",
        "25",
        "37",
        "42",
        "43",
        "53",
        "69",
        "77",
        "79",
        "87",
        "95",
        "101",
        "102",
        "103",
        "104",
        "109",
        "110",
        "111",
        "113",
        "115",
        "117",
        "119",
        "123",
        "135",
        "137",
        "139",
        "143",
        "161",
        "179",
        "389",
        "427",
        "465",
        "512",
        "513",
        "514",
        "515",
        "526",
        "530",
        "531",
        "532",
        "540",
        "548",
        "554",
        "556",
        "563",
        "587",
        "601",
        "636",
        "989",
        "990",
        "993",
        "995",
        "1719",
        "1720",
        "1723",
        "2049",
        "3659",
        "4045",
        "4190",
        "5060",
        "5061",
        "6000",
        "6566",
        "6665",
        "6666",
        "6667",
        "6668",
        "6669",
        "6679",
        "6697",
        "10080"
      ]
    );
    var badPortsSet = new Set(badPorts);
    var referrerPolicyTokens = (
      /** @type {const} */
      [
        "no-referrer",
        "no-referrer-when-downgrade",
        "same-origin",
        "origin",
        "strict-origin",
        "origin-when-cross-origin",
        "strict-origin-when-cross-origin",
        "unsafe-url"
      ]
    );
    var referrerPolicy = (
      /** @type {const} */
      [
        "",
        ...referrerPolicyTokens
      ]
    );
    var referrerPolicyTokensSet = new Set(referrerPolicyTokens);
    var requestRedirect = (
      /** @type {const} */
      ["follow", "manual", "error"]
    );
    var safeMethods = (
      /** @type {const} */
      ["GET", "HEAD", "OPTIONS", "TRACE"]
    );
    var safeMethodsSet = new Set(safeMethods);
    var requestMode = (
      /** @type {const} */
      ["navigate", "same-origin", "no-cors", "cors"]
    );
    var requestCredentials = (
      /** @type {const} */
      ["omit", "same-origin", "include"]
    );
    var requestCache = (
      /** @type {const} */
      [
        "default",
        "no-store",
        "reload",
        "no-cache",
        "force-cache",
        "only-if-cached"
      ]
    );
    var requestBodyHeader = (
      /** @type {const} */
      [
        "content-encoding",
        "content-language",
        "content-location",
        "content-type",
        // See https://github.com/nodejs/undici/issues/2021
        // 'Content-Length' is a forbidden header name, which is typically
        // removed in the Headers implementation. However, undici doesn't
        // filter out headers, so we add it here.
        "content-length"
      ]
    );
    var requestDuplex = (
      /** @type {const} */
      [
        "half"
      ]
    );
    var forbiddenMethods = (
      /** @type {const} */
      ["CONNECT", "TRACE", "TRACK"]
    );
    var forbiddenMethodsSet = new Set(forbiddenMethods);
    var subresource = (
      /** @type {const} */
      [
        "audio",
        "audioworklet",
        "font",
        "image",
        "manifest",
        "paintworklet",
        "script",
        "style",
        "track",
        "video",
        "xslt",
        ""
      ]
    );
    var subresourceSet = new Set(subresource);
    module2.exports = {
      subresource,
      forbiddenMethods,
      requestBodyHeader,
      referrerPolicy,
      requestRedirect,
      requestMode,
      requestCredentials,
      requestCache,
      redirectStatus,
      corsSafeListedMethods,
      nullBodyStatus,
      safeMethods,
      badPorts,
      requestDuplex,
      subresourceSet,
      badPortsSet,
      redirectStatusSet,
      corsSafeListedMethodsSet,
      safeMethodsSet,
      forbiddenMethodsSet,
      referrerPolicyTokens: referrerPolicyTokensSet
    };
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/web/fetch/global.js
var require_global = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/web/fetch/global.js"(exports, module2) {
    init_import_meta_url();
    var globalOrigin = Symbol.for("undici.globalOrigin.1");
    function getGlobalOrigin() {
      return globalThis[globalOrigin];
    }
    __name(getGlobalOrigin, "getGlobalOrigin");
    function setGlobalOrigin(newOrigin) {
      if (newOrigin === void 0) {
        Object.defineProperty(globalThis, globalOrigin, {
          value: void 0,
          writable: true,
          enumerable: false,
          configurable: false
        });
        return;
      }
      const parsedURL = new URL(newOrigin);
      if (parsedURL.protocol !== "http:" && parsedURL.protocol !== "https:") {
        throw new TypeError(`Only http & https urls are allowed, received ${parsedURL.protocol}`);
      }
      Object.defineProperty(globalThis, globalOrigin, {
        value: parsedURL,
        writable: true,
        enumerable: false,
        configurable: false
      });
    }
    __name(setGlobalOrigin, "setGlobalOrigin");
    module2.exports = {
      getGlobalOrigin,
      setGlobalOrigin
    };
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/encoding/index.js
var require_encoding = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/encoding/index.js"(exports, module2) {
    init_import_meta_url();
    var textDecoder = new TextDecoder();
    function utf8DecodeBytes(buffer) {
      if (buffer.length === 0) {
        return "";
      }
      if (buffer[0] === 239 && buffer[1] === 187 && buffer[2] === 191) {
        buffer = buffer.subarray(3);
      }
      const output = textDecoder.decode(buffer);
      return output;
    }
    __name(utf8DecodeBytes, "utf8DecodeBytes");
    module2.exports = {
      utf8DecodeBytes
    };
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/web/infra/index.js
var require_infra = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/web/infra/index.js"(exports, module2) {
    init_import_meta_url();
    var assert61 = __require("assert");
    var { utf8DecodeBytes } = require_encoding();
    function collectASequenceOfCodePoints(condition, input, position) {
      let result = "";
      while (position.position < input.length && condition(input[position.position])) {
        result += input[position.position];
        position.position++;
      }
      return result;
    }
    __name(collectASequenceOfCodePoints, "collectASequenceOfCodePoints");
    function collectASequenceOfCodePointsFast(char, input, position) {
      const idx = input.indexOf(char, position.position);
      const start = position.position;
      if (idx === -1) {
        position.position = input.length;
        return input.slice(start);
      }
      position.position = idx;
      return input.slice(start, position.position);
    }
    __name(collectASequenceOfCodePointsFast, "collectASequenceOfCodePointsFast");
    var ASCII_WHITESPACE_REPLACE_REGEX = /[\u0009\u000A\u000C\u000D\u0020]/g;
    function forgivingBase64(data) {
      data = data.replace(ASCII_WHITESPACE_REPLACE_REGEX, "");
      let dataLength = data.length;
      if (dataLength % 4 === 0) {
        if (data.charCodeAt(dataLength - 1) === 61) {
          --dataLength;
          if (data.charCodeAt(dataLength - 1) === 61) {
            --dataLength;
          }
        }
      }
      if (dataLength % 4 === 1) {
        return "failure";
      }
      if (/[^+/0-9A-Za-z]/.test(data.length === dataLength ? data : data.substring(0, dataLength))) {
        return "failure";
      }
      const buffer = Buffer.from(data, "base64");
      return new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength);
    }
    __name(forgivingBase64, "forgivingBase64");
    function isASCIIWhitespace(char) {
      return char === 9 || // \t
      char === 10 || // \n
      char === 12 || // \f
      char === 13 || // \r
      char === 32;
    }
    __name(isASCIIWhitespace, "isASCIIWhitespace");
    function isomorphicDecode(input) {
      const length = input.length;
      if ((2 << 15) - 1 > length) {
        return String.fromCharCode.apply(null, input);
      }
      let result = "";
      let i7 = 0;
      let addition = (2 << 15) - 1;
      while (i7 < length) {
        if (i7 + addition > length) {
          addition = length - i7;
        }
        result += String.fromCharCode.apply(null, input.subarray(i7, i7 += addition));
      }
      return result;
    }
    __name(isomorphicDecode, "isomorphicDecode");
    var invalidIsomorphicEncodeValueRegex = /[^\x00-\xFF]/;
    function isomorphicEncode(input) {
      assert61(!invalidIsomorphicEncodeValueRegex.test(input));
      return input;
    }
    __name(isomorphicEncode, "isomorphicEncode");
    function parseJSONFromBytes(bytes) {
      return JSON.parse(utf8DecodeBytes(bytes));
    }
    __name(parseJSONFromBytes, "parseJSONFromBytes");
    function removeASCIIWhitespace(str, leading = true, trailing = true) {
      return removeChars(str, leading, trailing, isASCIIWhitespace);
    }
    __name(removeASCIIWhitespace, "removeASCIIWhitespace");
    function removeChars(str, leading, trailing, predicate) {
      let lead = 0;
      let trail = str.length - 1;
      if (leading) {
        while (lead < str.length && predicate(str.charCodeAt(lead))) lead++;
      }
      if (trailing) {
        while (trail > 0 && predicate(str.charCodeAt(trail))) trail--;
      }
      return lead === 0 && trail === str.length - 1 ? str : str.slice(lead, trail + 1);
    }
    __name(removeChars, "removeChars");
    function serializeJavascriptValueToJSONString(value) {
      const result = JSON.stringify(value);
      if (result === void 0) {
        throw new TypeError("Value is not JSON serializable");
      }
      assert61(typeof result === "string");
      return result;
    }
    __name(serializeJavascriptValueToJSONString, "serializeJavascriptValueToJSONString");
    module2.exports = {
      collectASequenceOfCodePoints,
      collectASequenceOfCodePointsFast,
      forgivingBase64,
      isASCIIWhitespace,
      isomorphicDecode,
      isomorphicEncode,
      parseJSONFromBytes,
      removeASCIIWhitespace,
      removeChars,
      serializeJavascriptValueToJSONString
    };
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/web/fetch/data-url.js
var require_data_url = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/web/fetch/data-url.js"(exports, module2) {
    init_import_meta_url();
    var assert61 = __require("assert");
    var { forgivingBase64, collectASequenceOfCodePoints, collectASequenceOfCodePointsFast, isomorphicDecode, removeASCIIWhitespace, removeChars } = require_infra();
    var encoder = new TextEncoder();
    var HTTP_TOKEN_CODEPOINTS = /^[-!#$%&'*+.^_|~A-Za-z0-9]+$/u;
    var HTTP_WHITESPACE_REGEX = /[\u000A\u000D\u0009\u0020]/u;
    var HTTP_QUOTED_STRING_TOKENS = /^[\u0009\u0020-\u007E\u0080-\u00FF]+$/u;
    function dataURLProcessor(dataURL) {
      assert61(dataURL.protocol === "data:");
      let input = URLSerializer(dataURL, true);
      input = input.slice(5);
      const position = { position: 0 };
      let mimeType = collectASequenceOfCodePointsFast(
        ",",
        input,
        position
      );
      const mimeTypeLength = mimeType.length;
      mimeType = removeASCIIWhitespace(mimeType, true, true);
      if (position.position >= input.length) {
        return "failure";
      }
      position.position++;
      const encodedBody = input.slice(mimeTypeLength + 1);
      let body = stringPercentDecode(encodedBody);
      if (/;(?:\u0020*)base64$/ui.test(mimeType)) {
        const stringBody = isomorphicDecode(body);
        body = forgivingBase64(stringBody);
        if (body === "failure") {
          return "failure";
        }
        mimeType = mimeType.slice(0, -6);
        mimeType = mimeType.replace(/(\u0020+)$/u, "");
        mimeType = mimeType.slice(0, -1);
      }
      if (mimeType.startsWith(";")) {
        mimeType = "text/plain" + mimeType;
      }
      let mimeTypeRecord = parseMIMEType(mimeType);
      if (mimeTypeRecord === "failure") {
        mimeTypeRecord = parseMIMEType("text/plain;charset=US-ASCII");
      }
      return { mimeType: mimeTypeRecord, body };
    }
    __name(dataURLProcessor, "dataURLProcessor");
    function URLSerializer(url4, excludeFragment = false) {
      if (!excludeFragment) {
        return url4.href;
      }
      const href = url4.href;
      const hashLength = url4.hash.length;
      const serialized = hashLength === 0 ? href : href.substring(0, href.length - hashLength);
      if (!hashLength && href.endsWith("#")) {
        return serialized.slice(0, -1);
      }
      return serialized;
    }
    __name(URLSerializer, "URLSerializer");
    function stringPercentDecode(input) {
      const bytes = encoder.encode(input);
      return percentDecode(bytes);
    }
    __name(stringPercentDecode, "stringPercentDecode");
    function isHexCharByte(byte) {
      return byte >= 48 && byte <= 57 || byte >= 65 && byte <= 70 || byte >= 97 && byte <= 102;
    }
    __name(isHexCharByte, "isHexCharByte");
    function hexByteToNumber(byte) {
      return (
        // 0-9
        byte >= 48 && byte <= 57 ? byte - 48 : (byte & 223) - 55
      );
    }
    __name(hexByteToNumber, "hexByteToNumber");
    function percentDecode(input) {
      const length = input.length;
      const output = new Uint8Array(length);
      let j7 = 0;
      let i7 = 0;
      while (i7 < length) {
        const byte = input[i7];
        if (byte !== 37) {
          output[j7++] = byte;
        } else if (byte === 37 && !(isHexCharByte(input[i7 + 1]) && isHexCharByte(input[i7 + 2]))) {
          output[j7++] = 37;
        } else {
          output[j7++] = hexByteToNumber(input[i7 + 1]) << 4 | hexByteToNumber(input[i7 + 2]);
          i7 += 2;
        }
        ++i7;
      }
      return length === j7 ? output : output.subarray(0, j7);
    }
    __name(percentDecode, "percentDecode");
    function parseMIMEType(input) {
      input = removeHTTPWhitespace(input, true, true);
      const position = { position: 0 };
      const type = collectASequenceOfCodePointsFast(
        "/",
        input,
        position
      );
      if (type.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(type)) {
        return "failure";
      }
      if (position.position >= input.length) {
        return "failure";
      }
      position.position++;
      let subtype = collectASequenceOfCodePointsFast(
        ";",
        input,
        position
      );
      subtype = removeHTTPWhitespace(subtype, false, true);
      if (subtype.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(subtype)) {
        return "failure";
      }
      const typeLowercase = type.toLowerCase();
      const subtypeLowercase = subtype.toLowerCase();
      const mimeType = {
        type: typeLowercase,
        subtype: subtypeLowercase,
        /** @type {Map<string, string>} */
        parameters: /* @__PURE__ */ new Map(),
        // https://mimesniff.spec.whatwg.org/#mime-type-essence
        essence: `${typeLowercase}/${subtypeLowercase}`
      };
      while (position.position < input.length) {
        position.position++;
        collectASequenceOfCodePoints(
          // https://fetch.spec.whatwg.org/#http-whitespace
          (char) => HTTP_WHITESPACE_REGEX.test(char),
          input,
          position
        );
        let parameterName = collectASequenceOfCodePoints(
          (char) => char !== ";" && char !== "=",
          input,
          position
        );
        parameterName = parameterName.toLowerCase();
        if (position.position < input.length) {
          if (input[position.position] === ";") {
            continue;
          }
          position.position++;
        }
        if (position.position >= input.length) {
          break;
        }
        let parameterValue = null;
        if (input[position.position] === '"') {
          parameterValue = collectAnHTTPQuotedString(input, position, true);
          collectASequenceOfCodePointsFast(
            ";",
            input,
            position
          );
        } else {
          parameterValue = collectASequenceOfCodePointsFast(
            ";",
            input,
            position
          );
          parameterValue = removeHTTPWhitespace(parameterValue, false, true);
          if (parameterValue.length === 0) {
            continue;
          }
        }
        if (parameterName.length !== 0 && HTTP_TOKEN_CODEPOINTS.test(parameterName) && (parameterValue.length === 0 || HTTP_QUOTED_STRING_TOKENS.test(parameterValue)) && !mimeType.parameters.has(parameterName)) {
          mimeType.parameters.set(parameterName, parameterValue);
        }
      }
      return mimeType;
    }
    __name(parseMIMEType, "parseMIMEType");
    function collectAnHTTPQuotedString(input, position, extractValue3 = false) {
      const positionStart = position.position;
      let value = "";
      assert61(input[position.position] === '"');
      position.position++;
      while (true) {
        value += collectASequenceOfCodePoints(
          (char) => char !== '"' && char !== "\\",
          input,
          position
        );
        if (position.position >= input.length) {
          break;
        }
        const quoteOrBackslash = input[position.position];
        position.position++;
        if (quoteOrBackslash === "\\") {
          if (position.position >= input.length) {
            value += "\\";
            break;
          }
          value += input[position.position];
          position.position++;
        } else {
          assert61(quoteOrBackslash === '"');
          break;
        }
      }
      if (extractValue3) {
        return value;
      }
      return input.slice(positionStart, position.position);
    }
    __name(collectAnHTTPQuotedString, "collectAnHTTPQuotedString");
    function serializeAMimeType(mimeType) {
      assert61(mimeType !== "failure");
      const { parameters, essence } = mimeType;
      let serialization = essence;
      for (let [name2, value] of parameters.entries()) {
        serialization += ";";
        serialization += name2;
        serialization += "=";
        if (!HTTP_TOKEN_CODEPOINTS.test(value)) {
          value = value.replace(/[\\"]/ug, "\\$&");
          value = '"' + value;
          value += '"';
        }
        serialization += value;
      }
      return serialization;
    }
    __name(serializeAMimeType, "serializeAMimeType");
    function isHTTPWhiteSpace(char) {
      return char === 13 || char === 10 || char === 9 || char === 32;
    }
    __name(isHTTPWhiteSpace, "isHTTPWhiteSpace");
    function removeHTTPWhitespace(str, leading = true, trailing = true) {
      return removeChars(str, leading, trailing, isHTTPWhiteSpace);
    }
    __name(removeHTTPWhitespace, "removeHTTPWhitespace");
    function minimizeSupportedMimeType(mimeType) {
      switch (mimeType.essence) {
        case "application/ecmascript":
        case "application/javascript":
        case "application/x-ecmascript":
        case "application/x-javascript":
        case "text/ecmascript":
        case "text/javascript":
        case "text/javascript1.0":
        case "text/javascript1.1":
        case "text/javascript1.2":
        case "text/javascript1.3":
        case "text/javascript1.4":
        case "text/javascript1.5":
        case "text/jscript":
        case "text/livescript":
        case "text/x-ecmascript":
        case "text/x-javascript":
          return "text/javascript";
        case "application/json":
        case "text/json":
          return "application/json";
        case "image/svg+xml":
          return "image/svg+xml";
        case "text/xml":
        case "application/xml":
          return "application/xml";
      }
      if (mimeType.subtype.endsWith("+json")) {
        return "application/json";
      }
      if (mimeType.subtype.endsWith("+xml")) {
        return "application/xml";
      }
      return "";
    }
    __name(minimizeSupportedMimeType, "minimizeSupportedMimeType");
    module2.exports = {
      dataURLProcessor,
      URLSerializer,
      stringPercentDecode,
      parseMIMEType,
      collectAnHTTPQuotedString,
      serializeAMimeType,
      removeHTTPWhitespace,
      minimizeSupportedMimeType,
      HTTP_TOKEN_CODEPOINTS
    };
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/util/runtime-features.js
var require_runtime_features = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/util/runtime-features.js"(exports, module2) {
    init_import_meta_url();
    var lazyLoaders = {
      __proto__: null,
      "node:crypto": /* @__PURE__ */ __name(() => __require("crypto"), "node:crypto"),
      "node:sqlite": /* @__PURE__ */ __name(() => __require("sqlite"), "node:sqlite"),
      "node:worker_threads": /* @__PURE__ */ __name(() => __require("worker_threads"), "node:worker_threads"),
      "node:zlib": /* @__PURE__ */ __name(() => __require("zlib"), "node:zlib")
    };
    function detectRuntimeFeatureByNodeModule(moduleName) {
      try {
        lazyLoaders[moduleName]();
        return true;
      } catch (err) {
        if (err.code !== "ERR_UNKNOWN_BUILTIN_MODULE" && err.code !== "ERR_NO_CRYPTO") {
          throw err;
        }
        return false;
      }
    }
    __name(detectRuntimeFeatureByNodeModule, "detectRuntimeFeatureByNodeModule");
    function detectRuntimeFeatureByExportedProperty(moduleName, property) {
      const module3 = lazyLoaders[moduleName]();
      return typeof module3[property] !== "undefined";
    }
    __name(detectRuntimeFeatureByExportedProperty, "detectRuntimeFeatureByExportedProperty");
    var runtimeFeaturesByExportedProperty = (
      /** @type {const} */
      ["markAsUncloneable", "zstd"]
    );
    var exportedPropertyLookup = {
      markAsUncloneable: ["node:worker_threads", "markAsUncloneable"],
      zstd: ["node:zlib", "createZstdDecompress"]
    };
    var runtimeFeaturesAsNodeModule = (
      /** @type {const} */
      ["crypto", "sqlite"]
    );
    var features = (
      /** @type {const} */
      [
        ...runtimeFeaturesAsNodeModule,
        ...runtimeFeaturesByExportedProperty
      ]
    );
    function detectRuntimeFeature(feature) {
      if (runtimeFeaturesAsNodeModule.includes(
        /** @type {RuntimeFeatureByNodeModule} */
        feature
      )) {
        return detectRuntimeFeatureByNodeModule(`node:${feature}`);
      } else if (runtimeFeaturesByExportedProperty.includes(
        /** @type {RuntimeFeatureByExportedProperty} */
        feature
      )) {
        const [moduleName, property] = exportedPropertyLookup[feature];
        return detectRuntimeFeatureByExportedProperty(moduleName, property);
      }
      throw new TypeError(`unknown feature: ${feature}`);
    }
    __name(detectRuntimeFeature, "detectRuntimeFeature");
    var RuntimeFeatures = class {
      static {
        __name(this, "RuntimeFeatures");
      }
      /** @type {Map<Feature, boolean>} */
      #map = /* @__PURE__ */ new Map();
      /**
       * Clears all cached feature detections.
       */
      clear() {
        this.#map.clear();
      }
      /**
       * @param {Feature} feature
       * @returns {boolean}
       */
      has(feature) {
        return this.#map.get(feature) ?? this.#detectRuntimeFeature(feature);
      }
      /**
       * @param {Feature} feature
       * @param {boolean} value
       */
      set(feature, value) {
        if (features.includes(feature) === false) {
          throw new TypeError(`unknown feature: ${feature}`);
        }
        this.#map.set(feature, value);
      }
      /**
       * @param {Feature} feature
       * @returns {boolean}
       */
      #detectRuntimeFeature(feature) {
        const result = detectRuntimeFeature(feature);
        this.#map.set(feature, result);
        return result;
      }
    };
    var instance = new RuntimeFeatures();
    module2.exports.runtimeFeatures = instance;
    module2.exports.default = instance;
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/web/webidl/index.js
var require_webidl = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/web/webidl/index.js"(exports, module2) {
    init_import_meta_url();
    var assert61 = __require("assert");
    var { types: types13, inspect: inspect3 } = __require("util");
    var { runtimeFeatures } = require_runtime_features();
    var UNDEFINED = 1;
    var BOOLEAN = 2;
    var STRING = 3;
    var SYMBOL = 4;
    var NUMBER = 5;
    var BIGINT = 6;
    var NULL = 7;
    var OBJECT = 8;
    var FunctionPrototypeSymbolHasInstance = Function.call.bind(Function.prototype[Symbol.hasInstance]);
    var webidl = {
      converters: {},
      util: {},
      errors: {},
      is: {}
    };
    webidl.errors.exception = function(message) {
      return new TypeError(`${message.header}: ${message.message}`);
    };
    webidl.errors.conversionFailed = function(opts) {
      const plural2 = opts.types.length === 1 ? "" : " one of";
      const message = `${opts.argument} could not be converted to${plural2}: ${opts.types.join(", ")}.`;
      return webidl.errors.exception({
        header: opts.prefix,
        message
      });
    };
    webidl.errors.invalidArgument = function(context2) {
      return webidl.errors.exception({
        header: context2.prefix,
        message: `"${context2.value}" is an invalid ${context2.type}.`
      });
    };
    webidl.brandCheck = function(V4, I5) {
      if (!FunctionPrototypeSymbolHasInstance(I5, V4)) {
        const err = new TypeError("Illegal invocation");
        err.code = "ERR_INVALID_THIS";
        throw err;
      }
    };
    webidl.brandCheckMultiple = function(List) {
      const prototypes = List.map((c8) => webidl.util.MakeTypeAssertion(c8));
      return (V4) => {
        if (prototypes.every((typeCheck) => !typeCheck(V4))) {
          const err = new TypeError("Illegal invocation");
          err.code = "ERR_INVALID_THIS";
          throw err;
        }
      };
    };
    webidl.argumentLengthCheck = function({ length }, min, ctx) {
      if (length < min) {
        throw webidl.errors.exception({
          message: `${min} argument${min !== 1 ? "s" : ""} required, but${length ? " only" : ""} ${length} found.`,
          header: ctx
        });
      }
    };
    webidl.illegalConstructor = function() {
      throw webidl.errors.exception({
        header: "TypeError",
        message: "Illegal constructor"
      });
    };
    webidl.util.MakeTypeAssertion = function(I5) {
      return (O4) => FunctionPrototypeSymbolHasInstance(I5, O4);
    };
    webidl.util.Type = function(V4) {
      switch (typeof V4) {
        case "undefined":
          return UNDEFINED;
        case "boolean":
          return BOOLEAN;
        case "string":
          return STRING;
        case "symbol":
          return SYMBOL;
        case "number":
          return NUMBER;
        case "bigint":
          return BIGINT;
        case "function":
        case "object": {
          if (V4 === null) {
            return NULL;
          }
          return OBJECT;
        }
      }
    };
    webidl.util.Types = {
      UNDEFINED,
      BOOLEAN,
      STRING,
      SYMBOL,
      NUMBER,
      BIGINT,
      NULL,
      OBJECT
    };
    webidl.util.TypeValueToString = function(o7) {
      switch (webidl.util.Type(o7)) {
        case UNDEFINED:
          return "Undefined";
        case BOOLEAN:
          return "Boolean";
        case STRING:
          return "String";
        case SYMBOL:
          return "Symbol";
        case NUMBER:
          return "Number";
        case BIGINT:
          return "BigInt";
        case NULL:
          return "Null";
        case OBJECT:
          return "Object";
      }
    };
    webidl.util.markAsUncloneable = runtimeFeatures.has("markAsUncloneable") ? __require("worker_threads").markAsUncloneable : () => {
    };
    webidl.util.ConvertToInt = function(V4, bitLength, signedness, flags2) {
      let upperBound;
      let lowerBound2;
      if (bitLength === 64) {
        upperBound = Math.pow(2, 53) - 1;
        if (signedness === "unsigned") {
          lowerBound2 = 0;
        } else {
          lowerBound2 = Math.pow(-2, 53) + 1;
        }
      } else if (signedness === "unsigned") {
        lowerBound2 = 0;
        upperBound = Math.pow(2, bitLength) - 1;
      } else {
        lowerBound2 = Math.pow(-2, bitLength) - 1;
        upperBound = Math.pow(2, bitLength - 1) - 1;
      }
      let x7 = Number(V4);
      if (x7 === 0) {
        x7 = 0;
      }
      if (webidl.util.HasFlag(flags2, webidl.attributes.EnforceRange)) {
        if (Number.isNaN(x7) || x7 === Number.POSITIVE_INFINITY || x7 === Number.NEGATIVE_INFINITY) {
          throw webidl.errors.exception({
            header: "Integer conversion",
            message: `Could not convert ${webidl.util.Stringify(V4)} to an integer.`
          });
        }
        x7 = webidl.util.IntegerPart(x7);
        if (x7 < lowerBound2 || x7 > upperBound) {
          throw webidl.errors.exception({
            header: "Integer conversion",
            message: `Value must be between ${lowerBound2}-${upperBound}, got ${x7}.`
          });
        }
        return x7;
      }
      if (!Number.isNaN(x7) && webidl.util.HasFlag(flags2, webidl.attributes.Clamp)) {
        x7 = Math.min(Math.max(x7, lowerBound2), upperBound);
        if (Math.floor(x7) % 2 === 0) {
          x7 = Math.floor(x7);
        } else {
          x7 = Math.ceil(x7);
        }
        return x7;
      }
      if (Number.isNaN(x7) || x7 === 0 && Object.is(0, x7) || x7 === Number.POSITIVE_INFINITY || x7 === Number.NEGATIVE_INFINITY) {
        return 0;
      }
      x7 = webidl.util.IntegerPart(x7);
      x7 = x7 % Math.pow(2, bitLength);
      if (signedness === "signed" && x7 >= Math.pow(2, bitLength) - 1) {
        return x7 - Math.pow(2, bitLength);
      }
      return x7;
    };
    webidl.util.IntegerPart = function(n9) {
      const r10 = Math.floor(Math.abs(n9));
      if (n9 < 0) {
        return -1 * r10;
      }
      return r10;
    };
    webidl.util.Stringify = function(V4) {
      const type = webidl.util.Type(V4);
      switch (type) {
        case SYMBOL:
          return `Symbol(${V4.description})`;
        case OBJECT:
          return inspect3(V4);
        case STRING:
          return `"${V4}"`;
        case BIGINT:
          return `${V4}n`;
        default:
          return `${V4}`;
      }
    };
    webidl.util.IsResizableArrayBuffer = function(V4) {
      if (types13.isArrayBuffer(V4)) {
        return V4.resizable;
      }
      if (types13.isSharedArrayBuffer(V4)) {
        return V4.growable;
      }
      throw webidl.errors.exception({
        header: "IsResizableArrayBuffer",
        message: `"${webidl.util.Stringify(V4)}" is not an array buffer.`
      });
    };
    webidl.util.HasFlag = function(flags2, attributes) {
      return typeof flags2 === "number" && (flags2 & attributes) === attributes;
    };
    webidl.sequenceConverter = function(converter) {
      return (V4, prefix, argument, Iterable) => {
        if (webidl.util.Type(V4) !== OBJECT) {
          throw webidl.errors.exception({
            header: prefix,
            message: `${argument} (${webidl.util.Stringify(V4)}) is not iterable.`
          });
        }
        const method = typeof Iterable === "function" ? Iterable() : V4?.[Symbol.iterator]?.();
        const seq = [];
        let index = 0;
        if (method === void 0 || typeof method.next !== "function") {
          throw webidl.errors.exception({
            header: prefix,
            message: `${argument} is not iterable.`
          });
        }
        while (true) {
          const { done, value } = method.next();
          if (done) {
            break;
          }
          seq.push(converter(value, prefix, `${argument}[${index++}]`));
        }
        return seq;
      };
    };
    webidl.recordConverter = function(keyConverter, valueConverter) {
      return (O4, prefix, argument) => {
        if (webidl.util.Type(O4) !== OBJECT) {
          throw webidl.errors.exception({
            header: prefix,
            message: `${argument} ("${webidl.util.TypeValueToString(O4)}") is not an Object.`
          });
        }
        const result = {};
        if (!types13.isProxy(O4)) {
          const keys2 = [...Object.getOwnPropertyNames(O4), ...Object.getOwnPropertySymbols(O4)];
          for (const key of keys2) {
            const keyName = webidl.util.Stringify(key);
            const typedKey = keyConverter(key, prefix, `Key ${keyName} in ${argument}`);
            const typedValue = valueConverter(O4[key], prefix, `${argument}[${keyName}]`);
            result[typedKey] = typedValue;
          }
          return result;
        }
        const keys = Reflect.ownKeys(O4);
        for (const key of keys) {
          const desc = Reflect.getOwnPropertyDescriptor(O4, key);
          if (desc?.enumerable) {
            const typedKey = keyConverter(key, prefix, argument);
            const typedValue = valueConverter(O4[key], prefix, argument);
            result[typedKey] = typedValue;
          }
        }
        return result;
      };
    };
    webidl.interfaceConverter = function(TypeCheck, name2) {
      return (V4, prefix, argument) => {
        if (!TypeCheck(V4)) {
          throw webidl.errors.exception({
            header: prefix,
            message: `Expected ${argument} ("${webidl.util.Stringify(V4)}") to be an instance of ${name2}.`
          });
        }
        return V4;
      };
    };
    webidl.dictionaryConverter = function(converters) {
      converters.sort((a7, b11) => (a7.key > b11.key) - (a7.key < b11.key));
      return (dictionary, prefix, argument) => {
        const dict = {};
        if (dictionary != null && webidl.util.Type(dictionary) !== OBJECT) {
          throw webidl.errors.exception({
            header: prefix,
            message: `Expected ${dictionary} to be one of: Null, Undefined, Object.`
          });
        }
        for (const options of converters) {
          const { key, defaultValue, required, converter } = options;
          if (required === true) {
            if (dictionary == null || !Object.hasOwn(dictionary, key)) {
              throw webidl.errors.exception({
                header: prefix,
                message: `Missing required key "${key}".`
              });
            }
          }
          let value = dictionary?.[key];
          const hasDefault = defaultValue !== void 0;
          if (hasDefault && value === void 0) {
            value = defaultValue();
          }
          if (required || hasDefault || value !== void 0) {
            value = converter(value, prefix, `${argument}.${key}`);
            if (options.allowedValues && !options.allowedValues.includes(value)) {
              throw webidl.errors.exception({
                header: prefix,
                message: `${value} is not an accepted type. Expected one of ${options.allowedValues.join(", ")}.`
              });
            }
            dict[key] = value;
          }
        }
        return dict;
      };
    };
    webidl.nullableConverter = function(converter) {
      return (V4, prefix, argument) => {
        if (V4 === null) {
          return V4;
        }
        return converter(V4, prefix, argument);
      };
    };
    webidl.is.USVString = function(value) {
      return typeof value === "string" && value.isWellFormed();
    };
    webidl.is.ReadableStream = webidl.util.MakeTypeAssertion(ReadableStream);
    webidl.is.Blob = webidl.util.MakeTypeAssertion(Blob);
    webidl.is.URLSearchParams = webidl.util.MakeTypeAssertion(URLSearchParams);
    webidl.is.File = webidl.util.MakeTypeAssertion(File);
    webidl.is.URL = webidl.util.MakeTypeAssertion(URL);
    webidl.is.AbortSignal = webidl.util.MakeTypeAssertion(AbortSignal);
    webidl.is.MessagePort = webidl.util.MakeTypeAssertion(MessagePort);
    webidl.is.BufferSource = function(V4) {
      return types13.isArrayBuffer(V4) || ArrayBuffer.isView(V4) && types13.isArrayBuffer(V4.buffer);
    };
    webidl.util.getCopyOfBytesHeldByBufferSource = function(bufferSource) {
      const jsBufferSource = bufferSource;
      let jsArrayBuffer = jsBufferSource;
      let offset = 0;
      let length = 0;
      if (types13.isTypedArray(jsBufferSource) || types13.isDataView(jsBufferSource)) {
        jsArrayBuffer = jsBufferSource.buffer;
        offset = jsBufferSource.byteOffset;
        length = jsBufferSource.byteLength;
      } else {
        assert61(types13.isAnyArrayBuffer(jsBufferSource));
        length = jsBufferSource.byteLength;
      }
      if (jsArrayBuffer.detached) {
        return new Uint8Array(0);
      }
      const bytes = new Uint8Array(length);
      const view = new Uint8Array(jsArrayBuffer, offset, length);
      bytes.set(view);
      return bytes;
    };
    webidl.converters.DOMString = function(V4, prefix, argument, flags2) {
      if (V4 === null && webidl.util.HasFlag(flags2, webidl.attributes.LegacyNullToEmptyString)) {
        return "";
      }
      if (typeof V4 === "symbol") {
        throw webidl.errors.exception({
          header: prefix,
          message: `${argument} is a symbol, which cannot be converted to a DOMString.`
        });
      }
      return String(V4);
    };
    webidl.converters.ByteString = function(V4, prefix, argument) {
      if (typeof V4 === "symbol") {
        throw webidl.errors.exception({
          header: prefix,
          message: `${argument} is a symbol, which cannot be converted to a ByteString.`
        });
      }
      const x7 = String(V4);
      for (let index = 0; index < x7.length; index++) {
        if (x7.charCodeAt(index) > 255) {
          throw new TypeError(
            `Cannot convert argument to a ByteString because the character at index ${index} has a value of ${x7.charCodeAt(index)} which is greater than 255.`
          );
        }
      }
      return x7;
    };
    webidl.converters.USVString = function(value) {
      if (typeof value === "string") {
        return value.toWellFormed();
      }
      return `${value}`.toWellFormed();
    };
    webidl.converters.boolean = function(V4) {
      const x7 = Boolean(V4);
      return x7;
    };
    webidl.converters.any = function(V4) {
      return V4;
    };
    webidl.converters["long long"] = function(V4, prefix, argument) {
      const x7 = webidl.util.ConvertToInt(V4, 64, "signed", 0, prefix, argument);
      return x7;
    };
    webidl.converters["unsigned long long"] = function(V4, prefix, argument) {
      const x7 = webidl.util.ConvertToInt(V4, 64, "unsigned", 0, prefix, argument);
      return x7;
    };
    webidl.converters["unsigned long"] = function(V4, prefix, argument) {
      const x7 = webidl.util.ConvertToInt(V4, 32, "unsigned", 0, prefix, argument);
      return x7;
    };
    webidl.converters["unsigned short"] = function(V4, prefix, argument, flags2) {
      const x7 = webidl.util.ConvertToInt(V4, 16, "unsigned", flags2, prefix, argument);
      return x7;
    };
    webidl.converters.ArrayBuffer = function(V4, prefix, argument, flags2) {
      if (webidl.util.Type(V4) !== OBJECT || !types13.isArrayBuffer(V4)) {
        throw webidl.errors.conversionFailed({
          prefix,
          argument: `${argument} ("${webidl.util.Stringify(V4)}")`,
          types: ["ArrayBuffer"]
        });
      }
      if (!webidl.util.HasFlag(flags2, webidl.attributes.AllowResizable) && webidl.util.IsResizableArrayBuffer(V4)) {
        throw webidl.errors.exception({
          header: prefix,
          message: `${argument} cannot be a resizable ArrayBuffer.`
        });
      }
      return V4;
    };
    webidl.converters.SharedArrayBuffer = function(V4, prefix, argument, flags2) {
      if (webidl.util.Type(V4) !== OBJECT || !types13.isSharedArrayBuffer(V4)) {
        throw webidl.errors.conversionFailed({
          prefix,
          argument: `${argument} ("${webidl.util.Stringify(V4)}")`,
          types: ["SharedArrayBuffer"]
        });
      }
      if (!webidl.util.HasFlag(flags2, webidl.attributes.AllowResizable) && webidl.util.IsResizableArrayBuffer(V4)) {
        throw webidl.errors.exception({
          header: prefix,
          message: `${argument} cannot be a resizable SharedArrayBuffer.`
        });
      }
      return V4;
    };
    webidl.converters.TypedArray = function(V4, T4, prefix, argument, flags2) {
      if (webidl.util.Type(V4) !== OBJECT || !types13.isTypedArray(V4) || V4.constructor.name !== T4.name) {
        throw webidl.errors.conversionFailed({
          prefix,
          argument: `${argument} ("${webidl.util.Stringify(V4)}")`,
          types: [T4.name]
        });
      }
      if (!webidl.util.HasFlag(flags2, webidl.attributes.AllowShared) && types13.isSharedArrayBuffer(V4.buffer)) {
        throw webidl.errors.exception({
          header: prefix,
          message: `${argument} cannot be a view on a shared array buffer.`
        });
      }
      if (!webidl.util.HasFlag(flags2, webidl.attributes.AllowResizable) && webidl.util.IsResizableArrayBuffer(V4.buffer)) {
        throw webidl.errors.exception({
          header: prefix,
          message: `${argument} cannot be a view on a resizable array buffer.`
        });
      }
      return V4;
    };
    webidl.converters.DataView = function(V4, prefix, argument, flags2) {
      if (webidl.util.Type(V4) !== OBJECT || !types13.isDataView(V4)) {
        throw webidl.errors.conversionFailed({
          prefix,
          argument: `${argument} ("${webidl.util.Stringify(V4)}")`,
          types: ["DataView"]
        });
      }
      if (!webidl.util.HasFlag(flags2, webidl.attributes.AllowShared) && types13.isSharedArrayBuffer(V4.buffer)) {
        throw webidl.errors.exception({
          header: prefix,
          message: `${argument} cannot be a view on a shared array buffer.`
        });
      }
      if (!webidl.util.HasFlag(flags2, webidl.attributes.AllowResizable) && webidl.util.IsResizableArrayBuffer(V4.buffer)) {
        throw webidl.errors.exception({
          header: prefix,
          message: `${argument} cannot be a view on a resizable array buffer.`
        });
      }
      return V4;
    };
    webidl.converters.ArrayBufferView = function(V4, prefix, argument, flags2) {
      if (webidl.util.Type(V4) !== OBJECT || !types13.isArrayBufferView(V4)) {
        throw webidl.errors.conversionFailed({
          prefix,
          argument: `${argument} ("${webidl.util.Stringify(V4)}")`,
          types: ["ArrayBufferView"]
        });
      }
      if (!webidl.util.HasFlag(flags2, webidl.attributes.AllowShared) && types13.isSharedArrayBuffer(V4.buffer)) {
        throw webidl.errors.exception({
          header: prefix,
          message: `${argument} cannot be a view on a shared array buffer.`
        });
      }
      if (!webidl.util.HasFlag(flags2, webidl.attributes.AllowResizable) && webidl.util.IsResizableArrayBuffer(V4.buffer)) {
        throw webidl.errors.exception({
          header: prefix,
          message: `${argument} cannot be a view on a resizable array buffer.`
        });
      }
      return V4;
    };
    webidl.converters.BufferSource = function(V4, prefix, argument, flags2) {
      if (types13.isArrayBuffer(V4)) {
        return webidl.converters.ArrayBuffer(V4, prefix, argument, flags2);
      }
      if (types13.isArrayBufferView(V4)) {
        flags2 &= ~webidl.attributes.AllowShared;
        return webidl.converters.ArrayBufferView(V4, prefix, argument, flags2);
      }
      if (types13.isSharedArrayBuffer(V4)) {
        throw webidl.errors.exception({
          header: prefix,
          message: `${argument} cannot be a SharedArrayBuffer.`
        });
      }
      throw webidl.errors.conversionFailed({
        prefix,
        argument: `${argument} ("${webidl.util.Stringify(V4)}")`,
        types: ["ArrayBuffer", "ArrayBufferView"]
      });
    };
    webidl.converters.AllowSharedBufferSource = function(V4, prefix, argument, flags2) {
      if (types13.isArrayBuffer(V4)) {
        return webidl.converters.ArrayBuffer(V4, prefix, argument, flags2);
      }
      if (types13.isSharedArrayBuffer(V4)) {
        return webidl.converters.SharedArrayBuffer(V4, prefix, argument, flags2);
      }
      if (types13.isArrayBufferView(V4)) {
        flags2 |= webidl.attributes.AllowShared;
        return webidl.converters.ArrayBufferView(V4, prefix, argument, flags2);
      }
      throw webidl.errors.conversionFailed({
        prefix,
        argument: `${argument} ("${webidl.util.Stringify(V4)}")`,
        types: ["ArrayBuffer", "SharedArrayBuffer", "ArrayBufferView"]
      });
    };
    webidl.converters["sequence<ByteString>"] = webidl.sequenceConverter(
      webidl.converters.ByteString
    );
    webidl.converters["sequence<sequence<ByteString>>"] = webidl.sequenceConverter(
      webidl.converters["sequence<ByteString>"]
    );
    webidl.converters["record<ByteString, ByteString>"] = webidl.recordConverter(
      webidl.converters.ByteString,
      webidl.converters.ByteString
    );
    webidl.converters.Blob = webidl.interfaceConverter(webidl.is.Blob, "Blob");
    webidl.converters.AbortSignal = webidl.interfaceConverter(
      webidl.is.AbortSignal,
      "AbortSignal"
    );
    webidl.converters.EventHandlerNonNull = function(V4) {
      if (webidl.util.Type(V4) !== OBJECT) {
        return null;
      }
      if (typeof V4 === "function") {
        return V4;
      }
      return () => {
      };
    };
    webidl.attributes = {
      Clamp: 1 << 0,
      EnforceRange: 1 << 1,
      AllowShared: 1 << 2,
      AllowResizable: 1 << 3,
      LegacyNullToEmptyString: 1 << 4
    };
    module2.exports = {
      webidl
    };
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/web/fetch/util.js
var require_util2 = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/web/fetch/util.js"(exports, module2) {
    init_import_meta_url();
    var { Transform: Transform2 } = __require("stream");
    var zlib3 = __require("zlib");
    var { redirectStatusSet, referrerPolicyTokens, badPortsSet } = require_constants3();
    var { getGlobalOrigin } = require_global();
    var { collectAnHTTPQuotedString, parseMIMEType } = require_data_url();
    var { performance: performance2 } = __require("perf_hooks");
    var { ReadableStreamFrom, isValidHTTPToken, normalizedMethodRecordsBase } = require_util();
    var assert61 = __require("assert");
    var { isUint8Array } = __require("util/types");
    var { webidl } = require_webidl();
    var { isomorphicEncode, collectASequenceOfCodePoints, removeChars } = require_infra();
    function responseURL(response) {
      const urlList = response.urlList;
      const length = urlList.length;
      return length === 0 ? null : urlList[length - 1].toString();
    }
    __name(responseURL, "responseURL");
    function responseLocationURL(response, requestFragment) {
      if (!redirectStatusSet.has(response.status)) {
        return null;
      }
      let location = response.headersList.get("location", true);
      if (location !== null && isValidHeaderValue(location)) {
        if (!isValidEncodedURL(location)) {
          location = normalizeBinaryStringToUtf8(location);
        }
        location = new URL(location, responseURL(response));
      }
      if (location && !location.hash) {
        location.hash = requestFragment;
      }
      return location;
    }
    __name(responseLocationURL, "responseLocationURL");
    function isValidEncodedURL(url4) {
      for (let i7 = 0; i7 < url4.length; ++i7) {
        const code = url4.charCodeAt(i7);
        if (code > 126 || // Non-US-ASCII + DEL
        code < 32) {
          return false;
        }
      }
      return true;
    }
    __name(isValidEncodedURL, "isValidEncodedURL");
    function normalizeBinaryStringToUtf8(value) {
      return Buffer.from(value, "binary").toString("utf8");
    }
    __name(normalizeBinaryStringToUtf8, "normalizeBinaryStringToUtf8");
    function requestCurrentURL(request4) {
      return request4.urlList[request4.urlList.length - 1];
    }
    __name(requestCurrentURL, "requestCurrentURL");
    function requestBadPort(request4) {
      const url4 = requestCurrentURL(request4);
      if (urlIsHttpHttpsScheme(url4) && badPortsSet.has(url4.port)) {
        return "blocked";
      }
      return "allowed";
    }
    __name(requestBadPort, "requestBadPort");
    function isErrorLike(object) {
      return object instanceof Error || (object?.constructor?.name === "Error" || object?.constructor?.name === "DOMException");
    }
    __name(isErrorLike, "isErrorLike");
    function isValidReasonPhrase(statusText) {
      for (let i7 = 0; i7 < statusText.length; ++i7) {
        const c8 = statusText.charCodeAt(i7);
        if (!(c8 === 9 || // HTAB
        c8 >= 32 && c8 <= 126 || // SP / VCHAR
        c8 >= 128 && c8 <= 255)) {
          return false;
        }
      }
      return true;
    }
    __name(isValidReasonPhrase, "isValidReasonPhrase");
    var isValidHeaderName = isValidHTTPToken;
    function isValidHeaderValue(potentialValue) {
      return (potentialValue[0] === "	" || potentialValue[0] === " " || potentialValue[potentialValue.length - 1] === "	" || potentialValue[potentialValue.length - 1] === " " || potentialValue.includes("\n") || potentialValue.includes("\r") || potentialValue.includes("\0")) === false;
    }
    __name(isValidHeaderValue, "isValidHeaderValue");
    function parseReferrerPolicy(actualResponse) {
      const policyHeader = (actualResponse.headersList.get("referrer-policy", true) ?? "").split(",");
      let policy = "";
      if (policyHeader.length) {
        for (let i7 = policyHeader.length; i7 !== 0; i7--) {
          const token = policyHeader[i7 - 1].trim();
          if (referrerPolicyTokens.has(token)) {
            policy = token;
            break;
          }
        }
      }
      return policy;
    }
    __name(parseReferrerPolicy, "parseReferrerPolicy");
    function setRequestReferrerPolicyOnRedirect(request4, actualResponse) {
      const policy = parseReferrerPolicy(actualResponse);
      if (policy !== "") {
        request4.referrerPolicy = policy;
      }
    }
    __name(setRequestReferrerPolicyOnRedirect, "setRequestReferrerPolicyOnRedirect");
    function crossOriginResourcePolicyCheck() {
      return "allowed";
    }
    __name(crossOriginResourcePolicyCheck, "crossOriginResourcePolicyCheck");
    function corsCheck() {
      return "success";
    }
    __name(corsCheck, "corsCheck");
    function TAOCheck() {
      return "success";
    }
    __name(TAOCheck, "TAOCheck");
    function appendFetchMetadata(httpRequest2) {
      let header = null;
      header = httpRequest2.mode;
      httpRequest2.headersList.set("sec-fetch-mode", header, true);
    }
    __name(appendFetchMetadata, "appendFetchMetadata");
    function appendRequestOriginHeader(request4) {
      let serializedOrigin = request4.origin;
      if (serializedOrigin === "client" || serializedOrigin === void 0) {
        return;
      }
      if (request4.responseTainting === "cors" || request4.mode === "websocket") {
        request4.headersList.append("origin", serializedOrigin, true);
      } else if (request4.method !== "GET" && request4.method !== "HEAD") {
        switch (request4.referrerPolicy) {
          case "no-referrer":
            serializedOrigin = null;
            break;
          case "no-referrer-when-downgrade":
          case "strict-origin":
          case "strict-origin-when-cross-origin":
            if (request4.origin && urlHasHttpsScheme(request4.origin) && !urlHasHttpsScheme(requestCurrentURL(request4))) {
              serializedOrigin = null;
            }
            break;
          case "same-origin":
            if (!sameOrigin(request4, requestCurrentURL(request4))) {
              serializedOrigin = null;
            }
            break;
        }
        request4.headersList.append("origin", serializedOrigin, true);
      }
    }
    __name(appendRequestOriginHeader, "appendRequestOriginHeader");
    function coarsenTime(timestamp, crossOriginIsolatedCapability) {
      return timestamp;
    }
    __name(coarsenTime, "coarsenTime");
    function clampAndCoarsenConnectionTimingInfo(connectionTimingInfo, defaultStartTime, crossOriginIsolatedCapability) {
      if (!connectionTimingInfo?.startTime || connectionTimingInfo.startTime < defaultStartTime) {
        return {
          domainLookupStartTime: defaultStartTime,
          domainLookupEndTime: defaultStartTime,
          connectionStartTime: defaultStartTime,
          connectionEndTime: defaultStartTime,
          secureConnectionStartTime: defaultStartTime,
          ALPNNegotiatedProtocol: connectionTimingInfo?.ALPNNegotiatedProtocol
        };
      }
      return {
        domainLookupStartTime: coarsenTime(connectionTimingInfo.domainLookupStartTime),
        domainLookupEndTime: coarsenTime(connectionTimingInfo.domainLookupEndTime),
        connectionStartTime: coarsenTime(connectionTimingInfo.connectionStartTime),
        connectionEndTime: coarsenTime(connectionTimingInfo.connectionEndTime),
        secureConnectionStartTime: coarsenTime(connectionTimingInfo.secureConnectionStartTime),
        ALPNNegotiatedProtocol: connectionTimingInfo.ALPNNegotiatedProtocol
      };
    }
    __name(clampAndCoarsenConnectionTimingInfo, "clampAndCoarsenConnectionTimingInfo");
    function coarsenedSharedCurrentTime(crossOriginIsolatedCapability) {
      return coarsenTime(performance2.now());
    }
    __name(coarsenedSharedCurrentTime, "coarsenedSharedCurrentTime");
    function createOpaqueTimingInfo(timingInfo) {
      return {
        startTime: timingInfo.startTime ?? 0,
        redirectStartTime: 0,
        redirectEndTime: 0,
        postRedirectStartTime: timingInfo.startTime ?? 0,
        finalServiceWorkerStartTime: 0,
        finalNetworkResponseStartTime: 0,
        finalNetworkRequestStartTime: 0,
        endTime: 0,
        encodedBodySize: 0,
        decodedBodySize: 0,
        finalConnectionTimingInfo: null
      };
    }
    __name(createOpaqueTimingInfo, "createOpaqueTimingInfo");
    function makePolicyContainer() {
      return {
        referrerPolicy: "strict-origin-when-cross-origin"
      };
    }
    __name(makePolicyContainer, "makePolicyContainer");
    function clonePolicyContainer(policyContainer) {
      return {
        referrerPolicy: policyContainer.referrerPolicy
      };
    }
    __name(clonePolicyContainer, "clonePolicyContainer");
    function determineRequestsReferrer(request4) {
      const policy = request4.referrerPolicy;
      assert61(policy);
      let referrerSource = null;
      if (request4.referrer === "client") {
        const globalOrigin = getGlobalOrigin();
        if (!globalOrigin || globalOrigin.origin === "null") {
          return "no-referrer";
        }
        referrerSource = new URL(globalOrigin);
      } else if (webidl.is.URL(request4.referrer)) {
        referrerSource = request4.referrer;
      }
      let referrerURL = stripURLForReferrer(referrerSource);
      const referrerOrigin = stripURLForReferrer(referrerSource, true);
      if (referrerURL.toString().length > 4096) {
        referrerURL = referrerOrigin;
      }
      switch (policy) {
        case "no-referrer":
          return "no-referrer";
        case "origin":
          if (referrerOrigin != null) {
            return referrerOrigin;
          }
          return stripURLForReferrer(referrerSource, true);
        case "unsafe-url":
          return referrerURL;
        case "strict-origin": {
          const currentURL = requestCurrentURL(request4);
          if (isURLPotentiallyTrustworthy(referrerURL) && !isURLPotentiallyTrustworthy(currentURL)) {
            return "no-referrer";
          }
          return referrerOrigin;
        }
        case "strict-origin-when-cross-origin": {
          const currentURL = requestCurrentURL(request4);
          if (sameOrigin(referrerURL, currentURL)) {
            return referrerURL;
          }
          if (isURLPotentiallyTrustworthy(referrerURL) && !isURLPotentiallyTrustworthy(currentURL)) {
            return "no-referrer";
          }
          return referrerOrigin;
        }
        case "same-origin":
          if (sameOrigin(request4, referrerURL)) {
            return referrerURL;
          }
          return "no-referrer";
        case "origin-when-cross-origin":
          if (sameOrigin(request4, referrerURL)) {
            return referrerURL;
          }
          return referrerOrigin;
        case "no-referrer-when-downgrade": {
          const currentURL = requestCurrentURL(request4);
          if (isURLPotentiallyTrustworthy(referrerURL) && !isURLPotentiallyTrustworthy(currentURL)) {
            return "no-referrer";
          }
          return referrerURL;
        }
      }
    }
    __name(determineRequestsReferrer, "determineRequestsReferrer");
    function stripURLForReferrer(url4, originOnly = false) {
      assert61(webidl.is.URL(url4));
      url4 = new URL(url4);
      if (urlIsLocal(url4)) {
        return "no-referrer";
      }
      url4.username = "";
      url4.password = "";
      url4.hash = "";
      if (originOnly === true) {
        url4.pathname = "";
        url4.search = "";
      }
      return url4;
    }
    __name(stripURLForReferrer, "stripURLForReferrer");
    var isPotentialleTrustworthyIPv4 = RegExp.prototype.test.bind(/^127\.(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)\.){2}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)$/);
    var isPotentiallyTrustworthyIPv6 = RegExp.prototype.test.bind(/^(?:(?:0{1,4}:){7}|(?:0{1,4}:){1,6}:|::)0{0,3}1$/);
    function isOriginIPPotentiallyTrustworthy(origin) {
      if (origin.includes(":")) {
        if (origin[0] === "[" && origin[origin.length - 1] === "]") {
          origin = origin.slice(1, -1);
        }
        return isPotentiallyTrustworthyIPv6(origin);
      }
      return isPotentialleTrustworthyIPv4(origin);
    }
    __name(isOriginIPPotentiallyTrustworthy, "isOriginIPPotentiallyTrustworthy");
    function isOriginPotentiallyTrustworthy(origin) {
      if (origin == null || origin === "null") {
        return false;
      }
      origin = new URL(origin);
      if (origin.protocol === "https:" || origin.protocol === "wss:") {
        return true;
      }
      if (isOriginIPPotentiallyTrustworthy(origin.hostname)) {
        return true;
      }
      if (origin.hostname === "localhost" || origin.hostname === "localhost.") {
        return true;
      }
      if (origin.hostname.endsWith(".localhost") || origin.hostname.endsWith(".localhost.")) {
        return true;
      }
      if (origin.protocol === "file:") {
        return true;
      }
      return false;
    }
    __name(isOriginPotentiallyTrustworthy, "isOriginPotentiallyTrustworthy");
    function isURLPotentiallyTrustworthy(url4) {
      if (!webidl.is.URL(url4)) {
        return false;
      }
      if (url4.href === "about:blank" || url4.href === "about:srcdoc") {
        return true;
      }
      if (url4.protocol === "data:") return true;
      if (url4.protocol === "blob:") return true;
      return isOriginPotentiallyTrustworthy(url4.origin);
    }
    __name(isURLPotentiallyTrustworthy, "isURLPotentiallyTrustworthy");
    function tryUpgradeRequestToAPotentiallyTrustworthyURL(request4) {
    }
    __name(tryUpgradeRequestToAPotentiallyTrustworthyURL, "tryUpgradeRequestToAPotentiallyTrustworthyURL");
    function sameOrigin(A4, B4) {
      if (A4.origin === B4.origin && A4.origin === "null") {
        return true;
      }
      if (A4.protocol === B4.protocol && A4.hostname === B4.hostname && A4.port === B4.port) {
        return true;
      }
      return false;
    }
    __name(sameOrigin, "sameOrigin");
    function isAborted4(fetchParams) {
      return fetchParams.controller.state === "aborted";
    }
    __name(isAborted4, "isAborted");
    function isCancelled(fetchParams) {
      return fetchParams.controller.state === "aborted" || fetchParams.controller.state === "terminated";
    }
    __name(isCancelled, "isCancelled");
    function normalizeMethod(method) {
      return normalizedMethodRecordsBase[method.toLowerCase()] ?? method;
    }
    __name(normalizeMethod, "normalizeMethod");
    var esIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()));
    function createIterator(name2, kInternalIterator, keyIndex = 0, valueIndex = 1) {
      class FastIterableIterator {
        static {
          __name(this, "FastIterableIterator");
        }
        /** @type {any} */
        #target;
        /** @type {'key' | 'value' | 'key+value'} */
        #kind;
        /** @type {number} */
        #index;
        /**
         * @see https://webidl.spec.whatwg.org/#dfn-default-iterator-object
         * @param {unknown} target
         * @param {'key' | 'value' | 'key+value'} kind
         */
        constructor(target, kind2) {
          this.#target = target;
          this.#kind = kind2;
          this.#index = 0;
        }
        next() {
          if (typeof this !== "object" || this === null || !(#target in this)) {
            throw new TypeError(
              `'next' called on an object that does not implement interface ${name2} Iterator.`
            );
          }
          const index = this.#index;
          const values = kInternalIterator(this.#target);
          const len = values.length;
          if (index >= len) {
            return {
              value: void 0,
              done: true
            };
          }
          const { [keyIndex]: key, [valueIndex]: value } = values[index];
          this.#index = index + 1;
          let result;
          switch (this.#kind) {
            case "key":
              result = key;
              break;
            case "value":
              result = value;
              break;
            case "key+value":
              result = [key, value];
              break;
          }
          return {
            value: result,
            done: false
          };
        }
      }
      delete FastIterableIterator.prototype.constructor;
      Object.setPrototypeOf(FastIterableIterator.prototype, esIteratorPrototype);
      Object.defineProperties(FastIterableIterator.prototype, {
        [Symbol.toStringTag]: {
          writable: false,
          enumerable: false,
          configurable: true,
          value: `${name2} Iterator`
        },
        next: { writable: true, enumerable: true, configurable: true }
      });
      return function(target, kind2) {
        return new FastIterableIterator(target, kind2);
      };
    }
    __name(createIterator, "createIterator");
    function iteratorMixin(name2, object, kInternalIterator, keyIndex = 0, valueIndex = 1) {
      const makeIterator = createIterator(name2, kInternalIterator, keyIndex, valueIndex);
      const properties = {
        keys: {
          writable: true,
          enumerable: true,
          configurable: true,
          value: /* @__PURE__ */ __name(function keys() {
            webidl.brandCheck(this, object);
            return makeIterator(this, "key");
          }, "keys")
        },
        values: {
          writable: true,
          enumerable: true,
          configurable: true,
          value: /* @__PURE__ */ __name(function values() {
            webidl.brandCheck(this, object);
            return makeIterator(this, "value");
          }, "values")
        },
        entries: {
          writable: true,
          enumerable: true,
          configurable: true,
          value: /* @__PURE__ */ __name(function entries2() {
            webidl.brandCheck(this, object);
            return makeIterator(this, "key+value");
          }, "entries")
        },
        forEach: {
          writable: true,
          enumerable: true,
          configurable: true,
          value: /* @__PURE__ */ __name(function forEach(callbackfn, thisArg = globalThis) {
            webidl.brandCheck(this, object);
            webidl.argumentLengthCheck(arguments, 1, `${name2}.forEach`);
            if (typeof callbackfn !== "function") {
              throw new TypeError(
                `Failed to execute 'forEach' on '${name2}': parameter 1 is not of type 'Function'.`
              );
            }
            for (const { 0: key, 1: value } of makeIterator(this, "key+value")) {
              callbackfn.call(thisArg, value, key, this);
            }
          }, "forEach")
        }
      };
      return Object.defineProperties(object.prototype, {
        ...properties,
        [Symbol.iterator]: {
          writable: true,
          enumerable: false,
          configurable: true,
          value: properties.entries.value
        }
      });
    }
    __name(iteratorMixin, "iteratorMixin");
    function fullyReadBody(body, processBody, processBodyError) {
      const successSteps = processBody;
      const errorSteps = processBodyError;
      try {
        const reader = body.stream.getReader();
        readAllBytes(reader, successSteps, errorSteps);
      } catch (e10) {
        errorSteps(e10);
      }
    }
    __name(fullyReadBody, "fullyReadBody");
    function readableStreamClose(controller) {
      try {
        controller.close();
        controller.byobRequest?.respond(0);
      } catch (err) {
        if (!err.message.includes("Controller is already closed") && !err.message.includes("ReadableStream is already closed")) {
          throw err;
        }
      }
    }
    __name(readableStreamClose, "readableStreamClose");
    async function readAllBytes(reader, successSteps, failureSteps) {
      try {
        const bytes = [];
        let byteLength = 0;
        do {
          const { done, value: chunk } = await reader.read();
          if (done) {
            successSteps(Buffer.concat(bytes, byteLength));
            return;
          }
          if (!isUint8Array(chunk)) {
            failureSteps(new TypeError("Received non-Uint8Array chunk"));
            return;
          }
          bytes.push(chunk);
          byteLength += chunk.length;
        } while (true);
      } catch (e10) {
        failureSteps(e10);
      }
    }
    __name(readAllBytes, "readAllBytes");
    function urlIsLocal(url4) {
      assert61("protocol" in url4);
      const protocol = url4.protocol;
      return protocol === "about:" || protocol === "blob:" || protocol === "data:";
    }
    __name(urlIsLocal, "urlIsLocal");
    function urlHasHttpsScheme(url4) {
      return typeof url4 === "string" && url4[5] === ":" && url4[0] === "h" && url4[1] === "t" && url4[2] === "t" && url4[3] === "p" && url4[4] === "s" || url4.protocol === "https:";
    }
    __name(urlHasHttpsScheme, "urlHasHttpsScheme");
    function urlIsHttpHttpsScheme(url4) {
      assert61("protocol" in url4);
      const protocol = url4.protocol;
      return protocol === "http:" || protocol === "https:";
    }
    __name(urlIsHttpHttpsScheme, "urlIsHttpHttpsScheme");
    function simpleRangeHeaderValue(value, allowWhitespace) {
      const data = value;
      if (!data.startsWith("bytes")) {
        return "failure";
      }
      const position = { position: 5 };
      if (allowWhitespace) {
        collectASequenceOfCodePoints(
          (char) => char === "	" || char === " ",
          data,
          position
        );
      }
      if (data.charCodeAt(position.position) !== 61) {
        return "failure";
      }
      position.position++;
      if (allowWhitespace) {
        collectASequenceOfCodePoints(
          (char) => char === "	" || char === " ",
          data,
          position
        );
      }
      const rangeStart = collectASequenceOfCodePoints(
        (char) => {
          const code = char.charCodeAt(0);
          return code >= 48 && code <= 57;
        },
        data,
        position
      );
      const rangeStartValue = rangeStart.length ? Number(rangeStart) : null;
      if (allowWhitespace) {
        collectASequenceOfCodePoints(
          (char) => char === "	" || char === " ",
          data,
          position
        );
      }
      if (data.charCodeAt(position.position) !== 45) {
        return "failure";
      }
      position.position++;
      if (allowWhitespace) {
        collectASequenceOfCodePoints(
          (char) => char === "	" || char === " ",
          data,
          position
        );
      }
      const rangeEnd = collectASequenceOfCodePoints(
        (char) => {
          const code = char.charCodeAt(0);
          return code >= 48 && code <= 57;
        },
        data,
        position
      );
      const rangeEndValue = rangeEnd.length ? Number(rangeEnd) : null;
      if (position.position < data.length) {
        return "failure";
      }
      if (rangeEndValue === null && rangeStartValue === null) {
        return "failure";
      }
      if (rangeStartValue > rangeEndValue) {
        return "failure";
      }
      return { rangeStartValue, rangeEndValue };
    }
    __name(simpleRangeHeaderValue, "simpleRangeHeaderValue");
    function buildContentRange(rangeStart, rangeEnd, fullLength) {
      let contentRange = "bytes ";
      contentRange += isomorphicEncode(`${rangeStart}`);
      contentRange += "-";
      contentRange += isomorphicEncode(`${rangeEnd}`);
      contentRange += "/";
      contentRange += isomorphicEncode(`${fullLength}`);
      return contentRange;
    }
    __name(buildContentRange, "buildContentRange");
    var InflateStream = class extends Transform2 {
      static {
        __name(this, "InflateStream");
      }
      #zlibOptions;
      /** @param {zlib.ZlibOptions} [zlibOptions] */
      constructor(zlibOptions) {
        super();
        this.#zlibOptions = zlibOptions;
      }
      _transform(chunk, encoding, callback) {
        if (!this._inflateStream) {
          if (chunk.length === 0) {
            callback();
            return;
          }
          this._inflateStream = (chunk[0] & 15) === 8 ? zlib3.createInflate(this.#zlibOptions) : zlib3.createInflateRaw(this.#zlibOptions);
          this._inflateStream.on("data", this.push.bind(this));
          this._inflateStream.on("end", () => this.push(null));
          this._inflateStream.on("error", (err) => this.destroy(err));
        }
        this._inflateStream.write(chunk, encoding, callback);
      }
      _final(callback) {
        if (this._inflateStream) {
          this._inflateStream.end();
          this._inflateStream = null;
        }
        callback();
      }
    };
    function createInflate(zlibOptions) {
      return new InflateStream(zlibOptions);
    }
    __name(createInflate, "createInflate");
    function extractMimeType(headers) {
      let charset = null;
      let essence = null;
      let mimeType = null;
      const values = getDecodeSplit("content-type", headers);
      if (values === null) {
        return "failure";
      }
      for (const value of values) {
        const temporaryMimeType = parseMIMEType(value);
        if (temporaryMimeType === "failure" || temporaryMimeType.essence === "*/*") {
          continue;
        }
        mimeType = temporaryMimeType;
        if (mimeType.essence !== essence) {
          charset = null;
          if (mimeType.parameters.has("charset")) {
            charset = mimeType.parameters.get("charset");
          }
          essence = mimeType.essence;
        } else if (!mimeType.parameters.has("charset") && charset !== null) {
          mimeType.parameters.set("charset", charset);
        }
      }
      if (mimeType == null) {
        return "failure";
      }
      return mimeType;
    }
    __name(extractMimeType, "extractMimeType");
    function gettingDecodingSplitting(value) {
      const input = value;
      const position = { position: 0 };
      const values = [];
      let temporaryValue = "";
      while (position.position < input.length) {
        temporaryValue += collectASequenceOfCodePoints(
          (char) => char !== '"' && char !== ",",
          input,
          position
        );
        if (position.position < input.length) {
          if (input.charCodeAt(position.position) === 34) {
            temporaryValue += collectAnHTTPQuotedString(
              input,
              position
            );
            if (position.position < input.length) {
              continue;
            }
          } else {
            assert61(input.charCodeAt(position.position) === 44);
            position.position++;
          }
        }
        temporaryValue = removeChars(temporaryValue, true, true, (char) => char === 9 || char === 32);
        values.push(temporaryValue);
        temporaryValue = "";
      }
      return values;
    }
    __name(gettingDecodingSplitting, "gettingDecodingSplitting");
    function getDecodeSplit(name2, list) {
      const value = list.get(name2, true);
      if (value === null) {
        return null;
      }
      return gettingDecodingSplitting(value);
    }
    __name(getDecodeSplit, "getDecodeSplit");
    function hasAuthenticationEntry(request4) {
      return false;
    }
    __name(hasAuthenticationEntry, "hasAuthenticationEntry");
    function includesCredentials(url4) {
      return !!(url4.username || url4.password);
    }
    __name(includesCredentials, "includesCredentials");
    function isTraversableNavigable(navigable) {
      return false;
    }
    __name(isTraversableNavigable, "isTraversableNavigable");
    var EnvironmentSettingsObjectBase = class {
      static {
        __name(this, "EnvironmentSettingsObjectBase");
      }
      get baseUrl() {
        return getGlobalOrigin();
      }
      get origin() {
        return this.baseUrl?.origin;
      }
      policyContainer = makePolicyContainer();
    };
    var EnvironmentSettingsObject = class {
      static {
        __name(this, "EnvironmentSettingsObject");
      }
      settingsObject = new EnvironmentSettingsObjectBase();
    };
    var environmentSettingsObject = new EnvironmentSettingsObject();
    module2.exports = {
      isAborted: isAborted4,
      isCancelled,
      isValidEncodedURL,
      ReadableStreamFrom,
      tryUpgradeRequestToAPotentiallyTrustworthyURL,
      clampAndCoarsenConnectionTimingInfo,
      coarsenedSharedCurrentTime,
      determineRequestsReferrer,
      makePolicyContainer,
      clonePolicyContainer,
      appendFetchMetadata,
      appendRequestOriginHeader,
      TAOCheck,
      corsCheck,
      crossOriginResourcePolicyCheck,
      createOpaqueTimingInfo,
      setRequestReferrerPolicyOnRedirect,
      isValidHTTPToken,
      requestBadPort,
      requestCurrentURL,
      responseURL,
      responseLocationURL,
      isURLPotentiallyTrustworthy,
      isValidReasonPhrase,
      sameOrigin,
      normalizeMethod,
      iteratorMixin,
      createIterator,
      isValidHeaderName,
      isValidHeaderValue,
      isErrorLike,
      fullyReadBody,
      readableStreamClose,
      urlIsLocal,
      urlHasHttpsScheme,
      urlIsHttpHttpsScheme,
      readAllBytes,
      simpleRangeHeaderValue,
      buildContentRange,
      createInflate,
      extractMimeType,
      getDecodeSplit,
      environmentSettingsObject,
      isOriginIPPotentiallyTrustworthy,
      hasAuthenticationEntry,
      includesCredentials,
      isTraversableNavigable
    };
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/web/fetch/formdata.js
var require_formdata = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/web/fetch/formdata.js"(exports, module2) {
    init_import_meta_url();
    var { iteratorMixin } = require_util2();
    var { kEnumerableProperty } = require_util();
    var { webidl } = require_webidl();
    var nodeUtil = __require("util");
    var FormData13 = class _FormData {
      static {
        __name(this, "FormData");
      }
      #state = [];
      constructor(form = void 0) {
        webidl.util.markAsUncloneable(this);
        if (form !== void 0) {
          throw webidl.errors.conversionFailed({
            prefix: "FormData constructor",
            argument: "Argument 1",
            types: ["undefined"]
          });
        }
      }
      append(name2, value, filename = void 0) {
        webidl.brandCheck(this, _FormData);
        const prefix = "FormData.append";
        webidl.argumentLengthCheck(arguments, 2, prefix);
        name2 = webidl.converters.USVString(name2);
        if (arguments.length === 3 || webidl.is.Blob(value)) {
          value = webidl.converters.Blob(value, prefix, "value");
          if (filename !== void 0) {
            filename = webidl.converters.USVString(filename);
          }
        } else {
          value = webidl.converters.USVString(value);
        }
        const entry = makeEntry(name2, value, filename);
        this.#state.push(entry);
      }
      delete(name2) {
        webidl.brandCheck(this, _FormData);
        const prefix = "FormData.delete";
        webidl.argumentLengthCheck(arguments, 1, prefix);
        name2 = webidl.converters.USVString(name2);
        this.#state = this.#state.filter((entry) => entry.name !== name2);
      }
      get(name2) {
        webidl.brandCheck(this, _FormData);
        const prefix = "FormData.get";
        webidl.argumentLengthCheck(arguments, 1, prefix);
        name2 = webidl.converters.USVString(name2);
        const idx = this.#state.findIndex((entry) => entry.name === name2);
        if (idx === -1) {
          return null;
        }
        return this.#state[idx].value;
      }
      getAll(name2) {
        webidl.brandCheck(this, _FormData);
        const prefix = "FormData.getAll";
        webidl.argumentLengthCheck(arguments, 1, prefix);
        name2 = webidl.converters.USVString(name2);
        return this.#state.filter((entry) => entry.name === name2).map((entry) => entry.value);
      }
      has(name2) {
        webidl.brandCheck(this, _FormData);
        const prefix = "FormData.has";
        webidl.argumentLengthCheck(arguments, 1, prefix);
        name2 = webidl.converters.USVString(name2);
        return this.#state.findIndex((entry) => entry.name === name2) !== -1;
      }
      set(name2, value, filename = void 0) {
        webidl.brandCheck(this, _FormData);
        const prefix = "FormData.set";
        webidl.argumentLengthCheck(arguments, 2, prefix);
        name2 = webidl.converters.USVString(name2);
        if (arguments.length === 3 || webidl.is.Blob(value)) {
          value = webidl.converters.Blob(value, prefix, "value");
          if (filename !== void 0) {
            filename = webidl.converters.USVString(filename);
          }
        } else {
          value = webidl.converters.USVString(value);
        }
        const entry = makeEntry(name2, value, filename);
        const idx = this.#state.findIndex((entry2) => entry2.name === name2);
        if (idx !== -1) {
          this.#state = [
            ...this.#state.slice(0, idx),
            entry,
            ...this.#state.slice(idx + 1).filter((entry2) => entry2.name !== name2)
          ];
        } else {
          this.#state.push(entry);
        }
      }
      [nodeUtil.inspect.custom](depth, options) {
        const state2 = this.#state.reduce((a7, b11) => {
          if (a7[b11.name]) {
            if (Array.isArray(a7[b11.name])) {
              a7[b11.name].push(b11.value);
            } else {
              a7[b11.name] = [a7[b11.name], b11.value];
            }
          } else {
            a7[b11.name] = b11.value;
          }
          return a7;
        }, { __proto__: null });
        options.depth ??= depth;
        options.colors ??= true;
        const output = nodeUtil.formatWithOptions(options, state2);
        return `FormData ${output.slice(output.indexOf("]") + 2)}`;
      }
      /**
       * @param {FormData} formData
       */
      static getFormDataState(formData) {
        return formData.#state;
      }
      /**
       * @param {FormData} formData
       * @param {any[]} newState
       */
      static setFormDataState(formData, newState) {
        formData.#state = newState;
      }
    };
    var { getFormDataState, setFormDataState } = FormData13;
    Reflect.deleteProperty(FormData13, "getFormDataState");
    Reflect.deleteProperty(FormData13, "setFormDataState");
    iteratorMixin("FormData", FormData13, getFormDataState, "name", "value");
    Object.defineProperties(FormData13.prototype, {
      append: kEnumerableProperty,
      delete: kEnumerableProperty,
      get: kEnumerableProperty,
      getAll: kEnumerableProperty,
      has: kEnumerableProperty,
      set: kEnumerableProperty,
      [Symbol.toStringTag]: {
        value: "FormData",
        configurable: true
      }
    });
    function makeEntry(name2, value, filename) {
      if (typeof value === "string") ; else {
        if (!webidl.is.File(value)) {
          value = new File([value], "blob", { type: value.type });
        }
        if (filename !== void 0) {
          const options = {
            type: value.type,
            lastModified: value.lastModified
          };
          value = new File([value], filename, options);
        }
      }
      return { name: name2, value };
    }
    __name(makeEntry, "makeEntry");
    webidl.is.FormData = webidl.util.MakeTypeAssertion(FormData13);
    module2.exports = { FormData: FormData13, makeEntry, setFormDataState };
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/web/fetch/formdata-parser.js
var require_formdata_parser = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/web/fetch/formdata-parser.js"(exports, module2) {
    init_import_meta_url();
    var { bufferToLowerCasedHeaderName } = require_util();
    var { HTTP_TOKEN_CODEPOINTS } = require_data_url();
    var { makeEntry } = require_formdata();
    var { webidl } = require_webidl();
    var assert61 = __require("assert");
    var { isomorphicDecode } = require_infra();
    var { utf8DecodeBytes } = require_encoding();
    var dd = Buffer.from("--");
    var decoder = new TextDecoder();
    function isAsciiString(chars) {
      for (let i7 = 0; i7 < chars.length; ++i7) {
        if ((chars.charCodeAt(i7) & -128) !== 0) {
          return false;
        }
      }
      return true;
    }
    __name(isAsciiString, "isAsciiString");
    function validateBoundary(boundary) {
      const length = boundary.length;
      if (length < 27 || length > 70) {
        return false;
      }
      for (let i7 = 0; i7 < length; ++i7) {
        const cp3 = boundary.charCodeAt(i7);
        if (!(cp3 >= 48 && cp3 <= 57 || cp3 >= 65 && cp3 <= 90 || cp3 >= 97 && cp3 <= 122 || cp3 === 39 || cp3 === 45 || cp3 === 95)) {
          return false;
        }
      }
      return true;
    }
    __name(validateBoundary, "validateBoundary");
    function multipartFormDataParser(input, mimeType) {
      assert61(mimeType !== "failure" && mimeType.essence === "multipart/form-data");
      const boundaryString = mimeType.parameters.get("boundary");
      if (boundaryString === void 0) {
        throw parsingError("missing boundary in content-type header");
      }
      const boundary = Buffer.from(`--${boundaryString}`, "utf8");
      const entryList = [];
      const position = { position: 0 };
      const firstBoundaryIndex = input.indexOf(boundary);
      if (firstBoundaryIndex === -1) {
        throw parsingError("no boundary found in multipart body");
      }
      position.position = firstBoundaryIndex;
      while (true) {
        if (input.subarray(position.position, position.position + boundary.length).equals(boundary)) {
          position.position += boundary.length;
        } else {
          throw parsingError("expected a value starting with -- and the boundary");
        }
        if (bufferStartsWith(input, dd, position)) {
          return entryList;
        }
        if (input[position.position] !== 13 || input[position.position + 1] !== 10) {
          throw parsingError("expected CRLF");
        }
        position.position += 2;
        const result = parseMultipartFormDataHeaders(input, position);
        let { name: name2, filename, contentType, encoding } = result;
        position.position += 2;
        let body;
        {
          const boundaryIndex = input.indexOf(boundary.subarray(2), position.position);
          if (boundaryIndex === -1) {
            throw parsingError("expected boundary after body");
          }
          body = input.subarray(position.position, boundaryIndex - 4);
          position.position += body.length;
          if (encoding === "base64") {
            body = Buffer.from(body.toString(), "base64");
          }
        }
        if (input[position.position] !== 13 || input[position.position + 1] !== 10) {
          throw parsingError("expected CRLF");
        } else {
          position.position += 2;
        }
        let value;
        if (filename !== null) {
          contentType ??= "text/plain";
          if (!isAsciiString(contentType)) {
            contentType = "";
          }
          value = new File([body], filename, { type: contentType });
        } else {
          value = utf8DecodeBytes(Buffer.from(body));
        }
        assert61(webidl.is.USVString(name2));
        assert61(typeof value === "string" && webidl.is.USVString(value) || webidl.is.File(value));
        entryList.push(makeEntry(name2, value, filename));
      }
    }
    __name(multipartFormDataParser, "multipartFormDataParser");
    function parseContentDispositionAttribute(input, position) {
      if (input[position.position] === 59) {
        position.position++;
      }
      collectASequenceOfBytes(
        (char) => char === 32 || char === 9,
        input,
        position
      );
      const attributeName = collectASequenceOfBytes(
        (char) => isToken(char) && char !== 61 && char !== 42,
        // not = or *
        input,
        position
      );
      if (attributeName.length === 0) {
        return null;
      }
      const attrNameStr = attributeName.toString("ascii").toLowerCase();
      const isExtended = input[position.position] === 42;
      if (isExtended) {
        position.position++;
      }
      if (input[position.position] !== 61) {
        return null;
      }
      position.position++;
      collectASequenceOfBytes(
        (char) => char === 32 || char === 9,
        input,
        position
      );
      let value;
      if (isExtended) {
        const headerValue = collectASequenceOfBytes(
          (char) => char !== 32 && char !== 13 && char !== 10 && char !== 59,
          // not space, CRLF, or ;
          input,
          position
        );
        if (headerValue[0] !== 117 && headerValue[0] !== 85 || // u or U
        headerValue[1] !== 116 && headerValue[1] !== 84 || // t or T
        headerValue[2] !== 102 && headerValue[2] !== 70 || // f or F
        headerValue[3] !== 45 || // -
        headerValue[4] !== 56) {
          throw parsingError("unknown encoding, expected utf-8''");
        }
        value = decodeURIComponent(decoder.decode(headerValue.subarray(7)));
      } else if (input[position.position] === 34) {
        position.position++;
        const quotedValue = collectASequenceOfBytes(
          (char) => char !== 10 && char !== 13 && char !== 34,
          // not LF, CR, or "
          input,
          position
        );
        if (input[position.position] !== 34) {
          throw parsingError("Closing quote not found");
        }
        position.position++;
        value = decoder.decode(quotedValue).replace(/%0A/ig, "\n").replace(/%0D/ig, "\r").replace(/%22/g, '"');
      } else {
        const tokenValue = collectASequenceOfBytes(
          (char) => isToken(char) && char !== 59,
          // not ;
          input,
          position
        );
        value = decoder.decode(tokenValue);
      }
      return { name: attrNameStr, value };
    }
    __name(parseContentDispositionAttribute, "parseContentDispositionAttribute");
    function parseMultipartFormDataHeaders(input, position) {
      let name2 = null;
      let filename = null;
      let contentType = null;
      let encoding = null;
      while (true) {
        if (input[position.position] === 13 && input[position.position + 1] === 10) {
          if (name2 === null) {
            throw parsingError("header name is null");
          }
          return { name: name2, filename, contentType, encoding };
        }
        let headerName = collectASequenceOfBytes(
          (char) => char !== 10 && char !== 13 && char !== 58,
          input,
          position
        );
        headerName = removeChars(headerName, true, true, (char) => char === 9 || char === 32);
        if (!HTTP_TOKEN_CODEPOINTS.test(headerName.toString())) {
          throw parsingError("header name does not match the field-name token production");
        }
        if (input[position.position] !== 58) {
          throw parsingError("expected :");
        }
        position.position++;
        collectASequenceOfBytes(
          (char) => char === 32 || char === 9,
          input,
          position
        );
        switch (bufferToLowerCasedHeaderName(headerName)) {
          case "content-disposition": {
            name2 = filename = null;
            const dispositionType = collectASequenceOfBytes(
              (char) => isToken(char),
              input,
              position
            );
            if (dispositionType.toString("ascii").toLowerCase() !== "form-data") {
              throw parsingError("expected form-data for content-disposition header");
            }
            while (position.position < input.length && input[position.position] !== 13 && input[position.position + 1] !== 10) {
              const attribute = parseContentDispositionAttribute(input, position);
              if (!attribute) {
                break;
              }
              if (attribute.name === "name") {
                name2 = attribute.value;
              } else if (attribute.name === "filename") {
                filename = attribute.value;
              }
            }
            if (name2 === null) {
              throw parsingError("name attribute is required in content-disposition header");
            }
            break;
          }
          case "content-type": {
            let headerValue = collectASequenceOfBytes(
              (char) => char !== 10 && char !== 13,
              input,
              position
            );
            headerValue = removeChars(headerValue, false, true, (char) => char === 9 || char === 32);
            contentType = isomorphicDecode(headerValue);
            break;
          }
          case "content-transfer-encoding": {
            let headerValue = collectASequenceOfBytes(
              (char) => char !== 10 && char !== 13,
              input,
              position
            );
            headerValue = removeChars(headerValue, false, true, (char) => char === 9 || char === 32);
            encoding = isomorphicDecode(headerValue);
            break;
          }
          default: {
            collectASequenceOfBytes(
              (char) => char !== 10 && char !== 13,
              input,
              position
            );
          }
        }
        if (input[position.position] !== 13 && input[position.position + 1] !== 10) {
          throw parsingError("expected CRLF");
        } else {
          position.position += 2;
        }
      }
    }
    __name(parseMultipartFormDataHeaders, "parseMultipartFormDataHeaders");
    function collectASequenceOfBytes(condition, input, position) {
      let start = position.position;
      while (start < input.length && condition(input[start])) {
        ++start;
      }
      return input.subarray(position.position, position.position = start);
    }
    __name(collectASequenceOfBytes, "collectASequenceOfBytes");
    function removeChars(buf, leading, trailing, predicate) {
      let lead = 0;
      let trail = buf.length - 1;
      if (leading) {
        while (lead < buf.length && predicate(buf[lead])) lead++;
      }
      if (trailing) {
        while (trail > 0 && predicate(buf[trail])) trail--;
      }
      return lead === 0 && trail === buf.length - 1 ? buf : buf.subarray(lead, trail + 1);
    }
    __name(removeChars, "removeChars");
    function bufferStartsWith(buffer, start, position) {
      if (buffer.length < start.length) {
        return false;
      }
      for (let i7 = 0; i7 < start.length; i7++) {
        if (start[i7] !== buffer[position.position + i7]) {
          return false;
        }
      }
      return true;
    }
    __name(bufferStartsWith, "bufferStartsWith");
    function parsingError(cause) {
      return new TypeError("Failed to parse body as FormData.", { cause: new TypeError(cause) });
    }
    __name(parsingError, "parsingError");
    function isCTL(char) {
      return char <= 31 || char === 127;
    }
    __name(isCTL, "isCTL");
    function isTSpecial(char) {
      return char === 40 || // (
      char === 41 || // )
      char === 60 || // <
      char === 62 || // >
      char === 64 || // @
      char === 44 || // ,
      char === 59 || // ;
      char === 58 || // :
      char === 92 || // \
      char === 34 || // "
      char === 47 || // /
      char === 91 || // [
      char === 93 || // ]
      char === 63 || // ?
      char === 61;
    }
    __name(isTSpecial, "isTSpecial");
    function isToken(char) {
      return char <= 127 && // ascii
      char !== 32 && // space
      char !== 9 && !isCTL(char) && !isTSpecial(char);
    }
    __name(isToken, "isToken");
    module2.exports = {
      multipartFormDataParser,
      validateBoundary
    };
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/util/promise.js
var require_promise = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/util/promise.js"(exports, module2) {
    init_import_meta_url();
    function createDeferredPromise() {
      let res;
      let rej;
      const promise = new Promise((resolve32, reject) => {
        res = resolve32;
        rej = reject;
      });
      return { promise, resolve: res, reject: rej };
    }
    __name(createDeferredPromise, "createDeferredPromise");
    module2.exports = {
      createDeferredPromise
    };
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/web/fetch/body.js
var require_body = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/web/fetch/body.js"(exports, module2) {
    init_import_meta_url();
    var util5 = require_util();
    var {
      ReadableStreamFrom,
      readableStreamClose,
      fullyReadBody,
      extractMimeType
    } = require_util2();
    var { FormData: FormData13, setFormDataState } = require_formdata();
    var { webidl } = require_webidl();
    var assert61 = __require("assert");
    var { isErrored, isDisturbed } = __require("stream");
    var { isUint8Array } = __require("util/types");
    var { serializeAMimeType } = require_data_url();
    var { multipartFormDataParser } = require_formdata_parser();
    var { createDeferredPromise } = require_promise();
    var { parseJSONFromBytes } = require_infra();
    var { utf8DecodeBytes } = require_encoding();
    var { runtimeFeatures } = require_runtime_features();
    var random = runtimeFeatures.has("crypto") ? __require("crypto").randomInt : (max) => Math.floor(Math.random() * max);
    var textEncoder = new TextEncoder();
    function noop() {
    }
    __name(noop, "noop");
    var streamRegistry = new FinalizationRegistry((weakRef) => {
      const stream2 = weakRef.deref();
      if (stream2 && !stream2.locked && !isDisturbed(stream2) && !isErrored(stream2)) {
        stream2.cancel("Response object has been garbage collected").catch(noop);
      }
    });
    function extractBody(object, keepalive = false) {
      let stream2 = null;
      let controller = null;
      if (webidl.is.ReadableStream(object)) {
        stream2 = object;
      } else if (webidl.is.Blob(object)) {
        stream2 = object.stream();
      } else {
        stream2 = new ReadableStream({
          pull() {
          },
          start(c8) {
            controller = c8;
          },
          cancel() {
          },
          type: "bytes"
        });
      }
      assert61(webidl.is.ReadableStream(stream2));
      let action = null;
      let source = null;
      let length = null;
      let type = null;
      if (typeof object === "string") {
        source = object;
        type = "text/plain;charset=UTF-8";
      } else if (webidl.is.URLSearchParams(object)) {
        source = object.toString();
        type = "application/x-www-form-urlencoded;charset=UTF-8";
      } else if (webidl.is.BufferSource(object)) {
        source = webidl.util.getCopyOfBytesHeldByBufferSource(object);
      } else if (webidl.is.FormData(object)) {
        const boundary = `----formdata-undici-0${`${random(1e11)}`.padStart(11, "0")}`;
        const prefix = `--${boundary}\r
Content-Disposition: form-data`;
        const formdataEscape = /* @__PURE__ */ __name((str) => str.replace(/\n/g, "%0A").replace(/\r/g, "%0D").replace(/"/g, "%22"), "formdataEscape");
        const normalizeLinefeeds = /* @__PURE__ */ __name((value) => value.replace(/\r?\n|\r/g, "\r\n"), "normalizeLinefeeds");
        const blobParts = [];
        const rn = new Uint8Array([13, 10]);
        length = 0;
        let hasUnknownSizeValue = false;
        for (const [name2, value] of object) {
          if (typeof value === "string") {
            const chunk2 = textEncoder.encode(prefix + `; name="${formdataEscape(normalizeLinefeeds(name2))}"\r
\r
${normalizeLinefeeds(value)}\r
`);
            blobParts.push(chunk2);
            length += chunk2.byteLength;
          } else {
            const chunk2 = textEncoder.encode(`${prefix}; name="${formdataEscape(normalizeLinefeeds(name2))}"` + (value.name ? `; filename="${formdataEscape(value.name)}"` : "") + `\r
Content-Type: ${value.type || "application/octet-stream"}\r
\r
`);
            blobParts.push(chunk2, value, rn);
            if (typeof value.size === "number") {
              length += chunk2.byteLength + value.size + rn.byteLength;
            } else {
              hasUnknownSizeValue = true;
            }
          }
        }
        const chunk = textEncoder.encode(`--${boundary}--\r
`);
        blobParts.push(chunk);
        length += chunk.byteLength;
        if (hasUnknownSizeValue) {
          length = null;
        }
        source = object;
        action = /* @__PURE__ */ __name(async function* () {
          for (const part of blobParts) {
            if (part.stream) {
              yield* part.stream();
            } else {
              yield part;
            }
          }
        }, "action");
        type = `multipart/form-data; boundary=${boundary}`;
      } else if (webidl.is.Blob(object)) {
        source = object;
        length = object.size;
        if (object.type) {
          type = object.type;
        }
      } else if (typeof object[Symbol.asyncIterator] === "function") {
        if (keepalive) {
          throw new TypeError("keepalive");
        }
        if (util5.isDisturbed(object) || object.locked) {
          throw new TypeError(
            "Response body object should not be disturbed or locked"
          );
        }
        stream2 = webidl.is.ReadableStream(object) ? object : ReadableStreamFrom(object);
      }
      if (typeof source === "string" || isUint8Array(source)) {
        action = /* @__PURE__ */ __name(() => {
          length = typeof source === "string" ? Buffer.byteLength(source) : source.length;
          return source;
        }, "action");
      }
      if (action != null) {
        (async () => {
          const result = action();
          const iterator = result?.[Symbol.asyncIterator]?.();
          if (iterator) {
            for await (const bytes of iterator) {
              if (isErrored(stream2)) break;
              if (bytes.length) {
                controller.enqueue(new Uint8Array(bytes));
              }
            }
          } else if (result?.length && !isErrored(stream2)) {
            controller.enqueue(typeof result === "string" ? textEncoder.encode(result) : new Uint8Array(result));
          }
          queueMicrotask(() => readableStreamClose(controller));
        })();
      }
      const body = { stream: stream2, source, length };
      return [body, type];
    }
    __name(extractBody, "extractBody");
    function safelyExtractBody(object, keepalive = false) {
      if (webidl.is.ReadableStream(object)) {
        assert61(!util5.isDisturbed(object), "The body has already been consumed.");
        assert61(!object.locked, "The stream is locked.");
      }
      return extractBody(object, keepalive);
    }
    __name(safelyExtractBody, "safelyExtractBody");
    function cloneBody(body) {
      const { 0: out1, 1: out2 } = body.stream.tee();
      body.stream = out1;
      return {
        stream: out2,
        length: body.length,
        source: body.source
      };
    }
    __name(cloneBody, "cloneBody");
    function bodyMixinMethods(instance, getInternalState) {
      const methods = {
        blob() {
          return consumeBody2(this, (bytes) => {
            let mimeType = bodyMimeType(getInternalState(this));
            if (mimeType === null) {
              mimeType = "";
            } else if (mimeType) {
              mimeType = serializeAMimeType(mimeType);
            }
            return new Blob([bytes], { type: mimeType });
          }, instance, getInternalState);
        },
        arrayBuffer() {
          return consumeBody2(this, (bytes) => {
            return new Uint8Array(bytes).buffer;
          }, instance, getInternalState);
        },
        text() {
          return consumeBody2(this, utf8DecodeBytes, instance, getInternalState);
        },
        json() {
          return consumeBody2(this, parseJSONFromBytes, instance, getInternalState);
        },
        formData() {
          return consumeBody2(this, (value) => {
            const mimeType = bodyMimeType(getInternalState(this));
            if (mimeType !== null) {
              switch (mimeType.essence) {
                case "multipart/form-data": {
                  const parsed = multipartFormDataParser(value, mimeType);
                  const fd = new FormData13();
                  setFormDataState(fd, parsed);
                  return fd;
                }
                case "application/x-www-form-urlencoded": {
                  const entries2 = new URLSearchParams(value.toString());
                  const fd = new FormData13();
                  for (const [name2, value2] of entries2) {
                    fd.append(name2, value2);
                  }
                  return fd;
                }
              }
            }
            throw new TypeError(
              'Content-Type was not one of "multipart/form-data" or "application/x-www-form-urlencoded".'
            );
          }, instance, getInternalState);
        },
        bytes() {
          return consumeBody2(this, (bytes) => {
            return new Uint8Array(bytes);
          }, instance, getInternalState);
        }
      };
      return methods;
    }
    __name(bodyMixinMethods, "bodyMixinMethods");
    function mixinBody(prototype, getInternalState) {
      Object.assign(prototype.prototype, bodyMixinMethods(prototype, getInternalState));
    }
    __name(mixinBody, "mixinBody");
    function consumeBody2(object, convertBytesToJSValue, instance, getInternalState) {
      try {
        webidl.brandCheck(object, instance);
      } catch (e10) {
        return Promise.reject(e10);
      }
      object = getInternalState(object);
      if (bodyUnusable(object)) {
        return Promise.reject(new TypeError("Body is unusable: Body has already been read"));
      }
      const promise = createDeferredPromise();
      const errorSteps = promise.reject;
      const successSteps = /* @__PURE__ */ __name((data) => {
        try {
          promise.resolve(convertBytesToJSValue(data));
        } catch (e10) {
          errorSteps(e10);
        }
      }, "successSteps");
      if (object.body == null) {
        successSteps(Buffer.allocUnsafe(0));
        return promise.promise;
      }
      fullyReadBody(object.body, successSteps, errorSteps);
      return promise.promise;
    }
    __name(consumeBody2, "consumeBody");
    function bodyUnusable(object) {
      const body = object.body;
      return body != null && (body.stream.locked || util5.isDisturbed(body.stream));
    }
    __name(bodyUnusable, "bodyUnusable");
    function bodyMimeType(requestOrResponse) {
      const headers = requestOrResponse.headersList;
      const mimeType = extractMimeType(headers);
      if (mimeType === "failure") {
        return null;
      }
      return mimeType;
    }
    __name(bodyMimeType, "bodyMimeType");
    module2.exports = {
      extractBody,
      safelyExtractBody,
      cloneBody,
      mixinBody,
      streamRegistry,
      bodyUnusable
    };
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/dispatcher/client-h1.js
var require_client_h1 = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/dispatcher/client-h1.js"(exports, module2) {
    init_import_meta_url();
    var assert61 = __require("assert");
    var util5 = require_util();
    var { channels } = require_diagnostics();
    var timers = require_timers();
    var {
      RequestContentLengthMismatchError,
      ResponseContentLengthMismatchError,
      RequestAbortedError,
      HeadersTimeoutError,
      HeadersOverflowError,
      SocketError,
      InformationalError,
      BodyTimeoutError,
      HTTPParserError,
      ResponseExceededMaxSizeError
    } = require_errors();
    var {
      kUrl,
      kReset: kReset2,
      kClient,
      kParser,
      kBlocking,
      kRunning,
      kPending,
      kSize,
      kWriting,
      kQueue,
      kNoRef,
      kKeepAliveDefaultTimeout,
      kHostHeader,
      kPendingIdx,
      kRunningIdx,
      kError,
      kPipelining,
      kSocket,
      kKeepAliveTimeoutValue,
      kMaxHeadersSize,
      kKeepAliveMaxTimeout,
      kKeepAliveTimeoutThreshold,
      kHeadersTimeout,
      kBodyTimeout,
      kStrictContentLength,
      kMaxRequests,
      kCounter,
      kMaxResponseSize,
      kOnError,
      kResume,
      kHTTPContext,
      kClosed
    } = require_symbols();
    var constants5 = require_constants2();
    var EMPTY_BUF = Buffer.alloc(0);
    var FastBuffer = Buffer[Symbol.species];
    var removeAllListeners = util5.removeAllListeners;
    var extractBody;
    function lazyllhttp() {
      const llhttpWasmData = process.env.JEST_WORKER_ID ? require_llhttp_wasm() : void 0;
      let mod;
      let useWasmSIMD = process.arch !== "ppc64";
      if (process.env.UNDICI_NO_WASM_SIMD === "1") {
        useWasmSIMD = true;
      } else if (process.env.UNDICI_NO_WASM_SIMD === "0") {
        useWasmSIMD = false;
      }
      if (useWasmSIMD) {
        try {
          mod = new WebAssembly.Module(require_llhttp_simd_wasm());
        } catch {
        }
      }
      if (!mod) {
        mod = new WebAssembly.Module(llhttpWasmData || require_llhttp_wasm());
      }
      return new WebAssembly.Instance(mod, {
        env: {
          /**
           * @param {number} p
           * @param {number} at
           * @param {number} len
           * @returns {number}
           */
          wasm_on_url: /* @__PURE__ */ __name((p7, at3, len) => {
            return 0;
          }, "wasm_on_url"),
          /**
           * @param {number} p
           * @param {number} at
           * @param {number} len
           * @returns {number}
           */
          wasm_on_status: /* @__PURE__ */ __name((p7, at3, len) => {
            assert61(currentParser.ptr === p7);
            const start = at3 - currentBufferPtr + currentBufferRef.byteOffset;
            return currentParser.onStatus(new FastBuffer(currentBufferRef.buffer, start, len));
          }, "wasm_on_status"),
          /**
           * @param {number} p
           * @returns {number}
           */
          wasm_on_message_begin: /* @__PURE__ */ __name((p7) => {
            assert61(currentParser.ptr === p7);
            return currentParser.onMessageBegin();
          }, "wasm_on_message_begin"),
          /**
           * @param {number} p
           * @param {number} at
           * @param {number} len
           * @returns {number}
           */
          wasm_on_header_field: /* @__PURE__ */ __name((p7, at3, len) => {
            assert61(currentParser.ptr === p7);
            const start = at3 - currentBufferPtr + currentBufferRef.byteOffset;
            return currentParser.onHeaderField(new FastBuffer(currentBufferRef.buffer, start, len));
          }, "wasm_on_header_field"),
          /**
           * @param {number} p
           * @param {number} at
           * @param {number} len
           * @returns {number}
           */
          wasm_on_header_value: /* @__PURE__ */ __name((p7, at3, len) => {
            assert61(currentParser.ptr === p7);
            const start = at3 - currentBufferPtr + currentBufferRef.byteOffset;
            return currentParser.onHeaderValue(new FastBuffer(currentBufferRef.buffer, start, len));
          }, "wasm_on_header_value"),
          /**
           * @param {number} p
           * @param {number} statusCode
           * @param {0|1} upgrade
           * @param {0|1} shouldKeepAlive
           * @returns {number}
           */
          wasm_on_headers_complete: /* @__PURE__ */ __name((p7, statusCode, upgrade, shouldKeepAlive) => {
            assert61(currentParser.ptr === p7);
            return currentParser.onHeadersComplete(statusCode, upgrade === 1, shouldKeepAlive === 1);
          }, "wasm_on_headers_complete"),
          /**
           * @param {number} p
           * @param {number} at
           * @param {number} len
           * @returns {number}
           */
          wasm_on_body: /* @__PURE__ */ __name((p7, at3, len) => {
            assert61(currentParser.ptr === p7);
            const start = at3 - currentBufferPtr + currentBufferRef.byteOffset;
            return currentParser.onBody(new FastBuffer(currentBufferRef.buffer, start, len));
          }, "wasm_on_body"),
          /**
           * @param {number} p
           * @returns {number}
           */
          wasm_on_message_complete: /* @__PURE__ */ __name((p7) => {
            assert61(currentParser.ptr === p7);
            return currentParser.onMessageComplete();
          }, "wasm_on_message_complete")
        }
      });
    }
    __name(lazyllhttp, "lazyllhttp");
    var llhttpInstance = null;
    var currentParser = null;
    var currentBufferRef = null;
    var currentBufferSize = 0;
    var currentBufferPtr = null;
    var USE_NATIVE_TIMER = 0;
    var USE_FAST_TIMER = 1;
    var TIMEOUT_HEADERS = 2 | USE_FAST_TIMER;
    var TIMEOUT_BODY = 4 | USE_FAST_TIMER;
    var TIMEOUT_KEEP_ALIVE = 8 | USE_NATIVE_TIMER;
    var Parser2 = class {
      static {
        __name(this, "Parser");
      }
      /**
         * @param {import('./client.js')} client
         * @param {import('net').Socket} socket
         * @param {*} llhttp
         */
      constructor(client, socket, { exports: exports2 }) {
        this.llhttp = exports2;
        this.ptr = this.llhttp.llhttp_alloc(constants5.TYPE.RESPONSE);
        this.client = client;
        this.socket = socket;
        this.timeout = null;
        this.timeoutValue = null;
        this.timeoutType = null;
        this.statusCode = 0;
        this.statusText = "";
        this.upgrade = false;
        this.headers = [];
        this.headersSize = 0;
        this.headersMaxSize = client[kMaxHeadersSize];
        this.shouldKeepAlive = false;
        this.paused = false;
        this.resume = this.resume.bind(this);
        this.bytesRead = 0;
        this.keepAlive = "";
        this.contentLength = "";
        this.connection = "";
        this.maxResponseSize = client[kMaxResponseSize];
      }
      setTimeout(delay, type) {
        if (delay !== this.timeoutValue || type & USE_FAST_TIMER ^ this.timeoutType & USE_FAST_TIMER) {
          if (this.timeout) {
            timers.clearTimeout(this.timeout);
            this.timeout = null;
          }
          if (delay) {
            if (type & USE_FAST_TIMER) {
              this.timeout = timers.setFastTimeout(onParserTimeout, delay, new WeakRef(this));
            } else {
              this.timeout = setTimeout(onParserTimeout, delay, new WeakRef(this));
              this.timeout?.unref();
            }
          }
          this.timeoutValue = delay;
        } else if (this.timeout) {
          if (this.timeout.refresh) {
            this.timeout.refresh();
          }
        }
        this.timeoutType = type;
      }
      resume() {
        if (this.socket.destroyed || !this.paused) {
          return;
        }
        assert61(this.ptr != null);
        assert61(currentParser === null);
        this.llhttp.llhttp_resume(this.ptr);
        assert61(this.timeoutType === TIMEOUT_BODY);
        if (this.timeout) {
          if (this.timeout.refresh) {
            this.timeout.refresh();
          }
        }
        this.paused = false;
        this.execute(this.socket.read() || EMPTY_BUF);
        this.readMore();
      }
      readMore() {
        while (!this.paused && this.ptr) {
          const chunk = this.socket.read();
          if (chunk === null) {
            break;
          }
          this.execute(chunk);
        }
      }
      /**
       * @param {Buffer} chunk
       */
      execute(chunk) {
        assert61(currentParser === null);
        assert61(this.ptr != null);
        assert61(!this.paused);
        const { socket, llhttp } = this;
        if (chunk.length > currentBufferSize) {
          if (currentBufferPtr) {
            llhttp.free(currentBufferPtr);
          }
          currentBufferSize = Math.ceil(chunk.length / 4096) * 4096;
          currentBufferPtr = llhttp.malloc(currentBufferSize);
        }
        new Uint8Array(llhttp.memory.buffer, currentBufferPtr, currentBufferSize).set(chunk);
        try {
          let ret;
          try {
            currentBufferRef = chunk;
            currentParser = this;
            ret = llhttp.llhttp_execute(this.ptr, currentBufferPtr, chunk.length);
          } finally {
            currentParser = null;
            currentBufferRef = null;
          }
          if (ret !== constants5.ERROR.OK) {
            const data = chunk.subarray(llhttp.llhttp_get_error_pos(this.ptr) - currentBufferPtr);
            if (ret === constants5.ERROR.PAUSED_UPGRADE) {
              this.onUpgrade(data);
            } else if (ret === constants5.ERROR.PAUSED) {
              this.paused = true;
              socket.unshift(data);
            } else {
              const ptr = llhttp.llhttp_get_error_reason(this.ptr);
              let message = "";
              if (ptr) {
                const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0);
                message = "Response does not match the HTTP/1.1 protocol (" + Buffer.from(llhttp.memory.buffer, ptr, len).toString() + ")";
              }
              throw new HTTPParserError(message, constants5.ERROR[ret], data);
            }
          }
        } catch (err) {
          util5.destroy(socket, err);
        }
      }
      destroy() {
        assert61(currentParser === null);
        assert61(this.ptr != null);
        this.llhttp.llhttp_free(this.ptr);
        this.ptr = null;
        this.timeout && timers.clearTimeout(this.timeout);
        this.timeout = null;
        this.timeoutValue = null;
        this.timeoutType = null;
        this.paused = false;
      }
      /**
       * @param {Buffer} buf
       * @returns {0}
       */
      onStatus(buf) {
        this.statusText = buf.toString();
        return 0;
      }
      /**
       * @returns {0|-1}
       */
      onMessageBegin() {
        const { socket, client } = this;
        if (socket.destroyed) {
          return -1;
        }
        const request4 = client[kQueue][client[kRunningIdx]];
        if (!request4) {
          return -1;
        }
        request4.onResponseStarted();
        return 0;
      }
      /**
       * @param {Buffer} buf
       * @returns {number}
       */
      onHeaderField(buf) {
        const len = this.headers.length;
        if ((len & 1) === 0) {
          this.headers.push(buf);
        } else {
          this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf]);
        }
        this.trackHeader(buf.length);
        return 0;
      }
      /**
       * @param {Buffer} buf
       * @returns {number}
       */
      onHeaderValue(buf) {
        let len = this.headers.length;
        if ((len & 1) === 1) {
          this.headers.push(buf);
          len += 1;
        } else {
          this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf]);
        }
        const key = this.headers[len - 2];
        if (key.length === 10) {
          const headerName = util5.bufferToLowerCasedHeaderName(key);
          if (headerName === "keep-alive") {
            this.keepAlive += buf.toString();
          } else if (headerName === "connection") {
            this.connection += buf.toString();
          }
        } else if (key.length === 14 && util5.bufferToLowerCasedHeaderName(key) === "content-length") {
          this.contentLength += buf.toString();
        }
        this.trackHeader(buf.length);
        return 0;
      }
      /**
       * @param {number} len
       */
      trackHeader(len) {
        this.headersSize += len;
        if (this.headersSize >= this.headersMaxSize) {
          util5.destroy(this.socket, new HeadersOverflowError());
        }
      }
      /**
       * @param {Buffer} head
       */
      onUpgrade(head) {
        const { upgrade, client, socket, headers, statusCode } = this;
        assert61(upgrade);
        assert61(client[kSocket] === socket);
        assert61(!socket.destroyed);
        assert61(!this.paused);
        assert61((headers.length & 1) === 0);
        const request4 = client[kQueue][client[kRunningIdx]];
        assert61(request4);
        assert61(request4.upgrade || request4.method === "CONNECT");
        this.statusCode = 0;
        this.statusText = "";
        this.shouldKeepAlive = false;
        this.headers = [];
        this.headersSize = 0;
        socket.unshift(head);
        socket[kParser].destroy();
        socket[kParser] = null;
        socket[kClient] = null;
        socket[kError] = null;
        removeAllListeners(socket);
        client[kSocket] = null;
        client[kHTTPContext] = null;
        client[kQueue][client[kRunningIdx]++] = null;
        client.emit("disconnect", client[kUrl], [client], new InformationalError("upgrade"));
        try {
          request4.onUpgrade(statusCode, headers, socket);
        } catch (err) {
          util5.destroy(socket, err);
        }
        client[kResume]();
      }
      /**
       * @param {number} statusCode
       * @param {boolean} upgrade
       * @param {boolean} shouldKeepAlive
       * @returns {number}
       */
      onHeadersComplete(statusCode, upgrade, shouldKeepAlive) {
        const { client, socket, headers, statusText } = this;
        if (socket.destroyed) {
          return -1;
        }
        const request4 = client[kQueue][client[kRunningIdx]];
        if (!request4) {
          return -1;
        }
        assert61(!this.upgrade);
        assert61(this.statusCode < 200);
        if (statusCode === 100) {
          util5.destroy(socket, new SocketError("bad response", util5.getSocketInfo(socket)));
          return -1;
        }
        if (upgrade && !request4.upgrade) {
          util5.destroy(socket, new SocketError("bad upgrade", util5.getSocketInfo(socket)));
          return -1;
        }
        assert61(this.timeoutType === TIMEOUT_HEADERS);
        this.statusCode = statusCode;
        this.shouldKeepAlive = shouldKeepAlive || // Override llhttp value which does not allow keepAlive for HEAD.
        request4.method === "HEAD" && !socket[kReset2] && this.connection.toLowerCase() === "keep-alive";
        if (this.statusCode >= 200) {
          const bodyTimeout = request4.bodyTimeout != null ? request4.bodyTimeout : client[kBodyTimeout];
          this.setTimeout(bodyTimeout, TIMEOUT_BODY);
        } else if (this.timeout) {
          if (this.timeout.refresh) {
            this.timeout.refresh();
          }
        }
        if (request4.method === "CONNECT") {
          assert61(client[kRunning] === 1);
          this.upgrade = true;
          return 2;
        }
        if (upgrade) {
          assert61(client[kRunning] === 1);
          this.upgrade = true;
          return 2;
        }
        assert61((this.headers.length & 1) === 0);
        this.headers = [];
        this.headersSize = 0;
        if (this.shouldKeepAlive && client[kPipelining]) {
          const keepAliveTimeout = this.keepAlive ? util5.parseKeepAliveTimeout(this.keepAlive) : null;
          if (keepAliveTimeout != null) {
            const timeout2 = Math.min(
              keepAliveTimeout - client[kKeepAliveTimeoutThreshold],
              client[kKeepAliveMaxTimeout]
            );
            if (timeout2 <= 0) {
              socket[kReset2] = true;
            } else {
              client[kKeepAliveTimeoutValue] = timeout2;
            }
          } else {
            client[kKeepAliveTimeoutValue] = client[kKeepAliveDefaultTimeout];
          }
        } else {
          socket[kReset2] = true;
        }
        const pause = request4.onHeaders(statusCode, headers, this.resume, statusText) === false;
        if (request4.aborted) {
          return -1;
        }
        if (request4.method === "HEAD") {
          return 1;
        }
        if (statusCode < 200) {
          return 1;
        }
        if (socket[kBlocking]) {
          socket[kBlocking] = false;
          client[kResume]();
        }
        return pause ? constants5.ERROR.PAUSED : 0;
      }
      /**
       * @param {Buffer} buf
       * @returns {number}
       */
      onBody(buf) {
        const { client, socket, statusCode, maxResponseSize } = this;
        if (socket.destroyed) {
          return -1;
        }
        const request4 = client[kQueue][client[kRunningIdx]];
        assert61(request4);
        assert61(this.timeoutType === TIMEOUT_BODY);
        if (this.timeout) {
          if (this.timeout.refresh) {
            this.timeout.refresh();
          }
        }
        assert61(statusCode >= 200);
        if (maxResponseSize > -1 && this.bytesRead + buf.length > maxResponseSize) {
          util5.destroy(socket, new ResponseExceededMaxSizeError());
          return -1;
        }
        this.bytesRead += buf.length;
        if (request4.onData(buf) === false) {
          return constants5.ERROR.PAUSED;
        }
        return 0;
      }
      /**
       * @returns {number}
       */
      onMessageComplete() {
        const { client, socket, statusCode, upgrade, headers, contentLength, bytesRead, shouldKeepAlive } = this;
        if (socket.destroyed && (!statusCode || shouldKeepAlive)) {
          return -1;
        }
        if (upgrade) {
          return 0;
        }
        assert61(statusCode >= 100);
        assert61((this.headers.length & 1) === 0);
        const request4 = client[kQueue][client[kRunningIdx]];
        assert61(request4);
        this.statusCode = 0;
        this.statusText = "";
        this.bytesRead = 0;
        this.contentLength = "";
        this.keepAlive = "";
        this.connection = "";
        this.headers = [];
        this.headersSize = 0;
        if (statusCode < 200) {
          return 0;
        }
        if (request4.method !== "HEAD" && contentLength && bytesRead !== parseInt(contentLength, 10)) {
          util5.destroy(socket, new ResponseContentLengthMismatchError());
          return -1;
        }
        request4.onComplete(headers);
        client[kQueue][client[kRunningIdx]++] = null;
        if (socket[kWriting]) {
          assert61(client[kRunning] === 0);
          util5.destroy(socket, new InformationalError("reset"));
          return constants5.ERROR.PAUSED;
        } else if (!shouldKeepAlive) {
          util5.destroy(socket, new InformationalError("reset"));
          return constants5.ERROR.PAUSED;
        } else if (socket[kReset2] && client[kRunning] === 0) {
          util5.destroy(socket, new InformationalError("reset"));
          return constants5.ERROR.PAUSED;
        } else if (client[kPipelining] == null || client[kPipelining] === 1) {
          setImmediate(client[kResume]);
        } else {
          client[kResume]();
        }
        return 0;
      }
    };
    function onParserTimeout(parserWeakRef) {
      const parser2 = parserWeakRef.deref();
      if (!parser2) {
        return;
      }
      const { socket, timeoutType, client, paused } = parser2;
      if (timeoutType === TIMEOUT_HEADERS) {
        if (!socket[kWriting] || socket.writableNeedDrain || client[kRunning] > 1) {
          assert61(!paused, "cannot be paused while waiting for headers");
          util5.destroy(socket, new HeadersTimeoutError());
        }
      } else if (timeoutType === TIMEOUT_BODY) {
        if (!paused) {
          util5.destroy(socket, new BodyTimeoutError());
        }
      } else if (timeoutType === TIMEOUT_KEEP_ALIVE) {
        assert61(client[kRunning] === 0 && client[kKeepAliveTimeoutValue]);
        util5.destroy(socket, new InformationalError("socket idle timeout"));
      }
    }
    __name(onParserTimeout, "onParserTimeout");
    function connectH1(client, socket) {
      client[kSocket] = socket;
      if (!llhttpInstance) {
        llhttpInstance = lazyllhttp();
      }
      if (socket.errored) {
        throw socket.errored;
      }
      if (socket.destroyed) {
        throw new SocketError("destroyed");
      }
      socket[kNoRef] = false;
      socket[kWriting] = false;
      socket[kReset2] = false;
      socket[kBlocking] = false;
      socket[kParser] = new Parser2(client, socket, llhttpInstance);
      util5.addListener(socket, "error", onHttpSocketError);
      util5.addListener(socket, "readable", onHttpSocketReadable);
      util5.addListener(socket, "end", onHttpSocketEnd);
      util5.addListener(socket, "close", onHttpSocketClose);
      socket[kClosed] = false;
      socket.on("close", onSocketClose);
      return {
        version: "h1",
        defaultPipelining: 1,
        write(request4) {
          return writeH1(client, request4);
        },
        resume() {
          resumeH1(client);
        },
        /**
         * @param {Error|undefined} err
         * @param {() => void} callback
         */
        destroy(err, callback) {
          if (socket[kClosed]) {
            queueMicrotask(callback);
          } else {
            socket.on("close", callback);
            socket.destroy(err);
          }
        },
        /**
         * @returns {boolean}
         */
        get destroyed() {
          return socket.destroyed;
        },
        /**
         * @param {import('../core/request.js')} request
         * @returns {boolean}
         */
        busy(request4) {
          if (socket[kWriting] || socket[kReset2] || socket[kBlocking]) {
            return true;
          }
          if (request4) {
            if (client[kRunning] > 0 && !request4.idempotent) {
              return true;
            }
            if (client[kRunning] > 0 && (request4.upgrade || request4.method === "CONNECT")) {
              return true;
            }
            if (client[kRunning] > 0 && util5.bodyLength(request4.body) !== 0 && (util5.isStream(request4.body) || util5.isAsyncIterable(request4.body) || util5.isFormDataLike(request4.body))) {
              return true;
            }
          }
          return false;
        }
      };
    }
    __name(connectH1, "connectH1");
    function onHttpSocketError(err) {
      assert61(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID");
      const parser2 = this[kParser];
      if (err.code === "ECONNRESET" && parser2.statusCode && !parser2.shouldKeepAlive) {
        parser2.onMessageComplete();
        return;
      }
      this[kError] = err;
      this[kClient][kOnError](err);
    }
    __name(onHttpSocketError, "onHttpSocketError");
    function onHttpSocketReadable() {
      this[kParser]?.readMore();
    }
    __name(onHttpSocketReadable, "onHttpSocketReadable");
    function onHttpSocketEnd() {
      const parser2 = this[kParser];
      if (parser2.statusCode && !parser2.shouldKeepAlive) {
        parser2.onMessageComplete();
        return;
      }
      util5.destroy(this, new SocketError("other side closed", util5.getSocketInfo(this)));
    }
    __name(onHttpSocketEnd, "onHttpSocketEnd");
    function onHttpSocketClose() {
      const parser2 = this[kParser];
      if (parser2) {
        if (!this[kError] && parser2.statusCode && !parser2.shouldKeepAlive) {
          parser2.onMessageComplete();
        }
        this[kParser].destroy();
        this[kParser] = null;
      }
      const err = this[kError] || new SocketError("closed", util5.getSocketInfo(this));
      const client = this[kClient];
      client[kSocket] = null;
      client[kHTTPContext] = null;
      if (client.destroyed) {
        assert61(client[kPending] === 0);
        const requests = client[kQueue].splice(client[kRunningIdx]);
        for (let i7 = 0; i7 < requests.length; i7++) {
          const request4 = requests[i7];
          util5.errorRequest(client, request4, err);
        }
      } else if (client[kRunning] > 0 && err.code !== "UND_ERR_INFO") {
        const request4 = client[kQueue][client[kRunningIdx]];
        client[kQueue][client[kRunningIdx]++] = null;
        util5.errorRequest(client, request4, err);
      }
      client[kPendingIdx] = client[kRunningIdx];
      assert61(client[kRunning] === 0);
      client.emit("disconnect", client[kUrl], [client], err);
      client[kResume]();
    }
    __name(onHttpSocketClose, "onHttpSocketClose");
    function onSocketClose() {
      this[kClosed] = true;
    }
    __name(onSocketClose, "onSocketClose");
    function resumeH1(client) {
      const socket = client[kSocket];
      if (socket && !socket.destroyed) {
        if (client[kSize] === 0) {
          if (!socket[kNoRef] && socket.unref) {
            socket.unref();
            socket[kNoRef] = true;
          }
        } else if (socket[kNoRef] && socket.ref) {
          socket.ref();
          socket[kNoRef] = false;
        }
        if (client[kSize] === 0) {
          if (socket[kParser].timeoutType !== TIMEOUT_KEEP_ALIVE) {
            socket[kParser].setTimeout(client[kKeepAliveTimeoutValue], TIMEOUT_KEEP_ALIVE);
          }
        } else if (client[kRunning] > 0 && socket[kParser].statusCode < 200) {
          if (socket[kParser].timeoutType !== TIMEOUT_HEADERS) {
            const request4 = client[kQueue][client[kRunningIdx]];
            const headersTimeout = request4.headersTimeout != null ? request4.headersTimeout : client[kHeadersTimeout];
            socket[kParser].setTimeout(headersTimeout, TIMEOUT_HEADERS);
          }
        }
      }
    }
    __name(resumeH1, "resumeH1");
    function shouldSendContentLength(method) {
      return method !== "GET" && method !== "HEAD" && method !== "OPTIONS" && method !== "TRACE" && method !== "CONNECT";
    }
    __name(shouldSendContentLength, "shouldSendContentLength");
    function writeH1(client, request4) {
      const { method, path: path84, host, upgrade, blocking, reset } = request4;
      let { body, headers, contentLength } = request4;
      const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH" || method === "QUERY" || method === "PROPFIND" || method === "PROPPATCH";
      if (util5.isFormDataLike(body)) {
        if (!extractBody) {
          extractBody = require_body().extractBody;
        }
        const [bodyStream, contentType] = extractBody(body);
        if (request4.contentType == null) {
          headers.push("content-type", contentType);
        }
        body = bodyStream.stream;
        contentLength = bodyStream.length;
      } else if (util5.isBlobLike(body) && request4.contentType == null && body.type) {
        headers.push("content-type", body.type);
      }
      if (body && typeof body.read === "function") {
        body.read(0);
      }
      const bodyLength = util5.bodyLength(body);
      contentLength = bodyLength ?? contentLength;
      if (contentLength === null) {
        contentLength = request4.contentLength;
      }
      if (contentLength === 0 && !expectsPayload) {
        contentLength = null;
      }
      if (shouldSendContentLength(method) && contentLength > 0 && request4.contentLength !== null && request4.contentLength !== contentLength) {
        if (client[kStrictContentLength]) {
          util5.errorRequest(client, request4, new RequestContentLengthMismatchError());
          return false;
        }
        process.emitWarning(new RequestContentLengthMismatchError());
      }
      const socket = client[kSocket];
      const abort = /* @__PURE__ */ __name((err) => {
        if (request4.aborted || request4.completed) {
          return;
        }
        util5.errorRequest(client, request4, err || new RequestAbortedError());
        util5.destroy(body);
        util5.destroy(socket, new InformationalError("aborted"));
      }, "abort");
      try {
        request4.onConnect(abort);
      } catch (err) {
        util5.errorRequest(client, request4, err);
      }
      if (request4.aborted) {
        return false;
      }
      if (method === "HEAD") {
        socket[kReset2] = true;
      }
      if (upgrade || method === "CONNECT") {
        socket[kReset2] = true;
      }
      if (reset != null) {
        socket[kReset2] = reset;
      }
      if (client[kMaxRequests] && socket[kCounter]++ >= client[kMaxRequests]) {
        socket[kReset2] = true;
      }
      if (blocking) {
        socket[kBlocking] = true;
      }
      if (socket.setTypeOfService) {
        socket.setTypeOfService(request4.typeOfService);
      }
      let header = `${method} ${path84} HTTP/1.1\r
`;
      if (typeof host === "string") {
        header += `host: ${host}\r
`;
      } else {
        header += client[kHostHeader];
      }
      if (upgrade) {
        header += `connection: upgrade\r
upgrade: ${upgrade}\r
`;
      } else if (client[kPipelining] && !socket[kReset2]) {
        header += "connection: keep-alive\r\n";
      } else {
        header += "connection: close\r\n";
      }
      if (Array.isArray(headers)) {
        for (let n9 = 0; n9 < headers.length; n9 += 2) {
          const key = headers[n9 + 0];
          const val2 = headers[n9 + 1];
          if (Array.isArray(val2)) {
            for (let i7 = 0; i7 < val2.length; i7++) {
              header += `${key}: ${val2[i7]}\r
`;
            }
          } else {
            header += `${key}: ${val2}\r
`;
          }
        }
      }
      if (channels.sendHeaders.hasSubscribers) {
        channels.sendHeaders.publish({ request: request4, headers: header, socket });
      }
      if (!body || bodyLength === 0) {
        writeBuffer(abort, null, client, request4, socket, contentLength, header, expectsPayload);
      } else if (util5.isBuffer(body)) {
        writeBuffer(abort, body, client, request4, socket, contentLength, header, expectsPayload);
      } else if (util5.isBlobLike(body)) {
        if (typeof body.stream === "function") {
          writeIterable(abort, body.stream(), client, request4, socket, contentLength, header, expectsPayload);
        } else {
          writeBlob(abort, body, client, request4, socket, contentLength, header, expectsPayload);
        }
      } else if (util5.isStream(body)) {
        writeStream(abort, body, client, request4, socket, contentLength, header, expectsPayload);
      } else if (util5.isIterable(body)) {
        writeIterable(abort, body, client, request4, socket, contentLength, header, expectsPayload);
      } else {
        assert61(false);
      }
      return true;
    }
    __name(writeH1, "writeH1");
    function writeStream(abort, body, client, request4, socket, contentLength, header, expectsPayload) {
      assert61(contentLength !== 0 || client[kRunning] === 0, "stream body cannot be pipelined");
      let finished = false;
      const writer = new AsyncWriter({ abort, socket, request: request4, contentLength, client, expectsPayload, header });
      const onData = /* @__PURE__ */ __name(function(chunk) {
        if (finished) {
          return;
        }
        try {
          if (!writer.write(chunk) && this.pause) {
            this.pause();
          }
        } catch (err) {
          util5.destroy(this, err);
        }
      }, "onData");
      const onDrain = /* @__PURE__ */ __name(function() {
        if (finished) {
          return;
        }
        if (body.resume) {
          body.resume();
        }
      }, "onDrain");
      const onClose = /* @__PURE__ */ __name(function() {
        queueMicrotask(() => {
          body.removeListener("error", onFinished);
        });
        if (!finished) {
          const err = new RequestAbortedError();
          queueMicrotask(() => onFinished(err));
        }
      }, "onClose");
      const onFinished = /* @__PURE__ */ __name(function(err) {
        if (finished) {
          return;
        }
        finished = true;
        assert61(socket.destroyed || socket[kWriting] && client[kRunning] <= 1);
        socket.off("drain", onDrain).off("error", onFinished);
        body.removeListener("data", onData).removeListener("end", onFinished).removeListener("close", onClose);
        if (!err) {
          try {
            writer.end();
          } catch (er2) {
            err = er2;
          }
        }
        writer.destroy(err);
        if (err && (err.code !== "UND_ERR_INFO" || err.message !== "reset")) {
          util5.destroy(body, err);
        } else {
          util5.destroy(body);
        }
      }, "onFinished");
      body.on("data", onData).on("end", onFinished).on("error", onFinished).on("close", onClose);
      if (body.resume) {
        body.resume();
      }
      socket.on("drain", onDrain).on("error", onFinished);
      if (body.errorEmitted ?? body.errored) {
        setImmediate(onFinished, body.errored);
      } else if (body.endEmitted ?? body.readableEnded) {
        setImmediate(onFinished, null);
      }
      if (body.closeEmitted ?? body.closed) {
        setImmediate(onClose);
      }
    }
    __name(writeStream, "writeStream");
    function writeBuffer(abort, body, client, request4, socket, contentLength, header, expectsPayload) {
      try {
        if (!body) {
          if (contentLength === 0) {
            socket.write(`${header}content-length: 0\r
\r
`, "latin1");
          } else {
            assert61(contentLength === null, "no body must not have content length");
            socket.write(`${header}\r
`, "latin1");
          }
        } else if (util5.isBuffer(body)) {
          assert61(contentLength === body.byteLength, "buffer body must have content length");
          socket.cork();
          socket.write(`${header}content-length: ${contentLength}\r
\r
`, "latin1");
          socket.write(body);
          socket.uncork();
          request4.onBodySent(body);
          if (!expectsPayload && request4.reset !== false) {
            socket[kReset2] = true;
          }
        }
        request4.onRequestSent();
        client[kResume]();
      } catch (err) {
        abort(err);
      }
    }
    __name(writeBuffer, "writeBuffer");
    async function writeBlob(abort, body, client, request4, socket, contentLength, header, expectsPayload) {
      assert61(contentLength === body.size, "blob body must have content length");
      try {
        if (contentLength != null && contentLength !== body.size) {
          throw new RequestContentLengthMismatchError();
        }
        const buffer = Buffer.from(await body.arrayBuffer());
        socket.cork();
        socket.write(`${header}content-length: ${contentLength}\r
\r
`, "latin1");
        socket.write(buffer);
        socket.uncork();
        request4.onBodySent(buffer);
        request4.onRequestSent();
        if (!expectsPayload && request4.reset !== false) {
          socket[kReset2] = true;
        }
        client[kResume]();
      } catch (err) {
        abort(err);
      }
    }
    __name(writeBlob, "writeBlob");
    async function writeIterable(abort, body, client, request4, socket, contentLength, header, expectsPayload) {
      assert61(contentLength !== 0 || client[kRunning] === 0, "iterator body cannot be pipelined");
      let callback = null;
      function onDrain() {
        if (callback) {
          const cb2 = callback;
          callback = null;
          cb2();
        }
      }
      __name(onDrain, "onDrain");
      const waitForDrain = /* @__PURE__ */ __name(() => new Promise((resolve32, reject) => {
        assert61(callback === null);
        if (socket[kError]) {
          reject(socket[kError]);
        } else {
          callback = resolve32;
        }
      }), "waitForDrain");
      socket.on("close", onDrain).on("drain", onDrain);
      const writer = new AsyncWriter({ abort, socket, request: request4, contentLength, client, expectsPayload, header });
      try {
        for await (const chunk of body) {
          if (socket[kError]) {
            throw socket[kError];
          }
          if (!writer.write(chunk)) {
            await waitForDrain();
          }
        }
        writer.end();
      } catch (err) {
        writer.destroy(err);
      } finally {
        socket.off("close", onDrain).off("drain", onDrain);
      }
    }
    __name(writeIterable, "writeIterable");
    var AsyncWriter = class {
      static {
        __name(this, "AsyncWriter");
      }
      /**
       *
       * @param {object} arg
       * @param {AbortCallback} arg.abort
       * @param {import('net').Socket} arg.socket
       * @param {import('../core/request.js')} arg.request
       * @param {number} arg.contentLength
       * @param {import('./client.js')} arg.client
       * @param {boolean} arg.expectsPayload
       * @param {string} arg.header
       */
      constructor({ abort, socket, request: request4, contentLength, client, expectsPayload, header }) {
        this.socket = socket;
        this.request = request4;
        this.contentLength = contentLength;
        this.client = client;
        this.bytesWritten = 0;
        this.expectsPayload = expectsPayload;
        this.header = header;
        this.abort = abort;
        socket[kWriting] = true;
      }
      /**
       * @param {Buffer} chunk
       * @returns
       */
      write(chunk) {
        const { socket, request: request4, contentLength, client, bytesWritten, expectsPayload, header } = this;
        if (socket[kError]) {
          throw socket[kError];
        }
        if (socket.destroyed) {
          return false;
        }
        const len = Buffer.byteLength(chunk);
        if (!len) {
          return true;
        }
        if (contentLength !== null && bytesWritten + len > contentLength) {
          if (client[kStrictContentLength]) {
            throw new RequestContentLengthMismatchError();
          }
          process.emitWarning(new RequestContentLengthMismatchError());
        }
        socket.cork();
        if (bytesWritten === 0) {
          if (!expectsPayload && request4.reset !== false) {
            socket[kReset2] = true;
          }
          if (contentLength === null) {
            socket.write(`${header}transfer-encoding: chunked\r
`, "latin1");
          } else {
            socket.write(`${header}content-length: ${contentLength}\r
\r
`, "latin1");
          }
        }
        if (contentLength === null) {
          socket.write(`\r
${len.toString(16)}\r
`, "latin1");
        }
        this.bytesWritten += len;
        const ret = socket.write(chunk);
        socket.uncork();
        request4.onBodySent(chunk);
        if (!ret) {
          if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) {
            if (socket[kParser].timeout.refresh) {
              socket[kParser].timeout.refresh();
            }
          }
        }
        return ret;
      }
      /**
       * @returns {void}
       */
      end() {
        const { socket, contentLength, client, bytesWritten, expectsPayload, header, request: request4 } = this;
        request4.onRequestSent();
        socket[kWriting] = false;
        if (socket[kError]) {
          throw socket[kError];
        }
        if (socket.destroyed) {
          return;
        }
        if (bytesWritten === 0) {
          if (expectsPayload) {
            socket.write(`${header}content-length: 0\r
\r
`, "latin1");
          } else {
            socket.write(`${header}\r
`, "latin1");
          }
        } else if (contentLength === null) {
          socket.write("\r\n0\r\n\r\n", "latin1");
        }
        if (contentLength !== null && bytesWritten !== contentLength) {
          if (client[kStrictContentLength]) {
            throw new RequestContentLengthMismatchError();
          } else {
            process.emitWarning(new RequestContentLengthMismatchError());
          }
        }
        if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) {
          if (socket[kParser].timeout.refresh) {
            socket[kParser].timeout.refresh();
          }
        }
        client[kResume]();
      }
      /**
       * @param {Error} [err]
       * @returns {void}
       */
      destroy(err) {
        const { socket, client, abort } = this;
        socket[kWriting] = false;
        if (err) {
          assert61(client[kRunning] <= 1, "pipeline should only contain this request");
          abort(err);
        }
      }
    };
    module2.exports = connectH1;
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/dispatcher/client-h2.js
var require_client_h2 = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/dispatcher/client-h2.js"(exports, module2) {
    init_import_meta_url();
    var assert61 = __require("assert");
    var { pipeline } = __require("stream");
    var util5 = require_util();
    var {
      RequestContentLengthMismatchError,
      RequestAbortedError,
      SocketError,
      InformationalError,
      InvalidArgumentError
    } = require_errors();
    var {
      kUrl,
      kReset: kReset2,
      kClient,
      kRunning,
      kPending,
      kQueue,
      kPendingIdx,
      kRunningIdx,
      kError,
      kSocket,
      kStrictContentLength,
      kOnError,
      kMaxConcurrentStreams,
      kPingInterval,
      kHTTP2Session,
      kHTTP2InitialWindowSize,
      kHTTP2ConnectionWindowSize,
      kResume,
      kSize,
      kHTTPContext,
      kClosed,
      kBodyTimeout,
      kEnableConnectProtocol,
      kRemoteSettings,
      kHTTP2Stream,
      kHTTP2SessionState
    } = require_symbols();
    var { channels } = require_diagnostics();
    var kOpenStreams = Symbol("open streams");
    var extractBody;
    var http22;
    try {
      http22 = __require("http2");
    } catch {
      http22 = { constants: {} };
    }
    var {
      constants: {
        HTTP2_HEADER_AUTHORITY,
        HTTP2_HEADER_METHOD,
        HTTP2_HEADER_PATH,
        HTTP2_HEADER_SCHEME,
        HTTP2_HEADER_CONTENT_LENGTH,
        HTTP2_HEADER_EXPECT,
        HTTP2_HEADER_STATUS,
        HTTP2_HEADER_PROTOCOL,
        NGHTTP2_REFUSED_STREAM,
        NGHTTP2_CANCEL
      }
    } = http22;
    function parseH2Headers(headers) {
      const result = [];
      for (const [name2, value] of Object.entries(headers)) {
        if (Array.isArray(value)) {
          for (const subvalue of value) {
            result.push(Buffer.from(name2), Buffer.from(subvalue));
          }
        } else {
          result.push(Buffer.from(name2), Buffer.from(value));
        }
      }
      return result;
    }
    __name(parseH2Headers, "parseH2Headers");
    function connectH2(client, socket) {
      client[kSocket] = socket;
      const http2InitialWindowSize = client[kHTTP2InitialWindowSize];
      const http2ConnectionWindowSize = client[kHTTP2ConnectionWindowSize];
      const session = http22.connect(client[kUrl], {
        createConnection: /* @__PURE__ */ __name(() => socket, "createConnection"),
        peerMaxConcurrentStreams: client[kMaxConcurrentStreams],
        settings: {
          // TODO(metcoder95): add support for PUSH
          enablePush: false,
          ...http2InitialWindowSize != null ? { initialWindowSize: http2InitialWindowSize } : null
        }
      });
      client[kSocket] = socket;
      session[kOpenStreams] = 0;
      session[kClient] = client;
      session[kSocket] = socket;
      session[kHTTP2SessionState] = {
        ping: {
          interval: client[kPingInterval] === 0 ? null : setInterval(onHttp2SendPing, client[kPingInterval], session).unref()
        }
      };
      session[kEnableConnectProtocol] = false;
      session[kRemoteSettings] = false;
      if (http2ConnectionWindowSize) {
        util5.addListener(session, "connect", applyConnectionWindowSize.bind(session, http2ConnectionWindowSize));
      }
      util5.addListener(session, "error", onHttp2SessionError);
      util5.addListener(session, "frameError", onHttp2FrameError);
      util5.addListener(session, "end", onHttp2SessionEnd);
      util5.addListener(session, "goaway", onHttp2SessionGoAway);
      util5.addListener(session, "close", onHttp2SessionClose);
      util5.addListener(session, "remoteSettings", onHttp2RemoteSettings);
      session.unref();
      client[kHTTP2Session] = session;
      socket[kHTTP2Session] = session;
      util5.addListener(socket, "error", onHttp2SocketError);
      util5.addListener(socket, "end", onHttp2SocketEnd);
      util5.addListener(socket, "close", onHttp2SocketClose);
      socket[kClosed] = false;
      socket.on("close", onSocketClose);
      return {
        version: "h2",
        defaultPipelining: Infinity,
        /**
         * @param {import('../core/request.js')} request
         * @returns {boolean}
        */
        write(request4) {
          return writeH2(client, request4);
        },
        /**
         * @returns {void}
         */
        resume() {
          resumeH2(client);
        },
        /**
         * @param {Error | null} err
         * @param {() => void} callback
         */
        destroy(err, callback) {
          if (socket[kClosed]) {
            queueMicrotask(callback);
          } else {
            socket.destroy(err).on("close", callback);
          }
        },
        /**
         * @type {boolean}
         */
        get destroyed() {
          return socket.destroyed;
        },
        /**
         * @param {import('../core/request.js')} request
         * @returns {boolean}
        */
        busy(request4) {
          if (request4 != null) {
            if (client[kRunning] > 0) {
              if (request4.idempotent === false) return true;
              if ((request4.upgrade === "websocket" || request4.method === "CONNECT") && session[kRemoteSettings] === false) return true;
              if (util5.bodyLength(request4.body) !== 0 && (util5.isStream(request4.body) || util5.isAsyncIterable(request4.body) || util5.isFormDataLike(request4.body))) return true;
            } else {
              return (request4.upgrade === "websocket" || request4.method === "CONNECT") && session[kRemoteSettings] === false;
            }
          }
          return false;
        }
      };
    }
    __name(connectH2, "connectH2");
    function resumeH2(client) {
      const socket = client[kSocket];
      if (socket?.destroyed === false) {
        if (client[kSize] === 0 || client[kMaxConcurrentStreams] === 0) {
          socket.unref();
          client[kHTTP2Session].unref();
        } else {
          socket.ref();
          client[kHTTP2Session].ref();
        }
      }
    }
    __name(resumeH2, "resumeH2");
    function applyConnectionWindowSize(connectionWindowSize) {
      try {
        if (typeof this.setLocalWindowSize === "function") {
          this.setLocalWindowSize(connectionWindowSize);
        }
      } catch {
      }
    }
    __name(applyConnectionWindowSize, "applyConnectionWindowSize");
    function onHttp2RemoteSettings(settings) {
      this[kClient][kMaxConcurrentStreams] = settings.maxConcurrentStreams ?? this[kClient][kMaxConcurrentStreams];
      if (this[kRemoteSettings] === true && this[kEnableConnectProtocol] === true && settings.enableConnectProtocol === false) {
        const err = new InformationalError("HTTP/2: Server disabled extended CONNECT protocol against RFC-8441");
        this[kSocket][kError] = err;
        this[kClient][kOnError](err);
        return;
      }
      this[kEnableConnectProtocol] = settings.enableConnectProtocol ?? this[kEnableConnectProtocol];
      this[kRemoteSettings] = true;
      this[kClient][kResume]();
    }
    __name(onHttp2RemoteSettings, "onHttp2RemoteSettings");
    function onHttp2SendPing(session) {
      const state2 = session[kHTTP2SessionState];
      if ((session.closed || session.destroyed) && state2.ping.interval != null) {
        clearInterval(state2.ping.interval);
        state2.ping.interval = null;
        return;
      }
      session.ping(onPing.bind(session));
      function onPing(err, duration) {
        const client = this[kClient];
        const socket = this[kClient];
        if (err != null) {
          const error2 = new InformationalError(`HTTP/2: "PING" errored - type ${err.message}`);
          socket[kError] = error2;
          client[kOnError](error2);
        } else {
          client.emit("ping", duration);
        }
      }
      __name(onPing, "onPing");
    }
    __name(onHttp2SendPing, "onHttp2SendPing");
    function onHttp2SessionError(err) {
      assert61(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID");
      this[kSocket][kError] = err;
      this[kClient][kOnError](err);
    }
    __name(onHttp2SessionError, "onHttp2SessionError");
    function onHttp2FrameError(type, code, id) {
      if (id === 0) {
        const err = new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code}`);
        this[kSocket][kError] = err;
        this[kClient][kOnError](err);
      }
    }
    __name(onHttp2FrameError, "onHttp2FrameError");
    function onHttp2SessionEnd() {
      const err = new SocketError("other side closed", util5.getSocketInfo(this[kSocket]));
      this.destroy(err);
      util5.destroy(this[kSocket], err);
    }
    __name(onHttp2SessionEnd, "onHttp2SessionEnd");
    function onHttp2SessionGoAway(errorCode) {
      const err = this[kError] || new SocketError(`HTTP/2: "GOAWAY" frame received with code ${errorCode}`, util5.getSocketInfo(this[kSocket]));
      const client = this[kClient];
      client[kSocket] = null;
      client[kHTTPContext] = null;
      this.close();
      this[kHTTP2Session] = null;
      util5.destroy(this[kSocket], err);
      if (client[kRunningIdx] < client[kQueue].length) {
        const request4 = client[kQueue][client[kRunningIdx]];
        client[kQueue][client[kRunningIdx]++] = null;
        util5.errorRequest(client, request4, err);
        client[kPendingIdx] = client[kRunningIdx];
      }
      assert61(client[kRunning] === 0);
      client.emit("disconnect", client[kUrl], [client], err);
      client.emit("connectionError", client[kUrl], [client], err);
      client[kResume]();
    }
    __name(onHttp2SessionGoAway, "onHttp2SessionGoAway");
    function onHttp2SessionClose() {
      const { [kClient]: client, [kHTTP2SessionState]: state2 } = this;
      const { [kSocket]: socket } = client;
      const err = this[kSocket][kError] || this[kError] || new SocketError("closed", util5.getSocketInfo(socket));
      client[kSocket] = null;
      client[kHTTPContext] = null;
      if (state2.ping.interval != null) {
        clearInterval(state2.ping.interval);
        state2.ping.interval = null;
      }
      if (client.destroyed) {
        assert61(client[kPending] === 0);
        const requests = client[kQueue].splice(client[kRunningIdx]);
        for (let i7 = 0; i7 < requests.length; i7++) {
          const request4 = requests[i7];
          util5.errorRequest(client, request4, err);
        }
      }
    }
    __name(onHttp2SessionClose, "onHttp2SessionClose");
    function onHttp2SocketClose() {
      const err = this[kError] || new SocketError("closed", util5.getSocketInfo(this));
      const client = this[kHTTP2Session][kClient];
      client[kSocket] = null;
      client[kHTTPContext] = null;
      if (this[kHTTP2Session] !== null) {
        this[kHTTP2Session].destroy(err);
      }
      client[kPendingIdx] = client[kRunningIdx];
      assert61(client[kRunning] === 0);
      client.emit("disconnect", client[kUrl], [client], err);
      client[kResume]();
    }
    __name(onHttp2SocketClose, "onHttp2SocketClose");
    function onHttp2SocketError(err) {
      assert61(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID");
      this[kError] = err;
      this[kClient][kOnError](err);
    }
    __name(onHttp2SocketError, "onHttp2SocketError");
    function onHttp2SocketEnd() {
      util5.destroy(this, new SocketError("other side closed", util5.getSocketInfo(this)));
    }
    __name(onHttp2SocketEnd, "onHttp2SocketEnd");
    function onSocketClose() {
      this[kClosed] = true;
    }
    __name(onSocketClose, "onSocketClose");
    function shouldSendContentLength(method) {
      return method !== "GET" && method !== "HEAD" && method !== "OPTIONS" && method !== "TRACE" && method !== "CONNECT";
    }
    __name(shouldSendContentLength, "shouldSendContentLength");
    function writeH2(client, request4) {
      const requestTimeout2 = request4.bodyTimeout ?? client[kBodyTimeout];
      const session = client[kHTTP2Session];
      const { method, path: path84, host, upgrade, expectContinue, signal, protocol, headers: reqHeaders } = request4;
      let { body } = request4;
      if (upgrade != null && upgrade !== "websocket") {
        util5.errorRequest(client, request4, new InvalidArgumentError(`Custom upgrade "${upgrade}" not supported over HTTP/2`));
        return false;
      }
      const headers = {};
      for (let n9 = 0; n9 < reqHeaders.length; n9 += 2) {
        const key = reqHeaders[n9 + 0];
        const val2 = reqHeaders[n9 + 1];
        if (key === "cookie") {
          if (headers[key] != null) {
            headers[key] = Array.isArray(headers[key]) ? (headers[key].push(val2), headers[key]) : [headers[key], val2];
          } else {
            headers[key] = val2;
          }
          continue;
        }
        if (Array.isArray(val2)) {
          for (let i7 = 0; i7 < val2.length; i7++) {
            if (headers[key]) {
              headers[key] += `, ${val2[i7]}`;
            } else {
              headers[key] = val2[i7];
            }
          }
        } else if (headers[key]) {
          headers[key] += `, ${val2}`;
        } else {
          headers[key] = val2;
        }
      }
      let stream2 = null;
      const { hostname: hostname2, port } = client[kUrl];
      headers[HTTP2_HEADER_AUTHORITY] = host || `${hostname2}${port ? `:${port}` : ""}`;
      headers[HTTP2_HEADER_METHOD] = method;
      const abort = /* @__PURE__ */ __name((err) => {
        if (request4.aborted || request4.completed) {
          return;
        }
        err = err || new RequestAbortedError();
        util5.errorRequest(client, request4, err);
        if (stream2 != null) {
          stream2.removeAllListeners("data");
          stream2.close();
          client[kOnError](err);
          client[kResume]();
        }
        util5.destroy(body, err);
      }, "abort");
      try {
        request4.onConnect(abort);
      } catch (err) {
        util5.errorRequest(client, request4, err);
      }
      if (request4.aborted) {
        return false;
      }
      if (upgrade || method === "CONNECT") {
        session.ref();
        if (upgrade === "websocket") {
          if (session[kEnableConnectProtocol] === false) {
            util5.errorRequest(client, request4, new InformationalError("HTTP/2: Extended CONNECT protocol not supported by server"));
            session.unref();
            return false;
          }
          headers[HTTP2_HEADER_METHOD] = "CONNECT";
          headers[HTTP2_HEADER_PROTOCOL] = "websocket";
          headers[HTTP2_HEADER_PATH] = path84;
          if (protocol === "ws:" || protocol === "wss:") {
            headers[HTTP2_HEADER_SCHEME] = protocol === "ws:" ? "http" : "https";
          } else {
            headers[HTTP2_HEADER_SCHEME] = protocol === "http:" ? "http" : "https";
          }
          stream2 = session.request(headers, { endStream: false, signal });
          stream2[kHTTP2Stream] = true;
          stream2.once("response", (headers2, _flags) => {
            const { [HTTP2_HEADER_STATUS]: statusCode, ...realHeaders } = headers2;
            request4.onUpgrade(statusCode, parseH2Headers(realHeaders), stream2);
            ++session[kOpenStreams];
            client[kQueue][client[kRunningIdx]++] = null;
          });
          stream2.on("error", () => {
            if (stream2.rstCode === NGHTTP2_REFUSED_STREAM || stream2.rstCode === NGHTTP2_CANCEL) {
              abort(new InformationalError(`HTTP/2: "stream error" received - code ${stream2.rstCode}`));
            }
          });
          stream2.once("close", () => {
            session[kOpenStreams] -= 1;
            if (session[kOpenStreams] === 0) session.unref();
          });
          stream2.setTimeout(requestTimeout2);
          return true;
        }
        stream2 = session.request(headers, { endStream: false, signal });
        stream2[kHTTP2Stream] = true;
        stream2.on("response", (headers2) => {
          const { [HTTP2_HEADER_STATUS]: statusCode, ...realHeaders } = headers2;
          request4.onUpgrade(statusCode, parseH2Headers(realHeaders), stream2);
          ++session[kOpenStreams];
          client[kQueue][client[kRunningIdx]++] = null;
        });
        stream2.once("close", () => {
          session[kOpenStreams] -= 1;
          if (session[kOpenStreams] === 0) session.unref();
        });
        stream2.setTimeout(requestTimeout2);
        return true;
      }
      headers[HTTP2_HEADER_PATH] = path84;
      headers[HTTP2_HEADER_SCHEME] = protocol === "http:" ? "http" : "https";
      const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH";
      if (body && typeof body.read === "function") {
        body.read(0);
      }
      let contentLength = util5.bodyLength(body);
      if (util5.isFormDataLike(body)) {
        extractBody ??= require_body().extractBody;
        const [bodyStream, contentType] = extractBody(body);
        headers["content-type"] = contentType;
        body = bodyStream.stream;
        contentLength = bodyStream.length;
      }
      if (contentLength == null) {
        contentLength = request4.contentLength;
      }
      if (!expectsPayload) {
        contentLength = null;
      }
      if (shouldSendContentLength(method) && contentLength > 0 && request4.contentLength != null && request4.contentLength !== contentLength) {
        if (client[kStrictContentLength]) {
          util5.errorRequest(client, request4, new RequestContentLengthMismatchError());
          return false;
        }
        process.emitWarning(new RequestContentLengthMismatchError());
      }
      if (contentLength != null) {
        assert61(body || contentLength === 0, "no body must not have content length");
        headers[HTTP2_HEADER_CONTENT_LENGTH] = `${contentLength}`;
      }
      session.ref();
      if (channels.sendHeaders.hasSubscribers) {
        let header = "";
        for (const key in headers) {
          header += `${key}: ${headers[key]}\r
`;
        }
        channels.sendHeaders.publish({ request: request4, headers: header, socket: session[kSocket] });
      }
      const shouldEndStream = method === "GET" || method === "HEAD" || body === null;
      if (expectContinue) {
        headers[HTTP2_HEADER_EXPECT] = "100-continue";
        stream2 = session.request(headers, { endStream: shouldEndStream, signal });
        stream2[kHTTP2Stream] = true;
        stream2.once("continue", writeBodyH2);
      } else {
        stream2 = session.request(headers, {
          endStream: shouldEndStream,
          signal
        });
        stream2[kHTTP2Stream] = true;
        writeBodyH2();
      }
      ++session[kOpenStreams];
      stream2.setTimeout(requestTimeout2);
      let responseReceived = false;
      stream2.once("response", (headers2) => {
        const { [HTTP2_HEADER_STATUS]: statusCode, ...realHeaders } = headers2;
        request4.onResponseStarted();
        responseReceived = true;
        if (request4.aborted) {
          stream2.removeAllListeners("data");
          return;
        }
        if (request4.onHeaders(Number(statusCode), parseH2Headers(realHeaders), stream2.resume.bind(stream2), "") === false) {
          stream2.pause();
        }
        stream2.on("data", (chunk) => {
          if (request4.aborted || request4.completed) {
            return;
          }
          if (request4.onData(chunk) === false) {
            stream2.pause();
          }
        });
      });
      stream2.once("end", () => {
        stream2.removeAllListeners("data");
        if (responseReceived) {
          if (!request4.aborted && !request4.completed) {
            request4.onComplete({});
          }
          client[kQueue][client[kRunningIdx]++] = null;
          client[kResume]();
        } else {
          abort(new InformationalError("HTTP/2: stream half-closed (remote)"));
          client[kQueue][client[kRunningIdx]++] = null;
          client[kPendingIdx] = client[kRunningIdx];
          client[kResume]();
        }
      });
      stream2.once("close", () => {
        stream2.removeAllListeners("data");
        session[kOpenStreams] -= 1;
        if (session[kOpenStreams] === 0) {
          session.unref();
        }
      });
      stream2.once("error", function(err) {
        stream2.removeAllListeners("data");
        abort(err);
      });
      stream2.once("frameError", (type, code) => {
        stream2.removeAllListeners("data");
        abort(new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code}`));
      });
      stream2.on("aborted", () => {
        stream2.removeAllListeners("data");
      });
      stream2.on("timeout", () => {
        const err = new InformationalError(`HTTP/2: "stream timeout after ${requestTimeout2}"`);
        stream2.removeAllListeners("data");
        session[kOpenStreams] -= 1;
        if (session[kOpenStreams] === 0) {
          session.unref();
        }
        abort(err);
      });
      stream2.once("trailers", (trailers) => {
        if (request4.aborted || request4.completed) {
          return;
        }
        stream2.removeAllListeners("data");
        request4.onComplete(trailers);
      });
      return true;
      function writeBodyH2() {
        if (!body || contentLength === 0) {
          writeBuffer(
            abort,
            stream2,
            null,
            client,
            request4,
            client[kSocket],
            contentLength,
            expectsPayload
          );
        } else if (util5.isBuffer(body)) {
          writeBuffer(
            abort,
            stream2,
            body,
            client,
            request4,
            client[kSocket],
            contentLength,
            expectsPayload
          );
        } else if (util5.isBlobLike(body)) {
          if (typeof body.stream === "function") {
            writeIterable(
              abort,
              stream2,
              body.stream(),
              client,
              request4,
              client[kSocket],
              contentLength,
              expectsPayload
            );
          } else {
            writeBlob(
              abort,
              stream2,
              body,
              client,
              request4,
              client[kSocket],
              contentLength,
              expectsPayload
            );
          }
        } else if (util5.isStream(body)) {
          writeStream(
            abort,
            client[kSocket],
            expectsPayload,
            stream2,
            body,
            client,
            request4,
            contentLength
          );
        } else if (util5.isIterable(body)) {
          writeIterable(
            abort,
            stream2,
            body,
            client,
            request4,
            client[kSocket],
            contentLength,
            expectsPayload
          );
        } else {
          assert61(false);
        }
      }
    }
    __name(writeH2, "writeH2");
    function writeBuffer(abort, h2stream, body, client, request4, socket, contentLength, expectsPayload) {
      try {
        if (body != null && util5.isBuffer(body)) {
          assert61(contentLength === body.byteLength, "buffer body must have content length");
          h2stream.cork();
          h2stream.write(body);
          h2stream.uncork();
          h2stream.end();
          request4.onBodySent(body);
        }
        if (!expectsPayload) {
          socket[kReset2] = true;
        }
        request4.onRequestSent();
        client[kResume]();
      } catch (error2) {
        abort(error2);
      }
    }
    __name(writeBuffer, "writeBuffer");
    function writeStream(abort, socket, expectsPayload, h2stream, body, client, request4, contentLength) {
      assert61(contentLength !== 0 || client[kRunning] === 0, "stream body cannot be pipelined");
      const pipe = pipeline(
        body,
        h2stream,
        (err) => {
          if (err) {
            util5.destroy(pipe, err);
            abort(err);
          } else {
            util5.removeAllListeners(pipe);
            request4.onRequestSent();
            if (!expectsPayload) {
              socket[kReset2] = true;
            }
            client[kResume]();
          }
        }
      );
      util5.addListener(pipe, "data", onPipeData);
      function onPipeData(chunk) {
        request4.onBodySent(chunk);
      }
      __name(onPipeData, "onPipeData");
    }
    __name(writeStream, "writeStream");
    async function writeBlob(abort, h2stream, body, client, request4, socket, contentLength, expectsPayload) {
      assert61(contentLength === body.size, "blob body must have content length");
      try {
        if (contentLength != null && contentLength !== body.size) {
          throw new RequestContentLengthMismatchError();
        }
        const buffer = Buffer.from(await body.arrayBuffer());
        h2stream.cork();
        h2stream.write(buffer);
        h2stream.uncork();
        h2stream.end();
        request4.onBodySent(buffer);
        request4.onRequestSent();
        if (!expectsPayload) {
          socket[kReset2] = true;
        }
        client[kResume]();
      } catch (err) {
        abort(err);
      }
    }
    __name(writeBlob, "writeBlob");
    async function writeIterable(abort, h2stream, body, client, request4, socket, contentLength, expectsPayload) {
      assert61(contentLength !== 0 || client[kRunning] === 0, "iterator body cannot be pipelined");
      let callback = null;
      function onDrain() {
        if (callback) {
          const cb2 = callback;
          callback = null;
          cb2();
        }
      }
      __name(onDrain, "onDrain");
      const waitForDrain = /* @__PURE__ */ __name(() => new Promise((resolve32, reject) => {
        assert61(callback === null);
        if (socket[kError]) {
          reject(socket[kError]);
        } else {
          callback = resolve32;
        }
      }), "waitForDrain");
      h2stream.on("close", onDrain).on("drain", onDrain);
      try {
        for await (const chunk of body) {
          if (socket[kError]) {
            throw socket[kError];
          }
          const res = h2stream.write(chunk);
          request4.onBodySent(chunk);
          if (!res) {
            await waitForDrain();
          }
        }
        h2stream.end();
        request4.onRequestSent();
        if (!expectsPayload) {
          socket[kReset2] = true;
        }
        client[kResume]();
      } catch (err) {
        abort(err);
      } finally {
        h2stream.off("close", onDrain).off("drain", onDrain);
      }
    }
    __name(writeIterable, "writeIterable");
    module2.exports = connectH2;
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/dispatcher/client.js
var require_client = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/dispatcher/client.js"(exports, module2) {
    init_import_meta_url();
    var assert61 = __require("assert");
    var net3 = __require("net");
    var http6 = __require("http");
    var util5 = require_util();
    var { ClientStats } = require_stats();
    var { channels } = require_diagnostics();
    var Request7 = require_request();
    var DispatcherBase = require_dispatcher_base();
    var {
      InvalidArgumentError,
      InformationalError,
      ClientDestroyedError
    } = require_errors();
    var buildConnector = require_connect();
    var {
      kUrl,
      kServerName,
      kClient,
      kBusy,
      kConnect,
      kResuming,
      kRunning,
      kPending,
      kSize,
      kQueue,
      kConnected,
      kConnecting,
      kNeedDrain,
      kKeepAliveDefaultTimeout,
      kHostHeader,
      kPendingIdx,
      kRunningIdx,
      kError,
      kPipelining,
      kKeepAliveTimeoutValue,
      kMaxHeadersSize,
      kKeepAliveMaxTimeout,
      kKeepAliveTimeoutThreshold,
      kHeadersTimeout,
      kBodyTimeout,
      kStrictContentLength,
      kConnector,
      kMaxRequests,
      kCounter,
      kClose,
      kDestroy,
      kDispatch,
      kLocalAddress,
      kMaxResponseSize,
      kOnError,
      kHTTPContext,
      kMaxConcurrentStreams,
      kHTTP2InitialWindowSize,
      kHTTP2ConnectionWindowSize,
      kResume,
      kPingInterval
    } = require_symbols();
    var connectH1 = require_client_h1();
    var connectH2 = require_client_h2();
    var kClosedResolve = Symbol("kClosedResolve");
    var getDefaultNodeMaxHeaderSize = http6 && http6.maxHeaderSize && Number.isInteger(http6.maxHeaderSize) && http6.maxHeaderSize > 0 ? () => http6.maxHeaderSize : () => {
      throw new InvalidArgumentError("http module not available or http.maxHeaderSize invalid");
    };
    var noop = /* @__PURE__ */ __name(() => {
    }, "noop");
    function getPipelining(client) {
      return client[kPipelining] ?? client[kHTTPContext]?.defaultPipelining ?? 1;
    }
    __name(getPipelining, "getPipelining");
    var Client2 = class extends DispatcherBase {
      static {
        __name(this, "Client");
      }
      /**
       *
       * @param {string|URL} url
       * @param {import('../../types/client.js').Client.Options} options
       */
      constructor(url4, {
        maxHeaderSize,
        headersTimeout,
        socketTimeout,
        requestTimeout: requestTimeout2,
        connectTimeout,
        bodyTimeout,
        idleTimeout,
        keepAlive,
        keepAliveTimeout,
        maxKeepAliveTimeout,
        keepAliveMaxTimeout,
        keepAliveTimeoutThreshold,
        socketPath,
        pipelining,
        tls,
        strictContentLength,
        maxCachedSessions,
        connect: connect2,
        maxRequestsPerClient,
        localAddress,
        maxResponseSize,
        autoSelectFamily,
        autoSelectFamilyAttemptTimeout,
        // h2
        maxConcurrentStreams,
        allowH2,
        useH2c,
        initialWindowSize,
        connectionWindowSize,
        pingInterval
      } = {}) {
        if (keepAlive !== void 0) {
          throw new InvalidArgumentError("unsupported keepAlive, use pipelining=0 instead");
        }
        if (socketTimeout !== void 0) {
          throw new InvalidArgumentError("unsupported socketTimeout, use headersTimeout & bodyTimeout instead");
        }
        if (requestTimeout2 !== void 0) {
          throw new InvalidArgumentError("unsupported requestTimeout, use headersTimeout & bodyTimeout instead");
        }
        if (idleTimeout !== void 0) {
          throw new InvalidArgumentError("unsupported idleTimeout, use keepAliveTimeout instead");
        }
        if (maxKeepAliveTimeout !== void 0) {
          throw new InvalidArgumentError("unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead");
        }
        if (maxHeaderSize != null) {
          if (!Number.isInteger(maxHeaderSize) || maxHeaderSize < 1) {
            throw new InvalidArgumentError("invalid maxHeaderSize");
          }
        } else {
          maxHeaderSize = getDefaultNodeMaxHeaderSize();
        }
        if (socketPath != null && typeof socketPath !== "string") {
          throw new InvalidArgumentError("invalid socketPath");
        }
        if (connectTimeout != null && (!Number.isFinite(connectTimeout) || connectTimeout < 0)) {
          throw new InvalidArgumentError("invalid connectTimeout");
        }
        if (keepAliveTimeout != null && (!Number.isFinite(keepAliveTimeout) || keepAliveTimeout <= 0)) {
          throw new InvalidArgumentError("invalid keepAliveTimeout");
        }
        if (keepAliveMaxTimeout != null && (!Number.isFinite(keepAliveMaxTimeout) || keepAliveMaxTimeout <= 0)) {
          throw new InvalidArgumentError("invalid keepAliveMaxTimeout");
        }
        if (keepAliveTimeoutThreshold != null && !Number.isFinite(keepAliveTimeoutThreshold)) {
          throw new InvalidArgumentError("invalid keepAliveTimeoutThreshold");
        }
        if (headersTimeout != null && (!Number.isInteger(headersTimeout) || headersTimeout < 0)) {
          throw new InvalidArgumentError("headersTimeout must be a positive integer or zero");
        }
        if (bodyTimeout != null && (!Number.isInteger(bodyTimeout) || bodyTimeout < 0)) {
          throw new InvalidArgumentError("bodyTimeout must be a positive integer or zero");
        }
        if (connect2 != null && typeof connect2 !== "function" && typeof connect2 !== "object") {
          throw new InvalidArgumentError("connect must be a function or an object");
        }
        if (maxRequestsPerClient != null && (!Number.isInteger(maxRequestsPerClient) || maxRequestsPerClient < 0)) {
          throw new InvalidArgumentError("maxRequestsPerClient must be a positive number");
        }
        if (localAddress != null && (typeof localAddress !== "string" || net3.isIP(localAddress) === 0)) {
          throw new InvalidArgumentError("localAddress must be valid string IP address");
        }
        if (maxResponseSize != null && (!Number.isInteger(maxResponseSize) || maxResponseSize < -1)) {
          throw new InvalidArgumentError("maxResponseSize must be a positive number");
        }
        if (autoSelectFamilyAttemptTimeout != null && (!Number.isInteger(autoSelectFamilyAttemptTimeout) || autoSelectFamilyAttemptTimeout < -1)) {
          throw new InvalidArgumentError("autoSelectFamilyAttemptTimeout must be a positive number");
        }
        if (allowH2 != null && typeof allowH2 !== "boolean") {
          throw new InvalidArgumentError("allowH2 must be a valid boolean value");
        }
        if (maxConcurrentStreams != null && (typeof maxConcurrentStreams !== "number" || maxConcurrentStreams < 1)) {
          throw new InvalidArgumentError("maxConcurrentStreams must be a positive integer, greater than 0");
        }
        if (useH2c != null && typeof useH2c !== "boolean") {
          throw new InvalidArgumentError("useH2c must be a valid boolean value");
        }
        if (initialWindowSize != null && (!Number.isInteger(initialWindowSize) || initialWindowSize < 1)) {
          throw new InvalidArgumentError("initialWindowSize must be a positive integer, greater than 0");
        }
        if (connectionWindowSize != null && (!Number.isInteger(connectionWindowSize) || connectionWindowSize < 1)) {
          throw new InvalidArgumentError("connectionWindowSize must be a positive integer, greater than 0");
        }
        if (pingInterval != null && (typeof pingInterval !== "number" || !Number.isInteger(pingInterval) || pingInterval < 0)) {
          throw new InvalidArgumentError("pingInterval must be a positive integer, greater or equal to 0");
        }
        super();
        if (typeof connect2 !== "function") {
          connect2 = buildConnector({
            ...tls,
            maxCachedSessions,
            allowH2,
            useH2c,
            socketPath,
            timeout: connectTimeout,
            ...typeof autoSelectFamily === "boolean" ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : void 0,
            ...connect2
          });
        } else if (socketPath != null) {
          const customConnect = connect2;
          connect2 = /* @__PURE__ */ __name((opts, callback) => customConnect({ ...opts, socketPath }, callback), "connect");
        }
        this[kUrl] = util5.parseOrigin(url4);
        this[kConnector] = connect2;
        this[kPipelining] = pipelining != null ? pipelining : 1;
        this[kMaxHeadersSize] = maxHeaderSize;
        this[kKeepAliveDefaultTimeout] = keepAliveTimeout == null ? 4e3 : keepAliveTimeout;
        this[kKeepAliveMaxTimeout] = keepAliveMaxTimeout == null ? 6e5 : keepAliveMaxTimeout;
        this[kKeepAliveTimeoutThreshold] = keepAliveTimeoutThreshold == null ? 2e3 : keepAliveTimeoutThreshold;
        this[kKeepAliveTimeoutValue] = this[kKeepAliveDefaultTimeout];
        this[kServerName] = null;
        this[kLocalAddress] = localAddress != null ? localAddress : null;
        this[kResuming] = 0;
        this[kNeedDrain] = 0;
        this[kHostHeader] = `host: ${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ""}\r
`;
        this[kBodyTimeout] = bodyTimeout != null ? bodyTimeout : 3e5;
        this[kHeadersTimeout] = headersTimeout != null ? headersTimeout : 3e5;
        this[kStrictContentLength] = strictContentLength == null ? true : strictContentLength;
        this[kMaxRequests] = maxRequestsPerClient;
        this[kClosedResolve] = null;
        this[kMaxResponseSize] = maxResponseSize > -1 ? maxResponseSize : -1;
        this[kHTTPContext] = null;
        this[kMaxConcurrentStreams] = maxConcurrentStreams != null ? maxConcurrentStreams : 100;
        this[kHTTP2InitialWindowSize] = initialWindowSize != null ? initialWindowSize : 262144;
        this[kHTTP2ConnectionWindowSize] = connectionWindowSize != null ? connectionWindowSize : 524288;
        this[kPingInterval] = pingInterval != null ? pingInterval : 6e4;
        this[kQueue] = [];
        this[kRunningIdx] = 0;
        this[kPendingIdx] = 0;
        this[kResume] = (sync) => resume(this, sync);
        this[kOnError] = (err) => onError(this, err);
      }
      get pipelining() {
        return this[kPipelining];
      }
      set pipelining(value) {
        this[kPipelining] = value;
        this[kResume](true);
      }
      get stats() {
        return new ClientStats(this);
      }
      get [kPending]() {
        return this[kQueue].length - this[kPendingIdx];
      }
      get [kRunning]() {
        return this[kPendingIdx] - this[kRunningIdx];
      }
      get [kSize]() {
        return this[kQueue].length - this[kRunningIdx];
      }
      get [kConnected]() {
        return !!this[kHTTPContext] && !this[kConnecting] && !this[kHTTPContext].destroyed;
      }
      get [kBusy]() {
        return Boolean(
          this[kHTTPContext]?.busy(null) || this[kSize] >= (getPipelining(this) || 1) || this[kPending] > 0
        );
      }
      [kConnect](cb2) {
        connect(this);
        this.once("connect", cb2);
      }
      [kDispatch](opts, handler) {
        const request4 = new Request7(this[kUrl].origin, opts, handler);
        this[kQueue].push(request4);
        if (this[kResuming]) ; else if (util5.bodyLength(request4.body) == null && util5.isIterable(request4.body)) {
          this[kResuming] = 1;
          queueMicrotask(() => resume(this));
        } else {
          this[kResume](true);
        }
        if (this[kResuming] && this[kNeedDrain] !== 2 && this[kBusy]) {
          this[kNeedDrain] = 2;
        }
        return this[kNeedDrain] < 2;
      }
      [kClose]() {
        return new Promise((resolve32) => {
          if (this[kSize]) {
            this[kClosedResolve] = resolve32;
          } else {
            resolve32(null);
          }
        });
      }
      [kDestroy](err) {
        return new Promise((resolve32) => {
          const requests = this[kQueue].splice(this[kPendingIdx]);
          for (let i7 = 0; i7 < requests.length; i7++) {
            const request4 = requests[i7];
            util5.errorRequest(this, request4, err);
          }
          const callback = /* @__PURE__ */ __name(() => {
            if (this[kClosedResolve]) {
              this[kClosedResolve]();
              this[kClosedResolve] = null;
            }
            resolve32(null);
          }, "callback");
          if (this[kHTTPContext]) {
            this[kHTTPContext].destroy(err, callback);
            this[kHTTPContext] = null;
          } else {
            queueMicrotask(callback);
          }
          this[kResume]();
        });
      }
    };
    function onError(client, err) {
      if (client[kRunning] === 0 && err.code !== "UND_ERR_INFO" && err.code !== "UND_ERR_SOCKET") {
        assert61(client[kPendingIdx] === client[kRunningIdx]);
        const requests = client[kQueue].splice(client[kRunningIdx]);
        for (let i7 = 0; i7 < requests.length; i7++) {
          const request4 = requests[i7];
          util5.errorRequest(client, request4, err);
        }
        assert61(client[kSize] === 0);
      }
    }
    __name(onError, "onError");
    function connect(client) {
      assert61(!client[kConnecting]);
      assert61(!client[kHTTPContext]);
      let { host, hostname: hostname2, protocol, port } = client[kUrl];
      if (hostname2[0] === "[") {
        const idx = hostname2.indexOf("]");
        assert61(idx !== -1);
        const ip = hostname2.substring(1, idx);
        assert61(net3.isIPv6(ip));
        hostname2 = ip;
      }
      client[kConnecting] = true;
      if (channels.beforeConnect.hasSubscribers) {
        channels.beforeConnect.publish({
          connectParams: {
            host,
            hostname: hostname2,
            protocol,
            port,
            version: client[kHTTPContext]?.version,
            servername: client[kServerName],
            localAddress: client[kLocalAddress]
          },
          connector: client[kConnector]
        });
      }
      client[kConnector]({
        host,
        hostname: hostname2,
        protocol,
        port,
        servername: client[kServerName],
        localAddress: client[kLocalAddress]
      }, (err, socket) => {
        if (err) {
          handleConnectError(client, err, { host, hostname: hostname2, protocol, port });
          client[kResume]();
          return;
        }
        if (client.destroyed) {
          util5.destroy(socket.on("error", noop), new ClientDestroyedError());
          client[kResume]();
          return;
        }
        assert61(socket);
        try {
          client[kHTTPContext] = socket.alpnProtocol === "h2" ? connectH2(client, socket) : connectH1(client, socket);
        } catch (err2) {
          socket.destroy().on("error", noop);
          handleConnectError(client, err2, { host, hostname: hostname2, protocol, port });
          client[kResume]();
          return;
        }
        client[kConnecting] = false;
        socket[kCounter] = 0;
        socket[kMaxRequests] = client[kMaxRequests];
        socket[kClient] = client;
        socket[kError] = null;
        if (channels.connected.hasSubscribers) {
          channels.connected.publish({
            connectParams: {
              host,
              hostname: hostname2,
              protocol,
              port,
              version: client[kHTTPContext]?.version,
              servername: client[kServerName],
              localAddress: client[kLocalAddress]
            },
            connector: client[kConnector],
            socket
          });
        }
        client.emit("connect", client[kUrl], [client]);
        client[kResume]();
      });
    }
    __name(connect, "connect");
    function handleConnectError(client, err, { host, hostname: hostname2, protocol, port }) {
      if (client.destroyed) {
        return;
      }
      client[kConnecting] = false;
      if (channels.connectError.hasSubscribers) {
        channels.connectError.publish({
          connectParams: {
            host,
            hostname: hostname2,
            protocol,
            port,
            version: client[kHTTPContext]?.version,
            servername: client[kServerName],
            localAddress: client[kLocalAddress]
          },
          connector: client[kConnector],
          error: err
        });
      }
      if (err.code === "ERR_TLS_CERT_ALTNAME_INVALID") {
        assert61(client[kRunning] === 0);
        while (client[kPending] > 0 && client[kQueue][client[kPendingIdx]].servername === client[kServerName]) {
          const request4 = client[kQueue][client[kPendingIdx]++];
          util5.errorRequest(client, request4, err);
        }
      } else {
        onError(client, err);
      }
      client.emit("connectionError", client[kUrl], [client], err);
    }
    __name(handleConnectError, "handleConnectError");
    function emitDrain(client) {
      client[kNeedDrain] = 0;
      client.emit("drain", client[kUrl], [client]);
    }
    __name(emitDrain, "emitDrain");
    function resume(client, sync) {
      if (client[kResuming] === 2) {
        return;
      }
      client[kResuming] = 2;
      _resume(client, sync);
      client[kResuming] = 0;
      if (client[kRunningIdx] > 256) {
        client[kQueue].splice(0, client[kRunningIdx]);
        client[kPendingIdx] -= client[kRunningIdx];
        client[kRunningIdx] = 0;
      }
    }
    __name(resume, "resume");
    function _resume(client, sync) {
      while (true) {
        if (client.destroyed) {
          assert61(client[kPending] === 0);
          return;
        }
        if (client[kClosedResolve] && !client[kSize]) {
          client[kClosedResolve]();
          client[kClosedResolve] = null;
          return;
        }
        if (client[kHTTPContext]) {
          client[kHTTPContext].resume();
        }
        if (client[kBusy]) {
          client[kNeedDrain] = 2;
        } else if (client[kNeedDrain] === 2) {
          if (sync) {
            client[kNeedDrain] = 1;
            queueMicrotask(() => emitDrain(client));
          } else {
            emitDrain(client);
          }
          continue;
        }
        if (client[kPending] === 0) {
          return;
        }
        if (client[kRunning] >= (getPipelining(client) || 1)) {
          return;
        }
        const request4 = client[kQueue][client[kPendingIdx]];
        if (request4 === null) {
          return;
        }
        if (client[kUrl].protocol === "https:" && client[kServerName] !== request4.servername) {
          if (client[kRunning] > 0) {
            return;
          }
          client[kServerName] = request4.servername;
          client[kHTTPContext]?.destroy(new InformationalError("servername changed"), () => {
            client[kHTTPContext] = null;
            resume(client);
          });
        }
        if (client[kConnecting]) {
          return;
        }
        if (!client[kHTTPContext]) {
          connect(client);
          return;
        }
        if (client[kHTTPContext].destroyed) {
          return;
        }
        if (client[kHTTPContext].busy(request4)) {
          return;
        }
        if (!request4.aborted && client[kHTTPContext].write(request4)) {
          client[kPendingIdx]++;
        } else {
          client[kQueue].splice(client[kPendingIdx], 1);
        }
      }
    }
    __name(_resume, "_resume");
    module2.exports = Client2;
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/dispatcher/fixed-queue.js
var require_fixed_queue = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/dispatcher/fixed-queue.js"(exports, module2) {
    init_import_meta_url();
    var kSize = 2048;
    var kMask = kSize - 1;
    var FixedCircularBuffer = class {
      static {
        __name(this, "FixedCircularBuffer");
      }
      /** @type {number} */
      bottom = 0;
      /** @type {number} */
      top = 0;
      /** @type {Array<T|undefined>} */
      list = new Array(kSize).fill(void 0);
      /** @type {T|null} */
      next = null;
      /** @returns {boolean} */
      isEmpty() {
        return this.top === this.bottom;
      }
      /** @returns {boolean} */
      isFull() {
        return (this.top + 1 & kMask) === this.bottom;
      }
      /**
       * @param {T} data
       * @returns {void}
       */
      push(data) {
        this.list[this.top] = data;
        this.top = this.top + 1 & kMask;
      }
      /** @returns {T|null} */
      shift() {
        const nextItem = this.list[this.bottom];
        if (nextItem === void 0) {
          return null;
        }
        this.list[this.bottom] = void 0;
        this.bottom = this.bottom + 1 & kMask;
        return nextItem;
      }
    };
    module2.exports = class FixedQueue {
      static {
        __name(this, "FixedQueue");
      }
      constructor() {
        this.head = this.tail = new FixedCircularBuffer();
      }
      /** @returns {boolean} */
      isEmpty() {
        return this.head.isEmpty();
      }
      /** @param {T} data */
      push(data) {
        if (this.head.isFull()) {
          this.head = this.head.next = new FixedCircularBuffer();
        }
        this.head.push(data);
      }
      /** @returns {T|null} */
      shift() {
        const tail = this.tail;
        const next = tail.shift();
        if (tail.isEmpty() && tail.next !== null) {
          this.tail = tail.next;
          tail.next = null;
        }
        return next;
      }
    };
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/dispatcher/pool-base.js
var require_pool_base = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/dispatcher/pool-base.js"(exports, module2) {
    init_import_meta_url();
    var { PoolStats } = require_stats();
    var DispatcherBase = require_dispatcher_base();
    var FixedQueue = require_fixed_queue();
    var { kConnected, kSize, kRunning, kPending, kQueued, kBusy, kFree, kUrl, kClose, kDestroy, kDispatch } = require_symbols();
    var kClients = Symbol("clients");
    var kNeedDrain = Symbol("needDrain");
    var kQueue = Symbol("queue");
    var kClosedResolve = Symbol("closed resolve");
    var kOnDrain = Symbol("onDrain");
    var kOnConnect = Symbol("onConnect");
    var kOnDisconnect = Symbol("onDisconnect");
    var kOnConnectionError = Symbol("onConnectionError");
    var kGetDispatcher = Symbol("get dispatcher");
    var kAddClient = Symbol("add client");
    var kRemoveClient = Symbol("remove client");
    var PoolBase = class extends DispatcherBase {
      static {
        __name(this, "PoolBase");
      }
      [kQueue] = new FixedQueue();
      [kQueued] = 0;
      [kClients] = [];
      [kNeedDrain] = false;
      [kOnDrain](client, origin, targets) {
        const queue = this[kQueue];
        let needDrain = false;
        while (!needDrain) {
          const item = queue.shift();
          if (!item) {
            break;
          }
          this[kQueued]--;
          needDrain = !client.dispatch(item.opts, item.handler);
        }
        client[kNeedDrain] = needDrain;
        if (!needDrain && this[kNeedDrain]) {
          this[kNeedDrain] = false;
          this.emit("drain", origin, [this, ...targets]);
        }
        if (this[kClosedResolve] && queue.isEmpty()) {
          const closeAll = [];
          for (let i7 = 0; i7 < this[kClients].length; i7++) {
            const client2 = this[kClients][i7];
            if (!client2.destroyed) {
              closeAll.push(client2.close());
            }
          }
          return Promise.all(closeAll).then(this[kClosedResolve]);
        }
      }
      [kOnConnect] = (origin, targets) => {
        this.emit("connect", origin, [this, ...targets]);
      };
      [kOnDisconnect] = (origin, targets, err) => {
        this.emit("disconnect", origin, [this, ...targets], err);
      };
      [kOnConnectionError] = (origin, targets, err) => {
        this.emit("connectionError", origin, [this, ...targets], err);
      };
      get [kBusy]() {
        return this[kNeedDrain];
      }
      get [kConnected]() {
        let ret = 0;
        for (const { [kConnected]: connected } of this[kClients]) {
          ret += connected;
        }
        return ret;
      }
      get [kFree]() {
        let ret = 0;
        for (const { [kConnected]: connected, [kNeedDrain]: needDrain } of this[kClients]) {
          ret += connected && !needDrain;
        }
        return ret;
      }
      get [kPending]() {
        let ret = this[kQueued];
        for (const { [kPending]: pending } of this[kClients]) {
          ret += pending;
        }
        return ret;
      }
      get [kRunning]() {
        let ret = 0;
        for (const { [kRunning]: running } of this[kClients]) {
          ret += running;
        }
        return ret;
      }
      get [kSize]() {
        let ret = this[kQueued];
        for (const { [kSize]: size } of this[kClients]) {
          ret += size;
        }
        return ret;
      }
      get stats() {
        return new PoolStats(this);
      }
      [kClose]() {
        if (this[kQueue].isEmpty()) {
          const closeAll = [];
          for (let i7 = 0; i7 < this[kClients].length; i7++) {
            const client = this[kClients][i7];
            if (!client.destroyed) {
              closeAll.push(client.close());
            }
          }
          return Promise.all(closeAll);
        } else {
          return new Promise((resolve32) => {
            this[kClosedResolve] = resolve32;
          });
        }
      }
      [kDestroy](err) {
        while (true) {
          const item = this[kQueue].shift();
          if (!item) {
            break;
          }
          item.handler.onError(err);
        }
        const destroyAll = new Array(this[kClients].length);
        for (let i7 = 0; i7 < this[kClients].length; i7++) {
          destroyAll[i7] = this[kClients][i7].destroy(err);
        }
        return Promise.all(destroyAll);
      }
      [kDispatch](opts, handler) {
        const dispatcher = this[kGetDispatcher]();
        if (!dispatcher) {
          this[kNeedDrain] = true;
          this[kQueue].push({ opts, handler });
          this[kQueued]++;
        } else if (!dispatcher.dispatch(opts, handler)) {
          dispatcher[kNeedDrain] = true;
          this[kNeedDrain] = !this[kGetDispatcher]();
        }
        return !this[kNeedDrain];
      }
      [kAddClient](client) {
        client.on("drain", this[kOnDrain].bind(this, client)).on("connect", this[kOnConnect]).on("disconnect", this[kOnDisconnect]).on("connectionError", this[kOnConnectionError]);
        this[kClients].push(client);
        if (this[kNeedDrain]) {
          queueMicrotask(() => {
            if (this[kNeedDrain]) {
              this[kOnDrain](client, client[kUrl], [client, this]);
            }
          });
        }
        return this;
      }
      [kRemoveClient](client) {
        client.close(() => {
          const idx = this[kClients].indexOf(client);
          if (idx !== -1) {
            this[kClients].splice(idx, 1);
          }
        });
        this[kNeedDrain] = this[kClients].some((dispatcher) => !dispatcher[kNeedDrain] && dispatcher.closed !== true && dispatcher.destroyed !== true);
      }
    };
    module2.exports = {
      PoolBase,
      kClients,
      kNeedDrain,
      kAddClient,
      kRemoveClient,
      kGetDispatcher
    };
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/dispatcher/pool.js
var require_pool = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/dispatcher/pool.js"(exports, module2) {
    init_import_meta_url();
    var {
      PoolBase,
      kClients,
      kNeedDrain,
      kAddClient,
      kGetDispatcher,
      kRemoveClient
    } = require_pool_base();
    var Client2 = require_client();
    var {
      InvalidArgumentError
    } = require_errors();
    var util5 = require_util();
    var { kUrl } = require_symbols();
    var buildConnector = require_connect();
    var kOptions = Symbol("options");
    var kConnections = Symbol("connections");
    var kFactory = Symbol("factory");
    function defaultFactory(origin, opts) {
      return new Client2(origin, opts);
    }
    __name(defaultFactory, "defaultFactory");
    var Pool = class extends PoolBase {
      static {
        __name(this, "Pool");
      }
      constructor(origin, {
        connections,
        factory = defaultFactory,
        connect,
        connectTimeout,
        tls,
        maxCachedSessions,
        socketPath,
        autoSelectFamily,
        autoSelectFamilyAttemptTimeout,
        allowH2,
        clientTtl,
        ...options
      } = {}) {
        if (connections != null && (!Number.isFinite(connections) || connections < 0)) {
          throw new InvalidArgumentError("invalid connections");
        }
        if (typeof factory !== "function") {
          throw new InvalidArgumentError("factory must be a function.");
        }
        if (connect != null && typeof connect !== "function" && typeof connect !== "object") {
          throw new InvalidArgumentError("connect must be a function or an object");
        }
        if (typeof connect !== "function") {
          connect = buildConnector({
            ...tls,
            maxCachedSessions,
            allowH2,
            socketPath,
            timeout: connectTimeout,
            ...typeof autoSelectFamily === "boolean" ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : void 0,
            ...connect
          });
        }
        super();
        this[kConnections] = connections || null;
        this[kUrl] = util5.parseOrigin(origin);
        this[kOptions] = { ...util5.deepClone(options), connect, allowH2, clientTtl, socketPath };
        this[kOptions].interceptors = options.interceptors ? { ...options.interceptors } : void 0;
        this[kFactory] = factory;
        this.on("connect", (origin2, targets) => {
          if (clientTtl != null && clientTtl > 0) {
            for (const target of targets) {
              Object.assign(target, { ttl: Date.now() });
            }
          }
        });
        this.on("connectionError", (origin2, targets, error2) => {
          for (const target of targets) {
            const idx = this[kClients].indexOf(target);
            if (idx !== -1) {
              this[kClients].splice(idx, 1);
            }
          }
        });
      }
      [kGetDispatcher]() {
        const clientTtlOption = this[kOptions].clientTtl;
        for (const client of this[kClients]) {
          if (clientTtlOption != null && clientTtlOption > 0 && client.ttl && Date.now() - client.ttl > clientTtlOption) {
            this[kRemoveClient](client);
          } else if (!client[kNeedDrain]) {
            return client;
          }
        }
        if (!this[kConnections] || this[kClients].length < this[kConnections]) {
          const dispatcher = this[kFactory](this[kUrl], this[kOptions]);
          this[kAddClient](dispatcher);
          return dispatcher;
        }
      }
    };
    module2.exports = Pool;
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/dispatcher/balanced-pool.js
var require_balanced_pool = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/dispatcher/balanced-pool.js"(exports, module2) {
    init_import_meta_url();
    var {
      BalancedPoolMissingUpstreamError,
      InvalidArgumentError
    } = require_errors();
    var {
      PoolBase,
      kClients,
      kNeedDrain,
      kAddClient,
      kRemoveClient,
      kGetDispatcher
    } = require_pool_base();
    var Pool = require_pool();
    var { kUrl } = require_symbols();
    var util5 = require_util();
    var kFactory = Symbol("factory");
    var kOptions = Symbol("options");
    var kGreatestCommonDivisor = Symbol("kGreatestCommonDivisor");
    var kCurrentWeight = Symbol("kCurrentWeight");
    var kIndex = Symbol("kIndex");
    var kWeight = Symbol("kWeight");
    var kMaxWeightPerServer = Symbol("kMaxWeightPerServer");
    var kErrorPenalty = Symbol("kErrorPenalty");
    function getGreatestCommonDivisor(a7, b11) {
      if (a7 === 0) return b11;
      while (b11 !== 0) {
        const t13 = b11;
        b11 = a7 % b11;
        a7 = t13;
      }
      return a7;
    }
    __name(getGreatestCommonDivisor, "getGreatestCommonDivisor");
    function defaultFactory(origin, opts) {
      return new Pool(origin, opts);
    }
    __name(defaultFactory, "defaultFactory");
    var BalancedPool = class extends PoolBase {
      static {
        __name(this, "BalancedPool");
      }
      constructor(upstreams = [], { factory = defaultFactory, ...opts } = {}) {
        if (typeof factory !== "function") {
          throw new InvalidArgumentError("factory must be a function.");
        }
        super();
        this[kOptions] = { ...util5.deepClone(opts) };
        this[kOptions].interceptors = opts.interceptors ? { ...opts.interceptors } : void 0;
        this[kIndex] = -1;
        this[kCurrentWeight] = 0;
        this[kMaxWeightPerServer] = this[kOptions].maxWeightPerServer || 100;
        this[kErrorPenalty] = this[kOptions].errorPenalty || 15;
        if (!Array.isArray(upstreams)) {
          upstreams = [upstreams];
        }
        this[kFactory] = factory;
        for (const upstream of upstreams) {
          this.addUpstream(upstream);
        }
        this._updateBalancedPoolStats();
      }
      addUpstream(upstream) {
        const upstreamOrigin = util5.parseOrigin(upstream).origin;
        if (this[kClients].find((pool2) => pool2[kUrl].origin === upstreamOrigin && pool2.closed !== true && pool2.destroyed !== true)) {
          return this;
        }
        const pool = this[kFactory](upstreamOrigin, this[kOptions]);
        this[kAddClient](pool);
        pool.on("connect", () => {
          pool[kWeight] = Math.min(this[kMaxWeightPerServer], pool[kWeight] + this[kErrorPenalty]);
        });
        pool.on("connectionError", () => {
          pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty]);
          this._updateBalancedPoolStats();
        });
        pool.on("disconnect", (...args) => {
          const err = args[2];
          if (err && err.code === "UND_ERR_SOCKET") {
            pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty]);
            this._updateBalancedPoolStats();
          }
        });
        for (const client of this[kClients]) {
          client[kWeight] = this[kMaxWeightPerServer];
        }
        this._updateBalancedPoolStats();
        return this;
      }
      _updateBalancedPoolStats() {
        let result = 0;
        for (let i7 = 0; i7 < this[kClients].length; i7++) {
          result = getGreatestCommonDivisor(this[kClients][i7][kWeight], result);
        }
        this[kGreatestCommonDivisor] = result;
      }
      removeUpstream(upstream) {
        const upstreamOrigin = util5.parseOrigin(upstream).origin;
        const pool = this[kClients].find((pool2) => pool2[kUrl].origin === upstreamOrigin && pool2.closed !== true && pool2.destroyed !== true);
        if (pool) {
          this[kRemoveClient](pool);
        }
        return this;
      }
      getUpstream(upstream) {
        const upstreamOrigin = util5.parseOrigin(upstream).origin;
        return this[kClients].find((pool) => pool[kUrl].origin === upstreamOrigin && pool.closed !== true && pool.destroyed !== true);
      }
      get upstreams() {
        return this[kClients].filter((dispatcher) => dispatcher.closed !== true && dispatcher.destroyed !== true).map((p7) => p7[kUrl].origin);
      }
      [kGetDispatcher]() {
        if (this[kClients].length === 0) {
          throw new BalancedPoolMissingUpstreamError();
        }
        const dispatcher = this[kClients].find((dispatcher2) => !dispatcher2[kNeedDrain] && dispatcher2.closed !== true && dispatcher2.destroyed !== true);
        if (!dispatcher) {
          return;
        }
        const allClientsBusy = this[kClients].map((pool) => pool[kNeedDrain]).reduce((a7, b11) => a7 && b11, true);
        if (allClientsBusy) {
          return;
        }
        let counter = 0;
        let maxWeightIndex = this[kClients].findIndex((pool) => !pool[kNeedDrain]);
        while (counter++ < this[kClients].length) {
          this[kIndex] = (this[kIndex] + 1) % this[kClients].length;
          const pool = this[kClients][this[kIndex]];
          if (pool[kWeight] > this[kClients][maxWeightIndex][kWeight] && !pool[kNeedDrain]) {
            maxWeightIndex = this[kIndex];
          }
          if (this[kIndex] === 0) {
            this[kCurrentWeight] = this[kCurrentWeight] - this[kGreatestCommonDivisor];
            if (this[kCurrentWeight] <= 0) {
              this[kCurrentWeight] = this[kMaxWeightPerServer];
            }
          }
          if (pool[kWeight] >= this[kCurrentWeight] && !pool[kNeedDrain]) {
            return pool;
          }
        }
        this[kCurrentWeight] = this[kClients][maxWeightIndex][kWeight];
        this[kIndex] = maxWeightIndex;
        return this[kClients][maxWeightIndex];
      }
    };
    module2.exports = BalancedPool;
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/dispatcher/round-robin-pool.js
var require_round_robin_pool = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/dispatcher/round-robin-pool.js"(exports, module2) {
    init_import_meta_url();
    var {
      PoolBase,
      kClients,
      kNeedDrain,
      kAddClient,
      kGetDispatcher,
      kRemoveClient
    } = require_pool_base();
    var Client2 = require_client();
    var {
      InvalidArgumentError
    } = require_errors();
    var util5 = require_util();
    var { kUrl } = require_symbols();
    var buildConnector = require_connect();
    var kOptions = Symbol("options");
    var kConnections = Symbol("connections");
    var kFactory = Symbol("factory");
    var kIndex = Symbol("index");
    function defaultFactory(origin, opts) {
      return new Client2(origin, opts);
    }
    __name(defaultFactory, "defaultFactory");
    var RoundRobinPool = class extends PoolBase {
      static {
        __name(this, "RoundRobinPool");
      }
      constructor(origin, {
        connections,
        factory = defaultFactory,
        connect,
        connectTimeout,
        tls,
        maxCachedSessions,
        socketPath,
        autoSelectFamily,
        autoSelectFamilyAttemptTimeout,
        allowH2,
        clientTtl,
        ...options
      } = {}) {
        if (connections != null && (!Number.isFinite(connections) || connections < 0)) {
          throw new InvalidArgumentError("invalid connections");
        }
        if (typeof factory !== "function") {
          throw new InvalidArgumentError("factory must be a function.");
        }
        if (connect != null && typeof connect !== "function" && typeof connect !== "object") {
          throw new InvalidArgumentError("connect must be a function or an object");
        }
        if (typeof connect !== "function") {
          connect = buildConnector({
            ...tls,
            maxCachedSessions,
            allowH2,
            socketPath,
            timeout: connectTimeout,
            ...typeof autoSelectFamily === "boolean" ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : void 0,
            ...connect
          });
        }
        super();
        this[kConnections] = connections || null;
        this[kUrl] = util5.parseOrigin(origin);
        this[kOptions] = { ...util5.deepClone(options), connect, allowH2, clientTtl, socketPath };
        this[kOptions].interceptors = options.interceptors ? { ...options.interceptors } : void 0;
        this[kFactory] = factory;
        this[kIndex] = -1;
        this.on("connect", (origin2, targets) => {
          if (clientTtl != null && clientTtl > 0) {
            for (const target of targets) {
              Object.assign(target, { ttl: Date.now() });
            }
          }
        });
        this.on("connectionError", (origin2, targets, error2) => {
          for (const target of targets) {
            const idx = this[kClients].indexOf(target);
            if (idx !== -1) {
              this[kClients].splice(idx, 1);
            }
          }
        });
      }
      [kGetDispatcher]() {
        const clientTtlOption = this[kOptions].clientTtl;
        const clientsLength = this[kClients].length;
        if (clientsLength === 0) {
          const dispatcher = this[kFactory](this[kUrl], this[kOptions]);
          this[kAddClient](dispatcher);
          return dispatcher;
        }
        let checked = 0;
        while (checked < clientsLength) {
          this[kIndex] = (this[kIndex] + 1) % clientsLength;
          const client = this[kClients][this[kIndex]];
          if (clientTtlOption != null && clientTtlOption > 0 && client.ttl && Date.now() - client.ttl > clientTtlOption) {
            this[kRemoveClient](client);
            checked++;
            continue;
          }
          if (!client[kNeedDrain]) {
            return client;
          }
          checked++;
        }
        if (!this[kConnections] || clientsLength < this[kConnections]) {
          const dispatcher = this[kFactory](this[kUrl], this[kOptions]);
          this[kAddClient](dispatcher);
          return dispatcher;
        }
      }
    };
    module2.exports = RoundRobinPool;
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/dispatcher/agent.js
var require_agent = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/dispatcher/agent.js"(exports, module2) {
    init_import_meta_url();
    var { InvalidArgumentError, MaxOriginsReachedError } = require_errors();
    var { kClients, kRunning, kClose, kDestroy, kDispatch, kUrl } = require_symbols();
    var DispatcherBase = require_dispatcher_base();
    var Pool = require_pool();
    var Client2 = require_client();
    var util5 = require_util();
    var kOnConnect = Symbol("onConnect");
    var kOnDisconnect = Symbol("onDisconnect");
    var kOnConnectionError = Symbol("onConnectionError");
    var kOnDrain = Symbol("onDrain");
    var kFactory = Symbol("factory");
    var kOptions = Symbol("options");
    var kOrigins = Symbol("origins");
    function defaultFactory(origin, opts) {
      return opts && opts.connections === 1 ? new Client2(origin, opts) : new Pool(origin, opts);
    }
    __name(defaultFactory, "defaultFactory");
    var Agent = class extends DispatcherBase {
      static {
        __name(this, "Agent");
      }
      constructor({ factory = defaultFactory, maxOrigins = Infinity, connect, ...options } = {}) {
        if (typeof factory !== "function") {
          throw new InvalidArgumentError("factory must be a function.");
        }
        if (connect != null && typeof connect !== "function" && typeof connect !== "object") {
          throw new InvalidArgumentError("connect must be a function or an object");
        }
        if (typeof maxOrigins !== "number" || Number.isNaN(maxOrigins) || maxOrigins <= 0) {
          throw new InvalidArgumentError("maxOrigins must be a number greater than 0");
        }
        super();
        if (connect && typeof connect !== "function") {
          connect = { ...connect };
        }
        this[kOptions] = { ...util5.deepClone(options), maxOrigins, connect };
        this[kFactory] = factory;
        this[kClients] = /* @__PURE__ */ new Map();
        this[kOrigins] = /* @__PURE__ */ new Set();
        this[kOnDrain] = (origin, targets) => {
          this.emit("drain", origin, [this, ...targets]);
        };
        this[kOnConnect] = (origin, targets) => {
          this.emit("connect", origin, [this, ...targets]);
        };
        this[kOnDisconnect] = (origin, targets, err) => {
          this.emit("disconnect", origin, [this, ...targets], err);
        };
        this[kOnConnectionError] = (origin, targets, err) => {
          this.emit("connectionError", origin, [this, ...targets], err);
        };
      }
      get [kRunning]() {
        let ret = 0;
        for (const { dispatcher } of this[kClients].values()) {
          ret += dispatcher[kRunning];
        }
        return ret;
      }
      [kDispatch](opts, handler) {
        let key;
        if (opts.origin && (typeof opts.origin === "string" || opts.origin instanceof URL)) {
          key = String(opts.origin);
        } else {
          throw new InvalidArgumentError("opts.origin must be a non-empty string or URL.");
        }
        if (this[kOrigins].size >= this[kOptions].maxOrigins && !this[kOrigins].has(key)) {
          throw new MaxOriginsReachedError();
        }
        const result = this[kClients].get(key);
        let dispatcher = result && result.dispatcher;
        if (!dispatcher) {
          const closeClientIfUnused = /* @__PURE__ */ __name((connected) => {
            const result2 = this[kClients].get(key);
            if (result2) {
              if (connected) result2.count -= 1;
              if (result2.count <= 0) {
                this[kClients].delete(key);
                if (!result2.dispatcher.destroyed) {
                  result2.dispatcher.close();
                }
              }
              this[kOrigins].delete(key);
            }
          }, "closeClientIfUnused");
          dispatcher = this[kFactory](opts.origin, this[kOptions]).on("drain", this[kOnDrain]).on("connect", (origin, targets) => {
            const result2 = this[kClients].get(key);
            if (result2) {
              result2.count += 1;
            }
            this[kOnConnect](origin, targets);
          }).on("disconnect", (origin, targets, err) => {
            closeClientIfUnused(true);
            this[kOnDisconnect](origin, targets, err);
          }).on("connectionError", (origin, targets, err) => {
            closeClientIfUnused(false);
            this[kOnConnectionError](origin, targets, err);
          });
          this[kClients].set(key, { count: 0, dispatcher });
          this[kOrigins].add(key);
        }
        return dispatcher.dispatch(opts, handler);
      }
      [kClose]() {
        const closePromises = [];
        for (const { dispatcher } of this[kClients].values()) {
          closePromises.push(dispatcher.close());
        }
        this[kClients].clear();
        return Promise.all(closePromises);
      }
      [kDestroy](err) {
        const destroyPromises = [];
        for (const { dispatcher } of this[kClients].values()) {
          destroyPromises.push(dispatcher.destroy(err));
        }
        this[kClients].clear();
        return Promise.all(destroyPromises);
      }
      get stats() {
        const allClientStats = {};
        for (const { dispatcher } of this[kClients].values()) {
          if (dispatcher.stats) {
            allClientStats[dispatcher[kUrl].origin] = dispatcher.stats;
          }
        }
        return allClientStats;
      }
    };
    module2.exports = Agent;
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/core/socks5-utils.js
var require_socks5_utils = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/core/socks5-utils.js"(exports, module2) {
    init_import_meta_url();
    var { Buffer: Buffer8 } = __require("buffer");
    var net3 = __require("net");
    var { InvalidArgumentError } = require_errors();
    function parseAddress(address) {
      if (net3.isIPv4(address)) {
        const parts = address.split(".").map(Number);
        return {
          type: 1,
          // IPv4
          buffer: Buffer8.from(parts)
        };
      }
      if (net3.isIPv6(address)) {
        return {
          type: 4,
          // IPv6
          buffer: parseIPv6(address)
        };
      }
      const domainBuffer = Buffer8.from(address, "utf8");
      if (domainBuffer.length > 255) {
        throw new InvalidArgumentError("Domain name too long (max 255 bytes)");
      }
      return {
        type: 3,
        // Domain
        buffer: Buffer8.concat([Buffer8.from([domainBuffer.length]), domainBuffer])
      };
    }
    __name(parseAddress, "parseAddress");
    function parseIPv6(address) {
      const buffer = Buffer8.alloc(16);
      const parts = address.split(":");
      let partIndex = 0;
      let bufferIndex = 0;
      const doubleColonIndex = address.indexOf("::");
      if (doubleColonIndex !== -1) {
        const nonEmptyParts = parts.filter((p7) => p7.length > 0).length;
        const skipParts = 8 - nonEmptyParts;
        for (let i7 = 0; i7 < parts.length; i7++) {
          if (parts[i7] === "" && i7 === doubleColonIndex / 3) {
            bufferIndex += skipParts * 2;
          } else if (parts[i7] !== "") {
            const value = parseInt(parts[i7], 16);
            buffer.writeUInt16BE(value, bufferIndex);
            bufferIndex += 2;
          }
        }
      } else {
        for (const part of parts) {
          if (part === "") continue;
          const value = parseInt(part, 16);
          buffer.writeUInt16BE(value, partIndex * 2);
          partIndex++;
        }
      }
      return buffer;
    }
    __name(parseIPv6, "parseIPv6");
    function buildAddressBuffer(type, addressBuffer, port) {
      const portBuffer = Buffer8.allocUnsafe(2);
      portBuffer.writeUInt16BE(port, 0);
      return Buffer8.concat([
        Buffer8.from([type]),
        addressBuffer,
        portBuffer
      ]);
    }
    __name(buildAddressBuffer, "buildAddressBuffer");
    function parseResponseAddress(buffer, offset = 0) {
      if (buffer.length < offset + 1) {
        throw new InvalidArgumentError("Buffer too small to contain address type");
      }
      const addressType = buffer[offset];
      let address;
      let currentOffset = offset + 1;
      switch (addressType) {
        case 1: {
          if (buffer.length < currentOffset + 6) {
            throw new InvalidArgumentError("Buffer too small for IPv4 address");
          }
          address = Array.from(buffer.subarray(currentOffset, currentOffset + 4)).join(".");
          currentOffset += 4;
          break;
        }
        case 3: {
          if (buffer.length < currentOffset + 1) {
            throw new InvalidArgumentError("Buffer too small for domain length");
          }
          const domainLength = buffer[currentOffset];
          currentOffset += 1;
          if (buffer.length < currentOffset + domainLength + 2) {
            throw new InvalidArgumentError("Buffer too small for domain address");
          }
          address = buffer.subarray(currentOffset, currentOffset + domainLength).toString("utf8");
          currentOffset += domainLength;
          break;
        }
        case 4: {
          if (buffer.length < currentOffset + 18) {
            throw new InvalidArgumentError("Buffer too small for IPv6 address");
          }
          const parts = [];
          for (let i7 = 0; i7 < 8; i7++) {
            const value = buffer.readUInt16BE(currentOffset + i7 * 2);
            parts.push(value.toString(16));
          }
          address = parts.join(":");
          currentOffset += 16;
          break;
        }
        default:
          throw new InvalidArgumentError(`Invalid address type: ${addressType}`);
      }
      if (buffer.length < currentOffset + 2) {
        throw new InvalidArgumentError("Buffer too small for port");
      }
      const port = buffer.readUInt16BE(currentOffset);
      currentOffset += 2;
      return {
        address,
        port,
        bytesRead: currentOffset - offset
      };
    }
    __name(parseResponseAddress, "parseResponseAddress");
    function createReplyError(replyCode) {
      const messages = {
        1: "General SOCKS server failure",
        2: "Connection not allowed by ruleset",
        3: "Network unreachable",
        4: "Host unreachable",
        5: "Connection refused",
        6: "TTL expired",
        7: "Command not supported",
        8: "Address type not supported"
      };
      const message = messages[replyCode] || `Unknown SOCKS5 error code: ${replyCode}`;
      const error2 = new Error(message);
      error2.code = `SOCKS5_${replyCode}`;
      return error2;
    }
    __name(createReplyError, "createReplyError");
    module2.exports = {
      parseAddress,
      parseIPv6,
      buildAddressBuffer,
      parseResponseAddress,
      createReplyError
    };
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/core/socks5-client.js
var require_socks5_client = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/core/socks5-client.js"(exports, module2) {
    init_import_meta_url();
    var { EventEmitter: EventEmitter5 } = __require("events");
    var { Buffer: Buffer8 } = __require("buffer");
    var { InvalidArgumentError, Socks5ProxyError } = require_errors();
    var { debuglog } = __require("util");
    var { parseAddress } = require_socks5_utils();
    var debug2 = debuglog("undici:socks5");
    var SOCKS_VERSION = 5;
    var AUTH_METHODS = {
      NO_AUTH: 0,
      GSSAPI: 1,
      USERNAME_PASSWORD: 2,
      NO_ACCEPTABLE: 255
    };
    var COMMANDS = {
      CONNECT: 1,
      BIND: 2,
      UDP_ASSOCIATE: 3
    };
    var ADDRESS_TYPES = {
      IPV4: 1,
      DOMAIN: 3,
      IPV6: 4
    };
    var REPLY_CODES = {
      SUCCEEDED: 0,
      GENERAL_FAILURE: 1,
      CONNECTION_NOT_ALLOWED: 2,
      NETWORK_UNREACHABLE: 3,
      HOST_UNREACHABLE: 4,
      CONNECTION_REFUSED: 5,
      TTL_EXPIRED: 6,
      COMMAND_NOT_SUPPORTED: 7,
      ADDRESS_TYPE_NOT_SUPPORTED: 8
    };
    var STATES = {
      INITIAL: "initial",
      HANDSHAKING: "handshaking",
      AUTHENTICATING: "authenticating",
      CONNECTING: "connecting",
      CONNECTED: "connected",
      ERROR: "error",
      CLOSED: "closed"
    };
    var Socks5Client = class extends EventEmitter5 {
      static {
        __name(this, "Socks5Client");
      }
      constructor(socket, options = {}) {
        super();
        if (!socket) {
          throw new InvalidArgumentError("socket is required");
        }
        this.socket = socket;
        this.options = options;
        this.state = STATES.INITIAL;
        this.buffer = Buffer8.alloc(0);
        this.authMethods = [];
        if (options.username && options.password) {
          this.authMethods.push(AUTH_METHODS.USERNAME_PASSWORD);
        }
        this.authMethods.push(AUTH_METHODS.NO_AUTH);
        this.socket.on("data", this.onData.bind(this));
        this.socket.on("error", this.onError.bind(this));
        this.socket.on("close", this.onClose.bind(this));
      }
      /**
       * Handle incoming data from the socket
       */
      onData(data) {
        debug2("received data", data.length, "bytes in state", this.state);
        this.buffer = Buffer8.concat([this.buffer, data]);
        try {
          switch (this.state) {
            case STATES.HANDSHAKING:
              this.handleHandshakeResponse();
              break;
            case STATES.AUTHENTICATING:
              this.handleAuthResponse();
              break;
            case STATES.CONNECTING:
              this.handleConnectResponse();
              break;
          }
        } catch (err) {
          this.onError(err);
        }
      }
      /**
       * Handle socket errors
       */
      onError(err) {
        debug2("socket error", err);
        this.state = STATES.ERROR;
        this.emit("error", err);
        this.destroy();
      }
      /**
       * Handle socket close
       */
      onClose() {
        debug2("socket closed");
        this.state = STATES.CLOSED;
        this.emit("close");
      }
      /**
       * Destroy the client and underlying socket
       */
      destroy() {
        if (this.socket && !this.socket.destroyed) {
          this.socket.destroy();
        }
      }
      /**
       * Start the SOCKS5 handshake
       */
      handshake() {
        if (this.state !== STATES.INITIAL) {
          throw new InvalidArgumentError("Handshake already started");
        }
        debug2("starting handshake with", this.authMethods.length, "auth methods");
        this.state = STATES.HANDSHAKING;
        const request4 = Buffer8.alloc(2 + this.authMethods.length);
        request4[0] = SOCKS_VERSION;
        request4[1] = this.authMethods.length;
        this.authMethods.forEach((method, i7) => {
          request4[2 + i7] = method;
        });
        this.socket.write(request4);
      }
      /**
       * Handle handshake response from server
       */
      handleHandshakeResponse() {
        if (this.buffer.length < 2) {
          return;
        }
        const version5 = this.buffer[0];
        const method = this.buffer[1];
        if (version5 !== SOCKS_VERSION) {
          throw new Socks5ProxyError(`Invalid SOCKS version: ${version5}`, "UND_ERR_SOCKS5_VERSION");
        }
        if (method === AUTH_METHODS.NO_ACCEPTABLE) {
          throw new Socks5ProxyError("No acceptable authentication method", "UND_ERR_SOCKS5_AUTH_REJECTED");
        }
        this.buffer = this.buffer.subarray(2);
        debug2("server selected auth method", method);
        if (method === AUTH_METHODS.NO_AUTH) {
          this.emit("authenticated");
        } else if (method === AUTH_METHODS.USERNAME_PASSWORD) {
          this.state = STATES.AUTHENTICATING;
          this.sendAuthRequest();
        } else {
          throw new Socks5ProxyError(`Unsupported authentication method: ${method}`, "UND_ERR_SOCKS5_AUTH_METHOD");
        }
      }
      /**
       * Send username/password authentication request
       */
      sendAuthRequest() {
        const { username, password } = this.options;
        if (!username || !password) {
          throw new InvalidArgumentError("Username and password required for authentication");
        }
        debug2("sending username/password auth");
        const usernameBuffer = Buffer8.from(username);
        const passwordBuffer = Buffer8.from(password);
        if (usernameBuffer.length > 255 || passwordBuffer.length > 255) {
          throw new InvalidArgumentError("Username or password too long");
        }
        const request4 = Buffer8.alloc(3 + usernameBuffer.length + passwordBuffer.length);
        request4[0] = 1;
        request4[1] = usernameBuffer.length;
        usernameBuffer.copy(request4, 2);
        request4[2 + usernameBuffer.length] = passwordBuffer.length;
        passwordBuffer.copy(request4, 3 + usernameBuffer.length);
        this.socket.write(request4);
      }
      /**
       * Handle authentication response
       */
      handleAuthResponse() {
        if (this.buffer.length < 2) {
          return;
        }
        const version5 = this.buffer[0];
        const status2 = this.buffer[1];
        if (version5 !== 1) {
          throw new Socks5ProxyError(`Invalid auth sub-negotiation version: ${version5}`, "UND_ERR_SOCKS5_AUTH_VERSION");
        }
        if (status2 !== 0) {
          throw new Socks5ProxyError("Authentication failed", "UND_ERR_SOCKS5_AUTH_FAILED");
        }
        this.buffer = this.buffer.subarray(2);
        debug2("authentication successful");
        this.emit("authenticated");
      }
      /**
       * Send CONNECT command
       * @param {string} address - Target address (IP or domain)
       * @param {number} port - Target port
       */
      connect(address, port) {
        if (this.state === STATES.CONNECTED) {
          throw new InvalidArgumentError("Already connected");
        }
        debug2("connecting to", address, port);
        this.state = STATES.CONNECTING;
        const request4 = this.buildConnectRequest(COMMANDS.CONNECT, address, port);
        this.socket.write(request4);
      }
      /**
       * Build a SOCKS5 request
       */
      buildConnectRequest(command2, address, port) {
        const { type: addressType, buffer: addressBuffer } = parseAddress(address);
        const request4 = Buffer8.alloc(4 + addressBuffer.length + 2);
        request4[0] = SOCKS_VERSION;
        request4[1] = command2;
        request4[2] = 0;
        request4[3] = addressType;
        addressBuffer.copy(request4, 4);
        request4.writeUInt16BE(port, 4 + addressBuffer.length);
        return request4;
      }
      /**
       * Handle CONNECT response
       */
      handleConnectResponse() {
        if (this.buffer.length < 4) {
          return;
        }
        const version5 = this.buffer[0];
        const reply = this.buffer[1];
        const addressType = this.buffer[3];
        if (version5 !== SOCKS_VERSION) {
          throw new Socks5ProxyError(`Invalid SOCKS version in reply: ${version5}`, "UND_ERR_SOCKS5_REPLY_VERSION");
        }
        let responseLength = 4;
        if (addressType === ADDRESS_TYPES.IPV4) {
          responseLength += 4 + 2;
        } else if (addressType === ADDRESS_TYPES.DOMAIN) {
          if (this.buffer.length < 5) {
            return;
          }
          responseLength += 1 + this.buffer[4] + 2;
        } else if (addressType === ADDRESS_TYPES.IPV6) {
          responseLength += 16 + 2;
        } else {
          throw new Socks5ProxyError(`Invalid address type in reply: ${addressType}`, "UND_ERR_SOCKS5_ADDR_TYPE");
        }
        if (this.buffer.length < responseLength) {
          return;
        }
        if (reply !== REPLY_CODES.SUCCEEDED) {
          const errorMessage = this.getReplyErrorMessage(reply);
          throw new Socks5ProxyError(`SOCKS5 connection failed: ${errorMessage}`, `UND_ERR_SOCKS5_REPLY_${reply}`);
        }
        let boundAddress;
        let offset = 4;
        if (addressType === ADDRESS_TYPES.IPV4) {
          boundAddress = Array.from(this.buffer.subarray(offset, offset + 4)).join(".");
          offset += 4;
        } else if (addressType === ADDRESS_TYPES.DOMAIN) {
          const domainLength = this.buffer[offset];
          offset += 1;
          boundAddress = this.buffer.subarray(offset, offset + domainLength).toString();
          offset += domainLength;
        } else if (addressType === ADDRESS_TYPES.IPV6) {
          const parts = [];
          for (let i7 = 0; i7 < 8; i7++) {
            const value = this.buffer.readUInt16BE(offset + i7 * 2);
            parts.push(value.toString(16));
          }
          boundAddress = parts.join(":");
          offset += 16;
        }
        const boundPort = this.buffer.readUInt16BE(offset);
        this.buffer = this.buffer.subarray(responseLength);
        this.state = STATES.CONNECTED;
        debug2("connected, bound address:", boundAddress, "port:", boundPort);
        this.emit("connected", { address: boundAddress, port: boundPort });
      }
      /**
       * Get human-readable error message for reply code
       */
      getReplyErrorMessage(reply) {
        switch (reply) {
          case REPLY_CODES.GENERAL_FAILURE:
            return "General SOCKS server failure";
          case REPLY_CODES.CONNECTION_NOT_ALLOWED:
            return "Connection not allowed by ruleset";
          case REPLY_CODES.NETWORK_UNREACHABLE:
            return "Network unreachable";
          case REPLY_CODES.HOST_UNREACHABLE:
            return "Host unreachable";
          case REPLY_CODES.CONNECTION_REFUSED:
            return "Connection refused";
          case REPLY_CODES.TTL_EXPIRED:
            return "TTL expired";
          case REPLY_CODES.COMMAND_NOT_SUPPORTED:
            return "Command not supported";
          case REPLY_CODES.ADDRESS_TYPE_NOT_SUPPORTED:
            return "Address type not supported";
          default:
            return `Unknown error code: ${reply}`;
        }
      }
    };
    module2.exports = {
      Socks5Client,
      AUTH_METHODS,
      COMMANDS,
      ADDRESS_TYPES,
      REPLY_CODES,
      STATES
    };
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/dispatcher/socks5-proxy-agent.js
var require_socks5_proxy_agent = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/dispatcher/socks5-proxy-agent.js"(exports, module2) {
    init_import_meta_url();
    var net3 = __require("net");
    var { URL: URL8 } = __require("url");
    var tls;
    var DispatcherBase = require_dispatcher_base();
    var { InvalidArgumentError } = require_errors();
    var { Socks5Client } = require_socks5_client();
    var { kDispatch, kClose, kDestroy } = require_symbols();
    var Pool = require_pool();
    var buildConnector = require_connect();
    var { debuglog } = __require("util");
    var debug2 = debuglog("undici:socks5-proxy");
    var kProxyUrl = Symbol("proxy url");
    var kProxyHeaders = Symbol("proxy headers");
    var kProxyAuth = Symbol("proxy auth");
    var kPool = Symbol("pool");
    var kConnector = Symbol("connector");
    var experimentalWarningEmitted = false;
    var Socks5ProxyAgent = class extends DispatcherBase {
      static {
        __name(this, "Socks5ProxyAgent");
      }
      constructor(proxyUrl, options = {}) {
        super();
        if (!experimentalWarningEmitted) {
          process.emitWarning(
            "SOCKS5 proxy support is experimental and subject to change",
            "ExperimentalWarning"
          );
          experimentalWarningEmitted = true;
        }
        if (!proxyUrl) {
          throw new InvalidArgumentError("Proxy URL is mandatory");
        }
        const url4 = typeof proxyUrl === "string" ? new URL8(proxyUrl) : proxyUrl;
        if (url4.protocol !== "socks5:" && url4.protocol !== "socks:") {
          throw new InvalidArgumentError("Proxy URL must use socks5:// or socks:// protocol");
        }
        this[kProxyUrl] = url4;
        this[kProxyHeaders] = options.headers || {};
        this[kProxyAuth] = {
          username: options.username || (url4.username ? decodeURIComponent(url4.username) : null),
          password: options.password || (url4.password ? decodeURIComponent(url4.password) : null)
        };
        this[kConnector] = options.connect || buildConnector({
          ...options.proxyTls,
          servername: options.proxyTls?.servername || url4.hostname
        });
        this[kPool] = null;
      }
      /**
       * Create a SOCKS5 connection to the proxy
       */
      async createSocks5Connection(targetHost, targetPort) {
        const proxyHost = this[kProxyUrl].hostname;
        const proxyPort = parseInt(this[kProxyUrl].port) || 1080;
        debug2("creating SOCKS5 connection to", proxyHost, proxyPort);
        const socket = await new Promise((resolve32, reject) => {
          const onConnect = /* @__PURE__ */ __name(() => {
            socket2.removeListener("error", onError);
            resolve32(socket2);
          }, "onConnect");
          const onError = /* @__PURE__ */ __name((err) => {
            socket2.removeListener("connect", onConnect);
            reject(err);
          }, "onError");
          const socket2 = net3.connect({
            host: proxyHost,
            port: proxyPort
          });
          socket2.once("connect", onConnect);
          socket2.once("error", onError);
        });
        const socks5Client = new Socks5Client(socket, this[kProxyAuth]);
        socks5Client.on("error", (err) => {
          debug2("SOCKS5 error:", err);
          socket.destroy();
        });
        await socks5Client.handshake();
        await new Promise((resolve32, reject) => {
          const timeout2 = setTimeout(() => {
            reject(new Error("SOCKS5 authentication timeout"));
          }, 5e3);
          const onAuthenticated = /* @__PURE__ */ __name(() => {
            clearTimeout(timeout2);
            socks5Client.removeListener("error", onError);
            resolve32();
          }, "onAuthenticated");
          const onError = /* @__PURE__ */ __name((err) => {
            clearTimeout(timeout2);
            socks5Client.removeListener("authenticated", onAuthenticated);
            reject(err);
          }, "onError");
          if (socks5Client.state === "authenticated") {
            clearTimeout(timeout2);
            resolve32();
          } else {
            socks5Client.once("authenticated", onAuthenticated);
            socks5Client.once("error", onError);
          }
        });
        await socks5Client.connect(targetHost, targetPort);
        await new Promise((resolve32, reject) => {
          const timeout2 = setTimeout(() => {
            reject(new Error("SOCKS5 connection timeout"));
          }, 5e3);
          const onConnected = /* @__PURE__ */ __name((info) => {
            debug2("SOCKS5 tunnel established to", targetHost, targetPort, "via", info);
            clearTimeout(timeout2);
            socks5Client.removeListener("error", onError);
            resolve32();
          }, "onConnected");
          const onError = /* @__PURE__ */ __name((err) => {
            clearTimeout(timeout2);
            socks5Client.removeListener("connected", onConnected);
            reject(err);
          }, "onError");
          socks5Client.once("connected", onConnected);
          socks5Client.once("error", onError);
        });
        return socket;
      }
      /**
       * Dispatch a request through the SOCKS5 proxy
       */
      async [kDispatch](opts, handler) {
        const { origin } = opts;
        debug2("dispatching request to", origin, "via SOCKS5");
        try {
          if (!this[kPool] || this[kPool].destroyed || this[kPool].closed) {
            this[kPool] = new Pool(origin, {
              pipelining: opts.pipelining,
              connections: opts.connections,
              connect: /* @__PURE__ */ __name(async (connectOpts, callback) => {
                try {
                  const url4 = new URL8(origin);
                  const targetHost = url4.hostname;
                  const targetPort = parseInt(url4.port) || (url4.protocol === "https:" ? 443 : 80);
                  debug2("establishing SOCKS5 connection to", targetHost, targetPort);
                  const socket = await this.createSocks5Connection(targetHost, targetPort);
                  let finalSocket = socket;
                  if (url4.protocol === "https:") {
                    if (!tls) {
                      tls = __require("tls");
                    }
                    debug2("upgrading to TLS");
                    finalSocket = tls.connect({
                      socket,
                      servername: targetHost,
                      ...connectOpts.tls || {}
                    });
                    await new Promise((resolve32, reject) => {
                      finalSocket.once("secureConnect", resolve32);
                      finalSocket.once("error", reject);
                    });
                  }
                  callback(null, finalSocket);
                } catch (err) {
                  debug2("SOCKS5 connection error:", err);
                  callback(err);
                }
              }, "connect")
            });
          }
          return this[kPool][kDispatch](opts, handler);
        } catch (err) {
          debug2("dispatch error:", err);
          if (typeof handler.onError === "function") {
            handler.onError(err);
          } else {
            throw err;
          }
        }
      }
      async [kClose]() {
        if (this[kPool]) {
          await this[kPool].close();
        }
      }
      async [kDestroy](err) {
        if (this[kPool]) {
          await this[kPool].destroy(err);
        }
      }
    };
    module2.exports = Socks5ProxyAgent;
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/dispatcher/proxy-agent.js
var require_proxy_agent = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/dispatcher/proxy-agent.js"(exports, module2) {
    init_import_meta_url();
    var { kProxy, kClose, kDestroy, kDispatch } = require_symbols();
    var Agent = require_agent();
    var Pool = require_pool();
    var DispatcherBase = require_dispatcher_base();
    var { InvalidArgumentError, RequestAbortedError, SecureProxyConnectionError } = require_errors();
    var buildConnector = require_connect();
    var Client2 = require_client();
    var { channels } = require_diagnostics();
    var Socks5ProxyAgent = require_socks5_proxy_agent();
    var kAgent = Symbol("proxy agent");
    var kClient = Symbol("proxy client");
    var kProxyHeaders = Symbol("proxy headers");
    var kRequestTls = Symbol("request tls settings");
    var kProxyTls = Symbol("proxy tls settings");
    var kConnectEndpoint = Symbol("connect endpoint function");
    var kTunnelProxy = Symbol("tunnel proxy");
    function defaultProtocolPort(protocol) {
      return protocol === "https:" ? 443 : 80;
    }
    __name(defaultProtocolPort, "defaultProtocolPort");
    function defaultFactory(origin, opts) {
      return new Pool(origin, opts);
    }
    __name(defaultFactory, "defaultFactory");
    var noop = /* @__PURE__ */ __name(() => {
    }, "noop");
    function defaultAgentFactory(origin, opts) {
      if (opts.connections === 1) {
        return new Client2(origin, opts);
      }
      return new Pool(origin, opts);
    }
    __name(defaultAgentFactory, "defaultAgentFactory");
    var Http1ProxyWrapper = class extends DispatcherBase {
      static {
        __name(this, "Http1ProxyWrapper");
      }
      #client;
      constructor(proxyUrl, { headers = {}, connect, factory }) {
        if (!proxyUrl) {
          throw new InvalidArgumentError("Proxy URL is mandatory");
        }
        super();
        this[kProxyHeaders] = headers;
        if (factory) {
          this.#client = factory(proxyUrl, { connect });
        } else {
          this.#client = new Client2(proxyUrl, { connect });
        }
      }
      [kDispatch](opts, handler) {
        const onHeaders = handler.onHeaders;
        handler.onHeaders = function(statusCode, data, resume) {
          if (statusCode === 407) {
            if (typeof handler.onError === "function") {
              handler.onError(new InvalidArgumentError("Proxy Authentication Required (407)"));
            }
            return;
          }
          if (onHeaders) onHeaders.call(this, statusCode, data, resume);
        };
        const {
          origin,
          path: path84 = "/",
          headers = {}
        } = opts;
        opts.path = origin + path84;
        if (!("host" in headers) && !("Host" in headers)) {
          const { host } = new URL(origin);
          headers.host = host;
        }
        opts.headers = { ...this[kProxyHeaders], ...headers };
        return this.#client[kDispatch](opts, handler);
      }
      [kClose]() {
        return this.#client.close();
      }
      [kDestroy](err) {
        return this.#client.destroy(err);
      }
    };
    var ProxyAgent = class extends DispatcherBase {
      static {
        __name(this, "ProxyAgent");
      }
      constructor(opts) {
        if (!opts || typeof opts === "object" && !(opts instanceof URL) && !opts.uri) {
          throw new InvalidArgumentError("Proxy uri is mandatory");
        }
        const { clientFactory = defaultFactory } = opts;
        if (typeof clientFactory !== "function") {
          throw new InvalidArgumentError("Proxy opts.clientFactory must be a function.");
        }
        const { proxyTunnel = true } = opts;
        super();
        const url4 = this.#getUrl(opts);
        const { href, origin, port, protocol, username, password, hostname: proxyHostname } = url4;
        this[kProxy] = { uri: href, protocol };
        this[kRequestTls] = opts.requestTls;
        this[kProxyTls] = opts.proxyTls;
        this[kProxyHeaders] = opts.headers || {};
        this[kTunnelProxy] = proxyTunnel;
        if (opts.auth && opts.token) {
          throw new InvalidArgumentError("opts.auth cannot be used in combination with opts.token");
        } else if (opts.auth) {
          this[kProxyHeaders]["proxy-authorization"] = `Basic ${opts.auth}`;
        } else if (opts.token) {
          this[kProxyHeaders]["proxy-authorization"] = opts.token;
        } else if (username && password) {
          this[kProxyHeaders]["proxy-authorization"] = `Basic ${Buffer.from(`${decodeURIComponent(username)}:${decodeURIComponent(password)}`).toString("base64")}`;
        }
        const connect = buildConnector({ ...opts.proxyTls });
        this[kConnectEndpoint] = buildConnector({ ...opts.requestTls });
        const agentFactory = opts.factory || defaultAgentFactory;
        const factory = /* @__PURE__ */ __name((origin2, options) => {
          const { protocol: protocol2 } = new URL(origin2);
          if (this[kProxy].protocol === "socks5:" || this[kProxy].protocol === "socks:") {
            return new Socks5ProxyAgent(this[kProxy].uri, {
              headers: this[kProxyHeaders],
              connect,
              factory: agentFactory,
              username: opts.username || username,
              password: opts.password || password,
              proxyTls: opts.proxyTls
            });
          }
          if (!this[kTunnelProxy] && protocol2 === "http:" && this[kProxy].protocol === "http:") {
            return new Http1ProxyWrapper(this[kProxy].uri, {
              headers: this[kProxyHeaders],
              connect,
              factory: agentFactory
            });
          }
          return agentFactory(origin2, options);
        }, "factory");
        if (protocol === "socks5:" || protocol === "socks:") {
          this[kClient] = null;
        } else {
          this[kClient] = clientFactory(url4, { connect });
        }
        this[kAgent] = new Agent({
          ...opts,
          factory,
          connect: /* @__PURE__ */ __name(async (opts2, callback) => {
            if (!this[kClient]) {
              callback(new InvalidArgumentError("Cannot establish tunnel connection without a proxy client"));
              return;
            }
            let requestedPath = opts2.host;
            if (!opts2.port) {
              requestedPath += `:${defaultProtocolPort(opts2.protocol)}`;
            }
            try {
              const connectParams = {
                origin,
                port,
                path: requestedPath,
                signal: opts2.signal,
                headers: {
                  ...this[kProxyHeaders],
                  host: opts2.host,
                  ...opts2.connections == null || opts2.connections > 0 ? { "proxy-connection": "keep-alive" } : {}
                },
                servername: this[kProxyTls]?.servername || proxyHostname
              };
              const { socket, statusCode } = await this[kClient].connect(connectParams);
              if (statusCode !== 200) {
                socket.on("error", noop).destroy();
                callback(new RequestAbortedError(`Proxy response (${statusCode}) !== 200 when HTTP Tunneling`));
                return;
              }
              if (channels.proxyConnected.hasSubscribers) {
                channels.proxyConnected.publish({
                  socket,
                  connectParams
                });
              }
              if (opts2.protocol !== "https:") {
                callback(null, socket);
                return;
              }
              let servername;
              if (this[kRequestTls]) {
                servername = this[kRequestTls].servername;
              } else {
                servername = opts2.servername;
              }
              this[kConnectEndpoint]({ ...opts2, servername, httpSocket: socket }, callback);
            } catch (err) {
              if (err.code === "ERR_TLS_CERT_ALTNAME_INVALID") {
                callback(new SecureProxyConnectionError(err));
              } else {
                callback(err);
              }
            }
          }, "connect")
        });
      }
      dispatch(opts, handler) {
        const headers = buildHeaders(opts.headers);
        throwIfProxyAuthIsSent(headers);
        if (headers && !("host" in headers) && !("Host" in headers)) {
          const { host } = new URL(opts.origin);
          headers.host = host;
        }
        return this[kAgent].dispatch(
          {
            ...opts,
            headers
          },
          handler
        );
      }
      /**
       * @param {import('../../types/proxy-agent').ProxyAgent.Options | string | URL} opts
       * @returns {URL}
       */
      #getUrl(opts) {
        if (typeof opts === "string") {
          return new URL(opts);
        } else if (opts instanceof URL) {
          return opts;
        } else {
          return new URL(opts.uri);
        }
      }
      [kClose]() {
        const promises3 = [this[kAgent].close()];
        if (this[kClient]) {
          promises3.push(this[kClient].close());
        }
        return Promise.all(promises3);
      }
      [kDestroy]() {
        const promises3 = [this[kAgent].destroy()];
        if (this[kClient]) {
          promises3.push(this[kClient].destroy());
        }
        return Promise.all(promises3);
      }
    };
    function buildHeaders(headers) {
      if (Array.isArray(headers)) {
        const headersPair = {};
        for (let i7 = 0; i7 < headers.length; i7 += 2) {
          headersPair[headers[i7]] = headers[i7 + 1];
        }
        return headersPair;
      }
      return headers;
    }
    __name(buildHeaders, "buildHeaders");
    function throwIfProxyAuthIsSent(headers) {
      const existProxyAuth = headers && Object.keys(headers).find((key) => key.toLowerCase() === "proxy-authorization");
      if (existProxyAuth) {
        throw new InvalidArgumentError("Proxy-Authorization should be sent in ProxyAgent constructor");
      }
    }
    __name(throwIfProxyAuthIsSent, "throwIfProxyAuthIsSent");
    module2.exports = ProxyAgent;
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js
var require_env_http_proxy_agent = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js"(exports, module2) {
    init_import_meta_url();
    var DispatcherBase = require_dispatcher_base();
    var { kClose, kDestroy, kClosed, kDestroyed, kDispatch, kNoProxyAgent, kHttpProxyAgent, kHttpsProxyAgent } = require_symbols();
    var ProxyAgent = require_proxy_agent();
    var Agent = require_agent();
    var DEFAULT_PORTS2 = {
      "http:": 80,
      "https:": 443
    };
    var EnvHttpProxyAgent2 = class extends DispatcherBase {
      static {
        __name(this, "EnvHttpProxyAgent");
      }
      #noProxyValue = null;
      #noProxyEntries = null;
      #opts = null;
      constructor(opts = {}) {
        super();
        this.#opts = opts;
        const { httpProxy, httpsProxy, noProxy: noProxy2, ...agentOpts } = opts;
        this[kNoProxyAgent] = new Agent(agentOpts);
        const HTTP_PROXY = httpProxy ?? process.env.http_proxy ?? process.env.HTTP_PROXY;
        if (HTTP_PROXY) {
          this[kHttpProxyAgent] = new ProxyAgent({ ...agentOpts, uri: HTTP_PROXY });
        } else {
          this[kHttpProxyAgent] = this[kNoProxyAgent];
        }
        const HTTPS_PROXY = httpsProxy ?? process.env.https_proxy ?? process.env.HTTPS_PROXY;
        if (HTTPS_PROXY) {
          this[kHttpsProxyAgent] = new ProxyAgent({ ...agentOpts, uri: HTTPS_PROXY });
        } else {
          this[kHttpsProxyAgent] = this[kHttpProxyAgent];
        }
        this.#parseNoProxy();
      }
      [kDispatch](opts, handler) {
        const url4 = new URL(opts.origin);
        const agent = this.#getProxyAgentForUrl(url4);
        return agent.dispatch(opts, handler);
      }
      [kClose]() {
        return Promise.all([
          this[kNoProxyAgent].close(),
          !this[kHttpProxyAgent][kClosed] && this[kHttpProxyAgent].close(),
          !this[kHttpsProxyAgent][kClosed] && this[kHttpsProxyAgent].close()
        ]);
      }
      [kDestroy](err) {
        return Promise.all([
          this[kNoProxyAgent].destroy(err),
          !this[kHttpProxyAgent][kDestroyed] && this[kHttpProxyAgent].destroy(err),
          !this[kHttpsProxyAgent][kDestroyed] && this[kHttpsProxyAgent].destroy(err)
        ]);
      }
      #getProxyAgentForUrl(url4) {
        let { protocol, host: hostname2, port } = url4;
        hostname2 = hostname2.replace(/:\d*$/, "").toLowerCase();
        port = Number.parseInt(port, 10) || DEFAULT_PORTS2[protocol] || 0;
        if (!this.#shouldProxy(hostname2, port)) {
          return this[kNoProxyAgent];
        }
        if (protocol === "https:") {
          return this[kHttpsProxyAgent];
        }
        return this[kHttpProxyAgent];
      }
      #shouldProxy(hostname2, port) {
        if (this.#noProxyChanged) {
          this.#parseNoProxy();
        }
        if (this.#noProxyEntries.length === 0) {
          return true;
        }
        if (this.#noProxyValue === "*") {
          return false;
        }
        for (let i7 = 0; i7 < this.#noProxyEntries.length; i7++) {
          const entry = this.#noProxyEntries[i7];
          if (entry.port && entry.port !== port) {
            continue;
          }
          if (hostname2 === entry.hostname) {
            return false;
          }
          if (hostname2.slice(-(entry.hostname.length + 1)) === `.${entry.hostname}`) {
            return false;
          }
        }
        return true;
      }
      #parseNoProxy() {
        const noProxyValue = this.#opts.noProxy ?? this.#noProxyEnv;
        const noProxySplit = noProxyValue.split(/[,\s]/);
        const noProxyEntries = [];
        for (let i7 = 0; i7 < noProxySplit.length; i7++) {
          const entry = noProxySplit[i7];
          if (!entry) {
            continue;
          }
          const parsed = entry.match(/^(.+):(\d+)$/);
          noProxyEntries.push({
            // strip leading dot or asterisk with dot
            hostname: (parsed ? parsed[1] : entry).replace(/^\*?\./, "").toLowerCase(),
            port: parsed ? Number.parseInt(parsed[2], 10) : 0
          });
        }
        this.#noProxyValue = noProxyValue;
        this.#noProxyEntries = noProxyEntries;
      }
      get #noProxyChanged() {
        if (this.#opts.noProxy !== void 0) {
          return false;
        }
        return this.#noProxyValue !== this.#noProxyEnv;
      }
      get #noProxyEnv() {
        return process.env.no_proxy ?? process.env.NO_PROXY ?? "";
      }
    };
    module2.exports = EnvHttpProxyAgent2;
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/handler/retry-handler.js
var require_retry_handler = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/handler/retry-handler.js"(exports, module2) {
    init_import_meta_url();
    var assert61 = __require("assert");
    var { kRetryHandlerDefaultRetry } = require_symbols();
    var { RequestRetryError } = require_errors();
    var WrapHandler = require_wrap_handler();
    var {
      isDisturbed,
      parseRangeHeader,
      wrapRequestBody
    } = require_util();
    function calculateRetryAfterHeader(retryAfter) {
      const retryTime = new Date(retryAfter).getTime();
      return isNaN(retryTime) ? 0 : retryTime - Date.now();
    }
    __name(calculateRetryAfterHeader, "calculateRetryAfterHeader");
    var RetryHandler = class _RetryHandler {
      static {
        __name(this, "RetryHandler");
      }
      constructor(opts, { dispatch, handler }) {
        const { retryOptions, ...dispatchOpts } = opts;
        const {
          // Retry scoped
          retry: retryFn,
          maxRetries,
          maxTimeout,
          minTimeout,
          timeoutFactor,
          // Response scoped
          methods,
          errorCodes,
          retryAfter,
          statusCodes,
          throwOnError
        } = retryOptions ?? {};
        this.error = null;
        this.dispatch = dispatch;
        this.handler = WrapHandler.wrap(handler);
        this.opts = { ...dispatchOpts, body: wrapRequestBody(opts.body) };
        this.retryOpts = {
          throwOnError: throwOnError ?? true,
          retry: retryFn ?? _RetryHandler[kRetryHandlerDefaultRetry],
          retryAfter: retryAfter ?? true,
          maxTimeout: maxTimeout ?? 30 * 1e3,
          // 30s,
          minTimeout: minTimeout ?? 500,
          // .5s
          timeoutFactor: timeoutFactor ?? 2,
          maxRetries: maxRetries ?? 5,
          // What errors we should retry
          methods: methods ?? ["GET", "HEAD", "OPTIONS", "PUT", "DELETE", "TRACE"],
          // Indicates which errors to retry
          statusCodes: statusCodes ?? [500, 502, 503, 504, 429],
          // List of errors to retry
          errorCodes: errorCodes ?? [
            "ECONNRESET",
            "ECONNREFUSED",
            "ENOTFOUND",
            "ENETDOWN",
            "ENETUNREACH",
            "EHOSTDOWN",
            "EHOSTUNREACH",
            "EPIPE",
            "UND_ERR_SOCKET"
          ]
        };
        this.retryCount = 0;
        this.retryCountCheckpoint = 0;
        this.headersSent = false;
        this.start = 0;
        this.end = null;
        this.etag = null;
      }
      onResponseStartWithRetry(controller, statusCode, headers, statusMessage, err) {
        if (this.retryOpts.throwOnError) {
          if (this.retryOpts.statusCodes.includes(statusCode) === false) {
            this.headersSent = true;
            this.handler.onResponseStart?.(controller, statusCode, headers, statusMessage);
          } else {
            this.error = err;
          }
          return;
        }
        if (isDisturbed(this.opts.body)) {
          this.headersSent = true;
          this.handler.onResponseStart?.(controller, statusCode, headers, statusMessage);
          return;
        }
        function shouldRetry(passedErr) {
          if (passedErr) {
            this.headersSent = true;
            this.handler.onResponseStart?.(controller, statusCode, headers, statusMessage);
            controller.resume();
            return;
          }
          this.error = err;
          controller.resume();
        }
        __name(shouldRetry, "shouldRetry");
        controller.pause();
        this.retryOpts.retry(
          err,
          {
            state: { counter: this.retryCount },
            opts: { retryOptions: this.retryOpts, ...this.opts }
          },
          shouldRetry.bind(this)
        );
      }
      onRequestStart(controller, context2) {
        if (!this.headersSent) {
          this.handler.onRequestStart?.(controller, context2);
        }
      }
      onRequestUpgrade(controller, statusCode, headers, socket) {
        this.handler.onRequestUpgrade?.(controller, statusCode, headers, socket);
      }
      static [kRetryHandlerDefaultRetry](err, { state: state2, opts }, cb2) {
        const { statusCode, code, headers } = err;
        const { method, retryOptions } = opts;
        const {
          maxRetries,
          minTimeout,
          maxTimeout,
          timeoutFactor,
          statusCodes,
          errorCodes,
          methods
        } = retryOptions;
        const { counter } = state2;
        if (code && code !== "UND_ERR_REQ_RETRY" && !errorCodes.includes(code)) {
          cb2(err);
          return;
        }
        if (Array.isArray(methods) && !methods.includes(method)) {
          cb2(err);
          return;
        }
        if (statusCode != null && Array.isArray(statusCodes) && !statusCodes.includes(statusCode)) {
          cb2(err);
          return;
        }
        if (counter > maxRetries) {
          cb2(err);
          return;
        }
        let retryAfterHeader = headers?.["retry-after"];
        if (retryAfterHeader) {
          retryAfterHeader = Number(retryAfterHeader);
          retryAfterHeader = Number.isNaN(retryAfterHeader) ? calculateRetryAfterHeader(headers["retry-after"]) : retryAfterHeader * 1e3;
        }
        const retryTimeout = retryAfterHeader > 0 ? Math.min(retryAfterHeader, maxTimeout) : Math.min(minTimeout * timeoutFactor ** (counter - 1), maxTimeout);
        setTimeout(() => cb2(null), retryTimeout);
      }
      onResponseStart(controller, statusCode, headers, statusMessage) {
        this.error = null;
        this.retryCount += 1;
        if (statusCode >= 300) {
          const err = new RequestRetryError("Request failed", statusCode, {
            headers,
            data: {
              count: this.retryCount
            }
          });
          this.onResponseStartWithRetry(controller, statusCode, headers, statusMessage, err);
          return;
        }
        if (this.headersSent) {
          if (statusCode !== 206 && (this.start > 0 || statusCode !== 200)) {
            throw new RequestRetryError("server does not support the range header and the payload was partially consumed", statusCode, {
              headers,
              data: { count: this.retryCount }
            });
          }
          const contentRange = parseRangeHeader(headers["content-range"]);
          if (!contentRange) {
            throw new RequestRetryError("Content-Range mismatch", statusCode, {
              headers,
              data: { count: this.retryCount }
            });
          }
          if (this.etag != null && this.etag !== headers.etag) {
            throw new RequestRetryError("ETag mismatch", statusCode, {
              headers,
              data: { count: this.retryCount }
            });
          }
          const { start, size, end = size ? size - 1 : null } = contentRange;
          assert61(this.start === start, "content-range mismatch");
          assert61(this.end == null || this.end === end, "content-range mismatch");
          return;
        }
        if (this.end == null) {
          if (statusCode === 206) {
            const range = parseRangeHeader(headers["content-range"]);
            if (range == null) {
              this.headersSent = true;
              this.handler.onResponseStart?.(
                controller,
                statusCode,
                headers,
                statusMessage
              );
              return;
            }
            const { start, size, end = size ? size - 1 : null } = range;
            assert61(
              start != null && Number.isFinite(start),
              "content-range mismatch"
            );
            assert61(end != null && Number.isFinite(end), "invalid content-length");
            this.start = start;
            this.end = end;
          }
          if (this.end == null) {
            const contentLength = headers["content-length"];
            this.end = contentLength != null ? Number(contentLength) - 1 : null;
          }
          assert61(Number.isFinite(this.start));
          assert61(
            this.end == null || Number.isFinite(this.end),
            "invalid content-length"
          );
          this.resume = true;
          this.etag = headers.etag != null ? headers.etag : null;
          if (this.etag != null && this.etag[0] === "W" && this.etag[1] === "/") {
            this.etag = null;
          }
          this.headersSent = true;
          this.handler.onResponseStart?.(
            controller,
            statusCode,
            headers,
            statusMessage
          );
        } else {
          throw new RequestRetryError("Request failed", statusCode, {
            headers,
            data: { count: this.retryCount }
          });
        }
      }
      onResponseData(controller, chunk) {
        if (this.error) {
          return;
        }
        this.start += chunk.length;
        this.handler.onResponseData?.(controller, chunk);
      }
      onResponseEnd(controller, trailers) {
        if (this.error && this.retryOpts.throwOnError) {
          throw this.error;
        }
        if (!this.error) {
          this.retryCount = 0;
          return this.handler.onResponseEnd?.(controller, trailers);
        }
        this.retry(controller);
      }
      retry(controller) {
        if (this.start !== 0) {
          const headers = { range: `bytes=${this.start}-${this.end ?? ""}` };
          if (this.etag != null) {
            headers["if-match"] = this.etag;
          }
          this.opts = {
            ...this.opts,
            headers: {
              ...this.opts.headers,
              ...headers
            }
          };
        }
        try {
          this.retryCountCheckpoint = this.retryCount;
          this.dispatch(this.opts, this);
        } catch (err) {
          this.handler.onResponseError?.(controller, err);
        }
      }
      onResponseError(controller, err) {
        if (controller?.aborted || isDisturbed(this.opts.body)) {
          this.handler.onResponseError?.(controller, err);
          return;
        }
        function shouldRetry(returnedErr) {
          if (!returnedErr) {
            this.retry(controller);
            return;
          }
          this.handler?.onResponseError?.(controller, returnedErr);
        }
        __name(shouldRetry, "shouldRetry");
        if (this.retryCount - this.retryCountCheckpoint > 0) {
          this.retryCount = this.retryCountCheckpoint + (this.retryCount - this.retryCountCheckpoint);
        } else {
          this.retryCount += 1;
        }
        this.retryOpts.retry(
          err,
          {
            state: { counter: this.retryCount },
            opts: { retryOptions: this.retryOpts, ...this.opts }
          },
          shouldRetry.bind(this)
        );
      }
    };
    module2.exports = RetryHandler;
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/dispatcher/retry-agent.js
var require_retry_agent = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/dispatcher/retry-agent.js"(exports, module2) {
    init_import_meta_url();
    var Dispatcher2 = require_dispatcher();
    var RetryHandler = require_retry_handler();
    var RetryAgent = class extends Dispatcher2 {
      static {
        __name(this, "RetryAgent");
      }
      #agent = null;
      #options = null;
      constructor(agent, options = {}) {
        super(options);
        this.#agent = agent;
        this.#options = options;
      }
      dispatch(opts, handler) {
        const retry2 = new RetryHandler({
          ...opts,
          retryOptions: this.#options
        }, {
          dispatch: this.#agent.dispatch.bind(this.#agent),
          handler
        });
        return this.#agent.dispatch(opts, retry2);
      }
      close() {
        return this.#agent.close();
      }
      destroy() {
        return this.#agent.destroy();
      }
    };
    module2.exports = RetryAgent;
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/dispatcher/h2c-client.js
var require_h2c_client = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/dispatcher/h2c-client.js"(exports, module2) {
    init_import_meta_url();
    var { InvalidArgumentError } = require_errors();
    var Client2 = require_client();
    var H2CClient = class extends Client2 {
      static {
        __name(this, "H2CClient");
      }
      constructor(origin, clientOpts) {
        if (typeof origin === "string") {
          origin = new URL(origin);
        }
        if (origin.protocol !== "http:") {
          throw new InvalidArgumentError(
            "h2c-client: Only h2c protocol is supported"
          );
        }
        const { connect, maxConcurrentStreams, pipelining, ...opts } = clientOpts ?? {};
        let defaultMaxConcurrentStreams = 100;
        let defaultPipelining = 100;
        if (maxConcurrentStreams != null && Number.isInteger(maxConcurrentStreams) && maxConcurrentStreams > 0) {
          defaultMaxConcurrentStreams = maxConcurrentStreams;
        }
        if (pipelining != null && Number.isInteger(pipelining) && pipelining > 0) {
          defaultPipelining = pipelining;
        }
        if (defaultPipelining > defaultMaxConcurrentStreams) {
          throw new InvalidArgumentError(
            "h2c-client: pipelining cannot be greater than maxConcurrentStreams"
          );
        }
        super(origin, {
          ...opts,
          maxConcurrentStreams: defaultMaxConcurrentStreams,
          pipelining: defaultPipelining,
          allowH2: true,
          useH2c: true
        });
      }
    };
    module2.exports = H2CClient;
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/api/readable.js
var require_readable = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/api/readable.js"(exports, module2) {
    init_import_meta_url();
    var assert61 = __require("assert");
    var { Readable: Readable11 } = __require("stream");
    var { RequestAbortedError, NotSupportedError, InvalidArgumentError, AbortError: AbortError2 } = require_errors();
    var util5 = require_util();
    var { ReadableStreamFrom } = require_util();
    var kConsume = Symbol("kConsume");
    var kReading = Symbol("kReading");
    var kBody = Symbol("kBody");
    var kAbort = Symbol("kAbort");
    var kContentType = Symbol("kContentType");
    var kContentLength = Symbol("kContentLength");
    var kUsed = Symbol("kUsed");
    var kBytesRead = Symbol("kBytesRead");
    var noop = /* @__PURE__ */ __name(() => {
    }, "noop");
    var BodyReadable = class extends Readable11 {
      static {
        __name(this, "BodyReadable");
      }
      /**
       * @param {object} opts
       * @param {(this: Readable, size: number) => void} opts.resume
       * @param {() => (void | null)} opts.abort
       * @param {string} [opts.contentType = '']
       * @param {number} [opts.contentLength]
       * @param {number} [opts.highWaterMark = 64 * 1024]
       */
      constructor({
        resume,
        abort,
        contentType = "",
        contentLength,
        highWaterMark = 64 * 1024
        // Same as nodejs fs streams.
      }) {
        super({
          autoDestroy: true,
          read: resume,
          highWaterMark
        });
        this._readableState.dataEmitted = false;
        this[kAbort] = abort;
        this[kConsume] = null;
        this[kBytesRead] = 0;
        this[kBody] = null;
        this[kUsed] = false;
        this[kContentType] = contentType;
        this[kContentLength] = Number.isFinite(contentLength) ? contentLength : null;
        this[kReading] = false;
      }
      /**
       * @param {Error|null} err
       * @param {(error:(Error|null)) => void} callback
       * @returns {void}
       */
      _destroy(err, callback) {
        if (!err && !this._readableState.endEmitted) {
          err = new RequestAbortedError();
        }
        if (err) {
          this[kAbort]();
        }
        if (!this[kUsed]) {
          setImmediate(callback, err);
        } else {
          callback(err);
        }
      }
      /**
       * @param {string|symbol} event
       * @param {(...args: any[]) => void} listener
       * @returns {this}
       */
      on(event, listener) {
        if (event === "data" || event === "readable") {
          this[kReading] = true;
          this[kUsed] = true;
        }
        return super.on(event, listener);
      }
      /**
       * @param {string|symbol} event
       * @param {(...args: any[]) => void} listener
       * @returns {this}
       */
      addListener(event, listener) {
        return this.on(event, listener);
      }
      /**
       * @param {string|symbol} event
       * @param {(...args: any[]) => void} listener
       * @returns {this}
       */
      off(event, listener) {
        const ret = super.off(event, listener);
        if (event === "data" || event === "readable") {
          this[kReading] = this.listenerCount("data") > 0 || this.listenerCount("readable") > 0;
        }
        return ret;
      }
      /**
       * @param {string|symbol} event
       * @param {(...args: any[]) => void} listener
       * @returns {this}
       */
      removeListener(event, listener) {
        return this.off(event, listener);
      }
      /**
       * @param {Buffer|null} chunk
       * @returns {boolean}
       */
      push(chunk) {
        if (chunk) {
          this[kBytesRead] += chunk.length;
          if (this[kConsume]) {
            consumePush(this[kConsume], chunk);
            return this[kReading] ? super.push(chunk) : true;
          }
        }
        return super.push(chunk);
      }
      /**
       * Consumes and returns the body as a string.
       *
       * @see https://fetch.spec.whatwg.org/#dom-body-text
       * @returns {Promise<string>}
       */
      text() {
        return consume(this, "text");
      }
      /**
       * Consumes and returns the body as a JavaScript Object.
       *
       * @see https://fetch.spec.whatwg.org/#dom-body-json
       * @returns {Promise<unknown>}
       */
      json() {
        return consume(this, "json");
      }
      /**
       * Consumes and returns the body as a Blob
       *
       * @see https://fetch.spec.whatwg.org/#dom-body-blob
       * @returns {Promise<Blob>}
       */
      blob() {
        return consume(this, "blob");
      }
      /**
       * Consumes and returns the body as an Uint8Array.
       *
       * @see https://fetch.spec.whatwg.org/#dom-body-bytes
       * @returns {Promise<Uint8Array>}
       */
      bytes() {
        return consume(this, "bytes");
      }
      /**
       * Consumes and returns the body as an ArrayBuffer.
       *
       * @see https://fetch.spec.whatwg.org/#dom-body-arraybuffer
       * @returns {Promise<ArrayBuffer>}
       */
      arrayBuffer() {
        return consume(this, "arrayBuffer");
      }
      /**
       * Not implemented
       *
       * @see https://fetch.spec.whatwg.org/#dom-body-formdata
       * @throws {NotSupportedError}
       */
      async formData() {
        throw new NotSupportedError();
      }
      /**
       * Returns true if the body is not null and the body has been consumed.
       * Otherwise, returns false.
       *
       * @see https://fetch.spec.whatwg.org/#dom-body-bodyused
       * @readonly
       * @returns {boolean}
       */
      get bodyUsed() {
        return util5.isDisturbed(this);
      }
      /**
       * @see https://fetch.spec.whatwg.org/#dom-body-body
       * @readonly
       * @returns {ReadableStream}
       */
      get body() {
        if (!this[kBody]) {
          this[kBody] = ReadableStreamFrom(this);
          if (this[kConsume]) {
            this[kBody].getReader();
            assert61(this[kBody].locked);
          }
        }
        return this[kBody];
      }
      /**
       * Dumps the response body by reading `limit` number of bytes.
       * @param {object} opts
       * @param {number} [opts.limit = 131072] Number of bytes to read.
       * @param {AbortSignal} [opts.signal] An AbortSignal to cancel the dump.
       * @returns {Promise<null>}
       */
      dump(opts) {
        const signal = opts?.signal;
        if (signal != null && (typeof signal !== "object" || !("aborted" in signal))) {
          return Promise.reject(new InvalidArgumentError("signal must be an AbortSignal"));
        }
        const limit2 = opts?.limit && Number.isFinite(opts.limit) ? opts.limit : 128 * 1024;
        if (signal?.aborted) {
          return Promise.reject(signal.reason ?? new AbortError2());
        }
        if (this._readableState.closeEmitted) {
          return Promise.resolve(null);
        }
        return new Promise((resolve32, reject) => {
          if (this[kContentLength] && this[kContentLength] > limit2 || this[kBytesRead] > limit2) {
            this.destroy(new AbortError2());
          }
          if (signal) {
            const onAbort = /* @__PURE__ */ __name(() => {
              this.destroy(signal.reason ?? new AbortError2());
            }, "onAbort");
            signal.addEventListener("abort", onAbort);
            this.on("close", function() {
              signal.removeEventListener("abort", onAbort);
              if (signal.aborted) {
                reject(signal.reason ?? new AbortError2());
              } else {
                resolve32(null);
              }
            });
          } else {
            this.on("close", resolve32);
          }
          this.on("error", noop).on("data", () => {
            if (this[kBytesRead] > limit2) {
              this.destroy();
            }
          }).resume();
        });
      }
      /**
       * @param {BufferEncoding} encoding
       * @returns {this}
       */
      setEncoding(encoding) {
        if (Buffer.isEncoding(encoding)) {
          this._readableState.encoding = encoding;
        }
        return this;
      }
    };
    function isLocked(bodyReadable) {
      return bodyReadable[kBody]?.locked === true || bodyReadable[kConsume] !== null;
    }
    __name(isLocked, "isLocked");
    function isUnusable(bodyReadable) {
      return util5.isDisturbed(bodyReadable) || isLocked(bodyReadable);
    }
    __name(isUnusable, "isUnusable");
    function consume(stream2, type) {
      assert61(!stream2[kConsume]);
      return new Promise((resolve32, reject) => {
        if (isUnusable(stream2)) {
          const rState = stream2._readableState;
          if (rState.destroyed && rState.closeEmitted === false) {
            stream2.on("error", reject).on("close", () => {
              reject(new TypeError("unusable"));
            });
          } else {
            reject(rState.errored ?? new TypeError("unusable"));
          }
        } else {
          queueMicrotask(() => {
            stream2[kConsume] = {
              type,
              stream: stream2,
              resolve: resolve32,
              reject,
              length: 0,
              body: []
            };
            stream2.on("error", function(err) {
              consumeFinish(this[kConsume], err);
            }).on("close", function() {
              if (this[kConsume].body !== null) {
                consumeFinish(this[kConsume], new RequestAbortedError());
              }
            });
            consumeStart(stream2[kConsume]);
          });
        }
      });
    }
    __name(consume, "consume");
    function consumeStart(consume2) {
      if (consume2.body === null) {
        return;
      }
      const { _readableState: state2 } = consume2.stream;
      if (state2.bufferIndex) {
        const start = state2.bufferIndex;
        const end = state2.buffer.length;
        for (let n9 = start; n9 < end; n9++) {
          consumePush(consume2, state2.buffer[n9]);
        }
      } else {
        for (const chunk of state2.buffer) {
          consumePush(consume2, chunk);
        }
      }
      if (state2.endEmitted) {
        consumeEnd(this[kConsume], this._readableState.encoding);
      } else {
        consume2.stream.on("end", function() {
          consumeEnd(this[kConsume], this._readableState.encoding);
        });
      }
      consume2.stream.resume();
      while (consume2.stream.read() != null) {
      }
    }
    __name(consumeStart, "consumeStart");
    function chunksDecode(chunks, length, encoding) {
      if (chunks.length === 0 || length === 0) {
        return "";
      }
      const buffer = chunks.length === 1 ? chunks[0] : Buffer.concat(chunks, length);
      const bufferLength = buffer.length;
      const start = bufferLength > 2 && buffer[0] === 239 && buffer[1] === 187 && buffer[2] === 191 ? 3 : 0;
      if (!encoding || encoding === "utf8" || encoding === "utf-8") {
        return buffer.utf8Slice(start, bufferLength);
      } else {
        return buffer.subarray(start, bufferLength).toString(encoding);
      }
    }
    __name(chunksDecode, "chunksDecode");
    function chunksConcat(chunks, length) {
      if (chunks.length === 0 || length === 0) {
        return new Uint8Array(0);
      }
      if (chunks.length === 1) {
        return new Uint8Array(chunks[0]);
      }
      const buffer = new Uint8Array(Buffer.allocUnsafeSlow(length).buffer);
      let offset = 0;
      for (let i7 = 0; i7 < chunks.length; ++i7) {
        const chunk = chunks[i7];
        buffer.set(chunk, offset);
        offset += chunk.length;
      }
      return buffer;
    }
    __name(chunksConcat, "chunksConcat");
    function consumeEnd(consume2, encoding) {
      const { type, body, resolve: resolve32, stream: stream2, length } = consume2;
      try {
        if (type === "text") {
          resolve32(chunksDecode(body, length, encoding));
        } else if (type === "json") {
          resolve32(JSON.parse(chunksDecode(body, length, encoding)));
        } else if (type === "arrayBuffer") {
          resolve32(chunksConcat(body, length).buffer);
        } else if (type === "blob") {
          resolve32(new Blob(body, { type: stream2[kContentType] }));
        } else if (type === "bytes") {
          resolve32(chunksConcat(body, length));
        }
        consumeFinish(consume2);
      } catch (err) {
        stream2.destroy(err);
      }
    }
    __name(consumeEnd, "consumeEnd");
    function consumePush(consume2, chunk) {
      consume2.length += chunk.length;
      consume2.body.push(chunk);
    }
    __name(consumePush, "consumePush");
    function consumeFinish(consume2, err) {
      if (consume2.body === null) {
        return;
      }
      if (err) {
        consume2.reject(err);
      } else {
        consume2.resolve();
      }
      consume2.type = null;
      consume2.stream = null;
      consume2.resolve = null;
      consume2.reject = null;
      consume2.length = 0;
      consume2.body = null;
    }
    __name(consumeFinish, "consumeFinish");
    module2.exports = {
      Readable: BodyReadable,
      chunksDecode
    };
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/api/api-request.js
var require_api_request = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/api/api-request.js"(exports, module2) {
    init_import_meta_url();
    var assert61 = __require("assert");
    var { AsyncResource } = __require("async_hooks");
    var { Readable: Readable11 } = require_readable();
    var { InvalidArgumentError, RequestAbortedError } = require_errors();
    var util5 = require_util();
    function noop() {
    }
    __name(noop, "noop");
    var RequestHandler = class extends AsyncResource {
      static {
        __name(this, "RequestHandler");
      }
      constructor(opts, callback) {
        if (!opts || typeof opts !== "object") {
          throw new InvalidArgumentError("invalid opts");
        }
        const { signal, method, opaque, body, onInfo, responseHeaders, highWaterMark } = opts;
        try {
          if (typeof callback !== "function") {
            throw new InvalidArgumentError("invalid callback");
          }
          if (highWaterMark && (typeof highWaterMark !== "number" || highWaterMark < 0)) {
            throw new InvalidArgumentError("invalid highWaterMark");
          }
          if (signal && typeof signal.on !== "function" && typeof signal.addEventListener !== "function") {
            throw new InvalidArgumentError("signal must be an EventEmitter or EventTarget");
          }
          if (method === "CONNECT") {
            throw new InvalidArgumentError("invalid method");
          }
          if (onInfo && typeof onInfo !== "function") {
            throw new InvalidArgumentError("invalid onInfo callback");
          }
          super("UNDICI_REQUEST");
        } catch (err) {
          if (util5.isStream(body)) {
            util5.destroy(body.on("error", noop), err);
          }
          throw err;
        }
        this.method = method;
        this.responseHeaders = responseHeaders || null;
        this.opaque = opaque || null;
        this.callback = callback;
        this.res = null;
        this.abort = null;
        this.body = body;
        this.trailers = {};
        this.context = null;
        this.onInfo = onInfo || null;
        this.highWaterMark = highWaterMark;
        this.reason = null;
        this.removeAbortListener = null;
        if (signal?.aborted) {
          this.reason = signal.reason ?? new RequestAbortedError();
        } else if (signal) {
          this.removeAbortListener = util5.addAbortListener(signal, () => {
            this.reason = signal.reason ?? new RequestAbortedError();
            if (this.res) {
              util5.destroy(this.res.on("error", noop), this.reason);
            } else if (this.abort) {
              this.abort(this.reason);
            }
          });
        }
      }
      onConnect(abort, context2) {
        if (this.reason) {
          abort(this.reason);
          return;
        }
        assert61(this.callback);
        this.abort = abort;
        this.context = context2;
      }
      onHeaders(statusCode, rawHeaders, resume, statusMessage) {
        const { callback, opaque, abort, context: context2, responseHeaders, highWaterMark } = this;
        const headers = responseHeaders === "raw" ? util5.parseRawHeaders(rawHeaders) : util5.parseHeaders(rawHeaders);
        if (statusCode < 200) {
          if (this.onInfo) {
            this.onInfo({ statusCode, headers });
          }
          return;
        }
        const parsedHeaders = responseHeaders === "raw" ? util5.parseHeaders(rawHeaders) : headers;
        const contentType = parsedHeaders["content-type"];
        const contentLength = parsedHeaders["content-length"];
        const res = new Readable11({
          resume,
          abort,
          contentType,
          contentLength: this.method !== "HEAD" && contentLength ? Number(contentLength) : null,
          highWaterMark
        });
        if (this.removeAbortListener) {
          res.on("close", this.removeAbortListener);
          this.removeAbortListener = null;
        }
        this.callback = null;
        this.res = res;
        if (callback !== null) {
          try {
            this.runInAsyncScope(callback, null, null, {
              statusCode,
              statusText: statusMessage,
              headers,
              trailers: this.trailers,
              opaque,
              body: res,
              context: context2
            });
          } catch (err) {
            this.res = null;
            util5.destroy(res.on("error", noop), err);
            queueMicrotask(() => {
              throw err;
            });
          }
        }
      }
      onData(chunk) {
        return this.res.push(chunk);
      }
      onComplete(trailers) {
        util5.parseHeaders(trailers, this.trailers);
        this.res.push(null);
      }
      onError(err) {
        const { res, callback, body, opaque } = this;
        if (callback) {
          this.callback = null;
          queueMicrotask(() => {
            this.runInAsyncScope(callback, null, err, { opaque });
          });
        }
        if (res) {
          this.res = null;
          queueMicrotask(() => {
            util5.destroy(res.on("error", noop), err);
          });
        }
        if (body) {
          this.body = null;
          if (util5.isStream(body)) {
            body.on("error", noop);
            util5.destroy(body, err);
          }
        }
        if (this.removeAbortListener) {
          this.removeAbortListener();
          this.removeAbortListener = null;
        }
      }
    };
    function request4(opts, callback) {
      if (callback === void 0) {
        return new Promise((resolve32, reject) => {
          request4.call(this, opts, (err, data) => {
            return err ? reject(err) : resolve32(data);
          });
        });
      }
      try {
        const handler = new RequestHandler(opts, callback);
        this.dispatch(opts, handler);
      } catch (err) {
        if (typeof callback !== "function") {
          throw err;
        }
        const opaque = opts?.opaque;
        queueMicrotask(() => callback(err, { opaque }));
      }
    }
    __name(request4, "request");
    module2.exports = request4;
    module2.exports.RequestHandler = RequestHandler;
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/api/abort-signal.js
var require_abort_signal = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/api/abort-signal.js"(exports, module2) {
    init_import_meta_url();
    var { addAbortListener } = require_util();
    var { RequestAbortedError } = require_errors();
    var kListener = Symbol("kListener");
    var kSignal = Symbol("kSignal");
    function abort(self2) {
      if (self2.abort) {
        self2.abort(self2[kSignal]?.reason);
      } else {
        self2.reason = self2[kSignal]?.reason ?? new RequestAbortedError();
      }
      removeSignal(self2);
    }
    __name(abort, "abort");
    function addSignal(self2, signal) {
      self2.reason = null;
      self2[kSignal] = null;
      self2[kListener] = null;
      if (!signal) {
        return;
      }
      if (signal.aborted) {
        abort(self2);
        return;
      }
      self2[kSignal] = signal;
      self2[kListener] = () => {
        abort(self2);
      };
      addAbortListener(self2[kSignal], self2[kListener]);
    }
    __name(addSignal, "addSignal");
    function removeSignal(self2) {
      if (!self2[kSignal]) {
        return;
      }
      if ("removeEventListener" in self2[kSignal]) {
        self2[kSignal].removeEventListener("abort", self2[kListener]);
      } else {
        self2[kSignal].removeListener("abort", self2[kListener]);
      }
      self2[kSignal] = null;
      self2[kListener] = null;
    }
    __name(removeSignal, "removeSignal");
    module2.exports = {
      addSignal,
      removeSignal
    };
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/api/api-stream.js
var require_api_stream = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/api/api-stream.js"(exports, module2) {
    init_import_meta_url();
    var assert61 = __require("assert");
    var { finished } = __require("stream");
    var { AsyncResource } = __require("async_hooks");
    var { InvalidArgumentError, InvalidReturnValueError } = require_errors();
    var util5 = require_util();
    var { addSignal, removeSignal } = require_abort_signal();
    function noop() {
    }
    __name(noop, "noop");
    var StreamHandler = class extends AsyncResource {
      static {
        __name(this, "StreamHandler");
      }
      constructor(opts, factory, callback) {
        if (!opts || typeof opts !== "object") {
          throw new InvalidArgumentError("invalid opts");
        }
        const { signal, method, opaque, body, onInfo, responseHeaders } = opts;
        try {
          if (typeof callback !== "function") {
            throw new InvalidArgumentError("invalid callback");
          }
          if (typeof factory !== "function") {
            throw new InvalidArgumentError("invalid factory");
          }
          if (signal && typeof signal.on !== "function" && typeof signal.addEventListener !== "function") {
            throw new InvalidArgumentError("signal must be an EventEmitter or EventTarget");
          }
          if (method === "CONNECT") {
            throw new InvalidArgumentError("invalid method");
          }
          if (onInfo && typeof onInfo !== "function") {
            throw new InvalidArgumentError("invalid onInfo callback");
          }
          super("UNDICI_STREAM");
        } catch (err) {
          if (util5.isStream(body)) {
            util5.destroy(body.on("error", noop), err);
          }
          throw err;
        }
        this.responseHeaders = responseHeaders || null;
        this.opaque = opaque || null;
        this.factory = factory;
        this.callback = callback;
        this.res = null;
        this.abort = null;
        this.context = null;
        this.trailers = null;
        this.body = body;
        this.onInfo = onInfo || null;
        if (util5.isStream(body)) {
          body.on("error", (err) => {
            this.onError(err);
          });
        }
        addSignal(this, signal);
      }
      onConnect(abort, context2) {
        if (this.reason) {
          abort(this.reason);
          return;
        }
        assert61(this.callback);
        this.abort = abort;
        this.context = context2;
      }
      onHeaders(statusCode, rawHeaders, resume, statusMessage) {
        const { factory, opaque, context: context2, responseHeaders } = this;
        const headers = responseHeaders === "raw" ? util5.parseRawHeaders(rawHeaders) : util5.parseHeaders(rawHeaders);
        if (statusCode < 200) {
          if (this.onInfo) {
            this.onInfo({ statusCode, headers });
          }
          return;
        }
        this.factory = null;
        if (factory === null) {
          return;
        }
        const res = this.runInAsyncScope(factory, null, {
          statusCode,
          headers,
          opaque,
          context: context2
        });
        if (!res || typeof res.write !== "function" || typeof res.end !== "function" || typeof res.on !== "function") {
          throw new InvalidReturnValueError("expected Writable");
        }
        finished(res, { readable: false }, (err) => {
          const { callback, res: res2, opaque: opaque2, trailers, abort } = this;
          this.res = null;
          if (err || !res2?.readable) {
            util5.destroy(res2, err);
          }
          this.callback = null;
          this.runInAsyncScope(callback, null, err || null, { opaque: opaque2, trailers });
          if (err) {
            abort();
          }
        });
        res.on("drain", resume);
        this.res = res;
        const needDrain = res.writableNeedDrain !== void 0 ? res.writableNeedDrain : res._writableState?.needDrain;
        return needDrain !== true;
      }
      onData(chunk) {
        const { res } = this;
        return res ? res.write(chunk) : true;
      }
      onComplete(trailers) {
        const { res } = this;
        removeSignal(this);
        if (!res) {
          return;
        }
        this.trailers = util5.parseHeaders(trailers);
        res.end();
      }
      onError(err) {
        const { res, callback, opaque, body } = this;
        removeSignal(this);
        this.factory = null;
        if (res) {
          this.res = null;
          util5.destroy(res, err);
        } else if (callback) {
          this.callback = null;
          queueMicrotask(() => {
            this.runInAsyncScope(callback, null, err, { opaque });
          });
        }
        if (body) {
          this.body = null;
          util5.destroy(body, err);
        }
      }
    };
    function stream2(opts, factory, callback) {
      if (callback === void 0) {
        return new Promise((resolve32, reject) => {
          stream2.call(this, opts, factory, (err, data) => {
            return err ? reject(err) : resolve32(data);
          });
        });
      }
      try {
        const handler = new StreamHandler(opts, factory, callback);
        this.dispatch(opts, handler);
      } catch (err) {
        if (typeof callback !== "function") {
          throw err;
        }
        const opaque = opts?.opaque;
        queueMicrotask(() => callback(err, { opaque }));
      }
    }
    __name(stream2, "stream");
    module2.exports = stream2;
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/api/api-pipeline.js
var require_api_pipeline = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/api/api-pipeline.js"(exports, module2) {
    init_import_meta_url();
    var {
      Readable: Readable11,
      Duplex: Duplex2,
      PassThrough: PassThrough4
    } = __require("stream");
    var assert61 = __require("assert");
    var { AsyncResource } = __require("async_hooks");
    var {
      InvalidArgumentError,
      InvalidReturnValueError,
      RequestAbortedError
    } = require_errors();
    var util5 = require_util();
    var { addSignal, removeSignal } = require_abort_signal();
    function noop() {
    }
    __name(noop, "noop");
    var kResume = Symbol("resume");
    var PipelineRequest = class extends Readable11 {
      static {
        __name(this, "PipelineRequest");
      }
      constructor() {
        super({ autoDestroy: true });
        this[kResume] = null;
      }
      _read() {
        const { [kResume]: resume } = this;
        if (resume) {
          this[kResume] = null;
          resume();
        }
      }
      _destroy(err, callback) {
        this._read();
        callback(err);
      }
    };
    var PipelineResponse = class extends Readable11 {
      static {
        __name(this, "PipelineResponse");
      }
      constructor(resume) {
        super({ autoDestroy: true });
        this[kResume] = resume;
      }
      _read() {
        this[kResume]();
      }
      _destroy(err, callback) {
        if (!err && !this._readableState.endEmitted) {
          err = new RequestAbortedError();
        }
        callback(err);
      }
    };
    var PipelineHandler = class extends AsyncResource {
      static {
        __name(this, "PipelineHandler");
      }
      constructor(opts, handler) {
        if (!opts || typeof opts !== "object") {
          throw new InvalidArgumentError("invalid opts");
        }
        if (typeof handler !== "function") {
          throw new InvalidArgumentError("invalid handler");
        }
        const { signal, method, opaque, onInfo, responseHeaders } = opts;
        if (signal && typeof signal.on !== "function" && typeof signal.addEventListener !== "function") {
          throw new InvalidArgumentError("signal must be an EventEmitter or EventTarget");
        }
        if (method === "CONNECT") {
          throw new InvalidArgumentError("invalid method");
        }
        if (onInfo && typeof onInfo !== "function") {
          throw new InvalidArgumentError("invalid onInfo callback");
        }
        super("UNDICI_PIPELINE");
        this.opaque = opaque || null;
        this.responseHeaders = responseHeaders || null;
        this.handler = handler;
        this.abort = null;
        this.context = null;
        this.onInfo = onInfo || null;
        this.req = new PipelineRequest().on("error", noop);
        this.ret = new Duplex2({
          readableObjectMode: opts.objectMode,
          autoDestroy: true,
          read: /* @__PURE__ */ __name(() => {
            const { body } = this;
            if (body?.resume) {
              body.resume();
            }
          }, "read"),
          write: /* @__PURE__ */ __name((chunk, encoding, callback) => {
            const { req } = this;
            if (req.push(chunk, encoding) || req._readableState.destroyed) {
              callback();
            } else {
              req[kResume] = callback;
            }
          }, "write"),
          destroy: /* @__PURE__ */ __name((err, callback) => {
            const { body, req, res, ret, abort } = this;
            if (!err && !ret._readableState.endEmitted) {
              err = new RequestAbortedError();
            }
            if (abort && err) {
              abort();
            }
            util5.destroy(body, err);
            util5.destroy(req, err);
            util5.destroy(res, err);
            removeSignal(this);
            callback(err);
          }, "destroy")
        }).on("prefinish", () => {
          const { req } = this;
          req.push(null);
        });
        this.res = null;
        addSignal(this, signal);
      }
      onConnect(abort, context2) {
        const { res } = this;
        if (this.reason) {
          abort(this.reason);
          return;
        }
        assert61(!res, "pipeline cannot be retried");
        this.abort = abort;
        this.context = context2;
      }
      onHeaders(statusCode, rawHeaders, resume) {
        const { opaque, handler, context: context2 } = this;
        if (statusCode < 200) {
          if (this.onInfo) {
            const headers = this.responseHeaders === "raw" ? util5.parseRawHeaders(rawHeaders) : util5.parseHeaders(rawHeaders);
            this.onInfo({ statusCode, headers });
          }
          return;
        }
        this.res = new PipelineResponse(resume);
        let body;
        try {
          this.handler = null;
          const headers = this.responseHeaders === "raw" ? util5.parseRawHeaders(rawHeaders) : util5.parseHeaders(rawHeaders);
          body = this.runInAsyncScope(handler, null, {
            statusCode,
            headers,
            opaque,
            body: this.res,
            context: context2
          });
        } catch (err) {
          this.res.on("error", noop);
          throw err;
        }
        if (!body || typeof body.on !== "function") {
          throw new InvalidReturnValueError("expected Readable");
        }
        body.on("data", (chunk) => {
          const { ret, body: body2 } = this;
          if (!ret.push(chunk) && body2.pause) {
            body2.pause();
          }
        }).on("error", (err) => {
          const { ret } = this;
          util5.destroy(ret, err);
        }).on("end", () => {
          const { ret } = this;
          ret.push(null);
        }).on("close", () => {
          const { ret } = this;
          if (!ret._readableState.ended) {
            util5.destroy(ret, new RequestAbortedError());
          }
        });
        this.body = body;
      }
      onData(chunk) {
        const { res } = this;
        return res.push(chunk);
      }
      onComplete(trailers) {
        const { res } = this;
        res.push(null);
      }
      onError(err) {
        const { ret } = this;
        this.handler = null;
        util5.destroy(ret, err);
      }
    };
    function pipeline(opts, handler) {
      try {
        const pipelineHandler = new PipelineHandler(opts, handler);
        this.dispatch({ ...opts, body: pipelineHandler.req }, pipelineHandler);
        return pipelineHandler.ret;
      } catch (err) {
        return new PassThrough4().destroy(err);
      }
    }
    __name(pipeline, "pipeline");
    module2.exports = pipeline;
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/api/api-upgrade.js
var require_api_upgrade = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/api/api-upgrade.js"(exports, module2) {
    init_import_meta_url();
    var { InvalidArgumentError, SocketError } = require_errors();
    var { AsyncResource } = __require("async_hooks");
    var assert61 = __require("assert");
    var util5 = require_util();
    var { kHTTP2Stream } = require_symbols();
    var { addSignal, removeSignal } = require_abort_signal();
    var UpgradeHandler = class extends AsyncResource {
      static {
        __name(this, "UpgradeHandler");
      }
      constructor(opts, callback) {
        if (!opts || typeof opts !== "object") {
          throw new InvalidArgumentError("invalid opts");
        }
        if (typeof callback !== "function") {
          throw new InvalidArgumentError("invalid callback");
        }
        const { signal, opaque, responseHeaders } = opts;
        if (signal && typeof signal.on !== "function" && typeof signal.addEventListener !== "function") {
          throw new InvalidArgumentError("signal must be an EventEmitter or EventTarget");
        }
        super("UNDICI_UPGRADE");
        this.responseHeaders = responseHeaders || null;
        this.opaque = opaque || null;
        this.callback = callback;
        this.abort = null;
        this.context = null;
        addSignal(this, signal);
      }
      onConnect(abort, context2) {
        if (this.reason) {
          abort(this.reason);
          return;
        }
        assert61(this.callback);
        this.abort = abort;
        this.context = null;
      }
      onHeaders() {
        throw new SocketError("bad upgrade", null);
      }
      onUpgrade(statusCode, rawHeaders, socket) {
        assert61(socket[kHTTP2Stream] === true ? statusCode === 200 : statusCode === 101);
        const { callback, opaque, context: context2 } = this;
        removeSignal(this);
        this.callback = null;
        const headers = this.responseHeaders === "raw" ? util5.parseRawHeaders(rawHeaders) : util5.parseHeaders(rawHeaders);
        this.runInAsyncScope(callback, null, null, {
          headers,
          socket,
          opaque,
          context: context2
        });
      }
      onError(err) {
        const { callback, opaque } = this;
        removeSignal(this);
        if (callback) {
          this.callback = null;
          queueMicrotask(() => {
            this.runInAsyncScope(callback, null, err, { opaque });
          });
        }
      }
    };
    function upgrade(opts, callback) {
      if (callback === void 0) {
        return new Promise((resolve32, reject) => {
          upgrade.call(this, opts, (err, data) => {
            return err ? reject(err) : resolve32(data);
          });
        });
      }
      try {
        const upgradeHandler = new UpgradeHandler(opts, callback);
        const upgradeOpts = {
          ...opts,
          method: opts.method || "GET",
          upgrade: opts.protocol || "Websocket"
        };
        this.dispatch(upgradeOpts, upgradeHandler);
      } catch (err) {
        if (typeof callback !== "function") {
          throw err;
        }
        const opaque = opts?.opaque;
        queueMicrotask(() => callback(err, { opaque }));
      }
    }
    __name(upgrade, "upgrade");
    module2.exports = upgrade;
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/api/api-connect.js
var require_api_connect = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/api/api-connect.js"(exports, module2) {
    init_import_meta_url();
    var assert61 = __require("assert");
    var { AsyncResource } = __require("async_hooks");
    var { InvalidArgumentError, SocketError } = require_errors();
    var util5 = require_util();
    var { addSignal, removeSignal } = require_abort_signal();
    var ConnectHandler = class extends AsyncResource {
      static {
        __name(this, "ConnectHandler");
      }
      constructor(opts, callback) {
        if (!opts || typeof opts !== "object") {
          throw new InvalidArgumentError("invalid opts");
        }
        if (typeof callback !== "function") {
          throw new InvalidArgumentError("invalid callback");
        }
        const { signal, opaque, responseHeaders } = opts;
        if (signal && typeof signal.on !== "function" && typeof signal.addEventListener !== "function") {
          throw new InvalidArgumentError("signal must be an EventEmitter or EventTarget");
        }
        super("UNDICI_CONNECT");
        this.opaque = opaque || null;
        this.responseHeaders = responseHeaders || null;
        this.callback = callback;
        this.abort = null;
        addSignal(this, signal);
      }
      onConnect(abort, context2) {
        if (this.reason) {
          abort(this.reason);
          return;
        }
        assert61(this.callback);
        this.abort = abort;
        this.context = context2;
      }
      onHeaders() {
        throw new SocketError("bad connect", null);
      }
      onUpgrade(statusCode, rawHeaders, socket) {
        const { callback, opaque, context: context2 } = this;
        removeSignal(this);
        this.callback = null;
        let headers = rawHeaders;
        if (headers != null) {
          headers = this.responseHeaders === "raw" ? util5.parseRawHeaders(rawHeaders) : util5.parseHeaders(rawHeaders);
        }
        this.runInAsyncScope(callback, null, null, {
          statusCode,
          headers,
          socket,
          opaque,
          context: context2
        });
      }
      onError(err) {
        const { callback, opaque } = this;
        removeSignal(this);
        if (callback) {
          this.callback = null;
          queueMicrotask(() => {
            this.runInAsyncScope(callback, null, err, { opaque });
          });
        }
      }
    };
    function connect(opts, callback) {
      if (callback === void 0) {
        return new Promise((resolve32, reject) => {
          connect.call(this, opts, (err, data) => {
            return err ? reject(err) : resolve32(data);
          });
        });
      }
      try {
        const connectHandler = new ConnectHandler(opts, callback);
        const connectOptions = { ...opts, method: "CONNECT" };
        this.dispatch(connectOptions, connectHandler);
      } catch (err) {
        if (typeof callback !== "function") {
          throw err;
        }
        const opaque = opts?.opaque;
        queueMicrotask(() => callback(err, { opaque }));
      }
    }
    __name(connect, "connect");
    module2.exports = connect;
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/api/index.js
var require_api = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/api/index.js"(exports, module2) {
    init_import_meta_url();
    module2.exports.request = require_api_request();
    module2.exports.stream = require_api_stream();
    module2.exports.pipeline = require_api_pipeline();
    module2.exports.upgrade = require_api_upgrade();
    module2.exports.connect = require_api_connect();
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/mock/mock-errors.js
var require_mock_errors = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/mock/mock-errors.js"(exports, module2) {
    init_import_meta_url();
    var { UndiciError } = require_errors();
    var kMockNotMatchedError = Symbol.for("undici.error.UND_MOCK_ERR_MOCK_NOT_MATCHED");
    var MockNotMatchedError = class extends UndiciError {
      static {
        __name(this, "MockNotMatchedError");
      }
      constructor(message) {
        super(message);
        this.name = "MockNotMatchedError";
        this.message = message || "The request does not match any registered mock dispatches";
        this.code = "UND_MOCK_ERR_MOCK_NOT_MATCHED";
      }
      static [Symbol.hasInstance](instance) {
        return instance && instance[kMockNotMatchedError] === true;
      }
      get [kMockNotMatchedError]() {
        return true;
      }
    };
    module2.exports = {
      MockNotMatchedError
    };
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/mock/mock-symbols.js
var require_mock_symbols = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/mock/mock-symbols.js"(exports, module2) {
    init_import_meta_url();
    module2.exports = {
      kAgent: Symbol("agent"),
      kOptions: Symbol("options"),
      kFactory: Symbol("factory"),
      kDispatches: Symbol("dispatches"),
      kDispatchKey: Symbol("dispatch key"),
      kDefaultHeaders: Symbol("default headers"),
      kDefaultTrailers: Symbol("default trailers"),
      kContentLength: Symbol("content length"),
      kMockAgent: Symbol("mock agent"),
      kMockAgentSet: Symbol("mock agent set"),
      kMockAgentGet: Symbol("mock agent get"),
      kMockDispatch: Symbol("mock dispatch"),
      kClose: Symbol("close"),
      kOriginalClose: Symbol("original agent close"),
      kOriginalDispatch: Symbol("original dispatch"),
      kOrigin: Symbol("origin"),
      kIsMockActive: Symbol("is mock active"),
      kNetConnect: Symbol("net connect"),
      kGetNetConnect: Symbol("get net connect"),
      kConnected: Symbol("connected"),
      kIgnoreTrailingSlash: Symbol("ignore trailing slash"),
      kMockAgentMockCallHistoryInstance: Symbol("mock agent mock call history name"),
      kMockAgentRegisterCallHistory: Symbol("mock agent register mock call history"),
      kMockAgentAddCallHistoryLog: Symbol("mock agent add call history log"),
      kMockAgentIsCallHistoryEnabled: Symbol("mock agent is call history enabled"),
      kMockAgentAcceptsNonStandardSearchParameters: Symbol("mock agent accepts non standard search parameters"),
      kMockCallHistoryAddLog: Symbol("mock call history add log")
    };
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/mock/mock-utils.js
var require_mock_utils = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/mock/mock-utils.js"(exports, module2) {
    init_import_meta_url();
    var { MockNotMatchedError } = require_mock_errors();
    var {
      kDispatches,
      kMockAgent,
      kOriginalDispatch,
      kOrigin,
      kGetNetConnect
    } = require_mock_symbols();
    var { serializePathWithQuery } = require_util();
    var { STATUS_CODES: STATUS_CODES2 } = __require("http");
    var {
      types: {
        isPromise: isPromise2
      }
    } = __require("util");
    var { InvalidArgumentError } = require_errors();
    function matchValue(match3, value) {
      if (typeof match3 === "string") {
        return match3 === value;
      }
      if (match3 instanceof RegExp) {
        return match3.test(value);
      }
      if (typeof match3 === "function") {
        return match3(value) === true;
      }
      return false;
    }
    __name(matchValue, "matchValue");
    function lowerCaseEntries(headers) {
      return Object.fromEntries(
        Object.entries(headers).map(([headerName, headerValue]) => {
          return [headerName.toLocaleLowerCase(), headerValue];
        })
      );
    }
    __name(lowerCaseEntries, "lowerCaseEntries");
    function getHeaderByName(headers, key) {
      if (Array.isArray(headers)) {
        for (let i7 = 0; i7 < headers.length; i7 += 2) {
          if (headers[i7].toLocaleLowerCase() === key.toLocaleLowerCase()) {
            return headers[i7 + 1];
          }
        }
        return void 0;
      } else if (typeof headers.get === "function") {
        return headers.get(key);
      } else {
        return lowerCaseEntries(headers)[key.toLocaleLowerCase()];
      }
    }
    __name(getHeaderByName, "getHeaderByName");
    function buildHeadersFromArray(headers) {
      const clone2 = headers.slice();
      const entries2 = [];
      for (let index = 0; index < clone2.length; index += 2) {
        entries2.push([clone2[index], clone2[index + 1]]);
      }
      return Object.fromEntries(entries2);
    }
    __name(buildHeadersFromArray, "buildHeadersFromArray");
    function matchHeaders(mockDispatch2, headers) {
      if (typeof mockDispatch2.headers === "function") {
        if (Array.isArray(headers)) {
          headers = buildHeadersFromArray(headers);
        }
        return mockDispatch2.headers(headers ? lowerCaseEntries(headers) : {});
      }
      if (typeof mockDispatch2.headers === "undefined") {
        return true;
      }
      if (typeof headers !== "object" || typeof mockDispatch2.headers !== "object") {
        return false;
      }
      for (const [matchHeaderName, matchHeaderValue] of Object.entries(mockDispatch2.headers)) {
        const headerValue = getHeaderByName(headers, matchHeaderName);
        if (!matchValue(matchHeaderValue, headerValue)) {
          return false;
        }
      }
      return true;
    }
    __name(matchHeaders, "matchHeaders");
    function normalizeSearchParams(query) {
      if (typeof query !== "string") {
        return query;
      }
      const originalQp = new URLSearchParams(query);
      const normalizedQp = new URLSearchParams();
      for (let [key, value] of originalQp.entries()) {
        key = key.replace("[]", "");
        const valueRepresentsString = /^(['"]).*\1$/.test(value);
        if (valueRepresentsString) {
          normalizedQp.append(key, value);
          continue;
        }
        if (value.includes(",")) {
          const values = value.split(",");
          for (const v8 of values) {
            normalizedQp.append(key, v8);
          }
          continue;
        }
        normalizedQp.append(key, value);
      }
      return normalizedQp;
    }
    __name(normalizeSearchParams, "normalizeSearchParams");
    function safeUrl(path84) {
      if (typeof path84 !== "string") {
        return path84;
      }
      const pathSegments = path84.split("?", 3);
      if (pathSegments.length !== 2) {
        return path84;
      }
      const qp = new URLSearchParams(pathSegments.pop());
      qp.sort();
      return [...pathSegments, qp.toString()].join("?");
    }
    __name(safeUrl, "safeUrl");
    function matchKey(mockDispatch2, { path: path84, method, body, headers }) {
      const pathMatch = matchValue(mockDispatch2.path, path84);
      const methodMatch = matchValue(mockDispatch2.method, method);
      const bodyMatch = typeof mockDispatch2.body !== "undefined" ? matchValue(mockDispatch2.body, body) : true;
      const headersMatch = matchHeaders(mockDispatch2, headers);
      return pathMatch && methodMatch && bodyMatch && headersMatch;
    }
    __name(matchKey, "matchKey");
    function getResponseData(data) {
      if (Buffer.isBuffer(data)) {
        return data;
      } else if (data instanceof Uint8Array) {
        return data;
      } else if (data instanceof ArrayBuffer) {
        return data;
      } else if (typeof data === "object") {
        return JSON.stringify(data);
      } else if (data) {
        return data.toString();
      } else {
        return "";
      }
    }
    __name(getResponseData, "getResponseData");
    function getMockDispatch(mockDispatches, key) {
      const basePath = key.query ? serializePathWithQuery(key.path, key.query) : key.path;
      const resolvedPath2 = typeof basePath === "string" ? safeUrl(basePath) : basePath;
      const resolvedPathWithoutTrailingSlash = removeTrailingSlash2(resolvedPath2);
      let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path84, ignoreTrailingSlash }) => {
        return ignoreTrailingSlash ? matchValue(removeTrailingSlash2(safeUrl(path84)), resolvedPathWithoutTrailingSlash) : matchValue(safeUrl(path84), resolvedPath2);
      });
      if (matchedMockDispatches.length === 0) {
        throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath2}'`);
      }
      matchedMockDispatches = matchedMockDispatches.filter(({ method }) => matchValue(method, key.method));
      if (matchedMockDispatches.length === 0) {
        throw new MockNotMatchedError(`Mock dispatch not matched for method '${key.method}' on path '${resolvedPath2}'`);
      }
      matchedMockDispatches = matchedMockDispatches.filter(({ body }) => typeof body !== "undefined" ? matchValue(body, key.body) : true);
      if (matchedMockDispatches.length === 0) {
        throw new MockNotMatchedError(`Mock dispatch not matched for body '${key.body}' on path '${resolvedPath2}'`);
      }
      matchedMockDispatches = matchedMockDispatches.filter((mockDispatch2) => matchHeaders(mockDispatch2, key.headers));
      if (matchedMockDispatches.length === 0) {
        const headers = typeof key.headers === "object" ? JSON.stringify(key.headers) : key.headers;
        throw new MockNotMatchedError(`Mock dispatch not matched for headers '${headers}' on path '${resolvedPath2}'`);
      }
      return matchedMockDispatches[0];
    }
    __name(getMockDispatch, "getMockDispatch");
    function addMockDispatch(mockDispatches, key, data, opts) {
      const baseData = { timesInvoked: 0, times: 1, persist: false, consumed: false, ...opts };
      const replyData = typeof data === "function" ? { callback: data } : { ...data };
      const newMockDispatch = { ...baseData, ...key, pending: true, data: { error: null, ...replyData } };
      mockDispatches.push(newMockDispatch);
      return newMockDispatch;
    }
    __name(addMockDispatch, "addMockDispatch");
    function deleteMockDispatch(mockDispatches, key) {
      const index = mockDispatches.findIndex((dispatch) => {
        if (!dispatch.consumed) {
          return false;
        }
        return matchKey(dispatch, key);
      });
      if (index !== -1) {
        mockDispatches.splice(index, 1);
      }
    }
    __name(deleteMockDispatch, "deleteMockDispatch");
    function removeTrailingSlash2(path84) {
      while (path84.endsWith("/")) {
        path84 = path84.slice(0, -1);
      }
      if (path84.length === 0) {
        path84 = "/";
      }
      return path84;
    }
    __name(removeTrailingSlash2, "removeTrailingSlash");
    function buildKey(opts) {
      const { path: path84, method, body, headers, query } = opts;
      return {
        path: path84,
        method,
        body,
        headers,
        query
      };
    }
    __name(buildKey, "buildKey");
    function generateKeyValues(data) {
      const keys = Object.keys(data);
      const result = [];
      for (let i7 = 0; i7 < keys.length; ++i7) {
        const key = keys[i7];
        const value = data[key];
        const name2 = Buffer.from(`${key}`);
        if (Array.isArray(value)) {
          for (let j7 = 0; j7 < value.length; ++j7) {
            result.push(name2, Buffer.from(`${value[j7]}`));
          }
        } else {
          result.push(name2, Buffer.from(`${value}`));
        }
      }
      return result;
    }
    __name(generateKeyValues, "generateKeyValues");
    function getStatusText(statusCode) {
      return STATUS_CODES2[statusCode] || "unknown";
    }
    __name(getStatusText, "getStatusText");
    async function getResponse(body) {
      const buffers = [];
      for await (const data of body) {
        buffers.push(data);
      }
      return Buffer.concat(buffers).toString("utf8");
    }
    __name(getResponse, "getResponse");
    function mockDispatch(opts, handler) {
      const key = buildKey(opts);
      const mockDispatch2 = getMockDispatch(this[kDispatches], key);
      mockDispatch2.timesInvoked++;
      if (mockDispatch2.data.callback) {
        mockDispatch2.data = { ...mockDispatch2.data, ...mockDispatch2.data.callback(opts) };
      }
      const { data: { statusCode, data, headers, trailers, error: error2 }, delay, persist } = mockDispatch2;
      const { timesInvoked, times } = mockDispatch2;
      mockDispatch2.consumed = !persist && timesInvoked >= times;
      mockDispatch2.pending = timesInvoked < times;
      if (error2 !== null) {
        deleteMockDispatch(this[kDispatches], key);
        handler.onError(error2);
        return true;
      }
      let aborted = false;
      let timer = null;
      function abort(err) {
        if (aborted) {
          return;
        }
        aborted = true;
        if (timer !== null) {
          clearTimeout(timer);
          timer = null;
        }
        handler.onError(err);
      }
      __name(abort, "abort");
      handler.onConnect?.(abort, null);
      if (typeof delay === "number" && delay > 0) {
        timer = setTimeout(() => {
          timer = null;
          handleReply(this[kDispatches]);
        }, delay);
      } else {
        handleReply(this[kDispatches]);
      }
      function handleReply(mockDispatches, _data5 = data) {
        if (aborted) {
          return;
        }
        const optsHeaders = Array.isArray(opts.headers) ? buildHeadersFromArray(opts.headers) : opts.headers;
        const body = typeof _data5 === "function" ? _data5({ ...opts, headers: optsHeaders }) : _data5;
        if (isPromise2(body)) {
          return body.then((newData) => handleReply(mockDispatches, newData));
        }
        if (aborted) {
          return;
        }
        const responseData = getResponseData(body);
        const responseHeaders = generateKeyValues(headers);
        const responseTrailers = generateKeyValues(trailers);
        handler.onHeaders?.(statusCode, responseHeaders, resume, getStatusText(statusCode));
        handler.onData?.(Buffer.from(responseData));
        handler.onComplete?.(responseTrailers);
        deleteMockDispatch(mockDispatches, key);
      }
      __name(handleReply, "handleReply");
      function resume() {
      }
      __name(resume, "resume");
      return true;
    }
    __name(mockDispatch, "mockDispatch");
    function buildMockDispatch() {
      const agent = this[kMockAgent];
      const origin = this[kOrigin];
      const originalDispatch = this[kOriginalDispatch];
      return /* @__PURE__ */ __name(function dispatch(opts, handler) {
        if (agent.isMockActive) {
          try {
            mockDispatch.call(this, opts, handler);
          } catch (error2) {
            if (error2.code === "UND_MOCK_ERR_MOCK_NOT_MATCHED") {
              const netConnect = agent[kGetNetConnect]();
              if (netConnect === false) {
                throw new MockNotMatchedError(`${error2.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`);
              }
              if (checkNetConnect(netConnect, origin)) {
                originalDispatch.call(this, opts, handler);
              } else {
                throw new MockNotMatchedError(`${error2.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`);
              }
            } else {
              throw error2;
            }
          }
        } else {
          originalDispatch.call(this, opts, handler);
        }
      }, "dispatch");
    }
    __name(buildMockDispatch, "buildMockDispatch");
    function checkNetConnect(netConnect, origin) {
      const url4 = new URL(origin);
      if (netConnect === true) {
        return true;
      } else if (Array.isArray(netConnect) && netConnect.some((matcher) => matchValue(matcher, url4.host))) {
        return true;
      }
      return false;
    }
    __name(checkNetConnect, "checkNetConnect");
    function normalizeOrigin(origin) {
      if (typeof origin !== "string" && !(origin instanceof URL)) {
        return origin;
      }
      if (origin instanceof URL) {
        return origin.origin;
      }
      return origin.toLowerCase();
    }
    __name(normalizeOrigin, "normalizeOrigin");
    function buildAndValidateMockOptions(opts) {
      const { agent, ...mockOptions } = opts;
      if ("enableCallHistory" in mockOptions && typeof mockOptions.enableCallHistory !== "boolean") {
        throw new InvalidArgumentError("options.enableCallHistory must to be a boolean");
      }
      if ("acceptNonStandardSearchParameters" in mockOptions && typeof mockOptions.acceptNonStandardSearchParameters !== "boolean") {
        throw new InvalidArgumentError("options.acceptNonStandardSearchParameters must to be a boolean");
      }
      if ("ignoreTrailingSlash" in mockOptions && typeof mockOptions.ignoreTrailingSlash !== "boolean") {
        throw new InvalidArgumentError("options.ignoreTrailingSlash must to be a boolean");
      }
      return mockOptions;
    }
    __name(buildAndValidateMockOptions, "buildAndValidateMockOptions");
    module2.exports = {
      getResponseData,
      getMockDispatch,
      addMockDispatch,
      deleteMockDispatch,
      buildKey,
      generateKeyValues,
      matchValue,
      getResponse,
      getStatusText,
      mockDispatch,
      buildMockDispatch,
      checkNetConnect,
      buildAndValidateMockOptions,
      getHeaderByName,
      buildHeadersFromArray,
      normalizeSearchParams,
      normalizeOrigin
    };
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/mock/mock-interceptor.js
var require_mock_interceptor = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/mock/mock-interceptor.js"(exports, module2) {
    init_import_meta_url();
    var { getResponseData, buildKey, addMockDispatch } = require_mock_utils();
    var {
      kDispatches,
      kDispatchKey,
      kDefaultHeaders,
      kDefaultTrailers,
      kContentLength,
      kMockDispatch,
      kIgnoreTrailingSlash
    } = require_mock_symbols();
    var { InvalidArgumentError } = require_errors();
    var { serializePathWithQuery } = require_util();
    var MockScope = class {
      static {
        __name(this, "MockScope");
      }
      constructor(mockDispatch) {
        this[kMockDispatch] = mockDispatch;
      }
      /**
       * Delay a reply by a set amount in ms.
       */
      delay(waitInMs) {
        if (typeof waitInMs !== "number" || !Number.isInteger(waitInMs) || waitInMs <= 0) {
          throw new InvalidArgumentError("waitInMs must be a valid integer > 0");
        }
        this[kMockDispatch].delay = waitInMs;
        return this;
      }
      /**
       * For a defined reply, never mark as consumed.
       */
      persist() {
        this[kMockDispatch].persist = true;
        return this;
      }
      /**
       * Allow one to define a reply for a set amount of matching requests.
       */
      times(repeatTimes) {
        if (typeof repeatTimes !== "number" || !Number.isInteger(repeatTimes) || repeatTimes <= 0) {
          throw new InvalidArgumentError("repeatTimes must be a valid integer > 0");
        }
        this[kMockDispatch].times = repeatTimes;
        return this;
      }
    };
    var MockInterceptor = class {
      static {
        __name(this, "MockInterceptor");
      }
      constructor(opts, mockDispatches) {
        if (typeof opts !== "object") {
          throw new InvalidArgumentError("opts must be an object");
        }
        if (typeof opts.path === "undefined") {
          throw new InvalidArgumentError("opts.path must be defined");
        }
        if (typeof opts.method === "undefined") {
          opts.method = "GET";
        }
        if (typeof opts.path === "string") {
          if (opts.query) {
            opts.path = serializePathWithQuery(opts.path, opts.query);
          } else {
            const parsedURL = new URL(opts.path, "data://");
            opts.path = parsedURL.pathname + parsedURL.search;
          }
        }
        if (typeof opts.method === "string") {
          opts.method = opts.method.toUpperCase();
        }
        this[kDispatchKey] = buildKey(opts);
        this[kDispatches] = mockDispatches;
        this[kIgnoreTrailingSlash] = opts.ignoreTrailingSlash ?? false;
        this[kDefaultHeaders] = {};
        this[kDefaultTrailers] = {};
        this[kContentLength] = false;
      }
      createMockScopeDispatchData({ statusCode, data, responseOptions }) {
        const responseData = getResponseData(data);
        const contentLength = this[kContentLength] ? { "content-length": responseData.length } : {};
        const headers = { ...this[kDefaultHeaders], ...contentLength, ...responseOptions.headers };
        const trailers = { ...this[kDefaultTrailers], ...responseOptions.trailers };
        return { statusCode, data, headers, trailers };
      }
      validateReplyParameters(replyParameters) {
        if (typeof replyParameters.statusCode === "undefined") {
          throw new InvalidArgumentError("statusCode must be defined");
        }
        if (typeof replyParameters.responseOptions !== "object" || replyParameters.responseOptions === null) {
          throw new InvalidArgumentError("responseOptions must be an object");
        }
      }
      /**
       * Mock an undici request with a defined reply.
       */
      reply(replyOptionsCallbackOrStatusCode) {
        if (typeof replyOptionsCallbackOrStatusCode === "function") {
          const wrappedDefaultsCallback = /* @__PURE__ */ __name((opts) => {
            const resolvedData = replyOptionsCallbackOrStatusCode(opts);
            if (typeof resolvedData !== "object" || resolvedData === null) {
              throw new InvalidArgumentError("reply options callback must return an object");
            }
            const replyParameters2 = { data: "", responseOptions: {}, ...resolvedData };
            this.validateReplyParameters(replyParameters2);
            return {
              ...this.createMockScopeDispatchData(replyParameters2)
            };
          }, "wrappedDefaultsCallback");
          const newMockDispatch2 = addMockDispatch(this[kDispatches], this[kDispatchKey], wrappedDefaultsCallback, { ignoreTrailingSlash: this[kIgnoreTrailingSlash] });
          return new MockScope(newMockDispatch2);
        }
        const replyParameters = {
          statusCode: replyOptionsCallbackOrStatusCode,
          data: arguments[1] === void 0 ? "" : arguments[1],
          responseOptions: arguments[2] === void 0 ? {} : arguments[2]
        };
        this.validateReplyParameters(replyParameters);
        const dispatchData = this.createMockScopeDispatchData(replyParameters);
        const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], dispatchData, { ignoreTrailingSlash: this[kIgnoreTrailingSlash] });
        return new MockScope(newMockDispatch);
      }
      /**
       * Mock an undici request with a defined error.
       */
      replyWithError(error2) {
        if (typeof error2 === "undefined") {
          throw new InvalidArgumentError("error must be defined");
        }
        const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error: error2 }, { ignoreTrailingSlash: this[kIgnoreTrailingSlash] });
        return new MockScope(newMockDispatch);
      }
      /**
       * Set default reply headers on the interceptor for subsequent replies
       */
      defaultReplyHeaders(headers) {
        if (typeof headers === "undefined") {
          throw new InvalidArgumentError("headers must be defined");
        }
        this[kDefaultHeaders] = headers;
        return this;
      }
      /**
       * Set default reply trailers on the interceptor for subsequent replies
       */
      defaultReplyTrailers(trailers) {
        if (typeof trailers === "undefined") {
          throw new InvalidArgumentError("trailers must be defined");
        }
        this[kDefaultTrailers] = trailers;
        return this;
      }
      /**
       * Set reply content length header for replies on the interceptor
       */
      replyContentLength() {
        this[kContentLength] = true;
        return this;
      }
    };
    module2.exports.MockInterceptor = MockInterceptor;
    module2.exports.MockScope = MockScope;
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/mock/mock-client.js
var require_mock_client = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/mock/mock-client.js"(exports, module2) {
    init_import_meta_url();
    var { promisify: promisify9 } = __require("util");
    var Client2 = require_client();
    var { buildMockDispatch } = require_mock_utils();
    var {
      kDispatches,
      kMockAgent,
      kClose,
      kOriginalClose,
      kOrigin,
      kOriginalDispatch,
      kConnected,
      kIgnoreTrailingSlash
    } = require_mock_symbols();
    var { MockInterceptor } = require_mock_interceptor();
    var Symbols = require_symbols();
    var { InvalidArgumentError } = require_errors();
    var MockClient = class extends Client2 {
      static {
        __name(this, "MockClient");
      }
      constructor(origin, opts) {
        if (!opts || !opts.agent || typeof opts.agent.dispatch !== "function") {
          throw new InvalidArgumentError("Argument opts.agent must implement Agent");
        }
        super(origin, opts);
        this[kMockAgent] = opts.agent;
        this[kOrigin] = origin;
        this[kIgnoreTrailingSlash] = opts.ignoreTrailingSlash ?? false;
        this[kDispatches] = [];
        this[kConnected] = 1;
        this[kOriginalDispatch] = this.dispatch;
        this[kOriginalClose] = this.close.bind(this);
        this.dispatch = buildMockDispatch.call(this);
        this.close = this[kClose];
      }
      get [Symbols.kConnected]() {
        return this[kConnected];
      }
      /**
       * Sets up the base interceptor for mocking replies from undici.
       */
      intercept(opts) {
        return new MockInterceptor(
          opts && { ignoreTrailingSlash: this[kIgnoreTrailingSlash], ...opts },
          this[kDispatches]
        );
      }
      cleanMocks() {
        this[kDispatches] = [];
      }
      async [kClose]() {
        await promisify9(this[kOriginalClose])();
        this[kConnected] = 0;
        this[kMockAgent][Symbols.kClients].delete(this[kOrigin]);
      }
    };
    module2.exports = MockClient;
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/mock/mock-call-history.js
var require_mock_call_history = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/mock/mock-call-history.js"(exports, module2) {
    init_import_meta_url();
    var { kMockCallHistoryAddLog } = require_mock_symbols();
    var { InvalidArgumentError } = require_errors();
    function handleFilterCallsWithOptions(criteria, options, handler, store) {
      switch (options.operator) {
        case "OR":
          store.push(...handler(criteria));
          return store;
        case "AND":
          return handler.call({ logs: store }, criteria);
        default:
          throw new InvalidArgumentError("options.operator must to be a case insensitive string equal to 'OR' or 'AND'");
      }
    }
    __name(handleFilterCallsWithOptions, "handleFilterCallsWithOptions");
    function buildAndValidateFilterCallsOptions(options = {}) {
      const finalOptions = {};
      if ("operator" in options) {
        if (typeof options.operator !== "string" || options.operator.toUpperCase() !== "OR" && options.operator.toUpperCase() !== "AND") {
          throw new InvalidArgumentError("options.operator must to be a case insensitive string equal to 'OR' or 'AND'");
        }
        return {
          ...finalOptions,
          operator: options.operator.toUpperCase()
        };
      }
      return finalOptions;
    }
    __name(buildAndValidateFilterCallsOptions, "buildAndValidateFilterCallsOptions");
    function makeFilterCalls(parameterName) {
      return (parameterValue) => {
        if (typeof parameterValue === "string" || parameterValue == null) {
          return this.logs.filter((log2) => {
            return log2[parameterName] === parameterValue;
          });
        }
        if (parameterValue instanceof RegExp) {
          return this.logs.filter((log2) => {
            return parameterValue.test(log2[parameterName]);
          });
        }
        throw new InvalidArgumentError(`${parameterName} parameter should be one of string, regexp, undefined or null`);
      };
    }
    __name(makeFilterCalls, "makeFilterCalls");
    function computeUrlWithMaybeSearchParameters(requestInit) {
      try {
        const url4 = new URL(requestInit.path, requestInit.origin);
        if (url4.search.length !== 0) {
          return url4;
        }
        url4.search = new URLSearchParams(requestInit.query).toString();
        return url4;
      } catch (error2) {
        throw new InvalidArgumentError("An error occurred when computing MockCallHistoryLog.url", { cause: error2 });
      }
    }
    __name(computeUrlWithMaybeSearchParameters, "computeUrlWithMaybeSearchParameters");
    var MockCallHistoryLog = class {
      static {
        __name(this, "MockCallHistoryLog");
      }
      constructor(requestInit = {}) {
        this.body = requestInit.body;
        this.headers = requestInit.headers;
        this.method = requestInit.method;
        const url4 = computeUrlWithMaybeSearchParameters(requestInit);
        this.fullUrl = url4.toString();
        this.origin = url4.origin;
        this.path = url4.pathname;
        this.searchParams = Object.fromEntries(url4.searchParams);
        this.protocol = url4.protocol;
        this.host = url4.host;
        this.port = url4.port;
        this.hash = url4.hash;
      }
      toMap() {
        return /* @__PURE__ */ new Map(
          [
            ["protocol", this.protocol],
            ["host", this.host],
            ["port", this.port],
            ["origin", this.origin],
            ["path", this.path],
            ["hash", this.hash],
            ["searchParams", this.searchParams],
            ["fullUrl", this.fullUrl],
            ["method", this.method],
            ["body", this.body],
            ["headers", this.headers]
          ]
        );
      }
      toString() {
        const options = { betweenKeyValueSeparator: "->", betweenPairSeparator: "|" };
        let result = "";
        this.toMap().forEach((value, key) => {
          if (typeof value === "string" || value === void 0 || value === null) {
            result = `${result}${key}${options.betweenKeyValueSeparator}${value}${options.betweenPairSeparator}`;
          }
          if (typeof value === "object" && value !== null || Array.isArray(value)) {
            result = `${result}${key}${options.betweenKeyValueSeparator}${JSON.stringify(value)}${options.betweenPairSeparator}`;
          }
        });
        return result.slice(0, -1);
      }
    };
    var MockCallHistory = class {
      static {
        __name(this, "MockCallHistory");
      }
      logs = [];
      calls() {
        return this.logs;
      }
      firstCall() {
        return this.logs.at(0);
      }
      lastCall() {
        return this.logs.at(-1);
      }
      nthCall(number) {
        if (typeof number !== "number") {
          throw new InvalidArgumentError("nthCall must be called with a number");
        }
        if (!Number.isInteger(number)) {
          throw new InvalidArgumentError("nthCall must be called with an integer");
        }
        if (Math.sign(number) !== 1) {
          throw new InvalidArgumentError("nthCall must be called with a positive value. use firstCall or lastCall instead");
        }
        return this.logs.at(number - 1);
      }
      filterCalls(criteria, options) {
        if (this.logs.length === 0) {
          return this.logs;
        }
        if (typeof criteria === "function") {
          return this.logs.filter(criteria);
        }
        if (criteria instanceof RegExp) {
          return this.logs.filter((log2) => {
            return criteria.test(log2.toString());
          });
        }
        if (typeof criteria === "object" && criteria !== null) {
          if (Object.keys(criteria).length === 0) {
            return this.logs;
          }
          const finalOptions = { operator: "OR", ...buildAndValidateFilterCallsOptions(options) };
          let maybeDuplicatedLogsFiltered = [];
          if ("protocol" in criteria) {
            maybeDuplicatedLogsFiltered = handleFilterCallsWithOptions(criteria.protocol, finalOptions, this.filterCallsByProtocol, maybeDuplicatedLogsFiltered);
          }
          if ("host" in criteria) {
            maybeDuplicatedLogsFiltered = handleFilterCallsWithOptions(criteria.host, finalOptions, this.filterCallsByHost, maybeDuplicatedLogsFiltered);
          }
          if ("port" in criteria) {
            maybeDuplicatedLogsFiltered = handleFilterCallsWithOptions(criteria.port, finalOptions, this.filterCallsByPort, maybeDuplicatedLogsFiltered);
          }
          if ("origin" in criteria) {
            maybeDuplicatedLogsFiltered = handleFilterCallsWithOptions(criteria.origin, finalOptions, this.filterCallsByOrigin, maybeDuplicatedLogsFiltered);
          }
          if ("path" in criteria) {
            maybeDuplicatedLogsFiltered = handleFilterCallsWithOptions(criteria.path, finalOptions, this.filterCallsByPath, maybeDuplicatedLogsFiltered);
          }
          if ("hash" in criteria) {
            maybeDuplicatedLogsFiltered = handleFilterCallsWithOptions(criteria.hash, finalOptions, this.filterCallsByHash, maybeDuplicatedLogsFiltered);
          }
          if ("fullUrl" in criteria) {
            maybeDuplicatedLogsFiltered = handleFilterCallsWithOptions(criteria.fullUrl, finalOptions, this.filterCallsByFullUrl, maybeDuplicatedLogsFiltered);
          }
          if ("method" in criteria) {
            maybeDuplicatedLogsFiltered = handleFilterCallsWithOptions(criteria.method, finalOptions, this.filterCallsByMethod, maybeDuplicatedLogsFiltered);
          }
          const uniqLogsFiltered = [...new Set(maybeDuplicatedLogsFiltered)];
          return uniqLogsFiltered;
        }
        throw new InvalidArgumentError("criteria parameter should be one of function, regexp, or object");
      }
      filterCallsByProtocol = makeFilterCalls.call(this, "protocol");
      filterCallsByHost = makeFilterCalls.call(this, "host");
      filterCallsByPort = makeFilterCalls.call(this, "port");
      filterCallsByOrigin = makeFilterCalls.call(this, "origin");
      filterCallsByPath = makeFilterCalls.call(this, "path");
      filterCallsByHash = makeFilterCalls.call(this, "hash");
      filterCallsByFullUrl = makeFilterCalls.call(this, "fullUrl");
      filterCallsByMethod = makeFilterCalls.call(this, "method");
      clear() {
        this.logs = [];
      }
      [kMockCallHistoryAddLog](requestInit) {
        const log2 = new MockCallHistoryLog(requestInit);
        this.logs.push(log2);
        return log2;
      }
      *[Symbol.iterator]() {
        for (const log2 of this.calls()) {
          yield log2;
        }
      }
    };
    module2.exports.MockCallHistory = MockCallHistory;
    module2.exports.MockCallHistoryLog = MockCallHistoryLog;
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/mock/mock-pool.js
var require_mock_pool = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/mock/mock-pool.js"(exports, module2) {
    init_import_meta_url();
    var { promisify: promisify9 } = __require("util");
    var Pool = require_pool();
    var { buildMockDispatch } = require_mock_utils();
    var {
      kDispatches,
      kMockAgent,
      kClose,
      kOriginalClose,
      kOrigin,
      kOriginalDispatch,
      kConnected,
      kIgnoreTrailingSlash
    } = require_mock_symbols();
    var { MockInterceptor } = require_mock_interceptor();
    var Symbols = require_symbols();
    var { InvalidArgumentError } = require_errors();
    var MockPool = class extends Pool {
      static {
        __name(this, "MockPool");
      }
      constructor(origin, opts) {
        if (!opts || !opts.agent || typeof opts.agent.dispatch !== "function") {
          throw new InvalidArgumentError("Argument opts.agent must implement Agent");
        }
        super(origin, opts);
        this[kMockAgent] = opts.agent;
        this[kOrigin] = origin;
        this[kIgnoreTrailingSlash] = opts.ignoreTrailingSlash ?? false;
        this[kDispatches] = [];
        this[kConnected] = 1;
        this[kOriginalDispatch] = this.dispatch;
        this[kOriginalClose] = this.close.bind(this);
        this.dispatch = buildMockDispatch.call(this);
        this.close = this[kClose];
      }
      get [Symbols.kConnected]() {
        return this[kConnected];
      }
      /**
       * Sets up the base interceptor for mocking replies from undici.
       */
      intercept(opts) {
        return new MockInterceptor(
          opts && { ignoreTrailingSlash: this[kIgnoreTrailingSlash], ...opts },
          this[kDispatches]
        );
      }
      cleanMocks() {
        this[kDispatches] = [];
      }
      async [kClose]() {
        await promisify9(this[kOriginalClose])();
        this[kConnected] = 0;
        this[kMockAgent][Symbols.kClients].delete(this[kOrigin]);
      }
    };
    module2.exports = MockPool;
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/mock/pending-interceptors-formatter.js
var require_pending_interceptors_formatter = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/mock/pending-interceptors-formatter.js"(exports, module2) {
    init_import_meta_url();
    var { Transform: Transform2 } = __require("stream");
    var { Console: Console2 } = __require("console");
    var PERSISTENT = process.versions.icu ? "\u2705" : "Y ";
    var NOT_PERSISTENT = process.versions.icu ? "\u274C" : "N ";
    module2.exports = class PendingInterceptorsFormatter {
      static {
        __name(this, "PendingInterceptorsFormatter");
      }
      constructor({ disableColors } = {}) {
        this.transform = new Transform2({
          transform(chunk, _enc, cb2) {
            cb2(null, chunk);
          }
        });
        this.logger = new Console2({
          stdout: this.transform,
          inspectOptions: {
            colors: !disableColors && !process.env.CI
          }
        });
      }
      format(pendingInterceptors) {
        const withPrettyHeaders = pendingInterceptors.map(
          ({ method, path: path84, data: { statusCode }, persist, times, timesInvoked, origin }) => ({
            Method: method,
            Origin: origin,
            Path: path84,
            "Status code": statusCode,
            Persistent: persist ? PERSISTENT : NOT_PERSISTENT,
            Invocations: timesInvoked,
            Remaining: persist ? Infinity : times - timesInvoked
          })
        );
        this.logger.table(withPrettyHeaders);
        return this.transform.read().toString();
      }
    };
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/mock/mock-agent.js
var require_mock_agent = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/mock/mock-agent.js"(exports, module2) {
    init_import_meta_url();
    var { kClients } = require_symbols();
    var Agent = require_agent();
    var {
      kAgent,
      kMockAgentSet,
      kMockAgentGet,
      kDispatches,
      kIsMockActive,
      kNetConnect,
      kGetNetConnect,
      kOptions,
      kFactory,
      kMockAgentRegisterCallHistory,
      kMockAgentIsCallHistoryEnabled,
      kMockAgentAddCallHistoryLog,
      kMockAgentMockCallHistoryInstance,
      kMockAgentAcceptsNonStandardSearchParameters,
      kMockCallHistoryAddLog,
      kIgnoreTrailingSlash
    } = require_mock_symbols();
    var MockClient = require_mock_client();
    var MockPool = require_mock_pool();
    var { matchValue, normalizeSearchParams, buildAndValidateMockOptions, normalizeOrigin } = require_mock_utils();
    var { InvalidArgumentError, UndiciError } = require_errors();
    var Dispatcher2 = require_dispatcher();
    var PendingInterceptorsFormatter = require_pending_interceptors_formatter();
    var { MockCallHistory } = require_mock_call_history();
    var MockAgent = class extends Dispatcher2 {
      static {
        __name(this, "MockAgent");
      }
      constructor(opts = {}) {
        super(opts);
        const mockOptions = buildAndValidateMockOptions(opts);
        this[kNetConnect] = true;
        this[kIsMockActive] = true;
        this[kMockAgentIsCallHistoryEnabled] = mockOptions.enableCallHistory ?? false;
        this[kMockAgentAcceptsNonStandardSearchParameters] = mockOptions.acceptNonStandardSearchParameters ?? false;
        this[kIgnoreTrailingSlash] = mockOptions.ignoreTrailingSlash ?? false;
        if (opts?.agent && typeof opts.agent.dispatch !== "function") {
          throw new InvalidArgumentError("Argument opts.agent must implement Agent");
        }
        const agent = opts?.agent ? opts.agent : new Agent(opts);
        this[kAgent] = agent;
        this[kClients] = agent[kClients];
        this[kOptions] = mockOptions;
        if (this[kMockAgentIsCallHistoryEnabled]) {
          this[kMockAgentRegisterCallHistory]();
        }
      }
      get(origin) {
        const normalizedOrigin = normalizeOrigin(origin);
        const originKey = this[kIgnoreTrailingSlash] ? normalizedOrigin.replace(/\/$/, "") : normalizedOrigin;
        let dispatcher = this[kMockAgentGet](originKey);
        if (!dispatcher) {
          dispatcher = this[kFactory](originKey);
          this[kMockAgentSet](originKey, dispatcher);
        }
        return dispatcher;
      }
      dispatch(opts, handler) {
        opts.origin = normalizeOrigin(opts.origin);
        this.get(opts.origin);
        this[kMockAgentAddCallHistoryLog](opts);
        const acceptNonStandardSearchParameters = this[kMockAgentAcceptsNonStandardSearchParameters];
        const dispatchOpts = { ...opts };
        if (acceptNonStandardSearchParameters && dispatchOpts.path) {
          const [path84, searchParams] = dispatchOpts.path.split("?");
          const normalizedSearchParams = normalizeSearchParams(searchParams, acceptNonStandardSearchParameters);
          dispatchOpts.path = `${path84}?${normalizedSearchParams}`;
        }
        return this[kAgent].dispatch(dispatchOpts, handler);
      }
      async close() {
        this.clearCallHistory();
        await this[kAgent].close();
        this[kClients].clear();
      }
      deactivate() {
        this[kIsMockActive] = false;
      }
      activate() {
        this[kIsMockActive] = true;
      }
      enableNetConnect(matcher) {
        if (typeof matcher === "string" || typeof matcher === "function" || matcher instanceof RegExp) {
          if (Array.isArray(this[kNetConnect])) {
            this[kNetConnect].push(matcher);
          } else {
            this[kNetConnect] = [matcher];
          }
        } else if (typeof matcher === "undefined") {
          this[kNetConnect] = true;
        } else {
          throw new InvalidArgumentError("Unsupported matcher. Must be one of String|Function|RegExp.");
        }
      }
      disableNetConnect() {
        this[kNetConnect] = false;
      }
      enableCallHistory() {
        this[kMockAgentIsCallHistoryEnabled] = true;
        return this;
      }
      disableCallHistory() {
        this[kMockAgentIsCallHistoryEnabled] = false;
        return this;
      }
      getCallHistory() {
        return this[kMockAgentMockCallHistoryInstance];
      }
      clearCallHistory() {
        if (this[kMockAgentMockCallHistoryInstance] !== void 0) {
          this[kMockAgentMockCallHistoryInstance].clear();
        }
      }
      // This is required to bypass issues caused by using global symbols - see:
      // https://github.com/nodejs/undici/issues/1447
      get isMockActive() {
        return this[kIsMockActive];
      }
      [kMockAgentRegisterCallHistory]() {
        if (this[kMockAgentMockCallHistoryInstance] === void 0) {
          this[kMockAgentMockCallHistoryInstance] = new MockCallHistory();
        }
      }
      [kMockAgentAddCallHistoryLog](opts) {
        if (this[kMockAgentIsCallHistoryEnabled]) {
          this[kMockAgentRegisterCallHistory]();
          this[kMockAgentMockCallHistoryInstance][kMockCallHistoryAddLog](opts);
        }
      }
      [kMockAgentSet](origin, dispatcher) {
        this[kClients].set(origin, { count: 0, dispatcher });
      }
      [kFactory](origin) {
        const mockOptions = Object.assign({ agent: this }, this[kOptions]);
        return this[kOptions] && this[kOptions].connections === 1 ? new MockClient(origin, mockOptions) : new MockPool(origin, mockOptions);
      }
      [kMockAgentGet](origin) {
        const result = this[kClients].get(origin);
        if (result?.dispatcher) {
          return result.dispatcher;
        }
        if (typeof origin !== "string") {
          const dispatcher = this[kFactory]("http://localhost:9999");
          this[kMockAgentSet](origin, dispatcher);
          return dispatcher;
        }
        for (const [keyMatcher, result2] of Array.from(this[kClients])) {
          if (result2 && typeof keyMatcher !== "string" && matchValue(keyMatcher, origin)) {
            const dispatcher = this[kFactory](origin);
            this[kMockAgentSet](origin, dispatcher);
            dispatcher[kDispatches] = result2.dispatcher[kDispatches];
            return dispatcher;
          }
        }
      }
      [kGetNetConnect]() {
        return this[kNetConnect];
      }
      pendingInterceptors() {
        const mockAgentClients = this[kClients];
        return Array.from(mockAgentClients.entries()).flatMap(([origin, result]) => result.dispatcher[kDispatches].map((dispatch) => ({ ...dispatch, origin }))).filter(({ pending }) => pending);
      }
      assertNoPendingInterceptors({ pendingInterceptorsFormatter = new PendingInterceptorsFormatter() } = {}) {
        const pending = this.pendingInterceptors();
        if (pending.length === 0) {
          return;
        }
        throw new UndiciError(
          pending.length === 1 ? `1 interceptor is pending:

${pendingInterceptorsFormatter.format(pending)}`.trim() : `${pending.length} interceptors are pending:

${pendingInterceptorsFormatter.format(pending)}`.trim()
        );
      }
    };
    module2.exports = MockAgent;
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/mock/snapshot-utils.js
var require_snapshot_utils = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/mock/snapshot-utils.js"(exports, module2) {
    init_import_meta_url();
    var { InvalidArgumentError } = require_errors();
    var { runtimeFeatures } = require_runtime_features();
    function createHeaderFilters(matchOptions = {}) {
      const { ignoreHeaders = [], excludeHeaders = [], matchHeaders = [], caseSensitive = false } = matchOptions;
      return {
        ignore: new Set(ignoreHeaders.map((header) => caseSensitive ? header : header.toLowerCase())),
        exclude: new Set(excludeHeaders.map((header) => caseSensitive ? header : header.toLowerCase())),
        match: new Set(matchHeaders.map((header) => caseSensitive ? header : header.toLowerCase()))
      };
    }
    __name(createHeaderFilters, "createHeaderFilters");
    var crypto9 = runtimeFeatures.has("crypto") ? __require("crypto") : null;
    var hashId = crypto9?.hash ? (value) => crypto9.hash("sha256", value, "base64url") : (value) => Buffer.from(value).toString("base64url");
    function isUndiciHeaders(headers) {
      return Array.isArray(headers) && (headers.length & 1) === 0;
    }
    __name(isUndiciHeaders, "isUndiciHeaders");
    function isUrlExcludedFactory(excludePatterns = []) {
      if (excludePatterns.length === 0) {
        return () => false;
      }
      return /* @__PURE__ */ __name(function isUrlExcluded(url4) {
        let urlLowerCased;
        for (const pattern of excludePatterns) {
          if (typeof pattern === "string") {
            if (!urlLowerCased) {
              urlLowerCased = url4.toLowerCase();
            }
            if (urlLowerCased.includes(pattern.toLowerCase())) {
              return true;
            }
          } else if (pattern instanceof RegExp) {
            if (pattern.test(url4)) {
              return true;
            }
          }
        }
        return false;
      }, "isUrlExcluded");
    }
    __name(isUrlExcludedFactory, "isUrlExcludedFactory");
    function normalizeHeaders(headers) {
      const normalizedHeaders = {};
      if (!headers) return normalizedHeaders;
      if (isUndiciHeaders(headers)) {
        for (let i7 = 0; i7 < headers.length; i7 += 2) {
          const key = headers[i7];
          const value = headers[i7 + 1];
          if (key && value !== void 0) {
            const keyStr = Buffer.isBuffer(key) ? key.toString() : key;
            const valueStr = Buffer.isBuffer(value) ? value.toString() : value;
            normalizedHeaders[keyStr.toLowerCase()] = valueStr;
          }
        }
        return normalizedHeaders;
      }
      if (headers && typeof headers === "object") {
        for (const [key, value] of Object.entries(headers)) {
          if (key && typeof key === "string") {
            normalizedHeaders[key.toLowerCase()] = Array.isArray(value) ? value.join(", ") : String(value);
          }
        }
      }
      return normalizedHeaders;
    }
    __name(normalizeHeaders, "normalizeHeaders");
    var validSnapshotModes = (
      /** @type {const} */
      ["record", "playback", "update"]
    );
    function validateSnapshotMode(mode) {
      if (!validSnapshotModes.includes(mode)) {
        throw new InvalidArgumentError(`Invalid snapshot mode: ${mode}. Must be one of: ${validSnapshotModes.join(", ")}`);
      }
    }
    __name(validateSnapshotMode, "validateSnapshotMode");
    module2.exports = {
      createHeaderFilters,
      hashId,
      isUndiciHeaders,
      normalizeHeaders,
      isUrlExcludedFactory,
      validateSnapshotMode
    };
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/mock/snapshot-recorder.js
var require_snapshot_recorder = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/mock/snapshot-recorder.js"(exports, module2) {
    init_import_meta_url();
    var { writeFile: writeFile14, readFile: readFile19, mkdir: mkdir5 } = __require("fs/promises");
    var { dirname: dirname22, resolve: resolve32 } = __require("path");
    var { setTimeout: setTimeout8, clearTimeout: clearTimeout2 } = __require("timers");
    var { InvalidArgumentError, UndiciError } = require_errors();
    var { hashId, isUrlExcludedFactory, normalizeHeaders, createHeaderFilters } = require_snapshot_utils();
    function formatRequestKey(opts, headerFilters, matchOptions = {}) {
      const url4 = new URL(opts.path, opts.origin);
      const normalized = opts._normalizedHeaders || normalizeHeaders(opts.headers);
      if (!opts._normalizedHeaders) {
        opts._normalizedHeaders = normalized;
      }
      return {
        method: opts.method || "GET",
        url: matchOptions.matchQuery !== false ? url4.toString() : `${url4.origin}${url4.pathname}`,
        headers: filterHeadersForMatching(normalized, headerFilters, matchOptions),
        body: matchOptions.matchBody !== false && opts.body ? String(opts.body) : ""
      };
    }
    __name(formatRequestKey, "formatRequestKey");
    function filterHeadersForMatching(headers, headerFilters, matchOptions = {}) {
      if (!headers || typeof headers !== "object") return {};
      const {
        caseSensitive = false
      } = matchOptions;
      const filtered = {};
      const { ignore: ignore2, exclude, match: match3 } = headerFilters;
      for (const [key, value] of Object.entries(headers)) {
        const headerKey = caseSensitive ? key : key.toLowerCase();
        if (exclude.has(headerKey)) continue;
        if (ignore2.has(headerKey)) continue;
        if (match3.size !== 0) {
          if (!match3.has(headerKey)) continue;
        }
        filtered[headerKey] = value;
      }
      return filtered;
    }
    __name(filterHeadersForMatching, "filterHeadersForMatching");
    function filterHeadersForStorage(headers, headerFilters, matchOptions = {}) {
      if (!headers || typeof headers !== "object") return {};
      const {
        caseSensitive = false
      } = matchOptions;
      const filtered = {};
      const { exclude: excludeSet } = headerFilters;
      for (const [key, value] of Object.entries(headers)) {
        const headerKey = caseSensitive ? key : key.toLowerCase();
        if (excludeSet.has(headerKey)) continue;
        filtered[headerKey] = value;
      }
      return filtered;
    }
    __name(filterHeadersForStorage, "filterHeadersForStorage");
    function createRequestHash(formattedRequest) {
      const parts = [
        formattedRequest.method,
        formattedRequest.url
      ];
      if (formattedRequest.headers && typeof formattedRequest.headers === "object") {
        const headerKeys = Object.keys(formattedRequest.headers).sort();
        for (const key of headerKeys) {
          const values = Array.isArray(formattedRequest.headers[key]) ? formattedRequest.headers[key] : [formattedRequest.headers[key]];
          parts.push(key);
          for (const value of values.sort()) {
            parts.push(String(value));
          }
        }
      }
      parts.push(formattedRequest.body);
      const content = parts.join("|");
      return hashId(content);
    }
    __name(createRequestHash, "createRequestHash");
    var SnapshotRecorder = class {
      static {
        __name(this, "SnapshotRecorder");
      }
      /** @type {NodeJS.Timeout | null} */
      #flushTimeout;
      /** @type {import('./snapshot-utils').IsUrlExcluded} */
      #isUrlExcluded;
      /** @type {Map<string, SnapshotEntry>} */
      #snapshots = /* @__PURE__ */ new Map();
      /** @type {string|undefined} */
      #snapshotPath;
      /** @type {number} */
      #maxSnapshots = Infinity;
      /** @type {boolean} */
      #autoFlush = false;
      /** @type {import('./snapshot-utils').HeaderFilters} */
      #headerFilters;
      /**
       * Creates a new SnapshotRecorder instance
       * @param {SnapshotRecorderOptions&SnapshotRecorderMatchOptions} [options={}] - Configuration options for the recorder
       */
      constructor(options = {}) {
        this.#snapshotPath = options.snapshotPath;
        this.#maxSnapshots = options.maxSnapshots || Infinity;
        this.#autoFlush = options.autoFlush || false;
        this.flushInterval = options.flushInterval || 3e4;
        this._flushTimer = null;
        this.matchOptions = {
          matchHeaders: options.matchHeaders || [],
          // empty means match all headers
          ignoreHeaders: options.ignoreHeaders || [],
          excludeHeaders: options.excludeHeaders || [],
          matchBody: options.matchBody !== false,
          // default: true
          matchQuery: options.matchQuery !== false,
          // default: true
          caseSensitive: options.caseSensitive || false
        };
        this.#headerFilters = createHeaderFilters(this.matchOptions);
        this.shouldRecord = options.shouldRecord || (() => true);
        this.shouldPlayback = options.shouldPlayback || (() => true);
        this.#isUrlExcluded = isUrlExcludedFactory(options.excludeUrls);
        if (this.#autoFlush && this.#snapshotPath) {
          this.#startAutoFlush();
        }
      }
      /**
       * Records a request-response interaction
       * @param {SnapshotRequestOptions} requestOpts - Request options
       * @param {SnapshotEntryResponse} response - Response data to record
       * @return {Promise<void>} - Resolves when the recording is complete
       */
      async record(requestOpts, response) {
        if (!this.shouldRecord(requestOpts)) {
          return;
        }
        if (this.isUrlExcluded(requestOpts)) {
          return;
        }
        const request4 = formatRequestKey(requestOpts, this.#headerFilters, this.matchOptions);
        const hash = createRequestHash(request4);
        const normalizedHeaders = normalizeHeaders(response.headers);
        const responseData = {
          statusCode: response.statusCode,
          headers: filterHeadersForStorage(normalizedHeaders, this.#headerFilters, this.matchOptions),
          body: Buffer.isBuffer(response.body) ? response.body.toString("base64") : Buffer.from(String(response.body || "")).toString("base64"),
          trailers: response.trailers
        };
        if (this.#snapshots.size >= this.#maxSnapshots && !this.#snapshots.has(hash)) {
          const oldestKey = this.#snapshots.keys().next().value;
          this.#snapshots.delete(oldestKey);
        }
        const existingSnapshot = this.#snapshots.get(hash);
        if (existingSnapshot && existingSnapshot.responses) {
          existingSnapshot.responses.push(responseData);
          existingSnapshot.timestamp = (/* @__PURE__ */ new Date()).toISOString();
        } else {
          this.#snapshots.set(hash, {
            request: request4,
            responses: [responseData],
            // Always store as array for consistency
            callCount: 0,
            timestamp: (/* @__PURE__ */ new Date()).toISOString()
          });
        }
        if (this.#autoFlush && this.#snapshotPath) {
          this.#scheduleFlush();
        }
      }
      /**
       * Checks if a URL should be excluded from recording/playback
       * @param {SnapshotRequestOptions} requestOpts - Request options to check
       * @returns {boolean} - True if URL is excluded
       */
      isUrlExcluded(requestOpts) {
        const url4 = new URL(requestOpts.path, requestOpts.origin).toString();
        return this.#isUrlExcluded(url4);
      }
      /**
       * Finds a matching snapshot for the given request
       * Returns the appropriate response based on call count for sequential responses
       *
       * @param {SnapshotRequestOptions} requestOpts - Request options to match
       * @returns {SnapshotEntry&Record<'response', SnapshotEntryResponse>|undefined} - Matching snapshot response or undefined if not found
       */
      findSnapshot(requestOpts) {
        if (!this.shouldPlayback(requestOpts)) {
          return void 0;
        }
        if (this.isUrlExcluded(requestOpts)) {
          return void 0;
        }
        const request4 = formatRequestKey(requestOpts, this.#headerFilters, this.matchOptions);
        const hash = createRequestHash(request4);
        const snapshot = this.#snapshots.get(hash);
        if (!snapshot) return void 0;
        const currentCallCount = snapshot.callCount || 0;
        const responseIndex = Math.min(currentCallCount, snapshot.responses.length - 1);
        snapshot.callCount = currentCallCount + 1;
        return {
          ...snapshot,
          response: snapshot.responses[responseIndex]
        };
      }
      /**
       * Loads snapshots from file
       * @param {string} [filePath] - Optional file path to load snapshots from
       * @return {Promise<void>} - Resolves when snapshots are loaded
       */
      async loadSnapshots(filePath) {
        const path84 = filePath || this.#snapshotPath;
        if (!path84) {
          throw new InvalidArgumentError("Snapshot path is required");
        }
        try {
          const data = await readFile19(resolve32(path84), "utf8");
          const parsed = JSON.parse(data);
          if (Array.isArray(parsed)) {
            this.#snapshots.clear();
            for (const { hash, snapshot } of parsed) {
              this.#snapshots.set(hash, snapshot);
            }
          } else {
            this.#snapshots = new Map(Object.entries(parsed));
          }
        } catch (error2) {
          if (error2.code === "ENOENT") {
            this.#snapshots.clear();
          } else {
            throw new UndiciError(`Failed to load snapshots from ${path84}`, { cause: error2 });
          }
        }
      }
      /**
       * Saves snapshots to file
       *
       * @param {string} [filePath] - Optional file path to save snapshots
       * @returns {Promise<void>} - Resolves when snapshots are saved
       */
      async saveSnapshots(filePath) {
        const path84 = filePath || this.#snapshotPath;
        if (!path84) {
          throw new InvalidArgumentError("Snapshot path is required");
        }
        const resolvedPath2 = resolve32(path84);
        await mkdir5(dirname22(resolvedPath2), { recursive: true });
        const data = Array.from(this.#snapshots.entries()).map(([hash, snapshot]) => ({
          hash,
          snapshot
        }));
        await writeFile14(resolvedPath2, JSON.stringify(data, null, 2), { flush: true });
      }
      /**
       * Clears all recorded snapshots
       * @returns {void}
       */
      clear() {
        this.#snapshots.clear();
      }
      /**
       * Gets all recorded snapshots
       * @return {Array<SnapshotEntry>} - Array of all recorded snapshots
       */
      getSnapshots() {
        return Array.from(this.#snapshots.values());
      }
      /**
       * Gets snapshot count
       * @return {number} - Number of recorded snapshots
       */
      size() {
        return this.#snapshots.size;
      }
      /**
       * Resets call counts for all snapshots (useful for test cleanup)
       * @returns {void}
       */
      resetCallCounts() {
        for (const snapshot of this.#snapshots.values()) {
          snapshot.callCount = 0;
        }
      }
      /**
       * Deletes a specific snapshot by request options
       * @param {SnapshotRequestOptions} requestOpts - Request options to match
       * @returns {boolean} - True if snapshot was deleted, false if not found
       */
      deleteSnapshot(requestOpts) {
        const request4 = formatRequestKey(requestOpts, this.#headerFilters, this.matchOptions);
        const hash = createRequestHash(request4);
        return this.#snapshots.delete(hash);
      }
      /**
       * Gets information about a specific snapshot
       * @param {SnapshotRequestOptions} requestOpts - Request options to match
       * @returns {SnapshotInfo|null} - Snapshot information or null if not found
       */
      getSnapshotInfo(requestOpts) {
        const request4 = formatRequestKey(requestOpts, this.#headerFilters, this.matchOptions);
        const hash = createRequestHash(request4);
        const snapshot = this.#snapshots.get(hash);
        if (!snapshot) return null;
        return {
          hash,
          request: snapshot.request,
          responseCount: snapshot.responses ? snapshot.responses.length : snapshot.response ? 1 : 0,
          // .response for legacy snapshots
          callCount: snapshot.callCount || 0,
          timestamp: snapshot.timestamp
        };
      }
      /**
       * Replaces all snapshots with new data (full replacement)
       * @param {Array<{hash: string; snapshot: SnapshotEntry}>|Record<string, SnapshotEntry>} snapshotData - New snapshot data to replace existing ones
       * @returns {void}
       */
      replaceSnapshots(snapshotData) {
        this.#snapshots.clear();
        if (Array.isArray(snapshotData)) {
          for (const { hash, snapshot } of snapshotData) {
            this.#snapshots.set(hash, snapshot);
          }
        } else if (snapshotData && typeof snapshotData === "object") {
          this.#snapshots = new Map(Object.entries(snapshotData));
        }
      }
      /**
       * Starts the auto-flush timer
       * @returns {void}
       */
      #startAutoFlush() {
        return this.#scheduleFlush();
      }
      /**
       * Stops the auto-flush timer
       * @returns {void}
       */
      #stopAutoFlush() {
        if (this.#flushTimeout) {
          clearTimeout2(this.#flushTimeout);
          this.saveSnapshots().catch(() => {
          });
          this.#flushTimeout = null;
        }
      }
      /**
       * Schedules a flush (debounced to avoid excessive writes)
       */
      #scheduleFlush() {
        this.#flushTimeout = setTimeout8(() => {
          this.saveSnapshots().catch(() => {
          });
          if (this.#autoFlush) {
            this.#flushTimeout?.refresh();
          } else {
            this.#flushTimeout = null;
          }
        }, 1e3);
      }
      /**
       * Cleanup method to stop timers
       * @returns {void}
       */
      destroy() {
        this.#stopAutoFlush();
        if (this.#flushTimeout) {
          clearTimeout2(this.#flushTimeout);
          this.#flushTimeout = null;
        }
      }
      /**
       * Async close method that saves all recordings and performs cleanup
       * @returns {Promise<void>}
       */
      async close() {
        if (this.#snapshotPath && this.#snapshots.size !== 0) {
          await this.saveSnapshots();
        }
        this.destroy();
      }
    };
    module2.exports = { SnapshotRecorder, formatRequestKey, createRequestHash, filterHeadersForMatching, filterHeadersForStorage, createHeaderFilters };
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/mock/snapshot-agent.js
var require_snapshot_agent = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/mock/snapshot-agent.js"(exports, module2) {
    init_import_meta_url();
    var Agent = require_agent();
    var MockAgent = require_mock_agent();
    var { SnapshotRecorder } = require_snapshot_recorder();
    var WrapHandler = require_wrap_handler();
    var { InvalidArgumentError, UndiciError } = require_errors();
    var { validateSnapshotMode } = require_snapshot_utils();
    var kSnapshotRecorder = Symbol("kSnapshotRecorder");
    var kSnapshotMode = Symbol("kSnapshotMode");
    var kSnapshotPath = Symbol("kSnapshotPath");
    var kSnapshotLoaded = Symbol("kSnapshotLoaded");
    var kRealAgent = Symbol("kRealAgent");
    var warningEmitted2 = false;
    var SnapshotAgent = class extends MockAgent {
      static {
        __name(this, "SnapshotAgent");
      }
      constructor(opts = {}) {
        if (!warningEmitted2) {
          process.emitWarning(
            "SnapshotAgent is experimental and subject to change",
            "ExperimentalWarning"
          );
          warningEmitted2 = true;
        }
        const {
          mode = "record",
          snapshotPath = null,
          ...mockAgentOpts
        } = opts;
        super(mockAgentOpts);
        validateSnapshotMode(mode);
        if ((mode === "playback" || mode === "update") && !snapshotPath) {
          throw new InvalidArgumentError(`snapshotPath is required when mode is '${mode}'`);
        }
        this[kSnapshotMode] = mode;
        this[kSnapshotPath] = snapshotPath;
        this[kSnapshotRecorder] = new SnapshotRecorder({
          snapshotPath: this[kSnapshotPath],
          mode: this[kSnapshotMode],
          maxSnapshots: opts.maxSnapshots,
          autoFlush: opts.autoFlush,
          flushInterval: opts.flushInterval,
          matchHeaders: opts.matchHeaders,
          ignoreHeaders: opts.ignoreHeaders,
          excludeHeaders: opts.excludeHeaders,
          matchBody: opts.matchBody,
          matchQuery: opts.matchQuery,
          caseSensitive: opts.caseSensitive,
          shouldRecord: opts.shouldRecord,
          shouldPlayback: opts.shouldPlayback,
          excludeUrls: opts.excludeUrls
        });
        this[kSnapshotLoaded] = false;
        if (this[kSnapshotMode] === "record" || this[kSnapshotMode] === "update" || this[kSnapshotMode] === "playback" && opts.excludeUrls && opts.excludeUrls.length > 0) {
          this[kRealAgent] = new Agent(opts);
        }
        if ((this[kSnapshotMode] === "playback" || this[kSnapshotMode] === "update") && this[kSnapshotPath]) {
          this.loadSnapshots().catch(() => {
          });
        }
      }
      dispatch(opts, handler) {
        handler = WrapHandler.wrap(handler);
        const mode = this[kSnapshotMode];
        if (this[kSnapshotRecorder].isUrlExcluded(opts)) {
          return this[kRealAgent].dispatch(opts, handler);
        }
        if (mode === "playback" || mode === "update") {
          if (!this[kSnapshotLoaded]) {
            return this.#asyncDispatch(opts, handler);
          }
          const snapshot = this[kSnapshotRecorder].findSnapshot(opts);
          if (snapshot) {
            return this.#replaySnapshot(snapshot, handler);
          } else if (mode === "update") {
            return this.#recordAndReplay(opts, handler);
          } else {
            const error2 = new UndiciError(`No snapshot found for ${opts.method || "GET"} ${opts.path}`);
            if (handler.onError) {
              handler.onError(error2);
              return;
            }
            throw error2;
          }
        } else if (mode === "record") {
          return this.#recordAndReplay(opts, handler);
        }
      }
      /**
       * Async version of dispatch for when we need to load snapshots first
       */
      async #asyncDispatch(opts, handler) {
        await this.loadSnapshots();
        return this.dispatch(opts, handler);
      }
      /**
       * Records a real request and replays the response
       */
      #recordAndReplay(opts, handler) {
        const responseData = {
          statusCode: null,
          headers: {},
          trailers: {},
          body: []
        };
        const self2 = this;
        const recordingHandler = {
          onRequestStart(controller, context2) {
            return handler.onRequestStart(controller, { ...context2, history: this.history });
          },
          onRequestUpgrade(controller, statusCode, headers, socket) {
            return handler.onRequestUpgrade(controller, statusCode, headers, socket);
          },
          onResponseStart(controller, statusCode, headers, statusMessage) {
            responseData.statusCode = statusCode;
            responseData.headers = headers;
            return handler.onResponseStart(controller, statusCode, headers, statusMessage);
          },
          onResponseData(controller, chunk) {
            responseData.body.push(chunk);
            return handler.onResponseData(controller, chunk);
          },
          onResponseEnd(controller, trailers) {
            responseData.trailers = trailers;
            const responseBody = Buffer.concat(responseData.body);
            self2[kSnapshotRecorder].record(opts, {
              statusCode: responseData.statusCode,
              headers: responseData.headers,
              body: responseBody,
              trailers: responseData.trailers
            }).then(() => handler.onResponseEnd(controller, trailers)).catch((error2) => handler.onResponseError(controller, error2));
          }
        };
        const agent = this[kRealAgent];
        return agent.dispatch(opts, recordingHandler);
      }
      /**
       * Replays a recorded response
       *
       * @param {Object} snapshot - The recorded snapshot to replay.
       * @param {Object} handler - The handler to call with the response data.
       * @returns {void}
       */
      #replaySnapshot(snapshot, handler) {
        try {
          const { response } = snapshot;
          const controller = {
            pause() {
            },
            resume() {
            },
            abort(reason) {
              this.aborted = true;
              this.reason = reason;
            },
            aborted: false,
            paused: false
          };
          handler.onRequestStart(controller);
          handler.onResponseStart(controller, response.statusCode, response.headers);
          const body = Buffer.from(response.body, "base64");
          handler.onResponseData(controller, body);
          handler.onResponseEnd(controller, response.trailers);
        } catch (error2) {
          handler.onError?.(error2);
        }
      }
      /**
       * Loads snapshots from file
       *
       * @param {string} [filePath] - Optional file path to load snapshots from.
       * @returns {Promise<void>} - Resolves when snapshots are loaded.
       */
      async loadSnapshots(filePath) {
        await this[kSnapshotRecorder].loadSnapshots(filePath || this[kSnapshotPath]);
        this[kSnapshotLoaded] = true;
        if (this[kSnapshotMode] === "playback") {
          this.#setupMockInterceptors();
        }
      }
      /**
       * Saves snapshots to file
       *
       * @param {string} [filePath] - Optional file path to save snapshots to.
       * @returns {Promise<void>} - Resolves when snapshots are saved.
       */
      async saveSnapshots(filePath) {
        return this[kSnapshotRecorder].saveSnapshots(filePath || this[kSnapshotPath]);
      }
      /**
       * Sets up MockAgent interceptors based on recorded snapshots.
       *
       * This method creates MockAgent interceptors for each recorded snapshot,
       * allowing the SnapshotAgent to fall back to MockAgent's standard intercept
       * mechanism in playback mode. Each interceptor is configured to persist
       * (remain active for multiple requests) and responds with the recorded
       * response data.
       *
       * Called automatically when loading snapshots in playback mode.
       *
       * @returns {void}
       */
      #setupMockInterceptors() {
        for (const snapshot of this[kSnapshotRecorder].getSnapshots()) {
          const { request: request4, responses, response } = snapshot;
          const url4 = new URL(request4.url);
          const mockPool = this.get(url4.origin);
          const responseData = responses ? responses[0] : response;
          if (!responseData) continue;
          mockPool.intercept({
            path: url4.pathname + url4.search,
            method: request4.method,
            headers: request4.headers,
            body: request4.body
          }).reply(responseData.statusCode, responseData.body, {
            headers: responseData.headers,
            trailers: responseData.trailers
          }).persist();
        }
      }
      /**
       * Gets the snapshot recorder
       * @return {SnapshotRecorder} - The snapshot recorder instance
       */
      getRecorder() {
        return this[kSnapshotRecorder];
      }
      /**
       * Gets the current mode
       * @return {import('./snapshot-utils').SnapshotMode} - The current snapshot mode
       */
      getMode() {
        return this[kSnapshotMode];
      }
      /**
       * Clears all snapshots
       * @returns {void}
       */
      clearSnapshots() {
        this[kSnapshotRecorder].clear();
      }
      /**
       * Resets call counts for all snapshots (useful for test cleanup)
       * @returns {void}
       */
      resetCallCounts() {
        this[kSnapshotRecorder].resetCallCounts();
      }
      /**
       * Deletes a specific snapshot by request options
       * @param {import('./snapshot-recorder').SnapshotRequestOptions} requestOpts - Request options to identify the snapshot
       * @return {Promise<boolean>} - Returns true if the snapshot was deleted, false if not found
       */
      deleteSnapshot(requestOpts) {
        return this[kSnapshotRecorder].deleteSnapshot(requestOpts);
      }
      /**
       * Gets information about a specific snapshot
       * @returns {import('./snapshot-recorder').SnapshotInfo|null} - Snapshot information or null if not found
       */
      getSnapshotInfo(requestOpts) {
        return this[kSnapshotRecorder].getSnapshotInfo(requestOpts);
      }
      /**
       * Replaces all snapshots with new data (full replacement)
       * @param {Array<{hash: string; snapshot: import('./snapshot-recorder').SnapshotEntryshotEntry}>|Record<string, import('./snapshot-recorder').SnapshotEntry>} snapshotData - New snapshot data to replace existing snapshots
       * @returns {void}
       */
      replaceSnapshots(snapshotData) {
        this[kSnapshotRecorder].replaceSnapshots(snapshotData);
      }
      /**
       * Closes the agent, saving snapshots and cleaning up resources.
       *
       * @returns {Promise<void>}
       */
      async close() {
        await this[kSnapshotRecorder].close();
        await this[kRealAgent]?.close();
        await super.close();
      }
    };
    module2.exports = SnapshotAgent;
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/global.js
var require_global2 = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/global.js"(exports, module2) {
    init_import_meta_url();
    var globalDispatcher = Symbol.for("undici.globalDispatcher.1");
    var { InvalidArgumentError } = require_errors();
    var Agent = require_agent();
    if (getGlobalDispatcher2() === void 0) {
      setGlobalDispatcher2(new Agent());
    }
    function setGlobalDispatcher2(agent) {
      if (!agent || typeof agent.dispatch !== "function") {
        throw new InvalidArgumentError("Argument agent must implement Agent");
      }
      Object.defineProperty(globalThis, globalDispatcher, {
        value: agent,
        writable: true,
        enumerable: false,
        configurable: false
      });
    }
    __name(setGlobalDispatcher2, "setGlobalDispatcher");
    function getGlobalDispatcher2() {
      return globalThis[globalDispatcher];
    }
    __name(getGlobalDispatcher2, "getGlobalDispatcher");
    var installedExports = (
      /** @type {const} */
      [
        "fetch",
        "Headers",
        "Response",
        "Request",
        "FormData",
        "WebSocket",
        "CloseEvent",
        "ErrorEvent",
        "MessageEvent",
        "EventSource"
      ]
    );
    module2.exports = {
      setGlobalDispatcher: setGlobalDispatcher2,
      getGlobalDispatcher: getGlobalDispatcher2,
      installedExports
    };
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/handler/decorator-handler.js
var require_decorator_handler = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/handler/decorator-handler.js"(exports, module2) {
    init_import_meta_url();
    var assert61 = __require("assert");
    var WrapHandler = require_wrap_handler();
    module2.exports = class DecoratorHandler {
      static {
        __name(this, "DecoratorHandler");
      }
      #handler;
      #onCompleteCalled = false;
      #onErrorCalled = false;
      #onResponseStartCalled = false;
      constructor(handler) {
        if (typeof handler !== "object" || handler === null) {
          throw new TypeError("handler must be an object");
        }
        this.#handler = WrapHandler.wrap(handler);
      }
      onRequestStart(...args) {
        this.#handler.onRequestStart?.(...args);
      }
      onRequestUpgrade(...args) {
        assert61(!this.#onCompleteCalled);
        assert61(!this.#onErrorCalled);
        return this.#handler.onRequestUpgrade?.(...args);
      }
      onResponseStart(...args) {
        assert61(!this.#onCompleteCalled);
        assert61(!this.#onErrorCalled);
        assert61(!this.#onResponseStartCalled);
        this.#onResponseStartCalled = true;
        return this.#handler.onResponseStart?.(...args);
      }
      onResponseData(...args) {
        assert61(!this.#onCompleteCalled);
        assert61(!this.#onErrorCalled);
        return this.#handler.onResponseData?.(...args);
      }
      onResponseEnd(...args) {
        assert61(!this.#onCompleteCalled);
        assert61(!this.#onErrorCalled);
        this.#onCompleteCalled = true;
        return this.#handler.onResponseEnd?.(...args);
      }
      onResponseError(...args) {
        this.#onErrorCalled = true;
        return this.#handler.onResponseError?.(...args);
      }
      /**
       * @deprecated
       */
      onBodySent() {
      }
    };
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/handler/redirect-handler.js
var require_redirect_handler = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/handler/redirect-handler.js"(exports, module2) {
    init_import_meta_url();
    var util5 = require_util();
    var { kBodyUsed } = require_symbols();
    var assert61 = __require("assert");
    var { InvalidArgumentError } = require_errors();
    var EE = __require("events");
    var redirectableStatusCodes = [300, 301, 302, 303, 307, 308];
    var kBody = Symbol("body");
    var noop = /* @__PURE__ */ __name(() => {
    }, "noop");
    var BodyAsyncIterable = class {
      static {
        __name(this, "BodyAsyncIterable");
      }
      constructor(body) {
        this[kBody] = body;
        this[kBodyUsed] = false;
      }
      async *[Symbol.asyncIterator]() {
        assert61(!this[kBodyUsed], "disturbed");
        this[kBodyUsed] = true;
        yield* this[kBody];
      }
    };
    var RedirectHandler = class _RedirectHandler {
      static {
        __name(this, "RedirectHandler");
      }
      static buildDispatch(dispatcher, maxRedirections) {
        if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) {
          throw new InvalidArgumentError("maxRedirections must be a positive number");
        }
        const dispatch = dispatcher.dispatch.bind(dispatcher);
        return (opts, originalHandler) => dispatch(opts, new _RedirectHandler(dispatch, maxRedirections, opts, originalHandler));
      }
      constructor(dispatch, maxRedirections, opts, handler) {
        if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) {
          throw new InvalidArgumentError("maxRedirections must be a positive number");
        }
        this.dispatch = dispatch;
        this.location = null;
        const { maxRedirections: _5, ...cleanOpts } = opts;
        this.opts = cleanOpts;
        this.maxRedirections = maxRedirections;
        this.handler = handler;
        this.history = [];
        if (util5.isStream(this.opts.body)) {
          if (util5.bodyLength(this.opts.body) === 0) {
            this.opts.body.on("data", function() {
              assert61(false);
            });
          }
          if (typeof this.opts.body.readableDidRead !== "boolean") {
            this.opts.body[kBodyUsed] = false;
            EE.prototype.on.call(this.opts.body, "data", function() {
              this[kBodyUsed] = true;
            });
          }
        } else if (this.opts.body && typeof this.opts.body.pipeTo === "function") {
          this.opts.body = new BodyAsyncIterable(this.opts.body);
        } else if (this.opts.body && typeof this.opts.body !== "string" && !ArrayBuffer.isView(this.opts.body) && util5.isIterable(this.opts.body) && !util5.isFormDataLike(this.opts.body)) {
          this.opts.body = new BodyAsyncIterable(this.opts.body);
        }
      }
      onRequestStart(controller, context2) {
        this.handler.onRequestStart?.(controller, { ...context2, history: this.history });
      }
      onRequestUpgrade(controller, statusCode, headers, socket) {
        this.handler.onRequestUpgrade?.(controller, statusCode, headers, socket);
      }
      onResponseStart(controller, statusCode, headers, statusMessage) {
        if (this.opts.throwOnMaxRedirect && this.history.length >= this.maxRedirections) {
          throw new Error("max redirects");
        }
        if ((statusCode === 301 || statusCode === 302) && this.opts.method === "POST") {
          this.opts.method = "GET";
          if (util5.isStream(this.opts.body)) {
            util5.destroy(this.opts.body.on("error", noop));
          }
          this.opts.body = null;
        }
        if (statusCode === 303 && this.opts.method !== "HEAD") {
          this.opts.method = "GET";
          if (util5.isStream(this.opts.body)) {
            util5.destroy(this.opts.body.on("error", noop));
          }
          this.opts.body = null;
        }
        this.location = this.history.length >= this.maxRedirections || util5.isDisturbed(this.opts.body) || redirectableStatusCodes.indexOf(statusCode) === -1 ? null : headers.location;
        if (this.opts.origin) {
          this.history.push(new URL(this.opts.path, this.opts.origin));
        }
        if (!this.location) {
          this.handler.onResponseStart?.(controller, statusCode, headers, statusMessage);
          return;
        }
        const { origin, pathname, search } = util5.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin)));
        const path84 = search ? `${pathname}${search}` : pathname;
        const redirectUrlString = `${origin}${path84}`;
        for (const historyUrl of this.history) {
          if (historyUrl.toString() === redirectUrlString) {
            throw new InvalidArgumentError(`Redirect loop detected. Cannot redirect to ${origin}. This typically happens when using a Client or Pool with cross-origin redirects. Use an Agent for cross-origin redirects.`);
          }
        }
        this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin);
        this.opts.path = path84;
        this.opts.origin = origin;
        this.opts.query = null;
      }
      onResponseData(controller, chunk) {
        if (this.location) ; else {
          this.handler.onResponseData?.(controller, chunk);
        }
      }
      onResponseEnd(controller, trailers) {
        if (this.location) {
          this.dispatch(this.opts, this);
        } else {
          this.handler.onResponseEnd(controller, trailers);
        }
      }
      onResponseError(controller, error2) {
        this.handler.onResponseError?.(controller, error2);
      }
    };
    function shouldRemoveHeader(header, removeContent, unknownOrigin) {
      if (header.length === 4) {
        return util5.headerNameToString(header) === "host";
      }
      if (removeContent && util5.headerNameToString(header).startsWith("content-")) {
        return true;
      }
      if (unknownOrigin && (header.length === 13 || header.length === 6 || header.length === 19)) {
        const name2 = util5.headerNameToString(header);
        return name2 === "authorization" || name2 === "cookie" || name2 === "proxy-authorization";
      }
      return false;
    }
    __name(shouldRemoveHeader, "shouldRemoveHeader");
    function cleanRequestHeaders(headers, removeContent, unknownOrigin) {
      const ret = [];
      if (Array.isArray(headers)) {
        for (let i7 = 0; i7 < headers.length; i7 += 2) {
          if (!shouldRemoveHeader(headers[i7], removeContent, unknownOrigin)) {
            ret.push(headers[i7], headers[i7 + 1]);
          }
        }
      } else if (headers && typeof headers === "object") {
        const entries2 = util5.hasSafeIterator(headers) ? headers : Object.entries(headers);
        for (const [key, value] of entries2) {
          if (!shouldRemoveHeader(key, removeContent, unknownOrigin)) {
            ret.push(key, value);
          }
        }
      } else {
        assert61(headers == null, "headers must be an object or an array");
      }
      return ret;
    }
    __name(cleanRequestHeaders, "cleanRequestHeaders");
    module2.exports = RedirectHandler;
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/interceptor/redirect.js
var require_redirect = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/interceptor/redirect.js"(exports, module2) {
    init_import_meta_url();
    var RedirectHandler = require_redirect_handler();
    function createRedirectInterceptor({ maxRedirections: defaultMaxRedirections } = {}) {
      return (dispatch) => {
        return /* @__PURE__ */ __name(function Intercept(opts, handler) {
          const { maxRedirections = defaultMaxRedirections, ...rest } = opts;
          if (maxRedirections == null || maxRedirections === 0) {
            return dispatch(opts, handler);
          }
          const dispatchOpts = { ...rest };
          const redirectHandler = new RedirectHandler(dispatch, maxRedirections, dispatchOpts, handler);
          return dispatch(dispatchOpts, redirectHandler);
        }, "Intercept");
      };
    }
    __name(createRedirectInterceptor, "createRedirectInterceptor");
    module2.exports = createRedirectInterceptor;
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/interceptor/response-error.js
var require_response_error = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/interceptor/response-error.js"(exports, module2) {
    init_import_meta_url();
    var DecoratorHandler = require_decorator_handler();
    var { ResponseError } = require_errors();
    var ResponseErrorHandler = class extends DecoratorHandler {
      static {
        __name(this, "ResponseErrorHandler");
      }
      #statusCode;
      #contentType;
      #decoder;
      #headers;
      #body;
      constructor(_opts, { handler }) {
        super(handler);
      }
      #checkContentType(contentType) {
        return (this.#contentType ?? "").indexOf(contentType) === 0;
      }
      onRequestStart(controller, context2) {
        this.#statusCode = 0;
        this.#contentType = null;
        this.#decoder = null;
        this.#headers = null;
        this.#body = "";
        return super.onRequestStart(controller, context2);
      }
      onResponseStart(controller, statusCode, headers, statusMessage) {
        this.#statusCode = statusCode;
        this.#headers = headers;
        this.#contentType = headers["content-type"];
        if (this.#statusCode < 400) {
          return super.onResponseStart(controller, statusCode, headers, statusMessage);
        }
        if (this.#checkContentType("application/json") || this.#checkContentType("text/plain")) {
          this.#decoder = new TextDecoder("utf-8");
        }
      }
      onResponseData(controller, chunk) {
        if (this.#statusCode < 400) {
          return super.onResponseData(controller, chunk);
        }
        this.#body += this.#decoder?.decode(chunk, { stream: true }) ?? "";
      }
      onResponseEnd(controller, trailers) {
        if (this.#statusCode >= 400) {
          this.#body += this.#decoder?.decode(void 0, { stream: false }) ?? "";
          if (this.#checkContentType("application/json")) {
            try {
              this.#body = JSON.parse(this.#body);
            } catch {
            }
          }
          let err;
          const stackTraceLimit = Error.stackTraceLimit;
          Error.stackTraceLimit = 0;
          try {
            err = new ResponseError("Response Error", this.#statusCode, {
              body: this.#body,
              headers: this.#headers
            });
          } finally {
            Error.stackTraceLimit = stackTraceLimit;
          }
          super.onResponseError(controller, err);
        } else {
          super.onResponseEnd(controller, trailers);
        }
      }
      onResponseError(controller, err) {
        super.onResponseError(controller, err);
      }
    };
    module2.exports = () => {
      return (dispatch) => {
        return /* @__PURE__ */ __name(function Intercept(opts, handler) {
          return dispatch(opts, new ResponseErrorHandler(opts, { handler }));
        }, "Intercept");
      };
    };
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/interceptor/retry.js
var require_retry = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/interceptor/retry.js"(exports, module2) {
    init_import_meta_url();
    var RetryHandler = require_retry_handler();
    module2.exports = (globalOpts) => {
      return (dispatch) => {
        return /* @__PURE__ */ __name(function retryInterceptor(opts, handler) {
          return dispatch(
            opts,
            new RetryHandler(
              { ...opts, retryOptions: { ...globalOpts, ...opts.retryOptions } },
              {
                handler,
                dispatch
              }
            )
          );
        }, "retryInterceptor");
      };
    };
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/interceptor/dump.js
var require_dump = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/interceptor/dump.js"(exports, module2) {
    init_import_meta_url();
    var { InvalidArgumentError, RequestAbortedError } = require_errors();
    var DecoratorHandler = require_decorator_handler();
    var DumpHandler = class extends DecoratorHandler {
      static {
        __name(this, "DumpHandler");
      }
      #maxSize = 1024 * 1024;
      #dumped = false;
      #size = 0;
      #controller = null;
      aborted = false;
      reason = false;
      constructor({ maxSize, signal }, handler) {
        if (maxSize != null && (!Number.isFinite(maxSize) || maxSize < 1)) {
          throw new InvalidArgumentError("maxSize must be a number greater than 0");
        }
        super(handler);
        this.#maxSize = maxSize ?? this.#maxSize;
      }
      #abort(reason) {
        this.aborted = true;
        this.reason = reason;
      }
      onRequestStart(controller, context2) {
        controller.abort = this.#abort.bind(this);
        this.#controller = controller;
        return super.onRequestStart(controller, context2);
      }
      onResponseStart(controller, statusCode, headers, statusMessage) {
        const contentLength = headers["content-length"];
        if (contentLength != null && contentLength > this.#maxSize) {
          throw new RequestAbortedError(
            `Response size (${contentLength}) larger than maxSize (${this.#maxSize})`
          );
        }
        if (this.aborted === true) {
          return true;
        }
        return super.onResponseStart(controller, statusCode, headers, statusMessage);
      }
      onResponseError(controller, err) {
        if (this.#dumped) {
          return;
        }
        err = this.#controller?.reason ?? err;
        super.onResponseError(controller, err);
      }
      onResponseData(controller, chunk) {
        this.#size = this.#size + chunk.length;
        if (this.#size >= this.#maxSize) {
          this.#dumped = true;
          if (this.aborted === true) {
            super.onResponseError(controller, this.reason);
          } else {
            super.onResponseEnd(controller, {});
          }
        }
        return true;
      }
      onResponseEnd(controller, trailers) {
        if (this.#dumped) {
          return;
        }
        if (this.#controller.aborted === true) {
          super.onResponseError(controller, this.reason);
          return;
        }
        super.onResponseEnd(controller, trailers);
      }
    };
    function createDumpInterceptor({ maxSize: defaultMaxSize } = {
      maxSize: 1024 * 1024
    }) {
      return (dispatch) => {
        return /* @__PURE__ */ __name(function Intercept(opts, handler) {
          const { dumpMaxSize = defaultMaxSize } = opts;
          const dumpHandler = new DumpHandler({ maxSize: dumpMaxSize, signal: opts.signal }, handler);
          return dispatch(opts, dumpHandler);
        }, "Intercept");
      };
    }
    __name(createDumpInterceptor, "createDumpInterceptor");
    module2.exports = createDumpInterceptor;
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/interceptor/dns.js
var require_dns = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/interceptor/dns.js"(exports, module2) {
    init_import_meta_url();
    var { isIP } = __require("net");
    var { lookup } = __require("dns");
    var DecoratorHandler = require_decorator_handler();
    var { InvalidArgumentError, InformationalError } = require_errors();
    var maxInt = Math.pow(2, 31) - 1;
    function hasSafeIterator(headers) {
      const prototype = Object.getPrototypeOf(headers);
      const ownIterator = Object.prototype.hasOwnProperty.call(headers, Symbol.iterator);
      return ownIterator || prototype != null && prototype !== Object.prototype && typeof headers[Symbol.iterator] === "function";
    }
    __name(hasSafeIterator, "hasSafeIterator");
    function isHostHeader(key) {
      return typeof key === "string" && key.toLowerCase() === "host";
    }
    __name(isHostHeader, "isHostHeader");
    function normalizeHeaders(headers) {
      if (headers == null) {
        return null;
      }
      if (Array.isArray(headers)) {
        if (headers.length === 0 || !Array.isArray(headers[0])) {
          return headers;
        }
        const normalized = [];
        for (const header of headers) {
          if (Array.isArray(header) && header.length === 2) {
            normalized.push(header[0], header[1]);
          } else {
            normalized.push(header);
          }
        }
        return normalized;
      }
      if (typeof headers === "object" && hasSafeIterator(headers)) {
        const normalized = [];
        for (const header of headers) {
          if (Array.isArray(header) && header.length === 2) {
            normalized.push(header[0], header[1]);
          } else {
            normalized.push(header);
          }
        }
        return normalized;
      }
      return headers;
    }
    __name(normalizeHeaders, "normalizeHeaders");
    function hasHostHeader(headers) {
      if (headers == null) {
        return false;
      }
      if (Array.isArray(headers)) {
        if (headers.length === 0) {
          return false;
        }
        for (let i7 = 0; i7 < headers.length; i7 += 2) {
          if (isHostHeader(headers[i7])) {
            return true;
          }
        }
        return false;
      }
      if (typeof headers === "object") {
        for (const key in headers) {
          if (isHostHeader(key)) {
            return true;
          }
        }
      }
      return false;
    }
    __name(hasHostHeader, "hasHostHeader");
    function withHostHeader(host, headers) {
      const normalizedHeaders = normalizeHeaders(headers);
      if (hasHostHeader(normalizedHeaders)) {
        return normalizedHeaders;
      }
      if (Array.isArray(normalizedHeaders)) {
        return ["host", host, ...normalizedHeaders];
      }
      if (normalizedHeaders && typeof normalizedHeaders === "object") {
        return {
          host,
          ...normalizedHeaders
        };
      }
      return { host };
    }
    __name(withHostHeader, "withHostHeader");
    var DNSStorage = class {
      static {
        __name(this, "DNSStorage");
      }
      #maxItems = 0;
      #records = /* @__PURE__ */ new Map();
      constructor(opts) {
        this.#maxItems = opts.maxItems;
      }
      get size() {
        return this.#records.size;
      }
      get(hostname2) {
        return this.#records.get(hostname2) ?? null;
      }
      set(hostname2, records) {
        this.#records.set(hostname2, records);
      }
      delete(hostname2) {
        this.#records.delete(hostname2);
      }
      // Delegate to storage decide can we do more lookups or not
      full() {
        return this.size >= this.#maxItems;
      }
    };
    var DNSInstance = class {
      static {
        __name(this, "DNSInstance");
      }
      #maxTTL = 0;
      #maxItems = 0;
      dualStack = true;
      affinity = null;
      lookup = null;
      pick = null;
      storage = null;
      constructor(opts) {
        this.#maxTTL = opts.maxTTL;
        this.#maxItems = opts.maxItems;
        this.dualStack = opts.dualStack;
        this.affinity = opts.affinity;
        this.lookup = opts.lookup ?? this.#defaultLookup;
        this.pick = opts.pick ?? this.#defaultPick;
        this.storage = opts.storage ?? new DNSStorage(opts);
      }
      runLookup(origin, opts, cb2) {
        const ips = this.storage.get(origin.hostname);
        if (ips == null && this.storage.full()) {
          cb2(null, origin);
          return;
        }
        const newOpts = {
          affinity: this.affinity,
          dualStack: this.dualStack,
          lookup: this.lookup,
          pick: this.pick,
          ...opts.dns,
          maxTTL: this.#maxTTL,
          maxItems: this.#maxItems
        };
        if (ips == null) {
          this.lookup(origin, newOpts, (err, addresses) => {
            if (err || addresses == null || addresses.length === 0) {
              cb2(err ?? new InformationalError("No DNS entries found"));
              return;
            }
            this.setRecords(origin, addresses);
            const records = this.storage.get(origin.hostname);
            const ip = this.pick(
              origin,
              records,
              newOpts.affinity
            );
            let port;
            if (typeof ip.port === "number") {
              port = `:${ip.port}`;
            } else if (origin.port !== "") {
              port = `:${origin.port}`;
            } else {
              port = "";
            }
            cb2(
              null,
              new URL(`${origin.protocol}//${ip.family === 6 ? `[${ip.address}]` : ip.address}${port}`)
            );
          });
        } else {
          const ip = this.pick(
            origin,
            ips,
            newOpts.affinity
          );
          if (ip == null) {
            this.storage.delete(origin.hostname);
            this.runLookup(origin, opts, cb2);
            return;
          }
          let port;
          if (typeof ip.port === "number") {
            port = `:${ip.port}`;
          } else if (origin.port !== "") {
            port = `:${origin.port}`;
          } else {
            port = "";
          }
          cb2(
            null,
            new URL(`${origin.protocol}//${ip.family === 6 ? `[${ip.address}]` : ip.address}${port}`)
          );
        }
      }
      #defaultLookup(origin, opts, cb2) {
        lookup(
          origin.hostname,
          {
            all: true,
            family: this.dualStack === false ? this.affinity : 0,
            order: "ipv4first"
          },
          (err, addresses) => {
            if (err) {
              return cb2(err);
            }
            const results = /* @__PURE__ */ new Map();
            for (const addr of addresses) {
              results.set(`${addr.address}:${addr.family}`, addr);
            }
            cb2(null, results.values());
          }
        );
      }
      #defaultPick(origin, hostnameRecords, affinity) {
        let ip = null;
        const { records, offset } = hostnameRecords;
        let family;
        if (this.dualStack) {
          if (affinity == null) {
            if (offset == null || offset === maxInt) {
              hostnameRecords.offset = 0;
              affinity = 4;
            } else {
              hostnameRecords.offset++;
              affinity = (hostnameRecords.offset & 1) === 1 ? 6 : 4;
            }
          }
          if (records[affinity] != null && records[affinity].ips.length > 0) {
            family = records[affinity];
          } else {
            family = records[affinity === 4 ? 6 : 4];
          }
        } else {
          family = records[affinity];
        }
        if (family == null || family.ips.length === 0) {
          return ip;
        }
        if (family.offset == null || family.offset === maxInt) {
          family.offset = 0;
        } else {
          family.offset++;
        }
        const position = family.offset % family.ips.length;
        ip = family.ips[position] ?? null;
        if (ip == null) {
          return ip;
        }
        if (Date.now() - ip.timestamp > ip.ttl) {
          family.ips.splice(position, 1);
          return this.pick(origin, hostnameRecords, affinity);
        }
        return ip;
      }
      pickFamily(origin, ipFamily) {
        const records = this.storage.get(origin.hostname)?.records;
        if (!records) {
          return null;
        }
        const family = records[ipFamily];
        if (!family) {
          return null;
        }
        if (family.offset == null || family.offset === maxInt) {
          family.offset = 0;
        } else {
          family.offset++;
        }
        const position = family.offset % family.ips.length;
        const ip = family.ips[position] ?? null;
        if (ip == null) {
          return ip;
        }
        if (Date.now() - ip.timestamp > ip.ttl) {
          family.ips.splice(position, 1);
        }
        return ip;
      }
      setRecords(origin, addresses) {
        const timestamp = Date.now();
        const records = { records: { 4: null, 6: null } };
        let minTTL = this.#maxTTL;
        for (const record of addresses) {
          record.timestamp = timestamp;
          if (typeof record.ttl === "number") {
            record.ttl = Math.min(record.ttl, this.#maxTTL);
            minTTL = Math.min(minTTL, record.ttl);
          } else {
            record.ttl = this.#maxTTL;
          }
          const familyRecords = records.records[record.family] ?? { ips: [] };
          familyRecords.ips.push(record);
          records.records[record.family] = familyRecords;
        }
        this.storage.set(origin.hostname, records, { ttl: minTTL });
      }
      deleteRecords(origin) {
        this.storage.delete(origin.hostname);
      }
      getHandler(meta, opts) {
        return new DNSDispatchHandler(this, meta, opts);
      }
    };
    var DNSDispatchHandler = class extends DecoratorHandler {
      static {
        __name(this, "DNSDispatchHandler");
      }
      #state = null;
      #opts = null;
      #dispatch = null;
      #origin = null;
      #controller = null;
      #newOrigin = null;
      #firstTry = true;
      constructor(state2, { origin, handler, dispatch, newOrigin }, opts) {
        super(handler);
        this.#origin = origin;
        this.#newOrigin = newOrigin;
        this.#opts = { ...opts };
        this.#state = state2;
        this.#dispatch = dispatch;
      }
      onResponseError(controller, err) {
        switch (err.code) {
          case "ETIMEDOUT":
          case "ECONNREFUSED": {
            if (this.#state.dualStack) {
              if (!this.#firstTry) {
                super.onResponseError(controller, err);
                return;
              }
              this.#firstTry = false;
              const otherFamily = this.#newOrigin.hostname[0] === "[" ? 4 : 6;
              const ip = this.#state.pickFamily(this.#origin, otherFamily);
              if (ip == null) {
                super.onResponseError(controller, err);
                return;
              }
              let port;
              if (typeof ip.port === "number") {
                port = `:${ip.port}`;
              } else if (this.#origin.port !== "") {
                port = `:${this.#origin.port}`;
              } else {
                port = "";
              }
              const dispatchOpts = {
                ...this.#opts,
                origin: `${this.#origin.protocol}//${ip.family === 6 ? `[${ip.address}]` : ip.address}${port}`,
                headers: withHostHeader(this.#origin.host, this.#opts.headers)
              };
              this.#dispatch(dispatchOpts, this);
              return;
            }
            super.onResponseError(controller, err);
            break;
          }
          case "ENOTFOUND":
            this.#state.deleteRecords(this.#origin);
            super.onResponseError(controller, err);
            break;
          default:
            super.onResponseError(controller, err);
            break;
        }
      }
    };
    module2.exports = (interceptorOpts) => {
      if (interceptorOpts?.maxTTL != null && (typeof interceptorOpts?.maxTTL !== "number" || interceptorOpts?.maxTTL < 0)) {
        throw new InvalidArgumentError("Invalid maxTTL. Must be a positive number");
      }
      if (interceptorOpts?.maxItems != null && (typeof interceptorOpts?.maxItems !== "number" || interceptorOpts?.maxItems < 1)) {
        throw new InvalidArgumentError(
          "Invalid maxItems. Must be a positive number and greater than zero"
        );
      }
      if (interceptorOpts?.affinity != null && interceptorOpts?.affinity !== 4 && interceptorOpts?.affinity !== 6) {
        throw new InvalidArgumentError("Invalid affinity. Must be either 4 or 6");
      }
      if (interceptorOpts?.dualStack != null && typeof interceptorOpts?.dualStack !== "boolean") {
        throw new InvalidArgumentError("Invalid dualStack. Must be a boolean");
      }
      if (interceptorOpts?.lookup != null && typeof interceptorOpts?.lookup !== "function") {
        throw new InvalidArgumentError("Invalid lookup. Must be a function");
      }
      if (interceptorOpts?.pick != null && typeof interceptorOpts?.pick !== "function") {
        throw new InvalidArgumentError("Invalid pick. Must be a function");
      }
      if (interceptorOpts?.storage != null && (typeof interceptorOpts?.storage?.get !== "function" || typeof interceptorOpts?.storage?.set !== "function" || typeof interceptorOpts?.storage?.full !== "function" || typeof interceptorOpts?.storage?.delete !== "function")) {
        throw new InvalidArgumentError("Invalid storage. Must be a object with methods: { get, set, full, delete }");
      }
      const dualStack = interceptorOpts?.dualStack ?? true;
      let affinity;
      if (dualStack) {
        affinity = interceptorOpts?.affinity ?? null;
      } else {
        affinity = interceptorOpts?.affinity ?? 4;
      }
      const opts = {
        maxTTL: interceptorOpts?.maxTTL ?? 1e4,
        // Expressed in ms
        lookup: interceptorOpts?.lookup ?? null,
        pick: interceptorOpts?.pick ?? null,
        dualStack,
        affinity,
        maxItems: interceptorOpts?.maxItems ?? Infinity,
        storage: interceptorOpts?.storage
      };
      const instance = new DNSInstance(opts);
      return (dispatch) => {
        return /* @__PURE__ */ __name(function dnsInterceptor(origDispatchOpts, handler) {
          const origin = origDispatchOpts.origin.constructor === URL ? origDispatchOpts.origin : new URL(origDispatchOpts.origin);
          if (isIP(origin.hostname) !== 0) {
            return dispatch(origDispatchOpts, handler);
          }
          instance.runLookup(origin, origDispatchOpts, (err, newOrigin) => {
            if (err) {
              return handler.onResponseError(null, err);
            }
            const dispatchOpts = {
              ...origDispatchOpts,
              servername: origin.hostname,
              // For SNI on TLS
              origin: newOrigin.origin,
              headers: withHostHeader(origin.host, origDispatchOpts.headers)
            };
            dispatch(
              dispatchOpts,
              instance.getHandler(
                { origin, dispatch, handler, newOrigin },
                origDispatchOpts
              )
            );
          });
          return true;
        }, "dnsInterceptor");
      };
    };
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/util/cache.js
var require_cache = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/util/cache.js"(exports, module2) {
    init_import_meta_url();
    var {
      safeHTTPMethods,
      pathHasQueryOrFragment,
      hasSafeIterator
    } = require_util();
    var { serializePathWithQuery } = require_util();
    function makeCacheKey(opts) {
      if (!opts.origin) {
        throw new Error("opts.origin is undefined");
      }
      let fullPath = opts.path || "/";
      if (opts.query && !pathHasQueryOrFragment(opts.path)) {
        fullPath = serializePathWithQuery(fullPath, opts.query);
      }
      return {
        origin: opts.origin.toString(),
        method: opts.method,
        path: fullPath,
        headers: opts.headers
      };
    }
    __name(makeCacheKey, "makeCacheKey");
    function normalizeHeaders(opts) {
      let headers;
      if (opts.headers == null) {
        headers = {};
      } else if (typeof opts.headers === "object") {
        headers = {};
        if (hasSafeIterator(opts.headers)) {
          for (const x7 of opts.headers) {
            if (!Array.isArray(x7)) {
              throw new Error("opts.headers is not a valid header map");
            }
            const [key, val2] = x7;
            if (typeof key !== "string" || typeof val2 !== "string") {
              throw new Error("opts.headers is not a valid header map");
            }
            headers[key.toLowerCase()] = val2;
          }
        } else {
          for (const key of Object.keys(opts.headers)) {
            headers[key.toLowerCase()] = opts.headers[key];
          }
        }
      } else {
        throw new Error("opts.headers is not an object");
      }
      return headers;
    }
    __name(normalizeHeaders, "normalizeHeaders");
    function assertCacheKey(key) {
      if (typeof key !== "object") {
        throw new TypeError(`expected key to be object, got ${typeof key}`);
      }
      for (const property of ["origin", "method", "path"]) {
        if (typeof key[property] !== "string") {
          throw new TypeError(`expected key.${property} to be string, got ${typeof key[property]}`);
        }
      }
      if (key.headers !== void 0 && typeof key.headers !== "object") {
        throw new TypeError(`expected headers to be object, got ${typeof key}`);
      }
    }
    __name(assertCacheKey, "assertCacheKey");
    function assertCacheValue(value) {
      if (typeof value !== "object") {
        throw new TypeError(`expected value to be object, got ${typeof value}`);
      }
      for (const property of ["statusCode", "cachedAt", "staleAt", "deleteAt"]) {
        if (typeof value[property] !== "number") {
          throw new TypeError(`expected value.${property} to be number, got ${typeof value[property]}`);
        }
      }
      if (typeof value.statusMessage !== "string") {
        throw new TypeError(`expected value.statusMessage to be string, got ${typeof value.statusMessage}`);
      }
      if (value.headers != null && typeof value.headers !== "object") {
        throw new TypeError(`expected value.rawHeaders to be object, got ${typeof value.headers}`);
      }
      if (value.vary !== void 0 && typeof value.vary !== "object") {
        throw new TypeError(`expected value.vary to be object, got ${typeof value.vary}`);
      }
      if (value.etag !== void 0 && typeof value.etag !== "string") {
        throw new TypeError(`expected value.etag to be string, got ${typeof value.etag}`);
      }
    }
    __name(assertCacheValue, "assertCacheValue");
    function parseCacheControlHeader(header) {
      const output = {};
      let directives;
      if (Array.isArray(header)) {
        directives = [];
        for (const directive of header) {
          directives.push(...directive.split(","));
        }
      } else {
        directives = header.split(",");
      }
      for (let i7 = 0; i7 < directives.length; i7++) {
        const directive = directives[i7].toLowerCase();
        const keyValueDelimiter = directive.indexOf("=");
        let key;
        let value;
        if (keyValueDelimiter !== -1) {
          key = directive.substring(0, keyValueDelimiter).trimStart();
          value = directive.substring(keyValueDelimiter + 1);
        } else {
          key = directive.trim();
        }
        switch (key) {
          case "min-fresh":
          case "max-stale":
          case "max-age":
          case "s-maxage":
          case "stale-while-revalidate":
          case "stale-if-error": {
            if (value === void 0 || value[0] === " ") {
              continue;
            }
            if (value.length >= 2 && value[0] === '"' && value[value.length - 1] === '"') {
              value = value.substring(1, value.length - 1);
            }
            const parsedValue = parseInt(value, 10);
            if (parsedValue !== parsedValue) {
              continue;
            }
            if (key === "max-age" && key in output && output[key] >= parsedValue) {
              continue;
            }
            output[key] = parsedValue;
            break;
          }
          case "private":
          case "no-cache": {
            if (value) {
              if (value[0] === '"') {
                const headers = [value.substring(1)];
                let foundEndingQuote = value[value.length - 1] === '"';
                if (!foundEndingQuote) {
                  for (let j7 = i7 + 1; j7 < directives.length; j7++) {
                    const nextPart = directives[j7];
                    const nextPartLength = nextPart.length;
                    headers.push(nextPart.trim());
                    if (nextPartLength !== 0 && nextPart[nextPartLength - 1] === '"') {
                      foundEndingQuote = true;
                      break;
                    }
                  }
                }
                if (foundEndingQuote) {
                  let lastHeader = headers[headers.length - 1];
                  if (lastHeader[lastHeader.length - 1] === '"') {
                    lastHeader = lastHeader.substring(0, lastHeader.length - 1);
                    headers[headers.length - 1] = lastHeader;
                  }
                  if (key in output) {
                    output[key] = output[key].concat(headers);
                  } else {
                    output[key] = headers;
                  }
                }
              } else {
                if (key in output) {
                  output[key] = output[key].concat(value);
                } else {
                  output[key] = [value];
                }
              }
              break;
            }
          }
          // eslint-disable-next-line no-fallthrough
          case "public":
          case "no-store":
          case "must-revalidate":
          case "proxy-revalidate":
          case "immutable":
          case "no-transform":
          case "must-understand":
          case "only-if-cached":
            if (value) {
              continue;
            }
            output[key] = true;
            break;
          default:
            continue;
        }
      }
      return output;
    }
    __name(parseCacheControlHeader, "parseCacheControlHeader");
    function parseVaryHeader(varyHeader, headers) {
      if (typeof varyHeader === "string" && varyHeader.includes("*")) {
        return headers;
      }
      const output = (
        /** @type {Record<string, string | string[] | null>} */
        {}
      );
      const varyingHeaders = typeof varyHeader === "string" ? varyHeader.split(",") : varyHeader;
      for (const header of varyingHeaders) {
        const trimmedHeader = header.trim().toLowerCase();
        output[trimmedHeader] = headers[trimmedHeader] ?? null;
      }
      return output;
    }
    __name(parseVaryHeader, "parseVaryHeader");
    function isEtagUsable(etag) {
      if (etag.length <= 2) {
        return false;
      }
      if (etag[0] === '"' && etag[etag.length - 1] === '"') {
        return !(etag[1] === '"' || etag.startsWith('"W/'));
      }
      if (etag.startsWith('W/"') && etag[etag.length - 1] === '"') {
        return etag.length !== 4;
      }
      return false;
    }
    __name(isEtagUsable, "isEtagUsable");
    function assertCacheStore(store, name2 = "CacheStore") {
      if (typeof store !== "object" || store === null) {
        throw new TypeError(`expected type of ${name2} to be a CacheStore, got ${store === null ? "null" : typeof store}`);
      }
      for (const fn2 of ["get", "createWriteStream", "delete"]) {
        if (typeof store[fn2] !== "function") {
          throw new TypeError(`${name2} needs to have a \`${fn2}()\` function`);
        }
      }
    }
    __name(assertCacheStore, "assertCacheStore");
    function assertCacheMethods(methods, name2 = "CacheMethods") {
      if (!Array.isArray(methods)) {
        throw new TypeError(`expected type of ${name2} needs to be an array, got ${methods === null ? "null" : typeof methods}`);
      }
      if (methods.length === 0) {
        throw new TypeError(`${name2} needs to have at least one method`);
      }
      for (const method of methods) {
        if (!safeHTTPMethods.includes(method)) {
          throw new TypeError(`element of ${name2}-array needs to be one of following values: ${safeHTTPMethods.join(", ")}, got ${method}`);
        }
      }
    }
    __name(assertCacheMethods, "assertCacheMethods");
    function makeDeduplicationKey(cacheKey, excludeHeaders) {
      let key = `${cacheKey.origin}:${cacheKey.method}:${cacheKey.path}`;
      if (cacheKey.headers) {
        const sortedHeaders = Object.keys(cacheKey.headers).sort();
        for (const header of sortedHeaders) {
          if (excludeHeaders?.has(header.toLowerCase())) {
            continue;
          }
          const value = cacheKey.headers[header];
          key += `:${header}=${Array.isArray(value) ? value.join(",") : value}`;
        }
      }
      return key;
    }
    __name(makeDeduplicationKey, "makeDeduplicationKey");
    module2.exports = {
      makeCacheKey,
      normalizeHeaders,
      assertCacheKey,
      assertCacheValue,
      parseCacheControlHeader,
      parseVaryHeader,
      isEtagUsable,
      assertCacheMethods,
      assertCacheStore,
      makeDeduplicationKey
    };
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/util/date.js
var require_date = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/util/date.js"(exports, module2) {
    init_import_meta_url();
    function parseHttpDate(date) {
      switch (date[3]) {
        case ",":
          return parseImfDate(date);
        case " ":
          return parseAscTimeDate(date);
        default:
          return parseRfc850Date(date);
      }
    }
    __name(parseHttpDate, "parseHttpDate");
    function parseImfDate(date) {
      if (date.length !== 29 || date[4] !== " " || date[7] !== " " || date[11] !== " " || date[16] !== " " || date[19] !== ":" || date[22] !== ":" || date[25] !== " " || date[26] !== "G" || date[27] !== "M" || date[28] !== "T") {
        return void 0;
      }
      let weekday = -1;
      if (date[0] === "S" && date[1] === "u" && date[2] === "n") {
        weekday = 0;
      } else if (date[0] === "M" && date[1] === "o" && date[2] === "n") {
        weekday = 1;
      } else if (date[0] === "T" && date[1] === "u" && date[2] === "e") {
        weekday = 2;
      } else if (date[0] === "W" && date[1] === "e" && date[2] === "d") {
        weekday = 3;
      } else if (date[0] === "T" && date[1] === "h" && date[2] === "u") {
        weekday = 4;
      } else if (date[0] === "F" && date[1] === "r" && date[2] === "i") {
        weekday = 5;
      } else if (date[0] === "S" && date[1] === "a" && date[2] === "t") {
        weekday = 6;
      } else {
        return void 0;
      }
      let day = 0;
      if (date[5] === "0") {
        const code = date.charCodeAt(6);
        if (code < 49 || code > 57) {
          return void 0;
        }
        day = code - 48;
      } else {
        const code1 = date.charCodeAt(5);
        if (code1 < 49 || code1 > 51) {
          return void 0;
        }
        const code2 = date.charCodeAt(6);
        if (code2 < 48 || code2 > 57) {
          return void 0;
        }
        day = (code1 - 48) * 10 + (code2 - 48);
      }
      let monthIdx = -1;
      if (date[8] === "J" && date[9] === "a" && date[10] === "n") {
        monthIdx = 0;
      } else if (date[8] === "F" && date[9] === "e" && date[10] === "b") {
        monthIdx = 1;
      } else if (date[8] === "M" && date[9] === "a") {
        if (date[10] === "r") {
          monthIdx = 2;
        } else if (date[10] === "y") {
          monthIdx = 4;
        } else {
          return void 0;
        }
      } else if (date[8] === "J") {
        if (date[9] === "a" && date[10] === "n") {
          monthIdx = 0;
        } else if (date[9] === "u") {
          if (date[10] === "n") {
            monthIdx = 5;
          } else if (date[10] === "l") {
            monthIdx = 6;
          } else {
            return void 0;
          }
        } else {
          return void 0;
        }
      } else if (date[8] === "A") {
        if (date[9] === "p" && date[10] === "r") {
          monthIdx = 3;
        } else if (date[9] === "u" && date[10] === "g") {
          monthIdx = 7;
        } else {
          return void 0;
        }
      } else if (date[8] === "S" && date[9] === "e" && date[10] === "p") {
        monthIdx = 8;
      } else if (date[8] === "O" && date[9] === "c" && date[10] === "t") {
        monthIdx = 9;
      } else if (date[8] === "N" && date[9] === "o" && date[10] === "v") {
        monthIdx = 10;
      } else if (date[8] === "D" && date[9] === "e" && date[10] === "c") {
        monthIdx = 11;
      } else {
        return void 0;
      }
      const yearDigit1 = date.charCodeAt(12);
      if (yearDigit1 < 48 || yearDigit1 > 57) {
        return void 0;
      }
      const yearDigit2 = date.charCodeAt(13);
      if (yearDigit2 < 48 || yearDigit2 > 57) {
        return void 0;
      }
      const yearDigit3 = date.charCodeAt(14);
      if (yearDigit3 < 48 || yearDigit3 > 57) {
        return void 0;
      }
      const yearDigit4 = date.charCodeAt(15);
      if (yearDigit4 < 48 || yearDigit4 > 57) {
        return void 0;
      }
      const year = (yearDigit1 - 48) * 1e3 + (yearDigit2 - 48) * 100 + (yearDigit3 - 48) * 10 + (yearDigit4 - 48);
      let hour = 0;
      if (date[17] === "0") {
        const code = date.charCodeAt(18);
        if (code < 48 || code > 57) {
          return void 0;
        }
        hour = code - 48;
      } else {
        const code1 = date.charCodeAt(17);
        if (code1 < 48 || code1 > 50) {
          return void 0;
        }
        const code2 = date.charCodeAt(18);
        if (code2 < 48 || code2 > 57) {
          return void 0;
        }
        if (code1 === 50 && code2 > 51) {
          return void 0;
        }
        hour = (code1 - 48) * 10 + (code2 - 48);
      }
      let minute = 0;
      if (date[20] === "0") {
        const code = date.charCodeAt(21);
        if (code < 48 || code > 57) {
          return void 0;
        }
        minute = code - 48;
      } else {
        const code1 = date.charCodeAt(20);
        if (code1 < 48 || code1 > 53) {
          return void 0;
        }
        const code2 = date.charCodeAt(21);
        if (code2 < 48 || code2 > 57) {
          return void 0;
        }
        minute = (code1 - 48) * 10 + (code2 - 48);
      }
      let second = 0;
      if (date[23] === "0") {
        const code = date.charCodeAt(24);
        if (code < 48 || code > 57) {
          return void 0;
        }
        second = code - 48;
      } else {
        const code1 = date.charCodeAt(23);
        if (code1 < 48 || code1 > 53) {
          return void 0;
        }
        const code2 = date.charCodeAt(24);
        if (code2 < 48 || code2 > 57) {
          return void 0;
        }
        second = (code1 - 48) * 10 + (code2 - 48);
      }
      const result = new Date(Date.UTC(year, monthIdx, day, hour, minute, second));
      return result.getUTCDay() === weekday ? result : void 0;
    }
    __name(parseImfDate, "parseImfDate");
    function parseAscTimeDate(date) {
      if (date.length !== 24 || date[7] !== " " || date[10] !== " " || date[19] !== " ") {
        return void 0;
      }
      let weekday = -1;
      if (date[0] === "S" && date[1] === "u" && date[2] === "n") {
        weekday = 0;
      } else if (date[0] === "M" && date[1] === "o" && date[2] === "n") {
        weekday = 1;
      } else if (date[0] === "T" && date[1] === "u" && date[2] === "e") {
        weekday = 2;
      } else if (date[0] === "W" && date[1] === "e" && date[2] === "d") {
        weekday = 3;
      } else if (date[0] === "T" && date[1] === "h" && date[2] === "u") {
        weekday = 4;
      } else if (date[0] === "F" && date[1] === "r" && date[2] === "i") {
        weekday = 5;
      } else if (date[0] === "S" && date[1] === "a" && date[2] === "t") {
        weekday = 6;
      } else {
        return void 0;
      }
      let monthIdx = -1;
      if (date[4] === "J" && date[5] === "a" && date[6] === "n") {
        monthIdx = 0;
      } else if (date[4] === "F" && date[5] === "e" && date[6] === "b") {
        monthIdx = 1;
      } else if (date[4] === "M" && date[5] === "a") {
        if (date[6] === "r") {
          monthIdx = 2;
        } else if (date[6] === "y") {
          monthIdx = 4;
        } else {
          return void 0;
        }
      } else if (date[4] === "J") {
        if (date[5] === "a" && date[6] === "n") {
          monthIdx = 0;
        } else if (date[5] === "u") {
          if (date[6] === "n") {
            monthIdx = 5;
          } else if (date[6] === "l") {
            monthIdx = 6;
          } else {
            return void 0;
          }
        } else {
          return void 0;
        }
      } else if (date[4] === "A") {
        if (date[5] === "p" && date[6] === "r") {
          monthIdx = 3;
        } else if (date[5] === "u" && date[6] === "g") {
          monthIdx = 7;
        } else {
          return void 0;
        }
      } else if (date[4] === "S" && date[5] === "e" && date[6] === "p") {
        monthIdx = 8;
      } else if (date[4] === "O" && date[5] === "c" && date[6] === "t") {
        monthIdx = 9;
      } else if (date[4] === "N" && date[5] === "o" && date[6] === "v") {
        monthIdx = 10;
      } else if (date[4] === "D" && date[5] === "e" && date[6] === "c") {
        monthIdx = 11;
      } else {
        return void 0;
      }
      let day = 0;
      if (date[8] === " ") {
        const code = date.charCodeAt(9);
        if (code < 49 || code > 57) {
          return void 0;
        }
        day = code - 48;
      } else {
        const code1 = date.charCodeAt(8);
        if (code1 < 49 || code1 > 51) {
          return void 0;
        }
        const code2 = date.charCodeAt(9);
        if (code2 < 48 || code2 > 57) {
          return void 0;
        }
        day = (code1 - 48) * 10 + (code2 - 48);
      }
      let hour = 0;
      if (date[11] === "0") {
        const code = date.charCodeAt(12);
        if (code < 48 || code > 57) {
          return void 0;
        }
        hour = code - 48;
      } else {
        const code1 = date.charCodeAt(11);
        if (code1 < 48 || code1 > 50) {
          return void 0;
        }
        const code2 = date.charCodeAt(12);
        if (code2 < 48 || code2 > 57) {
          return void 0;
        }
        if (code1 === 50 && code2 > 51) {
          return void 0;
        }
        hour = (code1 - 48) * 10 + (code2 - 48);
      }
      let minute = 0;
      if (date[14] === "0") {
        const code = date.charCodeAt(15);
        if (code < 48 || code > 57) {
          return void 0;
        }
        minute = code - 48;
      } else {
        const code1 = date.charCodeAt(14);
        if (code1 < 48 || code1 > 53) {
          return void 0;
        }
        const code2 = date.charCodeAt(15);
        if (code2 < 48 || code2 > 57) {
          return void 0;
        }
        minute = (code1 - 48) * 10 + (code2 - 48);
      }
      let second = 0;
      if (date[17] === "0") {
        const code = date.charCodeAt(18);
        if (code < 48 || code > 57) {
          return void 0;
        }
        second = code - 48;
      } else {
        const code1 = date.charCodeAt(17);
        if (code1 < 48 || code1 > 53) {
          return void 0;
        }
        const code2 = date.charCodeAt(18);
        if (code2 < 48 || code2 > 57) {
          return void 0;
        }
        second = (code1 - 48) * 10 + (code2 - 48);
      }
      const yearDigit1 = date.charCodeAt(20);
      if (yearDigit1 < 48 || yearDigit1 > 57) {
        return void 0;
      }
      const yearDigit2 = date.charCodeAt(21);
      if (yearDigit2 < 48 || yearDigit2 > 57) {
        return void 0;
      }
      const yearDigit3 = date.charCodeAt(22);
      if (yearDigit3 < 48 || yearDigit3 > 57) {
        return void 0;
      }
      const yearDigit4 = date.charCodeAt(23);
      if (yearDigit4 < 48 || yearDigit4 > 57) {
        return void 0;
      }
      const year = (yearDigit1 - 48) * 1e3 + (yearDigit2 - 48) * 100 + (yearDigit3 - 48) * 10 + (yearDigit4 - 48);
      const result = new Date(Date.UTC(year, monthIdx, day, hour, minute, second));
      return result.getUTCDay() === weekday ? result : void 0;
    }
    __name(parseAscTimeDate, "parseAscTimeDate");
    function parseRfc850Date(date) {
      let commaIndex = -1;
      let weekday = -1;
      if (date[0] === "S") {
        if (date[1] === "u" && date[2] === "n" && date[3] === "d" && date[4] === "a" && date[5] === "y") {
          weekday = 0;
          commaIndex = 6;
        } else if (date[1] === "a" && date[2] === "t" && date[3] === "u" && date[4] === "r" && date[5] === "d" && date[6] === "a" && date[7] === "y") {
          weekday = 6;
          commaIndex = 8;
        }
      } else if (date[0] === "M" && date[1] === "o" && date[2] === "n" && date[3] === "d" && date[4] === "a" && date[5] === "y") {
        weekday = 1;
        commaIndex = 6;
      } else if (date[0] === "T") {
        if (date[1] === "u" && date[2] === "e" && date[3] === "s" && date[4] === "d" && date[5] === "a" && date[6] === "y") {
          weekday = 2;
          commaIndex = 7;
        } else if (date[1] === "h" && date[2] === "u" && date[3] === "r" && date[4] === "s" && date[5] === "d" && date[6] === "a" && date[7] === "y") {
          weekday = 4;
          commaIndex = 8;
        }
      } else if (date[0] === "W" && date[1] === "e" && date[2] === "d" && date[3] === "n" && date[4] === "e" && date[5] === "s" && date[6] === "d" && date[7] === "a" && date[8] === "y") {
        weekday = 3;
        commaIndex = 9;
      } else if (date[0] === "F" && date[1] === "r" && date[2] === "i" && date[3] === "d" && date[4] === "a" && date[5] === "y") {
        weekday = 5;
        commaIndex = 6;
      } else {
        return void 0;
      }
      if (date[commaIndex] !== "," || date.length - commaIndex - 1 !== 23 || date[commaIndex + 1] !== " " || date[commaIndex + 4] !== "-" || date[commaIndex + 8] !== "-" || date[commaIndex + 11] !== " " || date[commaIndex + 14] !== ":" || date[commaIndex + 17] !== ":" || date[commaIndex + 20] !== " " || date[commaIndex + 21] !== "G" || date[commaIndex + 22] !== "M" || date[commaIndex + 23] !== "T") {
        return void 0;
      }
      let day = 0;
      if (date[commaIndex + 2] === "0") {
        const code = date.charCodeAt(commaIndex + 3);
        if (code < 49 || code > 57) {
          return void 0;
        }
        day = code - 48;
      } else {
        const code1 = date.charCodeAt(commaIndex + 2);
        if (code1 < 49 || code1 > 51) {
          return void 0;
        }
        const code2 = date.charCodeAt(commaIndex + 3);
        if (code2 < 48 || code2 > 57) {
          return void 0;
        }
        day = (code1 - 48) * 10 + (code2 - 48);
      }
      let monthIdx = -1;
      if (date[commaIndex + 5] === "J" && date[commaIndex + 6] === "a" && date[commaIndex + 7] === "n") {
        monthIdx = 0;
      } else if (date[commaIndex + 5] === "F" && date[commaIndex + 6] === "e" && date[commaIndex + 7] === "b") {
        monthIdx = 1;
      } else if (date[commaIndex + 5] === "M" && date[commaIndex + 6] === "a" && date[commaIndex + 7] === "r") {
        monthIdx = 2;
      } else if (date[commaIndex + 5] === "A" && date[commaIndex + 6] === "p" && date[commaIndex + 7] === "r") {
        monthIdx = 3;
      } else if (date[commaIndex + 5] === "M" && date[commaIndex + 6] === "a" && date[commaIndex + 7] === "y") {
        monthIdx = 4;
      } else if (date[commaIndex + 5] === "J" && date[commaIndex + 6] === "u" && date[commaIndex + 7] === "n") {
        monthIdx = 5;
      } else if (date[commaIndex + 5] === "J" && date[commaIndex + 6] === "u" && date[commaIndex + 7] === "l") {
        monthIdx = 6;
      } else if (date[commaIndex + 5] === "A" && date[commaIndex + 6] === "u" && date[commaIndex + 7] === "g") {
        monthIdx = 7;
      } else if (date[commaIndex + 5] === "S" && date[commaIndex + 6] === "e" && date[commaIndex + 7] === "p") {
        monthIdx = 8;
      } else if (date[commaIndex + 5] === "O" && date[commaIndex + 6] === "c" && date[commaIndex + 7] === "t") {
        monthIdx = 9;
      } else if (date[commaIndex + 5] === "N" && date[commaIndex + 6] === "o" && date[commaIndex + 7] === "v") {
        monthIdx = 10;
      } else if (date[commaIndex + 5] === "D" && date[commaIndex + 6] === "e" && date[commaIndex + 7] === "c") {
        monthIdx = 11;
      } else {
        return void 0;
      }
      const yearDigit1 = date.charCodeAt(commaIndex + 9);
      if (yearDigit1 < 48 || yearDigit1 > 57) {
        return void 0;
      }
      const yearDigit2 = date.charCodeAt(commaIndex + 10);
      if (yearDigit2 < 48 || yearDigit2 > 57) {
        return void 0;
      }
      let year = (yearDigit1 - 48) * 10 + (yearDigit2 - 48);
      year += year < 70 ? 2e3 : 1900;
      let hour = 0;
      if (date[commaIndex + 12] === "0") {
        const code = date.charCodeAt(commaIndex + 13);
        if (code < 48 || code > 57) {
          return void 0;
        }
        hour = code - 48;
      } else {
        const code1 = date.charCodeAt(commaIndex + 12);
        if (code1 < 48 || code1 > 50) {
          return void 0;
        }
        const code2 = date.charCodeAt(commaIndex + 13);
        if (code2 < 48 || code2 > 57) {
          return void 0;
        }
        if (code1 === 50 && code2 > 51) {
          return void 0;
        }
        hour = (code1 - 48) * 10 + (code2 - 48);
      }
      let minute = 0;
      if (date[commaIndex + 15] === "0") {
        const code = date.charCodeAt(commaIndex + 16);
        if (code < 48 || code > 57) {
          return void 0;
        }
        minute = code - 48;
      } else {
        const code1 = date.charCodeAt(commaIndex + 15);
        if (code1 < 48 || code1 > 53) {
          return void 0;
        }
        const code2 = date.charCodeAt(commaIndex + 16);
        if (code2 < 48 || code2 > 57) {
          return void 0;
        }
        minute = (code1 - 48) * 10 + (code2 - 48);
      }
      let second = 0;
      if (date[commaIndex + 18] === "0") {
        const code = date.charCodeAt(commaIndex + 19);
        if (code < 48 || code > 57) {
          return void 0;
        }
        second = code - 48;
      } else {
        const code1 = date.charCodeAt(commaIndex + 18);
        if (code1 < 48 || code1 > 53) {
          return void 0;
        }
        const code2 = date.charCodeAt(commaIndex + 19);
        if (code2 < 48 || code2 > 57) {
          return void 0;
        }
        second = (code1 - 48) * 10 + (code2 - 48);
      }
      const result = new Date(Date.UTC(year, monthIdx, day, hour, minute, second));
      return result.getUTCDay() === weekday ? result : void 0;
    }
    __name(parseRfc850Date, "parseRfc850Date");
    module2.exports = {
      parseHttpDate
    };
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/handler/cache-handler.js
var require_cache_handler = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/handler/cache-handler.js"(exports, module2) {
    init_import_meta_url();
    var util5 = require_util();
    var {
      parseCacheControlHeader,
      parseVaryHeader,
      isEtagUsable
    } = require_cache();
    var { parseHttpDate } = require_date();
    function noop() {
    }
    __name(noop, "noop");
    var HEURISTICALLY_CACHEABLE_STATUS_CODES = [
      200,
      203,
      204,
      206,
      300,
      301,
      308,
      404,
      405,
      410,
      414,
      501
    ];
    var NOT_UNDERSTOOD_STATUS_CODES = [
      206
    ];
    var MAX_RESPONSE_AGE = 2147483647e3;
    var CacheHandler = class {
      static {
        __name(this, "CacheHandler");
      }
      /**
       * @type {import('../../types/cache-interceptor.d.ts').default.CacheKey}
       */
      #cacheKey;
      /**
       * @type {import('../../types/cache-interceptor.d.ts').default.CacheHandlerOptions['type']}
       */
      #cacheType;
      /**
       * @type {number | undefined}
       */
      #cacheByDefault;
      /**
       * @type {import('../../types/cache-interceptor.d.ts').default.CacheStore}
       */
      #store;
      /**
       * @type {import('../../types/dispatcher.d.ts').default.DispatchHandler}
       */
      #handler;
      /**
       * @type {import('node:stream').Writable | undefined}
       */
      #writeStream;
      /**
       * @param {import('../../types/cache-interceptor.d.ts').default.CacheHandlerOptions} opts
       * @param {import('../../types/cache-interceptor.d.ts').default.CacheKey} cacheKey
       * @param {import('../../types/dispatcher.d.ts').default.DispatchHandler} handler
       */
      constructor({ store, type, cacheByDefault }, cacheKey, handler) {
        this.#store = store;
        this.#cacheType = type;
        this.#cacheByDefault = cacheByDefault;
        this.#cacheKey = cacheKey;
        this.#handler = handler;
      }
      onRequestStart(controller, context2) {
        this.#writeStream?.destroy();
        this.#writeStream = void 0;
        this.#handler.onRequestStart?.(controller, context2);
      }
      onRequestUpgrade(controller, statusCode, headers, socket) {
        this.#handler.onRequestUpgrade?.(controller, statusCode, headers, socket);
      }
      /**
       * @param {import('../../types/dispatcher.d.ts').default.DispatchController} controller
       * @param {number} statusCode
       * @param {import('../../types/header.d.ts').IncomingHttpHeaders} resHeaders
       * @param {string} statusMessage
       */
      onResponseStart(controller, statusCode, resHeaders, statusMessage) {
        const downstreamOnHeaders = /* @__PURE__ */ __name(() => this.#handler.onResponseStart?.(
          controller,
          statusCode,
          resHeaders,
          statusMessage
        ), "downstreamOnHeaders");
        const handler = this;
        if (!util5.safeHTTPMethods.includes(this.#cacheKey.method) && statusCode >= 200 && statusCode <= 399) {
          try {
            this.#store.delete(this.#cacheKey)?.catch?.(noop);
          } catch {
          }
          return downstreamOnHeaders();
        }
        const cacheControlHeader = resHeaders["cache-control"];
        const heuristicallyCacheable = resHeaders["last-modified"] && HEURISTICALLY_CACHEABLE_STATUS_CODES.includes(statusCode);
        if (!cacheControlHeader && !resHeaders["expires"] && !heuristicallyCacheable && !this.#cacheByDefault) {
          return downstreamOnHeaders();
        }
        const cacheControlDirectives = cacheControlHeader ? parseCacheControlHeader(cacheControlHeader) : {};
        if (!canCacheResponse(this.#cacheType, statusCode, resHeaders, cacheControlDirectives)) {
          return downstreamOnHeaders();
        }
        const now = Date.now();
        const resAge = resHeaders.age ? getAge(resHeaders.age) : void 0;
        if (resAge && resAge >= MAX_RESPONSE_AGE) {
          return downstreamOnHeaders();
        }
        const resDate = typeof resHeaders.date === "string" ? parseHttpDate(resHeaders.date) : void 0;
        const staleAt = determineStaleAt(this.#cacheType, now, resAge, resHeaders, resDate, cacheControlDirectives) ?? this.#cacheByDefault;
        if (staleAt === void 0 || resAge && resAge > staleAt) {
          return downstreamOnHeaders();
        }
        const baseTime = resDate ? resDate.getTime() : now;
        const absoluteStaleAt = staleAt + baseTime;
        if (now >= absoluteStaleAt) {
          return downstreamOnHeaders();
        }
        let varyDirectives;
        if (this.#cacheKey.headers && resHeaders.vary) {
          varyDirectives = parseVaryHeader(resHeaders.vary, this.#cacheKey.headers);
          if (!varyDirectives) {
            return downstreamOnHeaders();
          }
        }
        const deleteAt = determineDeleteAt(baseTime, cacheControlDirectives, absoluteStaleAt);
        const strippedHeaders = stripNecessaryHeaders(resHeaders, cacheControlDirectives);
        const value = {
          statusCode,
          statusMessage,
          headers: strippedHeaders,
          vary: varyDirectives,
          cacheControlDirectives,
          cachedAt: resAge ? now - resAge : now,
          staleAt: absoluteStaleAt,
          deleteAt
        };
        if (statusCode === 304) {
          const handle304 = /* @__PURE__ */ __name((cachedValue) => {
            if (!cachedValue) {
              return downstreamOnHeaders();
            }
            value.statusCode = cachedValue.statusCode;
            value.statusMessage = cachedValue.statusMessage;
            value.etag = cachedValue.etag;
            value.headers = { ...cachedValue.headers, ...strippedHeaders };
            downstreamOnHeaders();
            this.#writeStream = this.#store.createWriteStream(this.#cacheKey, value);
            if (!this.#writeStream || !cachedValue?.body) {
              return;
            }
            if (typeof cachedValue.body.values === "function") {
              const bodyIterator = cachedValue.body.values();
              const streamCachedBody = /* @__PURE__ */ __name(() => {
                for (const chunk of bodyIterator) {
                  const full = this.#writeStream.write(chunk) === false;
                  this.#handler.onResponseData?.(controller, chunk);
                  if (full) {
                    break;
                  }
                }
              }, "streamCachedBody");
              this.#writeStream.on("error", function() {
                handler.#writeStream = void 0;
                handler.#store.delete(handler.#cacheKey);
              }).on("drain", () => {
                streamCachedBody();
              }).on("close", function() {
                if (handler.#writeStream === this) {
                  handler.#writeStream = void 0;
                }
              });
              streamCachedBody();
            } else if (typeof cachedValue.body.on === "function") {
              cachedValue.body.on("data", (chunk) => {
                this.#writeStream.write(chunk);
                this.#handler.onResponseData?.(controller, chunk);
              }).on("end", () => {
                this.#writeStream.end();
              }).on("error", () => {
                this.#writeStream = void 0;
                this.#store.delete(this.#cacheKey);
              });
              this.#writeStream.on("error", function() {
                handler.#writeStream = void 0;
                handler.#store.delete(handler.#cacheKey);
              }).on("close", function() {
                if (handler.#writeStream === this) {
                  handler.#writeStream = void 0;
                }
              });
            }
          }, "handle304");
          const result = this.#store.get(this.#cacheKey);
          if (result && typeof result.then === "function") {
            result.then(handle304);
          } else {
            handle304(result);
          }
        } else {
          if (typeof resHeaders.etag === "string" && isEtagUsable(resHeaders.etag)) {
            value.etag = resHeaders.etag;
          }
          this.#writeStream = this.#store.createWriteStream(this.#cacheKey, value);
          if (!this.#writeStream) {
            return downstreamOnHeaders();
          }
          this.#writeStream.on("drain", () => controller.resume()).on("error", function() {
            handler.#writeStream = void 0;
            handler.#store.delete(handler.#cacheKey);
          }).on("close", function() {
            if (handler.#writeStream === this) {
              handler.#writeStream = void 0;
            }
            controller.resume();
          });
          downstreamOnHeaders();
        }
      }
      onResponseData(controller, chunk) {
        if (this.#writeStream?.write(chunk) === false) {
          controller.pause();
        }
        this.#handler.onResponseData?.(controller, chunk);
      }
      onResponseEnd(controller, trailers) {
        this.#writeStream?.end();
        this.#handler.onResponseEnd?.(controller, trailers);
      }
      onResponseError(controller, err) {
        this.#writeStream?.destroy(err);
        this.#writeStream = void 0;
        this.#handler.onResponseError?.(controller, err);
      }
    };
    function canCacheResponse(cacheType, statusCode, resHeaders, cacheControlDirectives) {
      if (statusCode < 200 || NOT_UNDERSTOOD_STATUS_CODES.includes(statusCode)) {
        return false;
      }
      if (!HEURISTICALLY_CACHEABLE_STATUS_CODES.includes(statusCode) && !resHeaders["expires"] && !cacheControlDirectives.public && cacheControlDirectives["max-age"] === void 0 && // RFC 9111: a private response directive, if the cache is not shared
      !(cacheControlDirectives.private && cacheType === "private") && !(cacheControlDirectives["s-maxage"] !== void 0 && cacheType === "shared")) {
        return false;
      }
      if (cacheControlDirectives["no-store"]) {
        return false;
      }
      if (cacheType === "shared" && cacheControlDirectives.private === true) {
        return false;
      }
      if (resHeaders.vary?.includes("*")) {
        return false;
      }
      if (resHeaders.authorization) {
        if (!cacheControlDirectives.public || typeof resHeaders.authorization !== "string") {
          return false;
        }
        if (Array.isArray(cacheControlDirectives["no-cache"]) && cacheControlDirectives["no-cache"].includes("authorization")) {
          return false;
        }
        if (Array.isArray(cacheControlDirectives["private"]) && cacheControlDirectives["private"].includes("authorization")) {
          return false;
        }
      }
      return true;
    }
    __name(canCacheResponse, "canCacheResponse");
    function getAge(ageHeader) {
      const age = parseInt(Array.isArray(ageHeader) ? ageHeader[0] : ageHeader);
      return isNaN(age) ? void 0 : age * 1e3;
    }
    __name(getAge, "getAge");
    function determineStaleAt(cacheType, now, age, resHeaders, responseDate, cacheControlDirectives) {
      if (cacheType === "shared") {
        const sMaxAge = cacheControlDirectives["s-maxage"];
        if (sMaxAge !== void 0) {
          return sMaxAge > 0 ? sMaxAge * 1e3 : void 0;
        }
      }
      const maxAge = cacheControlDirectives["max-age"];
      if (maxAge !== void 0) {
        return maxAge > 0 ? maxAge * 1e3 : void 0;
      }
      if (typeof resHeaders.expires === "string") {
        const expiresDate = parseHttpDate(resHeaders.expires);
        if (expiresDate) {
          if (now >= expiresDate.getTime()) {
            return void 0;
          }
          if (responseDate) {
            if (responseDate >= expiresDate) {
              return void 0;
            }
            if (age !== void 0 && age > expiresDate - responseDate) {
              return void 0;
            }
          }
          return expiresDate.getTime() - now;
        }
      }
      if (typeof resHeaders["last-modified"] === "string") {
        const lastModified = new Date(resHeaders["last-modified"]);
        if (isValidDate2(lastModified)) {
          if (lastModified.getTime() >= now) {
            return void 0;
          }
          const responseAge = now - lastModified.getTime();
          return responseAge * 0.1;
        }
      }
      if (cacheControlDirectives.immutable) {
        return 31536e3;
      }
      return void 0;
    }
    __name(determineStaleAt, "determineStaleAt");
    function determineDeleteAt(now, cacheControlDirectives, staleAt) {
      let staleWhileRevalidate = -Infinity;
      let staleIfError = -Infinity;
      let immutable = -Infinity;
      if (cacheControlDirectives["stale-while-revalidate"]) {
        staleWhileRevalidate = staleAt + cacheControlDirectives["stale-while-revalidate"] * 1e3;
      }
      if (cacheControlDirectives["stale-if-error"]) {
        staleIfError = staleAt + cacheControlDirectives["stale-if-error"] * 1e3;
      }
      if (staleWhileRevalidate === -Infinity && staleIfError === -Infinity) {
        immutable = now + 31536e6;
      }
      return Math.max(staleAt, staleWhileRevalidate, staleIfError, immutable);
    }
    __name(determineDeleteAt, "determineDeleteAt");
    function stripNecessaryHeaders(resHeaders, cacheControlDirectives) {
      const headersToRemove = [
        "connection",
        "proxy-authenticate",
        "proxy-authentication-info",
        "proxy-authorization",
        "proxy-connection",
        "te",
        "transfer-encoding",
        "upgrade",
        // We'll add age back when serving it
        "age"
      ];
      if (resHeaders["connection"]) {
        if (Array.isArray(resHeaders["connection"])) {
          headersToRemove.push(...resHeaders["connection"].map((header) => header.trim()));
        } else {
          headersToRemove.push(...resHeaders["connection"].split(",").map((header) => header.trim()));
        }
      }
      if (Array.isArray(cacheControlDirectives["no-cache"])) {
        headersToRemove.push(...cacheControlDirectives["no-cache"]);
      }
      if (Array.isArray(cacheControlDirectives["private"])) {
        headersToRemove.push(...cacheControlDirectives["private"]);
      }
      let strippedHeaders;
      for (const headerName of headersToRemove) {
        if (resHeaders[headerName]) {
          strippedHeaders ??= { ...resHeaders };
          delete strippedHeaders[headerName];
        }
      }
      return strippedHeaders ?? resHeaders;
    }
    __name(stripNecessaryHeaders, "stripNecessaryHeaders");
    function isValidDate2(date) {
      return date instanceof Date && Number.isFinite(date.valueOf());
    }
    __name(isValidDate2, "isValidDate");
    module2.exports = CacheHandler;
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/cache/memory-cache-store.js
var require_memory_cache_store = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/cache/memory-cache-store.js"(exports, module2) {
    init_import_meta_url();
    var { Writable: Writable5 } = __require("stream");
    var { EventEmitter: EventEmitter5 } = __require("events");
    var { assertCacheKey, assertCacheValue } = require_cache();
    var MemoryCacheStore = class extends EventEmitter5 {
      static {
        __name(this, "MemoryCacheStore");
      }
      #maxCount = 1024;
      #maxSize = 104857600;
      // 100MB
      #maxEntrySize = 5242880;
      // 5MB
      #size = 0;
      #count = 0;
      #entries = /* @__PURE__ */ new Map();
      #hasEmittedMaxSizeEvent = false;
      /**
       * @param {import('../../types/cache-interceptor.d.ts').default.MemoryCacheStoreOpts | undefined} [opts]
       */
      constructor(opts) {
        super();
        if (opts) {
          if (typeof opts !== "object") {
            throw new TypeError("MemoryCacheStore options must be an object");
          }
          if (opts.maxCount !== void 0) {
            if (typeof opts.maxCount !== "number" || !Number.isInteger(opts.maxCount) || opts.maxCount < 0) {
              throw new TypeError("MemoryCacheStore options.maxCount must be a non-negative integer");
            }
            this.#maxCount = opts.maxCount;
          }
          if (opts.maxSize !== void 0) {
            if (typeof opts.maxSize !== "number" || !Number.isInteger(opts.maxSize) || opts.maxSize < 0) {
              throw new TypeError("MemoryCacheStore options.maxSize must be a non-negative integer");
            }
            this.#maxSize = opts.maxSize;
          }
          if (opts.maxEntrySize !== void 0) {
            if (typeof opts.maxEntrySize !== "number" || !Number.isInteger(opts.maxEntrySize) || opts.maxEntrySize < 0) {
              throw new TypeError("MemoryCacheStore options.maxEntrySize must be a non-negative integer");
            }
            this.#maxEntrySize = opts.maxEntrySize;
          }
        }
      }
      /**
       * Get the current size of the cache in bytes
       * @returns {number} The current size of the cache in bytes
       */
      get size() {
        return this.#size;
      }
      /**
       * Check if the cache is full (either max size or max count reached)
       * @returns {boolean} True if the cache is full, false otherwise
       */
      isFull() {
        return this.#size >= this.#maxSize || this.#count >= this.#maxCount;
      }
      /**
       * @param {import('../../types/cache-interceptor.d.ts').default.CacheKey} req
       * @returns {import('../../types/cache-interceptor.d.ts').default.GetResult | undefined}
       */
      get(key) {
        assertCacheKey(key);
        const topLevelKey = `${key.origin}:${key.path}`;
        const now = Date.now();
        const entries2 = this.#entries.get(topLevelKey);
        const entry = entries2 ? findEntry(key, entries2, now) : null;
        return entry == null ? void 0 : {
          statusMessage: entry.statusMessage,
          statusCode: entry.statusCode,
          headers: entry.headers,
          body: entry.body,
          vary: entry.vary ? entry.vary : void 0,
          etag: entry.etag,
          cacheControlDirectives: entry.cacheControlDirectives,
          cachedAt: entry.cachedAt,
          staleAt: entry.staleAt,
          deleteAt: entry.deleteAt
        };
      }
      /**
       * @param {import('../../types/cache-interceptor.d.ts').default.CacheKey} key
       * @param {import('../../types/cache-interceptor.d.ts').default.CacheValue} val
       * @returns {Writable | undefined}
       */
      createWriteStream(key, val2) {
        assertCacheKey(key);
        assertCacheValue(val2);
        const topLevelKey = `${key.origin}:${key.path}`;
        const store = this;
        const entry = { ...key, ...val2, body: [], size: 0 };
        return new Writable5({
          write(chunk, encoding, callback) {
            if (typeof chunk === "string") {
              chunk = Buffer.from(chunk, encoding);
            }
            entry.size += chunk.byteLength;
            if (entry.size >= store.#maxEntrySize) {
              this.destroy();
            } else {
              entry.body.push(chunk);
            }
            callback(null);
          },
          final(callback) {
            let entries2 = store.#entries.get(topLevelKey);
            if (!entries2) {
              entries2 = [];
              store.#entries.set(topLevelKey, entries2);
            }
            const previousEntry = findEntry(key, entries2, Date.now());
            if (previousEntry) {
              const index = entries2.indexOf(previousEntry);
              entries2.splice(index, 1, entry);
              store.#size -= previousEntry.size;
            } else {
              entries2.push(entry);
              store.#count += 1;
            }
            store.#size += entry.size;
            if (store.#size > store.#maxSize || store.#count > store.#maxCount) {
              if (!store.#hasEmittedMaxSizeEvent) {
                store.emit("maxSizeExceeded", {
                  size: store.#size,
                  maxSize: store.#maxSize,
                  count: store.#count,
                  maxCount: store.#maxCount
                });
                store.#hasEmittedMaxSizeEvent = true;
              }
              for (const [key2, entries3] of store.#entries) {
                for (const entry2 of entries3.splice(0, entries3.length / 2)) {
                  store.#size -= entry2.size;
                  store.#count -= 1;
                }
                if (entries3.length === 0) {
                  store.#entries.delete(key2);
                }
              }
              if (store.#size < store.#maxSize && store.#count < store.#maxCount) {
                store.#hasEmittedMaxSizeEvent = false;
              }
            }
            callback(null);
          }
        });
      }
      /**
       * @param {CacheKey} key
       */
      delete(key) {
        if (typeof key !== "object") {
          throw new TypeError(`expected key to be object, got ${typeof key}`);
        }
        const topLevelKey = `${key.origin}:${key.path}`;
        for (const entry of this.#entries.get(topLevelKey) ?? []) {
          this.#size -= entry.size;
          this.#count -= 1;
        }
        this.#entries.delete(topLevelKey);
      }
    };
    function findEntry(key, entries2, now) {
      return entries2.find((entry) => entry.deleteAt > now && entry.method === key.method && (entry.vary == null || Object.keys(entry.vary).every((headerName) => {
        if (entry.vary[headerName] === null) {
          return key.headers[headerName] === void 0;
        }
        return entry.vary[headerName] === key.headers[headerName];
      })));
    }
    __name(findEntry, "findEntry");
    module2.exports = MemoryCacheStore;
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/handler/cache-revalidation-handler.js
var require_cache_revalidation_handler = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/handler/cache-revalidation-handler.js"(exports, module2) {
    init_import_meta_url();
    var assert61 = __require("assert");
    var CacheRevalidationHandler = class {
      static {
        __name(this, "CacheRevalidationHandler");
      }
      #successful = false;
      /**
       * @type {((boolean, any) => void) | null}
       */
      #callback;
      /**
       * @type {(import('../../types/dispatcher.d.ts').default.DispatchHandler)}
       */
      #handler;
      #context;
      /**
       * @type {boolean}
       */
      #allowErrorStatusCodes;
      /**
       * @param {(boolean) => void} callback Function to call if the cached value is valid
       * @param {import('../../types/dispatcher.d.ts').default.DispatchHandlers} handler
       * @param {boolean} allowErrorStatusCodes
       */
      constructor(callback, handler, allowErrorStatusCodes) {
        if (typeof callback !== "function") {
          throw new TypeError("callback must be a function");
        }
        this.#callback = callback;
        this.#handler = handler;
        this.#allowErrorStatusCodes = allowErrorStatusCodes;
      }
      onRequestStart(_5, context2) {
        this.#successful = false;
        this.#context = context2;
      }
      onRequestUpgrade(controller, statusCode, headers, socket) {
        this.#handler.onRequestUpgrade?.(controller, statusCode, headers, socket);
      }
      onResponseStart(controller, statusCode, headers, statusMessage) {
        assert61(this.#callback != null);
        this.#successful = statusCode === 304 || this.#allowErrorStatusCodes && statusCode >= 500 && statusCode <= 504;
        this.#callback(this.#successful, this.#context);
        this.#callback = null;
        if (this.#successful) {
          return true;
        }
        this.#handler.onRequestStart?.(controller, this.#context);
        this.#handler.onResponseStart?.(
          controller,
          statusCode,
          headers,
          statusMessage
        );
      }
      onResponseData(controller, chunk) {
        if (this.#successful) {
          return;
        }
        return this.#handler.onResponseData?.(controller, chunk);
      }
      onResponseEnd(controller, trailers) {
        if (this.#successful) {
          return;
        }
        this.#handler.onResponseEnd?.(controller, trailers);
      }
      onResponseError(controller, err) {
        if (this.#successful) {
          return;
        }
        if (this.#callback) {
          this.#callback(false);
          this.#callback = null;
        }
        if (typeof this.#handler.onResponseError === "function") {
          this.#handler.onResponseError(controller, err);
        } else {
          throw err;
        }
      }
    };
    module2.exports = CacheRevalidationHandler;
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/interceptor/cache.js
var require_cache2 = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/interceptor/cache.js"(exports, module2) {
    init_import_meta_url();
    var assert61 = __require("assert");
    var { Readable: Readable11 } = __require("stream");
    var util5 = require_util();
    var CacheHandler = require_cache_handler();
    var MemoryCacheStore = require_memory_cache_store();
    var CacheRevalidationHandler = require_cache_revalidation_handler();
    var { assertCacheStore, assertCacheMethods, makeCacheKey, normalizeHeaders, parseCacheControlHeader } = require_cache();
    var { AbortError: AbortError2 } = require_errors();
    function assertCacheOrigins(origins, name2) {
      if (origins === void 0) return;
      if (!Array.isArray(origins)) {
        throw new TypeError(`expected ${name2} to be an array or undefined, got ${typeof origins}`);
      }
      for (let i7 = 0; i7 < origins.length; i7++) {
        const origin = origins[i7];
        if (typeof origin !== "string" && !(origin instanceof RegExp)) {
          throw new TypeError(`expected ${name2}[${i7}] to be a string or RegExp, got ${typeof origin}`);
        }
      }
    }
    __name(assertCacheOrigins, "assertCacheOrigins");
    var nop = /* @__PURE__ */ __name(() => {
    }, "nop");
    function needsRevalidation(result, cacheControlDirectives, { headers = {} }) {
      if (cacheControlDirectives?.["no-cache"]) {
        return true;
      }
      if (result.cacheControlDirectives?.["no-cache"] && !Array.isArray(result.cacheControlDirectives["no-cache"])) {
        return true;
      }
      if (headers["if-modified-since"] || headers["if-none-match"]) {
        return true;
      }
      return false;
    }
    __name(needsRevalidation, "needsRevalidation");
    function isStale(result, cacheControlDirectives) {
      const now = Date.now();
      if (now > result.staleAt) {
        if (cacheControlDirectives?.["max-stale"]) {
          const gracePeriod = result.staleAt + cacheControlDirectives["max-stale"] * 1e3;
          return now > gracePeriod;
        }
        return true;
      }
      if (cacheControlDirectives?.["min-fresh"]) {
        const timeLeftTillStale = result.staleAt - now;
        const threshold = cacheControlDirectives["min-fresh"] * 1e3;
        return timeLeftTillStale <= threshold;
      }
      return false;
    }
    __name(isStale, "isStale");
    function withinStaleWhileRevalidateWindow(result) {
      const staleWhileRevalidate = result.cacheControlDirectives?.["stale-while-revalidate"];
      if (!staleWhileRevalidate) {
        return false;
      }
      const now = Date.now();
      const staleWhileRevalidateExpiry = result.staleAt + staleWhileRevalidate * 1e3;
      return now <= staleWhileRevalidateExpiry;
    }
    __name(withinStaleWhileRevalidateWindow, "withinStaleWhileRevalidateWindow");
    function handleUncachedResponse(dispatch, globalOpts, cacheKey, handler, opts, reqCacheControl) {
      if (reqCacheControl?.["only-if-cached"]) {
        let aborted = false;
        try {
          if (typeof handler.onConnect === "function") {
            handler.onConnect(() => {
              aborted = true;
            });
            if (aborted) {
              return;
            }
          }
          if (typeof handler.onHeaders === "function") {
            handler.onHeaders(504, [], nop, "Gateway Timeout");
            if (aborted) {
              return;
            }
          }
          if (typeof handler.onComplete === "function") {
            handler.onComplete([]);
          }
        } catch (err) {
          if (typeof handler.onError === "function") {
            handler.onError(err);
          }
        }
        return true;
      }
      return dispatch(opts, new CacheHandler(globalOpts, cacheKey, handler));
    }
    __name(handleUncachedResponse, "handleUncachedResponse");
    function sendCachedValue(handler, opts, result, age, context2, isStale2) {
      const stream2 = util5.isStream(result.body) ? result.body : Readable11.from(result.body ?? []);
      assert61(!stream2.destroyed, "stream should not be destroyed");
      assert61(!stream2.readableDidRead, "stream should not be readableDidRead");
      const controller = {
        resume() {
          stream2.resume();
        },
        pause() {
          stream2.pause();
        },
        get paused() {
          return stream2.isPaused();
        },
        get aborted() {
          return stream2.destroyed;
        },
        get reason() {
          return stream2.errored;
        },
        abort(reason) {
          stream2.destroy(reason ?? new AbortError2());
        }
      };
      stream2.on("error", function(err) {
        if (!this.readableEnded) {
          if (typeof handler.onResponseError === "function") {
            handler.onResponseError(controller, err);
          } else {
            throw err;
          }
        }
      }).on("close", function() {
        if (!this.errored) {
          handler.onResponseEnd?.(controller, {});
        }
      });
      handler.onRequestStart?.(controller, context2);
      if (stream2.destroyed) {
        return;
      }
      const headers = { ...result.headers, age: String(age) };
      if (isStale2) {
        headers.warning = '110 - "response is stale"';
      }
      handler.onResponseStart?.(controller, result.statusCode, headers, result.statusMessage);
      if (opts.method === "HEAD") {
        stream2.destroy();
      } else {
        stream2.on("data", function(chunk) {
          handler.onResponseData?.(controller, chunk);
        });
      }
    }
    __name(sendCachedValue, "sendCachedValue");
    function handleResult4(dispatch, globalOpts, cacheKey, handler, opts, reqCacheControl, result) {
      if (!result) {
        return handleUncachedResponse(dispatch, globalOpts, cacheKey, handler, opts, reqCacheControl);
      }
      const now = Date.now();
      if (now > result.deleteAt) {
        return dispatch(opts, new CacheHandler(globalOpts, cacheKey, handler));
      }
      const age = Math.round((now - result.cachedAt) / 1e3);
      if (reqCacheControl?.["max-age"] && age >= reqCacheControl["max-age"]) {
        return dispatch(opts, handler);
      }
      const stale = isStale(result, reqCacheControl);
      const revalidate = needsRevalidation(result, reqCacheControl, opts);
      if (stale || revalidate) {
        if (util5.isStream(opts.body) && util5.bodyLength(opts.body) !== 0) {
          return dispatch(opts, new CacheHandler(globalOpts, cacheKey, handler));
        }
        if (!revalidate && withinStaleWhileRevalidateWindow(result)) {
          sendCachedValue(handler, opts, result, age, null, true);
          queueMicrotask(() => {
            const headers2 = {
              ...opts.headers,
              "if-modified-since": new Date(result.cachedAt).toUTCString()
            };
            if (result.etag) {
              headers2["if-none-match"] = result.etag;
            }
            if (result.vary) {
              for (const key in result.vary) {
                if (result.vary[key] != null) {
                  headers2[key] = result.vary[key];
                }
              }
            }
            dispatch(
              {
                ...opts,
                headers: headers2
              },
              new CacheHandler(globalOpts, cacheKey, {
                // Silent handler that just updates the cache
                onRequestStart() {
                },
                onRequestUpgrade() {
                },
                onResponseStart() {
                },
                onResponseData() {
                },
                onResponseEnd() {
                },
                onResponseError() {
                }
              })
            );
          });
          return true;
        }
        let withinStaleIfErrorThreshold = false;
        const staleIfErrorExpiry = result.cacheControlDirectives["stale-if-error"] ?? reqCacheControl?.["stale-if-error"];
        if (staleIfErrorExpiry) {
          withinStaleIfErrorThreshold = now < result.staleAt + staleIfErrorExpiry * 1e3;
        }
        const headers = {
          ...opts.headers,
          "if-modified-since": new Date(result.cachedAt).toUTCString()
        };
        if (result.etag) {
          headers["if-none-match"] = result.etag;
        }
        if (result.vary) {
          for (const key in result.vary) {
            if (result.vary[key] != null) {
              headers[key] = result.vary[key];
            }
          }
        }
        return dispatch(
          {
            ...opts,
            headers
          },
          new CacheRevalidationHandler(
            (success2, context2) => {
              if (success2) {
                sendCachedValue(handler, opts, result, age, context2, stale);
              } else if (util5.isStream(result.body)) {
                result.body.on("error", nop).destroy();
              }
            },
            new CacheHandler(globalOpts, cacheKey, handler),
            withinStaleIfErrorThreshold
          )
        );
      }
      if (util5.isStream(opts.body)) {
        opts.body.on("error", nop).destroy();
      }
      sendCachedValue(handler, opts, result, age, null, false);
    }
    __name(handleResult4, "handleResult");
    module2.exports = (opts = {}) => {
      const {
        store = new MemoryCacheStore(),
        methods = ["GET"],
        cacheByDefault = void 0,
        type = "shared",
        origins = void 0
      } = opts;
      if (typeof opts !== "object" || opts === null) {
        throw new TypeError(`expected type of opts to be an Object, got ${opts === null ? "null" : typeof opts}`);
      }
      assertCacheStore(store, "opts.store");
      assertCacheMethods(methods, "opts.methods");
      assertCacheOrigins(origins, "opts.origins");
      if (typeof cacheByDefault !== "undefined" && typeof cacheByDefault !== "number") {
        throw new TypeError(`expected opts.cacheByDefault to be number or undefined, got ${typeof cacheByDefault}`);
      }
      if (typeof type !== "undefined" && type !== "shared" && type !== "private") {
        throw new TypeError(`expected opts.type to be shared, private, or undefined, got ${typeof type}`);
      }
      const globalOpts = {
        store,
        methods,
        cacheByDefault,
        type
      };
      const safeMethodsToNotCache = util5.safeHTTPMethods.filter((method) => methods.includes(method) === false);
      return (dispatch) => {
        return (opts2, handler) => {
          if (!opts2.origin || safeMethodsToNotCache.includes(opts2.method)) {
            return dispatch(opts2, handler);
          }
          if (origins !== void 0) {
            const requestOrigin = opts2.origin.toString().toLowerCase();
            let isAllowed = false;
            for (let i7 = 0; i7 < origins.length; i7++) {
              const allowed = origins[i7];
              if (typeof allowed === "string") {
                if (allowed.toLowerCase() === requestOrigin) {
                  isAllowed = true;
                  break;
                }
              } else if (allowed.test(requestOrigin)) {
                isAllowed = true;
                break;
              }
            }
            if (!isAllowed) {
              return dispatch(opts2, handler);
            }
          }
          opts2 = {
            ...opts2,
            headers: normalizeHeaders(opts2)
          };
          const reqCacheControl = opts2.headers?.["cache-control"] ? parseCacheControlHeader(opts2.headers["cache-control"]) : void 0;
          if (reqCacheControl?.["no-store"]) {
            return dispatch(opts2, handler);
          }
          const cacheKey = makeCacheKey(opts2);
          const result = store.get(cacheKey);
          if (result && typeof result.then === "function") {
            return result.then((result2) => handleResult4(
              dispatch,
              globalOpts,
              cacheKey,
              handler,
              opts2,
              reqCacheControl,
              result2
            ));
          } else {
            return handleResult4(
              dispatch,
              globalOpts,
              cacheKey,
              handler,
              opts2,
              reqCacheControl,
              result
            );
          }
        };
      };
    };
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/interceptor/decompress.js
var require_decompress = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/interceptor/decompress.js"(exports, module2) {
    init_import_meta_url();
    var { createInflate, createGunzip, createBrotliDecompress, createZstdDecompress } = __require("zlib");
    var { pipeline } = __require("stream");
    var DecoratorHandler = require_decorator_handler();
    var { runtimeFeatures } = require_runtime_features();
    var supportedEncodings = {
      gzip: createGunzip,
      "x-gzip": createGunzip,
      br: createBrotliDecompress,
      deflate: createInflate,
      compress: createInflate,
      "x-compress": createInflate,
      ...runtimeFeatures.has("zstd") ? { zstd: createZstdDecompress } : {}
    };
    var defaultSkipStatusCodes = (
      /** @type {const} */
      [204, 304]
    );
    var warningEmitted2 = (
      /** @type {boolean} */
      false
    );
    var DecompressHandler = class extends DecoratorHandler {
      static {
        __name(this, "DecompressHandler");
      }
      /** @type {Transform[]} */
      #decompressors = [];
      /** @type {Readonly<number[]>} */
      #skipStatusCodes;
      /** @type {boolean} */
      #skipErrorResponses;
      constructor(handler, { skipStatusCodes = defaultSkipStatusCodes, skipErrorResponses = true } = {}) {
        super(handler);
        this.#skipStatusCodes = skipStatusCodes;
        this.#skipErrorResponses = skipErrorResponses;
      }
      /**
       * Determines if decompression should be skipped based on encoding and status code
       * @param {string} contentEncoding - Content-Encoding header value
       * @param {number} statusCode - HTTP status code of the response
       * @returns {boolean} - True if decompression should be skipped
       */
      #shouldSkipDecompression(contentEncoding, statusCode) {
        if (!contentEncoding || statusCode < 200) return true;
        if (this.#skipStatusCodes.includes(statusCode)) return true;
        if (this.#skipErrorResponses && statusCode >= 400) return true;
        return false;
      }
      /**
       * Creates a chain of decompressors for multiple content encodings
       *
       * @param {string} encodings - Comma-separated list of content encodings
       * @returns {Array<DecompressorStream>} - Array of decompressor streams
       * @throws {Error} - If the number of content-encodings exceeds the maximum allowed
       */
      #createDecompressionChain(encodings) {
        const parts = encodings.split(",");
        const maxContentEncodings = 5;
        if (parts.length > maxContentEncodings) {
          throw new Error(`too many content-encodings in response: ${parts.length}, maximum allowed is ${maxContentEncodings}`);
        }
        const decompressors = [];
        for (let i7 = parts.length - 1; i7 >= 0; i7--) {
          const encoding = parts[i7].trim();
          if (!encoding) continue;
          if (!supportedEncodings[encoding]) {
            decompressors.length = 0;
            return decompressors;
          }
          decompressors.push(supportedEncodings[encoding]());
        }
        return decompressors;
      }
      /**
       * Sets up event handlers for a decompressor stream using readable events
       * @param {DecompressorStream} decompressor - The decompressor stream
       * @param {Controller} controller - The controller to coordinate with
       * @returns {void}
       */
      #setupDecompressorEvents(decompressor, controller) {
        decompressor.on("readable", () => {
          let chunk;
          while ((chunk = decompressor.read()) !== null) {
            const result = super.onResponseData(controller, chunk);
            if (result === false) {
              break;
            }
          }
        });
        decompressor.on("error", (error2) => {
          super.onResponseError(controller, error2);
        });
      }
      /**
       * Sets up event handling for a single decompressor
       * @param {Controller} controller - The controller to handle events
       * @returns {void}
       */
      #setupSingleDecompressor(controller) {
        const decompressor = this.#decompressors[0];
        this.#setupDecompressorEvents(decompressor, controller);
        decompressor.on("end", () => {
          super.onResponseEnd(controller, {});
        });
      }
      /**
       * Sets up event handling for multiple chained decompressors using pipeline
       * @param {Controller} controller - The controller to handle events
       * @returns {void}
       */
      #setupMultipleDecompressors(controller) {
        const lastDecompressor = this.#decompressors[this.#decompressors.length - 1];
        this.#setupDecompressorEvents(lastDecompressor, controller);
        pipeline(this.#decompressors, (err) => {
          if (err) {
            super.onResponseError(controller, err);
            return;
          }
          super.onResponseEnd(controller, {});
        });
      }
      /**
       * Cleans up decompressor references to prevent memory leaks
       * @returns {void}
       */
      #cleanupDecompressors() {
        this.#decompressors.length = 0;
      }
      /**
       * @param {Controller} controller
       * @param {number} statusCode
       * @param {Record<string, string | string[] | undefined>} headers
       * @param {string} statusMessage
       * @returns {void}
       */
      onResponseStart(controller, statusCode, headers, statusMessage) {
        const contentEncoding = headers["content-encoding"];
        if (this.#shouldSkipDecompression(contentEncoding, statusCode)) {
          return super.onResponseStart(controller, statusCode, headers, statusMessage);
        }
        const decompressors = this.#createDecompressionChain(contentEncoding.toLowerCase());
        if (decompressors.length === 0) {
          this.#cleanupDecompressors();
          return super.onResponseStart(controller, statusCode, headers, statusMessage);
        }
        this.#decompressors = decompressors;
        const { "content-encoding": _5, "content-length": __, ...newHeaders } = headers;
        if (this.#decompressors.length === 1) {
          this.#setupSingleDecompressor(controller);
        } else {
          this.#setupMultipleDecompressors(controller);
        }
        return super.onResponseStart(controller, statusCode, newHeaders, statusMessage);
      }
      /**
       * @param {Controller} controller
       * @param {Buffer} chunk
       * @returns {void}
       */
      onResponseData(controller, chunk) {
        if (this.#decompressors.length > 0) {
          this.#decompressors[0].write(chunk);
          return;
        }
        super.onResponseData(controller, chunk);
      }
      /**
       * @param {Controller} controller
       * @param {Record<string, string | string[]> | undefined} trailers
       * @returns {void}
       */
      onResponseEnd(controller, trailers) {
        if (this.#decompressors.length > 0) {
          this.#decompressors[0].end();
          this.#cleanupDecompressors();
          return;
        }
        super.onResponseEnd(controller, trailers);
      }
      /**
       * @param {Controller} controller
       * @param {Error} err
       * @returns {void}
       */
      onResponseError(controller, err) {
        if (this.#decompressors.length > 0) {
          for (const decompressor of this.#decompressors) {
            decompressor.destroy(err);
          }
          this.#cleanupDecompressors();
        }
        super.onResponseError(controller, err);
      }
    };
    function createDecompressInterceptor(options = {}) {
      if (!warningEmitted2) {
        process.emitWarning(
          "DecompressInterceptor is experimental and subject to change",
          "ExperimentalWarning"
        );
        warningEmitted2 = true;
      }
      return (dispatch) => {
        return (opts, handler) => {
          const decompressHandler = new DecompressHandler(handler, options);
          return dispatch(opts, decompressHandler);
        };
      };
    }
    __name(createDecompressInterceptor, "createDecompressInterceptor");
    module2.exports = createDecompressInterceptor;
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/handler/deduplication-handler.js
var require_deduplication_handler = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/handler/deduplication-handler.js"(exports, module2) {
    init_import_meta_url();
    var { RequestAbortedError } = require_errors();
    var DEFAULT_MAX_BUFFER_SIZE = 5 * 1024 * 1024;
    var DeduplicationHandler = class {
      static {
        __name(this, "DeduplicationHandler");
      }
      /**
       * @type {DispatchHandler}
       */
      #primaryHandler;
      /**
       * @type {WaitingHandler[]}
       */
      #waitingHandlers = [];
      /**
       * @type {number}
       */
      #maxBufferSize = DEFAULT_MAX_BUFFER_SIZE;
      /**
       * @type {number}
       */
      #statusCode = 0;
      /**
       * @type {Record<string, string | string[]>}
       */
      #headers = {};
      /**
       * @type {string}
       */
      #statusMessage = "";
      /**
       * @type {boolean}
       */
      #aborted = false;
      /**
       * @type {boolean}
       */
      #responseStarted = false;
      /**
       * @type {boolean}
       */
      #responseDataStarted = false;
      /**
       * @type {boolean}
       */
      #completed = false;
      /**
       * @type {import('../../types/dispatcher.d.ts').default.DispatchController | null}
       */
      #controller = null;
      /**
       * @type {(() => void) | null}
       */
      #onComplete = null;
      /**
       * @param {DispatchHandler} primaryHandler The primary handler
       * @param {() => void} onComplete Callback when request completes
       * @param {number} [maxBufferSize] Maximum paused buffer size per waiting handler
       */
      constructor(primaryHandler, onComplete, maxBufferSize = DEFAULT_MAX_BUFFER_SIZE) {
        this.#primaryHandler = primaryHandler;
        this.#onComplete = onComplete;
        this.#maxBufferSize = maxBufferSize;
      }
      /**
       * Add a waiting handler that will receive response events.
       * Returns false if deduplication can no longer safely attach this handler.
       *
       * @param {DispatchHandler} handler
       * @returns {boolean}
       */
      addWaitingHandler(handler) {
        if (this.#completed || this.#responseDataStarted) {
          return false;
        }
        const waitingHandler = this.#createWaitingHandler(handler);
        const waitingController = waitingHandler.controller;
        try {
          handler.onRequestStart?.(waitingController, null);
          if (waitingController.aborted) {
            waitingHandler.done = true;
            return true;
          }
          if (this.#responseStarted) {
            handler.onResponseStart?.(
              waitingController,
              this.#statusCode,
              this.#headers,
              this.#statusMessage
            );
          }
        } catch {
          waitingHandler.done = true;
          return true;
        }
        if (!waitingController.aborted) {
          this.#waitingHandlers.push(waitingHandler);
        }
        return true;
      }
      /**
       * @param {import('../../types/dispatcher.d.ts').default.DispatchController} controller
       * @param {any} context
       */
      onRequestStart(controller, context2) {
        this.#controller = controller;
        this.#primaryHandler.onRequestStart?.(controller, context2);
      }
      /**
       * @param {import('../../types/dispatcher.d.ts').default.DispatchController} controller
       * @param {number} statusCode
       * @param {import('../../types/header.d.ts').IncomingHttpHeaders} headers
       * @param {Socket} socket
       */
      onRequestUpgrade(controller, statusCode, headers, socket) {
        this.#primaryHandler.onRequestUpgrade?.(controller, statusCode, headers, socket);
      }
      /**
       * @param {import('../../types/dispatcher.d.ts').default.DispatchController} controller
       * @param {number} statusCode
       * @param {Record<string, string | string[]>} headers
       * @param {string} statusMessage
       */
      onResponseStart(controller, statusCode, headers, statusMessage) {
        this.#responseStarted = true;
        this.#statusCode = statusCode;
        this.#headers = headers;
        this.#statusMessage = statusMessage;
        this.#primaryHandler.onResponseStart?.(controller, statusCode, headers, statusMessage);
        for (const waitingHandler of this.#waitingHandlers) {
          const { handler, controller: waitingController } = waitingHandler;
          if (waitingHandler.done || waitingController.aborted) {
            waitingHandler.done = true;
            continue;
          }
          try {
            handler.onResponseStart?.(
              waitingController,
              statusCode,
              headers,
              statusMessage
            );
          } catch {
          }
          if (waitingController.aborted) {
            waitingHandler.done = true;
          }
        }
        this.#pruneDoneWaitingHandlers();
      }
      /**
       * @param {import('../../types/dispatcher.d.ts').default.DispatchController} controller
       * @param {Buffer} chunk
       */
      onResponseData(controller, chunk) {
        if (this.#aborted || this.#completed) {
          return;
        }
        this.#responseDataStarted = true;
        this.#primaryHandler.onResponseData?.(controller, chunk);
        for (const waitingHandler of this.#waitingHandlers) {
          const { handler, controller: waitingController } = waitingHandler;
          if (waitingHandler.done || waitingController.aborted) {
            waitingHandler.done = true;
            continue;
          }
          if (waitingController.paused) {
            this.#bufferWaitingChunk(waitingHandler, chunk);
            continue;
          }
          try {
            handler.onResponseData?.(waitingController, chunk);
          } catch {
          }
          if (waitingController.aborted) {
            waitingHandler.done = true;
            waitingHandler.bufferedChunks = [];
            waitingHandler.bufferedBytes = 0;
          }
        }
        this.#pruneDoneWaitingHandlers();
      }
      /**
       * @param {import('../../types/dispatcher.d.ts').default.DispatchController} controller
       * @param {object} trailers
       */
      onResponseEnd(controller, trailers) {
        if (this.#aborted || this.#completed) {
          return;
        }
        this.#completed = true;
        this.#primaryHandler.onResponseEnd?.(controller, trailers);
        for (const waitingHandler of this.#waitingHandlers) {
          if (waitingHandler.done || waitingHandler.controller.aborted) {
            waitingHandler.done = true;
            continue;
          }
          this.#flushWaitingHandler(waitingHandler);
          if (waitingHandler.done || waitingHandler.controller.aborted) {
            waitingHandler.done = true;
            continue;
          }
          if (waitingHandler.controller.paused && waitingHandler.bufferedChunks.length > 0) {
            waitingHandler.pendingTrailers = trailers;
            continue;
          }
          try {
            waitingHandler.handler.onResponseEnd?.(waitingHandler.controller, trailers);
          } catch {
          }
          waitingHandler.done = true;
        }
        this.#pruneDoneWaitingHandlers();
        this.#onComplete?.();
      }
      /**
       * @param {import('../../types/dispatcher.d.ts').default.DispatchController} controller
       * @param {Error} err
       */
      onResponseError(controller, err) {
        if (this.#completed) {
          return;
        }
        this.#aborted = true;
        this.#completed = true;
        this.#primaryHandler.onResponseError?.(controller, err);
        for (const waitingHandler of this.#waitingHandlers) {
          this.#errorWaitingHandler(waitingHandler, err);
        }
        this.#waitingHandlers = [];
        this.#onComplete?.();
      }
      /**
       * @param {DispatchHandler} handler
       * @returns {WaitingHandler}
       */
      #createWaitingHandler(handler) {
        const waitingHandler = {
          handler,
          controller: null,
          bufferedChunks: [],
          bufferedBytes: 0,
          pendingTrailers: null,
          done: false
        };
        const state2 = {
          aborted: false,
          paused: false,
          reason: null
        };
        waitingHandler.controller = {
          resume: /* @__PURE__ */ __name(() => {
            if (state2.aborted) {
              return;
            }
            state2.paused = false;
            this.#flushWaitingHandler(waitingHandler);
            if (this.#completed && waitingHandler.pendingTrailers && waitingHandler.bufferedChunks.length === 0 && !state2.paused && !state2.aborted) {
              try {
                waitingHandler.handler.onResponseEnd?.(waitingHandler.controller, waitingHandler.pendingTrailers);
              } catch {
              }
              waitingHandler.pendingTrailers = null;
              waitingHandler.done = true;
            }
            this.#pruneDoneWaitingHandlers();
          }, "resume"),
          pause: /* @__PURE__ */ __name(() => {
            if (!state2.aborted) {
              state2.paused = true;
            }
          }, "pause"),
          get paused() {
            return state2.paused;
          },
          get aborted() {
            return state2.aborted;
          },
          get reason() {
            return state2.reason;
          },
          abort: /* @__PURE__ */ __name((reason) => {
            state2.aborted = true;
            state2.reason = reason ?? null;
            waitingHandler.done = true;
            waitingHandler.pendingTrailers = null;
            waitingHandler.bufferedChunks = [];
            waitingHandler.bufferedBytes = 0;
          }, "abort")
        };
        return waitingHandler;
      }
      /**
       * @param {WaitingHandler} waitingHandler
       * @param {Buffer} chunk
       */
      #bufferWaitingChunk(waitingHandler, chunk) {
        if (waitingHandler.done || waitingHandler.controller.aborted) {
          waitingHandler.done = true;
          waitingHandler.bufferedChunks = [];
          waitingHandler.bufferedBytes = 0;
          return;
        }
        const bufferedChunk = Buffer.from(chunk);
        waitingHandler.bufferedChunks.push(bufferedChunk);
        waitingHandler.bufferedBytes += bufferedChunk.length;
        if (waitingHandler.bufferedBytes > this.#maxBufferSize) {
          const err = new RequestAbortedError(`Deduplicated waiting handler exceeded maxBufferSize (${this.#maxBufferSize} bytes) while paused`);
          this.#errorWaitingHandler(waitingHandler, err);
        }
      }
      /**
       * @param {WaitingHandler} waitingHandler
       */
      #flushWaitingHandler(waitingHandler) {
        const { handler, controller } = waitingHandler;
        while (!waitingHandler.done && !controller.aborted && !controller.paused && waitingHandler.bufferedChunks.length > 0) {
          const bufferedChunk = waitingHandler.bufferedChunks.shift();
          waitingHandler.bufferedBytes -= bufferedChunk.length;
          try {
            handler.onResponseData?.(controller, bufferedChunk);
          } catch {
          }
          if (controller.aborted) {
            waitingHandler.done = true;
            waitingHandler.pendingTrailers = null;
            waitingHandler.bufferedChunks = [];
            waitingHandler.bufferedBytes = 0;
            break;
          }
        }
      }
      /**
       * @param {WaitingHandler} waitingHandler
       * @param {Error} err
       */
      #errorWaitingHandler(waitingHandler, err) {
        if (waitingHandler.done) {
          return;
        }
        waitingHandler.done = true;
        waitingHandler.pendingTrailers = null;
        waitingHandler.bufferedChunks = [];
        waitingHandler.bufferedBytes = 0;
        try {
          waitingHandler.controller.abort(err);
          waitingHandler.handler.onResponseError?.(waitingHandler.controller, err);
        } catch {
        }
      }
      #pruneDoneWaitingHandlers() {
        this.#waitingHandlers = this.#waitingHandlers.filter((waitingHandler) => waitingHandler.done === false);
      }
    };
    module2.exports = DeduplicationHandler;
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/interceptor/deduplicate.js
var require_deduplicate = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/interceptor/deduplicate.js"(exports, module2) {
    init_import_meta_url();
    var diagnosticsChannel = __require("diagnostics_channel");
    var util5 = require_util();
    var DeduplicationHandler = require_deduplication_handler();
    var { normalizeHeaders, makeCacheKey, makeDeduplicationKey } = require_cache();
    var pendingRequestsChannel = diagnosticsChannel.channel("undici:request:pending-requests");
    module2.exports = (opts = {}) => {
      const {
        methods = ["GET"],
        skipHeaderNames = [],
        excludeHeaderNames = [],
        maxBufferSize = 5 * 1024 * 1024
      } = opts;
      if (typeof opts !== "object" || opts === null) {
        throw new TypeError(`expected type of opts to be an Object, got ${opts === null ? "null" : typeof opts}`);
      }
      if (!Array.isArray(methods)) {
        throw new TypeError(`expected opts.methods to be an array, got ${typeof methods}`);
      }
      for (const method of methods) {
        if (!util5.safeHTTPMethods.includes(method)) {
          throw new TypeError(`expected opts.methods to only contain safe HTTP methods, got ${method}`);
        }
      }
      if (!Array.isArray(skipHeaderNames)) {
        throw new TypeError(`expected opts.skipHeaderNames to be an array, got ${typeof skipHeaderNames}`);
      }
      if (!Array.isArray(excludeHeaderNames)) {
        throw new TypeError(`expected opts.excludeHeaderNames to be an array, got ${typeof excludeHeaderNames}`);
      }
      if (!Number.isFinite(maxBufferSize) || maxBufferSize <= 0) {
        throw new TypeError(`expected opts.maxBufferSize to be a positive finite number, got ${maxBufferSize}`);
      }
      const skipHeaderNamesSet = new Set(skipHeaderNames.map((name2) => name2.toLowerCase()));
      const excludeHeaderNamesSet = new Set(excludeHeaderNames.map((name2) => name2.toLowerCase()));
      const pendingRequests2 = /* @__PURE__ */ new Map();
      return (dispatch) => {
        return (opts2, handler) => {
          if (!opts2.origin || methods.includes(opts2.method) === false) {
            return dispatch(opts2, handler);
          }
          opts2 = {
            ...opts2,
            headers: normalizeHeaders(opts2)
          };
          if (skipHeaderNamesSet.size > 0) {
            for (const headerName of Object.keys(opts2.headers)) {
              if (skipHeaderNamesSet.has(headerName.toLowerCase())) {
                return dispatch(opts2, handler);
              }
            }
          }
          const cacheKey = makeCacheKey(opts2);
          const dedupeKey = makeDeduplicationKey(cacheKey, excludeHeaderNamesSet);
          const pendingHandler = pendingRequests2.get(dedupeKey);
          if (pendingHandler) {
            if (pendingHandler.addWaitingHandler(handler)) {
              return true;
            }
            return dispatch(opts2, handler);
          }
          const deduplicationHandler = new DeduplicationHandler(
            handler,
            () => {
              pendingRequests2.delete(dedupeKey);
              if (pendingRequestsChannel.hasSubscribers) {
                pendingRequestsChannel.publish({ size: pendingRequests2.size, key: dedupeKey, type: "removed" });
              }
            },
            maxBufferSize
          );
          pendingRequests2.set(dedupeKey, deduplicationHandler);
          if (pendingRequestsChannel.hasSubscribers) {
            pendingRequestsChannel.publish({ size: pendingRequests2.size, key: dedupeKey, type: "added" });
          }
          return dispatch(opts2, deduplicationHandler);
        };
      };
    };
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/cache/sqlite-cache-store.js
var require_sqlite_cache_store = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/cache/sqlite-cache-store.js"(exports, module2) {
    init_import_meta_url();
    var { Writable: Writable5 } = __require("stream");
    var { assertCacheKey, assertCacheValue } = require_cache();
    var DatabaseSync;
    var VERSION2 = 3;
    var MAX_ENTRY_SIZE = 2 * 1e3 * 1e3 * 1e3;
    module2.exports = class SqliteCacheStore {
      static {
        __name(this, "SqliteCacheStore");
      }
      #maxEntrySize = MAX_ENTRY_SIZE;
      #maxCount = Infinity;
      /**
       * @type {import('node:sqlite').DatabaseSync}
       */
      #db;
      /**
       * @type {import('node:sqlite').StatementSync}
       */
      #getValuesQuery;
      /**
       * @type {import('node:sqlite').StatementSync}
       */
      #updateValueQuery;
      /**
       * @type {import('node:sqlite').StatementSync}
       */
      #insertValueQuery;
      /**
       * @type {import('node:sqlite').StatementSync}
       */
      #deleteExpiredValuesQuery;
      /**
       * @type {import('node:sqlite').StatementSync}
       */
      #deleteByUrlQuery;
      /**
       * @type {import('node:sqlite').StatementSync}
       */
      #countEntriesQuery;
      /**
       * @type {import('node:sqlite').StatementSync | null}
       */
      #deleteOldValuesQuery;
      /**
       * @param {import('../../types/cache-interceptor.d.ts').default.SqliteCacheStoreOpts | undefined} opts
       */
      constructor(opts) {
        if (opts) {
          if (typeof opts !== "object") {
            throw new TypeError("SqliteCacheStore options must be an object");
          }
          if (opts.maxEntrySize !== void 0) {
            if (typeof opts.maxEntrySize !== "number" || !Number.isInteger(opts.maxEntrySize) || opts.maxEntrySize < 0) {
              throw new TypeError("SqliteCacheStore options.maxEntrySize must be a non-negative integer");
            }
            if (opts.maxEntrySize > MAX_ENTRY_SIZE) {
              throw new TypeError("SqliteCacheStore options.maxEntrySize must be less than 2gb");
            }
            this.#maxEntrySize = opts.maxEntrySize;
          }
          if (opts.maxCount !== void 0) {
            if (typeof opts.maxCount !== "number" || !Number.isInteger(opts.maxCount) || opts.maxCount < 0) {
              throw new TypeError("SqliteCacheStore options.maxCount must be a non-negative integer");
            }
            this.#maxCount = opts.maxCount;
          }
        }
        if (!DatabaseSync) {
          DatabaseSync = __require("sqlite").DatabaseSync;
        }
        this.#db = new DatabaseSync(opts?.location ?? ":memory:");
        this.#db.exec(`
      PRAGMA journal_mode = WAL;
      PRAGMA synchronous = NORMAL;
      PRAGMA temp_store = memory;
      PRAGMA optimize;

      CREATE TABLE IF NOT EXISTS cacheInterceptorV${VERSION2} (
        -- Data specific to us
        id INTEGER PRIMARY KEY AUTOINCREMENT,
        url TEXT NOT NULL,
        method TEXT NOT NULL,

        -- Data returned to the interceptor
        body BUF NULL,
        deleteAt INTEGER NOT NULL,
        statusCode INTEGER NOT NULL,
        statusMessage TEXT NOT NULL,
        headers TEXT NULL,
        cacheControlDirectives TEXT NULL,
        etag TEXT NULL,
        vary TEXT NULL,
        cachedAt INTEGER NOT NULL,
        staleAt INTEGER NOT NULL
      );

      CREATE INDEX IF NOT EXISTS idx_cacheInterceptorV${VERSION2}_getValuesQuery ON cacheInterceptorV${VERSION2}(url, method, deleteAt);
      CREATE INDEX IF NOT EXISTS idx_cacheInterceptorV${VERSION2}_deleteByUrlQuery ON cacheInterceptorV${VERSION2}(deleteAt);
    `);
        this.#getValuesQuery = this.#db.prepare(`
      SELECT
        id,
        body,
        deleteAt,
        statusCode,
        statusMessage,
        headers,
        etag,
        cacheControlDirectives,
        vary,
        cachedAt,
        staleAt
      FROM cacheInterceptorV${VERSION2}
      WHERE
        url = ?
        AND method = ?
      ORDER BY
        deleteAt ASC
    `);
        this.#updateValueQuery = this.#db.prepare(`
      UPDATE cacheInterceptorV${VERSION2} SET
        body = ?,
        deleteAt = ?,
        statusCode = ?,
        statusMessage = ?,
        headers = ?,
        etag = ?,
        cacheControlDirectives = ?,
        cachedAt = ?,
        staleAt = ?
      WHERE
        id = ?
    `);
        this.#insertValueQuery = this.#db.prepare(`
      INSERT INTO cacheInterceptorV${VERSION2} (
        url,
        method,
        body,
        deleteAt,
        statusCode,
        statusMessage,
        headers,
        etag,
        cacheControlDirectives,
        vary,
        cachedAt,
        staleAt
      ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
    `);
        this.#deleteByUrlQuery = this.#db.prepare(
          `DELETE FROM cacheInterceptorV${VERSION2} WHERE url = ?`
        );
        this.#countEntriesQuery = this.#db.prepare(
          `SELECT COUNT(*) AS total FROM cacheInterceptorV${VERSION2}`
        );
        this.#deleteExpiredValuesQuery = this.#db.prepare(
          `DELETE FROM cacheInterceptorV${VERSION2} WHERE deleteAt <= ?`
        );
        this.#deleteOldValuesQuery = this.#maxCount === Infinity ? null : this.#db.prepare(`
        DELETE FROM cacheInterceptorV${VERSION2}
        WHERE id IN (
          SELECT
            id
          FROM cacheInterceptorV${VERSION2}
          ORDER BY cachedAt DESC
          LIMIT ?
        )
      `);
      }
      close() {
        this.#db.close();
      }
      /**
       * @param {import('../../types/cache-interceptor.d.ts').default.CacheKey} key
       * @returns {(import('../../types/cache-interceptor.d.ts').default.GetResult & { body?: Buffer }) | undefined}
       */
      get(key) {
        assertCacheKey(key);
        const value = this.#findValue(key);
        return value ? {
          body: value.body ? Buffer.from(value.body.buffer, value.body.byteOffset, value.body.byteLength) : void 0,
          statusCode: value.statusCode,
          statusMessage: value.statusMessage,
          headers: value.headers ? JSON.parse(value.headers) : void 0,
          etag: value.etag ? value.etag : void 0,
          vary: value.vary ? JSON.parse(value.vary) : void 0,
          cacheControlDirectives: value.cacheControlDirectives ? JSON.parse(value.cacheControlDirectives) : void 0,
          cachedAt: value.cachedAt,
          staleAt: value.staleAt,
          deleteAt: value.deleteAt
        } : void 0;
      }
      /**
       * @param {import('../../types/cache-interceptor.d.ts').default.CacheKey} key
       * @param {import('../../types/cache-interceptor.d.ts').default.CacheValue & { body: null | Buffer | Array<Buffer>}} value
       */
      set(key, value) {
        assertCacheKey(key);
        const url4 = this.#makeValueUrl(key);
        const body = Array.isArray(value.body) ? Buffer.concat(value.body) : value.body;
        const size = body?.byteLength;
        if (size && size > this.#maxEntrySize) {
          return;
        }
        const existingValue = this.#findValue(key, true);
        if (existingValue) {
          this.#updateValueQuery.run(
            body,
            value.deleteAt,
            value.statusCode,
            value.statusMessage,
            value.headers ? JSON.stringify(value.headers) : null,
            value.etag ? value.etag : null,
            value.cacheControlDirectives ? JSON.stringify(value.cacheControlDirectives) : null,
            value.cachedAt,
            value.staleAt,
            existingValue.id
          );
        } else {
          this.#prune();
          this.#insertValueQuery.run(
            url4,
            key.method,
            body,
            value.deleteAt,
            value.statusCode,
            value.statusMessage,
            value.headers ? JSON.stringify(value.headers) : null,
            value.etag ? value.etag : null,
            value.cacheControlDirectives ? JSON.stringify(value.cacheControlDirectives) : null,
            value.vary ? JSON.stringify(value.vary) : null,
            value.cachedAt,
            value.staleAt
          );
        }
      }
      /**
       * @param {import('../../types/cache-interceptor.d.ts').default.CacheKey} key
       * @param {import('../../types/cache-interceptor.d.ts').default.CacheValue} value
       * @returns {Writable | undefined}
       */
      createWriteStream(key, value) {
        assertCacheKey(key);
        assertCacheValue(value);
        let size = 0;
        const body = [];
        const store = this;
        return new Writable5({
          decodeStrings: true,
          write(chunk, encoding, callback) {
            size += chunk.byteLength;
            if (size < store.#maxEntrySize) {
              body.push(chunk);
            } else {
              this.destroy();
            }
            callback();
          },
          final(callback) {
            store.set(key, { ...value, body });
            callback();
          }
        });
      }
      /**
       * @param {import('../../types/cache-interceptor.d.ts').default.CacheKey} key
       */
      delete(key) {
        if (typeof key !== "object") {
          throw new TypeError(`expected key to be object, got ${typeof key}`);
        }
        this.#deleteByUrlQuery.run(this.#makeValueUrl(key));
      }
      #prune() {
        if (Number.isFinite(this.#maxCount) && this.size <= this.#maxCount) {
          return 0;
        }
        {
          const removed = this.#deleteExpiredValuesQuery.run(Date.now()).changes;
          if (removed) {
            return removed;
          }
        }
        {
          const removed = this.#deleteOldValuesQuery?.run(Math.max(Math.floor(this.#maxCount * 0.1), 1)).changes;
          if (removed) {
            return removed;
          }
        }
        return 0;
      }
      /**
       * Counts the number of rows in the cache
       * @returns {Number}
       */
      get size() {
        const { total } = this.#countEntriesQuery.get();
        return total;
      }
      /**
       * @param {import('../../types/cache-interceptor.d.ts').default.CacheKey} key
       * @returns {string}
       */
      #makeValueUrl(key) {
        return `${key.origin}/${key.path}`;
      }
      /**
       * @param {import('../../types/cache-interceptor.d.ts').default.CacheKey} key
       * @param {boolean} [canBeExpired=false]
       * @returns {SqliteStoreValue | undefined}
       */
      #findValue(key, canBeExpired = false) {
        const url4 = this.#makeValueUrl(key);
        const { headers, method } = key;
        const values = this.#getValuesQuery.all(url4, method);
        if (values.length === 0) {
          return void 0;
        }
        const now = Date.now();
        for (const value of values) {
          if (now >= value.deleteAt && !canBeExpired) {
            return void 0;
          }
          let matches = true;
          if (value.vary) {
            const vary = JSON.parse(value.vary);
            for (const header in vary) {
              if (!headerValueEquals(headers[header], vary[header])) {
                matches = false;
                break;
              }
            }
          }
          if (matches) {
            return value;
          }
        }
        return void 0;
      }
    };
    function headerValueEquals(lhs, rhs) {
      if (lhs == null && rhs == null) {
        return true;
      }
      if (lhs == null && rhs != null || lhs != null && rhs == null) {
        return false;
      }
      if (Array.isArray(lhs) && Array.isArray(rhs)) {
        if (lhs.length !== rhs.length) {
          return false;
        }
        return lhs.every((x7, i7) => x7 === rhs[i7]);
      }
      return lhs === rhs;
    }
    __name(headerValueEquals, "headerValueEquals");
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/web/fetch/headers.js
var require_headers = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/web/fetch/headers.js"(exports, module2) {
    init_import_meta_url();
    var { kConstruct } = require_symbols();
    var { kEnumerableProperty } = require_util();
    var {
      iteratorMixin,
      isValidHeaderName,
      isValidHeaderValue
    } = require_util2();
    var { webidl } = require_webidl();
    var assert61 = __require("assert");
    var util5 = __require("util");
    function isHTTPWhiteSpaceCharCode(code) {
      return code === 10 || code === 13 || code === 9 || code === 32;
    }
    __name(isHTTPWhiteSpaceCharCode, "isHTTPWhiteSpaceCharCode");
    function headerValueNormalize(potentialValue) {
      let i7 = 0;
      let j7 = potentialValue.length;
      while (j7 > i7 && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(j7 - 1))) --j7;
      while (j7 > i7 && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(i7))) ++i7;
      return i7 === 0 && j7 === potentialValue.length ? potentialValue : potentialValue.substring(i7, j7);
    }
    __name(headerValueNormalize, "headerValueNormalize");
    function fill2(headers, object) {
      if (Array.isArray(object)) {
        for (let i7 = 0; i7 < object.length; ++i7) {
          const header = object[i7];
          if (header.length !== 2) {
            throw webidl.errors.exception({
              header: "Headers constructor",
              message: `expected name/value pair to be length 2, found ${header.length}.`
            });
          }
          appendHeader(headers, header[0], header[1]);
        }
      } else if (typeof object === "object" && object !== null) {
        const keys = Object.keys(object);
        for (let i7 = 0; i7 < keys.length; ++i7) {
          appendHeader(headers, keys[i7], object[keys[i7]]);
        }
      } else {
        throw webidl.errors.conversionFailed({
          prefix: "Headers constructor",
          argument: "Argument 1",
          types: ["sequence<sequence<ByteString>>", "record<ByteString, ByteString>"]
        });
      }
    }
    __name(fill2, "fill");
    function appendHeader(headers, name2, value) {
      value = headerValueNormalize(value);
      if (!isValidHeaderName(name2)) {
        throw webidl.errors.invalidArgument({
          prefix: "Headers.append",
          value: name2,
          type: "header name"
        });
      } else if (!isValidHeaderValue(value)) {
        throw webidl.errors.invalidArgument({
          prefix: "Headers.append",
          value,
          type: "header value"
        });
      }
      if (getHeadersGuard(headers) === "immutable") {
        throw new TypeError("immutable");
      }
      return getHeadersList(headers).append(name2, value, false);
    }
    __name(appendHeader, "appendHeader");
    function headersListSortAndCombine(target) {
      const headersList = getHeadersList(target);
      if (!headersList) {
        return [];
      }
      if (headersList.sortedMap) {
        return headersList.sortedMap;
      }
      const headers = [];
      const names = headersList.toSortedArray();
      const cookies = headersList.cookies;
      if (cookies === null || cookies.length === 1) {
        return headersList.sortedMap = names;
      }
      for (let i7 = 0; i7 < names.length; ++i7) {
        const { 0: name2, 1: value } = names[i7];
        if (name2 === "set-cookie") {
          for (let j7 = 0; j7 < cookies.length; ++j7) {
            headers.push([name2, cookies[j7]]);
          }
        } else {
          headers.push([name2, value]);
        }
      }
      return headersList.sortedMap = headers;
    }
    __name(headersListSortAndCombine, "headersListSortAndCombine");
    function compareHeaderName(a7, b11) {
      return a7[0] < b11[0] ? -1 : 1;
    }
    __name(compareHeaderName, "compareHeaderName");
    var HeadersList = class _HeadersList {
      static {
        __name(this, "HeadersList");
      }
      /** @type {[string, string][]|null} */
      cookies = null;
      sortedMap;
      headersMap;
      constructor(init4) {
        if (init4 instanceof _HeadersList) {
          this.headersMap = new Map(init4.headersMap);
          this.sortedMap = init4.sortedMap;
          this.cookies = init4.cookies === null ? null : [...init4.cookies];
        } else {
          this.headersMap = new Map(init4);
          this.sortedMap = null;
        }
      }
      /**
       * @see https://fetch.spec.whatwg.org/#header-list-contains
       * @param {string} name
       * @param {boolean} isLowerCase
       */
      contains(name2, isLowerCase) {
        return this.headersMap.has(isLowerCase ? name2 : name2.toLowerCase());
      }
      clear() {
        this.headersMap.clear();
        this.sortedMap = null;
        this.cookies = null;
      }
      /**
       * @see https://fetch.spec.whatwg.org/#concept-header-list-append
       * @param {string} name
       * @param {string} value
       * @param {boolean} isLowerCase
       */
      append(name2, value, isLowerCase) {
        this.sortedMap = null;
        const lowercaseName = isLowerCase ? name2 : name2.toLowerCase();
        const exists = this.headersMap.get(lowercaseName);
        if (exists) {
          const delimiter = lowercaseName === "cookie" ? "; " : ", ";
          this.headersMap.set(lowercaseName, {
            name: exists.name,
            value: `${exists.value}${delimiter}${value}`
          });
        } else {
          this.headersMap.set(lowercaseName, { name: name2, value });
        }
        if (lowercaseName === "set-cookie") {
          (this.cookies ??= []).push(value);
        }
      }
      /**
       * @see https://fetch.spec.whatwg.org/#concept-header-list-set
       * @param {string} name
       * @param {string} value
       * @param {boolean} isLowerCase
       */
      set(name2, value, isLowerCase) {
        this.sortedMap = null;
        const lowercaseName = isLowerCase ? name2 : name2.toLowerCase();
        if (lowercaseName === "set-cookie") {
          this.cookies = [value];
        }
        this.headersMap.set(lowercaseName, { name: name2, value });
      }
      /**
       * @see https://fetch.spec.whatwg.org/#concept-header-list-delete
       * @param {string} name
       * @param {boolean} isLowerCase
       */
      delete(name2, isLowerCase) {
        this.sortedMap = null;
        if (!isLowerCase) name2 = name2.toLowerCase();
        if (name2 === "set-cookie") {
          this.cookies = null;
        }
        this.headersMap.delete(name2);
      }
      /**
       * @see https://fetch.spec.whatwg.org/#concept-header-list-get
       * @param {string} name
       * @param {boolean} isLowerCase
       * @returns {string | null}
       */
      get(name2, isLowerCase) {
        return this.headersMap.get(isLowerCase ? name2 : name2.toLowerCase())?.value ?? null;
      }
      *[Symbol.iterator]() {
        for (const { 0: name2, 1: { value } } of this.headersMap) {
          yield [name2, value];
        }
      }
      get entries() {
        const headers = {};
        if (this.headersMap.size !== 0) {
          for (const { name: name2, value } of this.headersMap.values()) {
            headers[name2] = value;
          }
        }
        return headers;
      }
      rawValues() {
        return this.headersMap.values();
      }
      get entriesList() {
        const headers = [];
        if (this.headersMap.size !== 0) {
          for (const { 0: lowerName, 1: { name: name2, value } } of this.headersMap) {
            if (lowerName === "set-cookie") {
              for (const cookie of this.cookies) {
                headers.push([name2, cookie]);
              }
            } else {
              headers.push([name2, value]);
            }
          }
        }
        return headers;
      }
      // https://fetch.spec.whatwg.org/#convert-header-names-to-a-sorted-lowercase-set
      toSortedArray() {
        const size = this.headersMap.size;
        const array = new Array(size);
        if (size <= 32) {
          if (size === 0) {
            return array;
          }
          const iterator = this.headersMap[Symbol.iterator]();
          const firstValue = iterator.next().value;
          array[0] = [firstValue[0], firstValue[1].value];
          assert61(firstValue[1].value !== null);
          for (let i7 = 1, j7 = 0, right2 = 0, left2 = 0, pivot = 0, x7, value; i7 < size; ++i7) {
            value = iterator.next().value;
            x7 = array[i7] = [value[0], value[1].value];
            assert61(x7[1] !== null);
            left2 = 0;
            right2 = i7;
            while (left2 < right2) {
              pivot = left2 + (right2 - left2 >> 1);
              if (array[pivot][0] <= x7[0]) {
                left2 = pivot + 1;
              } else {
                right2 = pivot;
              }
            }
            if (i7 !== pivot) {
              j7 = i7;
              while (j7 > left2) {
                array[j7] = array[--j7];
              }
              array[left2] = x7;
            }
          }
          if (!iterator.next().done) {
            throw new TypeError("Unreachable");
          }
          return array;
        } else {
          let i7 = 0;
          for (const { 0: name2, 1: { value } } of this.headersMap) {
            array[i7++] = [name2, value];
            assert61(value !== null);
          }
          return array.sort(compareHeaderName);
        }
      }
    };
    var Headers5 = class _Headers {
      static {
        __name(this, "Headers");
      }
      #guard;
      /**
       * @type {HeadersList}
       */
      #headersList;
      /**
       * @param {HeadersInit|Symbol} [init]
       * @returns
       */
      constructor(init4 = void 0) {
        webidl.util.markAsUncloneable(this);
        if (init4 === kConstruct) {
          return;
        }
        this.#headersList = new HeadersList();
        this.#guard = "none";
        if (init4 !== void 0) {
          init4 = webidl.converters.HeadersInit(init4, "Headers constructor", "init");
          fill2(this, init4);
        }
      }
      // https://fetch.spec.whatwg.org/#dom-headers-append
      append(name2, value) {
        webidl.brandCheck(this, _Headers);
        webidl.argumentLengthCheck(arguments, 2, "Headers.append");
        const prefix = "Headers.append";
        name2 = webidl.converters.ByteString(name2, prefix, "name");
        value = webidl.converters.ByteString(value, prefix, "value");
        return appendHeader(this, name2, value);
      }
      // https://fetch.spec.whatwg.org/#dom-headers-delete
      delete(name2) {
        webidl.brandCheck(this, _Headers);
        webidl.argumentLengthCheck(arguments, 1, "Headers.delete");
        const prefix = "Headers.delete";
        name2 = webidl.converters.ByteString(name2, prefix, "name");
        if (!isValidHeaderName(name2)) {
          throw webidl.errors.invalidArgument({
            prefix: "Headers.delete",
            value: name2,
            type: "header name"
          });
        }
        if (this.#guard === "immutable") {
          throw new TypeError("immutable");
        }
        if (!this.#headersList.contains(name2, false)) {
          return;
        }
        this.#headersList.delete(name2, false);
      }
      // https://fetch.spec.whatwg.org/#dom-headers-get
      get(name2) {
        webidl.brandCheck(this, _Headers);
        webidl.argumentLengthCheck(arguments, 1, "Headers.get");
        const prefix = "Headers.get";
        name2 = webidl.converters.ByteString(name2, prefix, "name");
        if (!isValidHeaderName(name2)) {
          throw webidl.errors.invalidArgument({
            prefix,
            value: name2,
            type: "header name"
          });
        }
        return this.#headersList.get(name2, false);
      }
      // https://fetch.spec.whatwg.org/#dom-headers-has
      has(name2) {
        webidl.brandCheck(this, _Headers);
        webidl.argumentLengthCheck(arguments, 1, "Headers.has");
        const prefix = "Headers.has";
        name2 = webidl.converters.ByteString(name2, prefix, "name");
        if (!isValidHeaderName(name2)) {
          throw webidl.errors.invalidArgument({
            prefix,
            value: name2,
            type: "header name"
          });
        }
        return this.#headersList.contains(name2, false);
      }
      // https://fetch.spec.whatwg.org/#dom-headers-set
      set(name2, value) {
        webidl.brandCheck(this, _Headers);
        webidl.argumentLengthCheck(arguments, 2, "Headers.set");
        const prefix = "Headers.set";
        name2 = webidl.converters.ByteString(name2, prefix, "name");
        value = webidl.converters.ByteString(value, prefix, "value");
        value = headerValueNormalize(value);
        if (!isValidHeaderName(name2)) {
          throw webidl.errors.invalidArgument({
            prefix,
            value: name2,
            type: "header name"
          });
        } else if (!isValidHeaderValue(value)) {
          throw webidl.errors.invalidArgument({
            prefix,
            value,
            type: "header value"
          });
        }
        if (this.#guard === "immutable") {
          throw new TypeError("immutable");
        }
        this.#headersList.set(name2, value, false);
      }
      // https://fetch.spec.whatwg.org/#dom-headers-getsetcookie
      getSetCookie() {
        webidl.brandCheck(this, _Headers);
        const list = this.#headersList.cookies;
        if (list) {
          return [...list];
        }
        return [];
      }
      [util5.inspect.custom](depth, options) {
        options.depth ??= depth;
        return `Headers ${util5.formatWithOptions(options, this.#headersList.entries)}`;
      }
      static getHeadersGuard(o7) {
        return o7.#guard;
      }
      static setHeadersGuard(o7, guard) {
        o7.#guard = guard;
      }
      /**
       * @param {Headers} o
       */
      static getHeadersList(o7) {
        return o7.#headersList;
      }
      /**
       * @param {Headers} target
       * @param {HeadersList} list
       */
      static setHeadersList(target, list) {
        target.#headersList = list;
      }
    };
    var { getHeadersGuard, setHeadersGuard, getHeadersList, setHeadersList } = Headers5;
    Reflect.deleteProperty(Headers5, "getHeadersGuard");
    Reflect.deleteProperty(Headers5, "setHeadersGuard");
    Reflect.deleteProperty(Headers5, "getHeadersList");
    Reflect.deleteProperty(Headers5, "setHeadersList");
    iteratorMixin("Headers", Headers5, headersListSortAndCombine, 0, 1);
    Object.defineProperties(Headers5.prototype, {
      append: kEnumerableProperty,
      delete: kEnumerableProperty,
      get: kEnumerableProperty,
      has: kEnumerableProperty,
      set: kEnumerableProperty,
      getSetCookie: kEnumerableProperty,
      [Symbol.toStringTag]: {
        value: "Headers",
        configurable: true
      },
      [util5.inspect.custom]: {
        enumerable: false
      }
    });
    webidl.converters.HeadersInit = function(V4, prefix, argument) {
      if (webidl.util.Type(V4) === webidl.util.Types.OBJECT) {
        const iterator = Reflect.get(V4, Symbol.iterator);
        if (!util5.types.isProxy(V4) && iterator === Headers5.prototype.entries) {
          try {
            return getHeadersList(V4).entriesList;
          } catch {
          }
        }
        if (typeof iterator === "function") {
          return webidl.converters["sequence<sequence<ByteString>>"](V4, prefix, argument, iterator.bind(V4));
        }
        return webidl.converters["record<ByteString, ByteString>"](V4, prefix, argument);
      }
      throw webidl.errors.conversionFailed({
        prefix: "Headers constructor",
        argument: "Argument 1",
        types: ["sequence<sequence<ByteString>>", "record<ByteString, ByteString>"]
      });
    };
    module2.exports = {
      fill: fill2,
      // for test.
      compareHeaderName,
      Headers: Headers5,
      HeadersList,
      getHeadersGuard,
      setHeadersGuard,
      setHeadersList,
      getHeadersList
    };
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/web/fetch/response.js
var require_response = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/web/fetch/response.js"(exports, module2) {
    init_import_meta_url();
    var { Headers: Headers5, HeadersList, fill: fill2, getHeadersGuard, setHeadersGuard, setHeadersList } = require_headers();
    var { extractBody, cloneBody, mixinBody, streamRegistry, bodyUnusable } = require_body();
    var util5 = require_util();
    var nodeUtil = __require("util");
    var { kEnumerableProperty } = util5;
    var {
      isValidReasonPhrase,
      isCancelled,
      isAborted: isAborted4,
      isErrorLike,
      environmentSettingsObject: relevantRealm
    } = require_util2();
    var {
      redirectStatusSet,
      nullBodyStatus
    } = require_constants3();
    var { webidl } = require_webidl();
    var { URLSerializer } = require_data_url();
    var { kConstruct } = require_symbols();
    var assert61 = __require("assert");
    var { isomorphicEncode, serializeJavascriptValueToJSONString } = require_infra();
    var textEncoder = new TextEncoder("utf-8");
    var Response11 = class _Response {
      static {
        __name(this, "Response");
      }
      /** @type {Headers} */
      #headers;
      #state;
      // Creates network error Response.
      static error() {
        const responseObject = fromInnerResponse(makeNetworkError(), "immutable");
        return responseObject;
      }
      // https://fetch.spec.whatwg.org/#dom-response-json
      static json(data, init4 = void 0) {
        webidl.argumentLengthCheck(arguments, 1, "Response.json");
        if (init4 !== null) {
          init4 = webidl.converters.ResponseInit(init4);
        }
        const bytes = textEncoder.encode(
          serializeJavascriptValueToJSONString(data)
        );
        const body = extractBody(bytes);
        const responseObject = fromInnerResponse(makeResponse({}), "response");
        initializeResponse(responseObject, init4, { body: body[0], type: "application/json" });
        return responseObject;
      }
      // Creates a redirect Response that redirects to url with status status.
      static redirect(url4, status2 = 302) {
        webidl.argumentLengthCheck(arguments, 1, "Response.redirect");
        url4 = webidl.converters.USVString(url4);
        status2 = webidl.converters["unsigned short"](status2);
        let parsedURL;
        try {
          parsedURL = new URL(url4, relevantRealm.settingsObject.baseUrl);
        } catch (err) {
          throw new TypeError(`Failed to parse URL from ${url4}`, { cause: err });
        }
        if (!redirectStatusSet.has(status2)) {
          throw new RangeError(`Invalid status code ${status2}`);
        }
        const responseObject = fromInnerResponse(makeResponse({}), "immutable");
        responseObject.#state.status = status2;
        const value = isomorphicEncode(URLSerializer(parsedURL));
        responseObject.#state.headersList.append("location", value, true);
        return responseObject;
      }
      // https://fetch.spec.whatwg.org/#dom-response
      constructor(body = null, init4 = void 0) {
        webidl.util.markAsUncloneable(this);
        if (body === kConstruct) {
          return;
        }
        if (body !== null) {
          body = webidl.converters.BodyInit(body, "Response", "body");
        }
        init4 = webidl.converters.ResponseInit(init4);
        this.#state = makeResponse({});
        this.#headers = new Headers5(kConstruct);
        setHeadersGuard(this.#headers, "response");
        setHeadersList(this.#headers, this.#state.headersList);
        let bodyWithType = null;
        if (body != null) {
          const [extractedBody, type] = extractBody(body);
          bodyWithType = { body: extractedBody, type };
        }
        initializeResponse(this, init4, bodyWithType);
      }
      // Returns response’s type, e.g., "cors".
      get type() {
        webidl.brandCheck(this, _Response);
        return this.#state.type;
      }
      // Returns response’s URL, if it has one; otherwise the empty string.
      get url() {
        webidl.brandCheck(this, _Response);
        const urlList = this.#state.urlList;
        const url4 = urlList[urlList.length - 1] ?? null;
        if (url4 === null) {
          return "";
        }
        return URLSerializer(url4, true);
      }
      // Returns whether response was obtained through a redirect.
      get redirected() {
        webidl.brandCheck(this, _Response);
        return this.#state.urlList.length > 1;
      }
      // Returns response’s status.
      get status() {
        webidl.brandCheck(this, _Response);
        return this.#state.status;
      }
      // Returns whether response’s status is an ok status.
      get ok() {
        webidl.brandCheck(this, _Response);
        return this.#state.status >= 200 && this.#state.status <= 299;
      }
      // Returns response’s status message.
      get statusText() {
        webidl.brandCheck(this, _Response);
        return this.#state.statusText;
      }
      // Returns response’s headers as Headers.
      get headers() {
        webidl.brandCheck(this, _Response);
        return this.#headers;
      }
      get body() {
        webidl.brandCheck(this, _Response);
        return this.#state.body ? this.#state.body.stream : null;
      }
      get bodyUsed() {
        webidl.brandCheck(this, _Response);
        return !!this.#state.body && util5.isDisturbed(this.#state.body.stream);
      }
      // Returns a clone of response.
      clone() {
        webidl.brandCheck(this, _Response);
        if (bodyUnusable(this.#state)) {
          throw webidl.errors.exception({
            header: "Response.clone",
            message: "Body has already been consumed."
          });
        }
        const clonedResponse = cloneResponse(this.#state);
        if (this.#state.urlList.length !== 0 && this.#state.body?.stream) {
          streamRegistry.register(this, new WeakRef(this.#state.body.stream));
        }
        return fromInnerResponse(clonedResponse, getHeadersGuard(this.#headers));
      }
      [nodeUtil.inspect.custom](depth, options) {
        if (options.depth === null) {
          options.depth = 2;
        }
        options.colors ??= true;
        const properties = {
          status: this.status,
          statusText: this.statusText,
          headers: this.headers,
          body: this.body,
          bodyUsed: this.bodyUsed,
          ok: this.ok,
          redirected: this.redirected,
          type: this.type,
          url: this.url
        };
        return `Response ${nodeUtil.formatWithOptions(options, properties)}`;
      }
      /**
       * @param {Response} response
       */
      static getResponseHeaders(response) {
        return response.#headers;
      }
      /**
       * @param {Response} response
       * @param {Headers} newHeaders
       */
      static setResponseHeaders(response, newHeaders) {
        response.#headers = newHeaders;
      }
      /**
       * @param {Response} response
       */
      static getResponseState(response) {
        return response.#state;
      }
      /**
       * @param {Response} response
       * @param {any} newState
       */
      static setResponseState(response, newState) {
        response.#state = newState;
      }
    };
    var { getResponseHeaders, setResponseHeaders, getResponseState, setResponseState } = Response11;
    Reflect.deleteProperty(Response11, "getResponseHeaders");
    Reflect.deleteProperty(Response11, "setResponseHeaders");
    Reflect.deleteProperty(Response11, "getResponseState");
    Reflect.deleteProperty(Response11, "setResponseState");
    mixinBody(Response11, getResponseState);
    Object.defineProperties(Response11.prototype, {
      type: kEnumerableProperty,
      url: kEnumerableProperty,
      status: kEnumerableProperty,
      ok: kEnumerableProperty,
      redirected: kEnumerableProperty,
      statusText: kEnumerableProperty,
      headers: kEnumerableProperty,
      clone: kEnumerableProperty,
      body: kEnumerableProperty,
      bodyUsed: kEnumerableProperty,
      [Symbol.toStringTag]: {
        value: "Response",
        configurable: true
      }
    });
    Object.defineProperties(Response11, {
      json: kEnumerableProperty,
      redirect: kEnumerableProperty,
      error: kEnumerableProperty
    });
    function cloneResponse(response) {
      if (response.internalResponse) {
        return filterResponse(
          cloneResponse(response.internalResponse),
          response.type
        );
      }
      const newResponse = makeResponse({ ...response, body: null });
      if (response.body != null) {
        newResponse.body = cloneBody(response.body);
      }
      return newResponse;
    }
    __name(cloneResponse, "cloneResponse");
    function makeResponse(init4) {
      return {
        aborted: false,
        rangeRequested: false,
        timingAllowPassed: false,
        requestIncludesCredentials: false,
        type: "default",
        status: 200,
        timingInfo: null,
        cacheState: "",
        statusText: "",
        ...init4,
        headersList: init4?.headersList ? new HeadersList(init4?.headersList) : new HeadersList(),
        urlList: init4?.urlList ? [...init4.urlList] : []
      };
    }
    __name(makeResponse, "makeResponse");
    function makeNetworkError(reason) {
      const isError2 = isErrorLike(reason);
      return makeResponse({
        type: "error",
        status: 0,
        error: isError2 ? reason : new Error(reason ? String(reason) : reason),
        aborted: reason && reason.name === "AbortError"
      });
    }
    __name(makeNetworkError, "makeNetworkError");
    function isNetworkError(response) {
      return (
        // A network error is a response whose type is "error",
        response.type === "error" && // status is 0
        response.status === 0
      );
    }
    __name(isNetworkError, "isNetworkError");
    function makeFilteredResponse(response, state2) {
      state2 = {
        internalResponse: response,
        ...state2
      };
      return new Proxy(response, {
        get(target, p7) {
          return p7 in state2 ? state2[p7] : target[p7];
        },
        set(target, p7, value) {
          assert61(!(p7 in state2));
          target[p7] = value;
          return true;
        }
      });
    }
    __name(makeFilteredResponse, "makeFilteredResponse");
    function filterResponse(response, type) {
      if (type === "basic") {
        return makeFilteredResponse(response, {
          type: "basic",
          headersList: response.headersList
        });
      } else if (type === "cors") {
        return makeFilteredResponse(response, {
          type: "cors",
          headersList: response.headersList
        });
      } else if (type === "opaque") {
        return makeFilteredResponse(response, {
          type: "opaque",
          urlList: [],
          status: 0,
          statusText: "",
          body: null
        });
      } else if (type === "opaqueredirect") {
        return makeFilteredResponse(response, {
          type: "opaqueredirect",
          status: 0,
          statusText: "",
          headersList: [],
          body: null
        });
      } else {
        assert61(false);
      }
    }
    __name(filterResponse, "filterResponse");
    function makeAppropriateNetworkError(fetchParams, err = null) {
      assert61(isCancelled(fetchParams));
      return isAborted4(fetchParams) ? makeNetworkError(Object.assign(new DOMException("The operation was aborted.", "AbortError"), { cause: err })) : makeNetworkError(Object.assign(new DOMException("Request was cancelled."), { cause: err }));
    }
    __name(makeAppropriateNetworkError, "makeAppropriateNetworkError");
    function initializeResponse(response, init4, body) {
      if (init4.status !== null && (init4.status < 200 || init4.status > 599)) {
        throw new RangeError('init["status"] must be in the range of 200 to 599, inclusive.');
      }
      if ("statusText" in init4 && init4.statusText != null) {
        if (!isValidReasonPhrase(String(init4.statusText))) {
          throw new TypeError("Invalid statusText");
        }
      }
      if ("status" in init4 && init4.status != null) {
        getResponseState(response).status = init4.status;
      }
      if ("statusText" in init4 && init4.statusText != null) {
        getResponseState(response).statusText = init4.statusText;
      }
      if ("headers" in init4 && init4.headers != null) {
        fill2(getResponseHeaders(response), init4.headers);
      }
      if (body) {
        if (nullBodyStatus.includes(response.status)) {
          throw webidl.errors.exception({
            header: "Response constructor",
            message: `Invalid response status code ${response.status}`
          });
        }
        getResponseState(response).body = body.body;
        if (body.type != null && !getResponseState(response).headersList.contains("content-type", true)) {
          getResponseState(response).headersList.append("content-type", body.type, true);
        }
      }
    }
    __name(initializeResponse, "initializeResponse");
    function fromInnerResponse(innerResponse, guard) {
      const response = new Response11(kConstruct);
      setResponseState(response, innerResponse);
      const headers = new Headers5(kConstruct);
      setResponseHeaders(response, headers);
      setHeadersList(headers, innerResponse.headersList);
      setHeadersGuard(headers, guard);
      if (innerResponse.urlList.length !== 0 && innerResponse.body?.stream) {
        streamRegistry.register(response, new WeakRef(innerResponse.body.stream));
      }
      return response;
    }
    __name(fromInnerResponse, "fromInnerResponse");
    webidl.converters.XMLHttpRequestBodyInit = function(V4, prefix, name2) {
      if (typeof V4 === "string") {
        return webidl.converters.USVString(V4, prefix, name2);
      }
      if (webidl.is.Blob(V4)) {
        return V4;
      }
      if (webidl.is.BufferSource(V4)) {
        return V4;
      }
      if (webidl.is.FormData(V4)) {
        return V4;
      }
      if (webidl.is.URLSearchParams(V4)) {
        return V4;
      }
      return webidl.converters.DOMString(V4, prefix, name2);
    };
    webidl.converters.BodyInit = function(V4, prefix, argument) {
      if (webidl.is.ReadableStream(V4)) {
        return V4;
      }
      if (V4?.[Symbol.asyncIterator]) {
        return V4;
      }
      return webidl.converters.XMLHttpRequestBodyInit(V4, prefix, argument);
    };
    webidl.converters.ResponseInit = webidl.dictionaryConverter([
      {
        key: "status",
        converter: webidl.converters["unsigned short"],
        defaultValue: /* @__PURE__ */ __name(() => 200, "defaultValue")
      },
      {
        key: "statusText",
        converter: webidl.converters.ByteString,
        defaultValue: /* @__PURE__ */ __name(() => "", "defaultValue")
      },
      {
        key: "headers",
        converter: webidl.converters.HeadersInit
      }
    ]);
    webidl.is.Response = webidl.util.MakeTypeAssertion(Response11);
    module2.exports = {
      isNetworkError,
      makeNetworkError,
      makeResponse,
      makeAppropriateNetworkError,
      filterResponse,
      Response: Response11,
      cloneResponse,
      fromInnerResponse,
      getResponseState
    };
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/web/fetch/request.js
var require_request2 = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/web/fetch/request.js"(exports, module2) {
    init_import_meta_url();
    var { extractBody, mixinBody, cloneBody, bodyUnusable } = require_body();
    var { Headers: Headers5, fill: fillHeaders, HeadersList, setHeadersGuard, getHeadersGuard, setHeadersList, getHeadersList } = require_headers();
    var util5 = require_util();
    var nodeUtil = __require("util");
    var {
      isValidHTTPToken,
      sameOrigin,
      environmentSettingsObject
    } = require_util2();
    var {
      forbiddenMethodsSet,
      corsSafeListedMethodsSet,
      referrerPolicy,
      requestRedirect,
      requestMode,
      requestCredentials,
      requestCache,
      requestDuplex
    } = require_constants3();
    var { kEnumerableProperty, normalizedMethodRecordsBase, normalizedMethodRecords } = util5;
    var { webidl } = require_webidl();
    var { URLSerializer } = require_data_url();
    var { kConstruct } = require_symbols();
    var assert61 = __require("assert");
    var { getMaxListeners, setMaxListeners, defaultMaxListeners } = __require("events");
    var kAbortController = Symbol("abortController");
    var requestFinalizer = new FinalizationRegistry(({ signal, abort }) => {
      signal.removeEventListener("abort", abort);
    });
    var dependentControllerMap = /* @__PURE__ */ new WeakMap();
    var abortSignalHasEventHandlerLeakWarning;
    try {
      abortSignalHasEventHandlerLeakWarning = getMaxListeners(new AbortController().signal) > 0;
    } catch {
      abortSignalHasEventHandlerLeakWarning = false;
    }
    function buildAbort(acRef) {
      return abort;
      function abort() {
        const ac2 = acRef.deref();
        if (ac2 !== void 0) {
          requestFinalizer.unregister(abort);
          this.removeEventListener("abort", abort);
          ac2.abort(this.reason);
          const controllerList = dependentControllerMap.get(ac2.signal);
          if (controllerList !== void 0) {
            if (controllerList.size !== 0) {
              for (const ref of controllerList) {
                const ctrl = ref.deref();
                if (ctrl !== void 0) {
                  ctrl.abort(this.reason);
                }
              }
              controllerList.clear();
            }
            dependentControllerMap.delete(ac2.signal);
          }
        }
      }
    }
    __name(buildAbort, "buildAbort");
    var patchMethodWarning = false;
    var Request7 = class _Request {
      static {
        __name(this, "Request");
      }
      /** @type {AbortSignal} */
      #signal;
      /** @type {import('../../dispatcher/dispatcher')} */
      #dispatcher;
      /** @type {Headers} */
      #headers;
      #state;
      // https://fetch.spec.whatwg.org/#dom-request
      constructor(input, init4 = void 0) {
        webidl.util.markAsUncloneable(this);
        if (input === kConstruct) {
          return;
        }
        const prefix = "Request constructor";
        webidl.argumentLengthCheck(arguments, 1, prefix);
        input = webidl.converters.RequestInfo(input);
        init4 = webidl.converters.RequestInit(init4);
        let request4 = null;
        let fallbackMode = null;
        const baseUrl = environmentSettingsObject.settingsObject.baseUrl;
        let signal = null;
        if (typeof input === "string") {
          this.#dispatcher = init4.dispatcher;
          let parsedURL;
          try {
            parsedURL = new URL(input, baseUrl);
          } catch (err) {
            throw new TypeError("Failed to parse URL from " + input, { cause: err });
          }
          if (parsedURL.username || parsedURL.password) {
            throw new TypeError(
              "Request cannot be constructed from a URL that includes credentials: " + input
            );
          }
          request4 = makeRequest({ urlList: [parsedURL] });
          fallbackMode = "cors";
        } else {
          assert61(webidl.is.Request(input));
          request4 = input.#state;
          signal = input.#signal;
          this.#dispatcher = init4.dispatcher || input.#dispatcher;
        }
        const origin = environmentSettingsObject.settingsObject.origin;
        let window2 = "client";
        if (request4.window?.constructor?.name === "EnvironmentSettingsObject" && sameOrigin(request4.window, origin)) {
          window2 = request4.window;
        }
        if (init4.window != null) {
          throw new TypeError(`'window' option '${window2}' must be null`);
        }
        if ("window" in init4) {
          window2 = "no-window";
        }
        request4 = makeRequest({
          // URL request’s URL.
          // undici implementation note: this is set as the first item in request's urlList in makeRequest
          // method request’s method.
          method: request4.method,
          // header list A copy of request’s header list.
          // undici implementation note: headersList is cloned in makeRequest
          headersList: request4.headersList,
          // unsafe-request flag Set.
          unsafeRequest: request4.unsafeRequest,
          // client This’s relevant settings object.
          client: environmentSettingsObject.settingsObject,
          // window window.
          window: window2,
          // priority request’s priority.
          priority: request4.priority,
          // origin request’s origin. The propagation of the origin is only significant for navigation requests
          // being handled by a service worker. In this scenario a request can have an origin that is different
          // from the current client.
          origin: request4.origin,
          // referrer request’s referrer.
          referrer: request4.referrer,
          // referrer policy request’s referrer policy.
          referrerPolicy: request4.referrerPolicy,
          // mode request’s mode.
          mode: request4.mode,
          // credentials mode request’s credentials mode.
          credentials: request4.credentials,
          // cache mode request’s cache mode.
          cache: request4.cache,
          // redirect mode request’s redirect mode.
          redirect: request4.redirect,
          // integrity metadata request’s integrity metadata.
          integrity: request4.integrity,
          // keepalive request’s keepalive.
          keepalive: request4.keepalive,
          // reload-navigation flag request’s reload-navigation flag.
          reloadNavigation: request4.reloadNavigation,
          // history-navigation flag request’s history-navigation flag.
          historyNavigation: request4.historyNavigation,
          // URL list A clone of request’s URL list.
          urlList: [...request4.urlList]
        });
        const initHasKey = Object.keys(init4).length !== 0;
        if (initHasKey) {
          if (request4.mode === "navigate") {
            request4.mode = "same-origin";
          }
          request4.reloadNavigation = false;
          request4.historyNavigation = false;
          request4.origin = "client";
          request4.referrer = "client";
          request4.referrerPolicy = "";
          request4.url = request4.urlList[request4.urlList.length - 1];
          request4.urlList = [request4.url];
        }
        if (init4.referrer !== void 0) {
          const referrer = init4.referrer;
          if (referrer === "") {
            request4.referrer = "no-referrer";
          } else {
            let parsedReferrer;
            try {
              parsedReferrer = new URL(referrer, baseUrl);
            } catch (err) {
              throw new TypeError(`Referrer "${referrer}" is not a valid URL.`, { cause: err });
            }
            if (parsedReferrer.protocol === "about:" && parsedReferrer.hostname === "client" || origin && !sameOrigin(parsedReferrer, environmentSettingsObject.settingsObject.baseUrl)) {
              request4.referrer = "client";
            } else {
              request4.referrer = parsedReferrer;
            }
          }
        }
        if (init4.referrerPolicy !== void 0) {
          request4.referrerPolicy = init4.referrerPolicy;
        }
        let mode;
        if (init4.mode !== void 0) {
          mode = init4.mode;
        } else {
          mode = fallbackMode;
        }
        if (mode === "navigate") {
          throw webidl.errors.exception({
            header: "Request constructor",
            message: "invalid request mode navigate."
          });
        }
        if (mode != null) {
          request4.mode = mode;
        }
        if (init4.credentials !== void 0) {
          request4.credentials = init4.credentials;
        }
        if (init4.cache !== void 0) {
          request4.cache = init4.cache;
        }
        if (request4.cache === "only-if-cached" && request4.mode !== "same-origin") {
          throw new TypeError(
            "'only-if-cached' can be set only with 'same-origin' mode"
          );
        }
        if (init4.redirect !== void 0) {
          request4.redirect = init4.redirect;
        }
        if (init4.integrity != null) {
          request4.integrity = String(init4.integrity);
        }
        if (init4.keepalive !== void 0) {
          request4.keepalive = Boolean(init4.keepalive);
        }
        if (init4.method !== void 0) {
          let method = init4.method;
          const mayBeNormalized = normalizedMethodRecords[method];
          if (mayBeNormalized !== void 0) {
            request4.method = mayBeNormalized;
          } else {
            if (!isValidHTTPToken(method)) {
              throw new TypeError(`'${method}' is not a valid HTTP method.`);
            }
            const upperCase = method.toUpperCase();
            if (forbiddenMethodsSet.has(upperCase)) {
              throw new TypeError(`'${method}' HTTP method is unsupported.`);
            }
            method = normalizedMethodRecordsBase[upperCase] ?? method;
            request4.method = method;
          }
          if (!patchMethodWarning && request4.method === "patch") {
            process.emitWarning("Using `patch` is highly likely to result in a `405 Method Not Allowed`. `PATCH` is much more likely to succeed.", {
              code: "UNDICI-FETCH-patch"
            });
            patchMethodWarning = true;
          }
        }
        if (init4.signal !== void 0) {
          signal = init4.signal;
        }
        this.#state = request4;
        const ac2 = new AbortController();
        this.#signal = ac2.signal;
        if (signal != null) {
          if (signal.aborted) {
            ac2.abort(signal.reason);
          } else {
            this[kAbortController] = ac2;
            const acRef = new WeakRef(ac2);
            const abort = buildAbort(acRef);
            if (abortSignalHasEventHandlerLeakWarning && getMaxListeners(signal) === defaultMaxListeners) {
              setMaxListeners(1500, signal);
            }
            util5.addAbortListener(signal, abort);
            requestFinalizer.register(ac2, { signal, abort }, abort);
          }
        }
        this.#headers = new Headers5(kConstruct);
        setHeadersList(this.#headers, request4.headersList);
        setHeadersGuard(this.#headers, "request");
        if (mode === "no-cors") {
          if (!corsSafeListedMethodsSet.has(request4.method)) {
            throw new TypeError(
              `'${request4.method} is unsupported in no-cors mode.`
            );
          }
          setHeadersGuard(this.#headers, "request-no-cors");
        }
        if (initHasKey) {
          const headersList = getHeadersList(this.#headers);
          const headers = init4.headers !== void 0 ? init4.headers : new HeadersList(headersList);
          headersList.clear();
          if (headers instanceof HeadersList) {
            for (const { name: name2, value } of headers.rawValues()) {
              headersList.append(name2, value, false);
            }
            headersList.cookies = headers.cookies;
          } else {
            fillHeaders(this.#headers, headers);
          }
        }
        const inputBody = webidl.is.Request(input) ? input.#state.body : null;
        if ((init4.body != null || inputBody != null) && (request4.method === "GET" || request4.method === "HEAD")) {
          throw new TypeError("Request with GET/HEAD method cannot have body.");
        }
        let initBody = null;
        if (init4.body != null) {
          const [extractedBody, contentType] = extractBody(
            init4.body,
            request4.keepalive
          );
          initBody = extractedBody;
          if (contentType && !getHeadersList(this.#headers).contains("content-type", true)) {
            this.#headers.append("content-type", contentType, true);
          }
        }
        const inputOrInitBody = initBody ?? inputBody;
        if (inputOrInitBody != null && inputOrInitBody.source == null) {
          if (initBody != null && init4.duplex == null) {
            throw new TypeError("RequestInit: duplex option is required when sending a body.");
          }
          if (request4.mode !== "same-origin" && request4.mode !== "cors") {
            throw new TypeError(
              'If request is made from ReadableStream, mode should be "same-origin" or "cors"'
            );
          }
          request4.useCORSPreflightFlag = true;
        }
        let finalBody = inputOrInitBody;
        if (initBody == null && inputBody != null) {
          if (bodyUnusable(input.#state)) {
            throw new TypeError(
              "Cannot construct a Request with a Request object that has already been used."
            );
          }
          const identityTransform = new TransformStream();
          inputBody.stream.pipeThrough(identityTransform);
          finalBody = {
            source: inputBody.source,
            length: inputBody.length,
            stream: identityTransform.readable
          };
        }
        this.#state.body = finalBody;
      }
      // Returns request’s HTTP method, which is "GET" by default.
      get method() {
        webidl.brandCheck(this, _Request);
        return this.#state.method;
      }
      // Returns the URL of request as a string.
      get url() {
        webidl.brandCheck(this, _Request);
        return URLSerializer(this.#state.url);
      }
      // Returns a Headers object consisting of the headers associated with request.
      // Note that headers added in the network layer by the user agent will not
      // be accounted for in this object, e.g., the "Host" header.
      get headers() {
        webidl.brandCheck(this, _Request);
        return this.#headers;
      }
      // Returns the kind of resource requested by request, e.g., "document"
      // or "script".
      get destination() {
        webidl.brandCheck(this, _Request);
        return this.#state.destination;
      }
      // Returns the referrer of request. Its value can be a same-origin URL if
      // explicitly set in init, the empty string to indicate no referrer, and
      // "about:client" when defaulting to the global’s default. This is used
      // during fetching to determine the value of the `Referer` header of the
      // request being made.
      get referrer() {
        webidl.brandCheck(this, _Request);
        if (this.#state.referrer === "no-referrer") {
          return "";
        }
        if (this.#state.referrer === "client") {
          return "about:client";
        }
        return this.#state.referrer.toString();
      }
      // Returns the referrer policy associated with request.
      // This is used during fetching to compute the value of the request’s
      // referrer.
      get referrerPolicy() {
        webidl.brandCheck(this, _Request);
        return this.#state.referrerPolicy;
      }
      // Returns the mode associated with request, which is a string indicating
      // whether the request will use CORS, or will be restricted to same-origin
      // URLs.
      get mode() {
        webidl.brandCheck(this, _Request);
        return this.#state.mode;
      }
      // Returns the credentials mode associated with request,
      // which is a string indicating whether credentials will be sent with the
      // request always, never, or only when sent to a same-origin URL.
      get credentials() {
        webidl.brandCheck(this, _Request);
        return this.#state.credentials;
      }
      // Returns the cache mode associated with request,
      // which is a string indicating how the request will
      // interact with the browser’s cache when fetching.
      get cache() {
        webidl.brandCheck(this, _Request);
        return this.#state.cache;
      }
      // Returns the redirect mode associated with request,
      // which is a string indicating how redirects for the
      // request will be handled during fetching. A request
      // will follow redirects by default.
      get redirect() {
        webidl.brandCheck(this, _Request);
        return this.#state.redirect;
      }
      // Returns request’s subresource integrity metadata, which is a
      // cryptographic hash of the resource being fetched. Its value
      // consists of multiple hashes separated by whitespace. [SRI]
      get integrity() {
        webidl.brandCheck(this, _Request);
        return this.#state.integrity;
      }
      // Returns a boolean indicating whether or not request can outlive the
      // global in which it was created.
      get keepalive() {
        webidl.brandCheck(this, _Request);
        return this.#state.keepalive;
      }
      // Returns a boolean indicating whether or not request is for a reload
      // navigation.
      get isReloadNavigation() {
        webidl.brandCheck(this, _Request);
        return this.#state.reloadNavigation;
      }
      // Returns a boolean indicating whether or not request is for a history
      // navigation (a.k.a. back-forward navigation).
      get isHistoryNavigation() {
        webidl.brandCheck(this, _Request);
        return this.#state.historyNavigation;
      }
      // Returns the signal associated with request, which is an AbortSignal
      // object indicating whether or not request has been aborted, and its
      // abort event handler.
      get signal() {
        webidl.brandCheck(this, _Request);
        return this.#signal;
      }
      get body() {
        webidl.brandCheck(this, _Request);
        return this.#state.body ? this.#state.body.stream : null;
      }
      get bodyUsed() {
        webidl.brandCheck(this, _Request);
        return !!this.#state.body && util5.isDisturbed(this.#state.body.stream);
      }
      get duplex() {
        webidl.brandCheck(this, _Request);
        return "half";
      }
      // Returns a clone of request.
      clone() {
        webidl.brandCheck(this, _Request);
        if (bodyUnusable(this.#state)) {
          throw new TypeError("unusable");
        }
        const clonedRequest = cloneRequest(this.#state);
        const ac2 = new AbortController();
        if (this.signal.aborted) {
          ac2.abort(this.signal.reason);
        } else {
          let list = dependentControllerMap.get(this.signal);
          if (list === void 0) {
            list = /* @__PURE__ */ new Set();
            dependentControllerMap.set(this.signal, list);
          }
          const acRef = new WeakRef(ac2);
          list.add(acRef);
          util5.addAbortListener(
            ac2.signal,
            buildAbort(acRef)
          );
        }
        return fromInnerRequest(clonedRequest, this.#dispatcher, ac2.signal, getHeadersGuard(this.#headers));
      }
      [nodeUtil.inspect.custom](depth, options) {
        if (options.depth === null) {
          options.depth = 2;
        }
        options.colors ??= true;
        const properties = {
          method: this.method,
          url: this.url,
          headers: this.headers,
          destination: this.destination,
          referrer: this.referrer,
          referrerPolicy: this.referrerPolicy,
          mode: this.mode,
          credentials: this.credentials,
          cache: this.cache,
          redirect: this.redirect,
          integrity: this.integrity,
          keepalive: this.keepalive,
          isReloadNavigation: this.isReloadNavigation,
          isHistoryNavigation: this.isHistoryNavigation,
          signal: this.signal
        };
        return `Request ${nodeUtil.formatWithOptions(options, properties)}`;
      }
      /**
       * @param {Request} request
       * @param {AbortSignal} newSignal
       */
      static setRequestSignal(request4, newSignal) {
        request4.#signal = newSignal;
        return request4;
      }
      /**
       * @param {Request} request
       */
      static getRequestDispatcher(request4) {
        return request4.#dispatcher;
      }
      /**
       * @param {Request} request
       * @param {import('../../dispatcher/dispatcher')} newDispatcher
       */
      static setRequestDispatcher(request4, newDispatcher) {
        request4.#dispatcher = newDispatcher;
      }
      /**
       * @param {Request} request
       * @param {Headers} newHeaders
       */
      static setRequestHeaders(request4, newHeaders) {
        request4.#headers = newHeaders;
      }
      /**
       * @param {Request} request
       */
      static getRequestState(request4) {
        return request4.#state;
      }
      /**
       * @param {Request} request
       * @param {any} newState
       */
      static setRequestState(request4, newState) {
        request4.#state = newState;
      }
    };
    var { setRequestSignal, getRequestDispatcher, setRequestDispatcher, setRequestHeaders, getRequestState, setRequestState } = Request7;
    Reflect.deleteProperty(Request7, "setRequestSignal");
    Reflect.deleteProperty(Request7, "getRequestDispatcher");
    Reflect.deleteProperty(Request7, "setRequestDispatcher");
    Reflect.deleteProperty(Request7, "setRequestHeaders");
    Reflect.deleteProperty(Request7, "getRequestState");
    Reflect.deleteProperty(Request7, "setRequestState");
    mixinBody(Request7, getRequestState);
    function makeRequest(init4) {
      return {
        method: init4.method ?? "GET",
        localURLsOnly: init4.localURLsOnly ?? false,
        unsafeRequest: init4.unsafeRequest ?? false,
        body: init4.body ?? null,
        client: init4.client ?? null,
        reservedClient: init4.reservedClient ?? null,
        replacesClientId: init4.replacesClientId ?? "",
        window: init4.window ?? "client",
        keepalive: init4.keepalive ?? false,
        serviceWorkers: init4.serviceWorkers ?? "all",
        initiator: init4.initiator ?? "",
        destination: init4.destination ?? "",
        priority: init4.priority ?? null,
        origin: init4.origin ?? "client",
        policyContainer: init4.policyContainer ?? "client",
        referrer: init4.referrer ?? "client",
        referrerPolicy: init4.referrerPolicy ?? "",
        mode: init4.mode ?? "no-cors",
        useCORSPreflightFlag: init4.useCORSPreflightFlag ?? false,
        credentials: init4.credentials ?? "same-origin",
        useCredentials: init4.useCredentials ?? false,
        cache: init4.cache ?? "default",
        redirect: init4.redirect ?? "follow",
        integrity: init4.integrity ?? "",
        cryptoGraphicsNonceMetadata: init4.cryptoGraphicsNonceMetadata ?? "",
        parserMetadata: init4.parserMetadata ?? "",
        reloadNavigation: init4.reloadNavigation ?? false,
        historyNavigation: init4.historyNavigation ?? false,
        userActivation: init4.userActivation ?? false,
        taintedOrigin: init4.taintedOrigin ?? false,
        redirectCount: init4.redirectCount ?? 0,
        responseTainting: init4.responseTainting ?? "basic",
        preventNoCacheCacheControlHeaderModification: init4.preventNoCacheCacheControlHeaderModification ?? false,
        done: init4.done ?? false,
        timingAllowFailed: init4.timingAllowFailed ?? false,
        useURLCredentials: init4.useURLCredentials ?? void 0,
        traversableForUserPrompts: init4.traversableForUserPrompts ?? "client",
        urlList: init4.urlList,
        url: init4.urlList[0],
        headersList: init4.headersList ? new HeadersList(init4.headersList) : new HeadersList()
      };
    }
    __name(makeRequest, "makeRequest");
    function cloneRequest(request4) {
      const newRequest = makeRequest({ ...request4, body: null });
      if (request4.body != null) {
        newRequest.body = cloneBody(request4.body);
      }
      return newRequest;
    }
    __name(cloneRequest, "cloneRequest");
    function fromInnerRequest(innerRequest, dispatcher, signal, guard) {
      const request4 = new Request7(kConstruct);
      setRequestState(request4, innerRequest);
      setRequestDispatcher(request4, dispatcher);
      setRequestSignal(request4, signal);
      const headers = new Headers5(kConstruct);
      setRequestHeaders(request4, headers);
      setHeadersList(headers, innerRequest.headersList);
      setHeadersGuard(headers, guard);
      return request4;
    }
    __name(fromInnerRequest, "fromInnerRequest");
    Object.defineProperties(Request7.prototype, {
      method: kEnumerableProperty,
      url: kEnumerableProperty,
      headers: kEnumerableProperty,
      redirect: kEnumerableProperty,
      clone: kEnumerableProperty,
      signal: kEnumerableProperty,
      duplex: kEnumerableProperty,
      destination: kEnumerableProperty,
      body: kEnumerableProperty,
      bodyUsed: kEnumerableProperty,
      isHistoryNavigation: kEnumerableProperty,
      isReloadNavigation: kEnumerableProperty,
      keepalive: kEnumerableProperty,
      integrity: kEnumerableProperty,
      cache: kEnumerableProperty,
      credentials: kEnumerableProperty,
      attribute: kEnumerableProperty,
      referrerPolicy: kEnumerableProperty,
      referrer: kEnumerableProperty,
      mode: kEnumerableProperty,
      [Symbol.toStringTag]: {
        value: "Request",
        configurable: true
      }
    });
    webidl.is.Request = webidl.util.MakeTypeAssertion(Request7);
    webidl.converters.RequestInfo = function(V4) {
      if (typeof V4 === "string") {
        return webidl.converters.USVString(V4);
      }
      if (webidl.is.Request(V4)) {
        return V4;
      }
      return webidl.converters.USVString(V4);
    };
    webidl.converters.RequestInit = webidl.dictionaryConverter([
      {
        key: "method",
        converter: webidl.converters.ByteString
      },
      {
        key: "headers",
        converter: webidl.converters.HeadersInit
      },
      {
        key: "body",
        converter: webidl.nullableConverter(
          webidl.converters.BodyInit
        )
      },
      {
        key: "referrer",
        converter: webidl.converters.USVString
      },
      {
        key: "referrerPolicy",
        converter: webidl.converters.DOMString,
        // https://w3c.github.io/webappsec-referrer-policy/#referrer-policy
        allowedValues: referrerPolicy
      },
      {
        key: "mode",
        converter: webidl.converters.DOMString,
        // https://fetch.spec.whatwg.org/#concept-request-mode
        allowedValues: requestMode
      },
      {
        key: "credentials",
        converter: webidl.converters.DOMString,
        // https://fetch.spec.whatwg.org/#requestcredentials
        allowedValues: requestCredentials
      },
      {
        key: "cache",
        converter: webidl.converters.DOMString,
        // https://fetch.spec.whatwg.org/#requestcache
        allowedValues: requestCache
      },
      {
        key: "redirect",
        converter: webidl.converters.DOMString,
        // https://fetch.spec.whatwg.org/#requestredirect
        allowedValues: requestRedirect
      },
      {
        key: "integrity",
        converter: webidl.converters.DOMString
      },
      {
        key: "keepalive",
        converter: webidl.converters.boolean
      },
      {
        key: "signal",
        converter: webidl.nullableConverter(
          (signal) => webidl.converters.AbortSignal(
            signal,
            "RequestInit",
            "signal"
          )
        )
      },
      {
        key: "window",
        converter: webidl.converters.any
      },
      {
        key: "duplex",
        converter: webidl.converters.DOMString,
        allowedValues: requestDuplex
      },
      {
        key: "dispatcher",
        // undici specific option
        converter: webidl.converters.any
      },
      {
        key: "priority",
        converter: webidl.converters.DOMString,
        allowedValues: ["high", "low", "auto"],
        defaultValue: /* @__PURE__ */ __name(() => "auto", "defaultValue")
      }
    ]);
    module2.exports = {
      Request: Request7,
      makeRequest,
      fromInnerRequest,
      cloneRequest,
      getRequestDispatcher,
      getRequestState
    };
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/web/subresource-integrity/subresource-integrity.js
var require_subresource_integrity = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/web/subresource-integrity/subresource-integrity.js"(exports, module2) {
    init_import_meta_url();
    var assert61 = __require("assert");
    var { runtimeFeatures } = require_runtime_features();
    var validSRIHashAlgorithmTokenSet = /* @__PURE__ */ new Map([["sha256", 0], ["sha384", 1], ["sha512", 2]]);
    var crypto9;
    if (runtimeFeatures.has("crypto")) {
      crypto9 = __require("crypto");
      const cryptoHashes = crypto9.getHashes();
      if (cryptoHashes.length === 0) {
        validSRIHashAlgorithmTokenSet.clear();
      }
      for (const algorithm of validSRIHashAlgorithmTokenSet.keys()) {
        if (cryptoHashes.includes(algorithm) === false) {
          validSRIHashAlgorithmTokenSet.delete(algorithm);
        }
      }
    } else {
      validSRIHashAlgorithmTokenSet.clear();
    }
    var getSRIHashAlgorithmIndex = (
      /** @type {GetSRIHashAlgorithmIndex} */
      Map.prototype.get.bind(
        validSRIHashAlgorithmTokenSet
      )
    );
    var isValidSRIHashAlgorithm = (
      /** @type {IsValidSRIHashAlgorithm} */
      Map.prototype.has.bind(validSRIHashAlgorithmTokenSet)
    );
    var bytesMatch = runtimeFeatures.has("crypto") === false || validSRIHashAlgorithmTokenSet.size === 0 ? () => true : (bytes, metadataList) => {
      const parsedMetadata = parseMetadata(metadataList);
      if (parsedMetadata.length === 0) {
        return true;
      }
      const metadata = getStrongestMetadata(parsedMetadata);
      for (const item of metadata) {
        const algorithm = item.alg;
        const expectedValue = item.val;
        const actualValue = applyAlgorithmToBytes(algorithm, bytes);
        if (caseSensitiveMatch(actualValue, expectedValue)) {
          return true;
        }
      }
      return false;
    };
    function getStrongestMetadata(metadataList) {
      const result = [];
      let strongest = null;
      for (const item of metadataList) {
        assert61(isValidSRIHashAlgorithm(item.alg), "Invalid SRI hash algorithm token");
        if (result.length === 0) {
          result.push(item);
          strongest = item;
          continue;
        }
        const currentAlgorithm = (
          /** @type {Metadata} */
          strongest.alg
        );
        const currentAlgorithmIndex = getSRIHashAlgorithmIndex(currentAlgorithm);
        const newAlgorithm = item.alg;
        const newAlgorithmIndex = getSRIHashAlgorithmIndex(newAlgorithm);
        if (newAlgorithmIndex < currentAlgorithmIndex) {
          continue;
        } else if (newAlgorithmIndex > currentAlgorithmIndex) {
          strongest = item;
          result[0] = item;
          result.length = 1;
        } else {
          result.push(item);
        }
      }
      return result;
    }
    __name(getStrongestMetadata, "getStrongestMetadata");
    function parseMetadata(metadata) {
      const result = [];
      for (const item of metadata.split(" ")) {
        const expressionAndOptions = item.split("?", 1);
        const algorithmExpression = expressionAndOptions[0];
        let base64Value = "";
        const algorithmAndValue = [algorithmExpression.slice(0, 6), algorithmExpression.slice(7)];
        const algorithm = algorithmAndValue[0];
        if (!isValidSRIHashAlgorithm(algorithm)) {
          continue;
        }
        if (algorithmAndValue[1]) {
          base64Value = algorithmAndValue[1];
        }
        const metadata2 = {
          alg: algorithm,
          val: base64Value
        };
        result.push(metadata2);
      }
      return result;
    }
    __name(parseMetadata, "parseMetadata");
    var applyAlgorithmToBytes = /* @__PURE__ */ __name((algorithm, bytes) => {
      return crypto9.hash(algorithm, bytes, "base64");
    }, "applyAlgorithmToBytes");
    function caseSensitiveMatch(actualValue, expectedValue) {
      let actualValueLength = actualValue.length;
      if (actualValueLength !== 0 && actualValue[actualValueLength - 1] === "=") {
        actualValueLength -= 1;
      }
      if (actualValueLength !== 0 && actualValue[actualValueLength - 1] === "=") {
        actualValueLength -= 1;
      }
      let expectedValueLength = expectedValue.length;
      if (expectedValueLength !== 0 && expectedValue[expectedValueLength - 1] === "=") {
        expectedValueLength -= 1;
      }
      if (expectedValueLength !== 0 && expectedValue[expectedValueLength - 1] === "=") {
        expectedValueLength -= 1;
      }
      if (actualValueLength !== expectedValueLength) {
        return false;
      }
      for (let i7 = 0; i7 < actualValueLength; ++i7) {
        if (actualValue[i7] === expectedValue[i7] || actualValue[i7] === "+" && expectedValue[i7] === "-" || actualValue[i7] === "/" && expectedValue[i7] === "_") {
          continue;
        }
        return false;
      }
      return true;
    }
    __name(caseSensitiveMatch, "caseSensitiveMatch");
    module2.exports = {
      applyAlgorithmToBytes,
      bytesMatch,
      caseSensitiveMatch,
      isValidSRIHashAlgorithm,
      getStrongestMetadata,
      parseMetadata
    };
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/web/fetch/index.js
var require_fetch = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/web/fetch/index.js"(exports, module2) {
    init_import_meta_url();
    var {
      makeNetworkError,
      makeAppropriateNetworkError,
      filterResponse,
      makeResponse,
      fromInnerResponse,
      getResponseState
    } = require_response();
    var { HeadersList } = require_headers();
    var { Request: Request7, cloneRequest, getRequestDispatcher, getRequestState } = require_request2();
    var zlib3 = __require("zlib");
    var {
      makePolicyContainer,
      clonePolicyContainer,
      requestBadPort,
      TAOCheck,
      appendRequestOriginHeader,
      responseLocationURL,
      requestCurrentURL,
      setRequestReferrerPolicyOnRedirect,
      tryUpgradeRequestToAPotentiallyTrustworthyURL,
      createOpaqueTimingInfo,
      appendFetchMetadata,
      corsCheck,
      crossOriginResourcePolicyCheck,
      determineRequestsReferrer,
      coarsenedSharedCurrentTime,
      sameOrigin,
      isCancelled,
      isAborted: isAborted4,
      isErrorLike,
      fullyReadBody,
      readableStreamClose,
      urlIsLocal,
      urlIsHttpHttpsScheme,
      urlHasHttpsScheme,
      clampAndCoarsenConnectionTimingInfo,
      simpleRangeHeaderValue,
      buildContentRange,
      createInflate,
      extractMimeType,
      hasAuthenticationEntry,
      includesCredentials,
      isTraversableNavigable
    } = require_util2();
    var assert61 = __require("assert");
    var { safelyExtractBody, extractBody } = require_body();
    var {
      redirectStatusSet,
      nullBodyStatus,
      safeMethodsSet,
      requestBodyHeader,
      subresourceSet
    } = require_constants3();
    var EE = __require("events");
    var { Readable: Readable11, pipeline, finished, isErrored, isReadable } = __require("stream");
    var { addAbortListener, bufferToLowerCasedHeaderName } = require_util();
    var { dataURLProcessor, serializeAMimeType, minimizeSupportedMimeType } = require_data_url();
    var { getGlobalDispatcher: getGlobalDispatcher2 } = require_global2();
    var { webidl } = require_webidl();
    var { STATUS_CODES: STATUS_CODES2 } = __require("http");
    var { bytesMatch } = require_subresource_integrity();
    var { createDeferredPromise } = require_promise();
    var { isomorphicEncode } = require_infra();
    var { runtimeFeatures } = require_runtime_features();
    var hasZstd = runtimeFeatures.has("zstd");
    var GET_OR_HEAD = ["GET", "HEAD"];
    var defaultUserAgent = typeof __UNDICI_IS_NODE__ !== "undefined" || typeof esbuildDetection !== "undefined" ? "node" : "undici";
    var resolveObjectURL;
    var Fetch = class extends EE {
      static {
        __name(this, "Fetch");
      }
      constructor(dispatcher) {
        super();
        this.dispatcher = dispatcher;
        this.connection = null;
        this.dump = false;
        this.state = "ongoing";
      }
      terminate(reason) {
        if (this.state !== "ongoing") {
          return;
        }
        this.state = "terminated";
        this.connection?.destroy(reason);
        this.emit("terminated", reason);
      }
      // https://fetch.spec.whatwg.org/#fetch-controller-abort
      abort(error2) {
        if (this.state !== "ongoing") {
          return;
        }
        this.state = "aborted";
        if (!error2) {
          error2 = new DOMException("The operation was aborted.", "AbortError");
        }
        this.serializedAbortReason = error2;
        this.connection?.destroy(error2);
        this.emit("terminated", error2);
      }
    };
    function handleFetchDone(response) {
      finalizeAndReportTiming(response, "fetch");
    }
    __name(handleFetchDone, "handleFetchDone");
    function fetch20(input, init4 = void 0) {
      webidl.argumentLengthCheck(arguments, 1, "globalThis.fetch");
      let p7 = createDeferredPromise();
      let requestObject;
      try {
        requestObject = new Request7(input, init4);
      } catch (e10) {
        p7.reject(e10);
        return p7.promise;
      }
      const request4 = getRequestState(requestObject);
      if (requestObject.signal.aborted) {
        abortFetch(p7, request4, null, requestObject.signal.reason, null);
        return p7.promise;
      }
      const globalObject = request4.client.globalObject;
      if (globalObject?.constructor?.name === "ServiceWorkerGlobalScope") {
        request4.serviceWorkers = "none";
      }
      let responseObject = null;
      let locallyAborted = false;
      let controller = null;
      addAbortListener(
        requestObject.signal,
        () => {
          locallyAborted = true;
          assert61(controller != null);
          controller.abort(requestObject.signal.reason);
          const realResponse = responseObject?.deref();
          abortFetch(p7, request4, realResponse, requestObject.signal.reason, controller.controller);
        }
      );
      const processResponse = /* @__PURE__ */ __name((response) => {
        if (locallyAborted) {
          return;
        }
        if (response.aborted) {
          abortFetch(p7, request4, responseObject, controller.serializedAbortReason, controller.controller);
          return;
        }
        if (response.type === "error") {
          p7.reject(new TypeError("fetch failed", { cause: response.error }));
          return;
        }
        responseObject = new WeakRef(fromInnerResponse(response, "immutable"));
        p7.resolve(responseObject.deref());
        p7 = null;
      }, "processResponse");
      controller = fetching({
        request: request4,
        processResponseEndOfBody: handleFetchDone,
        processResponse,
        dispatcher: getRequestDispatcher(requestObject),
        // undici
        // Keep requestObject alive to prevent its AbortController from being GC'd
        // See https://github.com/nodejs/undici/issues/4627
        requestObject
      });
      return p7.promise;
    }
    __name(fetch20, "fetch");
    function finalizeAndReportTiming(response, initiatorType = "other") {
      if (response.type === "error" && response.aborted) {
        return;
      }
      if (!response.urlList?.length) {
        return;
      }
      const originalURL = response.urlList[0];
      let timingInfo = response.timingInfo;
      let cacheState = response.cacheState;
      if (!urlIsHttpHttpsScheme(originalURL)) {
        return;
      }
      if (timingInfo === null) {
        return;
      }
      if (!response.timingAllowPassed) {
        timingInfo = createOpaqueTimingInfo({
          startTime: timingInfo.startTime
        });
        cacheState = "";
      }
      timingInfo.endTime = coarsenedSharedCurrentTime();
      response.timingInfo = timingInfo;
      markResourceTiming(
        timingInfo,
        originalURL.href,
        initiatorType,
        globalThis,
        cacheState,
        "",
        // bodyType
        response.status
      );
    }
    __name(finalizeAndReportTiming, "finalizeAndReportTiming");
    var markResourceTiming = performance.markResourceTiming;
    function abortFetch(p7, request4, responseObject, error2, controller) {
      if (p7) {
        p7.reject(error2);
      }
      if (request4.body?.stream != null && isReadable(request4.body.stream)) {
        request4.body.stream.cancel(error2).catch((err) => {
          if (err.code === "ERR_INVALID_STATE") {
            return;
          }
          throw err;
        });
      }
      if (responseObject == null) {
        return;
      }
      const response = getResponseState(responseObject);
      if (response.body?.stream != null && isReadable(response.body.stream)) {
        controller.error(error2);
      }
    }
    __name(abortFetch, "abortFetch");
    function fetching({
      request: request4,
      processRequestBodyChunkLength,
      processRequestEndOfBody,
      processResponse,
      processResponseEndOfBody,
      processResponseConsumeBody,
      useParallelQueue = false,
      dispatcher = getGlobalDispatcher2(),
      // undici
      requestObject = null
      // Keep alive to prevent AbortController GC, see #4627
    }) {
      assert61(dispatcher);
      let taskDestination = null;
      let crossOriginIsolatedCapability = false;
      if (request4.client != null) {
        taskDestination = request4.client.globalObject;
        crossOriginIsolatedCapability = request4.client.crossOriginIsolatedCapability;
      }
      const currentTime = coarsenedSharedCurrentTime(crossOriginIsolatedCapability);
      const timingInfo = createOpaqueTimingInfo({
        startTime: currentTime
      });
      const fetchParams = {
        controller: new Fetch(dispatcher),
        request: request4,
        timingInfo,
        processRequestBodyChunkLength,
        processRequestEndOfBody,
        processResponse,
        processResponseConsumeBody,
        processResponseEndOfBody,
        taskDestination,
        crossOriginIsolatedCapability,
        // Keep requestObject alive to prevent its AbortController from being GC'd
        requestObject
      };
      assert61(!request4.body || request4.body.stream);
      if (request4.window === "client") {
        request4.window = request4.client?.globalObject?.constructor?.name === "Window" ? request4.client : "no-window";
      }
      if (request4.origin === "client") {
        request4.origin = request4.client.origin;
      }
      if (request4.policyContainer === "client") {
        if (request4.client != null) {
          request4.policyContainer = clonePolicyContainer(
            request4.client.policyContainer
          );
        } else {
          request4.policyContainer = makePolicyContainer();
        }
      }
      if (!request4.headersList.contains("accept", true)) {
        const value = "*/*";
        request4.headersList.append("accept", value, true);
      }
      if (!request4.headersList.contains("accept-language", true)) {
        request4.headersList.append("accept-language", "*", true);
      }
      if (request4.priority === null) ;
      if (subresourceSet.has(request4.destination)) ;
      mainFetch(fetchParams, false);
      return fetchParams.controller;
    }
    __name(fetching, "fetching");
    async function mainFetch(fetchParams, recursive) {
      try {
        const request4 = fetchParams.request;
        let response = null;
        if (request4.localURLsOnly && !urlIsLocal(requestCurrentURL(request4))) {
          response = makeNetworkError("local URLs only");
        }
        tryUpgradeRequestToAPotentiallyTrustworthyURL(request4);
        if (requestBadPort(request4) === "blocked") {
          response = makeNetworkError("bad port");
        }
        if (request4.referrerPolicy === "") {
          request4.referrerPolicy = request4.policyContainer.referrerPolicy;
        }
        if (request4.referrer !== "no-referrer") {
          request4.referrer = determineRequestsReferrer(request4);
        }
        if (response === null) {
          const currentURL = requestCurrentURL(request4);
          if (
            // - request’s current URL’s origin is same origin with request’s origin,
            //   and request’s response tainting is "basic"
            sameOrigin(currentURL, request4.url) && request4.responseTainting === "basic" || // request’s current URL’s scheme is "data"
            currentURL.protocol === "data:" || // - request’s mode is "navigate" or "websocket"
            (request4.mode === "navigate" || request4.mode === "websocket")
          ) {
            request4.responseTainting = "basic";
            response = await schemeFetch(fetchParams);
          } else if (request4.mode === "same-origin") {
            response = makeNetworkError('request mode cannot be "same-origin"');
          } else if (request4.mode === "no-cors") {
            if (request4.redirect !== "follow") {
              response = makeNetworkError(
                'redirect mode cannot be "follow" for "no-cors" request'
              );
            } else {
              request4.responseTainting = "opaque";
              response = await schemeFetch(fetchParams);
            }
          } else if (!urlIsHttpHttpsScheme(requestCurrentURL(request4))) {
            response = makeNetworkError("URL scheme must be a HTTP(S) scheme");
          } else {
            request4.responseTainting = "cors";
            response = await httpFetch(fetchParams);
          }
        }
        if (recursive) {
          return response;
        }
        if (response.status !== 0 && !response.internalResponse) {
          if (request4.responseTainting === "cors") {
          }
          if (request4.responseTainting === "basic") {
            response = filterResponse(response, "basic");
          } else if (request4.responseTainting === "cors") {
            response = filterResponse(response, "cors");
          } else if (request4.responseTainting === "opaque") {
            response = filterResponse(response, "opaque");
          } else {
            assert61(false);
          }
        }
        let internalResponse = response.status === 0 ? response : response.internalResponse;
        if (internalResponse.urlList.length === 0) {
          internalResponse.urlList.push(...request4.urlList);
        }
        if (!request4.timingAllowFailed) {
          response.timingAllowPassed = true;
        }
        if (response.type === "opaque" && internalResponse.status === 206 && internalResponse.rangeRequested && !request4.headers.contains("range", true)) {
          response = internalResponse = makeNetworkError();
        }
        if (response.status !== 0 && (request4.method === "HEAD" || request4.method === "CONNECT" || nullBodyStatus.includes(internalResponse.status))) {
          internalResponse.body = null;
          fetchParams.controller.dump = true;
        }
        if (request4.integrity) {
          const processBodyError = /* @__PURE__ */ __name((reason) => fetchFinale(fetchParams, makeNetworkError(reason)), "processBodyError");
          if (request4.responseTainting === "opaque" || response.body == null) {
            processBodyError(response.error);
            return;
          }
          const processBody = /* @__PURE__ */ __name((bytes) => {
            if (!bytesMatch(bytes, request4.integrity)) {
              processBodyError("integrity mismatch");
              return;
            }
            response.body = safelyExtractBody(bytes)[0];
            fetchFinale(fetchParams, response);
          }, "processBody");
          fullyReadBody(response.body, processBody, processBodyError);
        } else {
          fetchFinale(fetchParams, response);
        }
      } catch (err) {
        fetchParams.controller.terminate(err);
      }
    }
    __name(mainFetch, "mainFetch");
    function schemeFetch(fetchParams) {
      if (isCancelled(fetchParams) && fetchParams.request.redirectCount === 0) {
        return Promise.resolve(makeAppropriateNetworkError(fetchParams));
      }
      const { request: request4 } = fetchParams;
      const { protocol: scheme } = requestCurrentURL(request4);
      switch (scheme) {
        case "about:": {
          return Promise.resolve(makeNetworkError("about scheme is not supported"));
        }
        case "blob:": {
          if (!resolveObjectURL) {
            resolveObjectURL = __require("buffer").resolveObjectURL;
          }
          const blobURLEntry = requestCurrentURL(request4);
          if (blobURLEntry.search.length !== 0) {
            return Promise.resolve(makeNetworkError("NetworkError when attempting to fetch resource."));
          }
          const blob = resolveObjectURL(blobURLEntry.toString());
          if (request4.method !== "GET" || !webidl.is.Blob(blob)) {
            return Promise.resolve(makeNetworkError("invalid method"));
          }
          const response = makeResponse();
          const fullLength = blob.size;
          const serializedFullLength = isomorphicEncode(`${fullLength}`);
          const type = blob.type;
          if (!request4.headersList.contains("range", true)) {
            const bodyWithType = extractBody(blob);
            response.statusText = "OK";
            response.body = bodyWithType[0];
            response.headersList.set("content-length", serializedFullLength, true);
            response.headersList.set("content-type", type, true);
          } else {
            response.rangeRequested = true;
            const rangeHeader = request4.headersList.get("range", true);
            const rangeValue = simpleRangeHeaderValue(rangeHeader, true);
            if (rangeValue === "failure") {
              return Promise.resolve(makeNetworkError("failed to fetch the data URL"));
            }
            let { rangeStartValue: rangeStart, rangeEndValue: rangeEnd } = rangeValue;
            if (rangeStart === null) {
              rangeStart = fullLength - rangeEnd;
              rangeEnd = rangeStart + rangeEnd - 1;
            } else {
              if (rangeStart >= fullLength) {
                return Promise.resolve(makeNetworkError("Range start is greater than the blob's size."));
              }
              if (rangeEnd === null || rangeEnd >= fullLength) {
                rangeEnd = fullLength - 1;
              }
            }
            const slicedBlob = blob.slice(rangeStart, rangeEnd + 1, type);
            const slicedBodyWithType = extractBody(slicedBlob);
            response.body = slicedBodyWithType[0];
            const serializedSlicedLength = isomorphicEncode(`${slicedBlob.size}`);
            const contentRange = buildContentRange(rangeStart, rangeEnd, fullLength);
            response.status = 206;
            response.statusText = "Partial Content";
            response.headersList.set("content-length", serializedSlicedLength, true);
            response.headersList.set("content-type", type, true);
            response.headersList.set("content-range", contentRange, true);
          }
          return Promise.resolve(response);
        }
        case "data:": {
          const currentURL = requestCurrentURL(request4);
          const dataURLStruct = dataURLProcessor(currentURL);
          if (dataURLStruct === "failure") {
            return Promise.resolve(makeNetworkError("failed to fetch the data URL"));
          }
          const mimeType = serializeAMimeType(dataURLStruct.mimeType);
          return Promise.resolve(makeResponse({
            statusText: "OK",
            headersList: [
              ["content-type", { name: "Content-Type", value: mimeType }]
            ],
            body: safelyExtractBody(dataURLStruct.body)[0]
          }));
        }
        case "file:": {
          return Promise.resolve(makeNetworkError("not implemented... yet..."));
        }
        case "http:":
        case "https:": {
          return httpFetch(fetchParams).catch((err) => makeNetworkError(err));
        }
        default: {
          return Promise.resolve(makeNetworkError("unknown scheme"));
        }
      }
    }
    __name(schemeFetch, "schemeFetch");
    function finalizeResponse(fetchParams, response) {
      fetchParams.request.done = true;
      if (fetchParams.processResponseDone != null) {
        queueMicrotask(() => fetchParams.processResponseDone(response));
      }
    }
    __name(finalizeResponse, "finalizeResponse");
    function fetchFinale(fetchParams, response) {
      let timingInfo = fetchParams.timingInfo;
      const processResponseEndOfBody = /* @__PURE__ */ __name(() => {
        const unsafeEndTime = Date.now();
        if (fetchParams.request.destination === "document") {
          fetchParams.controller.fullTimingInfo = timingInfo;
        }
        fetchParams.controller.reportTimingSteps = () => {
          if (!urlIsHttpHttpsScheme(fetchParams.request.url)) {
            return;
          }
          timingInfo.endTime = unsafeEndTime;
          let cacheState = response.cacheState;
          const bodyInfo = response.bodyInfo;
          if (!response.timingAllowPassed) {
            timingInfo = createOpaqueTimingInfo(timingInfo);
            cacheState = "";
          }
          let responseStatus = 0;
          if (fetchParams.request.mode !== "navigator" || !response.hasCrossOriginRedirects) {
            responseStatus = response.status;
            const mimeType = extractMimeType(response.headersList);
            if (mimeType !== "failure") {
              bodyInfo.contentType = minimizeSupportedMimeType(mimeType);
            }
          }
          if (fetchParams.request.initiatorType != null) {
            markResourceTiming(timingInfo, fetchParams.request.url.href, fetchParams.request.initiatorType, globalThis, cacheState, bodyInfo, responseStatus);
          }
        };
        const processResponseEndOfBodyTask = /* @__PURE__ */ __name(() => {
          fetchParams.request.done = true;
          if (fetchParams.processResponseEndOfBody != null) {
            queueMicrotask(() => fetchParams.processResponseEndOfBody(response));
          }
          if (fetchParams.request.initiatorType != null) {
            fetchParams.controller.reportTimingSteps();
          }
        }, "processResponseEndOfBodyTask");
        queueMicrotask(() => processResponseEndOfBodyTask());
      }, "processResponseEndOfBody");
      if (fetchParams.processResponse != null) {
        queueMicrotask(() => {
          fetchParams.processResponse(response);
          fetchParams.processResponse = null;
        });
      }
      const internalResponse = response.type === "error" ? response : response.internalResponse ?? response;
      if (internalResponse.body == null) {
        processResponseEndOfBody();
      } else {
        finished(internalResponse.body.stream, () => {
          processResponseEndOfBody();
        });
      }
    }
    __name(fetchFinale, "fetchFinale");
    async function httpFetch(fetchParams) {
      const request4 = fetchParams.request;
      let response = null;
      let actualResponse = null;
      const timingInfo = fetchParams.timingInfo;
      if (request4.serviceWorkers === "all") ;
      if (response === null) {
        if (request4.redirect === "follow") {
          request4.serviceWorkers = "none";
        }
        actualResponse = response = await httpNetworkOrCacheFetch(fetchParams);
        if (request4.responseTainting === "cors" && corsCheck(request4, response) === "failure") {
          return makeNetworkError("cors failure");
        }
        if (TAOCheck(request4, response) === "failure") {
          request4.timingAllowFailed = true;
        }
      }
      if ((request4.responseTainting === "opaque" || response.type === "opaque") && crossOriginResourcePolicyCheck(
        request4.origin,
        request4.client,
        request4.destination,
        actualResponse
      ) === "blocked") {
        return makeNetworkError("blocked");
      }
      if (redirectStatusSet.has(actualResponse.status)) {
        if (request4.redirect !== "manual") {
          fetchParams.controller.connection.destroy(void 0, false);
        }
        if (request4.redirect === "error") {
          response = makeNetworkError("unexpected redirect");
        } else if (request4.redirect === "manual") {
          response = actualResponse;
        } else if (request4.redirect === "follow") {
          response = await httpRedirectFetch(fetchParams, response);
        } else {
          assert61(false);
        }
      }
      response.timingInfo = timingInfo;
      return response;
    }
    __name(httpFetch, "httpFetch");
    function httpRedirectFetch(fetchParams, response) {
      const request4 = fetchParams.request;
      const actualResponse = response.internalResponse ? response.internalResponse : response;
      let locationURL;
      try {
        locationURL = responseLocationURL(
          actualResponse,
          requestCurrentURL(request4).hash
        );
        if (locationURL == null) {
          return response;
        }
      } catch (err) {
        return Promise.resolve(makeNetworkError(err));
      }
      if (!urlIsHttpHttpsScheme(locationURL)) {
        return Promise.resolve(makeNetworkError("URL scheme must be a HTTP(S) scheme"));
      }
      if (request4.redirectCount === 20) {
        return Promise.resolve(makeNetworkError("redirect count exceeded"));
      }
      request4.redirectCount += 1;
      if (request4.mode === "cors" && (locationURL.username || locationURL.password) && !sameOrigin(request4, locationURL)) {
        return Promise.resolve(makeNetworkError('cross origin not allowed for request mode "cors"'));
      }
      if (request4.responseTainting === "cors" && (locationURL.username || locationURL.password)) {
        return Promise.resolve(makeNetworkError(
          'URL cannot contain credentials for request mode "cors"'
        ));
      }
      if (actualResponse.status !== 303 && request4.body != null && request4.body.source == null) {
        return Promise.resolve(makeNetworkError());
      }
      if ([301, 302].includes(actualResponse.status) && request4.method === "POST" || actualResponse.status === 303 && !GET_OR_HEAD.includes(request4.method)) {
        request4.method = "GET";
        request4.body = null;
        for (const headerName of requestBodyHeader) {
          request4.headersList.delete(headerName);
        }
      }
      if (!sameOrigin(requestCurrentURL(request4), locationURL)) {
        request4.headersList.delete("authorization", true);
        request4.headersList.delete("proxy-authorization", true);
        request4.headersList.delete("cookie", true);
        request4.headersList.delete("host", true);
      }
      if (request4.body != null) {
        assert61(request4.body.source != null);
        request4.body = safelyExtractBody(request4.body.source)[0];
      }
      const timingInfo = fetchParams.timingInfo;
      timingInfo.redirectEndTime = timingInfo.postRedirectStartTime = coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability);
      if (timingInfo.redirectStartTime === 0) {
        timingInfo.redirectStartTime = timingInfo.startTime;
      }
      request4.urlList.push(locationURL);
      setRequestReferrerPolicyOnRedirect(request4, actualResponse);
      return mainFetch(fetchParams, true);
    }
    __name(httpRedirectFetch, "httpRedirectFetch");
    async function httpNetworkOrCacheFetch(fetchParams, isAuthenticationFetch = false, isNewConnectionFetch = false) {
      const request4 = fetchParams.request;
      let httpFetchParams = null;
      let httpRequest2 = null;
      let response = null;
      if (request4.window === "no-window" && request4.redirect === "error") {
        httpFetchParams = fetchParams;
        httpRequest2 = request4;
      } else {
        httpRequest2 = cloneRequest(request4);
        httpFetchParams = { ...fetchParams };
        httpFetchParams.request = httpRequest2;
      }
      const includeCredentials = request4.credentials === "include" || request4.credentials === "same-origin" && request4.responseTainting === "basic";
      const contentLength = httpRequest2.body ? httpRequest2.body.length : null;
      let contentLengthHeaderValue = null;
      if (httpRequest2.body == null && ["POST", "PUT"].includes(httpRequest2.method)) {
        contentLengthHeaderValue = "0";
      }
      if (contentLength != null) {
        contentLengthHeaderValue = isomorphicEncode(`${contentLength}`);
      }
      if (contentLengthHeaderValue != null) {
        httpRequest2.headersList.append("content-length", contentLengthHeaderValue, true);
      }
      if (contentLength != null && httpRequest2.keepalive) ;
      if (webidl.is.URL(httpRequest2.referrer)) {
        httpRequest2.headersList.append("referer", isomorphicEncode(httpRequest2.referrer.href), true);
      }
      appendRequestOriginHeader(httpRequest2);
      appendFetchMetadata(httpRequest2);
      if (!httpRequest2.headersList.contains("user-agent", true)) {
        httpRequest2.headersList.append("user-agent", defaultUserAgent, true);
      }
      if (httpRequest2.cache === "default" && (httpRequest2.headersList.contains("if-modified-since", true) || httpRequest2.headersList.contains("if-none-match", true) || httpRequest2.headersList.contains("if-unmodified-since", true) || httpRequest2.headersList.contains("if-match", true) || httpRequest2.headersList.contains("if-range", true))) {
        httpRequest2.cache = "no-store";
      }
      if (httpRequest2.cache === "no-cache" && !httpRequest2.preventNoCacheCacheControlHeaderModification && !httpRequest2.headersList.contains("cache-control", true)) {
        httpRequest2.headersList.append("cache-control", "max-age=0", true);
      }
      if (httpRequest2.cache === "no-store" || httpRequest2.cache === "reload") {
        if (!httpRequest2.headersList.contains("pragma", true)) {
          httpRequest2.headersList.append("pragma", "no-cache", true);
        }
        if (!httpRequest2.headersList.contains("cache-control", true)) {
          httpRequest2.headersList.append("cache-control", "no-cache", true);
        }
      }
      if (httpRequest2.headersList.contains("range", true)) {
        httpRequest2.headersList.append("accept-encoding", "identity", true);
      }
      if (!httpRequest2.headersList.contains("accept-encoding", true)) {
        if (urlHasHttpsScheme(requestCurrentURL(httpRequest2))) {
          httpRequest2.headersList.append("accept-encoding", "br, gzip, deflate", true);
        } else {
          httpRequest2.headersList.append("accept-encoding", "gzip, deflate", true);
        }
      }
      httpRequest2.headersList.delete("host", true);
      if (includeCredentials) {
        if (!httpRequest2.headersList.contains("authorization", true)) {
          let authorizationValue = null;
          if (hasAuthenticationEntry(httpRequest2) && (httpRequest2.useURLCredentials === void 0 || !includesCredentials(requestCurrentURL(httpRequest2)))) ; else if (includesCredentials(requestCurrentURL(httpRequest2)) && isAuthenticationFetch) {
            const { username, password } = requestCurrentURL(httpRequest2);
            authorizationValue = `Basic ${Buffer.from(`${username}:${password}`).toString("base64")}`;
          }
          if (authorizationValue !== null) {
            httpRequest2.headersList.append("Authorization", authorizationValue, false);
          }
        }
      }
      {
        httpRequest2.cache = "no-store";
      }
      if (httpRequest2.cache !== "no-store" && httpRequest2.cache !== "reload") ;
      if (response == null) {
        if (httpRequest2.cache === "only-if-cached") {
          return makeNetworkError("only if cached");
        }
        const forwardResponse = await httpNetworkFetch(
          httpFetchParams,
          includeCredentials,
          isNewConnectionFetch
        );
        if (!safeMethodsSet.has(httpRequest2.method) && forwardResponse.status >= 200 && forwardResponse.status <= 399) ;
        if (response == null) {
          response = forwardResponse;
        }
      }
      response.urlList = [...httpRequest2.urlList];
      if (httpRequest2.headersList.contains("range", true)) {
        response.rangeRequested = true;
      }
      response.requestIncludesCredentials = includeCredentials;
      if (response.status === 401 && httpRequest2.responseTainting !== "cors" && includeCredentials && isTraversableNavigable(request4.traversableForUserPrompts)) {
        if (request4.body != null) {
          if (request4.body.source == null) {
            return makeNetworkError("expected non-null body source");
          }
          request4.body = safelyExtractBody(request4.body.source)[0];
        }
        if (request4.useURLCredentials === void 0 || isAuthenticationFetch) {
          if (isCancelled(fetchParams)) {
            return makeAppropriateNetworkError(fetchParams);
          }
          return response;
        }
        fetchParams.controller.connection.destroy();
        response = await httpNetworkOrCacheFetch(fetchParams, true);
      }
      if (response.status === 407) {
        if (request4.window === "no-window") {
          return makeNetworkError();
        }
        if (isCancelled(fetchParams)) {
          return makeAppropriateNetworkError(fetchParams);
        }
        return makeNetworkError("proxy authentication required");
      }
      if (
        // response’s status is 421
        response.status === 421 && // isNewConnectionFetch is false
        !isNewConnectionFetch && // request’s body is null, or request’s body is non-null and request’s body’s source is non-null
        (request4.body == null || request4.body.source != null)
      ) {
        if (isCancelled(fetchParams)) {
          return makeAppropriateNetworkError(fetchParams);
        }
        fetchParams.controller.connection.destroy();
        response = await httpNetworkOrCacheFetch(
          fetchParams,
          isAuthenticationFetch,
          true
        );
      }
      return response;
    }
    __name(httpNetworkOrCacheFetch, "httpNetworkOrCacheFetch");
    async function httpNetworkFetch(fetchParams, includeCredentials = false, forceNewConnection = false) {
      assert61(!fetchParams.controller.connection || fetchParams.controller.connection.destroyed);
      fetchParams.controller.connection = {
        abort: null,
        destroyed: false,
        destroy(err, abort = true) {
          if (!this.destroyed) {
            this.destroyed = true;
            if (abort) {
              this.abort?.(err ?? new DOMException("The operation was aborted.", "AbortError"));
            }
          }
        }
      };
      const request4 = fetchParams.request;
      let response = null;
      const timingInfo = fetchParams.timingInfo;
      {
        request4.cache = "no-store";
      }
      if (request4.mode === "websocket") ;
      let requestBody = null;
      if (request4.body == null && fetchParams.processRequestEndOfBody) {
        queueMicrotask(() => fetchParams.processRequestEndOfBody());
      } else if (request4.body != null) {
        const processBodyChunk = /* @__PURE__ */ __name(async function* (bytes) {
          if (isCancelled(fetchParams)) {
            return;
          }
          yield bytes;
          fetchParams.processRequestBodyChunkLength?.(bytes.byteLength);
        }, "processBodyChunk");
        const processEndOfBody = /* @__PURE__ */ __name(() => {
          if (isCancelled(fetchParams)) {
            return;
          }
          if (fetchParams.processRequestEndOfBody) {
            fetchParams.processRequestEndOfBody();
          }
        }, "processEndOfBody");
        const processBodyError = /* @__PURE__ */ __name((e10) => {
          if (isCancelled(fetchParams)) {
            return;
          }
          if (e10.name === "AbortError") {
            fetchParams.controller.abort();
          } else {
            fetchParams.controller.terminate(e10);
          }
        }, "processBodyError");
        requestBody = async function* () {
          try {
            for await (const bytes of request4.body.stream) {
              yield* processBodyChunk(bytes);
            }
            processEndOfBody();
          } catch (err) {
            processBodyError(err);
          }
        }();
      }
      try {
        const { body, status: status2, statusText, headersList, socket } = await dispatch({ body: requestBody });
        if (socket) {
          response = makeResponse({ status: status2, statusText, headersList, socket });
        } else {
          const iterator = body[Symbol.asyncIterator]();
          fetchParams.controller.next = () => iterator.next();
          response = makeResponse({ status: status2, statusText, headersList });
        }
      } catch (err) {
        if (err.name === "AbortError") {
          fetchParams.controller.connection.destroy();
          return makeAppropriateNetworkError(fetchParams, err);
        }
        return makeNetworkError(err);
      }
      const pullAlgorithm = /* @__PURE__ */ __name(() => {
        return fetchParams.controller.resume();
      }, "pullAlgorithm");
      const cancelAlgorithm = /* @__PURE__ */ __name((reason) => {
        if (!isCancelled(fetchParams)) {
          fetchParams.controller.abort(reason);
        }
      }, "cancelAlgorithm");
      const stream2 = new ReadableStream(
        {
          start(controller) {
            fetchParams.controller.controller = controller;
          },
          pull: pullAlgorithm,
          cancel: cancelAlgorithm,
          type: "bytes"
        }
      );
      response.body = { stream: stream2, source: null, length: null };
      if (!fetchParams.controller.resume) {
        fetchParams.controller.on("terminated", onAborted);
      }
      fetchParams.controller.resume = async () => {
        while (true) {
          let bytes;
          let isFailure;
          try {
            const { done, value } = await fetchParams.controller.next();
            if (isAborted4(fetchParams)) {
              break;
            }
            bytes = done ? void 0 : value;
          } catch (err) {
            if (fetchParams.controller.ended && !timingInfo.encodedBodySize) {
              bytes = void 0;
            } else {
              bytes = err;
              isFailure = true;
            }
          }
          if (bytes === void 0) {
            readableStreamClose(fetchParams.controller.controller);
            finalizeResponse(fetchParams, response);
            return;
          }
          timingInfo.decodedBodySize += bytes?.byteLength ?? 0;
          if (isFailure) {
            fetchParams.controller.terminate(bytes);
            return;
          }
          const buffer = new Uint8Array(bytes);
          if (buffer.byteLength) {
            fetchParams.controller.controller.enqueue(buffer);
          }
          if (isErrored(stream2)) {
            fetchParams.controller.terminate();
            return;
          }
          if (fetchParams.controller.controller.desiredSize <= 0) {
            return;
          }
        }
      };
      function onAborted(reason) {
        if (isAborted4(fetchParams)) {
          response.aborted = true;
          if (isReadable(stream2)) {
            fetchParams.controller.controller.error(
              fetchParams.controller.serializedAbortReason
            );
          }
        } else {
          if (isReadable(stream2)) {
            fetchParams.controller.controller.error(new TypeError("terminated", {
              cause: isErrorLike(reason) ? reason : void 0
            }));
          }
        }
        fetchParams.controller.connection.destroy();
      }
      __name(onAborted, "onAborted");
      return response;
      function dispatch({ body }) {
        const url4 = requestCurrentURL(request4);
        const agent = fetchParams.controller.dispatcher;
        const path84 = url4.pathname + url4.search;
        const hasTrailingQuestionMark = url4.search.length === 0 && url4.href[url4.href.length - url4.hash.length - 1] === "?";
        return new Promise((resolve32, reject) => agent.dispatch(
          {
            path: hasTrailingQuestionMark ? `${path84}?` : path84,
            origin: url4.origin,
            method: request4.method,
            body: agent.isMockActive ? request4.body && (request4.body.source || request4.body.stream) : body,
            headers: request4.headersList.entries,
            maxRedirections: 0,
            upgrade: request4.mode === "websocket" ? "websocket" : void 0
          },
          {
            body: null,
            abort: null,
            onConnect(abort) {
              const { connection } = fetchParams.controller;
              timingInfo.finalConnectionTimingInfo = clampAndCoarsenConnectionTimingInfo(void 0, timingInfo.postRedirectStartTime, fetchParams.crossOriginIsolatedCapability);
              if (connection.destroyed) {
                abort(new DOMException("The operation was aborted.", "AbortError"));
              } else {
                fetchParams.controller.on("terminated", abort);
                this.abort = connection.abort = abort;
              }
              timingInfo.finalNetworkRequestStartTime = coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability);
            },
            onResponseStarted() {
              timingInfo.finalNetworkResponseStartTime = coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability);
            },
            onHeaders(status2, rawHeaders, resume, statusText) {
              if (status2 < 200) {
                return false;
              }
              const headersList = new HeadersList();
              for (let i7 = 0; i7 < rawHeaders.length; i7 += 2) {
                headersList.append(bufferToLowerCasedHeaderName(rawHeaders[i7]), rawHeaders[i7 + 1].toString("latin1"), true);
              }
              const location = headersList.get("location", true);
              this.body = new Readable11({ read: resume });
              const willFollow = location && request4.redirect === "follow" && redirectStatusSet.has(status2);
              const decoders = [];
              if (request4.method !== "HEAD" && request4.method !== "CONNECT" && !nullBodyStatus.includes(status2) && !willFollow) {
                const contentEncoding = headersList.get("content-encoding", true);
                const codings = contentEncoding ? contentEncoding.toLowerCase().split(",") : [];
                const maxContentEncodings = 5;
                if (codings.length > maxContentEncodings) {
                  reject(new Error(`too many content-encodings in response: ${codings.length}, maximum allowed is ${maxContentEncodings}`));
                  return true;
                }
                for (let i7 = codings.length - 1; i7 >= 0; --i7) {
                  const coding = codings[i7].trim();
                  if (coding === "x-gzip" || coding === "gzip") {
                    decoders.push(zlib3.createGunzip({
                      // Be less strict when decoding compressed responses, since sometimes
                      // servers send slightly invalid responses that are still accepted
                      // by common browsers.
                      // Always using Z_SYNC_FLUSH is what cURL does.
                      flush: zlib3.constants.Z_SYNC_FLUSH,
                      finishFlush: zlib3.constants.Z_SYNC_FLUSH
                    }));
                  } else if (coding === "deflate") {
                    decoders.push(createInflate({
                      flush: zlib3.constants.Z_SYNC_FLUSH,
                      finishFlush: zlib3.constants.Z_SYNC_FLUSH
                    }));
                  } else if (coding === "br") {
                    decoders.push(zlib3.createBrotliDecompress({
                      flush: zlib3.constants.BROTLI_OPERATION_FLUSH,
                      finishFlush: zlib3.constants.BROTLI_OPERATION_FLUSH
                    }));
                  } else if (coding === "zstd" && hasZstd) {
                    decoders.push(zlib3.createZstdDecompress({
                      flush: zlib3.constants.ZSTD_e_continue,
                      finishFlush: zlib3.constants.ZSTD_e_end
                    }));
                  } else {
                    decoders.length = 0;
                    break;
                  }
                }
              }
              const onError = this.onError.bind(this);
              resolve32({
                status: status2,
                statusText,
                headersList,
                body: decoders.length ? pipeline(this.body, ...decoders, (err) => {
                  if (err) {
                    this.onError(err);
                  }
                }).on("error", onError) : this.body.on("error", onError)
              });
              return true;
            },
            onData(chunk) {
              if (fetchParams.controller.dump) {
                return;
              }
              const bytes = chunk;
              timingInfo.encodedBodySize += bytes.byteLength;
              return this.body.push(bytes);
            },
            onComplete() {
              if (this.abort) {
                fetchParams.controller.off("terminated", this.abort);
              }
              fetchParams.controller.ended = true;
              this.body.push(null);
            },
            onError(error2) {
              if (this.abort) {
                fetchParams.controller.off("terminated", this.abort);
              }
              this.body?.destroy(error2);
              fetchParams.controller.terminate(error2);
              reject(error2);
            },
            onRequestUpgrade(_controller, status2, headers, socket) {
              if (socket.session != null && status2 !== 200 || socket.session == null && status2 !== 101) {
                return false;
              }
              const headersList = new HeadersList();
              for (const [name2, value] of Object.entries(headers)) {
                if (value == null) {
                  continue;
                }
                const headerName = name2.toLowerCase();
                if (Array.isArray(value)) {
                  for (const entry of value) {
                    headersList.append(headerName, String(entry), true);
                  }
                } else {
                  headersList.append(headerName, String(value), true);
                }
              }
              resolve32({
                status: status2,
                statusText: STATUS_CODES2[status2],
                headersList,
                socket
              });
              return true;
            },
            onUpgrade(status2, rawHeaders, socket) {
              if (socket.session != null && status2 !== 200 || socket.session == null && status2 !== 101) {
                return false;
              }
              const headersList = new HeadersList();
              for (let i7 = 0; i7 < rawHeaders.length; i7 += 2) {
                headersList.append(bufferToLowerCasedHeaderName(rawHeaders[i7]), rawHeaders[i7 + 1].toString("latin1"), true);
              }
              resolve32({
                status: status2,
                statusText: STATUS_CODES2[status2],
                headersList,
                socket
              });
              return true;
            }
          }
        ));
      }
    }
    __name(httpNetworkFetch, "httpNetworkFetch");
    module2.exports = {
      fetch: fetch20,
      Fetch,
      fetching,
      finalizeAndReportTiming
    };
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/web/cache/util.js
var require_util3 = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/web/cache/util.js"(exports, module2) {
    init_import_meta_url();
    var assert61 = __require("assert");
    var { URLSerializer } = require_data_url();
    var { isValidHeaderName } = require_util2();
    function urlEquals(A4, B4, excludeFragment = false) {
      const serializedA = URLSerializer(A4, excludeFragment);
      const serializedB = URLSerializer(B4, excludeFragment);
      return serializedA === serializedB;
    }
    __name(urlEquals, "urlEquals");
    function getFieldValues(header) {
      assert61(header !== null);
      const values = [];
      for (let value of header.split(",")) {
        value = value.trim();
        if (isValidHeaderName(value)) {
          values.push(value);
        }
      }
      return values;
    }
    __name(getFieldValues, "getFieldValues");
    module2.exports = {
      urlEquals,
      getFieldValues
    };
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/web/cache/cache.js
var require_cache3 = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/web/cache/cache.js"(exports, module2) {
    init_import_meta_url();
    var assert61 = __require("assert");
    var { kConstruct } = require_symbols();
    var { urlEquals, getFieldValues } = require_util3();
    var { kEnumerableProperty, isDisturbed } = require_util();
    var { webidl } = require_webidl();
    var { cloneResponse, fromInnerResponse, getResponseState } = require_response();
    var { Request: Request7, fromInnerRequest, getRequestState } = require_request2();
    var { fetching } = require_fetch();
    var { urlIsHttpHttpsScheme, readAllBytes } = require_util2();
    var { createDeferredPromise } = require_promise();
    var Cache3 = class _Cache {
      static {
        __name(this, "Cache");
      }
      /**
       * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-request-response-list
       * @type {requestResponseList}
       */
      #relevantRequestResponseList;
      constructor() {
        if (arguments[0] !== kConstruct) {
          webidl.illegalConstructor();
        }
        webidl.util.markAsUncloneable(this);
        this.#relevantRequestResponseList = arguments[1];
      }
      async match(request4, options = {}) {
        webidl.brandCheck(this, _Cache);
        const prefix = "Cache.match";
        webidl.argumentLengthCheck(arguments, 1, prefix);
        request4 = webidl.converters.RequestInfo(request4);
        options = webidl.converters.CacheQueryOptions(options, prefix, "options");
        const p7 = this.#internalMatchAll(request4, options, 1);
        if (p7.length === 0) {
          return;
        }
        return p7[0];
      }
      async matchAll(request4 = void 0, options = {}) {
        webidl.brandCheck(this, _Cache);
        const prefix = "Cache.matchAll";
        if (request4 !== void 0) request4 = webidl.converters.RequestInfo(request4);
        options = webidl.converters.CacheQueryOptions(options, prefix, "options");
        return this.#internalMatchAll(request4, options);
      }
      async add(request4) {
        webidl.brandCheck(this, _Cache);
        const prefix = "Cache.add";
        webidl.argumentLengthCheck(arguments, 1, prefix);
        request4 = webidl.converters.RequestInfo(request4);
        const requests = [request4];
        const responseArrayPromise = this.addAll(requests);
        return await responseArrayPromise;
      }
      async addAll(requests) {
        webidl.brandCheck(this, _Cache);
        const prefix = "Cache.addAll";
        webidl.argumentLengthCheck(arguments, 1, prefix);
        const responsePromises = [];
        const requestList = [];
        for (let request4 of requests) {
          if (request4 === void 0) {
            throw webidl.errors.conversionFailed({
              prefix,
              argument: "Argument 1",
              types: ["undefined is not allowed"]
            });
          }
          request4 = webidl.converters.RequestInfo(request4);
          if (typeof request4 === "string") {
            continue;
          }
          const r10 = getRequestState(request4);
          if (!urlIsHttpHttpsScheme(r10.url) || r10.method !== "GET") {
            throw webidl.errors.exception({
              header: prefix,
              message: "Expected http/s scheme when method is not GET."
            });
          }
        }
        const fetchControllers = [];
        for (const request4 of requests) {
          const r10 = getRequestState(new Request7(request4));
          if (!urlIsHttpHttpsScheme(r10.url)) {
            throw webidl.errors.exception({
              header: prefix,
              message: "Expected http/s scheme."
            });
          }
          r10.initiator = "fetch";
          r10.destination = "subresource";
          requestList.push(r10);
          const responsePromise = createDeferredPromise();
          fetchControllers.push(fetching({
            request: r10,
            processResponse(response) {
              if (response.type === "error" || response.status === 206 || response.status < 200 || response.status > 299) {
                responsePromise.reject(webidl.errors.exception({
                  header: "Cache.addAll",
                  message: "Received an invalid status code or the request failed."
                }));
              } else if (response.headersList.contains("vary")) {
                const fieldValues = getFieldValues(response.headersList.get("vary"));
                for (const fieldValue of fieldValues) {
                  if (fieldValue === "*") {
                    responsePromise.reject(webidl.errors.exception({
                      header: "Cache.addAll",
                      message: "invalid vary field value"
                    }));
                    for (const controller of fetchControllers) {
                      controller.abort();
                    }
                    return;
                  }
                }
              }
            },
            processResponseEndOfBody(response) {
              if (response.aborted) {
                responsePromise.reject(new DOMException("aborted", "AbortError"));
                return;
              }
              responsePromise.resolve(response);
            }
          }));
          responsePromises.push(responsePromise.promise);
        }
        const p7 = Promise.all(responsePromises);
        const responses = await p7;
        const operations = [];
        let index = 0;
        for (const response of responses) {
          const operation = {
            type: "put",
            // 7.3.2
            request: requestList[index],
            // 7.3.3
            response
            // 7.3.4
          };
          operations.push(operation);
          index++;
        }
        const cacheJobPromise = createDeferredPromise();
        let errorData = null;
        try {
          this.#batchCacheOperations(operations);
        } catch (e10) {
          errorData = e10;
        }
        queueMicrotask(() => {
          if (errorData === null) {
            cacheJobPromise.resolve(void 0);
          } else {
            cacheJobPromise.reject(errorData);
          }
        });
        return cacheJobPromise.promise;
      }
      async put(request4, response) {
        webidl.brandCheck(this, _Cache);
        const prefix = "Cache.put";
        webidl.argumentLengthCheck(arguments, 2, prefix);
        request4 = webidl.converters.RequestInfo(request4);
        response = webidl.converters.Response(response, prefix, "response");
        let innerRequest = null;
        if (webidl.is.Request(request4)) {
          innerRequest = getRequestState(request4);
        } else {
          innerRequest = getRequestState(new Request7(request4));
        }
        if (!urlIsHttpHttpsScheme(innerRequest.url) || innerRequest.method !== "GET") {
          throw webidl.errors.exception({
            header: prefix,
            message: "Expected an http/s scheme when method is not GET"
          });
        }
        const innerResponse = getResponseState(response);
        if (innerResponse.status === 206) {
          throw webidl.errors.exception({
            header: prefix,
            message: "Got 206 status"
          });
        }
        if (innerResponse.headersList.contains("vary")) {
          const fieldValues = getFieldValues(innerResponse.headersList.get("vary"));
          for (const fieldValue of fieldValues) {
            if (fieldValue === "*") {
              throw webidl.errors.exception({
                header: prefix,
                message: "Got * vary field value"
              });
            }
          }
        }
        if (innerResponse.body && (isDisturbed(innerResponse.body.stream) || innerResponse.body.stream.locked)) {
          throw webidl.errors.exception({
            header: prefix,
            message: "Response body is locked or disturbed"
          });
        }
        const clonedResponse = cloneResponse(innerResponse);
        const bodyReadPromise = createDeferredPromise();
        if (innerResponse.body != null) {
          const stream2 = innerResponse.body.stream;
          const reader = stream2.getReader();
          readAllBytes(reader, bodyReadPromise.resolve, bodyReadPromise.reject);
        } else {
          bodyReadPromise.resolve(void 0);
        }
        const operations = [];
        const operation = {
          type: "put",
          // 14.
          request: innerRequest,
          // 15.
          response: clonedResponse
          // 16.
        };
        operations.push(operation);
        const bytes = await bodyReadPromise.promise;
        if (clonedResponse.body != null) {
          clonedResponse.body.source = bytes;
        }
        const cacheJobPromise = createDeferredPromise();
        let errorData = null;
        try {
          this.#batchCacheOperations(operations);
        } catch (e10) {
          errorData = e10;
        }
        queueMicrotask(() => {
          if (errorData === null) {
            cacheJobPromise.resolve();
          } else {
            cacheJobPromise.reject(errorData);
          }
        });
        return cacheJobPromise.promise;
      }
      async delete(request4, options = {}) {
        webidl.brandCheck(this, _Cache);
        const prefix = "Cache.delete";
        webidl.argumentLengthCheck(arguments, 1, prefix);
        request4 = webidl.converters.RequestInfo(request4);
        options = webidl.converters.CacheQueryOptions(options, prefix, "options");
        let r10 = null;
        if (webidl.is.Request(request4)) {
          r10 = getRequestState(request4);
          if (r10.method !== "GET" && !options.ignoreMethod) {
            return false;
          }
        } else {
          assert61(typeof request4 === "string");
          r10 = getRequestState(new Request7(request4));
        }
        const operations = [];
        const operation = {
          type: "delete",
          request: r10,
          options
        };
        operations.push(operation);
        const cacheJobPromise = createDeferredPromise();
        let errorData = null;
        let requestResponses;
        try {
          requestResponses = this.#batchCacheOperations(operations);
        } catch (e10) {
          errorData = e10;
        }
        queueMicrotask(() => {
          if (errorData === null) {
            cacheJobPromise.resolve(!!requestResponses?.length);
          } else {
            cacheJobPromise.reject(errorData);
          }
        });
        return cacheJobPromise.promise;
      }
      /**
       * @see https://w3c.github.io/ServiceWorker/#dom-cache-keys
       * @param {any} request
       * @param {import('../../../types/cache').CacheQueryOptions} options
       * @returns {Promise<readonly Request[]>}
       */
      async keys(request4 = void 0, options = {}) {
        webidl.brandCheck(this, _Cache);
        const prefix = "Cache.keys";
        if (request4 !== void 0) request4 = webidl.converters.RequestInfo(request4);
        options = webidl.converters.CacheQueryOptions(options, prefix, "options");
        let r10 = null;
        if (request4 !== void 0) {
          if (webidl.is.Request(request4)) {
            r10 = getRequestState(request4);
            if (r10.method !== "GET" && !options.ignoreMethod) {
              return [];
            }
          } else if (typeof request4 === "string") {
            r10 = getRequestState(new Request7(request4));
          }
        }
        const promise = createDeferredPromise();
        const requests = [];
        if (request4 === void 0) {
          for (const requestResponse of this.#relevantRequestResponseList) {
            requests.push(requestResponse[0]);
          }
        } else {
          const requestResponses = this.#queryCache(r10, options);
          for (const requestResponse of requestResponses) {
            requests.push(requestResponse[0]);
          }
        }
        queueMicrotask(() => {
          const requestList = [];
          for (const request5 of requests) {
            const requestObject = fromInnerRequest(
              request5,
              void 0,
              new AbortController().signal,
              "immutable"
            );
            requestList.push(requestObject);
          }
          promise.resolve(Object.freeze(requestList));
        });
        return promise.promise;
      }
      /**
       * @see https://w3c.github.io/ServiceWorker/#batch-cache-operations-algorithm
       * @param {CacheBatchOperation[]} operations
       * @returns {requestResponseList}
       */
      #batchCacheOperations(operations) {
        const cache5 = this.#relevantRequestResponseList;
        const backupCache = [...cache5];
        const addedItems = [];
        const resultList = [];
        try {
          for (const operation of operations) {
            if (operation.type !== "delete" && operation.type !== "put") {
              throw webidl.errors.exception({
                header: "Cache.#batchCacheOperations",
                message: 'operation type does not match "delete" or "put"'
              });
            }
            if (operation.type === "delete" && operation.response != null) {
              throw webidl.errors.exception({
                header: "Cache.#batchCacheOperations",
                message: "delete operation should not have an associated response"
              });
            }
            if (this.#queryCache(operation.request, operation.options, addedItems).length) {
              throw new DOMException("???", "InvalidStateError");
            }
            let requestResponses;
            if (operation.type === "delete") {
              requestResponses = this.#queryCache(operation.request, operation.options);
              if (requestResponses.length === 0) {
                return [];
              }
              for (const requestResponse of requestResponses) {
                const idx = cache5.indexOf(requestResponse);
                assert61(idx !== -1);
                cache5.splice(idx, 1);
              }
            } else if (operation.type === "put") {
              if (operation.response == null) {
                throw webidl.errors.exception({
                  header: "Cache.#batchCacheOperations",
                  message: "put operation should have an associated response"
                });
              }
              const r10 = operation.request;
              if (!urlIsHttpHttpsScheme(r10.url)) {
                throw webidl.errors.exception({
                  header: "Cache.#batchCacheOperations",
                  message: "expected http or https scheme"
                });
              }
              if (r10.method !== "GET") {
                throw webidl.errors.exception({
                  header: "Cache.#batchCacheOperations",
                  message: "not get method"
                });
              }
              if (operation.options != null) {
                throw webidl.errors.exception({
                  header: "Cache.#batchCacheOperations",
                  message: "options must not be defined"
                });
              }
              requestResponses = this.#queryCache(operation.request);
              for (const requestResponse of requestResponses) {
                const idx = cache5.indexOf(requestResponse);
                assert61(idx !== -1);
                cache5.splice(idx, 1);
              }
              cache5.push([operation.request, operation.response]);
              addedItems.push([operation.request, operation.response]);
            }
            resultList.push([operation.request, operation.response]);
          }
          return resultList;
        } catch (e10) {
          this.#relevantRequestResponseList.length = 0;
          this.#relevantRequestResponseList = backupCache;
          throw e10;
        }
      }
      /**
       * @see https://w3c.github.io/ServiceWorker/#query-cache
       * @param {any} requestQuery
       * @param {import('../../../types/cache').CacheQueryOptions} options
       * @param {requestResponseList} targetStorage
       * @returns {requestResponseList}
       */
      #queryCache(requestQuery, options, targetStorage) {
        const resultList = [];
        const storage = targetStorage ?? this.#relevantRequestResponseList;
        for (const requestResponse of storage) {
          const [cachedRequest, cachedResponse] = requestResponse;
          if (this.#requestMatchesCachedItem(requestQuery, cachedRequest, cachedResponse, options)) {
            resultList.push(requestResponse);
          }
        }
        return resultList;
      }
      /**
       * @see https://w3c.github.io/ServiceWorker/#request-matches-cached-item-algorithm
       * @param {any} requestQuery
       * @param {any} request
       * @param {any | null} response
       * @param {import('../../../types/cache').CacheQueryOptions | undefined} options
       * @returns {boolean}
       */
      #requestMatchesCachedItem(requestQuery, request4, response = null, options) {
        const queryURL = new URL(requestQuery.url);
        const cachedURL = new URL(request4.url);
        if (options?.ignoreSearch) {
          cachedURL.search = "";
          queryURL.search = "";
        }
        if (!urlEquals(queryURL, cachedURL, true)) {
          return false;
        }
        if (response == null || options?.ignoreVary || !response.headersList.contains("vary")) {
          return true;
        }
        const fieldValues = getFieldValues(response.headersList.get("vary"));
        for (const fieldValue of fieldValues) {
          if (fieldValue === "*") {
            return false;
          }
          const requestValue = request4.headersList.get(fieldValue);
          const queryValue = requestQuery.headersList.get(fieldValue);
          if (requestValue !== queryValue) {
            return false;
          }
        }
        return true;
      }
      #internalMatchAll(request4, options, maxResponses = Infinity) {
        let r10 = null;
        if (request4 !== void 0) {
          if (webidl.is.Request(request4)) {
            r10 = getRequestState(request4);
            if (r10.method !== "GET" && !options.ignoreMethod) {
              return [];
            }
          } else if (typeof request4 === "string") {
            r10 = getRequestState(new Request7(request4));
          }
        }
        const responses = [];
        if (request4 === void 0) {
          for (const requestResponse of this.#relevantRequestResponseList) {
            responses.push(requestResponse[1]);
          }
        } else {
          const requestResponses = this.#queryCache(r10, options);
          for (const requestResponse of requestResponses) {
            responses.push(requestResponse[1]);
          }
        }
        const responseList = [];
        for (const response of responses) {
          const responseObject = fromInnerResponse(cloneResponse(response), "immutable");
          responseList.push(responseObject);
          if (responseList.length >= maxResponses) {
            break;
          }
        }
        return Object.freeze(responseList);
      }
    };
    Object.defineProperties(Cache3.prototype, {
      [Symbol.toStringTag]: {
        value: "Cache",
        configurable: true
      },
      match: kEnumerableProperty,
      matchAll: kEnumerableProperty,
      add: kEnumerableProperty,
      addAll: kEnumerableProperty,
      put: kEnumerableProperty,
      delete: kEnumerableProperty,
      keys: kEnumerableProperty
    });
    var cacheQueryOptionConverters = [
      {
        key: "ignoreSearch",
        converter: webidl.converters.boolean,
        defaultValue: /* @__PURE__ */ __name(() => false, "defaultValue")
      },
      {
        key: "ignoreMethod",
        converter: webidl.converters.boolean,
        defaultValue: /* @__PURE__ */ __name(() => false, "defaultValue")
      },
      {
        key: "ignoreVary",
        converter: webidl.converters.boolean,
        defaultValue: /* @__PURE__ */ __name(() => false, "defaultValue")
      }
    ];
    webidl.converters.CacheQueryOptions = webidl.dictionaryConverter(cacheQueryOptionConverters);
    webidl.converters.MultiCacheQueryOptions = webidl.dictionaryConverter([
      ...cacheQueryOptionConverters,
      {
        key: "cacheName",
        converter: webidl.converters.DOMString
      }
    ]);
    webidl.converters.Response = webidl.interfaceConverter(
      webidl.is.Response,
      "Response"
    );
    webidl.converters["sequence<RequestInfo>"] = webidl.sequenceConverter(
      webidl.converters.RequestInfo
    );
    module2.exports = {
      Cache: Cache3
    };
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/web/cache/cachestorage.js
var require_cachestorage = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/web/cache/cachestorage.js"(exports, module2) {
    init_import_meta_url();
    var { Cache: Cache3 } = require_cache3();
    var { webidl } = require_webidl();
    var { kEnumerableProperty } = require_util();
    var { kConstruct } = require_symbols();
    var CacheStorage2 = class _CacheStorage {
      static {
        __name(this, "CacheStorage");
      }
      /**
       * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-name-to-cache-map
       * @type {Map<string, import('./cache').requestResponseList}
       */
      #caches = /* @__PURE__ */ new Map();
      constructor() {
        if (arguments[0] !== kConstruct) {
          webidl.illegalConstructor();
        }
        webidl.util.markAsUncloneable(this);
      }
      async match(request4, options = {}) {
        webidl.brandCheck(this, _CacheStorage);
        webidl.argumentLengthCheck(arguments, 1, "CacheStorage.match");
        request4 = webidl.converters.RequestInfo(request4);
        options = webidl.converters.MultiCacheQueryOptions(options);
        if (options.cacheName != null) {
          if (this.#caches.has(options.cacheName)) {
            const cacheList = this.#caches.get(options.cacheName);
            const cache5 = new Cache3(kConstruct, cacheList);
            return await cache5.match(request4, options);
          }
        } else {
          for (const cacheList of this.#caches.values()) {
            const cache5 = new Cache3(kConstruct, cacheList);
            const response = await cache5.match(request4, options);
            if (response !== void 0) {
              return response;
            }
          }
        }
      }
      /**
       * @see https://w3c.github.io/ServiceWorker/#cache-storage-has
       * @param {string} cacheName
       * @returns {Promise<boolean>}
       */
      async has(cacheName) {
        webidl.brandCheck(this, _CacheStorage);
        const prefix = "CacheStorage.has";
        webidl.argumentLengthCheck(arguments, 1, prefix);
        cacheName = webidl.converters.DOMString(cacheName, prefix, "cacheName");
        return this.#caches.has(cacheName);
      }
      /**
       * @see https://w3c.github.io/ServiceWorker/#dom-cachestorage-open
       * @param {string} cacheName
       * @returns {Promise<Cache>}
       */
      async open(cacheName) {
        webidl.brandCheck(this, _CacheStorage);
        const prefix = "CacheStorage.open";
        webidl.argumentLengthCheck(arguments, 1, prefix);
        cacheName = webidl.converters.DOMString(cacheName, prefix, "cacheName");
        if (this.#caches.has(cacheName)) {
          const cache6 = this.#caches.get(cacheName);
          return new Cache3(kConstruct, cache6);
        }
        const cache5 = [];
        this.#caches.set(cacheName, cache5);
        return new Cache3(kConstruct, cache5);
      }
      /**
       * @see https://w3c.github.io/ServiceWorker/#cache-storage-delete
       * @param {string} cacheName
       * @returns {Promise<boolean>}
       */
      async delete(cacheName) {
        webidl.brandCheck(this, _CacheStorage);
        const prefix = "CacheStorage.delete";
        webidl.argumentLengthCheck(arguments, 1, prefix);
        cacheName = webidl.converters.DOMString(cacheName, prefix, "cacheName");
        return this.#caches.delete(cacheName);
      }
      /**
       * @see https://w3c.github.io/ServiceWorker/#cache-storage-keys
       * @returns {Promise<string[]>}
       */
      async keys() {
        webidl.brandCheck(this, _CacheStorage);
        const keys = this.#caches.keys();
        return [...keys];
      }
    };
    Object.defineProperties(CacheStorage2.prototype, {
      [Symbol.toStringTag]: {
        value: "CacheStorage",
        configurable: true
      },
      match: kEnumerableProperty,
      has: kEnumerableProperty,
      open: kEnumerableProperty,
      delete: kEnumerableProperty,
      keys: kEnumerableProperty
    });
    module2.exports = {
      CacheStorage: CacheStorage2
    };
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/web/cookies/constants.js
var require_constants4 = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/web/cookies/constants.js"(exports, module2) {
    init_import_meta_url();
    var maxAttributeValueSize = 1024;
    var maxNameValuePairSize = 4096;
    module2.exports = {
      maxAttributeValueSize,
      maxNameValuePairSize
    };
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/web/cookies/util.js
var require_util4 = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/web/cookies/util.js"(exports, module2) {
    init_import_meta_url();
    function isCTLExcludingHtab(value) {
      for (let i7 = 0; i7 < value.length; ++i7) {
        const code = value.charCodeAt(i7);
        if (code >= 0 && code <= 8 || code >= 10 && code <= 31 || code === 127) {
          return true;
        }
      }
      return false;
    }
    __name(isCTLExcludingHtab, "isCTLExcludingHtab");
    function validateCookieName(name2) {
      for (let i7 = 0; i7 < name2.length; ++i7) {
        const code = name2.charCodeAt(i7);
        if (code < 33 || // exclude CTLs (0-31), SP and HT
        code > 126 || // exclude non-ascii and DEL
        code === 34 || // "
        code === 40 || // (
        code === 41 || // )
        code === 60 || // <
        code === 62 || // >
        code === 64 || // @
        code === 44 || // ,
        code === 59 || // ;
        code === 58 || // :
        code === 92 || // \
        code === 47 || // /
        code === 91 || // [
        code === 93 || // ]
        code === 63 || // ?
        code === 61 || // =
        code === 123 || // {
        code === 125) {
          throw new Error("Invalid cookie name");
        }
      }
    }
    __name(validateCookieName, "validateCookieName");
    function validateCookieValue(value) {
      let len = value.length;
      let i7 = 0;
      if (value[0] === '"') {
        if (len === 1 || value[len - 1] !== '"') {
          throw new Error("Invalid cookie value");
        }
        --len;
        ++i7;
      }
      while (i7 < len) {
        const code = value.charCodeAt(i7++);
        if (code < 33 || // exclude CTLs (0-31)
        code > 126 || // non-ascii and DEL (127)
        code === 34 || // "
        code === 44 || // ,
        code === 59 || // ;
        code === 92) {
          throw new Error("Invalid cookie value");
        }
      }
    }
    __name(validateCookieValue, "validateCookieValue");
    function validateCookiePath(path84) {
      for (let i7 = 0; i7 < path84.length; ++i7) {
        const code = path84.charCodeAt(i7);
        if (code < 32 || // exclude CTLs (0-31)
        code === 127 || // DEL
        code === 59) {
          throw new Error("Invalid cookie path");
        }
      }
    }
    __name(validateCookiePath, "validateCookiePath");
    function validateCookieDomain(domain2) {
      if (domain2.startsWith("-") || domain2.endsWith(".") || domain2.endsWith("-")) {
        throw new Error("Invalid cookie domain");
      }
    }
    __name(validateCookieDomain, "validateCookieDomain");
    var IMFDays = [
      "Sun",
      "Mon",
      "Tue",
      "Wed",
      "Thu",
      "Fri",
      "Sat"
    ];
    var IMFMonths = [
      "Jan",
      "Feb",
      "Mar",
      "Apr",
      "May",
      "Jun",
      "Jul",
      "Aug",
      "Sep",
      "Oct",
      "Nov",
      "Dec"
    ];
    var IMFPaddedNumbers = Array(61).fill(0).map((_5, i7) => i7.toString().padStart(2, "0"));
    function toIMFDate(date) {
      if (typeof date === "number") {
        date = new Date(date);
      }
      return `${IMFDays[date.getUTCDay()]}, ${IMFPaddedNumbers[date.getUTCDate()]} ${IMFMonths[date.getUTCMonth()]} ${date.getUTCFullYear()} ${IMFPaddedNumbers[date.getUTCHours()]}:${IMFPaddedNumbers[date.getUTCMinutes()]}:${IMFPaddedNumbers[date.getUTCSeconds()]} GMT`;
    }
    __name(toIMFDate, "toIMFDate");
    function validateCookieMaxAge(maxAge) {
      if (maxAge < 0) {
        throw new Error("Invalid cookie max-age");
      }
    }
    __name(validateCookieMaxAge, "validateCookieMaxAge");
    function stringify4(cookie) {
      if (cookie.name.length === 0) {
        return null;
      }
      validateCookieName(cookie.name);
      validateCookieValue(cookie.value);
      const out = [`${cookie.name}=${cookie.value}`];
      if (cookie.name.startsWith("__Secure-")) {
        cookie.secure = true;
      }
      if (cookie.name.startsWith("__Host-")) {
        cookie.secure = true;
        cookie.domain = null;
        cookie.path = "/";
      }
      if (cookie.secure) {
        out.push("Secure");
      }
      if (cookie.httpOnly) {
        out.push("HttpOnly");
      }
      if (typeof cookie.maxAge === "number") {
        validateCookieMaxAge(cookie.maxAge);
        out.push(`Max-Age=${cookie.maxAge}`);
      }
      if (cookie.domain) {
        validateCookieDomain(cookie.domain);
        out.push(`Domain=${cookie.domain}`);
      }
      if (cookie.path) {
        validateCookiePath(cookie.path);
        out.push(`Path=${cookie.path}`);
      }
      if (cookie.expires && cookie.expires.toString() !== "Invalid Date") {
        out.push(`Expires=${toIMFDate(cookie.expires)}`);
      }
      if (cookie.sameSite) {
        out.push(`SameSite=${cookie.sameSite}`);
      }
      for (const part of cookie.unparsed) {
        if (!part.includes("=")) {
          throw new Error("Invalid unparsed");
        }
        const [key, ...value] = part.split("=");
        out.push(`${key.trim()}=${value.join("=")}`);
      }
      return out.join("; ");
    }
    __name(stringify4, "stringify");
    module2.exports = {
      isCTLExcludingHtab,
      validateCookieName,
      validateCookiePath,
      validateCookieValue,
      toIMFDate,
      stringify: stringify4
    };
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/web/cookies/parse.js
var require_parse = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/web/cookies/parse.js"(exports, module2) {
    init_import_meta_url();
    var { collectASequenceOfCodePointsFast } = require_infra();
    var { maxNameValuePairSize, maxAttributeValueSize } = require_constants4();
    var { isCTLExcludingHtab } = require_util4();
    var assert61 = __require("assert");
    var { unescape: qsUnescape } = __require("querystring");
    function parseSetCookie(header) {
      if (isCTLExcludingHtab(header)) {
        return null;
      }
      let nameValuePair = "";
      let unparsedAttributes = "";
      let name2 = "";
      let value = "";
      if (header.includes(";")) {
        const position = { position: 0 };
        nameValuePair = collectASequenceOfCodePointsFast(";", header, position);
        unparsedAttributes = header.slice(position.position);
      } else {
        nameValuePair = header;
      }
      if (!nameValuePair.includes("=")) {
        value = nameValuePair;
      } else {
        const position = { position: 0 };
        name2 = collectASequenceOfCodePointsFast(
          "=",
          nameValuePair,
          position
        );
        value = nameValuePair.slice(position.position + 1);
      }
      name2 = name2.trim();
      value = value.trim();
      if (name2.length + value.length > maxNameValuePairSize) {
        return null;
      }
      return {
        name: name2,
        value: qsUnescape(value),
        ...parseUnparsedAttributes(unparsedAttributes)
      };
    }
    __name(parseSetCookie, "parseSetCookie");
    function parseUnparsedAttributes(unparsedAttributes, cookieAttributeList = {}) {
      if (unparsedAttributes.length === 0) {
        return cookieAttributeList;
      }
      assert61(unparsedAttributes[0] === ";");
      unparsedAttributes = unparsedAttributes.slice(1);
      let cookieAv = "";
      if (unparsedAttributes.includes(";")) {
        cookieAv = collectASequenceOfCodePointsFast(
          ";",
          unparsedAttributes,
          { position: 0 }
        );
        unparsedAttributes = unparsedAttributes.slice(cookieAv.length);
      } else {
        cookieAv = unparsedAttributes;
        unparsedAttributes = "";
      }
      let attributeName = "";
      let attributeValue = "";
      if (cookieAv.includes("=")) {
        const position = { position: 0 };
        attributeName = collectASequenceOfCodePointsFast(
          "=",
          cookieAv,
          position
        );
        attributeValue = cookieAv.slice(position.position + 1);
      } else {
        attributeName = cookieAv;
      }
      attributeName = attributeName.trim();
      attributeValue = attributeValue.trim();
      if (attributeValue.length > maxAttributeValueSize) {
        return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList);
      }
      const attributeNameLowercase = attributeName.toLowerCase();
      if (attributeNameLowercase === "expires") {
        const expiryTime = new Date(attributeValue);
        cookieAttributeList.expires = expiryTime;
      } else if (attributeNameLowercase === "max-age") {
        const charCode = attributeValue.charCodeAt(0);
        if ((charCode < 48 || charCode > 57) && attributeValue[0] !== "-") {
          return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList);
        }
        if (!/^\d+$/.test(attributeValue)) {
          return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList);
        }
        const deltaSeconds = Number(attributeValue);
        cookieAttributeList.maxAge = deltaSeconds;
      } else if (attributeNameLowercase === "domain") {
        let cookieDomain = attributeValue;
        if (cookieDomain[0] === ".") {
          cookieDomain = cookieDomain.slice(1);
        }
        cookieDomain = cookieDomain.toLowerCase();
        cookieAttributeList.domain = cookieDomain;
      } else if (attributeNameLowercase === "path") {
        let cookiePath = "";
        if (attributeValue.length === 0 || attributeValue[0] !== "/") {
          cookiePath = "/";
        } else {
          cookiePath = attributeValue;
        }
        cookieAttributeList.path = cookiePath;
      } else if (attributeNameLowercase === "secure") {
        cookieAttributeList.secure = true;
      } else if (attributeNameLowercase === "httponly") {
        cookieAttributeList.httpOnly = true;
      } else if (attributeNameLowercase === "samesite") {
        let enforcement = "Default";
        const attributeValueLowercase = attributeValue.toLowerCase();
        if (attributeValueLowercase.includes("none")) {
          enforcement = "None";
        }
        if (attributeValueLowercase.includes("strict")) {
          enforcement = "Strict";
        }
        if (attributeValueLowercase.includes("lax")) {
          enforcement = "Lax";
        }
        cookieAttributeList.sameSite = enforcement;
      } else {
        cookieAttributeList.unparsed ??= [];
        cookieAttributeList.unparsed.push(`${attributeName}=${attributeValue}`);
      }
      return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList);
    }
    __name(parseUnparsedAttributes, "parseUnparsedAttributes");
    module2.exports = {
      parseSetCookie,
      parseUnparsedAttributes
    };
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/web/cookies/index.js
var require_cookies = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/web/cookies/index.js"(exports, module2) {
    init_import_meta_url();
    var { parseSetCookie } = require_parse();
    var { stringify: stringify4 } = require_util4();
    var { webidl } = require_webidl();
    var { Headers: Headers5 } = require_headers();
    var brandChecks = webidl.brandCheckMultiple([Headers5, globalThis.Headers].filter(Boolean));
    function getCookies(headers) {
      webidl.argumentLengthCheck(arguments, 1, "getCookies");
      brandChecks(headers);
      const cookie = headers.get("cookie");
      const out = {};
      if (!cookie) {
        return out;
      }
      for (const piece of cookie.split(";")) {
        const [name2, ...value] = piece.split("=");
        out[name2.trim()] = value.join("=");
      }
      return out;
    }
    __name(getCookies, "getCookies");
    function deleteCookie(headers, name2, attributes) {
      brandChecks(headers);
      const prefix = "deleteCookie";
      webidl.argumentLengthCheck(arguments, 2, prefix);
      name2 = webidl.converters.DOMString(name2, prefix, "name");
      attributes = webidl.converters.DeleteCookieAttributes(attributes);
      setCookie(headers, {
        name: name2,
        value: "",
        expires: /* @__PURE__ */ new Date(0),
        ...attributes
      });
    }
    __name(deleteCookie, "deleteCookie");
    function getSetCookies(headers) {
      webidl.argumentLengthCheck(arguments, 1, "getSetCookies");
      brandChecks(headers);
      const cookies = headers.getSetCookie();
      if (!cookies) {
        return [];
      }
      return cookies.map((pair) => parseSetCookie(pair));
    }
    __name(getSetCookies, "getSetCookies");
    function parseCookie2(cookie) {
      cookie = webidl.converters.DOMString(cookie);
      return parseSetCookie(cookie);
    }
    __name(parseCookie2, "parseCookie");
    function setCookie(headers, cookie) {
      webidl.argumentLengthCheck(arguments, 2, "setCookie");
      brandChecks(headers);
      cookie = webidl.converters.Cookie(cookie);
      const str = stringify4(cookie);
      if (str) {
        headers.append("set-cookie", str, true);
      }
    }
    __name(setCookie, "setCookie");
    webidl.converters.DeleteCookieAttributes = webidl.dictionaryConverter([
      {
        converter: webidl.nullableConverter(webidl.converters.DOMString),
        key: "path",
        defaultValue: /* @__PURE__ */ __name(() => null, "defaultValue")
      },
      {
        converter: webidl.nullableConverter(webidl.converters.DOMString),
        key: "domain",
        defaultValue: /* @__PURE__ */ __name(() => null, "defaultValue")
      }
    ]);
    webidl.converters.Cookie = webidl.dictionaryConverter([
      {
        converter: webidl.converters.DOMString,
        key: "name"
      },
      {
        converter: webidl.converters.DOMString,
        key: "value"
      },
      {
        converter: webidl.nullableConverter((value) => {
          if (typeof value === "number") {
            return webidl.converters["unsigned long long"](value);
          }
          return new Date(value);
        }),
        key: "expires",
        defaultValue: /* @__PURE__ */ __name(() => null, "defaultValue")
      },
      {
        converter: webidl.nullableConverter(webidl.converters["long long"]),
        key: "maxAge",
        defaultValue: /* @__PURE__ */ __name(() => null, "defaultValue")
      },
      {
        converter: webidl.nullableConverter(webidl.converters.DOMString),
        key: "domain",
        defaultValue: /* @__PURE__ */ __name(() => null, "defaultValue")
      },
      {
        converter: webidl.nullableConverter(webidl.converters.DOMString),
        key: "path",
        defaultValue: /* @__PURE__ */ __name(() => null, "defaultValue")
      },
      {
        converter: webidl.nullableConverter(webidl.converters.boolean),
        key: "secure",
        defaultValue: /* @__PURE__ */ __name(() => null, "defaultValue")
      },
      {
        converter: webidl.nullableConverter(webidl.converters.boolean),
        key: "httpOnly",
        defaultValue: /* @__PURE__ */ __name(() => null, "defaultValue")
      },
      {
        converter: webidl.converters.USVString,
        key: "sameSite",
        allowedValues: ["Strict", "Lax", "None"]
      },
      {
        converter: webidl.sequenceConverter(webidl.converters.DOMString),
        key: "unparsed",
        defaultValue: /* @__PURE__ */ __name(() => [], "defaultValue")
      }
    ]);
    module2.exports = {
      getCookies,
      deleteCookie,
      getSetCookies,
      setCookie,
      parseCookie: parseCookie2
    };
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/web/websocket/events.js
var require_events = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/web/websocket/events.js"(exports, module2) {
    init_import_meta_url();
    var { webidl } = require_webidl();
    var { kEnumerableProperty } = require_util();
    var { kConstruct } = require_symbols();
    var MessageEvent = class _MessageEvent extends Event {
      static {
        __name(this, "MessageEvent");
      }
      #eventInit;
      constructor(type, eventInitDict = {}) {
        if (type === kConstruct) {
          super(arguments[1], arguments[2]);
          webidl.util.markAsUncloneable(this);
          return;
        }
        const prefix = "MessageEvent constructor";
        webidl.argumentLengthCheck(arguments, 1, prefix);
        type = webidl.converters.DOMString(type, prefix, "type");
        eventInitDict = webidl.converters.MessageEventInit(eventInitDict, prefix, "eventInitDict");
        super(type, eventInitDict);
        this.#eventInit = eventInitDict;
        webidl.util.markAsUncloneable(this);
      }
      get data() {
        webidl.brandCheck(this, _MessageEvent);
        return this.#eventInit.data;
      }
      get origin() {
        webidl.brandCheck(this, _MessageEvent);
        return this.#eventInit.origin;
      }
      get lastEventId() {
        webidl.brandCheck(this, _MessageEvent);
        return this.#eventInit.lastEventId;
      }
      get source() {
        webidl.brandCheck(this, _MessageEvent);
        return this.#eventInit.source;
      }
      get ports() {
        webidl.brandCheck(this, _MessageEvent);
        if (!Object.isFrozen(this.#eventInit.ports)) {
          Object.freeze(this.#eventInit.ports);
        }
        return this.#eventInit.ports;
      }
      initMessageEvent(type, bubbles = false, cancelable = false, data = null, origin = "", lastEventId2 = "", source = null, ports = []) {
        webidl.brandCheck(this, _MessageEvent);
        webidl.argumentLengthCheck(arguments, 1, "MessageEvent.initMessageEvent");
        return new _MessageEvent(type, {
          bubbles,
          cancelable,
          data,
          origin,
          lastEventId: lastEventId2,
          source,
          ports
        });
      }
      static createFastMessageEvent(type, init4) {
        const messageEvent = new _MessageEvent(kConstruct, type, init4);
        messageEvent.#eventInit = init4;
        messageEvent.#eventInit.data ??= null;
        messageEvent.#eventInit.origin ??= "";
        messageEvent.#eventInit.lastEventId ??= "";
        messageEvent.#eventInit.source ??= null;
        messageEvent.#eventInit.ports ??= [];
        return messageEvent;
      }
    };
    var { createFastMessageEvent } = MessageEvent;
    delete MessageEvent.createFastMessageEvent;
    var CloseEvent = class _CloseEvent extends Event {
      static {
        __name(this, "CloseEvent");
      }
      #eventInit;
      constructor(type, eventInitDict = {}) {
        const prefix = "CloseEvent constructor";
        webidl.argumentLengthCheck(arguments, 1, prefix);
        type = webidl.converters.DOMString(type, prefix, "type");
        eventInitDict = webidl.converters.CloseEventInit(eventInitDict);
        super(type, eventInitDict);
        this.#eventInit = eventInitDict;
        webidl.util.markAsUncloneable(this);
      }
      get wasClean() {
        webidl.brandCheck(this, _CloseEvent);
        return this.#eventInit.wasClean;
      }
      get code() {
        webidl.brandCheck(this, _CloseEvent);
        return this.#eventInit.code;
      }
      get reason() {
        webidl.brandCheck(this, _CloseEvent);
        return this.#eventInit.reason;
      }
    };
    var ErrorEvent = class _ErrorEvent extends Event {
      static {
        __name(this, "ErrorEvent");
      }
      #eventInit;
      constructor(type, eventInitDict) {
        const prefix = "ErrorEvent constructor";
        webidl.argumentLengthCheck(arguments, 1, prefix);
        super(type, eventInitDict);
        webidl.util.markAsUncloneable(this);
        type = webidl.converters.DOMString(type, prefix, "type");
        eventInitDict = webidl.converters.ErrorEventInit(eventInitDict ?? {});
        this.#eventInit = eventInitDict;
      }
      get message() {
        webidl.brandCheck(this, _ErrorEvent);
        return this.#eventInit.message;
      }
      get filename() {
        webidl.brandCheck(this, _ErrorEvent);
        return this.#eventInit.filename;
      }
      get lineno() {
        webidl.brandCheck(this, _ErrorEvent);
        return this.#eventInit.lineno;
      }
      get colno() {
        webidl.brandCheck(this, _ErrorEvent);
        return this.#eventInit.colno;
      }
      get error() {
        webidl.brandCheck(this, _ErrorEvent);
        return this.#eventInit.error;
      }
    };
    Object.defineProperties(MessageEvent.prototype, {
      [Symbol.toStringTag]: {
        value: "MessageEvent",
        configurable: true
      },
      data: kEnumerableProperty,
      origin: kEnumerableProperty,
      lastEventId: kEnumerableProperty,
      source: kEnumerableProperty,
      ports: kEnumerableProperty,
      initMessageEvent: kEnumerableProperty
    });
    Object.defineProperties(CloseEvent.prototype, {
      [Symbol.toStringTag]: {
        value: "CloseEvent",
        configurable: true
      },
      reason: kEnumerableProperty,
      code: kEnumerableProperty,
      wasClean: kEnumerableProperty
    });
    Object.defineProperties(ErrorEvent.prototype, {
      [Symbol.toStringTag]: {
        value: "ErrorEvent",
        configurable: true
      },
      message: kEnumerableProperty,
      filename: kEnumerableProperty,
      lineno: kEnumerableProperty,
      colno: kEnumerableProperty,
      error: kEnumerableProperty
    });
    webidl.converters.MessagePort = webidl.interfaceConverter(
      webidl.is.MessagePort,
      "MessagePort"
    );
    webidl.converters["sequence<MessagePort>"] = webidl.sequenceConverter(
      webidl.converters.MessagePort
    );
    var eventInit = [
      {
        key: "bubbles",
        converter: webidl.converters.boolean,
        defaultValue: /* @__PURE__ */ __name(() => false, "defaultValue")
      },
      {
        key: "cancelable",
        converter: webidl.converters.boolean,
        defaultValue: /* @__PURE__ */ __name(() => false, "defaultValue")
      },
      {
        key: "composed",
        converter: webidl.converters.boolean,
        defaultValue: /* @__PURE__ */ __name(() => false, "defaultValue")
      }
    ];
    webidl.converters.MessageEventInit = webidl.dictionaryConverter([
      ...eventInit,
      {
        key: "data",
        converter: webidl.converters.any,
        defaultValue: /* @__PURE__ */ __name(() => null, "defaultValue")
      },
      {
        key: "origin",
        converter: webidl.converters.USVString,
        defaultValue: /* @__PURE__ */ __name(() => "", "defaultValue")
      },
      {
        key: "lastEventId",
        converter: webidl.converters.DOMString,
        defaultValue: /* @__PURE__ */ __name(() => "", "defaultValue")
      },
      {
        key: "source",
        // Node doesn't implement WindowProxy or ServiceWorker, so the only
        // valid value for source is a MessagePort.
        converter: webidl.nullableConverter(webidl.converters.MessagePort),
        defaultValue: /* @__PURE__ */ __name(() => null, "defaultValue")
      },
      {
        key: "ports",
        converter: webidl.converters["sequence<MessagePort>"],
        defaultValue: /* @__PURE__ */ __name(() => [], "defaultValue")
      }
    ]);
    webidl.converters.CloseEventInit = webidl.dictionaryConverter([
      ...eventInit,
      {
        key: "wasClean",
        converter: webidl.converters.boolean,
        defaultValue: /* @__PURE__ */ __name(() => false, "defaultValue")
      },
      {
        key: "code",
        converter: webidl.converters["unsigned short"],
        defaultValue: /* @__PURE__ */ __name(() => 0, "defaultValue")
      },
      {
        key: "reason",
        converter: webidl.converters.USVString,
        defaultValue: /* @__PURE__ */ __name(() => "", "defaultValue")
      }
    ]);
    webidl.converters.ErrorEventInit = webidl.dictionaryConverter([
      ...eventInit,
      {
        key: "message",
        converter: webidl.converters.DOMString,
        defaultValue: /* @__PURE__ */ __name(() => "", "defaultValue")
      },
      {
        key: "filename",
        converter: webidl.converters.USVString,
        defaultValue: /* @__PURE__ */ __name(() => "", "defaultValue")
      },
      {
        key: "lineno",
        converter: webidl.converters["unsigned long"],
        defaultValue: /* @__PURE__ */ __name(() => 0, "defaultValue")
      },
      {
        key: "colno",
        converter: webidl.converters["unsigned long"],
        defaultValue: /* @__PURE__ */ __name(() => 0, "defaultValue")
      },
      {
        key: "error",
        converter: webidl.converters.any
      }
    ]);
    module2.exports = {
      MessageEvent,
      CloseEvent,
      ErrorEvent,
      createFastMessageEvent
    };
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/web/websocket/constants.js
var require_constants5 = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/web/websocket/constants.js"(exports, module2) {
    init_import_meta_url();
    var uid = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11";
    var staticPropertyDescriptors = {
      enumerable: true,
      writable: false,
      configurable: false
    };
    var states = {
      CONNECTING: 0,
      OPEN: 1,
      CLOSING: 2,
      CLOSED: 3
    };
    var sentCloseFrameState = {
      SENT: 1,
      RECEIVED: 2
    };
    var opcodes = {
      CONTINUATION: 0,
      TEXT: 1,
      BINARY: 2,
      CLOSE: 8,
      PING: 9,
      PONG: 10
    };
    var maxUnsigned16Bit = 65535;
    var parserStates = {
      INFO: 0,
      PAYLOADLENGTH_16: 2,
      PAYLOADLENGTH_64: 3,
      READ_DATA: 4
    };
    var emptyBuffer = Buffer.allocUnsafe(0);
    var sendHints = {
      text: 1,
      typedArray: 2,
      arrayBuffer: 3,
      blob: 4
    };
    module2.exports = {
      uid,
      sentCloseFrameState,
      staticPropertyDescriptors,
      states,
      opcodes,
      maxUnsigned16Bit,
      parserStates,
      emptyBuffer,
      sendHints
    };
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/web/websocket/util.js
var require_util5 = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/web/websocket/util.js"(exports, module2) {
    init_import_meta_url();
    var { states, opcodes } = require_constants5();
    var { isUtf8 } = __require("buffer");
    var { removeHTTPWhitespace } = require_data_url();
    var { collectASequenceOfCodePointsFast } = require_infra();
    function isConnecting(readyState) {
      return readyState === states.CONNECTING;
    }
    __name(isConnecting, "isConnecting");
    function isEstablished(readyState) {
      return readyState === states.OPEN;
    }
    __name(isEstablished, "isEstablished");
    function isClosing(readyState) {
      return readyState === states.CLOSING;
    }
    __name(isClosing, "isClosing");
    function isClosed(readyState) {
      return readyState === states.CLOSED;
    }
    __name(isClosed, "isClosed");
    function fireEvent(e10, target, eventFactory = (type, init4) => new Event(type, init4), eventInitDict = {}) {
      const event = eventFactory(e10, eventInitDict);
      target.dispatchEvent(event);
    }
    __name(fireEvent, "fireEvent");
    function websocketMessageReceived(handler, type, data) {
      handler.onMessage(type, data);
    }
    __name(websocketMessageReceived, "websocketMessageReceived");
    function toArrayBuffer(buffer) {
      if (buffer.byteLength === buffer.buffer.byteLength) {
        return buffer.buffer;
      }
      return new Uint8Array(buffer).buffer;
    }
    __name(toArrayBuffer, "toArrayBuffer");
    function isValidSubprotocol(protocol) {
      if (protocol.length === 0) {
        return false;
      }
      for (let i7 = 0; i7 < protocol.length; ++i7) {
        const code = protocol.charCodeAt(i7);
        if (code < 33 || // CTL, contains SP (0x20) and HT (0x09)
        code > 126 || code === 34 || // "
        code === 40 || // (
        code === 41 || // )
        code === 44 || // ,
        code === 47 || // /
        code === 58 || // :
        code === 59 || // ;
        code === 60 || // <
        code === 61 || // =
        code === 62 || // >
        code === 63 || // ?
        code === 64 || // @
        code === 91 || // [
        code === 92 || // \
        code === 93 || // ]
        code === 123 || // {
        code === 125) {
          return false;
        }
      }
      return true;
    }
    __name(isValidSubprotocol, "isValidSubprotocol");
    function isValidStatusCode(code) {
      if (code >= 1e3 && code < 1015) {
        return code !== 1004 && // reserved
        code !== 1005 && // "MUST NOT be set as a status code"
        code !== 1006;
      }
      return code >= 3e3 && code <= 4999;
    }
    __name(isValidStatusCode, "isValidStatusCode");
    function isControlFrame(opcode) {
      return opcode === opcodes.CLOSE || opcode === opcodes.PING || opcode === opcodes.PONG;
    }
    __name(isControlFrame, "isControlFrame");
    function isContinuationFrame(opcode) {
      return opcode === opcodes.CONTINUATION;
    }
    __name(isContinuationFrame, "isContinuationFrame");
    function isTextBinaryFrame(opcode) {
      return opcode === opcodes.TEXT || opcode === opcodes.BINARY;
    }
    __name(isTextBinaryFrame, "isTextBinaryFrame");
    function isValidOpcode(opcode) {
      return isTextBinaryFrame(opcode) || isContinuationFrame(opcode) || isControlFrame(opcode);
    }
    __name(isValidOpcode, "isValidOpcode");
    function parseExtensions(extensions) {
      const position = { position: 0 };
      const extensionList = /* @__PURE__ */ new Map();
      while (position.position < extensions.length) {
        const pair = collectASequenceOfCodePointsFast(";", extensions, position);
        const [name2, value = ""] = pair.split("=", 2);
        extensionList.set(
          removeHTTPWhitespace(name2, true, false),
          removeHTTPWhitespace(value, false, true)
        );
        position.position++;
      }
      return extensionList;
    }
    __name(parseExtensions, "parseExtensions");
    function isValidClientWindowBits(value) {
      if (value.length === 0) {
        return false;
      }
      for (let i7 = 0; i7 < value.length; i7++) {
        const byte = value.charCodeAt(i7);
        if (byte < 48 || byte > 57) {
          return false;
        }
      }
      const num = Number.parseInt(value, 10);
      return num >= 8 && num <= 15;
    }
    __name(isValidClientWindowBits, "isValidClientWindowBits");
    function getURLRecord(url4, baseURL) {
      let urlRecord;
      try {
        urlRecord = new URL(url4, baseURL);
      } catch (e10) {
        throw new DOMException(e10, "SyntaxError");
      }
      if (urlRecord.protocol === "http:") {
        urlRecord.protocol = "ws:";
      } else if (urlRecord.protocol === "https:") {
        urlRecord.protocol = "wss:";
      }
      if (urlRecord.protocol !== "ws:" && urlRecord.protocol !== "wss:") {
        throw new DOMException("expected a ws: or wss: url", "SyntaxError");
      }
      if (urlRecord.hash.length || urlRecord.href.endsWith("#")) {
        throw new DOMException("hash", "SyntaxError");
      }
      return urlRecord;
    }
    __name(getURLRecord, "getURLRecord");
    function validateCloseCodeAndReason(code, reason) {
      if (code !== null) {
        if (code !== 1e3 && (code < 3e3 || code > 4999)) {
          throw new DOMException("invalid code", "InvalidAccessError");
        }
      }
      if (reason !== null) {
        const reasonBytesLength = Buffer.byteLength(reason);
        if (reasonBytesLength > 123) {
          throw new DOMException(`Reason must be less than 123 bytes; received ${reasonBytesLength}`, "SyntaxError");
        }
      }
    }
    __name(validateCloseCodeAndReason, "validateCloseCodeAndReason");
    var utf8Decode = (() => {
      if (typeof process.versions.icu === "string") {
        const fatalDecoder = new TextDecoder("utf-8", { fatal: true });
        return fatalDecoder.decode.bind(fatalDecoder);
      }
      return function(buffer) {
        if (isUtf8(buffer)) {
          return buffer.toString("utf-8");
        }
        throw new TypeError("Invalid utf-8 received.");
      };
    })();
    module2.exports = {
      isConnecting,
      isEstablished,
      isClosing,
      isClosed,
      fireEvent,
      isValidSubprotocol,
      isValidStatusCode,
      websocketMessageReceived,
      utf8Decode,
      isControlFrame,
      isContinuationFrame,
      isTextBinaryFrame,
      isValidOpcode,
      parseExtensions,
      isValidClientWindowBits,
      toArrayBuffer,
      getURLRecord,
      validateCloseCodeAndReason
    };
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/web/websocket/frame.js
var require_frame = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/web/websocket/frame.js"(exports, module2) {
    init_import_meta_url();
    var { runtimeFeatures } = require_runtime_features();
    var { maxUnsigned16Bit, opcodes } = require_constants5();
    var BUFFER_SIZE = 8 * 1024;
    var buffer = null;
    var bufIdx = BUFFER_SIZE;
    var randomFillSync = runtimeFeatures.has("crypto") ? __require("crypto").randomFillSync : /* @__PURE__ */ __name(function randomFillSync2(buffer2, _offset, _size) {
      for (let i7 = 0; i7 < buffer2.length; ++i7) {
        buffer2[i7] = Math.random() * 255 | 0;
      }
      return buffer2;
    }, "randomFillSync");
    function generateMask() {
      if (bufIdx === BUFFER_SIZE) {
        bufIdx = 0;
        randomFillSync(buffer ??= Buffer.allocUnsafeSlow(BUFFER_SIZE), 0, BUFFER_SIZE);
      }
      return [buffer[bufIdx++], buffer[bufIdx++], buffer[bufIdx++], buffer[bufIdx++]];
    }
    __name(generateMask, "generateMask");
    var WebsocketFrameSend = class {
      static {
        __name(this, "WebsocketFrameSend");
      }
      /**
       * @param {Buffer|undefined} data
       */
      constructor(data) {
        this.frameData = data;
      }
      createFrame(opcode) {
        const frameData = this.frameData;
        const maskKey = generateMask();
        const bodyLength = frameData?.byteLength ?? 0;
        let payloadLength = bodyLength;
        let offset = 6;
        if (bodyLength > maxUnsigned16Bit) {
          offset += 8;
          payloadLength = 127;
        } else if (bodyLength > 125) {
          offset += 2;
          payloadLength = 126;
        }
        const buffer2 = Buffer.allocUnsafe(bodyLength + offset);
        buffer2[0] = buffer2[1] = 0;
        buffer2[0] |= 128;
        buffer2[0] = (buffer2[0] & 240) + opcode;
        buffer2[offset - 4] = maskKey[0];
        buffer2[offset - 3] = maskKey[1];
        buffer2[offset - 2] = maskKey[2];
        buffer2[offset - 1] = maskKey[3];
        buffer2[1] = payloadLength;
        if (payloadLength === 126) {
          buffer2.writeUInt16BE(bodyLength, 2);
        } else if (payloadLength === 127) {
          buffer2[2] = buffer2[3] = 0;
          buffer2.writeUIntBE(bodyLength, 4, 6);
        }
        buffer2[1] |= 128;
        for (let i7 = 0; i7 < bodyLength; ++i7) {
          buffer2[offset + i7] = frameData[i7] ^ maskKey[i7 & 3];
        }
        return buffer2;
      }
      /**
       * @param {Uint8Array} buffer
       */
      static createFastTextFrame(buffer2) {
        const maskKey = generateMask();
        const bodyLength = buffer2.length;
        for (let i7 = 0; i7 < bodyLength; ++i7) {
          buffer2[i7] ^= maskKey[i7 & 3];
        }
        let payloadLength = bodyLength;
        let offset = 6;
        if (bodyLength > maxUnsigned16Bit) {
          offset += 8;
          payloadLength = 127;
        } else if (bodyLength > 125) {
          offset += 2;
          payloadLength = 126;
        }
        const head = Buffer.allocUnsafeSlow(offset);
        head[0] = 128 | opcodes.TEXT;
        head[1] = payloadLength | 128;
        head[offset - 4] = maskKey[0];
        head[offset - 3] = maskKey[1];
        head[offset - 2] = maskKey[2];
        head[offset - 1] = maskKey[3];
        if (payloadLength === 126) {
          head.writeUInt16BE(bodyLength, 2);
        } else if (payloadLength === 127) {
          head[2] = head[3] = 0;
          head.writeUIntBE(bodyLength, 4, 6);
        }
        return [head, buffer2];
      }
    };
    module2.exports = {
      WebsocketFrameSend,
      generateMask
      // for benchmark
    };
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/web/websocket/connection.js
var require_connection = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/web/websocket/connection.js"(exports, module2) {
    init_import_meta_url();
    var { uid, states, sentCloseFrameState, emptyBuffer, opcodes } = require_constants5();
    var { parseExtensions, isClosed, isClosing, isEstablished, isConnecting, validateCloseCodeAndReason } = require_util5();
    var { makeRequest } = require_request2();
    var { fetching } = require_fetch();
    var { Headers: Headers5, getHeadersList } = require_headers();
    var { getDecodeSplit } = require_util2();
    var { WebsocketFrameSend } = require_frame();
    var assert61 = __require("assert");
    var { runtimeFeatures } = require_runtime_features();
    var crypto9 = runtimeFeatures.has("crypto") ? __require("crypto") : null;
    var warningEmitted2 = false;
    function establishWebSocketConnection(url4, protocols, client, handler, options) {
      const requestURL = url4;
      requestURL.protocol = url4.protocol === "ws:" ? "http:" : "https:";
      const request4 = makeRequest({
        urlList: [requestURL],
        client,
        serviceWorkers: "none",
        referrer: "no-referrer",
        mode: "websocket",
        credentials: "include",
        cache: "no-store",
        redirect: "error",
        useURLCredentials: true
      });
      if (options.headers) {
        const headersList = getHeadersList(new Headers5(options.headers));
        request4.headersList = headersList;
      }
      const keyValue = crypto9.randomBytes(16).toString("base64");
      request4.headersList.append("sec-websocket-key", keyValue, true);
      request4.headersList.append("sec-websocket-version", "13", true);
      for (const protocol of protocols) {
        request4.headersList.append("sec-websocket-protocol", protocol, true);
      }
      const permessageDeflate = "permessage-deflate; client_max_window_bits";
      request4.headersList.append("sec-websocket-extensions", permessageDeflate, true);
      const controller = fetching({
        request: request4,
        useParallelQueue: true,
        dispatcher: options.dispatcher,
        processResponse(response) {
          if (response.type === "error" || response.status !== 101) {
            if (response.socket?.session == null) {
              failWebsocketConnection(handler, 1002, "Received network error or non-101 status code.", response.error);
              return;
            }
            if (response.status !== 200) {
              failWebsocketConnection(handler, 1002, "Received network error or non-200 status code.", response.error);
              return;
            }
          }
          if (warningEmitted2 === false && response.socket?.session != null) {
            process.emitWarning("WebSocket over HTTP2 is experimental, and subject to change.", "ExperimentalWarning");
            warningEmitted2 = true;
          }
          if (protocols.length !== 0 && !response.headersList.get("Sec-WebSocket-Protocol")) {
            failWebsocketConnection(handler, 1002, "Server did not respond with sent protocols.");
            return;
          }
          if (response.socket.session == null && response.headersList.get("Upgrade")?.toLowerCase() !== "websocket") {
            failWebsocketConnection(handler, 1002, 'Server did not set Upgrade header to "websocket".');
            return;
          }
          if (response.socket.session == null && response.headersList.get("Connection")?.toLowerCase() !== "upgrade") {
            failWebsocketConnection(handler, 1002, 'Server did not set Connection header to "upgrade".');
            return;
          }
          const secWSAccept = response.headersList.get("Sec-WebSocket-Accept");
          const digest = crypto9.hash("sha1", keyValue + uid, "base64");
          if (secWSAccept !== digest) {
            failWebsocketConnection(handler, 1002, "Incorrect hash received in Sec-WebSocket-Accept header.");
            return;
          }
          const secExtension = response.headersList.get("Sec-WebSocket-Extensions");
          let extensions;
          if (secExtension !== null) {
            extensions = parseExtensions(secExtension);
            if (!extensions.has("permessage-deflate")) {
              failWebsocketConnection(handler, 1002, "Sec-WebSocket-Extensions header does not match.");
              return;
            }
          }
          const secProtocol = response.headersList.get("Sec-WebSocket-Protocol");
          if (secProtocol !== null) {
            const requestProtocols = getDecodeSplit("sec-websocket-protocol", request4.headersList);
            if (!requestProtocols.includes(secProtocol)) {
              failWebsocketConnection(handler, 1002, "Protocol was not set in the opening handshake.");
              return;
            }
          }
          response.socket.on("data", handler.onSocketData);
          response.socket.on("close", handler.onSocketClose);
          response.socket.on("error", handler.onSocketError);
          handler.wasEverConnected = true;
          handler.onConnectionEstablished(response, extensions);
        }
      });
      return controller;
    }
    __name(establishWebSocketConnection, "establishWebSocketConnection");
    function closeWebSocketConnection(object, code, reason, validate3 = false) {
      code ??= null;
      reason ??= "";
      if (validate3) validateCloseCodeAndReason(code, reason);
      if (isClosed(object.readyState) || isClosing(object.readyState)) ; else if (!isEstablished(object.readyState)) {
        failWebsocketConnection(object);
        object.readyState = states.CLOSING;
      } else if (!object.closeState.has(sentCloseFrameState.SENT) && !object.closeState.has(sentCloseFrameState.RECEIVED)) {
        const frame = new WebsocketFrameSend();
        if (reason.length !== 0 && code === null) {
          code = 1e3;
        }
        assert61(code === null || Number.isInteger(code));
        if (code === null && reason.length === 0) {
          frame.frameData = emptyBuffer;
        } else if (code !== null && reason === null) {
          frame.frameData = Buffer.allocUnsafe(2);
          frame.frameData.writeUInt16BE(code, 0);
        } else if (code !== null && reason !== null) {
          frame.frameData = Buffer.allocUnsafe(2 + Buffer.byteLength(reason));
          frame.frameData.writeUInt16BE(code, 0);
          frame.frameData.write(reason, 2, "utf-8");
        } else {
          frame.frameData = emptyBuffer;
        }
        object.socket.write(frame.createFrame(opcodes.CLOSE));
        object.closeState.add(sentCloseFrameState.SENT);
        object.readyState = states.CLOSING;
      } else {
        object.readyState = states.CLOSING;
      }
    }
    __name(closeWebSocketConnection, "closeWebSocketConnection");
    function failWebsocketConnection(handler, code, reason, cause) {
      if (isEstablished(handler.readyState)) {
        closeWebSocketConnection(handler, code, reason, false);
      }
      handler.controller.abort();
      if (isConnecting(handler.readyState)) {
        handler.onSocketClose();
      } else if (handler.socket?.destroyed === false) {
        handler.socket.destroy();
      }
    }
    __name(failWebsocketConnection, "failWebsocketConnection");
    module2.exports = {
      establishWebSocketConnection,
      failWebsocketConnection,
      closeWebSocketConnection
    };
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/web/websocket/permessage-deflate.js
var require_permessage_deflate = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/web/websocket/permessage-deflate.js"(exports, module2) {
    init_import_meta_url();
    var { createInflateRaw, Z_DEFAULT_WINDOWBITS } = __require("zlib");
    var { isValidClientWindowBits } = require_util5();
    var { MessageSizeExceededError } = require_errors();
    var tail = Buffer.from([0, 0, 255, 255]);
    var kBuffer = Symbol("kBuffer");
    var kLength = Symbol("kLength");
    var kDefaultMaxDecompressedSize = 4 * 1024 * 1024;
    var PerMessageDeflate = class {
      static {
        __name(this, "PerMessageDeflate");
      }
      /** @type {import('node:zlib').InflateRaw} */
      #inflate;
      #options = {};
      /** @type {boolean} */
      #aborted = false;
      /** @type {Function|null} */
      #currentCallback = null;
      /**
       * @param {Map<string, string>} extensions
       */
      constructor(extensions) {
        this.#options.serverNoContextTakeover = extensions.has("server_no_context_takeover");
        this.#options.serverMaxWindowBits = extensions.get("server_max_window_bits");
      }
      decompress(chunk, fin, callback) {
        if (this.#aborted) {
          callback(new MessageSizeExceededError());
          return;
        }
        if (!this.#inflate) {
          let windowBits = Z_DEFAULT_WINDOWBITS;
          if (this.#options.serverMaxWindowBits) {
            if (!isValidClientWindowBits(this.#options.serverMaxWindowBits)) {
              callback(new Error("Invalid server_max_window_bits"));
              return;
            }
            windowBits = Number.parseInt(this.#options.serverMaxWindowBits);
          }
          try {
            this.#inflate = createInflateRaw({ windowBits });
          } catch (err) {
            callback(err);
            return;
          }
          this.#inflate[kBuffer] = [];
          this.#inflate[kLength] = 0;
          this.#inflate.on("data", (data) => {
            if (this.#aborted) {
              return;
            }
            this.#inflate[kLength] += data.length;
            if (this.#inflate[kLength] > kDefaultMaxDecompressedSize) {
              this.#aborted = true;
              this.#inflate.removeAllListeners();
              this.#inflate.destroy();
              this.#inflate = null;
              if (this.#currentCallback) {
                const cb2 = this.#currentCallback;
                this.#currentCallback = null;
                cb2(new MessageSizeExceededError());
              }
              return;
            }
            this.#inflate[kBuffer].push(data);
          });
          this.#inflate.on("error", (err) => {
            this.#inflate = null;
            callback(err);
          });
        }
        this.#currentCallback = callback;
        this.#inflate.write(chunk);
        if (fin) {
          this.#inflate.write(tail);
        }
        this.#inflate.flush(() => {
          if (this.#aborted || !this.#inflate) {
            return;
          }
          const full = Buffer.concat(this.#inflate[kBuffer], this.#inflate[kLength]);
          this.#inflate[kBuffer].length = 0;
          this.#inflate[kLength] = 0;
          this.#currentCallback = null;
          callback(null, full);
        });
      }
    };
    module2.exports = { PerMessageDeflate };
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/web/websocket/receiver.js
var require_receiver = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/web/websocket/receiver.js"(exports, module2) {
    init_import_meta_url();
    var { Writable: Writable5 } = __require("stream");
    var assert61 = __require("assert");
    var { parserStates, opcodes, states, emptyBuffer, sentCloseFrameState } = require_constants5();
    var {
      isValidStatusCode,
      isValidOpcode,
      websocketMessageReceived,
      utf8Decode,
      isControlFrame,
      isTextBinaryFrame,
      isContinuationFrame
    } = require_util5();
    var { failWebsocketConnection } = require_connection();
    var { WebsocketFrameSend } = require_frame();
    var { PerMessageDeflate } = require_permessage_deflate();
    var { MessageSizeExceededError } = require_errors();
    var ByteParser = class extends Writable5 {
      static {
        __name(this, "ByteParser");
      }
      #buffers = [];
      #fragmentsBytes = 0;
      #byteOffset = 0;
      #loop = false;
      #state = parserStates.INFO;
      #info = {};
      #fragments = [];
      /** @type {Map<string, PerMessageDeflate>} */
      #extensions;
      /** @type {import('./websocket').Handler} */
      #handler;
      /**
       * @param {import('./websocket').Handler} handler
       * @param {Map<string, string>|null} extensions
       */
      constructor(handler, extensions) {
        super();
        this.#handler = handler;
        this.#extensions = extensions == null ? /* @__PURE__ */ new Map() : extensions;
        if (this.#extensions.has("permessage-deflate")) {
          this.#extensions.set("permessage-deflate", new PerMessageDeflate(extensions));
        }
      }
      /**
       * @param {Buffer} chunk
       * @param {() => void} callback
       */
      _write(chunk, _5, callback) {
        this.#buffers.push(chunk);
        this.#byteOffset += chunk.length;
        this.#loop = true;
        this.run(callback);
      }
      /**
       * Runs whenever a new chunk is received.
       * Callback is called whenever there are no more chunks buffering,
       * or not enough bytes are buffered to parse.
       */
      run(callback) {
        while (this.#loop) {
          if (this.#state === parserStates.INFO) {
            if (this.#byteOffset < 2) {
              return callback();
            }
            const buffer = this.consume(2);
            const fin = (buffer[0] & 128) !== 0;
            const opcode = buffer[0] & 15;
            const masked = (buffer[1] & 128) === 128;
            const fragmented = !fin && opcode !== opcodes.CONTINUATION;
            const payloadLength = buffer[1] & 127;
            const rsv1 = buffer[0] & 64;
            const rsv2 = buffer[0] & 32;
            const rsv3 = buffer[0] & 16;
            if (!isValidOpcode(opcode)) {
              failWebsocketConnection(this.#handler, 1002, "Invalid opcode received");
              return callback();
            }
            if (masked) {
              failWebsocketConnection(this.#handler, 1002, "Frame cannot be masked");
              return callback();
            }
            if (rsv1 !== 0 && !this.#extensions.has("permessage-deflate")) {
              failWebsocketConnection(this.#handler, 1002, "Expected RSV1 to be clear.");
              return;
            }
            if (rsv2 !== 0 || rsv3 !== 0) {
              failWebsocketConnection(this.#handler, 1002, "RSV1, RSV2, RSV3 must be clear");
              return;
            }
            if (fragmented && !isTextBinaryFrame(opcode)) {
              failWebsocketConnection(this.#handler, 1002, "Invalid frame type was fragmented.");
              return;
            }
            if (isTextBinaryFrame(opcode) && this.#fragments.length > 0) {
              failWebsocketConnection(this.#handler, 1002, "Expected continuation frame");
              return;
            }
            if (this.#info.fragmented && fragmented) {
              failWebsocketConnection(this.#handler, 1002, "Fragmented frame exceeded 125 bytes.");
              return;
            }
            if ((payloadLength > 125 || fragmented) && isControlFrame(opcode)) {
              failWebsocketConnection(this.#handler, 1002, "Control frame either too large or fragmented");
              return;
            }
            if (isContinuationFrame(opcode) && this.#fragments.length === 0 && !this.#info.compressed) {
              failWebsocketConnection(this.#handler, 1002, "Unexpected continuation frame");
              return;
            }
            if (payloadLength <= 125) {
              this.#info.payloadLength = payloadLength;
              this.#state = parserStates.READ_DATA;
            } else if (payloadLength === 126) {
              this.#state = parserStates.PAYLOADLENGTH_16;
            } else if (payloadLength === 127) {
              this.#state = parserStates.PAYLOADLENGTH_64;
            }
            if (isTextBinaryFrame(opcode)) {
              this.#info.binaryType = opcode;
              this.#info.compressed = rsv1 !== 0;
            }
            this.#info.opcode = opcode;
            this.#info.masked = masked;
            this.#info.fin = fin;
            this.#info.fragmented = fragmented;
          } else if (this.#state === parserStates.PAYLOADLENGTH_16) {
            if (this.#byteOffset < 2) {
              return callback();
            }
            const buffer = this.consume(2);
            this.#info.payloadLength = buffer.readUInt16BE(0);
            this.#state = parserStates.READ_DATA;
          } else if (this.#state === parserStates.PAYLOADLENGTH_64) {
            if (this.#byteOffset < 8) {
              return callback();
            }
            const buffer = this.consume(8);
            const upper = buffer.readUInt32BE(0);
            const lower = buffer.readUInt32BE(4);
            if (upper !== 0 || lower > 2 ** 31 - 1) {
              failWebsocketConnection(this.#handler, 1009, "Received payload length > 2^31 bytes.");
              return;
            }
            this.#info.payloadLength = lower;
            this.#state = parserStates.READ_DATA;
          } else if (this.#state === parserStates.READ_DATA) {
            if (this.#byteOffset < this.#info.payloadLength) {
              return callback();
            }
            const body = this.consume(this.#info.payloadLength);
            if (isControlFrame(this.#info.opcode)) {
              this.#loop = this.parseControlFrame(body);
              this.#state = parserStates.INFO;
            } else {
              if (!this.#info.compressed) {
                this.writeFragments(body);
                if (!this.#info.fragmented && this.#info.fin) {
                  websocketMessageReceived(this.#handler, this.#info.binaryType, this.consumeFragments());
                }
                this.#state = parserStates.INFO;
              } else {
                this.#extensions.get("permessage-deflate").decompress(body, this.#info.fin, (error2, data) => {
                  if (error2) {
                    const code = error2 instanceof MessageSizeExceededError ? 1009 : 1007;
                    failWebsocketConnection(this.#handler, code, error2.message);
                    return;
                  }
                  this.writeFragments(data);
                  if (!this.#info.fin) {
                    this.#state = parserStates.INFO;
                    this.#loop = true;
                    this.run(callback);
                    return;
                  }
                  websocketMessageReceived(this.#handler, this.#info.binaryType, this.consumeFragments());
                  this.#loop = true;
                  this.#state = parserStates.INFO;
                  this.run(callback);
                });
                this.#loop = false;
                break;
              }
            }
          }
        }
      }
      /**
       * Take n bytes from the buffered Buffers
       * @param {number} n
       * @returns {Buffer}
       */
      consume(n9) {
        if (n9 > this.#byteOffset) {
          throw new Error("Called consume() before buffers satiated.");
        } else if (n9 === 0) {
          return emptyBuffer;
        }
        this.#byteOffset -= n9;
        const first = this.#buffers[0];
        if (first.length > n9) {
          this.#buffers[0] = first.subarray(n9, first.length);
          return first.subarray(0, n9);
        } else if (first.length === n9) {
          return this.#buffers.shift();
        } else {
          let offset = 0;
          const buffer = Buffer.allocUnsafeSlow(n9);
          while (offset !== n9) {
            const next = this.#buffers[0];
            const length = next.length;
            if (length + offset === n9) {
              buffer.set(this.#buffers.shift(), offset);
              break;
            } else if (length + offset > n9) {
              buffer.set(next.subarray(0, n9 - offset), offset);
              this.#buffers[0] = next.subarray(n9 - offset);
              break;
            } else {
              buffer.set(this.#buffers.shift(), offset);
              offset += length;
            }
          }
          return buffer;
        }
      }
      writeFragments(fragment) {
        this.#fragmentsBytes += fragment.length;
        this.#fragments.push(fragment);
      }
      consumeFragments() {
        const fragments = this.#fragments;
        if (fragments.length === 1) {
          this.#fragmentsBytes = 0;
          return fragments.shift();
        }
        let offset = 0;
        const output = Buffer.allocUnsafeSlow(this.#fragmentsBytes);
        for (let i7 = 0; i7 < fragments.length; ++i7) {
          const buffer = fragments[i7];
          output.set(buffer, offset);
          offset += buffer.length;
        }
        this.#fragments = [];
        this.#fragmentsBytes = 0;
        return output;
      }
      parseCloseBody(data) {
        assert61(data.length !== 1);
        let code;
        if (data.length >= 2) {
          code = data.readUInt16BE(0);
        }
        if (code !== void 0 && !isValidStatusCode(code)) {
          return { code: 1002, reason: "Invalid status code", error: true };
        }
        let reason = data.subarray(2);
        if (reason[0] === 239 && reason[1] === 187 && reason[2] === 191) {
          reason = reason.subarray(3);
        }
        try {
          reason = utf8Decode(reason);
        } catch {
          return { code: 1007, reason: "Invalid UTF-8", error: true };
        }
        return { code, reason, error: false };
      }
      /**
       * Parses control frames.
       * @param {Buffer} body
       */
      parseControlFrame(body) {
        const { opcode, payloadLength } = this.#info;
        if (opcode === opcodes.CLOSE) {
          if (payloadLength === 1) {
            failWebsocketConnection(this.#handler, 1002, "Received close frame with a 1-byte body.");
            return false;
          }
          this.#info.closeInfo = this.parseCloseBody(body);
          if (this.#info.closeInfo.error) {
            const { code, reason } = this.#info.closeInfo;
            failWebsocketConnection(this.#handler, code, reason);
            return false;
          }
          if (!this.#handler.closeState.has(sentCloseFrameState.SENT) && !this.#handler.closeState.has(sentCloseFrameState.RECEIVED)) {
            let body2 = emptyBuffer;
            if (this.#info.closeInfo.code) {
              body2 = Buffer.allocUnsafe(2);
              body2.writeUInt16BE(this.#info.closeInfo.code, 0);
            }
            const closeFrame = new WebsocketFrameSend(body2);
            this.#handler.socket.write(closeFrame.createFrame(opcodes.CLOSE));
            this.#handler.closeState.add(sentCloseFrameState.SENT);
          }
          this.#handler.readyState = states.CLOSING;
          this.#handler.closeState.add(sentCloseFrameState.RECEIVED);
          return false;
        } else if (opcode === opcodes.PING) {
          if (!this.#handler.closeState.has(sentCloseFrameState.RECEIVED)) {
            const frame = new WebsocketFrameSend(body);
            this.#handler.socket.write(frame.createFrame(opcodes.PONG));
            this.#handler.onPing(body);
          }
        } else if (opcode === opcodes.PONG) {
          this.#handler.onPong(body);
        }
        return true;
      }
      get closingInfo() {
        return this.#info.closeInfo;
      }
    };
    module2.exports = {
      ByteParser
    };
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/web/websocket/sender.js
var require_sender = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/web/websocket/sender.js"(exports, module2) {
    init_import_meta_url();
    var { WebsocketFrameSend } = require_frame();
    var { opcodes, sendHints } = require_constants5();
    var FixedQueue = require_fixed_queue();
    var SendQueue = class {
      static {
        __name(this, "SendQueue");
      }
      /**
       * @type {FixedQueue}
       */
      #queue = new FixedQueue();
      /**
       * @type {boolean}
       */
      #running = false;
      /** @type {import('node:net').Socket} */
      #socket;
      constructor(socket) {
        this.#socket = socket;
      }
      add(item, cb2, hint) {
        if (hint !== sendHints.blob) {
          if (!this.#running) {
            if (hint === sendHints.text) {
              const { 0: head, 1: body } = WebsocketFrameSend.createFastTextFrame(item);
              this.#socket.cork();
              this.#socket.write(head);
              this.#socket.write(body, cb2);
              this.#socket.uncork();
            } else {
              this.#socket.write(createFrame(item, hint), cb2);
            }
          } else {
            const node3 = {
              promise: null,
              callback: cb2,
              frame: createFrame(item, hint)
            };
            this.#queue.push(node3);
          }
          return;
        }
        const node2 = {
          promise: item.arrayBuffer().then((ab2) => {
            node2.promise = null;
            node2.frame = createFrame(ab2, hint);
          }),
          callback: cb2,
          frame: null
        };
        this.#queue.push(node2);
        if (!this.#running) {
          this.#run();
        }
      }
      async #run() {
        this.#running = true;
        const queue = this.#queue;
        while (!queue.isEmpty()) {
          const node2 = queue.shift();
          if (node2.promise !== null) {
            await node2.promise;
          }
          this.#socket.write(node2.frame, node2.callback);
          node2.callback = node2.frame = null;
        }
        this.#running = false;
      }
    };
    function createFrame(data, hint) {
      return new WebsocketFrameSend(toBuffer(data, hint)).createFrame(hint === sendHints.text ? opcodes.TEXT : opcodes.BINARY);
    }
    __name(createFrame, "createFrame");
    function toBuffer(data, hint) {
      switch (hint) {
        case sendHints.text:
        case sendHints.typedArray:
          return new Uint8Array(data.buffer, data.byteOffset, data.byteLength);
        case sendHints.arrayBuffer:
        case sendHints.blob:
          return new Uint8Array(data);
      }
    }
    __name(toBuffer, "toBuffer");
    module2.exports = { SendQueue };
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/web/websocket/websocket.js
var require_websocket = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/web/websocket/websocket.js"(exports, module2) {
    init_import_meta_url();
    var { isArrayBuffer: isArrayBuffer3 } = __require("util/types");
    var { webidl } = require_webidl();
    var { URLSerializer } = require_data_url();
    var { environmentSettingsObject } = require_util2();
    var { staticPropertyDescriptors, states, sentCloseFrameState, sendHints, opcodes } = require_constants5();
    var {
      isConnecting,
      isEstablished,
      isClosing,
      isClosed,
      isValidSubprotocol,
      fireEvent,
      utf8Decode,
      toArrayBuffer,
      getURLRecord
    } = require_util5();
    var { establishWebSocketConnection, closeWebSocketConnection, failWebsocketConnection } = require_connection();
    var { ByteParser } = require_receiver();
    var { kEnumerableProperty } = require_util();
    var { getGlobalDispatcher: getGlobalDispatcher2 } = require_global2();
    var { ErrorEvent, CloseEvent, createFastMessageEvent } = require_events();
    var { SendQueue } = require_sender();
    var { WebsocketFrameSend } = require_frame();
    var { channels } = require_diagnostics();
    var WebSocket2 = class _WebSocket extends EventTarget {
      static {
        __name(this, "WebSocket");
      }
      #events = {
        open: null,
        error: null,
        close: null,
        message: null
      };
      #bufferedAmount = 0;
      #protocol = "";
      #extensions = "";
      /** @type {SendQueue} */
      #sendQueue;
      /** @type {Handler} */
      #handler = {
        onConnectionEstablished: /* @__PURE__ */ __name((response, extensions) => this.#onConnectionEstablished(response, extensions), "onConnectionEstablished"),
        onMessage: /* @__PURE__ */ __name((opcode, data) => this.#onMessage(opcode, data), "onMessage"),
        onParserError: /* @__PURE__ */ __name((err) => failWebsocketConnection(this.#handler, null, err.message), "onParserError"),
        onParserDrain: /* @__PURE__ */ __name(() => this.#onParserDrain(), "onParserDrain"),
        onSocketData: /* @__PURE__ */ __name((chunk) => {
          if (!this.#parser.write(chunk)) {
            this.#handler.socket.pause();
          }
        }, "onSocketData"),
        onSocketError: /* @__PURE__ */ __name((err) => {
          this.#handler.readyState = states.CLOSING;
          if (channels.socketError.hasSubscribers) {
            channels.socketError.publish(err);
          }
          this.#handler.socket.destroy();
        }, "onSocketError"),
        onSocketClose: /* @__PURE__ */ __name(() => this.#onSocketClose(), "onSocketClose"),
        onPing: /* @__PURE__ */ __name((body) => {
          if (channels.ping.hasSubscribers) {
            channels.ping.publish({
              payload: body,
              websocket: this
            });
          }
        }, "onPing"),
        onPong: /* @__PURE__ */ __name((body) => {
          if (channels.pong.hasSubscribers) {
            channels.pong.publish({
              payload: body,
              websocket: this
            });
          }
        }, "onPong"),
        readyState: states.CONNECTING,
        socket: null,
        closeState: /* @__PURE__ */ new Set(),
        controller: null,
        wasEverConnected: false
      };
      #url;
      #binaryType;
      /** @type {import('./receiver').ByteParser} */
      #parser;
      /**
       * @param {string} url
       * @param {string|string[]} protocols
       */
      constructor(url4, protocols = []) {
        super();
        webidl.util.markAsUncloneable(this);
        const prefix = "WebSocket constructor";
        webidl.argumentLengthCheck(arguments, 1, prefix);
        const options = webidl.converters["DOMString or sequence<DOMString> or WebSocketInit"](protocols, prefix, "options");
        url4 = webidl.converters.USVString(url4);
        protocols = options.protocols;
        const baseURL = environmentSettingsObject.settingsObject.baseUrl;
        const urlRecord = getURLRecord(url4, baseURL);
        if (typeof protocols === "string") {
          protocols = [protocols];
        }
        if (protocols.length !== new Set(protocols.map((p7) => p7.toLowerCase())).size) {
          throw new DOMException("Invalid Sec-WebSocket-Protocol value", "SyntaxError");
        }
        if (protocols.length > 0 && !protocols.every((p7) => isValidSubprotocol(p7))) {
          throw new DOMException("Invalid Sec-WebSocket-Protocol value", "SyntaxError");
        }
        this.#url = new URL(urlRecord.href);
        const client = environmentSettingsObject.settingsObject;
        this.#handler.controller = establishWebSocketConnection(
          urlRecord,
          protocols,
          client,
          this.#handler,
          options
        );
        this.#handler.readyState = _WebSocket.CONNECTING;
        this.#binaryType = "blob";
      }
      /**
       * @see https://websockets.spec.whatwg.org/#dom-websocket-close
       * @param {number|undefined} code
       * @param {string|undefined} reason
       */
      close(code = void 0, reason = void 0) {
        webidl.brandCheck(this, _WebSocket);
        const prefix = "WebSocket.close";
        if (code !== void 0) {
          code = webidl.converters["unsigned short"](code, prefix, "code", webidl.attributes.Clamp);
        }
        if (reason !== void 0) {
          reason = webidl.converters.USVString(reason);
        }
        code ??= null;
        reason ??= "";
        closeWebSocketConnection(this.#handler, code, reason, true);
      }
      /**
       * @see https://websockets.spec.whatwg.org/#dom-websocket-send
       * @param {NodeJS.TypedArray|ArrayBuffer|Blob|string} data
       */
      send(data) {
        webidl.brandCheck(this, _WebSocket);
        const prefix = "WebSocket.send";
        webidl.argumentLengthCheck(arguments, 1, prefix);
        data = webidl.converters.WebSocketSendData(data, prefix, "data");
        if (isConnecting(this.#handler.readyState)) {
          throw new DOMException("Sent before connected.", "InvalidStateError");
        }
        if (!isEstablished(this.#handler.readyState) || isClosing(this.#handler.readyState)) {
          return;
        }
        if (typeof data === "string") {
          const buffer = Buffer.from(data);
          this.#bufferedAmount += buffer.byteLength;
          this.#sendQueue.add(buffer, () => {
            this.#bufferedAmount -= buffer.byteLength;
          }, sendHints.text);
        } else if (isArrayBuffer3(data)) {
          this.#bufferedAmount += data.byteLength;
          this.#sendQueue.add(data, () => {
            this.#bufferedAmount -= data.byteLength;
          }, sendHints.arrayBuffer);
        } else if (ArrayBuffer.isView(data)) {
          this.#bufferedAmount += data.byteLength;
          this.#sendQueue.add(data, () => {
            this.#bufferedAmount -= data.byteLength;
          }, sendHints.typedArray);
        } else if (webidl.is.Blob(data)) {
          this.#bufferedAmount += data.size;
          this.#sendQueue.add(data, () => {
            this.#bufferedAmount -= data.size;
          }, sendHints.blob);
        }
      }
      get readyState() {
        webidl.brandCheck(this, _WebSocket);
        return this.#handler.readyState;
      }
      get bufferedAmount() {
        webidl.brandCheck(this, _WebSocket);
        return this.#bufferedAmount;
      }
      get url() {
        webidl.brandCheck(this, _WebSocket);
        return URLSerializer(this.#url);
      }
      get extensions() {
        webidl.brandCheck(this, _WebSocket);
        return this.#extensions;
      }
      get protocol() {
        webidl.brandCheck(this, _WebSocket);
        return this.#protocol;
      }
      get onopen() {
        webidl.brandCheck(this, _WebSocket);
        return this.#events.open;
      }
      set onopen(fn2) {
        webidl.brandCheck(this, _WebSocket);
        if (this.#events.open) {
          this.removeEventListener("open", this.#events.open);
        }
        const listener = webidl.converters.EventHandlerNonNull(fn2);
        if (listener !== null) {
          this.addEventListener("open", listener);
          this.#events.open = fn2;
        } else {
          this.#events.open = null;
        }
      }
      get onerror() {
        webidl.brandCheck(this, _WebSocket);
        return this.#events.error;
      }
      set onerror(fn2) {
        webidl.brandCheck(this, _WebSocket);
        if (this.#events.error) {
          this.removeEventListener("error", this.#events.error);
        }
        const listener = webidl.converters.EventHandlerNonNull(fn2);
        if (listener !== null) {
          this.addEventListener("error", listener);
          this.#events.error = fn2;
        } else {
          this.#events.error = null;
        }
      }
      get onclose() {
        webidl.brandCheck(this, _WebSocket);
        return this.#events.close;
      }
      set onclose(fn2) {
        webidl.brandCheck(this, _WebSocket);
        if (this.#events.close) {
          this.removeEventListener("close", this.#events.close);
        }
        const listener = webidl.converters.EventHandlerNonNull(fn2);
        if (listener !== null) {
          this.addEventListener("close", listener);
          this.#events.close = fn2;
        } else {
          this.#events.close = null;
        }
      }
      get onmessage() {
        webidl.brandCheck(this, _WebSocket);
        return this.#events.message;
      }
      set onmessage(fn2) {
        webidl.brandCheck(this, _WebSocket);
        if (this.#events.message) {
          this.removeEventListener("message", this.#events.message);
        }
        const listener = webidl.converters.EventHandlerNonNull(fn2);
        if (listener !== null) {
          this.addEventListener("message", listener);
          this.#events.message = fn2;
        } else {
          this.#events.message = null;
        }
      }
      get binaryType() {
        webidl.brandCheck(this, _WebSocket);
        return this.#binaryType;
      }
      set binaryType(type) {
        webidl.brandCheck(this, _WebSocket);
        if (type !== "blob" && type !== "arraybuffer") {
          this.#binaryType = "blob";
        } else {
          this.#binaryType = type;
        }
      }
      /**
       * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol
       */
      #onConnectionEstablished(response, parsedExtensions) {
        this.#handler.socket = response.socket;
        const parser2 = new ByteParser(this.#handler, parsedExtensions);
        parser2.on("drain", () => this.#handler.onParserDrain());
        parser2.on("error", (err) => this.#handler.onParserError(err));
        this.#parser = parser2;
        this.#sendQueue = new SendQueue(response.socket);
        this.#handler.readyState = states.OPEN;
        const extensions = response.headersList.get("sec-websocket-extensions");
        if (extensions !== null) {
          this.#extensions = extensions;
        }
        const protocol = response.headersList.get("sec-websocket-protocol");
        if (protocol !== null) {
          this.#protocol = protocol;
        }
        fireEvent("open", this);
        if (channels.open.hasSubscribers) {
          const headers = response.headersList.entries;
          channels.open.publish({
            address: response.socket.address(),
            protocol: this.#protocol,
            extensions: this.#extensions,
            websocket: this,
            handshakeResponse: {
              status: response.status,
              statusText: response.statusText,
              headers
            }
          });
        }
      }
      #onMessage(type, data) {
        if (this.#handler.readyState !== states.OPEN) {
          return;
        }
        let dataForEvent;
        if (type === opcodes.TEXT) {
          try {
            dataForEvent = utf8Decode(data);
          } catch {
            failWebsocketConnection(this.#handler, 1007, "Received invalid UTF-8 in text frame.");
            return;
          }
        } else if (type === opcodes.BINARY) {
          if (this.#binaryType === "blob") {
            dataForEvent = new Blob([data]);
          } else {
            dataForEvent = toArrayBuffer(data);
          }
        }
        fireEvent("message", this, createFastMessageEvent, {
          origin: this.#url.origin,
          data: dataForEvent
        });
      }
      #onParserDrain() {
        this.#handler.socket.resume();
      }
      /**
       * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol
       * @see https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.4
       */
      #onSocketClose() {
        const wasClean = this.#handler.closeState.has(sentCloseFrameState.SENT) && this.#handler.closeState.has(sentCloseFrameState.RECEIVED);
        let code = 1005;
        let reason = "";
        const result = this.#parser?.closingInfo;
        if (result && !result.error) {
          code = result.code ?? 1005;
          reason = result.reason;
        }
        this.#handler.readyState = states.CLOSED;
        if (!this.#handler.closeState.has(sentCloseFrameState.RECEIVED)) {
          code = 1006;
          fireEvent("error", this, (type, init4) => new ErrorEvent(type, init4), {
            error: new TypeError(reason)
          });
        }
        fireEvent("close", this, (type, init4) => new CloseEvent(type, init4), {
          wasClean,
          code,
          reason
        });
        if (channels.close.hasSubscribers) {
          channels.close.publish({
            websocket: this,
            code,
            reason
          });
        }
      }
      /**
       * @param {WebSocket} ws
       * @param {Buffer|undefined} buffer
       */
      static ping(ws, buffer) {
        if (Buffer.isBuffer(buffer)) {
          if (buffer.length > 125) {
            throw new TypeError("A PING frame cannot have a body larger than 125 bytes.");
          }
        } else if (buffer !== void 0) {
          throw new TypeError("Expected buffer payload");
        }
        const readyState = ws.#handler.readyState;
        if (isEstablished(readyState) && !isClosing(readyState) && !isClosed(readyState)) {
          const frame = new WebsocketFrameSend(buffer);
          ws.#handler.socket.write(frame.createFrame(opcodes.PING));
        }
      }
    };
    var { ping } = WebSocket2;
    Reflect.deleteProperty(WebSocket2, "ping");
    WebSocket2.CONNECTING = WebSocket2.prototype.CONNECTING = states.CONNECTING;
    WebSocket2.OPEN = WebSocket2.prototype.OPEN = states.OPEN;
    WebSocket2.CLOSING = WebSocket2.prototype.CLOSING = states.CLOSING;
    WebSocket2.CLOSED = WebSocket2.prototype.CLOSED = states.CLOSED;
    Object.defineProperties(WebSocket2.prototype, {
      CONNECTING: staticPropertyDescriptors,
      OPEN: staticPropertyDescriptors,
      CLOSING: staticPropertyDescriptors,
      CLOSED: staticPropertyDescriptors,
      url: kEnumerableProperty,
      readyState: kEnumerableProperty,
      bufferedAmount: kEnumerableProperty,
      onopen: kEnumerableProperty,
      onerror: kEnumerableProperty,
      onclose: kEnumerableProperty,
      close: kEnumerableProperty,
      onmessage: kEnumerableProperty,
      binaryType: kEnumerableProperty,
      send: kEnumerableProperty,
      extensions: kEnumerableProperty,
      protocol: kEnumerableProperty,
      [Symbol.toStringTag]: {
        value: "WebSocket",
        writable: false,
        enumerable: false,
        configurable: true
      }
    });
    Object.defineProperties(WebSocket2, {
      CONNECTING: staticPropertyDescriptors,
      OPEN: staticPropertyDescriptors,
      CLOSING: staticPropertyDescriptors,
      CLOSED: staticPropertyDescriptors
    });
    webidl.converters["sequence<DOMString>"] = webidl.sequenceConverter(
      webidl.converters.DOMString
    );
    webidl.converters["DOMString or sequence<DOMString>"] = function(V4, prefix, argument) {
      if (webidl.util.Type(V4) === webidl.util.Types.OBJECT && Symbol.iterator in V4) {
        return webidl.converters["sequence<DOMString>"](V4);
      }
      return webidl.converters.DOMString(V4, prefix, argument);
    };
    webidl.converters.WebSocketInit = webidl.dictionaryConverter([
      {
        key: "protocols",
        converter: webidl.converters["DOMString or sequence<DOMString>"],
        defaultValue: /* @__PURE__ */ __name(() => [], "defaultValue")
      },
      {
        key: "dispatcher",
        converter: webidl.converters.any,
        defaultValue: /* @__PURE__ */ __name(() => getGlobalDispatcher2(), "defaultValue")
      },
      {
        key: "headers",
        converter: webidl.nullableConverter(webidl.converters.HeadersInit)
      }
    ]);
    webidl.converters["DOMString or sequence<DOMString> or WebSocketInit"] = function(V4) {
      if (webidl.util.Type(V4) === webidl.util.Types.OBJECT && !(Symbol.iterator in V4)) {
        return webidl.converters.WebSocketInit(V4);
      }
      return { protocols: webidl.converters["DOMString or sequence<DOMString>"](V4) };
    };
    webidl.converters.WebSocketSendData = function(V4) {
      if (webidl.util.Type(V4) === webidl.util.Types.OBJECT) {
        if (webidl.is.Blob(V4)) {
          return V4;
        }
        if (webidl.is.BufferSource(V4)) {
          return V4;
        }
      }
      return webidl.converters.USVString(V4);
    };
    module2.exports = {
      WebSocket: WebSocket2,
      ping
    };
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/web/websocket/stream/websocketerror.js
var require_websocketerror = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/web/websocket/stream/websocketerror.js"(exports, module2) {
    init_import_meta_url();
    var { webidl } = require_webidl();
    var { validateCloseCodeAndReason } = require_util5();
    var { kConstruct } = require_symbols();
    var { kEnumerableProperty } = require_util();
    function createInheritableDOMException() {
      class Test extends DOMException {
        static {
          __name(this, "Test");
        }
        get reason() {
          return "";
        }
      }
      if (new Test().reason !== void 0) {
        return DOMException;
      }
      return new Proxy(DOMException, {
        construct(target, args, newTarget) {
          const instance = Reflect.construct(target, args, target);
          Object.setPrototypeOf(instance, newTarget.prototype);
          return instance;
        }
      });
    }
    __name(createInheritableDOMException, "createInheritableDOMException");
    var WebSocketError = class _WebSocketError extends createInheritableDOMException() {
      static {
        __name(this, "WebSocketError");
      }
      #closeCode;
      #reason;
      constructor(message = "", init4 = void 0) {
        message = webidl.converters.DOMString(message, "WebSocketError", "message");
        super(message, "WebSocketError");
        if (init4 === kConstruct) {
          return;
        } else if (init4 !== null) {
          init4 = webidl.converters.WebSocketCloseInfo(init4);
        }
        let code = init4.closeCode ?? null;
        const reason = init4.reason ?? "";
        validateCloseCodeAndReason(code, reason);
        if (reason.length !== 0 && code === null) {
          code = 1e3;
        }
        this.#closeCode = code;
        this.#reason = reason;
      }
      get closeCode() {
        return this.#closeCode;
      }
      get reason() {
        return this.#reason;
      }
      /**
       * @param {string} message
       * @param {number|null} code
       * @param {string} reason
       */
      static createUnvalidatedWebSocketError(message, code, reason) {
        const error2 = new _WebSocketError(message, kConstruct);
        error2.#closeCode = code;
        error2.#reason = reason;
        return error2;
      }
    };
    var { createUnvalidatedWebSocketError } = WebSocketError;
    delete WebSocketError.createUnvalidatedWebSocketError;
    Object.defineProperties(WebSocketError.prototype, {
      closeCode: kEnumerableProperty,
      reason: kEnumerableProperty,
      [Symbol.toStringTag]: {
        value: "WebSocketError",
        writable: false,
        enumerable: false,
        configurable: true
      }
    });
    webidl.is.WebSocketError = webidl.util.MakeTypeAssertion(WebSocketError);
    module2.exports = { WebSocketError, createUnvalidatedWebSocketError };
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/web/websocket/stream/websocketstream.js
var require_websocketstream = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/web/websocket/stream/websocketstream.js"(exports, module2) {
    init_import_meta_url();
    var { createDeferredPromise } = require_promise();
    var { environmentSettingsObject } = require_util2();
    var { states, opcodes, sentCloseFrameState } = require_constants5();
    var { webidl } = require_webidl();
    var { getURLRecord, isValidSubprotocol, isEstablished, utf8Decode } = require_util5();
    var { establishWebSocketConnection, failWebsocketConnection, closeWebSocketConnection } = require_connection();
    var { channels } = require_diagnostics();
    var { WebsocketFrameSend } = require_frame();
    var { ByteParser } = require_receiver();
    var { WebSocketError, createUnvalidatedWebSocketError } = require_websocketerror();
    var { kEnumerableProperty } = require_util();
    var { utf8DecodeBytes } = require_encoding();
    var emittedExperimentalWarning = false;
    var WebSocketStream = class {
      static {
        __name(this, "WebSocketStream");
      }
      // Each WebSocketStream object has an associated url , which is a URL record .
      /** @type {URL} */
      #url;
      // Each WebSocketStream object has an associated opened promise , which is a promise.
      /** @type {import('../../../util/promise').DeferredPromise} */
      #openedPromise;
      // Each WebSocketStream object has an associated closed promise , which is a promise.
      /** @type {import('../../../util/promise').DeferredPromise} */
      #closedPromise;
      // Each WebSocketStream object has an associated readable stream , which is a ReadableStream .
      /** @type {ReadableStream} */
      #readableStream;
      /** @type {ReadableStreamDefaultController} */
      #readableStreamController;
      // Each WebSocketStream object has an associated writable stream , which is a WritableStream .
      /** @type {WritableStream} */
      #writableStream;
      // Each WebSocketStream object has an associated boolean handshake aborted , which is initially false.
      #handshakeAborted = false;
      /** @type {import('../websocket').Handler} */
      #handler = {
        // https://whatpr.org/websockets/48/7b748d3...d5570f3.html#feedback-to-websocket-stream-from-the-protocol
        onConnectionEstablished: /* @__PURE__ */ __name((response, extensions) => this.#onConnectionEstablished(response, extensions), "onConnectionEstablished"),
        onMessage: /* @__PURE__ */ __name((opcode, data) => this.#onMessage(opcode, data), "onMessage"),
        onParserError: /* @__PURE__ */ __name((err) => failWebsocketConnection(this.#handler, null, err.message), "onParserError"),
        onParserDrain: /* @__PURE__ */ __name(() => this.#handler.socket.resume(), "onParserDrain"),
        onSocketData: /* @__PURE__ */ __name((chunk) => {
          if (!this.#parser.write(chunk)) {
            this.#handler.socket.pause();
          }
        }, "onSocketData"),
        onSocketError: /* @__PURE__ */ __name((err) => {
          this.#handler.readyState = states.CLOSING;
          if (channels.socketError.hasSubscribers) {
            channels.socketError.publish(err);
          }
          this.#handler.socket.destroy();
        }, "onSocketError"),
        onSocketClose: /* @__PURE__ */ __name(() => this.#onSocketClose(), "onSocketClose"),
        onPing: /* @__PURE__ */ __name(() => {
        }, "onPing"),
        onPong: /* @__PURE__ */ __name(() => {
        }, "onPong"),
        readyState: states.CONNECTING,
        socket: null,
        closeState: /* @__PURE__ */ new Set(),
        controller: null,
        wasEverConnected: false
      };
      /** @type {import('../receiver').ByteParser} */
      #parser;
      constructor(url4, options = void 0) {
        if (!emittedExperimentalWarning) {
          process.emitWarning("WebSocketStream is experimental! Expect it to change at any time.", {
            code: "UNDICI-WSS"
          });
          emittedExperimentalWarning = true;
        }
        webidl.argumentLengthCheck(arguments, 1, "WebSocket");
        url4 = webidl.converters.USVString(url4);
        if (options !== null) {
          options = webidl.converters.WebSocketStreamOptions(options);
        }
        const baseURL = environmentSettingsObject.settingsObject.baseUrl;
        const urlRecord = getURLRecord(url4, baseURL);
        const protocols = options.protocols;
        if (protocols.length !== new Set(protocols.map((p7) => p7.toLowerCase())).size) {
          throw new DOMException("Invalid Sec-WebSocket-Protocol value", "SyntaxError");
        }
        if (protocols.length > 0 && !protocols.every((p7) => isValidSubprotocol(p7))) {
          throw new DOMException("Invalid Sec-WebSocket-Protocol value", "SyntaxError");
        }
        this.#url = urlRecord.toString();
        this.#openedPromise = createDeferredPromise();
        this.#closedPromise = createDeferredPromise();
        if (options.signal != null) {
          const signal = options.signal;
          if (signal.aborted) {
            this.#openedPromise.reject(signal.reason);
            this.#closedPromise.reject(signal.reason);
            return;
          }
          signal.addEventListener("abort", () => {
            if (!isEstablished(this.#handler.readyState)) {
              failWebsocketConnection(this.#handler);
              this.#handler.readyState = states.CLOSING;
              this.#openedPromise.reject(signal.reason);
              this.#closedPromise.reject(signal.reason);
              this.#handshakeAborted = true;
            }
          }, { once: true });
        }
        const client = environmentSettingsObject.settingsObject;
        this.#handler.controller = establishWebSocketConnection(
          urlRecord,
          protocols,
          client,
          this.#handler,
          options
        );
      }
      // The url getter steps are to return this 's url , serialized .
      get url() {
        return this.#url.toString();
      }
      // The opened getter steps are to return this 's opened promise .
      get opened() {
        return this.#openedPromise.promise;
      }
      // The closed getter steps are to return this 's closed promise .
      get closed() {
        return this.#closedPromise.promise;
      }
      // The close( closeInfo ) method steps are:
      close(closeInfo = void 0) {
        if (closeInfo !== null) {
          closeInfo = webidl.converters.WebSocketCloseInfo(closeInfo);
        }
        const code = closeInfo.closeCode ?? null;
        const reason = closeInfo.reason;
        closeWebSocketConnection(this.#handler, code, reason, true);
      }
      #write(chunk) {
        chunk = webidl.converters.WebSocketStreamWrite(chunk);
        const promise = createDeferredPromise();
        let data = null;
        let opcode = null;
        if (webidl.is.BufferSource(chunk)) {
          data = new Uint8Array(ArrayBuffer.isView(chunk) ? new Uint8Array(chunk.buffer, chunk.byteOffset, chunk.byteLength) : chunk.slice());
          opcode = opcodes.BINARY;
        } else {
          let string;
          try {
            string = webidl.converters.DOMString(chunk);
          } catch (e10) {
            promise.reject(e10);
            return promise.promise;
          }
          data = new TextEncoder().encode(string);
          opcode = opcodes.TEXT;
        }
        if (!this.#handler.closeState.has(sentCloseFrameState.SENT) && !this.#handler.closeState.has(sentCloseFrameState.RECEIVED)) {
          const frame = new WebsocketFrameSend(data);
          this.#handler.socket.write(frame.createFrame(opcode), () => {
            promise.resolve(void 0);
          });
        }
        return promise.promise;
      }
      /** @type {import('../websocket').Handler['onConnectionEstablished']} */
      #onConnectionEstablished(response, parsedExtensions) {
        this.#handler.socket = response.socket;
        const parser2 = new ByteParser(this.#handler, parsedExtensions);
        parser2.on("drain", () => this.#handler.onParserDrain());
        parser2.on("error", (err) => this.#handler.onParserError(err));
        this.#parser = parser2;
        this.#handler.readyState = states.OPEN;
        const extensions = parsedExtensions ?? "";
        const protocol = response.headersList.get("sec-websocket-protocol") ?? "";
        const readable = new ReadableStream({
          start: /* @__PURE__ */ __name((controller) => {
            this.#readableStreamController = controller;
          }, "start"),
          pull(controller) {
            let chunk;
            while (controller.desiredSize > 0 && (chunk = response.socket.read()) !== null) {
              controller.enqueue(chunk);
            }
          },
          cancel: /* @__PURE__ */ __name((reason) => this.#cancel(reason), "cancel")
        });
        const writable = new WritableStream({
          write: /* @__PURE__ */ __name((chunk) => this.#write(chunk), "write"),
          close: /* @__PURE__ */ __name(() => closeWebSocketConnection(this.#handler, null, null), "close"),
          abort: /* @__PURE__ */ __name((reason) => this.#closeUsingReason(reason), "abort")
        });
        this.#readableStream = readable;
        this.#writableStream = writable;
        this.#openedPromise.resolve({
          extensions,
          protocol,
          readable,
          writable
        });
      }
      /** @type {import('../websocket').Handler['onMessage']} */
      #onMessage(type, data) {
        if (this.#handler.readyState !== states.OPEN) {
          return;
        }
        let chunk;
        if (type === opcodes.TEXT) {
          try {
            chunk = utf8Decode(data);
          } catch {
            failWebsocketConnection(this.#handler, "Received invalid UTF-8 in text frame.");
            return;
          }
        } else if (type === opcodes.BINARY) {
          chunk = new Uint8Array(data.buffer, data.byteOffset, data.byteLength);
        }
        this.#readableStreamController.enqueue(chunk);
      }
      /** @type {import('../websocket').Handler['onSocketClose']} */
      #onSocketClose() {
        const wasClean = this.#handler.closeState.has(sentCloseFrameState.SENT) && this.#handler.closeState.has(sentCloseFrameState.RECEIVED);
        this.#handler.readyState = states.CLOSED;
        if (this.#handshakeAborted) {
          return;
        }
        if (!this.#handler.wasEverConnected) {
          this.#openedPromise.reject(new WebSocketError("Socket never opened"));
        }
        const result = this.#parser?.closingInfo;
        let code = result?.code ?? 1005;
        if (!this.#handler.closeState.has(sentCloseFrameState.SENT) && !this.#handler.closeState.has(sentCloseFrameState.RECEIVED)) {
          code = 1006;
        }
        const reason = result?.reason == null ? "" : utf8DecodeBytes(Buffer.from(result.reason));
        if (wasClean) {
          this.#readableStreamController.close();
          if (!this.#writableStream.locked) {
            this.#writableStream.abort(new DOMException("A closed WebSocketStream cannot be written to", "InvalidStateError"));
          }
          this.#closedPromise.resolve({
            closeCode: code,
            reason
          });
        } else {
          const error2 = createUnvalidatedWebSocketError("unclean close", code, reason);
          this.#readableStreamController?.error(error2);
          this.#writableStream?.abort(error2);
          this.#closedPromise.reject(error2);
        }
      }
      #closeUsingReason(reason) {
        let code = null;
        let reasonString = "";
        if (webidl.is.WebSocketError(reason)) {
          code = reason.closeCode;
          reasonString = reason.reason;
        }
        closeWebSocketConnection(this.#handler, code, reasonString);
      }
      //  To cancel a WebSocketStream stream given reason , close using reason giving stream and reason .
      #cancel(reason) {
        this.#closeUsingReason(reason);
      }
    };
    Object.defineProperties(WebSocketStream.prototype, {
      url: kEnumerableProperty,
      opened: kEnumerableProperty,
      closed: kEnumerableProperty,
      close: kEnumerableProperty,
      [Symbol.toStringTag]: {
        value: "WebSocketStream",
        writable: false,
        enumerable: false,
        configurable: true
      }
    });
    webidl.converters.WebSocketStreamOptions = webidl.dictionaryConverter([
      {
        key: "protocols",
        converter: webidl.sequenceConverter(webidl.converters.USVString),
        defaultValue: /* @__PURE__ */ __name(() => [], "defaultValue")
      },
      {
        key: "signal",
        converter: webidl.nullableConverter(webidl.converters.AbortSignal),
        defaultValue: /* @__PURE__ */ __name(() => null, "defaultValue")
      }
    ]);
    webidl.converters.WebSocketCloseInfo = webidl.dictionaryConverter([
      {
        key: "closeCode",
        converter: /* @__PURE__ */ __name((V4) => webidl.converters["unsigned short"](V4, webidl.attributes.EnforceRange), "converter")
      },
      {
        key: "reason",
        converter: webidl.converters.USVString,
        defaultValue: /* @__PURE__ */ __name(() => "", "defaultValue")
      }
    ]);
    webidl.converters.WebSocketStreamWrite = function(V4) {
      if (typeof V4 === "string") {
        return webidl.converters.USVString(V4);
      }
      return webidl.converters.BufferSource(V4);
    };
    module2.exports = { WebSocketStream };
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/web/eventsource/util.js
var require_util6 = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/web/eventsource/util.js"(exports, module2) {
    init_import_meta_url();
    function isValidLastEventId(value) {
      return value.indexOf("\0") === -1;
    }
    __name(isValidLastEventId, "isValidLastEventId");
    function isASCIINumber(value) {
      if (value.length === 0) return false;
      for (let i7 = 0; i7 < value.length; i7++) {
        if (value.charCodeAt(i7) < 48 || value.charCodeAt(i7) > 57) return false;
      }
      return true;
    }
    __name(isASCIINumber, "isASCIINumber");
    module2.exports = {
      isValidLastEventId,
      isASCIINumber
    };
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/web/eventsource/eventsource-stream.js
var require_eventsource_stream = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/web/eventsource/eventsource-stream.js"(exports, module2) {
    init_import_meta_url();
    var { Transform: Transform2 } = __require("stream");
    var { isASCIINumber, isValidLastEventId } = require_util6();
    var BOM = [239, 187, 191];
    var LF = 10;
    var CR = 13;
    var COLON = 58;
    var SPACE2 = 32;
    var EventSourceStream = class extends Transform2 {
      static {
        __name(this, "EventSourceStream");
      }
      /**
       * @type {eventSourceSettings}
       */
      state;
      /**
       * Leading byte-order-mark check.
       * @type {boolean}
       */
      checkBOM = true;
      /**
       * @type {boolean}
       */
      crlfCheck = false;
      /**
       * @type {boolean}
       */
      eventEndCheck = false;
      /**
       * @type {Buffer|null}
       */
      buffer = null;
      pos = 0;
      event = {
        data: void 0,
        event: void 0,
        id: void 0,
        retry: void 0
      };
      /**
       * @param {object} options
       * @param {boolean} [options.readableObjectMode]
       * @param {eventSourceSettings} [options.eventSourceSettings]
       * @param {(chunk: any, encoding?: BufferEncoding | undefined) => boolean} [options.push]
       */
      constructor(options = {}) {
        options.readableObjectMode = true;
        super(options);
        this.state = options.eventSourceSettings || {};
        if (options.push) {
          this.push = options.push;
        }
      }
      /**
       * @param {Buffer} chunk
       * @param {string} _encoding
       * @param {Function} callback
       * @returns {void}
       */
      _transform(chunk, _encoding, callback) {
        if (chunk.length === 0) {
          callback();
          return;
        }
        if (this.buffer) {
          this.buffer = Buffer.concat([this.buffer, chunk]);
        } else {
          this.buffer = chunk;
        }
        if (this.checkBOM) {
          switch (this.buffer.length) {
            case 1:
              if (this.buffer[0] === BOM[0]) {
                callback();
                return;
              }
              this.checkBOM = false;
              callback();
              return;
            case 2:
              if (this.buffer[0] === BOM[0] && this.buffer[1] === BOM[1]) {
                callback();
                return;
              }
              this.checkBOM = false;
              break;
            case 3:
              if (this.buffer[0] === BOM[0] && this.buffer[1] === BOM[1] && this.buffer[2] === BOM[2]) {
                this.buffer = Buffer.alloc(0);
                this.checkBOM = false;
                callback();
                return;
              }
              this.checkBOM = false;
              break;
            default:
              if (this.buffer[0] === BOM[0] && this.buffer[1] === BOM[1] && this.buffer[2] === BOM[2]) {
                this.buffer = this.buffer.subarray(3);
              }
              this.checkBOM = false;
              break;
          }
        }
        while (this.pos < this.buffer.length) {
          if (this.eventEndCheck) {
            if (this.crlfCheck) {
              if (this.buffer[this.pos] === LF) {
                this.buffer = this.buffer.subarray(this.pos + 1);
                this.pos = 0;
                this.crlfCheck = false;
                continue;
              }
              this.crlfCheck = false;
            }
            if (this.buffer[this.pos] === LF || this.buffer[this.pos] === CR) {
              if (this.buffer[this.pos] === CR) {
                this.crlfCheck = true;
              }
              this.buffer = this.buffer.subarray(this.pos + 1);
              this.pos = 0;
              if (this.event.data !== void 0 || this.event.event || this.event.id !== void 0 || this.event.retry) {
                this.processEvent(this.event);
              }
              this.clearEvent();
              continue;
            }
            this.eventEndCheck = false;
            continue;
          }
          if (this.buffer[this.pos] === LF || this.buffer[this.pos] === CR) {
            if (this.buffer[this.pos] === CR) {
              this.crlfCheck = true;
            }
            this.parseLine(this.buffer.subarray(0, this.pos), this.event);
            this.buffer = this.buffer.subarray(this.pos + 1);
            this.pos = 0;
            this.eventEndCheck = true;
            continue;
          }
          this.pos++;
        }
        callback();
      }
      /**
       * @param {Buffer} line
       * @param {EventSourceStreamEvent} event
       */
      parseLine(line, event) {
        if (line.length === 0) {
          return;
        }
        const colonPosition = line.indexOf(COLON);
        if (colonPosition === 0) {
          return;
        }
        let field = "";
        let value = "";
        if (colonPosition !== -1) {
          field = line.subarray(0, colonPosition).toString("utf8");
          let valueStart = colonPosition + 1;
          if (line[valueStart] === SPACE2) {
            ++valueStart;
          }
          value = line.subarray(valueStart).toString("utf8");
        } else {
          field = line.toString("utf8");
          value = "";
        }
        switch (field) {
          case "data":
            if (event[field] === void 0) {
              event[field] = value;
            } else {
              event[field] += `
${value}`;
            }
            break;
          case "retry":
            if (isASCIINumber(value)) {
              event[field] = value;
            }
            break;
          case "id":
            if (isValidLastEventId(value)) {
              event[field] = value;
            }
            break;
          case "event":
            if (value.length > 0) {
              event[field] = value;
            }
            break;
        }
      }
      /**
       * @param {EventSourceStreamEvent} event
       */
      processEvent(event) {
        if (event.retry && isASCIINumber(event.retry)) {
          this.state.reconnectionTime = parseInt(event.retry, 10);
        }
        if (event.id !== void 0 && isValidLastEventId(event.id)) {
          this.state.lastEventId = event.id;
        }
        if (event.data !== void 0) {
          this.push({
            type: event.event || "message",
            options: {
              data: event.data,
              lastEventId: this.state.lastEventId,
              origin: this.state.origin
            }
          });
        }
      }
      clearEvent() {
        this.event = {
          data: void 0,
          event: void 0,
          id: void 0,
          retry: void 0
        };
      }
    };
    module2.exports = {
      EventSourceStream
    };
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/web/eventsource/eventsource.js
var require_eventsource = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/lib/web/eventsource/eventsource.js"(exports, module2) {
    init_import_meta_url();
    var { pipeline } = __require("stream");
    var { fetching } = require_fetch();
    var { makeRequest } = require_request2();
    var { webidl } = require_webidl();
    var { EventSourceStream } = require_eventsource_stream();
    var { parseMIMEType } = require_data_url();
    var { createFastMessageEvent } = require_events();
    var { isNetworkError } = require_response();
    var { kEnumerableProperty } = require_util();
    var { environmentSettingsObject } = require_util2();
    var experimentalWarned = false;
    var defaultReconnectionTime = 3e3;
    var CONNECTING = 0;
    var OPEN = 1;
    var CLOSED = 2;
    var ANONYMOUS = "anonymous";
    var USE_CREDENTIALS = "use-credentials";
    var EventSource = class _EventSource extends EventTarget {
      static {
        __name(this, "EventSource");
      }
      #events = {
        open: null,
        error: null,
        message: null
      };
      #url;
      #withCredentials = false;
      /**
       * @type {ReadyState}
       */
      #readyState = CONNECTING;
      #request = null;
      #controller = null;
      #dispatcher;
      /**
       * @type {import('./eventsource-stream').eventSourceSettings}
       */
      #state;
      /**
       * Creates a new EventSource object.
       * @param {string} url
       * @param {EventSourceInit} [eventSourceInitDict={}]
       * @see https://html.spec.whatwg.org/multipage/server-sent-events.html#the-eventsource-interface
       */
      constructor(url4, eventSourceInitDict = {}) {
        super();
        webidl.util.markAsUncloneable(this);
        const prefix = "EventSource constructor";
        webidl.argumentLengthCheck(arguments, 1, prefix);
        if (!experimentalWarned) {
          experimentalWarned = true;
          process.emitWarning("EventSource is experimental, expect them to change at any time.", {
            code: "UNDICI-ES"
          });
        }
        url4 = webidl.converters.USVString(url4);
        eventSourceInitDict = webidl.converters.EventSourceInitDict(eventSourceInitDict, prefix, "eventSourceInitDict");
        this.#dispatcher = eventSourceInitDict.node.dispatcher || eventSourceInitDict.dispatcher;
        this.#state = {
          lastEventId: "",
          reconnectionTime: eventSourceInitDict.node.reconnectionTime
        };
        const settings = environmentSettingsObject;
        let urlRecord;
        try {
          urlRecord = new URL(url4, settings.settingsObject.baseUrl);
          this.#state.origin = urlRecord.origin;
        } catch (e10) {
          throw new DOMException(e10, "SyntaxError");
        }
        this.#url = urlRecord.href;
        let corsAttributeState = ANONYMOUS;
        if (eventSourceInitDict.withCredentials === true) {
          corsAttributeState = USE_CREDENTIALS;
          this.#withCredentials = true;
        }
        const initRequest = {
          redirect: "follow",
          keepalive: true,
          // @see https://html.spec.whatwg.org/multipage/urls-and-fetching.html#cors-settings-attributes
          mode: "cors",
          credentials: corsAttributeState === "anonymous" ? "same-origin" : "omit",
          referrer: "no-referrer"
        };
        initRequest.client = environmentSettingsObject.settingsObject;
        initRequest.headersList = [["accept", { name: "accept", value: "text/event-stream" }]];
        initRequest.cache = "no-store";
        initRequest.initiator = "other";
        initRequest.urlList = [new URL(this.#url)];
        this.#request = makeRequest(initRequest);
        this.#connect();
      }
      /**
       * Returns the state of this EventSource object's connection. It can have the
       * values described below.
       * @returns {ReadyState}
       * @readonly
       */
      get readyState() {
        return this.#readyState;
      }
      /**
       * Returns the URL providing the event stream.
       * @readonly
       * @returns {string}
       */
      get url() {
        return this.#url;
      }
      /**
       * Returns a boolean indicating whether the EventSource object was
       * instantiated with CORS credentials set (true), or not (false, the default).
       */
      get withCredentials() {
        return this.#withCredentials;
      }
      #connect() {
        if (this.#readyState === CLOSED) return;
        this.#readyState = CONNECTING;
        const fetchParams = {
          request: this.#request,
          dispatcher: this.#dispatcher
        };
        const processEventSourceEndOfBody = /* @__PURE__ */ __name((response) => {
          if (!isNetworkError(response)) {
            return this.#reconnect();
          }
        }, "processEventSourceEndOfBody");
        fetchParams.processResponseEndOfBody = processEventSourceEndOfBody;
        fetchParams.processResponse = (response) => {
          if (isNetworkError(response)) {
            if (response.aborted) {
              this.close();
              this.dispatchEvent(new Event("error"));
              return;
            } else {
              this.#reconnect();
              return;
            }
          }
          const contentType = response.headersList.get("content-type", true);
          const mimeType = contentType !== null ? parseMIMEType(contentType) : "failure";
          const contentTypeValid = mimeType !== "failure" && mimeType.essence === "text/event-stream";
          if (response.status !== 200 || contentTypeValid === false) {
            this.close();
            this.dispatchEvent(new Event("error"));
            return;
          }
          this.#readyState = OPEN;
          this.dispatchEvent(new Event("open"));
          this.#state.origin = response.urlList[response.urlList.length - 1].origin;
          const eventSourceStream = new EventSourceStream({
            eventSourceSettings: this.#state,
            push: /* @__PURE__ */ __name((event) => {
              this.dispatchEvent(createFastMessageEvent(
                event.type,
                event.options
              ));
            }, "push")
          });
          pipeline(
            response.body.stream,
            eventSourceStream,
            (error2) => {
              if (error2?.aborted === false) {
                this.close();
                this.dispatchEvent(new Event("error"));
              }
            }
          );
        };
        this.#controller = fetching(fetchParams);
      }
      /**
       * @see https://html.spec.whatwg.org/multipage/server-sent-events.html#sse-processing-model
       * @returns {void}
       */
      #reconnect() {
        if (this.#readyState === CLOSED) return;
        this.#readyState = CONNECTING;
        this.dispatchEvent(new Event("error"));
        setTimeout(() => {
          if (this.#readyState !== CONNECTING) return;
          if (this.#state.lastEventId.length) {
            this.#request.headersList.set("last-event-id", this.#state.lastEventId, true);
          }
          this.#connect();
        }, this.#state.reconnectionTime)?.unref();
      }
      /**
       * Closes the connection, if any, and sets the readyState attribute to
       * CLOSED.
       */
      close() {
        webidl.brandCheck(this, _EventSource);
        if (this.#readyState === CLOSED) return;
        this.#readyState = CLOSED;
        this.#controller.abort();
        this.#request = null;
      }
      get onopen() {
        return this.#events.open;
      }
      set onopen(fn2) {
        if (this.#events.open) {
          this.removeEventListener("open", this.#events.open);
        }
        const listener = webidl.converters.EventHandlerNonNull(fn2);
        if (listener !== null) {
          this.addEventListener("open", listener);
          this.#events.open = fn2;
        } else {
          this.#events.open = null;
        }
      }
      get onmessage() {
        return this.#events.message;
      }
      set onmessage(fn2) {
        if (this.#events.message) {
          this.removeEventListener("message", this.#events.message);
        }
        const listener = webidl.converters.EventHandlerNonNull(fn2);
        if (listener !== null) {
          this.addEventListener("message", listener);
          this.#events.message = fn2;
        } else {
          this.#events.message = null;
        }
      }
      get onerror() {
        return this.#events.error;
      }
      set onerror(fn2) {
        if (this.#events.error) {
          this.removeEventListener("error", this.#events.error);
        }
        const listener = webidl.converters.EventHandlerNonNull(fn2);
        if (listener !== null) {
          this.addEventListener("error", listener);
          this.#events.error = fn2;
        } else {
          this.#events.error = null;
        }
      }
    };
    var constantsPropertyDescriptors = {
      CONNECTING: {
        __proto__: null,
        configurable: false,
        enumerable: true,
        value: CONNECTING,
        writable: false
      },
      OPEN: {
        __proto__: null,
        configurable: false,
        enumerable: true,
        value: OPEN,
        writable: false
      },
      CLOSED: {
        __proto__: null,
        configurable: false,
        enumerable: true,
        value: CLOSED,
        writable: false
      }
    };
    Object.defineProperties(EventSource, constantsPropertyDescriptors);
    Object.defineProperties(EventSource.prototype, constantsPropertyDescriptors);
    Object.defineProperties(EventSource.prototype, {
      close: kEnumerableProperty,
      onerror: kEnumerableProperty,
      onmessage: kEnumerableProperty,
      onopen: kEnumerableProperty,
      readyState: kEnumerableProperty,
      url: kEnumerableProperty,
      withCredentials: kEnumerableProperty
    });
    webidl.converters.EventSourceInitDict = webidl.dictionaryConverter([
      {
        key: "withCredentials",
        converter: webidl.converters.boolean,
        defaultValue: /* @__PURE__ */ __name(() => false, "defaultValue")
      },
      {
        key: "dispatcher",
        // undici only
        converter: webidl.converters.any
      },
      {
        key: "node",
        // undici only
        converter: webidl.dictionaryConverter([
          {
            key: "reconnectionTime",
            converter: webidl.converters["unsigned long"],
            defaultValue: /* @__PURE__ */ __name(() => defaultReconnectionTime, "defaultValue")
          },
          {
            key: "dispatcher",
            converter: webidl.converters.any
          }
        ]),
        defaultValue: /* @__PURE__ */ __name(() => ({}), "defaultValue")
      }
    ]);
    module2.exports = {
      EventSource,
      defaultReconnectionTime
    };
  }
});

// ../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/index.js
var require_undici = __commonJS({
  "../../node_modules/.pnpm/undici@7.24.4_patch_hash=957063fa4cdb086f68ebd6f837888aa6a1240dbd31e3d3eaee4fb4fd54d24990/node_modules/undici/index.js"(exports, module2) {
    init_import_meta_url();
    var Client2 = require_client();
    var Dispatcher2 = require_dispatcher();
    var Pool = require_pool();
    var BalancedPool = require_balanced_pool();
    var RoundRobinPool = require_round_robin_pool();
    var Agent = require_agent();
    var ProxyAgent = require_proxy_agent();
    var Socks5ProxyAgent = require_socks5_proxy_agent();
    var EnvHttpProxyAgent2 = require_env_http_proxy_agent();
    var RetryAgent = require_retry_agent();
    var H2CClient = require_h2c_client();
    var errors = require_errors();
    var util5 = require_util();
    var { InvalidArgumentError } = errors;
    var api = require_api();
    var buildConnector = require_connect();
    var MockClient = require_mock_client();
    var { MockCallHistory, MockCallHistoryLog } = require_mock_call_history();
    var MockAgent = require_mock_agent();
    var MockPool = require_mock_pool();
    var SnapshotAgent = require_snapshot_agent();
    var mockErrors = require_mock_errors();
    var RetryHandler = require_retry_handler();
    var { getGlobalDispatcher: getGlobalDispatcher2, setGlobalDispatcher: setGlobalDispatcher2 } = require_global2();
    var DecoratorHandler = require_decorator_handler();
    var RedirectHandler = require_redirect_handler();
    Object.assign(Dispatcher2.prototype, api);
    module2.exports.Dispatcher = Dispatcher2;
    module2.exports.Client = Client2;
    module2.exports.Pool = Pool;
    module2.exports.BalancedPool = BalancedPool;
    module2.exports.RoundRobinPool = RoundRobinPool;
    module2.exports.Agent = Agent;
    module2.exports.ProxyAgent = ProxyAgent;
    module2.exports.Socks5ProxyAgent = Socks5ProxyAgent;
    module2.exports.EnvHttpProxyAgent = EnvHttpProxyAgent2;
    module2.exports.RetryAgent = RetryAgent;
    module2.exports.H2CClient = H2CClient;
    module2.exports.RetryHandler = RetryHandler;
    module2.exports.DecoratorHandler = DecoratorHandler;
    module2.exports.RedirectHandler = RedirectHandler;
    module2.exports.interceptors = {
      redirect: require_redirect(),
      responseError: require_response_error(),
      retry: require_retry(),
      dump: require_dump(),
      dns: require_dns(),
      cache: require_cache2(),
      decompress: require_decompress(),
      deduplicate: require_deduplicate()
    };
    module2.exports.cacheStores = {
      MemoryCacheStore: require_memory_cache_store()
    };
    var SqliteCacheStore = require_sqlite_cache_store();
    module2.exports.cacheStores.SqliteCacheStore = SqliteCacheStore;
    module2.exports.buildConnector = buildConnector;
    module2.exports.errors = errors;
    module2.exports.util = {
      parseHeaders: util5.parseHeaders,
      headerNameToString: util5.headerNameToString
    };
    function makeDispatcher(fn2) {
      return (url4, opts, handler) => {
        if (typeof opts === "function") {
          handler = opts;
          opts = null;
        }
        if (!url4 || typeof url4 !== "string" && typeof url4 !== "object" && !(url4 instanceof URL)) {
          throw new InvalidArgumentError("invalid url");
        }
        if (opts != null && typeof opts !== "object") {
          throw new InvalidArgumentError("invalid opts");
        }
        if (opts && opts.path != null) {
          if (typeof opts.path !== "string") {
            throw new InvalidArgumentError("invalid opts.path");
          }
          let path84 = opts.path;
          if (!opts.path.startsWith("/")) {
            path84 = `/${path84}`;
          }
          url4 = new URL(util5.parseOrigin(url4).origin + path84);
        } else {
          if (!opts) {
            opts = typeof url4 === "object" ? url4 : {};
          }
          url4 = util5.parseURL(url4);
        }
        const { agent, dispatcher = getGlobalDispatcher2() } = opts;
        if (agent) {
          throw new InvalidArgumentError("unsupported opts.agent. Did you mean opts.client?");
        }
        return fn2.call(dispatcher, {
          ...opts,
          origin: url4.origin,
          path: url4.search ? `${url4.pathname}${url4.search}` : url4.pathname,
          method: opts.method || (opts.body ? "PUT" : "GET")
        }, handler);
      };
    }
    __name(makeDispatcher, "makeDispatcher");
    module2.exports.setGlobalDispatcher = setGlobalDispatcher2;
    module2.exports.getGlobalDispatcher = getGlobalDispatcher2;
    var fetchImpl = require_fetch().fetch;
    var currentFilename = typeof __filename !== "undefined" ? __filename : void 0;
    function appendFetchStackTrace(err, filename) {
      if (!err || typeof err !== "object") {
        return;
      }
      const stack = typeof err.stack === "string" ? err.stack : "";
      const normalizedFilename = filename.replace(/\\/g, "/");
      if (stack && (stack.includes(filename) || stack.includes(normalizedFilename))) {
        return;
      }
      const capture = {};
      Error.captureStackTrace(capture, appendFetchStackTrace);
      if (!capture.stack) {
        return;
      }
      const captureLines = capture.stack.split("\n").slice(1).join("\n");
      err.stack = stack ? `${stack}
${captureLines}` : capture.stack;
    }
    __name(appendFetchStackTrace, "appendFetchStackTrace");
    module2.exports.fetch = /* @__PURE__ */ __name(function fetch20(init4, options = void 0) {
      return fetchImpl(init4, options).catch((err) => {
        if (currentFilename) {
          appendFetchStackTrace(err, currentFilename);
        } else if (err && typeof err === "object") {
          Error.captureStackTrace(err, module2.exports.fetch);
        }
        throw err;
      });
    }, "fetch");
    module2.exports.Headers = require_headers().Headers;
    module2.exports.Response = require_response().Response;
    module2.exports.Request = require_request2().Request;
    module2.exports.FormData = require_formdata().FormData;
    var { setGlobalOrigin, getGlobalOrigin } = require_global();
    module2.exports.setGlobalOrigin = setGlobalOrigin;
    module2.exports.getGlobalOrigin = getGlobalOrigin;
    var { CacheStorage: CacheStorage2 } = require_cachestorage();
    var { kConstruct } = require_symbols();
    module2.exports.caches = new CacheStorage2(kConstruct);
    var { deleteCookie, getCookies, getSetCookies, setCookie, parseCookie: parseCookie2 } = require_cookies();
    module2.exports.deleteCookie = deleteCookie;
    module2.exports.getCookies = getCookies;
    module2.exports.getSetCookies = getSetCookies;
    module2.exports.setCookie = setCookie;
    module2.exports.parseCookie = parseCookie2;
    var { parseMIMEType, serializeAMimeType } = require_data_url();
    module2.exports.parseMIMEType = parseMIMEType;
    module2.exports.serializeAMimeType = serializeAMimeType;
    var { CloseEvent, ErrorEvent, MessageEvent } = require_events();
    var { WebSocket: WebSocket2, ping } = require_websocket();
    module2.exports.WebSocket = WebSocket2;
    module2.exports.CloseEvent = CloseEvent;
    module2.exports.ErrorEvent = ErrorEvent;
    module2.exports.MessageEvent = MessageEvent;
    module2.exports.ping = ping;
    module2.exports.WebSocketStream = require_websocketstream().WebSocketStream;
    module2.exports.WebSocketError = require_websocketerror().WebSocketError;
    module2.exports.request = makeDispatcher(api.request);
    module2.exports.stream = makeDispatcher(api.stream);
    module2.exports.pipeline = makeDispatcher(api.pipeline);
    module2.exports.connect = makeDispatcher(api.connect);
    module2.exports.upgrade = makeDispatcher(api.upgrade);
    module2.exports.MockClient = MockClient;
    module2.exports.MockCallHistory = MockCallHistory;
    module2.exports.MockCallHistoryLog = MockCallHistoryLog;
    module2.exports.MockPool = MockPool;
    module2.exports.MockAgent = MockAgent;
    module2.exports.SnapshotAgent = SnapshotAgent;
    module2.exports.mockErrors = mockErrors;
    var { EventSource } = require_eventsource();
    module2.exports.EventSource = EventSource;
    function install() {
      globalThis.fetch = module2.exports.fetch;
      globalThis.Headers = module2.exports.Headers;
      globalThis.Response = module2.exports.Response;
      globalThis.Request = module2.exports.Request;
      globalThis.FormData = module2.exports.FormData;
      globalThis.WebSocket = module2.exports.WebSocket;
      globalThis.CloseEvent = module2.exports.CloseEvent;
      globalThis.ErrorEvent = module2.exports.ErrorEvent;
      globalThis.MessageEvent = module2.exports.MessageEvent;
      globalThis.EventSource = module2.exports.EventSource;
    }
    __name(install, "install");
    module2.exports.install = install;
  }
});

// ../../node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/vendor/ansi-styles/index.js
function assembleStyles() {
  const codes = /* @__PURE__ */ new Map();
  for (const [groupName, group] of Object.entries(styles)) {
    for (const [styleName, style] of Object.entries(group)) {
      styles[styleName] = {
        open: `\x1B[${style[0]}m`,
        close: `\x1B[${style[1]}m`
      };
      group[styleName] = styles[styleName];
      codes.set(style[0], style[1]);
    }
    Object.defineProperty(styles, groupName, {
      value: group,
      enumerable: false
    });
  }
  Object.defineProperty(styles, "codes", {
    value: codes,
    enumerable: false
  });
  styles.color.close = "\x1B[39m";
  styles.bgColor.close = "\x1B[49m";
  styles.color.ansi = wrapAnsi16();
  styles.color.ansi256 = wrapAnsi256();
  styles.color.ansi16m = wrapAnsi16m();
  styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
  styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
  styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
  Object.defineProperties(styles, {
    rgbToAnsi256: {
      value(red2, green2, blue2) {
        if (red2 === green2 && green2 === blue2) {
          if (red2 < 8) {
            return 16;
          }
          if (red2 > 248) {
            return 231;
          }
          return Math.round((red2 - 8) / 247 * 24) + 232;
        }
        return 16 + 36 * Math.round(red2 / 255 * 5) + 6 * Math.round(green2 / 255 * 5) + Math.round(blue2 / 255 * 5);
      },
      enumerable: false
    },
    hexToRgb: {
      value(hex) {
        const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
        if (!matches) {
          return [0, 0, 0];
        }
        let [colorString] = matches;
        if (colorString.length === 3) {
          colorString = [...colorString].map((character) => character + character).join("");
        }
        const integer = Number.parseInt(colorString, 16);
        return [
          /* eslint-disable no-bitwise */
          integer >> 16 & 255,
          integer >> 8 & 255,
          integer & 255
          /* eslint-enable no-bitwise */
        ];
      },
      enumerable: false
    },
    hexToAnsi256: {
      value: /* @__PURE__ */ __name((hex) => styles.rgbToAnsi256(...styles.hexToRgb(hex)), "value"),
      enumerable: false
    },
    ansi256ToAnsi: {
      value(code) {
        if (code < 8) {
          return 30 + code;
        }
        if (code < 16) {
          return 90 + (code - 8);
        }
        let red2;
        let green2;
        let blue2;
        if (code >= 232) {
          red2 = ((code - 232) * 10 + 8) / 255;
          green2 = red2;
          blue2 = red2;
        } else {
          code -= 16;
          const remainder = code % 36;
          red2 = Math.floor(code / 36) / 5;
          green2 = Math.floor(remainder / 6) / 5;
          blue2 = remainder % 6 / 5;
        }
        const value = Math.max(red2, green2, blue2) * 2;
        if (value === 0) {
          return 30;
        }
        let result = 30 + (Math.round(blue2) << 2 | Math.round(green2) << 1 | Math.round(red2));
        if (value === 2) {
          result += 60;
        }
        return result;
      },
      enumerable: false
    },
    rgbToAnsi: {
      value: /* @__PURE__ */ __name((red2, green2, blue2) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red2, green2, blue2)), "value"),
      enumerable: false
    },
    hexToAnsi: {
      value: /* @__PURE__ */ __name((hex) => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)), "value"),
      enumerable: false
    }
  });
  return styles;
}
var ANSI_BACKGROUND_OFFSET, wrapAnsi16, wrapAnsi256, wrapAnsi16m, styles, foregroundColorNames, backgroundColorNames, ansiStyles, ansi_styles_default;
var init_ansi_styles = __esm({
  "../../node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/vendor/ansi-styles/index.js"() {
    init_import_meta_url();
    ANSI_BACKGROUND_OFFSET = 10;
    wrapAnsi16 = /* @__PURE__ */ __name((offset = 0) => (code) => `\x1B[${code + offset}m`, "wrapAnsi16");
    wrapAnsi256 = /* @__PURE__ */ __name((offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`, "wrapAnsi256");
    wrapAnsi16m = /* @__PURE__ */ __name((offset = 0) => (red2, green2, blue2) => `\x1B[${38 + offset};2;${red2};${green2};${blue2}m`, "wrapAnsi16m");
    styles = {
      modifier: {
        reset: [0, 0],
        // 21 isn't widely supported and 22 does the same thing
        bold: [1, 22],
        dim: [2, 22],
        italic: [3, 23],
        underline: [4, 24],
        overline: [53, 55],
        inverse: [7, 27],
        hidden: [8, 28],
        strikethrough: [9, 29]
      },
      color: {
        black: [30, 39],
        red: [31, 39],
        green: [32, 39],
        yellow: [33, 39],
        blue: [34, 39],
        magenta: [35, 39],
        cyan: [36, 39],
        white: [37, 39],
        // Bright color
        blackBright: [90, 39],
        gray: [90, 39],
        // Alias of `blackBright`
        grey: [90, 39],
        // Alias of `blackBright`
        redBright: [91, 39],
        greenBright: [92, 39],
        yellowBright: [93, 39],
        blueBright: [94, 39],
        magentaBright: [95, 39],
        cyanBright: [96, 39],
        whiteBright: [97, 39]
      },
      bgColor: {
        bgBlack: [40, 49],
        bgRed: [41, 49],
        bgGreen: [42, 49],
        bgYellow: [43, 49],
        bgBlue: [44, 49],
        bgMagenta: [45, 49],
        bgCyan: [46, 49],
        bgWhite: [47, 49],
        // Bright color
        bgBlackBright: [100, 49],
        bgGray: [100, 49],
        // Alias of `bgBlackBright`
        bgGrey: [100, 49],
        // Alias of `bgBlackBright`
        bgRedBright: [101, 49],
        bgGreenBright: [102, 49],
        bgYellowBright: [103, 49],
        bgBlueBright: [104, 49],
        bgMagentaBright: [105, 49],
        bgCyanBright: [106, 49],
        bgWhiteBright: [107, 49]
      }
    };
    Object.keys(styles.modifier);
    foregroundColorNames = Object.keys(styles.color);
    backgroundColorNames = Object.keys(styles.bgColor);
    [...foregroundColorNames, ...backgroundColorNames];
    __name(assembleStyles, "assembleStyles");
    ansiStyles = assembleStyles();
    ansi_styles_default = ansiStyles;
  }
});
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process7__default.default.argv) {
  const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
  const position = argv.indexOf(prefix + flag);
  const terminatorPosition = argv.indexOf("--");
  return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
}
function envForceColor() {
  if ("FORCE_COLOR" in env2) {
    if (env2.FORCE_COLOR === "true") {
      return 1;
    }
    if (env2.FORCE_COLOR === "false") {
      return 0;
    }
    return env2.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env2.FORCE_COLOR, 10), 3);
  }
}
function translateLevel(level) {
  if (level === 0) {
    return false;
  }
  return {
    level,
    hasBasic: true,
    has256: level >= 2,
    has16m: level >= 3
  };
}
function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
  const noFlagForceColor = envForceColor();
  if (noFlagForceColor !== void 0) {
    flagForceColor = noFlagForceColor;
  }
  const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
  if (forceColor === 0) {
    return 0;
  }
  if (sniffFlags) {
    if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
      return 3;
    }
    if (hasFlag("color=256")) {
      return 2;
    }
  }
  if ("TF_BUILD" in env2 && "AGENT_NAME" in env2) {
    return 1;
  }
  if (haveStream && !streamIsTTY && forceColor === void 0) {
    return 0;
  }
  const min = forceColor || 0;
  if (env2.TERM === "dumb") {
    return min;
  }
  if (process7__default.default.platform === "win32") {
    const osRelease = os11__namespace.default.release().split(".");
    if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
      return Number(osRelease[2]) >= 14931 ? 3 : 2;
    }
    return 1;
  }
  if ("CI" in env2) {
    if ("GITHUB_ACTIONS" in env2 || "GITEA_ACTIONS" in env2) {
      return 3;
    }
    if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => sign in env2) || env2.CI_NAME === "codeship") {
      return 1;
    }
    return min;
  }
  if ("TEAMCITY_VERSION" in env2) {
    return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env2.TEAMCITY_VERSION) ? 1 : 0;
  }
  if (env2.COLORTERM === "truecolor") {
    return 3;
  }
  if (env2.TERM === "xterm-kitty") {
    return 3;
  }
  if ("TERM_PROGRAM" in env2) {
    const version5 = Number.parseInt((env2.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
    switch (env2.TERM_PROGRAM) {
      case "iTerm.app": {
        return version5 >= 3 ? 3 : 2;
      }
      case "Apple_Terminal": {
        return 2;
      }
    }
  }
  if (/-256(color)?$/i.test(env2.TERM)) {
    return 2;
  }
  if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env2.TERM)) {
    return 1;
  }
  if ("COLORTERM" in env2) {
    return 1;
  }
  return min;
}
function createSupportsColor(stream2, options = {}) {
  const level = _supportsColor(stream2, {
    streamIsTTY: stream2 && stream2.isTTY,
    ...options
  });
  return translateLevel(level);
}
var env2, flagForceColor, supportsColor, supports_color_default;
var init_supports_color = __esm({
  "../../node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/vendor/supports-color/index.js"() {
    init_import_meta_url();
    __name(hasFlag, "hasFlag");
    ({ env: env2 } = process7__default.default);
    if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
      flagForceColor = 0;
    } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
      flagForceColor = 1;
    }
    __name(envForceColor, "envForceColor");
    __name(translateLevel, "translateLevel");
    __name(_supportsColor, "_supportsColor");
    __name(createSupportsColor, "createSupportsColor");
    supportsColor = {
      stdout: createSupportsColor({ isTTY: tty__default.default.isatty(1) }),
      stderr: createSupportsColor({ isTTY: tty__default.default.isatty(2) })
    };
    supports_color_default = supportsColor;
  }
});

// ../../node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/utilities.js
function stringReplaceAll(string, substring2, replacer2) {
  let index = string.indexOf(substring2);
  if (index === -1) {
    return string;
  }
  const substringLength = substring2.length;
  let endIndex = 0;
  let returnValue = "";
  do {
    returnValue += string.slice(endIndex, index) + substring2 + replacer2;
    endIndex = index + substringLength;
    index = string.indexOf(substring2, endIndex);
  } while (index !== -1);
  returnValue += string.slice(endIndex);
  return returnValue;
}
function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {
  let endIndex = 0;
  let returnValue = "";
  do {
    const gotCR = string[index - 1] === "\r";
    returnValue += string.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
    endIndex = index + 1;
    index = string.indexOf("\n", endIndex);
  } while (index !== -1);
  returnValue += string.slice(endIndex);
  return returnValue;
}
var init_utilities = __esm({
  "../../node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/utilities.js"() {
    init_import_meta_url();
    __name(stringReplaceAll, "stringReplaceAll");
    __name(stringEncaseCRLFWithFirstIndex, "stringEncaseCRLFWithFirstIndex");
  }
});

// ../../node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/index.js
function createChalk(options) {
  return chalkFactory(options);
}
var stdoutColor, stderrColor, GENERATOR, STYLER, IS_EMPTY, levelMapping, styles2, applyOptions, chalkFactory, getModelAnsi, usedModels, proto, createStyler, createBuilder, applyStyle, chalk, source_default;
var init_source = __esm({
  "../../node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/index.js"() {
    init_import_meta_url();
    init_ansi_styles();
    init_supports_color();
    init_utilities();
    ({ stdout: stdoutColor, stderr: stderrColor } = supports_color_default);
    GENERATOR = Symbol("GENERATOR");
    STYLER = Symbol("STYLER");
    IS_EMPTY = Symbol("IS_EMPTY");
    levelMapping = [
      "ansi",
      "ansi",
      "ansi256",
      "ansi16m"
    ];
    styles2 = /* @__PURE__ */ Object.create(null);
    applyOptions = /* @__PURE__ */ __name((object, options = {}) => {
      if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
        throw new Error("The `level` option should be an integer from 0 to 3");
      }
      const colorLevel = stdoutColor ? stdoutColor.level : 0;
      object.level = options.level === void 0 ? colorLevel : options.level;
    }, "applyOptions");
    chalkFactory = /* @__PURE__ */ __name((options) => {
      const chalk2 = /* @__PURE__ */ __name((...strings) => strings.join(" "), "chalk");
      applyOptions(chalk2, options);
      Object.setPrototypeOf(chalk2, createChalk.prototype);
      return chalk2;
    }, "chalkFactory");
    __name(createChalk, "createChalk");
    Object.setPrototypeOf(createChalk.prototype, Function.prototype);
    for (const [styleName, style] of Object.entries(ansi_styles_default)) {
      styles2[styleName] = {
        get() {
          const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);
          Object.defineProperty(this, styleName, { value: builder });
          return builder;
        }
      };
    }
    styles2.visible = {
      get() {
        const builder = createBuilder(this, this[STYLER], true);
        Object.defineProperty(this, "visible", { value: builder });
        return builder;
      }
    };
    getModelAnsi = /* @__PURE__ */ __name((model, level, type, ...arguments_) => {
      if (model === "rgb") {
        if (level === "ansi16m") {
          return ansi_styles_default[type].ansi16m(...arguments_);
        }
        if (level === "ansi256") {
          return ansi_styles_default[type].ansi256(ansi_styles_default.rgbToAnsi256(...arguments_));
        }
        return ansi_styles_default[type].ansi(ansi_styles_default.rgbToAnsi(...arguments_));
      }
      if (model === "hex") {
        return getModelAnsi("rgb", level, type, ...ansi_styles_default.hexToRgb(...arguments_));
      }
      return ansi_styles_default[type][model](...arguments_);
    }, "getModelAnsi");
    usedModels = ["rgb", "hex", "ansi256"];
    for (const model of usedModels) {
      styles2[model] = {
        get() {
          const { level } = this;
          return function(...arguments_) {
            const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansi_styles_default.color.close, this[STYLER]);
            return createBuilder(this, styler, this[IS_EMPTY]);
          };
        }
      };
      const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
      styles2[bgModel] = {
        get() {
          const { level } = this;
          return function(...arguments_) {
            const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansi_styles_default.bgColor.close, this[STYLER]);
            return createBuilder(this, styler, this[IS_EMPTY]);
          };
        }
      };
    }
    proto = Object.defineProperties(() => {
    }, {
      ...styles2,
      level: {
        enumerable: true,
        get() {
          return this[GENERATOR].level;
        },
        set(level) {
          this[GENERATOR].level = level;
        }
      }
    });
    createStyler = /* @__PURE__ */ __name((open3, close2, parent) => {
      let openAll;
      let closeAll;
      if (parent === void 0) {
        openAll = open3;
        closeAll = close2;
      } else {
        openAll = parent.openAll + open3;
        closeAll = close2 + parent.closeAll;
      }
      return {
        open: open3,
        close: close2,
        openAll,
        closeAll,
        parent
      };
    }, "createStyler");
    createBuilder = /* @__PURE__ */ __name((self2, _styler, _isEmpty) => {
      const builder = /* @__PURE__ */ __name((...arguments_) => applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" ")), "builder");
      Object.setPrototypeOf(builder, proto);
      builder[GENERATOR] = self2;
      builder[STYLER] = _styler;
      builder[IS_EMPTY] = _isEmpty;
      return builder;
    }, "createBuilder");
    applyStyle = /* @__PURE__ */ __name((self2, string) => {
      if (self2.level <= 0 || !string) {
        return self2[IS_EMPTY] ? "" : string;
      }
      let styler = self2[STYLER];
      if (styler === void 0) {
        return string;
      }
      const { openAll, closeAll } = styler;
      if (string.includes("\x1B")) {
        while (styler !== void 0) {
          string = stringReplaceAll(string, styler.close, styler.open);
          styler = styler.parent;
        }
      }
      const lfIndex = string.indexOf("\n");
      if (lfIndex !== -1) {
        string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
      }
      return openAll + string + closeAll;
    }, "applyStyle");
    Object.defineProperties(createChalk.prototype, styles2);
    chalk = createChalk();
    createChalk({ level: stderrColor ? stderrColor.level : 0 });
    source_default = chalk;
  }
});

// ../cli/colors.ts
var white, gray, dim, hidden, bold, cyanBright, bgCyan, brandColor, black, blue, bgBlue, red, bgRed, green, bgGreen, yellow, bgYellow;
var init_colors = __esm({
  "../cli/colors.ts"() {
    init_import_meta_url();
    init_source();
    ({ white, gray, dim, hidden, bold, cyanBright, bgCyan } = source_default);
    brandColor = source_default.hex("#BD5B08");
    black = source_default.hex("#111");
    blue = source_default.hex("#0E838F");
    bgBlue = black.bgHex("#0E838F");
    red = source_default.hex("#AB2526");
    bgRed = black.bgHex("#AB2526");
    green = source_default.hex("#218529");
    bgGreen = black.bgHex("#218529");
    yellow = source_default.hex("#7F7322");
    bgYellow = black.bgHex("#7F7322");
  }
});

// ../containers-shared/src/client/core/ApiError.ts
var ApiError;
var init_ApiError = __esm({
  "../containers-shared/src/client/core/ApiError.ts"() {
    init_import_meta_url();
    ApiError = class extends Error {
      static {
        __name(this, "ApiError");
      }
      url;
      status;
      statusText;
      body;
      request;
      constructor(request4, response, message) {
        super(message);
        this.name = "ApiError";
        this.url = response.url;
        this.status = response.status;
        this.statusText = response.statusText;
        this.body = response.body;
        this.request = request4;
      }
    };
  }
});

// ../containers-shared/src/client/core/CancelablePromise.ts
var CancelError, CancelablePromise;
var init_CancelablePromise = __esm({
  "../containers-shared/src/client/core/CancelablePromise.ts"() {
    init_import_meta_url();
    CancelError = class extends Error {
      static {
        __name(this, "CancelError");
      }
      constructor(message) {
        super(message);
        this.name = "CancelError";
      }
      get isCancelled() {
        return true;
      }
    };
    CancelablePromise = class {
      static {
        __name(this, "CancelablePromise");
      }
      #isResolved;
      #isRejected;
      #isCancelled;
      #cancelHandlers;
      #promise;
      #resolve;
      #reject;
      constructor(executor) {
        this.#isResolved = false;
        this.#isRejected = false;
        this.#isCancelled = false;
        this.#cancelHandlers = [];
        this.#promise = new Promise((resolve32, reject) => {
          this.#resolve = resolve32;
          this.#reject = reject;
          const onResolve = /* @__PURE__ */ __name((value) => {
            if (this.#isResolved || this.#isRejected || this.#isCancelled) {
              return;
            }
            this.#isResolved = true;
            this.#resolve?.(value);
          }, "onResolve");
          const onReject = /* @__PURE__ */ __name((reason) => {
            if (this.#isResolved || this.#isRejected || this.#isCancelled) {
              return;
            }
            this.#isRejected = true;
            this.#reject?.(reason);
          }, "onReject");
          const onCancel = /* @__PURE__ */ __name((cancelHandler) => {
            if (this.#isResolved || this.#isRejected || this.#isCancelled) {
              return;
            }
            this.#cancelHandlers.push(cancelHandler);
          }, "onCancel");
          Object.defineProperty(onCancel, "isResolved", {
            get: /* @__PURE__ */ __name(() => this.#isResolved, "get")
          });
          Object.defineProperty(onCancel, "isRejected", {
            get: /* @__PURE__ */ __name(() => this.#isRejected, "get")
          });
          Object.defineProperty(onCancel, "isCancelled", {
            get: /* @__PURE__ */ __name(() => this.#isCancelled, "get")
          });
          return executor(onResolve, onReject, onCancel);
        });
      }
      get [Symbol.toStringTag]() {
        return "Cancellable Promise";
      }
      then(onFulfilled, onRejected) {
        return this.#promise.then(onFulfilled, onRejected);
      }
      catch(onRejected) {
        return this.#promise.catch(onRejected);
      }
      finally(onFinally) {
        return this.#promise.finally(onFinally);
      }
      cancel() {
        if (this.#isResolved || this.#isRejected || this.#isCancelled) {
          return;
        }
        this.#isCancelled = true;
        if (this.#cancelHandlers.length) {
          try {
            for (const cancelHandler of this.#cancelHandlers) {
              cancelHandler();
            }
          } catch (error2) {
            console.warn("Cancellation threw an error", error2);
            return;
          }
        }
        this.#cancelHandlers.length = 0;
        this.#reject?.(new CancelError("Request aborted"));
      }
      get isCancelled() {
        return this.#isCancelled;
      }
    };
  }
});

// ../containers-shared/src/client/core/OpenAPI.ts
var OpenAPI;
var init_OpenAPI = __esm({
  "../containers-shared/src/client/core/OpenAPI.ts"() {
    init_import_meta_url();
    OpenAPI = {
      BASE: "",
      VERSION: "1.0.0",
      WITH_CREDENTIALS: false,
      CREDENTIALS: "include",
      TOKEN: void 0,
      USERNAME: void 0,
      PASSWORD: void 0,
      HEADERS: void 0,
      ENCODE_PATH: void 0,
      LOGGER: void 0
    };
  }
});

// ../containers-shared/src/client/core/request.ts
var isDefined, isString2, isStringWithValue, isBlob, base64, getQueryString, getUrl, getFormData, resolve6, getHeaders, getRequestBody, isResponseSchemaV4, parseResponseSchemaV4, sendRequest, getResponseHeader, getResponseBody, catchErrorCodes, executeRequest, buildApiResult, request, requestPaginated, debugLogRequest, debugLogResponse;
var init_request = __esm({
  "../containers-shared/src/client/core/request.ts"() {
    init_import_meta_url();
    init_ApiError();
    init_CancelablePromise();
    isDefined = /* @__PURE__ */ __name((value) => {
      return value !== void 0 && value !== null;
    }, "isDefined");
    isString2 = /* @__PURE__ */ __name((value) => {
      return typeof value === "string";
    }, "isString");
    isStringWithValue = /* @__PURE__ */ __name((value) => {
      return isString2(value) && value !== "";
    }, "isStringWithValue");
    isBlob = /* @__PURE__ */ __name((value) => {
      return typeof value === "object" && typeof value.type === "string" && typeof value.stream === "function" && typeof value.arrayBuffer === "function" && typeof value.constructor === "function" && typeof value.constructor.name === "string" && /^(Blob|File)$/.test(value.constructor.name) && /^(Blob|File)$/.test(value[Symbol.toStringTag]);
    }, "isBlob");
    base64 = /* @__PURE__ */ __name((str) => {
      try {
        return btoa(str);
      } catch (err) {
        return Buffer.from(str).toString("base64");
      }
    }, "base64");
    getQueryString = /* @__PURE__ */ __name((params) => {
      const qs = [];
      const append = /* @__PURE__ */ __name((key, value) => {
        qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`);
      }, "append");
      const process19 = /* @__PURE__ */ __name((key, value) => {
        if (isDefined(value)) {
          if (Array.isArray(value)) {
            value.forEach((v8) => {
              process19(key, v8);
            });
          } else if (typeof value === "object") {
            Object.entries(value).forEach(([k7, v8]) => {
              process19(`${key}[${k7}]`, v8);
            });
          } else {
            append(key, value);
          }
        }
      }, "process");
      Object.entries(params).forEach(([key, value]) => {
        process19(key, value);
      });
      if (qs.length > 0) {
        return `?${qs.join("&")}`;
      }
      return "";
    }, "getQueryString");
    getUrl = /* @__PURE__ */ __name((config, options) => {
      const encoder = config.ENCODE_PATH || encodeURI;
      const path84 = options.url.replace("{api-version}", config.VERSION).replace(/{(.*?)}/g, (substring2, group) => {
        if (options.path?.hasOwnProperty(group)) {
          return encoder(String(options.path[group]));
        }
        return substring2;
      });
      const url4 = `${config.BASE}${path84}`;
      if (options.query) {
        return `${url4}${getQueryString(options.query)}`;
      }
      return url4;
    }, "getUrl");
    getFormData = /* @__PURE__ */ __name((options) => {
      if (options.formData) {
        const formData = new FormData();
        const process19 = /* @__PURE__ */ __name(async (key, value) => {
          if (isString2(value)) {
            formData.append(key, value);
          } else {
            formData.append(key, JSON.stringify(value));
          }
        }, "process");
        Object.entries(options.formData).filter(([_5, value]) => isDefined(value)).forEach(([key, value]) => {
          if (Array.isArray(value)) {
            value.forEach((v8) => process19(key, v8));
          } else {
            process19(key, value);
          }
        });
        return formData;
      }
      return void 0;
    }, "getFormData");
    resolve6 = /* @__PURE__ */ __name(async (options, resolver) => {
      if (typeof resolver === "function") {
        return resolver(options);
      }
      return resolver;
    }, "resolve");
    getHeaders = /* @__PURE__ */ __name(async (config, options) => {
      const token = await resolve6(options, config.TOKEN);
      const username = await resolve6(options, config.USERNAME);
      const password = await resolve6(options, config.PASSWORD);
      const additionalHeaders = await resolve6(options, config.HEADERS);
      const headers = Object.entries({
        Accept: "application/json",
        ...additionalHeaders,
        ...options.headers
      }).filter(([_5, value]) => isDefined(value)).reduce(
        (headers2, [key, value]) => ({
          ...headers2,
          [key]: String(value)
        }),
        {}
      );
      if (isStringWithValue(token)) {
        headers["Authorization"] = `Bearer ${token}`;
      }
      if (isStringWithValue(username) && isStringWithValue(password)) {
        const credentials = base64(`${username}:${password}`);
        headers["Authorization"] = `Basic ${credentials}`;
      }
      if (options.body) {
        if (options.mediaType) {
          headers["Content-Type"] = options.mediaType;
        } else if (isBlob(options.body)) {
          headers["Content-Type"] = options.body.type || "application/octet-stream";
        } else if (isString2(options.body)) {
          headers["Content-Type"] = "text/plain";
        } else {
          headers["Content-Type"] = "application/json";
        }
      }
      return new Headers(headers);
    }, "getHeaders");
    getRequestBody = /* @__PURE__ */ __name((options) => {
      if (options.body !== void 0) {
        if (options.mediaType?.includes("/json")) {
          return JSON.stringify(options.body);
        } else if (isString2(options.body) || isBlob(options.body)) {
          return options.body;
        } else {
          return JSON.stringify(options.body);
        }
      }
      return void 0;
    }, "getRequestBody");
    isResponseSchemaV4 = /* @__PURE__ */ __name((config, _options) => {
      return config.BASE.endsWith("/containers");
    }, "isResponseSchemaV4");
    parseResponseSchemaV4 = /* @__PURE__ */ __name((url4, response, responseHeader, responseBody) => {
      const fetchResult2 = typeof responseBody === "object" ? responseBody : JSON.parse(responseBody);
      const ok = response.ok && fetchResult2.success;
      let result;
      if (ok) {
        if (fetchResult2.result !== void 0) {
          result = fetchResult2.result;
        } else {
          result = {};
        }
      } else {
        result = { error: fetchResult2.errors?.[0]?.message };
      }
      return {
        url: url4,
        ok,
        status: response.status,
        statusText: response.statusText,
        body: responseHeader ?? result
      };
    }, "parseResponseSchemaV4");
    sendRequest = /* @__PURE__ */ __name(async (config, options, url4, body, formData, headers, onCancel) => {
      const controller = new AbortController();
      const request4 = {
        headers,
        body: body ?? formData,
        method: options.method,
        signal: controller.signal
      };
      if (config.WITH_CREDENTIALS) {
        request4.credentials = config.CREDENTIALS;
      }
      onCancel(() => controller.abort());
      return await fetch(url4, request4);
    }, "sendRequest");
    getResponseHeader = /* @__PURE__ */ __name((response, responseHeader) => {
      if (responseHeader) {
        const content = response.headers.get(responseHeader);
        if (isString2(content)) {
          return content;
        }
      }
      return void 0;
    }, "getResponseHeader");
    getResponseBody = /* @__PURE__ */ __name(async (response) => {
      if (response.status !== 204) {
        try {
          const contentType = response.headers.get("Content-Type");
          if (contentType) {
            const jsonTypes = ["application/json", "application/problem+json"];
            const isJSON = jsonTypes.some(
              (type) => contentType.toLowerCase().startsWith(type)
            );
            if (isJSON) {
              return await response.json();
            } else {
              return await response.text();
            }
          }
        } catch (error2) {
          console.error(error2);
        }
      }
      return void 0;
    }, "getResponseBody");
    catchErrorCodes = /* @__PURE__ */ __name((options, result) => {
      const errors = {
        400: "Bad Request",
        401: "Unauthorized",
        403: "Forbidden",
        404: "Not Found",
        500: "Internal Server Error",
        502: "Bad Gateway",
        503: "Service Unavailable",
        ...options.errors
      };
      const error2 = errors[result.status];
      if (error2) {
        throw new ApiError(options, result, error2);
      }
      if (!result.ok) {
        throw new ApiError(options, result, "Generic Error");
      }
    }, "catchErrorCodes");
    executeRequest = /* @__PURE__ */ __name(async (config, options, onCancel) => {
      const url4 = getUrl(config, options);
      const formData = getFormData(options);
      const body = getRequestBody(options);
      const headers = await getHeaders(config, options);
      debugLogRequest(config, url4, headers, formData ?? body ?? {});
      if (onCancel.isCancelled) {
        return null;
      }
      const response = await sendRequest(
        config,
        options,
        url4,
        body,
        formData,
        headers,
        onCancel
      );
      const responseBody = await getResponseBody(response);
      const responseHeader = getResponseHeader(response, options.responseHeader);
      return { url: url4, response, responseBody, responseHeader };
    }, "executeRequest");
    buildApiResult = /* @__PURE__ */ __name((config, options, req) => {
      if (isResponseSchemaV4(config, options)) {
        return parseResponseSchemaV4(
          req.url,
          req.response,
          req.responseHeader,
          req.responseBody
        );
      }
      return {
        url: req.url,
        ok: req.response.ok,
        status: req.response.status,
        statusText: req.response.statusText,
        body: req.responseHeader ?? req.responseBody
      };
    }, "buildApiResult");
    request = /* @__PURE__ */ __name((config, options) => {
      return new CancelablePromise(async (resolve32, reject, onCancel) => {
        try {
          const req = await executeRequest(config, options, onCancel);
          if (!req) {
            return;
          }
          const result = buildApiResult(config, options, req);
          debugLogResponse(config, result);
          catchErrorCodes(options, result);
          resolve32(result.body);
        } catch (error2) {
          reject(error2);
        }
      });
    }, "request");
    requestPaginated = /* @__PURE__ */ __name((config, options) => {
      return new CancelablePromise(async (resolve32, reject, onCancel) => {
        try {
          const req = await executeRequest(config, options, onCancel);
          if (!req) {
            return;
          }
          const result = buildApiResult(config, options, req);
          debugLogResponse(config, result);
          catchErrorCodes(options, result);
          let resultInfo;
          if (isResponseSchemaV4(config, options)) {
            const fetchResult2 = typeof req.responseBody === "object" ? req.responseBody : JSON.parse(req.responseBody);
            resultInfo = fetchResult2.result_info;
          }
          resolve32({
            data: result.body,
            resultInfo
          });
        } catch (error2) {
          reject(error2);
        }
      });
    }, "requestPaginated");
    debugLogRequest = /* @__PURE__ */ __name(async (config, url4, headers, body) => {
      config.LOGGER?.debug(`-- START CF API REQUEST: ${url4}`);
      const logHeaders2 = new Headers(headers);
      logHeaders2.delete("Authorization");
      config.LOGGER?.debugWithSanitization(
        "HEADERS:",
        JSON.stringify(logHeaders2, null, 2)
      );
      config.LOGGER?.debugWithSanitization(
        "BODY:",
        JSON.stringify(
          body instanceof FormData ? await new Response(body).text() : body,
          null,
          2
        )
      );
      config.LOGGER?.debug("-- END CF API REQUEST");
    }, "debugLogRequest");
    debugLogResponse = /* @__PURE__ */ __name((config, response) => {
      config.LOGGER?.debug(
        "-- START CF API RESPONSE:",
        response.statusText,
        response.status
      );
      config.LOGGER?.debugWithSanitization("RESPONSE:", response.body);
      config.LOGGER?.debug("-- END CF API RESPONSE");
    }, "debugLogResponse");
  }
});

// ../containers-shared/src/client/models/ApplicationAffinityColocation.ts
var init_ApplicationAffinityColocation = __esm({
  "../containers-shared/src/client/models/ApplicationAffinityColocation.ts"() {
    init_import_meta_url();
  }
});

// ../containers-shared/src/client/models/ApplicationAffinityHardwareGeneration.ts
var init_ApplicationAffinityHardwareGeneration = __esm({
  "../containers-shared/src/client/models/ApplicationAffinityHardwareGeneration.ts"() {
    init_import_meta_url();
  }
});

// ../containers-shared/src/client/models/ApplicationMutationError.ts
var init_ApplicationMutationError = __esm({
  "../containers-shared/src/client/models/ApplicationMutationError.ts"() {
    init_import_meta_url();
  }
});

// ../containers-shared/src/client/models/ApplicationRollout.ts
var ApplicationRollout;
var init_ApplicationRollout = __esm({
  "../containers-shared/src/client/models/ApplicationRollout.ts"() {
    init_import_meta_url();
    ((ApplicationRollout2) => {
      ((kind3) => {
        kind3["FULL_AUTO"] = "full_auto";
        kind3["FULL_MANUAL"] = "full_manual";
        kind3["DURABLE_OBJECTS_AUTO"] = "durable_objects_auto";
      })(ApplicationRollout2.kind || (ApplicationRollout2.kind = {}));
      ((strategy2) => {
        strategy2["ROLLING"] = "rolling";
      })(ApplicationRollout2.strategy || (ApplicationRollout2.strategy = {}));
      ((status3) => {
        status3["PENDING"] = "pending";
        status3["PROGRESSING"] = "progressing";
        status3["COMPLETED"] = "completed";
        status3["REVERTED"] = "reverted";
        status3["REPLACED"] = "replaced";
      })(ApplicationRollout2.status || (ApplicationRollout2.status = {}));
    })(ApplicationRollout || (ApplicationRollout = {}));
  }
});

// ../containers-shared/src/client/models/AssignIPv4.ts
var init_AssignIPv4 = __esm({
  "../containers-shared/src/client/models/AssignIPv4.ts"() {
    init_import_meta_url();
  }
});

// ../containers-shared/src/client/models/AssignIPv6.ts
var init_AssignIPv6 = __esm({
  "../containers-shared/src/client/models/AssignIPv6.ts"() {
    init_import_meta_url();
  }
});

// ../containers-shared/src/client/models/BadRequestWithCodeError.ts
var BadRequestWithCodeError;
var init_BadRequestWithCodeError = __esm({
  "../containers-shared/src/client/models/BadRequestWithCodeError.ts"() {
    init_import_meta_url();
    ((BadRequestWithCodeError2) => {
      ((error3) => {
        error3["VALIDATE_INPUT"] = "VALIDATE_INPUT";
      })(BadRequestWithCodeError2.error || (BadRequestWithCodeError2.error = {}));
    })(BadRequestWithCodeError || (BadRequestWithCodeError = {}));
  }
});

// ../containers-shared/src/client/models/ContainerNetworkMode.ts
var init_ContainerNetworkMode = __esm({
  "../containers-shared/src/client/models/ContainerNetworkMode.ts"() {
    init_import_meta_url();
  }
});

// ../containers-shared/src/client/models/CreateApplicationRolloutRequest.ts
var CreateApplicationRolloutRequest;
var init_CreateApplicationRolloutRequest = __esm({
  "../containers-shared/src/client/models/CreateApplicationRolloutRequest.ts"() {
    init_import_meta_url();
    ((CreateApplicationRolloutRequest2) => {
      ((strategy2) => {
        strategy2["ROLLING"] = "rolling";
      })(CreateApplicationRolloutRequest2.strategy || (CreateApplicationRolloutRequest2.strategy = {}));
      ((step_percentage2) => {
        step_percentage2[step_percentage2["_5"] = 5] = "_5";
        step_percentage2[step_percentage2["_10"] = 10] = "_10";
        step_percentage2[step_percentage2["_20"] = 20] = "_20";
        step_percentage2[step_percentage2["_25"] = 25] = "_25";
        step_percentage2[step_percentage2["_50"] = 50] = "_50";
        step_percentage2[step_percentage2["_100"] = 100] = "_100";
      })(CreateApplicationRolloutRequest2.step_percentage || (CreateApplicationRolloutRequest2.step_percentage = {}));
      ((kind3) => {
        kind3["FULL_AUTO"] = "full_auto";
        kind3["FULL_MANUAL"] = "full_manual";
      })(CreateApplicationRolloutRequest2.kind || (CreateApplicationRolloutRequest2.kind = {}));
    })(CreateApplicationRolloutRequest || (CreateApplicationRolloutRequest = {}));
  }
});

// ../containers-shared/src/client/models/DeploymentCheckKind.ts
var init_DeploymentCheckKind = __esm({
  "../containers-shared/src/client/models/DeploymentCheckKind.ts"() {
    init_import_meta_url();
  }
});

// ../containers-shared/src/client/models/DeploymentCheckType.ts
var init_DeploymentCheckType = __esm({
  "../containers-shared/src/client/models/DeploymentCheckType.ts"() {
    init_import_meta_url();
  }
});

// ../containers-shared/src/client/models/DeploymentMutationError.ts
var DeploymentMutationError;
var init_DeploymentMutationError = __esm({
  "../containers-shared/src/client/models/DeploymentMutationError.ts"() {
    init_import_meta_url();
    DeploymentMutationError = /* @__PURE__ */ ((DeploymentMutationError2) => {
      DeploymentMutationError2["VALIDATE_INPUT"] = "VALIDATE_INPUT";
      DeploymentMutationError2["SURPASSED_BASE_LIMITS"] = "SURPASSED_BASE_LIMITS";
      DeploymentMutationError2["SURPASSED_TOTAL_LIMITS"] = "SURPASSED_TOTAL_LIMITS";
      DeploymentMutationError2["LOCATION_NOT_ALLOWED"] = "LOCATION_NOT_ALLOWED";
      DeploymentMutationError2["LOCATION_SURPASSED_BASE_LIMITS"] = "LOCATION_SURPASSED_BASE_LIMITS";
      DeploymentMutationError2["IMAGE_REGISTRY_NOT_CONFIGURED"] = "IMAGE_REGISTRY_NOT_CONFIGURED";
      return DeploymentMutationError2;
    })(DeploymentMutationError || {});
  }
});

// ../containers-shared/src/client/models/DeploymentNotFoundError.ts
var DeploymentNotFoundError;
var init_DeploymentNotFoundError = __esm({
  "../containers-shared/src/client/models/DeploymentNotFoundError.ts"() {
    init_import_meta_url();
    ((DeploymentNotFoundError2) => {
      ((error3) => {
        error3["DEPLOYMENT_NOT_FOUND"] = "DEPLOYMENT_NOT_FOUND";
      })(DeploymentNotFoundError2.error || (DeploymentNotFoundError2.error = {}));
    })(DeploymentNotFoundError || (DeploymentNotFoundError = {}));
  }
});

// ../containers-shared/src/client/models/DeploymentPlacementState.ts
var init_DeploymentPlacementState = __esm({
  "../containers-shared/src/client/models/DeploymentPlacementState.ts"() {
    init_import_meta_url();
  }
});

// ../containers-shared/src/client/models/DeploymentQueuedReason.ts
var init_DeploymentQueuedReason = __esm({
  "../containers-shared/src/client/models/DeploymentQueuedReason.ts"() {
    init_import_meta_url();
  }
});

// ../containers-shared/src/client/models/DeploymentSchedulingState.ts
var init_DeploymentSchedulingState = __esm({
  "../containers-shared/src/client/models/DeploymentSchedulingState.ts"() {
    init_import_meta_url();
  }
});

// ../containers-shared/src/client/models/DeploymentType.ts
var init_DeploymentType = __esm({
  "../containers-shared/src/client/models/DeploymentType.ts"() {
    init_import_meta_url();
  }
});

// ../containers-shared/src/client/models/DurableObjectStatusHealth.ts
var init_DurableObjectStatusHealth = __esm({
  "../containers-shared/src/client/models/DurableObjectStatusHealth.ts"() {
    init_import_meta_url();
  }
});

// ../containers-shared/src/client/models/EventName.ts
var init_EventName = __esm({
  "../containers-shared/src/client/models/EventName.ts"() {
    init_import_meta_url();
  }
});

// ../containers-shared/src/client/models/EventType.ts
var init_EventType = __esm({
  "../containers-shared/src/client/models/EventType.ts"() {
    init_import_meta_url();
  }
});

// ../containers-shared/src/client/models/ExternalRegistryKind.ts
var ExternalRegistryKind;
var init_ExternalRegistryKind = __esm({
  "../containers-shared/src/client/models/ExternalRegistryKind.ts"() {
    init_import_meta_url();
    ExternalRegistryKind = /* @__PURE__ */ ((ExternalRegistryKind2) => {
      ExternalRegistryKind2["ECR"] = "ECR";
      ExternalRegistryKind2["DOCKER_HUB"] = "DockerHub";
      return ExternalRegistryKind2;
    })(ExternalRegistryKind || {});
  }
});

// ../containers-shared/src/client/models/HTTPMethod.ts
var init_HTTPMethod = __esm({
  "../containers-shared/src/client/models/HTTPMethod.ts"() {
    init_import_meta_url();
  }
});

// ../containers-shared/src/client/models/ImageRegistryAlreadyExistsError.ts
var ImageRegistryAlreadyExistsError;
var init_ImageRegistryAlreadyExistsError = __esm({
  "../containers-shared/src/client/models/ImageRegistryAlreadyExistsError.ts"() {
    init_import_meta_url();
    ((ImageRegistryAlreadyExistsError2) => {
      ((error3) => {
        error3["IMAGE_REGISTRY_ALREADY_EXISTS"] = "IMAGE_REGISTRY_ALREADY_EXISTS";
      })(ImageRegistryAlreadyExistsError2.error || (ImageRegistryAlreadyExistsError2.error = {}));
    })(ImageRegistryAlreadyExistsError || (ImageRegistryAlreadyExistsError = {}));
  }
});

// ../containers-shared/src/client/models/ImageRegistryIsPublic.ts
var ImageRegistryIsPublic;
var init_ImageRegistryIsPublic = __esm({
  "../containers-shared/src/client/models/ImageRegistryIsPublic.ts"() {
    init_import_meta_url();
    ((ImageRegistryIsPublic2) => {
      ((error3) => {
        error3["IMAGE_REGISTRY_IS_PUBLIC"] = "IMAGE_REGISTRY_IS_PUBLIC";
      })(ImageRegistryIsPublic2.error || (ImageRegistryIsPublic2.error = {}));
    })(ImageRegistryIsPublic || (ImageRegistryIsPublic = {}));
  }
});

// ../containers-shared/src/client/models/ImageRegistryNotAllowedError.ts
var ImageRegistryNotAllowedError;
var init_ImageRegistryNotAllowedError = __esm({
  "../containers-shared/src/client/models/ImageRegistryNotAllowedError.ts"() {
    init_import_meta_url();
    ((ImageRegistryNotAllowedError2) => {
      ((error3) => {
        error3["IMAGE_REGISTRY_NOT_ALLOWED"] = "IMAGE_REGISTRY_NOT_ALLOWED";
      })(ImageRegistryNotAllowedError2.error || (ImageRegistryNotAllowedError2.error = {}));
    })(ImageRegistryNotAllowedError || (ImageRegistryNotAllowedError = {}));
  }
});

// ../containers-shared/src/client/models/ImageRegistryNotFoundError.ts
var ImageRegistryNotFoundError;
var init_ImageRegistryNotFoundError = __esm({
  "../containers-shared/src/client/models/ImageRegistryNotFoundError.ts"() {
    init_import_meta_url();
    ((ImageRegistryNotFoundError2) => {
      ((error3) => {
        error3["IMAGE_REGISTRY_NOT_FOUND"] = "IMAGE_REGISTRY_NOT_FOUND";
      })(ImageRegistryNotFoundError2.error || (ImageRegistryNotFoundError2.error = {}));
    })(ImageRegistryNotFoundError || (ImageRegistryNotFoundError = {}));
  }
});

// ../containers-shared/src/client/models/ImageRegistryPermissions.ts
var init_ImageRegistryPermissions = __esm({
  "../containers-shared/src/client/models/ImageRegistryPermissions.ts"() {
    init_import_meta_url();
  }
});

// ../containers-shared/src/client/models/ImageRegistryProtocolAlreadyExists.ts
var ImageRegistryProtocolAlreadyExists;
var init_ImageRegistryProtocolAlreadyExists = __esm({
  "../containers-shared/src/client/models/ImageRegistryProtocolAlreadyExists.ts"() {
    init_import_meta_url();
    ((ImageRegistryProtocolAlreadyExists2) => {
      ((error3) => {
        error3["IMAGE_REGISTRY_PROTOCOL_ALREADY_EXISTS"] = "IMAGE_REGISTRY_PROTOCOL_ALREADY_EXISTS";
      })(ImageRegistryProtocolAlreadyExists2.error || (ImageRegistryProtocolAlreadyExists2.error = {}));
    })(ImageRegistryProtocolAlreadyExists || (ImageRegistryProtocolAlreadyExists = {}));
  }
});

// ../containers-shared/src/client/models/ImageRegistryProtocolIsReferencedError.ts
var ImageRegistryProtocolIsReferencedError;
var init_ImageRegistryProtocolIsReferencedError = __esm({
  "../containers-shared/src/client/models/ImageRegistryProtocolIsReferencedError.ts"() {
    init_import_meta_url();
    ((ImageRegistryProtocolIsReferencedError2) => {
      ((error3) => {
        error3["IMAGE_REGISTRY_PROTO_IS_REFERENCED"] = "IMAGE_REGISTRY_PROTO_IS_REFERENCED";
      })(ImageRegistryProtocolIsReferencedError2.error || (ImageRegistryProtocolIsReferencedError2.error = {}));
    })(ImageRegistryProtocolIsReferencedError || (ImageRegistryProtocolIsReferencedError = {}));
  }
});

// ../containers-shared/src/client/models/ImageRegistryProtocolNotFound.ts
var ImageRegistryProtocolNotFound;
var init_ImageRegistryProtocolNotFound = __esm({
  "../containers-shared/src/client/models/ImageRegistryProtocolNotFound.ts"() {
    init_import_meta_url();
    ((ImageRegistryProtocolNotFound2) => {
      ((error3) => {
        error3["IMAGE_REGISTRY_PROTOCOL_NOT_FOUND"] = "IMAGE_REGISTRY_PROTOCOL_NOT_FOUND";
      })(ImageRegistryProtocolNotFound2.error || (ImageRegistryProtocolNotFound2.error = {}));
    })(ImageRegistryProtocolNotFound || (ImageRegistryProtocolNotFound = {}));
  }
});

// ../containers-shared/src/client/models/InstanceType.ts
var init_InstanceType = __esm({
  "../containers-shared/src/client/models/InstanceType.ts"() {
    init_import_meta_url();
  }
});

// ../containers-shared/src/client/models/IPType.ts
var init_IPType = __esm({
  "../containers-shared/src/client/models/IPType.ts"() {
    init_import_meta_url();
  }
});

// ../containers-shared/src/client/models/JobStatusHealth.ts
var init_JobStatusHealth = __esm({
  "../containers-shared/src/client/models/JobStatusHealth.ts"() {
    init_import_meta_url();
  }
});

// ../containers-shared/src/client/models/NetworkMode.ts
var init_NetworkMode = __esm({
  "../containers-shared/src/client/models/NetworkMode.ts"() {
    init_import_meta_url();
  }
});

// ../containers-shared/src/client/models/NodeGroup.ts
var init_NodeGroup = __esm({
  "../containers-shared/src/client/models/NodeGroup.ts"() {
    init_import_meta_url();
  }
});

// ../containers-shared/src/client/models/PlacementStatusHealth.ts
var init_PlacementStatusHealth = __esm({
  "../containers-shared/src/client/models/PlacementStatusHealth.ts"() {
    init_import_meta_url();
  }
});

// ../containers-shared/src/client/models/ProvisionerConfiguration.ts
var ProvisionerConfiguration;
var init_ProvisionerConfiguration = __esm({
  "../containers-shared/src/client/models/ProvisionerConfiguration.ts"() {
    init_import_meta_url();
    ((ProvisionerConfiguration2) => {
      ((type2) => {
        type2["NONE"] = "none";
        type2["CLOUDINIT"] = "cloudinit";
      })(ProvisionerConfiguration2.type || (ProvisionerConfiguration2.type = {}));
    })(ProvisionerConfiguration || (ProvisionerConfiguration = {}));
  }
});

// ../containers-shared/src/client/models/RolloutStep.ts
var RolloutStep;
var init_RolloutStep = __esm({
  "../containers-shared/src/client/models/RolloutStep.ts"() {
    init_import_meta_url();
    ((RolloutStep2) => {
      ((status3) => {
        status3["PENDING"] = "pending";
        status3["PROGRESSING"] = "progressing";
        status3["REVERTING"] = "reverting";
        status3["COMPLETED"] = "completed";
        status3["REVERTED"] = "reverted";
      })(RolloutStep2.status || (RolloutStep2.status = {}));
    })(RolloutStep || (RolloutStep = {}));
  }
});

// ../containers-shared/src/client/models/SchedulingPolicy.ts
var init_SchedulingPolicy = __esm({
  "../containers-shared/src/client/models/SchedulingPolicy.ts"() {
    init_import_meta_url();
  }
});

// ../containers-shared/src/client/models/SecretAccessType.ts
var init_SecretAccessType = __esm({
  "../containers-shared/src/client/models/SecretAccessType.ts"() {
    init_import_meta_url();
  }
});

// ../containers-shared/src/client/models/SecretNameAlreadyExists.ts
var SecretNameAlreadyExists;
var init_SecretNameAlreadyExists = __esm({
  "../containers-shared/src/client/models/SecretNameAlreadyExists.ts"() {
    init_import_meta_url();
    ((SecretNameAlreadyExists2) => {
      ((error3) => {
        error3["SECRET_NAME_ALREADY_EXISTS"] = "SECRET_NAME_ALREADY_EXISTS";
      })(SecretNameAlreadyExists2.error || (SecretNameAlreadyExists2.error = {}));
    })(SecretNameAlreadyExists || (SecretNameAlreadyExists = {}));
  }
});

// ../containers-shared/src/client/models/SecretNotFound.ts
var SecretNotFound;
var init_SecretNotFound = __esm({
  "../containers-shared/src/client/models/SecretNotFound.ts"() {
    init_import_meta_url();
    ((SecretNotFound2) => {
      ((error3) => {
        error3["SECRET_NAME_NOT_FOUND"] = "SECRET_NAME_NOT_FOUND";
      })(SecretNotFound2.error || (SecretNotFound2.error = {}));
    })(SecretNotFound || (SecretNotFound = {}));
  }
});

// ../containers-shared/src/client/models/SSHPublicKeyNotFoundError.ts
var SSHPublicKeyNotFoundError;
var init_SSHPublicKeyNotFoundError = __esm({
  "../containers-shared/src/client/models/SSHPublicKeyNotFoundError.ts"() {
    init_import_meta_url();
    ((SSHPublicKeyNotFoundError2) => {
      ((error3) => {
        error3["SSH_PUBLIC_KEY_NOT_FOUND"] = "SSH_PUBLIC_KEY_NOT_FOUND";
      })(SSHPublicKeyNotFoundError2.error || (SSHPublicKeyNotFoundError2.error = {}));
    })(SSHPublicKeyNotFoundError || (SSHPublicKeyNotFoundError = {}));
  }
});

// ../containers-shared/src/client/models/UpdateApplicationRolloutRequest.ts
var UpdateApplicationRolloutRequest;
var init_UpdateApplicationRolloutRequest = __esm({
  "../containers-shared/src/client/models/UpdateApplicationRolloutRequest.ts"() {
    init_import_meta_url();
    ((UpdateApplicationRolloutRequest2) => {
      ((action2) => {
        action2["NEXT"] = "next";
        action2["PREVIOUS"] = "previous";
        action2["REVERT"] = "revert";
      })(UpdateApplicationRolloutRequest2.action || (UpdateApplicationRolloutRequest2.action = {}));
    })(UpdateApplicationRolloutRequest || (UpdateApplicationRolloutRequest = {}));
  }
});

// ../containers-shared/src/client/services/AccountService.ts
var AccountService;
var init_AccountService = __esm({
  "../containers-shared/src/client/services/AccountService.ts"() {
    init_import_meta_url();
    init_OpenAPI();
    init_request();
    AccountService = class {
      static {
        __name(this, "AccountService");
      }
      /**
       * Get complete account details related to Cloudchamber
       * Get complete account details related to Cloudchamber, like limits and available locations
       * @returns CompleteAccountCustomer Complete account for the user
       * @throws ApiError
       */
      static getMe() {
        return request(OpenAPI, {
          method: "GET",
          url: "/me",
          errors: {
            401: `Unauthorized`,
            500: `There has been an internal error`
          }
        });
      }
      /**
       * Modify account details like defaults
       * Modify account details like defaults
       * @param requestBody
       * @returns CompleteAccountCustomer Complete account for the user
       * @throws ApiError
       */
      static modifyMe(requestBody) {
        return request(OpenAPI, {
          method: "PATCH",
          url: "/me",
          body: requestBody,
          mediaType: "application/json",
          errors: {
            400: `Bad Request that contains a specific constant code and details object about the error.`,
            401: `Unauthorized`,
            500: `There has been an internal error`
          }
        });
      }
    };
  }
});

// ../containers-shared/src/client/services/ApplicationsService.ts
var ApplicationsService;
var init_ApplicationsService = __esm({
  "../containers-shared/src/client/services/ApplicationsService.ts"() {
    init_import_meta_url();
    init_OpenAPI();
    init_request();
    ApplicationsService = class {
      static {
        __name(this, "ApplicationsService");
      }
      /**
       * Create a new application
       * Create a new application. An Application represents an intent to run one or more containers, with the same image, dynamically scheduled based on constraints
       * @param requestBody
       * @returns Application A newly created application
       * @throws ApiError
       */
      static createApplication(requestBody) {
        return request(OpenAPI, {
          method: "POST",
          url: "/applications",
          body: requestBody,
          mediaType: "application/json",
          errors: {
            400: `Could not create the application because of input/limits reasons, more details in the error code`,
            401: `Unauthorized`,
            500: `There has been an internal error`
          }
        });
      }
      /**
       * List Applications associated with your account
       * Lists all the applications that are associated with your account
       * @param name Filter applications by name
       * @param image Filter applications by image
       * @param label Filter applications by label
       * @returns ListApplications Get all application associated with your account
       * @throws ApiError
       */
      static listApplications(name2, image, label) {
        return request(OpenAPI, {
          method: "GET",
          url: "/applications",
          query: {
            name: name2,
            image,
            label
          },
          errors: {
            401: `Unauthorized`,
            500: `There has been an internal error`
          }
        });
      }
      /**
       * Get a single application by id
       * Returns a single application by id
       * @param applicationId
       * @returns Application A single application
       * @throws ApiError
       */
      static getApplication(applicationId) {
        return request(OpenAPI, {
          method: "GET",
          url: "/applications/{application_id}",
          path: {
            application_id: applicationId
          },
          errors: {
            401: `Unauthorized`,
            404: `Response body when an Application is not found`,
            500: `There has been an internal error`
          }
        });
      }
      /**
       * Modify an application
       * Modifies a single application by id.
       * @param applicationId
       * @param requestBody
       * @returns Application Modify application response
       * @throws ApiError
       */
      static modifyApplication(applicationId, requestBody) {
        return request(OpenAPI, {
          method: "PATCH",
          url: "/applications/{application_id}",
          path: {
            application_id: applicationId
          },
          body: requestBody,
          mediaType: "application/json",
          errors: {
            400: `Could not modify the application because of input/limits reasons, more details in the error code`,
            401: `Unauthorized`,
            404: `Response body when an Application is not found`,
            500: `There has been an internal error`
          }
        });
      }
      /**
       * Delete a single application by id
       * Deletes a single application by id
       * @param applicationId
       * @returns EmptyResponse Delete application response
       * @throws ApiError
       */
      static deleteApplication(applicationId) {
        return request(OpenAPI, {
          method: "DELETE",
          url: "/applications/{application_id}",
          path: {
            application_id: applicationId
          },
          errors: {
            401: `Unauthorized`,
            404: `Response body when an Application is not found`,
            500: `There has been an internal error`
          }
        });
      }
      /**
       * Application queue status
       * Get an application's queue status. Only works under an application with type jobs.
       * @param applicationId
       * @returns ApplicationStatus Application status with details about the job queue, instances and other metadata for introspection.
       * @throws ApiError
       */
      static getApplicationStatus(applicationId) {
        return request(OpenAPI, {
          method: "GET",
          url: "/applications/{application_id}/status",
          path: {
            application_id: applicationId
          },
          errors: {
            401: `Unauthorized`,
            404: `Response body when an Application is not found`,
            500: `There has been an internal error`
          }
        });
      }
      /**
       * Create a new job within an application
       * Returns the created job
       * @param applicationId
       * @param requestBody
       * @returns ApplicationJob A single job within an application
       * @throws ApiError
       */
      static createApplicationJob(applicationId, requestBody) {
        return request(OpenAPI, {
          method: "POST",
          url: "/applications/{application_id}/jobs",
          path: {
            application_id: applicationId
          },
          body: requestBody,
          mediaType: "application/json",
          errors: {
            400: `Can't create the application job because it has bad inputs`,
            401: `Unauthorized`,
            404: `Response body when an Application is not found`,
            500: `There has been an internal error`
          }
        });
      }
      /**
       * Get an application job by application and job id
       * Returns a single application job by id with its current status
       * @param applicationId
       * @param jobId
       * @returns ApplicationJob A single application
       * @throws ApiError
       */
      static getApplicationJob(applicationId, jobId) {
        return request(OpenAPI, {
          method: "GET",
          url: "/applications/{application_id}/jobs/{job_id}",
          path: {
            application_id: applicationId,
            job_id: jobId
          },
          errors: {
            401: `Unauthorized`,
            404: `Response body when an Application/Job is not found`,
            500: `There has been an internal error`
          }
        });
      }
      /**
       * Delete an application job by application and job id
       * Cleans up the specific job from the Application and all its assoicated resources
       * @param applicationId
       * @param jobId
       * @returns GenericMessageResponse Generic OK response
       * @throws ApiError
       */
      static deleteApplicationJob(applicationId, jobId) {
        return request(OpenAPI, {
          method: "DELETE",
          url: "/applications/{application_id}/jobs/{job_id}",
          path: {
            application_id: applicationId,
            job_id: jobId
          },
          errors: {
            401: `Unauthorized`,
            404: `Response body when an Application/Job is not found`,
            500: `There has been an internal error`
          }
        });
      }
      /**
       * Modify an existing application job
       * Modify an application job state
       * @param applicationId
       * @param jobId
       * @param requestBody
       * @returns ApplicationJob A modified job within an application
       * @throws ApiError
       */
      static modifyApplicationJob(applicationId, jobId, requestBody) {
        return request(OpenAPI, {
          method: "PATCH",
          url: "/applications/{application_id}/jobs/{job_id}",
          path: {
            application_id: applicationId,
            job_id: jobId
          },
          body: requestBody,
          mediaType: "application/json",
          errors: {
            400: `Can't modify the application job because it has bad inputs`,
            401: `Unauthorized`,
            404: `Response body when an Application/Job is not found`,
            500: `There has been an internal error`
          }
        });
      }
      /**
       * Create a new rollout for an application
       * A rollout can be used to update the application's configuration across instances with minimal downtime.
       * @param applicationId
       * @param requestBody
       * @returns ApplicationRollout
       * @throws ApiError
       */
      static createApplicationRollout(applicationId, requestBody) {
        return request(OpenAPI, {
          method: "POST",
          url: "/applications/{application_id}/rollouts",
          path: {
            application_id: applicationId
          },
          body: requestBody,
          mediaType: "application/json",
          errors: {
            400: `Can't update the application rollout because it has bad inputs`,
            401: `Unauthorized`,
            404: `Response body when an Application is not found`,
            500: `There has been an internal error`
          }
        });
      }
      /**
       * List rollouts
       * List all rollouts within an application
       * @param applicationId
       * @param limit The amount of rollouts to return. By default it is all of them.
       * @param last The last rollout that was used to paginate
       * @returns ApplicationRollout
       * @throws ApiError
       */
      static listApplicationRollouts(applicationId, limit2, last) {
        return request(OpenAPI, {
          method: "GET",
          url: "/applications/{application_id}/rollouts",
          path: {
            application_id: applicationId
          },
          query: {
            limit: limit2,
            last
          },
          errors: {
            401: `Unauthorized`,
            404: `Response body when an Application is not found`,
            500: `There has been an internal error`
          }
        });
      }
      /**
       * Get a rollout by id within an application
       * View rollout configurations and state for a specific rollout
       * @param applicationId
       * @param rolloutId
       * @returns ApplicationRollout
       * @throws ApiError
       */
      static getApplicationRollout(applicationId, rolloutId) {
        return request(OpenAPI, {
          method: "GET",
          url: "/applications/{application_id}/rollouts/{rollout_id}",
          path: {
            application_id: applicationId,
            rollout_id: rolloutId
          },
          errors: {
            401: `Unauthorized`,
            404: `Response body when an Application is not found`,
            500: `There has been an internal error`
          }
        });
      }
      /**
       * Update a rollout within an application
       * A rollout can be updated to modify its current state. Actions include - next, previous, rollback
       * @param applicationId
       * @param rolloutId
       * @param requestBody
       * @returns UpdateRolloutResponse
       * @throws ApiError
       */
      static updateApplicationRollout(applicationId, rolloutId, requestBody) {
        return request(OpenAPI, {
          method: "POST",
          url: "/applications/{application_id}/rollouts/{rollout_id}",
          path: {
            application_id: applicationId,
            rollout_id: rolloutId
          },
          body: requestBody,
          mediaType: "application/json",
          errors: {
            400: `Can't create the application rollout because it has bad inputs`,
            401: `Unauthorized`,
            404: `Response body when an Application is not found`,
            500: `There has been an internal error`
          }
        });
      }
      /**
       * Delete a rollout within an application by its rollout id
       * Cleans up the specific rollout from the Application if it is not in use
       * @param applicationId
       * @param rolloutId
       * @returns EmptyResponse
       * @throws ApiError
       */
      static deleteApplicationRollout(applicationId, rolloutId) {
        return request(OpenAPI, {
          method: "DELETE",
          url: "/applications/{application_id}/rollouts/{rollout_id}",
          path: {
            application_id: applicationId,
            rollout_id: rolloutId
          },
          errors: {
            401: `Unauthorized`,
            404: `Response body when an Application is not found`,
            500: `There has been an internal error`
          }
        });
      }
      /**
       * Get a single applications deployments
       * Returns a single applications deployments
       * @param applicationId
       * @returns ListDeploymentsV2 List of deployments with their corresponding placements
       * @throws ApiError
       */
      static listDeploymentsByApplication(applicationId) {
        return request(OpenAPI, {
          method: "GET",
          url: "/applications/{application_id}/deployments",
          path: {
            application_id: applicationId
          },
          errors: {
            401: `Unauthorized`,
            404: `Response body when an Application is not found`,
            500: `There has been an internal error`
          }
        });
      }
      /**
       * Get a specific deployment within an application
       * Get a deployment by its app and deployment IDs
       * @param applicationId
       * @param deploymentId
       * @returns DeploymentV2 Get a specific deployment along with its respective placements
       * @throws ApiError
       */
      static getApplicationsV3Deployment(applicationId, deploymentId) {
        return request(OpenAPI, {
          method: "GET",
          url: "/applications/{application_id}/deployments/{deployment_id}",
          path: {
            application_id: applicationId,
            deployment_id: deploymentId
          },
          errors: {
            400: `Unknown account`,
            401: `Unauthorized`,
            404: `Deployment not found`,
            500: `Deployment Get Error`
          }
        });
      }
      /**
       * Recreate an existing deployment within an application.
       * The given existing deployment is deleted and a replacement deployment is created. The latter retains some properties of the former that cannot be set by the client.
       *
       * @param applicationId
       * @param deploymentId
       * @param requestBody
       * @returns DeploymentV2 Deployment created
       * @throws ApiError
       */
      static recreateDeploymentV3(applicationId, deploymentId, requestBody) {
        return request(OpenAPI, {
          method: "POST",
          url: "/applications/{application_id}/deployments/{deployment_id}/recreate",
          path: {
            application_id: applicationId,
            deployment_id: deploymentId
          },
          body: requestBody,
          mediaType: "application/json",
          errors: {
            400: `Could not create the deployment because of input/limits reasons, more details in the error code`,
            401: `Unauthorized`,
            404: `Deployment not found`,
            500: `Deployment Creation Error`
          }
        });
      }
      /**
       * List container applications with pagination (Dash endpoint)
       * Returns summary application data suitable for list display
       * @param perPage Number of results per page
       * @param pageToken Token for fetching the next page
       * @returns PaginatedResult<DashApplication[]> Paginated list of applications
       * @throws ApiError
       */
      static listDashApplications(perPage, pageToken) {
        return requestPaginated(OpenAPI, {
          method: "GET",
          url: "/dash/applications",
          query: {
            per_page: perPage,
            page_token: pageToken
          },
          errors: {
            401: `Unauthorized`,
            404: `Not found`,
            500: `There has been an internal error`
          }
        });
      }
      /**
       * List container instances for a given application
       * Returns instances and optional durable object instances with pagination support
       * @param applicationId
       * @param perPage Number of results per page
       * @param pageToken Token for fetching the next page
       * @returns PaginatedResult<DashApplicationInstances> Paginated list of instances
       * @throws ApiError
       */
      static listDashApplicationInstances(applicationId, perPage, pageToken) {
        return requestPaginated(OpenAPI, {
          method: "GET",
          url: "/dash/applications/{application_id}/instances",
          path: {
            application_id: applicationId
          },
          query: {
            per_page: perPage,
            page_token: pageToken
          },
          errors: {
            401: `Unauthorized`,
            404: `Application not found`,
            500: `Internal error`
          }
        });
      }
    };
  }
});

// ../containers-shared/src/client/services/DeploymentsService.ts
var DeploymentsService;
var init_DeploymentsService = __esm({
  "../containers-shared/src/client/services/DeploymentsService.ts"() {
    init_import_meta_url();
    init_OpenAPI();
    init_request();
    DeploymentsService = class {
      static {
        __name(this, "DeploymentsService");
      }
      /**
       * Get a specific deployment within an application
       * Get a deployment by its app and deployment IDs
       * @param applicationId
       * @param deploymentId
       * @returns DeploymentV2 Get a specific deployment along with its respective placements
       * @throws ApiError
       */
      static getApplicationsV3Deployment(applicationId, deploymentId) {
        return request(OpenAPI, {
          method: "GET",
          url: "/applications/{application_id}/deployments/{deployment_id}",
          path: {
            application_id: applicationId,
            deployment_id: deploymentId
          },
          errors: {
            400: `Unknown account`,
            401: `Unauthorized`,
            404: `Deployment not found`,
            500: `Deployment Get Error`
          }
        });
      }
      /**
       * Recreate an existing deployment within an application.
       * The given existing deployment is deleted and a replacement deployment is created. The latter retains some properties of the former that cannot be set by the client.
       *
       * @param applicationId
       * @param deploymentId
       * @param requestBody
       * @returns DeploymentV2 Deployment created
       * @throws ApiError
       */
      static recreateDeploymentV3(applicationId, deploymentId, requestBody) {
        return request(OpenAPI, {
          method: "POST",
          url: "/applications/{application_id}/deployments/{deployment_id}/recreate",
          path: {
            application_id: applicationId,
            deployment_id: deploymentId
          },
          body: requestBody,
          mediaType: "application/json",
          errors: {
            400: `Could not create the deployment because of input/limits reasons, more details in the error code`,
            401: `Unauthorized`,
            404: `Deployment not found`,
            500: `Deployment Creation Error`
          }
        });
      }
      /**
       * Get credentials to SSH into a Container
       * Get a JWT to hit the SSH port on a given container.
       * @param instanceId
       * @returns WranglerSSHResponse Credentials to SSH into a Container
       * @throws ApiError
       */
      static containerWranglerSsh(instanceId) {
        return request(OpenAPI, {
          method: "GET",
          url: "/instances/{instance_id}/ssh",
          path: {
            instance_id: instanceId
          },
          errors: {
            400: `Unknown account`,
            401: `Unauthorized`,
            404: `Deployment not found`,
            500: `There has been an internal error`
          }
        });
      }
      /**
       * Create a new deployment
       * Creates a new deployment. A Deployment represents an intent to run one container, with image, in a particular location
       * @param requestBody
       * @returns DeploymentV2 Deployment created
       * @throws ApiError
       */
      static createDeploymentV2(requestBody) {
        return request(OpenAPI, {
          method: "POST",
          url: "/deployments/v2",
          body: requestBody,
          mediaType: "application/json",
          errors: {
            400: `Could not create the deployment because of input/limits reasons, more details in the error code`,
            401: `Unauthorized`,
            409: `Deployment already exists`,
            500: `Deployment Creation Error`
          }
        });
      }
      /**
       * List deployments
       * List all deployments in the current account. Optionally filter them
       * @param appId Filter deployments by application id
       * @param location Filter deployments by location
       * @param image Filter deployments by image
       * @param state Filter deployments by placement state
       * @param ipv4 Filter deployments by ipv4 address
       * @param label Filter deployments by label
       * @returns ListDeploymentsV2 List of deployments with their corresponding placements
       * @throws ApiError
       */
      static listDeploymentsV2(appId, location, image, state2, ipv4, label) {
        return request(OpenAPI, {
          method: "GET",
          url: "/deployments/v2",
          query: {
            app_id: appId,
            location,
            image,
            state: state2,
            ipv4,
            label
          },
          errors: {
            400: `Unknown account`,
            401: `Unauthorized`,
            500: `Deployment List Error`
          }
        });
      }
      /**
       * Get a specific deployment
       * Get a deployment by its deployment
       * @param deploymentId
       * @returns DeploymentV2 Get a specific deployment along with its respective placements
       * @throws ApiError
       */
      static getDeploymentV2(deploymentId) {
        return request(OpenAPI, {
          method: "GET",
          url: "/deployments/{deployment_id}/v2",
          path: {
            deployment_id: deploymentId
          },
          errors: {
            400: `Unknown account`,
            401: `Unauthorized`,
            404: `Deployment not found`,
            500: `Deployment Get Error`
          }
        });
      }
      /**
       * Modify an existing deployment
       * Change specific properties in an existing deployment
       * @param deploymentId
       * @param requestBody
       * @returns DeploymentV2 Deployment modified
       * @throws ApiError
       */
      static modifyDeploymentV2(deploymentId, requestBody) {
        return request(OpenAPI, {
          method: "PATCH",
          url: "/deployments/{deployment_id}/v2",
          path: {
            deployment_id: deploymentId
          },
          body: requestBody,
          mediaType: "application/json",
          errors: {
            400: `Can't modify the deployment because it surpasses limits or it has bad input`,
            401: `Unauthorized`,
            404: `Deployment not found`,
            500: `Deployment Modification Error`
          }
        });
      }
      /**
       * Delete a specific deployment
       * Delete a deployment by its deployment ID
       * @param deploymentId
       * @returns EmptyResponse Delete a specific deployment along with its respective placements
       * @throws ApiError
       */
      static deleteDeploymentV2(deploymentId) {
        return request(OpenAPI, {
          method: "DELETE",
          url: "/deployments/{deployment_id}/v2",
          path: {
            deployment_id: deploymentId
          },
          errors: {
            400: `Unknown account`,
            401: `Unauthorized`,
            404: `Deployment not found`,
            500: `Deployment Delete Error`
          }
        });
      }
      /**
       * Recreate an existing deployment.
       * The given existing deployment is deleted and a replacement deployment is created. The latter retains some properties of the former that cannot be set by the client.
       *
       * @param deploymentId
       * @param requestBody
       * @returns DeploymentV2 Deployment created
       * @throws ApiError
       */
      static recreateDeployment(deploymentId, requestBody) {
        return request(OpenAPI, {
          method: "POST",
          url: "/deployments/{deployment_id}/recreate",
          path: {
            deployment_id: deploymentId
          },
          body: requestBody,
          mediaType: "application/json",
          errors: {
            400: `Could not create the deployment because of input/limits reasons, more details in the error code`,
            401: `Unauthorized`,
            404: `Deployment not found`,
            500: `Deployment Creation Error`
          }
        });
      }
      /**
       * Replace a deployment
       * You can stop the current placement and create a new one. The new one will have the same durable properties of the deployment, but will otherwise be like new
       * @param placementId
       * @param requestBody
       * @returns DeploymentV2 Deployment replaced
       * @throws ApiError
       */
      static replaceDeployment(placementId, requestBody) {
        return request(OpenAPI, {
          method: "POST",
          url: "/placements/{placement_id}",
          path: {
            placement_id: placementId
          },
          body: requestBody,
          mediaType: "application/json",
          errors: {
            400: `Responses with 400 status code`,
            401: `Unauthorized`,
            404: `Placement not found`,
            500: `Deployment Replacement Error`
          }
        });
      }
    };
  }
});

// ../containers-shared/src/client/services/ImageRegistriesService.ts
var ImageRegistriesService;
var init_ImageRegistriesService = __esm({
  "../containers-shared/src/client/services/ImageRegistriesService.ts"() {
    init_import_meta_url();
    init_OpenAPI();
    init_request();
    ImageRegistriesService = class {
      static {
        __name(this, "ImageRegistriesService");
      }
      /**
       * Create an image registry protocol that resolves to multiple domains.
       * @param requestBody
       * @returns ImageRegistryProtocol The image registry protocol was created
       * @throws ApiError
       */
      static createImageRegistryProtocol(requestBody) {
        return request(OpenAPI, {
          method: "POST",
          url: "/registries/protos",
          body: requestBody,
          mediaType: "application/json",
          errors: {
            400: `Bad Request that contains a specific constant code and details object about the error.`,
            403: `The registry that is being added is not allowed`,
            409: `Image registry protocol already exists`,
            500: `There has been an internal error`
          }
        });
      }
      /**
       * List all image registry protocols.
       * @returns ImageRegistryProtocols The image registry protocols in the account
       * @throws ApiError
       */
      static listImageRegistryProtocols() {
        return request(OpenAPI, {
          method: "GET",
          url: "/registries/protos",
          errors: {
            500: `There has been an internal error`
          }
        });
      }
      /**
       * Modify an image registry protocol. The previous list of domains will be replaced by the ones you specify in this endpoint.
       * @param requestBody
       * @returns ImageRegistryProtocol The image registry protocol was modified
       * @throws ApiError
       */
      static modifyImageRegistryProtocol(requestBody) {
        return request(OpenAPI, {
          method: "PUT",
          url: "/registries/protos",
          body: requestBody,
          mediaType: "application/json",
          errors: {
            400: `Bad Request that contains a specific constant code and details object about the error.`,
            403: `The registry that is being added is not allowed`,
            404: `Image registry protocol doesn't exist`,
            500: `There has been an internal error`
          }
        });
      }
      /**
       * Delete an image registry protocol. Be careful, if there is deployments running referencing this protocol they won't be able to pull the image.
       * @param proto
       * @returns EmptyResponse Image registry protocol was deleted successfully
       * @throws ApiError
       */
      static deleteImageRegistryProto(proto2) {
        return request(OpenAPI, {
          method: "DELETE",
          url: "/registries/protos/{proto}",
          path: {
            proto: proto2
          },
          errors: {
            400: `The image registry protocol couldn't be deleted because it's referenced by a deployment or application`,
            404: `Image registry protocol doesn't exist`,
            500: `There has been an internal error`
          }
        });
      }
      /**
       * Get a JWT to pull from the image registry
       * Get a JWT to pull from the image registry specifying its domain
       * @param domain
       * @param requestBody
       * @returns AccountRegistryToken Credentials with 'pull' or 'push' permissions to access the registry
       * @throws ApiError
       */
      static generateImageRegistryCredentials(domain2, requestBody) {
        return request(OpenAPI, {
          method: "POST",
          url: "/registries/{domain}/credentials",
          path: {
            domain: domain2
          },
          body: requestBody,
          mediaType: "application/json",
          errors: {
            400: `Bad Request that contains a specific constant code and details object about the error.`,
            404: `The image registry does not exist`,
            409: `The registry was configured as public, so credentials can not be generated`,
            500: `There has been an internal error`
          }
        });
      }
      /**
       * Delete a registry from the account
       * Delete a registry from the account, this will make Cloudchamber unable to pull images from the registry
       * @param domain
       * @returns EmptyResponse The image registry is deleted
       * @throws ApiError
       */
      static deleteImageRegistry(domain2) {
        return request(OpenAPI, {
          method: "DELETE",
          url: "/registries/{domain}",
          path: {
            domain: domain2
          },
          errors: {
            404: `The image registry does not exist`,
            500: `There has been an internal error`
          }
        });
      }
      /**
       * Get the list of configured registries in the account
       * Get the list of configured registries in the account
       * @returns CustomerImageRegistry The list of registries that are added in the account
       * @throws ApiError
       */
      static listImageRegistries() {
        return request(OpenAPI, {
          method: "GET",
          url: "/registries",
          errors: {
            500: `There has been an internal error`
          }
        });
      }
      /**
       * Add a new image registry configuration
       * Add a new image registry into your account, so then Cloudflare can pull docker images with public key JWT authentication
       * @param requestBody
       * @returns CustomerImageRegistry Created a new image registry in the account
       * @throws ApiError
       */
      static createImageRegistry(requestBody) {
        return request(OpenAPI, {
          method: "POST",
          url: "/registries",
          body: requestBody,
          mediaType: "application/json",
          errors: {
            400: `Image registry input is malformed, see the error details`,
            403: `The registry that is being added is not allowed`,
            409: `The image registry already exists in the account`,
            500: `There has been an internal error`
          }
        });
      }
    };
  }
});

// ../containers-shared/src/client/services/IPsService.ts
var init_IPsService = __esm({
  "../containers-shared/src/client/services/IPsService.ts"() {
    init_import_meta_url();
    init_OpenAPI();
    init_request();
  }
});

// ../containers-shared/src/client/services/JobsService.ts
var init_JobsService = __esm({
  "../containers-shared/src/client/services/JobsService.ts"() {
    init_import_meta_url();
    init_OpenAPI();
    init_request();
  }
});

// ../containers-shared/src/client/services/PlacementsService.ts
var PlacementsService;
var init_PlacementsService = __esm({
  "../containers-shared/src/client/services/PlacementsService.ts"() {
    init_import_meta_url();
    init_OpenAPI();
    init_request();
    PlacementsService = class {
      static {
        __name(this, "PlacementsService");
      }
      /**
       * List placements
       * List all placements under a given deploymentID with all its events
       * @param deploymentId
       * @returns ListPlacements A list of placements along with its events under a deployment
       * @throws ApiError
       */
      static listPlacements(deploymentId) {
        return request(OpenAPI, {
          method: "GET",
          url: "/deployments/{deployment_id}/placements",
          path: {
            deployment_id: deploymentId
          },
          errors: {
            400: `Unknown account`,
            401: `Unauthorized`,
            404: `Deployment not found`,
            500: `List Placements Error`
          }
        });
      }
      /**
       * Get placement
       * A Placement represents the lifetime of a single instance of a Deployment
       * @param placementId
       * @returns PlacementWithEvents A specific placement along with its events
       * @throws ApiError
       */
      static getPlacement(placementId) {
        return request(OpenAPI, {
          method: "GET",
          url: "/placements/{placement_id}",
          path: {
            placement_id: placementId
          },
          errors: {
            400: `Unknown account`,
            401: `Unauthorized`,
            404: `Placement not found`,
            500: `Get Placement Error`
          }
        });
      }
      /**
       * Replace a deployment
       * You can stop the current placement and create a new one. The new one will have the same durable properties of the deployment, but will otherwise be like new
       * @param placementId
       * @param requestBody
       * @returns DeploymentV2 Deployment replaced
       * @throws ApiError
       */
      static replaceDeployment(placementId, requestBody) {
        return request(OpenAPI, {
          method: "POST",
          url: "/placements/{placement_id}",
          path: {
            placement_id: placementId
          },
          body: requestBody,
          mediaType: "application/json",
          errors: {
            400: `Responses with 400 status code`,
            401: `Unauthorized`,
            404: `Placement not found`,
            500: `Deployment Replacement Error`
          }
        });
      }
    };
  }
});

// ../containers-shared/src/client/services/RolloutsService.ts
var RolloutsService;
var init_RolloutsService = __esm({
  "../containers-shared/src/client/services/RolloutsService.ts"() {
    init_import_meta_url();
    init_OpenAPI();
    init_request();
    RolloutsService = class {
      static {
        __name(this, "RolloutsService");
      }
      /**
       * Create a new rollout for an application
       * A rollout can be used to update the application's configuration across instances with minimal downtime.
       * @param applicationId
       * @param requestBody
       * @returns ApplicationRollout
       * @throws ApiError
       */
      static createApplicationRollout(applicationId, requestBody) {
        return request(OpenAPI, {
          method: "POST",
          url: "/applications/{application_id}/rollouts",
          path: {
            application_id: applicationId
          },
          body: requestBody,
          mediaType: "application/json",
          errors: {
            400: `Can't update the application rollout because it has bad inputs`,
            401: `Unauthorized`,
            404: `Response body when an Application is not found`,
            500: `There has been an internal error`
          }
        });
      }
      /**
       * List rollouts
       * List all rollouts within an application
       * @param applicationId
       * @param limit The amount of rollouts to return. By default it is all of them.
       * @param last The last rollout that was used to paginate
       * @returns ApplicationRollout
       * @throws ApiError
       */
      static listApplicationRollouts(applicationId, limit2, last) {
        return request(OpenAPI, {
          method: "GET",
          url: "/applications/{application_id}/rollouts",
          path: {
            application_id: applicationId
          },
          query: {
            limit: limit2,
            last
          },
          errors: {
            401: `Unauthorized`,
            404: `Response body when an Application is not found`,
            500: `There has been an internal error`
          }
        });
      }
      /**
       * Get a rollout by id within an application
       * View rollout configurations and state for a specific rollout
       * @param applicationId
       * @param rolloutId
       * @returns ApplicationRollout
       * @throws ApiError
       */
      static getApplicationRollout(applicationId, rolloutId) {
        return request(OpenAPI, {
          method: "GET",
          url: "/applications/{application_id}/rollouts/{rollout_id}",
          path: {
            application_id: applicationId,
            rollout_id: rolloutId
          },
          errors: {
            401: `Unauthorized`,
            404: `Response body when an Application is not found`,
            500: `There has been an internal error`
          }
        });
      }
      /**
       * Update a rollout within an application
       * A rollout can be updated to modify its current state. Actions include - next, previous, rollback
       * @param applicationId
       * @param rolloutId
       * @param requestBody
       * @returns UpdateRolloutResponse
       * @throws ApiError
       */
      static updateApplicationRollout(applicationId, rolloutId, requestBody) {
        return request(OpenAPI, {
          method: "POST",
          url: "/applications/{application_id}/rollouts/{rollout_id}",
          path: {
            application_id: applicationId,
            rollout_id: rolloutId
          },
          body: requestBody,
          mediaType: "application/json",
          errors: {
            400: `Can't create the application rollout because it has bad inputs`,
            401: `Unauthorized`,
            404: `Response body when an Application is not found`,
            500: `There has been an internal error`
          }
        });
      }
      /**
       * Delete a rollout within an application by its rollout id
       * Cleans up the specific rollout from the Application if it is not in use
       * @param applicationId
       * @param rolloutId
       * @returns EmptyResponse
       * @throws ApiError
       */
      static deleteApplicationRollout(applicationId, rolloutId) {
        return request(OpenAPI, {
          method: "DELETE",
          url: "/applications/{application_id}/rollouts/{rollout_id}",
          path: {
            application_id: applicationId,
            rollout_id: rolloutId
          },
          errors: {
            401: `Unauthorized`,
            404: `Response body when an Application is not found`,
            500: `There has been an internal error`
          }
        });
      }
    };
  }
});

// ../containers-shared/src/client/services/SecretsService.ts
var init_SecretsService = __esm({
  "../containers-shared/src/client/services/SecretsService.ts"() {
    init_import_meta_url();
    init_OpenAPI();
    init_request();
  }
});

// ../containers-shared/src/client/services/SshPublicKeysService.ts
var SshPublicKeysService;
var init_SshPublicKeysService = __esm({
  "../containers-shared/src/client/services/SshPublicKeysService.ts"() {
    init_import_meta_url();
    init_OpenAPI();
    init_request();
    SshPublicKeysService = class {
      static {
        __name(this, "SshPublicKeysService");
      }
      /**
       * Add SSH public key
       * Adds a new ssh public key to an account. This can then be associated with a specific deployment during its creation or modification.
       * @param requestBody
       * @returns SSHPublicKeyItem SSH Public key added successfully
       * @throws ApiError
       */
      static createSshPublicKey(requestBody) {
        return request(OpenAPI, {
          method: "POST",
          url: "/ssh-public-keys",
          body: requestBody,
          mediaType: "application/json",
          errors: {
            401: `Unauthorized`,
            500: `Create SSH Public key error`
          }
        });
      }
      /**
       * List SSH Public keys
       * List all SSH Public keys in an account
       * @returns ListSSHPublicKeys List SSH Public keys response
       * @throws ApiError
       */
      static listSshPublicKeys() {
        return request(OpenAPI, {
          method: "GET",
          url: "/ssh-public-keys",
          errors: {
            401: `Unauthorized`,
            500: `List SSH Public keys error`
          }
        });
      }
      /**
       * Delete SSH public key from the account
       * Delete an SSH public key from an account.
       * @param sshPublicKeyName
       * @returns EmptyResponse SSH Public key was removed successfully
       * @throws ApiError
       */
      static deleteSshPublicKey(sshPublicKeyName) {
        return request(OpenAPI, {
          method: "DELETE",
          url: "/ssh-public-keys/{sshPublicKeyName}",
          path: {
            sshPublicKeyName
          },
          errors: {
            401: `Unauthorized`,
            404: `Response body when the SSH public key that is trying to be found does not exist`,
            500: `There has been an internal error`
          }
        });
      }
    };
  }
});

// ../containers-shared/src/client/index.ts
var init_client = __esm({
  "../containers-shared/src/client/index.ts"() {
    init_import_meta_url();
    init_ApiError();
    init_CancelablePromise();
    init_OpenAPI();
    init_request();
    init_ApplicationAffinityColocation();
    init_ApplicationAffinityHardwareGeneration();
    init_ApplicationMutationError();
    init_ApplicationRollout();
    init_AssignIPv4();
    init_AssignIPv6();
    init_BadRequestWithCodeError();
    init_ContainerNetworkMode();
    init_CreateApplicationRolloutRequest();
    init_DeploymentCheckKind();
    init_DeploymentCheckType();
    init_DeploymentMutationError();
    init_DeploymentNotFoundError();
    init_DeploymentPlacementState();
    init_DeploymentQueuedReason();
    init_DeploymentSchedulingState();
    init_DeploymentType();
    init_DurableObjectStatusHealth();
    init_EventName();
    init_EventType();
    init_ExternalRegistryKind();
    init_HTTPMethod();
    init_ImageRegistryAlreadyExistsError();
    init_ImageRegistryIsPublic();
    init_ImageRegistryNotAllowedError();
    init_ImageRegistryNotFoundError();
    init_ImageRegistryPermissions();
    init_ImageRegistryProtocolAlreadyExists();
    init_ImageRegistryProtocolIsReferencedError();
    init_ImageRegistryProtocolNotFound();
    init_InstanceType();
    init_IPType();
    init_JobStatusHealth();
    init_NetworkMode();
    init_NodeGroup();
    init_PlacementStatusHealth();
    init_ProvisionerConfiguration();
    init_RolloutStep();
    init_SchedulingPolicy();
    init_SecretAccessType();
    init_SecretNameAlreadyExists();
    init_SecretNotFound();
    init_SSHPublicKeyNotFoundError();
    init_UpdateApplicationRolloutRequest();
    init_AccountService();
    init_ApplicationsService();
    init_DeploymentsService();
    init_ImageRegistriesService();
    init_IPsService();
    init_JobsService();
    init_PlacementsService();
    init_RolloutsService();
    init_SecretsService();
    init_SshPublicKeysService();
  }
});
async function constructBuildCommand(options, logger4) {
  const platform4 = options.platform ?? "linux/amd64";
  const buildCmd = [
    "build",
    "--load",
    "-t",
    options.tag,
    "--platform",
    platform4,
    "--provenance=false"
  ];
  if (options.args) {
    for (const arg in options.args) {
      buildCmd.push("--build-arg", `${arg}=${options.args[arg]}`);
    }
  }
  if (options.setNetworkToHost) {
    buildCmd.push("--network", "host");
  }
  const dockerfile = fs29.readFileSync(options.pathToDockerfile, "utf-8");
  buildCmd.push("-f", "-");
  buildCmd.push(options.buildContext);
  logger4?.debug(`Building image with command: ${buildCmd.join(" ")}`);
  return { buildCmd, dockerfile };
}
function dockerBuild(dockerPath, options) {
  let errorHandled = false;
  let resolve32;
  let reject;
  const ready = new Promise((res, rej) => {
    resolve32 = res;
    reject = rej;
  });
  const child = childProcess.spawn(dockerPath, options.buildCmd, {
    stdio: ["pipe", "inherit", "inherit"],
    // We need to set detached to true so that the child process
    // will control all of its child processes and we can kill
    // all of them in case we need to abort the build process.
    // On Windows, detached: true opens a new console window per child
    // process, so we only set it on non-Windows platforms.
    detached: process.platform !== "win32",
    // Prevent child processes from opening visible console windows on Windows.
    // This is a no-op on non-Windows platforms.
    windowsHide: true
  });
  if (child.stdin !== null) {
    child.stdin.write(options.dockerfile);
    child.stdin.end();
  }
  child.on("exit", (code) => {
    if (code === 0) {
      resolve32();
    } else if (!errorHandled) {
      errorHandled = true;
      reject(new UserError(`Docker build exited with code: ${code}`));
    }
  });
  child.on("error", (err) => {
    if (!errorHandled) {
      errorHandled = true;
      reject(err);
    }
  });
  return {
    abort: /* @__PURE__ */ __name(() => {
      child.unref();
      if (child.pid !== void 0) {
        if (process.platform === "win32") {
          child.kill();
        } else {
          process.kill(-child.pid);
        }
      }
    }, "abort"),
    ready
  };
}
async function buildImage(dockerPath, options) {
  const { buildCmd, dockerfile } = await constructBuildCommand({
    tag: options.image_tag,
    pathToDockerfile: options.dockerfile,
    buildContext: options.image_build_context,
    args: options.image_vars,
    platform: "linux/amd64"
  });
  return dockerBuild(dockerPath, { buildCmd, dockerfile });
}
var init_build = __esm({
  "../containers-shared/src/build.ts"() {
    init_import_meta_url();
    init_dist();
    __name(constructBuildCommand, "constructBuildCommand");
    __name(dockerBuild, "dockerBuild");
    __name(buildImage, "buildImage");
  }
});
async function dockerLoginImageRegistry(pathToDocker, domain2) {
  const expirationMinutes = 15;
  const credentials = await ImageRegistriesService.generateImageRegistryCredentials(domain2, {
    expiration_minutes: expirationMinutes,
    permissions: [
      "push" /* PUSH */,
      "pull" /* PULL */
    ]
  });
  const child = childProcess.spawn(
    pathToDocker,
    ["login", "--password-stdin", "--username", credentials.username, domain2],
    { stdio: ["pipe", "inherit", "inherit"] }
  ).on("error", (err) => {
    throw err;
  });
  child.stdin.write(credentials.password);
  child.stdin.end();
  await new Promise((resolve32, reject) => {
    child.on("close", (code) => {
      if (code === 0) {
        resolve32();
      } else {
        reject(new UserError(`Login failed with code: ${code}`));
      }
    });
  });
}
var init_login = __esm({
  "../containers-shared/src/login.ts"() {
    init_import_meta_url();
    init_dist();
    init_client();
    __name(dockerLoginImageRegistry, "dockerLoginImageRegistry");
  }
});

// ../containers-shared/src/registry.ts
var getCloudflareRegistryWithAccountNamespace, MF_DEV_CONTAINER_PREFIX;
var init_registry2 = __esm({
  "../containers-shared/src/registry.ts"() {
    init_import_meta_url();
    init_knobs();
    getCloudflareRegistryWithAccountNamespace = /* @__PURE__ */ __name((accountID, tag) => {
      return `${getCloudflareContainerRegistry()}/${accountID}/${tag}`;
    }, "getCloudflareRegistryWithAccountNamespace");
    MF_DEV_CONTAINER_PREFIX = "cloudflare-dev";
  }
});

// ../containers-shared/src/knobs.ts
var getCloudflareContainerRegistry, getDevContainerImageName;
var init_knobs = __esm({
  "../containers-shared/src/knobs.ts"() {
    init_import_meta_url();
    init_registry2();
    getCloudflareContainerRegistry = /* @__PURE__ */ __name(() => {
      return process.env.CLOUDFLARE_CONTAINER_REGISTRY ?? (process.env.WRANGLER_API_ENVIRONMENT === "staging" ? "staging.registry.cloudflare.com" : "registry.cloudflare.com");
    }, "getCloudflareContainerRegistry");
    getDevContainerImageName = /* @__PURE__ */ __name((name2, tag) => {
      return `${MF_DEV_CONTAINER_PREFIX}/${name2.toLowerCase()}:${tag}`;
    }, "getDevContainerImageName");
  }
});
async function dockerImageInspect(dockerPath, options) {
  return new Promise((resolve32, reject) => {
    const proc = childProcess.spawn(
      dockerPath,
      ["image", "inspect", options.imageTag, "--format", options.formatString],
      {
        stdio: ["ignore", "pipe", "pipe"]
      }
    );
    let stdout2 = "";
    let stderr2 = "";
    proc.stdout.on("data", (chunk) => stdout2 += chunk);
    proc.stderr.on("data", (chunk) => stderr2 += chunk);
    proc.on("close", (code) => {
      if (code !== 0) {
        return reject(
          new UserError(`failed inspecting image locally: ${stderr2.trim()}`)
        );
      }
      resolve32(stdout2.trim());
    });
    proc.on("error", (err) => reject(err));
  });
}
var init_inspect = __esm({
  "../containers-shared/src/inspect.ts"() {
    init_import_meta_url();
    init_dist();
    __name(dockerImageInspect, "dockerImageInspect");
  }
});
function getContainerIdsByImageTags(dockerPath, imageTags) {
  const ids = /* @__PURE__ */ new Set();
  for (const imageTag of imageTags) {
    const containerIdsFromImage = getContainerIdsFromImage(
      dockerPath,
      imageTag
    );
    containerIdsFromImage.forEach((id) => ids.add(id));
  }
  return Array.from(ids);
}
async function checkExposedPorts(dockerPath, options) {
  const output = await dockerImageInspect(dockerPath, {
    imageTag: options.image_tag,
    formatString: "{{ len .Config.ExposedPorts }}"
  });
  if (output === "0") {
    throw new UserError(
      `The container "${options.class_name}" does not expose any ports. In your Dockerfile, please expose any ports you intend to connect to.
For additional information please see: https://developers.cloudflare.com/containers/local-dev/#exposing-ports.
`
    );
  }
}
function generateContainerBuildId() {
  return crypto2.randomUUID().slice(0, 8);
}
function getDockerSocketFromContext(dockerPath) {
  try {
    const output = runDockerCmdWithOutput(dockerPath, [
      "context",
      "ls",
      "--format",
      "json"
    ]);
    const lines = output.trim().split("\n");
    const contexts = lines.map((line) => JSON.parse(line));
    const currentContext = contexts.find((context2) => context2.Current === true);
    if (currentContext && currentContext.DockerEndpoint) {
      return currentContext.DockerEndpoint;
    }
  } catch {
  }
  return null;
}
function resolveDockerHost(dockerPath) {
  if (process.env.WRANGLER_DOCKER_HOST) {
    return process.env.WRANGLER_DOCKER_HOST;
  }
  if (process.env.DOCKER_HOST) {
    return process.env.DOCKER_HOST;
  }
  const contextSocket = getDockerSocketFromContext(dockerPath);
  if (contextSocket) {
    return contextSocket;
  }
  return process.platform === "win32" ? "//./pipe/docker_engine" : "unix:///var/run/docker.sock";
}
async function getImageRepoTags(dockerPath, imageTag) {
  try {
    const output = await dockerImageInspect(dockerPath, {
      imageTag,
      formatString: "{{ range .RepoTags }}{{ . }}\n{{ end }}"
    });
    return output.split("\n").filter((tag) => tag.trim() !== "");
  } catch {
    return [];
  }
}
async function cleanupDuplicateImageTags(dockerPath, imageTag) {
  try {
    const repoTags = await getImageRepoTags(dockerPath, imageTag);
    const tagsToRemove = repoTags.filter(
      (tag) => tag !== imageTag && tag.startsWith("cloudflare-dev")
    );
    if (tagsToRemove.length > 0) {
      runDockerCmdWithOutput(dockerPath, ["rmi", ...tagsToRemove]);
    }
  } catch {
  }
}
var runDockerCmd, runDockerCmdWithOutput, isDockerRunning, verifyDockerInstalled, cleanupContainers, getContainerIdsFromImage;
var init_utils = __esm({
  "../containers-shared/src/utils.ts"() {
    init_import_meta_url();
    init_dist();
    init_inspect();
    runDockerCmd = /* @__PURE__ */ __name((dockerPath, args, stdio) => {
      let aborted = false;
      let resolve32;
      let reject;
      const ready = new Promise((res, rej) => {
        resolve32 = res;
        reject = rej;
      });
      const child = childProcess.spawn(dockerPath, args, {
        stdio: stdio ?? "inherit",
        // We need to set detached to true so that the child process
        // will control all of its child processes and we can kill
        // all of them in case we need to abort the build process.
        // On Windows, detached: true opens a new console window per child
        // process, so we only set it on non-Windows platforms.
        detached: process.platform !== "win32",
        // Prevent child processes from opening visible console windows on Windows.
        // This is a no-op on non-Windows platforms.
        windowsHide: true
      });
      let errorHandled = false;
      child.on("close", (code) => {
        if (code === 0 || aborted) {
          resolve32({ aborted });
        } else if (!errorHandled) {
          errorHandled = true;
          reject(new UserError(`Docker command exited with code: ${code}`));
        }
      });
      child.on("error", (err) => {
        if (!errorHandled) {
          errorHandled = true;
          reject(new UserError(`Docker command failed: ${err.message}`));
        }
      });
      return {
        abort: /* @__PURE__ */ __name(() => {
          aborted = true;
          child.unref();
          if (child.pid !== void 0) {
            if (process.platform === "win32") {
              child.kill();
            } else {
              process.kill(-child.pid);
            }
          }
        }, "abort"),
        ready,
        then: /* @__PURE__ */ __name(async (onResolve, onReject) => ready.then(onResolve).catch(onReject), "then")
      };
    }, "runDockerCmd");
    runDockerCmdWithOutput = /* @__PURE__ */ __name((dockerPath, args) => {
      try {
        const stdout2 = childProcess.execFileSync(dockerPath, args, { encoding: "utf8" });
        return stdout2.trim();
      } catch (error2) {
        throw new UserError(
          `Failed running docker command: ${error2.message}. Command: ${dockerPath} ${args.join(" ")}`
        );
      }
    }, "runDockerCmdWithOutput");
    isDockerRunning = /* @__PURE__ */ __name(async (dockerPath) => {
      try {
        await runDockerCmd(dockerPath, ["info"], ["inherit", "pipe", "pipe"]);
      } catch {
        return false;
      }
      return true;
    }, "isDockerRunning");
    verifyDockerInstalled = /* @__PURE__ */ __name(async (dockerPath, isDev = true) => {
      const dockerIsRunning = await isDockerRunning(dockerPath);
      if (!dockerIsRunning) {
        throw new UserError(
          `The Docker CLI could not be launched. Please ensure that the Docker CLI is installed and the daemon is running.
Other container tooling that is compatible with the Docker CLI and engine may work, but is not yet guaranteed to do so. You can specify an executable with the environment variable WRANGLER_DOCKER_BIN and a socket with DOCKER_HOST.${isDev ? "\nTo suppress this error if you do not intend on triggering any container instances, set dev.enable_containers to false in your Wrangler config or passing in --enable-containers=false." : ""}`
        );
      }
    }, "verifyDockerInstalled");
    cleanupContainers = /* @__PURE__ */ __name((dockerPath, imageTags) => {
      try {
        const containerIds = getContainerIdsByImageTags(dockerPath, imageTags);
        if (containerIds.length === 0) {
          return true;
        }
        runDockerCmdWithOutput(dockerPath, ["rm", "--force", ...containerIds]);
        return true;
      } catch {
        return false;
      }
    }, "cleanupContainers");
    __name(getContainerIdsByImageTags, "getContainerIdsByImageTags");
    getContainerIdsFromImage = /* @__PURE__ */ __name((dockerPath, ancestorImage) => {
      const output = runDockerCmdWithOutput(dockerPath, [
        "ps",
        "-a",
        "--filter",
        `ancestor=${ancestorImage}`,
        "--format",
        "{{.ID}}"
      ]);
      return output.split("\n").filter((line) => line.trim());
    }, "getContainerIdsFromImage");
    __name(checkExposedPorts, "checkExposedPorts");
    __name(generateContainerBuildId, "generateContainerBuildId");
    __name(getDockerSocketFromContext, "getDockerSocketFromContext");
    __name(resolveDockerHost, "resolveDockerHost");
    __name(getImageRepoTags, "getImageRepoTags");
    __name(cleanupDuplicateImageTags, "cleanupDuplicateImageTags");
  }
});

// ../containers-shared/src/types.ts
var init_types = __esm({
  "../containers-shared/src/types.ts"() {
    init_import_meta_url();
  }
});

// ../containers-shared/src/images.ts
function getEgressInterceptorImage() {
  return process.env.MINIFLARE_CONTAINER_EGRESS_IMAGE ?? DEFAULT_CONTAINER_EGRESS_INTERCEPTOR_IMAGE;
}
async function pullEgressInterceptorImage(dockerPath) {
  const image = getEgressInterceptorImage();
  await runDockerCmd(dockerPath, ["pull", image, "--platform", "linux/amd64"]);
}
async function pullImage(dockerPath, options, logger4, isVite) {
  const domain2 = new URL(`http://${options.image_uri}`).hostname;
  const isExternalRegistry = domain2 !== getCloudflareContainerRegistry();
  try {
    await dockerLoginImageRegistry(dockerPath, domain2);
  } catch (e10) {
    if (!isExternalRegistry) {
      if (isVite) {
        throw new UserError(
          `Using images from the Cloudflare-managed registry is not currently supported with the Vite plugin.
You should use a Dockerfile or a supported external registry and authenticate to that registry separately using \`docker login\` or similar.
Supported external registries are currently: ${Object.values(ExternalRegistryKind).join(", ")}.`
        );
      }
      throw e10;
    }
    logger4?.warn(
      "Unable to retrieve configured registry credentials from Cloudflare.\nUnless this is a public image, you will need to run `wrangler containers registries configure` before deploying.\nAttempting to pull image anyway..."
    );
  }
  const pull = runDockerCmd(dockerPath, [
    "pull",
    options.image_uri,
    // All containers running on our platform need to be built for amd64 architecture, but by default docker pull seems to look for an image matching the host system, so we need to specify this here
    "--platform",
    "linux/amd64"
  ]);
  const ready = pull.ready.then(async ({ aborted }) => {
    if (!aborted) {
      await runDockerCmd(dockerPath, [
        "tag",
        options.image_uri,
        options.image_tag
      ]);
    }
  });
  return {
    abort: /* @__PURE__ */ __name(() => {
      pull.abort();
    }, "abort"),
    ready
  };
}
async function prepareContainerImagesForDev(args) {
  const {
    dockerPath,
    containerOptions,
    onContainerImagePreparationStart,
    onContainerImagePreparationEnd
  } = args;
  let aborted = false;
  if (process.platform === "win32") {
    throw new UserError(
      "Local development with containers is currently not supported on Windows. You should use WSL instead. You can also set `enable_containers` to false if you do not need to develop the container part of your application."
    );
  }
  await verifyDockerInstalled(dockerPath);
  for (const options of containerOptions) {
    if ("dockerfile" in options) {
      const build5 = await buildImage(dockerPath, options);
      onContainerImagePreparationStart({
        containerOptions: options,
        abort: /* @__PURE__ */ __name(() => {
          aborted = true;
          build5.abort();
        }, "abort")
      });
      await build5.ready;
      onContainerImagePreparationEnd({
        containerOptions: options
      });
    } else {
      const pull = await pullImage(
        dockerPath,
        options,
        args.logger,
        args.isVite
      );
      onContainerImagePreparationStart({
        containerOptions: options,
        abort: /* @__PURE__ */ __name(() => {
          aborted = true;
          pull.abort();
        }, "abort")
      });
      await pull.ready;
      onContainerImagePreparationEnd({
        containerOptions: options
      });
    }
    if (!aborted) {
      await cleanupDuplicateImageTags(dockerPath, options.image_tag);
      await checkExposedPorts(dockerPath, options);
    }
  }
  if (!aborted) {
    await pullEgressInterceptorImage(dockerPath);
  }
}
function resolveImageName(accountId, image) {
  let url4;
  try {
    url4 = new URL(`http://${image}`);
  } catch {
  }
  if (url4 === void 0 || !url4.host.match(/[:.]/) && url4.hostname !== "localhost") {
    return getCloudflareRegistryWithAccountNamespace(accountId, image);
  }
  if (url4.hostname !== getCloudflareContainerRegistry()) {
    return image;
  }
  if (url4.pathname.startsWith(`/${accountId}`)) {
    return image;
  }
  const accountIdPattern = /^\/([a-f0-9]{32})\//;
  const match3 = accountIdPattern.exec(url4.pathname);
  if (match3) {
    const foundAccountId = match3[1];
    if (foundAccountId !== accountId) {
      throw new Error(
        `Image "${image}" does not belong to your account
Image appears to belong to account: "${foundAccountId}"
Current account: "${accountId}"`
      );
    }
    return image;
  }
  return `${url4.hostname}/${accountId}${url4.pathname}`;
}
var DEFAULT_CONTAINER_EGRESS_INTERCEPTOR_IMAGE, getAndValidateRegistryType;
var init_images = __esm({
  "../containers-shared/src/images.ts"() {
    init_import_meta_url();
    init_dist();
    init_build();
    init_ExternalRegistryKind();
    init_knobs();
    init_login();
    init_registry2();
    init_utils();
    DEFAULT_CONTAINER_EGRESS_INTERCEPTOR_IMAGE = "cloudflare/proxy-everything:3cb1195@sha256:0ef6716c52430096900b150d84a3302057d6cd2319dae7987128c85d0733e3c8";
    __name(getEgressInterceptorImage, "getEgressInterceptorImage");
    __name(pullEgressInterceptorImage, "pullEgressInterceptorImage");
    __name(pullImage, "pullImage");
    __name(prepareContainerImagesForDev, "prepareContainerImagesForDev");
    __name(resolveImageName, "resolveImageName");
    getAndValidateRegistryType = /* @__PURE__ */ __name((domain2) => {
      if (domain2.includes("://")) {
        throw new Error(
          `${domain2} is invalid:
Image reference should not include the protocol part (e.g: registry.cloudflare.com rather than https://registry.cloudflare.com)`
        );
      }
      let url4;
      try {
        url4 = new URL(`http://${domain2}`);
      } catch (e10) {
        if (e10 instanceof Error) {
          throw new Error(`${domain2} is invalid:
${e10.message}`);
        }
        throw e10;
      }
      const acceptedRegistries = [
        {
          type: "ECR" /* ECR */,
          pattern: /^[0-9]{12}\.dkr\.ecr\.[a-z0-9-]+\.amazonaws\.com$/,
          name: "AWS ECR",
          secretType: "AWS Secret Access Key"
        },
        {
          type: "DockerHub" /* DOCKER_HUB */,
          pattern: /^docker\.io$/,
          name: "DockerHub",
          secretType: "DockerHub PAT Token"
        },
        {
          type: "cloudflare",
          // Make a regex based on the env var CLOUDFLARE_CONTAINER_REGISTRY
          pattern: new RegExp(
            `^${getCloudflareContainerRegistry().replace(/[\\.]/g, "\\$&")}$`
          ),
          name: "Cloudflare Containers Managed Registry"
        }
      ];
      const match3 = acceptedRegistries.find(
        (registry) => registry.pattern.test(url4.hostname)
      );
      if (!match3) {
        const supportedRegistries = acceptedRegistries.filter((r10) => r10.type !== "cloudflare").map((r10) => r10.name).join(", ");
        throw new UserError(
          `${url4.hostname} is not a supported image registry.
Currently we support the following non-Cloudflare registries: ${supportedRegistries}.
To use an existing image from another repository, see https://developers.cloudflare.com/containers/platform-details/image-management/#using-pre-built-container-images`
        );
      }
      return match3;
    }, "getAndValidateRegistryType");
  }
});

// ../containers-shared/index.ts
var init_containers_shared = __esm({
  "../containers-shared/index.ts"() {
    init_import_meta_url();
    init_client();
    init_build();
    init_login();
    init_knobs();
    init_utils();
    init_types();
    init_inspect();
    init_registry2();
    init_images();
  }
});

// ../../node_modules/.pnpm/ts-dedent@2.2.0/node_modules/ts-dedent/esm/index.js
function dedent2(templ) {
  var values = [];
  for (var _i2 = 1; _i2 < arguments.length; _i2++) {
    values[_i2 - 1] = arguments[_i2];
  }
  var strings = Array.from(typeof templ === "string" ? [templ] : templ);
  strings[strings.length - 1] = strings[strings.length - 1].replace(/\r?\n([\t ]*)$/, "");
  var indentLengths = strings.reduce(function(arr, str) {
    var matches = str.match(/\n([\t ]+|(?!\s).)/g);
    if (matches) {
      return arr.concat(matches.map(function(match3) {
        var _a5, _b2;
        return (_b2 = (_a5 = match3.match(/[\t ]/g)) === null || _a5 === void 0 ? void 0 : _a5.length) !== null && _b2 !== void 0 ? _b2 : 0;
      }));
    }
    return arr;
  }, []);
  if (indentLengths.length) {
    var pattern_1 = new RegExp("\n[	 ]{" + Math.min.apply(Math, indentLengths) + "}", "g");
    strings = strings.map(function(str) {
      return str.replace(pattern_1, "\n");
    });
  }
  strings[0] = strings[0].replace(/^\r?\n/, "");
  var string = strings[0];
  values.forEach(function(value, i7) {
    var endentations = string.match(/(?:^|\n)( *)$/);
    var endentation = endentations ? endentations[1] : "";
    var indentedValue = value;
    if (typeof value === "string" && value.includes("\n")) {
      indentedValue = String(value).split("\n").map(function(str, i8) {
        return i8 === 0 ? str : "" + endentation + str;
      }).join("\n");
    }
    string += indentedValue + strings[i7 + 1];
  });
  return string;
}
var esm_default3;
var init_esm2 = __esm({
  "../../node_modules/.pnpm/ts-dedent@2.2.0/node_modules/ts-dedent/esm/index.js"() {
    init_import_meta_url();
    __name(dedent2, "dedent");
    esm_default3 = dedent2;
  }
});
function assertNever2(_value) {
}
function createDeferred(previousDeferred) {
  let resolve32, reject;
  const newPromise = new Promise((_resolve, _reject) => {
    resolve32 = _resolve;
    reject = _reject;
  });
  assert53__default.default(resolve32);
  assert53__default.default(reject);
  previousDeferred?.resolve(newPromise);
  return {
    promise: newPromise,
    resolve: resolve32,
    reject
  };
}
function unwrapHook(hook, ...args) {
  return typeof hook === "function" ? hook(...args) : hook;
}
async function getBinaryFileContents(file3) {
  if ("contents" in file3) {
    if (file3.contents instanceof Buffer) {
      return file3.contents;
    }
    return Buffer.from(file3.contents);
  }
  return fs9.readFile(file3.path);
}
function convertConfigBindingsToStartWorkerBindings(configBindings) {
  return convertConfigToBindings(configBindings, {
    usePreviewIds: true
  });
}
function convertConfigToBindings(config, options) {
  const { usePreviewIds = false, pages = false } = options ?? {};
  const output = {};
  const configIterable = Object.entries(config);
  for (const [type, info] of configIterable) {
    if (info === void 0) {
      continue;
    }
    switch (type) {
      case "vars": {
        for (const [key, value] of Object.entries(info)) {
          if (typeof value === "string") {
            output[key] = { type: "plain_text", value };
          } else {
            output[key] = { type: "json", value };
          }
        }
        break;
      }
      case "kv_namespaces": {
        for (const { binding, ...x7 } of info) {
          output[binding] = {
            type: "kv_namespace",
            ...x7,
            id: usePreviewIds ? x7.preview_id ?? x7.id : x7.id
          };
        }
        break;
      }
      case "send_email": {
        if (pages) {
          break;
        }
        for (const { name: name2, ...x7 } of info) {
          output[name2] = { type: "send_email", ...x7 };
        }
        break;
      }
      case "wasm_modules": {
        if (pages) {
          break;
        }
        for (const [key, value] of Object.entries(info)) {
          if (typeof value === "string") {
            output[key] = { type: "wasm_module", source: { path: value } };
          } else {
            output[key] = { type: "wasm_module", source: { contents: value } };
          }
        }
        break;
      }
      case "text_blobs": {
        if (pages) {
          break;
        }
        for (const [key, value] of Object.entries(info)) {
          output[key] = { type: "text_blob", source: { path: value } };
        }
        break;
      }
      case "data_blobs": {
        if (pages) {
          break;
        }
        for (const [key, value] of Object.entries(info)) {
          if (typeof value === "string") {
            output[key] = { type: "data_blob", source: { path: value } };
          } else {
            output[key] = { type: "data_blob", source: { contents: value } };
          }
        }
        break;
      }
      case "browser": {
        const { binding, ...x7 } = info;
        output[binding] = { type: "browser", ...x7 };
        break;
      }
      case "durable_objects": {
        for (const { name: name2, ...x7 } of info.bindings ?? []) {
          output[name2] = { type: "durable_object_namespace", ...x7 };
        }
        break;
      }
      case "workflows": {
        for (const { binding, ...x7 } of info) {
          output[binding] = { type: "workflow", ...x7 };
        }
        break;
      }
      case "queues": {
        for (const { binding, ...x7 } of info.producers ?? []) {
          output[binding] = {
            type: "queue",
            queue_name: x7.queue,
            ...x7
          };
        }
        break;
      }
      case "r2_buckets": {
        for (const { binding, ...x7 } of info) {
          output[binding] = {
            type: "r2_bucket",
            ...x7,
            bucket_name: usePreviewIds ? x7.preview_bucket_name ?? x7.bucket_name : x7.bucket_name
          };
        }
        break;
      }
      case "d1_databases": {
        for (const { binding, ...x7 } of info) {
          output[binding] = {
            type: "d1",
            ...x7,
            database_id: usePreviewIds ? x7.preview_database_id ?? x7.database_id : x7.database_id
          };
        }
        break;
      }
      case "services": {
        for (const { binding, ...x7 } of info) {
          output[binding] = { type: "service", ...x7 };
        }
        break;
      }
      case "analytics_engine_datasets": {
        for (const { binding, ...x7 } of info) {
          output[binding] = { type: "analytics_engine", ...x7 };
        }
        break;
      }
      case "dispatch_namespaces": {
        if (pages) {
          break;
        }
        for (const { binding, ...x7 } of info) {
          output[binding] = { type: "dispatch_namespace", ...x7 };
        }
        break;
      }
      case "mtls_certificates": {
        for (const { binding, ...x7 } of info) {
          output[binding] = { type: "mtls_certificate", ...x7 };
        }
        break;
      }
      case "logfwdr": {
        if (pages) {
          break;
        }
        for (const { name: name2, ...x7 } of info.bindings ?? []) {
          output[name2] = { type: "logfwdr", ...x7 };
        }
        break;
      }
      case "ai": {
        const { binding, ...x7 } = info;
        output[binding] = { type: "ai", ...x7 };
        break;
      }
      case "images": {
        const { binding, ...x7 } = info;
        output[binding] = { type: "images", ...x7 };
        break;
      }
      case "stream": {
        const { binding, ...x7 } = info;
        output[binding] = { type: "stream", ...x7 };
        break;
      }
      case "version_metadata": {
        const { binding, ...x7 } = info;
        output[binding] = { type: "version_metadata", ...x7 };
        break;
      }
      case "hyperdrive": {
        for (const { binding, ...x7 } of info) {
          output[binding] = { type: "hyperdrive", ...x7 };
        }
        break;
      }
      case "vectorize": {
        for (const { binding, ...x7 } of info) {
          output[binding] = { type: "vectorize", ...x7 };
        }
        break;
      }
      case "ai_search_namespaces": {
        for (const { binding, ...x7 } of info) {
          output[binding] = { type: "ai_search_namespace", ...x7 };
        }
        break;
      }
      case "ai_search": {
        for (const { binding, ...x7 } of info) {
          output[binding] = { type: "ai_search", ...x7 };
        }
        break;
      }
      case "unsafe": {
        if (pages) {
          break;
        }
        for (const { type: unsafeType, name: name2, ...data } of info.bindings ?? []) {
          output[name2] = { type: `unsafe_${unsafeType}`, ...data };
        }
        break;
      }
      case "assets": {
        if (pages) {
          break;
        }
        if (info.binding) {
          output[info.binding] = { type: "assets" };
        }
        break;
      }
      case "pipelines": {
        if (pages) {
          break;
        }
        for (const { binding, ...x7 } of info) {
          output[binding] = { type: "pipeline", ...x7 };
        }
        break;
      }
      case "secrets_store_secrets": {
        for (const { binding, ...x7 } of info) {
          output[binding] = { type: "secrets_store_secret", ...x7 };
        }
        break;
      }
      case "unsafe_hello_world": {
        if (pages) {
          break;
        }
        for (const { binding, ...x7 } of info) {
          output[binding] = { type: "unsafe_hello_world", ...x7 };
        }
        break;
      }
      case "flagship": {
        for (const { binding, ...x7 } of info) {
          output[binding] = { type: "flagship", ...x7 };
        }
        break;
      }
      case "ratelimits": {
        for (const { name: name2, ...x7 } of info) {
          output[name2] = { type: "ratelimit", ...x7 };
        }
        break;
      }
      case "worker_loaders": {
        for (const { binding, ...x7 } of info) {
          output[binding] = { type: "worker_loader", ...x7 };
        }
        break;
      }
      case "vpc_services": {
        for (const { binding, ...x7 } of info) {
          output[binding] = { type: "vpc_service", ...x7 };
        }
        break;
      }
      case "vpc_networks": {
        for (const { binding, ...x7 } of info) {
          output[binding] = { type: "vpc_network", ...x7 };
        }
        break;
      }
      case "media": {
        const { binding, ...x7 } = info;
        output[binding] = { type: "media", ...x7 };
        break;
      }
    }
  }
  return output;
}
function convertStartDevOptionsToBindings(inputBindings) {
  const configBindings = {
    vars: inputBindings.vars,
    kv_namespaces: inputBindings.kv,
    durable_objects: inputBindings.durableObjects ? { bindings: inputBindings.durableObjects } : void 0,
    services: inputBindings.services,
    r2_buckets: inputBindings.r2,
    ai: inputBindings.ai,
    stream: inputBindings.stream,
    version_metadata: inputBindings.version_metadata,
    d1_databases: inputBindings.d1Databases
  };
  return convertConfigToBindings(configBindings, {
    usePreviewIds: true
  });
}
function isUnsafeBindingType(type) {
  return type.startsWith("unsafe_");
}
function getBindingKey(type) {
  if (nameBindings.includes(type)) {
    return "name";
  }
  return "binding";
}
function convertWorkerMetadataBindingsToFlatBindings(bindings) {
  const output = {};
  for (const binding of bindings) {
    const { name: name2, type } = binding;
    switch (type) {
      case "plain_text": {
        const b11 = binding;
        output[name2] = { type: "plain_text", value: b11.text };
        break;
      }
      case "secret_text": {
        const b11 = binding;
        output[name2] = { type: "secret_text", value: b11.text };
        break;
      }
      case "json": {
        const b11 = binding;
        output[name2] = { type: "json", value: b11.json };
        break;
      }
      case "kv_namespace": {
        const b11 = binding;
        output[name2] = { type: "kv_namespace", id: b11.namespace_id, raw: b11.raw };
        break;
      }
      case "d1": {
        const b11 = binding;
        output[name2] = {
          type: "d1",
          database_id: b11.id,
          database_internal_env: b11.internalEnv,
          raw: b11.raw
        };
        break;
      }
      case "dispatch_namespace": {
        const b11 = binding;
        output[name2] = {
          type: "dispatch_namespace",
          namespace: b11.namespace,
          outbound: b11.outbound ? {
            service: b11.outbound.worker.service,
            environment: b11.outbound.worker.environment,
            parameters: b11.outbound.params?.map((p7) => p7.name)
          } : void 0
        };
        break;
      }
      case "durable_object_namespace": {
        const b11 = binding;
        output[name2] = {
          type: "durable_object_namespace",
          class_name: b11.class_name,
          script_name: b11.script_name,
          environment: b11.environment
        };
        break;
      }
      case "workflow": {
        const b11 = binding;
        output[name2] = {
          type: "workflow",
          name: b11.workflow_name,
          class_name: b11.class_name,
          script_name: b11.script_name,
          raw: b11.raw
        };
        break;
      }
      case "queue": {
        const b11 = binding;
        output[name2] = {
          type: "queue",
          queue_name: b11.queue_name,
          delivery_delay: b11.delivery_delay,
          raw: b11.raw
        };
        break;
      }
      case "r2_bucket": {
        const b11 = binding;
        output[name2] = {
          type: "r2_bucket",
          bucket_name: b11.bucket_name,
          jurisdiction: b11.jurisdiction,
          raw: b11.raw
        };
        break;
      }
      case "service": {
        const b11 = binding;
        output[name2] = {
          type: "service",
          service: b11.service,
          environment: b11.environment,
          entrypoint: b11.entrypoint,
          cross_account_grant: b11.cross_account_grant
        };
        break;
      }
      case "analytics_engine": {
        const b11 = binding;
        output[name2] = { type: "analytics_engine", dataset: b11.dataset };
        break;
      }
      case "vectorize": {
        const b11 = binding;
        output[name2] = {
          type: "vectorize",
          index_name: b11.index_name,
          raw: b11.raw
        };
        break;
      }
      case "ai_search_namespace": {
        const b11 = binding;
        output[name2] = {
          type: "ai_search_namespace",
          namespace: b11.namespace
        };
        break;
      }
      case "ai_search": {
        const b11 = binding;
        output[name2] = {
          type: "ai_search",
          instance_name: b11.instance_name
        };
        break;
      }
      case "hyperdrive": {
        const b11 = binding;
        output[name2] = { type: "hyperdrive", id: b11.id };
        break;
      }
      case "send_email": {
        const b11 = binding;
        const emailBinding = { type: "send_email" };
        if ("destination_address" in b11 && b11.destination_address) {
          emailBinding.destination_address = b11.destination_address;
        }
        if ("allowed_destination_addresses" in b11 && b11.allowed_destination_addresses) {
          emailBinding.allowed_destination_addresses = b11.allowed_destination_addresses;
        }
        if ("allowed_sender_addresses" in b11 && b11.allowed_sender_addresses) {
          emailBinding.allowed_sender_addresses = b11.allowed_sender_addresses;
        }
        output[name2] = emailBinding;
        break;
      }
      case "mtls_certificate": {
        const b11 = binding;
        output[name2] = {
          type: "mtls_certificate",
          certificate_id: b11.certificate_id
        };
        break;
      }
      case "pipelines": {
        const b11 = binding;
        output[name2] = { type: "pipeline", pipeline: b11.pipeline };
        break;
      }
      case "browser":
      case "ai":
      case "images":
      case "stream":
      case "version_metadata":
      case "media":
      case "inherit": {
        const { name: _name, ...rest } = binding;
        output[name2] = rest;
        break;
      }
      default: {
        const { name: _name, ...rest } = binding;
        output[name2] = rest;
      }
    }
  }
  return output;
}
function extractBindingsOfType(type, bindings) {
  return Object.entries(bindings ?? {}).filter(
    (binding) => binding[1].type === type
  ).map((binding) => ({
    ...binding[1],
    [getBindingKey(type)]: binding[0]
  }));
}
var nameBindings;
var init_utils2 = __esm({
  "src/api/startDevWorker/utils.ts"() {
    init_import_meta_url();
    __name(assertNever2, "assertNever");
    __name(createDeferred, "createDeferred");
    __name(unwrapHook, "unwrapHook");
    __name(getBinaryFileContents, "getBinaryFileContents");
    __name(convertConfigBindingsToStartWorkerBindings, "convertConfigBindingsToStartWorkerBindings");
    __name(convertConfigToBindings, "convertConfigToBindings");
    __name(convertStartDevOptionsToBindings, "convertStartDevOptionsToBindings");
    __name(isUnsafeBindingType, "isUnsafeBindingType");
    nameBindings = [
      "durable_object_namespace",
      "logfwdr",
      "ratelimit",
      "unsafe_ratelimit",
      "send_email"
    ];
    __name(getBindingKey, "getBindingKey");
    __name(convertWorkerMetadataBindingsToFlatBindings, "convertWorkerMetadataBindingsToFlatBindings");
    __name(extractBindingsOfType, "extractBindingsOfType");
  }
});

// ../../node_modules/.pnpm/glob-to-regexp@0.4.1/node_modules/glob-to-regexp/index.js
var require_glob_to_regexp = __commonJS({
  "../../node_modules/.pnpm/glob-to-regexp@0.4.1/node_modules/glob-to-regexp/index.js"(exports, module2) {
    init_import_meta_url();
    module2.exports = function(glob, opts) {
      if (typeof glob !== "string") {
        throw new TypeError("Expected a string");
      }
      var str = String(glob);
      var reStr = "";
      var extended = opts ? !!opts.extended : false;
      var globstar = opts ? !!opts.globstar : false;
      var inGroup = false;
      var flags2 = opts && typeof opts.flags === "string" ? opts.flags : "";
      var c8;
      for (var i7 = 0, len = str.length; i7 < len; i7++) {
        c8 = str[i7];
        switch (c8) {
          case "/":
          case "$":
          case "^":
          case "+":
          case ".":
          case "(":
          case ")":
          case "=":
          case "!":
          case "|":
            reStr += "\\" + c8;
            break;
          case "?":
            if (extended) {
              reStr += ".";
              break;
            }
          case "[":
          case "]":
            if (extended) {
              reStr += c8;
              break;
            }
          case "{":
            if (extended) {
              inGroup = true;
              reStr += "(";
              break;
            }
          case "}":
            if (extended) {
              inGroup = false;
              reStr += ")";
              break;
            }
          case ",":
            if (inGroup) {
              reStr += "|";
              break;
            }
            reStr += "\\" + c8;
            break;
          case "*":
            var prevChar = str[i7 - 1];
            var starCount = 1;
            while (str[i7 + 1] === "*") {
              starCount++;
              i7++;
            }
            var nextChar = str[i7 + 1];
            if (!globstar) {
              reStr += ".*";
            } else {
              var isGlobstar = starCount > 1 && (prevChar === "/" || prevChar === void 0) && (nextChar === "/" || nextChar === void 0);
              if (isGlobstar) {
                reStr += "((?:[^/]*(?:/|$))*)";
                i7++;
              } else {
                reStr += "([^/]*)";
              }
            }
            break;
          default:
            reStr += c8;
        }
      }
      if (!flags2 || !~flags2.indexOf("g")) {
        reStr = "^" + reStr + "$";
      }
      return new RegExp(reStr, flags2);
    };
  }
});

// ../../node_modules/.pnpm/resolve@1.22.8/node_modules/resolve/lib/homedir.js
var require_homedir = __commonJS({
  "../../node_modules/.pnpm/resolve@1.22.8/node_modules/resolve/lib/homedir.js"(exports, module2) {
    init_import_meta_url();
    var os13 = __require("os");
    module2.exports = os13.homedir || /* @__PURE__ */ __name(function homedir3() {
      var home = process.env.HOME;
      var user = process.env.LOGNAME || process.env.USER || process.env.LNAME || process.env.USERNAME;
      if (process.platform === "win32") {
        return process.env.USERPROFILE || process.env.HOMEDRIVE + process.env.HOMEPATH || home || null;
      }
      if (process.platform === "darwin") {
        return home || (user ? "/Users/" + user : null);
      }
      if (process.platform === "linux") {
        return home || (process.getuid() === 0 ? "/root" : user ? "/home/" + user : null);
      }
      return home || null;
    }, "homedir");
  }
});

// ../../node_modules/.pnpm/resolve@1.22.8/node_modules/resolve/lib/caller.js
var require_caller = __commonJS({
  "../../node_modules/.pnpm/resolve@1.22.8/node_modules/resolve/lib/caller.js"(exports, module2) {
    init_import_meta_url();
    module2.exports = function() {
      var origPrepareStackTrace = Error.prepareStackTrace;
      Error.prepareStackTrace = function(_5, stack2) {
        return stack2;
      };
      var stack = new Error().stack;
      Error.prepareStackTrace = origPrepareStackTrace;
      return stack[2].getFileName();
    };
  }
});

// ../../node_modules/.pnpm/path-parse@1.0.7/node_modules/path-parse/index.js
var require_path_parse = __commonJS({
  "../../node_modules/.pnpm/path-parse@1.0.7/node_modules/path-parse/index.js"(exports, module2) {
    init_import_meta_url();
    var isWindows5 = process.platform === "win32";
    var splitWindowsRe = /^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/;
    var win32 = {};
    function win32SplitPath(filename) {
      return splitWindowsRe.exec(filename).slice(1);
    }
    __name(win32SplitPath, "win32SplitPath");
    win32.parse = function(pathString) {
      if (typeof pathString !== "string") {
        throw new TypeError(
          "Parameter 'pathString' must be a string, not " + typeof pathString
        );
      }
      var allParts = win32SplitPath(pathString);
      if (!allParts || allParts.length !== 5) {
        throw new TypeError("Invalid path '" + pathString + "'");
      }
      return {
        root: allParts[1],
        dir: allParts[0] === allParts[1] ? allParts[0] : allParts[0].slice(0, -1),
        base: allParts[2],
        ext: allParts[4],
        name: allParts[3]
      };
    };
    var splitPathRe = /^((\/?)(?:[^\/]*\/)*)((\.{1,2}|[^\/]+?|)(\.[^.\/]*|))[\/]*$/;
    var posix2 = {};
    function posixSplitPath(filename) {
      return splitPathRe.exec(filename).slice(1);
    }
    __name(posixSplitPath, "posixSplitPath");
    posix2.parse = function(pathString) {
      if (typeof pathString !== "string") {
        throw new TypeError(
          "Parameter 'pathString' must be a string, not " + typeof pathString
        );
      }
      var allParts = posixSplitPath(pathString);
      if (!allParts || allParts.length !== 5) {
        throw new TypeError("Invalid path '" + pathString + "'");
      }
      return {
        root: allParts[1],
        dir: allParts[0].slice(0, -1),
        base: allParts[2],
        ext: allParts[4],
        name: allParts[3]
      };
    };
    if (isWindows5)
      module2.exports = win32.parse;
    else
      module2.exports = posix2.parse;
    module2.exports.posix = posix2.parse;
    module2.exports.win32 = win32.parse;
  }
});

// ../../node_modules/.pnpm/resolve@1.22.8/node_modules/resolve/lib/node-modules-paths.js
var require_node_modules_paths = __commonJS({
  "../../node_modules/.pnpm/resolve@1.22.8/node_modules/resolve/lib/node-modules-paths.js"(exports, module2) {
    init_import_meta_url();
    var path84 = __require("path");
    var parse17 = path84.parse || require_path_parse();
    var getNodeModulesDirs = /* @__PURE__ */ __name(function getNodeModulesDirs2(absoluteStart, modules) {
      var prefix = "/";
      if (/^([A-Za-z]:)/.test(absoluteStart)) {
        prefix = "";
      } else if (/^\\\\/.test(absoluteStart)) {
        prefix = "\\\\";
      }
      var paths = [absoluteStart];
      var parsed = parse17(absoluteStart);
      while (parsed.dir !== paths[paths.length - 1]) {
        paths.push(parsed.dir);
        parsed = parse17(parsed.dir);
      }
      return paths.reduce(function(dirs, aPath) {
        return dirs.concat(modules.map(function(moduleDir) {
          return path84.resolve(prefix, aPath, moduleDir);
        }));
      }, []);
    }, "getNodeModulesDirs");
    module2.exports = /* @__PURE__ */ __name(function nodeModulesPaths(start, opts, request4) {
      var modules = opts && opts.moduleDirectory ? [].concat(opts.moduleDirectory) : ["node_modules"];
      if (opts && typeof opts.paths === "function") {
        return opts.paths(
          request4,
          start,
          function() {
            return getNodeModulesDirs(start, modules);
          },
          opts
        );
      }
      var dirs = getNodeModulesDirs(start, modules);
      return opts && opts.paths ? dirs.concat(opts.paths) : dirs;
    }, "nodeModulesPaths");
  }
});

// ../../node_modules/.pnpm/resolve@1.22.8/node_modules/resolve/lib/normalize-options.js
var require_normalize_options = __commonJS({
  "../../node_modules/.pnpm/resolve@1.22.8/node_modules/resolve/lib/normalize-options.js"(exports, module2) {
    init_import_meta_url();
    module2.exports = function(x7, opts) {
      return opts || {};
    };
  }
});

// ../../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"(exports, module2) {
    init_import_meta_url();
    var ERROR_MESSAGE = "Function.prototype.bind called on incompatible ";
    var toStr = Object.prototype.toString;
    var max = Math.max;
    var funcType = "[object Function]";
    var concatty = /* @__PURE__ */ __name(function concatty2(a7, b11) {
      var arr = [];
      for (var i7 = 0; i7 < a7.length; i7 += 1) {
        arr[i7] = a7[i7];
      }
      for (var j7 = 0; j7 < b11.length; j7 += 1) {
        arr[j7 + a7.length] = b11[j7];
      }
      return arr;
    }, "concatty");
    var slicy = /* @__PURE__ */ __name(function slicy2(arrLike, offset) {
      var arr = [];
      for (var i7 = offset || 0, j7 = 0; i7 < arrLike.length; i7 += 1, j7 += 1) {
        arr[j7] = arrLike[i7];
      }
      return arr;
    }, "slicy");
    var joiny = /* @__PURE__ */ __name(function(arr, joiner) {
      var str = "";
      for (var i7 = 0; i7 < arr.length; i7 += 1) {
        str += arr[i7];
        if (i7 + 1 < arr.length) {
          str += joiner;
        }
      }
      return str;
    }, "joiny");
    module2.exports = /* @__PURE__ */ __name(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 = /* @__PURE__ */ __name(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)
        );
      }, "binder");
      var boundLength = max(0, target.length - args.length);
      var boundArgs = [];
      for (var i7 = 0; i7 < boundLength; i7++) {
        boundArgs[i7] = "$" + i7;
      }
      bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder);
      if (target.prototype) {
        var Empty = /* @__PURE__ */ __name(function Empty2() {
        }, "Empty");
        Empty.prototype = target.prototype;
        bound.prototype = new Empty();
        Empty.prototype = null;
      }
      return bound;
    }, "bind");
  }
});

// ../../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"(exports, module2) {
    init_import_meta_url();
    var implementation = require_implementation();
    module2.exports = Function.prototype.bind || implementation;
  }
});

// ../../node_modules/.pnpm/has@1.0.3/node_modules/has/src/index.js
var require_src = __commonJS({
  "../../node_modules/.pnpm/has@1.0.3/node_modules/has/src/index.js"(exports, module2) {
    init_import_meta_url();
    var bind = require_function_bind();
    module2.exports = bind.call(Function.call, Object.prototype.hasOwnProperty);
  }
});

// ../../node_modules/.pnpm/is-core-module@2.13.0/node_modules/is-core-module/core.json
var require_core = __commonJS({
  "../../node_modules/.pnpm/is-core-module@2.13.0/node_modules/is-core-module/core.json"(exports, module2) {
    module2.exports = {
      assert: true,
      "node:assert": [">= 14.18 && < 15", ">= 16"],
      "assert/strict": ">= 15",
      "node:assert/strict": ">= 16",
      async_hooks: ">= 8",
      "node:async_hooks": [">= 14.18 && < 15", ">= 16"],
      buffer_ieee754: ">= 0.5 && < 0.9.7",
      buffer: true,
      "node:buffer": [">= 14.18 && < 15", ">= 16"],
      child_process: true,
      "node:child_process": [">= 14.18 && < 15", ">= 16"],
      cluster: ">= 0.5",
      "node:cluster": [">= 14.18 && < 15", ">= 16"],
      console: true,
      "node:console": [">= 14.18 && < 15", ">= 16"],
      constants: true,
      "node:constants": [">= 14.18 && < 15", ">= 16"],
      crypto: true,
      "node:crypto": [">= 14.18 && < 15", ">= 16"],
      _debug_agent: ">= 1 && < 8",
      _debugger: "< 8",
      dgram: true,
      "node:dgram": [">= 14.18 && < 15", ">= 16"],
      diagnostics_channel: [">= 14.17 && < 15", ">= 15.1"],
      "node:diagnostics_channel": [">= 14.18 && < 15", ">= 16"],
      dns: true,
      "node:dns": [">= 14.18 && < 15", ">= 16"],
      "dns/promises": ">= 15",
      "node:dns/promises": ">= 16",
      domain: ">= 0.7.12",
      "node:domain": [">= 14.18 && < 15", ">= 16"],
      events: true,
      "node:events": [">= 14.18 && < 15", ">= 16"],
      freelist: "< 6",
      fs: true,
      "node:fs": [">= 14.18 && < 15", ">= 16"],
      "fs/promises": [">= 10 && < 10.1", ">= 14"],
      "node:fs/promises": [">= 14.18 && < 15", ">= 16"],
      _http_agent: ">= 0.11.1",
      "node:_http_agent": [">= 14.18 && < 15", ">= 16"],
      _http_client: ">= 0.11.1",
      "node:_http_client": [">= 14.18 && < 15", ">= 16"],
      _http_common: ">= 0.11.1",
      "node:_http_common": [">= 14.18 && < 15", ">= 16"],
      _http_incoming: ">= 0.11.1",
      "node:_http_incoming": [">= 14.18 && < 15", ">= 16"],
      _http_outgoing: ">= 0.11.1",
      "node:_http_outgoing": [">= 14.18 && < 15", ">= 16"],
      _http_server: ">= 0.11.1",
      "node:_http_server": [">= 14.18 && < 15", ">= 16"],
      http: true,
      "node:http": [">= 14.18 && < 15", ">= 16"],
      http2: ">= 8.8",
      "node:http2": [">= 14.18 && < 15", ">= 16"],
      https: true,
      "node:https": [">= 14.18 && < 15", ">= 16"],
      inspector: ">= 8",
      "node:inspector": [">= 14.18 && < 15", ">= 16"],
      "inspector/promises": [">= 19"],
      "node:inspector/promises": [">= 19"],
      _linklist: "< 8",
      module: true,
      "node:module": [">= 14.18 && < 15", ">= 16"],
      net: true,
      "node:net": [">= 14.18 && < 15", ">= 16"],
      "node-inspect/lib/_inspect": ">= 7.6 && < 12",
      "node-inspect/lib/internal/inspect_client": ">= 7.6 && < 12",
      "node-inspect/lib/internal/inspect_repl": ">= 7.6 && < 12",
      os: true,
      "node:os": [">= 14.18 && < 15", ">= 16"],
      path: true,
      "node:path": [">= 14.18 && < 15", ">= 16"],
      "path/posix": ">= 15.3",
      "node:path/posix": ">= 16",
      "path/win32": ">= 15.3",
      "node:path/win32": ">= 16",
      perf_hooks: ">= 8.5",
      "node:perf_hooks": [">= 14.18 && < 15", ">= 16"],
      process: ">= 1",
      "node:process": [">= 14.18 && < 15", ">= 16"],
      punycode: ">= 0.5",
      "node:punycode": [">= 14.18 && < 15", ">= 16"],
      querystring: true,
      "node:querystring": [">= 14.18 && < 15", ">= 16"],
      readline: true,
      "node:readline": [">= 14.18 && < 15", ">= 16"],
      "readline/promises": ">= 17",
      "node:readline/promises": ">= 17",
      repl: true,
      "node:repl": [">= 14.18 && < 15", ">= 16"],
      smalloc: ">= 0.11.5 && < 3",
      _stream_duplex: ">= 0.9.4",
      "node:_stream_duplex": [">= 14.18 && < 15", ">= 16"],
      _stream_transform: ">= 0.9.4",
      "node:_stream_transform": [">= 14.18 && < 15", ">= 16"],
      _stream_wrap: ">= 1.4.1",
      "node:_stream_wrap": [">= 14.18 && < 15", ">= 16"],
      _stream_passthrough: ">= 0.9.4",
      "node:_stream_passthrough": [">= 14.18 && < 15", ">= 16"],
      _stream_readable: ">= 0.9.4",
      "node:_stream_readable": [">= 14.18 && < 15", ">= 16"],
      _stream_writable: ">= 0.9.4",
      "node:_stream_writable": [">= 14.18 && < 15", ">= 16"],
      stream: true,
      "node:stream": [">= 14.18 && < 15", ">= 16"],
      "stream/consumers": ">= 16.7",
      "node:stream/consumers": ">= 16.7",
      "stream/promises": ">= 15",
      "node:stream/promises": ">= 16",
      "stream/web": ">= 16.5",
      "node:stream/web": ">= 16.5",
      string_decoder: true,
      "node:string_decoder": [">= 14.18 && < 15", ">= 16"],
      sys: [">= 0.4 && < 0.7", ">= 0.8"],
      "node:sys": [">= 14.18 && < 15", ">= 16"],
      "test/reporters": ">= 19.9 && < 20.2",
      "node:test/reporters": [">= 18.17 && < 19", ">= 19.9", ">= 20"],
      "node:test": [">= 16.17 && < 17", ">= 18"],
      timers: true,
      "node:timers": [">= 14.18 && < 15", ">= 16"],
      "timers/promises": ">= 15",
      "node:timers/promises": ">= 16",
      _tls_common: ">= 0.11.13",
      "node:_tls_common": [">= 14.18 && < 15", ">= 16"],
      _tls_legacy: ">= 0.11.3 && < 10",
      _tls_wrap: ">= 0.11.3",
      "node:_tls_wrap": [">= 14.18 && < 15", ">= 16"],
      tls: true,
      "node:tls": [">= 14.18 && < 15", ">= 16"],
      trace_events: ">= 10",
      "node:trace_events": [">= 14.18 && < 15", ">= 16"],
      tty: true,
      "node:tty": [">= 14.18 && < 15", ">= 16"],
      url: true,
      "node:url": [">= 14.18 && < 15", ">= 16"],
      util: true,
      "node:util": [">= 14.18 && < 15", ">= 16"],
      "util/types": ">= 15.3",
      "node:util/types": ">= 16",
      "v8/tools/arguments": ">= 10 && < 12",
      "v8/tools/codemap": [">= 4.4 && < 5", ">= 5.2 && < 12"],
      "v8/tools/consarray": [">= 4.4 && < 5", ">= 5.2 && < 12"],
      "v8/tools/csvparser": [">= 4.4 && < 5", ">= 5.2 && < 12"],
      "v8/tools/logreader": [">= 4.4 && < 5", ">= 5.2 && < 12"],
      "v8/tools/profile_view": [">= 4.4 && < 5", ">= 5.2 && < 12"],
      "v8/tools/splaytree": [">= 4.4 && < 5", ">= 5.2 && < 12"],
      v8: ">= 1",
      "node:v8": [">= 14.18 && < 15", ">= 16"],
      vm: true,
      "node:vm": [">= 14.18 && < 15", ">= 16"],
      wasi: [">= 13.4 && < 13.5", ">= 18.17 && < 19", ">= 20"],
      "node:wasi": [">= 18.17 && < 19", ">= 20"],
      worker_threads: ">= 11.7",
      "node:worker_threads": [">= 14.18 && < 15", ">= 16"],
      zlib: ">= 0.5",
      "node:zlib": [">= 14.18 && < 15", ">= 16"]
    };
  }
});

// ../../node_modules/.pnpm/is-core-module@2.13.0/node_modules/is-core-module/index.js
var require_is_core_module = __commonJS({
  "../../node_modules/.pnpm/is-core-module@2.13.0/node_modules/is-core-module/index.js"(exports, module2) {
    init_import_meta_url();
    var has2 = require_src();
    function specifierIncluded(current, specifier) {
      var nodeParts = current.split(".");
      var parts = specifier.split(" ");
      var op = parts.length > 1 ? parts[0] : "=";
      var versionParts = (parts.length > 1 ? parts[1] : parts[0]).split(".");
      for (var i7 = 0; i7 < 3; ++i7) {
        var cur = parseInt(nodeParts[i7] || 0, 10);
        var ver = parseInt(versionParts[i7] || 0, 10);
        if (cur === ver) {
          continue;
        }
        if (op === "<") {
          return cur < ver;
        }
        if (op === ">=") {
          return cur >= ver;
        }
        return false;
      }
      return op === ">=";
    }
    __name(specifierIncluded, "specifierIncluded");
    function matchesRange(current, range) {
      var specifiers = range.split(/ ?&& ?/);
      if (specifiers.length === 0) {
        return false;
      }
      for (var i7 = 0; i7 < specifiers.length; ++i7) {
        if (!specifierIncluded(current, specifiers[i7])) {
          return false;
        }
      }
      return true;
    }
    __name(matchesRange, "matchesRange");
    function versionIncluded(nodeVersion2, specifierValue) {
      if (typeof specifierValue === "boolean") {
        return specifierValue;
      }
      var current = typeof nodeVersion2 === "undefined" ? process.versions && process.versions.node : nodeVersion2;
      if (typeof current !== "string") {
        throw new TypeError(typeof nodeVersion2 === "undefined" ? "Unable to determine current node version" : "If provided, a valid node version is required");
      }
      if (specifierValue && typeof specifierValue === "object") {
        for (var i7 = 0; i7 < specifierValue.length; ++i7) {
          if (matchesRange(current, specifierValue[i7])) {
            return true;
          }
        }
        return false;
      }
      return matchesRange(current, specifierValue);
    }
    __name(versionIncluded, "versionIncluded");
    var data = require_core();
    module2.exports = /* @__PURE__ */ __name(function isCore(x7, nodeVersion2) {
      return has2(data, x7) && versionIncluded(nodeVersion2, data[x7]);
    }, "isCore");
  }
});

// ../../node_modules/.pnpm/resolve@1.22.8/node_modules/resolve/lib/async.js
var require_async = __commonJS({
  "../../node_modules/.pnpm/resolve@1.22.8/node_modules/resolve/lib/async.js"(exports, module2) {
    init_import_meta_url();
    var fs33 = __require("fs");
    var getHomedir = require_homedir();
    var path84 = __require("path");
    var caller = require_caller();
    var nodeModulesPaths = require_node_modules_paths();
    var normalizeOptions = require_normalize_options();
    var isCore = require_is_core_module();
    var realpathFS = process.platform !== "win32" && fs33.realpath && typeof fs33.realpath.native === "function" ? fs33.realpath.native : fs33.realpath;
    var homedir3 = getHomedir();
    var defaultPaths = /* @__PURE__ */ __name(function() {
      return [
        path84.join(homedir3, ".node_modules"),
        path84.join(homedir3, ".node_libraries")
      ];
    }, "defaultPaths");
    var defaultIsFile = /* @__PURE__ */ __name(function isFile2(file3, cb2) {
      fs33.stat(file3, function(err, stat9) {
        if (!err) {
          return cb2(null, stat9.isFile() || stat9.isFIFO());
        }
        if (err.code === "ENOENT" || err.code === "ENOTDIR") return cb2(null, false);
        return cb2(err);
      });
    }, "isFile");
    var defaultIsDir = /* @__PURE__ */ __name(function isDirectory3(dir2, cb2) {
      fs33.stat(dir2, function(err, stat9) {
        if (!err) {
          return cb2(null, stat9.isDirectory());
        }
        if (err.code === "ENOENT" || err.code === "ENOTDIR") return cb2(null, false);
        return cb2(err);
      });
    }, "isDirectory");
    var defaultRealpath = /* @__PURE__ */ __name(function realpath2(x7, cb2) {
      realpathFS(x7, function(realpathErr, realPath) {
        if (realpathErr && realpathErr.code !== "ENOENT") cb2(realpathErr);
        else cb2(null, realpathErr ? x7 : realPath);
      });
    }, "realpath");
    var maybeRealpath = /* @__PURE__ */ __name(function maybeRealpath2(realpath2, x7, opts, cb2) {
      if (opts && opts.preserveSymlinks === false) {
        realpath2(x7, cb2);
      } else {
        cb2(null, x7);
      }
    }, "maybeRealpath");
    var defaultReadPackage = /* @__PURE__ */ __name(function defaultReadPackage2(readFile19, pkgfile, cb2) {
      readFile19(pkgfile, function(readFileErr, body) {
        if (readFileErr) cb2(readFileErr);
        else {
          try {
            var pkg = JSON.parse(body);
            cb2(null, pkg);
          } catch (jsonErr) {
            cb2(null);
          }
        }
      });
    }, "defaultReadPackage");
    var getPackageCandidates = /* @__PURE__ */ __name(function getPackageCandidates2(x7, start, opts) {
      var dirs = nodeModulesPaths(start, opts, x7);
      for (var i7 = 0; i7 < dirs.length; i7++) {
        dirs[i7] = path84.join(dirs[i7], x7);
      }
      return dirs;
    }, "getPackageCandidates");
    module2.exports = /* @__PURE__ */ __name(function resolve32(x7, options, callback) {
      var cb2 = callback;
      var opts = options;
      if (typeof options === "function") {
        cb2 = opts;
        opts = {};
      }
      if (typeof x7 !== "string") {
        var err = new TypeError("Path must be a string.");
        return process.nextTick(function() {
          cb2(err);
        });
      }
      opts = normalizeOptions(x7, opts);
      var isFile2 = opts.isFile || defaultIsFile;
      var isDirectory3 = opts.isDirectory || defaultIsDir;
      var readFile19 = opts.readFile || fs33.readFile;
      var realpath2 = opts.realpath || defaultRealpath;
      var readPackage = opts.readPackage || defaultReadPackage;
      if (opts.readFile && opts.readPackage) {
        var conflictErr = new TypeError("`readFile` and `readPackage` are mutually exclusive.");
        return process.nextTick(function() {
          cb2(conflictErr);
        });
      }
      var packageIterator = opts.packageIterator;
      var extensions = opts.extensions || [".js"];
      var includeCoreModules = opts.includeCoreModules !== false;
      var basedir = opts.basedir || path84.dirname(caller());
      var parent = opts.filename || basedir;
      opts.paths = opts.paths || defaultPaths();
      var absoluteStart = path84.resolve(basedir);
      maybeRealpath(
        realpath2,
        absoluteStart,
        opts,
        function(err2, realStart) {
          if (err2) cb2(err2);
          else init4(realStart);
        }
      );
      var res;
      function init4(basedir2) {
        if (/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(x7)) {
          res = path84.resolve(basedir2, x7);
          if (x7 === "." || x7 === ".." || x7.slice(-1) === "/") res += "/";
          if (/\/$/.test(x7) && res === basedir2) {
            loadAsDirectory(res, opts.package, onfile);
          } else loadAsFile(res, opts.package, onfile);
        } else if (includeCoreModules && isCore(x7)) {
          return cb2(null, x7);
        } else loadNodeModules(x7, basedir2, function(err2, n9, pkg) {
          if (err2) cb2(err2);
          else if (n9) {
            return maybeRealpath(realpath2, n9, opts, function(err3, realN) {
              if (err3) {
                cb2(err3);
              } else {
                cb2(null, realN, pkg);
              }
            });
          } else {
            var moduleError = new Error("Cannot find module '" + x7 + "' from '" + parent + "'");
            moduleError.code = "MODULE_NOT_FOUND";
            cb2(moduleError);
          }
        });
      }
      __name(init4, "init");
      function onfile(err2, m7, pkg) {
        if (err2) cb2(err2);
        else if (m7) cb2(null, m7, pkg);
        else loadAsDirectory(res, function(err3, d8, pkg2) {
          if (err3) cb2(err3);
          else if (d8) {
            maybeRealpath(realpath2, d8, opts, function(err4, realD) {
              if (err4) {
                cb2(err4);
              } else {
                cb2(null, realD, pkg2);
              }
            });
          } else {
            var moduleError = new Error("Cannot find module '" + x7 + "' from '" + parent + "'");
            moduleError.code = "MODULE_NOT_FOUND";
            cb2(moduleError);
          }
        });
      }
      __name(onfile, "onfile");
      function loadAsFile(x8, thePackage, callback2) {
        var loadAsFilePackage = thePackage;
        var cb3 = callback2;
        if (typeof loadAsFilePackage === "function") {
          cb3 = loadAsFilePackage;
          loadAsFilePackage = void 0;
        }
        var exts = [""].concat(extensions);
        load(exts, x8, loadAsFilePackage);
        function load(exts2, x9, loadPackage) {
          if (exts2.length === 0) return cb3(null, void 0, loadPackage);
          var file3 = x9 + exts2[0];
          var pkg = loadPackage;
          if (pkg) onpkg(null, pkg);
          else loadpkg(path84.dirname(file3), onpkg);
          function onpkg(err2, pkg_, dir2) {
            pkg = pkg_;
            if (err2) return cb3(err2);
            if (dir2 && pkg && opts.pathFilter) {
              var rfile = path84.relative(dir2, file3);
              var rel = rfile.slice(0, rfile.length - exts2[0].length);
              var r10 = opts.pathFilter(pkg, x9, rel);
              if (r10) return load(
                [""].concat(extensions.slice()),
                path84.resolve(dir2, r10),
                pkg
              );
            }
            isFile2(file3, onex);
          }
          __name(onpkg, "onpkg");
          function onex(err2, ex) {
            if (err2) return cb3(err2);
            if (ex) return cb3(null, file3, pkg);
            load(exts2.slice(1), x9, pkg);
          }
          __name(onex, "onex");
        }
        __name(load, "load");
      }
      __name(loadAsFile, "loadAsFile");
      function loadpkg(dir2, cb3) {
        if (dir2 === "" || dir2 === "/") return cb3(null);
        if (process.platform === "win32" && /^\w:[/\\]*$/.test(dir2)) {
          return cb3(null);
        }
        if (/[/\\]node_modules[/\\]*$/.test(dir2)) return cb3(null);
        maybeRealpath(realpath2, dir2, opts, function(unwrapErr, pkgdir) {
          if (unwrapErr) return loadpkg(path84.dirname(dir2), cb3);
          var pkgfile = path84.join(pkgdir, "package.json");
          isFile2(pkgfile, function(err2, ex) {
            if (!ex) return loadpkg(path84.dirname(dir2), cb3);
            readPackage(readFile19, pkgfile, function(err3, pkgParam) {
              if (err3) cb3(err3);
              var pkg = pkgParam;
              if (pkg && opts.packageFilter) {
                pkg = opts.packageFilter(pkg, pkgfile);
              }
              cb3(null, pkg, dir2);
            });
          });
        });
      }
      __name(loadpkg, "loadpkg");
      function loadAsDirectory(x8, loadAsDirectoryPackage, callback2) {
        var cb3 = callback2;
        var fpkg = loadAsDirectoryPackage;
        if (typeof fpkg === "function") {
          cb3 = fpkg;
          fpkg = opts.package;
        }
        maybeRealpath(realpath2, x8, opts, function(unwrapErr, pkgdir) {
          if (unwrapErr) return cb3(unwrapErr);
          var pkgfile = path84.join(pkgdir, "package.json");
          isFile2(pkgfile, function(err2, ex) {
            if (err2) return cb3(err2);
            if (!ex) return loadAsFile(path84.join(x8, "index"), fpkg, cb3);
            readPackage(readFile19, pkgfile, function(err3, pkgParam) {
              if (err3) return cb3(err3);
              var pkg = pkgParam;
              if (pkg && opts.packageFilter) {
                pkg = opts.packageFilter(pkg, pkgfile);
              }
              if (pkg && pkg.main) {
                if (typeof pkg.main !== "string") {
                  var mainError = new TypeError("package \u201C" + pkg.name + "\u201D `main` must be a string");
                  mainError.code = "INVALID_PACKAGE_MAIN";
                  return cb3(mainError);
                }
                if (pkg.main === "." || pkg.main === "./") {
                  pkg.main = "index";
                }
                loadAsFile(path84.resolve(x8, pkg.main), pkg, function(err4, m7, pkg2) {
                  if (err4) return cb3(err4);
                  if (m7) return cb3(null, m7, pkg2);
                  if (!pkg2) return loadAsFile(path84.join(x8, "index"), pkg2, cb3);
                  var dir2 = path84.resolve(x8, pkg2.main);
                  loadAsDirectory(dir2, pkg2, function(err5, n9, pkg3) {
                    if (err5) return cb3(err5);
                    if (n9) return cb3(null, n9, pkg3);
                    loadAsFile(path84.join(x8, "index"), pkg3, cb3);
                  });
                });
                return;
              }
              loadAsFile(path84.join(x8, "/index"), pkg, cb3);
            });
          });
        });
      }
      __name(loadAsDirectory, "loadAsDirectory");
      function processDirs(cb3, dirs) {
        if (dirs.length === 0) return cb3(null, void 0);
        var dir2 = dirs[0];
        isDirectory3(path84.dirname(dir2), isdir);
        function isdir(err2, isdir2) {
          if (err2) return cb3(err2);
          if (!isdir2) return processDirs(cb3, dirs.slice(1));
          loadAsFile(dir2, opts.package, onfile2);
        }
        __name(isdir, "isdir");
        function onfile2(err2, m7, pkg) {
          if (err2) return cb3(err2);
          if (m7) return cb3(null, m7, pkg);
          loadAsDirectory(dir2, opts.package, ondir);
        }
        __name(onfile2, "onfile");
        function ondir(err2, n9, pkg) {
          if (err2) return cb3(err2);
          if (n9) return cb3(null, n9, pkg);
          processDirs(cb3, dirs.slice(1));
        }
        __name(ondir, "ondir");
      }
      __name(processDirs, "processDirs");
      function loadNodeModules(x8, start, cb3) {
        var thunk = /* @__PURE__ */ __name(function() {
          return getPackageCandidates(x8, start, opts);
        }, "thunk");
        processDirs(
          cb3,
          packageIterator ? packageIterator(x8, start, thunk, opts) : thunk()
        );
      }
      __name(loadNodeModules, "loadNodeModules");
    }, "resolve");
  }
});

// ../../node_modules/.pnpm/resolve@1.22.8/node_modules/resolve/lib/core.json
var require_core2 = __commonJS({
  "../../node_modules/.pnpm/resolve@1.22.8/node_modules/resolve/lib/core.json"(exports, module2) {
    module2.exports = {
      assert: true,
      "node:assert": [">= 14.18 && < 15", ">= 16"],
      "assert/strict": ">= 15",
      "node:assert/strict": ">= 16",
      async_hooks: ">= 8",
      "node:async_hooks": [">= 14.18 && < 15", ">= 16"],
      buffer_ieee754: ">= 0.5 && < 0.9.7",
      buffer: true,
      "node:buffer": [">= 14.18 && < 15", ">= 16"],
      child_process: true,
      "node:child_process": [">= 14.18 && < 15", ">= 16"],
      cluster: ">= 0.5",
      "node:cluster": [">= 14.18 && < 15", ">= 16"],
      console: true,
      "node:console": [">= 14.18 && < 15", ">= 16"],
      constants: true,
      "node:constants": [">= 14.18 && < 15", ">= 16"],
      crypto: true,
      "node:crypto": [">= 14.18 && < 15", ">= 16"],
      _debug_agent: ">= 1 && < 8",
      _debugger: "< 8",
      dgram: true,
      "node:dgram": [">= 14.18 && < 15", ">= 16"],
      diagnostics_channel: [">= 14.17 && < 15", ">= 15.1"],
      "node:diagnostics_channel": [">= 14.18 && < 15", ">= 16"],
      dns: true,
      "node:dns": [">= 14.18 && < 15", ">= 16"],
      "dns/promises": ">= 15",
      "node:dns/promises": ">= 16",
      domain: ">= 0.7.12",
      "node:domain": [">= 14.18 && < 15", ">= 16"],
      events: true,
      "node:events": [">= 14.18 && < 15", ">= 16"],
      freelist: "< 6",
      fs: true,
      "node:fs": [">= 14.18 && < 15", ">= 16"],
      "fs/promises": [">= 10 && < 10.1", ">= 14"],
      "node:fs/promises": [">= 14.18 && < 15", ">= 16"],
      _http_agent: ">= 0.11.1",
      "node:_http_agent": [">= 14.18 && < 15", ">= 16"],
      _http_client: ">= 0.11.1",
      "node:_http_client": [">= 14.18 && < 15", ">= 16"],
      _http_common: ">= 0.11.1",
      "node:_http_common": [">= 14.18 && < 15", ">= 16"],
      _http_incoming: ">= 0.11.1",
      "node:_http_incoming": [">= 14.18 && < 15", ">= 16"],
      _http_outgoing: ">= 0.11.1",
      "node:_http_outgoing": [">= 14.18 && < 15", ">= 16"],
      _http_server: ">= 0.11.1",
      "node:_http_server": [">= 14.18 && < 15", ">= 16"],
      http: true,
      "node:http": [">= 14.18 && < 15", ">= 16"],
      http2: ">= 8.8",
      "node:http2": [">= 14.18 && < 15", ">= 16"],
      https: true,
      "node:https": [">= 14.18 && < 15", ">= 16"],
      inspector: ">= 8",
      "node:inspector": [">= 14.18 && < 15", ">= 16"],
      "inspector/promises": [">= 19"],
      "node:inspector/promises": [">= 19"],
      _linklist: "< 8",
      module: true,
      "node:module": [">= 14.18 && < 15", ">= 16"],
      net: true,
      "node:net": [">= 14.18 && < 15", ">= 16"],
      "node-inspect/lib/_inspect": ">= 7.6 && < 12",
      "node-inspect/lib/internal/inspect_client": ">= 7.6 && < 12",
      "node-inspect/lib/internal/inspect_repl": ">= 7.6 && < 12",
      os: true,
      "node:os": [">= 14.18 && < 15", ">= 16"],
      path: true,
      "node:path": [">= 14.18 && < 15", ">= 16"],
      "path/posix": ">= 15.3",
      "node:path/posix": ">= 16",
      "path/win32": ">= 15.3",
      "node:path/win32": ">= 16",
      perf_hooks: ">= 8.5",
      "node:perf_hooks": [">= 14.18 && < 15", ">= 16"],
      process: ">= 1",
      "node:process": [">= 14.18 && < 15", ">= 16"],
      punycode: ">= 0.5",
      "node:punycode": [">= 14.18 && < 15", ">= 16"],
      querystring: true,
      "node:querystring": [">= 14.18 && < 15", ">= 16"],
      readline: true,
      "node:readline": [">= 14.18 && < 15", ">= 16"],
      "readline/promises": ">= 17",
      "node:readline/promises": ">= 17",
      repl: true,
      "node:repl": [">= 14.18 && < 15", ">= 16"],
      smalloc: ">= 0.11.5 && < 3",
      _stream_duplex: ">= 0.9.4",
      "node:_stream_duplex": [">= 14.18 && < 15", ">= 16"],
      _stream_transform: ">= 0.9.4",
      "node:_stream_transform": [">= 14.18 && < 15", ">= 16"],
      _stream_wrap: ">= 1.4.1",
      "node:_stream_wrap": [">= 14.18 && < 15", ">= 16"],
      _stream_passthrough: ">= 0.9.4",
      "node:_stream_passthrough": [">= 14.18 && < 15", ">= 16"],
      _stream_readable: ">= 0.9.4",
      "node:_stream_readable": [">= 14.18 && < 15", ">= 16"],
      _stream_writable: ">= 0.9.4",
      "node:_stream_writable": [">= 14.18 && < 15", ">= 16"],
      stream: true,
      "node:stream": [">= 14.18 && < 15", ">= 16"],
      "stream/consumers": ">= 16.7",
      "node:stream/consumers": ">= 16.7",
      "stream/promises": ">= 15",
      "node:stream/promises": ">= 16",
      "stream/web": ">= 16.5",
      "node:stream/web": ">= 16.5",
      string_decoder: true,
      "node:string_decoder": [">= 14.18 && < 15", ">= 16"],
      sys: [">= 0.4 && < 0.7", ">= 0.8"],
      "node:sys": [">= 14.18 && < 15", ">= 16"],
      "test/reporters": ">= 19.9 && < 20.2",
      "node:test/reporters": [">= 18.17 && < 19", ">= 19.9", ">= 20"],
      "node:test": [">= 16.17 && < 17", ">= 18"],
      timers: true,
      "node:timers": [">= 14.18 && < 15", ">= 16"],
      "timers/promises": ">= 15",
      "node:timers/promises": ">= 16",
      _tls_common: ">= 0.11.13",
      "node:_tls_common": [">= 14.18 && < 15", ">= 16"],
      _tls_legacy: ">= 0.11.3 && < 10",
      _tls_wrap: ">= 0.11.3",
      "node:_tls_wrap": [">= 14.18 && < 15", ">= 16"],
      tls: true,
      "node:tls": [">= 14.18 && < 15", ">= 16"],
      trace_events: ">= 10",
      "node:trace_events": [">= 14.18 && < 15", ">= 16"],
      tty: true,
      "node:tty": [">= 14.18 && < 15", ">= 16"],
      url: true,
      "node:url": [">= 14.18 && < 15", ">= 16"],
      util: true,
      "node:util": [">= 14.18 && < 15", ">= 16"],
      "util/types": ">= 15.3",
      "node:util/types": ">= 16",
      "v8/tools/arguments": ">= 10 && < 12",
      "v8/tools/codemap": [">= 4.4 && < 5", ">= 5.2 && < 12"],
      "v8/tools/consarray": [">= 4.4 && < 5", ">= 5.2 && < 12"],
      "v8/tools/csvparser": [">= 4.4 && < 5", ">= 5.2 && < 12"],
      "v8/tools/logreader": [">= 4.4 && < 5", ">= 5.2 && < 12"],
      "v8/tools/profile_view": [">= 4.4 && < 5", ">= 5.2 && < 12"],
      "v8/tools/splaytree": [">= 4.4 && < 5", ">= 5.2 && < 12"],
      v8: ">= 1",
      "node:v8": [">= 14.18 && < 15", ">= 16"],
      vm: true,
      "node:vm": [">= 14.18 && < 15", ">= 16"],
      wasi: [">= 13.4 && < 13.5", ">= 18.17 && < 19", ">= 20"],
      "node:wasi": [">= 18.17 && < 19", ">= 20"],
      worker_threads: ">= 11.7",
      "node:worker_threads": [">= 14.18 && < 15", ">= 16"],
      zlib: ">= 0.5",
      "node:zlib": [">= 14.18 && < 15", ">= 16"]
    };
  }
});

// ../../node_modules/.pnpm/resolve@1.22.8/node_modules/resolve/lib/core.js
var require_core3 = __commonJS({
  "../../node_modules/.pnpm/resolve@1.22.8/node_modules/resolve/lib/core.js"(exports, module2) {
    init_import_meta_url();
    var isCoreModule = require_is_core_module();
    var data = require_core2();
    var core = {};
    for (mod in data) {
      if (Object.prototype.hasOwnProperty.call(data, mod)) {
        core[mod] = isCoreModule(mod);
      }
    }
    var mod;
    module2.exports = core;
  }
});

// ../../node_modules/.pnpm/resolve@1.22.8/node_modules/resolve/lib/is-core.js
var require_is_core = __commonJS({
  "../../node_modules/.pnpm/resolve@1.22.8/node_modules/resolve/lib/is-core.js"(exports, module2) {
    init_import_meta_url();
    var isCoreModule = require_is_core_module();
    module2.exports = /* @__PURE__ */ __name(function isCore(x7) {
      return isCoreModule(x7);
    }, "isCore");
  }
});

// ../../node_modules/.pnpm/resolve@1.22.8/node_modules/resolve/lib/sync.js
var require_sync = __commonJS({
  "../../node_modules/.pnpm/resolve@1.22.8/node_modules/resolve/lib/sync.js"(exports, module2) {
    init_import_meta_url();
    var isCore = require_is_core_module();
    var fs33 = __require("fs");
    var path84 = __require("path");
    var getHomedir = require_homedir();
    var caller = require_caller();
    var nodeModulesPaths = require_node_modules_paths();
    var normalizeOptions = require_normalize_options();
    var realpathFS = process.platform !== "win32" && fs33.realpathSync && typeof fs33.realpathSync.native === "function" ? fs33.realpathSync.native : fs33.realpathSync;
    var homedir3 = getHomedir();
    var defaultPaths = /* @__PURE__ */ __name(function() {
      return [
        path84.join(homedir3, ".node_modules"),
        path84.join(homedir3, ".node_libraries")
      ];
    }, "defaultPaths");
    var defaultIsFile = /* @__PURE__ */ __name(function isFile2(file3) {
      try {
        var stat9 = fs33.statSync(file3, { throwIfNoEntry: false });
      } catch (e10) {
        if (e10 && (e10.code === "ENOENT" || e10.code === "ENOTDIR")) return false;
        throw e10;
      }
      return !!stat9 && (stat9.isFile() || stat9.isFIFO());
    }, "isFile");
    var defaultIsDir = /* @__PURE__ */ __name(function isDirectory3(dir2) {
      try {
        var stat9 = fs33.statSync(dir2, { throwIfNoEntry: false });
      } catch (e10) {
        if (e10 && (e10.code === "ENOENT" || e10.code === "ENOTDIR")) return false;
        throw e10;
      }
      return !!stat9 && stat9.isDirectory();
    }, "isDirectory");
    var defaultRealpathSync = /* @__PURE__ */ __name(function realpathSync4(x7) {
      try {
        return realpathFS(x7);
      } catch (realpathErr) {
        if (realpathErr.code !== "ENOENT") {
          throw realpathErr;
        }
      }
      return x7;
    }, "realpathSync");
    var maybeRealpathSync = /* @__PURE__ */ __name(function maybeRealpathSync2(realpathSync4, x7, opts) {
      if (opts && opts.preserveSymlinks === false) {
        return realpathSync4(x7);
      }
      return x7;
    }, "maybeRealpathSync");
    var defaultReadPackageSync = /* @__PURE__ */ __name(function defaultReadPackageSync2(readFileSync37, pkgfile) {
      var body = readFileSync37(pkgfile);
      try {
        var pkg = JSON.parse(body);
        return pkg;
      } catch (jsonErr) {
      }
    }, "defaultReadPackageSync");
    var getPackageCandidates = /* @__PURE__ */ __name(function getPackageCandidates2(x7, start, opts) {
      var dirs = nodeModulesPaths(start, opts, x7);
      for (var i7 = 0; i7 < dirs.length; i7++) {
        dirs[i7] = path84.join(dirs[i7], x7);
      }
      return dirs;
    }, "getPackageCandidates");
    module2.exports = /* @__PURE__ */ __name(function resolveSync2(x7, options) {
      if (typeof x7 !== "string") {
        throw new TypeError("Path must be a string.");
      }
      var opts = normalizeOptions(x7, options);
      var isFile2 = opts.isFile || defaultIsFile;
      var readFileSync37 = opts.readFileSync || fs33.readFileSync;
      var isDirectory3 = opts.isDirectory || defaultIsDir;
      var realpathSync4 = opts.realpathSync || defaultRealpathSync;
      var readPackageSync = opts.readPackageSync || defaultReadPackageSync;
      if (opts.readFileSync && opts.readPackageSync) {
        throw new TypeError("`readFileSync` and `readPackageSync` are mutually exclusive.");
      }
      var packageIterator = opts.packageIterator;
      var extensions = opts.extensions || [".js"];
      var includeCoreModules = opts.includeCoreModules !== false;
      var basedir = opts.basedir || path84.dirname(caller());
      var parent = opts.filename || basedir;
      opts.paths = opts.paths || defaultPaths();
      var absoluteStart = maybeRealpathSync(realpathSync4, path84.resolve(basedir), opts);
      if (/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(x7)) {
        var res = path84.resolve(absoluteStart, x7);
        if (x7 === "." || x7 === ".." || x7.slice(-1) === "/") res += "/";
        var m7 = loadAsFileSync(res) || loadAsDirectorySync(res);
        if (m7) return maybeRealpathSync(realpathSync4, m7, opts);
      } else if (includeCoreModules && isCore(x7)) {
        return x7;
      } else {
        var n9 = loadNodeModulesSync(x7, absoluteStart);
        if (n9) return maybeRealpathSync(realpathSync4, n9, opts);
      }
      var err = new Error("Cannot find module '" + x7 + "' from '" + parent + "'");
      err.code = "MODULE_NOT_FOUND";
      throw err;
      function loadAsFileSync(x8) {
        var pkg = loadpkg(path84.dirname(x8));
        if (pkg && pkg.dir && pkg.pkg && opts.pathFilter) {
          var rfile = path84.relative(pkg.dir, x8);
          var r10 = opts.pathFilter(pkg.pkg, x8, rfile);
          if (r10) {
            x8 = path84.resolve(pkg.dir, r10);
          }
        }
        if (isFile2(x8)) {
          return x8;
        }
        for (var i7 = 0; i7 < extensions.length; i7++) {
          var file3 = x8 + extensions[i7];
          if (isFile2(file3)) {
            return file3;
          }
        }
      }
      function loadpkg(dir2) {
        if (dir2 === "" || dir2 === "/") return;
        if (process.platform === "win32" && /^\w:[/\\]*$/.test(dir2)) {
          return;
        }
        if (/[/\\]node_modules[/\\]*$/.test(dir2)) return;
        var pkgfile = path84.join(maybeRealpathSync(realpathSync4, dir2, opts), "package.json");
        if (!isFile2(pkgfile)) {
          return loadpkg(path84.dirname(dir2));
        }
        var pkg = readPackageSync(readFileSync37, pkgfile);
        if (pkg && opts.packageFilter) {
          pkg = opts.packageFilter(
            pkg,
            /*pkgfile,*/
            dir2
          );
        }
        return { pkg, dir: dir2 };
      }
      function loadAsDirectorySync(x8) {
        var pkgfile = path84.join(maybeRealpathSync(realpathSync4, x8, opts), "/package.json");
        if (isFile2(pkgfile)) {
          try {
            var pkg = readPackageSync(readFileSync37, pkgfile);
          } catch (e10) {
          }
          if (pkg && opts.packageFilter) {
            pkg = opts.packageFilter(
              pkg,
              /*pkgfile,*/
              x8
            );
          }
          if (pkg && pkg.main) {
            if (typeof pkg.main !== "string") {
              var mainError = new TypeError("package \u201C" + pkg.name + "\u201D `main` must be a string");
              mainError.code = "INVALID_PACKAGE_MAIN";
              throw mainError;
            }
            if (pkg.main === "." || pkg.main === "./") {
              pkg.main = "index";
            }
            try {
              var m8 = loadAsFileSync(path84.resolve(x8, pkg.main));
              if (m8) return m8;
              var n10 = loadAsDirectorySync(path84.resolve(x8, pkg.main));
              if (n10) return n10;
            } catch (e10) {
            }
          }
        }
        return loadAsFileSync(path84.join(x8, "/index"));
      }
      function loadNodeModulesSync(x8, start) {
        var thunk = /* @__PURE__ */ __name(function() {
          return getPackageCandidates(x8, start, opts);
        }, "thunk");
        var dirs = packageIterator ? packageIterator(x8, start, thunk, opts) : thunk();
        for (var i7 = 0; i7 < dirs.length; i7++) {
          var dir2 = dirs[i7];
          if (isDirectory3(path84.dirname(dir2))) {
            var m8 = loadAsFileSync(dir2);
            if (m8) return m8;
            var n10 = loadAsDirectorySync(dir2);
            if (n10) return n10;
          }
        }
      }
    }, "resolveSync");
  }
});

// ../../node_modules/.pnpm/resolve@1.22.8/node_modules/resolve/index.js
var require_resolve = __commonJS({
  "../../node_modules/.pnpm/resolve@1.22.8/node_modules/resolve/index.js"(exports, module2) {
    init_import_meta_url();
    var async = require_async();
    async.core = require_core3();
    async.isCore = require_is_core();
    async.sync = require_sync();
    module2.exports = async;
  }
});

// ../../node_modules/.pnpm/cli-table3@0.6.3/node_modules/cli-table3/src/debug.js
var require_debug = __commonJS({
  "../../node_modules/.pnpm/cli-table3@0.6.3/node_modules/cli-table3/src/debug.js"(exports, module2) {
    init_import_meta_url();
    var messages = [];
    var level = 0;
    var debug2 = /* @__PURE__ */ __name((msg, min) => {
      if (level >= min) {
        messages.push(msg);
      }
    }, "debug");
    debug2.WARN = 1;
    debug2.INFO = 2;
    debug2.DEBUG = 3;
    debug2.reset = () => {
      messages = [];
    };
    debug2.setDebugLevel = (v8) => {
      level = v8;
    };
    debug2.warn = (msg) => debug2(msg, debug2.WARN);
    debug2.info = (msg) => debug2(msg, debug2.INFO);
    debug2.debug = (msg) => debug2(msg, debug2.DEBUG);
    debug2.debugMessages = () => messages;
    module2.exports = debug2;
  }
});

// ../../node_modules/.pnpm/ansi-regex@5.0.1/node_modules/ansi-regex/index.js
var require_ansi_regex = __commonJS({
  "../../node_modules/.pnpm/ansi-regex@5.0.1/node_modules/ansi-regex/index.js"(exports, module2) {
    init_import_meta_url();
    module2.exports = ({ onlyFirst = false } = {}) => {
      const pattern = [
        "[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)",
        "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"
      ].join("|");
      return new RegExp(pattern, onlyFirst ? void 0 : "g");
    };
  }
});

// ../../node_modules/.pnpm/strip-ansi@6.0.1/node_modules/strip-ansi/index.js
var require_strip_ansi = __commonJS({
  "../../node_modules/.pnpm/strip-ansi@6.0.1/node_modules/strip-ansi/index.js"(exports, module2) {
    init_import_meta_url();
    var ansiRegex2 = require_ansi_regex();
    module2.exports = (string) => typeof string === "string" ? string.replace(ansiRegex2(), "") : string;
  }
});

// ../../node_modules/.pnpm/is-fullwidth-code-point@3.0.0/node_modules/is-fullwidth-code-point/index.js
var require_is_fullwidth_code_point = __commonJS({
  "../../node_modules/.pnpm/is-fullwidth-code-point@3.0.0/node_modules/is-fullwidth-code-point/index.js"(exports, module2) {
    init_import_meta_url();
    var isFullwidthCodePoint2 = /* @__PURE__ */ __name((codePoint) => {
      if (Number.isNaN(codePoint)) {
        return false;
      }
      if (codePoint >= 4352 && (codePoint <= 4447 || // Hangul Jamo
      codePoint === 9001 || // LEFT-POINTING ANGLE BRACKET
      codePoint === 9002 || // RIGHT-POINTING ANGLE BRACKET
      // CJK Radicals Supplement .. Enclosed CJK Letters and Months
      11904 <= codePoint && codePoint <= 12871 && codePoint !== 12351 || // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A
      12880 <= codePoint && codePoint <= 19903 || // CJK Unified Ideographs .. Yi Radicals
      19968 <= codePoint && codePoint <= 42182 || // Hangul Jamo Extended-A
      43360 <= codePoint && codePoint <= 43388 || // Hangul Syllables
      44032 <= codePoint && codePoint <= 55203 || // CJK Compatibility Ideographs
      63744 <= codePoint && codePoint <= 64255 || // Vertical Forms
      65040 <= codePoint && codePoint <= 65049 || // CJK Compatibility Forms .. Small Form Variants
      65072 <= codePoint && codePoint <= 65131 || // Halfwidth and Fullwidth Forms
      65281 <= codePoint && codePoint <= 65376 || 65504 <= codePoint && codePoint <= 65510 || // Kana Supplement
      110592 <= codePoint && codePoint <= 110593 || // Enclosed Ideographic Supplement
      127488 <= codePoint && codePoint <= 127569 || // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane
      131072 <= codePoint && codePoint <= 262141)) {
        return true;
      }
      return false;
    }, "isFullwidthCodePoint");
    module2.exports = isFullwidthCodePoint2;
    module2.exports.default = isFullwidthCodePoint2;
  }
});

// ../../node_modules/.pnpm/emoji-regex@8.0.0/node_modules/emoji-regex/index.js
var require_emoji_regex = __commonJS({
  "../../node_modules/.pnpm/emoji-regex@8.0.0/node_modules/emoji-regex/index.js"(exports, module2) {
    init_import_meta_url();
    module2.exports = function() {
      return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g;
    };
  }
});

// ../../node_modules/.pnpm/string-width@4.2.3/node_modules/string-width/index.js
var require_string_width = __commonJS({
  "../../node_modules/.pnpm/string-width@4.2.3/node_modules/string-width/index.js"(exports, module2) {
    init_import_meta_url();
    var stripAnsi5 = require_strip_ansi();
    var isFullwidthCodePoint2 = require_is_fullwidth_code_point();
    var emojiRegex5 = require_emoji_regex();
    var stringWidth2 = /* @__PURE__ */ __name((string) => {
      if (typeof string !== "string" || string.length === 0) {
        return 0;
      }
      string = stripAnsi5(string);
      if (string.length === 0) {
        return 0;
      }
      string = string.replace(emojiRegex5(), "  ");
      let width = 0;
      for (let i7 = 0; i7 < string.length; i7++) {
        const code = string.codePointAt(i7);
        if (code <= 31 || code >= 127 && code <= 159) {
          continue;
        }
        if (code >= 768 && code <= 879) {
          continue;
        }
        if (code > 65535) {
          i7++;
        }
        width += isFullwidthCodePoint2(code) ? 2 : 1;
      }
      return width;
    }, "stringWidth");
    module2.exports = stringWidth2;
    module2.exports.default = stringWidth2;
  }
});

// ../../node_modules/.pnpm/cli-table3@0.6.3/node_modules/cli-table3/src/utils.js
var require_utils2 = __commonJS({
  "../../node_modules/.pnpm/cli-table3@0.6.3/node_modules/cli-table3/src/utils.js"(exports, module2) {
    init_import_meta_url();
    var stringWidth2 = require_string_width();
    function codeRegex(capture) {
      return capture ? /\u001b\[((?:\d*;){0,5}\d*)m/g : /\u001b\[(?:\d*;){0,5}\d*m/g;
    }
    __name(codeRegex, "codeRegex");
    function strlen(str) {
      let code = codeRegex();
      let stripped = ("" + str).replace(code, "");
      let split = stripped.split("\n");
      return split.reduce(function(memo, s7) {
        return stringWidth2(s7) > memo ? stringWidth2(s7) : memo;
      }, 0);
    }
    __name(strlen, "strlen");
    function repeat2(str, times) {
      return Array(times + 1).join(str);
    }
    __name(repeat2, "repeat");
    function pad2(str, len, pad3, dir2) {
      let length = strlen(str);
      if (len + 1 >= length) {
        let padlen = len - length;
        switch (dir2) {
          case "right": {
            str = repeat2(pad3, padlen) + str;
            break;
          }
          case "center": {
            let right2 = Math.ceil(padlen / 2);
            let left2 = padlen - right2;
            str = repeat2(pad3, left2) + str + repeat2(pad3, right2);
            break;
          }
          default: {
            str = str + repeat2(pad3, padlen);
            break;
          }
        }
      }
      return str;
    }
    __name(pad2, "pad");
    var codeCache = {};
    function addToCodeCache(name2, on, off) {
      on = "\x1B[" + on + "m";
      off = "\x1B[" + off + "m";
      codeCache[on] = { set: name2, to: true };
      codeCache[off] = { set: name2, to: false };
      codeCache[name2] = { on, off };
    }
    __name(addToCodeCache, "addToCodeCache");
    addToCodeCache("bold", 1, 22);
    addToCodeCache("italics", 3, 23);
    addToCodeCache("underline", 4, 24);
    addToCodeCache("inverse", 7, 27);
    addToCodeCache("strikethrough", 9, 29);
    function updateState(state2, controlChars) {
      let controlCode = controlChars[1] ? parseInt(controlChars[1].split(";")[0]) : 0;
      if (controlCode >= 30 && controlCode <= 39 || controlCode >= 90 && controlCode <= 97) {
        state2.lastForegroundAdded = controlChars[0];
        return;
      }
      if (controlCode >= 40 && controlCode <= 49 || controlCode >= 100 && controlCode <= 107) {
        state2.lastBackgroundAdded = controlChars[0];
        return;
      }
      if (controlCode === 0) {
        for (let i7 in state2) {
          if (Object.prototype.hasOwnProperty.call(state2, i7)) {
            delete state2[i7];
          }
        }
        return;
      }
      let info = codeCache[controlChars[0]];
      if (info) {
        state2[info.set] = info.to;
      }
    }
    __name(updateState, "updateState");
    function readState(line) {
      let code = codeRegex(true);
      let controlChars = code.exec(line);
      let state2 = {};
      while (controlChars !== null) {
        updateState(state2, controlChars);
        controlChars = code.exec(line);
      }
      return state2;
    }
    __name(readState, "readState");
    function unwindState(state2, ret) {
      let lastBackgroundAdded = state2.lastBackgroundAdded;
      let lastForegroundAdded = state2.lastForegroundAdded;
      delete state2.lastBackgroundAdded;
      delete state2.lastForegroundAdded;
      Object.keys(state2).forEach(function(key) {
        if (state2[key]) {
          ret += codeCache[key].off;
        }
      });
      if (lastBackgroundAdded && lastBackgroundAdded != "\x1B[49m") {
        ret += "\x1B[49m";
      }
      if (lastForegroundAdded && lastForegroundAdded != "\x1B[39m") {
        ret += "\x1B[39m";
      }
      return ret;
    }
    __name(unwindState, "unwindState");
    function rewindState(state2, ret) {
      let lastBackgroundAdded = state2.lastBackgroundAdded;
      let lastForegroundAdded = state2.lastForegroundAdded;
      delete state2.lastBackgroundAdded;
      delete state2.lastForegroundAdded;
      Object.keys(state2).forEach(function(key) {
        if (state2[key]) {
          ret = codeCache[key].on + ret;
        }
      });
      if (lastBackgroundAdded && lastBackgroundAdded != "\x1B[49m") {
        ret = lastBackgroundAdded + ret;
      }
      if (lastForegroundAdded && lastForegroundAdded != "\x1B[39m") {
        ret = lastForegroundAdded + ret;
      }
      return ret;
    }
    __name(rewindState, "rewindState");
    function truncateWidth(str, desiredLength) {
      if (str.length === strlen(str)) {
        return str.substr(0, desiredLength);
      }
      while (strlen(str) > desiredLength) {
        str = str.slice(0, -1);
      }
      return str;
    }
    __name(truncateWidth, "truncateWidth");
    function truncateWidthWithAnsi(str, desiredLength) {
      let code = codeRegex(true);
      let split = str.split(codeRegex());
      let splitIndex = 0;
      let retLen = 0;
      let ret = "";
      let myArray;
      let state2 = {};
      while (retLen < desiredLength) {
        myArray = code.exec(str);
        let toAdd = split[splitIndex];
        splitIndex++;
        if (retLen + strlen(toAdd) > desiredLength) {
          toAdd = truncateWidth(toAdd, desiredLength - retLen);
        }
        ret += toAdd;
        retLen += strlen(toAdd);
        if (retLen < desiredLength) {
          if (!myArray) {
            break;
          }
          ret += myArray[0];
          updateState(state2, myArray);
        }
      }
      return unwindState(state2, ret);
    }
    __name(truncateWidthWithAnsi, "truncateWidthWithAnsi");
    function truncate4(str, desiredLength, truncateChar) {
      truncateChar = truncateChar || "\u2026";
      let lengthOfStr = strlen(str);
      if (lengthOfStr <= desiredLength) {
        return str;
      }
      desiredLength -= strlen(truncateChar);
      let ret = truncateWidthWithAnsi(str, desiredLength);
      return ret + truncateChar;
    }
    __name(truncate4, "truncate");
    function defaultOptions4() {
      return {
        chars: {
          top: "\u2500",
          "top-mid": "\u252C",
          "top-left": "\u250C",
          "top-right": "\u2510",
          bottom: "\u2500",
          "bottom-mid": "\u2534",
          "bottom-left": "\u2514",
          "bottom-right": "\u2518",
          left: "\u2502",
          "left-mid": "\u251C",
          mid: "\u2500",
          "mid-mid": "\u253C",
          right: "\u2502",
          "right-mid": "\u2524",
          middle: "\u2502"
        },
        truncate: "\u2026",
        colWidths: [],
        rowHeights: [],
        colAligns: [],
        rowAligns: [],
        style: {
          "padding-left": 1,
          "padding-right": 1,
          head: ["red"],
          border: ["grey"],
          compact: false
        },
        head: []
      };
    }
    __name(defaultOptions4, "defaultOptions");
    function mergeOptions(options, defaults3) {
      options = options || {};
      defaults3 = defaults3 || defaultOptions4();
      let ret = Object.assign({}, defaults3, options);
      ret.chars = Object.assign({}, defaults3.chars, options.chars);
      ret.style = Object.assign({}, defaults3.style, options.style);
      return ret;
    }
    __name(mergeOptions, "mergeOptions");
    function wordWrap(maxLength, input) {
      let lines = [];
      let split = input.split(/(\s+)/g);
      let line = [];
      let lineLength = 0;
      let whitespace;
      for (let i7 = 0; i7 < split.length; i7 += 2) {
        let word = split[i7];
        let newLength = lineLength + strlen(word);
        if (lineLength > 0 && whitespace) {
          newLength += whitespace.length;
        }
        if (newLength > maxLength) {
          if (lineLength !== 0) {
            lines.push(line.join(""));
          }
          line = [word];
          lineLength = strlen(word);
        } else {
          line.push(whitespace || "", word);
          lineLength = newLength;
        }
        whitespace = split[i7 + 1];
      }
      if (lineLength) {
        lines.push(line.join(""));
      }
      return lines;
    }
    __name(wordWrap, "wordWrap");
    function textWrap(maxLength, input) {
      let lines = [];
      let line = "";
      function pushLine(str, ws) {
        if (line.length && ws) line += ws;
        line += str;
        while (line.length > maxLength) {
          lines.push(line.slice(0, maxLength));
          line = line.slice(maxLength);
        }
      }
      __name(pushLine, "pushLine");
      let split = input.split(/(\s+)/g);
      for (let i7 = 0; i7 < split.length; i7 += 2) {
        pushLine(split[i7], i7 && split[i7 - 1]);
      }
      if (line.length) lines.push(line);
      return lines;
    }
    __name(textWrap, "textWrap");
    function multiLineWordWrap(maxLength, input, wrapOnWordBoundary = true) {
      let output = [];
      input = input.split("\n");
      const handler = wrapOnWordBoundary ? wordWrap : textWrap;
      for (let i7 = 0; i7 < input.length; i7++) {
        output.push.apply(output, handler(maxLength, input[i7]));
      }
      return output;
    }
    __name(multiLineWordWrap, "multiLineWordWrap");
    function colorizeLines(input) {
      let state2 = {};
      let output = [];
      for (let i7 = 0; i7 < input.length; i7++) {
        let line = rewindState(state2, input[i7]);
        state2 = readState(line);
        let temp = Object.assign({}, state2);
        output.push(unwindState(temp, line));
      }
      return output;
    }
    __name(colorizeLines, "colorizeLines");
    function hyperlink(url4, text) {
      const OSC2 = "\x1B]";
      const BEL2 = "\x07";
      const SEP2 = ";";
      return [OSC2, "8", SEP2, SEP2, url4 || text, BEL2, text, OSC2, "8", SEP2, SEP2, BEL2].join("");
    }
    __name(hyperlink, "hyperlink");
    module2.exports = {
      strlen,
      repeat: repeat2,
      pad: pad2,
      truncate: truncate4,
      mergeOptions,
      wordWrap: multiLineWordWrap,
      colorizeLines,
      hyperlink
    };
  }
});

// ../../node_modules/.pnpm/@colors+colors@1.5.0/node_modules/@colors/colors/lib/styles.js
var require_styles = __commonJS({
  "../../node_modules/.pnpm/@colors+colors@1.5.0/node_modules/@colors/colors/lib/styles.js"(exports, module2) {
    init_import_meta_url();
    var styles4 = {};
    module2["exports"] = styles4;
    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 val2 = codes[key];
      var style = styles4[key] = [];
      style.open = "\x1B[" + val2[0] + "m";
      style.close = "\x1B[" + val2[1] + "m";
    });
  }
});

// ../../node_modules/.pnpm/@colors+colors@1.5.0/node_modules/@colors/colors/lib/system/has-flag.js
var require_has_flag = __commonJS({
  "../../node_modules/.pnpm/@colors+colors@1.5.0/node_modules/@colors/colors/lib/system/has-flag.js"(exports, module2) {
    init_import_meta_url();
    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);
    };
  }
});

// ../../node_modules/.pnpm/@colors+colors@1.5.0/node_modules/@colors/colors/lib/system/supports-colors.js
var require_supports_colors = __commonJS({
  "../../node_modules/.pnpm/@colors+colors@1.5.0/node_modules/@colors/colors/lib/system/supports-colors.js"(exports, module2) {
    init_import_meta_url();
    var os13 = __require("os");
    var hasFlag3 = require_has_flag();
    var env6 = process.env;
    var forceColor = void 0;
    if (hasFlag3("no-color") || hasFlag3("no-colors") || hasFlag3("color=false")) {
      forceColor = false;
    } else if (hasFlag3("color") || hasFlag3("colors") || hasFlag3("color=true") || hasFlag3("color=always")) {
      forceColor = true;
    }
    if ("FORCE_COLOR" in env6) {
      forceColor = env6.FORCE_COLOR.length === 0 || parseInt(env6.FORCE_COLOR, 10) !== 0;
    }
    function translateLevel3(level) {
      if (level === 0) {
        return false;
      }
      return {
        level,
        hasBasic: true,
        has256: level >= 2,
        has16m: level >= 3
      };
    }
    __name(translateLevel3, "translateLevel");
    function supportsColor3(stream2) {
      if (forceColor === false) {
        return 0;
      }
      if (hasFlag3("color=16m") || hasFlag3("color=full") || hasFlag3("color=truecolor")) {
        return 3;
      }
      if (hasFlag3("color=256")) {
        return 2;
      }
      if (stream2 && !stream2.isTTY && forceColor !== true) {
        return 0;
      }
      var min = forceColor ? 1 : 0;
      if (process.platform === "win32") {
        var osRelease = os13.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 env6) {
        if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI"].some(function(sign) {
          return sign in env6;
        }) || env6.CI_NAME === "codeship") {
          return 1;
        }
        return min;
      }
      if ("TEAMCITY_VERSION" in env6) {
        return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env6.TEAMCITY_VERSION) ? 1 : 0;
      }
      if ("TERM_PROGRAM" in env6) {
        var version5 = parseInt((env6.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
        switch (env6.TERM_PROGRAM) {
          case "iTerm.app":
            return version5 >= 3 ? 3 : 2;
          case "Hyper":
            return 3;
          case "Apple_Terminal":
            return 2;
        }
      }
      if (/-256(color)?$/i.test(env6.TERM)) {
        return 2;
      }
      if (/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(env6.TERM)) {
        return 1;
      }
      if ("COLORTERM" in env6) {
        return 1;
      }
      if (env6.TERM === "dumb") {
        return min;
      }
      return min;
    }
    __name(supportsColor3, "supportsColor");
    function getSupportLevel(stream2) {
      var level = supportsColor3(stream2);
      return translateLevel3(level);
    }
    __name(getSupportLevel, "getSupportLevel");
    module2.exports = {
      supportsColor: getSupportLevel,
      stdout: getSupportLevel(process.stdout),
      stderr: getSupportLevel(process.stderr)
    };
  }
});

// ../../node_modules/.pnpm/@colors+colors@1.5.0/node_modules/@colors/colors/lib/custom/trap.js
var require_trap = __commonJS({
  "../../node_modules/.pnpm/@colors+colors@1.5.0/node_modules/@colors/colors/lib/custom/trap.js"(exports, module2) {
    init_import_meta_url();
    module2["exports"] = /* @__PURE__ */ __name(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(c8) {
        c8 = c8.toLowerCase();
        var chars = trap[c8] || [" "];
        var rand = Math.floor(Math.random() * chars.length);
        if (typeof trap[c8] !== "undefined") {
          result += trap[c8][rand];
        } else {
          result += c8;
        }
      });
      return result;
    }, "runTheTrap");
  }
});

// ../../node_modules/.pnpm/@colors+colors@1.5.0/node_modules/@colors/colors/lib/custom/zalgo.js
var require_zalgo = __commonJS({
  "../../node_modules/.pnpm/@colors+colors@1.5.0/node_modules/@colors/colors/lib/custom/zalgo.js"(exports, module2) {
    init_import_meta_url();
    module2["exports"] = /* @__PURE__ */ __name(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 all3 = [].concat(soul.up, soul.down, soul.mid);
      function randomNumber(range) {
        var r10 = Math.floor(Math.random() * range);
        return r10;
      }
      __name(randomNumber, "randomNumber");
      function isChar(character) {
        var bool = false;
        all3.filter(function(i7) {
          bool = i7 === character;
        });
        return bool;
      }
      __name(isChar, "isChar");
      function heComes(text2, options2) {
        var result = "";
        var counts;
        var l8;
        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 (l8 in text2) {
          if (isChar(l8)) {
            continue;
          }
          result = result + text2[l8];
          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 d8 in arr) {
            var index = arr[d8];
            for (var i7 = 0; i7 <= counts[index]; i7++) {
              if (options2[index]) {
                result = result + soul[index][randomNumber(soul[index].length)];
              }
            }
          }
        }
        return result;
      }
      __name(heComes, "heComes");
      return heComes(text, options);
    }, "zalgo");
  }
});

// ../../node_modules/.pnpm/@colors+colors@1.5.0/node_modules/@colors/colors/lib/maps/america.js
var require_america = __commonJS({
  "../../node_modules/.pnpm/@colors+colors@1.5.0/node_modules/@colors/colors/lib/maps/america.js"(exports, module2) {
    init_import_meta_url();
    module2["exports"] = function(colors) {
      return function(letter, i7, exploded) {
        if (letter === " ") return letter;
        switch (i7 % 3) {
          case 0:
            return colors.red(letter);
          case 1:
            return colors.white(letter);
          case 2:
            return colors.blue(letter);
        }
      };
    };
  }
});

// ../../node_modules/.pnpm/@colors+colors@1.5.0/node_modules/@colors/colors/lib/maps/zebra.js
var require_zebra = __commonJS({
  "../../node_modules/.pnpm/@colors+colors@1.5.0/node_modules/@colors/colors/lib/maps/zebra.js"(exports, module2) {
    init_import_meta_url();
    module2["exports"] = function(colors) {
      return function(letter, i7, exploded) {
        return i7 % 2 === 0 ? letter : colors.inverse(letter);
      };
    };
  }
});

// ../../node_modules/.pnpm/@colors+colors@1.5.0/node_modules/@colors/colors/lib/maps/rainbow.js
var require_rainbow = __commonJS({
  "../../node_modules/.pnpm/@colors+colors@1.5.0/node_modules/@colors/colors/lib/maps/rainbow.js"(exports, module2) {
    init_import_meta_url();
    module2["exports"] = function(colors) {
      var rainbowColors = ["red", "yellow", "green", "blue", "magenta"];
      return function(letter, i7, exploded) {
        if (letter === " ") {
          return letter;
        } else {
          return colors[rainbowColors[i7++ % rainbowColors.length]](letter);
        }
      };
    };
  }
});

// ../../node_modules/.pnpm/@colors+colors@1.5.0/node_modules/@colors/colors/lib/maps/random.js
var require_random = __commonJS({
  "../../node_modules/.pnpm/@colors+colors@1.5.0/node_modules/@colors/colors/lib/maps/random.js"(exports, module2) {
    init_import_meta_url();
    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, i7, exploded) {
        return letter === " " ? letter : colors[available[Math.round(Math.random() * (available.length - 2))]](letter);
      };
    };
  }
});

// ../../node_modules/.pnpm/@colors+colors@1.5.0/node_modules/@colors/colors/lib/colors.js
var require_colors = __commonJS({
  "../../node_modules/.pnpm/@colors+colors@1.5.0/node_modules/@colors/colors/lib/colors.js"(exports, module2) {
    init_import_meta_url();
    var colors = {};
    module2["exports"] = colors;
    colors.themes = {};
    var util5 = __require("util");
    var ansiStyles3 = 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 = /* @__PURE__ */ __name(function stylize2(str, style) {
      if (!colors.enabled) {
        return str + "";
      }
      var styleMap = ansiStyles3[style];
      if (!styleMap && style in colors) {
        return colors[style](str);
      }
      return styleMap.open + str + styleMap.close;
    }, "stylize");
    var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g;
    var escapeStringRegexp = /* @__PURE__ */ __name(function(str) {
      if (typeof str !== "string") {
        throw new TypeError("Expected a string");
      }
      return str.replace(matchOperatorsRe, "\\$&");
    }, "escapeStringRegexp");
    function build5(_styles) {
      var builder = /* @__PURE__ */ __name(function builder2() {
        return applyStyle2.apply(builder2, arguments);
      }, "builder");
      builder._styles = _styles;
      builder.__proto__ = proto2;
      return builder;
    }
    __name(build5, "build");
    var styles4 = function() {
      var ret = {};
      ansiStyles3.grey = ansiStyles3.gray;
      Object.keys(ansiStyles3).forEach(function(key) {
        ansiStyles3[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles3[key].close), "g");
        ret[key] = {
          get: /* @__PURE__ */ __name(function() {
            return build5(this._styles.concat(key));
          }, "get")
        };
      });
      return ret;
    }();
    var proto2 = defineProps(/* @__PURE__ */ __name(function colors2() {
    }, "colors"), styles4);
    function applyStyle2() {
      var args = Array.prototype.slice.call(arguments);
      var str = args.map(function(arg) {
        if (arg != null && arg.constructor === String) {
          return arg;
        } else {
          return util5.inspect(arg);
        }
      }).join(" ");
      if (!colors.enabled || !str) {
        return str;
      }
      var newLinesPresent = str.indexOf("\n") != -1;
      var nestedStyles = this._styles;
      var i7 = nestedStyles.length;
      while (i7--) {
        var code = ansiStyles3[nestedStyles[i7]];
        str = code.open + str.replace(code.closeRe, code.open) + code.close;
        if (newLinesPresent) {
          str = str.replace(newLineRegex, function(match3) {
            return code.close + match3 + code.open;
          });
        }
      }
      return str;
    }
    __name(applyStyle2, "applyStyle");
    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 i7 in theme[style2]) {
                out = colors[theme[style2][i7]](out);
              }
              return out;
            }
            return colors[theme[style2]](str);
          };
        })(style);
      }
    };
    function init4() {
      var ret = {};
      Object.keys(styles4).forEach(function(name2) {
        ret[name2] = {
          get: /* @__PURE__ */ __name(function() {
            return build5([name2]);
          }, "get")
        };
      });
      return ret;
    }
    __name(init4, "init");
    var sequencer = /* @__PURE__ */ __name(function sequencer2(map3, str) {
      var exploded = str.split("");
      exploded = exploded.map(map3);
      return exploded.join("");
    }, "sequencer");
    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 (map2 in colors.maps) {
      (function(map3) {
        colors[map3] = function(str) {
          return sequencer(colors.maps[map3], str);
        };
      })(map2);
    }
    var map2;
    defineProps(colors, init4());
  }
});

// ../../node_modules/.pnpm/@colors+colors@1.5.0/node_modules/@colors/colors/safe.js
var require_safe = __commonJS({
  "../../node_modules/.pnpm/@colors+colors@1.5.0/node_modules/@colors/colors/safe.js"(exports, module2) {
    init_import_meta_url();
    var colors = require_colors();
    module2["exports"] = colors;
  }
});

// ../../node_modules/.pnpm/cli-table3@0.6.3/node_modules/cli-table3/src/cell.js
var require_cell = __commonJS({
  "../../node_modules/.pnpm/cli-table3@0.6.3/node_modules/cli-table3/src/cell.js"(exports, module2) {
    init_import_meta_url();
    var { info, debug: debug2 } = require_debug();
    var utils = require_utils2();
    var Cell = class _Cell {
      static {
        __name(this, "Cell");
      }
      /**
       * A representation of a cell within the table.
       * Implementations must have `init` and `draw` methods,
       * as well as `colSpan`, `rowSpan`, `desiredHeight` and `desiredWidth` properties.
       * @param options
       * @constructor
       */
      constructor(options) {
        this.setOptions(options);
        this.x = null;
        this.y = null;
      }
      setOptions(options) {
        if (["boolean", "number", "string"].indexOf(typeof options) !== -1) {
          options = { content: "" + options };
        }
        options = options || {};
        this.options = options;
        let content = options.content;
        if (["boolean", "number", "string"].indexOf(typeof content) !== -1) {
          this.content = String(content);
        } else if (!content) {
          this.content = this.options.href || "";
        } else {
          throw new Error("Content needs to be a primitive, got: " + typeof content);
        }
        this.colSpan = options.colSpan || 1;
        this.rowSpan = options.rowSpan || 1;
        if (this.options.href) {
          Object.defineProperty(this, "href", {
            get() {
              return this.options.href;
            }
          });
        }
      }
      mergeTableOptions(tableOptions, cells) {
        this.cells = cells;
        let optionsChars = this.options.chars || {};
        let tableChars = tableOptions.chars;
        let chars = this.chars = {};
        CHAR_NAMES.forEach(function(name2) {
          setOption(optionsChars, tableChars, name2, chars);
        });
        this.truncate = this.options.truncate || tableOptions.truncate;
        let style = this.options.style = this.options.style || {};
        let tableStyle = tableOptions.style;
        setOption(style, tableStyle, "padding-left", this);
        setOption(style, tableStyle, "padding-right", this);
        this.head = style.head || tableStyle.head;
        this.border = style.border || tableStyle.border;
        this.fixedWidth = tableOptions.colWidths[this.x];
        this.lines = this.computeLines(tableOptions);
        this.desiredWidth = utils.strlen(this.content) + this.paddingLeft + this.paddingRight;
        this.desiredHeight = this.lines.length;
      }
      computeLines(tableOptions) {
        const tableWordWrap = tableOptions.wordWrap || tableOptions.textWrap;
        const { wordWrap = tableWordWrap } = this.options;
        if (this.fixedWidth && wordWrap) {
          this.fixedWidth -= this.paddingLeft + this.paddingRight;
          if (this.colSpan) {
            let i7 = 1;
            while (i7 < this.colSpan) {
              this.fixedWidth += tableOptions.colWidths[this.x + i7];
              i7++;
            }
          }
          const { wrapOnWordBoundary: tableWrapOnWordBoundary = true } = tableOptions;
          const { wrapOnWordBoundary = tableWrapOnWordBoundary } = this.options;
          return this.wrapLines(utils.wordWrap(this.fixedWidth, this.content, wrapOnWordBoundary));
        }
        return this.wrapLines(this.content.split("\n"));
      }
      wrapLines(computedLines) {
        const lines = utils.colorizeLines(computedLines);
        if (this.href) {
          return lines.map((line) => utils.hyperlink(this.href, line));
        }
        return lines;
      }
      /**
       * Initializes the Cells data structure.
       *
       * @param tableOptions - A fully populated set of tableOptions.
       * In addition to the standard default values, tableOptions must have fully populated the
       * `colWidths` and `rowWidths` arrays. Those arrays must have lengths equal to the number
       * of columns or rows (respectively) in this table, and each array item must be a Number.
       *
       */
      init(tableOptions) {
        let x7 = this.x;
        let y5 = this.y;
        this.widths = tableOptions.colWidths.slice(x7, x7 + this.colSpan);
        this.heights = tableOptions.rowHeights.slice(y5, y5 + this.rowSpan);
        this.width = this.widths.reduce(sumPlusOne, -1);
        this.height = this.heights.reduce(sumPlusOne, -1);
        this.hAlign = this.options.hAlign || tableOptions.colAligns[x7];
        this.vAlign = this.options.vAlign || tableOptions.rowAligns[y5];
        this.drawRight = x7 + this.colSpan == tableOptions.colWidths.length;
      }
      /**
       * Draws the given line of the cell.
       * This default implementation defers to methods `drawTop`, `drawBottom`, `drawLine` and `drawEmpty`.
       * @param lineNum - can be `top`, `bottom` or a numerical line number.
       * @param spanningCell - will be a number if being called from a RowSpanCell, and will represent how
       * many rows below it's being called from. Otherwise it's undefined.
       * @returns {String} The representation of this line.
       */
      draw(lineNum, spanningCell) {
        if (lineNum == "top") return this.drawTop(this.drawRight);
        if (lineNum == "bottom") return this.drawBottom(this.drawRight);
        let content = utils.truncate(this.content, 10, this.truncate);
        if (!lineNum) {
          info(`${this.y}-${this.x}: ${this.rowSpan - lineNum}x${this.colSpan} Cell ${content}`);
        }
        let padLen = Math.max(this.height - this.lines.length, 0);
        let padTop;
        switch (this.vAlign) {
          case "center":
            padTop = Math.ceil(padLen / 2);
            break;
          case "bottom":
            padTop = padLen;
            break;
          default:
            padTop = 0;
        }
        if (lineNum < padTop || lineNum >= padTop + this.lines.length) {
          return this.drawEmpty(this.drawRight, spanningCell);
        }
        let forceTruncation = this.lines.length > this.height && lineNum + 1 >= this.height;
        return this.drawLine(lineNum - padTop, this.drawRight, forceTruncation, spanningCell);
      }
      /**
       * Renders the top line of the cell.
       * @param drawRight - true if this method should render the right edge of the cell.
       * @returns {String}
       */
      drawTop(drawRight) {
        let content = [];
        if (this.cells) {
          this.widths.forEach(function(width, index) {
            content.push(this._topLeftChar(index));
            content.push(utils.repeat(this.chars[this.y == 0 ? "top" : "mid"], width));
          }, this);
        } else {
          content.push(this._topLeftChar(0));
          content.push(utils.repeat(this.chars[this.y == 0 ? "top" : "mid"], this.width));
        }
        if (drawRight) {
          content.push(this.chars[this.y == 0 ? "topRight" : "rightMid"]);
        }
        return this.wrapWithStyleColors("border", content.join(""));
      }
      _topLeftChar(offset) {
        let x7 = this.x + offset;
        let leftChar;
        if (this.y == 0) {
          leftChar = x7 == 0 ? "topLeft" : offset == 0 ? "topMid" : "top";
        } else {
          if (x7 == 0) {
            leftChar = "leftMid";
          } else {
            leftChar = offset == 0 ? "midMid" : "bottomMid";
            if (this.cells) {
              let spanAbove = this.cells[this.y - 1][x7] instanceof _Cell.ColSpanCell;
              if (spanAbove) {
                leftChar = offset == 0 ? "topMid" : "mid";
              }
              if (offset == 0) {
                let i7 = 1;
                while (this.cells[this.y][x7 - i7] instanceof _Cell.ColSpanCell) {
                  i7++;
                }
                if (this.cells[this.y][x7 - i7] instanceof _Cell.RowSpanCell) {
                  leftChar = "leftMid";
                }
              }
            }
          }
        }
        return this.chars[leftChar];
      }
      wrapWithStyleColors(styleProperty, content) {
        if (this[styleProperty] && this[styleProperty].length) {
          try {
            let colors = require_safe();
            for (let i7 = this[styleProperty].length - 1; i7 >= 0; i7--) {
              colors = colors[this[styleProperty][i7]];
            }
            return colors(content);
          } catch (e10) {
            return content;
          }
        } else {
          return content;
        }
      }
      /**
       * Renders a line of text.
       * @param lineNum - Which line of text to render. This is not necessarily the line within the cell.
       * There may be top-padding above the first line of text.
       * @param drawRight - true if this method should render the right edge of the cell.
       * @param forceTruncationSymbol - `true` if the rendered text should end with the truncation symbol even
       * if the text fits. This is used when the cell is vertically truncated. If `false` the text should
       * only include the truncation symbol if the text will not fit horizontally within the cell width.
       * @param spanningCell - a number of if being called from a RowSpanCell. (how many rows below). otherwise undefined.
       * @returns {String}
       */
      drawLine(lineNum, drawRight, forceTruncationSymbol, spanningCell) {
        let left2 = this.chars[this.x == 0 ? "left" : "middle"];
        if (this.x && spanningCell && this.cells) {
          let cellLeft = this.cells[this.y + spanningCell][this.x - 1];
          while (cellLeft instanceof ColSpanCell) {
            cellLeft = this.cells[cellLeft.y][cellLeft.x - 1];
          }
          if (!(cellLeft instanceof RowSpanCell)) {
            left2 = this.chars["rightMid"];
          }
        }
        let leftPadding = utils.repeat(" ", this.paddingLeft);
        let right2 = drawRight ? this.chars["right"] : "";
        let rightPadding = utils.repeat(" ", this.paddingRight);
        let line = this.lines[lineNum];
        let len = this.width - (this.paddingLeft + this.paddingRight);
        if (forceTruncationSymbol) line += this.truncate || "\u2026";
        let content = utils.truncate(line, len, this.truncate);
        content = utils.pad(content, len, " ", this.hAlign);
        content = leftPadding + content + rightPadding;
        return this.stylizeLine(left2, content, right2);
      }
      stylizeLine(left2, content, right2) {
        left2 = this.wrapWithStyleColors("border", left2);
        right2 = this.wrapWithStyleColors("border", right2);
        if (this.y === 0) {
          content = this.wrapWithStyleColors("head", content);
        }
        return left2 + content + right2;
      }
      /**
       * Renders the bottom line of the cell.
       * @param drawRight - true if this method should render the right edge of the cell.
       * @returns {String}
       */
      drawBottom(drawRight) {
        let left2 = this.chars[this.x == 0 ? "bottomLeft" : "bottomMid"];
        let content = utils.repeat(this.chars.bottom, this.width);
        let right2 = drawRight ? this.chars["bottomRight"] : "";
        return this.wrapWithStyleColors("border", left2 + content + right2);
      }
      /**
       * Renders a blank line of text within the cell. Used for top and/or bottom padding.
       * @param drawRight - true if this method should render the right edge of the cell.
       * @param spanningCell - a number of if being called from a RowSpanCell. (how many rows below). otherwise undefined.
       * @returns {String}
       */
      drawEmpty(drawRight, spanningCell) {
        let left2 = this.chars[this.x == 0 ? "left" : "middle"];
        if (this.x && spanningCell && this.cells) {
          let cellLeft = this.cells[this.y + spanningCell][this.x - 1];
          while (cellLeft instanceof ColSpanCell) {
            cellLeft = this.cells[cellLeft.y][cellLeft.x - 1];
          }
          if (!(cellLeft instanceof RowSpanCell)) {
            left2 = this.chars["rightMid"];
          }
        }
        let right2 = drawRight ? this.chars["right"] : "";
        let content = utils.repeat(" ", this.width);
        return this.stylizeLine(left2, content, right2);
      }
    };
    var ColSpanCell = class {
      static {
        __name(this, "ColSpanCell");
      }
      /**
       * A Cell that doesn't do anything. It just draws empty lines.
       * Used as a placeholder in column spanning.
       * @constructor
       */
      constructor() {
      }
      draw(lineNum) {
        if (typeof lineNum === "number") {
          debug2(`${this.y}-${this.x}: 1x1 ColSpanCell`);
        }
        return "";
      }
      init() {
      }
      mergeTableOptions() {
      }
    };
    var RowSpanCell = class {
      static {
        __name(this, "RowSpanCell");
      }
      /**
       * A placeholder Cell for a Cell that spans multiple rows.
       * It delegates rendering to the original cell, but adds the appropriate offset.
       * @param originalCell
       * @constructor
       */
      constructor(originalCell) {
        this.originalCell = originalCell;
      }
      init(tableOptions) {
        let y5 = this.y;
        let originalY = this.originalCell.y;
        this.cellOffset = y5 - originalY;
        this.offset = findDimension(tableOptions.rowHeights, originalY, this.cellOffset);
      }
      draw(lineNum) {
        if (lineNum == "top") {
          return this.originalCell.draw(this.offset, this.cellOffset);
        }
        if (lineNum == "bottom") {
          return this.originalCell.draw("bottom");
        }
        debug2(`${this.y}-${this.x}: 1x${this.colSpan} RowSpanCell for ${this.originalCell.content}`);
        return this.originalCell.draw(this.offset + 1 + lineNum);
      }
      mergeTableOptions() {
      }
    };
    function firstDefined(...args) {
      return args.filter((v8) => v8 !== void 0 && v8 !== null).shift();
    }
    __name(firstDefined, "firstDefined");
    function setOption(objA, objB, nameB, targetObj) {
      let nameA = nameB.split("-");
      if (nameA.length > 1) {
        nameA[1] = nameA[1].charAt(0).toUpperCase() + nameA[1].substr(1);
        nameA = nameA.join("");
        targetObj[nameA] = firstDefined(objA[nameA], objA[nameB], objB[nameA], objB[nameB]);
      } else {
        targetObj[nameB] = firstDefined(objA[nameB], objB[nameB]);
      }
    }
    __name(setOption, "setOption");
    function findDimension(dimensionTable, startingIndex, span) {
      let ret = dimensionTable[startingIndex];
      for (let i7 = 1; i7 < span; i7++) {
        ret += 1 + dimensionTable[startingIndex + i7];
      }
      return ret;
    }
    __name(findDimension, "findDimension");
    function sumPlusOne(a7, b11) {
      return a7 + b11 + 1;
    }
    __name(sumPlusOne, "sumPlusOne");
    var CHAR_NAMES = [
      "top",
      "top-mid",
      "top-left",
      "top-right",
      "bottom",
      "bottom-mid",
      "bottom-left",
      "bottom-right",
      "left",
      "left-mid",
      "mid",
      "mid-mid",
      "right",
      "right-mid",
      "middle"
    ];
    module2.exports = Cell;
    module2.exports.ColSpanCell = ColSpanCell;
    module2.exports.RowSpanCell = RowSpanCell;
  }
});

// ../../node_modules/.pnpm/cli-table3@0.6.3/node_modules/cli-table3/src/layout-manager.js
var require_layout_manager = __commonJS({
  "../../node_modules/.pnpm/cli-table3@0.6.3/node_modules/cli-table3/src/layout-manager.js"(exports, module2) {
    init_import_meta_url();
    var { warn: warn2, debug: debug2 } = require_debug();
    var Cell = require_cell();
    var { ColSpanCell, RowSpanCell } = Cell;
    (function() {
      function next(alloc, col) {
        if (alloc[col] > 0) {
          return next(alloc, col + 1);
        }
        return col;
      }
      __name(next, "next");
      function layoutTable(table) {
        let alloc = {};
        table.forEach(function(row, rowIndex) {
          let col = 0;
          row.forEach(function(cell) {
            cell.y = rowIndex;
            cell.x = rowIndex ? next(alloc, col) : col;
            const rowSpan = cell.rowSpan || 1;
            const colSpan = cell.colSpan || 1;
            if (rowSpan > 1) {
              for (let cs2 = 0; cs2 < colSpan; cs2++) {
                alloc[cell.x + cs2] = rowSpan;
              }
            }
            col = cell.x + colSpan;
          });
          Object.keys(alloc).forEach((idx) => {
            alloc[idx]--;
            if (alloc[idx] < 1) delete alloc[idx];
          });
        });
      }
      __name(layoutTable, "layoutTable");
      function maxWidth(table) {
        let mw = 0;
        table.forEach(function(row) {
          row.forEach(function(cell) {
            mw = Math.max(mw, cell.x + (cell.colSpan || 1));
          });
        });
        return mw;
      }
      __name(maxWidth, "maxWidth");
      function maxHeight(table) {
        return table.length;
      }
      __name(maxHeight, "maxHeight");
      function cellsConflict(cell1, cell2) {
        let yMin1 = cell1.y;
        let yMax1 = cell1.y - 1 + (cell1.rowSpan || 1);
        let yMin2 = cell2.y;
        let yMax2 = cell2.y - 1 + (cell2.rowSpan || 1);
        let yConflict = !(yMin1 > yMax2 || yMin2 > yMax1);
        let xMin1 = cell1.x;
        let xMax1 = cell1.x - 1 + (cell1.colSpan || 1);
        let xMin2 = cell2.x;
        let xMax2 = cell2.x - 1 + (cell2.colSpan || 1);
        let xConflict = !(xMin1 > xMax2 || xMin2 > xMax1);
        return yConflict && xConflict;
      }
      __name(cellsConflict, "cellsConflict");
      function conflictExists(rows, x7, y5) {
        let i_max = Math.min(rows.length - 1, y5);
        let cell = { x: x7, y: y5 };
        for (let i7 = 0; i7 <= i_max; i7++) {
          let row = rows[i7];
          for (let j7 = 0; j7 < row.length; j7++) {
            if (cellsConflict(cell, row[j7])) {
              return true;
            }
          }
        }
        return false;
      }
      __name(conflictExists, "conflictExists");
      function allBlank(rows, y5, xMin, xMax) {
        for (let x7 = xMin; x7 < xMax; x7++) {
          if (conflictExists(rows, x7, y5)) {
            return false;
          }
        }
        return true;
      }
      __name(allBlank, "allBlank");
      function addRowSpanCells(table) {
        table.forEach(function(row, rowIndex) {
          row.forEach(function(cell) {
            for (let i7 = 1; i7 < cell.rowSpan; i7++) {
              let rowSpanCell = new RowSpanCell(cell);
              rowSpanCell.x = cell.x;
              rowSpanCell.y = cell.y + i7;
              rowSpanCell.colSpan = cell.colSpan;
              insertCell(rowSpanCell, table[rowIndex + i7]);
            }
          });
        });
      }
      __name(addRowSpanCells, "addRowSpanCells");
      function addColSpanCells(cellRows) {
        for (let rowIndex = cellRows.length - 1; rowIndex >= 0; rowIndex--) {
          let cellColumns = cellRows[rowIndex];
          for (let columnIndex = 0; columnIndex < cellColumns.length; columnIndex++) {
            let cell = cellColumns[columnIndex];
            for (let k7 = 1; k7 < cell.colSpan; k7++) {
              let colSpanCell = new ColSpanCell();
              colSpanCell.x = cell.x + k7;
              colSpanCell.y = cell.y;
              cellColumns.splice(columnIndex + 1, 0, colSpanCell);
            }
          }
        }
      }
      __name(addColSpanCells, "addColSpanCells");
      function insertCell(cell, row) {
        let x7 = 0;
        while (x7 < row.length && row[x7].x < cell.x) {
          x7++;
        }
        row.splice(x7, 0, cell);
      }
      __name(insertCell, "insertCell");
      function fillInTable(table) {
        let h_max = maxHeight(table);
        let w_max = maxWidth(table);
        debug2(`Max rows: ${h_max}; Max cols: ${w_max}`);
        for (let y5 = 0; y5 < h_max; y5++) {
          for (let x7 = 0; x7 < w_max; x7++) {
            if (!conflictExists(table, x7, y5)) {
              let opts = { x: x7, y: y5, colSpan: 1, rowSpan: 1 };
              x7++;
              while (x7 < w_max && !conflictExists(table, x7, y5)) {
                opts.colSpan++;
                x7++;
              }
              let y22 = y5 + 1;
              while (y22 < h_max && allBlank(table, y22, opts.x, opts.x + opts.colSpan)) {
                opts.rowSpan++;
                y22++;
              }
              let cell = new Cell(opts);
              cell.x = opts.x;
              cell.y = opts.y;
              warn2(`Missing cell at ${cell.y}-${cell.x}.`);
              insertCell(cell, table[y5]);
            }
          }
        }
      }
      __name(fillInTable, "fillInTable");
      function generateCells(rows) {
        return rows.map(function(row) {
          if (!Array.isArray(row)) {
            let key = Object.keys(row)[0];
            row = row[key];
            if (Array.isArray(row)) {
              row = row.slice();
              row.unshift(key);
            } else {
              row = [key, row];
            }
          }
          return row.map(function(cell) {
            return new Cell(cell);
          });
        });
      }
      __name(generateCells, "generateCells");
      function makeTableLayout(rows) {
        let cellRows = generateCells(rows);
        layoutTable(cellRows);
        fillInTable(cellRows);
        addRowSpanCells(cellRows);
        addColSpanCells(cellRows);
        return cellRows;
      }
      __name(makeTableLayout, "makeTableLayout");
      module2.exports = {
        makeTableLayout,
        layoutTable,
        addRowSpanCells,
        maxWidth,
        fillInTable,
        computeWidths: makeComputeWidths("colSpan", "desiredWidth", "x", 1),
        computeHeights: makeComputeWidths("rowSpan", "desiredHeight", "y", 1)
      };
    })();
    function makeComputeWidths(colSpan, desiredWidth, x7, forcedMin) {
      return function(vals, table) {
        let result = [];
        let spanners = [];
        let auto2 = {};
        table.forEach(function(row) {
          row.forEach(function(cell) {
            if ((cell[colSpan] || 1) > 1) {
              spanners.push(cell);
            } else {
              result[cell[x7]] = Math.max(result[cell[x7]] || 0, cell[desiredWidth] || 0, forcedMin);
            }
          });
        });
        vals.forEach(function(val2, index) {
          if (typeof val2 === "number") {
            result[index] = val2;
          }
        });
        for (let k7 = spanners.length - 1; k7 >= 0; k7--) {
          let cell = spanners[k7];
          let span = cell[colSpan];
          let col = cell[x7];
          let existingWidth = result[col];
          let editableCols = typeof vals[col] === "number" ? 0 : 1;
          if (typeof existingWidth === "number") {
            for (let i7 = 1; i7 < span; i7++) {
              existingWidth += 1 + result[col + i7];
              if (typeof vals[col + i7] !== "number") {
                editableCols++;
              }
            }
          } else {
            existingWidth = desiredWidth === "desiredWidth" ? cell.desiredWidth - 1 : 1;
            if (!auto2[col] || auto2[col] < existingWidth) {
              auto2[col] = existingWidth;
            }
          }
          if (cell[desiredWidth] > existingWidth) {
            let i7 = 0;
            while (editableCols > 0 && cell[desiredWidth] > existingWidth) {
              if (typeof vals[col + i7] !== "number") {
                let dif = Math.round((cell[desiredWidth] - existingWidth) / editableCols);
                existingWidth += dif;
                result[col + i7] += dif;
                editableCols--;
              }
              i7++;
            }
          }
        }
        Object.assign(vals, result, auto2);
        for (let j7 = 0; j7 < vals.length; j7++) {
          vals[j7] = Math.max(forcedMin, vals[j7] || 0);
        }
      };
    }
    __name(makeComputeWidths, "makeComputeWidths");
  }
});

// ../../node_modules/.pnpm/cli-table3@0.6.3/node_modules/cli-table3/src/table.js
var require_table = __commonJS({
  "../../node_modules/.pnpm/cli-table3@0.6.3/node_modules/cli-table3/src/table.js"(exports, module2) {
    init_import_meta_url();
    var debug2 = require_debug();
    var utils = require_utils2();
    var tableLayout = require_layout_manager();
    var Table = class extends Array {
      static {
        __name(this, "Table");
      }
      constructor(opts) {
        super();
        const options = utils.mergeOptions(opts);
        Object.defineProperty(this, "options", {
          value: options,
          enumerable: options.debug
        });
        if (options.debug) {
          switch (typeof options.debug) {
            case "boolean":
              debug2.setDebugLevel(debug2.WARN);
              break;
            case "number":
              debug2.setDebugLevel(options.debug);
              break;
            case "string":
              debug2.setDebugLevel(parseInt(options.debug, 10));
              break;
            default:
              debug2.setDebugLevel(debug2.WARN);
              debug2.warn(`Debug option is expected to be boolean, number, or string. Received a ${typeof options.debug}`);
          }
          Object.defineProperty(this, "messages", {
            get() {
              return debug2.debugMessages();
            }
          });
        }
      }
      toString() {
        let array = this;
        let headersPresent = this.options.head && this.options.head.length;
        if (headersPresent) {
          array = [this.options.head];
          if (this.length) {
            array.push.apply(array, this);
          }
        } else {
          this.options.style.head = [];
        }
        let cells = tableLayout.makeTableLayout(array);
        cells.forEach(function(row) {
          row.forEach(function(cell) {
            cell.mergeTableOptions(this.options, cells);
          }, this);
        }, this);
        tableLayout.computeWidths(this.options.colWidths, cells);
        tableLayout.computeHeights(this.options.rowHeights, cells);
        cells.forEach(function(row) {
          row.forEach(function(cell) {
            cell.init(this.options);
          }, this);
        }, this);
        let result = [];
        for (let rowIndex = 0; rowIndex < cells.length; rowIndex++) {
          let row = cells[rowIndex];
          let heightOfRow = this.options.rowHeights[rowIndex];
          if (rowIndex === 0 || !this.options.style.compact || rowIndex == 1 && headersPresent) {
            doDraw(row, "top", result);
          }
          for (let lineNum = 0; lineNum < heightOfRow; lineNum++) {
            doDraw(row, lineNum, result);
          }
          if (rowIndex + 1 == cells.length) {
            doDraw(row, "bottom", result);
          }
        }
        return result.join("\n");
      }
      get width() {
        let str = this.toString().split("\n");
        return str[0].length;
      }
    };
    Table.reset = () => debug2.reset();
    function doDraw(row, lineNum, result) {
      let line = [];
      row.forEach(function(cell) {
        line.push(cell.draw(lineNum));
      });
      let str = line.join("");
      if (str.length) result.push(str);
    }
    __name(doDraw, "doDraw");
    module2.exports = Table;
  }
});

// ../../node_modules/.pnpm/cli-table3@0.6.3/node_modules/cli-table3/index.js
var require_cli_table3 = __commonJS({
  "../../node_modules/.pnpm/cli-table3@0.6.3/node_modules/cli-table3/index.js"(exports, module2) {
    init_import_meta_url();
    module2.exports = require_table();
  }
});
function formatMessage({ text, notes, location, kind: kind2 = "error" }, color = true) {
  const input = { text, notes, location };
  delete input.location?.fileText;
  for (const note of notes ?? []) {
    delete note.location?.fileText;
  }
  const lines = esbuild.formatMessagesSync([input], {
    color,
    kind: kind2,
    terminalWidth: logger.columns
  });
  return lines.join("\n");
}
var init_format_message = __esm({
  "src/utils/format-message.ts"() {
    init_import_meta_url();
    init_logger();
    __name(formatMessage, "formatMessage");
  }
});

// ../../node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/signals.js
var require_signals = __commonJS({
  "../../node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/signals.js"(exports, module2) {
    init_import_meta_url();
    module2.exports = [
      "SIGABRT",
      "SIGALRM",
      "SIGHUP",
      "SIGINT",
      "SIGTERM"
    ];
    if (process.platform !== "win32") {
      module2.exports.push(
        "SIGVTALRM",
        "SIGXCPU",
        "SIGXFSZ",
        "SIGUSR2",
        "SIGTRAP",
        "SIGSYS",
        "SIGQUIT",
        "SIGIOT"
        // should detect profiler and enable/disable accordingly.
        // see #21
        // 'SIGPROF'
      );
    }
    if (process.platform === "linux") {
      module2.exports.push(
        "SIGIO",
        "SIGPOLL",
        "SIGPWR",
        "SIGSTKFLT",
        "SIGUNUSED"
      );
    }
  }
});

// ../../node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/index.js
var require_signal_exit = __commonJS({
  "../../node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/index.js"(exports, module2) {
    init_import_meta_url();
    var process19 = global.process;
    var processOk = /* @__PURE__ */ __name(function(process20) {
      return process20 && typeof process20 === "object" && typeof process20.removeListener === "function" && typeof process20.emit === "function" && typeof process20.reallyExit === "function" && typeof process20.listeners === "function" && typeof process20.kill === "function" && typeof process20.pid === "number" && typeof process20.on === "function";
    }, "processOk");
    if (!processOk(process19)) {
      module2.exports = function() {
        return function() {
        };
      };
    } else {
      assert61 = __require("assert");
      signals = require_signals();
      isWin = /^win/i.test(process19.platform);
      EE = __require("events");
      if (typeof EE !== "function") {
        EE = EE.EventEmitter;
      }
      if (process19.__signal_exit_emitter__) {
        emitter = process19.__signal_exit_emitter__;
      } else {
        emitter = process19.__signal_exit_emitter__ = new EE();
        emitter.count = 0;
        emitter.emitted = {};
      }
      if (!emitter.infinite) {
        emitter.setMaxListeners(Infinity);
        emitter.infinite = true;
      }
      module2.exports = function(cb2, opts) {
        if (!processOk(global.process)) {
          return function() {
          };
        }
        assert61.equal(typeof cb2, "function", "a callback must be provided for exit handler");
        if (loaded === false) {
          load();
        }
        var ev = "exit";
        if (opts && opts.alwaysLast) {
          ev = "afterexit";
        }
        var remove = /* @__PURE__ */ __name(function() {
          emitter.removeListener(ev, cb2);
          if (emitter.listeners("exit").length === 0 && emitter.listeners("afterexit").length === 0) {
            unload();
          }
        }, "remove");
        emitter.on(ev, cb2);
        return remove;
      };
      unload = /* @__PURE__ */ __name(function unload2() {
        if (!loaded || !processOk(global.process)) {
          return;
        }
        loaded = false;
        signals.forEach(function(sig) {
          try {
            process19.removeListener(sig, sigListeners[sig]);
          } catch (er2) {
          }
        });
        process19.emit = originalProcessEmit;
        process19.reallyExit = originalProcessReallyExit;
        emitter.count -= 1;
      }, "unload");
      module2.exports.unload = unload;
      emit = /* @__PURE__ */ __name(function emit2(event, code, signal) {
        if (emitter.emitted[event]) {
          return;
        }
        emitter.emitted[event] = true;
        emitter.emit(event, code, signal);
      }, "emit");
      sigListeners = {};
      signals.forEach(function(sig) {
        sigListeners[sig] = /* @__PURE__ */ __name(function listener() {
          if (!processOk(global.process)) {
            return;
          }
          var listeners = process19.listeners(sig);
          if (listeners.length === emitter.count) {
            unload();
            emit("exit", null, sig);
            emit("afterexit", null, sig);
            if (isWin && sig === "SIGHUP") {
              sig = "SIGINT";
            }
            process19.kill(process19.pid, sig);
          }
        }, "listener");
      });
      module2.exports.signals = function() {
        return signals;
      };
      loaded = false;
      load = /* @__PURE__ */ __name(function load2() {
        if (loaded || !processOk(global.process)) {
          return;
        }
        loaded = true;
        emitter.count += 1;
        signals = signals.filter(function(sig) {
          try {
            process19.on(sig, sigListeners[sig]);
            return true;
          } catch (er2) {
            return false;
          }
        });
        process19.emit = processEmit;
        process19.reallyExit = processReallyExit;
      }, "load");
      module2.exports.load = load;
      originalProcessReallyExit = process19.reallyExit;
      processReallyExit = /* @__PURE__ */ __name(function processReallyExit2(code) {
        if (!processOk(global.process)) {
          return;
        }
        process19.exitCode = code || /* istanbul ignore next */
        0;
        emit("exit", process19.exitCode, null);
        emit("afterexit", process19.exitCode, null);
        originalProcessReallyExit.call(process19, process19.exitCode);
      }, "processReallyExit");
      originalProcessEmit = process19.emit;
      processEmit = /* @__PURE__ */ __name(function processEmit2(ev, arg) {
        if (ev === "exit" && processOk(global.process)) {
          if (arg !== void 0) {
            process19.exitCode = arg;
          }
          var ret = originalProcessEmit.apply(this, arguments);
          emit("exit", process19.exitCode, null);
          emit("afterexit", process19.exitCode, null);
          return ret;
        } else {
          return originalProcessEmit.apply(this, arguments);
        }
      }, "processEmit");
    }
    var assert61;
    var signals;
    var isWin;
    var EE;
    var emitter;
    var unload;
    var emit;
    var sigListeners;
    var loaded;
    var load;
    var originalProcessReallyExit;
    var processReallyExit;
    var originalProcessEmit;
    var processEmit;
  }
});
async function ensureDirectoryExists(filepath) {
  const dirpath = path3__namespace.default.dirname(filepath);
  await fs9.mkdir(dirpath, { recursive: true });
}
function ensureDirectoryExistsSync(filepath) {
  const dirpath = path3__namespace.default.dirname(filepath);
  fs29.mkdirSync(dirpath, { recursive: true });
}
var init_filesystem = __esm({
  "src/utils/filesystem.ts"() {
    init_import_meta_url();
    __name(ensureDirectoryExists, "ensureDirectoryExists");
    __name(ensureDirectoryExistsSync, "ensureDirectoryExistsSync");
  }
});
function getDebugFilepath() {
  const dir2 = getDebugFileDir();
  const date = (/* @__PURE__ */ new Date()).toISOString().replaceAll(":", "-").replace(".", "_").replace("T", "_").replace("Z", "");
  const filepath = dir2.endsWith(".log") ? dir2 : path3__namespace.default.join(dir2, `wrangler-${date}.log`);
  return path3__namespace.default.resolve(filepath);
}
async function appendToDebugLogFile(messageLevel, message) {
  const entry = `
--- ${(/* @__PURE__ */ new Date()).toISOString()} ${messageLevel}
${util4.stripVTControlCharacters(message)}
---
`;
  if (!hasLoggedLocation) {
    hasLoggedLocation = true;
    logger.debug(`\u{1FAB5}  Writing logs to "${debugLogFilepath}"`);
    (0, import_signal_exit.default)(() => {
      if (hasSeenErrorMessage) {
        logger.console(
          "warn",
          `\u{1FAB5}  Logs were written to "${debugLogFilepath}"`
        );
      }
    });
  }
  if (!hasSeenErrorMessage) {
    hasSeenErrorMessage = messageLevel === "error";
  }
  await mutex.runWith(async () => {
    try {
      await ensureDirectoryExists(debugLogFilepath);
      await fs9.appendFile(debugLogFilepath, entry);
    } catch (err) {
      if (!hasLoggedError) {
        hasLoggedError = true;
        logger.error(`Failed to write to log file`, err);
        logger.error(`Would have written:`, entry);
      }
    }
  });
}
var import_signal_exit, getDebugFileDir, debugLogFilepath, mutex, hasLoggedLocation, hasLoggedError, hasSeenErrorMessage;
var init_log_file = __esm({
  "src/utils/log-file.ts"() {
    init_import_meta_url();
    init_dist();
    import_signal_exit = __toESM(require_signal_exit());
    init_logger();
    init_filesystem();
    getDebugFileDir = getEnvironmentVariableFactory({
      variableName: "WRANGLER_LOG_PATH",
      defaultValue() {
        const gobalWranglerConfigDir = getGlobalWranglerConfigPath();
        return path3__namespace.default.join(gobalWranglerConfigDir, "logs");
      }
    });
    __name(getDebugFilepath, "getDebugFilepath");
    debugLogFilepath = getDebugFilepath();
    mutex = new miniflare.Mutex();
    hasLoggedLocation = false;
    hasLoggedError = false;
    hasSeenErrorMessage = false;
    __name(appendToDebugLogFile, "appendToDebugLogFile");
  }
});
function getLoggerLevel() {
  const fromEnv3 = getLogLevelFromEnv()?.toLowerCase();
  if (fromEnv3 !== void 0) {
    if (fromEnv3 in LOGGER_LEVELS) {
      return fromEnv3;
    }
    const expected = Object.keys(LOGGER_LEVELS).map((level) => `"${level}"`).join(" | ");
    logger.once.warn(
      `Unrecognised WRANGLER_LOG value ${JSON.stringify(
        fromEnv3
      )}, expected ${expected}, defaulting to "log"...`
    );
  }
  return "log";
}
function consoleMethodToLoggerLevel(method) {
  if (method in LOGGER_LEVELS) {
    return method;
  }
  return "log";
}
function logBuildWarnings(warnings) {
  const logs = esbuild.formatMessagesSync(warnings, { kind: "warning", color: true });
  for (const log2 of logs) {
    logger.console("warn", log2);
  }
}
function logBuildFailure(errors, warnings) {
  if (errors.length > 0) {
    const logs = esbuild.formatMessagesSync(errors, { kind: "error", color: true });
    const errorStr = errors.length > 1 ? "errors" : "error";
    logger.error(
      `Build failed with ${errors.length} ${errorStr}:
` + logs.join("\n")
    );
  }
  logBuildWarnings(warnings);
}
var import_cli_table3, LOGGER_LEVELS, LOGGER_LEVEL_FORMAT_TYPE_MAP, getLogLevelFromEnv, overrideLoggerLevel, runWithLogLevel, Logger, logger;
var init_logger = __esm({
  "src/logger.ts"() {
    init_import_meta_url();
    init_dist();
    init_source();
    import_cli_table3 = __toESM(require_cli_table3());
    init_format_message();
    init_log_file();
    LOGGER_LEVELS = {
      none: -1,
      error: 0,
      warn: 1,
      info: 2,
      log: 3,
      debug: 4
    };
    LOGGER_LEVEL_FORMAT_TYPE_MAP = {
      error: "error",
      warn: "warning",
      info: void 0,
      log: void 0,
      debug: void 0
    };
    getLogLevelFromEnv = getEnvironmentVariableFactory({
      variableName: "WRANGLER_LOG"
    });
    __name(getLoggerLevel, "getLoggerLevel");
    overrideLoggerLevel = new async_hooks.AsyncLocalStorage();
    runWithLogLevel = /* @__PURE__ */ __name((overrideLogLevel, cb2) => overrideLoggerLevel.run({ logLevel: overrideLogLevel }, cb2), "runWithLogLevel");
    __name(consoleMethodToLoggerLevel, "consoleMethodToLoggerLevel");
    Logger = class _Logger {
      static {
        __name(this, "Logger");
      }
      constructor() {
      }
      overrideLoggerLevel;
      onceHistory = /* @__PURE__ */ new Set();
      get loggerLevel() {
        return overrideLoggerLevel.getStore()?.logLevel ?? this.overrideLoggerLevel ?? getLoggerLevel();
      }
      set loggerLevel(val2) {
        this.overrideLoggerLevel = val2;
      }
      resetLoggerLevel() {
        this.overrideLoggerLevel = void 0;
      }
      columns = process.stdout.columns;
      json = /* @__PURE__ */ __name((data) => {
        console.log(JSON.stringify(data, null, 4));
      }, "json");
      debug = /* @__PURE__ */ __name((...args) => this.doLog("debug", args), "debug");
      debugWithSanitization = /* @__PURE__ */ __name((label, ...args) => {
        if (getSanitizeLogs()) {
          this.doLog("debug", [
            label,
            "omitted; set WRANGLER_LOG_SANITIZE=false to include sanitized data"
          ]);
        } else {
          this.doLog("debug", [label, ...args]);
        }
      }, "debugWithSanitization");
      info = /* @__PURE__ */ __name((...args) => this.doLog("info", args), "info");
      log = /* @__PURE__ */ __name((...args) => this.doLog("log", args), "log");
      warn = /* @__PURE__ */ __name((...args) => this.doLog("warn", args), "warn");
      error(...args) {
        if (args.length === 1 && args[0] instanceof ParseError) {
          this.doLog("error", formatMessage(args[0]));
        } else {
          this.doLog("error", args);
        }
      }
      table(data, options) {
        const derivedHead = data.length === 0 ? [] : Object.keys(data[0]);
        const wordWrap = options?.wordWrap ?? false;
        const head = options?.head ?? derivedHead;
        const tableOptions = {
          style: {
            head: source_default.level ? ["blue"] : [],
            border: source_default.level ? ["gray"] : []
          },
          wordWrap,
          head
        };
        const t13 = new import_cli_table3.default(tableOptions);
        t13.push(...data.map((row) => head.map((k7) => row[k7])));
        return this.doLog("log", [t13.toString()]);
      }
      console(method, ...args) {
        if (typeof console[method] !== "function") {
          throw new Error(`console.${method}() is not a function`);
        }
        if (LOGGER_LEVELS[this.loggerLevel] >= LOGGER_LEVELS[consoleMethodToLoggerLevel(method)]) {
          _Logger.#beforeLogHook?.();
          console[method].apply(console, args);
          _Logger.#afterLogHook?.();
        }
      }
      get once() {
        return {
          info: /* @__PURE__ */ __name((...args) => this.doLogOnce("info", args), "info"),
          log: /* @__PURE__ */ __name((...args) => this.doLogOnce("log", args), "log"),
          warn: /* @__PURE__ */ __name((...args) => this.doLogOnce("warn", args), "warn"),
          error: /* @__PURE__ */ __name((...args) => this.doLogOnce("error", args), "error")
        };
      }
      clearHistory() {
        this.onceHistory.clear();
      }
      doLogOnce(messageLevel, args) {
        const cacheKey = `${messageLevel}: ${args.join(" ")}`;
        if (!this.onceHistory.has(cacheKey)) {
          this.onceHistory.add(cacheKey);
          this.doLog(messageLevel, args);
        }
      }
      doLog(messageLevel, args) {
        const message = Array.isArray(args) ? this.formatMessage(messageLevel, util4.format(...args)) : args;
        const inUnitTests = typeof vitest !== "undefined";
        if (!inUnitTests) {
          void appendToDebugLogFile(messageLevel, message);
        }
        if (LOGGER_LEVELS[this.loggerLevel] >= LOGGER_LEVELS[messageLevel]) {
          _Logger.#beforeLogHook?.();
          console[messageLevel](message);
          _Logger.#afterLogHook?.();
        }
      }
      static #beforeLogHook;
      static registerBeforeLogHook(callback) {
        this.#beforeLogHook = callback;
      }
      static #afterLogHook;
      static registerAfterLogHook(callback) {
        this.#afterLogHook = callback;
      }
      formatMessage(level, message) {
        const kind2 = LOGGER_LEVEL_FORMAT_TYPE_MAP[level];
        if (kind2) {
          const [firstLine, ...otherLines] = message.split("\n");
          const notes = otherLines.length > 0 ? otherLines.map((text) => ({ text })) : void 0;
          return esbuild.formatMessagesSync([{ text: firstLine, notes }], {
            color: true,
            kind: kind2,
            terminalWidth: this.columns
          })[0];
        } else {
          return message;
        }
      }
    };
    logger = new Logger();
    __name(logBuildWarnings, "logBuildWarnings");
    __name(logBuildFailure, "logBuildFailure");
  }
});
function toUrlPath(filePath) {
  console$1.assert(
    !/^[a-z]:/i.test(filePath),
    "Tried to convert a Windows file path with a drive to a URL path."
  );
  return filePath.replace(/\\/g, "/");
}
function readableRelative(to) {
  const relativePath = path3__namespace.default.relative(process.cwd(), to);
  if (
    // No directory nesting, return as-is
    path3__namespace.default.basename(relativePath) === relativePath || // Outside current directory
    relativePath.startsWith(".")
  ) {
    return relativePath;
  } else {
    return "./" + relativePath;
  }
}
function getBasePath() {
  return path3__namespace.default.resolve(__dirname, "..");
}
function getWranglerHiddenDirPath(projectRoot) {
  projectRoot ??= process.cwd();
  return path3__namespace.default.join(projectRoot, ".wrangler");
}
function getWranglerTmpDir(projectRoot, prefix, cleanup = true) {
  const tmpRoot = path3__namespace.default.join(getWranglerHiddenDirPath(projectRoot), "tmp");
  fs29__namespace.default.mkdirSync(tmpRoot, { recursive: true });
  const tmpPrefix = path3__namespace.default.join(tmpRoot, `${prefix}-`);
  const tmpDir = fs29__namespace.default.realpathSync(fs29__namespace.default.mkdtempSync(tmpPrefix));
  const cleanupDir = /* @__PURE__ */ __name(() => {
    if (cleanup) {
      try {
        removeDirSync(tmpDir);
      } catch {
      }
    }
  }, "cleanupDir");
  const removeExitListener = (0, import_signal_exit2.default)(cleanupDir);
  return {
    path: tmpDir,
    remove() {
      removeExitListener();
      cleanupDir();
    }
  };
}
var import_signal_exit2;
var init_paths = __esm({
  "src/paths.ts"() {
    init_import_meta_url();
    init_dist();
    import_signal_exit2 = __toESM(require_signal_exit());
    __name(toUrlPath, "toUrlPath");
    __name(readableRelative, "readableRelative");
    __name(getBasePath, "getBasePath");
    __name(getWranglerHiddenDirPath, "getWranglerHiddenDirPath");
    __name(getWranglerTmpDir, "getWranglerTmpDir");
  }
});

// src/deployment-bundle/bundle-type.ts
function getBundleType(format11, file3) {
  if (file3 && file3.endsWith(".py")) {
    return "python";
  }
  return format11 === "modules" ? "esm" : "commonjs";
}
var init_bundle_type = __esm({
  "src/deployment-bundle/bundle-type.ts"() {
    init_import_meta_url();
    __name(getBundleType, "getBundleType");
  }
});

// src/deployment-bundle/rules.ts
function isJavaScriptModuleRule(rule) {
  return rule.type === "ESModule" || rule.type === "CommonJS";
}
function parseRules(userRules = []) {
  const rules = [...userRules, ...DEFAULT_MODULE_RULES];
  const completedRuleLocations = {};
  const redundantRules = {};
  let index = 0;
  const rulesToRemove = [];
  for (const rule of rules) {
    if (rule.type in completedRuleLocations) {
      if (rules[completedRuleLocations[rule.type]].fallthrough !== false) {
        if (rule.type in redundantRules) {
          redundantRules[rule.type].push({
            index,
            default: index >= userRules.length
          });
        } else {
          redundantRules[rule.type] = [
            { index, default: index >= userRules.length }
          ];
        }
      }
      rulesToRemove.push(rule);
    }
    if (!(rule.type in completedRuleLocations) && rule.fallthrough !== true) {
      completedRuleLocations[rule.type] = index;
    }
    index++;
  }
  for (const completedRuleType in completedRuleLocations) {
    const r10 = redundantRules[completedRuleType];
    if (r10) {
      const completedRuleIndex = completedRuleLocations[completedRuleType];
      let warning = `The ${completedRuleIndex >= userRules.length ? "default " : ""}module rule ${JSON.stringify(
        rules[completedRuleIndex]
      )} does not have a fallback, the following rules will be ignored:`;
      for (const rule of r10) {
        warning += `
 ${JSON.stringify(rules[rule.index])}${rule.default ? " (DEFAULT)" : ""}`;
      }
      warning += `

Add \`fallthrough = true\` to rule to allow next rule to be used or \`fallthrough = false\` to silence this warning`;
      logger.warn(warning);
    }
  }
  rulesToRemove.forEach((rule) => rules.splice(rules.indexOf(rule), 1));
  return { rules, removedRules: rulesToRemove };
}
var DEFAULT_MODULE_RULES;
var init_rules = __esm({
  "src/deployment-bundle/rules.ts"() {
    init_import_meta_url();
    init_logger();
    __name(isJavaScriptModuleRule, "isJavaScriptModuleRule");
    DEFAULT_MODULE_RULES = [
      { type: "Text", globs: ["**/*.txt", "**/*.html", "**/*.sql"] },
      { type: "Data", globs: ["**/*.bin"] },
      { type: "CompiledWasm", globs: ["**/*.wasm", "**/*.wasm?module"] }
    ];
    __name(parseRules, "parseRules");
  }
});
function loadSourceMaps(main2, modules, bundle) {
  const { sourceMapPath, sourceMapMetadata } = bundle;
  if (sourceMapPath && sourceMapMetadata) {
    return loadSourceMap(main2, sourceMapPath, sourceMapMetadata);
  } else {
    return scanSourceMaps([main2, ...modules]);
  }
}
function loadSourceMap({ name: name2, filePath }, sourceMapPath, { entryDirectory }) {
  if (filePath === void 0) {
    return [];
  }
  const map2 = JSON.parse(
    fs29__namespace.default.readFileSync(path3__namespace.default.join(entryDirectory, sourceMapPath), "utf8")
  );
  map2.file = name2;
  if (map2.sourceRoot) {
    const sourceRootPath = path3__namespace.default.dirname(
      path3__namespace.default.join(entryDirectory, sourceMapPath)
    );
    map2.sourceRoot = path3__namespace.default.relative(sourceRootPath, map2.sourceRoot);
  }
  map2.sources = map2.sources.map((source) => {
    const originalPath = path3__namespace.default.join(path3__namespace.default.dirname(filePath), source);
    return path3__namespace.default.relative(entryDirectory, originalPath);
  });
  return [
    {
      name: name2 + ".map",
      content: JSON.stringify(map2)
    }
  ];
}
function scanSourceMaps(modules) {
  const maps = [];
  for (const module2 of modules) {
    const maybeSourcemap = sourceMapForModule(module2);
    if (maybeSourcemap) {
      maps.push(maybeSourcemap);
    }
  }
  return maps;
}
function tryAttachSourcemapToModule(module2) {
  if (module2.type !== "esm" && module2.type !== "commonjs") {
    return;
  }
  const sourceMap = sourceMapForModule(module2);
  if (sourceMap) {
    module2.sourceMap = sourceMap;
  }
}
function getSourceMappingUrl(module2) {
  const content = typeof module2.content === "string" ? module2.content : new TextDecoder().decode(module2.content);
  const trimmed = content.trimEnd();
  const lines = trimmed.split("\n");
  while (lines.at(-1)?.trim().length === 0) {
    lines.pop();
  }
  const commentPrefix = "//# sourceMappingURL=";
  const lastLine = lines.pop();
  if (lastLine === void 0 || !lastLine.startsWith(commentPrefix)) {
    return void 0;
  }
  const commentPath = stripPrefix(commentPrefix, lastLine).trim();
  if (commentPath.startsWith("data:")) {
    throw new Error(
      `Unsupported source map path in ${module2.filePath}: expected file path but found data URL.`
    );
  }
  return commentPath;
}
function sourceMapForModule(module2) {
  if (module2.filePath === void 0) {
    return void 0;
  }
  const sourceMapUrl = getSourceMappingUrl(module2);
  if (sourceMapUrl === void 0) {
    return;
  }
  const sourcemapPath = path3__namespace.default.join(path3__namespace.default.dirname(module2.filePath), sourceMapUrl);
  if (!fs29__namespace.default.existsSync(sourcemapPath)) {
    throw new Error(
      `Invalid source map path in ${module2.filePath}: ${sourcemapPath} does not exist.`
    );
  }
  const map2 = JSON.parse(
    fs29__namespace.default.readFileSync(sourcemapPath, "utf8")
  );
  map2.file = module2.name;
  if (map2.sourceRoot) {
    map2.sourceRoot = cleanPathPrefix(map2.sourceRoot);
  }
  map2.sources = map2.sources.map(cleanPathPrefix);
  return {
    name: module2.name + ".map",
    content: JSON.stringify(map2)
  };
}
function cleanPathPrefix(filePath) {
  return stripPrefix(
    "..\\",
    stripPrefix("../", stripPrefix(".\\", stripPrefix("./", filePath)))
  );
}
function stripPrefix(prefix, input) {
  let stripped = input;
  while (stripped.startsWith(prefix)) {
    stripped = stripped.slice(prefix.length);
  }
  return stripped;
}
var init_source_maps = __esm({
  "src/deployment-bundle/source-maps.ts"() {
    init_import_meta_url();
    __name(loadSourceMaps, "loadSourceMaps");
    __name(loadSourceMap, "loadSourceMap");
    __name(scanSourceMaps, "scanSourceMaps");
    __name(tryAttachSourcemapToModule, "tryAttachSourcemapToModule");
    __name(getSourceMappingUrl, "getSourceMappingUrl");
    __name(sourceMapForModule, "sourceMapForModule");
    __name(cleanPathPrefix, "cleanPathPrefix");
    __name(stripPrefix, "stripPrefix");
  }
});
async function* getFiles(configPath, moduleRoot, relativeTo, projectRoot) {
  const wranglerHiddenDirPath = getWranglerHiddenDirPath(projectRoot);
  for (const file3 of await fs9.readdir(moduleRoot, { withFileTypes: true })) {
    const absPath = path3__namespace.default.join(moduleRoot, file3.name);
    if (file3.isDirectory()) {
      if (absPath !== wranglerHiddenDirPath) {
        yield* getFiles(configPath, absPath, relativeTo, projectRoot);
      }
    } else {
      if (absPath !== configPath) {
        yield path3__namespace.default.relative(relativeTo, absPath).replaceAll("\\", "/");
      }
    }
  }
}
function isPythonVendorModule(moduleName) {
  return moduleName.startsWith("python_modules/");
}
function removePythonVendorModules(isPythonEntrypoint, modules) {
  if (!isPythonEntrypoint) {
    return modules;
  }
  return modules.filter((m7) => !isPythonVendorModule(m7.name));
}
function getPythonVendorModulesSize(modules) {
  const vendorModules = modules.filter((m7) => isPythonVendorModule(m7.name));
  return vendorModules.reduce((total, m7) => total + m7.content.length, 0);
}
async function findAdditionalModules(entry, rules, attachSourcemaps = false, pythonModulesExcludes = []) {
  const files = getFiles(
    entry.configPath,
    entry.moduleRoot,
    entry.moduleRoot,
    entry.projectRoot
  );
  const relativeEntryPoint = path3__namespace.default.relative(entry.moduleRoot, entry.file).replaceAll("\\", "/");
  if (Array.isArray(rules)) {
    rules = parseRules(rules);
  }
  const modules = (await matchFiles(files, entry.moduleRoot, rules)).filter((m7) => m7.name !== relativeEntryPoint).map((m7) => ({
    ...m7,
    name: m7.name
  }));
  const isPythonEntrypoint = getBundleType(entry.format, entry.file) === "python";
  if (isPythonEntrypoint) {
    if (fs29.existsSync(path3__namespace.default.resolve(entry.projectRoot, "cf-requirements.txt"))) {
      logger.warn(
        "Found a `cf-requirements.txt` file. cf-requirements.txt is no longer used, instead put your dependencies in pyproject.toml and use pywrangler."
      );
    }
    const pythonModulesDir = path3__namespace.default.resolve(entry.projectRoot, "python_modules");
    const pythonModulesDirInModuleRoot = path3__namespace.default.resolve(
      entry.moduleRoot,
      "python_modules"
    );
    const pythonModulesExistsInModuleRoot = fs29.existsSync(
      pythonModulesDirInModuleRoot
    );
    if (pythonModulesExistsInModuleRoot && entry.projectRoot !== entry.moduleRoot) {
      throw new UserError(
        "The 'python_modules' directory cannot exist in your module root. Delete it to continue."
      );
    }
    const pythonModulesExists = fs29.existsSync(pythonModulesDir);
    if (pythonModulesExists) {
      const pythonModulesFiles = getFiles(
        entry.file,
        pythonModulesDir,
        pythonModulesDir,
        entry.projectRoot
      );
      const vendoredRules = [
        { type: "Data", globs: ["**/*"], fallthrough: true }
      ];
      const vendoredModules = (await matchFiles(pythonModulesFiles, pythonModulesDir, {
        rules: vendoredRules,
        removedRules: []
      })).filter((m7) => {
        for (const pattern of pythonModulesExcludes) {
          const regexp = (0, import_glob_to_regexp.default)(pattern, { globstar: true });
          if (regexp.test(m7.name)) {
            return false;
          }
        }
        return true;
      }).map((m7) => {
        const prefixedPath = `python_modules/${m7.name}`;
        return {
          ...m7,
          name: prefixedPath
        };
      });
      modules.push(...vendoredModules);
    } else {
      logger.debug(
        "Python entrypoint detected, but no python_modules directory found."
      );
    }
  }
  if (attachSourcemaps) {
    modules.forEach((module2) => tryAttachSourcemapToModule(module2));
  }
  if (modules.length > 0) {
    logger.info(`Attaching additional modules:`);
    const filteredModules = removePythonVendorModules(
      isPythonEntrypoint,
      modules
    );
    const vendorModulesSize = getPythonVendorModulesSize(modules);
    const totalSize = modules.reduce(
      (previous, { content }) => previous + content.length,
      0
    );
    const tableEntries = [
      ...filteredModules.map(({ name: name2, type, content }) => {
        return {
          Name: name2,
          Type: type ?? "",
          Size: type === "python-requirement" ? "" : `${(content.length / 1024).toFixed(2)} KiB`
        };
      })
    ];
    if (isPythonEntrypoint && vendorModulesSize > 0) {
      tableEntries.push({
        Name: "Vendored Modules",
        Type: "",
        Size: `${(vendorModulesSize / 1024).toFixed(2)} KiB`
      });
    }
    tableEntries.push({
      Name: `Total (${modules.length} module${modules.length > 1 ? "s" : ""})`,
      Type: "",
      Size: `${(totalSize / 1024).toFixed(2)} KiB`
    });
    logger.table(tableEntries);
  }
  return modules;
}
async function matchFiles(files, relativeTo, { rules, removedRules }) {
  const modules = [];
  const moduleNames = /* @__PURE__ */ new Set();
  for await (const filePath of files) {
    for (const rule of rules) {
      for (const glob of rule.globs) {
        const regexp = (0, import_glob_to_regexp.default)(glob, {
          globstar: true
        });
        if (!regexp.test(filePath)) {
          continue;
        }
        const absoluteFilePath = path3__namespace.default.join(relativeTo, filePath);
        const fileContent = await fs9.readFile(
          absoluteFilePath
        );
        const module2 = {
          name: filePath,
          content: fileContent,
          filePath: absoluteFilePath,
          type: RuleTypeToModuleType[rule.type]
        };
        if (!moduleNames.has(module2.name)) {
          moduleNames.add(module2.name);
          modules.push(module2);
        } else {
          logger.warn(
            `Ignoring duplicate module: ${source_default.blue(
              module2.name
            )} (${source_default.green(module2.type ?? "")})`
          );
        }
      }
    }
    for (const rule of removedRules) {
      for (const glob of rule.globs) {
        const regexp = (0, import_glob_to_regexp.default)(glob);
        if (regexp.test(filePath)) {
          throw new UserError(
            `The file ${filePath} matched a module rule in your configuration (${JSON.stringify(
              rule
            )}), but was ignored because a previous rule with the same type was not marked as \`fallthrough = true\`.`
          );
        }
      }
    }
  }
  return modules;
}
async function* findAdditionalModuleWatchDirs(root) {
  yield root;
  for (const entry of await fs9.readdir(root, { withFileTypes: true })) {
    if (entry.isDirectory()) {
      if (entry.name === "node_modules" || entry.name === ".git") {
        continue;
      }
      yield* findAdditionalModuleWatchDirs(path3__namespace.default.join(root, entry.name));
    }
  }
}
async function writeAdditionalModules(modules, destination) {
  for (const module2 of modules) {
    const modulePath = path3__namespace.default.resolve(destination, module2.name);
    logger.debug("Writing additional module to output", modulePath);
    await fs9.mkdir(path3__namespace.default.dirname(modulePath), { recursive: true });
    await fs9.writeFile(modulePath, module2.content);
    if (module2.sourceMap) {
      const sourcemapPath = path3__namespace.default.resolve(destination, module2.sourceMap.name);
      await fs9.writeFile(sourcemapPath, module2.sourceMap.content);
    }
  }
}
var import_glob_to_regexp;
var init_find_additional_modules = __esm({
  "src/deployment-bundle/find-additional-modules.ts"() {
    init_import_meta_url();
    init_dist();
    init_source();
    import_glob_to_regexp = __toESM(require_glob_to_regexp());
    init_logger();
    init_paths();
    init_bundle_type();
    init_module_collection();
    init_rules();
    init_source_maps();
    __name(getFiles, "getFiles");
    __name(isPythonVendorModule, "isPythonVendorModule");
    __name(removePythonVendorModules, "removePythonVendorModules");
    __name(getPythonVendorModulesSize, "getPythonVendorModulesSize");
    __name(findAdditionalModules, "findAdditionalModules");
    __name(matchFiles, "matchFiles");
    __name(findAdditionalModuleWatchDirs, "findAdditionalModuleWatchDirs");
    __name(writeAdditionalModules, "writeAdditionalModules");
  }
});
function flipObject(obj) {
  return Object.fromEntries(
    Object.entries(obj).filter(([_5, v8]) => !!v8).map(([k7, v8]) => [v8, k7])
  );
}
function stripQueryString(modulePath) {
  const queryIndex = modulePath.indexOf("?");
  return queryIndex !== -1 ? modulePath.slice(0, queryIndex) : modulePath;
}
function createModuleCollector(props) {
  const parsedRules = parseRules(props.rules);
  const modules = [];
  return {
    modules,
    plugin: {
      name: "wrangler-module-collector",
      setup(build5) {
        let foundModulePaths = [];
        build5.onStart(async () => {
          modules.splice(0);
          if (props.findAdditionalModules) {
            if (props.entry.format !== "modules") {
              const error2 = "`find_additional_modules` can only be used with an ES module entrypoint.\nRemove `find_additional_modules = true` from your configuration, or migrate to the ES module Worker format: https://developers.cloudflare.com/workers/learning/migrate-to-module-workers/";
              return { errors: [{ text: error2 }] };
            }
            const found = await findAdditionalModules(props.entry, parsedRules);
            foundModulePaths = found.map(
              ({ name: name2 }) => path3__namespace.default.resolve(props.entry.moduleRoot, name2)
            );
            modules.push(...found);
          }
        });
        build5.onResolve({ filter: modulesWatchRegexp }, (args) => {
          return { namespace: modulesWatchNamespace, path: args.path };
        });
        build5.onLoad(
          { namespace: modulesWatchNamespace, filter: modulesWatchRegexp },
          async () => {
            let watchFiles = [];
            const watchDirs = [];
            if (props.findAdditionalModules) {
              watchFiles = foundModulePaths;
              const root = path3__namespace.default.resolve(props.entry.moduleRoot);
              for await (const dir2 of findAdditionalModuleWatchDirs(root)) {
                watchDirs.push(dir2);
              }
            }
            return { contents: "", loader: "js", watchFiles, watchDirs };
          }
        );
        const rulesMatchers = parsedRules.rules.flatMap((rule) => {
          return rule.globs.map((glob) => {
            const regex2 = (0, import_glob_to_regexp2.default)(glob);
            return {
              regex: regex2,
              rule
            };
          });
        });
        if (props.wrangler1xLegacyModuleReferences && props.wrangler1xLegacyModuleReferences.fileNames.size > 0) {
          build5.onResolve(
            {
              filter: new RegExp(
                "^(" + [...props.wrangler1xLegacyModuleReferences.fileNames].map((name2) => name2.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|") + ")$"
              )
            },
            async (args) => {
              if (args.kind !== "import-statement" && args.kind !== "require-call") {
                return;
              }
              logger.warn(
                `Deprecation: detected a legacy module import in "./${path3__namespace.default.relative(
                  process.cwd(),
                  args.importer
                )}". This will stop working in the future. Replace references to "${args.path}" with "./${args.path}";`
              );
              const cleanedPath = stripQueryString(args.path);
              const filePath = path3__namespace.default.join(
                // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
                props.wrangler1xLegacyModuleReferences.rootDirectory,
                cleanedPath
              );
              const fileContent = await fs9.readFile(
                filePath
              );
              const fileHash = crypto2__default.default.createHash("sha1").update(fileContent).digest("hex");
              const fileName = props.preserveFileNames ? cleanedPath : `./${fileHash}-${path3__namespace.default.basename(cleanedPath)}`;
              const { rule } = rulesMatchers.find(({ regex: regex2 }) => regex2.test(fileName)) || {};
              if (rule) {
                modules.push({
                  name: fileName,
                  filePath,
                  content: fileContent,
                  type: RuleTypeToModuleType[rule.type]
                });
                return {
                  path: fileName,
                  // change the reference to the changed module
                  external: props.entry.format === "modules",
                  // mark it as external in the bundle
                  namespace: `wrangler-module-${rule.type}`,
                  // just a tag, this isn't strictly necessary
                  watchFiles: [filePath]
                  // we also add the file to esbuild's watch list
                };
              }
            }
          );
        }
        parsedRules.rules?.forEach((rule) => {
          if (!props.findAdditionalModules && isJavaScriptModuleRule(rule)) {
            return;
          }
          rule.globs.forEach((glob) => {
            build5.onResolve(
              { filter: (0, import_glob_to_regexp2.default)(glob) },
              async (args) => {
                if (args.pluginData?.skip) {
                  return;
                }
                const cleanedPath = stripQueryString(args.path);
                let filePath = path3__namespace.default.join(args.resolveDir, cleanedPath);
                if (foundModulePaths.includes(filePath)) {
                  return { path: cleanedPath, external: true };
                }
                if (isJavaScriptModuleRule(rule)) {
                  return;
                }
                try {
                  const resolved = await build5.resolve(cleanedPath, {
                    kind: args.kind,
                    importer: args.importer,
                    resolveDir: args.resolveDir,
                    pluginData: {
                      skip: true
                    }
                  });
                  if (resolved.path) {
                    filePath = resolved.path;
                  }
                } catch {
                }
                try {
                  const resolved = (0, import_resolve.sync)(cleanedPath, {
                    basedir: args.resolveDir
                  });
                  filePath = resolved;
                } catch {
                }
                const fileContent = await fs9.readFile(
                  filePath
                );
                const fileHash = crypto2__default.default.createHash("sha1").update(fileContent).digest("hex");
                const fileName = props.preserveFileNames ? cleanedPath : `./${fileHash}-${path3__namespace.default.basename(cleanedPath)}`;
                modules.push({
                  name: fileName,
                  filePath,
                  content: fileContent,
                  type: RuleTypeToModuleType[rule.type]
                });
                return {
                  path: fileName,
                  // change the reference to the changed module
                  external: props.entry.format === "modules",
                  // mark it as external in the bundle
                  namespace: `wrangler-module-${rule.type}`,
                  // just a tag, this isn't strictly necessary
                  watchFiles: [filePath]
                  // we also add the file to esbuild's watch list
                };
              }
            );
            if (props.entry.format === "service-worker") {
              build5.onLoad(
                { filter: (0, import_glob_to_regexp2.default)(glob) },
                async (args) => {
                  return {
                    // We replace the the module with an identifier
                    // that we'll separately add to the form upload
                    // as part of [wasm_modules]/[text_blobs]/[data_blobs]. This identifier has to be a valid
                    // JS identifier, so we replace all non alphanumeric characters
                    // with an underscore.
                    contents: `export default ${args.path.replace(
                      /[^a-zA-Z0-9_$]/g,
                      "_"
                    )};`
                  };
                }
              );
            }
          });
        });
        parsedRules.removedRules.forEach((rule) => {
          rule.globs.forEach((glob) => {
            build5.onResolve(
              { filter: (0, import_glob_to_regexp2.default)(glob) },
              async (args) => {
                throw new UserError(
                  `The file ${args.path} matched a module rule in your configuration (${JSON.stringify(
                    rule
                  )}), but was ignored because a previous rule with the same type was not marked as \`fallthrough = true\`.`
                );
              }
            );
          });
        });
      }
    }
  };
}
function getWrangler1xLegacyModuleReferences(rootDirectory, entryPath) {
  return {
    rootDirectory,
    fileNames: new Set(
      fs29.readdirSync(rootDirectory, { withFileTypes: true }).filter(
        (dirEntry) => dirEntry.isFile() && dirEntry.name !== path3__namespace.default.basename(entryPath)
      ).map((dirEnt) => dirEnt.name)
    )
  };
}
var import_glob_to_regexp2, import_resolve, RuleTypeToModuleType, ModuleTypeToRuleType, modulesWatchRegexp, modulesWatchNamespace, noopModuleCollector;
var init_module_collection = __esm({
  "src/deployment-bundle/module-collection.ts"() {
    init_import_meta_url();
    init_dist();
    import_glob_to_regexp2 = __toESM(require_glob_to_regexp());
    import_resolve = __toESM(require_resolve());
    init_logger();
    init_find_additional_modules();
    init_rules();
    __name(flipObject, "flipObject");
    RuleTypeToModuleType = {
      ESModule: "esm",
      CommonJS: "commonjs",
      CompiledWasm: "compiled-wasm",
      Data: "buffer",
      Text: "text",
      PythonModule: "python",
      PythonRequirement: "python-requirement"
    };
    ModuleTypeToRuleType = flipObject(RuleTypeToModuleType);
    __name(stripQueryString, "stripQueryString");
    modulesWatchRegexp = /^wrangler:modules-watch$/;
    modulesWatchNamespace = "wrangler-modules-watch";
    noopModuleCollector = {
      modules: [],
      plugin: {
        name: "wrangler-module-collector",
        setup: /* @__PURE__ */ __name((build5) => {
          build5.onResolve({ filter: modulesWatchRegexp }, (args) => {
            return { namespace: modulesWatchNamespace, path: args.path };
          });
          build5.onLoad(
            { namespace: modulesWatchNamespace, filter: modulesWatchRegexp },
            () => ({ contents: "", loader: "js" })
          );
        }, "setup")
      }
    };
    __name(createModuleCollector, "createModuleCollector");
    __name(getWrangler1xLegacyModuleReferences, "getWrangler1xLegacyModuleReferences");
  }
});
function withSourceURL(source, sourcePath) {
  return `${source}
//# sourceURL=${Url.pathToFileURL(sourcePath)}`;
}
function withSourceURLs(entrypointPath, entrypointSource, modules) {
  if (!entrypointPath.endsWith(".py")) {
    entrypointSource = withSourceURL(entrypointSource, entrypointPath);
  }
  modules = modules.map((module2) => {
    if (module2.filePath !== void 0 && (module2.type === "esm" || module2.type === "commonjs")) {
      let newContent = module2.content.toString();
      newContent = withSourceURL(newContent, module2.filePath);
      return { ...module2, content: newContent };
    } else {
      return module2;
    }
  });
  return { entrypointSource, modules };
}
var init_source_url = __esm({
  "src/deployment-bundle/source-url.ts"() {
    init_import_meta_url();
    __name(withSourceURL, "withSourceURL");
    __name(withSourceURLs, "withSourceURLs");
  }
});
function getProcessInfo(pid) {
  try {
    const output = childProcess.execSync(`ps -p ${pid} -o pid=,ppid=,command=`, {
      encoding: "utf8",
      timeout: 5e3
      // 5 second timeout
    }).trim();
    if (!output) {
      return null;
    }
    const [pidStr, ppidStr, ...commandParts] = output.split(/\s+/);
    const parsedPid = pidStr ? parseInt(pidStr, 10) : NaN;
    const parsedPpid = ppidStr ? parseInt(ppidStr, 10) : NaN;
    if (isNaN(parsedPid) || isNaN(parsedPpid)) {
      return null;
    }
    return {
      pid: parsedPid,
      ppid: parsedPpid,
      command: commandParts.join(" ") || void 0
    };
  } catch (error2) {
    if (error2 instanceof Error && error2.message.includes("timeout")) {
      console.warn(`Process lookup timed out for PID ${pid}`);
    }
    return null;
  }
}
function getAncestryUnix(startPid) {
  const result = [];
  const visited = /* @__PURE__ */ new Set();
  let currentPid = startPid;
  let maxDepth = 1e3;
  while (currentPid && maxDepth > 0) {
    if (visited.has(currentPid)) {
      console.warn(`Detected cycle in process tree at PID ${currentPid}`);
      break;
    }
    visited.add(currentPid);
    const info = getProcessInfo(currentPid);
    if (!info || info.ppid === 0 || info.ppid === 1) break;
    result.push(info);
    currentPid = info.ppid;
    maxDepth--;
  }
  if (maxDepth === 0) {
    console.warn(`Reached maximum depth limit while traversing process tree from PID ${startPid}`);
  }
  return result;
}
function getProcessInfo2(pid) {
  try {
    const output = childProcess.execSync(
      `wmic process where (ProcessId=${pid}) get ProcessId,ParentProcessId,CommandLine /format:csv`,
      {
        encoding: "utf8",
        timeout: 1e4
        // 10 second timeout (wmic can be slower)
      }
    );
    if (!output) {
      return null;
    }
    const lines = output.split("\n").filter((line) => line.trim() && !line.startsWith("Node"));
    const fields = lines.pop()?.split(",");
    if (!fields || fields.length < 4) return null;
    const [_node, commandLine, parentPid, thisPid] = fields;
    const parsedPid = thisPid ? parseInt(thisPid.trim(), 10) : NaN;
    const parsedPpid = parentPid ? parseInt(parentPid.trim(), 10) : NaN;
    if (isNaN(parsedPid) || isNaN(parsedPpid)) {
      return null;
    }
    return {
      pid: parsedPid,
      ppid: parsedPpid,
      command: commandLine?.trim() || void 0
    };
  } catch (error2) {
    if (error2 instanceof Error && error2.message.includes("timeout")) {
      console.warn(`Process lookup timed out for PID ${pid}`);
    }
    return null;
  }
}
function getAncestryWindows(startPid) {
  const result = [];
  const visited = /* @__PURE__ */ new Set();
  let currentPid = startPid;
  let maxDepth = 1e3;
  while (currentPid && maxDepth > 0) {
    if (visited.has(currentPid)) {
      console.warn(`Detected cycle in process tree at PID ${currentPid}`);
      break;
    }
    visited.add(currentPid);
    const info = getProcessInfo2(currentPid);
    if (!info || info.ppid === 0 || info.ppid === 4) break;
    result.push(info);
    currentPid = info.ppid;
    maxDepth--;
  }
  if (maxDepth === 0) {
    console.warn(`Reached maximum depth limit while traversing process tree from PID ${startPid}`);
  }
  return result;
}
function getProcessAncestry(pid = process.pid) {
  if (typeof pid !== "number" || !Number.isInteger(pid) || pid <= 0) {
    throw new Error("PID must be a positive integer");
  }
  if (os11__namespace.default.platform() === "win32") {
    return getAncestryWindows(pid);
  } else {
    return getAncestryUnix(pid);
  }
}
var init_dist2 = __esm({
  "../../node_modules/.pnpm/process-ancestry@0.0.2/node_modules/process-ancestry/dist/index.js"() {
    init_import_meta_url();
    __name(getProcessInfo, "getProcessInfo");
    __name(getAncestryUnix, "getAncestryUnix");
    __name(getProcessInfo2, "getProcessInfo2");
    __name(getAncestryWindows, "getAncestryWindows");
    __name(getProcessAncestry, "getProcessAncestry");
  }
});

// ../../node_modules/.pnpm/am-i-vibing@0.1.0/node_modules/am-i-vibing/dist/detector-LEsE74_L.js
function checkEnvVar(envVarDef, env6 = process.env) {
  const [envVar, expectedValue] = typeof envVarDef === "string" ? [envVarDef, void 0] : envVarDef;
  const actualValue = env6[envVar];
  return Boolean(actualValue && (!expectedValue || actualValue === expectedValue));
}
function checkProcess(processName, processAncestry) {
  try {
    const ancestry = processAncestry ?? getProcessAncestry();
    for (const ancestorProcess of ancestry) if (ancestorProcess.command?.includes(processName)) return true;
  } catch (error2) {
  }
  return false;
}
function checkEnvVars(definition, env6 = process.env) {
  if (typeof definition === "string" || Array.isArray(definition)) return checkEnvVar(definition, env6);
  const { any, all: all3, none } = definition;
  const anyResult = !any?.length || any.some((envVar) => checkEnvVar(envVar, env6));
  const allResult = !all3?.length || all3.every((envVar) => checkEnvVar(envVar, env6));
  const noneResult = !none?.length || !none.some((envVar) => checkEnvVar(envVar, env6));
  return anyResult && allResult && noneResult;
}
function runCustomDetectors(provider) {
  return provider.customDetectors?.some((detector) => {
    try {
      return detector();
    } catch {
      return false;
    }
  }) ?? false;
}
function createDetectedResult(provider) {
  return {
    isAgentic: true,
    id: provider.id,
    name: provider.name,
    type: provider.type
  };
}
function detectAgenticEnvironment(env6 = process.env, processAncestry) {
  for (const provider of providers) {
    if (provider.envVars?.some((group) => checkEnvVars(group, env6))) return createDetectedResult(provider);
    if (provider.processChecks?.some((processName) => checkProcess(processName, processAncestry))) return createDetectedResult(provider);
    if (runCustomDetectors(provider)) return createDetectedResult(provider);
  }
  return {
    isAgentic: false,
    id: null,
    name: null,
    type: null
  };
}
var providers;
var init_detector_LEsE74_L = __esm({
  "../../node_modules/.pnpm/am-i-vibing@0.1.0/node_modules/am-i-vibing/dist/detector-LEsE74_L.js"() {
    init_import_meta_url();
    init_dist2();
    providers = [
      {
        id: "sst-opencode",
        name: "SST OpenCode",
        type: "agent",
        envVars: [{ any: [
          "OPENCODE_BIN_PATH",
          "OPENCODE_SERVER",
          "OPENCODE_APP_INFO",
          "OPENCODE_MODES"
        ] }]
      },
      {
        id: "jules",
        name: "Jules",
        type: "agent",
        envVars: [{ all: [["HOME", "/home/jules"], ["USER", "swebot"]] }]
      },
      {
        id: "claude-code",
        name: "Claude Code",
        type: "agent",
        envVars: ["CLAUDECODE"]
      },
      {
        id: "cursor-agent",
        name: "Cursor Agent",
        type: "agent",
        envVars: [{ all: ["CURSOR_TRACE_ID", ["PAGER", "head -n 10000 | cat"]] }]
      },
      {
        id: "cursor",
        name: "Cursor",
        type: "interactive",
        envVars: ["CURSOR_TRACE_ID"]
      },
      {
        id: "gemini-agent",
        name: "Gemini Agent",
        type: "agent",
        processChecks: ["gemini"]
      },
      {
        id: "codex",
        name: "OpenAI Codex",
        type: "agent",
        processChecks: ["codex"]
      },
      {
        id: "replit",
        name: "Replit",
        type: "agent",
        envVars: ["REPL_ID"]
      },
      {
        id: "aider",
        name: "Aider",
        type: "agent",
        envVars: ["AIDER_API_KEY"],
        processChecks: ["aider"]
      },
      {
        id: "bolt-agent",
        name: "Bolt.new Agent",
        type: "agent",
        envVars: [{ all: [["SHELL", "/bin/jsh"], "npm_config_yes"] }]
      },
      {
        id: "bolt",
        name: "Bolt.new",
        type: "interactive",
        envVars: [{
          all: [["SHELL", "/bin/jsh"]],
          none: ["npm_config_yes"]
        }]
      },
      {
        id: "zed-agent",
        name: "Zed Agent",
        type: "agent",
        envVars: [{ all: [["TERM_PROGRAM", "zed"], ["PAGER", "cat"]] }]
      },
      {
        id: "zed",
        name: "Zed",
        type: "interactive",
        envVars: [{
          all: [["TERM_PROGRAM", "zed"]],
          none: [["PAGER", "cat"]]
        }]
      },
      {
        id: "replit-assistant",
        name: "Replit Assistant",
        type: "agent",
        envVars: [{ all: ["REPL_ID", ["REPLIT_MODE", "assistant"]] }]
      },
      {
        id: "replit",
        name: "Replit",
        type: "interactive",
        envVars: [{
          all: ["REPL_ID"],
          none: [["REPLIT_MODE", "assistant"]]
        }]
      },
      {
        id: "windsurf",
        name: "Windsurf",
        type: "agent",
        envVars: ["CODEIUM_EDITOR_APP_ROOT"]
      },
      {
        id: "crush",
        name: "Crush",
        type: "agent",
        processChecks: ["crush"]
      },
      {
        id: "vscode-copilot-agent",
        name: "GitHub Copilot in VS Code",
        type: "agent",
        envVars: [{ all: [["TERM_PROGRAM", "vscode"], ["GIT_PAGER", "cat"]] }]
      },
      {
        id: "warp",
        name: "Warp Terminal",
        type: "hybrid",
        envVars: [{ all: [["TERM_PROGRAM", "WarpTerminal"]] }]
      },
      {
        id: "octofriend",
        name: "Octofriend",
        type: "agent",
        processChecks: ["octofriend"]
      }
    ];
    __name(checkEnvVar, "checkEnvVar");
    __name(checkProcess, "checkProcess");
    __name(checkEnvVars, "checkEnvVars");
    __name(runCustomDetectors, "runCustomDetectors");
    __name(createDetectedResult, "createDetectedResult");
    __name(detectAgenticEnvironment, "detectAgenticEnvironment");
  }
});

// ../../node_modules/.pnpm/am-i-vibing@0.1.0/node_modules/am-i-vibing/dist/index.js
var init_dist3 = __esm({
  "../../node_modules/.pnpm/am-i-vibing@0.1.0/node_modules/am-i-vibing/dist/index.js"() {
    init_import_meta_url();
    init_detector_LEsE74_L();
  }
});

// ../../node_modules/.pnpm/ci-info@4.4.0/node_modules/ci-info/vendors.json
var require_vendors = __commonJS({
  "../../node_modules/.pnpm/ci-info@4.4.0/node_modules/ci-info/vendors.json"(exports, module2) {
    module2.exports = [
      {
        name: "Agola CI",
        constant: "AGOLA",
        env: "AGOLA_GIT_REF",
        pr: "AGOLA_PULL_REQUEST_ID"
      },
      {
        name: "Alpic",
        constant: "ALPIC",
        env: "ALPIC_HOST"
      },
      {
        name: "Appcircle",
        constant: "APPCIRCLE",
        env: "AC_APPCIRCLE",
        pr: {
          env: "AC_GIT_PR",
          ne: "false"
        }
      },
      {
        name: "AppVeyor",
        constant: "APPVEYOR",
        env: "APPVEYOR",
        pr: "APPVEYOR_PULL_REQUEST_NUMBER"
      },
      {
        name: "AWS CodeBuild",
        constant: "CODEBUILD",
        env: "CODEBUILD_BUILD_ARN",
        pr: {
          env: "CODEBUILD_WEBHOOK_EVENT",
          any: [
            "PULL_REQUEST_CREATED",
            "PULL_REQUEST_UPDATED",
            "PULL_REQUEST_REOPENED"
          ]
        }
      },
      {
        name: "Azure Pipelines",
        constant: "AZURE_PIPELINES",
        env: "TF_BUILD",
        pr: {
          BUILD_REASON: "PullRequest"
        }
      },
      {
        name: "Bamboo",
        constant: "BAMBOO",
        env: "bamboo_planKey"
      },
      {
        name: "Bitbucket Pipelines",
        constant: "BITBUCKET",
        env: "BITBUCKET_COMMIT",
        pr: "BITBUCKET_PR_ID"
      },
      {
        name: "Bitrise",
        constant: "BITRISE",
        env: "BITRISE_IO",
        pr: "BITRISE_PULL_REQUEST"
      },
      {
        name: "Buddy",
        constant: "BUDDY",
        env: "BUDDY_WORKSPACE_ID",
        pr: "BUDDY_EXECUTION_PULL_REQUEST_ID"
      },
      {
        name: "Buildkite",
        constant: "BUILDKITE",
        env: "BUILDKITE",
        pr: {
          env: "BUILDKITE_PULL_REQUEST",
          ne: "false"
        }
      },
      {
        name: "CircleCI",
        constant: "CIRCLE",
        env: "CIRCLECI",
        pr: "CIRCLE_PULL_REQUEST"
      },
      {
        name: "Cirrus CI",
        constant: "CIRRUS",
        env: "CIRRUS_CI",
        pr: "CIRRUS_PR"
      },
      {
        name: "Cloudflare Pages",
        constant: "CLOUDFLARE_PAGES",
        env: "CF_PAGES"
      },
      {
        name: "Cloudflare Workers",
        constant: "CLOUDFLARE_WORKERS",
        env: "WORKERS_CI"
      },
      {
        name: "Codefresh",
        constant: "CODEFRESH",
        env: "CF_BUILD_ID",
        pr: {
          any: [
            "CF_PULL_REQUEST_NUMBER",
            "CF_PULL_REQUEST_ID"
          ]
        }
      },
      {
        name: "Codemagic",
        constant: "CODEMAGIC",
        env: "CM_BUILD_ID",
        pr: "CM_PULL_REQUEST"
      },
      {
        name: "Codeship",
        constant: "CODESHIP",
        env: {
          CI_NAME: "codeship"
        }
      },
      {
        name: "Drone",
        constant: "DRONE",
        env: "DRONE",
        pr: {
          DRONE_BUILD_EVENT: "pull_request"
        }
      },
      {
        name: "dsari",
        constant: "DSARI",
        env: "DSARI"
      },
      {
        name: "Earthly",
        constant: "EARTHLY",
        env: "EARTHLY_CI"
      },
      {
        name: "Expo Application Services",
        constant: "EAS",
        env: "EAS_BUILD"
      },
      {
        name: "Gerrit",
        constant: "GERRIT",
        env: "GERRIT_PROJECT"
      },
      {
        name: "Gitea Actions",
        constant: "GITEA_ACTIONS",
        env: "GITEA_ACTIONS"
      },
      {
        name: "GitHub Actions",
        constant: "GITHUB_ACTIONS",
        env: "GITHUB_ACTIONS",
        pr: {
          GITHUB_EVENT_NAME: "pull_request"
        }
      },
      {
        name: "GitLab CI",
        constant: "GITLAB",
        env: "GITLAB_CI",
        pr: "CI_MERGE_REQUEST_ID"
      },
      {
        name: "GoCD",
        constant: "GOCD",
        env: "GO_PIPELINE_LABEL"
      },
      {
        name: "Google Cloud Build",
        constant: "GOOGLE_CLOUD_BUILD",
        env: "BUILDER_OUTPUT"
      },
      {
        name: "Harness CI",
        constant: "HARNESS",
        env: "HARNESS_BUILD_ID"
      },
      {
        name: "Heroku",
        constant: "HEROKU",
        env: {
          env: "NODE",
          includes: "/app/.heroku/node/bin/node"
        }
      },
      {
        name: "Hudson",
        constant: "HUDSON",
        env: "HUDSON_URL"
      },
      {
        name: "Jenkins",
        constant: "JENKINS",
        env: [
          "JENKINS_URL",
          "BUILD_ID"
        ],
        pr: {
          any: [
            "ghprbPullId",
            "CHANGE_ID"
          ]
        }
      },
      {
        name: "LayerCI",
        constant: "LAYERCI",
        env: "LAYERCI",
        pr: "LAYERCI_PULL_REQUEST"
      },
      {
        name: "Magnum CI",
        constant: "MAGNUM",
        env: "MAGNUM"
      },
      {
        name: "Netlify CI",
        constant: "NETLIFY",
        env: "NETLIFY",
        pr: {
          env: "PULL_REQUEST",
          ne: "false"
        }
      },
      {
        name: "Nevercode",
        constant: "NEVERCODE",
        env: "NEVERCODE",
        pr: {
          env: "NEVERCODE_PULL_REQUEST",
          ne: "false"
        }
      },
      {
        name: "Prow",
        constant: "PROW",
        env: "PROW_JOB_ID"
      },
      {
        name: "ReleaseHub",
        constant: "RELEASEHUB",
        env: "RELEASE_BUILD_ID"
      },
      {
        name: "Render",
        constant: "RENDER",
        env: "RENDER",
        pr: {
          IS_PULL_REQUEST: "true"
        }
      },
      {
        name: "Sail CI",
        constant: "SAIL",
        env: "SAILCI",
        pr: "SAIL_PULL_REQUEST_NUMBER"
      },
      {
        name: "Screwdriver",
        constant: "SCREWDRIVER",
        env: "SCREWDRIVER",
        pr: {
          env: "SD_PULL_REQUEST",
          ne: "false"
        }
      },
      {
        name: "Semaphore",
        constant: "SEMAPHORE",
        env: "SEMAPHORE",
        pr: "PULL_REQUEST_NUMBER"
      },
      {
        name: "Sourcehut",
        constant: "SOURCEHUT",
        env: {
          CI_NAME: "sourcehut"
        }
      },
      {
        name: "Strider CD",
        constant: "STRIDER",
        env: "STRIDER"
      },
      {
        name: "TaskCluster",
        constant: "TASKCLUSTER",
        env: [
          "TASK_ID",
          "RUN_ID"
        ]
      },
      {
        name: "TeamCity",
        constant: "TEAMCITY",
        env: "TEAMCITY_VERSION"
      },
      {
        name: "Travis CI",
        constant: "TRAVIS",
        env: "TRAVIS",
        pr: {
          env: "TRAVIS_PULL_REQUEST",
          ne: "false"
        }
      },
      {
        name: "Vela",
        constant: "VELA",
        env: "VELA",
        pr: {
          VELA_PULL_REQUEST: "1"
        }
      },
      {
        name: "Vercel",
        constant: "VERCEL",
        env: {
          any: [
            "NOW_BUILDER",
            "VERCEL"
          ]
        },
        pr: "VERCEL_GIT_PULL_REQUEST_ID"
      },
      {
        name: "Visual Studio App Center",
        constant: "APPCENTER",
        env: "APPCENTER_BUILD_ID"
      },
      {
        name: "Woodpecker",
        constant: "WOODPECKER",
        env: {
          CI: "woodpecker"
        },
        pr: {
          CI_BUILD_EVENT: "pull_request"
        }
      },
      {
        name: "Xcode Cloud",
        constant: "XCODE_CLOUD",
        env: "CI_XCODE_PROJECT",
        pr: "CI_PULL_REQUEST_NUMBER"
      },
      {
        name: "Xcode Server",
        constant: "XCODE_SERVER",
        env: "XCS"
      }
    ];
  }
});

// ../../node_modules/.pnpm/ci-info@4.4.0/node_modules/ci-info/index.js
var require_ci_info = __commonJS({
  "../../node_modules/.pnpm/ci-info@4.4.0/node_modules/ci-info/index.js"(exports) {
    init_import_meta_url();
    var vendors = require_vendors();
    var env6 = process.env;
    Object.defineProperty(exports, "_vendors", {
      value: vendors.map(function(v8) {
        return v8.constant;
      })
    });
    exports.name = null;
    exports.isPR = null;
    exports.id = null;
    if (env6.CI !== "false") {
      vendors.forEach(function(vendor) {
        const envs = Array.isArray(vendor.env) ? vendor.env : [vendor.env];
        const isCI = envs.every(function(obj) {
          return checkEnv(obj);
        });
        exports[vendor.constant] = isCI;
        if (!isCI) {
          return;
        }
        exports.name = vendor.name;
        exports.isPR = checkPR(vendor);
        exports.id = vendor.constant;
      });
    }
    exports.isCI = !!(env6.CI !== "false" && // Bypass all checks if CI env is explicitly set to 'false'
    (env6.BUILD_ID || // Jenkins, Cloudbees
    env6.BUILD_NUMBER || // Jenkins, TeamCity
    env6.CI || // Travis CI, CircleCI, Cirrus CI, Gitlab CI, Appveyor, CodeShip, dsari, Cloudflare Pages/Workers
    env6.CI_APP_ID || // Appflow
    env6.CI_BUILD_ID || // Appflow
    env6.CI_BUILD_NUMBER || // Appflow
    env6.CI_NAME || // Codeship and others
    env6.CONTINUOUS_INTEGRATION || // Travis CI, Cirrus CI
    env6.RUN_ID || // TaskCluster, dsari
    exports.name || false));
    function checkEnv(obj) {
      if (typeof obj === "string") return !!env6[obj];
      if ("env" in obj) {
        return env6[obj.env] && env6[obj.env].includes(obj.includes);
      }
      if ("any" in obj) {
        return obj.any.some(function(k7) {
          return !!env6[k7];
        });
      }
      return Object.keys(obj).every(function(k7) {
        return env6[k7] === obj[k7];
      });
    }
    __name(checkEnv, "checkEnv");
    function checkPR(vendor) {
      switch (typeof vendor.pr) {
        case "string":
          return !!env6[vendor.pr];
        case "object":
          if ("env" in vendor.pr) {
            if ("any" in vendor.pr) {
              return vendor.pr.any.some(function(key) {
                return env6[vendor.pr.env] === key;
              });
            } else {
              return vendor.pr.env in env6 && env6[vendor.pr.env] !== vendor.pr.ne;
            }
          } else if ("any" in vendor.pr) {
            return vendor.pr.any.some(function(key) {
              return !!env6[key];
            });
          } else {
            return checkEnv(vendor.pr);
          }
        default:
          return null;
      }
    }
    __name(checkPR, "checkPR");
  }
});

// ../../node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js
var require_src2 = __commonJS({
  "../../node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js"(exports, module2) {
    init_import_meta_url();
    var ESC2 = "\x1B";
    var CSI = `${ESC2}[`;
    var beep = "\x07";
    var cursor = {
      to(x7, y5) {
        if (!y5) return `${CSI}${x7 + 1}G`;
        return `${CSI}${y5 + 1};${x7 + 1}H`;
      },
      move(x7, y5) {
        let ret = "";
        if (x7 < 0) ret += `${CSI}${-x7}D`;
        else if (x7 > 0) ret += `${CSI}${x7}C`;
        if (y5 < 0) ret += `${CSI}${-y5}A`;
        else if (y5 > 0) ret += `${CSI}${y5}B`;
        return ret;
      },
      up: /* @__PURE__ */ __name((count = 1) => `${CSI}${count}A`, "up"),
      down: /* @__PURE__ */ __name((count = 1) => `${CSI}${count}B`, "down"),
      forward: /* @__PURE__ */ __name((count = 1) => `${CSI}${count}C`, "forward"),
      backward: /* @__PURE__ */ __name((count = 1) => `${CSI}${count}D`, "backward"),
      nextLine: /* @__PURE__ */ __name((count = 1) => `${CSI}E`.repeat(count), "nextLine"),
      prevLine: /* @__PURE__ */ __name((count = 1) => `${CSI}F`.repeat(count), "prevLine"),
      left: `${CSI}G`,
      hide: `${CSI}?25l`,
      show: `${CSI}?25h`,
      save: `${ESC2}7`,
      restore: `${ESC2}8`
    };
    var scroll = {
      up: /* @__PURE__ */ __name((count = 1) => `${CSI}S`.repeat(count), "up"),
      down: /* @__PURE__ */ __name((count = 1) => `${CSI}T`.repeat(count), "down")
    };
    var erase = {
      screen: `${CSI}2J`,
      up: /* @__PURE__ */ __name((count = 1) => `${CSI}1J`.repeat(count), "up"),
      down: /* @__PURE__ */ __name((count = 1) => `${CSI}J`.repeat(count), "down"),
      line: `${CSI}2K`,
      lineEnd: `${CSI}K`,
      lineStart: `${CSI}1K`,
      lines(count) {
        let clear = "";
        for (let i7 = 0; i7 < count; i7++)
          clear += this.line + (i7 < count - 1 ? cursor.up() : "");
        if (count)
          clear += cursor.left;
        return clear;
      }
    };
    module2.exports = { cursor, scroll, erase, beep };
  }
});

// ../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js
var require_picocolors = __commonJS({
  "../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js"(exports, module2) {
    init_import_meta_url();
    var p7 = process || {};
    var argv = p7.argv || [];
    var env6 = p7.env || {};
    var isColorSupported = !(!!env6.NO_COLOR || argv.includes("--no-color")) && (!!env6.FORCE_COLOR || argv.includes("--color") || p7.platform === "win32" || (p7.stdout || {}).isTTY && env6.TERM !== "dumb" || !!env6.CI);
    var formatter = /* @__PURE__ */ __name((open3, close2, replace = open3) => (input) => {
      let string = "" + input, index = string.indexOf(close2, open3.length);
      return ~index ? open3 + replaceClose(string, close2, replace, index) + close2 : open3 + string + close2;
    }, "formatter");
    var replaceClose = /* @__PURE__ */ __name((string, close2, replace, index) => {
      let result = "", cursor = 0;
      do {
        result += string.substring(cursor, index) + replace;
        cursor = index + close2.length;
        index = string.indexOf(close2, cursor);
      } while (~index);
      return result + string.substring(cursor);
    }, "replaceClose");
    var createColors = /* @__PURE__ */ __name((enabled = isColorSupported) => {
      let f8 = enabled ? formatter : () => String;
      return {
        isColorSupported: enabled,
        reset: f8("\x1B[0m", "\x1B[0m"),
        bold: f8("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
        dim: f8("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
        italic: f8("\x1B[3m", "\x1B[23m"),
        underline: f8("\x1B[4m", "\x1B[24m"),
        inverse: f8("\x1B[7m", "\x1B[27m"),
        hidden: f8("\x1B[8m", "\x1B[28m"),
        strikethrough: f8("\x1B[9m", "\x1B[29m"),
        black: f8("\x1B[30m", "\x1B[39m"),
        red: f8("\x1B[31m", "\x1B[39m"),
        green: f8("\x1B[32m", "\x1B[39m"),
        yellow: f8("\x1B[33m", "\x1B[39m"),
        blue: f8("\x1B[34m", "\x1B[39m"),
        magenta: f8("\x1B[35m", "\x1B[39m"),
        cyan: f8("\x1B[36m", "\x1B[39m"),
        white: f8("\x1B[37m", "\x1B[39m"),
        gray: f8("\x1B[90m", "\x1B[39m"),
        bgBlack: f8("\x1B[40m", "\x1B[49m"),
        bgRed: f8("\x1B[41m", "\x1B[49m"),
        bgGreen: f8("\x1B[42m", "\x1B[49m"),
        bgYellow: f8("\x1B[43m", "\x1B[49m"),
        bgBlue: f8("\x1B[44m", "\x1B[49m"),
        bgMagenta: f8("\x1B[45m", "\x1B[49m"),
        bgCyan: f8("\x1B[46m", "\x1B[49m"),
        bgWhite: f8("\x1B[47m", "\x1B[49m"),
        blackBright: f8("\x1B[90m", "\x1B[39m"),
        redBright: f8("\x1B[91m", "\x1B[39m"),
        greenBright: f8("\x1B[92m", "\x1B[39m"),
        yellowBright: f8("\x1B[93m", "\x1B[39m"),
        blueBright: f8("\x1B[94m", "\x1B[39m"),
        magentaBright: f8("\x1B[95m", "\x1B[39m"),
        cyanBright: f8("\x1B[96m", "\x1B[39m"),
        whiteBright: f8("\x1B[97m", "\x1B[39m"),
        bgBlackBright: f8("\x1B[100m", "\x1B[49m"),
        bgRedBright: f8("\x1B[101m", "\x1B[49m"),
        bgGreenBright: f8("\x1B[102m", "\x1B[49m"),
        bgYellowBright: f8("\x1B[103m", "\x1B[49m"),
        bgBlueBright: f8("\x1B[104m", "\x1B[49m"),
        bgMagentaBright: f8("\x1B[105m", "\x1B[49m"),
        bgCyanBright: f8("\x1B[106m", "\x1B[49m"),
        bgWhiteBright: f8("\x1B[107m", "\x1B[49m")
      };
    }, "createColors");
    module2.exports = createColors();
    module2.exports.createColors = createColors;
  }
});
function z2({ onlyFirst: t13 = false } = {}) {
  const u7 = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");
  return new RegExp(u7, t13 ? void 0 : "g");
}
function $(t13) {
  if (typeof t13 != "string") throw new TypeError(`Expected a \`string\`, got \`${typeof t13}\``);
  return t13.replace(z2(), "");
}
function c(t13, u7 = {}) {
  if (typeof t13 != "string" || t13.length === 0 || (u7 = { ambiguousIsNarrow: true, ...u7 }, t13 = $(t13), t13.length === 0)) return 0;
  t13 = t13.replace(Y(), "  ");
  const F4 = u7.ambiguousIsNarrow ? 1 : 2;
  let e10 = 0;
  for (const s7 of t13) {
    const C4 = s7.codePointAt(0);
    if (C4 <= 31 || C4 >= 127 && C4 <= 159 || C4 >= 768 && C4 <= 879) continue;
    switch (K.eastAsianWidth(s7)) {
      case "F":
      case "W":
        e10 += 2;
        break;
      case "A":
        e10 += F4;
        break;
      default:
        e10 += 1;
    }
  }
  return e10;
}
function U() {
  const t13 = /* @__PURE__ */ new Map();
  for (const [u7, F4] of Object.entries(r)) {
    for (const [e10, s7] of Object.entries(F4)) r[e10] = { open: `\x1B[${s7[0]}m`, close: `\x1B[${s7[1]}m` }, F4[e10] = r[e10], t13.set(s7[0], s7[1]);
    Object.defineProperty(r, u7, { value: F4, enumerable: false });
  }
  return Object.defineProperty(r, "codes", { value: t13, enumerable: false }), r.color.close = "\x1B[39m", r.bgColor.close = "\x1B[49m", r.color.ansi = L(), r.color.ansi256 = M(), r.color.ansi16m = T(), r.bgColor.ansi = L(v), r.bgColor.ansi256 = M(v), r.bgColor.ansi16m = T(v), Object.defineProperties(r, { rgbToAnsi256: { value: /* @__PURE__ */ __name((u7, F4, e10) => u7 === F4 && F4 === e10 ? u7 < 8 ? 16 : u7 > 248 ? 231 : Math.round((u7 - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(u7 / 255 * 5) + 6 * Math.round(F4 / 255 * 5) + Math.round(e10 / 255 * 5), "value"), enumerable: false }, hexToRgb: { value: /* @__PURE__ */ __name((u7) => {
    const F4 = /[a-f\d]{6}|[a-f\d]{3}/i.exec(u7.toString(16));
    if (!F4) return [0, 0, 0];
    let [e10] = F4;
    e10.length === 3 && (e10 = [...e10].map((C4) => C4 + C4).join(""));
    const s7 = Number.parseInt(e10, 16);
    return [s7 >> 16 & 255, s7 >> 8 & 255, s7 & 255];
  }, "value"), enumerable: false }, hexToAnsi256: { value: /* @__PURE__ */ __name((u7) => r.rgbToAnsi256(...r.hexToRgb(u7)), "value"), enumerable: false }, ansi256ToAnsi: { value: /* @__PURE__ */ __name((u7) => {
    if (u7 < 8) return 30 + u7;
    if (u7 < 16) return 90 + (u7 - 8);
    let F4, e10, s7;
    if (u7 >= 232) F4 = ((u7 - 232) * 10 + 8) / 255, e10 = F4, s7 = F4;
    else {
      u7 -= 16;
      const i7 = u7 % 36;
      F4 = Math.floor(u7 / 36) / 5, e10 = Math.floor(i7 / 6) / 5, s7 = i7 % 6 / 5;
    }
    const C4 = Math.max(F4, e10, s7) * 2;
    if (C4 === 0) return 30;
    let D4 = 30 + (Math.round(s7) << 2 | Math.round(e10) << 1 | Math.round(F4));
    return C4 === 2 && (D4 += 60), D4;
  }, "value"), enumerable: false }, rgbToAnsi: { value: /* @__PURE__ */ __name((u7, F4, e10) => r.ansi256ToAnsi(r.rgbToAnsi256(u7, F4, e10)), "value"), enumerable: false }, hexToAnsi: { value: /* @__PURE__ */ __name((u7) => r.ansi256ToAnsi(r.hexToAnsi256(u7)), "value"), enumerable: false } }), r;
}
function P(t13, u7, F4) {
  return String(t13).normalize().replace(/\r\n/g, `
`).split(`
`).map((e10) => uD(e10, u7, F4)).join(`
`);
}
function FD(t13, u7) {
  if (t13 === u7) return;
  const F4 = t13.split(`
`), e10 = u7.split(`
`), s7 = [];
  for (let C4 = 0; C4 < Math.max(F4.length, e10.length); C4++) F4[C4] !== e10[C4] && s7.push(C4);
  return s7;
}
function eD(t13) {
  return t13 === R;
}
function g(t13, u7) {
  t13.isTTY && t13.setRawMode(u7);
}
var import_sisteransi, import_picocolors, m, G, K, Y, v, L, M, T, r, Z, H, q, p, J, b, W, Q, I, w, N, j, X, _, DD, uD, R, V, tD, h, sD, iD, ED, oD;
var init_dist4 = __esm({
  "../../node_modules/.pnpm/@clack+core@0.3.2/node_modules/@clack/core/dist/index.mjs"() {
    init_import_meta_url();
    import_sisteransi = __toESM(require_src2(), 1);
    import_picocolors = __toESM(require_picocolors(), 1);
    __name(z2, "z");
    __name($, "$");
    m = {};
    G = { get exports() {
      return m;
    }, set exports(t13) {
      m = t13;
    } };
    (function(t13) {
      var u7 = {};
      t13.exports = u7, u7.eastAsianWidth = function(e10) {
        var s7 = e10.charCodeAt(0), C4 = e10.length == 2 ? e10.charCodeAt(1) : 0, D4 = s7;
        return 55296 <= s7 && s7 <= 56319 && 56320 <= C4 && C4 <= 57343 && (s7 &= 1023, C4 &= 1023, D4 = s7 << 10 | C4, D4 += 65536), D4 == 12288 || 65281 <= D4 && D4 <= 65376 || 65504 <= D4 && D4 <= 65510 ? "F" : D4 == 8361 || 65377 <= D4 && D4 <= 65470 || 65474 <= D4 && D4 <= 65479 || 65482 <= D4 && D4 <= 65487 || 65490 <= D4 && D4 <= 65495 || 65498 <= D4 && D4 <= 65500 || 65512 <= D4 && D4 <= 65518 ? "H" : 4352 <= D4 && D4 <= 4447 || 4515 <= D4 && D4 <= 4519 || 4602 <= D4 && D4 <= 4607 || 9001 <= D4 && D4 <= 9002 || 11904 <= D4 && D4 <= 11929 || 11931 <= D4 && D4 <= 12019 || 12032 <= D4 && D4 <= 12245 || 12272 <= D4 && D4 <= 12283 || 12289 <= D4 && D4 <= 12350 || 12353 <= D4 && D4 <= 12438 || 12441 <= D4 && D4 <= 12543 || 12549 <= D4 && D4 <= 12589 || 12593 <= D4 && D4 <= 12686 || 12688 <= D4 && D4 <= 12730 || 12736 <= D4 && D4 <= 12771 || 12784 <= D4 && D4 <= 12830 || 12832 <= D4 && D4 <= 12871 || 12880 <= D4 && D4 <= 13054 || 13056 <= D4 && D4 <= 19903 || 19968 <= D4 && D4 <= 42124 || 42128 <= D4 && D4 <= 42182 || 43360 <= D4 && D4 <= 43388 || 44032 <= D4 && D4 <= 55203 || 55216 <= D4 && D4 <= 55238 || 55243 <= D4 && D4 <= 55291 || 63744 <= D4 && D4 <= 64255 || 65040 <= D4 && D4 <= 65049 || 65072 <= D4 && D4 <= 65106 || 65108 <= D4 && D4 <= 65126 || 65128 <= D4 && D4 <= 65131 || 110592 <= D4 && D4 <= 110593 || 127488 <= D4 && D4 <= 127490 || 127504 <= D4 && D4 <= 127546 || 127552 <= D4 && D4 <= 127560 || 127568 <= D4 && D4 <= 127569 || 131072 <= D4 && D4 <= 194367 || 177984 <= D4 && D4 <= 196605 || 196608 <= D4 && D4 <= 262141 ? "W" : 32 <= D4 && D4 <= 126 || 162 <= D4 && D4 <= 163 || 165 <= D4 && D4 <= 166 || D4 == 172 || D4 == 175 || 10214 <= D4 && D4 <= 10221 || 10629 <= D4 && D4 <= 10630 ? "Na" : D4 == 161 || D4 == 164 || 167 <= D4 && D4 <= 168 || D4 == 170 || 173 <= D4 && D4 <= 174 || 176 <= D4 && D4 <= 180 || 182 <= D4 && D4 <= 186 || 188 <= D4 && D4 <= 191 || D4 == 198 || D4 == 208 || 215 <= D4 && D4 <= 216 || 222 <= D4 && D4 <= 225 || D4 == 230 || 232 <= D4 && D4 <= 234 || 236 <= D4 && D4 <= 237 || D4 == 240 || 242 <= D4 && D4 <= 243 || 247 <= D4 && D4 <= 250 || D4 == 252 || D4 == 254 || D4 == 257 || D4 == 273 || D4 == 275 || D4 == 283 || 294 <= D4 && D4 <= 295 || D4 == 299 || 305 <= D4 && D4 <= 307 || D4 == 312 || 319 <= D4 && D4 <= 322 || D4 == 324 || 328 <= D4 && D4 <= 331 || D4 == 333 || 338 <= D4 && D4 <= 339 || 358 <= D4 && D4 <= 359 || D4 == 363 || D4 == 462 || D4 == 464 || D4 == 466 || D4 == 468 || D4 == 470 || D4 == 472 || D4 == 474 || D4 == 476 || D4 == 593 || D4 == 609 || D4 == 708 || D4 == 711 || 713 <= D4 && D4 <= 715 || D4 == 717 || D4 == 720 || 728 <= D4 && D4 <= 731 || D4 == 733 || D4 == 735 || 768 <= D4 && D4 <= 879 || 913 <= D4 && D4 <= 929 || 931 <= D4 && D4 <= 937 || 945 <= D4 && D4 <= 961 || 963 <= D4 && D4 <= 969 || D4 == 1025 || 1040 <= D4 && D4 <= 1103 || D4 == 1105 || D4 == 8208 || 8211 <= D4 && D4 <= 8214 || 8216 <= D4 && D4 <= 8217 || 8220 <= D4 && D4 <= 8221 || 8224 <= D4 && D4 <= 8226 || 8228 <= D4 && D4 <= 8231 || D4 == 8240 || 8242 <= D4 && D4 <= 8243 || D4 == 8245 || D4 == 8251 || D4 == 8254 || D4 == 8308 || D4 == 8319 || 8321 <= D4 && D4 <= 8324 || D4 == 8364 || D4 == 8451 || D4 == 8453 || D4 == 8457 || D4 == 8467 || D4 == 8470 || 8481 <= D4 && D4 <= 8482 || D4 == 8486 || D4 == 8491 || 8531 <= D4 && D4 <= 8532 || 8539 <= D4 && D4 <= 8542 || 8544 <= D4 && D4 <= 8555 || 8560 <= D4 && D4 <= 8569 || D4 == 8585 || 8592 <= D4 && D4 <= 8601 || 8632 <= D4 && D4 <= 8633 || D4 == 8658 || D4 == 8660 || D4 == 8679 || D4 == 8704 || 8706 <= D4 && D4 <= 8707 || 8711 <= D4 && D4 <= 8712 || D4 == 8715 || D4 == 8719 || D4 == 8721 || D4 == 8725 || D4 == 8730 || 8733 <= D4 && D4 <= 8736 || D4 == 8739 || D4 == 8741 || 8743 <= D4 && D4 <= 8748 || D4 == 8750 || 8756 <= D4 && D4 <= 8759 || 8764 <= D4 && D4 <= 8765 || D4 == 8776 || D4 == 8780 || D4 == 8786 || 8800 <= D4 && D4 <= 8801 || 8804 <= D4 && D4 <= 8807 || 8810 <= D4 && D4 <= 8811 || 8814 <= D4 && D4 <= 8815 || 8834 <= D4 && D4 <= 8835 || 8838 <= D4 && D4 <= 8839 || D4 == 8853 || D4 == 8857 || D4 == 8869 || D4 == 8895 || D4 == 8978 || 9312 <= D4 && D4 <= 9449 || 9451 <= D4 && D4 <= 9547 || 9552 <= D4 && D4 <= 9587 || 9600 <= D4 && D4 <= 9615 || 9618 <= D4 && D4 <= 9621 || 9632 <= D4 && D4 <= 9633 || 9635 <= D4 && D4 <= 9641 || 9650 <= D4 && D4 <= 9651 || 9654 <= D4 && D4 <= 9655 || 9660 <= D4 && D4 <= 9661 || 9664 <= D4 && D4 <= 9665 || 9670 <= D4 && D4 <= 9672 || D4 == 9675 || 9678 <= D4 && D4 <= 9681 || 9698 <= D4 && D4 <= 9701 || D4 == 9711 || 9733 <= D4 && D4 <= 9734 || D4 == 9737 || 9742 <= D4 && D4 <= 9743 || 9748 <= D4 && D4 <= 9749 || D4 == 9756 || D4 == 9758 || D4 == 9792 || D4 == 9794 || 9824 <= D4 && D4 <= 9825 || 9827 <= D4 && D4 <= 9829 || 9831 <= D4 && D4 <= 9834 || 9836 <= D4 && D4 <= 9837 || D4 == 9839 || 9886 <= D4 && D4 <= 9887 || 9918 <= D4 && D4 <= 9919 || 9924 <= D4 && D4 <= 9933 || 9935 <= D4 && D4 <= 9953 || D4 == 9955 || 9960 <= D4 && D4 <= 9983 || D4 == 10045 || D4 == 10071 || 10102 <= D4 && D4 <= 10111 || 11093 <= D4 && D4 <= 11097 || 12872 <= D4 && D4 <= 12879 || 57344 <= D4 && D4 <= 63743 || 65024 <= D4 && D4 <= 65039 || D4 == 65533 || 127232 <= D4 && D4 <= 127242 || 127248 <= D4 && D4 <= 127277 || 127280 <= D4 && D4 <= 127337 || 127344 <= D4 && D4 <= 127386 || 917760 <= D4 && D4 <= 917999 || 983040 <= D4 && D4 <= 1048573 || 1048576 <= D4 && D4 <= 1114109 ? "A" : "N";
      }, u7.characterLength = function(e10) {
        var s7 = this.eastAsianWidth(e10);
        return s7 == "F" || s7 == "W" || s7 == "A" ? 2 : 1;
      };
      function F4(e10) {
        return e10.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || [];
      }
      __name(F4, "F");
      u7.length = function(e10) {
        for (var s7 = F4(e10), C4 = 0, D4 = 0; D4 < s7.length; D4++) C4 = C4 + this.characterLength(s7[D4]);
        return C4;
      }, u7.slice = function(e10, s7, C4) {
        textLen = u7.length(e10), s7 = s7 || 0, C4 = C4 || 1, s7 < 0 && (s7 = textLen + s7), C4 < 0 && (C4 = textLen + C4);
        for (var D4 = "", i7 = 0, o7 = F4(e10), E4 = 0; E4 < o7.length; E4++) {
          var a7 = o7[E4], n9 = u7.length(a7);
          if (i7 >= s7 - (n9 == 2 ? 1 : 0)) if (i7 + n9 <= C4) D4 += a7;
          else break;
          i7 += n9;
        }
        return D4;
      };
    })(G);
    K = m;
    Y = /* @__PURE__ */ __name(function() {
      return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g;
    }, "Y");
    __name(c, "c");
    v = 10;
    L = /* @__PURE__ */ __name((t13 = 0) => (u7) => `\x1B[${u7 + t13}m`, "L");
    M = /* @__PURE__ */ __name((t13 = 0) => (u7) => `\x1B[${38 + t13};5;${u7}m`, "M");
    T = /* @__PURE__ */ __name((t13 = 0) => (u7, F4, e10) => `\x1B[${38 + t13};2;${u7};${F4};${e10}m`, "T");
    r = { modifier: { reset: [0, 0], bold: [1, 22], dim: [2, 22], italic: [3, 23], underline: [4, 24], overline: [53, 55], inverse: [7, 27], hidden: [8, 28], strikethrough: [9, 29] }, color: { black: [30, 39], red: [31, 39], green: [32, 39], yellow: [33, 39], blue: [34, 39], magenta: [35, 39], cyan: [36, 39], white: [37, 39], blackBright: [90, 39], gray: [90, 39], grey: [90, 39], redBright: [91, 39], greenBright: [92, 39], yellowBright: [93, 39], blueBright: [94, 39], magentaBright: [95, 39], cyanBright: [96, 39], whiteBright: [97, 39] }, bgColor: { bgBlack: [40, 49], bgRed: [41, 49], bgGreen: [42, 49], bgYellow: [43, 49], bgBlue: [44, 49], bgMagenta: [45, 49], bgCyan: [46, 49], bgWhite: [47, 49], bgBlackBright: [100, 49], bgGray: [100, 49], bgGrey: [100, 49], bgRedBright: [101, 49], bgGreenBright: [102, 49], bgYellowBright: [103, 49], bgBlueBright: [104, 49], bgMagentaBright: [105, 49], bgCyanBright: [106, 49], bgWhiteBright: [107, 49] } };
    Object.keys(r.modifier);
    Z = Object.keys(r.color);
    H = Object.keys(r.bgColor);
    [...Z, ...H];
    __name(U, "U");
    q = U();
    p = /* @__PURE__ */ new Set(["\x1B", "\x9B"]);
    J = 39;
    b = "\x07";
    W = "[";
    Q = "]";
    I = "m";
    w = `${Q}8;;`;
    N = /* @__PURE__ */ __name((t13) => `${p.values().next().value}${W}${t13}${I}`, "N");
    j = /* @__PURE__ */ __name((t13) => `${p.values().next().value}${w}${t13}${b}`, "j");
    X = /* @__PURE__ */ __name((t13) => t13.split(" ").map((u7) => c(u7)), "X");
    _ = /* @__PURE__ */ __name((t13, u7, F4) => {
      const e10 = [...u7];
      let s7 = false, C4 = false, D4 = c($(t13[t13.length - 1]));
      for (const [i7, o7] of e10.entries()) {
        const E4 = c(o7);
        if (D4 + E4 <= F4 ? t13[t13.length - 1] += o7 : (t13.push(o7), D4 = 0), p.has(o7) && (s7 = true, C4 = e10.slice(i7 + 1).join("").startsWith(w)), s7) {
          C4 ? o7 === b && (s7 = false, C4 = false) : o7 === I && (s7 = false);
          continue;
        }
        D4 += E4, D4 === F4 && i7 < e10.length - 1 && (t13.push(""), D4 = 0);
      }
      !D4 && t13[t13.length - 1].length > 0 && t13.length > 1 && (t13[t13.length - 2] += t13.pop());
    }, "_");
    DD = /* @__PURE__ */ __name((t13) => {
      const u7 = t13.split(" ");
      let F4 = u7.length;
      for (; F4 > 0 && !(c(u7[F4 - 1]) > 0); ) F4--;
      return F4 === u7.length ? t13 : u7.slice(0, F4).join(" ") + u7.slice(F4).join("");
    }, "DD");
    uD = /* @__PURE__ */ __name((t13, u7, F4 = {}) => {
      if (F4.trim !== false && t13.trim() === "") return "";
      let e10 = "", s7, C4;
      const D4 = X(t13);
      let i7 = [""];
      for (const [E4, a7] of t13.split(" ").entries()) {
        F4.trim !== false && (i7[i7.length - 1] = i7[i7.length - 1].trimStart());
        let n9 = c(i7[i7.length - 1]);
        if (E4 !== 0 && (n9 >= u7 && (F4.wordWrap === false || F4.trim === false) && (i7.push(""), n9 = 0), (n9 > 0 || F4.trim === false) && (i7[i7.length - 1] += " ", n9++)), F4.hard && D4[E4] > u7) {
          const B4 = u7 - n9, A4 = 1 + Math.floor((D4[E4] - B4 - 1) / u7);
          Math.floor((D4[E4] - 1) / u7) < A4 && i7.push(""), _(i7, a7, u7);
          continue;
        }
        if (n9 + D4[E4] > u7 && n9 > 0 && D4[E4] > 0) {
          if (F4.wordWrap === false && n9 < u7) {
            _(i7, a7, u7);
            continue;
          }
          i7.push("");
        }
        if (n9 + D4[E4] > u7 && F4.wordWrap === false) {
          _(i7, a7, u7);
          continue;
        }
        i7[i7.length - 1] += a7;
      }
      F4.trim !== false && (i7 = i7.map((E4) => DD(E4)));
      const o7 = [...i7.join(`
`)];
      for (const [E4, a7] of o7.entries()) {
        if (e10 += a7, p.has(a7)) {
          const { groups: B4 } = new RegExp(`(?:\\${W}(?<code>\\d+)m|\\${w}(?<uri>.*)${b})`).exec(o7.slice(E4).join("")) || { groups: {} };
          if (B4.code !== void 0) {
            const A4 = Number.parseFloat(B4.code);
            s7 = A4 === J ? void 0 : A4;
          } else B4.uri !== void 0 && (C4 = B4.uri.length === 0 ? void 0 : B4.uri);
        }
        const n9 = q.codes.get(Number(s7));
        o7[E4 + 1] === `
` ? (C4 && (e10 += j("")), s7 && n9 && (e10 += N(n9))) : a7 === `
` && (s7 && n9 && (e10 += N(s7)), C4 && (e10 += j(C4)));
      }
      return e10;
    }, "uD");
    __name(P, "P");
    __name(FD, "FD");
    R = Symbol("clack:cancel");
    __name(eD, "eD");
    __name(g, "g");
    V = /* @__PURE__ */ new Map([["k", "up"], ["j", "down"], ["h", "left"], ["l", "right"]]);
    tD = /* @__PURE__ */ new Set(["up", "down", "left", "right", "space", "enter"]);
    h = class {
      static {
        __name(this, "h");
      }
      constructor({ render: u7, input: F4 = process7.stdin, output: e10 = process7.stdout, ...s7 }, C4 = true) {
        this._track = false, this._cursor = 0, this.state = "initial", this.error = "", this.subscribers = /* @__PURE__ */ new Map(), this._prevFrame = "", this.opts = s7, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = u7.bind(this), this._track = C4, this.input = F4, this.output = e10;
      }
      prompt() {
        const u7 = new tty.WriteStream(0);
        return u7._write = (F4, e10, s7) => {
          this._track && (this.value = this.rl.line.replace(/\t/g, ""), this._cursor = this.rl.cursor, this.emit("value", this.value)), s7();
        }, this.input.pipe(u7), this.rl = S__default.default.createInterface({ input: this.input, output: u7, tabSize: 2, prompt: "", escapeCodeTimeout: 50 }), S__default.default.emitKeypressEvents(this.input, this.rl), this.rl.prompt(), this.opts.initialValue !== void 0 && this._track && this.rl.write(this.opts.initialValue), this.input.on("keypress", this.onKeypress), g(this.input, true), this.output.on("resize", this.render), this.render(), new Promise((F4, e10) => {
          this.once("submit", () => {
            this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), g(this.input, false), F4(this.value);
          }), this.once("cancel", () => {
            this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), g(this.input, false), F4(R);
          });
        });
      }
      on(u7, F4) {
        const e10 = this.subscribers.get(u7) ?? [];
        e10.push({ cb: F4 }), this.subscribers.set(u7, e10);
      }
      once(u7, F4) {
        const e10 = this.subscribers.get(u7) ?? [];
        e10.push({ cb: F4, once: true }), this.subscribers.set(u7, e10);
      }
      emit(u7, ...F4) {
        const e10 = this.subscribers.get(u7) ?? [], s7 = [];
        for (const C4 of e10) C4.cb(...F4), C4.once && s7.push(() => e10.splice(e10.indexOf(C4), 1));
        for (const C4 of s7) C4();
      }
      unsubscribe() {
        this.subscribers.clear();
      }
      onKeypress(u7, F4) {
        if (this.state === "error" && (this.state = "active"), F4?.name && !this._track && V.has(F4.name) && this.emit("cursor", V.get(F4.name)), F4?.name && tD.has(F4.name) && this.emit("cursor", F4.name), u7 && (u7.toLowerCase() === "y" || u7.toLowerCase() === "n") && this.emit("confirm", u7.toLowerCase() === "y"), u7 && this.emit("key", u7.toLowerCase()), F4?.name === "return") {
          if (this.opts.validate) {
            const e10 = this.opts.validate(this.value);
            e10 && (this.error = e10, this.state = "error", this.rl.write(this.value));
          }
          this.state !== "error" && (this.state = "submit");
        }
        u7 === "" && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
      }
      close() {
        this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
`), g(this.input, false), this.rl.close(), this.emit(`${this.state}`, this.value), this.unsubscribe();
      }
      restoreCursor() {
        const u7 = P(this._prevFrame, process.stdout.columns, { hard: true }).split(`
`).length - 1;
        this.output.write(import_sisteransi.cursor.move(-999, u7 * -1));
      }
      render() {
        const u7 = P(this._render(this) ?? "", process.stdout.columns, { hard: true });
        if (u7 !== this._prevFrame) {
          if (this.state === "initial") this.output.write(import_sisteransi.cursor.hide);
          else {
            const F4 = FD(this._prevFrame, u7);
            if (this.restoreCursor(), F4 && F4?.length === 1) {
              const e10 = F4[0];
              this.output.write(import_sisteransi.cursor.move(0, e10)), this.output.write(import_sisteransi.erase.lines(1));
              const s7 = u7.split(`
`);
              this.output.write(s7[e10]), this._prevFrame = u7, this.output.write(import_sisteransi.cursor.move(0, s7.length - e10 - 1));
              return;
            } else if (F4 && F4?.length > 1) {
              const e10 = F4[0];
              this.output.write(import_sisteransi.cursor.move(0, e10)), this.output.write(import_sisteransi.erase.down());
              const C4 = u7.split(`
`).slice(e10);
              this.output.write(C4.join(`
`)), this._prevFrame = u7;
              return;
            }
            this.output.write(import_sisteransi.erase.down());
          }
          this.output.write(u7), this.state === "initial" && (this.state = "active"), this._prevFrame = u7;
        }
      }
    };
    sD = class extends h {
      static {
        __name(this, "sD");
      }
      get cursor() {
        return this.value ? 0 : 1;
      }
      get _value() {
        return this.cursor === 0;
      }
      constructor(u7) {
        super(u7, false), this.value = !!u7.initialValue, this.on("value", () => {
          this.value = this._value;
        }), this.on("confirm", (F4) => {
          this.output.write(import_sisteransi.cursor.move(0, -1)), this.value = F4, this.state = "submit", this.close();
        }), this.on("cursor", () => {
          this.value = !this.value;
        });
      }
    };
    iD = class extends h {
      static {
        __name(this, "iD");
      }
      constructor(u7) {
        super(u7, false), this.cursor = 0, this.options = u7.options, this.value = [...u7.initialValues ?? []], this.cursor = Math.max(this.options.findIndex(({ value: F4 }) => F4 === u7.cursorAt), 0), this.on("key", (F4) => {
          F4 === "a" && this.toggleAll();
        }), this.on("cursor", (F4) => {
          switch (F4) {
            case "left":
            case "up":
              this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
              break;
            case "down":
            case "right":
              this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
              break;
            case "space":
              this.toggleValue();
              break;
          }
        });
      }
      get _value() {
        return this.options[this.cursor].value;
      }
      toggleAll() {
        const u7 = this.value.length === this.options.length;
        this.value = u7 ? [] : this.options.map((F4) => F4.value);
      }
      toggleValue() {
        const u7 = this.value.includes(this._value);
        this.value = u7 ? this.value.filter((F4) => F4 !== this._value) : [...this.value, this._value];
      }
    };
    ED = class extends h {
      static {
        __name(this, "ED");
      }
      constructor(u7) {
        super(u7, false), this.cursor = 0, this.options = u7.options, this.cursor = this.options.findIndex(({ value: F4 }) => F4 === u7.initialValue), this.cursor === -1 && (this.cursor = 0), this.changeValue(), this.on("cursor", (F4) => {
          switch (F4) {
            case "left":
            case "up":
              this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
              break;
            case "down":
            case "right":
              this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
              break;
          }
          this.changeValue();
        });
      }
      get _value() {
        return this.options[this.cursor];
      }
      changeValue() {
        this.value = this._value.value;
      }
    };
    oD = class extends h {
      static {
        __name(this, "oD");
      }
      constructor(u7) {
        super(u7), this.valueWithCursor = "", this.on("finalize", () => {
          this.value || (this.value = u7.defaultValue), this.valueWithCursor = this.value;
        }), this.on("value", () => {
          if (this.cursor >= this.value.length) this.valueWithCursor = `${this.value}${import_picocolors.default.inverse(import_picocolors.default.hidden("_"))}`;
          else {
            const F4 = this.value.slice(0, this.cursor), e10 = this.value.slice(this.cursor);
            this.valueWithCursor = `${F4}${import_picocolors.default.inverse(e10[0])}${e10.slice(1)}`;
          }
        });
      }
      get cursor() {
        return this._cursor;
      }
    };
  }
});

// ../../node_modules/.pnpm/ansi-escapes@5.0.0/node_modules/ansi-escapes/index.js
var ESC, OSC, BEL, SEP, isTerminalApp, ansiEscapes, ansi_escapes_default;
var init_ansi_escapes = __esm({
  "../../node_modules/.pnpm/ansi-escapes@5.0.0/node_modules/ansi-escapes/index.js"() {
    init_import_meta_url();
    ESC = "\x1B[";
    OSC = "\x1B]";
    BEL = "\x07";
    SEP = ";";
    isTerminalApp = process.env.TERM_PROGRAM === "Apple_Terminal";
    ansiEscapes = {};
    ansiEscapes.cursorTo = (x7, y5) => {
      if (typeof x7 !== "number") {
        throw new TypeError("The `x` argument is required");
      }
      if (typeof y5 !== "number") {
        return ESC + (x7 + 1) + "G";
      }
      return ESC + (y5 + 1) + ";" + (x7 + 1) + "H";
    };
    ansiEscapes.cursorMove = (x7, y5) => {
      if (typeof x7 !== "number") {
        throw new TypeError("The `x` argument is required");
      }
      let returnValue = "";
      if (x7 < 0) {
        returnValue += ESC + -x7 + "D";
      } else if (x7 > 0) {
        returnValue += ESC + x7 + "C";
      }
      if (y5 < 0) {
        returnValue += ESC + -y5 + "A";
      } else if (y5 > 0) {
        returnValue += ESC + y5 + "B";
      }
      return returnValue;
    };
    ansiEscapes.cursorUp = (count = 1) => ESC + count + "A";
    ansiEscapes.cursorDown = (count = 1) => ESC + count + "B";
    ansiEscapes.cursorForward = (count = 1) => ESC + count + "C";
    ansiEscapes.cursorBackward = (count = 1) => ESC + count + "D";
    ansiEscapes.cursorLeft = ESC + "G";
    ansiEscapes.cursorSavePosition = isTerminalApp ? "\x1B7" : ESC + "s";
    ansiEscapes.cursorRestorePosition = isTerminalApp ? "\x1B8" : ESC + "u";
    ansiEscapes.cursorGetPosition = ESC + "6n";
    ansiEscapes.cursorNextLine = ESC + "E";
    ansiEscapes.cursorPrevLine = ESC + "F";
    ansiEscapes.cursorHide = ESC + "?25l";
    ansiEscapes.cursorShow = ESC + "?25h";
    ansiEscapes.eraseLines = (count) => {
      let clear = "";
      for (let i7 = 0; i7 < count; i7++) {
        clear += ansiEscapes.eraseLine + (i7 < count - 1 ? ansiEscapes.cursorUp() : "");
      }
      if (count) {
        clear += ansiEscapes.cursorLeft;
      }
      return clear;
    };
    ansiEscapes.eraseEndLine = ESC + "K";
    ansiEscapes.eraseStartLine = ESC + "1K";
    ansiEscapes.eraseLine = ESC + "2K";
    ansiEscapes.eraseDown = ESC + "J";
    ansiEscapes.eraseUp = ESC + "1J";
    ansiEscapes.eraseScreen = ESC + "2J";
    ansiEscapes.scrollUp = ESC + "S";
    ansiEscapes.scrollDown = ESC + "T";
    ansiEscapes.clearScreen = "\x1Bc";
    ansiEscapes.clearTerminal = process.platform === "win32" ? `${ansiEscapes.eraseScreen}${ESC}0f` : (
      // 1. Erases the screen (Only done in case `2` is not supported)
      // 2. Erases the whole screen including scrollback buffer
      // 3. Moves cursor to the top-left position
      // More info: https://www.real-world-systems.com/docs/ANSIcode.html
      `${ansiEscapes.eraseScreen}${ESC}3J${ESC}H`
    );
    ansiEscapes.beep = BEL;
    ansiEscapes.link = (text, url4) => {
      return [
        OSC,
        "8",
        SEP,
        SEP,
        url4,
        BEL,
        text,
        OSC,
        "8",
        SEP,
        SEP,
        BEL
      ].join("");
    };
    ansiEscapes.image = (buffer, options = {}) => {
      let returnValue = `${OSC}1337;File=inline=1`;
      if (options.width) {
        returnValue += `;width=${options.width}`;
      }
      if (options.height) {
        returnValue += `;height=${options.height}`;
      }
      if (options.preserveAspectRatio === false) {
        returnValue += ";preserveAspectRatio=0";
      }
      return returnValue + ":" + buffer.toString("base64") + BEL;
    };
    ansiEscapes.iTerm = {
      setCwd: /* @__PURE__ */ __name((cwd2 = process.cwd()) => `${OSC}50;CurrentDir=${cwd2}${BEL}`, "setCwd"),
      annotation: /* @__PURE__ */ __name((message, options = {}) => {
        let returnValue = `${OSC}1337;`;
        const hasX = typeof options.x !== "undefined";
        const hasY = typeof options.y !== "undefined";
        if ((hasX || hasY) && !(hasX && hasY && typeof options.length !== "undefined")) {
          throw new Error("`x`, `y` and `length` must be defined when `x` or `y` is defined");
        }
        message = message.replace(/\|/g, "");
        returnValue += options.isHidden ? "AddHiddenAnnotation=" : "AddAnnotation=";
        if (options.length > 0) {
          returnValue += (hasX ? [message, options.length, options.x, options.y] : [options.length, message]).join("|");
        } else {
          returnValue += message;
        }
        return returnValue + BEL;
      }, "annotation")
    };
    ansi_escapes_default = ansiEscapes;
  }
});

// ../../node_modules/.pnpm/mimic-fn@2.1.0/node_modules/mimic-fn/index.js
var require_mimic_fn = __commonJS({
  "../../node_modules/.pnpm/mimic-fn@2.1.0/node_modules/mimic-fn/index.js"(exports, module2) {
    init_import_meta_url();
    var mimicFn = /* @__PURE__ */ __name((to, from) => {
      for (const prop of Reflect.ownKeys(from)) {
        Object.defineProperty(to, prop, Object.getOwnPropertyDescriptor(from, prop));
      }
      return to;
    }, "mimicFn");
    module2.exports = mimicFn;
    module2.exports.default = mimicFn;
  }
});

// ../../node_modules/.pnpm/onetime@5.1.2/node_modules/onetime/index.js
var require_onetime = __commonJS({
  "../../node_modules/.pnpm/onetime@5.1.2/node_modules/onetime/index.js"(exports, module2) {
    init_import_meta_url();
    var mimicFn = require_mimic_fn();
    var calledFunctions2 = /* @__PURE__ */ new WeakMap();
    var onetime3 = /* @__PURE__ */ __name((function_, options = {}) => {
      if (typeof function_ !== "function") {
        throw new TypeError("Expected a function");
      }
      let returnValue;
      let callCount = 0;
      const functionName = function_.displayName || function_.name || "<anonymous>";
      const onetime4 = /* @__PURE__ */ __name(function(...arguments_) {
        calledFunctions2.set(onetime4, ++callCount);
        if (callCount === 1) {
          returnValue = function_.apply(this, arguments_);
          function_ = null;
        } else if (options.throw === true) {
          throw new Error(`Function \`${functionName}\` can only be called once`);
        }
        return returnValue;
      }, "onetime");
      mimicFn(onetime4, function_);
      calledFunctions2.set(onetime4, callCount);
      return onetime4;
    }, "onetime");
    module2.exports = onetime3;
    module2.exports.default = onetime3;
    module2.exports.callCount = (function_) => {
      if (!calledFunctions2.has(function_)) {
        throw new Error(`The given function \`${function_.name}\` is not wrapped by the \`onetime\` package`);
      }
      return calledFunctions2.get(function_);
    };
  }
});
var import_onetime, import_signal_exit3, restoreCursor, restore_cursor_default;
var init_restore_cursor = __esm({
  "../../node_modules/.pnpm/restore-cursor@4.0.0/node_modules/restore-cursor/index.js"() {
    init_import_meta_url();
    import_onetime = __toESM(require_onetime(), 1);
    import_signal_exit3 = __toESM(require_signal_exit(), 1);
    restoreCursor = (0, import_onetime.default)(() => {
      (0, import_signal_exit3.default)(() => {
        process7__default.default.stderr.write("\x1B[?25h");
      }, { alwaysLast: true });
    });
    restore_cursor_default = restoreCursor;
  }
});
var isHidden, cliCursor, cli_cursor_default;
var init_cli_cursor = __esm({
  "../../node_modules/.pnpm/cli-cursor@4.0.0/node_modules/cli-cursor/index.js"() {
    init_import_meta_url();
    init_restore_cursor();
    isHidden = false;
    cliCursor = {};
    cliCursor.show = (writableStream = process7__default.default.stderr) => {
      if (!writableStream.isTTY) {
        return;
      }
      isHidden = false;
      writableStream.write("\x1B[?25h");
    };
    cliCursor.hide = (writableStream = process7__default.default.stderr) => {
      if (!writableStream.isTTY) {
        return;
      }
      restore_cursor_default();
      isHidden = true;
      writableStream.write("\x1B[?25l");
    };
    cliCursor.toggle = (force, writableStream) => {
      if (force !== void 0) {
        isHidden = force;
      }
      if (isHidden) {
        cliCursor.show(writableStream);
      } else {
        cliCursor.hide(writableStream);
      }
    };
    cli_cursor_default = cliCursor;
  }
});

// ../../node_modules/.pnpm/ansi-regex@6.0.1/node_modules/ansi-regex/index.js
function ansiRegex({ onlyFirst = false } = {}) {
  const pattern = [
    "[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)",
    "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"
  ].join("|");
  return new RegExp(pattern, onlyFirst ? void 0 : "g");
}
var init_ansi_regex = __esm({
  "../../node_modules/.pnpm/ansi-regex@6.0.1/node_modules/ansi-regex/index.js"() {
    init_import_meta_url();
    __name(ansiRegex, "ansiRegex");
  }
});

// ../../node_modules/.pnpm/strip-ansi@7.1.0/node_modules/strip-ansi/index.js
function stripAnsi2(string) {
  if (typeof string !== "string") {
    throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
  }
  return string.replace(regex, "");
}
var regex;
var init_strip_ansi = __esm({
  "../../node_modules/.pnpm/strip-ansi@7.1.0/node_modules/strip-ansi/index.js"() {
    init_import_meta_url();
    init_ansi_regex();
    regex = ansiRegex();
    __name(stripAnsi2, "stripAnsi");
  }
});

// ../../node_modules/.pnpm/eastasianwidth@0.2.0/node_modules/eastasianwidth/eastasianwidth.js
var require_eastasianwidth = __commonJS({
  "../../node_modules/.pnpm/eastasianwidth@0.2.0/node_modules/eastasianwidth/eastasianwidth.js"(exports, module2) {
    init_import_meta_url();
    var eaw = {};
    if ("undefined" == typeof module2) {
      window.eastasianwidth = eaw;
    } else {
      module2.exports = eaw;
    }
    eaw.eastAsianWidth = function(character) {
      var x7 = character.charCodeAt(0);
      var y5 = character.length == 2 ? character.charCodeAt(1) : 0;
      var codePoint = x7;
      if (55296 <= x7 && x7 <= 56319 && (56320 <= y5 && y5 <= 57343)) {
        x7 &= 1023;
        y5 &= 1023;
        codePoint = x7 << 10 | y5;
        codePoint += 65536;
      }
      if (12288 == codePoint || 65281 <= codePoint && codePoint <= 65376 || 65504 <= codePoint && codePoint <= 65510) {
        return "F";
      }
      if (8361 == codePoint || 65377 <= codePoint && codePoint <= 65470 || 65474 <= codePoint && codePoint <= 65479 || 65482 <= codePoint && codePoint <= 65487 || 65490 <= codePoint && codePoint <= 65495 || 65498 <= codePoint && codePoint <= 65500 || 65512 <= codePoint && codePoint <= 65518) {
        return "H";
      }
      if (4352 <= codePoint && codePoint <= 4447 || 4515 <= codePoint && codePoint <= 4519 || 4602 <= codePoint && codePoint <= 4607 || 9001 <= codePoint && codePoint <= 9002 || 11904 <= codePoint && codePoint <= 11929 || 11931 <= codePoint && codePoint <= 12019 || 12032 <= codePoint && codePoint <= 12245 || 12272 <= codePoint && codePoint <= 12283 || 12289 <= codePoint && codePoint <= 12350 || 12353 <= codePoint && codePoint <= 12438 || 12441 <= codePoint && codePoint <= 12543 || 12549 <= codePoint && codePoint <= 12589 || 12593 <= codePoint && codePoint <= 12686 || 12688 <= codePoint && codePoint <= 12730 || 12736 <= codePoint && codePoint <= 12771 || 12784 <= codePoint && codePoint <= 12830 || 12832 <= codePoint && codePoint <= 12871 || 12880 <= codePoint && codePoint <= 13054 || 13056 <= codePoint && codePoint <= 19903 || 19968 <= codePoint && codePoint <= 42124 || 42128 <= codePoint && codePoint <= 42182 || 43360 <= codePoint && codePoint <= 43388 || 44032 <= codePoint && codePoint <= 55203 || 55216 <= codePoint && codePoint <= 55238 || 55243 <= codePoint && codePoint <= 55291 || 63744 <= codePoint && codePoint <= 64255 || 65040 <= codePoint && codePoint <= 65049 || 65072 <= codePoint && codePoint <= 65106 || 65108 <= codePoint && codePoint <= 65126 || 65128 <= codePoint && codePoint <= 65131 || 110592 <= codePoint && codePoint <= 110593 || 127488 <= codePoint && codePoint <= 127490 || 127504 <= codePoint && codePoint <= 127546 || 127552 <= codePoint && codePoint <= 127560 || 127568 <= codePoint && codePoint <= 127569 || 131072 <= codePoint && codePoint <= 194367 || 177984 <= codePoint && codePoint <= 196605 || 196608 <= codePoint && codePoint <= 262141) {
        return "W";
      }
      if (32 <= codePoint && codePoint <= 126 || 162 <= codePoint && codePoint <= 163 || 165 <= codePoint && codePoint <= 166 || 172 == codePoint || 175 == codePoint || 10214 <= codePoint && codePoint <= 10221 || 10629 <= codePoint && codePoint <= 10630) {
        return "Na";
      }
      if (161 == codePoint || 164 == codePoint || 167 <= codePoint && codePoint <= 168 || 170 == codePoint || 173 <= codePoint && codePoint <= 174 || 176 <= codePoint && codePoint <= 180 || 182 <= codePoint && codePoint <= 186 || 188 <= codePoint && codePoint <= 191 || 198 == codePoint || 208 == codePoint || 215 <= codePoint && codePoint <= 216 || 222 <= codePoint && codePoint <= 225 || 230 == codePoint || 232 <= codePoint && codePoint <= 234 || 236 <= codePoint && codePoint <= 237 || 240 == codePoint || 242 <= codePoint && codePoint <= 243 || 247 <= codePoint && codePoint <= 250 || 252 == codePoint || 254 == codePoint || 257 == codePoint || 273 == codePoint || 275 == codePoint || 283 == codePoint || 294 <= codePoint && codePoint <= 295 || 299 == codePoint || 305 <= codePoint && codePoint <= 307 || 312 == codePoint || 319 <= codePoint && codePoint <= 322 || 324 == codePoint || 328 <= codePoint && codePoint <= 331 || 333 == codePoint || 338 <= codePoint && codePoint <= 339 || 358 <= codePoint && codePoint <= 359 || 363 == codePoint || 462 == codePoint || 464 == codePoint || 466 == codePoint || 468 == codePoint || 470 == codePoint || 472 == codePoint || 474 == codePoint || 476 == codePoint || 593 == codePoint || 609 == codePoint || 708 == codePoint || 711 == codePoint || 713 <= codePoint && codePoint <= 715 || 717 == codePoint || 720 == codePoint || 728 <= codePoint && codePoint <= 731 || 733 == codePoint || 735 == codePoint || 768 <= codePoint && codePoint <= 879 || 913 <= codePoint && codePoint <= 929 || 931 <= codePoint && codePoint <= 937 || 945 <= codePoint && codePoint <= 961 || 963 <= codePoint && codePoint <= 969 || 1025 == codePoint || 1040 <= codePoint && codePoint <= 1103 || 1105 == codePoint || 8208 == codePoint || 8211 <= codePoint && codePoint <= 8214 || 8216 <= codePoint && codePoint <= 8217 || 8220 <= codePoint && codePoint <= 8221 || 8224 <= codePoint && codePoint <= 8226 || 8228 <= codePoint && codePoint <= 8231 || 8240 == codePoint || 8242 <= codePoint && codePoint <= 8243 || 8245 == codePoint || 8251 == codePoint || 8254 == codePoint || 8308 == codePoint || 8319 == codePoint || 8321 <= codePoint && codePoint <= 8324 || 8364 == codePoint || 8451 == codePoint || 8453 == codePoint || 8457 == codePoint || 8467 == codePoint || 8470 == codePoint || 8481 <= codePoint && codePoint <= 8482 || 8486 == codePoint || 8491 == codePoint || 8531 <= codePoint && codePoint <= 8532 || 8539 <= codePoint && codePoint <= 8542 || 8544 <= codePoint && codePoint <= 8555 || 8560 <= codePoint && codePoint <= 8569 || 8585 == codePoint || 8592 <= codePoint && codePoint <= 8601 || 8632 <= codePoint && codePoint <= 8633 || 8658 == codePoint || 8660 == codePoint || 8679 == codePoint || 8704 == codePoint || 8706 <= codePoint && codePoint <= 8707 || 8711 <= codePoint && codePoint <= 8712 || 8715 == codePoint || 8719 == codePoint || 8721 == codePoint || 8725 == codePoint || 8730 == codePoint || 8733 <= codePoint && codePoint <= 8736 || 8739 == codePoint || 8741 == codePoint || 8743 <= codePoint && codePoint <= 8748 || 8750 == codePoint || 8756 <= codePoint && codePoint <= 8759 || 8764 <= codePoint && codePoint <= 8765 || 8776 == codePoint || 8780 == codePoint || 8786 == codePoint || 8800 <= codePoint && codePoint <= 8801 || 8804 <= codePoint && codePoint <= 8807 || 8810 <= codePoint && codePoint <= 8811 || 8814 <= codePoint && codePoint <= 8815 || 8834 <= codePoint && codePoint <= 8835 || 8838 <= codePoint && codePoint <= 8839 || 8853 == codePoint || 8857 == codePoint || 8869 == codePoint || 8895 == codePoint || 8978 == codePoint || 9312 <= codePoint && codePoint <= 9449 || 9451 <= codePoint && codePoint <= 9547 || 9552 <= codePoint && codePoint <= 9587 || 9600 <= codePoint && codePoint <= 9615 || 9618 <= codePoint && codePoint <= 9621 || 9632 <= codePoint && codePoint <= 9633 || 9635 <= codePoint && codePoint <= 9641 || 9650 <= codePoint && codePoint <= 9651 || 9654 <= codePoint && codePoint <= 9655 || 9660 <= codePoint && codePoint <= 9661 || 9664 <= codePoint && codePoint <= 9665 || 9670 <= codePoint && codePoint <= 9672 || 9675 == codePoint || 9678 <= codePoint && codePoint <= 9681 || 9698 <= codePoint && codePoint <= 9701 || 9711 == codePoint || 9733 <= codePoint && codePoint <= 9734 || 9737 == codePoint || 9742 <= codePoint && codePoint <= 9743 || 9748 <= codePoint && codePoint <= 9749 || 9756 == codePoint || 9758 == codePoint || 9792 == codePoint || 9794 == codePoint || 9824 <= codePoint && codePoint <= 9825 || 9827 <= codePoint && codePoint <= 9829 || 9831 <= codePoint && codePoint <= 9834 || 9836 <= codePoint && codePoint <= 9837 || 9839 == codePoint || 9886 <= codePoint && codePoint <= 9887 || 9918 <= codePoint && codePoint <= 9919 || 9924 <= codePoint && codePoint <= 9933 || 9935 <= codePoint && codePoint <= 9953 || 9955 == codePoint || 9960 <= codePoint && codePoint <= 9983 || 10045 == codePoint || 10071 == codePoint || 10102 <= codePoint && codePoint <= 10111 || 11093 <= codePoint && codePoint <= 11097 || 12872 <= codePoint && codePoint <= 12879 || 57344 <= codePoint && codePoint <= 63743 || 65024 <= codePoint && codePoint <= 65039 || 65533 == codePoint || 127232 <= codePoint && codePoint <= 127242 || 127248 <= codePoint && codePoint <= 127277 || 127280 <= codePoint && codePoint <= 127337 || 127344 <= codePoint && codePoint <= 127386 || 917760 <= codePoint && codePoint <= 917999 || 983040 <= codePoint && codePoint <= 1048573 || 1048576 <= codePoint && codePoint <= 1114109) {
        return "A";
      }
      return "N";
    };
    eaw.characterLength = function(character) {
      var code = this.eastAsianWidth(character);
      if (code == "F" || code == "W" || code == "A") {
        return 2;
      } else {
        return 1;
      }
    };
    function stringToArray(string) {
      return string.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || [];
    }
    __name(stringToArray, "stringToArray");
    eaw.length = function(string) {
      var characters = stringToArray(string);
      var len = 0;
      for (var i7 = 0; i7 < characters.length; i7++) {
        len = len + this.characterLength(characters[i7]);
      }
      return len;
    };
    eaw.slice = function(text, start, end) {
      textLen = eaw.length(text);
      start = start ? start : 0;
      end = end ? end : 1;
      if (start < 0) {
        start = textLen + start;
      }
      if (end < 0) {
        end = textLen + end;
      }
      var result = "";
      var eawLen = 0;
      var chars = stringToArray(text);
      for (var i7 = 0; i7 < chars.length; i7++) {
        var char = chars[i7];
        var charLen = eaw.length(char);
        if (eawLen >= start - (charLen == 2 ? 1 : 0)) {
          if (eawLen + charLen <= end) {
            result += char;
          } else {
            break;
          }
        }
        eawLen += charLen;
      }
      return result;
    };
  }
});

// ../../node_modules/.pnpm/emoji-regex@9.2.2/node_modules/emoji-regex/index.js
var require_emoji_regex2 = __commonJS({
  "../../node_modules/.pnpm/emoji-regex@9.2.2/node_modules/emoji-regex/index.js"(exports, module2) {
    init_import_meta_url();
    module2.exports = function() {
      return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g;
    };
  }
});

// ../../node_modules/.pnpm/string-width@5.1.2/node_modules/string-width/index.js
function stringWidth(string, options = {}) {
  if (typeof string !== "string" || string.length === 0) {
    return 0;
  }
  options = {
    ambiguousIsNarrow: true,
    ...options
  };
  string = stripAnsi2(string);
  if (string.length === 0) {
    return 0;
  }
  string = string.replace((0, import_emoji_regex.default)(), "  ");
  const ambiguousCharacterWidth = options.ambiguousIsNarrow ? 1 : 2;
  let width = 0;
  for (const character of string) {
    const codePoint = character.codePointAt(0);
    if (codePoint <= 31 || codePoint >= 127 && codePoint <= 159) {
      continue;
    }
    if (codePoint >= 768 && codePoint <= 879) {
      continue;
    }
    const code = import_eastasianwidth.default.eastAsianWidth(character);
    switch (code) {
      case "F":
      case "W":
        width += 2;
        break;
      case "A":
        width += ambiguousCharacterWidth;
        break;
      default:
        width += 1;
    }
  }
  return width;
}
var import_eastasianwidth, import_emoji_regex;
var init_string_width = __esm({
  "../../node_modules/.pnpm/string-width@5.1.2/node_modules/string-width/index.js"() {
    init_import_meta_url();
    init_strip_ansi();
    import_eastasianwidth = __toESM(require_eastasianwidth(), 1);
    import_emoji_regex = __toESM(require_emoji_regex2(), 1);
    __name(stringWidth, "stringWidth");
  }
});

// ../../node_modules/.pnpm/ansi-styles@6.2.1/node_modules/ansi-styles/index.js
function assembleStyles2() {
  const codes = /* @__PURE__ */ new Map();
  for (const [groupName, group] of Object.entries(styles3)) {
    for (const [styleName, style] of Object.entries(group)) {
      styles3[styleName] = {
        open: `\x1B[${style[0]}m`,
        close: `\x1B[${style[1]}m`
      };
      group[styleName] = styles3[styleName];
      codes.set(style[0], style[1]);
    }
    Object.defineProperty(styles3, groupName, {
      value: group,
      enumerable: false
    });
  }
  Object.defineProperty(styles3, "codes", {
    value: codes,
    enumerable: false
  });
  styles3.color.close = "\x1B[39m";
  styles3.bgColor.close = "\x1B[49m";
  styles3.color.ansi = wrapAnsi162();
  styles3.color.ansi256 = wrapAnsi2562();
  styles3.color.ansi16m = wrapAnsi16m2();
  styles3.bgColor.ansi = wrapAnsi162(ANSI_BACKGROUND_OFFSET2);
  styles3.bgColor.ansi256 = wrapAnsi2562(ANSI_BACKGROUND_OFFSET2);
  styles3.bgColor.ansi16m = wrapAnsi16m2(ANSI_BACKGROUND_OFFSET2);
  Object.defineProperties(styles3, {
    rgbToAnsi256: {
      value: /* @__PURE__ */ __name((red2, green2, blue2) => {
        if (red2 === green2 && green2 === blue2) {
          if (red2 < 8) {
            return 16;
          }
          if (red2 > 248) {
            return 231;
          }
          return Math.round((red2 - 8) / 247 * 24) + 232;
        }
        return 16 + 36 * Math.round(red2 / 255 * 5) + 6 * Math.round(green2 / 255 * 5) + Math.round(blue2 / 255 * 5);
      }, "value"),
      enumerable: false
    },
    hexToRgb: {
      value: /* @__PURE__ */ __name((hex) => {
        const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
        if (!matches) {
          return [0, 0, 0];
        }
        let [colorString] = matches;
        if (colorString.length === 3) {
          colorString = [...colorString].map((character) => character + character).join("");
        }
        const integer = Number.parseInt(colorString, 16);
        return [
          /* eslint-disable no-bitwise */
          integer >> 16 & 255,
          integer >> 8 & 255,
          integer & 255
          /* eslint-enable no-bitwise */
        ];
      }, "value"),
      enumerable: false
    },
    hexToAnsi256: {
      value: /* @__PURE__ */ __name((hex) => styles3.rgbToAnsi256(...styles3.hexToRgb(hex)), "value"),
      enumerable: false
    },
    ansi256ToAnsi: {
      value: /* @__PURE__ */ __name((code) => {
        if (code < 8) {
          return 30 + code;
        }
        if (code < 16) {
          return 90 + (code - 8);
        }
        let red2;
        let green2;
        let blue2;
        if (code >= 232) {
          red2 = ((code - 232) * 10 + 8) / 255;
          green2 = red2;
          blue2 = red2;
        } else {
          code -= 16;
          const remainder = code % 36;
          red2 = Math.floor(code / 36) / 5;
          green2 = Math.floor(remainder / 6) / 5;
          blue2 = remainder % 6 / 5;
        }
        const value = Math.max(red2, green2, blue2) * 2;
        if (value === 0) {
          return 30;
        }
        let result = 30 + (Math.round(blue2) << 2 | Math.round(green2) << 1 | Math.round(red2));
        if (value === 2) {
          result += 60;
        }
        return result;
      }, "value"),
      enumerable: false
    },
    rgbToAnsi: {
      value: /* @__PURE__ */ __name((red2, green2, blue2) => styles3.ansi256ToAnsi(styles3.rgbToAnsi256(red2, green2, blue2)), "value"),
      enumerable: false
    },
    hexToAnsi: {
      value: /* @__PURE__ */ __name((hex) => styles3.ansi256ToAnsi(styles3.hexToAnsi256(hex)), "value"),
      enumerable: false
    }
  });
  return styles3;
}
var ANSI_BACKGROUND_OFFSET2, wrapAnsi162, wrapAnsi2562, wrapAnsi16m2, styles3, foregroundColorNames2, backgroundColorNames2, ansiStyles2, ansi_styles_default2;
var init_ansi_styles2 = __esm({
  "../../node_modules/.pnpm/ansi-styles@6.2.1/node_modules/ansi-styles/index.js"() {
    init_import_meta_url();
    ANSI_BACKGROUND_OFFSET2 = 10;
    wrapAnsi162 = /* @__PURE__ */ __name((offset = 0) => (code) => `\x1B[${code + offset}m`, "wrapAnsi16");
    wrapAnsi2562 = /* @__PURE__ */ __name((offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`, "wrapAnsi256");
    wrapAnsi16m2 = /* @__PURE__ */ __name((offset = 0) => (red2, green2, blue2) => `\x1B[${38 + offset};2;${red2};${green2};${blue2}m`, "wrapAnsi16m");
    styles3 = {
      modifier: {
        reset: [0, 0],
        // 21 isn't widely supported and 22 does the same thing
        bold: [1, 22],
        dim: [2, 22],
        italic: [3, 23],
        underline: [4, 24],
        overline: [53, 55],
        inverse: [7, 27],
        hidden: [8, 28],
        strikethrough: [9, 29]
      },
      color: {
        black: [30, 39],
        red: [31, 39],
        green: [32, 39],
        yellow: [33, 39],
        blue: [34, 39],
        magenta: [35, 39],
        cyan: [36, 39],
        white: [37, 39],
        // Bright color
        blackBright: [90, 39],
        gray: [90, 39],
        // Alias of `blackBright`
        grey: [90, 39],
        // Alias of `blackBright`
        redBright: [91, 39],
        greenBright: [92, 39],
        yellowBright: [93, 39],
        blueBright: [94, 39],
        magentaBright: [95, 39],
        cyanBright: [96, 39],
        whiteBright: [97, 39]
      },
      bgColor: {
        bgBlack: [40, 49],
        bgRed: [41, 49],
        bgGreen: [42, 49],
        bgYellow: [43, 49],
        bgBlue: [44, 49],
        bgMagenta: [45, 49],
        bgCyan: [46, 49],
        bgWhite: [47, 49],
        // Bright color
        bgBlackBright: [100, 49],
        bgGray: [100, 49],
        // Alias of `bgBlackBright`
        bgGrey: [100, 49],
        // Alias of `bgBlackBright`
        bgRedBright: [101, 49],
        bgGreenBright: [102, 49],
        bgYellowBright: [103, 49],
        bgBlueBright: [104, 49],
        bgMagentaBright: [105, 49],
        bgCyanBright: [106, 49],
        bgWhiteBright: [107, 49]
      }
    };
    Object.keys(styles3.modifier);
    foregroundColorNames2 = Object.keys(styles3.color);
    backgroundColorNames2 = Object.keys(styles3.bgColor);
    [...foregroundColorNames2, ...backgroundColorNames2];
    __name(assembleStyles2, "assembleStyles");
    ansiStyles2 = assembleStyles2();
    ansi_styles_default2 = ansiStyles2;
  }
});

// ../../node_modules/.pnpm/wrap-ansi@8.1.0/node_modules/wrap-ansi/index.js
function wrapAnsi(string, columns, options) {
  return String(string).normalize().replace(/\r\n/g, "\n").split("\n").map((line) => exec(line, columns, options)).join("\n");
}
var ESCAPES, END_CODE, ANSI_ESCAPE_BELL, ANSI_CSI, ANSI_OSC, ANSI_SGR_TERMINATOR, ANSI_ESCAPE_LINK, wrapAnsiCode, wrapAnsiHyperlink, wordLengths, wrapWord, stringVisibleTrimSpacesRight, exec;
var init_wrap_ansi = __esm({
  "../../node_modules/.pnpm/wrap-ansi@8.1.0/node_modules/wrap-ansi/index.js"() {
    init_import_meta_url();
    init_string_width();
    init_strip_ansi();
    init_ansi_styles2();
    ESCAPES = /* @__PURE__ */ new Set([
      "\x1B",
      "\x9B"
    ]);
    END_CODE = 39;
    ANSI_ESCAPE_BELL = "\x07";
    ANSI_CSI = "[";
    ANSI_OSC = "]";
    ANSI_SGR_TERMINATOR = "m";
    ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`;
    wrapAnsiCode = /* @__PURE__ */ __name((code) => `${ESCAPES.values().next().value}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`, "wrapAnsiCode");
    wrapAnsiHyperlink = /* @__PURE__ */ __name((uri) => `${ESCAPES.values().next().value}${ANSI_ESCAPE_LINK}${uri}${ANSI_ESCAPE_BELL}`, "wrapAnsiHyperlink");
    wordLengths = /* @__PURE__ */ __name((string) => string.split(" ").map((character) => stringWidth(character)), "wordLengths");
    wrapWord = /* @__PURE__ */ __name((rows, word, columns) => {
      const characters = [...word];
      let isInsideEscape = false;
      let isInsideLinkEscape = false;
      let visible = stringWidth(stripAnsi2(rows[rows.length - 1]));
      for (const [index, character] of characters.entries()) {
        const characterLength = stringWidth(character);
        if (visible + characterLength <= columns) {
          rows[rows.length - 1] += character;
        } else {
          rows.push(character);
          visible = 0;
        }
        if (ESCAPES.has(character)) {
          isInsideEscape = true;
          isInsideLinkEscape = characters.slice(index + 1).join("").startsWith(ANSI_ESCAPE_LINK);
        }
        if (isInsideEscape) {
          if (isInsideLinkEscape) {
            if (character === ANSI_ESCAPE_BELL) {
              isInsideEscape = false;
              isInsideLinkEscape = false;
            }
          } else if (character === ANSI_SGR_TERMINATOR) {
            isInsideEscape = false;
          }
          continue;
        }
        visible += characterLength;
        if (visible === columns && index < characters.length - 1) {
          rows.push("");
          visible = 0;
        }
      }
      if (!visible && rows[rows.length - 1].length > 0 && rows.length > 1) {
        rows[rows.length - 2] += rows.pop();
      }
    }, "wrapWord");
    stringVisibleTrimSpacesRight = /* @__PURE__ */ __name((string) => {
      const words = string.split(" ");
      let last = words.length;
      while (last > 0) {
        if (stringWidth(words[last - 1]) > 0) {
          break;
        }
        last--;
      }
      if (last === words.length) {
        return string;
      }
      return words.slice(0, last).join(" ") + words.slice(last).join("");
    }, "stringVisibleTrimSpacesRight");
    exec = /* @__PURE__ */ __name((string, columns, options = {}) => {
      if (options.trim !== false && string.trim() === "") {
        return "";
      }
      let returnValue = "";
      let escapeCode;
      let escapeUrl;
      const lengths = wordLengths(string);
      let rows = [""];
      for (const [index, word] of string.split(" ").entries()) {
        if (options.trim !== false) {
          rows[rows.length - 1] = rows[rows.length - 1].trimStart();
        }
        let rowLength = stringWidth(rows[rows.length - 1]);
        if (index !== 0) {
          if (rowLength >= columns && (options.wordWrap === false || options.trim === false)) {
            rows.push("");
            rowLength = 0;
          }
          if (rowLength > 0 || options.trim === false) {
            rows[rows.length - 1] += " ";
            rowLength++;
          }
        }
        if (options.hard && lengths[index] > columns) {
          const remainingColumns = columns - rowLength;
          const breaksStartingThisLine = 1 + Math.floor((lengths[index] - remainingColumns - 1) / columns);
          const breaksStartingNextLine = Math.floor((lengths[index] - 1) / columns);
          if (breaksStartingNextLine < breaksStartingThisLine) {
            rows.push("");
          }
          wrapWord(rows, word, columns);
          continue;
        }
        if (rowLength + lengths[index] > columns && rowLength > 0 && lengths[index] > 0) {
          if (options.wordWrap === false && rowLength < columns) {
            wrapWord(rows, word, columns);
            continue;
          }
          rows.push("");
        }
        if (rowLength + lengths[index] > columns && options.wordWrap === false) {
          wrapWord(rows, word, columns);
          continue;
        }
        rows[rows.length - 1] += word;
      }
      if (options.trim !== false) {
        rows = rows.map((row) => stringVisibleTrimSpacesRight(row));
      }
      const pre = [...rows.join("\n")];
      for (const [index, character] of pre.entries()) {
        returnValue += character;
        if (ESCAPES.has(character)) {
          const { groups } = new RegExp(`(?:\\${ANSI_CSI}(?<code>\\d+)m|\\${ANSI_ESCAPE_LINK}(?<uri>.*)${ANSI_ESCAPE_BELL})`).exec(pre.slice(index).join("")) || { groups: {} };
          if (groups.code !== void 0) {
            const code2 = Number.parseFloat(groups.code);
            escapeCode = code2 === END_CODE ? void 0 : code2;
          } else if (groups.uri !== void 0) {
            escapeUrl = groups.uri.length === 0 ? void 0 : groups.uri;
          }
        }
        const code = ansi_styles_default2.codes.get(Number(escapeCode));
        if (pre[index + 1] === "\n") {
          if (escapeUrl) {
            returnValue += wrapAnsiHyperlink("");
          }
          if (escapeCode && code) {
            returnValue += wrapAnsiCode(code);
          }
        } else if (character === "\n") {
          if (escapeCode && code) {
            returnValue += wrapAnsiCode(escapeCode);
          }
          if (escapeUrl) {
            returnValue += wrapAnsiHyperlink(escapeUrl);
          }
        }
      }
      return returnValue;
    }, "exec");
    __name(wrapAnsi, "wrapAnsi");
  }
});

// ../../node_modules/.pnpm/is-fullwidth-code-point@4.0.0/node_modules/is-fullwidth-code-point/index.js
function isFullwidthCodePoint(codePoint) {
  if (!Number.isInteger(codePoint)) {
    return false;
  }
  return codePoint >= 4352 && (codePoint <= 4447 || // Hangul Jamo
  codePoint === 9001 || // LEFT-POINTING ANGLE BRACKET
  codePoint === 9002 || // RIGHT-POINTING ANGLE BRACKET
  // CJK Radicals Supplement .. Enclosed CJK Letters and Months
  11904 <= codePoint && codePoint <= 12871 && codePoint !== 12351 || // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A
  12880 <= codePoint && codePoint <= 19903 || // CJK Unified Ideographs .. Yi Radicals
  19968 <= codePoint && codePoint <= 42182 || // Hangul Jamo Extended-A
  43360 <= codePoint && codePoint <= 43388 || // Hangul Syllables
  44032 <= codePoint && codePoint <= 55203 || // CJK Compatibility Ideographs
  63744 <= codePoint && codePoint <= 64255 || // Vertical Forms
  65040 <= codePoint && codePoint <= 65049 || // CJK Compatibility Forms .. Small Form Variants
  65072 <= codePoint && codePoint <= 65131 || // Halfwidth and Fullwidth Forms
  65281 <= codePoint && codePoint <= 65376 || 65504 <= codePoint && codePoint <= 65510 || // Kana Supplement
  110592 <= codePoint && codePoint <= 110593 || // Enclosed Ideographic Supplement
  127488 <= codePoint && codePoint <= 127569 || // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane
  131072 <= codePoint && codePoint <= 262141);
}
var init_is_fullwidth_code_point = __esm({
  "../../node_modules/.pnpm/is-fullwidth-code-point@4.0.0/node_modules/is-fullwidth-code-point/index.js"() {
    init_import_meta_url();
    __name(isFullwidthCodePoint, "isFullwidthCodePoint");
  }
});

// ../../node_modules/.pnpm/slice-ansi@5.0.0/node_modules/slice-ansi/index.js
function sliceAnsi(string, begin, end) {
  const characters = [...string];
  const ansiCodes = [];
  let stringEnd = typeof end === "number" ? end : characters.length;
  let isInsideEscape = false;
  let ansiCode;
  let visible = 0;
  let output = "";
  for (const [index, character] of characters.entries()) {
    let leftEscape = false;
    if (ESCAPES2.includes(character)) {
      const code = /\d[^m]*/.exec(string.slice(index, index + 18));
      ansiCode = code && code.length > 0 ? code[0] : void 0;
      if (visible < stringEnd) {
        isInsideEscape = true;
        if (ansiCode !== void 0) {
          ansiCodes.push(ansiCode);
        }
      }
    } else if (isInsideEscape && character === "m") {
      isInsideEscape = false;
      leftEscape = true;
    }
    if (!isInsideEscape && !leftEscape) {
      visible++;
    }
    if (!astralRegex.test(character) && isFullwidthCodePoint(character.codePointAt())) {
      visible++;
      if (typeof end !== "number") {
        stringEnd++;
      }
    }
    if (visible > begin && visible <= stringEnd) {
      output += character;
    } else if (visible === begin && !isInsideEscape && ansiCode !== void 0) {
      output = checkAnsi(ansiCodes);
    } else if (visible >= stringEnd) {
      output += checkAnsi(ansiCodes, true, ansiCode);
      break;
    }
  }
  return output;
}
var astralRegex, ESCAPES2, wrapAnsi2, checkAnsi;
var init_slice_ansi = __esm({
  "../../node_modules/.pnpm/slice-ansi@5.0.0/node_modules/slice-ansi/index.js"() {
    init_import_meta_url();
    init_is_fullwidth_code_point();
    init_ansi_styles2();
    astralRegex = /^[\uD800-\uDBFF][\uDC00-\uDFFF]$/;
    ESCAPES2 = [
      "\x1B",
      "\x9B"
    ];
    wrapAnsi2 = /* @__PURE__ */ __name((code) => `${ESCAPES2[0]}[${code}m`, "wrapAnsi");
    checkAnsi = /* @__PURE__ */ __name((ansiCodes, isEscapes, endAnsiCode) => {
      let output = [];
      ansiCodes = [...ansiCodes];
      for (let ansiCode of ansiCodes) {
        const ansiCodeOrigin = ansiCode;
        if (ansiCode.includes(";")) {
          ansiCode = ansiCode.split(";")[0][0] + "0";
        }
        const item = ansi_styles_default2.codes.get(Number.parseInt(ansiCode, 10));
        if (item) {
          const indexEscape = ansiCodes.indexOf(item.toString());
          if (indexEscape === -1) {
            output.push(wrapAnsi2(isEscapes ? item : ansiCodeOrigin));
          } else {
            ansiCodes.splice(indexEscape, 1);
          }
        } else if (isEscapes) {
          output.push(wrapAnsi2(0));
          break;
        } else {
          output.push(wrapAnsi2(ansiCodeOrigin));
        }
      }
      if (isEscapes) {
        output = output.filter((element, index) => output.indexOf(element) === index);
        if (endAnsiCode !== void 0) {
          const fistEscapeCode = wrapAnsi2(ansi_styles_default2.codes.get(Number.parseInt(endAnsiCode, 10)));
          output = output.reduce((current, next) => next === fistEscapeCode ? [next, ...current] : [...current, next], []);
        }
      }
      return output.join("");
    }, "checkAnsi");
    __name(sliceAnsi, "sliceAnsi");
  }
});
function createLogUpdate(stream2, { showCursor: showCursor2 = false } = {}) {
  let previousLineCount = 0;
  let previousWidth = getWidth(stream2);
  let previousOutput = "";
  const render2 = /* @__PURE__ */ __name((...arguments_) => {
    if (!showCursor2) {
      cli_cursor_default.hide();
    }
    let output = arguments_.join(" ") + "\n";
    output = fitToTerminalHeight(stream2, output);
    const width = getWidth(stream2);
    if (output === previousOutput && previousWidth === width) {
      return;
    }
    previousOutput = output;
    previousWidth = width;
    output = wrapAnsi(output, width, {
      trim: false,
      hard: true,
      wordWrap: false
    });
    stream2.write(ansi_escapes_default.eraseLines(previousLineCount) + output);
    previousLineCount = output.split("\n").length;
  }, "render");
  render2.clear = () => {
    stream2.write(ansi_escapes_default.eraseLines(previousLineCount));
    previousOutput = "";
    previousWidth = getWidth(stream2);
    previousLineCount = 0;
  };
  render2.done = () => {
    previousOutput = "";
    previousWidth = getWidth(stream2);
    previousLineCount = 0;
    if (!showCursor2) {
      cli_cursor_default.show();
    }
  };
  return render2;
}
var defaultTerminalHeight, getWidth, fitToTerminalHeight;
var init_log_update = __esm({
  "../../node_modules/.pnpm/log-update@5.0.1/node_modules/log-update/index.js"() {
    init_import_meta_url();
    init_ansi_escapes();
    init_cli_cursor();
    init_wrap_ansi();
    init_slice_ansi();
    init_strip_ansi();
    defaultTerminalHeight = 24;
    getWidth = /* @__PURE__ */ __name((stream2) => {
      const { columns } = stream2;
      if (!columns) {
        return 80;
      }
      return columns;
    }, "getWidth");
    fitToTerminalHeight = /* @__PURE__ */ __name((stream2, text) => {
      const terminalHeight = stream2.rows || defaultTerminalHeight;
      const lines = text.split("\n");
      const toRemove = lines.length - terminalHeight;
      if (toRemove <= 0) {
        return text;
      }
      return sliceAnsi(
        text,
        stripAnsi2(lines.slice(0, toRemove).join("\n")).length + 1
      );
    }, "fitToTerminalHeight");
    __name(createLogUpdate, "createLogUpdate");
    createLogUpdate(process7__default.default.stdout);
    createLogUpdate(process7__default.default.stderr);
  }
});

// ../cli/error.ts
var CancelError2;
var init_error = __esm({
  "../cli/error.ts"() {
    init_import_meta_url();
    CancelError2 = class extends Error {
      constructor(message, signal) {
        super(message);
        this.signal = signal;
      }
      static {
        __name(this, "CancelError");
      }
    };
  }
});

// ../cli/select-list.ts
var SelectRefreshablePrompt;
var init_select_list = __esm({
  "../cli/select-list.ts"() {
    init_import_meta_url();
    init_dist4();
    SelectRefreshablePrompt = class extends h {
      static {
        __name(this, "SelectRefreshablePrompt");
      }
      options;
      cursor = 0;
      get _value() {
        return this.options[this.cursor];
      }
      changeValue() {
        this.value = this._value.value;
      }
      constructor(opts) {
        super(opts, false);
        this.options = opts.options;
        this.cursor = this.options.findIndex(
          ({ value }) => value === opts.initialValue
        );
        if (this.cursor === -1) {
          this.cursor = 0;
        }
        this.changeValue();
        this.on("key", (c8) => {
          if (c8 !== "r") {
            return;
          }
          void opts.onRefresh().then((newOptions) => {
            this.options = [...newOptions];
            this.cursor = 0;
            this.changeValue();
            const that = this;
            if ("render" in that && typeof that.render === "function") {
              that.render();
            }
          }).catch(() => {
          });
        });
        this.on("cursor", (key) => {
          switch (key) {
            case "left":
            case "up":
              this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
              break;
            case "down":
            case "right":
              this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
              break;
          }
          this.changeValue();
        });
      }
    };
  }
});

// ../cli/streams.ts
var stdout, stderr;
var init_streams = __esm({
  "../cli/streams.ts"() {
    init_import_meta_url();
    stdout = process.stdout;
    stderr = process.stderr;
  }
});
function checkMacOSVersion(options) {
  if (process.platform !== "darwin") {
    return;
  }
  if (import_ci_info.default.isCI) {
    return;
  }
  const release3 = os11__namespace.default.release();
  const macOSVersion = darwinVersionToMacOSVersion(release3);
  if (macOSVersion && isVersionLessThan(macOSVersion, MINIMUM_MACOS_VERSION)) {
    if (options.shouldThrow) {
      throw new UserError(
        `Unsupported macOS version: The Cloudflare Workers runtime cannot run on the current version of macOS (${macOSVersion}). The minimum requirement is macOS ${MINIMUM_MACOS_VERSION}+. See https://github.com/cloudflare/workerd?tab=readme-ov-file#running-workerd If you cannot upgrade your version of macOS, you could try running in a DevContainer setup with a supported version of Linux (glibc 2.35+ required).`
      );
    } else {
      console.warn(
        `\u26A0\uFE0F  Warning: Unsupported macOS version detected (${macOSVersion}). The Cloudflare Workers runtime may not work correctly on macOS versions below ${MINIMUM_MACOS_VERSION}. Consider upgrading to macOS ${MINIMUM_MACOS_VERSION}+ or using a DevContainer setup with a supported version of Linux (glibc 2.35+ required).`
      );
    }
  }
}
function darwinVersionToMacOSVersion(darwinVersion) {
  const match3 = darwinVersion.match(/^(\d+)\.(\d+)\.(\d+)/);
  if (!match3) {
    return null;
  }
  const major = parseInt(match3[1], 10);
  if (major >= 20) {
    const macOSMajor = major - 9;
    const minor = parseInt(match3[2], 10);
    const patch = parseInt(match3[3], 10);
    return `${macOSMajor}.${minor}.${patch}`;
  }
  return null;
}
function isVersionLessThan(version1, version22) {
  const versionRegex = /^(\d+)\.(\d+)\.(\d+)$/;
  const match1 = version1.match(versionRegex);
  const match22 = version22.match(versionRegex);
  if (!match1 || !match22) {
    throw new Error(
      `Invalid version format. Expected M.m.p format, got: ${version1}, ${version22}`
    );
  }
  const [major1, minor1, patch1] = [
    parseInt(match1[1], 10),
    parseInt(match1[2], 10),
    parseInt(match1[3], 10)
  ];
  const [major2, minor2, patch2] = [
    parseInt(match22[1], 10),
    parseInt(match22[2], 10),
    parseInt(match22[3], 10)
  ];
  if (major1 !== major2) {
    return major1 < major2;
  }
  if (minor1 !== minor2) {
    return minor1 < minor2;
  }
  return patch1 < patch2;
}
var import_ci_info, MINIMUM_MACOS_VERSION;
var init_check_macos_version = __esm({
  "../cli/check-macos-version.ts"() {
    init_import_meta_url();
    init_dist();
    import_ci_info = __toESM(require_ci_info());
    MINIMUM_MACOS_VERSION = "13.5.0";
    __name(checkMacOSVersion, "checkMacOSVersion");
    __name(darwinVersionToMacOSVersion, "darwinVersionToMacOSVersion");
    __name(isVersionLessThan, "isVersionLessThan");
  }
});
function showCursor(show, stream2 = process7__default.default.stderr) {
  if (!stream2.isTTY) {
    return;
  }
  if (show) {
    stream2.write("\x1B[?25h");
  } else {
    stream2.write("\x1B[?25l");
  }
}
var init_cursor = __esm({
  "../cli/cursor.ts"() {
    init_import_meta_url();
    __name(showCursor, "showCursor");
  }
});
function setLogLevel(level) {
  currentLogLevel = level;
}
function getLogLevel() {
  return currentLogLevel;
}
var shapes, status, space, LOGGER_LEVELS2, currentLogLevel, logRaw, log, newline, format6, updateStatus, startSection, endSection, cancel, warn, success, stripAnsi3, linkRegex, crash, error;
var init_cli = __esm({
  "../cli/index.ts"() {
    init_import_meta_url();
    init_colors();
    init_streams();
    init_check_macos_version();
    init_cursor();
    shapes = {
      diamond: "\u25C7",
      dash: "\u2500",
      radioInactive: "\u25CB",
      radioActive: "\u25CF",
      backActive: "\u25C0",
      backInactive: "\u25C1",
      bar: "\u2502",
      leftT: "\u251C",
      rigthT: "\u2524",
      arrows: {
        left: "\u2039",
        right: "\u203A"
      },
      corners: {
        tl: "\u256D",
        bl: "\u2570",
        tr: "\u256E",
        br: "\u256F"
      }
    };
    status = {
      error: bgRed(` ERROR `),
      warning: bgYellow(` WARNING `),
      info: bgBlue(` INFO `),
      success: bgGreen(` SUCCESS `),
      cancel: white.bgRed(` X `)
    };
    space = /* @__PURE__ */ __name((n9 = 1) => {
      return hidden("\u200A".repeat(n9));
    }, "space");
    LOGGER_LEVELS2 = {
      none: -1,
      error: 0,
      warn: 1,
      info: 2,
      log: 3,
      debug: 4
    };
    currentLogLevel = "log";
    __name(setLogLevel, "setLogLevel");
    __name(getLogLevel, "getLogLevel");
    logRaw = /* @__PURE__ */ __name((msg) => {
      const currentLevel = getLogLevel();
      if (LOGGER_LEVELS2[currentLevel] >= LOGGER_LEVELS2.log) {
        stdout.write(`${msg}
`);
      }
    }, "logRaw");
    log = /* @__PURE__ */ __name((msg) => {
      const lines = msg.split("\n").map((ln) => `${gray(shapes.bar)}${ln.length > 0 ? " " + white(ln) : ""}`);
      logRaw(lines.join("\n"));
    }, "log");
    newline = /* @__PURE__ */ __name(() => {
      log("");
    }, "newline");
    format6 = /* @__PURE__ */ __name((msg, {
      linePrefix = gray(shapes.bar),
      firstLinePrefix = linePrefix,
      newlineBefore = false,
      newlineAfter = false,
      formatLine = /* @__PURE__ */ __name((line) => white(line), "formatLine"),
      multiline = true
    } = {}) => {
      const lines = multiline ? msg.split("\n") : [msg];
      const formattedLines = lines.map(
        (line, i7) => (i7 === 0 ? firstLinePrefix : linePrefix) + space() + formatLine(line)
      );
      if (newlineBefore) {
        formattedLines.unshift(linePrefix);
      }
      if (newlineAfter) {
        formattedLines.push(linePrefix);
      }
      return formattedLines.join("\n");
    }, "format");
    updateStatus = /* @__PURE__ */ __name((msg, printNewLine = true) => {
      logRaw(
        format6(msg, {
          firstLinePrefix: gray(shapes.leftT),
          linePrefix: gray(shapes.bar),
          newlineAfter: printNewLine
        })
      );
    }, "updateStatus");
    startSection = /* @__PURE__ */ __name((heading, subheading, printNewLine = true) => {
      logRaw(
        `${gray(shapes.corners.tl)} ${brandColor(heading)} ${subheading ? dim(subheading) : ""}`
      );
      if (printNewLine) {
        newline();
      }
    }, "startSection");
    endSection = /* @__PURE__ */ __name((heading, subheading) => {
      logRaw(
        `${gray(shapes.corners.bl)} ${brandColor(heading)} ${subheading ? dim(subheading) : ""}
`
      );
    }, "endSection");
    cancel = /* @__PURE__ */ __name((msg, {
      // current default is backcompat and makes sense going forward too
      shape = shapes.corners.bl,
      // current default for backcompat -- TODO: change default to true once all callees have been updated
      multiline = false
    } = {}) => {
      logRaw(
        format6(msg, {
          firstLinePrefix: `${gray(shape)} ${status.cancel}`,
          linePrefix: gray(shapes.bar),
          newlineBefore: true,
          formatLine: /* @__PURE__ */ __name((line) => dim(line), "formatLine"),
          // for backcompat but it's not ideal for this to be "dim"
          multiline
        })
      );
    }, "cancel");
    warn = /* @__PURE__ */ __name((msg, {
      // current default for backcompat -- TODO: change default to shapes.bar once all callees have been updated
      shape = shapes.corners.bl,
      // current default for backcompat -- TODO: change default to true once all callees have been updated
      multiline = false,
      newlineBefore = true
    } = {}) => {
      logRaw(
        format6(msg, {
          firstLinePrefix: gray(shape) + space() + status.warning,
          linePrefix: gray(shapes.bar),
          formatLine: /* @__PURE__ */ __name((line) => dim(line), "formatLine"),
          // for backcompat but it's not ideal for this to be "dim"
          multiline,
          newlineBefore
        })
      );
    }, "warn");
    success = /* @__PURE__ */ __name((msg, {
      // current default for backcompat -- TODO: change default to shapes.bar once all callees have been updated
      shape = shapes.corners.bl,
      // current default for backcompat -- TODO: change default to true once all callees have been updated
      multiline = false
    } = {}) => {
      logRaw(
        format6(msg, {
          firstLinePrefix: gray(shape) + space() + status.success,
          linePrefix: gray(shapes.bar),
          newlineBefore: true,
          formatLine: /* @__PURE__ */ __name((line) => dim(line), "formatLine"),
          // for backcompat but it's not ideal for this to be "dim"
          multiline
        })
      );
    }, "success");
    stripAnsi3 = /* @__PURE__ */ __name((str) => {
      const pattern = [
        "[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)",
        "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"
      ].join("|");
      const regex2 = RegExp(pattern, "g");
      return str.replace(linkRegex, "$2").replace(regex2, "");
    }, "stripAnsi");
    linkRegex = // eslint-disable-next-line no-control-regex
    /\u001B\]8;;(?<url>.+)\u001B\\(?<label>.+)\u001B\]8;;\u001B\\/g;
    crash = /* @__PURE__ */ __name((msg, extra) => {
      error(msg, extra);
      process7.exit(1);
    }, "crash");
    error = /* @__PURE__ */ __name((msg, extra, corner = shapes.corners.bl) => {
      const currentLevel = getLogLevel();
      if (msg && LOGGER_LEVELS2[currentLevel] >= LOGGER_LEVELS2.error) {
        stderr.write(
          `${gray(corner)} ${status.error} ${dim(msg)}
${extra ? space() + extra + "\n" : ""}`
        );
      }
    }, "error");
  }
});

// ../cli/interactive.ts
function acceptDefault(promptConfig, renderers, initialValue) {
  const error2 = promptConfig.validate?.(initialValue);
  if (error2) {
    if (promptConfig.throwOnError) {
      throw new Error(error2);
    } else {
      crash(error2);
    }
  }
  const lines = renderers.submit({ value: initialValue });
  logRaw(lines.join("\n"));
  return initialValue;
}
function isInteractive2() {
  try {
    return Boolean(process.stdin.isTTY && process.stdout.isTTY);
  } catch {
    return false;
  }
}
var logUpdate2, grayBar, blCorner, leftT, inputPrompt, renderSubmit, getRenderers, getTextRenderers, getSelectRenderers, getSelectListRenderers, getConfirmRenderers, spinnerFrames, ellipsisFrames, spinner, unwrapFactory, spinnerWhile;
var init_interactive = __esm({
  "../cli/interactive.ts"() {
    init_import_meta_url();
    init_dist4();
    init_log_update();
    init_colors();
    init_error();
    init_select_list();
    init_streams();
    init_cli();
    logUpdate2 = createLogUpdate(stdout);
    grayBar = gray(shapes.bar);
    blCorner = gray(shapes.corners.bl);
    leftT = gray(shapes.leftT);
    __name(acceptDefault, "acceptDefault");
    inputPrompt = /* @__PURE__ */ __name(async (promptConfig) => {
      const renderers = {
        ...getRenderers(promptConfig),
        ...promptConfig.renderers
      };
      let prompt2;
      const dispatchRender = /* @__PURE__ */ __name((props, p7) => {
        let state2 = props.state;
        if (state2 === "initial" && promptConfig.initialErrorMessage) {
          state2 = "error";
          props.error = promptConfig.initialErrorMessage;
        }
        const renderedLines = renderers[state2](props, p7);
        return renderedLines.join("\n");
      }, "dispatchRender");
      if (promptConfig.type === "select") {
        const initialValue = String(promptConfig.defaultValue);
        if (promptConfig.acceptDefault) {
          return acceptDefault(promptConfig, renderers, initialValue);
        }
        prompt2 = new ED({
          ...promptConfig,
          options: promptConfig.options.filter((o7) => !o7.hidden),
          initialValue,
          render() {
            return dispatchRender(this, prompt2);
          }
        });
      } else if (promptConfig.type === "confirm") {
        const initialValue = Boolean(promptConfig.defaultValue);
        if (promptConfig.acceptDefault) {
          return acceptDefault(promptConfig, renderers, initialValue);
        }
        prompt2 = new sD({
          ...promptConfig,
          initialValue,
          active: promptConfig.activeText || "",
          inactive: promptConfig.inactiveText || "",
          render() {
            return dispatchRender(this, prompt2);
          }
        });
      } else if (promptConfig.type == "multiselect") {
        let initialValues;
        if (Array.isArray(promptConfig.defaultValue)) {
          initialValues = promptConfig.defaultValue;
        } else if (promptConfig.defaultValue !== void 0) {
          initialValues = [String(promptConfig.defaultValue)];
        }
        if (promptConfig.acceptDefault) {
          return acceptDefault(promptConfig, renderers, initialValues);
        }
        prompt2 = new iD({
          ...promptConfig,
          options: promptConfig.options,
          initialValues,
          render() {
            return dispatchRender(this, prompt2);
          }
        });
      } else if (promptConfig.type === "list") {
        const initialValue = String(promptConfig.defaultValue);
        if (promptConfig.acceptDefault) {
          return acceptDefault(promptConfig, renderers, initialValue);
        }
        prompt2 = new SelectRefreshablePrompt({
          ...promptConfig,
          onRefresh: promptConfig.onRefresh ?? (() => Promise.resolve(promptConfig.options)),
          initialValue,
          render() {
            return dispatchRender(this, prompt2);
          }
        });
      } else {
        const initialValue = promptConfig.initialValue ?? String(promptConfig.defaultValue ?? "");
        if (promptConfig.acceptDefault) {
          return acceptDefault(promptConfig, renderers, initialValue);
        }
        prompt2 = new oD({
          ...promptConfig,
          initialValue: promptConfig.initialValue,
          defaultValue: String(promptConfig.defaultValue ?? ""),
          render() {
            return dispatchRender(this, prompt2);
          }
        });
      }
      const input = await prompt2.prompt();
      if (eD(input)) {
        if (promptConfig.throwOnError) {
          throw new CancelError2("Operation cancelled");
        } else {
          cancel("Operation cancelled");
          process.exit(0);
        }
      }
      return input;
    }, "inputPrompt");
    renderSubmit = /* @__PURE__ */ __name((config, value) => {
      const { question, label } = config;
      if (config.type !== "confirm" && !value) {
        return [`${leftT} ${question} ${dim("(skipped)")}`, `${grayBar}`];
      }
      const content = config.type === "confirm" ? `${grayBar} ${brandColor(value)} ${dim(label)}` : `${grayBar} ${brandColor(label)} ${dim(value)}`;
      return [`${leftT} ${question}`, content, `${grayBar}`];
    }, "renderSubmit");
    getRenderers = /* @__PURE__ */ __name((config) => {
      switch (config.type) {
        case "select":
          return getSelectRenderers(config);
        case "confirm":
          return getConfirmRenderers(config);
        case "text":
          return getTextRenderers(config);
        case "multiselect":
          return getSelectRenderers(config);
        case "list":
          return getSelectListRenderers(config);
      }
    }, "getRenderers");
    getTextRenderers = /* @__PURE__ */ __name((config) => {
      const { question } = config;
      const helpText = config.helpText ?? "";
      const format11 = config.format ?? ((val2) => String(val2));
      const defaultValue = config.defaultValue?.toString() ?? "";
      const activeRenderer = /* @__PURE__ */ __name((props) => {
        const { valueWithCursor } = props;
        return [
          `${blCorner} ${bold(question)} ${dim(helpText)}`,
          `${space(2)}${format11(valueWithCursor || dim(defaultValue))}`,
          ``
          // extra line for readability
        ];
      }, "activeRenderer");
      return {
        initial: /* @__PURE__ */ __name(() => [
          `${blCorner} ${bold(question)} ${dim(helpText)}`,
          `${space(2)}${gray(format11(defaultValue))}`,
          ``
          // extra line for readability
        ], "initial"),
        active: activeRenderer,
        error: /* @__PURE__ */ __name(({ value, error: error2 }) => [
          `${leftT} ${status.error} ${dim(error2)}`,
          `${grayBar}`,
          `${blCorner} ${question} ${dim(helpText)}`,
          `${space(2)}${format11(value)}`,
          ``
          // extra line for readability
        ], "error"),
        submit: /* @__PURE__ */ __name(({ value }) => renderSubmit(config, format11(value ?? "")), "submit"),
        cancel: activeRenderer
      };
    }, "getTextRenderers");
    getSelectRenderers = /* @__PURE__ */ __name((config) => {
      const { options, question, helpText: _helpText } = config;
      const helpText = _helpText ?? "";
      const maxItemsPerPage = config.maxItemsPerPage ?? 32;
      const defaultRenderer = /* @__PURE__ */ __name(({ cursor = 0, value }) => {
        const renderOption = /* @__PURE__ */ __name((opt, i7) => {
          const { label: optionLabel, value: optionValue } = opt;
          const active2 = i7 === cursor;
          const isInListOfValues = Array.isArray(value) && value.includes(optionValue);
          const color = isInListOfValues || active2 ? blue : white;
          const text = active2 ? color.underline(optionLabel) : color(optionLabel);
          const sublabel = opt.sublabel ? color.grey(opt.sublabel) : "";
          const indicator = isInListOfValues || active2 && !Array.isArray(value) ? color(opt.activeIcon ?? shapes.radioActive) : color(opt.inactiveIcon ?? shapes.radioInactive);
          return `${space(2)}${indicator} ${text} ${sublabel}`;
        }, "renderOption");
        const renderOptionCondition = /* @__PURE__ */ __name((_5, i7) => {
          if (options.length <= maxItemsPerPage) {
            return true;
          }
          if (i7 < cursor) {
            return options.length - i7 <= maxItemsPerPage;
          }
          return cursor + maxItemsPerPage > i7;
        }, "renderOptionCondition");
        const visibleOptions = options.filter((o7) => !o7.hidden);
        const activeOption = visibleOptions.at(cursor);
        const lines = [
          `${blCorner} ${bold(question)} ${dim(helpText)}`,
          `${cursor > 0 && options.length > maxItemsPerPage ? `${space(2)}${dim("...")}
` : ""}${visibleOptions.map(renderOption).filter(renderOptionCondition).join(`
`)}${cursor + maxItemsPerPage < options.length && options.length > maxItemsPerPage ? `
${space(2)}${dim("...")}` : ""}`,
          ``
          // extra line for readability
        ];
        if (activeOption?.description) {
          const wordSegmenter = new Intl.Segmenter("en", { granularity: "word" });
          const padding = space(2);
          const availableWidth = process.stdout.columns - stripAnsi3(padding).length * 2;
          const description = stripAnsi3(activeOption.description);
          const descriptionLines = [];
          let descriptionLineNumber = 0;
          for (const data of wordSegmenter.segment(description)) {
            let line = descriptionLines[descriptionLineNumber] ?? "";
            const currentLineWidth = line.length;
            const segmentSize = data.segment.length;
            if (currentLineWidth + segmentSize > availableWidth) {
              descriptionLineNumber++;
              line = "";
              if (data.segment.match(/^\s+$/)) {
                continue;
              }
            }
            descriptionLines[descriptionLineNumber] = line + data.segment;
          }
          lines.push(
            dim(
              descriptionLines.map((line) => padding + line + padding).join("\n")
            ),
            ``
          );
        }
        return lines;
      }, "defaultRenderer");
      return {
        initial: defaultRenderer,
        active: defaultRenderer,
        confirm: defaultRenderer,
        error: /* @__PURE__ */ __name((opts, prompt2) => {
          return [
            `${leftT} ${status.error} ${dim(opts.error)}`,
            `${grayBar}`,
            ...defaultRenderer(opts, prompt2)
          ];
        }, "error"),
        submit: /* @__PURE__ */ __name(({ value }) => {
          if (Array.isArray(value)) {
            return renderSubmit(
              config,
              options.filter((o7) => value.includes(o7.value)).map((o7) => o7.label).join(", ")
            );
          }
          return renderSubmit(
            config,
            options.find((o7) => o7.value === value)?.label
          );
        }, "submit"),
        cancel: defaultRenderer
      };
    }, "getSelectRenderers");
    getSelectListRenderers = /* @__PURE__ */ __name((config) => {
      const { question, helpText: _helpText } = config;
      let options = config.options;
      const helpText = _helpText ?? "";
      const { rows } = stdout;
      const defaultRenderer = /* @__PURE__ */ __name(({ cursor, value }, prompt2) => {
        if (prompt2 instanceof SelectRefreshablePrompt) {
          options = prompt2.options;
        }
        cursor = cursor ?? 0;
        let smallCursor = 0;
        const renderOption = /* @__PURE__ */ __name((opt, i7) => {
          const { label: optionLabel, value: optionValueAny } = opt;
          const optionValue = optionValueAny.toString();
          const active2 = i7 === smallCursor;
          const isInListOfValues = Array.isArray(value) && value.includes(optionValue);
          const color = isInListOfValues || active2 ? blue : white;
          const text = active2 ? color.underline(optionLabel) : color(optionLabel);
          const indicator = isInListOfValues || active2 && !Array.isArray(value) ? color(shapes.radioActive) : color(shapes.radioInactive);
          const indicatorMargin = 2;
          const detailBulletpointMargin = indicatorMargin + 4;
          return [
            `${space(indicatorMargin)}${indicator} ${text}`,
            ...opt.details.map(
              (detail, j7) => `${space(detailBulletpointMargin)}${j7 === opt.details.length - 1 ? gray(shapes.corners.bl) : grayBar} ${detail}`
            )
          ];
        }, "renderOption");
        const pages = [];
        let current = {
          size: 0,
          options: []
        };
        const VERTICAL_MARGIN = 6;
        for (const option of options) {
          const optionHeight = option.details.length + 1;
          if (current.size + optionHeight > rows - VERTICAL_MARGIN) {
            pages.push(current.options);
            current = { size: optionHeight, options: [option] };
            continue;
          }
          current.size += optionHeight;
          current.options.push(option);
        }
        if (current.size !== 0) {
          pages.push(current.options);
        }
        let isFirstPage = true;
        let isLastPage = false;
        let page = [];
        let len = 0;
        for (let i7 = 0; i7 < pages.length; i7++) {
          const pageIter = pages[i7];
          if (cursor >= len && pageIter.length + len > cursor) {
            isFirstPage = i7 === 0;
            isLastPage = i7 === pages.length - 1;
            page = pageIter;
            smallCursor = cursor - len;
            break;
          }
          len += pageIter.length;
        }
        return [
          `${blCorner} ${bold(question)} ${dim(helpText)}`,
          ...!isFirstPage ? [`${space(2)}${dim("...")}`] : [],
          ...page.map(renderOption).reduce((prev, now) => [...prev, ...now], []),
          ...!isLastPage ? [`${space(2)}${dim("...")}`] : []
        ];
      }, "defaultRenderer");
      return {
        initial: defaultRenderer,
        active: defaultRenderer,
        confirm: defaultRenderer,
        error: /* @__PURE__ */ __name((opts, prompt2) => {
          return [
            `${leftT} ${status.error} ${dim(opts.error)}`,
            `${grayBar}`,
            ...defaultRenderer(opts, prompt2)
          ];
        }, "error"),
        submit: /* @__PURE__ */ __name(({ value }) => {
          if (Array.isArray(value)) {
            return renderSubmit(
              config,
              options.filter((o7) => value.includes(o7.value)).map((o7) => o7.value).join(", ")
            );
          }
          return renderSubmit(
            config,
            options.find((o7) => o7.value === value)?.value
          );
        }, "submit"),
        cancel: defaultRenderer
      };
    }, "getSelectListRenderers");
    getConfirmRenderers = /* @__PURE__ */ __name((config) => {
      const { activeText, inactiveText, question, helpText: _helpText } = config;
      const helpText = _helpText ?? "";
      const active2 = activeText || "Yes";
      const inactive = inactiveText || "No";
      const defaultRenderer = /* @__PURE__ */ __name(({ value }) => {
        const yesColor = value ? blue.underline : dim;
        const noColor = value ? dim : blue.underline;
        return [
          `${blCorner} ${bold(question)} ${dim(helpText)}`,
          `${space(2)}${yesColor(active2)} / ${noColor(inactive)}`
        ];
      }, "defaultRenderer");
      return {
        initial: defaultRenderer,
        active: defaultRenderer,
        confirm: defaultRenderer,
        error: defaultRenderer,
        submit: /* @__PURE__ */ __name(({ value }) => renderSubmit(config, value ? "yes" : "no"), "submit"),
        cancel: defaultRenderer
      };
    }, "getConfirmRenderers");
    spinnerFrames = {
      clockwise: ["\u2524", "\u2518", "\u2534", "\u2514", "\u251C", "\u250C", "\u252C", "\u2510"],
      vertical: ["\u2581", "\u2583", "\u2584", "\u2585", "\u2586", "\u2587", "\u2586", "\u2585", "\u2584", "\u2583"]
    };
    ellipsisFrames = ["", ".", "..", "...", " ..", "  .", ""];
    spinner = /* @__PURE__ */ __name((frames = spinnerFrames.clockwise, color = brandColor) => {
      const frameRate = 120;
      let loop = null;
      let startMsg;
      let currentMsg;
      function clearLoop() {
        if (loop) {
          clearTimeout(loop);
        }
        loop = null;
      }
      __name(clearLoop, "clearLoop");
      return {
        start(msg, helpText) {
          helpText ||= ``;
          currentMsg = msg;
          startMsg = currentMsg;
          if (helpText !== void 0 && helpText.length > 0) {
            startMsg += ` ${dim(helpText)}`;
          }
          if (isInteractive2()) {
            let index = 0;
            clearLoop();
            loop = setInterval(() => {
              index++;
              const spinnerFrame = frames[index % frames.length];
              const ellipsisFrame = ellipsisFrames[index % ellipsisFrames.length];
              if (msg) {
                logUpdate2(`${color(spinnerFrame)} ${currentMsg} ${ellipsisFrame}`);
              }
            }, frameRate);
          } else {
            logRaw(`${leftT} ${startMsg}`);
          }
        },
        update(msg) {
          currentMsg = msg;
        },
        stop(msg) {
          if (isInteractive2()) {
            logUpdate2.clear();
            if (msg) {
              logUpdate2(`${leftT} ${startMsg}
${grayBar} ${msg}`);
              logUpdate2.done();
              newline();
            }
            clearLoop();
          } else {
            if (msg !== void 0) {
              logRaw(`${grayBar} ${msg}`);
            }
            newline();
          }
        }
      };
    }, "spinner");
    unwrapFactory = /* @__PURE__ */ __name((input) => {
      const output = typeof input === "function" ? input() : input;
      return output;
    }, "unwrapFactory");
    spinnerWhile = /* @__PURE__ */ __name(async (opts) => {
      const s7 = opts.spinner ?? spinner();
      s7.start(unwrapFactory(opts.startMessage));
      try {
        const result = await unwrapFactory(opts.promise);
        return result;
      } finally {
        s7.stop(unwrapFactory(opts.endMessage));
      }
    }, "spinnerWhile");
    __name(isInteractive2, "isInteractive");
  }
});

// src/is-interactive.ts
function isInteractive3() {
  if (import_ci_info2.default.CLOUDFLARE_PAGES || import_ci_info2.default.CLOUDFLARE_WORKERS) {
    return false;
  }
  return isInteractive2();
}
function isNonInteractiveOrCI() {
  return !isInteractive3() || import_ci_info2.default.isCI;
}
var import_ci_info2;
var init_is_interactive = __esm({
  "src/is-interactive.ts"() {
    init_import_meta_url();
    init_interactive();
    import_ci_info2 = __toESM(require_ci_info());
    __name(isInteractive3, "isInteractive");
    __name(isNonInteractiveOrCI, "isNonInteractiveOrCI");
  }
});

// ../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js
var require_windows = __commonJS({
  "../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js"(exports, module2) {
    init_import_meta_url();
    module2.exports = isexe;
    isexe.sync = sync;
    var fs33 = __require("fs");
    function checkPathExt(path84, options) {
      var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
      if (!pathext) {
        return true;
      }
      pathext = pathext.split(";");
      if (pathext.indexOf("") !== -1) {
        return true;
      }
      for (var i7 = 0; i7 < pathext.length; i7++) {
        var p7 = pathext[i7].toLowerCase();
        if (p7 && path84.substr(-p7.length).toLowerCase() === p7) {
          return true;
        }
      }
      return false;
    }
    __name(checkPathExt, "checkPathExt");
    function checkStat(stat9, path84, options) {
      if (!stat9.isSymbolicLink() && !stat9.isFile()) {
        return false;
      }
      return checkPathExt(path84, options);
    }
    __name(checkStat, "checkStat");
    function isexe(path84, options, cb2) {
      fs33.stat(path84, function(er2, stat9) {
        cb2(er2, er2 ? false : checkStat(stat9, path84, options));
      });
    }
    __name(isexe, "isexe");
    function sync(path84, options) {
      return checkStat(fs33.statSync(path84), path84, options);
    }
    __name(sync, "sync");
  }
});

// ../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js
var require_mode = __commonJS({
  "../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js"(exports, module2) {
    init_import_meta_url();
    module2.exports = isexe;
    isexe.sync = sync;
    var fs33 = __require("fs");
    function isexe(path84, options, cb2) {
      fs33.stat(path84, function(er2, stat9) {
        cb2(er2, er2 ? false : checkStat(stat9, options));
      });
    }
    __name(isexe, "isexe");
    function sync(path84, options) {
      return checkStat(fs33.statSync(path84), options);
    }
    __name(sync, "sync");
    function checkStat(stat9, options) {
      return stat9.isFile() && checkMode(stat9, options);
    }
    __name(checkStat, "checkStat");
    function checkMode(stat9, options) {
      var mod = stat9.mode;
      var uid = stat9.uid;
      var gid = stat9.gid;
      var myUid = options.uid !== void 0 ? options.uid : process.getuid && process.getuid();
      var myGid = options.gid !== void 0 ? options.gid : process.getgid && process.getgid();
      var u7 = parseInt("100", 8);
      var g7 = parseInt("010", 8);
      var o7 = parseInt("001", 8);
      var ug = u7 | g7;
      var ret = mod & o7 || mod & g7 && gid === myGid || mod & u7 && uid === myUid || mod & ug && myUid === 0;
      return ret;
    }
    __name(checkMode, "checkMode");
  }
});

// ../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js
var require_isexe = __commonJS({
  "../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js"(exports, module2) {
    init_import_meta_url();
    __require("fs");
    var core;
    if (process.platform === "win32" || global.TESTING_WINDOWS) {
      core = require_windows();
    } else {
      core = require_mode();
    }
    module2.exports = isexe;
    isexe.sync = sync;
    function isexe(path84, options, cb2) {
      if (typeof options === "function") {
        cb2 = options;
        options = {};
      }
      if (!cb2) {
        if (typeof Promise !== "function") {
          throw new TypeError("callback not provided");
        }
        return new Promise(function(resolve32, reject) {
          isexe(path84, options || {}, function(er2, is) {
            if (er2) {
              reject(er2);
            } else {
              resolve32(is);
            }
          });
        });
      }
      core(path84, options || {}, function(er2, is) {
        if (er2) {
          if (er2.code === "EACCES" || options && options.ignoreErrors) {
            er2 = null;
            is = false;
          }
        }
        cb2(er2, is);
      });
    }
    __name(isexe, "isexe");
    function sync(path84, options) {
      try {
        return core.sync(path84, options || {});
      } catch (er2) {
        if (options && options.ignoreErrors || er2.code === "EACCES") {
          return false;
        } else {
          throw er2;
        }
      }
    }
    __name(sync, "sync");
  }
});

// ../../node_modules/.pnpm/which@2.0.2/node_modules/which/which.js
var require_which = __commonJS({
  "../../node_modules/.pnpm/which@2.0.2/node_modules/which/which.js"(exports, module2) {
    init_import_meta_url();
    var isWindows5 = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
    var path84 = __require("path");
    var COLON = isWindows5 ? ";" : ":";
    var isexe = require_isexe();
    var getNotFoundError = /* @__PURE__ */ __name((cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" }), "getNotFoundError");
    var getPathInfo = /* @__PURE__ */ __name((cmd, opt) => {
      const colon = opt.colon || COLON;
      const pathEnv = cmd.match(/\//) || isWindows5 && cmd.match(/\\/) ? [""] : [
        // windows always checks the cwd first
        ...isWindows5 ? [process.cwd()] : [],
        ...(opt.path || process.env.PATH || /* istanbul ignore next: very unusual */
        "").split(colon)
      ];
      const pathExtExe = isWindows5 ? opt.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
      const pathExt = isWindows5 ? pathExtExe.split(colon) : [""];
      if (isWindows5) {
        if (cmd.indexOf(".") !== -1 && pathExt[0] !== "")
          pathExt.unshift("");
      }
      return {
        pathEnv,
        pathExt,
        pathExtExe
      };
    }, "getPathInfo");
    var which = /* @__PURE__ */ __name((cmd, opt, cb2) => {
      if (typeof opt === "function") {
        cb2 = opt;
        opt = {};
      }
      if (!opt)
        opt = {};
      const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
      const found = [];
      const step = /* @__PURE__ */ __name((i7) => new Promise((resolve32, reject) => {
        if (i7 === pathEnv.length)
          return opt.all && found.length ? resolve32(found) : reject(getNotFoundError(cmd));
        const ppRaw = pathEnv[i7];
        const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
        const pCmd = path84.join(pathPart, cmd);
        const p7 = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
        resolve32(subStep(p7, i7, 0));
      }), "step");
      const subStep = /* @__PURE__ */ __name((p7, i7, ii) => new Promise((resolve32, reject) => {
        if (ii === pathExt.length)
          return resolve32(step(i7 + 1));
        const ext2 = pathExt[ii];
        isexe(p7 + ext2, { pathExt: pathExtExe }, (er2, is) => {
          if (!er2 && is) {
            if (opt.all)
              found.push(p7 + ext2);
            else
              return resolve32(p7 + ext2);
          }
          return resolve32(subStep(p7, i7, ii + 1));
        });
      }), "subStep");
      return cb2 ? step(0).then((res) => cb2(null, res), cb2) : step(0);
    }, "which");
    var whichSync = /* @__PURE__ */ __name((cmd, opt) => {
      opt = opt || {};
      const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
      const found = [];
      for (let i7 = 0; i7 < pathEnv.length; i7++) {
        const ppRaw = pathEnv[i7];
        const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
        const pCmd = path84.join(pathPart, cmd);
        const p7 = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
        for (let j7 = 0; j7 < pathExt.length; j7++) {
          const cur = p7 + pathExt[j7];
          try {
            const is = isexe.sync(cur, { pathExt: pathExtExe });
            if (is) {
              if (opt.all)
                found.push(cur);
              else
                return cur;
            }
          } catch (ex) {
          }
        }
      }
      if (opt.all && found.length)
        return found;
      if (opt.nothrow)
        return null;
      throw getNotFoundError(cmd);
    }, "whichSync");
    module2.exports = which;
    which.sync = whichSync;
  }
});

// ../../node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js
var require_path_key = __commonJS({
  "../../node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js"(exports, module2) {
    init_import_meta_url();
    var pathKey2 = /* @__PURE__ */ __name((options = {}) => {
      const environment = options.env || process.env;
      const platform4 = options.platform || process.platform;
      if (platform4 !== "win32") {
        return "PATH";
      }
      return Object.keys(environment).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
    }, "pathKey");
    module2.exports = pathKey2;
    module2.exports.default = pathKey2;
  }
});

// ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js
var require_resolveCommand = __commonJS({
  "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js"(exports, module2) {
    init_import_meta_url();
    var path84 = __require("path");
    var which = require_which();
    var getPathKey = require_path_key();
    function resolveCommandAttempt(parsed, withoutPathExt) {
      const env6 = parsed.options.env || process.env;
      const cwd2 = process.cwd();
      const hasCustomCwd = parsed.options.cwd != null;
      const shouldSwitchCwd = hasCustomCwd && process.chdir !== void 0 && !process.chdir.disabled;
      if (shouldSwitchCwd) {
        try {
          process.chdir(parsed.options.cwd);
        } catch (err) {
        }
      }
      let resolved;
      try {
        resolved = which.sync(parsed.command, {
          path: env6[getPathKey({ env: env6 })],
          pathExt: withoutPathExt ? path84.delimiter : void 0
        });
      } catch (e10) {
      } finally {
        if (shouldSwitchCwd) {
          process.chdir(cwd2);
        }
      }
      if (resolved) {
        resolved = path84.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
      }
      return resolved;
    }
    __name(resolveCommandAttempt, "resolveCommandAttempt");
    function resolveCommand(parsed) {
      return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);
    }
    __name(resolveCommand, "resolveCommand");
    module2.exports = resolveCommand;
  }
});

// ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/escape.js
var require_escape = __commonJS({
  "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/escape.js"(exports, module2) {
    init_import_meta_url();
    var metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
    function escapeCommand(arg) {
      arg = arg.replace(metaCharsRegExp, "^$1");
      return arg;
    }
    __name(escapeCommand, "escapeCommand");
    function escapeArgument(arg, doubleEscapeMetaChars) {
      arg = `${arg}`;
      arg = arg.replace(/(?=(\\+?)?)\1"/g, '$1$1\\"');
      arg = arg.replace(/(?=(\\+?)?)\1$/, "$1$1");
      arg = `"${arg}"`;
      arg = arg.replace(metaCharsRegExp, "^$1");
      if (doubleEscapeMetaChars) {
        arg = arg.replace(metaCharsRegExp, "^$1");
      }
      return arg;
    }
    __name(escapeArgument, "escapeArgument");
    module2.exports.command = escapeCommand;
    module2.exports.argument = escapeArgument;
  }
});

// ../../node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js
var require_shebang_regex = __commonJS({
  "../../node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js"(exports, module2) {
    init_import_meta_url();
    module2.exports = /^#!(.*)/;
  }
});

// ../../node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js
var require_shebang_command = __commonJS({
  "../../node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js"(exports, module2) {
    init_import_meta_url();
    var shebangRegex = require_shebang_regex();
    module2.exports = (string = "") => {
      const match3 = string.match(shebangRegex);
      if (!match3) {
        return null;
      }
      const [path84, argument] = match3[0].replace(/#! ?/, "").split(" ");
      const binary = path84.split("/").pop();
      if (binary === "env") {
        return argument;
      }
      return argument ? `${binary} ${argument}` : binary;
    };
  }
});

// ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js
var require_readShebang = __commonJS({
  "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js"(exports, module2) {
    init_import_meta_url();
    var fs33 = __require("fs");
    var shebangCommand = require_shebang_command();
    function readShebang(command2) {
      const size = 150;
      const buffer = Buffer.alloc(size);
      let fd;
      try {
        fd = fs33.openSync(command2, "r");
        fs33.readSync(fd, buffer, 0, size, 0);
        fs33.closeSync(fd);
      } catch (e10) {
      }
      return shebangCommand(buffer.toString());
    }
    __name(readShebang, "readShebang");
    module2.exports = readShebang;
  }
});

// ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js
var require_parse2 = __commonJS({
  "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js"(exports, module2) {
    init_import_meta_url();
    var path84 = __require("path");
    var resolveCommand = require_resolveCommand();
    var escape3 = require_escape();
    var readShebang = require_readShebang();
    var isWin = process.platform === "win32";
    var isExecutableRegExp = /\.(?:com|exe)$/i;
    var isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
    function detectShebang(parsed) {
      parsed.file = resolveCommand(parsed);
      const shebang = parsed.file && readShebang(parsed.file);
      if (shebang) {
        parsed.args.unshift(parsed.file);
        parsed.command = shebang;
        return resolveCommand(parsed);
      }
      return parsed.file;
    }
    __name(detectShebang, "detectShebang");
    function parseNonShell(parsed) {
      if (!isWin) {
        return parsed;
      }
      const commandFile = detectShebang(parsed);
      const needsShell = !isExecutableRegExp.test(commandFile);
      if (parsed.options.forceShell || needsShell) {
        const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
        parsed.command = path84.normalize(parsed.command);
        parsed.command = escape3.command(parsed.command);
        parsed.args = parsed.args.map((arg) => escape3.argument(arg, needsDoubleEscapeMetaChars));
        const shellCommand = [parsed.command].concat(parsed.args).join(" ");
        parsed.args = ["/d", "/s", "/c", `"${shellCommand}"`];
        parsed.command = process.env.comspec || "cmd.exe";
        parsed.options.windowsVerbatimArguments = true;
      }
      return parsed;
    }
    __name(parseNonShell, "parseNonShell");
    function parse17(command2, args, options) {
      if (args && !Array.isArray(args)) {
        options = args;
        args = null;
      }
      args = args ? args.slice(0) : [];
      options = Object.assign({}, options);
      const parsed = {
        command: command2,
        args,
        options,
        file: void 0,
        original: {
          command: command2,
          args
        }
      };
      return options.shell ? parsed : parseNonShell(parsed);
    }
    __name(parse17, "parse");
    module2.exports = parse17;
  }
});

// ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/enoent.js
var require_enoent = __commonJS({
  "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/enoent.js"(exports, module2) {
    init_import_meta_url();
    var isWin = process.platform === "win32";
    function notFoundError(original, syscall) {
      return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
        code: "ENOENT",
        errno: "ENOENT",
        syscall: `${syscall} ${original.command}`,
        path: original.command,
        spawnargs: original.args
      });
    }
    __name(notFoundError, "notFoundError");
    function hookChildProcess(cp3, parsed) {
      if (!isWin) {
        return;
      }
      const originalEmit = cp3.emit;
      cp3.emit = function(name2, arg1) {
        if (name2 === "exit") {
          const err = verifyENOENT(arg1, parsed);
          if (err) {
            return originalEmit.call(cp3, "error", err);
          }
        }
        return originalEmit.apply(cp3, arguments);
      };
    }
    __name(hookChildProcess, "hookChildProcess");
    function verifyENOENT(status2, parsed) {
      if (isWin && status2 === 1 && !parsed.file) {
        return notFoundError(parsed.original, "spawn");
      }
      return null;
    }
    __name(verifyENOENT, "verifyENOENT");
    function verifyENOENTSync(status2, parsed) {
      if (isWin && status2 === 1 && !parsed.file) {
        return notFoundError(parsed.original, "spawnSync");
      }
      return null;
    }
    __name(verifyENOENTSync, "verifyENOENTSync");
    module2.exports = {
      hookChildProcess,
      verifyENOENT,
      verifyENOENTSync,
      notFoundError
    };
  }
});

// ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js
var require_cross_spawn = __commonJS({
  "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js"(exports, module2) {
    init_import_meta_url();
    var cp3 = __require("child_process");
    var parse17 = require_parse2();
    var enoent = require_enoent();
    function spawn9(command2, args, options) {
      const parsed = parse17(command2, args, options);
      const spawned = cp3.spawn(parsed.command, parsed.args, parsed.options);
      enoent.hookChildProcess(spawned, parsed);
      return spawned;
    }
    __name(spawn9, "spawn");
    function spawnSync3(command2, args, options) {
      const parsed = parse17(command2, args, options);
      const result = cp3.spawnSync(parsed.command, parsed.args, parsed.options);
      result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
      return result;
    }
    __name(spawnSync3, "spawnSync");
    module2.exports = spawn9;
    module2.exports.spawn = spawn9;
    module2.exports.sync = spawnSync3;
    module2.exports._parse = parse17;
    module2.exports._enoent = enoent;
  }
});

// ../../node_modules/.pnpm/strip-final-newline@3.0.0/node_modules/strip-final-newline/index.js
function stripFinalNewline(input) {
  const LF = typeof input === "string" ? "\n" : "\n".charCodeAt();
  const CR = typeof input === "string" ? "\r" : "\r".charCodeAt();
  if (input[input.length - 1] === LF) {
    input = input.slice(0, -1);
  }
  if (input[input.length - 1] === CR) {
    input = input.slice(0, -1);
  }
  return input;
}
var init_strip_final_newline = __esm({
  "../../node_modules/.pnpm/strip-final-newline@3.0.0/node_modules/strip-final-newline/index.js"() {
    init_import_meta_url();
    __name(stripFinalNewline, "stripFinalNewline");
  }
});

// ../../node_modules/.pnpm/path-key@4.0.0/node_modules/path-key/index.js
function pathKey(options = {}) {
  const {
    env: env6 = process.env,
    platform: platform4 = process.platform
  } = options;
  if (platform4 !== "win32") {
    return "PATH";
  }
  return Object.keys(env6).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
}
var init_path_key = __esm({
  "../../node_modules/.pnpm/path-key@4.0.0/node_modules/path-key/index.js"() {
    init_import_meta_url();
    __name(pathKey, "pathKey");
  }
});
function npmRunPath(options = {}) {
  const {
    cwd: cwd2 = process7__default.default.cwd(),
    path: path_ = process7__default.default.env[pathKey()],
    execPath = process7__default.default.execPath
  } = options;
  let previous;
  const cwdString = cwd2 instanceof URL ? Url__default.default.fileURLToPath(cwd2) : cwd2;
  let cwdPath = path3__namespace.default.resolve(cwdString);
  const result = [];
  while (previous !== cwdPath) {
    result.push(path3__namespace.default.join(cwdPath, "node_modules/.bin"));
    previous = cwdPath;
    cwdPath = path3__namespace.default.resolve(cwdPath, "..");
  }
  result.push(path3__namespace.default.resolve(cwdString, execPath, ".."));
  return [...result, path_].join(path3__namespace.default.delimiter);
}
function npmRunPathEnv({ env: env6 = process7__default.default.env, ...options } = {}) {
  env6 = { ...env6 };
  const path84 = pathKey({ env: env6 });
  options.path = env6[path84];
  env6[path84] = npmRunPath(options);
  return env6;
}
var init_npm_run_path = __esm({
  "../../node_modules/.pnpm/npm-run-path@5.1.0/node_modules/npm-run-path/index.js"() {
    init_import_meta_url();
    init_path_key();
    __name(npmRunPath, "npmRunPath");
    __name(npmRunPathEnv, "npmRunPathEnv");
  }
});

// ../../node_modules/.pnpm/mimic-fn@4.0.0/node_modules/mimic-fn/index.js
function mimicFunction(to, from, { ignoreNonConfigurable = false } = {}) {
  const { name: name2 } = to;
  for (const property of Reflect.ownKeys(from)) {
    copyProperty(to, from, property, ignoreNonConfigurable);
  }
  changePrototype(to, from);
  changeToString(to, from, name2);
  return to;
}
var copyProperty, canCopyProperty, changePrototype, wrappedToString, toStringDescriptor, toStringName, changeToString;
var init_mimic_fn = __esm({
  "../../node_modules/.pnpm/mimic-fn@4.0.0/node_modules/mimic-fn/index.js"() {
    init_import_meta_url();
    copyProperty = /* @__PURE__ */ __name((to, from, property, ignoreNonConfigurable) => {
      if (property === "length" || property === "prototype") {
        return;
      }
      if (property === "arguments" || property === "caller") {
        return;
      }
      const toDescriptor = Object.getOwnPropertyDescriptor(to, property);
      const fromDescriptor = Object.getOwnPropertyDescriptor(from, property);
      if (!canCopyProperty(toDescriptor, fromDescriptor) && ignoreNonConfigurable) {
        return;
      }
      Object.defineProperty(to, property, fromDescriptor);
    }, "copyProperty");
    canCopyProperty = /* @__PURE__ */ __name(function(toDescriptor, fromDescriptor) {
      return toDescriptor === void 0 || toDescriptor.configurable || toDescriptor.writable === fromDescriptor.writable && toDescriptor.enumerable === fromDescriptor.enumerable && toDescriptor.configurable === fromDescriptor.configurable && (toDescriptor.writable || toDescriptor.value === fromDescriptor.value);
    }, "canCopyProperty");
    changePrototype = /* @__PURE__ */ __name((to, from) => {
      const fromPrototype = Object.getPrototypeOf(from);
      if (fromPrototype === Object.getPrototypeOf(to)) {
        return;
      }
      Object.setPrototypeOf(to, fromPrototype);
    }, "changePrototype");
    wrappedToString = /* @__PURE__ */ __name((withName, fromBody) => `/* Wrapped ${withName}*/
${fromBody}`, "wrappedToString");
    toStringDescriptor = Object.getOwnPropertyDescriptor(Function.prototype, "toString");
    toStringName = Object.getOwnPropertyDescriptor(Function.prototype.toString, "name");
    changeToString = /* @__PURE__ */ __name((to, from, name2) => {
      const withName = name2 === "" ? "" : `with ${name2.trim()}() `;
      const newToString = wrappedToString.bind(null, withName, from.toString());
      Object.defineProperty(newToString, "name", toStringName);
      Object.defineProperty(to, "toString", { ...toStringDescriptor, value: newToString });
    }, "changeToString");
    __name(mimicFunction, "mimicFunction");
  }
});

// ../../node_modules/.pnpm/onetime@6.0.0/node_modules/onetime/index.js
var calledFunctions, onetime2, onetime_default;
var init_onetime = __esm({
  "../../node_modules/.pnpm/onetime@6.0.0/node_modules/onetime/index.js"() {
    init_import_meta_url();
    init_mimic_fn();
    calledFunctions = /* @__PURE__ */ new WeakMap();
    onetime2 = /* @__PURE__ */ __name((function_, options = {}) => {
      if (typeof function_ !== "function") {
        throw new TypeError("Expected a function");
      }
      let returnValue;
      let callCount = 0;
      const functionName = function_.displayName || function_.name || "<anonymous>";
      const onetime3 = /* @__PURE__ */ __name(function(...arguments_) {
        calledFunctions.set(onetime3, ++callCount);
        if (callCount === 1) {
          returnValue = function_.apply(this, arguments_);
          function_ = null;
        } else if (options.throw === true) {
          throw new Error(`Function \`${functionName}\` can only be called once`);
        }
        return returnValue;
      }, "onetime");
      mimicFunction(onetime3, function_);
      calledFunctions.set(onetime3, callCount);
      return onetime3;
    }, "onetime");
    onetime2.callCount = (function_) => {
      if (!calledFunctions.has(function_)) {
        throw new Error(`The given function \`${function_.name}\` is not wrapped by the \`onetime\` package`);
      }
      return calledFunctions.get(function_);
    };
    onetime_default = onetime2;
  }
});

// ../../node_modules/.pnpm/human-signals@3.0.1/node_modules/human-signals/build/src/realtime.js
var getRealtimeSignals, getRealtimeSignal, SIGRTMIN, SIGRTMAX;
var init_realtime = __esm({
  "../../node_modules/.pnpm/human-signals@3.0.1/node_modules/human-signals/build/src/realtime.js"() {
    init_import_meta_url();
    getRealtimeSignals = /* @__PURE__ */ __name(function() {
      const length = SIGRTMAX - SIGRTMIN + 1;
      return Array.from({ length }, getRealtimeSignal);
    }, "getRealtimeSignals");
    getRealtimeSignal = /* @__PURE__ */ __name(function(value, index) {
      return {
        name: `SIGRT${index + 1}`,
        number: SIGRTMIN + index,
        action: "terminate",
        description: "Application-specific signal (realtime)",
        standard: "posix"
      };
    }, "getRealtimeSignal");
    SIGRTMIN = 34;
    SIGRTMAX = 64;
  }
});

// ../../node_modules/.pnpm/human-signals@3.0.1/node_modules/human-signals/build/src/core.js
var SIGNALS;
var init_core = __esm({
  "../../node_modules/.pnpm/human-signals@3.0.1/node_modules/human-signals/build/src/core.js"() {
    init_import_meta_url();
    SIGNALS = [
      {
        name: "SIGHUP",
        number: 1,
        action: "terminate",
        description: "Terminal closed",
        standard: "posix"
      },
      {
        name: "SIGINT",
        number: 2,
        action: "terminate",
        description: "User interruption with CTRL-C",
        standard: "ansi"
      },
      {
        name: "SIGQUIT",
        number: 3,
        action: "core",
        description: "User interruption with CTRL-\\",
        standard: "posix"
      },
      {
        name: "SIGILL",
        number: 4,
        action: "core",
        description: "Invalid machine instruction",
        standard: "ansi"
      },
      {
        name: "SIGTRAP",
        number: 5,
        action: "core",
        description: "Debugger breakpoint",
        standard: "posix"
      },
      {
        name: "SIGABRT",
        number: 6,
        action: "core",
        description: "Aborted",
        standard: "ansi"
      },
      {
        name: "SIGIOT",
        number: 6,
        action: "core",
        description: "Aborted",
        standard: "bsd"
      },
      {
        name: "SIGBUS",
        number: 7,
        action: "core",
        description: "Bus error due to misaligned, non-existing address or paging error",
        standard: "bsd"
      },
      {
        name: "SIGEMT",
        number: 7,
        action: "terminate",
        description: "Command should be emulated but is not implemented",
        standard: "other"
      },
      {
        name: "SIGFPE",
        number: 8,
        action: "core",
        description: "Floating point arithmetic error",
        standard: "ansi"
      },
      {
        name: "SIGKILL",
        number: 9,
        action: "terminate",
        description: "Forced termination",
        standard: "posix",
        forced: true
      },
      {
        name: "SIGUSR1",
        number: 10,
        action: "terminate",
        description: "Application-specific signal",
        standard: "posix"
      },
      {
        name: "SIGSEGV",
        number: 11,
        action: "core",
        description: "Segmentation fault",
        standard: "ansi"
      },
      {
        name: "SIGUSR2",
        number: 12,
        action: "terminate",
        description: "Application-specific signal",
        standard: "posix"
      },
      {
        name: "SIGPIPE",
        number: 13,
        action: "terminate",
        description: "Broken pipe or socket",
        standard: "posix"
      },
      {
        name: "SIGALRM",
        number: 14,
        action: "terminate",
        description: "Timeout or timer",
        standard: "posix"
      },
      {
        name: "SIGTERM",
        number: 15,
        action: "terminate",
        description: "Termination",
        standard: "ansi"
      },
      {
        name: "SIGSTKFLT",
        number: 16,
        action: "terminate",
        description: "Stack is empty or overflowed",
        standard: "other"
      },
      {
        name: "SIGCHLD",
        number: 17,
        action: "ignore",
        description: "Child process terminated, paused or unpaused",
        standard: "posix"
      },
      {
        name: "SIGCLD",
        number: 17,
        action: "ignore",
        description: "Child process terminated, paused or unpaused",
        standard: "other"
      },
      {
        name: "SIGCONT",
        number: 18,
        action: "unpause",
        description: "Unpaused",
        standard: "posix",
        forced: true
      },
      {
        name: "SIGSTOP",
        number: 19,
        action: "pause",
        description: "Paused",
        standard: "posix",
        forced: true
      },
      {
        name: "SIGTSTP",
        number: 20,
        action: "pause",
        description: 'Paused using CTRL-Z or "suspend"',
        standard: "posix"
      },
      {
        name: "SIGTTIN",
        number: 21,
        action: "pause",
        description: "Background process cannot read terminal input",
        standard: "posix"
      },
      {
        name: "SIGBREAK",
        number: 21,
        action: "terminate",
        description: "User interruption with CTRL-BREAK",
        standard: "other"
      },
      {
        name: "SIGTTOU",
        number: 22,
        action: "pause",
        description: "Background process cannot write to terminal output",
        standard: "posix"
      },
      {
        name: "SIGURG",
        number: 23,
        action: "ignore",
        description: "Socket received out-of-band data",
        standard: "bsd"
      },
      {
        name: "SIGXCPU",
        number: 24,
        action: "core",
        description: "Process timed out",
        standard: "bsd"
      },
      {
        name: "SIGXFSZ",
        number: 25,
        action: "core",
        description: "File too big",
        standard: "bsd"
      },
      {
        name: "SIGVTALRM",
        number: 26,
        action: "terminate",
        description: "Timeout or timer",
        standard: "bsd"
      },
      {
        name: "SIGPROF",
        number: 27,
        action: "terminate",
        description: "Timeout or timer",
        standard: "bsd"
      },
      {
        name: "SIGWINCH",
        number: 28,
        action: "ignore",
        description: "Terminal window size changed",
        standard: "bsd"
      },
      {
        name: "SIGIO",
        number: 29,
        action: "terminate",
        description: "I/O is available",
        standard: "other"
      },
      {
        name: "SIGPOLL",
        number: 29,
        action: "terminate",
        description: "Watched event",
        standard: "other"
      },
      {
        name: "SIGINFO",
        number: 29,
        action: "ignore",
        description: "Request for process information",
        standard: "other"
      },
      {
        name: "SIGPWR",
        number: 30,
        action: "terminate",
        description: "Device running out of power",
        standard: "systemv"
      },
      {
        name: "SIGSYS",
        number: 31,
        action: "core",
        description: "Invalid system call",
        standard: "other"
      },
      {
        name: "SIGUNUSED",
        number: 31,
        action: "terminate",
        description: "Invalid system call",
        standard: "other"
      }
    ];
  }
});
var getSignals, normalizeSignal;
var init_signals = __esm({
  "../../node_modules/.pnpm/human-signals@3.0.1/node_modules/human-signals/build/src/signals.js"() {
    init_import_meta_url();
    init_core();
    init_realtime();
    getSignals = /* @__PURE__ */ __name(function() {
      const realtimeSignals = getRealtimeSignals();
      const signals = [...SIGNALS, ...realtimeSignals].map(normalizeSignal);
      return signals;
    }, "getSignals");
    normalizeSignal = /* @__PURE__ */ __name(function({
      name: name2,
      number: defaultNumber,
      description,
      action,
      forced = false,
      standard
    }) {
      const {
        signals: { [name2]: constantSignal }
      } = os11.constants;
      const supported = constantSignal !== void 0;
      const number = supported ? constantSignal : defaultNumber;
      return { name: name2, number, description, supported, action, forced, standard };
    }, "normalizeSignal");
  }
});
var getSignalsByName, getSignalByName, signalsByName, getSignalsByNumber, getSignalByNumber, findSignalByNumber;
var init_main = __esm({
  "../../node_modules/.pnpm/human-signals@3.0.1/node_modules/human-signals/build/src/main.js"() {
    init_import_meta_url();
    init_realtime();
    init_signals();
    getSignalsByName = /* @__PURE__ */ __name(function() {
      const signals = getSignals();
      return signals.reduce(getSignalByName, {});
    }, "getSignalsByName");
    getSignalByName = /* @__PURE__ */ __name(function(signalByNameMemo, { name: name2, number, description, supported, action, forced, standard }) {
      return {
        ...signalByNameMemo,
        [name2]: { name: name2, number, description, supported, action, forced, standard }
      };
    }, "getSignalByName");
    signalsByName = getSignalsByName();
    getSignalsByNumber = /* @__PURE__ */ __name(function() {
      const signals = getSignals();
      const length = SIGRTMAX + 1;
      const signalsA = Array.from({ length }, (value, number) => getSignalByNumber(number, signals));
      return Object.assign({}, ...signalsA);
    }, "getSignalsByNumber");
    getSignalByNumber = /* @__PURE__ */ __name(function(number, signals) {
      const signal = findSignalByNumber(number, signals);
      if (signal === void 0) {
        return {};
      }
      const { name: name2, description, supported, action, forced, standard } = signal;
      return {
        [number]: {
          name: name2,
          number,
          description,
          supported,
          action,
          forced,
          standard
        }
      };
    }, "getSignalByNumber");
    findSignalByNumber = /* @__PURE__ */ __name(function(number, signals) {
      const signal = signals.find(({ name: name2 }) => os11.constants.signals[name2] === number);
      if (signal !== void 0) {
        return signal;
      }
      return signals.find((signalA) => signalA.number === number);
    }, "findSignalByNumber");
    getSignalsByNumber();
  }
});

// ../../node_modules/.pnpm/execa@6.1.0/node_modules/execa/lib/error.js
var getErrorPrefix, makeError;
var init_error2 = __esm({
  "../../node_modules/.pnpm/execa@6.1.0/node_modules/execa/lib/error.js"() {
    init_import_meta_url();
    init_main();
    getErrorPrefix = /* @__PURE__ */ __name(({ timedOut, timeout: timeout2, errorCode, signal, signalDescription, exitCode, isCanceled }) => {
      if (timedOut) {
        return `timed out after ${timeout2} milliseconds`;
      }
      if (isCanceled) {
        return "was canceled";
      }
      if (errorCode !== void 0) {
        return `failed with ${errorCode}`;
      }
      if (signal !== void 0) {
        return `was killed with ${signal} (${signalDescription})`;
      }
      if (exitCode !== void 0) {
        return `failed with exit code ${exitCode}`;
      }
      return "failed";
    }, "getErrorPrefix");
    makeError = /* @__PURE__ */ __name(({
      stdout: stdout2,
      stderr: stderr2,
      all: all3,
      error: error2,
      signal,
      exitCode,
      command: command2,
      escapedCommand,
      timedOut,
      isCanceled,
      killed,
      parsed: { options: { timeout: timeout2 } }
    }) => {
      exitCode = exitCode === null ? void 0 : exitCode;
      signal = signal === null ? void 0 : signal;
      const signalDescription = signal === void 0 ? void 0 : signalsByName[signal].description;
      const errorCode = error2 && error2.code;
      const prefix = getErrorPrefix({ timedOut, timeout: timeout2, errorCode, signal, signalDescription, exitCode, isCanceled });
      const execaMessage = `Command ${prefix}: ${command2}`;
      const isError2 = Object.prototype.toString.call(error2) === "[object Error]";
      const shortMessage = isError2 ? `${execaMessage}
${error2.message}` : execaMessage;
      const message = [shortMessage, stderr2, stdout2].filter(Boolean).join("\n");
      if (isError2) {
        error2.originalMessage = error2.message;
        error2.message = message;
      } else {
        error2 = new Error(message);
      }
      error2.shortMessage = shortMessage;
      error2.command = command2;
      error2.escapedCommand = escapedCommand;
      error2.exitCode = exitCode;
      error2.signal = signal;
      error2.signalDescription = signalDescription;
      error2.stdout = stdout2;
      error2.stderr = stderr2;
      if (all3 !== void 0) {
        error2.all = all3;
      }
      if ("bufferedData" in error2) {
        delete error2.bufferedData;
      }
      error2.failed = true;
      error2.timedOut = Boolean(timedOut);
      error2.isCanceled = isCanceled;
      error2.killed = killed && !timedOut;
      return error2;
    }, "makeError");
  }
});

// ../../node_modules/.pnpm/execa@6.1.0/node_modules/execa/lib/stdio.js
var aliases, hasAlias, normalizeStdio;
var init_stdio = __esm({
  "../../node_modules/.pnpm/execa@6.1.0/node_modules/execa/lib/stdio.js"() {
    init_import_meta_url();
    aliases = ["stdin", "stdout", "stderr"];
    hasAlias = /* @__PURE__ */ __name((options) => aliases.some((alias) => options[alias] !== void 0), "hasAlias");
    normalizeStdio = /* @__PURE__ */ __name((options) => {
      if (!options) {
        return;
      }
      const { stdio } = options;
      if (stdio === void 0) {
        return aliases.map((alias) => options[alias]);
      }
      if (hasAlias(options)) {
        throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${aliases.map((alias) => `\`${alias}\``).join(", ")}`);
      }
      if (typeof stdio === "string") {
        return stdio;
      }
      if (!Array.isArray(stdio)) {
        throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``);
      }
      const length = Math.max(stdio.length, aliases.length);
      return Array.from({ length }, (value, index) => stdio[index]);
    }, "normalizeStdio");
  }
});
var import_signal_exit4, DEFAULT_FORCE_KILL_TIMEOUT, spawnedKill, setKillTimeout, shouldForceKill, isSigterm, getForceKillAfterTimeout, spawnedCancel, timeoutKill, setupTimeout, validateTimeout, setExitHandler;
var init_kill = __esm({
  "../../node_modules/.pnpm/execa@6.1.0/node_modules/execa/lib/kill.js"() {
    init_import_meta_url();
    import_signal_exit4 = __toESM(require_signal_exit(), 1);
    DEFAULT_FORCE_KILL_TIMEOUT = 1e3 * 5;
    spawnedKill = /* @__PURE__ */ __name((kill, signal = "SIGTERM", options = {}) => {
      const killResult = kill(signal);
      setKillTimeout(kill, signal, options, killResult);
      return killResult;
    }, "spawnedKill");
    setKillTimeout = /* @__PURE__ */ __name((kill, signal, options, killResult) => {
      if (!shouldForceKill(signal, options, killResult)) {
        return;
      }
      const timeout2 = getForceKillAfterTimeout(options);
      const t13 = setTimeout(() => {
        kill("SIGKILL");
      }, timeout2);
      if (t13.unref) {
        t13.unref();
      }
    }, "setKillTimeout");
    shouldForceKill = /* @__PURE__ */ __name((signal, { forceKillAfterTimeout }, killResult) => isSigterm(signal) && forceKillAfterTimeout !== false && killResult, "shouldForceKill");
    isSigterm = /* @__PURE__ */ __name((signal) => signal === os11__namespace.default.constants.signals.SIGTERM || typeof signal === "string" && signal.toUpperCase() === "SIGTERM", "isSigterm");
    getForceKillAfterTimeout = /* @__PURE__ */ __name(({ forceKillAfterTimeout = true }) => {
      if (forceKillAfterTimeout === true) {
        return DEFAULT_FORCE_KILL_TIMEOUT;
      }
      if (!Number.isFinite(forceKillAfterTimeout) || forceKillAfterTimeout < 0) {
        throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${forceKillAfterTimeout}\` (${typeof forceKillAfterTimeout})`);
      }
      return forceKillAfterTimeout;
    }, "getForceKillAfterTimeout");
    spawnedCancel = /* @__PURE__ */ __name((spawned, context2) => {
      const killResult = spawned.kill();
      if (killResult) {
        context2.isCanceled = true;
      }
    }, "spawnedCancel");
    timeoutKill = /* @__PURE__ */ __name((spawned, signal, reject) => {
      spawned.kill(signal);
      reject(Object.assign(new Error("Timed out"), { timedOut: true, signal }));
    }, "timeoutKill");
    setupTimeout = /* @__PURE__ */ __name((spawned, { timeout: timeout2, killSignal = "SIGTERM" }, spawnedPromise) => {
      if (timeout2 === 0 || timeout2 === void 0) {
        return spawnedPromise;
      }
      let timeoutId;
      const timeoutPromise = new Promise((resolve32, reject) => {
        timeoutId = setTimeout(() => {
          timeoutKill(spawned, killSignal, reject);
        }, timeout2);
      });
      const safeSpawnedPromise = spawnedPromise.finally(() => {
        clearTimeout(timeoutId);
      });
      return Promise.race([timeoutPromise, safeSpawnedPromise]);
    }, "setupTimeout");
    validateTimeout = /* @__PURE__ */ __name(({ timeout: timeout2 }) => {
      if (timeout2 !== void 0 && (!Number.isFinite(timeout2) || timeout2 < 0)) {
        throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${timeout2}\` (${typeof timeout2})`);
      }
    }, "validateTimeout");
    setExitHandler = /* @__PURE__ */ __name(async (spawned, { cleanup, detached }, timedPromise) => {
      if (!cleanup || detached) {
        return timedPromise;
      }
      const removeExitHandler = (0, import_signal_exit4.default)(() => {
        spawned.kill();
      });
      return timedPromise.finally(() => {
        removeExitHandler();
      });
    }, "setExitHandler");
  }
});

// ../../node_modules/.pnpm/is-stream@3.0.0/node_modules/is-stream/index.js
function isStream(stream2) {
  return stream2 !== null && typeof stream2 === "object" && typeof stream2.pipe === "function";
}
var init_is_stream = __esm({
  "../../node_modules/.pnpm/is-stream@3.0.0/node_modules/is-stream/index.js"() {
    init_import_meta_url();
    __name(isStream, "isStream");
  }
});

// ../../node_modules/.pnpm/get-stream@6.0.1/node_modules/get-stream/buffer-stream.js
var require_buffer_stream = __commonJS({
  "../../node_modules/.pnpm/get-stream@6.0.1/node_modules/get-stream/buffer-stream.js"(exports, module2) {
    init_import_meta_url();
    var { PassThrough: PassThroughStream } = __require("stream");
    module2.exports = (options) => {
      options = { ...options };
      const { array } = options;
      let { encoding } = options;
      const isBuffer = encoding === "buffer";
      let objectMode = false;
      if (array) {
        objectMode = !(encoding || isBuffer);
      } else {
        encoding = encoding || "utf8";
      }
      if (isBuffer) {
        encoding = null;
      }
      const stream2 = new PassThroughStream({ objectMode });
      if (encoding) {
        stream2.setEncoding(encoding);
      }
      let length = 0;
      const chunks = [];
      stream2.on("data", (chunk) => {
        chunks.push(chunk);
        if (objectMode) {
          length = chunks.length;
        } else {
          length += chunk.length;
        }
      });
      stream2.getBufferedValue = () => {
        if (array) {
          return chunks;
        }
        return isBuffer ? Buffer.concat(chunks, length) : chunks.join("");
      };
      stream2.getBufferedLength = () => length;
      return stream2;
    };
  }
});

// ../../node_modules/.pnpm/get-stream@6.0.1/node_modules/get-stream/index.js
var require_get_stream = __commonJS({
  "../../node_modules/.pnpm/get-stream@6.0.1/node_modules/get-stream/index.js"(exports, module2) {
    init_import_meta_url();
    var { constants: BufferConstants } = __require("buffer");
    var stream2 = __require("stream");
    var { promisify: promisify9 } = __require("util");
    var bufferStream = require_buffer_stream();
    var streamPipelinePromisified = promisify9(stream2.pipeline);
    var MaxBufferError = class extends Error {
      static {
        __name(this, "MaxBufferError");
      }
      constructor() {
        super("maxBuffer exceeded");
        this.name = "MaxBufferError";
      }
    };
    async function getStream3(inputStream, options) {
      if (!inputStream) {
        throw new Error("Expected a stream");
      }
      options = {
        maxBuffer: Infinity,
        ...options
      };
      const { maxBuffer } = options;
      const stream3 = bufferStream(options);
      await new Promise((resolve32, reject) => {
        const rejectPromise = /* @__PURE__ */ __name((error2) => {
          if (error2 && stream3.getBufferedLength() <= BufferConstants.MAX_LENGTH) {
            error2.bufferedData = stream3.getBufferedValue();
          }
          reject(error2);
        }, "rejectPromise");
        (async () => {
          try {
            await streamPipelinePromisified(inputStream, stream3);
            resolve32();
          } catch (error2) {
            rejectPromise(error2);
          }
        })();
        stream3.on("data", () => {
          if (stream3.getBufferedLength() > maxBuffer) {
            rejectPromise(new MaxBufferError());
          }
        });
      });
      return stream3.getBufferedValue();
    }
    __name(getStream3, "getStream");
    module2.exports = getStream3;
    module2.exports.buffer = (stream3, options) => getStream3(stream3, { ...options, encoding: "buffer" });
    module2.exports.array = (stream3, options) => getStream3(stream3, { ...options, array: true });
    module2.exports.MaxBufferError = MaxBufferError;
  }
});

// ../../node_modules/.pnpm/merge-stream@2.0.0/node_modules/merge-stream/index.js
var require_merge_stream = __commonJS({
  "../../node_modules/.pnpm/merge-stream@2.0.0/node_modules/merge-stream/index.js"(exports, module2) {
    init_import_meta_url();
    var { PassThrough: PassThrough4 } = __require("stream");
    module2.exports = function() {
      var sources = [];
      var output = new PassThrough4({ objectMode: true });
      output.setMaxListeners(0);
      output.add = add;
      output.isEmpty = isEmpty;
      output.on("unpipe", remove);
      Array.prototype.slice.call(arguments).forEach(add);
      return output;
      function add(source) {
        if (Array.isArray(source)) {
          source.forEach(add);
          return this;
        }
        sources.push(source);
        source.once("end", remove.bind(null, source));
        source.once("error", output.emit.bind(output, "error"));
        source.pipe(output, { end: false });
        return this;
      }
      function isEmpty() {
        return sources.length == 0;
      }
      function remove(source) {
        sources = sources.filter(function(it2) {
          return it2 !== source;
        });
        if (!sources.length && output.readable) {
          output.end();
        }
      }
    };
  }
});

// ../../node_modules/.pnpm/execa@6.1.0/node_modules/execa/lib/stream.js
var import_get_stream, import_merge_stream, handleInput, makeAllStream, getBufferedData, getStreamPromise, getSpawnedResult, validateInputSync;
var init_stream = __esm({
  "../../node_modules/.pnpm/execa@6.1.0/node_modules/execa/lib/stream.js"() {
    init_import_meta_url();
    init_is_stream();
    import_get_stream = __toESM(require_get_stream(), 1);
    import_merge_stream = __toESM(require_merge_stream(), 1);
    handleInput = /* @__PURE__ */ __name((spawned, input) => {
      if (input === void 0 || spawned.stdin === void 0) {
        return;
      }
      if (isStream(input)) {
        input.pipe(spawned.stdin);
      } else {
        spawned.stdin.end(input);
      }
    }, "handleInput");
    makeAllStream = /* @__PURE__ */ __name((spawned, { all: all3 }) => {
      if (!all3 || !spawned.stdout && !spawned.stderr) {
        return;
      }
      const mixed = (0, import_merge_stream.default)();
      if (spawned.stdout) {
        mixed.add(spawned.stdout);
      }
      if (spawned.stderr) {
        mixed.add(spawned.stderr);
      }
      return mixed;
    }, "makeAllStream");
    getBufferedData = /* @__PURE__ */ __name(async (stream2, streamPromise) => {
      if (!stream2) {
        return;
      }
      stream2.destroy();
      try {
        return await streamPromise;
      } catch (error2) {
        return error2.bufferedData;
      }
    }, "getBufferedData");
    getStreamPromise = /* @__PURE__ */ __name((stream2, { encoding, buffer, maxBuffer }) => {
      if (!stream2 || !buffer) {
        return;
      }
      if (encoding) {
        return (0, import_get_stream.default)(stream2, { encoding, maxBuffer });
      }
      return import_get_stream.default.buffer(stream2, { maxBuffer });
    }, "getStreamPromise");
    getSpawnedResult = /* @__PURE__ */ __name(async ({ stdout: stdout2, stderr: stderr2, all: all3 }, { encoding, buffer, maxBuffer }, processDone) => {
      const stdoutPromise = getStreamPromise(stdout2, { encoding, buffer, maxBuffer });
      const stderrPromise = getStreamPromise(stderr2, { encoding, buffer, maxBuffer });
      const allPromise = getStreamPromise(all3, { encoding, buffer, maxBuffer: maxBuffer * 2 });
      try {
        return await Promise.all([processDone, stdoutPromise, stderrPromise, allPromise]);
      } catch (error2) {
        return Promise.all([
          { error: error2, signal: error2.signal, timedOut: error2.timedOut },
          getBufferedData(stdout2, stdoutPromise),
          getBufferedData(stderr2, stderrPromise),
          getBufferedData(all3, allPromise)
        ]);
      }
    }, "getSpawnedResult");
    validateInputSync = /* @__PURE__ */ __name(({ input }) => {
      if (isStream(input)) {
        throw new TypeError("The `input` option cannot be a stream in sync mode");
      }
    }, "validateInputSync");
  }
});

// ../../node_modules/.pnpm/execa@6.1.0/node_modules/execa/lib/promise.js
var nativePromisePrototype, descriptors, mergePromise, getSpawnedPromise;
var init_promise = __esm({
  "../../node_modules/.pnpm/execa@6.1.0/node_modules/execa/lib/promise.js"() {
    init_import_meta_url();
    nativePromisePrototype = (async () => {
    })().constructor.prototype;
    descriptors = ["then", "catch", "finally"].map((property) => [
      property,
      Reflect.getOwnPropertyDescriptor(nativePromisePrototype, property)
    ]);
    mergePromise = /* @__PURE__ */ __name((spawned, promise) => {
      for (const [property, descriptor] of descriptors) {
        const value = typeof promise === "function" ? (...args) => Reflect.apply(descriptor.value, promise(), args) : descriptor.value.bind(promise);
        Reflect.defineProperty(spawned, property, { ...descriptor, value });
      }
      return spawned;
    }, "mergePromise");
    getSpawnedPromise = /* @__PURE__ */ __name((spawned) => new Promise((resolve32, reject) => {
      spawned.on("exit", (exitCode, signal) => {
        resolve32({ exitCode, signal });
      });
      spawned.on("error", (error2) => {
        reject(error2);
      });
      if (spawned.stdin) {
        spawned.stdin.on("error", (error2) => {
          reject(error2);
        });
      }
    }), "getSpawnedPromise");
  }
});

// ../../node_modules/.pnpm/execa@6.1.0/node_modules/execa/lib/command.js
var normalizeArgs, NO_ESCAPE_REGEXP, DOUBLE_QUOTES_REGEXP, escapeArg, joinCommand, getEscapedCommand, SPACES_REGEXP, parseCommand;
var init_command = __esm({
  "../../node_modules/.pnpm/execa@6.1.0/node_modules/execa/lib/command.js"() {
    init_import_meta_url();
    normalizeArgs = /* @__PURE__ */ __name((file3, args = []) => {
      if (!Array.isArray(args)) {
        return [file3];
      }
      return [file3, ...args];
    }, "normalizeArgs");
    NO_ESCAPE_REGEXP = /^[\w.-]+$/;
    DOUBLE_QUOTES_REGEXP = /"/g;
    escapeArg = /* @__PURE__ */ __name((arg) => {
      if (typeof arg !== "string" || NO_ESCAPE_REGEXP.test(arg)) {
        return arg;
      }
      return `"${arg.replace(DOUBLE_QUOTES_REGEXP, '\\"')}"`;
    }, "escapeArg");
    joinCommand = /* @__PURE__ */ __name((file3, args) => normalizeArgs(file3, args).join(" "), "joinCommand");
    getEscapedCommand = /* @__PURE__ */ __name((file3, args) => normalizeArgs(file3, args).map((arg) => escapeArg(arg)).join(" "), "getEscapedCommand");
    SPACES_REGEXP = / +/g;
    parseCommand = /* @__PURE__ */ __name((command2) => {
      const tokens = [];
      for (const token of command2.trim().split(SPACES_REGEXP)) {
        const previousToken = tokens[tokens.length - 1];
        if (previousToken && previousToken.endsWith("\\")) {
          tokens[tokens.length - 1] = `${previousToken.slice(0, -1)} ${token}`;
        } else {
          tokens.push(token);
        }
      }
      return tokens;
    }, "parseCommand");
  }
});
function execa(file3, args, options) {
  const parsed = handleArguments(file3, args, options);
  const command2 = joinCommand(file3, args);
  const escapedCommand = getEscapedCommand(file3, args);
  validateTimeout(parsed.options);
  let spawned;
  try {
    spawned = childProcess__default.default.spawn(parsed.file, parsed.args, parsed.options);
  } catch (error2) {
    const dummySpawned = new childProcess__default.default.ChildProcess();
    const errorPromise = Promise.reject(makeError({
      error: error2,
      stdout: "",
      stderr: "",
      all: "",
      command: command2,
      escapedCommand,
      parsed,
      timedOut: false,
      isCanceled: false,
      killed: false
    }));
    return mergePromise(dummySpawned, errorPromise);
  }
  const spawnedPromise = getSpawnedPromise(spawned);
  const timedPromise = setupTimeout(spawned, parsed.options, spawnedPromise);
  const processDone = setExitHandler(spawned, parsed.options, timedPromise);
  const context2 = { isCanceled: false };
  spawned.kill = spawnedKill.bind(null, spawned.kill.bind(spawned));
  spawned.cancel = spawnedCancel.bind(null, spawned, context2);
  const handlePromise = /* @__PURE__ */ __name(async () => {
    const [{ error: error2, exitCode, signal, timedOut }, stdoutResult, stderrResult, allResult] = await getSpawnedResult(spawned, parsed.options, processDone);
    const stdout2 = handleOutput(parsed.options, stdoutResult);
    const stderr2 = handleOutput(parsed.options, stderrResult);
    const all3 = handleOutput(parsed.options, allResult);
    if (error2 || exitCode !== 0 || signal !== null) {
      const returnedError = makeError({
        error: error2,
        exitCode,
        signal,
        stdout: stdout2,
        stderr: stderr2,
        all: all3,
        command: command2,
        escapedCommand,
        parsed,
        timedOut,
        isCanceled: context2.isCanceled || (parsed.options.signal ? parsed.options.signal.aborted : false),
        killed: spawned.killed
      });
      if (!parsed.options.reject) {
        return returnedError;
      }
      throw returnedError;
    }
    return {
      command: command2,
      escapedCommand,
      exitCode: 0,
      stdout: stdout2,
      stderr: stderr2,
      all: all3,
      failed: false,
      timedOut: false,
      isCanceled: false,
      killed: false
    };
  }, "handlePromise");
  const handlePromiseOnce = onetime_default(handlePromise);
  handleInput(spawned, parsed.options.input);
  spawned.all = makeAllStream(spawned, parsed.options);
  return mergePromise(spawned, handlePromiseOnce);
}
function execaSync(file3, args, options) {
  const parsed = handleArguments(file3, args, options);
  const command2 = joinCommand(file3, args);
  const escapedCommand = getEscapedCommand(file3, args);
  validateInputSync(parsed.options);
  let result;
  try {
    result = childProcess__default.default.spawnSync(parsed.file, parsed.args, parsed.options);
  } catch (error2) {
    throw makeError({
      error: error2,
      stdout: "",
      stderr: "",
      all: "",
      command: command2,
      escapedCommand,
      parsed,
      timedOut: false,
      isCanceled: false,
      killed: false
    });
  }
  const stdout2 = handleOutput(parsed.options, result.stdout, result.error);
  const stderr2 = handleOutput(parsed.options, result.stderr, result.error);
  if (result.error || result.status !== 0 || result.signal !== null) {
    const error2 = makeError({
      stdout: stdout2,
      stderr: stderr2,
      error: result.error,
      signal: result.signal,
      exitCode: result.status,
      command: command2,
      escapedCommand,
      parsed,
      timedOut: result.error && result.error.code === "ETIMEDOUT",
      isCanceled: false,
      killed: result.signal !== null
    });
    if (!parsed.options.reject) {
      return error2;
    }
    throw error2;
  }
  return {
    command: command2,
    escapedCommand,
    exitCode: 0,
    stdout: stdout2,
    stderr: stderr2,
    failed: false,
    timedOut: false,
    isCanceled: false,
    killed: false
  };
}
function execaCommand(command2, options) {
  const [file3, ...args] = parseCommand(command2);
  return execa(file3, args, options);
}
function execaCommandSync(command2, options) {
  const [file3, ...args] = parseCommand(command2);
  return execaSync(file3, args, options);
}
var import_cross_spawn, DEFAULT_MAX_BUFFER, getEnv, handleArguments, handleOutput;
var init_execa = __esm({
  "../../node_modules/.pnpm/execa@6.1.0/node_modules/execa/index.js"() {
    init_import_meta_url();
    import_cross_spawn = __toESM(require_cross_spawn(), 1);
    init_strip_final_newline();
    init_npm_run_path();
    init_onetime();
    init_error2();
    init_stdio();
    init_kill();
    init_stream();
    init_promise();
    init_command();
    DEFAULT_MAX_BUFFER = 1e3 * 1e3 * 100;
    getEnv = /* @__PURE__ */ __name(({ env: envOption, extendEnv, preferLocal, localDir, execPath }) => {
      const env6 = extendEnv ? { ...process7__default.default.env, ...envOption } : envOption;
      if (preferLocal) {
        return npmRunPathEnv({ env: env6, cwd: localDir, execPath });
      }
      return env6;
    }, "getEnv");
    handleArguments = /* @__PURE__ */ __name((file3, args, options = {}) => {
      const parsed = import_cross_spawn.default._parse(file3, args, options);
      file3 = parsed.command;
      args = parsed.args;
      options = parsed.options;
      options = {
        maxBuffer: DEFAULT_MAX_BUFFER,
        buffer: true,
        stripFinalNewline: true,
        extendEnv: true,
        preferLocal: false,
        localDir: options.cwd || process7__default.default.cwd(),
        execPath: process7__default.default.execPath,
        encoding: "utf8",
        reject: true,
        cleanup: true,
        all: false,
        windowsHide: true,
        ...options
      };
      options.env = getEnv(options);
      options.stdio = normalizeStdio(options);
      if (process7__default.default.platform === "win32" && path3__namespace.default.basename(file3, ".exe") === "cmd") {
        args.unshift("/q");
      }
      return { file: file3, args, options, parsed };
    }, "handleArguments");
    handleOutput = /* @__PURE__ */ __name((options, value, error2) => {
      if (typeof value !== "string" && !buffer.Buffer.isBuffer(value)) {
        return error2 === void 0 ? void 0 : "";
      }
      if (options.stripFinalNewline) {
        return stripFinalNewline(value);
      }
      return value;
    }, "handleOutput");
    __name(execa, "execa");
    __name(execaSync, "execaSync");
    __name(execaCommand, "execaCommand");
    __name(execaCommandSync, "execaCommandSync");
  }
});
async function getPackageManager() {
  const [hasYarn, hasNpm, hasPnpm, hasBun] = await Promise.all([
    supportsYarn(),
    supportsNpm(),
    supportsPnpm(),
    supportsBun()
  ]);
  const userAgent = sniffUserAgent();
  if (userAgent === "npm" && hasNpm) {
    logger.debug("Using npm as package manager.");
    return { ...NpmPackageManager };
  } else if (userAgent === "pnpm" && hasPnpm) {
    logger.debug("Using pnpm as package manager.");
    return { ...PnpmPackageManager };
  } else if (userAgent === "yarn" && hasYarn) {
    logger.debug("Using yarn as package manager.");
    return { ...YarnPackageManager };
  } else if (userAgent === "bun" && hasBun) {
    logger.debug("Using bun as package manager.");
    return { ...BunPackageManager };
  }
  if (hasNpm) {
    logger.debug("Using npm as package manager.");
    return { ...NpmPackageManager };
  } else if (hasYarn) {
    logger.debug("Using yarn as package manager.");
    return { ...YarnPackageManager };
  } else if (hasPnpm) {
    logger.debug("Using pnpm as package manager.");
    return { ...PnpmPackageManager };
  } else if (hasBun) {
    logger.debug("Using bun as package manager.");
    return { ...BunPackageManager };
  } else {
    throw new UserError(
      "Unable to find a package manager. Supported managers are: npm, yarn, pnpm, and bun.",
      {
        telemetryMessage: true
      }
    );
  }
}
async function supports(name2) {
  try {
    execaCommandSync(`${name2} --version`, { stdio: "ignore" });
    return true;
  } catch {
    return false;
  }
}
function supportsYarn() {
  return supports("yarn");
}
function supportsNpm() {
  return supports("npm");
}
function supportsPnpm() {
  return supports("pnpm");
}
function supportsBun() {
  return supports("bun");
}
function sniffUserAgent() {
  const userAgent = process7.env.npm_config_user_agent;
  if (userAgent === void 0) {
    return void 0;
  }
  if (userAgent.includes("yarn")) {
    return "yarn";
  }
  if (userAgent.includes("pnpm")) {
    return "pnpm";
  }
  if (userAgent.includes("bun")) {
    return "bun";
  }
  if (userAgent.includes("npm")) {
    return "npm";
  }
}
var NpmPackageManager, PnpmPackageManager, YarnPackageManager, BunPackageManager;
var init_package_manager = __esm({
  "src/package-manager.ts"() {
    init_import_meta_url();
    init_dist();
    init_execa();
    init_logger();
    __name(getPackageManager, "getPackageManager");
    NpmPackageManager = {
      type: "npm",
      npx: "npx",
      dlx: ["npx"],
      lockFiles: ["package-lock.json"]
    };
    PnpmPackageManager = {
      type: "pnpm",
      npx: "pnpm",
      lockFiles: ["pnpm-lock.yaml"],
      dlx: ["pnpm", "dlx"]
    };
    YarnPackageManager = {
      type: "yarn",
      npx: "yarn",
      dlx: ["yarn", "dlx"],
      lockFiles: ["yarn.lock"]
    };
    BunPackageManager = {
      type: "bun",
      npx: "bunx",
      dlx: ["bunx"],
      lockFiles: ["bun.lockb", "bun.lock"]
    };
    __name(supports, "supports");
    __name(supportsYarn, "supportsYarn");
    __name(supportsNpm, "supportsNpm");
    __name(supportsPnpm, "supportsPnpm");
    __name(supportsBun, "supportsBun");
    __name(sniffUserAgent, "sniffUserAgent");
  }
});

// package.json
var name, version;
var init_package = __esm({
  "package.json"() {
    name = "wrangler";
    version = "4.82.2";
  }
});
function getWranglerVersion() {
  return version;
}
function getPlatform() {
  const platform4 = process.platform;
  switch (platform4) {
    case "win32":
      return "Windows";
    case "darwin":
      return "Mac OS";
    case "linux":
      return "Linux";
    default:
      return `Others: ${platform4}`;
  }
}
function getOS() {
  return process.platform + ":" + process.arch;
}
function getOSVersion() {
  return os11__namespace.default.version();
}
function getNodeVersion() {
  const nodeVersion2 = process.versions.node;
  return parseInt(nodeVersion2.split(".")[0]);
}
var init_helpers = __esm({
  "src/metrics/helpers.ts"() {
    init_import_meta_url();
    init_package();
    __name(getWranglerVersion, "getWranglerVersion");
    __name(getPlatform, "getPlatform");
    __name(getOS, "getOS");
    __name(getOSVersion, "getOSVersion");
    __name(getNodeVersion, "getNodeVersion");
  }
});
function getMetricsConfig({
  sendMetrics
}) {
  const config = readMetricsConfig();
  const deviceId = getDeviceId(config);
  const sendMetricsEnv = getWranglerSendMetricsFromEnv();
  if (sendMetricsEnv !== void 0) {
    return {
      enabled: sendMetricsEnv,
      deviceId
    };
  }
  if (sendMetrics !== void 0) {
    return { enabled: sendMetrics, deviceId };
  }
  const permission = config.permission;
  if (permission !== void 0) {
    if (new Date(permission.date) >= CURRENT_METRICS_DATE) {
      return { enabled: permission.enabled, deviceId };
    } else if (permission.enabled) {
      logger.log(
        "Usage metrics tracking has changed since you last granted permission."
      );
    }
  }
  writeMetricsConfig({
    ...config,
    permission: {
      enabled: true,
      date: /* @__PURE__ */ new Date()
    },
    deviceId
  });
  return { enabled: true, deviceId };
}
function writeMetricsConfig(config) {
  fs29.mkdirSync(path3__namespace.default.dirname(getMetricsConfigPath()), { recursive: true });
  fs29.writeFileSync(
    getMetricsConfigPath(),
    JSON.stringify(
      config,
      (_key, value) => value instanceof Date ? value.toISOString() : value,
      "	"
    )
  );
}
function readMetricsConfig() {
  try {
    const config = fs29.readFileSync(getMetricsConfigPath(), "utf8");
    return JSON.parse(
      config,
      (key, value) => key === "date" ? new Date(value) : value
    );
  } catch {
    return {};
  }
}
function updateMetricsPermission(enabled) {
  const config = readMetricsConfig();
  config.permission = {
    enabled,
    date: /* @__PURE__ */ new Date()
  };
  writeMetricsConfig(config);
}
function getMetricsConfigPath() {
  return path3__namespace.default.resolve(getGlobalWranglerConfigPath(), "metrics.json");
}
function getDeviceId(config) {
  const deviceId = config.deviceId ?? crypto2.randomUUID();
  if (config.deviceId === void 0) {
    writeMetricsConfig({ ...config, deviceId });
  }
  return deviceId;
}
var CURRENT_METRICS_DATE;
var init_metrics_config = __esm({
  "src/metrics/metrics-config.ts"() {
    init_import_meta_url();
    init_dist();
    init_logger();
    CURRENT_METRICS_DATE = new Date(2022, 6, 4);
    __name(getMetricsConfig, "getMetricsConfig");
    __name(writeMetricsConfig, "writeMetricsConfig");
    __name(readMetricsConfig, "readMetricsConfig");
    __name(updateMetricsPermission, "updateMetricsPermission");
    __name(getMetricsConfigPath, "getMetricsConfigPath");
    __name(getDeviceId, "getDeviceId");
  }
});

// src/metrics/metrics-dispatcher.ts
function allMetricsDispatchesCompleted() {
  return Promise.allSettled(pendingRequests).then(() => {
  });
}
function getMetricsDispatcher(options) {
  const wranglerVersion = getWranglerVersion();
  const [wranglerMajorVersion, wranglerMinorVersion, wranglerPatchVersion] = wranglerVersion.split(".").map((v8) => parseInt(v8, 10));
  const amplitude_session_id = Date.now();
  let amplitude_event_id = 0;
  let agent = null;
  try {
    const agentDetection = detectAgenticEnvironment(process.env, []);
    agent = agentDetection.id;
  } catch {
  }
  function getCommonEventProperties() {
    return {
      amplitude_session_id,
      amplitude_event_id: amplitude_event_id++,
      wranglerVersion,
      wranglerMajorVersion,
      wranglerMinorVersion,
      wranglerPatchVersion,
      osPlatform: getPlatform(),
      osVersion: getOSVersion(),
      nodeVersion: getNodeVersion(),
      packageManager: sniffUserAgent(),
      isFirstUsage: readMetricsConfig().permission === void 0,
      configFileType: configFormat(options.configPath),
      isCI: import_ci_info3.default.isCI,
      isPagesCI: import_ci_info3.default.CLOUDFLARE_PAGES,
      isWorkersCI: import_ci_info3.default.CLOUDFLARE_WORKERS,
      isInteractive: isInteractive3(),
      hasAssets: options.hasAssets ?? false,
      agent
    };
  }
  __name(getCommonEventProperties, "getCommonEventProperties");
  return {
    /**
     * This doesn't have a session id and is not tied to the command events.
     *
     * The event should follow these conventions
     *  - name is of the form `[action] [object]` (lower case)
     *  - additional properties are camelCased
     */
    sendAdhocEvent(name2, properties = {}) {
      dispatch({
        name: name2,
        properties: {
          ...getCommonEventProperties(),
          category: "Workers",
          wranglerVersion,
          wranglerMajorVersion,
          wranglerMinorVersion,
          wranglerPatchVersion,
          os: getOS(),
          agent,
          ...properties
        }
      });
    },
    /**
     * Posts events to telemetry when a command is started, has completed, or has errored.
     *
     * @param name The name of the event to send
     * @param properties The properties specific to this event
     * @param cmdBehaviour The behavior of the command being executed. Might not been provided for unrecognized commands.
     */
    sendCommandEvent(name2, properties, cmdBehaviour) {
      if (cmdBehaviour?.sendMetrics === false) {
        return;
      }
      try {
        if (cmdBehaviour?.printMetricsBanner === true) {
          printMetricsBanner();
        }
        const argsUsed = properties.argsUsed;
        const argsCombination = argsUsed.join(", ");
        const commonCommandEventProperties = {
          ...getCommonEventProperties(),
          argsUsed,
          argsCombination
        };
        dispatch({
          name: name2,
          properties: {
            ...commonCommandEventProperties,
            ...properties
          }
        });
      } catch (err) {
        logger.debug("Error sending metrics event", err);
      }
    }
  };
  function dispatch(event) {
    const metricsConfig = getMetricsConfig(options);
    const body = {
      deviceId: metricsConfig.deviceId,
      event: event.name,
      timestamp: Date.now(),
      properties: event.properties
    };
    if (!metricsConfig.enabled) {
      logger.debug(
        `Metrics dispatcher: Dispatching disabled - would have sent ${JSON.stringify(
          body
        )}.`
      );
      return;
    }
    {
      logger.debug(
        "Metrics dispatcher: Source Key not provided. Be sure to initialize before sending events",
        JSON.stringify(body)
      );
      return;
    }
  }
  function printMetricsBanner() {
    const metricsConfig = readMetricsConfig();
    if (metricsConfig.permission?.enabled && metricsConfig.permission?.bannerLastShown !== wranglerVersion) {
      logger.log(
        source_default.gray(
          `
Cloudflare collects anonymous telemetry about your usage of Wrangler. Learn more at https://github.com/cloudflare/workers-sdk/tree/main/packages/wrangler/telemetry.md`
        )
      );
      metricsConfig.permission.bannerLastShown = wranglerVersion;
      writeMetricsConfig(metricsConfig);
    }
  }
}
var import_ci_info3, pendingRequests;
var init_metrics_dispatcher = __esm({
  "src/metrics/metrics-dispatcher.ts"() {
    init_import_meta_url();
    init_dist();
    init_dist3();
    init_source();
    import_ci_info3 = __toESM(require_ci_info());
    __toESM(require_undici());
    init_is_interactive();
    init_logger();
    init_package_manager();
    init_helpers();
    init_metrics_config();
    pendingRequests = /* @__PURE__ */ new Set();
    __name(allMetricsDispatchesCompleted, "allMetricsDispatchesCompleted");
    __name(getMetricsDispatcher, "getMetricsDispatcher");
  }
});

// src/metrics/send-event.ts
function sendMetricsEvent(event, ...args) {
  try {
    const options = args.pop() ?? {};
    const properties = args.pop() ?? {};
    const metricsDispatcher = getMetricsDispatcher(options);
    metricsDispatcher.sendAdhocEvent(event, properties);
  } catch (err) {
    logger.debug("Error sending metrics event", err);
  }
}
var init_send_event = __esm({
  "src/metrics/send-event.ts"() {
    init_import_meta_url();
    init_logger();
    init_metrics_dispatcher();
    __name(sendMetricsEvent, "sendMetricsEvent");
  }
});

// src/metrics/metrics-usage-headers.ts
async function getMetricsUsageHeaders(sendMetrics) {
  const metricsEnabled = (await getMetricsConfig({
    sendMetrics
  })).enabled;
  if (metricsEnabled) {
    return {
      metricsEnabled: "true"
    };
  } else {
    return void 0;
  }
}
var init_metrics_usage_headers = __esm({
  "src/metrics/metrics-usage-headers.ts"() {
    init_import_meta_url();
    init_metrics_config();
    __name(getMetricsUsageHeaders, "getMetricsUsageHeaders");
  }
});

// src/metrics/index.ts
var init_metrics = __esm({
  "src/metrics/index.ts"() {
    init_import_meta_url();
    init_metrics_dispatcher();
    init_metrics_config();
    init_send_event();
    init_metrics_usage_headers();
  }
});

// ../workers-shared/utils/constants.ts
var MAX_ASSET_SIZE, CF_ASSETS_IGNORE_FILENAME, REDIRECTS_FILENAME, HEADERS_FILENAME;
var init_constants = __esm({
  "../workers-shared/utils/constants.ts"() {
    init_import_meta_url();
    MAX_ASSET_SIZE = 25 * 1024 * 1024;
    CF_ASSETS_IGNORE_FILENAME = ".assetsignore";
    REDIRECTS_FILENAME = "_redirects";
    HEADERS_FILENAME = "_headers";
  }
});

// ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/util.js
var util2, objectUtil2, ZodParsedType2, getParsedType2;
var init_util = __esm({
  "../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/util.js"() {
    init_import_meta_url();
    (function(util5) {
      util5.assertEqual = (_5) => {
      };
      function assertIs(_arg) {
      }
      __name(assertIs, "assertIs");
      util5.assertIs = assertIs;
      function assertNever4(_x2) {
        throw new Error();
      }
      __name(assertNever4, "assertNever");
      util5.assertNever = assertNever4;
      util5.arrayToEnum = (items) => {
        const obj = {};
        for (const item of items) {
          obj[item] = item;
        }
        return obj;
      };
      util5.getValidEnumValues = (obj) => {
        const validKeys = util5.objectKeys(obj).filter((k7) => typeof obj[obj[k7]] !== "number");
        const filtered = {};
        for (const k7 of validKeys) {
          filtered[k7] = obj[k7];
        }
        return util5.objectValues(filtered);
      };
      util5.objectValues = (obj) => {
        return util5.objectKeys(obj).map(function(e10) {
          return obj[e10];
        });
      };
      util5.objectKeys = typeof Object.keys === "function" ? (obj) => Object.keys(obj) : (object) => {
        const keys = [];
        for (const key in object) {
          if (Object.prototype.hasOwnProperty.call(object, key)) {
            keys.push(key);
          }
        }
        return keys;
      };
      util5.find = (arr, checker) => {
        for (const item of arr) {
          if (checker(item))
            return item;
        }
        return void 0;
      };
      util5.isInteger = typeof Number.isInteger === "function" ? (val2) => Number.isInteger(val2) : (val2) => typeof val2 === "number" && Number.isFinite(val2) && Math.floor(val2) === val2;
      function joinValues(array, separator = " | ") {
        return array.map((val2) => typeof val2 === "string" ? `'${val2}'` : val2).join(separator);
      }
      __name(joinValues, "joinValues");
      util5.joinValues = joinValues;
      util5.jsonStringifyReplacer = (_5, value) => {
        if (typeof value === "bigint") {
          return value.toString();
        }
        return value;
      };
    })(util2 || (util2 = {}));
    (function(objectUtil4) {
      objectUtil4.mergeShapes = (first, second) => {
        return {
          ...first,
          ...second
          // second overwrites first
        };
      };
    })(objectUtil2 || (objectUtil2 = {}));
    ZodParsedType2 = util2.arrayToEnum([
      "string",
      "nan",
      "number",
      "integer",
      "float",
      "boolean",
      "date",
      "bigint",
      "symbol",
      "function",
      "undefined",
      "null",
      "array",
      "object",
      "unknown",
      "promise",
      "void",
      "never",
      "map",
      "set"
    ]);
    getParsedType2 = /* @__PURE__ */ __name((data) => {
      const t13 = typeof data;
      switch (t13) {
        case "undefined":
          return ZodParsedType2.undefined;
        case "string":
          return ZodParsedType2.string;
        case "number":
          return Number.isNaN(data) ? ZodParsedType2.nan : ZodParsedType2.number;
        case "boolean":
          return ZodParsedType2.boolean;
        case "function":
          return ZodParsedType2.function;
        case "bigint":
          return ZodParsedType2.bigint;
        case "symbol":
          return ZodParsedType2.symbol;
        case "object":
          if (Array.isArray(data)) {
            return ZodParsedType2.array;
          }
          if (data === null) {
            return ZodParsedType2.null;
          }
          if (data.then && typeof data.then === "function" && data.catch && typeof data.catch === "function") {
            return ZodParsedType2.promise;
          }
          if (typeof Map !== "undefined" && data instanceof Map) {
            return ZodParsedType2.map;
          }
          if (typeof Set !== "undefined" && data instanceof Set) {
            return ZodParsedType2.set;
          }
          if (typeof Date !== "undefined" && data instanceof Date) {
            return ZodParsedType2.date;
          }
          return ZodParsedType2.object;
        default:
          return ZodParsedType2.unknown;
      }
    }, "getParsedType");
  }
});

// ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/ZodError.js
var ZodIssueCode2, quotelessJson2, ZodError2;
var init_ZodError = __esm({
  "../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/ZodError.js"() {
    init_import_meta_url();
    init_util();
    ZodIssueCode2 = util2.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"
    ]);
    quotelessJson2 = /* @__PURE__ */ __name((obj) => {
      const json = JSON.stringify(obj, null, 2);
      return json.replace(/"([^"]+)":/g, "$1:");
    }, "quotelessJson");
    ZodError2 = class _ZodError extends Error {
      static {
        __name(this, "ZodError");
      }
      get errors() {
        return this.issues;
      }
      constructor(issues) {
        super();
        this.issues = [];
        this.addIssue = (sub) => {
          this.issues = [...this.issues, sub];
        };
        this.addIssues = (subs = []) => {
          this.issues = [...this.issues, ...subs];
        };
        const actualProto = new.target.prototype;
        if (Object.setPrototypeOf) {
          Object.setPrototypeOf(this, actualProto);
        } else {
          this.__proto__ = actualProto;
        }
        this.name = "ZodError";
        this.issues = issues;
      }
      format(_mapper) {
        const mapper = _mapper || function(issue) {
          return issue.message;
        };
        const fieldErrors = { _errors: [] };
        const processError = /* @__PURE__ */ __name((error2) => {
          for (const issue of error2.issues) {
            if (issue.code === "invalid_union") {
              issue.unionErrors.map(processError);
            } else if (issue.code === "invalid_return_type") {
              processError(issue.returnTypeError);
            } else if (issue.code === "invalid_arguments") {
              processError(issue.argumentsError);
            } else if (issue.path.length === 0) {
              fieldErrors._errors.push(mapper(issue));
            } else {
              let curr = fieldErrors;
              let i7 = 0;
              while (i7 < issue.path.length) {
                const el = issue.path[i7];
                const terminal = i7 === issue.path.length - 1;
                if (!terminal) {
                  curr[el] = curr[el] || { _errors: [] };
                } else {
                  curr[el] = curr[el] || { _errors: [] };
                  curr[el]._errors.push(mapper(issue));
                }
                curr = curr[el];
                i7++;
              }
            }
          }
        }, "processError");
        processError(this);
        return fieldErrors;
      }
      static assert(value) {
        if (!(value instanceof _ZodError)) {
          throw new Error(`Not a ZodError: ${value}`);
        }
      }
      toString() {
        return this.message;
      }
      get message() {
        return JSON.stringify(this.issues, util2.jsonStringifyReplacer, 2);
      }
      get isEmpty() {
        return this.issues.length === 0;
      }
      flatten(mapper = (issue) => issue.message) {
        const fieldErrors = {};
        const formErrors = [];
        for (const sub of this.issues) {
          if (sub.path.length > 0) {
            const firstEl = sub.path[0];
            fieldErrors[firstEl] = fieldErrors[firstEl] || [];
            fieldErrors[firstEl].push(mapper(sub));
          } else {
            formErrors.push(mapper(sub));
          }
        }
        return { formErrors, fieldErrors };
      }
      get formErrors() {
        return this.flatten();
      }
    };
    ZodError2.create = (issues) => {
      const error2 = new ZodError2(issues);
      return error2;
    };
  }
});

// ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/locales/en.js
var errorMap2, en_default;
var init_en = __esm({
  "../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/locales/en.js"() {
    init_import_meta_url();
    init_ZodError();
    init_util();
    errorMap2 = /* @__PURE__ */ __name((issue, _ctx) => {
      let message;
      switch (issue.code) {
        case ZodIssueCode2.invalid_type:
          if (issue.received === ZodParsedType2.undefined) {
            message = "Required";
          } else {
            message = `Expected ${issue.expected}, received ${issue.received}`;
          }
          break;
        case ZodIssueCode2.invalid_literal:
          message = `Invalid literal value, expected ${JSON.stringify(issue.expected, util2.jsonStringifyReplacer)}`;
          break;
        case ZodIssueCode2.unrecognized_keys:
          message = `Unrecognized key(s) in object: ${util2.joinValues(issue.keys, ", ")}`;
          break;
        case ZodIssueCode2.invalid_union:
          message = `Invalid input`;
          break;
        case ZodIssueCode2.invalid_union_discriminator:
          message = `Invalid discriminator value. Expected ${util2.joinValues(issue.options)}`;
          break;
        case ZodIssueCode2.invalid_enum_value:
          message = `Invalid enum value. Expected ${util2.joinValues(issue.options)}, received '${issue.received}'`;
          break;
        case ZodIssueCode2.invalid_arguments:
          message = `Invalid function arguments`;
          break;
        case ZodIssueCode2.invalid_return_type:
          message = `Invalid function return type`;
          break;
        case ZodIssueCode2.invalid_date:
          message = `Invalid date`;
          break;
        case ZodIssueCode2.invalid_string:
          if (typeof issue.validation === "object") {
            if ("includes" in issue.validation) {
              message = `Invalid input: must include "${issue.validation.includes}"`;
              if (typeof issue.validation.position === "number") {
                message = `${message} at one or more positions greater than or equal to ${issue.validation.position}`;
              }
            } else if ("startsWith" in issue.validation) {
              message = `Invalid input: must start with "${issue.validation.startsWith}"`;
            } else if ("endsWith" in issue.validation) {
              message = `Invalid input: must end with "${issue.validation.endsWith}"`;
            } else {
              util2.assertNever(issue.validation);
            }
          } else if (issue.validation !== "regex") {
            message = `Invalid ${issue.validation}`;
          } else {
            message = "Invalid";
          }
          break;
        case ZodIssueCode2.too_small:
          if (issue.type === "array")
            message = `Array must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `more than`} ${issue.minimum} element(s)`;
          else if (issue.type === "string")
            message = `String must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`;
          else if (issue.type === "number")
            message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;
          else if (issue.type === "bigint")
            message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;
          else if (issue.type === "date")
            message = `Date must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${new Date(Number(issue.minimum))}`;
          else
            message = "Invalid input";
          break;
        case ZodIssueCode2.too_big:
          if (issue.type === "array")
            message = `Array must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `less than`} ${issue.maximum} element(s)`;
          else if (issue.type === "string")
            message = `String must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`;
          else if (issue.type === "number")
            message = `Number must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;
          else if (issue.type === "bigint")
            message = `BigInt must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;
          else if (issue.type === "date")
            message = `Date must be ${issue.exact ? `exactly` : issue.inclusive ? `smaller than or equal to` : `smaller than`} ${new Date(Number(issue.maximum))}`;
          else
            message = "Invalid input";
          break;
        case ZodIssueCode2.custom:
          message = `Invalid input`;
          break;
        case ZodIssueCode2.invalid_intersection_types:
          message = `Intersection results could not be merged`;
          break;
        case ZodIssueCode2.not_multiple_of:
          message = `Number must be a multiple of ${issue.multipleOf}`;
          break;
        case ZodIssueCode2.not_finite:
          message = "Number must be finite";
          break;
        default:
          message = _ctx.defaultError;
          util2.assertNever(issue);
      }
      return { message };
    }, "errorMap");
    en_default = errorMap2;
  }
});

// ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/errors.js
function setErrorMap2(map2) {
  overrideErrorMap2 = map2;
}
function getErrorMap2() {
  return overrideErrorMap2;
}
var overrideErrorMap2;
var init_errors = __esm({
  "../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/errors.js"() {
    init_import_meta_url();
    init_en();
    overrideErrorMap2 = en_default;
    __name(setErrorMap2, "setErrorMap");
    __name(getErrorMap2, "getErrorMap");
  }
});

// ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.js
function addIssueToContext2(ctx, issueData) {
  const overrideMap = getErrorMap2();
  const issue = makeIssue2({
    issueData,
    data: ctx.data,
    path: ctx.path,
    errorMaps: [
      ctx.common.contextualErrorMap,
      // contextual error map is first priority
      ctx.schemaErrorMap,
      // then schema-bound map if available
      overrideMap,
      // then global override map
      overrideMap === en_default ? void 0 : en_default
      // then global default map
    ].filter((x7) => !!x7)
  });
  ctx.common.issues.push(issue);
}
var makeIssue2, EMPTY_PATH2, ParseStatus2, INVALID2, DIRTY2, OK2, isAborted2, isDirty2, isValid2, isAsync2;
var init_parseUtil = __esm({
  "../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.js"() {
    init_import_meta_url();
    init_errors();
    init_en();
    makeIssue2 = /* @__PURE__ */ __name((params) => {
      const { data, path: path84, errorMaps, issueData } = params;
      const fullPath = [...path84, ...issueData.path || []];
      const fullIssue = {
        ...issueData,
        path: fullPath
      };
      if (issueData.message !== void 0) {
        return {
          ...issueData,
          path: fullPath,
          message: issueData.message
        };
      }
      let errorMessage = "";
      const maps = errorMaps.filter((m7) => !!m7).slice().reverse();
      for (const map2 of maps) {
        errorMessage = map2(fullIssue, { data, defaultError: errorMessage }).message;
      }
      return {
        ...issueData,
        path: fullPath,
        message: errorMessage
      };
    }, "makeIssue");
    EMPTY_PATH2 = [];
    __name(addIssueToContext2, "addIssueToContext");
    ParseStatus2 = class _ParseStatus2 {
      static {
        __name(this, "ParseStatus");
      }
      constructor() {
        this.value = "valid";
      }
      dirty() {
        if (this.value === "valid")
          this.value = "dirty";
      }
      abort() {
        if (this.value !== "aborted")
          this.value = "aborted";
      }
      static mergeArray(status2, results) {
        const arrayValue = [];
        for (const s7 of results) {
          if (s7.status === "aborted")
            return INVALID2;
          if (s7.status === "dirty")
            status2.dirty();
          arrayValue.push(s7.value);
        }
        return { status: status2.value, value: arrayValue };
      }
      static async mergeObjectAsync(status2, pairs) {
        const syncPairs = [];
        for (const pair of pairs) {
          const key = await pair.key;
          const value = await pair.value;
          syncPairs.push({
            key,
            value
          });
        }
        return _ParseStatus2.mergeObjectSync(status2, syncPairs);
      }
      static mergeObjectSync(status2, pairs) {
        const finalObject = {};
        for (const pair of pairs) {
          const { key, value } = pair;
          if (key.status === "aborted")
            return INVALID2;
          if (value.status === "aborted")
            return INVALID2;
          if (key.status === "dirty")
            status2.dirty();
          if (value.status === "dirty")
            status2.dirty();
          if (key.value !== "__proto__" && (typeof value.value !== "undefined" || pair.alwaysSet)) {
            finalObject[key.value] = value.value;
          }
        }
        return { status: status2.value, value: finalObject };
      }
    };
    INVALID2 = Object.freeze({
      status: "aborted"
    });
    DIRTY2 = /* @__PURE__ */ __name((value) => ({ status: "dirty", value }), "DIRTY");
    OK2 = /* @__PURE__ */ __name((value) => ({ status: "valid", value }), "OK");
    isAborted2 = /* @__PURE__ */ __name((x7) => x7.status === "aborted", "isAborted");
    isDirty2 = /* @__PURE__ */ __name((x7) => x7.status === "dirty", "isDirty");
    isValid2 = /* @__PURE__ */ __name((x7) => x7.status === "valid", "isValid");
    isAsync2 = /* @__PURE__ */ __name((x7) => typeof Promise !== "undefined" && x7 instanceof Promise, "isAsync");
  }
});

// ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/typeAliases.js
var init_typeAliases = __esm({
  "../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/typeAliases.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/errorUtil.js
var errorUtil2;
var init_errorUtil = __esm({
  "../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/errorUtil.js"() {
    init_import_meta_url();
    (function(errorUtil4) {
      errorUtil4.errToObj = (message) => typeof message === "string" ? { message } : message || {};
      errorUtil4.toString = (message) => typeof message === "string" ? message : message?.message;
    })(errorUtil2 || (errorUtil2 = {}));
  }
});

// ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.js
function processCreateParams2(params) {
  if (!params)
    return {};
  const { errorMap: errorMap4, invalid_type_error, required_error, description } = params;
  if (errorMap4 && (invalid_type_error || required_error)) {
    throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
  }
  if (errorMap4)
    return { errorMap: errorMap4, description };
  const customMap = /* @__PURE__ */ __name((iss, ctx) => {
    const { message } = params;
    if (iss.code === "invalid_enum_value") {
      return { message: message ?? ctx.defaultError };
    }
    if (typeof ctx.data === "undefined") {
      return { message: message ?? required_error ?? ctx.defaultError };
    }
    if (iss.code !== "invalid_type")
      return { message: ctx.defaultError };
    return { message: message ?? invalid_type_error ?? ctx.defaultError };
  }, "customMap");
  return { errorMap: customMap, description };
}
function timeRegexSource(args) {
  let secondsRegexSource = `[0-5]\\d`;
  if (args.precision) {
    secondsRegexSource = `${secondsRegexSource}\\.\\d{${args.precision}}`;
  } else if (args.precision == null) {
    secondsRegexSource = `${secondsRegexSource}(\\.\\d+)?`;
  }
  const secondsQuantifier = args.precision ? "+" : "?";
  return `([01]\\d|2[0-3]):[0-5]\\d(:${secondsRegexSource})${secondsQuantifier}`;
}
function timeRegex(args) {
  return new RegExp(`^${timeRegexSource(args)}$`);
}
function datetimeRegex2(args) {
  let regex2 = `${dateRegexSource}T${timeRegexSource(args)}`;
  const opts = [];
  opts.push(args.local ? `Z?` : `Z`);
  if (args.offset)
    opts.push(`([+-]\\d{2}:?\\d{2})`);
  regex2 = `${regex2}(${opts.join("|")})`;
  return new RegExp(`^${regex2}$`);
}
function isValidIP2(ip, version5) {
  if ((version5 === "v4" || !version5) && ipv4Regex2.test(ip)) {
    return true;
  }
  if ((version5 === "v6" || !version5) && ipv6Regex2.test(ip)) {
    return true;
  }
  return false;
}
function isValidJWT(jwt, alg) {
  if (!jwtRegex.test(jwt))
    return false;
  try {
    const [header] = jwt.split(".");
    if (!header)
      return false;
    const base642 = header.replace(/-/g, "+").replace(/_/g, "/").padEnd(header.length + (4 - header.length % 4) % 4, "=");
    const decoded = JSON.parse(atob(base642));
    if (typeof decoded !== "object" || decoded === null)
      return false;
    if ("typ" in decoded && decoded?.typ !== "JWT")
      return false;
    if (!decoded.alg)
      return false;
    if (alg && decoded.alg !== alg)
      return false;
    return true;
  } catch {
    return false;
  }
}
function isValidCidr(ip, version5) {
  if ((version5 === "v4" || !version5) && ipv4CidrRegex.test(ip)) {
    return true;
  }
  if ((version5 === "v6" || !version5) && ipv6CidrRegex.test(ip)) {
    return true;
  }
  return false;
}
function floatSafeRemainder2(val2, step) {
  const valDecCount = (val2.toString().split(".")[1] || "").length;
  const stepDecCount = (step.toString().split(".")[1] || "").length;
  const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;
  const valInt = Number.parseInt(val2.toFixed(decCount).replace(".", ""));
  const stepInt = Number.parseInt(step.toFixed(decCount).replace(".", ""));
  return valInt % stepInt / 10 ** decCount;
}
function deepPartialify2(schema) {
  if (schema instanceof ZodObject2) {
    const newShape = {};
    for (const key in schema.shape) {
      const fieldSchema = schema.shape[key];
      newShape[key] = ZodOptional2.create(deepPartialify2(fieldSchema));
    }
    return new ZodObject2({
      ...schema._def,
      shape: /* @__PURE__ */ __name(() => newShape, "shape")
    });
  } else if (schema instanceof ZodArray2) {
    return new ZodArray2({
      ...schema._def,
      type: deepPartialify2(schema.element)
    });
  } else if (schema instanceof ZodOptional2) {
    return ZodOptional2.create(deepPartialify2(schema.unwrap()));
  } else if (schema instanceof ZodNullable2) {
    return ZodNullable2.create(deepPartialify2(schema.unwrap()));
  } else if (schema instanceof ZodTuple2) {
    return ZodTuple2.create(schema.items.map((item) => deepPartialify2(item)));
  } else {
    return schema;
  }
}
function mergeValues2(a7, b11) {
  const aType = getParsedType2(a7);
  const bType = getParsedType2(b11);
  if (a7 === b11) {
    return { valid: true, data: a7 };
  } else if (aType === ZodParsedType2.object && bType === ZodParsedType2.object) {
    const bKeys = util2.objectKeys(b11);
    const sharedKeys = util2.objectKeys(a7).filter((key) => bKeys.indexOf(key) !== -1);
    const newObj = { ...a7, ...b11 };
    for (const key of sharedKeys) {
      const sharedValue = mergeValues2(a7[key], b11[key]);
      if (!sharedValue.valid) {
        return { valid: false };
      }
      newObj[key] = sharedValue.data;
    }
    return { valid: true, data: newObj };
  } else if (aType === ZodParsedType2.array && bType === ZodParsedType2.array) {
    if (a7.length !== b11.length) {
      return { valid: false };
    }
    const newArray = [];
    for (let index = 0; index < a7.length; index++) {
      const itemA = a7[index];
      const itemB = b11[index];
      const sharedValue = mergeValues2(itemA, itemB);
      if (!sharedValue.valid) {
        return { valid: false };
      }
      newArray.push(sharedValue.data);
    }
    return { valid: true, data: newArray };
  } else if (aType === ZodParsedType2.date && bType === ZodParsedType2.date && +a7 === +b11) {
    return { valid: true, data: a7 };
  } else {
    return { valid: false };
  }
}
function createZodEnum2(values, params) {
  return new ZodEnum2({
    values,
    typeName: ZodFirstPartyTypeKind2.ZodEnum,
    ...processCreateParams2(params)
  });
}
function cleanParams(params, data) {
  const p7 = typeof params === "function" ? params(data) : typeof params === "string" ? { message: params } : params;
  const p22 = typeof p7 === "string" ? { message: p7 } : p7;
  return p22;
}
function custom2(check, _params = {}, fatal) {
  if (check)
    return ZodAny2.create().superRefine((data, ctx) => {
      const r10 = check(data);
      if (r10 instanceof Promise) {
        return r10.then((r11) => {
          if (!r11) {
            const params = cleanParams(_params, data);
            const _fatal = params.fatal ?? fatal ?? true;
            ctx.addIssue({ code: "custom", ...params, fatal: _fatal });
          }
        });
      }
      if (!r10) {
        const params = cleanParams(_params, data);
        const _fatal = params.fatal ?? fatal ?? true;
        ctx.addIssue({ code: "custom", ...params, fatal: _fatal });
      }
      return;
    });
  return ZodAny2.create();
}
var ParseInputLazyPath2, handleResult2, ZodType2, cuidRegex2, cuid2Regex2, ulidRegex2, uuidRegex2, nanoidRegex, jwtRegex, durationRegex, emailRegex2, _emojiRegex, emojiRegex3, ipv4Regex2, ipv4CidrRegex, ipv6Regex2, ipv6CidrRegex, base64Regex, base64urlRegex, dateRegexSource, dateRegex, ZodString2, ZodNumber2, ZodBigInt2, ZodBoolean2, ZodDate2, ZodSymbol2, ZodUndefined2, ZodNull2, ZodAny2, ZodUnknown2, ZodNever2, ZodVoid2, ZodArray2, ZodObject2, ZodUnion2, getDiscriminator2, ZodDiscriminatedUnion2, ZodIntersection2, ZodTuple2, ZodRecord2, ZodMap2, ZodSet2, ZodFunction2, ZodLazy2, ZodLiteral2, ZodEnum2, ZodNativeEnum2, ZodPromise2, ZodEffects2, ZodOptional2, ZodNullable2, ZodDefault2, ZodCatch2, ZodNaN2, BRAND2, ZodBranded2, ZodPipeline2, ZodReadonly2, late2, ZodFirstPartyTypeKind2, instanceOfType2, stringType2, numberType2, nanType2, bigIntType2, booleanType2, dateType2, symbolType2, undefinedType2, nullType2, anyType2, unknownType2, neverType2, voidType2, arrayType2, objectType2, strictObjectType2, unionType2, discriminatedUnionType2, intersectionType2, tupleType2, recordType2, mapType2, setType2, functionType2, lazyType2, literalType2, enumType2, nativeEnumType2, promiseType2, effectsType2, optionalType2, nullableType2, preprocessType2, pipelineType2, ostring2, onumber2, oboolean2, coerce2, NEVER2;
var init_types2 = __esm({
  "../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.js"() {
    init_import_meta_url();
    init_ZodError();
    init_errors();
    init_errorUtil();
    init_parseUtil();
    init_util();
    ParseInputLazyPath2 = class {
      static {
        __name(this, "ParseInputLazyPath");
      }
      constructor(parent, value, path84, key) {
        this._cachedPath = [];
        this.parent = parent;
        this.data = value;
        this._path = path84;
        this._key = key;
      }
      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;
      }
    };
    handleResult2 = /* @__PURE__ */ __name((ctx, result) => {
      if (isValid2(result)) {
        return { success: true, data: result.value };
      } else {
        if (!ctx.common.issues.length) {
          throw new Error("Validation failed but no issues detected.");
        }
        return {
          success: false,
          get error() {
            if (this._error)
              return this._error;
            const error2 = new ZodError2(ctx.common.issues);
            this._error = error2;
            return this._error;
          }
        };
      }
    }, "handleResult");
    __name(processCreateParams2, "processCreateParams");
    ZodType2 = class {
      static {
        __name(this, "ZodType");
      }
      get description() {
        return this._def.description;
      }
      _getType(input) {
        return getParsedType2(input.data);
      }
      _getOrReturnCtx(input, ctx) {
        return ctx || {
          common: input.parent.common,
          data: input.data,
          parsedType: getParsedType2(input.data),
          schemaErrorMap: this._def.errorMap,
          path: input.path,
          parent: input.parent
        };
      }
      _processInputParams(input) {
        return {
          status: new ParseStatus2(),
          ctx: {
            common: input.parent.common,
            data: input.data,
            parsedType: getParsedType2(input.data),
            schemaErrorMap: this._def.errorMap,
            path: input.path,
            parent: input.parent
          }
        };
      }
      _parseSync(input) {
        const result = this._parse(input);
        if (isAsync2(result)) {
          throw new Error("Synchronous parse encountered promise.");
        }
        return result;
      }
      _parseAsync(input) {
        const result = this._parse(input);
        return Promise.resolve(result);
      }
      parse(data, params) {
        const result = this.safeParse(data, params);
        if (result.success)
          return result.data;
        throw result.error;
      }
      safeParse(data, params) {
        const ctx = {
          common: {
            issues: [],
            async: params?.async ?? false,
            contextualErrorMap: params?.errorMap
          },
          path: params?.path || [],
          schemaErrorMap: this._def.errorMap,
          parent: null,
          data,
          parsedType: getParsedType2(data)
        };
        const result = this._parseSync({ data, path: ctx.path, parent: ctx });
        return handleResult2(ctx, result);
      }
      "~validate"(data) {
        const ctx = {
          common: {
            issues: [],
            async: !!this["~standard"].async
          },
          path: [],
          schemaErrorMap: this._def.errorMap,
          parent: null,
          data,
          parsedType: getParsedType2(data)
        };
        if (!this["~standard"].async) {
          try {
            const result = this._parseSync({ data, path: [], parent: ctx });
            return isValid2(result) ? {
              value: result.value
            } : {
              issues: ctx.common.issues
            };
          } catch (err) {
            if (err?.message?.toLowerCase()?.includes("encountered")) {
              this["~standard"].async = true;
            }
            ctx.common = {
              issues: [],
              async: true
            };
          }
        }
        return this._parseAsync({ data, path: [], parent: ctx }).then((result) => isValid2(result) ? {
          value: result.value
        } : {
          issues: ctx.common.issues
        });
      }
      async parseAsync(data, params) {
        const result = await this.safeParseAsync(data, params);
        if (result.success)
          return result.data;
        throw result.error;
      }
      async safeParseAsync(data, params) {
        const ctx = {
          common: {
            issues: [],
            contextualErrorMap: params?.errorMap,
            async: true
          },
          path: params?.path || [],
          schemaErrorMap: this._def.errorMap,
          parent: null,
          data,
          parsedType: getParsedType2(data)
        };
        const maybeAsyncResult2 = this._parse({ data, path: ctx.path, parent: ctx });
        const result = await (isAsync2(maybeAsyncResult2) ? maybeAsyncResult2 : Promise.resolve(maybeAsyncResult2));
        return handleResult2(ctx, result);
      }
      refine(check, message) {
        const getIssueProperties = /* @__PURE__ */ __name((val2) => {
          if (typeof message === "string" || typeof message === "undefined") {
            return { message };
          } else if (typeof message === "function") {
            return message(val2);
          } else {
            return message;
          }
        }, "getIssueProperties");
        return this._refinement((val2, ctx) => {
          const result = check(val2);
          const setError = /* @__PURE__ */ __name(() => ctx.addIssue({
            code: ZodIssueCode2.custom,
            ...getIssueProperties(val2)
          }), "setError");
          if (typeof Promise !== "undefined" && result instanceof Promise) {
            return result.then((data) => {
              if (!data) {
                setError();
                return false;
              } else {
                return true;
              }
            });
          }
          if (!result) {
            setError();
            return false;
          } else {
            return true;
          }
        });
      }
      refinement(check, refinementData) {
        return this._refinement((val2, ctx) => {
          if (!check(val2)) {
            ctx.addIssue(typeof refinementData === "function" ? refinementData(val2, ctx) : refinementData);
            return false;
          } else {
            return true;
          }
        });
      }
      _refinement(refinement) {
        return new ZodEffects2({
          schema: this,
          typeName: ZodFirstPartyTypeKind2.ZodEffects,
          effect: { type: "refinement", refinement }
        });
      }
      superRefine(refinement) {
        return this._refinement(refinement);
      }
      constructor(def) {
        this.spa = this.safeParseAsync;
        this._def = def;
        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: /* @__PURE__ */ __name((data) => this["~validate"](data), "validate")
        };
      }
      optional() {
        return ZodOptional2.create(this, this._def);
      }
      nullable() {
        return ZodNullable2.create(this, this._def);
      }
      nullish() {
        return this.nullable().optional();
      }
      array() {
        return ZodArray2.create(this);
      }
      promise() {
        return ZodPromise2.create(this, this._def);
      }
      or(option) {
        return ZodUnion2.create([this, option], this._def);
      }
      and(incoming) {
        return ZodIntersection2.create(this, incoming, this._def);
      }
      transform(transform) {
        return new ZodEffects2({
          ...processCreateParams2(this._def),
          schema: this,
          typeName: ZodFirstPartyTypeKind2.ZodEffects,
          effect: { type: "transform", transform }
        });
      }
      default(def) {
        const defaultValueFunc = typeof def === "function" ? def : () => def;
        return new ZodDefault2({
          ...processCreateParams2(this._def),
          innerType: this,
          defaultValue: defaultValueFunc,
          typeName: ZodFirstPartyTypeKind2.ZodDefault
        });
      }
      brand() {
        return new ZodBranded2({
          typeName: ZodFirstPartyTypeKind2.ZodBranded,
          type: this,
          ...processCreateParams2(this._def)
        });
      }
      catch(def) {
        const catchValueFunc = typeof def === "function" ? def : () => def;
        return new ZodCatch2({
          ...processCreateParams2(this._def),
          innerType: this,
          catchValue: catchValueFunc,
          typeName: ZodFirstPartyTypeKind2.ZodCatch
        });
      }
      describe(description) {
        const This = this.constructor;
        return new This({
          ...this._def,
          description
        });
      }
      pipe(target) {
        return ZodPipeline2.create(this, target);
      }
      readonly() {
        return ZodReadonly2.create(this);
      }
      isOptional() {
        return this.safeParse(void 0).success;
      }
      isNullable() {
        return this.safeParse(null).success;
      }
    };
    cuidRegex2 = /^c[^\s-]{8,}$/i;
    cuid2Regex2 = /^[0-9a-z]+$/;
    ulidRegex2 = /^[0-9A-HJKMNP-TV-Z]{26}$/i;
    uuidRegex2 = /^[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;
    nanoidRegex = /^[a-z0-9_-]{21}$/i;
    jwtRegex = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/;
    durationRegex = /^[-+]?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)?)??$/;
    emailRegex2 = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;
    _emojiRegex = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
    ipv4Regex2 = /^(?:(?: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])$/;
    ipv4CidrRegex = /^(?:(?: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])$/;
    ipv6Regex2 = /^(([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]))$/;
    ipv6CidrRegex = /^(([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])$/;
    base64Regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;
    base64urlRegex = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/;
    dateRegexSource = `((\\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])))`;
    dateRegex = new RegExp(`^${dateRegexSource}$`);
    __name(timeRegexSource, "timeRegexSource");
    __name(timeRegex, "timeRegex");
    __name(datetimeRegex2, "datetimeRegex");
    __name(isValidIP2, "isValidIP");
    __name(isValidJWT, "isValidJWT");
    __name(isValidCidr, "isValidCidr");
    ZodString2 = class _ZodString2 extends ZodType2 {
      static {
        __name(this, "ZodString");
      }
      _parse(input) {
        if (this._def.coerce) {
          input.data = String(input.data);
        }
        const parsedType = this._getType(input);
        if (parsedType !== ZodParsedType2.string) {
          const ctx2 = this._getOrReturnCtx(input);
          addIssueToContext2(ctx2, {
            code: ZodIssueCode2.invalid_type,
            expected: ZodParsedType2.string,
            received: ctx2.parsedType
          });
          return INVALID2;
        }
        const status2 = new ParseStatus2();
        let ctx = void 0;
        for (const check of this._def.checks) {
          if (check.kind === "min") {
            if (input.data.length < check.value) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext2(ctx, {
                code: ZodIssueCode2.too_small,
                minimum: check.value,
                type: "string",
                inclusive: true,
                exact: false,
                message: check.message
              });
              status2.dirty();
            }
          } else if (check.kind === "max") {
            if (input.data.length > check.value) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext2(ctx, {
                code: ZodIssueCode2.too_big,
                maximum: check.value,
                type: "string",
                inclusive: true,
                exact: false,
                message: check.message
              });
              status2.dirty();
            }
          } else if (check.kind === "length") {
            const tooBig = input.data.length > check.value;
            const tooSmall = input.data.length < check.value;
            if (tooBig || tooSmall) {
              ctx = this._getOrReturnCtx(input, ctx);
              if (tooBig) {
                addIssueToContext2(ctx, {
                  code: ZodIssueCode2.too_big,
                  maximum: check.value,
                  type: "string",
                  inclusive: true,
                  exact: true,
                  message: check.message
                });
              } else if (tooSmall) {
                addIssueToContext2(ctx, {
                  code: ZodIssueCode2.too_small,
                  minimum: check.value,
                  type: "string",
                  inclusive: true,
                  exact: true,
                  message: check.message
                });
              }
              status2.dirty();
            }
          } else if (check.kind === "email") {
            if (!emailRegex2.test(input.data)) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext2(ctx, {
                validation: "email",
                code: ZodIssueCode2.invalid_string,
                message: check.message
              });
              status2.dirty();
            }
          } else if (check.kind === "emoji") {
            if (!emojiRegex3) {
              emojiRegex3 = new RegExp(_emojiRegex, "u");
            }
            if (!emojiRegex3.test(input.data)) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext2(ctx, {
                validation: "emoji",
                code: ZodIssueCode2.invalid_string,
                message: check.message
              });
              status2.dirty();
            }
          } else if (check.kind === "uuid") {
            if (!uuidRegex2.test(input.data)) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext2(ctx, {
                validation: "uuid",
                code: ZodIssueCode2.invalid_string,
                message: check.message
              });
              status2.dirty();
            }
          } else if (check.kind === "nanoid") {
            if (!nanoidRegex.test(input.data)) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext2(ctx, {
                validation: "nanoid",
                code: ZodIssueCode2.invalid_string,
                message: check.message
              });
              status2.dirty();
            }
          } else if (check.kind === "cuid") {
            if (!cuidRegex2.test(input.data)) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext2(ctx, {
                validation: "cuid",
                code: ZodIssueCode2.invalid_string,
                message: check.message
              });
              status2.dirty();
            }
          } else if (check.kind === "cuid2") {
            if (!cuid2Regex2.test(input.data)) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext2(ctx, {
                validation: "cuid2",
                code: ZodIssueCode2.invalid_string,
                message: check.message
              });
              status2.dirty();
            }
          } else if (check.kind === "ulid") {
            if (!ulidRegex2.test(input.data)) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext2(ctx, {
                validation: "ulid",
                code: ZodIssueCode2.invalid_string,
                message: check.message
              });
              status2.dirty();
            }
          } else if (check.kind === "url") {
            try {
              new URL(input.data);
            } catch {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext2(ctx, {
                validation: "url",
                code: ZodIssueCode2.invalid_string,
                message: check.message
              });
              status2.dirty();
            }
          } else if (check.kind === "regex") {
            check.regex.lastIndex = 0;
            const testResult = check.regex.test(input.data);
            if (!testResult) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext2(ctx, {
                validation: "regex",
                code: ZodIssueCode2.invalid_string,
                message: check.message
              });
              status2.dirty();
            }
          } else if (check.kind === "trim") {
            input.data = input.data.trim();
          } else if (check.kind === "includes") {
            if (!input.data.includes(check.value, check.position)) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext2(ctx, {
                code: ZodIssueCode2.invalid_string,
                validation: { includes: check.value, position: check.position },
                message: check.message
              });
              status2.dirty();
            }
          } else if (check.kind === "toLowerCase") {
            input.data = input.data.toLowerCase();
          } else if (check.kind === "toUpperCase") {
            input.data = input.data.toUpperCase();
          } else if (check.kind === "startsWith") {
            if (!input.data.startsWith(check.value)) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext2(ctx, {
                code: ZodIssueCode2.invalid_string,
                validation: { startsWith: check.value },
                message: check.message
              });
              status2.dirty();
            }
          } else if (check.kind === "endsWith") {
            if (!input.data.endsWith(check.value)) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext2(ctx, {
                code: ZodIssueCode2.invalid_string,
                validation: { endsWith: check.value },
                message: check.message
              });
              status2.dirty();
            }
          } else if (check.kind === "datetime") {
            const regex2 = datetimeRegex2(check);
            if (!regex2.test(input.data)) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext2(ctx, {
                code: ZodIssueCode2.invalid_string,
                validation: "datetime",
                message: check.message
              });
              status2.dirty();
            }
          } else if (check.kind === "date") {
            const regex2 = dateRegex;
            if (!regex2.test(input.data)) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext2(ctx, {
                code: ZodIssueCode2.invalid_string,
                validation: "date",
                message: check.message
              });
              status2.dirty();
            }
          } else if (check.kind === "time") {
            const regex2 = timeRegex(check);
            if (!regex2.test(input.data)) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext2(ctx, {
                code: ZodIssueCode2.invalid_string,
                validation: "time",
                message: check.message
              });
              status2.dirty();
            }
          } else if (check.kind === "duration") {
            if (!durationRegex.test(input.data)) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext2(ctx, {
                validation: "duration",
                code: ZodIssueCode2.invalid_string,
                message: check.message
              });
              status2.dirty();
            }
          } else if (check.kind === "ip") {
            if (!isValidIP2(input.data, check.version)) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext2(ctx, {
                validation: "ip",
                code: ZodIssueCode2.invalid_string,
                message: check.message
              });
              status2.dirty();
            }
          } else if (check.kind === "jwt") {
            if (!isValidJWT(input.data, check.alg)) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext2(ctx, {
                validation: "jwt",
                code: ZodIssueCode2.invalid_string,
                message: check.message
              });
              status2.dirty();
            }
          } else if (check.kind === "cidr") {
            if (!isValidCidr(input.data, check.version)) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext2(ctx, {
                validation: "cidr",
                code: ZodIssueCode2.invalid_string,
                message: check.message
              });
              status2.dirty();
            }
          } else if (check.kind === "base64") {
            if (!base64Regex.test(input.data)) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext2(ctx, {
                validation: "base64",
                code: ZodIssueCode2.invalid_string,
                message: check.message
              });
              status2.dirty();
            }
          } else if (check.kind === "base64url") {
            if (!base64urlRegex.test(input.data)) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext2(ctx, {
                validation: "base64url",
                code: ZodIssueCode2.invalid_string,
                message: check.message
              });
              status2.dirty();
            }
          } else {
            util2.assertNever(check);
          }
        }
        return { status: status2.value, value: input.data };
      }
      _regex(regex2, validation2, message) {
        return this.refinement((data) => regex2.test(data), {
          validation: validation2,
          code: ZodIssueCode2.invalid_string,
          ...errorUtil2.errToObj(message)
        });
      }
      _addCheck(check) {
        return new _ZodString2({
          ...this._def,
          checks: [...this._def.checks, check]
        });
      }
      email(message) {
        return this._addCheck({ kind: "email", ...errorUtil2.errToObj(message) });
      }
      url(message) {
        return this._addCheck({ kind: "url", ...errorUtil2.errToObj(message) });
      }
      emoji(message) {
        return this._addCheck({ kind: "emoji", ...errorUtil2.errToObj(message) });
      }
      uuid(message) {
        return this._addCheck({ kind: "uuid", ...errorUtil2.errToObj(message) });
      }
      nanoid(message) {
        return this._addCheck({ kind: "nanoid", ...errorUtil2.errToObj(message) });
      }
      cuid(message) {
        return this._addCheck({ kind: "cuid", ...errorUtil2.errToObj(message) });
      }
      cuid2(message) {
        return this._addCheck({ kind: "cuid2", ...errorUtil2.errToObj(message) });
      }
      ulid(message) {
        return this._addCheck({ kind: "ulid", ...errorUtil2.errToObj(message) });
      }
      base64(message) {
        return this._addCheck({ kind: "base64", ...errorUtil2.errToObj(message) });
      }
      base64url(message) {
        return this._addCheck({
          kind: "base64url",
          ...errorUtil2.errToObj(message)
        });
      }
      jwt(options) {
        return this._addCheck({ kind: "jwt", ...errorUtil2.errToObj(options) });
      }
      ip(options) {
        return this._addCheck({ kind: "ip", ...errorUtil2.errToObj(options) });
      }
      cidr(options) {
        return this._addCheck({ kind: "cidr", ...errorUtil2.errToObj(options) });
      }
      datetime(options) {
        if (typeof options === "string") {
          return this._addCheck({
            kind: "datetime",
            precision: null,
            offset: false,
            local: false,
            message: options
          });
        }
        return this._addCheck({
          kind: "datetime",
          precision: typeof options?.precision === "undefined" ? null : options?.precision,
          offset: options?.offset ?? false,
          local: options?.local ?? false,
          ...errorUtil2.errToObj(options?.message)
        });
      }
      date(message) {
        return this._addCheck({ kind: "date", message });
      }
      time(options) {
        if (typeof options === "string") {
          return this._addCheck({
            kind: "time",
            precision: null,
            message: options
          });
        }
        return this._addCheck({
          kind: "time",
          precision: typeof options?.precision === "undefined" ? null : options?.precision,
          ...errorUtil2.errToObj(options?.message)
        });
      }
      duration(message) {
        return this._addCheck({ kind: "duration", ...errorUtil2.errToObj(message) });
      }
      regex(regex2, message) {
        return this._addCheck({
          kind: "regex",
          regex: regex2,
          ...errorUtil2.errToObj(message)
        });
      }
      includes(value, options) {
        return this._addCheck({
          kind: "includes",
          value,
          position: options?.position,
          ...errorUtil2.errToObj(options?.message)
        });
      }
      startsWith(value, message) {
        return this._addCheck({
          kind: "startsWith",
          value,
          ...errorUtil2.errToObj(message)
        });
      }
      endsWith(value, message) {
        return this._addCheck({
          kind: "endsWith",
          value,
          ...errorUtil2.errToObj(message)
        });
      }
      min(minLength, message) {
        return this._addCheck({
          kind: "min",
          value: minLength,
          ...errorUtil2.errToObj(message)
        });
      }
      max(maxLength, message) {
        return this._addCheck({
          kind: "max",
          value: maxLength,
          ...errorUtil2.errToObj(message)
        });
      }
      length(len, message) {
        return this._addCheck({
          kind: "length",
          value: len,
          ...errorUtil2.errToObj(message)
        });
      }
      /**
       * Equivalent to `.min(1)`
       */
      nonempty(message) {
        return this.min(1, errorUtil2.errToObj(message));
      }
      trim() {
        return new _ZodString2({
          ...this._def,
          checks: [...this._def.checks, { kind: "trim" }]
        });
      }
      toLowerCase() {
        return new _ZodString2({
          ...this._def,
          checks: [...this._def.checks, { kind: "toLowerCase" }]
        });
      }
      toUpperCase() {
        return new _ZodString2({
          ...this._def,
          checks: [...this._def.checks, { kind: "toUpperCase" }]
        });
      }
      get isDatetime() {
        return !!this._def.checks.find((ch2) => ch2.kind === "datetime");
      }
      get isDate() {
        return !!this._def.checks.find((ch2) => ch2.kind === "date");
      }
      get isTime() {
        return !!this._def.checks.find((ch2) => ch2.kind === "time");
      }
      get isDuration() {
        return !!this._def.checks.find((ch2) => ch2.kind === "duration");
      }
      get isEmail() {
        return !!this._def.checks.find((ch2) => ch2.kind === "email");
      }
      get isURL() {
        return !!this._def.checks.find((ch2) => ch2.kind === "url");
      }
      get isEmoji() {
        return !!this._def.checks.find((ch2) => ch2.kind === "emoji");
      }
      get isUUID() {
        return !!this._def.checks.find((ch2) => ch2.kind === "uuid");
      }
      get isNANOID() {
        return !!this._def.checks.find((ch2) => ch2.kind === "nanoid");
      }
      get isCUID() {
        return !!this._def.checks.find((ch2) => ch2.kind === "cuid");
      }
      get isCUID2() {
        return !!this._def.checks.find((ch2) => ch2.kind === "cuid2");
      }
      get isULID() {
        return !!this._def.checks.find((ch2) => ch2.kind === "ulid");
      }
      get isIP() {
        return !!this._def.checks.find((ch2) => ch2.kind === "ip");
      }
      get isCIDR() {
        return !!this._def.checks.find((ch2) => ch2.kind === "cidr");
      }
      get isBase64() {
        return !!this._def.checks.find((ch2) => ch2.kind === "base64");
      }
      get isBase64url() {
        return !!this._def.checks.find((ch2) => ch2.kind === "base64url");
      }
      get minLength() {
        let min = null;
        for (const ch2 of this._def.checks) {
          if (ch2.kind === "min") {
            if (min === null || ch2.value > min)
              min = ch2.value;
          }
        }
        return min;
      }
      get maxLength() {
        let max = null;
        for (const ch2 of this._def.checks) {
          if (ch2.kind === "max") {
            if (max === null || ch2.value < max)
              max = ch2.value;
          }
        }
        return max;
      }
    };
    ZodString2.create = (params) => {
      return new ZodString2({
        checks: [],
        typeName: ZodFirstPartyTypeKind2.ZodString,
        coerce: params?.coerce ?? false,
        ...processCreateParams2(params)
      });
    };
    __name(floatSafeRemainder2, "floatSafeRemainder");
    ZodNumber2 = class _ZodNumber2 extends ZodType2 {
      static {
        __name(this, "ZodNumber");
      }
      constructor() {
        super(...arguments);
        this.min = this.gte;
        this.max = this.lte;
        this.step = this.multipleOf;
      }
      _parse(input) {
        if (this._def.coerce) {
          input.data = Number(input.data);
        }
        const parsedType = this._getType(input);
        if (parsedType !== ZodParsedType2.number) {
          const ctx2 = this._getOrReturnCtx(input);
          addIssueToContext2(ctx2, {
            code: ZodIssueCode2.invalid_type,
            expected: ZodParsedType2.number,
            received: ctx2.parsedType
          });
          return INVALID2;
        }
        let ctx = void 0;
        const status2 = new ParseStatus2();
        for (const check of this._def.checks) {
          if (check.kind === "int") {
            if (!util2.isInteger(input.data)) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext2(ctx, {
                code: ZodIssueCode2.invalid_type,
                expected: "integer",
                received: "float",
                message: check.message
              });
              status2.dirty();
            }
          } else if (check.kind === "min") {
            const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value;
            if (tooSmall) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext2(ctx, {
                code: ZodIssueCode2.too_small,
                minimum: check.value,
                type: "number",
                inclusive: check.inclusive,
                exact: false,
                message: check.message
              });
              status2.dirty();
            }
          } else if (check.kind === "max") {
            const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value;
            if (tooBig) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext2(ctx, {
                code: ZodIssueCode2.too_big,
                maximum: check.value,
                type: "number",
                inclusive: check.inclusive,
                exact: false,
                message: check.message
              });
              status2.dirty();
            }
          } else if (check.kind === "multipleOf") {
            if (floatSafeRemainder2(input.data, check.value) !== 0) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext2(ctx, {
                code: ZodIssueCode2.not_multiple_of,
                multipleOf: check.value,
                message: check.message
              });
              status2.dirty();
            }
          } else if (check.kind === "finite") {
            if (!Number.isFinite(input.data)) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext2(ctx, {
                code: ZodIssueCode2.not_finite,
                message: check.message
              });
              status2.dirty();
            }
          } else {
            util2.assertNever(check);
          }
        }
        return { status: status2.value, value: input.data };
      }
      gte(value, message) {
        return this.setLimit("min", value, true, errorUtil2.toString(message));
      }
      gt(value, message) {
        return this.setLimit("min", value, false, errorUtil2.toString(message));
      }
      lte(value, message) {
        return this.setLimit("max", value, true, errorUtil2.toString(message));
      }
      lt(value, message) {
        return this.setLimit("max", value, false, errorUtil2.toString(message));
      }
      setLimit(kind2, value, inclusive, message) {
        return new _ZodNumber2({
          ...this._def,
          checks: [
            ...this._def.checks,
            {
              kind: kind2,
              value,
              inclusive,
              message: errorUtil2.toString(message)
            }
          ]
        });
      }
      _addCheck(check) {
        return new _ZodNumber2({
          ...this._def,
          checks: [...this._def.checks, check]
        });
      }
      int(message) {
        return this._addCheck({
          kind: "int",
          message: errorUtil2.toString(message)
        });
      }
      positive(message) {
        return this._addCheck({
          kind: "min",
          value: 0,
          inclusive: false,
          message: errorUtil2.toString(message)
        });
      }
      negative(message) {
        return this._addCheck({
          kind: "max",
          value: 0,
          inclusive: false,
          message: errorUtil2.toString(message)
        });
      }
      nonpositive(message) {
        return this._addCheck({
          kind: "max",
          value: 0,
          inclusive: true,
          message: errorUtil2.toString(message)
        });
      }
      nonnegative(message) {
        return this._addCheck({
          kind: "min",
          value: 0,
          inclusive: true,
          message: errorUtil2.toString(message)
        });
      }
      multipleOf(value, message) {
        return this._addCheck({
          kind: "multipleOf",
          value,
          message: errorUtil2.toString(message)
        });
      }
      finite(message) {
        return this._addCheck({
          kind: "finite",
          message: errorUtil2.toString(message)
        });
      }
      safe(message) {
        return this._addCheck({
          kind: "min",
          inclusive: true,
          value: Number.MIN_SAFE_INTEGER,
          message: errorUtil2.toString(message)
        })._addCheck({
          kind: "max",
          inclusive: true,
          value: Number.MAX_SAFE_INTEGER,
          message: errorUtil2.toString(message)
        });
      }
      get minValue() {
        let min = null;
        for (const ch2 of this._def.checks) {
          if (ch2.kind === "min") {
            if (min === null || ch2.value > min)
              min = ch2.value;
          }
        }
        return min;
      }
      get maxValue() {
        let max = null;
        for (const ch2 of this._def.checks) {
          if (ch2.kind === "max") {
            if (max === null || ch2.value < max)
              max = ch2.value;
          }
        }
        return max;
      }
      get isInt() {
        return !!this._def.checks.find((ch2) => ch2.kind === "int" || ch2.kind === "multipleOf" && util2.isInteger(ch2.value));
      }
      get isFinite() {
        let max = null;
        let min = null;
        for (const ch2 of this._def.checks) {
          if (ch2.kind === "finite" || ch2.kind === "int" || ch2.kind === "multipleOf") {
            return true;
          } else if (ch2.kind === "min") {
            if (min === null || ch2.value > min)
              min = ch2.value;
          } else if (ch2.kind === "max") {
            if (max === null || ch2.value < max)
              max = ch2.value;
          }
        }
        return Number.isFinite(min) && Number.isFinite(max);
      }
    };
    ZodNumber2.create = (params) => {
      return new ZodNumber2({
        checks: [],
        typeName: ZodFirstPartyTypeKind2.ZodNumber,
        coerce: params?.coerce || false,
        ...processCreateParams2(params)
      });
    };
    ZodBigInt2 = class _ZodBigInt2 extends ZodType2 {
      static {
        __name(this, "ZodBigInt");
      }
      constructor() {
        super(...arguments);
        this.min = this.gte;
        this.max = this.lte;
      }
      _parse(input) {
        if (this._def.coerce) {
          try {
            input.data = BigInt(input.data);
          } catch {
            return this._getInvalidInput(input);
          }
        }
        const parsedType = this._getType(input);
        if (parsedType !== ZodParsedType2.bigint) {
          return this._getInvalidInput(input);
        }
        let ctx = void 0;
        const status2 = new ParseStatus2();
        for (const check of this._def.checks) {
          if (check.kind === "min") {
            const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value;
            if (tooSmall) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext2(ctx, {
                code: ZodIssueCode2.too_small,
                type: "bigint",
                minimum: check.value,
                inclusive: check.inclusive,
                message: check.message
              });
              status2.dirty();
            }
          } else if (check.kind === "max") {
            const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value;
            if (tooBig) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext2(ctx, {
                code: ZodIssueCode2.too_big,
                type: "bigint",
                maximum: check.value,
                inclusive: check.inclusive,
                message: check.message
              });
              status2.dirty();
            }
          } else if (check.kind === "multipleOf") {
            if (input.data % check.value !== BigInt(0)) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext2(ctx, {
                code: ZodIssueCode2.not_multiple_of,
                multipleOf: check.value,
                message: check.message
              });
              status2.dirty();
            }
          } else {
            util2.assertNever(check);
          }
        }
        return { status: status2.value, value: input.data };
      }
      _getInvalidInput(input) {
        const ctx = this._getOrReturnCtx(input);
        addIssueToContext2(ctx, {
          code: ZodIssueCode2.invalid_type,
          expected: ZodParsedType2.bigint,
          received: ctx.parsedType
        });
        return INVALID2;
      }
      gte(value, message) {
        return this.setLimit("min", value, true, errorUtil2.toString(message));
      }
      gt(value, message) {
        return this.setLimit("min", value, false, errorUtil2.toString(message));
      }
      lte(value, message) {
        return this.setLimit("max", value, true, errorUtil2.toString(message));
      }
      lt(value, message) {
        return this.setLimit("max", value, false, errorUtil2.toString(message));
      }
      setLimit(kind2, value, inclusive, message) {
        return new _ZodBigInt2({
          ...this._def,
          checks: [
            ...this._def.checks,
            {
              kind: kind2,
              value,
              inclusive,
              message: errorUtil2.toString(message)
            }
          ]
        });
      }
      _addCheck(check) {
        return new _ZodBigInt2({
          ...this._def,
          checks: [...this._def.checks, check]
        });
      }
      positive(message) {
        return this._addCheck({
          kind: "min",
          value: BigInt(0),
          inclusive: false,
          message: errorUtil2.toString(message)
        });
      }
      negative(message) {
        return this._addCheck({
          kind: "max",
          value: BigInt(0),
          inclusive: false,
          message: errorUtil2.toString(message)
        });
      }
      nonpositive(message) {
        return this._addCheck({
          kind: "max",
          value: BigInt(0),
          inclusive: true,
          message: errorUtil2.toString(message)
        });
      }
      nonnegative(message) {
        return this._addCheck({
          kind: "min",
          value: BigInt(0),
          inclusive: true,
          message: errorUtil2.toString(message)
        });
      }
      multipleOf(value, message) {
        return this._addCheck({
          kind: "multipleOf",
          value,
          message: errorUtil2.toString(message)
        });
      }
      get minValue() {
        let min = null;
        for (const ch2 of this._def.checks) {
          if (ch2.kind === "min") {
            if (min === null || ch2.value > min)
              min = ch2.value;
          }
        }
        return min;
      }
      get maxValue() {
        let max = null;
        for (const ch2 of this._def.checks) {
          if (ch2.kind === "max") {
            if (max === null || ch2.value < max)
              max = ch2.value;
          }
        }
        return max;
      }
    };
    ZodBigInt2.create = (params) => {
      return new ZodBigInt2({
        checks: [],
        typeName: ZodFirstPartyTypeKind2.ZodBigInt,
        coerce: params?.coerce ?? false,
        ...processCreateParams2(params)
      });
    };
    ZodBoolean2 = class extends ZodType2 {
      static {
        __name(this, "ZodBoolean");
      }
      _parse(input) {
        if (this._def.coerce) {
          input.data = Boolean(input.data);
        }
        const parsedType = this._getType(input);
        if (parsedType !== ZodParsedType2.boolean) {
          const ctx = this._getOrReturnCtx(input);
          addIssueToContext2(ctx, {
            code: ZodIssueCode2.invalid_type,
            expected: ZodParsedType2.boolean,
            received: ctx.parsedType
          });
          return INVALID2;
        }
        return OK2(input.data);
      }
    };
    ZodBoolean2.create = (params) => {
      return new ZodBoolean2({
        typeName: ZodFirstPartyTypeKind2.ZodBoolean,
        coerce: params?.coerce || false,
        ...processCreateParams2(params)
      });
    };
    ZodDate2 = class _ZodDate2 extends ZodType2 {
      static {
        __name(this, "ZodDate");
      }
      _parse(input) {
        if (this._def.coerce) {
          input.data = new Date(input.data);
        }
        const parsedType = this._getType(input);
        if (parsedType !== ZodParsedType2.date) {
          const ctx2 = this._getOrReturnCtx(input);
          addIssueToContext2(ctx2, {
            code: ZodIssueCode2.invalid_type,
            expected: ZodParsedType2.date,
            received: ctx2.parsedType
          });
          return INVALID2;
        }
        if (Number.isNaN(input.data.getTime())) {
          const ctx2 = this._getOrReturnCtx(input);
          addIssueToContext2(ctx2, {
            code: ZodIssueCode2.invalid_date
          });
          return INVALID2;
        }
        const status2 = new ParseStatus2();
        let ctx = void 0;
        for (const check of this._def.checks) {
          if (check.kind === "min") {
            if (input.data.getTime() < check.value) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext2(ctx, {
                code: ZodIssueCode2.too_small,
                message: check.message,
                inclusive: true,
                exact: false,
                minimum: check.value,
                type: "date"
              });
              status2.dirty();
            }
          } else if (check.kind === "max") {
            if (input.data.getTime() > check.value) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext2(ctx, {
                code: ZodIssueCode2.too_big,
                message: check.message,
                inclusive: true,
                exact: false,
                maximum: check.value,
                type: "date"
              });
              status2.dirty();
            }
          } else {
            util2.assertNever(check);
          }
        }
        return {
          status: status2.value,
          value: new Date(input.data.getTime())
        };
      }
      _addCheck(check) {
        return new _ZodDate2({
          ...this._def,
          checks: [...this._def.checks, check]
        });
      }
      min(minDate, message) {
        return this._addCheck({
          kind: "min",
          value: minDate.getTime(),
          message: errorUtil2.toString(message)
        });
      }
      max(maxDate, message) {
        return this._addCheck({
          kind: "max",
          value: maxDate.getTime(),
          message: errorUtil2.toString(message)
        });
      }
      get minDate() {
        let min = null;
        for (const ch2 of this._def.checks) {
          if (ch2.kind === "min") {
            if (min === null || ch2.value > min)
              min = ch2.value;
          }
        }
        return min != null ? new Date(min) : null;
      }
      get maxDate() {
        let max = null;
        for (const ch2 of this._def.checks) {
          if (ch2.kind === "max") {
            if (max === null || ch2.value < max)
              max = ch2.value;
          }
        }
        return max != null ? new Date(max) : null;
      }
    };
    ZodDate2.create = (params) => {
      return new ZodDate2({
        checks: [],
        coerce: params?.coerce || false,
        typeName: ZodFirstPartyTypeKind2.ZodDate,
        ...processCreateParams2(params)
      });
    };
    ZodSymbol2 = class extends ZodType2 {
      static {
        __name(this, "ZodSymbol");
      }
      _parse(input) {
        const parsedType = this._getType(input);
        if (parsedType !== ZodParsedType2.symbol) {
          const ctx = this._getOrReturnCtx(input);
          addIssueToContext2(ctx, {
            code: ZodIssueCode2.invalid_type,
            expected: ZodParsedType2.symbol,
            received: ctx.parsedType
          });
          return INVALID2;
        }
        return OK2(input.data);
      }
    };
    ZodSymbol2.create = (params) => {
      return new ZodSymbol2({
        typeName: ZodFirstPartyTypeKind2.ZodSymbol,
        ...processCreateParams2(params)
      });
    };
    ZodUndefined2 = class extends ZodType2 {
      static {
        __name(this, "ZodUndefined");
      }
      _parse(input) {
        const parsedType = this._getType(input);
        if (parsedType !== ZodParsedType2.undefined) {
          const ctx = this._getOrReturnCtx(input);
          addIssueToContext2(ctx, {
            code: ZodIssueCode2.invalid_type,
            expected: ZodParsedType2.undefined,
            received: ctx.parsedType
          });
          return INVALID2;
        }
        return OK2(input.data);
      }
    };
    ZodUndefined2.create = (params) => {
      return new ZodUndefined2({
        typeName: ZodFirstPartyTypeKind2.ZodUndefined,
        ...processCreateParams2(params)
      });
    };
    ZodNull2 = class extends ZodType2 {
      static {
        __name(this, "ZodNull");
      }
      _parse(input) {
        const parsedType = this._getType(input);
        if (parsedType !== ZodParsedType2.null) {
          const ctx = this._getOrReturnCtx(input);
          addIssueToContext2(ctx, {
            code: ZodIssueCode2.invalid_type,
            expected: ZodParsedType2.null,
            received: ctx.parsedType
          });
          return INVALID2;
        }
        return OK2(input.data);
      }
    };
    ZodNull2.create = (params) => {
      return new ZodNull2({
        typeName: ZodFirstPartyTypeKind2.ZodNull,
        ...processCreateParams2(params)
      });
    };
    ZodAny2 = class extends ZodType2 {
      static {
        __name(this, "ZodAny");
      }
      constructor() {
        super(...arguments);
        this._any = true;
      }
      _parse(input) {
        return OK2(input.data);
      }
    };
    ZodAny2.create = (params) => {
      return new ZodAny2({
        typeName: ZodFirstPartyTypeKind2.ZodAny,
        ...processCreateParams2(params)
      });
    };
    ZodUnknown2 = class extends ZodType2 {
      static {
        __name(this, "ZodUnknown");
      }
      constructor() {
        super(...arguments);
        this._unknown = true;
      }
      _parse(input) {
        return OK2(input.data);
      }
    };
    ZodUnknown2.create = (params) => {
      return new ZodUnknown2({
        typeName: ZodFirstPartyTypeKind2.ZodUnknown,
        ...processCreateParams2(params)
      });
    };
    ZodNever2 = class extends ZodType2 {
      static {
        __name(this, "ZodNever");
      }
      _parse(input) {
        const ctx = this._getOrReturnCtx(input);
        addIssueToContext2(ctx, {
          code: ZodIssueCode2.invalid_type,
          expected: ZodParsedType2.never,
          received: ctx.parsedType
        });
        return INVALID2;
      }
    };
    ZodNever2.create = (params) => {
      return new ZodNever2({
        typeName: ZodFirstPartyTypeKind2.ZodNever,
        ...processCreateParams2(params)
      });
    };
    ZodVoid2 = class extends ZodType2 {
      static {
        __name(this, "ZodVoid");
      }
      _parse(input) {
        const parsedType = this._getType(input);
        if (parsedType !== ZodParsedType2.undefined) {
          const ctx = this._getOrReturnCtx(input);
          addIssueToContext2(ctx, {
            code: ZodIssueCode2.invalid_type,
            expected: ZodParsedType2.void,
            received: ctx.parsedType
          });
          return INVALID2;
        }
        return OK2(input.data);
      }
    };
    ZodVoid2.create = (params) => {
      return new ZodVoid2({
        typeName: ZodFirstPartyTypeKind2.ZodVoid,
        ...processCreateParams2(params)
      });
    };
    ZodArray2 = class _ZodArray2 extends ZodType2 {
      static {
        __name(this, "ZodArray");
      }
      _parse(input) {
        const { ctx, status: status2 } = this._processInputParams(input);
        const def = this._def;
        if (ctx.parsedType !== ZodParsedType2.array) {
          addIssueToContext2(ctx, {
            code: ZodIssueCode2.invalid_type,
            expected: ZodParsedType2.array,
            received: ctx.parsedType
          });
          return INVALID2;
        }
        if (def.exactLength !== null) {
          const tooBig = ctx.data.length > def.exactLength.value;
          const tooSmall = ctx.data.length < def.exactLength.value;
          if (tooBig || tooSmall) {
            addIssueToContext2(ctx, {
              code: tooBig ? ZodIssueCode2.too_big : ZodIssueCode2.too_small,
              minimum: tooSmall ? def.exactLength.value : void 0,
              maximum: tooBig ? def.exactLength.value : void 0,
              type: "array",
              inclusive: true,
              exact: true,
              message: def.exactLength.message
            });
            status2.dirty();
          }
        }
        if (def.minLength !== null) {
          if (ctx.data.length < def.minLength.value) {
            addIssueToContext2(ctx, {
              code: ZodIssueCode2.too_small,
              minimum: def.minLength.value,
              type: "array",
              inclusive: true,
              exact: false,
              message: def.minLength.message
            });
            status2.dirty();
          }
        }
        if (def.maxLength !== null) {
          if (ctx.data.length > def.maxLength.value) {
            addIssueToContext2(ctx, {
              code: ZodIssueCode2.too_big,
              maximum: def.maxLength.value,
              type: "array",
              inclusive: true,
              exact: false,
              message: def.maxLength.message
            });
            status2.dirty();
          }
        }
        if (ctx.common.async) {
          return Promise.all([...ctx.data].map((item, i7) => {
            return def.type._parseAsync(new ParseInputLazyPath2(ctx, item, ctx.path, i7));
          })).then((result2) => {
            return ParseStatus2.mergeArray(status2, result2);
          });
        }
        const result = [...ctx.data].map((item, i7) => {
          return def.type._parseSync(new ParseInputLazyPath2(ctx, item, ctx.path, i7));
        });
        return ParseStatus2.mergeArray(status2, result);
      }
      get element() {
        return this._def.type;
      }
      min(minLength, message) {
        return new _ZodArray2({
          ...this._def,
          minLength: { value: minLength, message: errorUtil2.toString(message) }
        });
      }
      max(maxLength, message) {
        return new _ZodArray2({
          ...this._def,
          maxLength: { value: maxLength, message: errorUtil2.toString(message) }
        });
      }
      length(len, message) {
        return new _ZodArray2({
          ...this._def,
          exactLength: { value: len, message: errorUtil2.toString(message) }
        });
      }
      nonempty(message) {
        return this.min(1, message);
      }
    };
    ZodArray2.create = (schema, params) => {
      return new ZodArray2({
        type: schema,
        minLength: null,
        maxLength: null,
        exactLength: null,
        typeName: ZodFirstPartyTypeKind2.ZodArray,
        ...processCreateParams2(params)
      });
    };
    __name(deepPartialify2, "deepPartialify");
    ZodObject2 = class _ZodObject2 extends ZodType2 {
      static {
        __name(this, "ZodObject");
      }
      constructor() {
        super(...arguments);
        this._cached = null;
        this.nonstrict = this.passthrough;
        this.augment = this.extend;
      }
      _getCached() {
        if (this._cached !== null)
          return this._cached;
        const shape = this._def.shape();
        const keys = util2.objectKeys(shape);
        this._cached = { shape, keys };
        return this._cached;
      }
      _parse(input) {
        const parsedType = this._getType(input);
        if (parsedType !== ZodParsedType2.object) {
          const ctx2 = this._getOrReturnCtx(input);
          addIssueToContext2(ctx2, {
            code: ZodIssueCode2.invalid_type,
            expected: ZodParsedType2.object,
            received: ctx2.parsedType
          });
          return INVALID2;
        }
        const { status: status2, ctx } = this._processInputParams(input);
        const { shape, keys: shapeKeys } = this._getCached();
        const extraKeys = [];
        if (!(this._def.catchall instanceof ZodNever2 && this._def.unknownKeys === "strip")) {
          for (const key in ctx.data) {
            if (!shapeKeys.includes(key)) {
              extraKeys.push(key);
            }
          }
        }
        const pairs = [];
        for (const key of shapeKeys) {
          const keyValidator = shape[key];
          const value = ctx.data[key];
          pairs.push({
            key: { status: "valid", value: key },
            value: keyValidator._parse(new ParseInputLazyPath2(ctx, value, ctx.path, key)),
            alwaysSet: key in ctx.data
          });
        }
        if (this._def.catchall instanceof ZodNever2) {
          const unknownKeys = this._def.unknownKeys;
          if (unknownKeys === "passthrough") {
            for (const key of extraKeys) {
              pairs.push({
                key: { status: "valid", value: key },
                value: { status: "valid", value: ctx.data[key] }
              });
            }
          } else if (unknownKeys === "strict") {
            if (extraKeys.length > 0) {
              addIssueToContext2(ctx, {
                code: ZodIssueCode2.unrecognized_keys,
                keys: extraKeys
              });
              status2.dirty();
            }
          } else if (unknownKeys === "strip") ; else {
            throw new Error(`Internal ZodObject error: invalid unknownKeys value.`);
          }
        } else {
          const catchall = this._def.catchall;
          for (const key of extraKeys) {
            const value = ctx.data[key];
            pairs.push({
              key: { status: "valid", value: key },
              value: catchall._parse(
                new ParseInputLazyPath2(ctx, value, ctx.path, key)
                //, ctx.child(key), value, getParsedType(value)
              ),
              alwaysSet: key in ctx.data
            });
          }
        }
        if (ctx.common.async) {
          return Promise.resolve().then(async () => {
            const syncPairs = [];
            for (const pair of pairs) {
              const key = await pair.key;
              const value = await pair.value;
              syncPairs.push({
                key,
                value,
                alwaysSet: pair.alwaysSet
              });
            }
            return syncPairs;
          }).then((syncPairs) => {
            return ParseStatus2.mergeObjectSync(status2, syncPairs);
          });
        } else {
          return ParseStatus2.mergeObjectSync(status2, pairs);
        }
      }
      get shape() {
        return this._def.shape();
      }
      strict(message) {
        errorUtil2.errToObj;
        return new _ZodObject2({
          ...this._def,
          unknownKeys: "strict",
          ...message !== void 0 ? {
            errorMap: /* @__PURE__ */ __name((issue, ctx) => {
              const defaultError = this._def.errorMap?.(issue, ctx).message ?? ctx.defaultError;
              if (issue.code === "unrecognized_keys")
                return {
                  message: errorUtil2.errToObj(message).message ?? defaultError
                };
              return {
                message: defaultError
              };
            }, "errorMap")
          } : {}
        });
      }
      strip() {
        return new _ZodObject2({
          ...this._def,
          unknownKeys: "strip"
        });
      }
      passthrough() {
        return new _ZodObject2({
          ...this._def,
          unknownKeys: "passthrough"
        });
      }
      // const AugmentFactory =
      //   <Def extends ZodObjectDef>(def: Def) =>
      //   <Augmentation extends ZodRawShape>(
      //     augmentation: Augmentation
      //   ): ZodObject<
      //     extendShape<ReturnType<Def["shape"]>, Augmentation>,
      //     Def["unknownKeys"],
      //     Def["catchall"]
      //   > => {
      //     return new ZodObject({
      //       ...def,
      //       shape: () => ({
      //         ...def.shape(),
      //         ...augmentation,
      //       }),
      //     }) as any;
      //   };
      extend(augmentation) {
        return new _ZodObject2({
          ...this._def,
          shape: /* @__PURE__ */ __name(() => ({
            ...this._def.shape(),
            ...augmentation
          }), "shape")
        });
      }
      /**
       * Prior to zod@1.0.12 there was a bug in the
       * inferred type of merged objects. Please
       * upgrade if you are experiencing issues.
       */
      merge(merging) {
        const merged = new _ZodObject2({
          unknownKeys: merging._def.unknownKeys,
          catchall: merging._def.catchall,
          shape: /* @__PURE__ */ __name(() => ({
            ...this._def.shape(),
            ...merging._def.shape()
          }), "shape"),
          typeName: ZodFirstPartyTypeKind2.ZodObject
        });
        return merged;
      }
      // merge<
      //   Incoming extends AnyZodObject,
      //   Augmentation extends Incoming["shape"],
      //   NewOutput extends {
      //     [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation
      //       ? Augmentation[k]["_output"]
      //       : k extends keyof Output
      //       ? Output[k]
      //       : never;
      //   },
      //   NewInput extends {
      //     [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation
      //       ? Augmentation[k]["_input"]
      //       : k extends keyof Input
      //       ? Input[k]
      //       : never;
      //   }
      // >(
      //   merging: Incoming
      // ): ZodObject<
      //   extendShape<T, ReturnType<Incoming["_def"]["shape"]>>,
      //   Incoming["_def"]["unknownKeys"],
      //   Incoming["_def"]["catchall"],
      //   NewOutput,
      //   NewInput
      // > {
      //   const merged: any = new ZodObject({
      //     unknownKeys: merging._def.unknownKeys,
      //     catchall: merging._def.catchall,
      //     shape: () =>
      //       objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
      //     typeName: ZodFirstPartyTypeKind.ZodObject,
      //   }) as any;
      //   return merged;
      // }
      setKey(key, schema) {
        return this.augment({ [key]: schema });
      }
      // merge<Incoming extends AnyZodObject>(
      //   merging: Incoming
      // ): //ZodObject<T & Incoming["_shape"], UnknownKeys, Catchall> = (merging) => {
      // ZodObject<
      //   extendShape<T, ReturnType<Incoming["_def"]["shape"]>>,
      //   Incoming["_def"]["unknownKeys"],
      //   Incoming["_def"]["catchall"]
      // > {
      //   // const mergedShape = objectUtil.mergeShapes(
      //   //   this._def.shape(),
      //   //   merging._def.shape()
      //   // );
      //   const merged: any = new ZodObject({
      //     unknownKeys: merging._def.unknownKeys,
      //     catchall: merging._def.catchall,
      //     shape: () =>
      //       objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
      //     typeName: ZodFirstPartyTypeKind.ZodObject,
      //   }) as any;
      //   return merged;
      // }
      catchall(index) {
        return new _ZodObject2({
          ...this._def,
          catchall: index
        });
      }
      pick(mask) {
        const shape = {};
        for (const key of util2.objectKeys(mask)) {
          if (mask[key] && this.shape[key]) {
            shape[key] = this.shape[key];
          }
        }
        return new _ZodObject2({
          ...this._def,
          shape: /* @__PURE__ */ __name(() => shape, "shape")
        });
      }
      omit(mask) {
        const shape = {};
        for (const key of util2.objectKeys(this.shape)) {
          if (!mask[key]) {
            shape[key] = this.shape[key];
          }
        }
        return new _ZodObject2({
          ...this._def,
          shape: /* @__PURE__ */ __name(() => shape, "shape")
        });
      }
      /**
       * @deprecated
       */
      deepPartial() {
        return deepPartialify2(this);
      }
      partial(mask) {
        const newShape = {};
        for (const key of util2.objectKeys(this.shape)) {
          const fieldSchema = this.shape[key];
          if (mask && !mask[key]) {
            newShape[key] = fieldSchema;
          } else {
            newShape[key] = fieldSchema.optional();
          }
        }
        return new _ZodObject2({
          ...this._def,
          shape: /* @__PURE__ */ __name(() => newShape, "shape")
        });
      }
      required(mask) {
        const newShape = {};
        for (const key of util2.objectKeys(this.shape)) {
          if (mask && !mask[key]) {
            newShape[key] = this.shape[key];
          } else {
            const fieldSchema = this.shape[key];
            let newField = fieldSchema;
            while (newField instanceof ZodOptional2) {
              newField = newField._def.innerType;
            }
            newShape[key] = newField;
          }
        }
        return new _ZodObject2({
          ...this._def,
          shape: /* @__PURE__ */ __name(() => newShape, "shape")
        });
      }
      keyof() {
        return createZodEnum2(util2.objectKeys(this.shape));
      }
    };
    ZodObject2.create = (shape, params) => {
      return new ZodObject2({
        shape: /* @__PURE__ */ __name(() => shape, "shape"),
        unknownKeys: "strip",
        catchall: ZodNever2.create(),
        typeName: ZodFirstPartyTypeKind2.ZodObject,
        ...processCreateParams2(params)
      });
    };
    ZodObject2.strictCreate = (shape, params) => {
      return new ZodObject2({
        shape: /* @__PURE__ */ __name(() => shape, "shape"),
        unknownKeys: "strict",
        catchall: ZodNever2.create(),
        typeName: ZodFirstPartyTypeKind2.ZodObject,
        ...processCreateParams2(params)
      });
    };
    ZodObject2.lazycreate = (shape, params) => {
      return new ZodObject2({
        shape,
        unknownKeys: "strip",
        catchall: ZodNever2.create(),
        typeName: ZodFirstPartyTypeKind2.ZodObject,
        ...processCreateParams2(params)
      });
    };
    ZodUnion2 = class extends ZodType2 {
      static {
        __name(this, "ZodUnion");
      }
      _parse(input) {
        const { ctx } = this._processInputParams(input);
        const options = this._def.options;
        function handleResults(results) {
          for (const result of results) {
            if (result.result.status === "valid") {
              return result.result;
            }
          }
          for (const result of results) {
            if (result.result.status === "dirty") {
              ctx.common.issues.push(...result.ctx.common.issues);
              return result.result;
            }
          }
          const unionErrors = results.map((result) => new ZodError2(result.ctx.common.issues));
          addIssueToContext2(ctx, {
            code: ZodIssueCode2.invalid_union,
            unionErrors
          });
          return INVALID2;
        }
        __name(handleResults, "handleResults");
        if (ctx.common.async) {
          return Promise.all(options.map(async (option) => {
            const childCtx = {
              ...ctx,
              common: {
                ...ctx.common,
                issues: []
              },
              parent: null
            };
            return {
              result: await option._parseAsync({
                data: ctx.data,
                path: ctx.path,
                parent: childCtx
              }),
              ctx: childCtx
            };
          })).then(handleResults);
        } else {
          let dirty = void 0;
          const issues = [];
          for (const option of options) {
            const childCtx = {
              ...ctx,
              common: {
                ...ctx.common,
                issues: []
              },
              parent: null
            };
            const result = option._parseSync({
              data: ctx.data,
              path: ctx.path,
              parent: childCtx
            });
            if (result.status === "valid") {
              return result;
            } else if (result.status === "dirty" && !dirty) {
              dirty = { result, ctx: childCtx };
            }
            if (childCtx.common.issues.length) {
              issues.push(childCtx.common.issues);
            }
          }
          if (dirty) {
            ctx.common.issues.push(...dirty.ctx.common.issues);
            return dirty.result;
          }
          const unionErrors = issues.map((issues2) => new ZodError2(issues2));
          addIssueToContext2(ctx, {
            code: ZodIssueCode2.invalid_union,
            unionErrors
          });
          return INVALID2;
        }
      }
      get options() {
        return this._def.options;
      }
    };
    ZodUnion2.create = (types13, params) => {
      return new ZodUnion2({
        options: types13,
        typeName: ZodFirstPartyTypeKind2.ZodUnion,
        ...processCreateParams2(params)
      });
    };
    getDiscriminator2 = /* @__PURE__ */ __name((type) => {
      if (type instanceof ZodLazy2) {
        return getDiscriminator2(type.schema);
      } else if (type instanceof ZodEffects2) {
        return getDiscriminator2(type.innerType());
      } else if (type instanceof ZodLiteral2) {
        return [type.value];
      } else if (type instanceof ZodEnum2) {
        return type.options;
      } else if (type instanceof ZodNativeEnum2) {
        return util2.objectValues(type.enum);
      } else if (type instanceof ZodDefault2) {
        return getDiscriminator2(type._def.innerType);
      } else if (type instanceof ZodUndefined2) {
        return [void 0];
      } else if (type instanceof ZodNull2) {
        return [null];
      } else if (type instanceof ZodOptional2) {
        return [void 0, ...getDiscriminator2(type.unwrap())];
      } else if (type instanceof ZodNullable2) {
        return [null, ...getDiscriminator2(type.unwrap())];
      } else if (type instanceof ZodBranded2) {
        return getDiscriminator2(type.unwrap());
      } else if (type instanceof ZodReadonly2) {
        return getDiscriminator2(type.unwrap());
      } else if (type instanceof ZodCatch2) {
        return getDiscriminator2(type._def.innerType);
      } else {
        return [];
      }
    }, "getDiscriminator");
    ZodDiscriminatedUnion2 = class _ZodDiscriminatedUnion2 extends ZodType2 {
      static {
        __name(this, "ZodDiscriminatedUnion");
      }
      _parse(input) {
        const { ctx } = this._processInputParams(input);
        if (ctx.parsedType !== ZodParsedType2.object) {
          addIssueToContext2(ctx, {
            code: ZodIssueCode2.invalid_type,
            expected: ZodParsedType2.object,
            received: ctx.parsedType
          });
          return INVALID2;
        }
        const discriminator = this.discriminator;
        const discriminatorValue = ctx.data[discriminator];
        const option = this.optionsMap.get(discriminatorValue);
        if (!option) {
          addIssueToContext2(ctx, {
            code: ZodIssueCode2.invalid_union_discriminator,
            options: Array.from(this.optionsMap.keys()),
            path: [discriminator]
          });
          return INVALID2;
        }
        if (ctx.common.async) {
          return option._parseAsync({
            data: ctx.data,
            path: ctx.path,
            parent: ctx
          });
        } else {
          return option._parseSync({
            data: ctx.data,
            path: ctx.path,
            parent: ctx
          });
        }
      }
      get discriminator() {
        return this._def.discriminator;
      }
      get options() {
        return this._def.options;
      }
      get optionsMap() {
        return this._def.optionsMap;
      }
      /**
       * The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor.
       * However, it only allows a union of objects, all of which need to share a discriminator property. This property must
       * have a different value for each object in the union.
       * @param discriminator the name of the discriminator property
       * @param types an array of object schemas
       * @param params
       */
      static create(discriminator, options, params) {
        const optionsMap = /* @__PURE__ */ new Map();
        for (const type of options) {
          const discriminatorValues = getDiscriminator2(type.shape[discriminator]);
          if (!discriminatorValues.length) {
            throw new Error(`A discriminator value for key \`${discriminator}\` could not be extracted from all schema options`);
          }
          for (const value of discriminatorValues) {
            if (optionsMap.has(value)) {
              throw new Error(`Discriminator property ${String(discriminator)} has duplicate value ${String(value)}`);
            }
            optionsMap.set(value, type);
          }
        }
        return new _ZodDiscriminatedUnion2({
          typeName: ZodFirstPartyTypeKind2.ZodDiscriminatedUnion,
          discriminator,
          options,
          optionsMap,
          ...processCreateParams2(params)
        });
      }
    };
    __name(mergeValues2, "mergeValues");
    ZodIntersection2 = class extends ZodType2 {
      static {
        __name(this, "ZodIntersection");
      }
      _parse(input) {
        const { status: status2, ctx } = this._processInputParams(input);
        const handleParsed = /* @__PURE__ */ __name((parsedLeft, parsedRight) => {
          if (isAborted2(parsedLeft) || isAborted2(parsedRight)) {
            return INVALID2;
          }
          const merged = mergeValues2(parsedLeft.value, parsedRight.value);
          if (!merged.valid) {
            addIssueToContext2(ctx, {
              code: ZodIssueCode2.invalid_intersection_types
            });
            return INVALID2;
          }
          if (isDirty2(parsedLeft) || isDirty2(parsedRight)) {
            status2.dirty();
          }
          return { status: status2.value, value: merged.data };
        }, "handleParsed");
        if (ctx.common.async) {
          return Promise.all([
            this._def.left._parseAsync({
              data: ctx.data,
              path: ctx.path,
              parent: ctx
            }),
            this._def.right._parseAsync({
              data: ctx.data,
              path: ctx.path,
              parent: ctx
            })
          ]).then(([left2, right2]) => handleParsed(left2, right2));
        } else {
          return handleParsed(this._def.left._parseSync({
            data: ctx.data,
            path: ctx.path,
            parent: ctx
          }), this._def.right._parseSync({
            data: ctx.data,
            path: ctx.path,
            parent: ctx
          }));
        }
      }
    };
    ZodIntersection2.create = (left2, right2, params) => {
      return new ZodIntersection2({
        left: left2,
        right: right2,
        typeName: ZodFirstPartyTypeKind2.ZodIntersection,
        ...processCreateParams2(params)
      });
    };
    ZodTuple2 = class _ZodTuple2 extends ZodType2 {
      static {
        __name(this, "ZodTuple");
      }
      _parse(input) {
        const { status: status2, ctx } = this._processInputParams(input);
        if (ctx.parsedType !== ZodParsedType2.array) {
          addIssueToContext2(ctx, {
            code: ZodIssueCode2.invalid_type,
            expected: ZodParsedType2.array,
            received: ctx.parsedType
          });
          return INVALID2;
        }
        if (ctx.data.length < this._def.items.length) {
          addIssueToContext2(ctx, {
            code: ZodIssueCode2.too_small,
            minimum: this._def.items.length,
            inclusive: true,
            exact: false,
            type: "array"
          });
          return INVALID2;
        }
        const rest = this._def.rest;
        if (!rest && ctx.data.length > this._def.items.length) {
          addIssueToContext2(ctx, {
            code: ZodIssueCode2.too_big,
            maximum: this._def.items.length,
            inclusive: true,
            exact: false,
            type: "array"
          });
          status2.dirty();
        }
        const items = [...ctx.data].map((item, itemIndex) => {
          const schema = this._def.items[itemIndex] || this._def.rest;
          if (!schema)
            return null;
          return schema._parse(new ParseInputLazyPath2(ctx, item, ctx.path, itemIndex));
        }).filter((x7) => !!x7);
        if (ctx.common.async) {
          return Promise.all(items).then((results) => {
            return ParseStatus2.mergeArray(status2, results);
          });
        } else {
          return ParseStatus2.mergeArray(status2, items);
        }
      }
      get items() {
        return this._def.items;
      }
      rest(rest) {
        return new _ZodTuple2({
          ...this._def,
          rest
        });
      }
    };
    ZodTuple2.create = (schemas, params) => {
      if (!Array.isArray(schemas)) {
        throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
      }
      return new ZodTuple2({
        items: schemas,
        typeName: ZodFirstPartyTypeKind2.ZodTuple,
        rest: null,
        ...processCreateParams2(params)
      });
    };
    ZodRecord2 = class _ZodRecord2 extends ZodType2 {
      static {
        __name(this, "ZodRecord");
      }
      get keySchema() {
        return this._def.keyType;
      }
      get valueSchema() {
        return this._def.valueType;
      }
      _parse(input) {
        const { status: status2, ctx } = this._processInputParams(input);
        if (ctx.parsedType !== ZodParsedType2.object) {
          addIssueToContext2(ctx, {
            code: ZodIssueCode2.invalid_type,
            expected: ZodParsedType2.object,
            received: ctx.parsedType
          });
          return INVALID2;
        }
        const pairs = [];
        const keyType = this._def.keyType;
        const valueType = this._def.valueType;
        for (const key in ctx.data) {
          pairs.push({
            key: keyType._parse(new ParseInputLazyPath2(ctx, key, ctx.path, key)),
            value: valueType._parse(new ParseInputLazyPath2(ctx, ctx.data[key], ctx.path, key)),
            alwaysSet: key in ctx.data
          });
        }
        if (ctx.common.async) {
          return ParseStatus2.mergeObjectAsync(status2, pairs);
        } else {
          return ParseStatus2.mergeObjectSync(status2, pairs);
        }
      }
      get element() {
        return this._def.valueType;
      }
      static create(first, second, third) {
        if (second instanceof ZodType2) {
          return new _ZodRecord2({
            keyType: first,
            valueType: second,
            typeName: ZodFirstPartyTypeKind2.ZodRecord,
            ...processCreateParams2(third)
          });
        }
        return new _ZodRecord2({
          keyType: ZodString2.create(),
          valueType: first,
          typeName: ZodFirstPartyTypeKind2.ZodRecord,
          ...processCreateParams2(second)
        });
      }
    };
    ZodMap2 = class extends ZodType2 {
      static {
        __name(this, "ZodMap");
      }
      get keySchema() {
        return this._def.keyType;
      }
      get valueSchema() {
        return this._def.valueType;
      }
      _parse(input) {
        const { status: status2, ctx } = this._processInputParams(input);
        if (ctx.parsedType !== ZodParsedType2.map) {
          addIssueToContext2(ctx, {
            code: ZodIssueCode2.invalid_type,
            expected: ZodParsedType2.map,
            received: ctx.parsedType
          });
          return INVALID2;
        }
        const keyType = this._def.keyType;
        const valueType = this._def.valueType;
        const pairs = [...ctx.data.entries()].map(([key, value], index) => {
          return {
            key: keyType._parse(new ParseInputLazyPath2(ctx, key, ctx.path, [index, "key"])),
            value: valueType._parse(new ParseInputLazyPath2(ctx, value, ctx.path, [index, "value"]))
          };
        });
        if (ctx.common.async) {
          const finalMap = /* @__PURE__ */ new Map();
          return Promise.resolve().then(async () => {
            for (const pair of pairs) {
              const key = await pair.key;
              const value = await pair.value;
              if (key.status === "aborted" || value.status === "aborted") {
                return INVALID2;
              }
              if (key.status === "dirty" || value.status === "dirty") {
                status2.dirty();
              }
              finalMap.set(key.value, value.value);
            }
            return { status: status2.value, value: finalMap };
          });
        } else {
          const finalMap = /* @__PURE__ */ new Map();
          for (const pair of pairs) {
            const key = pair.key;
            const value = pair.value;
            if (key.status === "aborted" || value.status === "aborted") {
              return INVALID2;
            }
            if (key.status === "dirty" || value.status === "dirty") {
              status2.dirty();
            }
            finalMap.set(key.value, value.value);
          }
          return { status: status2.value, value: finalMap };
        }
      }
    };
    ZodMap2.create = (keyType, valueType, params) => {
      return new ZodMap2({
        valueType,
        keyType,
        typeName: ZodFirstPartyTypeKind2.ZodMap,
        ...processCreateParams2(params)
      });
    };
    ZodSet2 = class _ZodSet2 extends ZodType2 {
      static {
        __name(this, "ZodSet");
      }
      _parse(input) {
        const { status: status2, ctx } = this._processInputParams(input);
        if (ctx.parsedType !== ZodParsedType2.set) {
          addIssueToContext2(ctx, {
            code: ZodIssueCode2.invalid_type,
            expected: ZodParsedType2.set,
            received: ctx.parsedType
          });
          return INVALID2;
        }
        const def = this._def;
        if (def.minSize !== null) {
          if (ctx.data.size < def.minSize.value) {
            addIssueToContext2(ctx, {
              code: ZodIssueCode2.too_small,
              minimum: def.minSize.value,
              type: "set",
              inclusive: true,
              exact: false,
              message: def.minSize.message
            });
            status2.dirty();
          }
        }
        if (def.maxSize !== null) {
          if (ctx.data.size > def.maxSize.value) {
            addIssueToContext2(ctx, {
              code: ZodIssueCode2.too_big,
              maximum: def.maxSize.value,
              type: "set",
              inclusive: true,
              exact: false,
              message: def.maxSize.message
            });
            status2.dirty();
          }
        }
        const valueType = this._def.valueType;
        function finalizeSet(elements2) {
          const parsedSet = /* @__PURE__ */ new Set();
          for (const element of elements2) {
            if (element.status === "aborted")
              return INVALID2;
            if (element.status === "dirty")
              status2.dirty();
            parsedSet.add(element.value);
          }
          return { status: status2.value, value: parsedSet };
        }
        __name(finalizeSet, "finalizeSet");
        const elements = [...ctx.data.values()].map((item, i7) => valueType._parse(new ParseInputLazyPath2(ctx, item, ctx.path, i7)));
        if (ctx.common.async) {
          return Promise.all(elements).then((elements2) => finalizeSet(elements2));
        } else {
          return finalizeSet(elements);
        }
      }
      min(minSize, message) {
        return new _ZodSet2({
          ...this._def,
          minSize: { value: minSize, message: errorUtil2.toString(message) }
        });
      }
      max(maxSize, message) {
        return new _ZodSet2({
          ...this._def,
          maxSize: { value: maxSize, message: errorUtil2.toString(message) }
        });
      }
      size(size, message) {
        return this.min(size, message).max(size, message);
      }
      nonempty(message) {
        return this.min(1, message);
      }
    };
    ZodSet2.create = (valueType, params) => {
      return new ZodSet2({
        valueType,
        minSize: null,
        maxSize: null,
        typeName: ZodFirstPartyTypeKind2.ZodSet,
        ...processCreateParams2(params)
      });
    };
    ZodFunction2 = class _ZodFunction2 extends ZodType2 {
      static {
        __name(this, "ZodFunction");
      }
      constructor() {
        super(...arguments);
        this.validate = this.implement;
      }
      _parse(input) {
        const { ctx } = this._processInputParams(input);
        if (ctx.parsedType !== ZodParsedType2.function) {
          addIssueToContext2(ctx, {
            code: ZodIssueCode2.invalid_type,
            expected: ZodParsedType2.function,
            received: ctx.parsedType
          });
          return INVALID2;
        }
        function makeArgsIssue(args, error2) {
          return makeIssue2({
            data: args,
            path: ctx.path,
            errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap2(), en_default].filter((x7) => !!x7),
            issueData: {
              code: ZodIssueCode2.invalid_arguments,
              argumentsError: error2
            }
          });
        }
        __name(makeArgsIssue, "makeArgsIssue");
        function makeReturnsIssue(returns, error2) {
          return makeIssue2({
            data: returns,
            path: ctx.path,
            errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap2(), en_default].filter((x7) => !!x7),
            issueData: {
              code: ZodIssueCode2.invalid_return_type,
              returnTypeError: error2
            }
          });
        }
        __name(makeReturnsIssue, "makeReturnsIssue");
        const params = { errorMap: ctx.common.contextualErrorMap };
        const fn2 = ctx.data;
        if (this._def.returns instanceof ZodPromise2) {
          const me2 = this;
          return OK2(async function(...args) {
            const error2 = new ZodError2([]);
            const parsedArgs = await me2._def.args.parseAsync(args, params).catch((e10) => {
              error2.addIssue(makeArgsIssue(args, e10));
              throw error2;
            });
            const result = await Reflect.apply(fn2, this, parsedArgs);
            const parsedReturns = await me2._def.returns._def.type.parseAsync(result, params).catch((e10) => {
              error2.addIssue(makeReturnsIssue(result, e10));
              throw error2;
            });
            return parsedReturns;
          });
        } else {
          const me2 = this;
          return OK2(function(...args) {
            const parsedArgs = me2._def.args.safeParse(args, params);
            if (!parsedArgs.success) {
              throw new ZodError2([makeArgsIssue(args, parsedArgs.error)]);
            }
            const result = Reflect.apply(fn2, this, parsedArgs.data);
            const parsedReturns = me2._def.returns.safeParse(result, params);
            if (!parsedReturns.success) {
              throw new ZodError2([makeReturnsIssue(result, parsedReturns.error)]);
            }
            return parsedReturns.data;
          });
        }
      }
      parameters() {
        return this._def.args;
      }
      returnType() {
        return this._def.returns;
      }
      args(...items) {
        return new _ZodFunction2({
          ...this._def,
          args: ZodTuple2.create(items).rest(ZodUnknown2.create())
        });
      }
      returns(returnType) {
        return new _ZodFunction2({
          ...this._def,
          returns: returnType
        });
      }
      implement(func) {
        const validatedFunc = this.parse(func);
        return validatedFunc;
      }
      strictImplement(func) {
        const validatedFunc = this.parse(func);
        return validatedFunc;
      }
      static create(args, returns, params) {
        return new _ZodFunction2({
          args: args ? args : ZodTuple2.create([]).rest(ZodUnknown2.create()),
          returns: returns || ZodUnknown2.create(),
          typeName: ZodFirstPartyTypeKind2.ZodFunction,
          ...processCreateParams2(params)
        });
      }
    };
    ZodLazy2 = class extends ZodType2 {
      static {
        __name(this, "ZodLazy");
      }
      get schema() {
        return this._def.getter();
      }
      _parse(input) {
        const { ctx } = this._processInputParams(input);
        const lazySchema = this._def.getter();
        return lazySchema._parse({ data: ctx.data, path: ctx.path, parent: ctx });
      }
    };
    ZodLazy2.create = (getter, params) => {
      return new ZodLazy2({
        getter,
        typeName: ZodFirstPartyTypeKind2.ZodLazy,
        ...processCreateParams2(params)
      });
    };
    ZodLiteral2 = class extends ZodType2 {
      static {
        __name(this, "ZodLiteral");
      }
      _parse(input) {
        if (input.data !== this._def.value) {
          const ctx = this._getOrReturnCtx(input);
          addIssueToContext2(ctx, {
            received: ctx.data,
            code: ZodIssueCode2.invalid_literal,
            expected: this._def.value
          });
          return INVALID2;
        }
        return { status: "valid", value: input.data };
      }
      get value() {
        return this._def.value;
      }
    };
    ZodLiteral2.create = (value, params) => {
      return new ZodLiteral2({
        value,
        typeName: ZodFirstPartyTypeKind2.ZodLiteral,
        ...processCreateParams2(params)
      });
    };
    __name(createZodEnum2, "createZodEnum");
    ZodEnum2 = class _ZodEnum2 extends ZodType2 {
      static {
        __name(this, "ZodEnum");
      }
      _parse(input) {
        if (typeof input.data !== "string") {
          const ctx = this._getOrReturnCtx(input);
          const expectedValues = this._def.values;
          addIssueToContext2(ctx, {
            expected: util2.joinValues(expectedValues),
            received: ctx.parsedType,
            code: ZodIssueCode2.invalid_type
          });
          return INVALID2;
        }
        if (!this._cache) {
          this._cache = new Set(this._def.values);
        }
        if (!this._cache.has(input.data)) {
          const ctx = this._getOrReturnCtx(input);
          const expectedValues = this._def.values;
          addIssueToContext2(ctx, {
            received: ctx.data,
            code: ZodIssueCode2.invalid_enum_value,
            options: expectedValues
          });
          return INVALID2;
        }
        return OK2(input.data);
      }
      get options() {
        return this._def.values;
      }
      get enum() {
        const enumValues = {};
        for (const val2 of this._def.values) {
          enumValues[val2] = val2;
        }
        return enumValues;
      }
      get Values() {
        const enumValues = {};
        for (const val2 of this._def.values) {
          enumValues[val2] = val2;
        }
        return enumValues;
      }
      get Enum() {
        const enumValues = {};
        for (const val2 of this._def.values) {
          enumValues[val2] = val2;
        }
        return enumValues;
      }
      extract(values, newDef = this._def) {
        return _ZodEnum2.create(values, {
          ...this._def,
          ...newDef
        });
      }
      exclude(values, newDef = this._def) {
        return _ZodEnum2.create(this.options.filter((opt) => !values.includes(opt)), {
          ...this._def,
          ...newDef
        });
      }
    };
    ZodEnum2.create = createZodEnum2;
    ZodNativeEnum2 = class extends ZodType2 {
      static {
        __name(this, "ZodNativeEnum");
      }
      _parse(input) {
        const nativeEnumValues = util2.getValidEnumValues(this._def.values);
        const ctx = this._getOrReturnCtx(input);
        if (ctx.parsedType !== ZodParsedType2.string && ctx.parsedType !== ZodParsedType2.number) {
          const expectedValues = util2.objectValues(nativeEnumValues);
          addIssueToContext2(ctx, {
            expected: util2.joinValues(expectedValues),
            received: ctx.parsedType,
            code: ZodIssueCode2.invalid_type
          });
          return INVALID2;
        }
        if (!this._cache) {
          this._cache = new Set(util2.getValidEnumValues(this._def.values));
        }
        if (!this._cache.has(input.data)) {
          const expectedValues = util2.objectValues(nativeEnumValues);
          addIssueToContext2(ctx, {
            received: ctx.data,
            code: ZodIssueCode2.invalid_enum_value,
            options: expectedValues
          });
          return INVALID2;
        }
        return OK2(input.data);
      }
      get enum() {
        return this._def.values;
      }
    };
    ZodNativeEnum2.create = (values, params) => {
      return new ZodNativeEnum2({
        values,
        typeName: ZodFirstPartyTypeKind2.ZodNativeEnum,
        ...processCreateParams2(params)
      });
    };
    ZodPromise2 = class extends ZodType2 {
      static {
        __name(this, "ZodPromise");
      }
      unwrap() {
        return this._def.type;
      }
      _parse(input) {
        const { ctx } = this._processInputParams(input);
        if (ctx.parsedType !== ZodParsedType2.promise && ctx.common.async === false) {
          addIssueToContext2(ctx, {
            code: ZodIssueCode2.invalid_type,
            expected: ZodParsedType2.promise,
            received: ctx.parsedType
          });
          return INVALID2;
        }
        const promisified = ctx.parsedType === ZodParsedType2.promise ? ctx.data : Promise.resolve(ctx.data);
        return OK2(promisified.then((data) => {
          return this._def.type.parseAsync(data, {
            path: ctx.path,
            errorMap: ctx.common.contextualErrorMap
          });
        }));
      }
    };
    ZodPromise2.create = (schema, params) => {
      return new ZodPromise2({
        type: schema,
        typeName: ZodFirstPartyTypeKind2.ZodPromise,
        ...processCreateParams2(params)
      });
    };
    ZodEffects2 = class extends ZodType2 {
      static {
        __name(this, "ZodEffects");
      }
      innerType() {
        return this._def.schema;
      }
      sourceType() {
        return this._def.schema._def.typeName === ZodFirstPartyTypeKind2.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
      }
      _parse(input) {
        const { status: status2, ctx } = this._processInputParams(input);
        const effect = this._def.effect || null;
        const checkCtx = {
          addIssue: /* @__PURE__ */ __name((arg) => {
            addIssueToContext2(ctx, arg);
            if (arg.fatal) {
              status2.abort();
            } else {
              status2.dirty();
            }
          }, "addIssue"),
          get path() {
            return ctx.path;
          }
        };
        checkCtx.addIssue = checkCtx.addIssue.bind(checkCtx);
        if (effect.type === "preprocess") {
          const processed = effect.transform(ctx.data, checkCtx);
          if (ctx.common.async) {
            return Promise.resolve(processed).then(async (processed2) => {
              if (status2.value === "aborted")
                return INVALID2;
              const result = await this._def.schema._parseAsync({
                data: processed2,
                path: ctx.path,
                parent: ctx
              });
              if (result.status === "aborted")
                return INVALID2;
              if (result.status === "dirty")
                return DIRTY2(result.value);
              if (status2.value === "dirty")
                return DIRTY2(result.value);
              return result;
            });
          } else {
            if (status2.value === "aborted")
              return INVALID2;
            const result = this._def.schema._parseSync({
              data: processed,
              path: ctx.path,
              parent: ctx
            });
            if (result.status === "aborted")
              return INVALID2;
            if (result.status === "dirty")
              return DIRTY2(result.value);
            if (status2.value === "dirty")
              return DIRTY2(result.value);
            return result;
          }
        }
        if (effect.type === "refinement") {
          const executeRefinement = /* @__PURE__ */ __name((acc) => {
            const result = effect.refinement(acc, checkCtx);
            if (ctx.common.async) {
              return Promise.resolve(result);
            }
            if (result instanceof Promise) {
              throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");
            }
            return acc;
          }, "executeRefinement");
          if (ctx.common.async === false) {
            const inner = this._def.schema._parseSync({
              data: ctx.data,
              path: ctx.path,
              parent: ctx
            });
            if (inner.status === "aborted")
              return INVALID2;
            if (inner.status === "dirty")
              status2.dirty();
            executeRefinement(inner.value);
            return { status: status2.value, value: inner.value };
          } else {
            return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((inner) => {
              if (inner.status === "aborted")
                return INVALID2;
              if (inner.status === "dirty")
                status2.dirty();
              return executeRefinement(inner.value).then(() => {
                return { status: status2.value, value: inner.value };
              });
            });
          }
        }
        if (effect.type === "transform") {
          if (ctx.common.async === false) {
            const base = this._def.schema._parseSync({
              data: ctx.data,
              path: ctx.path,
              parent: ctx
            });
            if (!isValid2(base))
              return INVALID2;
            const result = effect.transform(base.value, checkCtx);
            if (result instanceof Promise) {
              throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);
            }
            return { status: status2.value, value: result };
          } else {
            return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((base) => {
              if (!isValid2(base))
                return INVALID2;
              return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({
                status: status2.value,
                value: result
              }));
            });
          }
        }
        util2.assertNever(effect);
      }
    };
    ZodEffects2.create = (schema, effect, params) => {
      return new ZodEffects2({
        schema,
        typeName: ZodFirstPartyTypeKind2.ZodEffects,
        effect,
        ...processCreateParams2(params)
      });
    };
    ZodEffects2.createWithPreprocess = (preprocess, schema, params) => {
      return new ZodEffects2({
        schema,
        effect: { type: "preprocess", transform: preprocess },
        typeName: ZodFirstPartyTypeKind2.ZodEffects,
        ...processCreateParams2(params)
      });
    };
    ZodOptional2 = class extends ZodType2 {
      static {
        __name(this, "ZodOptional");
      }
      _parse(input) {
        const parsedType = this._getType(input);
        if (parsedType === ZodParsedType2.undefined) {
          return OK2(void 0);
        }
        return this._def.innerType._parse(input);
      }
      unwrap() {
        return this._def.innerType;
      }
    };
    ZodOptional2.create = (type, params) => {
      return new ZodOptional2({
        innerType: type,
        typeName: ZodFirstPartyTypeKind2.ZodOptional,
        ...processCreateParams2(params)
      });
    };
    ZodNullable2 = class extends ZodType2 {
      static {
        __name(this, "ZodNullable");
      }
      _parse(input) {
        const parsedType = this._getType(input);
        if (parsedType === ZodParsedType2.null) {
          return OK2(null);
        }
        return this._def.innerType._parse(input);
      }
      unwrap() {
        return this._def.innerType;
      }
    };
    ZodNullable2.create = (type, params) => {
      return new ZodNullable2({
        innerType: type,
        typeName: ZodFirstPartyTypeKind2.ZodNullable,
        ...processCreateParams2(params)
      });
    };
    ZodDefault2 = class extends ZodType2 {
      static {
        __name(this, "ZodDefault");
      }
      _parse(input) {
        const { ctx } = this._processInputParams(input);
        let data = ctx.data;
        if (ctx.parsedType === ZodParsedType2.undefined) {
          data = this._def.defaultValue();
        }
        return this._def.innerType._parse({
          data,
          path: ctx.path,
          parent: ctx
        });
      }
      removeDefault() {
        return this._def.innerType;
      }
    };
    ZodDefault2.create = (type, params) => {
      return new ZodDefault2({
        innerType: type,
        typeName: ZodFirstPartyTypeKind2.ZodDefault,
        defaultValue: typeof params.default === "function" ? params.default : () => params.default,
        ...processCreateParams2(params)
      });
    };
    ZodCatch2 = class extends ZodType2 {
      static {
        __name(this, "ZodCatch");
      }
      _parse(input) {
        const { ctx } = this._processInputParams(input);
        const newCtx = {
          ...ctx,
          common: {
            ...ctx.common,
            issues: []
          }
        };
        const result = this._def.innerType._parse({
          data: newCtx.data,
          path: newCtx.path,
          parent: {
            ...newCtx
          }
        });
        if (isAsync2(result)) {
          return result.then((result2) => {
            return {
              status: "valid",
              value: result2.status === "valid" ? result2.value : this._def.catchValue({
                get error() {
                  return new ZodError2(newCtx.common.issues);
                },
                input: newCtx.data
              })
            };
          });
        } else {
          return {
            status: "valid",
            value: result.status === "valid" ? result.value : this._def.catchValue({
              get error() {
                return new ZodError2(newCtx.common.issues);
              },
              input: newCtx.data
            })
          };
        }
      }
      removeCatch() {
        return this._def.innerType;
      }
    };
    ZodCatch2.create = (type, params) => {
      return new ZodCatch2({
        innerType: type,
        typeName: ZodFirstPartyTypeKind2.ZodCatch,
        catchValue: typeof params.catch === "function" ? params.catch : () => params.catch,
        ...processCreateParams2(params)
      });
    };
    ZodNaN2 = class extends ZodType2 {
      static {
        __name(this, "ZodNaN");
      }
      _parse(input) {
        const parsedType = this._getType(input);
        if (parsedType !== ZodParsedType2.nan) {
          const ctx = this._getOrReturnCtx(input);
          addIssueToContext2(ctx, {
            code: ZodIssueCode2.invalid_type,
            expected: ZodParsedType2.nan,
            received: ctx.parsedType
          });
          return INVALID2;
        }
        return { status: "valid", value: input.data };
      }
    };
    ZodNaN2.create = (params) => {
      return new ZodNaN2({
        typeName: ZodFirstPartyTypeKind2.ZodNaN,
        ...processCreateParams2(params)
      });
    };
    BRAND2 = Symbol("zod_brand");
    ZodBranded2 = class extends ZodType2 {
      static {
        __name(this, "ZodBranded");
      }
      _parse(input) {
        const { ctx } = this._processInputParams(input);
        const data = ctx.data;
        return this._def.type._parse({
          data,
          path: ctx.path,
          parent: ctx
        });
      }
      unwrap() {
        return this._def.type;
      }
    };
    ZodPipeline2 = class _ZodPipeline2 extends ZodType2 {
      static {
        __name(this, "ZodPipeline");
      }
      _parse(input) {
        const { status: status2, ctx } = this._processInputParams(input);
        if (ctx.common.async) {
          const handleAsync = /* @__PURE__ */ __name(async () => {
            const inResult = await this._def.in._parseAsync({
              data: ctx.data,
              path: ctx.path,
              parent: ctx
            });
            if (inResult.status === "aborted")
              return INVALID2;
            if (inResult.status === "dirty") {
              status2.dirty();
              return DIRTY2(inResult.value);
            } else {
              return this._def.out._parseAsync({
                data: inResult.value,
                path: ctx.path,
                parent: ctx
              });
            }
          }, "handleAsync");
          return handleAsync();
        } else {
          const inResult = this._def.in._parseSync({
            data: ctx.data,
            path: ctx.path,
            parent: ctx
          });
          if (inResult.status === "aborted")
            return INVALID2;
          if (inResult.status === "dirty") {
            status2.dirty();
            return {
              status: "dirty",
              value: inResult.value
            };
          } else {
            return this._def.out._parseSync({
              data: inResult.value,
              path: ctx.path,
              parent: ctx
            });
          }
        }
      }
      static create(a7, b11) {
        return new _ZodPipeline2({
          in: a7,
          out: b11,
          typeName: ZodFirstPartyTypeKind2.ZodPipeline
        });
      }
    };
    ZodReadonly2 = class extends ZodType2 {
      static {
        __name(this, "ZodReadonly");
      }
      _parse(input) {
        const result = this._def.innerType._parse(input);
        const freeze = /* @__PURE__ */ __name((data) => {
          if (isValid2(data)) {
            data.value = Object.freeze(data.value);
          }
          return data;
        }, "freeze");
        return isAsync2(result) ? result.then((data) => freeze(data)) : freeze(result);
      }
      unwrap() {
        return this._def.innerType;
      }
    };
    ZodReadonly2.create = (type, params) => {
      return new ZodReadonly2({
        innerType: type,
        typeName: ZodFirstPartyTypeKind2.ZodReadonly,
        ...processCreateParams2(params)
      });
    };
    __name(cleanParams, "cleanParams");
    __name(custom2, "custom");
    late2 = {
      object: ZodObject2.lazycreate
    };
    (function(ZodFirstPartyTypeKind4) {
      ZodFirstPartyTypeKind4["ZodString"] = "ZodString";
      ZodFirstPartyTypeKind4["ZodNumber"] = "ZodNumber";
      ZodFirstPartyTypeKind4["ZodNaN"] = "ZodNaN";
      ZodFirstPartyTypeKind4["ZodBigInt"] = "ZodBigInt";
      ZodFirstPartyTypeKind4["ZodBoolean"] = "ZodBoolean";
      ZodFirstPartyTypeKind4["ZodDate"] = "ZodDate";
      ZodFirstPartyTypeKind4["ZodSymbol"] = "ZodSymbol";
      ZodFirstPartyTypeKind4["ZodUndefined"] = "ZodUndefined";
      ZodFirstPartyTypeKind4["ZodNull"] = "ZodNull";
      ZodFirstPartyTypeKind4["ZodAny"] = "ZodAny";
      ZodFirstPartyTypeKind4["ZodUnknown"] = "ZodUnknown";
      ZodFirstPartyTypeKind4["ZodNever"] = "ZodNever";
      ZodFirstPartyTypeKind4["ZodVoid"] = "ZodVoid";
      ZodFirstPartyTypeKind4["ZodArray"] = "ZodArray";
      ZodFirstPartyTypeKind4["ZodObject"] = "ZodObject";
      ZodFirstPartyTypeKind4["ZodUnion"] = "ZodUnion";
      ZodFirstPartyTypeKind4["ZodDiscriminatedUnion"] = "ZodDiscriminatedUnion";
      ZodFirstPartyTypeKind4["ZodIntersection"] = "ZodIntersection";
      ZodFirstPartyTypeKind4["ZodTuple"] = "ZodTuple";
      ZodFirstPartyTypeKind4["ZodRecord"] = "ZodRecord";
      ZodFirstPartyTypeKind4["ZodMap"] = "ZodMap";
      ZodFirstPartyTypeKind4["ZodSet"] = "ZodSet";
      ZodFirstPartyTypeKind4["ZodFunction"] = "ZodFunction";
      ZodFirstPartyTypeKind4["ZodLazy"] = "ZodLazy";
      ZodFirstPartyTypeKind4["ZodLiteral"] = "ZodLiteral";
      ZodFirstPartyTypeKind4["ZodEnum"] = "ZodEnum";
      ZodFirstPartyTypeKind4["ZodEffects"] = "ZodEffects";
      ZodFirstPartyTypeKind4["ZodNativeEnum"] = "ZodNativeEnum";
      ZodFirstPartyTypeKind4["ZodOptional"] = "ZodOptional";
      ZodFirstPartyTypeKind4["ZodNullable"] = "ZodNullable";
      ZodFirstPartyTypeKind4["ZodDefault"] = "ZodDefault";
      ZodFirstPartyTypeKind4["ZodCatch"] = "ZodCatch";
      ZodFirstPartyTypeKind4["ZodPromise"] = "ZodPromise";
      ZodFirstPartyTypeKind4["ZodBranded"] = "ZodBranded";
      ZodFirstPartyTypeKind4["ZodPipeline"] = "ZodPipeline";
      ZodFirstPartyTypeKind4["ZodReadonly"] = "ZodReadonly";
    })(ZodFirstPartyTypeKind2 || (ZodFirstPartyTypeKind2 = {}));
    instanceOfType2 = /* @__PURE__ */ __name((cls, params = {
      message: `Input not instance of ${cls.name}`
    }) => custom2((data) => data instanceof cls, params), "instanceOfType");
    stringType2 = ZodString2.create;
    numberType2 = ZodNumber2.create;
    nanType2 = ZodNaN2.create;
    bigIntType2 = ZodBigInt2.create;
    booleanType2 = ZodBoolean2.create;
    dateType2 = ZodDate2.create;
    symbolType2 = ZodSymbol2.create;
    undefinedType2 = ZodUndefined2.create;
    nullType2 = ZodNull2.create;
    anyType2 = ZodAny2.create;
    unknownType2 = ZodUnknown2.create;
    neverType2 = ZodNever2.create;
    voidType2 = ZodVoid2.create;
    arrayType2 = ZodArray2.create;
    objectType2 = ZodObject2.create;
    strictObjectType2 = ZodObject2.strictCreate;
    unionType2 = ZodUnion2.create;
    discriminatedUnionType2 = ZodDiscriminatedUnion2.create;
    intersectionType2 = ZodIntersection2.create;
    tupleType2 = ZodTuple2.create;
    recordType2 = ZodRecord2.create;
    mapType2 = ZodMap2.create;
    setType2 = ZodSet2.create;
    functionType2 = ZodFunction2.create;
    lazyType2 = ZodLazy2.create;
    literalType2 = ZodLiteral2.create;
    enumType2 = ZodEnum2.create;
    nativeEnumType2 = ZodNativeEnum2.create;
    promiseType2 = ZodPromise2.create;
    effectsType2 = ZodEffects2.create;
    optionalType2 = ZodOptional2.create;
    nullableType2 = ZodNullable2.create;
    preprocessType2 = ZodEffects2.createWithPreprocess;
    pipelineType2 = ZodPipeline2.create;
    ostring2 = /* @__PURE__ */ __name(() => stringType2().optional(), "ostring");
    onumber2 = /* @__PURE__ */ __name(() => numberType2().optional(), "onumber");
    oboolean2 = /* @__PURE__ */ __name(() => booleanType2().optional(), "oboolean");
    coerce2 = {
      string: /* @__PURE__ */ __name((arg) => ZodString2.create({ ...arg, coerce: true }), "string"),
      number: /* @__PURE__ */ __name((arg) => ZodNumber2.create({ ...arg, coerce: true }), "number"),
      boolean: /* @__PURE__ */ __name((arg) => ZodBoolean2.create({
        ...arg,
        coerce: true
      }), "boolean"),
      bigint: /* @__PURE__ */ __name((arg) => ZodBigInt2.create({ ...arg, coerce: true }), "bigint"),
      date: /* @__PURE__ */ __name((arg) => ZodDate2.create({ ...arg, coerce: true }), "date")
    };
    NEVER2 = INVALID2;
  }
});

// ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/external.js
var external_exports = {};
__export(external_exports, {
  BRAND: () => BRAND2,
  DIRTY: () => DIRTY2,
  EMPTY_PATH: () => EMPTY_PATH2,
  INVALID: () => INVALID2,
  NEVER: () => NEVER2,
  OK: () => OK2,
  ParseStatus: () => ParseStatus2,
  Schema: () => ZodType2,
  ZodAny: () => ZodAny2,
  ZodArray: () => ZodArray2,
  ZodBigInt: () => ZodBigInt2,
  ZodBoolean: () => ZodBoolean2,
  ZodBranded: () => ZodBranded2,
  ZodCatch: () => ZodCatch2,
  ZodDate: () => ZodDate2,
  ZodDefault: () => ZodDefault2,
  ZodDiscriminatedUnion: () => ZodDiscriminatedUnion2,
  ZodEffects: () => ZodEffects2,
  ZodEnum: () => ZodEnum2,
  ZodError: () => ZodError2,
  ZodFirstPartyTypeKind: () => ZodFirstPartyTypeKind2,
  ZodFunction: () => ZodFunction2,
  ZodIntersection: () => ZodIntersection2,
  ZodIssueCode: () => ZodIssueCode2,
  ZodLazy: () => ZodLazy2,
  ZodLiteral: () => ZodLiteral2,
  ZodMap: () => ZodMap2,
  ZodNaN: () => ZodNaN2,
  ZodNativeEnum: () => ZodNativeEnum2,
  ZodNever: () => ZodNever2,
  ZodNull: () => ZodNull2,
  ZodNullable: () => ZodNullable2,
  ZodNumber: () => ZodNumber2,
  ZodObject: () => ZodObject2,
  ZodOptional: () => ZodOptional2,
  ZodParsedType: () => ZodParsedType2,
  ZodPipeline: () => ZodPipeline2,
  ZodPromise: () => ZodPromise2,
  ZodReadonly: () => ZodReadonly2,
  ZodRecord: () => ZodRecord2,
  ZodSchema: () => ZodType2,
  ZodSet: () => ZodSet2,
  ZodString: () => ZodString2,
  ZodSymbol: () => ZodSymbol2,
  ZodTransformer: () => ZodEffects2,
  ZodTuple: () => ZodTuple2,
  ZodType: () => ZodType2,
  ZodUndefined: () => ZodUndefined2,
  ZodUnion: () => ZodUnion2,
  ZodUnknown: () => ZodUnknown2,
  ZodVoid: () => ZodVoid2,
  addIssueToContext: () => addIssueToContext2,
  any: () => anyType2,
  array: () => arrayType2,
  bigint: () => bigIntType2,
  boolean: () => booleanType2,
  coerce: () => coerce2,
  custom: () => custom2,
  date: () => dateType2,
  datetimeRegex: () => datetimeRegex2,
  defaultErrorMap: () => en_default,
  discriminatedUnion: () => discriminatedUnionType2,
  effect: () => effectsType2,
  enum: () => enumType2,
  function: () => functionType2,
  getErrorMap: () => getErrorMap2,
  getParsedType: () => getParsedType2,
  instanceof: () => instanceOfType2,
  intersection: () => intersectionType2,
  isAborted: () => isAborted2,
  isAsync: () => isAsync2,
  isDirty: () => isDirty2,
  isValid: () => isValid2,
  late: () => late2,
  lazy: () => lazyType2,
  literal: () => literalType2,
  makeIssue: () => makeIssue2,
  map: () => mapType2,
  nan: () => nanType2,
  nativeEnum: () => nativeEnumType2,
  never: () => neverType2,
  null: () => nullType2,
  nullable: () => nullableType2,
  number: () => numberType2,
  object: () => objectType2,
  objectUtil: () => objectUtil2,
  oboolean: () => oboolean2,
  onumber: () => onumber2,
  optional: () => optionalType2,
  ostring: () => ostring2,
  pipeline: () => pipelineType2,
  preprocess: () => preprocessType2,
  promise: () => promiseType2,
  quotelessJson: () => quotelessJson2,
  record: () => recordType2,
  set: () => setType2,
  setErrorMap: () => setErrorMap2,
  strictObject: () => strictObjectType2,
  string: () => stringType2,
  symbol: () => symbolType2,
  transformer: () => effectsType2,
  tuple: () => tupleType2,
  undefined: () => undefinedType2,
  union: () => unionType2,
  unknown: () => unknownType2,
  util: () => util2,
  void: () => voidType2
});
var init_external = __esm({
  "../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/external.js"() {
    init_import_meta_url();
    init_errors();
    init_parseUtil();
    init_typeAliases();
    init_util();
    init_types2();
    init_ZodError();
  }
});

// ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/index.js
var init_zod = __esm({
  "../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/index.js"() {
    init_import_meta_url();
    init_external();
    init_external();
  }
});

// ../workers-shared/utils/types.ts
var InternalConfigSchema, StaticRoutingSchema, MetadataStaticRedirectEntry, MetadataRedirectEntry, MetadataStaticRedirects, MetadataRedirects, MetadataHeaderEntry, MetadataHeaders, RedirectsSchema, HeadersSchema;
var init_types3 = __esm({
  "../workers-shared/utils/types.ts"() {
    init_import_meta_url();
    init_zod();
    InternalConfigSchema = external_exports.object({
      account_id: external_exports.number().optional(),
      script_id: external_exports.number().optional(),
      debug: external_exports.boolean().optional()
    });
    StaticRoutingSchema = external_exports.object({
      user_worker: external_exports.array(external_exports.string()),
      asset_worker: external_exports.array(external_exports.string()).optional()
    });
    external_exports.object({
      invoke_user_worker_ahead_of_assets: external_exports.boolean().optional(),
      static_routing: StaticRoutingSchema.optional(),
      has_user_worker: external_exports.boolean().optional(),
      ...InternalConfigSchema.shape
    });
    external_exports.union([
      external_exports.object({
        limitedAssetsOnly: external_exports.boolean().optional()
      }),
      external_exports.null()
    ]);
    MetadataStaticRedirectEntry = external_exports.object({
      status: external_exports.number(),
      to: external_exports.string(),
      lineNumber: external_exports.number()
    });
    MetadataRedirectEntry = external_exports.object({
      status: external_exports.number(),
      to: external_exports.string()
    });
    MetadataStaticRedirects = external_exports.record(MetadataStaticRedirectEntry);
    MetadataRedirects = external_exports.record(MetadataRedirectEntry);
    MetadataHeaderEntry = external_exports.object({
      set: external_exports.record(external_exports.string()).optional(),
      unset: external_exports.array(external_exports.string()).optional()
    });
    MetadataHeaders = external_exports.record(MetadataHeaderEntry);
    RedirectsSchema = external_exports.object({
      version: external_exports.literal(1),
      staticRules: MetadataStaticRedirects,
      rules: MetadataRedirects
    }).optional();
    HeadersSchema = external_exports.object({
      version: external_exports.literal(2),
      rules: MetadataHeaders
    }).optional();
    external_exports.object({
      compatibility_date: external_exports.string().optional(),
      compatibility_flags: external_exports.array(external_exports.string()).optional(),
      html_handling: external_exports.enum([
        "auto-trailing-slash",
        "force-trailing-slash",
        "drop-trailing-slash",
        "none"
      ]).optional(),
      not_found_handling: external_exports.enum(["single-page-application", "404-page", "none"]).optional(),
      redirects: RedirectsSchema,
      headers: HeadersSchema,
      has_static_routing: external_exports.boolean().optional(),
      ...InternalConfigSchema.shape
    });
  }
});

// ../../node_modules/.pnpm/ignore@5.3.1/node_modules/ignore/index.js
var require_ignore = __commonJS({
  "../../node_modules/.pnpm/ignore@5.3.1/node_modules/ignore/index.js"(exports, module2) {
    init_import_meta_url();
    function makeArray(subject) {
      return Array.isArray(subject) ? subject : [subject];
    }
    __name(makeArray, "makeArray");
    var EMPTY = "";
    var SPACE2 = " ";
    var ESCAPE = "\\";
    var REGEX_TEST_BLANK_LINE = /^\s+$/;
    var REGEX_INVALID_TRAILING_BACKSLASH = /(?:[^\\]|^)\\$/;
    var REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION = /^\\!/;
    var REGEX_REPLACE_LEADING_EXCAPED_HASH = /^\\#/;
    var REGEX_SPLITALL_CRLF = /\r?\n/g;
    var REGEX_TEST_INVALID_PATH = /^\.*\/|^\.+$/;
    var SLASH2 = "/";
    var TMP_KEY_IGNORE = "node-ignore";
    if (typeof Symbol !== "undefined") {
      TMP_KEY_IGNORE = Symbol.for("node-ignore");
    }
    var KEY_IGNORE = TMP_KEY_IGNORE;
    var define2 = /* @__PURE__ */ __name((object, key, value) => Object.defineProperty(object, key, { value }), "define");
    var REGEX_REGEXP_RANGE = /([0-z])-([0-z])/g;
    var RETURN_FALSE = /* @__PURE__ */ __name(() => false, "RETURN_FALSE");
    var sanitizeRange = /* @__PURE__ */ __name((range) => range.replace(
      REGEX_REGEXP_RANGE,
      (match3, from, to) => from.charCodeAt(0) <= to.charCodeAt(0) ? match3 : EMPTY
    ), "sanitizeRange");
    var cleanRangeBackSlash = /* @__PURE__ */ __name((slashes) => {
      const { length } = slashes;
      return slashes.slice(0, length - length % 2);
    }, "cleanRangeBackSlash");
    var REPLACERS = [
      [
        // remove BOM
        // TODO:
        // Other similar zero-width characters?
        /^\uFEFF/,
        () => EMPTY
      ],
      // > Trailing spaces are ignored unless they are quoted with backslash ("\")
      [
        // (a\ ) -> (a )
        // (a  ) -> (a)
        // (a \ ) -> (a  )
        /\\?\s+$/,
        (match3) => match3.indexOf("\\") === 0 ? SPACE2 : EMPTY
      ],
      // replace (\ ) with ' '
      [
        /\\\s/g,
        () => SPACE2
      ],
      // Escape metacharacters
      // which is written down by users but means special for regular expressions.
      // > There are 12 characters with special meanings:
      // > - the backslash \,
      // > - the caret ^,
      // > - the dollar sign $,
      // > - the period or dot .,
      // > - the vertical bar or pipe symbol |,
      // > - the question mark ?,
      // > - the asterisk or star *,
      // > - the plus sign +,
      // > - the opening parenthesis (,
      // > - the closing parenthesis ),
      // > - and the opening square bracket [,
      // > - the opening curly brace {,
      // > These special characters are often called "metacharacters".
      [
        /[\\$.|*+(){^]/g,
        (match3) => `\\${match3}`
      ],
      [
        // > a question mark (?) matches a single character
        /(?!\\)\?/g,
        () => "[^/]"
      ],
      // leading slash
      [
        // > A leading slash matches the beginning of the pathname.
        // > For example, "/*.c" matches "cat-file.c" but not "mozilla-sha1/sha1.c".
        // A leading slash matches the beginning of the pathname
        /^\//,
        () => "^"
      ],
      // replace special metacharacter slash after the leading slash
      [
        /\//g,
        () => "\\/"
      ],
      [
        // > A leading "**" followed by a slash means match in all directories.
        // > For example, "**/foo" matches file or directory "foo" anywhere,
        // > the same as pattern "foo".
        // > "**/foo/bar" matches file or directory "bar" anywhere that is directly
        // >   under directory "foo".
        // Notice that the '*'s have been replaced as '\\*'
        /^\^*\\\*\\\*\\\//,
        // '**/foo' <-> 'foo'
        () => "^(?:.*\\/)?"
      ],
      // starting
      [
        // there will be no leading '/'
        //   (which has been replaced by section "leading slash")
        // If starts with '**', adding a '^' to the regular expression also works
        /^(?=[^^])/,
        /* @__PURE__ */ __name(function startingReplacer() {
          return !/\/(?!$)/.test(this) ? "(?:^|\\/)" : "^";
        }, "startingReplacer")
      ],
      // two globstars
      [
        // Use lookahead assertions so that we could match more than one `'/**'`
        /\\\/\\\*\\\*(?=\\\/|$)/g,
        // Zero, one or several directories
        // should not use '*', or it will be replaced by the next replacer
        // Check if it is not the last `'/**'`
        (_5, index, str) => index + 6 < str.length ? "(?:\\/[^\\/]+)*" : "\\/.+"
      ],
      // normal intermediate wildcards
      [
        // Never replace escaped '*'
        // ignore rule '\*' will match the path '*'
        // 'abc.*/' -> go
        // 'abc.*'  -> skip this rule,
        //    coz trailing single wildcard will be handed by [trailing wildcard]
        /(^|[^\\]+)(\\\*)+(?=.+)/g,
        // '*.js' matches '.js'
        // '*.js' doesn't match 'abc'
        (_5, p1, p22) => {
          const unescaped = p22.replace(/\\\*/g, "[^\\/]*");
          return p1 + unescaped;
        }
      ],
      [
        // unescape, revert step 3 except for back slash
        // For example, if a user escape a '\\*',
        // after step 3, the result will be '\\\\\\*'
        /\\\\\\(?=[$.|*+(){^])/g,
        () => ESCAPE
      ],
      [
        // '\\\\' -> '\\'
        /\\\\/g,
        () => ESCAPE
      ],
      [
        // > The range notation, e.g. [a-zA-Z],
        // > can be used to match one of the characters in a range.
        // `\` is escaped by step 3
        /(\\)?\[([^\]/]*?)(\\*)($|\])/g,
        (match3, leadEscape, range, endEscape, close2) => leadEscape === ESCAPE ? `\\[${range}${cleanRangeBackSlash(endEscape)}${close2}` : close2 === "]" ? endEscape.length % 2 === 0 ? `[${sanitizeRange(range)}${endEscape}]` : "[]" : "[]"
      ],
      // ending
      [
        // 'js' will not match 'js.'
        // 'ab' will not match 'abc'
        /(?:[^*])$/,
        // WTF!
        // https://git-scm.com/docs/gitignore
        // changes in [2.22.1](https://git-scm.com/docs/gitignore/2.22.1)
        // which re-fixes #24, #38
        // > If there is a separator at the end of the pattern then the pattern
        // > will only match directories, otherwise the pattern can match both
        // > files and directories.
        // 'js*' will not match 'a.js'
        // 'js/' will not match 'a.js'
        // 'js' will match 'a.js' and 'a.js/'
        (match3) => /\/$/.test(match3) ? `${match3}$` : `${match3}(?=$|\\/$)`
      ],
      // trailing wildcard
      [
        /(\^|\\\/)?\\\*$/,
        (_5, p1) => {
          const prefix = p1 ? `${p1}[^/]+` : "[^/]*";
          return `${prefix}(?=$|\\/$)`;
        }
      ]
    ];
    var regexCache = /* @__PURE__ */ Object.create(null);
    var makeRegex = /* @__PURE__ */ __name((pattern, ignoreCase) => {
      let source = regexCache[pattern];
      if (!source) {
        source = REPLACERS.reduce(
          (prev, current) => prev.replace(current[0], current[1].bind(pattern)),
          pattern
        );
        regexCache[pattern] = source;
      }
      return ignoreCase ? new RegExp(source, "i") : new RegExp(source);
    }, "makeRegex");
    var isString5 = /* @__PURE__ */ __name((subject) => typeof subject === "string", "isString");
    var checkPattern = /* @__PURE__ */ __name((pattern) => pattern && isString5(pattern) && !REGEX_TEST_BLANK_LINE.test(pattern) && !REGEX_INVALID_TRAILING_BACKSLASH.test(pattern) && pattern.indexOf("#") !== 0, "checkPattern");
    var splitPattern = /* @__PURE__ */ __name((pattern) => pattern.split(REGEX_SPLITALL_CRLF), "splitPattern");
    var IgnoreRule = class {
      static {
        __name(this, "IgnoreRule");
      }
      constructor(origin, pattern, negative, regex2) {
        this.origin = origin;
        this.pattern = pattern;
        this.negative = negative;
        this.regex = regex2;
      }
    };
    var createRule = /* @__PURE__ */ __name((pattern, ignoreCase) => {
      const origin = pattern;
      let negative = false;
      if (pattern.indexOf("!") === 0) {
        negative = true;
        pattern = pattern.substr(1);
      }
      pattern = pattern.replace(REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION, "!").replace(REGEX_REPLACE_LEADING_EXCAPED_HASH, "#");
      const regex2 = makeRegex(pattern, ignoreCase);
      return new IgnoreRule(
        origin,
        pattern,
        negative,
        regex2
      );
    }, "createRule");
    var throwError = /* @__PURE__ */ __name((message, Ctor) => {
      throw new Ctor(message);
    }, "throwError");
    var checkPath = /* @__PURE__ */ __name((path84, originalPath, doThrow) => {
      if (!isString5(path84)) {
        return doThrow(
          `path must be a string, but got \`${originalPath}\``,
          TypeError
        );
      }
      if (!path84) {
        return doThrow(`path must not be empty`, TypeError);
      }
      if (checkPath.isNotRelative(path84)) {
        const r10 = "`path.relative()`d";
        return doThrow(
          `path should be a ${r10} string, but got "${originalPath}"`,
          RangeError
        );
      }
      return true;
    }, "checkPath");
    var isNotRelative = /* @__PURE__ */ __name((path84) => REGEX_TEST_INVALID_PATH.test(path84), "isNotRelative");
    checkPath.isNotRelative = isNotRelative;
    checkPath.convert = (p7) => p7;
    var Ignore = class {
      static {
        __name(this, "Ignore");
      }
      constructor({
        ignorecase = true,
        ignoreCase = ignorecase,
        allowRelativePaths = false
      } = {}) {
        define2(this, KEY_IGNORE, true);
        this._rules = [];
        this._ignoreCase = ignoreCase;
        this._allowRelativePaths = allowRelativePaths;
        this._initCache();
      }
      _initCache() {
        this._ignoreCache = /* @__PURE__ */ Object.create(null);
        this._testCache = /* @__PURE__ */ Object.create(null);
      }
      _addPattern(pattern) {
        if (pattern && pattern[KEY_IGNORE]) {
          this._rules = this._rules.concat(pattern._rules);
          this._added = true;
          return;
        }
        if (checkPattern(pattern)) {
          const rule = createRule(pattern, this._ignoreCase);
          this._added = true;
          this._rules.push(rule);
        }
      }
      // @param {Array<string> | string | Ignore} pattern
      add(pattern) {
        this._added = false;
        makeArray(
          isString5(pattern) ? splitPattern(pattern) : pattern
        ).forEach(this._addPattern, this);
        if (this._added) {
          this._initCache();
        }
        return this;
      }
      // legacy
      addPattern(pattern) {
        return this.add(pattern);
      }
      //          |           ignored : unignored
      // negative |   0:0   |   0:1   |   1:0   |   1:1
      // -------- | ------- | ------- | ------- | --------
      //     0    |  TEST   |  TEST   |  SKIP   |    X
      //     1    |  TESTIF |  SKIP   |  TEST   |    X
      // - SKIP: always skip
      // - TEST: always test
      // - TESTIF: only test if checkUnignored
      // - X: that never happen
      // @param {boolean} whether should check if the path is unignored,
      //   setting `checkUnignored` to `false` could reduce additional
      //   path matching.
      // @returns {TestResult} true if a file is ignored
      _testOne(path84, checkUnignored) {
        let ignored = false;
        let unignored = false;
        this._rules.forEach((rule) => {
          const { negative } = rule;
          if (unignored === negative && ignored !== unignored || negative && !ignored && !unignored && !checkUnignored) {
            return;
          }
          const matched = rule.regex.test(path84);
          if (matched) {
            ignored = !negative;
            unignored = negative;
          }
        });
        return {
          ignored,
          unignored
        };
      }
      // @returns {TestResult}
      _test(originalPath, cache5, checkUnignored, slices) {
        const path84 = originalPath && checkPath.convert(originalPath);
        checkPath(
          path84,
          originalPath,
          this._allowRelativePaths ? RETURN_FALSE : throwError
        );
        return this._t(path84, cache5, checkUnignored, slices);
      }
      _t(path84, cache5, checkUnignored, slices) {
        if (path84 in cache5) {
          return cache5[path84];
        }
        if (!slices) {
          slices = path84.split(SLASH2);
        }
        slices.pop();
        if (!slices.length) {
          return cache5[path84] = this._testOne(path84, checkUnignored);
        }
        const parent = this._t(
          slices.join(SLASH2) + SLASH2,
          cache5,
          checkUnignored,
          slices
        );
        return cache5[path84] = parent.ignored ? parent : this._testOne(path84, checkUnignored);
      }
      ignores(path84) {
        return this._test(path84, this._ignoreCache, false).ignored;
      }
      createFilter() {
        return (path84) => !this.ignores(path84);
      }
      filter(paths) {
        return makeArray(paths).filter(this.createFilter());
      }
      // @returns {TestResult}
      test(path84) {
        return this._test(path84, this._testCache, true);
      }
    };
    var factory = /* @__PURE__ */ __name((options) => new Ignore(options), "factory");
    var isPathValid = /* @__PURE__ */ __name((path84) => checkPath(path84 && checkPath.convert(path84), path84, RETURN_FALSE), "isPathValid");
    factory.isPathValid = isPathValid;
    factory.default = factory;
    module2.exports = factory;
    if (
      // Detect `process` so that it can run in browsers.
      typeof process !== "undefined" && (process.env && process.env.IGNORE_TEST_WIN32 || process.platform === "win32")
    ) {
      const makePosix = /* @__PURE__ */ __name((str) => /^\\\\\?\\/.test(str) || /["<>|\u0000-\u001F]+/u.test(str) ? str : str.replace(/\\/g, "/"), "makePosix");
      checkPath.convert = makePosix;
      const REGIX_IS_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\//i;
      checkPath.isNotRelative = (path84) => REGIX_IS_WINDOWS_PATH_ABSOLUTE.test(path84) || isNotRelative(path84);
    }
  }
});

// ../../node_modules/.pnpm/mime@4.0.7/node_modules/mime/dist/types/other.js
var types, other_default;
var init_other = __esm({
  "../../node_modules/.pnpm/mime@4.0.7/node_modules/mime/dist/types/other.js"() {
    init_import_meta_url();
    types = {
      "application/prs.cww": ["cww"],
      "application/prs.xsf+xml": ["xsf"],
      "application/vnd.1000minds.decision-model+xml": ["1km"],
      "application/vnd.3gpp.pic-bw-large": ["plb"],
      "application/vnd.3gpp.pic-bw-small": ["psb"],
      "application/vnd.3gpp.pic-bw-var": ["pvb"],
      "application/vnd.3gpp2.tcap": ["tcap"],
      "application/vnd.3m.post-it-notes": ["pwn"],
      "application/vnd.accpac.simply.aso": ["aso"],
      "application/vnd.accpac.simply.imp": ["imp"],
      "application/vnd.acucobol": ["acu"],
      "application/vnd.acucorp": ["atc", "acutc"],
      "application/vnd.adobe.air-application-installer-package+zip": ["air"],
      "application/vnd.adobe.formscentral.fcdt": ["fcdt"],
      "application/vnd.adobe.fxp": ["fxp", "fxpl"],
      "application/vnd.adobe.xdp+xml": ["xdp"],
      "application/vnd.adobe.xfdf": ["*xfdf"],
      "application/vnd.age": ["age"],
      "application/vnd.ahead.space": ["ahead"],
      "application/vnd.airzip.filesecure.azf": ["azf"],
      "application/vnd.airzip.filesecure.azs": ["azs"],
      "application/vnd.amazon.ebook": ["azw"],
      "application/vnd.americandynamics.acc": ["acc"],
      "application/vnd.amiga.ami": ["ami"],
      "application/vnd.android.package-archive": ["apk"],
      "application/vnd.anser-web-certificate-issue-initiation": ["cii"],
      "application/vnd.anser-web-funds-transfer-initiation": ["fti"],
      "application/vnd.antix.game-component": ["atx"],
      "application/vnd.apple.installer+xml": ["mpkg"],
      "application/vnd.apple.keynote": ["key"],
      "application/vnd.apple.mpegurl": ["m3u8"],
      "application/vnd.apple.numbers": ["numbers"],
      "application/vnd.apple.pages": ["pages"],
      "application/vnd.apple.pkpass": ["pkpass"],
      "application/vnd.aristanetworks.swi": ["swi"],
      "application/vnd.astraea-software.iota": ["iota"],
      "application/vnd.audiograph": ["aep"],
      "application/vnd.autodesk.fbx": ["fbx"],
      "application/vnd.balsamiq.bmml+xml": ["bmml"],
      "application/vnd.blueice.multipass": ["mpm"],
      "application/vnd.bmi": ["bmi"],
      "application/vnd.businessobjects": ["rep"],
      "application/vnd.chemdraw+xml": ["cdxml"],
      "application/vnd.chipnuts.karaoke-mmd": ["mmd"],
      "application/vnd.cinderella": ["cdy"],
      "application/vnd.citationstyles.style+xml": ["csl"],
      "application/vnd.claymore": ["cla"],
      "application/vnd.cloanto.rp9": ["rp9"],
      "application/vnd.clonk.c4group": ["c4g", "c4d", "c4f", "c4p", "c4u"],
      "application/vnd.cluetrust.cartomobile-config": ["c11amc"],
      "application/vnd.cluetrust.cartomobile-config-pkg": ["c11amz"],
      "application/vnd.commonspace": ["csp"],
      "application/vnd.contact.cmsg": ["cdbcmsg"],
      "application/vnd.cosmocaller": ["cmc"],
      "application/vnd.crick.clicker": ["clkx"],
      "application/vnd.crick.clicker.keyboard": ["clkk"],
      "application/vnd.crick.clicker.palette": ["clkp"],
      "application/vnd.crick.clicker.template": ["clkt"],
      "application/vnd.crick.clicker.wordbank": ["clkw"],
      "application/vnd.criticaltools.wbs+xml": ["wbs"],
      "application/vnd.ctc-posml": ["pml"],
      "application/vnd.cups-ppd": ["ppd"],
      "application/vnd.curl.car": ["car"],
      "application/vnd.curl.pcurl": ["pcurl"],
      "application/vnd.dart": ["dart"],
      "application/vnd.data-vision.rdz": ["rdz"],
      "application/vnd.dbf": ["dbf"],
      "application/vnd.dcmp+xml": ["dcmp"],
      "application/vnd.dece.data": ["uvf", "uvvf", "uvd", "uvvd"],
      "application/vnd.dece.ttml+xml": ["uvt", "uvvt"],
      "application/vnd.dece.unspecified": ["uvx", "uvvx"],
      "application/vnd.dece.zip": ["uvz", "uvvz"],
      "application/vnd.denovo.fcselayout-link": ["fe_launch"],
      "application/vnd.dna": ["dna"],
      "application/vnd.dolby.mlp": ["mlp"],
      "application/vnd.dpgraph": ["dpg"],
      "application/vnd.dreamfactory": ["dfac"],
      "application/vnd.ds-keypoint": ["kpxx"],
      "application/vnd.dvb.ait": ["ait"],
      "application/vnd.dvb.service": ["svc"],
      "application/vnd.dynageo": ["geo"],
      "application/vnd.ecowin.chart": ["mag"],
      "application/vnd.enliven": ["nml"],
      "application/vnd.epson.esf": ["esf"],
      "application/vnd.epson.msf": ["msf"],
      "application/vnd.epson.quickanime": ["qam"],
      "application/vnd.epson.salt": ["slt"],
      "application/vnd.epson.ssf": ["ssf"],
      "application/vnd.eszigno3+xml": ["es3", "et3"],
      "application/vnd.ezpix-album": ["ez2"],
      "application/vnd.ezpix-package": ["ez3"],
      "application/vnd.fdf": ["*fdf"],
      "application/vnd.fdsn.mseed": ["mseed"],
      "application/vnd.fdsn.seed": ["seed", "dataless"],
      "application/vnd.flographit": ["gph"],
      "application/vnd.fluxtime.clip": ["ftc"],
      "application/vnd.framemaker": ["fm", "frame", "maker", "book"],
      "application/vnd.frogans.fnc": ["fnc"],
      "application/vnd.frogans.ltf": ["ltf"],
      "application/vnd.fsc.weblaunch": ["fsc"],
      "application/vnd.fujitsu.oasys": ["oas"],
      "application/vnd.fujitsu.oasys2": ["oa2"],
      "application/vnd.fujitsu.oasys3": ["oa3"],
      "application/vnd.fujitsu.oasysgp": ["fg5"],
      "application/vnd.fujitsu.oasysprs": ["bh2"],
      "application/vnd.fujixerox.ddd": ["ddd"],
      "application/vnd.fujixerox.docuworks": ["xdw"],
      "application/vnd.fujixerox.docuworks.binder": ["xbd"],
      "application/vnd.fuzzysheet": ["fzs"],
      "application/vnd.genomatix.tuxedo": ["txd"],
      "application/vnd.geogebra.file": ["ggb"],
      "application/vnd.geogebra.slides": ["ggs"],
      "application/vnd.geogebra.tool": ["ggt"],
      "application/vnd.geometry-explorer": ["gex", "gre"],
      "application/vnd.geonext": ["gxt"],
      "application/vnd.geoplan": ["g2w"],
      "application/vnd.geospace": ["g3w"],
      "application/vnd.gmx": ["gmx"],
      "application/vnd.google-apps.document": ["gdoc"],
      "application/vnd.google-apps.drawing": ["gdraw"],
      "application/vnd.google-apps.form": ["gform"],
      "application/vnd.google-apps.jam": ["gjam"],
      "application/vnd.google-apps.map": ["gmap"],
      "application/vnd.google-apps.presentation": ["gslides"],
      "application/vnd.google-apps.script": ["gscript"],
      "application/vnd.google-apps.site": ["gsite"],
      "application/vnd.google-apps.spreadsheet": ["gsheet"],
      "application/vnd.google-earth.kml+xml": ["kml"],
      "application/vnd.google-earth.kmz": ["kmz"],
      "application/vnd.gov.sk.xmldatacontainer+xml": ["xdcf"],
      "application/vnd.grafeq": ["gqf", "gqs"],
      "application/vnd.groove-account": ["gac"],
      "application/vnd.groove-help": ["ghf"],
      "application/vnd.groove-identity-message": ["gim"],
      "application/vnd.groove-injector": ["grv"],
      "application/vnd.groove-tool-message": ["gtm"],
      "application/vnd.groove-tool-template": ["tpl"],
      "application/vnd.groove-vcard": ["vcg"],
      "application/vnd.hal+xml": ["hal"],
      "application/vnd.handheld-entertainment+xml": ["zmm"],
      "application/vnd.hbci": ["hbci"],
      "application/vnd.hhe.lesson-player": ["les"],
      "application/vnd.hp-hpgl": ["hpgl"],
      "application/vnd.hp-hpid": ["hpid"],
      "application/vnd.hp-hps": ["hps"],
      "application/vnd.hp-jlyt": ["jlt"],
      "application/vnd.hp-pcl": ["pcl"],
      "application/vnd.hp-pclxl": ["pclxl"],
      "application/vnd.hydrostatix.sof-data": ["sfd-hdstx"],
      "application/vnd.ibm.minipay": ["mpy"],
      "application/vnd.ibm.modcap": ["afp", "listafp", "list3820"],
      "application/vnd.ibm.rights-management": ["irm"],
      "application/vnd.ibm.secure-container": ["sc"],
      "application/vnd.iccprofile": ["icc", "icm"],
      "application/vnd.igloader": ["igl"],
      "application/vnd.immervision-ivp": ["ivp"],
      "application/vnd.immervision-ivu": ["ivu"],
      "application/vnd.insors.igm": ["igm"],
      "application/vnd.intercon.formnet": ["xpw", "xpx"],
      "application/vnd.intergeo": ["i2g"],
      "application/vnd.intu.qbo": ["qbo"],
      "application/vnd.intu.qfx": ["qfx"],
      "application/vnd.ipunplugged.rcprofile": ["rcprofile"],
      "application/vnd.irepository.package+xml": ["irp"],
      "application/vnd.is-xpr": ["xpr"],
      "application/vnd.isac.fcs": ["fcs"],
      "application/vnd.jam": ["jam"],
      "application/vnd.jcp.javame.midlet-rms": ["rms"],
      "application/vnd.jisp": ["jisp"],
      "application/vnd.joost.joda-archive": ["joda"],
      "application/vnd.kahootz": ["ktz", "ktr"],
      "application/vnd.kde.karbon": ["karbon"],
      "application/vnd.kde.kchart": ["chrt"],
      "application/vnd.kde.kformula": ["kfo"],
      "application/vnd.kde.kivio": ["flw"],
      "application/vnd.kde.kontour": ["kon"],
      "application/vnd.kde.kpresenter": ["kpr", "kpt"],
      "application/vnd.kde.kspread": ["ksp"],
      "application/vnd.kde.kword": ["kwd", "kwt"],
      "application/vnd.kenameaapp": ["htke"],
      "application/vnd.kidspiration": ["kia"],
      "application/vnd.kinar": ["kne", "knp"],
      "application/vnd.koan": ["skp", "skd", "skt", "skm"],
      "application/vnd.kodak-descriptor": ["sse"],
      "application/vnd.las.las+xml": ["lasxml"],
      "application/vnd.llamagraphics.life-balance.desktop": ["lbd"],
      "application/vnd.llamagraphics.life-balance.exchange+xml": ["lbe"],
      "application/vnd.lotus-1-2-3": ["123"],
      "application/vnd.lotus-approach": ["apr"],
      "application/vnd.lotus-freelance": ["pre"],
      "application/vnd.lotus-notes": ["nsf"],
      "application/vnd.lotus-organizer": ["org"],
      "application/vnd.lotus-screencam": ["scm"],
      "application/vnd.lotus-wordpro": ["lwp"],
      "application/vnd.macports.portpkg": ["portpkg"],
      "application/vnd.mapbox-vector-tile": ["mvt"],
      "application/vnd.mcd": ["mcd"],
      "application/vnd.medcalcdata": ["mc1"],
      "application/vnd.mediastation.cdkey": ["cdkey"],
      "application/vnd.mfer": ["mwf"],
      "application/vnd.mfmp": ["mfm"],
      "application/vnd.micrografx.flo": ["flo"],
      "application/vnd.micrografx.igx": ["igx"],
      "application/vnd.mif": ["mif"],
      "application/vnd.mobius.daf": ["daf"],
      "application/vnd.mobius.dis": ["dis"],
      "application/vnd.mobius.mbk": ["mbk"],
      "application/vnd.mobius.mqy": ["mqy"],
      "application/vnd.mobius.msl": ["msl"],
      "application/vnd.mobius.plc": ["plc"],
      "application/vnd.mobius.txf": ["txf"],
      "application/vnd.mophun.application": ["mpn"],
      "application/vnd.mophun.certificate": ["mpc"],
      "application/vnd.mozilla.xul+xml": ["xul"],
      "application/vnd.ms-artgalry": ["cil"],
      "application/vnd.ms-cab-compressed": ["cab"],
      "application/vnd.ms-excel": ["xls", "xlm", "xla", "xlc", "xlt", "xlw"],
      "application/vnd.ms-excel.addin.macroenabled.12": ["xlam"],
      "application/vnd.ms-excel.sheet.binary.macroenabled.12": ["xlsb"],
      "application/vnd.ms-excel.sheet.macroenabled.12": ["xlsm"],
      "application/vnd.ms-excel.template.macroenabled.12": ["xltm"],
      "application/vnd.ms-fontobject": ["eot"],
      "application/vnd.ms-htmlhelp": ["chm"],
      "application/vnd.ms-ims": ["ims"],
      "application/vnd.ms-lrm": ["lrm"],
      "application/vnd.ms-officetheme": ["thmx"],
      "application/vnd.ms-outlook": ["msg"],
      "application/vnd.ms-pki.seccat": ["cat"],
      "application/vnd.ms-pki.stl": ["*stl"],
      "application/vnd.ms-powerpoint": ["ppt", "pps", "pot"],
      "application/vnd.ms-powerpoint.addin.macroenabled.12": ["ppam"],
      "application/vnd.ms-powerpoint.presentation.macroenabled.12": ["pptm"],
      "application/vnd.ms-powerpoint.slide.macroenabled.12": ["sldm"],
      "application/vnd.ms-powerpoint.slideshow.macroenabled.12": ["ppsm"],
      "application/vnd.ms-powerpoint.template.macroenabled.12": ["potm"],
      "application/vnd.ms-project": ["*mpp", "mpt"],
      "application/vnd.ms-visio.viewer": ["vdx"],
      "application/vnd.ms-word.document.macroenabled.12": ["docm"],
      "application/vnd.ms-word.template.macroenabled.12": ["dotm"],
      "application/vnd.ms-works": ["wps", "wks", "wcm", "wdb"],
      "application/vnd.ms-wpl": ["wpl"],
      "application/vnd.ms-xpsdocument": ["xps"],
      "application/vnd.mseq": ["mseq"],
      "application/vnd.musician": ["mus"],
      "application/vnd.muvee.style": ["msty"],
      "application/vnd.mynfc": ["taglet"],
      "application/vnd.nato.bindingdataobject+xml": ["bdo"],
      "application/vnd.neurolanguage.nlu": ["nlu"],
      "application/vnd.nitf": ["ntf", "nitf"],
      "application/vnd.noblenet-directory": ["nnd"],
      "application/vnd.noblenet-sealer": ["nns"],
      "application/vnd.noblenet-web": ["nnw"],
      "application/vnd.nokia.n-gage.ac+xml": ["*ac"],
      "application/vnd.nokia.n-gage.data": ["ngdat"],
      "application/vnd.nokia.n-gage.symbian.install": ["n-gage"],
      "application/vnd.nokia.radio-preset": ["rpst"],
      "application/vnd.nokia.radio-presets": ["rpss"],
      "application/vnd.novadigm.edm": ["edm"],
      "application/vnd.novadigm.edx": ["edx"],
      "application/vnd.novadigm.ext": ["ext"],
      "application/vnd.oasis.opendocument.chart": ["odc"],
      "application/vnd.oasis.opendocument.chart-template": ["otc"],
      "application/vnd.oasis.opendocument.database": ["odb"],
      "application/vnd.oasis.opendocument.formula": ["odf"],
      "application/vnd.oasis.opendocument.formula-template": ["odft"],
      "application/vnd.oasis.opendocument.graphics": ["odg"],
      "application/vnd.oasis.opendocument.graphics-template": ["otg"],
      "application/vnd.oasis.opendocument.image": ["odi"],
      "application/vnd.oasis.opendocument.image-template": ["oti"],
      "application/vnd.oasis.opendocument.presentation": ["odp"],
      "application/vnd.oasis.opendocument.presentation-template": ["otp"],
      "application/vnd.oasis.opendocument.spreadsheet": ["ods"],
      "application/vnd.oasis.opendocument.spreadsheet-template": ["ots"],
      "application/vnd.oasis.opendocument.text": ["odt"],
      "application/vnd.oasis.opendocument.text-master": ["odm"],
      "application/vnd.oasis.opendocument.text-template": ["ott"],
      "application/vnd.oasis.opendocument.text-web": ["oth"],
      "application/vnd.olpc-sugar": ["xo"],
      "application/vnd.oma.dd2+xml": ["dd2"],
      "application/vnd.openblox.game+xml": ["obgx"],
      "application/vnd.openofficeorg.extension": ["oxt"],
      "application/vnd.openstreetmap.data+xml": ["osm"],
      "application/vnd.openxmlformats-officedocument.presentationml.presentation": [
        "pptx"
      ],
      "application/vnd.openxmlformats-officedocument.presentationml.slide": [
        "sldx"
      ],
      "application/vnd.openxmlformats-officedocument.presentationml.slideshow": [
        "ppsx"
      ],
      "application/vnd.openxmlformats-officedocument.presentationml.template": [
        "potx"
      ],
      "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": ["xlsx"],
      "application/vnd.openxmlformats-officedocument.spreadsheetml.template": [
        "xltx"
      ],
      "application/vnd.openxmlformats-officedocument.wordprocessingml.document": [
        "docx"
      ],
      "application/vnd.openxmlformats-officedocument.wordprocessingml.template": [
        "dotx"
      ],
      "application/vnd.osgeo.mapguide.package": ["mgp"],
      "application/vnd.osgi.dp": ["dp"],
      "application/vnd.osgi.subsystem": ["esa"],
      "application/vnd.palm": ["pdb", "pqa", "oprc"],
      "application/vnd.pawaafile": ["paw"],
      "application/vnd.pg.format": ["str"],
      "application/vnd.pg.osasli": ["ei6"],
      "application/vnd.picsel": ["efif"],
      "application/vnd.pmi.widget": ["wg"],
      "application/vnd.pocketlearn": ["plf"],
      "application/vnd.powerbuilder6": ["pbd"],
      "application/vnd.previewsystems.box": ["box"],
      "application/vnd.procrate.brushset": ["brushset"],
      "application/vnd.procreate.brush": ["brush"],
      "application/vnd.procreate.dream": ["drm"],
      "application/vnd.proteus.magazine": ["mgz"],
      "application/vnd.publishare-delta-tree": ["qps"],
      "application/vnd.pvi.ptid1": ["ptid"],
      "application/vnd.pwg-xhtml-print+xml": ["xhtm"],
      "application/vnd.quark.quarkxpress": [
        "qxd",
        "qxt",
        "qwd",
        "qwt",
        "qxl",
        "qxb"
      ],
      "application/vnd.rar": ["rar"],
      "application/vnd.realvnc.bed": ["bed"],
      "application/vnd.recordare.musicxml": ["mxl"],
      "application/vnd.recordare.musicxml+xml": ["musicxml"],
      "application/vnd.rig.cryptonote": ["cryptonote"],
      "application/vnd.rim.cod": ["cod"],
      "application/vnd.rn-realmedia": ["rm"],
      "application/vnd.rn-realmedia-vbr": ["rmvb"],
      "application/vnd.route66.link66+xml": ["link66"],
      "application/vnd.sailingtracker.track": ["st"],
      "application/vnd.seemail": ["see"],
      "application/vnd.sema": ["sema"],
      "application/vnd.semd": ["semd"],
      "application/vnd.semf": ["semf"],
      "application/vnd.shana.informed.formdata": ["ifm"],
      "application/vnd.shana.informed.formtemplate": ["itp"],
      "application/vnd.shana.informed.interchange": ["iif"],
      "application/vnd.shana.informed.package": ["ipk"],
      "application/vnd.simtech-mindmapper": ["twd", "twds"],
      "application/vnd.smaf": ["mmf"],
      "application/vnd.smart.teacher": ["teacher"],
      "application/vnd.software602.filler.form+xml": ["fo"],
      "application/vnd.solent.sdkm+xml": ["sdkm", "sdkd"],
      "application/vnd.spotfire.dxp": ["dxp"],
      "application/vnd.spotfire.sfs": ["sfs"],
      "application/vnd.stardivision.calc": ["sdc"],
      "application/vnd.stardivision.draw": ["sda"],
      "application/vnd.stardivision.impress": ["sdd"],
      "application/vnd.stardivision.math": ["smf"],
      "application/vnd.stardivision.writer": ["sdw", "vor"],
      "application/vnd.stardivision.writer-global": ["sgl"],
      "application/vnd.stepmania.package": ["smzip"],
      "application/vnd.stepmania.stepchart": ["sm"],
      "application/vnd.sun.wadl+xml": ["wadl"],
      "application/vnd.sun.xml.calc": ["sxc"],
      "application/vnd.sun.xml.calc.template": ["stc"],
      "application/vnd.sun.xml.draw": ["sxd"],
      "application/vnd.sun.xml.draw.template": ["std"],
      "application/vnd.sun.xml.impress": ["sxi"],
      "application/vnd.sun.xml.impress.template": ["sti"],
      "application/vnd.sun.xml.math": ["sxm"],
      "application/vnd.sun.xml.writer": ["sxw"],
      "application/vnd.sun.xml.writer.global": ["sxg"],
      "application/vnd.sun.xml.writer.template": ["stw"],
      "application/vnd.sus-calendar": ["sus", "susp"],
      "application/vnd.svd": ["svd"],
      "application/vnd.symbian.install": ["sis", "sisx"],
      "application/vnd.syncml+xml": ["xsm"],
      "application/vnd.syncml.dm+wbxml": ["bdm"],
      "application/vnd.syncml.dm+xml": ["xdm"],
      "application/vnd.syncml.dmddf+xml": ["ddf"],
      "application/vnd.tao.intent-module-archive": ["tao"],
      "application/vnd.tcpdump.pcap": ["pcap", "cap", "dmp"],
      "application/vnd.tmobile-livetv": ["tmo"],
      "application/vnd.trid.tpt": ["tpt"],
      "application/vnd.triscape.mxs": ["mxs"],
      "application/vnd.trueapp": ["tra"],
      "application/vnd.ufdl": ["ufd", "ufdl"],
      "application/vnd.uiq.theme": ["utz"],
      "application/vnd.umajin": ["umj"],
      "application/vnd.unity": ["unityweb"],
      "application/vnd.uoml+xml": ["uoml", "uo"],
      "application/vnd.vcx": ["vcx"],
      "application/vnd.visio": ["vsd", "vst", "vss", "vsw", "vsdx", "vtx"],
      "application/vnd.visionary": ["vis"],
      "application/vnd.vsf": ["vsf"],
      "application/vnd.wap.wbxml": ["wbxml"],
      "application/vnd.wap.wmlc": ["wmlc"],
      "application/vnd.wap.wmlscriptc": ["wmlsc"],
      "application/vnd.webturbo": ["wtb"],
      "application/vnd.wolfram.player": ["nbp"],
      "application/vnd.wordperfect": ["wpd"],
      "application/vnd.wqd": ["wqd"],
      "application/vnd.wt.stf": ["stf"],
      "application/vnd.xara": ["xar"],
      "application/vnd.xfdl": ["xfdl"],
      "application/vnd.yamaha.hv-dic": ["hvd"],
      "application/vnd.yamaha.hv-script": ["hvs"],
      "application/vnd.yamaha.hv-voice": ["hvp"],
      "application/vnd.yamaha.openscoreformat": ["osf"],
      "application/vnd.yamaha.openscoreformat.osfpvg+xml": ["osfpvg"],
      "application/vnd.yamaha.smaf-audio": ["saf"],
      "application/vnd.yamaha.smaf-phrase": ["spf"],
      "application/vnd.yellowriver-custom-menu": ["cmp"],
      "application/vnd.zul": ["zir", "zirz"],
      "application/vnd.zzazz.deck+xml": ["zaz"],
      "application/x-7z-compressed": ["7z"],
      "application/x-abiword": ["abw"],
      "application/x-ace-compressed": ["ace"],
      "application/x-apple-diskimage": ["*dmg"],
      "application/x-arj": ["arj"],
      "application/x-authorware-bin": ["aab", "x32", "u32", "vox"],
      "application/x-authorware-map": ["aam"],
      "application/x-authorware-seg": ["aas"],
      "application/x-bcpio": ["bcpio"],
      "application/x-bdoc": ["*bdoc"],
      "application/x-bittorrent": ["torrent"],
      "application/x-blender": ["blend"],
      "application/x-blorb": ["blb", "blorb"],
      "application/x-bzip": ["bz"],
      "application/x-bzip2": ["bz2", "boz"],
      "application/x-cbr": ["cbr", "cba", "cbt", "cbz", "cb7"],
      "application/x-cdlink": ["vcd"],
      "application/x-cfs-compressed": ["cfs"],
      "application/x-chat": ["chat"],
      "application/x-chess-pgn": ["pgn"],
      "application/x-chrome-extension": ["crx"],
      "application/x-cocoa": ["cco"],
      "application/x-compressed": ["*rar"],
      "application/x-conference": ["nsc"],
      "application/x-cpio": ["cpio"],
      "application/x-csh": ["csh"],
      "application/x-debian-package": ["*deb", "udeb"],
      "application/x-dgc-compressed": ["dgc"],
      "application/x-director": [
        "dir",
        "dcr",
        "dxr",
        "cst",
        "cct",
        "cxt",
        "w3d",
        "fgd",
        "swa"
      ],
      "application/x-doom": ["wad"],
      "application/x-dtbncx+xml": ["ncx"],
      "application/x-dtbook+xml": ["dtb"],
      "application/x-dtbresource+xml": ["res"],
      "application/x-dvi": ["dvi"],
      "application/x-envoy": ["evy"],
      "application/x-eva": ["eva"],
      "application/x-font-bdf": ["bdf"],
      "application/x-font-ghostscript": ["gsf"],
      "application/x-font-linux-psf": ["psf"],
      "application/x-font-pcf": ["pcf"],
      "application/x-font-snf": ["snf"],
      "application/x-font-type1": ["pfa", "pfb", "pfm", "afm"],
      "application/x-freearc": ["arc"],
      "application/x-futuresplash": ["spl"],
      "application/x-gca-compressed": ["gca"],
      "application/x-glulx": ["ulx"],
      "application/x-gnumeric": ["gnumeric"],
      "application/x-gramps-xml": ["gramps"],
      "application/x-gtar": ["gtar"],
      "application/x-hdf": ["hdf"],
      "application/x-httpd-php": ["php"],
      "application/x-install-instructions": ["install"],
      "application/x-ipynb+json": ["ipynb"],
      "application/x-iso9660-image": ["*iso"],
      "application/x-iwork-keynote-sffkey": ["*key"],
      "application/x-iwork-numbers-sffnumbers": ["*numbers"],
      "application/x-iwork-pages-sffpages": ["*pages"],
      "application/x-java-archive-diff": ["jardiff"],
      "application/x-java-jnlp-file": ["jnlp"],
      "application/x-keepass2": ["kdbx"],
      "application/x-latex": ["latex"],
      "application/x-lua-bytecode": ["luac"],
      "application/x-lzh-compressed": ["lzh", "lha"],
      "application/x-makeself": ["run"],
      "application/x-mie": ["mie"],
      "application/x-mobipocket-ebook": ["*prc", "mobi"],
      "application/x-ms-application": ["application"],
      "application/x-ms-shortcut": ["lnk"],
      "application/x-ms-wmd": ["wmd"],
      "application/x-ms-wmz": ["wmz"],
      "application/x-ms-xbap": ["xbap"],
      "application/x-msaccess": ["mdb"],
      "application/x-msbinder": ["obd"],
      "application/x-mscardfile": ["crd"],
      "application/x-msclip": ["clp"],
      "application/x-msdos-program": ["*exe"],
      "application/x-msdownload": ["*exe", "*dll", "com", "bat", "*msi"],
      "application/x-msmediaview": ["mvb", "m13", "m14"],
      "application/x-msmetafile": ["*wmf", "*wmz", "*emf", "emz"],
      "application/x-msmoney": ["mny"],
      "application/x-mspublisher": ["pub"],
      "application/x-msschedule": ["scd"],
      "application/x-msterminal": ["trm"],
      "application/x-mswrite": ["wri"],
      "application/x-netcdf": ["nc", "cdf"],
      "application/x-ns-proxy-autoconfig": ["pac"],
      "application/x-nzb": ["nzb"],
      "application/x-perl": ["pl", "pm"],
      "application/x-pilot": ["*prc", "*pdb"],
      "application/x-pkcs12": ["p12", "pfx"],
      "application/x-pkcs7-certificates": ["p7b", "spc"],
      "application/x-pkcs7-certreqresp": ["p7r"],
      "application/x-rar-compressed": ["*rar"],
      "application/x-redhat-package-manager": ["rpm"],
      "application/x-research-info-systems": ["ris"],
      "application/x-sea": ["sea"],
      "application/x-sh": ["sh"],
      "application/x-shar": ["shar"],
      "application/x-shockwave-flash": ["swf"],
      "application/x-silverlight-app": ["xap"],
      "application/x-sql": ["*sql"],
      "application/x-stuffit": ["sit"],
      "application/x-stuffitx": ["sitx"],
      "application/x-subrip": ["srt"],
      "application/x-sv4cpio": ["sv4cpio"],
      "application/x-sv4crc": ["sv4crc"],
      "application/x-t3vm-image": ["t3"],
      "application/x-tads": ["gam"],
      "application/x-tar": ["tar"],
      "application/x-tcl": ["tcl", "tk"],
      "application/x-tex": ["tex"],
      "application/x-tex-tfm": ["tfm"],
      "application/x-texinfo": ["texinfo", "texi"],
      "application/x-tgif": ["*obj"],
      "application/x-ustar": ["ustar"],
      "application/x-virtualbox-hdd": ["hdd"],
      "application/x-virtualbox-ova": ["ova"],
      "application/x-virtualbox-ovf": ["ovf"],
      "application/x-virtualbox-vbox": ["vbox"],
      "application/x-virtualbox-vbox-extpack": ["vbox-extpack"],
      "application/x-virtualbox-vdi": ["vdi"],
      "application/x-virtualbox-vhd": ["vhd"],
      "application/x-virtualbox-vmdk": ["vmdk"],
      "application/x-wais-source": ["src"],
      "application/x-web-app-manifest+json": ["webapp"],
      "application/x-x509-ca-cert": ["der", "crt", "pem"],
      "application/x-xfig": ["fig"],
      "application/x-xliff+xml": ["*xlf"],
      "application/x-xpinstall": ["xpi"],
      "application/x-xz": ["xz"],
      "application/x-zip-compressed": ["*zip"],
      "application/x-zmachine": ["z1", "z2", "z3", "z4", "z5", "z6", "z7", "z8"],
      "audio/vnd.dece.audio": ["uva", "uvva"],
      "audio/vnd.digital-winds": ["eol"],
      "audio/vnd.dra": ["dra"],
      "audio/vnd.dts": ["dts"],
      "audio/vnd.dts.hd": ["dtshd"],
      "audio/vnd.lucent.voice": ["lvp"],
      "audio/vnd.ms-playready.media.pya": ["pya"],
      "audio/vnd.nuera.ecelp4800": ["ecelp4800"],
      "audio/vnd.nuera.ecelp7470": ["ecelp7470"],
      "audio/vnd.nuera.ecelp9600": ["ecelp9600"],
      "audio/vnd.rip": ["rip"],
      "audio/x-aac": ["*aac"],
      "audio/x-aiff": ["aif", "aiff", "aifc"],
      "audio/x-caf": ["caf"],
      "audio/x-flac": ["flac"],
      "audio/x-m4a": ["*m4a"],
      "audio/x-matroska": ["mka"],
      "audio/x-mpegurl": ["m3u"],
      "audio/x-ms-wax": ["wax"],
      "audio/x-ms-wma": ["wma"],
      "audio/x-pn-realaudio": ["ram", "ra"],
      "audio/x-pn-realaudio-plugin": ["rmp"],
      "audio/x-realaudio": ["*ra"],
      "audio/x-wav": ["*wav"],
      "chemical/x-cdx": ["cdx"],
      "chemical/x-cif": ["cif"],
      "chemical/x-cmdf": ["cmdf"],
      "chemical/x-cml": ["cml"],
      "chemical/x-csml": ["csml"],
      "chemical/x-xyz": ["xyz"],
      "image/prs.btif": ["btif", "btf"],
      "image/prs.pti": ["pti"],
      "image/vnd.adobe.photoshop": ["psd"],
      "image/vnd.airzip.accelerator.azv": ["azv"],
      "image/vnd.dece.graphic": ["uvi", "uvvi", "uvg", "uvvg"],
      "image/vnd.djvu": ["djvu", "djv"],
      "image/vnd.dvb.subtitle": ["*sub"],
      "image/vnd.dwg": ["dwg"],
      "image/vnd.dxf": ["dxf"],
      "image/vnd.fastbidsheet": ["fbs"],
      "image/vnd.fpx": ["fpx"],
      "image/vnd.fst": ["fst"],
      "image/vnd.fujixerox.edmics-mmr": ["mmr"],
      "image/vnd.fujixerox.edmics-rlc": ["rlc"],
      "image/vnd.microsoft.icon": ["ico"],
      "image/vnd.ms-dds": ["dds"],
      "image/vnd.ms-modi": ["mdi"],
      "image/vnd.ms-photo": ["wdp"],
      "image/vnd.net-fpx": ["npx"],
      "image/vnd.pco.b16": ["b16"],
      "image/vnd.tencent.tap": ["tap"],
      "image/vnd.valve.source.texture": ["vtf"],
      "image/vnd.wap.wbmp": ["wbmp"],
      "image/vnd.xiff": ["xif"],
      "image/vnd.zbrush.pcx": ["pcx"],
      "image/x-3ds": ["3ds"],
      "image/x-adobe-dng": ["dng"],
      "image/x-cmu-raster": ["ras"],
      "image/x-cmx": ["cmx"],
      "image/x-freehand": ["fh", "fhc", "fh4", "fh5", "fh7"],
      "image/x-icon": ["*ico"],
      "image/x-jng": ["jng"],
      "image/x-mrsid-image": ["sid"],
      "image/x-ms-bmp": ["*bmp"],
      "image/x-pcx": ["*pcx"],
      "image/x-pict": ["pic", "pct"],
      "image/x-portable-anymap": ["pnm"],
      "image/x-portable-bitmap": ["pbm"],
      "image/x-portable-graymap": ["pgm"],
      "image/x-portable-pixmap": ["ppm"],
      "image/x-rgb": ["rgb"],
      "image/x-tga": ["tga"],
      "image/x-xbitmap": ["xbm"],
      "image/x-xpixmap": ["xpm"],
      "image/x-xwindowdump": ["xwd"],
      "message/vnd.wfa.wsc": ["wsc"],
      "model/vnd.bary": ["bary"],
      "model/vnd.cld": ["cld"],
      "model/vnd.collada+xml": ["dae"],
      "model/vnd.dwf": ["dwf"],
      "model/vnd.gdl": ["gdl"],
      "model/vnd.gtw": ["gtw"],
      "model/vnd.mts": ["*mts"],
      "model/vnd.opengex": ["ogex"],
      "model/vnd.parasolid.transmit.binary": ["x_b"],
      "model/vnd.parasolid.transmit.text": ["x_t"],
      "model/vnd.pytha.pyox": ["pyo", "pyox"],
      "model/vnd.sap.vds": ["vds"],
      "model/vnd.usda": ["usda"],
      "model/vnd.usdz+zip": ["usdz"],
      "model/vnd.valve.source.compiled-map": ["bsp"],
      "model/vnd.vtu": ["vtu"],
      "text/prs.lines.tag": ["dsc"],
      "text/vnd.curl": ["curl"],
      "text/vnd.curl.dcurl": ["dcurl"],
      "text/vnd.curl.mcurl": ["mcurl"],
      "text/vnd.curl.scurl": ["scurl"],
      "text/vnd.dvb.subtitle": ["sub"],
      "text/vnd.familysearch.gedcom": ["ged"],
      "text/vnd.fly": ["fly"],
      "text/vnd.fmi.flexstor": ["flx"],
      "text/vnd.graphviz": ["gv"],
      "text/vnd.in3d.3dml": ["3dml"],
      "text/vnd.in3d.spot": ["spot"],
      "text/vnd.sun.j2me.app-descriptor": ["jad"],
      "text/vnd.wap.wml": ["wml"],
      "text/vnd.wap.wmlscript": ["wmls"],
      "text/x-asm": ["s", "asm"],
      "text/x-c": ["c", "cc", "cxx", "cpp", "h", "hh", "dic"],
      "text/x-component": ["htc"],
      "text/x-fortran": ["f", "for", "f77", "f90"],
      "text/x-handlebars-template": ["hbs"],
      "text/x-java-source": ["java"],
      "text/x-lua": ["lua"],
      "text/x-markdown": ["mkd"],
      "text/x-nfo": ["nfo"],
      "text/x-opml": ["opml"],
      "text/x-org": ["*org"],
      "text/x-pascal": ["p", "pas"],
      "text/x-processing": ["pde"],
      "text/x-sass": ["sass"],
      "text/x-scss": ["scss"],
      "text/x-setext": ["etx"],
      "text/x-sfv": ["sfv"],
      "text/x-suse-ymp": ["ymp"],
      "text/x-uuencode": ["uu"],
      "text/x-vcalendar": ["vcs"],
      "text/x-vcard": ["vcf"],
      "video/vnd.dece.hd": ["uvh", "uvvh"],
      "video/vnd.dece.mobile": ["uvm", "uvvm"],
      "video/vnd.dece.pd": ["uvp", "uvvp"],
      "video/vnd.dece.sd": ["uvs", "uvvs"],
      "video/vnd.dece.video": ["uvv", "uvvv"],
      "video/vnd.dvb.file": ["dvb"],
      "video/vnd.fvt": ["fvt"],
      "video/vnd.mpegurl": ["mxu", "m4u"],
      "video/vnd.ms-playready.media.pyv": ["pyv"],
      "video/vnd.uvvu.mp4": ["uvu", "uvvu"],
      "video/vnd.vivo": ["viv"],
      "video/x-f4v": ["f4v"],
      "video/x-fli": ["fli"],
      "video/x-flv": ["flv"],
      "video/x-m4v": ["m4v"],
      "video/x-matroska": ["mkv", "mk3d", "mks"],
      "video/x-mng": ["mng"],
      "video/x-ms-asf": ["asf", "asx"],
      "video/x-ms-vob": ["vob"],
      "video/x-ms-wm": ["wm"],
      "video/x-ms-wmv": ["wmv"],
      "video/x-ms-wmx": ["wmx"],
      "video/x-ms-wvx": ["wvx"],
      "video/x-msvideo": ["avi"],
      "video/x-sgi-movie": ["movie"],
      "video/x-smv": ["smv"],
      "x-conference/x-cooltalk": ["ice"]
    };
    Object.freeze(types);
    other_default = types;
  }
});

// ../../node_modules/.pnpm/mime@4.0.7/node_modules/mime/dist/types/standard.js
var types2, standard_default;
var init_standard = __esm({
  "../../node_modules/.pnpm/mime@4.0.7/node_modules/mime/dist/types/standard.js"() {
    init_import_meta_url();
    types2 = {
      "application/andrew-inset": ["ez"],
      "application/appinstaller": ["appinstaller"],
      "application/applixware": ["aw"],
      "application/appx": ["appx"],
      "application/appxbundle": ["appxbundle"],
      "application/atom+xml": ["atom"],
      "application/atomcat+xml": ["atomcat"],
      "application/atomdeleted+xml": ["atomdeleted"],
      "application/atomsvc+xml": ["atomsvc"],
      "application/atsc-dwd+xml": ["dwd"],
      "application/atsc-held+xml": ["held"],
      "application/atsc-rsat+xml": ["rsat"],
      "application/automationml-aml+xml": ["aml"],
      "application/automationml-amlx+zip": ["amlx"],
      "application/bdoc": ["bdoc"],
      "application/calendar+xml": ["xcs"],
      "application/ccxml+xml": ["ccxml"],
      "application/cdfx+xml": ["cdfx"],
      "application/cdmi-capability": ["cdmia"],
      "application/cdmi-container": ["cdmic"],
      "application/cdmi-domain": ["cdmid"],
      "application/cdmi-object": ["cdmio"],
      "application/cdmi-queue": ["cdmiq"],
      "application/cpl+xml": ["cpl"],
      "application/cu-seeme": ["cu"],
      "application/cwl": ["cwl"],
      "application/dash+xml": ["mpd"],
      "application/dash-patch+xml": ["mpp"],
      "application/davmount+xml": ["davmount"],
      "application/dicom": ["dcm"],
      "application/docbook+xml": ["dbk"],
      "application/dssc+der": ["dssc"],
      "application/dssc+xml": ["xdssc"],
      "application/ecmascript": ["ecma"],
      "application/emma+xml": ["emma"],
      "application/emotionml+xml": ["emotionml"],
      "application/epub+zip": ["epub"],
      "application/exi": ["exi"],
      "application/express": ["exp"],
      "application/fdf": ["fdf"],
      "application/fdt+xml": ["fdt"],
      "application/font-tdpfr": ["pfr"],
      "application/geo+json": ["geojson"],
      "application/gml+xml": ["gml"],
      "application/gpx+xml": ["gpx"],
      "application/gxf": ["gxf"],
      "application/gzip": ["gz"],
      "application/hjson": ["hjson"],
      "application/hyperstudio": ["stk"],
      "application/inkml+xml": ["ink", "inkml"],
      "application/ipfix": ["ipfix"],
      "application/its+xml": ["its"],
      "application/java-archive": ["jar", "war", "ear"],
      "application/java-serialized-object": ["ser"],
      "application/java-vm": ["class"],
      "application/javascript": ["*js"],
      "application/json": ["json", "map"],
      "application/json5": ["json5"],
      "application/jsonml+json": ["jsonml"],
      "application/ld+json": ["jsonld"],
      "application/lgr+xml": ["lgr"],
      "application/lost+xml": ["lostxml"],
      "application/mac-binhex40": ["hqx"],
      "application/mac-compactpro": ["cpt"],
      "application/mads+xml": ["mads"],
      "application/manifest+json": ["webmanifest"],
      "application/marc": ["mrc"],
      "application/marcxml+xml": ["mrcx"],
      "application/mathematica": ["ma", "nb", "mb"],
      "application/mathml+xml": ["mathml"],
      "application/mbox": ["mbox"],
      "application/media-policy-dataset+xml": ["mpf"],
      "application/mediaservercontrol+xml": ["mscml"],
      "application/metalink+xml": ["metalink"],
      "application/metalink4+xml": ["meta4"],
      "application/mets+xml": ["mets"],
      "application/mmt-aei+xml": ["maei"],
      "application/mmt-usd+xml": ["musd"],
      "application/mods+xml": ["mods"],
      "application/mp21": ["m21", "mp21"],
      "application/mp4": ["*mp4", "*mpg4", "mp4s", "m4p"],
      "application/msix": ["msix"],
      "application/msixbundle": ["msixbundle"],
      "application/msword": ["doc", "dot"],
      "application/mxf": ["mxf"],
      "application/n-quads": ["nq"],
      "application/n-triples": ["nt"],
      "application/node": ["cjs"],
      "application/octet-stream": [
        "bin",
        "dms",
        "lrf",
        "mar",
        "so",
        "dist",
        "distz",
        "pkg",
        "bpk",
        "dump",
        "elc",
        "deploy",
        "exe",
        "dll",
        "deb",
        "dmg",
        "iso",
        "img",
        "msi",
        "msp",
        "msm",
        "buffer"
      ],
      "application/oda": ["oda"],
      "application/oebps-package+xml": ["opf"],
      "application/ogg": ["ogx"],
      "application/omdoc+xml": ["omdoc"],
      "application/onenote": [
        "onetoc",
        "onetoc2",
        "onetmp",
        "onepkg",
        "one",
        "onea"
      ],
      "application/oxps": ["oxps"],
      "application/p2p-overlay+xml": ["relo"],
      "application/patch-ops-error+xml": ["xer"],
      "application/pdf": ["pdf"],
      "application/pgp-encrypted": ["pgp"],
      "application/pgp-keys": ["asc"],
      "application/pgp-signature": ["sig", "*asc"],
      "application/pics-rules": ["prf"],
      "application/pkcs10": ["p10"],
      "application/pkcs7-mime": ["p7m", "p7c"],
      "application/pkcs7-signature": ["p7s"],
      "application/pkcs8": ["p8"],
      "application/pkix-attr-cert": ["ac"],
      "application/pkix-cert": ["cer"],
      "application/pkix-crl": ["crl"],
      "application/pkix-pkipath": ["pkipath"],
      "application/pkixcmp": ["pki"],
      "application/pls+xml": ["pls"],
      "application/postscript": ["ai", "eps", "ps"],
      "application/provenance+xml": ["provx"],
      "application/pskc+xml": ["pskcxml"],
      "application/raml+yaml": ["raml"],
      "application/rdf+xml": ["rdf", "owl"],
      "application/reginfo+xml": ["rif"],
      "application/relax-ng-compact-syntax": ["rnc"],
      "application/resource-lists+xml": ["rl"],
      "application/resource-lists-diff+xml": ["rld"],
      "application/rls-services+xml": ["rs"],
      "application/route-apd+xml": ["rapd"],
      "application/route-s-tsid+xml": ["sls"],
      "application/route-usd+xml": ["rusd"],
      "application/rpki-ghostbusters": ["gbr"],
      "application/rpki-manifest": ["mft"],
      "application/rpki-roa": ["roa"],
      "application/rsd+xml": ["rsd"],
      "application/rss+xml": ["rss"],
      "application/rtf": ["rtf"],
      "application/sbml+xml": ["sbml"],
      "application/scvp-cv-request": ["scq"],
      "application/scvp-cv-response": ["scs"],
      "application/scvp-vp-request": ["spq"],
      "application/scvp-vp-response": ["spp"],
      "application/sdp": ["sdp"],
      "application/senml+xml": ["senmlx"],
      "application/sensml+xml": ["sensmlx"],
      "application/set-payment-initiation": ["setpay"],
      "application/set-registration-initiation": ["setreg"],
      "application/shf+xml": ["shf"],
      "application/sieve": ["siv", "sieve"],
      "application/smil+xml": ["smi", "smil"],
      "application/sparql-query": ["rq"],
      "application/sparql-results+xml": ["srx"],
      "application/sql": ["sql"],
      "application/srgs": ["gram"],
      "application/srgs+xml": ["grxml"],
      "application/sru+xml": ["sru"],
      "application/ssdl+xml": ["ssdl"],
      "application/ssml+xml": ["ssml"],
      "application/swid+xml": ["swidtag"],
      "application/tei+xml": ["tei", "teicorpus"],
      "application/thraud+xml": ["tfi"],
      "application/timestamped-data": ["tsd"],
      "application/toml": ["toml"],
      "application/trig": ["trig"],
      "application/ttml+xml": ["ttml"],
      "application/ubjson": ["ubj"],
      "application/urc-ressheet+xml": ["rsheet"],
      "application/urc-targetdesc+xml": ["td"],
      "application/voicexml+xml": ["vxml"],
      "application/wasm": ["wasm"],
      "application/watcherinfo+xml": ["wif"],
      "application/widget": ["wgt"],
      "application/winhlp": ["hlp"],
      "application/wsdl+xml": ["wsdl"],
      "application/wspolicy+xml": ["wspolicy"],
      "application/xaml+xml": ["xaml"],
      "application/xcap-att+xml": ["xav"],
      "application/xcap-caps+xml": ["xca"],
      "application/xcap-diff+xml": ["xdf"],
      "application/xcap-el+xml": ["xel"],
      "application/xcap-ns+xml": ["xns"],
      "application/xenc+xml": ["xenc"],
      "application/xfdf": ["xfdf"],
      "application/xhtml+xml": ["xhtml", "xht"],
      "application/xliff+xml": ["xlf"],
      "application/xml": ["xml", "xsl", "xsd", "rng"],
      "application/xml-dtd": ["dtd"],
      "application/xop+xml": ["xop"],
      "application/xproc+xml": ["xpl"],
      "application/xslt+xml": ["*xsl", "xslt"],
      "application/xspf+xml": ["xspf"],
      "application/xv+xml": ["mxml", "xhvml", "xvml", "xvm"],
      "application/yang": ["yang"],
      "application/yin+xml": ["yin"],
      "application/zip": ["zip"],
      "application/zip+dotlottie": ["lottie"],
      "audio/3gpp": ["*3gpp"],
      "audio/aac": ["adts", "aac"],
      "audio/adpcm": ["adp"],
      "audio/amr": ["amr"],
      "audio/basic": ["au", "snd"],
      "audio/midi": ["mid", "midi", "kar", "rmi"],
      "audio/mobile-xmf": ["mxmf"],
      "audio/mp3": ["*mp3"],
      "audio/mp4": ["m4a", "mp4a", "m4b"],
      "audio/mpeg": ["mpga", "mp2", "mp2a", "mp3", "m2a", "m3a"],
      "audio/ogg": ["oga", "ogg", "spx", "opus"],
      "audio/s3m": ["s3m"],
      "audio/silk": ["sil"],
      "audio/wav": ["wav"],
      "audio/wave": ["*wav"],
      "audio/webm": ["weba"],
      "audio/xm": ["xm"],
      "font/collection": ["ttc"],
      "font/otf": ["otf"],
      "font/ttf": ["ttf"],
      "font/woff": ["woff"],
      "font/woff2": ["woff2"],
      "image/aces": ["exr"],
      "image/apng": ["apng"],
      "image/avci": ["avci"],
      "image/avcs": ["avcs"],
      "image/avif": ["avif"],
      "image/bmp": ["bmp", "dib"],
      "image/cgm": ["cgm"],
      "image/dicom-rle": ["drle"],
      "image/dpx": ["dpx"],
      "image/emf": ["emf"],
      "image/fits": ["fits"],
      "image/g3fax": ["g3"],
      "image/gif": ["gif"],
      "image/heic": ["heic"],
      "image/heic-sequence": ["heics"],
      "image/heif": ["heif"],
      "image/heif-sequence": ["heifs"],
      "image/hej2k": ["hej2"],
      "image/ief": ["ief"],
      "image/jaii": ["jaii"],
      "image/jais": ["jais"],
      "image/jls": ["jls"],
      "image/jp2": ["jp2", "jpg2"],
      "image/jpeg": ["jpg", "jpeg", "jpe"],
      "image/jph": ["jph"],
      "image/jphc": ["jhc"],
      "image/jpm": ["jpm", "jpgm"],
      "image/jpx": ["jpx", "jpf"],
      "image/jxl": ["jxl"],
      "image/jxr": ["jxr"],
      "image/jxra": ["jxra"],
      "image/jxrs": ["jxrs"],
      "image/jxs": ["jxs"],
      "image/jxsc": ["jxsc"],
      "image/jxsi": ["jxsi"],
      "image/jxss": ["jxss"],
      "image/ktx": ["ktx"],
      "image/ktx2": ["ktx2"],
      "image/pjpeg": ["jfif"],
      "image/png": ["png"],
      "image/sgi": ["sgi"],
      "image/svg+xml": ["svg", "svgz"],
      "image/t38": ["t38"],
      "image/tiff": ["tif", "tiff"],
      "image/tiff-fx": ["tfx"],
      "image/webp": ["webp"],
      "image/wmf": ["wmf"],
      "message/disposition-notification": ["disposition-notification"],
      "message/global": ["u8msg"],
      "message/global-delivery-status": ["u8dsn"],
      "message/global-disposition-notification": ["u8mdn"],
      "message/global-headers": ["u8hdr"],
      "message/rfc822": ["eml", "mime", "mht", "mhtml"],
      "model/3mf": ["3mf"],
      "model/gltf+json": ["gltf"],
      "model/gltf-binary": ["glb"],
      "model/iges": ["igs", "iges"],
      "model/jt": ["jt"],
      "model/mesh": ["msh", "mesh", "silo"],
      "model/mtl": ["mtl"],
      "model/obj": ["obj"],
      "model/prc": ["prc"],
      "model/step": ["step", "stp", "stpnc", "p21", "210"],
      "model/step+xml": ["stpx"],
      "model/step+zip": ["stpz"],
      "model/step-xml+zip": ["stpxz"],
      "model/stl": ["stl"],
      "model/u3d": ["u3d"],
      "model/vrml": ["wrl", "vrml"],
      "model/x3d+binary": ["*x3db", "x3dbz"],
      "model/x3d+fastinfoset": ["x3db"],
      "model/x3d+vrml": ["*x3dv", "x3dvz"],
      "model/x3d+xml": ["x3d", "x3dz"],
      "model/x3d-vrml": ["x3dv"],
      "text/cache-manifest": ["appcache", "manifest"],
      "text/calendar": ["ics", "ifb"],
      "text/coffeescript": ["coffee", "litcoffee"],
      "text/css": ["css"],
      "text/csv": ["csv"],
      "text/html": ["html", "htm", "shtml"],
      "text/jade": ["jade"],
      "text/javascript": ["js", "mjs"],
      "text/jsx": ["jsx"],
      "text/less": ["less"],
      "text/markdown": ["md", "markdown"],
      "text/mathml": ["mml"],
      "text/mdx": ["mdx"],
      "text/n3": ["n3"],
      "text/plain": ["txt", "text", "conf", "def", "list", "log", "in", "ini"],
      "text/richtext": ["rtx"],
      "text/rtf": ["*rtf"],
      "text/sgml": ["sgml", "sgm"],
      "text/shex": ["shex"],
      "text/slim": ["slim", "slm"],
      "text/spdx": ["spdx"],
      "text/stylus": ["stylus", "styl"],
      "text/tab-separated-values": ["tsv"],
      "text/troff": ["t", "tr", "roff", "man", "me", "ms"],
      "text/turtle": ["ttl"],
      "text/uri-list": ["uri", "uris", "urls"],
      "text/vcard": ["vcard"],
      "text/vtt": ["vtt"],
      "text/wgsl": ["wgsl"],
      "text/xml": ["*xml"],
      "text/yaml": ["yaml", "yml"],
      "video/3gpp": ["3gp", "3gpp"],
      "video/3gpp2": ["3g2"],
      "video/h261": ["h261"],
      "video/h263": ["h263"],
      "video/h264": ["h264"],
      "video/iso.segment": ["m4s"],
      "video/jpeg": ["jpgv"],
      "video/jpm": ["*jpm", "*jpgm"],
      "video/mj2": ["mj2", "mjp2"],
      "video/mp2t": ["ts", "m2t", "m2ts", "mts"],
      "video/mp4": ["mp4", "mp4v", "mpg4"],
      "video/mpeg": ["mpeg", "mpg", "mpe", "m1v", "m2v"],
      "video/ogg": ["ogv"],
      "video/quicktime": ["qt", "mov"],
      "video/webm": ["webm"]
    };
    Object.freeze(types2);
    standard_default = types2;
  }
});

// ../../node_modules/.pnpm/mime@4.0.7/node_modules/mime/dist/src/Mime.js
var __classPrivateFieldGet, _Mime_extensionToType, _Mime_typeToExtension, _Mime_typeToExtensions, Mime, Mime_default;
var init_Mime = __esm({
  "../../node_modules/.pnpm/mime@4.0.7/node_modules/mime/dist/src/Mime.js"() {
    init_import_meta_url();
    __classPrivateFieldGet = function(receiver, state2, kind2, f8) {
      if (kind2 === "a" && !f8) throw new TypeError("Private accessor was defined without a getter");
      if (typeof state2 === "function" ? receiver !== state2 || !f8 : !state2.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
      return kind2 === "m" ? f8 : kind2 === "a" ? f8.call(receiver) : f8 ? f8.value : state2.get(receiver);
    };
    Mime = class {
      static {
        __name(this, "Mime");
      }
      constructor(...args) {
        _Mime_extensionToType.set(this, /* @__PURE__ */ new Map());
        _Mime_typeToExtension.set(this, /* @__PURE__ */ new Map());
        _Mime_typeToExtensions.set(this, /* @__PURE__ */ new Map());
        for (const arg of args) {
          this.define(arg);
        }
      }
      define(typeMap, force = false) {
        for (let [type, extensions] of Object.entries(typeMap)) {
          type = type.toLowerCase();
          extensions = extensions.map((ext2) => ext2.toLowerCase());
          if (!__classPrivateFieldGet(this, _Mime_typeToExtensions, "f").has(type)) {
            __classPrivateFieldGet(this, _Mime_typeToExtensions, "f").set(type, /* @__PURE__ */ new Set());
          }
          const allExtensions = __classPrivateFieldGet(this, _Mime_typeToExtensions, "f").get(type);
          let first = true;
          for (let extension of extensions) {
            const starred = extension.startsWith("*");
            extension = starred ? extension.slice(1) : extension;
            allExtensions?.add(extension);
            if (first) {
              __classPrivateFieldGet(this, _Mime_typeToExtension, "f").set(type, extension);
            }
            first = false;
            if (starred)
              continue;
            const currentType = __classPrivateFieldGet(this, _Mime_extensionToType, "f").get(extension);
            if (currentType && currentType != type && !force) {
              throw new Error(`"${type} -> ${extension}" conflicts with "${currentType} -> ${extension}". Pass \`force=true\` to override this definition.`);
            }
            __classPrivateFieldGet(this, _Mime_extensionToType, "f").set(extension, type);
          }
        }
        return this;
      }
      getType(path84) {
        if (typeof path84 !== "string")
          return null;
        const last = path84.replace(/^.*[/\\]/s, "").toLowerCase();
        const ext2 = last.replace(/^.*\./s, "").toLowerCase();
        const hasPath = last.length < path84.length;
        const hasDot = ext2.length < last.length - 1;
        if (!hasDot && hasPath)
          return null;
        return __classPrivateFieldGet(this, _Mime_extensionToType, "f").get(ext2) ?? null;
      }
      getExtension(type) {
        if (typeof type !== "string")
          return null;
        type = type?.split?.(";")[0];
        return (type && __classPrivateFieldGet(this, _Mime_typeToExtension, "f").get(type.trim().toLowerCase())) ?? null;
      }
      getAllExtensions(type) {
        if (typeof type !== "string")
          return null;
        return __classPrivateFieldGet(this, _Mime_typeToExtensions, "f").get(type.toLowerCase()) ?? null;
      }
      _freeze() {
        this.define = () => {
          throw new Error("define() not allowed for built-in Mime objects. See https://github.com/broofa/mime/blob/main/README.md#custom-mime-instances");
        };
        Object.freeze(this);
        for (const extensions of __classPrivateFieldGet(this, _Mime_typeToExtensions, "f").values()) {
          Object.freeze(extensions);
        }
        return this;
      }
      _getTestState() {
        return {
          types: __classPrivateFieldGet(this, _Mime_extensionToType, "f"),
          extensions: __classPrivateFieldGet(this, _Mime_typeToExtension, "f")
        };
      }
    };
    _Mime_extensionToType = /* @__PURE__ */ new WeakMap(), _Mime_typeToExtension = /* @__PURE__ */ new WeakMap(), _Mime_typeToExtensions = /* @__PURE__ */ new WeakMap();
    Mime_default = Mime;
  }
});

// ../../node_modules/.pnpm/mime@4.0.7/node_modules/mime/dist/src/index.js
var src_default;
var init_src = __esm({
  "../../node_modules/.pnpm/mime@4.0.7/node_modules/mime/dist/src/index.js"() {
    init_import_meta_url();
    init_other();
    init_standard();
    init_Mime();
    init_Mime();
    src_default = new Mime_default(standard_default, other_default)._freeze();
  }
});
function createPatternMatcher(patterns, exclude) {
  if (patterns.length === 0) {
    return (_filePath) => !exclude;
  } else {
    const ignorer = (0, import_ignore.default)().add(patterns);
    return (filePath) => ignorer.test(filePath).ignored;
  }
}
function thrownIsDoesNotExistError(thrown) {
  return thrown instanceof Error && "code" in thrown && thrown.code === "ENOENT";
}
function maybeGetFile(filePath) {
  try {
    return fs29.readFileSync(filePath, "utf8");
  } catch (e10) {
    if (!thrownIsDoesNotExistError(e10)) {
      throw e10;
    }
  }
}
async function createAssetsIgnoreFunction(dir2) {
  const cfAssetIgnorePath = path3.resolve(dir2, CF_ASSETS_IGNORE_FILENAME);
  const ignorePatterns = [
    // Ignore the `.assetsignore` file and other metafiles by default.
    // The ignore lib expects unix-style paths for its patterns
    `/${CF_ASSETS_IGNORE_FILENAME}`,
    `/${REDIRECTS_FILENAME}`,
    `/${HEADERS_FILENAME}`
  ];
  let assetsIgnoreFilePresent = false;
  const assetsIgnore = maybeGetFile(cfAssetIgnorePath);
  if (assetsIgnore !== void 0) {
    assetsIgnoreFilePresent = true;
    ignorePatterns.push(...assetsIgnore.split("\n"));
  }
  return {
    assetsIgnoreFunction: createPatternMatcher(ignorePatterns, true),
    assetsIgnoreFilePresent
  };
}
var import_ignore, normalizeFilePath, getContentType;
var init_helpers2 = __esm({
  "../workers-shared/utils/helpers.ts"() {
    init_import_meta_url();
    import_ignore = __toESM(require_ignore());
    init_src();
    init_constants();
    normalizeFilePath = /* @__PURE__ */ __name((relativeFilepath) => {
      if (path3.isAbsolute(relativeFilepath)) {
        throw new Error(`Expected relative path`);
      }
      return "/" + relativeFilepath.split(path3.sep).join("/");
    }, "normalizeFilePath");
    getContentType = /* @__PURE__ */ __name((absFilePath) => {
      let contentType = src_default.getType(absFilePath);
      if (contentType && contentType.startsWith("text/") && !contentType.includes("charset")) {
        contentType = `${contentType}; charset=utf-8`;
      }
      return contentType;
    }, "getContentType");
    __name(createPatternMatcher, "createPatternMatcher");
    __name(thrownIsDoesNotExistError, "thrownIsDoesNotExistError");
    __name(maybeGetFile, "maybeGetFile");
    __name(createAssetsIgnoreFunction, "createAssetsIgnoreFunction");
  }
});

// ../workers-shared/utils/configuration/constants.ts
var REDIRECTS_VERSION, HEADERS_VERSION, PERMITTED_STATUS_CODES, HEADER_SEPARATOR, MAX_LINE_LENGTH, MAX_HEADER_RULES, MAX_DYNAMIC_REDIRECT_RULES, MAX_STATIC_REDIRECT_RULES, UNSET_OPERATOR, SPLAT_REGEX, PLACEHOLDER_REGEX, MAX_ROUTES_RULES, MAX_ROUTES_RULE_LENGTH;
var init_constants2 = __esm({
  "../workers-shared/utils/configuration/constants.ts"() {
    init_import_meta_url();
    REDIRECTS_VERSION = 1;
    HEADERS_VERSION = 2;
    PERMITTED_STATUS_CODES = /* @__PURE__ */ new Set([200, 301, 302, 303, 307, 308]);
    HEADER_SEPARATOR = ":";
    MAX_LINE_LENGTH = 2e3;
    MAX_HEADER_RULES = 100;
    MAX_DYNAMIC_REDIRECT_RULES = 100;
    MAX_STATIC_REDIRECT_RULES = 2e3;
    UNSET_OPERATOR = "! ";
    SPLAT_REGEX = /\*/g;
    PLACEHOLDER_REGEX = /:[A-Za-z]\w*/g;
    MAX_ROUTES_RULES = 100;
    MAX_ROUTES_RULE_LENGTH = 100;
  }
});

// ../workers-shared/utils/configuration/validateURL.ts
function urlHasHost(token) {
  const host = URL_REGEX.exec(token);
  return Boolean(host && host.groups && host.groups.host);
}
var extractPathname, URL_REGEX, HOST_WITH_PORT_REGEX, PATH_REGEX, validateUrl;
var init_validateURL = __esm({
  "../workers-shared/utils/configuration/validateURL.ts"() {
    init_import_meta_url();
    extractPathname = /* @__PURE__ */ __name((path84 = "/", includeSearch, includeHash) => {
      if (!path84.startsWith("/")) {
        path84 = `/${path84}`;
      }
      const url4 = new URL(`//${path84}`, "relative://");
      return `${url4.pathname}${includeSearch ? url4.search : ""}${includeHash ? url4.hash : ""}`;
    }, "extractPathname");
    URL_REGEX = /^https:\/\/+(?<host>[^/]+)\/?(?<path>.*)/;
    HOST_WITH_PORT_REGEX = /.*:\d+$/;
    PATH_REGEX = /^\//;
    validateUrl = /* @__PURE__ */ __name((token, onlyRelative = false, disallowPorts = false, includeSearch = false, includeHash = false) => {
      const host = URL_REGEX.exec(token);
      if (host && host.groups && host.groups.host) {
        if (onlyRelative) {
          return [
            void 0,
            `Only relative URLs are allowed. Skipping absolute URL ${token}.`
          ];
        }
        if (disallowPorts && host.groups.host.match(HOST_WITH_PORT_REGEX)) {
          return [
            void 0,
            `Specifying ports is not supported. Skipping absolute URL ${token}.`
          ];
        }
        return [
          `https://${host.groups.host}${extractPathname(
            host.groups.path,
            includeSearch,
            includeHash
          )}`,
          void 0
        ];
      } else {
        if (!token.startsWith("/") && onlyRelative) {
          token = `/${token}`;
        }
        const path84 = PATH_REGEX.exec(token);
        if (path84) {
          try {
            return [extractPathname(token, includeSearch, includeHash), void 0];
          } catch {
            return [void 0, `Error parsing URL segment ${token}. Skipping.`];
          }
        }
      }
      return [
        void 0,
        onlyRelative ? "URLs should begin with a forward-slash." : 'URLs should either be relative (e.g. begin with a forward-slash), or use HTTPS (e.g. begin with "https://").'
      ];
    }, "validateUrl");
    __name(urlHasHost, "urlHasHost");
  }
});

// ../workers-shared/utils/configuration/parseHeaders.ts
function parseHeaders(input, {
  maxRules = MAX_HEADER_RULES,
  maxLineLength = MAX_LINE_LENGTH
} = {}) {
  const lines = input.split("\n");
  const rules = [];
  const invalid = [];
  let rule = void 0;
  for (let i7 = 0; i7 < lines.length; i7++) {
    const line = (lines[i7] || "").trim();
    if (line.length === 0 || line.startsWith("#")) {
      continue;
    }
    if (line.length > maxLineLength) {
      invalid.push({
        message: `Ignoring line ${i7 + 1} as it exceeds the maximum allowed length of ${maxLineLength}.`
      });
      continue;
    }
    if (LINE_IS_PROBABLY_A_PATH.test(line)) {
      if (rules.length >= maxRules) {
        invalid.push({
          message: `Maximum number of rules supported is ${maxRules}. Skipping remaining ${lines.length - i7} lines of file.`
        });
        break;
      }
      if (rule) {
        if (isValidRule(rule)) {
          rules.push({
            path: rule.path,
            headers: rule.headers,
            unsetHeaders: rule.unsetHeaders
          });
        } else {
          invalid.push({
            line: rule.line,
            lineNumber: i7 + 1,
            message: "No headers specified"
          });
        }
      }
      const [path84, pathError] = validateUrl(line, false, true);
      if (pathError) {
        invalid.push({
          line,
          lineNumber: i7 + 1,
          message: pathError
        });
        rule = void 0;
        continue;
      }
      rule = {
        path: path84,
        line,
        headers: {},
        unsetHeaders: []
      };
      continue;
    }
    if (!line.includes(HEADER_SEPARATOR)) {
      if (!rule) {
        invalid.push({
          line,
          lineNumber: i7 + 1,
          message: "Expected a path beginning with at least one forward-slash"
        });
      } else {
        if (line.trim().startsWith(UNSET_OPERATOR)) {
          rule.unsetHeaders.push(line.trim().replace(UNSET_OPERATOR, ""));
        } else {
          invalid.push({
            line,
            lineNumber: i7 + 1,
            message: "Expected a colon-separated header pair (e.g. name: value)"
          });
        }
      }
      continue;
    }
    const [rawName, ...rawValue] = line.split(HEADER_SEPARATOR);
    const name2 = (rawName || "").trim().toLowerCase();
    if (name2.includes(" ")) {
      invalid.push({
        line,
        lineNumber: i7 + 1,
        message: "Header name cannot include spaces"
      });
      continue;
    }
    const value = rawValue.join(HEADER_SEPARATOR).trim();
    if (name2 === "") {
      invalid.push({
        line,
        lineNumber: i7 + 1,
        message: "No header name specified"
      });
      continue;
    }
    if (value === "") {
      invalid.push({
        line,
        lineNumber: i7 + 1,
        message: "No header value specified"
      });
      continue;
    }
    if (!rule) {
      invalid.push({
        line,
        lineNumber: i7 + 1,
        message: `Path should come before header (${name2}: ${value})`
      });
      continue;
    }
    const existingValues = rule.headers[name2];
    rule.headers[name2] = existingValues ? `${existingValues}, ${value}` : value;
  }
  if (rule) {
    if (isValidRule(rule)) {
      rules.push({
        path: rule.path,
        headers: rule.headers,
        unsetHeaders: rule.unsetHeaders
      });
    } else {
      invalid.push({ line: rule.line, message: "No headers specified" });
    }
  }
  return {
    rules,
    invalid
  };
}
function isValidRule(rule) {
  return Object.keys(rule.headers).length > 0 || rule.unsetHeaders.length > 0;
}
var LINE_IS_PROBABLY_A_PATH;
var init_parseHeaders = __esm({
  "../workers-shared/utils/configuration/parseHeaders.ts"() {
    init_import_meta_url();
    init_constants2();
    init_validateURL();
    LINE_IS_PROBABLY_A_PATH = new RegExp(/^([^\s]+:\/\/|^\/)/);
    __name(parseHeaders, "parseHeaders");
    __name(isValidRule, "isValidRule");
  }
});

// ../workers-shared/utils/configuration/parseRedirects.ts
function parseRedirects(input, {
  htmlHandling = void 0,
  maxStaticRules = MAX_STATIC_REDIRECT_RULES,
  maxDynamicRules = MAX_DYNAMIC_REDIRECT_RULES,
  maxLineLength = MAX_LINE_LENGTH
} = {}) {
  const lines = input.split("\n");
  const rules = [];
  const seen_paths = /* @__PURE__ */ new Set();
  const invalid = [];
  let staticRules = 0;
  let dynamicRules = 0;
  let canCreateStaticRule = true;
  for (let i7 = 0; i7 < lines.length; i7++) {
    const line = (lines[i7] || "").trim();
    if (line.length === 0 || line.startsWith("#")) {
      continue;
    }
    if (line.length > maxLineLength) {
      invalid.push({
        message: `Ignoring line ${i7 + 1} as it exceeds the maximum allowed length of ${maxLineLength}.`
      });
      continue;
    }
    const tokens = line.replace(/\s+#.*$/, "").split(/\s+/);
    if (tokens.length < 2 || tokens.length > 3) {
      invalid.push({
        line,
        lineNumber: i7 + 1,
        message: `Expected exactly 2 or 3 whitespace-separated tokens. Got ${tokens.length}.`
      });
      continue;
    }
    const [str_from, str_to, str_status = "302"] = tokens;
    const fromResult = validateUrl(str_from, true, true, false, false);
    if (fromResult[0] === void 0) {
      invalid.push({
        line,
        lineNumber: i7 + 1,
        message: fromResult[1]
      });
      continue;
    }
    const from = fromResult[0];
    if (canCreateStaticRule && !from.match(SPLAT_REGEX) && !from.match(PLACEHOLDER_REGEX)) {
      staticRules += 1;
      if (staticRules > maxStaticRules) {
        invalid.push({
          message: `Maximum number of static rules supported is ${maxStaticRules}. Skipping line.`
        });
        continue;
      }
    } else {
      dynamicRules += 1;
      canCreateStaticRule = false;
      if (dynamicRules > maxDynamicRules) {
        invalid.push({
          message: `Maximum number of dynamic rules supported is ${maxDynamicRules}. Skipping remaining ${lines.length - i7} lines of file.`
        });
        break;
      }
    }
    const toResult = validateUrl(str_to, false, false, true, true);
    if (toResult[0] === void 0) {
      invalid.push({
        line,
        lineNumber: i7 + 1,
        message: toResult[1]
      });
      continue;
    }
    const to = toResult[0];
    const status2 = Number(str_status);
    if (isNaN(status2) || !PERMITTED_STATUS_CODES.has(status2)) {
      invalid.push({
        line,
        lineNumber: i7 + 1,
        message: `Valid status codes are 200, 301, 302 (default), 303, 307, or 308. Got ${str_status}.`
      });
      continue;
    }
    const hasRelativePath = !urlHasHost(to);
    const hasWildcardToIndex = from.endsWith("/*") && /\/index(.html)?$/.test(to);
    const hasRootToIndex = from.endsWith("/") && /\/index(.html)?$/.test(to);
    const hasHTMLHandling = htmlHandling !== "none";
    if (hasRelativePath && (hasWildcardToIndex || hasRootToIndex && hasHTMLHandling)) {
      invalid.push({
        line,
        lineNumber: i7 + 1,
        message: "Infinite loop detected in this rule and has been ignored. This will cause a redirect to strip `.html` or `/index` and end up triggering this rule again. Please fix or remove this rule to silence this warning."
      });
      continue;
    }
    if (seen_paths.has(from)) {
      invalid.push({
        line,
        lineNumber: i7 + 1,
        message: `Ignoring duplicate rule for path ${from}.`
      });
      continue;
    }
    seen_paths.add(from);
    if (status2 === 200) {
      if (urlHasHost(to)) {
        invalid.push({
          line,
          lineNumber: i7 + 1,
          message: `Proxy (200) redirects can only point to relative paths. Got ${to}`
        });
        continue;
      }
    }
    rules.push({ from, to, status: status2, lineNumber: i7 + 1 });
  }
  return {
    rules,
    invalid
  };
}
var init_parseRedirects = __esm({
  "../workers-shared/utils/configuration/parseRedirects.ts"() {
    init_import_meta_url();
    init_constants2();
    init_validateURL();
    __name(parseRedirects, "parseRedirects");
  }
});

// ../workers-shared/utils/configuration/types.ts
var init_types4 = __esm({
  "../workers-shared/utils/configuration/types.ts"() {
    init_import_meta_url();
  }
});

// ../workers-shared/index.ts
var init_workers_shared = __esm({
  "../workers-shared/index.ts"() {
    init_import_meta_url();
    init_constants();
    init_types3();
    init_helpers2();
    init_parseHeaders();
    init_parseRedirects();
    init_types4();
  }
});
function maybeRetrieveFileSourceMap(filePath) {
  if (filePath === void 0) {
    return null;
  }
  const contents = maybeGetFile(filePath);
  if (contents === void 0) {
    return null;
  }
  const mapRegexp = /# sourceMappingURL=(.+)/g;
  const matches = [...contents.matchAll(mapRegexp)];
  if (matches.length === 0) {
    return null;
  }
  const mapMatch = matches[matches.length - 1];
  const fileUrl = Url__default.default.pathToFileURL(filePath);
  const mapUrl = new URL(mapMatch[1], fileUrl);
  if (mapUrl.protocol === "data:" && mapUrl.pathname.startsWith("application/json;base64,")) {
    const base642 = mapUrl.href.substring(mapUrl.href.indexOf(",") + 1);
    const map2 = Buffer.from(base642, "base64").toString();
    return { map: map2, url: fileUrl.href };
  } else {
    const map2 = maybeGetFile(mapUrl);
    if (map2 === void 0) {
      return null;
    }
    return { map: map2, url: mapUrl.href };
  }
}
function getSourceMappingPrepareStackTrace(retrieveSourceMap) {
  retrieveSourceMapOverride = retrieveSourceMap;
  if (sourceMappingPrepareStackTrace !== void 0) {
    return sourceMappingPrepareStackTrace;
  }
  const support = miniflare.getFreshSourceMapSupport();
  const originalPrepareStackTrace = Error.prepareStackTrace;
  support.install({
    environment: "node",
    // Don't add Node `uncaughtException` handler
    handleUncaughtExceptions: false,
    // Don't hook Node `require` function
    hookRequire: false,
    redirectConflictingLibrary: false,
    // Make sure we're using fresh copies of files each time we source map
    emptyCacheBetweenOperations: true,
    // Allow retriever to be overridden at prepare stack trace time
    retrieveSourceMap(path84) {
      return retrieveSourceMapOverride?.(path84) ?? null;
    }
  });
  sourceMappingPrepareStackTrace = Error.prepareStackTrace;
  assert53__default.default(sourceMappingPrepareStackTrace !== void 0);
  Error.prepareStackTrace = originalPrepareStackTrace;
  return sourceMappingPrepareStackTrace;
}
function getSourceMappedStack(details) {
  const description = details.exception?.description ?? "";
  const callFrames = details.stackTrace?.callFrames;
  if (callFrames === void 0) {
    return description;
  }
  const nameMessage = details.exception?.description?.split("\n")[0] ?? "";
  const colonIndex = nameMessage.indexOf(":");
  const error2 = new Error(nameMessage.substring(colonIndex + 2));
  error2.name = nameMessage.substring(0, colonIndex);
  const callSites = callFrames.map(callFrameToCallSite);
  return getSourceMappingPrepareStackTrace()(error2, callSites);
}
function callFrameToCallSite(frame) {
  return new CallSite({
    typeName: null,
    functionName: frame.functionName,
    methodName: null,
    fileName: frame.url,
    lineNumber: frame.lineNumber + 1,
    columnNumber: frame.columnNumber + 1,
    native: false
  });
}
function getSourceMappedString(value, retrieveSourceMap) {
  const callSiteLines = Array.from(value.matchAll(CALL_SITE_REGEXP));
  const callSites = callSiteLines.map(lineMatchToCallSite);
  const prepareStack = getSourceMappingPrepareStackTrace(retrieveSourceMap);
  const sourceMappedStackTrace = prepareStack(
    placeholderError,
    callSites
  );
  const sourceMappedCallSiteLines = sourceMappedStackTrace.split("\n").slice(1);
  for (let i7 = 0; i7 < callSiteLines.length; i7++) {
    if (callSites[i7].getFileName() === void 0) {
      continue;
    }
    const callSiteLine = callSiteLines[i7][0];
    const callSiteAtIndex = callSiteLine.indexOf("at");
    assert53__default.default(callSiteAtIndex !== -1);
    const callSiteLineLeftPad = callSiteLine.substring(0, callSiteAtIndex);
    value = value.replace(
      callSiteLine,
      callSiteLineLeftPad + sourceMappedCallSiteLines[i7].trimStart()
    );
  }
  return value;
}
function lineMatchToCallSite(lineMatch) {
  let object = null;
  let method = null;
  let functionName = null;
  let typeName = null;
  let methodName = null;
  const isNative = lineMatch[5] === "native";
  if (lineMatch[1]) {
    functionName = lineMatch[1];
    let methodStart = functionName.lastIndexOf(".");
    if (functionName[methodStart - 1] == ".") {
      methodStart--;
    }
    if (methodStart > 0) {
      object = functionName.substring(0, methodStart);
      method = functionName.substring(methodStart + 1);
      const objectEnd = object.indexOf(".Module");
      if (objectEnd > 0) {
        functionName = functionName.substring(objectEnd + 1);
        object = object.substring(0, objectEnd);
      }
    }
  }
  if (method) {
    typeName = object;
    methodName = method;
  }
  if (method === "<anonymous>") {
    methodName = null;
    functionName = null;
  }
  return new CallSite({
    typeName,
    functionName,
    methodName,
    fileName: lineMatch[2],
    lineNumber: parseInt(lineMatch[3]) || null,
    columnNumber: parseInt(lineMatch[4]) || null,
    native: isNative
  });
}
var sourceMappingPrepareStackTrace, retrieveSourceMapOverride, placeholderError, CALL_SITE_REGEXP, CallSite;
var init_sourcemap = __esm({
  "src/sourcemap.ts"() {
    init_import_meta_url();
    init_workers_shared();
    __name(maybeRetrieveFileSourceMap, "maybeRetrieveFileSourceMap");
    __name(getSourceMappingPrepareStackTrace, "getSourceMappingPrepareStackTrace");
    __name(getSourceMappedStack, "getSourceMappedStack");
    __name(callFrameToCallSite, "callFrameToCallSite");
    placeholderError = new Error();
    __name(getSourceMappedString, "getSourceMappedString");
    CALL_SITE_REGEXP = // Validation errors from `wrangler deploy` have a 2 space indent, whereas
    // regular stack traces have a 4 space indent.
    // eslint-disable-next-line no-control-regex
    /^(?:\s+(?:\x1B\[\d+m)?'?)? {2,4}at (?:(.+?)\s+\()?(?:(.+?):(\d+)(?::(\d+))?|([^)]+))\)?/gm;
    __name(lineMatchToCallSite, "lineMatchToCallSite");
    CallSite = class {
      constructor(opts) {
        this.opts = opts;
      }
      static {
        __name(this, "CallSite");
      }
      getScriptHash() {
        throw new Error("Method not implemented.");
      }
      getEnclosingColumnNumber() {
        throw new Error("Method not implemented.");
      }
      getEnclosingLineNumber() {
        throw new Error("Method not implemented.");
      }
      getPosition() {
        throw new Error("Method not implemented.");
      }
      getThis() {
        return null;
      }
      getTypeName() {
        return this.opts.typeName;
      }
      // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
      getFunction() {
        return void 0;
      }
      getFunctionName() {
        return this.opts.functionName;
      }
      getMethodName() {
        return this.opts.methodName;
      }
      getFileName() {
        return this.opts.fileName ?? null;
      }
      getScriptNameOrSourceURL() {
        return this.opts.fileName;
      }
      getLineNumber() {
        return this.opts.lineNumber;
      }
      getColumnNumber() {
        return this.opts.columnNumber;
      }
      getEvalOrigin() {
        return void 0;
      }
      isToplevel() {
        return false;
      }
      isEval() {
        return false;
      }
      isNative() {
        return this.opts.native;
      }
      isConstructor() {
        return false;
      }
      isAsync() {
        return false;
      }
      isPromiseAll() {
        return false;
      }
      isPromiseAny() {
        return false;
      }
      getPromiseIndex() {
        return null;
      }
    };
  }
});

// ../../node_modules/.pnpm/ini@1.3.8/node_modules/ini/ini.js
var require_ini = __commonJS({
  "../../node_modules/.pnpm/ini@1.3.8/node_modules/ini/ini.js"(exports) {
    init_import_meta_url();
    exports.parse = exports.decode = decode;
    exports.stringify = exports.encode = encode2;
    exports.safe = safe;
    exports.unsafe = unsafe;
    var eol = typeof process !== "undefined" && process.platform === "win32" ? "\r\n" : "\n";
    function encode2(obj, opt) {
      var children = [];
      var out = "";
      if (typeof opt === "string") {
        opt = {
          section: opt,
          whitespace: false
        };
      } else {
        opt = opt || {};
        opt.whitespace = opt.whitespace === true;
      }
      var separator = opt.whitespace ? " = " : "=";
      Object.keys(obj).forEach(function(k7, _5, __) {
        var val2 = obj[k7];
        if (val2 && Array.isArray(val2)) {
          val2.forEach(function(item) {
            out += safe(k7 + "[]") + separator + safe(item) + "\n";
          });
        } else if (val2 && typeof val2 === "object")
          children.push(k7);
        else
          out += safe(k7) + separator + safe(val2) + eol;
      });
      if (opt.section && out.length)
        out = "[" + safe(opt.section) + "]" + eol + out;
      children.forEach(function(k7, _5, __) {
        var nk = dotSplit(k7).join("\\.");
        var section = (opt.section ? opt.section + "." : "") + nk;
        var child = encode2(obj[k7], {
          section,
          whitespace: opt.whitespace
        });
        if (out.length && child.length)
          out += eol;
        out += child;
      });
      return out;
    }
    __name(encode2, "encode");
    function dotSplit(str) {
      return str.replace(/\1/g, "LITERAL\\1LITERAL").replace(/\\\./g, "").split(/\./).map(function(part) {
        return part.replace(/\1/g, "\\.").replace(/\2LITERAL\\1LITERAL\2/g, "");
      });
    }
    __name(dotSplit, "dotSplit");
    function decode(str) {
      var out = {};
      var p7 = out;
      var section = null;
      var re2 = /^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i;
      var lines = str.split(/[\r\n]+/g);
      lines.forEach(function(line, _5, __) {
        if (!line || line.match(/^\s*[;#]/))
          return;
        var match3 = line.match(re2);
        if (!match3)
          return;
        if (match3[1] !== void 0) {
          section = unsafe(match3[1]);
          if (section === "__proto__") {
            p7 = {};
            return;
          }
          p7 = out[section] = out[section] || {};
          return;
        }
        var key = unsafe(match3[2]);
        if (key === "__proto__")
          return;
        var value = match3[3] ? unsafe(match3[4]) : true;
        switch (value) {
          case "true":
          case "false":
          case "null":
            value = JSON.parse(value);
        }
        if (key.length > 2 && key.slice(-2) === "[]") {
          key = key.substring(0, key.length - 2);
          if (key === "__proto__")
            return;
          if (!p7[key])
            p7[key] = [];
          else if (!Array.isArray(p7[key]))
            p7[key] = [p7[key]];
        }
        if (Array.isArray(p7[key]))
          p7[key].push(value);
        else
          p7[key] = value;
      });
      Object.keys(out).filter(function(k7, _5, __) {
        if (!out[k7] || typeof out[k7] !== "object" || Array.isArray(out[k7]))
          return false;
        var parts = dotSplit(k7);
        var p8 = out;
        var l8 = parts.pop();
        var nl = l8.replace(/\\\./g, ".");
        parts.forEach(function(part, _6, __2) {
          if (part === "__proto__")
            return;
          if (!p8[part] || typeof p8[part] !== "object")
            p8[part] = {};
          p8 = p8[part];
        });
        if (p8 === out && nl === l8)
          return false;
        p8[nl] = out[k7];
        return true;
      }).forEach(function(del, _5, __) {
        delete out[del];
      });
      return out;
    }
    __name(decode, "decode");
    function isQuoted(val2) {
      return val2.charAt(0) === '"' && val2.slice(-1) === '"' || val2.charAt(0) === "'" && val2.slice(-1) === "'";
    }
    __name(isQuoted, "isQuoted");
    function safe(val2) {
      return typeof val2 !== "string" || val2.match(/[=\r\n]/) || val2.match(/^\[/) || val2.length > 1 && isQuoted(val2) || val2 !== val2.trim() ? JSON.stringify(val2) : val2.replace(/;/g, "\\;").replace(/#/g, "\\#");
    }
    __name(safe, "safe");
    function unsafe(val2, doUnesc) {
      val2 = (val2 || "").trim();
      if (isQuoted(val2)) {
        if (val2.charAt(0) === "'")
          val2 = val2.substr(1, val2.length - 2);
        try {
          val2 = JSON.parse(val2);
        } catch (_5) {
        }
      } else {
        var esc = false;
        var unesc = "";
        for (var i7 = 0, l8 = val2.length; i7 < l8; i7++) {
          var c8 = val2.charAt(i7);
          if (esc) {
            if ("\\;#".indexOf(c8) !== -1)
              unesc += c8;
            else
              unesc += "\\" + c8;
            esc = false;
          } else if (";#".indexOf(c8) !== -1)
            break;
          else if (c8 === "\\")
            esc = true;
          else
            unesc += c8;
        }
        if (esc)
          unesc += "\\";
        return unesc.trim();
      }
      return val2;
    }
    __name(unsafe, "unsafe");
  }
});

// ../../node_modules/.pnpm/strip-json-comments@2.0.1/node_modules/strip-json-comments/index.js
var require_strip_json_comments = __commonJS({
  "../../node_modules/.pnpm/strip-json-comments@2.0.1/node_modules/strip-json-comments/index.js"(exports, module2) {
    init_import_meta_url();
    var singleComment = 1;
    var multiComment = 2;
    function stripWithoutWhitespace() {
      return "";
    }
    __name(stripWithoutWhitespace, "stripWithoutWhitespace");
    function stripWithWhitespace(str, start, end) {
      return str.slice(start, end).replace(/\S/g, " ");
    }
    __name(stripWithWhitespace, "stripWithWhitespace");
    module2.exports = function(str, opts) {
      opts = opts || {};
      var currentChar;
      var nextChar;
      var insideString = false;
      var insideComment = false;
      var offset = 0;
      var ret = "";
      var strip = opts.whitespace === false ? stripWithoutWhitespace : stripWithWhitespace;
      for (var i7 = 0; i7 < str.length; i7++) {
        currentChar = str[i7];
        nextChar = str[i7 + 1];
        if (!insideComment && currentChar === '"') {
          var escaped = str[i7 - 1] === "\\" && str[i7 - 2] !== "\\";
          if (!escaped) {
            insideString = !insideString;
          }
        }
        if (insideString) {
          continue;
        }
        if (!insideComment && currentChar + nextChar === "//") {
          ret += str.slice(offset, i7);
          offset = i7;
          insideComment = singleComment;
          i7++;
        } else if (insideComment === singleComment && currentChar + nextChar === "\r\n") {
          i7++;
          insideComment = false;
          ret += strip(str, offset, i7);
          offset = i7;
          continue;
        } else if (insideComment === singleComment && currentChar === "\n") {
          insideComment = false;
          ret += strip(str, offset, i7);
          offset = i7;
        } else if (!insideComment && currentChar + nextChar === "/*") {
          ret += str.slice(offset, i7);
          offset = i7;
          insideComment = multiComment;
          i7++;
          continue;
        } else if (insideComment === multiComment && currentChar + nextChar === "*/") {
          i7++;
          insideComment = false;
          ret += strip(str, offset, i7 + 1);
          offset = i7 + 1;
          continue;
        }
      }
      return ret + (insideComment ? strip(str.substr(offset)) : str.substr(offset));
    };
  }
});

// ../../node_modules/.pnpm/rc@1.2.8/node_modules/rc/lib/utils.js
var require_utils3 = __commonJS({
  "../../node_modules/.pnpm/rc@1.2.8/node_modules/rc/lib/utils.js"(exports) {
    init_import_meta_url();
    var fs33 = __require("fs");
    var ini = require_ini();
    var path84 = __require("path");
    var stripJsonComments = require_strip_json_comments();
    var parse17 = exports.parse = function(content) {
      if (/^\s*{/.test(content))
        return JSON.parse(stripJsonComments(content));
      return ini.parse(content);
    };
    var file3 = exports.file = function() {
      var args = [].slice.call(arguments).filter(function(arg) {
        return arg != null;
      });
      for (var i7 in args)
        if ("string" !== typeof args[i7])
          return;
      var file4 = path84.join.apply(null, args);
      try {
        return fs33.readFileSync(file4, "utf-8");
      } catch (err) {
        return;
      }
    };
    exports.json = function() {
      var content = file3.apply(null, arguments);
      return content ? parse17(content) : null;
    };
    exports.env = function(prefix, env7) {
      env7 = env7 || process.env;
      var obj = {};
      var l8 = prefix.length;
      for (var k7 in env7) {
        if (k7.toLowerCase().indexOf(prefix.toLowerCase()) === 0) {
          var keypath = k7.substring(l8).split("__");
          var _emptyStringIndex;
          while ((_emptyStringIndex = keypath.indexOf("")) > -1) {
            keypath.splice(_emptyStringIndex, 1);
          }
          var cursor = obj;
          keypath.forEach(/* @__PURE__ */ __name(function _buildSubObj(_subkey, i7) {
            if (!_subkey || typeof cursor !== "object")
              return;
            if (i7 === keypath.length - 1)
              cursor[_subkey] = env7[k7];
            if (cursor[_subkey] === void 0)
              cursor[_subkey] = {};
            cursor = cursor[_subkey];
          }, "_buildSubObj"));
        }
      }
      return obj;
    };
    exports.find = function() {
      var rel = path84.join.apply(null, [].slice.call(arguments));
      function find3(start, rel2) {
        var file4 = path84.join(start, rel2);
        try {
          fs33.statSync(file4);
          return file4;
        } catch (err) {
          if (path84.dirname(start) !== start)
            return find3(path84.dirname(start), rel2);
        }
      }
      __name(find3, "find");
      return find3(process.cwd(), rel);
    };
  }
});

// ../../node_modules/.pnpm/deep-extend@0.6.0/node_modules/deep-extend/lib/deep-extend.js
var require_deep_extend = __commonJS({
  "../../node_modules/.pnpm/deep-extend@0.6.0/node_modules/deep-extend/lib/deep-extend.js"(exports, module2) {
    init_import_meta_url();
    function isSpecificValue(val2) {
      return val2 instanceof Buffer || val2 instanceof Date || val2 instanceof RegExp ? true : false;
    }
    __name(isSpecificValue, "isSpecificValue");
    function cloneSpecificValue(val2) {
      if (val2 instanceof Buffer) {
        var x7 = Buffer.alloc ? Buffer.alloc(val2.length) : new Buffer(val2.length);
        val2.copy(x7);
        return x7;
      } else if (val2 instanceof Date) {
        return new Date(val2.getTime());
      } else if (val2 instanceof RegExp) {
        return new RegExp(val2);
      } else {
        throw new Error("Unexpected situation");
      }
    }
    __name(cloneSpecificValue, "cloneSpecificValue");
    function deepCloneArray(arr) {
      var clone2 = [];
      arr.forEach(function(item, index) {
        if (typeof item === "object" && item !== null) {
          if (Array.isArray(item)) {
            clone2[index] = deepCloneArray(item);
          } else if (isSpecificValue(item)) {
            clone2[index] = cloneSpecificValue(item);
          } else {
            clone2[index] = deepExtend({}, item);
          }
        } else {
          clone2[index] = item;
        }
      });
      return clone2;
    }
    __name(deepCloneArray, "deepCloneArray");
    function safeGetProperty(object, property) {
      return property === "__proto__" ? void 0 : object[property];
    }
    __name(safeGetProperty, "safeGetProperty");
    var deepExtend = module2.exports = function() {
      if (arguments.length < 1 || typeof arguments[0] !== "object") {
        return false;
      }
      if (arguments.length < 2) {
        return arguments[0];
      }
      var target = arguments[0];
      var args = Array.prototype.slice.call(arguments, 1);
      var val2, src;
      args.forEach(function(obj) {
        if (typeof obj !== "object" || obj === null || Array.isArray(obj)) {
          return;
        }
        Object.keys(obj).forEach(function(key) {
          src = safeGetProperty(target, key);
          val2 = safeGetProperty(obj, key);
          if (val2 === target) {
            return;
          } else if (typeof val2 !== "object" || val2 === null) {
            target[key] = val2;
            return;
          } else if (Array.isArray(val2)) {
            target[key] = deepCloneArray(val2);
            return;
          } else if (isSpecificValue(val2)) {
            target[key] = cloneSpecificValue(val2);
            return;
          } else if (typeof src !== "object" || src === null || Array.isArray(src)) {
            target[key] = deepExtend({}, val2);
            return;
          } else {
            target[key] = deepExtend(src, val2);
            return;
          }
        });
      });
      return target;
    };
  }
});

// ../../node_modules/.pnpm/minimist@1.2.6/node_modules/minimist/index.js
var require_minimist = __commonJS({
  "../../node_modules/.pnpm/minimist@1.2.6/node_modules/minimist/index.js"(exports, module2) {
    init_import_meta_url();
    module2.exports = function(args, opts) {
      if (!opts) opts = {};
      var flags2 = { bools: {}, strings: {}, unknownFn: null };
      if (typeof opts["unknown"] === "function") {
        flags2.unknownFn = opts["unknown"];
      }
      if (typeof opts["boolean"] === "boolean" && opts["boolean"]) {
        flags2.allBools = true;
      } else {
        [].concat(opts["boolean"]).filter(Boolean).forEach(function(key2) {
          flags2.bools[key2] = true;
        });
      }
      var aliases2 = {};
      Object.keys(opts.alias || {}).forEach(function(key2) {
        aliases2[key2] = [].concat(opts.alias[key2]);
        aliases2[key2].forEach(function(x7) {
          aliases2[x7] = [key2].concat(aliases2[key2].filter(function(y5) {
            return x7 !== y5;
          }));
        });
      });
      [].concat(opts.string).filter(Boolean).forEach(function(key2) {
        flags2.strings[key2] = true;
        if (aliases2[key2]) {
          flags2.strings[aliases2[key2]] = true;
        }
      });
      var defaults3 = opts["default"] || {};
      var argv = { _: [] };
      Object.keys(flags2.bools).forEach(function(key2) {
        setArg(key2, defaults3[key2] === void 0 ? false : defaults3[key2]);
      });
      var notFlags = [];
      if (args.indexOf("--") !== -1) {
        notFlags = args.slice(args.indexOf("--") + 1);
        args = args.slice(0, args.indexOf("--"));
      }
      function argDefined(key2, arg2) {
        return flags2.allBools && /^--[^=]+$/.test(arg2) || flags2.strings[key2] || flags2.bools[key2] || aliases2[key2];
      }
      __name(argDefined, "argDefined");
      function setArg(key2, val2, arg2) {
        if (arg2 && flags2.unknownFn && !argDefined(key2, arg2)) {
          if (flags2.unknownFn(arg2) === false) return;
        }
        var value2 = !flags2.strings[key2] && isNumber(val2) ? Number(val2) : val2;
        setKey(argv, key2.split("."), value2);
        (aliases2[key2] || []).forEach(function(x7) {
          setKey(argv, x7.split("."), value2);
        });
      }
      __name(setArg, "setArg");
      function setKey(obj, keys, value2) {
        var o7 = obj;
        for (var i8 = 0; i8 < keys.length - 1; i8++) {
          var key2 = keys[i8];
          if (isConstructorOrProto(o7, key2)) return;
          if (o7[key2] === void 0) o7[key2] = {};
          if (o7[key2] === Object.prototype || o7[key2] === Number.prototype || o7[key2] === String.prototype) o7[key2] = {};
          if (o7[key2] === Array.prototype) o7[key2] = [];
          o7 = o7[key2];
        }
        var key2 = keys[keys.length - 1];
        if (isConstructorOrProto(o7, key2)) return;
        if (o7 === Object.prototype || o7 === Number.prototype || o7 === String.prototype) o7 = {};
        if (o7 === Array.prototype) o7 = [];
        if (o7[key2] === void 0 || flags2.bools[key2] || typeof o7[key2] === "boolean") {
          o7[key2] = value2;
        } else if (Array.isArray(o7[key2])) {
          o7[key2].push(value2);
        } else {
          o7[key2] = [o7[key2], value2];
        }
      }
      __name(setKey, "setKey");
      function aliasIsBoolean(key2) {
        return aliases2[key2].some(function(x7) {
          return flags2.bools[x7];
        });
      }
      __name(aliasIsBoolean, "aliasIsBoolean");
      for (var i7 = 0; i7 < args.length; i7++) {
        var arg = args[i7];
        if (/^--.+=/.test(arg)) {
          var m7 = arg.match(/^--([^=]+)=([\s\S]*)$/);
          var key = m7[1];
          var value = m7[2];
          if (flags2.bools[key]) {
            value = value !== "false";
          }
          setArg(key, value, arg);
        } else if (/^--no-.+/.test(arg)) {
          var key = arg.match(/^--no-(.+)/)[1];
          setArg(key, false, arg);
        } else if (/^--.+/.test(arg)) {
          var key = arg.match(/^--(.+)/)[1];
          var next = args[i7 + 1];
          if (next !== void 0 && !/^-/.test(next) && !flags2.bools[key] && !flags2.allBools && (aliases2[key] ? !aliasIsBoolean(key) : true)) {
            setArg(key, next, arg);
            i7++;
          } else if (/^(true|false)$/.test(next)) {
            setArg(key, next === "true", arg);
            i7++;
          } else {
            setArg(key, flags2.strings[key] ? "" : true, arg);
          }
        } else if (/^-[^-]+/.test(arg)) {
          var letters = arg.slice(1, -1).split("");
          var broken = false;
          for (var j7 = 0; j7 < letters.length; j7++) {
            var next = arg.slice(j7 + 2);
            if (next === "-") {
              setArg(letters[j7], next, arg);
              continue;
            }
            if (/[A-Za-z]/.test(letters[j7]) && /=/.test(next)) {
              setArg(letters[j7], next.split("=")[1], arg);
              broken = true;
              break;
            }
            if (/[A-Za-z]/.test(letters[j7]) && /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) {
              setArg(letters[j7], next, arg);
              broken = true;
              break;
            }
            if (letters[j7 + 1] && letters[j7 + 1].match(/\W/)) {
              setArg(letters[j7], arg.slice(j7 + 2), arg);
              broken = true;
              break;
            } else {
              setArg(letters[j7], flags2.strings[letters[j7]] ? "" : true, arg);
            }
          }
          var key = arg.slice(-1)[0];
          if (!broken && key !== "-") {
            if (args[i7 + 1] && !/^(-|--)[^-]/.test(args[i7 + 1]) && !flags2.bools[key] && (aliases2[key] ? !aliasIsBoolean(key) : true)) {
              setArg(key, args[i7 + 1], arg);
              i7++;
            } else if (args[i7 + 1] && /^(true|false)$/.test(args[i7 + 1])) {
              setArg(key, args[i7 + 1] === "true", arg);
              i7++;
            } else {
              setArg(key, flags2.strings[key] ? "" : true, arg);
            }
          }
        } else {
          if (!flags2.unknownFn || flags2.unknownFn(arg) !== false) {
            argv._.push(
              flags2.strings["_"] || !isNumber(arg) ? arg : Number(arg)
            );
          }
          if (opts.stopEarly) {
            argv._.push.apply(argv._, args.slice(i7 + 1));
            break;
          }
        }
      }
      Object.keys(defaults3).forEach(function(key2) {
        if (!hasKey(argv, key2.split("."))) {
          setKey(argv, key2.split("."), defaults3[key2]);
          (aliases2[key2] || []).forEach(function(x7) {
            setKey(argv, x7.split("."), defaults3[key2]);
          });
        }
      });
      if (opts["--"]) {
        argv["--"] = new Array();
        notFlags.forEach(function(key2) {
          argv["--"].push(key2);
        });
      } else {
        notFlags.forEach(function(key2) {
          argv._.push(key2);
        });
      }
      return argv;
    };
    function hasKey(obj, keys) {
      var o7 = obj;
      keys.slice(0, -1).forEach(function(key2) {
        o7 = o7[key2] || {};
      });
      var key = keys[keys.length - 1];
      return key in o7;
    }
    __name(hasKey, "hasKey");
    function isNumber(x7) {
      if (typeof x7 === "number") return true;
      if (/^0x[0-9a-f]+$/i.test(x7)) return true;
      return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x7);
    }
    __name(isNumber, "isNumber");
    function isConstructorOrProto(obj, key) {
      return key === "constructor" && typeof obj[key] === "function" || key === "__proto__";
    }
    __name(isConstructorOrProto, "isConstructorOrProto");
  }
});

// ../../node_modules/.pnpm/rc@1.2.8/node_modules/rc/index.js
var require_rc = __commonJS({
  "../../node_modules/.pnpm/rc@1.2.8/node_modules/rc/index.js"(exports, module2) {
    init_import_meta_url();
    var cc2 = require_utils3();
    var join36 = __require("path").join;
    var deepExtend = require_deep_extend();
    var etc = "/etc";
    var win = process.platform === "win32";
    var home = win ? process.env.USERPROFILE : process.env.HOME;
    module2.exports = function(name2, defaults3, argv, parse17) {
      if ("string" !== typeof name2)
        throw new Error("rc(name): name *must* be string");
      if (!argv)
        argv = require_minimist()(process.argv.slice(2));
      defaults3 = ("string" === typeof defaults3 ? cc2.json(defaults3) : defaults3) || {};
      parse17 = parse17 || cc2.parse;
      var env6 = cc2.env(name2 + "_");
      var configs = [defaults3];
      var configFiles = [];
      function addConfigFile(file3) {
        if (configFiles.indexOf(file3) >= 0) return;
        var fileConfig = cc2.file(file3);
        if (fileConfig) {
          configs.push(parse17(fileConfig));
          configFiles.push(file3);
        }
      }
      __name(addConfigFile, "addConfigFile");
      if (!win)
        [
          join36(etc, name2, "config"),
          join36(etc, name2 + "rc")
        ].forEach(addConfigFile);
      if (home)
        [
          join36(home, ".config", name2, "config"),
          join36(home, ".config", name2),
          join36(home, "." + name2, "config"),
          join36(home, "." + name2 + "rc")
        ].forEach(addConfigFile);
      addConfigFile(cc2.find("." + name2 + "rc"));
      if (env6.config) addConfigFile(env6.config);
      if (argv.config) addConfigFile(argv.config);
      return deepExtend.apply(null, configs.concat([
        env6,
        argv,
        configFiles.length ? { configs: configFiles, config: configFiles[configFiles.length - 1] } : void 0
      ]));
    };
  }
});

// ../../node_modules/.pnpm/registry-url@3.1.0/node_modules/registry-url/index.js
var require_registry_url = __commonJS({
  "../../node_modules/.pnpm/registry-url@3.1.0/node_modules/registry-url/index.js"(exports, module2) {
    init_import_meta_url();
    module2.exports = function(scope) {
      var rc = require_rc()("npm", { registry: "https://registry.npmjs.org/" });
      var url4 = rc[scope + ":registry"] || rc.registry;
      return url4.slice(-1) === "/" ? url4 : url4 + "/";
    };
  }
});

// ../../node_modules/.pnpm/safe-buffer@5.2.1/node_modules/safe-buffer/index.js
var require_safe_buffer = __commonJS({
  "../../node_modules/.pnpm/safe-buffer@5.2.1/node_modules/safe-buffer/index.js"(exports, module2) {
    init_import_meta_url();
    var buffer = __require("buffer");
    var Buffer8 = buffer.Buffer;
    function copyProps(src, dst) {
      for (var key in src) {
        dst[key] = src[key];
      }
    }
    __name(copyProps, "copyProps");
    if (Buffer8.from && Buffer8.alloc && Buffer8.allocUnsafe && Buffer8.allocUnsafeSlow) {
      module2.exports = buffer;
    } else {
      copyProps(buffer, exports);
      exports.Buffer = SafeBuffer;
    }
    function SafeBuffer(arg, encodingOrOffset, length) {
      return Buffer8(arg, encodingOrOffset, length);
    }
    __name(SafeBuffer, "SafeBuffer");
    SafeBuffer.prototype = Object.create(Buffer8.prototype);
    copyProps(Buffer8, SafeBuffer);
    SafeBuffer.from = function(arg, encodingOrOffset, length) {
      if (typeof arg === "number") {
        throw new TypeError("Argument must not be a number");
      }
      return Buffer8(arg, encodingOrOffset, length);
    };
    SafeBuffer.alloc = function(size, fill2, encoding) {
      if (typeof size !== "number") {
        throw new TypeError("Argument must be a number");
      }
      var buf = Buffer8(size);
      if (fill2 !== void 0) {
        if (typeof encoding === "string") {
          buf.fill(fill2, encoding);
        } else {
          buf.fill(fill2);
        }
      } else {
        buf.fill(0);
      }
      return buf;
    };
    SafeBuffer.allocUnsafe = function(size) {
      if (typeof size !== "number") {
        throw new TypeError("Argument must be a number");
      }
      return Buffer8(size);
    };
    SafeBuffer.allocUnsafeSlow = function(size) {
      if (typeof size !== "number") {
        throw new TypeError("Argument must be a number");
      }
      return buffer.SlowBuffer(size);
    };
  }
});

// ../../node_modules/.pnpm/registry-auth-token@3.3.2/node_modules/registry-auth-token/base64.js
var require_base64 = __commonJS({
  "../../node_modules/.pnpm/registry-auth-token@3.3.2/node_modules/registry-auth-token/base64.js"(exports, module2) {
    init_import_meta_url();
    var safeBuffer = require_safe_buffer().Buffer;
    function decodeBase64(base642) {
      return safeBuffer.from(base642, "base64").toString("utf8");
    }
    __name(decodeBase64, "decodeBase64");
    function encodeBase64(string) {
      return safeBuffer.from(string, "utf8").toString("base64");
    }
    __name(encodeBase64, "encodeBase64");
    module2.exports = {
      decodeBase64,
      encodeBase64
    };
  }
});

// ../../node_modules/.pnpm/registry-auth-token@3.3.2/node_modules/registry-auth-token/index.js
var require_registry_auth_token = __commonJS({
  "../../node_modules/.pnpm/registry-auth-token@3.3.2/node_modules/registry-auth-token/index.js"(exports, module2) {
    init_import_meta_url();
    var url4 = __require("url");
    var base642 = require_base64();
    var decodeBase64 = base642.decodeBase64;
    var encodeBase64 = base642.encodeBase64;
    var tokenKey = ":_authToken";
    var userKey = ":username";
    var passwordKey = ":_password";
    module2.exports = function() {
      var checkUrl2;
      var options;
      if (arguments.length >= 2) {
        checkUrl2 = arguments[0];
        options = arguments[1];
      } else if (typeof arguments[0] === "string") {
        checkUrl2 = arguments[0];
      } else {
        options = arguments[0];
      }
      options = options || {};
      options.npmrc = options.npmrc || require_rc()("npm", { registry: "https://registry.npmjs.org/" });
      checkUrl2 = checkUrl2 || options.npmrc.registry;
      return getRegistryAuthInfo(checkUrl2, options) || getLegacyAuthInfo(options.npmrc);
    };
    function getRegistryAuthInfo(checkUrl2, options) {
      var parsed = url4.parse(checkUrl2, false, true);
      var pathname;
      while (pathname !== "/" && parsed.pathname !== pathname) {
        pathname = parsed.pathname || "/";
        var regUrl = "//" + parsed.host + pathname.replace(/\/$/, "");
        var authInfo = getAuthInfoForUrl(regUrl, options.npmrc);
        if (authInfo) {
          return authInfo;
        }
        if (!options.recursive) {
          return /\/$/.test(checkUrl2) ? void 0 : getRegistryAuthInfo(url4.resolve(checkUrl2, "."), options);
        }
        parsed.pathname = url4.resolve(normalizePath2(pathname), "..") || "/";
      }
      return void 0;
    }
    __name(getRegistryAuthInfo, "getRegistryAuthInfo");
    function getLegacyAuthInfo(npmrc) {
      if (npmrc._auth) {
        return { token: npmrc._auth, type: "Basic" };
      }
      return void 0;
    }
    __name(getLegacyAuthInfo, "getLegacyAuthInfo");
    function normalizePath2(path84) {
      return path84[path84.length - 1] === "/" ? path84 : path84 + "/";
    }
    __name(normalizePath2, "normalizePath");
    function getAuthInfoForUrl(regUrl, npmrc) {
      var bearerAuth = getBearerToken(npmrc[regUrl + tokenKey] || npmrc[regUrl + "/" + tokenKey]);
      if (bearerAuth) {
        return bearerAuth;
      }
      var username = npmrc[regUrl + userKey] || npmrc[regUrl + "/" + userKey];
      var password = npmrc[regUrl + passwordKey] || npmrc[regUrl + "/" + passwordKey];
      var basicAuth = getTokenForUsernameAndPassword(username, password);
      if (basicAuth) {
        return basicAuth;
      }
      return void 0;
    }
    __name(getAuthInfoForUrl, "getAuthInfoForUrl");
    function getBearerToken(tok) {
      if (!tok) {
        return void 0;
      }
      var token = tok.replace(/^\$\{?([^}]*)\}?$/, function(fullMatch, envVar) {
        return process.env[envVar];
      });
      return { token, type: "Bearer" };
    }
    __name(getBearerToken, "getBearerToken");
    function getTokenForUsernameAndPassword(username, password) {
      if (!username || !password) {
        return void 0;
      }
      var pass2 = decodeBase64(password.replace(/^\$\{?([^}]*)\}?$/, function(fullMatch, envVar) {
        return process.env[envVar];
      }));
      var token = encodeBase64(username + ":" + pass2);
      return {
        token,
        type: "Basic",
        password: pass2,
        username
      };
    }
    __name(getTokenForUsernameAndPassword, "getTokenForUsernameAndPassword");
  }
});

// ../../node_modules/.pnpm/update-check@1.5.4/node_modules/update-check/index.js
var require_update_check = __commonJS({
  "../../node_modules/.pnpm/update-check@1.5.4/node_modules/update-check/index.js"(exports, module2) {
    init_import_meta_url();
    var { URL: URL8 } = __require("url");
    var { join: join36 } = __require("path");
    var fs33 = __require("fs");
    var { promisify: promisify9 } = __require("util");
    var { tmpdir: tmpdir2 } = __require("os");
    var registryUrl = require_registry_url();
    var writeFile14 = promisify9(fs33.writeFile);
    var mkdir5 = promisify9(fs33.mkdir);
    var readFile19 = promisify9(fs33.readFile);
    var compareVersions = /* @__PURE__ */ __name((a7, b11) => a7.localeCompare(b11, "en-US", { numeric: true }), "compareVersions");
    var encode2 = /* @__PURE__ */ __name((value) => encodeURIComponent(value).replace(/^%40/, "@"), "encode");
    var getFile = /* @__PURE__ */ __name(async (details, distTag) => {
      const rootDir = tmpdir2();
      const subDir = join36(rootDir, "update-check");
      if (!fs33.existsSync(subDir)) {
        await mkdir5(subDir);
      }
      let name2 = `${details.name}-${distTag}.json`;
      if (details.scope) {
        name2 = `${details.scope}-${name2}`;
      }
      return join36(subDir, name2);
    }, "getFile");
    var evaluateCache = /* @__PURE__ */ __name(async (file3, time, interval) => {
      if (fs33.existsSync(file3)) {
        const content = await readFile19(file3, "utf8");
        const { lastUpdate, latest } = JSON.parse(content);
        const nextCheck = lastUpdate + interval;
        if (nextCheck > time) {
          return {
            shouldCheck: false,
            latest
          };
        }
      }
      return {
        shouldCheck: true,
        latest: null
      };
    }, "evaluateCache");
    var updateCache = /* @__PURE__ */ __name(async (file3, latest, lastUpdate) => {
      const content = JSON.stringify({
        latest,
        lastUpdate
      });
      await writeFile14(file3, content, "utf8");
    }, "updateCache");
    var loadPackage = /* @__PURE__ */ __name((url4, authInfo) => new Promise((resolve32, reject) => {
      const options = {
        host: url4.hostname,
        path: url4.pathname,
        port: url4.port,
        headers: {
          accept: "application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"
        },
        timeout: 2e3
      };
      if (authInfo) {
        options.headers.authorization = `${authInfo.type} ${authInfo.token}`;
      }
      const { get: get2 } = url4.protocol === "https:" ? __require("https") : __require("http");
      get2(options, (response) => {
        const { statusCode } = response;
        if (statusCode !== 200) {
          const error2 = new Error(`Request failed with code ${statusCode}`);
          error2.code = statusCode;
          reject(error2);
          response.resume();
          return;
        }
        let rawData = "";
        response.setEncoding("utf8");
        response.on("data", (chunk) => {
          rawData += chunk;
        });
        response.on("end", () => {
          try {
            const parsedData = JSON.parse(rawData);
            resolve32(parsedData);
          } catch (e10) {
            reject(e10);
          }
        });
      }).on("error", reject).on("timeout", reject);
    }), "loadPackage");
    var getMostRecent = /* @__PURE__ */ __name(async ({ full, scope }, distTag) => {
      const regURL = registryUrl(scope);
      const url4 = new URL8(full, regURL);
      let spec = null;
      try {
        spec = await loadPackage(url4);
      } catch (err) {
        if (err.code && String(err.code).startsWith(4)) {
          const registryAuthToken = require_registry_auth_token();
          const authInfo = registryAuthToken(regURL, { recursive: true });
          spec = await loadPackage(url4, authInfo);
        } else {
          throw err;
        }
      }
      const version5 = spec["dist-tags"][distTag];
      if (!version5) {
        throw new Error(`Distribution tag ${distTag} is not available`);
      }
      return version5;
    }, "getMostRecent");
    var defaultConfig = {
      interval: 36e5,
      distTag: "latest"
    };
    var getDetails = /* @__PURE__ */ __name((name2) => {
      const spec = {
        full: encode2(name2)
      };
      if (name2.includes("/")) {
        const parts = name2.split("/");
        spec.scope = parts[0];
        spec.name = parts[1];
      } else {
        spec.scope = null;
        spec.name = name2;
      }
      return spec;
    }, "getDetails");
    module2.exports = async (pkg, config) => {
      if (typeof pkg !== "object") {
        throw new Error("The first parameter should be your package.json file content");
      }
      const details = getDetails(pkg.name);
      const time = Date.now();
      const { distTag, interval } = Object.assign({}, defaultConfig, config);
      const file3 = await getFile(details, distTag);
      let latest = null;
      let shouldCheck = true;
      ({ shouldCheck, latest } = await evaluateCache(file3, time, interval));
      if (shouldCheck) {
        latest = await getMostRecent(details, distTag);
        await updateCache(file3, latest, time);
      }
      const comparision = compareVersions(pkg.version, latest);
      if (comparision === -1) {
        return {
          latest,
          fromCache: !shouldCheck
        };
      }
      return null;
    };
  }
});

// src/update-check.ts
async function doUpdateCheck() {
  let update = null;
  const pkg = { name, version };
  try {
    update = await (0, import_update_check.default)(pkg, {
      distTag: pkg.version.startsWith("0.0.0") ? "beta" : "latest"
    });
  } catch {
  }
  return update?.latest;
}
function updateCheck() {
  return updateCheckPromise ??= doUpdateCheck();
}
var import_update_check, updateCheckPromise;
var init_update_check = __esm({
  "src/update-check.ts"() {
    init_import_meta_url();
    import_update_check = __toESM(require_update_check());
    init_package();
    __name(doUpdateCheck, "doUpdateCheck");
    __name(updateCheck, "updateCheck");
  }
});
var flags, run, getFlag;
var init_experimental_flags = __esm({
  "src/experimental-flags.ts"() {
    init_import_meta_url();
    init_logger();
    flags = new async_hooks.AsyncLocalStorage();
    run = /* @__PURE__ */ __name((flagValues, cb2) => flags.run(flagValues, cb2), "run");
    getFlag = /* @__PURE__ */ __name((flag) => {
      const store = flags.getStore();
      if (store === void 0) {
        logger.debug("No experimental flag store instantiated");
      }
      const value = flags.getStore()?.[flag];
      if (value === void 0) {
        logger.debug(
          `Attempted to use flag "${flag}" which has not been instantiated`
        );
      }
      return value;
    }, "getFlag");
  }
});
function printBindings(bindings, tailConsumers = [], streamingTailConsumers = [], containers = [], context2 = {}) {
  let hasConnectionStatus = false;
  const log2 = context2.log ?? logger.log;
  const isMultiWorker = context2.isMultiWorker ?? getFlag("MULTIWORKER");
  const getMode = createGetMode({
    isProvisioning: context2.provisioning,
    isLocalDev: context2.local
  });
  const truncate4 = /* @__PURE__ */ __name((item, maxLength = 40) => {
    const s7 = typeof item === "string" ? item : JSON.stringify(item);
    if (s7.length < maxLength) {
      return s7;
    }
    return `${s7.substring(0, maxLength - 3)}...`;
  }, "truncate");
  const output = [];
  const data_blobs = extractBindingsOfType("data_blob", bindings);
  const durable_objects = extractBindingsOfType(
    "durable_object_namespace",
    bindings
  );
  const workflows = extractBindingsOfType("workflow", bindings);
  const kv_namespaces = extractBindingsOfType("kv_namespace", bindings);
  const send_email = extractBindingsOfType("send_email", bindings);
  const queues = extractBindingsOfType("queue", bindings);
  const d1_databases = extractBindingsOfType("d1", bindings);
  const vectorize = extractBindingsOfType("vectorize", bindings);
  const ai_search_namespaces = extractBindingsOfType(
    "ai_search_namespace",
    bindings
  );
  const ai_search = extractBindingsOfType("ai_search", bindings);
  const hyperdrive = extractBindingsOfType("hyperdrive", bindings);
  const r2_buckets = extractBindingsOfType("r2_bucket", bindings);
  const logfwdr = extractBindingsOfType("logfwdr", bindings);
  const secrets_store_secrets = extractBindingsOfType(
    "secrets_store_secret",
    bindings
  );
  const services = extractBindingsOfType("service", bindings);
  const vpc_services = extractBindingsOfType("vpc_service", bindings);
  const vpc_networks = extractBindingsOfType("vpc_network", bindings);
  const analytics_engine_datasets = extractBindingsOfType(
    "analytics_engine",
    bindings
  );
  const text_blobs = extractBindingsOfType("text_blob", bindings);
  const browser = extractBindingsOfType("browser", bindings);
  const images = extractBindingsOfType("images", bindings);
  const stream2 = extractBindingsOfType("stream", bindings);
  const ai2 = extractBindingsOfType("ai", bindings);
  const version_metadata = extractBindingsOfType("version_metadata", bindings);
  const vars = Object.entries(bindings ?? {}).filter(
    ([_5, binding]) => binding.type === "plain_text" || binding.type === "json" || binding.type === "secret_text"
  ).map(([name2, binding]) => ({
    binding: name2,
    ...binding
  }));
  const wasm_modules = extractBindingsOfType("wasm_module", bindings);
  const dispatch_namespaces = extractBindingsOfType(
    "dispatch_namespace",
    bindings
  );
  const mtls_certificates = extractBindingsOfType("mtls_certificate", bindings);
  const pipelines = extractBindingsOfType("pipeline", bindings);
  const ratelimits = extractBindingsOfType("ratelimit", bindings);
  const assets = extractBindingsOfType("assets", bindings);
  const unsafe_hello_world = extractBindingsOfType(
    "unsafe_hello_world",
    bindings
  );
  const flagship = extractBindingsOfType("flagship", bindings);
  const media = extractBindingsOfType("media", bindings);
  const worker_loaders = extractBindingsOfType("worker_loader", bindings);
  const unsafe_bindings = Object.entries(bindings ?? {}).filter(
    ([_5, binding]) => isUnsafeBindingType(binding.type) && binding.type !== "unsafe_hello_world"
  ).map(([name2, binding]) => ({ name: name2, ...binding }));
  if (data_blobs.length > 0) {
    output.push(
      ...data_blobs.map(({ binding, source }) => ({
        name: binding,
        type: getBindingTypeFriendlyName("data_blob"),
        value: "contents" in source ? "<Buffer>" : truncate4(source.path),
        mode: getMode({ isSimulatedLocally: true })
      }))
    );
  }
  if (durable_objects.length > 0) {
    output.push(
      ...durable_objects.map(({ name: name2, class_name, script_name }) => {
        let value = class_name;
        let mode = void 0;
        if (script_name) {
          if (context2.local && context2.registry !== null) {
            const registryDefinition = context2.registry?.[script_name];
            hasConnectionStatus = true;
            if (registryDefinition && registryDefinition.durableObjects.some(
              (d8) => d8.className === class_name
            )) {
              value += `, defined in ${script_name}`;
              mode = getMode({ isSimulatedLocally: true, connected: true });
            } else {
              value += `, defined in ${script_name}`;
              mode = getMode({ isSimulatedLocally: true, connected: false });
            }
          } else {
            value += `, defined in ${script_name}`;
            mode = getMode({ isSimulatedLocally: true });
          }
        } else {
          mode = getMode({ isSimulatedLocally: true });
        }
        return {
          name: name2,
          type: getBindingTypeFriendlyName("durable_object_namespace"),
          value,
          mode
        };
      })
    );
  }
  if (workflows.length > 0) {
    output.push(
      ...workflows.map(({ class_name, script_name, binding, remote }) => {
        let value = class_name;
        if (script_name) {
          value += ` (defined in ${script_name})`;
        }
        return {
          name: binding,
          type: getBindingTypeFriendlyName("workflow"),
          value,
          mode: getMode({
            isSimulatedLocally: script_name && !context2.remoteBindingsDisabled ? !remote : true
          })
        };
      })
    );
  }
  if (kv_namespaces.length > 0) {
    output.push(
      ...kv_namespaces.map(({ binding, id, remote }) => {
        return {
          name: binding,
          type: getBindingTypeFriendlyName("kv_namespace"),
          value: id,
          mode: getMode({
            isSimulatedLocally: context2.remoteBindingsDisabled || !remote
          })
        };
      })
    );
  }
  if (send_email.length > 0) {
    output.push(
      ...send_email.map((emailBinding) => {
        const destination_address = "destination_address" in emailBinding ? emailBinding.destination_address : void 0;
        const allowed_destination_addresses = "allowed_destination_addresses" in emailBinding ? emailBinding.allowed_destination_addresses : void 0;
        const allowed_sender_addresses = "allowed_sender_addresses" in emailBinding ? emailBinding.allowed_sender_addresses : void 0;
        let value = destination_address || allowed_destination_addresses?.join(", ") || "unrestricted";
        if (allowed_sender_addresses) {
          value += ` - senders: ${allowed_sender_addresses.join(", ")}`;
        }
        return {
          name: emailBinding.name,
          type: getBindingTypeFriendlyName("send_email"),
          value,
          mode: getMode({
            isSimulatedLocally: context2.remoteBindingsDisabled || !emailBinding.remote
          })
        };
      })
    );
  }
  if (queues.length > 0) {
    output.push(
      ...queues.map(({ binding, queue_name, remote }) => {
        return {
          name: binding,
          type: getBindingTypeFriendlyName("queue"),
          value: queue_name,
          mode: getMode({
            isSimulatedLocally: context2.remoteBindingsDisabled || !remote
          })
        };
      })
    );
  }
  if (d1_databases.length > 0) {
    output.push(
      ...d1_databases.map(
        ({
          binding,
          database_name,
          database_id,
          preview_database_id,
          remote
        }) => {
          const value = typeof database_id == "symbol" ? database_id : preview_database_id ?? database_name ?? database_id;
          return {
            name: binding,
            type: getBindingTypeFriendlyName("d1"),
            mode: getMode({
              isSimulatedLocally: context2.remoteBindingsDisabled || !remote
            }),
            value
          };
        }
      )
    );
  }
  if (vectorize.length > 0) {
    output.push(
      ...vectorize.map(({ binding, index_name, remote }) => {
        return {
          name: binding,
          type: getBindingTypeFriendlyName("vectorize"),
          value: index_name,
          mode: getMode({
            isSimulatedLocally: remote && !context2.remoteBindingsDisabled ? false : void 0
          })
        };
      })
    );
  }
  if (ai_search_namespaces.length > 0) {
    output.push(
      ...ai_search_namespaces.map(({ binding, namespace }) => ({
        name: binding,
        type: getBindingTypeFriendlyName("ai_search_namespace"),
        value: namespace ? String(namespace) : void 0,
        mode: getMode({ isSimulatedLocally: false })
      }))
    );
  }
  if (ai_search.length > 0) {
    output.push(
      ...ai_search.map(({ binding, instance_name }) => ({
        name: binding,
        type: getBindingTypeFriendlyName("ai_search"),
        value: instance_name ? String(instance_name) : void 0,
        mode: getMode({ isSimulatedLocally: false })
      }))
    );
  }
  if (hyperdrive.length > 0) {
    output.push(
      ...hyperdrive.map(({ binding, id }) => {
        return {
          name: binding,
          type: getBindingTypeFriendlyName("hyperdrive"),
          value: id,
          mode: getMode({ isSimulatedLocally: true })
        };
      })
    );
  }
  if (vpc_services.length > 0) {
    output.push(
      ...vpc_services.map(({ binding, service_id, remote }) => {
        return {
          name: binding,
          type: getBindingTypeFriendlyName("vpc_service"),
          value: service_id,
          mode: getMode({
            isSimulatedLocally: remote && !context2.remoteBindingsDisabled ? false : void 0
          })
        };
      })
    );
  }
  if (vpc_networks.length > 0) {
    output.push(
      ...vpc_networks.map(({ binding, tunnel_id, network_id, remote }) => {
        return {
          name: binding,
          type: getBindingTypeFriendlyName("vpc_network"),
          value: tunnel_id ?? network_id,
          mode: getMode({
            isSimulatedLocally: remote && !context2.remoteBindingsDisabled ? false : void 0
          })
        };
      })
    );
  }
  if (r2_buckets.length > 0) {
    output.push(
      ...r2_buckets.map(({ binding, bucket_name, jurisdiction, remote }) => {
        const value = typeof bucket_name === "symbol" ? bucket_name : bucket_name ? `${bucket_name}${jurisdiction ? ` (${jurisdiction})` : ""}` : void 0;
        return {
          name: binding,
          type: getBindingTypeFriendlyName("r2_bucket"),
          value,
          mode: getMode({
            isSimulatedLocally: context2.remoteBindingsDisabled || !remote
          })
        };
      })
    );
  }
  if (logfwdr.length > 0) {
    output.push(
      ...logfwdr.map(({ name: name2, destination }) => {
        return {
          name: name2,
          type: getBindingTypeFriendlyName("logfwdr"),
          value: destination,
          mode: getMode()
        };
      })
    );
  }
  if (secrets_store_secrets.length > 0) {
    output.push(
      ...secrets_store_secrets.map(({ binding, store_id, secret_name }) => {
        return {
          name: binding,
          type: getBindingTypeFriendlyName("secrets_store_secret"),
          value: `${store_id}/${secret_name}`,
          mode: getMode({ isSimulatedLocally: true })
        };
      })
    );
  }
  if (unsafe_hello_world.length > 0) {
    output.push(
      ...unsafe_hello_world.map(({ binding, enable_timer }) => {
        return {
          name: binding,
          type: getBindingTypeFriendlyName("unsafe_hello_world"),
          value: enable_timer ? `Timer enabled` : `Timer disabled`,
          mode: getMode({ isSimulatedLocally: true })
        };
      })
    );
  }
  if (flagship.length > 0) {
    output.push(
      ...flagship.map(({ binding, app_id, remote }) => {
        return {
          name: binding,
          type: getBindingTypeFriendlyName("flagship"),
          value: app_id,
          mode: getMode({
            isSimulatedLocally: context2.remoteBindingsDisabled || !remote
          })
        };
      })
    );
  }
  if (services.length > 0) {
    output.push(
      ...services.map(({ binding, service, entrypoint, remote }) => {
        let value = service;
        let mode = void 0;
        if (entrypoint) {
          value += `#${entrypoint}`;
        }
        if (remote) {
          mode = getMode({ isSimulatedLocally: false });
        } else if (context2.local && context2.registry !== null) {
          const isSelfBinding = service === context2.name;
          if (isSelfBinding) {
            hasConnectionStatus = true;
            mode = getMode({ isSimulatedLocally: true, connected: true });
          } else {
            const registryDefinition = context2.registry?.[service];
            hasConnectionStatus = true;
            if (registryDefinition && (!entrypoint || registryDefinition.entrypointAddresses?.[entrypoint])) {
              mode = getMode({ isSimulatedLocally: true, connected: true });
            } else {
              mode = getMode({ isSimulatedLocally: true, connected: false });
            }
          }
        }
        return {
          name: binding,
          type: getBindingTypeFriendlyName("service"),
          value,
          mode
        };
      })
    );
  }
  if (analytics_engine_datasets.length > 0) {
    output.push(
      ...analytics_engine_datasets.map(({ binding, dataset }) => {
        return {
          name: binding,
          type: getBindingTypeFriendlyName("analytics_engine"),
          value: dataset ?? binding,
          mode: getMode({ isSimulatedLocally: true })
        };
      })
    );
  }
  if (text_blobs.length > 0) {
    output.push(
      ...text_blobs.map(({ binding, source }) => ({
        name: binding,
        type: getBindingTypeFriendlyName("text_blob"),
        value: "contents" in source ? truncate4(source.contents) : "path" in source ? truncate4(source.path) : void 0,
        mode: getMode({ isSimulatedLocally: true })
      }))
    );
  }
  if (browser.length > 0) {
    output.push(
      ...browser.map(({ binding, remote }) => ({
        name: binding,
        type: getBindingTypeFriendlyName("browser"),
        value: void 0,
        mode: getMode({
          isSimulatedLocally: context2.remoteBindingsDisabled || !remote
        })
      }))
    );
  }
  if (images.length > 0) {
    output.push(
      ...images.map(({ binding, remote }) => ({
        name: binding,
        type: getBindingTypeFriendlyName("images"),
        value: void 0,
        mode: getMode({
          isSimulatedLocally: context2.remoteBindingsDisabled || !remote
        })
      }))
    );
  }
  if (stream2.length > 0) {
    output.push(
      ...stream2.map(({ binding, remote }) => ({
        name: binding,
        type: getBindingTypeFriendlyName("stream"),
        value: void 0,
        mode: getMode({
          isSimulatedLocally: (remote === true || remote === void 0) && !context2.remoteBindingsDisabled ? false : void 0
        })
      }))
    );
  }
  if (media.length > 0) {
    output.push(
      ...media.map(({ binding, remote }) => ({
        name: binding,
        type: getBindingTypeFriendlyName("media"),
        value: void 0,
        mode: getMode({
          isSimulatedLocally: (remote === true || remote === void 0) && !context2.remoteBindingsDisabled ? false : void 0
        })
      }))
    );
  }
  if (ai2.length > 0) {
    output.push(
      ...ai2.map(({ binding, staging, remote }) => ({
        name: binding,
        type: getBindingTypeFriendlyName("ai"),
        value: staging ? `staging` : void 0,
        mode: getMode({
          isSimulatedLocally: (remote === true || remote === void 0) && !context2.remoteBindingsDisabled ? false : void 0
        })
      }))
    );
  }
  if (pipelines.length > 0) {
    output.push(
      ...pipelines.map(({ binding, pipeline, remote }) => ({
        name: binding,
        type: getBindingTypeFriendlyName("pipeline"),
        value: pipeline,
        mode: getMode({
          isSimulatedLocally: context2.remoteBindingsDisabled || !remote
        })
      }))
    );
  }
  if (ratelimits.length > 0) {
    output.push(
      ...ratelimits.map(({ name: name2, simple }) => ({
        name: name2,
        type: getBindingTypeFriendlyName("ratelimit"),
        value: `${simple.limit} requests/${simple.period}s`,
        mode: getMode({ isSimulatedLocally: true })
      }))
    );
  }
  if (assets.length > 0) {
    output.push(
      ...assets.map(({ binding }) => ({
        name: binding,
        type: getBindingTypeFriendlyName("assets"),
        value: void 0,
        mode: getMode({ isSimulatedLocally: true })
      }))
    );
  }
  if (version_metadata.length > 0) {
    output.push(
      ...version_metadata.map(({ binding }) => ({
        name: binding,
        type: getBindingTypeFriendlyName("version_metadata"),
        value: void 0,
        mode: getMode({ isSimulatedLocally: true })
      }))
    );
  }
  if (unsafe_bindings.length > 0) {
    output.push(
      ...unsafe_bindings.map((binding) => {
        const dev2 = "dev" in binding ? binding.dev : void 0;
        const originalType = binding.type.slice("unsafe_".length);
        return {
          name: binding.name,
          type: dev2 ? dev2.plugin.name : getBindingTypeFriendlyName(binding.type),
          value: originalType,
          mode: getMode({
            isSimulatedLocally: !!dev2
          })
        };
      })
    );
  }
  if (vars.length > 0) {
    output.push(
      ...vars.map((variable) => {
        const { binding, type: varType, value: varValue } = variable;
        let parsedValue;
        if (varType === "plain_text" && variable.hidden !== true) {
          parsedValue = `"${truncate4(varValue)}"`;
        } else if (varType === "json") {
          parsedValue = truncate4(JSON.stringify(varValue));
        } else {
          parsedValue = `"(hidden)"`;
        }
        return {
          name: binding,
          type: getBindingTypeFriendlyName(varType),
          value: parsedValue,
          mode: getMode({ isSimulatedLocally: true })
        };
      })
    );
  }
  if (wasm_modules.length > 0) {
    output.push(
      ...wasm_modules.map(({ binding, source }) => ({
        name: binding,
        type: getBindingTypeFriendlyName("wasm_module"),
        value: "contents" in source ? "<Wasm>" : truncate4(source.path),
        mode: getMode({ isSimulatedLocally: true })
      }))
    );
  }
  if (dispatch_namespaces.length > 0) {
    output.push(
      ...dispatch_namespaces.map(({ binding, namespace, outbound, remote }) => {
        return {
          name: binding,
          type: getBindingTypeFriendlyName("dispatch_namespace"),
          value: outbound ? `${namespace} (outbound -> ${outbound.service})` : namespace,
          mode: getMode({
            isSimulatedLocally: remote && !context2.remoteBindingsDisabled ? false : void 0
          })
        };
      })
    );
  }
  if (mtls_certificates.length > 0) {
    output.push(
      ...mtls_certificates.map(({ binding, certificate_id, remote }) => {
        return {
          name: binding,
          type: getBindingTypeFriendlyName("mtls_certificate"),
          value: certificate_id,
          mode: getMode({
            isSimulatedLocally: remote && !context2.remoteBindingsDisabled ? false : void 0
          })
        };
      })
    );
  }
  if (worker_loaders.length > 0) {
    output.push(
      ...worker_loaders.map(({ binding }) => ({
        name: binding,
        type: getBindingTypeFriendlyName("worker_loader"),
        value: void 0,
        mode: getMode({ isSimulatedLocally: true })
      }))
    );
  }
  if (output.length === 0) {
    if (context2.warnIfNoBindings) {
      if (context2.name && isMultiWorker) {
        log2(`No bindings found for ${source_default.blue(context2.name)}`);
      } else {
        log2("No bindings found.");
      }
    }
  } else {
    let title2;
    if (context2.provisioning) {
      title2 = `${source_default.red("Experimental:")} The following bindings need to be provisioned:`;
    } else if (context2.name && isMultiWorker) {
      title2 = `${source_default.blue(context2.name)} has access to the following bindings:`;
    } else {
      title2 = "Your Worker has access to the following bindings:";
    }
    const headings = {
      binding: "Binding",
      resource: "Resource",
      mode: "Mode"
    };
    const maxValueLength = Math.max(
      ...output.map(
        (b11) => typeof b11.value === "symbol" ? "inherited".length : b11.value?.length ?? 0
      )
    );
    const maxNameLength = Math.max(...output.map((b11) => b11.name.length));
    const maxTypeLength = Math.max(
      ...output.map((b11) => b11.type.length),
      headings.resource.length
    );
    const maxModeLength = Math.max(
      ...output.map(
        (b11) => b11.mode ? util4.stripVTControlCharacters(b11.mode).length : headings.mode.length
      )
    );
    const hasMode = output.some((b11) => b11.mode);
    const bindingPrefix = `env.`;
    const bindingLength = bindingPrefix.length + maxNameLength + " (".length + maxValueLength + ")".length;
    const columnGapSpaces = 6;
    const columnGapSpacesWrapped = 4;
    const shouldWrap = bindingLength + columnGapSpaces + maxTypeLength + columnGapSpaces + maxModeLength >= process.stdout.columns;
    log2(title2);
    const columnGap = shouldWrap ? " ".repeat(columnGapSpacesWrapped) : " ".repeat(columnGapSpaces);
    log2(
      `${padEndAnsi(dim(headings.binding), shouldWrap ? bindingPrefix.length + maxNameLength : bindingLength)}${columnGap}${padEndAnsi(dim(headings.resource), maxTypeLength)}${columnGap}${hasMode ? dim(headings.mode) : ""}`
    );
    for (const binding of output) {
      const bindingValue = dim(
        typeof binding.value === "symbol" ? source_default.italic("inherited") : binding.value ?? ""
      );
      const bindingString = padEndAnsi(
        `${white(`env.${binding.name}`)}${binding.value && !shouldWrap ? ` (${bindingValue})` : ""}`,
        shouldWrap ? bindingPrefix.length + maxNameLength : bindingLength
      );
      const suffix = shouldWrap ? binding.value ? `
  ${bindingValue}` : "" : "";
      log2(
        `${bindingString}${columnGap}${brandColor(binding.type.padEnd(maxTypeLength))}${columnGap}${hasMode ? binding.mode : ""}${suffix}`
      );
    }
    log2("");
  }
  let title;
  if (context2.name && isMultiWorker) {
    title = `${source_default.blue(context2.name)} is sending Tail events to the following Workers:`;
  } else {
    title = "Your Worker is sending Tail events to the following Workers:";
  }
  const allTailConsumers = [
    ...(tailConsumers ?? []).map((c8) => ({
      service: c8.service,
      streaming: false
    })),
    ...(streamingTailConsumers ?? []).map((c8) => ({
      service: c8.service,
      streaming: true
    }))
  ];
  if (allTailConsumers.length > 0) {
    log2(
      `${title}
${allTailConsumers.map(({ service, streaming }) => {
        const displayName = `${service}${streaming ? ` (streaming)` : ""}`;
        if (context2.local && context2.registry !== null) {
          const registryDefinition = context2.registry?.[service];
          hasConnectionStatus = true;
          if (registryDefinition) {
            return `- ${displayName} ${source_default.green("[connected]")}`;
          } else {
            return `- ${displayName} ${source_default.red("[not connected]")}`;
          }
        } else {
          return `- ${displayName}`;
        }
      }).join("\n")}`
    );
  }
  if (containers.length > 0 && !context2.provisioning) {
    let containersTitle = "The following containers are available:";
    if (context2.name && isMultiWorker) {
      containersTitle = `The following containers are available from ${source_default.blue(context2.name)}:`;
    }
    log2(
      `${containersTitle}
${containers.map((c8) => `- ${c8.name} (${c8.image})`).join("\n")}`
    );
    log2("");
  }
  if (context2.unsafeMetadata) {
    log2("The following unsafe metadata will be attached to your Worker:");
    log2(JSON.stringify(context2.unsafeMetadata, null, 2));
  }
  if (hasConnectionStatus && !isConnectedStatusExplained) {
    log2(
      dim(
        `
Service bindings, Durable Object bindings, and Tail consumers connect to other Wrangler or Vite dev processes running locally, with their connection status indicated by ${source_default.green("[connected]")} or ${source_default.red("[not connected]")}. For more details, refer to https://developers.cloudflare.com/workers/runtime-apis/bindings/service-bindings/#local-development
`
      )
    );
    isConnectedStatusExplained = true;
  }
}
function padEndAnsi(str, length) {
  return str + " ".repeat(Math.max(0, length - util4.stripVTControlCharacters(str).length));
}
function createGetMode({
  isProvisioning = false,
  isLocalDev = false
}) {
  return /* @__PURE__ */ __name(function bindingMode({
    isSimulatedLocally,
    connected
  } = {}) {
    if (isProvisioning || !isLocalDev) {
      return void 0;
    }
    if (isSimulatedLocally === void 0) {
      return dim("not supported");
    }
    return `${isSimulatedLocally ? source_default.blue("local") : source_default.yellow("remote")}${connected === void 0 ? "" : connected ? source_default.green(" [connected]") : source_default.red(" [not connected]")}`;
  }, "bindingMode");
}
function warnOrError(type, remote, supports2) {
  if (remote === true && supports2 === "local") {
    throw new UserError(
      `${getBindingTypeFriendlyName(type)} bindings do not support accessing remote resources.`,
      {
        telemetryMessage: true
      }
    );
  }
  if (remote === false && supports2 === "remote") {
    throw new UserError(
      `${getBindingTypeFriendlyName(type)} bindings do not support local development. You may be able to set \`remote: true\` for the binding definition in your configuration file to access a remote version of the resource.`,
      {
        telemetryMessage: true
      }
    );
  }
  if (remote === void 0 && supports2 === "remote") {
    logger.warn(
      `${getBindingTypeFriendlyName(type)} bindings do not support local development, and so parts of your Worker may not work correctly. You may be able to set \`remote: true\` for the binding definition in your configuration file to access a remote version of the resource.`
    );
  }
  if (remote === void 0 && supports2 === "always-remote") {
    logger.warn(
      `${getBindingTypeFriendlyName(type)} bindings always access remote resources, and so may incur usage charges even in local dev. To suppress this warning, set \`remote: true\` for the binding definition in your configuration file.`
    );
  }
}
var isConnectedStatusExplained;
var init_print_bindings = __esm({
  "src/utils/print-bindings.ts"() {
    init_import_meta_url();
    init_colors();
    init_dist();
    init_source();
    init_utils2();
    init_experimental_flags();
    init_logger();
    isConnectedStatusExplained = false;
    __name(printBindings, "printBindings");
    __name(padEndAnsi, "padEndAnsi");
    __name(createGetMode, "createGetMode");
    __name(warnOrError, "warnOrError");
  }
});

// src/dev/class-names-sqlite.ts
function getDurableObjectClassNameToUseSQLiteMap(migrations) {
  const durableObjectClassNameToUseSQLiteMap = /* @__PURE__ */ new Map();
  (migrations || []).forEach((migration) => {
    migration.deleted_classes?.forEach((deleted_class) => {
      if (!durableObjectClassNameToUseSQLiteMap.delete(deleted_class)) {
        throw new UserError(
          `Cannot apply deleted_classes migration to non-existent class ${deleted_class}`
        );
      }
    });
    migration.renamed_classes?.forEach(({ from, to }) => {
      const useSQLite = durableObjectClassNameToUseSQLiteMap.get(from);
      if (useSQLite === void 0) {
        throw new UserError(
          `Cannot apply renamed_classes migration to non-existent class ${from}`
        );
      } else {
        durableObjectClassNameToUseSQLiteMap.delete(from);
        durableObjectClassNameToUseSQLiteMap.set(to, useSQLite);
      }
    });
    migration.new_classes?.forEach((new_class) => {
      if (durableObjectClassNameToUseSQLiteMap.has(new_class)) {
        throw new UserError(
          `Cannot apply new_classes migration to existing class ${new_class}`
        );
      } else {
        durableObjectClassNameToUseSQLiteMap.set(new_class, false);
      }
    });
    migration.new_sqlite_classes?.forEach((new_class) => {
      if (durableObjectClassNameToUseSQLiteMap.has(new_class)) {
        throw new UserError(
          `Cannot apply new_sqlite_classes migration to existing class ${new_class}`
        );
      } else {
        durableObjectClassNameToUseSQLiteMap.set(new_class, true);
      }
    });
  });
  return durableObjectClassNameToUseSQLiteMap;
}
var init_class_names_sqlite = __esm({
  "src/dev/class-names-sqlite.ts"() {
    init_import_meta_url();
    init_dist();
    __name(getDurableObjectClassNameToUseSQLiteMap, "getDurableObjectClassNameToUseSQLiteMap");
  }
});
function getName(config) {
  return config.name ?? DEFAULT_WORKER_NAME;
}
function getIdentifier(name2) {
  return name2.replace(IDENTIFIER_UNSAFE_REGEXP, "_");
}
function castLogLevel(level) {
  let key = level.toUpperCase();
  if (key === "LOG") {
    key = "INFO";
  }
  return miniflare.LogLevel[key];
}
function buildLog() {
  const level = castLogLevel(logger.loggerLevel);
  return new WranglerLog(level, {
    prefix: level === miniflare.LogLevel.DEBUG ? "wrangler-UserWorker" : "wrangler"
  });
}
async function buildSourceOptions(config) {
  const scriptPath4 = config.bundle.path;
  if (config.format === "modules") {
    const isPython = config.bundle.type === "python";
    const { entrypointSource, modules } = isPython ? {
      entrypointSource: config.bundle.entrypointSource,
      modules: config.bundle.modules
    } : withSourceURLs(
      scriptPath4,
      config.bundle.entrypointSource,
      config.bundle.modules
    );
    const entrypointNames = isPython ? [] : config.bundle.entry.exports;
    const modulesRoot = path3__namespace.default.dirname(scriptPath4);
    const sourceOptions = {
      modulesRoot,
      modules: [
        // Entrypoint
        {
          type: ModuleTypeToRuleType[config.bundle.type],
          path: scriptPath4,
          contents: entrypointSource
        },
        // Misc (WebAssembly, etc, ...)
        ...modules.map((module2) => ({
          type: ModuleTypeToRuleType[module2.type ?? "esm"],
          path: path3__namespace.default.resolve(modulesRoot, module2.name),
          contents: module2.content
        }))
      ]
    };
    return { sourceOptions, entrypointNames };
  } else {
    return {
      sourceOptions: { script: config.bundle.entrypointSource, scriptPath: scriptPath4 },
      entrypointNames: []
    };
  }
}
function getRemoteId(id) {
  return typeof id === "string" ? id : null;
}
function kvNamespaceEntry({ binding, id: originalId, remote }, remoteProxyConnectionString) {
  const id = getRemoteId(originalId) ?? binding;
  if (!remoteProxyConnectionString || !remote) {
    return [binding, { id }];
  }
  return [binding, { id, remoteProxyConnectionString }];
}
function r2BucketEntry({ binding, bucket_name, remote }, remoteProxyConnectionString) {
  const id = getRemoteId(bucket_name) ?? binding;
  if (!remoteProxyConnectionString || !remote) {
    return [binding, { id }];
  }
  return [binding, { id, remoteProxyConnectionString }];
}
function d1DatabaseEntry({ binding, database_id, preview_database_id, remote }, remoteProxyConnectionString) {
  const id = getRemoteId(preview_database_id ?? database_id) ?? binding;
  if (!remoteProxyConnectionString || !remote) {
    return [binding, { id }];
  }
  return [binding, { id, remoteProxyConnectionString }];
}
function queueProducerEntry({
  binding,
  queue_name: queueName,
  delivery_delay: deliveryDelay,
  remote
}, remoteProxyConnectionString) {
  if (!remoteProxyConnectionString || !remote) {
    return [binding, { queueName, deliveryDelay }];
  }
  return [binding, { queueName, deliveryDelay, remoteProxyConnectionString }];
}
function pipelineEntry(pipeline, remoteProxyConnectionString) {
  if (!remoteProxyConnectionString || !pipeline.remote) {
    return [pipeline.binding, { pipeline: pipeline.pipeline }];
  }
  return [
    pipeline.binding,
    { pipeline: pipeline.pipeline, remoteProxyConnectionString }
  ];
}
function hyperdriveEntry(hyperdrive) {
  return [hyperdrive.binding, hyperdrive.localConnectionString ?? ""];
}
function workflowEntry({
  binding,
  name: name2,
  class_name: className,
  script_name: scriptName,
  remote,
  limits
}, remoteProxyConnectionString) {
  const stepLimit = limits?.steps;
  if (!remoteProxyConnectionString || !remote) {
    return [
      binding,
      {
        name: name2,
        className,
        scriptName,
        ...stepLimit !== void 0 && { stepLimit }
      }
    ];
  }
  return [
    binding,
    {
      name: name2,
      className,
      scriptName,
      remoteProxyConnectionString,
      ...stepLimit !== void 0 && { stepLimit }
    }
  ];
}
function dispatchNamespaceEntry({ binding, namespace, remote }, remoteProxyConnectionString) {
  if (!remoteProxyConnectionString || !remote) {
    return [binding, { namespace }];
  }
  return [binding, { namespace, remoteProxyConnectionString }];
}
function ratelimitEntry(ratelimit) {
  return [ratelimit.name, ratelimit];
}
function queueConsumerEntry(consumer) {
  const options = {
    maxBatchSize: consumer.max_batch_size,
    maxBatchTimeout: consumer.max_batch_timeout,
    maxRetries: consumer.max_retries,
    deadLetterQueue: consumer.dead_letter_queue,
    retryDelay: consumer.retry_delay
  };
  return [consumer.queue, options];
}
function buildMiniflareBindingOptions(config, remoteProxyConnectionString) {
  const bindings = config.bindings;
  const textBlobs = extractBindingsOfType("text_blob", bindings);
  const dataBlobs = extractBindingsOfType("data_blob", bindings);
  const wasmModules = extractBindingsOfType("wasm_module", bindings);
  const plainTextBindings = extractBindingsOfType("plain_text", bindings);
  const secretTextBindings = extractBindingsOfType("secret_text", bindings);
  const jsonBindings = extractBindingsOfType("json", bindings);
  const kvNamespaces = extractBindingsOfType("kv_namespace", bindings);
  const r2Buckets = extractBindingsOfType("r2_bucket", bindings);
  const d1Databases = extractBindingsOfType("d1", bindings);
  const queues = extractBindingsOfType("queue", bindings);
  const pipelines = extractBindingsOfType("pipeline", bindings);
  const hyperdrives = extractBindingsOfType("hyperdrive", bindings);
  const workflows = extractBindingsOfType("workflow", bindings);
  const durableObjects = extractBindingsOfType(
    "durable_object_namespace",
    bindings
  );
  const services = extractBindingsOfType("service", bindings);
  const analyticsEngineDatasets = extractBindingsOfType(
    "analytics_engine",
    bindings
  );
  const dispatchNamespaces = extractBindingsOfType(
    "dispatch_namespace",
    bindings
  );
  const mtlsCertificates = extractBindingsOfType("mtls_certificate", bindings);
  const vectorizeBindings = extractBindingsOfType("vectorize", bindings);
  const vpcServices = extractBindingsOfType("vpc_service", bindings);
  const vpcNetworks = extractBindingsOfType("vpc_network", bindings);
  const secretsStoreSecrets = extractBindingsOfType(
    "secrets_store_secret",
    bindings
  );
  const helloWorldBindings = extractBindingsOfType(
    "unsafe_hello_world",
    bindings
  );
  const flagshipBindings = extractBindingsOfType("flagship", bindings);
  const workerLoaders = extractBindingsOfType("worker_loader", bindings);
  const sendEmailBindings = extractBindingsOfType("send_email", bindings);
  const ratelimits = [
    ...extractBindingsOfType("ratelimit", bindings),
    ...extractBindingsOfType("unsafe_ratelimit", bindings)
  ];
  const aiBindings = extractBindingsOfType("ai", bindings);
  const aiSearchNamespaceBindings = extractBindingsOfType(
    "ai_search_namespace",
    bindings
  );
  const aiSearchInstanceBindings = extractBindingsOfType("ai_search", bindings);
  const imagesBindings = extractBindingsOfType("images", bindings);
  const mediaBindings = extractBindingsOfType("media", bindings);
  const browserBindings = extractBindingsOfType("browser", bindings);
  const versionMetadataBindings = extractBindingsOfType(
    "version_metadata",
    bindings
  );
  const streamBindings = extractBindingsOfType("stream", bindings);
  const fetchers = extractBindingsOfType("fetcher", bindings);
  const textBlobBindings = {};
  for (const blob of textBlobs) {
    if ("path" in blob.source && blob.source.path) {
      textBlobBindings[blob.binding] = blob.source.path;
    } else if ("contents" in blob.source) {
      textBlobBindings[blob.binding] = blob.source.contents;
    }
  }
  const dataBlobBindings = {};
  for (const blob of dataBlobs) {
    if ("path" in blob.source && blob.source.path) {
      dataBlobBindings[blob.binding] = blob.source.path;
    } else if ("contents" in blob.source) {
      dataBlobBindings[blob.binding] = blob.source.contents;
    }
  }
  const wasmBindings = {};
  for (const wasm of wasmModules) {
    if ("path" in wasm.source && wasm.source.path) {
      wasmBindings[wasm.binding] = wasm.source.path;
    } else if ("contents" in wasm.source) {
      wasmBindings[wasm.binding] = wasm.source.contents;
    }
  }
  if (config.format === "service-worker" && config.bundle) {
    const scriptPath4 = config.bundle.path;
    const modulesRoot = path3__namespace.default.dirname(scriptPath4);
    for (const { type, name: name2 } of config.bundle.modules) {
      if (type === "text") {
        textBlobBindings[getIdentifier(name2)] = path3__namespace.default.resolve(modulesRoot, name2);
      } else if (type === "buffer") {
        dataBlobBindings[getIdentifier(name2)] = path3__namespace.default.resolve(modulesRoot, name2);
      } else if (type === "compiled-wasm") {
        wasmBindings[getIdentifier(name2)] = path3__namespace.default.resolve(modulesRoot, name2);
      }
    }
  }
  const serviceBindings = Object.fromEntries(fetchers.map((f8) => [f8.binding, f8.fetcher]));
  for (const service of services) {
    if (remoteProxyConnectionString && service.remote) {
      serviceBindings[service.binding] = {
        name: service.service,
        props: service.props,
        entrypoint: service.entrypoint,
        remoteProxyConnectionString
      };
      continue;
    }
    serviceBindings[service.binding] = {
      name: service.service,
      entrypoint: service.entrypoint,
      props: service.props
    };
  }
  const tails = [];
  for (const tail of config.tails ?? []) {
    tails.push({ name: tail.service });
  }
  const streamingTails = [];
  for (const streamingTail of config.streamingTails ?? []) {
    streamingTails.push({ name: streamingTail.service });
  }
  const classNameToUseSQLite = getDurableObjectClassNameToUseSQLiteMap(
    config.migrations
  );
  const externalWorkers = [];
  const wrappedBindings = {};
  for (const ai2 of aiBindings) {
    warnOrError("ai", ai2.remote, "always-remote");
  }
  for (const ns of aiSearchNamespaceBindings) {
    warnOrError("ai_search_namespace", ns.remote, "always-remote");
  }
  for (const inst of aiSearchInstanceBindings) {
    warnOrError("ai_search", inst.remote, "always-remote");
  }
  for (const media of mediaBindings) {
    warnOrError("media", media.remote, "always-remote");
  }
  const unsafeBindings = [];
  const unsafeBindingsWithLocalDev = Object.entries(bindings ?? {}).filter(
    (b11) => isUnsafeServiceBindingWithDevCfg(b11[1])
  );
  for (const [name2, unsafeBinding] of unsafeBindingsWithLocalDev) {
    assert53__default.default(isUnsafeServiceBindingWithDevCfg(unsafeBinding));
    const {
      type,
      dev: {
        plugin,
        options: devOptions
      },
      // additional options that are included in the production binding
      ...options
    } = unsafeBinding;
    logger.debug(
      `Binding ${name2} is a local binding to plugin ${plugin.name} provided by package ${plugin.package}`
    );
    unsafeBindings.push({
      name: name2,
      type: type.slice("unsafe_".length),
      plugin,
      options: {
        ...options,
        ...devOptions
      }
    });
  }
  const additionalUnboundDurableObjects = [];
  for (const [className, useSQLite] of classNameToUseSQLite) {
    if (!durableObjects.find((d8) => d8.class_name === className)) {
      additionalUnboundDurableObjects.push({
        className,
        scriptName: void 0,
        useSQLite,
        container: config.containerDOClassNames?.size && config.enableContainers ? getImageNameFromDOClassName({
          doClassName: className,
          containerDOClassNames: config.containerDOClassNames,
          containerBuildId: config.containerBuildId
        }) : void 0
      });
    }
  }
  const vars = {};
  for (const binding of plainTextBindings) {
    vars[binding.binding] = binding.value;
  }
  for (const binding of secretTextBindings) {
    vars[binding.binding] = binding.value;
  }
  for (const binding of jsonBindings) {
    vars[binding.binding] = binding.value;
  }
  const bindingOptions = {
    bindings: vars,
    versionMetadata: versionMetadataBindings[0]?.binding,
    textBlobBindings,
    dataBlobBindings,
    wasmBindings,
    unsafeBindings,
    ai: aiBindings.length > 0 ? {
      binding: aiBindings[0].binding,
      remoteProxyConnectionString
    } : void 0,
    aiSearchNamespaces: Object.fromEntries(
      aiSearchNamespaceBindings.map((ns) => [
        ns.binding,
        {
          namespace: ns.namespace,
          remoteProxyConnectionString
        }
      ])
    ),
    aiSearchInstances: Object.fromEntries(
      aiSearchInstanceBindings.map((inst) => [
        inst.binding,
        {
          instance_name: inst.instance_name,
          remoteProxyConnectionString
        }
      ])
    ),
    kvNamespaces: Object.fromEntries(
      kvNamespaces.map(
        (kv) => kvNamespaceEntry(kv, remoteProxyConnectionString)
      )
    ),
    r2Buckets: Object.fromEntries(
      r2Buckets.map((r22) => r2BucketEntry(r22, remoteProxyConnectionString))
    ),
    d1Databases: Object.fromEntries(
      d1Databases.map((d1) => d1DatabaseEntry(d1, remoteProxyConnectionString))
    ),
    queueProducers: Object.fromEntries(
      queues.map(
        (queue) => queueProducerEntry(queue, remoteProxyConnectionString)
      )
    ),
    queueConsumers: Object.fromEntries(
      config.queueConsumers?.map(queueConsumerEntry) ?? []
    ),
    pipelines: Object.fromEntries(
      pipelines.map(
        (pipeline) => pipelineEntry(pipeline, remoteProxyConnectionString)
      )
    ),
    hyperdrives: Object.fromEntries(hyperdrives.map(hyperdriveEntry)),
    analyticsEngineDatasets: Object.fromEntries(
      analyticsEngineDatasets.map((binding) => [
        binding.binding,
        { dataset: binding.dataset ?? "dataset" }
      ])
    ),
    workflows: Object.fromEntries(
      workflows.map((workflow) => {
        if (workflow.script_name !== void 0 && workflow.script_name !== config.name && workflow.limits) {
          throw new UserError(
            `Workflow "${workflow.name}" has "limits" configured but references external script "${workflow.script_name}". Configure limits on the worker that defines the workflow.`
          );
        }
        return workflowEntry(workflow, remoteProxyConnectionString);
      })
    ),
    secretsStoreSecrets: Object.fromEntries(
      secretsStoreSecrets.map((binding) => [binding.binding, binding])
    ),
    helloWorld: Object.fromEntries(
      helloWorldBindings.map((binding) => [binding.binding, binding])
    ),
    flagship: Object.fromEntries(
      flagshipBindings.map((binding) => [
        binding.binding,
        {
          app_id: binding.app_id,
          remoteProxyConnectionString: binding.remote && remoteProxyConnectionString ? remoteProxyConnectionString : void 0
        }
      ])
    ),
    workerLoaders: Object.fromEntries(
      workerLoaders.map(({ binding }) => [binding, {}])
    ),
    email: {
      send_email: sendEmailBindings.map(({ type: _type, ...b11 }) => {
        return {
          ...b11,
          remoteProxyConnectionString: b11.remote && remoteProxyConnectionString ? remoteProxyConnectionString : void 0
        };
      })
    },
    images: imagesBindings.length > 0 ? {
      binding: imagesBindings[0].binding,
      remoteProxyConnectionString: imagesBindings[0].remote && remoteProxyConnectionString ? remoteProxyConnectionString : void 0
    } : void 0,
    media: mediaBindings.length > 0 ? {
      binding: mediaBindings[0].binding,
      remoteProxyConnectionString
    } : void 0,
    browserRendering: browserBindings.length > 0 ? {
      binding: browserBindings[0].binding,
      remoteProxyConnectionString: remoteProxyConnectionString && browserBindings[0].remote ? remoteProxyConnectionString : void 0
    } : void 0,
    stream: streamBindings.length > 0 ? {
      binding: streamBindings[0].binding,
      remoteProxyConnectionString: streamBindings[0].remote && remoteProxyConnectionString ? remoteProxyConnectionString : void 0
    } : void 0,
    vectorize: Object.fromEntries(
      vectorizeBindings.map((vectorize) => {
        warnOrError("vectorize", vectorize.remote, "remote");
        return [
          vectorize.binding,
          {
            index_name: vectorize.index_name,
            remoteProxyConnectionString: vectorize.remote && remoteProxyConnectionString ? remoteProxyConnectionString : void 0
          }
        ];
      })
    ),
    vpcServices: Object.fromEntries(
      vpcServices.map((vpc) => {
        warnOrError("vpc_service", vpc.remote, "always-remote");
        return [
          vpc.binding,
          {
            service_id: vpc.service_id,
            remoteProxyConnectionString
          }
        ];
      })
    ),
    vpcNetworks: Object.fromEntries(
      vpcNetworks.map((vpc) => {
        warnOrError("vpc_network", vpc.remote, "always-remote");
        const id = vpc.tunnel_id !== void 0 ? { tunnel_id: vpc.tunnel_id } : { network_id: vpc.network_id };
        return [vpc.binding, { ...id, remoteProxyConnectionString }];
      })
    ),
    dispatchNamespaces: Object.fromEntries(
      dispatchNamespaces.map((dispatchNamespace) => {
        warnOrError("dispatch_namespace", dispatchNamespace.remote, "remote");
        return dispatchNamespaceEntry(
          dispatchNamespace,
          dispatchNamespace.remote && remoteProxyConnectionString ? remoteProxyConnectionString : void 0
        );
      })
    ),
    durableObjects: Object.fromEntries(
      durableObjects.map(
        ({ name: name2, class_name: className, script_name: scriptName }) => {
          return [
            name2,
            {
              className,
              scriptName,
              useSQLite: classNameToUseSQLite.get(className),
              container: config.containerDOClassNames?.size && config.enableContainers ? getImageNameFromDOClassName({
                doClassName: className,
                containerDOClassNames: config.containerDOClassNames,
                containerBuildId: config.containerBuildId
              }) : void 0
            }
          ];
        }
      )
    ),
    additionalUnboundDurableObjects,
    ratelimits: Object.fromEntries(ratelimits.map(ratelimitEntry)),
    mtlsCertificates: Object.fromEntries(
      mtlsCertificates.map((mtlsCertificate) => {
        warnOrError("mtls_certificate", mtlsCertificate.remote, "remote");
        return [
          mtlsCertificate.binding,
          {
            remoteProxyConnectionString: mtlsCertificate.remote && remoteProxyConnectionString ? remoteProxyConnectionString : void 0,
            certificate_id: mtlsCertificate.certificate_id
          }
        ];
      })
    ),
    serviceBindings,
    wrappedBindings,
    tails,
    streamingTails
  };
  return {
    bindingOptions,
    externalWorkers
  };
}
function getDefaultPersistRoot(localPersistencePath) {
  if (localPersistencePath !== false) {
    const v3Path = path3__namespace.default.join(localPersistencePath, "v3");
    return v3Path;
  }
}
function buildAssetOptions(config) {
  if (config.assets) {
    return {
      assets: {
        directory: config.assets.directory,
        binding: config.assets.binding,
        routerConfig: config.assets.routerConfig,
        assetConfig: config.assets.assetConfig
      }
    };
  }
}
function buildSitesOptions({
  legacyAssetPaths
}) {
  if (legacyAssetPaths !== void 0) {
    const { baseDirectory, assetDirectory, includePatterns, excludePatterns } = legacyAssetPaths;
    return {
      sitePath: path3__namespace.default.join(baseDirectory, assetDirectory),
      siteInclude: includePatterns.length > 0 ? includePatterns : void 0,
      siteExclude: excludePatterns.length > 0 ? excludePatterns : void 0
    };
  }
}
async function buildMiniflareOptions(log2, config, proxyToUserWorkerAuthenticationSecret, remoteProxyConnectionString, onDevRegistryUpdate) {
  const upstream = typeof config.localUpstream === "string" ? `${config.upstreamProtocol}://${config.localUpstream}` : void 0;
  const { sourceOptions, entrypointNames } = await buildSourceOptions(config);
  const { bindingOptions, externalWorkers } = buildMiniflareBindingOptions(
    config,
    remoteProxyConnectionString
  );
  if (bindingOptions.browserRendering && getBrowserRenderingHeadfulFromEnv()) {
    bindingOptions.browserRendering.headful = true;
  }
  const sitesOptions = buildSitesOptions(config);
  const defaultPersistRoot = getDefaultPersistRoot(config.localPersistencePath);
  const assetOptions = buildAssetOptions(config);
  const options = {
    host: config.initialIp,
    port: config.initialPort,
    inspectorPort: config.inspect ? config.inspectorPort : void 0,
    inspectorHost: config.inspect ? config.inspectorHost : void 0,
    liveReload: config.liveReload,
    upstream,
    unsafeDevRegistryPath: config.devRegistry,
    unsafeDevRegistryDurableObjectProxy: true,
    unsafeHandleDevRegistryUpdate: onDevRegistryUpdate,
    unsafeProxySharedSecret: proxyToUserWorkerAuthenticationSecret,
    unsafeTriggerHandlers: true,
    unsafeLocalExplorer: getLocalExplorerEnabledFromEnv(),
    telemetry: getMetricsConfig({ sendMetrics: config.sendMetrics }),
    // The way we run Miniflare instances with wrangler dev is that there are two:
    //  - one holding the proxy worker,
    //  - and one holding the user worker.
    // The issue with that setup is that end users would see two sets of request logs from Miniflare!
    // Instead of hiding all logs from this Miniflare instance, we specifically hide the request logs,
    // allowing other logs to be shown to the user (such as details about emails being triggered)
    logRequests: false,
    log: log2,
    verbose: logger.loggerLevel === "debug",
    handleStructuredLogs,
    defaultPersistRoot,
    workers: [
      {
        name: getName(config),
        compatibilityDate: config.compatibilityDate,
        compatibilityFlags: config.compatibilityFlags,
        ...sourceOptions,
        ...bindingOptions,
        ...sitesOptions,
        ...assetOptions,
        // Allow each entrypoint to be accessed directly over `127.0.0.1:0`
        unsafeDirectSockets: entrypointNames.map((name2) => ({
          host: "127.0.0.1",
          port: 0,
          entrypoint: name2,
          proxy: true
        })),
        containerEngine: config.containerEngine,
        zone: config.zone
      },
      ...externalWorkers
    ]
  };
  return options;
}
function getImageNameFromDOClassName(options) {
  assert53__default.default(
    options.containerBuildId,
    "Build ID should be set if containers are defined and enabled"
  );
  if (options.containerDOClassNames.has(options.doClassName)) {
    return {
      imageName: getDevContainerImageName(
        options.doClassName,
        options.containerBuildId
      )
    };
  }
}
function isUnsafeServiceBindingWithDevCfg(b11) {
  return isUnsafeBindingType(b11.type) && "dev" in b11;
}
function handleStructuredLogs({ level, message }) {
  if (level === "warn") {
    return logger.warn(message);
  }
  if (level === "info") {
    return logger.info(message);
  }
  if (level === "debug") {
    return logger.info(message);
  }
  if (level === "error") {
    return logger.error(getSourceMappedString(message));
  }
  return logger.log(getSourceMappedString(message));
}
var EXTERNAL_SERVICE_WORKER_NAME, WranglerLog, DEFAULT_WORKER_NAME, IDENTIFIER_UNSAFE_REGEXP;
var init_miniflare = __esm({
  "src/dev/miniflare/index.ts"() {
    init_import_meta_url();
    init_containers_shared();
    init_dist();
    init_utils2();
    init_module_collection();
    init_source_url();
    init_logger();
    init_metrics();
    init_sourcemap();
    init_update_check();
    init_print_bindings();
    init_class_names_sqlite();
    EXTERNAL_SERVICE_WORKER_NAME = "__WRANGLER_EXTERNAL_DURABLE_OBJECTS_WORKER";
    WranglerLog = class extends miniflare.Log {
      static {
        __name(this, "WranglerLog");
      }
      #warnedCompatibilityDateFallback = false;
      log(message) {
        if (message.includes(EXTERNAL_SERVICE_WORKER_NAME)) {
          return;
        }
        super.log(message);
      }
      warn(message) {
        if (message.startsWith("The latest compatibility date supported by")) {
          if (this.#warnedCompatibilityDateFallback) {
            return;
          }
          this.#warnedCompatibilityDateFallback = true;
          return void updateCheck().then((maybeNewVersion) => {
            if (maybeNewVersion === void 0) {
              return;
            }
            message += [
              "",
              "Features enabled by your requested compatibility date may not be available.",
              `Upgrade to \`wrangler@${maybeNewVersion}\` to remove this warning.`
            ].join("\n");
            super.warn(message);
          });
        }
        super.warn(message);
      }
    };
    DEFAULT_WORKER_NAME = "worker";
    __name(getName, "getName");
    IDENTIFIER_UNSAFE_REGEXP = /[^a-zA-Z0-9_$]/g;
    __name(getIdentifier, "getIdentifier");
    __name(castLogLevel, "castLogLevel");
    __name(buildLog, "buildLog");
    __name(buildSourceOptions, "buildSourceOptions");
    __name(getRemoteId, "getRemoteId");
    __name(kvNamespaceEntry, "kvNamespaceEntry");
    __name(r2BucketEntry, "r2BucketEntry");
    __name(d1DatabaseEntry, "d1DatabaseEntry");
    __name(queueProducerEntry, "queueProducerEntry");
    __name(pipelineEntry, "pipelineEntry");
    __name(hyperdriveEntry, "hyperdriveEntry");
    __name(workflowEntry, "workflowEntry");
    __name(dispatchNamespaceEntry, "dispatchNamespaceEntry");
    __name(ratelimitEntry, "ratelimitEntry");
    __name(queueConsumerEntry, "queueConsumerEntry");
    __name(buildMiniflareBindingOptions, "buildMiniflareBindingOptions");
    __name(getDefaultPersistRoot, "getDefaultPersistRoot");
    __name(buildAssetOptions, "buildAssetOptions");
    __name(buildSitesOptions, "buildSitesOptions");
    __name(buildMiniflareOptions, "buildMiniflareOptions");
    __name(getImageNameFromDOClassName, "getImageNameFromDOClassName");
    __name(isUnsafeServiceBindingWithDevCfg, "isUnsafeServiceBindingWithDevCfg");
    __name(handleStructuredLogs, "handleStructuredLogs");
  }
});

// src/api/startDevWorker/devtools.ts
var init_devtools = __esm({
  "src/api/startDevWorker/devtools.ts"() {
    init_import_meta_url();
  }
});

// src/api/startDevWorker/events.ts
function castErrorCause(cause) {
  if (cause instanceof Error) {
    return cause;
  }
  const error2 = new Error();
  error2.cause = cause;
  return error2;
}
var init_events = __esm({
  "src/api/startDevWorker/events.ts"() {
    init_import_meta_url();
    init_devtools();
    __name(castErrorCause, "castErrorCause");
  }
});

// src/api/startDevWorker/BaseController.ts
var Controller, RuntimeController;
var init_BaseController = __esm({
  "src/api/startDevWorker/BaseController.ts"() {
    init_import_meta_url();
    init_logger();
    Controller = class {
      static {
        __name(this, "Controller");
      }
      bus;
      #tearingDown = false;
      constructor(bus) {
        this.bus = bus;
      }
      async teardown() {
        this.#tearingDown = true;
      }
      emitErrorEvent(event) {
        if (this.#tearingDown) {
          logger.debug("Suppressing error event during teardown");
          logger.debug(`Error in ${event.source}: ${event.reason}
`, event.cause);
          logger.debug("=> Error contextual data:", event.data);
          return;
        }
        this.bus.dispatch(event);
      }
    };
    RuntimeController = class extends Controller {
      static {
        __name(this, "RuntimeController");
      }
      // *********************
      //   Event Dispatchers
      // *********************
      emitReloadStartEvent(data) {
        this.bus.dispatch(data);
      }
      emitReloadCompleteEvent(data) {
        this.bus.dispatch(data);
      }
      emitDevRegistryUpdateEvent(data) {
        this.bus.dispatch(data);
      }
    };
  }
});

// src/pages/constants.ts
var isWindows, MAX_ASSET_COUNT_DEFAULT, MAX_ASSET_SIZE2, PAGES_CONFIG_CACHE_FILENAME, MAX_BUCKET_SIZE, MAX_BUCKET_FILE_COUNT, BULK_UPLOAD_CONCURRENCY, MAX_UPLOAD_ATTEMPTS, MAX_UPLOAD_GATEWAY_ERRORS, MAX_DEPLOYMENT_ATTEMPTS, MAX_DEPLOYMENT_STATUS_ATTEMPTS, MAX_CHECK_MISSING_ATTEMPTS, SECONDS_TO_WAIT_FOR_PROXY, MAX_FUNCTIONS_ROUTES_RULES, MAX_FUNCTIONS_ROUTES_RULE_LENGTH, ROUTES_SPEC_VERSION, ROUTES_SPEC_DESCRIPTION;
var init_constants3 = __esm({
  "src/pages/constants.ts"() {
    init_import_meta_url();
    init_package();
    isWindows = process.platform === "win32";
    MAX_ASSET_COUNT_DEFAULT = 2e4;
    MAX_ASSET_SIZE2 = 25 * 1024 * 1024;
    PAGES_CONFIG_CACHE_FILENAME = "pages.json";
    MAX_BUCKET_SIZE = 40 * 1024 * 1024;
    MAX_BUCKET_FILE_COUNT = isWindows ? 1e3 : 2e3;
    BULK_UPLOAD_CONCURRENCY = 3;
    MAX_UPLOAD_ATTEMPTS = 5;
    MAX_UPLOAD_GATEWAY_ERRORS = 5;
    MAX_DEPLOYMENT_ATTEMPTS = 3;
    MAX_DEPLOYMENT_STATUS_ATTEMPTS = 5;
    MAX_CHECK_MISSING_ATTEMPTS = 5;
    SECONDS_TO_WAIT_FOR_PROXY = 5;
    MAX_FUNCTIONS_ROUTES_RULES = 100;
    MAX_FUNCTIONS_ROUTES_RULE_LENGTH = 100;
    ROUTES_SPEC_VERSION = 1;
    ROUTES_SPEC_DESCRIPTION = `Generated by wrangler@${version}`;
  }
});

// src/pages/functions/routes-validation.ts
function isRoutesJSONSpec(data) {
  return typeof data === "object" && data && "version" in data && typeof data.version === "number" && data.version === ROUTES_SPEC_VERSION && Array.isArray(data.include) && Array.isArray(data.exclude) || false;
}
function validateRoutes2(routesJSON, routesPath) {
  if (!isRoutesJSONSpec(routesJSON)) {
    throw new FatalError(
      getRoutesValidationErrorMessage(
        0 /* INVALID_JSON_SPEC */,
        routesPath
      ),
      1
    );
  }
  if (!hasIncludeRules(routesJSON)) {
    throw new FatalError(
      getRoutesValidationErrorMessage(
        1 /* NO_INCLUDE_RULES */,
        routesPath
      ),
      1
    );
  }
  if (!hasValidRulesCount(routesJSON)) {
    throw new FatalError(
      getRoutesValidationErrorMessage(
        3 /* TOO_MANY_RULES */,
        routesPath
      ),
      1
    );
  }
  if (!hasValidRuleCharCount(routesJSON)) {
    throw new FatalError(
      getRoutesValidationErrorMessage(
        4 /* RULE_TOO_LONG */,
        routesPath
      ),
      1
    );
  }
  if (!hasValidRules(routesJSON)) {
    throw new FatalError(
      getRoutesValidationErrorMessage(
        2 /* INVALID_RULES */,
        routesPath
      ),
      1
    );
  }
  if (hasOverlappingRules(routesJSON.include) || hasOverlappingRules(routesJSON.exclude)) {
    throw new FatalError(
      getRoutesValidationErrorMessage(
        5 /* OVERLAPPING_RULES */,
        routesPath
      ),
      1
    );
  }
}
function hasIncludeRules(routesJSON) {
  if (!routesJSON || !routesJSON.include) {
    throw new Error(
      "Function `hasIncludeRules` was called out of context. Attempting to validate include rules for routes that are undefined or an invalid RoutesJSONSpec"
    );
  }
  return routesJSON?.include?.length > 0;
}
function hasValidRulesCount(routesJSON) {
  if (!routesJSON || !routesJSON.include || !routesJSON.exclude) {
    throw new Error(
      "Function `hasValidRulesCount` was called out of context. Attempting to validate maximum rules count for routes that are undefined or an invalid RoutesJSONSpec"
    );
  }
  return routesJSON.include.length + routesJSON.exclude.length <= MAX_FUNCTIONS_ROUTES_RULES;
}
function hasValidRuleCharCount(routesJSON) {
  if (!routesJSON || !routesJSON.include || !routesJSON.exclude) {
    throw new Error(
      "Function `hasValidRuleCharCount` was called out of context. Attempting to validate rules maximum character count for routes that are undefined or an invalid RoutesJSONSpec"
    );
  }
  const rules = [...routesJSON.include, ...routesJSON.exclude];
  return rules.filter((rule) => rule.length > MAX_FUNCTIONS_ROUTES_RULE_LENGTH).length === 0;
}
function hasValidRules(routesJSON) {
  if (!routesJSON || !routesJSON.include || !routesJSON.exclude) {
    throw new Error(
      "Function `hasValidRules` was called out of context. Attempting to validate rules for routes that are undefined or an invalid RoutesJSONSpec"
    );
  }
  const rules = [...routesJSON.include, ...routesJSON.exclude];
  return rules.filter((rule) => !rule.match(/^\//)).length === 0;
}
function hasOverlappingRules(routes) {
  if (!routes) {
    throw new Error(
      "Function `hasverlappingRules` was called out of context. Attempting to validate rules for routes that are undefined"
    );
  }
  const endingSplatRoutes = routes.filter((route) => route.endsWith("/*"));
  for (let i7 = 0; i7 < endingSplatRoutes.length; i7++) {
    const crrRoute = endingSplatRoutes[i7];
    const crrRouteTrimmed = crrRoute.substring(0, crrRoute.length - 1);
    for (let j7 = 0; j7 < routes.length; j7++) {
      const nextRoute = routes[j7];
      if (nextRoute !== crrRoute && nextRoute.startsWith(crrRouteTrimmed)) {
        return true;
      }
    }
  }
  return false;
}
var init_routes_validation = __esm({
  "src/pages/functions/routes-validation.ts"() {
    init_import_meta_url();
    init_dist();
    init_constants3();
    init_errors2();
    __name(isRoutesJSONSpec, "isRoutesJSONSpec");
    __name(validateRoutes2, "validateRoutes");
    __name(hasIncludeRules, "hasIncludeRules");
    __name(hasValidRulesCount, "hasValidRulesCount");
    __name(hasValidRuleCharCount, "hasValidRuleCharCount");
    __name(hasValidRules, "hasValidRules");
    __name(hasOverlappingRules, "hasOverlappingRules");
  }
});

// src/pages/errors.ts
function getFunctionsNoRoutesWarning(functionsDirectory, suffix) {
  return `No routes found when building Functions directory: ${functionsDirectory}${suffix ? " - " + suffix : ""}`;
}
function getRoutesValidationErrorMessage(errorCode, routesPath) {
  switch (errorCode) {
    case 1 /* NO_INCLUDE_RULES */:
      return `Invalid _routes.json file found at: ${routesPath}
Routes must have at least 1 include rule, but no include rules were detected.`;
    case 3 /* TOO_MANY_RULES */:
      return `Invalid _routes.json file found at: ${routesPath}
Detected rules that are over the ${MAX_FUNCTIONS_ROUTES_RULES} rule limit. Please make sure you have a total of ${MAX_FUNCTIONS_ROUTES_RULES} include and exclude rules combined.`;
    case 4 /* RULE_TOO_LONG */:
      return `Invalid _routes.json file found at: ${routesPath}
Detected rules the are over the ${MAX_FUNCTIONS_ROUTES_RULE_LENGTH} character limit. Please make sure that each include and exclude routing rule is at most ${MAX_FUNCTIONS_ROUTES_RULE_LENGTH} characters long.`;
    case 2 /* INVALID_RULES */:
      return `Invalid _routes.json file found at: ${routesPath}
All rules must start with '/'.`;
    case 5 /* OVERLAPPING_RULES */:
      return `Invalid _routes.json file found at: ${routesPath}
Overlapping rules found. Please make sure that rules ending with a splat (eg. "/api/*") don't overlap any other rules (eg. "/api/foo"). This applies to both include and exclude rules individually.`;
    case 0 /* INVALID_JSON_SPEC */:
    default:
      return `Invalid _routes.json file found at: ${routesPath}
Please make sure the JSON object has the following format:
{
	version: ${ROUTES_SPEC_VERSION};
	include: string[];
	exclude: string[];
}
and that at least one include rule is provided.
			`;
  }
}
var EXIT_CODE_FUNCTIONS_NO_ROUTES_ERROR, EXIT_CODE_FUNCTIONS_NOTHING_TO_BUILD_ERROR, EXIT_CODE_NO_CONFIG_FOUND, EXIT_CODE_INVALID_PAGES_CONFIG, FunctionsBuildError, FunctionsNoRoutesError;
var init_errors2 = __esm({
  "src/pages/errors.ts"() {
    init_import_meta_url();
    init_dist();
    init_constants3();
    init_routes_validation();
    EXIT_CODE_FUNCTIONS_NO_ROUTES_ERROR = 156;
    EXIT_CODE_FUNCTIONS_NOTHING_TO_BUILD_ERROR = 157;
    EXIT_CODE_NO_CONFIG_FOUND = 158;
    EXIT_CODE_INVALID_PAGES_CONFIG = 159;
    FunctionsBuildError = class extends UserError {
      static {
        __name(this, "FunctionsBuildError");
      }
      constructor(message) {
        super(message);
      }
    };
    FunctionsNoRoutesError = class extends UserError {
      static {
        __name(this, "FunctionsNoRoutesError");
      }
      constructor(message) {
        super(message);
      }
    };
    __name(getFunctionsNoRoutesWarning, "getFunctionsNoRoutesWarning");
    __name(getRoutesValidationErrorMessage, "getRoutesValidationErrorMessage");
  }
});
async function logWarningsWithUpgradeHint(diagnostics, hideWarnings) {
  if (!diagnostics.hasWarnings() || hideWarnings) {
    return;
  }
  logger.warn(diagnostics.renderWarnings());
  if (diagnostics.hasUnexpectedFieldsInTree()) {
    const latestVersion = await updateCheck();
    if (latestVersion !== void 0) {
      logger.log(
        `There is a newer version of Wrangler available (current: ${version}, latest: ${latestVersion}). Try upgrading, as it might support this configuration option.`
      );
    }
  }
}
function readConfig(args, options = {}) {
  const {
    rawConfig,
    configPath,
    userConfigPath,
    deployConfigPath,
    redirected
  } = exports.experimental_readRawConfig(args, options);
  if (redirected) {
    assert53__default.default(configPath, "Redirected config found without a configPath");
    assert53__default.default(
      deployConfigPath,
      "Redirected config found without a deployConfigPath"
    );
    logger.info(esm_default3`
				Using redirected Wrangler configuration.
				 - Configuration being used: "${path3__namespace.default.relative(".", configPath)}"
				 - Original user's configuration: "${userConfigPath ? path3__namespace.default.relative(".", userConfigPath) : "<no user config found>"}"
				 - Deploy configuration file: "${path3__namespace.default.relative(".", deployConfigPath)}"
			`);
  }
  const { config, diagnostics } = normalizeAndValidateConfig(
    rawConfig,
    configPath,
    userConfigPath,
    args,
    options.preserveOriginalMain
  );
  void logWarningsWithUpgradeHint(diagnostics, options?.hideWarnings);
  if (diagnostics.hasErrors()) {
    throw new UserError(diagnostics.renderErrors());
  }
  return config;
}
function readPagesConfig(args, options = {}) {
  let rawConfig;
  let configPath;
  let userConfigPath;
  let redirected;
  let deployConfigPath;
  try {
    ({ rawConfig, configPath, userConfigPath, deployConfigPath, redirected } = exports.experimental_readRawConfig(args, options));
    if (redirected) {
      assert53__default.default(configPath, "Redirected config found without a configPath");
      assert53__default.default(
        deployConfigPath,
        "Redirected config found without a deployConfigPath"
      );
      logger.info(esm_default3`
				Using redirected Wrangler configuration.
				 - Configuration being used: "${path3__namespace.default.relative(".", configPath)}"
				 - Original user's configuration: "${userConfigPath ? path3__namespace.default.relative(".", userConfigPath) : "<no user config found>"}"
				 - Deploy configuration file: "${path3__namespace.default.relative(".", deployConfigPath)}"
			`);
    }
  } catch (e10) {
    logger.error(e10);
    throw new FatalError(
      `Your ${configFileName(configPath)} file is not a valid Pages configuration file`,
      EXIT_CODE_INVALID_PAGES_CONFIG
    );
  }
  if (!isPagesConfig(rawConfig)) {
    throw new FatalError(
      `Your ${configFileName(configPath)} file is not a valid Pages configuration file`,
      EXIT_CODE_INVALID_PAGES_CONFIG
    );
  }
  const { config, diagnostics } = normalizeAndValidateConfig(
    rawConfig,
    configPath,
    userConfigPath,
    args
  );
  void logWarningsWithUpgradeHint(diagnostics, options.hideWarnings);
  if (diagnostics.hasErrors()) {
    throw new UserError(diagnostics.renderErrors());
  }
  logger.debug(`Configuration file belonging to \u26A1\uFE0F Pages \u26A1\uFE0F project detected.`);
  const envNames = rawConfig.env ? Object.keys(rawConfig.env) : [];
  const projectName = rawConfig?.name;
  const pagesDiagnostics = validatePagesConfig(config, envNames, projectName);
  if (pagesDiagnostics.hasWarnings()) {
    logger.warn(pagesDiagnostics.renderWarnings());
  }
  if (pagesDiagnostics.hasErrors()) {
    throw new UserError(pagesDiagnostics.renderErrors());
  }
  return config;
}
var init_config = __esm({
  "src/config/index.ts"() {
    init_import_meta_url();
    init_dist();
    init_esm2();
    init_package();
    init_logger();
    init_errors2();
    init_update_check();
    __name(logWarningsWithUpgradeHint, "logWarningsWithUpgradeHint");
    __name(readConfig, "readConfig");
    __name(readPagesConfig, "readPagesConfig");
  }
});

// ../../node_modules/.pnpm/smol-toml@1.5.2/node_modules/smol-toml/dist/error.js
function getLineColFromPtr2(string, ptr) {
  let lines = string.slice(0, ptr).split(/\r\n|\n|\r/g);
  return [lines.length, lines.pop().length + 1];
}
function makeCodeBlock2(string, line, column) {
  let lines = string.split(/\r\n|\n|\r/g);
  let codeblock = "";
  let numberLen = (Math.log10(line + 1) | 0) + 1;
  for (let i7 = line - 1; i7 <= line + 1; i7++) {
    let l8 = lines[i7 - 1];
    if (!l8)
      continue;
    codeblock += i7.toString().padEnd(numberLen, " ");
    codeblock += ":  ";
    codeblock += l8;
    codeblock += "\n";
    if (i7 === line) {
      codeblock += " ".repeat(numberLen + column + 2);
      codeblock += "^\n";
    }
  }
  return codeblock;
}
var TomlError2;
var init_error3 = __esm({
  "../../node_modules/.pnpm/smol-toml@1.5.2/node_modules/smol-toml/dist/error.js"() {
    init_import_meta_url();
    __name(getLineColFromPtr2, "getLineColFromPtr");
    __name(makeCodeBlock2, "makeCodeBlock");
    TomlError2 = class extends Error {
      static {
        __name(this, "TomlError");
      }
      line;
      column;
      codeblock;
      constructor(message, options) {
        const [line, column] = getLineColFromPtr2(options.toml, options.ptr);
        const codeblock = makeCodeBlock2(options.toml, line, column);
        super(`Invalid TOML document: ${message}

${codeblock}`, options);
        this.line = line;
        this.column = column;
        this.codeblock = codeblock;
      }
    };
  }
});

// ../../node_modules/.pnpm/smol-toml@1.5.2/node_modules/smol-toml/dist/util.js
function isEscaped2(str, ptr) {
  let i7 = 0;
  while (str[ptr - ++i7] === "\\")
    ;
  return --i7 && i7 % 2;
}
function indexOfNewline2(str, start = 0, end = str.length) {
  let idx = str.indexOf("\n", start);
  if (str[idx - 1] === "\r")
    idx--;
  return idx <= end ? idx : -1;
}
function skipComment2(str, ptr) {
  for (let i7 = ptr; i7 < str.length; i7++) {
    let c8 = str[i7];
    if (c8 === "\n")
      return i7;
    if (c8 === "\r" && str[i7 + 1] === "\n")
      return i7 + 1;
    if (c8 < " " && c8 !== "	" || c8 === "\x7F") {
      throw new TomlError2("control characters are not allowed in comments", {
        toml: str,
        ptr
      });
    }
  }
  return str.length;
}
function skipVoid2(str, ptr, banNewLines, banComments) {
  let c8;
  while ((c8 = str[ptr]) === " " || c8 === "	" || !banNewLines && (c8 === "\n" || c8 === "\r" && str[ptr + 1] === "\n"))
    ptr++;
  return banComments || c8 !== "#" ? ptr : skipVoid2(str, skipComment2(str, ptr), banNewLines);
}
function skipUntil2(str, ptr, sep6, end, banNewLines = false) {
  if (!end) {
    ptr = indexOfNewline2(str, ptr);
    return ptr < 0 ? str.length : ptr;
  }
  for (let i7 = ptr; i7 < str.length; i7++) {
    let c8 = str[i7];
    if (c8 === "#") {
      i7 = indexOfNewline2(str, i7);
    } else if (c8 === sep6) {
      return i7 + 1;
    } else if (c8 === end || banNewLines && (c8 === "\n" || c8 === "\r" && str[i7 + 1] === "\n")) {
      return i7;
    }
  }
  throw new TomlError2("cannot find end of structure", {
    toml: str,
    ptr
  });
}
function getStringEnd2(str, seek) {
  let first = str[seek];
  let target = first === str[seek + 1] && str[seek + 1] === str[seek + 2] ? str.slice(seek, seek + 3) : first;
  seek += target.length - 1;
  do
    seek = str.indexOf(target, ++seek);
  while (seek > -1 && first !== "'" && isEscaped2(str, seek));
  if (seek > -1) {
    seek += target.length;
    if (target.length > 1) {
      if (str[seek] === first)
        seek++;
      if (str[seek] === first)
        seek++;
    }
  }
  return seek;
}
var init_util2 = __esm({
  "../../node_modules/.pnpm/smol-toml@1.5.2/node_modules/smol-toml/dist/util.js"() {
    init_import_meta_url();
    init_error3();
    __name(isEscaped2, "isEscaped");
    __name(indexOfNewline2, "indexOfNewline");
    __name(skipComment2, "skipComment");
    __name(skipVoid2, "skipVoid");
    __name(skipUntil2, "skipUntil");
    __name(getStringEnd2, "getStringEnd");
  }
});

// ../../node_modules/.pnpm/smol-toml@1.5.2/node_modules/smol-toml/dist/date.js
var DATE_TIME_RE2, TomlDate2;
var init_date = __esm({
  "../../node_modules/.pnpm/smol-toml@1.5.2/node_modules/smol-toml/dist/date.js"() {
    init_import_meta_url();
    DATE_TIME_RE2 = /^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}:\d{2}(?:\.\d+)?)?(Z|[-+]\d{2}:\d{2})?$/i;
    TomlDate2 = class _TomlDate2 extends Date {
      static {
        __name(this, "TomlDate");
      }
      #hasDate = false;
      #hasTime = false;
      #offset = null;
      constructor(date) {
        let hasDate = true;
        let hasTime = true;
        let offset = "Z";
        if (typeof date === "string") {
          let match3 = date.match(DATE_TIME_RE2);
          if (match3) {
            if (!match3[1]) {
              hasDate = false;
              date = `0000-01-01T${date}`;
            }
            hasTime = !!match3[2];
            hasTime && date[10] === " " && (date = date.replace(" ", "T"));
            if (match3[2] && +match3[2] > 23) {
              date = "";
            } else {
              offset = match3[3] || null;
              date = date.toUpperCase();
              if (!offset && hasTime)
                date += "Z";
            }
          } else {
            date = "";
          }
        }
        super(date);
        if (!isNaN(this.getTime())) {
          this.#hasDate = hasDate;
          this.#hasTime = hasTime;
          this.#offset = offset;
        }
      }
      isDateTime() {
        return this.#hasDate && this.#hasTime;
      }
      isLocal() {
        return !this.#hasDate || !this.#hasTime || !this.#offset;
      }
      isDate() {
        return this.#hasDate && !this.#hasTime;
      }
      isTime() {
        return this.#hasTime && !this.#hasDate;
      }
      isValid() {
        return this.#hasDate || this.#hasTime;
      }
      toISOString() {
        let iso = super.toISOString();
        if (this.isDate())
          return iso.slice(0, 10);
        if (this.isTime())
          return iso.slice(11, 23);
        if (this.#offset === null)
          return iso.slice(0, -1);
        if (this.#offset === "Z")
          return iso;
        let offset = +this.#offset.slice(1, 3) * 60 + +this.#offset.slice(4, 6);
        offset = this.#offset[0] === "-" ? offset : -offset;
        let offsetDate = new Date(this.getTime() - offset * 6e4);
        return offsetDate.toISOString().slice(0, -1) + this.#offset;
      }
      static wrapAsOffsetDateTime(jsDate, offset = "Z") {
        let date = new _TomlDate2(jsDate);
        date.#offset = offset;
        return date;
      }
      static wrapAsLocalDateTime(jsDate) {
        let date = new _TomlDate2(jsDate);
        date.#offset = null;
        return date;
      }
      static wrapAsLocalDate(jsDate) {
        let date = new _TomlDate2(jsDate);
        date.#hasTime = false;
        date.#offset = null;
        return date;
      }
      static wrapAsLocalTime(jsDate) {
        let date = new _TomlDate2(jsDate);
        date.#hasDate = false;
        date.#offset = null;
        return date;
      }
    };
  }
});

// ../../node_modules/.pnpm/smol-toml@1.5.2/node_modules/smol-toml/dist/primitive.js
function parseString2(str, ptr = 0, endPtr = str.length) {
  let isLiteral = str[ptr] === "'";
  let isMultiline = str[ptr++] === str[ptr] && str[ptr] === str[ptr + 1];
  if (isMultiline) {
    endPtr -= 2;
    if (str[ptr += 2] === "\r")
      ptr++;
    if (str[ptr] === "\n")
      ptr++;
  }
  let tmp = 0;
  let isEscape;
  let parsed = "";
  let sliceStart = ptr;
  while (ptr < endPtr - 1) {
    let c8 = str[ptr++];
    if (c8 === "\n" || c8 === "\r" && str[ptr] === "\n") {
      if (!isMultiline) {
        throw new TomlError2("newlines are not allowed in strings", {
          toml: str,
          ptr: ptr - 1
        });
      }
    } else if (c8 < " " && c8 !== "	" || c8 === "\x7F") {
      throw new TomlError2("control characters are not allowed in strings", {
        toml: str,
        ptr: ptr - 1
      });
    }
    if (isEscape) {
      isEscape = false;
      if (c8 === "u" || c8 === "U") {
        let code = str.slice(ptr, ptr += c8 === "u" ? 4 : 8);
        if (!ESCAPE_REGEX2.test(code)) {
          throw new TomlError2("invalid unicode escape", {
            toml: str,
            ptr: tmp
          });
        }
        try {
          parsed += String.fromCodePoint(parseInt(code, 16));
        } catch {
          throw new TomlError2("invalid unicode escape", {
            toml: str,
            ptr: tmp
          });
        }
      } else if (isMultiline && (c8 === "\n" || c8 === " " || c8 === "	" || c8 === "\r")) {
        ptr = skipVoid2(str, ptr - 1, true);
        if (str[ptr] !== "\n" && str[ptr] !== "\r") {
          throw new TomlError2("invalid escape: only line-ending whitespace may be escaped", {
            toml: str,
            ptr: tmp
          });
        }
        ptr = skipVoid2(str, ptr);
      } else if (c8 in ESC_MAP2) {
        parsed += ESC_MAP2[c8];
      } else {
        throw new TomlError2("unrecognized escape sequence", {
          toml: str,
          ptr: tmp
        });
      }
      sliceStart = ptr;
    } else if (!isLiteral && c8 === "\\") {
      tmp = ptr - 1;
      isEscape = true;
      parsed += str.slice(sliceStart, tmp);
    }
  }
  return parsed + str.slice(sliceStart, endPtr - 1);
}
function parseValue2(value, toml, ptr, integersAsBigInt) {
  if (value === "true")
    return true;
  if (value === "false")
    return false;
  if (value === "-inf")
    return -Infinity;
  if (value === "inf" || value === "+inf")
    return Infinity;
  if (value === "nan" || value === "+nan" || value === "-nan")
    return NaN;
  if (value === "-0")
    return integersAsBigInt ? 0n : 0;
  let isInt = INT_REGEX2.test(value);
  if (isInt || FLOAT_REGEX2.test(value)) {
    if (LEADING_ZERO2.test(value)) {
      throw new TomlError2("leading zeroes are not allowed", {
        toml,
        ptr
      });
    }
    value = value.replace(/_/g, "");
    let numeric = +value;
    if (isNaN(numeric)) {
      throw new TomlError2("invalid number", {
        toml,
        ptr
      });
    }
    if (isInt) {
      if ((isInt = !Number.isSafeInteger(numeric)) && !integersAsBigInt) {
        throw new TomlError2("integer value cannot be represented losslessly", {
          toml,
          ptr
        });
      }
      if (isInt || integersAsBigInt === true)
        numeric = BigInt(value);
    }
    return numeric;
  }
  const date = new TomlDate2(value);
  if (!date.isValid()) {
    throw new TomlError2("invalid value", {
      toml,
      ptr
    });
  }
  return date;
}
var INT_REGEX2, FLOAT_REGEX2, LEADING_ZERO2, ESCAPE_REGEX2, ESC_MAP2;
var init_primitive = __esm({
  "../../node_modules/.pnpm/smol-toml@1.5.2/node_modules/smol-toml/dist/primitive.js"() {
    init_import_meta_url();
    init_util2();
    init_date();
    init_error3();
    INT_REGEX2 = /^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/;
    FLOAT_REGEX2 = /^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/;
    LEADING_ZERO2 = /^[+-]?0[0-9_]/;
    ESCAPE_REGEX2 = /^[0-9a-f]{4,8}$/i;
    ESC_MAP2 = {
      b: "\b",
      t: "	",
      n: "\n",
      f: "\f",
      r: "\r",
      '"': '"',
      "\\": "\\"
    };
    __name(parseString2, "parseString");
    __name(parseValue2, "parseValue");
  }
});

// ../../node_modules/.pnpm/smol-toml@1.5.2/node_modules/smol-toml/dist/extract.js
function sliceAndTrimEndOf2(str, startPtr, endPtr, allowNewLines) {
  let value = str.slice(startPtr, endPtr);
  let commentIdx = value.indexOf("#");
  if (commentIdx > -1) {
    skipComment2(str, commentIdx);
    value = value.slice(0, commentIdx);
  }
  let trimmed = value.trimEnd();
  if (!allowNewLines) {
    let newlineIdx = value.indexOf("\n", trimmed.length);
    if (newlineIdx > -1) {
      throw new TomlError2("newlines are not allowed in inline tables", {
        toml: str,
        ptr: startPtr + newlineIdx
      });
    }
  }
  return [trimmed, commentIdx];
}
function extractValue2(str, ptr, end, depth, integersAsBigInt) {
  if (depth === 0) {
    throw new TomlError2("document contains excessively nested structures. aborting.", {
      toml: str,
      ptr
    });
  }
  let c8 = str[ptr];
  if (c8 === "[" || c8 === "{") {
    let [value, endPtr2] = c8 === "[" ? parseArray2(str, ptr, depth, integersAsBigInt) : parseInlineTable2(str, ptr, depth, integersAsBigInt);
    let newPtr = end ? skipUntil2(str, endPtr2, ",", end) : endPtr2;
    if (endPtr2 - newPtr && end === "}") {
      let nextNewLine = indexOfNewline2(str, endPtr2, newPtr);
      if (nextNewLine > -1) {
        throw new TomlError2("newlines are not allowed in inline tables", {
          toml: str,
          ptr: nextNewLine
        });
      }
    }
    return [value, newPtr];
  }
  let endPtr;
  if (c8 === '"' || c8 === "'") {
    endPtr = getStringEnd2(str, ptr);
    let parsed = parseString2(str, ptr, endPtr);
    if (end) {
      endPtr = skipVoid2(str, endPtr, end !== "]");
      if (str[endPtr] && str[endPtr] !== "," && str[endPtr] !== end && str[endPtr] !== "\n" && str[endPtr] !== "\r") {
        throw new TomlError2("unexpected character encountered", {
          toml: str,
          ptr: endPtr
        });
      }
      endPtr += +(str[endPtr] === ",");
    }
    return [parsed, endPtr];
  }
  endPtr = skipUntil2(str, ptr, ",", end);
  let slice = sliceAndTrimEndOf2(str, ptr, endPtr - +(str[endPtr - 1] === ","), end === "]");
  if (!slice[0]) {
    throw new TomlError2("incomplete key-value declaration: no value specified", {
      toml: str,
      ptr
    });
  }
  if (end && slice[1] > -1) {
    endPtr = skipVoid2(str, ptr + slice[1]);
    endPtr += +(str[endPtr] === ",");
  }
  return [
    parseValue2(slice[0], str, ptr, integersAsBigInt),
    endPtr
  ];
}
var init_extract = __esm({
  "../../node_modules/.pnpm/smol-toml@1.5.2/node_modules/smol-toml/dist/extract.js"() {
    init_import_meta_url();
    init_primitive();
    init_struct();
    init_util2();
    init_error3();
    __name(sliceAndTrimEndOf2, "sliceAndTrimEndOf");
    __name(extractValue2, "extractValue");
  }
});

// ../../node_modules/.pnpm/smol-toml@1.5.2/node_modules/smol-toml/dist/struct.js
function parseKey2(str, ptr, end = "=") {
  let dot = ptr - 1;
  let parsed = [];
  let endPtr = str.indexOf(end, ptr);
  if (endPtr < 0) {
    throw new TomlError2("incomplete key-value: cannot find end of key", {
      toml: str,
      ptr
    });
  }
  do {
    let c8 = str[ptr = ++dot];
    if (c8 !== " " && c8 !== "	") {
      if (c8 === '"' || c8 === "'") {
        if (c8 === str[ptr + 1] && c8 === str[ptr + 2]) {
          throw new TomlError2("multiline strings are not allowed in keys", {
            toml: str,
            ptr
          });
        }
        let eos = getStringEnd2(str, ptr);
        if (eos < 0) {
          throw new TomlError2("unfinished string encountered", {
            toml: str,
            ptr
          });
        }
        dot = str.indexOf(".", eos);
        let strEnd = str.slice(eos, dot < 0 || dot > endPtr ? endPtr : dot);
        let newLine = indexOfNewline2(strEnd);
        if (newLine > -1) {
          throw new TomlError2("newlines are not allowed in keys", {
            toml: str,
            ptr: ptr + dot + newLine
          });
        }
        if (strEnd.trimStart()) {
          throw new TomlError2("found extra tokens after the string part", {
            toml: str,
            ptr: eos
          });
        }
        if (endPtr < eos) {
          endPtr = str.indexOf(end, eos);
          if (endPtr < 0) {
            throw new TomlError2("incomplete key-value: cannot find end of key", {
              toml: str,
              ptr
            });
          }
        }
        parsed.push(parseString2(str, ptr, eos));
      } else {
        dot = str.indexOf(".", ptr);
        let part = str.slice(ptr, dot < 0 || dot > endPtr ? endPtr : dot);
        if (!KEY_PART_RE2.test(part)) {
          throw new TomlError2("only letter, numbers, dashes and underscores are allowed in keys", {
            toml: str,
            ptr
          });
        }
        parsed.push(part.trimEnd());
      }
    }
  } while (dot + 1 && dot < endPtr);
  return [parsed, skipVoid2(str, endPtr + 1, true, true)];
}
function parseInlineTable2(str, ptr, depth, integersAsBigInt) {
  let res = {};
  let seen = /* @__PURE__ */ new Set();
  let c8;
  let comma = 0;
  ptr++;
  while ((c8 = str[ptr++]) !== "}" && c8) {
    let err = { toml: str, ptr: ptr - 1 };
    if (c8 === "\n") {
      throw new TomlError2("newlines are not allowed in inline tables", err);
    } else if (c8 === "#") {
      throw new TomlError2("inline tables cannot contain comments", err);
    } else if (c8 === ",") {
      throw new TomlError2("expected key-value, found comma", err);
    } else if (c8 !== " " && c8 !== "	") {
      let k7;
      let t13 = res;
      let hasOwn2 = false;
      let [key, keyEndPtr] = parseKey2(str, ptr - 1);
      for (let i7 = 0; i7 < key.length; i7++) {
        if (i7)
          t13 = hasOwn2 ? t13[k7] : t13[k7] = {};
        k7 = key[i7];
        if ((hasOwn2 = Object.hasOwn(t13, k7)) && (typeof t13[k7] !== "object" || seen.has(t13[k7]))) {
          throw new TomlError2("trying to redefine an already defined value", {
            toml: str,
            ptr
          });
        }
        if (!hasOwn2 && k7 === "__proto__") {
          Object.defineProperty(t13, k7, { enumerable: true, configurable: true, writable: true });
        }
      }
      if (hasOwn2) {
        throw new TomlError2("trying to redefine an already defined value", {
          toml: str,
          ptr
        });
      }
      let [value, valueEndPtr] = extractValue2(str, keyEndPtr, "}", depth - 1, integersAsBigInt);
      seen.add(value);
      t13[k7] = value;
      ptr = valueEndPtr;
      comma = str[ptr - 1] === "," ? ptr - 1 : 0;
    }
  }
  if (comma) {
    throw new TomlError2("trailing commas are not allowed in inline tables", {
      toml: str,
      ptr: comma
    });
  }
  if (!c8) {
    throw new TomlError2("unfinished table encountered", {
      toml: str,
      ptr
    });
  }
  return [res, ptr];
}
function parseArray2(str, ptr, depth, integersAsBigInt) {
  let res = [];
  let c8;
  ptr++;
  while ((c8 = str[ptr++]) !== "]" && c8) {
    if (c8 === ",") {
      throw new TomlError2("expected value, found comma", {
        toml: str,
        ptr: ptr - 1
      });
    } else if (c8 === "#")
      ptr = skipComment2(str, ptr);
    else if (c8 !== " " && c8 !== "	" && c8 !== "\n" && c8 !== "\r") {
      let e10 = extractValue2(str, ptr - 1, "]", depth - 1, integersAsBigInt);
      res.push(e10[0]);
      ptr = e10[1];
    }
  }
  if (!c8) {
    throw new TomlError2("unfinished array encountered", {
      toml: str,
      ptr
    });
  }
  return [res, ptr];
}
var KEY_PART_RE2;
var init_struct = __esm({
  "../../node_modules/.pnpm/smol-toml@1.5.2/node_modules/smol-toml/dist/struct.js"() {
    init_import_meta_url();
    init_primitive();
    init_extract();
    init_util2();
    init_error3();
    KEY_PART_RE2 = /^[a-zA-Z0-9-_]+[ \t]*$/;
    __name(parseKey2, "parseKey");
    __name(parseInlineTable2, "parseInlineTable");
    __name(parseArray2, "parseArray");
  }
});

// ../../node_modules/.pnpm/smol-toml@1.5.2/node_modules/smol-toml/dist/parse.js
function peekTable2(key, table, meta, type) {
  let t13 = table;
  let m7 = meta;
  let k7;
  let hasOwn2 = false;
  let state2;
  for (let i7 = 0; i7 < key.length; i7++) {
    if (i7) {
      t13 = hasOwn2 ? t13[k7] : t13[k7] = {};
      m7 = (state2 = m7[k7]).c;
      if (type === 0 && (state2.t === 1 || state2.t === 2)) {
        return null;
      }
      if (state2.t === 2) {
        let l8 = t13.length - 1;
        t13 = t13[l8];
        m7 = m7[l8].c;
      }
    }
    k7 = key[i7];
    if ((hasOwn2 = Object.hasOwn(t13, k7)) && m7[k7]?.t === 0 && m7[k7]?.d) {
      return null;
    }
    if (!hasOwn2) {
      if (k7 === "__proto__") {
        Object.defineProperty(t13, k7, { enumerable: true, configurable: true, writable: true });
        Object.defineProperty(m7, k7, { enumerable: true, configurable: true, writable: true });
      }
      m7[k7] = {
        t: i7 < key.length - 1 && type === 2 ? 3 : type,
        d: false,
        i: 0,
        c: {}
      };
    }
  }
  state2 = m7[k7];
  if (state2.t !== type && !(type === 1 && state2.t === 3)) {
    return null;
  }
  if (type === 2) {
    if (!state2.d) {
      state2.d = true;
      t13[k7] = [];
    }
    t13[k7].push(t13 = {});
    state2.c[state2.i++] = state2 = { t: 1, d: false, i: 0, c: {} };
  }
  if (state2.d) {
    return null;
  }
  state2.d = true;
  if (type === 1) {
    t13 = hasOwn2 ? t13[k7] : t13[k7] = {};
  } else if (type === 0 && hasOwn2) {
    return null;
  }
  return [k7, t13, state2.c];
}
function parse4(toml, { maxDepth = 1e3, integersAsBigInt } = {}) {
  let res = {};
  let meta = {};
  let tbl = res;
  let m7 = meta;
  for (let ptr = skipVoid2(toml, 0); ptr < toml.length; ) {
    if (toml[ptr] === "[") {
      let isTableArray = toml[++ptr] === "[";
      let k7 = parseKey2(toml, ptr += +isTableArray, "]");
      if (isTableArray) {
        if (toml[k7[1] - 1] !== "]") {
          throw new TomlError2("expected end of table declaration", {
            toml,
            ptr: k7[1] - 1
          });
        }
        k7[1]++;
      }
      let p7 = peekTable2(
        k7[0],
        res,
        meta,
        isTableArray ? 2 : 1
        /* Type.EXPLICIT */
      );
      if (!p7) {
        throw new TomlError2("trying to redefine an already defined table or value", {
          toml,
          ptr
        });
      }
      m7 = p7[2];
      tbl = p7[1];
      ptr = k7[1];
    } else {
      let k7 = parseKey2(toml, ptr);
      let p7 = peekTable2(
        k7[0],
        tbl,
        m7,
        0
        /* Type.DOTTED */
      );
      if (!p7) {
        throw new TomlError2("trying to redefine an already defined table or value", {
          toml,
          ptr
        });
      }
      let v8 = extractValue2(toml, k7[1], void 0, maxDepth, integersAsBigInt);
      p7[1][p7[0]] = v8[0];
      ptr = v8[1];
    }
    ptr = skipVoid2(toml, ptr, true);
    if (toml[ptr] && toml[ptr] !== "\n" && toml[ptr] !== "\r") {
      throw new TomlError2("each key-value declaration must be followed by an end-of-line", {
        toml,
        ptr
      });
    }
    ptr = skipVoid2(toml, ptr);
  }
  return res;
}
var init_parse = __esm({
  "../../node_modules/.pnpm/smol-toml@1.5.2/node_modules/smol-toml/dist/parse.js"() {
    init_import_meta_url();
    init_struct();
    init_extract();
    init_util2();
    init_error3();
    __name(peekTable2, "peekTable");
    __name(parse4, "parse");
  }
});

// ../../node_modules/.pnpm/smol-toml@1.5.2/node_modules/smol-toml/dist/stringify.js
function extendedTypeOf2(obj) {
  let type = typeof obj;
  if (type === "object") {
    if (Array.isArray(obj))
      return "array";
    if (obj instanceof Date)
      return "date";
  }
  return type;
}
function isArrayOfTables2(obj) {
  for (let i7 = 0; i7 < obj.length; i7++) {
    if (extendedTypeOf2(obj[i7]) !== "object")
      return false;
  }
  return obj.length != 0;
}
function formatString2(s7) {
  return JSON.stringify(s7).replace(/\x7f/g, "\\u007f");
}
function stringifyValue2(val2, type, depth, numberAsFloat) {
  if (depth === 0) {
    throw new Error("Could not stringify the object: maximum object depth exceeded");
  }
  if (type === "number") {
    if (isNaN(val2))
      return "nan";
    if (val2 === Infinity)
      return "inf";
    if (val2 === -Infinity)
      return "-inf";
    if (numberAsFloat && Number.isInteger(val2))
      return val2.toFixed(1);
    return val2.toString();
  }
  if (type === "bigint" || type === "boolean") {
    return val2.toString();
  }
  if (type === "string") {
    return formatString2(val2);
  }
  if (type === "date") {
    if (isNaN(val2.getTime())) {
      throw new TypeError("cannot serialize invalid date");
    }
    return val2.toISOString();
  }
  if (type === "object") {
    return stringifyInlineTable2(val2, depth, numberAsFloat);
  }
  if (type === "array") {
    return stringifyArray2(val2, depth, numberAsFloat);
  }
}
function stringifyInlineTable2(obj, depth, numberAsFloat) {
  let keys = Object.keys(obj);
  if (keys.length === 0)
    return "{}";
  let res = "{ ";
  for (let i7 = 0; i7 < keys.length; i7++) {
    let k7 = keys[i7];
    if (i7)
      res += ", ";
    res += BARE_KEY2.test(k7) ? k7 : formatString2(k7);
    res += " = ";
    res += stringifyValue2(obj[k7], extendedTypeOf2(obj[k7]), depth - 1, numberAsFloat);
  }
  return res + " }";
}
function stringifyArray2(array, depth, numberAsFloat) {
  if (array.length === 0)
    return "[]";
  let res = "[ ";
  for (let i7 = 0; i7 < array.length; i7++) {
    if (i7)
      res += ", ";
    if (array[i7] === null || array[i7] === void 0) {
      throw new TypeError("arrays cannot contain null or undefined values");
    }
    res += stringifyValue2(array[i7], extendedTypeOf2(array[i7]), depth - 1, numberAsFloat);
  }
  return res + " ]";
}
function stringifyArrayTable2(array, key, depth, numberAsFloat) {
  if (depth === 0) {
    throw new Error("Could not stringify the object: maximum object depth exceeded");
  }
  let res = "";
  for (let i7 = 0; i7 < array.length; i7++) {
    res += `${res && "\n"}[[${key}]]
`;
    res += stringifyTable2(0, array[i7], key, depth, numberAsFloat);
  }
  return res;
}
function stringifyTable2(tableKey, obj, prefix, depth, numberAsFloat) {
  if (depth === 0) {
    throw new Error("Could not stringify the object: maximum object depth exceeded");
  }
  let preamble = "";
  let tables = "";
  let keys = Object.keys(obj);
  for (let i7 = 0; i7 < keys.length; i7++) {
    let k7 = keys[i7];
    if (obj[k7] !== null && obj[k7] !== void 0) {
      let type = extendedTypeOf2(obj[k7]);
      if (type === "symbol" || type === "function") {
        throw new TypeError(`cannot serialize values of type '${type}'`);
      }
      let key = BARE_KEY2.test(k7) ? k7 : formatString2(k7);
      if (type === "array" && isArrayOfTables2(obj[k7])) {
        tables += (tables && "\n") + stringifyArrayTable2(obj[k7], prefix ? `${prefix}.${key}` : key, depth - 1, numberAsFloat);
      } else if (type === "object") {
        let tblKey = prefix ? `${prefix}.${key}` : key;
        tables += (tables && "\n") + stringifyTable2(tblKey, obj[k7], tblKey, depth - 1, numberAsFloat);
      } else {
        preamble += key;
        preamble += " = ";
        preamble += stringifyValue2(obj[k7], type, depth, numberAsFloat);
        preamble += "\n";
      }
    }
  }
  if (tableKey && (preamble || !tables))
    preamble = preamble ? `[${tableKey}]
${preamble}` : `[${tableKey}]`;
  return preamble && tables ? `${preamble}
${tables}` : preamble || tables;
}
function stringify2(obj, { maxDepth = 1e3, numbersAsFloat = false } = {}) {
  if (extendedTypeOf2(obj) !== "object") {
    throw new TypeError("stringify can only be called with an object");
  }
  let str = stringifyTable2(0, obj, "", maxDepth, numbersAsFloat);
  if (str[str.length - 1] !== "\n")
    return str + "\n";
  return str;
}
var BARE_KEY2;
var init_stringify = __esm({
  "../../node_modules/.pnpm/smol-toml@1.5.2/node_modules/smol-toml/dist/stringify.js"() {
    init_import_meta_url();
    BARE_KEY2 = /^[a-z0-9-_]+$/i;
    __name(extendedTypeOf2, "extendedTypeOf");
    __name(isArrayOfTables2, "isArrayOfTables");
    __name(formatString2, "formatString");
    __name(stringifyValue2, "stringifyValue");
    __name(stringifyInlineTable2, "stringifyInlineTable");
    __name(stringifyArray2, "stringifyArray");
    __name(stringifyArrayTable2, "stringifyArrayTable");
    __name(stringifyTable2, "stringifyTable");
    __name(stringify2, "stringify");
  }
});

// ../../node_modules/.pnpm/smol-toml@1.5.2/node_modules/smol-toml/dist/index.js
var dist_default2;
var init_dist5 = __esm({
  "../../node_modules/.pnpm/smol-toml@1.5.2/node_modules/smol-toml/dist/index.js"() {
    init_import_meta_url();
    init_parse();
    init_stringify();
    init_date();
    init_error3();
    dist_default2 = { parse: parse4, stringify: stringify2, TomlDate: TomlDate2, TomlError: TomlError2 };
  }
});
function absolute2(input, root) {
  return path3.isAbsolute(input) ? input : path3.resolve(root || ".", input);
}
var init_resolve = __esm({
  "../../node_modules/.pnpm/empathic@2.0.0/node_modules/empathic/resolve.mjs"() {
    init_import_meta_url();
    __name(absolute2, "absolute");
  }
});
function up2(base, options) {
  let { last, cwd: cwd2 } = options || {};
  let tmp = absolute2(base, cwd2);
  let root = absolute2(last || "/", cwd2);
  let prev, arr = [];
  while (prev !== root) {
    arr.push(tmp);
    tmp = path3.dirname(prev = tmp);
    if (tmp === prev) break;
  }
  return arr;
}
var init_walk = __esm({
  "../../node_modules/.pnpm/empathic@2.0.0/node_modules/empathic/walk.mjs"() {
    init_import_meta_url();
    init_resolve();
    __name(up2, "up");
  }
});
function file2(name2, options) {
  let dir2, tmp;
  let start = options && options.cwd || "";
  for (dir2 of up2(start, options)) {
    try {
      tmp = path3.join(dir2, name2);
      if (fs29.statSync(tmp).isFile()) return tmp;
    } catch {
    }
  }
}
function dir(name2, options) {
  let dir2, tmp;
  let start = options && options.cwd || "";
  for (dir2 of up2(start, options)) {
    try {
      tmp = path3.join(dir2, name2);
      if (fs29.statSync(tmp).isDirectory()) return tmp;
    } catch {
    }
  }
}
var init_find = __esm({
  "../../node_modules/.pnpm/empathic@2.0.0/node_modules/empathic/find.mjs"() {
    init_import_meta_url();
    init_walk();
    __name(file2, "file");
    __name(dir, "dir");
  }
});
function getCacheFolder() {
  const envCacheDir = getWranglerCacheDirFromEnv();
  if (envCacheDir) {
    return envCacheDir;
  }
  const closestNodeModulesDirectory = dir("node_modules");
  const nodeModulesCache = closestNodeModulesDirectory ? path3__namespace.join(closestNodeModulesDirectory, ".cache", "wrangler") : null;
  const wranglerCache = path3__namespace.join(process.cwd(), ".wrangler", "cache");
  if (nodeModulesCache && fs29.existsSync(nodeModulesCache)) {
    return nodeModulesCache;
  }
  if (fs29.existsSync(wranglerCache)) {
    return wranglerCache;
  }
  if (nodeModulesCache) {
    return nodeModulesCache;
  }
  return wranglerCache;
}
function showCacheMessage(fields, folder) {
  if (!cacheMessageShown && !isNonInteractiveOrCI()) {
    if (fields.length > 0) {
      logger.debug(
        `Retrieving cached values for ${arrayFormatter.format(
          fields
        )} from ${path3__namespace.relative(process.cwd(), folder)}`
      );
      cacheMessageShown = true;
    }
  }
}
function getConfigCache(fileName) {
  try {
    const cacheFolder = getCacheFolder();
    const configCacheLocation = path3__namespace.join(cacheFolder, fileName);
    const configCache = JSON.parse(fs29.readFileSync(configCacheLocation, "utf-8"));
    showCacheMessage(Object.keys(configCache), cacheFolder);
    return configCache;
  } catch {
    return {};
  }
}
function saveToConfigCache(fileName, newValues) {
  const cacheFolder = getCacheFolder();
  if (cacheFolder) {
    logger.debug(`Saving to cache: ${JSON.stringify(newValues)}`);
    const configCacheLocation = path3__namespace.join(cacheFolder, fileName);
    const existingValues = getConfigCache(fileName);
    fs29.mkdirSync(path3__namespace.dirname(configCacheLocation), { recursive: true });
    fs29.writeFileSync(
      configCacheLocation,
      JSON.stringify({ ...existingValues, ...newValues }, null, 2)
    );
  }
}
function purgeConfigCaches() {
  const cacheFolder = getCacheFolder();
  if (cacheFolder) {
    removeDirSync(cacheFolder);
  }
}
var cacheMessageShown, arrayFormatter;
var init_config_cache = __esm({
  "src/config-cache.ts"() {
    init_import_meta_url();
    init_dist();
    init_find();
    init_is_interactive();
    init_logger();
    cacheMessageShown = false;
    __name(getCacheFolder, "getCacheFolder");
    arrayFormatter = new Intl.ListFormat("en-US", {
      style: "long",
      type: "conjunction"
    });
    __name(showCacheMessage, "showCacheMessage");
    __name(getConfigCache, "getConfigCache");
    __name(saveToConfigCache, "saveToConfigCache");
    __name(purgeConfigCaches, "purgeConfigCaches");
  }
});

// ../../node_modules/.pnpm/kleur@3.0.3/node_modules/kleur/index.js
var require_kleur = __commonJS({
  "../../node_modules/.pnpm/kleur@3.0.3/node_modules/kleur/index.js"(exports, module2) {
    init_import_meta_url();
    var { FORCE_COLOR, NODE_DISABLE_COLORS, TERM } = process.env;
    var $3 = {
      enabled: !NODE_DISABLE_COLORS && TERM !== "dumb" && FORCE_COLOR !== "0",
      // modifiers
      reset: init4(0, 0),
      bold: init4(1, 22),
      dim: init4(2, 22),
      italic: init4(3, 23),
      underline: init4(4, 24),
      inverse: init4(7, 27),
      hidden: init4(8, 28),
      strikethrough: init4(9, 29),
      // colors
      black: init4(30, 39),
      red: init4(31, 39),
      green: init4(32, 39),
      yellow: init4(33, 39),
      blue: init4(34, 39),
      magenta: init4(35, 39),
      cyan: init4(36, 39),
      white: init4(37, 39),
      gray: init4(90, 39),
      grey: init4(90, 39),
      // background colors
      bgBlack: init4(40, 49),
      bgRed: init4(41, 49),
      bgGreen: init4(42, 49),
      bgYellow: init4(43, 49),
      bgBlue: init4(44, 49),
      bgMagenta: init4(45, 49),
      bgCyan: init4(46, 49),
      bgWhite: init4(47, 49)
    };
    function run2(arr, str) {
      let i7 = 0, tmp, beg = "", end = "";
      for (; i7 < arr.length; i7++) {
        tmp = arr[i7];
        beg += tmp.open;
        end += tmp.close;
        if (str.includes(tmp.close)) {
          str = str.replace(tmp.rgx, tmp.close + tmp.open);
        }
      }
      return beg + str + end;
    }
    __name(run2, "run");
    function chain2(has2, keys) {
      let ctx = { has: has2, keys };
      ctx.reset = $3.reset.bind(ctx);
      ctx.bold = $3.bold.bind(ctx);
      ctx.dim = $3.dim.bind(ctx);
      ctx.italic = $3.italic.bind(ctx);
      ctx.underline = $3.underline.bind(ctx);
      ctx.inverse = $3.inverse.bind(ctx);
      ctx.hidden = $3.hidden.bind(ctx);
      ctx.strikethrough = $3.strikethrough.bind(ctx);
      ctx.black = $3.black.bind(ctx);
      ctx.red = $3.red.bind(ctx);
      ctx.green = $3.green.bind(ctx);
      ctx.yellow = $3.yellow.bind(ctx);
      ctx.blue = $3.blue.bind(ctx);
      ctx.magenta = $3.magenta.bind(ctx);
      ctx.cyan = $3.cyan.bind(ctx);
      ctx.white = $3.white.bind(ctx);
      ctx.gray = $3.gray.bind(ctx);
      ctx.grey = $3.grey.bind(ctx);
      ctx.bgBlack = $3.bgBlack.bind(ctx);
      ctx.bgRed = $3.bgRed.bind(ctx);
      ctx.bgGreen = $3.bgGreen.bind(ctx);
      ctx.bgYellow = $3.bgYellow.bind(ctx);
      ctx.bgBlue = $3.bgBlue.bind(ctx);
      ctx.bgMagenta = $3.bgMagenta.bind(ctx);
      ctx.bgCyan = $3.bgCyan.bind(ctx);
      ctx.bgWhite = $3.bgWhite.bind(ctx);
      return ctx;
    }
    __name(chain2, "chain");
    function init4(open3, close2) {
      let blk = {
        open: `\x1B[${open3}m`,
        close: `\x1B[${close2}m`,
        rgx: new RegExp(`\\x1b\\[${close2}m`, "g")
      };
      return function(txt) {
        if (this !== void 0 && this.has !== void 0) {
          this.has.includes(open3) || (this.has.push(open3), this.keys.push(blk));
          return txt === void 0 ? this : $3.enabled ? run2(this.keys, txt + "") : txt + "";
        }
        return txt === void 0 ? chain2([open3], [blk]) : $3.enabled ? run2([blk], txt + "") : txt + "";
      };
    }
    __name(init4, "init");
    module2.exports = $3;
  }
});

// ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/action.js
var require_action = __commonJS({
  "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/action.js"(exports, module2) {
    init_import_meta_url();
    module2.exports = (key, isSelect) => {
      if (key.meta && key.name !== "escape") return;
      if (key.ctrl) {
        if (key.name === "a") return "first";
        if (key.name === "c") return "abort";
        if (key.name === "d") return "abort";
        if (key.name === "e") return "last";
        if (key.name === "g") return "reset";
      }
      if (isSelect) {
        if (key.name === "j") return "down";
        if (key.name === "k") return "up";
      }
      if (key.name === "return") return "submit";
      if (key.name === "enter") return "submit";
      if (key.name === "backspace") return "delete";
      if (key.name === "delete") return "deleteForward";
      if (key.name === "abort") return "abort";
      if (key.name === "escape") return "exit";
      if (key.name === "tab") return "next";
      if (key.name === "pagedown") return "nextPage";
      if (key.name === "pageup") return "prevPage";
      if (key.name === "home") return "home";
      if (key.name === "end") return "end";
      if (key.name === "up") return "up";
      if (key.name === "down") return "down";
      if (key.name === "right") return "right";
      if (key.name === "left") return "left";
      return false;
    };
  }
});

// ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/strip.js
var require_strip = __commonJS({
  "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/strip.js"(exports, module2) {
    init_import_meta_url();
    module2.exports = (str) => {
      const pattern = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|");
      const RGX = new RegExp(pattern, "g");
      return typeof str === "string" ? str.replace(RGX, "") : str;
    };
  }
});

// ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/clear.js
var require_clear = __commonJS({
  "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/clear.js"(exports, module2) {
    init_import_meta_url();
    function _createForOfIteratorHelper(o7, allowArrayLike) {
      var it2 = typeof Symbol !== "undefined" && o7[Symbol.iterator] || o7["@@iterator"];
      if (!it2) {
        if (Array.isArray(o7) || (it2 = _unsupportedIterableToArray(o7)) || allowArrayLike && o7 && typeof o7.length === "number") {
          if (it2) o7 = it2;
          var i7 = 0;
          var F4 = /* @__PURE__ */ __name(function F5() {
          }, "F");
          return { s: F4, n: /* @__PURE__ */ __name(function n9() {
            if (i7 >= o7.length) return { done: true };
            return { done: false, value: o7[i7++] };
          }, "n"), e: /* @__PURE__ */ __name(function e10(_e3) {
            throw _e3;
          }, "e"), f: F4 };
        }
        throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
      }
      var normalCompletion = true, didErr = false, err;
      return { s: /* @__PURE__ */ __name(function s7() {
        it2 = it2.call(o7);
      }, "s"), n: /* @__PURE__ */ __name(function n9() {
        var step = it2.next();
        normalCompletion = step.done;
        return step;
      }, "n"), e: /* @__PURE__ */ __name(function e10(_e22) {
        didErr = true;
        err = _e22;
      }, "e"), f: /* @__PURE__ */ __name(function f8() {
        try {
          if (!normalCompletion && it2.return != null) it2.return();
        } finally {
          if (didErr) throw err;
        }
      }, "f") };
    }
    __name(_createForOfIteratorHelper, "_createForOfIteratorHelper");
    function _unsupportedIterableToArray(o7, minLen) {
      if (!o7) return;
      if (typeof o7 === "string") return _arrayLikeToArray(o7, minLen);
      var n9 = Object.prototype.toString.call(o7).slice(8, -1);
      if (n9 === "Object" && o7.constructor) n9 = o7.constructor.name;
      if (n9 === "Map" || n9 === "Set") return Array.from(o7);
      if (n9 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n9)) return _arrayLikeToArray(o7, minLen);
    }
    __name(_unsupportedIterableToArray, "_unsupportedIterableToArray");
    function _arrayLikeToArray(arr, len) {
      if (len == null || len > arr.length) len = arr.length;
      for (var i7 = 0, arr2 = new Array(len); i7 < len; i7++) arr2[i7] = arr[i7];
      return arr2;
    }
    __name(_arrayLikeToArray, "_arrayLikeToArray");
    var strip = require_strip();
    var _require = require_src2();
    var erase = _require.erase;
    var cursor = _require.cursor;
    var width = /* @__PURE__ */ __name((str) => [...strip(str)].length, "width");
    module2.exports = function(prompt2, perLine) {
      if (!perLine) return erase.line + cursor.to(0);
      let rows = 0;
      const lines = prompt2.split(/\r?\n/);
      var _iterator = _createForOfIteratorHelper(lines), _step;
      try {
        for (_iterator.s(); !(_step = _iterator.n()).done; ) {
          let line = _step.value;
          rows += 1 + Math.floor(Math.max(width(line) - 1, 0) / perLine);
        }
      } catch (err) {
        _iterator.e(err);
      } finally {
        _iterator.f();
      }
      return erase.lines(rows);
    };
  }
});

// ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/figures.js
var require_figures = __commonJS({
  "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/figures.js"(exports, module2) {
    init_import_meta_url();
    var main2 = {
      arrowUp: "\u2191",
      arrowDown: "\u2193",
      arrowLeft: "\u2190",
      arrowRight: "\u2192",
      radioOn: "\u25C9",
      radioOff: "\u25EF",
      tick: "\u2714",
      cross: "\u2716",
      ellipsis: "\u2026",
      pointerSmall: "\u203A",
      line: "\u2500",
      pointer: "\u276F"
    };
    var win = {
      arrowUp: main2.arrowUp,
      arrowDown: main2.arrowDown,
      arrowLeft: main2.arrowLeft,
      arrowRight: main2.arrowRight,
      radioOn: "(*)",
      radioOff: "( )",
      tick: "\u221A",
      cross: "\xD7",
      ellipsis: "...",
      pointerSmall: "\xBB",
      line: "\u2500",
      pointer: ">"
    };
    var figures = process.platform === "win32" ? win : main2;
    module2.exports = figures;
  }
});

// ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/style.js
var require_style = __commonJS({
  "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/style.js"(exports, module2) {
    init_import_meta_url();
    var c8 = require_kleur();
    var figures = require_figures();
    var styles4 = Object.freeze({
      password: {
        scale: 1,
        render: /* @__PURE__ */ __name((input) => "*".repeat(input.length), "render")
      },
      emoji: {
        scale: 2,
        render: /* @__PURE__ */ __name((input) => "\u{1F603}".repeat(input.length), "render")
      },
      invisible: {
        scale: 0,
        render: /* @__PURE__ */ __name((input) => "", "render")
      },
      default: {
        scale: 1,
        render: /* @__PURE__ */ __name((input) => `${input}`, "render")
      }
    });
    var render2 = /* @__PURE__ */ __name((type) => styles4[type] || styles4.default, "render");
    var symbols = Object.freeze({
      aborted: c8.red(figures.cross),
      done: c8.green(figures.tick),
      exited: c8.yellow(figures.cross),
      default: c8.cyan("?")
    });
    var symbol = /* @__PURE__ */ __name((done, aborted, exited) => aborted ? symbols.aborted : exited ? symbols.exited : done ? symbols.done : symbols.default, "symbol");
    var delimiter = /* @__PURE__ */ __name((completing) => c8.gray(completing ? figures.ellipsis : figures.pointerSmall), "delimiter");
    var item = /* @__PURE__ */ __name((expandable, expanded) => c8.gray(expandable ? expanded ? figures.pointerSmall : "+" : figures.line), "item");
    module2.exports = {
      styles: styles4,
      render: render2,
      symbols,
      symbol,
      delimiter,
      item
    };
  }
});

// ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/lines.js
var require_lines = __commonJS({
  "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/lines.js"(exports, module2) {
    init_import_meta_url();
    var strip = require_strip();
    module2.exports = function(msg, perLine) {
      let lines = String(strip(msg) || "").split(/\r?\n/);
      if (!perLine) return lines.length;
      return lines.map((l8) => Math.ceil(l8.length / perLine)).reduce((a7, b11) => a7 + b11);
    };
  }
});

// ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/wrap.js
var require_wrap = __commonJS({
  "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/wrap.js"(exports, module2) {
    init_import_meta_url();
    module2.exports = (msg, opts = {}) => {
      const tab = Number.isSafeInteger(parseInt(opts.margin)) ? new Array(parseInt(opts.margin)).fill(" ").join("") : opts.margin || "";
      const width = opts.width;
      return (msg || "").split(/\r?\n/g).map((line) => line.split(/\s+/g).reduce((arr, w7) => {
        if (w7.length + tab.length >= width || arr[arr.length - 1].length + w7.length + 1 < width) arr[arr.length - 1] += ` ${w7}`;
        else arr.push(`${tab}${w7}`);
        return arr;
      }, [tab]).join("\n")).join("\n");
    };
  }
});

// ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/entriesToDisplay.js
var require_entriesToDisplay = __commonJS({
  "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/entriesToDisplay.js"(exports, module2) {
    init_import_meta_url();
    module2.exports = (cursor, total, maxVisible) => {
      maxVisible = maxVisible || total;
      let startIndex = Math.min(total - maxVisible, cursor - Math.floor(maxVisible / 2));
      if (startIndex < 0) startIndex = 0;
      let endIndex = Math.min(startIndex + maxVisible, total);
      return {
        startIndex,
        endIndex
      };
    };
  }
});

// ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/index.js
var require_util7 = __commonJS({
  "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/index.js"(exports, module2) {
    init_import_meta_url();
    module2.exports = {
      action: require_action(),
      clear: require_clear(),
      style: require_style(),
      strip: require_strip(),
      figures: require_figures(),
      lines: require_lines(),
      wrap: require_wrap(),
      entriesToDisplay: require_entriesToDisplay()
    };
  }
});

// ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/prompt.js
var require_prompt = __commonJS({
  "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/prompt.js"(exports, module2) {
    init_import_meta_url();
    var readline3 = __require("readline");
    var _require = require_util7();
    var action = _require.action;
    var EventEmitter5 = __require("events");
    var _require2 = require_src2();
    var beep = _require2.beep;
    var cursor = _require2.cursor;
    var color = require_kleur();
    var Prompt = class extends EventEmitter5 {
      static {
        __name(this, "Prompt");
      }
      constructor(opts = {}) {
        super();
        this.firstRender = true;
        this.in = opts.stdin || process.stdin;
        this.out = opts.stdout || process.stdout;
        this.onRender = (opts.onRender || (() => void 0)).bind(this);
        const rl = readline3.createInterface({
          input: this.in,
          escapeCodeTimeout: 50
        });
        readline3.emitKeypressEvents(this.in, rl);
        if (this.in.isTTY) this.in.setRawMode(true);
        const isSelect = ["SelectPrompt", "MultiselectPrompt"].indexOf(this.constructor.name) > -1;
        const keypress = /* @__PURE__ */ __name((str, key) => {
          let a7 = action(key, isSelect);
          if (a7 === false) {
            this._ && this._(str, key);
          } else if (typeof this[a7] === "function") {
            this[a7](key);
          } else {
            this.bell();
          }
        }, "keypress");
        this.close = () => {
          this.out.write(cursor.show);
          this.in.removeListener("keypress", keypress);
          if (this.in.isTTY) this.in.setRawMode(false);
          rl.close();
          this.emit(this.aborted ? "abort" : this.exited ? "exit" : "submit", this.value);
          this.closed = true;
        };
        this.in.on("keypress", keypress);
      }
      fire() {
        this.emit("state", {
          value: this.value,
          aborted: !!this.aborted,
          exited: !!this.exited
        });
      }
      bell() {
        this.out.write(beep);
      }
      render() {
        this.onRender(color);
        if (this.firstRender) this.firstRender = false;
      }
    };
    module2.exports = Prompt;
  }
});

// ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/text.js
var require_text = __commonJS({
  "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/text.js"(exports, module2) {
    init_import_meta_url();
    function asyncGeneratorStep(gen, resolve32, reject, _next, _throw, key, arg) {
      try {
        var info = gen[key](arg);
        var value = info.value;
      } catch (error2) {
        reject(error2);
        return;
      }
      if (info.done) {
        resolve32(value);
      } else {
        Promise.resolve(value).then(_next, _throw);
      }
    }
    __name(asyncGeneratorStep, "asyncGeneratorStep");
    function _asyncToGenerator(fn2) {
      return function() {
        var self2 = this, args = arguments;
        return new Promise(function(resolve32, reject) {
          var gen = fn2.apply(self2, args);
          function _next(value) {
            asyncGeneratorStep(gen, resolve32, reject, _next, _throw, "next", value);
          }
          __name(_next, "_next");
          function _throw(err) {
            asyncGeneratorStep(gen, resolve32, reject, _next, _throw, "throw", err);
          }
          __name(_throw, "_throw");
          _next(void 0);
        });
      };
    }
    __name(_asyncToGenerator, "_asyncToGenerator");
    var color = require_kleur();
    var Prompt = require_prompt();
    var _require = require_src2();
    var erase = _require.erase;
    var cursor = _require.cursor;
    var _require2 = require_util7();
    var style = _require2.style;
    var clear = _require2.clear;
    var lines = _require2.lines;
    var figures = _require2.figures;
    var TextPrompt = class extends Prompt {
      static {
        __name(this, "TextPrompt");
      }
      constructor(opts = {}) {
        super(opts);
        this.transform = style.render(opts.style);
        this.scale = this.transform.scale;
        this.msg = opts.message;
        this.initial = opts.initial || ``;
        this.validator = opts.validate || (() => true);
        this.value = ``;
        this.errorMsg = opts.error || `Please Enter A Valid Value`;
        this.cursor = Number(!!this.initial);
        this.cursorOffset = 0;
        this.clear = clear(``, this.out.columns);
        this.render();
      }
      set value(v8) {
        if (!v8 && this.initial) {
          this.placeholder = true;
          this.rendered = color.gray(this.transform.render(this.initial));
        } else {
          this.placeholder = false;
          this.rendered = this.transform.render(v8);
        }
        this._value = v8;
        this.fire();
      }
      get value() {
        return this._value;
      }
      reset() {
        this.value = ``;
        this.cursor = Number(!!this.initial);
        this.cursorOffset = 0;
        this.fire();
        this.render();
      }
      exit() {
        this.abort();
      }
      abort() {
        this.value = this.value || this.initial;
        this.done = this.aborted = true;
        this.error = false;
        this.red = false;
        this.fire();
        this.render();
        this.out.write("\n");
        this.close();
      }
      validate() {
        var _this = this;
        return _asyncToGenerator(function* () {
          let valid = yield _this.validator(_this.value);
          if (typeof valid === `string`) {
            _this.errorMsg = valid;
            valid = false;
          }
          _this.error = !valid;
        })();
      }
      submit() {
        var _this2 = this;
        return _asyncToGenerator(function* () {
          _this2.value = _this2.value || _this2.initial;
          _this2.cursorOffset = 0;
          _this2.cursor = _this2.rendered.length;
          yield _this2.validate();
          if (_this2.error) {
            _this2.red = true;
            _this2.fire();
            _this2.render();
            return;
          }
          _this2.done = true;
          _this2.aborted = false;
          _this2.fire();
          _this2.render();
          _this2.out.write("\n");
          _this2.close();
        })();
      }
      next() {
        if (!this.placeholder) return this.bell();
        this.value = this.initial;
        this.cursor = this.rendered.length;
        this.fire();
        this.render();
      }
      moveCursor(n9) {
        if (this.placeholder) return;
        this.cursor = this.cursor + n9;
        this.cursorOffset += n9;
      }
      _(c8, key) {
        let s1 = this.value.slice(0, this.cursor);
        let s22 = this.value.slice(this.cursor);
        this.value = `${s1}${c8}${s22}`;
        this.red = false;
        this.cursor = this.placeholder ? 0 : s1.length + 1;
        this.render();
      }
      delete() {
        if (this.isCursorAtStart()) return this.bell();
        let s1 = this.value.slice(0, this.cursor - 1);
        let s22 = this.value.slice(this.cursor);
        this.value = `${s1}${s22}`;
        this.red = false;
        if (this.isCursorAtStart()) {
          this.cursorOffset = 0;
        } else {
          this.cursorOffset++;
          this.moveCursor(-1);
        }
        this.render();
      }
      deleteForward() {
        if (this.cursor * this.scale >= this.rendered.length || this.placeholder) return this.bell();
        let s1 = this.value.slice(0, this.cursor);
        let s22 = this.value.slice(this.cursor + 1);
        this.value = `${s1}${s22}`;
        this.red = false;
        if (this.isCursorAtEnd()) {
          this.cursorOffset = 0;
        } else {
          this.cursorOffset++;
        }
        this.render();
      }
      first() {
        this.cursor = 0;
        this.render();
      }
      last() {
        this.cursor = this.value.length;
        this.render();
      }
      left() {
        if (this.cursor <= 0 || this.placeholder) return this.bell();
        this.moveCursor(-1);
        this.render();
      }
      right() {
        if (this.cursor * this.scale >= this.rendered.length || this.placeholder) return this.bell();
        this.moveCursor(1);
        this.render();
      }
      isCursorAtStart() {
        return this.cursor === 0 || this.placeholder && this.cursor === 1;
      }
      isCursorAtEnd() {
        return this.cursor === this.rendered.length || this.placeholder && this.cursor === this.rendered.length + 1;
      }
      render() {
        if (this.closed) return;
        if (!this.firstRender) {
          if (this.outputError) this.out.write(cursor.down(lines(this.outputError, this.out.columns) - 1) + clear(this.outputError, this.out.columns));
          this.out.write(clear(this.outputText, this.out.columns));
        }
        super.render();
        this.outputError = "";
        this.outputText = [style.symbol(this.done, this.aborted), color.bold(this.msg), style.delimiter(this.done), this.red ? color.red(this.rendered) : this.rendered].join(` `);
        if (this.error) {
          this.outputError += this.errorMsg.split(`
`).reduce((a7, l8, i7) => a7 + `
${i7 ? " " : figures.pointerSmall} ${color.red().italic(l8)}`, ``);
        }
        this.out.write(erase.line + cursor.to(0) + this.outputText + cursor.save + this.outputError + cursor.restore + cursor.move(this.cursorOffset, 0));
      }
    };
    module2.exports = TextPrompt;
  }
});

// ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/select.js
var require_select = __commonJS({
  "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/select.js"(exports, module2) {
    init_import_meta_url();
    var color = require_kleur();
    var Prompt = require_prompt();
    var _require = require_util7();
    var style = _require.style;
    var clear = _require.clear;
    var figures = _require.figures;
    var wrap4 = _require.wrap;
    var entriesToDisplay = _require.entriesToDisplay;
    var _require2 = require_src2();
    var cursor = _require2.cursor;
    var SelectPrompt = class extends Prompt {
      static {
        __name(this, "SelectPrompt");
      }
      constructor(opts = {}) {
        super(opts);
        this.msg = opts.message;
        this.hint = opts.hint || "- Use arrow-keys. Return to submit.";
        this.warn = opts.warn || "- This option is disabled";
        this.cursor = opts.initial || 0;
        this.choices = opts.choices.map((ch2, idx) => {
          if (typeof ch2 === "string") ch2 = {
            title: ch2,
            value: idx
          };
          return {
            title: ch2 && (ch2.title || ch2.value || ch2),
            value: ch2 && (ch2.value === void 0 ? idx : ch2.value),
            description: ch2 && ch2.description,
            selected: ch2 && ch2.selected,
            disabled: ch2 && ch2.disabled
          };
        });
        this.optionsPerPage = opts.optionsPerPage || 10;
        this.value = (this.choices[this.cursor] || {}).value;
        this.clear = clear("", this.out.columns);
        this.render();
      }
      moveCursor(n9) {
        this.cursor = n9;
        this.value = this.choices[n9].value;
        this.fire();
      }
      reset() {
        this.moveCursor(0);
        this.fire();
        this.render();
      }
      exit() {
        this.abort();
      }
      abort() {
        this.done = this.aborted = true;
        this.fire();
        this.render();
        this.out.write("\n");
        this.close();
      }
      submit() {
        if (!this.selection.disabled) {
          this.done = true;
          this.aborted = false;
          this.fire();
          this.render();
          this.out.write("\n");
          this.close();
        } else this.bell();
      }
      first() {
        this.moveCursor(0);
        this.render();
      }
      last() {
        this.moveCursor(this.choices.length - 1);
        this.render();
      }
      up() {
        if (this.cursor === 0) {
          this.moveCursor(this.choices.length - 1);
        } else {
          this.moveCursor(this.cursor - 1);
        }
        this.render();
      }
      down() {
        if (this.cursor === this.choices.length - 1) {
          this.moveCursor(0);
        } else {
          this.moveCursor(this.cursor + 1);
        }
        this.render();
      }
      next() {
        this.moveCursor((this.cursor + 1) % this.choices.length);
        this.render();
      }
      _(c8, key) {
        if (c8 === " ") return this.submit();
      }
      get selection() {
        return this.choices[this.cursor];
      }
      render() {
        if (this.closed) return;
        if (this.firstRender) this.out.write(cursor.hide);
        else this.out.write(clear(this.outputText, this.out.columns));
        super.render();
        let _entriesToDisplay = entriesToDisplay(this.cursor, this.choices.length, this.optionsPerPage), startIndex = _entriesToDisplay.startIndex, endIndex = _entriesToDisplay.endIndex;
        this.outputText = [style.symbol(this.done, this.aborted), color.bold(this.msg), style.delimiter(false), this.done ? this.selection.title : this.selection.disabled ? color.yellow(this.warn) : color.gray(this.hint)].join(" ");
        if (!this.done) {
          this.outputText += "\n";
          for (let i7 = startIndex; i7 < endIndex; i7++) {
            let title, prefix, desc = "", v8 = this.choices[i7];
            if (i7 === startIndex && startIndex > 0) {
              prefix = figures.arrowUp;
            } else if (i7 === endIndex - 1 && endIndex < this.choices.length) {
              prefix = figures.arrowDown;
            } else {
              prefix = " ";
            }
            if (v8.disabled) {
              title = this.cursor === i7 ? color.gray().underline(v8.title) : color.strikethrough().gray(v8.title);
              prefix = (this.cursor === i7 ? color.bold().gray(figures.pointer) + " " : "  ") + prefix;
            } else {
              title = this.cursor === i7 ? color.cyan().underline(v8.title) : v8.title;
              prefix = (this.cursor === i7 ? color.cyan(figures.pointer) + " " : "  ") + prefix;
              if (v8.description && this.cursor === i7) {
                desc = ` - ${v8.description}`;
                if (prefix.length + title.length + desc.length >= this.out.columns || v8.description.split(/\r?\n/).length > 1) {
                  desc = "\n" + wrap4(v8.description, {
                    margin: 3,
                    width: this.out.columns
                  });
                }
              }
            }
            this.outputText += `${prefix} ${title}${color.gray(desc)}
`;
          }
        }
        this.out.write(this.outputText);
      }
    };
    module2.exports = SelectPrompt;
  }
});

// ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/toggle.js
var require_toggle = __commonJS({
  "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/toggle.js"(exports, module2) {
    init_import_meta_url();
    var color = require_kleur();
    var Prompt = require_prompt();
    var _require = require_util7();
    var style = _require.style;
    var clear = _require.clear;
    var _require2 = require_src2();
    var cursor = _require2.cursor;
    var erase = _require2.erase;
    var TogglePrompt = class extends Prompt {
      static {
        __name(this, "TogglePrompt");
      }
      constructor(opts = {}) {
        super(opts);
        this.msg = opts.message;
        this.value = !!opts.initial;
        this.active = opts.active || "on";
        this.inactive = opts.inactive || "off";
        this.initialValue = this.value;
        this.render();
      }
      reset() {
        this.value = this.initialValue;
        this.fire();
        this.render();
      }
      exit() {
        this.abort();
      }
      abort() {
        this.done = this.aborted = true;
        this.fire();
        this.render();
        this.out.write("\n");
        this.close();
      }
      submit() {
        this.done = true;
        this.aborted = false;
        this.fire();
        this.render();
        this.out.write("\n");
        this.close();
      }
      deactivate() {
        if (this.value === false) return this.bell();
        this.value = false;
        this.render();
      }
      activate() {
        if (this.value === true) return this.bell();
        this.value = true;
        this.render();
      }
      delete() {
        this.deactivate();
      }
      left() {
        this.deactivate();
      }
      right() {
        this.activate();
      }
      down() {
        this.deactivate();
      }
      up() {
        this.activate();
      }
      next() {
        this.value = !this.value;
        this.fire();
        this.render();
      }
      _(c8, key) {
        if (c8 === " ") {
          this.value = !this.value;
        } else if (c8 === "1") {
          this.value = true;
        } else if (c8 === "0") {
          this.value = false;
        } else return this.bell();
        this.render();
      }
      render() {
        if (this.closed) return;
        if (this.firstRender) this.out.write(cursor.hide);
        else this.out.write(clear(this.outputText, this.out.columns));
        super.render();
        this.outputText = [style.symbol(this.done, this.aborted), color.bold(this.msg), style.delimiter(this.done), this.value ? this.inactive : color.cyan().underline(this.inactive), color.gray("/"), this.value ? color.cyan().underline(this.active) : this.active].join(" ");
        this.out.write(erase.line + cursor.to(0) + this.outputText);
      }
    };
    module2.exports = TogglePrompt;
  }
});

// ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/datepart.js
var require_datepart = __commonJS({
  "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/datepart.js"(exports, module2) {
    init_import_meta_url();
    var DatePart = class _DatePart {
      static {
        __name(this, "DatePart");
      }
      constructor({
        token,
        date,
        parts,
        locales
      }) {
        this.token = token;
        this.date = date || /* @__PURE__ */ new Date();
        this.parts = parts || [this];
        this.locales = locales || {};
      }
      up() {
      }
      down() {
      }
      next() {
        const currentIdx = this.parts.indexOf(this);
        return this.parts.find((part, idx) => idx > currentIdx && part instanceof _DatePart);
      }
      setTo(val2) {
      }
      prev() {
        let parts = [].concat(this.parts).reverse();
        const currentIdx = parts.indexOf(this);
        return parts.find((part, idx) => idx > currentIdx && part instanceof _DatePart);
      }
      toString() {
        return String(this.date);
      }
    };
    module2.exports = DatePart;
  }
});

// ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/meridiem.js
var require_meridiem = __commonJS({
  "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/meridiem.js"(exports, module2) {
    init_import_meta_url();
    var DatePart = require_datepart();
    var Meridiem = class extends DatePart {
      static {
        __name(this, "Meridiem");
      }
      constructor(opts = {}) {
        super(opts);
      }
      up() {
        this.date.setHours((this.date.getHours() + 12) % 24);
      }
      down() {
        this.up();
      }
      toString() {
        let meridiem = this.date.getHours() > 12 ? "pm" : "am";
        return /\A/.test(this.token) ? meridiem.toUpperCase() : meridiem;
      }
    };
    module2.exports = Meridiem;
  }
});

// ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/day.js
var require_day = __commonJS({
  "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/day.js"(exports, module2) {
    init_import_meta_url();
    var DatePart = require_datepart();
    var pos = /* @__PURE__ */ __name((n9) => {
      n9 = n9 % 10;
      return n9 === 1 ? "st" : n9 === 2 ? "nd" : n9 === 3 ? "rd" : "th";
    }, "pos");
    var Day = class extends DatePart {
      static {
        __name(this, "Day");
      }
      constructor(opts = {}) {
        super(opts);
      }
      up() {
        this.date.setDate(this.date.getDate() + 1);
      }
      down() {
        this.date.setDate(this.date.getDate() - 1);
      }
      setTo(val2) {
        this.date.setDate(parseInt(val2.substr(-2)));
      }
      toString() {
        let date = this.date.getDate();
        let day = this.date.getDay();
        return this.token === "DD" ? String(date).padStart(2, "0") : this.token === "Do" ? date + pos(date) : this.token === "d" ? day + 1 : this.token === "ddd" ? this.locales.weekdaysShort[day] : this.token === "dddd" ? this.locales.weekdays[day] : date;
      }
    };
    module2.exports = Day;
  }
});

// ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/hours.js
var require_hours = __commonJS({
  "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/hours.js"(exports, module2) {
    init_import_meta_url();
    var DatePart = require_datepart();
    var Hours = class extends DatePart {
      static {
        __name(this, "Hours");
      }
      constructor(opts = {}) {
        super(opts);
      }
      up() {
        this.date.setHours(this.date.getHours() + 1);
      }
      down() {
        this.date.setHours(this.date.getHours() - 1);
      }
      setTo(val2) {
        this.date.setHours(parseInt(val2.substr(-2)));
      }
      toString() {
        let hours = this.date.getHours();
        if (/h/.test(this.token)) hours = hours % 12 || 12;
        return this.token.length > 1 ? String(hours).padStart(2, "0") : hours;
      }
    };
    module2.exports = Hours;
  }
});

// ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/milliseconds.js
var require_milliseconds = __commonJS({
  "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/milliseconds.js"(exports, module2) {
    init_import_meta_url();
    var DatePart = require_datepart();
    var Milliseconds = class extends DatePart {
      static {
        __name(this, "Milliseconds");
      }
      constructor(opts = {}) {
        super(opts);
      }
      up() {
        this.date.setMilliseconds(this.date.getMilliseconds() + 1);
      }
      down() {
        this.date.setMilliseconds(this.date.getMilliseconds() - 1);
      }
      setTo(val2) {
        this.date.setMilliseconds(parseInt(val2.substr(-this.token.length)));
      }
      toString() {
        return String(this.date.getMilliseconds()).padStart(4, "0").substr(0, this.token.length);
      }
    };
    module2.exports = Milliseconds;
  }
});

// ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/minutes.js
var require_minutes = __commonJS({
  "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/minutes.js"(exports, module2) {
    init_import_meta_url();
    var DatePart = require_datepart();
    var Minutes = class extends DatePart {
      static {
        __name(this, "Minutes");
      }
      constructor(opts = {}) {
        super(opts);
      }
      up() {
        this.date.setMinutes(this.date.getMinutes() + 1);
      }
      down() {
        this.date.setMinutes(this.date.getMinutes() - 1);
      }
      setTo(val2) {
        this.date.setMinutes(parseInt(val2.substr(-2)));
      }
      toString() {
        let m7 = this.date.getMinutes();
        return this.token.length > 1 ? String(m7).padStart(2, "0") : m7;
      }
    };
    module2.exports = Minutes;
  }
});

// ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/month.js
var require_month = __commonJS({
  "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/month.js"(exports, module2) {
    init_import_meta_url();
    var DatePart = require_datepart();
    var Month = class extends DatePart {
      static {
        __name(this, "Month");
      }
      constructor(opts = {}) {
        super(opts);
      }
      up() {
        this.date.setMonth(this.date.getMonth() + 1);
      }
      down() {
        this.date.setMonth(this.date.getMonth() - 1);
      }
      setTo(val2) {
        val2 = parseInt(val2.substr(-2)) - 1;
        this.date.setMonth(val2 < 0 ? 0 : val2);
      }
      toString() {
        let month = this.date.getMonth();
        let tl = this.token.length;
        return tl === 2 ? String(month + 1).padStart(2, "0") : tl === 3 ? this.locales.monthsShort[month] : tl === 4 ? this.locales.months[month] : String(month + 1);
      }
    };
    module2.exports = Month;
  }
});

// ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/seconds.js
var require_seconds = __commonJS({
  "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/seconds.js"(exports, module2) {
    init_import_meta_url();
    var DatePart = require_datepart();
    var Seconds = class extends DatePart {
      static {
        __name(this, "Seconds");
      }
      constructor(opts = {}) {
        super(opts);
      }
      up() {
        this.date.setSeconds(this.date.getSeconds() + 1);
      }
      down() {
        this.date.setSeconds(this.date.getSeconds() - 1);
      }
      setTo(val2) {
        this.date.setSeconds(parseInt(val2.substr(-2)));
      }
      toString() {
        let s7 = this.date.getSeconds();
        return this.token.length > 1 ? String(s7).padStart(2, "0") : s7;
      }
    };
    module2.exports = Seconds;
  }
});

// ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/year.js
var require_year = __commonJS({
  "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/year.js"(exports, module2) {
    init_import_meta_url();
    var DatePart = require_datepart();
    var Year = class extends DatePart {
      static {
        __name(this, "Year");
      }
      constructor(opts = {}) {
        super(opts);
      }
      up() {
        this.date.setFullYear(this.date.getFullYear() + 1);
      }
      down() {
        this.date.setFullYear(this.date.getFullYear() - 1);
      }
      setTo(val2) {
        this.date.setFullYear(val2.substr(-4));
      }
      toString() {
        let year = String(this.date.getFullYear()).padStart(4, "0");
        return this.token.length === 2 ? year.substr(-2) : year;
      }
    };
    module2.exports = Year;
  }
});

// ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/index.js
var require_dateparts = __commonJS({
  "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/index.js"(exports, module2) {
    init_import_meta_url();
    module2.exports = {
      DatePart: require_datepart(),
      Meridiem: require_meridiem(),
      Day: require_day(),
      Hours: require_hours(),
      Milliseconds: require_milliseconds(),
      Minutes: require_minutes(),
      Month: require_month(),
      Seconds: require_seconds(),
      Year: require_year()
    };
  }
});

// ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/date.js
var require_date2 = __commonJS({
  "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/date.js"(exports, module2) {
    init_import_meta_url();
    function asyncGeneratorStep(gen, resolve32, reject, _next, _throw, key, arg) {
      try {
        var info = gen[key](arg);
        var value = info.value;
      } catch (error2) {
        reject(error2);
        return;
      }
      if (info.done) {
        resolve32(value);
      } else {
        Promise.resolve(value).then(_next, _throw);
      }
    }
    __name(asyncGeneratorStep, "asyncGeneratorStep");
    function _asyncToGenerator(fn2) {
      return function() {
        var self2 = this, args = arguments;
        return new Promise(function(resolve32, reject) {
          var gen = fn2.apply(self2, args);
          function _next(value) {
            asyncGeneratorStep(gen, resolve32, reject, _next, _throw, "next", value);
          }
          __name(_next, "_next");
          function _throw(err) {
            asyncGeneratorStep(gen, resolve32, reject, _next, _throw, "throw", err);
          }
          __name(_throw, "_throw");
          _next(void 0);
        });
      };
    }
    __name(_asyncToGenerator, "_asyncToGenerator");
    var color = require_kleur();
    var Prompt = require_prompt();
    var _require = require_util7();
    var style = _require.style;
    var clear = _require.clear;
    var figures = _require.figures;
    var _require2 = require_src2();
    var erase = _require2.erase;
    var cursor = _require2.cursor;
    var _require3 = require_dateparts();
    var DatePart = _require3.DatePart;
    var Meridiem = _require3.Meridiem;
    var Day = _require3.Day;
    var Hours = _require3.Hours;
    var Milliseconds = _require3.Milliseconds;
    var Minutes = _require3.Minutes;
    var Month = _require3.Month;
    var Seconds = _require3.Seconds;
    var Year = _require3.Year;
    var regex2 = /\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g;
    var regexGroups = {
      1: ({
        token
      }) => token.replace(/\\(.)/g, "$1"),
      2: (opts) => new Day(opts),
      // Day // TODO
      3: (opts) => new Month(opts),
      // Month
      4: (opts) => new Year(opts),
      // Year
      5: (opts) => new Meridiem(opts),
      // AM/PM // TODO (special)
      6: (opts) => new Hours(opts),
      // Hours
      7: (opts) => new Minutes(opts),
      // Minutes
      8: (opts) => new Seconds(opts),
      // Seconds
      9: (opts) => new Milliseconds(opts)
      // Fractional seconds
    };
    var dfltLocales = {
      months: "January,February,March,April,May,June,July,August,September,October,November,December".split(","),
      monthsShort: "Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),
      weekdays: "Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),
      weekdaysShort: "Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")
    };
    var DatePrompt = class extends Prompt {
      static {
        __name(this, "DatePrompt");
      }
      constructor(opts = {}) {
        super(opts);
        this.msg = opts.message;
        this.cursor = 0;
        this.typed = "";
        this.locales = Object.assign(dfltLocales, opts.locales);
        this._date = opts.initial || /* @__PURE__ */ new Date();
        this.errorMsg = opts.error || "Please Enter A Valid Value";
        this.validator = opts.validate || (() => true);
        this.mask = opts.mask || "YYYY-MM-DD HH:mm:ss";
        this.clear = clear("", this.out.columns);
        this.render();
      }
      get value() {
        return this.date;
      }
      get date() {
        return this._date;
      }
      set date(date) {
        if (date) this._date.setTime(date.getTime());
      }
      set mask(mask) {
        let result;
        this.parts = [];
        while (result = regex2.exec(mask)) {
          let match3 = result.shift();
          let idx = result.findIndex((gr2) => gr2 != null);
          this.parts.push(idx in regexGroups ? regexGroups[idx]({
            token: result[idx] || match3,
            date: this.date,
            parts: this.parts,
            locales: this.locales
          }) : result[idx] || match3);
        }
        let parts = this.parts.reduce((arr, i7) => {
          if (typeof i7 === "string" && typeof arr[arr.length - 1] === "string") arr[arr.length - 1] += i7;
          else arr.push(i7);
          return arr;
        }, []);
        this.parts.splice(0);
        this.parts.push(...parts);
        this.reset();
      }
      moveCursor(n9) {
        this.typed = "";
        this.cursor = n9;
        this.fire();
      }
      reset() {
        this.moveCursor(this.parts.findIndex((p7) => p7 instanceof DatePart));
        this.fire();
        this.render();
      }
      exit() {
        this.abort();
      }
      abort() {
        this.done = this.aborted = true;
        this.error = false;
        this.fire();
        this.render();
        this.out.write("\n");
        this.close();
      }
      validate() {
        var _this = this;
        return _asyncToGenerator(function* () {
          let valid = yield _this.validator(_this.value);
          if (typeof valid === "string") {
            _this.errorMsg = valid;
            valid = false;
          }
          _this.error = !valid;
        })();
      }
      submit() {
        var _this2 = this;
        return _asyncToGenerator(function* () {
          yield _this2.validate();
          if (_this2.error) {
            _this2.color = "red";
            _this2.fire();
            _this2.render();
            return;
          }
          _this2.done = true;
          _this2.aborted = false;
          _this2.fire();
          _this2.render();
          _this2.out.write("\n");
          _this2.close();
        })();
      }
      up() {
        this.typed = "";
        this.parts[this.cursor].up();
        this.render();
      }
      down() {
        this.typed = "";
        this.parts[this.cursor].down();
        this.render();
      }
      left() {
        let prev = this.parts[this.cursor].prev();
        if (prev == null) return this.bell();
        this.moveCursor(this.parts.indexOf(prev));
        this.render();
      }
      right() {
        let next = this.parts[this.cursor].next();
        if (next == null) return this.bell();
        this.moveCursor(this.parts.indexOf(next));
        this.render();
      }
      next() {
        let next = this.parts[this.cursor].next();
        this.moveCursor(next ? this.parts.indexOf(next) : this.parts.findIndex((part) => part instanceof DatePart));
        this.render();
      }
      _(c8) {
        if (/\d/.test(c8)) {
          this.typed += c8;
          this.parts[this.cursor].setTo(this.typed);
          this.render();
        }
      }
      render() {
        if (this.closed) return;
        if (this.firstRender) this.out.write(cursor.hide);
        else this.out.write(clear(this.outputText, this.out.columns));
        super.render();
        this.outputText = [style.symbol(this.done, this.aborted), color.bold(this.msg), style.delimiter(false), this.parts.reduce((arr, p7, idx) => arr.concat(idx === this.cursor && !this.done ? color.cyan().underline(p7.toString()) : p7), []).join("")].join(" ");
        if (this.error) {
          this.outputText += this.errorMsg.split("\n").reduce((a7, l8, i7) => a7 + `
${i7 ? ` ` : figures.pointerSmall} ${color.red().italic(l8)}`, ``);
        }
        this.out.write(erase.line + cursor.to(0) + this.outputText);
      }
    };
    module2.exports = DatePrompt;
  }
});

// ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/number.js
var require_number = __commonJS({
  "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/number.js"(exports, module2) {
    init_import_meta_url();
    function asyncGeneratorStep(gen, resolve32, reject, _next, _throw, key, arg) {
      try {
        var info = gen[key](arg);
        var value = info.value;
      } catch (error2) {
        reject(error2);
        return;
      }
      if (info.done) {
        resolve32(value);
      } else {
        Promise.resolve(value).then(_next, _throw);
      }
    }
    __name(asyncGeneratorStep, "asyncGeneratorStep");
    function _asyncToGenerator(fn2) {
      return function() {
        var self2 = this, args = arguments;
        return new Promise(function(resolve32, reject) {
          var gen = fn2.apply(self2, args);
          function _next(value) {
            asyncGeneratorStep(gen, resolve32, reject, _next, _throw, "next", value);
          }
          __name(_next, "_next");
          function _throw(err) {
            asyncGeneratorStep(gen, resolve32, reject, _next, _throw, "throw", err);
          }
          __name(_throw, "_throw");
          _next(void 0);
        });
      };
    }
    __name(_asyncToGenerator, "_asyncToGenerator");
    var color = require_kleur();
    var Prompt = require_prompt();
    var _require = require_src2();
    var cursor = _require.cursor;
    var erase = _require.erase;
    var _require2 = require_util7();
    var style = _require2.style;
    var figures = _require2.figures;
    var clear = _require2.clear;
    var lines = _require2.lines;
    var isNumber = /[0-9]/;
    var isDef = /* @__PURE__ */ __name((any) => any !== void 0, "isDef");
    var round = /* @__PURE__ */ __name((number, precision) => {
      let factor = Math.pow(10, precision);
      return Math.round(number * factor) / factor;
    }, "round");
    var NumberPrompt = class extends Prompt {
      static {
        __name(this, "NumberPrompt");
      }
      constructor(opts = {}) {
        super(opts);
        this.transform = style.render(opts.style);
        this.msg = opts.message;
        this.initial = isDef(opts.initial) ? opts.initial : "";
        this.float = !!opts.float;
        this.round = opts.round || 2;
        this.inc = opts.increment || 1;
        this.min = isDef(opts.min) ? opts.min : -Infinity;
        this.max = isDef(opts.max) ? opts.max : Infinity;
        this.errorMsg = opts.error || `Please Enter A Valid Value`;
        this.validator = opts.validate || (() => true);
        this.color = `cyan`;
        this.value = ``;
        this.typed = ``;
        this.lastHit = 0;
        this.render();
      }
      set value(v8) {
        if (!v8 && v8 !== 0) {
          this.placeholder = true;
          this.rendered = color.gray(this.transform.render(`${this.initial}`));
          this._value = ``;
        } else {
          this.placeholder = false;
          this.rendered = this.transform.render(`${round(v8, this.round)}`);
          this._value = round(v8, this.round);
        }
        this.fire();
      }
      get value() {
        return this._value;
      }
      parse(x7) {
        return this.float ? parseFloat(x7) : parseInt(x7);
      }
      valid(c8) {
        return c8 === `-` || c8 === `.` && this.float || isNumber.test(c8);
      }
      reset() {
        this.typed = ``;
        this.value = ``;
        this.fire();
        this.render();
      }
      exit() {
        this.abort();
      }
      abort() {
        let x7 = this.value;
        this.value = x7 !== `` ? x7 : this.initial;
        this.done = this.aborted = true;
        this.error = false;
        this.fire();
        this.render();
        this.out.write(`
`);
        this.close();
      }
      validate() {
        var _this = this;
        return _asyncToGenerator(function* () {
          let valid = yield _this.validator(_this.value);
          if (typeof valid === `string`) {
            _this.errorMsg = valid;
            valid = false;
          }
          _this.error = !valid;
        })();
      }
      submit() {
        var _this2 = this;
        return _asyncToGenerator(function* () {
          yield _this2.validate();
          if (_this2.error) {
            _this2.color = `red`;
            _this2.fire();
            _this2.render();
            return;
          }
          let x7 = _this2.value;
          _this2.value = x7 !== `` ? x7 : _this2.initial;
          _this2.done = true;
          _this2.aborted = false;
          _this2.error = false;
          _this2.fire();
          _this2.render();
          _this2.out.write(`
`);
          _this2.close();
        })();
      }
      up() {
        this.typed = ``;
        if (this.value === "") {
          this.value = this.min - this.inc;
        }
        if (this.value >= this.max) return this.bell();
        this.value += this.inc;
        this.color = `cyan`;
        this.fire();
        this.render();
      }
      down() {
        this.typed = ``;
        if (this.value === "") {
          this.value = this.min + this.inc;
        }
        if (this.value <= this.min) return this.bell();
        this.value -= this.inc;
        this.color = `cyan`;
        this.fire();
        this.render();
      }
      delete() {
        let val2 = this.value.toString();
        if (val2.length === 0) return this.bell();
        this.value = this.parse(val2 = val2.slice(0, -1)) || ``;
        if (this.value !== "" && this.value < this.min) {
          this.value = this.min;
        }
        this.color = `cyan`;
        this.fire();
        this.render();
      }
      next() {
        this.value = this.initial;
        this.fire();
        this.render();
      }
      _(c8, key) {
        if (!this.valid(c8)) return this.bell();
        const now = Date.now();
        if (now - this.lastHit > 1e3) this.typed = ``;
        this.typed += c8;
        this.lastHit = now;
        this.color = `cyan`;
        if (c8 === `.`) return this.fire();
        this.value = Math.min(this.parse(this.typed), this.max);
        if (this.value > this.max) this.value = this.max;
        if (this.value < this.min) this.value = this.min;
        this.fire();
        this.render();
      }
      render() {
        if (this.closed) return;
        if (!this.firstRender) {
          if (this.outputError) this.out.write(cursor.down(lines(this.outputError, this.out.columns) - 1) + clear(this.outputError, this.out.columns));
          this.out.write(clear(this.outputText, this.out.columns));
        }
        super.render();
        this.outputError = "";
        this.outputText = [style.symbol(this.done, this.aborted), color.bold(this.msg), style.delimiter(this.done), !this.done || !this.done && !this.placeholder ? color[this.color]().underline(this.rendered) : this.rendered].join(` `);
        if (this.error) {
          this.outputError += this.errorMsg.split(`
`).reduce((a7, l8, i7) => a7 + `
${i7 ? ` ` : figures.pointerSmall} ${color.red().italic(l8)}`, ``);
        }
        this.out.write(erase.line + cursor.to(0) + this.outputText + cursor.save + this.outputError + cursor.restore);
      }
    };
    module2.exports = NumberPrompt;
  }
});

// ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/multiselect.js
var require_multiselect = __commonJS({
  "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/multiselect.js"(exports, module2) {
    init_import_meta_url();
    var color = require_kleur();
    var _require = require_src2();
    var cursor = _require.cursor;
    var Prompt = require_prompt();
    var _require2 = require_util7();
    var clear = _require2.clear;
    var figures = _require2.figures;
    var style = _require2.style;
    var wrap4 = _require2.wrap;
    var entriesToDisplay = _require2.entriesToDisplay;
    var MultiselectPrompt = class extends Prompt {
      static {
        __name(this, "MultiselectPrompt");
      }
      constructor(opts = {}) {
        super(opts);
        this.msg = opts.message;
        this.cursor = opts.cursor || 0;
        this.scrollIndex = opts.cursor || 0;
        this.hint = opts.hint || "";
        this.warn = opts.warn || "- This option is disabled -";
        this.minSelected = opts.min;
        this.showMinError = false;
        this.maxChoices = opts.max;
        this.instructions = opts.instructions;
        this.optionsPerPage = opts.optionsPerPage || 10;
        this.value = opts.choices.map((ch2, idx) => {
          if (typeof ch2 === "string") ch2 = {
            title: ch2,
            value: idx
          };
          return {
            title: ch2 && (ch2.title || ch2.value || ch2),
            description: ch2 && ch2.description,
            value: ch2 && (ch2.value === void 0 ? idx : ch2.value),
            selected: ch2 && ch2.selected,
            disabled: ch2 && ch2.disabled
          };
        });
        this.clear = clear("", this.out.columns);
        if (!opts.overrideRender) {
          this.render();
        }
      }
      reset() {
        this.value.map((v8) => !v8.selected);
        this.cursor = 0;
        this.fire();
        this.render();
      }
      selected() {
        return this.value.filter((v8) => v8.selected);
      }
      exit() {
        this.abort();
      }
      abort() {
        this.done = this.aborted = true;
        this.fire();
        this.render();
        this.out.write("\n");
        this.close();
      }
      submit() {
        const selected = this.value.filter((e10) => e10.selected);
        if (this.minSelected && selected.length < this.minSelected) {
          this.showMinError = true;
          this.render();
        } else {
          this.done = true;
          this.aborted = false;
          this.fire();
          this.render();
          this.out.write("\n");
          this.close();
        }
      }
      first() {
        this.cursor = 0;
        this.render();
      }
      last() {
        this.cursor = this.value.length - 1;
        this.render();
      }
      next() {
        this.cursor = (this.cursor + 1) % this.value.length;
        this.render();
      }
      up() {
        if (this.cursor === 0) {
          this.cursor = this.value.length - 1;
        } else {
          this.cursor--;
        }
        this.render();
      }
      down() {
        if (this.cursor === this.value.length - 1) {
          this.cursor = 0;
        } else {
          this.cursor++;
        }
        this.render();
      }
      left() {
        this.value[this.cursor].selected = false;
        this.render();
      }
      right() {
        if (this.value.filter((e10) => e10.selected).length >= this.maxChoices) return this.bell();
        this.value[this.cursor].selected = true;
        this.render();
      }
      handleSpaceToggle() {
        const v8 = this.value[this.cursor];
        if (v8.selected) {
          v8.selected = false;
          this.render();
        } else if (v8.disabled || this.value.filter((e10) => e10.selected).length >= this.maxChoices) {
          return this.bell();
        } else {
          v8.selected = true;
          this.render();
        }
      }
      toggleAll() {
        if (this.maxChoices !== void 0 || this.value[this.cursor].disabled) {
          return this.bell();
        }
        const newSelected = !this.value[this.cursor].selected;
        this.value.filter((v8) => !v8.disabled).forEach((v8) => v8.selected = newSelected);
        this.render();
      }
      _(c8, key) {
        if (c8 === " ") {
          this.handleSpaceToggle();
        } else if (c8 === "a") {
          this.toggleAll();
        } else {
          return this.bell();
        }
      }
      renderInstructions() {
        if (this.instructions === void 0 || this.instructions) {
          if (typeof this.instructions === "string") {
            return this.instructions;
          }
          return `
Instructions:
    ${figures.arrowUp}/${figures.arrowDown}: Highlight option
    ${figures.arrowLeft}/${figures.arrowRight}/[space]: Toggle selection
` + (this.maxChoices === void 0 ? `    a: Toggle all
` : "") + `    enter/return: Complete answer`;
        }
        return "";
      }
      renderOption(cursor2, v8, i7, arrowIndicator) {
        const prefix = (v8.selected ? color.green(figures.radioOn) : figures.radioOff) + " " + arrowIndicator + " ";
        let title, desc;
        if (v8.disabled) {
          title = cursor2 === i7 ? color.gray().underline(v8.title) : color.strikethrough().gray(v8.title);
        } else {
          title = cursor2 === i7 ? color.cyan().underline(v8.title) : v8.title;
          if (cursor2 === i7 && v8.description) {
            desc = ` - ${v8.description}`;
            if (prefix.length + title.length + desc.length >= this.out.columns || v8.description.split(/\r?\n/).length > 1) {
              desc = "\n" + wrap4(v8.description, {
                margin: prefix.length,
                width: this.out.columns
              });
            }
          }
        }
        return prefix + title + color.gray(desc || "");
      }
      // shared with autocompleteMultiselect
      paginateOptions(options) {
        if (options.length === 0) {
          return color.red("No matches for this query.");
        }
        let _entriesToDisplay = entriesToDisplay(this.cursor, options.length, this.optionsPerPage), startIndex = _entriesToDisplay.startIndex, endIndex = _entriesToDisplay.endIndex;
        let prefix, styledOptions = [];
        for (let i7 = startIndex; i7 < endIndex; i7++) {
          if (i7 === startIndex && startIndex > 0) {
            prefix = figures.arrowUp;
          } else if (i7 === endIndex - 1 && endIndex < options.length) {
            prefix = figures.arrowDown;
          } else {
            prefix = " ";
          }
          styledOptions.push(this.renderOption(this.cursor, options[i7], i7, prefix));
        }
        return "\n" + styledOptions.join("\n");
      }
      // shared with autocomleteMultiselect
      renderOptions(options) {
        if (!this.done) {
          return this.paginateOptions(options);
        }
        return "";
      }
      renderDoneOrInstructions() {
        if (this.done) {
          return this.value.filter((e10) => e10.selected).map((v8) => v8.title).join(", ");
        }
        const output = [color.gray(this.hint), this.renderInstructions()];
        if (this.value[this.cursor].disabled) {
          output.push(color.yellow(this.warn));
        }
        return output.join(" ");
      }
      render() {
        if (this.closed) return;
        if (this.firstRender) this.out.write(cursor.hide);
        super.render();
        let prompt2 = [style.symbol(this.done, this.aborted), color.bold(this.msg), style.delimiter(false), this.renderDoneOrInstructions()].join(" ");
        if (this.showMinError) {
          prompt2 += color.red(`You must select a minimum of ${this.minSelected} choices.`);
          this.showMinError = false;
        }
        prompt2 += this.renderOptions(this.value);
        this.out.write(this.clear + prompt2);
        this.clear = clear(prompt2, this.out.columns);
      }
    };
    module2.exports = MultiselectPrompt;
  }
});

// ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/autocomplete.js
var require_autocomplete = __commonJS({
  "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/autocomplete.js"(exports, module2) {
    init_import_meta_url();
    function asyncGeneratorStep(gen, resolve32, reject, _next, _throw, key, arg) {
      try {
        var info = gen[key](arg);
        var value = info.value;
      } catch (error2) {
        reject(error2);
        return;
      }
      if (info.done) {
        resolve32(value);
      } else {
        Promise.resolve(value).then(_next, _throw);
      }
    }
    __name(asyncGeneratorStep, "asyncGeneratorStep");
    function _asyncToGenerator(fn2) {
      return function() {
        var self2 = this, args = arguments;
        return new Promise(function(resolve32, reject) {
          var gen = fn2.apply(self2, args);
          function _next(value) {
            asyncGeneratorStep(gen, resolve32, reject, _next, _throw, "next", value);
          }
          __name(_next, "_next");
          function _throw(err) {
            asyncGeneratorStep(gen, resolve32, reject, _next, _throw, "throw", err);
          }
          __name(_throw, "_throw");
          _next(void 0);
        });
      };
    }
    __name(_asyncToGenerator, "_asyncToGenerator");
    var color = require_kleur();
    var Prompt = require_prompt();
    var _require = require_src2();
    var erase = _require.erase;
    var cursor = _require.cursor;
    var _require2 = require_util7();
    var style = _require2.style;
    var clear = _require2.clear;
    var figures = _require2.figures;
    var wrap4 = _require2.wrap;
    var entriesToDisplay = _require2.entriesToDisplay;
    var getVal = /* @__PURE__ */ __name((arr, i7) => arr[i7] && (arr[i7].value || arr[i7].title || arr[i7]), "getVal");
    var getTitle = /* @__PURE__ */ __name((arr, i7) => arr[i7] && (arr[i7].title || arr[i7].value || arr[i7]), "getTitle");
    var getIndex2 = /* @__PURE__ */ __name((arr, valOrTitle) => {
      const index = arr.findIndex((el) => el.value === valOrTitle || el.title === valOrTitle);
      return index > -1 ? index : void 0;
    }, "getIndex");
    var AutocompletePrompt = class extends Prompt {
      static {
        __name(this, "AutocompletePrompt");
      }
      constructor(opts = {}) {
        super(opts);
        this.msg = opts.message;
        this.suggest = opts.suggest;
        this.choices = opts.choices;
        this.initial = typeof opts.initial === "number" ? opts.initial : getIndex2(opts.choices, opts.initial);
        this.select = this.initial || opts.cursor || 0;
        this.i18n = {
          noMatches: opts.noMatches || "no matches found"
        };
        this.fallback = opts.fallback || this.initial;
        this.clearFirst = opts.clearFirst || false;
        this.suggestions = [];
        this.input = "";
        this.limit = opts.limit || 10;
        this.cursor = 0;
        this.transform = style.render(opts.style);
        this.scale = this.transform.scale;
        this.render = this.render.bind(this);
        this.complete = this.complete.bind(this);
        this.clear = clear("", this.out.columns);
        this.complete(this.render);
        this.render();
      }
      set fallback(fb) {
        this._fb = Number.isSafeInteger(parseInt(fb)) ? parseInt(fb) : fb;
      }
      get fallback() {
        let choice;
        if (typeof this._fb === "number") choice = this.choices[this._fb];
        else if (typeof this._fb === "string") choice = {
          title: this._fb
        };
        return choice || this._fb || {
          title: this.i18n.noMatches
        };
      }
      moveSelect(i7) {
        this.select = i7;
        if (this.suggestions.length > 0) this.value = getVal(this.suggestions, i7);
        else this.value = this.fallback.value;
        this.fire();
      }
      complete(cb2) {
        var _this = this;
        return _asyncToGenerator(function* () {
          const p7 = _this.completing = _this.suggest(_this.input, _this.choices);
          const suggestions = yield p7;
          if (_this.completing !== p7) return;
          _this.suggestions = suggestions.map((s7, i7, arr) => ({
            title: getTitle(arr, i7),
            value: getVal(arr, i7),
            description: s7.description
          }));
          _this.completing = false;
          const l8 = Math.max(suggestions.length - 1, 0);
          _this.moveSelect(Math.min(l8, _this.select));
          cb2 && cb2();
        })();
      }
      reset() {
        this.input = "";
        this.complete(() => {
          this.moveSelect(this.initial !== void 0 ? this.initial : 0);
          this.render();
        });
        this.render();
      }
      exit() {
        if (this.clearFirst && this.input.length > 0) {
          this.reset();
        } else {
          this.done = this.exited = true;
          this.aborted = false;
          this.fire();
          this.render();
          this.out.write("\n");
          this.close();
        }
      }
      abort() {
        this.done = this.aborted = true;
        this.exited = false;
        this.fire();
        this.render();
        this.out.write("\n");
        this.close();
      }
      submit() {
        this.done = true;
        this.aborted = this.exited = false;
        this.fire();
        this.render();
        this.out.write("\n");
        this.close();
      }
      _(c8, key) {
        let s1 = this.input.slice(0, this.cursor);
        let s22 = this.input.slice(this.cursor);
        this.input = `${s1}${c8}${s22}`;
        this.cursor = s1.length + 1;
        this.complete(this.render);
        this.render();
      }
      delete() {
        if (this.cursor === 0) return this.bell();
        let s1 = this.input.slice(0, this.cursor - 1);
        let s22 = this.input.slice(this.cursor);
        this.input = `${s1}${s22}`;
        this.complete(this.render);
        this.cursor = this.cursor - 1;
        this.render();
      }
      deleteForward() {
        if (this.cursor * this.scale >= this.rendered.length) return this.bell();
        let s1 = this.input.slice(0, this.cursor);
        let s22 = this.input.slice(this.cursor + 1);
        this.input = `${s1}${s22}`;
        this.complete(this.render);
        this.render();
      }
      first() {
        this.moveSelect(0);
        this.render();
      }
      last() {
        this.moveSelect(this.suggestions.length - 1);
        this.render();
      }
      up() {
        if (this.select === 0) {
          this.moveSelect(this.suggestions.length - 1);
        } else {
          this.moveSelect(this.select - 1);
        }
        this.render();
      }
      down() {
        if (this.select === this.suggestions.length - 1) {
          this.moveSelect(0);
        } else {
          this.moveSelect(this.select + 1);
        }
        this.render();
      }
      next() {
        if (this.select === this.suggestions.length - 1) {
          this.moveSelect(0);
        } else this.moveSelect(this.select + 1);
        this.render();
      }
      nextPage() {
        this.moveSelect(Math.min(this.select + this.limit, this.suggestions.length - 1));
        this.render();
      }
      prevPage() {
        this.moveSelect(Math.max(this.select - this.limit, 0));
        this.render();
      }
      left() {
        if (this.cursor <= 0) return this.bell();
        this.cursor = this.cursor - 1;
        this.render();
      }
      right() {
        if (this.cursor * this.scale >= this.rendered.length) return this.bell();
        this.cursor = this.cursor + 1;
        this.render();
      }
      renderOption(v8, hovered, isStart, isEnd) {
        let desc;
        let prefix = isStart ? figures.arrowUp : isEnd ? figures.arrowDown : " ";
        let title = hovered ? color.cyan().underline(v8.title) : v8.title;
        prefix = (hovered ? color.cyan(figures.pointer) + " " : "  ") + prefix;
        if (v8.description) {
          desc = ` - ${v8.description}`;
          if (prefix.length + title.length + desc.length >= this.out.columns || v8.description.split(/\r?\n/).length > 1) {
            desc = "\n" + wrap4(v8.description, {
              margin: 3,
              width: this.out.columns
            });
          }
        }
        return prefix + " " + title + color.gray(desc || "");
      }
      render() {
        if (this.closed) return;
        if (this.firstRender) this.out.write(cursor.hide);
        else this.out.write(clear(this.outputText, this.out.columns));
        super.render();
        let _entriesToDisplay = entriesToDisplay(this.select, this.choices.length, this.limit), startIndex = _entriesToDisplay.startIndex, endIndex = _entriesToDisplay.endIndex;
        this.outputText = [style.symbol(this.done, this.aborted, this.exited), color.bold(this.msg), style.delimiter(this.completing), this.done && this.suggestions[this.select] ? this.suggestions[this.select].title : this.rendered = this.transform.render(this.input)].join(" ");
        if (!this.done) {
          const suggestions = this.suggestions.slice(startIndex, endIndex).map((item, i7) => this.renderOption(item, this.select === i7 + startIndex, i7 === 0 && startIndex > 0, i7 + startIndex === endIndex - 1 && endIndex < this.choices.length)).join("\n");
          this.outputText += `
` + (suggestions || color.gray(this.fallback.title));
        }
        this.out.write(erase.line + cursor.to(0) + this.outputText);
      }
    };
    module2.exports = AutocompletePrompt;
  }
});

// ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/autocompleteMultiselect.js
var require_autocompleteMultiselect = __commonJS({
  "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/autocompleteMultiselect.js"(exports, module2) {
    init_import_meta_url();
    var color = require_kleur();
    var _require = require_src2();
    var cursor = _require.cursor;
    var MultiselectPrompt = require_multiselect();
    var _require2 = require_util7();
    var clear = _require2.clear;
    var style = _require2.style;
    var figures = _require2.figures;
    var AutocompleteMultiselectPrompt = class extends MultiselectPrompt {
      static {
        __name(this, "AutocompleteMultiselectPrompt");
      }
      constructor(opts = {}) {
        opts.overrideRender = true;
        super(opts);
        this.inputValue = "";
        this.clear = clear("", this.out.columns);
        this.filteredOptions = this.value;
        this.render();
      }
      last() {
        this.cursor = this.filteredOptions.length - 1;
        this.render();
      }
      next() {
        this.cursor = (this.cursor + 1) % this.filteredOptions.length;
        this.render();
      }
      up() {
        if (this.cursor === 0) {
          this.cursor = this.filteredOptions.length - 1;
        } else {
          this.cursor--;
        }
        this.render();
      }
      down() {
        if (this.cursor === this.filteredOptions.length - 1) {
          this.cursor = 0;
        } else {
          this.cursor++;
        }
        this.render();
      }
      left() {
        this.filteredOptions[this.cursor].selected = false;
        this.render();
      }
      right() {
        if (this.value.filter((e10) => e10.selected).length >= this.maxChoices) return this.bell();
        this.filteredOptions[this.cursor].selected = true;
        this.render();
      }
      delete() {
        if (this.inputValue.length) {
          this.inputValue = this.inputValue.substr(0, this.inputValue.length - 1);
          this.updateFilteredOptions();
        }
      }
      updateFilteredOptions() {
        const currentHighlight = this.filteredOptions[this.cursor];
        this.filteredOptions = this.value.filter((v8) => {
          if (this.inputValue) {
            if (typeof v8.title === "string") {
              if (v8.title.toLowerCase().includes(this.inputValue.toLowerCase())) {
                return true;
              }
            }
            if (typeof v8.value === "string") {
              if (v8.value.toLowerCase().includes(this.inputValue.toLowerCase())) {
                return true;
              }
            }
            return false;
          }
          return true;
        });
        const newHighlightIndex = this.filteredOptions.findIndex((v8) => v8 === currentHighlight);
        this.cursor = newHighlightIndex < 0 ? 0 : newHighlightIndex;
        this.render();
      }
      handleSpaceToggle() {
        const v8 = this.filteredOptions[this.cursor];
        if (v8.selected) {
          v8.selected = false;
          this.render();
        } else if (v8.disabled || this.value.filter((e10) => e10.selected).length >= this.maxChoices) {
          return this.bell();
        } else {
          v8.selected = true;
          this.render();
        }
      }
      handleInputChange(c8) {
        this.inputValue = this.inputValue + c8;
        this.updateFilteredOptions();
      }
      _(c8, key) {
        if (c8 === " ") {
          this.handleSpaceToggle();
        } else {
          this.handleInputChange(c8);
        }
      }
      renderInstructions() {
        if (this.instructions === void 0 || this.instructions) {
          if (typeof this.instructions === "string") {
            return this.instructions;
          }
          return `
Instructions:
    ${figures.arrowUp}/${figures.arrowDown}: Highlight option
    ${figures.arrowLeft}/${figures.arrowRight}/[space]: Toggle selection
    [a,b,c]/delete: Filter choices
    enter/return: Complete answer
`;
        }
        return "";
      }
      renderCurrentInput() {
        return `
Filtered results for: ${this.inputValue ? this.inputValue : color.gray("Enter something to filter")}
`;
      }
      renderOption(cursor2, v8, i7) {
        let title;
        if (v8.disabled) title = cursor2 === i7 ? color.gray().underline(v8.title) : color.strikethrough().gray(v8.title);
        else title = cursor2 === i7 ? color.cyan().underline(v8.title) : v8.title;
        return (v8.selected ? color.green(figures.radioOn) : figures.radioOff) + "  " + title;
      }
      renderDoneOrInstructions() {
        if (this.done) {
          return this.value.filter((e10) => e10.selected).map((v8) => v8.title).join(", ");
        }
        const output = [color.gray(this.hint), this.renderInstructions(), this.renderCurrentInput()];
        if (this.filteredOptions.length && this.filteredOptions[this.cursor].disabled) {
          output.push(color.yellow(this.warn));
        }
        return output.join(" ");
      }
      render() {
        if (this.closed) return;
        if (this.firstRender) this.out.write(cursor.hide);
        super.render();
        let prompt2 = [style.symbol(this.done, this.aborted), color.bold(this.msg), style.delimiter(false), this.renderDoneOrInstructions()].join(" ");
        if (this.showMinError) {
          prompt2 += color.red(`You must select a minimum of ${this.minSelected} choices.`);
          this.showMinError = false;
        }
        prompt2 += this.renderOptions(this.filteredOptions);
        this.out.write(this.clear + prompt2);
        this.clear = clear(prompt2, this.out.columns);
      }
    };
    module2.exports = AutocompleteMultiselectPrompt;
  }
});

// ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/confirm.js
var require_confirm = __commonJS({
  "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/confirm.js"(exports, module2) {
    init_import_meta_url();
    var color = require_kleur();
    var Prompt = require_prompt();
    var _require = require_util7();
    var style = _require.style;
    var clear = _require.clear;
    var _require2 = require_src2();
    var erase = _require2.erase;
    var cursor = _require2.cursor;
    var ConfirmPrompt = class extends Prompt {
      static {
        __name(this, "ConfirmPrompt");
      }
      constructor(opts = {}) {
        super(opts);
        this.msg = opts.message;
        this.value = opts.initial;
        this.initialValue = !!opts.initial;
        this.yesMsg = opts.yes || "yes";
        this.yesOption = opts.yesOption || "(Y/n)";
        this.noMsg = opts.no || "no";
        this.noOption = opts.noOption || "(y/N)";
        this.render();
      }
      reset() {
        this.value = this.initialValue;
        this.fire();
        this.render();
      }
      exit() {
        this.abort();
      }
      abort() {
        this.done = this.aborted = true;
        this.fire();
        this.render();
        this.out.write("\n");
        this.close();
      }
      submit() {
        this.value = this.value || false;
        this.done = true;
        this.aborted = false;
        this.fire();
        this.render();
        this.out.write("\n");
        this.close();
      }
      _(c8, key) {
        if (c8.toLowerCase() === "y") {
          this.value = true;
          return this.submit();
        }
        if (c8.toLowerCase() === "n") {
          this.value = false;
          return this.submit();
        }
        return this.bell();
      }
      render() {
        if (this.closed) return;
        if (this.firstRender) this.out.write(cursor.hide);
        else this.out.write(clear(this.outputText, this.out.columns));
        super.render();
        this.outputText = [style.symbol(this.done, this.aborted), color.bold(this.msg), style.delimiter(this.done), this.done ? this.value ? this.yesMsg : this.noMsg : color.gray(this.initialValue ? this.yesOption : this.noOption)].join(" ");
        this.out.write(erase.line + cursor.to(0) + this.outputText);
      }
    };
    module2.exports = ConfirmPrompt;
  }
});

// ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/index.js
var require_elements = __commonJS({
  "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/index.js"(exports, module2) {
    init_import_meta_url();
    module2.exports = {
      TextPrompt: require_text(),
      SelectPrompt: require_select(),
      TogglePrompt: require_toggle(),
      DatePrompt: require_date2(),
      NumberPrompt: require_number(),
      MultiselectPrompt: require_multiselect(),
      AutocompletePrompt: require_autocomplete(),
      AutocompleteMultiselectPrompt: require_autocompleteMultiselect(),
      ConfirmPrompt: require_confirm()
    };
  }
});

// ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/prompts.js
var require_prompts = __commonJS({
  "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/prompts.js"(exports) {
    init_import_meta_url();
    var $3 = exports;
    var el = require_elements();
    var noop = /* @__PURE__ */ __name((v8) => v8, "noop");
    function toPrompt(type, args, opts = {}) {
      return new Promise((res, rej) => {
        const p7 = new el[type](args);
        const onAbort = opts.onAbort || noop;
        const onSubmit = opts.onSubmit || noop;
        const onExit6 = opts.onExit || noop;
        p7.on("state", args.onState || noop);
        p7.on("submit", (x7) => res(onSubmit(x7)));
        p7.on("exit", (x7) => res(onExit6(x7)));
        p7.on("abort", (x7) => rej(onAbort(x7)));
      });
    }
    __name(toPrompt, "toPrompt");
    $3.text = (args) => toPrompt("TextPrompt", args);
    $3.password = (args) => {
      args.style = "password";
      return $3.text(args);
    };
    $3.invisible = (args) => {
      args.style = "invisible";
      return $3.text(args);
    };
    $3.number = (args) => toPrompt("NumberPrompt", args);
    $3.date = (args) => toPrompt("DatePrompt", args);
    $3.confirm = (args) => toPrompt("ConfirmPrompt", args);
    $3.list = (args) => {
      const sep6 = args.separator || ",";
      return toPrompt("TextPrompt", args, {
        onSubmit: /* @__PURE__ */ __name((str) => str.split(sep6).map((s7) => s7.trim()), "onSubmit")
      });
    };
    $3.toggle = (args) => toPrompt("TogglePrompt", args);
    $3.select = (args) => toPrompt("SelectPrompt", args);
    $3.multiselect = (args) => {
      args.choices = [].concat(args.choices || []);
      const toSelected = /* @__PURE__ */ __name((items) => items.filter((item) => item.selected).map((item) => item.value), "toSelected");
      return toPrompt("MultiselectPrompt", args, {
        onAbort: toSelected,
        onSubmit: toSelected
      });
    };
    $3.autocompleteMultiselect = (args) => {
      args.choices = [].concat(args.choices || []);
      const toSelected = /* @__PURE__ */ __name((items) => items.filter((item) => item.selected).map((item) => item.value), "toSelected");
      return toPrompt("AutocompleteMultiselectPrompt", args, {
        onAbort: toSelected,
        onSubmit: toSelected
      });
    };
    var byTitle = /* @__PURE__ */ __name((input, choices) => Promise.resolve(choices.filter((item) => item.title.slice(0, input.length).toLowerCase() === input.toLowerCase())), "byTitle");
    $3.autocomplete = (args) => {
      args.suggest = args.suggest || byTitle;
      args.choices = [].concat(args.choices || []);
      return toPrompt("AutocompletePrompt", args);
    };
  }
});

// ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/index.js
var require_dist = __commonJS({
  "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/index.js"(exports, module2) {
    init_import_meta_url();
    function ownKeys2(object, enumerableOnly) {
      var keys = Object.keys(object);
      if (Object.getOwnPropertySymbols) {
        var symbols = Object.getOwnPropertySymbols(object);
        if (enumerableOnly) {
          symbols = symbols.filter(function(sym) {
            return Object.getOwnPropertyDescriptor(object, sym).enumerable;
          });
        }
        keys.push.apply(keys, symbols);
      }
      return keys;
    }
    __name(ownKeys2, "ownKeys");
    function _objectSpread(target) {
      for (var i7 = 1; i7 < arguments.length; i7++) {
        var source = arguments[i7] != null ? arguments[i7] : {};
        if (i7 % 2) {
          ownKeys2(Object(source), true).forEach(function(key) {
            _defineProperty(target, key, source[key]);
          });
        } else if (Object.getOwnPropertyDescriptors) {
          Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
        } else {
          ownKeys2(Object(source)).forEach(function(key) {
            Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
          });
        }
      }
      return target;
    }
    __name(_objectSpread, "_objectSpread");
    function _defineProperty(obj, key, value) {
      if (key in obj) {
        Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
      } else {
        obj[key] = value;
      }
      return obj;
    }
    __name(_defineProperty, "_defineProperty");
    function _createForOfIteratorHelper(o7, allowArrayLike) {
      var it2 = typeof Symbol !== "undefined" && o7[Symbol.iterator] || o7["@@iterator"];
      if (!it2) {
        if (Array.isArray(o7) || (it2 = _unsupportedIterableToArray(o7)) || allowArrayLike && o7 && typeof o7.length === "number") {
          if (it2) o7 = it2;
          var i7 = 0;
          var F4 = /* @__PURE__ */ __name(function F5() {
          }, "F");
          return { s: F4, n: /* @__PURE__ */ __name(function n9() {
            if (i7 >= o7.length) return { done: true };
            return { done: false, value: o7[i7++] };
          }, "n"), e: /* @__PURE__ */ __name(function e10(_e3) {
            throw _e3;
          }, "e"), f: F4 };
        }
        throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
      }
      var normalCompletion = true, didErr = false, err;
      return { s: /* @__PURE__ */ __name(function s7() {
        it2 = it2.call(o7);
      }, "s"), n: /* @__PURE__ */ __name(function n9() {
        var step = it2.next();
        normalCompletion = step.done;
        return step;
      }, "n"), e: /* @__PURE__ */ __name(function e10(_e22) {
        didErr = true;
        err = _e22;
      }, "e"), f: /* @__PURE__ */ __name(function f8() {
        try {
          if (!normalCompletion && it2.return != null) it2.return();
        } finally {
          if (didErr) throw err;
        }
      }, "f") };
    }
    __name(_createForOfIteratorHelper, "_createForOfIteratorHelper");
    function _unsupportedIterableToArray(o7, minLen) {
      if (!o7) return;
      if (typeof o7 === "string") return _arrayLikeToArray(o7, minLen);
      var n9 = Object.prototype.toString.call(o7).slice(8, -1);
      if (n9 === "Object" && o7.constructor) n9 = o7.constructor.name;
      if (n9 === "Map" || n9 === "Set") return Array.from(o7);
      if (n9 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n9)) return _arrayLikeToArray(o7, minLen);
    }
    __name(_unsupportedIterableToArray, "_unsupportedIterableToArray");
    function _arrayLikeToArray(arr, len) {
      if (len == null || len > arr.length) len = arr.length;
      for (var i7 = 0, arr2 = new Array(len); i7 < len; i7++) arr2[i7] = arr[i7];
      return arr2;
    }
    __name(_arrayLikeToArray, "_arrayLikeToArray");
    function asyncGeneratorStep(gen, resolve32, reject, _next, _throw, key, arg) {
      try {
        var info = gen[key](arg);
        var value = info.value;
      } catch (error2) {
        reject(error2);
        return;
      }
      if (info.done) {
        resolve32(value);
      } else {
        Promise.resolve(value).then(_next, _throw);
      }
    }
    __name(asyncGeneratorStep, "asyncGeneratorStep");
    function _asyncToGenerator(fn2) {
      return function() {
        var self2 = this, args = arguments;
        return new Promise(function(resolve32, reject) {
          var gen = fn2.apply(self2, args);
          function _next(value) {
            asyncGeneratorStep(gen, resolve32, reject, _next, _throw, "next", value);
          }
          __name(_next, "_next");
          function _throw(err) {
            asyncGeneratorStep(gen, resolve32, reject, _next, _throw, "throw", err);
          }
          __name(_throw, "_throw");
          _next(void 0);
        });
      };
    }
    __name(_asyncToGenerator, "_asyncToGenerator");
    var prompts2 = require_prompts();
    var passOn = ["suggest", "format", "onState", "validate", "onRender", "type"];
    var noop = /* @__PURE__ */ __name(() => {
    }, "noop");
    function prompt2() {
      return _prompt.apply(this, arguments);
    }
    __name(prompt2, "prompt");
    function _prompt() {
      _prompt = _asyncToGenerator(function* (questions = [], {
        onSubmit = noop,
        onCancel = noop
      } = {}) {
        const answers = {};
        const override2 = prompt2._override || {};
        questions = [].concat(questions);
        let answer, question, quit, name2, type, lastPrompt;
        const getFormattedAnswer = /* @__PURE__ */ function() {
          var _ref = _asyncToGenerator(function* (question2, answer2, skipValidation = false) {
            if (!skipValidation && question2.validate && question2.validate(answer2) !== true) {
              return;
            }
            return question2.format ? yield question2.format(answer2, answers) : answer2;
          });
          return /* @__PURE__ */ __name(function getFormattedAnswer2(_x2, _x22) {
            return _ref.apply(this, arguments);
          }, "getFormattedAnswer");
        }();
        var _iterator = _createForOfIteratorHelper(questions), _step;
        try {
          for (_iterator.s(); !(_step = _iterator.n()).done; ) {
            question = _step.value;
            var _question = question;
            name2 = _question.name;
            type = _question.type;
            if (typeof type === "function") {
              type = yield type(answer, _objectSpread({}, answers), question);
              question["type"] = type;
            }
            if (!type) continue;
            for (let key in question) {
              if (passOn.includes(key)) continue;
              let value = question[key];
              question[key] = typeof value === "function" ? yield value(answer, _objectSpread({}, answers), lastPrompt) : value;
            }
            lastPrompt = question;
            if (typeof question.message !== "string") {
              throw new Error("prompt message is required");
            }
            var _question2 = question;
            name2 = _question2.name;
            type = _question2.type;
            if (prompts2[type] === void 0) {
              throw new Error(`prompt type (${type}) is not defined`);
            }
            if (override2[question.name] !== void 0) {
              answer = yield getFormattedAnswer(question, override2[question.name]);
              if (answer !== void 0) {
                answers[name2] = answer;
                continue;
              }
            }
            try {
              answer = prompt2._injected ? getInjectedAnswer(prompt2._injected, question.initial) : yield prompts2[type](question);
              answers[name2] = answer = yield getFormattedAnswer(question, answer, true);
              quit = yield onSubmit(question, answer, answers);
            } catch (err) {
              quit = !(yield onCancel(question, answers));
            }
            if (quit) return answers;
          }
        } catch (err) {
          _iterator.e(err);
        } finally {
          _iterator.f();
        }
        return answers;
      });
      return _prompt.apply(this, arguments);
    }
    __name(_prompt, "_prompt");
    function getInjectedAnswer(injected, deafultValue) {
      const answer = injected.shift();
      if (answer instanceof Error) {
        throw answer;
      }
      return answer === void 0 ? deafultValue : answer;
    }
    __name(getInjectedAnswer, "getInjectedAnswer");
    function inject(answers) {
      prompt2._injected = (prompt2._injected || []).concat(answers);
    }
    __name(inject, "inject");
    function override(answers) {
      prompt2._override = Object.assign({}, answers);
    }
    __name(override, "override");
    module2.exports = Object.assign(prompt2, {
      prompt: prompt2,
      prompts: prompts2,
      inject,
      override
    });
  }
});

// ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/action.js
var require_action2 = __commonJS({
  "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/action.js"(exports, module2) {
    init_import_meta_url();
    module2.exports = (key, isSelect) => {
      if (key.meta && key.name !== "escape") return;
      if (key.ctrl) {
        if (key.name === "a") return "first";
        if (key.name === "c") return "abort";
        if (key.name === "d") return "abort";
        if (key.name === "e") return "last";
        if (key.name === "g") return "reset";
      }
      if (isSelect) {
        if (key.name === "j") return "down";
        if (key.name === "k") return "up";
      }
      if (key.name === "return") return "submit";
      if (key.name === "enter") return "submit";
      if (key.name === "backspace") return "delete";
      if (key.name === "delete") return "deleteForward";
      if (key.name === "abort") return "abort";
      if (key.name === "escape") return "exit";
      if (key.name === "tab") return "next";
      if (key.name === "pagedown") return "nextPage";
      if (key.name === "pageup") return "prevPage";
      if (key.name === "home") return "home";
      if (key.name === "end") return "end";
      if (key.name === "up") return "up";
      if (key.name === "down") return "down";
      if (key.name === "right") return "right";
      if (key.name === "left") return "left";
      return false;
    };
  }
});

// ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/strip.js
var require_strip2 = __commonJS({
  "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/strip.js"(exports, module2) {
    init_import_meta_url();
    module2.exports = (str) => {
      const pattern = [
        "[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)",
        "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"
      ].join("|");
      const RGX = new RegExp(pattern, "g");
      return typeof str === "string" ? str.replace(RGX, "") : str;
    };
  }
});

// ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/clear.js
var require_clear2 = __commonJS({
  "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/clear.js"(exports, module2) {
    init_import_meta_url();
    var strip = require_strip2();
    var { erase, cursor } = require_src2();
    var width = /* @__PURE__ */ __name((str) => [...strip(str)].length, "width");
    module2.exports = function(prompt2, perLine) {
      if (!perLine) return erase.line + cursor.to(0);
      let rows = 0;
      const lines = prompt2.split(/\r?\n/);
      for (let line of lines) {
        rows += 1 + Math.floor(Math.max(width(line) - 1, 0) / perLine);
      }
      return erase.lines(rows);
    };
  }
});

// ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/figures.js
var require_figures2 = __commonJS({
  "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/figures.js"(exports, module2) {
    init_import_meta_url();
    var main2 = {
      arrowUp: "\u2191",
      arrowDown: "\u2193",
      arrowLeft: "\u2190",
      arrowRight: "\u2192",
      radioOn: "\u25C9",
      radioOff: "\u25EF",
      tick: "\u2714",
      cross: "\u2716",
      ellipsis: "\u2026",
      pointerSmall: "\u203A",
      line: "\u2500",
      pointer: "\u276F"
    };
    var win = {
      arrowUp: main2.arrowUp,
      arrowDown: main2.arrowDown,
      arrowLeft: main2.arrowLeft,
      arrowRight: main2.arrowRight,
      radioOn: "(*)",
      radioOff: "( )",
      tick: "\u221A",
      cross: "\xD7",
      ellipsis: "...",
      pointerSmall: "\xBB",
      line: "\u2500",
      pointer: ">"
    };
    var figures = process.platform === "win32" ? win : main2;
    module2.exports = figures;
  }
});

// ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/style.js
var require_style2 = __commonJS({
  "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/style.js"(exports, module2) {
    init_import_meta_url();
    var c8 = require_kleur();
    var figures = require_figures2();
    var styles4 = Object.freeze({
      password: { scale: 1, render: /* @__PURE__ */ __name((input) => "*".repeat(input.length), "render") },
      emoji: { scale: 2, render: /* @__PURE__ */ __name((input) => "\u{1F603}".repeat(input.length), "render") },
      invisible: { scale: 0, render: /* @__PURE__ */ __name((input) => "", "render") },
      default: { scale: 1, render: /* @__PURE__ */ __name((input) => `${input}`, "render") }
    });
    var render2 = /* @__PURE__ */ __name((type) => styles4[type] || styles4.default, "render");
    var symbols = Object.freeze({
      aborted: c8.red(figures.cross),
      done: c8.green(figures.tick),
      exited: c8.yellow(figures.cross),
      default: c8.cyan("?")
    });
    var symbol = /* @__PURE__ */ __name((done, aborted, exited) => aborted ? symbols.aborted : exited ? symbols.exited : done ? symbols.done : symbols.default, "symbol");
    var delimiter = /* @__PURE__ */ __name((completing) => c8.gray(completing ? figures.ellipsis : figures.pointerSmall), "delimiter");
    var item = /* @__PURE__ */ __name((expandable, expanded) => c8.gray(expandable ? expanded ? figures.pointerSmall : "+" : figures.line), "item");
    module2.exports = {
      styles: styles4,
      render: render2,
      symbols,
      symbol,
      delimiter,
      item
    };
  }
});

// ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/lines.js
var require_lines2 = __commonJS({
  "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/lines.js"(exports, module2) {
    init_import_meta_url();
    var strip = require_strip2();
    module2.exports = function(msg, perLine) {
      let lines = String(strip(msg) || "").split(/\r?\n/);
      if (!perLine) return lines.length;
      return lines.map((l8) => Math.ceil(l8.length / perLine)).reduce((a7, b11) => a7 + b11);
    };
  }
});

// ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/wrap.js
var require_wrap2 = __commonJS({
  "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/wrap.js"(exports, module2) {
    init_import_meta_url();
    module2.exports = (msg, opts = {}) => {
      const tab = Number.isSafeInteger(parseInt(opts.margin)) ? new Array(parseInt(opts.margin)).fill(" ").join("") : opts.margin || "";
      const width = opts.width;
      return (msg || "").split(/\r?\n/g).map((line) => line.split(/\s+/g).reduce((arr, w7) => {
        if (w7.length + tab.length >= width || arr[arr.length - 1].length + w7.length + 1 < width)
          arr[arr.length - 1] += ` ${w7}`;
        else arr.push(`${tab}${w7}`);
        return arr;
      }, [tab]).join("\n")).join("\n");
    };
  }
});

// ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/entriesToDisplay.js
var require_entriesToDisplay2 = __commonJS({
  "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/entriesToDisplay.js"(exports, module2) {
    init_import_meta_url();
    module2.exports = (cursor, total, maxVisible) => {
      maxVisible = maxVisible || total;
      let startIndex = Math.min(total - maxVisible, cursor - Math.floor(maxVisible / 2));
      if (startIndex < 0) startIndex = 0;
      let endIndex = Math.min(startIndex + maxVisible, total);
      return { startIndex, endIndex };
    };
  }
});

// ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/index.js
var require_util8 = __commonJS({
  "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/index.js"(exports, module2) {
    init_import_meta_url();
    module2.exports = {
      action: require_action2(),
      clear: require_clear2(),
      style: require_style2(),
      strip: require_strip2(),
      figures: require_figures2(),
      lines: require_lines2(),
      wrap: require_wrap2(),
      entriesToDisplay: require_entriesToDisplay2()
    };
  }
});

// ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/prompt.js
var require_prompt2 = __commonJS({
  "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/prompt.js"(exports, module2) {
    init_import_meta_url();
    var readline3 = __require("readline");
    var { action } = require_util8();
    var EventEmitter5 = __require("events");
    var { beep, cursor } = require_src2();
    var color = require_kleur();
    var Prompt = class extends EventEmitter5 {
      static {
        __name(this, "Prompt");
      }
      constructor(opts = {}) {
        super();
        this.firstRender = true;
        this.in = opts.stdin || process.stdin;
        this.out = opts.stdout || process.stdout;
        this.onRender = (opts.onRender || (() => void 0)).bind(this);
        const rl = readline3.createInterface({ input: this.in, escapeCodeTimeout: 50 });
        readline3.emitKeypressEvents(this.in, rl);
        if (this.in.isTTY) this.in.setRawMode(true);
        const isSelect = ["SelectPrompt", "MultiselectPrompt"].indexOf(this.constructor.name) > -1;
        const keypress = /* @__PURE__ */ __name((str, key) => {
          let a7 = action(key, isSelect);
          if (a7 === false) {
            this._ && this._(str, key);
          } else if (typeof this[a7] === "function") {
            this[a7](key);
          } else {
            this.bell();
          }
        }, "keypress");
        this.close = () => {
          this.out.write(cursor.show);
          this.in.removeListener("keypress", keypress);
          if (this.in.isTTY) this.in.setRawMode(false);
          rl.close();
          this.emit(this.aborted ? "abort" : this.exited ? "exit" : "submit", this.value);
          this.closed = true;
        };
        this.in.on("keypress", keypress);
      }
      fire() {
        this.emit("state", {
          value: this.value,
          aborted: !!this.aborted,
          exited: !!this.exited
        });
      }
      bell() {
        this.out.write(beep);
      }
      render() {
        this.onRender(color);
        if (this.firstRender) this.firstRender = false;
      }
    };
    module2.exports = Prompt;
  }
});

// ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/text.js
var require_text2 = __commonJS({
  "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/text.js"(exports, module2) {
    init_import_meta_url();
    var color = require_kleur();
    var Prompt = require_prompt2();
    var { erase, cursor } = require_src2();
    var { style, clear, lines, figures } = require_util8();
    var TextPrompt = class extends Prompt {
      static {
        __name(this, "TextPrompt");
      }
      constructor(opts = {}) {
        super(opts);
        this.transform = style.render(opts.style);
        this.scale = this.transform.scale;
        this.msg = opts.message;
        this.initial = opts.initial || ``;
        this.validator = opts.validate || (() => true);
        this.value = ``;
        this.errorMsg = opts.error || `Please Enter A Valid Value`;
        this.cursor = Number(!!this.initial);
        this.cursorOffset = 0;
        this.clear = clear(``, this.out.columns);
        this.render();
      }
      set value(v8) {
        if (!v8 && this.initial) {
          this.placeholder = true;
          this.rendered = color.gray(this.transform.render(this.initial));
        } else {
          this.placeholder = false;
          this.rendered = this.transform.render(v8);
        }
        this._value = v8;
        this.fire();
      }
      get value() {
        return this._value;
      }
      reset() {
        this.value = ``;
        this.cursor = Number(!!this.initial);
        this.cursorOffset = 0;
        this.fire();
        this.render();
      }
      exit() {
        this.abort();
      }
      abort() {
        this.value = this.value || this.initial;
        this.done = this.aborted = true;
        this.error = false;
        this.red = false;
        this.fire();
        this.render();
        this.out.write("\n");
        this.close();
      }
      async validate() {
        let valid = await this.validator(this.value);
        if (typeof valid === `string`) {
          this.errorMsg = valid;
          valid = false;
        }
        this.error = !valid;
      }
      async submit() {
        this.value = this.value || this.initial;
        this.cursorOffset = 0;
        this.cursor = this.rendered.length;
        await this.validate();
        if (this.error) {
          this.red = true;
          this.fire();
          this.render();
          return;
        }
        this.done = true;
        this.aborted = false;
        this.fire();
        this.render();
        this.out.write("\n");
        this.close();
      }
      next() {
        if (!this.placeholder) return this.bell();
        this.value = this.initial;
        this.cursor = this.rendered.length;
        this.fire();
        this.render();
      }
      moveCursor(n9) {
        if (this.placeholder) return;
        this.cursor = this.cursor + n9;
        this.cursorOffset += n9;
      }
      _(c8, key) {
        let s1 = this.value.slice(0, this.cursor);
        let s22 = this.value.slice(this.cursor);
        this.value = `${s1}${c8}${s22}`;
        this.red = false;
        this.cursor = this.placeholder ? 0 : s1.length + 1;
        this.render();
      }
      delete() {
        if (this.isCursorAtStart()) return this.bell();
        let s1 = this.value.slice(0, this.cursor - 1);
        let s22 = this.value.slice(this.cursor);
        this.value = `${s1}${s22}`;
        this.red = false;
        if (this.isCursorAtStart()) {
          this.cursorOffset = 0;
        } else {
          this.cursorOffset++;
          this.moveCursor(-1);
        }
        this.render();
      }
      deleteForward() {
        if (this.cursor * this.scale >= this.rendered.length || this.placeholder) return this.bell();
        let s1 = this.value.slice(0, this.cursor);
        let s22 = this.value.slice(this.cursor + 1);
        this.value = `${s1}${s22}`;
        this.red = false;
        if (this.isCursorAtEnd()) {
          this.cursorOffset = 0;
        } else {
          this.cursorOffset++;
        }
        this.render();
      }
      first() {
        this.cursor = 0;
        this.render();
      }
      last() {
        this.cursor = this.value.length;
        this.render();
      }
      left() {
        if (this.cursor <= 0 || this.placeholder) return this.bell();
        this.moveCursor(-1);
        this.render();
      }
      right() {
        if (this.cursor * this.scale >= this.rendered.length || this.placeholder) return this.bell();
        this.moveCursor(1);
        this.render();
      }
      isCursorAtStart() {
        return this.cursor === 0 || this.placeholder && this.cursor === 1;
      }
      isCursorAtEnd() {
        return this.cursor === this.rendered.length || this.placeholder && this.cursor === this.rendered.length + 1;
      }
      render() {
        if (this.closed) return;
        if (!this.firstRender) {
          if (this.outputError)
            this.out.write(cursor.down(lines(this.outputError, this.out.columns) - 1) + clear(this.outputError, this.out.columns));
          this.out.write(clear(this.outputText, this.out.columns));
        }
        super.render();
        this.outputError = "";
        this.outputText = [
          style.symbol(this.done, this.aborted),
          color.bold(this.msg),
          style.delimiter(this.done),
          this.red ? color.red(this.rendered) : this.rendered
        ].join(` `);
        if (this.error) {
          this.outputError += this.errorMsg.split(`
`).reduce((a7, l8, i7) => a7 + `
${i7 ? " " : figures.pointerSmall} ${color.red().italic(l8)}`, ``);
        }
        this.out.write(erase.line + cursor.to(0) + this.outputText + cursor.save + this.outputError + cursor.restore + cursor.move(this.cursorOffset, 0));
      }
    };
    module2.exports = TextPrompt;
  }
});

// ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/select.js
var require_select2 = __commonJS({
  "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/select.js"(exports, module2) {
    init_import_meta_url();
    var color = require_kleur();
    var Prompt = require_prompt2();
    var { style, clear, figures, wrap: wrap4, entriesToDisplay } = require_util8();
    var { cursor } = require_src2();
    var SelectPrompt = class extends Prompt {
      static {
        __name(this, "SelectPrompt");
      }
      constructor(opts = {}) {
        super(opts);
        this.msg = opts.message;
        this.hint = opts.hint || "- Use arrow-keys. Return to submit.";
        this.warn = opts.warn || "- This option is disabled";
        this.cursor = opts.initial || 0;
        this.choices = opts.choices.map((ch2, idx) => {
          if (typeof ch2 === "string")
            ch2 = { title: ch2, value: idx };
          return {
            title: ch2 && (ch2.title || ch2.value || ch2),
            value: ch2 && (ch2.value === void 0 ? idx : ch2.value),
            description: ch2 && ch2.description,
            selected: ch2 && ch2.selected,
            disabled: ch2 && ch2.disabled
          };
        });
        this.optionsPerPage = opts.optionsPerPage || 10;
        this.value = (this.choices[this.cursor] || {}).value;
        this.clear = clear("", this.out.columns);
        this.render();
      }
      moveCursor(n9) {
        this.cursor = n9;
        this.value = this.choices[n9].value;
        this.fire();
      }
      reset() {
        this.moveCursor(0);
        this.fire();
        this.render();
      }
      exit() {
        this.abort();
      }
      abort() {
        this.done = this.aborted = true;
        this.fire();
        this.render();
        this.out.write("\n");
        this.close();
      }
      submit() {
        if (!this.selection.disabled) {
          this.done = true;
          this.aborted = false;
          this.fire();
          this.render();
          this.out.write("\n");
          this.close();
        } else
          this.bell();
      }
      first() {
        this.moveCursor(0);
        this.render();
      }
      last() {
        this.moveCursor(this.choices.length - 1);
        this.render();
      }
      up() {
        if (this.cursor === 0) {
          this.moveCursor(this.choices.length - 1);
        } else {
          this.moveCursor(this.cursor - 1);
        }
        this.render();
      }
      down() {
        if (this.cursor === this.choices.length - 1) {
          this.moveCursor(0);
        } else {
          this.moveCursor(this.cursor + 1);
        }
        this.render();
      }
      next() {
        this.moveCursor((this.cursor + 1) % this.choices.length);
        this.render();
      }
      _(c8, key) {
        if (c8 === " ") return this.submit();
      }
      get selection() {
        return this.choices[this.cursor];
      }
      render() {
        if (this.closed) return;
        if (this.firstRender) this.out.write(cursor.hide);
        else this.out.write(clear(this.outputText, this.out.columns));
        super.render();
        let { startIndex, endIndex } = entriesToDisplay(this.cursor, this.choices.length, this.optionsPerPage);
        this.outputText = [
          style.symbol(this.done, this.aborted),
          color.bold(this.msg),
          style.delimiter(false),
          this.done ? this.selection.title : this.selection.disabled ? color.yellow(this.warn) : color.gray(this.hint)
        ].join(" ");
        if (!this.done) {
          this.outputText += "\n";
          for (let i7 = startIndex; i7 < endIndex; i7++) {
            let title, prefix, desc = "", v8 = this.choices[i7];
            if (i7 === startIndex && startIndex > 0) {
              prefix = figures.arrowUp;
            } else if (i7 === endIndex - 1 && endIndex < this.choices.length) {
              prefix = figures.arrowDown;
            } else {
              prefix = " ";
            }
            if (v8.disabled) {
              title = this.cursor === i7 ? color.gray().underline(v8.title) : color.strikethrough().gray(v8.title);
              prefix = (this.cursor === i7 ? color.bold().gray(figures.pointer) + " " : "  ") + prefix;
            } else {
              title = this.cursor === i7 ? color.cyan().underline(v8.title) : v8.title;
              prefix = (this.cursor === i7 ? color.cyan(figures.pointer) + " " : "  ") + prefix;
              if (v8.description && this.cursor === i7) {
                desc = ` - ${v8.description}`;
                if (prefix.length + title.length + desc.length >= this.out.columns || v8.description.split(/\r?\n/).length > 1) {
                  desc = "\n" + wrap4(v8.description, { margin: 3, width: this.out.columns });
                }
              }
            }
            this.outputText += `${prefix} ${title}${color.gray(desc)}
`;
          }
        }
        this.out.write(this.outputText);
      }
    };
    module2.exports = SelectPrompt;
  }
});

// ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/toggle.js
var require_toggle2 = __commonJS({
  "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/toggle.js"(exports, module2) {
    init_import_meta_url();
    var color = require_kleur();
    var Prompt = require_prompt2();
    var { style, clear } = require_util8();
    var { cursor, erase } = require_src2();
    var TogglePrompt = class extends Prompt {
      static {
        __name(this, "TogglePrompt");
      }
      constructor(opts = {}) {
        super(opts);
        this.msg = opts.message;
        this.value = !!opts.initial;
        this.active = opts.active || "on";
        this.inactive = opts.inactive || "off";
        this.initialValue = this.value;
        this.render();
      }
      reset() {
        this.value = this.initialValue;
        this.fire();
        this.render();
      }
      exit() {
        this.abort();
      }
      abort() {
        this.done = this.aborted = true;
        this.fire();
        this.render();
        this.out.write("\n");
        this.close();
      }
      submit() {
        this.done = true;
        this.aborted = false;
        this.fire();
        this.render();
        this.out.write("\n");
        this.close();
      }
      deactivate() {
        if (this.value === false) return this.bell();
        this.value = false;
        this.render();
      }
      activate() {
        if (this.value === true) return this.bell();
        this.value = true;
        this.render();
      }
      delete() {
        this.deactivate();
      }
      left() {
        this.deactivate();
      }
      right() {
        this.activate();
      }
      down() {
        this.deactivate();
      }
      up() {
        this.activate();
      }
      next() {
        this.value = !this.value;
        this.fire();
        this.render();
      }
      _(c8, key) {
        if (c8 === " ") {
          this.value = !this.value;
        } else if (c8 === "1") {
          this.value = true;
        } else if (c8 === "0") {
          this.value = false;
        } else return this.bell();
        this.render();
      }
      render() {
        if (this.closed) return;
        if (this.firstRender) this.out.write(cursor.hide);
        else this.out.write(clear(this.outputText, this.out.columns));
        super.render();
        this.outputText = [
          style.symbol(this.done, this.aborted),
          color.bold(this.msg),
          style.delimiter(this.done),
          this.value ? this.inactive : color.cyan().underline(this.inactive),
          color.gray("/"),
          this.value ? color.cyan().underline(this.active) : this.active
        ].join(" ");
        this.out.write(erase.line + cursor.to(0) + this.outputText);
      }
    };
    module2.exports = TogglePrompt;
  }
});

// ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/datepart.js
var require_datepart2 = __commonJS({
  "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/datepart.js"(exports, module2) {
    init_import_meta_url();
    var DatePart = class _DatePart {
      static {
        __name(this, "DatePart");
      }
      constructor({ token, date, parts, locales }) {
        this.token = token;
        this.date = date || /* @__PURE__ */ new Date();
        this.parts = parts || [this];
        this.locales = locales || {};
      }
      up() {
      }
      down() {
      }
      next() {
        const currentIdx = this.parts.indexOf(this);
        return this.parts.find((part, idx) => idx > currentIdx && part instanceof _DatePart);
      }
      setTo(val2) {
      }
      prev() {
        let parts = [].concat(this.parts).reverse();
        const currentIdx = parts.indexOf(this);
        return parts.find((part, idx) => idx > currentIdx && part instanceof _DatePart);
      }
      toString() {
        return String(this.date);
      }
    };
    module2.exports = DatePart;
  }
});

// ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/meridiem.js
var require_meridiem2 = __commonJS({
  "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/meridiem.js"(exports, module2) {
    init_import_meta_url();
    var DatePart = require_datepart2();
    var Meridiem = class extends DatePart {
      static {
        __name(this, "Meridiem");
      }
      constructor(opts = {}) {
        super(opts);
      }
      up() {
        this.date.setHours((this.date.getHours() + 12) % 24);
      }
      down() {
        this.up();
      }
      toString() {
        let meridiem = this.date.getHours() > 12 ? "pm" : "am";
        return /\A/.test(this.token) ? meridiem.toUpperCase() : meridiem;
      }
    };
    module2.exports = Meridiem;
  }
});

// ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/day.js
var require_day2 = __commonJS({
  "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/day.js"(exports, module2) {
    init_import_meta_url();
    var DatePart = require_datepart2();
    var pos = /* @__PURE__ */ __name((n9) => {
      n9 = n9 % 10;
      return n9 === 1 ? "st" : n9 === 2 ? "nd" : n9 === 3 ? "rd" : "th";
    }, "pos");
    var Day = class extends DatePart {
      static {
        __name(this, "Day");
      }
      constructor(opts = {}) {
        super(opts);
      }
      up() {
        this.date.setDate(this.date.getDate() + 1);
      }
      down() {
        this.date.setDate(this.date.getDate() - 1);
      }
      setTo(val2) {
        this.date.setDate(parseInt(val2.substr(-2)));
      }
      toString() {
        let date = this.date.getDate();
        let day = this.date.getDay();
        return this.token === "DD" ? String(date).padStart(2, "0") : this.token === "Do" ? date + pos(date) : this.token === "d" ? day + 1 : this.token === "ddd" ? this.locales.weekdaysShort[day] : this.token === "dddd" ? this.locales.weekdays[day] : date;
      }
    };
    module2.exports = Day;
  }
});

// ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/hours.js
var require_hours2 = __commonJS({
  "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/hours.js"(exports, module2) {
    init_import_meta_url();
    var DatePart = require_datepart2();
    var Hours = class extends DatePart {
      static {
        __name(this, "Hours");
      }
      constructor(opts = {}) {
        super(opts);
      }
      up() {
        this.date.setHours(this.date.getHours() + 1);
      }
      down() {
        this.date.setHours(this.date.getHours() - 1);
      }
      setTo(val2) {
        this.date.setHours(parseInt(val2.substr(-2)));
      }
      toString() {
        let hours = this.date.getHours();
        if (/h/.test(this.token))
          hours = hours % 12 || 12;
        return this.token.length > 1 ? String(hours).padStart(2, "0") : hours;
      }
    };
    module2.exports = Hours;
  }
});

// ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/milliseconds.js
var require_milliseconds2 = __commonJS({
  "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/milliseconds.js"(exports, module2) {
    init_import_meta_url();
    var DatePart = require_datepart2();
    var Milliseconds = class extends DatePart {
      static {
        __name(this, "Milliseconds");
      }
      constructor(opts = {}) {
        super(opts);
      }
      up() {
        this.date.setMilliseconds(this.date.getMilliseconds() + 1);
      }
      down() {
        this.date.setMilliseconds(this.date.getMilliseconds() - 1);
      }
      setTo(val2) {
        this.date.setMilliseconds(parseInt(val2.substr(-this.token.length)));
      }
      toString() {
        return String(this.date.getMilliseconds()).padStart(4, "0").substr(0, this.token.length);
      }
    };
    module2.exports = Milliseconds;
  }
});

// ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/minutes.js
var require_minutes2 = __commonJS({
  "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/minutes.js"(exports, module2) {
    init_import_meta_url();
    var DatePart = require_datepart2();
    var Minutes = class extends DatePart {
      static {
        __name(this, "Minutes");
      }
      constructor(opts = {}) {
        super(opts);
      }
      up() {
        this.date.setMinutes(this.date.getMinutes() + 1);
      }
      down() {
        this.date.setMinutes(this.date.getMinutes() - 1);
      }
      setTo(val2) {
        this.date.setMinutes(parseInt(val2.substr(-2)));
      }
      toString() {
        let m7 = this.date.getMinutes();
        return this.token.length > 1 ? String(m7).padStart(2, "0") : m7;
      }
    };
    module2.exports = Minutes;
  }
});

// ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/month.js
var require_month2 = __commonJS({
  "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/month.js"(exports, module2) {
    init_import_meta_url();
    var DatePart = require_datepart2();
    var Month = class extends DatePart {
      static {
        __name(this, "Month");
      }
      constructor(opts = {}) {
        super(opts);
      }
      up() {
        this.date.setMonth(this.date.getMonth() + 1);
      }
      down() {
        this.date.setMonth(this.date.getMonth() - 1);
      }
      setTo(val2) {
        val2 = parseInt(val2.substr(-2)) - 1;
        this.date.setMonth(val2 < 0 ? 0 : val2);
      }
      toString() {
        let month = this.date.getMonth();
        let tl = this.token.length;
        return tl === 2 ? String(month + 1).padStart(2, "0") : tl === 3 ? this.locales.monthsShort[month] : tl === 4 ? this.locales.months[month] : String(month + 1);
      }
    };
    module2.exports = Month;
  }
});

// ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/seconds.js
var require_seconds2 = __commonJS({
  "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/seconds.js"(exports, module2) {
    init_import_meta_url();
    var DatePart = require_datepart2();
    var Seconds = class extends DatePart {
      static {
        __name(this, "Seconds");
      }
      constructor(opts = {}) {
        super(opts);
      }
      up() {
        this.date.setSeconds(this.date.getSeconds() + 1);
      }
      down() {
        this.date.setSeconds(this.date.getSeconds() - 1);
      }
      setTo(val2) {
        this.date.setSeconds(parseInt(val2.substr(-2)));
      }
      toString() {
        let s7 = this.date.getSeconds();
        return this.token.length > 1 ? String(s7).padStart(2, "0") : s7;
      }
    };
    module2.exports = Seconds;
  }
});

// ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/year.js
var require_year2 = __commonJS({
  "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/year.js"(exports, module2) {
    init_import_meta_url();
    var DatePart = require_datepart2();
    var Year = class extends DatePart {
      static {
        __name(this, "Year");
      }
      constructor(opts = {}) {
        super(opts);
      }
      up() {
        this.date.setFullYear(this.date.getFullYear() + 1);
      }
      down() {
        this.date.setFullYear(this.date.getFullYear() - 1);
      }
      setTo(val2) {
        this.date.setFullYear(val2.substr(-4));
      }
      toString() {
        let year = String(this.date.getFullYear()).padStart(4, "0");
        return this.token.length === 2 ? year.substr(-2) : year;
      }
    };
    module2.exports = Year;
  }
});

// ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/index.js
var require_dateparts2 = __commonJS({
  "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/index.js"(exports, module2) {
    init_import_meta_url();
    module2.exports = {
      DatePart: require_datepart2(),
      Meridiem: require_meridiem2(),
      Day: require_day2(),
      Hours: require_hours2(),
      Milliseconds: require_milliseconds2(),
      Minutes: require_minutes2(),
      Month: require_month2(),
      Seconds: require_seconds2(),
      Year: require_year2()
    };
  }
});

// ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/date.js
var require_date3 = __commonJS({
  "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/date.js"(exports, module2) {
    init_import_meta_url();
    var color = require_kleur();
    var Prompt = require_prompt2();
    var { style, clear, figures } = require_util8();
    var { erase, cursor } = require_src2();
    var { DatePart, Meridiem, Day, Hours, Milliseconds, Minutes, Month, Seconds, Year } = require_dateparts2();
    var regex2 = /\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g;
    var regexGroups = {
      1: ({ token }) => token.replace(/\\(.)/g, "$1"),
      2: (opts) => new Day(opts),
      // Day // TODO
      3: (opts) => new Month(opts),
      // Month
      4: (opts) => new Year(opts),
      // Year
      5: (opts) => new Meridiem(opts),
      // AM/PM // TODO (special)
      6: (opts) => new Hours(opts),
      // Hours
      7: (opts) => new Minutes(opts),
      // Minutes
      8: (opts) => new Seconds(opts),
      // Seconds
      9: (opts) => new Milliseconds(opts)
      // Fractional seconds
    };
    var dfltLocales = {
      months: "January,February,March,April,May,June,July,August,September,October,November,December".split(","),
      monthsShort: "Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),
      weekdays: "Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),
      weekdaysShort: "Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")
    };
    var DatePrompt = class extends Prompt {
      static {
        __name(this, "DatePrompt");
      }
      constructor(opts = {}) {
        super(opts);
        this.msg = opts.message;
        this.cursor = 0;
        this.typed = "";
        this.locales = Object.assign(dfltLocales, opts.locales);
        this._date = opts.initial || /* @__PURE__ */ new Date();
        this.errorMsg = opts.error || "Please Enter A Valid Value";
        this.validator = opts.validate || (() => true);
        this.mask = opts.mask || "YYYY-MM-DD HH:mm:ss";
        this.clear = clear("", this.out.columns);
        this.render();
      }
      get value() {
        return this.date;
      }
      get date() {
        return this._date;
      }
      set date(date) {
        if (date) this._date.setTime(date.getTime());
      }
      set mask(mask) {
        let result;
        this.parts = [];
        while (result = regex2.exec(mask)) {
          let match3 = result.shift();
          let idx = result.findIndex((gr2) => gr2 != null);
          this.parts.push(idx in regexGroups ? regexGroups[idx]({ token: result[idx] || match3, date: this.date, parts: this.parts, locales: this.locales }) : result[idx] || match3);
        }
        let parts = this.parts.reduce((arr, i7) => {
          if (typeof i7 === "string" && typeof arr[arr.length - 1] === "string")
            arr[arr.length - 1] += i7;
          else arr.push(i7);
          return arr;
        }, []);
        this.parts.splice(0);
        this.parts.push(...parts);
        this.reset();
      }
      moveCursor(n9) {
        this.typed = "";
        this.cursor = n9;
        this.fire();
      }
      reset() {
        this.moveCursor(this.parts.findIndex((p7) => p7 instanceof DatePart));
        this.fire();
        this.render();
      }
      exit() {
        this.abort();
      }
      abort() {
        this.done = this.aborted = true;
        this.error = false;
        this.fire();
        this.render();
        this.out.write("\n");
        this.close();
      }
      async validate() {
        let valid = await this.validator(this.value);
        if (typeof valid === "string") {
          this.errorMsg = valid;
          valid = false;
        }
        this.error = !valid;
      }
      async submit() {
        await this.validate();
        if (this.error) {
          this.color = "red";
          this.fire();
          this.render();
          return;
        }
        this.done = true;
        this.aborted = false;
        this.fire();
        this.render();
        this.out.write("\n");
        this.close();
      }
      up() {
        this.typed = "";
        this.parts[this.cursor].up();
        this.render();
      }
      down() {
        this.typed = "";
        this.parts[this.cursor].down();
        this.render();
      }
      left() {
        let prev = this.parts[this.cursor].prev();
        if (prev == null) return this.bell();
        this.moveCursor(this.parts.indexOf(prev));
        this.render();
      }
      right() {
        let next = this.parts[this.cursor].next();
        if (next == null) return this.bell();
        this.moveCursor(this.parts.indexOf(next));
        this.render();
      }
      next() {
        let next = this.parts[this.cursor].next();
        this.moveCursor(next ? this.parts.indexOf(next) : this.parts.findIndex((part) => part instanceof DatePart));
        this.render();
      }
      _(c8) {
        if (/\d/.test(c8)) {
          this.typed += c8;
          this.parts[this.cursor].setTo(this.typed);
          this.render();
        }
      }
      render() {
        if (this.closed) return;
        if (this.firstRender) this.out.write(cursor.hide);
        else this.out.write(clear(this.outputText, this.out.columns));
        super.render();
        this.outputText = [
          style.symbol(this.done, this.aborted),
          color.bold(this.msg),
          style.delimiter(false),
          this.parts.reduce((arr, p7, idx) => arr.concat(idx === this.cursor && !this.done ? color.cyan().underline(p7.toString()) : p7), []).join("")
        ].join(" ");
        if (this.error) {
          this.outputText += this.errorMsg.split("\n").reduce(
            (a7, l8, i7) => a7 + `
${i7 ? ` ` : figures.pointerSmall} ${color.red().italic(l8)}`,
            ``
          );
        }
        this.out.write(erase.line + cursor.to(0) + this.outputText);
      }
    };
    module2.exports = DatePrompt;
  }
});

// ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/number.js
var require_number2 = __commonJS({
  "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/number.js"(exports, module2) {
    init_import_meta_url();
    var color = require_kleur();
    var Prompt = require_prompt2();
    var { cursor, erase } = require_src2();
    var { style, figures, clear, lines } = require_util8();
    var isNumber = /[0-9]/;
    var isDef = /* @__PURE__ */ __name((any) => any !== void 0, "isDef");
    var round = /* @__PURE__ */ __name((number, precision) => {
      let factor = Math.pow(10, precision);
      return Math.round(number * factor) / factor;
    }, "round");
    var NumberPrompt = class extends Prompt {
      static {
        __name(this, "NumberPrompt");
      }
      constructor(opts = {}) {
        super(opts);
        this.transform = style.render(opts.style);
        this.msg = opts.message;
        this.initial = isDef(opts.initial) ? opts.initial : "";
        this.float = !!opts.float;
        this.round = opts.round || 2;
        this.inc = opts.increment || 1;
        this.min = isDef(opts.min) ? opts.min : -Infinity;
        this.max = isDef(opts.max) ? opts.max : Infinity;
        this.errorMsg = opts.error || `Please Enter A Valid Value`;
        this.validator = opts.validate || (() => true);
        this.color = `cyan`;
        this.value = ``;
        this.typed = ``;
        this.lastHit = 0;
        this.render();
      }
      set value(v8) {
        if (!v8 && v8 !== 0) {
          this.placeholder = true;
          this.rendered = color.gray(this.transform.render(`${this.initial}`));
          this._value = ``;
        } else {
          this.placeholder = false;
          this.rendered = this.transform.render(`${round(v8, this.round)}`);
          this._value = round(v8, this.round);
        }
        this.fire();
      }
      get value() {
        return this._value;
      }
      parse(x7) {
        return this.float ? parseFloat(x7) : parseInt(x7);
      }
      valid(c8) {
        return c8 === `-` || c8 === `.` && this.float || isNumber.test(c8);
      }
      reset() {
        this.typed = ``;
        this.value = ``;
        this.fire();
        this.render();
      }
      exit() {
        this.abort();
      }
      abort() {
        let x7 = this.value;
        this.value = x7 !== `` ? x7 : this.initial;
        this.done = this.aborted = true;
        this.error = false;
        this.fire();
        this.render();
        this.out.write(`
`);
        this.close();
      }
      async validate() {
        let valid = await this.validator(this.value);
        if (typeof valid === `string`) {
          this.errorMsg = valid;
          valid = false;
        }
        this.error = !valid;
      }
      async submit() {
        await this.validate();
        if (this.error) {
          this.color = `red`;
          this.fire();
          this.render();
          return;
        }
        let x7 = this.value;
        this.value = x7 !== `` ? x7 : this.initial;
        this.done = true;
        this.aborted = false;
        this.error = false;
        this.fire();
        this.render();
        this.out.write(`
`);
        this.close();
      }
      up() {
        this.typed = ``;
        if (this.value === "") {
          this.value = this.min - this.inc;
        }
        if (this.value >= this.max) return this.bell();
        this.value += this.inc;
        this.color = `cyan`;
        this.fire();
        this.render();
      }
      down() {
        this.typed = ``;
        if (this.value === "") {
          this.value = this.min + this.inc;
        }
        if (this.value <= this.min) return this.bell();
        this.value -= this.inc;
        this.color = `cyan`;
        this.fire();
        this.render();
      }
      delete() {
        let val2 = this.value.toString();
        if (val2.length === 0) return this.bell();
        this.value = this.parse(val2 = val2.slice(0, -1)) || ``;
        if (this.value !== "" && this.value < this.min) {
          this.value = this.min;
        }
        this.color = `cyan`;
        this.fire();
        this.render();
      }
      next() {
        this.value = this.initial;
        this.fire();
        this.render();
      }
      _(c8, key) {
        if (!this.valid(c8)) return this.bell();
        const now = Date.now();
        if (now - this.lastHit > 1e3) this.typed = ``;
        this.typed += c8;
        this.lastHit = now;
        this.color = `cyan`;
        if (c8 === `.`) return this.fire();
        this.value = Math.min(this.parse(this.typed), this.max);
        if (this.value > this.max) this.value = this.max;
        if (this.value < this.min) this.value = this.min;
        this.fire();
        this.render();
      }
      render() {
        if (this.closed) return;
        if (!this.firstRender) {
          if (this.outputError)
            this.out.write(cursor.down(lines(this.outputError, this.out.columns) - 1) + clear(this.outputError, this.out.columns));
          this.out.write(clear(this.outputText, this.out.columns));
        }
        super.render();
        this.outputError = "";
        this.outputText = [
          style.symbol(this.done, this.aborted),
          color.bold(this.msg),
          style.delimiter(this.done),
          !this.done || !this.done && !this.placeholder ? color[this.color]().underline(this.rendered) : this.rendered
        ].join(` `);
        if (this.error) {
          this.outputError += this.errorMsg.split(`
`).reduce((a7, l8, i7) => a7 + `
${i7 ? ` ` : figures.pointerSmall} ${color.red().italic(l8)}`, ``);
        }
        this.out.write(erase.line + cursor.to(0) + this.outputText + cursor.save + this.outputError + cursor.restore);
      }
    };
    module2.exports = NumberPrompt;
  }
});

// ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/multiselect.js
var require_multiselect2 = __commonJS({
  "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/multiselect.js"(exports, module2) {
    init_import_meta_url();
    var color = require_kleur();
    var { cursor } = require_src2();
    var Prompt = require_prompt2();
    var { clear, figures, style, wrap: wrap4, entriesToDisplay } = require_util8();
    var MultiselectPrompt = class extends Prompt {
      static {
        __name(this, "MultiselectPrompt");
      }
      constructor(opts = {}) {
        super(opts);
        this.msg = opts.message;
        this.cursor = opts.cursor || 0;
        this.scrollIndex = opts.cursor || 0;
        this.hint = opts.hint || "";
        this.warn = opts.warn || "- This option is disabled -";
        this.minSelected = opts.min;
        this.showMinError = false;
        this.maxChoices = opts.max;
        this.instructions = opts.instructions;
        this.optionsPerPage = opts.optionsPerPage || 10;
        this.value = opts.choices.map((ch2, idx) => {
          if (typeof ch2 === "string")
            ch2 = { title: ch2, value: idx };
          return {
            title: ch2 && (ch2.title || ch2.value || ch2),
            description: ch2 && ch2.description,
            value: ch2 && (ch2.value === void 0 ? idx : ch2.value),
            selected: ch2 && ch2.selected,
            disabled: ch2 && ch2.disabled
          };
        });
        this.clear = clear("", this.out.columns);
        if (!opts.overrideRender) {
          this.render();
        }
      }
      reset() {
        this.value.map((v8) => !v8.selected);
        this.cursor = 0;
        this.fire();
        this.render();
      }
      selected() {
        return this.value.filter((v8) => v8.selected);
      }
      exit() {
        this.abort();
      }
      abort() {
        this.done = this.aborted = true;
        this.fire();
        this.render();
        this.out.write("\n");
        this.close();
      }
      submit() {
        const selected = this.value.filter((e10) => e10.selected);
        if (this.minSelected && selected.length < this.minSelected) {
          this.showMinError = true;
          this.render();
        } else {
          this.done = true;
          this.aborted = false;
          this.fire();
          this.render();
          this.out.write("\n");
          this.close();
        }
      }
      first() {
        this.cursor = 0;
        this.render();
      }
      last() {
        this.cursor = this.value.length - 1;
        this.render();
      }
      next() {
        this.cursor = (this.cursor + 1) % this.value.length;
        this.render();
      }
      up() {
        if (this.cursor === 0) {
          this.cursor = this.value.length - 1;
        } else {
          this.cursor--;
        }
        this.render();
      }
      down() {
        if (this.cursor === this.value.length - 1) {
          this.cursor = 0;
        } else {
          this.cursor++;
        }
        this.render();
      }
      left() {
        this.value[this.cursor].selected = false;
        this.render();
      }
      right() {
        if (this.value.filter((e10) => e10.selected).length >= this.maxChoices) return this.bell();
        this.value[this.cursor].selected = true;
        this.render();
      }
      handleSpaceToggle() {
        const v8 = this.value[this.cursor];
        if (v8.selected) {
          v8.selected = false;
          this.render();
        } else if (v8.disabled || this.value.filter((e10) => e10.selected).length >= this.maxChoices) {
          return this.bell();
        } else {
          v8.selected = true;
          this.render();
        }
      }
      toggleAll() {
        if (this.maxChoices !== void 0 || this.value[this.cursor].disabled) {
          return this.bell();
        }
        const newSelected = !this.value[this.cursor].selected;
        this.value.filter((v8) => !v8.disabled).forEach((v8) => v8.selected = newSelected);
        this.render();
      }
      _(c8, key) {
        if (c8 === " ") {
          this.handleSpaceToggle();
        } else if (c8 === "a") {
          this.toggleAll();
        } else {
          return this.bell();
        }
      }
      renderInstructions() {
        if (this.instructions === void 0 || this.instructions) {
          if (typeof this.instructions === "string") {
            return this.instructions;
          }
          return `
Instructions:
    ${figures.arrowUp}/${figures.arrowDown}: Highlight option
    ${figures.arrowLeft}/${figures.arrowRight}/[space]: Toggle selection
` + (this.maxChoices === void 0 ? `    a: Toggle all
` : "") + `    enter/return: Complete answer`;
        }
        return "";
      }
      renderOption(cursor2, v8, i7, arrowIndicator) {
        const prefix = (v8.selected ? color.green(figures.radioOn) : figures.radioOff) + " " + arrowIndicator + " ";
        let title, desc;
        if (v8.disabled) {
          title = cursor2 === i7 ? color.gray().underline(v8.title) : color.strikethrough().gray(v8.title);
        } else {
          title = cursor2 === i7 ? color.cyan().underline(v8.title) : v8.title;
          if (cursor2 === i7 && v8.description) {
            desc = ` - ${v8.description}`;
            if (prefix.length + title.length + desc.length >= this.out.columns || v8.description.split(/\r?\n/).length > 1) {
              desc = "\n" + wrap4(v8.description, { margin: prefix.length, width: this.out.columns });
            }
          }
        }
        return prefix + title + color.gray(desc || "");
      }
      // shared with autocompleteMultiselect
      paginateOptions(options) {
        if (options.length === 0) {
          return color.red("No matches for this query.");
        }
        let { startIndex, endIndex } = entriesToDisplay(this.cursor, options.length, this.optionsPerPage);
        let prefix, styledOptions = [];
        for (let i7 = startIndex; i7 < endIndex; i7++) {
          if (i7 === startIndex && startIndex > 0) {
            prefix = figures.arrowUp;
          } else if (i7 === endIndex - 1 && endIndex < options.length) {
            prefix = figures.arrowDown;
          } else {
            prefix = " ";
          }
          styledOptions.push(this.renderOption(this.cursor, options[i7], i7, prefix));
        }
        return "\n" + styledOptions.join("\n");
      }
      // shared with autocomleteMultiselect
      renderOptions(options) {
        if (!this.done) {
          return this.paginateOptions(options);
        }
        return "";
      }
      renderDoneOrInstructions() {
        if (this.done) {
          return this.value.filter((e10) => e10.selected).map((v8) => v8.title).join(", ");
        }
        const output = [color.gray(this.hint), this.renderInstructions()];
        if (this.value[this.cursor].disabled) {
          output.push(color.yellow(this.warn));
        }
        return output.join(" ");
      }
      render() {
        if (this.closed) return;
        if (this.firstRender) this.out.write(cursor.hide);
        super.render();
        let prompt2 = [
          style.symbol(this.done, this.aborted),
          color.bold(this.msg),
          style.delimiter(false),
          this.renderDoneOrInstructions()
        ].join(" ");
        if (this.showMinError) {
          prompt2 += color.red(`You must select a minimum of ${this.minSelected} choices.`);
          this.showMinError = false;
        }
        prompt2 += this.renderOptions(this.value);
        this.out.write(this.clear + prompt2);
        this.clear = clear(prompt2, this.out.columns);
      }
    };
    module2.exports = MultiselectPrompt;
  }
});

// ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/autocomplete.js
var require_autocomplete2 = __commonJS({
  "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/autocomplete.js"(exports, module2) {
    init_import_meta_url();
    var color = require_kleur();
    var Prompt = require_prompt2();
    var { erase, cursor } = require_src2();
    var { style, clear, figures, wrap: wrap4, entriesToDisplay } = require_util8();
    var getVal = /* @__PURE__ */ __name((arr, i7) => arr[i7] && (arr[i7].value || arr[i7].title || arr[i7]), "getVal");
    var getTitle = /* @__PURE__ */ __name((arr, i7) => arr[i7] && (arr[i7].title || arr[i7].value || arr[i7]), "getTitle");
    var getIndex2 = /* @__PURE__ */ __name((arr, valOrTitle) => {
      const index = arr.findIndex((el) => el.value === valOrTitle || el.title === valOrTitle);
      return index > -1 ? index : void 0;
    }, "getIndex");
    var AutocompletePrompt = class extends Prompt {
      static {
        __name(this, "AutocompletePrompt");
      }
      constructor(opts = {}) {
        super(opts);
        this.msg = opts.message;
        this.suggest = opts.suggest;
        this.choices = opts.choices;
        this.initial = typeof opts.initial === "number" ? opts.initial : getIndex2(opts.choices, opts.initial);
        this.select = this.initial || opts.cursor || 0;
        this.i18n = { noMatches: opts.noMatches || "no matches found" };
        this.fallback = opts.fallback || this.initial;
        this.clearFirst = opts.clearFirst || false;
        this.suggestions = [];
        this.input = "";
        this.limit = opts.limit || 10;
        this.cursor = 0;
        this.transform = style.render(opts.style);
        this.scale = this.transform.scale;
        this.render = this.render.bind(this);
        this.complete = this.complete.bind(this);
        this.clear = clear("", this.out.columns);
        this.complete(this.render);
        this.render();
      }
      set fallback(fb) {
        this._fb = Number.isSafeInteger(parseInt(fb)) ? parseInt(fb) : fb;
      }
      get fallback() {
        let choice;
        if (typeof this._fb === "number")
          choice = this.choices[this._fb];
        else if (typeof this._fb === "string")
          choice = { title: this._fb };
        return choice || this._fb || { title: this.i18n.noMatches };
      }
      moveSelect(i7) {
        this.select = i7;
        if (this.suggestions.length > 0)
          this.value = getVal(this.suggestions, i7);
        else this.value = this.fallback.value;
        this.fire();
      }
      async complete(cb2) {
        const p7 = this.completing = this.suggest(this.input, this.choices);
        const suggestions = await p7;
        if (this.completing !== p7) return;
        this.suggestions = suggestions.map((s7, i7, arr) => ({ title: getTitle(arr, i7), value: getVal(arr, i7), description: s7.description }));
        this.completing = false;
        const l8 = Math.max(suggestions.length - 1, 0);
        this.moveSelect(Math.min(l8, this.select));
        cb2 && cb2();
      }
      reset() {
        this.input = "";
        this.complete(() => {
          this.moveSelect(this.initial !== void 0 ? this.initial : 0);
          this.render();
        });
        this.render();
      }
      exit() {
        if (this.clearFirst && this.input.length > 0) {
          this.reset();
        } else {
          this.done = this.exited = true;
          this.aborted = false;
          this.fire();
          this.render();
          this.out.write("\n");
          this.close();
        }
      }
      abort() {
        this.done = this.aborted = true;
        this.exited = false;
        this.fire();
        this.render();
        this.out.write("\n");
        this.close();
      }
      submit() {
        this.done = true;
        this.aborted = this.exited = false;
        this.fire();
        this.render();
        this.out.write("\n");
        this.close();
      }
      _(c8, key) {
        let s1 = this.input.slice(0, this.cursor);
        let s22 = this.input.slice(this.cursor);
        this.input = `${s1}${c8}${s22}`;
        this.cursor = s1.length + 1;
        this.complete(this.render);
        this.render();
      }
      delete() {
        if (this.cursor === 0) return this.bell();
        let s1 = this.input.slice(0, this.cursor - 1);
        let s22 = this.input.slice(this.cursor);
        this.input = `${s1}${s22}`;
        this.complete(this.render);
        this.cursor = this.cursor - 1;
        this.render();
      }
      deleteForward() {
        if (this.cursor * this.scale >= this.rendered.length) return this.bell();
        let s1 = this.input.slice(0, this.cursor);
        let s22 = this.input.slice(this.cursor + 1);
        this.input = `${s1}${s22}`;
        this.complete(this.render);
        this.render();
      }
      first() {
        this.moveSelect(0);
        this.render();
      }
      last() {
        this.moveSelect(this.suggestions.length - 1);
        this.render();
      }
      up() {
        if (this.select === 0) {
          this.moveSelect(this.suggestions.length - 1);
        } else {
          this.moveSelect(this.select - 1);
        }
        this.render();
      }
      down() {
        if (this.select === this.suggestions.length - 1) {
          this.moveSelect(0);
        } else {
          this.moveSelect(this.select + 1);
        }
        this.render();
      }
      next() {
        if (this.select === this.suggestions.length - 1) {
          this.moveSelect(0);
        } else this.moveSelect(this.select + 1);
        this.render();
      }
      nextPage() {
        this.moveSelect(Math.min(this.select + this.limit, this.suggestions.length - 1));
        this.render();
      }
      prevPage() {
        this.moveSelect(Math.max(this.select - this.limit, 0));
        this.render();
      }
      left() {
        if (this.cursor <= 0) return this.bell();
        this.cursor = this.cursor - 1;
        this.render();
      }
      right() {
        if (this.cursor * this.scale >= this.rendered.length) return this.bell();
        this.cursor = this.cursor + 1;
        this.render();
      }
      renderOption(v8, hovered, isStart, isEnd) {
        let desc;
        let prefix = isStart ? figures.arrowUp : isEnd ? figures.arrowDown : " ";
        let title = hovered ? color.cyan().underline(v8.title) : v8.title;
        prefix = (hovered ? color.cyan(figures.pointer) + " " : "  ") + prefix;
        if (v8.description) {
          desc = ` - ${v8.description}`;
          if (prefix.length + title.length + desc.length >= this.out.columns || v8.description.split(/\r?\n/).length > 1) {
            desc = "\n" + wrap4(v8.description, { margin: 3, width: this.out.columns });
          }
        }
        return prefix + " " + title + color.gray(desc || "");
      }
      render() {
        if (this.closed) return;
        if (this.firstRender) this.out.write(cursor.hide);
        else this.out.write(clear(this.outputText, this.out.columns));
        super.render();
        let { startIndex, endIndex } = entriesToDisplay(this.select, this.choices.length, this.limit);
        this.outputText = [
          style.symbol(this.done, this.aborted, this.exited),
          color.bold(this.msg),
          style.delimiter(this.completing),
          this.done && this.suggestions[this.select] ? this.suggestions[this.select].title : this.rendered = this.transform.render(this.input)
        ].join(" ");
        if (!this.done) {
          const suggestions = this.suggestions.slice(startIndex, endIndex).map((item, i7) => this.renderOption(
            item,
            this.select === i7 + startIndex,
            i7 === 0 && startIndex > 0,
            i7 + startIndex === endIndex - 1 && endIndex < this.choices.length
          )).join("\n");
          this.outputText += `
` + (suggestions || color.gray(this.fallback.title));
        }
        this.out.write(erase.line + cursor.to(0) + this.outputText);
      }
    };
    module2.exports = AutocompletePrompt;
  }
});

// ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/autocompleteMultiselect.js
var require_autocompleteMultiselect2 = __commonJS({
  "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/autocompleteMultiselect.js"(exports, module2) {
    init_import_meta_url();
    var color = require_kleur();
    var { cursor } = require_src2();
    var MultiselectPrompt = require_multiselect2();
    var { clear, style, figures } = require_util8();
    var AutocompleteMultiselectPrompt = class extends MultiselectPrompt {
      static {
        __name(this, "AutocompleteMultiselectPrompt");
      }
      constructor(opts = {}) {
        opts.overrideRender = true;
        super(opts);
        this.inputValue = "";
        this.clear = clear("", this.out.columns);
        this.filteredOptions = this.value;
        this.render();
      }
      last() {
        this.cursor = this.filteredOptions.length - 1;
        this.render();
      }
      next() {
        this.cursor = (this.cursor + 1) % this.filteredOptions.length;
        this.render();
      }
      up() {
        if (this.cursor === 0) {
          this.cursor = this.filteredOptions.length - 1;
        } else {
          this.cursor--;
        }
        this.render();
      }
      down() {
        if (this.cursor === this.filteredOptions.length - 1) {
          this.cursor = 0;
        } else {
          this.cursor++;
        }
        this.render();
      }
      left() {
        this.filteredOptions[this.cursor].selected = false;
        this.render();
      }
      right() {
        if (this.value.filter((e10) => e10.selected).length >= this.maxChoices) return this.bell();
        this.filteredOptions[this.cursor].selected = true;
        this.render();
      }
      delete() {
        if (this.inputValue.length) {
          this.inputValue = this.inputValue.substr(0, this.inputValue.length - 1);
          this.updateFilteredOptions();
        }
      }
      updateFilteredOptions() {
        const currentHighlight = this.filteredOptions[this.cursor];
        this.filteredOptions = this.value.filter((v8) => {
          if (this.inputValue) {
            if (typeof v8.title === "string") {
              if (v8.title.toLowerCase().includes(this.inputValue.toLowerCase())) {
                return true;
              }
            }
            if (typeof v8.value === "string") {
              if (v8.value.toLowerCase().includes(this.inputValue.toLowerCase())) {
                return true;
              }
            }
            return false;
          }
          return true;
        });
        const newHighlightIndex = this.filteredOptions.findIndex((v8) => v8 === currentHighlight);
        this.cursor = newHighlightIndex < 0 ? 0 : newHighlightIndex;
        this.render();
      }
      handleSpaceToggle() {
        const v8 = this.filteredOptions[this.cursor];
        if (v8.selected) {
          v8.selected = false;
          this.render();
        } else if (v8.disabled || this.value.filter((e10) => e10.selected).length >= this.maxChoices) {
          return this.bell();
        } else {
          v8.selected = true;
          this.render();
        }
      }
      handleInputChange(c8) {
        this.inputValue = this.inputValue + c8;
        this.updateFilteredOptions();
      }
      _(c8, key) {
        if (c8 === " ") {
          this.handleSpaceToggle();
        } else {
          this.handleInputChange(c8);
        }
      }
      renderInstructions() {
        if (this.instructions === void 0 || this.instructions) {
          if (typeof this.instructions === "string") {
            return this.instructions;
          }
          return `
Instructions:
    ${figures.arrowUp}/${figures.arrowDown}: Highlight option
    ${figures.arrowLeft}/${figures.arrowRight}/[space]: Toggle selection
    [a,b,c]/delete: Filter choices
    enter/return: Complete answer
`;
        }
        return "";
      }
      renderCurrentInput() {
        return `
Filtered results for: ${this.inputValue ? this.inputValue : color.gray("Enter something to filter")}
`;
      }
      renderOption(cursor2, v8, i7) {
        let title;
        if (v8.disabled) title = cursor2 === i7 ? color.gray().underline(v8.title) : color.strikethrough().gray(v8.title);
        else title = cursor2 === i7 ? color.cyan().underline(v8.title) : v8.title;
        return (v8.selected ? color.green(figures.radioOn) : figures.radioOff) + "  " + title;
      }
      renderDoneOrInstructions() {
        if (this.done) {
          return this.value.filter((e10) => e10.selected).map((v8) => v8.title).join(", ");
        }
        const output = [color.gray(this.hint), this.renderInstructions(), this.renderCurrentInput()];
        if (this.filteredOptions.length && this.filteredOptions[this.cursor].disabled) {
          output.push(color.yellow(this.warn));
        }
        return output.join(" ");
      }
      render() {
        if (this.closed) return;
        if (this.firstRender) this.out.write(cursor.hide);
        super.render();
        let prompt2 = [
          style.symbol(this.done, this.aborted),
          color.bold(this.msg),
          style.delimiter(false),
          this.renderDoneOrInstructions()
        ].join(" ");
        if (this.showMinError) {
          prompt2 += color.red(`You must select a minimum of ${this.minSelected} choices.`);
          this.showMinError = false;
        }
        prompt2 += this.renderOptions(this.filteredOptions);
        this.out.write(this.clear + prompt2);
        this.clear = clear(prompt2, this.out.columns);
      }
    };
    module2.exports = AutocompleteMultiselectPrompt;
  }
});

// ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/confirm.js
var require_confirm2 = __commonJS({
  "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/confirm.js"(exports, module2) {
    init_import_meta_url();
    var color = require_kleur();
    var Prompt = require_prompt2();
    var { style, clear } = require_util8();
    var { erase, cursor } = require_src2();
    var ConfirmPrompt = class extends Prompt {
      static {
        __name(this, "ConfirmPrompt");
      }
      constructor(opts = {}) {
        super(opts);
        this.msg = opts.message;
        this.value = opts.initial;
        this.initialValue = !!opts.initial;
        this.yesMsg = opts.yes || "yes";
        this.yesOption = opts.yesOption || "(Y/n)";
        this.noMsg = opts.no || "no";
        this.noOption = opts.noOption || "(y/N)";
        this.render();
      }
      reset() {
        this.value = this.initialValue;
        this.fire();
        this.render();
      }
      exit() {
        this.abort();
      }
      abort() {
        this.done = this.aborted = true;
        this.fire();
        this.render();
        this.out.write("\n");
        this.close();
      }
      submit() {
        this.value = this.value || false;
        this.done = true;
        this.aborted = false;
        this.fire();
        this.render();
        this.out.write("\n");
        this.close();
      }
      _(c8, key) {
        if (c8.toLowerCase() === "y") {
          this.value = true;
          return this.submit();
        }
        if (c8.toLowerCase() === "n") {
          this.value = false;
          return this.submit();
        }
        return this.bell();
      }
      render() {
        if (this.closed) return;
        if (this.firstRender) this.out.write(cursor.hide);
        else this.out.write(clear(this.outputText, this.out.columns));
        super.render();
        this.outputText = [
          style.symbol(this.done, this.aborted),
          color.bold(this.msg),
          style.delimiter(this.done),
          this.done ? this.value ? this.yesMsg : this.noMsg : color.gray(this.initialValue ? this.yesOption : this.noOption)
        ].join(" ");
        this.out.write(erase.line + cursor.to(0) + this.outputText);
      }
    };
    module2.exports = ConfirmPrompt;
  }
});

// ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/index.js
var require_elements2 = __commonJS({
  "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/index.js"(exports, module2) {
    init_import_meta_url();
    module2.exports = {
      TextPrompt: require_text2(),
      SelectPrompt: require_select2(),
      TogglePrompt: require_toggle2(),
      DatePrompt: require_date3(),
      NumberPrompt: require_number2(),
      MultiselectPrompt: require_multiselect2(),
      AutocompletePrompt: require_autocomplete2(),
      AutocompleteMultiselectPrompt: require_autocompleteMultiselect2(),
      ConfirmPrompt: require_confirm2()
    };
  }
});

// ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/prompts.js
var require_prompts2 = __commonJS({
  "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/prompts.js"(exports) {
    init_import_meta_url();
    var $3 = exports;
    var el = require_elements2();
    var noop = /* @__PURE__ */ __name((v8) => v8, "noop");
    function toPrompt(type, args, opts = {}) {
      return new Promise((res, rej) => {
        const p7 = new el[type](args);
        const onAbort = opts.onAbort || noop;
        const onSubmit = opts.onSubmit || noop;
        const onExit6 = opts.onExit || noop;
        p7.on("state", args.onState || noop);
        p7.on("submit", (x7) => res(onSubmit(x7)));
        p7.on("exit", (x7) => res(onExit6(x7)));
        p7.on("abort", (x7) => rej(onAbort(x7)));
      });
    }
    __name(toPrompt, "toPrompt");
    $3.text = (args) => toPrompt("TextPrompt", args);
    $3.password = (args) => {
      args.style = "password";
      return $3.text(args);
    };
    $3.invisible = (args) => {
      args.style = "invisible";
      return $3.text(args);
    };
    $3.number = (args) => toPrompt("NumberPrompt", args);
    $3.date = (args) => toPrompt("DatePrompt", args);
    $3.confirm = (args) => toPrompt("ConfirmPrompt", args);
    $3.list = (args) => {
      const sep6 = args.separator || ",";
      return toPrompt("TextPrompt", args, {
        onSubmit: /* @__PURE__ */ __name((str) => str.split(sep6).map((s7) => s7.trim()), "onSubmit")
      });
    };
    $3.toggle = (args) => toPrompt("TogglePrompt", args);
    $3.select = (args) => toPrompt("SelectPrompt", args);
    $3.multiselect = (args) => {
      args.choices = [].concat(args.choices || []);
      const toSelected = /* @__PURE__ */ __name((items) => items.filter((item) => item.selected).map((item) => item.value), "toSelected");
      return toPrompt("MultiselectPrompt", args, {
        onAbort: toSelected,
        onSubmit: toSelected
      });
    };
    $3.autocompleteMultiselect = (args) => {
      args.choices = [].concat(args.choices || []);
      const toSelected = /* @__PURE__ */ __name((items) => items.filter((item) => item.selected).map((item) => item.value), "toSelected");
      return toPrompt("AutocompleteMultiselectPrompt", args, {
        onAbort: toSelected,
        onSubmit: toSelected
      });
    };
    var byTitle = /* @__PURE__ */ __name((input, choices) => Promise.resolve(
      choices.filter((item) => item.title.slice(0, input.length).toLowerCase() === input.toLowerCase())
    ), "byTitle");
    $3.autocomplete = (args) => {
      args.suggest = args.suggest || byTitle;
      args.choices = [].concat(args.choices || []);
      return toPrompt("AutocompletePrompt", args);
    };
  }
});

// ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/index.js
var require_lib = __commonJS({
  "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/index.js"(exports, module2) {
    init_import_meta_url();
    var prompts2 = require_prompts2();
    var passOn = ["suggest", "format", "onState", "validate", "onRender", "type"];
    var noop = /* @__PURE__ */ __name(() => {
    }, "noop");
    async function prompt2(questions = [], { onSubmit = noop, onCancel = noop } = {}) {
      const answers = {};
      const override2 = prompt2._override || {};
      questions = [].concat(questions);
      let answer, question, quit, name2, type, lastPrompt;
      const getFormattedAnswer = /* @__PURE__ */ __name(async (question2, answer2, skipValidation = false) => {
        if (!skipValidation && question2.validate && question2.validate(answer2) !== true) {
          return;
        }
        return question2.format ? await question2.format(answer2, answers) : answer2;
      }, "getFormattedAnswer");
      for (question of questions) {
        ({ name: name2, type } = question);
        if (typeof type === "function") {
          type = await type(answer, { ...answers }, question);
          question["type"] = type;
        }
        if (!type) continue;
        for (let key in question) {
          if (passOn.includes(key)) continue;
          let value = question[key];
          question[key] = typeof value === "function" ? await value(answer, { ...answers }, lastPrompt) : value;
        }
        lastPrompt = question;
        if (typeof question.message !== "string") {
          throw new Error("prompt message is required");
        }
        ({ name: name2, type } = question);
        if (prompts2[type] === void 0) {
          throw new Error(`prompt type (${type}) is not defined`);
        }
        if (override2[question.name] !== void 0) {
          answer = await getFormattedAnswer(question, override2[question.name]);
          if (answer !== void 0) {
            answers[name2] = answer;
            continue;
          }
        }
        try {
          answer = prompt2._injected ? getInjectedAnswer(prompt2._injected, question.initial) : await prompts2[type](question);
          answers[name2] = answer = await getFormattedAnswer(question, answer, true);
          quit = await onSubmit(question, answer, answers);
        } catch (err) {
          quit = !await onCancel(question, answers);
        }
        if (quit) return answers;
      }
      return answers;
    }
    __name(prompt2, "prompt");
    function getInjectedAnswer(injected, deafultValue) {
      const answer = injected.shift();
      if (answer instanceof Error) {
        throw answer;
      }
      return answer === void 0 ? deafultValue : answer;
    }
    __name(getInjectedAnswer, "getInjectedAnswer");
    function inject(answers) {
      prompt2._injected = (prompt2._injected || []).concat(answers);
    }
    __name(inject, "inject");
    function override(answers) {
      prompt2._override = Object.assign({}, answers);
    }
    __name(override, "override");
    module2.exports = Object.assign(prompt2, { prompt: prompt2, prompts: prompts2, inject, override });
  }
});

// ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/index.js
var require_prompts3 = __commonJS({
  "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/index.js"(exports, module2) {
    init_import_meta_url();
    function isNodeLT(tar) {
      tar = (Array.isArray(tar) ? tar : tar.split(".")).map(Number);
      let i7 = 0, src = process.versions.node.split(".").map(Number);
      for (; i7 < tar.length; i7++) {
        if (src[i7] > tar[i7]) return false;
        if (tar[i7] > src[i7]) return true;
      }
      return false;
    }
    __name(isNodeLT, "isNodeLT");
    module2.exports = isNodeLT("8.6.0") ? require_dist() : require_lib();
  }
});

// src/dialogs.ts
async function confirm(text, { defaultValue = true, fallbackValue = true } = {}) {
  if (isNonInteractiveOrCI()) {
    logger.log(`? ${text}`);
    logger.log(
      `\u{1F916} ${source_default.dim(
        "Using fallback value in non-interactive context:"
      )} ${source_default.white.bold(fallbackValue ? "yes" : "no")}`
    );
    return fallbackValue;
  }
  const { value } = await (0, import_prompts.default)({
    type: "confirm",
    name: "value",
    message: text,
    initial: defaultValue,
    onState: /* @__PURE__ */ __name((state2) => {
      if (state2.aborted) {
        process.nextTick(() => {
          process.exit(1);
        });
      }
    }, "onState")
  });
  return value;
}
async function prompt(text, options = {}) {
  if (isNonInteractiveOrCI()) {
    if (options?.defaultValue === void 0) {
      throw new NoDefaultValueProvided();
    }
    logger.log(`? ${text}`);
    logger.log(
      `\u{1F916} ${source_default.dim(
        "Using default value in non-interactive context:"
      )} ${source_default.white.bold(options.defaultValue)}`
    );
    return options.defaultValue;
  }
  const { value } = await (0, import_prompts.default)({
    type: "text",
    name: "value",
    message: text,
    initial: options?.defaultValue,
    style: options?.isSecret ? "password" : "default",
    validate: options.validate,
    onState: /* @__PURE__ */ __name((state2) => {
      if (state2.aborted) {
        process.nextTick(() => {
          process.exit(1);
        });
      }
    }, "onState")
  });
  return value;
}
async function select(text, options) {
  if (isNonInteractiveOrCI()) {
    if (options.fallbackOption === void 0) {
      throw new NoDefaultValueProvided();
    }
    logger.log(`? ${text}`);
    logger.log(
      `\u{1F916} ${source_default.dim(
        "Using fallback value in non-interactive context:"
      )} ${source_default.white.bold(options.choices[options.fallbackOption].title)}`
    );
    return options.choices[options.fallbackOption].value;
  }
  const { value } = await (0, import_prompts.default)({
    type: "select",
    name: "value",
    message: text,
    choices: options.choices,
    initial: options.defaultOption,
    onState: /* @__PURE__ */ __name((state2) => {
      if (state2.aborted) {
        process.nextTick(() => {
          process.exit(1);
        });
      }
    }, "onState")
  });
  return value;
}
async function multiselect(text, options) {
  if (isNonInteractiveOrCI()) {
    if (options?.defaultOptions === void 0) {
      throw new NoDefaultValueProvided();
    }
    const defaultTitles = options.defaultOptions.map(
      (index) => options.choices[index].title
    );
    logger.log(`? ${text}`);
    logger.log(
      `\u{1F916} ${source_default.dim(
        "Using default value(s) in non-interactive context:"
      )} ${source_default.white.bold(defaultTitles.join(", "))}`
    );
    return options.defaultOptions.map((index) => options.choices[index].value);
  }
  const { value } = await (0, import_prompts.default)({
    type: "multiselect",
    name: "value",
    message: text,
    choices: options.choices,
    instructions: false,
    hint: "- Space to select. Return to submit",
    onState: /* @__PURE__ */ __name((state2) => {
      if (state2.aborted) {
        process.nextTick(() => {
          process.exit(1);
        });
      }
    }, "onState")
  });
  return value;
}
var import_prompts, NoDefaultValueProvided;
var init_dialogs = __esm({
  "src/dialogs.ts"() {
    init_import_meta_url();
    init_dist();
    init_source();
    import_prompts = __toESM(require_prompts3());
    init_is_interactive();
    init_logger();
    NoDefaultValueProvided = class extends UserError {
      static {
        __name(this, "NoDefaultValueProvided");
      }
      constructor() {
        super("This command cannot be run in a non-interactive context", {
          telemetryMessage: true
        });
        Object.setPrototypeOf(this, new.target.prototype);
      }
    };
    __name(confirm, "confirm");
    __name(prompt, "prompt");
    __name(select, "select");
    __name(multiselect, "multiselect");
  }
});
function hasDockerEnv() {
  try {
    fs29__namespace.default.statSync("/.dockerenv");
    return true;
  } catch {
    return false;
  }
}
function hasDockerCGroup() {
  try {
    return fs29__namespace.default.readFileSync("/proc/self/cgroup", "utf8").includes("docker");
  } catch {
    return false;
  }
}
function isDocker() {
  if (isDockerCached === void 0) {
    isDockerCached = hasDockerEnv() || hasDockerCGroup();
  }
  return isDockerCached;
}
var isDockerCached;
var init_is_docker = __esm({
  "../../node_modules/.pnpm/is-docker@3.0.0/node_modules/is-docker/index.js"() {
    init_import_meta_url();
    __name(hasDockerEnv, "hasDockerEnv");
    __name(hasDockerCGroup, "hasDockerCGroup");
    __name(isDocker, "isDocker");
  }
});
function isInsideContainer() {
  if (cachedResult === void 0) {
    cachedResult = hasContainerEnv() || isDocker();
  }
  return cachedResult;
}
var cachedResult, hasContainerEnv;
var init_is_inside_container = __esm({
  "../../node_modules/.pnpm/is-inside-container@1.0.0/node_modules/is-inside-container/index.js"() {
    init_import_meta_url();
    init_is_docker();
    hasContainerEnv = /* @__PURE__ */ __name(() => {
      try {
        fs29__namespace.default.statSync("/run/.containerenv");
        return true;
      } catch {
        return false;
      }
    }, "hasContainerEnv");
    __name(isInsideContainer, "isInsideContainer");
  }
});
var isWsl, is_wsl_default;
var init_is_wsl = __esm({
  "../../node_modules/.pnpm/is-wsl@3.1.0/node_modules/is-wsl/index.js"() {
    init_import_meta_url();
    init_is_inside_container();
    isWsl = /* @__PURE__ */ __name(() => {
      if (process7__default.default.platform !== "linux") {
        return false;
      }
      if (os11__namespace.default.release().toLowerCase().includes("microsoft")) {
        if (isInsideContainer()) {
          return false;
        }
        return true;
      }
      try {
        return fs29__namespace.default.readFileSync("/proc/version", "utf8").toLowerCase().includes("microsoft") ? !isInsideContainer() : false;
      } catch {
        return false;
      }
    }, "isWsl");
    is_wsl_default = process7__default.default.env.__IS_WSL_TEST__ ? isWsl : isWsl();
  }
});
var execFile, powerShellPath, executePowerShell;
var init_powershell_utils = __esm({
  "../../node_modules/.pnpm/powershell-utils@0.1.0/node_modules/powershell-utils/index.js"() {
    init_import_meta_url();
    execFile = util4.promisify(childProcess__default.default.execFile);
    powerShellPath = /* @__PURE__ */ __name(() => `${process7__default.default.env.SYSTEMROOT || process7__default.default.env.windir || String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`, "powerShellPath");
    executePowerShell = /* @__PURE__ */ __name(async (command2, options = {}) => {
      const {
        powerShellPath: psPath,
        ...execFileOptions
      } = options;
      const encodedCommand = executePowerShell.encodeCommand(command2);
      return execFile(
        psPath ?? powerShellPath(),
        [
          ...executePowerShell.argumentsPrefix,
          encodedCommand
        ],
        {
          encoding: "utf8",
          ...execFileOptions
        }
      );
    }, "executePowerShell");
    executePowerShell.argumentsPrefix = [
      "-NoProfile",
      "-NonInteractive",
      "-ExecutionPolicy",
      "Bypass",
      "-EncodedCommand"
    ];
    executePowerShell.encodeCommand = (command2) => buffer.Buffer.from(command2, "utf16le").toString("base64");
    executePowerShell.escapeArgument = (value) => `'${String(value).replaceAll("'", "''")}'`;
  }
});

// ../../node_modules/.pnpm/wsl-utils@0.3.1/node_modules/wsl-utils/utilities.js
function parseMountPointFromConfig(content) {
  for (const line of content.split("\n")) {
    if (/^\s*#/.test(line)) {
      continue;
    }
    const match3 = /^\s*root\s*=\s*(?<mountPoint>"[^"]*"|'[^']*'|[^#]*)/.exec(line);
    if (!match3) {
      continue;
    }
    return match3.groups.mountPoint.trim().replaceAll(/^["']|["']$/g, "");
  }
}
var init_utilities2 = __esm({
  "../../node_modules/.pnpm/wsl-utils@0.3.1/node_modules/wsl-utils/utilities.js"() {
    init_import_meta_url();
    __name(parseMountPointFromConfig, "parseMountPointFromConfig");
  }
});
var execFile2, wslDrivesMountPoint, powerShellPathFromWsl, powerShellPath2, canAccessPowerShellPromise, canAccessPowerShell, wslDefaultBrowser, convertWslPathToWindows;
var init_wsl_utils = __esm({
  "../../node_modules/.pnpm/wsl-utils@0.3.1/node_modules/wsl-utils/index.js"() {
    init_import_meta_url();
    init_is_wsl();
    init_powershell_utils();
    init_utilities2();
    init_is_wsl();
    execFile2 = util4.promisify(childProcess__default.default.execFile);
    wslDrivesMountPoint = /* @__PURE__ */ (() => {
      const defaultMountPoint = "/mnt/";
      let mountPoint;
      return async function() {
        if (mountPoint) {
          return mountPoint;
        }
        const configFilePath = "/etc/wsl.conf";
        let isConfigFileExists = false;
        try {
          await fs9__default.default.access(configFilePath, fs9.constants.F_OK);
          isConfigFileExists = true;
        } catch {
        }
        if (!isConfigFileExists) {
          return defaultMountPoint;
        }
        const configContent = await fs9__default.default.readFile(configFilePath, { encoding: "utf8" });
        const parsedMountPoint = parseMountPointFromConfig(configContent);
        if (parsedMountPoint === void 0) {
          return defaultMountPoint;
        }
        mountPoint = parsedMountPoint;
        mountPoint = mountPoint.endsWith("/") ? mountPoint : `${mountPoint}/`;
        return mountPoint;
      };
    })();
    powerShellPathFromWsl = /* @__PURE__ */ __name(async () => {
      const mountPoint = await wslDrivesMountPoint();
      return `${mountPoint}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`;
    }, "powerShellPathFromWsl");
    powerShellPath2 = is_wsl_default ? powerShellPathFromWsl : powerShellPath;
    canAccessPowerShell = /* @__PURE__ */ __name(async () => {
      canAccessPowerShellPromise ??= (async () => {
        try {
          const psPath = await powerShellPath2();
          await fs9__default.default.access(psPath, fs9.constants.X_OK);
          return true;
        } catch {
          return false;
        }
      })();
      return canAccessPowerShellPromise;
    }, "canAccessPowerShell");
    wslDefaultBrowser = /* @__PURE__ */ __name(async () => {
      const psPath = await powerShellPath2();
      const command2 = String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`;
      const { stdout: stdout2 } = await executePowerShell(command2, { powerShellPath: psPath });
      return stdout2.trim();
    }, "wslDefaultBrowser");
    convertWslPathToWindows = /* @__PURE__ */ __name(async (path84) => {
      if (/^[a-z]+:\/\//i.test(path84)) {
        return path84;
      }
      try {
        const { stdout: stdout2 } = await execFile2("wslpath", ["-aw", path84], { encoding: "utf8" });
        return stdout2.trim();
      } catch {
        return path84;
      }
    }, "convertWslPathToWindows");
  }
});

// ../../node_modules/.pnpm/define-lazy-prop@3.0.0/node_modules/define-lazy-prop/index.js
function defineLazyProperty(object, propertyName, valueGetter) {
  const define2 = /* @__PURE__ */ __name((value) => Object.defineProperty(object, propertyName, { value, enumerable: true, writable: true }), "define");
  Object.defineProperty(object, propertyName, {
    configurable: true,
    enumerable: true,
    get() {
      const result = valueGetter();
      define2(result);
      return result;
    },
    set(value) {
      define2(value);
    }
  });
  return object;
}
var init_define_lazy_prop = __esm({
  "../../node_modules/.pnpm/define-lazy-prop@3.0.0/node_modules/define-lazy-prop/index.js"() {
    init_import_meta_url();
    __name(defineLazyProperty, "defineLazyProperty");
  }
});
async function defaultBrowserId() {
  if (process7__default.default.platform !== "darwin") {
    throw new Error("macOS only");
  }
  const { stdout: stdout2 } = await execFileAsync("defaults", ["read", "com.apple.LaunchServices/com.apple.launchservices.secure", "LSHandlers"]);
  const match3 = /LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(stdout2);
  const browserId = match3?.groups.id ?? "com.apple.Safari";
  if (browserId === "com.apple.safari") {
    return "com.apple.Safari";
  }
  return browserId;
}
var execFileAsync;
var init_default_browser_id = __esm({
  "../../node_modules/.pnpm/default-browser-id@5.0.1/node_modules/default-browser-id/index.js"() {
    init_import_meta_url();
    execFileAsync = util4.promisify(childProcess.execFile);
    __name(defaultBrowserId, "defaultBrowserId");
  }
});
async function runAppleScript(script, { humanReadableOutput = true, signal } = {}) {
  if (process7__default.default.platform !== "darwin") {
    throw new Error("macOS only");
  }
  const outputArguments = humanReadableOutput ? [] : ["-ss"];
  const execOptions = {};
  if (signal) {
    execOptions.signal = signal;
  }
  const { stdout: stdout2 } = await execFileAsync2("osascript", ["-e", script, outputArguments], execOptions);
  return stdout2.trim();
}
var execFileAsync2;
var init_run_applescript = __esm({
  "../../node_modules/.pnpm/run-applescript@7.1.0/node_modules/run-applescript/index.js"() {
    init_import_meta_url();
    execFileAsync2 = util4.promisify(childProcess.execFile);
    __name(runAppleScript, "runAppleScript");
  }
});

// ../../node_modules/.pnpm/bundle-name@4.1.0/node_modules/bundle-name/index.js
async function bundleName(bundleId) {
  return runAppleScript(`tell application "Finder" to set app_path to application file id "${bundleId}" as string
tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`);
}
var init_bundle_name = __esm({
  "../../node_modules/.pnpm/bundle-name@4.1.0/node_modules/bundle-name/index.js"() {
    init_import_meta_url();
    init_run_applescript();
    __name(bundleName, "bundleName");
  }
});
async function defaultBrowser(_execFileAsync = execFileAsync3) {
  const { stdout: stdout2 } = await _execFileAsync("reg", [
    "QUERY",
    " HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice",
    "/v",
    "ProgId"
  ]);
  const match3 = /ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(stdout2);
  if (!match3) {
    throw new UnknownBrowserError(`Cannot find Windows browser in stdout: ${JSON.stringify(stdout2)}`);
  }
  const { id } = match3.groups;
  const browser = windowsBrowserProgIds[id];
  if (!browser) {
    throw new UnknownBrowserError(`Unknown browser ID: ${id}`);
  }
  return browser;
}
var execFileAsync3, windowsBrowserProgIds, _windowsBrowserProgIdMap, UnknownBrowserError;
var init_windows = __esm({
  "../../node_modules/.pnpm/default-browser@5.4.0/node_modules/default-browser/windows.js"() {
    init_import_meta_url();
    execFileAsync3 = util4.promisify(childProcess.execFile);
    windowsBrowserProgIds = {
      MSEdgeHTM: { name: "Edge", id: "com.microsoft.edge" },
      // The missing `L` is correct.
      MSEdgeBHTML: { name: "Edge Beta", id: "com.microsoft.edge.beta" },
      MSEdgeDHTML: { name: "Edge Dev", id: "com.microsoft.edge.dev" },
      AppXq0fevzme2pys62n3e0fbqa7peapykr8v: { name: "Edge", id: "com.microsoft.edge.old" },
      ChromeHTML: { name: "Chrome", id: "com.google.chrome" },
      ChromeBHTML: { name: "Chrome Beta", id: "com.google.chrome.beta" },
      ChromeDHTML: { name: "Chrome Dev", id: "com.google.chrome.dev" },
      ChromiumHTM: { name: "Chromium", id: "org.chromium.Chromium" },
      BraveHTML: { name: "Brave", id: "com.brave.Browser" },
      BraveBHTML: { name: "Brave Beta", id: "com.brave.Browser.beta" },
      BraveDHTML: { name: "Brave Dev", id: "com.brave.Browser.dev" },
      BraveSSHTM: { name: "Brave Nightly", id: "com.brave.Browser.nightly" },
      FirefoxURL: { name: "Firefox", id: "org.mozilla.firefox" },
      OperaStable: { name: "Opera", id: "com.operasoftware.Opera" },
      VivaldiHTM: { name: "Vivaldi", id: "com.vivaldi.Vivaldi" },
      "IE.HTTP": { name: "Internet Explorer", id: "com.microsoft.ie" }
    };
    _windowsBrowserProgIdMap = new Map(Object.entries(windowsBrowserProgIds));
    UnknownBrowserError = class extends Error {
      static {
        __name(this, "UnknownBrowserError");
      }
    };
    __name(defaultBrowser, "defaultBrowser");
  }
});
async function defaultBrowser2() {
  if (process7__default.default.platform === "darwin") {
    const id = await defaultBrowserId();
    const name2 = await bundleName(id);
    return { name: name2, id };
  }
  if (process7__default.default.platform === "linux") {
    const { stdout: stdout2 } = await execFileAsync4("xdg-mime", ["query", "default", "x-scheme-handler/http"]);
    const id = stdout2.trim();
    const name2 = titleize(id.replace(/.desktop$/, "").replace("-", " "));
    return { name: name2, id };
  }
  if (process7__default.default.platform === "win32") {
    return defaultBrowser();
  }
  throw new Error("Only macOS, Linux, and Windows are supported");
}
var execFileAsync4, titleize;
var init_default_browser = __esm({
  "../../node_modules/.pnpm/default-browser@5.4.0/node_modules/default-browser/index.js"() {
    init_import_meta_url();
    init_default_browser_id();
    init_bundle_name();
    init_windows();
    init_windows();
    execFileAsync4 = util4.promisify(childProcess.execFile);
    titleize = /* @__PURE__ */ __name((string) => string.toLowerCase().replaceAll(/(?:^|\s|-)\S/g, (x7) => x7.toUpperCase()), "titleize");
    __name(defaultBrowser2, "defaultBrowser");
  }
});
var isInSsh, is_in_ssh_default;
var init_is_in_ssh = __esm({
  "../../node_modules/.pnpm/is-in-ssh@1.0.0/node_modules/is-in-ssh/index.js"() {
    init_import_meta_url();
    isInSsh = Boolean(process7__default.default.env.SSH_CONNECTION || process7__default.default.env.SSH_CLIENT || process7__default.default.env.SSH_TTY);
    is_in_ssh_default = isInSsh;
  }
});
function detectArchBinary(binary) {
  if (typeof binary === "string" || Array.isArray(binary)) {
    return binary;
  }
  const { [arch]: archBinary } = binary;
  if (!archBinary) {
    throw new Error(`${arch} is not supported`);
  }
  return archBinary;
}
function detectPlatformBinary({ [platform]: platformBinary }, { wsl } = {}) {
  if (wsl && is_wsl_default) {
    return detectArchBinary(wsl);
  }
  if (!platformBinary) {
    throw new Error(`${platform} is not supported`);
  }
  return detectArchBinary(platformBinary);
}
var fallbackAttemptSymbol, __dirname3, localXdgOpenPath, platform, arch, tryEachApp, baseOpen, open, apps, open_default;
var init_open = __esm({
  "../../node_modules/.pnpm/open@11.0.0/node_modules/open/index.js"() {
    init_import_meta_url();
    init_wsl_utils();
    init_powershell_utils();
    init_define_lazy_prop();
    init_default_browser();
    init_is_inside_container();
    init_is_in_ssh();
    fallbackAttemptSymbol = Symbol("fallbackAttempt");
    __dirname3 = import_meta_url ? path3__namespace.default.dirname(Url.fileURLToPath(import_meta_url)) : "";
    localXdgOpenPath = path3__namespace.default.join(__dirname3, "xdg-open");
    ({ platform, arch } = process7__default.default);
    tryEachApp = /* @__PURE__ */ __name(async (apps2, opener) => {
      if (apps2.length === 0) {
        return;
      }
      const errors = [];
      for (const app of apps2) {
        try {
          return await opener(app);
        } catch (error2) {
          errors.push(error2);
        }
      }
      throw new AggregateError(errors, "Failed to open in all supported apps");
    }, "tryEachApp");
    baseOpen = /* @__PURE__ */ __name(async (options) => {
      options = {
        wait: false,
        background: false,
        newInstance: false,
        allowNonzeroExitCode: false,
        ...options
      };
      const isFallbackAttempt = options[fallbackAttemptSymbol] === true;
      delete options[fallbackAttemptSymbol];
      if (Array.isArray(options.app)) {
        return tryEachApp(options.app, (singleApp) => baseOpen({
          ...options,
          app: singleApp,
          [fallbackAttemptSymbol]: true
        }));
      }
      let { name: app, arguments: appArguments = [] } = options.app ?? {};
      appArguments = [...appArguments];
      if (Array.isArray(app)) {
        return tryEachApp(app, (appName) => baseOpen({
          ...options,
          app: {
            name: appName,
            arguments: appArguments
          },
          [fallbackAttemptSymbol]: true
        }));
      }
      if (app === "browser" || app === "browserPrivate") {
        const ids = {
          "com.google.chrome": "chrome",
          "google-chrome.desktop": "chrome",
          "com.brave.browser": "brave",
          "org.mozilla.firefox": "firefox",
          "firefox.desktop": "firefox",
          "com.microsoft.msedge": "edge",
          "com.microsoft.edge": "edge",
          "com.microsoft.edgemac": "edge",
          "microsoft-edge.desktop": "edge",
          "com.apple.safari": "safari"
        };
        const flags2 = {
          chrome: "--incognito",
          brave: "--incognito",
          firefox: "--private-window",
          edge: "--inPrivate"
          // Safari doesn't support private mode via command line
        };
        let browser;
        if (is_wsl_default) {
          const progId = await wslDefaultBrowser();
          const browserInfo = _windowsBrowserProgIdMap.get(progId);
          browser = browserInfo ?? {};
        } else {
          browser = await defaultBrowser2();
        }
        if (browser.id in ids) {
          const browserName = ids[browser.id.toLowerCase()];
          if (app === "browserPrivate") {
            if (browserName === "safari") {
              throw new Error("Safari doesn't support opening in private mode via command line");
            }
            appArguments.push(flags2[browserName]);
          }
          return baseOpen({
            ...options,
            app: {
              name: apps[browserName],
              arguments: appArguments
            }
          });
        }
        throw new Error(`${browser.name} is not supported as a default browser`);
      }
      let command2;
      const cliArguments = [];
      const childProcessOptions = {};
      let shouldUseWindowsInWsl = false;
      if (is_wsl_default && !isInsideContainer() && !is_in_ssh_default && !app) {
        shouldUseWindowsInWsl = await canAccessPowerShell();
      }
      if (platform === "darwin") {
        command2 = "open";
        if (options.wait) {
          cliArguments.push("--wait-apps");
        }
        if (options.background) {
          cliArguments.push("--background");
        }
        if (options.newInstance) {
          cliArguments.push("--new");
        }
        if (app) {
          cliArguments.push("-a", app);
        }
      } else if (platform === "win32" || shouldUseWindowsInWsl) {
        command2 = await powerShellPath2();
        cliArguments.push(...executePowerShell.argumentsPrefix);
        if (!is_wsl_default) {
          childProcessOptions.windowsVerbatimArguments = true;
        }
        if (is_wsl_default && options.target) {
          options.target = await convertWslPathToWindows(options.target);
        }
        const encodedArguments = ["$ProgressPreference = 'SilentlyContinue';", "Start"];
        if (options.wait) {
          encodedArguments.push("-Wait");
        }
        if (app) {
          encodedArguments.push(executePowerShell.escapeArgument(app));
          if (options.target) {
            appArguments.push(options.target);
          }
        } else if (options.target) {
          encodedArguments.push(executePowerShell.escapeArgument(options.target));
        }
        if (appArguments.length > 0) {
          appArguments = appArguments.map((argument) => executePowerShell.escapeArgument(argument));
          encodedArguments.push("-ArgumentList", appArguments.join(","));
        }
        options.target = executePowerShell.encodeCommand(encodedArguments.join(" "));
        if (!options.wait) {
          childProcessOptions.stdio = "ignore";
        }
      } else {
        if (app) {
          command2 = app;
        } else {
          const isBundled = !__dirname3 || __dirname3 === "/";
          let exeLocalXdgOpen = false;
          try {
            await fs9__default.default.access(localXdgOpenPath, fs9.constants.X_OK);
            exeLocalXdgOpen = true;
          } catch {
          }
          const useSystemXdgOpen = process7__default.default.versions.electron ?? (platform === "android" || isBundled || !exeLocalXdgOpen);
          command2 = useSystemXdgOpen ? "xdg-open" : localXdgOpenPath;
        }
        if (appArguments.length > 0) {
          cliArguments.push(...appArguments);
        }
        if (!options.wait) {
          childProcessOptions.stdio = "ignore";
          childProcessOptions.detached = true;
        }
      }
      if (platform === "darwin" && appArguments.length > 0) {
        cliArguments.push("--args", ...appArguments);
      }
      if (options.target) {
        cliArguments.push(options.target);
      }
      const subprocess = childProcess__default.default.spawn(command2, cliArguments, childProcessOptions);
      if (options.wait) {
        return new Promise((resolve32, reject) => {
          subprocess.once("error", reject);
          subprocess.once("close", (exitCode) => {
            if (!options.allowNonzeroExitCode && exitCode !== 0) {
              reject(new Error(`Exited with code ${exitCode}`));
              return;
            }
            resolve32(subprocess);
          });
        });
      }
      if (isFallbackAttempt) {
        return new Promise((resolve32, reject) => {
          subprocess.once("error", reject);
          subprocess.once("spawn", () => {
            subprocess.once("close", (exitCode) => {
              subprocess.off("error", reject);
              if (exitCode !== 0) {
                reject(new Error(`Exited with code ${exitCode}`));
                return;
              }
              subprocess.unref();
              resolve32(subprocess);
            });
          });
        });
      }
      subprocess.unref();
      return new Promise((resolve32, reject) => {
        subprocess.once("error", reject);
        subprocess.once("spawn", () => {
          subprocess.off("error", reject);
          resolve32(subprocess);
        });
      });
    }, "baseOpen");
    open = /* @__PURE__ */ __name((target, options) => {
      if (typeof target !== "string") {
        throw new TypeError("Expected a `target`");
      }
      return baseOpen({
        ...options,
        target
      });
    }, "open");
    __name(detectArchBinary, "detectArchBinary");
    __name(detectPlatformBinary, "detectPlatformBinary");
    apps = {
      browser: "browser",
      browserPrivate: "browserPrivate"
    };
    defineLazyProperty(apps, "chrome", () => detectPlatformBinary({
      darwin: "google chrome",
      win32: "chrome",
      // `chromium-browser` is the older deb package name used by Ubuntu/Debian before snap.
      linux: ["google-chrome", "google-chrome-stable", "chromium", "chromium-browser"]
    }, {
      wsl: {
        ia32: "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",
        x64: ["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe", "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]
      }
    }));
    defineLazyProperty(apps, "brave", () => detectPlatformBinary({
      darwin: "brave browser",
      win32: "brave",
      linux: ["brave-browser", "brave"]
    }, {
      wsl: {
        ia32: "/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe",
        x64: ["/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe", "/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe"]
      }
    }));
    defineLazyProperty(apps, "firefox", () => detectPlatformBinary({
      darwin: "firefox",
      win32: String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,
      linux: "firefox"
    }, {
      wsl: "/mnt/c/Program Files/Mozilla Firefox/firefox.exe"
    }));
    defineLazyProperty(apps, "edge", () => detectPlatformBinary({
      darwin: "microsoft edge",
      win32: "msedge",
      linux: ["microsoft-edge", "microsoft-edge-dev"]
    }, {
      wsl: "/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"
    }));
    defineLazyProperty(apps, "safari", () => detectPlatformBinary({
      darwin: "Safari"
    }));
    open_default = open;
  }
});

// src/open-in-browser.ts
async function openInBrowser(url4) {
  const childProcess5 = await open_default(url4);
  childProcess5.on("error", () => {
    logger.warn("Failed to open");
  });
}
var init_open_in_browser = __esm({
  "src/open-in-browser.ts"() {
    init_import_meta_url();
    init_open();
    init_logger();
    __name(openInBrowser, "openInBrowser");
  }
});

// src/user/auth-variables.ts
var getCloudflareAccountIdFromEnv, getCloudflareAPITokenFromEnv, getCloudflareGlobalAuthKeyFromEnv, getCloudflareGlobalAuthEmailFromEnv, getClientIdFromEnv, getAuthDomainFromEnv, getAuthUrlFromEnv, getTokenUrlFromEnv, getRevokeUrlFromEnv, getWranglerR2SqlAuthToken, getAccessClientIdFromEnv, getAccessClientSecretFromEnv, getCloudflareAccessHeaders;
var init_auth_variables = __esm({
  "src/user/auth-variables.ts"() {
    init_import_meta_url();
    init_dist();
    init_logger();
    init_access();
    getCloudflareAccountIdFromEnv = getEnvironmentVariableFactory({
      variableName: "CLOUDFLARE_ACCOUNT_ID",
      deprecatedName: "CF_ACCOUNT_ID"
    });
    getCloudflareAPITokenFromEnv = getEnvironmentVariableFactory({
      variableName: "CLOUDFLARE_API_TOKEN",
      deprecatedName: "CF_API_TOKEN"
    });
    getCloudflareGlobalAuthKeyFromEnv = getEnvironmentVariableFactory({
      variableName: "CLOUDFLARE_API_KEY",
      deprecatedName: "CF_API_KEY"
    });
    getCloudflareGlobalAuthEmailFromEnv = getEnvironmentVariableFactory({
      variableName: "CLOUDFLARE_EMAIL",
      deprecatedName: "CF_EMAIL"
    });
    getClientIdFromEnv = getEnvironmentVariableFactory({
      variableName: "WRANGLER_CLIENT_ID",
      defaultValue: /* @__PURE__ */ __name(() => getCloudflareApiEnvironmentFromEnv() === "staging" ? "4b2ea6cc-9421-4761-874b-ce550e0e3def" : "54d11594-84e4-41aa-b438-e81b8fa78ee7", "defaultValue")
    });
    getAuthDomainFromEnv = getEnvironmentVariableFactory({
      variableName: "WRANGLER_AUTH_DOMAIN",
      defaultValue: /* @__PURE__ */ __name(() => getCloudflareApiEnvironmentFromEnv() === "staging" ? "dash.staging.cloudflare.com" : "dash.cloudflare.com", "defaultValue")
    });
    getAuthUrlFromEnv = getEnvironmentVariableFactory({
      variableName: "WRANGLER_AUTH_URL",
      defaultValue: /* @__PURE__ */ __name(() => `https://${getAuthDomainFromEnv()}/oauth2/auth`, "defaultValue")
    });
    getTokenUrlFromEnv = getEnvironmentVariableFactory({
      variableName: "WRANGLER_TOKEN_URL",
      defaultValue: /* @__PURE__ */ __name(() => `https://${getAuthDomainFromEnv()}/oauth2/token`, "defaultValue")
    });
    getRevokeUrlFromEnv = getEnvironmentVariableFactory({
      variableName: "WRANGLER_REVOKE_URL",
      defaultValue: /* @__PURE__ */ __name(() => `https://${getAuthDomainFromEnv()}/oauth2/revoke`, "defaultValue")
    });
    getWranglerR2SqlAuthToken = getEnvironmentVariableFactory({
      variableName: "WRANGLER_R2_SQL_AUTH_TOKEN"
    });
    getAccessClientIdFromEnv = getEnvironmentVariableFactory({
      variableName: "CLOUDFLARE_ACCESS_CLIENT_ID"
    });
    getAccessClientSecretFromEnv = getEnvironmentVariableFactory({
      variableName: "CLOUDFLARE_ACCESS_CLIENT_SECRET"
    });
    getCloudflareAccessHeaders = /* @__PURE__ */ __name(async () => {
      const env6 = getEnvironmentVariableFactory({
        variableName: "WRANGLER_CF_AUTHORIZATION_TOKEN"
      })();
      if (env6 !== void 0) {
        logger.debug("Using WRANGLER_CF_AUTHORIZATION_TOKEN from environment", env6);
        return { Cookie: `CF_Authorization=${env6}` };
      }
      return getAccessHeaders(getAuthDomainFromEnv());
    }, "getCloudflareAccessHeaders");
  }
});
async function domainUsesAccess(domain2) {
  logger.debug("Checking if domain has Access enabled:", domain2);
  if (usesAccessCache.has(domain2)) {
    logger.debug(
      "Using cached Access switch for:",
      domain2,
      usesAccessCache.get(domain2)
    );
    return usesAccessCache.get(domain2);
  }
  logger.debug("Access switch not cached for:", domain2);
  try {
    const controller = new AbortController();
    const cancel3 = setTimeout(() => {
      controller.abort();
    }, 1e3);
    const output = await (0, import_undici2.fetch)(`https://${domain2}`, {
      redirect: "manual",
      signal: controller.signal
    });
    clearTimeout(cancel3);
    const usesAccess = !!(output.status === 302 && output.headers.get("location")?.includes("cloudflareaccess.com"));
    logger.debug("Caching access switch for:", domain2);
    usesAccessCache.set(domain2, usesAccess);
    return usesAccess;
  } catch {
    usesAccessCache.set(domain2, false);
    return false;
  }
}
async function getAccessHeaders(domain2) {
  if (!await domainUsesAccess(domain2)) {
    return {};
  }
  logger.debug("Getting Access headers for domain:", domain2);
  if (headersCache[domain2]) {
    logger.debug("Using cached Access headers for domain:", domain2);
    return headersCache[domain2];
  }
  const clientId = getAccessClientIdFromEnv();
  const clientSecret = getAccessClientSecretFromEnv();
  if (clientId && clientSecret) {
    logger.debug("Using Access Service Token headers for domain:", domain2);
    const headers = {
      "CF-Access-Client-Id": clientId,
      "CF-Access-Client-Secret": clientSecret
    };
    headersCache[domain2] = headers;
    return headers;
  }
  if (clientId !== void 0 || clientSecret !== void 0) {
    logger.warn(
      `Both CLOUDFLARE_ACCESS_CLIENT_ID and CLOUDFLARE_ACCESS_CLIENT_SECRET must be set to use Access Service Token authentication. Only ${clientId !== void 0 ? "CLOUDFLARE_ACCESS_CLIENT_ID" : "CLOUDFLARE_ACCESS_CLIENT_SECRET"} was found.`
    );
  }
  if (isNonInteractiveOrCI()) {
    throw new UserError(
      `The domain "${domain2}" is behind Cloudflare Access, but no Access Service Token credentials were found and the current environment is non-interactive.
Set the CLOUDFLARE_ACCESS_CLIENT_ID and CLOUDFLARE_ACCESS_CLIENT_SECRET environment variables to authenticate with an Access Service Token.
See https://developers.cloudflare.com/cloudflare-one/access-controls/service-credentials/service-tokens/`
    );
  }
  logger.debug("Spawning cloudflared to get Access token for domain:");
  const output = childProcess.spawnSync("cloudflared", ["access", "login", domain2]);
  if (output.error) {
    throw new UserError(
      "To use Wrangler with Cloudflare Access, please install `cloudflared` from https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/install-and-setup/installation"
    );
  }
  const stringOutput = output.stdout.toString();
  logger.debug("cloudflared output:", stringOutput);
  const matches = stringOutput.match(/fetched your token:\n\n(.*)/m);
  if (matches && matches.length >= 2) {
    const headers = { Cookie: `CF_Authorization=${matches[1]}` };
    headersCache[domain2] = headers;
    logger.debug("Caching Access headers for domain:", domain2);
    return headers;
  }
  throw new Error("Failed to authenticate with Cloudflare Access");
}
var import_undici2, headersCache, usesAccessCache;
var init_access = __esm({
  "src/user/access.ts"() {
    init_import_meta_url();
    init_dist();
    import_undici2 = __toESM(require_undici());
    init_is_interactive();
    init_logger();
    init_auth_variables();
    headersCache = {};
    usesAccessCache = /* @__PURE__ */ new Map();
    __name(domainUsesAccess, "domainUsesAccess");
    __name(getAccessHeaders, "getAccessHeaders");
  }
});

// src/cfetch/errors.ts
function buildDetailedError(message, ...extra) {
  return new ParseError({
    text: message,
    notes: extra.map((text) => ({ text }))
  });
}
function maybeThrowFriendlyError(error2) {
  if (error2.message === "workers.api.error.email_verification_required") {
    throw buildDetailedError(
      "Please verify your account's email address and try again.",
      "Check your email for a verification link, or login to https://dash.cloudflare.com and request a new one."
    );
  }
}
var init_errors3 = __esm({
  "src/cfetch/errors.ts"() {
    init_import_meta_url();
    init_dist();
    __name(buildDetailedError, "buildDetailedError");
    __name(maybeThrowFriendlyError, "maybeThrowFriendlyError");
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/internal/qs/formats.mjs
var default_format, formatters, RFC1738;
var init_formats = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/internal/qs/formats.mjs"() {
    init_import_meta_url();
    default_format = "RFC3986";
    formatters = {
      RFC1738: /* @__PURE__ */ __name((v8) => String(v8).replace(/%20/g, "+"), "RFC1738"),
      RFC3986: /* @__PURE__ */ __name((v8) => String(v8), "RFC3986")
    };
    RFC1738 = "RFC1738";
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/internal/qs/utils.mjs
function is_buffer(obj) {
  if (!obj || typeof obj !== "object") {
    return false;
  }
  return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
}
function maybe_map(val2, fn2) {
  if (is_array(val2)) {
    const mapped = [];
    for (let i7 = 0; i7 < val2.length; i7 += 1) {
      mapped.push(fn2(val2[i7]));
    }
    return mapped;
  }
  return fn2(val2);
}
var is_array, hex_table, limit, encode;
var init_utils3 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/internal/qs/utils.mjs"() {
    init_import_meta_url();
    init_formats();
    is_array = Array.isArray;
    hex_table = (() => {
      const array = [];
      for (let i7 = 0; i7 < 256; ++i7) {
        array.push("%" + ((i7 < 16 ? "0" : "") + i7.toString(16)).toUpperCase());
      }
      return array;
    })();
    limit = 1024;
    encode = /* @__PURE__ */ __name((str, _defaultEncoder, charset, _kind, format11) => {
      if (str.length === 0) {
        return str;
      }
      let 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";
        });
      }
      let out = "";
      for (let j7 = 0; j7 < string.length; j7 += limit) {
        const segment = string.length >= limit ? string.slice(j7, j7 + limit) : string;
        const arr = [];
        for (let i7 = 0; i7 < segment.length; ++i7) {
          let c8 = segment.charCodeAt(i7);
          if (c8 === 45 || // -
          c8 === 46 || // .
          c8 === 95 || // _
          c8 === 126 || // ~
          c8 >= 48 && c8 <= 57 || // 0-9
          c8 >= 65 && c8 <= 90 || // a-z
          c8 >= 97 && c8 <= 122 || // A-Z
          format11 === RFC1738 && (c8 === 40 || c8 === 41)) {
            arr[arr.length] = segment.charAt(i7);
            continue;
          }
          if (c8 < 128) {
            arr[arr.length] = hex_table[c8];
            continue;
          }
          if (c8 < 2048) {
            arr[arr.length] = hex_table[192 | c8 >> 6] + hex_table[128 | c8 & 63];
            continue;
          }
          if (c8 < 55296 || c8 >= 57344) {
            arr[arr.length] = hex_table[224 | c8 >> 12] + hex_table[128 | c8 >> 6 & 63] + hex_table[128 | c8 & 63];
            continue;
          }
          i7 += 1;
          c8 = 65536 + ((c8 & 1023) << 10 | segment.charCodeAt(i7) & 1023);
          arr[arr.length] = hex_table[240 | c8 >> 18] + hex_table[128 | c8 >> 12 & 63] + hex_table[128 | c8 >> 6 & 63] + hex_table[128 | c8 & 63];
        }
        out += arr.join("");
      }
      return out;
    }, "encode");
    __name(is_buffer, "is_buffer");
    __name(maybe_map, "maybe_map");
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/internal/qs/stringify.mjs
function is_non_nullish_primitive(v8) {
  return typeof v8 === "string" || typeof v8 === "number" || typeof v8 === "boolean" || typeof v8 === "symbol" || typeof v8 === "bigint";
}
function inner_stringify(object, prefix, generateArrayPrefix, commaRoundTrip, allowEmptyArrays, strictNullHandling, skipNulls, encodeDotInKeys, encoder, filter2, sort, allowDots, serializeDate, format11, formatter, encodeValuesOnly, charset, sideChannel) {
  let obj = object;
  let tmp_sc = sideChannel;
  let step = 0;
  let find_flag = false;
  while ((tmp_sc = tmp_sc.get(sentinel)) !== void 0 && !find_flag) {
    const pos = tmp_sc.get(object);
    step += 1;
    if (typeof pos !== "undefined") {
      if (pos === step) {
        throw new RangeError("Cyclic object value");
      } else {
        find_flag = true;
      }
    }
    if (typeof tmp_sc.get(sentinel) === "undefined") {
      step = 0;
    }
  }
  if (typeof filter2 === "function") {
    obj = filter2(prefix, obj);
  } else if (obj instanceof Date) {
    obj = serializeDate?.(obj);
  } else if (generateArrayPrefix === "comma" && is_array2(obj)) {
    obj = maybe_map(obj, function(value) {
      if (value instanceof Date) {
        return serializeDate?.(value);
      }
      return value;
    });
  }
  if (obj === null) {
    if (strictNullHandling) {
      return encoder && !encodeValuesOnly ? (
        // @ts-expect-error
        encoder(prefix, defaults.encoder, charset, "key", format11)
      ) : prefix;
    }
    obj = "";
  }
  if (is_non_nullish_primitive(obj) || is_buffer(obj)) {
    if (encoder) {
      const key_value = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, "key", format11);
      return [
        formatter?.(key_value) + "=" + // @ts-expect-error
        formatter?.(encoder(obj, defaults.encoder, charset, "value", format11))
      ];
    }
    return [formatter?.(prefix) + "=" + formatter?.(String(obj))];
  }
  const values = [];
  if (typeof obj === "undefined") {
    return values;
  }
  let obj_keys;
  if (generateArrayPrefix === "comma" && is_array2(obj)) {
    if (encodeValuesOnly && encoder) {
      obj = maybe_map(obj, encoder);
    }
    obj_keys = [{ value: obj.length > 0 ? obj.join(",") || null : void 0 }];
  } else if (is_array2(filter2)) {
    obj_keys = filter2;
  } else {
    const keys = Object.keys(obj);
    obj_keys = sort ? keys.sort(sort) : keys;
  }
  const encoded_prefix = encodeDotInKeys ? String(prefix).replace(/\./g, "%2E") : String(prefix);
  const adjusted_prefix = commaRoundTrip && is_array2(obj) && obj.length === 1 ? encoded_prefix + "[]" : encoded_prefix;
  if (allowEmptyArrays && is_array2(obj) && obj.length === 0) {
    return adjusted_prefix + "[]";
  }
  for (let j7 = 0; j7 < obj_keys.length; ++j7) {
    const key = obj_keys[j7];
    const value = (
      // @ts-ignore
      typeof key === "object" && typeof key.value !== "undefined" ? key.value : obj[key]
    );
    if (skipNulls && value === null) {
      continue;
    }
    const encoded_key = allowDots && encodeDotInKeys ? key.replace(/\./g, "%2E") : key;
    const key_prefix = is_array2(obj) ? typeof generateArrayPrefix === "function" ? generateArrayPrefix(adjusted_prefix, encoded_key) : adjusted_prefix : adjusted_prefix + (allowDots ? "." + encoded_key : "[" + encoded_key + "]");
    sideChannel.set(object, step);
    const valueSideChannel = /* @__PURE__ */ new WeakMap();
    valueSideChannel.set(sentinel, sideChannel);
    push_to_array(values, inner_stringify(
      value,
      key_prefix,
      generateArrayPrefix,
      commaRoundTrip,
      allowEmptyArrays,
      strictNullHandling,
      skipNulls,
      encodeDotInKeys,
      // @ts-ignore
      generateArrayPrefix === "comma" && encodeValuesOnly && is_array2(obj) ? null : encoder,
      filter2,
      sort,
      allowDots,
      serializeDate,
      format11,
      formatter,
      encodeValuesOnly,
      charset,
      valueSideChannel
    ));
  }
  return values;
}
function normalize_stringify_options(opts = 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.");
  }
  const 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");
  }
  let format11 = default_format;
  if (typeof opts.format !== "undefined") {
    if (!has.call(formatters, opts.format)) {
      throw new TypeError("Unknown format option provided.");
    }
    format11 = opts.format;
  }
  const formatter = formatters[format11];
  let filter2 = defaults.filter;
  if (typeof opts.filter === "function" || is_array2(opts.filter)) {
    filter2 = opts.filter;
  }
  let arrayFormat;
  if (opts.arrayFormat && opts.arrayFormat in array_prefix_generators) {
    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");
  }
  const allowDots = typeof opts.allowDots === "undefined" ? !!opts.encodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots;
  return {
    addQueryPrefix: typeof opts.addQueryPrefix === "boolean" ? opts.addQueryPrefix : defaults.addQueryPrefix,
    // @ts-ignore
    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: filter2,
    format: format11,
    formatter,
    serializeDate: typeof opts.serializeDate === "function" ? opts.serializeDate : defaults.serializeDate,
    skipNulls: typeof opts.skipNulls === "boolean" ? opts.skipNulls : defaults.skipNulls,
    // @ts-ignore
    sort: typeof opts.sort === "function" ? opts.sort : null,
    strictNullHandling: typeof opts.strictNullHandling === "boolean" ? opts.strictNullHandling : defaults.strictNullHandling
  };
}
function stringify3(object, opts = {}) {
  let obj = object;
  const options = normalize_stringify_options(opts);
  let obj_keys;
  let filter2;
  if (typeof options.filter === "function") {
    filter2 = options.filter;
    obj = filter2("", obj);
  } else if (is_array2(options.filter)) {
    filter2 = options.filter;
    obj_keys = filter2;
  }
  const keys = [];
  if (typeof obj !== "object" || obj === null) {
    return "";
  }
  const generateArrayPrefix = array_prefix_generators[options.arrayFormat];
  const commaRoundTrip = generateArrayPrefix === "comma" && options.commaRoundTrip;
  if (!obj_keys) {
    obj_keys = Object.keys(obj);
  }
  if (options.sort) {
    obj_keys.sort(options.sort);
  }
  const sideChannel = /* @__PURE__ */ new WeakMap();
  for (let i7 = 0; i7 < obj_keys.length; ++i7) {
    const key = obj_keys[i7];
    if (options.skipNulls && obj[key] === null) {
      continue;
    }
    push_to_array(keys, inner_stringify(
      obj[key],
      key,
      // @ts-expect-error
      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
    ));
  }
  const joined = keys.join(options.delimiter);
  let 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 : "";
}
var has, array_prefix_generators, is_array2, push, push_to_array, to_ISO, defaults, sentinel;
var init_stringify2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/internal/qs/stringify.mjs"() {
    init_import_meta_url();
    init_utils3();
    init_formats();
    has = Object.prototype.hasOwnProperty;
    array_prefix_generators = {
      brackets(prefix) {
        return String(prefix) + "[]";
      },
      comma: "comma",
      indices(prefix, key) {
        return String(prefix) + "[" + key + "]";
      },
      repeat(prefix) {
        return String(prefix);
      }
    };
    is_array2 = Array.isArray;
    push = Array.prototype.push;
    push_to_array = /* @__PURE__ */ __name(function(arr, value_or_array) {
      push.apply(arr, is_array2(value_or_array) ? value_or_array : [value_or_array]);
    }, "push_to_array");
    to_ISO = Date.prototype.toISOString;
    defaults = {
      addQueryPrefix: false,
      allowDots: false,
      allowEmptyArrays: false,
      arrayFormat: "indices",
      charset: "utf-8",
      charsetSentinel: false,
      delimiter: "&",
      encode: true,
      encodeDotInKeys: false,
      encoder: encode,
      encodeValuesOnly: false,
      format: default_format,
      formatter: formatters[default_format],
      /** @deprecated */
      indices: false,
      serializeDate(date) {
        return to_ISO.call(date);
      },
      skipNulls: false,
      strictNullHandling: false
    };
    __name(is_non_nullish_primitive, "is_non_nullish_primitive");
    sentinel = {};
    __name(inner_stringify, "inner_stringify");
    __name(normalize_stringify_options, "normalize_stringify_options");
    __name(stringify3, "stringify");
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/internal/qs/index.mjs
var init_qs = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/internal/qs/index.mjs"() {
    init_import_meta_url();
    init_stringify2();
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/version.mjs
var VERSION;
var init_version = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/version.mjs"() {
    init_import_meta_url();
    VERSION = "5.2.0";
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/error.mjs
var CloudflareError, APIError2, APIUserAbortError, APIConnectionError, APIConnectionTimeoutError, BadRequestError, AuthenticationError, PermissionDeniedError, NotFoundError, ConflictError, UnprocessableEntityError, RateLimitError, InternalServerError;
var init_error4 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/error.mjs"() {
    init_import_meta_url();
    init_core2();
    CloudflareError = class extends Error {
      static {
        __name(this, "CloudflareError");
      }
    };
    APIError2 = class _APIError extends CloudflareError {
      static {
        __name(this, "APIError");
      }
      constructor(status2, error2, message, headers) {
        super(`${_APIError.makeMessage(status2, error2, message)}`);
        this.status = status2;
        this.headers = headers;
        this.error = error2;
        const data = error2;
        this.errors = data?.["errors"] ?? [];
      }
      static makeMessage(status2, error2, message) {
        const msg = error2?.message ? typeof error2.message === "string" ? error2.message : JSON.stringify(error2.message) : error2 ? JSON.stringify(error2) : message;
        if (status2 && msg) {
          return `${status2} ${msg}`;
        }
        if (status2) {
          return `${status2} status code (no body)`;
        }
        if (msg) {
          return msg;
        }
        return "(no status code or body)";
      }
      static generate(status2, errorResponse, message, headers) {
        if (!status2 || !headers) {
          return new APIConnectionError({ message, cause: castToError(errorResponse) });
        }
        const error2 = errorResponse;
        if (status2 === 400) {
          return new BadRequestError(status2, error2, message, headers);
        }
        if (status2 === 401) {
          return new AuthenticationError(status2, error2, message, headers);
        }
        if (status2 === 403) {
          return new PermissionDeniedError(status2, error2, message, headers);
        }
        if (status2 === 404) {
          return new NotFoundError(status2, error2, message, headers);
        }
        if (status2 === 409) {
          return new ConflictError(status2, error2, message, headers);
        }
        if (status2 === 422) {
          return new UnprocessableEntityError(status2, error2, message, headers);
        }
        if (status2 === 429) {
          return new RateLimitError(status2, error2, message, headers);
        }
        if (status2 >= 500) {
          return new InternalServerError(status2, error2, message, headers);
        }
        return new _APIError(status2, error2, message, headers);
      }
    };
    APIUserAbortError = class extends APIError2 {
      static {
        __name(this, "APIUserAbortError");
      }
      constructor({ message } = {}) {
        super(void 0, void 0, message || "Request was aborted.", void 0);
      }
    };
    APIConnectionError = class extends APIError2 {
      static {
        __name(this, "APIConnectionError");
      }
      constructor({ message, cause }) {
        super(void 0, void 0, message || "Connection error.", void 0);
        if (cause)
          this.cause = cause;
      }
    };
    APIConnectionTimeoutError = class extends APIConnectionError {
      static {
        __name(this, "APIConnectionTimeoutError");
      }
      constructor({ message } = {}) {
        super({ message: message ?? "Request timed out." });
      }
    };
    BadRequestError = class extends APIError2 {
      static {
        __name(this, "BadRequestError");
      }
    };
    AuthenticationError = class extends APIError2 {
      static {
        __name(this, "AuthenticationError");
      }
    };
    PermissionDeniedError = class extends APIError2 {
      static {
        __name(this, "PermissionDeniedError");
      }
    };
    NotFoundError = class extends APIError2 {
      static {
        __name(this, "NotFoundError");
      }
    };
    ConflictError = class extends APIError2 {
      static {
        __name(this, "ConflictError");
      }
    };
    UnprocessableEntityError = class extends APIError2 {
      static {
        __name(this, "UnprocessableEntityError");
      }
    };
    RateLimitError = class extends APIError2 {
      static {
        __name(this, "RateLimitError");
      }
    };
    InternalServerError = class extends APIError2 {
      static {
        __name(this, "InternalServerError");
      }
    };
  }
});

// ../../node_modules/.pnpm/webidl-conversions@3.0.1/node_modules/webidl-conversions/lib/index.js
var require_lib2 = __commonJS({
  "../../node_modules/.pnpm/webidl-conversions@3.0.1/node_modules/webidl-conversions/lib/index.js"(exports, module2) {
    init_import_meta_url();
    var conversions = {};
    module2.exports = conversions;
    function sign(x7) {
      return x7 < 0 ? -1 : 1;
    }
    __name(sign, "sign");
    function evenRound(x7) {
      if (x7 % 1 === 0.5 && (x7 & 1) === 0) {
        return Math.floor(x7);
      } else {
        return Math.round(x7);
      }
    }
    __name(evenRound, "evenRound");
    function createNumberConversion(bitLength, typeOpts) {
      if (!typeOpts.unsigned) {
        --bitLength;
      }
      const lowerBound2 = typeOpts.unsigned ? 0 : -Math.pow(2, bitLength);
      const upperBound = Math.pow(2, bitLength) - 1;
      const moduloVal = typeOpts.moduloBitLength ? Math.pow(2, typeOpts.moduloBitLength) : Math.pow(2, bitLength);
      const moduloBound = typeOpts.moduloBitLength ? Math.pow(2, typeOpts.moduloBitLength - 1) : Math.pow(2, bitLength - 1);
      return function(V4, opts) {
        if (!opts) opts = {};
        let x7 = +V4;
        if (opts.enforceRange) {
          if (!Number.isFinite(x7)) {
            throw new TypeError("Argument is not a finite number");
          }
          x7 = sign(x7) * Math.floor(Math.abs(x7));
          if (x7 < lowerBound2 || x7 > upperBound) {
            throw new TypeError("Argument is not in byte range");
          }
          return x7;
        }
        if (!isNaN(x7) && opts.clamp) {
          x7 = evenRound(x7);
          if (x7 < lowerBound2) x7 = lowerBound2;
          if (x7 > upperBound) x7 = upperBound;
          return x7;
        }
        if (!Number.isFinite(x7) || x7 === 0) {
          return 0;
        }
        x7 = sign(x7) * Math.floor(Math.abs(x7));
        x7 = x7 % moduloVal;
        if (!typeOpts.unsigned && x7 >= moduloBound) {
          return x7 - moduloVal;
        } else if (typeOpts.unsigned) {
          if (x7 < 0) {
            x7 += moduloVal;
          } else if (x7 === -0) {
            return 0;
          }
        }
        return x7;
      };
    }
    __name(createNumberConversion, "createNumberConversion");
    conversions["void"] = function() {
      return void 0;
    };
    conversions["boolean"] = function(val2) {
      return !!val2;
    };
    conversions["byte"] = createNumberConversion(8, { unsigned: false });
    conversions["octet"] = createNumberConversion(8, { unsigned: true });
    conversions["short"] = createNumberConversion(16, { unsigned: false });
    conversions["unsigned short"] = createNumberConversion(16, { unsigned: true });
    conversions["long"] = createNumberConversion(32, { unsigned: false });
    conversions["unsigned long"] = createNumberConversion(32, { unsigned: true });
    conversions["long long"] = createNumberConversion(32, { unsigned: false, moduloBitLength: 64 });
    conversions["unsigned long long"] = createNumberConversion(32, { unsigned: true, moduloBitLength: 64 });
    conversions["double"] = function(V4) {
      const x7 = +V4;
      if (!Number.isFinite(x7)) {
        throw new TypeError("Argument is not a finite floating-point value");
      }
      return x7;
    };
    conversions["unrestricted double"] = function(V4) {
      const x7 = +V4;
      if (isNaN(x7)) {
        throw new TypeError("Argument is NaN");
      }
      return x7;
    };
    conversions["float"] = conversions["double"];
    conversions["unrestricted float"] = conversions["unrestricted double"];
    conversions["DOMString"] = function(V4, opts) {
      if (!opts) opts = {};
      if (opts.treatNullAsEmptyString && V4 === null) {
        return "";
      }
      return String(V4);
    };
    conversions["ByteString"] = function(V4, opts) {
      const x7 = String(V4);
      let c8 = void 0;
      for (let i7 = 0; (c8 = x7.codePointAt(i7)) !== void 0; ++i7) {
        if (c8 > 255) {
          throw new TypeError("Argument is not a valid bytestring");
        }
      }
      return x7;
    };
    conversions["USVString"] = function(V4) {
      const S4 = String(V4);
      const n9 = S4.length;
      const U4 = [];
      for (let i7 = 0; i7 < n9; ++i7) {
        const c8 = S4.charCodeAt(i7);
        if (c8 < 55296 || c8 > 57343) {
          U4.push(String.fromCodePoint(c8));
        } else if (56320 <= c8 && c8 <= 57343) {
          U4.push(String.fromCodePoint(65533));
        } else {
          if (i7 === n9 - 1) {
            U4.push(String.fromCodePoint(65533));
          } else {
            const d8 = S4.charCodeAt(i7 + 1);
            if (56320 <= d8 && d8 <= 57343) {
              const a7 = c8 & 1023;
              const b11 = d8 & 1023;
              U4.push(String.fromCodePoint((2 << 15) + (2 << 9) * a7 + b11));
              ++i7;
            } else {
              U4.push(String.fromCodePoint(65533));
            }
          }
        }
      }
      return U4.join("");
    };
    conversions["Date"] = function(V4, opts) {
      if (!(V4 instanceof Date)) {
        throw new TypeError("Argument is not a Date object");
      }
      if (isNaN(V4)) {
        return void 0;
      }
      return V4;
    };
    conversions["RegExp"] = function(V4, opts) {
      if (!(V4 instanceof RegExp)) {
        V4 = new RegExp(V4);
      }
      return V4;
    };
  }
});

// ../../node_modules/.pnpm/whatwg-url@5.0.0/node_modules/whatwg-url/lib/utils.js
var require_utils4 = __commonJS({
  "../../node_modules/.pnpm/whatwg-url@5.0.0/node_modules/whatwg-url/lib/utils.js"(exports, module2) {
    init_import_meta_url();
    module2.exports.mixin = /* @__PURE__ */ __name(function mixin3(target, source) {
      const keys = Object.getOwnPropertyNames(source);
      for (let i7 = 0; i7 < keys.length; ++i7) {
        Object.defineProperty(target, keys[i7], Object.getOwnPropertyDescriptor(source, keys[i7]));
      }
    }, "mixin");
    module2.exports.wrapperSymbol = Symbol("wrapper");
    module2.exports.implSymbol = Symbol("impl");
    module2.exports.wrapperForImpl = function(impl) {
      return impl[module2.exports.wrapperSymbol];
    };
    module2.exports.implForWrapper = function(wrapper) {
      return wrapper[module2.exports.implSymbol];
    };
  }
});

// ../../node_modules/.pnpm/tr46@0.0.3/node_modules/tr46/lib/mappingTable.json
var require_mappingTable = __commonJS({
  "../../node_modules/.pnpm/tr46@0.0.3/node_modules/tr46/lib/mappingTable.json"(exports, module2) {
    module2.exports = [[[0, 44], "disallowed_STD3_valid"], [[45, 46], "valid"], [[47, 47], "disallowed_STD3_valid"], [[48, 57], "valid"], [[58, 64], "disallowed_STD3_valid"], [[65, 65], "mapped", [97]], [[66, 66], "mapped", [98]], [[67, 67], "mapped", [99]], [[68, 68], "mapped", [100]], [[69, 69], "mapped", [101]], [[70, 70], "mapped", [102]], [[71, 71], "mapped", [103]], [[72, 72], "mapped", [104]], [[73, 73], "mapped", [105]], [[74, 74], "mapped", [106]], [[75, 75], "mapped", [107]], [[76, 76], "mapped", [108]], [[77, 77], "mapped", [109]], [[78, 78], "mapped", [110]], [[79, 79], "mapped", [111]], [[80, 80], "mapped", [112]], [[81, 81], "mapped", [113]], [[82, 82], "mapped", [114]], [[83, 83], "mapped", [115]], [[84, 84], "mapped", [116]], [[85, 85], "mapped", [117]], [[86, 86], "mapped", [118]], [[87, 87], "mapped", [119]], [[88, 88], "mapped", [120]], [[89, 89], "mapped", [121]], [[90, 90], "mapped", [122]], [[91, 96], "disallowed_STD3_valid"], [[97, 122], "valid"], [[123, 127], "disallowed_STD3_valid"], [[128, 159], "disallowed"], [[160, 160], "disallowed_STD3_mapped", [32]], [[161, 167], "valid", [], "NV8"], [[168, 168], "disallowed_STD3_mapped", [32, 776]], [[169, 169], "valid", [], "NV8"], [[170, 170], "mapped", [97]], [[171, 172], "valid", [], "NV8"], [[173, 173], "ignored"], [[174, 174], "valid", [], "NV8"], [[175, 175], "disallowed_STD3_mapped", [32, 772]], [[176, 177], "valid", [], "NV8"], [[178, 178], "mapped", [50]], [[179, 179], "mapped", [51]], [[180, 180], "disallowed_STD3_mapped", [32, 769]], [[181, 181], "mapped", [956]], [[182, 182], "valid", [], "NV8"], [[183, 183], "valid"], [[184, 184], "disallowed_STD3_mapped", [32, 807]], [[185, 185], "mapped", [49]], [[186, 186], "mapped", [111]], [[187, 187], "valid", [], "NV8"], [[188, 188], "mapped", [49, 8260, 52]], [[189, 189], "mapped", [49, 8260, 50]], [[190, 190], "mapped", [51, 8260, 52]], [[191, 191], "valid", [], "NV8"], [[192, 192], "mapped", [224]], [[193, 193], "mapped", [225]], [[194, 194], "mapped", [226]], [[195, 195], "mapped", [227]], [[196, 196], "mapped", [228]], [[197, 197], "mapped", [229]], [[198, 198], "mapped", [230]], [[199, 199], "mapped", [231]], [[200, 200], "mapped", [232]], [[201, 201], "mapped", [233]], [[202, 202], "mapped", [234]], [[203, 203], "mapped", [235]], [[204, 204], "mapped", [236]], [[205, 205], "mapped", [237]], [[206, 206], "mapped", [238]], [[207, 207], "mapped", [239]], [[208, 208], "mapped", [240]], [[209, 209], "mapped", [241]], [[210, 210], "mapped", [242]], [[211, 211], "mapped", [243]], [[212, 212], "mapped", [244]], [[213, 213], "mapped", [245]], [[214, 214], "mapped", [246]], [[215, 215], "valid", [], "NV8"], [[216, 216], "mapped", [248]], [[217, 217], "mapped", [249]], [[218, 218], "mapped", [250]], [[219, 219], "mapped", [251]], [[220, 220], "mapped", [252]], [[221, 221], "mapped", [253]], [[222, 222], "mapped", [254]], [[223, 223], "deviation", [115, 115]], [[224, 246], "valid"], [[247, 247], "valid", [], "NV8"], [[248, 255], "valid"], [[256, 256], "mapped", [257]], [[257, 257], "valid"], [[258, 258], "mapped", [259]], [[259, 259], "valid"], [[260, 260], "mapped", [261]], [[261, 261], "valid"], [[262, 262], "mapped", [263]], [[263, 263], "valid"], [[264, 264], "mapped", [265]], [[265, 265], "valid"], [[266, 266], "mapped", [267]], [[267, 267], "valid"], [[268, 268], "mapped", [269]], [[269, 269], "valid"], [[270, 270], "mapped", [271]], [[271, 271], "valid"], [[272, 272], "mapped", [273]], [[273, 273], "valid"], [[274, 274], "mapped", [275]], [[275, 275], "valid"], [[276, 276], "mapped", [277]], [[277, 277], "valid"], [[278, 278], "mapped", [279]], [[279, 279], "valid"], [[280, 280], "mapped", [281]], [[281, 281], "valid"], [[282, 282], "mapped", [283]], [[283, 283], "valid"], [[284, 284], "mapped", [285]], [[285, 285], "valid"], [[286, 286], "mapped", [287]], [[287, 287], "valid"], [[288, 288], "mapped", [289]], [[289, 289], "valid"], [[290, 290], "mapped", [291]], [[291, 291], "valid"], [[292, 292], "mapped", [293]], [[293, 293], "valid"], [[294, 294], "mapped", [295]], [[295, 295], "valid"], [[296, 296], "mapped", [297]], [[297, 297], "valid"], [[298, 298], "mapped", [299]], [[299, 299], "valid"], [[300, 300], "mapped", [301]], [[301, 301], "valid"], [[302, 302], "mapped", [303]], [[303, 303], "valid"], [[304, 304], "mapped", [105, 775]], [[305, 305], "valid"], [[306, 307], "mapped", [105, 106]], [[308, 308], "mapped", [309]], [[309, 309], "valid"], [[310, 310], "mapped", [311]], [[311, 312], "valid"], [[313, 313], "mapped", [314]], [[314, 314], "valid"], [[315, 315], "mapped", [316]], [[316, 316], "valid"], [[317, 317], "mapped", [318]], [[318, 318], "valid"], [[319, 320], "mapped", [108, 183]], [[321, 321], "mapped", [322]], [[322, 322], "valid"], [[323, 323], "mapped", [324]], [[324, 324], "valid"], [[325, 325], "mapped", [326]], [[326, 326], "valid"], [[327, 327], "mapped", [328]], [[328, 328], "valid"], [[329, 329], "mapped", [700, 110]], [[330, 330], "mapped", [331]], [[331, 331], "valid"], [[332, 332], "mapped", [333]], [[333, 333], "valid"], [[334, 334], "mapped", [335]], [[335, 335], "valid"], [[336, 336], "mapped", [337]], [[337, 337], "valid"], [[338, 338], "mapped", [339]], [[339, 339], "valid"], [[340, 340], "mapped", [341]], [[341, 341], "valid"], [[342, 342], "mapped", [343]], [[343, 343], "valid"], [[344, 344], "mapped", [345]], [[345, 345], "valid"], [[346, 346], "mapped", [347]], [[347, 347], "valid"], [[348, 348], "mapped", [349]], [[349, 349], "valid"], [[350, 350], "mapped", [351]], [[351, 351], "valid"], [[352, 352], "mapped", [353]], [[353, 353], "valid"], [[354, 354], "mapped", [355]], [[355, 355], "valid"], [[356, 356], "mapped", [357]], [[357, 357], "valid"], [[358, 358], "mapped", [359]], [[359, 359], "valid"], [[360, 360], "mapped", [361]], [[361, 361], "valid"], [[362, 362], "mapped", [363]], [[363, 363], "valid"], [[364, 364], "mapped", [365]], [[365, 365], "valid"], [[366, 366], "mapped", [367]], [[367, 367], "valid"], [[368, 368], "mapped", [369]], [[369, 369], "valid"], [[370, 370], "mapped", [371]], [[371, 371], "valid"], [[372, 372], "mapped", [373]], [[373, 373], "valid"], [[374, 374], "mapped", [375]], [[375, 375], "valid"], [[376, 376], "mapped", [255]], [[377, 377], "mapped", [378]], [[378, 378], "valid"], [[379, 379], "mapped", [380]], [[380, 380], "valid"], [[381, 381], "mapped", [382]], [[382, 382], "valid"], [[383, 383], "mapped", [115]], [[384, 384], "valid"], [[385, 385], "mapped", [595]], [[386, 386], "mapped", [387]], [[387, 387], "valid"], [[388, 388], "mapped", [389]], [[389, 389], "valid"], [[390, 390], "mapped", [596]], [[391, 391], "mapped", [392]], [[392, 392], "valid"], [[393, 393], "mapped", [598]], [[394, 394], "mapped", [599]], [[395, 395], "mapped", [396]], [[396, 397], "valid"], [[398, 398], "mapped", [477]], [[399, 399], "mapped", [601]], [[400, 400], "mapped", [603]], [[401, 401], "mapped", [402]], [[402, 402], "valid"], [[403, 403], "mapped", [608]], [[404, 404], "mapped", [611]], [[405, 405], "valid"], [[406, 406], "mapped", [617]], [[407, 407], "mapped", [616]], [[408, 408], "mapped", [409]], [[409, 411], "valid"], [[412, 412], "mapped", [623]], [[413, 413], "mapped", [626]], [[414, 414], "valid"], [[415, 415], "mapped", [629]], [[416, 416], "mapped", [417]], [[417, 417], "valid"], [[418, 418], "mapped", [419]], [[419, 419], "valid"], [[420, 420], "mapped", [421]], [[421, 421], "valid"], [[422, 422], "mapped", [640]], [[423, 423], "mapped", [424]], [[424, 424], "valid"], [[425, 425], "mapped", [643]], [[426, 427], "valid"], [[428, 428], "mapped", [429]], [[429, 429], "valid"], [[430, 430], "mapped", [648]], [[431, 431], "mapped", [432]], [[432, 432], "valid"], [[433, 433], "mapped", [650]], [[434, 434], "mapped", [651]], [[435, 435], "mapped", [436]], [[436, 436], "valid"], [[437, 437], "mapped", [438]], [[438, 438], "valid"], [[439, 439], "mapped", [658]], [[440, 440], "mapped", [441]], [[441, 443], "valid"], [[444, 444], "mapped", [445]], [[445, 451], "valid"], [[452, 454], "mapped", [100, 382]], [[455, 457], "mapped", [108, 106]], [[458, 460], "mapped", [110, 106]], [[461, 461], "mapped", [462]], [[462, 462], "valid"], [[463, 463], "mapped", [464]], [[464, 464], "valid"], [[465, 465], "mapped", [466]], [[466, 466], "valid"], [[467, 467], "mapped", [468]], [[468, 468], "valid"], [[469, 469], "mapped", [470]], [[470, 470], "valid"], [[471, 471], "mapped", [472]], [[472, 472], "valid"], [[473, 473], "mapped", [474]], [[474, 474], "valid"], [[475, 475], "mapped", [476]], [[476, 477], "valid"], [[478, 478], "mapped", [479]], [[479, 479], "valid"], [[480, 480], "mapped", [481]], [[481, 481], "valid"], [[482, 482], "mapped", [483]], [[483, 483], "valid"], [[484, 484], "mapped", [485]], [[485, 485], "valid"], [[486, 486], "mapped", [487]], [[487, 487], "valid"], [[488, 488], "mapped", [489]], [[489, 489], "valid"], [[490, 490], "mapped", [491]], [[491, 491], "valid"], [[492, 492], "mapped", [493]], [[493, 493], "valid"], [[494, 494], "mapped", [495]], [[495, 496], "valid"], [[497, 499], "mapped", [100, 122]], [[500, 500], "mapped", [501]], [[501, 501], "valid"], [[502, 502], "mapped", [405]], [[503, 503], "mapped", [447]], [[504, 504], "mapped", [505]], [[505, 505], "valid"], [[506, 506], "mapped", [507]], [[507, 507], "valid"], [[508, 508], "mapped", [509]], [[509, 509], "valid"], [[510, 510], "mapped", [511]], [[511, 511], "valid"], [[512, 512], "mapped", [513]], [[513, 513], "valid"], [[514, 514], "mapped", [515]], [[515, 515], "valid"], [[516, 516], "mapped", [517]], [[517, 517], "valid"], [[518, 518], "mapped", [519]], [[519, 519], "valid"], [[520, 520], "mapped", [521]], [[521, 521], "valid"], [[522, 522], "mapped", [523]], [[523, 523], "valid"], [[524, 524], "mapped", [525]], [[525, 525], "valid"], [[526, 526], "mapped", [527]], [[527, 527], "valid"], [[528, 528], "mapped", [529]], [[529, 529], "valid"], [[530, 530], "mapped", [531]], [[531, 531], "valid"], [[532, 532], "mapped", [533]], [[533, 533], "valid"], [[534, 534], "mapped", [535]], [[535, 535], "valid"], [[536, 536], "mapped", [537]], [[537, 537], "valid"], [[538, 538], "mapped", [539]], [[539, 539], "valid"], [[540, 540], "mapped", [541]], [[541, 541], "valid"], [[542, 542], "mapped", [543]], [[543, 543], "valid"], [[544, 544], "mapped", [414]], [[545, 545], "valid"], [[546, 546], "mapped", [547]], [[547, 547], "valid"], [[548, 548], "mapped", [549]], [[549, 549], "valid"], [[550, 550], "mapped", [551]], [[551, 551], "valid"], [[552, 552], "mapped", [553]], [[553, 553], "valid"], [[554, 554], "mapped", [555]], [[555, 555], "valid"], [[556, 556], "mapped", [557]], [[557, 557], "valid"], [[558, 558], "mapped", [559]], [[559, 559], "valid"], [[560, 560], "mapped", [561]], [[561, 561], "valid"], [[562, 562], "mapped", [563]], [[563, 563], "valid"], [[564, 566], "valid"], [[567, 569], "valid"], [[570, 570], "mapped", [11365]], [[571, 571], "mapped", [572]], [[572, 572], "valid"], [[573, 573], "mapped", [410]], [[574, 574], "mapped", [11366]], [[575, 576], "valid"], [[577, 577], "mapped", [578]], [[578, 578], "valid"], [[579, 579], "mapped", [384]], [[580, 580], "mapped", [649]], [[581, 581], "mapped", [652]], [[582, 582], "mapped", [583]], [[583, 583], "valid"], [[584, 584], "mapped", [585]], [[585, 585], "valid"], [[586, 586], "mapped", [587]], [[587, 587], "valid"], [[588, 588], "mapped", [589]], [[589, 589], "valid"], [[590, 590], "mapped", [591]], [[591, 591], "valid"], [[592, 680], "valid"], [[681, 685], "valid"], [[686, 687], "valid"], [[688, 688], "mapped", [104]], [[689, 689], "mapped", [614]], [[690, 690], "mapped", [106]], [[691, 691], "mapped", [114]], [[692, 692], "mapped", [633]], [[693, 693], "mapped", [635]], [[694, 694], "mapped", [641]], [[695, 695], "mapped", [119]], [[696, 696], "mapped", [121]], [[697, 705], "valid"], [[706, 709], "valid", [], "NV8"], [[710, 721], "valid"], [[722, 727], "valid", [], "NV8"], [[728, 728], "disallowed_STD3_mapped", [32, 774]], [[729, 729], "disallowed_STD3_mapped", [32, 775]], [[730, 730], "disallowed_STD3_mapped", [32, 778]], [[731, 731], "disallowed_STD3_mapped", [32, 808]], [[732, 732], "disallowed_STD3_mapped", [32, 771]], [[733, 733], "disallowed_STD3_mapped", [32, 779]], [[734, 734], "valid", [], "NV8"], [[735, 735], "valid", [], "NV8"], [[736, 736], "mapped", [611]], [[737, 737], "mapped", [108]], [[738, 738], "mapped", [115]], [[739, 739], "mapped", [120]], [[740, 740], "mapped", [661]], [[741, 745], "valid", [], "NV8"], [[746, 747], "valid", [], "NV8"], [[748, 748], "valid"], [[749, 749], "valid", [], "NV8"], [[750, 750], "valid"], [[751, 767], "valid", [], "NV8"], [[768, 831], "valid"], [[832, 832], "mapped", [768]], [[833, 833], "mapped", [769]], [[834, 834], "valid"], [[835, 835], "mapped", [787]], [[836, 836], "mapped", [776, 769]], [[837, 837], "mapped", [953]], [[838, 846], "valid"], [[847, 847], "ignored"], [[848, 855], "valid"], [[856, 860], "valid"], [[861, 863], "valid"], [[864, 865], "valid"], [[866, 866], "valid"], [[867, 879], "valid"], [[880, 880], "mapped", [881]], [[881, 881], "valid"], [[882, 882], "mapped", [883]], [[883, 883], "valid"], [[884, 884], "mapped", [697]], [[885, 885], "valid"], [[886, 886], "mapped", [887]], [[887, 887], "valid"], [[888, 889], "disallowed"], [[890, 890], "disallowed_STD3_mapped", [32, 953]], [[891, 893], "valid"], [[894, 894], "disallowed_STD3_mapped", [59]], [[895, 895], "mapped", [1011]], [[896, 899], "disallowed"], [[900, 900], "disallowed_STD3_mapped", [32, 769]], [[901, 901], "disallowed_STD3_mapped", [32, 776, 769]], [[902, 902], "mapped", [940]], [[903, 903], "mapped", [183]], [[904, 904], "mapped", [941]], [[905, 905], "mapped", [942]], [[906, 906], "mapped", [943]], [[907, 907], "disallowed"], [[908, 908], "mapped", [972]], [[909, 909], "disallowed"], [[910, 910], "mapped", [973]], [[911, 911], "mapped", [974]], [[912, 912], "valid"], [[913, 913], "mapped", [945]], [[914, 914], "mapped", [946]], [[915, 915], "mapped", [947]], [[916, 916], "mapped", [948]], [[917, 917], "mapped", [949]], [[918, 918], "mapped", [950]], [[919, 919], "mapped", [951]], [[920, 920], "mapped", [952]], [[921, 921], "mapped", [953]], [[922, 922], "mapped", [954]], [[923, 923], "mapped", [955]], [[924, 924], "mapped", [956]], [[925, 925], "mapped", [957]], [[926, 926], "mapped", [958]], [[927, 927], "mapped", [959]], [[928, 928], "mapped", [960]], [[929, 929], "mapped", [961]], [[930, 930], "disallowed"], [[931, 931], "mapped", [963]], [[932, 932], "mapped", [964]], [[933, 933], "mapped", [965]], [[934, 934], "mapped", [966]], [[935, 935], "mapped", [967]], [[936, 936], "mapped", [968]], [[937, 937], "mapped", [969]], [[938, 938], "mapped", [970]], [[939, 939], "mapped", [971]], [[940, 961], "valid"], [[962, 962], "deviation", [963]], [[963, 974], "valid"], [[975, 975], "mapped", [983]], [[976, 976], "mapped", [946]], [[977, 977], "mapped", [952]], [[978, 978], "mapped", [965]], [[979, 979], "mapped", [973]], [[980, 980], "mapped", [971]], [[981, 981], "mapped", [966]], [[982, 982], "mapped", [960]], [[983, 983], "valid"], [[984, 984], "mapped", [985]], [[985, 985], "valid"], [[986, 986], "mapped", [987]], [[987, 987], "valid"], [[988, 988], "mapped", [989]], [[989, 989], "valid"], [[990, 990], "mapped", [991]], [[991, 991], "valid"], [[992, 992], "mapped", [993]], [[993, 993], "valid"], [[994, 994], "mapped", [995]], [[995, 995], "valid"], [[996, 996], "mapped", [997]], [[997, 997], "valid"], [[998, 998], "mapped", [999]], [[999, 999], "valid"], [[1e3, 1e3], "mapped", [1001]], [[1001, 1001], "valid"], [[1002, 1002], "mapped", [1003]], [[1003, 1003], "valid"], [[1004, 1004], "mapped", [1005]], [[1005, 1005], "valid"], [[1006, 1006], "mapped", [1007]], [[1007, 1007], "valid"], [[1008, 1008], "mapped", [954]], [[1009, 1009], "mapped", [961]], [[1010, 1010], "mapped", [963]], [[1011, 1011], "valid"], [[1012, 1012], "mapped", [952]], [[1013, 1013], "mapped", [949]], [[1014, 1014], "valid", [], "NV8"], [[1015, 1015], "mapped", [1016]], [[1016, 1016], "valid"], [[1017, 1017], "mapped", [963]], [[1018, 1018], "mapped", [1019]], [[1019, 1019], "valid"], [[1020, 1020], "valid"], [[1021, 1021], "mapped", [891]], [[1022, 1022], "mapped", [892]], [[1023, 1023], "mapped", [893]], [[1024, 1024], "mapped", [1104]], [[1025, 1025], "mapped", [1105]], [[1026, 1026], "mapped", [1106]], [[1027, 1027], "mapped", [1107]], [[1028, 1028], "mapped", [1108]], [[1029, 1029], "mapped", [1109]], [[1030, 1030], "mapped", [1110]], [[1031, 1031], "mapped", [1111]], [[1032, 1032], "mapped", [1112]], [[1033, 1033], "mapped", [1113]], [[1034, 1034], "mapped", [1114]], [[1035, 1035], "mapped", [1115]], [[1036, 1036], "mapped", [1116]], [[1037, 1037], "mapped", [1117]], [[1038, 1038], "mapped", [1118]], [[1039, 1039], "mapped", [1119]], [[1040, 1040], "mapped", [1072]], [[1041, 1041], "mapped", [1073]], [[1042, 1042], "mapped", [1074]], [[1043, 1043], "mapped", [1075]], [[1044, 1044], "mapped", [1076]], [[1045, 1045], "mapped", [1077]], [[1046, 1046], "mapped", [1078]], [[1047, 1047], "mapped", [1079]], [[1048, 1048], "mapped", [1080]], [[1049, 1049], "mapped", [1081]], [[1050, 1050], "mapped", [1082]], [[1051, 1051], "mapped", [1083]], [[1052, 1052], "mapped", [1084]], [[1053, 1053], "mapped", [1085]], [[1054, 1054], "mapped", [1086]], [[1055, 1055], "mapped", [1087]], [[1056, 1056], "mapped", [1088]], [[1057, 1057], "mapped", [1089]], [[1058, 1058], "mapped", [1090]], [[1059, 1059], "mapped", [1091]], [[1060, 1060], "mapped", [1092]], [[1061, 1061], "mapped", [1093]], [[1062, 1062], "mapped", [1094]], [[1063, 1063], "mapped", [1095]], [[1064, 1064], "mapped", [1096]], [[1065, 1065], "mapped", [1097]], [[1066, 1066], "mapped", [1098]], [[1067, 1067], "mapped", [1099]], [[1068, 1068], "mapped", [1100]], [[1069, 1069], "mapped", [1101]], [[1070, 1070], "mapped", [1102]], [[1071, 1071], "mapped", [1103]], [[1072, 1103], "valid"], [[1104, 1104], "valid"], [[1105, 1116], "valid"], [[1117, 1117], "valid"], [[1118, 1119], "valid"], [[1120, 1120], "mapped", [1121]], [[1121, 1121], "valid"], [[1122, 1122], "mapped", [1123]], [[1123, 1123], "valid"], [[1124, 1124], "mapped", [1125]], [[1125, 1125], "valid"], [[1126, 1126], "mapped", [1127]], [[1127, 1127], "valid"], [[1128, 1128], "mapped", [1129]], [[1129, 1129], "valid"], [[1130, 1130], "mapped", [1131]], [[1131, 1131], "valid"], [[1132, 1132], "mapped", [1133]], [[1133, 1133], "valid"], [[1134, 1134], "mapped", [1135]], [[1135, 1135], "valid"], [[1136, 1136], "mapped", [1137]], [[1137, 1137], "valid"], [[1138, 1138], "mapped", [1139]], [[1139, 1139], "valid"], [[1140, 1140], "mapped", [1141]], [[1141, 1141], "valid"], [[1142, 1142], "mapped", [1143]], [[1143, 1143], "valid"], [[1144, 1144], "mapped", [1145]], [[1145, 1145], "valid"], [[1146, 1146], "mapped", [1147]], [[1147, 1147], "valid"], [[1148, 1148], "mapped", [1149]], [[1149, 1149], "valid"], [[1150, 1150], "mapped", [1151]], [[1151, 1151], "valid"], [[1152, 1152], "mapped", [1153]], [[1153, 1153], "valid"], [[1154, 1154], "valid", [], "NV8"], [[1155, 1158], "valid"], [[1159, 1159], "valid"], [[1160, 1161], "valid", [], "NV8"], [[1162, 1162], "mapped", [1163]], [[1163, 1163], "valid"], [[1164, 1164], "mapped", [1165]], [[1165, 1165], "valid"], [[1166, 1166], "mapped", [1167]], [[1167, 1167], "valid"], [[1168, 1168], "mapped", [1169]], [[1169, 1169], "valid"], [[1170, 1170], "mapped", [1171]], [[1171, 1171], "valid"], [[1172, 1172], "mapped", [1173]], [[1173, 1173], "valid"], [[1174, 1174], "mapped", [1175]], [[1175, 1175], "valid"], [[1176, 1176], "mapped", [1177]], [[1177, 1177], "valid"], [[1178, 1178], "mapped", [1179]], [[1179, 1179], "valid"], [[1180, 1180], "mapped", [1181]], [[1181, 1181], "valid"], [[1182, 1182], "mapped", [1183]], [[1183, 1183], "valid"], [[1184, 1184], "mapped", [1185]], [[1185, 1185], "valid"], [[1186, 1186], "mapped", [1187]], [[1187, 1187], "valid"], [[1188, 1188], "mapped", [1189]], [[1189, 1189], "valid"], [[1190, 1190], "mapped", [1191]], [[1191, 1191], "valid"], [[1192, 1192], "mapped", [1193]], [[1193, 1193], "valid"], [[1194, 1194], "mapped", [1195]], [[1195, 1195], "valid"], [[1196, 1196], "mapped", [1197]], [[1197, 1197], "valid"], [[1198, 1198], "mapped", [1199]], [[1199, 1199], "valid"], [[1200, 1200], "mapped", [1201]], [[1201, 1201], "valid"], [[1202, 1202], "mapped", [1203]], [[1203, 1203], "valid"], [[1204, 1204], "mapped", [1205]], [[1205, 1205], "valid"], [[1206, 1206], "mapped", [1207]], [[1207, 1207], "valid"], [[1208, 1208], "mapped", [1209]], [[1209, 1209], "valid"], [[1210, 1210], "mapped", [1211]], [[1211, 1211], "valid"], [[1212, 1212], "mapped", [1213]], [[1213, 1213], "valid"], [[1214, 1214], "mapped", [1215]], [[1215, 1215], "valid"], [[1216, 1216], "disallowed"], [[1217, 1217], "mapped", [1218]], [[1218, 1218], "valid"], [[1219, 1219], "mapped", [1220]], [[1220, 1220], "valid"], [[1221, 1221], "mapped", [1222]], [[1222, 1222], "valid"], [[1223, 1223], "mapped", [1224]], [[1224, 1224], "valid"], [[1225, 1225], "mapped", [1226]], [[1226, 1226], "valid"], [[1227, 1227], "mapped", [1228]], [[1228, 1228], "valid"], [[1229, 1229], "mapped", [1230]], [[1230, 1230], "valid"], [[1231, 1231], "valid"], [[1232, 1232], "mapped", [1233]], [[1233, 1233], "valid"], [[1234, 1234], "mapped", [1235]], [[1235, 1235], "valid"], [[1236, 1236], "mapped", [1237]], [[1237, 1237], "valid"], [[1238, 1238], "mapped", [1239]], [[1239, 1239], "valid"], [[1240, 1240], "mapped", [1241]], [[1241, 1241], "valid"], [[1242, 1242], "mapped", [1243]], [[1243, 1243], "valid"], [[1244, 1244], "mapped", [1245]], [[1245, 1245], "valid"], [[1246, 1246], "mapped", [1247]], [[1247, 1247], "valid"], [[1248, 1248], "mapped", [1249]], [[1249, 1249], "valid"], [[1250, 1250], "mapped", [1251]], [[1251, 1251], "valid"], [[1252, 1252], "mapped", [1253]], [[1253, 1253], "valid"], [[1254, 1254], "mapped", [1255]], [[1255, 1255], "valid"], [[1256, 1256], "mapped", [1257]], [[1257, 1257], "valid"], [[1258, 1258], "mapped", [1259]], [[1259, 1259], "valid"], [[1260, 1260], "mapped", [1261]], [[1261, 1261], "valid"], [[1262, 1262], "mapped", [1263]], [[1263, 1263], "valid"], [[1264, 1264], "mapped", [1265]], [[1265, 1265], "valid"], [[1266, 1266], "mapped", [1267]], [[1267, 1267], "valid"], [[1268, 1268], "mapped", [1269]], [[1269, 1269], "valid"], [[1270, 1270], "mapped", [1271]], [[1271, 1271], "valid"], [[1272, 1272], "mapped", [1273]], [[1273, 1273], "valid"], [[1274, 1274], "mapped", [1275]], [[1275, 1275], "valid"], [[1276, 1276], "mapped", [1277]], [[1277, 1277], "valid"], [[1278, 1278], "mapped", [1279]], [[1279, 1279], "valid"], [[1280, 1280], "mapped", [1281]], [[1281, 1281], "valid"], [[1282, 1282], "mapped", [1283]], [[1283, 1283], "valid"], [[1284, 1284], "mapped", [1285]], [[1285, 1285], "valid"], [[1286, 1286], "mapped", [1287]], [[1287, 1287], "valid"], [[1288, 1288], "mapped", [1289]], [[1289, 1289], "valid"], [[1290, 1290], "mapped", [1291]], [[1291, 1291], "valid"], [[1292, 1292], "mapped", [1293]], [[1293, 1293], "valid"], [[1294, 1294], "mapped", [1295]], [[1295, 1295], "valid"], [[1296, 1296], "mapped", [1297]], [[1297, 1297], "valid"], [[1298, 1298], "mapped", [1299]], [[1299, 1299], "valid"], [[1300, 1300], "mapped", [1301]], [[1301, 1301], "valid"], [[1302, 1302], "mapped", [1303]], [[1303, 1303], "valid"], [[1304, 1304], "mapped", [1305]], [[1305, 1305], "valid"], [[1306, 1306], "mapped", [1307]], [[1307, 1307], "valid"], [[1308, 1308], "mapped", [1309]], [[1309, 1309], "valid"], [[1310, 1310], "mapped", [1311]], [[1311, 1311], "valid"], [[1312, 1312], "mapped", [1313]], [[1313, 1313], "valid"], [[1314, 1314], "mapped", [1315]], [[1315, 1315], "valid"], [[1316, 1316], "mapped", [1317]], [[1317, 1317], "valid"], [[1318, 1318], "mapped", [1319]], [[1319, 1319], "valid"], [[1320, 1320], "mapped", [1321]], [[1321, 1321], "valid"], [[1322, 1322], "mapped", [1323]], [[1323, 1323], "valid"], [[1324, 1324], "mapped", [1325]], [[1325, 1325], "valid"], [[1326, 1326], "mapped", [1327]], [[1327, 1327], "valid"], [[1328, 1328], "disallowed"], [[1329, 1329], "mapped", [1377]], [[1330, 1330], "mapped", [1378]], [[1331, 1331], "mapped", [1379]], [[1332, 1332], "mapped", [1380]], [[1333, 1333], "mapped", [1381]], [[1334, 1334], "mapped", [1382]], [[1335, 1335], "mapped", [1383]], [[1336, 1336], "mapped", [1384]], [[1337, 1337], "mapped", [1385]], [[1338, 1338], "mapped", [1386]], [[1339, 1339], "mapped", [1387]], [[1340, 1340], "mapped", [1388]], [[1341, 1341], "mapped", [1389]], [[1342, 1342], "mapped", [1390]], [[1343, 1343], "mapped", [1391]], [[1344, 1344], "mapped", [1392]], [[1345, 1345], "mapped", [1393]], [[1346, 1346], "mapped", [1394]], [[1347, 1347], "mapped", [1395]], [[1348, 1348], "mapped", [1396]], [[1349, 1349], "mapped", [1397]], [[1350, 1350], "mapped", [1398]], [[1351, 1351], "mapped", [1399]], [[1352, 1352], "mapped", [1400]], [[1353, 1353], "mapped", [1401]], [[1354, 1354], "mapped", [1402]], [[1355, 1355], "mapped", [1403]], [[1356, 1356], "mapped", [1404]], [[1357, 1357], "mapped", [1405]], [[1358, 1358], "mapped", [1406]], [[1359, 1359], "mapped", [1407]], [[1360, 1360], "mapped", [1408]], [[1361, 1361], "mapped", [1409]], [[1362, 1362], "mapped", [1410]], [[1363, 1363], "mapped", [1411]], [[1364, 1364], "mapped", [1412]], [[1365, 1365], "mapped", [1413]], [[1366, 1366], "mapped", [1414]], [[1367, 1368], "disallowed"], [[1369, 1369], "valid"], [[1370, 1375], "valid", [], "NV8"], [[1376, 1376], "disallowed"], [[1377, 1414], "valid"], [[1415, 1415], "mapped", [1381, 1410]], [[1416, 1416], "disallowed"], [[1417, 1417], "valid", [], "NV8"], [[1418, 1418], "valid", [], "NV8"], [[1419, 1420], "disallowed"], [[1421, 1422], "valid", [], "NV8"], [[1423, 1423], "valid", [], "NV8"], [[1424, 1424], "disallowed"], [[1425, 1441], "valid"], [[1442, 1442], "valid"], [[1443, 1455], "valid"], [[1456, 1465], "valid"], [[1466, 1466], "valid"], [[1467, 1469], "valid"], [[1470, 1470], "valid", [], "NV8"], [[1471, 1471], "valid"], [[1472, 1472], "valid", [], "NV8"], [[1473, 1474], "valid"], [[1475, 1475], "valid", [], "NV8"], [[1476, 1476], "valid"], [[1477, 1477], "valid"], [[1478, 1478], "valid", [], "NV8"], [[1479, 1479], "valid"], [[1480, 1487], "disallowed"], [[1488, 1514], "valid"], [[1515, 1519], "disallowed"], [[1520, 1524], "valid"], [[1525, 1535], "disallowed"], [[1536, 1539], "disallowed"], [[1540, 1540], "disallowed"], [[1541, 1541], "disallowed"], [[1542, 1546], "valid", [], "NV8"], [[1547, 1547], "valid", [], "NV8"], [[1548, 1548], "valid", [], "NV8"], [[1549, 1551], "valid", [], "NV8"], [[1552, 1557], "valid"], [[1558, 1562], "valid"], [[1563, 1563], "valid", [], "NV8"], [[1564, 1564], "disallowed"], [[1565, 1565], "disallowed"], [[1566, 1566], "valid", [], "NV8"], [[1567, 1567], "valid", [], "NV8"], [[1568, 1568], "valid"], [[1569, 1594], "valid"], [[1595, 1599], "valid"], [[1600, 1600], "valid", [], "NV8"], [[1601, 1618], "valid"], [[1619, 1621], "valid"], [[1622, 1624], "valid"], [[1625, 1630], "valid"], [[1631, 1631], "valid"], [[1632, 1641], "valid"], [[1642, 1645], "valid", [], "NV8"], [[1646, 1647], "valid"], [[1648, 1652], "valid"], [[1653, 1653], "mapped", [1575, 1652]], [[1654, 1654], "mapped", [1608, 1652]], [[1655, 1655], "mapped", [1735, 1652]], [[1656, 1656], "mapped", [1610, 1652]], [[1657, 1719], "valid"], [[1720, 1721], "valid"], [[1722, 1726], "valid"], [[1727, 1727], "valid"], [[1728, 1742], "valid"], [[1743, 1743], "valid"], [[1744, 1747], "valid"], [[1748, 1748], "valid", [], "NV8"], [[1749, 1756], "valid"], [[1757, 1757], "disallowed"], [[1758, 1758], "valid", [], "NV8"], [[1759, 1768], "valid"], [[1769, 1769], "valid", [], "NV8"], [[1770, 1773], "valid"], [[1774, 1775], "valid"], [[1776, 1785], "valid"], [[1786, 1790], "valid"], [[1791, 1791], "valid"], [[1792, 1805], "valid", [], "NV8"], [[1806, 1806], "disallowed"], [[1807, 1807], "disallowed"], [[1808, 1836], "valid"], [[1837, 1839], "valid"], [[1840, 1866], "valid"], [[1867, 1868], "disallowed"], [[1869, 1871], "valid"], [[1872, 1901], "valid"], [[1902, 1919], "valid"], [[1920, 1968], "valid"], [[1969, 1969], "valid"], [[1970, 1983], "disallowed"], [[1984, 2037], "valid"], [[2038, 2042], "valid", [], "NV8"], [[2043, 2047], "disallowed"], [[2048, 2093], "valid"], [[2094, 2095], "disallowed"], [[2096, 2110], "valid", [], "NV8"], [[2111, 2111], "disallowed"], [[2112, 2139], "valid"], [[2140, 2141], "disallowed"], [[2142, 2142], "valid", [], "NV8"], [[2143, 2207], "disallowed"], [[2208, 2208], "valid"], [[2209, 2209], "valid"], [[2210, 2220], "valid"], [[2221, 2226], "valid"], [[2227, 2228], "valid"], [[2229, 2274], "disallowed"], [[2275, 2275], "valid"], [[2276, 2302], "valid"], [[2303, 2303], "valid"], [[2304, 2304], "valid"], [[2305, 2307], "valid"], [[2308, 2308], "valid"], [[2309, 2361], "valid"], [[2362, 2363], "valid"], [[2364, 2381], "valid"], [[2382, 2382], "valid"], [[2383, 2383], "valid"], [[2384, 2388], "valid"], [[2389, 2389], "valid"], [[2390, 2391], "valid"], [[2392, 2392], "mapped", [2325, 2364]], [[2393, 2393], "mapped", [2326, 2364]], [[2394, 2394], "mapped", [2327, 2364]], [[2395, 2395], "mapped", [2332, 2364]], [[2396, 2396], "mapped", [2337, 2364]], [[2397, 2397], "mapped", [2338, 2364]], [[2398, 2398], "mapped", [2347, 2364]], [[2399, 2399], "mapped", [2351, 2364]], [[2400, 2403], "valid"], [[2404, 2405], "valid", [], "NV8"], [[2406, 2415], "valid"], [[2416, 2416], "valid", [], "NV8"], [[2417, 2418], "valid"], [[2419, 2423], "valid"], [[2424, 2424], "valid"], [[2425, 2426], "valid"], [[2427, 2428], "valid"], [[2429, 2429], "valid"], [[2430, 2431], "valid"], [[2432, 2432], "valid"], [[2433, 2435], "valid"], [[2436, 2436], "disallowed"], [[2437, 2444], "valid"], [[2445, 2446], "disallowed"], [[2447, 2448], "valid"], [[2449, 2450], "disallowed"], [[2451, 2472], "valid"], [[2473, 2473], "disallowed"], [[2474, 2480], "valid"], [[2481, 2481], "disallowed"], [[2482, 2482], "valid"], [[2483, 2485], "disallowed"], [[2486, 2489], "valid"], [[2490, 2491], "disallowed"], [[2492, 2492], "valid"], [[2493, 2493], "valid"], [[2494, 2500], "valid"], [[2501, 2502], "disallowed"], [[2503, 2504], "valid"], [[2505, 2506], "disallowed"], [[2507, 2509], "valid"], [[2510, 2510], "valid"], [[2511, 2518], "disallowed"], [[2519, 2519], "valid"], [[2520, 2523], "disallowed"], [[2524, 2524], "mapped", [2465, 2492]], [[2525, 2525], "mapped", [2466, 2492]], [[2526, 2526], "disallowed"], [[2527, 2527], "mapped", [2479, 2492]], [[2528, 2531], "valid"], [[2532, 2533], "disallowed"], [[2534, 2545], "valid"], [[2546, 2554], "valid", [], "NV8"], [[2555, 2555], "valid", [], "NV8"], [[2556, 2560], "disallowed"], [[2561, 2561], "valid"], [[2562, 2562], "valid"], [[2563, 2563], "valid"], [[2564, 2564], "disallowed"], [[2565, 2570], "valid"], [[2571, 2574], "disallowed"], [[2575, 2576], "valid"], [[2577, 2578], "disallowed"], [[2579, 2600], "valid"], [[2601, 2601], "disallowed"], [[2602, 2608], "valid"], [[2609, 2609], "disallowed"], [[2610, 2610], "valid"], [[2611, 2611], "mapped", [2610, 2620]], [[2612, 2612], "disallowed"], [[2613, 2613], "valid"], [[2614, 2614], "mapped", [2616, 2620]], [[2615, 2615], "disallowed"], [[2616, 2617], "valid"], [[2618, 2619], "disallowed"], [[2620, 2620], "valid"], [[2621, 2621], "disallowed"], [[2622, 2626], "valid"], [[2627, 2630], "disallowed"], [[2631, 2632], "valid"], [[2633, 2634], "disallowed"], [[2635, 2637], "valid"], [[2638, 2640], "disallowed"], [[2641, 2641], "valid"], [[2642, 2648], "disallowed"], [[2649, 2649], "mapped", [2582, 2620]], [[2650, 2650], "mapped", [2583, 2620]], [[2651, 2651], "mapped", [2588, 2620]], [[2652, 2652], "valid"], [[2653, 2653], "disallowed"], [[2654, 2654], "mapped", [2603, 2620]], [[2655, 2661], "disallowed"], [[2662, 2676], "valid"], [[2677, 2677], "valid"], [[2678, 2688], "disallowed"], [[2689, 2691], "valid"], [[2692, 2692], "disallowed"], [[2693, 2699], "valid"], [[2700, 2700], "valid"], [[2701, 2701], "valid"], [[2702, 2702], "disallowed"], [[2703, 2705], "valid"], [[2706, 2706], "disallowed"], [[2707, 2728], "valid"], [[2729, 2729], "disallowed"], [[2730, 2736], "valid"], [[2737, 2737], "disallowed"], [[2738, 2739], "valid"], [[2740, 2740], "disallowed"], [[2741, 2745], "valid"], [[2746, 2747], "disallowed"], [[2748, 2757], "valid"], [[2758, 2758], "disallowed"], [[2759, 2761], "valid"], [[2762, 2762], "disallowed"], [[2763, 2765], "valid"], [[2766, 2767], "disallowed"], [[2768, 2768], "valid"], [[2769, 2783], "disallowed"], [[2784, 2784], "valid"], [[2785, 2787], "valid"], [[2788, 2789], "disallowed"], [[2790, 2799], "valid"], [[2800, 2800], "valid", [], "NV8"], [[2801, 2801], "valid", [], "NV8"], [[2802, 2808], "disallowed"], [[2809, 2809], "valid"], [[2810, 2816], "disallowed"], [[2817, 2819], "valid"], [[2820, 2820], "disallowed"], [[2821, 2828], "valid"], [[2829, 2830], "disallowed"], [[2831, 2832], "valid"], [[2833, 2834], "disallowed"], [[2835, 2856], "valid"], [[2857, 2857], "disallowed"], [[2858, 2864], "valid"], [[2865, 2865], "disallowed"], [[2866, 2867], "valid"], [[2868, 2868], "disallowed"], [[2869, 2869], "valid"], [[2870, 2873], "valid"], [[2874, 2875], "disallowed"], [[2876, 2883], "valid"], [[2884, 2884], "valid"], [[2885, 2886], "disallowed"], [[2887, 2888], "valid"], [[2889, 2890], "disallowed"], [[2891, 2893], "valid"], [[2894, 2901], "disallowed"], [[2902, 2903], "valid"], [[2904, 2907], "disallowed"], [[2908, 2908], "mapped", [2849, 2876]], [[2909, 2909], "mapped", [2850, 2876]], [[2910, 2910], "disallowed"], [[2911, 2913], "valid"], [[2914, 2915], "valid"], [[2916, 2917], "disallowed"], [[2918, 2927], "valid"], [[2928, 2928], "valid", [], "NV8"], [[2929, 2929], "valid"], [[2930, 2935], "valid", [], "NV8"], [[2936, 2945], "disallowed"], [[2946, 2947], "valid"], [[2948, 2948], "disallowed"], [[2949, 2954], "valid"], [[2955, 2957], "disallowed"], [[2958, 2960], "valid"], [[2961, 2961], "disallowed"], [[2962, 2965], "valid"], [[2966, 2968], "disallowed"], [[2969, 2970], "valid"], [[2971, 2971], "disallowed"], [[2972, 2972], "valid"], [[2973, 2973], "disallowed"], [[2974, 2975], "valid"], [[2976, 2978], "disallowed"], [[2979, 2980], "valid"], [[2981, 2983], "disallowed"], [[2984, 2986], "valid"], [[2987, 2989], "disallowed"], [[2990, 2997], "valid"], [[2998, 2998], "valid"], [[2999, 3001], "valid"], [[3002, 3005], "disallowed"], [[3006, 3010], "valid"], [[3011, 3013], "disallowed"], [[3014, 3016], "valid"], [[3017, 3017], "disallowed"], [[3018, 3021], "valid"], [[3022, 3023], "disallowed"], [[3024, 3024], "valid"], [[3025, 3030], "disallowed"], [[3031, 3031], "valid"], [[3032, 3045], "disallowed"], [[3046, 3046], "valid"], [[3047, 3055], "valid"], [[3056, 3058], "valid", [], "NV8"], [[3059, 3066], "valid", [], "NV8"], [[3067, 3071], "disallowed"], [[3072, 3072], "valid"], [[3073, 3075], "valid"], [[3076, 3076], "disallowed"], [[3077, 3084], "valid"], [[3085, 3085], "disallowed"], [[3086, 3088], "valid"], [[3089, 3089], "disallowed"], [[3090, 3112], "valid"], [[3113, 3113], "disallowed"], [[3114, 3123], "valid"], [[3124, 3124], "valid"], [[3125, 3129], "valid"], [[3130, 3132], "disallowed"], [[3133, 3133], "valid"], [[3134, 3140], "valid"], [[3141, 3141], "disallowed"], [[3142, 3144], "valid"], [[3145, 3145], "disallowed"], [[3146, 3149], "valid"], [[3150, 3156], "disallowed"], [[3157, 3158], "valid"], [[3159, 3159], "disallowed"], [[3160, 3161], "valid"], [[3162, 3162], "valid"], [[3163, 3167], "disallowed"], [[3168, 3169], "valid"], [[3170, 3171], "valid"], [[3172, 3173], "disallowed"], [[3174, 3183], "valid"], [[3184, 3191], "disallowed"], [[3192, 3199], "valid", [], "NV8"], [[3200, 3200], "disallowed"], [[3201, 3201], "valid"], [[3202, 3203], "valid"], [[3204, 3204], "disallowed"], [[3205, 3212], "valid"], [[3213, 3213], "disallowed"], [[3214, 3216], "valid"], [[3217, 3217], "disallowed"], [[3218, 3240], "valid"], [[3241, 3241], "disallowed"], [[3242, 3251], "valid"], [[3252, 3252], "disallowed"], [[3253, 3257], "valid"], [[3258, 3259], "disallowed"], [[3260, 3261], "valid"], [[3262, 3268], "valid"], [[3269, 3269], "disallowed"], [[3270, 3272], "valid"], [[3273, 3273], "disallowed"], [[3274, 3277], "valid"], [[3278, 3284], "disallowed"], [[3285, 3286], "valid"], [[3287, 3293], "disallowed"], [[3294, 3294], "valid"], [[3295, 3295], "disallowed"], [[3296, 3297], "valid"], [[3298, 3299], "valid"], [[3300, 3301], "disallowed"], [[3302, 3311], "valid"], [[3312, 3312], "disallowed"], [[3313, 3314], "valid"], [[3315, 3328], "disallowed"], [[3329, 3329], "valid"], [[3330, 3331], "valid"], [[3332, 3332], "disallowed"], [[3333, 3340], "valid"], [[3341, 3341], "disallowed"], [[3342, 3344], "valid"], [[3345, 3345], "disallowed"], [[3346, 3368], "valid"], [[3369, 3369], "valid"], [[3370, 3385], "valid"], [[3386, 3386], "valid"], [[3387, 3388], "disallowed"], [[3389, 3389], "valid"], [[3390, 3395], "valid"], [[3396, 3396], "valid"], [[3397, 3397], "disallowed"], [[3398, 3400], "valid"], [[3401, 3401], "disallowed"], [[3402, 3405], "valid"], [[3406, 3406], "valid"], [[3407, 3414], "disallowed"], [[3415, 3415], "valid"], [[3416, 3422], "disallowed"], [[3423, 3423], "valid"], [[3424, 3425], "valid"], [[3426, 3427], "valid"], [[3428, 3429], "disallowed"], [[3430, 3439], "valid"], [[3440, 3445], "valid", [], "NV8"], [[3446, 3448], "disallowed"], [[3449, 3449], "valid", [], "NV8"], [[3450, 3455], "valid"], [[3456, 3457], "disallowed"], [[3458, 3459], "valid"], [[3460, 3460], "disallowed"], [[3461, 3478], "valid"], [[3479, 3481], "disallowed"], [[3482, 3505], "valid"], [[3506, 3506], "disallowed"], [[3507, 3515], "valid"], [[3516, 3516], "disallowed"], [[3517, 3517], "valid"], [[3518, 3519], "disallowed"], [[3520, 3526], "valid"], [[3527, 3529], "disallowed"], [[3530, 3530], "valid"], [[3531, 3534], "disallowed"], [[3535, 3540], "valid"], [[3541, 3541], "disallowed"], [[3542, 3542], "valid"], [[3543, 3543], "disallowed"], [[3544, 3551], "valid"], [[3552, 3557], "disallowed"], [[3558, 3567], "valid"], [[3568, 3569], "disallowed"], [[3570, 3571], "valid"], [[3572, 3572], "valid", [], "NV8"], [[3573, 3584], "disallowed"], [[3585, 3634], "valid"], [[3635, 3635], "mapped", [3661, 3634]], [[3636, 3642], "valid"], [[3643, 3646], "disallowed"], [[3647, 3647], "valid", [], "NV8"], [[3648, 3662], "valid"], [[3663, 3663], "valid", [], "NV8"], [[3664, 3673], "valid"], [[3674, 3675], "valid", [], "NV8"], [[3676, 3712], "disallowed"], [[3713, 3714], "valid"], [[3715, 3715], "disallowed"], [[3716, 3716], "valid"], [[3717, 3718], "disallowed"], [[3719, 3720], "valid"], [[3721, 3721], "disallowed"], [[3722, 3722], "valid"], [[3723, 3724], "disallowed"], [[3725, 3725], "valid"], [[3726, 3731], "disallowed"], [[3732, 3735], "valid"], [[3736, 3736], "disallowed"], [[3737, 3743], "valid"], [[3744, 3744], "disallowed"], [[3745, 3747], "valid"], [[3748, 3748], "disallowed"], [[3749, 3749], "valid"], [[3750, 3750], "disallowed"], [[3751, 3751], "valid"], [[3752, 3753], "disallowed"], [[3754, 3755], "valid"], [[3756, 3756], "disallowed"], [[3757, 3762], "valid"], [[3763, 3763], "mapped", [3789, 3762]], [[3764, 3769], "valid"], [[3770, 3770], "disallowed"], [[3771, 3773], "valid"], [[3774, 3775], "disallowed"], [[3776, 3780], "valid"], [[3781, 3781], "disallowed"], [[3782, 3782], "valid"], [[3783, 3783], "disallowed"], [[3784, 3789], "valid"], [[3790, 3791], "disallowed"], [[3792, 3801], "valid"], [[3802, 3803], "disallowed"], [[3804, 3804], "mapped", [3755, 3737]], [[3805, 3805], "mapped", [3755, 3745]], [[3806, 3807], "valid"], [[3808, 3839], "disallowed"], [[3840, 3840], "valid"], [[3841, 3850], "valid", [], "NV8"], [[3851, 3851], "valid"], [[3852, 3852], "mapped", [3851]], [[3853, 3863], "valid", [], "NV8"], [[3864, 3865], "valid"], [[3866, 3871], "valid", [], "NV8"], [[3872, 3881], "valid"], [[3882, 3892], "valid", [], "NV8"], [[3893, 3893], "valid"], [[3894, 3894], "valid", [], "NV8"], [[3895, 3895], "valid"], [[3896, 3896], "valid", [], "NV8"], [[3897, 3897], "valid"], [[3898, 3901], "valid", [], "NV8"], [[3902, 3906], "valid"], [[3907, 3907], "mapped", [3906, 4023]], [[3908, 3911], "valid"], [[3912, 3912], "disallowed"], [[3913, 3916], "valid"], [[3917, 3917], "mapped", [3916, 4023]], [[3918, 3921], "valid"], [[3922, 3922], "mapped", [3921, 4023]], [[3923, 3926], "valid"], [[3927, 3927], "mapped", [3926, 4023]], [[3928, 3931], "valid"], [[3932, 3932], "mapped", [3931, 4023]], [[3933, 3944], "valid"], [[3945, 3945], "mapped", [3904, 4021]], [[3946, 3946], "valid"], [[3947, 3948], "valid"], [[3949, 3952], "disallowed"], [[3953, 3954], "valid"], [[3955, 3955], "mapped", [3953, 3954]], [[3956, 3956], "valid"], [[3957, 3957], "mapped", [3953, 3956]], [[3958, 3958], "mapped", [4018, 3968]], [[3959, 3959], "mapped", [4018, 3953, 3968]], [[3960, 3960], "mapped", [4019, 3968]], [[3961, 3961], "mapped", [4019, 3953, 3968]], [[3962, 3968], "valid"], [[3969, 3969], "mapped", [3953, 3968]], [[3970, 3972], "valid"], [[3973, 3973], "valid", [], "NV8"], [[3974, 3979], "valid"], [[3980, 3983], "valid"], [[3984, 3986], "valid"], [[3987, 3987], "mapped", [3986, 4023]], [[3988, 3989], "valid"], [[3990, 3990], "valid"], [[3991, 3991], "valid"], [[3992, 3992], "disallowed"], [[3993, 3996], "valid"], [[3997, 3997], "mapped", [3996, 4023]], [[3998, 4001], "valid"], [[4002, 4002], "mapped", [4001, 4023]], [[4003, 4006], "valid"], [[4007, 4007], "mapped", [4006, 4023]], [[4008, 4011], "valid"], [[4012, 4012], "mapped", [4011, 4023]], [[4013, 4013], "valid"], [[4014, 4016], "valid"], [[4017, 4023], "valid"], [[4024, 4024], "valid"], [[4025, 4025], "mapped", [3984, 4021]], [[4026, 4028], "valid"], [[4029, 4029], "disallowed"], [[4030, 4037], "valid", [], "NV8"], [[4038, 4038], "valid"], [[4039, 4044], "valid", [], "NV8"], [[4045, 4045], "disallowed"], [[4046, 4046], "valid", [], "NV8"], [[4047, 4047], "valid", [], "NV8"], [[4048, 4049], "valid", [], "NV8"], [[4050, 4052], "valid", [], "NV8"], [[4053, 4056], "valid", [], "NV8"], [[4057, 4058], "valid", [], "NV8"], [[4059, 4095], "disallowed"], [[4096, 4129], "valid"], [[4130, 4130], "valid"], [[4131, 4135], "valid"], [[4136, 4136], "valid"], [[4137, 4138], "valid"], [[4139, 4139], "valid"], [[4140, 4146], "valid"], [[4147, 4149], "valid"], [[4150, 4153], "valid"], [[4154, 4159], "valid"], [[4160, 4169], "valid"], [[4170, 4175], "valid", [], "NV8"], [[4176, 4185], "valid"], [[4186, 4249], "valid"], [[4250, 4253], "valid"], [[4254, 4255], "valid", [], "NV8"], [[4256, 4293], "disallowed"], [[4294, 4294], "disallowed"], [[4295, 4295], "mapped", [11559]], [[4296, 4300], "disallowed"], [[4301, 4301], "mapped", [11565]], [[4302, 4303], "disallowed"], [[4304, 4342], "valid"], [[4343, 4344], "valid"], [[4345, 4346], "valid"], [[4347, 4347], "valid", [], "NV8"], [[4348, 4348], "mapped", [4316]], [[4349, 4351], "valid"], [[4352, 4441], "valid", [], "NV8"], [[4442, 4446], "valid", [], "NV8"], [[4447, 4448], "disallowed"], [[4449, 4514], "valid", [], "NV8"], [[4515, 4519], "valid", [], "NV8"], [[4520, 4601], "valid", [], "NV8"], [[4602, 4607], "valid", [], "NV8"], [[4608, 4614], "valid"], [[4615, 4615], "valid"], [[4616, 4678], "valid"], [[4679, 4679], "valid"], [[4680, 4680], "valid"], [[4681, 4681], "disallowed"], [[4682, 4685], "valid"], [[4686, 4687], "disallowed"], [[4688, 4694], "valid"], [[4695, 4695], "disallowed"], [[4696, 4696], "valid"], [[4697, 4697], "disallowed"], [[4698, 4701], "valid"], [[4702, 4703], "disallowed"], [[4704, 4742], "valid"], [[4743, 4743], "valid"], [[4744, 4744], "valid"], [[4745, 4745], "disallowed"], [[4746, 4749], "valid"], [[4750, 4751], "disallowed"], [[4752, 4782], "valid"], [[4783, 4783], "valid"], [[4784, 4784], "valid"], [[4785, 4785], "disallowed"], [[4786, 4789], "valid"], [[4790, 4791], "disallowed"], [[4792, 4798], "valid"], [[4799, 4799], "disallowed"], [[4800, 4800], "valid"], [[4801, 4801], "disallowed"], [[4802, 4805], "valid"], [[4806, 4807], "disallowed"], [[4808, 4814], "valid"], [[4815, 4815], "valid"], [[4816, 4822], "valid"], [[4823, 4823], "disallowed"], [[4824, 4846], "valid"], [[4847, 4847], "valid"], [[4848, 4878], "valid"], [[4879, 4879], "valid"], [[4880, 4880], "valid"], [[4881, 4881], "disallowed"], [[4882, 4885], "valid"], [[4886, 4887], "disallowed"], [[4888, 4894], "valid"], [[4895, 4895], "valid"], [[4896, 4934], "valid"], [[4935, 4935], "valid"], [[4936, 4954], "valid"], [[4955, 4956], "disallowed"], [[4957, 4958], "valid"], [[4959, 4959], "valid"], [[4960, 4960], "valid", [], "NV8"], [[4961, 4988], "valid", [], "NV8"], [[4989, 4991], "disallowed"], [[4992, 5007], "valid"], [[5008, 5017], "valid", [], "NV8"], [[5018, 5023], "disallowed"], [[5024, 5108], "valid"], [[5109, 5109], "valid"], [[5110, 5111], "disallowed"], [[5112, 5112], "mapped", [5104]], [[5113, 5113], "mapped", [5105]], [[5114, 5114], "mapped", [5106]], [[5115, 5115], "mapped", [5107]], [[5116, 5116], "mapped", [5108]], [[5117, 5117], "mapped", [5109]], [[5118, 5119], "disallowed"], [[5120, 5120], "valid", [], "NV8"], [[5121, 5740], "valid"], [[5741, 5742], "valid", [], "NV8"], [[5743, 5750], "valid"], [[5751, 5759], "valid"], [[5760, 5760], "disallowed"], [[5761, 5786], "valid"], [[5787, 5788], "valid", [], "NV8"], [[5789, 5791], "disallowed"], [[5792, 5866], "valid"], [[5867, 5872], "valid", [], "NV8"], [[5873, 5880], "valid"], [[5881, 5887], "disallowed"], [[5888, 5900], "valid"], [[5901, 5901], "disallowed"], [[5902, 5908], "valid"], [[5909, 5919], "disallowed"], [[5920, 5940], "valid"], [[5941, 5942], "valid", [], "NV8"], [[5943, 5951], "disallowed"], [[5952, 5971], "valid"], [[5972, 5983], "disallowed"], [[5984, 5996], "valid"], [[5997, 5997], "disallowed"], [[5998, 6e3], "valid"], [[6001, 6001], "disallowed"], [[6002, 6003], "valid"], [[6004, 6015], "disallowed"], [[6016, 6067], "valid"], [[6068, 6069], "disallowed"], [[6070, 6099], "valid"], [[6100, 6102], "valid", [], "NV8"], [[6103, 6103], "valid"], [[6104, 6107], "valid", [], "NV8"], [[6108, 6108], "valid"], [[6109, 6109], "valid"], [[6110, 6111], "disallowed"], [[6112, 6121], "valid"], [[6122, 6127], "disallowed"], [[6128, 6137], "valid", [], "NV8"], [[6138, 6143], "disallowed"], [[6144, 6149], "valid", [], "NV8"], [[6150, 6150], "disallowed"], [[6151, 6154], "valid", [], "NV8"], [[6155, 6157], "ignored"], [[6158, 6158], "disallowed"], [[6159, 6159], "disallowed"], [[6160, 6169], "valid"], [[6170, 6175], "disallowed"], [[6176, 6263], "valid"], [[6264, 6271], "disallowed"], [[6272, 6313], "valid"], [[6314, 6314], "valid"], [[6315, 6319], "disallowed"], [[6320, 6389], "valid"], [[6390, 6399], "disallowed"], [[6400, 6428], "valid"], [[6429, 6430], "valid"], [[6431, 6431], "disallowed"], [[6432, 6443], "valid"], [[6444, 6447], "disallowed"], [[6448, 6459], "valid"], [[6460, 6463], "disallowed"], [[6464, 6464], "valid", [], "NV8"], [[6465, 6467], "disallowed"], [[6468, 6469], "valid", [], "NV8"], [[6470, 6509], "valid"], [[6510, 6511], "disallowed"], [[6512, 6516], "valid"], [[6517, 6527], "disallowed"], [[6528, 6569], "valid"], [[6570, 6571], "valid"], [[6572, 6575], "disallowed"], [[6576, 6601], "valid"], [[6602, 6607], "disallowed"], [[6608, 6617], "valid"], [[6618, 6618], "valid", [], "XV8"], [[6619, 6621], "disallowed"], [[6622, 6623], "valid", [], "NV8"], [[6624, 6655], "valid", [], "NV8"], [[6656, 6683], "valid"], [[6684, 6685], "disallowed"], [[6686, 6687], "valid", [], "NV8"], [[6688, 6750], "valid"], [[6751, 6751], "disallowed"], [[6752, 6780], "valid"], [[6781, 6782], "disallowed"], [[6783, 6793], "valid"], [[6794, 6799], "disallowed"], [[6800, 6809], "valid"], [[6810, 6815], "disallowed"], [[6816, 6822], "valid", [], "NV8"], [[6823, 6823], "valid"], [[6824, 6829], "valid", [], "NV8"], [[6830, 6831], "disallowed"], [[6832, 6845], "valid"], [[6846, 6846], "valid", [], "NV8"], [[6847, 6911], "disallowed"], [[6912, 6987], "valid"], [[6988, 6991], "disallowed"], [[6992, 7001], "valid"], [[7002, 7018], "valid", [], "NV8"], [[7019, 7027], "valid"], [[7028, 7036], "valid", [], "NV8"], [[7037, 7039], "disallowed"], [[7040, 7082], "valid"], [[7083, 7085], "valid"], [[7086, 7097], "valid"], [[7098, 7103], "valid"], [[7104, 7155], "valid"], [[7156, 7163], "disallowed"], [[7164, 7167], "valid", [], "NV8"], [[7168, 7223], "valid"], [[7224, 7226], "disallowed"], [[7227, 7231], "valid", [], "NV8"], [[7232, 7241], "valid"], [[7242, 7244], "disallowed"], [[7245, 7293], "valid"], [[7294, 7295], "valid", [], "NV8"], [[7296, 7359], "disallowed"], [[7360, 7367], "valid", [], "NV8"], [[7368, 7375], "disallowed"], [[7376, 7378], "valid"], [[7379, 7379], "valid", [], "NV8"], [[7380, 7410], "valid"], [[7411, 7414], "valid"], [[7415, 7415], "disallowed"], [[7416, 7417], "valid"], [[7418, 7423], "disallowed"], [[7424, 7467], "valid"], [[7468, 7468], "mapped", [97]], [[7469, 7469], "mapped", [230]], [[7470, 7470], "mapped", [98]], [[7471, 7471], "valid"], [[7472, 7472], "mapped", [100]], [[7473, 7473], "mapped", [101]], [[7474, 7474], "mapped", [477]], [[7475, 7475], "mapped", [103]], [[7476, 7476], "mapped", [104]], [[7477, 7477], "mapped", [105]], [[7478, 7478], "mapped", [106]], [[7479, 7479], "mapped", [107]], [[7480, 7480], "mapped", [108]], [[7481, 7481], "mapped", [109]], [[7482, 7482], "mapped", [110]], [[7483, 7483], "valid"], [[7484, 7484], "mapped", [111]], [[7485, 7485], "mapped", [547]], [[7486, 7486], "mapped", [112]], [[7487, 7487], "mapped", [114]], [[7488, 7488], "mapped", [116]], [[7489, 7489], "mapped", [117]], [[7490, 7490], "mapped", [119]], [[7491, 7491], "mapped", [97]], [[7492, 7492], "mapped", [592]], [[7493, 7493], "mapped", [593]], [[7494, 7494], "mapped", [7426]], [[7495, 7495], "mapped", [98]], [[7496, 7496], "mapped", [100]], [[7497, 7497], "mapped", [101]], [[7498, 7498], "mapped", [601]], [[7499, 7499], "mapped", [603]], [[7500, 7500], "mapped", [604]], [[7501, 7501], "mapped", [103]], [[7502, 7502], "valid"], [[7503, 7503], "mapped", [107]], [[7504, 7504], "mapped", [109]], [[7505, 7505], "mapped", [331]], [[7506, 7506], "mapped", [111]], [[7507, 7507], "mapped", [596]], [[7508, 7508], "mapped", [7446]], [[7509, 7509], "mapped", [7447]], [[7510, 7510], "mapped", [112]], [[7511, 7511], "mapped", [116]], [[7512, 7512], "mapped", [117]], [[7513, 7513], "mapped", [7453]], [[7514, 7514], "mapped", [623]], [[7515, 7515], "mapped", [118]], [[7516, 7516], "mapped", [7461]], [[7517, 7517], "mapped", [946]], [[7518, 7518], "mapped", [947]], [[7519, 7519], "mapped", [948]], [[7520, 7520], "mapped", [966]], [[7521, 7521], "mapped", [967]], [[7522, 7522], "mapped", [105]], [[7523, 7523], "mapped", [114]], [[7524, 7524], "mapped", [117]], [[7525, 7525], "mapped", [118]], [[7526, 7526], "mapped", [946]], [[7527, 7527], "mapped", [947]], [[7528, 7528], "mapped", [961]], [[7529, 7529], "mapped", [966]], [[7530, 7530], "mapped", [967]], [[7531, 7531], "valid"], [[7532, 7543], "valid"], [[7544, 7544], "mapped", [1085]], [[7545, 7578], "valid"], [[7579, 7579], "mapped", [594]], [[7580, 7580], "mapped", [99]], [[7581, 7581], "mapped", [597]], [[7582, 7582], "mapped", [240]], [[7583, 7583], "mapped", [604]], [[7584, 7584], "mapped", [102]], [[7585, 7585], "mapped", [607]], [[7586, 7586], "mapped", [609]], [[7587, 7587], "mapped", [613]], [[7588, 7588], "mapped", [616]], [[7589, 7589], "mapped", [617]], [[7590, 7590], "mapped", [618]], [[7591, 7591], "mapped", [7547]], [[7592, 7592], "mapped", [669]], [[7593, 7593], "mapped", [621]], [[7594, 7594], "mapped", [7557]], [[7595, 7595], "mapped", [671]], [[7596, 7596], "mapped", [625]], [[7597, 7597], "mapped", [624]], [[7598, 7598], "mapped", [626]], [[7599, 7599], "mapped", [627]], [[7600, 7600], "mapped", [628]], [[7601, 7601], "mapped", [629]], [[7602, 7602], "mapped", [632]], [[7603, 7603], "mapped", [642]], [[7604, 7604], "mapped", [643]], [[7605, 7605], "mapped", [427]], [[7606, 7606], "mapped", [649]], [[7607, 7607], "mapped", [650]], [[7608, 7608], "mapped", [7452]], [[7609, 7609], "mapped", [651]], [[7610, 7610], "mapped", [652]], [[7611, 7611], "mapped", [122]], [[7612, 7612], "mapped", [656]], [[7613, 7613], "mapped", [657]], [[7614, 7614], "mapped", [658]], [[7615, 7615], "mapped", [952]], [[7616, 7619], "valid"], [[7620, 7626], "valid"], [[7627, 7654], "valid"], [[7655, 7669], "valid"], [[7670, 7675], "disallowed"], [[7676, 7676], "valid"], [[7677, 7677], "valid"], [[7678, 7679], "valid"], [[7680, 7680], "mapped", [7681]], [[7681, 7681], "valid"], [[7682, 7682], "mapped", [7683]], [[7683, 7683], "valid"], [[7684, 7684], "mapped", [7685]], [[7685, 7685], "valid"], [[7686, 7686], "mapped", [7687]], [[7687, 7687], "valid"], [[7688, 7688], "mapped", [7689]], [[7689, 7689], "valid"], [[7690, 7690], "mapped", [7691]], [[7691, 7691], "valid"], [[7692, 7692], "mapped", [7693]], [[7693, 7693], "valid"], [[7694, 7694], "mapped", [7695]], [[7695, 7695], "valid"], [[7696, 7696], "mapped", [7697]], [[7697, 7697], "valid"], [[7698, 7698], "mapped", [7699]], [[7699, 7699], "valid"], [[7700, 7700], "mapped", [7701]], [[7701, 7701], "valid"], [[7702, 7702], "mapped", [7703]], [[7703, 7703], "valid"], [[7704, 7704], "mapped", [7705]], [[7705, 7705], "valid"], [[7706, 7706], "mapped", [7707]], [[7707, 7707], "valid"], [[7708, 7708], "mapped", [7709]], [[7709, 7709], "valid"], [[7710, 7710], "mapped", [7711]], [[7711, 7711], "valid"], [[7712, 7712], "mapped", [7713]], [[7713, 7713], "valid"], [[7714, 7714], "mapped", [7715]], [[7715, 7715], "valid"], [[7716, 7716], "mapped", [7717]], [[7717, 7717], "valid"], [[7718, 7718], "mapped", [7719]], [[7719, 7719], "valid"], [[7720, 7720], "mapped", [7721]], [[7721, 7721], "valid"], [[7722, 7722], "mapped", [7723]], [[7723, 7723], "valid"], [[7724, 7724], "mapped", [7725]], [[7725, 7725], "valid"], [[7726, 7726], "mapped", [7727]], [[7727, 7727], "valid"], [[7728, 7728], "mapped", [7729]], [[7729, 7729], "valid"], [[7730, 7730], "mapped", [7731]], [[7731, 7731], "valid"], [[7732, 7732], "mapped", [7733]], [[7733, 7733], "valid"], [[7734, 7734], "mapped", [7735]], [[7735, 7735], "valid"], [[7736, 7736], "mapped", [7737]], [[7737, 7737], "valid"], [[7738, 7738], "mapped", [7739]], [[7739, 7739], "valid"], [[7740, 7740], "mapped", [7741]], [[7741, 7741], "valid"], [[7742, 7742], "mapped", [7743]], [[7743, 7743], "valid"], [[7744, 7744], "mapped", [7745]], [[7745, 7745], "valid"], [[7746, 7746], "mapped", [7747]], [[7747, 7747], "valid"], [[7748, 7748], "mapped", [7749]], [[7749, 7749], "valid"], [[7750, 7750], "mapped", [7751]], [[7751, 7751], "valid"], [[7752, 7752], "mapped", [7753]], [[7753, 7753], "valid"], [[7754, 7754], "mapped", [7755]], [[7755, 7755], "valid"], [[7756, 7756], "mapped", [7757]], [[7757, 7757], "valid"], [[7758, 7758], "mapped", [7759]], [[7759, 7759], "valid"], [[7760, 7760], "mapped", [7761]], [[7761, 7761], "valid"], [[7762, 7762], "mapped", [7763]], [[7763, 7763], "valid"], [[7764, 7764], "mapped", [7765]], [[7765, 7765], "valid"], [[7766, 7766], "mapped", [7767]], [[7767, 7767], "valid"], [[7768, 7768], "mapped", [7769]], [[7769, 7769], "valid"], [[7770, 7770], "mapped", [7771]], [[7771, 7771], "valid"], [[7772, 7772], "mapped", [7773]], [[7773, 7773], "valid"], [[7774, 7774], "mapped", [7775]], [[7775, 7775], "valid"], [[7776, 7776], "mapped", [7777]], [[7777, 7777], "valid"], [[7778, 7778], "mapped", [7779]], [[7779, 7779], "valid"], [[7780, 7780], "mapped", [7781]], [[7781, 7781], "valid"], [[7782, 7782], "mapped", [7783]], [[7783, 7783], "valid"], [[7784, 7784], "mapped", [7785]], [[7785, 7785], "valid"], [[7786, 7786], "mapped", [7787]], [[7787, 7787], "valid"], [[7788, 7788], "mapped", [7789]], [[7789, 7789], "valid"], [[7790, 7790], "mapped", [7791]], [[7791, 7791], "valid"], [[7792, 7792], "mapped", [7793]], [[7793, 7793], "valid"], [[7794, 7794], "mapped", [7795]], [[7795, 7795], "valid"], [[7796, 7796], "mapped", [7797]], [[7797, 7797], "valid"], [[7798, 7798], "mapped", [7799]], [[7799, 7799], "valid"], [[7800, 7800], "mapped", [7801]], [[7801, 7801], "valid"], [[7802, 7802], "mapped", [7803]], [[7803, 7803], "valid"], [[7804, 7804], "mapped", [7805]], [[7805, 7805], "valid"], [[7806, 7806], "mapped", [7807]], [[7807, 7807], "valid"], [[7808, 7808], "mapped", [7809]], [[7809, 7809], "valid"], [[7810, 7810], "mapped", [7811]], [[7811, 7811], "valid"], [[7812, 7812], "mapped", [7813]], [[7813, 7813], "valid"], [[7814, 7814], "mapped", [7815]], [[7815, 7815], "valid"], [[7816, 7816], "mapped", [7817]], [[7817, 7817], "valid"], [[7818, 7818], "mapped", [7819]], [[7819, 7819], "valid"], [[7820, 7820], "mapped", [7821]], [[7821, 7821], "valid"], [[7822, 7822], "mapped", [7823]], [[7823, 7823], "valid"], [[7824, 7824], "mapped", [7825]], [[7825, 7825], "valid"], [[7826, 7826], "mapped", [7827]], [[7827, 7827], "valid"], [[7828, 7828], "mapped", [7829]], [[7829, 7833], "valid"], [[7834, 7834], "mapped", [97, 702]], [[7835, 7835], "mapped", [7777]], [[7836, 7837], "valid"], [[7838, 7838], "mapped", [115, 115]], [[7839, 7839], "valid"], [[7840, 7840], "mapped", [7841]], [[7841, 7841], "valid"], [[7842, 7842], "mapped", [7843]], [[7843, 7843], "valid"], [[7844, 7844], "mapped", [7845]], [[7845, 7845], "valid"], [[7846, 7846], "mapped", [7847]], [[7847, 7847], "valid"], [[7848, 7848], "mapped", [7849]], [[7849, 7849], "valid"], [[7850, 7850], "mapped", [7851]], [[7851, 7851], "valid"], [[7852, 7852], "mapped", [7853]], [[7853, 7853], "valid"], [[7854, 7854], "mapped", [7855]], [[7855, 7855], "valid"], [[7856, 7856], "mapped", [7857]], [[7857, 7857], "valid"], [[7858, 7858], "mapped", [7859]], [[7859, 7859], "valid"], [[7860, 7860], "mapped", [7861]], [[7861, 7861], "valid"], [[7862, 7862], "mapped", [7863]], [[7863, 7863], "valid"], [[7864, 7864], "mapped", [7865]], [[7865, 7865], "valid"], [[7866, 7866], "mapped", [7867]], [[7867, 7867], "valid"], [[7868, 7868], "mapped", [7869]], [[7869, 7869], "valid"], [[7870, 7870], "mapped", [7871]], [[7871, 7871], "valid"], [[7872, 7872], "mapped", [7873]], [[7873, 7873], "valid"], [[7874, 7874], "mapped", [7875]], [[7875, 7875], "valid"], [[7876, 7876], "mapped", [7877]], [[7877, 7877], "valid"], [[7878, 7878], "mapped", [7879]], [[7879, 7879], "valid"], [[7880, 7880], "mapped", [7881]], [[7881, 7881], "valid"], [[7882, 7882], "mapped", [7883]], [[7883, 7883], "valid"], [[7884, 7884], "mapped", [7885]], [[7885, 7885], "valid"], [[7886, 7886], "mapped", [7887]], [[7887, 7887], "valid"], [[7888, 7888], "mapped", [7889]], [[7889, 7889], "valid"], [[7890, 7890], "mapped", [7891]], [[7891, 7891], "valid"], [[7892, 7892], "mapped", [7893]], [[7893, 7893], "valid"], [[7894, 7894], "mapped", [7895]], [[7895, 7895], "valid"], [[7896, 7896], "mapped", [7897]], [[7897, 7897], "valid"], [[7898, 7898], "mapped", [7899]], [[7899, 7899], "valid"], [[7900, 7900], "mapped", [7901]], [[7901, 7901], "valid"], [[7902, 7902], "mapped", [7903]], [[7903, 7903], "valid"], [[7904, 7904], "mapped", [7905]], [[7905, 7905], "valid"], [[7906, 7906], "mapped", [7907]], [[7907, 7907], "valid"], [[7908, 7908], "mapped", [7909]], [[7909, 7909], "valid"], [[7910, 7910], "mapped", [7911]], [[7911, 7911], "valid"], [[7912, 7912], "mapped", [7913]], [[7913, 7913], "valid"], [[7914, 7914], "mapped", [7915]], [[7915, 7915], "valid"], [[7916, 7916], "mapped", [7917]], [[7917, 7917], "valid"], [[7918, 7918], "mapped", [7919]], [[7919, 7919], "valid"], [[7920, 7920], "mapped", [7921]], [[7921, 7921], "valid"], [[7922, 7922], "mapped", [7923]], [[7923, 7923], "valid"], [[7924, 7924], "mapped", [7925]], [[7925, 7925], "valid"], [[7926, 7926], "mapped", [7927]], [[7927, 7927], "valid"], [[7928, 7928], "mapped", [7929]], [[7929, 7929], "valid"], [[7930, 7930], "mapped", [7931]], [[7931, 7931], "valid"], [[7932, 7932], "mapped", [7933]], [[7933, 7933], "valid"], [[7934, 7934], "mapped", [7935]], [[7935, 7935], "valid"], [[7936, 7943], "valid"], [[7944, 7944], "mapped", [7936]], [[7945, 7945], "mapped", [7937]], [[7946, 7946], "mapped", [7938]], [[7947, 7947], "mapped", [7939]], [[7948, 7948], "mapped", [7940]], [[7949, 7949], "mapped", [7941]], [[7950, 7950], "mapped", [7942]], [[7951, 7951], "mapped", [7943]], [[7952, 7957], "valid"], [[7958, 7959], "disallowed"], [[7960, 7960], "mapped", [7952]], [[7961, 7961], "mapped", [7953]], [[7962, 7962], "mapped", [7954]], [[7963, 7963], "mapped", [7955]], [[7964, 7964], "mapped", [7956]], [[7965, 7965], "mapped", [7957]], [[7966, 7967], "disallowed"], [[7968, 7975], "valid"], [[7976, 7976], "mapped", [7968]], [[7977, 7977], "mapped", [7969]], [[7978, 7978], "mapped", [7970]], [[7979, 7979], "mapped", [7971]], [[7980, 7980], "mapped", [7972]], [[7981, 7981], "mapped", [7973]], [[7982, 7982], "mapped", [7974]], [[7983, 7983], "mapped", [7975]], [[7984, 7991], "valid"], [[7992, 7992], "mapped", [7984]], [[7993, 7993], "mapped", [7985]], [[7994, 7994], "mapped", [7986]], [[7995, 7995], "mapped", [7987]], [[7996, 7996], "mapped", [7988]], [[7997, 7997], "mapped", [7989]], [[7998, 7998], "mapped", [7990]], [[7999, 7999], "mapped", [7991]], [[8e3, 8005], "valid"], [[8006, 8007], "disallowed"], [[8008, 8008], "mapped", [8e3]], [[8009, 8009], "mapped", [8001]], [[8010, 8010], "mapped", [8002]], [[8011, 8011], "mapped", [8003]], [[8012, 8012], "mapped", [8004]], [[8013, 8013], "mapped", [8005]], [[8014, 8015], "disallowed"], [[8016, 8023], "valid"], [[8024, 8024], "disallowed"], [[8025, 8025], "mapped", [8017]], [[8026, 8026], "disallowed"], [[8027, 8027], "mapped", [8019]], [[8028, 8028], "disallowed"], [[8029, 8029], "mapped", [8021]], [[8030, 8030], "disallowed"], [[8031, 8031], "mapped", [8023]], [[8032, 8039], "valid"], [[8040, 8040], "mapped", [8032]], [[8041, 8041], "mapped", [8033]], [[8042, 8042], "mapped", [8034]], [[8043, 8043], "mapped", [8035]], [[8044, 8044], "mapped", [8036]], [[8045, 8045], "mapped", [8037]], [[8046, 8046], "mapped", [8038]], [[8047, 8047], "mapped", [8039]], [[8048, 8048], "valid"], [[8049, 8049], "mapped", [940]], [[8050, 8050], "valid"], [[8051, 8051], "mapped", [941]], [[8052, 8052], "valid"], [[8053, 8053], "mapped", [942]], [[8054, 8054], "valid"], [[8055, 8055], "mapped", [943]], [[8056, 8056], "valid"], [[8057, 8057], "mapped", [972]], [[8058, 8058], "valid"], [[8059, 8059], "mapped", [973]], [[8060, 8060], "valid"], [[8061, 8061], "mapped", [974]], [[8062, 8063], "disallowed"], [[8064, 8064], "mapped", [7936, 953]], [[8065, 8065], "mapped", [7937, 953]], [[8066, 8066], "mapped", [7938, 953]], [[8067, 8067], "mapped", [7939, 953]], [[8068, 8068], "mapped", [7940, 953]], [[8069, 8069], "mapped", [7941, 953]], [[8070, 8070], "mapped", [7942, 953]], [[8071, 8071], "mapped", [7943, 953]], [[8072, 8072], "mapped", [7936, 953]], [[8073, 8073], "mapped", [7937, 953]], [[8074, 8074], "mapped", [7938, 953]], [[8075, 8075], "mapped", [7939, 953]], [[8076, 8076], "mapped", [7940, 953]], [[8077, 8077], "mapped", [7941, 953]], [[8078, 8078], "mapped", [7942, 953]], [[8079, 8079], "mapped", [7943, 953]], [[8080, 8080], "mapped", [7968, 953]], [[8081, 8081], "mapped", [7969, 953]], [[8082, 8082], "mapped", [7970, 953]], [[8083, 8083], "mapped", [7971, 953]], [[8084, 8084], "mapped", [7972, 953]], [[8085, 8085], "mapped", [7973, 953]], [[8086, 8086], "mapped", [7974, 953]], [[8087, 8087], "mapped", [7975, 953]], [[8088, 8088], "mapped", [7968, 953]], [[8089, 8089], "mapped", [7969, 953]], [[8090, 8090], "mapped", [7970, 953]], [[8091, 8091], "mapped", [7971, 953]], [[8092, 8092], "mapped", [7972, 953]], [[8093, 8093], "mapped", [7973, 953]], [[8094, 8094], "mapped", [7974, 953]], [[8095, 8095], "mapped", [7975, 953]], [[8096, 8096], "mapped", [8032, 953]], [[8097, 8097], "mapped", [8033, 953]], [[8098, 8098], "mapped", [8034, 953]], [[8099, 8099], "mapped", [8035, 953]], [[8100, 8100], "mapped", [8036, 953]], [[8101, 8101], "mapped", [8037, 953]], [[8102, 8102], "mapped", [8038, 953]], [[8103, 8103], "mapped", [8039, 953]], [[8104, 8104], "mapped", [8032, 953]], [[8105, 8105], "mapped", [8033, 953]], [[8106, 8106], "mapped", [8034, 953]], [[8107, 8107], "mapped", [8035, 953]], [[8108, 8108], "mapped", [8036, 953]], [[8109, 8109], "mapped", [8037, 953]], [[8110, 8110], "mapped", [8038, 953]], [[8111, 8111], "mapped", [8039, 953]], [[8112, 8113], "valid"], [[8114, 8114], "mapped", [8048, 953]], [[8115, 8115], "mapped", [945, 953]], [[8116, 8116], "mapped", [940, 953]], [[8117, 8117], "disallowed"], [[8118, 8118], "valid"], [[8119, 8119], "mapped", [8118, 953]], [[8120, 8120], "mapped", [8112]], [[8121, 8121], "mapped", [8113]], [[8122, 8122], "mapped", [8048]], [[8123, 8123], "mapped", [940]], [[8124, 8124], "mapped", [945, 953]], [[8125, 8125], "disallowed_STD3_mapped", [32, 787]], [[8126, 8126], "mapped", [953]], [[8127, 8127], "disallowed_STD3_mapped", [32, 787]], [[8128, 8128], "disallowed_STD3_mapped", [32, 834]], [[8129, 8129], "disallowed_STD3_mapped", [32, 776, 834]], [[8130, 8130], "mapped", [8052, 953]], [[8131, 8131], "mapped", [951, 953]], [[8132, 8132], "mapped", [942, 953]], [[8133, 8133], "disallowed"], [[8134, 8134], "valid"], [[8135, 8135], "mapped", [8134, 953]], [[8136, 8136], "mapped", [8050]], [[8137, 8137], "mapped", [941]], [[8138, 8138], "mapped", [8052]], [[8139, 8139], "mapped", [942]], [[8140, 8140], "mapped", [951, 953]], [[8141, 8141], "disallowed_STD3_mapped", [32, 787, 768]], [[8142, 8142], "disallowed_STD3_mapped", [32, 787, 769]], [[8143, 8143], "disallowed_STD3_mapped", [32, 787, 834]], [[8144, 8146], "valid"], [[8147, 8147], "mapped", [912]], [[8148, 8149], "disallowed"], [[8150, 8151], "valid"], [[8152, 8152], "mapped", [8144]], [[8153, 8153], "mapped", [8145]], [[8154, 8154], "mapped", [8054]], [[8155, 8155], "mapped", [943]], [[8156, 8156], "disallowed"], [[8157, 8157], "disallowed_STD3_mapped", [32, 788, 768]], [[8158, 8158], "disallowed_STD3_mapped", [32, 788, 769]], [[8159, 8159], "disallowed_STD3_mapped", [32, 788, 834]], [[8160, 8162], "valid"], [[8163, 8163], "mapped", [944]], [[8164, 8167], "valid"], [[8168, 8168], "mapped", [8160]], [[8169, 8169], "mapped", [8161]], [[8170, 8170], "mapped", [8058]], [[8171, 8171], "mapped", [973]], [[8172, 8172], "mapped", [8165]], [[8173, 8173], "disallowed_STD3_mapped", [32, 776, 768]], [[8174, 8174], "disallowed_STD3_mapped", [32, 776, 769]], [[8175, 8175], "disallowed_STD3_mapped", [96]], [[8176, 8177], "disallowed"], [[8178, 8178], "mapped", [8060, 953]], [[8179, 8179], "mapped", [969, 953]], [[8180, 8180], "mapped", [974, 953]], [[8181, 8181], "disallowed"], [[8182, 8182], "valid"], [[8183, 8183], "mapped", [8182, 953]], [[8184, 8184], "mapped", [8056]], [[8185, 8185], "mapped", [972]], [[8186, 8186], "mapped", [8060]], [[8187, 8187], "mapped", [974]], [[8188, 8188], "mapped", [969, 953]], [[8189, 8189], "disallowed_STD3_mapped", [32, 769]], [[8190, 8190], "disallowed_STD3_mapped", [32, 788]], [[8191, 8191], "disallowed"], [[8192, 8202], "disallowed_STD3_mapped", [32]], [[8203, 8203], "ignored"], [[8204, 8205], "deviation", []], [[8206, 8207], "disallowed"], [[8208, 8208], "valid", [], "NV8"], [[8209, 8209], "mapped", [8208]], [[8210, 8214], "valid", [], "NV8"], [[8215, 8215], "disallowed_STD3_mapped", [32, 819]], [[8216, 8227], "valid", [], "NV8"], [[8228, 8230], "disallowed"], [[8231, 8231], "valid", [], "NV8"], [[8232, 8238], "disallowed"], [[8239, 8239], "disallowed_STD3_mapped", [32]], [[8240, 8242], "valid", [], "NV8"], [[8243, 8243], "mapped", [8242, 8242]], [[8244, 8244], "mapped", [8242, 8242, 8242]], [[8245, 8245], "valid", [], "NV8"], [[8246, 8246], "mapped", [8245, 8245]], [[8247, 8247], "mapped", [8245, 8245, 8245]], [[8248, 8251], "valid", [], "NV8"], [[8252, 8252], "disallowed_STD3_mapped", [33, 33]], [[8253, 8253], "valid", [], "NV8"], [[8254, 8254], "disallowed_STD3_mapped", [32, 773]], [[8255, 8262], "valid", [], "NV8"], [[8263, 8263], "disallowed_STD3_mapped", [63, 63]], [[8264, 8264], "disallowed_STD3_mapped", [63, 33]], [[8265, 8265], "disallowed_STD3_mapped", [33, 63]], [[8266, 8269], "valid", [], "NV8"], [[8270, 8274], "valid", [], "NV8"], [[8275, 8276], "valid", [], "NV8"], [[8277, 8278], "valid", [], "NV8"], [[8279, 8279], "mapped", [8242, 8242, 8242, 8242]], [[8280, 8286], "valid", [], "NV8"], [[8287, 8287], "disallowed_STD3_mapped", [32]], [[8288, 8288], "ignored"], [[8289, 8291], "disallowed"], [[8292, 8292], "ignored"], [[8293, 8293], "disallowed"], [[8294, 8297], "disallowed"], [[8298, 8303], "disallowed"], [[8304, 8304], "mapped", [48]], [[8305, 8305], "mapped", [105]], [[8306, 8307], "disallowed"], [[8308, 8308], "mapped", [52]], [[8309, 8309], "mapped", [53]], [[8310, 8310], "mapped", [54]], [[8311, 8311], "mapped", [55]], [[8312, 8312], "mapped", [56]], [[8313, 8313], "mapped", [57]], [[8314, 8314], "disallowed_STD3_mapped", [43]], [[8315, 8315], "mapped", [8722]], [[8316, 8316], "disallowed_STD3_mapped", [61]], [[8317, 8317], "disallowed_STD3_mapped", [40]], [[8318, 8318], "disallowed_STD3_mapped", [41]], [[8319, 8319], "mapped", [110]], [[8320, 8320], "mapped", [48]], [[8321, 8321], "mapped", [49]], [[8322, 8322], "mapped", [50]], [[8323, 8323], "mapped", [51]], [[8324, 8324], "mapped", [52]], [[8325, 8325], "mapped", [53]], [[8326, 8326], "mapped", [54]], [[8327, 8327], "mapped", [55]], [[8328, 8328], "mapped", [56]], [[8329, 8329], "mapped", [57]], [[8330, 8330], "disallowed_STD3_mapped", [43]], [[8331, 8331], "mapped", [8722]], [[8332, 8332], "disallowed_STD3_mapped", [61]], [[8333, 8333], "disallowed_STD3_mapped", [40]], [[8334, 8334], "disallowed_STD3_mapped", [41]], [[8335, 8335], "disallowed"], [[8336, 8336], "mapped", [97]], [[8337, 8337], "mapped", [101]], [[8338, 8338], "mapped", [111]], [[8339, 8339], "mapped", [120]], [[8340, 8340], "mapped", [601]], [[8341, 8341], "mapped", [104]], [[8342, 8342], "mapped", [107]], [[8343, 8343], "mapped", [108]], [[8344, 8344], "mapped", [109]], [[8345, 8345], "mapped", [110]], [[8346, 8346], "mapped", [112]], [[8347, 8347], "mapped", [115]], [[8348, 8348], "mapped", [116]], [[8349, 8351], "disallowed"], [[8352, 8359], "valid", [], "NV8"], [[8360, 8360], "mapped", [114, 115]], [[8361, 8362], "valid", [], "NV8"], [[8363, 8363], "valid", [], "NV8"], [[8364, 8364], "valid", [], "NV8"], [[8365, 8367], "valid", [], "NV8"], [[8368, 8369], "valid", [], "NV8"], [[8370, 8373], "valid", [], "NV8"], [[8374, 8376], "valid", [], "NV8"], [[8377, 8377], "valid", [], "NV8"], [[8378, 8378], "valid", [], "NV8"], [[8379, 8381], "valid", [], "NV8"], [[8382, 8382], "valid", [], "NV8"], [[8383, 8399], "disallowed"], [[8400, 8417], "valid", [], "NV8"], [[8418, 8419], "valid", [], "NV8"], [[8420, 8426], "valid", [], "NV8"], [[8427, 8427], "valid", [], "NV8"], [[8428, 8431], "valid", [], "NV8"], [[8432, 8432], "valid", [], "NV8"], [[8433, 8447], "disallowed"], [[8448, 8448], "disallowed_STD3_mapped", [97, 47, 99]], [[8449, 8449], "disallowed_STD3_mapped", [97, 47, 115]], [[8450, 8450], "mapped", [99]], [[8451, 8451], "mapped", [176, 99]], [[8452, 8452], "valid", [], "NV8"], [[8453, 8453], "disallowed_STD3_mapped", [99, 47, 111]], [[8454, 8454], "disallowed_STD3_mapped", [99, 47, 117]], [[8455, 8455], "mapped", [603]], [[8456, 8456], "valid", [], "NV8"], [[8457, 8457], "mapped", [176, 102]], [[8458, 8458], "mapped", [103]], [[8459, 8462], "mapped", [104]], [[8463, 8463], "mapped", [295]], [[8464, 8465], "mapped", [105]], [[8466, 8467], "mapped", [108]], [[8468, 8468], "valid", [], "NV8"], [[8469, 8469], "mapped", [110]], [[8470, 8470], "mapped", [110, 111]], [[8471, 8472], "valid", [], "NV8"], [[8473, 8473], "mapped", [112]], [[8474, 8474], "mapped", [113]], [[8475, 8477], "mapped", [114]], [[8478, 8479], "valid", [], "NV8"], [[8480, 8480], "mapped", [115, 109]], [[8481, 8481], "mapped", [116, 101, 108]], [[8482, 8482], "mapped", [116, 109]], [[8483, 8483], "valid", [], "NV8"], [[8484, 8484], "mapped", [122]], [[8485, 8485], "valid", [], "NV8"], [[8486, 8486], "mapped", [969]], [[8487, 8487], "valid", [], "NV8"], [[8488, 8488], "mapped", [122]], [[8489, 8489], "valid", [], "NV8"], [[8490, 8490], "mapped", [107]], [[8491, 8491], "mapped", [229]], [[8492, 8492], "mapped", [98]], [[8493, 8493], "mapped", [99]], [[8494, 8494], "valid", [], "NV8"], [[8495, 8496], "mapped", [101]], [[8497, 8497], "mapped", [102]], [[8498, 8498], "disallowed"], [[8499, 8499], "mapped", [109]], [[8500, 8500], "mapped", [111]], [[8501, 8501], "mapped", [1488]], [[8502, 8502], "mapped", [1489]], [[8503, 8503], "mapped", [1490]], [[8504, 8504], "mapped", [1491]], [[8505, 8505], "mapped", [105]], [[8506, 8506], "valid", [], "NV8"], [[8507, 8507], "mapped", [102, 97, 120]], [[8508, 8508], "mapped", [960]], [[8509, 8510], "mapped", [947]], [[8511, 8511], "mapped", [960]], [[8512, 8512], "mapped", [8721]], [[8513, 8516], "valid", [], "NV8"], [[8517, 8518], "mapped", [100]], [[8519, 8519], "mapped", [101]], [[8520, 8520], "mapped", [105]], [[8521, 8521], "mapped", [106]], [[8522, 8523], "valid", [], "NV8"], [[8524, 8524], "valid", [], "NV8"], [[8525, 8525], "valid", [], "NV8"], [[8526, 8526], "valid"], [[8527, 8527], "valid", [], "NV8"], [[8528, 8528], "mapped", [49, 8260, 55]], [[8529, 8529], "mapped", [49, 8260, 57]], [[8530, 8530], "mapped", [49, 8260, 49, 48]], [[8531, 8531], "mapped", [49, 8260, 51]], [[8532, 8532], "mapped", [50, 8260, 51]], [[8533, 8533], "mapped", [49, 8260, 53]], [[8534, 8534], "mapped", [50, 8260, 53]], [[8535, 8535], "mapped", [51, 8260, 53]], [[8536, 8536], "mapped", [52, 8260, 53]], [[8537, 8537], "mapped", [49, 8260, 54]], [[8538, 8538], "mapped", [53, 8260, 54]], [[8539, 8539], "mapped", [49, 8260, 56]], [[8540, 8540], "mapped", [51, 8260, 56]], [[8541, 8541], "mapped", [53, 8260, 56]], [[8542, 8542], "mapped", [55, 8260, 56]], [[8543, 8543], "mapped", [49, 8260]], [[8544, 8544], "mapped", [105]], [[8545, 8545], "mapped", [105, 105]], [[8546, 8546], "mapped", [105, 105, 105]], [[8547, 8547], "mapped", [105, 118]], [[8548, 8548], "mapped", [118]], [[8549, 8549], "mapped", [118, 105]], [[8550, 8550], "mapped", [118, 105, 105]], [[8551, 8551], "mapped", [118, 105, 105, 105]], [[8552, 8552], "mapped", [105, 120]], [[8553, 8553], "mapped", [120]], [[8554, 8554], "mapped", [120, 105]], [[8555, 8555], "mapped", [120, 105, 105]], [[8556, 8556], "mapped", [108]], [[8557, 8557], "mapped", [99]], [[8558, 8558], "mapped", [100]], [[8559, 8559], "mapped", [109]], [[8560, 8560], "mapped", [105]], [[8561, 8561], "mapped", [105, 105]], [[8562, 8562], "mapped", [105, 105, 105]], [[8563, 8563], "mapped", [105, 118]], [[8564, 8564], "mapped", [118]], [[8565, 8565], "mapped", [118, 105]], [[8566, 8566], "mapped", [118, 105, 105]], [[8567, 8567], "mapped", [118, 105, 105, 105]], [[8568, 8568], "mapped", [105, 120]], [[8569, 8569], "mapped", [120]], [[8570, 8570], "mapped", [120, 105]], [[8571, 8571], "mapped", [120, 105, 105]], [[8572, 8572], "mapped", [108]], [[8573, 8573], "mapped", [99]], [[8574, 8574], "mapped", [100]], [[8575, 8575], "mapped", [109]], [[8576, 8578], "valid", [], "NV8"], [[8579, 8579], "disallowed"], [[8580, 8580], "valid"], [[8581, 8584], "valid", [], "NV8"], [[8585, 8585], "mapped", [48, 8260, 51]], [[8586, 8587], "valid", [], "NV8"], [[8588, 8591], "disallowed"], [[8592, 8682], "valid", [], "NV8"], [[8683, 8691], "valid", [], "NV8"], [[8692, 8703], "valid", [], "NV8"], [[8704, 8747], "valid", [], "NV8"], [[8748, 8748], "mapped", [8747, 8747]], [[8749, 8749], "mapped", [8747, 8747, 8747]], [[8750, 8750], "valid", [], "NV8"], [[8751, 8751], "mapped", [8750, 8750]], [[8752, 8752], "mapped", [8750, 8750, 8750]], [[8753, 8799], "valid", [], "NV8"], [[8800, 8800], "disallowed_STD3_valid"], [[8801, 8813], "valid", [], "NV8"], [[8814, 8815], "disallowed_STD3_valid"], [[8816, 8945], "valid", [], "NV8"], [[8946, 8959], "valid", [], "NV8"], [[8960, 8960], "valid", [], "NV8"], [[8961, 8961], "valid", [], "NV8"], [[8962, 9e3], "valid", [], "NV8"], [[9001, 9001], "mapped", [12296]], [[9002, 9002], "mapped", [12297]], [[9003, 9082], "valid", [], "NV8"], [[9083, 9083], "valid", [], "NV8"], [[9084, 9084], "valid", [], "NV8"], [[9085, 9114], "valid", [], "NV8"], [[9115, 9166], "valid", [], "NV8"], [[9167, 9168], "valid", [], "NV8"], [[9169, 9179], "valid", [], "NV8"], [[9180, 9191], "valid", [], "NV8"], [[9192, 9192], "valid", [], "NV8"], [[9193, 9203], "valid", [], "NV8"], [[9204, 9210], "valid", [], "NV8"], [[9211, 9215], "disallowed"], [[9216, 9252], "valid", [], "NV8"], [[9253, 9254], "valid", [], "NV8"], [[9255, 9279], "disallowed"], [[9280, 9290], "valid", [], "NV8"], [[9291, 9311], "disallowed"], [[9312, 9312], "mapped", [49]], [[9313, 9313], "mapped", [50]], [[9314, 9314], "mapped", [51]], [[9315, 9315], "mapped", [52]], [[9316, 9316], "mapped", [53]], [[9317, 9317], "mapped", [54]], [[9318, 9318], "mapped", [55]], [[9319, 9319], "mapped", [56]], [[9320, 9320], "mapped", [57]], [[9321, 9321], "mapped", [49, 48]], [[9322, 9322], "mapped", [49, 49]], [[9323, 9323], "mapped", [49, 50]], [[9324, 9324], "mapped", [49, 51]], [[9325, 9325], "mapped", [49, 52]], [[9326, 9326], "mapped", [49, 53]], [[9327, 9327], "mapped", [49, 54]], [[9328, 9328], "mapped", [49, 55]], [[9329, 9329], "mapped", [49, 56]], [[9330, 9330], "mapped", [49, 57]], [[9331, 9331], "mapped", [50, 48]], [[9332, 9332], "disallowed_STD3_mapped", [40, 49, 41]], [[9333, 9333], "disallowed_STD3_mapped", [40, 50, 41]], [[9334, 9334], "disallowed_STD3_mapped", [40, 51, 41]], [[9335, 9335], "disallowed_STD3_mapped", [40, 52, 41]], [[9336, 9336], "disallowed_STD3_mapped", [40, 53, 41]], [[9337, 9337], "disallowed_STD3_mapped", [40, 54, 41]], [[9338, 9338], "disallowed_STD3_mapped", [40, 55, 41]], [[9339, 9339], "disallowed_STD3_mapped", [40, 56, 41]], [[9340, 9340], "disallowed_STD3_mapped", [40, 57, 41]], [[9341, 9341], "disallowed_STD3_mapped", [40, 49, 48, 41]], [[9342, 9342], "disallowed_STD3_mapped", [40, 49, 49, 41]], [[9343, 9343], "disallowed_STD3_mapped", [40, 49, 50, 41]], [[9344, 9344], "disallowed_STD3_mapped", [40, 49, 51, 41]], [[9345, 9345], "disallowed_STD3_mapped", [40, 49, 52, 41]], [[9346, 9346], "disallowed_STD3_mapped", [40, 49, 53, 41]], [[9347, 9347], "disallowed_STD3_mapped", [40, 49, 54, 41]], [[9348, 9348], "disallowed_STD3_mapped", [40, 49, 55, 41]], [[9349, 9349], "disallowed_STD3_mapped", [40, 49, 56, 41]], [[9350, 9350], "disallowed_STD3_mapped", [40, 49, 57, 41]], [[9351, 9351], "disallowed_STD3_mapped", [40, 50, 48, 41]], [[9352, 9371], "disallowed"], [[9372, 9372], "disallowed_STD3_mapped", [40, 97, 41]], [[9373, 9373], "disallowed_STD3_mapped", [40, 98, 41]], [[9374, 9374], "disallowed_STD3_mapped", [40, 99, 41]], [[9375, 9375], "disallowed_STD3_mapped", [40, 100, 41]], [[9376, 9376], "disallowed_STD3_mapped", [40, 101, 41]], [[9377, 9377], "disallowed_STD3_mapped", [40, 102, 41]], [[9378, 9378], "disallowed_STD3_mapped", [40, 103, 41]], [[9379, 9379], "disallowed_STD3_mapped", [40, 104, 41]], [[9380, 9380], "disallowed_STD3_mapped", [40, 105, 41]], [[9381, 9381], "disallowed_STD3_mapped", [40, 106, 41]], [[9382, 9382], "disallowed_STD3_mapped", [40, 107, 41]], [[9383, 9383], "disallowed_STD3_mapped", [40, 108, 41]], [[9384, 9384], "disallowed_STD3_mapped", [40, 109, 41]], [[9385, 9385], "disallowed_STD3_mapped", [40, 110, 41]], [[9386, 9386], "disallowed_STD3_mapped", [40, 111, 41]], [[9387, 9387], "disallowed_STD3_mapped", [40, 112, 41]], [[9388, 9388], "disallowed_STD3_mapped", [40, 113, 41]], [[9389, 9389], "disallowed_STD3_mapped", [40, 114, 41]], [[9390, 9390], "disallowed_STD3_mapped", [40, 115, 41]], [[9391, 9391], "disallowed_STD3_mapped", [40, 116, 41]], [[9392, 9392], "disallowed_STD3_mapped", [40, 117, 41]], [[9393, 9393], "disallowed_STD3_mapped", [40, 118, 41]], [[9394, 9394], "disallowed_STD3_mapped", [40, 119, 41]], [[9395, 9395], "disallowed_STD3_mapped", [40, 120, 41]], [[9396, 9396], "disallowed_STD3_mapped", [40, 121, 41]], [[9397, 9397], "disallowed_STD3_mapped", [40, 122, 41]], [[9398, 9398], "mapped", [97]], [[9399, 9399], "mapped", [98]], [[9400, 9400], "mapped", [99]], [[9401, 9401], "mapped", [100]], [[9402, 9402], "mapped", [101]], [[9403, 9403], "mapped", [102]], [[9404, 9404], "mapped", [103]], [[9405, 9405], "mapped", [104]], [[9406, 9406], "mapped", [105]], [[9407, 9407], "mapped", [106]], [[9408, 9408], "mapped", [107]], [[9409, 9409], "mapped", [108]], [[9410, 9410], "mapped", [109]], [[9411, 9411], "mapped", [110]], [[9412, 9412], "mapped", [111]], [[9413, 9413], "mapped", [112]], [[9414, 9414], "mapped", [113]], [[9415, 9415], "mapped", [114]], [[9416, 9416], "mapped", [115]], [[9417, 9417], "mapped", [116]], [[9418, 9418], "mapped", [117]], [[9419, 9419], "mapped", [118]], [[9420, 9420], "mapped", [119]], [[9421, 9421], "mapped", [120]], [[9422, 9422], "mapped", [121]], [[9423, 9423], "mapped", [122]], [[9424, 9424], "mapped", [97]], [[9425, 9425], "mapped", [98]], [[9426, 9426], "mapped", [99]], [[9427, 9427], "mapped", [100]], [[9428, 9428], "mapped", [101]], [[9429, 9429], "mapped", [102]], [[9430, 9430], "mapped", [103]], [[9431, 9431], "mapped", [104]], [[9432, 9432], "mapped", [105]], [[9433, 9433], "mapped", [106]], [[9434, 9434], "mapped", [107]], [[9435, 9435], "mapped", [108]], [[9436, 9436], "mapped", [109]], [[9437, 9437], "mapped", [110]], [[9438, 9438], "mapped", [111]], [[9439, 9439], "mapped", [112]], [[9440, 9440], "mapped", [113]], [[9441, 9441], "mapped", [114]], [[9442, 9442], "mapped", [115]], [[9443, 9443], "mapped", [116]], [[9444, 9444], "mapped", [117]], [[9445, 9445], "mapped", [118]], [[9446, 9446], "mapped", [119]], [[9447, 9447], "mapped", [120]], [[9448, 9448], "mapped", [121]], [[9449, 9449], "mapped", [122]], [[9450, 9450], "mapped", [48]], [[9451, 9470], "valid", [], "NV8"], [[9471, 9471], "valid", [], "NV8"], [[9472, 9621], "valid", [], "NV8"], [[9622, 9631], "valid", [], "NV8"], [[9632, 9711], "valid", [], "NV8"], [[9712, 9719], "valid", [], "NV8"], [[9720, 9727], "valid", [], "NV8"], [[9728, 9747], "valid", [], "NV8"], [[9748, 9749], "valid", [], "NV8"], [[9750, 9751], "valid", [], "NV8"], [[9752, 9752], "valid", [], "NV8"], [[9753, 9753], "valid", [], "NV8"], [[9754, 9839], "valid", [], "NV8"], [[9840, 9841], "valid", [], "NV8"], [[9842, 9853], "valid", [], "NV8"], [[9854, 9855], "valid", [], "NV8"], [[9856, 9865], "valid", [], "NV8"], [[9866, 9873], "valid", [], "NV8"], [[9874, 9884], "valid", [], "NV8"], [[9885, 9885], "valid", [], "NV8"], [[9886, 9887], "valid", [], "NV8"], [[9888, 9889], "valid", [], "NV8"], [[9890, 9905], "valid", [], "NV8"], [[9906, 9906], "valid", [], "NV8"], [[9907, 9916], "valid", [], "NV8"], [[9917, 9919], "valid", [], "NV8"], [[9920, 9923], "valid", [], "NV8"], [[9924, 9933], "valid", [], "NV8"], [[9934, 9934], "valid", [], "NV8"], [[9935, 9953], "valid", [], "NV8"], [[9954, 9954], "valid", [], "NV8"], [[9955, 9955], "valid", [], "NV8"], [[9956, 9959], "valid", [], "NV8"], [[9960, 9983], "valid", [], "NV8"], [[9984, 9984], "valid", [], "NV8"], [[9985, 9988], "valid", [], "NV8"], [[9989, 9989], "valid", [], "NV8"], [[9990, 9993], "valid", [], "NV8"], [[9994, 9995], "valid", [], "NV8"], [[9996, 10023], "valid", [], "NV8"], [[10024, 10024], "valid", [], "NV8"], [[10025, 10059], "valid", [], "NV8"], [[10060, 10060], "valid", [], "NV8"], [[10061, 10061], "valid", [], "NV8"], [[10062, 10062], "valid", [], "NV8"], [[10063, 10066], "valid", [], "NV8"], [[10067, 10069], "valid", [], "NV8"], [[10070, 10070], "valid", [], "NV8"], [[10071, 10071], "valid", [], "NV8"], [[10072, 10078], "valid", [], "NV8"], [[10079, 10080], "valid", [], "NV8"], [[10081, 10087], "valid", [], "NV8"], [[10088, 10101], "valid", [], "NV8"], [[10102, 10132], "valid", [], "NV8"], [[10133, 10135], "valid", [], "NV8"], [[10136, 10159], "valid", [], "NV8"], [[10160, 10160], "valid", [], "NV8"], [[10161, 10174], "valid", [], "NV8"], [[10175, 10175], "valid", [], "NV8"], [[10176, 10182], "valid", [], "NV8"], [[10183, 10186], "valid", [], "NV8"], [[10187, 10187], "valid", [], "NV8"], [[10188, 10188], "valid", [], "NV8"], [[10189, 10189], "valid", [], "NV8"], [[10190, 10191], "valid", [], "NV8"], [[10192, 10219], "valid", [], "NV8"], [[10220, 10223], "valid", [], "NV8"], [[10224, 10239], "valid", [], "NV8"], [[10240, 10495], "valid", [], "NV8"], [[10496, 10763], "valid", [], "NV8"], [[10764, 10764], "mapped", [8747, 8747, 8747, 8747]], [[10765, 10867], "valid", [], "NV8"], [[10868, 10868], "disallowed_STD3_mapped", [58, 58, 61]], [[10869, 10869], "disallowed_STD3_mapped", [61, 61]], [[10870, 10870], "disallowed_STD3_mapped", [61, 61, 61]], [[10871, 10971], "valid", [], "NV8"], [[10972, 10972], "mapped", [10973, 824]], [[10973, 11007], "valid", [], "NV8"], [[11008, 11021], "valid", [], "NV8"], [[11022, 11027], "valid", [], "NV8"], [[11028, 11034], "valid", [], "NV8"], [[11035, 11039], "valid", [], "NV8"], [[11040, 11043], "valid", [], "NV8"], [[11044, 11084], "valid", [], "NV8"], [[11085, 11087], "valid", [], "NV8"], [[11088, 11092], "valid", [], "NV8"], [[11093, 11097], "valid", [], "NV8"], [[11098, 11123], "valid", [], "NV8"], [[11124, 11125], "disallowed"], [[11126, 11157], "valid", [], "NV8"], [[11158, 11159], "disallowed"], [[11160, 11193], "valid", [], "NV8"], [[11194, 11196], "disallowed"], [[11197, 11208], "valid", [], "NV8"], [[11209, 11209], "disallowed"], [[11210, 11217], "valid", [], "NV8"], [[11218, 11243], "disallowed"], [[11244, 11247], "valid", [], "NV8"], [[11248, 11263], "disallowed"], [[11264, 11264], "mapped", [11312]], [[11265, 11265], "mapped", [11313]], [[11266, 11266], "mapped", [11314]], [[11267, 11267], "mapped", [11315]], [[11268, 11268], "mapped", [11316]], [[11269, 11269], "mapped", [11317]], [[11270, 11270], "mapped", [11318]], [[11271, 11271], "mapped", [11319]], [[11272, 11272], "mapped", [11320]], [[11273, 11273], "mapped", [11321]], [[11274, 11274], "mapped", [11322]], [[11275, 11275], "mapped", [11323]], [[11276, 11276], "mapped", [11324]], [[11277, 11277], "mapped", [11325]], [[11278, 11278], "mapped", [11326]], [[11279, 11279], "mapped", [11327]], [[11280, 11280], "mapped", [11328]], [[11281, 11281], "mapped", [11329]], [[11282, 11282], "mapped", [11330]], [[11283, 11283], "mapped", [11331]], [[11284, 11284], "mapped", [11332]], [[11285, 11285], "mapped", [11333]], [[11286, 11286], "mapped", [11334]], [[11287, 11287], "mapped", [11335]], [[11288, 11288], "mapped", [11336]], [[11289, 11289], "mapped", [11337]], [[11290, 11290], "mapped", [11338]], [[11291, 11291], "mapped", [11339]], [[11292, 11292], "mapped", [11340]], [[11293, 11293], "mapped", [11341]], [[11294, 11294], "mapped", [11342]], [[11295, 11295], "mapped", [11343]], [[11296, 11296], "mapped", [11344]], [[11297, 11297], "mapped", [11345]], [[11298, 11298], "mapped", [11346]], [[11299, 11299], "mapped", [11347]], [[11300, 11300], "mapped", [11348]], [[11301, 11301], "mapped", [11349]], [[11302, 11302], "mapped", [11350]], [[11303, 11303], "mapped", [11351]], [[11304, 11304], "mapped", [11352]], [[11305, 11305], "mapped", [11353]], [[11306, 11306], "mapped", [11354]], [[11307, 11307], "mapped", [11355]], [[11308, 11308], "mapped", [11356]], [[11309, 11309], "mapped", [11357]], [[11310, 11310], "mapped", [11358]], [[11311, 11311], "disallowed"], [[11312, 11358], "valid"], [[11359, 11359], "disallowed"], [[11360, 11360], "mapped", [11361]], [[11361, 11361], "valid"], [[11362, 11362], "mapped", [619]], [[11363, 11363], "mapped", [7549]], [[11364, 11364], "mapped", [637]], [[11365, 11366], "valid"], [[11367, 11367], "mapped", [11368]], [[11368, 11368], "valid"], [[11369, 11369], "mapped", [11370]], [[11370, 11370], "valid"], [[11371, 11371], "mapped", [11372]], [[11372, 11372], "valid"], [[11373, 11373], "mapped", [593]], [[11374, 11374], "mapped", [625]], [[11375, 11375], "mapped", [592]], [[11376, 11376], "mapped", [594]], [[11377, 11377], "valid"], [[11378, 11378], "mapped", [11379]], [[11379, 11379], "valid"], [[11380, 11380], "valid"], [[11381, 11381], "mapped", [11382]], [[11382, 11383], "valid"], [[11384, 11387], "valid"], [[11388, 11388], "mapped", [106]], [[11389, 11389], "mapped", [118]], [[11390, 11390], "mapped", [575]], [[11391, 11391], "mapped", [576]], [[11392, 11392], "mapped", [11393]], [[11393, 11393], "valid"], [[11394, 11394], "mapped", [11395]], [[11395, 11395], "valid"], [[11396, 11396], "mapped", [11397]], [[11397, 11397], "valid"], [[11398, 11398], "mapped", [11399]], [[11399, 11399], "valid"], [[11400, 11400], "mapped", [11401]], [[11401, 11401], "valid"], [[11402, 11402], "mapped", [11403]], [[11403, 11403], "valid"], [[11404, 11404], "mapped", [11405]], [[11405, 11405], "valid"], [[11406, 11406], "mapped", [11407]], [[11407, 11407], "valid"], [[11408, 11408], "mapped", [11409]], [[11409, 11409], "valid"], [[11410, 11410], "mapped", [11411]], [[11411, 11411], "valid"], [[11412, 11412], "mapped", [11413]], [[11413, 11413], "valid"], [[11414, 11414], "mapped", [11415]], [[11415, 11415], "valid"], [[11416, 11416], "mapped", [11417]], [[11417, 11417], "valid"], [[11418, 11418], "mapped", [11419]], [[11419, 11419], "valid"], [[11420, 11420], "mapped", [11421]], [[11421, 11421], "valid"], [[11422, 11422], "mapped", [11423]], [[11423, 11423], "valid"], [[11424, 11424], "mapped", [11425]], [[11425, 11425], "valid"], [[11426, 11426], "mapped", [11427]], [[11427, 11427], "valid"], [[11428, 11428], "mapped", [11429]], [[11429, 11429], "valid"], [[11430, 11430], "mapped", [11431]], [[11431, 11431], "valid"], [[11432, 11432], "mapped", [11433]], [[11433, 11433], "valid"], [[11434, 11434], "mapped", [11435]], [[11435, 11435], "valid"], [[11436, 11436], "mapped", [11437]], [[11437, 11437], "valid"], [[11438, 11438], "mapped", [11439]], [[11439, 11439], "valid"], [[11440, 11440], "mapped", [11441]], [[11441, 11441], "valid"], [[11442, 11442], "mapped", [11443]], [[11443, 11443], "valid"], [[11444, 11444], "mapped", [11445]], [[11445, 11445], "valid"], [[11446, 11446], "mapped", [11447]], [[11447, 11447], "valid"], [[11448, 11448], "mapped", [11449]], [[11449, 11449], "valid"], [[11450, 11450], "mapped", [11451]], [[11451, 11451], "valid"], [[11452, 11452], "mapped", [11453]], [[11453, 11453], "valid"], [[11454, 11454], "mapped", [11455]], [[11455, 11455], "valid"], [[11456, 11456], "mapped", [11457]], [[11457, 11457], "valid"], [[11458, 11458], "mapped", [11459]], [[11459, 11459], "valid"], [[11460, 11460], "mapped", [11461]], [[11461, 11461], "valid"], [[11462, 11462], "mapped", [11463]], [[11463, 11463], "valid"], [[11464, 11464], "mapped", [11465]], [[11465, 11465], "valid"], [[11466, 11466], "mapped", [11467]], [[11467, 11467], "valid"], [[11468, 11468], "mapped", [11469]], [[11469, 11469], "valid"], [[11470, 11470], "mapped", [11471]], [[11471, 11471], "valid"], [[11472, 11472], "mapped", [11473]], [[11473, 11473], "valid"], [[11474, 11474], "mapped", [11475]], [[11475, 11475], "valid"], [[11476, 11476], "mapped", [11477]], [[11477, 11477], "valid"], [[11478, 11478], "mapped", [11479]], [[11479, 11479], "valid"], [[11480, 11480], "mapped", [11481]], [[11481, 11481], "valid"], [[11482, 11482], "mapped", [11483]], [[11483, 11483], "valid"], [[11484, 11484], "mapped", [11485]], [[11485, 11485], "valid"], [[11486, 11486], "mapped", [11487]], [[11487, 11487], "valid"], [[11488, 11488], "mapped", [11489]], [[11489, 11489], "valid"], [[11490, 11490], "mapped", [11491]], [[11491, 11492], "valid"], [[11493, 11498], "valid", [], "NV8"], [[11499, 11499], "mapped", [11500]], [[11500, 11500], "valid"], [[11501, 11501], "mapped", [11502]], [[11502, 11505], "valid"], [[11506, 11506], "mapped", [11507]], [[11507, 11507], "valid"], [[11508, 11512], "disallowed"], [[11513, 11519], "valid", [], "NV8"], [[11520, 11557], "valid"], [[11558, 11558], "disallowed"], [[11559, 11559], "valid"], [[11560, 11564], "disallowed"], [[11565, 11565], "valid"], [[11566, 11567], "disallowed"], [[11568, 11621], "valid"], [[11622, 11623], "valid"], [[11624, 11630], "disallowed"], [[11631, 11631], "mapped", [11617]], [[11632, 11632], "valid", [], "NV8"], [[11633, 11646], "disallowed"], [[11647, 11647], "valid"], [[11648, 11670], "valid"], [[11671, 11679], "disallowed"], [[11680, 11686], "valid"], [[11687, 11687], "disallowed"], [[11688, 11694], "valid"], [[11695, 11695], "disallowed"], [[11696, 11702], "valid"], [[11703, 11703], "disallowed"], [[11704, 11710], "valid"], [[11711, 11711], "disallowed"], [[11712, 11718], "valid"], [[11719, 11719], "disallowed"], [[11720, 11726], "valid"], [[11727, 11727], "disallowed"], [[11728, 11734], "valid"], [[11735, 11735], "disallowed"], [[11736, 11742], "valid"], [[11743, 11743], "disallowed"], [[11744, 11775], "valid"], [[11776, 11799], "valid", [], "NV8"], [[11800, 11803], "valid", [], "NV8"], [[11804, 11805], "valid", [], "NV8"], [[11806, 11822], "valid", [], "NV8"], [[11823, 11823], "valid"], [[11824, 11824], "valid", [], "NV8"], [[11825, 11825], "valid", [], "NV8"], [[11826, 11835], "valid", [], "NV8"], [[11836, 11842], "valid", [], "NV8"], [[11843, 11903], "disallowed"], [[11904, 11929], "valid", [], "NV8"], [[11930, 11930], "disallowed"], [[11931, 11934], "valid", [], "NV8"], [[11935, 11935], "mapped", [27597]], [[11936, 12018], "valid", [], "NV8"], [[12019, 12019], "mapped", [40863]], [[12020, 12031], "disallowed"], [[12032, 12032], "mapped", [19968]], [[12033, 12033], "mapped", [20008]], [[12034, 12034], "mapped", [20022]], [[12035, 12035], "mapped", [20031]], [[12036, 12036], "mapped", [20057]], [[12037, 12037], "mapped", [20101]], [[12038, 12038], "mapped", [20108]], [[12039, 12039], "mapped", [20128]], [[12040, 12040], "mapped", [20154]], [[12041, 12041], "mapped", [20799]], [[12042, 12042], "mapped", [20837]], [[12043, 12043], "mapped", [20843]], [[12044, 12044], "mapped", [20866]], [[12045, 12045], "mapped", [20886]], [[12046, 12046], "mapped", [20907]], [[12047, 12047], "mapped", [20960]], [[12048, 12048], "mapped", [20981]], [[12049, 12049], "mapped", [20992]], [[12050, 12050], "mapped", [21147]], [[12051, 12051], "mapped", [21241]], [[12052, 12052], "mapped", [21269]], [[12053, 12053], "mapped", [21274]], [[12054, 12054], "mapped", [21304]], [[12055, 12055], "mapped", [21313]], [[12056, 12056], "mapped", [21340]], [[12057, 12057], "mapped", [21353]], [[12058, 12058], "mapped", [21378]], [[12059, 12059], "mapped", [21430]], [[12060, 12060], "mapped", [21448]], [[12061, 12061], "mapped", [21475]], [[12062, 12062], "mapped", [22231]], [[12063, 12063], "mapped", [22303]], [[12064, 12064], "mapped", [22763]], [[12065, 12065], "mapped", [22786]], [[12066, 12066], "mapped", [22794]], [[12067, 12067], "mapped", [22805]], [[12068, 12068], "mapped", [22823]], [[12069, 12069], "mapped", [22899]], [[12070, 12070], "mapped", [23376]], [[12071, 12071], "mapped", [23424]], [[12072, 12072], "mapped", [23544]], [[12073, 12073], "mapped", [23567]], [[12074, 12074], "mapped", [23586]], [[12075, 12075], "mapped", [23608]], [[12076, 12076], "mapped", [23662]], [[12077, 12077], "mapped", [23665]], [[12078, 12078], "mapped", [24027]], [[12079, 12079], "mapped", [24037]], [[12080, 12080], "mapped", [24049]], [[12081, 12081], "mapped", [24062]], [[12082, 12082], "mapped", [24178]], [[12083, 12083], "mapped", [24186]], [[12084, 12084], "mapped", [24191]], [[12085, 12085], "mapped", [24308]], [[12086, 12086], "mapped", [24318]], [[12087, 12087], "mapped", [24331]], [[12088, 12088], "mapped", [24339]], [[12089, 12089], "mapped", [24400]], [[12090, 12090], "mapped", [24417]], [[12091, 12091], "mapped", [24435]], [[12092, 12092], "mapped", [24515]], [[12093, 12093], "mapped", [25096]], [[12094, 12094], "mapped", [25142]], [[12095, 12095], "mapped", [25163]], [[12096, 12096], "mapped", [25903]], [[12097, 12097], "mapped", [25908]], [[12098, 12098], "mapped", [25991]], [[12099, 12099], "mapped", [26007]], [[12100, 12100], "mapped", [26020]], [[12101, 12101], "mapped", [26041]], [[12102, 12102], "mapped", [26080]], [[12103, 12103], "mapped", [26085]], [[12104, 12104], "mapped", [26352]], [[12105, 12105], "mapped", [26376]], [[12106, 12106], "mapped", [26408]], [[12107, 12107], "mapped", [27424]], [[12108, 12108], "mapped", [27490]], [[12109, 12109], "mapped", [27513]], [[12110, 12110], "mapped", [27571]], [[12111, 12111], "mapped", [27595]], [[12112, 12112], "mapped", [27604]], [[12113, 12113], "mapped", [27611]], [[12114, 12114], "mapped", [27663]], [[12115, 12115], "mapped", [27668]], [[12116, 12116], "mapped", [27700]], [[12117, 12117], "mapped", [28779]], [[12118, 12118], "mapped", [29226]], [[12119, 12119], "mapped", [29238]], [[12120, 12120], "mapped", [29243]], [[12121, 12121], "mapped", [29247]], [[12122, 12122], "mapped", [29255]], [[12123, 12123], "mapped", [29273]], [[12124, 12124], "mapped", [29275]], [[12125, 12125], "mapped", [29356]], [[12126, 12126], "mapped", [29572]], [[12127, 12127], "mapped", [29577]], [[12128, 12128], "mapped", [29916]], [[12129, 12129], "mapped", [29926]], [[12130, 12130], "mapped", [29976]], [[12131, 12131], "mapped", [29983]], [[12132, 12132], "mapped", [29992]], [[12133, 12133], "mapped", [3e4]], [[12134, 12134], "mapped", [30091]], [[12135, 12135], "mapped", [30098]], [[12136, 12136], "mapped", [30326]], [[12137, 12137], "mapped", [30333]], [[12138, 12138], "mapped", [30382]], [[12139, 12139], "mapped", [30399]], [[12140, 12140], "mapped", [30446]], [[12141, 12141], "mapped", [30683]], [[12142, 12142], "mapped", [30690]], [[12143, 12143], "mapped", [30707]], [[12144, 12144], "mapped", [31034]], [[12145, 12145], "mapped", [31160]], [[12146, 12146], "mapped", [31166]], [[12147, 12147], "mapped", [31348]], [[12148, 12148], "mapped", [31435]], [[12149, 12149], "mapped", [31481]], [[12150, 12150], "mapped", [31859]], [[12151, 12151], "mapped", [31992]], [[12152, 12152], "mapped", [32566]], [[12153, 12153], "mapped", [32593]], [[12154, 12154], "mapped", [32650]], [[12155, 12155], "mapped", [32701]], [[12156, 12156], "mapped", [32769]], [[12157, 12157], "mapped", [32780]], [[12158, 12158], "mapped", [32786]], [[12159, 12159], "mapped", [32819]], [[12160, 12160], "mapped", [32895]], [[12161, 12161], "mapped", [32905]], [[12162, 12162], "mapped", [33251]], [[12163, 12163], "mapped", [33258]], [[12164, 12164], "mapped", [33267]], [[12165, 12165], "mapped", [33276]], [[12166, 12166], "mapped", [33292]], [[12167, 12167], "mapped", [33307]], [[12168, 12168], "mapped", [33311]], [[12169, 12169], "mapped", [33390]], [[12170, 12170], "mapped", [33394]], [[12171, 12171], "mapped", [33400]], [[12172, 12172], "mapped", [34381]], [[12173, 12173], "mapped", [34411]], [[12174, 12174], "mapped", [34880]], [[12175, 12175], "mapped", [34892]], [[12176, 12176], "mapped", [34915]], [[12177, 12177], "mapped", [35198]], [[12178, 12178], "mapped", [35211]], [[12179, 12179], "mapped", [35282]], [[12180, 12180], "mapped", [35328]], [[12181, 12181], "mapped", [35895]], [[12182, 12182], "mapped", [35910]], [[12183, 12183], "mapped", [35925]], [[12184, 12184], "mapped", [35960]], [[12185, 12185], "mapped", [35997]], [[12186, 12186], "mapped", [36196]], [[12187, 12187], "mapped", [36208]], [[12188, 12188], "mapped", [36275]], [[12189, 12189], "mapped", [36523]], [[12190, 12190], "mapped", [36554]], [[12191, 12191], "mapped", [36763]], [[12192, 12192], "mapped", [36784]], [[12193, 12193], "mapped", [36789]], [[12194, 12194], "mapped", [37009]], [[12195, 12195], "mapped", [37193]], [[12196, 12196], "mapped", [37318]], [[12197, 12197], "mapped", [37324]], [[12198, 12198], "mapped", [37329]], [[12199, 12199], "mapped", [38263]], [[12200, 12200], "mapped", [38272]], [[12201, 12201], "mapped", [38428]], [[12202, 12202], "mapped", [38582]], [[12203, 12203], "mapped", [38585]], [[12204, 12204], "mapped", [38632]], [[12205, 12205], "mapped", [38737]], [[12206, 12206], "mapped", [38750]], [[12207, 12207], "mapped", [38754]], [[12208, 12208], "mapped", [38761]], [[12209, 12209], "mapped", [38859]], [[12210, 12210], "mapped", [38893]], [[12211, 12211], "mapped", [38899]], [[12212, 12212], "mapped", [38913]], [[12213, 12213], "mapped", [39080]], [[12214, 12214], "mapped", [39131]], [[12215, 12215], "mapped", [39135]], [[12216, 12216], "mapped", [39318]], [[12217, 12217], "mapped", [39321]], [[12218, 12218], "mapped", [39340]], [[12219, 12219], "mapped", [39592]], [[12220, 12220], "mapped", [39640]], [[12221, 12221], "mapped", [39647]], [[12222, 12222], "mapped", [39717]], [[12223, 12223], "mapped", [39727]], [[12224, 12224], "mapped", [39730]], [[12225, 12225], "mapped", [39740]], [[12226, 12226], "mapped", [39770]], [[12227, 12227], "mapped", [40165]], [[12228, 12228], "mapped", [40565]], [[12229, 12229], "mapped", [40575]], [[12230, 12230], "mapped", [40613]], [[12231, 12231], "mapped", [40635]], [[12232, 12232], "mapped", [40643]], [[12233, 12233], "mapped", [40653]], [[12234, 12234], "mapped", [40657]], [[12235, 12235], "mapped", [40697]], [[12236, 12236], "mapped", [40701]], [[12237, 12237], "mapped", [40718]], [[12238, 12238], "mapped", [40723]], [[12239, 12239], "mapped", [40736]], [[12240, 12240], "mapped", [40763]], [[12241, 12241], "mapped", [40778]], [[12242, 12242], "mapped", [40786]], [[12243, 12243], "mapped", [40845]], [[12244, 12244], "mapped", [40860]], [[12245, 12245], "mapped", [40864]], [[12246, 12271], "disallowed"], [[12272, 12283], "disallowed"], [[12284, 12287], "disallowed"], [[12288, 12288], "disallowed_STD3_mapped", [32]], [[12289, 12289], "valid", [], "NV8"], [[12290, 12290], "mapped", [46]], [[12291, 12292], "valid", [], "NV8"], [[12293, 12295], "valid"], [[12296, 12329], "valid", [], "NV8"], [[12330, 12333], "valid"], [[12334, 12341], "valid", [], "NV8"], [[12342, 12342], "mapped", [12306]], [[12343, 12343], "valid", [], "NV8"], [[12344, 12344], "mapped", [21313]], [[12345, 12345], "mapped", [21316]], [[12346, 12346], "mapped", [21317]], [[12347, 12347], "valid", [], "NV8"], [[12348, 12348], "valid"], [[12349, 12349], "valid", [], "NV8"], [[12350, 12350], "valid", [], "NV8"], [[12351, 12351], "valid", [], "NV8"], [[12352, 12352], "disallowed"], [[12353, 12436], "valid"], [[12437, 12438], "valid"], [[12439, 12440], "disallowed"], [[12441, 12442], "valid"], [[12443, 12443], "disallowed_STD3_mapped", [32, 12441]], [[12444, 12444], "disallowed_STD3_mapped", [32, 12442]], [[12445, 12446], "valid"], [[12447, 12447], "mapped", [12424, 12426]], [[12448, 12448], "valid", [], "NV8"], [[12449, 12542], "valid"], [[12543, 12543], "mapped", [12467, 12488]], [[12544, 12548], "disallowed"], [[12549, 12588], "valid"], [[12589, 12589], "valid"], [[12590, 12592], "disallowed"], [[12593, 12593], "mapped", [4352]], [[12594, 12594], "mapped", [4353]], [[12595, 12595], "mapped", [4522]], [[12596, 12596], "mapped", [4354]], [[12597, 12597], "mapped", [4524]], [[12598, 12598], "mapped", [4525]], [[12599, 12599], "mapped", [4355]], [[12600, 12600], "mapped", [4356]], [[12601, 12601], "mapped", [4357]], [[12602, 12602], "mapped", [4528]], [[12603, 12603], "mapped", [4529]], [[12604, 12604], "mapped", [4530]], [[12605, 12605], "mapped", [4531]], [[12606, 12606], "mapped", [4532]], [[12607, 12607], "mapped", [4533]], [[12608, 12608], "mapped", [4378]], [[12609, 12609], "mapped", [4358]], [[12610, 12610], "mapped", [4359]], [[12611, 12611], "mapped", [4360]], [[12612, 12612], "mapped", [4385]], [[12613, 12613], "mapped", [4361]], [[12614, 12614], "mapped", [4362]], [[12615, 12615], "mapped", [4363]], [[12616, 12616], "mapped", [4364]], [[12617, 12617], "mapped", [4365]], [[12618, 12618], "mapped", [4366]], [[12619, 12619], "mapped", [4367]], [[12620, 12620], "mapped", [4368]], [[12621, 12621], "mapped", [4369]], [[12622, 12622], "mapped", [4370]], [[12623, 12623], "mapped", [4449]], [[12624, 12624], "mapped", [4450]], [[12625, 12625], "mapped", [4451]], [[12626, 12626], "mapped", [4452]], [[12627, 12627], "mapped", [4453]], [[12628, 12628], "mapped", [4454]], [[12629, 12629], "mapped", [4455]], [[12630, 12630], "mapped", [4456]], [[12631, 12631], "mapped", [4457]], [[12632, 12632], "mapped", [4458]], [[12633, 12633], "mapped", [4459]], [[12634, 12634], "mapped", [4460]], [[12635, 12635], "mapped", [4461]], [[12636, 12636], "mapped", [4462]], [[12637, 12637], "mapped", [4463]], [[12638, 12638], "mapped", [4464]], [[12639, 12639], "mapped", [4465]], [[12640, 12640], "mapped", [4466]], [[12641, 12641], "mapped", [4467]], [[12642, 12642], "mapped", [4468]], [[12643, 12643], "mapped", [4469]], [[12644, 12644], "disallowed"], [[12645, 12645], "mapped", [4372]], [[12646, 12646], "mapped", [4373]], [[12647, 12647], "mapped", [4551]], [[12648, 12648], "mapped", [4552]], [[12649, 12649], "mapped", [4556]], [[12650, 12650], "mapped", [4558]], [[12651, 12651], "mapped", [4563]], [[12652, 12652], "mapped", [4567]], [[12653, 12653], "mapped", [4569]], [[12654, 12654], "mapped", [4380]], [[12655, 12655], "mapped", [4573]], [[12656, 12656], "mapped", [4575]], [[12657, 12657], "mapped", [4381]], [[12658, 12658], "mapped", [4382]], [[12659, 12659], "mapped", [4384]], [[12660, 12660], "mapped", [4386]], [[12661, 12661], "mapped", [4387]], [[12662, 12662], "mapped", [4391]], [[12663, 12663], "mapped", [4393]], [[12664, 12664], "mapped", [4395]], [[12665, 12665], "mapped", [4396]], [[12666, 12666], "mapped", [4397]], [[12667, 12667], "mapped", [4398]], [[12668, 12668], "mapped", [4399]], [[12669, 12669], "mapped", [4402]], [[12670, 12670], "mapped", [4406]], [[12671, 12671], "mapped", [4416]], [[12672, 12672], "mapped", [4423]], [[12673, 12673], "mapped", [4428]], [[12674, 12674], "mapped", [4593]], [[12675, 12675], "mapped", [4594]], [[12676, 12676], "mapped", [4439]], [[12677, 12677], "mapped", [4440]], [[12678, 12678], "mapped", [4441]], [[12679, 12679], "mapped", [4484]], [[12680, 12680], "mapped", [4485]], [[12681, 12681], "mapped", [4488]], [[12682, 12682], "mapped", [4497]], [[12683, 12683], "mapped", [4498]], [[12684, 12684], "mapped", [4500]], [[12685, 12685], "mapped", [4510]], [[12686, 12686], "mapped", [4513]], [[12687, 12687], "disallowed"], [[12688, 12689], "valid", [], "NV8"], [[12690, 12690], "mapped", [19968]], [[12691, 12691], "mapped", [20108]], [[12692, 12692], "mapped", [19977]], [[12693, 12693], "mapped", [22235]], [[12694, 12694], "mapped", [19978]], [[12695, 12695], "mapped", [20013]], [[12696, 12696], "mapped", [19979]], [[12697, 12697], "mapped", [30002]], [[12698, 12698], "mapped", [20057]], [[12699, 12699], "mapped", [19993]], [[12700, 12700], "mapped", [19969]], [[12701, 12701], "mapped", [22825]], [[12702, 12702], "mapped", [22320]], [[12703, 12703], "mapped", [20154]], [[12704, 12727], "valid"], [[12728, 12730], "valid"], [[12731, 12735], "disallowed"], [[12736, 12751], "valid", [], "NV8"], [[12752, 12771], "valid", [], "NV8"], [[12772, 12783], "disallowed"], [[12784, 12799], "valid"], [[12800, 12800], "disallowed_STD3_mapped", [40, 4352, 41]], [[12801, 12801], "disallowed_STD3_mapped", [40, 4354, 41]], [[12802, 12802], "disallowed_STD3_mapped", [40, 4355, 41]], [[12803, 12803], "disallowed_STD3_mapped", [40, 4357, 41]], [[12804, 12804], "disallowed_STD3_mapped", [40, 4358, 41]], [[12805, 12805], "disallowed_STD3_mapped", [40, 4359, 41]], [[12806, 12806], "disallowed_STD3_mapped", [40, 4361, 41]], [[12807, 12807], "disallowed_STD3_mapped", [40, 4363, 41]], [[12808, 12808], "disallowed_STD3_mapped", [40, 4364, 41]], [[12809, 12809], "disallowed_STD3_mapped", [40, 4366, 41]], [[12810, 12810], "disallowed_STD3_mapped", [40, 4367, 41]], [[12811, 12811], "disallowed_STD3_mapped", [40, 4368, 41]], [[12812, 12812], "disallowed_STD3_mapped", [40, 4369, 41]], [[12813, 12813], "disallowed_STD3_mapped", [40, 4370, 41]], [[12814, 12814], "disallowed_STD3_mapped", [40, 44032, 41]], [[12815, 12815], "disallowed_STD3_mapped", [40, 45208, 41]], [[12816, 12816], "disallowed_STD3_mapped", [40, 45796, 41]], [[12817, 12817], "disallowed_STD3_mapped", [40, 46972, 41]], [[12818, 12818], "disallowed_STD3_mapped", [40, 47560, 41]], [[12819, 12819], "disallowed_STD3_mapped", [40, 48148, 41]], [[12820, 12820], "disallowed_STD3_mapped", [40, 49324, 41]], [[12821, 12821], "disallowed_STD3_mapped", [40, 50500, 41]], [[12822, 12822], "disallowed_STD3_mapped", [40, 51088, 41]], [[12823, 12823], "disallowed_STD3_mapped", [40, 52264, 41]], [[12824, 12824], "disallowed_STD3_mapped", [40, 52852, 41]], [[12825, 12825], "disallowed_STD3_mapped", [40, 53440, 41]], [[12826, 12826], "disallowed_STD3_mapped", [40, 54028, 41]], [[12827, 12827], "disallowed_STD3_mapped", [40, 54616, 41]], [[12828, 12828], "disallowed_STD3_mapped", [40, 51452, 41]], [[12829, 12829], "disallowed_STD3_mapped", [40, 50724, 51204, 41]], [[12830, 12830], "disallowed_STD3_mapped", [40, 50724, 54980, 41]], [[12831, 12831], "disallowed"], [[12832, 12832], "disallowed_STD3_mapped", [40, 19968, 41]], [[12833, 12833], "disallowed_STD3_mapped", [40, 20108, 41]], [[12834, 12834], "disallowed_STD3_mapped", [40, 19977, 41]], [[12835, 12835], "disallowed_STD3_mapped", [40, 22235, 41]], [[12836, 12836], "disallowed_STD3_mapped", [40, 20116, 41]], [[12837, 12837], "disallowed_STD3_mapped", [40, 20845, 41]], [[12838, 12838], "disallowed_STD3_mapped", [40, 19971, 41]], [[12839, 12839], "disallowed_STD3_mapped", [40, 20843, 41]], [[12840, 12840], "disallowed_STD3_mapped", [40, 20061, 41]], [[12841, 12841], "disallowed_STD3_mapped", [40, 21313, 41]], [[12842, 12842], "disallowed_STD3_mapped", [40, 26376, 41]], [[12843, 12843], "disallowed_STD3_mapped", [40, 28779, 41]], [[12844, 12844], "disallowed_STD3_mapped", [40, 27700, 41]], [[12845, 12845], "disallowed_STD3_mapped", [40, 26408, 41]], [[12846, 12846], "disallowed_STD3_mapped", [40, 37329, 41]], [[12847, 12847], "disallowed_STD3_mapped", [40, 22303, 41]], [[12848, 12848], "disallowed_STD3_mapped", [40, 26085, 41]], [[12849, 12849], "disallowed_STD3_mapped", [40, 26666, 41]], [[12850, 12850], "disallowed_STD3_mapped", [40, 26377, 41]], [[12851, 12851], "disallowed_STD3_mapped", [40, 31038, 41]], [[12852, 12852], "disallowed_STD3_mapped", [40, 21517, 41]], [[12853, 12853], "disallowed_STD3_mapped", [40, 29305, 41]], [[12854, 12854], "disallowed_STD3_mapped", [40, 36001, 41]], [[12855, 12855], "disallowed_STD3_mapped", [40, 31069, 41]], [[12856, 12856], "disallowed_STD3_mapped", [40, 21172, 41]], [[12857, 12857], "disallowed_STD3_mapped", [40, 20195, 41]], [[12858, 12858], "disallowed_STD3_mapped", [40, 21628, 41]], [[12859, 12859], "disallowed_STD3_mapped", [40, 23398, 41]], [[12860, 12860], "disallowed_STD3_mapped", [40, 30435, 41]], [[12861, 12861], "disallowed_STD3_mapped", [40, 20225, 41]], [[12862, 12862], "disallowed_STD3_mapped", [40, 36039, 41]], [[12863, 12863], "disallowed_STD3_mapped", [40, 21332, 41]], [[12864, 12864], "disallowed_STD3_mapped", [40, 31085, 41]], [[12865, 12865], "disallowed_STD3_mapped", [40, 20241, 41]], [[12866, 12866], "disallowed_STD3_mapped", [40, 33258, 41]], [[12867, 12867], "disallowed_STD3_mapped", [40, 33267, 41]], [[12868, 12868], "mapped", [21839]], [[12869, 12869], "mapped", [24188]], [[12870, 12870], "mapped", [25991]], [[12871, 12871], "mapped", [31631]], [[12872, 12879], "valid", [], "NV8"], [[12880, 12880], "mapped", [112, 116, 101]], [[12881, 12881], "mapped", [50, 49]], [[12882, 12882], "mapped", [50, 50]], [[12883, 12883], "mapped", [50, 51]], [[12884, 12884], "mapped", [50, 52]], [[12885, 12885], "mapped", [50, 53]], [[12886, 12886], "mapped", [50, 54]], [[12887, 12887], "mapped", [50, 55]], [[12888, 12888], "mapped", [50, 56]], [[12889, 12889], "mapped", [50, 57]], [[12890, 12890], "mapped", [51, 48]], [[12891, 12891], "mapped", [51, 49]], [[12892, 12892], "mapped", [51, 50]], [[12893, 12893], "mapped", [51, 51]], [[12894, 12894], "mapped", [51, 52]], [[12895, 12895], "mapped", [51, 53]], [[12896, 12896], "mapped", [4352]], [[12897, 12897], "mapped", [4354]], [[12898, 12898], "mapped", [4355]], [[12899, 12899], "mapped", [4357]], [[12900, 12900], "mapped", [4358]], [[12901, 12901], "mapped", [4359]], [[12902, 12902], "mapped", [4361]], [[12903, 12903], "mapped", [4363]], [[12904, 12904], "mapped", [4364]], [[12905, 12905], "mapped", [4366]], [[12906, 12906], "mapped", [4367]], [[12907, 12907], "mapped", [4368]], [[12908, 12908], "mapped", [4369]], [[12909, 12909], "mapped", [4370]], [[12910, 12910], "mapped", [44032]], [[12911, 12911], "mapped", [45208]], [[12912, 12912], "mapped", [45796]], [[12913, 12913], "mapped", [46972]], [[12914, 12914], "mapped", [47560]], [[12915, 12915], "mapped", [48148]], [[12916, 12916], "mapped", [49324]], [[12917, 12917], "mapped", [50500]], [[12918, 12918], "mapped", [51088]], [[12919, 12919], "mapped", [52264]], [[12920, 12920], "mapped", [52852]], [[12921, 12921], "mapped", [53440]], [[12922, 12922], "mapped", [54028]], [[12923, 12923], "mapped", [54616]], [[12924, 12924], "mapped", [52280, 44256]], [[12925, 12925], "mapped", [51452, 51032]], [[12926, 12926], "mapped", [50864]], [[12927, 12927], "valid", [], "NV8"], [[12928, 12928], "mapped", [19968]], [[12929, 12929], "mapped", [20108]], [[12930, 12930], "mapped", [19977]], [[12931, 12931], "mapped", [22235]], [[12932, 12932], "mapped", [20116]], [[12933, 12933], "mapped", [20845]], [[12934, 12934], "mapped", [19971]], [[12935, 12935], "mapped", [20843]], [[12936, 12936], "mapped", [20061]], [[12937, 12937], "mapped", [21313]], [[12938, 12938], "mapped", [26376]], [[12939, 12939], "mapped", [28779]], [[12940, 12940], "mapped", [27700]], [[12941, 12941], "mapped", [26408]], [[12942, 12942], "mapped", [37329]], [[12943, 12943], "mapped", [22303]], [[12944, 12944], "mapped", [26085]], [[12945, 12945], "mapped", [26666]], [[12946, 12946], "mapped", [26377]], [[12947, 12947], "mapped", [31038]], [[12948, 12948], "mapped", [21517]], [[12949, 12949], "mapped", [29305]], [[12950, 12950], "mapped", [36001]], [[12951, 12951], "mapped", [31069]], [[12952, 12952], "mapped", [21172]], [[12953, 12953], "mapped", [31192]], [[12954, 12954], "mapped", [30007]], [[12955, 12955], "mapped", [22899]], [[12956, 12956], "mapped", [36969]], [[12957, 12957], "mapped", [20778]], [[12958, 12958], "mapped", [21360]], [[12959, 12959], "mapped", [27880]], [[12960, 12960], "mapped", [38917]], [[12961, 12961], "mapped", [20241]], [[12962, 12962], "mapped", [20889]], [[12963, 12963], "mapped", [27491]], [[12964, 12964], "mapped", [19978]], [[12965, 12965], "mapped", [20013]], [[12966, 12966], "mapped", [19979]], [[12967, 12967], "mapped", [24038]], [[12968, 12968], "mapped", [21491]], [[12969, 12969], "mapped", [21307]], [[12970, 12970], "mapped", [23447]], [[12971, 12971], "mapped", [23398]], [[12972, 12972], "mapped", [30435]], [[12973, 12973], "mapped", [20225]], [[12974, 12974], "mapped", [36039]], [[12975, 12975], "mapped", [21332]], [[12976, 12976], "mapped", [22812]], [[12977, 12977], "mapped", [51, 54]], [[12978, 12978], "mapped", [51, 55]], [[12979, 12979], "mapped", [51, 56]], [[12980, 12980], "mapped", [51, 57]], [[12981, 12981], "mapped", [52, 48]], [[12982, 12982], "mapped", [52, 49]], [[12983, 12983], "mapped", [52, 50]], [[12984, 12984], "mapped", [52, 51]], [[12985, 12985], "mapped", [52, 52]], [[12986, 12986], "mapped", [52, 53]], [[12987, 12987], "mapped", [52, 54]], [[12988, 12988], "mapped", [52, 55]], [[12989, 12989], "mapped", [52, 56]], [[12990, 12990], "mapped", [52, 57]], [[12991, 12991], "mapped", [53, 48]], [[12992, 12992], "mapped", [49, 26376]], [[12993, 12993], "mapped", [50, 26376]], [[12994, 12994], "mapped", [51, 26376]], [[12995, 12995], "mapped", [52, 26376]], [[12996, 12996], "mapped", [53, 26376]], [[12997, 12997], "mapped", [54, 26376]], [[12998, 12998], "mapped", [55, 26376]], [[12999, 12999], "mapped", [56, 26376]], [[13e3, 13e3], "mapped", [57, 26376]], [[13001, 13001], "mapped", [49, 48, 26376]], [[13002, 13002], "mapped", [49, 49, 26376]], [[13003, 13003], "mapped", [49, 50, 26376]], [[13004, 13004], "mapped", [104, 103]], [[13005, 13005], "mapped", [101, 114, 103]], [[13006, 13006], "mapped", [101, 118]], [[13007, 13007], "mapped", [108, 116, 100]], [[13008, 13008], "mapped", [12450]], [[13009, 13009], "mapped", [12452]], [[13010, 13010], "mapped", [12454]], [[13011, 13011], "mapped", [12456]], [[13012, 13012], "mapped", [12458]], [[13013, 13013], "mapped", [12459]], [[13014, 13014], "mapped", [12461]], [[13015, 13015], "mapped", [12463]], [[13016, 13016], "mapped", [12465]], [[13017, 13017], "mapped", [12467]], [[13018, 13018], "mapped", [12469]], [[13019, 13019], "mapped", [12471]], [[13020, 13020], "mapped", [12473]], [[13021, 13021], "mapped", [12475]], [[13022, 13022], "mapped", [12477]], [[13023, 13023], "mapped", [12479]], [[13024, 13024], "mapped", [12481]], [[13025, 13025], "mapped", [12484]], [[13026, 13026], "mapped", [12486]], [[13027, 13027], "mapped", [12488]], [[13028, 13028], "mapped", [12490]], [[13029, 13029], "mapped", [12491]], [[13030, 13030], "mapped", [12492]], [[13031, 13031], "mapped", [12493]], [[13032, 13032], "mapped", [12494]], [[13033, 13033], "mapped", [12495]], [[13034, 13034], "mapped", [12498]], [[13035, 13035], "mapped", [12501]], [[13036, 13036], "mapped", [12504]], [[13037, 13037], "mapped", [12507]], [[13038, 13038], "mapped", [12510]], [[13039, 13039], "mapped", [12511]], [[13040, 13040], "mapped", [12512]], [[13041, 13041], "mapped", [12513]], [[13042, 13042], "mapped", [12514]], [[13043, 13043], "mapped", [12516]], [[13044, 13044], "mapped", [12518]], [[13045, 13045], "mapped", [12520]], [[13046, 13046], "mapped", [12521]], [[13047, 13047], "mapped", [12522]], [[13048, 13048], "mapped", [12523]], [[13049, 13049], "mapped", [12524]], [[13050, 13050], "mapped", [12525]], [[13051, 13051], "mapped", [12527]], [[13052, 13052], "mapped", [12528]], [[13053, 13053], "mapped", [12529]], [[13054, 13054], "mapped", [12530]], [[13055, 13055], "disallowed"], [[13056, 13056], "mapped", [12450, 12497, 12540, 12488]], [[13057, 13057], "mapped", [12450, 12523, 12501, 12449]], [[13058, 13058], "mapped", [12450, 12531, 12506, 12450]], [[13059, 13059], "mapped", [12450, 12540, 12523]], [[13060, 13060], "mapped", [12452, 12491, 12531, 12464]], [[13061, 13061], "mapped", [12452, 12531, 12481]], [[13062, 13062], "mapped", [12454, 12457, 12531]], [[13063, 13063], "mapped", [12456, 12473, 12463, 12540, 12489]], [[13064, 13064], "mapped", [12456, 12540, 12459, 12540]], [[13065, 13065], "mapped", [12458, 12531, 12473]], [[13066, 13066], "mapped", [12458, 12540, 12512]], [[13067, 13067], "mapped", [12459, 12452, 12522]], [[13068, 13068], "mapped", [12459, 12521, 12483, 12488]], [[13069, 13069], "mapped", [12459, 12525, 12522, 12540]], [[13070, 13070], "mapped", [12460, 12525, 12531]], [[13071, 13071], "mapped", [12460, 12531, 12510]], [[13072, 13072], "mapped", [12462, 12460]], [[13073, 13073], "mapped", [12462, 12491, 12540]], [[13074, 13074], "mapped", [12461, 12517, 12522, 12540]], [[13075, 13075], "mapped", [12462, 12523, 12480, 12540]], [[13076, 13076], "mapped", [12461, 12525]], [[13077, 13077], "mapped", [12461, 12525, 12464, 12521, 12512]], [[13078, 13078], "mapped", [12461, 12525, 12513, 12540, 12488, 12523]], [[13079, 13079], "mapped", [12461, 12525, 12527, 12483, 12488]], [[13080, 13080], "mapped", [12464, 12521, 12512]], [[13081, 13081], "mapped", [12464, 12521, 12512, 12488, 12531]], [[13082, 13082], "mapped", [12463, 12523, 12476, 12452, 12525]], [[13083, 13083], "mapped", [12463, 12525, 12540, 12493]], [[13084, 13084], "mapped", [12465, 12540, 12473]], [[13085, 13085], "mapped", [12467, 12523, 12490]], [[13086, 13086], "mapped", [12467, 12540, 12509]], [[13087, 13087], "mapped", [12469, 12452, 12463, 12523]], [[13088, 13088], "mapped", [12469, 12531, 12481, 12540, 12512]], [[13089, 13089], "mapped", [12471, 12522, 12531, 12464]], [[13090, 13090], "mapped", [12475, 12531, 12481]], [[13091, 13091], "mapped", [12475, 12531, 12488]], [[13092, 13092], "mapped", [12480, 12540, 12473]], [[13093, 13093], "mapped", [12487, 12471]], [[13094, 13094], "mapped", [12489, 12523]], [[13095, 13095], "mapped", [12488, 12531]], [[13096, 13096], "mapped", [12490, 12494]], [[13097, 13097], "mapped", [12494, 12483, 12488]], [[13098, 13098], "mapped", [12495, 12452, 12484]], [[13099, 13099], "mapped", [12497, 12540, 12475, 12531, 12488]], [[13100, 13100], "mapped", [12497, 12540, 12484]], [[13101, 13101], "mapped", [12496, 12540, 12524, 12523]], [[13102, 13102], "mapped", [12500, 12450, 12473, 12488, 12523]], [[13103, 13103], "mapped", [12500, 12463, 12523]], [[13104, 13104], "mapped", [12500, 12467]], [[13105, 13105], "mapped", [12499, 12523]], [[13106, 13106], "mapped", [12501, 12449, 12521, 12483, 12489]], [[13107, 13107], "mapped", [12501, 12451, 12540, 12488]], [[13108, 13108], "mapped", [12502, 12483, 12471, 12455, 12523]], [[13109, 13109], "mapped", [12501, 12521, 12531]], [[13110, 13110], "mapped", [12504, 12463, 12479, 12540, 12523]], [[13111, 13111], "mapped", [12506, 12477]], [[13112, 13112], "mapped", [12506, 12491, 12498]], [[13113, 13113], "mapped", [12504, 12523, 12484]], [[13114, 13114], "mapped", [12506, 12531, 12473]], [[13115, 13115], "mapped", [12506, 12540, 12472]], [[13116, 13116], "mapped", [12505, 12540, 12479]], [[13117, 13117], "mapped", [12509, 12452, 12531, 12488]], [[13118, 13118], "mapped", [12508, 12523, 12488]], [[13119, 13119], "mapped", [12507, 12531]], [[13120, 13120], "mapped", [12509, 12531, 12489]], [[13121, 13121], "mapped", [12507, 12540, 12523]], [[13122, 13122], "mapped", [12507, 12540, 12531]], [[13123, 13123], "mapped", [12510, 12452, 12463, 12525]], [[13124, 13124], "mapped", [12510, 12452, 12523]], [[13125, 13125], "mapped", [12510, 12483, 12495]], [[13126, 13126], "mapped", [12510, 12523, 12463]], [[13127, 13127], "mapped", [12510, 12531, 12471, 12519, 12531]], [[13128, 13128], "mapped", [12511, 12463, 12525, 12531]], [[13129, 13129], "mapped", [12511, 12522]], [[13130, 13130], "mapped", [12511, 12522, 12496, 12540, 12523]], [[13131, 13131], "mapped", [12513, 12460]], [[13132, 13132], "mapped", [12513, 12460, 12488, 12531]], [[13133, 13133], "mapped", [12513, 12540, 12488, 12523]], [[13134, 13134], "mapped", [12516, 12540, 12489]], [[13135, 13135], "mapped", [12516, 12540, 12523]], [[13136, 13136], "mapped", [12518, 12450, 12531]], [[13137, 13137], "mapped", [12522, 12483, 12488, 12523]], [[13138, 13138], "mapped", [12522, 12521]], [[13139, 13139], "mapped", [12523, 12500, 12540]], [[13140, 13140], "mapped", [12523, 12540, 12502, 12523]], [[13141, 13141], "mapped", [12524, 12512]], [[13142, 13142], "mapped", [12524, 12531, 12488, 12466, 12531]], [[13143, 13143], "mapped", [12527, 12483, 12488]], [[13144, 13144], "mapped", [48, 28857]], [[13145, 13145], "mapped", [49, 28857]], [[13146, 13146], "mapped", [50, 28857]], [[13147, 13147], "mapped", [51, 28857]], [[13148, 13148], "mapped", [52, 28857]], [[13149, 13149], "mapped", [53, 28857]], [[13150, 13150], "mapped", [54, 28857]], [[13151, 13151], "mapped", [55, 28857]], [[13152, 13152], "mapped", [56, 28857]], [[13153, 13153], "mapped", [57, 28857]], [[13154, 13154], "mapped", [49, 48, 28857]], [[13155, 13155], "mapped", [49, 49, 28857]], [[13156, 13156], "mapped", [49, 50, 28857]], [[13157, 13157], "mapped", [49, 51, 28857]], [[13158, 13158], "mapped", [49, 52, 28857]], [[13159, 13159], "mapped", [49, 53, 28857]], [[13160, 13160], "mapped", [49, 54, 28857]], [[13161, 13161], "mapped", [49, 55, 28857]], [[13162, 13162], "mapped", [49, 56, 28857]], [[13163, 13163], "mapped", [49, 57, 28857]], [[13164, 13164], "mapped", [50, 48, 28857]], [[13165, 13165], "mapped", [50, 49, 28857]], [[13166, 13166], "mapped", [50, 50, 28857]], [[13167, 13167], "mapped", [50, 51, 28857]], [[13168, 13168], "mapped", [50, 52, 28857]], [[13169, 13169], "mapped", [104, 112, 97]], [[13170, 13170], "mapped", [100, 97]], [[13171, 13171], "mapped", [97, 117]], [[13172, 13172], "mapped", [98, 97, 114]], [[13173, 13173], "mapped", [111, 118]], [[13174, 13174], "mapped", [112, 99]], [[13175, 13175], "mapped", [100, 109]], [[13176, 13176], "mapped", [100, 109, 50]], [[13177, 13177], "mapped", [100, 109, 51]], [[13178, 13178], "mapped", [105, 117]], [[13179, 13179], "mapped", [24179, 25104]], [[13180, 13180], "mapped", [26157, 21644]], [[13181, 13181], "mapped", [22823, 27491]], [[13182, 13182], "mapped", [26126, 27835]], [[13183, 13183], "mapped", [26666, 24335, 20250, 31038]], [[13184, 13184], "mapped", [112, 97]], [[13185, 13185], "mapped", [110, 97]], [[13186, 13186], "mapped", [956, 97]], [[13187, 13187], "mapped", [109, 97]], [[13188, 13188], "mapped", [107, 97]], [[13189, 13189], "mapped", [107, 98]], [[13190, 13190], "mapped", [109, 98]], [[13191, 13191], "mapped", [103, 98]], [[13192, 13192], "mapped", [99, 97, 108]], [[13193, 13193], "mapped", [107, 99, 97, 108]], [[13194, 13194], "mapped", [112, 102]], [[13195, 13195], "mapped", [110, 102]], [[13196, 13196], "mapped", [956, 102]], [[13197, 13197], "mapped", [956, 103]], [[13198, 13198], "mapped", [109, 103]], [[13199, 13199], "mapped", [107, 103]], [[13200, 13200], "mapped", [104, 122]], [[13201, 13201], "mapped", [107, 104, 122]], [[13202, 13202], "mapped", [109, 104, 122]], [[13203, 13203], "mapped", [103, 104, 122]], [[13204, 13204], "mapped", [116, 104, 122]], [[13205, 13205], "mapped", [956, 108]], [[13206, 13206], "mapped", [109, 108]], [[13207, 13207], "mapped", [100, 108]], [[13208, 13208], "mapped", [107, 108]], [[13209, 13209], "mapped", [102, 109]], [[13210, 13210], "mapped", [110, 109]], [[13211, 13211], "mapped", [956, 109]], [[13212, 13212], "mapped", [109, 109]], [[13213, 13213], "mapped", [99, 109]], [[13214, 13214], "mapped", [107, 109]], [[13215, 13215], "mapped", [109, 109, 50]], [[13216, 13216], "mapped", [99, 109, 50]], [[13217, 13217], "mapped", [109, 50]], [[13218, 13218], "mapped", [107, 109, 50]], [[13219, 13219], "mapped", [109, 109, 51]], [[13220, 13220], "mapped", [99, 109, 51]], [[13221, 13221], "mapped", [109, 51]], [[13222, 13222], "mapped", [107, 109, 51]], [[13223, 13223], "mapped", [109, 8725, 115]], [[13224, 13224], "mapped", [109, 8725, 115, 50]], [[13225, 13225], "mapped", [112, 97]], [[13226, 13226], "mapped", [107, 112, 97]], [[13227, 13227], "mapped", [109, 112, 97]], [[13228, 13228], "mapped", [103, 112, 97]], [[13229, 13229], "mapped", [114, 97, 100]], [[13230, 13230], "mapped", [114, 97, 100, 8725, 115]], [[13231, 13231], "mapped", [114, 97, 100, 8725, 115, 50]], [[13232, 13232], "mapped", [112, 115]], [[13233, 13233], "mapped", [110, 115]], [[13234, 13234], "mapped", [956, 115]], [[13235, 13235], "mapped", [109, 115]], [[13236, 13236], "mapped", [112, 118]], [[13237, 13237], "mapped", [110, 118]], [[13238, 13238], "mapped", [956, 118]], [[13239, 13239], "mapped", [109, 118]], [[13240, 13240], "mapped", [107, 118]], [[13241, 13241], "mapped", [109, 118]], [[13242, 13242], "mapped", [112, 119]], [[13243, 13243], "mapped", [110, 119]], [[13244, 13244], "mapped", [956, 119]], [[13245, 13245], "mapped", [109, 119]], [[13246, 13246], "mapped", [107, 119]], [[13247, 13247], "mapped", [109, 119]], [[13248, 13248], "mapped", [107, 969]], [[13249, 13249], "mapped", [109, 969]], [[13250, 13250], "disallowed"], [[13251, 13251], "mapped", [98, 113]], [[13252, 13252], "mapped", [99, 99]], [[13253, 13253], "mapped", [99, 100]], [[13254, 13254], "mapped", [99, 8725, 107, 103]], [[13255, 13255], "disallowed"], [[13256, 13256], "mapped", [100, 98]], [[13257, 13257], "mapped", [103, 121]], [[13258, 13258], "mapped", [104, 97]], [[13259, 13259], "mapped", [104, 112]], [[13260, 13260], "mapped", [105, 110]], [[13261, 13261], "mapped", [107, 107]], [[13262, 13262], "mapped", [107, 109]], [[13263, 13263], "mapped", [107, 116]], [[13264, 13264], "mapped", [108, 109]], [[13265, 13265], "mapped", [108, 110]], [[13266, 13266], "mapped", [108, 111, 103]], [[13267, 13267], "mapped", [108, 120]], [[13268, 13268], "mapped", [109, 98]], [[13269, 13269], "mapped", [109, 105, 108]], [[13270, 13270], "mapped", [109, 111, 108]], [[13271, 13271], "mapped", [112, 104]], [[13272, 13272], "disallowed"], [[13273, 13273], "mapped", [112, 112, 109]], [[13274, 13274], "mapped", [112, 114]], [[13275, 13275], "mapped", [115, 114]], [[13276, 13276], "mapped", [115, 118]], [[13277, 13277], "mapped", [119, 98]], [[13278, 13278], "mapped", [118, 8725, 109]], [[13279, 13279], "mapped", [97, 8725, 109]], [[13280, 13280], "mapped", [49, 26085]], [[13281, 13281], "mapped", [50, 26085]], [[13282, 13282], "mapped", [51, 26085]], [[13283, 13283], "mapped", [52, 26085]], [[13284, 13284], "mapped", [53, 26085]], [[13285, 13285], "mapped", [54, 26085]], [[13286, 13286], "mapped", [55, 26085]], [[13287, 13287], "mapped", [56, 26085]], [[13288, 13288], "mapped", [57, 26085]], [[13289, 13289], "mapped", [49, 48, 26085]], [[13290, 13290], "mapped", [49, 49, 26085]], [[13291, 13291], "mapped", [49, 50, 26085]], [[13292, 13292], "mapped", [49, 51, 26085]], [[13293, 13293], "mapped", [49, 52, 26085]], [[13294, 13294], "mapped", [49, 53, 26085]], [[13295, 13295], "mapped", [49, 54, 26085]], [[13296, 13296], "mapped", [49, 55, 26085]], [[13297, 13297], "mapped", [49, 56, 26085]], [[13298, 13298], "mapped", [49, 57, 26085]], [[13299, 13299], "mapped", [50, 48, 26085]], [[13300, 13300], "mapped", [50, 49, 26085]], [[13301, 13301], "mapped", [50, 50, 26085]], [[13302, 13302], "mapped", [50, 51, 26085]], [[13303, 13303], "mapped", [50, 52, 26085]], [[13304, 13304], "mapped", [50, 53, 26085]], [[13305, 13305], "mapped", [50, 54, 26085]], [[13306, 13306], "mapped", [50, 55, 26085]], [[13307, 13307], "mapped", [50, 56, 26085]], [[13308, 13308], "mapped", [50, 57, 26085]], [[13309, 13309], "mapped", [51, 48, 26085]], [[13310, 13310], "mapped", [51, 49, 26085]], [[13311, 13311], "mapped", [103, 97, 108]], [[13312, 19893], "valid"], [[19894, 19903], "disallowed"], [[19904, 19967], "valid", [], "NV8"], [[19968, 40869], "valid"], [[40870, 40891], "valid"], [[40892, 40899], "valid"], [[40900, 40907], "valid"], [[40908, 40908], "valid"], [[40909, 40917], "valid"], [[40918, 40959], "disallowed"], [[40960, 42124], "valid"], [[42125, 42127], "disallowed"], [[42128, 42145], "valid", [], "NV8"], [[42146, 42147], "valid", [], "NV8"], [[42148, 42163], "valid", [], "NV8"], [[42164, 42164], "valid", [], "NV8"], [[42165, 42176], "valid", [], "NV8"], [[42177, 42177], "valid", [], "NV8"], [[42178, 42180], "valid", [], "NV8"], [[42181, 42181], "valid", [], "NV8"], [[42182, 42182], "valid", [], "NV8"], [[42183, 42191], "disallowed"], [[42192, 42237], "valid"], [[42238, 42239], "valid", [], "NV8"], [[42240, 42508], "valid"], [[42509, 42511], "valid", [], "NV8"], [[42512, 42539], "valid"], [[42540, 42559], "disallowed"], [[42560, 42560], "mapped", [42561]], [[42561, 42561], "valid"], [[42562, 42562], "mapped", [42563]], [[42563, 42563], "valid"], [[42564, 42564], "mapped", [42565]], [[42565, 42565], "valid"], [[42566, 42566], "mapped", [42567]], [[42567, 42567], "valid"], [[42568, 42568], "mapped", [42569]], [[42569, 42569], "valid"], [[42570, 42570], "mapped", [42571]], [[42571, 42571], "valid"], [[42572, 42572], "mapped", [42573]], [[42573, 42573], "valid"], [[42574, 42574], "mapped", [42575]], [[42575, 42575], "valid"], [[42576, 42576], "mapped", [42577]], [[42577, 42577], "valid"], [[42578, 42578], "mapped", [42579]], [[42579, 42579], "valid"], [[42580, 42580], "mapped", [42581]], [[42581, 42581], "valid"], [[42582, 42582], "mapped", [42583]], [[42583, 42583], "valid"], [[42584, 42584], "mapped", [42585]], [[42585, 42585], "valid"], [[42586, 42586], "mapped", [42587]], [[42587, 42587], "valid"], [[42588, 42588], "mapped", [42589]], [[42589, 42589], "valid"], [[42590, 42590], "mapped", [42591]], [[42591, 42591], "valid"], [[42592, 42592], "mapped", [42593]], [[42593, 42593], "valid"], [[42594, 42594], "mapped", [42595]], [[42595, 42595], "valid"], [[42596, 42596], "mapped", [42597]], [[42597, 42597], "valid"], [[42598, 42598], "mapped", [42599]], [[42599, 42599], "valid"], [[42600, 42600], "mapped", [42601]], [[42601, 42601], "valid"], [[42602, 42602], "mapped", [42603]], [[42603, 42603], "valid"], [[42604, 42604], "mapped", [42605]], [[42605, 42607], "valid"], [[42608, 42611], "valid", [], "NV8"], [[42612, 42619], "valid"], [[42620, 42621], "valid"], [[42622, 42622], "valid", [], "NV8"], [[42623, 42623], "valid"], [[42624, 42624], "mapped", [42625]], [[42625, 42625], "valid"], [[42626, 42626], "mapped", [42627]], [[42627, 42627], "valid"], [[42628, 42628], "mapped", [42629]], [[42629, 42629], "valid"], [[42630, 42630], "mapped", [42631]], [[42631, 42631], "valid"], [[42632, 42632], "mapped", [42633]], [[42633, 42633], "valid"], [[42634, 42634], "mapped", [42635]], [[42635, 42635], "valid"], [[42636, 42636], "mapped", [42637]], [[42637, 42637], "valid"], [[42638, 42638], "mapped", [42639]], [[42639, 42639], "valid"], [[42640, 42640], "mapped", [42641]], [[42641, 42641], "valid"], [[42642, 42642], "mapped", [42643]], [[42643, 42643], "valid"], [[42644, 42644], "mapped", [42645]], [[42645, 42645], "valid"], [[42646, 42646], "mapped", [42647]], [[42647, 42647], "valid"], [[42648, 42648], "mapped", [42649]], [[42649, 42649], "valid"], [[42650, 42650], "mapped", [42651]], [[42651, 42651], "valid"], [[42652, 42652], "mapped", [1098]], [[42653, 42653], "mapped", [1100]], [[42654, 42654], "valid"], [[42655, 42655], "valid"], [[42656, 42725], "valid"], [[42726, 42735], "valid", [], "NV8"], [[42736, 42737], "valid"], [[42738, 42743], "valid", [], "NV8"], [[42744, 42751], "disallowed"], [[42752, 42774], "valid", [], "NV8"], [[42775, 42778], "valid"], [[42779, 42783], "valid"], [[42784, 42785], "valid", [], "NV8"], [[42786, 42786], "mapped", [42787]], [[42787, 42787], "valid"], [[42788, 42788], "mapped", [42789]], [[42789, 42789], "valid"], [[42790, 42790], "mapped", [42791]], [[42791, 42791], "valid"], [[42792, 42792], "mapped", [42793]], [[42793, 42793], "valid"], [[42794, 42794], "mapped", [42795]], [[42795, 42795], "valid"], [[42796, 42796], "mapped", [42797]], [[42797, 42797], "valid"], [[42798, 42798], "mapped", [42799]], [[42799, 42801], "valid"], [[42802, 42802], "mapped", [42803]], [[42803, 42803], "valid"], [[42804, 42804], "mapped", [42805]], [[42805, 42805], "valid"], [[42806, 42806], "mapped", [42807]], [[42807, 42807], "valid"], [[42808, 42808], "mapped", [42809]], [[42809, 42809], "valid"], [[42810, 42810], "mapped", [42811]], [[42811, 42811], "valid"], [[42812, 42812], "mapped", [42813]], [[42813, 42813], "valid"], [[42814, 42814], "mapped", [42815]], [[42815, 42815], "valid"], [[42816, 42816], "mapped", [42817]], [[42817, 42817], "valid"], [[42818, 42818], "mapped", [42819]], [[42819, 42819], "valid"], [[42820, 42820], "mapped", [42821]], [[42821, 42821], "valid"], [[42822, 42822], "mapped", [42823]], [[42823, 42823], "valid"], [[42824, 42824], "mapped", [42825]], [[42825, 42825], "valid"], [[42826, 42826], "mapped", [42827]], [[42827, 42827], "valid"], [[42828, 42828], "mapped", [42829]], [[42829, 42829], "valid"], [[42830, 42830], "mapped", [42831]], [[42831, 42831], "valid"], [[42832, 42832], "mapped", [42833]], [[42833, 42833], "valid"], [[42834, 42834], "mapped", [42835]], [[42835, 42835], "valid"], [[42836, 42836], "mapped", [42837]], [[42837, 42837], "valid"], [[42838, 42838], "mapped", [42839]], [[42839, 42839], "valid"], [[42840, 42840], "mapped", [42841]], [[42841, 42841], "valid"], [[42842, 42842], "mapped", [42843]], [[42843, 42843], "valid"], [[42844, 42844], "mapped", [42845]], [[42845, 42845], "valid"], [[42846, 42846], "mapped", [42847]], [[42847, 42847], "valid"], [[42848, 42848], "mapped", [42849]], [[42849, 42849], "valid"], [[42850, 42850], "mapped", [42851]], [[42851, 42851], "valid"], [[42852, 42852], "mapped", [42853]], [[42853, 42853], "valid"], [[42854, 42854], "mapped", [42855]], [[42855, 42855], "valid"], [[42856, 42856], "mapped", [42857]], [[42857, 42857], "valid"], [[42858, 42858], "mapped", [42859]], [[42859, 42859], "valid"], [[42860, 42860], "mapped", [42861]], [[42861, 42861], "valid"], [[42862, 42862], "mapped", [42863]], [[42863, 42863], "valid"], [[42864, 42864], "mapped", [42863]], [[42865, 42872], "valid"], [[42873, 42873], "mapped", [42874]], [[42874, 42874], "valid"], [[42875, 42875], "mapped", [42876]], [[42876, 42876], "valid"], [[42877, 42877], "mapped", [7545]], [[42878, 42878], "mapped", [42879]], [[42879, 42879], "valid"], [[42880, 42880], "mapped", [42881]], [[42881, 42881], "valid"], [[42882, 42882], "mapped", [42883]], [[42883, 42883], "valid"], [[42884, 42884], "mapped", [42885]], [[42885, 42885], "valid"], [[42886, 42886], "mapped", [42887]], [[42887, 42888], "valid"], [[42889, 42890], "valid", [], "NV8"], [[42891, 42891], "mapped", [42892]], [[42892, 42892], "valid"], [[42893, 42893], "mapped", [613]], [[42894, 42894], "valid"], [[42895, 42895], "valid"], [[42896, 42896], "mapped", [42897]], [[42897, 42897], "valid"], [[42898, 42898], "mapped", [42899]], [[42899, 42899], "valid"], [[42900, 42901], "valid"], [[42902, 42902], "mapped", [42903]], [[42903, 42903], "valid"], [[42904, 42904], "mapped", [42905]], [[42905, 42905], "valid"], [[42906, 42906], "mapped", [42907]], [[42907, 42907], "valid"], [[42908, 42908], "mapped", [42909]], [[42909, 42909], "valid"], [[42910, 42910], "mapped", [42911]], [[42911, 42911], "valid"], [[42912, 42912], "mapped", [42913]], [[42913, 42913], "valid"], [[42914, 42914], "mapped", [42915]], [[42915, 42915], "valid"], [[42916, 42916], "mapped", [42917]], [[42917, 42917], "valid"], [[42918, 42918], "mapped", [42919]], [[42919, 42919], "valid"], [[42920, 42920], "mapped", [42921]], [[42921, 42921], "valid"], [[42922, 42922], "mapped", [614]], [[42923, 42923], "mapped", [604]], [[42924, 42924], "mapped", [609]], [[42925, 42925], "mapped", [620]], [[42926, 42927], "disallowed"], [[42928, 42928], "mapped", [670]], [[42929, 42929], "mapped", [647]], [[42930, 42930], "mapped", [669]], [[42931, 42931], "mapped", [43859]], [[42932, 42932], "mapped", [42933]], [[42933, 42933], "valid"], [[42934, 42934], "mapped", [42935]], [[42935, 42935], "valid"], [[42936, 42998], "disallowed"], [[42999, 42999], "valid"], [[43e3, 43e3], "mapped", [295]], [[43001, 43001], "mapped", [339]], [[43002, 43002], "valid"], [[43003, 43007], "valid"], [[43008, 43047], "valid"], [[43048, 43051], "valid", [], "NV8"], [[43052, 43055], "disallowed"], [[43056, 43065], "valid", [], "NV8"], [[43066, 43071], "disallowed"], [[43072, 43123], "valid"], [[43124, 43127], "valid", [], "NV8"], [[43128, 43135], "disallowed"], [[43136, 43204], "valid"], [[43205, 43213], "disallowed"], [[43214, 43215], "valid", [], "NV8"], [[43216, 43225], "valid"], [[43226, 43231], "disallowed"], [[43232, 43255], "valid"], [[43256, 43258], "valid", [], "NV8"], [[43259, 43259], "valid"], [[43260, 43260], "valid", [], "NV8"], [[43261, 43261], "valid"], [[43262, 43263], "disallowed"], [[43264, 43309], "valid"], [[43310, 43311], "valid", [], "NV8"], [[43312, 43347], "valid"], [[43348, 43358], "disallowed"], [[43359, 43359], "valid", [], "NV8"], [[43360, 43388], "valid", [], "NV8"], [[43389, 43391], "disallowed"], [[43392, 43456], "valid"], [[43457, 43469], "valid", [], "NV8"], [[43470, 43470], "disallowed"], [[43471, 43481], "valid"], [[43482, 43485], "disallowed"], [[43486, 43487], "valid", [], "NV8"], [[43488, 43518], "valid"], [[43519, 43519], "disallowed"], [[43520, 43574], "valid"], [[43575, 43583], "disallowed"], [[43584, 43597], "valid"], [[43598, 43599], "disallowed"], [[43600, 43609], "valid"], [[43610, 43611], "disallowed"], [[43612, 43615], "valid", [], "NV8"], [[43616, 43638], "valid"], [[43639, 43641], "valid", [], "NV8"], [[43642, 43643], "valid"], [[43644, 43647], "valid"], [[43648, 43714], "valid"], [[43715, 43738], "disallowed"], [[43739, 43741], "valid"], [[43742, 43743], "valid", [], "NV8"], [[43744, 43759], "valid"], [[43760, 43761], "valid", [], "NV8"], [[43762, 43766], "valid"], [[43767, 43776], "disallowed"], [[43777, 43782], "valid"], [[43783, 43784], "disallowed"], [[43785, 43790], "valid"], [[43791, 43792], "disallowed"], [[43793, 43798], "valid"], [[43799, 43807], "disallowed"], [[43808, 43814], "valid"], [[43815, 43815], "disallowed"], [[43816, 43822], "valid"], [[43823, 43823], "disallowed"], [[43824, 43866], "valid"], [[43867, 43867], "valid", [], "NV8"], [[43868, 43868], "mapped", [42791]], [[43869, 43869], "mapped", [43831]], [[43870, 43870], "mapped", [619]], [[43871, 43871], "mapped", [43858]], [[43872, 43875], "valid"], [[43876, 43877], "valid"], [[43878, 43887], "disallowed"], [[43888, 43888], "mapped", [5024]], [[43889, 43889], "mapped", [5025]], [[43890, 43890], "mapped", [5026]], [[43891, 43891], "mapped", [5027]], [[43892, 43892], "mapped", [5028]], [[43893, 43893], "mapped", [5029]], [[43894, 43894], "mapped", [5030]], [[43895, 43895], "mapped", [5031]], [[43896, 43896], "mapped", [5032]], [[43897, 43897], "mapped", [5033]], [[43898, 43898], "mapped", [5034]], [[43899, 43899], "mapped", [5035]], [[43900, 43900], "mapped", [5036]], [[43901, 43901], "mapped", [5037]], [[43902, 43902], "mapped", [5038]], [[43903, 43903], "mapped", [5039]], [[43904, 43904], "mapped", [5040]], [[43905, 43905], "mapped", [5041]], [[43906, 43906], "mapped", [5042]], [[43907, 43907], "mapped", [5043]], [[43908, 43908], "mapped", [5044]], [[43909, 43909], "mapped", [5045]], [[43910, 43910], "mapped", [5046]], [[43911, 43911], "mapped", [5047]], [[43912, 43912], "mapped", [5048]], [[43913, 43913], "mapped", [5049]], [[43914, 43914], "mapped", [5050]], [[43915, 43915], "mapped", [5051]], [[43916, 43916], "mapped", [5052]], [[43917, 43917], "mapped", [5053]], [[43918, 43918], "mapped", [5054]], [[43919, 43919], "mapped", [5055]], [[43920, 43920], "mapped", [5056]], [[43921, 43921], "mapped", [5057]], [[43922, 43922], "mapped", [5058]], [[43923, 43923], "mapped", [5059]], [[43924, 43924], "mapped", [5060]], [[43925, 43925], "mapped", [5061]], [[43926, 43926], "mapped", [5062]], [[43927, 43927], "mapped", [5063]], [[43928, 43928], "mapped", [5064]], [[43929, 43929], "mapped", [5065]], [[43930, 43930], "mapped", [5066]], [[43931, 43931], "mapped", [5067]], [[43932, 43932], "mapped", [5068]], [[43933, 43933], "mapped", [5069]], [[43934, 43934], "mapped", [5070]], [[43935, 43935], "mapped", [5071]], [[43936, 43936], "mapped", [5072]], [[43937, 43937], "mapped", [5073]], [[43938, 43938], "mapped", [5074]], [[43939, 43939], "mapped", [5075]], [[43940, 43940], "mapped", [5076]], [[43941, 43941], "mapped", [5077]], [[43942, 43942], "mapped", [5078]], [[43943, 43943], "mapped", [5079]], [[43944, 43944], "mapped", [5080]], [[43945, 43945], "mapped", [5081]], [[43946, 43946], "mapped", [5082]], [[43947, 43947], "mapped", [5083]], [[43948, 43948], "mapped", [5084]], [[43949, 43949], "mapped", [5085]], [[43950, 43950], "mapped", [5086]], [[43951, 43951], "mapped", [5087]], [[43952, 43952], "mapped", [5088]], [[43953, 43953], "mapped", [5089]], [[43954, 43954], "mapped", [5090]], [[43955, 43955], "mapped", [5091]], [[43956, 43956], "mapped", [5092]], [[43957, 43957], "mapped", [5093]], [[43958, 43958], "mapped", [5094]], [[43959, 43959], "mapped", [5095]], [[43960, 43960], "mapped", [5096]], [[43961, 43961], "mapped", [5097]], [[43962, 43962], "mapped", [5098]], [[43963, 43963], "mapped", [5099]], [[43964, 43964], "mapped", [5100]], [[43965, 43965], "mapped", [5101]], [[43966, 43966], "mapped", [5102]], [[43967, 43967], "mapped", [5103]], [[43968, 44010], "valid"], [[44011, 44011], "valid", [], "NV8"], [[44012, 44013], "valid"], [[44014, 44015], "disallowed"], [[44016, 44025], "valid"], [[44026, 44031], "disallowed"], [[44032, 55203], "valid"], [[55204, 55215], "disallowed"], [[55216, 55238], "valid", [], "NV8"], [[55239, 55242], "disallowed"], [[55243, 55291], "valid", [], "NV8"], [[55292, 55295], "disallowed"], [[55296, 57343], "disallowed"], [[57344, 63743], "disallowed"], [[63744, 63744], "mapped", [35912]], [[63745, 63745], "mapped", [26356]], [[63746, 63746], "mapped", [36554]], [[63747, 63747], "mapped", [36040]], [[63748, 63748], "mapped", [28369]], [[63749, 63749], "mapped", [20018]], [[63750, 63750], "mapped", [21477]], [[63751, 63752], "mapped", [40860]], [[63753, 63753], "mapped", [22865]], [[63754, 63754], "mapped", [37329]], [[63755, 63755], "mapped", [21895]], [[63756, 63756], "mapped", [22856]], [[63757, 63757], "mapped", [25078]], [[63758, 63758], "mapped", [30313]], [[63759, 63759], "mapped", [32645]], [[63760, 63760], "mapped", [34367]], [[63761, 63761], "mapped", [34746]], [[63762, 63762], "mapped", [35064]], [[63763, 63763], "mapped", [37007]], [[63764, 63764], "mapped", [27138]], [[63765, 63765], "mapped", [27931]], [[63766, 63766], "mapped", [28889]], [[63767, 63767], "mapped", [29662]], [[63768, 63768], "mapped", [33853]], [[63769, 63769], "mapped", [37226]], [[63770, 63770], "mapped", [39409]], [[63771, 63771], "mapped", [20098]], [[63772, 63772], "mapped", [21365]], [[63773, 63773], "mapped", [27396]], [[63774, 63774], "mapped", [29211]], [[63775, 63775], "mapped", [34349]], [[63776, 63776], "mapped", [40478]], [[63777, 63777], "mapped", [23888]], [[63778, 63778], "mapped", [28651]], [[63779, 63779], "mapped", [34253]], [[63780, 63780], "mapped", [35172]], [[63781, 63781], "mapped", [25289]], [[63782, 63782], "mapped", [33240]], [[63783, 63783], "mapped", [34847]], [[63784, 63784], "mapped", [24266]], [[63785, 63785], "mapped", [26391]], [[63786, 63786], "mapped", [28010]], [[63787, 63787], "mapped", [29436]], [[63788, 63788], "mapped", [37070]], [[63789, 63789], "mapped", [20358]], [[63790, 63790], "mapped", [20919]], [[63791, 63791], "mapped", [21214]], [[63792, 63792], "mapped", [25796]], [[63793, 63793], "mapped", [27347]], [[63794, 63794], "mapped", [29200]], [[63795, 63795], "mapped", [30439]], [[63796, 63796], "mapped", [32769]], [[63797, 63797], "mapped", [34310]], [[63798, 63798], "mapped", [34396]], [[63799, 63799], "mapped", [36335]], [[63800, 63800], "mapped", [38706]], [[63801, 63801], "mapped", [39791]], [[63802, 63802], "mapped", [40442]], [[63803, 63803], "mapped", [30860]], [[63804, 63804], "mapped", [31103]], [[63805, 63805], "mapped", [32160]], [[63806, 63806], "mapped", [33737]], [[63807, 63807], "mapped", [37636]], [[63808, 63808], "mapped", [40575]], [[63809, 63809], "mapped", [35542]], [[63810, 63810], "mapped", [22751]], [[63811, 63811], "mapped", [24324]], [[63812, 63812], "mapped", [31840]], [[63813, 63813], "mapped", [32894]], [[63814, 63814], "mapped", [29282]], [[63815, 63815], "mapped", [30922]], [[63816, 63816], "mapped", [36034]], [[63817, 63817], "mapped", [38647]], [[63818, 63818], "mapped", [22744]], [[63819, 63819], "mapped", [23650]], [[63820, 63820], "mapped", [27155]], [[63821, 63821], "mapped", [28122]], [[63822, 63822], "mapped", [28431]], [[63823, 63823], "mapped", [32047]], [[63824, 63824], "mapped", [32311]], [[63825, 63825], "mapped", [38475]], [[63826, 63826], "mapped", [21202]], [[63827, 63827], "mapped", [32907]], [[63828, 63828], "mapped", [20956]], [[63829, 63829], "mapped", [20940]], [[63830, 63830], "mapped", [31260]], [[63831, 63831], "mapped", [32190]], [[63832, 63832], "mapped", [33777]], [[63833, 63833], "mapped", [38517]], [[63834, 63834], "mapped", [35712]], [[63835, 63835], "mapped", [25295]], [[63836, 63836], "mapped", [27138]], [[63837, 63837], "mapped", [35582]], [[63838, 63838], "mapped", [20025]], [[63839, 63839], "mapped", [23527]], [[63840, 63840], "mapped", [24594]], [[63841, 63841], "mapped", [29575]], [[63842, 63842], "mapped", [30064]], [[63843, 63843], "mapped", [21271]], [[63844, 63844], "mapped", [30971]], [[63845, 63845], "mapped", [20415]], [[63846, 63846], "mapped", [24489]], [[63847, 63847], "mapped", [19981]], [[63848, 63848], "mapped", [27852]], [[63849, 63849], "mapped", [25976]], [[63850, 63850], "mapped", [32034]], [[63851, 63851], "mapped", [21443]], [[63852, 63852], "mapped", [22622]], [[63853, 63853], "mapped", [30465]], [[63854, 63854], "mapped", [33865]], [[63855, 63855], "mapped", [35498]], [[63856, 63856], "mapped", [27578]], [[63857, 63857], "mapped", [36784]], [[63858, 63858], "mapped", [27784]], [[63859, 63859], "mapped", [25342]], [[63860, 63860], "mapped", [33509]], [[63861, 63861], "mapped", [25504]], [[63862, 63862], "mapped", [30053]], [[63863, 63863], "mapped", [20142]], [[63864, 63864], "mapped", [20841]], [[63865, 63865], "mapped", [20937]], [[63866, 63866], "mapped", [26753]], [[63867, 63867], "mapped", [31975]], [[63868, 63868], "mapped", [33391]], [[63869, 63869], "mapped", [35538]], [[63870, 63870], "mapped", [37327]], [[63871, 63871], "mapped", [21237]], [[63872, 63872], "mapped", [21570]], [[63873, 63873], "mapped", [22899]], [[63874, 63874], "mapped", [24300]], [[63875, 63875], "mapped", [26053]], [[63876, 63876], "mapped", [28670]], [[63877, 63877], "mapped", [31018]], [[63878, 63878], "mapped", [38317]], [[63879, 63879], "mapped", [39530]], [[63880, 63880], "mapped", [40599]], [[63881, 63881], "mapped", [40654]], [[63882, 63882], "mapped", [21147]], [[63883, 63883], "mapped", [26310]], [[63884, 63884], "mapped", [27511]], [[63885, 63885], "mapped", [36706]], [[63886, 63886], "mapped", [24180]], [[63887, 63887], "mapped", [24976]], [[63888, 63888], "mapped", [25088]], [[63889, 63889], "mapped", [25754]], [[63890, 63890], "mapped", [28451]], [[63891, 63891], "mapped", [29001]], [[63892, 63892], "mapped", [29833]], [[63893, 63893], "mapped", [31178]], [[63894, 63894], "mapped", [32244]], [[63895, 63895], "mapped", [32879]], [[63896, 63896], "mapped", [36646]], [[63897, 63897], "mapped", [34030]], [[63898, 63898], "mapped", [36899]], [[63899, 63899], "mapped", [37706]], [[63900, 63900], "mapped", [21015]], [[63901, 63901], "mapped", [21155]], [[63902, 63902], "mapped", [21693]], [[63903, 63903], "mapped", [28872]], [[63904, 63904], "mapped", [35010]], [[63905, 63905], "mapped", [35498]], [[63906, 63906], "mapped", [24265]], [[63907, 63907], "mapped", [24565]], [[63908, 63908], "mapped", [25467]], [[63909, 63909], "mapped", [27566]], [[63910, 63910], "mapped", [31806]], [[63911, 63911], "mapped", [29557]], [[63912, 63912], "mapped", [20196]], [[63913, 63913], "mapped", [22265]], [[63914, 63914], "mapped", [23527]], [[63915, 63915], "mapped", [23994]], [[63916, 63916], "mapped", [24604]], [[63917, 63917], "mapped", [29618]], [[63918, 63918], "mapped", [29801]], [[63919, 63919], "mapped", [32666]], [[63920, 63920], "mapped", [32838]], [[63921, 63921], "mapped", [37428]], [[63922, 63922], "mapped", [38646]], [[63923, 63923], "mapped", [38728]], [[63924, 63924], "mapped", [38936]], [[63925, 63925], "mapped", [20363]], [[63926, 63926], "mapped", [31150]], [[63927, 63927], "mapped", [37300]], [[63928, 63928], "mapped", [38584]], [[63929, 63929], "mapped", [24801]], [[63930, 63930], "mapped", [20102]], [[63931, 63931], "mapped", [20698]], [[63932, 63932], "mapped", [23534]], [[63933, 63933], "mapped", [23615]], [[63934, 63934], "mapped", [26009]], [[63935, 63935], "mapped", [27138]], [[63936, 63936], "mapped", [29134]], [[63937, 63937], "mapped", [30274]], [[63938, 63938], "mapped", [34044]], [[63939, 63939], "mapped", [36988]], [[63940, 63940], "mapped", [40845]], [[63941, 63941], "mapped", [26248]], [[63942, 63942], "mapped", [38446]], [[63943, 63943], "mapped", [21129]], [[63944, 63944], "mapped", [26491]], [[63945, 63945], "mapped", [26611]], [[63946, 63946], "mapped", [27969]], [[63947, 63947], "mapped", [28316]], [[63948, 63948], "mapped", [29705]], [[63949, 63949], "mapped", [30041]], [[63950, 63950], "mapped", [30827]], [[63951, 63951], "mapped", [32016]], [[63952, 63952], "mapped", [39006]], [[63953, 63953], "mapped", [20845]], [[63954, 63954], "mapped", [25134]], [[63955, 63955], "mapped", [38520]], [[63956, 63956], "mapped", [20523]], [[63957, 63957], "mapped", [23833]], [[63958, 63958], "mapped", [28138]], [[63959, 63959], "mapped", [36650]], [[63960, 63960], "mapped", [24459]], [[63961, 63961], "mapped", [24900]], [[63962, 63962], "mapped", [26647]], [[63963, 63963], "mapped", [29575]], [[63964, 63964], "mapped", [38534]], [[63965, 63965], "mapped", [21033]], [[63966, 63966], "mapped", [21519]], [[63967, 63967], "mapped", [23653]], [[63968, 63968], "mapped", [26131]], [[63969, 63969], "mapped", [26446]], [[63970, 63970], "mapped", [26792]], [[63971, 63971], "mapped", [27877]], [[63972, 63972], "mapped", [29702]], [[63973, 63973], "mapped", [30178]], [[63974, 63974], "mapped", [32633]], [[63975, 63975], "mapped", [35023]], [[63976, 63976], "mapped", [35041]], [[63977, 63977], "mapped", [37324]], [[63978, 63978], "mapped", [38626]], [[63979, 63979], "mapped", [21311]], [[63980, 63980], "mapped", [28346]], [[63981, 63981], "mapped", [21533]], [[63982, 63982], "mapped", [29136]], [[63983, 63983], "mapped", [29848]], [[63984, 63984], "mapped", [34298]], [[63985, 63985], "mapped", [38563]], [[63986, 63986], "mapped", [40023]], [[63987, 63987], "mapped", [40607]], [[63988, 63988], "mapped", [26519]], [[63989, 63989], "mapped", [28107]], [[63990, 63990], "mapped", [33256]], [[63991, 63991], "mapped", [31435]], [[63992, 63992], "mapped", [31520]], [[63993, 63993], "mapped", [31890]], [[63994, 63994], "mapped", [29376]], [[63995, 63995], "mapped", [28825]], [[63996, 63996], "mapped", [35672]], [[63997, 63997], "mapped", [20160]], [[63998, 63998], "mapped", [33590]], [[63999, 63999], "mapped", [21050]], [[64e3, 64e3], "mapped", [20999]], [[64001, 64001], "mapped", [24230]], [[64002, 64002], "mapped", [25299]], [[64003, 64003], "mapped", [31958]], [[64004, 64004], "mapped", [23429]], [[64005, 64005], "mapped", [27934]], [[64006, 64006], "mapped", [26292]], [[64007, 64007], "mapped", [36667]], [[64008, 64008], "mapped", [34892]], [[64009, 64009], "mapped", [38477]], [[64010, 64010], "mapped", [35211]], [[64011, 64011], "mapped", [24275]], [[64012, 64012], "mapped", [20800]], [[64013, 64013], "mapped", [21952]], [[64014, 64015], "valid"], [[64016, 64016], "mapped", [22618]], [[64017, 64017], "valid"], [[64018, 64018], "mapped", [26228]], [[64019, 64020], "valid"], [[64021, 64021], "mapped", [20958]], [[64022, 64022], "mapped", [29482]], [[64023, 64023], "mapped", [30410]], [[64024, 64024], "mapped", [31036]], [[64025, 64025], "mapped", [31070]], [[64026, 64026], "mapped", [31077]], [[64027, 64027], "mapped", [31119]], [[64028, 64028], "mapped", [38742]], [[64029, 64029], "mapped", [31934]], [[64030, 64030], "mapped", [32701]], [[64031, 64031], "valid"], [[64032, 64032], "mapped", [34322]], [[64033, 64033], "valid"], [[64034, 64034], "mapped", [35576]], [[64035, 64036], "valid"], [[64037, 64037], "mapped", [36920]], [[64038, 64038], "mapped", [37117]], [[64039, 64041], "valid"], [[64042, 64042], "mapped", [39151]], [[64043, 64043], "mapped", [39164]], [[64044, 64044], "mapped", [39208]], [[64045, 64045], "mapped", [40372]], [[64046, 64046], "mapped", [37086]], [[64047, 64047], "mapped", [38583]], [[64048, 64048], "mapped", [20398]], [[64049, 64049], "mapped", [20711]], [[64050, 64050], "mapped", [20813]], [[64051, 64051], "mapped", [21193]], [[64052, 64052], "mapped", [21220]], [[64053, 64053], "mapped", [21329]], [[64054, 64054], "mapped", [21917]], [[64055, 64055], "mapped", [22022]], [[64056, 64056], "mapped", [22120]], [[64057, 64057], "mapped", [22592]], [[64058, 64058], "mapped", [22696]], [[64059, 64059], "mapped", [23652]], [[64060, 64060], "mapped", [23662]], [[64061, 64061], "mapped", [24724]], [[64062, 64062], "mapped", [24936]], [[64063, 64063], "mapped", [24974]], [[64064, 64064], "mapped", [25074]], [[64065, 64065], "mapped", [25935]], [[64066, 64066], "mapped", [26082]], [[64067, 64067], "mapped", [26257]], [[64068, 64068], "mapped", [26757]], [[64069, 64069], "mapped", [28023]], [[64070, 64070], "mapped", [28186]], [[64071, 64071], "mapped", [28450]], [[64072, 64072], "mapped", [29038]], [[64073, 64073], "mapped", [29227]], [[64074, 64074], "mapped", [29730]], [[64075, 64075], "mapped", [30865]], [[64076, 64076], "mapped", [31038]], [[64077, 64077], "mapped", [31049]], [[64078, 64078], "mapped", [31048]], [[64079, 64079], "mapped", [31056]], [[64080, 64080], "mapped", [31062]], [[64081, 64081], "mapped", [31069]], [[64082, 64082], "mapped", [31117]], [[64083, 64083], "mapped", [31118]], [[64084, 64084], "mapped", [31296]], [[64085, 64085], "mapped", [31361]], [[64086, 64086], "mapped", [31680]], [[64087, 64087], "mapped", [32244]], [[64088, 64088], "mapped", [32265]], [[64089, 64089], "mapped", [32321]], [[64090, 64090], "mapped", [32626]], [[64091, 64091], "mapped", [32773]], [[64092, 64092], "mapped", [33261]], [[64093, 64094], "mapped", [33401]], [[64095, 64095], "mapped", [33879]], [[64096, 64096], "mapped", [35088]], [[64097, 64097], "mapped", [35222]], [[64098, 64098], "mapped", [35585]], [[64099, 64099], "mapped", [35641]], [[64100, 64100], "mapped", [36051]], [[64101, 64101], "mapped", [36104]], [[64102, 64102], "mapped", [36790]], [[64103, 64103], "mapped", [36920]], [[64104, 64104], "mapped", [38627]], [[64105, 64105], "mapped", [38911]], [[64106, 64106], "mapped", [38971]], [[64107, 64107], "mapped", [24693]], [[64108, 64108], "mapped", [148206]], [[64109, 64109], "mapped", [33304]], [[64110, 64111], "disallowed"], [[64112, 64112], "mapped", [20006]], [[64113, 64113], "mapped", [20917]], [[64114, 64114], "mapped", [20840]], [[64115, 64115], "mapped", [20352]], [[64116, 64116], "mapped", [20805]], [[64117, 64117], "mapped", [20864]], [[64118, 64118], "mapped", [21191]], [[64119, 64119], "mapped", [21242]], [[64120, 64120], "mapped", [21917]], [[64121, 64121], "mapped", [21845]], [[64122, 64122], "mapped", [21913]], [[64123, 64123], "mapped", [21986]], [[64124, 64124], "mapped", [22618]], [[64125, 64125], "mapped", [22707]], [[64126, 64126], "mapped", [22852]], [[64127, 64127], "mapped", [22868]], [[64128, 64128], "mapped", [23138]], [[64129, 64129], "mapped", [23336]], [[64130, 64130], "mapped", [24274]], [[64131, 64131], "mapped", [24281]], [[64132, 64132], "mapped", [24425]], [[64133, 64133], "mapped", [24493]], [[64134, 64134], "mapped", [24792]], [[64135, 64135], "mapped", [24910]], [[64136, 64136], "mapped", [24840]], [[64137, 64137], "mapped", [24974]], [[64138, 64138], "mapped", [24928]], [[64139, 64139], "mapped", [25074]], [[64140, 64140], "mapped", [25140]], [[64141, 64141], "mapped", [25540]], [[64142, 64142], "mapped", [25628]], [[64143, 64143], "mapped", [25682]], [[64144, 64144], "mapped", [25942]], [[64145, 64145], "mapped", [26228]], [[64146, 64146], "mapped", [26391]], [[64147, 64147], "mapped", [26395]], [[64148, 64148], "mapped", [26454]], [[64149, 64149], "mapped", [27513]], [[64150, 64150], "mapped", [27578]], [[64151, 64151], "mapped", [27969]], [[64152, 64152], "mapped", [28379]], [[64153, 64153], "mapped", [28363]], [[64154, 64154], "mapped", [28450]], [[64155, 64155], "mapped", [28702]], [[64156, 64156], "mapped", [29038]], [[64157, 64157], "mapped", [30631]], [[64158, 64158], "mapped", [29237]], [[64159, 64159], "mapped", [29359]], [[64160, 64160], "mapped", [29482]], [[64161, 64161], "mapped", [29809]], [[64162, 64162], "mapped", [29958]], [[64163, 64163], "mapped", [30011]], [[64164, 64164], "mapped", [30237]], [[64165, 64165], "mapped", [30239]], [[64166, 64166], "mapped", [30410]], [[64167, 64167], "mapped", [30427]], [[64168, 64168], "mapped", [30452]], [[64169, 64169], "mapped", [30538]], [[64170, 64170], "mapped", [30528]], [[64171, 64171], "mapped", [30924]], [[64172, 64172], "mapped", [31409]], [[64173, 64173], "mapped", [31680]], [[64174, 64174], "mapped", [31867]], [[64175, 64175], "mapped", [32091]], [[64176, 64176], "mapped", [32244]], [[64177, 64177], "mapped", [32574]], [[64178, 64178], "mapped", [32773]], [[64179, 64179], "mapped", [33618]], [[64180, 64180], "mapped", [33775]], [[64181, 64181], "mapped", [34681]], [[64182, 64182], "mapped", [35137]], [[64183, 64183], "mapped", [35206]], [[64184, 64184], "mapped", [35222]], [[64185, 64185], "mapped", [35519]], [[64186, 64186], "mapped", [35576]], [[64187, 64187], "mapped", [35531]], [[64188, 64188], "mapped", [35585]], [[64189, 64189], "mapped", [35582]], [[64190, 64190], "mapped", [35565]], [[64191, 64191], "mapped", [35641]], [[64192, 64192], "mapped", [35722]], [[64193, 64193], "mapped", [36104]], [[64194, 64194], "mapped", [36664]], [[64195, 64195], "mapped", [36978]], [[64196, 64196], "mapped", [37273]], [[64197, 64197], "mapped", [37494]], [[64198, 64198], "mapped", [38524]], [[64199, 64199], "mapped", [38627]], [[64200, 64200], "mapped", [38742]], [[64201, 64201], "mapped", [38875]], [[64202, 64202], "mapped", [38911]], [[64203, 64203], "mapped", [38923]], [[64204, 64204], "mapped", [38971]], [[64205, 64205], "mapped", [39698]], [[64206, 64206], "mapped", [40860]], [[64207, 64207], "mapped", [141386]], [[64208, 64208], "mapped", [141380]], [[64209, 64209], "mapped", [144341]], [[64210, 64210], "mapped", [15261]], [[64211, 64211], "mapped", [16408]], [[64212, 64212], "mapped", [16441]], [[64213, 64213], "mapped", [152137]], [[64214, 64214], "mapped", [154832]], [[64215, 64215], "mapped", [163539]], [[64216, 64216], "mapped", [40771]], [[64217, 64217], "mapped", [40846]], [[64218, 64255], "disallowed"], [[64256, 64256], "mapped", [102, 102]], [[64257, 64257], "mapped", [102, 105]], [[64258, 64258], "mapped", [102, 108]], [[64259, 64259], "mapped", [102, 102, 105]], [[64260, 64260], "mapped", [102, 102, 108]], [[64261, 64262], "mapped", [115, 116]], [[64263, 64274], "disallowed"], [[64275, 64275], "mapped", [1396, 1398]], [[64276, 64276], "mapped", [1396, 1381]], [[64277, 64277], "mapped", [1396, 1387]], [[64278, 64278], "mapped", [1406, 1398]], [[64279, 64279], "mapped", [1396, 1389]], [[64280, 64284], "disallowed"], [[64285, 64285], "mapped", [1497, 1460]], [[64286, 64286], "valid"], [[64287, 64287], "mapped", [1522, 1463]], [[64288, 64288], "mapped", [1506]], [[64289, 64289], "mapped", [1488]], [[64290, 64290], "mapped", [1491]], [[64291, 64291], "mapped", [1492]], [[64292, 64292], "mapped", [1499]], [[64293, 64293], "mapped", [1500]], [[64294, 64294], "mapped", [1501]], [[64295, 64295], "mapped", [1512]], [[64296, 64296], "mapped", [1514]], [[64297, 64297], "disallowed_STD3_mapped", [43]], [[64298, 64298], "mapped", [1513, 1473]], [[64299, 64299], "mapped", [1513, 1474]], [[64300, 64300], "mapped", [1513, 1468, 1473]], [[64301, 64301], "mapped", [1513, 1468, 1474]], [[64302, 64302], "mapped", [1488, 1463]], [[64303, 64303], "mapped", [1488, 1464]], [[64304, 64304], "mapped", [1488, 1468]], [[64305, 64305], "mapped", [1489, 1468]], [[64306, 64306], "mapped", [1490, 1468]], [[64307, 64307], "mapped", [1491, 1468]], [[64308, 64308], "mapped", [1492, 1468]], [[64309, 64309], "mapped", [1493, 1468]], [[64310, 64310], "mapped", [1494, 1468]], [[64311, 64311], "disallowed"], [[64312, 64312], "mapped", [1496, 1468]], [[64313, 64313], "mapped", [1497, 1468]], [[64314, 64314], "mapped", [1498, 1468]], [[64315, 64315], "mapped", [1499, 1468]], [[64316, 64316], "mapped", [1500, 1468]], [[64317, 64317], "disallowed"], [[64318, 64318], "mapped", [1502, 1468]], [[64319, 64319], "disallowed"], [[64320, 64320], "mapped", [1504, 1468]], [[64321, 64321], "mapped", [1505, 1468]], [[64322, 64322], "disallowed"], [[64323, 64323], "mapped", [1507, 1468]], [[64324, 64324], "mapped", [1508, 1468]], [[64325, 64325], "disallowed"], [[64326, 64326], "mapped", [1510, 1468]], [[64327, 64327], "mapped", [1511, 1468]], [[64328, 64328], "mapped", [1512, 1468]], [[64329, 64329], "mapped", [1513, 1468]], [[64330, 64330], "mapped", [1514, 1468]], [[64331, 64331], "mapped", [1493, 1465]], [[64332, 64332], "mapped", [1489, 1471]], [[64333, 64333], "mapped", [1499, 1471]], [[64334, 64334], "mapped", [1508, 1471]], [[64335, 64335], "mapped", [1488, 1500]], [[64336, 64337], "mapped", [1649]], [[64338, 64341], "mapped", [1659]], [[64342, 64345], "mapped", [1662]], [[64346, 64349], "mapped", [1664]], [[64350, 64353], "mapped", [1658]], [[64354, 64357], "mapped", [1663]], [[64358, 64361], "mapped", [1657]], [[64362, 64365], "mapped", [1700]], [[64366, 64369], "mapped", [1702]], [[64370, 64373], "mapped", [1668]], [[64374, 64377], "mapped", [1667]], [[64378, 64381], "mapped", [1670]], [[64382, 64385], "mapped", [1671]], [[64386, 64387], "mapped", [1677]], [[64388, 64389], "mapped", [1676]], [[64390, 64391], "mapped", [1678]], [[64392, 64393], "mapped", [1672]], [[64394, 64395], "mapped", [1688]], [[64396, 64397], "mapped", [1681]], [[64398, 64401], "mapped", [1705]], [[64402, 64405], "mapped", [1711]], [[64406, 64409], "mapped", [1715]], [[64410, 64413], "mapped", [1713]], [[64414, 64415], "mapped", [1722]], [[64416, 64419], "mapped", [1723]], [[64420, 64421], "mapped", [1728]], [[64422, 64425], "mapped", [1729]], [[64426, 64429], "mapped", [1726]], [[64430, 64431], "mapped", [1746]], [[64432, 64433], "mapped", [1747]], [[64434, 64449], "valid", [], "NV8"], [[64450, 64466], "disallowed"], [[64467, 64470], "mapped", [1709]], [[64471, 64472], "mapped", [1735]], [[64473, 64474], "mapped", [1734]], [[64475, 64476], "mapped", [1736]], [[64477, 64477], "mapped", [1735, 1652]], [[64478, 64479], "mapped", [1739]], [[64480, 64481], "mapped", [1733]], [[64482, 64483], "mapped", [1737]], [[64484, 64487], "mapped", [1744]], [[64488, 64489], "mapped", [1609]], [[64490, 64491], "mapped", [1574, 1575]], [[64492, 64493], "mapped", [1574, 1749]], [[64494, 64495], "mapped", [1574, 1608]], [[64496, 64497], "mapped", [1574, 1735]], [[64498, 64499], "mapped", [1574, 1734]], [[64500, 64501], "mapped", [1574, 1736]], [[64502, 64504], "mapped", [1574, 1744]], [[64505, 64507], "mapped", [1574, 1609]], [[64508, 64511], "mapped", [1740]], [[64512, 64512], "mapped", [1574, 1580]], [[64513, 64513], "mapped", [1574, 1581]], [[64514, 64514], "mapped", [1574, 1605]], [[64515, 64515], "mapped", [1574, 1609]], [[64516, 64516], "mapped", [1574, 1610]], [[64517, 64517], "mapped", [1576, 1580]], [[64518, 64518], "mapped", [1576, 1581]], [[64519, 64519], "mapped", [1576, 1582]], [[64520, 64520], "mapped", [1576, 1605]], [[64521, 64521], "mapped", [1576, 1609]], [[64522, 64522], "mapped", [1576, 1610]], [[64523, 64523], "mapped", [1578, 1580]], [[64524, 64524], "mapped", [1578, 1581]], [[64525, 64525], "mapped", [1578, 1582]], [[64526, 64526], "mapped", [1578, 1605]], [[64527, 64527], "mapped", [1578, 1609]], [[64528, 64528], "mapped", [1578, 1610]], [[64529, 64529], "mapped", [1579, 1580]], [[64530, 64530], "mapped", [1579, 1605]], [[64531, 64531], "mapped", [1579, 1609]], [[64532, 64532], "mapped", [1579, 1610]], [[64533, 64533], "mapped", [1580, 1581]], [[64534, 64534], "mapped", [1580, 1605]], [[64535, 64535], "mapped", [1581, 1580]], [[64536, 64536], "mapped", [1581, 1605]], [[64537, 64537], "mapped", [1582, 1580]], [[64538, 64538], "mapped", [1582, 1581]], [[64539, 64539], "mapped", [1582, 1605]], [[64540, 64540], "mapped", [1587, 1580]], [[64541, 64541], "mapped", [1587, 1581]], [[64542, 64542], "mapped", [1587, 1582]], [[64543, 64543], "mapped", [1587, 1605]], [[64544, 64544], "mapped", [1589, 1581]], [[64545, 64545], "mapped", [1589, 1605]], [[64546, 64546], "mapped", [1590, 1580]], [[64547, 64547], "mapped", [1590, 1581]], [[64548, 64548], "mapped", [1590, 1582]], [[64549, 64549], "mapped", [1590, 1605]], [[64550, 64550], "mapped", [1591, 1581]], [[64551, 64551], "mapped", [1591, 1605]], [[64552, 64552], "mapped", [1592, 1605]], [[64553, 64553], "mapped", [1593, 1580]], [[64554, 64554], "mapped", [1593, 1605]], [[64555, 64555], "mapped", [1594, 1580]], [[64556, 64556], "mapped", [1594, 1605]], [[64557, 64557], "mapped", [1601, 1580]], [[64558, 64558], "mapped", [1601, 1581]], [[64559, 64559], "mapped", [1601, 1582]], [[64560, 64560], "mapped", [1601, 1605]], [[64561, 64561], "mapped", [1601, 1609]], [[64562, 64562], "mapped", [1601, 1610]], [[64563, 64563], "mapped", [1602, 1581]], [[64564, 64564], "mapped", [1602, 1605]], [[64565, 64565], "mapped", [1602, 1609]], [[64566, 64566], "mapped", [1602, 1610]], [[64567, 64567], "mapped", [1603, 1575]], [[64568, 64568], "mapped", [1603, 1580]], [[64569, 64569], "mapped", [1603, 1581]], [[64570, 64570], "mapped", [1603, 1582]], [[64571, 64571], "mapped", [1603, 1604]], [[64572, 64572], "mapped", [1603, 1605]], [[64573, 64573], "mapped", [1603, 1609]], [[64574, 64574], "mapped", [1603, 1610]], [[64575, 64575], "mapped", [1604, 1580]], [[64576, 64576], "mapped", [1604, 1581]], [[64577, 64577], "mapped", [1604, 1582]], [[64578, 64578], "mapped", [1604, 1605]], [[64579, 64579], "mapped", [1604, 1609]], [[64580, 64580], "mapped", [1604, 1610]], [[64581, 64581], "mapped", [1605, 1580]], [[64582, 64582], "mapped", [1605, 1581]], [[64583, 64583], "mapped", [1605, 1582]], [[64584, 64584], "mapped", [1605, 1605]], [[64585, 64585], "mapped", [1605, 1609]], [[64586, 64586], "mapped", [1605, 1610]], [[64587, 64587], "mapped", [1606, 1580]], [[64588, 64588], "mapped", [1606, 1581]], [[64589, 64589], "mapped", [1606, 1582]], [[64590, 64590], "mapped", [1606, 1605]], [[64591, 64591], "mapped", [1606, 1609]], [[64592, 64592], "mapped", [1606, 1610]], [[64593, 64593], "mapped", [1607, 1580]], [[64594, 64594], "mapped", [1607, 1605]], [[64595, 64595], "mapped", [1607, 1609]], [[64596, 64596], "mapped", [1607, 1610]], [[64597, 64597], "mapped", [1610, 1580]], [[64598, 64598], "mapped", [1610, 1581]], [[64599, 64599], "mapped", [1610, 1582]], [[64600, 64600], "mapped", [1610, 1605]], [[64601, 64601], "mapped", [1610, 1609]], [[64602, 64602], "mapped", [1610, 1610]], [[64603, 64603], "mapped", [1584, 1648]], [[64604, 64604], "mapped", [1585, 1648]], [[64605, 64605], "mapped", [1609, 1648]], [[64606, 64606], "disallowed_STD3_mapped", [32, 1612, 1617]], [[64607, 64607], "disallowed_STD3_mapped", [32, 1613, 1617]], [[64608, 64608], "disallowed_STD3_mapped", [32, 1614, 1617]], [[64609, 64609], "disallowed_STD3_mapped", [32, 1615, 1617]], [[64610, 64610], "disallowed_STD3_mapped", [32, 1616, 1617]], [[64611, 64611], "disallowed_STD3_mapped", [32, 1617, 1648]], [[64612, 64612], "mapped", [1574, 1585]], [[64613, 64613], "mapped", [1574, 1586]], [[64614, 64614], "mapped", [1574, 1605]], [[64615, 64615], "mapped", [1574, 1606]], [[64616, 64616], "mapped", [1574, 1609]], [[64617, 64617], "mapped", [1574, 1610]], [[64618, 64618], "mapped", [1576, 1585]], [[64619, 64619], "mapped", [1576, 1586]], [[64620, 64620], "mapped", [1576, 1605]], [[64621, 64621], "mapped", [1576, 1606]], [[64622, 64622], "mapped", [1576, 1609]], [[64623, 64623], "mapped", [1576, 1610]], [[64624, 64624], "mapped", [1578, 1585]], [[64625, 64625], "mapped", [1578, 1586]], [[64626, 64626], "mapped", [1578, 1605]], [[64627, 64627], "mapped", [1578, 1606]], [[64628, 64628], "mapped", [1578, 1609]], [[64629, 64629], "mapped", [1578, 1610]], [[64630, 64630], "mapped", [1579, 1585]], [[64631, 64631], "mapped", [1579, 1586]], [[64632, 64632], "mapped", [1579, 1605]], [[64633, 64633], "mapped", [1579, 1606]], [[64634, 64634], "mapped", [1579, 1609]], [[64635, 64635], "mapped", [1579, 1610]], [[64636, 64636], "mapped", [1601, 1609]], [[64637, 64637], "mapped", [1601, 1610]], [[64638, 64638], "mapped", [1602, 1609]], [[64639, 64639], "mapped", [1602, 1610]], [[64640, 64640], "mapped", [1603, 1575]], [[64641, 64641], "mapped", [1603, 1604]], [[64642, 64642], "mapped", [1603, 1605]], [[64643, 64643], "mapped", [1603, 1609]], [[64644, 64644], "mapped", [1603, 1610]], [[64645, 64645], "mapped", [1604, 1605]], [[64646, 64646], "mapped", [1604, 1609]], [[64647, 64647], "mapped", [1604, 1610]], [[64648, 64648], "mapped", [1605, 1575]], [[64649, 64649], "mapped", [1605, 1605]], [[64650, 64650], "mapped", [1606, 1585]], [[64651, 64651], "mapped", [1606, 1586]], [[64652, 64652], "mapped", [1606, 1605]], [[64653, 64653], "mapped", [1606, 1606]], [[64654, 64654], "mapped", [1606, 1609]], [[64655, 64655], "mapped", [1606, 1610]], [[64656, 64656], "mapped", [1609, 1648]], [[64657, 64657], "mapped", [1610, 1585]], [[64658, 64658], "mapped", [1610, 1586]], [[64659, 64659], "mapped", [1610, 1605]], [[64660, 64660], "mapped", [1610, 1606]], [[64661, 64661], "mapped", [1610, 1609]], [[64662, 64662], "mapped", [1610, 1610]], [[64663, 64663], "mapped", [1574, 1580]], [[64664, 64664], "mapped", [1574, 1581]], [[64665, 64665], "mapped", [1574, 1582]], [[64666, 64666], "mapped", [1574, 1605]], [[64667, 64667], "mapped", [1574, 1607]], [[64668, 64668], "mapped", [1576, 1580]], [[64669, 64669], "mapped", [1576, 1581]], [[64670, 64670], "mapped", [1576, 1582]], [[64671, 64671], "mapped", [1576, 1605]], [[64672, 64672], "mapped", [1576, 1607]], [[64673, 64673], "mapped", [1578, 1580]], [[64674, 64674], "mapped", [1578, 1581]], [[64675, 64675], "mapped", [1578, 1582]], [[64676, 64676], "mapped", [1578, 1605]], [[64677, 64677], "mapped", [1578, 1607]], [[64678, 64678], "mapped", [1579, 1605]], [[64679, 64679], "mapped", [1580, 1581]], [[64680, 64680], "mapped", [1580, 1605]], [[64681, 64681], "mapped", [1581, 1580]], [[64682, 64682], "mapped", [1581, 1605]], [[64683, 64683], "mapped", [1582, 1580]], [[64684, 64684], "mapped", [1582, 1605]], [[64685, 64685], "mapped", [1587, 1580]], [[64686, 64686], "mapped", [1587, 1581]], [[64687, 64687], "mapped", [1587, 1582]], [[64688, 64688], "mapped", [1587, 1605]], [[64689, 64689], "mapped", [1589, 1581]], [[64690, 64690], "mapped", [1589, 1582]], [[64691, 64691], "mapped", [1589, 1605]], [[64692, 64692], "mapped", [1590, 1580]], [[64693, 64693], "mapped", [1590, 1581]], [[64694, 64694], "mapped", [1590, 1582]], [[64695, 64695], "mapped", [1590, 1605]], [[64696, 64696], "mapped", [1591, 1581]], [[64697, 64697], "mapped", [1592, 1605]], [[64698, 64698], "mapped", [1593, 1580]], [[64699, 64699], "mapped", [1593, 1605]], [[64700, 64700], "mapped", [1594, 1580]], [[64701, 64701], "mapped", [1594, 1605]], [[64702, 64702], "mapped", [1601, 1580]], [[64703, 64703], "mapped", [1601, 1581]], [[64704, 64704], "mapped", [1601, 1582]], [[64705, 64705], "mapped", [1601, 1605]], [[64706, 64706], "mapped", [1602, 1581]], [[64707, 64707], "mapped", [1602, 1605]], [[64708, 64708], "mapped", [1603, 1580]], [[64709, 64709], "mapped", [1603, 1581]], [[64710, 64710], "mapped", [1603, 1582]], [[64711, 64711], "mapped", [1603, 1604]], [[64712, 64712], "mapped", [1603, 1605]], [[64713, 64713], "mapped", [1604, 1580]], [[64714, 64714], "mapped", [1604, 1581]], [[64715, 64715], "mapped", [1604, 1582]], [[64716, 64716], "mapped", [1604, 1605]], [[64717, 64717], "mapped", [1604, 1607]], [[64718, 64718], "mapped", [1605, 1580]], [[64719, 64719], "mapped", [1605, 1581]], [[64720, 64720], "mapped", [1605, 1582]], [[64721, 64721], "mapped", [1605, 1605]], [[64722, 64722], "mapped", [1606, 1580]], [[64723, 64723], "mapped", [1606, 1581]], [[64724, 64724], "mapped", [1606, 1582]], [[64725, 64725], "mapped", [1606, 1605]], [[64726, 64726], "mapped", [1606, 1607]], [[64727, 64727], "mapped", [1607, 1580]], [[64728, 64728], "mapped", [1607, 1605]], [[64729, 64729], "mapped", [1607, 1648]], [[64730, 64730], "mapped", [1610, 1580]], [[64731, 64731], "mapped", [1610, 1581]], [[64732, 64732], "mapped", [1610, 1582]], [[64733, 64733], "mapped", [1610, 1605]], [[64734, 64734], "mapped", [1610, 1607]], [[64735, 64735], "mapped", [1574, 1605]], [[64736, 64736], "mapped", [1574, 1607]], [[64737, 64737], "mapped", [1576, 1605]], [[64738, 64738], "mapped", [1576, 1607]], [[64739, 64739], "mapped", [1578, 1605]], [[64740, 64740], "mapped", [1578, 1607]], [[64741, 64741], "mapped", [1579, 1605]], [[64742, 64742], "mapped", [1579, 1607]], [[64743, 64743], "mapped", [1587, 1605]], [[64744, 64744], "mapped", [1587, 1607]], [[64745, 64745], "mapped", [1588, 1605]], [[64746, 64746], "mapped", [1588, 1607]], [[64747, 64747], "mapped", [1603, 1604]], [[64748, 64748], "mapped", [1603, 1605]], [[64749, 64749], "mapped", [1604, 1605]], [[64750, 64750], "mapped", [1606, 1605]], [[64751, 64751], "mapped", [1606, 1607]], [[64752, 64752], "mapped", [1610, 1605]], [[64753, 64753], "mapped", [1610, 1607]], [[64754, 64754], "mapped", [1600, 1614, 1617]], [[64755, 64755], "mapped", [1600, 1615, 1617]], [[64756, 64756], "mapped", [1600, 1616, 1617]], [[64757, 64757], "mapped", [1591, 1609]], [[64758, 64758], "mapped", [1591, 1610]], [[64759, 64759], "mapped", [1593, 1609]], [[64760, 64760], "mapped", [1593, 1610]], [[64761, 64761], "mapped", [1594, 1609]], [[64762, 64762], "mapped", [1594, 1610]], [[64763, 64763], "mapped", [1587, 1609]], [[64764, 64764], "mapped", [1587, 1610]], [[64765, 64765], "mapped", [1588, 1609]], [[64766, 64766], "mapped", [1588, 1610]], [[64767, 64767], "mapped", [1581, 1609]], [[64768, 64768], "mapped", [1581, 1610]], [[64769, 64769], "mapped", [1580, 1609]], [[64770, 64770], "mapped", [1580, 1610]], [[64771, 64771], "mapped", [1582, 1609]], [[64772, 64772], "mapped", [1582, 1610]], [[64773, 64773], "mapped", [1589, 1609]], [[64774, 64774], "mapped", [1589, 1610]], [[64775, 64775], "mapped", [1590, 1609]], [[64776, 64776], "mapped", [1590, 1610]], [[64777, 64777], "mapped", [1588, 1580]], [[64778, 64778], "mapped", [1588, 1581]], [[64779, 64779], "mapped", [1588, 1582]], [[64780, 64780], "mapped", [1588, 1605]], [[64781, 64781], "mapped", [1588, 1585]], [[64782, 64782], "mapped", [1587, 1585]], [[64783, 64783], "mapped", [1589, 1585]], [[64784, 64784], "mapped", [1590, 1585]], [[64785, 64785], "mapped", [1591, 1609]], [[64786, 64786], "mapped", [1591, 1610]], [[64787, 64787], "mapped", [1593, 1609]], [[64788, 64788], "mapped", [1593, 1610]], [[64789, 64789], "mapped", [1594, 1609]], [[64790, 64790], "mapped", [1594, 1610]], [[64791, 64791], "mapped", [1587, 1609]], [[64792, 64792], "mapped", [1587, 1610]], [[64793, 64793], "mapped", [1588, 1609]], [[64794, 64794], "mapped", [1588, 1610]], [[64795, 64795], "mapped", [1581, 1609]], [[64796, 64796], "mapped", [1581, 1610]], [[64797, 64797], "mapped", [1580, 1609]], [[64798, 64798], "mapped", [1580, 1610]], [[64799, 64799], "mapped", [1582, 1609]], [[64800, 64800], "mapped", [1582, 1610]], [[64801, 64801], "mapped", [1589, 1609]], [[64802, 64802], "mapped", [1589, 1610]], [[64803, 64803], "mapped", [1590, 1609]], [[64804, 64804], "mapped", [1590, 1610]], [[64805, 64805], "mapped", [1588, 1580]], [[64806, 64806], "mapped", [1588, 1581]], [[64807, 64807], "mapped", [1588, 1582]], [[64808, 64808], "mapped", [1588, 1605]], [[64809, 64809], "mapped", [1588, 1585]], [[64810, 64810], "mapped", [1587, 1585]], [[64811, 64811], "mapped", [1589, 1585]], [[64812, 64812], "mapped", [1590, 1585]], [[64813, 64813], "mapped", [1588, 1580]], [[64814, 64814], "mapped", [1588, 1581]], [[64815, 64815], "mapped", [1588, 1582]], [[64816, 64816], "mapped", [1588, 1605]], [[64817, 64817], "mapped", [1587, 1607]], [[64818, 64818], "mapped", [1588, 1607]], [[64819, 64819], "mapped", [1591, 1605]], [[64820, 64820], "mapped", [1587, 1580]], [[64821, 64821], "mapped", [1587, 1581]], [[64822, 64822], "mapped", [1587, 1582]], [[64823, 64823], "mapped", [1588, 1580]], [[64824, 64824], "mapped", [1588, 1581]], [[64825, 64825], "mapped", [1588, 1582]], [[64826, 64826], "mapped", [1591, 1605]], [[64827, 64827], "mapped", [1592, 1605]], [[64828, 64829], "mapped", [1575, 1611]], [[64830, 64831], "valid", [], "NV8"], [[64832, 64847], "disallowed"], [[64848, 64848], "mapped", [1578, 1580, 1605]], [[64849, 64850], "mapped", [1578, 1581, 1580]], [[64851, 64851], "mapped", [1578, 1581, 1605]], [[64852, 64852], "mapped", [1578, 1582, 1605]], [[64853, 64853], "mapped", [1578, 1605, 1580]], [[64854, 64854], "mapped", [1578, 1605, 1581]], [[64855, 64855], "mapped", [1578, 1605, 1582]], [[64856, 64857], "mapped", [1580, 1605, 1581]], [[64858, 64858], "mapped", [1581, 1605, 1610]], [[64859, 64859], "mapped", [1581, 1605, 1609]], [[64860, 64860], "mapped", [1587, 1581, 1580]], [[64861, 64861], "mapped", [1587, 1580, 1581]], [[64862, 64862], "mapped", [1587, 1580, 1609]], [[64863, 64864], "mapped", [1587, 1605, 1581]], [[64865, 64865], "mapped", [1587, 1605, 1580]], [[64866, 64867], "mapped", [1587, 1605, 1605]], [[64868, 64869], "mapped", [1589, 1581, 1581]], [[64870, 64870], "mapped", [1589, 1605, 1605]], [[64871, 64872], "mapped", [1588, 1581, 1605]], [[64873, 64873], "mapped", [1588, 1580, 1610]], [[64874, 64875], "mapped", [1588, 1605, 1582]], [[64876, 64877], "mapped", [1588, 1605, 1605]], [[64878, 64878], "mapped", [1590, 1581, 1609]], [[64879, 64880], "mapped", [1590, 1582, 1605]], [[64881, 64882], "mapped", [1591, 1605, 1581]], [[64883, 64883], "mapped", [1591, 1605, 1605]], [[64884, 64884], "mapped", [1591, 1605, 1610]], [[64885, 64885], "mapped", [1593, 1580, 1605]], [[64886, 64887], "mapped", [1593, 1605, 1605]], [[64888, 64888], "mapped", [1593, 1605, 1609]], [[64889, 64889], "mapped", [1594, 1605, 1605]], [[64890, 64890], "mapped", [1594, 1605, 1610]], [[64891, 64891], "mapped", [1594, 1605, 1609]], [[64892, 64893], "mapped", [1601, 1582, 1605]], [[64894, 64894], "mapped", [1602, 1605, 1581]], [[64895, 64895], "mapped", [1602, 1605, 1605]], [[64896, 64896], "mapped", [1604, 1581, 1605]], [[64897, 64897], "mapped", [1604, 1581, 1610]], [[64898, 64898], "mapped", [1604, 1581, 1609]], [[64899, 64900], "mapped", [1604, 1580, 1580]], [[64901, 64902], "mapped", [1604, 1582, 1605]], [[64903, 64904], "mapped", [1604, 1605, 1581]], [[64905, 64905], "mapped", [1605, 1581, 1580]], [[64906, 64906], "mapped", [1605, 1581, 1605]], [[64907, 64907], "mapped", [1605, 1581, 1610]], [[64908, 64908], "mapped", [1605, 1580, 1581]], [[64909, 64909], "mapped", [1605, 1580, 1605]], [[64910, 64910], "mapped", [1605, 1582, 1580]], [[64911, 64911], "mapped", [1605, 1582, 1605]], [[64912, 64913], "disallowed"], [[64914, 64914], "mapped", [1605, 1580, 1582]], [[64915, 64915], "mapped", [1607, 1605, 1580]], [[64916, 64916], "mapped", [1607, 1605, 1605]], [[64917, 64917], "mapped", [1606, 1581, 1605]], [[64918, 64918], "mapped", [1606, 1581, 1609]], [[64919, 64920], "mapped", [1606, 1580, 1605]], [[64921, 64921], "mapped", [1606, 1580, 1609]], [[64922, 64922], "mapped", [1606, 1605, 1610]], [[64923, 64923], "mapped", [1606, 1605, 1609]], [[64924, 64925], "mapped", [1610, 1605, 1605]], [[64926, 64926], "mapped", [1576, 1582, 1610]], [[64927, 64927], "mapped", [1578, 1580, 1610]], [[64928, 64928], "mapped", [1578, 1580, 1609]], [[64929, 64929], "mapped", [1578, 1582, 1610]], [[64930, 64930], "mapped", [1578, 1582, 1609]], [[64931, 64931], "mapped", [1578, 1605, 1610]], [[64932, 64932], "mapped", [1578, 1605, 1609]], [[64933, 64933], "mapped", [1580, 1605, 1610]], [[64934, 64934], "mapped", [1580, 1581, 1609]], [[64935, 64935], "mapped", [1580, 1605, 1609]], [[64936, 64936], "mapped", [1587, 1582, 1609]], [[64937, 64937], "mapped", [1589, 1581, 1610]], [[64938, 64938], "mapped", [1588, 1581, 1610]], [[64939, 64939], "mapped", [1590, 1581, 1610]], [[64940, 64940], "mapped", [1604, 1580, 1610]], [[64941, 64941], "mapped", [1604, 1605, 1610]], [[64942, 64942], "mapped", [1610, 1581, 1610]], [[64943, 64943], "mapped", [1610, 1580, 1610]], [[64944, 64944], "mapped", [1610, 1605, 1610]], [[64945, 64945], "mapped", [1605, 1605, 1610]], [[64946, 64946], "mapped", [1602, 1605, 1610]], [[64947, 64947], "mapped", [1606, 1581, 1610]], [[64948, 64948], "mapped", [1602, 1605, 1581]], [[64949, 64949], "mapped", [1604, 1581, 1605]], [[64950, 64950], "mapped", [1593, 1605, 1610]], [[64951, 64951], "mapped", [1603, 1605, 1610]], [[64952, 64952], "mapped", [1606, 1580, 1581]], [[64953, 64953], "mapped", [1605, 1582, 1610]], [[64954, 64954], "mapped", [1604, 1580, 1605]], [[64955, 64955], "mapped", [1603, 1605, 1605]], [[64956, 64956], "mapped", [1604, 1580, 1605]], [[64957, 64957], "mapped", [1606, 1580, 1581]], [[64958, 64958], "mapped", [1580, 1581, 1610]], [[64959, 64959], "mapped", [1581, 1580, 1610]], [[64960, 64960], "mapped", [1605, 1580, 1610]], [[64961, 64961], "mapped", [1601, 1605, 1610]], [[64962, 64962], "mapped", [1576, 1581, 1610]], [[64963, 64963], "mapped", [1603, 1605, 1605]], [[64964, 64964], "mapped", [1593, 1580, 1605]], [[64965, 64965], "mapped", [1589, 1605, 1605]], [[64966, 64966], "mapped", [1587, 1582, 1610]], [[64967, 64967], "mapped", [1606, 1580, 1610]], [[64968, 64975], "disallowed"], [[64976, 65007], "disallowed"], [[65008, 65008], "mapped", [1589, 1604, 1746]], [[65009, 65009], "mapped", [1602, 1604, 1746]], [[65010, 65010], "mapped", [1575, 1604, 1604, 1607]], [[65011, 65011], "mapped", [1575, 1603, 1576, 1585]], [[65012, 65012], "mapped", [1605, 1581, 1605, 1583]], [[65013, 65013], "mapped", [1589, 1604, 1593, 1605]], [[65014, 65014], "mapped", [1585, 1587, 1608, 1604]], [[65015, 65015], "mapped", [1593, 1604, 1610, 1607]], [[65016, 65016], "mapped", [1608, 1587, 1604, 1605]], [[65017, 65017], "mapped", [1589, 1604, 1609]], [[65018, 65018], "disallowed_STD3_mapped", [1589, 1604, 1609, 32, 1575, 1604, 1604, 1607, 32, 1593, 1604, 1610, 1607, 32, 1608, 1587, 1604, 1605]], [[65019, 65019], "disallowed_STD3_mapped", [1580, 1604, 32, 1580, 1604, 1575, 1604, 1607]], [[65020, 65020], "mapped", [1585, 1740, 1575, 1604]], [[65021, 65021], "valid", [], "NV8"], [[65022, 65023], "disallowed"], [[65024, 65039], "ignored"], [[65040, 65040], "disallowed_STD3_mapped", [44]], [[65041, 65041], "mapped", [12289]], [[65042, 65042], "disallowed"], [[65043, 65043], "disallowed_STD3_mapped", [58]], [[65044, 65044], "disallowed_STD3_mapped", [59]], [[65045, 65045], "disallowed_STD3_mapped", [33]], [[65046, 65046], "disallowed_STD3_mapped", [63]], [[65047, 65047], "mapped", [12310]], [[65048, 65048], "mapped", [12311]], [[65049, 65049], "disallowed"], [[65050, 65055], "disallowed"], [[65056, 65059], "valid"], [[65060, 65062], "valid"], [[65063, 65069], "valid"], [[65070, 65071], "valid"], [[65072, 65072], "disallowed"], [[65073, 65073], "mapped", [8212]], [[65074, 65074], "mapped", [8211]], [[65075, 65076], "disallowed_STD3_mapped", [95]], [[65077, 65077], "disallowed_STD3_mapped", [40]], [[65078, 65078], "disallowed_STD3_mapped", [41]], [[65079, 65079], "disallowed_STD3_mapped", [123]], [[65080, 65080], "disallowed_STD3_mapped", [125]], [[65081, 65081], "mapped", [12308]], [[65082, 65082], "mapped", [12309]], [[65083, 65083], "mapped", [12304]], [[65084, 65084], "mapped", [12305]], [[65085, 65085], "mapped", [12298]], [[65086, 65086], "mapped", [12299]], [[65087, 65087], "mapped", [12296]], [[65088, 65088], "mapped", [12297]], [[65089, 65089], "mapped", [12300]], [[65090, 65090], "mapped", [12301]], [[65091, 65091], "mapped", [12302]], [[65092, 65092], "mapped", [12303]], [[65093, 65094], "valid", [], "NV8"], [[65095, 65095], "disallowed_STD3_mapped", [91]], [[65096, 65096], "disallowed_STD3_mapped", [93]], [[65097, 65100], "disallowed_STD3_mapped", [32, 773]], [[65101, 65103], "disallowed_STD3_mapped", [95]], [[65104, 65104], "disallowed_STD3_mapped", [44]], [[65105, 65105], "mapped", [12289]], [[65106, 65106], "disallowed"], [[65107, 65107], "disallowed"], [[65108, 65108], "disallowed_STD3_mapped", [59]], [[65109, 65109], "disallowed_STD3_mapped", [58]], [[65110, 65110], "disallowed_STD3_mapped", [63]], [[65111, 65111], "disallowed_STD3_mapped", [33]], [[65112, 65112], "mapped", [8212]], [[65113, 65113], "disallowed_STD3_mapped", [40]], [[65114, 65114], "disallowed_STD3_mapped", [41]], [[65115, 65115], "disallowed_STD3_mapped", [123]], [[65116, 65116], "disallowed_STD3_mapped", [125]], [[65117, 65117], "mapped", [12308]], [[65118, 65118], "mapped", [12309]], [[65119, 65119], "disallowed_STD3_mapped", [35]], [[65120, 65120], "disallowed_STD3_mapped", [38]], [[65121, 65121], "disallowed_STD3_mapped", [42]], [[65122, 65122], "disallowed_STD3_mapped", [43]], [[65123, 65123], "mapped", [45]], [[65124, 65124], "disallowed_STD3_mapped", [60]], [[65125, 65125], "disallowed_STD3_mapped", [62]], [[65126, 65126], "disallowed_STD3_mapped", [61]], [[65127, 65127], "disallowed"], [[65128, 65128], "disallowed_STD3_mapped", [92]], [[65129, 65129], "disallowed_STD3_mapped", [36]], [[65130, 65130], "disallowed_STD3_mapped", [37]], [[65131, 65131], "disallowed_STD3_mapped", [64]], [[65132, 65135], "disallowed"], [[65136, 65136], "disallowed_STD3_mapped", [32, 1611]], [[65137, 65137], "mapped", [1600, 1611]], [[65138, 65138], "disallowed_STD3_mapped", [32, 1612]], [[65139, 65139], "valid"], [[65140, 65140], "disallowed_STD3_mapped", [32, 1613]], [[65141, 65141], "disallowed"], [[65142, 65142], "disallowed_STD3_mapped", [32, 1614]], [[65143, 65143], "mapped", [1600, 1614]], [[65144, 65144], "disallowed_STD3_mapped", [32, 1615]], [[65145, 65145], "mapped", [1600, 1615]], [[65146, 65146], "disallowed_STD3_mapped", [32, 1616]], [[65147, 65147], "mapped", [1600, 1616]], [[65148, 65148], "disallowed_STD3_mapped", [32, 1617]], [[65149, 65149], "mapped", [1600, 1617]], [[65150, 65150], "disallowed_STD3_mapped", [32, 1618]], [[65151, 65151], "mapped", [1600, 1618]], [[65152, 65152], "mapped", [1569]], [[65153, 65154], "mapped", [1570]], [[65155, 65156], "mapped", [1571]], [[65157, 65158], "mapped", [1572]], [[65159, 65160], "mapped", [1573]], [[65161, 65164], "mapped", [1574]], [[65165, 65166], "mapped", [1575]], [[65167, 65170], "mapped", [1576]], [[65171, 65172], "mapped", [1577]], [[65173, 65176], "mapped", [1578]], [[65177, 65180], "mapped", [1579]], [[65181, 65184], "mapped", [1580]], [[65185, 65188], "mapped", [1581]], [[65189, 65192], "mapped", [1582]], [[65193, 65194], "mapped", [1583]], [[65195, 65196], "mapped", [1584]], [[65197, 65198], "mapped", [1585]], [[65199, 65200], "mapped", [1586]], [[65201, 65204], "mapped", [1587]], [[65205, 65208], "mapped", [1588]], [[65209, 65212], "mapped", [1589]], [[65213, 65216], "mapped", [1590]], [[65217, 65220], "mapped", [1591]], [[65221, 65224], "mapped", [1592]], [[65225, 65228], "mapped", [1593]], [[65229, 65232], "mapped", [1594]], [[65233, 65236], "mapped", [1601]], [[65237, 65240], "mapped", [1602]], [[65241, 65244], "mapped", [1603]], [[65245, 65248], "mapped", [1604]], [[65249, 65252], "mapped", [1605]], [[65253, 65256], "mapped", [1606]], [[65257, 65260], "mapped", [1607]], [[65261, 65262], "mapped", [1608]], [[65263, 65264], "mapped", [1609]], [[65265, 65268], "mapped", [1610]], [[65269, 65270], "mapped", [1604, 1570]], [[65271, 65272], "mapped", [1604, 1571]], [[65273, 65274], "mapped", [1604, 1573]], [[65275, 65276], "mapped", [1604, 1575]], [[65277, 65278], "disallowed"], [[65279, 65279], "ignored"], [[65280, 65280], "disallowed"], [[65281, 65281], "disallowed_STD3_mapped", [33]], [[65282, 65282], "disallowed_STD3_mapped", [34]], [[65283, 65283], "disallowed_STD3_mapped", [35]], [[65284, 65284], "disallowed_STD3_mapped", [36]], [[65285, 65285], "disallowed_STD3_mapped", [37]], [[65286, 65286], "disallowed_STD3_mapped", [38]], [[65287, 65287], "disallowed_STD3_mapped", [39]], [[65288, 65288], "disallowed_STD3_mapped", [40]], [[65289, 65289], "disallowed_STD3_mapped", [41]], [[65290, 65290], "disallowed_STD3_mapped", [42]], [[65291, 65291], "disallowed_STD3_mapped", [43]], [[65292, 65292], "disallowed_STD3_mapped", [44]], [[65293, 65293], "mapped", [45]], [[65294, 65294], "mapped", [46]], [[65295, 65295], "disallowed_STD3_mapped", [47]], [[65296, 65296], "mapped", [48]], [[65297, 65297], "mapped", [49]], [[65298, 65298], "mapped", [50]], [[65299, 65299], "mapped", [51]], [[65300, 65300], "mapped", [52]], [[65301, 65301], "mapped", [53]], [[65302, 65302], "mapped", [54]], [[65303, 65303], "mapped", [55]], [[65304, 65304], "mapped", [56]], [[65305, 65305], "mapped", [57]], [[65306, 65306], "disallowed_STD3_mapped", [58]], [[65307, 65307], "disallowed_STD3_mapped", [59]], [[65308, 65308], "disallowed_STD3_mapped", [60]], [[65309, 65309], "disallowed_STD3_mapped", [61]], [[65310, 65310], "disallowed_STD3_mapped", [62]], [[65311, 65311], "disallowed_STD3_mapped", [63]], [[65312, 65312], "disallowed_STD3_mapped", [64]], [[65313, 65313], "mapped", [97]], [[65314, 65314], "mapped", [98]], [[65315, 65315], "mapped", [99]], [[65316, 65316], "mapped", [100]], [[65317, 65317], "mapped", [101]], [[65318, 65318], "mapped", [102]], [[65319, 65319], "mapped", [103]], [[65320, 65320], "mapped", [104]], [[65321, 65321], "mapped", [105]], [[65322, 65322], "mapped", [106]], [[65323, 65323], "mapped", [107]], [[65324, 65324], "mapped", [108]], [[65325, 65325], "mapped", [109]], [[65326, 65326], "mapped", [110]], [[65327, 65327], "mapped", [111]], [[65328, 65328], "mapped", [112]], [[65329, 65329], "mapped", [113]], [[65330, 65330], "mapped", [114]], [[65331, 65331], "mapped", [115]], [[65332, 65332], "mapped", [116]], [[65333, 65333], "mapped", [117]], [[65334, 65334], "mapped", [118]], [[65335, 65335], "mapped", [119]], [[65336, 65336], "mapped", [120]], [[65337, 65337], "mapped", [121]], [[65338, 65338], "mapped", [122]], [[65339, 65339], "disallowed_STD3_mapped", [91]], [[65340, 65340], "disallowed_STD3_mapped", [92]], [[65341, 65341], "disallowed_STD3_mapped", [93]], [[65342, 65342], "disallowed_STD3_mapped", [94]], [[65343, 65343], "disallowed_STD3_mapped", [95]], [[65344, 65344], "disallowed_STD3_mapped", [96]], [[65345, 65345], "mapped", [97]], [[65346, 65346], "mapped", [98]], [[65347, 65347], "mapped", [99]], [[65348, 65348], "mapped", [100]], [[65349, 65349], "mapped", [101]], [[65350, 65350], "mapped", [102]], [[65351, 65351], "mapped", [103]], [[65352, 65352], "mapped", [104]], [[65353, 65353], "mapped", [105]], [[65354, 65354], "mapped", [106]], [[65355, 65355], "mapped", [107]], [[65356, 65356], "mapped", [108]], [[65357, 65357], "mapped", [109]], [[65358, 65358], "mapped", [110]], [[65359, 65359], "mapped", [111]], [[65360, 65360], "mapped", [112]], [[65361, 65361], "mapped", [113]], [[65362, 65362], "mapped", [114]], [[65363, 65363], "mapped", [115]], [[65364, 65364], "mapped", [116]], [[65365, 65365], "mapped", [117]], [[65366, 65366], "mapped", [118]], [[65367, 65367], "mapped", [119]], [[65368, 65368], "mapped", [120]], [[65369, 65369], "mapped", [121]], [[65370, 65370], "mapped", [122]], [[65371, 65371], "disallowed_STD3_mapped", [123]], [[65372, 65372], "disallowed_STD3_mapped", [124]], [[65373, 65373], "disallowed_STD3_mapped", [125]], [[65374, 65374], "disallowed_STD3_mapped", [126]], [[65375, 65375], "mapped", [10629]], [[65376, 65376], "mapped", [10630]], [[65377, 65377], "mapped", [46]], [[65378, 65378], "mapped", [12300]], [[65379, 65379], "mapped", [12301]], [[65380, 65380], "mapped", [12289]], [[65381, 65381], "mapped", [12539]], [[65382, 65382], "mapped", [12530]], [[65383, 65383], "mapped", [12449]], [[65384, 65384], "mapped", [12451]], [[65385, 65385], "mapped", [12453]], [[65386, 65386], "mapped", [12455]], [[65387, 65387], "mapped", [12457]], [[65388, 65388], "mapped", [12515]], [[65389, 65389], "mapped", [12517]], [[65390, 65390], "mapped", [12519]], [[65391, 65391], "mapped", [12483]], [[65392, 65392], "mapped", [12540]], [[65393, 65393], "mapped", [12450]], [[65394, 65394], "mapped", [12452]], [[65395, 65395], "mapped", [12454]], [[65396, 65396], "mapped", [12456]], [[65397, 65397], "mapped", [12458]], [[65398, 65398], "mapped", [12459]], [[65399, 65399], "mapped", [12461]], [[65400, 65400], "mapped", [12463]], [[65401, 65401], "mapped", [12465]], [[65402, 65402], "mapped", [12467]], [[65403, 65403], "mapped", [12469]], [[65404, 65404], "mapped", [12471]], [[65405, 65405], "mapped", [12473]], [[65406, 65406], "mapped", [12475]], [[65407, 65407], "mapped", [12477]], [[65408, 65408], "mapped", [12479]], [[65409, 65409], "mapped", [12481]], [[65410, 65410], "mapped", [12484]], [[65411, 65411], "mapped", [12486]], [[65412, 65412], "mapped", [12488]], [[65413, 65413], "mapped", [12490]], [[65414, 65414], "mapped", [12491]], [[65415, 65415], "mapped", [12492]], [[65416, 65416], "mapped", [12493]], [[65417, 65417], "mapped", [12494]], [[65418, 65418], "mapped", [12495]], [[65419, 65419], "mapped", [12498]], [[65420, 65420], "mapped", [12501]], [[65421, 65421], "mapped", [12504]], [[65422, 65422], "mapped", [12507]], [[65423, 65423], "mapped", [12510]], [[65424, 65424], "mapped", [12511]], [[65425, 65425], "mapped", [12512]], [[65426, 65426], "mapped", [12513]], [[65427, 65427], "mapped", [12514]], [[65428, 65428], "mapped", [12516]], [[65429, 65429], "mapped", [12518]], [[65430, 65430], "mapped", [12520]], [[65431, 65431], "mapped", [12521]], [[65432, 65432], "mapped", [12522]], [[65433, 65433], "mapped", [12523]], [[65434, 65434], "mapped", [12524]], [[65435, 65435], "mapped", [12525]], [[65436, 65436], "mapped", [12527]], [[65437, 65437], "mapped", [12531]], [[65438, 65438], "mapped", [12441]], [[65439, 65439], "mapped", [12442]], [[65440, 65440], "disallowed"], [[65441, 65441], "mapped", [4352]], [[65442, 65442], "mapped", [4353]], [[65443, 65443], "mapped", [4522]], [[65444, 65444], "mapped", [4354]], [[65445, 65445], "mapped", [4524]], [[65446, 65446], "mapped", [4525]], [[65447, 65447], "mapped", [4355]], [[65448, 65448], "mapped", [4356]], [[65449, 65449], "mapped", [4357]], [[65450, 65450], "mapped", [4528]], [[65451, 65451], "mapped", [4529]], [[65452, 65452], "mapped", [4530]], [[65453, 65453], "mapped", [4531]], [[65454, 65454], "mapped", [4532]], [[65455, 65455], "mapped", [4533]], [[65456, 65456], "mapped", [4378]], [[65457, 65457], "mapped", [4358]], [[65458, 65458], "mapped", [4359]], [[65459, 65459], "mapped", [4360]], [[65460, 65460], "mapped", [4385]], [[65461, 65461], "mapped", [4361]], [[65462, 65462], "mapped", [4362]], [[65463, 65463], "mapped", [4363]], [[65464, 65464], "mapped", [4364]], [[65465, 65465], "mapped", [4365]], [[65466, 65466], "mapped", [4366]], [[65467, 65467], "mapped", [4367]], [[65468, 65468], "mapped", [4368]], [[65469, 65469], "mapped", [4369]], [[65470, 65470], "mapped", [4370]], [[65471, 65473], "disallowed"], [[65474, 65474], "mapped", [4449]], [[65475, 65475], "mapped", [4450]], [[65476, 65476], "mapped", [4451]], [[65477, 65477], "mapped", [4452]], [[65478, 65478], "mapped", [4453]], [[65479, 65479], "mapped", [4454]], [[65480, 65481], "disallowed"], [[65482, 65482], "mapped", [4455]], [[65483, 65483], "mapped", [4456]], [[65484, 65484], "mapped", [4457]], [[65485, 65485], "mapped", [4458]], [[65486, 65486], "mapped", [4459]], [[65487, 65487], "mapped", [4460]], [[65488, 65489], "disallowed"], [[65490, 65490], "mapped", [4461]], [[65491, 65491], "mapped", [4462]], [[65492, 65492], "mapped", [4463]], [[65493, 65493], "mapped", [4464]], [[65494, 65494], "mapped", [4465]], [[65495, 65495], "mapped", [4466]], [[65496, 65497], "disallowed"], [[65498, 65498], "mapped", [4467]], [[65499, 65499], "mapped", [4468]], [[65500, 65500], "mapped", [4469]], [[65501, 65503], "disallowed"], [[65504, 65504], "mapped", [162]], [[65505, 65505], "mapped", [163]], [[65506, 65506], "mapped", [172]], [[65507, 65507], "disallowed_STD3_mapped", [32, 772]], [[65508, 65508], "mapped", [166]], [[65509, 65509], "mapped", [165]], [[65510, 65510], "mapped", [8361]], [[65511, 65511], "disallowed"], [[65512, 65512], "mapped", [9474]], [[65513, 65513], "mapped", [8592]], [[65514, 65514], "mapped", [8593]], [[65515, 65515], "mapped", [8594]], [[65516, 65516], "mapped", [8595]], [[65517, 65517], "mapped", [9632]], [[65518, 65518], "mapped", [9675]], [[65519, 65528], "disallowed"], [[65529, 65531], "disallowed"], [[65532, 65532], "disallowed"], [[65533, 65533], "disallowed"], [[65534, 65535], "disallowed"], [[65536, 65547], "valid"], [[65548, 65548], "disallowed"], [[65549, 65574], "valid"], [[65575, 65575], "disallowed"], [[65576, 65594], "valid"], [[65595, 65595], "disallowed"], [[65596, 65597], "valid"], [[65598, 65598], "disallowed"], [[65599, 65613], "valid"], [[65614, 65615], "disallowed"], [[65616, 65629], "valid"], [[65630, 65663], "disallowed"], [[65664, 65786], "valid"], [[65787, 65791], "disallowed"], [[65792, 65794], "valid", [], "NV8"], [[65795, 65798], "disallowed"], [[65799, 65843], "valid", [], "NV8"], [[65844, 65846], "disallowed"], [[65847, 65855], "valid", [], "NV8"], [[65856, 65930], "valid", [], "NV8"], [[65931, 65932], "valid", [], "NV8"], [[65933, 65935], "disallowed"], [[65936, 65947], "valid", [], "NV8"], [[65948, 65951], "disallowed"], [[65952, 65952], "valid", [], "NV8"], [[65953, 65999], "disallowed"], [[66e3, 66044], "valid", [], "NV8"], [[66045, 66045], "valid"], [[66046, 66175], "disallowed"], [[66176, 66204], "valid"], [[66205, 66207], "disallowed"], [[66208, 66256], "valid"], [[66257, 66271], "disallowed"], [[66272, 66272], "valid"], [[66273, 66299], "valid", [], "NV8"], [[66300, 66303], "disallowed"], [[66304, 66334], "valid"], [[66335, 66335], "valid"], [[66336, 66339], "valid", [], "NV8"], [[66340, 66351], "disallowed"], [[66352, 66368], "valid"], [[66369, 66369], "valid", [], "NV8"], [[66370, 66377], "valid"], [[66378, 66378], "valid", [], "NV8"], [[66379, 66383], "disallowed"], [[66384, 66426], "valid"], [[66427, 66431], "disallowed"], [[66432, 66461], "valid"], [[66462, 66462], "disallowed"], [[66463, 66463], "valid", [], "NV8"], [[66464, 66499], "valid"], [[66500, 66503], "disallowed"], [[66504, 66511], "valid"], [[66512, 66517], "valid", [], "NV8"], [[66518, 66559], "disallowed"], [[66560, 66560], "mapped", [66600]], [[66561, 66561], "mapped", [66601]], [[66562, 66562], "mapped", [66602]], [[66563, 66563], "mapped", [66603]], [[66564, 66564], "mapped", [66604]], [[66565, 66565], "mapped", [66605]], [[66566, 66566], "mapped", [66606]], [[66567, 66567], "mapped", [66607]], [[66568, 66568], "mapped", [66608]], [[66569, 66569], "mapped", [66609]], [[66570, 66570], "mapped", [66610]], [[66571, 66571], "mapped", [66611]], [[66572, 66572], "mapped", [66612]], [[66573, 66573], "mapped", [66613]], [[66574, 66574], "mapped", [66614]], [[66575, 66575], "mapped", [66615]], [[66576, 66576], "mapped", [66616]], [[66577, 66577], "mapped", [66617]], [[66578, 66578], "mapped", [66618]], [[66579, 66579], "mapped", [66619]], [[66580, 66580], "mapped", [66620]], [[66581, 66581], "mapped", [66621]], [[66582, 66582], "mapped", [66622]], [[66583, 66583], "mapped", [66623]], [[66584, 66584], "mapped", [66624]], [[66585, 66585], "mapped", [66625]], [[66586, 66586], "mapped", [66626]], [[66587, 66587], "mapped", [66627]], [[66588, 66588], "mapped", [66628]], [[66589, 66589], "mapped", [66629]], [[66590, 66590], "mapped", [66630]], [[66591, 66591], "mapped", [66631]], [[66592, 66592], "mapped", [66632]], [[66593, 66593], "mapped", [66633]], [[66594, 66594], "mapped", [66634]], [[66595, 66595], "mapped", [66635]], [[66596, 66596], "mapped", [66636]], [[66597, 66597], "mapped", [66637]], [[66598, 66598], "mapped", [66638]], [[66599, 66599], "mapped", [66639]], [[66600, 66637], "valid"], [[66638, 66717], "valid"], [[66718, 66719], "disallowed"], [[66720, 66729], "valid"], [[66730, 66815], "disallowed"], [[66816, 66855], "valid"], [[66856, 66863], "disallowed"], [[66864, 66915], "valid"], [[66916, 66926], "disallowed"], [[66927, 66927], "valid", [], "NV8"], [[66928, 67071], "disallowed"], [[67072, 67382], "valid"], [[67383, 67391], "disallowed"], [[67392, 67413], "valid"], [[67414, 67423], "disallowed"], [[67424, 67431], "valid"], [[67432, 67583], "disallowed"], [[67584, 67589], "valid"], [[67590, 67591], "disallowed"], [[67592, 67592], "valid"], [[67593, 67593], "disallowed"], [[67594, 67637], "valid"], [[67638, 67638], "disallowed"], [[67639, 67640], "valid"], [[67641, 67643], "disallowed"], [[67644, 67644], "valid"], [[67645, 67646], "disallowed"], [[67647, 67647], "valid"], [[67648, 67669], "valid"], [[67670, 67670], "disallowed"], [[67671, 67679], "valid", [], "NV8"], [[67680, 67702], "valid"], [[67703, 67711], "valid", [], "NV8"], [[67712, 67742], "valid"], [[67743, 67750], "disallowed"], [[67751, 67759], "valid", [], "NV8"], [[67760, 67807], "disallowed"], [[67808, 67826], "valid"], [[67827, 67827], "disallowed"], [[67828, 67829], "valid"], [[67830, 67834], "disallowed"], [[67835, 67839], "valid", [], "NV8"], [[67840, 67861], "valid"], [[67862, 67865], "valid", [], "NV8"], [[67866, 67867], "valid", [], "NV8"], [[67868, 67870], "disallowed"], [[67871, 67871], "valid", [], "NV8"], [[67872, 67897], "valid"], [[67898, 67902], "disallowed"], [[67903, 67903], "valid", [], "NV8"], [[67904, 67967], "disallowed"], [[67968, 68023], "valid"], [[68024, 68027], "disallowed"], [[68028, 68029], "valid", [], "NV8"], [[68030, 68031], "valid"], [[68032, 68047], "valid", [], "NV8"], [[68048, 68049], "disallowed"], [[68050, 68095], "valid", [], "NV8"], [[68096, 68099], "valid"], [[68100, 68100], "disallowed"], [[68101, 68102], "valid"], [[68103, 68107], "disallowed"], [[68108, 68115], "valid"], [[68116, 68116], "disallowed"], [[68117, 68119], "valid"], [[68120, 68120], "disallowed"], [[68121, 68147], "valid"], [[68148, 68151], "disallowed"], [[68152, 68154], "valid"], [[68155, 68158], "disallowed"], [[68159, 68159], "valid"], [[68160, 68167], "valid", [], "NV8"], [[68168, 68175], "disallowed"], [[68176, 68184], "valid", [], "NV8"], [[68185, 68191], "disallowed"], [[68192, 68220], "valid"], [[68221, 68223], "valid", [], "NV8"], [[68224, 68252], "valid"], [[68253, 68255], "valid", [], "NV8"], [[68256, 68287], "disallowed"], [[68288, 68295], "valid"], [[68296, 68296], "valid", [], "NV8"], [[68297, 68326], "valid"], [[68327, 68330], "disallowed"], [[68331, 68342], "valid", [], "NV8"], [[68343, 68351], "disallowed"], [[68352, 68405], "valid"], [[68406, 68408], "disallowed"], [[68409, 68415], "valid", [], "NV8"], [[68416, 68437], "valid"], [[68438, 68439], "disallowed"], [[68440, 68447], "valid", [], "NV8"], [[68448, 68466], "valid"], [[68467, 68471], "disallowed"], [[68472, 68479], "valid", [], "NV8"], [[68480, 68497], "valid"], [[68498, 68504], "disallowed"], [[68505, 68508], "valid", [], "NV8"], [[68509, 68520], "disallowed"], [[68521, 68527], "valid", [], "NV8"], [[68528, 68607], "disallowed"], [[68608, 68680], "valid"], [[68681, 68735], "disallowed"], [[68736, 68736], "mapped", [68800]], [[68737, 68737], "mapped", [68801]], [[68738, 68738], "mapped", [68802]], [[68739, 68739], "mapped", [68803]], [[68740, 68740], "mapped", [68804]], [[68741, 68741], "mapped", [68805]], [[68742, 68742], "mapped", [68806]], [[68743, 68743], "mapped", [68807]], [[68744, 68744], "mapped", [68808]], [[68745, 68745], "mapped", [68809]], [[68746, 68746], "mapped", [68810]], [[68747, 68747], "mapped", [68811]], [[68748, 68748], "mapped", [68812]], [[68749, 68749], "mapped", [68813]], [[68750, 68750], "mapped", [68814]], [[68751, 68751], "mapped", [68815]], [[68752, 68752], "mapped", [68816]], [[68753, 68753], "mapped", [68817]], [[68754, 68754], "mapped", [68818]], [[68755, 68755], "mapped", [68819]], [[68756, 68756], "mapped", [68820]], [[68757, 68757], "mapped", [68821]], [[68758, 68758], "mapped", [68822]], [[68759, 68759], "mapped", [68823]], [[68760, 68760], "mapped", [68824]], [[68761, 68761], "mapped", [68825]], [[68762, 68762], "mapped", [68826]], [[68763, 68763], "mapped", [68827]], [[68764, 68764], "mapped", [68828]], [[68765, 68765], "mapped", [68829]], [[68766, 68766], "mapped", [68830]], [[68767, 68767], "mapped", [68831]], [[68768, 68768], "mapped", [68832]], [[68769, 68769], "mapped", [68833]], [[68770, 68770], "mapped", [68834]], [[68771, 68771], "mapped", [68835]], [[68772, 68772], "mapped", [68836]], [[68773, 68773], "mapped", [68837]], [[68774, 68774], "mapped", [68838]], [[68775, 68775], "mapped", [68839]], [[68776, 68776], "mapped", [68840]], [[68777, 68777], "mapped", [68841]], [[68778, 68778], "mapped", [68842]], [[68779, 68779], "mapped", [68843]], [[68780, 68780], "mapped", [68844]], [[68781, 68781], "mapped", [68845]], [[68782, 68782], "mapped", [68846]], [[68783, 68783], "mapped", [68847]], [[68784, 68784], "mapped", [68848]], [[68785, 68785], "mapped", [68849]], [[68786, 68786], "mapped", [68850]], [[68787, 68799], "disallowed"], [[68800, 68850], "valid"], [[68851, 68857], "disallowed"], [[68858, 68863], "valid", [], "NV8"], [[68864, 69215], "disallowed"], [[69216, 69246], "valid", [], "NV8"], [[69247, 69631], "disallowed"], [[69632, 69702], "valid"], [[69703, 69709], "valid", [], "NV8"], [[69710, 69713], "disallowed"], [[69714, 69733], "valid", [], "NV8"], [[69734, 69743], "valid"], [[69744, 69758], "disallowed"], [[69759, 69759], "valid"], [[69760, 69818], "valid"], [[69819, 69820], "valid", [], "NV8"], [[69821, 69821], "disallowed"], [[69822, 69825], "valid", [], "NV8"], [[69826, 69839], "disallowed"], [[69840, 69864], "valid"], [[69865, 69871], "disallowed"], [[69872, 69881], "valid"], [[69882, 69887], "disallowed"], [[69888, 69940], "valid"], [[69941, 69941], "disallowed"], [[69942, 69951], "valid"], [[69952, 69955], "valid", [], "NV8"], [[69956, 69967], "disallowed"], [[69968, 70003], "valid"], [[70004, 70005], "valid", [], "NV8"], [[70006, 70006], "valid"], [[70007, 70015], "disallowed"], [[70016, 70084], "valid"], [[70085, 70088], "valid", [], "NV8"], [[70089, 70089], "valid", [], "NV8"], [[70090, 70092], "valid"], [[70093, 70093], "valid", [], "NV8"], [[70094, 70095], "disallowed"], [[70096, 70105], "valid"], [[70106, 70106], "valid"], [[70107, 70107], "valid", [], "NV8"], [[70108, 70108], "valid"], [[70109, 70111], "valid", [], "NV8"], [[70112, 70112], "disallowed"], [[70113, 70132], "valid", [], "NV8"], [[70133, 70143], "disallowed"], [[70144, 70161], "valid"], [[70162, 70162], "disallowed"], [[70163, 70199], "valid"], [[70200, 70205], "valid", [], "NV8"], [[70206, 70271], "disallowed"], [[70272, 70278], "valid"], [[70279, 70279], "disallowed"], [[70280, 70280], "valid"], [[70281, 70281], "disallowed"], [[70282, 70285], "valid"], [[70286, 70286], "disallowed"], [[70287, 70301], "valid"], [[70302, 70302], "disallowed"], [[70303, 70312], "valid"], [[70313, 70313], "valid", [], "NV8"], [[70314, 70319], "disallowed"], [[70320, 70378], "valid"], [[70379, 70383], "disallowed"], [[70384, 70393], "valid"], [[70394, 70399], "disallowed"], [[70400, 70400], "valid"], [[70401, 70403], "valid"], [[70404, 70404], "disallowed"], [[70405, 70412], "valid"], [[70413, 70414], "disallowed"], [[70415, 70416], "valid"], [[70417, 70418], "disallowed"], [[70419, 70440], "valid"], [[70441, 70441], "disallowed"], [[70442, 70448], "valid"], [[70449, 70449], "disallowed"], [[70450, 70451], "valid"], [[70452, 70452], "disallowed"], [[70453, 70457], "valid"], [[70458, 70459], "disallowed"], [[70460, 70468], "valid"], [[70469, 70470], "disallowed"], [[70471, 70472], "valid"], [[70473, 70474], "disallowed"], [[70475, 70477], "valid"], [[70478, 70479], "disallowed"], [[70480, 70480], "valid"], [[70481, 70486], "disallowed"], [[70487, 70487], "valid"], [[70488, 70492], "disallowed"], [[70493, 70499], "valid"], [[70500, 70501], "disallowed"], [[70502, 70508], "valid"], [[70509, 70511], "disallowed"], [[70512, 70516], "valid"], [[70517, 70783], "disallowed"], [[70784, 70853], "valid"], [[70854, 70854], "valid", [], "NV8"], [[70855, 70855], "valid"], [[70856, 70863], "disallowed"], [[70864, 70873], "valid"], [[70874, 71039], "disallowed"], [[71040, 71093], "valid"], [[71094, 71095], "disallowed"], [[71096, 71104], "valid"], [[71105, 71113], "valid", [], "NV8"], [[71114, 71127], "valid", [], "NV8"], [[71128, 71133], "valid"], [[71134, 71167], "disallowed"], [[71168, 71232], "valid"], [[71233, 71235], "valid", [], "NV8"], [[71236, 71236], "valid"], [[71237, 71247], "disallowed"], [[71248, 71257], "valid"], [[71258, 71295], "disallowed"], [[71296, 71351], "valid"], [[71352, 71359], "disallowed"], [[71360, 71369], "valid"], [[71370, 71423], "disallowed"], [[71424, 71449], "valid"], [[71450, 71452], "disallowed"], [[71453, 71467], "valid"], [[71468, 71471], "disallowed"], [[71472, 71481], "valid"], [[71482, 71487], "valid", [], "NV8"], [[71488, 71839], "disallowed"], [[71840, 71840], "mapped", [71872]], [[71841, 71841], "mapped", [71873]], [[71842, 71842], "mapped", [71874]], [[71843, 71843], "mapped", [71875]], [[71844, 71844], "mapped", [71876]], [[71845, 71845], "mapped", [71877]], [[71846, 71846], "mapped", [71878]], [[71847, 71847], "mapped", [71879]], [[71848, 71848], "mapped", [71880]], [[71849, 71849], "mapped", [71881]], [[71850, 71850], "mapped", [71882]], [[71851, 71851], "mapped", [71883]], [[71852, 71852], "mapped", [71884]], [[71853, 71853], "mapped", [71885]], [[71854, 71854], "mapped", [71886]], [[71855, 71855], "mapped", [71887]], [[71856, 71856], "mapped", [71888]], [[71857, 71857], "mapped", [71889]], [[71858, 71858], "mapped", [71890]], [[71859, 71859], "mapped", [71891]], [[71860, 71860], "mapped", [71892]], [[71861, 71861], "mapped", [71893]], [[71862, 71862], "mapped", [71894]], [[71863, 71863], "mapped", [71895]], [[71864, 71864], "mapped", [71896]], [[71865, 71865], "mapped", [71897]], [[71866, 71866], "mapped", [71898]], [[71867, 71867], "mapped", [71899]], [[71868, 71868], "mapped", [71900]], [[71869, 71869], "mapped", [71901]], [[71870, 71870], "mapped", [71902]], [[71871, 71871], "mapped", [71903]], [[71872, 71913], "valid"], [[71914, 71922], "valid", [], "NV8"], [[71923, 71934], "disallowed"], [[71935, 71935], "valid"], [[71936, 72383], "disallowed"], [[72384, 72440], "valid"], [[72441, 73727], "disallowed"], [[73728, 74606], "valid"], [[74607, 74648], "valid"], [[74649, 74649], "valid"], [[74650, 74751], "disallowed"], [[74752, 74850], "valid", [], "NV8"], [[74851, 74862], "valid", [], "NV8"], [[74863, 74863], "disallowed"], [[74864, 74867], "valid", [], "NV8"], [[74868, 74868], "valid", [], "NV8"], [[74869, 74879], "disallowed"], [[74880, 75075], "valid"], [[75076, 77823], "disallowed"], [[77824, 78894], "valid"], [[78895, 82943], "disallowed"], [[82944, 83526], "valid"], [[83527, 92159], "disallowed"], [[92160, 92728], "valid"], [[92729, 92735], "disallowed"], [[92736, 92766], "valid"], [[92767, 92767], "disallowed"], [[92768, 92777], "valid"], [[92778, 92781], "disallowed"], [[92782, 92783], "valid", [], "NV8"], [[92784, 92879], "disallowed"], [[92880, 92909], "valid"], [[92910, 92911], "disallowed"], [[92912, 92916], "valid"], [[92917, 92917], "valid", [], "NV8"], [[92918, 92927], "disallowed"], [[92928, 92982], "valid"], [[92983, 92991], "valid", [], "NV8"], [[92992, 92995], "valid"], [[92996, 92997], "valid", [], "NV8"], [[92998, 93007], "disallowed"], [[93008, 93017], "valid"], [[93018, 93018], "disallowed"], [[93019, 93025], "valid", [], "NV8"], [[93026, 93026], "disallowed"], [[93027, 93047], "valid"], [[93048, 93052], "disallowed"], [[93053, 93071], "valid"], [[93072, 93951], "disallowed"], [[93952, 94020], "valid"], [[94021, 94031], "disallowed"], [[94032, 94078], "valid"], [[94079, 94094], "disallowed"], [[94095, 94111], "valid"], [[94112, 110591], "disallowed"], [[110592, 110593], "valid"], [[110594, 113663], "disallowed"], [[113664, 113770], "valid"], [[113771, 113775], "disallowed"], [[113776, 113788], "valid"], [[113789, 113791], "disallowed"], [[113792, 113800], "valid"], [[113801, 113807], "disallowed"], [[113808, 113817], "valid"], [[113818, 113819], "disallowed"], [[113820, 113820], "valid", [], "NV8"], [[113821, 113822], "valid"], [[113823, 113823], "valid", [], "NV8"], [[113824, 113827], "ignored"], [[113828, 118783], "disallowed"], [[118784, 119029], "valid", [], "NV8"], [[119030, 119039], "disallowed"], [[119040, 119078], "valid", [], "NV8"], [[119079, 119080], "disallowed"], [[119081, 119081], "valid", [], "NV8"], [[119082, 119133], "valid", [], "NV8"], [[119134, 119134], "mapped", [119127, 119141]], [[119135, 119135], "mapped", [119128, 119141]], [[119136, 119136], "mapped", [119128, 119141, 119150]], [[119137, 119137], "mapped", [119128, 119141, 119151]], [[119138, 119138], "mapped", [119128, 119141, 119152]], [[119139, 119139], "mapped", [119128, 119141, 119153]], [[119140, 119140], "mapped", [119128, 119141, 119154]], [[119141, 119154], "valid", [], "NV8"], [[119155, 119162], "disallowed"], [[119163, 119226], "valid", [], "NV8"], [[119227, 119227], "mapped", [119225, 119141]], [[119228, 119228], "mapped", [119226, 119141]], [[119229, 119229], "mapped", [119225, 119141, 119150]], [[119230, 119230], "mapped", [119226, 119141, 119150]], [[119231, 119231], "mapped", [119225, 119141, 119151]], [[119232, 119232], "mapped", [119226, 119141, 119151]], [[119233, 119261], "valid", [], "NV8"], [[119262, 119272], "valid", [], "NV8"], [[119273, 119295], "disallowed"], [[119296, 119365], "valid", [], "NV8"], [[119366, 119551], "disallowed"], [[119552, 119638], "valid", [], "NV8"], [[119639, 119647], "disallowed"], [[119648, 119665], "valid", [], "NV8"], [[119666, 119807], "disallowed"], [[119808, 119808], "mapped", [97]], [[119809, 119809], "mapped", [98]], [[119810, 119810], "mapped", [99]], [[119811, 119811], "mapped", [100]], [[119812, 119812], "mapped", [101]], [[119813, 119813], "mapped", [102]], [[119814, 119814], "mapped", [103]], [[119815, 119815], "mapped", [104]], [[119816, 119816], "mapped", [105]], [[119817, 119817], "mapped", [106]], [[119818, 119818], "mapped", [107]], [[119819, 119819], "mapped", [108]], [[119820, 119820], "mapped", [109]], [[119821, 119821], "mapped", [110]], [[119822, 119822], "mapped", [111]], [[119823, 119823], "mapped", [112]], [[119824, 119824], "mapped", [113]], [[119825, 119825], "mapped", [114]], [[119826, 119826], "mapped", [115]], [[119827, 119827], "mapped", [116]], [[119828, 119828], "mapped", [117]], [[119829, 119829], "mapped", [118]], [[119830, 119830], "mapped", [119]], [[119831, 119831], "mapped", [120]], [[119832, 119832], "mapped", [121]], [[119833, 119833], "mapped", [122]], [[119834, 119834], "mapped", [97]], [[119835, 119835], "mapped", [98]], [[119836, 119836], "mapped", [99]], [[119837, 119837], "mapped", [100]], [[119838, 119838], "mapped", [101]], [[119839, 119839], "mapped", [102]], [[119840, 119840], "mapped", [103]], [[119841, 119841], "mapped", [104]], [[119842, 119842], "mapped", [105]], [[119843, 119843], "mapped", [106]], [[119844, 119844], "mapped", [107]], [[119845, 119845], "mapped", [108]], [[119846, 119846], "mapped", [109]], [[119847, 119847], "mapped", [110]], [[119848, 119848], "mapped", [111]], [[119849, 119849], "mapped", [112]], [[119850, 119850], "mapped", [113]], [[119851, 119851], "mapped", [114]], [[119852, 119852], "mapped", [115]], [[119853, 119853], "mapped", [116]], [[119854, 119854], "mapped", [117]], [[119855, 119855], "mapped", [118]], [[119856, 119856], "mapped", [119]], [[119857, 119857], "mapped", [120]], [[119858, 119858], "mapped", [121]], [[119859, 119859], "mapped", [122]], [[119860, 119860], "mapped", [97]], [[119861, 119861], "mapped", [98]], [[119862, 119862], "mapped", [99]], [[119863, 119863], "mapped", [100]], [[119864, 119864], "mapped", [101]], [[119865, 119865], "mapped", [102]], [[119866, 119866], "mapped", [103]], [[119867, 119867], "mapped", [104]], [[119868, 119868], "mapped", [105]], [[119869, 119869], "mapped", [106]], [[119870, 119870], "mapped", [107]], [[119871, 119871], "mapped", [108]], [[119872, 119872], "mapped", [109]], [[119873, 119873], "mapped", [110]], [[119874, 119874], "mapped", [111]], [[119875, 119875], "mapped", [112]], [[119876, 119876], "mapped", [113]], [[119877, 119877], "mapped", [114]], [[119878, 119878], "mapped", [115]], [[119879, 119879], "mapped", [116]], [[119880, 119880], "mapped", [117]], [[119881, 119881], "mapped", [118]], [[119882, 119882], "mapped", [119]], [[119883, 119883], "mapped", [120]], [[119884, 119884], "mapped", [121]], [[119885, 119885], "mapped", [122]], [[119886, 119886], "mapped", [97]], [[119887, 119887], "mapped", [98]], [[119888, 119888], "mapped", [99]], [[119889, 119889], "mapped", [100]], [[119890, 119890], "mapped", [101]], [[119891, 119891], "mapped", [102]], [[119892, 119892], "mapped", [103]], [[119893, 119893], "disallowed"], [[119894, 119894], "mapped", [105]], [[119895, 119895], "mapped", [106]], [[119896, 119896], "mapped", [107]], [[119897, 119897], "mapped", [108]], [[119898, 119898], "mapped", [109]], [[119899, 119899], "mapped", [110]], [[119900, 119900], "mapped", [111]], [[119901, 119901], "mapped", [112]], [[119902, 119902], "mapped", [113]], [[119903, 119903], "mapped", [114]], [[119904, 119904], "mapped", [115]], [[119905, 119905], "mapped", [116]], [[119906, 119906], "mapped", [117]], [[119907, 119907], "mapped", [118]], [[119908, 119908], "mapped", [119]], [[119909, 119909], "mapped", [120]], [[119910, 119910], "mapped", [121]], [[119911, 119911], "mapped", [122]], [[119912, 119912], "mapped", [97]], [[119913, 119913], "mapped", [98]], [[119914, 119914], "mapped", [99]], [[119915, 119915], "mapped", [100]], [[119916, 119916], "mapped", [101]], [[119917, 119917], "mapped", [102]], [[119918, 119918], "mapped", [103]], [[119919, 119919], "mapped", [104]], [[119920, 119920], "mapped", [105]], [[119921, 119921], "mapped", [106]], [[119922, 119922], "mapped", [107]], [[119923, 119923], "mapped", [108]], [[119924, 119924], "mapped", [109]], [[119925, 119925], "mapped", [110]], [[119926, 119926], "mapped", [111]], [[119927, 119927], "mapped", [112]], [[119928, 119928], "mapped", [113]], [[119929, 119929], "mapped", [114]], [[119930, 119930], "mapped", [115]], [[119931, 119931], "mapped", [116]], [[119932, 119932], "mapped", [117]], [[119933, 119933], "mapped", [118]], [[119934, 119934], "mapped", [119]], [[119935, 119935], "mapped", [120]], [[119936, 119936], "mapped", [121]], [[119937, 119937], "mapped", [122]], [[119938, 119938], "mapped", [97]], [[119939, 119939], "mapped", [98]], [[119940, 119940], "mapped", [99]], [[119941, 119941], "mapped", [100]], [[119942, 119942], "mapped", [101]], [[119943, 119943], "mapped", [102]], [[119944, 119944], "mapped", [103]], [[119945, 119945], "mapped", [104]], [[119946, 119946], "mapped", [105]], [[119947, 119947], "mapped", [106]], [[119948, 119948], "mapped", [107]], [[119949, 119949], "mapped", [108]], [[119950, 119950], "mapped", [109]], [[119951, 119951], "mapped", [110]], [[119952, 119952], "mapped", [111]], [[119953, 119953], "mapped", [112]], [[119954, 119954], "mapped", [113]], [[119955, 119955], "mapped", [114]], [[119956, 119956], "mapped", [115]], [[119957, 119957], "mapped", [116]], [[119958, 119958], "mapped", [117]], [[119959, 119959], "mapped", [118]], [[119960, 119960], "mapped", [119]], [[119961, 119961], "mapped", [120]], [[119962, 119962], "mapped", [121]], [[119963, 119963], "mapped", [122]], [[119964, 119964], "mapped", [97]], [[119965, 119965], "disallowed"], [[119966, 119966], "mapped", [99]], [[119967, 119967], "mapped", [100]], [[119968, 119969], "disallowed"], [[119970, 119970], "mapped", [103]], [[119971, 119972], "disallowed"], [[119973, 119973], "mapped", [106]], [[119974, 119974], "mapped", [107]], [[119975, 119976], "disallowed"], [[119977, 119977], "mapped", [110]], [[119978, 119978], "mapped", [111]], [[119979, 119979], "mapped", [112]], [[119980, 119980], "mapped", [113]], [[119981, 119981], "disallowed"], [[119982, 119982], "mapped", [115]], [[119983, 119983], "mapped", [116]], [[119984, 119984], "mapped", [117]], [[119985, 119985], "mapped", [118]], [[119986, 119986], "mapped", [119]], [[119987, 119987], "mapped", [120]], [[119988, 119988], "mapped", [121]], [[119989, 119989], "mapped", [122]], [[119990, 119990], "mapped", [97]], [[119991, 119991], "mapped", [98]], [[119992, 119992], "mapped", [99]], [[119993, 119993], "mapped", [100]], [[119994, 119994], "disallowed"], [[119995, 119995], "mapped", [102]], [[119996, 119996], "disallowed"], [[119997, 119997], "mapped", [104]], [[119998, 119998], "mapped", [105]], [[119999, 119999], "mapped", [106]], [[12e4, 12e4], "mapped", [107]], [[120001, 120001], "mapped", [108]], [[120002, 120002], "mapped", [109]], [[120003, 120003], "mapped", [110]], [[120004, 120004], "disallowed"], [[120005, 120005], "mapped", [112]], [[120006, 120006], "mapped", [113]], [[120007, 120007], "mapped", [114]], [[120008, 120008], "mapped", [115]], [[120009, 120009], "mapped", [116]], [[120010, 120010], "mapped", [117]], [[120011, 120011], "mapped", [118]], [[120012, 120012], "mapped", [119]], [[120013, 120013], "mapped", [120]], [[120014, 120014], "mapped", [121]], [[120015, 120015], "mapped", [122]], [[120016, 120016], "mapped", [97]], [[120017, 120017], "mapped", [98]], [[120018, 120018], "mapped", [99]], [[120019, 120019], "mapped", [100]], [[120020, 120020], "mapped", [101]], [[120021, 120021], "mapped", [102]], [[120022, 120022], "mapped", [103]], [[120023, 120023], "mapped", [104]], [[120024, 120024], "mapped", [105]], [[120025, 120025], "mapped", [106]], [[120026, 120026], "mapped", [107]], [[120027, 120027], "mapped", [108]], [[120028, 120028], "mapped", [109]], [[120029, 120029], "mapped", [110]], [[120030, 120030], "mapped", [111]], [[120031, 120031], "mapped", [112]], [[120032, 120032], "mapped", [113]], [[120033, 120033], "mapped", [114]], [[120034, 120034], "mapped", [115]], [[120035, 120035], "mapped", [116]], [[120036, 120036], "mapped", [117]], [[120037, 120037], "mapped", [118]], [[120038, 120038], "mapped", [119]], [[120039, 120039], "mapped", [120]], [[120040, 120040], "mapped", [121]], [[120041, 120041], "mapped", [122]], [[120042, 120042], "mapped", [97]], [[120043, 120043], "mapped", [98]], [[120044, 120044], "mapped", [99]], [[120045, 120045], "mapped", [100]], [[120046, 120046], "mapped", [101]], [[120047, 120047], "mapped", [102]], [[120048, 120048], "mapped", [103]], [[120049, 120049], "mapped", [104]], [[120050, 120050], "mapped", [105]], [[120051, 120051], "mapped", [106]], [[120052, 120052], "mapped", [107]], [[120053, 120053], "mapped", [108]], [[120054, 120054], "mapped", [109]], [[120055, 120055], "mapped", [110]], [[120056, 120056], "mapped", [111]], [[120057, 120057], "mapped", [112]], [[120058, 120058], "mapped", [113]], [[120059, 120059], "mapped", [114]], [[120060, 120060], "mapped", [115]], [[120061, 120061], "mapped", [116]], [[120062, 120062], "mapped", [117]], [[120063, 120063], "mapped", [118]], [[120064, 120064], "mapped", [119]], [[120065, 120065], "mapped", [120]], [[120066, 120066], "mapped", [121]], [[120067, 120067], "mapped", [122]], [[120068, 120068], "mapped", [97]], [[120069, 120069], "mapped", [98]], [[120070, 120070], "disallowed"], [[120071, 120071], "mapped", [100]], [[120072, 120072], "mapped", [101]], [[120073, 120073], "mapped", [102]], [[120074, 120074], "mapped", [103]], [[120075, 120076], "disallowed"], [[120077, 120077], "mapped", [106]], [[120078, 120078], "mapped", [107]], [[120079, 120079], "mapped", [108]], [[120080, 120080], "mapped", [109]], [[120081, 120081], "mapped", [110]], [[120082, 120082], "mapped", [111]], [[120083, 120083], "mapped", [112]], [[120084, 120084], "mapped", [113]], [[120085, 120085], "disallowed"], [[120086, 120086], "mapped", [115]], [[120087, 120087], "mapped", [116]], [[120088, 120088], "mapped", [117]], [[120089, 120089], "mapped", [118]], [[120090, 120090], "mapped", [119]], [[120091, 120091], "mapped", [120]], [[120092, 120092], "mapped", [121]], [[120093, 120093], "disallowed"], [[120094, 120094], "mapped", [97]], [[120095, 120095], "mapped", [98]], [[120096, 120096], "mapped", [99]], [[120097, 120097], "mapped", [100]], [[120098, 120098], "mapped", [101]], [[120099, 120099], "mapped", [102]], [[120100, 120100], "mapped", [103]], [[120101, 120101], "mapped", [104]], [[120102, 120102], "mapped", [105]], [[120103, 120103], "mapped", [106]], [[120104, 120104], "mapped", [107]], [[120105, 120105], "mapped", [108]], [[120106, 120106], "mapped", [109]], [[120107, 120107], "mapped", [110]], [[120108, 120108], "mapped", [111]], [[120109, 120109], "mapped", [112]], [[120110, 120110], "mapped", [113]], [[120111, 120111], "mapped", [114]], [[120112, 120112], "mapped", [115]], [[120113, 120113], "mapped", [116]], [[120114, 120114], "mapped", [117]], [[120115, 120115], "mapped", [118]], [[120116, 120116], "mapped", [119]], [[120117, 120117], "mapped", [120]], [[120118, 120118], "mapped", [121]], [[120119, 120119], "mapped", [122]], [[120120, 120120], "mapped", [97]], [[120121, 120121], "mapped", [98]], [[120122, 120122], "disallowed"], [[120123, 120123], "mapped", [100]], [[120124, 120124], "mapped", [101]], [[120125, 120125], "mapped", [102]], [[120126, 120126], "mapped", [103]], [[120127, 120127], "disallowed"], [[120128, 120128], "mapped", [105]], [[120129, 120129], "mapped", [106]], [[120130, 120130], "mapped", [107]], [[120131, 120131], "mapped", [108]], [[120132, 120132], "mapped", [109]], [[120133, 120133], "disallowed"], [[120134, 120134], "mapped", [111]], [[120135, 120137], "disallowed"], [[120138, 120138], "mapped", [115]], [[120139, 120139], "mapped", [116]], [[120140, 120140], "mapped", [117]], [[120141, 120141], "mapped", [118]], [[120142, 120142], "mapped", [119]], [[120143, 120143], "mapped", [120]], [[120144, 120144], "mapped", [121]], [[120145, 120145], "disallowed"], [[120146, 120146], "mapped", [97]], [[120147, 120147], "mapped", [98]], [[120148, 120148], "mapped", [99]], [[120149, 120149], "mapped", [100]], [[120150, 120150], "mapped", [101]], [[120151, 120151], "mapped", [102]], [[120152, 120152], "mapped", [103]], [[120153, 120153], "mapped", [104]], [[120154, 120154], "mapped", [105]], [[120155, 120155], "mapped", [106]], [[120156, 120156], "mapped", [107]], [[120157, 120157], "mapped", [108]], [[120158, 120158], "mapped", [109]], [[120159, 120159], "mapped", [110]], [[120160, 120160], "mapped", [111]], [[120161, 120161], "mapped", [112]], [[120162, 120162], "mapped", [113]], [[120163, 120163], "mapped", [114]], [[120164, 120164], "mapped", [115]], [[120165, 120165], "mapped", [116]], [[120166, 120166], "mapped", [117]], [[120167, 120167], "mapped", [118]], [[120168, 120168], "mapped", [119]], [[120169, 120169], "mapped", [120]], [[120170, 120170], "mapped", [121]], [[120171, 120171], "mapped", [122]], [[120172, 120172], "mapped", [97]], [[120173, 120173], "mapped", [98]], [[120174, 120174], "mapped", [99]], [[120175, 120175], "mapped", [100]], [[120176, 120176], "mapped", [101]], [[120177, 120177], "mapped", [102]], [[120178, 120178], "mapped", [103]], [[120179, 120179], "mapped", [104]], [[120180, 120180], "mapped", [105]], [[120181, 120181], "mapped", [106]], [[120182, 120182], "mapped", [107]], [[120183, 120183], "mapped", [108]], [[120184, 120184], "mapped", [109]], [[120185, 120185], "mapped", [110]], [[120186, 120186], "mapped", [111]], [[120187, 120187], "mapped", [112]], [[120188, 120188], "mapped", [113]], [[120189, 120189], "mapped", [114]], [[120190, 120190], "mapped", [115]], [[120191, 120191], "mapped", [116]], [[120192, 120192], "mapped", [117]], [[120193, 120193], "mapped", [118]], [[120194, 120194], "mapped", [119]], [[120195, 120195], "mapped", [120]], [[120196, 120196], "mapped", [121]], [[120197, 120197], "mapped", [122]], [[120198, 120198], "mapped", [97]], [[120199, 120199], "mapped", [98]], [[120200, 120200], "mapped", [99]], [[120201, 120201], "mapped", [100]], [[120202, 120202], "mapped", [101]], [[120203, 120203], "mapped", [102]], [[120204, 120204], "mapped", [103]], [[120205, 120205], "mapped", [104]], [[120206, 120206], "mapped", [105]], [[120207, 120207], "mapped", [106]], [[120208, 120208], "mapped", [107]], [[120209, 120209], "mapped", [108]], [[120210, 120210], "mapped", [109]], [[120211, 120211], "mapped", [110]], [[120212, 120212], "mapped", [111]], [[120213, 120213], "mapped", [112]], [[120214, 120214], "mapped", [113]], [[120215, 120215], "mapped", [114]], [[120216, 120216], "mapped", [115]], [[120217, 120217], "mapped", [116]], [[120218, 120218], "mapped", [117]], [[120219, 120219], "mapped", [118]], [[120220, 120220], "mapped", [119]], [[120221, 120221], "mapped", [120]], [[120222, 120222], "mapped", [121]], [[120223, 120223], "mapped", [122]], [[120224, 120224], "mapped", [97]], [[120225, 120225], "mapped", [98]], [[120226, 120226], "mapped", [99]], [[120227, 120227], "mapped", [100]], [[120228, 120228], "mapped", [101]], [[120229, 120229], "mapped", [102]], [[120230, 120230], "mapped", [103]], [[120231, 120231], "mapped", [104]], [[120232, 120232], "mapped", [105]], [[120233, 120233], "mapped", [106]], [[120234, 120234], "mapped", [107]], [[120235, 120235], "mapped", [108]], [[120236, 120236], "mapped", [109]], [[120237, 120237], "mapped", [110]], [[120238, 120238], "mapped", [111]], [[120239, 120239], "mapped", [112]], [[120240, 120240], "mapped", [113]], [[120241, 120241], "mapped", [114]], [[120242, 120242], "mapped", [115]], [[120243, 120243], "mapped", [116]], [[120244, 120244], "mapped", [117]], [[120245, 120245], "mapped", [118]], [[120246, 120246], "mapped", [119]], [[120247, 120247], "mapped", [120]], [[120248, 120248], "mapped", [121]], [[120249, 120249], "mapped", [122]], [[120250, 120250], "mapped", [97]], [[120251, 120251], "mapped", [98]], [[120252, 120252], "mapped", [99]], [[120253, 120253], "mapped", [100]], [[120254, 120254], "mapped", [101]], [[120255, 120255], "mapped", [102]], [[120256, 120256], "mapped", [103]], [[120257, 120257], "mapped", [104]], [[120258, 120258], "mapped", [105]], [[120259, 120259], "mapped", [106]], [[120260, 120260], "mapped", [107]], [[120261, 120261], "mapped", [108]], [[120262, 120262], "mapped", [109]], [[120263, 120263], "mapped", [110]], [[120264, 120264], "mapped", [111]], [[120265, 120265], "mapped", [112]], [[120266, 120266], "mapped", [113]], [[120267, 120267], "mapped", [114]], [[120268, 120268], "mapped", [115]], [[120269, 120269], "mapped", [116]], [[120270, 120270], "mapped", [117]], [[120271, 120271], "mapped", [118]], [[120272, 120272], "mapped", [119]], [[120273, 120273], "mapped", [120]], [[120274, 120274], "mapped", [121]], [[120275, 120275], "mapped", [122]], [[120276, 120276], "mapped", [97]], [[120277, 120277], "mapped", [98]], [[120278, 120278], "mapped", [99]], [[120279, 120279], "mapped", [100]], [[120280, 120280], "mapped", [101]], [[120281, 120281], "mapped", [102]], [[120282, 120282], "mapped", [103]], [[120283, 120283], "mapped", [104]], [[120284, 120284], "mapped", [105]], [[120285, 120285], "mapped", [106]], [[120286, 120286], "mapped", [107]], [[120287, 120287], "mapped", [108]], [[120288, 120288], "mapped", [109]], [[120289, 120289], "mapped", [110]], [[120290, 120290], "mapped", [111]], [[120291, 120291], "mapped", [112]], [[120292, 120292], "mapped", [113]], [[120293, 120293], "mapped", [114]], [[120294, 120294], "mapped", [115]], [[120295, 120295], "mapped", [116]], [[120296, 120296], "mapped", [117]], [[120297, 120297], "mapped", [118]], [[120298, 120298], "mapped", [119]], [[120299, 120299], "mapped", [120]], [[120300, 120300], "mapped", [121]], [[120301, 120301], "mapped", [122]], [[120302, 120302], "mapped", [97]], [[120303, 120303], "mapped", [98]], [[120304, 120304], "mapped", [99]], [[120305, 120305], "mapped", [100]], [[120306, 120306], "mapped", [101]], [[120307, 120307], "mapped", [102]], [[120308, 120308], "mapped", [103]], [[120309, 120309], "mapped", [104]], [[120310, 120310], "mapped", [105]], [[120311, 120311], "mapped", [106]], [[120312, 120312], "mapped", [107]], [[120313, 120313], "mapped", [108]], [[120314, 120314], "mapped", [109]], [[120315, 120315], "mapped", [110]], [[120316, 120316], "mapped", [111]], [[120317, 120317], "mapped", [112]], [[120318, 120318], "mapped", [113]], [[120319, 120319], "mapped", [114]], [[120320, 120320], "mapped", [115]], [[120321, 120321], "mapped", [116]], [[120322, 120322], "mapped", [117]], [[120323, 120323], "mapped", [118]], [[120324, 120324], "mapped", [119]], [[120325, 120325], "mapped", [120]], [[120326, 120326], "mapped", [121]], [[120327, 120327], "mapped", [122]], [[120328, 120328], "mapped", [97]], [[120329, 120329], "mapped", [98]], [[120330, 120330], "mapped", [99]], [[120331, 120331], "mapped", [100]], [[120332, 120332], "mapped", [101]], [[120333, 120333], "mapped", [102]], [[120334, 120334], "mapped", [103]], [[120335, 120335], "mapped", [104]], [[120336, 120336], "mapped", [105]], [[120337, 120337], "mapped", [106]], [[120338, 120338], "mapped", [107]], [[120339, 120339], "mapped", [108]], [[120340, 120340], "mapped", [109]], [[120341, 120341], "mapped", [110]], [[120342, 120342], "mapped", [111]], [[120343, 120343], "mapped", [112]], [[120344, 120344], "mapped", [113]], [[120345, 120345], "mapped", [114]], [[120346, 120346], "mapped", [115]], [[120347, 120347], "mapped", [116]], [[120348, 120348], "mapped", [117]], [[120349, 120349], "mapped", [118]], [[120350, 120350], "mapped", [119]], [[120351, 120351], "mapped", [120]], [[120352, 120352], "mapped", [121]], [[120353, 120353], "mapped", [122]], [[120354, 120354], "mapped", [97]], [[120355, 120355], "mapped", [98]], [[120356, 120356], "mapped", [99]], [[120357, 120357], "mapped", [100]], [[120358, 120358], "mapped", [101]], [[120359, 120359], "mapped", [102]], [[120360, 120360], "mapped", [103]], [[120361, 120361], "mapped", [104]], [[120362, 120362], "mapped", [105]], [[120363, 120363], "mapped", [106]], [[120364, 120364], "mapped", [107]], [[120365, 120365], "mapped", [108]], [[120366, 120366], "mapped", [109]], [[120367, 120367], "mapped", [110]], [[120368, 120368], "mapped", [111]], [[120369, 120369], "mapped", [112]], [[120370, 120370], "mapped", [113]], [[120371, 120371], "mapped", [114]], [[120372, 120372], "mapped", [115]], [[120373, 120373], "mapped", [116]], [[120374, 120374], "mapped", [117]], [[120375, 120375], "mapped", [118]], [[120376, 120376], "mapped", [119]], [[120377, 120377], "mapped", [120]], [[120378, 120378], "mapped", [121]], [[120379, 120379], "mapped", [122]], [[120380, 120380], "mapped", [97]], [[120381, 120381], "mapped", [98]], [[120382, 120382], "mapped", [99]], [[120383, 120383], "mapped", [100]], [[120384, 120384], "mapped", [101]], [[120385, 120385], "mapped", [102]], [[120386, 120386], "mapped", [103]], [[120387, 120387], "mapped", [104]], [[120388, 120388], "mapped", [105]], [[120389, 120389], "mapped", [106]], [[120390, 120390], "mapped", [107]], [[120391, 120391], "mapped", [108]], [[120392, 120392], "mapped", [109]], [[120393, 120393], "mapped", [110]], [[120394, 120394], "mapped", [111]], [[120395, 120395], "mapped", [112]], [[120396, 120396], "mapped", [113]], [[120397, 120397], "mapped", [114]], [[120398, 120398], "mapped", [115]], [[120399, 120399], "mapped", [116]], [[120400, 120400], "mapped", [117]], [[120401, 120401], "mapped", [118]], [[120402, 120402], "mapped", [119]], [[120403, 120403], "mapped", [120]], [[120404, 120404], "mapped", [121]], [[120405, 120405], "mapped", [122]], [[120406, 120406], "mapped", [97]], [[120407, 120407], "mapped", [98]], [[120408, 120408], "mapped", [99]], [[120409, 120409], "mapped", [100]], [[120410, 120410], "mapped", [101]], [[120411, 120411], "mapped", [102]], [[120412, 120412], "mapped", [103]], [[120413, 120413], "mapped", [104]], [[120414, 120414], "mapped", [105]], [[120415, 120415], "mapped", [106]], [[120416, 120416], "mapped", [107]], [[120417, 120417], "mapped", [108]], [[120418, 120418], "mapped", [109]], [[120419, 120419], "mapped", [110]], [[120420, 120420], "mapped", [111]], [[120421, 120421], "mapped", [112]], [[120422, 120422], "mapped", [113]], [[120423, 120423], "mapped", [114]], [[120424, 120424], "mapped", [115]], [[120425, 120425], "mapped", [116]], [[120426, 120426], "mapped", [117]], [[120427, 120427], "mapped", [118]], [[120428, 120428], "mapped", [119]], [[120429, 120429], "mapped", [120]], [[120430, 120430], "mapped", [121]], [[120431, 120431], "mapped", [122]], [[120432, 120432], "mapped", [97]], [[120433, 120433], "mapped", [98]], [[120434, 120434], "mapped", [99]], [[120435, 120435], "mapped", [100]], [[120436, 120436], "mapped", [101]], [[120437, 120437], "mapped", [102]], [[120438, 120438], "mapped", [103]], [[120439, 120439], "mapped", [104]], [[120440, 120440], "mapped", [105]], [[120441, 120441], "mapped", [106]], [[120442, 120442], "mapped", [107]], [[120443, 120443], "mapped", [108]], [[120444, 120444], "mapped", [109]], [[120445, 120445], "mapped", [110]], [[120446, 120446], "mapped", [111]], [[120447, 120447], "mapped", [112]], [[120448, 120448], "mapped", [113]], [[120449, 120449], "mapped", [114]], [[120450, 120450], "mapped", [115]], [[120451, 120451], "mapped", [116]], [[120452, 120452], "mapped", [117]], [[120453, 120453], "mapped", [118]], [[120454, 120454], "mapped", [119]], [[120455, 120455], "mapped", [120]], [[120456, 120456], "mapped", [121]], [[120457, 120457], "mapped", [122]], [[120458, 120458], "mapped", [97]], [[120459, 120459], "mapped", [98]], [[120460, 120460], "mapped", [99]], [[120461, 120461], "mapped", [100]], [[120462, 120462], "mapped", [101]], [[120463, 120463], "mapped", [102]], [[120464, 120464], "mapped", [103]], [[120465, 120465], "mapped", [104]], [[120466, 120466], "mapped", [105]], [[120467, 120467], "mapped", [106]], [[120468, 120468], "mapped", [107]], [[120469, 120469], "mapped", [108]], [[120470, 120470], "mapped", [109]], [[120471, 120471], "mapped", [110]], [[120472, 120472], "mapped", [111]], [[120473, 120473], "mapped", [112]], [[120474, 120474], "mapped", [113]], [[120475, 120475], "mapped", [114]], [[120476, 120476], "mapped", [115]], [[120477, 120477], "mapped", [116]], [[120478, 120478], "mapped", [117]], [[120479, 120479], "mapped", [118]], [[120480, 120480], "mapped", [119]], [[120481, 120481], "mapped", [120]], [[120482, 120482], "mapped", [121]], [[120483, 120483], "mapped", [122]], [[120484, 120484], "mapped", [305]], [[120485, 120485], "mapped", [567]], [[120486, 120487], "disallowed"], [[120488, 120488], "mapped", [945]], [[120489, 120489], "mapped", [946]], [[120490, 120490], "mapped", [947]], [[120491, 120491], "mapped", [948]], [[120492, 120492], "mapped", [949]], [[120493, 120493], "mapped", [950]], [[120494, 120494], "mapped", [951]], [[120495, 120495], "mapped", [952]], [[120496, 120496], "mapped", [953]], [[120497, 120497], "mapped", [954]], [[120498, 120498], "mapped", [955]], [[120499, 120499], "mapped", [956]], [[120500, 120500], "mapped", [957]], [[120501, 120501], "mapped", [958]], [[120502, 120502], "mapped", [959]], [[120503, 120503], "mapped", [960]], [[120504, 120504], "mapped", [961]], [[120505, 120505], "mapped", [952]], [[120506, 120506], "mapped", [963]], [[120507, 120507], "mapped", [964]], [[120508, 120508], "mapped", [965]], [[120509, 120509], "mapped", [966]], [[120510, 120510], "mapped", [967]], [[120511, 120511], "mapped", [968]], [[120512, 120512], "mapped", [969]], [[120513, 120513], "mapped", [8711]], [[120514, 120514], "mapped", [945]], [[120515, 120515], "mapped", [946]], [[120516, 120516], "mapped", [947]], [[120517, 120517], "mapped", [948]], [[120518, 120518], "mapped", [949]], [[120519, 120519], "mapped", [950]], [[120520, 120520], "mapped", [951]], [[120521, 120521], "mapped", [952]], [[120522, 120522], "mapped", [953]], [[120523, 120523], "mapped", [954]], [[120524, 120524], "mapped", [955]], [[120525, 120525], "mapped", [956]], [[120526, 120526], "mapped", [957]], [[120527, 120527], "mapped", [958]], [[120528, 120528], "mapped", [959]], [[120529, 120529], "mapped", [960]], [[120530, 120530], "mapped", [961]], [[120531, 120532], "mapped", [963]], [[120533, 120533], "mapped", [964]], [[120534, 120534], "mapped", [965]], [[120535, 120535], "mapped", [966]], [[120536, 120536], "mapped", [967]], [[120537, 120537], "mapped", [968]], [[120538, 120538], "mapped", [969]], [[120539, 120539], "mapped", [8706]], [[120540, 120540], "mapped", [949]], [[120541, 120541], "mapped", [952]], [[120542, 120542], "mapped", [954]], [[120543, 120543], "mapped", [966]], [[120544, 120544], "mapped", [961]], [[120545, 120545], "mapped", [960]], [[120546, 120546], "mapped", [945]], [[120547, 120547], "mapped", [946]], [[120548, 120548], "mapped", [947]], [[120549, 120549], "mapped", [948]], [[120550, 120550], "mapped", [949]], [[120551, 120551], "mapped", [950]], [[120552, 120552], "mapped", [951]], [[120553, 120553], "mapped", [952]], [[120554, 120554], "mapped", [953]], [[120555, 120555], "mapped", [954]], [[120556, 120556], "mapped", [955]], [[120557, 120557], "mapped", [956]], [[120558, 120558], "mapped", [957]], [[120559, 120559], "mapped", [958]], [[120560, 120560], "mapped", [959]], [[120561, 120561], "mapped", [960]], [[120562, 120562], "mapped", [961]], [[120563, 120563], "mapped", [952]], [[120564, 120564], "mapped", [963]], [[120565, 120565], "mapped", [964]], [[120566, 120566], "mapped", [965]], [[120567, 120567], "mapped", [966]], [[120568, 120568], "mapped", [967]], [[120569, 120569], "mapped", [968]], [[120570, 120570], "mapped", [969]], [[120571, 120571], "mapped", [8711]], [[120572, 120572], "mapped", [945]], [[120573, 120573], "mapped", [946]], [[120574, 120574], "mapped", [947]], [[120575, 120575], "mapped", [948]], [[120576, 120576], "mapped", [949]], [[120577, 120577], "mapped", [950]], [[120578, 120578], "mapped", [951]], [[120579, 120579], "mapped", [952]], [[120580, 120580], "mapped", [953]], [[120581, 120581], "mapped", [954]], [[120582, 120582], "mapped", [955]], [[120583, 120583], "mapped", [956]], [[120584, 120584], "mapped", [957]], [[120585, 120585], "mapped", [958]], [[120586, 120586], "mapped", [959]], [[120587, 120587], "mapped", [960]], [[120588, 120588], "mapped", [961]], [[120589, 120590], "mapped", [963]], [[120591, 120591], "mapped", [964]], [[120592, 120592], "mapped", [965]], [[120593, 120593], "mapped", [966]], [[120594, 120594], "mapped", [967]], [[120595, 120595], "mapped", [968]], [[120596, 120596], "mapped", [969]], [[120597, 120597], "mapped", [8706]], [[120598, 120598], "mapped", [949]], [[120599, 120599], "mapped", [952]], [[120600, 120600], "mapped", [954]], [[120601, 120601], "mapped", [966]], [[120602, 120602], "mapped", [961]], [[120603, 120603], "mapped", [960]], [[120604, 120604], "mapped", [945]], [[120605, 120605], "mapped", [946]], [[120606, 120606], "mapped", [947]], [[120607, 120607], "mapped", [948]], [[120608, 120608], "mapped", [949]], [[120609, 120609], "mapped", [950]], [[120610, 120610], "mapped", [951]], [[120611, 120611], "mapped", [952]], [[120612, 120612], "mapped", [953]], [[120613, 120613], "mapped", [954]], [[120614, 120614], "mapped", [955]], [[120615, 120615], "mapped", [956]], [[120616, 120616], "mapped", [957]], [[120617, 120617], "mapped", [958]], [[120618, 120618], "mapped", [959]], [[120619, 120619], "mapped", [960]], [[120620, 120620], "mapped", [961]], [[120621, 120621], "mapped", [952]], [[120622, 120622], "mapped", [963]], [[120623, 120623], "mapped", [964]], [[120624, 120624], "mapped", [965]], [[120625, 120625], "mapped", [966]], [[120626, 120626], "mapped", [967]], [[120627, 120627], "mapped", [968]], [[120628, 120628], "mapped", [969]], [[120629, 120629], "mapped", [8711]], [[120630, 120630], "mapped", [945]], [[120631, 120631], "mapped", [946]], [[120632, 120632], "mapped", [947]], [[120633, 120633], "mapped", [948]], [[120634, 120634], "mapped", [949]], [[120635, 120635], "mapped", [950]], [[120636, 120636], "mapped", [951]], [[120637, 120637], "mapped", [952]], [[120638, 120638], "mapped", [953]], [[120639, 120639], "mapped", [954]], [[120640, 120640], "mapped", [955]], [[120641, 120641], "mapped", [956]], [[120642, 120642], "mapped", [957]], [[120643, 120643], "mapped", [958]], [[120644, 120644], "mapped", [959]], [[120645, 120645], "mapped", [960]], [[120646, 120646], "mapped", [961]], [[120647, 120648], "mapped", [963]], [[120649, 120649], "mapped", [964]], [[120650, 120650], "mapped", [965]], [[120651, 120651], "mapped", [966]], [[120652, 120652], "mapped", [967]], [[120653, 120653], "mapped", [968]], [[120654, 120654], "mapped", [969]], [[120655, 120655], "mapped", [8706]], [[120656, 120656], "mapped", [949]], [[120657, 120657], "mapped", [952]], [[120658, 120658], "mapped", [954]], [[120659, 120659], "mapped", [966]], [[120660, 120660], "mapped", [961]], [[120661, 120661], "mapped", [960]], [[120662, 120662], "mapped", [945]], [[120663, 120663], "mapped", [946]], [[120664, 120664], "mapped", [947]], [[120665, 120665], "mapped", [948]], [[120666, 120666], "mapped", [949]], [[120667, 120667], "mapped", [950]], [[120668, 120668], "mapped", [951]], [[120669, 120669], "mapped", [952]], [[120670, 120670], "mapped", [953]], [[120671, 120671], "mapped", [954]], [[120672, 120672], "mapped", [955]], [[120673, 120673], "mapped", [956]], [[120674, 120674], "mapped", [957]], [[120675, 120675], "mapped", [958]], [[120676, 120676], "mapped", [959]], [[120677, 120677], "mapped", [960]], [[120678, 120678], "mapped", [961]], [[120679, 120679], "mapped", [952]], [[120680, 120680], "mapped", [963]], [[120681, 120681], "mapped", [964]], [[120682, 120682], "mapped", [965]], [[120683, 120683], "mapped", [966]], [[120684, 120684], "mapped", [967]], [[120685, 120685], "mapped", [968]], [[120686, 120686], "mapped", [969]], [[120687, 120687], "mapped", [8711]], [[120688, 120688], "mapped", [945]], [[120689, 120689], "mapped", [946]], [[120690, 120690], "mapped", [947]], [[120691, 120691], "mapped", [948]], [[120692, 120692], "mapped", [949]], [[120693, 120693], "mapped", [950]], [[120694, 120694], "mapped", [951]], [[120695, 120695], "mapped", [952]], [[120696, 120696], "mapped", [953]], [[120697, 120697], "mapped", [954]], [[120698, 120698], "mapped", [955]], [[120699, 120699], "mapped", [956]], [[120700, 120700], "mapped", [957]], [[120701, 120701], "mapped", [958]], [[120702, 120702], "mapped", [959]], [[120703, 120703], "mapped", [960]], [[120704, 120704], "mapped", [961]], [[120705, 120706], "mapped", [963]], [[120707, 120707], "mapped", [964]], [[120708, 120708], "mapped", [965]], [[120709, 120709], "mapped", [966]], [[120710, 120710], "mapped", [967]], [[120711, 120711], "mapped", [968]], [[120712, 120712], "mapped", [969]], [[120713, 120713], "mapped", [8706]], [[120714, 120714], "mapped", [949]], [[120715, 120715], "mapped", [952]], [[120716, 120716], "mapped", [954]], [[120717, 120717], "mapped", [966]], [[120718, 120718], "mapped", [961]], [[120719, 120719], "mapped", [960]], [[120720, 120720], "mapped", [945]], [[120721, 120721], "mapped", [946]], [[120722, 120722], "mapped", [947]], [[120723, 120723], "mapped", [948]], [[120724, 120724], "mapped", [949]], [[120725, 120725], "mapped", [950]], [[120726, 120726], "mapped", [951]], [[120727, 120727], "mapped", [952]], [[120728, 120728], "mapped", [953]], [[120729, 120729], "mapped", [954]], [[120730, 120730], "mapped", [955]], [[120731, 120731], "mapped", [956]], [[120732, 120732], "mapped", [957]], [[120733, 120733], "mapped", [958]], [[120734, 120734], "mapped", [959]], [[120735, 120735], "mapped", [960]], [[120736, 120736], "mapped", [961]], [[120737, 120737], "mapped", [952]], [[120738, 120738], "mapped", [963]], [[120739, 120739], "mapped", [964]], [[120740, 120740], "mapped", [965]], [[120741, 120741], "mapped", [966]], [[120742, 120742], "mapped", [967]], [[120743, 120743], "mapped", [968]], [[120744, 120744], "mapped", [969]], [[120745, 120745], "mapped", [8711]], [[120746, 120746], "mapped", [945]], [[120747, 120747], "mapped", [946]], [[120748, 120748], "mapped", [947]], [[120749, 120749], "mapped", [948]], [[120750, 120750], "mapped", [949]], [[120751, 120751], "mapped", [950]], [[120752, 120752], "mapped", [951]], [[120753, 120753], "mapped", [952]], [[120754, 120754], "mapped", [953]], [[120755, 120755], "mapped", [954]], [[120756, 120756], "mapped", [955]], [[120757, 120757], "mapped", [956]], [[120758, 120758], "mapped", [957]], [[120759, 120759], "mapped", [958]], [[120760, 120760], "mapped", [959]], [[120761, 120761], "mapped", [960]], [[120762, 120762], "mapped", [961]], [[120763, 120764], "mapped", [963]], [[120765, 120765], "mapped", [964]], [[120766, 120766], "mapped", [965]], [[120767, 120767], "mapped", [966]], [[120768, 120768], "mapped", [967]], [[120769, 120769], "mapped", [968]], [[120770, 120770], "mapped", [969]], [[120771, 120771], "mapped", [8706]], [[120772, 120772], "mapped", [949]], [[120773, 120773], "mapped", [952]], [[120774, 120774], "mapped", [954]], [[120775, 120775], "mapped", [966]], [[120776, 120776], "mapped", [961]], [[120777, 120777], "mapped", [960]], [[120778, 120779], "mapped", [989]], [[120780, 120781], "disallowed"], [[120782, 120782], "mapped", [48]], [[120783, 120783], "mapped", [49]], [[120784, 120784], "mapped", [50]], [[120785, 120785], "mapped", [51]], [[120786, 120786], "mapped", [52]], [[120787, 120787], "mapped", [53]], [[120788, 120788], "mapped", [54]], [[120789, 120789], "mapped", [55]], [[120790, 120790], "mapped", [56]], [[120791, 120791], "mapped", [57]], [[120792, 120792], "mapped", [48]], [[120793, 120793], "mapped", [49]], [[120794, 120794], "mapped", [50]], [[120795, 120795], "mapped", [51]], [[120796, 120796], "mapped", [52]], [[120797, 120797], "mapped", [53]], [[120798, 120798], "mapped", [54]], [[120799, 120799], "mapped", [55]], [[120800, 120800], "mapped", [56]], [[120801, 120801], "mapped", [57]], [[120802, 120802], "mapped", [48]], [[120803, 120803], "mapped", [49]], [[120804, 120804], "mapped", [50]], [[120805, 120805], "mapped", [51]], [[120806, 120806], "mapped", [52]], [[120807, 120807], "mapped", [53]], [[120808, 120808], "mapped", [54]], [[120809, 120809], "mapped", [55]], [[120810, 120810], "mapped", [56]], [[120811, 120811], "mapped", [57]], [[120812, 120812], "mapped", [48]], [[120813, 120813], "mapped", [49]], [[120814, 120814], "mapped", [50]], [[120815, 120815], "mapped", [51]], [[120816, 120816], "mapped", [52]], [[120817, 120817], "mapped", [53]], [[120818, 120818], "mapped", [54]], [[120819, 120819], "mapped", [55]], [[120820, 120820], "mapped", [56]], [[120821, 120821], "mapped", [57]], [[120822, 120822], "mapped", [48]], [[120823, 120823], "mapped", [49]], [[120824, 120824], "mapped", [50]], [[120825, 120825], "mapped", [51]], [[120826, 120826], "mapped", [52]], [[120827, 120827], "mapped", [53]], [[120828, 120828], "mapped", [54]], [[120829, 120829], "mapped", [55]], [[120830, 120830], "mapped", [56]], [[120831, 120831], "mapped", [57]], [[120832, 121343], "valid", [], "NV8"], [[121344, 121398], "valid"], [[121399, 121402], "valid", [], "NV8"], [[121403, 121452], "valid"], [[121453, 121460], "valid", [], "NV8"], [[121461, 121461], "valid"], [[121462, 121475], "valid", [], "NV8"], [[121476, 121476], "valid"], [[121477, 121483], "valid", [], "NV8"], [[121484, 121498], "disallowed"], [[121499, 121503], "valid"], [[121504, 121504], "disallowed"], [[121505, 121519], "valid"], [[121520, 124927], "disallowed"], [[124928, 125124], "valid"], [[125125, 125126], "disallowed"], [[125127, 125135], "valid", [], "NV8"], [[125136, 125142], "valid"], [[125143, 126463], "disallowed"], [[126464, 126464], "mapped", [1575]], [[126465, 126465], "mapped", [1576]], [[126466, 126466], "mapped", [1580]], [[126467, 126467], "mapped", [1583]], [[126468, 126468], "disallowed"], [[126469, 126469], "mapped", [1608]], [[126470, 126470], "mapped", [1586]], [[126471, 126471], "mapped", [1581]], [[126472, 126472], "mapped", [1591]], [[126473, 126473], "mapped", [1610]], [[126474, 126474], "mapped", [1603]], [[126475, 126475], "mapped", [1604]], [[126476, 126476], "mapped", [1605]], [[126477, 126477], "mapped", [1606]], [[126478, 126478], "mapped", [1587]], [[126479, 126479], "mapped", [1593]], [[126480, 126480], "mapped", [1601]], [[126481, 126481], "mapped", [1589]], [[126482, 126482], "mapped", [1602]], [[126483, 126483], "mapped", [1585]], [[126484, 126484], "mapped", [1588]], [[126485, 126485], "mapped", [1578]], [[126486, 126486], "mapped", [1579]], [[126487, 126487], "mapped", [1582]], [[126488, 126488], "mapped", [1584]], [[126489, 126489], "mapped", [1590]], [[126490, 126490], "mapped", [1592]], [[126491, 126491], "mapped", [1594]], [[126492, 126492], "mapped", [1646]], [[126493, 126493], "mapped", [1722]], [[126494, 126494], "mapped", [1697]], [[126495, 126495], "mapped", [1647]], [[126496, 126496], "disallowed"], [[126497, 126497], "mapped", [1576]], [[126498, 126498], "mapped", [1580]], [[126499, 126499], "disallowed"], [[126500, 126500], "mapped", [1607]], [[126501, 126502], "disallowed"], [[126503, 126503], "mapped", [1581]], [[126504, 126504], "disallowed"], [[126505, 126505], "mapped", [1610]], [[126506, 126506], "mapped", [1603]], [[126507, 126507], "mapped", [1604]], [[126508, 126508], "mapped", [1605]], [[126509, 126509], "mapped", [1606]], [[126510, 126510], "mapped", [1587]], [[126511, 126511], "mapped", [1593]], [[126512, 126512], "mapped", [1601]], [[126513, 126513], "mapped", [1589]], [[126514, 126514], "mapped", [1602]], [[126515, 126515], "disallowed"], [[126516, 126516], "mapped", [1588]], [[126517, 126517], "mapped", [1578]], [[126518, 126518], "mapped", [1579]], [[126519, 126519], "mapped", [1582]], [[126520, 126520], "disallowed"], [[126521, 126521], "mapped", [1590]], [[126522, 126522], "disallowed"], [[126523, 126523], "mapped", [1594]], [[126524, 126529], "disallowed"], [[126530, 126530], "mapped", [1580]], [[126531, 126534], "disallowed"], [[126535, 126535], "mapped", [1581]], [[126536, 126536], "disallowed"], [[126537, 126537], "mapped", [1610]], [[126538, 126538], "disallowed"], [[126539, 126539], "mapped", [1604]], [[126540, 126540], "disallowed"], [[126541, 126541], "mapped", [1606]], [[126542, 126542], "mapped", [1587]], [[126543, 126543], "mapped", [1593]], [[126544, 126544], "disallowed"], [[126545, 126545], "mapped", [1589]], [[126546, 126546], "mapped", [1602]], [[126547, 126547], "disallowed"], [[126548, 126548], "mapped", [1588]], [[126549, 126550], "disallowed"], [[126551, 126551], "mapped", [1582]], [[126552, 126552], "disallowed"], [[126553, 126553], "mapped", [1590]], [[126554, 126554], "disallowed"], [[126555, 126555], "mapped", [1594]], [[126556, 126556], "disallowed"], [[126557, 126557], "mapped", [1722]], [[126558, 126558], "disallowed"], [[126559, 126559], "mapped", [1647]], [[126560, 126560], "disallowed"], [[126561, 126561], "mapped", [1576]], [[126562, 126562], "mapped", [1580]], [[126563, 126563], "disallowed"], [[126564, 126564], "mapped", [1607]], [[126565, 126566], "disallowed"], [[126567, 126567], "mapped", [1581]], [[126568, 126568], "mapped", [1591]], [[126569, 126569], "mapped", [1610]], [[126570, 126570], "mapped", [1603]], [[126571, 126571], "disallowed"], [[126572, 126572], "mapped", [1605]], [[126573, 126573], "mapped", [1606]], [[126574, 126574], "mapped", [1587]], [[126575, 126575], "mapped", [1593]], [[126576, 126576], "mapped", [1601]], [[126577, 126577], "mapped", [1589]], [[126578, 126578], "mapped", [1602]], [[126579, 126579], "disallowed"], [[126580, 126580], "mapped", [1588]], [[126581, 126581], "mapped", [1578]], [[126582, 126582], "mapped", [1579]], [[126583, 126583], "mapped", [1582]], [[126584, 126584], "disallowed"], [[126585, 126585], "mapped", [1590]], [[126586, 126586], "mapped", [1592]], [[126587, 126587], "mapped", [1594]], [[126588, 126588], "mapped", [1646]], [[126589, 126589], "disallowed"], [[126590, 126590], "mapped", [1697]], [[126591, 126591], "disallowed"], [[126592, 126592], "mapped", [1575]], [[126593, 126593], "mapped", [1576]], [[126594, 126594], "mapped", [1580]], [[126595, 126595], "mapped", [1583]], [[126596, 126596], "mapped", [1607]], [[126597, 126597], "mapped", [1608]], [[126598, 126598], "mapped", [1586]], [[126599, 126599], "mapped", [1581]], [[126600, 126600], "mapped", [1591]], [[126601, 126601], "mapped", [1610]], [[126602, 126602], "disallowed"], [[126603, 126603], "mapped", [1604]], [[126604, 126604], "mapped", [1605]], [[126605, 126605], "mapped", [1606]], [[126606, 126606], "mapped", [1587]], [[126607, 126607], "mapped", [1593]], [[126608, 126608], "mapped", [1601]], [[126609, 126609], "mapped", [1589]], [[126610, 126610], "mapped", [1602]], [[126611, 126611], "mapped", [1585]], [[126612, 126612], "mapped", [1588]], [[126613, 126613], "mapped", [1578]], [[126614, 126614], "mapped", [1579]], [[126615, 126615], "mapped", [1582]], [[126616, 126616], "mapped", [1584]], [[126617, 126617], "mapped", [1590]], [[126618, 126618], "mapped", [1592]], [[126619, 126619], "mapped", [1594]], [[126620, 126624], "disallowed"], [[126625, 126625], "mapped", [1576]], [[126626, 126626], "mapped", [1580]], [[126627, 126627], "mapped", [1583]], [[126628, 126628], "disallowed"], [[126629, 126629], "mapped", [1608]], [[126630, 126630], "mapped", [1586]], [[126631, 126631], "mapped", [1581]], [[126632, 126632], "mapped", [1591]], [[126633, 126633], "mapped", [1610]], [[126634, 126634], "disallowed"], [[126635, 126635], "mapped", [1604]], [[126636, 126636], "mapped", [1605]], [[126637, 126637], "mapped", [1606]], [[126638, 126638], "mapped", [1587]], [[126639, 126639], "mapped", [1593]], [[126640, 126640], "mapped", [1601]], [[126641, 126641], "mapped", [1589]], [[126642, 126642], "mapped", [1602]], [[126643, 126643], "mapped", [1585]], [[126644, 126644], "mapped", [1588]], [[126645, 126645], "mapped", [1578]], [[126646, 126646], "mapped", [1579]], [[126647, 126647], "mapped", [1582]], [[126648, 126648], "mapped", [1584]], [[126649, 126649], "mapped", [1590]], [[126650, 126650], "mapped", [1592]], [[126651, 126651], "mapped", [1594]], [[126652, 126703], "disallowed"], [[126704, 126705], "valid", [], "NV8"], [[126706, 126975], "disallowed"], [[126976, 127019], "valid", [], "NV8"], [[127020, 127023], "disallowed"], [[127024, 127123], "valid", [], "NV8"], [[127124, 127135], "disallowed"], [[127136, 127150], "valid", [], "NV8"], [[127151, 127152], "disallowed"], [[127153, 127166], "valid", [], "NV8"], [[127167, 127167], "valid", [], "NV8"], [[127168, 127168], "disallowed"], [[127169, 127183], "valid", [], "NV8"], [[127184, 127184], "disallowed"], [[127185, 127199], "valid", [], "NV8"], [[127200, 127221], "valid", [], "NV8"], [[127222, 127231], "disallowed"], [[127232, 127232], "disallowed"], [[127233, 127233], "disallowed_STD3_mapped", [48, 44]], [[127234, 127234], "disallowed_STD3_mapped", [49, 44]], [[127235, 127235], "disallowed_STD3_mapped", [50, 44]], [[127236, 127236], "disallowed_STD3_mapped", [51, 44]], [[127237, 127237], "disallowed_STD3_mapped", [52, 44]], [[127238, 127238], "disallowed_STD3_mapped", [53, 44]], [[127239, 127239], "disallowed_STD3_mapped", [54, 44]], [[127240, 127240], "disallowed_STD3_mapped", [55, 44]], [[127241, 127241], "disallowed_STD3_mapped", [56, 44]], [[127242, 127242], "disallowed_STD3_mapped", [57, 44]], [[127243, 127244], "valid", [], "NV8"], [[127245, 127247], "disallowed"], [[127248, 127248], "disallowed_STD3_mapped", [40, 97, 41]], [[127249, 127249], "disallowed_STD3_mapped", [40, 98, 41]], [[127250, 127250], "disallowed_STD3_mapped", [40, 99, 41]], [[127251, 127251], "disallowed_STD3_mapped", [40, 100, 41]], [[127252, 127252], "disallowed_STD3_mapped", [40, 101, 41]], [[127253, 127253], "disallowed_STD3_mapped", [40, 102, 41]], [[127254, 127254], "disallowed_STD3_mapped", [40, 103, 41]], [[127255, 127255], "disallowed_STD3_mapped", [40, 104, 41]], [[127256, 127256], "disallowed_STD3_mapped", [40, 105, 41]], [[127257, 127257], "disallowed_STD3_mapped", [40, 106, 41]], [[127258, 127258], "disallowed_STD3_mapped", [40, 107, 41]], [[127259, 127259], "disallowed_STD3_mapped", [40, 108, 41]], [[127260, 127260], "disallowed_STD3_mapped", [40, 109, 41]], [[127261, 127261], "disallowed_STD3_mapped", [40, 110, 41]], [[127262, 127262], "disallowed_STD3_mapped", [40, 111, 41]], [[127263, 127263], "disallowed_STD3_mapped", [40, 112, 41]], [[127264, 127264], "disallowed_STD3_mapped", [40, 113, 41]], [[127265, 127265], "disallowed_STD3_mapped", [40, 114, 41]], [[127266, 127266], "disallowed_STD3_mapped", [40, 115, 41]], [[127267, 127267], "disallowed_STD3_mapped", [40, 116, 41]], [[127268, 127268], "disallowed_STD3_mapped", [40, 117, 41]], [[127269, 127269], "disallowed_STD3_mapped", [40, 118, 41]], [[127270, 127270], "disallowed_STD3_mapped", [40, 119, 41]], [[127271, 127271], "disallowed_STD3_mapped", [40, 120, 41]], [[127272, 127272], "disallowed_STD3_mapped", [40, 121, 41]], [[127273, 127273], "disallowed_STD3_mapped", [40, 122, 41]], [[127274, 127274], "mapped", [12308, 115, 12309]], [[127275, 127275], "mapped", [99]], [[127276, 127276], "mapped", [114]], [[127277, 127277], "mapped", [99, 100]], [[127278, 127278], "mapped", [119, 122]], [[127279, 127279], "disallowed"], [[127280, 127280], "mapped", [97]], [[127281, 127281], "mapped", [98]], [[127282, 127282], "mapped", [99]], [[127283, 127283], "mapped", [100]], [[127284, 127284], "mapped", [101]], [[127285, 127285], "mapped", [102]], [[127286, 127286], "mapped", [103]], [[127287, 127287], "mapped", [104]], [[127288, 127288], "mapped", [105]], [[127289, 127289], "mapped", [106]], [[127290, 127290], "mapped", [107]], [[127291, 127291], "mapped", [108]], [[127292, 127292], "mapped", [109]], [[127293, 127293], "mapped", [110]], [[127294, 127294], "mapped", [111]], [[127295, 127295], "mapped", [112]], [[127296, 127296], "mapped", [113]], [[127297, 127297], "mapped", [114]], [[127298, 127298], "mapped", [115]], [[127299, 127299], "mapped", [116]], [[127300, 127300], "mapped", [117]], [[127301, 127301], "mapped", [118]], [[127302, 127302], "mapped", [119]], [[127303, 127303], "mapped", [120]], [[127304, 127304], "mapped", [121]], [[127305, 127305], "mapped", [122]], [[127306, 127306], "mapped", [104, 118]], [[127307, 127307], "mapped", [109, 118]], [[127308, 127308], "mapped", [115, 100]], [[127309, 127309], "mapped", [115, 115]], [[127310, 127310], "mapped", [112, 112, 118]], [[127311, 127311], "mapped", [119, 99]], [[127312, 127318], "valid", [], "NV8"], [[127319, 127319], "valid", [], "NV8"], [[127320, 127326], "valid", [], "NV8"], [[127327, 127327], "valid", [], "NV8"], [[127328, 127337], "valid", [], "NV8"], [[127338, 127338], "mapped", [109, 99]], [[127339, 127339], "mapped", [109, 100]], [[127340, 127343], "disallowed"], [[127344, 127352], "valid", [], "NV8"], [[127353, 127353], "valid", [], "NV8"], [[127354, 127354], "valid", [], "NV8"], [[127355, 127356], "valid", [], "NV8"], [[127357, 127358], "valid", [], "NV8"], [[127359, 127359], "valid", [], "NV8"], [[127360, 127369], "valid", [], "NV8"], [[127370, 127373], "valid", [], "NV8"], [[127374, 127375], "valid", [], "NV8"], [[127376, 127376], "mapped", [100, 106]], [[127377, 127386], "valid", [], "NV8"], [[127387, 127461], "disallowed"], [[127462, 127487], "valid", [], "NV8"], [[127488, 127488], "mapped", [12411, 12363]], [[127489, 127489], "mapped", [12467, 12467]], [[127490, 127490], "mapped", [12469]], [[127491, 127503], "disallowed"], [[127504, 127504], "mapped", [25163]], [[127505, 127505], "mapped", [23383]], [[127506, 127506], "mapped", [21452]], [[127507, 127507], "mapped", [12487]], [[127508, 127508], "mapped", [20108]], [[127509, 127509], "mapped", [22810]], [[127510, 127510], "mapped", [35299]], [[127511, 127511], "mapped", [22825]], [[127512, 127512], "mapped", [20132]], [[127513, 127513], "mapped", [26144]], [[127514, 127514], "mapped", [28961]], [[127515, 127515], "mapped", [26009]], [[127516, 127516], "mapped", [21069]], [[127517, 127517], "mapped", [24460]], [[127518, 127518], "mapped", [20877]], [[127519, 127519], "mapped", [26032]], [[127520, 127520], "mapped", [21021]], [[127521, 127521], "mapped", [32066]], [[127522, 127522], "mapped", [29983]], [[127523, 127523], "mapped", [36009]], [[127524, 127524], "mapped", [22768]], [[127525, 127525], "mapped", [21561]], [[127526, 127526], "mapped", [28436]], [[127527, 127527], "mapped", [25237]], [[127528, 127528], "mapped", [25429]], [[127529, 127529], "mapped", [19968]], [[127530, 127530], "mapped", [19977]], [[127531, 127531], "mapped", [36938]], [[127532, 127532], "mapped", [24038]], [[127533, 127533], "mapped", [20013]], [[127534, 127534], "mapped", [21491]], [[127535, 127535], "mapped", [25351]], [[127536, 127536], "mapped", [36208]], [[127537, 127537], "mapped", [25171]], [[127538, 127538], "mapped", [31105]], [[127539, 127539], "mapped", [31354]], [[127540, 127540], "mapped", [21512]], [[127541, 127541], "mapped", [28288]], [[127542, 127542], "mapped", [26377]], [[127543, 127543], "mapped", [26376]], [[127544, 127544], "mapped", [30003]], [[127545, 127545], "mapped", [21106]], [[127546, 127546], "mapped", [21942]], [[127547, 127551], "disallowed"], [[127552, 127552], "mapped", [12308, 26412, 12309]], [[127553, 127553], "mapped", [12308, 19977, 12309]], [[127554, 127554], "mapped", [12308, 20108, 12309]], [[127555, 127555], "mapped", [12308, 23433, 12309]], [[127556, 127556], "mapped", [12308, 28857, 12309]], [[127557, 127557], "mapped", [12308, 25171, 12309]], [[127558, 127558], "mapped", [12308, 30423, 12309]], [[127559, 127559], "mapped", [12308, 21213, 12309]], [[127560, 127560], "mapped", [12308, 25943, 12309]], [[127561, 127567], "disallowed"], [[127568, 127568], "mapped", [24471]], [[127569, 127569], "mapped", [21487]], [[127570, 127743], "disallowed"], [[127744, 127776], "valid", [], "NV8"], [[127777, 127788], "valid", [], "NV8"], [[127789, 127791], "valid", [], "NV8"], [[127792, 127797], "valid", [], "NV8"], [[127798, 127798], "valid", [], "NV8"], [[127799, 127868], "valid", [], "NV8"], [[127869, 127869], "valid", [], "NV8"], [[127870, 127871], "valid", [], "NV8"], [[127872, 127891], "valid", [], "NV8"], [[127892, 127903], "valid", [], "NV8"], [[127904, 127940], "valid", [], "NV8"], [[127941, 127941], "valid", [], "NV8"], [[127942, 127946], "valid", [], "NV8"], [[127947, 127950], "valid", [], "NV8"], [[127951, 127955], "valid", [], "NV8"], [[127956, 127967], "valid", [], "NV8"], [[127968, 127984], "valid", [], "NV8"], [[127985, 127991], "valid", [], "NV8"], [[127992, 127999], "valid", [], "NV8"], [[128e3, 128062], "valid", [], "NV8"], [[128063, 128063], "valid", [], "NV8"], [[128064, 128064], "valid", [], "NV8"], [[128065, 128065], "valid", [], "NV8"], [[128066, 128247], "valid", [], "NV8"], [[128248, 128248], "valid", [], "NV8"], [[128249, 128252], "valid", [], "NV8"], [[128253, 128254], "valid", [], "NV8"], [[128255, 128255], "valid", [], "NV8"], [[128256, 128317], "valid", [], "NV8"], [[128318, 128319], "valid", [], "NV8"], [[128320, 128323], "valid", [], "NV8"], [[128324, 128330], "valid", [], "NV8"], [[128331, 128335], "valid", [], "NV8"], [[128336, 128359], "valid", [], "NV8"], [[128360, 128377], "valid", [], "NV8"], [[128378, 128378], "disallowed"], [[128379, 128419], "valid", [], "NV8"], [[128420, 128420], "disallowed"], [[128421, 128506], "valid", [], "NV8"], [[128507, 128511], "valid", [], "NV8"], [[128512, 128512], "valid", [], "NV8"], [[128513, 128528], "valid", [], "NV8"], [[128529, 128529], "valid", [], "NV8"], [[128530, 128532], "valid", [], "NV8"], [[128533, 128533], "valid", [], "NV8"], [[128534, 128534], "valid", [], "NV8"], [[128535, 128535], "valid", [], "NV8"], [[128536, 128536], "valid", [], "NV8"], [[128537, 128537], "valid", [], "NV8"], [[128538, 128538], "valid", [], "NV8"], [[128539, 128539], "valid", [], "NV8"], [[128540, 128542], "valid", [], "NV8"], [[128543, 128543], "valid", [], "NV8"], [[128544, 128549], "valid", [], "NV8"], [[128550, 128551], "valid", [], "NV8"], [[128552, 128555], "valid", [], "NV8"], [[128556, 128556], "valid", [], "NV8"], [[128557, 128557], "valid", [], "NV8"], [[128558, 128559], "valid", [], "NV8"], [[128560, 128563], "valid", [], "NV8"], [[128564, 128564], "valid", [], "NV8"], [[128565, 128576], "valid", [], "NV8"], [[128577, 128578], "valid", [], "NV8"], [[128579, 128580], "valid", [], "NV8"], [[128581, 128591], "valid", [], "NV8"], [[128592, 128639], "valid", [], "NV8"], [[128640, 128709], "valid", [], "NV8"], [[128710, 128719], "valid", [], "NV8"], [[128720, 128720], "valid", [], "NV8"], [[128721, 128735], "disallowed"], [[128736, 128748], "valid", [], "NV8"], [[128749, 128751], "disallowed"], [[128752, 128755], "valid", [], "NV8"], [[128756, 128767], "disallowed"], [[128768, 128883], "valid", [], "NV8"], [[128884, 128895], "disallowed"], [[128896, 128980], "valid", [], "NV8"], [[128981, 129023], "disallowed"], [[129024, 129035], "valid", [], "NV8"], [[129036, 129039], "disallowed"], [[129040, 129095], "valid", [], "NV8"], [[129096, 129103], "disallowed"], [[129104, 129113], "valid", [], "NV8"], [[129114, 129119], "disallowed"], [[129120, 129159], "valid", [], "NV8"], [[129160, 129167], "disallowed"], [[129168, 129197], "valid", [], "NV8"], [[129198, 129295], "disallowed"], [[129296, 129304], "valid", [], "NV8"], [[129305, 129407], "disallowed"], [[129408, 129412], "valid", [], "NV8"], [[129413, 129471], "disallowed"], [[129472, 129472], "valid", [], "NV8"], [[129473, 131069], "disallowed"], [[131070, 131071], "disallowed"], [[131072, 173782], "valid"], [[173783, 173823], "disallowed"], [[173824, 177972], "valid"], [[177973, 177983], "disallowed"], [[177984, 178205], "valid"], [[178206, 178207], "disallowed"], [[178208, 183969], "valid"], [[183970, 194559], "disallowed"], [[194560, 194560], "mapped", [20029]], [[194561, 194561], "mapped", [20024]], [[194562, 194562], "mapped", [20033]], [[194563, 194563], "mapped", [131362]], [[194564, 194564], "mapped", [20320]], [[194565, 194565], "mapped", [20398]], [[194566, 194566], "mapped", [20411]], [[194567, 194567], "mapped", [20482]], [[194568, 194568], "mapped", [20602]], [[194569, 194569], "mapped", [20633]], [[194570, 194570], "mapped", [20711]], [[194571, 194571], "mapped", [20687]], [[194572, 194572], "mapped", [13470]], [[194573, 194573], "mapped", [132666]], [[194574, 194574], "mapped", [20813]], [[194575, 194575], "mapped", [20820]], [[194576, 194576], "mapped", [20836]], [[194577, 194577], "mapped", [20855]], [[194578, 194578], "mapped", [132380]], [[194579, 194579], "mapped", [13497]], [[194580, 194580], "mapped", [20839]], [[194581, 194581], "mapped", [20877]], [[194582, 194582], "mapped", [132427]], [[194583, 194583], "mapped", [20887]], [[194584, 194584], "mapped", [20900]], [[194585, 194585], "mapped", [20172]], [[194586, 194586], "mapped", [20908]], [[194587, 194587], "mapped", [20917]], [[194588, 194588], "mapped", [168415]], [[194589, 194589], "mapped", [20981]], [[194590, 194590], "mapped", [20995]], [[194591, 194591], "mapped", [13535]], [[194592, 194592], "mapped", [21051]], [[194593, 194593], "mapped", [21062]], [[194594, 194594], "mapped", [21106]], [[194595, 194595], "mapped", [21111]], [[194596, 194596], "mapped", [13589]], [[194597, 194597], "mapped", [21191]], [[194598, 194598], "mapped", [21193]], [[194599, 194599], "mapped", [21220]], [[194600, 194600], "mapped", [21242]], [[194601, 194601], "mapped", [21253]], [[194602, 194602], "mapped", [21254]], [[194603, 194603], "mapped", [21271]], [[194604, 194604], "mapped", [21321]], [[194605, 194605], "mapped", [21329]], [[194606, 194606], "mapped", [21338]], [[194607, 194607], "mapped", [21363]], [[194608, 194608], "mapped", [21373]], [[194609, 194611], "mapped", [21375]], [[194612, 194612], "mapped", [133676]], [[194613, 194613], "mapped", [28784]], [[194614, 194614], "mapped", [21450]], [[194615, 194615], "mapped", [21471]], [[194616, 194616], "mapped", [133987]], [[194617, 194617], "mapped", [21483]], [[194618, 194618], "mapped", [21489]], [[194619, 194619], "mapped", [21510]], [[194620, 194620], "mapped", [21662]], [[194621, 194621], "mapped", [21560]], [[194622, 194622], "mapped", [21576]], [[194623, 194623], "mapped", [21608]], [[194624, 194624], "mapped", [21666]], [[194625, 194625], "mapped", [21750]], [[194626, 194626], "mapped", [21776]], [[194627, 194627], "mapped", [21843]], [[194628, 194628], "mapped", [21859]], [[194629, 194630], "mapped", [21892]], [[194631, 194631], "mapped", [21913]], [[194632, 194632], "mapped", [21931]], [[194633, 194633], "mapped", [21939]], [[194634, 194634], "mapped", [21954]], [[194635, 194635], "mapped", [22294]], [[194636, 194636], "mapped", [22022]], [[194637, 194637], "mapped", [22295]], [[194638, 194638], "mapped", [22097]], [[194639, 194639], "mapped", [22132]], [[194640, 194640], "mapped", [20999]], [[194641, 194641], "mapped", [22766]], [[194642, 194642], "mapped", [22478]], [[194643, 194643], "mapped", [22516]], [[194644, 194644], "mapped", [22541]], [[194645, 194645], "mapped", [22411]], [[194646, 194646], "mapped", [22578]], [[194647, 194647], "mapped", [22577]], [[194648, 194648], "mapped", [22700]], [[194649, 194649], "mapped", [136420]], [[194650, 194650], "mapped", [22770]], [[194651, 194651], "mapped", [22775]], [[194652, 194652], "mapped", [22790]], [[194653, 194653], "mapped", [22810]], [[194654, 194654], "mapped", [22818]], [[194655, 194655], "mapped", [22882]], [[194656, 194656], "mapped", [136872]], [[194657, 194657], "mapped", [136938]], [[194658, 194658], "mapped", [23020]], [[194659, 194659], "mapped", [23067]], [[194660, 194660], "mapped", [23079]], [[194661, 194661], "mapped", [23e3]], [[194662, 194662], "mapped", [23142]], [[194663, 194663], "mapped", [14062]], [[194664, 194664], "disallowed"], [[194665, 194665], "mapped", [23304]], [[194666, 194667], "mapped", [23358]], [[194668, 194668], "mapped", [137672]], [[194669, 194669], "mapped", [23491]], [[194670, 194670], "mapped", [23512]], [[194671, 194671], "mapped", [23527]], [[194672, 194672], "mapped", [23539]], [[194673, 194673], "mapped", [138008]], [[194674, 194674], "mapped", [23551]], [[194675, 194675], "mapped", [23558]], [[194676, 194676], "disallowed"], [[194677, 194677], "mapped", [23586]], [[194678, 194678], "mapped", [14209]], [[194679, 194679], "mapped", [23648]], [[194680, 194680], "mapped", [23662]], [[194681, 194681], "mapped", [23744]], [[194682, 194682], "mapped", [23693]], [[194683, 194683], "mapped", [138724]], [[194684, 194684], "mapped", [23875]], [[194685, 194685], "mapped", [138726]], [[194686, 194686], "mapped", [23918]], [[194687, 194687], "mapped", [23915]], [[194688, 194688], "mapped", [23932]], [[194689, 194689], "mapped", [24033]], [[194690, 194690], "mapped", [24034]], [[194691, 194691], "mapped", [14383]], [[194692, 194692], "mapped", [24061]], [[194693, 194693], "mapped", [24104]], [[194694, 194694], "mapped", [24125]], [[194695, 194695], "mapped", [24169]], [[194696, 194696], "mapped", [14434]], [[194697, 194697], "mapped", [139651]], [[194698, 194698], "mapped", [14460]], [[194699, 194699], "mapped", [24240]], [[194700, 194700], "mapped", [24243]], [[194701, 194701], "mapped", [24246]], [[194702, 194702], "mapped", [24266]], [[194703, 194703], "mapped", [172946]], [[194704, 194704], "mapped", [24318]], [[194705, 194706], "mapped", [140081]], [[194707, 194707], "mapped", [33281]], [[194708, 194709], "mapped", [24354]], [[194710, 194710], "mapped", [14535]], [[194711, 194711], "mapped", [144056]], [[194712, 194712], "mapped", [156122]], [[194713, 194713], "mapped", [24418]], [[194714, 194714], "mapped", [24427]], [[194715, 194715], "mapped", [14563]], [[194716, 194716], "mapped", [24474]], [[194717, 194717], "mapped", [24525]], [[194718, 194718], "mapped", [24535]], [[194719, 194719], "mapped", [24569]], [[194720, 194720], "mapped", [24705]], [[194721, 194721], "mapped", [14650]], [[194722, 194722], "mapped", [14620]], [[194723, 194723], "mapped", [24724]], [[194724, 194724], "mapped", [141012]], [[194725, 194725], "mapped", [24775]], [[194726, 194726], "mapped", [24904]], [[194727, 194727], "mapped", [24908]], [[194728, 194728], "mapped", [24910]], [[194729, 194729], "mapped", [24908]], [[194730, 194730], "mapped", [24954]], [[194731, 194731], "mapped", [24974]], [[194732, 194732], "mapped", [25010]], [[194733, 194733], "mapped", [24996]], [[194734, 194734], "mapped", [25007]], [[194735, 194735], "mapped", [25054]], [[194736, 194736], "mapped", [25074]], [[194737, 194737], "mapped", [25078]], [[194738, 194738], "mapped", [25104]], [[194739, 194739], "mapped", [25115]], [[194740, 194740], "mapped", [25181]], [[194741, 194741], "mapped", [25265]], [[194742, 194742], "mapped", [25300]], [[194743, 194743], "mapped", [25424]], [[194744, 194744], "mapped", [142092]], [[194745, 194745], "mapped", [25405]], [[194746, 194746], "mapped", [25340]], [[194747, 194747], "mapped", [25448]], [[194748, 194748], "mapped", [25475]], [[194749, 194749], "mapped", [25572]], [[194750, 194750], "mapped", [142321]], [[194751, 194751], "mapped", [25634]], [[194752, 194752], "mapped", [25541]], [[194753, 194753], "mapped", [25513]], [[194754, 194754], "mapped", [14894]], [[194755, 194755], "mapped", [25705]], [[194756, 194756], "mapped", [25726]], [[194757, 194757], "mapped", [25757]], [[194758, 194758], "mapped", [25719]], [[194759, 194759], "mapped", [14956]], [[194760, 194760], "mapped", [25935]], [[194761, 194761], "mapped", [25964]], [[194762, 194762], "mapped", [143370]], [[194763, 194763], "mapped", [26083]], [[194764, 194764], "mapped", [26360]], [[194765, 194765], "mapped", [26185]], [[194766, 194766], "mapped", [15129]], [[194767, 194767], "mapped", [26257]], [[194768, 194768], "mapped", [15112]], [[194769, 194769], "mapped", [15076]], [[194770, 194770], "mapped", [20882]], [[194771, 194771], "mapped", [20885]], [[194772, 194772], "mapped", [26368]], [[194773, 194773], "mapped", [26268]], [[194774, 194774], "mapped", [32941]], [[194775, 194775], "mapped", [17369]], [[194776, 194776], "mapped", [26391]], [[194777, 194777], "mapped", [26395]], [[194778, 194778], "mapped", [26401]], [[194779, 194779], "mapped", [26462]], [[194780, 194780], "mapped", [26451]], [[194781, 194781], "mapped", [144323]], [[194782, 194782], "mapped", [15177]], [[194783, 194783], "mapped", [26618]], [[194784, 194784], "mapped", [26501]], [[194785, 194785], "mapped", [26706]], [[194786, 194786], "mapped", [26757]], [[194787, 194787], "mapped", [144493]], [[194788, 194788], "mapped", [26766]], [[194789, 194789], "mapped", [26655]], [[194790, 194790], "mapped", [26900]], [[194791, 194791], "mapped", [15261]], [[194792, 194792], "mapped", [26946]], [[194793, 194793], "mapped", [27043]], [[194794, 194794], "mapped", [27114]], [[194795, 194795], "mapped", [27304]], [[194796, 194796], "mapped", [145059]], [[194797, 194797], "mapped", [27355]], [[194798, 194798], "mapped", [15384]], [[194799, 194799], "mapped", [27425]], [[194800, 194800], "mapped", [145575]], [[194801, 194801], "mapped", [27476]], [[194802, 194802], "mapped", [15438]], [[194803, 194803], "mapped", [27506]], [[194804, 194804], "mapped", [27551]], [[194805, 194805], "mapped", [27578]], [[194806, 194806], "mapped", [27579]], [[194807, 194807], "mapped", [146061]], [[194808, 194808], "mapped", [138507]], [[194809, 194809], "mapped", [146170]], [[194810, 194810], "mapped", [27726]], [[194811, 194811], "mapped", [146620]], [[194812, 194812], "mapped", [27839]], [[194813, 194813], "mapped", [27853]], [[194814, 194814], "mapped", [27751]], [[194815, 194815], "mapped", [27926]], [[194816, 194816], "mapped", [27966]], [[194817, 194817], "mapped", [28023]], [[194818, 194818], "mapped", [27969]], [[194819, 194819], "mapped", [28009]], [[194820, 194820], "mapped", [28024]], [[194821, 194821], "mapped", [28037]], [[194822, 194822], "mapped", [146718]], [[194823, 194823], "mapped", [27956]], [[194824, 194824], "mapped", [28207]], [[194825, 194825], "mapped", [28270]], [[194826, 194826], "mapped", [15667]], [[194827, 194827], "mapped", [28363]], [[194828, 194828], "mapped", [28359]], [[194829, 194829], "mapped", [147153]], [[194830, 194830], "mapped", [28153]], [[194831, 194831], "mapped", [28526]], [[194832, 194832], "mapped", [147294]], [[194833, 194833], "mapped", [147342]], [[194834, 194834], "mapped", [28614]], [[194835, 194835], "mapped", [28729]], [[194836, 194836], "mapped", [28702]], [[194837, 194837], "mapped", [28699]], [[194838, 194838], "mapped", [15766]], [[194839, 194839], "mapped", [28746]], [[194840, 194840], "mapped", [28797]], [[194841, 194841], "mapped", [28791]], [[194842, 194842], "mapped", [28845]], [[194843, 194843], "mapped", [132389]], [[194844, 194844], "mapped", [28997]], [[194845, 194845], "mapped", [148067]], [[194846, 194846], "mapped", [29084]], [[194847, 194847], "disallowed"], [[194848, 194848], "mapped", [29224]], [[194849, 194849], "mapped", [29237]], [[194850, 194850], "mapped", [29264]], [[194851, 194851], "mapped", [149e3]], [[194852, 194852], "mapped", [29312]], [[194853, 194853], "mapped", [29333]], [[194854, 194854], "mapped", [149301]], [[194855, 194855], "mapped", [149524]], [[194856, 194856], "mapped", [29562]], [[194857, 194857], "mapped", [29579]], [[194858, 194858], "mapped", [16044]], [[194859, 194859], "mapped", [29605]], [[194860, 194861], "mapped", [16056]], [[194862, 194862], "mapped", [29767]], [[194863, 194863], "mapped", [29788]], [[194864, 194864], "mapped", [29809]], [[194865, 194865], "mapped", [29829]], [[194866, 194866], "mapped", [29898]], [[194867, 194867], "mapped", [16155]], [[194868, 194868], "mapped", [29988]], [[194869, 194869], "mapped", [150582]], [[194870, 194870], "mapped", [30014]], [[194871, 194871], "mapped", [150674]], [[194872, 194872], "mapped", [30064]], [[194873, 194873], "mapped", [139679]], [[194874, 194874], "mapped", [30224]], [[194875, 194875], "mapped", [151457]], [[194876, 194876], "mapped", [151480]], [[194877, 194877], "mapped", [151620]], [[194878, 194878], "mapped", [16380]], [[194879, 194879], "mapped", [16392]], [[194880, 194880], "mapped", [30452]], [[194881, 194881], "mapped", [151795]], [[194882, 194882], "mapped", [151794]], [[194883, 194883], "mapped", [151833]], [[194884, 194884], "mapped", [151859]], [[194885, 194885], "mapped", [30494]], [[194886, 194887], "mapped", [30495]], [[194888, 194888], "mapped", [30538]], [[194889, 194889], "mapped", [16441]], [[194890, 194890], "mapped", [30603]], [[194891, 194891], "mapped", [16454]], [[194892, 194892], "mapped", [16534]], [[194893, 194893], "mapped", [152605]], [[194894, 194894], "mapped", [30798]], [[194895, 194895], "mapped", [30860]], [[194896, 194896], "mapped", [30924]], [[194897, 194897], "mapped", [16611]], [[194898, 194898], "mapped", [153126]], [[194899, 194899], "mapped", [31062]], [[194900, 194900], "mapped", [153242]], [[194901, 194901], "mapped", [153285]], [[194902, 194902], "mapped", [31119]], [[194903, 194903], "mapped", [31211]], [[194904, 194904], "mapped", [16687]], [[194905, 194905], "mapped", [31296]], [[194906, 194906], "mapped", [31306]], [[194907, 194907], "mapped", [31311]], [[194908, 194908], "mapped", [153980]], [[194909, 194910], "mapped", [154279]], [[194911, 194911], "disallowed"], [[194912, 194912], "mapped", [16898]], [[194913, 194913], "mapped", [154539]], [[194914, 194914], "mapped", [31686]], [[194915, 194915], "mapped", [31689]], [[194916, 194916], "mapped", [16935]], [[194917, 194917], "mapped", [154752]], [[194918, 194918], "mapped", [31954]], [[194919, 194919], "mapped", [17056]], [[194920, 194920], "mapped", [31976]], [[194921, 194921], "mapped", [31971]], [[194922, 194922], "mapped", [32e3]], [[194923, 194923], "mapped", [155526]], [[194924, 194924], "mapped", [32099]], [[194925, 194925], "mapped", [17153]], [[194926, 194926], "mapped", [32199]], [[194927, 194927], "mapped", [32258]], [[194928, 194928], "mapped", [32325]], [[194929, 194929], "mapped", [17204]], [[194930, 194930], "mapped", [156200]], [[194931, 194931], "mapped", [156231]], [[194932, 194932], "mapped", [17241]], [[194933, 194933], "mapped", [156377]], [[194934, 194934], "mapped", [32634]], [[194935, 194935], "mapped", [156478]], [[194936, 194936], "mapped", [32661]], [[194937, 194937], "mapped", [32762]], [[194938, 194938], "mapped", [32773]], [[194939, 194939], "mapped", [156890]], [[194940, 194940], "mapped", [156963]], [[194941, 194941], "mapped", [32864]], [[194942, 194942], "mapped", [157096]], [[194943, 194943], "mapped", [32880]], [[194944, 194944], "mapped", [144223]], [[194945, 194945], "mapped", [17365]], [[194946, 194946], "mapped", [32946]], [[194947, 194947], "mapped", [33027]], [[194948, 194948], "mapped", [17419]], [[194949, 194949], "mapped", [33086]], [[194950, 194950], "mapped", [23221]], [[194951, 194951], "mapped", [157607]], [[194952, 194952], "mapped", [157621]], [[194953, 194953], "mapped", [144275]], [[194954, 194954], "mapped", [144284]], [[194955, 194955], "mapped", [33281]], [[194956, 194956], "mapped", [33284]], [[194957, 194957], "mapped", [36766]], [[194958, 194958], "mapped", [17515]], [[194959, 194959], "mapped", [33425]], [[194960, 194960], "mapped", [33419]], [[194961, 194961], "mapped", [33437]], [[194962, 194962], "mapped", [21171]], [[194963, 194963], "mapped", [33457]], [[194964, 194964], "mapped", [33459]], [[194965, 194965], "mapped", [33469]], [[194966, 194966], "mapped", [33510]], [[194967, 194967], "mapped", [158524]], [[194968, 194968], "mapped", [33509]], [[194969, 194969], "mapped", [33565]], [[194970, 194970], "mapped", [33635]], [[194971, 194971], "mapped", [33709]], [[194972, 194972], "mapped", [33571]], [[194973, 194973], "mapped", [33725]], [[194974, 194974], "mapped", [33767]], [[194975, 194975], "mapped", [33879]], [[194976, 194976], "mapped", [33619]], [[194977, 194977], "mapped", [33738]], [[194978, 194978], "mapped", [33740]], [[194979, 194979], "mapped", [33756]], [[194980, 194980], "mapped", [158774]], [[194981, 194981], "mapped", [159083]], [[194982, 194982], "mapped", [158933]], [[194983, 194983], "mapped", [17707]], [[194984, 194984], "mapped", [34033]], [[194985, 194985], "mapped", [34035]], [[194986, 194986], "mapped", [34070]], [[194987, 194987], "mapped", [160714]], [[194988, 194988], "mapped", [34148]], [[194989, 194989], "mapped", [159532]], [[194990, 194990], "mapped", [17757]], [[194991, 194991], "mapped", [17761]], [[194992, 194992], "mapped", [159665]], [[194993, 194993], "mapped", [159954]], [[194994, 194994], "mapped", [17771]], [[194995, 194995], "mapped", [34384]], [[194996, 194996], "mapped", [34396]], [[194997, 194997], "mapped", [34407]], [[194998, 194998], "mapped", [34409]], [[194999, 194999], "mapped", [34473]], [[195e3, 195e3], "mapped", [34440]], [[195001, 195001], "mapped", [34574]], [[195002, 195002], "mapped", [34530]], [[195003, 195003], "mapped", [34681]], [[195004, 195004], "mapped", [34600]], [[195005, 195005], "mapped", [34667]], [[195006, 195006], "mapped", [34694]], [[195007, 195007], "disallowed"], [[195008, 195008], "mapped", [34785]], [[195009, 195009], "mapped", [34817]], [[195010, 195010], "mapped", [17913]], [[195011, 195011], "mapped", [34912]], [[195012, 195012], "mapped", [34915]], [[195013, 195013], "mapped", [161383]], [[195014, 195014], "mapped", [35031]], [[195015, 195015], "mapped", [35038]], [[195016, 195016], "mapped", [17973]], [[195017, 195017], "mapped", [35066]], [[195018, 195018], "mapped", [13499]], [[195019, 195019], "mapped", [161966]], [[195020, 195020], "mapped", [162150]], [[195021, 195021], "mapped", [18110]], [[195022, 195022], "mapped", [18119]], [[195023, 195023], "mapped", [35488]], [[195024, 195024], "mapped", [35565]], [[195025, 195025], "mapped", [35722]], [[195026, 195026], "mapped", [35925]], [[195027, 195027], "mapped", [162984]], [[195028, 195028], "mapped", [36011]], [[195029, 195029], "mapped", [36033]], [[195030, 195030], "mapped", [36123]], [[195031, 195031], "mapped", [36215]], [[195032, 195032], "mapped", [163631]], [[195033, 195033], "mapped", [133124]], [[195034, 195034], "mapped", [36299]], [[195035, 195035], "mapped", [36284]], [[195036, 195036], "mapped", [36336]], [[195037, 195037], "mapped", [133342]], [[195038, 195038], "mapped", [36564]], [[195039, 195039], "mapped", [36664]], [[195040, 195040], "mapped", [165330]], [[195041, 195041], "mapped", [165357]], [[195042, 195042], "mapped", [37012]], [[195043, 195043], "mapped", [37105]], [[195044, 195044], "mapped", [37137]], [[195045, 195045], "mapped", [165678]], [[195046, 195046], "mapped", [37147]], [[195047, 195047], "mapped", [37432]], [[195048, 195048], "mapped", [37591]], [[195049, 195049], "mapped", [37592]], [[195050, 195050], "mapped", [37500]], [[195051, 195051], "mapped", [37881]], [[195052, 195052], "mapped", [37909]], [[195053, 195053], "mapped", [166906]], [[195054, 195054], "mapped", [38283]], [[195055, 195055], "mapped", [18837]], [[195056, 195056], "mapped", [38327]], [[195057, 195057], "mapped", [167287]], [[195058, 195058], "mapped", [18918]], [[195059, 195059], "mapped", [38595]], [[195060, 195060], "mapped", [23986]], [[195061, 195061], "mapped", [38691]], [[195062, 195062], "mapped", [168261]], [[195063, 195063], "mapped", [168474]], [[195064, 195064], "mapped", [19054]], [[195065, 195065], "mapped", [19062]], [[195066, 195066], "mapped", [38880]], [[195067, 195067], "mapped", [168970]], [[195068, 195068], "mapped", [19122]], [[195069, 195069], "mapped", [169110]], [[195070, 195071], "mapped", [38923]], [[195072, 195072], "mapped", [38953]], [[195073, 195073], "mapped", [169398]], [[195074, 195074], "mapped", [39138]], [[195075, 195075], "mapped", [19251]], [[195076, 195076], "mapped", [39209]], [[195077, 195077], "mapped", [39335]], [[195078, 195078], "mapped", [39362]], [[195079, 195079], "mapped", [39422]], [[195080, 195080], "mapped", [19406]], [[195081, 195081], "mapped", [170800]], [[195082, 195082], "mapped", [39698]], [[195083, 195083], "mapped", [4e4]], [[195084, 195084], "mapped", [40189]], [[195085, 195085], "mapped", [19662]], [[195086, 195086], "mapped", [19693]], [[195087, 195087], "mapped", [40295]], [[195088, 195088], "mapped", [172238]], [[195089, 195089], "mapped", [19704]], [[195090, 195090], "mapped", [172293]], [[195091, 195091], "mapped", [172558]], [[195092, 195092], "mapped", [172689]], [[195093, 195093], "mapped", [40635]], [[195094, 195094], "mapped", [19798]], [[195095, 195095], "mapped", [40697]], [[195096, 195096], "mapped", [40702]], [[195097, 195097], "mapped", [40709]], [[195098, 195098], "mapped", [40719]], [[195099, 195099], "mapped", [40726]], [[195100, 195100], "mapped", [40763]], [[195101, 195101], "mapped", [173568]], [[195102, 196605], "disallowed"], [[196606, 196607], "disallowed"], [[196608, 262141], "disallowed"], [[262142, 262143], "disallowed"], [[262144, 327677], "disallowed"], [[327678, 327679], "disallowed"], [[327680, 393213], "disallowed"], [[393214, 393215], "disallowed"], [[393216, 458749], "disallowed"], [[458750, 458751], "disallowed"], [[458752, 524285], "disallowed"], [[524286, 524287], "disallowed"], [[524288, 589821], "disallowed"], [[589822, 589823], "disallowed"], [[589824, 655357], "disallowed"], [[655358, 655359], "disallowed"], [[655360, 720893], "disallowed"], [[720894, 720895], "disallowed"], [[720896, 786429], "disallowed"], [[786430, 786431], "disallowed"], [[786432, 851965], "disallowed"], [[851966, 851967], "disallowed"], [[851968, 917501], "disallowed"], [[917502, 917503], "disallowed"], [[917504, 917504], "disallowed"], [[917505, 917505], "disallowed"], [[917506, 917535], "disallowed"], [[917536, 917631], "disallowed"], [[917632, 917759], "disallowed"], [[917760, 917999], "ignored"], [[918e3, 983037], "disallowed"], [[983038, 983039], "disallowed"], [[983040, 1048573], "disallowed"], [[1048574, 1048575], "disallowed"], [[1048576, 1114109], "disallowed"], [[1114110, 1114111], "disallowed"]];
  }
});

// ../../node_modules/.pnpm/tr46@0.0.3/node_modules/tr46/index.js
var require_tr46 = __commonJS({
  "../../node_modules/.pnpm/tr46@0.0.3/node_modules/tr46/index.js"(exports, module2) {
    init_import_meta_url();
    var punycode = __require("punycode");
    var mappingTable = require_mappingTable();
    var PROCESSING_OPTIONS = {
      TRANSITIONAL: 0,
      NONTRANSITIONAL: 1
    };
    function normalize6(str) {
      return str.split("\0").map(function(s7) {
        return s7.normalize("NFC");
      }).join("\0");
    }
    __name(normalize6, "normalize");
    function findStatus(val2) {
      var start = 0;
      var end = mappingTable.length - 1;
      while (start <= end) {
        var mid = Math.floor((start + end) / 2);
        var target = mappingTable[mid];
        if (target[0][0] <= val2 && target[0][1] >= val2) {
          return target;
        } else if (target[0][0] > val2) {
          end = mid - 1;
        } else {
          start = mid + 1;
        }
      }
      return null;
    }
    __name(findStatus, "findStatus");
    var regexAstralSymbols = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
    function countSymbols(string) {
      return string.replace(regexAstralSymbols, "_").length;
    }
    __name(countSymbols, "countSymbols");
    function mapChars(domain_name, useSTD3, processing_option) {
      var hasError = false;
      var processed = "";
      var len = countSymbols(domain_name);
      for (var i7 = 0; i7 < len; ++i7) {
        var codePoint = domain_name.codePointAt(i7);
        var status2 = findStatus(codePoint);
        switch (status2[1]) {
          case "disallowed":
            hasError = true;
            processed += String.fromCodePoint(codePoint);
            break;
          case "ignored":
            break;
          case "mapped":
            processed += String.fromCodePoint.apply(String, status2[2]);
            break;
          case "deviation":
            if (processing_option === PROCESSING_OPTIONS.TRANSITIONAL) {
              processed += String.fromCodePoint.apply(String, status2[2]);
            } else {
              processed += String.fromCodePoint(codePoint);
            }
            break;
          case "valid":
            processed += String.fromCodePoint(codePoint);
            break;
          case "disallowed_STD3_mapped":
            if (useSTD3) {
              hasError = true;
              processed += String.fromCodePoint(codePoint);
            } else {
              processed += String.fromCodePoint.apply(String, status2[2]);
            }
            break;
          case "disallowed_STD3_valid":
            if (useSTD3) {
              hasError = true;
            }
            processed += String.fromCodePoint(codePoint);
            break;
        }
      }
      return {
        string: processed,
        error: hasError
      };
    }
    __name(mapChars, "mapChars");
    var combiningMarksRegex = /[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08E4-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u18A9\u1920-\u192B\u1930-\u193B\u19B0-\u19C0\u19C8\u19C9\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFC-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C4\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2D]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC7F-\uDC82\uDCB0-\uDCBA\uDD00-\uDD02\uDD27-\uDD34\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDE2C-\uDE37\uDEDF-\uDEEA\uDF01-\uDF03\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDE30-\uDE40\uDEAB-\uDEB7]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF51-\uDF7E\uDF8F-\uDF92]|\uD82F[\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD83A[\uDCD0-\uDCD6]|\uDB40[\uDD00-\uDDEF]/;
    function validateLabel(label, processing_option) {
      if (label.substr(0, 4) === "xn--") {
        label = punycode.toUnicode(label);
        PROCESSING_OPTIONS.NONTRANSITIONAL;
      }
      var error2 = false;
      if (normalize6(label) !== label || label[3] === "-" && label[4] === "-" || label[0] === "-" || label[label.length - 1] === "-" || label.indexOf(".") !== -1 || label.search(combiningMarksRegex) === 0) {
        error2 = true;
      }
      var len = countSymbols(label);
      for (var i7 = 0; i7 < len; ++i7) {
        var status2 = findStatus(label.codePointAt(i7));
        if (processing === PROCESSING_OPTIONS.TRANSITIONAL && status2[1] !== "valid" || processing === PROCESSING_OPTIONS.NONTRANSITIONAL && status2[1] !== "valid" && status2[1] !== "deviation") {
          error2 = true;
          break;
        }
      }
      return {
        label,
        error: error2
      };
    }
    __name(validateLabel, "validateLabel");
    function processing(domain_name, useSTD3, processing_option) {
      var result = mapChars(domain_name, useSTD3, processing_option);
      result.string = normalize6(result.string);
      var labels = result.string.split(".");
      for (var i7 = 0; i7 < labels.length; ++i7) {
        try {
          var validation2 = validateLabel(labels[i7]);
          labels[i7] = validation2.label;
          result.error = result.error || validation2.error;
        } catch (e10) {
          result.error = true;
        }
      }
      return {
        string: labels.join("."),
        error: result.error
      };
    }
    __name(processing, "processing");
    module2.exports.toASCII = function(domain_name, useSTD3, processing_option, verifyDnsLength) {
      var result = processing(domain_name, useSTD3, processing_option);
      var labels = result.string.split(".");
      labels = labels.map(function(l8) {
        try {
          return punycode.toASCII(l8);
        } catch (e10) {
          result.error = true;
          return l8;
        }
      });
      if (verifyDnsLength) {
        var total = labels.slice(0, labels.length - 1).join(".").length;
        if (total.length > 253 || total.length === 0) {
          result.error = true;
        }
        for (var i7 = 0; i7 < labels.length; ++i7) {
          if (labels.length > 63 || labels.length === 0) {
            result.error = true;
            break;
          }
        }
      }
      if (result.error) return null;
      return labels.join(".");
    };
    module2.exports.toUnicode = function(domain_name, useSTD3) {
      var result = processing(domain_name, useSTD3, PROCESSING_OPTIONS.NONTRANSITIONAL);
      return {
        domain: result.string,
        error: result.error
      };
    };
    module2.exports.PROCESSING_OPTIONS = PROCESSING_OPTIONS;
  }
});

// ../../node_modules/.pnpm/whatwg-url@5.0.0/node_modules/whatwg-url/lib/url-state-machine.js
var require_url_state_machine = __commonJS({
  "../../node_modules/.pnpm/whatwg-url@5.0.0/node_modules/whatwg-url/lib/url-state-machine.js"(exports, module2) {
    init_import_meta_url();
    var punycode = __require("punycode");
    var tr46 = require_tr46();
    var specialSchemes = {
      ftp: 21,
      file: null,
      gopher: 70,
      http: 80,
      https: 443,
      ws: 80,
      wss: 443
    };
    var failure = Symbol("failure");
    function countSymbols(str) {
      return punycode.ucs2.decode(str).length;
    }
    __name(countSymbols, "countSymbols");
    function at3(input, idx) {
      const c8 = input[idx];
      return isNaN(c8) ? void 0 : String.fromCodePoint(c8);
    }
    __name(at3, "at");
    function isASCIIDigit(c8) {
      return c8 >= 48 && c8 <= 57;
    }
    __name(isASCIIDigit, "isASCIIDigit");
    function isASCIIAlpha(c8) {
      return c8 >= 65 && c8 <= 90 || c8 >= 97 && c8 <= 122;
    }
    __name(isASCIIAlpha, "isASCIIAlpha");
    function isASCIIAlphanumeric(c8) {
      return isASCIIAlpha(c8) || isASCIIDigit(c8);
    }
    __name(isASCIIAlphanumeric, "isASCIIAlphanumeric");
    function isASCIIHex(c8) {
      return isASCIIDigit(c8) || c8 >= 65 && c8 <= 70 || c8 >= 97 && c8 <= 102;
    }
    __name(isASCIIHex, "isASCIIHex");
    function isSingleDot(buffer) {
      return buffer === "." || buffer.toLowerCase() === "%2e";
    }
    __name(isSingleDot, "isSingleDot");
    function isDoubleDot(buffer) {
      buffer = buffer.toLowerCase();
      return buffer === ".." || buffer === "%2e." || buffer === ".%2e" || buffer === "%2e%2e";
    }
    __name(isDoubleDot, "isDoubleDot");
    function isWindowsDriveLetterCodePoints(cp1, cp22) {
      return isASCIIAlpha(cp1) && (cp22 === 58 || cp22 === 124);
    }
    __name(isWindowsDriveLetterCodePoints, "isWindowsDriveLetterCodePoints");
    function isWindowsDriveLetterString(string) {
      return string.length === 2 && isASCIIAlpha(string.codePointAt(0)) && (string[1] === ":" || string[1] === "|");
    }
    __name(isWindowsDriveLetterString, "isWindowsDriveLetterString");
    function isNormalizedWindowsDriveLetterString(string) {
      return string.length === 2 && isASCIIAlpha(string.codePointAt(0)) && string[1] === ":";
    }
    __name(isNormalizedWindowsDriveLetterString, "isNormalizedWindowsDriveLetterString");
    function containsForbiddenHostCodePoint(string) {
      return string.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|%|\/|:|\?|@|\[|\\|\]/) !== -1;
    }
    __name(containsForbiddenHostCodePoint, "containsForbiddenHostCodePoint");
    function containsForbiddenHostCodePointExcludingPercent(string) {
      return string.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|\/|:|\?|@|\[|\\|\]/) !== -1;
    }
    __name(containsForbiddenHostCodePointExcludingPercent, "containsForbiddenHostCodePointExcludingPercent");
    function isSpecialScheme(scheme) {
      return specialSchemes[scheme] !== void 0;
    }
    __name(isSpecialScheme, "isSpecialScheme");
    function isSpecial(url4) {
      return isSpecialScheme(url4.scheme);
    }
    __name(isSpecial, "isSpecial");
    function defaultPort(scheme) {
      return specialSchemes[scheme];
    }
    __name(defaultPort, "defaultPort");
    function percentEncode(c8) {
      let hex = c8.toString(16).toUpperCase();
      if (hex.length === 1) {
        hex = "0" + hex;
      }
      return "%" + hex;
    }
    __name(percentEncode, "percentEncode");
    function utf8PercentEncode(c8) {
      const buf = new Buffer(c8);
      let str = "";
      for (let i7 = 0; i7 < buf.length; ++i7) {
        str += percentEncode(buf[i7]);
      }
      return str;
    }
    __name(utf8PercentEncode, "utf8PercentEncode");
    function utf8PercentDecode(str) {
      const input = new Buffer(str);
      const output = [];
      for (let i7 = 0; i7 < input.length; ++i7) {
        if (input[i7] !== 37) {
          output.push(input[i7]);
        } else if (input[i7] === 37 && isASCIIHex(input[i7 + 1]) && isASCIIHex(input[i7 + 2])) {
          output.push(parseInt(input.slice(i7 + 1, i7 + 3).toString(), 16));
          i7 += 2;
        } else {
          output.push(input[i7]);
        }
      }
      return new Buffer(output).toString();
    }
    __name(utf8PercentDecode, "utf8PercentDecode");
    function isC0ControlPercentEncode(c8) {
      return c8 <= 31 || c8 > 126;
    }
    __name(isC0ControlPercentEncode, "isC0ControlPercentEncode");
    var extraPathPercentEncodeSet = /* @__PURE__ */ new Set([32, 34, 35, 60, 62, 63, 96, 123, 125]);
    function isPathPercentEncode(c8) {
      return isC0ControlPercentEncode(c8) || extraPathPercentEncodeSet.has(c8);
    }
    __name(isPathPercentEncode, "isPathPercentEncode");
    var extraUserinfoPercentEncodeSet = /* @__PURE__ */ new Set([47, 58, 59, 61, 64, 91, 92, 93, 94, 124]);
    function isUserinfoPercentEncode(c8) {
      return isPathPercentEncode(c8) || extraUserinfoPercentEncodeSet.has(c8);
    }
    __name(isUserinfoPercentEncode, "isUserinfoPercentEncode");
    function percentEncodeChar(c8, encodeSetPredicate) {
      const cStr = String.fromCodePoint(c8);
      if (encodeSetPredicate(c8)) {
        return utf8PercentEncode(cStr);
      }
      return cStr;
    }
    __name(percentEncodeChar, "percentEncodeChar");
    function parseIPv4Number(input) {
      let R4 = 10;
      if (input.length >= 2 && input.charAt(0) === "0" && input.charAt(1).toLowerCase() === "x") {
        input = input.substring(2);
        R4 = 16;
      } else if (input.length >= 2 && input.charAt(0) === "0") {
        input = input.substring(1);
        R4 = 8;
      }
      if (input === "") {
        return 0;
      }
      const regex2 = R4 === 10 ? /[^0-9]/ : R4 === 16 ? /[^0-9A-Fa-f]/ : /[^0-7]/;
      if (regex2.test(input)) {
        return failure;
      }
      return parseInt(input, R4);
    }
    __name(parseIPv4Number, "parseIPv4Number");
    function parseIPv4(input) {
      const parts = input.split(".");
      if (parts[parts.length - 1] === "") {
        if (parts.length > 1) {
          parts.pop();
        }
      }
      if (parts.length > 4) {
        return input;
      }
      const numbers = [];
      for (const part of parts) {
        if (part === "") {
          return input;
        }
        const n9 = parseIPv4Number(part);
        if (n9 === failure) {
          return input;
        }
        numbers.push(n9);
      }
      for (let i7 = 0; i7 < numbers.length - 1; ++i7) {
        if (numbers[i7] > 255) {
          return failure;
        }
      }
      if (numbers[numbers.length - 1] >= Math.pow(256, 5 - numbers.length)) {
        return failure;
      }
      let ipv4 = numbers.pop();
      let counter = 0;
      for (const n9 of numbers) {
        ipv4 += n9 * Math.pow(256, 3 - counter);
        ++counter;
      }
      return ipv4;
    }
    __name(parseIPv4, "parseIPv4");
    function serializeIPv4(address) {
      let output = "";
      let n9 = address;
      for (let i7 = 1; i7 <= 4; ++i7) {
        output = String(n9 % 256) + output;
        if (i7 !== 4) {
          output = "." + output;
        }
        n9 = Math.floor(n9 / 256);
      }
      return output;
    }
    __name(serializeIPv4, "serializeIPv4");
    function parseIPv6(input) {
      const address = [0, 0, 0, 0, 0, 0, 0, 0];
      let pieceIndex = 0;
      let compress = null;
      let pointer = 0;
      input = punycode.ucs2.decode(input);
      if (input[pointer] === 58) {
        if (input[pointer + 1] !== 58) {
          return failure;
        }
        pointer += 2;
        ++pieceIndex;
        compress = pieceIndex;
      }
      while (pointer < input.length) {
        if (pieceIndex === 8) {
          return failure;
        }
        if (input[pointer] === 58) {
          if (compress !== null) {
            return failure;
          }
          ++pointer;
          ++pieceIndex;
          compress = pieceIndex;
          continue;
        }
        let value = 0;
        let length = 0;
        while (length < 4 && isASCIIHex(input[pointer])) {
          value = value * 16 + parseInt(at3(input, pointer), 16);
          ++pointer;
          ++length;
        }
        if (input[pointer] === 46) {
          if (length === 0) {
            return failure;
          }
          pointer -= length;
          if (pieceIndex > 6) {
            return failure;
          }
          let numbersSeen = 0;
          while (input[pointer] !== void 0) {
            let ipv4Piece = null;
            if (numbersSeen > 0) {
              if (input[pointer] === 46 && numbersSeen < 4) {
                ++pointer;
              } else {
                return failure;
              }
            }
            if (!isASCIIDigit(input[pointer])) {
              return failure;
            }
            while (isASCIIDigit(input[pointer])) {
              const number = parseInt(at3(input, pointer));
              if (ipv4Piece === null) {
                ipv4Piece = number;
              } else if (ipv4Piece === 0) {
                return failure;
              } else {
                ipv4Piece = ipv4Piece * 10 + number;
              }
              if (ipv4Piece > 255) {
                return failure;
              }
              ++pointer;
            }
            address[pieceIndex] = address[pieceIndex] * 256 + ipv4Piece;
            ++numbersSeen;
            if (numbersSeen === 2 || numbersSeen === 4) {
              ++pieceIndex;
            }
          }
          if (numbersSeen !== 4) {
            return failure;
          }
          break;
        } else if (input[pointer] === 58) {
          ++pointer;
          if (input[pointer] === void 0) {
            return failure;
          }
        } else if (input[pointer] !== void 0) {
          return failure;
        }
        address[pieceIndex] = value;
        ++pieceIndex;
      }
      if (compress !== null) {
        let swaps = pieceIndex - compress;
        pieceIndex = 7;
        while (pieceIndex !== 0 && swaps > 0) {
          const temp = address[compress + swaps - 1];
          address[compress + swaps - 1] = address[pieceIndex];
          address[pieceIndex] = temp;
          --pieceIndex;
          --swaps;
        }
      } else if (compress === null && pieceIndex !== 8) {
        return failure;
      }
      return address;
    }
    __name(parseIPv6, "parseIPv6");
    function serializeIPv6(address) {
      let output = "";
      const seqResult = findLongestZeroSequence(address);
      const compress = seqResult.idx;
      let ignore0 = false;
      for (let pieceIndex = 0; pieceIndex <= 7; ++pieceIndex) {
        if (ignore0 && address[pieceIndex] === 0) {
          continue;
        } else if (ignore0) {
          ignore0 = false;
        }
        if (compress === pieceIndex) {
          const separator = pieceIndex === 0 ? "::" : ":";
          output += separator;
          ignore0 = true;
          continue;
        }
        output += address[pieceIndex].toString(16);
        if (pieceIndex !== 7) {
          output += ":";
        }
      }
      return output;
    }
    __name(serializeIPv6, "serializeIPv6");
    function parseHost(input, isSpecialArg) {
      if (input[0] === "[") {
        if (input[input.length - 1] !== "]") {
          return failure;
        }
        return parseIPv6(input.substring(1, input.length - 1));
      }
      if (!isSpecialArg) {
        return parseOpaqueHost(input);
      }
      const domain2 = utf8PercentDecode(input);
      const asciiDomain = tr46.toASCII(domain2, false, tr46.PROCESSING_OPTIONS.NONTRANSITIONAL, false);
      if (asciiDomain === null) {
        return failure;
      }
      if (containsForbiddenHostCodePoint(asciiDomain)) {
        return failure;
      }
      const ipv4Host = parseIPv4(asciiDomain);
      if (typeof ipv4Host === "number" || ipv4Host === failure) {
        return ipv4Host;
      }
      return asciiDomain;
    }
    __name(parseHost, "parseHost");
    function parseOpaqueHost(input) {
      if (containsForbiddenHostCodePointExcludingPercent(input)) {
        return failure;
      }
      let output = "";
      const decoded = punycode.ucs2.decode(input);
      for (let i7 = 0; i7 < decoded.length; ++i7) {
        output += percentEncodeChar(decoded[i7], isC0ControlPercentEncode);
      }
      return output;
    }
    __name(parseOpaqueHost, "parseOpaqueHost");
    function findLongestZeroSequence(arr) {
      let maxIdx = null;
      let maxLen = 1;
      let currStart = null;
      let currLen = 0;
      for (let i7 = 0; i7 < arr.length; ++i7) {
        if (arr[i7] !== 0) {
          if (currLen > maxLen) {
            maxIdx = currStart;
            maxLen = currLen;
          }
          currStart = null;
          currLen = 0;
        } else {
          if (currStart === null) {
            currStart = i7;
          }
          ++currLen;
        }
      }
      if (currLen > maxLen) {
        maxIdx = currStart;
        maxLen = currLen;
      }
      return {
        idx: maxIdx,
        len: maxLen
      };
    }
    __name(findLongestZeroSequence, "findLongestZeroSequence");
    function serializeHost(host) {
      if (typeof host === "number") {
        return serializeIPv4(host);
      }
      if (host instanceof Array) {
        return "[" + serializeIPv6(host) + "]";
      }
      return host;
    }
    __name(serializeHost, "serializeHost");
    function trimControlChars(url4) {
      return url4.replace(/^[\u0000-\u001F\u0020]+|[\u0000-\u001F\u0020]+$/g, "");
    }
    __name(trimControlChars, "trimControlChars");
    function trimTabAndNewline(url4) {
      return url4.replace(/\u0009|\u000A|\u000D/g, "");
    }
    __name(trimTabAndNewline, "trimTabAndNewline");
    function shortenPath(url4) {
      const path84 = url4.path;
      if (path84.length === 0) {
        return;
      }
      if (url4.scheme === "file" && path84.length === 1 && isNormalizedWindowsDriveLetter(path84[0])) {
        return;
      }
      path84.pop();
    }
    __name(shortenPath, "shortenPath");
    function includesCredentials(url4) {
      return url4.username !== "" || url4.password !== "";
    }
    __name(includesCredentials, "includesCredentials");
    function cannotHaveAUsernamePasswordPort(url4) {
      return url4.host === null || url4.host === "" || url4.cannotBeABaseURL || url4.scheme === "file";
    }
    __name(cannotHaveAUsernamePasswordPort, "cannotHaveAUsernamePasswordPort");
    function isNormalizedWindowsDriveLetter(string) {
      return /^[A-Za-z]:$/.test(string);
    }
    __name(isNormalizedWindowsDriveLetter, "isNormalizedWindowsDriveLetter");
    function URLStateMachine(input, base, encodingOverride, url4, stateOverride) {
      this.pointer = 0;
      this.input = input;
      this.base = base || null;
      this.encodingOverride = encodingOverride || "utf-8";
      this.stateOverride = stateOverride;
      this.url = url4;
      this.failure = false;
      this.parseError = false;
      if (!this.url) {
        this.url = {
          scheme: "",
          username: "",
          password: "",
          host: null,
          port: null,
          path: [],
          query: null,
          fragment: null,
          cannotBeABaseURL: false
        };
        const res2 = trimControlChars(this.input);
        if (res2 !== this.input) {
          this.parseError = true;
        }
        this.input = res2;
      }
      const res = trimTabAndNewline(this.input);
      if (res !== this.input) {
        this.parseError = true;
      }
      this.input = res;
      this.state = stateOverride || "scheme start";
      this.buffer = "";
      this.atFlag = false;
      this.arrFlag = false;
      this.passwordTokenSeenFlag = false;
      this.input = punycode.ucs2.decode(this.input);
      for (; this.pointer <= this.input.length; ++this.pointer) {
        const c8 = this.input[this.pointer];
        const cStr = isNaN(c8) ? void 0 : String.fromCodePoint(c8);
        const ret = this["parse " + this.state](c8, cStr);
        if (!ret) {
          break;
        } else if (ret === failure) {
          this.failure = true;
          break;
        }
      }
    }
    __name(URLStateMachine, "URLStateMachine");
    URLStateMachine.prototype["parse scheme start"] = /* @__PURE__ */ __name(function parseSchemeStart(c8, cStr) {
      if (isASCIIAlpha(c8)) {
        this.buffer += cStr.toLowerCase();
        this.state = "scheme";
      } else if (!this.stateOverride) {
        this.state = "no scheme";
        --this.pointer;
      } else {
        this.parseError = true;
        return failure;
      }
      return true;
    }, "parseSchemeStart");
    URLStateMachine.prototype["parse scheme"] = /* @__PURE__ */ __name(function parseScheme(c8, cStr) {
      if (isASCIIAlphanumeric(c8) || c8 === 43 || c8 === 45 || c8 === 46) {
        this.buffer += cStr.toLowerCase();
      } else if (c8 === 58) {
        if (this.stateOverride) {
          if (isSpecial(this.url) && !isSpecialScheme(this.buffer)) {
            return false;
          }
          if (!isSpecial(this.url) && isSpecialScheme(this.buffer)) {
            return false;
          }
          if ((includesCredentials(this.url) || this.url.port !== null) && this.buffer === "file") {
            return false;
          }
          if (this.url.scheme === "file" && (this.url.host === "" || this.url.host === null)) {
            return false;
          }
        }
        this.url.scheme = this.buffer;
        this.buffer = "";
        if (this.stateOverride) {
          return false;
        }
        if (this.url.scheme === "file") {
          if (this.input[this.pointer + 1] !== 47 || this.input[this.pointer + 2] !== 47) {
            this.parseError = true;
          }
          this.state = "file";
        } else if (isSpecial(this.url) && this.base !== null && this.base.scheme === this.url.scheme) {
          this.state = "special relative or authority";
        } else if (isSpecial(this.url)) {
          this.state = "special authority slashes";
        } else if (this.input[this.pointer + 1] === 47) {
          this.state = "path or authority";
          ++this.pointer;
        } else {
          this.url.cannotBeABaseURL = true;
          this.url.path.push("");
          this.state = "cannot-be-a-base-URL path";
        }
      } else if (!this.stateOverride) {
        this.buffer = "";
        this.state = "no scheme";
        this.pointer = -1;
      } else {
        this.parseError = true;
        return failure;
      }
      return true;
    }, "parseScheme");
    URLStateMachine.prototype["parse no scheme"] = /* @__PURE__ */ __name(function parseNoScheme(c8) {
      if (this.base === null || this.base.cannotBeABaseURL && c8 !== 35) {
        return failure;
      } else if (this.base.cannotBeABaseURL && c8 === 35) {
        this.url.scheme = this.base.scheme;
        this.url.path = this.base.path.slice();
        this.url.query = this.base.query;
        this.url.fragment = "";
        this.url.cannotBeABaseURL = true;
        this.state = "fragment";
      } else if (this.base.scheme === "file") {
        this.state = "file";
        --this.pointer;
      } else {
        this.state = "relative";
        --this.pointer;
      }
      return true;
    }, "parseNoScheme");
    URLStateMachine.prototype["parse special relative or authority"] = /* @__PURE__ */ __name(function parseSpecialRelativeOrAuthority(c8) {
      if (c8 === 47 && this.input[this.pointer + 1] === 47) {
        this.state = "special authority ignore slashes";
        ++this.pointer;
      } else {
        this.parseError = true;
        this.state = "relative";
        --this.pointer;
      }
      return true;
    }, "parseSpecialRelativeOrAuthority");
    URLStateMachine.prototype["parse path or authority"] = /* @__PURE__ */ __name(function parsePathOrAuthority(c8) {
      if (c8 === 47) {
        this.state = "authority";
      } else {
        this.state = "path";
        --this.pointer;
      }
      return true;
    }, "parsePathOrAuthority");
    URLStateMachine.prototype["parse relative"] = /* @__PURE__ */ __name(function parseRelative(c8) {
      this.url.scheme = this.base.scheme;
      if (isNaN(c8)) {
        this.url.username = this.base.username;
        this.url.password = this.base.password;
        this.url.host = this.base.host;
        this.url.port = this.base.port;
        this.url.path = this.base.path.slice();
        this.url.query = this.base.query;
      } else if (c8 === 47) {
        this.state = "relative slash";
      } else if (c8 === 63) {
        this.url.username = this.base.username;
        this.url.password = this.base.password;
        this.url.host = this.base.host;
        this.url.port = this.base.port;
        this.url.path = this.base.path.slice();
        this.url.query = "";
        this.state = "query";
      } else if (c8 === 35) {
        this.url.username = this.base.username;
        this.url.password = this.base.password;
        this.url.host = this.base.host;
        this.url.port = this.base.port;
        this.url.path = this.base.path.slice();
        this.url.query = this.base.query;
        this.url.fragment = "";
        this.state = "fragment";
      } else if (isSpecial(this.url) && c8 === 92) {
        this.parseError = true;
        this.state = "relative slash";
      } else {
        this.url.username = this.base.username;
        this.url.password = this.base.password;
        this.url.host = this.base.host;
        this.url.port = this.base.port;
        this.url.path = this.base.path.slice(0, this.base.path.length - 1);
        this.state = "path";
        --this.pointer;
      }
      return true;
    }, "parseRelative");
    URLStateMachine.prototype["parse relative slash"] = /* @__PURE__ */ __name(function parseRelativeSlash(c8) {
      if (isSpecial(this.url) && (c8 === 47 || c8 === 92)) {
        if (c8 === 92) {
          this.parseError = true;
        }
        this.state = "special authority ignore slashes";
      } else if (c8 === 47) {
        this.state = "authority";
      } else {
        this.url.username = this.base.username;
        this.url.password = this.base.password;
        this.url.host = this.base.host;
        this.url.port = this.base.port;
        this.state = "path";
        --this.pointer;
      }
      return true;
    }, "parseRelativeSlash");
    URLStateMachine.prototype["parse special authority slashes"] = /* @__PURE__ */ __name(function parseSpecialAuthoritySlashes(c8) {
      if (c8 === 47 && this.input[this.pointer + 1] === 47) {
        this.state = "special authority ignore slashes";
        ++this.pointer;
      } else {
        this.parseError = true;
        this.state = "special authority ignore slashes";
        --this.pointer;
      }
      return true;
    }, "parseSpecialAuthoritySlashes");
    URLStateMachine.prototype["parse special authority ignore slashes"] = /* @__PURE__ */ __name(function parseSpecialAuthorityIgnoreSlashes(c8) {
      if (c8 !== 47 && c8 !== 92) {
        this.state = "authority";
        --this.pointer;
      } else {
        this.parseError = true;
      }
      return true;
    }, "parseSpecialAuthorityIgnoreSlashes");
    URLStateMachine.prototype["parse authority"] = /* @__PURE__ */ __name(function parseAuthority(c8, cStr) {
      if (c8 === 64) {
        this.parseError = true;
        if (this.atFlag) {
          this.buffer = "%40" + this.buffer;
        }
        this.atFlag = true;
        const len = countSymbols(this.buffer);
        for (let pointer = 0; pointer < len; ++pointer) {
          const codePoint = this.buffer.codePointAt(pointer);
          if (codePoint === 58 && !this.passwordTokenSeenFlag) {
            this.passwordTokenSeenFlag = true;
            continue;
          }
          const encodedCodePoints = percentEncodeChar(codePoint, isUserinfoPercentEncode);
          if (this.passwordTokenSeenFlag) {
            this.url.password += encodedCodePoints;
          } else {
            this.url.username += encodedCodePoints;
          }
        }
        this.buffer = "";
      } else if (isNaN(c8) || c8 === 47 || c8 === 63 || c8 === 35 || isSpecial(this.url) && c8 === 92) {
        if (this.atFlag && this.buffer === "") {
          this.parseError = true;
          return failure;
        }
        this.pointer -= countSymbols(this.buffer) + 1;
        this.buffer = "";
        this.state = "host";
      } else {
        this.buffer += cStr;
      }
      return true;
    }, "parseAuthority");
    URLStateMachine.prototype["parse hostname"] = URLStateMachine.prototype["parse host"] = /* @__PURE__ */ __name(function parseHostName(c8, cStr) {
      if (this.stateOverride && this.url.scheme === "file") {
        --this.pointer;
        this.state = "file host";
      } else if (c8 === 58 && !this.arrFlag) {
        if (this.buffer === "") {
          this.parseError = true;
          return failure;
        }
        const host = parseHost(this.buffer, isSpecial(this.url));
        if (host === failure) {
          return failure;
        }
        this.url.host = host;
        this.buffer = "";
        this.state = "port";
        if (this.stateOverride === "hostname") {
          return false;
        }
      } else if (isNaN(c8) || c8 === 47 || c8 === 63 || c8 === 35 || isSpecial(this.url) && c8 === 92) {
        --this.pointer;
        if (isSpecial(this.url) && this.buffer === "") {
          this.parseError = true;
          return failure;
        } else if (this.stateOverride && this.buffer === "" && (includesCredentials(this.url) || this.url.port !== null)) {
          this.parseError = true;
          return false;
        }
        const host = parseHost(this.buffer, isSpecial(this.url));
        if (host === failure) {
          return failure;
        }
        this.url.host = host;
        this.buffer = "";
        this.state = "path start";
        if (this.stateOverride) {
          return false;
        }
      } else {
        if (c8 === 91) {
          this.arrFlag = true;
        } else if (c8 === 93) {
          this.arrFlag = false;
        }
        this.buffer += cStr;
      }
      return true;
    }, "parseHostName");
    URLStateMachine.prototype["parse port"] = /* @__PURE__ */ __name(function parsePort(c8, cStr) {
      if (isASCIIDigit(c8)) {
        this.buffer += cStr;
      } else if (isNaN(c8) || c8 === 47 || c8 === 63 || c8 === 35 || isSpecial(this.url) && c8 === 92 || this.stateOverride) {
        if (this.buffer !== "") {
          const port = parseInt(this.buffer);
          if (port > Math.pow(2, 16) - 1) {
            this.parseError = true;
            return failure;
          }
          this.url.port = port === defaultPort(this.url.scheme) ? null : port;
          this.buffer = "";
        }
        if (this.stateOverride) {
          return false;
        }
        this.state = "path start";
        --this.pointer;
      } else {
        this.parseError = true;
        return failure;
      }
      return true;
    }, "parsePort");
    var fileOtherwiseCodePoints = /* @__PURE__ */ new Set([47, 92, 63, 35]);
    URLStateMachine.prototype["parse file"] = /* @__PURE__ */ __name(function parseFile2(c8) {
      this.url.scheme = "file";
      if (c8 === 47 || c8 === 92) {
        if (c8 === 92) {
          this.parseError = true;
        }
        this.state = "file slash";
      } else if (this.base !== null && this.base.scheme === "file") {
        if (isNaN(c8)) {
          this.url.host = this.base.host;
          this.url.path = this.base.path.slice();
          this.url.query = this.base.query;
        } else if (c8 === 63) {
          this.url.host = this.base.host;
          this.url.path = this.base.path.slice();
          this.url.query = "";
          this.state = "query";
        } else if (c8 === 35) {
          this.url.host = this.base.host;
          this.url.path = this.base.path.slice();
          this.url.query = this.base.query;
          this.url.fragment = "";
          this.state = "fragment";
        } else {
          if (this.input.length - this.pointer - 1 === 0 || // remaining consists of 0 code points
          !isWindowsDriveLetterCodePoints(c8, this.input[this.pointer + 1]) || this.input.length - this.pointer - 1 >= 2 && // remaining has at least 2 code points
          !fileOtherwiseCodePoints.has(this.input[this.pointer + 2])) {
            this.url.host = this.base.host;
            this.url.path = this.base.path.slice();
            shortenPath(this.url);
          } else {
            this.parseError = true;
          }
          this.state = "path";
          --this.pointer;
        }
      } else {
        this.state = "path";
        --this.pointer;
      }
      return true;
    }, "parseFile");
    URLStateMachine.prototype["parse file slash"] = /* @__PURE__ */ __name(function parseFileSlash(c8) {
      if (c8 === 47 || c8 === 92) {
        if (c8 === 92) {
          this.parseError = true;
        }
        this.state = "file host";
      } else {
        if (this.base !== null && this.base.scheme === "file") {
          if (isNormalizedWindowsDriveLetterString(this.base.path[0])) {
            this.url.path.push(this.base.path[0]);
          } else {
            this.url.host = this.base.host;
          }
        }
        this.state = "path";
        --this.pointer;
      }
      return true;
    }, "parseFileSlash");
    URLStateMachine.prototype["parse file host"] = /* @__PURE__ */ __name(function parseFileHost(c8, cStr) {
      if (isNaN(c8) || c8 === 47 || c8 === 92 || c8 === 63 || c8 === 35) {
        --this.pointer;
        if (!this.stateOverride && isWindowsDriveLetterString(this.buffer)) {
          this.parseError = true;
          this.state = "path";
        } else if (this.buffer === "") {
          this.url.host = "";
          if (this.stateOverride) {
            return false;
          }
          this.state = "path start";
        } else {
          let host = parseHost(this.buffer, isSpecial(this.url));
          if (host === failure) {
            return failure;
          }
          if (host === "localhost") {
            host = "";
          }
          this.url.host = host;
          if (this.stateOverride) {
            return false;
          }
          this.buffer = "";
          this.state = "path start";
        }
      } else {
        this.buffer += cStr;
      }
      return true;
    }, "parseFileHost");
    URLStateMachine.prototype["parse path start"] = /* @__PURE__ */ __name(function parsePathStart(c8) {
      if (isSpecial(this.url)) {
        if (c8 === 92) {
          this.parseError = true;
        }
        this.state = "path";
        if (c8 !== 47 && c8 !== 92) {
          --this.pointer;
        }
      } else if (!this.stateOverride && c8 === 63) {
        this.url.query = "";
        this.state = "query";
      } else if (!this.stateOverride && c8 === 35) {
        this.url.fragment = "";
        this.state = "fragment";
      } else if (c8 !== void 0) {
        this.state = "path";
        if (c8 !== 47) {
          --this.pointer;
        }
      }
      return true;
    }, "parsePathStart");
    URLStateMachine.prototype["parse path"] = /* @__PURE__ */ __name(function parsePath(c8) {
      if (isNaN(c8) || c8 === 47 || isSpecial(this.url) && c8 === 92 || !this.stateOverride && (c8 === 63 || c8 === 35)) {
        if (isSpecial(this.url) && c8 === 92) {
          this.parseError = true;
        }
        if (isDoubleDot(this.buffer)) {
          shortenPath(this.url);
          if (c8 !== 47 && !(isSpecial(this.url) && c8 === 92)) {
            this.url.path.push("");
          }
        } else if (isSingleDot(this.buffer) && c8 !== 47 && !(isSpecial(this.url) && c8 === 92)) {
          this.url.path.push("");
        } else if (!isSingleDot(this.buffer)) {
          if (this.url.scheme === "file" && this.url.path.length === 0 && isWindowsDriveLetterString(this.buffer)) {
            if (this.url.host !== "" && this.url.host !== null) {
              this.parseError = true;
              this.url.host = "";
            }
            this.buffer = this.buffer[0] + ":";
          }
          this.url.path.push(this.buffer);
        }
        this.buffer = "";
        if (this.url.scheme === "file" && (c8 === void 0 || c8 === 63 || c8 === 35)) {
          while (this.url.path.length > 1 && this.url.path[0] === "") {
            this.parseError = true;
            this.url.path.shift();
          }
        }
        if (c8 === 63) {
          this.url.query = "";
          this.state = "query";
        }
        if (c8 === 35) {
          this.url.fragment = "";
          this.state = "fragment";
        }
      } else {
        if (c8 === 37 && (!isASCIIHex(this.input[this.pointer + 1]) || !isASCIIHex(this.input[this.pointer + 2]))) {
          this.parseError = true;
        }
        this.buffer += percentEncodeChar(c8, isPathPercentEncode);
      }
      return true;
    }, "parsePath");
    URLStateMachine.prototype["parse cannot-be-a-base-URL path"] = /* @__PURE__ */ __name(function parseCannotBeABaseURLPath(c8) {
      if (c8 === 63) {
        this.url.query = "";
        this.state = "query";
      } else if (c8 === 35) {
        this.url.fragment = "";
        this.state = "fragment";
      } else {
        if (!isNaN(c8) && c8 !== 37) {
          this.parseError = true;
        }
        if (c8 === 37 && (!isASCIIHex(this.input[this.pointer + 1]) || !isASCIIHex(this.input[this.pointer + 2]))) {
          this.parseError = true;
        }
        if (!isNaN(c8)) {
          this.url.path[0] = this.url.path[0] + percentEncodeChar(c8, isC0ControlPercentEncode);
        }
      }
      return true;
    }, "parseCannotBeABaseURLPath");
    URLStateMachine.prototype["parse query"] = /* @__PURE__ */ __name(function parseQuery2(c8, cStr) {
      if (isNaN(c8) || !this.stateOverride && c8 === 35) {
        if (!isSpecial(this.url) || this.url.scheme === "ws" || this.url.scheme === "wss") {
          this.encodingOverride = "utf-8";
        }
        const buffer = new Buffer(this.buffer);
        for (let i7 = 0; i7 < buffer.length; ++i7) {
          if (buffer[i7] < 33 || buffer[i7] > 126 || buffer[i7] === 34 || buffer[i7] === 35 || buffer[i7] === 60 || buffer[i7] === 62) {
            this.url.query += percentEncode(buffer[i7]);
          } else {
            this.url.query += String.fromCodePoint(buffer[i7]);
          }
        }
        this.buffer = "";
        if (c8 === 35) {
          this.url.fragment = "";
          this.state = "fragment";
        }
      } else {
        if (c8 === 37 && (!isASCIIHex(this.input[this.pointer + 1]) || !isASCIIHex(this.input[this.pointer + 2]))) {
          this.parseError = true;
        }
        this.buffer += cStr;
      }
      return true;
    }, "parseQuery");
    URLStateMachine.prototype["parse fragment"] = /* @__PURE__ */ __name(function parseFragment(c8) {
      if (isNaN(c8)) ; else if (c8 === 0) {
        this.parseError = true;
      } else {
        if (c8 === 37 && (!isASCIIHex(this.input[this.pointer + 1]) || !isASCIIHex(this.input[this.pointer + 2]))) {
          this.parseError = true;
        }
        this.url.fragment += percentEncodeChar(c8, isC0ControlPercentEncode);
      }
      return true;
    }, "parseFragment");
    function serializeURL(url4, excludeFragment) {
      let output = url4.scheme + ":";
      if (url4.host !== null) {
        output += "//";
        if (url4.username !== "" || url4.password !== "") {
          output += url4.username;
          if (url4.password !== "") {
            output += ":" + url4.password;
          }
          output += "@";
        }
        output += serializeHost(url4.host);
        if (url4.port !== null) {
          output += ":" + url4.port;
        }
      } else if (url4.host === null && url4.scheme === "file") {
        output += "//";
      }
      if (url4.cannotBeABaseURL) {
        output += url4.path[0];
      } else {
        for (const string of url4.path) {
          output += "/" + string;
        }
      }
      if (url4.query !== null) {
        output += "?" + url4.query;
      }
      if (!excludeFragment && url4.fragment !== null) {
        output += "#" + url4.fragment;
      }
      return output;
    }
    __name(serializeURL, "serializeURL");
    function serializeOrigin(tuple) {
      let result = tuple.scheme + "://";
      result += serializeHost(tuple.host);
      if (tuple.port !== null) {
        result += ":" + tuple.port;
      }
      return result;
    }
    __name(serializeOrigin, "serializeOrigin");
    module2.exports.serializeURL = serializeURL;
    module2.exports.serializeURLOrigin = function(url4) {
      switch (url4.scheme) {
        case "blob":
          try {
            return module2.exports.serializeURLOrigin(module2.exports.parseURL(url4.path[0]));
          } catch (e10) {
            return "null";
          }
        case "ftp":
        case "gopher":
        case "http":
        case "https":
        case "ws":
        case "wss":
          return serializeOrigin({
            scheme: url4.scheme,
            host: url4.host,
            port: url4.port
          });
        case "file":
          return "file://";
        default:
          return "null";
      }
    };
    module2.exports.basicURLParse = function(input, options) {
      if (options === void 0) {
        options = {};
      }
      const usm = new URLStateMachine(input, options.baseURL, options.encodingOverride, options.url, options.stateOverride);
      if (usm.failure) {
        return "failure";
      }
      return usm.url;
    };
    module2.exports.setTheUsername = function(url4, username) {
      url4.username = "";
      const decoded = punycode.ucs2.decode(username);
      for (let i7 = 0; i7 < decoded.length; ++i7) {
        url4.username += percentEncodeChar(decoded[i7], isUserinfoPercentEncode);
      }
    };
    module2.exports.setThePassword = function(url4, password) {
      url4.password = "";
      const decoded = punycode.ucs2.decode(password);
      for (let i7 = 0; i7 < decoded.length; ++i7) {
        url4.password += percentEncodeChar(decoded[i7], isUserinfoPercentEncode);
      }
    };
    module2.exports.serializeHost = serializeHost;
    module2.exports.cannotHaveAUsernamePasswordPort = cannotHaveAUsernamePasswordPort;
    module2.exports.serializeInteger = function(integer) {
      return String(integer);
    };
    module2.exports.parseURL = function(input, options) {
      if (options === void 0) {
        options = {};
      }
      return module2.exports.basicURLParse(input, { baseURL: options.baseURL, encodingOverride: options.encodingOverride });
    };
  }
});

// ../../node_modules/.pnpm/whatwg-url@5.0.0/node_modules/whatwg-url/lib/URL-impl.js
var require_URL_impl = __commonJS({
  "../../node_modules/.pnpm/whatwg-url@5.0.0/node_modules/whatwg-url/lib/URL-impl.js"(exports) {
    init_import_meta_url();
    var usm = require_url_state_machine();
    exports.implementation = class URLImpl {
      static {
        __name(this, "URLImpl");
      }
      constructor(constructorArgs) {
        const url4 = constructorArgs[0];
        const base = constructorArgs[1];
        let parsedBase = null;
        if (base !== void 0) {
          parsedBase = usm.basicURLParse(base);
          if (parsedBase === "failure") {
            throw new TypeError("Invalid base URL");
          }
        }
        const parsedURL = usm.basicURLParse(url4, { baseURL: parsedBase });
        if (parsedURL === "failure") {
          throw new TypeError("Invalid URL");
        }
        this._url = parsedURL;
      }
      get href() {
        return usm.serializeURL(this._url);
      }
      set href(v8) {
        const parsedURL = usm.basicURLParse(v8);
        if (parsedURL === "failure") {
          throw new TypeError("Invalid URL");
        }
        this._url = parsedURL;
      }
      get origin() {
        return usm.serializeURLOrigin(this._url);
      }
      get protocol() {
        return this._url.scheme + ":";
      }
      set protocol(v8) {
        usm.basicURLParse(v8 + ":", { url: this._url, stateOverride: "scheme start" });
      }
      get username() {
        return this._url.username;
      }
      set username(v8) {
        if (usm.cannotHaveAUsernamePasswordPort(this._url)) {
          return;
        }
        usm.setTheUsername(this._url, v8);
      }
      get password() {
        return this._url.password;
      }
      set password(v8) {
        if (usm.cannotHaveAUsernamePasswordPort(this._url)) {
          return;
        }
        usm.setThePassword(this._url, v8);
      }
      get host() {
        const url4 = this._url;
        if (url4.host === null) {
          return "";
        }
        if (url4.port === null) {
          return usm.serializeHost(url4.host);
        }
        return usm.serializeHost(url4.host) + ":" + usm.serializeInteger(url4.port);
      }
      set host(v8) {
        if (this._url.cannotBeABaseURL) {
          return;
        }
        usm.basicURLParse(v8, { url: this._url, stateOverride: "host" });
      }
      get hostname() {
        if (this._url.host === null) {
          return "";
        }
        return usm.serializeHost(this._url.host);
      }
      set hostname(v8) {
        if (this._url.cannotBeABaseURL) {
          return;
        }
        usm.basicURLParse(v8, { url: this._url, stateOverride: "hostname" });
      }
      get port() {
        if (this._url.port === null) {
          return "";
        }
        return usm.serializeInteger(this._url.port);
      }
      set port(v8) {
        if (usm.cannotHaveAUsernamePasswordPort(this._url)) {
          return;
        }
        if (v8 === "") {
          this._url.port = null;
        } else {
          usm.basicURLParse(v8, { url: this._url, stateOverride: "port" });
        }
      }
      get pathname() {
        if (this._url.cannotBeABaseURL) {
          return this._url.path[0];
        }
        if (this._url.path.length === 0) {
          return "";
        }
        return "/" + this._url.path.join("/");
      }
      set pathname(v8) {
        if (this._url.cannotBeABaseURL) {
          return;
        }
        this._url.path = [];
        usm.basicURLParse(v8, { url: this._url, stateOverride: "path start" });
      }
      get search() {
        if (this._url.query === null || this._url.query === "") {
          return "";
        }
        return "?" + this._url.query;
      }
      set search(v8) {
        const url4 = this._url;
        if (v8 === "") {
          url4.query = null;
          return;
        }
        const input = v8[0] === "?" ? v8.substring(1) : v8;
        url4.query = "";
        usm.basicURLParse(input, { url: url4, stateOverride: "query" });
      }
      get hash() {
        if (this._url.fragment === null || this._url.fragment === "") {
          return "";
        }
        return "#" + this._url.fragment;
      }
      set hash(v8) {
        if (v8 === "") {
          this._url.fragment = null;
          return;
        }
        const input = v8[0] === "#" ? v8.substring(1) : v8;
        this._url.fragment = "";
        usm.basicURLParse(input, { url: this._url, stateOverride: "fragment" });
      }
      toJSON() {
        return this.href;
      }
    };
  }
});

// ../../node_modules/.pnpm/whatwg-url@5.0.0/node_modules/whatwg-url/lib/URL.js
var require_URL = __commonJS({
  "../../node_modules/.pnpm/whatwg-url@5.0.0/node_modules/whatwg-url/lib/URL.js"(exports, module2) {
    init_import_meta_url();
    var conversions = require_lib2();
    var utils = require_utils4();
    var Impl = require_URL_impl();
    var impl = utils.implSymbol;
    function URL8(url4) {
      if (!this || this[impl] || !(this instanceof URL8)) {
        throw new TypeError("Failed to construct 'URL': Please use the 'new' operator, this DOM object constructor cannot be called as a function.");
      }
      if (arguments.length < 1) {
        throw new TypeError("Failed to construct 'URL': 1 argument required, but only " + arguments.length + " present.");
      }
      const args = [];
      for (let i7 = 0; i7 < arguments.length && i7 < 2; ++i7) {
        args[i7] = arguments[i7];
      }
      args[0] = conversions["USVString"](args[0]);
      if (args[1] !== void 0) {
        args[1] = conversions["USVString"](args[1]);
      }
      module2.exports.setup(this, args);
    }
    __name(URL8, "URL");
    URL8.prototype.toJSON = /* @__PURE__ */ __name(function toJSON() {
      if (!this || !module2.exports.is(this)) {
        throw new TypeError("Illegal invocation");
      }
      const args = [];
      for (let i7 = 0; i7 < arguments.length && i7 < 0; ++i7) {
        args[i7] = arguments[i7];
      }
      return this[impl].toJSON.apply(this[impl], args);
    }, "toJSON");
    Object.defineProperty(URL8.prototype, "href", {
      get() {
        return this[impl].href;
      },
      set(V4) {
        V4 = conversions["USVString"](V4);
        this[impl].href = V4;
      },
      enumerable: true,
      configurable: true
    });
    URL8.prototype.toString = function() {
      if (!this || !module2.exports.is(this)) {
        throw new TypeError("Illegal invocation");
      }
      return this.href;
    };
    Object.defineProperty(URL8.prototype, "origin", {
      get() {
        return this[impl].origin;
      },
      enumerable: true,
      configurable: true
    });
    Object.defineProperty(URL8.prototype, "protocol", {
      get() {
        return this[impl].protocol;
      },
      set(V4) {
        V4 = conversions["USVString"](V4);
        this[impl].protocol = V4;
      },
      enumerable: true,
      configurable: true
    });
    Object.defineProperty(URL8.prototype, "username", {
      get() {
        return this[impl].username;
      },
      set(V4) {
        V4 = conversions["USVString"](V4);
        this[impl].username = V4;
      },
      enumerable: true,
      configurable: true
    });
    Object.defineProperty(URL8.prototype, "password", {
      get() {
        return this[impl].password;
      },
      set(V4) {
        V4 = conversions["USVString"](V4);
        this[impl].password = V4;
      },
      enumerable: true,
      configurable: true
    });
    Object.defineProperty(URL8.prototype, "host", {
      get() {
        return this[impl].host;
      },
      set(V4) {
        V4 = conversions["USVString"](V4);
        this[impl].host = V4;
      },
      enumerable: true,
      configurable: true
    });
    Object.defineProperty(URL8.prototype, "hostname", {
      get() {
        return this[impl].hostname;
      },
      set(V4) {
        V4 = conversions["USVString"](V4);
        this[impl].hostname = V4;
      },
      enumerable: true,
      configurable: true
    });
    Object.defineProperty(URL8.prototype, "port", {
      get() {
        return this[impl].port;
      },
      set(V4) {
        V4 = conversions["USVString"](V4);
        this[impl].port = V4;
      },
      enumerable: true,
      configurable: true
    });
    Object.defineProperty(URL8.prototype, "pathname", {
      get() {
        return this[impl].pathname;
      },
      set(V4) {
        V4 = conversions["USVString"](V4);
        this[impl].pathname = V4;
      },
      enumerable: true,
      configurable: true
    });
    Object.defineProperty(URL8.prototype, "search", {
      get() {
        return this[impl].search;
      },
      set(V4) {
        V4 = conversions["USVString"](V4);
        this[impl].search = V4;
      },
      enumerable: true,
      configurable: true
    });
    Object.defineProperty(URL8.prototype, "hash", {
      get() {
        return this[impl].hash;
      },
      set(V4) {
        V4 = conversions["USVString"](V4);
        this[impl].hash = V4;
      },
      enumerable: true,
      configurable: true
    });
    module2.exports = {
      is(obj) {
        return !!obj && obj[impl] instanceof Impl.implementation;
      },
      create(constructorArgs, privateData) {
        let obj = Object.create(URL8.prototype);
        this.setup(obj, constructorArgs, privateData);
        return obj;
      },
      setup(obj, constructorArgs, privateData) {
        if (!privateData) privateData = {};
        privateData.wrapper = obj;
        obj[impl] = new Impl.implementation(constructorArgs, privateData);
        obj[impl][utils.wrapperSymbol] = obj;
      },
      interface: URL8,
      expose: {
        Window: { URL: URL8 },
        Worker: { URL: URL8 }
      }
    };
  }
});

// ../../node_modules/.pnpm/whatwg-url@5.0.0/node_modules/whatwg-url/lib/public-api.js
var require_public_api = __commonJS({
  "../../node_modules/.pnpm/whatwg-url@5.0.0/node_modules/whatwg-url/lib/public-api.js"(exports) {
    init_import_meta_url();
    exports.URL = require_URL().interface;
    exports.serializeURL = require_url_state_machine().serializeURL;
    exports.serializeURLOrigin = require_url_state_machine().serializeURLOrigin;
    exports.basicURLParse = require_url_state_machine().basicURLParse;
    exports.setTheUsername = require_url_state_machine().setTheUsername;
    exports.setThePassword = require_url_state_machine().setThePassword;
    exports.serializeHost = require_url_state_machine().serializeHost;
    exports.serializeInteger = require_url_state_machine().serializeInteger;
    exports.parseURL = require_url_state_machine().parseURL;
  }
});

// ../../node_modules/.pnpm/safer-buffer@2.1.2/node_modules/safer-buffer/safer.js
var require_safer = __commonJS({
  "../../node_modules/.pnpm/safer-buffer@2.1.2/node_modules/safer-buffer/safer.js"(exports, module2) {
    init_import_meta_url();
    var buffer = __require("buffer");
    var Buffer8 = buffer.Buffer;
    var safer = {};
    var key;
    for (key in buffer) {
      if (!buffer.hasOwnProperty(key)) continue;
      if (key === "SlowBuffer" || key === "Buffer") continue;
      safer[key] = buffer[key];
    }
    var Safer = safer.Buffer = {};
    for (key in Buffer8) {
      if (!Buffer8.hasOwnProperty(key)) continue;
      if (key === "allocUnsafe" || key === "allocUnsafeSlow") continue;
      Safer[key] = Buffer8[key];
    }
    safer.Buffer.prototype = Buffer8.prototype;
    if (!Safer.from || Safer.from === Uint8Array.from) {
      Safer.from = function(value, encodingOrOffset, length) {
        if (typeof value === "number") {
          throw new TypeError('The "value" argument must not be of type number. Received type ' + typeof value);
        }
        if (value && typeof value.length === "undefined") {
          throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value);
        }
        return Buffer8(value, encodingOrOffset, length);
      };
    }
    if (!Safer.alloc) {
      Safer.alloc = function(size, fill2, encoding) {
        if (typeof size !== "number") {
          throw new TypeError('The "size" argument must be of type number. Received type ' + typeof size);
        }
        if (size < 0 || size >= 2 * (1 << 30)) {
          throw new RangeError('The value "' + size + '" is invalid for option "size"');
        }
        var buf = Buffer8(size);
        if (!fill2 || fill2.length === 0) {
          buf.fill(0);
        } else if (typeof encoding === "string") {
          buf.fill(fill2, encoding);
        } else {
          buf.fill(fill2);
        }
        return buf;
      };
    }
    if (!safer.kStringMaxLength) {
      try {
        safer.kStringMaxLength = process.binding("buffer").kStringMaxLength;
      } catch (e10) {
      }
    }
    if (!safer.constants) {
      safer.constants = {
        MAX_LENGTH: safer.kMaxLength
      };
      if (safer.kStringMaxLength) {
        safer.constants.MAX_STRING_LENGTH = safer.kStringMaxLength;
      }
    }
    module2.exports = safer;
  }
});

// ../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/lib/bom-handling.js
var require_bom_handling = __commonJS({
  "../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/lib/bom-handling.js"(exports) {
    init_import_meta_url();
    var BOMChar = "\uFEFF";
    exports.PrependBOM = PrependBOMWrapper;
    function PrependBOMWrapper(encoder, options) {
      this.encoder = encoder;
      this.addBOM = true;
    }
    __name(PrependBOMWrapper, "PrependBOMWrapper");
    PrependBOMWrapper.prototype.write = function(str) {
      if (this.addBOM) {
        str = BOMChar + str;
        this.addBOM = false;
      }
      return this.encoder.write(str);
    };
    PrependBOMWrapper.prototype.end = function() {
      return this.encoder.end();
    };
    exports.StripBOM = StripBOMWrapper;
    function StripBOMWrapper(decoder, options) {
      this.decoder = decoder;
      this.pass = false;
      this.options = options || {};
    }
    __name(StripBOMWrapper, "StripBOMWrapper");
    StripBOMWrapper.prototype.write = function(buf) {
      var res = this.decoder.write(buf);
      if (this.pass || !res)
        return res;
      if (res[0] === BOMChar) {
        res = res.slice(1);
        if (typeof this.options.stripBOM === "function")
          this.options.stripBOM();
      }
      this.pass = true;
      return res;
    };
    StripBOMWrapper.prototype.end = function() {
      return this.decoder.end();
    };
  }
});

// ../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/internal.js
var require_internal = __commonJS({
  "../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/internal.js"(exports, module2) {
    init_import_meta_url();
    var Buffer8 = require_safer().Buffer;
    module2.exports = {
      // Encodings
      utf8: { type: "_internal", bomAware: true },
      cesu8: { type: "_internal", bomAware: true },
      unicode11utf8: "utf8",
      ucs2: { type: "_internal", bomAware: true },
      utf16le: "ucs2",
      binary: { type: "_internal" },
      base64: { type: "_internal" },
      hex: { type: "_internal" },
      // Codec.
      _internal: InternalCodec
    };
    function InternalCodec(codecOptions, iconv) {
      this.enc = codecOptions.encodingName;
      this.bomAware = codecOptions.bomAware;
      if (this.enc === "base64")
        this.encoder = InternalEncoderBase64;
      else if (this.enc === "cesu8") {
        this.enc = "utf8";
        this.encoder = InternalEncoderCesu8;
        if (Buffer8.from("eda0bdedb2a9", "hex").toString() !== "\u{1F4A9}") {
          this.decoder = InternalDecoderCesu8;
          this.defaultCharUnicode = iconv.defaultCharUnicode;
        }
      }
    }
    __name(InternalCodec, "InternalCodec");
    InternalCodec.prototype.encoder = InternalEncoder;
    InternalCodec.prototype.decoder = InternalDecoder;
    var StringDecoder2 = __require("string_decoder").StringDecoder;
    if (!StringDecoder2.prototype.end)
      StringDecoder2.prototype.end = function() {
      };
    function InternalDecoder(options, codec) {
      this.decoder = new StringDecoder2(codec.enc);
    }
    __name(InternalDecoder, "InternalDecoder");
    InternalDecoder.prototype.write = function(buf) {
      if (!Buffer8.isBuffer(buf)) {
        buf = Buffer8.from(buf);
      }
      return this.decoder.write(buf);
    };
    InternalDecoder.prototype.end = function() {
      return this.decoder.end();
    };
    function InternalEncoder(options, codec) {
      this.enc = codec.enc;
    }
    __name(InternalEncoder, "InternalEncoder");
    InternalEncoder.prototype.write = function(str) {
      return Buffer8.from(str, this.enc);
    };
    InternalEncoder.prototype.end = function() {
    };
    function InternalEncoderBase64(options, codec) {
      this.prevStr = "";
    }
    __name(InternalEncoderBase64, "InternalEncoderBase64");
    InternalEncoderBase64.prototype.write = function(str) {
      str = this.prevStr + str;
      var completeQuads = str.length - str.length % 4;
      this.prevStr = str.slice(completeQuads);
      str = str.slice(0, completeQuads);
      return Buffer8.from(str, "base64");
    };
    InternalEncoderBase64.prototype.end = function() {
      return Buffer8.from(this.prevStr, "base64");
    };
    function InternalEncoderCesu8(options, codec) {
    }
    __name(InternalEncoderCesu8, "InternalEncoderCesu8");
    InternalEncoderCesu8.prototype.write = function(str) {
      var buf = Buffer8.alloc(str.length * 3), bufIdx = 0;
      for (var i7 = 0; i7 < str.length; i7++) {
        var charCode = str.charCodeAt(i7);
        if (charCode < 128)
          buf[bufIdx++] = charCode;
        else if (charCode < 2048) {
          buf[bufIdx++] = 192 + (charCode >>> 6);
          buf[bufIdx++] = 128 + (charCode & 63);
        } else {
          buf[bufIdx++] = 224 + (charCode >>> 12);
          buf[bufIdx++] = 128 + (charCode >>> 6 & 63);
          buf[bufIdx++] = 128 + (charCode & 63);
        }
      }
      return buf.slice(0, bufIdx);
    };
    InternalEncoderCesu8.prototype.end = function() {
    };
    function InternalDecoderCesu8(options, codec) {
      this.acc = 0;
      this.contBytes = 0;
      this.accBytes = 0;
      this.defaultCharUnicode = codec.defaultCharUnicode;
    }
    __name(InternalDecoderCesu8, "InternalDecoderCesu8");
    InternalDecoderCesu8.prototype.write = function(buf) {
      var acc = this.acc, contBytes = this.contBytes, accBytes = this.accBytes, res = "";
      for (var i7 = 0; i7 < buf.length; i7++) {
        var curByte = buf[i7];
        if ((curByte & 192) !== 128) {
          if (contBytes > 0) {
            res += this.defaultCharUnicode;
            contBytes = 0;
          }
          if (curByte < 128) {
            res += String.fromCharCode(curByte);
          } else if (curByte < 224) {
            acc = curByte & 31;
            contBytes = 1;
            accBytes = 1;
          } else if (curByte < 240) {
            acc = curByte & 15;
            contBytes = 2;
            accBytes = 1;
          } else {
            res += this.defaultCharUnicode;
          }
        } else {
          if (contBytes > 0) {
            acc = acc << 6 | curByte & 63;
            contBytes--;
            accBytes++;
            if (contBytes === 0) {
              if (accBytes === 2 && acc < 128 && acc > 0)
                res += this.defaultCharUnicode;
              else if (accBytes === 3 && acc < 2048)
                res += this.defaultCharUnicode;
              else
                res += String.fromCharCode(acc);
            }
          } else {
            res += this.defaultCharUnicode;
          }
        }
      }
      this.acc = acc;
      this.contBytes = contBytes;
      this.accBytes = accBytes;
      return res;
    };
    InternalDecoderCesu8.prototype.end = function() {
      var res = 0;
      if (this.contBytes > 0)
        res += this.defaultCharUnicode;
      return res;
    };
  }
});

// ../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/utf32.js
var require_utf32 = __commonJS({
  "../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/utf32.js"(exports) {
    init_import_meta_url();
    var Buffer8 = require_safer().Buffer;
    exports._utf32 = Utf32Codec;
    function Utf32Codec(codecOptions, iconv) {
      this.iconv = iconv;
      this.bomAware = true;
      this.isLE = codecOptions.isLE;
    }
    __name(Utf32Codec, "Utf32Codec");
    exports.utf32le = { type: "_utf32", isLE: true };
    exports.utf32be = { type: "_utf32", isLE: false };
    exports.ucs4le = "utf32le";
    exports.ucs4be = "utf32be";
    Utf32Codec.prototype.encoder = Utf32Encoder;
    Utf32Codec.prototype.decoder = Utf32Decoder;
    function Utf32Encoder(options, codec) {
      this.isLE = codec.isLE;
      this.highSurrogate = 0;
    }
    __name(Utf32Encoder, "Utf32Encoder");
    Utf32Encoder.prototype.write = function(str) {
      var src = Buffer8.from(str, "ucs2");
      var dst = Buffer8.alloc(src.length * 2);
      var write32 = this.isLE ? dst.writeUInt32LE : dst.writeUInt32BE;
      var offset = 0;
      for (var i7 = 0; i7 < src.length; i7 += 2) {
        var code = src.readUInt16LE(i7);
        var isHighSurrogate = 55296 <= code && code < 56320;
        var isLowSurrogate = 56320 <= code && code < 57344;
        if (this.highSurrogate) {
          if (isHighSurrogate || !isLowSurrogate) {
            write32.call(dst, this.highSurrogate, offset);
            offset += 4;
          } else {
            var codepoint = (this.highSurrogate - 55296 << 10 | code - 56320) + 65536;
            write32.call(dst, codepoint, offset);
            offset += 4;
            this.highSurrogate = 0;
            continue;
          }
        }
        if (isHighSurrogate)
          this.highSurrogate = code;
        else {
          write32.call(dst, code, offset);
          offset += 4;
          this.highSurrogate = 0;
        }
      }
      if (offset < dst.length)
        dst = dst.slice(0, offset);
      return dst;
    };
    Utf32Encoder.prototype.end = function() {
      if (!this.highSurrogate)
        return;
      var buf = Buffer8.alloc(4);
      if (this.isLE)
        buf.writeUInt32LE(this.highSurrogate, 0);
      else
        buf.writeUInt32BE(this.highSurrogate, 0);
      this.highSurrogate = 0;
      return buf;
    };
    function Utf32Decoder(options, codec) {
      this.isLE = codec.isLE;
      this.badChar = codec.iconv.defaultCharUnicode.charCodeAt(0);
      this.overflow = [];
    }
    __name(Utf32Decoder, "Utf32Decoder");
    Utf32Decoder.prototype.write = function(src) {
      if (src.length === 0)
        return "";
      var i7 = 0;
      var codepoint = 0;
      var dst = Buffer8.alloc(src.length + 4);
      var offset = 0;
      var isLE = this.isLE;
      var overflow = this.overflow;
      var badChar = this.badChar;
      if (overflow.length > 0) {
        for (; i7 < src.length && overflow.length < 4; i7++)
          overflow.push(src[i7]);
        if (overflow.length === 4) {
          if (isLE) {
            codepoint = overflow[i7] | overflow[i7 + 1] << 8 | overflow[i7 + 2] << 16 | overflow[i7 + 3] << 24;
          } else {
            codepoint = overflow[i7 + 3] | overflow[i7 + 2] << 8 | overflow[i7 + 1] << 16 | overflow[i7] << 24;
          }
          overflow.length = 0;
          offset = _writeCodepoint(dst, offset, codepoint, badChar);
        }
      }
      for (; i7 < src.length - 3; i7 += 4) {
        if (isLE) {
          codepoint = src[i7] | src[i7 + 1] << 8 | src[i7 + 2] << 16 | src[i7 + 3] << 24;
        } else {
          codepoint = src[i7 + 3] | src[i7 + 2] << 8 | src[i7 + 1] << 16 | src[i7] << 24;
        }
        offset = _writeCodepoint(dst, offset, codepoint, badChar);
      }
      for (; i7 < src.length; i7++) {
        overflow.push(src[i7]);
      }
      return dst.slice(0, offset).toString("ucs2");
    };
    function _writeCodepoint(dst, offset, codepoint, badChar) {
      if (codepoint < 0 || codepoint > 1114111) {
        codepoint = badChar;
      }
      if (codepoint >= 65536) {
        codepoint -= 65536;
        var high = 55296 | codepoint >> 10;
        dst[offset++] = high & 255;
        dst[offset++] = high >> 8;
        var codepoint = 56320 | codepoint & 1023;
      }
      dst[offset++] = codepoint & 255;
      dst[offset++] = codepoint >> 8;
      return offset;
    }
    __name(_writeCodepoint, "_writeCodepoint");
    Utf32Decoder.prototype.end = function() {
      this.overflow.length = 0;
    };
    exports.utf32 = Utf32AutoCodec;
    exports.ucs4 = "utf32";
    function Utf32AutoCodec(options, iconv) {
      this.iconv = iconv;
    }
    __name(Utf32AutoCodec, "Utf32AutoCodec");
    Utf32AutoCodec.prototype.encoder = Utf32AutoEncoder;
    Utf32AutoCodec.prototype.decoder = Utf32AutoDecoder;
    function Utf32AutoEncoder(options, codec) {
      options = options || {};
      if (options.addBOM === void 0)
        options.addBOM = true;
      this.encoder = codec.iconv.getEncoder(options.defaultEncoding || "utf-32le", options);
    }
    __name(Utf32AutoEncoder, "Utf32AutoEncoder");
    Utf32AutoEncoder.prototype.write = function(str) {
      return this.encoder.write(str);
    };
    Utf32AutoEncoder.prototype.end = function() {
      return this.encoder.end();
    };
    function Utf32AutoDecoder(options, codec) {
      this.decoder = null;
      this.initialBufs = [];
      this.initialBufsLen = 0;
      this.options = options || {};
      this.iconv = codec.iconv;
    }
    __name(Utf32AutoDecoder, "Utf32AutoDecoder");
    Utf32AutoDecoder.prototype.write = function(buf) {
      if (!this.decoder) {
        this.initialBufs.push(buf);
        this.initialBufsLen += buf.length;
        if (this.initialBufsLen < 32)
          return "";
        var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding);
        this.decoder = this.iconv.getDecoder(encoding, this.options);
        var resStr = "";
        for (var i7 = 0; i7 < this.initialBufs.length; i7++)
          resStr += this.decoder.write(this.initialBufs[i7]);
        this.initialBufs.length = this.initialBufsLen = 0;
        return resStr;
      }
      return this.decoder.write(buf);
    };
    Utf32AutoDecoder.prototype.end = function() {
      if (!this.decoder) {
        var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding);
        this.decoder = this.iconv.getDecoder(encoding, this.options);
        var resStr = "";
        for (var i7 = 0; i7 < this.initialBufs.length; i7++)
          resStr += this.decoder.write(this.initialBufs[i7]);
        var trail = this.decoder.end();
        if (trail)
          resStr += trail;
        this.initialBufs.length = this.initialBufsLen = 0;
        return resStr;
      }
      return this.decoder.end();
    };
    function detectEncoding(bufs, defaultEncoding) {
      var b11 = [];
      var charsProcessed = 0;
      var invalidLE = 0, invalidBE = 0;
      var bmpCharsLE = 0, bmpCharsBE = 0;
      outer_loop:
        for (var i7 = 0; i7 < bufs.length; i7++) {
          var buf = bufs[i7];
          for (var j7 = 0; j7 < buf.length; j7++) {
            b11.push(buf[j7]);
            if (b11.length === 4) {
              if (charsProcessed === 0) {
                if (b11[0] === 255 && b11[1] === 254 && b11[2] === 0 && b11[3] === 0) {
                  return "utf-32le";
                }
                if (b11[0] === 0 && b11[1] === 0 && b11[2] === 254 && b11[3] === 255) {
                  return "utf-32be";
                }
              }
              if (b11[0] !== 0 || b11[1] > 16) invalidBE++;
              if (b11[3] !== 0 || b11[2] > 16) invalidLE++;
              if (b11[0] === 0 && b11[1] === 0 && (b11[2] !== 0 || b11[3] !== 0)) bmpCharsBE++;
              if ((b11[0] !== 0 || b11[1] !== 0) && b11[2] === 0 && b11[3] === 0) bmpCharsLE++;
              b11.length = 0;
              charsProcessed++;
              if (charsProcessed >= 100) {
                break outer_loop;
              }
            }
          }
        }
      if (bmpCharsBE - invalidBE > bmpCharsLE - invalidLE) return "utf-32be";
      if (bmpCharsBE - invalidBE < bmpCharsLE - invalidLE) return "utf-32le";
      return defaultEncoding || "utf-32le";
    }
    __name(detectEncoding, "detectEncoding");
  }
});

// ../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/utf16.js
var require_utf16 = __commonJS({
  "../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/utf16.js"(exports) {
    init_import_meta_url();
    var Buffer8 = require_safer().Buffer;
    exports.utf16be = Utf16BECodec;
    function Utf16BECodec() {
    }
    __name(Utf16BECodec, "Utf16BECodec");
    Utf16BECodec.prototype.encoder = Utf16BEEncoder;
    Utf16BECodec.prototype.decoder = Utf16BEDecoder;
    Utf16BECodec.prototype.bomAware = true;
    function Utf16BEEncoder() {
    }
    __name(Utf16BEEncoder, "Utf16BEEncoder");
    Utf16BEEncoder.prototype.write = function(str) {
      var buf = Buffer8.from(str, "ucs2");
      for (var i7 = 0; i7 < buf.length; i7 += 2) {
        var tmp = buf[i7];
        buf[i7] = buf[i7 + 1];
        buf[i7 + 1] = tmp;
      }
      return buf;
    };
    Utf16BEEncoder.prototype.end = function() {
    };
    function Utf16BEDecoder() {
      this.overflowByte = -1;
    }
    __name(Utf16BEDecoder, "Utf16BEDecoder");
    Utf16BEDecoder.prototype.write = function(buf) {
      if (buf.length == 0)
        return "";
      var buf2 = Buffer8.alloc(buf.length + 1), i7 = 0, j7 = 0;
      if (this.overflowByte !== -1) {
        buf2[0] = buf[0];
        buf2[1] = this.overflowByte;
        i7 = 1;
        j7 = 2;
      }
      for (; i7 < buf.length - 1; i7 += 2, j7 += 2) {
        buf2[j7] = buf[i7 + 1];
        buf2[j7 + 1] = buf[i7];
      }
      this.overflowByte = i7 == buf.length - 1 ? buf[buf.length - 1] : -1;
      return buf2.slice(0, j7).toString("ucs2");
    };
    Utf16BEDecoder.prototype.end = function() {
      this.overflowByte = -1;
    };
    exports.utf16 = Utf16Codec;
    function Utf16Codec(codecOptions, iconv) {
      this.iconv = iconv;
    }
    __name(Utf16Codec, "Utf16Codec");
    Utf16Codec.prototype.encoder = Utf16Encoder;
    Utf16Codec.prototype.decoder = Utf16Decoder;
    function Utf16Encoder(options, codec) {
      options = options || {};
      if (options.addBOM === void 0)
        options.addBOM = true;
      this.encoder = codec.iconv.getEncoder("utf-16le", options);
    }
    __name(Utf16Encoder, "Utf16Encoder");
    Utf16Encoder.prototype.write = function(str) {
      return this.encoder.write(str);
    };
    Utf16Encoder.prototype.end = function() {
      return this.encoder.end();
    };
    function Utf16Decoder(options, codec) {
      this.decoder = null;
      this.initialBufs = [];
      this.initialBufsLen = 0;
      this.options = options || {};
      this.iconv = codec.iconv;
    }
    __name(Utf16Decoder, "Utf16Decoder");
    Utf16Decoder.prototype.write = function(buf) {
      if (!this.decoder) {
        this.initialBufs.push(buf);
        this.initialBufsLen += buf.length;
        if (this.initialBufsLen < 16)
          return "";
        var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding);
        this.decoder = this.iconv.getDecoder(encoding, this.options);
        var resStr = "";
        for (var i7 = 0; i7 < this.initialBufs.length; i7++)
          resStr += this.decoder.write(this.initialBufs[i7]);
        this.initialBufs.length = this.initialBufsLen = 0;
        return resStr;
      }
      return this.decoder.write(buf);
    };
    Utf16Decoder.prototype.end = function() {
      if (!this.decoder) {
        var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding);
        this.decoder = this.iconv.getDecoder(encoding, this.options);
        var resStr = "";
        for (var i7 = 0; i7 < this.initialBufs.length; i7++)
          resStr += this.decoder.write(this.initialBufs[i7]);
        var trail = this.decoder.end();
        if (trail)
          resStr += trail;
        this.initialBufs.length = this.initialBufsLen = 0;
        return resStr;
      }
      return this.decoder.end();
    };
    function detectEncoding(bufs, defaultEncoding) {
      var b11 = [];
      var charsProcessed = 0;
      var asciiCharsLE = 0, asciiCharsBE = 0;
      outer_loop:
        for (var i7 = 0; i7 < bufs.length; i7++) {
          var buf = bufs[i7];
          for (var j7 = 0; j7 < buf.length; j7++) {
            b11.push(buf[j7]);
            if (b11.length === 2) {
              if (charsProcessed === 0) {
                if (b11[0] === 255 && b11[1] === 254) return "utf-16le";
                if (b11[0] === 254 && b11[1] === 255) return "utf-16be";
              }
              if (b11[0] === 0 && b11[1] !== 0) asciiCharsBE++;
              if (b11[0] !== 0 && b11[1] === 0) asciiCharsLE++;
              b11.length = 0;
              charsProcessed++;
              if (charsProcessed >= 100) {
                break outer_loop;
              }
            }
          }
        }
      if (asciiCharsBE > asciiCharsLE) return "utf-16be";
      if (asciiCharsBE < asciiCharsLE) return "utf-16le";
      return defaultEncoding || "utf-16le";
    }
    __name(detectEncoding, "detectEncoding");
  }
});

// ../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/utf7.js
var require_utf7 = __commonJS({
  "../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/utf7.js"(exports) {
    init_import_meta_url();
    var Buffer8 = require_safer().Buffer;
    exports.utf7 = Utf7Codec;
    exports.unicode11utf7 = "utf7";
    function Utf7Codec(codecOptions, iconv) {
      this.iconv = iconv;
    }
    __name(Utf7Codec, "Utf7Codec");
    Utf7Codec.prototype.encoder = Utf7Encoder;
    Utf7Codec.prototype.decoder = Utf7Decoder;
    Utf7Codec.prototype.bomAware = true;
    var nonDirectChars = /[^A-Za-z0-9'\(\),-\.\/:\? \n\r\t]+/g;
    function Utf7Encoder(options, codec) {
      this.iconv = codec.iconv;
    }
    __name(Utf7Encoder, "Utf7Encoder");
    Utf7Encoder.prototype.write = function(str) {
      return Buffer8.from(str.replace(nonDirectChars, function(chunk) {
        return "+" + (chunk === "+" ? "" : this.iconv.encode(chunk, "utf16-be").toString("base64").replace(/=+$/, "")) + "-";
      }.bind(this)));
    };
    Utf7Encoder.prototype.end = function() {
    };
    function Utf7Decoder(options, codec) {
      this.iconv = codec.iconv;
      this.inBase64 = false;
      this.base64Accum = "";
    }
    __name(Utf7Decoder, "Utf7Decoder");
    var base64Regex2 = /[A-Za-z0-9\/+]/;
    var base64Chars = [];
    for (i7 = 0; i7 < 256; i7++)
      base64Chars[i7] = base64Regex2.test(String.fromCharCode(i7));
    var i7;
    var plusChar = "+".charCodeAt(0);
    var minusChar = "-".charCodeAt(0);
    var andChar = "&".charCodeAt(0);
    Utf7Decoder.prototype.write = function(buf) {
      var res = "", lastI = 0, inBase64 = this.inBase64, base64Accum = this.base64Accum;
      for (var i8 = 0; i8 < buf.length; i8++) {
        if (!inBase64) {
          if (buf[i8] == plusChar) {
            res += this.iconv.decode(buf.slice(lastI, i8), "ascii");
            lastI = i8 + 1;
            inBase64 = true;
          }
        } else {
          if (!base64Chars[buf[i8]]) {
            if (i8 == lastI && buf[i8] == minusChar) {
              res += "+";
            } else {
              var b64str = base64Accum + this.iconv.decode(buf.slice(lastI, i8), "ascii");
              res += this.iconv.decode(Buffer8.from(b64str, "base64"), "utf16-be");
            }
            if (buf[i8] != minusChar)
              i8--;
            lastI = i8 + 1;
            inBase64 = false;
            base64Accum = "";
          }
        }
      }
      if (!inBase64) {
        res += this.iconv.decode(buf.slice(lastI), "ascii");
      } else {
        var b64str = base64Accum + this.iconv.decode(buf.slice(lastI), "ascii");
        var canBeDecoded = b64str.length - b64str.length % 8;
        base64Accum = b64str.slice(canBeDecoded);
        b64str = b64str.slice(0, canBeDecoded);
        res += this.iconv.decode(Buffer8.from(b64str, "base64"), "utf16-be");
      }
      this.inBase64 = inBase64;
      this.base64Accum = base64Accum;
      return res;
    };
    Utf7Decoder.prototype.end = function() {
      var res = "";
      if (this.inBase64 && this.base64Accum.length > 0)
        res = this.iconv.decode(Buffer8.from(this.base64Accum, "base64"), "utf16-be");
      this.inBase64 = false;
      this.base64Accum = "";
      return res;
    };
    exports.utf7imap = Utf7IMAPCodec;
    function Utf7IMAPCodec(codecOptions, iconv) {
      this.iconv = iconv;
    }
    __name(Utf7IMAPCodec, "Utf7IMAPCodec");
    Utf7IMAPCodec.prototype.encoder = Utf7IMAPEncoder;
    Utf7IMAPCodec.prototype.decoder = Utf7IMAPDecoder;
    Utf7IMAPCodec.prototype.bomAware = true;
    function Utf7IMAPEncoder(options, codec) {
      this.iconv = codec.iconv;
      this.inBase64 = false;
      this.base64Accum = Buffer8.alloc(6);
      this.base64AccumIdx = 0;
    }
    __name(Utf7IMAPEncoder, "Utf7IMAPEncoder");
    Utf7IMAPEncoder.prototype.write = function(str) {
      var inBase64 = this.inBase64, base64Accum = this.base64Accum, base64AccumIdx = this.base64AccumIdx, buf = Buffer8.alloc(str.length * 5 + 10), bufIdx = 0;
      for (var i8 = 0; i8 < str.length; i8++) {
        var uChar = str.charCodeAt(i8);
        if (32 <= uChar && uChar <= 126) {
          if (inBase64) {
            if (base64AccumIdx > 0) {
              bufIdx += buf.write(base64Accum.slice(0, base64AccumIdx).toString("base64").replace(/\//g, ",").replace(/=+$/, ""), bufIdx);
              base64AccumIdx = 0;
            }
            buf[bufIdx++] = minusChar;
            inBase64 = false;
          }
          if (!inBase64) {
            buf[bufIdx++] = uChar;
            if (uChar === andChar)
              buf[bufIdx++] = minusChar;
          }
        } else {
          if (!inBase64) {
            buf[bufIdx++] = andChar;
            inBase64 = true;
          }
          if (inBase64) {
            base64Accum[base64AccumIdx++] = uChar >> 8;
            base64Accum[base64AccumIdx++] = uChar & 255;
            if (base64AccumIdx == base64Accum.length) {
              bufIdx += buf.write(base64Accum.toString("base64").replace(/\//g, ","), bufIdx);
              base64AccumIdx = 0;
            }
          }
        }
      }
      this.inBase64 = inBase64;
      this.base64AccumIdx = base64AccumIdx;
      return buf.slice(0, bufIdx);
    };
    Utf7IMAPEncoder.prototype.end = function() {
      var buf = Buffer8.alloc(10), bufIdx = 0;
      if (this.inBase64) {
        if (this.base64AccumIdx > 0) {
          bufIdx += buf.write(this.base64Accum.slice(0, this.base64AccumIdx).toString("base64").replace(/\//g, ",").replace(/=+$/, ""), bufIdx);
          this.base64AccumIdx = 0;
        }
        buf[bufIdx++] = minusChar;
        this.inBase64 = false;
      }
      return buf.slice(0, bufIdx);
    };
    function Utf7IMAPDecoder(options, codec) {
      this.iconv = codec.iconv;
      this.inBase64 = false;
      this.base64Accum = "";
    }
    __name(Utf7IMAPDecoder, "Utf7IMAPDecoder");
    var base64IMAPChars = base64Chars.slice();
    base64IMAPChars[",".charCodeAt(0)] = true;
    Utf7IMAPDecoder.prototype.write = function(buf) {
      var res = "", lastI = 0, inBase64 = this.inBase64, base64Accum = this.base64Accum;
      for (var i8 = 0; i8 < buf.length; i8++) {
        if (!inBase64) {
          if (buf[i8] == andChar) {
            res += this.iconv.decode(buf.slice(lastI, i8), "ascii");
            lastI = i8 + 1;
            inBase64 = true;
          }
        } else {
          if (!base64IMAPChars[buf[i8]]) {
            if (i8 == lastI && buf[i8] == minusChar) {
              res += "&";
            } else {
              var b64str = base64Accum + this.iconv.decode(buf.slice(lastI, i8), "ascii").replace(/,/g, "/");
              res += this.iconv.decode(Buffer8.from(b64str, "base64"), "utf16-be");
            }
            if (buf[i8] != minusChar)
              i8--;
            lastI = i8 + 1;
            inBase64 = false;
            base64Accum = "";
          }
        }
      }
      if (!inBase64) {
        res += this.iconv.decode(buf.slice(lastI), "ascii");
      } else {
        var b64str = base64Accum + this.iconv.decode(buf.slice(lastI), "ascii").replace(/,/g, "/");
        var canBeDecoded = b64str.length - b64str.length % 8;
        base64Accum = b64str.slice(canBeDecoded);
        b64str = b64str.slice(0, canBeDecoded);
        res += this.iconv.decode(Buffer8.from(b64str, "base64"), "utf16-be");
      }
      this.inBase64 = inBase64;
      this.base64Accum = base64Accum;
      return res;
    };
    Utf7IMAPDecoder.prototype.end = function() {
      var res = "";
      if (this.inBase64 && this.base64Accum.length > 0)
        res = this.iconv.decode(Buffer8.from(this.base64Accum, "base64"), "utf16-be");
      this.inBase64 = false;
      this.base64Accum = "";
      return res;
    };
  }
});

// ../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/sbcs-codec.js
var require_sbcs_codec = __commonJS({
  "../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/sbcs-codec.js"(exports) {
    init_import_meta_url();
    var Buffer8 = require_safer().Buffer;
    exports._sbcs = SBCSCodec;
    function SBCSCodec(codecOptions, iconv) {
      if (!codecOptions)
        throw new Error("SBCS codec is called without the data.");
      if (!codecOptions.chars || codecOptions.chars.length !== 128 && codecOptions.chars.length !== 256)
        throw new Error("Encoding '" + codecOptions.type + "' has incorrect 'chars' (must be of len 128 or 256)");
      if (codecOptions.chars.length === 128) {
        var asciiString = "";
        for (var i7 = 0; i7 < 128; i7++)
          asciiString += String.fromCharCode(i7);
        codecOptions.chars = asciiString + codecOptions.chars;
      }
      this.decodeBuf = Buffer8.from(codecOptions.chars, "ucs2");
      var encodeBuf = Buffer8.alloc(65536, iconv.defaultCharSingleByte.charCodeAt(0));
      for (var i7 = 0; i7 < codecOptions.chars.length; i7++)
        encodeBuf[codecOptions.chars.charCodeAt(i7)] = i7;
      this.encodeBuf = encodeBuf;
    }
    __name(SBCSCodec, "SBCSCodec");
    SBCSCodec.prototype.encoder = SBCSEncoder;
    SBCSCodec.prototype.decoder = SBCSDecoder;
    function SBCSEncoder(options, codec) {
      this.encodeBuf = codec.encodeBuf;
    }
    __name(SBCSEncoder, "SBCSEncoder");
    SBCSEncoder.prototype.write = function(str) {
      var buf = Buffer8.alloc(str.length);
      for (var i7 = 0; i7 < str.length; i7++)
        buf[i7] = this.encodeBuf[str.charCodeAt(i7)];
      return buf;
    };
    SBCSEncoder.prototype.end = function() {
    };
    function SBCSDecoder(options, codec) {
      this.decodeBuf = codec.decodeBuf;
    }
    __name(SBCSDecoder, "SBCSDecoder");
    SBCSDecoder.prototype.write = function(buf) {
      var decodeBuf = this.decodeBuf;
      var newBuf = Buffer8.alloc(buf.length * 2);
      var idx1 = 0, idx2 = 0;
      for (var i7 = 0; i7 < buf.length; i7++) {
        idx1 = buf[i7] * 2;
        idx2 = i7 * 2;
        newBuf[idx2] = decodeBuf[idx1];
        newBuf[idx2 + 1] = decodeBuf[idx1 + 1];
      }
      return newBuf.toString("ucs2");
    };
    SBCSDecoder.prototype.end = function() {
    };
  }
});

// ../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/sbcs-data.js
var require_sbcs_data = __commonJS({
  "../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/sbcs-data.js"(exports, module2) {
    init_import_meta_url();
    module2.exports = {
      // Not supported by iconv, not sure why.
      "10029": "maccenteuro",
      "maccenteuro": {
        "type": "_sbcs",
        "chars": "\xC4\u0100\u0101\xC9\u0104\xD6\xDC\xE1\u0105\u010C\xE4\u010D\u0106\u0107\xE9\u0179\u017A\u010E\xED\u010F\u0112\u0113\u0116\xF3\u0117\xF4\xF6\xF5\xFA\u011A\u011B\xFC\u2020\xB0\u0118\xA3\xA7\u2022\xB6\xDF\xAE\xA9\u2122\u0119\xA8\u2260\u0123\u012E\u012F\u012A\u2264\u2265\u012B\u0136\u2202\u2211\u0142\u013B\u013C\u013D\u013E\u0139\u013A\u0145\u0146\u0143\xAC\u221A\u0144\u0147\u2206\xAB\xBB\u2026\xA0\u0148\u0150\xD5\u0151\u014C\u2013\u2014\u201C\u201D\u2018\u2019\xF7\u25CA\u014D\u0154\u0155\u0158\u2039\u203A\u0159\u0156\u0157\u0160\u201A\u201E\u0161\u015A\u015B\xC1\u0164\u0165\xCD\u017D\u017E\u016A\xD3\xD4\u016B\u016E\xDA\u016F\u0170\u0171\u0172\u0173\xDD\xFD\u0137\u017B\u0141\u017C\u0122\u02C7"
      },
      "808": "cp808",
      "ibm808": "cp808",
      "cp808": {
        "type": "_sbcs",
        "chars": "\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042A\u042B\u042C\u042D\u042E\u042F\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043A\u043B\u043C\u043D\u043E\u043F\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044A\u044B\u044C\u044D\u044E\u044F\u0401\u0451\u0404\u0454\u0407\u0457\u040E\u045E\xB0\u2219\xB7\u221A\u2116\u20AC\u25A0\xA0"
      },
      "mik": {
        "type": "_sbcs",
        "chars": "\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042A\u042B\u042C\u042D\u042E\u042F\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043A\u043B\u043C\u043D\u043E\u043F\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044A\u044B\u044C\u044D\u044E\u044F\u2514\u2534\u252C\u251C\u2500\u253C\u2563\u2551\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2510\u2591\u2592\u2593\u2502\u2524\u2116\xA7\u2557\u255D\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0"
      },
      "cp720": {
        "type": "_sbcs",
        "chars": "\x80\x81\xE9\xE2\x84\xE0\x86\xE7\xEA\xEB\xE8\xEF\xEE\x8D\x8E\x8F\x90\u0651\u0652\xF4\xA4\u0640\xFB\xF9\u0621\u0622\u0623\u0624\xA3\u0625\u0626\u0627\u0628\u0629\u062A\u062B\u062C\u062D\u062E\u062F\u0630\u0631\u0632\u0633\u0634\u0635\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u0636\u0637\u0638\u0639\u063A\u0641\xB5\u0642\u0643\u0644\u0645\u0646\u0647\u0648\u0649\u064A\u2261\u064B\u064C\u064D\u064E\u064F\u0650\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0"
      },
      // Aliases of generated encodings.
      "ascii8bit": "ascii",
      "usascii": "ascii",
      "ansix34": "ascii",
      "ansix341968": "ascii",
      "ansix341986": "ascii",
      "csascii": "ascii",
      "cp367": "ascii",
      "ibm367": "ascii",
      "isoir6": "ascii",
      "iso646us": "ascii",
      "iso646irv": "ascii",
      "us": "ascii",
      "latin1": "iso88591",
      "latin2": "iso88592",
      "latin3": "iso88593",
      "latin4": "iso88594",
      "latin5": "iso88599",
      "latin6": "iso885910",
      "latin7": "iso885913",
      "latin8": "iso885914",
      "latin9": "iso885915",
      "latin10": "iso885916",
      "csisolatin1": "iso88591",
      "csisolatin2": "iso88592",
      "csisolatin3": "iso88593",
      "csisolatin4": "iso88594",
      "csisolatincyrillic": "iso88595",
      "csisolatinarabic": "iso88596",
      "csisolatingreek": "iso88597",
      "csisolatinhebrew": "iso88598",
      "csisolatin5": "iso88599",
      "csisolatin6": "iso885910",
      "l1": "iso88591",
      "l2": "iso88592",
      "l3": "iso88593",
      "l4": "iso88594",
      "l5": "iso88599",
      "l6": "iso885910",
      "l7": "iso885913",
      "l8": "iso885914",
      "l9": "iso885915",
      "l10": "iso885916",
      "isoir14": "iso646jp",
      "isoir57": "iso646cn",
      "isoir100": "iso88591",
      "isoir101": "iso88592",
      "isoir109": "iso88593",
      "isoir110": "iso88594",
      "isoir144": "iso88595",
      "isoir127": "iso88596",
      "isoir126": "iso88597",
      "isoir138": "iso88598",
      "isoir148": "iso88599",
      "isoir157": "iso885910",
      "isoir166": "tis620",
      "isoir179": "iso885913",
      "isoir199": "iso885914",
      "isoir203": "iso885915",
      "isoir226": "iso885916",
      "cp819": "iso88591",
      "ibm819": "iso88591",
      "cyrillic": "iso88595",
      "arabic": "iso88596",
      "arabic8": "iso88596",
      "ecma114": "iso88596",
      "asmo708": "iso88596",
      "greek": "iso88597",
      "greek8": "iso88597",
      "ecma118": "iso88597",
      "elot928": "iso88597",
      "hebrew": "iso88598",
      "hebrew8": "iso88598",
      "turkish": "iso88599",
      "turkish8": "iso88599",
      "thai": "iso885911",
      "thai8": "iso885911",
      "celtic": "iso885914",
      "celtic8": "iso885914",
      "isoceltic": "iso885914",
      "tis6200": "tis620",
      "tis62025291": "tis620",
      "tis62025330": "tis620",
      "10000": "macroman",
      "10006": "macgreek",
      "10007": "maccyrillic",
      "10079": "maciceland",
      "10081": "macturkish",
      "cspc8codepage437": "cp437",
      "cspc775baltic": "cp775",
      "cspc850multilingual": "cp850",
      "cspcp852": "cp852",
      "cspc862latinhebrew": "cp862",
      "cpgr": "cp869",
      "msee": "cp1250",
      "mscyrl": "cp1251",
      "msansi": "cp1252",
      "msgreek": "cp1253",
      "msturk": "cp1254",
      "mshebr": "cp1255",
      "msarab": "cp1256",
      "winbaltrim": "cp1257",
      "cp20866": "koi8r",
      "20866": "koi8r",
      "ibm878": "koi8r",
      "cskoi8r": "koi8r",
      "cp21866": "koi8u",
      "21866": "koi8u",
      "ibm1168": "koi8u",
      "strk10482002": "rk1048",
      "tcvn5712": "tcvn",
      "tcvn57121": "tcvn",
      "gb198880": "iso646cn",
      "cn": "iso646cn",
      "csiso14jisc6220ro": "iso646jp",
      "jisc62201969ro": "iso646jp",
      "jp": "iso646jp",
      "cshproman8": "hproman8",
      "r8": "hproman8",
      "roman8": "hproman8",
      "xroman8": "hproman8",
      "ibm1051": "hproman8",
      "mac": "macintosh",
      "csmacintosh": "macintosh"
    };
  }
});

// ../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/sbcs-data-generated.js
var require_sbcs_data_generated = __commonJS({
  "../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/sbcs-data-generated.js"(exports, module2) {
    init_import_meta_url();
    module2.exports = {
      "437": "cp437",
      "737": "cp737",
      "775": "cp775",
      "850": "cp850",
      "852": "cp852",
      "855": "cp855",
      "856": "cp856",
      "857": "cp857",
      "858": "cp858",
      "860": "cp860",
      "861": "cp861",
      "862": "cp862",
      "863": "cp863",
      "864": "cp864",
      "865": "cp865",
      "866": "cp866",
      "869": "cp869",
      "874": "windows874",
      "922": "cp922",
      "1046": "cp1046",
      "1124": "cp1124",
      "1125": "cp1125",
      "1129": "cp1129",
      "1133": "cp1133",
      "1161": "cp1161",
      "1162": "cp1162",
      "1163": "cp1163",
      "1250": "windows1250",
      "1251": "windows1251",
      "1252": "windows1252",
      "1253": "windows1253",
      "1254": "windows1254",
      "1255": "windows1255",
      "1256": "windows1256",
      "1257": "windows1257",
      "1258": "windows1258",
      "28591": "iso88591",
      "28592": "iso88592",
      "28593": "iso88593",
      "28594": "iso88594",
      "28595": "iso88595",
      "28596": "iso88596",
      "28597": "iso88597",
      "28598": "iso88598",
      "28599": "iso88599",
      "28600": "iso885910",
      "28601": "iso885911",
      "28603": "iso885913",
      "28604": "iso885914",
      "28605": "iso885915",
      "28606": "iso885916",
      "windows874": {
        "type": "_sbcs",
        "chars": "\u20AC\uFFFD\uFFFD\uFFFD\uFFFD\u2026\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u2018\u2019\u201C\u201D\u2022\u2013\u2014\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\xA0\u0E01\u0E02\u0E03\u0E04\u0E05\u0E06\u0E07\u0E08\u0E09\u0E0A\u0E0B\u0E0C\u0E0D\u0E0E\u0E0F\u0E10\u0E11\u0E12\u0E13\u0E14\u0E15\u0E16\u0E17\u0E18\u0E19\u0E1A\u0E1B\u0E1C\u0E1D\u0E1E\u0E1F\u0E20\u0E21\u0E22\u0E23\u0E24\u0E25\u0E26\u0E27\u0E28\u0E29\u0E2A\u0E2B\u0E2C\u0E2D\u0E2E\u0E2F\u0E30\u0E31\u0E32\u0E33\u0E34\u0E35\u0E36\u0E37\u0E38\u0E39\u0E3A\uFFFD\uFFFD\uFFFD\uFFFD\u0E3F\u0E40\u0E41\u0E42\u0E43\u0E44\u0E45\u0E46\u0E47\u0E48\u0E49\u0E4A\u0E4B\u0E4C\u0E4D\u0E4E\u0E4F\u0E50\u0E51\u0E52\u0E53\u0E54\u0E55\u0E56\u0E57\u0E58\u0E59\u0E5A\u0E5B\uFFFD\uFFFD\uFFFD\uFFFD"
      },
      "win874": "windows874",
      "cp874": "windows874",
      "windows1250": {
        "type": "_sbcs",
        "chars": "\u20AC\uFFFD\u201A\uFFFD\u201E\u2026\u2020\u2021\uFFFD\u2030\u0160\u2039\u015A\u0164\u017D\u0179\uFFFD\u2018\u2019\u201C\u201D\u2022\u2013\u2014\uFFFD\u2122\u0161\u203A\u015B\u0165\u017E\u017A\xA0\u02C7\u02D8\u0141\xA4\u0104\xA6\xA7\xA8\xA9\u015E\xAB\xAC\xAD\xAE\u017B\xB0\xB1\u02DB\u0142\xB4\xB5\xB6\xB7\xB8\u0105\u015F\xBB\u013D\u02DD\u013E\u017C\u0154\xC1\xC2\u0102\xC4\u0139\u0106\xC7\u010C\xC9\u0118\xCB\u011A\xCD\xCE\u010E\u0110\u0143\u0147\xD3\xD4\u0150\xD6\xD7\u0158\u016E\xDA\u0170\xDC\xDD\u0162\xDF\u0155\xE1\xE2\u0103\xE4\u013A\u0107\xE7\u010D\xE9\u0119\xEB\u011B\xED\xEE\u010F\u0111\u0144\u0148\xF3\xF4\u0151\xF6\xF7\u0159\u016F\xFA\u0171\xFC\xFD\u0163\u02D9"
      },
      "win1250": "windows1250",
      "cp1250": "windows1250",
      "windows1251": {
        "type": "_sbcs",
        "chars": "\u0402\u0403\u201A\u0453\u201E\u2026\u2020\u2021\u20AC\u2030\u0409\u2039\u040A\u040C\u040B\u040F\u0452\u2018\u2019\u201C\u201D\u2022\u2013\u2014\uFFFD\u2122\u0459\u203A\u045A\u045C\u045B\u045F\xA0\u040E\u045E\u0408\xA4\u0490\xA6\xA7\u0401\xA9\u0404\xAB\xAC\xAD\xAE\u0407\xB0\xB1\u0406\u0456\u0491\xB5\xB6\xB7\u0451\u2116\u0454\xBB\u0458\u0405\u0455\u0457\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042A\u042B\u042C\u042D\u042E\u042F\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043A\u043B\u043C\u043D\u043E\u043F\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044A\u044B\u044C\u044D\u044E\u044F"
      },
      "win1251": "windows1251",
      "cp1251": "windows1251",
      "windows1252": {
        "type": "_sbcs",
        "chars": "\u20AC\uFFFD\u201A\u0192\u201E\u2026\u2020\u2021\u02C6\u2030\u0160\u2039\u0152\uFFFD\u017D\uFFFD\uFFFD\u2018\u2019\u201C\u201D\u2022\u2013\u2014\u02DC\u2122\u0161\u203A\u0153\uFFFD\u017E\u0178\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF"
      },
      "win1252": "windows1252",
      "cp1252": "windows1252",
      "windows1253": {
        "type": "_sbcs",
        "chars": "\u20AC\uFFFD\u201A\u0192\u201E\u2026\u2020\u2021\uFFFD\u2030\uFFFD\u2039\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u2018\u2019\u201C\u201D\u2022\u2013\u2014\uFFFD\u2122\uFFFD\u203A\uFFFD\uFFFD\uFFFD\uFFFD\xA0\u0385\u0386\xA3\xA4\xA5\xA6\xA7\xA8\xA9\uFFFD\xAB\xAC\xAD\xAE\u2015\xB0\xB1\xB2\xB3\u0384\xB5\xB6\xB7\u0388\u0389\u038A\xBB\u038C\xBD\u038E\u038F\u0390\u0391\u0392\u0393\u0394\u0395\u0396\u0397\u0398\u0399\u039A\u039B\u039C\u039D\u039E\u039F\u03A0\u03A1\uFFFD\u03A3\u03A4\u03A5\u03A6\u03A7\u03A8\u03A9\u03AA\u03AB\u03AC\u03AD\u03AE\u03AF\u03B0\u03B1\u03B2\u03B3\u03B4\u03B5\u03B6\u03B7\u03B8\u03B9\u03BA\u03BB\u03BC\u03BD\u03BE\u03BF\u03C0\u03C1\u03C2\u03C3\u03C4\u03C5\u03C6\u03C7\u03C8\u03C9\u03CA\u03CB\u03CC\u03CD\u03CE\uFFFD"
      },
      "win1253": "windows1253",
      "cp1253": "windows1253",
      "windows1254": {
        "type": "_sbcs",
        "chars": "\u20AC\uFFFD\u201A\u0192\u201E\u2026\u2020\u2021\u02C6\u2030\u0160\u2039\u0152\uFFFD\uFFFD\uFFFD\uFFFD\u2018\u2019\u201C\u201D\u2022\u2013\u2014\u02DC\u2122\u0161\u203A\u0153\uFFFD\uFFFD\u0178\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\u011E\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\u0130\u015E\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\u011F\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\u0131\u015F\xFF"
      },
      "win1254": "windows1254",
      "cp1254": "windows1254",
      "windows1255": {
        "type": "_sbcs",
        "chars": "\u20AC\uFFFD\u201A\u0192\u201E\u2026\u2020\u2021\u02C6\u2030\uFFFD\u2039\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u2018\u2019\u201C\u201D\u2022\u2013\u2014\u02DC\u2122\uFFFD\u203A\uFFFD\uFFFD\uFFFD\uFFFD\xA0\xA1\xA2\xA3\u20AA\xA5\xA6\xA7\xA8\xA9\xD7\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xF7\xBB\xBC\xBD\xBE\xBF\u05B0\u05B1\u05B2\u05B3\u05B4\u05B5\u05B6\u05B7\u05B8\u05B9\u05BA\u05BB\u05BC\u05BD\u05BE\u05BF\u05C0\u05C1\u05C2\u05C3\u05F0\u05F1\u05F2\u05F3\u05F4\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u05D0\u05D1\u05D2\u05D3\u05D4\u05D5\u05D6\u05D7\u05D8\u05D9\u05DA\u05DB\u05DC\u05DD\u05DE\u05DF\u05E0\u05E1\u05E2\u05E3\u05E4\u05E5\u05E6\u05E7\u05E8\u05E9\u05EA\uFFFD\uFFFD\u200E\u200F\uFFFD"
      },
      "win1255": "windows1255",
      "cp1255": "windows1255",
      "windows1256": {
        "type": "_sbcs",
        "chars": "\u20AC\u067E\u201A\u0192\u201E\u2026\u2020\u2021\u02C6\u2030\u0679\u2039\u0152\u0686\u0698\u0688\u06AF\u2018\u2019\u201C\u201D\u2022\u2013\u2014\u06A9\u2122\u0691\u203A\u0153\u200C\u200D\u06BA\xA0\u060C\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\u06BE\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\u061B\xBB\xBC\xBD\xBE\u061F\u06C1\u0621\u0622\u0623\u0624\u0625\u0626\u0627\u0628\u0629\u062A\u062B\u062C\u062D\u062E\u062F\u0630\u0631\u0632\u0633\u0634\u0635\u0636\xD7\u0637\u0638\u0639\u063A\u0640\u0641\u0642\u0643\xE0\u0644\xE2\u0645\u0646\u0647\u0648\xE7\xE8\xE9\xEA\xEB\u0649\u064A\xEE\xEF\u064B\u064C\u064D\u064E\xF4\u064F\u0650\xF7\u0651\xF9\u0652\xFB\xFC\u200E\u200F\u06D2"
      },
      "win1256": "windows1256",
      "cp1256": "windows1256",
      "windows1257": {
        "type": "_sbcs",
        "chars": "\u20AC\uFFFD\u201A\uFFFD\u201E\u2026\u2020\u2021\uFFFD\u2030\uFFFD\u2039\uFFFD\xA8\u02C7\xB8\uFFFD\u2018\u2019\u201C\u201D\u2022\u2013\u2014\uFFFD\u2122\uFFFD\u203A\uFFFD\xAF\u02DB\uFFFD\xA0\uFFFD\xA2\xA3\xA4\uFFFD\xA6\xA7\xD8\xA9\u0156\xAB\xAC\xAD\xAE\xC6\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xF8\xB9\u0157\xBB\xBC\xBD\xBE\xE6\u0104\u012E\u0100\u0106\xC4\xC5\u0118\u0112\u010C\xC9\u0179\u0116\u0122\u0136\u012A\u013B\u0160\u0143\u0145\xD3\u014C\xD5\xD6\xD7\u0172\u0141\u015A\u016A\xDC\u017B\u017D\xDF\u0105\u012F\u0101\u0107\xE4\xE5\u0119\u0113\u010D\xE9\u017A\u0117\u0123\u0137\u012B\u013C\u0161\u0144\u0146\xF3\u014D\xF5\xF6\xF7\u0173\u0142\u015B\u016B\xFC\u017C\u017E\u02D9"
      },
      "win1257": "windows1257",
      "cp1257": "windows1257",
      "windows1258": {
        "type": "_sbcs",
        "chars": "\u20AC\uFFFD\u201A\u0192\u201E\u2026\u2020\u2021\u02C6\u2030\uFFFD\u2039\u0152\uFFFD\uFFFD\uFFFD\uFFFD\u2018\u2019\u201C\u201D\u2022\u2013\u2014\u02DC\u2122\uFFFD\u203A\u0153\uFFFD\uFFFD\u0178\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\u0102\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\u0300\xCD\xCE\xCF\u0110\xD1\u0309\xD3\xD4\u01A0\xD6\xD7\xD8\xD9\xDA\xDB\xDC\u01AF\u0303\xDF\xE0\xE1\xE2\u0103\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\u0301\xED\xEE\xEF\u0111\xF1\u0323\xF3\xF4\u01A1\xF6\xF7\xF8\xF9\xFA\xFB\xFC\u01B0\u20AB\xFF"
      },
      "win1258": "windows1258",
      "cp1258": "windows1258",
      "iso88591": {
        "type": "_sbcs",
        "chars": "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF"
      },
      "cp28591": "iso88591",
      "iso88592": {
        "type": "_sbcs",
        "chars": "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\u0104\u02D8\u0141\xA4\u013D\u015A\xA7\xA8\u0160\u015E\u0164\u0179\xAD\u017D\u017B\xB0\u0105\u02DB\u0142\xB4\u013E\u015B\u02C7\xB8\u0161\u015F\u0165\u017A\u02DD\u017E\u017C\u0154\xC1\xC2\u0102\xC4\u0139\u0106\xC7\u010C\xC9\u0118\xCB\u011A\xCD\xCE\u010E\u0110\u0143\u0147\xD3\xD4\u0150\xD6\xD7\u0158\u016E\xDA\u0170\xDC\xDD\u0162\xDF\u0155\xE1\xE2\u0103\xE4\u013A\u0107\xE7\u010D\xE9\u0119\xEB\u011B\xED\xEE\u010F\u0111\u0144\u0148\xF3\xF4\u0151\xF6\xF7\u0159\u016F\xFA\u0171\xFC\xFD\u0163\u02D9"
      },
      "cp28592": "iso88592",
      "iso88593": {
        "type": "_sbcs",
        "chars": "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\u0126\u02D8\xA3\xA4\uFFFD\u0124\xA7\xA8\u0130\u015E\u011E\u0134\xAD\uFFFD\u017B\xB0\u0127\xB2\xB3\xB4\xB5\u0125\xB7\xB8\u0131\u015F\u011F\u0135\xBD\uFFFD\u017C\xC0\xC1\xC2\uFFFD\xC4\u010A\u0108\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\uFFFD\xD1\xD2\xD3\xD4\u0120\xD6\xD7\u011C\xD9\xDA\xDB\xDC\u016C\u015C\xDF\xE0\xE1\xE2\uFFFD\xE4\u010B\u0109\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\uFFFD\xF1\xF2\xF3\xF4\u0121\xF6\xF7\u011D\xF9\xFA\xFB\xFC\u016D\u015D\u02D9"
      },
      "cp28593": "iso88593",
      "iso88594": {
        "type": "_sbcs",
        "chars": "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\u0104\u0138\u0156\xA4\u0128\u013B\xA7\xA8\u0160\u0112\u0122\u0166\xAD\u017D\xAF\xB0\u0105\u02DB\u0157\xB4\u0129\u013C\u02C7\xB8\u0161\u0113\u0123\u0167\u014A\u017E\u014B\u0100\xC1\xC2\xC3\xC4\xC5\xC6\u012E\u010C\xC9\u0118\xCB\u0116\xCD\xCE\u012A\u0110\u0145\u014C\u0136\xD4\xD5\xD6\xD7\xD8\u0172\xDA\xDB\xDC\u0168\u016A\xDF\u0101\xE1\xE2\xE3\xE4\xE5\xE6\u012F\u010D\xE9\u0119\xEB\u0117\xED\xEE\u012B\u0111\u0146\u014D\u0137\xF4\xF5\xF6\xF7\xF8\u0173\xFA\xFB\xFC\u0169\u016B\u02D9"
      },
      "cp28594": "iso88594",
      "iso88595": {
        "type": "_sbcs",
        "chars": "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\u0401\u0402\u0403\u0404\u0405\u0406\u0407\u0408\u0409\u040A\u040B\u040C\xAD\u040E\u040F\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042A\u042B\u042C\u042D\u042E\u042F\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043A\u043B\u043C\u043D\u043E\u043F\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044A\u044B\u044C\u044D\u044E\u044F\u2116\u0451\u0452\u0453\u0454\u0455\u0456\u0457\u0458\u0459\u045A\u045B\u045C\xA7\u045E\u045F"
      },
      "cp28595": "iso88595",
      "iso88596": {
        "type": "_sbcs",
        "chars": "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\uFFFD\uFFFD\uFFFD\xA4\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u060C\xAD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u061B\uFFFD\uFFFD\uFFFD\u061F\uFFFD\u0621\u0622\u0623\u0624\u0625\u0626\u0627\u0628\u0629\u062A\u062B\u062C\u062D\u062E\u062F\u0630\u0631\u0632\u0633\u0634\u0635\u0636\u0637\u0638\u0639\u063A\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u0640\u0641\u0642\u0643\u0644\u0645\u0646\u0647\u0648\u0649\u064A\u064B\u064C\u064D\u064E\u064F\u0650\u0651\u0652\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"
      },
      "cp28596": "iso88596",
      "iso88597": {
        "type": "_sbcs",
        "chars": "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\u2018\u2019\xA3\u20AC\u20AF\xA6\xA7\xA8\xA9\u037A\xAB\xAC\xAD\uFFFD\u2015\xB0\xB1\xB2\xB3\u0384\u0385\u0386\xB7\u0388\u0389\u038A\xBB\u038C\xBD\u038E\u038F\u0390\u0391\u0392\u0393\u0394\u0395\u0396\u0397\u0398\u0399\u039A\u039B\u039C\u039D\u039E\u039F\u03A0\u03A1\uFFFD\u03A3\u03A4\u03A5\u03A6\u03A7\u03A8\u03A9\u03AA\u03AB\u03AC\u03AD\u03AE\u03AF\u03B0\u03B1\u03B2\u03B3\u03B4\u03B5\u03B6\u03B7\u03B8\u03B9\u03BA\u03BB\u03BC\u03BD\u03BE\u03BF\u03C0\u03C1\u03C2\u03C3\u03C4\u03C5\u03C6\u03C7\u03C8\u03C9\u03CA\u03CB\u03CC\u03CD\u03CE\uFFFD"
      },
      "cp28597": "iso88597",
      "iso88598": {
        "type": "_sbcs",
        "chars": "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\uFFFD\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xD7\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xF7\xBB\xBC\xBD\xBE\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u2017\u05D0\u05D1\u05D2\u05D3\u05D4\u05D5\u05D6\u05D7\u05D8\u05D9\u05DA\u05DB\u05DC\u05DD\u05DE\u05DF\u05E0\u05E1\u05E2\u05E3\u05E4\u05E5\u05E6\u05E7\u05E8\u05E9\u05EA\uFFFD\uFFFD\u200E\u200F\uFFFD"
      },
      "cp28598": "iso88598",
      "iso88599": {
        "type": "_sbcs",
        "chars": "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\u011E\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\u0130\u015E\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\u011F\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\u0131\u015F\xFF"
      },
      "cp28599": "iso88599",
      "iso885910": {
        "type": "_sbcs",
        "chars": "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\u0104\u0112\u0122\u012A\u0128\u0136\xA7\u013B\u0110\u0160\u0166\u017D\xAD\u016A\u014A\xB0\u0105\u0113\u0123\u012B\u0129\u0137\xB7\u013C\u0111\u0161\u0167\u017E\u2015\u016B\u014B\u0100\xC1\xC2\xC3\xC4\xC5\xC6\u012E\u010C\xC9\u0118\xCB\u0116\xCD\xCE\xCF\xD0\u0145\u014C\xD3\xD4\xD5\xD6\u0168\xD8\u0172\xDA\xDB\xDC\xDD\xDE\xDF\u0101\xE1\xE2\xE3\xE4\xE5\xE6\u012F\u010D\xE9\u0119\xEB\u0117\xED\xEE\xEF\xF0\u0146\u014D\xF3\xF4\xF5\xF6\u0169\xF8\u0173\xFA\xFB\xFC\xFD\xFE\u0138"
      },
      "cp28600": "iso885910",
      "iso885911": {
        "type": "_sbcs",
        "chars": "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\u0E01\u0E02\u0E03\u0E04\u0E05\u0E06\u0E07\u0E08\u0E09\u0E0A\u0E0B\u0E0C\u0E0D\u0E0E\u0E0F\u0E10\u0E11\u0E12\u0E13\u0E14\u0E15\u0E16\u0E17\u0E18\u0E19\u0E1A\u0E1B\u0E1C\u0E1D\u0E1E\u0E1F\u0E20\u0E21\u0E22\u0E23\u0E24\u0E25\u0E26\u0E27\u0E28\u0E29\u0E2A\u0E2B\u0E2C\u0E2D\u0E2E\u0E2F\u0E30\u0E31\u0E32\u0E33\u0E34\u0E35\u0E36\u0E37\u0E38\u0E39\u0E3A\uFFFD\uFFFD\uFFFD\uFFFD\u0E3F\u0E40\u0E41\u0E42\u0E43\u0E44\u0E45\u0E46\u0E47\u0E48\u0E49\u0E4A\u0E4B\u0E4C\u0E4D\u0E4E\u0E4F\u0E50\u0E51\u0E52\u0E53\u0E54\u0E55\u0E56\u0E57\u0E58\u0E59\u0E5A\u0E5B\uFFFD\uFFFD\uFFFD\uFFFD"
      },
      "cp28601": "iso885911",
      "iso885913": {
        "type": "_sbcs",
        "chars": "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\u201D\xA2\xA3\xA4\u201E\xA6\xA7\xD8\xA9\u0156\xAB\xAC\xAD\xAE\xC6\xB0\xB1\xB2\xB3\u201C\xB5\xB6\xB7\xF8\xB9\u0157\xBB\xBC\xBD\xBE\xE6\u0104\u012E\u0100\u0106\xC4\xC5\u0118\u0112\u010C\xC9\u0179\u0116\u0122\u0136\u012A\u013B\u0160\u0143\u0145\xD3\u014C\xD5\xD6\xD7\u0172\u0141\u015A\u016A\xDC\u017B\u017D\xDF\u0105\u012F\u0101\u0107\xE4\xE5\u0119\u0113\u010D\xE9\u017A\u0117\u0123\u0137\u012B\u013C\u0161\u0144\u0146\xF3\u014D\xF5\xF6\xF7\u0173\u0142\u015B\u016B\xFC\u017C\u017E\u2019"
      },
      "cp28603": "iso885913",
      "iso885914": {
        "type": "_sbcs",
        "chars": "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\u1E02\u1E03\xA3\u010A\u010B\u1E0A\xA7\u1E80\xA9\u1E82\u1E0B\u1EF2\xAD\xAE\u0178\u1E1E\u1E1F\u0120\u0121\u1E40\u1E41\xB6\u1E56\u1E81\u1E57\u1E83\u1E60\u1EF3\u1E84\u1E85\u1E61\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\u0174\xD1\xD2\xD3\xD4\xD5\xD6\u1E6A\xD8\xD9\xDA\xDB\xDC\xDD\u0176\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\u0175\xF1\xF2\xF3\xF4\xF5\xF6\u1E6B\xF8\xF9\xFA\xFB\xFC\xFD\u0177\xFF"
      },
      "cp28604": "iso885914",
      "iso885915": {
        "type": "_sbcs",
        "chars": "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\u20AC\xA5\u0160\xA7\u0161\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\u017D\xB5\xB6\xB7\u017E\xB9\xBA\xBB\u0152\u0153\u0178\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF"
      },
      "cp28605": "iso885915",
      "iso885916": {
        "type": "_sbcs",
        "chars": "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\u0104\u0105\u0141\u20AC\u201E\u0160\xA7\u0161\xA9\u0218\xAB\u0179\xAD\u017A\u017B\xB0\xB1\u010C\u0142\u017D\u201D\xB6\xB7\u017E\u010D\u0219\xBB\u0152\u0153\u0178\u017C\xC0\xC1\xC2\u0102\xC4\u0106\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\u0110\u0143\xD2\xD3\xD4\u0150\xD6\u015A\u0170\xD9\xDA\xDB\xDC\u0118\u021A\xDF\xE0\xE1\xE2\u0103\xE4\u0107\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\u0111\u0144\xF2\xF3\xF4\u0151\xF6\u015B\u0171\xF9\xFA\xFB\xFC\u0119\u021B\xFF"
      },
      "cp28606": "iso885916",
      "cp437": {
        "type": "_sbcs",
        "chars": "\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xA2\xA3\xA5\u20A7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0"
      },
      "ibm437": "cp437",
      "csibm437": "cp437",
      "cp737": {
        "type": "_sbcs",
        "chars": "\u0391\u0392\u0393\u0394\u0395\u0396\u0397\u0398\u0399\u039A\u039B\u039C\u039D\u039E\u039F\u03A0\u03A1\u03A3\u03A4\u03A5\u03A6\u03A7\u03A8\u03A9\u03B1\u03B2\u03B3\u03B4\u03B5\u03B6\u03B7\u03B8\u03B9\u03BA\u03BB\u03BC\u03BD\u03BE\u03BF\u03C0\u03C1\u03C3\u03C2\u03C4\u03C5\u03C6\u03C7\u03C8\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03C9\u03AC\u03AD\u03AE\u03CA\u03AF\u03CC\u03CD\u03CB\u03CE\u0386\u0388\u0389\u038A\u038C\u038E\u038F\xB1\u2265\u2264\u03AA\u03AB\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0"
      },
      "ibm737": "cp737",
      "csibm737": "cp737",
      "cp775": {
        "type": "_sbcs",
        "chars": "\u0106\xFC\xE9\u0101\xE4\u0123\xE5\u0107\u0142\u0113\u0156\u0157\u012B\u0179\xC4\xC5\xC9\xE6\xC6\u014D\xF6\u0122\xA2\u015A\u015B\xD6\xDC\xF8\xA3\xD8\xD7\xA4\u0100\u012A\xF3\u017B\u017C\u017A\u201D\xA6\xA9\xAE\xAC\xBD\xBC\u0141\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u0104\u010C\u0118\u0116\u2563\u2551\u2557\u255D\u012E\u0160\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u0172\u016A\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u017D\u0105\u010D\u0119\u0117\u012F\u0161\u0173\u016B\u017E\u2518\u250C\u2588\u2584\u258C\u2590\u2580\xD3\xDF\u014C\u0143\xF5\xD5\xB5\u0144\u0136\u0137\u013B\u013C\u0146\u0112\u0145\u2019\xAD\xB1\u201C\xBE\xB6\xA7\xF7\u201E\xB0\u2219\xB7\xB9\xB3\xB2\u25A0\xA0"
      },
      "ibm775": "cp775",
      "csibm775": "cp775",
      "cp850": {
        "type": "_sbcs",
        "chars": "\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xF8\xA3\xD8\xD7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\xAE\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\xC1\xC2\xC0\xA9\u2563\u2551\u2557\u255D\xA2\xA5\u2510\u2514\u2534\u252C\u251C\u2500\u253C\xE3\xC3\u255A\u2554\u2569\u2566\u2560\u2550\u256C\xA4\xF0\xD0\xCA\xCB\xC8\u0131\xCD\xCE\xCF\u2518\u250C\u2588\u2584\xA6\xCC\u2580\xD3\xDF\xD4\xD2\xF5\xD5\xB5\xFE\xDE\xDA\xDB\xD9\xFD\xDD\xAF\xB4\xAD\xB1\u2017\xBE\xB6\xA7\xF7\xB8\xB0\xA8\xB7\xB9\xB3\xB2\u25A0\xA0"
      },
      "ibm850": "cp850",
      "csibm850": "cp850",
      "cp852": {
        "type": "_sbcs",
        "chars": "\xC7\xFC\xE9\xE2\xE4\u016F\u0107\xE7\u0142\xEB\u0150\u0151\xEE\u0179\xC4\u0106\xC9\u0139\u013A\xF4\xF6\u013D\u013E\u015A\u015B\xD6\xDC\u0164\u0165\u0141\xD7\u010D\xE1\xED\xF3\xFA\u0104\u0105\u017D\u017E\u0118\u0119\xAC\u017A\u010C\u015F\xAB\xBB\u2591\u2592\u2593\u2502\u2524\xC1\xC2\u011A\u015E\u2563\u2551\u2557\u255D\u017B\u017C\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u0102\u0103\u255A\u2554\u2569\u2566\u2560\u2550\u256C\xA4\u0111\u0110\u010E\xCB\u010F\u0147\xCD\xCE\u011B\u2518\u250C\u2588\u2584\u0162\u016E\u2580\xD3\xDF\xD4\u0143\u0144\u0148\u0160\u0161\u0154\xDA\u0155\u0170\xFD\xDD\u0163\xB4\xAD\u02DD\u02DB\u02C7\u02D8\xA7\xF7\xB8\xB0\xA8\u02D9\u0171\u0158\u0159\u25A0\xA0"
      },
      "ibm852": "cp852",
      "csibm852": "cp852",
      "cp855": {
        "type": "_sbcs",
        "chars": "\u0452\u0402\u0453\u0403\u0451\u0401\u0454\u0404\u0455\u0405\u0456\u0406\u0457\u0407\u0458\u0408\u0459\u0409\u045A\u040A\u045B\u040B\u045C\u040C\u045E\u040E\u045F\u040F\u044E\u042E\u044A\u042A\u0430\u0410\u0431\u0411\u0446\u0426\u0434\u0414\u0435\u0415\u0444\u0424\u0433\u0413\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u0445\u0425\u0438\u0418\u2563\u2551\u2557\u255D\u0439\u0419\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u043A\u041A\u255A\u2554\u2569\u2566\u2560\u2550\u256C\xA4\u043B\u041B\u043C\u041C\u043D\u041D\u043E\u041E\u043F\u2518\u250C\u2588\u2584\u041F\u044F\u2580\u042F\u0440\u0420\u0441\u0421\u0442\u0422\u0443\u0423\u0436\u0416\u0432\u0412\u044C\u042C\u2116\xAD\u044B\u042B\u0437\u0417\u0448\u0428\u044D\u042D\u0449\u0429\u0447\u0427\xA7\u25A0\xA0"
      },
      "ibm855": "cp855",
      "csibm855": "cp855",
      "cp856": {
        "type": "_sbcs",
        "chars": "\u05D0\u05D1\u05D2\u05D3\u05D4\u05D5\u05D6\u05D7\u05D8\u05D9\u05DA\u05DB\u05DC\u05DD\u05DE\u05DF\u05E0\u05E1\u05E2\u05E3\u05E4\u05E5\u05E6\u05E7\u05E8\u05E9\u05EA\uFFFD\xA3\uFFFD\xD7\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\xAE\xAC\xBD\xBC\uFFFD\xAB\xBB\u2591\u2592\u2593\u2502\u2524\uFFFD\uFFFD\uFFFD\xA9\u2563\u2551\u2557\u255D\xA2\xA5\u2510\u2514\u2534\u252C\u251C\u2500\u253C\uFFFD\uFFFD\u255A\u2554\u2569\u2566\u2560\u2550\u256C\xA4\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u2518\u250C\u2588\u2584\xA6\uFFFD\u2580\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\xB5\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\xAF\xB4\xAD\xB1\u2017\xBE\xB6\xA7\xF7\xB8\xB0\xA8\xB7\xB9\xB3\xB2\u25A0\xA0"
      },
      "ibm856": "cp856",
      "csibm856": "cp856",
      "cp857": {
        "type": "_sbcs",
        "chars": "\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\u0131\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\u0130\xD6\xDC\xF8\xA3\xD8\u015E\u015F\xE1\xED\xF3\xFA\xF1\xD1\u011E\u011F\xBF\xAE\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\xC1\xC2\xC0\xA9\u2563\u2551\u2557\u255D\xA2\xA5\u2510\u2514\u2534\u252C\u251C\u2500\u253C\xE3\xC3\u255A\u2554\u2569\u2566\u2560\u2550\u256C\xA4\xBA\xAA\xCA\xCB\xC8\uFFFD\xCD\xCE\xCF\u2518\u250C\u2588\u2584\xA6\xCC\u2580\xD3\xDF\xD4\xD2\xF5\xD5\xB5\uFFFD\xD7\xDA\xDB\xD9\xEC\xFF\xAF\xB4\xAD\xB1\uFFFD\xBE\xB6\xA7\xF7\xB8\xB0\xA8\xB7\xB9\xB3\xB2\u25A0\xA0"
      },
      "ibm857": "cp857",
      "csibm857": "cp857",
      "cp858": {
        "type": "_sbcs",
        "chars": "\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xF8\xA3\xD8\xD7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\xAE\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\xC1\xC2\xC0\xA9\u2563\u2551\u2557\u255D\xA2\xA5\u2510\u2514\u2534\u252C\u251C\u2500\u253C\xE3\xC3\u255A\u2554\u2569\u2566\u2560\u2550\u256C\xA4\xF0\xD0\xCA\xCB\xC8\u20AC\xCD\xCE\xCF\u2518\u250C\u2588\u2584\xA6\xCC\u2580\xD3\xDF\xD4\xD2\xF5\xD5\xB5\xFE\xDE\xDA\xDB\xD9\xFD\xDD\xAF\xB4\xAD\xB1\u2017\xBE\xB6\xA7\xF7\xB8\xB0\xA8\xB7\xB9\xB3\xB2\u25A0\xA0"
      },
      "ibm858": "cp858",
      "csibm858": "cp858",
      "cp860": {
        "type": "_sbcs",
        "chars": "\xC7\xFC\xE9\xE2\xE3\xE0\xC1\xE7\xEA\xCA\xE8\xCD\xD4\xEC\xC3\xC2\xC9\xC0\xC8\xF4\xF5\xF2\xDA\xF9\xCC\xD5\xDC\xA2\xA3\xD9\u20A7\xD3\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\xD2\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0"
      },
      "ibm860": "cp860",
      "csibm860": "cp860",
      "cp861": {
        "type": "_sbcs",
        "chars": "\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xD0\xF0\xDE\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xFE\xFB\xDD\xFD\xD6\xDC\xF8\xA3\xD8\u20A7\u0192\xE1\xED\xF3\xFA\xC1\xCD\xD3\xDA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0"
      },
      "ibm861": "cp861",
      "csibm861": "cp861",
      "cp862": {
        "type": "_sbcs",
        "chars": "\u05D0\u05D1\u05D2\u05D3\u05D4\u05D5\u05D6\u05D7\u05D8\u05D9\u05DA\u05DB\u05DC\u05DD\u05DE\u05DF\u05E0\u05E1\u05E2\u05E3\u05E4\u05E5\u05E6\u05E7\u05E8\u05E9\u05EA\xA2\xA3\xA5\u20A7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0"
      },
      "ibm862": "cp862",
      "csibm862": "cp862",
      "cp863": {
        "type": "_sbcs",
        "chars": "\xC7\xFC\xE9\xE2\xC2\xE0\xB6\xE7\xEA\xEB\xE8\xEF\xEE\u2017\xC0\xA7\xC9\xC8\xCA\xF4\xCB\xCF\xFB\xF9\xA4\xD4\xDC\xA2\xA3\xD9\xDB\u0192\xA6\xB4\xF3\xFA\xA8\xB8\xB3\xAF\xCE\u2310\xAC\xBD\xBC\xBE\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0"
      },
      "ibm863": "cp863",
      "csibm863": "cp863",
      "cp864": {
        "type": "_sbcs",
        "chars": "\0\x07\b	\n\v\f\r\x1B !\"#$\u066A&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7F\xB0\xB7\u2219\u221A\u2592\u2500\u2502\u253C\u2524\u252C\u251C\u2534\u2510\u250C\u2514\u2518\u03B2\u221E\u03C6\xB1\xBD\xBC\u2248\xAB\xBB\uFEF7\uFEF8\uFFFD\uFFFD\uFEFB\uFEFC\uFFFD\xA0\xAD\uFE82\xA3\xA4\uFE84\uFFFD\uFFFD\uFE8E\uFE8F\uFE95\uFE99\u060C\uFE9D\uFEA1\uFEA5\u0660\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u0669\uFED1\u061B\uFEB1\uFEB5\uFEB9\u061F\xA2\uFE80\uFE81\uFE83\uFE85\uFECA\uFE8B\uFE8D\uFE91\uFE93\uFE97\uFE9B\uFE9F\uFEA3\uFEA7\uFEA9\uFEAB\uFEAD\uFEAF\uFEB3\uFEB7\uFEBB\uFEBF\uFEC1\uFEC5\uFECB\uFECF\xA6\xAC\xF7\xD7\uFEC9\u0640\uFED3\uFED7\uFEDB\uFEDF\uFEE3\uFEE7\uFEEB\uFEED\uFEEF\uFEF3\uFEBD\uFECC\uFECE\uFECD\uFEE1\uFE7D\u0651\uFEE5\uFEE9\uFEEC\uFEF0\uFEF2\uFED0\uFED5\uFEF5\uFEF6\uFEDD\uFED9\uFEF1\u25A0\uFFFD"
      },
      "ibm864": "cp864",
      "csibm864": "cp864",
      "cp865": {
        "type": "_sbcs",
        "chars": "\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xF8\xA3\xD8\u20A7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xA4\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0"
      },
      "ibm865": "cp865",
      "csibm865": "cp865",
      "cp866": {
        "type": "_sbcs",
        "chars": "\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042A\u042B\u042C\u042D\u042E\u042F\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043A\u043B\u043C\u043D\u043E\u043F\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044A\u044B\u044C\u044D\u044E\u044F\u0401\u0451\u0404\u0454\u0407\u0457\u040E\u045E\xB0\u2219\xB7\u221A\u2116\xA4\u25A0\xA0"
      },
      "ibm866": "cp866",
      "csibm866": "cp866",
      "cp869": {
        "type": "_sbcs",
        "chars": "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u0386\uFFFD\xB7\xAC\xA6\u2018\u2019\u0388\u2015\u0389\u038A\u03AA\u038C\uFFFD\uFFFD\u038E\u03AB\xA9\u038F\xB2\xB3\u03AC\xA3\u03AD\u03AE\u03AF\u03CA\u0390\u03CC\u03CD\u0391\u0392\u0393\u0394\u0395\u0396\u0397\xBD\u0398\u0399\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u039A\u039B\u039C\u039D\u2563\u2551\u2557\u255D\u039E\u039F\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u03A0\u03A1\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u03A3\u03A4\u03A5\u03A6\u03A7\u03A8\u03A9\u03B1\u03B2\u03B3\u2518\u250C\u2588\u2584\u03B4\u03B5\u2580\u03B6\u03B7\u03B8\u03B9\u03BA\u03BB\u03BC\u03BD\u03BE\u03BF\u03C0\u03C1\u03C3\u03C2\u03C4\u0384\xAD\xB1\u03C5\u03C6\u03C7\xA7\u03C8\u0385\xB0\xA8\u03C9\u03CB\u03B0\u03CE\u25A0\xA0"
      },
      "ibm869": "cp869",
      "csibm869": "cp869",
      "cp922": {
        "type": "_sbcs",
        "chars": "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\u203E\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\u0160\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\u017D\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\u0161\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\u017E\xFF"
      },
      "ibm922": "cp922",
      "csibm922": "cp922",
      "cp1046": {
        "type": "_sbcs",
        "chars": "\uFE88\xD7\xF7\uF8F6\uF8F5\uF8F4\uF8F7\uFE71\x88\u25A0\u2502\u2500\u2510\u250C\u2514\u2518\uFE79\uFE7B\uFE7D\uFE7F\uFE77\uFE8A\uFEF0\uFEF3\uFEF2\uFECE\uFECF\uFED0\uFEF6\uFEF8\uFEFA\uFEFC\xA0\uF8FA\uF8F9\uF8F8\xA4\uF8FB\uFE8B\uFE91\uFE97\uFE9B\uFE9F\uFEA3\u060C\xAD\uFEA7\uFEB3\u0660\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u0669\uFEB7\u061B\uFEBB\uFEBF\uFECA\u061F\uFECB\u0621\u0622\u0623\u0624\u0625\u0626\u0627\u0628\u0629\u062A\u062B\u062C\u062D\u062E\u062F\u0630\u0631\u0632\u0633\u0634\u0635\u0636\u0637\uFEC7\u0639\u063A\uFECC\uFE82\uFE84\uFE8E\uFED3\u0640\u0641\u0642\u0643\u0644\u0645\u0646\u0647\u0648\u0649\u064A\u064B\u064C\u064D\u064E\u064F\u0650\u0651\u0652\uFED7\uFEDB\uFEDF\uF8FC\uFEF5\uFEF7\uFEF9\uFEFB\uFEE3\uFEE7\uFEEC\uFEE9\uFFFD"
      },
      "ibm1046": "cp1046",
      "csibm1046": "cp1046",
      "cp1124": {
        "type": "_sbcs",
        "chars": "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\u0401\u0402\u0490\u0404\u0405\u0406\u0407\u0408\u0409\u040A\u040B\u040C\xAD\u040E\u040F\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042A\u042B\u042C\u042D\u042E\u042F\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043A\u043B\u043C\u043D\u043E\u043F\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044A\u044B\u044C\u044D\u044E\u044F\u2116\u0451\u0452\u0491\u0454\u0455\u0456\u0457\u0458\u0459\u045A\u045B\u045C\xA7\u045E\u045F"
      },
      "ibm1124": "cp1124",
      "csibm1124": "cp1124",
      "cp1125": {
        "type": "_sbcs",
        "chars": "\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042A\u042B\u042C\u042D\u042E\u042F\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043A\u043B\u043C\u043D\u043E\u043F\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044A\u044B\u044C\u044D\u044E\u044F\u0401\u0451\u0490\u0491\u0404\u0454\u0406\u0456\u0407\u0457\xB7\u221A\u2116\xA4\u25A0\xA0"
      },
      "ibm1125": "cp1125",
      "csibm1125": "cp1125",
      "cp1129": {
        "type": "_sbcs",
        "chars": "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\u0153\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\u0178\xB5\xB6\xB7\u0152\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\u0102\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\u0300\xCD\xCE\xCF\u0110\xD1\u0309\xD3\xD4\u01A0\xD6\xD7\xD8\xD9\xDA\xDB\xDC\u01AF\u0303\xDF\xE0\xE1\xE2\u0103\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\u0301\xED\xEE\xEF\u0111\xF1\u0323\xF3\xF4\u01A1\xF6\xF7\xF8\xF9\xFA\xFB\xFC\u01B0\u20AB\xFF"
      },
      "ibm1129": "cp1129",
      "csibm1129": "cp1129",
      "cp1133": {
        "type": "_sbcs",
        "chars": "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\u0E81\u0E82\u0E84\u0E87\u0E88\u0EAA\u0E8A\u0E8D\u0E94\u0E95\u0E96\u0E97\u0E99\u0E9A\u0E9B\u0E9C\u0E9D\u0E9E\u0E9F\u0EA1\u0EA2\u0EA3\u0EA5\u0EA7\u0EAB\u0EAD\u0EAE\uFFFD\uFFFD\uFFFD\u0EAF\u0EB0\u0EB2\u0EB3\u0EB4\u0EB5\u0EB6\u0EB7\u0EB8\u0EB9\u0EBC\u0EB1\u0EBB\u0EBD\uFFFD\uFFFD\uFFFD\u0EC0\u0EC1\u0EC2\u0EC3\u0EC4\u0EC8\u0EC9\u0ECA\u0ECB\u0ECC\u0ECD\u0EC6\uFFFD\u0EDC\u0EDD\u20AD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u0ED0\u0ED1\u0ED2\u0ED3\u0ED4\u0ED5\u0ED6\u0ED7\u0ED8\u0ED9\uFFFD\uFFFD\xA2\xAC\xA6\uFFFD"
      },
      "ibm1133": "cp1133",
      "csibm1133": "cp1133",
      "cp1161": {
        "type": "_sbcs",
        "chars": "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u0E48\u0E01\u0E02\u0E03\u0E04\u0E05\u0E06\u0E07\u0E08\u0E09\u0E0A\u0E0B\u0E0C\u0E0D\u0E0E\u0E0F\u0E10\u0E11\u0E12\u0E13\u0E14\u0E15\u0E16\u0E17\u0E18\u0E19\u0E1A\u0E1B\u0E1C\u0E1D\u0E1E\u0E1F\u0E20\u0E21\u0E22\u0E23\u0E24\u0E25\u0E26\u0E27\u0E28\u0E29\u0E2A\u0E2B\u0E2C\u0E2D\u0E2E\u0E2F\u0E30\u0E31\u0E32\u0E33\u0E34\u0E35\u0E36\u0E37\u0E38\u0E39\u0E3A\u0E49\u0E4A\u0E4B\u20AC\u0E3F\u0E40\u0E41\u0E42\u0E43\u0E44\u0E45\u0E46\u0E47\u0E48\u0E49\u0E4A\u0E4B\u0E4C\u0E4D\u0E4E\u0E4F\u0E50\u0E51\u0E52\u0E53\u0E54\u0E55\u0E56\u0E57\u0E58\u0E59\u0E5A\u0E5B\xA2\xAC\xA6\xA0"
      },
      "ibm1161": "cp1161",
      "csibm1161": "cp1161",
      "cp1162": {
        "type": "_sbcs",
        "chars": "\u20AC\x81\x82\x83\x84\u2026\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\u2018\u2019\u201C\u201D\u2022\u2013\u2014\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\u0E01\u0E02\u0E03\u0E04\u0E05\u0E06\u0E07\u0E08\u0E09\u0E0A\u0E0B\u0E0C\u0E0D\u0E0E\u0E0F\u0E10\u0E11\u0E12\u0E13\u0E14\u0E15\u0E16\u0E17\u0E18\u0E19\u0E1A\u0E1B\u0E1C\u0E1D\u0E1E\u0E1F\u0E20\u0E21\u0E22\u0E23\u0E24\u0E25\u0E26\u0E27\u0E28\u0E29\u0E2A\u0E2B\u0E2C\u0E2D\u0E2E\u0E2F\u0E30\u0E31\u0E32\u0E33\u0E34\u0E35\u0E36\u0E37\u0E38\u0E39\u0E3A\uFFFD\uFFFD\uFFFD\uFFFD\u0E3F\u0E40\u0E41\u0E42\u0E43\u0E44\u0E45\u0E46\u0E47\u0E48\u0E49\u0E4A\u0E4B\u0E4C\u0E4D\u0E4E\u0E4F\u0E50\u0E51\u0E52\u0E53\u0E54\u0E55\u0E56\u0E57\u0E58\u0E59\u0E5A\u0E5B\uFFFD\uFFFD\uFFFD\uFFFD"
      },
      "ibm1162": "cp1162",
      "csibm1162": "cp1162",
      "cp1163": {
        "type": "_sbcs",
        "chars": "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\u20AC\xA5\xA6\xA7\u0153\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\u0178\xB5\xB6\xB7\u0152\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\u0102\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\u0300\xCD\xCE\xCF\u0110\xD1\u0309\xD3\xD4\u01A0\xD6\xD7\xD8\xD9\xDA\xDB\xDC\u01AF\u0303\xDF\xE0\xE1\xE2\u0103\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\u0301\xED\xEE\xEF\u0111\xF1\u0323\xF3\xF4\u01A1\xF6\xF7\xF8\xF9\xFA\xFB\xFC\u01B0\u20AB\xFF"
      },
      "ibm1163": "cp1163",
      "csibm1163": "cp1163",
      "maccroatian": {
        "type": "_sbcs",
        "chars": "\xC4\xC5\xC7\xC9\xD1\xD6\xDC\xE1\xE0\xE2\xE4\xE3\xE5\xE7\xE9\xE8\xEA\xEB\xED\xEC\xEE\xEF\xF1\xF3\xF2\xF4\xF6\xF5\xFA\xF9\xFB\xFC\u2020\xB0\xA2\xA3\xA7\u2022\xB6\xDF\xAE\u0160\u2122\xB4\xA8\u2260\u017D\xD8\u221E\xB1\u2264\u2265\u2206\xB5\u2202\u2211\u220F\u0161\u222B\xAA\xBA\u2126\u017E\xF8\xBF\xA1\xAC\u221A\u0192\u2248\u0106\xAB\u010C\u2026\xA0\xC0\xC3\xD5\u0152\u0153\u0110\u2014\u201C\u201D\u2018\u2019\xF7\u25CA\uFFFD\xA9\u2044\xA4\u2039\u203A\xC6\xBB\u2013\xB7\u201A\u201E\u2030\xC2\u0107\xC1\u010D\xC8\xCD\xCE\xCF\xCC\xD3\xD4\u0111\xD2\xDA\xDB\xD9\u0131\u02C6\u02DC\xAF\u03C0\xCB\u02DA\xB8\xCA\xE6\u02C7"
      },
      "maccyrillic": {
        "type": "_sbcs",
        "chars": "\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042A\u042B\u042C\u042D\u042E\u042F\u2020\xB0\xA2\xA3\xA7\u2022\xB6\u0406\xAE\xA9\u2122\u0402\u0452\u2260\u0403\u0453\u221E\xB1\u2264\u2265\u0456\xB5\u2202\u0408\u0404\u0454\u0407\u0457\u0409\u0459\u040A\u045A\u0458\u0405\xAC\u221A\u0192\u2248\u2206\xAB\xBB\u2026\xA0\u040B\u045B\u040C\u045C\u0455\u2013\u2014\u201C\u201D\u2018\u2019\xF7\u201E\u040E\u045E\u040F\u045F\u2116\u0401\u0451\u044F\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043A\u043B\u043C\u043D\u043E\u043F\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044A\u044B\u044C\u044D\u044E\xA4"
      },
      "macgreek": {
        "type": "_sbcs",
        "chars": "\xC4\xB9\xB2\xC9\xB3\xD6\xDC\u0385\xE0\xE2\xE4\u0384\xA8\xE7\xE9\xE8\xEA\xEB\xA3\u2122\xEE\xEF\u2022\xBD\u2030\xF4\xF6\xA6\xAD\xF9\xFB\xFC\u2020\u0393\u0394\u0398\u039B\u039E\u03A0\xDF\xAE\xA9\u03A3\u03AA\xA7\u2260\xB0\u0387\u0391\xB1\u2264\u2265\xA5\u0392\u0395\u0396\u0397\u0399\u039A\u039C\u03A6\u03AB\u03A8\u03A9\u03AC\u039D\xAC\u039F\u03A1\u2248\u03A4\xAB\xBB\u2026\xA0\u03A5\u03A7\u0386\u0388\u0153\u2013\u2015\u201C\u201D\u2018\u2019\xF7\u0389\u038A\u038C\u038E\u03AD\u03AE\u03AF\u03CC\u038F\u03CD\u03B1\u03B2\u03C8\u03B4\u03B5\u03C6\u03B3\u03B7\u03B9\u03BE\u03BA\u03BB\u03BC\u03BD\u03BF\u03C0\u03CE\u03C1\u03C3\u03C4\u03B8\u03C9\u03C2\u03C7\u03C5\u03B6\u03CA\u03CB\u0390\u03B0\uFFFD"
      },
      "maciceland": {
        "type": "_sbcs",
        "chars": "\xC4\xC5\xC7\xC9\xD1\xD6\xDC\xE1\xE0\xE2\xE4\xE3\xE5\xE7\xE9\xE8\xEA\xEB\xED\xEC\xEE\xEF\xF1\xF3\xF2\xF4\xF6\xF5\xFA\xF9\xFB\xFC\xDD\xB0\xA2\xA3\xA7\u2022\xB6\xDF\xAE\xA9\u2122\xB4\xA8\u2260\xC6\xD8\u221E\xB1\u2264\u2265\xA5\xB5\u2202\u2211\u220F\u03C0\u222B\xAA\xBA\u2126\xE6\xF8\xBF\xA1\xAC\u221A\u0192\u2248\u2206\xAB\xBB\u2026\xA0\xC0\xC3\xD5\u0152\u0153\u2013\u2014\u201C\u201D\u2018\u2019\xF7\u25CA\xFF\u0178\u2044\xA4\xD0\xF0\xDE\xFE\xFD\xB7\u201A\u201E\u2030\xC2\xCA\xC1\xCB\xC8\xCD\xCE\xCF\xCC\xD3\xD4\uFFFD\xD2\xDA\xDB\xD9\u0131\u02C6\u02DC\xAF\u02D8\u02D9\u02DA\xB8\u02DD\u02DB\u02C7"
      },
      "macroman": {
        "type": "_sbcs",
        "chars": "\xC4\xC5\xC7\xC9\xD1\xD6\xDC\xE1\xE0\xE2\xE4\xE3\xE5\xE7\xE9\xE8\xEA\xEB\xED\xEC\xEE\xEF\xF1\xF3\xF2\xF4\xF6\xF5\xFA\xF9\xFB\xFC\u2020\xB0\xA2\xA3\xA7\u2022\xB6\xDF\xAE\xA9\u2122\xB4\xA8\u2260\xC6\xD8\u221E\xB1\u2264\u2265\xA5\xB5\u2202\u2211\u220F\u03C0\u222B\xAA\xBA\u2126\xE6\xF8\xBF\xA1\xAC\u221A\u0192\u2248\u2206\xAB\xBB\u2026\xA0\xC0\xC3\xD5\u0152\u0153\u2013\u2014\u201C\u201D\u2018\u2019\xF7\u25CA\xFF\u0178\u2044\xA4\u2039\u203A\uFB01\uFB02\u2021\xB7\u201A\u201E\u2030\xC2\xCA\xC1\xCB\xC8\xCD\xCE\xCF\xCC\xD3\xD4\uFFFD\xD2\xDA\xDB\xD9\u0131\u02C6\u02DC\xAF\u02D8\u02D9\u02DA\xB8\u02DD\u02DB\u02C7"
      },
      "macromania": {
        "type": "_sbcs",
        "chars": "\xC4\xC5\xC7\xC9\xD1\xD6\xDC\xE1\xE0\xE2\xE4\xE3\xE5\xE7\xE9\xE8\xEA\xEB\xED\xEC\xEE\xEF\xF1\xF3\xF2\xF4\xF6\xF5\xFA\xF9\xFB\xFC\u2020\xB0\xA2\xA3\xA7\u2022\xB6\xDF\xAE\xA9\u2122\xB4\xA8\u2260\u0102\u015E\u221E\xB1\u2264\u2265\xA5\xB5\u2202\u2211\u220F\u03C0\u222B\xAA\xBA\u2126\u0103\u015F\xBF\xA1\xAC\u221A\u0192\u2248\u2206\xAB\xBB\u2026\xA0\xC0\xC3\xD5\u0152\u0153\u2013\u2014\u201C\u201D\u2018\u2019\xF7\u25CA\xFF\u0178\u2044\xA4\u2039\u203A\u0162\u0163\u2021\xB7\u201A\u201E\u2030\xC2\xCA\xC1\xCB\xC8\xCD\xCE\xCF\xCC\xD3\xD4\uFFFD\xD2\xDA\xDB\xD9\u0131\u02C6\u02DC\xAF\u02D8\u02D9\u02DA\xB8\u02DD\u02DB\u02C7"
      },
      "macthai": {
        "type": "_sbcs",
        "chars": "\xAB\xBB\u2026\uF88C\uF88F\uF892\uF895\uF898\uF88B\uF88E\uF891\uF894\uF897\u201C\u201D\uF899\uFFFD\u2022\uF884\uF889\uF885\uF886\uF887\uF888\uF88A\uF88D\uF890\uF893\uF896\u2018\u2019\uFFFD\xA0\u0E01\u0E02\u0E03\u0E04\u0E05\u0E06\u0E07\u0E08\u0E09\u0E0A\u0E0B\u0E0C\u0E0D\u0E0E\u0E0F\u0E10\u0E11\u0E12\u0E13\u0E14\u0E15\u0E16\u0E17\u0E18\u0E19\u0E1A\u0E1B\u0E1C\u0E1D\u0E1E\u0E1F\u0E20\u0E21\u0E22\u0E23\u0E24\u0E25\u0E26\u0E27\u0E28\u0E29\u0E2A\u0E2B\u0E2C\u0E2D\u0E2E\u0E2F\u0E30\u0E31\u0E32\u0E33\u0E34\u0E35\u0E36\u0E37\u0E38\u0E39\u0E3A\uFEFF\u200B\u2013\u2014\u0E3F\u0E40\u0E41\u0E42\u0E43\u0E44\u0E45\u0E46\u0E47\u0E48\u0E49\u0E4A\u0E4B\u0E4C\u0E4D\u2122\u0E4F\u0E50\u0E51\u0E52\u0E53\u0E54\u0E55\u0E56\u0E57\u0E58\u0E59\xAE\xA9\uFFFD\uFFFD\uFFFD\uFFFD"
      },
      "macturkish": {
        "type": "_sbcs",
        "chars": "\xC4\xC5\xC7\xC9\xD1\xD6\xDC\xE1\xE0\xE2\xE4\xE3\xE5\xE7\xE9\xE8\xEA\xEB\xED\xEC\xEE\xEF\xF1\xF3\xF2\xF4\xF6\xF5\xFA\xF9\xFB\xFC\u2020\xB0\xA2\xA3\xA7\u2022\xB6\xDF\xAE\xA9\u2122\xB4\xA8\u2260\xC6\xD8\u221E\xB1\u2264\u2265\xA5\xB5\u2202\u2211\u220F\u03C0\u222B\xAA\xBA\u2126\xE6\xF8\xBF\xA1\xAC\u221A\u0192\u2248\u2206\xAB\xBB\u2026\xA0\xC0\xC3\xD5\u0152\u0153\u2013\u2014\u201C\u201D\u2018\u2019\xF7\u25CA\xFF\u0178\u011E\u011F\u0130\u0131\u015E\u015F\u2021\xB7\u201A\u201E\u2030\xC2\xCA\xC1\xCB\xC8\xCD\xCE\xCF\xCC\xD3\xD4\uFFFD\xD2\xDA\xDB\xD9\uFFFD\u02C6\u02DC\xAF\u02D8\u02D9\u02DA\xB8\u02DD\u02DB\u02C7"
      },
      "macukraine": {
        "type": "_sbcs",
        "chars": "\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042A\u042B\u042C\u042D\u042E\u042F\u2020\xB0\u0490\xA3\xA7\u2022\xB6\u0406\xAE\xA9\u2122\u0402\u0452\u2260\u0403\u0453\u221E\xB1\u2264\u2265\u0456\xB5\u0491\u0408\u0404\u0454\u0407\u0457\u0409\u0459\u040A\u045A\u0458\u0405\xAC\u221A\u0192\u2248\u2206\xAB\xBB\u2026\xA0\u040B\u045B\u040C\u045C\u0455\u2013\u2014\u201C\u201D\u2018\u2019\xF7\u201E\u040E\u045E\u040F\u045F\u2116\u0401\u0451\u044F\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043A\u043B\u043C\u043D\u043E\u043F\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044A\u044B\u044C\u044D\u044E\xA4"
      },
      "koi8r": {
        "type": "_sbcs",
        "chars": "\u2500\u2502\u250C\u2510\u2514\u2518\u251C\u2524\u252C\u2534\u253C\u2580\u2584\u2588\u258C\u2590\u2591\u2592\u2593\u2320\u25A0\u2219\u221A\u2248\u2264\u2265\xA0\u2321\xB0\xB2\xB7\xF7\u2550\u2551\u2552\u0451\u2553\u2554\u2555\u2556\u2557\u2558\u2559\u255A\u255B\u255C\u255D\u255E\u255F\u2560\u2561\u0401\u2562\u2563\u2564\u2565\u2566\u2567\u2568\u2569\u256A\u256B\u256C\xA9\u044E\u0430\u0431\u0446\u0434\u0435\u0444\u0433\u0445\u0438\u0439\u043A\u043B\u043C\u043D\u043E\u043F\u044F\u0440\u0441\u0442\u0443\u0436\u0432\u044C\u044B\u0437\u0448\u044D\u0449\u0447\u044A\u042E\u0410\u0411\u0426\u0414\u0415\u0424\u0413\u0425\u0418\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u042F\u0420\u0421\u0422\u0423\u0416\u0412\u042C\u042B\u0417\u0428\u042D\u0429\u0427\u042A"
      },
      "koi8u": {
        "type": "_sbcs",
        "chars": "\u2500\u2502\u250C\u2510\u2514\u2518\u251C\u2524\u252C\u2534\u253C\u2580\u2584\u2588\u258C\u2590\u2591\u2592\u2593\u2320\u25A0\u2219\u221A\u2248\u2264\u2265\xA0\u2321\xB0\xB2\xB7\xF7\u2550\u2551\u2552\u0451\u0454\u2554\u0456\u0457\u2557\u2558\u2559\u255A\u255B\u0491\u255D\u255E\u255F\u2560\u2561\u0401\u0404\u2563\u0406\u0407\u2566\u2567\u2568\u2569\u256A\u0490\u256C\xA9\u044E\u0430\u0431\u0446\u0434\u0435\u0444\u0433\u0445\u0438\u0439\u043A\u043B\u043C\u043D\u043E\u043F\u044F\u0440\u0441\u0442\u0443\u0436\u0432\u044C\u044B\u0437\u0448\u044D\u0449\u0447\u044A\u042E\u0410\u0411\u0426\u0414\u0415\u0424\u0413\u0425\u0418\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u042F\u0420\u0421\u0422\u0423\u0416\u0412\u042C\u042B\u0417\u0428\u042D\u0429\u0427\u042A"
      },
      "koi8ru": {
        "type": "_sbcs",
        "chars": "\u2500\u2502\u250C\u2510\u2514\u2518\u251C\u2524\u252C\u2534\u253C\u2580\u2584\u2588\u258C\u2590\u2591\u2592\u2593\u2320\u25A0\u2219\u221A\u2248\u2264\u2265\xA0\u2321\xB0\xB2\xB7\xF7\u2550\u2551\u2552\u0451\u0454\u2554\u0456\u0457\u2557\u2558\u2559\u255A\u255B\u0491\u045E\u255E\u255F\u2560\u2561\u0401\u0404\u2563\u0406\u0407\u2566\u2567\u2568\u2569\u256A\u0490\u040E\xA9\u044E\u0430\u0431\u0446\u0434\u0435\u0444\u0433\u0445\u0438\u0439\u043A\u043B\u043C\u043D\u043E\u043F\u044F\u0440\u0441\u0442\u0443\u0436\u0432\u044C\u044B\u0437\u0448\u044D\u0449\u0447\u044A\u042E\u0410\u0411\u0426\u0414\u0415\u0424\u0413\u0425\u0418\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u042F\u0420\u0421\u0422\u0423\u0416\u0412\u042C\u042B\u0417\u0428\u042D\u0429\u0427\u042A"
      },
      "koi8t": {
        "type": "_sbcs",
        "chars": "\u049B\u0493\u201A\u0492\u201E\u2026\u2020\u2021\uFFFD\u2030\u04B3\u2039\u04B2\u04B7\u04B6\uFFFD\u049A\u2018\u2019\u201C\u201D\u2022\u2013\u2014\uFFFD\u2122\uFFFD\u203A\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u04EF\u04EE\u0451\xA4\u04E3\xA6\xA7\uFFFD\uFFFD\uFFFD\xAB\xAC\xAD\xAE\uFFFD\xB0\xB1\xB2\u0401\uFFFD\u04E2\xB6\xB7\uFFFD\u2116\uFFFD\xBB\uFFFD\uFFFD\uFFFD\xA9\u044E\u0430\u0431\u0446\u0434\u0435\u0444\u0433\u0445\u0438\u0439\u043A\u043B\u043C\u043D\u043E\u043F\u044F\u0440\u0441\u0442\u0443\u0436\u0432\u044C\u044B\u0437\u0448\u044D\u0449\u0447\u044A\u042E\u0410\u0411\u0426\u0414\u0415\u0424\u0413\u0425\u0418\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u042F\u0420\u0421\u0422\u0423\u0416\u0412\u042C\u042B\u0417\u0428\u042D\u0429\u0427\u042A"
      },
      "armscii8": {
        "type": "_sbcs",
        "chars": "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\uFFFD\u0587\u0589)(\xBB\xAB\u2014.\u055D,-\u058A\u2026\u055C\u055B\u055E\u0531\u0561\u0532\u0562\u0533\u0563\u0534\u0564\u0535\u0565\u0536\u0566\u0537\u0567\u0538\u0568\u0539\u0569\u053A\u056A\u053B\u056B\u053C\u056C\u053D\u056D\u053E\u056E\u053F\u056F\u0540\u0570\u0541\u0571\u0542\u0572\u0543\u0573\u0544\u0574\u0545\u0575\u0546\u0576\u0547\u0577\u0548\u0578\u0549\u0579\u054A\u057A\u054B\u057B\u054C\u057C\u054D\u057D\u054E\u057E\u054F\u057F\u0550\u0580\u0551\u0581\u0552\u0582\u0553\u0583\u0554\u0584\u0555\u0585\u0556\u0586\u055A\uFFFD"
      },
      "rk1048": {
        "type": "_sbcs",
        "chars": "\u0402\u0403\u201A\u0453\u201E\u2026\u2020\u2021\u20AC\u2030\u0409\u2039\u040A\u049A\u04BA\u040F\u0452\u2018\u2019\u201C\u201D\u2022\u2013\u2014\uFFFD\u2122\u0459\u203A\u045A\u049B\u04BB\u045F\xA0\u04B0\u04B1\u04D8\xA4\u04E8\xA6\xA7\u0401\xA9\u0492\xAB\xAC\xAD\xAE\u04AE\xB0\xB1\u0406\u0456\u04E9\xB5\xB6\xB7\u0451\u2116\u0493\xBB\u04D9\u04A2\u04A3\u04AF\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042A\u042B\u042C\u042D\u042E\u042F\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043A\u043B\u043C\u043D\u043E\u043F\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044A\u044B\u044C\u044D\u044E\u044F"
      },
      "tcvn": {
        "type": "_sbcs",
        "chars": "\0\xDA\u1EE4\u1EEA\u1EEC\u1EEE\x07\b	\n\v\f\r\u1EE8\u1EF0\u1EF2\u1EF6\u1EF8\xDD\u1EF4\x1B !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7F\xC0\u1EA2\xC3\xC1\u1EA0\u1EB6\u1EAC\xC8\u1EBA\u1EBC\xC9\u1EB8\u1EC6\xCC\u1EC8\u0128\xCD\u1ECA\xD2\u1ECE\xD5\xD3\u1ECC\u1ED8\u1EDC\u1EDE\u1EE0\u1EDA\u1EE2\xD9\u1EE6\u0168\xA0\u0102\xC2\xCA\xD4\u01A0\u01AF\u0110\u0103\xE2\xEA\xF4\u01A1\u01B0\u0111\u1EB0\u0300\u0309\u0303\u0301\u0323\xE0\u1EA3\xE3\xE1\u1EA1\u1EB2\u1EB1\u1EB3\u1EB5\u1EAF\u1EB4\u1EAE\u1EA6\u1EA8\u1EAA\u1EA4\u1EC0\u1EB7\u1EA7\u1EA9\u1EAB\u1EA5\u1EAD\xE8\u1EC2\u1EBB\u1EBD\xE9\u1EB9\u1EC1\u1EC3\u1EC5\u1EBF\u1EC7\xEC\u1EC9\u1EC4\u1EBE\u1ED2\u0129\xED\u1ECB\xF2\u1ED4\u1ECF\xF5\xF3\u1ECD\u1ED3\u1ED5\u1ED7\u1ED1\u1ED9\u1EDD\u1EDF\u1EE1\u1EDB\u1EE3\xF9\u1ED6\u1EE7\u0169\xFA\u1EE5\u1EEB\u1EED\u1EEF\u1EE9\u1EF1\u1EF3\u1EF7\u1EF9\xFD\u1EF5\u1ED0"
      },
      "georgianacademy": {
        "type": "_sbcs",
        "chars": "\x80\x81\u201A\u0192\u201E\u2026\u2020\u2021\u02C6\u2030\u0160\u2039\u0152\x8D\x8E\x8F\x90\u2018\u2019\u201C\u201D\u2022\u2013\u2014\u02DC\u2122\u0161\u203A\u0153\x9D\x9E\u0178\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\u10D0\u10D1\u10D2\u10D3\u10D4\u10D5\u10D6\u10D7\u10D8\u10D9\u10DA\u10DB\u10DC\u10DD\u10DE\u10DF\u10E0\u10E1\u10E2\u10E3\u10E4\u10E5\u10E6\u10E7\u10E8\u10E9\u10EA\u10EB\u10EC\u10ED\u10EE\u10EF\u10F0\u10F1\u10F2\u10F3\u10F4\u10F5\u10F6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF"
      },
      "georgianps": {
        "type": "_sbcs",
        "chars": "\x80\x81\u201A\u0192\u201E\u2026\u2020\u2021\u02C6\u2030\u0160\u2039\u0152\x8D\x8E\x8F\x90\u2018\u2019\u201C\u201D\u2022\u2013\u2014\u02DC\u2122\u0161\u203A\u0153\x9D\x9E\u0178\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\u10D0\u10D1\u10D2\u10D3\u10D4\u10D5\u10D6\u10F1\u10D7\u10D8\u10D9\u10DA\u10DB\u10DC\u10F2\u10DD\u10DE\u10DF\u10E0\u10E1\u10E2\u10F3\u10E3\u10E4\u10E5\u10E6\u10E7\u10E8\u10E9\u10EA\u10EB\u10EC\u10ED\u10EE\u10F4\u10EF\u10F0\u10F5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF"
      },
      "pt154": {
        "type": "_sbcs",
        "chars": "\u0496\u0492\u04EE\u0493\u201E\u2026\u04B6\u04AE\u04B2\u04AF\u04A0\u04E2\u04A2\u049A\u04BA\u04B8\u0497\u2018\u2019\u201C\u201D\u2022\u2013\u2014\u04B3\u04B7\u04A1\u04E3\u04A3\u049B\u04BB\u04B9\xA0\u040E\u045E\u0408\u04E8\u0498\u04B0\xA7\u0401\xA9\u04D8\xAB\xAC\u04EF\xAE\u049C\xB0\u04B1\u0406\u0456\u0499\u04E9\xB6\xB7\u0451\u2116\u04D9\xBB\u0458\u04AA\u04AB\u049D\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042A\u042B\u042C\u042D\u042E\u042F\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043A\u043B\u043C\u043D\u043E\u043F\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044A\u044B\u044C\u044D\u044E\u044F"
      },
      "viscii": {
        "type": "_sbcs",
        "chars": "\0\u1EB2\u1EB4\u1EAA\x07\b	\n\v\f\r\u1EF6\u1EF8\x1B\u1EF4 !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7F\u1EA0\u1EAE\u1EB0\u1EB6\u1EA4\u1EA6\u1EA8\u1EAC\u1EBC\u1EB8\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EE2\u1EDA\u1EDC\u1EDE\u1ECA\u1ECE\u1ECC\u1EC8\u1EE6\u0168\u1EE4\u1EF2\xD5\u1EAF\u1EB1\u1EB7\u1EA5\u1EA7\u1EA9\u1EAD\u1EBD\u1EB9\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1ED1\u1ED3\u1ED5\u1ED7\u1EE0\u01A0\u1ED9\u1EDD\u1EDF\u1ECB\u1EF0\u1EE8\u1EEA\u1EEC\u01A1\u1EDB\u01AF\xC0\xC1\xC2\xC3\u1EA2\u0102\u1EB3\u1EB5\xC8\xC9\xCA\u1EBA\xCC\xCD\u0128\u1EF3\u0110\u1EE9\xD2\xD3\xD4\u1EA1\u1EF7\u1EEB\u1EED\xD9\xDA\u1EF9\u1EF5\xDD\u1EE1\u01B0\xE0\xE1\xE2\xE3\u1EA3\u0103\u1EEF\u1EAB\xE8\xE9\xEA\u1EBB\xEC\xED\u0129\u1EC9\u0111\u1EF1\xF2\xF3\xF4\xF5\u1ECF\u1ECD\u1EE5\xF9\xFA\u0169\u1EE7\xFD\u1EE3\u1EEE"
      },
      "iso646cn": {
        "type": "_sbcs",
        "chars": "\0\x07\b	\n\v\f\r\x1B !\"#\xA5%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}\u203E\x7F\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"
      },
      "iso646jp": {
        "type": "_sbcs",
        "chars": "\0\x07\b	\n\v\f\r\x1B !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\xA5]^_`abcdefghijklmnopqrstuvwxyz{|}\u203E\x7F\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"
      },
      "hproman8": {
        "type": "_sbcs",
        "chars": "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xC0\xC2\xC8\xCA\xCB\xCE\xCF\xB4\u02CB\u02C6\xA8\u02DC\xD9\xDB\u20A4\xAF\xDD\xFD\xB0\xC7\xE7\xD1\xF1\xA1\xBF\xA4\xA3\xA5\xA7\u0192\xA2\xE2\xEA\xF4\xFB\xE1\xE9\xF3\xFA\xE0\xE8\xF2\xF9\xE4\xEB\xF6\xFC\xC5\xEE\xD8\xC6\xE5\xED\xF8\xE6\xC4\xEC\xD6\xDC\xC9\xEF\xDF\xD4\xC1\xC3\xE3\xD0\xF0\xCD\xCC\xD3\xD2\xD5\xF5\u0160\u0161\xDA\u0178\xFF\xDE\xFE\xB7\xB5\xB6\xBE\u2014\xBC\xBD\xAA\xBA\xAB\u25A0\xBB\xB1\uFFFD"
      },
      "macintosh": {
        "type": "_sbcs",
        "chars": "\xC4\xC5\xC7\xC9\xD1\xD6\xDC\xE1\xE0\xE2\xE4\xE3\xE5\xE7\xE9\xE8\xEA\xEB\xED\xEC\xEE\xEF\xF1\xF3\xF2\xF4\xF6\xF5\xFA\xF9\xFB\xFC\u2020\xB0\xA2\xA3\xA7\u2022\xB6\xDF\xAE\xA9\u2122\xB4\xA8\u2260\xC6\xD8\u221E\xB1\u2264\u2265\xA5\xB5\u2202\u2211\u220F\u03C0\u222B\xAA\xBA\u2126\xE6\xF8\xBF\xA1\xAC\u221A\u0192\u2248\u2206\xAB\xBB\u2026\xA0\xC0\xC3\xD5\u0152\u0153\u2013\u2014\u201C\u201D\u2018\u2019\xF7\u25CA\xFF\u0178\u2044\xA4\u2039\u203A\uFB01\uFB02\u2021\xB7\u201A\u201E\u2030\xC2\xCA\xC1\xCB\xC8\xCD\xCE\xCF\xCC\xD3\xD4\uFFFD\xD2\xDA\xDB\xD9\u0131\u02C6\u02DC\xAF\u02D8\u02D9\u02DA\xB8\u02DD\u02DB\u02C7"
      },
      "ascii": {
        "type": "_sbcs",
        "chars": "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"
      },
      "tis620": {
        "type": "_sbcs",
        "chars": "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u0E01\u0E02\u0E03\u0E04\u0E05\u0E06\u0E07\u0E08\u0E09\u0E0A\u0E0B\u0E0C\u0E0D\u0E0E\u0E0F\u0E10\u0E11\u0E12\u0E13\u0E14\u0E15\u0E16\u0E17\u0E18\u0E19\u0E1A\u0E1B\u0E1C\u0E1D\u0E1E\u0E1F\u0E20\u0E21\u0E22\u0E23\u0E24\u0E25\u0E26\u0E27\u0E28\u0E29\u0E2A\u0E2B\u0E2C\u0E2D\u0E2E\u0E2F\u0E30\u0E31\u0E32\u0E33\u0E34\u0E35\u0E36\u0E37\u0E38\u0E39\u0E3A\uFFFD\uFFFD\uFFFD\uFFFD\u0E3F\u0E40\u0E41\u0E42\u0E43\u0E44\u0E45\u0E46\u0E47\u0E48\u0E49\u0E4A\u0E4B\u0E4C\u0E4D\u0E4E\u0E4F\u0E50\u0E51\u0E52\u0E53\u0E54\u0E55\u0E56\u0E57\u0E58\u0E59\u0E5A\u0E5B\uFFFD\uFFFD\uFFFD\uFFFD"
      }
    };
  }
});

// ../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/dbcs-codec.js
var require_dbcs_codec = __commonJS({
  "../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/dbcs-codec.js"(exports) {
    init_import_meta_url();
    var Buffer8 = require_safer().Buffer;
    exports._dbcs = DBCSCodec;
    var UNASSIGNED = -1;
    var GB18030_CODE = -2;
    var SEQ_START = -10;
    var NODE_START = -1e3;
    var UNASSIGNED_NODE = new Array(256);
    var DEF_CHAR = -1;
    for (i7 = 0; i7 < 256; i7++)
      UNASSIGNED_NODE[i7] = UNASSIGNED;
    var i7;
    function DBCSCodec(codecOptions, iconv) {
      this.encodingName = codecOptions.encodingName;
      if (!codecOptions)
        throw new Error("DBCS codec is called without the data.");
      if (!codecOptions.table)
        throw new Error("Encoding '" + this.encodingName + "' has no data.");
      var mappingTable = codecOptions.table();
      this.decodeTables = [];
      this.decodeTables[0] = UNASSIGNED_NODE.slice(0);
      this.decodeTableSeq = [];
      for (var i8 = 0; i8 < mappingTable.length; i8++)
        this._addDecodeChunk(mappingTable[i8]);
      if (typeof codecOptions.gb18030 === "function") {
        this.gb18030 = codecOptions.gb18030();
        var commonThirdByteNodeIdx = this.decodeTables.length;
        this.decodeTables.push(UNASSIGNED_NODE.slice(0));
        var commonFourthByteNodeIdx = this.decodeTables.length;
        this.decodeTables.push(UNASSIGNED_NODE.slice(0));
        var firstByteNode = this.decodeTables[0];
        for (var i8 = 129; i8 <= 254; i8++) {
          var secondByteNode = this.decodeTables[NODE_START - firstByteNode[i8]];
          for (var j7 = 48; j7 <= 57; j7++) {
            if (secondByteNode[j7] === UNASSIGNED) {
              secondByteNode[j7] = NODE_START - commonThirdByteNodeIdx;
            } else if (secondByteNode[j7] > NODE_START) {
              throw new Error("gb18030 decode tables conflict at byte 2");
            }
            var thirdByteNode = this.decodeTables[NODE_START - secondByteNode[j7]];
            for (var k7 = 129; k7 <= 254; k7++) {
              if (thirdByteNode[k7] === UNASSIGNED) {
                thirdByteNode[k7] = NODE_START - commonFourthByteNodeIdx;
              } else if (thirdByteNode[k7] === NODE_START - commonFourthByteNodeIdx) {
                continue;
              } else if (thirdByteNode[k7] > NODE_START) {
                throw new Error("gb18030 decode tables conflict at byte 3");
              }
              var fourthByteNode = this.decodeTables[NODE_START - thirdByteNode[k7]];
              for (var l8 = 48; l8 <= 57; l8++) {
                if (fourthByteNode[l8] === UNASSIGNED)
                  fourthByteNode[l8] = GB18030_CODE;
              }
            }
          }
        }
      }
      this.defaultCharUnicode = iconv.defaultCharUnicode;
      this.encodeTable = [];
      this.encodeTableSeq = [];
      var skipEncodeChars = {};
      if (codecOptions.encodeSkipVals)
        for (var i8 = 0; i8 < codecOptions.encodeSkipVals.length; i8++) {
          var val2 = codecOptions.encodeSkipVals[i8];
          if (typeof val2 === "number")
            skipEncodeChars[val2] = true;
          else
            for (var j7 = val2.from; j7 <= val2.to; j7++)
              skipEncodeChars[j7] = true;
        }
      this._fillEncodeTable(0, 0, skipEncodeChars);
      if (codecOptions.encodeAdd) {
        for (var uChar in codecOptions.encodeAdd)
          if (Object.prototype.hasOwnProperty.call(codecOptions.encodeAdd, uChar))
            this._setEncodeChar(uChar.charCodeAt(0), codecOptions.encodeAdd[uChar]);
      }
      this.defCharSB = this.encodeTable[0][iconv.defaultCharSingleByte.charCodeAt(0)];
      if (this.defCharSB === UNASSIGNED) this.defCharSB = this.encodeTable[0]["?"];
      if (this.defCharSB === UNASSIGNED) this.defCharSB = "?".charCodeAt(0);
    }
    __name(DBCSCodec, "DBCSCodec");
    DBCSCodec.prototype.encoder = DBCSEncoder;
    DBCSCodec.prototype.decoder = DBCSDecoder;
    DBCSCodec.prototype._getDecodeTrieNode = function(addr) {
      var bytes = [];
      for (; addr > 0; addr >>>= 8)
        bytes.push(addr & 255);
      if (bytes.length == 0)
        bytes.push(0);
      var node2 = this.decodeTables[0];
      for (var i8 = bytes.length - 1; i8 > 0; i8--) {
        var val2 = node2[bytes[i8]];
        if (val2 == UNASSIGNED) {
          node2[bytes[i8]] = NODE_START - this.decodeTables.length;
          this.decodeTables.push(node2 = UNASSIGNED_NODE.slice(0));
        } else if (val2 <= NODE_START) {
          node2 = this.decodeTables[NODE_START - val2];
        } else
          throw new Error("Overwrite byte in " + this.encodingName + ", addr: " + addr.toString(16));
      }
      return node2;
    };
    DBCSCodec.prototype._addDecodeChunk = function(chunk) {
      var curAddr = parseInt(chunk[0], 16);
      var writeTable = this._getDecodeTrieNode(curAddr);
      curAddr = curAddr & 255;
      for (var k7 = 1; k7 < chunk.length; k7++) {
        var part = chunk[k7];
        if (typeof part === "string") {
          for (var l8 = 0; l8 < part.length; ) {
            var code = part.charCodeAt(l8++);
            if (55296 <= code && code < 56320) {
              var codeTrail = part.charCodeAt(l8++);
              if (56320 <= codeTrail && codeTrail < 57344)
                writeTable[curAddr++] = 65536 + (code - 55296) * 1024 + (codeTrail - 56320);
              else
                throw new Error("Incorrect surrogate pair in " + this.encodingName + " at chunk " + chunk[0]);
            } else if (4080 < code && code <= 4095) {
              var len = 4095 - code + 2;
              var seq = [];
              for (var m7 = 0; m7 < len; m7++)
                seq.push(part.charCodeAt(l8++));
              writeTable[curAddr++] = SEQ_START - this.decodeTableSeq.length;
              this.decodeTableSeq.push(seq);
            } else
              writeTable[curAddr++] = code;
          }
        } else if (typeof part === "number") {
          var charCode = writeTable[curAddr - 1] + 1;
          for (var l8 = 0; l8 < part; l8++)
            writeTable[curAddr++] = charCode++;
        } else
          throw new Error("Incorrect type '" + typeof part + "' given in " + this.encodingName + " at chunk " + chunk[0]);
      }
      if (curAddr > 255)
        throw new Error("Incorrect chunk in " + this.encodingName + " at addr " + chunk[0] + ": too long" + curAddr);
    };
    DBCSCodec.prototype._getEncodeBucket = function(uCode) {
      var high = uCode >> 8;
      if (this.encodeTable[high] === void 0)
        this.encodeTable[high] = UNASSIGNED_NODE.slice(0);
      return this.encodeTable[high];
    };
    DBCSCodec.prototype._setEncodeChar = function(uCode, dbcsCode) {
      var bucket = this._getEncodeBucket(uCode);
      var low = uCode & 255;
      if (bucket[low] <= SEQ_START)
        this.encodeTableSeq[SEQ_START - bucket[low]][DEF_CHAR] = dbcsCode;
      else if (bucket[low] == UNASSIGNED)
        bucket[low] = dbcsCode;
    };
    DBCSCodec.prototype._setEncodeSequence = function(seq, dbcsCode) {
      var uCode = seq[0];
      var bucket = this._getEncodeBucket(uCode);
      var low = uCode & 255;
      var node2;
      if (bucket[low] <= SEQ_START) {
        node2 = this.encodeTableSeq[SEQ_START - bucket[low]];
      } else {
        node2 = {};
        if (bucket[low] !== UNASSIGNED) node2[DEF_CHAR] = bucket[low];
        bucket[low] = SEQ_START - this.encodeTableSeq.length;
        this.encodeTableSeq.push(node2);
      }
      for (var j7 = 1; j7 < seq.length - 1; j7++) {
        var oldVal = node2[uCode];
        if (typeof oldVal === "object")
          node2 = oldVal;
        else {
          node2 = node2[uCode] = {};
          if (oldVal !== void 0)
            node2[DEF_CHAR] = oldVal;
        }
      }
      uCode = seq[seq.length - 1];
      node2[uCode] = dbcsCode;
    };
    DBCSCodec.prototype._fillEncodeTable = function(nodeIdx, prefix, skipEncodeChars) {
      var node2 = this.decodeTables[nodeIdx];
      var hasValues = false;
      var subNodeEmpty = {};
      for (var i8 = 0; i8 < 256; i8++) {
        var uCode = node2[i8];
        var mbCode = prefix + i8;
        if (skipEncodeChars[mbCode])
          continue;
        if (uCode >= 0) {
          this._setEncodeChar(uCode, mbCode);
          hasValues = true;
        } else if (uCode <= NODE_START) {
          var subNodeIdx = NODE_START - uCode;
          if (!subNodeEmpty[subNodeIdx]) {
            var newPrefix = mbCode << 8 >>> 0;
            if (this._fillEncodeTable(subNodeIdx, newPrefix, skipEncodeChars))
              hasValues = true;
            else
              subNodeEmpty[subNodeIdx] = true;
          }
        } else if (uCode <= SEQ_START) {
          this._setEncodeSequence(this.decodeTableSeq[SEQ_START - uCode], mbCode);
          hasValues = true;
        }
      }
      return hasValues;
    };
    function DBCSEncoder(options, codec) {
      this.leadSurrogate = -1;
      this.seqObj = void 0;
      this.encodeTable = codec.encodeTable;
      this.encodeTableSeq = codec.encodeTableSeq;
      this.defaultCharSingleByte = codec.defCharSB;
      this.gb18030 = codec.gb18030;
    }
    __name(DBCSEncoder, "DBCSEncoder");
    DBCSEncoder.prototype.write = function(str) {
      var newBuf = Buffer8.alloc(str.length * (this.gb18030 ? 4 : 3)), leadSurrogate = this.leadSurrogate, seqObj = this.seqObj, nextChar = -1, i8 = 0, j7 = 0;
      while (true) {
        if (nextChar === -1) {
          if (i8 == str.length) break;
          var uCode = str.charCodeAt(i8++);
        } else {
          var uCode = nextChar;
          nextChar = -1;
        }
        if (55296 <= uCode && uCode < 57344) {
          if (uCode < 56320) {
            if (leadSurrogate === -1) {
              leadSurrogate = uCode;
              continue;
            } else {
              leadSurrogate = uCode;
              uCode = UNASSIGNED;
            }
          } else {
            if (leadSurrogate !== -1) {
              uCode = 65536 + (leadSurrogate - 55296) * 1024 + (uCode - 56320);
              leadSurrogate = -1;
            } else {
              uCode = UNASSIGNED;
            }
          }
        } else if (leadSurrogate !== -1) {
          nextChar = uCode;
          uCode = UNASSIGNED;
          leadSurrogate = -1;
        }
        var dbcsCode = UNASSIGNED;
        if (seqObj !== void 0 && uCode != UNASSIGNED) {
          var resCode = seqObj[uCode];
          if (typeof resCode === "object") {
            seqObj = resCode;
            continue;
          } else if (typeof resCode == "number") {
            dbcsCode = resCode;
          } else if (resCode == void 0) {
            resCode = seqObj[DEF_CHAR];
            if (resCode !== void 0) {
              dbcsCode = resCode;
              nextChar = uCode;
            }
          }
          seqObj = void 0;
        } else if (uCode >= 0) {
          var subtable = this.encodeTable[uCode >> 8];
          if (subtable !== void 0)
            dbcsCode = subtable[uCode & 255];
          if (dbcsCode <= SEQ_START) {
            seqObj = this.encodeTableSeq[SEQ_START - dbcsCode];
            continue;
          }
          if (dbcsCode == UNASSIGNED && this.gb18030) {
            var idx = findIdx(this.gb18030.uChars, uCode);
            if (idx != -1) {
              var dbcsCode = this.gb18030.gbChars[idx] + (uCode - this.gb18030.uChars[idx]);
              newBuf[j7++] = 129 + Math.floor(dbcsCode / 12600);
              dbcsCode = dbcsCode % 12600;
              newBuf[j7++] = 48 + Math.floor(dbcsCode / 1260);
              dbcsCode = dbcsCode % 1260;
              newBuf[j7++] = 129 + Math.floor(dbcsCode / 10);
              dbcsCode = dbcsCode % 10;
              newBuf[j7++] = 48 + dbcsCode;
              continue;
            }
          }
        }
        if (dbcsCode === UNASSIGNED)
          dbcsCode = this.defaultCharSingleByte;
        if (dbcsCode < 256) {
          newBuf[j7++] = dbcsCode;
        } else if (dbcsCode < 65536) {
          newBuf[j7++] = dbcsCode >> 8;
          newBuf[j7++] = dbcsCode & 255;
        } else if (dbcsCode < 16777216) {
          newBuf[j7++] = dbcsCode >> 16;
          newBuf[j7++] = dbcsCode >> 8 & 255;
          newBuf[j7++] = dbcsCode & 255;
        } else {
          newBuf[j7++] = dbcsCode >>> 24;
          newBuf[j7++] = dbcsCode >>> 16 & 255;
          newBuf[j7++] = dbcsCode >>> 8 & 255;
          newBuf[j7++] = dbcsCode & 255;
        }
      }
      this.seqObj = seqObj;
      this.leadSurrogate = leadSurrogate;
      return newBuf.slice(0, j7);
    };
    DBCSEncoder.prototype.end = function() {
      if (this.leadSurrogate === -1 && this.seqObj === void 0)
        return;
      var newBuf = Buffer8.alloc(10), j7 = 0;
      if (this.seqObj) {
        var dbcsCode = this.seqObj[DEF_CHAR];
        if (dbcsCode !== void 0) {
          if (dbcsCode < 256) {
            newBuf[j7++] = dbcsCode;
          } else {
            newBuf[j7++] = dbcsCode >> 8;
            newBuf[j7++] = dbcsCode & 255;
          }
        }
        this.seqObj = void 0;
      }
      if (this.leadSurrogate !== -1) {
        newBuf[j7++] = this.defaultCharSingleByte;
        this.leadSurrogate = -1;
      }
      return newBuf.slice(0, j7);
    };
    DBCSEncoder.prototype.findIdx = findIdx;
    function DBCSDecoder(options, codec) {
      this.nodeIdx = 0;
      this.prevBytes = [];
      this.decodeTables = codec.decodeTables;
      this.decodeTableSeq = codec.decodeTableSeq;
      this.defaultCharUnicode = codec.defaultCharUnicode;
      this.gb18030 = codec.gb18030;
    }
    __name(DBCSDecoder, "DBCSDecoder");
    DBCSDecoder.prototype.write = function(buf) {
      var newBuf = Buffer8.alloc(buf.length * 2), nodeIdx = this.nodeIdx, prevBytes = this.prevBytes, prevOffset = this.prevBytes.length, seqStart = -this.prevBytes.length, uCode;
      for (var i8 = 0, j7 = 0; i8 < buf.length; i8++) {
        var curByte = i8 >= 0 ? buf[i8] : prevBytes[i8 + prevOffset];
        var uCode = this.decodeTables[nodeIdx][curByte];
        if (uCode >= 0) ; else if (uCode === UNASSIGNED) {
          uCode = this.defaultCharUnicode.charCodeAt(0);
          i8 = seqStart;
        } else if (uCode === GB18030_CODE) {
          if (i8 >= 3) {
            var ptr = (buf[i8 - 3] - 129) * 12600 + (buf[i8 - 2] - 48) * 1260 + (buf[i8 - 1] - 129) * 10 + (curByte - 48);
          } else {
            var ptr = (prevBytes[i8 - 3 + prevOffset] - 129) * 12600 + ((i8 - 2 >= 0 ? buf[i8 - 2] : prevBytes[i8 - 2 + prevOffset]) - 48) * 1260 + ((i8 - 1 >= 0 ? buf[i8 - 1] : prevBytes[i8 - 1 + prevOffset]) - 129) * 10 + (curByte - 48);
          }
          var idx = findIdx(this.gb18030.gbChars, ptr);
          uCode = this.gb18030.uChars[idx] + ptr - this.gb18030.gbChars[idx];
        } else if (uCode <= NODE_START) {
          nodeIdx = NODE_START - uCode;
          continue;
        } else if (uCode <= SEQ_START) {
          var seq = this.decodeTableSeq[SEQ_START - uCode];
          for (var k7 = 0; k7 < seq.length - 1; k7++) {
            uCode = seq[k7];
            newBuf[j7++] = uCode & 255;
            newBuf[j7++] = uCode >> 8;
          }
          uCode = seq[seq.length - 1];
        } else
          throw new Error("iconv-lite internal error: invalid decoding table value " + uCode + " at " + nodeIdx + "/" + curByte);
        if (uCode >= 65536) {
          uCode -= 65536;
          var uCodeLead = 55296 | uCode >> 10;
          newBuf[j7++] = uCodeLead & 255;
          newBuf[j7++] = uCodeLead >> 8;
          uCode = 56320 | uCode & 1023;
        }
        newBuf[j7++] = uCode & 255;
        newBuf[j7++] = uCode >> 8;
        nodeIdx = 0;
        seqStart = i8 + 1;
      }
      this.nodeIdx = nodeIdx;
      this.prevBytes = seqStart >= 0 ? Array.prototype.slice.call(buf, seqStart) : prevBytes.slice(seqStart + prevOffset).concat(Array.prototype.slice.call(buf));
      return newBuf.slice(0, j7).toString("ucs2");
    };
    DBCSDecoder.prototype.end = function() {
      var ret = "";
      while (this.prevBytes.length > 0) {
        ret += this.defaultCharUnicode;
        var bytesArr = this.prevBytes.slice(1);
        this.prevBytes = [];
        this.nodeIdx = 0;
        if (bytesArr.length > 0)
          ret += this.write(bytesArr);
      }
      this.prevBytes = [];
      this.nodeIdx = 0;
      return ret;
    };
    function findIdx(table, val2) {
      if (table[0] > val2)
        return -1;
      var l8 = 0, r10 = table.length;
      while (l8 < r10 - 1) {
        var mid = l8 + (r10 - l8 + 1 >> 1);
        if (table[mid] <= val2)
          l8 = mid;
        else
          r10 = mid;
      }
      return l8;
    }
    __name(findIdx, "findIdx");
  }
});

// ../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/tables/shiftjis.json
var require_shiftjis = __commonJS({
  "../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/tables/shiftjis.json"(exports, module2) {
    module2.exports = [
      ["0", "\0", 128],
      ["a1", "\uFF61", 62],
      ["8140", "\u3000\u3001\u3002\uFF0C\uFF0E\u30FB\uFF1A\uFF1B\uFF1F\uFF01\u309B\u309C\xB4\uFF40\xA8\uFF3E\uFFE3\uFF3F\u30FD\u30FE\u309D\u309E\u3003\u4EDD\u3005\u3006\u3007\u30FC\u2015\u2010\uFF0F\uFF3C\uFF5E\u2225\uFF5C\u2026\u2025\u2018\u2019\u201C\u201D\uFF08\uFF09\u3014\u3015\uFF3B\uFF3D\uFF5B\uFF5D\u3008", 9, "\uFF0B\uFF0D\xB1\xD7"],
      ["8180", "\xF7\uFF1D\u2260\uFF1C\uFF1E\u2266\u2267\u221E\u2234\u2642\u2640\xB0\u2032\u2033\u2103\uFFE5\uFF04\uFFE0\uFFE1\uFF05\uFF03\uFF06\uFF0A\uFF20\xA7\u2606\u2605\u25CB\u25CF\u25CE\u25C7\u25C6\u25A1\u25A0\u25B3\u25B2\u25BD\u25BC\u203B\u3012\u2192\u2190\u2191\u2193\u3013"],
      ["81b8", "\u2208\u220B\u2286\u2287\u2282\u2283\u222A\u2229"],
      ["81c8", "\u2227\u2228\uFFE2\u21D2\u21D4\u2200\u2203"],
      ["81da", "\u2220\u22A5\u2312\u2202\u2207\u2261\u2252\u226A\u226B\u221A\u223D\u221D\u2235\u222B\u222C"],
      ["81f0", "\u212B\u2030\u266F\u266D\u266A\u2020\u2021\xB6"],
      ["81fc", "\u25EF"],
      ["824f", "\uFF10", 9],
      ["8260", "\uFF21", 25],
      ["8281", "\uFF41", 25],
      ["829f", "\u3041", 82],
      ["8340", "\u30A1", 62],
      ["8380", "\u30E0", 22],
      ["839f", "\u0391", 16, "\u03A3", 6],
      ["83bf", "\u03B1", 16, "\u03C3", 6],
      ["8440", "\u0410", 5, "\u0401\u0416", 25],
      ["8470", "\u0430", 5, "\u0451\u0436", 7],
      ["8480", "\u043E", 17],
      ["849f", "\u2500\u2502\u250C\u2510\u2518\u2514\u251C\u252C\u2524\u2534\u253C\u2501\u2503\u250F\u2513\u251B\u2517\u2523\u2533\u252B\u253B\u254B\u2520\u252F\u2528\u2537\u253F\u251D\u2530\u2525\u2538\u2542"],
      ["8740", "\u2460", 19, "\u2160", 9],
      ["875f", "\u3349\u3314\u3322\u334D\u3318\u3327\u3303\u3336\u3351\u3357\u330D\u3326\u3323\u332B\u334A\u333B\u339C\u339D\u339E\u338E\u338F\u33C4\u33A1"],
      ["877e", "\u337B"],
      ["8780", "\u301D\u301F\u2116\u33CD\u2121\u32A4", 4, "\u3231\u3232\u3239\u337E\u337D\u337C\u2252\u2261\u222B\u222E\u2211\u221A\u22A5\u2220\u221F\u22BF\u2235\u2229\u222A"],
      ["889f", "\u4E9C\u5516\u5A03\u963F\u54C0\u611B\u6328\u59F6\u9022\u8475\u831C\u7A50\u60AA\u63E1\u6E25\u65ED\u8466\u82A6\u9BF5\u6893\u5727\u65A1\u6271\u5B9B\u59D0\u867B\u98F4\u7D62\u7DBE\u9B8E\u6216\u7C9F\u88B7\u5B89\u5EB5\u6309\u6697\u6848\u95C7\u978D\u674F\u4EE5\u4F0A\u4F4D\u4F9D\u5049\u56F2\u5937\u59D4\u5A01\u5C09\u60DF\u610F\u6170\u6613\u6905\u70BA\u754F\u7570\u79FB\u7DAD\u7DEF\u80C3\u840E\u8863\u8B02\u9055\u907A\u533B\u4E95\u4EA5\u57DF\u80B2\u90C1\u78EF\u4E00\u58F1\u6EA2\u9038\u7A32\u8328\u828B\u9C2F\u5141\u5370\u54BD\u54E1\u56E0\u59FB\u5F15\u98F2\u6DEB\u80E4\u852D"],
      ["8940", "\u9662\u9670\u96A0\u97FB\u540B\u53F3\u5B87\u70CF\u7FBD\u8FC2\u96E8\u536F\u9D5C\u7ABA\u4E11\u7893\u81FC\u6E26\u5618\u5504\u6B1D\u851A\u9C3B\u59E5\u53A9\u6D66\u74DC\u958F\u5642\u4E91\u904B\u96F2\u834F\u990C\u53E1\u55B6\u5B30\u5F71\u6620\u66F3\u6804\u6C38\u6CF3\u6D29\u745B\u76C8\u7A4E\u9834\u82F1\u885B\u8A60\u92ED\u6DB2\u75AB\u76CA\u99C5\u60A6\u8B01\u8D8A\u95B2\u698E\u53AD\u5186"],
      ["8980", "\u5712\u5830\u5944\u5BB4\u5EF6\u6028\u63A9\u63F4\u6CBF\u6F14\u708E\u7114\u7159\u71D5\u733F\u7E01\u8276\u82D1\u8597\u9060\u925B\u9D1B\u5869\u65BC\u6C5A\u7525\u51F9\u592E\u5965\u5F80\u5FDC\u62BC\u65FA\u6A2A\u6B27\u6BB4\u738B\u7FC1\u8956\u9D2C\u9D0E\u9EC4\u5CA1\u6C96\u837B\u5104\u5C4B\u61B6\u81C6\u6876\u7261\u4E59\u4FFA\u5378\u6069\u6E29\u7A4F\u97F3\u4E0B\u5316\u4EEE\u4F55\u4F3D\u4FA1\u4F73\u52A0\u53EF\u5609\u590F\u5AC1\u5BB6\u5BE1\u79D1\u6687\u679C\u67B6\u6B4C\u6CB3\u706B\u73C2\u798D\u79BE\u7A3C\u7B87\u82B1\u82DB\u8304\u8377\u83EF\u83D3\u8766\u8AB2\u5629\u8CA8\u8FE6\u904E\u971E\u868A\u4FC4\u5CE8\u6211\u7259\u753B\u81E5\u82BD\u86FE\u8CC0\u96C5\u9913\u99D5\u4ECB\u4F1A\u89E3\u56DE\u584A\u58CA\u5EFB\u5FEB\u602A\u6094\u6062\u61D0\u6212\u62D0\u6539"],
      ["8a40", "\u9B41\u6666\u68B0\u6D77\u7070\u754C\u7686\u7D75\u82A5\u87F9\u958B\u968E\u8C9D\u51F1\u52BE\u5916\u54B3\u5BB3\u5D16\u6168\u6982\u6DAF\u788D\u84CB\u8857\u8A72\u93A7\u9AB8\u6D6C\u99A8\u86D9\u57A3\u67FF\u86CE\u920E\u5283\u5687\u5404\u5ED3\u62E1\u64B9\u683C\u6838\u6BBB\u7372\u78BA\u7A6B\u899A\u89D2\u8D6B\u8F03\u90ED\u95A3\u9694\u9769\u5B66\u5CB3\u697D\u984D\u984E\u639B\u7B20\u6A2B"],
      ["8a80", "\u6A7F\u68B6\u9C0D\u6F5F\u5272\u559D\u6070\u62EC\u6D3B\u6E07\u6ED1\u845B\u8910\u8F44\u4E14\u9C39\u53F6\u691B\u6A3A\u9784\u682A\u515C\u7AC3\u84B2\u91DC\u938C\u565B\u9D28\u6822\u8305\u8431\u7CA5\u5208\u82C5\u74E6\u4E7E\u4F83\u51A0\u5BD2\u520A\u52D8\u52E7\u5DFB\u559A\u582A\u59E6\u5B8C\u5B98\u5BDB\u5E72\u5E79\u60A3\u611F\u6163\u61BE\u63DB\u6562\u67D1\u6853\u68FA\u6B3E\u6B53\u6C57\u6F22\u6F97\u6F45\u74B0\u7518\u76E3\u770B\u7AFF\u7BA1\u7C21\u7DE9\u7F36\u7FF0\u809D\u8266\u839E\u89B3\u8ACC\u8CAB\u9084\u9451\u9593\u9591\u95A2\u9665\u97D3\u9928\u8218\u4E38\u542B\u5CB8\u5DCC\u73A9\u764C\u773C\u5CA9\u7FEB\u8D0B\u96C1\u9811\u9854\u9858\u4F01\u4F0E\u5371\u559C\u5668\u57FA\u5947\u5B09\u5BC4\u5C90\u5E0C\u5E7E\u5FCC\u63EE\u673A\u65D7\u65E2\u671F\u68CB\u68C4"],
      ["8b40", "\u6A5F\u5E30\u6BC5\u6C17\u6C7D\u757F\u7948\u5B63\u7A00\u7D00\u5FBD\u898F\u8A18\u8CB4\u8D77\u8ECC\u8F1D\u98E2\u9A0E\u9B3C\u4E80\u507D\u5100\u5993\u5B9C\u622F\u6280\u64EC\u6B3A\u72A0\u7591\u7947\u7FA9\u87FB\u8ABC\u8B70\u63AC\u83CA\u97A0\u5409\u5403\u55AB\u6854\u6A58\u8A70\u7827\u6775\u9ECD\u5374\u5BA2\u811A\u8650\u9006\u4E18\u4E45\u4EC7\u4F11\u53CA\u5438\u5BAE\u5F13\u6025\u6551"],
      ["8b80", "\u673D\u6C42\u6C72\u6CE3\u7078\u7403\u7A76\u7AAE\u7B08\u7D1A\u7CFE\u7D66\u65E7\u725B\u53BB\u5C45\u5DE8\u62D2\u62E0\u6319\u6E20\u865A\u8A31\u8DDD\u92F8\u6F01\u79A6\u9B5A\u4EA8\u4EAB\u4EAC\u4F9B\u4FA0\u50D1\u5147\u7AF6\u5171\u51F6\u5354\u5321\u537F\u53EB\u55AC\u5883\u5CE1\u5F37\u5F4A\u602F\u6050\u606D\u631F\u6559\u6A4B\u6CC1\u72C2\u72ED\u77EF\u80F8\u8105\u8208\u854E\u90F7\u93E1\u97FF\u9957\u9A5A\u4EF0\u51DD\u5C2D\u6681\u696D\u5C40\u66F2\u6975\u7389\u6850\u7C81\u50C5\u52E4\u5747\u5DFE\u9326\u65A4\u6B23\u6B3D\u7434\u7981\u79BD\u7B4B\u7DCA\u82B9\u83CC\u887F\u895F\u8B39\u8FD1\u91D1\u541F\u9280\u4E5D\u5036\u53E5\u533A\u72D7\u7396\u77E9\u82E6\u8EAF\u99C6\u99C8\u99D2\u5177\u611A\u865E\u55B0\u7A7A\u5076\u5BD3\u9047\u9685\u4E32\u6ADB\u91E7\u5C51\u5C48"],
      ["8c40", "\u6398\u7A9F\u6C93\u9774\u8F61\u7AAA\u718A\u9688\u7C82\u6817\u7E70\u6851\u936C\u52F2\u541B\u85AB\u8A13\u7FA4\u8ECD\u90E1\u5366\u8888\u7941\u4FC2\u50BE\u5211\u5144\u5553\u572D\u73EA\u578B\u5951\u5F62\u5F84\u6075\u6176\u6167\u61A9\u63B2\u643A\u656C\u666F\u6842\u6E13\u7566\u7A3D\u7CFB\u7D4C\u7D99\u7E4B\u7F6B\u830E\u834A\u86CD\u8A08\u8A63\u8B66\u8EFD\u981A\u9D8F\u82B8\u8FCE\u9BE8"],
      ["8c80", "\u5287\u621F\u6483\u6FC0\u9699\u6841\u5091\u6B20\u6C7A\u6F54\u7A74\u7D50\u8840\u8A23\u6708\u4EF6\u5039\u5026\u5065\u517C\u5238\u5263\u55A7\u570F\u5805\u5ACC\u5EFA\u61B2\u61F8\u62F3\u6372\u691C\u6A29\u727D\u72AC\u732E\u7814\u786F\u7D79\u770C\u80A9\u898B\u8B19\u8CE2\u8ED2\u9063\u9375\u967A\u9855\u9A13\u9E78\u5143\u539F\u53B3\u5E7B\u5F26\u6E1B\u6E90\u7384\u73FE\u7D43\u8237\u8A00\u8AFA\u9650\u4E4E\u500B\u53E4\u547C\u56FA\u59D1\u5B64\u5DF1\u5EAB\u5F27\u6238\u6545\u67AF\u6E56\u72D0\u7CCA\u88B4\u80A1\u80E1\u83F0\u864E\u8A87\u8DE8\u9237\u96C7\u9867\u9F13\u4E94\u4E92\u4F0D\u5348\u5449\u543E\u5A2F\u5F8C\u5FA1\u609F\u68A7\u6A8E\u745A\u7881\u8A9E\u8AA4\u8B77\u9190\u4E5E\u9BC9\u4EA4\u4F7C\u4FAF\u5019\u5016\u5149\u516C\u529F\u52B9\u52FE\u539A\u53E3\u5411"],
      ["8d40", "\u540E\u5589\u5751\u57A2\u597D\u5B54\u5B5D\u5B8F\u5DE5\u5DE7\u5DF7\u5E78\u5E83\u5E9A\u5EB7\u5F18\u6052\u614C\u6297\u62D8\u63A7\u653B\u6602\u6643\u66F4\u676D\u6821\u6897\u69CB\u6C5F\u6D2A\u6D69\u6E2F\u6E9D\u7532\u7687\u786C\u7A3F\u7CE0\u7D05\u7D18\u7D5E\u7DB1\u8015\u8003\u80AF\u80B1\u8154\u818F\u822A\u8352\u884C\u8861\u8B1B\u8CA2\u8CFC\u90CA\u9175\u9271\u783F\u92FC\u95A4\u964D"],
      ["8d80", "\u9805\u9999\u9AD8\u9D3B\u525B\u52AB\u53F7\u5408\u58D5\u62F7\u6FE0\u8C6A\u8F5F\u9EB9\u514B\u523B\u544A\u56FD\u7A40\u9177\u9D60\u9ED2\u7344\u6F09\u8170\u7511\u5FFD\u60DA\u9AA8\u72DB\u8FBC\u6B64\u9803\u4ECA\u56F0\u5764\u58BE\u5A5A\u6068\u61C7\u660F\u6606\u6839\u68B1\u6DF7\u75D5\u7D3A\u826E\u9B42\u4E9B\u4F50\u53C9\u5506\u5D6F\u5DE6\u5DEE\u67FB\u6C99\u7473\u7802\u8A50\u9396\u88DF\u5750\u5EA7\u632B\u50B5\u50AC\u518D\u6700\u54C9\u585E\u59BB\u5BB0\u5F69\u624D\u63A1\u683D\u6B73\u6E08\u707D\u91C7\u7280\u7815\u7826\u796D\u658E\u7D30\u83DC\u88C1\u8F09\u969B\u5264\u5728\u6750\u7F6A\u8CA1\u51B4\u5742\u962A\u583A\u698A\u80B4\u54B2\u5D0E\u57FC\u7895\u9DFA\u4F5C\u524A\u548B\u643E\u6628\u6714\u67F5\u7A84\u7B56\u7D22\u932F\u685C\u9BAD\u7B39\u5319\u518A\u5237"],
      ["8e40", "\u5BDF\u62F6\u64AE\u64E6\u672D\u6BBA\u85A9\u96D1\u7690\u9BD6\u634C\u9306\u9BAB\u76BF\u6652\u4E09\u5098\u53C2\u5C71\u60E8\u6492\u6563\u685F\u71E6\u73CA\u7523\u7B97\u7E82\u8695\u8B83\u8CDB\u9178\u9910\u65AC\u66AB\u6B8B\u4ED5\u4ED4\u4F3A\u4F7F\u523A\u53F8\u53F2\u55E3\u56DB\u58EB\u59CB\u59C9\u59FF\u5B50\u5C4D\u5E02\u5E2B\u5FD7\u601D\u6307\u652F\u5B5C\u65AF\u65BD\u65E8\u679D\u6B62"],
      ["8e80", "\u6B7B\u6C0F\u7345\u7949\u79C1\u7CF8\u7D19\u7D2B\u80A2\u8102\u81F3\u8996\u8A5E\u8A69\u8A66\u8A8C\u8AEE\u8CC7\u8CDC\u96CC\u98FC\u6B6F\u4E8B\u4F3C\u4F8D\u5150\u5B57\u5BFA\u6148\u6301\u6642\u6B21\u6ECB\u6CBB\u723E\u74BD\u75D4\u78C1\u793A\u800C\u8033\u81EA\u8494\u8F9E\u6C50\u9E7F\u5F0F\u8B58\u9D2B\u7AFA\u8EF8\u5B8D\u96EB\u4E03\u53F1\u57F7\u5931\u5AC9\u5BA4\u6089\u6E7F\u6F06\u75BE\u8CEA\u5B9F\u8500\u7BE0\u5072\u67F4\u829D\u5C61\u854A\u7E1E\u820E\u5199\u5C04\u6368\u8D66\u659C\u716E\u793E\u7D17\u8005\u8B1D\u8ECA\u906E\u86C7\u90AA\u501F\u52FA\u5C3A\u6753\u707C\u7235\u914C\u91C8\u932B\u82E5\u5BC2\u5F31\u60F9\u4E3B\u53D6\u5B88\u624B\u6731\u6B8A\u72E9\u73E0\u7A2E\u816B\u8DA3\u9152\u9996\u5112\u53D7\u546A\u5BFF\u6388\u6A39\u7DAC\u9700\u56DA\u53CE\u5468"],
      ["8f40", "\u5B97\u5C31\u5DDE\u4FEE\u6101\u62FE\u6D32\u79C0\u79CB\u7D42\u7E4D\u7FD2\u81ED\u821F\u8490\u8846\u8972\u8B90\u8E74\u8F2F\u9031\u914B\u916C\u96C6\u919C\u4EC0\u4F4F\u5145\u5341\u5F93\u620E\u67D4\u6C41\u6E0B\u7363\u7E26\u91CD\u9283\u53D4\u5919\u5BBF\u6DD1\u795D\u7E2E\u7C9B\u587E\u719F\u51FA\u8853\u8FF0\u4FCA\u5CFB\u6625\u77AC\u7AE3\u821C\u99FF\u51C6\u5FAA\u65EC\u696F\u6B89\u6DF3"],
      ["8f80", "\u6E96\u6F64\u76FE\u7D14\u5DE1\u9075\u9187\u9806\u51E6\u521D\u6240\u6691\u66D9\u6E1A\u5EB6\u7DD2\u7F72\u66F8\u85AF\u85F7\u8AF8\u52A9\u53D9\u5973\u5E8F\u5F90\u6055\u92E4\u9664\u50B7\u511F\u52DD\u5320\u5347\u53EC\u54E8\u5546\u5531\u5617\u5968\u59BE\u5A3C\u5BB5\u5C06\u5C0F\u5C11\u5C1A\u5E84\u5E8A\u5EE0\u5F70\u627F\u6284\u62DB\u638C\u6377\u6607\u660C\u662D\u6676\u677E\u68A2\u6A1F\u6A35\u6CBC\u6D88\u6E09\u6E58\u713C\u7126\u7167\u75C7\u7701\u785D\u7901\u7965\u79F0\u7AE0\u7B11\u7CA7\u7D39\u8096\u83D6\u848B\u8549\u885D\u88F3\u8A1F\u8A3C\u8A54\u8A73\u8C61\u8CDE\u91A4\u9266\u937E\u9418\u969C\u9798\u4E0A\u4E08\u4E1E\u4E57\u5197\u5270\u57CE\u5834\u58CC\u5B22\u5E38\u60C5\u64FE\u6761\u6756\u6D44\u72B6\u7573\u7A63\u84B8\u8B72\u91B8\u9320\u5631\u57F4\u98FE"],
      ["9040", "\u62ED\u690D\u6B96\u71ED\u7E54\u8077\u8272\u89E6\u98DF\u8755\u8FB1\u5C3B\u4F38\u4FE1\u4FB5\u5507\u5A20\u5BDD\u5BE9\u5FC3\u614E\u632F\u65B0\u664B\u68EE\u699B\u6D78\u6DF1\u7533\u75B9\u771F\u795E\u79E6\u7D33\u81E3\u82AF\u85AA\u89AA\u8A3A\u8EAB\u8F9B\u9032\u91DD\u9707\u4EBA\u4EC1\u5203\u5875\u58EC\u5C0B\u751A\u5C3D\u814E\u8A0A\u8FC5\u9663\u976D\u7B25\u8ACF\u9808\u9162\u56F3\u53A8"],
      ["9080", "\u9017\u5439\u5782\u5E25\u63A8\u6C34\u708A\u7761\u7C8B\u7FE0\u8870\u9042\u9154\u9310\u9318\u968F\u745E\u9AC4\u5D07\u5D69\u6570\u67A2\u8DA8\u96DB\u636E\u6749\u6919\u83C5\u9817\u96C0\u88FE\u6F84\u647A\u5BF8\u4E16\u702C\u755D\u662F\u51C4\u5236\u52E2\u59D3\u5F81\u6027\u6210\u653F\u6574\u661F\u6674\u68F2\u6816\u6B63\u6E05\u7272\u751F\u76DB\u7CBE\u8056\u58F0\u88FD\u897F\u8AA0\u8A93\u8ACB\u901D\u9192\u9752\u9759\u6589\u7A0E\u8106\u96BB\u5E2D\u60DC\u621A\u65A5\u6614\u6790\u77F3\u7A4D\u7C4D\u7E3E\u810A\u8CAC\u8D64\u8DE1\u8E5F\u78A9\u5207\u62D9\u63A5\u6442\u6298\u8A2D\u7A83\u7BC0\u8AAC\u96EA\u7D76\u820C\u8749\u4ED9\u5148\u5343\u5360\u5BA3\u5C02\u5C16\u5DDD\u6226\u6247\u64B0\u6813\u6834\u6CC9\u6D45\u6D17\u67D3\u6F5C\u714E\u717D\u65CB\u7A7F\u7BAD\u7DDA"],
      ["9140", "\u7E4A\u7FA8\u817A\u821B\u8239\u85A6\u8A6E\u8CCE\u8DF5\u9078\u9077\u92AD\u9291\u9583\u9BAE\u524D\u5584\u6F38\u7136\u5168\u7985\u7E55\u81B3\u7CCE\u564C\u5851\u5CA8\u63AA\u66FE\u66FD\u695A\u72D9\u758F\u758E\u790E\u7956\u79DF\u7C97\u7D20\u7D44\u8607\u8A34\u963B\u9061\u9F20\u50E7\u5275\u53CC\u53E2\u5009\u55AA\u58EE\u594F\u723D\u5B8B\u5C64\u531D\u60E3\u60F3\u635C\u6383\u633F\u63BB"],
      ["9180", "\u64CD\u65E9\u66F9\u5DE3\u69CD\u69FD\u6F15\u71E5\u4E89\u75E9\u76F8\u7A93\u7CDF\u7DCF\u7D9C\u8061\u8349\u8358\u846C\u84BC\u85FB\u88C5\u8D70\u9001\u906D\u9397\u971C\u9A12\u50CF\u5897\u618E\u81D3\u8535\u8D08\u9020\u4FC3\u5074\u5247\u5373\u606F\u6349\u675F\u6E2C\u8DB3\u901F\u4FD7\u5C5E\u8CCA\u65CF\u7D9A\u5352\u8896\u5176\u63C3\u5B58\u5B6B\u5C0A\u640D\u6751\u905C\u4ED6\u591A\u592A\u6C70\u8A51\u553E\u5815\u59A5\u60F0\u6253\u67C1\u8235\u6955\u9640\u99C4\u9A28\u4F53\u5806\u5BFE\u8010\u5CB1\u5E2F\u5F85\u6020\u614B\u6234\u66FF\u6CF0\u6EDE\u80CE\u817F\u82D4\u888B\u8CB8\u9000\u902E\u968A\u9EDB\u9BDB\u4EE3\u53F0\u5927\u7B2C\u918D\u984C\u9DF9\u6EDD\u7027\u5353\u5544\u5B85\u6258\u629E\u62D3\u6CA2\u6FEF\u7422\u8A17\u9438\u6FC1\u8AFE\u8338\u51E7\u86F8\u53EA"],
      ["9240", "\u53E9\u4F46\u9054\u8FB0\u596A\u8131\u5DFD\u7AEA\u8FBF\u68DA\u8C37\u72F8\u9C48\u6A3D\u8AB0\u4E39\u5358\u5606\u5766\u62C5\u63A2\u65E6\u6B4E\u6DE1\u6E5B\u70AD\u77ED\u7AEF\u7BAA\u7DBB\u803D\u80C6\u86CB\u8A95\u935B\u56E3\u58C7\u5F3E\u65AD\u6696\u6A80\u6BB5\u7537\u8AC7\u5024\u77E5\u5730\u5F1B\u6065\u667A\u6C60\u75F4\u7A1A\u7F6E\u81F4\u8718\u9045\u99B3\u7BC9\u755C\u7AF9\u7B51\u84C4"],
      ["9280", "\u9010\u79E9\u7A92\u8336\u5AE1\u7740\u4E2D\u4EF2\u5B99\u5FE0\u62BD\u663C\u67F1\u6CE8\u866B\u8877\u8A3B\u914E\u92F3\u99D0\u6A17\u7026\u732A\u82E7\u8457\u8CAF\u4E01\u5146\u51CB\u558B\u5BF5\u5E16\u5E33\u5E81\u5F14\u5F35\u5F6B\u5FB4\u61F2\u6311\u66A2\u671D\u6F6E\u7252\u753A\u773A\u8074\u8139\u8178\u8776\u8ABF\u8ADC\u8D85\u8DF3\u929A\u9577\u9802\u9CE5\u52C5\u6357\u76F4\u6715\u6C88\u73CD\u8CC3\u93AE\u9673\u6D25\u589C\u690E\u69CC\u8FFD\u939A\u75DB\u901A\u585A\u6802\u63B4\u69FB\u4F43\u6F2C\u67D8\u8FBB\u8526\u7DB4\u9354\u693F\u6F70\u576A\u58F7\u5B2C\u7D2C\u722A\u540A\u91E3\u9DB4\u4EAD\u4F4E\u505C\u5075\u5243\u8C9E\u5448\u5824\u5B9A\u5E1D\u5E95\u5EAD\u5EF7\u5F1F\u608C\u62B5\u633A\u63D0\u68AF\u6C40\u7887\u798E\u7A0B\u7DE0\u8247\u8A02\u8AE6\u8E44\u9013"],
      ["9340", "\u90B8\u912D\u91D8\u9F0E\u6CE5\u6458\u64E2\u6575\u6EF4\u7684\u7B1B\u9069\u93D1\u6EBA\u54F2\u5FB9\u64A4\u8F4D\u8FED\u9244\u5178\u586B\u5929\u5C55\u5E97\u6DFB\u7E8F\u751C\u8CBC\u8EE2\u985B\u70B9\u4F1D\u6BBF\u6FB1\u7530\u96FB\u514E\u5410\u5835\u5857\u59AC\u5C60\u5F92\u6597\u675C\u6E21\u767B\u83DF\u8CED\u9014\u90FD\u934D\u7825\u783A\u52AA\u5EA6\u571F\u5974\u6012\u5012\u515A\u51AC"],
      ["9380", "\u51CD\u5200\u5510\u5854\u5858\u5957\u5B95\u5CF6\u5D8B\u60BC\u6295\u642D\u6771\u6843\u68BC\u68DF\u76D7\u6DD8\u6E6F\u6D9B\u706F\u71C8\u5F53\u75D8\u7977\u7B49\u7B54\u7B52\u7CD6\u7D71\u5230\u8463\u8569\u85E4\u8A0E\u8B04\u8C46\u8E0F\u9003\u900F\u9419\u9676\u982D\u9A30\u95D8\u50CD\u52D5\u540C\u5802\u5C0E\u61A7\u649E\u6D1E\u77B3\u7AE5\u80F4\u8404\u9053\u9285\u5CE0\u9D07\u533F\u5F97\u5FB3\u6D9C\u7279\u7763\u79BF\u7BE4\u6BD2\u72EC\u8AAD\u6803\u6A61\u51F8\u7A81\u6934\u5C4A\u9CF6\u82EB\u5BC5\u9149\u701E\u5678\u5C6F\u60C7\u6566\u6C8C\u8C5A\u9041\u9813\u5451\u66C7\u920D\u5948\u90A3\u5185\u4E4D\u51EA\u8599\u8B0E\u7058\u637A\u934B\u6962\u99B4\u7E04\u7577\u5357\u6960\u8EDF\u96E3\u6C5D\u4E8C\u5C3C\u5F10\u8FE9\u5302\u8CD1\u8089\u8679\u5EFF\u65E5\u4E73\u5165"],
      ["9440", "\u5982\u5C3F\u97EE\u4EFB\u598A\u5FCD\u8A8D\u6FE1\u79B0\u7962\u5BE7\u8471\u732B\u71B1\u5E74\u5FF5\u637B\u649A\u71C3\u7C98\u4E43\u5EFC\u4E4B\u57DC\u56A2\u60A9\u6FC3\u7D0D\u80FD\u8133\u81BF\u8FB2\u8997\u86A4\u5DF4\u628A\u64AD\u8987\u6777\u6CE2\u6D3E\u7436\u7834\u5A46\u7F75\u82AD\u99AC\u4FF3\u5EC3\u62DD\u6392\u6557\u676F\u76C3\u724C\u80CC\u80BA\u8F29\u914D\u500D\u57F9\u5A92\u6885"],
      ["9480", "\u6973\u7164\u72FD\u8CB7\u58F2\u8CE0\u966A\u9019\u877F\u79E4\u77E7\u8429\u4F2F\u5265\u535A\u62CD\u67CF\u6CCA\u767D\u7B94\u7C95\u8236\u8584\u8FEB\u66DD\u6F20\u7206\u7E1B\u83AB\u99C1\u9EA6\u51FD\u7BB1\u7872\u7BB8\u8087\u7B48\u6AE8\u5E61\u808C\u7551\u7560\u516B\u9262\u6E8C\u767A\u9197\u9AEA\u4F10\u7F70\u629C\u7B4F\u95A5\u9CE9\u567A\u5859\u86E4\u96BC\u4F34\u5224\u534A\u53CD\u53DB\u5E06\u642C\u6591\u677F\u6C3E\u6C4E\u7248\u72AF\u73ED\u7554\u7E41\u822C\u85E9\u8CA9\u7BC4\u91C6\u7169\u9812\u98EF\u633D\u6669\u756A\u76E4\u78D0\u8543\u86EE\u532A\u5351\u5426\u5983\u5E87\u5F7C\u60B2\u6249\u6279\u62AB\u6590\u6BD4\u6CCC\u75B2\u76AE\u7891\u79D8\u7DCB\u7F77\u80A5\u88AB\u8AB9\u8CBB\u907F\u975E\u98DB\u6A0B\u7C38\u5099\u5C3E\u5FAE\u6787\u6BD8\u7435\u7709\u7F8E"],
      ["9540", "\u9F3B\u67CA\u7A17\u5339\u758B\u9AED\u5F66\u819D\u83F1\u8098\u5F3C\u5FC5\u7562\u7B46\u903C\u6867\u59EB\u5A9B\u7D10\u767E\u8B2C\u4FF5\u5F6A\u6A19\u6C37\u6F02\u74E2\u7968\u8868\u8A55\u8C79\u5EDF\u63CF\u75C5\u79D2\u82D7\u9328\u92F2\u849C\u86ED\u9C2D\u54C1\u5F6C\u658C\u6D5C\u7015\u8CA7\u8CD3\u983B\u654F\u74F6\u4E0D\u4ED8\u57E0\u592B\u5A66\u5BCC\u51A8\u5E03\u5E9C\u6016\u6276\u6577"],
      ["9580", "\u65A7\u666E\u6D6E\u7236\u7B26\u8150\u819A\u8299\u8B5C\u8CA0\u8CE6\u8D74\u961C\u9644\u4FAE\u64AB\u6B66\u821E\u8461\u856A\u90E8\u5C01\u6953\u98A8\u847A\u8557\u4F0F\u526F\u5FA9\u5E45\u670D\u798F\u8179\u8907\u8986\u6DF5\u5F17\u6255\u6CB8\u4ECF\u7269\u9B92\u5206\u543B\u5674\u58B3\u61A4\u626E\u711A\u596E\u7C89\u7CDE\u7D1B\u96F0\u6587\u805E\u4E19\u4F75\u5175\u5840\u5E63\u5E73\u5F0A\u67C4\u4E26\u853D\u9589\u965B\u7C73\u9801\u50FB\u58C1\u7656\u78A7\u5225\u77A5\u8511\u7B86\u504F\u5909\u7247\u7BC7\u7DE8\u8FBA\u8FD4\u904D\u4FBF\u52C9\u5A29\u5F01\u97AD\u4FDD\u8217\u92EA\u5703\u6355\u6B69\u752B\u88DC\u8F14\u7A42\u52DF\u5893\u6155\u620A\u66AE\u6BCD\u7C3F\u83E9\u5023\u4FF8\u5305\u5446\u5831\u5949\u5B9D\u5CF0\u5CEF\u5D29\u5E96\u62B1\u6367\u653E\u65B9\u670B"],
      ["9640", "\u6CD5\u6CE1\u70F9\u7832\u7E2B\u80DE\u82B3\u840C\u84EC\u8702\u8912\u8A2A\u8C4A\u90A6\u92D2\u98FD\u9CF3\u9D6C\u4E4F\u4EA1\u508D\u5256\u574A\u59A8\u5E3D\u5FD8\u5FD9\u623F\u66B4\u671B\u67D0\u68D2\u5192\u7D21\u80AA\u81A8\u8B00\u8C8C\u8CBF\u927E\u9632\u5420\u982C\u5317\u50D5\u535C\u58A8\u64B2\u6734\u7267\u7766\u7A46\u91E6\u52C3\u6CA1\u6B86\u5800\u5E4C\u5954\u672C\u7FFB\u51E1\u76C6"],
      ["9680", "\u6469\u78E8\u9B54\u9EBB\u57CB\u59B9\u6627\u679A\u6BCE\u54E9\u69D9\u5E55\u819C\u6795\u9BAA\u67FE\u9C52\u685D\u4EA6\u4FE3\u53C8\u62B9\u672B\u6CAB\u8FC4\u4FAD\u7E6D\u9EBF\u4E07\u6162\u6E80\u6F2B\u8513\u5473\u672A\u9B45\u5DF3\u7B95\u5CAC\u5BC6\u871C\u6E4A\u84D1\u7A14\u8108\u5999\u7C8D\u6C11\u7720\u52D9\u5922\u7121\u725F\u77DB\u9727\u9D61\u690B\u5A7F\u5A18\u51A5\u540D\u547D\u660E\u76DF\u8FF7\u9298\u9CF4\u59EA\u725D\u6EC5\u514D\u68C9\u7DBF\u7DEC\u9762\u9EBA\u6478\u6A21\u8302\u5984\u5B5F\u6BDB\u731B\u76F2\u7DB2\u8017\u8499\u5132\u6728\u9ED9\u76EE\u6762\u52FF\u9905\u5C24\u623B\u7C7E\u8CB0\u554F\u60B6\u7D0B\u9580\u5301\u4E5F\u51B6\u591C\u723A\u8036\u91CE\u5F25\u77E2\u5384\u5F79\u7D04\u85AC\u8A33\u8E8D\u9756\u67F3\u85AE\u9453\u6109\u6108\u6CB9\u7652"],
      ["9740", "\u8AED\u8F38\u552F\u4F51\u512A\u52C7\u53CB\u5BA5\u5E7D\u60A0\u6182\u63D6\u6709\u67DA\u6E67\u6D8C\u7336\u7337\u7531\u7950\u88D5\u8A98\u904A\u9091\u90F5\u96C4\u878D\u5915\u4E88\u4F59\u4E0E\u8A89\u8F3F\u9810\u50AD\u5E7C\u5996\u5BB9\u5EB8\u63DA\u63FA\u64C1\u66DC\u694A\u69D8\u6D0B\u6EB6\u7194\u7528\u7AAF\u7F8A\u8000\u8449\u84C9\u8981\u8B21\u8E0A\u9065\u967D\u990A\u617E\u6291\u6B32"],
      ["9780", "\u6C83\u6D74\u7FCC\u7FFC\u6DC0\u7F85\u87BA\u88F8\u6765\u83B1\u983C\u96F7\u6D1B\u7D61\u843D\u916A\u4E71\u5375\u5D50\u6B04\u6FEB\u85CD\u862D\u89A7\u5229\u540F\u5C65\u674E\u68A8\u7406\u7483\u75E2\u88CF\u88E1\u91CC\u96E2\u9678\u5F8B\u7387\u7ACB\u844E\u63A0\u7565\u5289\u6D41\u6E9C\u7409\u7559\u786B\u7C92\u9686\u7ADC\u9F8D\u4FB6\u616E\u65C5\u865C\u4E86\u4EAE\u50DA\u4E21\u51CC\u5BEE\u6599\u6881\u6DBC\u731F\u7642\u77AD\u7A1C\u7CE7\u826F\u8AD2\u907C\u91CF\u9675\u9818\u529B\u7DD1\u502B\u5398\u6797\u6DCB\u71D0\u7433\u81E8\u8F2A\u96A3\u9C57\u9E9F\u7460\u5841\u6D99\u7D2F\u985E\u4EE4\u4F36\u4F8B\u51B7\u52B1\u5DBA\u601C\u73B2\u793C\u82D3\u9234\u96B7\u96F6\u970A\u9E97\u9F62\u66A6\u6B74\u5217\u52A3\u70C8\u88C2\u5EC9\u604B\u6190\u6F23\u7149\u7C3E\u7DF4\u806F"],
      ["9840", "\u84EE\u9023\u932C\u5442\u9B6F\u6AD3\u7089\u8CC2\u8DEF\u9732\u52B4\u5A41\u5ECA\u5F04\u6717\u697C\u6994\u6D6A\u6F0F\u7262\u72FC\u7BED\u8001\u807E\u874B\u90CE\u516D\u9E93\u7984\u808B\u9332\u8AD6\u502D\u548C\u8A71\u6B6A\u8CC4\u8107\u60D1\u67A0\u9DF2\u4E99\u4E98\u9C10\u8A6B\u85C1\u8568\u6900\u6E7E\u7897\u8155"],
      ["989f", "\u5F0C\u4E10\u4E15\u4E2A\u4E31\u4E36\u4E3C\u4E3F\u4E42\u4E56\u4E58\u4E82\u4E85\u8C6B\u4E8A\u8212\u5F0D\u4E8E\u4E9E\u4E9F\u4EA0\u4EA2\u4EB0\u4EB3\u4EB6\u4ECE\u4ECD\u4EC4\u4EC6\u4EC2\u4ED7\u4EDE\u4EED\u4EDF\u4EF7\u4F09\u4F5A\u4F30\u4F5B\u4F5D\u4F57\u4F47\u4F76\u4F88\u4F8F\u4F98\u4F7B\u4F69\u4F70\u4F91\u4F6F\u4F86\u4F96\u5118\u4FD4\u4FDF\u4FCE\u4FD8\u4FDB\u4FD1\u4FDA\u4FD0\u4FE4\u4FE5\u501A\u5028\u5014\u502A\u5025\u5005\u4F1C\u4FF6\u5021\u5029\u502C\u4FFE\u4FEF\u5011\u5006\u5043\u5047\u6703\u5055\u5050\u5048\u505A\u5056\u506C\u5078\u5080\u509A\u5085\u50B4\u50B2"],
      ["9940", "\u50C9\u50CA\u50B3\u50C2\u50D6\u50DE\u50E5\u50ED\u50E3\u50EE\u50F9\u50F5\u5109\u5101\u5102\u5116\u5115\u5114\u511A\u5121\u513A\u5137\u513C\u513B\u513F\u5140\u5152\u514C\u5154\u5162\u7AF8\u5169\u516A\u516E\u5180\u5182\u56D8\u518C\u5189\u518F\u5191\u5193\u5195\u5196\u51A4\u51A6\u51A2\u51A9\u51AA\u51AB\u51B3\u51B1\u51B2\u51B0\u51B5\u51BD\u51C5\u51C9\u51DB\u51E0\u8655\u51E9\u51ED"],
      ["9980", "\u51F0\u51F5\u51FE\u5204\u520B\u5214\u520E\u5227\u522A\u522E\u5233\u5239\u524F\u5244\u524B\u524C\u525E\u5254\u526A\u5274\u5269\u5273\u527F\u527D\u528D\u5294\u5292\u5271\u5288\u5291\u8FA8\u8FA7\u52AC\u52AD\u52BC\u52B5\u52C1\u52CD\u52D7\u52DE\u52E3\u52E6\u98ED\u52E0\u52F3\u52F5\u52F8\u52F9\u5306\u5308\u7538\u530D\u5310\u530F\u5315\u531A\u5323\u532F\u5331\u5333\u5338\u5340\u5346\u5345\u4E17\u5349\u534D\u51D6\u535E\u5369\u536E\u5918\u537B\u5377\u5382\u5396\u53A0\u53A6\u53A5\u53AE\u53B0\u53B6\u53C3\u7C12\u96D9\u53DF\u66FC\u71EE\u53EE\u53E8\u53ED\u53FA\u5401\u543D\u5440\u542C\u542D\u543C\u542E\u5436\u5429\u541D\u544E\u548F\u5475\u548E\u545F\u5471\u5477\u5470\u5492\u547B\u5480\u5476\u5484\u5490\u5486\u54C7\u54A2\u54B8\u54A5\u54AC\u54C4\u54C8\u54A8"],
      ["9a40", "\u54AB\u54C2\u54A4\u54BE\u54BC\u54D8\u54E5\u54E6\u550F\u5514\u54FD\u54EE\u54ED\u54FA\u54E2\u5539\u5540\u5563\u554C\u552E\u555C\u5545\u5556\u5557\u5538\u5533\u555D\u5599\u5580\u54AF\u558A\u559F\u557B\u557E\u5598\u559E\u55AE\u557C\u5583\u55A9\u5587\u55A8\u55DA\u55C5\u55DF\u55C4\u55DC\u55E4\u55D4\u5614\u55F7\u5616\u55FE\u55FD\u561B\u55F9\u564E\u5650\u71DF\u5634\u5636\u5632\u5638"],
      ["9a80", "\u566B\u5664\u562F\u566C\u566A\u5686\u5680\u568A\u56A0\u5694\u568F\u56A5\u56AE\u56B6\u56B4\u56C2\u56BC\u56C1\u56C3\u56C0\u56C8\u56CE\u56D1\u56D3\u56D7\u56EE\u56F9\u5700\u56FF\u5704\u5709\u5708\u570B\u570D\u5713\u5718\u5716\u55C7\u571C\u5726\u5737\u5738\u574E\u573B\u5740\u574F\u5769\u57C0\u5788\u5761\u577F\u5789\u5793\u57A0\u57B3\u57A4\u57AA\u57B0\u57C3\u57C6\u57D4\u57D2\u57D3\u580A\u57D6\u57E3\u580B\u5819\u581D\u5872\u5821\u5862\u584B\u5870\u6BC0\u5852\u583D\u5879\u5885\u58B9\u589F\u58AB\u58BA\u58DE\u58BB\u58B8\u58AE\u58C5\u58D3\u58D1\u58D7\u58D9\u58D8\u58E5\u58DC\u58E4\u58DF\u58EF\u58FA\u58F9\u58FB\u58FC\u58FD\u5902\u590A\u5910\u591B\u68A6\u5925\u592C\u592D\u5932\u5938\u593E\u7AD2\u5955\u5950\u594E\u595A\u5958\u5962\u5960\u5967\u596C\u5969"],
      ["9b40", "\u5978\u5981\u599D\u4F5E\u4FAB\u59A3\u59B2\u59C6\u59E8\u59DC\u598D\u59D9\u59DA\u5A25\u5A1F\u5A11\u5A1C\u5A09\u5A1A\u5A40\u5A6C\u5A49\u5A35\u5A36\u5A62\u5A6A\u5A9A\u5ABC\u5ABE\u5ACB\u5AC2\u5ABD\u5AE3\u5AD7\u5AE6\u5AE9\u5AD6\u5AFA\u5AFB\u5B0C\u5B0B\u5B16\u5B32\u5AD0\u5B2A\u5B36\u5B3E\u5B43\u5B45\u5B40\u5B51\u5B55\u5B5A\u5B5B\u5B65\u5B69\u5B70\u5B73\u5B75\u5B78\u6588\u5B7A\u5B80"],
      ["9b80", "\u5B83\u5BA6\u5BB8\u5BC3\u5BC7\u5BC9\u5BD4\u5BD0\u5BE4\u5BE6\u5BE2\u5BDE\u5BE5\u5BEB\u5BF0\u5BF6\u5BF3\u5C05\u5C07\u5C08\u5C0D\u5C13\u5C20\u5C22\u5C28\u5C38\u5C39\u5C41\u5C46\u5C4E\u5C53\u5C50\u5C4F\u5B71\u5C6C\u5C6E\u4E62\u5C76\u5C79\u5C8C\u5C91\u5C94\u599B\u5CAB\u5CBB\u5CB6\u5CBC\u5CB7\u5CC5\u5CBE\u5CC7\u5CD9\u5CE9\u5CFD\u5CFA\u5CED\u5D8C\u5CEA\u5D0B\u5D15\u5D17\u5D5C\u5D1F\u5D1B\u5D11\u5D14\u5D22\u5D1A\u5D19\u5D18\u5D4C\u5D52\u5D4E\u5D4B\u5D6C\u5D73\u5D76\u5D87\u5D84\u5D82\u5DA2\u5D9D\u5DAC\u5DAE\u5DBD\u5D90\u5DB7\u5DBC\u5DC9\u5DCD\u5DD3\u5DD2\u5DD6\u5DDB\u5DEB\u5DF2\u5DF5\u5E0B\u5E1A\u5E19\u5E11\u5E1B\u5E36\u5E37\u5E44\u5E43\u5E40\u5E4E\u5E57\u5E54\u5E5F\u5E62\u5E64\u5E47\u5E75\u5E76\u5E7A\u9EBC\u5E7F\u5EA0\u5EC1\u5EC2\u5EC8\u5ED0\u5ECF"],
      ["9c40", "\u5ED6\u5EE3\u5EDD\u5EDA\u5EDB\u5EE2\u5EE1\u5EE8\u5EE9\u5EEC\u5EF1\u5EF3\u5EF0\u5EF4\u5EF8\u5EFE\u5F03\u5F09\u5F5D\u5F5C\u5F0B\u5F11\u5F16\u5F29\u5F2D\u5F38\u5F41\u5F48\u5F4C\u5F4E\u5F2F\u5F51\u5F56\u5F57\u5F59\u5F61\u5F6D\u5F73\u5F77\u5F83\u5F82\u5F7F\u5F8A\u5F88\u5F91\u5F87\u5F9E\u5F99\u5F98\u5FA0\u5FA8\u5FAD\u5FBC\u5FD6\u5FFB\u5FE4\u5FF8\u5FF1\u5FDD\u60B3\u5FFF\u6021\u6060"],
      ["9c80", "\u6019\u6010\u6029\u600E\u6031\u601B\u6015\u602B\u6026\u600F\u603A\u605A\u6041\u606A\u6077\u605F\u604A\u6046\u604D\u6063\u6043\u6064\u6042\u606C\u606B\u6059\u6081\u608D\u60E7\u6083\u609A\u6084\u609B\u6096\u6097\u6092\u60A7\u608B\u60E1\u60B8\u60E0\u60D3\u60B4\u5FF0\u60BD\u60C6\u60B5\u60D8\u614D\u6115\u6106\u60F6\u60F7\u6100\u60F4\u60FA\u6103\u6121\u60FB\u60F1\u610D\u610E\u6147\u613E\u6128\u6127\u614A\u613F\u613C\u612C\u6134\u613D\u6142\u6144\u6173\u6177\u6158\u6159\u615A\u616B\u6174\u616F\u6165\u6171\u615F\u615D\u6153\u6175\u6199\u6196\u6187\u61AC\u6194\u619A\u618A\u6191\u61AB\u61AE\u61CC\u61CA\u61C9\u61F7\u61C8\u61C3\u61C6\u61BA\u61CB\u7F79\u61CD\u61E6\u61E3\u61F6\u61FA\u61F4\u61FF\u61FD\u61FC\u61FE\u6200\u6208\u6209\u620D\u620C\u6214\u621B"],
      ["9d40", "\u621E\u6221\u622A\u622E\u6230\u6232\u6233\u6241\u624E\u625E\u6263\u625B\u6260\u6268\u627C\u6282\u6289\u627E\u6292\u6293\u6296\u62D4\u6283\u6294\u62D7\u62D1\u62BB\u62CF\u62FF\u62C6\u64D4\u62C8\u62DC\u62CC\u62CA\u62C2\u62C7\u629B\u62C9\u630C\u62EE\u62F1\u6327\u6302\u6308\u62EF\u62F5\u6350\u633E\u634D\u641C\u634F\u6396\u638E\u6380\u63AB\u6376\u63A3\u638F\u6389\u639F\u63B5\u636B"],
      ["9d80", "\u6369\u63BE\u63E9\u63C0\u63C6\u63E3\u63C9\u63D2\u63F6\u63C4\u6416\u6434\u6406\u6413\u6426\u6436\u651D\u6417\u6428\u640F\u6467\u646F\u6476\u644E\u652A\u6495\u6493\u64A5\u64A9\u6488\u64BC\u64DA\u64D2\u64C5\u64C7\u64BB\u64D8\u64C2\u64F1\u64E7\u8209\u64E0\u64E1\u62AC\u64E3\u64EF\u652C\u64F6\u64F4\u64F2\u64FA\u6500\u64FD\u6518\u651C\u6505\u6524\u6523\u652B\u6534\u6535\u6537\u6536\u6538\u754B\u6548\u6556\u6555\u654D\u6558\u655E\u655D\u6572\u6578\u6582\u6583\u8B8A\u659B\u659F\u65AB\u65B7\u65C3\u65C6\u65C1\u65C4\u65CC\u65D2\u65DB\u65D9\u65E0\u65E1\u65F1\u6772\u660A\u6603\u65FB\u6773\u6635\u6636\u6634\u661C\u664F\u6644\u6649\u6641\u665E\u665D\u6664\u6667\u6668\u665F\u6662\u6670\u6683\u6688\u668E\u6689\u6684\u6698\u669D\u66C1\u66B9\u66C9\u66BE\u66BC"],
      ["9e40", "\u66C4\u66B8\u66D6\u66DA\u66E0\u663F\u66E6\u66E9\u66F0\u66F5\u66F7\u670F\u6716\u671E\u6726\u6727\u9738\u672E\u673F\u6736\u6741\u6738\u6737\u6746\u675E\u6760\u6759\u6763\u6764\u6789\u6770\u67A9\u677C\u676A\u678C\u678B\u67A6\u67A1\u6785\u67B7\u67EF\u67B4\u67EC\u67B3\u67E9\u67B8\u67E4\u67DE\u67DD\u67E2\u67EE\u67B9\u67CE\u67C6\u67E7\u6A9C\u681E\u6846\u6829\u6840\u684D\u6832\u684E"],
      ["9e80", "\u68B3\u682B\u6859\u6863\u6877\u687F\u689F\u688F\u68AD\u6894\u689D\u689B\u6883\u6AAE\u68B9\u6874\u68B5\u68A0\u68BA\u690F\u688D\u687E\u6901\u68CA\u6908\u68D8\u6922\u6926\u68E1\u690C\u68CD\u68D4\u68E7\u68D5\u6936\u6912\u6904\u68D7\u68E3\u6925\u68F9\u68E0\u68EF\u6928\u692A\u691A\u6923\u6921\u68C6\u6979\u6977\u695C\u6978\u696B\u6954\u697E\u696E\u6939\u6974\u693D\u6959\u6930\u6961\u695E\u695D\u6981\u696A\u69B2\u69AE\u69D0\u69BF\u69C1\u69D3\u69BE\u69CE\u5BE8\u69CA\u69DD\u69BB\u69C3\u69A7\u6A2E\u6991\u69A0\u699C\u6995\u69B4\u69DE\u69E8\u6A02\u6A1B\u69FF\u6B0A\u69F9\u69F2\u69E7\u6A05\u69B1\u6A1E\u69ED\u6A14\u69EB\u6A0A\u6A12\u6AC1\u6A23\u6A13\u6A44\u6A0C\u6A72\u6A36\u6A78\u6A47\u6A62\u6A59\u6A66\u6A48\u6A38\u6A22\u6A90\u6A8D\u6AA0\u6A84\u6AA2\u6AA3"],
      ["9f40", "\u6A97\u8617\u6ABB\u6AC3\u6AC2\u6AB8\u6AB3\u6AAC\u6ADE\u6AD1\u6ADF\u6AAA\u6ADA\u6AEA\u6AFB\u6B05\u8616\u6AFA\u6B12\u6B16\u9B31\u6B1F\u6B38\u6B37\u76DC\u6B39\u98EE\u6B47\u6B43\u6B49\u6B50\u6B59\u6B54\u6B5B\u6B5F\u6B61\u6B78\u6B79\u6B7F\u6B80\u6B84\u6B83\u6B8D\u6B98\u6B95\u6B9E\u6BA4\u6BAA\u6BAB\u6BAF\u6BB2\u6BB1\u6BB3\u6BB7\u6BBC\u6BC6\u6BCB\u6BD3\u6BDF\u6BEC\u6BEB\u6BF3\u6BEF"],
      ["9f80", "\u9EBE\u6C08\u6C13\u6C14\u6C1B\u6C24\u6C23\u6C5E\u6C55\u6C62\u6C6A\u6C82\u6C8D\u6C9A\u6C81\u6C9B\u6C7E\u6C68\u6C73\u6C92\u6C90\u6CC4\u6CF1\u6CD3\u6CBD\u6CD7\u6CC5\u6CDD\u6CAE\u6CB1\u6CBE\u6CBA\u6CDB\u6CEF\u6CD9\u6CEA\u6D1F\u884D\u6D36\u6D2B\u6D3D\u6D38\u6D19\u6D35\u6D33\u6D12\u6D0C\u6D63\u6D93\u6D64\u6D5A\u6D79\u6D59\u6D8E\u6D95\u6FE4\u6D85\u6DF9\u6E15\u6E0A\u6DB5\u6DC7\u6DE6\u6DB8\u6DC6\u6DEC\u6DDE\u6DCC\u6DE8\u6DD2\u6DC5\u6DFA\u6DD9\u6DE4\u6DD5\u6DEA\u6DEE\u6E2D\u6E6E\u6E2E\u6E19\u6E72\u6E5F\u6E3E\u6E23\u6E6B\u6E2B\u6E76\u6E4D\u6E1F\u6E43\u6E3A\u6E4E\u6E24\u6EFF\u6E1D\u6E38\u6E82\u6EAA\u6E98\u6EC9\u6EB7\u6ED3\u6EBD\u6EAF\u6EC4\u6EB2\u6ED4\u6ED5\u6E8F\u6EA5\u6EC2\u6E9F\u6F41\u6F11\u704C\u6EEC\u6EF8\u6EFE\u6F3F\u6EF2\u6F31\u6EEF\u6F32\u6ECC"],
      ["e040", "\u6F3E\u6F13\u6EF7\u6F86\u6F7A\u6F78\u6F81\u6F80\u6F6F\u6F5B\u6FF3\u6F6D\u6F82\u6F7C\u6F58\u6F8E\u6F91\u6FC2\u6F66\u6FB3\u6FA3\u6FA1\u6FA4\u6FB9\u6FC6\u6FAA\u6FDF\u6FD5\u6FEC\u6FD4\u6FD8\u6FF1\u6FEE\u6FDB\u7009\u700B\u6FFA\u7011\u7001\u700F\u6FFE\u701B\u701A\u6F74\u701D\u7018\u701F\u7030\u703E\u7032\u7051\u7063\u7099\u7092\u70AF\u70F1\u70AC\u70B8\u70B3\u70AE\u70DF\u70CB\u70DD"],
      ["e080", "\u70D9\u7109\u70FD\u711C\u7119\u7165\u7155\u7188\u7166\u7162\u714C\u7156\u716C\u718F\u71FB\u7184\u7195\u71A8\u71AC\u71D7\u71B9\u71BE\u71D2\u71C9\u71D4\u71CE\u71E0\u71EC\u71E7\u71F5\u71FC\u71F9\u71FF\u720D\u7210\u721B\u7228\u722D\u722C\u7230\u7232\u723B\u723C\u723F\u7240\u7246\u724B\u7258\u7274\u727E\u7282\u7281\u7287\u7292\u7296\u72A2\u72A7\u72B9\u72B2\u72C3\u72C6\u72C4\u72CE\u72D2\u72E2\u72E0\u72E1\u72F9\u72F7\u500F\u7317\u730A\u731C\u7316\u731D\u7334\u732F\u7329\u7325\u733E\u734E\u734F\u9ED8\u7357\u736A\u7368\u7370\u7378\u7375\u737B\u737A\u73C8\u73B3\u73CE\u73BB\u73C0\u73E5\u73EE\u73DE\u74A2\u7405\u746F\u7425\u73F8\u7432\u743A\u7455\u743F\u745F\u7459\u7441\u745C\u7469\u7470\u7463\u746A\u7476\u747E\u748B\u749E\u74A7\u74CA\u74CF\u74D4\u73F1"],
      ["e140", "\u74E0\u74E3\u74E7\u74E9\u74EE\u74F2\u74F0\u74F1\u74F8\u74F7\u7504\u7503\u7505\u750C\u750E\u750D\u7515\u7513\u751E\u7526\u752C\u753C\u7544\u754D\u754A\u7549\u755B\u7546\u755A\u7569\u7564\u7567\u756B\u756D\u7578\u7576\u7586\u7587\u7574\u758A\u7589\u7582\u7594\u759A\u759D\u75A5\u75A3\u75C2\u75B3\u75C3\u75B5\u75BD\u75B8\u75BC\u75B1\u75CD\u75CA\u75D2\u75D9\u75E3\u75DE\u75FE\u75FF"],
      ["e180", "\u75FC\u7601\u75F0\u75FA\u75F2\u75F3\u760B\u760D\u7609\u761F\u7627\u7620\u7621\u7622\u7624\u7634\u7630\u763B\u7647\u7648\u7646\u765C\u7658\u7661\u7662\u7668\u7669\u766A\u7667\u766C\u7670\u7672\u7676\u7678\u767C\u7680\u7683\u7688\u768B\u768E\u7696\u7693\u7699\u769A\u76B0\u76B4\u76B8\u76B9\u76BA\u76C2\u76CD\u76D6\u76D2\u76DE\u76E1\u76E5\u76E7\u76EA\u862F\u76FB\u7708\u7707\u7704\u7729\u7724\u771E\u7725\u7726\u771B\u7737\u7738\u7747\u775A\u7768\u776B\u775B\u7765\u777F\u777E\u7779\u778E\u778B\u7791\u77A0\u779E\u77B0\u77B6\u77B9\u77BF\u77BC\u77BD\u77BB\u77C7\u77CD\u77D7\u77DA\u77DC\u77E3\u77EE\u77FC\u780C\u7812\u7926\u7820\u792A\u7845\u788E\u7874\u7886\u787C\u789A\u788C\u78A3\u78B5\u78AA\u78AF\u78D1\u78C6\u78CB\u78D4\u78BE\u78BC\u78C5\u78CA\u78EC"],
      ["e240", "\u78E7\u78DA\u78FD\u78F4\u7907\u7912\u7911\u7919\u792C\u792B\u7940\u7960\u7957\u795F\u795A\u7955\u7953\u797A\u797F\u798A\u799D\u79A7\u9F4B\u79AA\u79AE\u79B3\u79B9\u79BA\u79C9\u79D5\u79E7\u79EC\u79E1\u79E3\u7A08\u7A0D\u7A18\u7A19\u7A20\u7A1F\u7980\u7A31\u7A3B\u7A3E\u7A37\u7A43\u7A57\u7A49\u7A61\u7A62\u7A69\u9F9D\u7A70\u7A79\u7A7D\u7A88\u7A97\u7A95\u7A98\u7A96\u7AA9\u7AC8\u7AB0"],
      ["e280", "\u7AB6\u7AC5\u7AC4\u7ABF\u9083\u7AC7\u7ACA\u7ACD\u7ACF\u7AD5\u7AD3\u7AD9\u7ADA\u7ADD\u7AE1\u7AE2\u7AE6\u7AED\u7AF0\u7B02\u7B0F\u7B0A\u7B06\u7B33\u7B18\u7B19\u7B1E\u7B35\u7B28\u7B36\u7B50\u7B7A\u7B04\u7B4D\u7B0B\u7B4C\u7B45\u7B75\u7B65\u7B74\u7B67\u7B70\u7B71\u7B6C\u7B6E\u7B9D\u7B98\u7B9F\u7B8D\u7B9C\u7B9A\u7B8B\u7B92\u7B8F\u7B5D\u7B99\u7BCB\u7BC1\u7BCC\u7BCF\u7BB4\u7BC6\u7BDD\u7BE9\u7C11\u7C14\u7BE6\u7BE5\u7C60\u7C00\u7C07\u7C13\u7BF3\u7BF7\u7C17\u7C0D\u7BF6\u7C23\u7C27\u7C2A\u7C1F\u7C37\u7C2B\u7C3D\u7C4C\u7C43\u7C54\u7C4F\u7C40\u7C50\u7C58\u7C5F\u7C64\u7C56\u7C65\u7C6C\u7C75\u7C83\u7C90\u7CA4\u7CAD\u7CA2\u7CAB\u7CA1\u7CA8\u7CB3\u7CB2\u7CB1\u7CAE\u7CB9\u7CBD\u7CC0\u7CC5\u7CC2\u7CD8\u7CD2\u7CDC\u7CE2\u9B3B\u7CEF\u7CF2\u7CF4\u7CF6\u7CFA\u7D06"],
      ["e340", "\u7D02\u7D1C\u7D15\u7D0A\u7D45\u7D4B\u7D2E\u7D32\u7D3F\u7D35\u7D46\u7D73\u7D56\u7D4E\u7D72\u7D68\u7D6E\u7D4F\u7D63\u7D93\u7D89\u7D5B\u7D8F\u7D7D\u7D9B\u7DBA\u7DAE\u7DA3\u7DB5\u7DC7\u7DBD\u7DAB\u7E3D\u7DA2\u7DAF\u7DDC\u7DB8\u7D9F\u7DB0\u7DD8\u7DDD\u7DE4\u7DDE\u7DFB\u7DF2\u7DE1\u7E05\u7E0A\u7E23\u7E21\u7E12\u7E31\u7E1F\u7E09\u7E0B\u7E22\u7E46\u7E66\u7E3B\u7E35\u7E39\u7E43\u7E37"],
      ["e380", "\u7E32\u7E3A\u7E67\u7E5D\u7E56\u7E5E\u7E59\u7E5A\u7E79\u7E6A\u7E69\u7E7C\u7E7B\u7E83\u7DD5\u7E7D\u8FAE\u7E7F\u7E88\u7E89\u7E8C\u7E92\u7E90\u7E93\u7E94\u7E96\u7E8E\u7E9B\u7E9C\u7F38\u7F3A\u7F45\u7F4C\u7F4D\u7F4E\u7F50\u7F51\u7F55\u7F54\u7F58\u7F5F\u7F60\u7F68\u7F69\u7F67\u7F78\u7F82\u7F86\u7F83\u7F88\u7F87\u7F8C\u7F94\u7F9E\u7F9D\u7F9A\u7FA3\u7FAF\u7FB2\u7FB9\u7FAE\u7FB6\u7FB8\u8B71\u7FC5\u7FC6\u7FCA\u7FD5\u7FD4\u7FE1\u7FE6\u7FE9\u7FF3\u7FF9\u98DC\u8006\u8004\u800B\u8012\u8018\u8019\u801C\u8021\u8028\u803F\u803B\u804A\u8046\u8052\u8058\u805A\u805F\u8062\u8068\u8073\u8072\u8070\u8076\u8079\u807D\u807F\u8084\u8086\u8085\u809B\u8093\u809A\u80AD\u5190\u80AC\u80DB\u80E5\u80D9\u80DD\u80C4\u80DA\u80D6\u8109\u80EF\u80F1\u811B\u8129\u8123\u812F\u814B"],
      ["e440", "\u968B\u8146\u813E\u8153\u8151\u80FC\u8171\u816E\u8165\u8166\u8174\u8183\u8188\u818A\u8180\u8182\u81A0\u8195\u81A4\u81A3\u815F\u8193\u81A9\u81B0\u81B5\u81BE\u81B8\u81BD\u81C0\u81C2\u81BA\u81C9\u81CD\u81D1\u81D9\u81D8\u81C8\u81DA\u81DF\u81E0\u81E7\u81FA\u81FB\u81FE\u8201\u8202\u8205\u8207\u820A\u820D\u8210\u8216\u8229\u822B\u8238\u8233\u8240\u8259\u8258\u825D\u825A\u825F\u8264"],
      ["e480", "\u8262\u8268\u826A\u826B\u822E\u8271\u8277\u8278\u827E\u828D\u8292\u82AB\u829F\u82BB\u82AC\u82E1\u82E3\u82DF\u82D2\u82F4\u82F3\u82FA\u8393\u8303\u82FB\u82F9\u82DE\u8306\u82DC\u8309\u82D9\u8335\u8334\u8316\u8332\u8331\u8340\u8339\u8350\u8345\u832F\u832B\u8317\u8318\u8385\u839A\u83AA\u839F\u83A2\u8396\u8323\u838E\u8387\u838A\u837C\u83B5\u8373\u8375\u83A0\u8389\u83A8\u83F4\u8413\u83EB\u83CE\u83FD\u8403\u83D8\u840B\u83C1\u83F7\u8407\u83E0\u83F2\u840D\u8422\u8420\u83BD\u8438\u8506\u83FB\u846D\u842A\u843C\u855A\u8484\u8477\u846B\u84AD\u846E\u8482\u8469\u8446\u842C\u846F\u8479\u8435\u84CA\u8462\u84B9\u84BF\u849F\u84D9\u84CD\u84BB\u84DA\u84D0\u84C1\u84C6\u84D6\u84A1\u8521\u84FF\u84F4\u8517\u8518\u852C\u851F\u8515\u8514\u84FC\u8540\u8563\u8558\u8548"],
      ["e540", "\u8541\u8602\u854B\u8555\u8580\u85A4\u8588\u8591\u858A\u85A8\u856D\u8594\u859B\u85EA\u8587\u859C\u8577\u857E\u8590\u85C9\u85BA\u85CF\u85B9\u85D0\u85D5\u85DD\u85E5\u85DC\u85F9\u860A\u8613\u860B\u85FE\u85FA\u8606\u8622\u861A\u8630\u863F\u864D\u4E55\u8654\u865F\u8667\u8671\u8693\u86A3\u86A9\u86AA\u868B\u868C\u86B6\u86AF\u86C4\u86C6\u86B0\u86C9\u8823\u86AB\u86D4\u86DE\u86E9\u86EC"],
      ["e580", "\u86DF\u86DB\u86EF\u8712\u8706\u8708\u8700\u8703\u86FB\u8711\u8709\u870D\u86F9\u870A\u8734\u873F\u8737\u873B\u8725\u8729\u871A\u8760\u875F\u8778\u874C\u874E\u8774\u8757\u8768\u876E\u8759\u8753\u8763\u876A\u8805\u87A2\u879F\u8782\u87AF\u87CB\u87BD\u87C0\u87D0\u96D6\u87AB\u87C4\u87B3\u87C7\u87C6\u87BB\u87EF\u87F2\u87E0\u880F\u880D\u87FE\u87F6\u87F7\u880E\u87D2\u8811\u8816\u8815\u8822\u8821\u8831\u8836\u8839\u8827\u883B\u8844\u8842\u8852\u8859\u885E\u8862\u886B\u8881\u887E\u889E\u8875\u887D\u88B5\u8872\u8882\u8897\u8892\u88AE\u8899\u88A2\u888D\u88A4\u88B0\u88BF\u88B1\u88C3\u88C4\u88D4\u88D8\u88D9\u88DD\u88F9\u8902\u88FC\u88F4\u88E8\u88F2\u8904\u890C\u890A\u8913\u8943\u891E\u8925\u892A\u892B\u8941\u8944\u893B\u8936\u8938\u894C\u891D\u8960\u895E"],
      ["e640", "\u8966\u8964\u896D\u896A\u896F\u8974\u8977\u897E\u8983\u8988\u898A\u8993\u8998\u89A1\u89A9\u89A6\u89AC\u89AF\u89B2\u89BA\u89BD\u89BF\u89C0\u89DA\u89DC\u89DD\u89E7\u89F4\u89F8\u8A03\u8A16\u8A10\u8A0C\u8A1B\u8A1D\u8A25\u8A36\u8A41\u8A5B\u8A52\u8A46\u8A48\u8A7C\u8A6D\u8A6C\u8A62\u8A85\u8A82\u8A84\u8AA8\u8AA1\u8A91\u8AA5\u8AA6\u8A9A\u8AA3\u8AC4\u8ACD\u8AC2\u8ADA\u8AEB\u8AF3\u8AE7"],
      ["e680", "\u8AE4\u8AF1\u8B14\u8AE0\u8AE2\u8AF7\u8ADE\u8ADB\u8B0C\u8B07\u8B1A\u8AE1\u8B16\u8B10\u8B17\u8B20\u8B33\u97AB\u8B26\u8B2B\u8B3E\u8B28\u8B41\u8B4C\u8B4F\u8B4E\u8B49\u8B56\u8B5B\u8B5A\u8B6B\u8B5F\u8B6C\u8B6F\u8B74\u8B7D\u8B80\u8B8C\u8B8E\u8B92\u8B93\u8B96\u8B99\u8B9A\u8C3A\u8C41\u8C3F\u8C48\u8C4C\u8C4E\u8C50\u8C55\u8C62\u8C6C\u8C78\u8C7A\u8C82\u8C89\u8C85\u8C8A\u8C8D\u8C8E\u8C94\u8C7C\u8C98\u621D\u8CAD\u8CAA\u8CBD\u8CB2\u8CB3\u8CAE\u8CB6\u8CC8\u8CC1\u8CE4\u8CE3\u8CDA\u8CFD\u8CFA\u8CFB\u8D04\u8D05\u8D0A\u8D07\u8D0F\u8D0D\u8D10\u9F4E\u8D13\u8CCD\u8D14\u8D16\u8D67\u8D6D\u8D71\u8D73\u8D81\u8D99\u8DC2\u8DBE\u8DBA\u8DCF\u8DDA\u8DD6\u8DCC\u8DDB\u8DCB\u8DEA\u8DEB\u8DDF\u8DE3\u8DFC\u8E08\u8E09\u8DFF\u8E1D\u8E1E\u8E10\u8E1F\u8E42\u8E35\u8E30\u8E34\u8E4A"],
      ["e740", "\u8E47\u8E49\u8E4C\u8E50\u8E48\u8E59\u8E64\u8E60\u8E2A\u8E63\u8E55\u8E76\u8E72\u8E7C\u8E81\u8E87\u8E85\u8E84\u8E8B\u8E8A\u8E93\u8E91\u8E94\u8E99\u8EAA\u8EA1\u8EAC\u8EB0\u8EC6\u8EB1\u8EBE\u8EC5\u8EC8\u8ECB\u8EDB\u8EE3\u8EFC\u8EFB\u8EEB\u8EFE\u8F0A\u8F05\u8F15\u8F12\u8F19\u8F13\u8F1C\u8F1F\u8F1B\u8F0C\u8F26\u8F33\u8F3B\u8F39\u8F45\u8F42\u8F3E\u8F4C\u8F49\u8F46\u8F4E\u8F57\u8F5C"],
      ["e780", "\u8F62\u8F63\u8F64\u8F9C\u8F9F\u8FA3\u8FAD\u8FAF\u8FB7\u8FDA\u8FE5\u8FE2\u8FEA\u8FEF\u9087\u8FF4\u9005\u8FF9\u8FFA\u9011\u9015\u9021\u900D\u901E\u9016\u900B\u9027\u9036\u9035\u9039\u8FF8\u904F\u9050\u9051\u9052\u900E\u9049\u903E\u9056\u9058\u905E\u9068\u906F\u9076\u96A8\u9072\u9082\u907D\u9081\u9080\u908A\u9089\u908F\u90A8\u90AF\u90B1\u90B5\u90E2\u90E4\u6248\u90DB\u9102\u9112\u9119\u9132\u9130\u914A\u9156\u9158\u9163\u9165\u9169\u9173\u9172\u918B\u9189\u9182\u91A2\u91AB\u91AF\u91AA\u91B5\u91B4\u91BA\u91C0\u91C1\u91C9\u91CB\u91D0\u91D6\u91DF\u91E1\u91DB\u91FC\u91F5\u91F6\u921E\u91FF\u9214\u922C\u9215\u9211\u925E\u9257\u9245\u9249\u9264\u9248\u9295\u923F\u924B\u9250\u929C\u9296\u9293\u929B\u925A\u92CF\u92B9\u92B7\u92E9\u930F\u92FA\u9344\u932E"],
      ["e840", "\u9319\u9322\u931A\u9323\u933A\u9335\u933B\u935C\u9360\u937C\u936E\u9356\u93B0\u93AC\u93AD\u9394\u93B9\u93D6\u93D7\u93E8\u93E5\u93D8\u93C3\u93DD\u93D0\u93C8\u93E4\u941A\u9414\u9413\u9403\u9407\u9410\u9436\u942B\u9435\u9421\u943A\u9441\u9452\u9444\u945B\u9460\u9462\u945E\u946A\u9229\u9470\u9475\u9477\u947D\u945A\u947C\u947E\u9481\u947F\u9582\u9587\u958A\u9594\u9596\u9598\u9599"],
      ["e880", "\u95A0\u95A8\u95A7\u95AD\u95BC\u95BB\u95B9\u95BE\u95CA\u6FF6\u95C3\u95CD\u95CC\u95D5\u95D4\u95D6\u95DC\u95E1\u95E5\u95E2\u9621\u9628\u962E\u962F\u9642\u964C\u964F\u964B\u9677\u965C\u965E\u965D\u965F\u9666\u9672\u966C\u968D\u9698\u9695\u9697\u96AA\u96A7\u96B1\u96B2\u96B0\u96B4\u96B6\u96B8\u96B9\u96CE\u96CB\u96C9\u96CD\u894D\u96DC\u970D\u96D5\u96F9\u9704\u9706\u9708\u9713\u970E\u9711\u970F\u9716\u9719\u9724\u972A\u9730\u9739\u973D\u973E\u9744\u9746\u9748\u9742\u9749\u975C\u9760\u9764\u9766\u9768\u52D2\u976B\u9771\u9779\u9785\u977C\u9781\u977A\u9786\u978B\u978F\u9790\u979C\u97A8\u97A6\u97A3\u97B3\u97B4\u97C3\u97C6\u97C8\u97CB\u97DC\u97ED\u9F4F\u97F2\u7ADF\u97F6\u97F5\u980F\u980C\u9838\u9824\u9821\u9837\u983D\u9846\u984F\u984B\u986B\u986F\u9870"],
      ["e940", "\u9871\u9874\u9873\u98AA\u98AF\u98B1\u98B6\u98C4\u98C3\u98C6\u98E9\u98EB\u9903\u9909\u9912\u9914\u9918\u9921\u991D\u991E\u9924\u9920\u992C\u992E\u993D\u993E\u9942\u9949\u9945\u9950\u994B\u9951\u9952\u994C\u9955\u9997\u9998\u99A5\u99AD\u99AE\u99BC\u99DF\u99DB\u99DD\u99D8\u99D1\u99ED\u99EE\u99F1\u99F2\u99FB\u99F8\u9A01\u9A0F\u9A05\u99E2\u9A19\u9A2B\u9A37\u9A45\u9A42\u9A40\u9A43"],
      ["e980", "\u9A3E\u9A55\u9A4D\u9A5B\u9A57\u9A5F\u9A62\u9A65\u9A64\u9A69\u9A6B\u9A6A\u9AAD\u9AB0\u9ABC\u9AC0\u9ACF\u9AD1\u9AD3\u9AD4\u9ADE\u9ADF\u9AE2\u9AE3\u9AE6\u9AEF\u9AEB\u9AEE\u9AF4\u9AF1\u9AF7\u9AFB\u9B06\u9B18\u9B1A\u9B1F\u9B22\u9B23\u9B25\u9B27\u9B28\u9B29\u9B2A\u9B2E\u9B2F\u9B32\u9B44\u9B43\u9B4F\u9B4D\u9B4E\u9B51\u9B58\u9B74\u9B93\u9B83\u9B91\u9B96\u9B97\u9B9F\u9BA0\u9BA8\u9BB4\u9BC0\u9BCA\u9BB9\u9BC6\u9BCF\u9BD1\u9BD2\u9BE3\u9BE2\u9BE4\u9BD4\u9BE1\u9C3A\u9BF2\u9BF1\u9BF0\u9C15\u9C14\u9C09\u9C13\u9C0C\u9C06\u9C08\u9C12\u9C0A\u9C04\u9C2E\u9C1B\u9C25\u9C24\u9C21\u9C30\u9C47\u9C32\u9C46\u9C3E\u9C5A\u9C60\u9C67\u9C76\u9C78\u9CE7\u9CEC\u9CF0\u9D09\u9D08\u9CEB\u9D03\u9D06\u9D2A\u9D26\u9DAF\u9D23\u9D1F\u9D44\u9D15\u9D12\u9D41\u9D3F\u9D3E\u9D46\u9D48"],
      ["ea40", "\u9D5D\u9D5E\u9D64\u9D51\u9D50\u9D59\u9D72\u9D89\u9D87\u9DAB\u9D6F\u9D7A\u9D9A\u9DA4\u9DA9\u9DB2\u9DC4\u9DC1\u9DBB\u9DB8\u9DBA\u9DC6\u9DCF\u9DC2\u9DD9\u9DD3\u9DF8\u9DE6\u9DED\u9DEF\u9DFD\u9E1A\u9E1B\u9E1E\u9E75\u9E79\u9E7D\u9E81\u9E88\u9E8B\u9E8C\u9E92\u9E95\u9E91\u9E9D\u9EA5\u9EA9\u9EB8\u9EAA\u9EAD\u9761\u9ECC\u9ECE\u9ECF\u9ED0\u9ED4\u9EDC\u9EDE\u9EDD\u9EE0\u9EE5\u9EE8\u9EEF"],
      ["ea80", "\u9EF4\u9EF6\u9EF7\u9EF9\u9EFB\u9EFC\u9EFD\u9F07\u9F08\u76B7\u9F15\u9F21\u9F2C\u9F3E\u9F4A\u9F52\u9F54\u9F63\u9F5F\u9F60\u9F61\u9F66\u9F67\u9F6C\u9F6A\u9F77\u9F72\u9F76\u9F95\u9F9C\u9FA0\u582F\u69C7\u9059\u7464\u51DC\u7199"],
      ["ed40", "\u7E8A\u891C\u9348\u9288\u84DC\u4FC9\u70BB\u6631\u68C8\u92F9\u66FB\u5F45\u4E28\u4EE1\u4EFC\u4F00\u4F03\u4F39\u4F56\u4F92\u4F8A\u4F9A\u4F94\u4FCD\u5040\u5022\u4FFF\u501E\u5046\u5070\u5042\u5094\u50F4\u50D8\u514A\u5164\u519D\u51BE\u51EC\u5215\u529C\u52A6\u52C0\u52DB\u5300\u5307\u5324\u5372\u5393\u53B2\u53DD\uFA0E\u549C\u548A\u54A9\u54FF\u5586\u5759\u5765\u57AC\u57C8\u57C7\uFA0F"],
      ["ed80", "\uFA10\u589E\u58B2\u590B\u5953\u595B\u595D\u5963\u59A4\u59BA\u5B56\u5BC0\u752F\u5BD8\u5BEC\u5C1E\u5CA6\u5CBA\u5CF5\u5D27\u5D53\uFA11\u5D42\u5D6D\u5DB8\u5DB9\u5DD0\u5F21\u5F34\u5F67\u5FB7\u5FDE\u605D\u6085\u608A\u60DE\u60D5\u6120\u60F2\u6111\u6137\u6130\u6198\u6213\u62A6\u63F5\u6460\u649D\u64CE\u654E\u6600\u6615\u663B\u6609\u662E\u661E\u6624\u6665\u6657\u6659\uFA12\u6673\u6699\u66A0\u66B2\u66BF\u66FA\u670E\uF929\u6766\u67BB\u6852\u67C0\u6801\u6844\u68CF\uFA13\u6968\uFA14\u6998\u69E2\u6A30\u6A6B\u6A46\u6A73\u6A7E\u6AE2\u6AE4\u6BD6\u6C3F\u6C5C\u6C86\u6C6F\u6CDA\u6D04\u6D87\u6D6F\u6D96\u6DAC\u6DCF\u6DF8\u6DF2\u6DFC\u6E39\u6E5C\u6E27\u6E3C\u6EBF\u6F88\u6FB5\u6FF5\u7005\u7007\u7028\u7085\u70AB\u710F\u7104\u715C\u7146\u7147\uFA15\u71C1\u71FE\u72B1"],
      ["ee40", "\u72BE\u7324\uFA16\u7377\u73BD\u73C9\u73D6\u73E3\u73D2\u7407\u73F5\u7426\u742A\u7429\u742E\u7462\u7489\u749F\u7501\u756F\u7682\u769C\u769E\u769B\u76A6\uFA17\u7746\u52AF\u7821\u784E\u7864\u787A\u7930\uFA18\uFA19\uFA1A\u7994\uFA1B\u799B\u7AD1\u7AE7\uFA1C\u7AEB\u7B9E\uFA1D\u7D48\u7D5C\u7DB7\u7DA0\u7DD6\u7E52\u7F47\u7FA1\uFA1E\u8301\u8362\u837F\u83C7\u83F6\u8448\u84B4\u8553\u8559"],
      ["ee80", "\u856B\uFA1F\u85B0\uFA20\uFA21\u8807\u88F5\u8A12\u8A37\u8A79\u8AA7\u8ABE\u8ADF\uFA22\u8AF6\u8B53\u8B7F\u8CF0\u8CF4\u8D12\u8D76\uFA23\u8ECF\uFA24\uFA25\u9067\u90DE\uFA26\u9115\u9127\u91DA\u91D7\u91DE\u91ED\u91EE\u91E4\u91E5\u9206\u9210\u920A\u923A\u9240\u923C\u924E\u9259\u9251\u9239\u9267\u92A7\u9277\u9278\u92E7\u92D7\u92D9\u92D0\uFA27\u92D5\u92E0\u92D3\u9325\u9321\u92FB\uFA28\u931E\u92FF\u931D\u9302\u9370\u9357\u93A4\u93C6\u93DE\u93F8\u9431\u9445\u9448\u9592\uF9DC\uFA29\u969D\u96AF\u9733\u973B\u9743\u974D\u974F\u9751\u9755\u9857\u9865\uFA2A\uFA2B\u9927\uFA2C\u999E\u9A4E\u9AD9\u9ADC\u9B75\u9B72\u9B8F\u9BB1\u9BBB\u9C00\u9D70\u9D6B\uFA2D\u9E19\u9ED1"],
      ["eeef", "\u2170", 9, "\uFFE2\uFFE4\uFF07\uFF02"],
      ["f040", "\uE000", 62],
      ["f080", "\uE03F", 124],
      ["f140", "\uE0BC", 62],
      ["f180", "\uE0FB", 124],
      ["f240", "\uE178", 62],
      ["f280", "\uE1B7", 124],
      ["f340", "\uE234", 62],
      ["f380", "\uE273", 124],
      ["f440", "\uE2F0", 62],
      ["f480", "\uE32F", 124],
      ["f540", "\uE3AC", 62],
      ["f580", "\uE3EB", 124],
      ["f640", "\uE468", 62],
      ["f680", "\uE4A7", 124],
      ["f740", "\uE524", 62],
      ["f780", "\uE563", 124],
      ["f840", "\uE5E0", 62],
      ["f880", "\uE61F", 124],
      ["f940", "\uE69C"],
      ["fa40", "\u2170", 9, "\u2160", 9, "\uFFE2\uFFE4\uFF07\uFF02\u3231\u2116\u2121\u2235\u7E8A\u891C\u9348\u9288\u84DC\u4FC9\u70BB\u6631\u68C8\u92F9\u66FB\u5F45\u4E28\u4EE1\u4EFC\u4F00\u4F03\u4F39\u4F56\u4F92\u4F8A\u4F9A\u4F94\u4FCD\u5040\u5022\u4FFF\u501E\u5046\u5070\u5042\u5094\u50F4\u50D8\u514A"],
      ["fa80", "\u5164\u519D\u51BE\u51EC\u5215\u529C\u52A6\u52C0\u52DB\u5300\u5307\u5324\u5372\u5393\u53B2\u53DD\uFA0E\u549C\u548A\u54A9\u54FF\u5586\u5759\u5765\u57AC\u57C8\u57C7\uFA0F\uFA10\u589E\u58B2\u590B\u5953\u595B\u595D\u5963\u59A4\u59BA\u5B56\u5BC0\u752F\u5BD8\u5BEC\u5C1E\u5CA6\u5CBA\u5CF5\u5D27\u5D53\uFA11\u5D42\u5D6D\u5DB8\u5DB9\u5DD0\u5F21\u5F34\u5F67\u5FB7\u5FDE\u605D\u6085\u608A\u60DE\u60D5\u6120\u60F2\u6111\u6137\u6130\u6198\u6213\u62A6\u63F5\u6460\u649D\u64CE\u654E\u6600\u6615\u663B\u6609\u662E\u661E\u6624\u6665\u6657\u6659\uFA12\u6673\u6699\u66A0\u66B2\u66BF\u66FA\u670E\uF929\u6766\u67BB\u6852\u67C0\u6801\u6844\u68CF\uFA13\u6968\uFA14\u6998\u69E2\u6A30\u6A6B\u6A46\u6A73\u6A7E\u6AE2\u6AE4\u6BD6\u6C3F\u6C5C\u6C86\u6C6F\u6CDA\u6D04\u6D87\u6D6F"],
      ["fb40", "\u6D96\u6DAC\u6DCF\u6DF8\u6DF2\u6DFC\u6E39\u6E5C\u6E27\u6E3C\u6EBF\u6F88\u6FB5\u6FF5\u7005\u7007\u7028\u7085\u70AB\u710F\u7104\u715C\u7146\u7147\uFA15\u71C1\u71FE\u72B1\u72BE\u7324\uFA16\u7377\u73BD\u73C9\u73D6\u73E3\u73D2\u7407\u73F5\u7426\u742A\u7429\u742E\u7462\u7489\u749F\u7501\u756F\u7682\u769C\u769E\u769B\u76A6\uFA17\u7746\u52AF\u7821\u784E\u7864\u787A\u7930\uFA18\uFA19"],
      ["fb80", "\uFA1A\u7994\uFA1B\u799B\u7AD1\u7AE7\uFA1C\u7AEB\u7B9E\uFA1D\u7D48\u7D5C\u7DB7\u7DA0\u7DD6\u7E52\u7F47\u7FA1\uFA1E\u8301\u8362\u837F\u83C7\u83F6\u8448\u84B4\u8553\u8559\u856B\uFA1F\u85B0\uFA20\uFA21\u8807\u88F5\u8A12\u8A37\u8A79\u8AA7\u8ABE\u8ADF\uFA22\u8AF6\u8B53\u8B7F\u8CF0\u8CF4\u8D12\u8D76\uFA23\u8ECF\uFA24\uFA25\u9067\u90DE\uFA26\u9115\u9127\u91DA\u91D7\u91DE\u91ED\u91EE\u91E4\u91E5\u9206\u9210\u920A\u923A\u9240\u923C\u924E\u9259\u9251\u9239\u9267\u92A7\u9277\u9278\u92E7\u92D7\u92D9\u92D0\uFA27\u92D5\u92E0\u92D3\u9325\u9321\u92FB\uFA28\u931E\u92FF\u931D\u9302\u9370\u9357\u93A4\u93C6\u93DE\u93F8\u9431\u9445\u9448\u9592\uF9DC\uFA29\u969D\u96AF\u9733\u973B\u9743\u974D\u974F\u9751\u9755\u9857\u9865\uFA2A\uFA2B\u9927\uFA2C\u999E\u9A4E\u9AD9"],
      ["fc40", "\u9ADC\u9B75\u9B72\u9B8F\u9BB1\u9BBB\u9C00\u9D70\u9D6B\uFA2D\u9E19\u9ED1"]
    ];
  }
});

// ../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/tables/eucjp.json
var require_eucjp = __commonJS({
  "../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/tables/eucjp.json"(exports, module2) {
    module2.exports = [
      ["0", "\0", 127],
      ["8ea1", "\uFF61", 62],
      ["a1a1", "\u3000\u3001\u3002\uFF0C\uFF0E\u30FB\uFF1A\uFF1B\uFF1F\uFF01\u309B\u309C\xB4\uFF40\xA8\uFF3E\uFFE3\uFF3F\u30FD\u30FE\u309D\u309E\u3003\u4EDD\u3005\u3006\u3007\u30FC\u2015\u2010\uFF0F\uFF3C\uFF5E\u2225\uFF5C\u2026\u2025\u2018\u2019\u201C\u201D\uFF08\uFF09\u3014\u3015\uFF3B\uFF3D\uFF5B\uFF5D\u3008", 9, "\uFF0B\uFF0D\xB1\xD7\xF7\uFF1D\u2260\uFF1C\uFF1E\u2266\u2267\u221E\u2234\u2642\u2640\xB0\u2032\u2033\u2103\uFFE5\uFF04\uFFE0\uFFE1\uFF05\uFF03\uFF06\uFF0A\uFF20\xA7\u2606\u2605\u25CB\u25CF\u25CE\u25C7"],
      ["a2a1", "\u25C6\u25A1\u25A0\u25B3\u25B2\u25BD\u25BC\u203B\u3012\u2192\u2190\u2191\u2193\u3013"],
      ["a2ba", "\u2208\u220B\u2286\u2287\u2282\u2283\u222A\u2229"],
      ["a2ca", "\u2227\u2228\uFFE2\u21D2\u21D4\u2200\u2203"],
      ["a2dc", "\u2220\u22A5\u2312\u2202\u2207\u2261\u2252\u226A\u226B\u221A\u223D\u221D\u2235\u222B\u222C"],
      ["a2f2", "\u212B\u2030\u266F\u266D\u266A\u2020\u2021\xB6"],
      ["a2fe", "\u25EF"],
      ["a3b0", "\uFF10", 9],
      ["a3c1", "\uFF21", 25],
      ["a3e1", "\uFF41", 25],
      ["a4a1", "\u3041", 82],
      ["a5a1", "\u30A1", 85],
      ["a6a1", "\u0391", 16, "\u03A3", 6],
      ["a6c1", "\u03B1", 16, "\u03C3", 6],
      ["a7a1", "\u0410", 5, "\u0401\u0416", 25],
      ["a7d1", "\u0430", 5, "\u0451\u0436", 25],
      ["a8a1", "\u2500\u2502\u250C\u2510\u2518\u2514\u251C\u252C\u2524\u2534\u253C\u2501\u2503\u250F\u2513\u251B\u2517\u2523\u2533\u252B\u253B\u254B\u2520\u252F\u2528\u2537\u253F\u251D\u2530\u2525\u2538\u2542"],
      ["ada1", "\u2460", 19, "\u2160", 9],
      ["adc0", "\u3349\u3314\u3322\u334D\u3318\u3327\u3303\u3336\u3351\u3357\u330D\u3326\u3323\u332B\u334A\u333B\u339C\u339D\u339E\u338E\u338F\u33C4\u33A1"],
      ["addf", "\u337B\u301D\u301F\u2116\u33CD\u2121\u32A4", 4, "\u3231\u3232\u3239\u337E\u337D\u337C\u2252\u2261\u222B\u222E\u2211\u221A\u22A5\u2220\u221F\u22BF\u2235\u2229\u222A"],
      ["b0a1", "\u4E9C\u5516\u5A03\u963F\u54C0\u611B\u6328\u59F6\u9022\u8475\u831C\u7A50\u60AA\u63E1\u6E25\u65ED\u8466\u82A6\u9BF5\u6893\u5727\u65A1\u6271\u5B9B\u59D0\u867B\u98F4\u7D62\u7DBE\u9B8E\u6216\u7C9F\u88B7\u5B89\u5EB5\u6309\u6697\u6848\u95C7\u978D\u674F\u4EE5\u4F0A\u4F4D\u4F9D\u5049\u56F2\u5937\u59D4\u5A01\u5C09\u60DF\u610F\u6170\u6613\u6905\u70BA\u754F\u7570\u79FB\u7DAD\u7DEF\u80C3\u840E\u8863\u8B02\u9055\u907A\u533B\u4E95\u4EA5\u57DF\u80B2\u90C1\u78EF\u4E00\u58F1\u6EA2\u9038\u7A32\u8328\u828B\u9C2F\u5141\u5370\u54BD\u54E1\u56E0\u59FB\u5F15\u98F2\u6DEB\u80E4\u852D"],
      ["b1a1", "\u9662\u9670\u96A0\u97FB\u540B\u53F3\u5B87\u70CF\u7FBD\u8FC2\u96E8\u536F\u9D5C\u7ABA\u4E11\u7893\u81FC\u6E26\u5618\u5504\u6B1D\u851A\u9C3B\u59E5\u53A9\u6D66\u74DC\u958F\u5642\u4E91\u904B\u96F2\u834F\u990C\u53E1\u55B6\u5B30\u5F71\u6620\u66F3\u6804\u6C38\u6CF3\u6D29\u745B\u76C8\u7A4E\u9834\u82F1\u885B\u8A60\u92ED\u6DB2\u75AB\u76CA\u99C5\u60A6\u8B01\u8D8A\u95B2\u698E\u53AD\u5186\u5712\u5830\u5944\u5BB4\u5EF6\u6028\u63A9\u63F4\u6CBF\u6F14\u708E\u7114\u7159\u71D5\u733F\u7E01\u8276\u82D1\u8597\u9060\u925B\u9D1B\u5869\u65BC\u6C5A\u7525\u51F9\u592E\u5965\u5F80\u5FDC"],
      ["b2a1", "\u62BC\u65FA\u6A2A\u6B27\u6BB4\u738B\u7FC1\u8956\u9D2C\u9D0E\u9EC4\u5CA1\u6C96\u837B\u5104\u5C4B\u61B6\u81C6\u6876\u7261\u4E59\u4FFA\u5378\u6069\u6E29\u7A4F\u97F3\u4E0B\u5316\u4EEE\u4F55\u4F3D\u4FA1\u4F73\u52A0\u53EF\u5609\u590F\u5AC1\u5BB6\u5BE1\u79D1\u6687\u679C\u67B6\u6B4C\u6CB3\u706B\u73C2\u798D\u79BE\u7A3C\u7B87\u82B1\u82DB\u8304\u8377\u83EF\u83D3\u8766\u8AB2\u5629\u8CA8\u8FE6\u904E\u971E\u868A\u4FC4\u5CE8\u6211\u7259\u753B\u81E5\u82BD\u86FE\u8CC0\u96C5\u9913\u99D5\u4ECB\u4F1A\u89E3\u56DE\u584A\u58CA\u5EFB\u5FEB\u602A\u6094\u6062\u61D0\u6212\u62D0\u6539"],
      ["b3a1", "\u9B41\u6666\u68B0\u6D77\u7070\u754C\u7686\u7D75\u82A5\u87F9\u958B\u968E\u8C9D\u51F1\u52BE\u5916\u54B3\u5BB3\u5D16\u6168\u6982\u6DAF\u788D\u84CB\u8857\u8A72\u93A7\u9AB8\u6D6C\u99A8\u86D9\u57A3\u67FF\u86CE\u920E\u5283\u5687\u5404\u5ED3\u62E1\u64B9\u683C\u6838\u6BBB\u7372\u78BA\u7A6B\u899A\u89D2\u8D6B\u8F03\u90ED\u95A3\u9694\u9769\u5B66\u5CB3\u697D\u984D\u984E\u639B\u7B20\u6A2B\u6A7F\u68B6\u9C0D\u6F5F\u5272\u559D\u6070\u62EC\u6D3B\u6E07\u6ED1\u845B\u8910\u8F44\u4E14\u9C39\u53F6\u691B\u6A3A\u9784\u682A\u515C\u7AC3\u84B2\u91DC\u938C\u565B\u9D28\u6822\u8305\u8431"],
      ["b4a1", "\u7CA5\u5208\u82C5\u74E6\u4E7E\u4F83\u51A0\u5BD2\u520A\u52D8\u52E7\u5DFB\u559A\u582A\u59E6\u5B8C\u5B98\u5BDB\u5E72\u5E79\u60A3\u611F\u6163\u61BE\u63DB\u6562\u67D1\u6853\u68FA\u6B3E\u6B53\u6C57\u6F22\u6F97\u6F45\u74B0\u7518\u76E3\u770B\u7AFF\u7BA1\u7C21\u7DE9\u7F36\u7FF0\u809D\u8266\u839E\u89B3\u8ACC\u8CAB\u9084\u9451\u9593\u9591\u95A2\u9665\u97D3\u9928\u8218\u4E38\u542B\u5CB8\u5DCC\u73A9\u764C\u773C\u5CA9\u7FEB\u8D0B\u96C1\u9811\u9854\u9858\u4F01\u4F0E\u5371\u559C\u5668\u57FA\u5947\u5B09\u5BC4\u5C90\u5E0C\u5E7E\u5FCC\u63EE\u673A\u65D7\u65E2\u671F\u68CB\u68C4"],
      ["b5a1", "\u6A5F\u5E30\u6BC5\u6C17\u6C7D\u757F\u7948\u5B63\u7A00\u7D00\u5FBD\u898F\u8A18\u8CB4\u8D77\u8ECC\u8F1D\u98E2\u9A0E\u9B3C\u4E80\u507D\u5100\u5993\u5B9C\u622F\u6280\u64EC\u6B3A\u72A0\u7591\u7947\u7FA9\u87FB\u8ABC\u8B70\u63AC\u83CA\u97A0\u5409\u5403\u55AB\u6854\u6A58\u8A70\u7827\u6775\u9ECD\u5374\u5BA2\u811A\u8650\u9006\u4E18\u4E45\u4EC7\u4F11\u53CA\u5438\u5BAE\u5F13\u6025\u6551\u673D\u6C42\u6C72\u6CE3\u7078\u7403\u7A76\u7AAE\u7B08\u7D1A\u7CFE\u7D66\u65E7\u725B\u53BB\u5C45\u5DE8\u62D2\u62E0\u6319\u6E20\u865A\u8A31\u8DDD\u92F8\u6F01\u79A6\u9B5A\u4EA8\u4EAB\u4EAC"],
      ["b6a1", "\u4F9B\u4FA0\u50D1\u5147\u7AF6\u5171\u51F6\u5354\u5321\u537F\u53EB\u55AC\u5883\u5CE1\u5F37\u5F4A\u602F\u6050\u606D\u631F\u6559\u6A4B\u6CC1\u72C2\u72ED\u77EF\u80F8\u8105\u8208\u854E\u90F7\u93E1\u97FF\u9957\u9A5A\u4EF0\u51DD\u5C2D\u6681\u696D\u5C40\u66F2\u6975\u7389\u6850\u7C81\u50C5\u52E4\u5747\u5DFE\u9326\u65A4\u6B23\u6B3D\u7434\u7981\u79BD\u7B4B\u7DCA\u82B9\u83CC\u887F\u895F\u8B39\u8FD1\u91D1\u541F\u9280\u4E5D\u5036\u53E5\u533A\u72D7\u7396\u77E9\u82E6\u8EAF\u99C6\u99C8\u99D2\u5177\u611A\u865E\u55B0\u7A7A\u5076\u5BD3\u9047\u9685\u4E32\u6ADB\u91E7\u5C51\u5C48"],
      ["b7a1", "\u6398\u7A9F\u6C93\u9774\u8F61\u7AAA\u718A\u9688\u7C82\u6817\u7E70\u6851\u936C\u52F2\u541B\u85AB\u8A13\u7FA4\u8ECD\u90E1\u5366\u8888\u7941\u4FC2\u50BE\u5211\u5144\u5553\u572D\u73EA\u578B\u5951\u5F62\u5F84\u6075\u6176\u6167\u61A9\u63B2\u643A\u656C\u666F\u6842\u6E13\u7566\u7A3D\u7CFB\u7D4C\u7D99\u7E4B\u7F6B\u830E\u834A\u86CD\u8A08\u8A63\u8B66\u8EFD\u981A\u9D8F\u82B8\u8FCE\u9BE8\u5287\u621F\u6483\u6FC0\u9699\u6841\u5091\u6B20\u6C7A\u6F54\u7A74\u7D50\u8840\u8A23\u6708\u4EF6\u5039\u5026\u5065\u517C\u5238\u5263\u55A7\u570F\u5805\u5ACC\u5EFA\u61B2\u61F8\u62F3\u6372"],
      ["b8a1", "\u691C\u6A29\u727D\u72AC\u732E\u7814\u786F\u7D79\u770C\u80A9\u898B\u8B19\u8CE2\u8ED2\u9063\u9375\u967A\u9855\u9A13\u9E78\u5143\u539F\u53B3\u5E7B\u5F26\u6E1B\u6E90\u7384\u73FE\u7D43\u8237\u8A00\u8AFA\u9650\u4E4E\u500B\u53E4\u547C\u56FA\u59D1\u5B64\u5DF1\u5EAB\u5F27\u6238\u6545\u67AF\u6E56\u72D0\u7CCA\u88B4\u80A1\u80E1\u83F0\u864E\u8A87\u8DE8\u9237\u96C7\u9867\u9F13\u4E94\u4E92\u4F0D\u5348\u5449\u543E\u5A2F\u5F8C\u5FA1\u609F\u68A7\u6A8E\u745A\u7881\u8A9E\u8AA4\u8B77\u9190\u4E5E\u9BC9\u4EA4\u4F7C\u4FAF\u5019\u5016\u5149\u516C\u529F\u52B9\u52FE\u539A\u53E3\u5411"],
      ["b9a1", "\u540E\u5589\u5751\u57A2\u597D\u5B54\u5B5D\u5B8F\u5DE5\u5DE7\u5DF7\u5E78\u5E83\u5E9A\u5EB7\u5F18\u6052\u614C\u6297\u62D8\u63A7\u653B\u6602\u6643\u66F4\u676D\u6821\u6897\u69CB\u6C5F\u6D2A\u6D69\u6E2F\u6E9D\u7532\u7687\u786C\u7A3F\u7CE0\u7D05\u7D18\u7D5E\u7DB1\u8015\u8003\u80AF\u80B1\u8154\u818F\u822A\u8352\u884C\u8861\u8B1B\u8CA2\u8CFC\u90CA\u9175\u9271\u783F\u92FC\u95A4\u964D\u9805\u9999\u9AD8\u9D3B\u525B\u52AB\u53F7\u5408\u58D5\u62F7\u6FE0\u8C6A\u8F5F\u9EB9\u514B\u523B\u544A\u56FD\u7A40\u9177\u9D60\u9ED2\u7344\u6F09\u8170\u7511\u5FFD\u60DA\u9AA8\u72DB\u8FBC"],
      ["baa1", "\u6B64\u9803\u4ECA\u56F0\u5764\u58BE\u5A5A\u6068\u61C7\u660F\u6606\u6839\u68B1\u6DF7\u75D5\u7D3A\u826E\u9B42\u4E9B\u4F50\u53C9\u5506\u5D6F\u5DE6\u5DEE\u67FB\u6C99\u7473\u7802\u8A50\u9396\u88DF\u5750\u5EA7\u632B\u50B5\u50AC\u518D\u6700\u54C9\u585E\u59BB\u5BB0\u5F69\u624D\u63A1\u683D\u6B73\u6E08\u707D\u91C7\u7280\u7815\u7826\u796D\u658E\u7D30\u83DC\u88C1\u8F09\u969B\u5264\u5728\u6750\u7F6A\u8CA1\u51B4\u5742\u962A\u583A\u698A\u80B4\u54B2\u5D0E\u57FC\u7895\u9DFA\u4F5C\u524A\u548B\u643E\u6628\u6714\u67F5\u7A84\u7B56\u7D22\u932F\u685C\u9BAD\u7B39\u5319\u518A\u5237"],
      ["bba1", "\u5BDF\u62F6\u64AE\u64E6\u672D\u6BBA\u85A9\u96D1\u7690\u9BD6\u634C\u9306\u9BAB\u76BF\u6652\u4E09\u5098\u53C2\u5C71\u60E8\u6492\u6563\u685F\u71E6\u73CA\u7523\u7B97\u7E82\u8695\u8B83\u8CDB\u9178\u9910\u65AC\u66AB\u6B8B\u4ED5\u4ED4\u4F3A\u4F7F\u523A\u53F8\u53F2\u55E3\u56DB\u58EB\u59CB\u59C9\u59FF\u5B50\u5C4D\u5E02\u5E2B\u5FD7\u601D\u6307\u652F\u5B5C\u65AF\u65BD\u65E8\u679D\u6B62\u6B7B\u6C0F\u7345\u7949\u79C1\u7CF8\u7D19\u7D2B\u80A2\u8102\u81F3\u8996\u8A5E\u8A69\u8A66\u8A8C\u8AEE\u8CC7\u8CDC\u96CC\u98FC\u6B6F\u4E8B\u4F3C\u4F8D\u5150\u5B57\u5BFA\u6148\u6301\u6642"],
      ["bca1", "\u6B21\u6ECB\u6CBB\u723E\u74BD\u75D4\u78C1\u793A\u800C\u8033\u81EA\u8494\u8F9E\u6C50\u9E7F\u5F0F\u8B58\u9D2B\u7AFA\u8EF8\u5B8D\u96EB\u4E03\u53F1\u57F7\u5931\u5AC9\u5BA4\u6089\u6E7F\u6F06\u75BE\u8CEA\u5B9F\u8500\u7BE0\u5072\u67F4\u829D\u5C61\u854A\u7E1E\u820E\u5199\u5C04\u6368\u8D66\u659C\u716E\u793E\u7D17\u8005\u8B1D\u8ECA\u906E\u86C7\u90AA\u501F\u52FA\u5C3A\u6753\u707C\u7235\u914C\u91C8\u932B\u82E5\u5BC2\u5F31\u60F9\u4E3B\u53D6\u5B88\u624B\u6731\u6B8A\u72E9\u73E0\u7A2E\u816B\u8DA3\u9152\u9996\u5112\u53D7\u546A\u5BFF\u6388\u6A39\u7DAC\u9700\u56DA\u53CE\u5468"],
      ["bda1", "\u5B97\u5C31\u5DDE\u4FEE\u6101\u62FE\u6D32\u79C0\u79CB\u7D42\u7E4D\u7FD2\u81ED\u821F\u8490\u8846\u8972\u8B90\u8E74\u8F2F\u9031\u914B\u916C\u96C6\u919C\u4EC0\u4F4F\u5145\u5341\u5F93\u620E\u67D4\u6C41\u6E0B\u7363\u7E26\u91CD\u9283\u53D4\u5919\u5BBF\u6DD1\u795D\u7E2E\u7C9B\u587E\u719F\u51FA\u8853\u8FF0\u4FCA\u5CFB\u6625\u77AC\u7AE3\u821C\u99FF\u51C6\u5FAA\u65EC\u696F\u6B89\u6DF3\u6E96\u6F64\u76FE\u7D14\u5DE1\u9075\u9187\u9806\u51E6\u521D\u6240\u6691\u66D9\u6E1A\u5EB6\u7DD2\u7F72\u66F8\u85AF\u85F7\u8AF8\u52A9\u53D9\u5973\u5E8F\u5F90\u6055\u92E4\u9664\u50B7\u511F"],
      ["bea1", "\u52DD\u5320\u5347\u53EC\u54E8\u5546\u5531\u5617\u5968\u59BE\u5A3C\u5BB5\u5C06\u5C0F\u5C11\u5C1A\u5E84\u5E8A\u5EE0\u5F70\u627F\u6284\u62DB\u638C\u6377\u6607\u660C\u662D\u6676\u677E\u68A2\u6A1F\u6A35\u6CBC\u6D88\u6E09\u6E58\u713C\u7126\u7167\u75C7\u7701\u785D\u7901\u7965\u79F0\u7AE0\u7B11\u7CA7\u7D39\u8096\u83D6\u848B\u8549\u885D\u88F3\u8A1F\u8A3C\u8A54\u8A73\u8C61\u8CDE\u91A4\u9266\u937E\u9418\u969C\u9798\u4E0A\u4E08\u4E1E\u4E57\u5197\u5270\u57CE\u5834\u58CC\u5B22\u5E38\u60C5\u64FE\u6761\u6756\u6D44\u72B6\u7573\u7A63\u84B8\u8B72\u91B8\u9320\u5631\u57F4\u98FE"],
      ["bfa1", "\u62ED\u690D\u6B96\u71ED\u7E54\u8077\u8272\u89E6\u98DF\u8755\u8FB1\u5C3B\u4F38\u4FE1\u4FB5\u5507\u5A20\u5BDD\u5BE9\u5FC3\u614E\u632F\u65B0\u664B\u68EE\u699B\u6D78\u6DF1\u7533\u75B9\u771F\u795E\u79E6\u7D33\u81E3\u82AF\u85AA\u89AA\u8A3A\u8EAB\u8F9B\u9032\u91DD\u9707\u4EBA\u4EC1\u5203\u5875\u58EC\u5C0B\u751A\u5C3D\u814E\u8A0A\u8FC5\u9663\u976D\u7B25\u8ACF\u9808\u9162\u56F3\u53A8\u9017\u5439\u5782\u5E25\u63A8\u6C34\u708A\u7761\u7C8B\u7FE0\u8870\u9042\u9154\u9310\u9318\u968F\u745E\u9AC4\u5D07\u5D69\u6570\u67A2\u8DA8\u96DB\u636E\u6749\u6919\u83C5\u9817\u96C0\u88FE"],
      ["c0a1", "\u6F84\u647A\u5BF8\u4E16\u702C\u755D\u662F\u51C4\u5236\u52E2\u59D3\u5F81\u6027\u6210\u653F\u6574\u661F\u6674\u68F2\u6816\u6B63\u6E05\u7272\u751F\u76DB\u7CBE\u8056\u58F0\u88FD\u897F\u8AA0\u8A93\u8ACB\u901D\u9192\u9752\u9759\u6589\u7A0E\u8106\u96BB\u5E2D\u60DC\u621A\u65A5\u6614\u6790\u77F3\u7A4D\u7C4D\u7E3E\u810A\u8CAC\u8D64\u8DE1\u8E5F\u78A9\u5207\u62D9\u63A5\u6442\u6298\u8A2D\u7A83\u7BC0\u8AAC\u96EA\u7D76\u820C\u8749\u4ED9\u5148\u5343\u5360\u5BA3\u5C02\u5C16\u5DDD\u6226\u6247\u64B0\u6813\u6834\u6CC9\u6D45\u6D17\u67D3\u6F5C\u714E\u717D\u65CB\u7A7F\u7BAD\u7DDA"],
      ["c1a1", "\u7E4A\u7FA8\u817A\u821B\u8239\u85A6\u8A6E\u8CCE\u8DF5\u9078\u9077\u92AD\u9291\u9583\u9BAE\u524D\u5584\u6F38\u7136\u5168\u7985\u7E55\u81B3\u7CCE\u564C\u5851\u5CA8\u63AA\u66FE\u66FD\u695A\u72D9\u758F\u758E\u790E\u7956\u79DF\u7C97\u7D20\u7D44\u8607\u8A34\u963B\u9061\u9F20\u50E7\u5275\u53CC\u53E2\u5009\u55AA\u58EE\u594F\u723D\u5B8B\u5C64\u531D\u60E3\u60F3\u635C\u6383\u633F\u63BB\u64CD\u65E9\u66F9\u5DE3\u69CD\u69FD\u6F15\u71E5\u4E89\u75E9\u76F8\u7A93\u7CDF\u7DCF\u7D9C\u8061\u8349\u8358\u846C\u84BC\u85FB\u88C5\u8D70\u9001\u906D\u9397\u971C\u9A12\u50CF\u5897\u618E"],
      ["c2a1", "\u81D3\u8535\u8D08\u9020\u4FC3\u5074\u5247\u5373\u606F\u6349\u675F\u6E2C\u8DB3\u901F\u4FD7\u5C5E\u8CCA\u65CF\u7D9A\u5352\u8896\u5176\u63C3\u5B58\u5B6B\u5C0A\u640D\u6751\u905C\u4ED6\u591A\u592A\u6C70\u8A51\u553E\u5815\u59A5\u60F0\u6253\u67C1\u8235\u6955\u9640\u99C4\u9A28\u4F53\u5806\u5BFE\u8010\u5CB1\u5E2F\u5F85\u6020\u614B\u6234\u66FF\u6CF0\u6EDE\u80CE\u817F\u82D4\u888B\u8CB8\u9000\u902E\u968A\u9EDB\u9BDB\u4EE3\u53F0\u5927\u7B2C\u918D\u984C\u9DF9\u6EDD\u7027\u5353\u5544\u5B85\u6258\u629E\u62D3\u6CA2\u6FEF\u7422\u8A17\u9438\u6FC1\u8AFE\u8338\u51E7\u86F8\u53EA"],
      ["c3a1", "\u53E9\u4F46\u9054\u8FB0\u596A\u8131\u5DFD\u7AEA\u8FBF\u68DA\u8C37\u72F8\u9C48\u6A3D\u8AB0\u4E39\u5358\u5606\u5766\u62C5\u63A2\u65E6\u6B4E\u6DE1\u6E5B\u70AD\u77ED\u7AEF\u7BAA\u7DBB\u803D\u80C6\u86CB\u8A95\u935B\u56E3\u58C7\u5F3E\u65AD\u6696\u6A80\u6BB5\u7537\u8AC7\u5024\u77E5\u5730\u5F1B\u6065\u667A\u6C60\u75F4\u7A1A\u7F6E\u81F4\u8718\u9045\u99B3\u7BC9\u755C\u7AF9\u7B51\u84C4\u9010\u79E9\u7A92\u8336\u5AE1\u7740\u4E2D\u4EF2\u5B99\u5FE0\u62BD\u663C\u67F1\u6CE8\u866B\u8877\u8A3B\u914E\u92F3\u99D0\u6A17\u7026\u732A\u82E7\u8457\u8CAF\u4E01\u5146\u51CB\u558B\u5BF5"],
      ["c4a1", "\u5E16\u5E33\u5E81\u5F14\u5F35\u5F6B\u5FB4\u61F2\u6311\u66A2\u671D\u6F6E\u7252\u753A\u773A\u8074\u8139\u8178\u8776\u8ABF\u8ADC\u8D85\u8DF3\u929A\u9577\u9802\u9CE5\u52C5\u6357\u76F4\u6715\u6C88\u73CD\u8CC3\u93AE\u9673\u6D25\u589C\u690E\u69CC\u8FFD\u939A\u75DB\u901A\u585A\u6802\u63B4\u69FB\u4F43\u6F2C\u67D8\u8FBB\u8526\u7DB4\u9354\u693F\u6F70\u576A\u58F7\u5B2C\u7D2C\u722A\u540A\u91E3\u9DB4\u4EAD\u4F4E\u505C\u5075\u5243\u8C9E\u5448\u5824\u5B9A\u5E1D\u5E95\u5EAD\u5EF7\u5F1F\u608C\u62B5\u633A\u63D0\u68AF\u6C40\u7887\u798E\u7A0B\u7DE0\u8247\u8A02\u8AE6\u8E44\u9013"],
      ["c5a1", "\u90B8\u912D\u91D8\u9F0E\u6CE5\u6458\u64E2\u6575\u6EF4\u7684\u7B1B\u9069\u93D1\u6EBA\u54F2\u5FB9\u64A4\u8F4D\u8FED\u9244\u5178\u586B\u5929\u5C55\u5E97\u6DFB\u7E8F\u751C\u8CBC\u8EE2\u985B\u70B9\u4F1D\u6BBF\u6FB1\u7530\u96FB\u514E\u5410\u5835\u5857\u59AC\u5C60\u5F92\u6597\u675C\u6E21\u767B\u83DF\u8CED\u9014\u90FD\u934D\u7825\u783A\u52AA\u5EA6\u571F\u5974\u6012\u5012\u515A\u51AC\u51CD\u5200\u5510\u5854\u5858\u5957\u5B95\u5CF6\u5D8B\u60BC\u6295\u642D\u6771\u6843\u68BC\u68DF\u76D7\u6DD8\u6E6F\u6D9B\u706F\u71C8\u5F53\u75D8\u7977\u7B49\u7B54\u7B52\u7CD6\u7D71\u5230"],
      ["c6a1", "\u8463\u8569\u85E4\u8A0E\u8B04\u8C46\u8E0F\u9003\u900F\u9419\u9676\u982D\u9A30\u95D8\u50CD\u52D5\u540C\u5802\u5C0E\u61A7\u649E\u6D1E\u77B3\u7AE5\u80F4\u8404\u9053\u9285\u5CE0\u9D07\u533F\u5F97\u5FB3\u6D9C\u7279\u7763\u79BF\u7BE4\u6BD2\u72EC\u8AAD\u6803\u6A61\u51F8\u7A81\u6934\u5C4A\u9CF6\u82EB\u5BC5\u9149\u701E\u5678\u5C6F\u60C7\u6566\u6C8C\u8C5A\u9041\u9813\u5451\u66C7\u920D\u5948\u90A3\u5185\u4E4D\u51EA\u8599\u8B0E\u7058\u637A\u934B\u6962\u99B4\u7E04\u7577\u5357\u6960\u8EDF\u96E3\u6C5D\u4E8C\u5C3C\u5F10\u8FE9\u5302\u8CD1\u8089\u8679\u5EFF\u65E5\u4E73\u5165"],
      ["c7a1", "\u5982\u5C3F\u97EE\u4EFB\u598A\u5FCD\u8A8D\u6FE1\u79B0\u7962\u5BE7\u8471\u732B\u71B1\u5E74\u5FF5\u637B\u649A\u71C3\u7C98\u4E43\u5EFC\u4E4B\u57DC\u56A2\u60A9\u6FC3\u7D0D\u80FD\u8133\u81BF\u8FB2\u8997\u86A4\u5DF4\u628A\u64AD\u8987\u6777\u6CE2\u6D3E\u7436\u7834\u5A46\u7F75\u82AD\u99AC\u4FF3\u5EC3\u62DD\u6392\u6557\u676F\u76C3\u724C\u80CC\u80BA\u8F29\u914D\u500D\u57F9\u5A92\u6885\u6973\u7164\u72FD\u8CB7\u58F2\u8CE0\u966A\u9019\u877F\u79E4\u77E7\u8429\u4F2F\u5265\u535A\u62CD\u67CF\u6CCA\u767D\u7B94\u7C95\u8236\u8584\u8FEB\u66DD\u6F20\u7206\u7E1B\u83AB\u99C1\u9EA6"],
      ["c8a1", "\u51FD\u7BB1\u7872\u7BB8\u8087\u7B48\u6AE8\u5E61\u808C\u7551\u7560\u516B\u9262\u6E8C\u767A\u9197\u9AEA\u4F10\u7F70\u629C\u7B4F\u95A5\u9CE9\u567A\u5859\u86E4\u96BC\u4F34\u5224\u534A\u53CD\u53DB\u5E06\u642C\u6591\u677F\u6C3E\u6C4E\u7248\u72AF\u73ED\u7554\u7E41\u822C\u85E9\u8CA9\u7BC4\u91C6\u7169\u9812\u98EF\u633D\u6669\u756A\u76E4\u78D0\u8543\u86EE\u532A\u5351\u5426\u5983\u5E87\u5F7C\u60B2\u6249\u6279\u62AB\u6590\u6BD4\u6CCC\u75B2\u76AE\u7891\u79D8\u7DCB\u7F77\u80A5\u88AB\u8AB9\u8CBB\u907F\u975E\u98DB\u6A0B\u7C38\u5099\u5C3E\u5FAE\u6787\u6BD8\u7435\u7709\u7F8E"],
      ["c9a1", "\u9F3B\u67CA\u7A17\u5339\u758B\u9AED\u5F66\u819D\u83F1\u8098\u5F3C\u5FC5\u7562\u7B46\u903C\u6867\u59EB\u5A9B\u7D10\u767E\u8B2C\u4FF5\u5F6A\u6A19\u6C37\u6F02\u74E2\u7968\u8868\u8A55\u8C79\u5EDF\u63CF\u75C5\u79D2\u82D7\u9328\u92F2\u849C\u86ED\u9C2D\u54C1\u5F6C\u658C\u6D5C\u7015\u8CA7\u8CD3\u983B\u654F\u74F6\u4E0D\u4ED8\u57E0\u592B\u5A66\u5BCC\u51A8\u5E03\u5E9C\u6016\u6276\u6577\u65A7\u666E\u6D6E\u7236\u7B26\u8150\u819A\u8299\u8B5C\u8CA0\u8CE6\u8D74\u961C\u9644\u4FAE\u64AB\u6B66\u821E\u8461\u856A\u90E8\u5C01\u6953\u98A8\u847A\u8557\u4F0F\u526F\u5FA9\u5E45\u670D"],
      ["caa1", "\u798F\u8179\u8907\u8986\u6DF5\u5F17\u6255\u6CB8\u4ECF\u7269\u9B92\u5206\u543B\u5674\u58B3\u61A4\u626E\u711A\u596E\u7C89\u7CDE\u7D1B\u96F0\u6587\u805E\u4E19\u4F75\u5175\u5840\u5E63\u5E73\u5F0A\u67C4\u4E26\u853D\u9589\u965B\u7C73\u9801\u50FB\u58C1\u7656\u78A7\u5225\u77A5\u8511\u7B86\u504F\u5909\u7247\u7BC7\u7DE8\u8FBA\u8FD4\u904D\u4FBF\u52C9\u5A29\u5F01\u97AD\u4FDD\u8217\u92EA\u5703\u6355\u6B69\u752B\u88DC\u8F14\u7A42\u52DF\u5893\u6155\u620A\u66AE\u6BCD\u7C3F\u83E9\u5023\u4FF8\u5305\u5446\u5831\u5949\u5B9D\u5CF0\u5CEF\u5D29\u5E96\u62B1\u6367\u653E\u65B9\u670B"],
      ["cba1", "\u6CD5\u6CE1\u70F9\u7832\u7E2B\u80DE\u82B3\u840C\u84EC\u8702\u8912\u8A2A\u8C4A\u90A6\u92D2\u98FD\u9CF3\u9D6C\u4E4F\u4EA1\u508D\u5256\u574A\u59A8\u5E3D\u5FD8\u5FD9\u623F\u66B4\u671B\u67D0\u68D2\u5192\u7D21\u80AA\u81A8\u8B00\u8C8C\u8CBF\u927E\u9632\u5420\u982C\u5317\u50D5\u535C\u58A8\u64B2\u6734\u7267\u7766\u7A46\u91E6\u52C3\u6CA1\u6B86\u5800\u5E4C\u5954\u672C\u7FFB\u51E1\u76C6\u6469\u78E8\u9B54\u9EBB\u57CB\u59B9\u6627\u679A\u6BCE\u54E9\u69D9\u5E55\u819C\u6795\u9BAA\u67FE\u9C52\u685D\u4EA6\u4FE3\u53C8\u62B9\u672B\u6CAB\u8FC4\u4FAD\u7E6D\u9EBF\u4E07\u6162\u6E80"],
      ["cca1", "\u6F2B\u8513\u5473\u672A\u9B45\u5DF3\u7B95\u5CAC\u5BC6\u871C\u6E4A\u84D1\u7A14\u8108\u5999\u7C8D\u6C11\u7720\u52D9\u5922\u7121\u725F\u77DB\u9727\u9D61\u690B\u5A7F\u5A18\u51A5\u540D\u547D\u660E\u76DF\u8FF7\u9298\u9CF4\u59EA\u725D\u6EC5\u514D\u68C9\u7DBF\u7DEC\u9762\u9EBA\u6478\u6A21\u8302\u5984\u5B5F\u6BDB\u731B\u76F2\u7DB2\u8017\u8499\u5132\u6728\u9ED9\u76EE\u6762\u52FF\u9905\u5C24\u623B\u7C7E\u8CB0\u554F\u60B6\u7D0B\u9580\u5301\u4E5F\u51B6\u591C\u723A\u8036\u91CE\u5F25\u77E2\u5384\u5F79\u7D04\u85AC\u8A33\u8E8D\u9756\u67F3\u85AE\u9453\u6109\u6108\u6CB9\u7652"],
      ["cda1", "\u8AED\u8F38\u552F\u4F51\u512A\u52C7\u53CB\u5BA5\u5E7D\u60A0\u6182\u63D6\u6709\u67DA\u6E67\u6D8C\u7336\u7337\u7531\u7950\u88D5\u8A98\u904A\u9091\u90F5\u96C4\u878D\u5915\u4E88\u4F59\u4E0E\u8A89\u8F3F\u9810\u50AD\u5E7C\u5996\u5BB9\u5EB8\u63DA\u63FA\u64C1\u66DC\u694A\u69D8\u6D0B\u6EB6\u7194\u7528\u7AAF\u7F8A\u8000\u8449\u84C9\u8981\u8B21\u8E0A\u9065\u967D\u990A\u617E\u6291\u6B32\u6C83\u6D74\u7FCC\u7FFC\u6DC0\u7F85\u87BA\u88F8\u6765\u83B1\u983C\u96F7\u6D1B\u7D61\u843D\u916A\u4E71\u5375\u5D50\u6B04\u6FEB\u85CD\u862D\u89A7\u5229\u540F\u5C65\u674E\u68A8\u7406\u7483"],
      ["cea1", "\u75E2\u88CF\u88E1\u91CC\u96E2\u9678\u5F8B\u7387\u7ACB\u844E\u63A0\u7565\u5289\u6D41\u6E9C\u7409\u7559\u786B\u7C92\u9686\u7ADC\u9F8D\u4FB6\u616E\u65C5\u865C\u4E86\u4EAE\u50DA\u4E21\u51CC\u5BEE\u6599\u6881\u6DBC\u731F\u7642\u77AD\u7A1C\u7CE7\u826F\u8AD2\u907C\u91CF\u9675\u9818\u529B\u7DD1\u502B\u5398\u6797\u6DCB\u71D0\u7433\u81E8\u8F2A\u96A3\u9C57\u9E9F\u7460\u5841\u6D99\u7D2F\u985E\u4EE4\u4F36\u4F8B\u51B7\u52B1\u5DBA\u601C\u73B2\u793C\u82D3\u9234\u96B7\u96F6\u970A\u9E97\u9F62\u66A6\u6B74\u5217\u52A3\u70C8\u88C2\u5EC9\u604B\u6190\u6F23\u7149\u7C3E\u7DF4\u806F"],
      ["cfa1", "\u84EE\u9023\u932C\u5442\u9B6F\u6AD3\u7089\u8CC2\u8DEF\u9732\u52B4\u5A41\u5ECA\u5F04\u6717\u697C\u6994\u6D6A\u6F0F\u7262\u72FC\u7BED\u8001\u807E\u874B\u90CE\u516D\u9E93\u7984\u808B\u9332\u8AD6\u502D\u548C\u8A71\u6B6A\u8CC4\u8107\u60D1\u67A0\u9DF2\u4E99\u4E98\u9C10\u8A6B\u85C1\u8568\u6900\u6E7E\u7897\u8155"],
      ["d0a1", "\u5F0C\u4E10\u4E15\u4E2A\u4E31\u4E36\u4E3C\u4E3F\u4E42\u4E56\u4E58\u4E82\u4E85\u8C6B\u4E8A\u8212\u5F0D\u4E8E\u4E9E\u4E9F\u4EA0\u4EA2\u4EB0\u4EB3\u4EB6\u4ECE\u4ECD\u4EC4\u4EC6\u4EC2\u4ED7\u4EDE\u4EED\u4EDF\u4EF7\u4F09\u4F5A\u4F30\u4F5B\u4F5D\u4F57\u4F47\u4F76\u4F88\u4F8F\u4F98\u4F7B\u4F69\u4F70\u4F91\u4F6F\u4F86\u4F96\u5118\u4FD4\u4FDF\u4FCE\u4FD8\u4FDB\u4FD1\u4FDA\u4FD0\u4FE4\u4FE5\u501A\u5028\u5014\u502A\u5025\u5005\u4F1C\u4FF6\u5021\u5029\u502C\u4FFE\u4FEF\u5011\u5006\u5043\u5047\u6703\u5055\u5050\u5048\u505A\u5056\u506C\u5078\u5080\u509A\u5085\u50B4\u50B2"],
      ["d1a1", "\u50C9\u50CA\u50B3\u50C2\u50D6\u50DE\u50E5\u50ED\u50E3\u50EE\u50F9\u50F5\u5109\u5101\u5102\u5116\u5115\u5114\u511A\u5121\u513A\u5137\u513C\u513B\u513F\u5140\u5152\u514C\u5154\u5162\u7AF8\u5169\u516A\u516E\u5180\u5182\u56D8\u518C\u5189\u518F\u5191\u5193\u5195\u5196\u51A4\u51A6\u51A2\u51A9\u51AA\u51AB\u51B3\u51B1\u51B2\u51B0\u51B5\u51BD\u51C5\u51C9\u51DB\u51E0\u8655\u51E9\u51ED\u51F0\u51F5\u51FE\u5204\u520B\u5214\u520E\u5227\u522A\u522E\u5233\u5239\u524F\u5244\u524B\u524C\u525E\u5254\u526A\u5274\u5269\u5273\u527F\u527D\u528D\u5294\u5292\u5271\u5288\u5291\u8FA8"],
      ["d2a1", "\u8FA7\u52AC\u52AD\u52BC\u52B5\u52C1\u52CD\u52D7\u52DE\u52E3\u52E6\u98ED\u52E0\u52F3\u52F5\u52F8\u52F9\u5306\u5308\u7538\u530D\u5310\u530F\u5315\u531A\u5323\u532F\u5331\u5333\u5338\u5340\u5346\u5345\u4E17\u5349\u534D\u51D6\u535E\u5369\u536E\u5918\u537B\u5377\u5382\u5396\u53A0\u53A6\u53A5\u53AE\u53B0\u53B6\u53C3\u7C12\u96D9\u53DF\u66FC\u71EE\u53EE\u53E8\u53ED\u53FA\u5401\u543D\u5440\u542C\u542D\u543C\u542E\u5436\u5429\u541D\u544E\u548F\u5475\u548E\u545F\u5471\u5477\u5470\u5492\u547B\u5480\u5476\u5484\u5490\u5486\u54C7\u54A2\u54B8\u54A5\u54AC\u54C4\u54C8\u54A8"],
      ["d3a1", "\u54AB\u54C2\u54A4\u54BE\u54BC\u54D8\u54E5\u54E6\u550F\u5514\u54FD\u54EE\u54ED\u54FA\u54E2\u5539\u5540\u5563\u554C\u552E\u555C\u5545\u5556\u5557\u5538\u5533\u555D\u5599\u5580\u54AF\u558A\u559F\u557B\u557E\u5598\u559E\u55AE\u557C\u5583\u55A9\u5587\u55A8\u55DA\u55C5\u55DF\u55C4\u55DC\u55E4\u55D4\u5614\u55F7\u5616\u55FE\u55FD\u561B\u55F9\u564E\u5650\u71DF\u5634\u5636\u5632\u5638\u566B\u5664\u562F\u566C\u566A\u5686\u5680\u568A\u56A0\u5694\u568F\u56A5\u56AE\u56B6\u56B4\u56C2\u56BC\u56C1\u56C3\u56C0\u56C8\u56CE\u56D1\u56D3\u56D7\u56EE\u56F9\u5700\u56FF\u5704\u5709"],
      ["d4a1", "\u5708\u570B\u570D\u5713\u5718\u5716\u55C7\u571C\u5726\u5737\u5738\u574E\u573B\u5740\u574F\u5769\u57C0\u5788\u5761\u577F\u5789\u5793\u57A0\u57B3\u57A4\u57AA\u57B0\u57C3\u57C6\u57D4\u57D2\u57D3\u580A\u57D6\u57E3\u580B\u5819\u581D\u5872\u5821\u5862\u584B\u5870\u6BC0\u5852\u583D\u5879\u5885\u58B9\u589F\u58AB\u58BA\u58DE\u58BB\u58B8\u58AE\u58C5\u58D3\u58D1\u58D7\u58D9\u58D8\u58E5\u58DC\u58E4\u58DF\u58EF\u58FA\u58F9\u58FB\u58FC\u58FD\u5902\u590A\u5910\u591B\u68A6\u5925\u592C\u592D\u5932\u5938\u593E\u7AD2\u5955\u5950\u594E\u595A\u5958\u5962\u5960\u5967\u596C\u5969"],
      ["d5a1", "\u5978\u5981\u599D\u4F5E\u4FAB\u59A3\u59B2\u59C6\u59E8\u59DC\u598D\u59D9\u59DA\u5A25\u5A1F\u5A11\u5A1C\u5A09\u5A1A\u5A40\u5A6C\u5A49\u5A35\u5A36\u5A62\u5A6A\u5A9A\u5ABC\u5ABE\u5ACB\u5AC2\u5ABD\u5AE3\u5AD7\u5AE6\u5AE9\u5AD6\u5AFA\u5AFB\u5B0C\u5B0B\u5B16\u5B32\u5AD0\u5B2A\u5B36\u5B3E\u5B43\u5B45\u5B40\u5B51\u5B55\u5B5A\u5B5B\u5B65\u5B69\u5B70\u5B73\u5B75\u5B78\u6588\u5B7A\u5B80\u5B83\u5BA6\u5BB8\u5BC3\u5BC7\u5BC9\u5BD4\u5BD0\u5BE4\u5BE6\u5BE2\u5BDE\u5BE5\u5BEB\u5BF0\u5BF6\u5BF3\u5C05\u5C07\u5C08\u5C0D\u5C13\u5C20\u5C22\u5C28\u5C38\u5C39\u5C41\u5C46\u5C4E\u5C53"],
      ["d6a1", "\u5C50\u5C4F\u5B71\u5C6C\u5C6E\u4E62\u5C76\u5C79\u5C8C\u5C91\u5C94\u599B\u5CAB\u5CBB\u5CB6\u5CBC\u5CB7\u5CC5\u5CBE\u5CC7\u5CD9\u5CE9\u5CFD\u5CFA\u5CED\u5D8C\u5CEA\u5D0B\u5D15\u5D17\u5D5C\u5D1F\u5D1B\u5D11\u5D14\u5D22\u5D1A\u5D19\u5D18\u5D4C\u5D52\u5D4E\u5D4B\u5D6C\u5D73\u5D76\u5D87\u5D84\u5D82\u5DA2\u5D9D\u5DAC\u5DAE\u5DBD\u5D90\u5DB7\u5DBC\u5DC9\u5DCD\u5DD3\u5DD2\u5DD6\u5DDB\u5DEB\u5DF2\u5DF5\u5E0B\u5E1A\u5E19\u5E11\u5E1B\u5E36\u5E37\u5E44\u5E43\u5E40\u5E4E\u5E57\u5E54\u5E5F\u5E62\u5E64\u5E47\u5E75\u5E76\u5E7A\u9EBC\u5E7F\u5EA0\u5EC1\u5EC2\u5EC8\u5ED0\u5ECF"],
      ["d7a1", "\u5ED6\u5EE3\u5EDD\u5EDA\u5EDB\u5EE2\u5EE1\u5EE8\u5EE9\u5EEC\u5EF1\u5EF3\u5EF0\u5EF4\u5EF8\u5EFE\u5F03\u5F09\u5F5D\u5F5C\u5F0B\u5F11\u5F16\u5F29\u5F2D\u5F38\u5F41\u5F48\u5F4C\u5F4E\u5F2F\u5F51\u5F56\u5F57\u5F59\u5F61\u5F6D\u5F73\u5F77\u5F83\u5F82\u5F7F\u5F8A\u5F88\u5F91\u5F87\u5F9E\u5F99\u5F98\u5FA0\u5FA8\u5FAD\u5FBC\u5FD6\u5FFB\u5FE4\u5FF8\u5FF1\u5FDD\u60B3\u5FFF\u6021\u6060\u6019\u6010\u6029\u600E\u6031\u601B\u6015\u602B\u6026\u600F\u603A\u605A\u6041\u606A\u6077\u605F\u604A\u6046\u604D\u6063\u6043\u6064\u6042\u606C\u606B\u6059\u6081\u608D\u60E7\u6083\u609A"],
      ["d8a1", "\u6084\u609B\u6096\u6097\u6092\u60A7\u608B\u60E1\u60B8\u60E0\u60D3\u60B4\u5FF0\u60BD\u60C6\u60B5\u60D8\u614D\u6115\u6106\u60F6\u60F7\u6100\u60F4\u60FA\u6103\u6121\u60FB\u60F1\u610D\u610E\u6147\u613E\u6128\u6127\u614A\u613F\u613C\u612C\u6134\u613D\u6142\u6144\u6173\u6177\u6158\u6159\u615A\u616B\u6174\u616F\u6165\u6171\u615F\u615D\u6153\u6175\u6199\u6196\u6187\u61AC\u6194\u619A\u618A\u6191\u61AB\u61AE\u61CC\u61CA\u61C9\u61F7\u61C8\u61C3\u61C6\u61BA\u61CB\u7F79\u61CD\u61E6\u61E3\u61F6\u61FA\u61F4\u61FF\u61FD\u61FC\u61FE\u6200\u6208\u6209\u620D\u620C\u6214\u621B"],
      ["d9a1", "\u621E\u6221\u622A\u622E\u6230\u6232\u6233\u6241\u624E\u625E\u6263\u625B\u6260\u6268\u627C\u6282\u6289\u627E\u6292\u6293\u6296\u62D4\u6283\u6294\u62D7\u62D1\u62BB\u62CF\u62FF\u62C6\u64D4\u62C8\u62DC\u62CC\u62CA\u62C2\u62C7\u629B\u62C9\u630C\u62EE\u62F1\u6327\u6302\u6308\u62EF\u62F5\u6350\u633E\u634D\u641C\u634F\u6396\u638E\u6380\u63AB\u6376\u63A3\u638F\u6389\u639F\u63B5\u636B\u6369\u63BE\u63E9\u63C0\u63C6\u63E3\u63C9\u63D2\u63F6\u63C4\u6416\u6434\u6406\u6413\u6426\u6436\u651D\u6417\u6428\u640F\u6467\u646F\u6476\u644E\u652A\u6495\u6493\u64A5\u64A9\u6488\u64BC"],
      ["daa1", "\u64DA\u64D2\u64C5\u64C7\u64BB\u64D8\u64C2\u64F1\u64E7\u8209\u64E0\u64E1\u62AC\u64E3\u64EF\u652C\u64F6\u64F4\u64F2\u64FA\u6500\u64FD\u6518\u651C\u6505\u6524\u6523\u652B\u6534\u6535\u6537\u6536\u6538\u754B\u6548\u6556\u6555\u654D\u6558\u655E\u655D\u6572\u6578\u6582\u6583\u8B8A\u659B\u659F\u65AB\u65B7\u65C3\u65C6\u65C1\u65C4\u65CC\u65D2\u65DB\u65D9\u65E0\u65E1\u65F1\u6772\u660A\u6603\u65FB\u6773\u6635\u6636\u6634\u661C\u664F\u6644\u6649\u6641\u665E\u665D\u6664\u6667\u6668\u665F\u6662\u6670\u6683\u6688\u668E\u6689\u6684\u6698\u669D\u66C1\u66B9\u66C9\u66BE\u66BC"],
      ["dba1", "\u66C4\u66B8\u66D6\u66DA\u66E0\u663F\u66E6\u66E9\u66F0\u66F5\u66F7\u670F\u6716\u671E\u6726\u6727\u9738\u672E\u673F\u6736\u6741\u6738\u6737\u6746\u675E\u6760\u6759\u6763\u6764\u6789\u6770\u67A9\u677C\u676A\u678C\u678B\u67A6\u67A1\u6785\u67B7\u67EF\u67B4\u67EC\u67B3\u67E9\u67B8\u67E4\u67DE\u67DD\u67E2\u67EE\u67B9\u67CE\u67C6\u67E7\u6A9C\u681E\u6846\u6829\u6840\u684D\u6832\u684E\u68B3\u682B\u6859\u6863\u6877\u687F\u689F\u688F\u68AD\u6894\u689D\u689B\u6883\u6AAE\u68B9\u6874\u68B5\u68A0\u68BA\u690F\u688D\u687E\u6901\u68CA\u6908\u68D8\u6922\u6926\u68E1\u690C\u68CD"],
      ["dca1", "\u68D4\u68E7\u68D5\u6936\u6912\u6904\u68D7\u68E3\u6925\u68F9\u68E0\u68EF\u6928\u692A\u691A\u6923\u6921\u68C6\u6979\u6977\u695C\u6978\u696B\u6954\u697E\u696E\u6939\u6974\u693D\u6959\u6930\u6961\u695E\u695D\u6981\u696A\u69B2\u69AE\u69D0\u69BF\u69C1\u69D3\u69BE\u69CE\u5BE8\u69CA\u69DD\u69BB\u69C3\u69A7\u6A2E\u6991\u69A0\u699C\u6995\u69B4\u69DE\u69E8\u6A02\u6A1B\u69FF\u6B0A\u69F9\u69F2\u69E7\u6A05\u69B1\u6A1E\u69ED\u6A14\u69EB\u6A0A\u6A12\u6AC1\u6A23\u6A13\u6A44\u6A0C\u6A72\u6A36\u6A78\u6A47\u6A62\u6A59\u6A66\u6A48\u6A38\u6A22\u6A90\u6A8D\u6AA0\u6A84\u6AA2\u6AA3"],
      ["dda1", "\u6A97\u8617\u6ABB\u6AC3\u6AC2\u6AB8\u6AB3\u6AAC\u6ADE\u6AD1\u6ADF\u6AAA\u6ADA\u6AEA\u6AFB\u6B05\u8616\u6AFA\u6B12\u6B16\u9B31\u6B1F\u6B38\u6B37\u76DC\u6B39\u98EE\u6B47\u6B43\u6B49\u6B50\u6B59\u6B54\u6B5B\u6B5F\u6B61\u6B78\u6B79\u6B7F\u6B80\u6B84\u6B83\u6B8D\u6B98\u6B95\u6B9E\u6BA4\u6BAA\u6BAB\u6BAF\u6BB2\u6BB1\u6BB3\u6BB7\u6BBC\u6BC6\u6BCB\u6BD3\u6BDF\u6BEC\u6BEB\u6BF3\u6BEF\u9EBE\u6C08\u6C13\u6C14\u6C1B\u6C24\u6C23\u6C5E\u6C55\u6C62\u6C6A\u6C82\u6C8D\u6C9A\u6C81\u6C9B\u6C7E\u6C68\u6C73\u6C92\u6C90\u6CC4\u6CF1\u6CD3\u6CBD\u6CD7\u6CC5\u6CDD\u6CAE\u6CB1\u6CBE"],
      ["dea1", "\u6CBA\u6CDB\u6CEF\u6CD9\u6CEA\u6D1F\u884D\u6D36\u6D2B\u6D3D\u6D38\u6D19\u6D35\u6D33\u6D12\u6D0C\u6D63\u6D93\u6D64\u6D5A\u6D79\u6D59\u6D8E\u6D95\u6FE4\u6D85\u6DF9\u6E15\u6E0A\u6DB5\u6DC7\u6DE6\u6DB8\u6DC6\u6DEC\u6DDE\u6DCC\u6DE8\u6DD2\u6DC5\u6DFA\u6DD9\u6DE4\u6DD5\u6DEA\u6DEE\u6E2D\u6E6E\u6E2E\u6E19\u6E72\u6E5F\u6E3E\u6E23\u6E6B\u6E2B\u6E76\u6E4D\u6E1F\u6E43\u6E3A\u6E4E\u6E24\u6EFF\u6E1D\u6E38\u6E82\u6EAA\u6E98\u6EC9\u6EB7\u6ED3\u6EBD\u6EAF\u6EC4\u6EB2\u6ED4\u6ED5\u6E8F\u6EA5\u6EC2\u6E9F\u6F41\u6F11\u704C\u6EEC\u6EF8\u6EFE\u6F3F\u6EF2\u6F31\u6EEF\u6F32\u6ECC"],
      ["dfa1", "\u6F3E\u6F13\u6EF7\u6F86\u6F7A\u6F78\u6F81\u6F80\u6F6F\u6F5B\u6FF3\u6F6D\u6F82\u6F7C\u6F58\u6F8E\u6F91\u6FC2\u6F66\u6FB3\u6FA3\u6FA1\u6FA4\u6FB9\u6FC6\u6FAA\u6FDF\u6FD5\u6FEC\u6FD4\u6FD8\u6FF1\u6FEE\u6FDB\u7009\u700B\u6FFA\u7011\u7001\u700F\u6FFE\u701B\u701A\u6F74\u701D\u7018\u701F\u7030\u703E\u7032\u7051\u7063\u7099\u7092\u70AF\u70F1\u70AC\u70B8\u70B3\u70AE\u70DF\u70CB\u70DD\u70D9\u7109\u70FD\u711C\u7119\u7165\u7155\u7188\u7166\u7162\u714C\u7156\u716C\u718F\u71FB\u7184\u7195\u71A8\u71AC\u71D7\u71B9\u71BE\u71D2\u71C9\u71D4\u71CE\u71E0\u71EC\u71E7\u71F5\u71FC"],
      ["e0a1", "\u71F9\u71FF\u720D\u7210\u721B\u7228\u722D\u722C\u7230\u7232\u723B\u723C\u723F\u7240\u7246\u724B\u7258\u7274\u727E\u7282\u7281\u7287\u7292\u7296\u72A2\u72A7\u72B9\u72B2\u72C3\u72C6\u72C4\u72CE\u72D2\u72E2\u72E0\u72E1\u72F9\u72F7\u500F\u7317\u730A\u731C\u7316\u731D\u7334\u732F\u7329\u7325\u733E\u734E\u734F\u9ED8\u7357\u736A\u7368\u7370\u7378\u7375\u737B\u737A\u73C8\u73B3\u73CE\u73BB\u73C0\u73E5\u73EE\u73DE\u74A2\u7405\u746F\u7425\u73F8\u7432\u743A\u7455\u743F\u745F\u7459\u7441\u745C\u7469\u7470\u7463\u746A\u7476\u747E\u748B\u749E\u74A7\u74CA\u74CF\u74D4\u73F1"],
      ["e1a1", "\u74E0\u74E3\u74E7\u74E9\u74EE\u74F2\u74F0\u74F1\u74F8\u74F7\u7504\u7503\u7505\u750C\u750E\u750D\u7515\u7513\u751E\u7526\u752C\u753C\u7544\u754D\u754A\u7549\u755B\u7546\u755A\u7569\u7564\u7567\u756B\u756D\u7578\u7576\u7586\u7587\u7574\u758A\u7589\u7582\u7594\u759A\u759D\u75A5\u75A3\u75C2\u75B3\u75C3\u75B5\u75BD\u75B8\u75BC\u75B1\u75CD\u75CA\u75D2\u75D9\u75E3\u75DE\u75FE\u75FF\u75FC\u7601\u75F0\u75FA\u75F2\u75F3\u760B\u760D\u7609\u761F\u7627\u7620\u7621\u7622\u7624\u7634\u7630\u763B\u7647\u7648\u7646\u765C\u7658\u7661\u7662\u7668\u7669\u766A\u7667\u766C\u7670"],
      ["e2a1", "\u7672\u7676\u7678\u767C\u7680\u7683\u7688\u768B\u768E\u7696\u7693\u7699\u769A\u76B0\u76B4\u76B8\u76B9\u76BA\u76C2\u76CD\u76D6\u76D2\u76DE\u76E1\u76E5\u76E7\u76EA\u862F\u76FB\u7708\u7707\u7704\u7729\u7724\u771E\u7725\u7726\u771B\u7737\u7738\u7747\u775A\u7768\u776B\u775B\u7765\u777F\u777E\u7779\u778E\u778B\u7791\u77A0\u779E\u77B0\u77B6\u77B9\u77BF\u77BC\u77BD\u77BB\u77C7\u77CD\u77D7\u77DA\u77DC\u77E3\u77EE\u77FC\u780C\u7812\u7926\u7820\u792A\u7845\u788E\u7874\u7886\u787C\u789A\u788C\u78A3\u78B5\u78AA\u78AF\u78D1\u78C6\u78CB\u78D4\u78BE\u78BC\u78C5\u78CA\u78EC"],
      ["e3a1", "\u78E7\u78DA\u78FD\u78F4\u7907\u7912\u7911\u7919\u792C\u792B\u7940\u7960\u7957\u795F\u795A\u7955\u7953\u797A\u797F\u798A\u799D\u79A7\u9F4B\u79AA\u79AE\u79B3\u79B9\u79BA\u79C9\u79D5\u79E7\u79EC\u79E1\u79E3\u7A08\u7A0D\u7A18\u7A19\u7A20\u7A1F\u7980\u7A31\u7A3B\u7A3E\u7A37\u7A43\u7A57\u7A49\u7A61\u7A62\u7A69\u9F9D\u7A70\u7A79\u7A7D\u7A88\u7A97\u7A95\u7A98\u7A96\u7AA9\u7AC8\u7AB0\u7AB6\u7AC5\u7AC4\u7ABF\u9083\u7AC7\u7ACA\u7ACD\u7ACF\u7AD5\u7AD3\u7AD9\u7ADA\u7ADD\u7AE1\u7AE2\u7AE6\u7AED\u7AF0\u7B02\u7B0F\u7B0A\u7B06\u7B33\u7B18\u7B19\u7B1E\u7B35\u7B28\u7B36\u7B50"],
      ["e4a1", "\u7B7A\u7B04\u7B4D\u7B0B\u7B4C\u7B45\u7B75\u7B65\u7B74\u7B67\u7B70\u7B71\u7B6C\u7B6E\u7B9D\u7B98\u7B9F\u7B8D\u7B9C\u7B9A\u7B8B\u7B92\u7B8F\u7B5D\u7B99\u7BCB\u7BC1\u7BCC\u7BCF\u7BB4\u7BC6\u7BDD\u7BE9\u7C11\u7C14\u7BE6\u7BE5\u7C60\u7C00\u7C07\u7C13\u7BF3\u7BF7\u7C17\u7C0D\u7BF6\u7C23\u7C27\u7C2A\u7C1F\u7C37\u7C2B\u7C3D\u7C4C\u7C43\u7C54\u7C4F\u7C40\u7C50\u7C58\u7C5F\u7C64\u7C56\u7C65\u7C6C\u7C75\u7C83\u7C90\u7CA4\u7CAD\u7CA2\u7CAB\u7CA1\u7CA8\u7CB3\u7CB2\u7CB1\u7CAE\u7CB9\u7CBD\u7CC0\u7CC5\u7CC2\u7CD8\u7CD2\u7CDC\u7CE2\u9B3B\u7CEF\u7CF2\u7CF4\u7CF6\u7CFA\u7D06"],
      ["e5a1", "\u7D02\u7D1C\u7D15\u7D0A\u7D45\u7D4B\u7D2E\u7D32\u7D3F\u7D35\u7D46\u7D73\u7D56\u7D4E\u7D72\u7D68\u7D6E\u7D4F\u7D63\u7D93\u7D89\u7D5B\u7D8F\u7D7D\u7D9B\u7DBA\u7DAE\u7DA3\u7DB5\u7DC7\u7DBD\u7DAB\u7E3D\u7DA2\u7DAF\u7DDC\u7DB8\u7D9F\u7DB0\u7DD8\u7DDD\u7DE4\u7DDE\u7DFB\u7DF2\u7DE1\u7E05\u7E0A\u7E23\u7E21\u7E12\u7E31\u7E1F\u7E09\u7E0B\u7E22\u7E46\u7E66\u7E3B\u7E35\u7E39\u7E43\u7E37\u7E32\u7E3A\u7E67\u7E5D\u7E56\u7E5E\u7E59\u7E5A\u7E79\u7E6A\u7E69\u7E7C\u7E7B\u7E83\u7DD5\u7E7D\u8FAE\u7E7F\u7E88\u7E89\u7E8C\u7E92\u7E90\u7E93\u7E94\u7E96\u7E8E\u7E9B\u7E9C\u7F38\u7F3A"],
      ["e6a1", "\u7F45\u7F4C\u7F4D\u7F4E\u7F50\u7F51\u7F55\u7F54\u7F58\u7F5F\u7F60\u7F68\u7F69\u7F67\u7F78\u7F82\u7F86\u7F83\u7F88\u7F87\u7F8C\u7F94\u7F9E\u7F9D\u7F9A\u7FA3\u7FAF\u7FB2\u7FB9\u7FAE\u7FB6\u7FB8\u8B71\u7FC5\u7FC6\u7FCA\u7FD5\u7FD4\u7FE1\u7FE6\u7FE9\u7FF3\u7FF9\u98DC\u8006\u8004\u800B\u8012\u8018\u8019\u801C\u8021\u8028\u803F\u803B\u804A\u8046\u8052\u8058\u805A\u805F\u8062\u8068\u8073\u8072\u8070\u8076\u8079\u807D\u807F\u8084\u8086\u8085\u809B\u8093\u809A\u80AD\u5190\u80AC\u80DB\u80E5\u80D9\u80DD\u80C4\u80DA\u80D6\u8109\u80EF\u80F1\u811B\u8129\u8123\u812F\u814B"],
      ["e7a1", "\u968B\u8146\u813E\u8153\u8151\u80FC\u8171\u816E\u8165\u8166\u8174\u8183\u8188\u818A\u8180\u8182\u81A0\u8195\u81A4\u81A3\u815F\u8193\u81A9\u81B0\u81B5\u81BE\u81B8\u81BD\u81C0\u81C2\u81BA\u81C9\u81CD\u81D1\u81D9\u81D8\u81C8\u81DA\u81DF\u81E0\u81E7\u81FA\u81FB\u81FE\u8201\u8202\u8205\u8207\u820A\u820D\u8210\u8216\u8229\u822B\u8238\u8233\u8240\u8259\u8258\u825D\u825A\u825F\u8264\u8262\u8268\u826A\u826B\u822E\u8271\u8277\u8278\u827E\u828D\u8292\u82AB\u829F\u82BB\u82AC\u82E1\u82E3\u82DF\u82D2\u82F4\u82F3\u82FA\u8393\u8303\u82FB\u82F9\u82DE\u8306\u82DC\u8309\u82D9"],
      ["e8a1", "\u8335\u8334\u8316\u8332\u8331\u8340\u8339\u8350\u8345\u832F\u832B\u8317\u8318\u8385\u839A\u83AA\u839F\u83A2\u8396\u8323\u838E\u8387\u838A\u837C\u83B5\u8373\u8375\u83A0\u8389\u83A8\u83F4\u8413\u83EB\u83CE\u83FD\u8403\u83D8\u840B\u83C1\u83F7\u8407\u83E0\u83F2\u840D\u8422\u8420\u83BD\u8438\u8506\u83FB\u846D\u842A\u843C\u855A\u8484\u8477\u846B\u84AD\u846E\u8482\u8469\u8446\u842C\u846F\u8479\u8435\u84CA\u8462\u84B9\u84BF\u849F\u84D9\u84CD\u84BB\u84DA\u84D0\u84C1\u84C6\u84D6\u84A1\u8521\u84FF\u84F4\u8517\u8518\u852C\u851F\u8515\u8514\u84FC\u8540\u8563\u8558\u8548"],
      ["e9a1", "\u8541\u8602\u854B\u8555\u8580\u85A4\u8588\u8591\u858A\u85A8\u856D\u8594\u859B\u85EA\u8587\u859C\u8577\u857E\u8590\u85C9\u85BA\u85CF\u85B9\u85D0\u85D5\u85DD\u85E5\u85DC\u85F9\u860A\u8613\u860B\u85FE\u85FA\u8606\u8622\u861A\u8630\u863F\u864D\u4E55\u8654\u865F\u8667\u8671\u8693\u86A3\u86A9\u86AA\u868B\u868C\u86B6\u86AF\u86C4\u86C6\u86B0\u86C9\u8823\u86AB\u86D4\u86DE\u86E9\u86EC\u86DF\u86DB\u86EF\u8712\u8706\u8708\u8700\u8703\u86FB\u8711\u8709\u870D\u86F9\u870A\u8734\u873F\u8737\u873B\u8725\u8729\u871A\u8760\u875F\u8778\u874C\u874E\u8774\u8757\u8768\u876E\u8759"],
      ["eaa1", "\u8753\u8763\u876A\u8805\u87A2\u879F\u8782\u87AF\u87CB\u87BD\u87C0\u87D0\u96D6\u87AB\u87C4\u87B3\u87C7\u87C6\u87BB\u87EF\u87F2\u87E0\u880F\u880D\u87FE\u87F6\u87F7\u880E\u87D2\u8811\u8816\u8815\u8822\u8821\u8831\u8836\u8839\u8827\u883B\u8844\u8842\u8852\u8859\u885E\u8862\u886B\u8881\u887E\u889E\u8875\u887D\u88B5\u8872\u8882\u8897\u8892\u88AE\u8899\u88A2\u888D\u88A4\u88B0\u88BF\u88B1\u88C3\u88C4\u88D4\u88D8\u88D9\u88DD\u88F9\u8902\u88FC\u88F4\u88E8\u88F2\u8904\u890C\u890A\u8913\u8943\u891E\u8925\u892A\u892B\u8941\u8944\u893B\u8936\u8938\u894C\u891D\u8960\u895E"],
      ["eba1", "\u8966\u8964\u896D\u896A\u896F\u8974\u8977\u897E\u8983\u8988\u898A\u8993\u8998\u89A1\u89A9\u89A6\u89AC\u89AF\u89B2\u89BA\u89BD\u89BF\u89C0\u89DA\u89DC\u89DD\u89E7\u89F4\u89F8\u8A03\u8A16\u8A10\u8A0C\u8A1B\u8A1D\u8A25\u8A36\u8A41\u8A5B\u8A52\u8A46\u8A48\u8A7C\u8A6D\u8A6C\u8A62\u8A85\u8A82\u8A84\u8AA8\u8AA1\u8A91\u8AA5\u8AA6\u8A9A\u8AA3\u8AC4\u8ACD\u8AC2\u8ADA\u8AEB\u8AF3\u8AE7\u8AE4\u8AF1\u8B14\u8AE0\u8AE2\u8AF7\u8ADE\u8ADB\u8B0C\u8B07\u8B1A\u8AE1\u8B16\u8B10\u8B17\u8B20\u8B33\u97AB\u8B26\u8B2B\u8B3E\u8B28\u8B41\u8B4C\u8B4F\u8B4E\u8B49\u8B56\u8B5B\u8B5A\u8B6B"],
      ["eca1", "\u8B5F\u8B6C\u8B6F\u8B74\u8B7D\u8B80\u8B8C\u8B8E\u8B92\u8B93\u8B96\u8B99\u8B9A\u8C3A\u8C41\u8C3F\u8C48\u8C4C\u8C4E\u8C50\u8C55\u8C62\u8C6C\u8C78\u8C7A\u8C82\u8C89\u8C85\u8C8A\u8C8D\u8C8E\u8C94\u8C7C\u8C98\u621D\u8CAD\u8CAA\u8CBD\u8CB2\u8CB3\u8CAE\u8CB6\u8CC8\u8CC1\u8CE4\u8CE3\u8CDA\u8CFD\u8CFA\u8CFB\u8D04\u8D05\u8D0A\u8D07\u8D0F\u8D0D\u8D10\u9F4E\u8D13\u8CCD\u8D14\u8D16\u8D67\u8D6D\u8D71\u8D73\u8D81\u8D99\u8DC2\u8DBE\u8DBA\u8DCF\u8DDA\u8DD6\u8DCC\u8DDB\u8DCB\u8DEA\u8DEB\u8DDF\u8DE3\u8DFC\u8E08\u8E09\u8DFF\u8E1D\u8E1E\u8E10\u8E1F\u8E42\u8E35\u8E30\u8E34\u8E4A"],
      ["eda1", "\u8E47\u8E49\u8E4C\u8E50\u8E48\u8E59\u8E64\u8E60\u8E2A\u8E63\u8E55\u8E76\u8E72\u8E7C\u8E81\u8E87\u8E85\u8E84\u8E8B\u8E8A\u8E93\u8E91\u8E94\u8E99\u8EAA\u8EA1\u8EAC\u8EB0\u8EC6\u8EB1\u8EBE\u8EC5\u8EC8\u8ECB\u8EDB\u8EE3\u8EFC\u8EFB\u8EEB\u8EFE\u8F0A\u8F05\u8F15\u8F12\u8F19\u8F13\u8F1C\u8F1F\u8F1B\u8F0C\u8F26\u8F33\u8F3B\u8F39\u8F45\u8F42\u8F3E\u8F4C\u8F49\u8F46\u8F4E\u8F57\u8F5C\u8F62\u8F63\u8F64\u8F9C\u8F9F\u8FA3\u8FAD\u8FAF\u8FB7\u8FDA\u8FE5\u8FE2\u8FEA\u8FEF\u9087\u8FF4\u9005\u8FF9\u8FFA\u9011\u9015\u9021\u900D\u901E\u9016\u900B\u9027\u9036\u9035\u9039\u8FF8"],
      ["eea1", "\u904F\u9050\u9051\u9052\u900E\u9049\u903E\u9056\u9058\u905E\u9068\u906F\u9076\u96A8\u9072\u9082\u907D\u9081\u9080\u908A\u9089\u908F\u90A8\u90AF\u90B1\u90B5\u90E2\u90E4\u6248\u90DB\u9102\u9112\u9119\u9132\u9130\u914A\u9156\u9158\u9163\u9165\u9169\u9173\u9172\u918B\u9189\u9182\u91A2\u91AB\u91AF\u91AA\u91B5\u91B4\u91BA\u91C0\u91C1\u91C9\u91CB\u91D0\u91D6\u91DF\u91E1\u91DB\u91FC\u91F5\u91F6\u921E\u91FF\u9214\u922C\u9215\u9211\u925E\u9257\u9245\u9249\u9264\u9248\u9295\u923F\u924B\u9250\u929C\u9296\u9293\u929B\u925A\u92CF\u92B9\u92B7\u92E9\u930F\u92FA\u9344\u932E"],
      ["efa1", "\u9319\u9322\u931A\u9323\u933A\u9335\u933B\u935C\u9360\u937C\u936E\u9356\u93B0\u93AC\u93AD\u9394\u93B9\u93D6\u93D7\u93E8\u93E5\u93D8\u93C3\u93DD\u93D0\u93C8\u93E4\u941A\u9414\u9413\u9403\u9407\u9410\u9436\u942B\u9435\u9421\u943A\u9441\u9452\u9444\u945B\u9460\u9462\u945E\u946A\u9229\u9470\u9475\u9477\u947D\u945A\u947C\u947E\u9481\u947F\u9582\u9587\u958A\u9594\u9596\u9598\u9599\u95A0\u95A8\u95A7\u95AD\u95BC\u95BB\u95B9\u95BE\u95CA\u6FF6\u95C3\u95CD\u95CC\u95D5\u95D4\u95D6\u95DC\u95E1\u95E5\u95E2\u9621\u9628\u962E\u962F\u9642\u964C\u964F\u964B\u9677\u965C\u965E"],
      ["f0a1", "\u965D\u965F\u9666\u9672\u966C\u968D\u9698\u9695\u9697\u96AA\u96A7\u96B1\u96B2\u96B0\u96B4\u96B6\u96B8\u96B9\u96CE\u96CB\u96C9\u96CD\u894D\u96DC\u970D\u96D5\u96F9\u9704\u9706\u9708\u9713\u970E\u9711\u970F\u9716\u9719\u9724\u972A\u9730\u9739\u973D\u973E\u9744\u9746\u9748\u9742\u9749\u975C\u9760\u9764\u9766\u9768\u52D2\u976B\u9771\u9779\u9785\u977C\u9781\u977A\u9786\u978B\u978F\u9790\u979C\u97A8\u97A6\u97A3\u97B3\u97B4\u97C3\u97C6\u97C8\u97CB\u97DC\u97ED\u9F4F\u97F2\u7ADF\u97F6\u97F5\u980F\u980C\u9838\u9824\u9821\u9837\u983D\u9846\u984F\u984B\u986B\u986F\u9870"],
      ["f1a1", "\u9871\u9874\u9873\u98AA\u98AF\u98B1\u98B6\u98C4\u98C3\u98C6\u98E9\u98EB\u9903\u9909\u9912\u9914\u9918\u9921\u991D\u991E\u9924\u9920\u992C\u992E\u993D\u993E\u9942\u9949\u9945\u9950\u994B\u9951\u9952\u994C\u9955\u9997\u9998\u99A5\u99AD\u99AE\u99BC\u99DF\u99DB\u99DD\u99D8\u99D1\u99ED\u99EE\u99F1\u99F2\u99FB\u99F8\u9A01\u9A0F\u9A05\u99E2\u9A19\u9A2B\u9A37\u9A45\u9A42\u9A40\u9A43\u9A3E\u9A55\u9A4D\u9A5B\u9A57\u9A5F\u9A62\u9A65\u9A64\u9A69\u9A6B\u9A6A\u9AAD\u9AB0\u9ABC\u9AC0\u9ACF\u9AD1\u9AD3\u9AD4\u9ADE\u9ADF\u9AE2\u9AE3\u9AE6\u9AEF\u9AEB\u9AEE\u9AF4\u9AF1\u9AF7"],
      ["f2a1", "\u9AFB\u9B06\u9B18\u9B1A\u9B1F\u9B22\u9B23\u9B25\u9B27\u9B28\u9B29\u9B2A\u9B2E\u9B2F\u9B32\u9B44\u9B43\u9B4F\u9B4D\u9B4E\u9B51\u9B58\u9B74\u9B93\u9B83\u9B91\u9B96\u9B97\u9B9F\u9BA0\u9BA8\u9BB4\u9BC0\u9BCA\u9BB9\u9BC6\u9BCF\u9BD1\u9BD2\u9BE3\u9BE2\u9BE4\u9BD4\u9BE1\u9C3A\u9BF2\u9BF1\u9BF0\u9C15\u9C14\u9C09\u9C13\u9C0C\u9C06\u9C08\u9C12\u9C0A\u9C04\u9C2E\u9C1B\u9C25\u9C24\u9C21\u9C30\u9C47\u9C32\u9C46\u9C3E\u9C5A\u9C60\u9C67\u9C76\u9C78\u9CE7\u9CEC\u9CF0\u9D09\u9D08\u9CEB\u9D03\u9D06\u9D2A\u9D26\u9DAF\u9D23\u9D1F\u9D44\u9D15\u9D12\u9D41\u9D3F\u9D3E\u9D46\u9D48"],
      ["f3a1", "\u9D5D\u9D5E\u9D64\u9D51\u9D50\u9D59\u9D72\u9D89\u9D87\u9DAB\u9D6F\u9D7A\u9D9A\u9DA4\u9DA9\u9DB2\u9DC4\u9DC1\u9DBB\u9DB8\u9DBA\u9DC6\u9DCF\u9DC2\u9DD9\u9DD3\u9DF8\u9DE6\u9DED\u9DEF\u9DFD\u9E1A\u9E1B\u9E1E\u9E75\u9E79\u9E7D\u9E81\u9E88\u9E8B\u9E8C\u9E92\u9E95\u9E91\u9E9D\u9EA5\u9EA9\u9EB8\u9EAA\u9EAD\u9761\u9ECC\u9ECE\u9ECF\u9ED0\u9ED4\u9EDC\u9EDE\u9EDD\u9EE0\u9EE5\u9EE8\u9EEF\u9EF4\u9EF6\u9EF7\u9EF9\u9EFB\u9EFC\u9EFD\u9F07\u9F08\u76B7\u9F15\u9F21\u9F2C\u9F3E\u9F4A\u9F52\u9F54\u9F63\u9F5F\u9F60\u9F61\u9F66\u9F67\u9F6C\u9F6A\u9F77\u9F72\u9F76\u9F95\u9F9C\u9FA0"],
      ["f4a1", "\u582F\u69C7\u9059\u7464\u51DC\u7199"],
      ["f9a1", "\u7E8A\u891C\u9348\u9288\u84DC\u4FC9\u70BB\u6631\u68C8\u92F9\u66FB\u5F45\u4E28\u4EE1\u4EFC\u4F00\u4F03\u4F39\u4F56\u4F92\u4F8A\u4F9A\u4F94\u4FCD\u5040\u5022\u4FFF\u501E\u5046\u5070\u5042\u5094\u50F4\u50D8\u514A\u5164\u519D\u51BE\u51EC\u5215\u529C\u52A6\u52C0\u52DB\u5300\u5307\u5324\u5372\u5393\u53B2\u53DD\uFA0E\u549C\u548A\u54A9\u54FF\u5586\u5759\u5765\u57AC\u57C8\u57C7\uFA0F\uFA10\u589E\u58B2\u590B\u5953\u595B\u595D\u5963\u59A4\u59BA\u5B56\u5BC0\u752F\u5BD8\u5BEC\u5C1E\u5CA6\u5CBA\u5CF5\u5D27\u5D53\uFA11\u5D42\u5D6D\u5DB8\u5DB9\u5DD0\u5F21\u5F34\u5F67\u5FB7"],
      ["faa1", "\u5FDE\u605D\u6085\u608A\u60DE\u60D5\u6120\u60F2\u6111\u6137\u6130\u6198\u6213\u62A6\u63F5\u6460\u649D\u64CE\u654E\u6600\u6615\u663B\u6609\u662E\u661E\u6624\u6665\u6657\u6659\uFA12\u6673\u6699\u66A0\u66B2\u66BF\u66FA\u670E\uF929\u6766\u67BB\u6852\u67C0\u6801\u6844\u68CF\uFA13\u6968\uFA14\u6998\u69E2\u6A30\u6A6B\u6A46\u6A73\u6A7E\u6AE2\u6AE4\u6BD6\u6C3F\u6C5C\u6C86\u6C6F\u6CDA\u6D04\u6D87\u6D6F\u6D96\u6DAC\u6DCF\u6DF8\u6DF2\u6DFC\u6E39\u6E5C\u6E27\u6E3C\u6EBF\u6F88\u6FB5\u6FF5\u7005\u7007\u7028\u7085\u70AB\u710F\u7104\u715C\u7146\u7147\uFA15\u71C1\u71FE\u72B1"],
      ["fba1", "\u72BE\u7324\uFA16\u7377\u73BD\u73C9\u73D6\u73E3\u73D2\u7407\u73F5\u7426\u742A\u7429\u742E\u7462\u7489\u749F\u7501\u756F\u7682\u769C\u769E\u769B\u76A6\uFA17\u7746\u52AF\u7821\u784E\u7864\u787A\u7930\uFA18\uFA19\uFA1A\u7994\uFA1B\u799B\u7AD1\u7AE7\uFA1C\u7AEB\u7B9E\uFA1D\u7D48\u7D5C\u7DB7\u7DA0\u7DD6\u7E52\u7F47\u7FA1\uFA1E\u8301\u8362\u837F\u83C7\u83F6\u8448\u84B4\u8553\u8559\u856B\uFA1F\u85B0\uFA20\uFA21\u8807\u88F5\u8A12\u8A37\u8A79\u8AA7\u8ABE\u8ADF\uFA22\u8AF6\u8B53\u8B7F\u8CF0\u8CF4\u8D12\u8D76\uFA23\u8ECF\uFA24\uFA25\u9067\u90DE\uFA26\u9115\u9127\u91DA"],
      ["fca1", "\u91D7\u91DE\u91ED\u91EE\u91E4\u91E5\u9206\u9210\u920A\u923A\u9240\u923C\u924E\u9259\u9251\u9239\u9267\u92A7\u9277\u9278\u92E7\u92D7\u92D9\u92D0\uFA27\u92D5\u92E0\u92D3\u9325\u9321\u92FB\uFA28\u931E\u92FF\u931D\u9302\u9370\u9357\u93A4\u93C6\u93DE\u93F8\u9431\u9445\u9448\u9592\uF9DC\uFA29\u969D\u96AF\u9733\u973B\u9743\u974D\u974F\u9751\u9755\u9857\u9865\uFA2A\uFA2B\u9927\uFA2C\u999E\u9A4E\u9AD9\u9ADC\u9B75\u9B72\u9B8F\u9BB1\u9BBB\u9C00\u9D70\u9D6B\uFA2D\u9E19\u9ED1"],
      ["fcf1", "\u2170", 9, "\uFFE2\uFFE4\uFF07\uFF02"],
      ["8fa2af", "\u02D8\u02C7\xB8\u02D9\u02DD\xAF\u02DB\u02DA\uFF5E\u0384\u0385"],
      ["8fa2c2", "\xA1\xA6\xBF"],
      ["8fa2eb", "\xBA\xAA\xA9\xAE\u2122\xA4\u2116"],
      ["8fa6e1", "\u0386\u0388\u0389\u038A\u03AA"],
      ["8fa6e7", "\u038C"],
      ["8fa6e9", "\u038E\u03AB"],
      ["8fa6ec", "\u038F"],
      ["8fa6f1", "\u03AC\u03AD\u03AE\u03AF\u03CA\u0390\u03CC\u03C2\u03CD\u03CB\u03B0\u03CE"],
      ["8fa7c2", "\u0402", 10, "\u040E\u040F"],
      ["8fa7f2", "\u0452", 10, "\u045E\u045F"],
      ["8fa9a1", "\xC6\u0110"],
      ["8fa9a4", "\u0126"],
      ["8fa9a6", "\u0132"],
      ["8fa9a8", "\u0141\u013F"],
      ["8fa9ab", "\u014A\xD8\u0152"],
      ["8fa9af", "\u0166\xDE"],
      ["8fa9c1", "\xE6\u0111\xF0\u0127\u0131\u0133\u0138\u0142\u0140\u0149\u014B\xF8\u0153\xDF\u0167\xFE"],
      ["8faaa1", "\xC1\xC0\xC4\xC2\u0102\u01CD\u0100\u0104\xC5\xC3\u0106\u0108\u010C\xC7\u010A\u010E\xC9\xC8\xCB\xCA\u011A\u0116\u0112\u0118"],
      ["8faaba", "\u011C\u011E\u0122\u0120\u0124\xCD\xCC\xCF\xCE\u01CF\u0130\u012A\u012E\u0128\u0134\u0136\u0139\u013D\u013B\u0143\u0147\u0145\xD1\xD3\xD2\xD6\xD4\u01D1\u0150\u014C\xD5\u0154\u0158\u0156\u015A\u015C\u0160\u015E\u0164\u0162\xDA\xD9\xDC\xDB\u016C\u01D3\u0170\u016A\u0172\u016E\u0168\u01D7\u01DB\u01D9\u01D5\u0174\xDD\u0178\u0176\u0179\u017D\u017B"],
      ["8faba1", "\xE1\xE0\xE4\xE2\u0103\u01CE\u0101\u0105\xE5\xE3\u0107\u0109\u010D\xE7\u010B\u010F\xE9\xE8\xEB\xEA\u011B\u0117\u0113\u0119\u01F5\u011D\u011F"],
      ["8fabbd", "\u0121\u0125\xED\xEC\xEF\xEE\u01D0"],
      ["8fabc5", "\u012B\u012F\u0129\u0135\u0137\u013A\u013E\u013C\u0144\u0148\u0146\xF1\xF3\xF2\xF6\xF4\u01D2\u0151\u014D\xF5\u0155\u0159\u0157\u015B\u015D\u0161\u015F\u0165\u0163\xFA\xF9\xFC\xFB\u016D\u01D4\u0171\u016B\u0173\u016F\u0169\u01D8\u01DC\u01DA\u01D6\u0175\xFD\xFF\u0177\u017A\u017E\u017C"],
      ["8fb0a1", "\u4E02\u4E04\u4E05\u4E0C\u4E12\u4E1F\u4E23\u4E24\u4E28\u4E2B\u4E2E\u4E2F\u4E30\u4E35\u4E40\u4E41\u4E44\u4E47\u4E51\u4E5A\u4E5C\u4E63\u4E68\u4E69\u4E74\u4E75\u4E79\u4E7F\u4E8D\u4E96\u4E97\u4E9D\u4EAF\u4EB9\u4EC3\u4ED0\u4EDA\u4EDB\u4EE0\u4EE1\u4EE2\u4EE8\u4EEF\u4EF1\u4EF3\u4EF5\u4EFD\u4EFE\u4EFF\u4F00\u4F02\u4F03\u4F08\u4F0B\u4F0C\u4F12\u4F15\u4F16\u4F17\u4F19\u4F2E\u4F31\u4F60\u4F33\u4F35\u4F37\u4F39\u4F3B\u4F3E\u4F40\u4F42\u4F48\u4F49\u4F4B\u4F4C\u4F52\u4F54\u4F56\u4F58\u4F5F\u4F63\u4F6A\u4F6C\u4F6E\u4F71\u4F77\u4F78\u4F79\u4F7A\u4F7D\u4F7E\u4F81\u4F82\u4F84"],
      ["8fb1a1", "\u4F85\u4F89\u4F8A\u4F8C\u4F8E\u4F90\u4F92\u4F93\u4F94\u4F97\u4F99\u4F9A\u4F9E\u4F9F\u4FB2\u4FB7\u4FB9\u4FBB\u4FBC\u4FBD\u4FBE\u4FC0\u4FC1\u4FC5\u4FC6\u4FC8\u4FC9\u4FCB\u4FCC\u4FCD\u4FCF\u4FD2\u4FDC\u4FE0\u4FE2\u4FF0\u4FF2\u4FFC\u4FFD\u4FFF\u5000\u5001\u5004\u5007\u500A\u500C\u500E\u5010\u5013\u5017\u5018\u501B\u501C\u501D\u501E\u5022\u5027\u502E\u5030\u5032\u5033\u5035\u5040\u5041\u5042\u5045\u5046\u504A\u504C\u504E\u5051\u5052\u5053\u5057\u5059\u505F\u5060\u5062\u5063\u5066\u5067\u506A\u506D\u5070\u5071\u503B\u5081\u5083\u5084\u5086\u508A\u508E\u508F\u5090"],
      ["8fb2a1", "\u5092\u5093\u5094\u5096\u509B\u509C\u509E", 4, "\u50AA\u50AF\u50B0\u50B9\u50BA\u50BD\u50C0\u50C3\u50C4\u50C7\u50CC\u50CE\u50D0\u50D3\u50D4\u50D8\u50DC\u50DD\u50DF\u50E2\u50E4\u50E6\u50E8\u50E9\u50EF\u50F1\u50F6\u50FA\u50FE\u5103\u5106\u5107\u5108\u510B\u510C\u510D\u510E\u50F2\u5110\u5117\u5119\u511B\u511C\u511D\u511E\u5123\u5127\u5128\u512C\u512D\u512F\u5131\u5133\u5134\u5135\u5138\u5139\u5142\u514A\u514F\u5153\u5155\u5157\u5158\u515F\u5164\u5166\u517E\u5183\u5184\u518B\u518E\u5198\u519D\u51A1\u51A3\u51AD\u51B8\u51BA\u51BC\u51BE\u51BF\u51C2"],
      ["8fb3a1", "\u51C8\u51CF\u51D1\u51D2\u51D3\u51D5\u51D8\u51DE\u51E2\u51E5\u51EE\u51F2\u51F3\u51F4\u51F7\u5201\u5202\u5205\u5212\u5213\u5215\u5216\u5218\u5222\u5228\u5231\u5232\u5235\u523C\u5245\u5249\u5255\u5257\u5258\u525A\u525C\u525F\u5260\u5261\u5266\u526E\u5277\u5278\u5279\u5280\u5282\u5285\u528A\u528C\u5293\u5295\u5296\u5297\u5298\u529A\u529C\u52A4\u52A5\u52A6\u52A7\u52AF\u52B0\u52B6\u52B7\u52B8\u52BA\u52BB\u52BD\u52C0\u52C4\u52C6\u52C8\u52CC\u52CF\u52D1\u52D4\u52D6\u52DB\u52DC\u52E1\u52E5\u52E8\u52E9\u52EA\u52EC\u52F0\u52F1\u52F4\u52F6\u52F7\u5300\u5303\u530A\u530B"],
      ["8fb4a1", "\u530C\u5311\u5313\u5318\u531B\u531C\u531E\u531F\u5325\u5327\u5328\u5329\u532B\u532C\u532D\u5330\u5332\u5335\u533C\u533D\u533E\u5342\u534C\u534B\u5359\u535B\u5361\u5363\u5365\u536C\u536D\u5372\u5379\u537E\u5383\u5387\u5388\u538E\u5393\u5394\u5399\u539D\u53A1\u53A4\u53AA\u53AB\u53AF\u53B2\u53B4\u53B5\u53B7\u53B8\u53BA\u53BD\u53C0\u53C5\u53CF\u53D2\u53D3\u53D5\u53DA\u53DD\u53DE\u53E0\u53E6\u53E7\u53F5\u5402\u5413\u541A\u5421\u5427\u5428\u542A\u542F\u5431\u5434\u5435\u5443\u5444\u5447\u544D\u544F\u545E\u5462\u5464\u5466\u5467\u5469\u546B\u546D\u546E\u5474\u547F"],
      ["8fb5a1", "\u5481\u5483\u5485\u5488\u5489\u548D\u5491\u5495\u5496\u549C\u549F\u54A1\u54A6\u54A7\u54A9\u54AA\u54AD\u54AE\u54B1\u54B7\u54B9\u54BA\u54BB\u54BF\u54C6\u54CA\u54CD\u54CE\u54E0\u54EA\u54EC\u54EF\u54F6\u54FC\u54FE\u54FF\u5500\u5501\u5505\u5508\u5509\u550C\u550D\u550E\u5515\u552A\u552B\u5532\u5535\u5536\u553B\u553C\u553D\u5541\u5547\u5549\u554A\u554D\u5550\u5551\u5558\u555A\u555B\u555E\u5560\u5561\u5564\u5566\u557F\u5581\u5582\u5586\u5588\u558E\u558F\u5591\u5592\u5593\u5594\u5597\u55A3\u55A4\u55AD\u55B2\u55BF\u55C1\u55C3\u55C6\u55C9\u55CB\u55CC\u55CE\u55D1\u55D2"],
      ["8fb6a1", "\u55D3\u55D7\u55D8\u55DB\u55DE\u55E2\u55E9\u55F6\u55FF\u5605\u5608\u560A\u560D", 5, "\u5619\u562C\u5630\u5633\u5635\u5637\u5639\u563B\u563C\u563D\u563F\u5640\u5641\u5643\u5644\u5646\u5649\u564B\u564D\u564F\u5654\u565E\u5660\u5661\u5662\u5663\u5666\u5669\u566D\u566F\u5671\u5672\u5675\u5684\u5685\u5688\u568B\u568C\u5695\u5699\u569A\u569D\u569E\u569F\u56A6\u56A7\u56A8\u56A9\u56AB\u56AC\u56AD\u56B1\u56B3\u56B7\u56BE\u56C5\u56C9\u56CA\u56CB\u56CF\u56D0\u56CC\u56CD\u56D9\u56DC\u56DD\u56DF\u56E1\u56E4", 4, "\u56F1\u56EB\u56ED"],
      ["8fb7a1", "\u56F6\u56F7\u5701\u5702\u5707\u570A\u570C\u5711\u5715\u571A\u571B\u571D\u5720\u5722\u5723\u5724\u5725\u5729\u572A\u572C\u572E\u572F\u5733\u5734\u573D\u573E\u573F\u5745\u5746\u574C\u574D\u5752\u5762\u5765\u5767\u5768\u576B\u576D", 4, "\u5773\u5774\u5775\u5777\u5779\u577A\u577B\u577C\u577E\u5781\u5783\u578C\u5794\u5797\u5799\u579A\u579C\u579D\u579E\u579F\u57A1\u5795\u57A7\u57A8\u57A9\u57AC\u57B8\u57BD\u57C7\u57C8\u57CC\u57CF\u57D5\u57DD\u57DE\u57E4\u57E6\u57E7\u57E9\u57ED\u57F0\u57F5\u57F6\u57F8\u57FD\u57FE\u57FF\u5803\u5804\u5808\u5809\u57E1"],
      ["8fb8a1", "\u580C\u580D\u581B\u581E\u581F\u5820\u5826\u5827\u582D\u5832\u5839\u583F\u5849\u584C\u584D\u584F\u5850\u5855\u585F\u5861\u5864\u5867\u5868\u5878\u587C\u587F\u5880\u5881\u5887\u5888\u5889\u588A\u588C\u588D\u588F\u5890\u5894\u5896\u589D\u58A0\u58A1\u58A2\u58A6\u58A9\u58B1\u58B2\u58C4\u58BC\u58C2\u58C8\u58CD\u58CE\u58D0\u58D2\u58D4\u58D6\u58DA\u58DD\u58E1\u58E2\u58E9\u58F3\u5905\u5906\u590B\u590C\u5912\u5913\u5914\u8641\u591D\u5921\u5923\u5924\u5928\u592F\u5930\u5933\u5935\u5936\u593F\u5943\u5946\u5952\u5953\u5959\u595B\u595D\u595E\u595F\u5961\u5963\u596B\u596D"],
      ["8fb9a1", "\u596F\u5972\u5975\u5976\u5979\u597B\u597C\u598B\u598C\u598E\u5992\u5995\u5997\u599F\u59A4\u59A7\u59AD\u59AE\u59AF\u59B0\u59B3\u59B7\u59BA\u59BC\u59C1\u59C3\u59C4\u59C8\u59CA\u59CD\u59D2\u59DD\u59DE\u59DF\u59E3\u59E4\u59E7\u59EE\u59EF\u59F1\u59F2\u59F4\u59F7\u5A00\u5A04\u5A0C\u5A0D\u5A0E\u5A12\u5A13\u5A1E\u5A23\u5A24\u5A27\u5A28\u5A2A\u5A2D\u5A30\u5A44\u5A45\u5A47\u5A48\u5A4C\u5A50\u5A55\u5A5E\u5A63\u5A65\u5A67\u5A6D\u5A77\u5A7A\u5A7B\u5A7E\u5A8B\u5A90\u5A93\u5A96\u5A99\u5A9C\u5A9E\u5A9F\u5AA0\u5AA2\u5AA7\u5AAC\u5AB1\u5AB2\u5AB3\u5AB5\u5AB8\u5ABA\u5ABB\u5ABF"],
      ["8fbaa1", "\u5AC4\u5AC6\u5AC8\u5ACF\u5ADA\u5ADC\u5AE0\u5AE5\u5AEA\u5AEE\u5AF5\u5AF6\u5AFD\u5B00\u5B01\u5B08\u5B17\u5B34\u5B19\u5B1B\u5B1D\u5B21\u5B25\u5B2D\u5B38\u5B41\u5B4B\u5B4C\u5B52\u5B56\u5B5E\u5B68\u5B6E\u5B6F\u5B7C\u5B7D\u5B7E\u5B7F\u5B81\u5B84\u5B86\u5B8A\u5B8E\u5B90\u5B91\u5B93\u5B94\u5B96\u5BA8\u5BA9\u5BAC\u5BAD\u5BAF\u5BB1\u5BB2\u5BB7\u5BBA\u5BBC\u5BC0\u5BC1\u5BCD\u5BCF\u5BD6", 4, "\u5BE0\u5BEF\u5BF1\u5BF4\u5BFD\u5C0C\u5C17\u5C1E\u5C1F\u5C23\u5C26\u5C29\u5C2B\u5C2C\u5C2E\u5C30\u5C32\u5C35\u5C36\u5C59\u5C5A\u5C5C\u5C62\u5C63\u5C67\u5C68\u5C69"],
      ["8fbba1", "\u5C6D\u5C70\u5C74\u5C75\u5C7A\u5C7B\u5C7C\u5C7D\u5C87\u5C88\u5C8A\u5C8F\u5C92\u5C9D\u5C9F\u5CA0\u5CA2\u5CA3\u5CA6\u5CAA\u5CB2\u5CB4\u5CB5\u5CBA\u5CC9\u5CCB\u5CD2\u5CDD\u5CD7\u5CEE\u5CF1\u5CF2\u5CF4\u5D01\u5D06\u5D0D\u5D12\u5D2B\u5D23\u5D24\u5D26\u5D27\u5D31\u5D34\u5D39\u5D3D\u5D3F\u5D42\u5D43\u5D46\u5D48\u5D55\u5D51\u5D59\u5D4A\u5D5F\u5D60\u5D61\u5D62\u5D64\u5D6A\u5D6D\u5D70\u5D79\u5D7A\u5D7E\u5D7F\u5D81\u5D83\u5D88\u5D8A\u5D92\u5D93\u5D94\u5D95\u5D99\u5D9B\u5D9F\u5DA0\u5DA7\u5DAB\u5DB0\u5DB4\u5DB8\u5DB9\u5DC3\u5DC7\u5DCB\u5DD0\u5DCE\u5DD8\u5DD9\u5DE0\u5DE4"],
      ["8fbca1", "\u5DE9\u5DF8\u5DF9\u5E00\u5E07\u5E0D\u5E12\u5E14\u5E15\u5E18\u5E1F\u5E20\u5E2E\u5E28\u5E32\u5E35\u5E3E\u5E4B\u5E50\u5E49\u5E51\u5E56\u5E58\u5E5B\u5E5C\u5E5E\u5E68\u5E6A", 4, "\u5E70\u5E80\u5E8B\u5E8E\u5EA2\u5EA4\u5EA5\u5EA8\u5EAA\u5EAC\u5EB1\u5EB3\u5EBD\u5EBE\u5EBF\u5EC6\u5ECC\u5ECB\u5ECE\u5ED1\u5ED2\u5ED4\u5ED5\u5EDC\u5EDE\u5EE5\u5EEB\u5F02\u5F06\u5F07\u5F08\u5F0E\u5F19\u5F1C\u5F1D\u5F21\u5F22\u5F23\u5F24\u5F28\u5F2B\u5F2C\u5F2E\u5F30\u5F34\u5F36\u5F3B\u5F3D\u5F3F\u5F40\u5F44\u5F45\u5F47\u5F4D\u5F50\u5F54\u5F58\u5F5B\u5F60\u5F63\u5F64\u5F67"],
      ["8fbda1", "\u5F6F\u5F72\u5F74\u5F75\u5F78\u5F7A\u5F7D\u5F7E\u5F89\u5F8D\u5F8F\u5F96\u5F9C\u5F9D\u5FA2\u5FA7\u5FAB\u5FA4\u5FAC\u5FAF\u5FB0\u5FB1\u5FB8\u5FC4\u5FC7\u5FC8\u5FC9\u5FCB\u5FD0", 4, "\u5FDE\u5FE1\u5FE2\u5FE8\u5FE9\u5FEA\u5FEC\u5FED\u5FEE\u5FEF\u5FF2\u5FF3\u5FF6\u5FFA\u5FFC\u6007\u600A\u600D\u6013\u6014\u6017\u6018\u601A\u601F\u6024\u602D\u6033\u6035\u6040\u6047\u6048\u6049\u604C\u6051\u6054\u6056\u6057\u605D\u6061\u6067\u6071\u607E\u607F\u6082\u6086\u6088\u608A\u608E\u6091\u6093\u6095\u6098\u609D\u609E\u60A2\u60A4\u60A5\u60A8\u60B0\u60B1\u60B7"],
      ["8fbea1", "\u60BB\u60BE\u60C2\u60C4\u60C8\u60C9\u60CA\u60CB\u60CE\u60CF\u60D4\u60D5\u60D9\u60DB\u60DD\u60DE\u60E2\u60E5\u60F2\u60F5\u60F8\u60FC\u60FD\u6102\u6107\u610A\u610C\u6110", 4, "\u6116\u6117\u6119\u611C\u611E\u6122\u612A\u612B\u6130\u6131\u6135\u6136\u6137\u6139\u6141\u6145\u6146\u6149\u615E\u6160\u616C\u6172\u6178\u617B\u617C\u617F\u6180\u6181\u6183\u6184\u618B\u618D\u6192\u6193\u6197\u6198\u619C\u619D\u619F\u61A0\u61A5\u61A8\u61AA\u61AD\u61B8\u61B9\u61BC\u61C0\u61C1\u61C2\u61CE\u61CF\u61D5\u61DC\u61DD\u61DE\u61DF\u61E1\u61E2\u61E7\u61E9\u61E5"],
      ["8fbfa1", "\u61EC\u61ED\u61EF\u6201\u6203\u6204\u6207\u6213\u6215\u621C\u6220\u6222\u6223\u6227\u6229\u622B\u6239\u623D\u6242\u6243\u6244\u6246\u624C\u6250\u6251\u6252\u6254\u6256\u625A\u625C\u6264\u626D\u626F\u6273\u627A\u627D\u628D\u628E\u628F\u6290\u62A6\u62A8\u62B3\u62B6\u62B7\u62BA\u62BE\u62BF\u62C4\u62CE\u62D5\u62D6\u62DA\u62EA\u62F2\u62F4\u62FC\u62FD\u6303\u6304\u630A\u630B\u630D\u6310\u6313\u6316\u6318\u6329\u632A\u632D\u6335\u6336\u6339\u633C\u6341\u6342\u6343\u6344\u6346\u634A\u634B\u634E\u6352\u6353\u6354\u6358\u635B\u6365\u6366\u636C\u636D\u6371\u6374\u6375"],
      ["8fc0a1", "\u6378\u637C\u637D\u637F\u6382\u6384\u6387\u638A\u6390\u6394\u6395\u6399\u639A\u639E\u63A4\u63A6\u63AD\u63AE\u63AF\u63BD\u63C1\u63C5\u63C8\u63CE\u63D1\u63D3\u63D4\u63D5\u63DC\u63E0\u63E5\u63EA\u63EC\u63F2\u63F3\u63F5\u63F8\u63F9\u6409\u640A\u6410\u6412\u6414\u6418\u641E\u6420\u6422\u6424\u6425\u6429\u642A\u642F\u6430\u6435\u643D\u643F\u644B\u644F\u6451\u6452\u6453\u6454\u645A\u645B\u645C\u645D\u645F\u6460\u6461\u6463\u646D\u6473\u6474\u647B\u647D\u6485\u6487\u648F\u6490\u6491\u6498\u6499\u649B\u649D\u649F\u64A1\u64A3\u64A6\u64A8\u64AC\u64B3\u64BD\u64BE\u64BF"],
      ["8fc1a1", "\u64C4\u64C9\u64CA\u64CB\u64CC\u64CE\u64D0\u64D1\u64D5\u64D7\u64E4\u64E5\u64E9\u64EA\u64ED\u64F0\u64F5\u64F7\u64FB\u64FF\u6501\u6504\u6508\u6509\u650A\u650F\u6513\u6514\u6516\u6519\u651B\u651E\u651F\u6522\u6526\u6529\u652E\u6531\u653A\u653C\u653D\u6543\u6547\u6549\u6550\u6552\u6554\u655F\u6560\u6567\u656B\u657A\u657D\u6581\u6585\u658A\u6592\u6595\u6598\u659D\u65A0\u65A3\u65A6\u65AE\u65B2\u65B3\u65B4\u65BF\u65C2\u65C8\u65C9\u65CE\u65D0\u65D4\u65D6\u65D8\u65DF\u65F0\u65F2\u65F4\u65F5\u65F9\u65FE\u65FF\u6600\u6604\u6608\u6609\u660D\u6611\u6612\u6615\u6616\u661D"],
      ["8fc2a1", "\u661E\u6621\u6622\u6623\u6624\u6626\u6629\u662A\u662B\u662C\u662E\u6630\u6631\u6633\u6639\u6637\u6640\u6645\u6646\u664A\u664C\u6651\u664E\u6657\u6658\u6659\u665B\u665C\u6660\u6661\u66FB\u666A\u666B\u666C\u667E\u6673\u6675\u667F\u6677\u6678\u6679\u667B\u6680\u667C\u668B\u668C\u668D\u6690\u6692\u6699\u669A\u669B\u669C\u669F\u66A0\u66A4\u66AD\u66B1\u66B2\u66B5\u66BB\u66BF\u66C0\u66C2\u66C3\u66C8\u66CC\u66CE\u66CF\u66D4\u66DB\u66DF\u66E8\u66EB\u66EC\u66EE\u66FA\u6705\u6707\u670E\u6713\u6719\u671C\u6720\u6722\u6733\u673E\u6745\u6747\u6748\u674C\u6754\u6755\u675D"],
      ["8fc3a1", "\u6766\u676C\u676E\u6774\u6776\u677B\u6781\u6784\u678E\u678F\u6791\u6793\u6796\u6798\u6799\u679B\u67B0\u67B1\u67B2\u67B5\u67BB\u67BC\u67BD\u67F9\u67C0\u67C2\u67C3\u67C5\u67C8\u67C9\u67D2\u67D7\u67D9\u67DC\u67E1\u67E6\u67F0\u67F2\u67F6\u67F7\u6852\u6814\u6819\u681D\u681F\u6828\u6827\u682C\u682D\u682F\u6830\u6831\u6833\u683B\u683F\u6844\u6845\u684A\u684C\u6855\u6857\u6858\u685B\u686B\u686E", 4, "\u6875\u6879\u687A\u687B\u687C\u6882\u6884\u6886\u6888\u6896\u6898\u689A\u689C\u68A1\u68A3\u68A5\u68A9\u68AA\u68AE\u68B2\u68BB\u68C5\u68C8\u68CC\u68CF"],
      ["8fc4a1", "\u68D0\u68D1\u68D3\u68D6\u68D9\u68DC\u68DD\u68E5\u68E8\u68EA\u68EB\u68EC\u68ED\u68F0\u68F1\u68F5\u68F6\u68FB\u68FC\u68FD\u6906\u6909\u690A\u6910\u6911\u6913\u6916\u6917\u6931\u6933\u6935\u6938\u693B\u6942\u6945\u6949\u694E\u6957\u695B\u6963\u6964\u6965\u6966\u6968\u6969\u696C\u6970\u6971\u6972\u697A\u697B\u697F\u6980\u698D\u6992\u6996\u6998\u69A1\u69A5\u69A6\u69A8\u69AB\u69AD\u69AF\u69B7\u69B8\u69BA\u69BC\u69C5\u69C8\u69D1\u69D6\u69D7\u69E2\u69E5\u69EE\u69EF\u69F1\u69F3\u69F5\u69FE\u6A00\u6A01\u6A03\u6A0F\u6A11\u6A15\u6A1A\u6A1D\u6A20\u6A24\u6A28\u6A30\u6A32"],
      ["8fc5a1", "\u6A34\u6A37\u6A3B\u6A3E\u6A3F\u6A45\u6A46\u6A49\u6A4A\u6A4E\u6A50\u6A51\u6A52\u6A55\u6A56\u6A5B\u6A64\u6A67\u6A6A\u6A71\u6A73\u6A7E\u6A81\u6A83\u6A86\u6A87\u6A89\u6A8B\u6A91\u6A9B\u6A9D\u6A9E\u6A9F\u6AA5\u6AAB\u6AAF\u6AB0\u6AB1\u6AB4\u6ABD\u6ABE\u6ABF\u6AC6\u6AC9\u6AC8\u6ACC\u6AD0\u6AD4\u6AD5\u6AD6\u6ADC\u6ADD\u6AE4\u6AE7\u6AEC\u6AF0\u6AF1\u6AF2\u6AFC\u6AFD\u6B02\u6B03\u6B06\u6B07\u6B09\u6B0F\u6B10\u6B11\u6B17\u6B1B\u6B1E\u6B24\u6B28\u6B2B\u6B2C\u6B2F\u6B35\u6B36\u6B3B\u6B3F\u6B46\u6B4A\u6B4D\u6B52\u6B56\u6B58\u6B5D\u6B60\u6B67\u6B6B\u6B6E\u6B70\u6B75\u6B7D"],
      ["8fc6a1", "\u6B7E\u6B82\u6B85\u6B97\u6B9B\u6B9F\u6BA0\u6BA2\u6BA3\u6BA8\u6BA9\u6BAC\u6BAD\u6BAE\u6BB0\u6BB8\u6BB9\u6BBD\u6BBE\u6BC3\u6BC4\u6BC9\u6BCC\u6BD6\u6BDA\u6BE1\u6BE3\u6BE6\u6BE7\u6BEE\u6BF1\u6BF7\u6BF9\u6BFF\u6C02\u6C04\u6C05\u6C09\u6C0D\u6C0E\u6C10\u6C12\u6C19\u6C1F\u6C26\u6C27\u6C28\u6C2C\u6C2E\u6C33\u6C35\u6C36\u6C3A\u6C3B\u6C3F\u6C4A\u6C4B\u6C4D\u6C4F\u6C52\u6C54\u6C59\u6C5B\u6C5C\u6C6B\u6C6D\u6C6F\u6C74\u6C76\u6C78\u6C79\u6C7B\u6C85\u6C86\u6C87\u6C89\u6C94\u6C95\u6C97\u6C98\u6C9C\u6C9F\u6CB0\u6CB2\u6CB4\u6CC2\u6CC6\u6CCD\u6CCF\u6CD0\u6CD1\u6CD2\u6CD4\u6CD6"],
      ["8fc7a1", "\u6CDA\u6CDC\u6CE0\u6CE7\u6CE9\u6CEB\u6CEC\u6CEE\u6CF2\u6CF4\u6D04\u6D07\u6D0A\u6D0E\u6D0F\u6D11\u6D13\u6D1A\u6D26\u6D27\u6D28\u6C67\u6D2E\u6D2F\u6D31\u6D39\u6D3C\u6D3F\u6D57\u6D5E\u6D5F\u6D61\u6D65\u6D67\u6D6F\u6D70\u6D7C\u6D82\u6D87\u6D91\u6D92\u6D94\u6D96\u6D97\u6D98\u6DAA\u6DAC\u6DB4\u6DB7\u6DB9\u6DBD\u6DBF\u6DC4\u6DC8\u6DCA\u6DCE\u6DCF\u6DD6\u6DDB\u6DDD\u6DDF\u6DE0\u6DE2\u6DE5\u6DE9\u6DEF\u6DF0\u6DF4\u6DF6\u6DFC\u6E00\u6E04\u6E1E\u6E22\u6E27\u6E32\u6E36\u6E39\u6E3B\u6E3C\u6E44\u6E45\u6E48\u6E49\u6E4B\u6E4F\u6E51\u6E52\u6E53\u6E54\u6E57\u6E5C\u6E5D\u6E5E"],
      ["8fc8a1", "\u6E62\u6E63\u6E68\u6E73\u6E7B\u6E7D\u6E8D\u6E93\u6E99\u6EA0\u6EA7\u6EAD\u6EAE\u6EB1\u6EB3\u6EBB\u6EBF\u6EC0\u6EC1\u6EC3\u6EC7\u6EC8\u6ECA\u6ECD\u6ECE\u6ECF\u6EEB\u6EED\u6EEE\u6EF9\u6EFB\u6EFD\u6F04\u6F08\u6F0A\u6F0C\u6F0D\u6F16\u6F18\u6F1A\u6F1B\u6F26\u6F29\u6F2A\u6F2F\u6F30\u6F33\u6F36\u6F3B\u6F3C\u6F2D\u6F4F\u6F51\u6F52\u6F53\u6F57\u6F59\u6F5A\u6F5D\u6F5E\u6F61\u6F62\u6F68\u6F6C\u6F7D\u6F7E\u6F83\u6F87\u6F88\u6F8B\u6F8C\u6F8D\u6F90\u6F92\u6F93\u6F94\u6F96\u6F9A\u6F9F\u6FA0\u6FA5\u6FA6\u6FA7\u6FA8\u6FAE\u6FAF\u6FB0\u6FB5\u6FB6\u6FBC\u6FC5\u6FC7\u6FC8\u6FCA"],
      ["8fc9a1", "\u6FDA\u6FDE\u6FE8\u6FE9\u6FF0\u6FF5\u6FF9\u6FFC\u6FFD\u7000\u7005\u7006\u7007\u700D\u7017\u7020\u7023\u702F\u7034\u7037\u7039\u703C\u7043\u7044\u7048\u7049\u704A\u704B\u7054\u7055\u705D\u705E\u704E\u7064\u7065\u706C\u706E\u7075\u7076\u707E\u7081\u7085\u7086\u7094", 4, "\u709B\u70A4\u70AB\u70B0\u70B1\u70B4\u70B7\u70CA\u70D1\u70D3\u70D4\u70D5\u70D6\u70D8\u70DC\u70E4\u70FA\u7103", 4, "\u710B\u710C\u710F\u711E\u7120\u712B\u712D\u712F\u7130\u7131\u7138\u7141\u7145\u7146\u7147\u714A\u714B\u7150\u7152\u7157\u715A\u715C\u715E\u7160"],
      ["8fcaa1", "\u7168\u7179\u7180\u7185\u7187\u718C\u7192\u719A\u719B\u71A0\u71A2\u71AF\u71B0\u71B2\u71B3\u71BA\u71BF\u71C0\u71C1\u71C4\u71CB\u71CC\u71D3\u71D6\u71D9\u71DA\u71DC\u71F8\u71FE\u7200\u7207\u7208\u7209\u7213\u7217\u721A\u721D\u721F\u7224\u722B\u722F\u7234\u7238\u7239\u7241\u7242\u7243\u7245\u724E\u724F\u7250\u7253\u7255\u7256\u725A\u725C\u725E\u7260\u7263\u7268\u726B\u726E\u726F\u7271\u7277\u7278\u727B\u727C\u727F\u7284\u7289\u728D\u728E\u7293\u729B\u72A8\u72AD\u72AE\u72B1\u72B4\u72BE\u72C1\u72C7\u72C9\u72CC\u72D5\u72D6\u72D8\u72DF\u72E5\u72F3\u72F4\u72FA\u72FB"],
      ["8fcba1", "\u72FE\u7302\u7304\u7305\u7307\u730B\u730D\u7312\u7313\u7318\u7319\u731E\u7322\u7324\u7327\u7328\u732C\u7331\u7332\u7335\u733A\u733B\u733D\u7343\u734D\u7350\u7352\u7356\u7358\u735D\u735E\u735F\u7360\u7366\u7367\u7369\u736B\u736C\u736E\u736F\u7371\u7377\u7379\u737C\u7380\u7381\u7383\u7385\u7386\u738E\u7390\u7393\u7395\u7397\u7398\u739C\u739E\u739F\u73A0\u73A2\u73A5\u73A6\u73AA\u73AB\u73AD\u73B5\u73B7\u73B9\u73BC\u73BD\u73BF\u73C5\u73C6\u73C9\u73CB\u73CC\u73CF\u73D2\u73D3\u73D6\u73D9\u73DD\u73E1\u73E3\u73E6\u73E7\u73E9\u73F4\u73F5\u73F7\u73F9\u73FA\u73FB\u73FD"],
      ["8fcca1", "\u73FF\u7400\u7401\u7404\u7407\u740A\u7411\u741A\u741B\u7424\u7426\u7428", 9, "\u7439\u7440\u7443\u7444\u7446\u7447\u744B\u744D\u7451\u7452\u7457\u745D\u7462\u7466\u7467\u7468\u746B\u746D\u746E\u7471\u7472\u7480\u7481\u7485\u7486\u7487\u7489\u748F\u7490\u7491\u7492\u7498\u7499\u749A\u749C\u749F\u74A0\u74A1\u74A3\u74A6\u74A8\u74A9\u74AA\u74AB\u74AE\u74AF\u74B1\u74B2\u74B5\u74B9\u74BB\u74BF\u74C8\u74C9\u74CC\u74D0\u74D3\u74D8\u74DA\u74DB\u74DE\u74DF\u74E4\u74E8\u74EA\u74EB\u74EF\u74F4\u74FA\u74FB\u74FC\u74FF\u7506"],
      ["8fcda1", "\u7512\u7516\u7517\u7520\u7521\u7524\u7527\u7529\u752A\u752F\u7536\u7539\u753D\u753E\u753F\u7540\u7543\u7547\u7548\u754E\u7550\u7552\u7557\u755E\u755F\u7561\u756F\u7571\u7579", 5, "\u7581\u7585\u7590\u7592\u7593\u7595\u7599\u759C\u75A2\u75A4\u75B4\u75BA\u75BF\u75C0\u75C1\u75C4\u75C6\u75CC\u75CE\u75CF\u75D7\u75DC\u75DF\u75E0\u75E1\u75E4\u75E7\u75EC\u75EE\u75EF\u75F1\u75F9\u7600\u7602\u7603\u7604\u7607\u7608\u760A\u760C\u760F\u7612\u7613\u7615\u7616\u7619\u761B\u761C\u761D\u761E\u7623\u7625\u7626\u7629\u762D\u7632\u7633\u7635\u7638\u7639"],
      ["8fcea1", "\u763A\u763C\u764A\u7640\u7641\u7643\u7644\u7645\u7649\u764B\u7655\u7659\u765F\u7664\u7665\u766D\u766E\u766F\u7671\u7674\u7681\u7685\u768C\u768D\u7695\u769B\u769C\u769D\u769F\u76A0\u76A2", 6, "\u76AA\u76AD\u76BD\u76C1\u76C5\u76C9\u76CB\u76CC\u76CE\u76D4\u76D9\u76E0\u76E6\u76E8\u76EC\u76F0\u76F1\u76F6\u76F9\u76FC\u7700\u7706\u770A\u770E\u7712\u7714\u7715\u7717\u7719\u771A\u771C\u7722\u7728\u772D\u772E\u772F\u7734\u7735\u7736\u7739\u773D\u773E\u7742\u7745\u7746\u774A\u774D\u774E\u774F\u7752\u7756\u7757\u775C\u775E\u775F\u7760\u7762"],
      ["8fcfa1", "\u7764\u7767\u776A\u776C\u7770\u7772\u7773\u7774\u777A\u777D\u7780\u7784\u778C\u778D\u7794\u7795\u7796\u779A\u779F\u77A2\u77A7\u77AA\u77AE\u77AF\u77B1\u77B5\u77BE\u77C3\u77C9\u77D1\u77D2\u77D5\u77D9\u77DE\u77DF\u77E0\u77E4\u77E6\u77EA\u77EC\u77F0\u77F1\u77F4\u77F8\u77FB\u7805\u7806\u7809\u780D\u780E\u7811\u781D\u7821\u7822\u7823\u782D\u782E\u7830\u7835\u7837\u7843\u7844\u7847\u7848\u784C\u784E\u7852\u785C\u785E\u7860\u7861\u7863\u7864\u7868\u786A\u786E\u787A\u787E\u788A\u788F\u7894\u7898\u78A1\u789D\u789E\u789F\u78A4\u78A8\u78AC\u78AD\u78B0\u78B1\u78B2\u78B3"],
      ["8fd0a1", "\u78BB\u78BD\u78BF\u78C7\u78C8\u78C9\u78CC\u78CE\u78D2\u78D3\u78D5\u78D6\u78E4\u78DB\u78DF\u78E0\u78E1\u78E6\u78EA\u78F2\u78F3\u7900\u78F6\u78F7\u78FA\u78FB\u78FF\u7906\u790C\u7910\u791A\u791C\u791E\u791F\u7920\u7925\u7927\u7929\u792D\u7931\u7934\u7935\u793B\u793D\u793F\u7944\u7945\u7946\u794A\u794B\u794F\u7951\u7954\u7958\u795B\u795C\u7967\u7969\u796B\u7972\u7979\u797B\u797C\u797E\u798B\u798C\u7991\u7993\u7994\u7995\u7996\u7998\u799B\u799C\u79A1\u79A8\u79A9\u79AB\u79AF\u79B1\u79B4\u79B8\u79BB\u79C2\u79C4\u79C7\u79C8\u79CA\u79CF\u79D4\u79D6\u79DA\u79DD\u79DE"],
      ["8fd1a1", "\u79E0\u79E2\u79E5\u79EA\u79EB\u79ED\u79F1\u79F8\u79FC\u7A02\u7A03\u7A07\u7A09\u7A0A\u7A0C\u7A11\u7A15\u7A1B\u7A1E\u7A21\u7A27\u7A2B\u7A2D\u7A2F\u7A30\u7A34\u7A35\u7A38\u7A39\u7A3A\u7A44\u7A45\u7A47\u7A48\u7A4C\u7A55\u7A56\u7A59\u7A5C\u7A5D\u7A5F\u7A60\u7A65\u7A67\u7A6A\u7A6D\u7A75\u7A78\u7A7E\u7A80\u7A82\u7A85\u7A86\u7A8A\u7A8B\u7A90\u7A91\u7A94\u7A9E\u7AA0\u7AA3\u7AAC\u7AB3\u7AB5\u7AB9\u7ABB\u7ABC\u7AC6\u7AC9\u7ACC\u7ACE\u7AD1\u7ADB\u7AE8\u7AE9\u7AEB\u7AEC\u7AF1\u7AF4\u7AFB\u7AFD\u7AFE\u7B07\u7B14\u7B1F\u7B23\u7B27\u7B29\u7B2A\u7B2B\u7B2D\u7B2E\u7B2F\u7B30"],
      ["8fd2a1", "\u7B31\u7B34\u7B3D\u7B3F\u7B40\u7B41\u7B47\u7B4E\u7B55\u7B60\u7B64\u7B66\u7B69\u7B6A\u7B6D\u7B6F\u7B72\u7B73\u7B77\u7B84\u7B89\u7B8E\u7B90\u7B91\u7B96\u7B9B\u7B9E\u7BA0\u7BA5\u7BAC\u7BAF\u7BB0\u7BB2\u7BB5\u7BB6\u7BBA\u7BBB\u7BBC\u7BBD\u7BC2\u7BC5\u7BC8\u7BCA\u7BD4\u7BD6\u7BD7\u7BD9\u7BDA\u7BDB\u7BE8\u7BEA\u7BF2\u7BF4\u7BF5\u7BF8\u7BF9\u7BFA\u7BFC\u7BFE\u7C01\u7C02\u7C03\u7C04\u7C06\u7C09\u7C0B\u7C0C\u7C0E\u7C0F\u7C19\u7C1B\u7C20\u7C25\u7C26\u7C28\u7C2C\u7C31\u7C33\u7C34\u7C36\u7C39\u7C3A\u7C46\u7C4A\u7C55\u7C51\u7C52\u7C53\u7C59", 5],
      ["8fd3a1", "\u7C61\u7C63\u7C67\u7C69\u7C6D\u7C6E\u7C70\u7C72\u7C79\u7C7C\u7C7D\u7C86\u7C87\u7C8F\u7C94\u7C9E\u7CA0\u7CA6\u7CB0\u7CB6\u7CB7\u7CBA\u7CBB\u7CBC\u7CBF\u7CC4\u7CC7\u7CC8\u7CC9\u7CCD\u7CCF\u7CD3\u7CD4\u7CD5\u7CD7\u7CD9\u7CDA\u7CDD\u7CE6\u7CE9\u7CEB\u7CF5\u7D03\u7D07\u7D08\u7D09\u7D0F\u7D11\u7D12\u7D13\u7D16\u7D1D\u7D1E\u7D23\u7D26\u7D2A\u7D2D\u7D31\u7D3C\u7D3D\u7D3E\u7D40\u7D41\u7D47\u7D48\u7D4D\u7D51\u7D53\u7D57\u7D59\u7D5A\u7D5C\u7D5D\u7D65\u7D67\u7D6A\u7D70\u7D78\u7D7A\u7D7B\u7D7F\u7D81\u7D82\u7D83\u7D85\u7D86\u7D88\u7D8B\u7D8C\u7D8D\u7D91\u7D96\u7D97\u7D9D"],
      ["8fd4a1", "\u7D9E\u7DA6\u7DA7\u7DAA\u7DB3\u7DB6\u7DB7\u7DB9\u7DC2", 4, "\u7DCC\u7DCD\u7DCE\u7DD7\u7DD9\u7E00\u7DE2\u7DE5\u7DE6\u7DEA\u7DEB\u7DED\u7DF1\u7DF5\u7DF6\u7DF9\u7DFA\u7E08\u7E10\u7E11\u7E15\u7E17\u7E1C\u7E1D\u7E20\u7E27\u7E28\u7E2C\u7E2D\u7E2F\u7E33\u7E36\u7E3F\u7E44\u7E45\u7E47\u7E4E\u7E50\u7E52\u7E58\u7E5F\u7E61\u7E62\u7E65\u7E6B\u7E6E\u7E6F\u7E73\u7E78\u7E7E\u7E81\u7E86\u7E87\u7E8A\u7E8D\u7E91\u7E95\u7E98\u7E9A\u7E9D\u7E9E\u7F3C\u7F3B\u7F3D\u7F3E\u7F3F\u7F43\u7F44\u7F47\u7F4F\u7F52\u7F53\u7F5B\u7F5C\u7F5D\u7F61\u7F63\u7F64\u7F65\u7F66\u7F6D"],
      ["8fd5a1", "\u7F71\u7F7D\u7F7E\u7F7F\u7F80\u7F8B\u7F8D\u7F8F\u7F90\u7F91\u7F96\u7F97\u7F9C\u7FA1\u7FA2\u7FA6\u7FAA\u7FAD\u7FB4\u7FBC\u7FBF\u7FC0\u7FC3\u7FC8\u7FCE\u7FCF\u7FDB\u7FDF\u7FE3\u7FE5\u7FE8\u7FEC\u7FEE\u7FEF\u7FF2\u7FFA\u7FFD\u7FFE\u7FFF\u8007\u8008\u800A\u800D\u800E\u800F\u8011\u8013\u8014\u8016\u801D\u801E\u801F\u8020\u8024\u8026\u802C\u802E\u8030\u8034\u8035\u8037\u8039\u803A\u803C\u803E\u8040\u8044\u8060\u8064\u8066\u806D\u8071\u8075\u8081\u8088\u808E\u809C\u809E\u80A6\u80A7\u80AB\u80B8\u80B9\u80C8\u80CD\u80CF\u80D2\u80D4\u80D5\u80D7\u80D8\u80E0\u80ED\u80EE"],
      ["8fd6a1", "\u80F0\u80F2\u80F3\u80F6\u80F9\u80FA\u80FE\u8103\u810B\u8116\u8117\u8118\u811C\u811E\u8120\u8124\u8127\u812C\u8130\u8135\u813A\u813C\u8145\u8147\u814A\u814C\u8152\u8157\u8160\u8161\u8167\u8168\u8169\u816D\u816F\u8177\u8181\u8190\u8184\u8185\u8186\u818B\u818E\u8196\u8198\u819B\u819E\u81A2\u81AE\u81B2\u81B4\u81BB\u81CB\u81C3\u81C5\u81CA\u81CE\u81CF\u81D5\u81D7\u81DB\u81DD\u81DE\u81E1\u81E4\u81EB\u81EC\u81F0\u81F1\u81F2\u81F5\u81F6\u81F8\u81F9\u81FD\u81FF\u8200\u8203\u820F\u8213\u8214\u8219\u821A\u821D\u8221\u8222\u8228\u8232\u8234\u823A\u8243\u8244\u8245\u8246"],
      ["8fd7a1", "\u824B\u824E\u824F\u8251\u8256\u825C\u8260\u8263\u8267\u826D\u8274\u827B\u827D\u827F\u8280\u8281\u8283\u8284\u8287\u8289\u828A\u828E\u8291\u8294\u8296\u8298\u829A\u829B\u82A0\u82A1\u82A3\u82A4\u82A7\u82A8\u82A9\u82AA\u82AE\u82B0\u82B2\u82B4\u82B7\u82BA\u82BC\u82BE\u82BF\u82C6\u82D0\u82D5\u82DA\u82E0\u82E2\u82E4\u82E8\u82EA\u82ED\u82EF\u82F6\u82F7\u82FD\u82FE\u8300\u8301\u8307\u8308\u830A\u830B\u8354\u831B\u831D\u831E\u831F\u8321\u8322\u832C\u832D\u832E\u8330\u8333\u8337\u833A\u833C\u833D\u8342\u8343\u8344\u8347\u834D\u834E\u8351\u8355\u8356\u8357\u8370\u8378"],
      ["8fd8a1", "\u837D\u837F\u8380\u8382\u8384\u8386\u838D\u8392\u8394\u8395\u8398\u8399\u839B\u839C\u839D\u83A6\u83A7\u83A9\u83AC\u83BE\u83BF\u83C0\u83C7\u83C9\u83CF\u83D0\u83D1\u83D4\u83DD\u8353\u83E8\u83EA\u83F6\u83F8\u83F9\u83FC\u8401\u8406\u840A\u840F\u8411\u8415\u8419\u83AD\u842F\u8439\u8445\u8447\u8448\u844A\u844D\u844F\u8451\u8452\u8456\u8458\u8459\u845A\u845C\u8460\u8464\u8465\u8467\u846A\u8470\u8473\u8474\u8476\u8478\u847C\u847D\u8481\u8485\u8492\u8493\u8495\u849E\u84A6\u84A8\u84A9\u84AA\u84AF\u84B1\u84B4\u84BA\u84BD\u84BE\u84C0\u84C2\u84C7\u84C8\u84CC\u84CF\u84D3"],
      ["8fd9a1", "\u84DC\u84E7\u84EA\u84EF\u84F0\u84F1\u84F2\u84F7\u8532\u84FA\u84FB\u84FD\u8502\u8503\u8507\u850C\u850E\u8510\u851C\u851E\u8522\u8523\u8524\u8525\u8527\u852A\u852B\u852F\u8533\u8534\u8536\u853F\u8546\u854F", 4, "\u8556\u8559\u855C", 6, "\u8564\u856B\u856F\u8579\u857A\u857B\u857D\u857F\u8581\u8585\u8586\u8589\u858B\u858C\u858F\u8593\u8598\u859D\u859F\u85A0\u85A2\u85A5\u85A7\u85B4\u85B6\u85B7\u85B8\u85BC\u85BD\u85BE\u85BF\u85C2\u85C7\u85CA\u85CB\u85CE\u85AD\u85D8\u85DA\u85DF\u85E0\u85E6\u85E8\u85ED\u85F3\u85F6\u85FC"],
      ["8fdaa1", "\u85FF\u8600\u8604\u8605\u860D\u860E\u8610\u8611\u8612\u8618\u8619\u861B\u861E\u8621\u8627\u8629\u8636\u8638\u863A\u863C\u863D\u8640\u8642\u8646\u8652\u8653\u8656\u8657\u8658\u8659\u865D\u8660", 4, "\u8669\u866C\u866F\u8675\u8676\u8677\u867A\u868D\u8691\u8696\u8698\u869A\u869C\u86A1\u86A6\u86A7\u86A8\u86AD\u86B1\u86B3\u86B4\u86B5\u86B7\u86B8\u86B9\u86BF\u86C0\u86C1\u86C3\u86C5\u86D1\u86D2\u86D5\u86D7\u86DA\u86DC\u86E0\u86E3\u86E5\u86E7\u8688\u86FA\u86FC\u86FD\u8704\u8705\u8707\u870B\u870E\u870F\u8710\u8713\u8714\u8719\u871E\u871F\u8721\u8723"],
      ["8fdba1", "\u8728\u872E\u872F\u8731\u8732\u8739\u873A\u873C\u873D\u873E\u8740\u8743\u8745\u874D\u8758\u875D\u8761\u8764\u8765\u876F\u8771\u8772\u877B\u8783", 6, "\u878B\u878C\u8790\u8793\u8795\u8797\u8798\u8799\u879E\u87A0\u87A3\u87A7\u87AC\u87AD\u87AE\u87B1\u87B5\u87BE\u87BF\u87C1\u87C8\u87C9\u87CA\u87CE\u87D5\u87D6\u87D9\u87DA\u87DC\u87DF\u87E2\u87E3\u87E4\u87EA\u87EB\u87ED\u87F1\u87F3\u87F8\u87FA\u87FF\u8801\u8803\u8806\u8809\u880A\u880B\u8810\u8819\u8812\u8813\u8814\u8818\u881A\u881B\u881C\u881E\u881F\u8828\u882D\u882E\u8830\u8832\u8835"],
      ["8fdca1", "\u883A\u883C\u8841\u8843\u8845\u8848\u8849\u884A\u884B\u884E\u8851\u8855\u8856\u8858\u885A\u885C\u885F\u8860\u8864\u8869\u8871\u8879\u887B\u8880\u8898\u889A\u889B\u889C\u889F\u88A0\u88A8\u88AA\u88BA\u88BD\u88BE\u88C0\u88CA", 4, "\u88D1\u88D2\u88D3\u88DB\u88DE\u88E7\u88EF\u88F0\u88F1\u88F5\u88F7\u8901\u8906\u890D\u890E\u890F\u8915\u8916\u8918\u8919\u891A\u891C\u8920\u8926\u8927\u8928\u8930\u8931\u8932\u8935\u8939\u893A\u893E\u8940\u8942\u8945\u8946\u8949\u894F\u8952\u8957\u895A\u895B\u895C\u8961\u8962\u8963\u896B\u896E\u8970\u8973\u8975\u897A"],
      ["8fdda1", "\u897B\u897C\u897D\u8989\u898D\u8990\u8994\u8995\u899B\u899C\u899F\u89A0\u89A5\u89B0\u89B4\u89B5\u89B6\u89B7\u89BC\u89D4", 4, "\u89E5\u89E9\u89EB\u89ED\u89F1\u89F3\u89F6\u89F9\u89FD\u89FF\u8A04\u8A05\u8A07\u8A0F\u8A11\u8A12\u8A14\u8A15\u8A1E\u8A20\u8A22\u8A24\u8A26\u8A2B\u8A2C\u8A2F\u8A35\u8A37\u8A3D\u8A3E\u8A40\u8A43\u8A45\u8A47\u8A49\u8A4D\u8A4E\u8A53\u8A56\u8A57\u8A58\u8A5C\u8A5D\u8A61\u8A65\u8A67\u8A75\u8A76\u8A77\u8A79\u8A7A\u8A7B\u8A7E\u8A7F\u8A80\u8A83\u8A86\u8A8B\u8A8F\u8A90\u8A92\u8A96\u8A97\u8A99\u8A9F\u8AA7\u8AA9\u8AAE\u8AAF\u8AB3"],
      ["8fdea1", "\u8AB6\u8AB7\u8ABB\u8ABE\u8AC3\u8AC6\u8AC8\u8AC9\u8ACA\u8AD1\u8AD3\u8AD4\u8AD5\u8AD7\u8ADD\u8ADF\u8AEC\u8AF0\u8AF4\u8AF5\u8AF6\u8AFC\u8AFF\u8B05\u8B06\u8B0B\u8B11\u8B1C\u8B1E\u8B1F\u8B0A\u8B2D\u8B30\u8B37\u8B3C\u8B42", 4, "\u8B48\u8B52\u8B53\u8B54\u8B59\u8B4D\u8B5E\u8B63\u8B6D\u8B76\u8B78\u8B79\u8B7C\u8B7E\u8B81\u8B84\u8B85\u8B8B\u8B8D\u8B8F\u8B94\u8B95\u8B9C\u8B9E\u8B9F\u8C38\u8C39\u8C3D\u8C3E\u8C45\u8C47\u8C49\u8C4B\u8C4F\u8C51\u8C53\u8C54\u8C57\u8C58\u8C5B\u8C5D\u8C59\u8C63\u8C64\u8C66\u8C68\u8C69\u8C6D\u8C73\u8C75\u8C76\u8C7B\u8C7E\u8C86"],
      ["8fdfa1", "\u8C87\u8C8B\u8C90\u8C92\u8C93\u8C99\u8C9B\u8C9C\u8CA4\u8CB9\u8CBA\u8CC5\u8CC6\u8CC9\u8CCB\u8CCF\u8CD6\u8CD5\u8CD9\u8CDD\u8CE1\u8CE8\u8CEC\u8CEF\u8CF0\u8CF2\u8CF5\u8CF7\u8CF8\u8CFE\u8CFF\u8D01\u8D03\u8D09\u8D12\u8D17\u8D1B\u8D65\u8D69\u8D6C\u8D6E\u8D7F\u8D82\u8D84\u8D88\u8D8D\u8D90\u8D91\u8D95\u8D9E\u8D9F\u8DA0\u8DA6\u8DAB\u8DAC\u8DAF\u8DB2\u8DB5\u8DB7\u8DB9\u8DBB\u8DC0\u8DC5\u8DC6\u8DC7\u8DC8\u8DCA\u8DCE\u8DD1\u8DD4\u8DD5\u8DD7\u8DD9\u8DE4\u8DE5\u8DE7\u8DEC\u8DF0\u8DBC\u8DF1\u8DF2\u8DF4\u8DFD\u8E01\u8E04\u8E05\u8E06\u8E0B\u8E11\u8E14\u8E16\u8E20\u8E21\u8E22"],
      ["8fe0a1", "\u8E23\u8E26\u8E27\u8E31\u8E33\u8E36\u8E37\u8E38\u8E39\u8E3D\u8E40\u8E41\u8E4B\u8E4D\u8E4E\u8E4F\u8E54\u8E5B\u8E5C\u8E5D\u8E5E\u8E61\u8E62\u8E69\u8E6C\u8E6D\u8E6F\u8E70\u8E71\u8E79\u8E7A\u8E7B\u8E82\u8E83\u8E89\u8E90\u8E92\u8E95\u8E9A\u8E9B\u8E9D\u8E9E\u8EA2\u8EA7\u8EA9\u8EAD\u8EAE\u8EB3\u8EB5\u8EBA\u8EBB\u8EC0\u8EC1\u8EC3\u8EC4\u8EC7\u8ECF\u8ED1\u8ED4\u8EDC\u8EE8\u8EEE\u8EF0\u8EF1\u8EF7\u8EF9\u8EFA\u8EED\u8F00\u8F02\u8F07\u8F08\u8F0F\u8F10\u8F16\u8F17\u8F18\u8F1E\u8F20\u8F21\u8F23\u8F25\u8F27\u8F28\u8F2C\u8F2D\u8F2E\u8F34\u8F35\u8F36\u8F37\u8F3A\u8F40\u8F41"],
      ["8fe1a1", "\u8F43\u8F47\u8F4F\u8F51", 4, "\u8F58\u8F5D\u8F5E\u8F65\u8F9D\u8FA0\u8FA1\u8FA4\u8FA5\u8FA6\u8FB5\u8FB6\u8FB8\u8FBE\u8FC0\u8FC1\u8FC6\u8FCA\u8FCB\u8FCD\u8FD0\u8FD2\u8FD3\u8FD5\u8FE0\u8FE3\u8FE4\u8FE8\u8FEE\u8FF1\u8FF5\u8FF6\u8FFB\u8FFE\u9002\u9004\u9008\u900C\u9018\u901B\u9028\u9029\u902F\u902A\u902C\u902D\u9033\u9034\u9037\u903F\u9043\u9044\u904C\u905B\u905D\u9062\u9066\u9067\u906C\u9070\u9074\u9079\u9085\u9088\u908B\u908C\u908E\u9090\u9095\u9097\u9098\u9099\u909B\u90A0\u90A1\u90A2\u90A5\u90B0\u90B2\u90B3\u90B4\u90B6\u90BD\u90CC\u90BE\u90C3"],
      ["8fe2a1", "\u90C4\u90C5\u90C7\u90C8\u90D5\u90D7\u90D8\u90D9\u90DC\u90DD\u90DF\u90E5\u90D2\u90F6\u90EB\u90EF\u90F0\u90F4\u90FE\u90FF\u9100\u9104\u9105\u9106\u9108\u910D\u9110\u9114\u9116\u9117\u9118\u911A\u911C\u911E\u9120\u9125\u9122\u9123\u9127\u9129\u912E\u912F\u9131\u9134\u9136\u9137\u9139\u913A\u913C\u913D\u9143\u9147\u9148\u914F\u9153\u9157\u9159\u915A\u915B\u9161\u9164\u9167\u916D\u9174\u9179\u917A\u917B\u9181\u9183\u9185\u9186\u918A\u918E\u9191\u9193\u9194\u9195\u9198\u919E\u91A1\u91A6\u91A8\u91AC\u91AD\u91AE\u91B0\u91B1\u91B2\u91B3\u91B6\u91BB\u91BC\u91BD\u91BF"],
      ["8fe3a1", "\u91C2\u91C3\u91C5\u91D3\u91D4\u91D7\u91D9\u91DA\u91DE\u91E4\u91E5\u91E9\u91EA\u91EC", 5, "\u91F7\u91F9\u91FB\u91FD\u9200\u9201\u9204\u9205\u9206\u9207\u9209\u920A\u920C\u9210\u9212\u9213\u9216\u9218\u921C\u921D\u9223\u9224\u9225\u9226\u9228\u922E\u922F\u9230\u9233\u9235\u9236\u9238\u9239\u923A\u923C\u923E\u9240\u9242\u9243\u9246\u9247\u924A\u924D\u924E\u924F\u9251\u9258\u9259\u925C\u925D\u9260\u9261\u9265\u9267\u9268\u9269\u926E\u926F\u9270\u9275", 4, "\u927B\u927C\u927D\u927F\u9288\u9289\u928A\u928D\u928E\u9292\u9297"],
      ["8fe4a1", "\u9299\u929F\u92A0\u92A4\u92A5\u92A7\u92A8\u92AB\u92AF\u92B2\u92B6\u92B8\u92BA\u92BB\u92BC\u92BD\u92BF", 4, "\u92C5\u92C6\u92C7\u92C8\u92CB\u92CC\u92CD\u92CE\u92D0\u92D3\u92D5\u92D7\u92D8\u92D9\u92DC\u92DD\u92DF\u92E0\u92E1\u92E3\u92E5\u92E7\u92E8\u92EC\u92EE\u92F0\u92F9\u92FB\u92FF\u9300\u9302\u9308\u930D\u9311\u9314\u9315\u931C\u931D\u931E\u931F\u9321\u9324\u9325\u9327\u9329\u932A\u9333\u9334\u9336\u9337\u9347\u9348\u9349\u9350\u9351\u9352\u9355\u9357\u9358\u935A\u935E\u9364\u9365\u9367\u9369\u936A\u936D\u936F\u9370\u9371\u9373\u9374\u9376"],
      ["8fe5a1", "\u937A\u937D\u937F\u9380\u9381\u9382\u9388\u938A\u938B\u938D\u938F\u9392\u9395\u9398\u939B\u939E\u93A1\u93A3\u93A4\u93A6\u93A8\u93AB\u93B4\u93B5\u93B6\u93BA\u93A9\u93C1\u93C4\u93C5\u93C6\u93C7\u93C9", 4, "\u93D3\u93D9\u93DC\u93DE\u93DF\u93E2\u93E6\u93E7\u93F9\u93F7\u93F8\u93FA\u93FB\u93FD\u9401\u9402\u9404\u9408\u9409\u940D\u940E\u940F\u9415\u9416\u9417\u941F\u942E\u942F\u9431\u9432\u9433\u9434\u943B\u943F\u943D\u9443\u9445\u9448\u944A\u944C\u9455\u9459\u945C\u945F\u9461\u9463\u9468\u946B\u946D\u946E\u946F\u9471\u9472\u9484\u9483\u9578\u9579"],
      ["8fe6a1", "\u957E\u9584\u9588\u958C\u958D\u958E\u959D\u959E\u959F\u95A1\u95A6\u95A9\u95AB\u95AC\u95B4\u95B6\u95BA\u95BD\u95BF\u95C6\u95C8\u95C9\u95CB\u95D0\u95D1\u95D2\u95D3\u95D9\u95DA\u95DD\u95DE\u95DF\u95E0\u95E4\u95E6\u961D\u961E\u9622\u9624\u9625\u9626\u962C\u9631\u9633\u9637\u9638\u9639\u963A\u963C\u963D\u9641\u9652\u9654\u9656\u9657\u9658\u9661\u966E\u9674\u967B\u967C\u967E\u967F\u9681\u9682\u9683\u9684\u9689\u9691\u9696\u969A\u969D\u969F\u96A4\u96A5\u96A6\u96A9\u96AE\u96AF\u96B3\u96BA\u96CA\u96D2\u5DB2\u96D8\u96DA\u96DD\u96DE\u96DF\u96E9\u96EF\u96F1\u96FA\u9702"],
      ["8fe7a1", "\u9703\u9705\u9709\u971A\u971B\u971D\u9721\u9722\u9723\u9728\u9731\u9733\u9741\u9743\u974A\u974E\u974F\u9755\u9757\u9758\u975A\u975B\u9763\u9767\u976A\u976E\u9773\u9776\u9777\u9778\u977B\u977D\u977F\u9780\u9789\u9795\u9796\u9797\u9799\u979A\u979E\u979F\u97A2\u97AC\u97AE\u97B1\u97B2\u97B5\u97B6\u97B8\u97B9\u97BA\u97BC\u97BE\u97BF\u97C1\u97C4\u97C5\u97C7\u97C9\u97CA\u97CC\u97CD\u97CE\u97D0\u97D1\u97D4\u97D7\u97D8\u97D9\u97DD\u97DE\u97E0\u97DB\u97E1\u97E4\u97EF\u97F1\u97F4\u97F7\u97F8\u97FA\u9807\u980A\u9819\u980D\u980E\u9814\u9816\u981C\u981E\u9820\u9823\u9826"],
      ["8fe8a1", "\u982B\u982E\u982F\u9830\u9832\u9833\u9835\u9825\u983E\u9844\u9847\u984A\u9851\u9852\u9853\u9856\u9857\u9859\u985A\u9862\u9863\u9865\u9866\u986A\u986C\u98AB\u98AD\u98AE\u98B0\u98B4\u98B7\u98B8\u98BA\u98BB\u98BF\u98C2\u98C5\u98C8\u98CC\u98E1\u98E3\u98E5\u98E6\u98E7\u98EA\u98F3\u98F6\u9902\u9907\u9908\u9911\u9915\u9916\u9917\u991A\u991B\u991C\u991F\u9922\u9926\u9927\u992B\u9931", 4, "\u9939\u993A\u993B\u993C\u9940\u9941\u9946\u9947\u9948\u994D\u994E\u9954\u9958\u9959\u995B\u995C\u995E\u995F\u9960\u999B\u999D\u999F\u99A6\u99B0\u99B1\u99B2\u99B5"],
      ["8fe9a1", "\u99B9\u99BA\u99BD\u99BF\u99C3\u99C9\u99D3\u99D4\u99D9\u99DA\u99DC\u99DE\u99E7\u99EA\u99EB\u99EC\u99F0\u99F4\u99F5\u99F9\u99FD\u99FE\u9A02\u9A03\u9A04\u9A0B\u9A0C\u9A10\u9A11\u9A16\u9A1E\u9A20\u9A22\u9A23\u9A24\u9A27\u9A2D\u9A2E\u9A33\u9A35\u9A36\u9A38\u9A47\u9A41\u9A44\u9A4A\u9A4B\u9A4C\u9A4E\u9A51\u9A54\u9A56\u9A5D\u9AAA\u9AAC\u9AAE\u9AAF\u9AB2\u9AB4\u9AB5\u9AB6\u9AB9\u9ABB\u9ABE\u9ABF\u9AC1\u9AC3\u9AC6\u9AC8\u9ACE\u9AD0\u9AD2\u9AD5\u9AD6\u9AD7\u9ADB\u9ADC\u9AE0\u9AE4\u9AE5\u9AE7\u9AE9\u9AEC\u9AF2\u9AF3\u9AF5\u9AF9\u9AFA\u9AFD\u9AFF", 4],
      ["8feaa1", "\u9B04\u9B05\u9B08\u9B09\u9B0B\u9B0C\u9B0D\u9B0E\u9B10\u9B12\u9B16\u9B19\u9B1B\u9B1C\u9B20\u9B26\u9B2B\u9B2D\u9B33\u9B34\u9B35\u9B37\u9B39\u9B3A\u9B3D\u9B48\u9B4B\u9B4C\u9B55\u9B56\u9B57\u9B5B\u9B5E\u9B61\u9B63\u9B65\u9B66\u9B68\u9B6A", 4, "\u9B73\u9B75\u9B77\u9B78\u9B79\u9B7F\u9B80\u9B84\u9B85\u9B86\u9B87\u9B89\u9B8A\u9B8B\u9B8D\u9B8F\u9B90\u9B94\u9B9A\u9B9D\u9B9E\u9BA6\u9BA7\u9BA9\u9BAC\u9BB0\u9BB1\u9BB2\u9BB7\u9BB8\u9BBB\u9BBC\u9BBE\u9BBF\u9BC1\u9BC7\u9BC8\u9BCE\u9BD0\u9BD7\u9BD8\u9BDD\u9BDF\u9BE5\u9BE7\u9BEA\u9BEB\u9BEF\u9BF3\u9BF7\u9BF8"],
      ["8feba1", "\u9BF9\u9BFA\u9BFD\u9BFF\u9C00\u9C02\u9C0B\u9C0F\u9C11\u9C16\u9C18\u9C19\u9C1A\u9C1C\u9C1E\u9C22\u9C23\u9C26", 4, "\u9C31\u9C35\u9C36\u9C37\u9C3D\u9C41\u9C43\u9C44\u9C45\u9C49\u9C4A\u9C4E\u9C4F\u9C50\u9C53\u9C54\u9C56\u9C58\u9C5B\u9C5D\u9C5E\u9C5F\u9C63\u9C69\u9C6A\u9C5C\u9C6B\u9C68\u9C6E\u9C70\u9C72\u9C75\u9C77\u9C7B\u9CE6\u9CF2\u9CF7\u9CF9\u9D0B\u9D02\u9D11\u9D17\u9D18\u9D1C\u9D1D\u9D1E\u9D2F\u9D30\u9D32\u9D33\u9D34\u9D3A\u9D3C\u9D45\u9D3D\u9D42\u9D43\u9D47\u9D4A\u9D53\u9D54\u9D5F\u9D63\u9D62\u9D65\u9D69\u9D6A\u9D6B\u9D70\u9D76\u9D77\u9D7B"],
      ["8feca1", "\u9D7C\u9D7E\u9D83\u9D84\u9D86\u9D8A\u9D8D\u9D8E\u9D92\u9D93\u9D95\u9D96\u9D97\u9D98\u9DA1\u9DAA\u9DAC\u9DAE\u9DB1\u9DB5\u9DB9\u9DBC\u9DBF\u9DC3\u9DC7\u9DC9\u9DCA\u9DD4\u9DD5\u9DD6\u9DD7\u9DDA\u9DDE\u9DDF\u9DE0\u9DE5\u9DE7\u9DE9\u9DEB\u9DEE\u9DF0\u9DF3\u9DF4\u9DFE\u9E0A\u9E02\u9E07\u9E0E\u9E10\u9E11\u9E12\u9E15\u9E16\u9E19\u9E1C\u9E1D\u9E7A\u9E7B\u9E7C\u9E80\u9E82\u9E83\u9E84\u9E85\u9E87\u9E8E\u9E8F\u9E96\u9E98\u9E9B\u9E9E\u9EA4\u9EA8\u9EAC\u9EAE\u9EAF\u9EB0\u9EB3\u9EB4\u9EB5\u9EC6\u9EC8\u9ECB\u9ED5\u9EDF\u9EE4\u9EE7\u9EEC\u9EED\u9EEE\u9EF0\u9EF1\u9EF2\u9EF5"],
      ["8feda1", "\u9EF8\u9EFF\u9F02\u9F03\u9F09\u9F0F\u9F10\u9F11\u9F12\u9F14\u9F16\u9F17\u9F19\u9F1A\u9F1B\u9F1F\u9F22\u9F26\u9F2A\u9F2B\u9F2F\u9F31\u9F32\u9F34\u9F37\u9F39\u9F3A\u9F3C\u9F3D\u9F3F\u9F41\u9F43", 4, "\u9F53\u9F55\u9F56\u9F57\u9F58\u9F5A\u9F5D\u9F5E\u9F68\u9F69\u9F6D", 4, "\u9F73\u9F75\u9F7A\u9F7D\u9F8F\u9F90\u9F91\u9F92\u9F94\u9F96\u9F97\u9F9E\u9FA1\u9FA2\u9FA3\u9FA5"]
    ];
  }
});

// ../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/tables/cp936.json
var require_cp936 = __commonJS({
  "../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/tables/cp936.json"(exports, module2) {
    module2.exports = [
      ["0", "\0", 127, "\u20AC"],
      ["8140", "\u4E02\u4E04\u4E05\u4E06\u4E0F\u4E12\u4E17\u4E1F\u4E20\u4E21\u4E23\u4E26\u4E29\u4E2E\u4E2F\u4E31\u4E33\u4E35\u4E37\u4E3C\u4E40\u4E41\u4E42\u4E44\u4E46\u4E4A\u4E51\u4E55\u4E57\u4E5A\u4E5B\u4E62\u4E63\u4E64\u4E65\u4E67\u4E68\u4E6A", 5, "\u4E72\u4E74", 9, "\u4E7F", 6, "\u4E87\u4E8A"],
      ["8180", "\u4E90\u4E96\u4E97\u4E99\u4E9C\u4E9D\u4E9E\u4EA3\u4EAA\u4EAF\u4EB0\u4EB1\u4EB4\u4EB6\u4EB7\u4EB8\u4EB9\u4EBC\u4EBD\u4EBE\u4EC8\u4ECC\u4ECF\u4ED0\u4ED2\u4EDA\u4EDB\u4EDC\u4EE0\u4EE2\u4EE6\u4EE7\u4EE9\u4EED\u4EEE\u4EEF\u4EF1\u4EF4\u4EF8\u4EF9\u4EFA\u4EFC\u4EFE\u4F00\u4F02", 6, "\u4F0B\u4F0C\u4F12", 4, "\u4F1C\u4F1D\u4F21\u4F23\u4F28\u4F29\u4F2C\u4F2D\u4F2E\u4F31\u4F33\u4F35\u4F37\u4F39\u4F3B\u4F3E", 4, "\u4F44\u4F45\u4F47", 5, "\u4F52\u4F54\u4F56\u4F61\u4F62\u4F66\u4F68\u4F6A\u4F6B\u4F6D\u4F6E\u4F71\u4F72\u4F75\u4F77\u4F78\u4F79\u4F7A\u4F7D\u4F80\u4F81\u4F82\u4F85\u4F86\u4F87\u4F8A\u4F8C\u4F8E\u4F90\u4F92\u4F93\u4F95\u4F96\u4F98\u4F99\u4F9A\u4F9C\u4F9E\u4F9F\u4FA1\u4FA2"],
      ["8240", "\u4FA4\u4FAB\u4FAD\u4FB0", 4, "\u4FB6", 8, "\u4FC0\u4FC1\u4FC2\u4FC6\u4FC7\u4FC8\u4FC9\u4FCB\u4FCC\u4FCD\u4FD2", 4, "\u4FD9\u4FDB\u4FE0\u4FE2\u4FE4\u4FE5\u4FE7\u4FEB\u4FEC\u4FF0\u4FF2\u4FF4\u4FF5\u4FF6\u4FF7\u4FF9\u4FFB\u4FFC\u4FFD\u4FFF", 11],
      ["8280", "\u500B\u500E\u5010\u5011\u5013\u5015\u5016\u5017\u501B\u501D\u501E\u5020\u5022\u5023\u5024\u5027\u502B\u502F", 10, "\u503B\u503D\u503F\u5040\u5041\u5042\u5044\u5045\u5046\u5049\u504A\u504B\u504D\u5050", 4, "\u5056\u5057\u5058\u5059\u505B\u505D", 7, "\u5066", 5, "\u506D", 8, "\u5078\u5079\u507A\u507C\u507D\u5081\u5082\u5083\u5084\u5086\u5087\u5089\u508A\u508B\u508C\u508E", 20, "\u50A4\u50A6\u50AA\u50AB\u50AD", 4, "\u50B3", 6, "\u50BC"],
      ["8340", "\u50BD", 17, "\u50D0", 5, "\u50D7\u50D8\u50D9\u50DB", 10, "\u50E8\u50E9\u50EA\u50EB\u50EF\u50F0\u50F1\u50F2\u50F4\u50F6", 4, "\u50FC", 9, "\u5108"],
      ["8380", "\u5109\u510A\u510C", 5, "\u5113", 13, "\u5122", 28, "\u5142\u5147\u514A\u514C\u514E\u514F\u5150\u5152\u5153\u5157\u5158\u5159\u515B\u515D", 4, "\u5163\u5164\u5166\u5167\u5169\u516A\u516F\u5172\u517A\u517E\u517F\u5183\u5184\u5186\u5187\u518A\u518B\u518E\u518F\u5190\u5191\u5193\u5194\u5198\u519A\u519D\u519E\u519F\u51A1\u51A3\u51A6", 4, "\u51AD\u51AE\u51B4\u51B8\u51B9\u51BA\u51BE\u51BF\u51C1\u51C2\u51C3\u51C5\u51C8\u51CA\u51CD\u51CE\u51D0\u51D2", 5],
      ["8440", "\u51D8\u51D9\u51DA\u51DC\u51DE\u51DF\u51E2\u51E3\u51E5", 5, "\u51EC\u51EE\u51F1\u51F2\u51F4\u51F7\u51FE\u5204\u5205\u5209\u520B\u520C\u520F\u5210\u5213\u5214\u5215\u521C\u521E\u521F\u5221\u5222\u5223\u5225\u5226\u5227\u522A\u522C\u522F\u5231\u5232\u5234\u5235\u523C\u523E\u5244", 5, "\u524B\u524E\u524F\u5252\u5253\u5255\u5257\u5258"],
      ["8480", "\u5259\u525A\u525B\u525D\u525F\u5260\u5262\u5263\u5264\u5266\u5268\u526B\u526C\u526D\u526E\u5270\u5271\u5273", 9, "\u527E\u5280\u5283", 4, "\u5289", 6, "\u5291\u5292\u5294", 6, "\u529C\u52A4\u52A5\u52A6\u52A7\u52AE\u52AF\u52B0\u52B4", 9, "\u52C0\u52C1\u52C2\u52C4\u52C5\u52C6\u52C8\u52CA\u52CC\u52CD\u52CE\u52CF\u52D1\u52D3\u52D4\u52D5\u52D7\u52D9", 5, "\u52E0\u52E1\u52E2\u52E3\u52E5", 10, "\u52F1", 7, "\u52FB\u52FC\u52FD\u5301\u5302\u5303\u5304\u5307\u5309\u530A\u530B\u530C\u530E"],
      ["8540", "\u5311\u5312\u5313\u5314\u5318\u531B\u531C\u531E\u531F\u5322\u5324\u5325\u5327\u5328\u5329\u532B\u532C\u532D\u532F", 9, "\u533C\u533D\u5340\u5342\u5344\u5346\u534B\u534C\u534D\u5350\u5354\u5358\u5359\u535B\u535D\u5365\u5368\u536A\u536C\u536D\u5372\u5376\u5379\u537B\u537C\u537D\u537E\u5380\u5381\u5383\u5387\u5388\u538A\u538E\u538F"],
      ["8580", "\u5390", 4, "\u5396\u5397\u5399\u539B\u539C\u539E\u53A0\u53A1\u53A4\u53A7\u53AA\u53AB\u53AC\u53AD\u53AF", 6, "\u53B7\u53B8\u53B9\u53BA\u53BC\u53BD\u53BE\u53C0\u53C3", 4, "\u53CE\u53CF\u53D0\u53D2\u53D3\u53D5\u53DA\u53DC\u53DD\u53DE\u53E1\u53E2\u53E7\u53F4\u53FA\u53FE\u53FF\u5400\u5402\u5405\u5407\u540B\u5414\u5418\u5419\u541A\u541C\u5422\u5424\u5425\u542A\u5430\u5433\u5436\u5437\u543A\u543D\u543F\u5441\u5442\u5444\u5445\u5447\u5449\u544C\u544D\u544E\u544F\u5451\u545A\u545D", 4, "\u5463\u5465\u5467\u5469", 7, "\u5474\u5479\u547A\u547E\u547F\u5481\u5483\u5485\u5487\u5488\u5489\u548A\u548D\u5491\u5493\u5497\u5498\u549C\u549E\u549F\u54A0\u54A1"],
      ["8640", "\u54A2\u54A5\u54AE\u54B0\u54B2\u54B5\u54B6\u54B7\u54B9\u54BA\u54BC\u54BE\u54C3\u54C5\u54CA\u54CB\u54D6\u54D8\u54DB\u54E0", 4, "\u54EB\u54EC\u54EF\u54F0\u54F1\u54F4", 5, "\u54FB\u54FE\u5500\u5502\u5503\u5504\u5505\u5508\u550A", 4, "\u5512\u5513\u5515", 5, "\u551C\u551D\u551E\u551F\u5521\u5525\u5526"],
      ["8680", "\u5528\u5529\u552B\u552D\u5532\u5534\u5535\u5536\u5538\u5539\u553A\u553B\u553D\u5540\u5542\u5545\u5547\u5548\u554B", 4, "\u5551\u5552\u5553\u5554\u5557", 4, "\u555D\u555E\u555F\u5560\u5562\u5563\u5568\u5569\u556B\u556F", 5, "\u5579\u557A\u557D\u557F\u5585\u5586\u558C\u558D\u558E\u5590\u5592\u5593\u5595\u5596\u5597\u559A\u559B\u559E\u55A0", 6, "\u55A8", 8, "\u55B2\u55B4\u55B6\u55B8\u55BA\u55BC\u55BF", 4, "\u55C6\u55C7\u55C8\u55CA\u55CB\u55CE\u55CF\u55D0\u55D5\u55D7", 4, "\u55DE\u55E0\u55E2\u55E7\u55E9\u55ED\u55EE\u55F0\u55F1\u55F4\u55F6\u55F8", 4, "\u55FF\u5602\u5603\u5604\u5605"],
      ["8740", "\u5606\u5607\u560A\u560B\u560D\u5610", 7, "\u5619\u561A\u561C\u561D\u5620\u5621\u5622\u5625\u5626\u5628\u5629\u562A\u562B\u562E\u562F\u5630\u5633\u5635\u5637\u5638\u563A\u563C\u563D\u563E\u5640", 11, "\u564F", 4, "\u5655\u5656\u565A\u565B\u565D", 4],
      ["8780", "\u5663\u5665\u5666\u5667\u566D\u566E\u566F\u5670\u5672\u5673\u5674\u5675\u5677\u5678\u5679\u567A\u567D", 7, "\u5687", 6, "\u5690\u5691\u5692\u5694", 14, "\u56A4", 10, "\u56B0", 6, "\u56B8\u56B9\u56BA\u56BB\u56BD", 12, "\u56CB", 8, "\u56D5\u56D6\u56D8\u56D9\u56DC\u56E3\u56E5", 5, "\u56EC\u56EE\u56EF\u56F2\u56F3\u56F6\u56F7\u56F8\u56FB\u56FC\u5700\u5701\u5702\u5705\u5707\u570B", 6],
      ["8840", "\u5712", 9, "\u571D\u571E\u5720\u5721\u5722\u5724\u5725\u5726\u5727\u572B\u5731\u5732\u5734", 4, "\u573C\u573D\u573F\u5741\u5743\u5744\u5745\u5746\u5748\u5749\u574B\u5752", 4, "\u5758\u5759\u5762\u5763\u5765\u5767\u576C\u576E\u5770\u5771\u5772\u5774\u5775\u5778\u5779\u577A\u577D\u577E\u577F\u5780"],
      ["8880", "\u5781\u5787\u5788\u5789\u578A\u578D", 4, "\u5794", 6, "\u579C\u579D\u579E\u579F\u57A5\u57A8\u57AA\u57AC\u57AF\u57B0\u57B1\u57B3\u57B5\u57B6\u57B7\u57B9", 8, "\u57C4", 6, "\u57CC\u57CD\u57D0\u57D1\u57D3\u57D6\u57D7\u57DB\u57DC\u57DE\u57E1\u57E2\u57E3\u57E5", 7, "\u57EE\u57F0\u57F1\u57F2\u57F3\u57F5\u57F6\u57F7\u57FB\u57FC\u57FE\u57FF\u5801\u5803\u5804\u5805\u5808\u5809\u580A\u580C\u580E\u580F\u5810\u5812\u5813\u5814\u5816\u5817\u5818\u581A\u581B\u581C\u581D\u581F\u5822\u5823\u5825", 4, "\u582B", 4, "\u5831\u5832\u5833\u5834\u5836", 7],
      ["8940", "\u583E", 5, "\u5845", 6, "\u584E\u584F\u5850\u5852\u5853\u5855\u5856\u5857\u5859", 4, "\u585F", 5, "\u5866", 4, "\u586D", 16, "\u587F\u5882\u5884\u5886\u5887\u5888\u588A\u588B\u588C"],
      ["8980", "\u588D", 4, "\u5894", 4, "\u589B\u589C\u589D\u58A0", 7, "\u58AA", 17, "\u58BD\u58BE\u58BF\u58C0\u58C2\u58C3\u58C4\u58C6", 10, "\u58D2\u58D3\u58D4\u58D6", 13, "\u58E5", 5, "\u58ED\u58EF\u58F1\u58F2\u58F4\u58F5\u58F7\u58F8\u58FA", 7, "\u5903\u5905\u5906\u5908", 4, "\u590E\u5910\u5911\u5912\u5913\u5917\u5918\u591B\u591D\u591E\u5920\u5921\u5922\u5923\u5926\u5928\u592C\u5930\u5932\u5933\u5935\u5936\u593B"],
      ["8a40", "\u593D\u593E\u593F\u5940\u5943\u5945\u5946\u594A\u594C\u594D\u5950\u5952\u5953\u5959\u595B", 4, "\u5961\u5963\u5964\u5966", 12, "\u5975\u5977\u597A\u597B\u597C\u597E\u597F\u5980\u5985\u5989\u598B\u598C\u598E\u598F\u5990\u5991\u5994\u5995\u5998\u599A\u599B\u599C\u599D\u599F\u59A0\u59A1\u59A2\u59A6"],
      ["8a80", "\u59A7\u59AC\u59AD\u59B0\u59B1\u59B3", 5, "\u59BA\u59BC\u59BD\u59BF", 6, "\u59C7\u59C8\u59C9\u59CC\u59CD\u59CE\u59CF\u59D5\u59D6\u59D9\u59DB\u59DE", 4, "\u59E4\u59E6\u59E7\u59E9\u59EA\u59EB\u59ED", 11, "\u59FA\u59FC\u59FD\u59FE\u5A00\u5A02\u5A0A\u5A0B\u5A0D\u5A0E\u5A0F\u5A10\u5A12\u5A14\u5A15\u5A16\u5A17\u5A19\u5A1A\u5A1B\u5A1D\u5A1E\u5A21\u5A22\u5A24\u5A26\u5A27\u5A28\u5A2A", 6, "\u5A33\u5A35\u5A37", 4, "\u5A3D\u5A3E\u5A3F\u5A41", 4, "\u5A47\u5A48\u5A4B", 9, "\u5A56\u5A57\u5A58\u5A59\u5A5B", 5],
      ["8b40", "\u5A61\u5A63\u5A64\u5A65\u5A66\u5A68\u5A69\u5A6B", 8, "\u5A78\u5A79\u5A7B\u5A7C\u5A7D\u5A7E\u5A80", 17, "\u5A93", 6, "\u5A9C", 13, "\u5AAB\u5AAC"],
      ["8b80", "\u5AAD", 4, "\u5AB4\u5AB6\u5AB7\u5AB9", 4, "\u5ABF\u5AC0\u5AC3", 5, "\u5ACA\u5ACB\u5ACD", 4, "\u5AD3\u5AD5\u5AD7\u5AD9\u5ADA\u5ADB\u5ADD\u5ADE\u5ADF\u5AE2\u5AE4\u5AE5\u5AE7\u5AE8\u5AEA\u5AEC", 4, "\u5AF2", 22, "\u5B0A", 11, "\u5B18", 25, "\u5B33\u5B35\u5B36\u5B38", 7, "\u5B41", 6],
      ["8c40", "\u5B48", 7, "\u5B52\u5B56\u5B5E\u5B60\u5B61\u5B67\u5B68\u5B6B\u5B6D\u5B6E\u5B6F\u5B72\u5B74\u5B76\u5B77\u5B78\u5B79\u5B7B\u5B7C\u5B7E\u5B7F\u5B82\u5B86\u5B8A\u5B8D\u5B8E\u5B90\u5B91\u5B92\u5B94\u5B96\u5B9F\u5BA7\u5BA8\u5BA9\u5BAC\u5BAD\u5BAE\u5BAF\u5BB1\u5BB2\u5BB7\u5BBA\u5BBB\u5BBC\u5BC0\u5BC1\u5BC3\u5BC8\u5BC9\u5BCA\u5BCB\u5BCD\u5BCE\u5BCF"],
      ["8c80", "\u5BD1\u5BD4", 8, "\u5BE0\u5BE2\u5BE3\u5BE6\u5BE7\u5BE9", 4, "\u5BEF\u5BF1", 6, "\u5BFD\u5BFE\u5C00\u5C02\u5C03\u5C05\u5C07\u5C08\u5C0B\u5C0C\u5C0D\u5C0E\u5C10\u5C12\u5C13\u5C17\u5C19\u5C1B\u5C1E\u5C1F\u5C20\u5C21\u5C23\u5C26\u5C28\u5C29\u5C2A\u5C2B\u5C2D\u5C2E\u5C2F\u5C30\u5C32\u5C33\u5C35\u5C36\u5C37\u5C43\u5C44\u5C46\u5C47\u5C4C\u5C4D\u5C52\u5C53\u5C54\u5C56\u5C57\u5C58\u5C5A\u5C5B\u5C5C\u5C5D\u5C5F\u5C62\u5C64\u5C67", 6, "\u5C70\u5C72", 6, "\u5C7B\u5C7C\u5C7D\u5C7E\u5C80\u5C83", 4, "\u5C89\u5C8A\u5C8B\u5C8E\u5C8F\u5C92\u5C93\u5C95\u5C9D", 4, "\u5CA4", 4],
      ["8d40", "\u5CAA\u5CAE\u5CAF\u5CB0\u5CB2\u5CB4\u5CB6\u5CB9\u5CBA\u5CBB\u5CBC\u5CBE\u5CC0\u5CC2\u5CC3\u5CC5", 5, "\u5CCC", 5, "\u5CD3", 5, "\u5CDA", 6, "\u5CE2\u5CE3\u5CE7\u5CE9\u5CEB\u5CEC\u5CEE\u5CEF\u5CF1", 9, "\u5CFC", 4],
      ["8d80", "\u5D01\u5D04\u5D05\u5D08", 5, "\u5D0F", 4, "\u5D15\u5D17\u5D18\u5D19\u5D1A\u5D1C\u5D1D\u5D1F", 4, "\u5D25\u5D28\u5D2A\u5D2B\u5D2C\u5D2F", 4, "\u5D35", 7, "\u5D3F", 7, "\u5D48\u5D49\u5D4D", 10, "\u5D59\u5D5A\u5D5C\u5D5E", 10, "\u5D6A\u5D6D\u5D6E\u5D70\u5D71\u5D72\u5D73\u5D75", 12, "\u5D83", 21, "\u5D9A\u5D9B\u5D9C\u5D9E\u5D9F\u5DA0"],
      ["8e40", "\u5DA1", 21, "\u5DB8", 12, "\u5DC6", 6, "\u5DCE", 12, "\u5DDC\u5DDF\u5DE0\u5DE3\u5DE4\u5DEA\u5DEC\u5DED"],
      ["8e80", "\u5DF0\u5DF5\u5DF6\u5DF8", 4, "\u5DFF\u5E00\u5E04\u5E07\u5E09\u5E0A\u5E0B\u5E0D\u5E0E\u5E12\u5E13\u5E17\u5E1E", 7, "\u5E28", 4, "\u5E2F\u5E30\u5E32", 4, "\u5E39\u5E3A\u5E3E\u5E3F\u5E40\u5E41\u5E43\u5E46", 5, "\u5E4D", 6, "\u5E56", 4, "\u5E5C\u5E5D\u5E5F\u5E60\u5E63", 14, "\u5E75\u5E77\u5E79\u5E7E\u5E81\u5E82\u5E83\u5E85\u5E88\u5E89\u5E8C\u5E8D\u5E8E\u5E92\u5E98\u5E9B\u5E9D\u5EA1\u5EA2\u5EA3\u5EA4\u5EA8", 4, "\u5EAE", 4, "\u5EB4\u5EBA\u5EBB\u5EBC\u5EBD\u5EBF", 6],
      ["8f40", "\u5EC6\u5EC7\u5EC8\u5ECB", 5, "\u5ED4\u5ED5\u5ED7\u5ED8\u5ED9\u5EDA\u5EDC", 11, "\u5EE9\u5EEB", 8, "\u5EF5\u5EF8\u5EF9\u5EFB\u5EFC\u5EFD\u5F05\u5F06\u5F07\u5F09\u5F0C\u5F0D\u5F0E\u5F10\u5F12\u5F14\u5F16\u5F19\u5F1A\u5F1C\u5F1D\u5F1E\u5F21\u5F22\u5F23\u5F24"],
      ["8f80", "\u5F28\u5F2B\u5F2C\u5F2E\u5F30\u5F32", 6, "\u5F3B\u5F3D\u5F3E\u5F3F\u5F41", 14, "\u5F51\u5F54\u5F59\u5F5A\u5F5B\u5F5C\u5F5E\u5F5F\u5F60\u5F63\u5F65\u5F67\u5F68\u5F6B\u5F6E\u5F6F\u5F72\u5F74\u5F75\u5F76\u5F78\u5F7A\u5F7D\u5F7E\u5F7F\u5F83\u5F86\u5F8D\u5F8E\u5F8F\u5F91\u5F93\u5F94\u5F96\u5F9A\u5F9B\u5F9D\u5F9E\u5F9F\u5FA0\u5FA2", 5, "\u5FA9\u5FAB\u5FAC\u5FAF", 5, "\u5FB6\u5FB8\u5FB9\u5FBA\u5FBB\u5FBE", 4, "\u5FC7\u5FC8\u5FCA\u5FCB\u5FCE\u5FD3\u5FD4\u5FD5\u5FDA\u5FDB\u5FDC\u5FDE\u5FDF\u5FE2\u5FE3\u5FE5\u5FE6\u5FE8\u5FE9\u5FEC\u5FEF\u5FF0\u5FF2\u5FF3\u5FF4\u5FF6\u5FF7\u5FF9\u5FFA\u5FFC\u6007"],
      ["9040", "\u6008\u6009\u600B\u600C\u6010\u6011\u6013\u6017\u6018\u601A\u601E\u601F\u6022\u6023\u6024\u602C\u602D\u602E\u6030", 4, "\u6036", 4, "\u603D\u603E\u6040\u6044", 6, "\u604C\u604E\u604F\u6051\u6053\u6054\u6056\u6057\u6058\u605B\u605C\u605E\u605F\u6060\u6061\u6065\u6066\u606E\u6071\u6072\u6074\u6075\u6077\u607E\u6080"],
      ["9080", "\u6081\u6082\u6085\u6086\u6087\u6088\u608A\u608B\u608E\u608F\u6090\u6091\u6093\u6095\u6097\u6098\u6099\u609C\u609E\u60A1\u60A2\u60A4\u60A5\u60A7\u60A9\u60AA\u60AE\u60B0\u60B3\u60B5\u60B6\u60B7\u60B9\u60BA\u60BD", 7, "\u60C7\u60C8\u60C9\u60CC", 4, "\u60D2\u60D3\u60D4\u60D6\u60D7\u60D9\u60DB\u60DE\u60E1", 4, "\u60EA\u60F1\u60F2\u60F5\u60F7\u60F8\u60FB", 4, "\u6102\u6103\u6104\u6105\u6107\u610A\u610B\u610C\u6110", 4, "\u6116\u6117\u6118\u6119\u611B\u611C\u611D\u611E\u6121\u6122\u6125\u6128\u6129\u612A\u612C", 18, "\u6140", 6],
      ["9140", "\u6147\u6149\u614B\u614D\u614F\u6150\u6152\u6153\u6154\u6156", 6, "\u615E\u615F\u6160\u6161\u6163\u6164\u6165\u6166\u6169", 6, "\u6171\u6172\u6173\u6174\u6176\u6178", 18, "\u618C\u618D\u618F", 4, "\u6195"],
      ["9180", "\u6196", 6, "\u619E", 8, "\u61AA\u61AB\u61AD", 9, "\u61B8", 5, "\u61BF\u61C0\u61C1\u61C3", 4, "\u61C9\u61CC", 4, "\u61D3\u61D5", 16, "\u61E7", 13, "\u61F6", 8, "\u6200", 5, "\u6207\u6209\u6213\u6214\u6219\u621C\u621D\u621E\u6220\u6223\u6226\u6227\u6228\u6229\u622B\u622D\u622F\u6230\u6231\u6232\u6235\u6236\u6238", 4, "\u6242\u6244\u6245\u6246\u624A"],
      ["9240", "\u624F\u6250\u6255\u6256\u6257\u6259\u625A\u625C", 6, "\u6264\u6265\u6268\u6271\u6272\u6274\u6275\u6277\u6278\u627A\u627B\u627D\u6281\u6282\u6283\u6285\u6286\u6287\u6288\u628B", 5, "\u6294\u6299\u629C\u629D\u629E\u62A3\u62A6\u62A7\u62A9\u62AA\u62AD\u62AE\u62AF\u62B0\u62B2\u62B3\u62B4\u62B6\u62B7\u62B8\u62BA\u62BE\u62C0\u62C1"],
      ["9280", "\u62C3\u62CB\u62CF\u62D1\u62D5\u62DD\u62DE\u62E0\u62E1\u62E4\u62EA\u62EB\u62F0\u62F2\u62F5\u62F8\u62F9\u62FA\u62FB\u6300\u6303\u6304\u6305\u6306\u630A\u630B\u630C\u630D\u630F\u6310\u6312\u6313\u6314\u6315\u6317\u6318\u6319\u631C\u6326\u6327\u6329\u632C\u632D\u632E\u6330\u6331\u6333", 5, "\u633B\u633C\u633E\u633F\u6340\u6341\u6344\u6347\u6348\u634A\u6351\u6352\u6353\u6354\u6356", 7, "\u6360\u6364\u6365\u6366\u6368\u636A\u636B\u636C\u636F\u6370\u6372\u6373\u6374\u6375\u6378\u6379\u637C\u637D\u637E\u637F\u6381\u6383\u6384\u6385\u6386\u638B\u638D\u6391\u6393\u6394\u6395\u6397\u6399", 6, "\u63A1\u63A4\u63A6\u63AB\u63AF\u63B1\u63B2\u63B5\u63B6\u63B9\u63BB\u63BD\u63BF\u63C0"],
      ["9340", "\u63C1\u63C2\u63C3\u63C5\u63C7\u63C8\u63CA\u63CB\u63CC\u63D1\u63D3\u63D4\u63D5\u63D7", 6, "\u63DF\u63E2\u63E4", 4, "\u63EB\u63EC\u63EE\u63EF\u63F0\u63F1\u63F3\u63F5\u63F7\u63F9\u63FA\u63FB\u63FC\u63FE\u6403\u6404\u6406", 4, "\u640D\u640E\u6411\u6412\u6415", 5, "\u641D\u641F\u6422\u6423\u6424"],
      ["9380", "\u6425\u6427\u6428\u6429\u642B\u642E", 5, "\u6435", 4, "\u643B\u643C\u643E\u6440\u6442\u6443\u6449\u644B", 6, "\u6453\u6455\u6456\u6457\u6459", 4, "\u645F", 7, "\u6468\u646A\u646B\u646C\u646E", 9, "\u647B", 6, "\u6483\u6486\u6488", 8, "\u6493\u6494\u6497\u6498\u649A\u649B\u649C\u649D\u649F", 4, "\u64A5\u64A6\u64A7\u64A8\u64AA\u64AB\u64AF\u64B1\u64B2\u64B3\u64B4\u64B6\u64B9\u64BB\u64BD\u64BE\u64BF\u64C1\u64C3\u64C4\u64C6", 6, "\u64CF\u64D1\u64D3\u64D4\u64D5\u64D6\u64D9\u64DA"],
      ["9440", "\u64DB\u64DC\u64DD\u64DF\u64E0\u64E1\u64E3\u64E5\u64E7", 24, "\u6501", 7, "\u650A", 7, "\u6513", 4, "\u6519", 8],
      ["9480", "\u6522\u6523\u6524\u6526", 4, "\u652C\u652D\u6530\u6531\u6532\u6533\u6537\u653A\u653C\u653D\u6540", 4, "\u6546\u6547\u654A\u654B\u654D\u654E\u6550\u6552\u6553\u6554\u6557\u6558\u655A\u655C\u655F\u6560\u6561\u6564\u6565\u6567\u6568\u6569\u656A\u656D\u656E\u656F\u6571\u6573\u6575\u6576\u6578", 14, "\u6588\u6589\u658A\u658D\u658E\u658F\u6592\u6594\u6595\u6596\u6598\u659A\u659D\u659E\u65A0\u65A2\u65A3\u65A6\u65A8\u65AA\u65AC\u65AE\u65B1", 7, "\u65BA\u65BB\u65BE\u65BF\u65C0\u65C2\u65C7\u65C8\u65C9\u65CA\u65CD\u65D0\u65D1\u65D3\u65D4\u65D5\u65D8", 7, "\u65E1\u65E3\u65E4\u65EA\u65EB"],
      ["9540", "\u65F2\u65F3\u65F4\u65F5\u65F8\u65F9\u65FB", 4, "\u6601\u6604\u6605\u6607\u6608\u6609\u660B\u660D\u6610\u6611\u6612\u6616\u6617\u6618\u661A\u661B\u661C\u661E\u6621\u6622\u6623\u6624\u6626\u6629\u662A\u662B\u662C\u662E\u6630\u6632\u6633\u6637", 4, "\u663D\u663F\u6640\u6642\u6644", 6, "\u664D\u664E\u6650\u6651\u6658"],
      ["9580", "\u6659\u665B\u665C\u665D\u665E\u6660\u6662\u6663\u6665\u6667\u6669", 4, "\u6671\u6672\u6673\u6675\u6678\u6679\u667B\u667C\u667D\u667F\u6680\u6681\u6683\u6685\u6686\u6688\u6689\u668A\u668B\u668D\u668E\u668F\u6690\u6692\u6693\u6694\u6695\u6698", 4, "\u669E", 8, "\u66A9", 4, "\u66AF", 4, "\u66B5\u66B6\u66B7\u66B8\u66BA\u66BB\u66BC\u66BD\u66BF", 25, "\u66DA\u66DE", 7, "\u66E7\u66E8\u66EA", 5, "\u66F1\u66F5\u66F6\u66F8\u66FA\u66FB\u66FD\u6701\u6702\u6703"],
      ["9640", "\u6704\u6705\u6706\u6707\u670C\u670E\u670F\u6711\u6712\u6713\u6716\u6718\u6719\u671A\u671C\u671E\u6720", 5, "\u6727\u6729\u672E\u6730\u6732\u6733\u6736\u6737\u6738\u6739\u673B\u673C\u673E\u673F\u6741\u6744\u6745\u6747\u674A\u674B\u674D\u6752\u6754\u6755\u6757", 4, "\u675D\u6762\u6763\u6764\u6766\u6767\u676B\u676C\u676E\u6771\u6774\u6776"],
      ["9680", "\u6778\u6779\u677A\u677B\u677D\u6780\u6782\u6783\u6785\u6786\u6788\u678A\u678C\u678D\u678E\u678F\u6791\u6792\u6793\u6794\u6796\u6799\u679B\u679F\u67A0\u67A1\u67A4\u67A6\u67A9\u67AC\u67AE\u67B1\u67B2\u67B4\u67B9", 7, "\u67C2\u67C5", 9, "\u67D5\u67D6\u67D7\u67DB\u67DF\u67E1\u67E3\u67E4\u67E6\u67E7\u67E8\u67EA\u67EB\u67ED\u67EE\u67F2\u67F5", 7, "\u67FE\u6801\u6802\u6803\u6804\u6806\u680D\u6810\u6812\u6814\u6815\u6818", 4, "\u681E\u681F\u6820\u6822", 6, "\u682B", 6, "\u6834\u6835\u6836\u683A\u683B\u683F\u6847\u684B\u684D\u684F\u6852\u6856", 5],
      ["9740", "\u685C\u685D\u685E\u685F\u686A\u686C", 7, "\u6875\u6878", 8, "\u6882\u6884\u6887", 7, "\u6890\u6891\u6892\u6894\u6895\u6896\u6898", 9, "\u68A3\u68A4\u68A5\u68A9\u68AA\u68AB\u68AC\u68AE\u68B1\u68B2\u68B4\u68B6\u68B7\u68B8"],
      ["9780", "\u68B9", 6, "\u68C1\u68C3", 5, "\u68CA\u68CC\u68CE\u68CF\u68D0\u68D1\u68D3\u68D4\u68D6\u68D7\u68D9\u68DB", 4, "\u68E1\u68E2\u68E4", 9, "\u68EF\u68F2\u68F3\u68F4\u68F6\u68F7\u68F8\u68FB\u68FD\u68FE\u68FF\u6900\u6902\u6903\u6904\u6906", 4, "\u690C\u690F\u6911\u6913", 11, "\u6921\u6922\u6923\u6925", 7, "\u692E\u692F\u6931\u6932\u6933\u6935\u6936\u6937\u6938\u693A\u693B\u693C\u693E\u6940\u6941\u6943", 16, "\u6955\u6956\u6958\u6959\u695B\u695C\u695F"],
      ["9840", "\u6961\u6962\u6964\u6965\u6967\u6968\u6969\u696A\u696C\u696D\u696F\u6970\u6972", 4, "\u697A\u697B\u697D\u697E\u697F\u6981\u6983\u6985\u698A\u698B\u698C\u698E", 5, "\u6996\u6997\u6999\u699A\u699D", 9, "\u69A9\u69AA\u69AC\u69AE\u69AF\u69B0\u69B2\u69B3\u69B5\u69B6\u69B8\u69B9\u69BA\u69BC\u69BD"],
      ["9880", "\u69BE\u69BF\u69C0\u69C2", 7, "\u69CB\u69CD\u69CF\u69D1\u69D2\u69D3\u69D5", 5, "\u69DC\u69DD\u69DE\u69E1", 11, "\u69EE\u69EF\u69F0\u69F1\u69F3", 9, "\u69FE\u6A00", 9, "\u6A0B", 11, "\u6A19", 5, "\u6A20\u6A22", 5, "\u6A29\u6A2B\u6A2C\u6A2D\u6A2E\u6A30\u6A32\u6A33\u6A34\u6A36", 6, "\u6A3F", 4, "\u6A45\u6A46\u6A48", 7, "\u6A51", 6, "\u6A5A"],
      ["9940", "\u6A5C", 4, "\u6A62\u6A63\u6A64\u6A66", 10, "\u6A72", 6, "\u6A7A\u6A7B\u6A7D\u6A7E\u6A7F\u6A81\u6A82\u6A83\u6A85", 8, "\u6A8F\u6A92", 4, "\u6A98", 7, "\u6AA1", 5],
      ["9980", "\u6AA7\u6AA8\u6AAA\u6AAD", 114, "\u6B25\u6B26\u6B28", 6],
      ["9a40", "\u6B2F\u6B30\u6B31\u6B33\u6B34\u6B35\u6B36\u6B38\u6B3B\u6B3C\u6B3D\u6B3F\u6B40\u6B41\u6B42\u6B44\u6B45\u6B48\u6B4A\u6B4B\u6B4D", 11, "\u6B5A", 7, "\u6B68\u6B69\u6B6B", 13, "\u6B7A\u6B7D\u6B7E\u6B7F\u6B80\u6B85\u6B88"],
      ["9a80", "\u6B8C\u6B8E\u6B8F\u6B90\u6B91\u6B94\u6B95\u6B97\u6B98\u6B99\u6B9C", 4, "\u6BA2", 7, "\u6BAB", 7, "\u6BB6\u6BB8", 6, "\u6BC0\u6BC3\u6BC4\u6BC6", 4, "\u6BCC\u6BCE\u6BD0\u6BD1\u6BD8\u6BDA\u6BDC", 4, "\u6BE2", 7, "\u6BEC\u6BED\u6BEE\u6BF0\u6BF1\u6BF2\u6BF4\u6BF6\u6BF7\u6BF8\u6BFA\u6BFB\u6BFC\u6BFE", 6, "\u6C08", 4, "\u6C0E\u6C12\u6C17\u6C1C\u6C1D\u6C1E\u6C20\u6C23\u6C25\u6C2B\u6C2C\u6C2D\u6C31\u6C33\u6C36\u6C37\u6C39\u6C3A\u6C3B\u6C3C\u6C3E\u6C3F\u6C43\u6C44\u6C45\u6C48\u6C4B", 4, "\u6C51\u6C52\u6C53\u6C56\u6C58"],
      ["9b40", "\u6C59\u6C5A\u6C62\u6C63\u6C65\u6C66\u6C67\u6C6B", 4, "\u6C71\u6C73\u6C75\u6C77\u6C78\u6C7A\u6C7B\u6C7C\u6C7F\u6C80\u6C84\u6C87\u6C8A\u6C8B\u6C8D\u6C8E\u6C91\u6C92\u6C95\u6C96\u6C97\u6C98\u6C9A\u6C9C\u6C9D\u6C9E\u6CA0\u6CA2\u6CA8\u6CAC\u6CAF\u6CB0\u6CB4\u6CB5\u6CB6\u6CB7\u6CBA\u6CC0\u6CC1\u6CC2\u6CC3\u6CC6\u6CC7\u6CC8\u6CCB\u6CCD\u6CCE\u6CCF\u6CD1\u6CD2\u6CD8"],
      ["9b80", "\u6CD9\u6CDA\u6CDC\u6CDD\u6CDF\u6CE4\u6CE6\u6CE7\u6CE9\u6CEC\u6CED\u6CF2\u6CF4\u6CF9\u6CFF\u6D00\u6D02\u6D03\u6D05\u6D06\u6D08\u6D09\u6D0A\u6D0D\u6D0F\u6D10\u6D11\u6D13\u6D14\u6D15\u6D16\u6D18\u6D1C\u6D1D\u6D1F", 5, "\u6D26\u6D28\u6D29\u6D2C\u6D2D\u6D2F\u6D30\u6D34\u6D36\u6D37\u6D38\u6D3A\u6D3F\u6D40\u6D42\u6D44\u6D49\u6D4C\u6D50\u6D55\u6D56\u6D57\u6D58\u6D5B\u6D5D\u6D5F\u6D61\u6D62\u6D64\u6D65\u6D67\u6D68\u6D6B\u6D6C\u6D6D\u6D70\u6D71\u6D72\u6D73\u6D75\u6D76\u6D79\u6D7A\u6D7B\u6D7D", 4, "\u6D83\u6D84\u6D86\u6D87\u6D8A\u6D8B\u6D8D\u6D8F\u6D90\u6D92\u6D96", 4, "\u6D9C\u6DA2\u6DA5\u6DAC\u6DAD\u6DB0\u6DB1\u6DB3\u6DB4\u6DB6\u6DB7\u6DB9", 5, "\u6DC1\u6DC2\u6DC3\u6DC8\u6DC9\u6DCA"],
      ["9c40", "\u6DCD\u6DCE\u6DCF\u6DD0\u6DD2\u6DD3\u6DD4\u6DD5\u6DD7\u6DDA\u6DDB\u6DDC\u6DDF\u6DE2\u6DE3\u6DE5\u6DE7\u6DE8\u6DE9\u6DEA\u6DED\u6DEF\u6DF0\u6DF2\u6DF4\u6DF5\u6DF6\u6DF8\u6DFA\u6DFD", 7, "\u6E06\u6E07\u6E08\u6E09\u6E0B\u6E0F\u6E12\u6E13\u6E15\u6E18\u6E19\u6E1B\u6E1C\u6E1E\u6E1F\u6E22\u6E26\u6E27\u6E28\u6E2A\u6E2C\u6E2E\u6E30\u6E31\u6E33\u6E35"],
      ["9c80", "\u6E36\u6E37\u6E39\u6E3B", 7, "\u6E45", 7, "\u6E4F\u6E50\u6E51\u6E52\u6E55\u6E57\u6E59\u6E5A\u6E5C\u6E5D\u6E5E\u6E60", 10, "\u6E6C\u6E6D\u6E6F", 14, "\u6E80\u6E81\u6E82\u6E84\u6E87\u6E88\u6E8A", 4, "\u6E91", 6, "\u6E99\u6E9A\u6E9B\u6E9D\u6E9E\u6EA0\u6EA1\u6EA3\u6EA4\u6EA6\u6EA8\u6EA9\u6EAB\u6EAC\u6EAD\u6EAE\u6EB0\u6EB3\u6EB5\u6EB8\u6EB9\u6EBC\u6EBE\u6EBF\u6EC0\u6EC3\u6EC4\u6EC5\u6EC6\u6EC8\u6EC9\u6ECA\u6ECC\u6ECD\u6ECE\u6ED0\u6ED2\u6ED6\u6ED8\u6ED9\u6EDB\u6EDC\u6EDD\u6EE3\u6EE7\u6EEA", 5],
      ["9d40", "\u6EF0\u6EF1\u6EF2\u6EF3\u6EF5\u6EF6\u6EF7\u6EF8\u6EFA", 7, "\u6F03\u6F04\u6F05\u6F07\u6F08\u6F0A", 4, "\u6F10\u6F11\u6F12\u6F16", 9, "\u6F21\u6F22\u6F23\u6F25\u6F26\u6F27\u6F28\u6F2C\u6F2E\u6F30\u6F32\u6F34\u6F35\u6F37", 6, "\u6F3F\u6F40\u6F41\u6F42"],
      ["9d80", "\u6F43\u6F44\u6F45\u6F48\u6F49\u6F4A\u6F4C\u6F4E", 9, "\u6F59\u6F5A\u6F5B\u6F5D\u6F5F\u6F60\u6F61\u6F63\u6F64\u6F65\u6F67", 5, "\u6F6F\u6F70\u6F71\u6F73\u6F75\u6F76\u6F77\u6F79\u6F7B\u6F7D", 6, "\u6F85\u6F86\u6F87\u6F8A\u6F8B\u6F8F", 12, "\u6F9D\u6F9E\u6F9F\u6FA0\u6FA2", 4, "\u6FA8", 10, "\u6FB4\u6FB5\u6FB7\u6FB8\u6FBA", 5, "\u6FC1\u6FC3", 5, "\u6FCA", 6, "\u6FD3", 10, "\u6FDF\u6FE2\u6FE3\u6FE4\u6FE5"],
      ["9e40", "\u6FE6", 7, "\u6FF0", 32, "\u7012", 7, "\u701C", 6, "\u7024", 6],
      ["9e80", "\u702B", 9, "\u7036\u7037\u7038\u703A", 17, "\u704D\u704E\u7050", 13, "\u705F", 11, "\u706E\u7071\u7072\u7073\u7074\u7077\u7079\u707A\u707B\u707D\u7081\u7082\u7083\u7084\u7086\u7087\u7088\u708B\u708C\u708D\u708F\u7090\u7091\u7093\u7097\u7098\u709A\u709B\u709E", 12, "\u70B0\u70B2\u70B4\u70B5\u70B6\u70BA\u70BE\u70BF\u70C4\u70C5\u70C6\u70C7\u70C9\u70CB", 12, "\u70DA"],
      ["9f40", "\u70DC\u70DD\u70DE\u70E0\u70E1\u70E2\u70E3\u70E5\u70EA\u70EE\u70F0", 6, "\u70F8\u70FA\u70FB\u70FC\u70FE", 10, "\u710B", 4, "\u7111\u7112\u7114\u7117\u711B", 10, "\u7127", 7, "\u7132\u7133\u7134"],
      ["9f80", "\u7135\u7137", 13, "\u7146\u7147\u7148\u7149\u714B\u714D\u714F", 12, "\u715D\u715F", 4, "\u7165\u7169", 4, "\u716F\u7170\u7171\u7174\u7175\u7176\u7177\u7179\u717B\u717C\u717E", 5, "\u7185", 4, "\u718B\u718C\u718D\u718E\u7190\u7191\u7192\u7193\u7195\u7196\u7197\u719A", 4, "\u71A1", 6, "\u71A9\u71AA\u71AB\u71AD", 5, "\u71B4\u71B6\u71B7\u71B8\u71BA", 8, "\u71C4", 9, "\u71CF", 4],
      ["a040", "\u71D6", 9, "\u71E1\u71E2\u71E3\u71E4\u71E6\u71E8", 5, "\u71EF", 9, "\u71FA", 11, "\u7207", 19],
      ["a080", "\u721B\u721C\u721E", 9, "\u7229\u722B\u722D\u722E\u722F\u7232\u7233\u7234\u723A\u723C\u723E\u7240", 6, "\u7249\u724A\u724B\u724E\u724F\u7250\u7251\u7253\u7254\u7255\u7257\u7258\u725A\u725C\u725E\u7260\u7263\u7264\u7265\u7268\u726A\u726B\u726C\u726D\u7270\u7271\u7273\u7274\u7276\u7277\u7278\u727B\u727C\u727D\u7282\u7283\u7285", 4, "\u728C\u728E\u7290\u7291\u7293", 11, "\u72A0", 11, "\u72AE\u72B1\u72B2\u72B3\u72B5\u72BA", 6, "\u72C5\u72C6\u72C7\u72C9\u72CA\u72CB\u72CC\u72CF\u72D1\u72D3\u72D4\u72D5\u72D6\u72D8\u72DA\u72DB"],
      ["a1a1", "\u3000\u3001\u3002\xB7\u02C9\u02C7\xA8\u3003\u3005\u2014\uFF5E\u2016\u2026\u2018\u2019\u201C\u201D\u3014\u3015\u3008", 7, "\u3016\u3017\u3010\u3011\xB1\xD7\xF7\u2236\u2227\u2228\u2211\u220F\u222A\u2229\u2208\u2237\u221A\u22A5\u2225\u2220\u2312\u2299\u222B\u222E\u2261\u224C\u2248\u223D\u221D\u2260\u226E\u226F\u2264\u2265\u221E\u2235\u2234\u2642\u2640\xB0\u2032\u2033\u2103\uFF04\xA4\uFFE0\uFFE1\u2030\xA7\u2116\u2606\u2605\u25CB\u25CF\u25CE\u25C7\u25C6\u25A1\u25A0\u25B3\u25B2\u203B\u2192\u2190\u2191\u2193\u3013"],
      ["a2a1", "\u2170", 9],
      ["a2b1", "\u2488", 19, "\u2474", 19, "\u2460", 9],
      ["a2e5", "\u3220", 9],
      ["a2f1", "\u2160", 11],
      ["a3a1", "\uFF01\uFF02\uFF03\uFFE5\uFF05", 88, "\uFFE3"],
      ["a4a1", "\u3041", 82],
      ["a5a1", "\u30A1", 85],
      ["a6a1", "\u0391", 16, "\u03A3", 6],
      ["a6c1", "\u03B1", 16, "\u03C3", 6],
      ["a6e0", "\uFE35\uFE36\uFE39\uFE3A\uFE3F\uFE40\uFE3D\uFE3E\uFE41\uFE42\uFE43\uFE44"],
      ["a6ee", "\uFE3B\uFE3C\uFE37\uFE38\uFE31"],
      ["a6f4", "\uFE33\uFE34"],
      ["a7a1", "\u0410", 5, "\u0401\u0416", 25],
      ["a7d1", "\u0430", 5, "\u0451\u0436", 25],
      ["a840", "\u02CA\u02CB\u02D9\u2013\u2015\u2025\u2035\u2105\u2109\u2196\u2197\u2198\u2199\u2215\u221F\u2223\u2252\u2266\u2267\u22BF\u2550", 35, "\u2581", 6],
      ["a880", "\u2588", 7, "\u2593\u2594\u2595\u25BC\u25BD\u25E2\u25E3\u25E4\u25E5\u2609\u2295\u3012\u301D\u301E"],
      ["a8a1", "\u0101\xE1\u01CE\xE0\u0113\xE9\u011B\xE8\u012B\xED\u01D0\xEC\u014D\xF3\u01D2\xF2\u016B\xFA\u01D4\xF9\u01D6\u01D8\u01DA\u01DC\xFC\xEA\u0251"],
      ["a8bd", "\u0144\u0148"],
      ["a8c0", "\u0261"],
      ["a8c5", "\u3105", 36],
      ["a940", "\u3021", 8, "\u32A3\u338E\u338F\u339C\u339D\u339E\u33A1\u33C4\u33CE\u33D1\u33D2\u33D5\uFE30\uFFE2\uFFE4"],
      ["a959", "\u2121\u3231"],
      ["a95c", "\u2010"],
      ["a960", "\u30FC\u309B\u309C\u30FD\u30FE\u3006\u309D\u309E\uFE49", 9, "\uFE54\uFE55\uFE56\uFE57\uFE59", 8],
      ["a980", "\uFE62", 4, "\uFE68\uFE69\uFE6A\uFE6B"],
      ["a996", "\u3007"],
      ["a9a4", "\u2500", 75],
      ["aa40", "\u72DC\u72DD\u72DF\u72E2", 5, "\u72EA\u72EB\u72F5\u72F6\u72F9\u72FD\u72FE\u72FF\u7300\u7302\u7304", 5, "\u730B\u730C\u730D\u730F\u7310\u7311\u7312\u7314\u7318\u7319\u731A\u731F\u7320\u7323\u7324\u7326\u7327\u7328\u732D\u732F\u7330\u7332\u7333\u7335\u7336\u733A\u733B\u733C\u733D\u7340", 8],
      ["aa80", "\u7349\u734A\u734B\u734C\u734E\u734F\u7351\u7353\u7354\u7355\u7356\u7358", 7, "\u7361", 10, "\u736E\u7370\u7371"],
      ["ab40", "\u7372", 11, "\u737F", 4, "\u7385\u7386\u7388\u738A\u738C\u738D\u738F\u7390\u7392\u7393\u7394\u7395\u7397\u7398\u7399\u739A\u739C\u739D\u739E\u73A0\u73A1\u73A3", 5, "\u73AA\u73AC\u73AD\u73B1\u73B4\u73B5\u73B6\u73B8\u73B9\u73BC\u73BD\u73BE\u73BF\u73C1\u73C3", 4],
      ["ab80", "\u73CB\u73CC\u73CE\u73D2", 6, "\u73DA\u73DB\u73DC\u73DD\u73DF\u73E1\u73E2\u73E3\u73E4\u73E6\u73E8\u73EA\u73EB\u73EC\u73EE\u73EF\u73F0\u73F1\u73F3", 4],
      ["ac40", "\u73F8", 10, "\u7404\u7407\u7408\u740B\u740C\u740D\u740E\u7411", 8, "\u741C", 5, "\u7423\u7424\u7427\u7429\u742B\u742D\u742F\u7431\u7432\u7437", 4, "\u743D\u743E\u743F\u7440\u7442", 11],
      ["ac80", "\u744E", 6, "\u7456\u7458\u745D\u7460", 12, "\u746E\u746F\u7471", 4, "\u7478\u7479\u747A"],
      ["ad40", "\u747B\u747C\u747D\u747F\u7482\u7484\u7485\u7486\u7488\u7489\u748A\u748C\u748D\u748F\u7491", 10, "\u749D\u749F", 7, "\u74AA", 15, "\u74BB", 12],
      ["ad80", "\u74C8", 9, "\u74D3", 8, "\u74DD\u74DF\u74E1\u74E5\u74E7", 6, "\u74F0\u74F1\u74F2"],
      ["ae40", "\u74F3\u74F5\u74F8", 6, "\u7500\u7501\u7502\u7503\u7505", 7, "\u750E\u7510\u7512\u7514\u7515\u7516\u7517\u751B\u751D\u751E\u7520", 4, "\u7526\u7527\u752A\u752E\u7534\u7536\u7539\u753C\u753D\u753F\u7541\u7542\u7543\u7544\u7546\u7547\u7549\u754A\u754D\u7550\u7551\u7552\u7553\u7555\u7556\u7557\u7558"],
      ["ae80", "\u755D", 7, "\u7567\u7568\u7569\u756B", 6, "\u7573\u7575\u7576\u7577\u757A", 4, "\u7580\u7581\u7582\u7584\u7585\u7587"],
      ["af40", "\u7588\u7589\u758A\u758C\u758D\u758E\u7590\u7593\u7595\u7598\u759B\u759C\u759E\u75A2\u75A6", 4, "\u75AD\u75B6\u75B7\u75BA\u75BB\u75BF\u75C0\u75C1\u75C6\u75CB\u75CC\u75CE\u75CF\u75D0\u75D1\u75D3\u75D7\u75D9\u75DA\u75DC\u75DD\u75DF\u75E0\u75E1\u75E5\u75E9\u75EC\u75ED\u75EE\u75EF\u75F2\u75F3\u75F5\u75F6\u75F7\u75F8\u75FA\u75FB\u75FD\u75FE\u7602\u7604\u7606\u7607"],
      ["af80", "\u7608\u7609\u760B\u760D\u760E\u760F\u7611\u7612\u7613\u7614\u7616\u761A\u761C\u761D\u761E\u7621\u7623\u7627\u7628\u762C\u762E\u762F\u7631\u7632\u7636\u7637\u7639\u763A\u763B\u763D\u7641\u7642\u7644"],
      ["b040", "\u7645", 6, "\u764E", 5, "\u7655\u7657", 4, "\u765D\u765F\u7660\u7661\u7662\u7664", 6, "\u766C\u766D\u766E\u7670", 7, "\u7679\u767A\u767C\u767F\u7680\u7681\u7683\u7685\u7689\u768A\u768C\u768D\u768F\u7690\u7692\u7694\u7695\u7697\u7698\u769A\u769B"],
      ["b080", "\u769C", 7, "\u76A5", 8, "\u76AF\u76B0\u76B3\u76B5", 9, "\u76C0\u76C1\u76C3\u554A\u963F\u57C3\u6328\u54CE\u5509\u54C0\u7691\u764C\u853C\u77EE\u827E\u788D\u7231\u9698\u978D\u6C28\u5B89\u4FFA\u6309\u6697\u5CB8\u80FA\u6848\u80AE\u6602\u76CE\u51F9\u6556\u71AC\u7FF1\u8884\u50B2\u5965\u61CA\u6FB3\u82AD\u634C\u6252\u53ED\u5427\u7B06\u516B\u75A4\u5DF4\u62D4\u8DCB\u9776\u628A\u8019\u575D\u9738\u7F62\u7238\u767D\u67CF\u767E\u6446\u4F70\u8D25\u62DC\u7A17\u6591\u73ED\u642C\u6273\u822C\u9881\u677F\u7248\u626E\u62CC\u4F34\u74E3\u534A\u529E\u7ECA\u90A6\u5E2E\u6886\u699C\u8180\u7ED1\u68D2\u78C5\u868C\u9551\u508D\u8C24\u82DE\u80DE\u5305\u8912\u5265"],
      ["b140", "\u76C4\u76C7\u76C9\u76CB\u76CC\u76D3\u76D5\u76D9\u76DA\u76DC\u76DD\u76DE\u76E0", 4, "\u76E6", 7, "\u76F0\u76F3\u76F5\u76F6\u76F7\u76FA\u76FB\u76FD\u76FF\u7700\u7702\u7703\u7705\u7706\u770A\u770C\u770E", 10, "\u771B\u771C\u771D\u771E\u7721\u7723\u7724\u7725\u7727\u772A\u772B"],
      ["b180", "\u772C\u772E\u7730", 4, "\u7739\u773B\u773D\u773E\u773F\u7742\u7744\u7745\u7746\u7748", 7, "\u7752", 7, "\u775C\u8584\u96F9\u4FDD\u5821\u9971\u5B9D\u62B1\u62A5\u66B4\u8C79\u9C8D\u7206\u676F\u7891\u60B2\u5351\u5317\u8F88\u80CC\u8D1D\u94A1\u500D\u72C8\u5907\u60EB\u7119\u88AB\u5954\u82EF\u672C\u7B28\u5D29\u7EF7\u752D\u6CF5\u8E66\u8FF8\u903C\u9F3B\u6BD4\u9119\u7B14\u5F7C\u78A7\u84D6\u853D\u6BD5\u6BD9\u6BD6\u5E01\u5E87\u75F9\u95ED\u655D\u5F0A\u5FC5\u8F9F\u58C1\u81C2\u907F\u965B\u97AD\u8FB9\u7F16\u8D2C\u6241\u4FBF\u53D8\u535E\u8FA8\u8FA9\u8FAB\u904D\u6807\u5F6A\u8198\u8868\u9CD6\u618B\u522B\u762A\u5F6C\u658C\u6FD2\u6EE8\u5BBE\u6448\u5175\u51B0\u67C4\u4E19\u79C9\u997C\u70B3"],
      ["b240", "\u775D\u775E\u775F\u7760\u7764\u7767\u7769\u776A\u776D", 11, "\u777A\u777B\u777C\u7781\u7782\u7783\u7786", 5, "\u778F\u7790\u7793", 11, "\u77A1\u77A3\u77A4\u77A6\u77A8\u77AB\u77AD\u77AE\u77AF\u77B1\u77B2\u77B4\u77B6", 4],
      ["b280", "\u77BC\u77BE\u77C0", 12, "\u77CE", 8, "\u77D8\u77D9\u77DA\u77DD", 4, "\u77E4\u75C5\u5E76\u73BB\u83E0\u64AD\u62E8\u94B5\u6CE2\u535A\u52C3\u640F\u94C2\u7B94\u4F2F\u5E1B\u8236\u8116\u818A\u6E24\u6CCA\u9A73\u6355\u535C\u54FA\u8865\u57E0\u4E0D\u5E03\u6B65\u7C3F\u90E8\u6016\u64E6\u731C\u88C1\u6750\u624D\u8D22\u776C\u8E29\u91C7\u5F69\u83DC\u8521\u9910\u53C2\u8695\u6B8B\u60ED\u60E8\u707F\u82CD\u8231\u4ED3\u6CA7\u85CF\u64CD\u7CD9\u69FD\u66F9\u8349\u5395\u7B56\u4FA7\u518C\u6D4B\u5C42\u8E6D\u63D2\u53C9\u832C\u8336\u67E5\u78B4\u643D\u5BDF\u5C94\u5DEE\u8BE7\u62C6\u67F4\u8C7A\u6400\u63BA\u8749\u998B\u8C17\u7F20\u94F2\u4EA7\u9610\u98A4\u660C\u7316"],
      ["b340", "\u77E6\u77E8\u77EA\u77EF\u77F0\u77F1\u77F2\u77F4\u77F5\u77F7\u77F9\u77FA\u77FB\u77FC\u7803", 5, "\u780A\u780B\u780E\u780F\u7810\u7813\u7815\u7819\u781B\u781E\u7820\u7821\u7822\u7824\u7828\u782A\u782B\u782E\u782F\u7831\u7832\u7833\u7835\u7836\u783D\u783F\u7841\u7842\u7843\u7844\u7846\u7848\u7849\u784A\u784B\u784D\u784F\u7851\u7853\u7854\u7858\u7859\u785A"],
      ["b380", "\u785B\u785C\u785E", 11, "\u786F", 7, "\u7878\u7879\u787A\u787B\u787D", 6, "\u573A\u5C1D\u5E38\u957F\u507F\u80A0\u5382\u655E\u7545\u5531\u5021\u8D85\u6284\u949E\u671D\u5632\u6F6E\u5DE2\u5435\u7092\u8F66\u626F\u64A4\u63A3\u5F7B\u6F88\u90F4\u81E3\u8FB0\u5C18\u6668\u5FF1\u6C89\u9648\u8D81\u886C\u6491\u79F0\u57CE\u6A59\u6210\u5448\u4E58\u7A0B\u60E9\u6F84\u8BDA\u627F\u901E\u9A8B\u79E4\u5403\u75F4\u6301\u5319\u6C60\u8FDF\u5F1B\u9A70\u803B\u9F7F\u4F88\u5C3A\u8D64\u7FC5\u65A5\u70BD\u5145\u51B2\u866B\u5D07\u5BA0\u62BD\u916C\u7574\u8E0C\u7A20\u6101\u7B79\u4EC7\u7EF8\u7785\u4E11\u81ED\u521D\u51FA\u6A71\u53A8\u8E87\u9504\u96CF\u6EC1\u9664\u695A"],
      ["b440", "\u7884\u7885\u7886\u7888\u788A\u788B\u788F\u7890\u7892\u7894\u7895\u7896\u7899\u789D\u789E\u78A0\u78A2\u78A4\u78A6\u78A8", 7, "\u78B5\u78B6\u78B7\u78B8\u78BA\u78BB\u78BC\u78BD\u78BF\u78C0\u78C2\u78C3\u78C4\u78C6\u78C7\u78C8\u78CC\u78CD\u78CE\u78CF\u78D1\u78D2\u78D3\u78D6\u78D7\u78D8\u78DA", 9],
      ["b480", "\u78E4\u78E5\u78E6\u78E7\u78E9\u78EA\u78EB\u78ED", 4, "\u78F3\u78F5\u78F6\u78F8\u78F9\u78FB", 5, "\u7902\u7903\u7904\u7906", 6, "\u7840\u50A8\u77D7\u6410\u89E6\u5904\u63E3\u5DDD\u7A7F\u693D\u4F20\u8239\u5598\u4E32\u75AE\u7A97\u5E62\u5E8A\u95EF\u521B\u5439\u708A\u6376\u9524\u5782\u6625\u693F\u9187\u5507\u6DF3\u7EAF\u8822\u6233\u7EF0\u75B5\u8328\u78C1\u96CC\u8F9E\u6148\u74F7\u8BCD\u6B64\u523A\u8D50\u6B21\u806A\u8471\u56F1\u5306\u4ECE\u4E1B\u51D1\u7C97\u918B\u7C07\u4FC3\u8E7F\u7BE1\u7A9C\u6467\u5D14\u50AC\u8106\u7601\u7CB9\u6DEC\u7FE0\u6751\u5B58\u5BF8\u78CB\u64AE\u6413\u63AA\u632B\u9519\u642D\u8FBE\u7B54\u7629\u6253\u5927\u5446\u6B79\u50A3\u6234\u5E26\u6B86\u4EE3\u8D37\u888B\u5F85\u902E"],
      ["b540", "\u790D", 5, "\u7914", 9, "\u791F", 4, "\u7925", 14, "\u7935", 4, "\u793D\u793F\u7942\u7943\u7944\u7945\u7947\u794A", 8, "\u7954\u7955\u7958\u7959\u7961\u7963"],
      ["b580", "\u7964\u7966\u7969\u796A\u796B\u796C\u796E\u7970", 6, "\u7979\u797B", 4, "\u7982\u7983\u7986\u7987\u7988\u7989\u798B\u798C\u798D\u798E\u7990\u7991\u7992\u6020\u803D\u62C5\u4E39\u5355\u90F8\u63B8\u80C6\u65E6\u6C2E\u4F46\u60EE\u6DE1\u8BDE\u5F39\u86CB\u5F53\u6321\u515A\u8361\u6863\u5200\u6363\u8E48\u5012\u5C9B\u7977\u5BFC\u5230\u7A3B\u60BC\u9053\u76D7\u5FB7\u5F97\u7684\u8E6C\u706F\u767B\u7B49\u77AA\u51F3\u9093\u5824\u4F4E\u6EF4\u8FEA\u654C\u7B1B\u72C4\u6DA4\u7FDF\u5AE1\u62B5\u5E95\u5730\u8482\u7B2C\u5E1D\u5F1F\u9012\u7F14\u98A0\u6382\u6EC7\u7898\u70B9\u5178\u975B\u57AB\u7535\u4F43\u7538\u5E97\u60E6\u5960\u6DC0\u6BBF\u7889\u53FC\u96D5\u51CB\u5201\u6389\u540A\u9493\u8C03\u8DCC\u7239\u789F\u8776\u8FED\u8C0D\u53E0"],
      ["b640", "\u7993", 6, "\u799B", 11, "\u79A8", 10, "\u79B4", 4, "\u79BC\u79BF\u79C2\u79C4\u79C5\u79C7\u79C8\u79CA\u79CC\u79CE\u79CF\u79D0\u79D3\u79D4\u79D6\u79D7\u79D9", 5, "\u79E0\u79E1\u79E2\u79E5\u79E8\u79EA"],
      ["b680", "\u79EC\u79EE\u79F1", 6, "\u79F9\u79FA\u79FC\u79FE\u79FF\u7A01\u7A04\u7A05\u7A07\u7A08\u7A09\u7A0A\u7A0C\u7A0F", 4, "\u7A15\u7A16\u7A18\u7A19\u7A1B\u7A1C\u4E01\u76EF\u53EE\u9489\u9876\u9F0E\u952D\u5B9A\u8BA2\u4E22\u4E1C\u51AC\u8463\u61C2\u52A8\u680B\u4F97\u606B\u51BB\u6D1E\u515C\u6296\u6597\u9661\u8C46\u9017\u75D8\u90FD\u7763\u6BD2\u728A\u72EC\u8BFB\u5835\u7779\u8D4C\u675C\u9540\u809A\u5EA6\u6E21\u5992\u7AEF\u77ED\u953B\u6BB5\u65AD\u7F0E\u5806\u5151\u961F\u5BF9\u58A9\u5428\u8E72\u6566\u987F\u56E4\u949D\u76FE\u9041\u6387\u54C6\u591A\u593A\u579B\u8EB2\u6735\u8DFA\u8235\u5241\u60F0\u5815\u86FE\u5CE8\u9E45\u4FC4\u989D\u8BB9\u5A25\u6076\u5384\u627C\u904F\u9102\u997F\u6069\u800C\u513F\u8033\u5C14\u9975\u6D31\u4E8C"],
      ["b740", "\u7A1D\u7A1F\u7A21\u7A22\u7A24", 14, "\u7A34\u7A35\u7A36\u7A38\u7A3A\u7A3E\u7A40", 5, "\u7A47", 9, "\u7A52", 4, "\u7A58", 16],
      ["b780", "\u7A69", 6, "\u7A71\u7A72\u7A73\u7A75\u7A7B\u7A7C\u7A7D\u7A7E\u7A82\u7A85\u7A87\u7A89\u7A8A\u7A8B\u7A8C\u7A8E\u7A8F\u7A90\u7A93\u7A94\u7A99\u7A9A\u7A9B\u7A9E\u7AA1\u7AA2\u8D30\u53D1\u7F5A\u7B4F\u4F10\u4E4F\u9600\u6CD5\u73D0\u85E9\u5E06\u756A\u7FFB\u6A0A\u77FE\u9492\u7E41\u51E1\u70E6\u53CD\u8FD4\u8303\u8D29\u72AF\u996D\u6CDB\u574A\u82B3\u65B9\u80AA\u623F\u9632\u59A8\u4EFF\u8BBF\u7EBA\u653E\u83F2\u975E\u5561\u98DE\u80A5\u532A\u8BFD\u5420\u80BA\u5E9F\u6CB8\u8D39\u82AC\u915A\u5429\u6C1B\u5206\u7EB7\u575F\u711A\u6C7E\u7C89\u594B\u4EFD\u5FFF\u6124\u7CAA\u4E30\u5C01\u67AB\u8702\u5CF0\u950B\u98CE\u75AF\u70FD\u9022\u51AF\u7F1D\u8BBD\u5949\u51E4\u4F5B\u5426\u592B\u6577\u80A4\u5B75\u6276\u62C2\u8F90\u5E45\u6C1F\u7B26\u4F0F\u4FD8\u670D"],
      ["b840", "\u7AA3\u7AA4\u7AA7\u7AA9\u7AAA\u7AAB\u7AAE", 4, "\u7AB4", 10, "\u7AC0", 10, "\u7ACC", 9, "\u7AD7\u7AD8\u7ADA\u7ADB\u7ADC\u7ADD\u7AE1\u7AE2\u7AE4\u7AE7", 5, "\u7AEE\u7AF0\u7AF1\u7AF2\u7AF3"],
      ["b880", "\u7AF4", 4, "\u7AFB\u7AFC\u7AFE\u7B00\u7B01\u7B02\u7B05\u7B07\u7B09\u7B0C\u7B0D\u7B0E\u7B10\u7B12\u7B13\u7B16\u7B17\u7B18\u7B1A\u7B1C\u7B1D\u7B1F\u7B21\u7B22\u7B23\u7B27\u7B29\u7B2D\u6D6E\u6DAA\u798F\u88B1\u5F17\u752B\u629A\u8F85\u4FEF\u91DC\u65A7\u812F\u8151\u5E9C\u8150\u8D74\u526F\u8986\u8D4B\u590D\u5085\u4ED8\u961C\u7236\u8179\u8D1F\u5BCC\u8BA3\u9644\u5987\u7F1A\u5490\u5676\u560E\u8BE5\u6539\u6982\u9499\u76D6\u6E89\u5E72\u7518\u6746\u67D1\u7AFF\u809D\u8D76\u611F\u79C6\u6562\u8D63\u5188\u521A\u94A2\u7F38\u809B\u7EB2\u5C97\u6E2F\u6760\u7BD9\u768B\u9AD8\u818F\u7F94\u7CD5\u641E\u9550\u7A3F\u544A\u54E5\u6B4C\u6401\u6208\u9E3D\u80F3\u7599\u5272\u9769\u845B\u683C\u86E4\u9601\u9694\u94EC\u4E2A\u5404\u7ED9\u6839\u8DDF\u8015\u66F4\u5E9A\u7FB9"],
      ["b940", "\u7B2F\u7B30\u7B32\u7B34\u7B35\u7B36\u7B37\u7B39\u7B3B\u7B3D\u7B3F", 5, "\u7B46\u7B48\u7B4A\u7B4D\u7B4E\u7B53\u7B55\u7B57\u7B59\u7B5C\u7B5E\u7B5F\u7B61\u7B63", 10, "\u7B6F\u7B70\u7B73\u7B74\u7B76\u7B78\u7B7A\u7B7C\u7B7D\u7B7F\u7B81\u7B82\u7B83\u7B84\u7B86", 6, "\u7B8E\u7B8F"],
      ["b980", "\u7B91\u7B92\u7B93\u7B96\u7B98\u7B99\u7B9A\u7B9B\u7B9E\u7B9F\u7BA0\u7BA3\u7BA4\u7BA5\u7BAE\u7BAF\u7BB0\u7BB2\u7BB3\u7BB5\u7BB6\u7BB7\u7BB9", 7, "\u7BC2\u7BC3\u7BC4\u57C2\u803F\u6897\u5DE5\u653B\u529F\u606D\u9F9A\u4F9B\u8EAC\u516C\u5BAB\u5F13\u5DE9\u6C5E\u62F1\u8D21\u5171\u94A9\u52FE\u6C9F\u82DF\u72D7\u57A2\u6784\u8D2D\u591F\u8F9C\u83C7\u5495\u7B8D\u4F30\u6CBD\u5B64\u59D1\u9F13\u53E4\u86CA\u9AA8\u8C37\u80A1\u6545\u987E\u56FA\u96C7\u522E\u74DC\u5250\u5BE1\u6302\u8902\u4E56\u62D0\u602A\u68FA\u5173\u5B98\u51A0\u89C2\u7BA1\u9986\u7F50\u60EF\u704C\u8D2F\u5149\u5E7F\u901B\u7470\u89C4\u572D\u7845\u5F52\u9F9F\u95FA\u8F68\u9B3C\u8BE1\u7678\u6842\u67DC\u8DEA\u8D35\u523D\u8F8A\u6EDA\u68CD\u9505\u90ED\u56FD\u679C\u88F9\u8FC7\u54C8"],
      ["ba40", "\u7BC5\u7BC8\u7BC9\u7BCA\u7BCB\u7BCD\u7BCE\u7BCF\u7BD0\u7BD2\u7BD4", 4, "\u7BDB\u7BDC\u7BDE\u7BDF\u7BE0\u7BE2\u7BE3\u7BE4\u7BE7\u7BE8\u7BE9\u7BEB\u7BEC\u7BED\u7BEF\u7BF0\u7BF2", 4, "\u7BF8\u7BF9\u7BFA\u7BFB\u7BFD\u7BFF", 7, "\u7C08\u7C09\u7C0A\u7C0D\u7C0E\u7C10", 5, "\u7C17\u7C18\u7C19"],
      ["ba80", "\u7C1A", 4, "\u7C20", 5, "\u7C28\u7C29\u7C2B", 12, "\u7C39", 5, "\u7C42\u9AB8\u5B69\u6D77\u6C26\u4EA5\u5BB3\u9A87\u9163\u61A8\u90AF\u97E9\u542B\u6DB5\u5BD2\u51FD\u558A\u7F55\u7FF0\u64BC\u634D\u65F1\u61BE\u608D\u710A\u6C57\u6C49\u592F\u676D\u822A\u58D5\u568E\u8C6A\u6BEB\u90DD\u597D\u8017\u53F7\u6D69\u5475\u559D\u8377\u83CF\u6838\u79BE\u548C\u4F55\u5408\u76D2\u8C89\u9602\u6CB3\u6DB8\u8D6B\u8910\u9E64\u8D3A\u563F\u9ED1\u75D5\u5F88\u72E0\u6068\u54FC\u4EA8\u6A2A\u8861\u6052\u8F70\u54C4\u70D8\u8679\u9E3F\u6D2A\u5B8F\u5F18\u7EA2\u5589\u4FAF\u7334\u543C\u539A\u5019\u540E\u547C\u4E4E\u5FFD\u745A\u58F6\u846B\u80E1\u8774\u72D0\u7CCA\u6E56"],
      ["bb40", "\u7C43", 9, "\u7C4E", 36, "\u7C75", 5, "\u7C7E", 9],
      ["bb80", "\u7C88\u7C8A", 6, "\u7C93\u7C94\u7C96\u7C99\u7C9A\u7C9B\u7CA0\u7CA1\u7CA3\u7CA6\u7CA7\u7CA8\u7CA9\u7CAB\u7CAC\u7CAD\u7CAF\u7CB0\u7CB4", 4, "\u7CBA\u7CBB\u5F27\u864E\u552C\u62A4\u4E92\u6CAA\u6237\u82B1\u54D7\u534E\u733E\u6ED1\u753B\u5212\u5316\u8BDD\u69D0\u5F8A\u6000\u6DEE\u574F\u6B22\u73AF\u6853\u8FD8\u7F13\u6362\u60A3\u5524\u75EA\u8C62\u7115\u6DA3\u5BA6\u5E7B\u8352\u614C\u9EC4\u78FA\u8757\u7C27\u7687\u51F0\u60F6\u714C\u6643\u5E4C\u604D\u8C0E\u7070\u6325\u8F89\u5FBD\u6062\u86D4\u56DE\u6BC1\u6094\u6167\u5349\u60E0\u6666\u8D3F\u79FD\u4F1A\u70E9\u6C47\u8BB3\u8BF2\u7ED8\u8364\u660F\u5A5A\u9B42\u6D51\u6DF7\u8C41\u6D3B\u4F19\u706B\u83B7\u6216\u60D1\u970D\u8D27\u7978\u51FB\u573E\u57FA\u673A\u7578\u7A3D\u79EF\u7B95"],
      ["bc40", "\u7CBF\u7CC0\u7CC2\u7CC3\u7CC4\u7CC6\u7CC9\u7CCB\u7CCE", 6, "\u7CD8\u7CDA\u7CDB\u7CDD\u7CDE\u7CE1", 6, "\u7CE9", 5, "\u7CF0", 7, "\u7CF9\u7CFA\u7CFC", 13, "\u7D0B", 5],
      ["bc80", "\u7D11", 14, "\u7D21\u7D23\u7D24\u7D25\u7D26\u7D28\u7D29\u7D2A\u7D2C\u7D2D\u7D2E\u7D30", 6, "\u808C\u9965\u8FF9\u6FC0\u8BA5\u9E21\u59EC\u7EE9\u7F09\u5409\u6781\u68D8\u8F91\u7C4D\u96C6\u53CA\u6025\u75BE\u6C72\u5373\u5AC9\u7EA7\u6324\u51E0\u810A\u5DF1\u84DF\u6280\u5180\u5B63\u4F0E\u796D\u5242\u60B8\u6D4E\u5BC4\u5BC2\u8BA1\u8BB0\u65E2\u5FCC\u9645\u5993\u7EE7\u7EAA\u5609\u67B7\u5939\u4F73\u5BB6\u52A0\u835A\u988A\u8D3E\u7532\u94BE\u5047\u7A3C\u4EF7\u67B6\u9A7E\u5AC1\u6B7C\u76D1\u575A\u5C16\u7B3A\u95F4\u714E\u517C\u80A9\u8270\u5978\u7F04\u8327\u68C0\u67EC\u78B1\u7877\u62E3\u6361\u7B80\u4FED\u526A\u51CF\u8350\u69DB\u9274\u8DF5\u8D31\u89C1\u952E\u7BAD\u4EF6"],
      ["bd40", "\u7D37", 54, "\u7D6F", 7],
      ["bd80", "\u7D78", 32, "\u5065\u8230\u5251\u996F\u6E10\u6E85\u6DA7\u5EFA\u50F5\u59DC\u5C06\u6D46\u6C5F\u7586\u848B\u6868\u5956\u8BB2\u5320\u9171\u964D\u8549\u6912\u7901\u7126\u80F6\u4EA4\u90CA\u6D47\u9A84\u5A07\u56BC\u6405\u94F0\u77EB\u4FA5\u811A\u72E1\u89D2\u997A\u7F34\u7EDE\u527F\u6559\u9175\u8F7F\u8F83\u53EB\u7A96\u63ED\u63A5\u7686\u79F8\u8857\u9636\u622A\u52AB\u8282\u6854\u6770\u6377\u776B\u7AED\u6D01\u7ED3\u89E3\u59D0\u6212\u85C9\u82A5\u754C\u501F\u4ECB\u75A5\u8BEB\u5C4A\u5DFE\u7B4B\u65A4\u91D1\u4ECA\u6D25\u895F\u7D27\u9526\u4EC5\u8C28\u8FDB\u9773\u664B\u7981\u8FD1\u70EC\u6D78"],
      ["be40", "\u7D99", 12, "\u7DA7", 6, "\u7DAF", 42],
      ["be80", "\u7DDA", 32, "\u5C3D\u52B2\u8346\u5162\u830E\u775B\u6676\u9CB8\u4EAC\u60CA\u7CBE\u7CB3\u7ECF\u4E95\u8B66\u666F\u9888\u9759\u5883\u656C\u955C\u5F84\u75C9\u9756\u7ADF\u7ADE\u51C0\u70AF\u7A98\u63EA\u7A76\u7EA0\u7396\u97ED\u4E45\u7078\u4E5D\u9152\u53A9\u6551\u65E7\u81FC\u8205\u548E\u5C31\u759A\u97A0\u62D8\u72D9\u75BD\u5C45\u9A79\u83CA\u5C40\u5480\u77E9\u4E3E\u6CAE\u805A\u62D2\u636E\u5DE8\u5177\u8DDD\u8E1E\u952F\u4FF1\u53E5\u60E7\u70AC\u5267\u6350\u9E43\u5A1F\u5026\u7737\u5377\u7EE2\u6485\u652B\u6289\u6398\u5014\u7235\u89C9\u51B3\u8BC0\u7EDD\u5747\u83CC\u94A7\u519B\u541B\u5CFB"],
      ["bf40", "\u7DFB", 62],
      ["bf80", "\u7E3A\u7E3C", 4, "\u7E42", 4, "\u7E48", 21, "\u4FCA\u7AE3\u6D5A\u90E1\u9A8F\u5580\u5496\u5361\u54AF\u5F00\u63E9\u6977\u51EF\u6168\u520A\u582A\u52D8\u574E\u780D\u770B\u5EB7\u6177\u7CE0\u625B\u6297\u4EA2\u7095\u8003\u62F7\u70E4\u9760\u5777\u82DB\u67EF\u68F5\u78D5\u9897\u79D1\u58F3\u54B3\u53EF\u6E34\u514B\u523B\u5BA2\u8BFE\u80AF\u5543\u57A6\u6073\u5751\u542D\u7A7A\u6050\u5B54\u63A7\u62A0\u53E3\u6263\u5BC7\u67AF\u54ED\u7A9F\u82E6\u9177\u5E93\u88E4\u5938\u57AE\u630E\u8DE8\u80EF\u5757\u7B77\u4FA9\u5FEB\u5BBD\u6B3E\u5321\u7B50\u72C2\u6846\u77FF\u7736\u65F7\u51B5\u4E8F\u76D4\u5CBF\u7AA5\u8475\u594E\u9B41\u5080"],
      ["c040", "\u7E5E", 35, "\u7E83", 23, "\u7E9C\u7E9D\u7E9E"],
      ["c080", "\u7EAE\u7EB4\u7EBB\u7EBC\u7ED6\u7EE4\u7EEC\u7EF9\u7F0A\u7F10\u7F1E\u7F37\u7F39\u7F3B", 6, "\u7F43\u7F46", 9, "\u7F52\u7F53\u9988\u6127\u6E83\u5764\u6606\u6346\u56F0\u62EC\u6269\u5ED3\u9614\u5783\u62C9\u5587\u8721\u814A\u8FA3\u5566\u83B1\u6765\u8D56\u84DD\u5A6A\u680F\u62E6\u7BEE\u9611\u5170\u6F9C\u8C30\u63FD\u89C8\u61D2\u7F06\u70C2\u6EE5\u7405\u6994\u72FC\u5ECA\u90CE\u6717\u6D6A\u635E\u52B3\u7262\u8001\u4F6C\u59E5\u916A\u70D9\u6D9D\u52D2\u4E50\u96F7\u956D\u857E\u78CA\u7D2F\u5121\u5792\u64C2\u808B\u7C7B\u6CEA\u68F1\u695E\u51B7\u5398\u68A8\u7281\u9ECE\u7BF1\u72F8\u79BB\u6F13\u7406\u674E\u91CC\u9CA4\u793C\u8389\u8354\u540F\u6817\u4E3D\u5389\u52B1\u783E\u5386\u5229\u5088\u4F8B\u4FD0"],
      ["c140", "\u7F56\u7F59\u7F5B\u7F5C\u7F5D\u7F5E\u7F60\u7F63", 4, "\u7F6B\u7F6C\u7F6D\u7F6F\u7F70\u7F73\u7F75\u7F76\u7F77\u7F78\u7F7A\u7F7B\u7F7C\u7F7D\u7F7F\u7F80\u7F82", 7, "\u7F8B\u7F8D\u7F8F", 4, "\u7F95", 4, "\u7F9B\u7F9C\u7FA0\u7FA2\u7FA3\u7FA5\u7FA6\u7FA8", 6, "\u7FB1"],
      ["c180", "\u7FB3", 4, "\u7FBA\u7FBB\u7FBE\u7FC0\u7FC2\u7FC3\u7FC4\u7FC6\u7FC7\u7FC8\u7FC9\u7FCB\u7FCD\u7FCF", 4, "\u7FD6\u7FD7\u7FD9", 5, "\u7FE2\u7FE3\u75E2\u7ACB\u7C92\u6CA5\u96B6\u529B\u7483\u54E9\u4FE9\u8054\u83B2\u8FDE\u9570\u5EC9\u601C\u6D9F\u5E18\u655B\u8138\u94FE\u604B\u70BC\u7EC3\u7CAE\u51C9\u6881\u7CB1\u826F\u4E24\u8F86\u91CF\u667E\u4EAE\u8C05\u64A9\u804A\u50DA\u7597\u71CE\u5BE5\u8FBD\u6F66\u4E86\u6482\u9563\u5ED6\u6599\u5217\u88C2\u70C8\u52A3\u730E\u7433\u6797\u78F7\u9716\u4E34\u90BB\u9CDE\u6DCB\u51DB\u8D41\u541D\u62CE\u73B2\u83F1\u96F6\u9F84\u94C3\u4F36\u7F9A\u51CC\u7075\u9675\u5CAD\u9886\u53E6\u4EE4\u6E9C\u7409\u69B4\u786B\u998F\u7559\u5218\u7624\u6D41\u67F3\u516D\u9F99\u804B\u5499\u7B3C\u7ABF"],
      ["c240", "\u7FE4\u7FE7\u7FE8\u7FEA\u7FEB\u7FEC\u7FED\u7FEF\u7FF2\u7FF4", 6, "\u7FFD\u7FFE\u7FFF\u8002\u8007\u8008\u8009\u800A\u800E\u800F\u8011\u8013\u801A\u801B\u801D\u801E\u801F\u8021\u8023\u8024\u802B", 5, "\u8032\u8034\u8039\u803A\u803C\u803E\u8040\u8041\u8044\u8045\u8047\u8048\u8049\u804E\u804F\u8050\u8051\u8053\u8055\u8056\u8057"],
      ["c280", "\u8059\u805B", 13, "\u806B", 5, "\u8072", 11, "\u9686\u5784\u62E2\u9647\u697C\u5A04\u6402\u7BD3\u6F0F\u964B\u82A6\u5362\u9885\u5E90\u7089\u63B3\u5364\u864F\u9C81\u9E93\u788C\u9732\u8DEF\u8D42\u9E7F\u6F5E\u7984\u5F55\u9646\u622E\u9A74\u5415\u94DD\u4FA3\u65C5\u5C65\u5C61\u7F15\u8651\u6C2F\u5F8B\u7387\u6EE4\u7EFF\u5CE6\u631B\u5B6A\u6EE6\u5375\u4E71\u63A0\u7565\u62A1\u8F6E\u4F26\u4ED1\u6CA6\u7EB6\u8BBA\u841D\u87BA\u7F57\u903B\u9523\u7BA9\u9AA1\u88F8\u843D\u6D1B\u9A86\u7EDC\u5988\u9EBB\u739B\u7801\u8682\u9A6C\u9A82\u561B\u5417\u57CB\u4E70\u9EA6\u5356\u8FC8\u8109\u7792\u9992\u86EE\u6EE1\u8513\u66FC\u6162\u6F2B"],
      ["c340", "\u807E\u8081\u8082\u8085\u8088\u808A\u808D", 5, "\u8094\u8095\u8097\u8099\u809E\u80A3\u80A6\u80A7\u80A8\u80AC\u80B0\u80B3\u80B5\u80B6\u80B8\u80B9\u80BB\u80C5\u80C7", 4, "\u80CF", 6, "\u80D8\u80DF\u80E0\u80E2\u80E3\u80E6\u80EE\u80F5\u80F7\u80F9\u80FB\u80FE\u80FF\u8100\u8101\u8103\u8104\u8105\u8107\u8108\u810B"],
      ["c380", "\u810C\u8115\u8117\u8119\u811B\u811C\u811D\u811F", 12, "\u812D\u812E\u8130\u8133\u8134\u8135\u8137\u8139", 4, "\u813F\u8C29\u8292\u832B\u76F2\u6C13\u5FD9\u83BD\u732B\u8305\u951A\u6BDB\u77DB\u94C6\u536F\u8302\u5192\u5E3D\u8C8C\u8D38\u4E48\u73AB\u679A\u6885\u9176\u9709\u7164\u6CA1\u7709\u5A92\u9541\u6BCF\u7F8E\u6627\u5BD0\u59B9\u5A9A\u95E8\u95F7\u4EEC\u840C\u8499\u6AAC\u76DF\u9530\u731B\u68A6\u5B5F\u772F\u919A\u9761\u7CDC\u8FF7\u8C1C\u5F25\u7C73\u79D8\u89C5\u6CCC\u871C\u5BC6\u5E42\u68C9\u7720\u7EF5\u5195\u514D\u52C9\u5A29\u7F05\u9762\u82D7\u63CF\u7784\u85D0\u79D2\u6E3A\u5E99\u5999\u8511\u706D\u6C11\u62BF\u76BF\u654F\u60AF\u95FD\u660E\u879F\u9E23\u94ED\u540D\u547D\u8C2C\u6478"],
      ["c440", "\u8140", 5, "\u8147\u8149\u814D\u814E\u814F\u8152\u8156\u8157\u8158\u815B", 4, "\u8161\u8162\u8163\u8164\u8166\u8168\u816A\u816B\u816C\u816F\u8172\u8173\u8175\u8176\u8177\u8178\u8181\u8183", 4, "\u8189\u818B\u818C\u818D\u818E\u8190\u8192", 5, "\u8199\u819A\u819E", 4, "\u81A4\u81A5"],
      ["c480", "\u81A7\u81A9\u81AB", 7, "\u81B4", 5, "\u81BC\u81BD\u81BE\u81BF\u81C4\u81C5\u81C7\u81C8\u81C9\u81CB\u81CD", 6, "\u6479\u8611\u6A21\u819C\u78E8\u6469\u9B54\u62B9\u672B\u83AB\u58A8\u9ED8\u6CAB\u6F20\u5BDE\u964C\u8C0B\u725F\u67D0\u62C7\u7261\u4EA9\u59C6\u6BCD\u5893\u66AE\u5E55\u52DF\u6155\u6728\u76EE\u7766\u7267\u7A46\u62FF\u54EA\u5450\u94A0\u90A3\u5A1C\u7EB3\u6C16\u4E43\u5976\u8010\u5948\u5357\u7537\u96BE\u56CA\u6320\u8111\u607C\u95F9\u6DD6\u5462\u9981\u5185\u5AE9\u80FD\u59AE\u9713\u502A\u6CE5\u5C3C\u62DF\u4F60\u533F\u817B\u9006\u6EBA\u852B\u62C8\u5E74\u78BE\u64B5\u637B\u5FF5\u5A18\u917F\u9E1F\u5C3F\u634F\u8042\u5B7D\u556E\u954A\u954D\u6D85\u60A8\u67E0\u72DE\u51DD\u5B81"],
      ["c540", "\u81D4", 14, "\u81E4\u81E5\u81E6\u81E8\u81E9\u81EB\u81EE", 4, "\u81F5", 5, "\u81FD\u81FF\u8203\u8207", 4, "\u820E\u820F\u8211\u8213\u8215", 5, "\u821D\u8220\u8224\u8225\u8226\u8227\u8229\u822E\u8232\u823A\u823C\u823D\u823F"],
      ["c580", "\u8240\u8241\u8242\u8243\u8245\u8246\u8248\u824A\u824C\u824D\u824E\u8250", 7, "\u8259\u825B\u825C\u825D\u825E\u8260", 7, "\u8269\u62E7\u6CDE\u725B\u626D\u94AE\u7EBD\u8113\u6D53\u519C\u5F04\u5974\u52AA\u6012\u5973\u6696\u8650\u759F\u632A\u61E6\u7CEF\u8BFA\u54E6\u6B27\u9E25\u6BB4\u85D5\u5455\u5076\u6CA4\u556A\u8DB4\u722C\u5E15\u6015\u7436\u62CD\u6392\u724C\u5F98\u6E43\u6D3E\u6500\u6F58\u76D8\u78D0\u76FC\u7554\u5224\u53DB\u4E53\u5E9E\u65C1\u802A\u80D6\u629B\u5486\u5228\u70AE\u888D\u8DD1\u6CE1\u5478\u80DA\u57F9\u88F4\u8D54\u966A\u914D\u4F69\u6C9B\u55B7\u76C6\u7830\u62A8\u70F9\u6F8E\u5F6D\u84EC\u68DA\u787C\u7BF7\u81A8\u670B\u9E4F\u6367\u78B0\u576F\u7812\u9739\u6279\u62AB\u5288\u7435\u6BD7"],
      ["c640", "\u826A\u826B\u826C\u826D\u8271\u8275\u8276\u8277\u8278\u827B\u827C\u8280\u8281\u8283\u8285\u8286\u8287\u8289\u828C\u8290\u8293\u8294\u8295\u8296\u829A\u829B\u829E\u82A0\u82A2\u82A3\u82A7\u82B2\u82B5\u82B6\u82BA\u82BB\u82BC\u82BF\u82C0\u82C2\u82C3\u82C5\u82C6\u82C9\u82D0\u82D6\u82D9\u82DA\u82DD\u82E2\u82E7\u82E8\u82E9\u82EA\u82EC\u82ED\u82EE\u82F0\u82F2\u82F3\u82F5\u82F6\u82F8"],
      ["c680", "\u82FA\u82FC", 4, "\u830A\u830B\u830D\u8310\u8312\u8313\u8316\u8318\u8319\u831D", 9, "\u8329\u832A\u832E\u8330\u8332\u8337\u833B\u833D\u5564\u813E\u75B2\u76AE\u5339\u75DE\u50FB\u5C41\u8B6C\u7BC7\u504F\u7247\u9A97\u98D8\u6F02\u74E2\u7968\u6487\u77A5\u62FC\u9891\u8D2B\u54C1\u8058\u4E52\u576A\u82F9\u840D\u5E73\u51ED\u74F6\u8BC4\u5C4F\u5761\u6CFC\u9887\u5A46\u7834\u9B44\u8FEB\u7C95\u5256\u6251\u94FA\u4EC6\u8386\u8461\u83E9\u84B2\u57D4\u6734\u5703\u666E\u6D66\u8C31\u66DD\u7011\u671F\u6B3A\u6816\u621A\u59BB\u4E03\u51C4\u6F06\u67D2\u6C8F\u5176\u68CB\u5947\u6B67\u7566\u5D0E\u8110\u9F50\u65D7\u7948\u7941\u9A91\u8D77\u5C82\u4E5E\u4F01\u542F\u5951\u780C\u5668\u6C14\u8FC4\u5F03\u6C7D\u6CE3\u8BAB\u6390"],
      ["c740", "\u833E\u833F\u8341\u8342\u8344\u8345\u8348\u834A", 4, "\u8353\u8355", 4, "\u835D\u8362\u8370", 6, "\u8379\u837A\u837E", 6, "\u8387\u8388\u838A\u838B\u838C\u838D\u838F\u8390\u8391\u8394\u8395\u8396\u8397\u8399\u839A\u839D\u839F\u83A1", 6, "\u83AC\u83AD\u83AE"],
      ["c780", "\u83AF\u83B5\u83BB\u83BE\u83BF\u83C2\u83C3\u83C4\u83C6\u83C8\u83C9\u83CB\u83CD\u83CE\u83D0\u83D1\u83D2\u83D3\u83D5\u83D7\u83D9\u83DA\u83DB\u83DE\u83E2\u83E3\u83E4\u83E6\u83E7\u83E8\u83EB\u83EC\u83ED\u6070\u6D3D\u7275\u6266\u948E\u94C5\u5343\u8FC1\u7B7E\u4EDF\u8C26\u4E7E\u9ED4\u94B1\u94B3\u524D\u6F5C\u9063\u6D45\u8C34\u5811\u5D4C\u6B20\u6B49\u67AA\u545B\u8154\u7F8C\u5899\u8537\u5F3A\u62A2\u6A47\u9539\u6572\u6084\u6865\u77A7\u4E54\u4FA8\u5DE7\u9798\u64AC\u7FD8\u5CED\u4FCF\u7A8D\u5207\u8304\u4E14\u602F\u7A83\u94A6\u4FB5\u4EB2\u79E6\u7434\u52E4\u82B9\u64D2\u79BD\u5BDD\u6C81\u9752\u8F7B\u6C22\u503E\u537F\u6E05\u64CE\u6674\u6C30\u60C5\u9877\u8BF7\u5E86\u743C\u7A77\u79CB\u4E18\u90B1\u7403\u6C42\u56DA\u914B\u6CC5\u8D8B\u533A\u86C6\u66F2\u8EAF\u5C48\u9A71\u6E20"],
      ["c840", "\u83EE\u83EF\u83F3", 4, "\u83FA\u83FB\u83FC\u83FE\u83FF\u8400\u8402\u8405\u8407\u8408\u8409\u840A\u8410\u8412", 5, "\u8419\u841A\u841B\u841E", 5, "\u8429", 7, "\u8432", 5, "\u8439\u843A\u843B\u843E", 7, "\u8447\u8448\u8449"],
      ["c880", "\u844A", 6, "\u8452", 4, "\u8458\u845D\u845E\u845F\u8460\u8462\u8464", 4, "\u846A\u846E\u846F\u8470\u8472\u8474\u8477\u8479\u847B\u847C\u53D6\u5A36\u9F8B\u8DA3\u53BB\u5708\u98A7\u6743\u919B\u6CC9\u5168\u75CA\u62F3\u72AC\u5238\u529D\u7F3A\u7094\u7638\u5374\u9E4A\u69B7\u786E\u96C0\u88D9\u7FA4\u7136\u71C3\u5189\u67D3\u74E4\u58E4\u6518\u56B7\u8BA9\u9976\u6270\u7ED5\u60F9\u70ED\u58EC\u4EC1\u4EBA\u5FCD\u97E7\u4EFB\u8BA4\u5203\u598A\u7EAB\u6254\u4ECD\u65E5\u620E\u8338\u84C9\u8363\u878D\u7194\u6EB6\u5BB9\u7ED2\u5197\u63C9\u67D4\u8089\u8339\u8815\u5112\u5B7A\u5982\u8FB1\u4E73\u6C5D\u5165\u8925\u8F6F\u962E\u854A\u745E\u9510\u95F0\u6DA6\u82E5\u5F31\u6492\u6D12\u8428\u816E\u9CC3\u585E\u8D5B\u4E09\u53C1"],
      ["c940", "\u847D", 4, "\u8483\u8484\u8485\u8486\u848A\u848D\u848F", 7, "\u8498\u849A\u849B\u849D\u849E\u849F\u84A0\u84A2", 12, "\u84B0\u84B1\u84B3\u84B5\u84B6\u84B7\u84BB\u84BC\u84BE\u84C0\u84C2\u84C3\u84C5\u84C6\u84C7\u84C8\u84CB\u84CC\u84CE\u84CF\u84D2\u84D4\u84D5\u84D7"],
      ["c980", "\u84D8", 4, "\u84DE\u84E1\u84E2\u84E4\u84E7", 4, "\u84ED\u84EE\u84EF\u84F1", 10, "\u84FD\u84FE\u8500\u8501\u8502\u4F1E\u6563\u6851\u55D3\u4E27\u6414\u9A9A\u626B\u5AC2\u745F\u8272\u6DA9\u68EE\u50E7\u838E\u7802\u6740\u5239\u6C99\u7EB1\u50BB\u5565\u715E\u7B5B\u6652\u73CA\u82EB\u6749\u5C71\u5220\u717D\u886B\u95EA\u9655\u64C5\u8D61\u81B3\u5584\u6C55\u6247\u7F2E\u5892\u4F24\u5546\u8D4F\u664C\u4E0A\u5C1A\u88F3\u68A2\u634E\u7A0D\u70E7\u828D\u52FA\u97F6\u5C11\u54E8\u90B5\u7ECD\u5962\u8D4A\u86C7\u820C\u820D\u8D66\u6444\u5C04\u6151\u6D89\u793E\u8BBE\u7837\u7533\u547B\u4F38\u8EAB\u6DF1\u5A20\u7EC5\u795E\u6C88\u5BA1\u5A76\u751A\u80BE\u614E\u6E17\u58F0\u751F\u7525\u7272\u5347\u7EF3"],
      ["ca40", "\u8503", 8, "\u850D\u850E\u850F\u8510\u8512\u8514\u8515\u8516\u8518\u8519\u851B\u851C\u851D\u851E\u8520\u8522", 8, "\u852D", 9, "\u853E", 4, "\u8544\u8545\u8546\u8547\u854B", 10],
      ["ca80", "\u8557\u8558\u855A\u855B\u855C\u855D\u855F", 4, "\u8565\u8566\u8567\u8569", 8, "\u8573\u8575\u8576\u8577\u8578\u857C\u857D\u857F\u8580\u8581\u7701\u76DB\u5269\u80DC\u5723\u5E08\u5931\u72EE\u65BD\u6E7F\u8BD7\u5C38\u8671\u5341\u77F3\u62FE\u65F6\u4EC0\u98DF\u8680\u5B9E\u8BC6\u53F2\u77E2\u4F7F\u5C4E\u9A76\u59CB\u5F0F\u793A\u58EB\u4E16\u67FF\u4E8B\u62ED\u8A93\u901D\u52BF\u662F\u55DC\u566C\u9002\u4ED5\u4F8D\u91CA\u9970\u6C0F\u5E02\u6043\u5BA4\u89C6\u8BD5\u6536\u624B\u9996\u5B88\u5BFF\u6388\u552E\u53D7\u7626\u517D\u852C\u67A2\u68B3\u6B8A\u6292\u8F93\u53D4\u8212\u6DD1\u758F\u4E66\u8D4E\u5B70\u719F\u85AF\u6691\u66D9\u7F72\u8700\u9ECD\u9F20\u5C5E\u672F\u8FF0\u6811\u675F\u620D\u7AD6\u5885\u5EB6\u6570\u6F31"],
      ["cb40", "\u8582\u8583\u8586\u8588", 6, "\u8590", 10, "\u859D", 6, "\u85A5\u85A6\u85A7\u85A9\u85AB\u85AC\u85AD\u85B1", 5, "\u85B8\u85BA", 6, "\u85C2", 6, "\u85CA", 4, "\u85D1\u85D2"],
      ["cb80", "\u85D4\u85D6", 5, "\u85DD", 6, "\u85E5\u85E6\u85E7\u85E8\u85EA", 14, "\u6055\u5237\u800D\u6454\u8870\u7529\u5E05\u6813\u62F4\u971C\u53CC\u723D\u8C01\u6C34\u7761\u7A0E\u542E\u77AC\u987A\u821C\u8BF4\u7855\u6714\u70C1\u65AF\u6495\u5636\u601D\u79C1\u53F8\u4E1D\u6B7B\u8086\u5BFA\u55E3\u56DB\u4F3A\u4F3C\u9972\u5DF3\u677E\u8038\u6002\u9882\u9001\u5B8B\u8BBC\u8BF5\u641C\u8258\u64DE\u55FD\u82CF\u9165\u4FD7\u7D20\u901F\u7C9F\u50F3\u5851\u6EAF\u5BBF\u8BC9\u8083\u9178\u849C\u7B97\u867D\u968B\u968F\u7EE5\u9AD3\u788E\u5C81\u7A57\u9042\u96A7\u795F\u5B59\u635F\u7B0B\u84D1\u68AD\u5506\u7F29\u7410\u7D22\u9501\u6240\u584C\u4ED6\u5B83\u5979\u5854"],
      ["cc40", "\u85F9\u85FA\u85FC\u85FD\u85FE\u8600", 4, "\u8606", 10, "\u8612\u8613\u8614\u8615\u8617", 15, "\u8628\u862A", 13, "\u8639\u863A\u863B\u863D\u863E\u863F\u8640"],
      ["cc80", "\u8641", 11, "\u8652\u8653\u8655", 4, "\u865B\u865C\u865D\u865F\u8660\u8661\u8663", 7, "\u736D\u631E\u8E4B\u8E0F\u80CE\u82D4\u62AC\u53F0\u6CF0\u915E\u592A\u6001\u6C70\u574D\u644A\u8D2A\u762B\u6EE9\u575B\u6A80\u75F0\u6F6D\u8C2D\u8C08\u5766\u6BEF\u8892\u78B3\u63A2\u53F9\u70AD\u6C64\u5858\u642A\u5802\u68E0\u819B\u5510\u7CD6\u5018\u8EBA\u6DCC\u8D9F\u70EB\u638F\u6D9B\u6ED4\u7EE6\u8404\u6843\u9003\u6DD8\u9676\u8BA8\u5957\u7279\u85E4\u817E\u75BC\u8A8A\u68AF\u5254\u8E22\u9511\u63D0\u9898\u8E44\u557C\u4F53\u66FF\u568F\u60D5\u6D95\u5243\u5C49\u5929\u6DFB\u586B\u7530\u751C\u606C\u8214\u8146\u6311\u6761\u8FE2\u773A\u8DF3\u8D34\u94C1\u5E16\u5385\u542C\u70C3"],
      ["cd40", "\u866D\u866F\u8670\u8672", 6, "\u8683", 6, "\u868E", 4, "\u8694\u8696", 5, "\u869E", 4, "\u86A5\u86A6\u86AB\u86AD\u86AE\u86B2\u86B3\u86B7\u86B8\u86B9\u86BB", 4, "\u86C1\u86C2\u86C3\u86C5\u86C8\u86CC\u86CD\u86D2\u86D3\u86D5\u86D6\u86D7\u86DA\u86DC"],
      ["cd80", "\u86DD\u86E0\u86E1\u86E2\u86E3\u86E5\u86E6\u86E7\u86E8\u86EA\u86EB\u86EC\u86EF\u86F5\u86F6\u86F7\u86FA\u86FB\u86FC\u86FD\u86FF\u8701\u8704\u8705\u8706\u870B\u870C\u870E\u870F\u8710\u8711\u8714\u8716\u6C40\u5EF7\u505C\u4EAD\u5EAD\u633A\u8247\u901A\u6850\u916E\u77B3\u540C\u94DC\u5F64\u7AE5\u6876\u6345\u7B52\u7EDF\u75DB\u5077\u6295\u5934\u900F\u51F8\u79C3\u7A81\u56FE\u5F92\u9014\u6D82\u5C60\u571F\u5410\u5154\u6E4D\u56E2\u63A8\u9893\u817F\u8715\u892A\u9000\u541E\u5C6F\u81C0\u62D6\u6258\u8131\u9E35\u9640\u9A6E\u9A7C\u692D\u59A5\u62D3\u553E\u6316\u54C7\u86D9\u6D3C\u5A03\u74E6\u889C\u6B6A\u5916\u8C4C\u5F2F\u6E7E\u73A9\u987D\u4E38\u70F7\u5B8C\u7897\u633D\u665A\u7696\u60CB\u5B9B\u5A49\u4E07\u8155\u6C6A\u738B\u4EA1\u6789\u7F51\u5F80\u65FA\u671B\u5FD8\u5984\u5A01"],
      ["ce40", "\u8719\u871B\u871D\u871F\u8720\u8724\u8726\u8727\u8728\u872A\u872B\u872C\u872D\u872F\u8730\u8732\u8733\u8735\u8736\u8738\u8739\u873A\u873C\u873D\u8740", 6, "\u874A\u874B\u874D\u874F\u8750\u8751\u8752\u8754\u8755\u8756\u8758\u875A", 5, "\u8761\u8762\u8766", 7, "\u876F\u8771\u8772\u8773\u8775"],
      ["ce80", "\u8777\u8778\u8779\u877A\u877F\u8780\u8781\u8784\u8786\u8787\u8789\u878A\u878C\u878E", 4, "\u8794\u8795\u8796\u8798", 6, "\u87A0", 4, "\u5DCD\u5FAE\u5371\u97E6\u8FDD\u6845\u56F4\u552F\u60DF\u4E3A\u6F4D\u7EF4\u82C7\u840E\u59D4\u4F1F\u4F2A\u5C3E\u7EAC\u672A\u851A\u5473\u754F\u80C3\u5582\u9B4F\u4F4D\u6E2D\u8C13\u5C09\u6170\u536B\u761F\u6E29\u868A\u6587\u95FB\u7EB9\u543B\u7A33\u7D0A\u95EE\u55E1\u7FC1\u74EE\u631D\u8717\u6DA1\u7A9D\u6211\u65A1\u5367\u63E1\u6C83\u5DEB\u545C\u94A8\u4E4C\u6C61\u8BEC\u5C4B\u65E0\u829C\u68A7\u543E\u5434\u6BCB\u6B66\u4E94\u6342\u5348\u821E\u4F0D\u4FAE\u575E\u620A\u96FE\u6664\u7269\u52FF\u52A1\u609F\u8BEF\u6614\u7199\u6790\u897F\u7852\u77FD\u6670\u563B\u5438\u9521\u727A"],
      ["cf40", "\u87A5\u87A6\u87A7\u87A9\u87AA\u87AE\u87B0\u87B1\u87B2\u87B4\u87B6\u87B7\u87B8\u87B9\u87BB\u87BC\u87BE\u87BF\u87C1", 4, "\u87C7\u87C8\u87C9\u87CC", 4, "\u87D4", 6, "\u87DC\u87DD\u87DE\u87DF\u87E1\u87E2\u87E3\u87E4\u87E6\u87E7\u87E8\u87E9\u87EB\u87EC\u87ED\u87EF", 9],
      ["cf80", "\u87FA\u87FB\u87FC\u87FD\u87FF\u8800\u8801\u8802\u8804", 5, "\u880B", 7, "\u8814\u8817\u8818\u8819\u881A\u881C", 4, "\u8823\u7A00\u606F\u5E0C\u6089\u819D\u5915\u60DC\u7184\u70EF\u6EAA\u6C50\u7280\u6A84\u88AD\u5E2D\u4E60\u5AB3\u559C\u94E3\u6D17\u7CFB\u9699\u620F\u7EC6\u778E\u867E\u5323\u971E\u8F96\u6687\u5CE1\u4FA0\u72ED\u4E0B\u53A6\u590F\u5413\u6380\u9528\u5148\u4ED9\u9C9C\u7EA4\u54B8\u8D24\u8854\u8237\u95F2\u6D8E\u5F26\u5ACC\u663E\u9669\u73B0\u732E\u53BF\u817A\u9985\u7FA1\u5BAA\u9677\u9650\u7EBF\u76F8\u53A2\u9576\u9999\u7BB1\u8944\u6E58\u4E61\u7FD4\u7965\u8BE6\u60F3\u54CD\u4EAB\u9879\u5DF7\u6A61\u50CF\u5411\u8C61\u8427\u785D\u9704\u524A\u54EE\u56A3\u9500\u6D88\u5BB5\u6DC6\u6653"],
      ["d040", "\u8824", 13, "\u8833", 5, "\u883A\u883B\u883D\u883E\u883F\u8841\u8842\u8843\u8846", 5, "\u884E", 5, "\u8855\u8856\u8858\u885A", 6, "\u8866\u8867\u886A\u886D\u886F\u8871\u8873\u8874\u8875\u8876\u8878\u8879\u887A"],
      ["d080", "\u887B\u887C\u8880\u8883\u8886\u8887\u8889\u888A\u888C\u888E\u888F\u8890\u8891\u8893\u8894\u8895\u8897", 4, "\u889D", 4, "\u88A3\u88A5", 5, "\u5C0F\u5B5D\u6821\u8096\u5578\u7B11\u6548\u6954\u4E9B\u6B47\u874E\u978B\u534F\u631F\u643A\u90AA\u659C\u80C1\u8C10\u5199\u68B0\u5378\u87F9\u61C8\u6CC4\u6CFB\u8C22\u5C51\u85AA\u82AF\u950C\u6B23\u8F9B\u65B0\u5FFB\u5FC3\u4FE1\u8845\u661F\u8165\u7329\u60FA\u5174\u5211\u578B\u5F62\u90A2\u884C\u9192\u5E78\u674F\u6027\u59D3\u5144\u51F6\u80F8\u5308\u6C79\u96C4\u718A\u4F11\u4FEE\u7F9E\u673D\u55C5\u9508\u79C0\u8896\u7EE3\u589F\u620C\u9700\u865A\u5618\u987B\u5F90\u8BB8\u84C4\u9157\u53D9\u65ED\u5E8F\u755C\u6064\u7D6E\u5A7F\u7EEA\u7EED\u8F69\u55A7\u5BA3\u60AC\u65CB\u7384"],
      ["d140", "\u88AC\u88AE\u88AF\u88B0\u88B2", 4, "\u88B8\u88B9\u88BA\u88BB\u88BD\u88BE\u88BF\u88C0\u88C3\u88C4\u88C7\u88C8\u88CA\u88CB\u88CC\u88CD\u88CF\u88D0\u88D1\u88D3\u88D6\u88D7\u88DA", 4, "\u88E0\u88E1\u88E6\u88E7\u88E9", 6, "\u88F2\u88F5\u88F6\u88F7\u88FA\u88FB\u88FD\u88FF\u8900\u8901\u8903", 5],
      ["d180", "\u8909\u890B", 4, "\u8911\u8914", 4, "\u891C", 4, "\u8922\u8923\u8924\u8926\u8927\u8928\u8929\u892C\u892D\u892E\u892F\u8931\u8932\u8933\u8935\u8937\u9009\u7663\u7729\u7EDA\u9774\u859B\u5B66\u7A74\u96EA\u8840\u52CB\u718F\u5FAA\u65EC\u8BE2\u5BFB\u9A6F\u5DE1\u6B89\u6C5B\u8BAD\u8BAF\u900A\u8FC5\u538B\u62BC\u9E26\u9E2D\u5440\u4E2B\u82BD\u7259\u869C\u5D16\u8859\u6DAF\u96C5\u54D1\u4E9A\u8BB6\u7109\u54BD\u9609\u70DF\u6DF9\u76D0\u4E25\u7814\u8712\u5CA9\u5EF6\u8A00\u989C\u960E\u708E\u6CBF\u5944\u63A9\u773C\u884D\u6F14\u8273\u5830\u71D5\u538C\u781A\u96C1\u5501\u5F66\u7130\u5BB4\u8C1A\u9A8C\u6B83\u592E\u9E2F\u79E7\u6768\u626C\u4F6F\u75A1\u7F8A\u6D0B\u9633\u6C27\u4EF0\u75D2\u517B\u6837\u6F3E\u9080\u8170\u5996\u7476"],
      ["d240", "\u8938", 8, "\u8942\u8943\u8945", 24, "\u8960", 5, "\u8967", 19, "\u897C"],
      ["d280", "\u897D\u897E\u8980\u8982\u8984\u8985\u8987", 26, "\u6447\u5C27\u9065\u7A91\u8C23\u59DA\u54AC\u8200\u836F\u8981\u8000\u6930\u564E\u8036\u7237\u91CE\u51B6\u4E5F\u9875\u6396\u4E1A\u53F6\u66F3\u814B\u591C\u6DB2\u4E00\u58F9\u533B\u63D6\u94F1\u4F9D\u4F0A\u8863\u9890\u5937\u9057\u79FB\u4EEA\u80F0\u7591\u6C82\u5B9C\u59E8\u5F5D\u6905\u8681\u501A\u5DF2\u4E59\u77E3\u4EE5\u827A\u6291\u6613\u9091\u5C79\u4EBF\u5F79\u81C6\u9038\u8084\u75AB\u4EA6\u88D4\u610F\u6BC5\u5FC6\u4E49\u76CA\u6EA2\u8BE3\u8BAE\u8C0A\u8BD1\u5F02\u7FFC\u7FCC\u7ECE\u8335\u836B\u56E0\u6BB7\u97F3\u9634\u59FB\u541F\u94F6\u6DEB\u5BC5\u996E\u5C39\u5F15\u9690"],
      ["d340", "\u89A2", 30, "\u89C3\u89CD\u89D3\u89D4\u89D5\u89D7\u89D8\u89D9\u89DB\u89DD\u89DF\u89E0\u89E1\u89E2\u89E4\u89E7\u89E8\u89E9\u89EA\u89EC\u89ED\u89EE\u89F0\u89F1\u89F2\u89F4", 6],
      ["d380", "\u89FB", 4, "\u8A01", 5, "\u8A08", 21, "\u5370\u82F1\u6A31\u5A74\u9E70\u5E94\u7F28\u83B9\u8424\u8425\u8367\u8747\u8FCE\u8D62\u76C8\u5F71\u9896\u786C\u6620\u54DF\u62E5\u4F63\u81C3\u75C8\u5EB8\u96CD\u8E0A\u86F9\u548F\u6CF3\u6D8C\u6C38\u607F\u52C7\u7528\u5E7D\u4F18\u60A0\u5FE7\u5C24\u7531\u90AE\u94C0\u72B9\u6CB9\u6E38\u9149\u6709\u53CB\u53F3\u4F51\u91C9\u8BF1\u53C8\u5E7C\u8FC2\u6DE4\u4E8E\u76C2\u6986\u865E\u611A\u8206\u4F59\u4FDE\u903E\u9C7C\u6109\u6E1D\u6E14\u9685\u4E88\u5A31\u96E8\u4E0E\u5C7F\u79B9\u5B87\u8BED\u7FBD\u7389\u57DF\u828B\u90C1\u5401\u9047\u55BB\u5CEA\u5FA1\u6108\u6B32\u72F1\u80B2\u8A89"],
      ["d440", "\u8A1E", 31, "\u8A3F", 8, "\u8A49", 21],
      ["d480", "\u8A5F", 25, "\u8A7A", 6, "\u6D74\u5BD3\u88D5\u9884\u8C6B\u9A6D\u9E33\u6E0A\u51A4\u5143\u57A3\u8881\u539F\u63F4\u8F95\u56ED\u5458\u5706\u733F\u6E90\u7F18\u8FDC\u82D1\u613F\u6028\u9662\u66F0\u7EA6\u8D8A\u8DC3\u94A5\u5CB3\u7CA4\u6708\u60A6\u9605\u8018\u4E91\u90E7\u5300\u9668\u5141\u8FD0\u8574\u915D\u6655\u97F5\u5B55\u531D\u7838\u6742\u683D\u54C9\u707E\u5BB0\u8F7D\u518D\u5728\u54B1\u6512\u6682\u8D5E\u8D43\u810F\u846C\u906D\u7CDF\u51FF\u85FB\u67A3\u65E9\u6FA1\u86A4\u8E81\u566A\u9020\u7682\u7076\u71E5\u8D23\u62E9\u5219\u6CFD\u8D3C\u600E\u589E\u618E\u66FE\u8D60\u624E\u55B3\u6E23\u672D\u8F67"],
      ["d540", "\u8A81", 7, "\u8A8B", 7, "\u8A94", 46],
      ["d580", "\u8AC3", 32, "\u94E1\u95F8\u7728\u6805\u69A8\u548B\u4E4D\u70B8\u8BC8\u6458\u658B\u5B85\u7A84\u503A\u5BE8\u77BB\u6BE1\u8A79\u7C98\u6CBE\u76CF\u65A9\u8F97\u5D2D\u5C55\u8638\u6808\u5360\u6218\u7AD9\u6E5B\u7EFD\u6A1F\u7AE0\u5F70\u6F33\u5F20\u638C\u6DA8\u6756\u4E08\u5E10\u8D26\u4ED7\u80C0\u7634\u969C\u62DB\u662D\u627E\u6CBC\u8D75\u7167\u7F69\u5146\u8087\u53EC\u906E\u6298\u54F2\u86F0\u8F99\u8005\u9517\u8517\u8FD9\u6D59\u73CD\u659F\u771F\u7504\u7827\u81FB\u8D1E\u9488\u4FA6\u6795\u75B9\u8BCA\u9707\u632F\u9547\u9635\u84B8\u6323\u7741\u5F81\u72F0\u4E89\u6014\u6574\u62EF\u6B63\u653F"],
      ["d640", "\u8AE4", 34, "\u8B08", 27],
      ["d680", "\u8B24\u8B25\u8B27", 30, "\u5E27\u75C7\u90D1\u8BC1\u829D\u679D\u652F\u5431\u8718\u77E5\u80A2\u8102\u6C41\u4E4B\u7EC7\u804C\u76F4\u690D\u6B96\u6267\u503C\u4F84\u5740\u6307\u6B62\u8DBE\u53EA\u65E8\u7EB8\u5FD7\u631A\u63B7\u81F3\u81F4\u7F6E\u5E1C\u5CD9\u5236\u667A\u79E9\u7A1A\u8D28\u7099\u75D4\u6EDE\u6CBB\u7A92\u4E2D\u76C5\u5FE0\u949F\u8877\u7EC8\u79CD\u80BF\u91CD\u4EF2\u4F17\u821F\u5468\u5DDE\u6D32\u8BCC\u7CA5\u8F74\u8098\u5E1A\u5492\u76B1\u5B99\u663C\u9AA4\u73E0\u682A\u86DB\u6731\u732A\u8BF8\u8BDB\u9010\u7AF9\u70DB\u716E\u62C4\u77A9\u5631\u4E3B\u8457\u67F1\u52A9\u86C0\u8D2E\u94F8\u7B51"],
      ["d740", "\u8B46", 31, "\u8B67", 4, "\u8B6D", 25],
      ["d780", "\u8B87", 24, "\u8BAC\u8BB1\u8BBB\u8BC7\u8BD0\u8BEA\u8C09\u8C1E\u4F4F\u6CE8\u795D\u9A7B\u6293\u722A\u62FD\u4E13\u7816\u8F6C\u64B0\u8D5A\u7BC6\u6869\u5E84\u88C5\u5986\u649E\u58EE\u72B6\u690E\u9525\u8FFD\u8D58\u5760\u7F00\u8C06\u51C6\u6349\u62D9\u5353\u684C\u7422\u8301\u914C\u5544\u7740\u707C\u6D4A\u5179\u54A8\u8D44\u59FF\u6ECB\u6DC4\u5B5C\u7D2B\u4ED4\u7C7D\u6ED3\u5B50\u81EA\u6E0D\u5B57\u9B03\u68D5\u8E2A\u5B97\u7EFC\u603B\u7EB5\u90B9\u8D70\u594F\u63CD\u79DF\u8DB3\u5352\u65CF\u7956\u8BC5\u963B\u7EC4\u94BB\u7E82\u5634\u9189\u6700\u7F6A\u5C0A\u9075\u6628\u5DE6\u4F50\u67DE\u505A\u4F5C\u5750\u5EA7"],
      ["d840", "\u8C38", 8, "\u8C42\u8C43\u8C44\u8C45\u8C48\u8C4A\u8C4B\u8C4D", 7, "\u8C56\u8C57\u8C58\u8C59\u8C5B", 5, "\u8C63", 6, "\u8C6C", 6, "\u8C74\u8C75\u8C76\u8C77\u8C7B", 6, "\u8C83\u8C84\u8C86\u8C87"],
      ["d880", "\u8C88\u8C8B\u8C8D", 6, "\u8C95\u8C96\u8C97\u8C99", 20, "\u4E8D\u4E0C\u5140\u4E10\u5EFF\u5345\u4E15\u4E98\u4E1E\u9B32\u5B6C\u5669\u4E28\u79BA\u4E3F\u5315\u4E47\u592D\u723B\u536E\u6C10\u56DF\u80E4\u9997\u6BD3\u777E\u9F17\u4E36\u4E9F\u9F10\u4E5C\u4E69\u4E93\u8288\u5B5B\u556C\u560F\u4EC4\u538D\u539D\u53A3\u53A5\u53AE\u9765\u8D5D\u531A\u53F5\u5326\u532E\u533E\u8D5C\u5366\u5363\u5202\u5208\u520E\u522D\u5233\u523F\u5240\u524C\u525E\u5261\u525C\u84AF\u527D\u5282\u5281\u5290\u5293\u5182\u7F54\u4EBB\u4EC3\u4EC9\u4EC2\u4EE8\u4EE1\u4EEB\u4EDE\u4F1B\u4EF3\u4F22\u4F64\u4EF5\u4F25\u4F27\u4F09\u4F2B\u4F5E\u4F67\u6538\u4F5A\u4F5D"],
      ["d940", "\u8CAE", 62],
      ["d980", "\u8CED", 32, "\u4F5F\u4F57\u4F32\u4F3D\u4F76\u4F74\u4F91\u4F89\u4F83\u4F8F\u4F7E\u4F7B\u4FAA\u4F7C\u4FAC\u4F94\u4FE6\u4FE8\u4FEA\u4FC5\u4FDA\u4FE3\u4FDC\u4FD1\u4FDF\u4FF8\u5029\u504C\u4FF3\u502C\u500F\u502E\u502D\u4FFE\u501C\u500C\u5025\u5028\u507E\u5043\u5055\u5048\u504E\u506C\u507B\u50A5\u50A7\u50A9\u50BA\u50D6\u5106\u50ED\u50EC\u50E6\u50EE\u5107\u510B\u4EDD\u6C3D\u4F58\u4F65\u4FCE\u9FA0\u6C46\u7C74\u516E\u5DFD\u9EC9\u9998\u5181\u5914\u52F9\u530D\u8A07\u5310\u51EB\u5919\u5155\u4EA0\u5156\u4EB3\u886E\u88A4\u4EB5\u8114\u88D2\u7980\u5B34\u8803\u7FB8\u51AB\u51B1\u51BD\u51BC"],
      ["da40", "\u8D0E", 14, "\u8D20\u8D51\u8D52\u8D57\u8D5F\u8D65\u8D68\u8D69\u8D6A\u8D6C\u8D6E\u8D6F\u8D71\u8D72\u8D78", 8, "\u8D82\u8D83\u8D86\u8D87\u8D88\u8D89\u8D8C", 4, "\u8D92\u8D93\u8D95", 9, "\u8DA0\u8DA1"],
      ["da80", "\u8DA2\u8DA4", 12, "\u8DB2\u8DB6\u8DB7\u8DB9\u8DBB\u8DBD\u8DC0\u8DC1\u8DC2\u8DC5\u8DC7\u8DC8\u8DC9\u8DCA\u8DCD\u8DD0\u8DD2\u8DD3\u8DD4\u51C7\u5196\u51A2\u51A5\u8BA0\u8BA6\u8BA7\u8BAA\u8BB4\u8BB5\u8BB7\u8BC2\u8BC3\u8BCB\u8BCF\u8BCE\u8BD2\u8BD3\u8BD4\u8BD6\u8BD8\u8BD9\u8BDC\u8BDF\u8BE0\u8BE4\u8BE8\u8BE9\u8BEE\u8BF0\u8BF3\u8BF6\u8BF9\u8BFC\u8BFF\u8C00\u8C02\u8C04\u8C07\u8C0C\u8C0F\u8C11\u8C12\u8C14\u8C15\u8C16\u8C19\u8C1B\u8C18\u8C1D\u8C1F\u8C20\u8C21\u8C25\u8C27\u8C2A\u8C2B\u8C2E\u8C2F\u8C32\u8C33\u8C35\u8C36\u5369\u537A\u961D\u9622\u9621\u9631\u962A\u963D\u963C\u9642\u9649\u9654\u965F\u9667\u966C\u9672\u9674\u9688\u968D\u9697\u96B0\u9097\u909B\u909D\u9099\u90AC\u90A1\u90B4\u90B3\u90B6\u90BA"],
      ["db40", "\u8DD5\u8DD8\u8DD9\u8DDC\u8DE0\u8DE1\u8DE2\u8DE5\u8DE6\u8DE7\u8DE9\u8DED\u8DEE\u8DF0\u8DF1\u8DF2\u8DF4\u8DF6\u8DFC\u8DFE", 6, "\u8E06\u8E07\u8E08\u8E0B\u8E0D\u8E0E\u8E10\u8E11\u8E12\u8E13\u8E15", 7, "\u8E20\u8E21\u8E24", 4, "\u8E2B\u8E2D\u8E30\u8E32\u8E33\u8E34\u8E36\u8E37\u8E38\u8E3B\u8E3C\u8E3E"],
      ["db80", "\u8E3F\u8E43\u8E45\u8E46\u8E4C", 4, "\u8E53", 5, "\u8E5A", 11, "\u8E67\u8E68\u8E6A\u8E6B\u8E6E\u8E71\u90B8\u90B0\u90CF\u90C5\u90BE\u90D0\u90C4\u90C7\u90D3\u90E6\u90E2\u90DC\u90D7\u90DB\u90EB\u90EF\u90FE\u9104\u9122\u911E\u9123\u9131\u912F\u9139\u9143\u9146\u520D\u5942\u52A2\u52AC\u52AD\u52BE\u54FF\u52D0\u52D6\u52F0\u53DF\u71EE\u77CD\u5EF4\u51F5\u51FC\u9B2F\u53B6\u5F01\u755A\u5DEF\u574C\u57A9\u57A1\u587E\u58BC\u58C5\u58D1\u5729\u572C\u572A\u5733\u5739\u572E\u572F\u575C\u573B\u5742\u5769\u5785\u576B\u5786\u577C\u577B\u5768\u576D\u5776\u5773\u57AD\u57A4\u578C\u57B2\u57CF\u57A7\u57B4\u5793\u57A0\u57D5\u57D8\u57DA\u57D9\u57D2\u57B8\u57F4\u57EF\u57F8\u57E4\u57DD"],
      ["dc40", "\u8E73\u8E75\u8E77", 4, "\u8E7D\u8E7E\u8E80\u8E82\u8E83\u8E84\u8E86\u8E88", 6, "\u8E91\u8E92\u8E93\u8E95", 6, "\u8E9D\u8E9F", 11, "\u8EAD\u8EAE\u8EB0\u8EB1\u8EB3", 6, "\u8EBB", 7],
      ["dc80", "\u8EC3", 10, "\u8ECF", 21, "\u580B\u580D\u57FD\u57ED\u5800\u581E\u5819\u5844\u5820\u5865\u586C\u5881\u5889\u589A\u5880\u99A8\u9F19\u61FF\u8279\u827D\u827F\u828F\u828A\u82A8\u8284\u828E\u8291\u8297\u8299\u82AB\u82B8\u82BE\u82B0\u82C8\u82CA\u82E3\u8298\u82B7\u82AE\u82CB\u82CC\u82C1\u82A9\u82B4\u82A1\u82AA\u829F\u82C4\u82CE\u82A4\u82E1\u8309\u82F7\u82E4\u830F\u8307\u82DC\u82F4\u82D2\u82D8\u830C\u82FB\u82D3\u8311\u831A\u8306\u8314\u8315\u82E0\u82D5\u831C\u8351\u835B\u835C\u8308\u8392\u833C\u8334\u8331\u839B\u835E\u832F\u834F\u8347\u8343\u835F\u8340\u8317\u8360\u832D\u833A\u8333\u8366\u8365"],
      ["dd40", "\u8EE5", 62],
      ["dd80", "\u8F24", 32, "\u8368\u831B\u8369\u836C\u836A\u836D\u836E\u83B0\u8378\u83B3\u83B4\u83A0\u83AA\u8393\u839C\u8385\u837C\u83B6\u83A9\u837D\u83B8\u837B\u8398\u839E\u83A8\u83BA\u83BC\u83C1\u8401\u83E5\u83D8\u5807\u8418\u840B\u83DD\u83FD\u83D6\u841C\u8438\u8411\u8406\u83D4\u83DF\u840F\u8403\u83F8\u83F9\u83EA\u83C5\u83C0\u8426\u83F0\u83E1\u845C\u8451\u845A\u8459\u8473\u8487\u8488\u847A\u8489\u8478\u843C\u8446\u8469\u8476\u848C\u848E\u8431\u846D\u84C1\u84CD\u84D0\u84E6\u84BD\u84D3\u84CA\u84BF\u84BA\u84E0\u84A1\u84B9\u84B4\u8497\u84E5\u84E3\u850C\u750D\u8538\u84F0\u8539\u851F\u853A"],
      ["de40", "\u8F45", 32, "\u8F6A\u8F80\u8F8C\u8F92\u8F9D\u8FA0\u8FA1\u8FA2\u8FA4\u8FA5\u8FA6\u8FA7\u8FAA\u8FAC\u8FAD\u8FAE\u8FAF\u8FB2\u8FB3\u8FB4\u8FB5\u8FB7\u8FB8\u8FBA\u8FBB\u8FBC\u8FBF\u8FC0\u8FC3\u8FC6"],
      ["de80", "\u8FC9", 4, "\u8FCF\u8FD2\u8FD6\u8FD7\u8FDA\u8FE0\u8FE1\u8FE3\u8FE7\u8FEC\u8FEF\u8FF1\u8FF2\u8FF4\u8FF5\u8FF6\u8FFA\u8FFB\u8FFC\u8FFE\u8FFF\u9007\u9008\u900C\u900E\u9013\u9015\u9018\u8556\u853B\u84FF\u84FC\u8559\u8548\u8568\u8564\u855E\u857A\u77A2\u8543\u8572\u857B\u85A4\u85A8\u8587\u858F\u8579\u85AE\u859C\u8585\u85B9\u85B7\u85B0\u85D3\u85C1\u85DC\u85FF\u8627\u8605\u8629\u8616\u863C\u5EFE\u5F08\u593C\u5941\u8037\u5955\u595A\u5958\u530F\u5C22\u5C25\u5C2C\u5C34\u624C\u626A\u629F\u62BB\u62CA\u62DA\u62D7\u62EE\u6322\u62F6\u6339\u634B\u6343\u63AD\u63F6\u6371\u637A\u638E\u63B4\u636D\u63AC\u638A\u6369\u63AE\u63BC\u63F2\u63F8\u63E0\u63FF\u63C4\u63DE\u63CE\u6452\u63C6\u63BE\u6445\u6441\u640B\u641B\u6420\u640C\u6426\u6421\u645E\u6484\u646D\u6496"],
      ["df40", "\u9019\u901C\u9023\u9024\u9025\u9027", 5, "\u9030", 4, "\u9037\u9039\u903A\u903D\u903F\u9040\u9043\u9045\u9046\u9048", 4, "\u904E\u9054\u9055\u9056\u9059\u905A\u905C", 5, "\u9064\u9066\u9067\u9069\u906A\u906B\u906C\u906F", 4, "\u9076", 6, "\u907E\u9081"],
      ["df80", "\u9084\u9085\u9086\u9087\u9089\u908A\u908C", 4, "\u9092\u9094\u9096\u9098\u909A\u909C\u909E\u909F\u90A0\u90A4\u90A5\u90A7\u90A8\u90A9\u90AB\u90AD\u90B2\u90B7\u90BC\u90BD\u90BF\u90C0\u647A\u64B7\u64B8\u6499\u64BA\u64C0\u64D0\u64D7\u64E4\u64E2\u6509\u6525\u652E\u5F0B\u5FD2\u7519\u5F11\u535F\u53F1\u53FD\u53E9\u53E8\u53FB\u5412\u5416\u5406\u544B\u5452\u5453\u5454\u5456\u5443\u5421\u5457\u5459\u5423\u5432\u5482\u5494\u5477\u5471\u5464\u549A\u549B\u5484\u5476\u5466\u549D\u54D0\u54AD\u54C2\u54B4\u54D2\u54A7\u54A6\u54D3\u54D4\u5472\u54A3\u54D5\u54BB\u54BF\u54CC\u54D9\u54DA\u54DC\u54A9\u54AA\u54A4\u54DD\u54CF\u54DE\u551B\u54E7\u5520\u54FD\u5514\u54F3\u5522\u5523\u550F\u5511\u5527\u552A\u5567\u558F\u55B5\u5549\u556D\u5541\u5555\u553F\u5550\u553C"],
      ["e040", "\u90C2\u90C3\u90C6\u90C8\u90C9\u90CB\u90CC\u90CD\u90D2\u90D4\u90D5\u90D6\u90D8\u90D9\u90DA\u90DE\u90DF\u90E0\u90E3\u90E4\u90E5\u90E9\u90EA\u90EC\u90EE\u90F0\u90F1\u90F2\u90F3\u90F5\u90F6\u90F7\u90F9\u90FA\u90FB\u90FC\u90FF\u9100\u9101\u9103\u9105", 19, "\u911A\u911B\u911C"],
      ["e080", "\u911D\u911F\u9120\u9121\u9124", 10, "\u9130\u9132", 6, "\u913A", 8, "\u9144\u5537\u5556\u5575\u5576\u5577\u5533\u5530\u555C\u558B\u55D2\u5583\u55B1\u55B9\u5588\u5581\u559F\u557E\u55D6\u5591\u557B\u55DF\u55BD\u55BE\u5594\u5599\u55EA\u55F7\u55C9\u561F\u55D1\u55EB\u55EC\u55D4\u55E6\u55DD\u55C4\u55EF\u55E5\u55F2\u55F3\u55CC\u55CD\u55E8\u55F5\u55E4\u8F94\u561E\u5608\u560C\u5601\u5624\u5623\u55FE\u5600\u5627\u562D\u5658\u5639\u5657\u562C\u564D\u5662\u5659\u565C\u564C\u5654\u5686\u5664\u5671\u566B\u567B\u567C\u5685\u5693\u56AF\u56D4\u56D7\u56DD\u56E1\u56F5\u56EB\u56F9\u56FF\u5704\u570A\u5709\u571C\u5E0F\u5E19\u5E14\u5E11\u5E31\u5E3B\u5E3C"],
      ["e140", "\u9145\u9147\u9148\u9151\u9153\u9154\u9155\u9156\u9158\u9159\u915B\u915C\u915F\u9160\u9166\u9167\u9168\u916B\u916D\u9173\u917A\u917B\u917C\u9180", 4, "\u9186\u9188\u918A\u918E\u918F\u9193", 6, "\u919C", 5, "\u91A4", 5, "\u91AB\u91AC\u91B0\u91B1\u91B2\u91B3\u91B6\u91B7\u91B8\u91B9\u91BB"],
      ["e180", "\u91BC", 10, "\u91C8\u91CB\u91D0\u91D2", 9, "\u91DD", 8, "\u5E37\u5E44\u5E54\u5E5B\u5E5E\u5E61\u5C8C\u5C7A\u5C8D\u5C90\u5C96\u5C88\u5C98\u5C99\u5C91\u5C9A\u5C9C\u5CB5\u5CA2\u5CBD\u5CAC\u5CAB\u5CB1\u5CA3\u5CC1\u5CB7\u5CC4\u5CD2\u5CE4\u5CCB\u5CE5\u5D02\u5D03\u5D27\u5D26\u5D2E\u5D24\u5D1E\u5D06\u5D1B\u5D58\u5D3E\u5D34\u5D3D\u5D6C\u5D5B\u5D6F\u5D5D\u5D6B\u5D4B\u5D4A\u5D69\u5D74\u5D82\u5D99\u5D9D\u8C73\u5DB7\u5DC5\u5F73\u5F77\u5F82\u5F87\u5F89\u5F8C\u5F95\u5F99\u5F9C\u5FA8\u5FAD\u5FB5\u5FBC\u8862\u5F61\u72AD\u72B0\u72B4\u72B7\u72B8\u72C3\u72C1\u72CE\u72CD\u72D2\u72E8\u72EF\u72E9\u72F2\u72F4\u72F7\u7301\u72F3\u7303\u72FA"],
      ["e240", "\u91E6", 62],
      ["e280", "\u9225", 32, "\u72FB\u7317\u7313\u7321\u730A\u731E\u731D\u7315\u7322\u7339\u7325\u732C\u7338\u7331\u7350\u734D\u7357\u7360\u736C\u736F\u737E\u821B\u5925\u98E7\u5924\u5902\u9963\u9967", 5, "\u9974\u9977\u997D\u9980\u9984\u9987\u998A\u998D\u9990\u9991\u9993\u9994\u9995\u5E80\u5E91\u5E8B\u5E96\u5EA5\u5EA0\u5EB9\u5EB5\u5EBE\u5EB3\u8D53\u5ED2\u5ED1\u5EDB\u5EE8\u5EEA\u81BA\u5FC4\u5FC9\u5FD6\u5FCF\u6003\u5FEE\u6004\u5FE1\u5FE4\u5FFE\u6005\u6006\u5FEA\u5FED\u5FF8\u6019\u6035\u6026\u601B\u600F\u600D\u6029\u602B\u600A\u603F\u6021\u6078\u6079\u607B\u607A\u6042"],
      ["e340", "\u9246", 45, "\u9275", 16],
      ["e380", "\u9286", 7, "\u928F", 24, "\u606A\u607D\u6096\u609A\u60AD\u609D\u6083\u6092\u608C\u609B\u60EC\u60BB\u60B1\u60DD\u60D8\u60C6\u60DA\u60B4\u6120\u6126\u6115\u6123\u60F4\u6100\u610E\u612B\u614A\u6175\u61AC\u6194\u61A7\u61B7\u61D4\u61F5\u5FDD\u96B3\u95E9\u95EB\u95F1\u95F3\u95F5\u95F6\u95FC\u95FE\u9603\u9604\u9606\u9608\u960A\u960B\u960C\u960D\u960F\u9612\u9615\u9616\u9617\u9619\u961A\u4E2C\u723F\u6215\u6C35\u6C54\u6C5C\u6C4A\u6CA3\u6C85\u6C90\u6C94\u6C8C\u6C68\u6C69\u6C74\u6C76\u6C86\u6CA9\u6CD0\u6CD4\u6CAD\u6CF7\u6CF8\u6CF1\u6CD7\u6CB2\u6CE0\u6CD6\u6CFA\u6CEB\u6CEE\u6CB1\u6CD3\u6CEF\u6CFE"],
      ["e440", "\u92A8", 5, "\u92AF", 24, "\u92C9", 31],
      ["e480", "\u92E9", 32, "\u6D39\u6D27\u6D0C\u6D43\u6D48\u6D07\u6D04\u6D19\u6D0E\u6D2B\u6D4D\u6D2E\u6D35\u6D1A\u6D4F\u6D52\u6D54\u6D33\u6D91\u6D6F\u6D9E\u6DA0\u6D5E\u6D93\u6D94\u6D5C\u6D60\u6D7C\u6D63\u6E1A\u6DC7\u6DC5\u6DDE\u6E0E\u6DBF\u6DE0\u6E11\u6DE6\u6DDD\u6DD9\u6E16\u6DAB\u6E0C\u6DAE\u6E2B\u6E6E\u6E4E\u6E6B\u6EB2\u6E5F\u6E86\u6E53\u6E54\u6E32\u6E25\u6E44\u6EDF\u6EB1\u6E98\u6EE0\u6F2D\u6EE2\u6EA5\u6EA7\u6EBD\u6EBB\u6EB7\u6ED7\u6EB4\u6ECF\u6E8F\u6EC2\u6E9F\u6F62\u6F46\u6F47\u6F24\u6F15\u6EF9\u6F2F\u6F36\u6F4B\u6F74\u6F2A\u6F09\u6F29\u6F89\u6F8D\u6F8C\u6F78\u6F72\u6F7C\u6F7A\u6FD1"],
      ["e540", "\u930A", 51, "\u933F", 10],
      ["e580", "\u934A", 31, "\u936B\u6FC9\u6FA7\u6FB9\u6FB6\u6FC2\u6FE1\u6FEE\u6FDE\u6FE0\u6FEF\u701A\u7023\u701B\u7039\u7035\u704F\u705E\u5B80\u5B84\u5B95\u5B93\u5BA5\u5BB8\u752F\u9A9E\u6434\u5BE4\u5BEE\u8930\u5BF0\u8E47\u8B07\u8FB6\u8FD3\u8FD5\u8FE5\u8FEE\u8FE4\u8FE9\u8FE6\u8FF3\u8FE8\u9005\u9004\u900B\u9026\u9011\u900D\u9016\u9021\u9035\u9036\u902D\u902F\u9044\u9051\u9052\u9050\u9068\u9058\u9062\u905B\u66B9\u9074\u907D\u9082\u9088\u9083\u908B\u5F50\u5F57\u5F56\u5F58\u5C3B\u54AB\u5C50\u5C59\u5B71\u5C63\u5C66\u7FBC\u5F2A\u5F29\u5F2D\u8274\u5F3C\u9B3B\u5C6E\u5981\u5983\u598D\u59A9\u59AA\u59A3"],
      ["e640", "\u936C", 34, "\u9390", 27],
      ["e680", "\u93AC", 29, "\u93CB\u93CC\u93CD\u5997\u59CA\u59AB\u599E\u59A4\u59D2\u59B2\u59AF\u59D7\u59BE\u5A05\u5A06\u59DD\u5A08\u59E3\u59D8\u59F9\u5A0C\u5A09\u5A32\u5A34\u5A11\u5A23\u5A13\u5A40\u5A67\u5A4A\u5A55\u5A3C\u5A62\u5A75\u80EC\u5AAA\u5A9B\u5A77\u5A7A\u5ABE\u5AEB\u5AB2\u5AD2\u5AD4\u5AB8\u5AE0\u5AE3\u5AF1\u5AD6\u5AE6\u5AD8\u5ADC\u5B09\u5B17\u5B16\u5B32\u5B37\u5B40\u5C15\u5C1C\u5B5A\u5B65\u5B73\u5B51\u5B53\u5B62\u9A75\u9A77\u9A78\u9A7A\u9A7F\u9A7D\u9A80\u9A81\u9A85\u9A88\u9A8A\u9A90\u9A92\u9A93\u9A96\u9A98\u9A9B\u9A9C\u9A9D\u9A9F\u9AA0\u9AA2\u9AA3\u9AA5\u9AA7\u7E9F\u7EA1\u7EA3\u7EA5\u7EA8\u7EA9"],
      ["e740", "\u93CE", 7, "\u93D7", 54],
      ["e780", "\u940E", 32, "\u7EAD\u7EB0\u7EBE\u7EC0\u7EC1\u7EC2\u7EC9\u7ECB\u7ECC\u7ED0\u7ED4\u7ED7\u7EDB\u7EE0\u7EE1\u7EE8\u7EEB\u7EEE\u7EEF\u7EF1\u7EF2\u7F0D\u7EF6\u7EFA\u7EFB\u7EFE\u7F01\u7F02\u7F03\u7F07\u7F08\u7F0B\u7F0C\u7F0F\u7F11\u7F12\u7F17\u7F19\u7F1C\u7F1B\u7F1F\u7F21", 6, "\u7F2A\u7F2B\u7F2C\u7F2D\u7F2F", 4, "\u7F35\u5E7A\u757F\u5DDB\u753E\u9095\u738E\u7391\u73AE\u73A2\u739F\u73CF\u73C2\u73D1\u73B7\u73B3\u73C0\u73C9\u73C8\u73E5\u73D9\u987C\u740A\u73E9\u73E7\u73DE\u73BA\u73F2\u740F\u742A\u745B\u7426\u7425\u7428\u7430\u742E\u742C"],
      ["e840", "\u942F", 14, "\u943F", 43, "\u946C\u946D\u946E\u946F"],
      ["e880", "\u9470", 20, "\u9491\u9496\u9498\u94C7\u94CF\u94D3\u94D4\u94DA\u94E6\u94FB\u951C\u9520\u741B\u741A\u7441\u745C\u7457\u7455\u7459\u7477\u746D\u747E\u749C\u748E\u7480\u7481\u7487\u748B\u749E\u74A8\u74A9\u7490\u74A7\u74D2\u74BA\u97EA\u97EB\u97EC\u674C\u6753\u675E\u6748\u6769\u67A5\u6787\u676A\u6773\u6798\u67A7\u6775\u67A8\u679E\u67AD\u678B\u6777\u677C\u67F0\u6809\u67D8\u680A\u67E9\u67B0\u680C\u67D9\u67B5\u67DA\u67B3\u67DD\u6800\u67C3\u67B8\u67E2\u680E\u67C1\u67FD\u6832\u6833\u6860\u6861\u684E\u6862\u6844\u6864\u6883\u681D\u6855\u6866\u6841\u6867\u6840\u683E\u684A\u6849\u6829\u68B5\u688F\u6874\u6877\u6893\u686B\u68C2\u696E\u68FC\u691F\u6920\u68F9"],
      ["e940", "\u9527\u9533\u953D\u9543\u9548\u954B\u9555\u955A\u9560\u956E\u9574\u9575\u9577", 7, "\u9580", 42],
      ["e980", "\u95AB", 32, "\u6924\u68F0\u690B\u6901\u6957\u68E3\u6910\u6971\u6939\u6960\u6942\u695D\u6984\u696B\u6980\u6998\u6978\u6934\u69CC\u6987\u6988\u69CE\u6989\u6966\u6963\u6979\u699B\u69A7\u69BB\u69AB\u69AD\u69D4\u69B1\u69C1\u69CA\u69DF\u6995\u69E0\u698D\u69FF\u6A2F\u69ED\u6A17\u6A18\u6A65\u69F2\u6A44\u6A3E\u6AA0\u6A50\u6A5B\u6A35\u6A8E\u6A79\u6A3D\u6A28\u6A58\u6A7C\u6A91\u6A90\u6AA9\u6A97\u6AAB\u7337\u7352\u6B81\u6B82\u6B87\u6B84\u6B92\u6B93\u6B8D\u6B9A\u6B9B\u6BA1\u6BAA\u8F6B\u8F6D\u8F71\u8F72\u8F73\u8F75\u8F76\u8F78\u8F77\u8F79\u8F7A\u8F7C\u8F7E\u8F81\u8F82\u8F84\u8F87\u8F8B"],
      ["ea40", "\u95CC", 27, "\u95EC\u95FF\u9607\u9613\u9618\u961B\u961E\u9620\u9623", 6, "\u962B\u962C\u962D\u962F\u9630\u9637\u9638\u9639\u963A\u963E\u9641\u9643\u964A\u964E\u964F\u9651\u9652\u9653\u9656\u9657"],
      ["ea80", "\u9658\u9659\u965A\u965C\u965D\u965E\u9660\u9663\u9665\u9666\u966B\u966D", 4, "\u9673\u9678", 12, "\u9687\u9689\u968A\u8F8D\u8F8E\u8F8F\u8F98\u8F9A\u8ECE\u620B\u6217\u621B\u621F\u6222\u6221\u6225\u6224\u622C\u81E7\u74EF\u74F4\u74FF\u750F\u7511\u7513\u6534\u65EE\u65EF\u65F0\u660A\u6619\u6772\u6603\u6615\u6600\u7085\u66F7\u661D\u6634\u6631\u6636\u6635\u8006\u665F\u6654\u6641\u664F\u6656\u6661\u6657\u6677\u6684\u668C\u66A7\u669D\u66BE\u66DB\u66DC\u66E6\u66E9\u8D32\u8D33\u8D36\u8D3B\u8D3D\u8D40\u8D45\u8D46\u8D48\u8D49\u8D47\u8D4D\u8D55\u8D59\u89C7\u89CA\u89CB\u89CC\u89CE\u89CF\u89D0\u89D1\u726E\u729F\u725D\u7266\u726F\u727E\u727F\u7284\u728B\u728D\u728F\u7292\u6308\u6332\u63B0"],
      ["eb40", "\u968C\u968E\u9691\u9692\u9693\u9695\u9696\u969A\u969B\u969D", 9, "\u96A8", 7, "\u96B1\u96B2\u96B4\u96B5\u96B7\u96B8\u96BA\u96BB\u96BF\u96C2\u96C3\u96C8\u96CA\u96CB\u96D0\u96D1\u96D3\u96D4\u96D6", 9, "\u96E1", 6, "\u96EB"],
      ["eb80", "\u96EC\u96ED\u96EE\u96F0\u96F1\u96F2\u96F4\u96F5\u96F8\u96FA\u96FB\u96FC\u96FD\u96FF\u9702\u9703\u9705\u970A\u970B\u970C\u9710\u9711\u9712\u9714\u9715\u9717", 4, "\u971D\u971F\u9720\u643F\u64D8\u8004\u6BEA\u6BF3\u6BFD\u6BF5\u6BF9\u6C05\u6C07\u6C06\u6C0D\u6C15\u6C18\u6C19\u6C1A\u6C21\u6C29\u6C24\u6C2A\u6C32\u6535\u6555\u656B\u724D\u7252\u7256\u7230\u8662\u5216\u809F\u809C\u8093\u80BC\u670A\u80BD\u80B1\u80AB\u80AD\u80B4\u80B7\u80E7\u80E8\u80E9\u80EA\u80DB\u80C2\u80C4\u80D9\u80CD\u80D7\u6710\u80DD\u80EB\u80F1\u80F4\u80ED\u810D\u810E\u80F2\u80FC\u6715\u8112\u8C5A\u8136\u811E\u812C\u8118\u8132\u8148\u814C\u8153\u8174\u8159\u815A\u8171\u8160\u8169\u817C\u817D\u816D\u8167\u584D\u5AB5\u8188\u8182\u8191\u6ED5\u81A3\u81AA\u81CC\u6726\u81CA\u81BB"],
      ["ec40", "\u9721", 8, "\u972B\u972C\u972E\u972F\u9731\u9733", 4, "\u973A\u973B\u973C\u973D\u973F", 18, "\u9754\u9755\u9757\u9758\u975A\u975C\u975D\u975F\u9763\u9764\u9766\u9767\u9768\u976A", 7],
      ["ec80", "\u9772\u9775\u9777", 4, "\u977D", 7, "\u9786", 4, "\u978C\u978E\u978F\u9790\u9793\u9795\u9796\u9797\u9799", 4, "\u81C1\u81A6\u6B24\u6B37\u6B39\u6B43\u6B46\u6B59\u98D1\u98D2\u98D3\u98D5\u98D9\u98DA\u6BB3\u5F40\u6BC2\u89F3\u6590\u9F51\u6593\u65BC\u65C6\u65C4\u65C3\u65CC\u65CE\u65D2\u65D6\u7080\u709C\u7096\u709D\u70BB\u70C0\u70B7\u70AB\u70B1\u70E8\u70CA\u7110\u7113\u7116\u712F\u7131\u7173\u715C\u7168\u7145\u7172\u714A\u7178\u717A\u7198\u71B3\u71B5\u71A8\u71A0\u71E0\u71D4\u71E7\u71F9\u721D\u7228\u706C\u7118\u7166\u71B9\u623E\u623D\u6243\u6248\u6249\u793B\u7940\u7946\u7949\u795B\u795C\u7953\u795A\u7962\u7957\u7960\u796F\u7967\u797A\u7985\u798A\u799A\u79A7\u79B3\u5FD1\u5FD0"],
      ["ed40", "\u979E\u979F\u97A1\u97A2\u97A4", 6, "\u97AC\u97AE\u97B0\u97B1\u97B3\u97B5", 46],
      ["ed80", "\u97E4\u97E5\u97E8\u97EE", 4, "\u97F4\u97F7", 23, "\u603C\u605D\u605A\u6067\u6041\u6059\u6063\u60AB\u6106\u610D\u615D\u61A9\u619D\u61CB\u61D1\u6206\u8080\u807F\u6C93\u6CF6\u6DFC\u77F6\u77F8\u7800\u7809\u7817\u7818\u7811\u65AB\u782D\u781C\u781D\u7839\u783A\u783B\u781F\u783C\u7825\u782C\u7823\u7829\u784E\u786D\u7856\u7857\u7826\u7850\u7847\u784C\u786A\u789B\u7893\u789A\u7887\u789C\u78A1\u78A3\u78B2\u78B9\u78A5\u78D4\u78D9\u78C9\u78EC\u78F2\u7905\u78F4\u7913\u7924\u791E\u7934\u9F9B\u9EF9\u9EFB\u9EFC\u76F1\u7704\u770D\u76F9\u7707\u7708\u771A\u7722\u7719\u772D\u7726\u7735\u7738\u7750\u7751\u7747\u7743\u775A\u7768"],
      ["ee40", "\u980F", 62],
      ["ee80", "\u984E", 32, "\u7762\u7765\u777F\u778D\u777D\u7780\u778C\u7791\u779F\u77A0\u77B0\u77B5\u77BD\u753A\u7540\u754E\u754B\u7548\u755B\u7572\u7579\u7583\u7F58\u7F61\u7F5F\u8A48\u7F68\u7F74\u7F71\u7F79\u7F81\u7F7E\u76CD\u76E5\u8832\u9485\u9486\u9487\u948B\u948A\u948C\u948D\u948F\u9490\u9494\u9497\u9495\u949A\u949B\u949C\u94A3\u94A4\u94AB\u94AA\u94AD\u94AC\u94AF\u94B0\u94B2\u94B4\u94B6", 4, "\u94BC\u94BD\u94BF\u94C4\u94C8", 6, "\u94D0\u94D1\u94D2\u94D5\u94D6\u94D7\u94D9\u94D8\u94DB\u94DE\u94DF\u94E0\u94E2\u94E4\u94E5\u94E7\u94E8\u94EA"],
      ["ef40", "\u986F", 5, "\u988B\u988E\u9892\u9895\u9899\u98A3\u98A8", 37, "\u98CF\u98D0\u98D4\u98D6\u98D7\u98DB\u98DC\u98DD\u98E0", 4],
      ["ef80", "\u98E5\u98E6\u98E9", 30, "\u94E9\u94EB\u94EE\u94EF\u94F3\u94F4\u94F5\u94F7\u94F9\u94FC\u94FD\u94FF\u9503\u9502\u9506\u9507\u9509\u950A\u950D\u950E\u950F\u9512", 4, "\u9518\u951B\u951D\u951E\u951F\u9522\u952A\u952B\u9529\u952C\u9531\u9532\u9534\u9536\u9537\u9538\u953C\u953E\u953F\u9542\u9535\u9544\u9545\u9546\u9549\u954C\u954E\u954F\u9552\u9553\u9554\u9556\u9557\u9558\u9559\u955B\u955E\u955F\u955D\u9561\u9562\u9564", 8, "\u956F\u9571\u9572\u9573\u953A\u77E7\u77EC\u96C9\u79D5\u79ED\u79E3\u79EB\u7A06\u5D47\u7A03\u7A02\u7A1E\u7A14"],
      ["f040", "\u9908", 4, "\u990E\u990F\u9911", 28, "\u992F", 26],
      ["f080", "\u994A", 9, "\u9956", 12, "\u9964\u9966\u9973\u9978\u9979\u997B\u997E\u9982\u9983\u9989\u7A39\u7A37\u7A51\u9ECF\u99A5\u7A70\u7688\u768E\u7693\u7699\u76A4\u74DE\u74E0\u752C\u9E20\u9E22\u9E28", 4, "\u9E32\u9E31\u9E36\u9E38\u9E37\u9E39\u9E3A\u9E3E\u9E41\u9E42\u9E44\u9E46\u9E47\u9E48\u9E49\u9E4B\u9E4C\u9E4E\u9E51\u9E55\u9E57\u9E5A\u9E5B\u9E5C\u9E5E\u9E63\u9E66", 6, "\u9E71\u9E6D\u9E73\u7592\u7594\u7596\u75A0\u759D\u75AC\u75A3\u75B3\u75B4\u75B8\u75C4\u75B1\u75B0\u75C3\u75C2\u75D6\u75CD\u75E3\u75E8\u75E6\u75E4\u75EB\u75E7\u7603\u75F1\u75FC\u75FF\u7610\u7600\u7605\u760C\u7617\u760A\u7625\u7618\u7615\u7619"],
      ["f140", "\u998C\u998E\u999A", 10, "\u99A6\u99A7\u99A9", 47],
      ["f180", "\u99D9", 32, "\u761B\u763C\u7622\u7620\u7640\u762D\u7630\u763F\u7635\u7643\u763E\u7633\u764D\u765E\u7654\u765C\u7656\u766B\u766F\u7FCA\u7AE6\u7A78\u7A79\u7A80\u7A86\u7A88\u7A95\u7AA6\u7AA0\u7AAC\u7AA8\u7AAD\u7AB3\u8864\u8869\u8872\u887D\u887F\u8882\u88A2\u88C6\u88B7\u88BC\u88C9\u88E2\u88CE\u88E3\u88E5\u88F1\u891A\u88FC\u88E8\u88FE\u88F0\u8921\u8919\u8913\u891B\u890A\u8934\u892B\u8936\u8941\u8966\u897B\u758B\u80E5\u76B2\u76B4\u77DC\u8012\u8014\u8016\u801C\u8020\u8022\u8025\u8026\u8027\u8029\u8028\u8031\u800B\u8035\u8043\u8046\u804D\u8052\u8069\u8071\u8983\u9878\u9880\u9883"],
      ["f240", "\u99FA", 62],
      ["f280", "\u9A39", 32, "\u9889\u988C\u988D\u988F\u9894\u989A\u989B\u989E\u989F\u98A1\u98A2\u98A5\u98A6\u864D\u8654\u866C\u866E\u867F\u867A\u867C\u867B\u86A8\u868D\u868B\u86AC\u869D\u86A7\u86A3\u86AA\u8693\u86A9\u86B6\u86C4\u86B5\u86CE\u86B0\u86BA\u86B1\u86AF\u86C9\u86CF\u86B4\u86E9\u86F1\u86F2\u86ED\u86F3\u86D0\u8713\u86DE\u86F4\u86DF\u86D8\u86D1\u8703\u8707\u86F8\u8708\u870A\u870D\u8709\u8723\u873B\u871E\u8725\u872E\u871A\u873E\u8748\u8734\u8731\u8729\u8737\u873F\u8782\u8722\u877D\u877E\u877B\u8760\u8770\u874C\u876E\u878B\u8753\u8763\u877C\u8764\u8759\u8765\u8793\u87AF\u87A8\u87D2"],
      ["f340", "\u9A5A", 17, "\u9A72\u9A83\u9A89\u9A8D\u9A8E\u9A94\u9A95\u9A99\u9AA6\u9AA9", 6, "\u9AB2\u9AB3\u9AB4\u9AB5\u9AB9\u9ABB\u9ABD\u9ABE\u9ABF\u9AC3\u9AC4\u9AC6", 4, "\u9ACD\u9ACE\u9ACF\u9AD0\u9AD2\u9AD4\u9AD5\u9AD6\u9AD7\u9AD9\u9ADA\u9ADB\u9ADC"],
      ["f380", "\u9ADD\u9ADE\u9AE0\u9AE2\u9AE3\u9AE4\u9AE5\u9AE7\u9AE8\u9AE9\u9AEA\u9AEC\u9AEE\u9AF0", 8, "\u9AFA\u9AFC", 6, "\u9B04\u9B05\u9B06\u87C6\u8788\u8785\u87AD\u8797\u8783\u87AB\u87E5\u87AC\u87B5\u87B3\u87CB\u87D3\u87BD\u87D1\u87C0\u87CA\u87DB\u87EA\u87E0\u87EE\u8816\u8813\u87FE\u880A\u881B\u8821\u8839\u883C\u7F36\u7F42\u7F44\u7F45\u8210\u7AFA\u7AFD\u7B08\u7B03\u7B04\u7B15\u7B0A\u7B2B\u7B0F\u7B47\u7B38\u7B2A\u7B19\u7B2E\u7B31\u7B20\u7B25\u7B24\u7B33\u7B3E\u7B1E\u7B58\u7B5A\u7B45\u7B75\u7B4C\u7B5D\u7B60\u7B6E\u7B7B\u7B62\u7B72\u7B71\u7B90\u7BA6\u7BA7\u7BB8\u7BAC\u7B9D\u7BA8\u7B85\u7BAA\u7B9C\u7BA2\u7BAB\u7BB4\u7BD1\u7BC1\u7BCC\u7BDD\u7BDA\u7BE5\u7BE6\u7BEA\u7C0C\u7BFE\u7BFC\u7C0F\u7C16\u7C0B"],
      ["f440", "\u9B07\u9B09", 5, "\u9B10\u9B11\u9B12\u9B14", 10, "\u9B20\u9B21\u9B22\u9B24", 10, "\u9B30\u9B31\u9B33", 7, "\u9B3D\u9B3E\u9B3F\u9B40\u9B46\u9B4A\u9B4B\u9B4C\u9B4E\u9B50\u9B52\u9B53\u9B55", 5],
      ["f480", "\u9B5B", 32, "\u7C1F\u7C2A\u7C26\u7C38\u7C41\u7C40\u81FE\u8201\u8202\u8204\u81EC\u8844\u8221\u8222\u8223\u822D\u822F\u8228\u822B\u8238\u823B\u8233\u8234\u823E\u8244\u8249\u824B\u824F\u825A\u825F\u8268\u887E\u8885\u8888\u88D8\u88DF\u895E\u7F9D\u7F9F\u7FA7\u7FAF\u7FB0\u7FB2\u7C7C\u6549\u7C91\u7C9D\u7C9C\u7C9E\u7CA2\u7CB2\u7CBC\u7CBD\u7CC1\u7CC7\u7CCC\u7CCD\u7CC8\u7CC5\u7CD7\u7CE8\u826E\u66A8\u7FBF\u7FCE\u7FD5\u7FE5\u7FE1\u7FE6\u7FE9\u7FEE\u7FF3\u7CF8\u7D77\u7DA6\u7DAE\u7E47\u7E9B\u9EB8\u9EB4\u8D73\u8D84\u8D94\u8D91\u8DB1\u8D67\u8D6D\u8C47\u8C49\u914A\u9150\u914E\u914F\u9164"],
      ["f540", "\u9B7C", 62],
      ["f580", "\u9BBB", 32, "\u9162\u9161\u9170\u9169\u916F\u917D\u917E\u9172\u9174\u9179\u918C\u9185\u9190\u918D\u9191\u91A2\u91A3\u91AA\u91AD\u91AE\u91AF\u91B5\u91B4\u91BA\u8C55\u9E7E\u8DB8\u8DEB\u8E05\u8E59\u8E69\u8DB5\u8DBF\u8DBC\u8DBA\u8DC4\u8DD6\u8DD7\u8DDA\u8DDE\u8DCE\u8DCF\u8DDB\u8DC6\u8DEC\u8DF7\u8DF8\u8DE3\u8DF9\u8DFB\u8DE4\u8E09\u8DFD\u8E14\u8E1D\u8E1F\u8E2C\u8E2E\u8E23\u8E2F\u8E3A\u8E40\u8E39\u8E35\u8E3D\u8E31\u8E49\u8E41\u8E42\u8E51\u8E52\u8E4A\u8E70\u8E76\u8E7C\u8E6F\u8E74\u8E85\u8E8F\u8E94\u8E90\u8E9C\u8E9E\u8C78\u8C82\u8C8A\u8C85\u8C98\u8C94\u659B\u89D6\u89DE\u89DA\u89DC"],
      ["f640", "\u9BDC", 62],
      ["f680", "\u9C1B", 32, "\u89E5\u89EB\u89EF\u8A3E\u8B26\u9753\u96E9\u96F3\u96EF\u9706\u9701\u9708\u970F\u970E\u972A\u972D\u9730\u973E\u9F80\u9F83\u9F85", 5, "\u9F8C\u9EFE\u9F0B\u9F0D\u96B9\u96BC\u96BD\u96CE\u96D2\u77BF\u96E0\u928E\u92AE\u92C8\u933E\u936A\u93CA\u938F\u943E\u946B\u9C7F\u9C82\u9C85\u9C86\u9C87\u9C88\u7A23\u9C8B\u9C8E\u9C90\u9C91\u9C92\u9C94\u9C95\u9C9A\u9C9B\u9C9E", 5, "\u9CA5", 4, "\u9CAB\u9CAD\u9CAE\u9CB0", 7, "\u9CBA\u9CBB\u9CBC\u9CBD\u9CC4\u9CC5\u9CC6\u9CC7\u9CCA\u9CCB"],
      ["f740", "\u9C3C", 62],
      ["f780", "\u9C7B\u9C7D\u9C7E\u9C80\u9C83\u9C84\u9C89\u9C8A\u9C8C\u9C8F\u9C93\u9C96\u9C97\u9C98\u9C99\u9C9D\u9CAA\u9CAC\u9CAF\u9CB9\u9CBE", 4, "\u9CC8\u9CC9\u9CD1\u9CD2\u9CDA\u9CDB\u9CE0\u9CE1\u9CCC", 4, "\u9CD3\u9CD4\u9CD5\u9CD7\u9CD8\u9CD9\u9CDC\u9CDD\u9CDF\u9CE2\u977C\u9785\u9791\u9792\u9794\u97AF\u97AB\u97A3\u97B2\u97B4\u9AB1\u9AB0\u9AB7\u9E58\u9AB6\u9ABA\u9ABC\u9AC1\u9AC0\u9AC5\u9AC2\u9ACB\u9ACC\u9AD1\u9B45\u9B43\u9B47\u9B49\u9B48\u9B4D\u9B51\u98E8\u990D\u992E\u9955\u9954\u9ADF\u9AE1\u9AE6\u9AEF\u9AEB\u9AFB\u9AED\u9AF9\u9B08\u9B0F\u9B13\u9B1F\u9B23\u9EBD\u9EBE\u7E3B\u9E82\u9E87\u9E88\u9E8B\u9E92\u93D6\u9E9D\u9E9F\u9EDB\u9EDC\u9EDD\u9EE0\u9EDF\u9EE2\u9EE9\u9EE7\u9EE5\u9EEA\u9EEF\u9F22\u9F2C\u9F2F\u9F39\u9F37\u9F3D\u9F3E\u9F44"],
      ["f840", "\u9CE3", 62],
      ["f880", "\u9D22", 32],
      ["f940", "\u9D43", 62],
      ["f980", "\u9D82", 32],
      ["fa40", "\u9DA3", 62],
      ["fa80", "\u9DE2", 32],
      ["fb40", "\u9E03", 27, "\u9E24\u9E27\u9E2E\u9E30\u9E34\u9E3B\u9E3C\u9E40\u9E4D\u9E50\u9E52\u9E53\u9E54\u9E56\u9E59\u9E5D\u9E5F\u9E60\u9E61\u9E62\u9E65\u9E6E\u9E6F\u9E72\u9E74", 9, "\u9E80"],
      ["fb80", "\u9E81\u9E83\u9E84\u9E85\u9E86\u9E89\u9E8A\u9E8C", 5, "\u9E94", 8, "\u9E9E\u9EA0", 5, "\u9EA7\u9EA8\u9EA9\u9EAA"],
      ["fc40", "\u9EAB", 8, "\u9EB5\u9EB6\u9EB7\u9EB9\u9EBA\u9EBC\u9EBF", 4, "\u9EC5\u9EC6\u9EC7\u9EC8\u9ECA\u9ECB\u9ECC\u9ED0\u9ED2\u9ED3\u9ED5\u9ED6\u9ED7\u9ED9\u9EDA\u9EDE\u9EE1\u9EE3\u9EE4\u9EE6\u9EE8\u9EEB\u9EEC\u9EED\u9EEE\u9EF0", 8, "\u9EFA\u9EFD\u9EFF", 6],
      ["fc80", "\u9F06", 4, "\u9F0C\u9F0F\u9F11\u9F12\u9F14\u9F15\u9F16\u9F18\u9F1A", 5, "\u9F21\u9F23", 8, "\u9F2D\u9F2E\u9F30\u9F31"],
      ["fd40", "\u9F32", 4, "\u9F38\u9F3A\u9F3C\u9F3F", 4, "\u9F45", 10, "\u9F52", 38],
      ["fd80", "\u9F79", 5, "\u9F81\u9F82\u9F8D", 11, "\u9F9C\u9F9D\u9F9E\u9FA1", 4, "\uF92C\uF979\uF995\uF9E7\uF9F1"],
      ["fe40", "\uFA0C\uFA0D\uFA0E\uFA0F\uFA11\uFA13\uFA14\uFA18\uFA1F\uFA20\uFA21\uFA23\uFA24\uFA27\uFA28\uFA29"]
    ];
  }
});

// ../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/tables/gbk-added.json
var require_gbk_added = __commonJS({
  "../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/tables/gbk-added.json"(exports, module2) {
    module2.exports = [
      ["a140", "\uE4C6", 62],
      ["a180", "\uE505", 32],
      ["a240", "\uE526", 62],
      ["a280", "\uE565", 32],
      ["a2ab", "\uE766", 5],
      ["a2e3", "\u20AC\uE76D"],
      ["a2ef", "\uE76E\uE76F"],
      ["a2fd", "\uE770\uE771"],
      ["a340", "\uE586", 62],
      ["a380", "\uE5C5", 31, "\u3000"],
      ["a440", "\uE5E6", 62],
      ["a480", "\uE625", 32],
      ["a4f4", "\uE772", 10],
      ["a540", "\uE646", 62],
      ["a580", "\uE685", 32],
      ["a5f7", "\uE77D", 7],
      ["a640", "\uE6A6", 62],
      ["a680", "\uE6E5", 32],
      ["a6b9", "\uE785", 7],
      ["a6d9", "\uE78D", 6],
      ["a6ec", "\uE794\uE795"],
      ["a6f3", "\uE796"],
      ["a6f6", "\uE797", 8],
      ["a740", "\uE706", 62],
      ["a780", "\uE745", 32],
      ["a7c2", "\uE7A0", 14],
      ["a7f2", "\uE7AF", 12],
      ["a896", "\uE7BC", 10],
      ["a8bc", "\u1E3F"],
      ["a8bf", "\u01F9"],
      ["a8c1", "\uE7C9\uE7CA\uE7CB\uE7CC"],
      ["a8ea", "\uE7CD", 20],
      ["a958", "\uE7E2"],
      ["a95b", "\uE7E3"],
      ["a95d", "\uE7E4\uE7E5\uE7E6"],
      ["a989", "\u303E\u2FF0", 11],
      ["a997", "\uE7F4", 12],
      ["a9f0", "\uE801", 14],
      ["aaa1", "\uE000", 93],
      ["aba1", "\uE05E", 93],
      ["aca1", "\uE0BC", 93],
      ["ada1", "\uE11A", 93],
      ["aea1", "\uE178", 93],
      ["afa1", "\uE1D6", 93],
      ["d7fa", "\uE810", 4],
      ["f8a1", "\uE234", 93],
      ["f9a1", "\uE292", 93],
      ["faa1", "\uE2F0", 93],
      ["fba1", "\uE34E", 93],
      ["fca1", "\uE3AC", 93],
      ["fda1", "\uE40A", 93],
      ["fe50", "\u2E81\uE816\uE817\uE818\u2E84\u3473\u3447\u2E88\u2E8B\uE81E\u359E\u361A\u360E\u2E8C\u2E97\u396E\u3918\uE826\u39CF\u39DF\u3A73\u39D0\uE82B\uE82C\u3B4E\u3C6E\u3CE0\u2EA7\uE831\uE832\u2EAA\u4056\u415F\u2EAE\u4337\u2EB3\u2EB6\u2EB7\uE83B\u43B1\u43AC\u2EBB\u43DD\u44D6\u4661\u464C\uE843"],
      ["fe80", "\u4723\u4729\u477C\u478D\u2ECA\u4947\u497A\u497D\u4982\u4983\u4985\u4986\u499F\u499B\u49B7\u49B6\uE854\uE855\u4CA3\u4C9F\u4CA0\u4CA1\u4C77\u4CA2\u4D13", 6, "\u4DAE\uE864\uE468", 93],
      ["8135f437", "\uE7C7"]
    ];
  }
});

// ../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json
var require_gb18030_ranges = __commonJS({
  "../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json"(exports, module2) {
    module2.exports = { uChars: [128, 165, 169, 178, 184, 216, 226, 235, 238, 244, 248, 251, 253, 258, 276, 284, 300, 325, 329, 334, 364, 463, 465, 467, 469, 471, 473, 475, 477, 506, 594, 610, 712, 716, 730, 930, 938, 962, 970, 1026, 1104, 1106, 8209, 8215, 8218, 8222, 8231, 8241, 8244, 8246, 8252, 8365, 8452, 8454, 8458, 8471, 8482, 8556, 8570, 8596, 8602, 8713, 8720, 8722, 8726, 8731, 8737, 8740, 8742, 8748, 8751, 8760, 8766, 8777, 8781, 8787, 8802, 8808, 8816, 8854, 8858, 8870, 8896, 8979, 9322, 9372, 9548, 9588, 9616, 9622, 9634, 9652, 9662, 9672, 9676, 9680, 9702, 9735, 9738, 9793, 9795, 11906, 11909, 11913, 11917, 11928, 11944, 11947, 11951, 11956, 11960, 11964, 11979, 12284, 12292, 12312, 12319, 12330, 12351, 12436, 12447, 12535, 12543, 12586, 12842, 12850, 12964, 13200, 13215, 13218, 13253, 13263, 13267, 13270, 13384, 13428, 13727, 13839, 13851, 14617, 14703, 14801, 14816, 14964, 15183, 15471, 15585, 16471, 16736, 17208, 17325, 17330, 17374, 17623, 17997, 18018, 18212, 18218, 18301, 18318, 18760, 18811, 18814, 18820, 18823, 18844, 18848, 18872, 19576, 19620, 19738, 19887, 40870, 59244, 59336, 59367, 59413, 59417, 59423, 59431, 59437, 59443, 59452, 59460, 59478, 59493, 63789, 63866, 63894, 63976, 63986, 64016, 64018, 64021, 64025, 64034, 64037, 64042, 65074, 65093, 65107, 65112, 65127, 65132, 65375, 65510, 65536], gbChars: [0, 36, 38, 45, 50, 81, 89, 95, 96, 100, 103, 104, 105, 109, 126, 133, 148, 172, 175, 179, 208, 306, 307, 308, 309, 310, 311, 312, 313, 341, 428, 443, 544, 545, 558, 741, 742, 749, 750, 805, 819, 820, 7922, 7924, 7925, 7927, 7934, 7943, 7944, 7945, 7950, 8062, 8148, 8149, 8152, 8164, 8174, 8236, 8240, 8262, 8264, 8374, 8380, 8381, 8384, 8388, 8390, 8392, 8393, 8394, 8396, 8401, 8406, 8416, 8419, 8424, 8437, 8439, 8445, 8482, 8485, 8496, 8521, 8603, 8936, 8946, 9046, 9050, 9063, 9066, 9076, 9092, 9100, 9108, 9111, 9113, 9131, 9162, 9164, 9218, 9219, 11329, 11331, 11334, 11336, 11346, 11361, 11363, 11366, 11370, 11372, 11375, 11389, 11682, 11686, 11687, 11692, 11694, 11714, 11716, 11723, 11725, 11730, 11736, 11982, 11989, 12102, 12336, 12348, 12350, 12384, 12393, 12395, 12397, 12510, 12553, 12851, 12962, 12973, 13738, 13823, 13919, 13933, 14080, 14298, 14585, 14698, 15583, 15847, 16318, 16434, 16438, 16481, 16729, 17102, 17122, 17315, 17320, 17402, 17418, 17859, 17909, 17911, 17915, 17916, 17936, 17939, 17961, 18664, 18703, 18814, 18962, 19043, 33469, 33470, 33471, 33484, 33485, 33490, 33497, 33501, 33505, 33513, 33520, 33536, 33550, 37845, 37921, 37948, 38029, 38038, 38064, 38065, 38066, 38069, 38075, 38076, 38078, 39108, 39109, 39113, 39114, 39115, 39116, 39265, 39394, 189e3] };
  }
});

// ../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/tables/cp949.json
var require_cp949 = __commonJS({
  "../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/tables/cp949.json"(exports, module2) {
    module2.exports = [
      ["0", "\0", 127],
      ["8141", "\uAC02\uAC03\uAC05\uAC06\uAC0B", 4, "\uAC18\uAC1E\uAC1F\uAC21\uAC22\uAC23\uAC25", 6, "\uAC2E\uAC32\uAC33\uAC34"],
      ["8161", "\uAC35\uAC36\uAC37\uAC3A\uAC3B\uAC3D\uAC3E\uAC3F\uAC41", 9, "\uAC4C\uAC4E", 5, "\uAC55"],
      ["8181", "\uAC56\uAC57\uAC59\uAC5A\uAC5B\uAC5D", 18, "\uAC72\uAC73\uAC75\uAC76\uAC79\uAC7B", 4, "\uAC82\uAC87\uAC88\uAC8D\uAC8E\uAC8F\uAC91\uAC92\uAC93\uAC95", 6, "\uAC9E\uACA2", 5, "\uACAB\uACAD\uACAE\uACB1", 6, "\uACBA\uACBE\uACBF\uACC0\uACC2\uACC3\uACC5\uACC6\uACC7\uACC9\uACCA\uACCB\uACCD", 7, "\uACD6\uACD8", 7, "\uACE2\uACE3\uACE5\uACE6\uACE9\uACEB\uACED\uACEE\uACF2\uACF4\uACF7", 4, "\uACFE\uACFF\uAD01\uAD02\uAD03\uAD05\uAD07", 4, "\uAD0E\uAD10\uAD12\uAD13"],
      ["8241", "\uAD14\uAD15\uAD16\uAD17\uAD19\uAD1A\uAD1B\uAD1D\uAD1E\uAD1F\uAD21", 7, "\uAD2A\uAD2B\uAD2E", 5],
      ["8261", "\uAD36\uAD37\uAD39\uAD3A\uAD3B\uAD3D", 6, "\uAD46\uAD48\uAD4A", 5, "\uAD51\uAD52\uAD53\uAD55\uAD56\uAD57"],
      ["8281", "\uAD59", 7, "\uAD62\uAD64", 7, "\uAD6E\uAD6F\uAD71\uAD72\uAD77\uAD78\uAD79\uAD7A\uAD7E\uAD80\uAD83", 4, "\uAD8A\uAD8B\uAD8D\uAD8E\uAD8F\uAD91", 10, "\uAD9E", 5, "\uADA5", 17, "\uADB8", 7, "\uADC2\uADC3\uADC5\uADC6\uADC7\uADC9", 6, "\uADD2\uADD4", 7, "\uADDD\uADDE\uADDF\uADE1\uADE2\uADE3\uADE5", 18],
      ["8341", "\uADFA\uADFB\uADFD\uADFE\uAE02", 5, "\uAE0A\uAE0C\uAE0E", 5, "\uAE15", 7],
      ["8361", "\uAE1D", 18, "\uAE32\uAE33\uAE35\uAE36\uAE39\uAE3B\uAE3C"],
      ["8381", "\uAE3D\uAE3E\uAE3F\uAE42\uAE44\uAE47\uAE48\uAE49\uAE4B\uAE4F\uAE51\uAE52\uAE53\uAE55\uAE57", 4, "\uAE5E\uAE62\uAE63\uAE64\uAE66\uAE67\uAE6A\uAE6B\uAE6D\uAE6E\uAE6F\uAE71", 6, "\uAE7A\uAE7E", 5, "\uAE86", 5, "\uAE8D", 46, "\uAEBF\uAEC1\uAEC2\uAEC3\uAEC5", 6, "\uAECE\uAED2", 5, "\uAEDA\uAEDB\uAEDD", 8],
      ["8441", "\uAEE6\uAEE7\uAEE9\uAEEA\uAEEC\uAEEE", 5, "\uAEF5\uAEF6\uAEF7\uAEF9\uAEFA\uAEFB\uAEFD", 8],
      ["8461", "\uAF06\uAF09\uAF0A\uAF0B\uAF0C\uAF0E\uAF0F\uAF11", 18],
      ["8481", "\uAF24", 7, "\uAF2E\uAF2F\uAF31\uAF33\uAF35", 6, "\uAF3E\uAF40\uAF44\uAF45\uAF46\uAF47\uAF4A", 5, "\uAF51", 10, "\uAF5E", 5, "\uAF66", 18, "\uAF7A", 5, "\uAF81\uAF82\uAF83\uAF85\uAF86\uAF87\uAF89", 6, "\uAF92\uAF93\uAF94\uAF96", 5, "\uAF9D", 26, "\uAFBA\uAFBB\uAFBD\uAFBE"],
      ["8541", "\uAFBF\uAFC1", 5, "\uAFCA\uAFCC\uAFCF", 4, "\uAFD5", 6, "\uAFDD", 4],
      ["8561", "\uAFE2", 5, "\uAFEA", 5, "\uAFF2\uAFF3\uAFF5\uAFF6\uAFF7\uAFF9", 6, "\uB002\uB003"],
      ["8581", "\uB005", 6, "\uB00D\uB00E\uB00F\uB011\uB012\uB013\uB015", 6, "\uB01E", 9, "\uB029", 26, "\uB046\uB047\uB049\uB04B\uB04D\uB04F\uB050\uB051\uB052\uB056\uB058\uB05A\uB05B\uB05C\uB05E", 29, "\uB07E\uB07F\uB081\uB082\uB083\uB085", 6, "\uB08E\uB090\uB092", 5, "\uB09B\uB09D\uB09E\uB0A3\uB0A4"],
      ["8641", "\uB0A5\uB0A6\uB0A7\uB0AA\uB0B0\uB0B2\uB0B6\uB0B7\uB0B9\uB0BA\uB0BB\uB0BD", 6, "\uB0C6\uB0CA", 5, "\uB0D2"],
      ["8661", "\uB0D3\uB0D5\uB0D6\uB0D7\uB0D9", 6, "\uB0E1\uB0E2\uB0E3\uB0E4\uB0E6", 10],
      ["8681", "\uB0F1", 22, "\uB10A\uB10D\uB10E\uB10F\uB111\uB114\uB115\uB116\uB117\uB11A\uB11E", 4, "\uB126\uB127\uB129\uB12A\uB12B\uB12D", 6, "\uB136\uB13A", 5, "\uB142\uB143\uB145\uB146\uB147\uB149", 6, "\uB152\uB153\uB156\uB157\uB159\uB15A\uB15B\uB15D\uB15E\uB15F\uB161", 22, "\uB17A\uB17B\uB17D\uB17E\uB17F\uB181\uB183", 4, "\uB18A\uB18C\uB18E\uB18F\uB190\uB191\uB195\uB196\uB197\uB199\uB19A\uB19B\uB19D"],
      ["8741", "\uB19E", 9, "\uB1A9", 15],
      ["8761", "\uB1B9", 18, "\uB1CD\uB1CE\uB1CF\uB1D1\uB1D2\uB1D3\uB1D5"],
      ["8781", "\uB1D6", 5, "\uB1DE\uB1E0", 7, "\uB1EA\uB1EB\uB1ED\uB1EE\uB1EF\uB1F1", 7, "\uB1FA\uB1FC\uB1FE", 5, "\uB206\uB207\uB209\uB20A\uB20D", 6, "\uB216\uB218\uB21A", 5, "\uB221", 18, "\uB235", 6, "\uB23D", 26, "\uB259\uB25A\uB25B\uB25D\uB25E\uB25F\uB261", 6, "\uB26A", 4],
      ["8841", "\uB26F", 4, "\uB276", 5, "\uB27D", 6, "\uB286\uB287\uB288\uB28A", 4],
      ["8861", "\uB28F\uB292\uB293\uB295\uB296\uB297\uB29B", 4, "\uB2A2\uB2A4\uB2A7\uB2A8\uB2A9\uB2AB\uB2AD\uB2AE\uB2AF\uB2B1\uB2B2\uB2B3\uB2B5\uB2B6\uB2B7"],
      ["8881", "\uB2B8", 15, "\uB2CA\uB2CB\uB2CD\uB2CE\uB2CF\uB2D1\uB2D3", 4, "\uB2DA\uB2DC\uB2DE\uB2DF\uB2E0\uB2E1\uB2E3\uB2E7\uB2E9\uB2EA\uB2F0\uB2F1\uB2F2\uB2F6\uB2FC\uB2FD\uB2FE\uB302\uB303\uB305\uB306\uB307\uB309", 6, "\uB312\uB316", 5, "\uB31D", 54, "\uB357\uB359\uB35A\uB35D\uB360\uB361\uB362\uB363"],
      ["8941", "\uB366\uB368\uB36A\uB36C\uB36D\uB36F\uB372\uB373\uB375\uB376\uB377\uB379", 6, "\uB382\uB386", 5, "\uB38D"],
      ["8961", "\uB38E\uB38F\uB391\uB392\uB393\uB395", 10, "\uB3A2", 5, "\uB3A9\uB3AA\uB3AB\uB3AD"],
      ["8981", "\uB3AE", 21, "\uB3C6\uB3C7\uB3C9\uB3CA\uB3CD\uB3CF\uB3D1\uB3D2\uB3D3\uB3D6\uB3D8\uB3DA\uB3DC\uB3DE\uB3DF\uB3E1\uB3E2\uB3E3\uB3E5\uB3E6\uB3E7\uB3E9", 18, "\uB3FD", 18, "\uB411", 6, "\uB419\uB41A\uB41B\uB41D\uB41E\uB41F\uB421", 6, "\uB42A\uB42C", 7, "\uB435", 15],
      ["8a41", "\uB445", 10, "\uB452\uB453\uB455\uB456\uB457\uB459", 6, "\uB462\uB464\uB466"],
      ["8a61", "\uB467", 4, "\uB46D", 18, "\uB481\uB482"],
      ["8a81", "\uB483", 4, "\uB489", 19, "\uB49E", 5, "\uB4A5\uB4A6\uB4A7\uB4A9\uB4AA\uB4AB\uB4AD", 7, "\uB4B6\uB4B8\uB4BA", 5, "\uB4C1\uB4C2\uB4C3\uB4C5\uB4C6\uB4C7\uB4C9", 6, "\uB4D1\uB4D2\uB4D3\uB4D4\uB4D6", 5, "\uB4DE\uB4DF\uB4E1\uB4E2\uB4E5\uB4E7", 4, "\uB4EE\uB4F0\uB4F2", 5, "\uB4F9", 26, "\uB516\uB517\uB519\uB51A\uB51D"],
      ["8b41", "\uB51E", 5, "\uB526\uB52B", 4, "\uB532\uB533\uB535\uB536\uB537\uB539", 6, "\uB542\uB546"],
      ["8b61", "\uB547\uB548\uB549\uB54A\uB54E\uB54F\uB551\uB552\uB553\uB555", 6, "\uB55E\uB562", 8],
      ["8b81", "\uB56B", 52, "\uB5A2\uB5A3\uB5A5\uB5A6\uB5A7\uB5A9\uB5AC\uB5AD\uB5AE\uB5AF\uB5B2\uB5B6", 4, "\uB5BE\uB5BF\uB5C1\uB5C2\uB5C3\uB5C5", 6, "\uB5CE\uB5D2", 5, "\uB5D9", 18, "\uB5ED", 18],
      ["8c41", "\uB600", 15, "\uB612\uB613\uB615\uB616\uB617\uB619", 4],
      ["8c61", "\uB61E", 6, "\uB626", 5, "\uB62D", 6, "\uB635", 5],
      ["8c81", "\uB63B", 12, "\uB649", 26, "\uB665\uB666\uB667\uB669", 50, "\uB69E\uB69F\uB6A1\uB6A2\uB6A3\uB6A5", 5, "\uB6AD\uB6AE\uB6AF\uB6B0\uB6B2", 16],
      ["8d41", "\uB6C3", 16, "\uB6D5", 8],
      ["8d61", "\uB6DE", 17, "\uB6F1\uB6F2\uB6F3\uB6F5\uB6F6\uB6F7\uB6F9\uB6FA"],
      ["8d81", "\uB6FB", 4, "\uB702\uB703\uB704\uB706", 33, "\uB72A\uB72B\uB72D\uB72E\uB731", 6, "\uB73A\uB73C", 7, "\uB745\uB746\uB747\uB749\uB74A\uB74B\uB74D", 6, "\uB756", 9, "\uB761\uB762\uB763\uB765\uB766\uB767\uB769", 6, "\uB772\uB774\uB776", 5, "\uB77E\uB77F\uB781\uB782\uB783\uB785", 6, "\uB78E\uB793\uB794\uB795\uB79A\uB79B\uB79D\uB79E"],
      ["8e41", "\uB79F\uB7A1", 6, "\uB7AA\uB7AE", 5, "\uB7B6\uB7B7\uB7B9", 8],
      ["8e61", "\uB7C2", 4, "\uB7C8\uB7CA", 19],
      ["8e81", "\uB7DE", 13, "\uB7EE\uB7EF\uB7F1\uB7F2\uB7F3\uB7F5", 6, "\uB7FE\uB802", 4, "\uB80A\uB80B\uB80D\uB80E\uB80F\uB811", 6, "\uB81A\uB81C\uB81E", 5, "\uB826\uB827\uB829\uB82A\uB82B\uB82D", 6, "\uB836\uB83A", 5, "\uB841\uB842\uB843\uB845", 11, "\uB852\uB854", 7, "\uB85E\uB85F\uB861\uB862\uB863\uB865", 6, "\uB86E\uB870\uB872", 5, "\uB879\uB87A\uB87B\uB87D", 7],
      ["8f41", "\uB885", 7, "\uB88E", 17],
      ["8f61", "\uB8A0", 7, "\uB8A9", 6, "\uB8B1\uB8B2\uB8B3\uB8B5\uB8B6\uB8B7\uB8B9", 4],
      ["8f81", "\uB8BE\uB8BF\uB8C2\uB8C4\uB8C6", 5, "\uB8CD\uB8CE\uB8CF\uB8D1\uB8D2\uB8D3\uB8D5", 7, "\uB8DE\uB8E0\uB8E2", 5, "\uB8EA\uB8EB\uB8ED\uB8EE\uB8EF\uB8F1", 6, "\uB8FA\uB8FC\uB8FE", 5, "\uB905", 18, "\uB919", 6, "\uB921", 26, "\uB93E\uB93F\uB941\uB942\uB943\uB945", 6, "\uB94D\uB94E\uB950\uB952", 5],
      ["9041", "\uB95A\uB95B\uB95D\uB95E\uB95F\uB961", 6, "\uB96A\uB96C\uB96E", 5, "\uB976\uB977\uB979\uB97A\uB97B\uB97D"],
      ["9061", "\uB97E", 5, "\uB986\uB988\uB98B\uB98C\uB98F", 15],
      ["9081", "\uB99F", 12, "\uB9AE\uB9AF\uB9B1\uB9B2\uB9B3\uB9B5", 6, "\uB9BE\uB9C0\uB9C2", 5, "\uB9CA\uB9CB\uB9CD\uB9D3", 4, "\uB9DA\uB9DC\uB9DF\uB9E0\uB9E2\uB9E6\uB9E7\uB9E9\uB9EA\uB9EB\uB9ED", 6, "\uB9F6\uB9FB", 4, "\uBA02", 5, "\uBA09", 11, "\uBA16", 33, "\uBA3A\uBA3B\uBA3D\uBA3E\uBA3F\uBA41\uBA43\uBA44\uBA45\uBA46"],
      ["9141", "\uBA47\uBA4A\uBA4C\uBA4F\uBA50\uBA51\uBA52\uBA56\uBA57\uBA59\uBA5A\uBA5B\uBA5D", 6, "\uBA66\uBA6A", 5],
      ["9161", "\uBA72\uBA73\uBA75\uBA76\uBA77\uBA79", 9, "\uBA86\uBA88\uBA89\uBA8A\uBA8B\uBA8D", 5],
      ["9181", "\uBA93", 20, "\uBAAA\uBAAD\uBAAE\uBAAF\uBAB1\uBAB3", 4, "\uBABA\uBABC\uBABE", 5, "\uBAC5\uBAC6\uBAC7\uBAC9", 14, "\uBADA", 33, "\uBAFD\uBAFE\uBAFF\uBB01\uBB02\uBB03\uBB05", 7, "\uBB0E\uBB10\uBB12", 5, "\uBB19\uBB1A\uBB1B\uBB1D\uBB1E\uBB1F\uBB21", 6],
      ["9241", "\uBB28\uBB2A\uBB2C", 7, "\uBB37\uBB39\uBB3A\uBB3F", 4, "\uBB46\uBB48\uBB4A\uBB4B\uBB4C\uBB4E\uBB51\uBB52"],
      ["9261", "\uBB53\uBB55\uBB56\uBB57\uBB59", 7, "\uBB62\uBB64", 7, "\uBB6D", 4],
      ["9281", "\uBB72", 21, "\uBB89\uBB8A\uBB8B\uBB8D\uBB8E\uBB8F\uBB91", 18, "\uBBA5\uBBA6\uBBA7\uBBA9\uBBAA\uBBAB\uBBAD", 6, "\uBBB5\uBBB6\uBBB8", 7, "\uBBC1\uBBC2\uBBC3\uBBC5\uBBC6\uBBC7\uBBC9", 6, "\uBBD1\uBBD2\uBBD4", 35, "\uBBFA\uBBFB\uBBFD\uBBFE\uBC01"],
      ["9341", "\uBC03", 4, "\uBC0A\uBC0E\uBC10\uBC12\uBC13\uBC19\uBC1A\uBC20\uBC21\uBC22\uBC23\uBC26\uBC28\uBC2A\uBC2B\uBC2C\uBC2E\uBC2F\uBC32\uBC33\uBC35"],
      ["9361", "\uBC36\uBC37\uBC39", 6, "\uBC42\uBC46\uBC47\uBC48\uBC4A\uBC4B\uBC4E\uBC4F\uBC51", 8],
      ["9381", "\uBC5A\uBC5B\uBC5C\uBC5E", 37, "\uBC86\uBC87\uBC89\uBC8A\uBC8D\uBC8F", 4, "\uBC96\uBC98\uBC9B", 4, "\uBCA2\uBCA3\uBCA5\uBCA6\uBCA9", 6, "\uBCB2\uBCB6", 5, "\uBCBE\uBCBF\uBCC1\uBCC2\uBCC3\uBCC5", 7, "\uBCCE\uBCD2\uBCD3\uBCD4\uBCD6\uBCD7\uBCD9\uBCDA\uBCDB\uBCDD", 22, "\uBCF7\uBCF9\uBCFA\uBCFB\uBCFD"],
      ["9441", "\uBCFE", 5, "\uBD06\uBD08\uBD0A", 5, "\uBD11\uBD12\uBD13\uBD15", 8],
      ["9461", "\uBD1E", 5, "\uBD25", 6, "\uBD2D", 12],
      ["9481", "\uBD3A", 5, "\uBD41", 6, "\uBD4A\uBD4B\uBD4D\uBD4E\uBD4F\uBD51", 6, "\uBD5A", 9, "\uBD65\uBD66\uBD67\uBD69", 22, "\uBD82\uBD83\uBD85\uBD86\uBD8B", 4, "\uBD92\uBD94\uBD96\uBD97\uBD98\uBD9B\uBD9D", 6, "\uBDA5", 10, "\uBDB1", 6, "\uBDB9", 24],
      ["9541", "\uBDD2\uBDD3\uBDD6\uBDD7\uBDD9\uBDDA\uBDDB\uBDDD", 11, "\uBDEA", 5, "\uBDF1"],
      ["9561", "\uBDF2\uBDF3\uBDF5\uBDF6\uBDF7\uBDF9", 6, "\uBE01\uBE02\uBE04\uBE06", 5, "\uBE0E\uBE0F\uBE11\uBE12\uBE13"],
      ["9581", "\uBE15", 6, "\uBE1E\uBE20", 35, "\uBE46\uBE47\uBE49\uBE4A\uBE4B\uBE4D\uBE4F", 4, "\uBE56\uBE58\uBE5C\uBE5D\uBE5E\uBE5F\uBE62\uBE63\uBE65\uBE66\uBE67\uBE69\uBE6B", 4, "\uBE72\uBE76", 4, "\uBE7E\uBE7F\uBE81\uBE82\uBE83\uBE85", 6, "\uBE8E\uBE92", 5, "\uBE9A", 13, "\uBEA9", 14],
      ["9641", "\uBEB8", 23, "\uBED2\uBED3"],
      ["9661", "\uBED5\uBED6\uBED9", 6, "\uBEE1\uBEE2\uBEE6", 5, "\uBEED", 8],
      ["9681", "\uBEF6", 10, "\uBF02", 5, "\uBF0A", 13, "\uBF1A\uBF1E", 33, "\uBF42\uBF43\uBF45\uBF46\uBF47\uBF49", 6, "\uBF52\uBF53\uBF54\uBF56", 44],
      ["9741", "\uBF83", 16, "\uBF95", 8],
      ["9761", "\uBF9E", 17, "\uBFB1", 7],
      ["9781", "\uBFB9", 11, "\uBFC6", 5, "\uBFCE\uBFCF\uBFD1\uBFD2\uBFD3\uBFD5", 6, "\uBFDD\uBFDE\uBFE0\uBFE2", 89, "\uC03D\uC03E\uC03F"],
      ["9841", "\uC040", 16, "\uC052", 5, "\uC059\uC05A\uC05B"],
      ["9861", "\uC05D\uC05E\uC05F\uC061", 6, "\uC06A", 15],
      ["9881", "\uC07A", 21, "\uC092\uC093\uC095\uC096\uC097\uC099", 6, "\uC0A2\uC0A4\uC0A6", 5, "\uC0AE\uC0B1\uC0B2\uC0B7", 4, "\uC0BE\uC0C2\uC0C3\uC0C4\uC0C6\uC0C7\uC0CA\uC0CB\uC0CD\uC0CE\uC0CF\uC0D1", 6, "\uC0DA\uC0DE", 5, "\uC0E6\uC0E7\uC0E9\uC0EA\uC0EB\uC0ED", 6, "\uC0F6\uC0F8\uC0FA", 5, "\uC101\uC102\uC103\uC105\uC106\uC107\uC109", 6, "\uC111\uC112\uC113\uC114\uC116", 5, "\uC121\uC122\uC125\uC128\uC129\uC12A\uC12B\uC12E"],
      ["9941", "\uC132\uC133\uC134\uC135\uC137\uC13A\uC13B\uC13D\uC13E\uC13F\uC141", 6, "\uC14A\uC14E", 5, "\uC156\uC157"],
      ["9961", "\uC159\uC15A\uC15B\uC15D", 6, "\uC166\uC16A", 5, "\uC171\uC172\uC173\uC175\uC176\uC177\uC179\uC17A\uC17B"],
      ["9981", "\uC17C", 8, "\uC186", 5, "\uC18F\uC191\uC192\uC193\uC195\uC197", 4, "\uC19E\uC1A0\uC1A2\uC1A3\uC1A4\uC1A6\uC1A7\uC1AA\uC1AB\uC1AD\uC1AE\uC1AF\uC1B1", 11, "\uC1BE", 5, "\uC1C5\uC1C6\uC1C7\uC1C9\uC1CA\uC1CB\uC1CD", 6, "\uC1D5\uC1D6\uC1D9", 6, "\uC1E1\uC1E2\uC1E3\uC1E5\uC1E6\uC1E7\uC1E9", 6, "\uC1F2\uC1F4", 7, "\uC1FE\uC1FF\uC201\uC202\uC203\uC205", 6, "\uC20E\uC210\uC212", 5, "\uC21A\uC21B\uC21D\uC21E\uC221\uC222\uC223"],
      ["9a41", "\uC224\uC225\uC226\uC227\uC22A\uC22C\uC22E\uC230\uC233\uC235", 16],
      ["9a61", "\uC246\uC247\uC249", 6, "\uC252\uC253\uC255\uC256\uC257\uC259", 6, "\uC261\uC262\uC263\uC264\uC266"],
      ["9a81", "\uC267", 4, "\uC26E\uC26F\uC271\uC272\uC273\uC275", 6, "\uC27E\uC280\uC282", 5, "\uC28A", 5, "\uC291", 6, "\uC299\uC29A\uC29C\uC29E", 5, "\uC2A6\uC2A7\uC2A9\uC2AA\uC2AB\uC2AE", 5, "\uC2B6\uC2B8\uC2BA", 33, "\uC2DE\uC2DF\uC2E1\uC2E2\uC2E5", 5, "\uC2EE\uC2F0\uC2F2\uC2F3\uC2F4\uC2F5\uC2F7\uC2FA\uC2FD\uC2FE\uC2FF\uC301", 6, "\uC30A\uC30B\uC30E\uC30F"],
      ["9b41", "\uC310\uC311\uC312\uC316\uC317\uC319\uC31A\uC31B\uC31D", 6, "\uC326\uC327\uC32A", 8],
      ["9b61", "\uC333", 17, "\uC346", 7],
      ["9b81", "\uC34E", 25, "\uC36A\uC36B\uC36D\uC36E\uC36F\uC371\uC373", 4, "\uC37A\uC37B\uC37E", 5, "\uC385\uC386\uC387\uC389\uC38A\uC38B\uC38D", 50, "\uC3C1", 22, "\uC3DA"],
      ["9c41", "\uC3DB\uC3DD\uC3DE\uC3E1\uC3E3", 4, "\uC3EA\uC3EB\uC3EC\uC3EE", 5, "\uC3F6\uC3F7\uC3F9", 5],
      ["9c61", "\uC3FF", 8, "\uC409", 6, "\uC411", 9],
      ["9c81", "\uC41B", 8, "\uC425", 6, "\uC42D\uC42E\uC42F\uC431\uC432\uC433\uC435", 6, "\uC43E", 9, "\uC449", 26, "\uC466\uC467\uC469\uC46A\uC46B\uC46D", 6, "\uC476\uC477\uC478\uC47A", 5, "\uC481", 18, "\uC495", 6, "\uC49D", 12],
      ["9d41", "\uC4AA", 13, "\uC4B9\uC4BA\uC4BB\uC4BD", 8],
      ["9d61", "\uC4C6", 25],
      ["9d81", "\uC4E0", 8, "\uC4EA", 5, "\uC4F2\uC4F3\uC4F5\uC4F6\uC4F7\uC4F9\uC4FB\uC4FC\uC4FD\uC4FE\uC502", 9, "\uC50D\uC50E\uC50F\uC511\uC512\uC513\uC515", 6, "\uC51D", 10, "\uC52A\uC52B\uC52D\uC52E\uC52F\uC531", 6, "\uC53A\uC53C\uC53E", 5, "\uC546\uC547\uC54B\uC54F\uC550\uC551\uC552\uC556\uC55A\uC55B\uC55C\uC55F\uC562\uC563\uC565\uC566\uC567\uC569", 6, "\uC572\uC576", 5, "\uC57E\uC57F\uC581\uC582\uC583\uC585\uC586\uC588\uC589\uC58A\uC58B\uC58E\uC590\uC592\uC593\uC594"],
      ["9e41", "\uC596\uC599\uC59A\uC59B\uC59D\uC59E\uC59F\uC5A1", 7, "\uC5AA", 9, "\uC5B6"],
      ["9e61", "\uC5B7\uC5BA\uC5BF", 4, "\uC5CB\uC5CD\uC5CF\uC5D2\uC5D3\uC5D5\uC5D6\uC5D7\uC5D9", 6, "\uC5E2\uC5E4\uC5E6\uC5E7"],
      ["9e81", "\uC5E8\uC5E9\uC5EA\uC5EB\uC5EF\uC5F1\uC5F2\uC5F3\uC5F5\uC5F8\uC5F9\uC5FA\uC5FB\uC602\uC603\uC604\uC609\uC60A\uC60B\uC60D\uC60E\uC60F\uC611", 6, "\uC61A\uC61D", 6, "\uC626\uC627\uC629\uC62A\uC62B\uC62F\uC631\uC632\uC636\uC638\uC63A\uC63C\uC63D\uC63E\uC63F\uC642\uC643\uC645\uC646\uC647\uC649", 6, "\uC652\uC656", 5, "\uC65E\uC65F\uC661", 10, "\uC66D\uC66E\uC670\uC672", 5, "\uC67A\uC67B\uC67D\uC67E\uC67F\uC681", 6, "\uC68A\uC68C\uC68E", 5, "\uC696\uC697\uC699\uC69A\uC69B\uC69D", 6, "\uC6A6"],
      ["9f41", "\uC6A8\uC6AA", 5, "\uC6B2\uC6B3\uC6B5\uC6B6\uC6B7\uC6BB", 4, "\uC6C2\uC6C4\uC6C6", 5, "\uC6CE"],
      ["9f61", "\uC6CF\uC6D1\uC6D2\uC6D3\uC6D5", 6, "\uC6DE\uC6DF\uC6E2", 5, "\uC6EA\uC6EB\uC6ED\uC6EE\uC6EF\uC6F1\uC6F2"],
      ["9f81", "\uC6F3", 4, "\uC6FA\uC6FB\uC6FC\uC6FE", 5, "\uC706\uC707\uC709\uC70A\uC70B\uC70D", 6, "\uC716\uC718\uC71A", 5, "\uC722\uC723\uC725\uC726\uC727\uC729", 6, "\uC732\uC734\uC736\uC738\uC739\uC73A\uC73B\uC73E\uC73F\uC741\uC742\uC743\uC745", 4, "\uC74B\uC74E\uC750\uC759\uC75A\uC75B\uC75D\uC75E\uC75F\uC761", 6, "\uC769\uC76A\uC76C", 7, "\uC776\uC777\uC779\uC77A\uC77B\uC77F\uC780\uC781\uC782\uC786\uC78B\uC78C\uC78D\uC78F\uC792\uC793\uC795\uC799\uC79B", 4, "\uC7A2\uC7A7", 4, "\uC7AE\uC7AF\uC7B1\uC7B2\uC7B3\uC7B5\uC7B6\uC7B7"],
      ["a041", "\uC7B8\uC7B9\uC7BA\uC7BB\uC7BE\uC7C2", 5, "\uC7CA\uC7CB\uC7CD\uC7CF\uC7D1", 6, "\uC7D9\uC7DA\uC7DB\uC7DC"],
      ["a061", "\uC7DE", 5, "\uC7E5\uC7E6\uC7E7\uC7E9\uC7EA\uC7EB\uC7ED", 13],
      ["a081", "\uC7FB", 4, "\uC802\uC803\uC805\uC806\uC807\uC809\uC80B", 4, "\uC812\uC814\uC817", 4, "\uC81E\uC81F\uC821\uC822\uC823\uC825", 6, "\uC82E\uC830\uC832", 5, "\uC839\uC83A\uC83B\uC83D\uC83E\uC83F\uC841", 6, "\uC84A\uC84B\uC84E", 5, "\uC855", 26, "\uC872\uC873\uC875\uC876\uC877\uC879\uC87B", 4, "\uC882\uC884\uC888\uC889\uC88A\uC88E", 5, "\uC895", 7, "\uC89E\uC8A0\uC8A2\uC8A3\uC8A4"],
      ["a141", "\uC8A5\uC8A6\uC8A7\uC8A9", 18, "\uC8BE\uC8BF\uC8C0\uC8C1"],
      ["a161", "\uC8C2\uC8C3\uC8C5\uC8C6\uC8C7\uC8C9\uC8CA\uC8CB\uC8CD", 6, "\uC8D6\uC8D8\uC8DA", 5, "\uC8E2\uC8E3\uC8E5"],
      ["a181", "\uC8E6", 14, "\uC8F6", 5, "\uC8FE\uC8FF\uC901\uC902\uC903\uC907", 4, "\uC90E\u3000\u3001\u3002\xB7\u2025\u2026\xA8\u3003\xAD\u2015\u2225\uFF3C\u223C\u2018\u2019\u201C\u201D\u3014\u3015\u3008", 9, "\xB1\xD7\xF7\u2260\u2264\u2265\u221E\u2234\xB0\u2032\u2033\u2103\u212B\uFFE0\uFFE1\uFFE5\u2642\u2640\u2220\u22A5\u2312\u2202\u2207\u2261\u2252\xA7\u203B\u2606\u2605\u25CB\u25CF\u25CE\u25C7\u25C6\u25A1\u25A0\u25B3\u25B2\u25BD\u25BC\u2192\u2190\u2191\u2193\u2194\u3013\u226A\u226B\u221A\u223D\u221D\u2235\u222B\u222C\u2208\u220B\u2286\u2287\u2282\u2283\u222A\u2229\u2227\u2228\uFFE2"],
      ["a241", "\uC910\uC912", 5, "\uC919", 18],
      ["a261", "\uC92D", 6, "\uC935", 18],
      ["a281", "\uC948", 7, "\uC952\uC953\uC955\uC956\uC957\uC959", 6, "\uC962\uC964", 7, "\uC96D\uC96E\uC96F\u21D2\u21D4\u2200\u2203\xB4\uFF5E\u02C7\u02D8\u02DD\u02DA\u02D9\xB8\u02DB\xA1\xBF\u02D0\u222E\u2211\u220F\xA4\u2109\u2030\u25C1\u25C0\u25B7\u25B6\u2664\u2660\u2661\u2665\u2667\u2663\u2299\u25C8\u25A3\u25D0\u25D1\u2592\u25A4\u25A5\u25A8\u25A7\u25A6\u25A9\u2668\u260F\u260E\u261C\u261E\xB6\u2020\u2021\u2195\u2197\u2199\u2196\u2198\u266D\u2669\u266A\u266C\u327F\u321C\u2116\u33C7\u2122\u33C2\u33D8\u2121\u20AC\xAE"],
      ["a341", "\uC971\uC972\uC973\uC975", 6, "\uC97D", 10, "\uC98A\uC98B\uC98D\uC98E\uC98F"],
      ["a361", "\uC991", 6, "\uC99A\uC99C\uC99E", 16],
      ["a381", "\uC9AF", 16, "\uC9C2\uC9C3\uC9C5\uC9C6\uC9C9\uC9CB", 4, "\uC9D2\uC9D4\uC9D7\uC9D8\uC9DB\uFF01", 58, "\uFFE6\uFF3D", 32, "\uFFE3"],
      ["a441", "\uC9DE\uC9DF\uC9E1\uC9E3\uC9E5\uC9E6\uC9E8\uC9E9\uC9EA\uC9EB\uC9EE\uC9F2", 5, "\uC9FA\uC9FB\uC9FD\uC9FE\uC9FF\uCA01\uCA02\uCA03\uCA04"],
      ["a461", "\uCA05\uCA06\uCA07\uCA0A\uCA0E", 5, "\uCA15\uCA16\uCA17\uCA19", 12],
      ["a481", "\uCA26\uCA27\uCA28\uCA2A", 28, "\u3131", 93],
      ["a541", "\uCA47", 4, "\uCA4E\uCA4F\uCA51\uCA52\uCA53\uCA55", 6, "\uCA5E\uCA62", 5, "\uCA69\uCA6A"],
      ["a561", "\uCA6B", 17, "\uCA7E", 5, "\uCA85\uCA86"],
      ["a581", "\uCA87", 16, "\uCA99", 14, "\u2170", 9],
      ["a5b0", "\u2160", 9],
      ["a5c1", "\u0391", 16, "\u03A3", 6],
      ["a5e1", "\u03B1", 16, "\u03C3", 6],
      ["a641", "\uCAA8", 19, "\uCABE\uCABF\uCAC1\uCAC2\uCAC3\uCAC5"],
      ["a661", "\uCAC6", 5, "\uCACE\uCAD0\uCAD2\uCAD4\uCAD5\uCAD6\uCAD7\uCADA", 5, "\uCAE1", 6],
      ["a681", "\uCAE8\uCAE9\uCAEA\uCAEB\uCAED", 6, "\uCAF5", 18, "\uCB09\uCB0A\u2500\u2502\u250C\u2510\u2518\u2514\u251C\u252C\u2524\u2534\u253C\u2501\u2503\u250F\u2513\u251B\u2517\u2523\u2533\u252B\u253B\u254B\u2520\u252F\u2528\u2537\u253F\u251D\u2530\u2525\u2538\u2542\u2512\u2511\u251A\u2519\u2516\u2515\u250E\u250D\u251E\u251F\u2521\u2522\u2526\u2527\u2529\u252A\u252D\u252E\u2531\u2532\u2535\u2536\u2539\u253A\u253D\u253E\u2540\u2541\u2543", 7],
      ["a741", "\uCB0B", 4, "\uCB11\uCB12\uCB13\uCB15\uCB16\uCB17\uCB19", 6, "\uCB22", 7],
      ["a761", "\uCB2A", 22, "\uCB42\uCB43\uCB44"],
      ["a781", "\uCB45\uCB46\uCB47\uCB4A\uCB4B\uCB4D\uCB4E\uCB4F\uCB51", 6, "\uCB5A\uCB5B\uCB5C\uCB5E", 5, "\uCB65", 7, "\u3395\u3396\u3397\u2113\u3398\u33C4\u33A3\u33A4\u33A5\u33A6\u3399", 9, "\u33CA\u338D\u338E\u338F\u33CF\u3388\u3389\u33C8\u33A7\u33A8\u33B0", 9, "\u3380", 4, "\u33BA", 5, "\u3390", 4, "\u2126\u33C0\u33C1\u338A\u338B\u338C\u33D6\u33C5\u33AD\u33AE\u33AF\u33DB\u33A9\u33AA\u33AB\u33AC\u33DD\u33D0\u33D3\u33C3\u33C9\u33DC\u33C6"],
      ["a841", "\uCB6D", 10, "\uCB7A", 14],
      ["a861", "\uCB89", 18, "\uCB9D", 6],
      ["a881", "\uCBA4", 19, "\uCBB9", 11, "\xC6\xD0\xAA\u0126"],
      ["a8a6", "\u0132"],
      ["a8a8", "\u013F\u0141\xD8\u0152\xBA\xDE\u0166\u014A"],
      ["a8b1", "\u3260", 27, "\u24D0", 25, "\u2460", 14, "\xBD\u2153\u2154\xBC\xBE\u215B\u215C\u215D\u215E"],
      ["a941", "\uCBC5", 14, "\uCBD5", 10],
      ["a961", "\uCBE0\uCBE1\uCBE2\uCBE3\uCBE5\uCBE6\uCBE8\uCBEA", 18],
      ["a981", "\uCBFD", 14, "\uCC0E\uCC0F\uCC11\uCC12\uCC13\uCC15", 6, "\uCC1E\uCC1F\uCC20\uCC23\uCC24\xE6\u0111\xF0\u0127\u0131\u0133\u0138\u0140\u0142\xF8\u0153\xDF\xFE\u0167\u014B\u0149\u3200", 27, "\u249C", 25, "\u2474", 14, "\xB9\xB2\xB3\u2074\u207F\u2081\u2082\u2083\u2084"],
      ["aa41", "\uCC25\uCC26\uCC2A\uCC2B\uCC2D\uCC2F\uCC31", 6, "\uCC3A\uCC3F", 4, "\uCC46\uCC47\uCC49\uCC4A\uCC4B\uCC4D\uCC4E"],
      ["aa61", "\uCC4F", 4, "\uCC56\uCC5A", 5, "\uCC61\uCC62\uCC63\uCC65\uCC67\uCC69", 6, "\uCC71\uCC72"],
      ["aa81", "\uCC73\uCC74\uCC76", 29, "\u3041", 82],
      ["ab41", "\uCC94\uCC95\uCC96\uCC97\uCC9A\uCC9B\uCC9D\uCC9E\uCC9F\uCCA1", 6, "\uCCAA\uCCAE", 5, "\uCCB6\uCCB7\uCCB9"],
      ["ab61", "\uCCBA\uCCBB\uCCBD", 6, "\uCCC6\uCCC8\uCCCA", 5, "\uCCD1\uCCD2\uCCD3\uCCD5", 5],
      ["ab81", "\uCCDB", 8, "\uCCE5", 6, "\uCCED\uCCEE\uCCEF\uCCF1", 12, "\u30A1", 85],
      ["ac41", "\uCCFE\uCCFF\uCD00\uCD02", 5, "\uCD0A\uCD0B\uCD0D\uCD0E\uCD0F\uCD11", 6, "\uCD1A\uCD1C\uCD1E\uCD1F\uCD20"],
      ["ac61", "\uCD21\uCD22\uCD23\uCD25\uCD26\uCD27\uCD29\uCD2A\uCD2B\uCD2D", 11, "\uCD3A", 4],
      ["ac81", "\uCD3F", 28, "\uCD5D\uCD5E\uCD5F\u0410", 5, "\u0401\u0416", 25],
      ["acd1", "\u0430", 5, "\u0451\u0436", 25],
      ["ad41", "\uCD61\uCD62\uCD63\uCD65", 6, "\uCD6E\uCD70\uCD72", 5, "\uCD79", 7],
      ["ad61", "\uCD81", 6, "\uCD89", 10, "\uCD96\uCD97\uCD99\uCD9A\uCD9B\uCD9D\uCD9E\uCD9F"],
      ["ad81", "\uCDA0\uCDA1\uCDA2\uCDA3\uCDA6\uCDA8\uCDAA", 5, "\uCDB1", 18, "\uCDC5"],
      ["ae41", "\uCDC6", 5, "\uCDCD\uCDCE\uCDCF\uCDD1", 16],
      ["ae61", "\uCDE2", 5, "\uCDE9\uCDEA\uCDEB\uCDED\uCDEE\uCDEF\uCDF1", 6, "\uCDFA\uCDFC\uCDFE", 4],
      ["ae81", "\uCE03\uCE05\uCE06\uCE07\uCE09\uCE0A\uCE0B\uCE0D", 6, "\uCE15\uCE16\uCE17\uCE18\uCE1A", 5, "\uCE22\uCE23\uCE25\uCE26\uCE27\uCE29\uCE2A\uCE2B"],
      ["af41", "\uCE2C\uCE2D\uCE2E\uCE2F\uCE32\uCE34\uCE36", 19],
      ["af61", "\uCE4A", 13, "\uCE5A\uCE5B\uCE5D\uCE5E\uCE62", 5, "\uCE6A\uCE6C"],
      ["af81", "\uCE6E", 5, "\uCE76\uCE77\uCE79\uCE7A\uCE7B\uCE7D", 6, "\uCE86\uCE88\uCE8A", 5, "\uCE92\uCE93\uCE95\uCE96\uCE97\uCE99"],
      ["b041", "\uCE9A", 5, "\uCEA2\uCEA6", 5, "\uCEAE", 12],
      ["b061", "\uCEBB", 5, "\uCEC2", 19],
      ["b081", "\uCED6", 13, "\uCEE6\uCEE7\uCEE9\uCEEA\uCEED", 6, "\uCEF6\uCEFA", 5, "\uAC00\uAC01\uAC04\uAC07\uAC08\uAC09\uAC0A\uAC10", 7, "\uAC19", 4, "\uAC20\uAC24\uAC2C\uAC2D\uAC2F\uAC30\uAC31\uAC38\uAC39\uAC3C\uAC40\uAC4B\uAC4D\uAC54\uAC58\uAC5C\uAC70\uAC71\uAC74\uAC77\uAC78\uAC7A\uAC80\uAC81\uAC83\uAC84\uAC85\uAC86\uAC89\uAC8A\uAC8B\uAC8C\uAC90\uAC94\uAC9C\uAC9D\uAC9F\uACA0\uACA1\uACA8\uACA9\uACAA\uACAC\uACAF\uACB0\uACB8\uACB9\uACBB\uACBC\uACBD\uACC1\uACC4\uACC8\uACCC\uACD5\uACD7\uACE0\uACE1\uACE4\uACE7\uACE8\uACEA\uACEC\uACEF\uACF0\uACF1\uACF3\uACF5\uACF6\uACFC\uACFD\uAD00\uAD04\uAD06"],
      ["b141", "\uCF02\uCF03\uCF05\uCF06\uCF07\uCF09", 6, "\uCF12\uCF14\uCF16", 5, "\uCF1D\uCF1E\uCF1F\uCF21\uCF22\uCF23"],
      ["b161", "\uCF25", 6, "\uCF2E\uCF32", 5, "\uCF39", 11],
      ["b181", "\uCF45", 14, "\uCF56\uCF57\uCF59\uCF5A\uCF5B\uCF5D", 6, "\uCF66\uCF68\uCF6A\uCF6B\uCF6C\uAD0C\uAD0D\uAD0F\uAD11\uAD18\uAD1C\uAD20\uAD29\uAD2C\uAD2D\uAD34\uAD35\uAD38\uAD3C\uAD44\uAD45\uAD47\uAD49\uAD50\uAD54\uAD58\uAD61\uAD63\uAD6C\uAD6D\uAD70\uAD73\uAD74\uAD75\uAD76\uAD7B\uAD7C\uAD7D\uAD7F\uAD81\uAD82\uAD88\uAD89\uAD8C\uAD90\uAD9C\uAD9D\uADA4\uADB7\uADC0\uADC1\uADC4\uADC8\uADD0\uADD1\uADD3\uADDC\uADE0\uADE4\uADF8\uADF9\uADFC\uADFF\uAE00\uAE01\uAE08\uAE09\uAE0B\uAE0D\uAE14\uAE30\uAE31\uAE34\uAE37\uAE38\uAE3A\uAE40\uAE41\uAE43\uAE45\uAE46\uAE4A\uAE4C\uAE4D\uAE4E\uAE50\uAE54\uAE56\uAE5C\uAE5D\uAE5F\uAE60\uAE61\uAE65\uAE68\uAE69\uAE6C\uAE70\uAE78"],
      ["b241", "\uCF6D\uCF6E\uCF6F\uCF72\uCF73\uCF75\uCF76\uCF77\uCF79", 6, "\uCF81\uCF82\uCF83\uCF84\uCF86", 5, "\uCF8D"],
      ["b261", "\uCF8E", 18, "\uCFA2", 5, "\uCFA9"],
      ["b281", "\uCFAA", 5, "\uCFB1", 18, "\uCFC5", 6, "\uAE79\uAE7B\uAE7C\uAE7D\uAE84\uAE85\uAE8C\uAEBC\uAEBD\uAEBE\uAEC0\uAEC4\uAECC\uAECD\uAECF\uAED0\uAED1\uAED8\uAED9\uAEDC\uAEE8\uAEEB\uAEED\uAEF4\uAEF8\uAEFC\uAF07\uAF08\uAF0D\uAF10\uAF2C\uAF2D\uAF30\uAF32\uAF34\uAF3C\uAF3D\uAF3F\uAF41\uAF42\uAF43\uAF48\uAF49\uAF50\uAF5C\uAF5D\uAF64\uAF65\uAF79\uAF80\uAF84\uAF88\uAF90\uAF91\uAF95\uAF9C\uAFB8\uAFB9\uAFBC\uAFC0\uAFC7\uAFC8\uAFC9\uAFCB\uAFCD\uAFCE\uAFD4\uAFDC\uAFE8\uAFE9\uAFF0\uAFF1\uAFF4\uAFF8\uB000\uB001\uB004\uB00C\uB010\uB014\uB01C\uB01D\uB028\uB044\uB045\uB048\uB04A\uB04C\uB04E\uB053\uB054\uB055\uB057\uB059"],
      ["b341", "\uCFCC", 19, "\uCFE2\uCFE3\uCFE5\uCFE6\uCFE7\uCFE9"],
      ["b361", "\uCFEA", 5, "\uCFF2\uCFF4\uCFF6", 5, "\uCFFD\uCFFE\uCFFF\uD001\uD002\uD003\uD005", 5],
      ["b381", "\uD00B", 5, "\uD012", 5, "\uD019", 19, "\uB05D\uB07C\uB07D\uB080\uB084\uB08C\uB08D\uB08F\uB091\uB098\uB099\uB09A\uB09C\uB09F\uB0A0\uB0A1\uB0A2\uB0A8\uB0A9\uB0AB", 4, "\uB0B1\uB0B3\uB0B4\uB0B5\uB0B8\uB0BC\uB0C4\uB0C5\uB0C7\uB0C8\uB0C9\uB0D0\uB0D1\uB0D4\uB0D8\uB0E0\uB0E5\uB108\uB109\uB10B\uB10C\uB110\uB112\uB113\uB118\uB119\uB11B\uB11C\uB11D\uB123\uB124\uB125\uB128\uB12C\uB134\uB135\uB137\uB138\uB139\uB140\uB141\uB144\uB148\uB150\uB151\uB154\uB155\uB158\uB15C\uB160\uB178\uB179\uB17C\uB180\uB182\uB188\uB189\uB18B\uB18D\uB192\uB193\uB194\uB198\uB19C\uB1A8\uB1CC\uB1D0\uB1D4\uB1DC\uB1DD"],
      ["b441", "\uD02E", 5, "\uD036\uD037\uD039\uD03A\uD03B\uD03D", 6, "\uD046\uD048\uD04A", 5],
      ["b461", "\uD051\uD052\uD053\uD055\uD056\uD057\uD059", 6, "\uD061", 10, "\uD06E\uD06F"],
      ["b481", "\uD071\uD072\uD073\uD075", 6, "\uD07E\uD07F\uD080\uD082", 18, "\uB1DF\uB1E8\uB1E9\uB1EC\uB1F0\uB1F9\uB1FB\uB1FD\uB204\uB205\uB208\uB20B\uB20C\uB214\uB215\uB217\uB219\uB220\uB234\uB23C\uB258\uB25C\uB260\uB268\uB269\uB274\uB275\uB27C\uB284\uB285\uB289\uB290\uB291\uB294\uB298\uB299\uB29A\uB2A0\uB2A1\uB2A3\uB2A5\uB2A6\uB2AA\uB2AC\uB2B0\uB2B4\uB2C8\uB2C9\uB2CC\uB2D0\uB2D2\uB2D8\uB2D9\uB2DB\uB2DD\uB2E2\uB2E4\uB2E5\uB2E6\uB2E8\uB2EB", 4, "\uB2F3\uB2F4\uB2F5\uB2F7", 4, "\uB2FF\uB300\uB301\uB304\uB308\uB310\uB311\uB313\uB314\uB315\uB31C\uB354\uB355\uB356\uB358\uB35B\uB35C\uB35E\uB35F\uB364\uB365"],
      ["b541", "\uD095", 14, "\uD0A6\uD0A7\uD0A9\uD0AA\uD0AB\uD0AD", 5],
      ["b561", "\uD0B3\uD0B6\uD0B8\uD0BA", 5, "\uD0C2\uD0C3\uD0C5\uD0C6\uD0C7\uD0CA", 5, "\uD0D2\uD0D6", 4],
      ["b581", "\uD0DB\uD0DE\uD0DF\uD0E1\uD0E2\uD0E3\uD0E5", 6, "\uD0EE\uD0F2", 5, "\uD0F9", 11, "\uB367\uB369\uB36B\uB36E\uB370\uB371\uB374\uB378\uB380\uB381\uB383\uB384\uB385\uB38C\uB390\uB394\uB3A0\uB3A1\uB3A8\uB3AC\uB3C4\uB3C5\uB3C8\uB3CB\uB3CC\uB3CE\uB3D0\uB3D4\uB3D5\uB3D7\uB3D9\uB3DB\uB3DD\uB3E0\uB3E4\uB3E8\uB3FC\uB410\uB418\uB41C\uB420\uB428\uB429\uB42B\uB434\uB450\uB451\uB454\uB458\uB460\uB461\uB463\uB465\uB46C\uB480\uB488\uB49D\uB4A4\uB4A8\uB4AC\uB4B5\uB4B7\uB4B9\uB4C0\uB4C4\uB4C8\uB4D0\uB4D5\uB4DC\uB4DD\uB4E0\uB4E3\uB4E4\uB4E6\uB4EC\uB4ED\uB4EF\uB4F1\uB4F8\uB514\uB515\uB518\uB51B\uB51C\uB524\uB525\uB527\uB528\uB529\uB52A\uB530\uB531\uB534\uB538"],
      ["b641", "\uD105", 7, "\uD10E", 17],
      ["b661", "\uD120", 15, "\uD132\uD133\uD135\uD136\uD137\uD139\uD13B\uD13C\uD13D\uD13E"],
      ["b681", "\uD13F\uD142\uD146", 5, "\uD14E\uD14F\uD151\uD152\uD153\uD155", 6, "\uD15E\uD160\uD162", 5, "\uD169\uD16A\uD16B\uD16D\uB540\uB541\uB543\uB544\uB545\uB54B\uB54C\uB54D\uB550\uB554\uB55C\uB55D\uB55F\uB560\uB561\uB5A0\uB5A1\uB5A4\uB5A8\uB5AA\uB5AB\uB5B0\uB5B1\uB5B3\uB5B4\uB5B5\uB5BB\uB5BC\uB5BD\uB5C0\uB5C4\uB5CC\uB5CD\uB5CF\uB5D0\uB5D1\uB5D8\uB5EC\uB610\uB611\uB614\uB618\uB625\uB62C\uB634\uB648\uB664\uB668\uB69C\uB69D\uB6A0\uB6A4\uB6AB\uB6AC\uB6B1\uB6D4\uB6F0\uB6F4\uB6F8\uB700\uB701\uB705\uB728\uB729\uB72C\uB72F\uB730\uB738\uB739\uB73B\uB744\uB748\uB74C\uB754\uB755\uB760\uB764\uB768\uB770\uB771\uB773\uB775\uB77C\uB77D\uB780\uB784\uB78C\uB78D\uB78F\uB790\uB791\uB792\uB796\uB797"],
      ["b741", "\uD16E", 13, "\uD17D", 6, "\uD185\uD186\uD187\uD189\uD18A"],
      ["b761", "\uD18B", 20, "\uD1A2\uD1A3\uD1A5\uD1A6\uD1A7"],
      ["b781", "\uD1A9", 6, "\uD1B2\uD1B4\uD1B6\uD1B7\uD1B8\uD1B9\uD1BB\uD1BD\uD1BE\uD1BF\uD1C1", 14, "\uB798\uB799\uB79C\uB7A0\uB7A8\uB7A9\uB7AB\uB7AC\uB7AD\uB7B4\uB7B5\uB7B8\uB7C7\uB7C9\uB7EC\uB7ED\uB7F0\uB7F4\uB7FC\uB7FD\uB7FF\uB800\uB801\uB807\uB808\uB809\uB80C\uB810\uB818\uB819\uB81B\uB81D\uB824\uB825\uB828\uB82C\uB834\uB835\uB837\uB838\uB839\uB840\uB844\uB851\uB853\uB85C\uB85D\uB860\uB864\uB86C\uB86D\uB86F\uB871\uB878\uB87C\uB88D\uB8A8\uB8B0\uB8B4\uB8B8\uB8C0\uB8C1\uB8C3\uB8C5\uB8CC\uB8D0\uB8D4\uB8DD\uB8DF\uB8E1\uB8E8\uB8E9\uB8EC\uB8F0\uB8F8\uB8F9\uB8FB\uB8FD\uB904\uB918\uB920\uB93C\uB93D\uB940\uB944\uB94C\uB94F\uB951\uB958\uB959\uB95C\uB960\uB968\uB969"],
      ["b841", "\uD1D0", 7, "\uD1D9", 17],
      ["b861", "\uD1EB", 8, "\uD1F5\uD1F6\uD1F7\uD1F9", 13],
      ["b881", "\uD208\uD20A", 5, "\uD211", 24, "\uB96B\uB96D\uB974\uB975\uB978\uB97C\uB984\uB985\uB987\uB989\uB98A\uB98D\uB98E\uB9AC\uB9AD\uB9B0\uB9B4\uB9BC\uB9BD\uB9BF\uB9C1\uB9C8\uB9C9\uB9CC\uB9CE", 4, "\uB9D8\uB9D9\uB9DB\uB9DD\uB9DE\uB9E1\uB9E3\uB9E4\uB9E5\uB9E8\uB9EC\uB9F4\uB9F5\uB9F7\uB9F8\uB9F9\uB9FA\uBA00\uBA01\uBA08\uBA15\uBA38\uBA39\uBA3C\uBA40\uBA42\uBA48\uBA49\uBA4B\uBA4D\uBA4E\uBA53\uBA54\uBA55\uBA58\uBA5C\uBA64\uBA65\uBA67\uBA68\uBA69\uBA70\uBA71\uBA74\uBA78\uBA83\uBA84\uBA85\uBA87\uBA8C\uBAA8\uBAA9\uBAAB\uBAAC\uBAB0\uBAB2\uBAB8\uBAB9\uBABB\uBABD\uBAC4\uBAC8\uBAD8\uBAD9\uBAFC"],
      ["b941", "\uD22A\uD22B\uD22E\uD22F\uD231\uD232\uD233\uD235", 6, "\uD23E\uD240\uD242", 5, "\uD249\uD24A\uD24B\uD24C"],
      ["b961", "\uD24D", 14, "\uD25D", 6, "\uD265\uD266\uD267\uD268"],
      ["b981", "\uD269", 22, "\uD282\uD283\uD285\uD286\uD287\uD289\uD28A\uD28B\uD28C\uBB00\uBB04\uBB0D\uBB0F\uBB11\uBB18\uBB1C\uBB20\uBB29\uBB2B\uBB34\uBB35\uBB36\uBB38\uBB3B\uBB3C\uBB3D\uBB3E\uBB44\uBB45\uBB47\uBB49\uBB4D\uBB4F\uBB50\uBB54\uBB58\uBB61\uBB63\uBB6C\uBB88\uBB8C\uBB90\uBBA4\uBBA8\uBBAC\uBBB4\uBBB7\uBBC0\uBBC4\uBBC8\uBBD0\uBBD3\uBBF8\uBBF9\uBBFC\uBBFF\uBC00\uBC02\uBC08\uBC09\uBC0B\uBC0C\uBC0D\uBC0F\uBC11\uBC14", 4, "\uBC1B", 4, "\uBC24\uBC25\uBC27\uBC29\uBC2D\uBC30\uBC31\uBC34\uBC38\uBC40\uBC41\uBC43\uBC44\uBC45\uBC49\uBC4C\uBC4D\uBC50\uBC5D\uBC84\uBC85\uBC88\uBC8B\uBC8C\uBC8E\uBC94\uBC95\uBC97"],
      ["ba41", "\uD28D\uD28E\uD28F\uD292\uD293\uD294\uD296", 5, "\uD29D\uD29E\uD29F\uD2A1\uD2A2\uD2A3\uD2A5", 6, "\uD2AD"],
      ["ba61", "\uD2AE\uD2AF\uD2B0\uD2B2", 5, "\uD2BA\uD2BB\uD2BD\uD2BE\uD2C1\uD2C3", 4, "\uD2CA\uD2CC", 5],
      ["ba81", "\uD2D2\uD2D3\uD2D5\uD2D6\uD2D7\uD2D9\uD2DA\uD2DB\uD2DD", 6, "\uD2E6", 9, "\uD2F2\uD2F3\uD2F5\uD2F6\uD2F7\uD2F9\uD2FA\uBC99\uBC9A\uBCA0\uBCA1\uBCA4\uBCA7\uBCA8\uBCB0\uBCB1\uBCB3\uBCB4\uBCB5\uBCBC\uBCBD\uBCC0\uBCC4\uBCCD\uBCCF\uBCD0\uBCD1\uBCD5\uBCD8\uBCDC\uBCF4\uBCF5\uBCF6\uBCF8\uBCFC\uBD04\uBD05\uBD07\uBD09\uBD10\uBD14\uBD24\uBD2C\uBD40\uBD48\uBD49\uBD4C\uBD50\uBD58\uBD59\uBD64\uBD68\uBD80\uBD81\uBD84\uBD87\uBD88\uBD89\uBD8A\uBD90\uBD91\uBD93\uBD95\uBD99\uBD9A\uBD9C\uBDA4\uBDB0\uBDB8\uBDD4\uBDD5\uBDD8\uBDDC\uBDE9\uBDF0\uBDF4\uBDF8\uBE00\uBE03\uBE05\uBE0C\uBE0D\uBE10\uBE14\uBE1C\uBE1D\uBE1F\uBE44\uBE45\uBE48\uBE4C\uBE4E\uBE54\uBE55\uBE57\uBE59\uBE5A\uBE5B\uBE60\uBE61\uBE64"],
      ["bb41", "\uD2FB", 4, "\uD302\uD304\uD306", 5, "\uD30F\uD311\uD312\uD313\uD315\uD317", 4, "\uD31E\uD322\uD323"],
      ["bb61", "\uD324\uD326\uD327\uD32A\uD32B\uD32D\uD32E\uD32F\uD331", 6, "\uD33A\uD33E", 5, "\uD346\uD347\uD348\uD349"],
      ["bb81", "\uD34A", 31, "\uBE68\uBE6A\uBE70\uBE71\uBE73\uBE74\uBE75\uBE7B\uBE7C\uBE7D\uBE80\uBE84\uBE8C\uBE8D\uBE8F\uBE90\uBE91\uBE98\uBE99\uBEA8\uBED0\uBED1\uBED4\uBED7\uBED8\uBEE0\uBEE3\uBEE4\uBEE5\uBEEC\uBF01\uBF08\uBF09\uBF18\uBF19\uBF1B\uBF1C\uBF1D\uBF40\uBF41\uBF44\uBF48\uBF50\uBF51\uBF55\uBF94\uBFB0\uBFC5\uBFCC\uBFCD\uBFD0\uBFD4\uBFDC\uBFDF\uBFE1\uC03C\uC051\uC058\uC05C\uC060\uC068\uC069\uC090\uC091\uC094\uC098\uC0A0\uC0A1\uC0A3\uC0A5\uC0AC\uC0AD\uC0AF\uC0B0\uC0B3\uC0B4\uC0B5\uC0B6\uC0BC\uC0BD\uC0BF\uC0C0\uC0C1\uC0C5\uC0C8\uC0C9\uC0CC\uC0D0\uC0D8\uC0D9\uC0DB\uC0DC\uC0DD\uC0E4"],
      ["bc41", "\uD36A", 17, "\uD37E\uD37F\uD381\uD382\uD383\uD385\uD386\uD387"],
      ["bc61", "\uD388\uD389\uD38A\uD38B\uD38E\uD392", 5, "\uD39A\uD39B\uD39D\uD39E\uD39F\uD3A1", 6, "\uD3AA\uD3AC\uD3AE"],
      ["bc81", "\uD3AF", 4, "\uD3B5\uD3B6\uD3B7\uD3B9\uD3BA\uD3BB\uD3BD", 6, "\uD3C6\uD3C7\uD3CA", 5, "\uD3D1", 5, "\uC0E5\uC0E8\uC0EC\uC0F4\uC0F5\uC0F7\uC0F9\uC100\uC104\uC108\uC110\uC115\uC11C", 4, "\uC123\uC124\uC126\uC127\uC12C\uC12D\uC12F\uC130\uC131\uC136\uC138\uC139\uC13C\uC140\uC148\uC149\uC14B\uC14C\uC14D\uC154\uC155\uC158\uC15C\uC164\uC165\uC167\uC168\uC169\uC170\uC174\uC178\uC185\uC18C\uC18D\uC18E\uC190\uC194\uC196\uC19C\uC19D\uC19F\uC1A1\uC1A5\uC1A8\uC1A9\uC1AC\uC1B0\uC1BD\uC1C4\uC1C8\uC1CC\uC1D4\uC1D7\uC1D8\uC1E0\uC1E4\uC1E8\uC1F0\uC1F1\uC1F3\uC1FC\uC1FD\uC200\uC204\uC20C\uC20D\uC20F\uC211\uC218\uC219\uC21C\uC21F\uC220\uC228\uC229\uC22B\uC22D"],
      ["bd41", "\uD3D7\uD3D9", 7, "\uD3E2\uD3E4", 7, "\uD3EE\uD3EF\uD3F1\uD3F2\uD3F3\uD3F5\uD3F6\uD3F7"],
      ["bd61", "\uD3F8\uD3F9\uD3FA\uD3FB\uD3FE\uD400\uD402", 5, "\uD409", 13],
      ["bd81", "\uD417", 5, "\uD41E", 25, "\uC22F\uC231\uC232\uC234\uC248\uC250\uC251\uC254\uC258\uC260\uC265\uC26C\uC26D\uC270\uC274\uC27C\uC27D\uC27F\uC281\uC288\uC289\uC290\uC298\uC29B\uC29D\uC2A4\uC2A5\uC2A8\uC2AC\uC2AD\uC2B4\uC2B5\uC2B7\uC2B9\uC2DC\uC2DD\uC2E0\uC2E3\uC2E4\uC2EB\uC2EC\uC2ED\uC2EF\uC2F1\uC2F6\uC2F8\uC2F9\uC2FB\uC2FC\uC300\uC308\uC309\uC30C\uC30D\uC313\uC314\uC315\uC318\uC31C\uC324\uC325\uC328\uC329\uC345\uC368\uC369\uC36C\uC370\uC372\uC378\uC379\uC37C\uC37D\uC384\uC388\uC38C\uC3C0\uC3D8\uC3D9\uC3DC\uC3DF\uC3E0\uC3E2\uC3E8\uC3E9\uC3ED\uC3F4\uC3F5\uC3F8\uC408\uC410\uC424\uC42C\uC430"],
      ["be41", "\uD438", 7, "\uD441\uD442\uD443\uD445", 14],
      ["be61", "\uD454", 7, "\uD45D\uD45E\uD45F\uD461\uD462\uD463\uD465", 7, "\uD46E\uD470\uD471\uD472"],
      ["be81", "\uD473", 4, "\uD47A\uD47B\uD47D\uD47E\uD481\uD483", 4, "\uD48A\uD48C\uD48E", 5, "\uD495", 8, "\uC434\uC43C\uC43D\uC448\uC464\uC465\uC468\uC46C\uC474\uC475\uC479\uC480\uC494\uC49C\uC4B8\uC4BC\uC4E9\uC4F0\uC4F1\uC4F4\uC4F8\uC4FA\uC4FF\uC500\uC501\uC50C\uC510\uC514\uC51C\uC528\uC529\uC52C\uC530\uC538\uC539\uC53B\uC53D\uC544\uC545\uC548\uC549\uC54A\uC54C\uC54D\uC54E\uC553\uC554\uC555\uC557\uC558\uC559\uC55D\uC55E\uC560\uC561\uC564\uC568\uC570\uC571\uC573\uC574\uC575\uC57C\uC57D\uC580\uC584\uC587\uC58C\uC58D\uC58F\uC591\uC595\uC597\uC598\uC59C\uC5A0\uC5A9\uC5B4\uC5B5\uC5B8\uC5B9\uC5BB\uC5BC\uC5BD\uC5BE\uC5C4", 6, "\uC5CC\uC5CE"],
      ["bf41", "\uD49E", 10, "\uD4AA", 14],
      ["bf61", "\uD4B9", 18, "\uD4CD\uD4CE\uD4CF\uD4D1\uD4D2\uD4D3\uD4D5"],
      ["bf81", "\uD4D6", 5, "\uD4DD\uD4DE\uD4E0", 7, "\uD4E9\uD4EA\uD4EB\uD4ED\uD4EE\uD4EF\uD4F1", 6, "\uD4F9\uD4FA\uD4FC\uC5D0\uC5D1\uC5D4\uC5D8\uC5E0\uC5E1\uC5E3\uC5E5\uC5EC\uC5ED\uC5EE\uC5F0\uC5F4\uC5F6\uC5F7\uC5FC", 5, "\uC605\uC606\uC607\uC608\uC60C\uC610\uC618\uC619\uC61B\uC61C\uC624\uC625\uC628\uC62C\uC62D\uC62E\uC630\uC633\uC634\uC635\uC637\uC639\uC63B\uC640\uC641\uC644\uC648\uC650\uC651\uC653\uC654\uC655\uC65C\uC65D\uC660\uC66C\uC66F\uC671\uC678\uC679\uC67C\uC680\uC688\uC689\uC68B\uC68D\uC694\uC695\uC698\uC69C\uC6A4\uC6A5\uC6A7\uC6A9\uC6B0\uC6B1\uC6B4\uC6B8\uC6B9\uC6BA\uC6C0\uC6C1\uC6C3\uC6C5\uC6CC\uC6CD\uC6D0\uC6D4\uC6DC\uC6DD\uC6E0\uC6E1\uC6E8"],
      ["c041", "\uD4FE", 5, "\uD505\uD506\uD507\uD509\uD50A\uD50B\uD50D", 6, "\uD516\uD518", 5],
      ["c061", "\uD51E", 25],
      ["c081", "\uD538\uD539\uD53A\uD53B\uD53E\uD53F\uD541\uD542\uD543\uD545", 6, "\uD54E\uD550\uD552", 5, "\uD55A\uD55B\uD55D\uD55E\uD55F\uD561\uD562\uD563\uC6E9\uC6EC\uC6F0\uC6F8\uC6F9\uC6FD\uC704\uC705\uC708\uC70C\uC714\uC715\uC717\uC719\uC720\uC721\uC724\uC728\uC730\uC731\uC733\uC735\uC737\uC73C\uC73D\uC740\uC744\uC74A\uC74C\uC74D\uC74F\uC751", 7, "\uC75C\uC760\uC768\uC76B\uC774\uC775\uC778\uC77C\uC77D\uC77E\uC783\uC784\uC785\uC787\uC788\uC789\uC78A\uC78E\uC790\uC791\uC794\uC796\uC797\uC798\uC79A\uC7A0\uC7A1\uC7A3\uC7A4\uC7A5\uC7A6\uC7AC\uC7AD\uC7B0\uC7B4\uC7BC\uC7BD\uC7BF\uC7C0\uC7C1\uC7C8\uC7C9\uC7CC\uC7CE\uC7D0\uC7D8\uC7DD\uC7E4\uC7E8\uC7EC\uC800\uC801\uC804\uC808\uC80A"],
      ["c141", "\uD564\uD566\uD567\uD56A\uD56C\uD56E", 5, "\uD576\uD577\uD579\uD57A\uD57B\uD57D", 6, "\uD586\uD58A\uD58B"],
      ["c161", "\uD58C\uD58D\uD58E\uD58F\uD591", 19, "\uD5A6\uD5A7"],
      ["c181", "\uD5A8", 31, "\uC810\uC811\uC813\uC815\uC816\uC81C\uC81D\uC820\uC824\uC82C\uC82D\uC82F\uC831\uC838\uC83C\uC840\uC848\uC849\uC84C\uC84D\uC854\uC870\uC871\uC874\uC878\uC87A\uC880\uC881\uC883\uC885\uC886\uC887\uC88B\uC88C\uC88D\uC894\uC89D\uC89F\uC8A1\uC8A8\uC8BC\uC8BD\uC8C4\uC8C8\uC8CC\uC8D4\uC8D5\uC8D7\uC8D9\uC8E0\uC8E1\uC8E4\uC8F5\uC8FC\uC8FD\uC900\uC904\uC905\uC906\uC90C\uC90D\uC90F\uC911\uC918\uC92C\uC934\uC950\uC951\uC954\uC958\uC960\uC961\uC963\uC96C\uC970\uC974\uC97C\uC988\uC989\uC98C\uC990\uC998\uC999\uC99B\uC99D\uC9C0\uC9C1\uC9C4\uC9C7\uC9C8\uC9CA\uC9D0\uC9D1\uC9D3"],
      ["c241", "\uD5CA\uD5CB\uD5CD\uD5CE\uD5CF\uD5D1\uD5D3", 4, "\uD5DA\uD5DC\uD5DE", 5, "\uD5E6\uD5E7\uD5E9\uD5EA\uD5EB\uD5ED\uD5EE"],
      ["c261", "\uD5EF", 4, "\uD5F6\uD5F8\uD5FA", 5, "\uD602\uD603\uD605\uD606\uD607\uD609", 6, "\uD612"],
      ["c281", "\uD616", 5, "\uD61D\uD61E\uD61F\uD621\uD622\uD623\uD625", 7, "\uD62E", 9, "\uD63A\uD63B\uC9D5\uC9D6\uC9D9\uC9DA\uC9DC\uC9DD\uC9E0\uC9E2\uC9E4\uC9E7\uC9EC\uC9ED\uC9EF\uC9F0\uC9F1\uC9F8\uC9F9\uC9FC\uCA00\uCA08\uCA09\uCA0B\uCA0C\uCA0D\uCA14\uCA18\uCA29\uCA4C\uCA4D\uCA50\uCA54\uCA5C\uCA5D\uCA5F\uCA60\uCA61\uCA68\uCA7D\uCA84\uCA98\uCABC\uCABD\uCAC0\uCAC4\uCACC\uCACD\uCACF\uCAD1\uCAD3\uCAD8\uCAD9\uCAE0\uCAEC\uCAF4\uCB08\uCB10\uCB14\uCB18\uCB20\uCB21\uCB41\uCB48\uCB49\uCB4C\uCB50\uCB58\uCB59\uCB5D\uCB64\uCB78\uCB79\uCB9C\uCBB8\uCBD4\uCBE4\uCBE7\uCBE9\uCC0C\uCC0D\uCC10\uCC14\uCC1C\uCC1D\uCC21\uCC22\uCC27\uCC28\uCC29\uCC2C\uCC2E\uCC30\uCC38\uCC39\uCC3B"],
      ["c341", "\uD63D\uD63E\uD63F\uD641\uD642\uD643\uD644\uD646\uD647\uD64A\uD64C\uD64E\uD64F\uD650\uD652\uD653\uD656\uD657\uD659\uD65A\uD65B\uD65D", 4],
      ["c361", "\uD662", 4, "\uD668\uD66A", 5, "\uD672\uD673\uD675", 11],
      ["c381", "\uD681\uD682\uD684\uD686", 5, "\uD68E\uD68F\uD691\uD692\uD693\uD695", 7, "\uD69E\uD6A0\uD6A2", 5, "\uD6A9\uD6AA\uCC3C\uCC3D\uCC3E\uCC44\uCC45\uCC48\uCC4C\uCC54\uCC55\uCC57\uCC58\uCC59\uCC60\uCC64\uCC66\uCC68\uCC70\uCC75\uCC98\uCC99\uCC9C\uCCA0\uCCA8\uCCA9\uCCAB\uCCAC\uCCAD\uCCB4\uCCB5\uCCB8\uCCBC\uCCC4\uCCC5\uCCC7\uCCC9\uCCD0\uCCD4\uCCE4\uCCEC\uCCF0\uCD01\uCD08\uCD09\uCD0C\uCD10\uCD18\uCD19\uCD1B\uCD1D\uCD24\uCD28\uCD2C\uCD39\uCD5C\uCD60\uCD64\uCD6C\uCD6D\uCD6F\uCD71\uCD78\uCD88\uCD94\uCD95\uCD98\uCD9C\uCDA4\uCDA5\uCDA7\uCDA9\uCDB0\uCDC4\uCDCC\uCDD0\uCDE8\uCDEC\uCDF0\uCDF8\uCDF9\uCDFB\uCDFD\uCE04\uCE08\uCE0C\uCE14\uCE19\uCE20\uCE21\uCE24\uCE28\uCE30\uCE31\uCE33\uCE35"],
      ["c441", "\uD6AB\uD6AD\uD6AE\uD6AF\uD6B1", 7, "\uD6BA\uD6BC", 7, "\uD6C6\uD6C7\uD6C9\uD6CA\uD6CB"],
      ["c461", "\uD6CD\uD6CE\uD6CF\uD6D0\uD6D2\uD6D3\uD6D5\uD6D6\uD6D8\uD6DA", 5, "\uD6E1\uD6E2\uD6E3\uD6E5\uD6E6\uD6E7\uD6E9", 4],
      ["c481", "\uD6EE\uD6EF\uD6F1\uD6F2\uD6F3\uD6F4\uD6F6", 5, "\uD6FE\uD6FF\uD701\uD702\uD703\uD705", 11, "\uD712\uD713\uD714\uCE58\uCE59\uCE5C\uCE5F\uCE60\uCE61\uCE68\uCE69\uCE6B\uCE6D\uCE74\uCE75\uCE78\uCE7C\uCE84\uCE85\uCE87\uCE89\uCE90\uCE91\uCE94\uCE98\uCEA0\uCEA1\uCEA3\uCEA4\uCEA5\uCEAC\uCEAD\uCEC1\uCEE4\uCEE5\uCEE8\uCEEB\uCEEC\uCEF4\uCEF5\uCEF7\uCEF8\uCEF9\uCF00\uCF01\uCF04\uCF08\uCF10\uCF11\uCF13\uCF15\uCF1C\uCF20\uCF24\uCF2C\uCF2D\uCF2F\uCF30\uCF31\uCF38\uCF54\uCF55\uCF58\uCF5C\uCF64\uCF65\uCF67\uCF69\uCF70\uCF71\uCF74\uCF78\uCF80\uCF85\uCF8C\uCFA1\uCFA8\uCFB0\uCFC4\uCFE0\uCFE1\uCFE4\uCFE8\uCFF0\uCFF1\uCFF3\uCFF5\uCFFC\uD000\uD004\uD011\uD018\uD02D\uD034\uD035\uD038\uD03C"],
      ["c541", "\uD715\uD716\uD717\uD71A\uD71B\uD71D\uD71E\uD71F\uD721", 6, "\uD72A\uD72C\uD72E", 5, "\uD736\uD737\uD739"],
      ["c561", "\uD73A\uD73B\uD73D", 6, "\uD745\uD746\uD748\uD74A", 5, "\uD752\uD753\uD755\uD75A", 4],
      ["c581", "\uD75F\uD762\uD764\uD766\uD767\uD768\uD76A\uD76B\uD76D\uD76E\uD76F\uD771\uD772\uD773\uD775", 6, "\uD77E\uD77F\uD780\uD782", 5, "\uD78A\uD78B\uD044\uD045\uD047\uD049\uD050\uD054\uD058\uD060\uD06C\uD06D\uD070\uD074\uD07C\uD07D\uD081\uD0A4\uD0A5\uD0A8\uD0AC\uD0B4\uD0B5\uD0B7\uD0B9\uD0C0\uD0C1\uD0C4\uD0C8\uD0C9\uD0D0\uD0D1\uD0D3\uD0D4\uD0D5\uD0DC\uD0DD\uD0E0\uD0E4\uD0EC\uD0ED\uD0EF\uD0F0\uD0F1\uD0F8\uD10D\uD130\uD131\uD134\uD138\uD13A\uD140\uD141\uD143\uD144\uD145\uD14C\uD14D\uD150\uD154\uD15C\uD15D\uD15F\uD161\uD168\uD16C\uD17C\uD184\uD188\uD1A0\uD1A1\uD1A4\uD1A8\uD1B0\uD1B1\uD1B3\uD1B5\uD1BA\uD1BC\uD1C0\uD1D8\uD1F4\uD1F8\uD207\uD209\uD210\uD22C\uD22D\uD230\uD234\uD23C\uD23D\uD23F\uD241\uD248\uD25C"],
      ["c641", "\uD78D\uD78E\uD78F\uD791", 6, "\uD79A\uD79C\uD79E", 5],
      ["c6a1", "\uD264\uD280\uD281\uD284\uD288\uD290\uD291\uD295\uD29C\uD2A0\uD2A4\uD2AC\uD2B1\uD2B8\uD2B9\uD2BC\uD2BF\uD2C0\uD2C2\uD2C8\uD2C9\uD2CB\uD2D4\uD2D8\uD2DC\uD2E4\uD2E5\uD2F0\uD2F1\uD2F4\uD2F8\uD300\uD301\uD303\uD305\uD30C\uD30D\uD30E\uD310\uD314\uD316\uD31C\uD31D\uD31F\uD320\uD321\uD325\uD328\uD329\uD32C\uD330\uD338\uD339\uD33B\uD33C\uD33D\uD344\uD345\uD37C\uD37D\uD380\uD384\uD38C\uD38D\uD38F\uD390\uD391\uD398\uD399\uD39C\uD3A0\uD3A8\uD3A9\uD3AB\uD3AD\uD3B4\uD3B8\uD3BC\uD3C4\uD3C5\uD3C8\uD3C9\uD3D0\uD3D8\uD3E1\uD3E3\uD3EC\uD3ED\uD3F0\uD3F4\uD3FC\uD3FD\uD3FF\uD401"],
      ["c7a1", "\uD408\uD41D\uD440\uD444\uD45C\uD460\uD464\uD46D\uD46F\uD478\uD479\uD47C\uD47F\uD480\uD482\uD488\uD489\uD48B\uD48D\uD494\uD4A9\uD4CC\uD4D0\uD4D4\uD4DC\uD4DF\uD4E8\uD4EC\uD4F0\uD4F8\uD4FB\uD4FD\uD504\uD508\uD50C\uD514\uD515\uD517\uD53C\uD53D\uD540\uD544\uD54C\uD54D\uD54F\uD551\uD558\uD559\uD55C\uD560\uD565\uD568\uD569\uD56B\uD56D\uD574\uD575\uD578\uD57C\uD584\uD585\uD587\uD588\uD589\uD590\uD5A5\uD5C8\uD5C9\uD5CC\uD5D0\uD5D2\uD5D8\uD5D9\uD5DB\uD5DD\uD5E4\uD5E5\uD5E8\uD5EC\uD5F4\uD5F5\uD5F7\uD5F9\uD600\uD601\uD604\uD608\uD610\uD611\uD613\uD614\uD615\uD61C\uD620"],
      ["c8a1", "\uD624\uD62D\uD638\uD639\uD63C\uD640\uD645\uD648\uD649\uD64B\uD64D\uD651\uD654\uD655\uD658\uD65C\uD667\uD669\uD670\uD671\uD674\uD683\uD685\uD68C\uD68D\uD690\uD694\uD69D\uD69F\uD6A1\uD6A8\uD6AC\uD6B0\uD6B9\uD6BB\uD6C4\uD6C5\uD6C8\uD6CC\uD6D1\uD6D4\uD6D7\uD6D9\uD6E0\uD6E4\uD6E8\uD6F0\uD6F5\uD6FC\uD6FD\uD700\uD704\uD711\uD718\uD719\uD71C\uD720\uD728\uD729\uD72B\uD72D\uD734\uD735\uD738\uD73C\uD744\uD747\uD749\uD750\uD751\uD754\uD756\uD757\uD758\uD759\uD760\uD761\uD763\uD765\uD769\uD76C\uD770\uD774\uD77C\uD77D\uD781\uD788\uD789\uD78C\uD790\uD798\uD799\uD79B\uD79D"],
      ["caa1", "\u4F3D\u4F73\u5047\u50F9\u52A0\u53EF\u5475\u54E5\u5609\u5AC1\u5BB6\u6687\u67B6\u67B7\u67EF\u6B4C\u73C2\u75C2\u7A3C\u82DB\u8304\u8857\u8888\u8A36\u8CC8\u8DCF\u8EFB\u8FE6\u99D5\u523B\u5374\u5404\u606A\u6164\u6BBC\u73CF\u811A\u89BA\u89D2\u95A3\u4F83\u520A\u58BE\u5978\u59E6\u5E72\u5E79\u61C7\u63C0\u6746\u67EC\u687F\u6F97\u764E\u770B\u78F5\u7A08\u7AFF\u7C21\u809D\u826E\u8271\u8AEB\u9593\u4E6B\u559D\u66F7\u6E34\u78A3\u7AED\u845B\u8910\u874E\u97A8\u52D8\u574E\u582A\u5D4C\u611F\u61BE\u6221\u6562\u67D1\u6A44\u6E1B\u7518\u75B3\u76E3\u77B0\u7D3A\u90AF\u9451\u9452\u9F95"],
      ["cba1", "\u5323\u5CAC\u7532\u80DB\u9240\u9598\u525B\u5808\u59DC\u5CA1\u5D17\u5EB7\u5F3A\u5F4A\u6177\u6C5F\u757A\u7586\u7CE0\u7D73\u7DB1\u7F8C\u8154\u8221\u8591\u8941\u8B1B\u92FC\u964D\u9C47\u4ECB\u4EF7\u500B\u51F1\u584F\u6137\u613E\u6168\u6539\u69EA\u6F11\u75A5\u7686\u76D6\u7B87\u82A5\u84CB\uF900\u93A7\u958B\u5580\u5BA2\u5751\uF901\u7CB3\u7FB9\u91B5\u5028\u53BB\u5C45\u5DE8\u62D2\u636E\u64DA\u64E7\u6E20\u70AC\u795B\u8DDD\u8E1E\uF902\u907D\u9245\u92F8\u4E7E\u4EF6\u5065\u5DFE\u5EFA\u6106\u6957\u8171\u8654\u8E47\u9375\u9A2B\u4E5E\u5091\u6770\u6840\u5109\u528D\u5292\u6AA2"],
      ["cca1", "\u77BC\u9210\u9ED4\u52AB\u602F\u8FF2\u5048\u61A9\u63ED\u64CA\u683C\u6A84\u6FC0\u8188\u89A1\u9694\u5805\u727D\u72AC\u7504\u7D79\u7E6D\u80A9\u898B\u8B74\u9063\u9D51\u6289\u6C7A\u6F54\u7D50\u7F3A\u8A23\u517C\u614A\u7B9D\u8B19\u9257\u938C\u4EAC\u4FD3\u501E\u50BE\u5106\u52C1\u52CD\u537F\u5770\u5883\u5E9A\u5F91\u6176\u61AC\u64CE\u656C\u666F\u66BB\u66F4\u6897\u6D87\u7085\u70F1\u749F\u74A5\u74CA\u75D9\u786C\u78EC\u7ADF\u7AF6\u7D45\u7D93\u8015\u803F\u811B\u8396\u8B66\u8F15\u9015\u93E1\u9803\u9838\u9A5A\u9BE8\u4FC2\u5553\u583A\u5951\u5B63\u5C46\u60B8\u6212\u6842\u68B0"],
      ["cda1", "\u68E8\u6EAA\u754C\u7678\u78CE\u7A3D\u7CFB\u7E6B\u7E7C\u8A08\u8AA1\u8C3F\u968E\u9DC4\u53E4\u53E9\u544A\u5471\u56FA\u59D1\u5B64\u5C3B\u5EAB\u62F7\u6537\u6545\u6572\u66A0\u67AF\u69C1\u6CBD\u75FC\u7690\u777E\u7A3F\u7F94\u8003\u80A1\u818F\u82E6\u82FD\u83F0\u85C1\u8831\u88B4\u8AA5\uF903\u8F9C\u932E\u96C7\u9867\u9AD8\u9F13\u54ED\u659B\u66F2\u688F\u7A40\u8C37\u9D60\u56F0\u5764\u5D11\u6606\u68B1\u68CD\u6EFE\u7428\u889E\u9BE4\u6C68\uF904\u9AA8\u4F9B\u516C\u5171\u529F\u5B54\u5DE5\u6050\u606D\u62F1\u63A7\u653B\u73D9\u7A7A\u86A3\u8CA2\u978F\u4E32\u5BE1\u6208\u679C\u74DC"],
      ["cea1", "\u79D1\u83D3\u8A87\u8AB2\u8DE8\u904E\u934B\u9846\u5ED3\u69E8\u85FF\u90ED\uF905\u51A0\u5B98\u5BEC\u6163\u68FA\u6B3E\u704C\u742F\u74D8\u7BA1\u7F50\u83C5\u89C0\u8CAB\u95DC\u9928\u522E\u605D\u62EC\u9002\u4F8A\u5149\u5321\u58D9\u5EE3\u66E0\u6D38\u709A\u72C2\u73D6\u7B50\u80F1\u945B\u5366\u639B\u7F6B\u4E56\u5080\u584A\u58DE\u602A\u6127\u62D0\u69D0\u9B41\u5B8F\u7D18\u80B1\u8F5F\u4EA4\u50D1\u54AC\u55AC\u5B0C\u5DA0\u5DE7\u652A\u654E\u6821\u6A4B\u72E1\u768E\u77EF\u7D5E\u7FF9\u81A0\u854E\u86DF\u8F03\u8F4E\u90CA\u9903\u9A55\u9BAB\u4E18\u4E45\u4E5D\u4EC7\u4FF1\u5177\u52FE"],
      ["cfa1", "\u5340\u53E3\u53E5\u548E\u5614\u5775\u57A2\u5BC7\u5D87\u5ED0\u61FC\u62D8\u6551\u67B8\u67E9\u69CB\u6B50\u6BC6\u6BEC\u6C42\u6E9D\u7078\u72D7\u7396\u7403\u77BF\u77E9\u7A76\u7D7F\u8009\u81FC\u8205\u820A\u82DF\u8862\u8B33\u8CFC\u8EC0\u9011\u90B1\u9264\u92B6\u99D2\u9A45\u9CE9\u9DD7\u9F9C\u570B\u5C40\u83CA\u97A0\u97AB\u9EB4\u541B\u7A98\u7FA4\u88D9\u8ECD\u90E1\u5800\u5C48\u6398\u7A9F\u5BAE\u5F13\u7A79\u7AAE\u828E\u8EAC\u5026\u5238\u52F8\u5377\u5708\u62F3\u6372\u6B0A\u6DC3\u7737\u53A5\u7357\u8568\u8E76\u95D5\u673A\u6AC3\u6F70\u8A6D\u8ECC\u994B\uF906\u6677\u6B78\u8CB4"],
      ["d0a1", "\u9B3C\uF907\u53EB\u572D\u594E\u63C6\u69FB\u73EA\u7845\u7ABA\u7AC5\u7CFE\u8475\u898F\u8D73\u9035\u95A8\u52FB\u5747\u7547\u7B60\u83CC\u921E\uF908\u6A58\u514B\u524B\u5287\u621F\u68D8\u6975\u9699\u50C5\u52A4\u52E4\u61C3\u65A4\u6839\u69FF\u747E\u7B4B\u82B9\u83EB\u89B2\u8B39\u8FD1\u9949\uF909\u4ECA\u5997\u64D2\u6611\u6A8E\u7434\u7981\u79BD\u82A9\u887E\u887F\u895F\uF90A\u9326\u4F0B\u53CA\u6025\u6271\u6C72\u7D1A\u7D66\u4E98\u5162\u77DC\u80AF\u4F01\u4F0E\u5176\u5180\u55DC\u5668\u573B\u57FA\u57FC\u5914\u5947\u5993\u5BC4\u5C90\u5D0E\u5DF1\u5E7E\u5FCC\u6280\u65D7\u65E3"],
      ["d1a1", "\u671E\u671F\u675E\u68CB\u68C4\u6A5F\u6B3A\u6C23\u6C7D\u6C82\u6DC7\u7398\u7426\u742A\u7482\u74A3\u7578\u757F\u7881\u78EF\u7941\u7947\u7948\u797A\u7B95\u7D00\u7DBA\u7F88\u8006\u802D\u808C\u8A18\u8B4F\u8C48\u8D77\u9321\u9324\u98E2\u9951\u9A0E\u9A0F\u9A65\u9E92\u7DCA\u4F76\u5409\u62EE\u6854\u91D1\u55AB\u513A\uF90B\uF90C\u5A1C\u61E6\uF90D\u62CF\u62FF\uF90E", 5, "\u90A3\uF914", 4, "\u8AFE\uF919\uF91A\uF91B\uF91C\u6696\uF91D\u7156\uF91E\uF91F\u96E3\uF920\u634F\u637A\u5357\uF921\u678F\u6960\u6E73\uF922\u7537\uF923\uF924\uF925"],
      ["d2a1", "\u7D0D\uF926\uF927\u8872\u56CA\u5A18\uF928", 4, "\u4E43\uF92D\u5167\u5948\u67F0\u8010\uF92E\u5973\u5E74\u649A\u79CA\u5FF5\u606C\u62C8\u637B\u5BE7\u5BD7\u52AA\uF92F\u5974\u5F29\u6012\uF930\uF931\uF932\u7459\uF933", 5, "\u99D1\uF939", 10, "\u6FC3\uF944\uF945\u81BF\u8FB2\u60F1\uF946\uF947\u8166\uF948\uF949\u5C3F\uF94A", 7, "\u5AE9\u8A25\u677B\u7D10\uF952", 5, "\u80FD\uF958\uF959\u5C3C\u6CE5\u533F\u6EBA\u591A\u8336"],
      ["d3a1", "\u4E39\u4EB6\u4F46\u55AE\u5718\u58C7\u5F56\u65B7\u65E6\u6A80\u6BB5\u6E4D\u77ED\u7AEF\u7C1E\u7DDE\u86CB\u8892\u9132\u935B\u64BB\u6FBE\u737A\u75B8\u9054\u5556\u574D\u61BA\u64D4\u66C7\u6DE1\u6E5B\u6F6D\u6FB9\u75F0\u8043\u81BD\u8541\u8983\u8AC7\u8B5A\u931F\u6C93\u7553\u7B54\u8E0F\u905D\u5510\u5802\u5858\u5E62\u6207\u649E\u68E0\u7576\u7CD6\u87B3\u9EE8\u4EE3\u5788\u576E\u5927\u5C0D\u5CB1\u5E36\u5F85\u6234\u64E1\u73B3\u81FA\u888B\u8CB8\u968A\u9EDB\u5B85\u5FB7\u60B3\u5012\u5200\u5230\u5716\u5835\u5857\u5C0E\u5C60\u5CF6\u5D8B\u5EA6\u5F92\u60BC\u6311\u6389\u6417\u6843"],
      ["d4a1", "\u68F9\u6AC2\u6DD8\u6E21\u6ED4\u6FE4\u71FE\u76DC\u7779\u79B1\u7A3B\u8404\u89A9\u8CED\u8DF3\u8E48\u9003\u9014\u9053\u90FD\u934D\u9676\u97DC\u6BD2\u7006\u7258\u72A2\u7368\u7763\u79BF\u7BE4\u7E9B\u8B80\u58A9\u60C7\u6566\u65FD\u66BE\u6C8C\u711E\u71C9\u8C5A\u9813\u4E6D\u7A81\u4EDD\u51AC\u51CD\u52D5\u540C\u61A7\u6771\u6850\u68DF\u6D1E\u6F7C\u75BC\u77B3\u7AE5\u80F4\u8463\u9285\u515C\u6597\u675C\u6793\u75D8\u7AC7\u8373\uF95A\u8C46\u9017\u982D\u5C6F\u81C0\u829A\u9041\u906F\u920D\u5F97\u5D9D\u6A59\u71C8\u767B\u7B49\u85E4\u8B04\u9127\u9A30\u5587\u61F6\uF95B\u7669\u7F85"],
      ["d5a1", "\u863F\u87BA\u88F8\u908F\uF95C\u6D1B\u70D9\u73DE\u7D61\u843D\uF95D\u916A\u99F1\uF95E\u4E82\u5375\u6B04\u6B12\u703E\u721B\u862D\u9E1E\u524C\u8FA3\u5D50\u64E5\u652C\u6B16\u6FEB\u7C43\u7E9C\u85CD\u8964\u89BD\u62C9\u81D8\u881F\u5ECA\u6717\u6D6A\u72FC\u7405\u746F\u8782\u90DE\u4F86\u5D0D\u5FA0\u840A\u51B7\u63A0\u7565\u4EAE\u5006\u5169\u51C9\u6881\u6A11\u7CAE\u7CB1\u7CE7\u826F\u8AD2\u8F1B\u91CF\u4FB6\u5137\u52F5\u5442\u5EEC\u616E\u623E\u65C5\u6ADA\u6FFE\u792A\u85DC\u8823\u95AD\u9A62\u9A6A\u9E97\u9ECE\u529B\u66C6\u6B77\u701D\u792B\u8F62\u9742\u6190\u6200\u6523\u6F23"],
      ["d6a1", "\u7149\u7489\u7DF4\u806F\u84EE\u8F26\u9023\u934A\u51BD\u5217\u52A3\u6D0C\u70C8\u88C2\u5EC9\u6582\u6BAE\u6FC2\u7C3E\u7375\u4EE4\u4F36\u56F9\uF95F\u5CBA\u5DBA\u601C\u73B2\u7B2D\u7F9A\u7FCE\u8046\u901E\u9234\u96F6\u9748\u9818\u9F61\u4F8B\u6FA7\u79AE\u91B4\u96B7\u52DE\uF960\u6488\u64C4\u6AD3\u6F5E\u7018\u7210\u76E7\u8001\u8606\u865C\u8DEF\u8F05\u9732\u9B6F\u9DFA\u9E75\u788C\u797F\u7DA0\u83C9\u9304\u9E7F\u9E93\u8AD6\u58DF\u5F04\u6727\u7027\u74CF\u7C60\u807E\u5121\u7028\u7262\u78CA\u8CC2\u8CDA\u8CF4\u96F7\u4E86\u50DA\u5BEE\u5ED6\u6599\u71CE\u7642\u77AD\u804A\u84FC"],
      ["d7a1", "\u907C\u9B27\u9F8D\u58D8\u5A41\u5C62\u6A13\u6DDA\u6F0F\u763B\u7D2F\u7E37\u851E\u8938\u93E4\u964B\u5289\u65D2\u67F3\u69B4\u6D41\u6E9C\u700F\u7409\u7460\u7559\u7624\u786B\u8B2C\u985E\u516D\u622E\u9678\u4F96\u502B\u5D19\u6DEA\u7DB8\u8F2A\u5F8B\u6144\u6817\uF961\u9686\u52D2\u808B\u51DC\u51CC\u695E\u7A1C\u7DBE\u83F1\u9675\u4FDA\u5229\u5398\u540F\u550E\u5C65\u60A7\u674E\u68A8\u6D6C\u7281\u72F8\u7406\u7483\uF962\u75E2\u7C6C\u7F79\u7FB8\u8389\u88CF\u88E1\u91CC\u91D0\u96E2\u9BC9\u541D\u6F7E\u71D0\u7498\u85FA\u8EAA\u96A3\u9C57\u9E9F\u6797\u6DCB\u7433\u81E8\u9716\u782C"],
      ["d8a1", "\u7ACB\u7B20\u7C92\u6469\u746A\u75F2\u78BC\u78E8\u99AC\u9B54\u9EBB\u5BDE\u5E55\u6F20\u819C\u83AB\u9088\u4E07\u534D\u5A29\u5DD2\u5F4E\u6162\u633D\u6669\u66FC\u6EFF\u6F2B\u7063\u779E\u842C\u8513\u883B\u8F13\u9945\u9C3B\u551C\u62B9\u672B\u6CAB\u8309\u896A\u977A\u4EA1\u5984\u5FD8\u5FD9\u671B\u7DB2\u7F54\u8292\u832B\u83BD\u8F1E\u9099\u57CB\u59B9\u5A92\u5BD0\u6627\u679A\u6885\u6BCF\u7164\u7F75\u8CB7\u8CE3\u9081\u9B45\u8108\u8C8A\u964C\u9A40\u9EA5\u5B5F\u6C13\u731B\u76F2\u76DF\u840C\u51AA\u8993\u514D\u5195\u52C9\u68C9\u6C94\u7704\u7720\u7DBF\u7DEC\u9762\u9EB5\u6EC5"],
      ["d9a1", "\u8511\u51A5\u540D\u547D\u660E\u669D\u6927\u6E9F\u76BF\u7791\u8317\u84C2\u879F\u9169\u9298\u9CF4\u8882\u4FAE\u5192\u52DF\u59C6\u5E3D\u6155\u6478\u6479\u66AE\u67D0\u6A21\u6BCD\u6BDB\u725F\u7261\u7441\u7738\u77DB\u8017\u82BC\u8305\u8B00\u8B28\u8C8C\u6728\u6C90\u7267\u76EE\u7766\u7A46\u9DA9\u6B7F\u6C92\u5922\u6726\u8499\u536F\u5893\u5999\u5EDF\u63CF\u6634\u6773\u6E3A\u732B\u7AD7\u82D7\u9328\u52D9\u5DEB\u61AE\u61CB\u620A\u62C7\u64AB\u65E0\u6959\u6B66\u6BCB\u7121\u73F7\u755D\u7E46\u821E\u8302\u856A\u8AA3\u8CBF\u9727\u9D61\u58A8\u9ED8\u5011\u520E\u543B\u554F\u6587"],
      ["daa1", "\u6C76\u7D0A\u7D0B\u805E\u868A\u9580\u96EF\u52FF\u6C95\u7269\u5473\u5A9A\u5C3E\u5D4B\u5F4C\u5FAE\u672A\u68B6\u6963\u6E3C\u6E44\u7709\u7C73\u7F8E\u8587\u8B0E\u8FF7\u9761\u9EF4\u5CB7\u60B6\u610D\u61AB\u654F\u65FB\u65FC\u6C11\u6CEF\u739F\u73C9\u7DE1\u9594\u5BC6\u871C\u8B10\u525D\u535A\u62CD\u640F\u64B2\u6734\u6A38\u6CCA\u73C0\u749E\u7B94\u7C95\u7E1B\u818A\u8236\u8584\u8FEB\u96F9\u99C1\u4F34\u534A\u53CD\u53DB\u62CC\u642C\u6500\u6591\u69C3\u6CEE\u6F58\u73ED\u7554\u7622\u76E4\u76FC\u78D0\u78FB\u792C\u7D46\u822C\u87E0\u8FD4\u9812\u98EF\u52C3\u62D4\u64A5\u6E24\u6F51"],
      ["dba1", "\u767C\u8DCB\u91B1\u9262\u9AEE\u9B43\u5023\u508D\u574A\u59A8\u5C28\u5E47\u5F77\u623F\u653E\u65B9\u65C1\u6609\u678B\u699C\u6EC2\u78C5\u7D21\u80AA\u8180\u822B\u82B3\u84A1\u868C\u8A2A\u8B17\u90A6\u9632\u9F90\u500D\u4FF3\uF963\u57F9\u5F98\u62DC\u6392\u676F\u6E43\u7119\u76C3\u80CC\u80DA\u88F4\u88F5\u8919\u8CE0\u8F29\u914D\u966A\u4F2F\u4F70\u5E1B\u67CF\u6822\u767D\u767E\u9B44\u5E61\u6A0A\u7169\u71D4\u756A\uF964\u7E41\u8543\u85E9\u98DC\u4F10\u7B4F\u7F70\u95A5\u51E1\u5E06\u68B5\u6C3E\u6C4E\u6CDB\u72AF\u7BC4\u8303\u6CD5\u743A\u50FB\u5288\u58C1\u64D8\u6A97\u74A7\u7656"],
      ["dca1", "\u78A7\u8617\u95E2\u9739\uF965\u535E\u5F01\u8B8A\u8FA8\u8FAF\u908A\u5225\u77A5\u9C49\u9F08\u4E19\u5002\u5175\u5C5B\u5E77\u661E\u663A\u67C4\u68C5\u70B3\u7501\u75C5\u79C9\u7ADD\u8F27\u9920\u9A08\u4FDD\u5821\u5831\u5BF6\u666E\u6B65\u6D11\u6E7A\u6F7D\u73E4\u752B\u83E9\u88DC\u8913\u8B5C\u8F14\u4F0F\u50D5\u5310\u535C\u5B93\u5FA9\u670D\u798F\u8179\u832F\u8514\u8907\u8986\u8F39\u8F3B\u99A5\u9C12\u672C\u4E76\u4FF8\u5949\u5C01\u5CEF\u5CF0\u6367\u68D2\u70FD\u71A2\u742B\u7E2B\u84EC\u8702\u9022\u92D2\u9CF3\u4E0D\u4ED8\u4FEF\u5085\u5256\u526F\u5426\u5490\u57E0\u592B\u5A66"],
      ["dda1", "\u5B5A\u5B75\u5BCC\u5E9C\uF966\u6276\u6577\u65A7\u6D6E\u6EA5\u7236\u7B26\u7C3F\u7F36\u8150\u8151\u819A\u8240\u8299\u83A9\u8A03\u8CA0\u8CE6\u8CFB\u8D74\u8DBA\u90E8\u91DC\u961C\u9644\u99D9\u9CE7\u5317\u5206\u5429\u5674\u58B3\u5954\u596E\u5FFF\u61A4\u626E\u6610\u6C7E\u711A\u76C6\u7C89\u7CDE\u7D1B\u82AC\u8CC1\u96F0\uF967\u4F5B\u5F17\u5F7F\u62C2\u5D29\u670B\u68DA\u787C\u7E43\u9D6C\u4E15\u5099\u5315\u532A\u5351\u5983\u5A62\u5E87\u60B2\u618A\u6249\u6279\u6590\u6787\u69A7\u6BD4\u6BD6\u6BD7\u6BD8\u6CB8\uF968\u7435\u75FA\u7812\u7891\u79D5\u79D8\u7C83\u7DCB\u7FE1\u80A5"],
      ["dea1", "\u813E\u81C2\u83F2\u871A\u88E8\u8AB9\u8B6C\u8CBB\u9119\u975E\u98DB\u9F3B\u56AC\u5B2A\u5F6C\u658C\u6AB3\u6BAF\u6D5C\u6FF1\u7015\u725D\u73AD\u8CA7\u8CD3\u983B\u6191\u6C37\u8058\u9A01\u4E4D\u4E8B\u4E9B\u4ED5\u4F3A\u4F3C\u4F7F\u4FDF\u50FF\u53F2\u53F8\u5506\u55E3\u56DB\u58EB\u5962\u5A11\u5BEB\u5BFA\u5C04\u5DF3\u5E2B\u5F99\u601D\u6368\u659C\u65AF\u67F6\u67FB\u68AD\u6B7B\u6C99\u6CD7\u6E23\u7009\u7345\u7802\u793E\u7940\u7960\u79C1\u7BE9\u7D17\u7D72\u8086\u820D\u838E\u84D1\u86C7\u88DF\u8A50\u8A5E\u8B1D\u8CDC\u8D66\u8FAD\u90AA\u98FC\u99DF\u9E9D\u524A\uF969\u6714\uF96A"],
      ["dfa1", "\u5098\u522A\u5C71\u6563\u6C55\u73CA\u7523\u759D\u7B97\u849C\u9178\u9730\u4E77\u6492\u6BBA\u715E\u85A9\u4E09\uF96B\u6749\u68EE\u6E17\u829F\u8518\u886B\u63F7\u6F81\u9212\u98AF\u4E0A\u50B7\u50CF\u511F\u5546\u55AA\u5617\u5B40\u5C19\u5CE0\u5E38\u5E8A\u5EA0\u5EC2\u60F3\u6851\u6A61\u6E58\u723D\u7240\u72C0\u76F8\u7965\u7BB1\u7FD4\u88F3\u89F4\u8A73\u8C61\u8CDE\u971C\u585E\u74BD\u8CFD\u55C7\uF96C\u7A61\u7D22\u8272\u7272\u751F\u7525\uF96D\u7B19\u5885\u58FB\u5DBC\u5E8F\u5EB6\u5F90\u6055\u6292\u637F\u654D\u6691\u66D9\u66F8\u6816\u68F2\u7280\u745E\u7B6E\u7D6E\u7DD6\u7F72"],
      ["e0a1", "\u80E5\u8212\u85AF\u897F\u8A93\u901D\u92E4\u9ECD\u9F20\u5915\u596D\u5E2D\u60DC\u6614\u6673\u6790\u6C50\u6DC5\u6F5F\u77F3\u78A9\u84C6\u91CB\u932B\u4ED9\u50CA\u5148\u5584\u5B0B\u5BA3\u6247\u657E\u65CB\u6E32\u717D\u7401\u7444\u7487\u74BF\u766C\u79AA\u7DDA\u7E55\u7FA8\u817A\u81B3\u8239\u861A\u87EC\u8A75\u8DE3\u9078\u9291\u9425\u994D\u9BAE\u5368\u5C51\u6954\u6CC4\u6D29\u6E2B\u820C\u859B\u893B\u8A2D\u8AAA\u96EA\u9F67\u5261\u66B9\u6BB2\u7E96\u87FE\u8D0D\u9583\u965D\u651D\u6D89\u71EE\uF96E\u57CE\u59D3\u5BAC\u6027\u60FA\u6210\u661F\u665F\u7329\u73F9\u76DB\u7701\u7B6C"],
      ["e1a1", "\u8056\u8072\u8165\u8AA0\u9192\u4E16\u52E2\u6B72\u6D17\u7A05\u7B39\u7D30\uF96F\u8CB0\u53EC\u562F\u5851\u5BB5\u5C0F\u5C11\u5DE2\u6240\u6383\u6414\u662D\u68B3\u6CBC\u6D88\u6EAF\u701F\u70A4\u71D2\u7526\u758F\u758E\u7619\u7B11\u7BE0\u7C2B\u7D20\u7D39\u852C\u856D\u8607\u8A34\u900D\u9061\u90B5\u92B7\u97F6\u9A37\u4FD7\u5C6C\u675F\u6D91\u7C9F\u7E8C\u8B16\u8D16\u901F\u5B6B\u5DFD\u640D\u84C0\u905C\u98E1\u7387\u5B8B\u609A\u677E\u6DDE\u8A1F\u8AA6\u9001\u980C\u5237\uF970\u7051\u788E\u9396\u8870\u91D7\u4FEE\u53D7\u55FD\u56DA\u5782\u58FD\u5AC2\u5B88\u5CAB\u5CC0\u5E25\u6101"],
      ["e2a1", "\u620D\u624B\u6388\u641C\u6536\u6578\u6A39\u6B8A\u6C34\u6D19\u6F31\u71E7\u72E9\u7378\u7407\u74B2\u7626\u7761\u79C0\u7A57\u7AEA\u7CB9\u7D8F\u7DAC\u7E61\u7F9E\u8129\u8331\u8490\u84DA\u85EA\u8896\u8AB0\u8B90\u8F38\u9042\u9083\u916C\u9296\u92B9\u968B\u96A7\u96A8\u96D6\u9700\u9808\u9996\u9AD3\u9B1A\u53D4\u587E\u5919\u5B70\u5BBF\u6DD1\u6F5A\u719F\u7421\u74B9\u8085\u83FD\u5DE1\u5F87\u5FAA\u6042\u65EC\u6812\u696F\u6A53\u6B89\u6D35\u6DF3\u73E3\u76FE\u77AC\u7B4D\u7D14\u8123\u821C\u8340\u84F4\u8563\u8A62\u8AC4\u9187\u931E\u9806\u99B4\u620C\u8853\u8FF0\u9265\u5D07\u5D27"],
      ["e3a1", "\u5D69\u745F\u819D\u8768\u6FD5\u62FE\u7FD2\u8936\u8972\u4E1E\u4E58\u50E7\u52DD\u5347\u627F\u6607\u7E69\u8805\u965E\u4F8D\u5319\u5636\u59CB\u5AA4\u5C38\u5C4E\u5C4D\u5E02\u5F11\u6043\u65BD\u662F\u6642\u67BE\u67F4\u731C\u77E2\u793A\u7FC5\u8494\u84CD\u8996\u8A66\u8A69\u8AE1\u8C55\u8C7A\u57F4\u5BD4\u5F0F\u606F\u62ED\u690D\u6B96\u6E5C\u7184\u7BD2\u8755\u8B58\u8EFE\u98DF\u98FE\u4F38\u4F81\u4FE1\u547B\u5A20\u5BB8\u613C\u65B0\u6668\u71FC\u7533\u795E\u7D33\u814E\u81E3\u8398\u85AA\u85CE\u8703\u8A0A\u8EAB\u8F9B\uF971\u8FC5\u5931\u5BA4\u5BE6\u6089\u5BE9\u5C0B\u5FC3\u6C81"],
      ["e4a1", "\uF972\u6DF1\u700B\u751A\u82AF\u8AF6\u4EC0\u5341\uF973\u96D9\u6C0F\u4E9E\u4FC4\u5152\u555E\u5A25\u5CE8\u6211\u7259\u82BD\u83AA\u86FE\u8859\u8A1D\u963F\u96C5\u9913\u9D09\u9D5D\u580A\u5CB3\u5DBD\u5E44\u60E1\u6115\u63E1\u6A02\u6E25\u9102\u9354\u984E\u9C10\u9F77\u5B89\u5CB8\u6309\u664F\u6848\u773C\u96C1\u978D\u9854\u9B9F\u65A1\u8B01\u8ECB\u95BC\u5535\u5CA9\u5DD6\u5EB5\u6697\u764C\u83F4\u95C7\u58D3\u62BC\u72CE\u9D28\u4EF0\u592E\u600F\u663B\u6B83\u79E7\u9D26\u5393\u54C0\u57C3\u5D16\u611B\u66D6\u6DAF\u788D\u827E\u9698\u9744\u5384\u627C\u6396\u6DB2\u7E0A\u814B\u984D"],
      ["e5a1", "\u6AFB\u7F4C\u9DAF\u9E1A\u4E5F\u503B\u51B6\u591C\u60F9\u63F6\u6930\u723A\u8036\uF974\u91CE\u5F31\uF975\uF976\u7D04\u82E5\u846F\u84BB\u85E5\u8E8D\uF977\u4F6F\uF978\uF979\u58E4\u5B43\u6059\u63DA\u6518\u656D\u6698\uF97A\u694A\u6A23\u6D0B\u7001\u716C\u75D2\u760D\u79B3\u7A70\uF97B\u7F8A\uF97C\u8944\uF97D\u8B93\u91C0\u967D\uF97E\u990A\u5704\u5FA1\u65BC\u6F01\u7600\u79A6\u8A9E\u99AD\u9B5A\u9F6C\u5104\u61B6\u6291\u6A8D\u81C6\u5043\u5830\u5F66\u7109\u8A00\u8AFA\u5B7C\u8616\u4FFA\u513C\u56B4\u5944\u63A9\u6DF9\u5DAA\u696D\u5186\u4E88\u4F59\uF97F\uF980\uF981\u5982\uF982"],
      ["e6a1", "\uF983\u6B5F\u6C5D\uF984\u74B5\u7916\uF985\u8207\u8245\u8339\u8F3F\u8F5D\uF986\u9918\uF987\uF988\uF989\u4EA6\uF98A\u57DF\u5F79\u6613\uF98B\uF98C\u75AB\u7E79\u8B6F\uF98D\u9006\u9A5B\u56A5\u5827\u59F8\u5A1F\u5BB4\uF98E\u5EF6\uF98F\uF990\u6350\u633B\uF991\u693D\u6C87\u6CBF\u6D8E\u6D93\u6DF5\u6F14\uF992\u70DF\u7136\u7159\uF993\u71C3\u71D5\uF994\u784F\u786F\uF995\u7B75\u7DE3\uF996\u7E2F\uF997\u884D\u8EDF\uF998\uF999\uF99A\u925B\uF99B\u9CF6\uF99C\uF99D\uF99E\u6085\u6D85\uF99F\u71B1\uF9A0\uF9A1\u95B1\u53AD\uF9A2\uF9A3\uF9A4\u67D3\uF9A5\u708E\u7130\u7430\u8276\u82D2"],
      ["e7a1", "\uF9A6\u95BB\u9AE5\u9E7D\u66C4\uF9A7\u71C1\u8449\uF9A8\uF9A9\u584B\uF9AA\uF9AB\u5DB8\u5F71\uF9AC\u6620\u668E\u6979\u69AE\u6C38\u6CF3\u6E36\u6F41\u6FDA\u701B\u702F\u7150\u71DF\u7370\uF9AD\u745B\uF9AE\u74D4\u76C8\u7A4E\u7E93\uF9AF\uF9B0\u82F1\u8A60\u8FCE\uF9B1\u9348\uF9B2\u9719\uF9B3\uF9B4\u4E42\u502A\uF9B5\u5208\u53E1\u66F3\u6C6D\u6FCA\u730A\u777F\u7A62\u82AE\u85DD\u8602\uF9B6\u88D4\u8A63\u8B7D\u8C6B\uF9B7\u92B3\uF9B8\u9713\u9810\u4E94\u4F0D\u4FC9\u50B2\u5348\u543E\u5433\u55DA\u5862\u58BA\u5967\u5A1B\u5BE4\u609F\uF9B9\u61CA\u6556\u65FF\u6664\u68A7\u6C5A\u6FB3"],
      ["e8a1", "\u70CF\u71AC\u7352\u7B7D\u8708\u8AA4\u9C32\u9F07\u5C4B\u6C83\u7344\u7389\u923A\u6EAB\u7465\u761F\u7A69\u7E15\u860A\u5140\u58C5\u64C1\u74EE\u7515\u7670\u7FC1\u9095\u96CD\u9954\u6E26\u74E6\u7AA9\u7AAA\u81E5\u86D9\u8778\u8A1B\u5A49\u5B8C\u5B9B\u68A1\u6900\u6D63\u73A9\u7413\u742C\u7897\u7DE9\u7FEB\u8118\u8155\u839E\u8C4C\u962E\u9811\u66F0\u5F80\u65FA\u6789\u6C6A\u738B\u502D\u5A03\u6B6A\u77EE\u5916\u5D6C\u5DCD\u7325\u754F\uF9BA\uF9BB\u50E5\u51F9\u582F\u592D\u5996\u59DA\u5BE5\uF9BC\uF9BD\u5DA2\u62D7\u6416\u6493\u64FE\uF9BE\u66DC\uF9BF\u6A48\uF9C0\u71FF\u7464\uF9C1"],
      ["e9a1", "\u7A88\u7AAF\u7E47\u7E5E\u8000\u8170\uF9C2\u87EF\u8981\u8B20\u9059\uF9C3\u9080\u9952\u617E\u6B32\u6D74\u7E1F\u8925\u8FB1\u4FD1\u50AD\u5197\u52C7\u57C7\u5889\u5BB9\u5EB8\u6142\u6995\u6D8C\u6E67\u6EB6\u7194\u7462\u7528\u752C\u8073\u8338\u84C9\u8E0A\u9394\u93DE\uF9C4\u4E8E\u4F51\u5076\u512A\u53C8\u53CB\u53F3\u5B87\u5BD3\u5C24\u611A\u6182\u65F4\u725B\u7397\u7440\u76C2\u7950\u7991\u79B9\u7D06\u7FBD\u828B\u85D5\u865E\u8FC2\u9047\u90F5\u91EA\u9685\u96E8\u96E9\u52D6\u5F67\u65ED\u6631\u682F\u715C\u7A36\u90C1\u980A\u4E91\uF9C5\u6A52\u6B9E\u6F90\u7189\u8018\u82B8\u8553"],
      ["eaa1", "\u904B\u9695\u96F2\u97FB\u851A\u9B31\u4E90\u718A\u96C4\u5143\u539F\u54E1\u5713\u5712\u57A3\u5A9B\u5AC4\u5BC3\u6028\u613F\u63F4\u6C85\u6D39\u6E72\u6E90\u7230\u733F\u7457\u82D1\u8881\u8F45\u9060\uF9C6\u9662\u9858\u9D1B\u6708\u8D8A\u925E\u4F4D\u5049\u50DE\u5371\u570D\u59D4\u5A01\u5C09\u6170\u6690\u6E2D\u7232\u744B\u7DEF\u80C3\u840E\u8466\u853F\u875F\u885B\u8918\u8B02\u9055\u97CB\u9B4F\u4E73\u4F91\u5112\u516A\uF9C7\u552F\u55A9\u5B7A\u5BA5\u5E7C\u5E7D\u5EBE\u60A0\u60DF\u6108\u6109\u63C4\u6538\u6709\uF9C8\u67D4\u67DA\uF9C9\u6961\u6962\u6CB9\u6D27\uF9CA\u6E38\uF9CB"],
      ["eba1", "\u6FE1\u7336\u7337\uF9CC\u745C\u7531\uF9CD\u7652\uF9CE\uF9CF\u7DAD\u81FE\u8438\u88D5\u8A98\u8ADB\u8AED\u8E30\u8E42\u904A\u903E\u907A\u9149\u91C9\u936E\uF9D0\uF9D1\u5809\uF9D2\u6BD3\u8089\u80B2\uF9D3\uF9D4\u5141\u596B\u5C39\uF9D5\uF9D6\u6F64\u73A7\u80E4\u8D07\uF9D7\u9217\u958F\uF9D8\uF9D9\uF9DA\uF9DB\u807F\u620E\u701C\u7D68\u878D\uF9DC\u57A0\u6069\u6147\u6BB7\u8ABE\u9280\u96B1\u4E59\u541F\u6DEB\u852D\u9670\u97F3\u98EE\u63D6\u6CE3\u9091\u51DD\u61C9\u81BA\u9DF9\u4F9D\u501A\u5100\u5B9C\u610F\u61FF\u64EC\u6905\u6BC5\u7591\u77E3\u7FA9\u8264\u858F\u87FB\u8863\u8ABC"],
      ["eca1", "\u8B70\u91AB\u4E8C\u4EE5\u4F0A\uF9DD\uF9DE\u5937\u59E8\uF9DF\u5DF2\u5F1B\u5F5B\u6021\uF9E0\uF9E1\uF9E2\uF9E3\u723E\u73E5\uF9E4\u7570\u75CD\uF9E5\u79FB\uF9E6\u800C\u8033\u8084\u82E1\u8351\uF9E7\uF9E8\u8CBD\u8CB3\u9087\uF9E9\uF9EA\u98F4\u990C\uF9EB\uF9EC\u7037\u76CA\u7FCA\u7FCC\u7FFC\u8B1A\u4EBA\u4EC1\u5203\u5370\uF9ED\u54BD\u56E0\u59FB\u5BC5\u5F15\u5FCD\u6E6E\uF9EE\uF9EF\u7D6A\u8335\uF9F0\u8693\u8A8D\uF9F1\u976D\u9777\uF9F2\uF9F3\u4E00\u4F5A\u4F7E\u58F9\u65E5\u6EA2\u9038\u93B0\u99B9\u4EFB\u58EC\u598A\u59D9\u6041\uF9F4\uF9F5\u7A14\uF9F6\u834F\u8CC3\u5165\u5344"],
      ["eda1", "\uF9F7\uF9F8\uF9F9\u4ECD\u5269\u5B55\u82BF\u4ED4\u523A\u54A8\u59C9\u59FF\u5B50\u5B57\u5B5C\u6063\u6148\u6ECB\u7099\u716E\u7386\u74F7\u75B5\u78C1\u7D2B\u8005\u81EA\u8328\u8517\u85C9\u8AEE\u8CC7\u96CC\u4F5C\u52FA\u56BC\u65AB\u6628\u707C\u70B8\u7235\u7DBD\u828D\u914C\u96C0\u9D72\u5B71\u68E7\u6B98\u6F7A\u76DE\u5C91\u66AB\u6F5B\u7BB4\u7C2A\u8836\u96DC\u4E08\u4ED7\u5320\u5834\u58BB\u58EF\u596C\u5C07\u5E33\u5E84\u5F35\u638C\u66B2\u6756\u6A1F\u6AA3\u6B0C\u6F3F\u7246\uF9FA\u7350\u748B\u7AE0\u7CA7\u8178\u81DF\u81E7\u838A\u846C\u8523\u8594\u85CF\u88DD\u8D13\u91AC\u9577"],
      ["eea1", "\u969C\u518D\u54C9\u5728\u5BB0\u624D\u6750\u683D\u6893\u6E3D\u6ED3\u707D\u7E21\u88C1\u8CA1\u8F09\u9F4B\u9F4E\u722D\u7B8F\u8ACD\u931A\u4F47\u4F4E\u5132\u5480\u59D0\u5E95\u62B5\u6775\u696E\u6A17\u6CAE\u6E1A\u72D9\u732A\u75BD\u7BB8\u7D35\u82E7\u83F9\u8457\u85F7\u8A5B\u8CAF\u8E87\u9019\u90B8\u96CE\u9F5F\u52E3\u540A\u5AE1\u5BC2\u6458\u6575\u6EF4\u72C4\uF9FB\u7684\u7A4D\u7B1B\u7C4D\u7E3E\u7FDF\u837B\u8B2B\u8CCA\u8D64\u8DE1\u8E5F\u8FEA\u8FF9\u9069\u93D1\u4F43\u4F7A\u50B3\u5168\u5178\u524D\u526A\u5861\u587C\u5960\u5C08\u5C55\u5EDB\u609B\u6230\u6813\u6BBF\u6C08\u6FB1"],
      ["efa1", "\u714E\u7420\u7530\u7538\u7551\u7672\u7B4C\u7B8B\u7BAD\u7BC6\u7E8F\u8A6E\u8F3E\u8F49\u923F\u9293\u9322\u942B\u96FB\u985A\u986B\u991E\u5207\u622A\u6298\u6D59\u7664\u7ACA\u7BC0\u7D76\u5360\u5CBE\u5E97\u6F38\u70B9\u7C98\u9711\u9B8E\u9EDE\u63A5\u647A\u8776\u4E01\u4E95\u4EAD\u505C\u5075\u5448\u59C3\u5B9A\u5E40\u5EAD\u5EF7\u5F81\u60C5\u633A\u653F\u6574\u65CC\u6676\u6678\u67FE\u6968\u6A89\u6B63\u6C40\u6DC0\u6DE8\u6E1F\u6E5E\u701E\u70A1\u738E\u73FD\u753A\u775B\u7887\u798E\u7A0B\u7A7D\u7CBE\u7D8E\u8247\u8A02\u8AEA\u8C9E\u912D\u914A\u91D8\u9266\u92CC\u9320\u9706\u9756"],
      ["f0a1", "\u975C\u9802\u9F0E\u5236\u5291\u557C\u5824\u5E1D\u5F1F\u608C\u63D0\u68AF\u6FDF\u796D\u7B2C\u81CD\u85BA\u88FD\u8AF8\u8E44\u918D\u9664\u969B\u973D\u984C\u9F4A\u4FCE\u5146\u51CB\u52A9\u5632\u5F14\u5F6B\u63AA\u64CD\u65E9\u6641\u66FA\u66F9\u671D\u689D\u68D7\u69FD\u6F15\u6F6E\u7167\u71E5\u722A\u74AA\u773A\u7956\u795A\u79DF\u7A20\u7A95\u7C97\u7CDF\u7D44\u7E70\u8087\u85FB\u86A4\u8A54\u8ABF\u8D99\u8E81\u9020\u906D\u91E3\u963B\u96D5\u9CE5\u65CF\u7C07\u8DB3\u93C3\u5B58\u5C0A\u5352\u62D9\u731D\u5027\u5B97\u5F9E\u60B0\u616B\u68D5\u6DD9\u742E\u7A2E\u7D42\u7D9C\u7E31\u816B"],
      ["f1a1", "\u8E2A\u8E35\u937E\u9418\u4F50\u5750\u5DE6\u5EA7\u632B\u7F6A\u4E3B\u4F4F\u4F8F\u505A\u59DD\u80C4\u546A\u5468\u55FE\u594F\u5B99\u5DDE\u5EDA\u665D\u6731\u67F1\u682A\u6CE8\u6D32\u6E4A\u6F8D\u70B7\u73E0\u7587\u7C4C\u7D02\u7D2C\u7DA2\u821F\u86DB\u8A3B\u8A85\u8D70\u8E8A\u8F33\u9031\u914E\u9152\u9444\u99D0\u7AF9\u7CA5\u4FCA\u5101\u51C6\u57C8\u5BEF\u5CFB\u6659\u6A3D\u6D5A\u6E96\u6FEC\u710C\u756F\u7AE3\u8822\u9021\u9075\u96CB\u99FF\u8301\u4E2D\u4EF2\u8846\u91CD\u537D\u6ADB\u696B\u6C41\u847A\u589E\u618E\u66FE\u62EF\u70DD\u7511\u75C7\u7E52\u84B8\u8B49\u8D08\u4E4B\u53EA"],
      ["f2a1", "\u54AB\u5730\u5740\u5FD7\u6301\u6307\u646F\u652F\u65E8\u667A\u679D\u67B3\u6B62\u6C60\u6C9A\u6F2C\u77E5\u7825\u7949\u7957\u7D19\u80A2\u8102\u81F3\u829D\u82B7\u8718\u8A8C\uF9FC\u8D04\u8DBE\u9072\u76F4\u7A19\u7A37\u7E54\u8077\u5507\u55D4\u5875\u632F\u6422\u6649\u664B\u686D\u699B\u6B84\u6D25\u6EB1\u73CD\u7468\u74A1\u755B\u75B9\u76E1\u771E\u778B\u79E6\u7E09\u7E1D\u81FB\u852F\u8897\u8A3A\u8CD1\u8EEB\u8FB0\u9032\u93AD\u9663\u9673\u9707\u4F84\u53F1\u59EA\u5AC9\u5E19\u684E\u74C6\u75BE\u79E9\u7A92\u81A3\u86ED\u8CEA\u8DCC\u8FED\u659F\u6715\uF9FD\u57F7\u6F57\u7DDD\u8F2F"],
      ["f3a1", "\u93F6\u96C6\u5FB5\u61F2\u6F84\u4E14\u4F98\u501F\u53C9\u55DF\u5D6F\u5DEE\u6B21\u6B64\u78CB\u7B9A\uF9FE\u8E49\u8ECA\u906E\u6349\u643E\u7740\u7A84\u932F\u947F\u9F6A\u64B0\u6FAF\u71E6\u74A8\u74DA\u7AC4\u7C12\u7E82\u7CB2\u7E98\u8B9A\u8D0A\u947D\u9910\u994C\u5239\u5BDF\u64E6\u672D\u7D2E\u50ED\u53C3\u5879\u6158\u6159\u61FA\u65AC\u7AD9\u8B92\u8B96\u5009\u5021\u5275\u5531\u5A3C\u5EE0\u5F70\u6134\u655E\u660C\u6636\u66A2\u69CD\u6EC4\u6F32\u7316\u7621\u7A93\u8139\u8259\u83D6\u84BC\u50B5\u57F0\u5BC0\u5BE8\u5F69\u63A1\u7826\u7DB5\u83DC\u8521\u91C7\u91F5\u518A\u67F5\u7B56"],
      ["f4a1", "\u8CAC\u51C4\u59BB\u60BD\u8655\u501C\uF9FF\u5254\u5C3A\u617D\u621A\u62D3\u64F2\u65A5\u6ECC\u7620\u810A\u8E60\u965F\u96BB\u4EDF\u5343\u5598\u5929\u5DDD\u64C5\u6CC9\u6DFA\u7394\u7A7F\u821B\u85A6\u8CE4\u8E10\u9077\u91E7\u95E1\u9621\u97C6\u51F8\u54F2\u5586\u5FB9\u64A4\u6F88\u7DB4\u8F1F\u8F4D\u9435\u50C9\u5C16\u6CBE\u6DFB\u751B\u77BB\u7C3D\u7C64\u8A79\u8AC2\u581E\u59BE\u5E16\u6377\u7252\u758A\u776B\u8ADC\u8CBC\u8F12\u5EF3\u6674\u6DF8\u807D\u83C1\u8ACB\u9751\u9BD6\uFA00\u5243\u66FF\u6D95\u6EEF\u7DE0\u8AE6\u902E\u905E\u9AD4\u521D\u527F\u54E8\u6194\u6284\u62DB\u68A2"],
      ["f5a1", "\u6912\u695A\u6A35\u7092\u7126\u785D\u7901\u790E\u79D2\u7A0D\u8096\u8278\u82D5\u8349\u8549\u8C82\u8D85\u9162\u918B\u91AE\u4FC3\u56D1\u71ED\u77D7\u8700\u89F8\u5BF8\u5FD6\u6751\u90A8\u53E2\u585A\u5BF5\u60A4\u6181\u6460\u7E3D\u8070\u8525\u9283\u64AE\u50AC\u5D14\u6700\u589C\u62BD\u63A8\u690E\u6978\u6A1E\u6E6B\u76BA\u79CB\u82BB\u8429\u8ACF\u8DA8\u8FFD\u9112\u914B\u919C\u9310\u9318\u939A\u96DB\u9A36\u9C0D\u4E11\u755C\u795D\u7AFA\u7B51\u7BC9\u7E2E\u84C4\u8E59\u8E74\u8EF8\u9010\u6625\u693F\u7443\u51FA\u672E\u9EDC\u5145\u5FE0\u6C96\u87F2\u885D\u8877\u60B4\u81B5\u8403"],
      ["f6a1", "\u8D05\u53D6\u5439\u5634\u5A36\u5C31\u708A\u7FE0\u805A\u8106\u81ED\u8DA3\u9189\u9A5F\u9DF2\u5074\u4EC4\u53A0\u60FB\u6E2C\u5C64\u4F88\u5024\u55E4\u5CD9\u5E5F\u6065\u6894\u6CBB\u6DC4\u71BE\u75D4\u75F4\u7661\u7A1A\u7A49\u7DC7\u7DFB\u7F6E\u81F4\u86A9\u8F1C\u96C9\u99B3\u9F52\u5247\u52C5\u98ED\u89AA\u4E03\u67D2\u6F06\u4FB5\u5BE2\u6795\u6C88\u6D78\u741B\u7827\u91DD\u937C\u87C4\u79E4\u7A31\u5FEB\u4ED6\u54A4\u553E\u58AE\u59A5\u60F0\u6253\u62D6\u6736\u6955\u8235\u9640\u99B1\u99DD\u502C\u5353\u5544\u577C\uFA01\u6258\uFA02\u64E2\u666B\u67DD\u6FC1\u6FEF\u7422\u7438\u8A17"],
      ["f7a1", "\u9438\u5451\u5606\u5766\u5F48\u619A\u6B4E\u7058\u70AD\u7DBB\u8A95\u596A\u812B\u63A2\u7708\u803D\u8CAA\u5854\u642D\u69BB\u5B95\u5E11\u6E6F\uFA03\u8569\u514C\u53F0\u592A\u6020\u614B\u6B86\u6C70\u6CF0\u7B1E\u80CE\u82D4\u8DC6\u90B0\u98B1\uFA04\u64C7\u6FA4\u6491\u6504\u514E\u5410\u571F\u8A0E\u615F\u6876\uFA05\u75DB\u7B52\u7D71\u901A\u5806\u69CC\u817F\u892A\u9000\u9839\u5078\u5957\u59AC\u6295\u900F\u9B2A\u615D\u7279\u95D6\u5761\u5A46\u5DF4\u628A\u64AD\u64FA\u6777\u6CE2\u6D3E\u722C\u7436\u7834\u7F77\u82AD\u8DDB\u9817\u5224\u5742\u677F\u7248\u74E3\u8CA9\u8FA6\u9211"],
      ["f8a1", "\u962A\u516B\u53ED\u634C\u4F69\u5504\u6096\u6557\u6C9B\u6D7F\u724C\u72FD\u7A17\u8987\u8C9D\u5F6D\u6F8E\u70F9\u81A8\u610E\u4FBF\u504F\u6241\u7247\u7BC7\u7DE8\u7FE9\u904D\u97AD\u9A19\u8CB6\u576A\u5E73\u67B0\u840D\u8A55\u5420\u5B16\u5E63\u5EE2\u5F0A\u6583\u80BA\u853D\u9589\u965B\u4F48\u5305\u530D\u530F\u5486\u54FA\u5703\u5E03\u6016\u629B\u62B1\u6355\uFA06\u6CE1\u6D66\u75B1\u7832\u80DE\u812F\u82DE\u8461\u84B2\u888D\u8912\u900B\u92EA\u98FD\u9B91\u5E45\u66B4\u66DD\u7011\u7206\uFA07\u4FF5\u527D\u5F6A\u6153\u6753\u6A19\u6F02\u74E2\u7968\u8868\u8C79\u98C7\u98C4\u9A43"],
      ["f9a1", "\u54C1\u7A1F\u6953\u8AF7\u8C4A\u98A8\u99AE\u5F7C\u62AB\u75B2\u76AE\u88AB\u907F\u9642\u5339\u5F3C\u5FC5\u6CCC\u73CC\u7562\u758B\u7B46\u82FE\u999D\u4E4F\u903C\u4E0B\u4F55\u53A6\u590F\u5EC8\u6630\u6CB3\u7455\u8377\u8766\u8CC0\u9050\u971E\u9C15\u58D1\u5B78\u8650\u8B14\u9DB4\u5BD2\u6068\u608D\u65F1\u6C57\u6F22\u6FA3\u701A\u7F55\u7FF0\u9591\u9592\u9650\u97D3\u5272\u8F44\u51FD\u542B\u54B8\u5563\u558A\u6ABB\u6DB5\u7DD8\u8266\u929C\u9677\u9E79\u5408\u54C8\u76D2\u86E4\u95A4\u95D4\u965C\u4EA2\u4F09\u59EE\u5AE6\u5DF7\u6052\u6297\u676D\u6841\u6C86\u6E2F\u7F38\u809B\u822A"],
      ["faa1", "\uFA08\uFA09\u9805\u4EA5\u5055\u54B3\u5793\u595A\u5B69\u5BB3\u61C8\u6977\u6D77\u7023\u87F9\u89E3\u8A72\u8AE7\u9082\u99ED\u9AB8\u52BE\u6838\u5016\u5E78\u674F\u8347\u884C\u4EAB\u5411\u56AE\u73E6\u9115\u97FF\u9909\u9957\u9999\u5653\u589F\u865B\u8A31\u61B2\u6AF6\u737B\u8ED2\u6B47\u96AA\u9A57\u5955\u7200\u8D6B\u9769\u4FD4\u5CF4\u5F26\u61F8\u665B\u6CEB\u70AB\u7384\u73B9\u73FE\u7729\u774D\u7D43\u7D62\u7E23\u8237\u8852\uFA0A\u8CE2\u9249\u986F\u5B51\u7A74\u8840\u9801\u5ACC\u4FE0\u5354\u593E\u5CFD\u633E\u6D79\u72F9\u8105\u8107\u83A2\u92CF\u9830\u4EA8\u5144\u5211\u578B"],
      ["fba1", "\u5F62\u6CC2\u6ECE\u7005\u7050\u70AF\u7192\u73E9\u7469\u834A\u87A2\u8861\u9008\u90A2\u93A3\u99A8\u516E\u5F57\u60E0\u6167\u66B3\u8559\u8E4A\u91AF\u978B\u4E4E\u4E92\u547C\u58D5\u58FA\u597D\u5CB5\u5F27\u6236\u6248\u660A\u6667\u6BEB\u6D69\u6DCF\u6E56\u6EF8\u6F94\u6FE0\u6FE9\u705D\u72D0\u7425\u745A\u74E0\u7693\u795C\u7CCA\u7E1E\u80E1\u82A6\u846B\u84BF\u864E\u865F\u8774\u8B77\u8C6A\u93AC\u9800\u9865\u60D1\u6216\u9177\u5A5A\u660F\u6DF7\u6E3E\u743F\u9B42\u5FFD\u60DA\u7B0F\u54C4\u5F18\u6C5E\u6CD3\u6D2A\u70D8\u7D05\u8679\u8A0C\u9D3B\u5316\u548C\u5B05\u6A3A\u706B\u7575"],
      ["fca1", "\u798D\u79BE\u82B1\u83EF\u8A71\u8B41\u8CA8\u9774\uFA0B\u64F4\u652B\u78BA\u78BB\u7A6B\u4E38\u559A\u5950\u5BA6\u5E7B\u60A3\u63DB\u6B61\u6665\u6853\u6E19\u7165\u74B0\u7D08\u9084\u9A69\u9C25\u6D3B\u6ED1\u733E\u8C41\u95CA\u51F0\u5E4C\u5FA8\u604D\u60F6\u6130\u614C\u6643\u6644\u69A5\u6CC1\u6E5F\u6EC9\u6F62\u714C\u749C\u7687\u7BC1\u7C27\u8352\u8757\u9051\u968D\u9EC3\u532F\u56DE\u5EFB\u5F8A\u6062\u6094\u61F7\u6666\u6703\u6A9C\u6DEE\u6FAE\u7070\u736A\u7E6A\u81BE\u8334\u86D4\u8AA8\u8CC4\u5283\u7372\u5B96\u6A6B\u9404\u54EE\u5686\u5B5D\u6548\u6585\u66C9\u689F\u6D8D\u6DC6"],
      ["fda1", "\u723B\u80B4\u9175\u9A4D\u4FAF\u5019\u539A\u540E\u543C\u5589\u55C5\u5E3F\u5F8C\u673D\u7166\u73DD\u9005\u52DB\u52F3\u5864\u58CE\u7104\u718F\u71FB\u85B0\u8A13\u6688\u85A8\u55A7\u6684\u714A\u8431\u5349\u5599\u6BC1\u5F59\u5FBD\u63EE\u6689\u7147\u8AF1\u8F1D\u9EBE\u4F11\u643A\u70CB\u7566\u8667\u6064\u8B4E\u9DF8\u5147\u51F6\u5308\u6D36\u80F8\u9ED1\u6615\u6B23\u7098\u75D5\u5403\u5C79\u7D07\u8A16\u6B20\u6B3D\u6B46\u5438\u6070\u6D3D\u7FD5\u8208\u50D6\u51DE\u559C\u566B\u56CD\u59EC\u5B09\u5E0C\u6199\u6198\u6231\u665E\u66E6\u7199\u71B9\u71BA\u72A7\u79A7\u7A00\u7FB2\u8A70"]
    ];
  }
});

// ../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/tables/cp950.json
var require_cp950 = __commonJS({
  "../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/tables/cp950.json"(exports, module2) {
    module2.exports = [
      ["0", "\0", 127],
      ["a140", "\u3000\uFF0C\u3001\u3002\uFF0E\u2027\uFF1B\uFF1A\uFF1F\uFF01\uFE30\u2026\u2025\uFE50\uFE51\uFE52\xB7\uFE54\uFE55\uFE56\uFE57\uFF5C\u2013\uFE31\u2014\uFE33\u2574\uFE34\uFE4F\uFF08\uFF09\uFE35\uFE36\uFF5B\uFF5D\uFE37\uFE38\u3014\u3015\uFE39\uFE3A\u3010\u3011\uFE3B\uFE3C\u300A\u300B\uFE3D\uFE3E\u3008\u3009\uFE3F\uFE40\u300C\u300D\uFE41\uFE42\u300E\u300F\uFE43\uFE44\uFE59\uFE5A"],
      ["a1a1", "\uFE5B\uFE5C\uFE5D\uFE5E\u2018\u2019\u201C\u201D\u301D\u301E\u2035\u2032\uFF03\uFF06\uFF0A\u203B\xA7\u3003\u25CB\u25CF\u25B3\u25B2\u25CE\u2606\u2605\u25C7\u25C6\u25A1\u25A0\u25BD\u25BC\u32A3\u2105\xAF\uFFE3\uFF3F\u02CD\uFE49\uFE4A\uFE4D\uFE4E\uFE4B\uFE4C\uFE5F\uFE60\uFE61\uFF0B\uFF0D\xD7\xF7\xB1\u221A\uFF1C\uFF1E\uFF1D\u2266\u2267\u2260\u221E\u2252\u2261\uFE62", 4, "\uFF5E\u2229\u222A\u22A5\u2220\u221F\u22BF\u33D2\u33D1\u222B\u222E\u2235\u2234\u2640\u2642\u2295\u2299\u2191\u2193\u2190\u2192\u2196\u2197\u2199\u2198\u2225\u2223\uFF0F"],
      ["a240", "\uFF3C\u2215\uFE68\uFF04\uFFE5\u3012\uFFE0\uFFE1\uFF05\uFF20\u2103\u2109\uFE69\uFE6A\uFE6B\u33D5\u339C\u339D\u339E\u33CE\u33A1\u338E\u338F\u33C4\xB0\u5159\u515B\u515E\u515D\u5161\u5163\u55E7\u74E9\u7CCE\u2581", 7, "\u258F\u258E\u258D\u258C\u258B\u258A\u2589\u253C\u2534\u252C\u2524\u251C\u2594\u2500\u2502\u2595\u250C\u2510\u2514\u2518\u256D"],
      ["a2a1", "\u256E\u2570\u256F\u2550\u255E\u256A\u2561\u25E2\u25E3\u25E5\u25E4\u2571\u2572\u2573\uFF10", 9, "\u2160", 9, "\u3021", 8, "\u5341\u5344\u5345\uFF21", 25, "\uFF41", 21],
      ["a340", "\uFF57\uFF58\uFF59\uFF5A\u0391", 16, "\u03A3", 6, "\u03B1", 16, "\u03C3", 6, "\u3105", 10],
      ["a3a1", "\u3110", 25, "\u02D9\u02C9\u02CA\u02C7\u02CB"],
      ["a3e1", "\u20AC"],
      ["a440", "\u4E00\u4E59\u4E01\u4E03\u4E43\u4E5D\u4E86\u4E8C\u4EBA\u513F\u5165\u516B\u51E0\u5200\u5201\u529B\u5315\u5341\u535C\u53C8\u4E09\u4E0B\u4E08\u4E0A\u4E2B\u4E38\u51E1\u4E45\u4E48\u4E5F\u4E5E\u4E8E\u4EA1\u5140\u5203\u52FA\u5343\u53C9\u53E3\u571F\u58EB\u5915\u5927\u5973\u5B50\u5B51\u5B53\u5BF8\u5C0F\u5C22\u5C38\u5C71\u5DDD\u5DE5\u5DF1\u5DF2\u5DF3\u5DFE\u5E72\u5EFE\u5F0B\u5F13\u624D"],
      ["a4a1", "\u4E11\u4E10\u4E0D\u4E2D\u4E30\u4E39\u4E4B\u5C39\u4E88\u4E91\u4E95\u4E92\u4E94\u4EA2\u4EC1\u4EC0\u4EC3\u4EC6\u4EC7\u4ECD\u4ECA\u4ECB\u4EC4\u5143\u5141\u5167\u516D\u516E\u516C\u5197\u51F6\u5206\u5207\u5208\u52FB\u52FE\u52FF\u5316\u5339\u5348\u5347\u5345\u535E\u5384\u53CB\u53CA\u53CD\u58EC\u5929\u592B\u592A\u592D\u5B54\u5C11\u5C24\u5C3A\u5C6F\u5DF4\u5E7B\u5EFF\u5F14\u5F15\u5FC3\u6208\u6236\u624B\u624E\u652F\u6587\u6597\u65A4\u65B9\u65E5\u66F0\u6708\u6728\u6B20\u6B62\u6B79\u6BCB\u6BD4\u6BDB\u6C0F\u6C34\u706B\u722A\u7236\u723B\u7247\u7259\u725B\u72AC\u738B\u4E19"],
      ["a540", "\u4E16\u4E15\u4E14\u4E18\u4E3B\u4E4D\u4E4F\u4E4E\u4EE5\u4ED8\u4ED4\u4ED5\u4ED6\u4ED7\u4EE3\u4EE4\u4ED9\u4EDE\u5145\u5144\u5189\u518A\u51AC\u51F9\u51FA\u51F8\u520A\u52A0\u529F\u5305\u5306\u5317\u531D\u4EDF\u534A\u5349\u5361\u5360\u536F\u536E\u53BB\u53EF\u53E4\u53F3\u53EC\u53EE\u53E9\u53E8\u53FC\u53F8\u53F5\u53EB\u53E6\u53EA\u53F2\u53F1\u53F0\u53E5\u53ED\u53FB\u56DB\u56DA\u5916"],
      ["a5a1", "\u592E\u5931\u5974\u5976\u5B55\u5B83\u5C3C\u5DE8\u5DE7\u5DE6\u5E02\u5E03\u5E73\u5E7C\u5F01\u5F18\u5F17\u5FC5\u620A\u6253\u6254\u6252\u6251\u65A5\u65E6\u672E\u672C\u672A\u672B\u672D\u6B63\u6BCD\u6C11\u6C10\u6C38\u6C41\u6C40\u6C3E\u72AF\u7384\u7389\u74DC\u74E6\u7518\u751F\u7528\u7529\u7530\u7531\u7532\u7533\u758B\u767D\u76AE\u76BF\u76EE\u77DB\u77E2\u77F3\u793A\u79BE\u7A74\u7ACB\u4E1E\u4E1F\u4E52\u4E53\u4E69\u4E99\u4EA4\u4EA6\u4EA5\u4EFF\u4F09\u4F19\u4F0A\u4F15\u4F0D\u4F10\u4F11\u4F0F\u4EF2\u4EF6\u4EFB\u4EF0\u4EF3\u4EFD\u4F01\u4F0B\u5149\u5147\u5146\u5148\u5168"],
      ["a640", "\u5171\u518D\u51B0\u5217\u5211\u5212\u520E\u5216\u52A3\u5308\u5321\u5320\u5370\u5371\u5409\u540F\u540C\u540A\u5410\u5401\u540B\u5404\u5411\u540D\u5408\u5403\u540E\u5406\u5412\u56E0\u56DE\u56DD\u5733\u5730\u5728\u572D\u572C\u572F\u5729\u5919\u591A\u5937\u5938\u5984\u5978\u5983\u597D\u5979\u5982\u5981\u5B57\u5B58\u5B87\u5B88\u5B85\u5B89\u5BFA\u5C16\u5C79\u5DDE\u5E06\u5E76\u5E74"],
      ["a6a1", "\u5F0F\u5F1B\u5FD9\u5FD6\u620E\u620C\u620D\u6210\u6263\u625B\u6258\u6536\u65E9\u65E8\u65EC\u65ED\u66F2\u66F3\u6709\u673D\u6734\u6731\u6735\u6B21\u6B64\u6B7B\u6C16\u6C5D\u6C57\u6C59\u6C5F\u6C60\u6C50\u6C55\u6C61\u6C5B\u6C4D\u6C4E\u7070\u725F\u725D\u767E\u7AF9\u7C73\u7CF8\u7F36\u7F8A\u7FBD\u8001\u8003\u800C\u8012\u8033\u807F\u8089\u808B\u808C\u81E3\u81EA\u81F3\u81FC\u820C\u821B\u821F\u826E\u8272\u827E\u866B\u8840\u884C\u8863\u897F\u9621\u4E32\u4EA8\u4F4D\u4F4F\u4F47\u4F57\u4F5E\u4F34\u4F5B\u4F55\u4F30\u4F50\u4F51\u4F3D\u4F3A\u4F38\u4F43\u4F54\u4F3C\u4F46\u4F63"],
      ["a740", "\u4F5C\u4F60\u4F2F\u4F4E\u4F36\u4F59\u4F5D\u4F48\u4F5A\u514C\u514B\u514D\u5175\u51B6\u51B7\u5225\u5224\u5229\u522A\u5228\u52AB\u52A9\u52AA\u52AC\u5323\u5373\u5375\u541D\u542D\u541E\u543E\u5426\u544E\u5427\u5446\u5443\u5433\u5448\u5442\u541B\u5429\u544A\u5439\u543B\u5438\u542E\u5435\u5436\u5420\u543C\u5440\u5431\u542B\u541F\u542C\u56EA\u56F0\u56E4\u56EB\u574A\u5751\u5740\u574D"],
      ["a7a1", "\u5747\u574E\u573E\u5750\u574F\u573B\u58EF\u593E\u599D\u5992\u59A8\u599E\u59A3\u5999\u5996\u598D\u59A4\u5993\u598A\u59A5\u5B5D\u5B5C\u5B5A\u5B5B\u5B8C\u5B8B\u5B8F\u5C2C\u5C40\u5C41\u5C3F\u5C3E\u5C90\u5C91\u5C94\u5C8C\u5DEB\u5E0C\u5E8F\u5E87\u5E8A\u5EF7\u5F04\u5F1F\u5F64\u5F62\u5F77\u5F79\u5FD8\u5FCC\u5FD7\u5FCD\u5FF1\u5FEB\u5FF8\u5FEA\u6212\u6211\u6284\u6297\u6296\u6280\u6276\u6289\u626D\u628A\u627C\u627E\u6279\u6273\u6292\u626F\u6298\u626E\u6295\u6293\u6291\u6286\u6539\u653B\u6538\u65F1\u66F4\u675F\u674E\u674F\u6750\u6751\u675C\u6756\u675E\u6749\u6746\u6760"],
      ["a840", "\u6753\u6757\u6B65\u6BCF\u6C42\u6C5E\u6C99\u6C81\u6C88\u6C89\u6C85\u6C9B\u6C6A\u6C7A\u6C90\u6C70\u6C8C\u6C68\u6C96\u6C92\u6C7D\u6C83\u6C72\u6C7E\u6C74\u6C86\u6C76\u6C8D\u6C94\u6C98\u6C82\u7076\u707C\u707D\u7078\u7262\u7261\u7260\u72C4\u72C2\u7396\u752C\u752B\u7537\u7538\u7682\u76EF\u77E3\u79C1\u79C0\u79BF\u7A76\u7CFB\u7F55\u8096\u8093\u809D\u8098\u809B\u809A\u80B2\u826F\u8292"],
      ["a8a1", "\u828B\u828D\u898B\u89D2\u8A00\u8C37\u8C46\u8C55\u8C9D\u8D64\u8D70\u8DB3\u8EAB\u8ECA\u8F9B\u8FB0\u8FC2\u8FC6\u8FC5\u8FC4\u5DE1\u9091\u90A2\u90AA\u90A6\u90A3\u9149\u91C6\u91CC\u9632\u962E\u9631\u962A\u962C\u4E26\u4E56\u4E73\u4E8B\u4E9B\u4E9E\u4EAB\u4EAC\u4F6F\u4F9D\u4F8D\u4F73\u4F7F\u4F6C\u4F9B\u4F8B\u4F86\u4F83\u4F70\u4F75\u4F88\u4F69\u4F7B\u4F96\u4F7E\u4F8F\u4F91\u4F7A\u5154\u5152\u5155\u5169\u5177\u5176\u5178\u51BD\u51FD\u523B\u5238\u5237\u523A\u5230\u522E\u5236\u5241\u52BE\u52BB\u5352\u5354\u5353\u5351\u5366\u5377\u5378\u5379\u53D6\u53D4\u53D7\u5473\u5475"],
      ["a940", "\u5496\u5478\u5495\u5480\u547B\u5477\u5484\u5492\u5486\u547C\u5490\u5471\u5476\u548C\u549A\u5462\u5468\u548B\u547D\u548E\u56FA\u5783\u5777\u576A\u5769\u5761\u5766\u5764\u577C\u591C\u5949\u5947\u5948\u5944\u5954\u59BE\u59BB\u59D4\u59B9\u59AE\u59D1\u59C6\u59D0\u59CD\u59CB\u59D3\u59CA\u59AF\u59B3\u59D2\u59C5\u5B5F\u5B64\u5B63\u5B97\u5B9A\u5B98\u5B9C\u5B99\u5B9B\u5C1A\u5C48\u5C45"],
      ["a9a1", "\u5C46\u5CB7\u5CA1\u5CB8\u5CA9\u5CAB\u5CB1\u5CB3\u5E18\u5E1A\u5E16\u5E15\u5E1B\u5E11\u5E78\u5E9A\u5E97\u5E9C\u5E95\u5E96\u5EF6\u5F26\u5F27\u5F29\u5F80\u5F81\u5F7F\u5F7C\u5FDD\u5FE0\u5FFD\u5FF5\u5FFF\u600F\u6014\u602F\u6035\u6016\u602A\u6015\u6021\u6027\u6029\u602B\u601B\u6216\u6215\u623F\u623E\u6240\u627F\u62C9\u62CC\u62C4\u62BF\u62C2\u62B9\u62D2\u62DB\u62AB\u62D3\u62D4\u62CB\u62C8\u62A8\u62BD\u62BC\u62D0\u62D9\u62C7\u62CD\u62B5\u62DA\u62B1\u62D8\u62D6\u62D7\u62C6\u62AC\u62CE\u653E\u65A7\u65BC\u65FA\u6614\u6613\u660C\u6606\u6602\u660E\u6600\u660F\u6615\u660A"],
      ["aa40", "\u6607\u670D\u670B\u676D\u678B\u6795\u6771\u679C\u6773\u6777\u6787\u679D\u6797\u676F\u6770\u677F\u6789\u677E\u6790\u6775\u679A\u6793\u677C\u676A\u6772\u6B23\u6B66\u6B67\u6B7F\u6C13\u6C1B\u6CE3\u6CE8\u6CF3\u6CB1\u6CCC\u6CE5\u6CB3\u6CBD\u6CBE\u6CBC\u6CE2\u6CAB\u6CD5\u6CD3\u6CB8\u6CC4\u6CB9\u6CC1\u6CAE\u6CD7\u6CC5\u6CF1\u6CBF\u6CBB\u6CE1\u6CDB\u6CCA\u6CAC\u6CEF\u6CDC\u6CD6\u6CE0"],
      ["aaa1", "\u7095\u708E\u7092\u708A\u7099\u722C\u722D\u7238\u7248\u7267\u7269\u72C0\u72CE\u72D9\u72D7\u72D0\u73A9\u73A8\u739F\u73AB\u73A5\u753D\u759D\u7599\u759A\u7684\u76C2\u76F2\u76F4\u77E5\u77FD\u793E\u7940\u7941\u79C9\u79C8\u7A7A\u7A79\u7AFA\u7CFE\u7F54\u7F8C\u7F8B\u8005\u80BA\u80A5\u80A2\u80B1\u80A1\u80AB\u80A9\u80B4\u80AA\u80AF\u81E5\u81FE\u820D\u82B3\u829D\u8299\u82AD\u82BD\u829F\u82B9\u82B1\u82AC\u82A5\u82AF\u82B8\u82A3\u82B0\u82BE\u82B7\u864E\u8671\u521D\u8868\u8ECB\u8FCE\u8FD4\u8FD1\u90B5\u90B8\u90B1\u90B6\u91C7\u91D1\u9577\u9580\u961C\u9640\u963F\u963B\u9644"],
      ["ab40", "\u9642\u96B9\u96E8\u9752\u975E\u4E9F\u4EAD\u4EAE\u4FE1\u4FB5\u4FAF\u4FBF\u4FE0\u4FD1\u4FCF\u4FDD\u4FC3\u4FB6\u4FD8\u4FDF\u4FCA\u4FD7\u4FAE\u4FD0\u4FC4\u4FC2\u4FDA\u4FCE\u4FDE\u4FB7\u5157\u5192\u5191\u51A0\u524E\u5243\u524A\u524D\u524C\u524B\u5247\u52C7\u52C9\u52C3\u52C1\u530D\u5357\u537B\u539A\u53DB\u54AC\u54C0\u54A8\u54CE\u54C9\u54B8\u54A6\u54B3\u54C7\u54C2\u54BD\u54AA\u54C1"],
      ["aba1", "\u54C4\u54C8\u54AF\u54AB\u54B1\u54BB\u54A9\u54A7\u54BF\u56FF\u5782\u578B\u57A0\u57A3\u57A2\u57CE\u57AE\u5793\u5955\u5951\u594F\u594E\u5950\u59DC\u59D8\u59FF\u59E3\u59E8\u5A03\u59E5\u59EA\u59DA\u59E6\u5A01\u59FB\u5B69\u5BA3\u5BA6\u5BA4\u5BA2\u5BA5\u5C01\u5C4E\u5C4F\u5C4D\u5C4B\u5CD9\u5CD2\u5DF7\u5E1D\u5E25\u5E1F\u5E7D\u5EA0\u5EA6\u5EFA\u5F08\u5F2D\u5F65\u5F88\u5F85\u5F8A\u5F8B\u5F87\u5F8C\u5F89\u6012\u601D\u6020\u6025\u600E\u6028\u604D\u6070\u6068\u6062\u6046\u6043\u606C\u606B\u606A\u6064\u6241\u62DC\u6316\u6309\u62FC\u62ED\u6301\u62EE\u62FD\u6307\u62F1\u62F7"],
      ["ac40", "\u62EF\u62EC\u62FE\u62F4\u6311\u6302\u653F\u6545\u65AB\u65BD\u65E2\u6625\u662D\u6620\u6627\u662F\u661F\u6628\u6631\u6624\u66F7\u67FF\u67D3\u67F1\u67D4\u67D0\u67EC\u67B6\u67AF\u67F5\u67E9\u67EF\u67C4\u67D1\u67B4\u67DA\u67E5\u67B8\u67CF\u67DE\u67F3\u67B0\u67D9\u67E2\u67DD\u67D2\u6B6A\u6B83\u6B86\u6BB5\u6BD2\u6BD7\u6C1F\u6CC9\u6D0B\u6D32\u6D2A\u6D41\u6D25\u6D0C\u6D31\u6D1E\u6D17"],
      ["aca1", "\u6D3B\u6D3D\u6D3E\u6D36\u6D1B\u6CF5\u6D39\u6D27\u6D38\u6D29\u6D2E\u6D35\u6D0E\u6D2B\u70AB\u70BA\u70B3\u70AC\u70AF\u70AD\u70B8\u70AE\u70A4\u7230\u7272\u726F\u7274\u72E9\u72E0\u72E1\u73B7\u73CA\u73BB\u73B2\u73CD\u73C0\u73B3\u751A\u752D\u754F\u754C\u754E\u754B\u75AB\u75A4\u75A5\u75A2\u75A3\u7678\u7686\u7687\u7688\u76C8\u76C6\u76C3\u76C5\u7701\u76F9\u76F8\u7709\u770B\u76FE\u76FC\u7707\u77DC\u7802\u7814\u780C\u780D\u7946\u7949\u7948\u7947\u79B9\u79BA\u79D1\u79D2\u79CB\u7A7F\u7A81\u7AFF\u7AFD\u7C7D\u7D02\u7D05\u7D00\u7D09\u7D07\u7D04\u7D06\u7F38\u7F8E\u7FBF\u8004"],
      ["ad40", "\u8010\u800D\u8011\u8036\u80D6\u80E5\u80DA\u80C3\u80C4\u80CC\u80E1\u80DB\u80CE\u80DE\u80E4\u80DD\u81F4\u8222\u82E7\u8303\u8305\u82E3\u82DB\u82E6\u8304\u82E5\u8302\u8309\u82D2\u82D7\u82F1\u8301\u82DC\u82D4\u82D1\u82DE\u82D3\u82DF\u82EF\u8306\u8650\u8679\u867B\u867A\u884D\u886B\u8981\u89D4\u8A08\u8A02\u8A03\u8C9E\u8CA0\u8D74\u8D73\u8DB4\u8ECD\u8ECC\u8FF0\u8FE6\u8FE2\u8FEA\u8FE5"],
      ["ada1", "\u8FED\u8FEB\u8FE4\u8FE8\u90CA\u90CE\u90C1\u90C3\u914B\u914A\u91CD\u9582\u9650\u964B\u964C\u964D\u9762\u9769\u97CB\u97ED\u97F3\u9801\u98A8\u98DB\u98DF\u9996\u9999\u4E58\u4EB3\u500C\u500D\u5023\u4FEF\u5026\u5025\u4FF8\u5029\u5016\u5006\u503C\u501F\u501A\u5012\u5011\u4FFA\u5000\u5014\u5028\u4FF1\u5021\u500B\u5019\u5018\u4FF3\u4FEE\u502D\u502A\u4FFE\u502B\u5009\u517C\u51A4\u51A5\u51A2\u51CD\u51CC\u51C6\u51CB\u5256\u525C\u5254\u525B\u525D\u532A\u537F\u539F\u539D\u53DF\u54E8\u5510\u5501\u5537\u54FC\u54E5\u54F2\u5506\u54FA\u5514\u54E9\u54ED\u54E1\u5509\u54EE\u54EA"],
      ["ae40", "\u54E6\u5527\u5507\u54FD\u550F\u5703\u5704\u57C2\u57D4\u57CB\u57C3\u5809\u590F\u5957\u5958\u595A\u5A11\u5A18\u5A1C\u5A1F\u5A1B\u5A13\u59EC\u5A20\u5A23\u5A29\u5A25\u5A0C\u5A09\u5B6B\u5C58\u5BB0\u5BB3\u5BB6\u5BB4\u5BAE\u5BB5\u5BB9\u5BB8\u5C04\u5C51\u5C55\u5C50\u5CED\u5CFD\u5CFB\u5CEA\u5CE8\u5CF0\u5CF6\u5D01\u5CF4\u5DEE\u5E2D\u5E2B\u5EAB\u5EAD\u5EA7\u5F31\u5F92\u5F91\u5F90\u6059"],
      ["aea1", "\u6063\u6065\u6050\u6055\u606D\u6069\u606F\u6084\u609F\u609A\u608D\u6094\u608C\u6085\u6096\u6247\u62F3\u6308\u62FF\u634E\u633E\u632F\u6355\u6342\u6346\u634F\u6349\u633A\u6350\u633D\u632A\u632B\u6328\u634D\u634C\u6548\u6549\u6599\u65C1\u65C5\u6642\u6649\u664F\u6643\u6652\u664C\u6645\u6641\u66F8\u6714\u6715\u6717\u6821\u6838\u6848\u6846\u6853\u6839\u6842\u6854\u6829\u68B3\u6817\u684C\u6851\u683D\u67F4\u6850\u6840\u683C\u6843\u682A\u6845\u6813\u6818\u6841\u6B8A\u6B89\u6BB7\u6C23\u6C27\u6C28\u6C26\u6C24\u6CF0\u6D6A\u6D95\u6D88\u6D87\u6D66\u6D78\u6D77\u6D59\u6D93"],
      ["af40", "\u6D6C\u6D89\u6D6E\u6D5A\u6D74\u6D69\u6D8C\u6D8A\u6D79\u6D85\u6D65\u6D94\u70CA\u70D8\u70E4\u70D9\u70C8\u70CF\u7239\u7279\u72FC\u72F9\u72FD\u72F8\u72F7\u7386\u73ED\u7409\u73EE\u73E0\u73EA\u73DE\u7554\u755D\u755C\u755A\u7559\u75BE\u75C5\u75C7\u75B2\u75B3\u75BD\u75BC\u75B9\u75C2\u75B8\u768B\u76B0\u76CA\u76CD\u76CE\u7729\u771F\u7720\u7728\u77E9\u7830\u7827\u7838\u781D\u7834\u7837"],
      ["afa1", "\u7825\u782D\u7820\u781F\u7832\u7955\u7950\u7960\u795F\u7956\u795E\u795D\u7957\u795A\u79E4\u79E3\u79E7\u79DF\u79E6\u79E9\u79D8\u7A84\u7A88\u7AD9\u7B06\u7B11\u7C89\u7D21\u7D17\u7D0B\u7D0A\u7D20\u7D22\u7D14\u7D10\u7D15\u7D1A\u7D1C\u7D0D\u7D19\u7D1B\u7F3A\u7F5F\u7F94\u7FC5\u7FC1\u8006\u8018\u8015\u8019\u8017\u803D\u803F\u80F1\u8102\u80F0\u8105\u80ED\u80F4\u8106\u80F8\u80F3\u8108\u80FD\u810A\u80FC\u80EF\u81ED\u81EC\u8200\u8210\u822A\u822B\u8228\u822C\u82BB\u832B\u8352\u8354\u834A\u8338\u8350\u8349\u8335\u8334\u834F\u8332\u8339\u8336\u8317\u8340\u8331\u8328\u8343"],
      ["b040", "\u8654\u868A\u86AA\u8693\u86A4\u86A9\u868C\u86A3\u869C\u8870\u8877\u8881\u8882\u887D\u8879\u8A18\u8A10\u8A0E\u8A0C\u8A15\u8A0A\u8A17\u8A13\u8A16\u8A0F\u8A11\u8C48\u8C7A\u8C79\u8CA1\u8CA2\u8D77\u8EAC\u8ED2\u8ED4\u8ECF\u8FB1\u9001\u9006\u8FF7\u9000\u8FFA\u8FF4\u9003\u8FFD\u9005\u8FF8\u9095\u90E1\u90DD\u90E2\u9152\u914D\u914C\u91D8\u91DD\u91D7\u91DC\u91D9\u9583\u9662\u9663\u9661"],
      ["b0a1", "\u965B\u965D\u9664\u9658\u965E\u96BB\u98E2\u99AC\u9AA8\u9AD8\u9B25\u9B32\u9B3C\u4E7E\u507A\u507D\u505C\u5047\u5043\u504C\u505A\u5049\u5065\u5076\u504E\u5055\u5075\u5074\u5077\u504F\u500F\u506F\u506D\u515C\u5195\u51F0\u526A\u526F\u52D2\u52D9\u52D8\u52D5\u5310\u530F\u5319\u533F\u5340\u533E\u53C3\u66FC\u5546\u556A\u5566\u5544\u555E\u5561\u5543\u554A\u5531\u5556\u554F\u5555\u552F\u5564\u5538\u552E\u555C\u552C\u5563\u5533\u5541\u5557\u5708\u570B\u5709\u57DF\u5805\u580A\u5806\u57E0\u57E4\u57FA\u5802\u5835\u57F7\u57F9\u5920\u5962\u5A36\u5A41\u5A49\u5A66\u5A6A\u5A40"],
      ["b140", "\u5A3C\u5A62\u5A5A\u5A46\u5A4A\u5B70\u5BC7\u5BC5\u5BC4\u5BC2\u5BBF\u5BC6\u5C09\u5C08\u5C07\u5C60\u5C5C\u5C5D\u5D07\u5D06\u5D0E\u5D1B\u5D16\u5D22\u5D11\u5D29\u5D14\u5D19\u5D24\u5D27\u5D17\u5DE2\u5E38\u5E36\u5E33\u5E37\u5EB7\u5EB8\u5EB6\u5EB5\u5EBE\u5F35\u5F37\u5F57\u5F6C\u5F69\u5F6B\u5F97\u5F99\u5F9E\u5F98\u5FA1\u5FA0\u5F9C\u607F\u60A3\u6089\u60A0\u60A8\u60CB\u60B4\u60E6\u60BD"],
      ["b1a1", "\u60C5\u60BB\u60B5\u60DC\u60BC\u60D8\u60D5\u60C6\u60DF\u60B8\u60DA\u60C7\u621A\u621B\u6248\u63A0\u63A7\u6372\u6396\u63A2\u63A5\u6377\u6367\u6398\u63AA\u6371\u63A9\u6389\u6383\u639B\u636B\u63A8\u6384\u6388\u6399\u63A1\u63AC\u6392\u638F\u6380\u637B\u6369\u6368\u637A\u655D\u6556\u6551\u6559\u6557\u555F\u654F\u6558\u6555\u6554\u659C\u659B\u65AC\u65CF\u65CB\u65CC\u65CE\u665D\u665A\u6664\u6668\u6666\u665E\u66F9\u52D7\u671B\u6881\u68AF\u68A2\u6893\u68B5\u687F\u6876\u68B1\u68A7\u6897\u68B0\u6883\u68C4\u68AD\u6886\u6885\u6894\u689D\u68A8\u689F\u68A1\u6882\u6B32\u6BBA"],
      ["b240", "\u6BEB\u6BEC\u6C2B\u6D8E\u6DBC\u6DF3\u6DD9\u6DB2\u6DE1\u6DCC\u6DE4\u6DFB\u6DFA\u6E05\u6DC7\u6DCB\u6DAF\u6DD1\u6DAE\u6DDE\u6DF9\u6DB8\u6DF7\u6DF5\u6DC5\u6DD2\u6E1A\u6DB5\u6DDA\u6DEB\u6DD8\u6DEA\u6DF1\u6DEE\u6DE8\u6DC6\u6DC4\u6DAA\u6DEC\u6DBF\u6DE6\u70F9\u7109\u710A\u70FD\u70EF\u723D\u727D\u7281\u731C\u731B\u7316\u7313\u7319\u7387\u7405\u740A\u7403\u7406\u73FE\u740D\u74E0\u74F6"],
      ["b2a1", "\u74F7\u751C\u7522\u7565\u7566\u7562\u7570\u758F\u75D4\u75D5\u75B5\u75CA\u75CD\u768E\u76D4\u76D2\u76DB\u7737\u773E\u773C\u7736\u7738\u773A\u786B\u7843\u784E\u7965\u7968\u796D\u79FB\u7A92\u7A95\u7B20\u7B28\u7B1B\u7B2C\u7B26\u7B19\u7B1E\u7B2E\u7C92\u7C97\u7C95\u7D46\u7D43\u7D71\u7D2E\u7D39\u7D3C\u7D40\u7D30\u7D33\u7D44\u7D2F\u7D42\u7D32\u7D31\u7F3D\u7F9E\u7F9A\u7FCC\u7FCE\u7FD2\u801C\u804A\u8046\u812F\u8116\u8123\u812B\u8129\u8130\u8124\u8202\u8235\u8237\u8236\u8239\u838E\u839E\u8398\u8378\u83A2\u8396\u83BD\u83AB\u8392\u838A\u8393\u8389\u83A0\u8377\u837B\u837C"],
      ["b340", "\u8386\u83A7\u8655\u5F6A\u86C7\u86C0\u86B6\u86C4\u86B5\u86C6\u86CB\u86B1\u86AF\u86C9\u8853\u889E\u8888\u88AB\u8892\u8896\u888D\u888B\u8993\u898F\u8A2A\u8A1D\u8A23\u8A25\u8A31\u8A2D\u8A1F\u8A1B\u8A22\u8C49\u8C5A\u8CA9\u8CAC\u8CAB\u8CA8\u8CAA\u8CA7\u8D67\u8D66\u8DBE\u8DBA\u8EDB\u8EDF\u9019\u900D\u901A\u9017\u9023\u901F\u901D\u9010\u9015\u901E\u9020\u900F\u9022\u9016\u901B\u9014"],
      ["b3a1", "\u90E8\u90ED\u90FD\u9157\u91CE\u91F5\u91E6\u91E3\u91E7\u91ED\u91E9\u9589\u966A\u9675\u9673\u9678\u9670\u9674\u9676\u9677\u966C\u96C0\u96EA\u96E9\u7AE0\u7ADF\u9802\u9803\u9B5A\u9CE5\u9E75\u9E7F\u9EA5\u9EBB\u50A2\u508D\u5085\u5099\u5091\u5080\u5096\u5098\u509A\u6700\u51F1\u5272\u5274\u5275\u5269\u52DE\u52DD\u52DB\u535A\u53A5\u557B\u5580\u55A7\u557C\u558A\u559D\u5598\u5582\u559C\u55AA\u5594\u5587\u558B\u5583\u55B3\u55AE\u559F\u553E\u55B2\u559A\u55BB\u55AC\u55B1\u557E\u5589\u55AB\u5599\u570D\u582F\u582A\u5834\u5824\u5830\u5831\u5821\u581D\u5820\u58F9\u58FA\u5960"],
      ["b440", "\u5A77\u5A9A\u5A7F\u5A92\u5A9B\u5AA7\u5B73\u5B71\u5BD2\u5BCC\u5BD3\u5BD0\u5C0A\u5C0B\u5C31\u5D4C\u5D50\u5D34\u5D47\u5DFD\u5E45\u5E3D\u5E40\u5E43\u5E7E\u5ECA\u5EC1\u5EC2\u5EC4\u5F3C\u5F6D\u5FA9\u5FAA\u5FA8\u60D1\u60E1\u60B2\u60B6\u60E0\u611C\u6123\u60FA\u6115\u60F0\u60FB\u60F4\u6168\u60F1\u610E\u60F6\u6109\u6100\u6112\u621F\u6249\u63A3\u638C\u63CF\u63C0\u63E9\u63C9\u63C6\u63CD"],
      ["b4a1", "\u63D2\u63E3\u63D0\u63E1\u63D6\u63ED\u63EE\u6376\u63F4\u63EA\u63DB\u6452\u63DA\u63F9\u655E\u6566\u6562\u6563\u6591\u6590\u65AF\u666E\u6670\u6674\u6676\u666F\u6691\u667A\u667E\u6677\u66FE\u66FF\u671F\u671D\u68FA\u68D5\u68E0\u68D8\u68D7\u6905\u68DF\u68F5\u68EE\u68E7\u68F9\u68D2\u68F2\u68E3\u68CB\u68CD\u690D\u6912\u690E\u68C9\u68DA\u696E\u68FB\u6B3E\u6B3A\u6B3D\u6B98\u6B96\u6BBC\u6BEF\u6C2E\u6C2F\u6C2C\u6E2F\u6E38\u6E54\u6E21\u6E32\u6E67\u6E4A\u6E20\u6E25\u6E23\u6E1B\u6E5B\u6E58\u6E24\u6E56\u6E6E\u6E2D\u6E26\u6E6F\u6E34\u6E4D\u6E3A\u6E2C\u6E43\u6E1D\u6E3E\u6ECB"],
      ["b540", "\u6E89\u6E19\u6E4E\u6E63\u6E44\u6E72\u6E69\u6E5F\u7119\u711A\u7126\u7130\u7121\u7136\u716E\u711C\u724C\u7284\u7280\u7336\u7325\u7334\u7329\u743A\u742A\u7433\u7422\u7425\u7435\u7436\u7434\u742F\u741B\u7426\u7428\u7525\u7526\u756B\u756A\u75E2\u75DB\u75E3\u75D9\u75D8\u75DE\u75E0\u767B\u767C\u7696\u7693\u76B4\u76DC\u774F\u77ED\u785D\u786C\u786F\u7A0D\u7A08\u7A0B\u7A05\u7A00\u7A98"],
      ["b5a1", "\u7A97\u7A96\u7AE5\u7AE3\u7B49\u7B56\u7B46\u7B50\u7B52\u7B54\u7B4D\u7B4B\u7B4F\u7B51\u7C9F\u7CA5\u7D5E\u7D50\u7D68\u7D55\u7D2B\u7D6E\u7D72\u7D61\u7D66\u7D62\u7D70\u7D73\u5584\u7FD4\u7FD5\u800B\u8052\u8085\u8155\u8154\u814B\u8151\u814E\u8139\u8146\u813E\u814C\u8153\u8174\u8212\u821C\u83E9\u8403\u83F8\u840D\u83E0\u83C5\u840B\u83C1\u83EF\u83F1\u83F4\u8457\u840A\u83F0\u840C\u83CC\u83FD\u83F2\u83CA\u8438\u840E\u8404\u83DC\u8407\u83D4\u83DF\u865B\u86DF\u86D9\u86ED\u86D4\u86DB\u86E4\u86D0\u86DE\u8857\u88C1\u88C2\u88B1\u8983\u8996\u8A3B\u8A60\u8A55\u8A5E\u8A3C\u8A41"],
      ["b640", "\u8A54\u8A5B\u8A50\u8A46\u8A34\u8A3A\u8A36\u8A56\u8C61\u8C82\u8CAF\u8CBC\u8CB3\u8CBD\u8CC1\u8CBB\u8CC0\u8CB4\u8CB7\u8CB6\u8CBF\u8CB8\u8D8A\u8D85\u8D81\u8DCE\u8DDD\u8DCB\u8DDA\u8DD1\u8DCC\u8DDB\u8DC6\u8EFB\u8EF8\u8EFC\u8F9C\u902E\u9035\u9031\u9038\u9032\u9036\u9102\u90F5\u9109\u90FE\u9163\u9165\u91CF\u9214\u9215\u9223\u9209\u921E\u920D\u9210\u9207\u9211\u9594\u958F\u958B\u9591"],
      ["b6a1", "\u9593\u9592\u958E\u968A\u968E\u968B\u967D\u9685\u9686\u968D\u9672\u9684\u96C1\u96C5\u96C4\u96C6\u96C7\u96EF\u96F2\u97CC\u9805\u9806\u9808\u98E7\u98EA\u98EF\u98E9\u98F2\u98ED\u99AE\u99AD\u9EC3\u9ECD\u9ED1\u4E82\u50AD\u50B5\u50B2\u50B3\u50C5\u50BE\u50AC\u50B7\u50BB\u50AF\u50C7\u527F\u5277\u527D\u52DF\u52E6\u52E4\u52E2\u52E3\u532F\u55DF\u55E8\u55D3\u55E6\u55CE\u55DC\u55C7\u55D1\u55E3\u55E4\u55EF\u55DA\u55E1\u55C5\u55C6\u55E5\u55C9\u5712\u5713\u585E\u5851\u5858\u5857\u585A\u5854\u586B\u584C\u586D\u584A\u5862\u5852\u584B\u5967\u5AC1\u5AC9\u5ACC\u5ABE\u5ABD\u5ABC"],
      ["b740", "\u5AB3\u5AC2\u5AB2\u5D69\u5D6F\u5E4C\u5E79\u5EC9\u5EC8\u5F12\u5F59\u5FAC\u5FAE\u611A\u610F\u6148\u611F\u60F3\u611B\u60F9\u6101\u6108\u614E\u614C\u6144\u614D\u613E\u6134\u6127\u610D\u6106\u6137\u6221\u6222\u6413\u643E\u641E\u642A\u642D\u643D\u642C\u640F\u641C\u6414\u640D\u6436\u6416\u6417\u6406\u656C\u659F\u65B0\u6697\u6689\u6687\u6688\u6696\u6684\u6698\u668D\u6703\u6994\u696D"],
      ["b7a1", "\u695A\u6977\u6960\u6954\u6975\u6930\u6982\u694A\u6968\u696B\u695E\u6953\u6979\u6986\u695D\u6963\u695B\u6B47\u6B72\u6BC0\u6BBF\u6BD3\u6BFD\u6EA2\u6EAF\u6ED3\u6EB6\u6EC2\u6E90\u6E9D\u6EC7\u6EC5\u6EA5\u6E98\u6EBC\u6EBA\u6EAB\u6ED1\u6E96\u6E9C\u6EC4\u6ED4\u6EAA\u6EA7\u6EB4\u714E\u7159\u7169\u7164\u7149\u7167\u715C\u716C\u7166\u714C\u7165\u715E\u7146\u7168\u7156\u723A\u7252\u7337\u7345\u733F\u733E\u746F\u745A\u7455\u745F\u745E\u7441\u743F\u7459\u745B\u745C\u7576\u7578\u7600\u75F0\u7601\u75F2\u75F1\u75FA\u75FF\u75F4\u75F3\u76DE\u76DF\u775B\u776B\u7766\u775E\u7763"],
      ["b840", "\u7779\u776A\u776C\u775C\u7765\u7768\u7762\u77EE\u788E\u78B0\u7897\u7898\u788C\u7889\u787C\u7891\u7893\u787F\u797A\u797F\u7981\u842C\u79BD\u7A1C\u7A1A\u7A20\u7A14\u7A1F\u7A1E\u7A9F\u7AA0\u7B77\u7BC0\u7B60\u7B6E\u7B67\u7CB1\u7CB3\u7CB5\u7D93\u7D79\u7D91\u7D81\u7D8F\u7D5B\u7F6E\u7F69\u7F6A\u7F72\u7FA9\u7FA8\u7FA4\u8056\u8058\u8086\u8084\u8171\u8170\u8178\u8165\u816E\u8173\u816B"],
      ["b8a1", "\u8179\u817A\u8166\u8205\u8247\u8482\u8477\u843D\u8431\u8475\u8466\u846B\u8449\u846C\u845B\u843C\u8435\u8461\u8463\u8469\u846D\u8446\u865E\u865C\u865F\u86F9\u8713\u8708\u8707\u8700\u86FE\u86FB\u8702\u8703\u8706\u870A\u8859\u88DF\u88D4\u88D9\u88DC\u88D8\u88DD\u88E1\u88CA\u88D5\u88D2\u899C\u89E3\u8A6B\u8A72\u8A73\u8A66\u8A69\u8A70\u8A87\u8A7C\u8A63\u8AA0\u8A71\u8A85\u8A6D\u8A62\u8A6E\u8A6C\u8A79\u8A7B\u8A3E\u8A68\u8C62\u8C8A\u8C89\u8CCA\u8CC7\u8CC8\u8CC4\u8CB2\u8CC3\u8CC2\u8CC5\u8DE1\u8DDF\u8DE8\u8DEF\u8DF3\u8DFA\u8DEA\u8DE4\u8DE6\u8EB2\u8F03\u8F09\u8EFE\u8F0A"],
      ["b940", "\u8F9F\u8FB2\u904B\u904A\u9053\u9042\u9054\u903C\u9055\u9050\u9047\u904F\u904E\u904D\u9051\u903E\u9041\u9112\u9117\u916C\u916A\u9169\u91C9\u9237\u9257\u9238\u923D\u9240\u923E\u925B\u924B\u9264\u9251\u9234\u9249\u924D\u9245\u9239\u923F\u925A\u9598\u9698\u9694\u9695\u96CD\u96CB\u96C9\u96CA\u96F7\u96FB\u96F9\u96F6\u9756\u9774\u9776\u9810\u9811\u9813\u980A\u9812\u980C\u98FC\u98F4"],
      ["b9a1", "\u98FD\u98FE\u99B3\u99B1\u99B4\u9AE1\u9CE9\u9E82\u9F0E\u9F13\u9F20\u50E7\u50EE\u50E5\u50D6\u50ED\u50DA\u50D5\u50CF\u50D1\u50F1\u50CE\u50E9\u5162\u51F3\u5283\u5282\u5331\u53AD\u55FE\u5600\u561B\u5617\u55FD\u5614\u5606\u5609\u560D\u560E\u55F7\u5616\u561F\u5608\u5610\u55F6\u5718\u5716\u5875\u587E\u5883\u5893\u588A\u5879\u5885\u587D\u58FD\u5925\u5922\u5924\u596A\u5969\u5AE1\u5AE6\u5AE9\u5AD7\u5AD6\u5AD8\u5AE3\u5B75\u5BDE\u5BE7\u5BE1\u5BE5\u5BE6\u5BE8\u5BE2\u5BE4\u5BDF\u5C0D\u5C62\u5D84\u5D87\u5E5B\u5E63\u5E55\u5E57\u5E54\u5ED3\u5ED6\u5F0A\u5F46\u5F70\u5FB9\u6147"],
      ["ba40", "\u613F\u614B\u6177\u6162\u6163\u615F\u615A\u6158\u6175\u622A\u6487\u6458\u6454\u64A4\u6478\u645F\u647A\u6451\u6467\u6434\u646D\u647B\u6572\u65A1\u65D7\u65D6\u66A2\u66A8\u669D\u699C\u69A8\u6995\u69C1\u69AE\u69D3\u69CB\u699B\u69B7\u69BB\u69AB\u69B4\u69D0\u69CD\u69AD\u69CC\u69A6\u69C3\u69A3\u6B49\u6B4C\u6C33\u6F33\u6F14\u6EFE\u6F13\u6EF4\u6F29\u6F3E\u6F20\u6F2C\u6F0F\u6F02\u6F22"],
      ["baa1", "\u6EFF\u6EEF\u6F06\u6F31\u6F38\u6F32\u6F23\u6F15\u6F2B\u6F2F\u6F88\u6F2A\u6EEC\u6F01\u6EF2\u6ECC\u6EF7\u7194\u7199\u717D\u718A\u7184\u7192\u723E\u7292\u7296\u7344\u7350\u7464\u7463\u746A\u7470\u746D\u7504\u7591\u7627\u760D\u760B\u7609\u7613\u76E1\u76E3\u7784\u777D\u777F\u7761\u78C1\u789F\u78A7\u78B3\u78A9\u78A3\u798E\u798F\u798D\u7A2E\u7A31\u7AAA\u7AA9\u7AED\u7AEF\u7BA1\u7B95\u7B8B\u7B75\u7B97\u7B9D\u7B94\u7B8F\u7BB8\u7B87\u7B84\u7CB9\u7CBD\u7CBE\u7DBB\u7DB0\u7D9C\u7DBD\u7DBE\u7DA0\u7DCA\u7DB4\u7DB2\u7DB1\u7DBA\u7DA2\u7DBF\u7DB5\u7DB8\u7DAD\u7DD2\u7DC7\u7DAC"],
      ["bb40", "\u7F70\u7FE0\u7FE1\u7FDF\u805E\u805A\u8087\u8150\u8180\u818F\u8188\u818A\u817F\u8182\u81E7\u81FA\u8207\u8214\u821E\u824B\u84C9\u84BF\u84C6\u84C4\u8499\u849E\u84B2\u849C\u84CB\u84B8\u84C0\u84D3\u8490\u84BC\u84D1\u84CA\u873F\u871C\u873B\u8722\u8725\u8734\u8718\u8755\u8737\u8729\u88F3\u8902\u88F4\u88F9\u88F8\u88FD\u88E8\u891A\u88EF\u8AA6\u8A8C\u8A9E\u8AA3\u8A8D\u8AA1\u8A93\u8AA4"],
      ["bba1", "\u8AAA\u8AA5\u8AA8\u8A98\u8A91\u8A9A\u8AA7\u8C6A\u8C8D\u8C8C\u8CD3\u8CD1\u8CD2\u8D6B\u8D99\u8D95\u8DFC\u8F14\u8F12\u8F15\u8F13\u8FA3\u9060\u9058\u905C\u9063\u9059\u905E\u9062\u905D\u905B\u9119\u9118\u911E\u9175\u9178\u9177\u9174\u9278\u9280\u9285\u9298\u9296\u927B\u9293\u929C\u92A8\u927C\u9291\u95A1\u95A8\u95A9\u95A3\u95A5\u95A4\u9699\u969C\u969B\u96CC\u96D2\u9700\u977C\u9785\u97F6\u9817\u9818\u98AF\u98B1\u9903\u9905\u990C\u9909\u99C1\u9AAF\u9AB0\u9AE6\u9B41\u9B42\u9CF4\u9CF6\u9CF3\u9EBC\u9F3B\u9F4A\u5104\u5100\u50FB\u50F5\u50F9\u5102\u5108\u5109\u5105\u51DC"],
      ["bc40", "\u5287\u5288\u5289\u528D\u528A\u52F0\u53B2\u562E\u563B\u5639\u5632\u563F\u5634\u5629\u5653\u564E\u5657\u5674\u5636\u562F\u5630\u5880\u589F\u589E\u58B3\u589C\u58AE\u58A9\u58A6\u596D\u5B09\u5AFB\u5B0B\u5AF5\u5B0C\u5B08\u5BEE\u5BEC\u5BE9\u5BEB\u5C64\u5C65\u5D9D\u5D94\u5E62\u5E5F\u5E61\u5EE2\u5EDA\u5EDF\u5EDD\u5EE3\u5EE0\u5F48\u5F71\u5FB7\u5FB5\u6176\u6167\u616E\u615D\u6155\u6182"],
      ["bca1", "\u617C\u6170\u616B\u617E\u61A7\u6190\u61AB\u618E\u61AC\u619A\u61A4\u6194\u61AE\u622E\u6469\u646F\u6479\u649E\u64B2\u6488\u6490\u64B0\u64A5\u6493\u6495\u64A9\u6492\u64AE\u64AD\u64AB\u649A\u64AC\u6499\u64A2\u64B3\u6575\u6577\u6578\u66AE\u66AB\u66B4\u66B1\u6A23\u6A1F\u69E8\u6A01\u6A1E\u6A19\u69FD\u6A21\u6A13\u6A0A\u69F3\u6A02\u6A05\u69ED\u6A11\u6B50\u6B4E\u6BA4\u6BC5\u6BC6\u6F3F\u6F7C\u6F84\u6F51\u6F66\u6F54\u6F86\u6F6D\u6F5B\u6F78\u6F6E\u6F8E\u6F7A\u6F70\u6F64\u6F97\u6F58\u6ED5\u6F6F\u6F60\u6F5F\u719F\u71AC\u71B1\u71A8\u7256\u729B\u734E\u7357\u7469\u748B\u7483"],
      ["bd40", "\u747E\u7480\u757F\u7620\u7629\u761F\u7624\u7626\u7621\u7622\u769A\u76BA\u76E4\u778E\u7787\u778C\u7791\u778B\u78CB\u78C5\u78BA\u78CA\u78BE\u78D5\u78BC\u78D0\u7A3F\u7A3C\u7A40\u7A3D\u7A37\u7A3B\u7AAF\u7AAE\u7BAD\u7BB1\u7BC4\u7BB4\u7BC6\u7BC7\u7BC1\u7BA0\u7BCC\u7CCA\u7DE0\u7DF4\u7DEF\u7DFB\u7DD8\u7DEC\u7DDD\u7DE8\u7DE3\u7DDA\u7DDE\u7DE9\u7D9E\u7DD9\u7DF2\u7DF9\u7F75\u7F77\u7FAF"],
      ["bda1", "\u7FE9\u8026\u819B\u819C\u819D\u81A0\u819A\u8198\u8517\u853D\u851A\u84EE\u852C\u852D\u8513\u8511\u8523\u8521\u8514\u84EC\u8525\u84FF\u8506\u8782\u8774\u8776\u8760\u8766\u8778\u8768\u8759\u8757\u874C\u8753\u885B\u885D\u8910\u8907\u8912\u8913\u8915\u890A\u8ABC\u8AD2\u8AC7\u8AC4\u8A95\u8ACB\u8AF8\u8AB2\u8AC9\u8AC2\u8ABF\u8AB0\u8AD6\u8ACD\u8AB6\u8AB9\u8ADB\u8C4C\u8C4E\u8C6C\u8CE0\u8CDE\u8CE6\u8CE4\u8CEC\u8CED\u8CE2\u8CE3\u8CDC\u8CEA\u8CE1\u8D6D\u8D9F\u8DA3\u8E2B\u8E10\u8E1D\u8E22\u8E0F\u8E29\u8E1F\u8E21\u8E1E\u8EBA\u8F1D\u8F1B\u8F1F\u8F29\u8F26\u8F2A\u8F1C\u8F1E"],
      ["be40", "\u8F25\u9069\u906E\u9068\u906D\u9077\u9130\u912D\u9127\u9131\u9187\u9189\u918B\u9183\u92C5\u92BB\u92B7\u92EA\u92AC\u92E4\u92C1\u92B3\u92BC\u92D2\u92C7\u92F0\u92B2\u95AD\u95B1\u9704\u9706\u9707\u9709\u9760\u978D\u978B\u978F\u9821\u982B\u981C\u98B3\u990A\u9913\u9912\u9918\u99DD\u99D0\u99DF\u99DB\u99D1\u99D5\u99D2\u99D9\u9AB7\u9AEE\u9AEF\u9B27\u9B45\u9B44\u9B77\u9B6F\u9D06\u9D09"],
      ["bea1", "\u9D03\u9EA9\u9EBE\u9ECE\u58A8\u9F52\u5112\u5118\u5114\u5110\u5115\u5180\u51AA\u51DD\u5291\u5293\u52F3\u5659\u566B\u5679\u5669\u5664\u5678\u566A\u5668\u5665\u5671\u566F\u566C\u5662\u5676\u58C1\u58BE\u58C7\u58C5\u596E\u5B1D\u5B34\u5B78\u5BF0\u5C0E\u5F4A\u61B2\u6191\u61A9\u618A\u61CD\u61B6\u61BE\u61CA\u61C8\u6230\u64C5\u64C1\u64CB\u64BB\u64BC\u64DA\u64C4\u64C7\u64C2\u64CD\u64BF\u64D2\u64D4\u64BE\u6574\u66C6\u66C9\u66B9\u66C4\u66C7\u66B8\u6A3D\u6A38\u6A3A\u6A59\u6A6B\u6A58\u6A39\u6A44\u6A62\u6A61\u6A4B\u6A47\u6A35\u6A5F\u6A48\u6B59\u6B77\u6C05\u6FC2\u6FB1\u6FA1"],
      ["bf40", "\u6FC3\u6FA4\u6FC1\u6FA7\u6FB3\u6FC0\u6FB9\u6FB6\u6FA6\u6FA0\u6FB4\u71BE\u71C9\u71D0\u71D2\u71C8\u71D5\u71B9\u71CE\u71D9\u71DC\u71C3\u71C4\u7368\u749C\u74A3\u7498\u749F\u749E\u74E2\u750C\u750D\u7634\u7638\u763A\u76E7\u76E5\u77A0\u779E\u779F\u77A5\u78E8\u78DA\u78EC\u78E7\u79A6\u7A4D\u7A4E\u7A46\u7A4C\u7A4B\u7ABA\u7BD9\u7C11\u7BC9\u7BE4\u7BDB\u7BE1\u7BE9\u7BE6\u7CD5\u7CD6\u7E0A"],
      ["bfa1", "\u7E11\u7E08\u7E1B\u7E23\u7E1E\u7E1D\u7E09\u7E10\u7F79\u7FB2\u7FF0\u7FF1\u7FEE\u8028\u81B3\u81A9\u81A8\u81FB\u8208\u8258\u8259\u854A\u8559\u8548\u8568\u8569\u8543\u8549\u856D\u856A\u855E\u8783\u879F\u879E\u87A2\u878D\u8861\u892A\u8932\u8925\u892B\u8921\u89AA\u89A6\u8AE6\u8AFA\u8AEB\u8AF1\u8B00\u8ADC\u8AE7\u8AEE\u8AFE\u8B01\u8B02\u8AF7\u8AED\u8AF3\u8AF6\u8AFC\u8C6B\u8C6D\u8C93\u8CF4\u8E44\u8E31\u8E34\u8E42\u8E39\u8E35\u8F3B\u8F2F\u8F38\u8F33\u8FA8\u8FA6\u9075\u9074\u9078\u9072\u907C\u907A\u9134\u9192\u9320\u9336\u92F8\u9333\u932F\u9322\u92FC\u932B\u9304\u931A"],
      ["c040", "\u9310\u9326\u9321\u9315\u932E\u9319\u95BB\u96A7\u96A8\u96AA\u96D5\u970E\u9711\u9716\u970D\u9713\u970F\u975B\u975C\u9766\u9798\u9830\u9838\u983B\u9837\u982D\u9839\u9824\u9910\u9928\u991E\u991B\u9921\u991A\u99ED\u99E2\u99F1\u9AB8\u9ABC\u9AFB\u9AED\u9B28\u9B91\u9D15\u9D23\u9D26\u9D28\u9D12\u9D1B\u9ED8\u9ED4\u9F8D\u9F9C\u512A\u511F\u5121\u5132\u52F5\u568E\u5680\u5690\u5685\u5687"],
      ["c0a1", "\u568F\u58D5\u58D3\u58D1\u58CE\u5B30\u5B2A\u5B24\u5B7A\u5C37\u5C68\u5DBC\u5DBA\u5DBD\u5DB8\u5E6B\u5F4C\u5FBD\u61C9\u61C2\u61C7\u61E6\u61CB\u6232\u6234\u64CE\u64CA\u64D8\u64E0\u64F0\u64E6\u64EC\u64F1\u64E2\u64ED\u6582\u6583\u66D9\u66D6\u6A80\u6A94\u6A84\u6AA2\u6A9C\u6ADB\u6AA3\u6A7E\u6A97\u6A90\u6AA0\u6B5C\u6BAE\u6BDA\u6C08\u6FD8\u6FF1\u6FDF\u6FE0\u6FDB\u6FE4\u6FEB\u6FEF\u6F80\u6FEC\u6FE1\u6FE9\u6FD5\u6FEE\u6FF0\u71E7\u71DF\u71EE\u71E6\u71E5\u71ED\u71EC\u71F4\u71E0\u7235\u7246\u7370\u7372\u74A9\u74B0\u74A6\u74A8\u7646\u7642\u764C\u76EA\u77B3\u77AA\u77B0\u77AC"],
      ["c140", "\u77A7\u77AD\u77EF\u78F7\u78FA\u78F4\u78EF\u7901\u79A7\u79AA\u7A57\u7ABF\u7C07\u7C0D\u7BFE\u7BF7\u7C0C\u7BE0\u7CE0\u7CDC\u7CDE\u7CE2\u7CDF\u7CD9\u7CDD\u7E2E\u7E3E\u7E46\u7E37\u7E32\u7E43\u7E2B\u7E3D\u7E31\u7E45\u7E41\u7E34\u7E39\u7E48\u7E35\u7E3F\u7E2F\u7F44\u7FF3\u7FFC\u8071\u8072\u8070\u806F\u8073\u81C6\u81C3\u81BA\u81C2\u81C0\u81BF\u81BD\u81C9\u81BE\u81E8\u8209\u8271\u85AA"],
      ["c1a1", "\u8584\u857E\u859C\u8591\u8594\u85AF\u859B\u8587\u85A8\u858A\u8667\u87C0\u87D1\u87B3\u87D2\u87C6\u87AB\u87BB\u87BA\u87C8\u87CB\u893B\u8936\u8944\u8938\u893D\u89AC\u8B0E\u8B17\u8B19\u8B1B\u8B0A\u8B20\u8B1D\u8B04\u8B10\u8C41\u8C3F\u8C73\u8CFA\u8CFD\u8CFC\u8CF8\u8CFB\u8DA8\u8E49\u8E4B\u8E48\u8E4A\u8F44\u8F3E\u8F42\u8F45\u8F3F\u907F\u907D\u9084\u9081\u9082\u9080\u9139\u91A3\u919E\u919C\u934D\u9382\u9328\u9375\u934A\u9365\u934B\u9318\u937E\u936C\u935B\u9370\u935A\u9354\u95CA\u95CB\u95CC\u95C8\u95C6\u96B1\u96B8\u96D6\u971C\u971E\u97A0\u97D3\u9846\u98B6\u9935\u9A01"],
      ["c240", "\u99FF\u9BAE\u9BAB\u9BAA\u9BAD\u9D3B\u9D3F\u9E8B\u9ECF\u9EDE\u9EDC\u9EDD\u9EDB\u9F3E\u9F4B\u53E2\u5695\u56AE\u58D9\u58D8\u5B38\u5F5D\u61E3\u6233\u64F4\u64F2\u64FE\u6506\u64FA\u64FB\u64F7\u65B7\u66DC\u6726\u6AB3\u6AAC\u6AC3\u6ABB\u6AB8\u6AC2\u6AAE\u6AAF\u6B5F\u6B78\u6BAF\u7009\u700B\u6FFE\u7006\u6FFA\u7011\u700F\u71FB\u71FC\u71FE\u71F8\u7377\u7375\u74A7\u74BF\u7515\u7656\u7658"],
      ["c2a1", "\u7652\u77BD\u77BF\u77BB\u77BC\u790E\u79AE\u7A61\u7A62\u7A60\u7AC4\u7AC5\u7C2B\u7C27\u7C2A\u7C1E\u7C23\u7C21\u7CE7\u7E54\u7E55\u7E5E\u7E5A\u7E61\u7E52\u7E59\u7F48\u7FF9\u7FFB\u8077\u8076\u81CD\u81CF\u820A\u85CF\u85A9\u85CD\u85D0\u85C9\u85B0\u85BA\u85B9\u85A6\u87EF\u87EC\u87F2\u87E0\u8986\u89B2\u89F4\u8B28\u8B39\u8B2C\u8B2B\u8C50\u8D05\u8E59\u8E63\u8E66\u8E64\u8E5F\u8E55\u8EC0\u8F49\u8F4D\u9087\u9083\u9088\u91AB\u91AC\u91D0\u9394\u938A\u9396\u93A2\u93B3\u93AE\u93AC\u93B0\u9398\u939A\u9397\u95D4\u95D6\u95D0\u95D5\u96E2\u96DC\u96D9\u96DB\u96DE\u9724\u97A3\u97A6"],
      ["c340", "\u97AD\u97F9\u984D\u984F\u984C\u984E\u9853\u98BA\u993E\u993F\u993D\u992E\u99A5\u9A0E\u9AC1\u9B03\u9B06\u9B4F\u9B4E\u9B4D\u9BCA\u9BC9\u9BFD\u9BC8\u9BC0\u9D51\u9D5D\u9D60\u9EE0\u9F15\u9F2C\u5133\u56A5\u58DE\u58DF\u58E2\u5BF5\u9F90\u5EEC\u61F2\u61F7\u61F6\u61F5\u6500\u650F\u66E0\u66DD\u6AE5\u6ADD\u6ADA\u6AD3\u701B\u701F\u7028\u701A\u701D\u7015\u7018\u7206\u720D\u7258\u72A2\u7378"],
      ["c3a1", "\u737A\u74BD\u74CA\u74E3\u7587\u7586\u765F\u7661\u77C7\u7919\u79B1\u7A6B\u7A69\u7C3E\u7C3F\u7C38\u7C3D\u7C37\u7C40\u7E6B\u7E6D\u7E79\u7E69\u7E6A\u7F85\u7E73\u7FB6\u7FB9\u7FB8\u81D8\u85E9\u85DD\u85EA\u85D5\u85E4\u85E5\u85F7\u87FB\u8805\u880D\u87F9\u87FE\u8960\u895F\u8956\u895E\u8B41\u8B5C\u8B58\u8B49\u8B5A\u8B4E\u8B4F\u8B46\u8B59\u8D08\u8D0A\u8E7C\u8E72\u8E87\u8E76\u8E6C\u8E7A\u8E74\u8F54\u8F4E\u8FAD\u908A\u908B\u91B1\u91AE\u93E1\u93D1\u93DF\u93C3\u93C8\u93DC\u93DD\u93D6\u93E2\u93CD\u93D8\u93E4\u93D7\u93E8\u95DC\u96B4\u96E3\u972A\u9727\u9761\u97DC\u97FB\u985E"],
      ["c440", "\u9858\u985B\u98BC\u9945\u9949\u9A16\u9A19\u9B0D\u9BE8\u9BE7\u9BD6\u9BDB\u9D89\u9D61\u9D72\u9D6A\u9D6C\u9E92\u9E97\u9E93\u9EB4\u52F8\u56A8\u56B7\u56B6\u56B4\u56BC\u58E4\u5B40\u5B43\u5B7D\u5BF6\u5DC9\u61F8\u61FA\u6518\u6514\u6519\u66E6\u6727\u6AEC\u703E\u7030\u7032\u7210\u737B\u74CF\u7662\u7665\u7926\u792A\u792C\u792B\u7AC7\u7AF6\u7C4C\u7C43\u7C4D\u7CEF\u7CF0\u8FAE\u7E7D\u7E7C"],
      ["c4a1", "\u7E82\u7F4C\u8000\u81DA\u8266\u85FB\u85F9\u8611\u85FA\u8606\u860B\u8607\u860A\u8814\u8815\u8964\u89BA\u89F8\u8B70\u8B6C\u8B66\u8B6F\u8B5F\u8B6B\u8D0F\u8D0D\u8E89\u8E81\u8E85\u8E82\u91B4\u91CB\u9418\u9403\u93FD\u95E1\u9730\u98C4\u9952\u9951\u99A8\u9A2B\u9A30\u9A37\u9A35\u9C13\u9C0D\u9E79\u9EB5\u9EE8\u9F2F\u9F5F\u9F63\u9F61\u5137\u5138\u56C1\u56C0\u56C2\u5914\u5C6C\u5DCD\u61FC\u61FE\u651D\u651C\u6595\u66E9\u6AFB\u6B04\u6AFA\u6BB2\u704C\u721B\u72A7\u74D6\u74D4\u7669\u77D3\u7C50\u7E8F\u7E8C\u7FBC\u8617\u862D\u861A\u8823\u8822\u8821\u881F\u896A\u896C\u89BD\u8B74"],
      ["c540", "\u8B77\u8B7D\u8D13\u8E8A\u8E8D\u8E8B\u8F5F\u8FAF\u91BA\u942E\u9433\u9435\u943A\u9438\u9432\u942B\u95E2\u9738\u9739\u9732\u97FF\u9867\u9865\u9957\u9A45\u9A43\u9A40\u9A3E\u9ACF\u9B54\u9B51\u9C2D\u9C25\u9DAF\u9DB4\u9DC2\u9DB8\u9E9D\u9EEF\u9F19\u9F5C\u9F66\u9F67\u513C\u513B\u56C8\u56CA\u56C9\u5B7F\u5DD4\u5DD2\u5F4E\u61FF\u6524\u6B0A\u6B61\u7051\u7058\u7380\u74E4\u758A\u766E\u766C"],
      ["c5a1", "\u79B3\u7C60\u7C5F\u807E\u807D\u81DF\u8972\u896F\u89FC\u8B80\u8D16\u8D17\u8E91\u8E93\u8F61\u9148\u9444\u9451\u9452\u973D\u973E\u97C3\u97C1\u986B\u9955\u9A55\u9A4D\u9AD2\u9B1A\u9C49\u9C31\u9C3E\u9C3B\u9DD3\u9DD7\u9F34\u9F6C\u9F6A\u9F94\u56CC\u5DD6\u6200\u6523\u652B\u652A\u66EC\u6B10\u74DA\u7ACA\u7C64\u7C63\u7C65\u7E93\u7E96\u7E94\u81E2\u8638\u863F\u8831\u8B8A\u9090\u908F\u9463\u9460\u9464\u9768\u986F\u995C\u9A5A\u9A5B\u9A57\u9AD3\u9AD4\u9AD1\u9C54\u9C57\u9C56\u9DE5\u9E9F\u9EF4\u56D1\u58E9\u652C\u705E\u7671\u7672\u77D7\u7F50\u7F88\u8836\u8839\u8862\u8B93\u8B92"],
      ["c640", "\u8B96\u8277\u8D1B\u91C0\u946A\u9742\u9748\u9744\u97C6\u9870\u9A5F\u9B22\u9B58\u9C5F\u9DF9\u9DFA\u9E7C\u9E7D\u9F07\u9F77\u9F72\u5EF3\u6B16\u7063\u7C6C\u7C6E\u883B\u89C0\u8EA1\u91C1\u9472\u9470\u9871\u995E\u9AD6\u9B23\u9ECC\u7064\u77DA\u8B9A\u9477\u97C9\u9A62\u9A65\u7E9C\u8B9C\u8EAA\u91C5\u947D\u947E\u947C\u9C77\u9C78\u9EF7\u8C54\u947F\u9E1A\u7228\u9A6A\u9B31\u9E1B\u9E1E\u7C72"],
      ["c940", "\u4E42\u4E5C\u51F5\u531A\u5382\u4E07\u4E0C\u4E47\u4E8D\u56D7\uFA0C\u5C6E\u5F73\u4E0F\u5187\u4E0E\u4E2E\u4E93\u4EC2\u4EC9\u4EC8\u5198\u52FC\u536C\u53B9\u5720\u5903\u592C\u5C10\u5DFF\u65E1\u6BB3\u6BCC\u6C14\u723F\u4E31\u4E3C\u4EE8\u4EDC\u4EE9\u4EE1\u4EDD\u4EDA\u520C\u531C\u534C\u5722\u5723\u5917\u592F\u5B81\u5B84\u5C12\u5C3B\u5C74\u5C73\u5E04\u5E80\u5E82\u5FC9\u6209\u6250\u6C15"],
      ["c9a1", "\u6C36\u6C43\u6C3F\u6C3B\u72AE\u72B0\u738A\u79B8\u808A\u961E\u4F0E\u4F18\u4F2C\u4EF5\u4F14\u4EF1\u4F00\u4EF7\u4F08\u4F1D\u4F02\u4F05\u4F22\u4F13\u4F04\u4EF4\u4F12\u51B1\u5213\u5209\u5210\u52A6\u5322\u531F\u534D\u538A\u5407\u56E1\u56DF\u572E\u572A\u5734\u593C\u5980\u597C\u5985\u597B\u597E\u5977\u597F\u5B56\u5C15\u5C25\u5C7C\u5C7A\u5C7B\u5C7E\u5DDF\u5E75\u5E84\u5F02\u5F1A\u5F74\u5FD5\u5FD4\u5FCF\u625C\u625E\u6264\u6261\u6266\u6262\u6259\u6260\u625A\u6265\u65EF\u65EE\u673E\u6739\u6738\u673B\u673A\u673F\u673C\u6733\u6C18\u6C46\u6C52\u6C5C\u6C4F\u6C4A\u6C54\u6C4B"],
      ["ca40", "\u6C4C\u7071\u725E\u72B4\u72B5\u738E\u752A\u767F\u7A75\u7F51\u8278\u827C\u8280\u827D\u827F\u864D\u897E\u9099\u9097\u9098\u909B\u9094\u9622\u9624\u9620\u9623\u4F56\u4F3B\u4F62\u4F49\u4F53\u4F64\u4F3E\u4F67\u4F52\u4F5F\u4F41\u4F58\u4F2D\u4F33\u4F3F\u4F61\u518F\u51B9\u521C\u521E\u5221\u52AD\u52AE\u5309\u5363\u5372\u538E\u538F\u5430\u5437\u542A\u5454\u5445\u5419\u541C\u5425\u5418"],
      ["caa1", "\u543D\u544F\u5441\u5428\u5424\u5447\u56EE\u56E7\u56E5\u5741\u5745\u574C\u5749\u574B\u5752\u5906\u5940\u59A6\u5998\u59A0\u5997\u598E\u59A2\u5990\u598F\u59A7\u59A1\u5B8E\u5B92\u5C28\u5C2A\u5C8D\u5C8F\u5C88\u5C8B\u5C89\u5C92\u5C8A\u5C86\u5C93\u5C95\u5DE0\u5E0A\u5E0E\u5E8B\u5E89\u5E8C\u5E88\u5E8D\u5F05\u5F1D\u5F78\u5F76\u5FD2\u5FD1\u5FD0\u5FED\u5FE8\u5FEE\u5FF3\u5FE1\u5FE4\u5FE3\u5FFA\u5FEF\u5FF7\u5FFB\u6000\u5FF4\u623A\u6283\u628C\u628E\u628F\u6294\u6287\u6271\u627B\u627A\u6270\u6281\u6288\u6277\u627D\u6272\u6274\u6537\u65F0\u65F4\u65F3\u65F2\u65F5\u6745\u6747"],
      ["cb40", "\u6759\u6755\u674C\u6748\u675D\u674D\u675A\u674B\u6BD0\u6C19\u6C1A\u6C78\u6C67\u6C6B\u6C84\u6C8B\u6C8F\u6C71\u6C6F\u6C69\u6C9A\u6C6D\u6C87\u6C95\u6C9C\u6C66\u6C73\u6C65\u6C7B\u6C8E\u7074\u707A\u7263\u72BF\u72BD\u72C3\u72C6\u72C1\u72BA\u72C5\u7395\u7397\u7393\u7394\u7392\u753A\u7539\u7594\u7595\u7681\u793D\u8034\u8095\u8099\u8090\u8092\u809C\u8290\u828F\u8285\u828E\u8291\u8293"],
      ["cba1", "\u828A\u8283\u8284\u8C78\u8FC9\u8FBF\u909F\u90A1\u90A5\u909E\u90A7\u90A0\u9630\u9628\u962F\u962D\u4E33\u4F98\u4F7C\u4F85\u4F7D\u4F80\u4F87\u4F76\u4F74\u4F89\u4F84\u4F77\u4F4C\u4F97\u4F6A\u4F9A\u4F79\u4F81\u4F78\u4F90\u4F9C\u4F94\u4F9E\u4F92\u4F82\u4F95\u4F6B\u4F6E\u519E\u51BC\u51BE\u5235\u5232\u5233\u5246\u5231\u52BC\u530A\u530B\u533C\u5392\u5394\u5487\u547F\u5481\u5491\u5482\u5488\u546B\u547A\u547E\u5465\u546C\u5474\u5466\u548D\u546F\u5461\u5460\u5498\u5463\u5467\u5464\u56F7\u56F9\u576F\u5772\u576D\u576B\u5771\u5770\u5776\u5780\u5775\u577B\u5773\u5774\u5762"],
      ["cc40", "\u5768\u577D\u590C\u5945\u59B5\u59BA\u59CF\u59CE\u59B2\u59CC\u59C1\u59B6\u59BC\u59C3\u59D6\u59B1\u59BD\u59C0\u59C8\u59B4\u59C7\u5B62\u5B65\u5B93\u5B95\u5C44\u5C47\u5CAE\u5CA4\u5CA0\u5CB5\u5CAF\u5CA8\u5CAC\u5C9F\u5CA3\u5CAD\u5CA2\u5CAA\u5CA7\u5C9D\u5CA5\u5CB6\u5CB0\u5CA6\u5E17\u5E14\u5E19\u5F28\u5F22\u5F23\u5F24\u5F54\u5F82\u5F7E\u5F7D\u5FDE\u5FE5\u602D\u6026\u6019\u6032\u600B"],
      ["cca1", "\u6034\u600A\u6017\u6033\u601A\u601E\u602C\u6022\u600D\u6010\u602E\u6013\u6011\u600C\u6009\u601C\u6214\u623D\u62AD\u62B4\u62D1\u62BE\u62AA\u62B6\u62CA\u62AE\u62B3\u62AF\u62BB\u62A9\u62B0\u62B8\u653D\u65A8\u65BB\u6609\u65FC\u6604\u6612\u6608\u65FB\u6603\u660B\u660D\u6605\u65FD\u6611\u6610\u66F6\u670A\u6785\u676C\u678E\u6792\u6776\u677B\u6798\u6786\u6784\u6774\u678D\u678C\u677A\u679F\u6791\u6799\u6783\u677D\u6781\u6778\u6779\u6794\u6B25\u6B80\u6B7E\u6BDE\u6C1D\u6C93\u6CEC\u6CEB\u6CEE\u6CD9\u6CB6\u6CD4\u6CAD\u6CE7\u6CB7\u6CD0\u6CC2\u6CBA\u6CC3\u6CC6\u6CED\u6CF2"],
      ["cd40", "\u6CD2\u6CDD\u6CB4\u6C8A\u6C9D\u6C80\u6CDE\u6CC0\u6D30\u6CCD\u6CC7\u6CB0\u6CF9\u6CCF\u6CE9\u6CD1\u7094\u7098\u7085\u7093\u7086\u7084\u7091\u7096\u7082\u709A\u7083\u726A\u72D6\u72CB\u72D8\u72C9\u72DC\u72D2\u72D4\u72DA\u72CC\u72D1\u73A4\u73A1\u73AD\u73A6\u73A2\u73A0\u73AC\u739D\u74DD\u74E8\u753F\u7540\u753E\u758C\u7598\u76AF\u76F3\u76F1\u76F0\u76F5\u77F8\u77FC\u77F9\u77FB\u77FA"],
      ["cda1", "\u77F7\u7942\u793F\u79C5\u7A78\u7A7B\u7AFB\u7C75\u7CFD\u8035\u808F\u80AE\u80A3\u80B8\u80B5\u80AD\u8220\u82A0\u82C0\u82AB\u829A\u8298\u829B\u82B5\u82A7\u82AE\u82BC\u829E\u82BA\u82B4\u82A8\u82A1\u82A9\u82C2\u82A4\u82C3\u82B6\u82A2\u8670\u866F\u866D\u866E\u8C56\u8FD2\u8FCB\u8FD3\u8FCD\u8FD6\u8FD5\u8FD7\u90B2\u90B4\u90AF\u90B3\u90B0\u9639\u963D\u963C\u963A\u9643\u4FCD\u4FC5\u4FD3\u4FB2\u4FC9\u4FCB\u4FC1\u4FD4\u4FDC\u4FD9\u4FBB\u4FB3\u4FDB\u4FC7\u4FD6\u4FBA\u4FC0\u4FB9\u4FEC\u5244\u5249\u52C0\u52C2\u533D\u537C\u5397\u5396\u5399\u5398\u54BA\u54A1\u54AD\u54A5\u54CF"],
      ["ce40", "\u54C3\u830D\u54B7\u54AE\u54D6\u54B6\u54C5\u54C6\u54A0\u5470\u54BC\u54A2\u54BE\u5472\u54DE\u54B0\u57B5\u579E\u579F\u57A4\u578C\u5797\u579D\u579B\u5794\u5798\u578F\u5799\u57A5\u579A\u5795\u58F4\u590D\u5953\u59E1\u59DE\u59EE\u5A00\u59F1\u59DD\u59FA\u59FD\u59FC\u59F6\u59E4\u59F2\u59F7\u59DB\u59E9\u59F3\u59F5\u59E0\u59FE\u59F4\u59ED\u5BA8\u5C4C\u5CD0\u5CD8\u5CCC\u5CD7\u5CCB\u5CDB"],
      ["cea1", "\u5CDE\u5CDA\u5CC9\u5CC7\u5CCA\u5CD6\u5CD3\u5CD4\u5CCF\u5CC8\u5CC6\u5CCE\u5CDF\u5CF8\u5DF9\u5E21\u5E22\u5E23\u5E20\u5E24\u5EB0\u5EA4\u5EA2\u5E9B\u5EA3\u5EA5\u5F07\u5F2E\u5F56\u5F86\u6037\u6039\u6054\u6072\u605E\u6045\u6053\u6047\u6049\u605B\u604C\u6040\u6042\u605F\u6024\u6044\u6058\u6066\u606E\u6242\u6243\u62CF\u630D\u630B\u62F5\u630E\u6303\u62EB\u62F9\u630F\u630C\u62F8\u62F6\u6300\u6313\u6314\u62FA\u6315\u62FB\u62F0\u6541\u6543\u65AA\u65BF\u6636\u6621\u6632\u6635\u661C\u6626\u6622\u6633\u662B\u663A\u661D\u6634\u6639\u662E\u670F\u6710\u67C1\u67F2\u67C8\u67BA"],
      ["cf40", "\u67DC\u67BB\u67F8\u67D8\u67C0\u67B7\u67C5\u67EB\u67E4\u67DF\u67B5\u67CD\u67B3\u67F7\u67F6\u67EE\u67E3\u67C2\u67B9\u67CE\u67E7\u67F0\u67B2\u67FC\u67C6\u67ED\u67CC\u67AE\u67E6\u67DB\u67FA\u67C9\u67CA\u67C3\u67EA\u67CB\u6B28\u6B82\u6B84\u6BB6\u6BD6\u6BD8\u6BE0\u6C20\u6C21\u6D28\u6D34\u6D2D\u6D1F\u6D3C\u6D3F\u6D12\u6D0A\u6CDA\u6D33\u6D04\u6D19\u6D3A\u6D1A\u6D11\u6D00\u6D1D\u6D42"],
      ["cfa1", "\u6D01\u6D18\u6D37\u6D03\u6D0F\u6D40\u6D07\u6D20\u6D2C\u6D08\u6D22\u6D09\u6D10\u70B7\u709F\u70BE\u70B1\u70B0\u70A1\u70B4\u70B5\u70A9\u7241\u7249\u724A\u726C\u7270\u7273\u726E\u72CA\u72E4\u72E8\u72EB\u72DF\u72EA\u72E6\u72E3\u7385\u73CC\u73C2\u73C8\u73C5\u73B9\u73B6\u73B5\u73B4\u73EB\u73BF\u73C7\u73BE\u73C3\u73C6\u73B8\u73CB\u74EC\u74EE\u752E\u7547\u7548\u75A7\u75AA\u7679\u76C4\u7708\u7703\u7704\u7705\u770A\u76F7\u76FB\u76FA\u77E7\u77E8\u7806\u7811\u7812\u7805\u7810\u780F\u780E\u7809\u7803\u7813\u794A\u794C\u794B\u7945\u7944\u79D5\u79CD\u79CF\u79D6\u79CE\u7A80"],
      ["d040", "\u7A7E\u7AD1\u7B00\u7B01\u7C7A\u7C78\u7C79\u7C7F\u7C80\u7C81\u7D03\u7D08\u7D01\u7F58\u7F91\u7F8D\u7FBE\u8007\u800E\u800F\u8014\u8037\u80D8\u80C7\u80E0\u80D1\u80C8\u80C2\u80D0\u80C5\u80E3\u80D9\u80DC\u80CA\u80D5\u80C9\u80CF\u80D7\u80E6\u80CD\u81FF\u8221\u8294\u82D9\u82FE\u82F9\u8307\u82E8\u8300\u82D5\u833A\u82EB\u82D6\u82F4\u82EC\u82E1\u82F2\u82F5\u830C\u82FB\u82F6\u82F0\u82EA"],
      ["d0a1", "\u82E4\u82E0\u82FA\u82F3\u82ED\u8677\u8674\u867C\u8673\u8841\u884E\u8867\u886A\u8869\u89D3\u8A04\u8A07\u8D72\u8FE3\u8FE1\u8FEE\u8FE0\u90F1\u90BD\u90BF\u90D5\u90C5\u90BE\u90C7\u90CB\u90C8\u91D4\u91D3\u9654\u964F\u9651\u9653\u964A\u964E\u501E\u5005\u5007\u5013\u5022\u5030\u501B\u4FF5\u4FF4\u5033\u5037\u502C\u4FF6\u4FF7\u5017\u501C\u5020\u5027\u5035\u502F\u5031\u500E\u515A\u5194\u5193\u51CA\u51C4\u51C5\u51C8\u51CE\u5261\u525A\u5252\u525E\u525F\u5255\u5262\u52CD\u530E\u539E\u5526\u54E2\u5517\u5512\u54E7\u54F3\u54E4\u551A\u54FF\u5504\u5508\u54EB\u5511\u5505\u54F1"],
      ["d140", "\u550A\u54FB\u54F7\u54F8\u54E0\u550E\u5503\u550B\u5701\u5702\u57CC\u5832\u57D5\u57D2\u57BA\u57C6\u57BD\u57BC\u57B8\u57B6\u57BF\u57C7\u57D0\u57B9\u57C1\u590E\u594A\u5A19\u5A16\u5A2D\u5A2E\u5A15\u5A0F\u5A17\u5A0A\u5A1E\u5A33\u5B6C\u5BA7\u5BAD\u5BAC\u5C03\u5C56\u5C54\u5CEC\u5CFF\u5CEE\u5CF1\u5CF7\u5D00\u5CF9\u5E29\u5E28\u5EA8\u5EAE\u5EAA\u5EAC\u5F33\u5F30\u5F67\u605D\u605A\u6067"],
      ["d1a1", "\u6041\u60A2\u6088\u6080\u6092\u6081\u609D\u6083\u6095\u609B\u6097\u6087\u609C\u608E\u6219\u6246\u62F2\u6310\u6356\u632C\u6344\u6345\u6336\u6343\u63E4\u6339\u634B\u634A\u633C\u6329\u6341\u6334\u6358\u6354\u6359\u632D\u6347\u6333\u635A\u6351\u6338\u6357\u6340\u6348\u654A\u6546\u65C6\u65C3\u65C4\u65C2\u664A\u665F\u6647\u6651\u6712\u6713\u681F\u681A\u6849\u6832\u6833\u683B\u684B\u684F\u6816\u6831\u681C\u6835\u682B\u682D\u682F\u684E\u6844\u6834\u681D\u6812\u6814\u6826\u6828\u682E\u684D\u683A\u6825\u6820\u6B2C\u6B2F\u6B2D\u6B31\u6B34\u6B6D\u8082\u6B88\u6BE6\u6BE4"],
      ["d240", "\u6BE8\u6BE3\u6BE2\u6BE7\u6C25\u6D7A\u6D63\u6D64\u6D76\u6D0D\u6D61\u6D92\u6D58\u6D62\u6D6D\u6D6F\u6D91\u6D8D\u6DEF\u6D7F\u6D86\u6D5E\u6D67\u6D60\u6D97\u6D70\u6D7C\u6D5F\u6D82\u6D98\u6D2F\u6D68\u6D8B\u6D7E\u6D80\u6D84\u6D16\u6D83\u6D7B\u6D7D\u6D75\u6D90\u70DC\u70D3\u70D1\u70DD\u70CB\u7F39\u70E2\u70D7\u70D2\u70DE\u70E0\u70D4\u70CD\u70C5\u70C6\u70C7\u70DA\u70CE\u70E1\u7242\u7278"],
      ["d2a1", "\u7277\u7276\u7300\u72FA\u72F4\u72FE\u72F6\u72F3\u72FB\u7301\u73D3\u73D9\u73E5\u73D6\u73BC\u73E7\u73E3\u73E9\u73DC\u73D2\u73DB\u73D4\u73DD\u73DA\u73D7\u73D8\u73E8\u74DE\u74DF\u74F4\u74F5\u7521\u755B\u755F\u75B0\u75C1\u75BB\u75C4\u75C0\u75BF\u75B6\u75BA\u768A\u76C9\u771D\u771B\u7710\u7713\u7712\u7723\u7711\u7715\u7719\u771A\u7722\u7727\u7823\u782C\u7822\u7835\u782F\u7828\u782E\u782B\u7821\u7829\u7833\u782A\u7831\u7954\u795B\u794F\u795C\u7953\u7952\u7951\u79EB\u79EC\u79E0\u79EE\u79ED\u79EA\u79DC\u79DE\u79DD\u7A86\u7A89\u7A85\u7A8B\u7A8C\u7A8A\u7A87\u7AD8\u7B10"],
      ["d340", "\u7B04\u7B13\u7B05\u7B0F\u7B08\u7B0A\u7B0E\u7B09\u7B12\u7C84\u7C91\u7C8A\u7C8C\u7C88\u7C8D\u7C85\u7D1E\u7D1D\u7D11\u7D0E\u7D18\u7D16\u7D13\u7D1F\u7D12\u7D0F\u7D0C\u7F5C\u7F61\u7F5E\u7F60\u7F5D\u7F5B\u7F96\u7F92\u7FC3\u7FC2\u7FC0\u8016\u803E\u8039\u80FA\u80F2\u80F9\u80F5\u8101\u80FB\u8100\u8201\u822F\u8225\u8333\u832D\u8344\u8319\u8351\u8325\u8356\u833F\u8341\u8326\u831C\u8322"],
      ["d3a1", "\u8342\u834E\u831B\u832A\u8308\u833C\u834D\u8316\u8324\u8320\u8337\u832F\u8329\u8347\u8345\u834C\u8353\u831E\u832C\u834B\u8327\u8348\u8653\u8652\u86A2\u86A8\u8696\u868D\u8691\u869E\u8687\u8697\u8686\u868B\u869A\u8685\u86A5\u8699\u86A1\u86A7\u8695\u8698\u868E\u869D\u8690\u8694\u8843\u8844\u886D\u8875\u8876\u8872\u8880\u8871\u887F\u886F\u8883\u887E\u8874\u887C\u8A12\u8C47\u8C57\u8C7B\u8CA4\u8CA3\u8D76\u8D78\u8DB5\u8DB7\u8DB6\u8ED1\u8ED3\u8FFE\u8FF5\u9002\u8FFF\u8FFB\u9004\u8FFC\u8FF6\u90D6\u90E0\u90D9\u90DA\u90E3\u90DF\u90E5\u90D8\u90DB\u90D7\u90DC\u90E4\u9150"],
      ["d440", "\u914E\u914F\u91D5\u91E2\u91DA\u965C\u965F\u96BC\u98E3\u9ADF\u9B2F\u4E7F\u5070\u506A\u5061\u505E\u5060\u5053\u504B\u505D\u5072\u5048\u504D\u5041\u505B\u504A\u5062\u5015\u5045\u505F\u5069\u506B\u5063\u5064\u5046\u5040\u506E\u5073\u5057\u5051\u51D0\u526B\u526D\u526C\u526E\u52D6\u52D3\u532D\u539C\u5575\u5576\u553C\u554D\u5550\u5534\u552A\u5551\u5562\u5536\u5535\u5530\u5552\u5545"],
      ["d4a1", "\u550C\u5532\u5565\u554E\u5539\u5548\u552D\u553B\u5540\u554B\u570A\u5707\u57FB\u5814\u57E2\u57F6\u57DC\u57F4\u5800\u57ED\u57FD\u5808\u57F8\u580B\u57F3\u57CF\u5807\u57EE\u57E3\u57F2\u57E5\u57EC\u57E1\u580E\u57FC\u5810\u57E7\u5801\u580C\u57F1\u57E9\u57F0\u580D\u5804\u595C\u5A60\u5A58\u5A55\u5A67\u5A5E\u5A38\u5A35\u5A6D\u5A50\u5A5F\u5A65\u5A6C\u5A53\u5A64\u5A57\u5A43\u5A5D\u5A52\u5A44\u5A5B\u5A48\u5A8E\u5A3E\u5A4D\u5A39\u5A4C\u5A70\u5A69\u5A47\u5A51\u5A56\u5A42\u5A5C\u5B72\u5B6E\u5BC1\u5BC0\u5C59\u5D1E\u5D0B\u5D1D\u5D1A\u5D20\u5D0C\u5D28\u5D0D\u5D26\u5D25\u5D0F"],
      ["d540", "\u5D30\u5D12\u5D23\u5D1F\u5D2E\u5E3E\u5E34\u5EB1\u5EB4\u5EB9\u5EB2\u5EB3\u5F36\u5F38\u5F9B\u5F96\u5F9F\u608A\u6090\u6086\u60BE\u60B0\u60BA\u60D3\u60D4\u60CF\u60E4\u60D9\u60DD\u60C8\u60B1\u60DB\u60B7\u60CA\u60BF\u60C3\u60CD\u60C0\u6332\u6365\u638A\u6382\u637D\u63BD\u639E\u63AD\u639D\u6397\u63AB\u638E\u636F\u6387\u6390\u636E\u63AF\u6375\u639C\u636D\u63AE\u637C\u63A4\u633B\u639F"],
      ["d5a1", "\u6378\u6385\u6381\u6391\u638D\u6370\u6553\u65CD\u6665\u6661\u665B\u6659\u665C\u6662\u6718\u6879\u6887\u6890\u689C\u686D\u686E\u68AE\u68AB\u6956\u686F\u68A3\u68AC\u68A9\u6875\u6874\u68B2\u688F\u6877\u6892\u687C\u686B\u6872\u68AA\u6880\u6871\u687E\u689B\u6896\u688B\u68A0\u6889\u68A4\u6878\u687B\u6891\u688C\u688A\u687D\u6B36\u6B33\u6B37\u6B38\u6B91\u6B8F\u6B8D\u6B8E\u6B8C\u6C2A\u6DC0\u6DAB\u6DB4\u6DB3\u6E74\u6DAC\u6DE9\u6DE2\u6DB7\u6DF6\u6DD4\u6E00\u6DC8\u6DE0\u6DDF\u6DD6\u6DBE\u6DE5\u6DDC\u6DDD\u6DDB\u6DF4\u6DCA\u6DBD\u6DED\u6DF0\u6DBA\u6DD5\u6DC2\u6DCF\u6DC9"],
      ["d640", "\u6DD0\u6DF2\u6DD3\u6DFD\u6DD7\u6DCD\u6DE3\u6DBB\u70FA\u710D\u70F7\u7117\u70F4\u710C\u70F0\u7104\u70F3\u7110\u70FC\u70FF\u7106\u7113\u7100\u70F8\u70F6\u710B\u7102\u710E\u727E\u727B\u727C\u727F\u731D\u7317\u7307\u7311\u7318\u730A\u7308\u72FF\u730F\u731E\u7388\u73F6\u73F8\u73F5\u7404\u7401\u73FD\u7407\u7400\u73FA\u73FC\u73FF\u740C\u740B\u73F4\u7408\u7564\u7563\u75CE\u75D2\u75CF"],
      ["d6a1", "\u75CB\u75CC\u75D1\u75D0\u768F\u7689\u76D3\u7739\u772F\u772D\u7731\u7732\u7734\u7733\u773D\u7725\u773B\u7735\u7848\u7852\u7849\u784D\u784A\u784C\u7826\u7845\u7850\u7964\u7967\u7969\u796A\u7963\u796B\u7961\u79BB\u79FA\u79F8\u79F6\u79F7\u7A8F\u7A94\u7A90\u7B35\u7B47\u7B34\u7B25\u7B30\u7B22\u7B24\u7B33\u7B18\u7B2A\u7B1D\u7B31\u7B2B\u7B2D\u7B2F\u7B32\u7B38\u7B1A\u7B23\u7C94\u7C98\u7C96\u7CA3\u7D35\u7D3D\u7D38\u7D36\u7D3A\u7D45\u7D2C\u7D29\u7D41\u7D47\u7D3E\u7D3F\u7D4A\u7D3B\u7D28\u7F63\u7F95\u7F9C\u7F9D\u7F9B\u7FCA\u7FCB\u7FCD\u7FD0\u7FD1\u7FC7\u7FCF\u7FC9\u801F"],
      ["d740", "\u801E\u801B\u8047\u8043\u8048\u8118\u8125\u8119\u811B\u812D\u811F\u812C\u811E\u8121\u8115\u8127\u811D\u8122\u8211\u8238\u8233\u823A\u8234\u8232\u8274\u8390\u83A3\u83A8\u838D\u837A\u8373\u83A4\u8374\u838F\u8381\u8395\u8399\u8375\u8394\u83A9\u837D\u8383\u838C\u839D\u839B\u83AA\u838B\u837E\u83A5\u83AF\u8388\u8397\u83B0\u837F\u83A6\u8387\u83AE\u8376\u839A\u8659\u8656\u86BF\u86B7"],
      ["d7a1", "\u86C2\u86C1\u86C5\u86BA\u86B0\u86C8\u86B9\u86B3\u86B8\u86CC\u86B4\u86BB\u86BC\u86C3\u86BD\u86BE\u8852\u8889\u8895\u88A8\u88A2\u88AA\u889A\u8891\u88A1\u889F\u8898\u88A7\u8899\u889B\u8897\u88A4\u88AC\u888C\u8893\u888E\u8982\u89D6\u89D9\u89D5\u8A30\u8A27\u8A2C\u8A1E\u8C39\u8C3B\u8C5C\u8C5D\u8C7D\u8CA5\u8D7D\u8D7B\u8D79\u8DBC\u8DC2\u8DB9\u8DBF\u8DC1\u8ED8\u8EDE\u8EDD\u8EDC\u8ED7\u8EE0\u8EE1\u9024\u900B\u9011\u901C\u900C\u9021\u90EF\u90EA\u90F0\u90F4\u90F2\u90F3\u90D4\u90EB\u90EC\u90E9\u9156\u9158\u915A\u9153\u9155\u91EC\u91F4\u91F1\u91F3\u91F8\u91E4\u91F9\u91EA"],
      ["d840", "\u91EB\u91F7\u91E8\u91EE\u957A\u9586\u9588\u967C\u966D\u966B\u9671\u966F\u96BF\u976A\u9804\u98E5\u9997\u509B\u5095\u5094\u509E\u508B\u50A3\u5083\u508C\u508E\u509D\u5068\u509C\u5092\u5082\u5087\u515F\u51D4\u5312\u5311\u53A4\u53A7\u5591\u55A8\u55A5\u55AD\u5577\u5645\u55A2\u5593\u5588\u558F\u55B5\u5581\u55A3\u5592\u55A4\u557D\u558C\u55A6\u557F\u5595\u55A1\u558E\u570C\u5829\u5837"],
      ["d8a1", "\u5819\u581E\u5827\u5823\u5828\u57F5\u5848\u5825\u581C\u581B\u5833\u583F\u5836\u582E\u5839\u5838\u582D\u582C\u583B\u5961\u5AAF\u5A94\u5A9F\u5A7A\u5AA2\u5A9E\u5A78\u5AA6\u5A7C\u5AA5\u5AAC\u5A95\u5AAE\u5A37\u5A84\u5A8A\u5A97\u5A83\u5A8B\u5AA9\u5A7B\u5A7D\u5A8C\u5A9C\u5A8F\u5A93\u5A9D\u5BEA\u5BCD\u5BCB\u5BD4\u5BD1\u5BCA\u5BCE\u5C0C\u5C30\u5D37\u5D43\u5D6B\u5D41\u5D4B\u5D3F\u5D35\u5D51\u5D4E\u5D55\u5D33\u5D3A\u5D52\u5D3D\u5D31\u5D59\u5D42\u5D39\u5D49\u5D38\u5D3C\u5D32\u5D36\u5D40\u5D45\u5E44\u5E41\u5F58\u5FA6\u5FA5\u5FAB\u60C9\u60B9\u60CC\u60E2\u60CE\u60C4\u6114"],
      ["d940", "\u60F2\u610A\u6116\u6105\u60F5\u6113\u60F8\u60FC\u60FE\u60C1\u6103\u6118\u611D\u6110\u60FF\u6104\u610B\u624A\u6394\u63B1\u63B0\u63CE\u63E5\u63E8\u63EF\u63C3\u649D\u63F3\u63CA\u63E0\u63F6\u63D5\u63F2\u63F5\u6461\u63DF\u63BE\u63DD\u63DC\u63C4\u63D8\u63D3\u63C2\u63C7\u63CC\u63CB\u63C8\u63F0\u63D7\u63D9\u6532\u6567\u656A\u6564\u655C\u6568\u6565\u658C\u659D\u659E\u65AE\u65D0\u65D2"],
      ["d9a1", "\u667C\u666C\u667B\u6680\u6671\u6679\u666A\u6672\u6701\u690C\u68D3\u6904\u68DC\u692A\u68EC\u68EA\u68F1\u690F\u68D6\u68F7\u68EB\u68E4\u68F6\u6913\u6910\u68F3\u68E1\u6907\u68CC\u6908\u6970\u68B4\u6911\u68EF\u68C6\u6914\u68F8\u68D0\u68FD\u68FC\u68E8\u690B\u690A\u6917\u68CE\u68C8\u68DD\u68DE\u68E6\u68F4\u68D1\u6906\u68D4\u68E9\u6915\u6925\u68C7\u6B39\u6B3B\u6B3F\u6B3C\u6B94\u6B97\u6B99\u6B95\u6BBD\u6BF0\u6BF2\u6BF3\u6C30\u6DFC\u6E46\u6E47\u6E1F\u6E49\u6E88\u6E3C\u6E3D\u6E45\u6E62\u6E2B\u6E3F\u6E41\u6E5D\u6E73\u6E1C\u6E33\u6E4B\u6E40\u6E51\u6E3B\u6E03\u6E2E\u6E5E"],
      ["da40", "\u6E68\u6E5C\u6E61\u6E31\u6E28\u6E60\u6E71\u6E6B\u6E39\u6E22\u6E30\u6E53\u6E65\u6E27\u6E78\u6E64\u6E77\u6E55\u6E79\u6E52\u6E66\u6E35\u6E36\u6E5A\u7120\u711E\u712F\u70FB\u712E\u7131\u7123\u7125\u7122\u7132\u711F\u7128\u713A\u711B\u724B\u725A\u7288\u7289\u7286\u7285\u728B\u7312\u730B\u7330\u7322\u7331\u7333\u7327\u7332\u732D\u7326\u7323\u7335\u730C\u742E\u742C\u7430\u742B\u7416"],
      ["daa1", "\u741A\u7421\u742D\u7431\u7424\u7423\u741D\u7429\u7420\u7432\u74FB\u752F\u756F\u756C\u75E7\u75DA\u75E1\u75E6\u75DD\u75DF\u75E4\u75D7\u7695\u7692\u76DA\u7746\u7747\u7744\u774D\u7745\u774A\u774E\u774B\u774C\u77DE\u77EC\u7860\u7864\u7865\u785C\u786D\u7871\u786A\u786E\u7870\u7869\u7868\u785E\u7862\u7974\u7973\u7972\u7970\u7A02\u7A0A\u7A03\u7A0C\u7A04\u7A99\u7AE6\u7AE4\u7B4A\u7B3B\u7B44\u7B48\u7B4C\u7B4E\u7B40\u7B58\u7B45\u7CA2\u7C9E\u7CA8\u7CA1\u7D58\u7D6F\u7D63\u7D53\u7D56\u7D67\u7D6A\u7D4F\u7D6D\u7D5C\u7D6B\u7D52\u7D54\u7D69\u7D51\u7D5F\u7D4E\u7F3E\u7F3F\u7F65"],
      ["db40", "\u7F66\u7FA2\u7FA0\u7FA1\u7FD7\u8051\u804F\u8050\u80FE\u80D4\u8143\u814A\u8152\u814F\u8147\u813D\u814D\u813A\u81E6\u81EE\u81F7\u81F8\u81F9\u8204\u823C\u823D\u823F\u8275\u833B\u83CF\u83F9\u8423\u83C0\u83E8\u8412\u83E7\u83E4\u83FC\u83F6\u8410\u83C6\u83C8\u83EB\u83E3\u83BF\u8401\u83DD\u83E5\u83D8\u83FF\u83E1\u83CB\u83CE\u83D6\u83F5\u83C9\u8409\u840F\u83DE\u8411\u8406\u83C2\u83F3"],
      ["dba1", "\u83D5\u83FA\u83C7\u83D1\u83EA\u8413\u83C3\u83EC\u83EE\u83C4\u83FB\u83D7\u83E2\u841B\u83DB\u83FE\u86D8\u86E2\u86E6\u86D3\u86E3\u86DA\u86EA\u86DD\u86EB\u86DC\u86EC\u86E9\u86D7\u86E8\u86D1\u8848\u8856\u8855\u88BA\u88D7\u88B9\u88B8\u88C0\u88BE\u88B6\u88BC\u88B7\u88BD\u88B2\u8901\u88C9\u8995\u8998\u8997\u89DD\u89DA\u89DB\u8A4E\u8A4D\u8A39\u8A59\u8A40\u8A57\u8A58\u8A44\u8A45\u8A52\u8A48\u8A51\u8A4A\u8A4C\u8A4F\u8C5F\u8C81\u8C80\u8CBA\u8CBE\u8CB0\u8CB9\u8CB5\u8D84\u8D80\u8D89\u8DD8\u8DD3\u8DCD\u8DC7\u8DD6\u8DDC\u8DCF\u8DD5\u8DD9\u8DC8\u8DD7\u8DC5\u8EEF\u8EF7\u8EFA"],
      ["dc40", "\u8EF9\u8EE6\u8EEE\u8EE5\u8EF5\u8EE7\u8EE8\u8EF6\u8EEB\u8EF1\u8EEC\u8EF4\u8EE9\u902D\u9034\u902F\u9106\u912C\u9104\u90FF\u90FC\u9108\u90F9\u90FB\u9101\u9100\u9107\u9105\u9103\u9161\u9164\u915F\u9162\u9160\u9201\u920A\u9225\u9203\u921A\u9226\u920F\u920C\u9200\u9212\u91FF\u91FD\u9206\u9204\u9227\u9202\u921C\u9224\u9219\u9217\u9205\u9216\u957B\u958D\u958C\u9590\u9687\u967E\u9688"],
      ["dca1", "\u9689\u9683\u9680\u96C2\u96C8\u96C3\u96F1\u96F0\u976C\u9770\u976E\u9807\u98A9\u98EB\u9CE6\u9EF9\u4E83\u4E84\u4EB6\u50BD\u50BF\u50C6\u50AE\u50C4\u50CA\u50B4\u50C8\u50C2\u50B0\u50C1\u50BA\u50B1\u50CB\u50C9\u50B6\u50B8\u51D7\u527A\u5278\u527B\u527C\u55C3\u55DB\u55CC\u55D0\u55CB\u55CA\u55DD\u55C0\u55D4\u55C4\u55E9\u55BF\u55D2\u558D\u55CF\u55D5\u55E2\u55D6\u55C8\u55F2\u55CD\u55D9\u55C2\u5714\u5853\u5868\u5864\u584F\u584D\u5849\u586F\u5855\u584E\u585D\u5859\u5865\u585B\u583D\u5863\u5871\u58FC\u5AC7\u5AC4\u5ACB\u5ABA\u5AB8\u5AB1\u5AB5\u5AB0\u5ABF\u5AC8\u5ABB\u5AC6"],
      ["dd40", "\u5AB7\u5AC0\u5ACA\u5AB4\u5AB6\u5ACD\u5AB9\u5A90\u5BD6\u5BD8\u5BD9\u5C1F\u5C33\u5D71\u5D63\u5D4A\u5D65\u5D72\u5D6C\u5D5E\u5D68\u5D67\u5D62\u5DF0\u5E4F\u5E4E\u5E4A\u5E4D\u5E4B\u5EC5\u5ECC\u5EC6\u5ECB\u5EC7\u5F40\u5FAF\u5FAD\u60F7\u6149\u614A\u612B\u6145\u6136\u6132\u612E\u6146\u612F\u614F\u6129\u6140\u6220\u9168\u6223\u6225\u6224\u63C5\u63F1\u63EB\u6410\u6412\u6409\u6420\u6424"],
      ["dda1", "\u6433\u6443\u641F\u6415\u6418\u6439\u6437\u6422\u6423\u640C\u6426\u6430\u6428\u6441\u6435\u642F\u640A\u641A\u6440\u6425\u6427\u640B\u63E7\u641B\u642E\u6421\u640E\u656F\u6592\u65D3\u6686\u668C\u6695\u6690\u668B\u668A\u6699\u6694\u6678\u6720\u6966\u695F\u6938\u694E\u6962\u6971\u693F\u6945\u696A\u6939\u6942\u6957\u6959\u697A\u6948\u6949\u6935\u696C\u6933\u693D\u6965\u68F0\u6978\u6934\u6969\u6940\u696F\u6944\u6976\u6958\u6941\u6974\u694C\u693B\u694B\u6937\u695C\u694F\u6951\u6932\u6952\u692F\u697B\u693C\u6B46\u6B45\u6B43\u6B42\u6B48\u6B41\u6B9B\uFA0D\u6BFB\u6BFC"],
      ["de40", "\u6BF9\u6BF7\u6BF8\u6E9B\u6ED6\u6EC8\u6E8F\u6EC0\u6E9F\u6E93\u6E94\u6EA0\u6EB1\u6EB9\u6EC6\u6ED2\u6EBD\u6EC1\u6E9E\u6EC9\u6EB7\u6EB0\u6ECD\u6EA6\u6ECF\u6EB2\u6EBE\u6EC3\u6EDC\u6ED8\u6E99\u6E92\u6E8E\u6E8D\u6EA4\u6EA1\u6EBF\u6EB3\u6ED0\u6ECA\u6E97\u6EAE\u6EA3\u7147\u7154\u7152\u7163\u7160\u7141\u715D\u7162\u7172\u7178\u716A\u7161\u7142\u7158\u7143\u714B\u7170\u715F\u7150\u7153"],
      ["dea1", "\u7144\u714D\u715A\u724F\u728D\u728C\u7291\u7290\u728E\u733C\u7342\u733B\u733A\u7340\u734A\u7349\u7444\u744A\u744B\u7452\u7451\u7457\u7440\u744F\u7450\u744E\u7442\u7446\u744D\u7454\u74E1\u74FF\u74FE\u74FD\u751D\u7579\u7577\u6983\u75EF\u760F\u7603\u75F7\u75FE\u75FC\u75F9\u75F8\u7610\u75FB\u75F6\u75ED\u75F5\u75FD\u7699\u76B5\u76DD\u7755\u775F\u7760\u7752\u7756\u775A\u7769\u7767\u7754\u7759\u776D\u77E0\u7887\u789A\u7894\u788F\u7884\u7895\u7885\u7886\u78A1\u7883\u7879\u7899\u7880\u7896\u787B\u797C\u7982\u797D\u7979\u7A11\u7A18\u7A19\u7A12\u7A17\u7A15\u7A22\u7A13"],
      ["df40", "\u7A1B\u7A10\u7AA3\u7AA2\u7A9E\u7AEB\u7B66\u7B64\u7B6D\u7B74\u7B69\u7B72\u7B65\u7B73\u7B71\u7B70\u7B61\u7B78\u7B76\u7B63\u7CB2\u7CB4\u7CAF\u7D88\u7D86\u7D80\u7D8D\u7D7F\u7D85\u7D7A\u7D8E\u7D7B\u7D83\u7D7C\u7D8C\u7D94\u7D84\u7D7D\u7D92\u7F6D\u7F6B\u7F67\u7F68\u7F6C\u7FA6\u7FA5\u7FA7\u7FDB\u7FDC\u8021\u8164\u8160\u8177\u815C\u8169\u815B\u8162\u8172\u6721\u815E\u8176\u8167\u816F"],
      ["dfa1", "\u8144\u8161\u821D\u8249\u8244\u8240\u8242\u8245\u84F1\u843F\u8456\u8476\u8479\u848F\u848D\u8465\u8451\u8440\u8486\u8467\u8430\u844D\u847D\u845A\u8459\u8474\u8473\u845D\u8507\u845E\u8437\u843A\u8434\u847A\u8443\u8478\u8432\u8445\u8429\u83D9\u844B\u842F\u8442\u842D\u845F\u8470\u8439\u844E\u844C\u8452\u846F\u84C5\u848E\u843B\u8447\u8436\u8433\u8468\u847E\u8444\u842B\u8460\u8454\u846E\u8450\u870B\u8704\u86F7\u870C\u86FA\u86D6\u86F5\u874D\u86F8\u870E\u8709\u8701\u86F6\u870D\u8705\u88D6\u88CB\u88CD\u88CE\u88DE\u88DB\u88DA\u88CC\u88D0\u8985\u899B\u89DF\u89E5\u89E4"],
      ["e040", "\u89E1\u89E0\u89E2\u89DC\u89E6\u8A76\u8A86\u8A7F\u8A61\u8A3F\u8A77\u8A82\u8A84\u8A75\u8A83\u8A81\u8A74\u8A7A\u8C3C\u8C4B\u8C4A\u8C65\u8C64\u8C66\u8C86\u8C84\u8C85\u8CCC\u8D68\u8D69\u8D91\u8D8C\u8D8E\u8D8F\u8D8D\u8D93\u8D94\u8D90\u8D92\u8DF0\u8DE0\u8DEC\u8DF1\u8DEE\u8DD0\u8DE9\u8DE3\u8DE2\u8DE7\u8DF2\u8DEB\u8DF4\u8F06\u8EFF\u8F01\u8F00\u8F05\u8F07\u8F08\u8F02\u8F0B\u9052\u903F"],
      ["e0a1", "\u9044\u9049\u903D\u9110\u910D\u910F\u9111\u9116\u9114\u910B\u910E\u916E\u916F\u9248\u9252\u9230\u923A\u9266\u9233\u9265\u925E\u9283\u922E\u924A\u9246\u926D\u926C\u924F\u9260\u9267\u926F\u9236\u9261\u9270\u9231\u9254\u9263\u9250\u9272\u924E\u9253\u924C\u9256\u9232\u959F\u959C\u959E\u959B\u9692\u9693\u9691\u9697\u96CE\u96FA\u96FD\u96F8\u96F5\u9773\u9777\u9778\u9772\u980F\u980D\u980E\u98AC\u98F6\u98F9\u99AF\u99B2\u99B0\u99B5\u9AAD\u9AAB\u9B5B\u9CEA\u9CED\u9CE7\u9E80\u9EFD\u50E6\u50D4\u50D7\u50E8\u50F3\u50DB\u50EA\u50DD\u50E4\u50D3\u50EC\u50F0\u50EF\u50E3\u50E0"],
      ["e140", "\u51D8\u5280\u5281\u52E9\u52EB\u5330\u53AC\u5627\u5615\u560C\u5612\u55FC\u560F\u561C\u5601\u5613\u5602\u55FA\u561D\u5604\u55FF\u55F9\u5889\u587C\u5890\u5898\u5886\u5881\u587F\u5874\u588B\u587A\u5887\u5891\u588E\u5876\u5882\u5888\u587B\u5894\u588F\u58FE\u596B\u5ADC\u5AEE\u5AE5\u5AD5\u5AEA\u5ADA\u5AED\u5AEB\u5AF3\u5AE2\u5AE0\u5ADB\u5AEC\u5ADE\u5ADD\u5AD9\u5AE8\u5ADF\u5B77\u5BE0"],
      ["e1a1", "\u5BE3\u5C63\u5D82\u5D80\u5D7D\u5D86\u5D7A\u5D81\u5D77\u5D8A\u5D89\u5D88\u5D7E\u5D7C\u5D8D\u5D79\u5D7F\u5E58\u5E59\u5E53\u5ED8\u5ED1\u5ED7\u5ECE\u5EDC\u5ED5\u5ED9\u5ED2\u5ED4\u5F44\u5F43\u5F6F\u5FB6\u612C\u6128\u6141\u615E\u6171\u6173\u6152\u6153\u6172\u616C\u6180\u6174\u6154\u617A\u615B\u6165\u613B\u616A\u6161\u6156\u6229\u6227\u622B\u642B\u644D\u645B\u645D\u6474\u6476\u6472\u6473\u647D\u6475\u6466\u64A6\u644E\u6482\u645E\u645C\u644B\u6453\u6460\u6450\u647F\u643F\u646C\u646B\u6459\u6465\u6477\u6573\u65A0\u66A1\u66A0\u669F\u6705\u6704\u6722\u69B1\u69B6\u69C9"],
      ["e240", "\u69A0\u69CE\u6996\u69B0\u69AC\u69BC\u6991\u6999\u698E\u69A7\u698D\u69A9\u69BE\u69AF\u69BF\u69C4\u69BD\u69A4\u69D4\u69B9\u69CA\u699A\u69CF\u69B3\u6993\u69AA\u69A1\u699E\u69D9\u6997\u6990\u69C2\u69B5\u69A5\u69C6\u6B4A\u6B4D\u6B4B\u6B9E\u6B9F\u6BA0\u6BC3\u6BC4\u6BFE\u6ECE\u6EF5\u6EF1\u6F03\u6F25\u6EF8\u6F37\u6EFB\u6F2E\u6F09\u6F4E\u6F19\u6F1A\u6F27\u6F18\u6F3B\u6F12\u6EED\u6F0A"],
      ["e2a1", "\u6F36\u6F73\u6EF9\u6EEE\u6F2D\u6F40\u6F30\u6F3C\u6F35\u6EEB\u6F07\u6F0E\u6F43\u6F05\u6EFD\u6EF6\u6F39\u6F1C\u6EFC\u6F3A\u6F1F\u6F0D\u6F1E\u6F08\u6F21\u7187\u7190\u7189\u7180\u7185\u7182\u718F\u717B\u7186\u7181\u7197\u7244\u7253\u7297\u7295\u7293\u7343\u734D\u7351\u734C\u7462\u7473\u7471\u7475\u7472\u7467\u746E\u7500\u7502\u7503\u757D\u7590\u7616\u7608\u760C\u7615\u7611\u760A\u7614\u76B8\u7781\u777C\u7785\u7782\u776E\u7780\u776F\u777E\u7783\u78B2\u78AA\u78B4\u78AD\u78A8\u787E\u78AB\u789E\u78A5\u78A0\u78AC\u78A2\u78A4\u7998\u798A\u798B\u7996\u7995\u7994\u7993"],
      ["e340", "\u7997\u7988\u7992\u7990\u7A2B\u7A4A\u7A30\u7A2F\u7A28\u7A26\u7AA8\u7AAB\u7AAC\u7AEE\u7B88\u7B9C\u7B8A\u7B91\u7B90\u7B96\u7B8D\u7B8C\u7B9B\u7B8E\u7B85\u7B98\u5284\u7B99\u7BA4\u7B82\u7CBB\u7CBF\u7CBC\u7CBA\u7DA7\u7DB7\u7DC2\u7DA3\u7DAA\u7DC1\u7DC0\u7DC5\u7D9D\u7DCE\u7DC4\u7DC6\u7DCB\u7DCC\u7DAF\u7DB9\u7D96\u7DBC\u7D9F\u7DA6\u7DAE\u7DA9\u7DA1\u7DC9\u7F73\u7FE2\u7FE3\u7FE5\u7FDE"],
      ["e3a1", "\u8024\u805D\u805C\u8189\u8186\u8183\u8187\u818D\u818C\u818B\u8215\u8497\u84A4\u84A1\u849F\u84BA\u84CE\u84C2\u84AC\u84AE\u84AB\u84B9\u84B4\u84C1\u84CD\u84AA\u849A\u84B1\u84D0\u849D\u84A7\u84BB\u84A2\u8494\u84C7\u84CC\u849B\u84A9\u84AF\u84A8\u84D6\u8498\u84B6\u84CF\u84A0\u84D7\u84D4\u84D2\u84DB\u84B0\u8491\u8661\u8733\u8723\u8728\u876B\u8740\u872E\u871E\u8721\u8719\u871B\u8743\u872C\u8741\u873E\u8746\u8720\u8732\u872A\u872D\u873C\u8712\u873A\u8731\u8735\u8742\u8726\u8727\u8738\u8724\u871A\u8730\u8711\u88F7\u88E7\u88F1\u88F2\u88FA\u88FE\u88EE\u88FC\u88F6\u88FB"],
      ["e440", "\u88F0\u88EC\u88EB\u899D\u89A1\u899F\u899E\u89E9\u89EB\u89E8\u8AAB\u8A99\u8A8B\u8A92\u8A8F\u8A96\u8C3D\u8C68\u8C69\u8CD5\u8CCF\u8CD7\u8D96\u8E09\u8E02\u8DFF\u8E0D\u8DFD\u8E0A\u8E03\u8E07\u8E06\u8E05\u8DFE\u8E00\u8E04\u8F10\u8F11\u8F0E\u8F0D\u9123\u911C\u9120\u9122\u911F\u911D\u911A\u9124\u9121\u911B\u917A\u9172\u9179\u9173\u92A5\u92A4\u9276\u929B\u927A\u92A0\u9294\u92AA\u928D"],
      ["e4a1", "\u92A6\u929A\u92AB\u9279\u9297\u927F\u92A3\u92EE\u928E\u9282\u9295\u92A2\u927D\u9288\u92A1\u928A\u9286\u928C\u9299\u92A7\u927E\u9287\u92A9\u929D\u928B\u922D\u969E\u96A1\u96FF\u9758\u977D\u977A\u977E\u9783\u9780\u9782\u977B\u9784\u9781\u977F\u97CE\u97CD\u9816\u98AD\u98AE\u9902\u9900\u9907\u999D\u999C\u99C3\u99B9\u99BB\u99BA\u99C2\u99BD\u99C7\u9AB1\u9AE3\u9AE7\u9B3E\u9B3F\u9B60\u9B61\u9B5F\u9CF1\u9CF2\u9CF5\u9EA7\u50FF\u5103\u5130\u50F8\u5106\u5107\u50F6\u50FE\u510B\u510C\u50FD\u510A\u528B\u528C\u52F1\u52EF\u5648\u5642\u564C\u5635\u5641\u564A\u5649\u5646\u5658"],
      ["e540", "\u565A\u5640\u5633\u563D\u562C\u563E\u5638\u562A\u563A\u571A\u58AB\u589D\u58B1\u58A0\u58A3\u58AF\u58AC\u58A5\u58A1\u58FF\u5AFF\u5AF4\u5AFD\u5AF7\u5AF6\u5B03\u5AF8\u5B02\u5AF9\u5B01\u5B07\u5B05\u5B0F\u5C67\u5D99\u5D97\u5D9F\u5D92\u5DA2\u5D93\u5D95\u5DA0\u5D9C\u5DA1\u5D9A\u5D9E\u5E69\u5E5D\u5E60\u5E5C\u7DF3\u5EDB\u5EDE\u5EE1\u5F49\u5FB2\u618B\u6183\u6179\u61B1\u61B0\u61A2\u6189"],
      ["e5a1", "\u619B\u6193\u61AF\u61AD\u619F\u6192\u61AA\u61A1\u618D\u6166\u61B3\u622D\u646E\u6470\u6496\u64A0\u6485\u6497\u649C\u648F\u648B\u648A\u648C\u64A3\u649F\u6468\u64B1\u6498\u6576\u657A\u6579\u657B\u65B2\u65B3\u66B5\u66B0\u66A9\u66B2\u66B7\u66AA\u66AF\u6A00\u6A06\u6A17\u69E5\u69F8\u6A15\u69F1\u69E4\u6A20\u69FF\u69EC\u69E2\u6A1B\u6A1D\u69FE\u6A27\u69F2\u69EE\u6A14\u69F7\u69E7\u6A40\u6A08\u69E6\u69FB\u6A0D\u69FC\u69EB\u6A09\u6A04\u6A18\u6A25\u6A0F\u69F6\u6A26\u6A07\u69F4\u6A16\u6B51\u6BA5\u6BA3\u6BA2\u6BA6\u6C01\u6C00\u6BFF\u6C02\u6F41\u6F26\u6F7E\u6F87\u6FC6\u6F92"],
      ["e640", "\u6F8D\u6F89\u6F8C\u6F62\u6F4F\u6F85\u6F5A\u6F96\u6F76\u6F6C\u6F82\u6F55\u6F72\u6F52\u6F50\u6F57\u6F94\u6F93\u6F5D\u6F00\u6F61\u6F6B\u6F7D\u6F67\u6F90\u6F53\u6F8B\u6F69\u6F7F\u6F95\u6F63\u6F77\u6F6A\u6F7B\u71B2\u71AF\u719B\u71B0\u71A0\u719A\u71A9\u71B5\u719D\u71A5\u719E\u71A4\u71A1\u71AA\u719C\u71A7\u71B3\u7298\u729A\u7358\u7352\u735E\u735F\u7360\u735D\u735B\u7361\u735A\u7359"],
      ["e6a1", "\u7362\u7487\u7489\u748A\u7486\u7481\u747D\u7485\u7488\u747C\u7479\u7508\u7507\u757E\u7625\u761E\u7619\u761D\u761C\u7623\u761A\u7628\u761B\u769C\u769D\u769E\u769B\u778D\u778F\u7789\u7788\u78CD\u78BB\u78CF\u78CC\u78D1\u78CE\u78D4\u78C8\u78C3\u78C4\u78C9\u799A\u79A1\u79A0\u799C\u79A2\u799B\u6B76\u7A39\u7AB2\u7AB4\u7AB3\u7BB7\u7BCB\u7BBE\u7BAC\u7BCE\u7BAF\u7BB9\u7BCA\u7BB5\u7CC5\u7CC8\u7CCC\u7CCB\u7DF7\u7DDB\u7DEA\u7DE7\u7DD7\u7DE1\u7E03\u7DFA\u7DE6\u7DF6\u7DF1\u7DF0\u7DEE\u7DDF\u7F76\u7FAC\u7FB0\u7FAD\u7FED\u7FEB\u7FEA\u7FEC\u7FE6\u7FE8\u8064\u8067\u81A3\u819F"],
      ["e740", "\u819E\u8195\u81A2\u8199\u8197\u8216\u824F\u8253\u8252\u8250\u824E\u8251\u8524\u853B\u850F\u8500\u8529\u850E\u8509\u850D\u851F\u850A\u8527\u851C\u84FB\u852B\u84FA\u8508\u850C\u84F4\u852A\u84F2\u8515\u84F7\u84EB\u84F3\u84FC\u8512\u84EA\u84E9\u8516\u84FE\u8528\u851D\u852E\u8502\u84FD\u851E\u84F6\u8531\u8526\u84E7\u84E8\u84F0\u84EF\u84F9\u8518\u8520\u8530\u850B\u8519\u852F\u8662"],
      ["e7a1", "\u8756\u8763\u8764\u8777\u87E1\u8773\u8758\u8754\u875B\u8752\u8761\u875A\u8751\u875E\u876D\u876A\u8750\u874E\u875F\u875D\u876F\u876C\u877A\u876E\u875C\u8765\u874F\u877B\u8775\u8762\u8767\u8769\u885A\u8905\u890C\u8914\u890B\u8917\u8918\u8919\u8906\u8916\u8911\u890E\u8909\u89A2\u89A4\u89A3\u89ED\u89F0\u89EC\u8ACF\u8AC6\u8AB8\u8AD3\u8AD1\u8AD4\u8AD5\u8ABB\u8AD7\u8ABE\u8AC0\u8AC5\u8AD8\u8AC3\u8ABA\u8ABD\u8AD9\u8C3E\u8C4D\u8C8F\u8CE5\u8CDF\u8CD9\u8CE8\u8CDA\u8CDD\u8CE7\u8DA0\u8D9C\u8DA1\u8D9B\u8E20\u8E23\u8E25\u8E24\u8E2E\u8E15\u8E1B\u8E16\u8E11\u8E19\u8E26\u8E27"],
      ["e840", "\u8E14\u8E12\u8E18\u8E13\u8E1C\u8E17\u8E1A\u8F2C\u8F24\u8F18\u8F1A\u8F20\u8F23\u8F16\u8F17\u9073\u9070\u906F\u9067\u906B\u912F\u912B\u9129\u912A\u9132\u9126\u912E\u9185\u9186\u918A\u9181\u9182\u9184\u9180\u92D0\u92C3\u92C4\u92C0\u92D9\u92B6\u92CF\u92F1\u92DF\u92D8\u92E9\u92D7\u92DD\u92CC\u92EF\u92C2\u92E8\u92CA\u92C8\u92CE\u92E6\u92CD\u92D5\u92C9\u92E0\u92DE\u92E7\u92D1\u92D3"],
      ["e8a1", "\u92B5\u92E1\u92C6\u92B4\u957C\u95AC\u95AB\u95AE\u95B0\u96A4\u96A2\u96D3\u9705\u9708\u9702\u975A\u978A\u978E\u9788\u97D0\u97CF\u981E\u981D\u9826\u9829\u9828\u9820\u981B\u9827\u98B2\u9908\u98FA\u9911\u9914\u9916\u9917\u9915\u99DC\u99CD\u99CF\u99D3\u99D4\u99CE\u99C9\u99D6\u99D8\u99CB\u99D7\u99CC\u9AB3\u9AEC\u9AEB\u9AF3\u9AF2\u9AF1\u9B46\u9B43\u9B67\u9B74\u9B71\u9B66\u9B76\u9B75\u9B70\u9B68\u9B64\u9B6C\u9CFC\u9CFA\u9CFD\u9CFF\u9CF7\u9D07\u9D00\u9CF9\u9CFB\u9D08\u9D05\u9D04\u9E83\u9ED3\u9F0F\u9F10\u511C\u5113\u5117\u511A\u5111\u51DE\u5334\u53E1\u5670\u5660\u566E"],
      ["e940", "\u5673\u5666\u5663\u566D\u5672\u565E\u5677\u571C\u571B\u58C8\u58BD\u58C9\u58BF\u58BA\u58C2\u58BC\u58C6\u5B17\u5B19\u5B1B\u5B21\u5B14\u5B13\u5B10\u5B16\u5B28\u5B1A\u5B20\u5B1E\u5BEF\u5DAC\u5DB1\u5DA9\u5DA7\u5DB5\u5DB0\u5DAE\u5DAA\u5DA8\u5DB2\u5DAD\u5DAF\u5DB4\u5E67\u5E68\u5E66\u5E6F\u5EE9\u5EE7\u5EE6\u5EE8\u5EE5\u5F4B\u5FBC\u619D\u61A8\u6196\u61C5\u61B4\u61C6\u61C1\u61CC\u61BA"],
      ["e9a1", "\u61BF\u61B8\u618C\u64D7\u64D6\u64D0\u64CF\u64C9\u64BD\u6489\u64C3\u64DB\u64F3\u64D9\u6533\u657F\u657C\u65A2\u66C8\u66BE\u66C0\u66CA\u66CB\u66CF\u66BD\u66BB\u66BA\u66CC\u6723\u6A34\u6A66\u6A49\u6A67\u6A32\u6A68\u6A3E\u6A5D\u6A6D\u6A76\u6A5B\u6A51\u6A28\u6A5A\u6A3B\u6A3F\u6A41\u6A6A\u6A64\u6A50\u6A4F\u6A54\u6A6F\u6A69\u6A60\u6A3C\u6A5E\u6A56\u6A55\u6A4D\u6A4E\u6A46\u6B55\u6B54\u6B56\u6BA7\u6BAA\u6BAB\u6BC8\u6BC7\u6C04\u6C03\u6C06\u6FAD\u6FCB\u6FA3\u6FC7\u6FBC\u6FCE\u6FC8\u6F5E\u6FC4\u6FBD\u6F9E\u6FCA\u6FA8\u7004\u6FA5\u6FAE\u6FBA\u6FAC\u6FAA\u6FCF\u6FBF\u6FB8"],
      ["ea40", "\u6FA2\u6FC9\u6FAB\u6FCD\u6FAF\u6FB2\u6FB0\u71C5\u71C2\u71BF\u71B8\u71D6\u71C0\u71C1\u71CB\u71D4\u71CA\u71C7\u71CF\u71BD\u71D8\u71BC\u71C6\u71DA\u71DB\u729D\u729E\u7369\u7366\u7367\u736C\u7365\u736B\u736A\u747F\u749A\u74A0\u7494\u7492\u7495\u74A1\u750B\u7580\u762F\u762D\u7631\u763D\u7633\u763C\u7635\u7632\u7630\u76BB\u76E6\u779A\u779D\u77A1\u779C\u779B\u77A2\u77A3\u7795\u7799"],
      ["eaa1", "\u7797\u78DD\u78E9\u78E5\u78EA\u78DE\u78E3\u78DB\u78E1\u78E2\u78ED\u78DF\u78E0\u79A4\u7A44\u7A48\u7A47\u7AB6\u7AB8\u7AB5\u7AB1\u7AB7\u7BDE\u7BE3\u7BE7\u7BDD\u7BD5\u7BE5\u7BDA\u7BE8\u7BF9\u7BD4\u7BEA\u7BE2\u7BDC\u7BEB\u7BD8\u7BDF\u7CD2\u7CD4\u7CD7\u7CD0\u7CD1\u7E12\u7E21\u7E17\u7E0C\u7E1F\u7E20\u7E13\u7E0E\u7E1C\u7E15\u7E1A\u7E22\u7E0B\u7E0F\u7E16\u7E0D\u7E14\u7E25\u7E24\u7F43\u7F7B\u7F7C\u7F7A\u7FB1\u7FEF\u802A\u8029\u806C\u81B1\u81A6\u81AE\u81B9\u81B5\u81AB\u81B0\u81AC\u81B4\u81B2\u81B7\u81A7\u81F2\u8255\u8256\u8257\u8556\u8545\u856B\u854D\u8553\u8561\u8558"],
      ["eb40", "\u8540\u8546\u8564\u8541\u8562\u8544\u8551\u8547\u8563\u853E\u855B\u8571\u854E\u856E\u8575\u8555\u8567\u8560\u858C\u8566\u855D\u8554\u8565\u856C\u8663\u8665\u8664\u879B\u878F\u8797\u8793\u8792\u8788\u8781\u8796\u8798\u8779\u8787\u87A3\u8785\u8790\u8791\u879D\u8784\u8794\u879C\u879A\u8789\u891E\u8926\u8930\u892D\u892E\u8927\u8931\u8922\u8929\u8923\u892F\u892C\u891F\u89F1\u8AE0"],
      ["eba1", "\u8AE2\u8AF2\u8AF4\u8AF5\u8ADD\u8B14\u8AE4\u8ADF\u8AF0\u8AC8\u8ADE\u8AE1\u8AE8\u8AFF\u8AEF\u8AFB\u8C91\u8C92\u8C90\u8CF5\u8CEE\u8CF1\u8CF0\u8CF3\u8D6C\u8D6E\u8DA5\u8DA7\u8E33\u8E3E\u8E38\u8E40\u8E45\u8E36\u8E3C\u8E3D\u8E41\u8E30\u8E3F\u8EBD\u8F36\u8F2E\u8F35\u8F32\u8F39\u8F37\u8F34\u9076\u9079\u907B\u9086\u90FA\u9133\u9135\u9136\u9193\u9190\u9191\u918D\u918F\u9327\u931E\u9308\u931F\u9306\u930F\u937A\u9338\u933C\u931B\u9323\u9312\u9301\u9346\u932D\u930E\u930D\u92CB\u931D\u92FA\u9325\u9313\u92F9\u92F7\u9334\u9302\u9324\u92FF\u9329\u9339\u9335\u932A\u9314\u930C"],
      ["ec40", "\u930B\u92FE\u9309\u9300\u92FB\u9316\u95BC\u95CD\u95BE\u95B9\u95BA\u95B6\u95BF\u95B5\u95BD\u96A9\u96D4\u970B\u9712\u9710\u9799\u9797\u9794\u97F0\u97F8\u9835\u982F\u9832\u9924\u991F\u9927\u9929\u999E\u99EE\u99EC\u99E5\u99E4\u99F0\u99E3\u99EA\u99E9\u99E7\u9AB9\u9ABF\u9AB4\u9ABB\u9AF6\u9AFA\u9AF9\u9AF7\u9B33\u9B80\u9B85\u9B87\u9B7C\u9B7E\u9B7B\u9B82\u9B93\u9B92\u9B90\u9B7A\u9B95"],
      ["eca1", "\u9B7D\u9B88\u9D25\u9D17\u9D20\u9D1E\u9D14\u9D29\u9D1D\u9D18\u9D22\u9D10\u9D19\u9D1F\u9E88\u9E86\u9E87\u9EAE\u9EAD\u9ED5\u9ED6\u9EFA\u9F12\u9F3D\u5126\u5125\u5122\u5124\u5120\u5129\u52F4\u5693\u568C\u568D\u5686\u5684\u5683\u567E\u5682\u567F\u5681\u58D6\u58D4\u58CF\u58D2\u5B2D\u5B25\u5B32\u5B23\u5B2C\u5B27\u5B26\u5B2F\u5B2E\u5B7B\u5BF1\u5BF2\u5DB7\u5E6C\u5E6A\u5FBE\u5FBB\u61C3\u61B5\u61BC\u61E7\u61E0\u61E5\u61E4\u61E8\u61DE\u64EF\u64E9\u64E3\u64EB\u64E4\u64E8\u6581\u6580\u65B6\u65DA\u66D2\u6A8D\u6A96\u6A81\u6AA5\u6A89\u6A9F\u6A9B\u6AA1\u6A9E\u6A87\u6A93\u6A8E"],
      ["ed40", "\u6A95\u6A83\u6AA8\u6AA4\u6A91\u6A7F\u6AA6\u6A9A\u6A85\u6A8C\u6A92\u6B5B\u6BAD\u6C09\u6FCC\u6FA9\u6FF4\u6FD4\u6FE3\u6FDC\u6FED\u6FE7\u6FE6\u6FDE\u6FF2\u6FDD\u6FE2\u6FE8\u71E1\u71F1\u71E8\u71F2\u71E4\u71F0\u71E2\u7373\u736E\u736F\u7497\u74B2\u74AB\u7490\u74AA\u74AD\u74B1\u74A5\u74AF\u7510\u7511\u7512\u750F\u7584\u7643\u7648\u7649\u7647\u76A4\u76E9\u77B5\u77AB\u77B2\u77B7\u77B6"],
      ["eda1", "\u77B4\u77B1\u77A8\u77F0\u78F3\u78FD\u7902\u78FB\u78FC\u78F2\u7905\u78F9\u78FE\u7904\u79AB\u79A8\u7A5C\u7A5B\u7A56\u7A58\u7A54\u7A5A\u7ABE\u7AC0\u7AC1\u7C05\u7C0F\u7BF2\u7C00\u7BFF\u7BFB\u7C0E\u7BF4\u7C0B\u7BF3\u7C02\u7C09\u7C03\u7C01\u7BF8\u7BFD\u7C06\u7BF0\u7BF1\u7C10\u7C0A\u7CE8\u7E2D\u7E3C\u7E42\u7E33\u9848\u7E38\u7E2A\u7E49\u7E40\u7E47\u7E29\u7E4C\u7E30\u7E3B\u7E36\u7E44\u7E3A\u7F45\u7F7F\u7F7E\u7F7D\u7FF4\u7FF2\u802C\u81BB\u81C4\u81CC\u81CA\u81C5\u81C7\u81BC\u81E9\u825B\u825A\u825C\u8583\u8580\u858F\u85A7\u8595\u85A0\u858B\u85A3\u857B\u85A4\u859A\u859E"],
      ["ee40", "\u8577\u857C\u8589\u85A1\u857A\u8578\u8557\u858E\u8596\u8586\u858D\u8599\u859D\u8581\u85A2\u8582\u8588\u8585\u8579\u8576\u8598\u8590\u859F\u8668\u87BE\u87AA\u87AD\u87C5\u87B0\u87AC\u87B9\u87B5\u87BC\u87AE\u87C9\u87C3\u87C2\u87CC\u87B7\u87AF\u87C4\u87CA\u87B4\u87B6\u87BF\u87B8\u87BD\u87DE\u87B2\u8935\u8933\u893C\u893E\u8941\u8952\u8937\u8942\u89AD\u89AF\u89AE\u89F2\u89F3\u8B1E"],
      ["eea1", "\u8B18\u8B16\u8B11\u8B05\u8B0B\u8B22\u8B0F\u8B12\u8B15\u8B07\u8B0D\u8B08\u8B06\u8B1C\u8B13\u8B1A\u8C4F\u8C70\u8C72\u8C71\u8C6F\u8C95\u8C94\u8CF9\u8D6F\u8E4E\u8E4D\u8E53\u8E50\u8E4C\u8E47\u8F43\u8F40\u9085\u907E\u9138\u919A\u91A2\u919B\u9199\u919F\u91A1\u919D\u91A0\u93A1\u9383\u93AF\u9364\u9356\u9347\u937C\u9358\u935C\u9376\u9349\u9350\u9351\u9360\u936D\u938F\u934C\u936A\u9379\u9357\u9355\u9352\u934F\u9371\u9377\u937B\u9361\u935E\u9363\u9367\u9380\u934E\u9359\u95C7\u95C0\u95C9\u95C3\u95C5\u95B7\u96AE\u96B0\u96AC\u9720\u971F\u9718\u971D\u9719\u979A\u97A1\u979C"],
      ["ef40", "\u979E\u979D\u97D5\u97D4\u97F1\u9841\u9844\u984A\u9849\u9845\u9843\u9925\u992B\u992C\u992A\u9933\u9932\u992F\u992D\u9931\u9930\u9998\u99A3\u99A1\u9A02\u99FA\u99F4\u99F7\u99F9\u99F8\u99F6\u99FB\u99FD\u99FE\u99FC\u9A03\u9ABE\u9AFE\u9AFD\u9B01\u9AFC\u9B48\u9B9A\u9BA8\u9B9E\u9B9B\u9BA6\u9BA1\u9BA5\u9BA4\u9B86\u9BA2\u9BA0\u9BAF\u9D33\u9D41\u9D67\u9D36\u9D2E\u9D2F\u9D31\u9D38\u9D30"],
      ["efa1", "\u9D45\u9D42\u9D43\u9D3E\u9D37\u9D40\u9D3D\u7FF5\u9D2D\u9E8A\u9E89\u9E8D\u9EB0\u9EC8\u9EDA\u9EFB\u9EFF\u9F24\u9F23\u9F22\u9F54\u9FA0\u5131\u512D\u512E\u5698\u569C\u5697\u569A\u569D\u5699\u5970\u5B3C\u5C69\u5C6A\u5DC0\u5E6D\u5E6E\u61D8\u61DF\u61ED\u61EE\u61F1\u61EA\u61F0\u61EB\u61D6\u61E9\u64FF\u6504\u64FD\u64F8\u6501\u6503\u64FC\u6594\u65DB\u66DA\u66DB\u66D8\u6AC5\u6AB9\u6ABD\u6AE1\u6AC6\u6ABA\u6AB6\u6AB7\u6AC7\u6AB4\u6AAD\u6B5E\u6BC9\u6C0B\u7007\u700C\u700D\u7001\u7005\u7014\u700E\u6FFF\u7000\u6FFB\u7026\u6FFC\u6FF7\u700A\u7201\u71FF\u71F9\u7203\u71FD\u7376"],
      ["f040", "\u74B8\u74C0\u74B5\u74C1\u74BE\u74B6\u74BB\u74C2\u7514\u7513\u765C\u7664\u7659\u7650\u7653\u7657\u765A\u76A6\u76BD\u76EC\u77C2\u77BA\u78FF\u790C\u7913\u7914\u7909\u7910\u7912\u7911\u79AD\u79AC\u7A5F\u7C1C\u7C29\u7C19\u7C20\u7C1F\u7C2D\u7C1D\u7C26\u7C28\u7C22\u7C25\u7C30\u7E5C\u7E50\u7E56\u7E63\u7E58\u7E62\u7E5F\u7E51\u7E60\u7E57\u7E53\u7FB5\u7FB3\u7FF7\u7FF8\u8075\u81D1\u81D2"],
      ["f0a1", "\u81D0\u825F\u825E\u85B4\u85C6\u85C0\u85C3\u85C2\u85B3\u85B5\u85BD\u85C7\u85C4\u85BF\u85CB\u85CE\u85C8\u85C5\u85B1\u85B6\u85D2\u8624\u85B8\u85B7\u85BE\u8669\u87E7\u87E6\u87E2\u87DB\u87EB\u87EA\u87E5\u87DF\u87F3\u87E4\u87D4\u87DC\u87D3\u87ED\u87D8\u87E3\u87A4\u87D7\u87D9\u8801\u87F4\u87E8\u87DD\u8953\u894B\u894F\u894C\u8946\u8950\u8951\u8949\u8B2A\u8B27\u8B23\u8B33\u8B30\u8B35\u8B47\u8B2F\u8B3C\u8B3E\u8B31\u8B25\u8B37\u8B26\u8B36\u8B2E\u8B24\u8B3B\u8B3D\u8B3A\u8C42\u8C75\u8C99\u8C98\u8C97\u8CFE\u8D04\u8D02\u8D00\u8E5C\u8E62\u8E60\u8E57\u8E56\u8E5E\u8E65\u8E67"],
      ["f140", "\u8E5B\u8E5A\u8E61\u8E5D\u8E69\u8E54\u8F46\u8F47\u8F48\u8F4B\u9128\u913A\u913B\u913E\u91A8\u91A5\u91A7\u91AF\u91AA\u93B5\u938C\u9392\u93B7\u939B\u939D\u9389\u93A7\u938E\u93AA\u939E\u93A6\u9395\u9388\u9399\u939F\u938D\u93B1\u9391\u93B2\u93A4\u93A8\u93B4\u93A3\u93A5\u95D2\u95D3\u95D1\u96B3\u96D7\u96DA\u5DC2\u96DF\u96D8\u96DD\u9723\u9722\u9725\u97AC\u97AE\u97A8\u97AB\u97A4\u97AA"],
      ["f1a1", "\u97A2\u97A5\u97D7\u97D9\u97D6\u97D8\u97FA\u9850\u9851\u9852\u98B8\u9941\u993C\u993A\u9A0F\u9A0B\u9A09\u9A0D\u9A04\u9A11\u9A0A\u9A05\u9A07\u9A06\u9AC0\u9ADC\u9B08\u9B04\u9B05\u9B29\u9B35\u9B4A\u9B4C\u9B4B\u9BC7\u9BC6\u9BC3\u9BBF\u9BC1\u9BB5\u9BB8\u9BD3\u9BB6\u9BC4\u9BB9\u9BBD\u9D5C\u9D53\u9D4F\u9D4A\u9D5B\u9D4B\u9D59\u9D56\u9D4C\u9D57\u9D52\u9D54\u9D5F\u9D58\u9D5A\u9E8E\u9E8C\u9EDF\u9F01\u9F00\u9F16\u9F25\u9F2B\u9F2A\u9F29\u9F28\u9F4C\u9F55\u5134\u5135\u5296\u52F7\u53B4\u56AB\u56AD\u56A6\u56A7\u56AA\u56AC\u58DA\u58DD\u58DB\u5912\u5B3D\u5B3E\u5B3F\u5DC3\u5E70"],
      ["f240", "\u5FBF\u61FB\u6507\u6510\u650D\u6509\u650C\u650E\u6584\u65DE\u65DD\u66DE\u6AE7\u6AE0\u6ACC\u6AD1\u6AD9\u6ACB\u6ADF\u6ADC\u6AD0\u6AEB\u6ACF\u6ACD\u6ADE\u6B60\u6BB0\u6C0C\u7019\u7027\u7020\u7016\u702B\u7021\u7022\u7023\u7029\u7017\u7024\u701C\u702A\u720C\u720A\u7207\u7202\u7205\u72A5\u72A6\u72A4\u72A3\u72A1\u74CB\u74C5\u74B7\u74C3\u7516\u7660\u77C9\u77CA\u77C4\u77F1\u791D\u791B"],
      ["f2a1", "\u7921\u791C\u7917\u791E\u79B0\u7A67\u7A68\u7C33\u7C3C\u7C39\u7C2C\u7C3B\u7CEC\u7CEA\u7E76\u7E75\u7E78\u7E70\u7E77\u7E6F\u7E7A\u7E72\u7E74\u7E68\u7F4B\u7F4A\u7F83\u7F86\u7FB7\u7FFD\u7FFE\u8078\u81D7\u81D5\u8264\u8261\u8263\u85EB\u85F1\u85ED\u85D9\u85E1\u85E8\u85DA\u85D7\u85EC\u85F2\u85F8\u85D8\u85DF\u85E3\u85DC\u85D1\u85F0\u85E6\u85EF\u85DE\u85E2\u8800\u87FA\u8803\u87F6\u87F7\u8809\u880C\u880B\u8806\u87FC\u8808\u87FF\u880A\u8802\u8962\u895A\u895B\u8957\u8961\u895C\u8958\u895D\u8959\u8988\u89B7\u89B6\u89F6\u8B50\u8B48\u8B4A\u8B40\u8B53\u8B56\u8B54\u8B4B\u8B55"],
      ["f340", "\u8B51\u8B42\u8B52\u8B57\u8C43\u8C77\u8C76\u8C9A\u8D06\u8D07\u8D09\u8DAC\u8DAA\u8DAD\u8DAB\u8E6D\u8E78\u8E73\u8E6A\u8E6F\u8E7B\u8EC2\u8F52\u8F51\u8F4F\u8F50\u8F53\u8FB4\u9140\u913F\u91B0\u91AD\u93DE\u93C7\u93CF\u93C2\u93DA\u93D0\u93F9\u93EC\u93CC\u93D9\u93A9\u93E6\u93CA\u93D4\u93EE\u93E3\u93D5\u93C4\u93CE\u93C0\u93D2\u93E7\u957D\u95DA\u95DB\u96E1\u9729\u972B\u972C\u9728\u9726"],
      ["f3a1", "\u97B3\u97B7\u97B6\u97DD\u97DE\u97DF\u985C\u9859\u985D\u9857\u98BF\u98BD\u98BB\u98BE\u9948\u9947\u9943\u99A6\u99A7\u9A1A\u9A15\u9A25\u9A1D\u9A24\u9A1B\u9A22\u9A20\u9A27\u9A23\u9A1E\u9A1C\u9A14\u9AC2\u9B0B\u9B0A\u9B0E\u9B0C\u9B37\u9BEA\u9BEB\u9BE0\u9BDE\u9BE4\u9BE6\u9BE2\u9BF0\u9BD4\u9BD7\u9BEC\u9BDC\u9BD9\u9BE5\u9BD5\u9BE1\u9BDA\u9D77\u9D81\u9D8A\u9D84\u9D88\u9D71\u9D80\u9D78\u9D86\u9D8B\u9D8C\u9D7D\u9D6B\u9D74\u9D75\u9D70\u9D69\u9D85\u9D73\u9D7B\u9D82\u9D6F\u9D79\u9D7F\u9D87\u9D68\u9E94\u9E91\u9EC0\u9EFC\u9F2D\u9F40\u9F41\u9F4D\u9F56\u9F57\u9F58\u5337\u56B2"],
      ["f440", "\u56B5\u56B3\u58E3\u5B45\u5DC6\u5DC7\u5EEE\u5EEF\u5FC0\u5FC1\u61F9\u6517\u6516\u6515\u6513\u65DF\u66E8\u66E3\u66E4\u6AF3\u6AF0\u6AEA\u6AE8\u6AF9\u6AF1\u6AEE\u6AEF\u703C\u7035\u702F\u7037\u7034\u7031\u7042\u7038\u703F\u703A\u7039\u7040\u703B\u7033\u7041\u7213\u7214\u72A8\u737D\u737C\u74BA\u76AB\u76AA\u76BE\u76ED\u77CC\u77CE\u77CF\u77CD\u77F2\u7925\u7923\u7927\u7928\u7924\u7929"],
      ["f4a1", "\u79B2\u7A6E\u7A6C\u7A6D\u7AF7\u7C49\u7C48\u7C4A\u7C47\u7C45\u7CEE\u7E7B\u7E7E\u7E81\u7E80\u7FBA\u7FFF\u8079\u81DB\u81D9\u820B\u8268\u8269\u8622\u85FF\u8601\u85FE\u861B\u8600\u85F6\u8604\u8609\u8605\u860C\u85FD\u8819\u8810\u8811\u8817\u8813\u8816\u8963\u8966\u89B9\u89F7\u8B60\u8B6A\u8B5D\u8B68\u8B63\u8B65\u8B67\u8B6D\u8DAE\u8E86\u8E88\u8E84\u8F59\u8F56\u8F57\u8F55\u8F58\u8F5A\u908D\u9143\u9141\u91B7\u91B5\u91B2\u91B3\u940B\u9413\u93FB\u9420\u940F\u9414\u93FE\u9415\u9410\u9428\u9419\u940D\u93F5\u9400\u93F7\u9407\u940E\u9416\u9412\u93FA\u9409\u93F8\u940A\u93FF"],
      ["f540", "\u93FC\u940C\u93F6\u9411\u9406\u95DE\u95E0\u95DF\u972E\u972F\u97B9\u97BB\u97FD\u97FE\u9860\u9862\u9863\u985F\u98C1\u98C2\u9950\u994E\u9959\u994C\u994B\u9953\u9A32\u9A34\u9A31\u9A2C\u9A2A\u9A36\u9A29\u9A2E\u9A38\u9A2D\u9AC7\u9ACA\u9AC6\u9B10\u9B12\u9B11\u9C0B\u9C08\u9BF7\u9C05\u9C12\u9BF8\u9C40\u9C07\u9C0E\u9C06\u9C17\u9C14\u9C09\u9D9F\u9D99\u9DA4\u9D9D\u9D92\u9D98\u9D90\u9D9B"],
      ["f5a1", "\u9DA0\u9D94\u9D9C\u9DAA\u9D97\u9DA1\u9D9A\u9DA2\u9DA8\u9D9E\u9DA3\u9DBF\u9DA9\u9D96\u9DA6\u9DA7\u9E99\u9E9B\u9E9A\u9EE5\u9EE4\u9EE7\u9EE6\u9F30\u9F2E\u9F5B\u9F60\u9F5E\u9F5D\u9F59\u9F91\u513A\u5139\u5298\u5297\u56C3\u56BD\u56BE\u5B48\u5B47\u5DCB\u5DCF\u5EF1\u61FD\u651B\u6B02\u6AFC\u6B03\u6AF8\u6B00\u7043\u7044\u704A\u7048\u7049\u7045\u7046\u721D\u721A\u7219\u737E\u7517\u766A\u77D0\u792D\u7931\u792F\u7C54\u7C53\u7CF2\u7E8A\u7E87\u7E88\u7E8B\u7E86\u7E8D\u7F4D\u7FBB\u8030\u81DD\u8618\u862A\u8626\u861F\u8623\u861C\u8619\u8627\u862E\u8621\u8620\u8629\u861E\u8625"],
      ["f640", "\u8829\u881D\u881B\u8820\u8824\u881C\u882B\u884A\u896D\u8969\u896E\u896B\u89FA\u8B79\u8B78\u8B45\u8B7A\u8B7B\u8D10\u8D14\u8DAF\u8E8E\u8E8C\u8F5E\u8F5B\u8F5D\u9146\u9144\u9145\u91B9\u943F\u943B\u9436\u9429\u943D\u943C\u9430\u9439\u942A\u9437\u942C\u9440\u9431\u95E5\u95E4\u95E3\u9735\u973A\u97BF\u97E1\u9864\u98C9\u98C6\u98C0\u9958\u9956\u9A39\u9A3D\u9A46\u9A44\u9A42\u9A41\u9A3A"],
      ["f6a1", "\u9A3F\u9ACD\u9B15\u9B17\u9B18\u9B16\u9B3A\u9B52\u9C2B\u9C1D\u9C1C\u9C2C\u9C23\u9C28\u9C29\u9C24\u9C21\u9DB7\u9DB6\u9DBC\u9DC1\u9DC7\u9DCA\u9DCF\u9DBE\u9DC5\u9DC3\u9DBB\u9DB5\u9DCE\u9DB9\u9DBA\u9DAC\u9DC8\u9DB1\u9DAD\u9DCC\u9DB3\u9DCD\u9DB2\u9E7A\u9E9C\u9EEB\u9EEE\u9EED\u9F1B\u9F18\u9F1A\u9F31\u9F4E\u9F65\u9F64\u9F92\u4EB9\u56C6\u56C5\u56CB\u5971\u5B4B\u5B4C\u5DD5\u5DD1\u5EF2\u6521\u6520\u6526\u6522\u6B0B\u6B08\u6B09\u6C0D\u7055\u7056\u7057\u7052\u721E\u721F\u72A9\u737F\u74D8\u74D5\u74D9\u74D7\u766D\u76AD\u7935\u79B4\u7A70\u7A71\u7C57\u7C5C\u7C59\u7C5B\u7C5A"],
      ["f740", "\u7CF4\u7CF1\u7E91\u7F4F\u7F87\u81DE\u826B\u8634\u8635\u8633\u862C\u8632\u8636\u882C\u8828\u8826\u882A\u8825\u8971\u89BF\u89BE\u89FB\u8B7E\u8B84\u8B82\u8B86\u8B85\u8B7F\u8D15\u8E95\u8E94\u8E9A\u8E92\u8E90\u8E96\u8E97\u8F60\u8F62\u9147\u944C\u9450\u944A\u944B\u944F\u9447\u9445\u9448\u9449\u9446\u973F\u97E3\u986A\u9869\u98CB\u9954\u995B\u9A4E\u9A53\u9A54\u9A4C\u9A4F\u9A48\u9A4A"],
      ["f7a1", "\u9A49\u9A52\u9A50\u9AD0\u9B19\u9B2B\u9B3B\u9B56\u9B55\u9C46\u9C48\u9C3F\u9C44\u9C39\u9C33\u9C41\u9C3C\u9C37\u9C34\u9C32\u9C3D\u9C36\u9DDB\u9DD2\u9DDE\u9DDA\u9DCB\u9DD0\u9DDC\u9DD1\u9DDF\u9DE9\u9DD9\u9DD8\u9DD6\u9DF5\u9DD5\u9DDD\u9EB6\u9EF0\u9F35\u9F33\u9F32\u9F42\u9F6B\u9F95\u9FA2\u513D\u5299\u58E8\u58E7\u5972\u5B4D\u5DD8\u882F\u5F4F\u6201\u6203\u6204\u6529\u6525\u6596\u66EB\u6B11\u6B12\u6B0F\u6BCA\u705B\u705A\u7222\u7382\u7381\u7383\u7670\u77D4\u7C67\u7C66\u7E95\u826C\u863A\u8640\u8639\u863C\u8631\u863B\u863E\u8830\u8832\u882E\u8833\u8976\u8974\u8973\u89FE"],
      ["f840", "\u8B8C\u8B8E\u8B8B\u8B88\u8C45\u8D19\u8E98\u8F64\u8F63\u91BC\u9462\u9455\u945D\u9457\u945E\u97C4\u97C5\u9800\u9A56\u9A59\u9B1E\u9B1F\u9B20\u9C52\u9C58\u9C50\u9C4A\u9C4D\u9C4B\u9C55\u9C59\u9C4C\u9C4E\u9DFB\u9DF7\u9DEF\u9DE3\u9DEB\u9DF8\u9DE4\u9DF6\u9DE1\u9DEE\u9DE6\u9DF2\u9DF0\u9DE2\u9DEC\u9DF4\u9DF3\u9DE8\u9DED\u9EC2\u9ED0\u9EF2\u9EF3\u9F06\u9F1C\u9F38\u9F37\u9F36\u9F43\u9F4F"],
      ["f8a1", "\u9F71\u9F70\u9F6E\u9F6F\u56D3\u56CD\u5B4E\u5C6D\u652D\u66ED\u66EE\u6B13\u705F\u7061\u705D\u7060\u7223\u74DB\u74E5\u77D5\u7938\u79B7\u79B6\u7C6A\u7E97\u7F89\u826D\u8643\u8838\u8837\u8835\u884B\u8B94\u8B95\u8E9E\u8E9F\u8EA0\u8E9D\u91BE\u91BD\u91C2\u946B\u9468\u9469\u96E5\u9746\u9743\u9747\u97C7\u97E5\u9A5E\u9AD5\u9B59\u9C63\u9C67\u9C66\u9C62\u9C5E\u9C60\u9E02\u9DFE\u9E07\u9E03\u9E06\u9E05\u9E00\u9E01\u9E09\u9DFF\u9DFD\u9E04\u9EA0\u9F1E\u9F46\u9F74\u9F75\u9F76\u56D4\u652E\u65B8\u6B18\u6B19\u6B17\u6B1A\u7062\u7226\u72AA\u77D8\u77D9\u7939\u7C69\u7C6B\u7CF6\u7E9A"],
      ["f940", "\u7E98\u7E9B\u7E99\u81E0\u81E1\u8646\u8647\u8648\u8979\u897A\u897C\u897B\u89FF\u8B98\u8B99\u8EA5\u8EA4\u8EA3\u946E\u946D\u946F\u9471\u9473\u9749\u9872\u995F\u9C68\u9C6E\u9C6D\u9E0B\u9E0D\u9E10\u9E0F\u9E12\u9E11\u9EA1\u9EF5\u9F09\u9F47\u9F78\u9F7B\u9F7A\u9F79\u571E\u7066\u7C6F\u883C\u8DB2\u8EA6\u91C3\u9474\u9478\u9476\u9475\u9A60\u9C74\u9C73\u9C71\u9C75\u9E14\u9E13\u9EF6\u9F0A"],
      ["f9a1", "\u9FA4\u7068\u7065\u7CF7\u866A\u883E\u883D\u883F\u8B9E\u8C9C\u8EA9\u8EC9\u974B\u9873\u9874\u98CC\u9961\u99AB\u9A64\u9A66\u9A67\u9B24\u9E15\u9E17\u9F48\u6207\u6B1E\u7227\u864C\u8EA8\u9482\u9480\u9481\u9A69\u9A68\u9B2E\u9E19\u7229\u864B\u8B9F\u9483\u9C79\u9EB7\u7675\u9A6B\u9C7A\u9E1D\u7069\u706A\u9EA4\u9F7E\u9F49\u9F98\u7881\u92B9\u88CF\u58BB\u6052\u7CA7\u5AFA\u2554\u2566\u2557\u2560\u256C\u2563\u255A\u2569\u255D\u2552\u2564\u2555\u255E\u256A\u2561\u2558\u2567\u255B\u2553\u2565\u2556\u255F\u256B\u2562\u2559\u2568\u255C\u2551\u2550\u256D\u256E\u2570\u256F\u2593"]
    ];
  }
});

// ../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/tables/big5-added.json
var require_big5_added = __commonJS({
  "../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/tables/big5-added.json"(exports, module2) {
    module2.exports = [
      ["8740", "\u43F0\u4C32\u4603\u45A6\u4578\u{27267}\u4D77\u45B3\u{27CB1}\u4CE2\u{27CC5}\u3B95\u4736\u4744\u4C47\u4C40\u{242BF}\u{23617}\u{27352}\u{26E8B}\u{270D2}\u4C57\u{2A351}\u474F\u45DA\u4C85\u{27C6C}\u4D07\u4AA4\u46A1\u{26B23}\u7225\u{25A54}\u{21A63}\u{23E06}\u{23F61}\u664D\u56FB"],
      ["8767", "\u7D95\u591D\u{28BB9}\u3DF4\u9734\u{27BEF}\u5BDB\u{21D5E}\u5AA4\u3625\u{29EB0}\u5AD1\u5BB7\u5CFC\u676E\u8593\u{29945}\u7461\u749D\u3875\u{21D53}\u{2369E}\u{26021}\u3EEC"],
      ["87a1", "\u{258DE}\u3AF5\u7AFC\u9F97\u{24161}\u{2890D}\u{231EA}\u{20A8A}\u{2325E}\u430A\u8484\u9F96\u942F\u4930\u8613\u5896\u974A\u9218\u79D0\u7A32\u6660\u6A29\u889D\u744C\u7BC5\u6782\u7A2C\u524F\u9046\u34E6\u73C4\u{25DB9}\u74C6\u9FC7\u57B3\u492F\u544C\u4131\u{2368E}\u5818\u7A72\u{27B65}\u8B8F\u46AE\u{26E88}\u4181\u{25D99}\u7BAE\u{224BC}\u9FC8\u{224C1}\u{224C9}\u{224CC}\u9FC9\u8504\u{235BB}\u40B4\u9FCA\u44E1\u{2ADFF}\u62C1\u706E\u9FCB"],
      ["8840", "\u31C0", 4, "\u{2010C}\u31C5\u{200D1}\u{200CD}\u31C6\u31C7\u{200CB}\u{21FE8}\u31C8\u{200CA}\u31C9\u31CA\u31CB\u31CC\u{2010E}\u31CD\u31CE\u0100\xC1\u01CD\xC0\u0112\xC9\u011A\xC8\u014C\xD3\u01D1\xD2\u0FFF\xCA\u0304\u1EBE\u0FFF\xCA\u030C\u1EC0\xCA\u0101\xE1\u01CE\xE0\u0251\u0113\xE9\u011B\xE8\u012B\xED\u01D0\xEC\u014D\xF3\u01D2\xF2\u016B\xFA\u01D4\xF9\u01D6\u01D8\u01DA"],
      ["88a1", "\u01DC\xFC\u0FFF\xEA\u0304\u1EBF\u0FFF\xEA\u030C\u1EC1\xEA\u0261\u23DA\u23DB"],
      ["8940", "\u{2A3A9}\u{21145}"],
      ["8943", "\u650A"],
      ["8946", "\u4E3D\u6EDD\u9D4E\u91DF"],
      ["894c", "\u{27735}\u6491\u4F1A\u4F28\u4FA8\u5156\u5174\u519C\u51E4\u52A1\u52A8\u533B\u534E\u53D1\u53D8\u56E2\u58F0\u5904\u5907\u5932\u5934\u5B66\u5B9E\u5B9F\u5C9A\u5E86\u603B\u6589\u67FE\u6804\u6865\u6D4E\u70BC\u7535\u7EA4\u7EAC\u7EBA\u7EC7\u7ECF\u7EDF\u7F06\u7F37\u827A\u82CF\u836F\u89C6\u8BBE\u8BE2\u8F66\u8F67\u8F6E"],
      ["89a1", "\u7411\u7CFC\u7DCD\u6946\u7AC9\u5227"],
      ["89ab", "\u918C\u78B8\u915E\u80BC"],
      ["89b0", "\u8D0B\u80F6\u{209E7}"],
      ["89b5", "\u809F\u9EC7\u4CCD\u9DC9\u9E0C\u4C3E\u{29DF6}\u{2700E}\u9E0A\u{2A133}\u35C1"],
      ["89c1", "\u6E9A\u823E\u7519"],
      ["89c5", "\u4911\u9A6C\u9A8F\u9F99\u7987\u{2846C}\u{21DCA}\u{205D0}\u{22AE6}\u4E24\u4E81\u4E80\u4E87\u4EBF\u4EEB\u4F37\u344C\u4FBD\u3E48\u5003\u5088\u347D\u3493\u34A5\u5186\u5905\u51DB\u51FC\u5205\u4E89\u5279\u5290\u5327\u35C7\u53A9\u3551\u53B0\u3553\u53C2\u5423\u356D\u3572\u3681\u5493\u54A3\u54B4\u54B9\u54D0\u54EF\u5518\u5523\u5528\u3598\u553F\u35A5\u35BF\u55D7\u35C5"],
      ["8a40", "\u{27D84}\u5525"],
      ["8a43", "\u{20C42}\u{20D15}\u{2512B}\u5590\u{22CC6}\u39EC\u{20341}\u8E46\u{24DB8}\u{294E5}\u4053\u{280BE}\u777A\u{22C38}\u3A34\u47D5\u{2815D}\u{269F2}\u{24DEA}\u64DD\u{20D7C}\u{20FB4}\u{20CD5}\u{210F4}\u648D\u8E7E\u{20E96}\u{20C0B}\u{20F64}\u{22CA9}\u{28256}\u{244D3}"],
      ["8a64", "\u{20D46}\u{29A4D}\u{280E9}\u47F4\u{24EA7}\u{22CC2}\u9AB2\u3A67\u{295F4}\u3FED\u3506\u{252C7}\u{297D4}\u{278C8}\u{22D44}\u9D6E\u9815"],
      ["8a76", "\u43D9\u{260A5}\u64B4\u54E3\u{22D4C}\u{22BCA}\u{21077}\u39FB\u{2106F}"],
      ["8aa1", "\u{266DA}\u{26716}\u{279A0}\u64EA\u{25052}\u{20C43}\u8E68\u{221A1}\u{28B4C}\u{20731}"],
      ["8aac", "\u480B\u{201A9}\u3FFA\u5873\u{22D8D}"],
      ["8ab2", "\u{245C8}\u{204FC}\u{26097}\u{20F4C}\u{20D96}\u5579\u40BB\u43BA"],
      ["8abb", "\u4AB4\u{22A66}\u{2109D}\u81AA\u98F5\u{20D9C}\u6379\u39FE\u{22775}\u8DC0\u56A1\u647C\u3E43"],
      ["8ac9", "\u{2A601}\u{20E09}\u{22ACF}\u{22CC9}"],
      ["8ace", "\u{210C8}\u{239C2}\u3992\u3A06\u{2829B}\u3578\u{25E49}\u{220C7}\u5652\u{20F31}\u{22CB2}\u{29720}\u34BC\u6C3D\u{24E3B}"],
      ["8adf", "\u{27574}\u{22E8B}\u{22208}\u{2A65B}\u{28CCD}\u{20E7A}\u{20C34}\u{2681C}\u7F93\u{210CF}\u{22803}\u{22939}\u35FB\u{251E3}\u{20E8C}\u{20F8D}\u{20EAA}\u3F93\u{20F30}\u{20D47}\u{2114F}\u{20E4C}"],
      ["8af6", "\u{20EAB}\u{20BA9}\u{20D48}\u{210C0}\u{2113D}\u3FF9\u{22696}\u6432\u{20FAD}"],
      ["8b40", "\u{233F4}\u{27639}\u{22BCE}\u{20D7E}\u{20D7F}\u{22C51}\u{22C55}\u3A18\u{20E98}\u{210C7}\u{20F2E}\u{2A632}\u{26B50}\u{28CD2}\u{28D99}\u{28CCA}\u95AA\u54CC\u82C4\u55B9"],
      ["8b55", "\u{29EC3}\u9C26\u9AB6\u{2775E}\u{22DEE}\u7140\u816D\u80EC\u5C1C\u{26572}\u8134\u3797\u535F\u{280BD}\u91B6\u{20EFA}\u{20E0F}\u{20E77}\u{20EFB}\u35DD\u{24DEB}\u3609\u{20CD6}\u56AF\u{227B5}\u{210C9}\u{20E10}\u{20E78}\u{21078}\u{21148}\u{28207}\u{21455}\u{20E79}\u{24E50}\u{22DA4}\u5A54\u{2101D}\u{2101E}\u{210F5}\u{210F6}\u579C\u{20E11}"],
      ["8ba1", "\u{27694}\u{282CD}\u{20FB5}\u{20E7B}\u{2517E}\u3703\u{20FB6}\u{21180}\u{252D8}\u{2A2BD}\u{249DA}\u{2183A}\u{24177}\u{2827C}\u5899\u5268\u361A\u{2573D}\u7BB2\u5B68\u4800\u4B2C\u9F27\u49E7\u9C1F\u9B8D\u{25B74}\u{2313D}\u55FB\u35F2\u5689\u4E28\u5902\u{21BC1}\u{2F878}\u9751\u{20086}\u4E5B\u4EBB\u353E\u5C23\u5F51\u5FC4\u38FA\u624C\u6535\u6B7A\u6C35\u6C3A\u706C\u722B\u4E2C\u72AD\u{248E9}\u7F52\u793B\u7CF9\u7F53\u{2626A}\u34C1"],
      ["8bde", "\u{2634B}\u8002\u8080\u{26612}\u{26951}\u535D\u8864\u89C1\u{278B2}\u8BA0\u8D1D\u9485\u9578\u957F\u95E8\u{28E0F}\u97E6\u9875\u98CE\u98DE\u9963\u{29810}\u9C7C\u9E1F\u9EC4\u6B6F\uF907\u4E37\u{20087}\u961D\u6237\u94A2"],
      ["8c40", "\u503B\u6DFE\u{29C73}\u9FA6\u3DC9\u888F\u{2414E}\u7077\u5CF5\u4B20\u{251CD}\u3559\u{25D30}\u6122\u{28A32}\u8FA7\u91F6\u7191\u6719\u73BA\u{23281}\u{2A107}\u3C8B\u{21980}\u4B10\u78E4\u7402\u51AE\u{2870F}\u4009\u6A63\u{2A2BA}\u4223\u860F\u{20A6F}\u7A2A\u{29947}\u{28AEA}\u9755\u704D\u5324\u{2207E}\u93F4\u76D9\u{289E3}\u9FA7\u77DD\u4EA3\u4FF0\u50BC\u4E2F\u4F17\u9FA8\u5434\u7D8B\u5892\u58D0\u{21DB6}\u5E92\u5E99\u5FC2\u{22712}\u658B"],
      ["8ca1", "\u{233F9}\u6919\u6A43\u{23C63}\u6CFF"],
      ["8ca7", "\u7200\u{24505}\u738C\u3EDB\u{24A13}\u5B15\u74B9\u8B83\u{25CA4}\u{25695}\u7A93\u7BEC\u7CC3\u7E6C\u82F8\u8597\u9FA9\u8890\u9FAA\u8EB9\u9FAB\u8FCF\u855F\u99E0\u9221\u9FAC\u{28DB9}\u{2143F}\u4071\u42A2\u5A1A"],
      ["8cc9", "\u9868\u676B\u4276\u573D"],
      ["8cce", "\u85D6\u{2497B}\u82BF\u{2710D}\u4C81\u{26D74}\u5D7B\u{26B15}\u{26FBE}\u9FAD\u9FAE\u5B96\u9FAF\u66E7\u7E5B\u6E57\u79CA\u3D88\u44C3\u{23256}\u{22796}\u439A\u4536"],
      ["8ce6", "\u5CD5\u{23B1A}\u8AF9\u5C78\u3D12\u{23551}\u5D78\u9FB2\u7157\u4558\u{240EC}\u{21E23}\u4C77\u3978\u344A\u{201A4}\u{26C41}\u8ACC\u4FB4\u{20239}\u59BF\u816C\u9856\u{298FA}\u5F3B"],
      ["8d40", "\u{20B9F}"],
      ["8d42", "\u{221C1}\u{2896D}\u4102\u46BB\u{29079}\u3F07\u9FB3\u{2A1B5}\u40F8\u37D6\u46F7\u{26C46}\u417C\u{286B2}\u{273FF}\u456D\u38D4\u{2549A}\u4561\u451B\u4D89\u4C7B\u4D76\u45EA\u3FC8\u{24B0F}\u3661\u44DE\u44BD\u41ED\u5D3E\u5D48\u5D56\u3DFC\u380F\u5DA4\u5DB9\u3820\u3838\u5E42\u5EBD\u5F25\u5F83\u3908\u3914\u393F\u394D\u60D7\u613D\u5CE5\u3989\u61B7\u61B9\u61CF\u39B8\u622C\u6290\u62E5\u6318\u39F8\u56B1"],
      ["8da1", "\u3A03\u63E2\u63FB\u6407\u645A\u3A4B\u64C0\u5D15\u5621\u9F9F\u3A97\u6586\u3ABD\u65FF\u6653\u3AF2\u6692\u3B22\u6716\u3B42\u67A4\u6800\u3B58\u684A\u6884\u3B72\u3B71\u3B7B\u6909\u6943\u725C\u6964\u699F\u6985\u3BBC\u69D6\u3BDD\u6A65\u6A74\u6A71\u6A82\u3BEC\u6A99\u3BF2\u6AAB\u6AB5\u6AD4\u6AF6\u6B81\u6BC1\u6BEA\u6C75\u6CAA\u3CCB\u6D02\u6D06\u6D26\u6D81\u3CEF\u6DA4\u6DB1\u6E15\u6E18\u6E29\u6E86\u{289C0}\u6EBB\u6EE2\u6EDA\u9F7F\u6EE8\u6EE9\u6F24\u6F34\u3D46\u{23F41}\u6F81\u6FBE\u3D6A\u3D75\u71B7\u5C99\u3D8A\u702C\u3D91\u7050\u7054\u706F\u707F\u7089\u{20325}\u43C1\u35F1\u{20ED8}"],
      ["8e40", "\u{23ED7}\u57BE\u{26ED3}\u713E\u{257E0}\u364E\u69A2\u{28BE9}\u5B74\u7A49\u{258E1}\u{294D9}\u7A65\u7A7D\u{259AC}\u7ABB\u7AB0\u7AC2\u7AC3\u71D1\u{2648D}\u41CA\u7ADA\u7ADD\u7AEA\u41EF\u54B2\u{25C01}\u7B0B\u7B55\u7B29\u{2530E}\u{25CFE}\u7BA2\u7B6F\u839C\u{25BB4}\u{26C7F}\u7BD0\u8421\u7B92\u7BB8\u{25D20}\u3DAD\u{25C65}\u8492\u7BFA\u7C06\u7C35\u{25CC1}\u7C44\u7C83\u{24882}\u7CA6\u667D\u{24578}\u7CC9\u7CC7\u7CE6\u7C74\u7CF3\u7CF5\u7CCE"],
      ["8ea1", "\u7E67\u451D\u{26E44}\u7D5D\u{26ED6}\u748D\u7D89\u7DAB\u7135\u7DB3\u7DD2\u{24057}\u{26029}\u7DE4\u3D13\u7DF5\u{217F9}\u7DE5\u{2836D}\u7E1D\u{26121}\u{2615A}\u7E6E\u7E92\u432B\u946C\u7E27\u7F40\u7F41\u7F47\u7936\u{262D0}\u99E1\u7F97\u{26351}\u7FA3\u{21661}\u{20068}\u455C\u{23766}\u4503\u{2833A}\u7FFA\u{26489}\u8005\u8008\u801D\u8028\u802F\u{2A087}\u{26CC3}\u803B\u803C\u8061\u{22714}\u4989\u{26626}\u{23DE3}\u{266E8}\u6725\u80A7\u{28A48}\u8107\u811A\u58B0\u{226F6}\u6C7F\u{26498}\u{24FB8}\u64E7\u{2148A}\u8218\u{2185E}\u6A53\u{24A65}\u{24A95}\u447A\u8229\u{20B0D}\u{26A52}\u{23D7E}\u4FF9\u{214FD}\u84E2\u8362\u{26B0A}\u{249A7}\u{23530}\u{21773}\u{23DF8}\u82AA\u691B\u{2F994}\u41DB"],
      ["8f40", "\u854B\u82D0\u831A\u{20E16}\u{217B4}\u36C1\u{2317D}\u{2355A}\u827B\u82E2\u8318\u{23E8B}\u{26DA3}\u{26B05}\u{26B97}\u{235CE}\u3DBF\u831D\u55EC\u8385\u450B\u{26DA5}\u83AC\u83C1\u83D3\u347E\u{26ED4}\u6A57\u855A\u3496\u{26E42}\u{22EEF}\u8458\u{25BE4}\u8471\u3DD3\u44E4\u6AA7\u844A\u{23CB5}\u7958\u84A8\u{26B96}\u{26E77}\u{26E43}\u84DE\u840F\u8391\u44A0\u8493\u84E4\u{25C91}\u4240\u{25CC0}\u4543\u8534\u5AF2\u{26E99}\u4527\u8573\u4516\u67BF\u8616"],
      ["8fa1", "\u{28625}\u{2863B}\u85C1\u{27088}\u8602\u{21582}\u{270CD}\u{2F9B2}\u456A\u8628\u3648\u{218A2}\u53F7\u{2739A}\u867E\u8771\u{2A0F8}\u87EE\u{22C27}\u87B1\u87DA\u880F\u5661\u866C\u6856\u460F\u8845\u8846\u{275E0}\u{23DB9}\u{275E4}\u885E\u889C\u465B\u88B4\u88B5\u63C1\u88C5\u7777\u{2770F}\u8987\u898A\u89A6\u89A9\u89A7\u89BC\u{28A25}\u89E7\u{27924}\u{27ABD}\u8A9C\u7793\u91FE\u8A90\u{27A59}\u7AE9\u{27B3A}\u{23F8F}\u4713\u{27B38}\u717C\u8B0C\u8B1F\u{25430}\u{25565}\u8B3F\u8B4C\u8B4D\u8AA9\u{24A7A}\u8B90\u8B9B\u8AAF\u{216DF}\u4615\u884F\u8C9B\u{27D54}\u{27D8F}\u{2F9D4}\u3725\u{27D53}\u8CD6\u{27D98}\u{27DBD}\u8D12\u8D03\u{21910}\u8CDB\u705C\u8D11\u{24CC9}\u3ED0\u8D77"],
      ["9040", "\u8DA9\u{28002}\u{21014}\u{2498A}\u3B7C\u{281BC}\u{2710C}\u7AE7\u8EAD\u8EB6\u8EC3\u92D4\u8F19\u8F2D\u{28365}\u{28412}\u8FA5\u9303\u{2A29F}\u{20A50}\u8FB3\u492A\u{289DE}\u{2853D}\u{23DBB}\u5EF8\u{23262}\u8FF9\u{2A014}\u{286BC}\u{28501}\u{22325}\u3980\u{26ED7}\u9037\u{2853C}\u{27ABE}\u9061\u{2856C}\u{2860B}\u90A8\u{28713}\u90C4\u{286E6}\u90AE\u90FD\u9167\u3AF0\u91A9\u91C4\u7CAC\u{28933}\u{21E89}\u920E\u6C9F\u9241\u9262\u{255B9}\u92B9\u{28AC6}\u{23C9B}\u{28B0C}\u{255DB}"],
      ["90a1", "\u{20D31}\u932C\u936B\u{28AE1}\u{28BEB}\u708F\u5AC3\u{28AE2}\u{28AE5}\u4965\u9244\u{28BEC}\u{28C39}\u{28BFF}\u9373\u945B\u8EBC\u9585\u95A6\u9426\u95A0\u6FF6\u42B9\u{2267A}\u{286D8}\u{2127C}\u{23E2E}\u49DF\u6C1C\u967B\u9696\u416C\u96A3\u{26ED5}\u61DA\u96B6\u78F5\u{28AE0}\u96BD\u53CC\u49A1\u{26CB8}\u{20274}\u{26410}\u{290AF}\u{290E5}\u{24AD1}\u{21915}\u{2330A}\u9731\u8642\u9736\u4A0F\u453D\u4585\u{24AE9}\u7075\u5B41\u971B\u975C\u{291D5}\u9757\u5B4A\u{291EB}\u975F\u9425\u50D0\u{230B7}\u{230BC}\u9789\u979F\u97B1\u97BE\u97C0\u97D2\u97E0\u{2546C}\u97EE\u741C\u{29433}\u97FF\u97F5\u{2941D}\u{2797A}\u4AD1\u9834\u9833\u984B\u9866\u3B0E\u{27175}\u3D51\u{20630}\u{2415C}"],
      ["9140", "\u{25706}\u98CA\u98B7\u98C8\u98C7\u4AFF\u{26D27}\u{216D3}\u55B0\u98E1\u98E6\u98EC\u9378\u9939\u{24A29}\u4B72\u{29857}\u{29905}\u99F5\u9A0C\u9A3B\u9A10\u9A58\u{25725}\u36C4\u{290B1}\u{29BD5}\u9AE0\u9AE2\u{29B05}\u9AF4\u4C0E\u9B14\u9B2D\u{28600}\u5034\u9B34\u{269A8}\u38C3\u{2307D}\u9B50\u9B40\u{29D3E}\u5A45\u{21863}\u9B8E\u{2424B}\u9C02\u9BFF\u9C0C\u{29E68}\u9DD4\u{29FB7}\u{2A192}\u{2A1AB}\u{2A0E1}\u{2A123}\u{2A1DF}\u9D7E\u9D83\u{2A134}\u9E0E\u6888"],
      ["91a1", "\u9DC4\u{2215B}\u{2A193}\u{2A220}\u{2193B}\u{2A233}\u9D39\u{2A0B9}\u{2A2B4}\u9E90\u9E95\u9E9E\u9EA2\u4D34\u9EAA\u9EAF\u{24364}\u9EC1\u3B60\u39E5\u3D1D\u4F32\u37BE\u{28C2B}\u9F02\u9F08\u4B96\u9424\u{26DA2}\u9F17\u9F16\u9F39\u569F\u568A\u9F45\u99B8\u{2908B}\u97F2\u847F\u9F62\u9F69\u7ADC\u9F8E\u7216\u4BBE\u{24975}\u{249BB}\u7177\u{249F8}\u{24348}\u{24A51}\u739E\u{28BDA}\u{218FA}\u799F\u{2897E}\u{28E36}\u9369\u93F3\u{28A44}\u92EC\u9381\u93CB\u{2896C}\u{244B9}\u7217\u3EEB\u7772\u7A43\u70D0\u{24473}\u{243F8}\u717E\u{217EF}\u70A3\u{218BE}\u{23599}\u3EC7\u{21885}\u{2542F}\u{217F8}\u3722\u{216FB}\u{21839}\u36E1\u{21774}\u{218D1}\u{25F4B}\u3723\u{216C0}\u575B\u{24A25}\u{213FE}\u{212A8}"],
      ["9240", "\u{213C6}\u{214B6}\u8503\u{236A6}\u8503\u8455\u{24994}\u{27165}\u{23E31}\u{2555C}\u{23EFB}\u{27052}\u44F4\u{236EE}\u{2999D}\u{26F26}\u67F9\u3733\u3C15\u3DE7\u586C\u{21922}\u6810\u4057\u{2373F}\u{240E1}\u{2408B}\u{2410F}\u{26C21}\u54CB\u569E\u{266B1}\u5692\u{20FDF}\u{20BA8}\u{20E0D}\u93C6\u{28B13}\u939C\u4EF8\u512B\u3819\u{24436}\u4EBC\u{20465}\u{2037F}\u4F4B\u4F8A\u{25651}\u5A68\u{201AB}\u{203CB}\u3999\u{2030A}\u{20414}\u3435\u4F29\u{202C0}\u{28EB3}\u{20275}\u8ADA\u{2020C}\u4E98"],
      ["92a1", "\u50CD\u510D\u4FA2\u4F03\u{24A0E}\u{23E8A}\u4F42\u502E\u506C\u5081\u4FCC\u4FE5\u5058\u50FC\u5159\u515B\u515D\u515E\u6E76\u{23595}\u{23E39}\u{23EBF}\u6D72\u{21884}\u{23E89}\u51A8\u51C3\u{205E0}\u44DD\u{204A3}\u{20492}\u{20491}\u8D7A\u{28A9C}\u{2070E}\u5259\u52A4\u{20873}\u52E1\u936E\u467A\u718C\u{2438C}\u{20C20}\u{249AC}\u{210E4}\u69D1\u{20E1D}\u7479\u3EDE\u7499\u7414\u7456\u7398\u4B8E\u{24ABC}\u{2408D}\u53D0\u3584\u720F\u{240C9}\u55B4\u{20345}\u54CD\u{20BC6}\u571D\u925D\u96F4\u9366\u57DD\u578D\u577F\u363E\u58CB\u5A99\u{28A46}\u{216FA}\u{2176F}\u{21710}\u5A2C\u59B8\u928F\u5A7E\u5ACF\u5A12\u{25946}\u{219F3}\u{21861}\u{24295}\u36F5\u6D05\u7443\u5A21\u{25E83}"],
      ["9340", "\u5A81\u{28BD7}\u{20413}\u93E0\u748C\u{21303}\u7105\u4972\u9408\u{289FB}\u93BD\u37A0\u5C1E\u5C9E\u5E5E\u5E48\u{21996}\u{2197C}\u{23AEE}\u5ECD\u5B4F\u{21903}\u{21904}\u3701\u{218A0}\u36DD\u{216FE}\u36D3\u812A\u{28A47}\u{21DBA}\u{23472}\u{289A8}\u5F0C\u5F0E\u{21927}\u{217AB}\u5A6B\u{2173B}\u5B44\u8614\u{275FD}\u8860\u607E\u{22860}\u{2262B}\u5FDB\u3EB8\u{225AF}\u{225BE}\u{29088}\u{26F73}\u61C0\u{2003E}\u{20046}\u{2261B}\u6199\u6198\u6075\u{22C9B}\u{22D07}\u{246D4}\u{2914D}"],
      ["93a1", "\u6471\u{24665}\u{22B6A}\u3A29\u{22B22}\u{23450}\u{298EA}\u{22E78}\u6337\u{2A45B}\u64B6\u6331\u63D1\u{249E3}\u{22D67}\u62A4\u{22CA1}\u643B\u656B\u6972\u3BF4\u{2308E}\u{232AD}\u{24989}\u{232AB}\u550D\u{232E0}\u{218D9}\u{2943F}\u66CE\u{23289}\u{231B3}\u3AE0\u4190\u{25584}\u{28B22}\u{2558F}\u{216FC}\u{2555B}\u{25425}\u78EE\u{23103}\u{2182A}\u{23234}\u3464\u{2320F}\u{23182}\u{242C9}\u668E\u{26D24}\u666B\u4B93\u6630\u{27870}\u{21DEB}\u6663\u{232D2}\u{232E1}\u661E\u{25872}\u38D1\u{2383A}\u{237BC}\u3B99\u{237A2}\u{233FE}\u74D0\u3B96\u678F\u{2462A}\u68B6\u681E\u3BC4\u6ABE\u3863\u{237D5}\u{24487}\u6A33\u6A52\u6AC9\u6B05\u{21912}\u6511\u6898\u6A4C\u3BD7\u6A7A\u6B57\u{23FC0}\u{23C9A}\u93A0\u92F2\u{28BEA}\u{28ACB}"],
      ["9440", "\u9289\u{2801E}\u{289DC}\u9467\u6DA5\u6F0B\u{249EC}\u6D67\u{23F7F}\u3D8F\u6E04\u{2403C}\u5A3D\u6E0A\u5847\u6D24\u7842\u713B\u{2431A}\u{24276}\u70F1\u7250\u7287\u7294\u{2478F}\u{24725}\u5179\u{24AA4}\u{205EB}\u747A\u{23EF8}\u{2365F}\u{24A4A}\u{24917}\u{25FE1}\u3F06\u3EB1\u{24ADF}\u{28C23}\u{23F35}\u60A7\u3EF3\u74CC\u743C\u9387\u7437\u449F\u{26DEA}\u4551\u7583\u3F63\u{24CD9}\u{24D06}\u3F58\u7555\u7673\u{2A5C6}\u3B19\u7468\u{28ACC}\u{249AB}\u{2498E}\u3AFB"],
      ["94a1", "\u3DCD\u{24A4E}\u3EFF\u{249C5}\u{248F3}\u91FA\u5732\u9342\u{28AE3}\u{21864}\u50DF\u{25221}\u{251E7}\u7778\u{23232}\u770E\u770F\u777B\u{24697}\u{23781}\u3A5E\u{248F0}\u7438\u749B\u3EBF\u{24ABA}\u{24AC7}\u40C8\u{24A96}\u{261AE}\u9307\u{25581}\u781E\u788D\u7888\u78D2\u73D0\u7959\u{27741}\u{256E3}\u410E\u799B\u8496\u79A5\u6A2D\u{23EFA}\u7A3A\u79F4\u416E\u{216E6}\u4132\u9235\u79F1\u{20D4C}\u{2498C}\u{20299}\u{23DBA}\u{2176E}\u3597\u556B\u3570\u36AA\u{201D4}\u{20C0D}\u7AE2\u5A59\u{226F5}\u{25AAF}\u{25A9C}\u5A0D\u{2025B}\u78F0\u5A2A\u{25BC6}\u7AFE\u41F9\u7C5D\u7C6D\u4211\u{25BB3}\u{25EBC}\u{25EA6}\u7CCD\u{249F9}\u{217B0}\u7C8E\u7C7C\u7CAE\u6AB2\u7DDC\u7E07\u7DD3\u7F4E\u{26261}"],
      ["9540", "\u{2615C}\u{27B48}\u7D97\u{25E82}\u426A\u{26B75}\u{20916}\u67D6\u{2004E}\u{235CF}\u57C4\u{26412}\u{263F8}\u{24962}\u7FDD\u7B27\u{2082C}\u{25AE9}\u{25D43}\u7B0C\u{25E0E}\u99E6\u8645\u9A63\u6A1C\u{2343F}\u39E2\u{249F7}\u{265AD}\u9A1F\u{265A0}\u8480\u{27127}\u{26CD1}\u44EA\u8137\u4402\u80C6\u8109\u8142\u{267B4}\u98C3\u{26A42}\u8262\u8265\u{26A51}\u8453\u{26DA7}\u8610\u{2721B}\u5A86\u417F\u{21840}\u5B2B\u{218A1}\u5AE4\u{218D8}\u86A0\u{2F9BC}\u{23D8F}\u882D\u{27422}\u5A02"],
      ["95a1", "\u886E\u4F45\u8887\u88BF\u88E6\u8965\u894D\u{25683}\u8954\u{27785}\u{27784}\u{28BF5}\u{28BD9}\u{28B9C}\u{289F9}\u3EAD\u84A3\u46F5\u46CF\u37F2\u8A3D\u8A1C\u{29448}\u5F4D\u922B\u{24284}\u65D4\u7129\u70C4\u{21845}\u9D6D\u8C9F\u8CE9\u{27DDC}\u599A\u77C3\u59F0\u436E\u36D4\u8E2A\u8EA7\u{24C09}\u8F30\u8F4A\u42F4\u6C58\u6FBB\u{22321}\u489B\u6F79\u6E8B\u{217DA}\u9BE9\u36B5\u{2492F}\u90BB\u9097\u5571\u4906\u91BB\u9404\u{28A4B}\u4062\u{28AFC}\u9427\u{28C1D}\u{28C3B}\u84E5\u8A2B\u9599\u95A7\u9597\u9596\u{28D34}\u7445\u3EC2\u{248FF}\u{24A42}\u{243EA}\u3EE7\u{23225}\u968F\u{28EE7}\u{28E66}\u{28E65}\u3ECC\u{249ED}\u{24A78}\u{23FEE}\u7412\u746B\u3EFC\u9741\u{290B0}"],
      ["9640", "\u6847\u4A1D\u{29093}\u{257DF}\u975D\u9368\u{28989}\u{28C26}\u{28B2F}\u{263BE}\u92BA\u5B11\u8B69\u493C\u73F9\u{2421B}\u979B\u9771\u9938\u{20F26}\u5DC1\u{28BC5}\u{24AB2}\u981F\u{294DA}\u92F6\u{295D7}\u91E5\u44C0\u{28B50}\u{24A67}\u{28B64}\u98DC\u{28A45}\u3F00\u922A\u4925\u8414\u993B\u994D\u{27B06}\u3DFD\u999B\u4B6F\u99AA\u9A5C\u{28B65}\u{258C8}\u6A8F\u9A21\u5AFE\u9A2F\u{298F1}\u4B90\u{29948}\u99BC\u4BBD\u4B97\u937D\u5872\u{21302}\u5822\u{249B8}"],
      ["96a1", "\u{214E8}\u7844\u{2271F}\u{23DB8}\u68C5\u3D7D\u9458\u3927\u6150\u{22781}\u{2296B}\u6107\u9C4F\u9C53\u9C7B\u9C35\u9C10\u9B7F\u9BCF\u{29E2D}\u9B9F\u{2A1F5}\u{2A0FE}\u9D21\u4CAE\u{24104}\u9E18\u4CB0\u9D0C\u{2A1B4}\u{2A0ED}\u{2A0F3}\u{2992F}\u9DA5\u84BD\u{26E12}\u{26FDF}\u{26B82}\u85FC\u4533\u{26DA4}\u{26E84}\u{26DF0}\u8420\u85EE\u{26E00}\u{237D7}\u{26064}\u79E2\u{2359C}\u{23640}\u492D\u{249DE}\u3D62\u93DB\u92BE\u9348\u{202BF}\u78B9\u9277\u944D\u4FE4\u3440\u9064\u{2555D}\u783D\u7854\u78B6\u784B\u{21757}\u{231C9}\u{24941}\u369A\u4F72\u6FDA\u6FD9\u701E\u701E\u5414\u{241B5}\u57BB\u58F3\u578A\u9D16\u57D7\u7134\u34AF\u{241AC}\u71EB\u{26C40}\u{24F97}\u5B28\u{217B5}\u{28A49}"],
      ["9740", "\u610C\u5ACE\u5A0B\u42BC\u{24488}\u372C\u4B7B\u{289FC}\u93BB\u93B8\u{218D6}\u{20F1D}\u8472\u{26CC0}\u{21413}\u{242FA}\u{22C26}\u{243C1}\u5994\u{23DB7}\u{26741}\u7DA8\u{2615B}\u{260A4}\u{249B9}\u{2498B}\u{289FA}\u92E5\u73E2\u3EE9\u74B4\u{28B63}\u{2189F}\u3EE1\u{24AB3}\u6AD8\u73F3\u73FB\u3ED6\u{24A3E}\u{24A94}\u{217D9}\u{24A66}\u{203A7}\u{21424}\u{249E5}\u7448\u{24916}\u70A5\u{24976}\u9284\u73E6\u935F\u{204FE}\u9331\u{28ACE}\u{28A16}\u9386\u{28BE7}\u{255D5}\u4935\u{28A82}\u716B"],
      ["97a1", "\u{24943}\u{20CFF}\u56A4\u{2061A}\u{20BEB}\u{20CB8}\u5502\u79C4\u{217FA}\u7DFE\u{216C2}\u{24A50}\u{21852}\u452E\u9401\u370A\u{28AC0}\u{249AD}\u59B0\u{218BF}\u{21883}\u{27484}\u5AA1\u36E2\u{23D5B}\u36B0\u925F\u5A79\u{28A81}\u{21862}\u9374\u3CCD\u{20AB4}\u4A96\u398A\u50F4\u3D69\u3D4C\u{2139C}\u7175\u42FB\u{28218}\u6E0F\u{290E4}\u44EB\u6D57\u{27E4F}\u7067\u6CAF\u3CD6\u{23FED}\u{23E2D}\u6E02\u6F0C\u3D6F\u{203F5}\u7551\u36BC\u34C8\u4680\u3EDA\u4871\u59C4\u926E\u493E\u8F41\u{28C1C}\u{26BC0}\u5812\u57C8\u36D6\u{21452}\u70FE\u{24362}\u{24A71}\u{22FE3}\u{212B0}\u{223BD}\u68B9\u6967\u{21398}\u{234E5}\u{27BF4}\u{236DF}\u{28A83}\u{237D6}\u{233FA}\u{24C9F}\u6A1A\u{236AD}\u{26CB7}\u843E\u44DF\u44CE"],
      ["9840", "\u{26D26}\u{26D51}\u{26C82}\u{26FDE}\u6F17\u{27109}\u833D\u{2173A}\u83ED\u{26C80}\u{27053}\u{217DB}\u5989\u5A82\u{217B3}\u5A61\u5A71\u{21905}\u{241FC}\u372D\u59EF\u{2173C}\u36C7\u718E\u9390\u669A\u{242A5}\u5A6E\u5A2B\u{24293}\u6A2B\u{23EF9}\u{27736}\u{2445B}\u{242CA}\u711D\u{24259}\u{289E1}\u4FB0\u{26D28}\u5CC2\u{244CE}\u{27E4D}\u{243BD}\u6A0C\u{24256}\u{21304}\u70A6\u7133\u{243E9}\u3DA5\u6CDF\u{2F825}\u{24A4F}\u7E65\u59EB\u5D2F\u3DF3\u5F5C\u{24A5D}\u{217DF}\u7DA4\u8426"],
      ["98a1", "\u5485\u{23AFA}\u{23300}\u{20214}\u577E\u{208D5}\u{20619}\u3FE5\u{21F9E}\u{2A2B6}\u7003\u{2915B}\u5D70\u738F\u7CD3\u{28A59}\u{29420}\u4FC8\u7FE7\u72CD\u7310\u{27AF4}\u7338\u7339\u{256F6}\u7341\u7348\u3EA9\u{27B18}\u906C\u71F5\u{248F2}\u73E1\u81F6\u3ECA\u770C\u3ED1\u6CA2\u56FD\u7419\u741E\u741F\u3EE2\u3EF0\u3EF4\u3EFA\u74D3\u3F0E\u3F53\u7542\u756D\u7572\u758D\u3F7C\u75C8\u75DC\u3FC0\u764D\u3FD7\u7674\u3FDC\u767A\u{24F5C}\u7188\u5623\u8980\u5869\u401D\u7743\u4039\u6761\u4045\u35DB\u7798\u406A\u406F\u5C5E\u77BE\u77CB\u58F2\u7818\u70B9\u781C\u40A8\u7839\u7847\u7851\u7866\u8448\u{25535}\u7933\u6803\u7932\u4103"],
      ["9940", "\u4109\u7991\u7999\u8FBB\u7A06\u8FBC\u4167\u7A91\u41B2\u7ABC\u8279\u41C4\u7ACF\u7ADB\u41CF\u4E21\u7B62\u7B6C\u7B7B\u7C12\u7C1B\u4260\u427A\u7C7B\u7C9C\u428C\u7CB8\u4294\u7CED\u8F93\u70C0\u{20CCF}\u7DCF\u7DD4\u7DD0\u7DFD\u7FAE\u7FB4\u729F\u4397\u8020\u8025\u7B39\u802E\u8031\u8054\u3DCC\u57B4\u70A0\u80B7\u80E9\u43ED\u810C\u732A\u810E\u8112\u7560\u8114\u4401\u3B39\u8156\u8159\u815A"],
      ["99a1", "\u4413\u583A\u817C\u8184\u4425\u8193\u442D\u81A5\u57EF\u81C1\u81E4\u8254\u448F\u82A6\u8276\u82CA\u82D8\u82FF\u44B0\u8357\u9669\u698A\u8405\u70F5\u8464\u60E3\u8488\u4504\u84BE\u84E1\u84F8\u8510\u8538\u8552\u453B\u856F\u8570\u85E0\u4577\u8672\u8692\u86B2\u86EF\u9645\u878B\u4606\u4617\u88AE\u88FF\u8924\u8947\u8991\u{27967}\u8A29\u8A38\u8A94\u8AB4\u8C51\u8CD4\u8CF2\u8D1C\u4798\u585F\u8DC3\u47ED\u4EEE\u8E3A\u55D8\u5754\u8E71\u55F5\u8EB0\u4837\u8ECE\u8EE2\u8EE4\u8EED\u8EF2\u8FB7\u8FC1\u8FCA\u8FCC\u9033\u99C4\u48AD\u98E0\u9213\u491E\u9228\u9258\u926B\u92B1\u92AE\u92BF"],
      ["9a40", "\u92E3\u92EB\u92F3\u92F4\u92FD\u9343\u9384\u93AD\u4945\u4951\u9EBF\u9417\u5301\u941D\u942D\u943E\u496A\u9454\u9479\u952D\u95A2\u49A7\u95F4\u9633\u49E5\u67A0\u4A24\u9740\u4A35\u97B2\u97C2\u5654\u4AE4\u60E8\u98B9\u4B19\u98F1\u5844\u990E\u9919\u51B4\u991C\u9937\u9942\u995D\u9962\u4B70\u99C5\u4B9D\u9A3C\u9B0F\u7A83\u9B69\u9B81\u9BDD\u9BF1\u9BF4\u4C6D\u9C20\u376F\u{21BC2}\u9D49\u9C3A"],
      ["9aa1", "\u9EFE\u5650\u9D93\u9DBD\u9DC0\u9DFC\u94F6\u8FB6\u9E7B\u9EAC\u9EB1\u9EBD\u9EC6\u94DC\u9EE2\u9EF1\u9EF8\u7AC8\u9F44\u{20094}\u{202B7}\u{203A0}\u691A\u94C3\u59AC\u{204D7}\u5840\u94C1\u37B9\u{205D5}\u{20615}\u{20676}\u{216BA}\u5757\u7173\u{20AC2}\u{20ACD}\u{20BBF}\u546A\u{2F83B}\u{20BCB}\u549E\u{20BFB}\u{20C3B}\u{20C53}\u{20C65}\u{20C7C}\u60E7\u{20C8D}\u567A\u{20CB5}\u{20CDD}\u{20CED}\u{20D6F}\u{20DB2}\u{20DC8}\u6955\u9C2F\u87A5\u{20E04}\u{20E0E}\u{20ED7}\u{20F90}\u{20F2D}\u{20E73}\u5C20\u{20FBC}\u5E0B\u{2105C}\u{2104F}\u{21076}\u671E\u{2107B}\u{21088}\u{21096}\u3647\u{210BF}\u{210D3}\u{2112F}\u{2113B}\u5364\u84AD\u{212E3}\u{21375}\u{21336}\u8B81\u{21577}\u{21619}\u{217C3}\u{217C7}\u4E78\u70BB\u{2182D}\u{2196A}"],
      ["9b40", "\u{21A2D}\u{21A45}\u{21C2A}\u{21C70}\u{21CAC}\u{21EC8}\u62C3\u{21ED5}\u{21F15}\u7198\u6855\u{22045}\u69E9\u36C8\u{2227C}\u{223D7}\u{223FA}\u{2272A}\u{22871}\u{2294F}\u82FD\u{22967}\u{22993}\u{22AD5}\u89A5\u{22AE8}\u8FA0\u{22B0E}\u97B8\u{22B3F}\u9847\u9ABD\u{22C4C}"],
      ["9b62", "\u{22C88}\u{22CB7}\u{25BE8}\u{22D08}\u{22D12}\u{22DB7}\u{22D95}\u{22E42}\u{22F74}\u{22FCC}\u{23033}\u{23066}\u{2331F}\u{233DE}\u5FB1\u6648\u66BF\u{27A79}\u{23567}\u{235F3}\u7201\u{249BA}\u77D7\u{2361A}\u{23716}\u7E87\u{20346}\u58B5\u670E"],
      ["9ba1", "\u6918\u{23AA7}\u{27657}\u{25FE2}\u{23E11}\u{23EB9}\u{275FE}\u{2209A}\u48D0\u4AB8\u{24119}\u{28A9A}\u{242EE}\u{2430D}\u{2403B}\u{24334}\u{24396}\u{24A45}\u{205CA}\u51D2\u{20611}\u599F\u{21EA8}\u3BBE\u{23CFF}\u{24404}\u{244D6}\u5788\u{24674}\u399B\u{2472F}\u{285E8}\u{299C9}\u3762\u{221C3}\u8B5E\u{28B4E}\u99D6\u{24812}\u{248FB}\u{24A15}\u7209\u{24AC0}\u{20C78}\u5965\u{24EA5}\u{24F86}\u{20779}\u8EDA\u{2502C}\u528F\u573F\u7171\u{25299}\u{25419}\u{23F4A}\u{24AA7}\u55BC\u{25446}\u{2546E}\u{26B52}\u91D4\u3473\u{2553F}\u{27632}\u{2555E}\u4718\u{25562}\u{25566}\u{257C7}\u{2493F}\u{2585D}\u5066\u34FB\u{233CC}\u60DE\u{25903}\u477C\u{28948}\u{25AAE}\u{25B89}\u{25C06}\u{21D90}\u57A1\u7151\u6FB6\u{26102}\u{27C12}\u9056\u{261B2}\u{24F9A}\u8B62\u{26402}\u{2644A}"],
      ["9c40", "\u5D5B\u{26BF7}\u8F36\u{26484}\u{2191C}\u8AEA\u{249F6}\u{26488}\u{23FEF}\u{26512}\u4BC0\u{265BF}\u{266B5}\u{2271B}\u9465\u{257E1}\u6195\u5A27\u{2F8CD}\u4FBB\u56B9\u{24521}\u{266FC}\u4E6A\u{24934}\u9656\u6D8F\u{26CBD}\u3618\u8977\u{26799}\u{2686E}\u{26411}\u{2685E}\u71DF\u{268C7}\u7B42\u{290C0}\u{20A11}\u{26926}\u9104\u{26939}\u7A45\u9DF0\u{269FA}\u9A26\u{26A2D}\u365F\u{26469}\u{20021}\u7983\u{26A34}\u{26B5B}\u5D2C\u{23519}\u83CF\u{26B9D}\u46D0\u{26CA4}\u753B\u8865\u{26DAE}\u58B6"],
      ["9ca1", "\u371C\u{2258D}\u{2704B}\u{271CD}\u3C54\u{27280}\u{27285}\u9281\u{2217A}\u{2728B}\u9330\u{272E6}\u{249D0}\u6C39\u949F\u{27450}\u{20EF8}\u8827\u88F5\u{22926}\u{28473}\u{217B1}\u6EB8\u{24A2A}\u{21820}\u39A4\u36B9\u5C10\u79E3\u453F\u66B6\u{29CAD}\u{298A4}\u8943\u{277CC}\u{27858}\u56D6\u40DF\u{2160A}\u39A1\u{2372F}\u{280E8}\u{213C5}\u71AD\u8366\u{279DD}\u{291A8}\u5A67\u4CB7\u{270AF}\u{289AB}\u{279FD}\u{27A0A}\u{27B0B}\u{27D66}\u{2417A}\u7B43\u797E\u{28009}\u6FB5\u{2A2DF}\u6A03\u{28318}\u53A2\u{26E07}\u93BF\u6836\u975D\u{2816F}\u{28023}\u{269B5}\u{213ED}\u{2322F}\u{28048}\u5D85\u{28C30}\u{28083}\u5715\u9823\u{28949}\u5DAB\u{24988}\u65BE\u69D5\u53D2\u{24AA5}\u{23F81}\u3C11\u6736\u{28090}\u{280F4}\u{2812E}\u{21FA1}\u{2814F}"],
      ["9d40", "\u{28189}\u{281AF}\u{2821A}\u{28306}\u{2832F}\u{2838A}\u35CA\u{28468}\u{286AA}\u48FA\u63E6\u{28956}\u7808\u9255\u{289B8}\u43F2\u{289E7}\u43DF\u{289E8}\u{28B46}\u{28BD4}\u59F8\u{28C09}\u8F0B\u{28FC5}\u{290EC}\u7B51\u{29110}\u{2913C}\u3DF7\u{2915E}\u{24ACA}\u8FD0\u728F\u568B\u{294E7}\u{295E9}\u{295B0}\u{295B8}\u{29732}\u{298D1}\u{29949}\u{2996A}\u{299C3}\u{29A28}\u{29B0E}\u{29D5A}\u{29D9B}\u7E9F\u{29EF8}\u{29F23}\u4CA4\u9547\u{2A293}\u71A2\u{2A2FF}\u4D91\u9012\u{2A5CB}\u4D9C\u{20C9C}\u8FBE\u55C1"],
      ["9da1", "\u8FBA\u{224B0}\u8FB9\u{24A93}\u4509\u7E7F\u6F56\u6AB1\u4EEA\u34E4\u{28B2C}\u{2789D}\u373A\u8E80\u{217F5}\u{28024}\u{28B6C}\u{28B99}\u{27A3E}\u{266AF}\u3DEB\u{27655}\u{23CB7}\u{25635}\u{25956}\u4E9A\u{25E81}\u{26258}\u56BF\u{20E6D}\u8E0E\u5B6D\u{23E88}\u{24C9E}\u63DE\u62D0\u{217F6}\u{2187B}\u6530\u562D\u{25C4A}\u541A\u{25311}\u3DC6\u{29D98}\u4C7D\u5622\u561E\u7F49\u{25ED8}\u5975\u{23D40}\u8770\u4E1C\u{20FEA}\u{20D49}\u{236BA}\u8117\u9D5E\u8D18\u763B\u9C45\u764E\u77B9\u9345\u5432\u8148\u82F7\u5625\u8132\u8418\u80BD\u55EA\u7962\u5643\u5416\u{20E9D}\u35CE\u5605\u55F1\u66F1\u{282E2}\u362D\u7534\u55F0\u55BA\u5497\u5572\u{20C41}\u{20C96}\u5ED0\u{25148}\u{20E76}\u{22C62}"],
      ["9e40", "\u{20EA2}\u9EAB\u7D5A\u55DE\u{21075}\u629D\u976D\u5494\u8CCD\u71F6\u9176\u63FC\u63B9\u63FE\u5569\u{22B43}\u9C72\u{22EB3}\u519A\u34DF\u{20DA7}\u51A7\u544D\u551E\u5513\u7666\u8E2D\u{2688A}\u75B1\u80B6\u8804\u8786\u88C7\u81B6\u841C\u{210C1}\u44EC\u7304\u{24706}\u5B90\u830B\u{26893}\u567B\u{226F4}\u{27D2F}\u{241A3}\u{27D73}\u{26ED0}\u{272B6}\u9170\u{211D9}\u9208\u{23CFC}\u{2A6A9}\u{20EAC}\u{20EF9}\u7266\u{21CA2}\u474E\u{24FC2}\u{27FF9}\u{20FEB}\u40FA"],
      ["9ea1", "\u9C5D\u651F\u{22DA0}\u48F3\u{247E0}\u{29D7C}\u{20FEC}\u{20E0A}\u6062\u{275A3}\u{20FED}"],
      ["9ead", "\u{26048}\u{21187}\u71A3\u7E8E\u9D50\u4E1A\u4E04\u3577\u5B0D\u6CB2\u5367\u36AC\u39DC\u537D\u36A5\u{24618}\u589A\u{24B6E}\u822D\u544B\u57AA\u{25A95}\u{20979}"],
      ["9ec5", "\u3A52\u{22465}\u7374\u{29EAC}\u4D09\u9BED\u{23CFE}\u{29F30}\u4C5B\u{24FA9}\u{2959E}\u{29FDE}\u845C\u{23DB6}\u{272B2}\u{267B3}\u{23720}\u632E\u7D25\u{23EF7}\u{23E2C}\u3A2A\u9008\u52CC\u3E74\u367A\u45E9\u{2048E}\u7640\u5AF0\u{20EB6}\u787A\u{27F2E}\u58A7\u40BF\u567C\u9B8B\u5D74\u7654\u{2A434}\u9E85\u4CE1\u75F9\u37FB\u6119\u{230DA}\u{243F2}"],
      ["9ef5", "\u565D\u{212A9}\u57A7\u{24963}\u{29E06}\u5234\u{270AE}\u35AD\u6C4A\u9D7C"],
      ["9f40", "\u7C56\u9B39\u57DE\u{2176C}\u5C53\u64D3\u{294D0}\u{26335}\u{27164}\u86AD\u{20D28}\u{26D22}\u{24AE2}\u{20D71}"],
      ["9f4f", "\u51FE\u{21F0F}\u5D8E\u9703\u{21DD1}\u9E81\u904C\u7B1F\u9B02\u5CD1\u7BA3\u6268\u6335\u9AFF\u7BCF\u9B2A\u7C7E\u9B2E\u7C42\u7C86\u9C15\u7BFC\u9B09\u9F17\u9C1B\u{2493E}\u9F5A\u5573\u5BC3\u4FFD\u9E98\u4FF2\u5260\u3E06\u52D1\u5767\u5056\u59B7\u5E12\u97C8\u9DAB\u8F5C\u5469\u97B4\u9940\u97BA\u532C\u6130"],
      ["9fa1", "\u692C\u53DA\u9C0A\u9D02\u4C3B\u9641\u6980\u50A6\u7546\u{2176D}\u99DA\u5273"],
      ["9fae", "\u9159\u9681\u915C"],
      ["9fb2", "\u9151\u{28E97}\u637F\u{26D23}\u6ACA\u5611\u918E\u757A\u6285\u{203FC}\u734F\u7C70\u{25C21}\u{23CFD}"],
      ["9fc1", "\u{24919}\u76D6\u9B9D\u4E2A\u{20CD4}\u83BE\u8842"],
      ["9fc9", "\u5C4A\u69C0\u50ED\u577A\u521F\u5DF5\u4ECE\u6C31\u{201F2}\u4F39\u549C\u54DA\u529A\u8D82\u35FE\u5F0C\u35F3"],
      ["9fdb", "\u6B52\u917C\u9FA5\u9B97\u982E\u98B4\u9ABA\u9EA8\u9E84\u717A\u7B14"],
      ["9fe7", "\u6BFA\u8818\u7F78"],
      ["9feb", "\u5620\u{2A64A}\u8E77\u9F53"],
      ["9ff0", "\u8DD4\u8E4F\u9E1C\u8E01\u6282\u{2837D}\u8E28\u8E75\u7AD3\u{24A77}\u7A3E\u78D8\u6CEA\u8A67\u7607"],
      ["a040", "\u{28A5A}\u9F26\u6CCE\u87D6\u75C3\u{2A2B2}\u7853\u{2F840}\u8D0C\u72E2\u7371\u8B2D\u7302\u74F1\u8CEB\u{24ABB}\u862F\u5FBA\u88A0\u44B7"],
      ["a055", "\u{2183B}\u{26E05}"],
      ["a058", "\u8A7E\u{2251B}"],
      ["a05b", "\u60FD\u7667\u9AD7\u9D44\u936E\u9B8F\u87F5"],
      ["a063", "\u880F\u8CF7\u732C\u9721\u9BB0\u35D6\u72B2\u4C07\u7C51\u994A\u{26159}\u6159\u4C04\u9E96\u617D"],
      ["a073", "\u575F\u616F\u62A6\u6239\u62CE\u3A5C\u61E2\u53AA\u{233F5}\u6364\u6802\u35D2"],
      ["a0a1", "\u5D57\u{28BC2}\u8FDA\u{28E39}"],
      ["a0a6", "\u50D9\u{21D46}\u7906\u5332\u9638\u{20F3B}\u4065"],
      ["a0ae", "\u77FE"],
      ["a0b0", "\u7CC2\u{25F1A}\u7CDA\u7A2D\u8066\u8063\u7D4D\u7505\u74F2\u8994\u821A\u670C\u8062\u{27486}\u805B\u74F0\u8103\u7724\u8989\u{267CC}\u7553\u{26ED1}\u87A9\u87CE\u81C8\u878C\u8A49\u8CAD\u8B43\u772B\u74F8\u84DA\u3635\u69B2\u8DA6"],
      ["a0d4", "\u89A9\u7468\u6DB9\u87C1\u{24011}\u74E7\u3DDB\u7176\u60A4\u619C\u3CD1\u7162\u6077"],
      ["a0e2", "\u7F71\u{28B2D}\u7250\u60E9\u4B7E\u5220\u3C18\u{23CC7}\u{25ED7}\u{27656}\u{25531}\u{21944}\u{212FE}\u{29903}\u{26DDC}\u{270AD}\u5CC1\u{261AD}\u{28A0F}\u{23677}\u{200EE}\u{26846}\u{24F0E}\u4562\u5B1F\u{2634C}\u9F50\u9EA6\u{2626B}"],
      ["a3c0", "\u2400", 31, "\u2421"],
      ["c6a1", "\u2460", 9, "\u2474", 9, "\u2170", 9, "\u4E36\u4E3F\u4E85\u4EA0\u5182\u5196\u51AB\u52F9\u5338\u5369\u53B6\u590A\u5B80\u5DDB\u2F33\u5E7F\u5EF4\u5F50\u5F61\u6534\u65E0\u7592\u7676\u8FB5\u96B6\xA8\u02C6\u30FD\u30FE\u309D\u309E\u3003\u4EDD\u3005\u3006\u3007\u30FC\uFF3B\uFF3D\u273D\u3041", 23],
      ["c740", "\u3059", 58, "\u30A1\u30A2\u30A3\u30A4"],
      ["c7a1", "\u30A5", 81, "\u0410", 5, "\u0401\u0416", 4],
      ["c840", "\u041B", 26, "\u0451\u0436", 25, "\u21E7\u21B8\u21B9\u31CF\u{200CC}\u4E5A\u{2008A}\u5202\u4491"],
      ["c8a1", "\u9FB0\u5188\u9FB1\u{27607}"],
      ["c8cd", "\uFFE2\uFFE4\uFF07\uFF02\u3231\u2116\u2121\u309B\u309C\u2E80\u2E84\u2E86\u2E87\u2E88\u2E8A\u2E8C\u2E8D\u2E95\u2E9C\u2E9D\u2EA5\u2EA7\u2EAA\u2EAC\u2EAE\u2EB6\u2EBC\u2EBE\u2EC6\u2ECA\u2ECC\u2ECD\u2ECF\u2ED6\u2ED7\u2EDE\u2EE3"],
      ["c8f5", "\u0283\u0250\u025B\u0254\u0275\u0153\xF8\u014B\u028A\u026A"],
      ["f9fe", "\uFFED"],
      ["fa40", "\u{20547}\u92DB\u{205DF}\u{23FC5}\u854C\u42B5\u73EF\u51B5\u3649\u{24942}\u{289E4}\u9344\u{219DB}\u82EE\u{23CC8}\u783C\u6744\u62DF\u{24933}\u{289AA}\u{202A0}\u{26BB3}\u{21305}\u4FAB\u{224ED}\u5008\u{26D29}\u{27A84}\u{23600}\u{24AB1}\u{22513}\u5029\u{2037E}\u5FA4\u{20380}\u{20347}\u6EDB\u{2041F}\u507D\u5101\u347A\u510E\u986C\u3743\u8416\u{249A4}\u{20487}\u5160\u{233B4}\u516A\u{20BFF}\u{220FC}\u{202E5}\u{22530}\u{2058E}\u{23233}\u{21983}\u5B82\u877D\u{205B3}\u{23C99}\u51B2\u51B8"],
      ["faa1", "\u9D34\u51C9\u51CF\u51D1\u3CDC\u51D3\u{24AA6}\u51B3\u51E2\u5342\u51ED\u83CD\u693E\u{2372D}\u5F7B\u520B\u5226\u523C\u52B5\u5257\u5294\u52B9\u52C5\u7C15\u8542\u52E0\u860D\u{26B13}\u5305\u{28ADE}\u5549\u6ED9\u{23F80}\u{20954}\u{23FEC}\u5333\u5344\u{20BE2}\u6CCB\u{21726}\u681B\u73D5\u604A\u3EAA\u38CC\u{216E8}\u71DD\u44A2\u536D\u5374\u{286AB}\u537E\u537F\u{21596}\u{21613}\u77E6\u5393\u{28A9B}\u53A0\u53AB\u53AE\u73A7\u{25772}\u3F59\u739C\u53C1\u53C5\u6C49\u4E49\u57FE\u53D9\u3AAB\u{20B8F}\u53E0\u{23FEB}\u{22DA3}\u53F6\u{20C77}\u5413\u7079\u552B\u6657\u6D5B\u546D\u{26B53}\u{20D74}\u555D\u548F\u54A4\u47A6\u{2170D}\u{20EDD}\u3DB4\u{20D4D}"],
      ["fb40", "\u{289BC}\u{22698}\u5547\u4CED\u542F\u7417\u5586\u55A9\u5605\u{218D7}\u{2403A}\u4552\u{24435}\u66B3\u{210B4}\u5637\u66CD\u{2328A}\u66A4\u66AD\u564D\u564F\u78F1\u56F1\u9787\u53FE\u5700\u56EF\u56ED\u{28B66}\u3623\u{2124F}\u5746\u{241A5}\u6C6E\u708B\u5742\u36B1\u{26C7E}\u57E6\u{21416}\u5803\u{21454}\u{24363}\u5826\u{24BF5}\u585C\u58AA\u3561\u58E0\u58DC\u{2123C}\u58FB\u5BFF\u5743\u{2A150}\u{24278}\u93D3\u35A1\u591F\u68A6\u36C3\u6E59"],
      ["fba1", "\u{2163E}\u5A24\u5553\u{21692}\u8505\u59C9\u{20D4E}\u{26C81}\u{26D2A}\u{217DC}\u59D9\u{217FB}\u{217B2}\u{26DA6}\u6D71\u{21828}\u{216D5}\u59F9\u{26E45}\u5AAB\u5A63\u36E6\u{249A9}\u5A77\u3708\u5A96\u7465\u5AD3\u{26FA1}\u{22554}\u3D85\u{21911}\u3732\u{216B8}\u5E83\u52D0\u5B76\u6588\u5B7C\u{27A0E}\u4004\u485D\u{20204}\u5BD5\u6160\u{21A34}\u{259CC}\u{205A5}\u5BF3\u5B9D\u4D10\u5C05\u{21B44}\u5C13\u73CE\u5C14\u{21CA5}\u{26B28}\u5C49\u48DD\u5C85\u5CE9\u5CEF\u5D8B\u{21DF9}\u{21E37}\u5D10\u5D18\u5D46\u{21EA4}\u5CBA\u5DD7\u82FC\u382D\u{24901}\u{22049}\u{22173}\u8287\u3836\u3BC2\u5E2E\u6A8A\u5E75\u5E7A\u{244BC}\u{20CD3}\u53A6\u4EB7\u5ED0\u53A8\u{21771}\u5E09\u5EF4\u{28482}"],
      ["fc40", "\u5EF9\u5EFB\u38A0\u5EFC\u683E\u941B\u5F0D\u{201C1}\u{2F894}\u3ADE\u48AE\u{2133A}\u5F3A\u{26888}\u{223D0}\u5F58\u{22471}\u5F63\u97BD\u{26E6E}\u5F72\u9340\u{28A36}\u5FA7\u5DB6\u3D5F\u{25250}\u{21F6A}\u{270F8}\u{22668}\u91D6\u{2029E}\u{28A29}\u6031\u6685\u{21877}\u3963\u3DC7\u3639\u5790\u{227B4}\u7971\u3E40\u609E\u60A4\u60B3\u{24982}\u{2498F}\u{27A53}\u74A4\u50E1\u5AA0\u6164\u8424\u6142\u{2F8A6}\u{26ED2}\u6181\u51F4\u{20656}\u6187\u5BAA\u{23FB7}"],
      ["fca1", "\u{2285F}\u61D3\u{28B9D}\u{2995D}\u61D0\u3932\u{22980}\u{228C1}\u6023\u615C\u651E\u638B\u{20118}\u62C5\u{21770}\u62D5\u{22E0D}\u636C\u{249DF}\u3A17\u6438\u63F8\u{2138E}\u{217FC}\u6490\u6F8A\u{22E36}\u9814\u{2408C}\u{2571D}\u64E1\u64E5\u947B\u3A66\u643A\u3A57\u654D\u6F16\u{24A28}\u{24A23}\u6585\u656D\u655F\u{2307E}\u65B5\u{24940}\u4B37\u65D1\u40D8\u{21829}\u65E0\u65E3\u5FDF\u{23400}\u6618\u{231F7}\u{231F8}\u6644\u{231A4}\u{231A5}\u664B\u{20E75}\u6667\u{251E6}\u6673\u6674\u{21E3D}\u{23231}\u{285F4}\u{231C8}\u{25313}\u77C5\u{228F7}\u99A4\u6702\u{2439C}\u{24A21}\u3B2B\u69FA\u{237C2}\u675E\u6767\u6762\u{241CD}\u{290ED}\u67D7\u44E9\u6822\u6E50\u923C\u6801\u{233E6}\u{26DA0}\u685D"],
      ["fd40", "\u{2346F}\u69E1\u6A0B\u{28ADF}\u6973\u68C3\u{235CD}\u6901\u6900\u3D32\u3A01\u{2363C}\u3B80\u67AC\u6961\u{28A4A}\u42FC\u6936\u6998\u3BA1\u{203C9}\u8363\u5090\u69F9\u{23659}\u{2212A}\u6A45\u{23703}\u6A9D\u3BF3\u67B1\u6AC8\u{2919C}\u3C0D\u6B1D\u{20923}\u60DE\u6B35\u6B74\u{227CD}\u6EB5\u{23ADB}\u{203B5}\u{21958}\u3740\u5421\u{23B5A}\u6BE1\u{23EFC}\u6BDC\u6C37\u{2248B}\u{248F1}\u{26B51}\u6C5A\u8226\u6C79\u{23DBC}\u44C5\u{23DBD}\u{241A4}\u{2490C}\u{24900}"],
      ["fda1", "\u{23CC9}\u36E5\u3CEB\u{20D32}\u9B83\u{231F9}\u{22491}\u7F8F\u6837\u{26D25}\u{26DA1}\u{26DEB}\u6D96\u6D5C\u6E7C\u6F04\u{2497F}\u{24085}\u{26E72}\u8533\u{26F74}\u51C7\u6C9C\u6E1D\u842E\u{28B21}\u6E2F\u{23E2F}\u7453\u{23F82}\u79CC\u6E4F\u5A91\u{2304B}\u6FF8\u370D\u6F9D\u{23E30}\u6EFA\u{21497}\u{2403D}\u4555\u93F0\u6F44\u6F5C\u3D4E\u6F74\u{29170}\u3D3B\u6F9F\u{24144}\u6FD3\u{24091}\u{24155}\u{24039}\u{23FF0}\u{23FB4}\u{2413F}\u51DF\u{24156}\u{24157}\u{24140}\u{261DD}\u704B\u707E\u70A7\u7081\u70CC\u70D5\u70D6\u70DF\u4104\u3DE8\u71B4\u7196\u{24277}\u712B\u7145\u5A88\u714A\u716E\u5C9C\u{24365}\u714F\u9362\u{242C1}\u712C\u{2445A}\u{24A27}\u{24A22}\u71BA\u{28BE8}\u70BD\u720E"],
      ["fe40", "\u9442\u7215\u5911\u9443\u7224\u9341\u{25605}\u722E\u7240\u{24974}\u68BD\u7255\u7257\u3E55\u{23044}\u680D\u6F3D\u7282\u732A\u732B\u{24823}\u{2882B}\u48ED\u{28804}\u7328\u732E\u73CF\u73AA\u{20C3A}\u{26A2E}\u73C9\u7449\u{241E2}\u{216E7}\u{24A24}\u6623\u36C5\u{249B7}\u{2498D}\u{249FB}\u73F7\u7415\u6903\u{24A26}\u7439\u{205C3}\u3ED7\u745C\u{228AD}\u7460\u{28EB2}\u7447\u73E4\u7476\u83B9\u746C\u3730\u7474\u93F1\u6A2C\u7482\u4953\u{24A8C}"],
      ["fea1", "\u{2415F}\u{24A79}\u{28B8F}\u5B46\u{28C03}\u{2189E}\u74C8\u{21988}\u750E\u74E9\u751E\u{28ED9}\u{21A4B}\u5BD7\u{28EAC}\u9385\u754D\u754A\u7567\u756E\u{24F82}\u3F04\u{24D13}\u758E\u745D\u759E\u75B4\u7602\u762C\u7651\u764F\u766F\u7676\u{263F5}\u7690\u81EF\u37F8\u{26911}\u{2690E}\u76A1\u76A5\u76B7\u76CC\u{26F9F}\u8462\u{2509D}\u{2517D}\u{21E1C}\u771E\u7726\u7740\u64AF\u{25220}\u7758\u{232AC}\u77AF\u{28964}\u{28968}\u{216C1}\u77F4\u7809\u{21376}\u{24A12}\u68CA\u78AF\u78C7\u78D3\u96A5\u792E\u{255E0}\u78D7\u7934\u78B1\u{2760C}\u8FB8\u8884\u{28B2B}\u{26083}\u{2261C}\u7986\u8900\u6902\u7980\u{25857}\u799D\u{27B39}\u793C\u79A9\u6E2A\u{27126}\u3EA8\u79C6\u{2910D}\u79D4"]
    ];
  }
});

// ../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/dbcs-data.js
var require_dbcs_data = __commonJS({
  "../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/dbcs-data.js"(exports, module2) {
    init_import_meta_url();
    module2.exports = {
      // == Japanese/ShiftJIS ====================================================
      // All japanese encodings are based on JIS X set of standards:
      // JIS X 0201 - Single-byte encoding of ASCII + ¥ + Kana chars at 0xA1-0xDF.
      // JIS X 0208 - Main set of 6879 characters, placed in 94x94 plane, to be encoded by 2 bytes. 
      //              Has several variations in 1978, 1983, 1990 and 1997.
      // JIS X 0212 - Supplementary plane of 6067 chars in 94x94 plane. 1990. Effectively dead.
      // JIS X 0213 - Extension and modern replacement of 0208 and 0212. Total chars: 11233.
      //              2 planes, first is superset of 0208, second - revised 0212.
      //              Introduced in 2000, revised 2004. Some characters are in Unicode Plane 2 (0x2xxxx)
      // Byte encodings are:
      //  * Shift_JIS: Compatible with 0201, uses not defined chars in top half as lead bytes for double-byte
      //               encoding of 0208. Lead byte ranges: 0x81-0x9F, 0xE0-0xEF; Trail byte ranges: 0x40-0x7E, 0x80-0x9E, 0x9F-0xFC.
      //               Windows CP932 is a superset of Shift_JIS. Some companies added more chars, notably KDDI.
      //  * EUC-JP:    Up to 3 bytes per character. Used mostly on *nixes.
      //               0x00-0x7F       - lower part of 0201
      //               0x8E, 0xA1-0xDF - upper part of 0201
      //               (0xA1-0xFE)x2   - 0208 plane (94x94).
      //               0x8F, (0xA1-0xFE)x2 - 0212 plane (94x94).
      //  * JIS X 208: 7-bit, direct encoding of 0208. Byte ranges: 0x21-0x7E (94 values). Uncommon.
      //               Used as-is in ISO2022 family.
      //  * ISO2022-JP: Stateful encoding, with escape sequences to switch between ASCII, 
      //                0201-1976 Roman, 0208-1978, 0208-1983.
      //  * ISO2022-JP-1: Adds esc seq for 0212-1990.
      //  * ISO2022-JP-2: Adds esc seq for GB2313-1980, KSX1001-1992, ISO8859-1, ISO8859-7.
      //  * ISO2022-JP-3: Adds esc seq for 0201-1976 Kana set, 0213-2000 Planes 1, 2.
      //  * ISO2022-JP-2004: Adds 0213-2004 Plane 1.
      //
      // After JIS X 0213 appeared, Shift_JIS-2004, EUC-JISX0213 and ISO2022-JP-2004 followed, with just changing the planes.
      //
      // Overall, it seems that it's a mess :( http://www8.plala.or.jp/tkubota1/unicode-symbols-map2.html
      "shiftjis": {
        type: "_dbcs",
        table: /* @__PURE__ */ __name(function() {
          return require_shiftjis();
        }, "table"),
        encodeAdd: { "\xA5": 92, "\u203E": 126 },
        encodeSkipVals: [{ from: 60736, to: 63808 }]
      },
      "csshiftjis": "shiftjis",
      "mskanji": "shiftjis",
      "sjis": "shiftjis",
      "windows31j": "shiftjis",
      "ms31j": "shiftjis",
      "xsjis": "shiftjis",
      "windows932": "shiftjis",
      "ms932": "shiftjis",
      "932": "shiftjis",
      "cp932": "shiftjis",
      "eucjp": {
        type: "_dbcs",
        table: /* @__PURE__ */ __name(function() {
          return require_eucjp();
        }, "table"),
        encodeAdd: { "\xA5": 92, "\u203E": 126 }
      },
      // TODO: KDDI extension to Shift_JIS
      // TODO: IBM CCSID 942 = CP932, but F0-F9 custom chars and other char changes.
      // TODO: IBM CCSID 943 = Shift_JIS = CP932 with original Shift_JIS lower 128 chars.
      // == Chinese/GBK ==========================================================
      // http://en.wikipedia.org/wiki/GBK
      // We mostly implement W3C recommendation: https://www.w3.org/TR/encoding/#gbk-encoder
      // Oldest GB2312 (1981, ~7600 chars) is a subset of CP936
      "gb2312": "cp936",
      "gb231280": "cp936",
      "gb23121980": "cp936",
      "csgb2312": "cp936",
      "csiso58gb231280": "cp936",
      "euccn": "cp936",
      // Microsoft's CP936 is a subset and approximation of GBK.
      "windows936": "cp936",
      "ms936": "cp936",
      "936": "cp936",
      "cp936": {
        type: "_dbcs",
        table: /* @__PURE__ */ __name(function() {
          return require_cp936();
        }, "table")
      },
      // GBK (~22000 chars) is an extension of CP936 that added user-mapped chars and some other.
      "gbk": {
        type: "_dbcs",
        table: /* @__PURE__ */ __name(function() {
          return require_cp936().concat(require_gbk_added());
        }, "table")
      },
      "xgbk": "gbk",
      "isoir58": "gbk",
      // GB18030 is an algorithmic extension of GBK.
      // Main source: https://www.w3.org/TR/encoding/#gbk-encoder
      // http://icu-project.org/docs/papers/gb18030.html
      // http://source.icu-project.org/repos/icu/data/trunk/charset/data/xml/gb-18030-2000.xml
      // http://www.khngai.com/chinese/charmap/tblgbk.php?page=0
      "gb18030": {
        type: "_dbcs",
        table: /* @__PURE__ */ __name(function() {
          return require_cp936().concat(require_gbk_added());
        }, "table"),
        gb18030: /* @__PURE__ */ __name(function() {
          return require_gb18030_ranges();
        }, "gb18030"),
        encodeSkipVals: [128],
        encodeAdd: { "\u20AC": 41699 }
      },
      "chinese": "gb18030",
      // == Korean ===============================================================
      // EUC-KR, KS_C_5601 and KS X 1001 are exactly the same.
      "windows949": "cp949",
      "ms949": "cp949",
      "949": "cp949",
      "cp949": {
        type: "_dbcs",
        table: /* @__PURE__ */ __name(function() {
          return require_cp949();
        }, "table")
      },
      "cseuckr": "cp949",
      "csksc56011987": "cp949",
      "euckr": "cp949",
      "isoir149": "cp949",
      "korean": "cp949",
      "ksc56011987": "cp949",
      "ksc56011989": "cp949",
      "ksc5601": "cp949",
      // == Big5/Taiwan/Hong Kong ================================================
      // There are lots of tables for Big5 and cp950. Please see the following links for history:
      // http://moztw.org/docs/big5/  http://www.haible.de/bruno/charsets/conversion-tables/Big5.html
      // Variations, in roughly number of defined chars:
      //  * Windows CP 950: Microsoft variant of Big5. Canonical: http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP950.TXT
      //  * Windows CP 951: Microsoft variant of Big5-HKSCS-2001. Seems to be never public. http://me.abelcheung.org/articles/research/what-is-cp951/
      //  * Big5-2003 (Taiwan standard) almost superset of cp950.
      //  * Unicode-at-on (UAO) / Mozilla 1.8. Falling out of use on the Web. Not supported by other browsers.
      //  * Big5-HKSCS (-2001, -2004, -2008). Hong Kong standard. 
      //    many unicode code points moved from PUA to Supplementary plane (U+2XXXX) over the years.
      //    Plus, it has 4 combining sequences.
      //    Seems that Mozilla refused to support it for 10 yrs. https://bugzilla.mozilla.org/show_bug.cgi?id=162431 https://bugzilla.mozilla.org/show_bug.cgi?id=310299
      //    because big5-hkscs is the only encoding to include astral characters in non-algorithmic way.
      //    Implementations are not consistent within browsers; sometimes labeled as just big5.
      //    MS Internet Explorer switches from big5 to big5-hkscs when a patch applied.
      //    Great discussion & recap of what's going on https://bugzilla.mozilla.org/show_bug.cgi?id=912470#c31
      //    In the encoder, it might make sense to support encoding old PUA mappings to Big5 bytes seq-s.
      //    Official spec: http://www.ogcio.gov.hk/en/business/tech_promotion/ccli/terms/doc/2003cmp_2008.txt
      //                   http://www.ogcio.gov.hk/tc/business/tech_promotion/ccli/terms/doc/hkscs-2008-big5-iso.txt
      // 
      // Current understanding of how to deal with Big5(-HKSCS) is in the Encoding Standard, http://encoding.spec.whatwg.org/#big5-encoder
      // Unicode mapping (http://www.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/OTHER/BIG5.TXT) is said to be wrong.
      "windows950": "cp950",
      "ms950": "cp950",
      "950": "cp950",
      "cp950": {
        type: "_dbcs",
        table: /* @__PURE__ */ __name(function() {
          return require_cp950();
        }, "table")
      },
      // Big5 has many variations and is an extension of cp950. We use Encoding Standard's as a consensus.
      "big5": "big5hkscs",
      "big5hkscs": {
        type: "_dbcs",
        table: /* @__PURE__ */ __name(function() {
          return require_cp950().concat(require_big5_added());
        }, "table"),
        encodeSkipVals: [
          // Although Encoding Standard says we should avoid encoding to HKSCS area (See Step 1 of
          // https://encoding.spec.whatwg.org/#index-big5-pointer), we still do it to increase compatibility with ICU.
          // But if a single unicode point can be encoded both as HKSCS and regular Big5, we prefer the latter.
          36457,
          36463,
          36478,
          36523,
          36532,
          36557,
          36560,
          36695,
          36713,
          36718,
          36811,
          36862,
          36973,
          36986,
          37060,
          37084,
          37105,
          37311,
          37551,
          37552,
          37553,
          37554,
          37585,
          37959,
          38090,
          38361,
          38652,
          39285,
          39798,
          39800,
          39803,
          39878,
          39902,
          39916,
          39926,
          40002,
          40019,
          40034,
          40040,
          40043,
          40055,
          40124,
          40125,
          40144,
          40279,
          40282,
          40388,
          40431,
          40443,
          40617,
          40687,
          40701,
          40800,
          40907,
          41079,
          41180,
          41183,
          36812,
          37576,
          38468,
          38637,
          // Step 2 of https://encoding.spec.whatwg.org/#index-big5-pointer: Use last pointer for U+2550, U+255E, U+2561, U+256A, U+5341, or U+5345
          41636,
          41637,
          41639,
          41638,
          41676,
          41678
        ]
      },
      "cnbig5": "big5hkscs",
      "csbig5": "big5hkscs",
      "xxbig5": "big5hkscs"
    };
  }
});

// ../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/index.js
var require_encodings = __commonJS({
  "../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/index.js"(exports, module2) {
    init_import_meta_url();
    var modules = [
      require_internal(),
      require_utf32(),
      require_utf16(),
      require_utf7(),
      require_sbcs_codec(),
      require_sbcs_data(),
      require_sbcs_data_generated(),
      require_dbcs_codec(),
      require_dbcs_data()
    ];
    for (i7 = 0; i7 < modules.length; i7++) {
      module2 = modules[i7];
      for (enc in module2)
        if (Object.prototype.hasOwnProperty.call(module2, enc))
          exports[enc] = module2[enc];
    }
    var module2;
    var enc;
    var i7;
  }
});

// ../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/lib/streams.js
var require_streams = __commonJS({
  "../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/lib/streams.js"(exports, module2) {
    init_import_meta_url();
    var Buffer8 = require_safer().Buffer;
    module2.exports = function(stream_module) {
      var Transform2 = stream_module.Transform;
      function IconvLiteEncoderStream(conv, options) {
        this.conv = conv;
        options = options || {};
        options.decodeStrings = false;
        Transform2.call(this, options);
      }
      __name(IconvLiteEncoderStream, "IconvLiteEncoderStream");
      IconvLiteEncoderStream.prototype = Object.create(Transform2.prototype, {
        constructor: { value: IconvLiteEncoderStream }
      });
      IconvLiteEncoderStream.prototype._transform = function(chunk, encoding, done) {
        if (typeof chunk != "string")
          return done(new Error("Iconv encoding stream needs strings as its input."));
        try {
          var res = this.conv.write(chunk);
          if (res && res.length) this.push(res);
          done();
        } catch (e10) {
          done(e10);
        }
      };
      IconvLiteEncoderStream.prototype._flush = function(done) {
        try {
          var res = this.conv.end();
          if (res && res.length) this.push(res);
          done();
        } catch (e10) {
          done(e10);
        }
      };
      IconvLiteEncoderStream.prototype.collect = function(cb2) {
        var chunks = [];
        this.on("error", cb2);
        this.on("data", function(chunk) {
          chunks.push(chunk);
        });
        this.on("end", function() {
          cb2(null, Buffer8.concat(chunks));
        });
        return this;
      };
      function IconvLiteDecoderStream(conv, options) {
        this.conv = conv;
        options = options || {};
        options.encoding = this.encoding = "utf8";
        Transform2.call(this, options);
      }
      __name(IconvLiteDecoderStream, "IconvLiteDecoderStream");
      IconvLiteDecoderStream.prototype = Object.create(Transform2.prototype, {
        constructor: { value: IconvLiteDecoderStream }
      });
      IconvLiteDecoderStream.prototype._transform = function(chunk, encoding, done) {
        if (!Buffer8.isBuffer(chunk) && !(chunk instanceof Uint8Array))
          return done(new Error("Iconv decoding stream needs buffers as its input."));
        try {
          var res = this.conv.write(chunk);
          if (res && res.length) this.push(res, this.encoding);
          done();
        } catch (e10) {
          done(e10);
        }
      };
      IconvLiteDecoderStream.prototype._flush = function(done) {
        try {
          var res = this.conv.end();
          if (res && res.length) this.push(res, this.encoding);
          done();
        } catch (e10) {
          done(e10);
        }
      };
      IconvLiteDecoderStream.prototype.collect = function(cb2) {
        var res = "";
        this.on("error", cb2);
        this.on("data", function(chunk) {
          res += chunk;
        });
        this.on("end", function() {
          cb2(null, res);
        });
        return this;
      };
      return {
        IconvLiteEncoderStream,
        IconvLiteDecoderStream
      };
    };
  }
});

// ../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/lib/index.js
var require_lib3 = __commonJS({
  "../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/lib/index.js"(exports, module2) {
    init_import_meta_url();
    var Buffer8 = require_safer().Buffer;
    var bomHandling = require_bom_handling();
    var iconv = module2.exports;
    iconv.encodings = null;
    iconv.defaultCharUnicode = "\uFFFD";
    iconv.defaultCharSingleByte = "?";
    iconv.encode = /* @__PURE__ */ __name(function encode2(str, encoding, options) {
      str = "" + (str || "");
      var encoder = iconv.getEncoder(encoding, options);
      var res = encoder.write(str);
      var trail = encoder.end();
      return trail && trail.length > 0 ? Buffer8.concat([res, trail]) : res;
    }, "encode");
    iconv.decode = /* @__PURE__ */ __name(function decode(buf, encoding, options) {
      if (typeof buf === "string") {
        if (!iconv.skipDecodeWarning) {
          console.error("Iconv-lite warning: decode()-ing strings is deprecated. Refer to https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding");
          iconv.skipDecodeWarning = true;
        }
        buf = Buffer8.from("" + (buf || ""), "binary");
      }
      var decoder = iconv.getDecoder(encoding, options);
      var res = decoder.write(buf);
      var trail = decoder.end();
      return trail ? res + trail : res;
    }, "decode");
    iconv.encodingExists = /* @__PURE__ */ __name(function encodingExists(enc) {
      try {
        iconv.getCodec(enc);
        return true;
      } catch (e10) {
        return false;
      }
    }, "encodingExists");
    iconv.toEncoding = iconv.encode;
    iconv.fromEncoding = iconv.decode;
    iconv._codecDataCache = {};
    iconv.getCodec = /* @__PURE__ */ __name(function getCodec(encoding) {
      if (!iconv.encodings)
        iconv.encodings = require_encodings();
      var enc = iconv._canonicalizeEncoding(encoding);
      var codecOptions = {};
      while (true) {
        var codec = iconv._codecDataCache[enc];
        if (codec)
          return codec;
        var codecDef = iconv.encodings[enc];
        switch (typeof codecDef) {
          case "string":
            enc = codecDef;
            break;
          case "object":
            for (var key in codecDef)
              codecOptions[key] = codecDef[key];
            if (!codecOptions.encodingName)
              codecOptions.encodingName = enc;
            enc = codecDef.type;
            break;
          case "function":
            if (!codecOptions.encodingName)
              codecOptions.encodingName = enc;
            codec = new codecDef(codecOptions, iconv);
            iconv._codecDataCache[codecOptions.encodingName] = codec;
            return codec;
          default:
            throw new Error("Encoding not recognized: '" + encoding + "' (searched as: '" + enc + "')");
        }
      }
    }, "getCodec");
    iconv._canonicalizeEncoding = function(encoding) {
      return ("" + encoding).toLowerCase().replace(/:\d{4}$|[^0-9a-z]/g, "");
    };
    iconv.getEncoder = /* @__PURE__ */ __name(function getEncoder(encoding, options) {
      var codec = iconv.getCodec(encoding), encoder = new codec.encoder(options, codec);
      if (codec.bomAware && options && options.addBOM)
        encoder = new bomHandling.PrependBOM(encoder, options);
      return encoder;
    }, "getEncoder");
    iconv.getDecoder = /* @__PURE__ */ __name(function getDecoder(encoding, options) {
      var codec = iconv.getCodec(encoding), decoder = new codec.decoder(options, codec);
      if (codec.bomAware && !(options && options.stripBOM === false))
        decoder = new bomHandling.StripBOM(decoder, options);
      return decoder;
    }, "getDecoder");
    iconv.enableStreamingAPI = /* @__PURE__ */ __name(function enableStreamingAPI(stream_module2) {
      if (iconv.supportsStreams)
        return;
      var streams = require_streams()(stream_module2);
      iconv.IconvLiteEncoderStream = streams.IconvLiteEncoderStream;
      iconv.IconvLiteDecoderStream = streams.IconvLiteDecoderStream;
      iconv.encodeStream = /* @__PURE__ */ __name(function encodeStream(encoding, options) {
        return new iconv.IconvLiteEncoderStream(iconv.getEncoder(encoding, options), options);
      }, "encodeStream");
      iconv.decodeStream = /* @__PURE__ */ __name(function decodeStream(encoding, options) {
        return new iconv.IconvLiteDecoderStream(iconv.getDecoder(encoding, options), options);
      }, "decodeStream");
      iconv.supportsStreams = true;
    }, "enableStreamingAPI");
    var stream_module;
    try {
      stream_module = __require("stream");
    } catch (e10) {
    }
    if (stream_module && stream_module.Transform) {
      iconv.enableStreamingAPI(stream_module);
    } else {
      iconv.encodeStream = iconv.decodeStream = function() {
        throw new Error("iconv-lite Streaming API is not enabled. Use iconv.enableStreamingAPI(require('stream')); to enable it.");
      };
    }
  }
});

// ../../node_modules/.pnpm/encoding@0.1.13/node_modules/encoding/lib/encoding.js
var require_encoding2 = __commonJS({
  "../../node_modules/.pnpm/encoding@0.1.13/node_modules/encoding/lib/encoding.js"(exports, module2) {
    init_import_meta_url();
    var iconvLite = require_lib3();
    module2.exports.convert = convert2;
    function convert2(str, to, from) {
      from = checkEncoding(from || "UTF-8");
      to = checkEncoding(to || "UTF-8");
      str = str || "";
      var result;
      if (from !== "UTF-8" && typeof str === "string") {
        str = Buffer.from(str, "binary");
      }
      if (from === to) {
        if (typeof str === "string") {
          result = Buffer.from(str);
        } else {
          result = str;
        }
      } else {
        try {
          result = convertIconvLite(str, to, from);
        } catch (E4) {
          console.error(E4);
          result = str;
        }
      }
      if (typeof result === "string") {
        result = Buffer.from(result, "utf-8");
      }
      return result;
    }
    __name(convert2, "convert");
    function convertIconvLite(str, to, from) {
      if (to === "UTF-8") {
        return iconvLite.decode(str, from);
      } else if (from === "UTF-8") {
        return iconvLite.encode(str, to);
      } else {
        return iconvLite.encode(iconvLite.decode(str, from), to);
      }
    }
    __name(convertIconvLite, "convertIconvLite");
    function checkEncoding(name2) {
      return (name2 || "").toString().trim().replace(/^latin[\-_]?(\d+)$/i, "ISO-8859-$1").replace(/^win(?:dows)?[\-_]?(\d+)$/i, "WINDOWS-$1").replace(/^utf[\-_]?(\d+)$/i, "UTF-$1").replace(/^ks_c_5601\-1987$/i, "CP949").replace(/^us[\-_]?ascii$/i, "ASCII").toUpperCase();
    }
    __name(checkEncoding, "checkEncoding");
  }
});
function FetchError(message, type, systemError) {
  Error.call(this, message);
  this.message = message;
  this.type = type;
  if (systemError) {
    this.code = this.errno = systemError.code;
  }
  Error.captureStackTrace(this, this.constructor);
}
function Body(body) {
  var _this = this;
  var _ref = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, _ref$size = _ref.size;
  let size = _ref$size === void 0 ? 0 : _ref$size;
  var _ref$timeout = _ref.timeout;
  let timeout2 = _ref$timeout === void 0 ? 0 : _ref$timeout;
  if (body == null) {
    body = null;
  } else if (isURLSearchParams(body)) {
    body = Buffer.from(body.toString());
  } else if (isBlob2(body)) ;
  else if (Buffer.isBuffer(body)) ;
  else if (Object.prototype.toString.call(body) === "[object ArrayBuffer]") {
    body = Buffer.from(body);
  } else if (ArrayBuffer.isView(body)) {
    body = Buffer.from(body.buffer, body.byteOffset, body.byteLength);
  } else if (body instanceof Stream__namespace.default) ;
  else {
    body = Buffer.from(String(body));
  }
  this[INTERNALS] = {
    body,
    disturbed: false,
    error: null
  };
  this.size = size;
  this.timeout = timeout2;
  if (body instanceof Stream__namespace.default) {
    body.on("error", function(err) {
      const error2 = err.name === "AbortError" ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, "system", err);
      _this[INTERNALS].error = error2;
    });
  }
}
function consumeBody() {
  var _this4 = this;
  if (this[INTERNALS].disturbed) {
    return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`));
  }
  this[INTERNALS].disturbed = true;
  if (this[INTERNALS].error) {
    return Body.Promise.reject(this[INTERNALS].error);
  }
  let body = this.body;
  if (body === null) {
    return Body.Promise.resolve(Buffer.alloc(0));
  }
  if (isBlob2(body)) {
    body = body.stream();
  }
  if (Buffer.isBuffer(body)) {
    return Body.Promise.resolve(body);
  }
  if (!(body instanceof Stream__namespace.default)) {
    return Body.Promise.resolve(Buffer.alloc(0));
  }
  let accum = [];
  let accumBytes = 0;
  let abort = false;
  return new Body.Promise(function(resolve32, reject) {
    let resTimeout;
    if (_this4.timeout) {
      resTimeout = setTimeout(function() {
        abort = true;
        reject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, "body-timeout"));
      }, _this4.timeout);
    }
    body.on("error", function(err) {
      if (err.name === "AbortError") {
        abort = true;
        reject(err);
      } else {
        reject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, "system", err));
      }
    });
    body.on("data", function(chunk) {
      if (abort || chunk === null) {
        return;
      }
      if (_this4.size && accumBytes + chunk.length > _this4.size) {
        abort = true;
        reject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, "max-size"));
        return;
      }
      accumBytes += chunk.length;
      accum.push(chunk);
    });
    body.on("end", function() {
      if (abort) {
        return;
      }
      clearTimeout(resTimeout);
      try {
        resolve32(Buffer.concat(accum, accumBytes));
      } catch (err) {
        reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, "system", err));
      }
    });
  });
}
function convertBody(buffer, headers) {
  if (typeof convert !== "function") {
    throw new Error("The package `encoding` must be installed to use the textConverted() function");
  }
  const ct3 = headers.get("content-type");
  let charset = "utf-8";
  let res, str;
  if (ct3) {
    res = /charset=([^;]*)/i.exec(ct3);
  }
  str = buffer.slice(0, 1024).toString();
  if (!res && str) {
    res = /<meta.+?charset=(['"])(.+?)\1/i.exec(str);
  }
  if (!res && str) {
    res = /<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(str);
    if (!res) {
      res = /<meta[\s]+?content=(['"])(.+?)\1[\s]+?http-equiv=(['"])content-type\3/i.exec(str);
      if (res) {
        res.pop();
      }
    }
    if (res) {
      res = /charset=(.*)/i.exec(res.pop());
    }
  }
  if (!res && str) {
    res = /<\?xml.+?encoding=(['"])(.+?)\1/i.exec(str);
  }
  if (res) {
    charset = res.pop();
    if (charset === "gb2312" || charset === "gbk") {
      charset = "gb18030";
    }
  }
  return convert(buffer, "UTF-8", charset).toString();
}
function isURLSearchParams(obj) {
  if (typeof obj !== "object" || typeof obj.append !== "function" || typeof obj.delete !== "function" || typeof obj.get !== "function" || typeof obj.getAll !== "function" || typeof obj.has !== "function" || typeof obj.set !== "function") {
    return false;
  }
  return obj.constructor.name === "URLSearchParams" || Object.prototype.toString.call(obj) === "[object URLSearchParams]" || typeof obj.sort === "function";
}
function isBlob2(obj) {
  return typeof obj === "object" && typeof obj.arrayBuffer === "function" && typeof obj.type === "string" && typeof obj.stream === "function" && typeof obj.constructor === "function" && typeof obj.constructor.name === "string" && /^(Blob|File)$/.test(obj.constructor.name) && /^(Blob|File)$/.test(obj[Symbol.toStringTag]);
}
function clone(instance) {
  let p1, p22;
  let body = instance.body;
  if (instance.bodyUsed) {
    throw new Error("cannot clone body after it is used");
  }
  if (body instanceof Stream__namespace.default && typeof body.getBoundary !== "function") {
    p1 = new PassThrough();
    p22 = new PassThrough();
    body.pipe(p1);
    body.pipe(p22);
    instance[INTERNALS].body = p1;
    body = p22;
  }
  return body;
}
function extractContentType(body) {
  if (body === null) {
    return null;
  } else if (typeof body === "string") {
    return "text/plain;charset=UTF-8";
  } else if (isURLSearchParams(body)) {
    return "application/x-www-form-urlencoded;charset=UTF-8";
  } else if (isBlob2(body)) {
    return body.type || null;
  } else if (Buffer.isBuffer(body)) {
    return null;
  } else if (Object.prototype.toString.call(body) === "[object ArrayBuffer]") {
    return null;
  } else if (ArrayBuffer.isView(body)) {
    return null;
  } else if (typeof body.getBoundary === "function") {
    return `multipart/form-data;boundary=${body.getBoundary()}`;
  } else if (body instanceof Stream__namespace.default) {
    return null;
  } else {
    return "text/plain;charset=UTF-8";
  }
}
function getTotalBytes(instance) {
  const body = instance.body;
  if (body === null) {
    return 0;
  } else if (isBlob2(body)) {
    return body.size;
  } else if (Buffer.isBuffer(body)) {
    return body.length;
  } else if (body && typeof body.getLengthSync === "function") {
    if (body._lengthRetrievers && body._lengthRetrievers.length == 0 || // 1.x
    body.hasKnownLength && body.hasKnownLength()) {
      return body.getLengthSync();
    }
    return null;
  } else {
    return null;
  }
}
function writeToStream(dest, instance) {
  const body = instance.body;
  if (body === null) {
    dest.end();
  } else if (isBlob2(body)) {
    body.stream().pipe(dest);
  } else if (Buffer.isBuffer(body)) {
    dest.write(body);
    dest.end();
  } else {
    body.pipe(dest);
  }
}
function validateName(name2) {
  name2 = `${name2}`;
  if (invalidTokenRegex.test(name2) || name2 === "") {
    throw new TypeError(`${name2} is not a legal HTTP header name`);
  }
}
function validateValue(value) {
  value = `${value}`;
  if (invalidHeaderCharRegex.test(value)) {
    throw new TypeError(`${value} is not a legal HTTP header value`);
  }
}
function find(map2, name2) {
  name2 = name2.toLowerCase();
  for (const key in map2) {
    if (key.toLowerCase() === name2) {
      return key;
    }
  }
  return void 0;
}
function getHeaders2(headers) {
  let kind2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "key+value";
  const keys = Object.keys(headers[MAP]).sort();
  return keys.map(kind2 === "key" ? function(k7) {
    return k7.toLowerCase();
  } : kind2 === "value" ? function(k7) {
    return headers[MAP][k7].join(", ");
  } : function(k7) {
    return [k7.toLowerCase(), headers[MAP][k7].join(", ")];
  });
}
function createHeadersIterator(target, kind2) {
  const iterator = Object.create(HeadersIteratorPrototype);
  iterator[INTERNAL] = {
    target,
    kind: kind2,
    index: 0
  };
  return iterator;
}
function exportNodeCompatibleHeaders(headers) {
  const obj = Object.assign({ __proto__: null }, headers[MAP]);
  const hostHeaderKey = find(headers[MAP], "Host");
  if (hostHeaderKey !== void 0) {
    obj[hostHeaderKey] = obj[hostHeaderKey][0];
  }
  return obj;
}
function createHeadersLenient(obj) {
  const headers = new Headers3();
  for (const name2 of Object.keys(obj)) {
    if (invalidTokenRegex.test(name2)) {
      continue;
    }
    if (Array.isArray(obj[name2])) {
      for (const val2 of obj[name2]) {
        if (invalidHeaderCharRegex.test(val2)) {
          continue;
        }
        if (headers[MAP][name2] === void 0) {
          headers[MAP][name2] = [val2];
        } else {
          headers[MAP][name2].push(val2);
        }
      }
    } else if (!invalidHeaderCharRegex.test(obj[name2])) {
      headers[MAP][name2] = [obj[name2]];
    }
  }
  return headers;
}
function parseURL(urlStr) {
  if (/^[a-zA-Z][a-zA-Z\d+\-.]*:/.exec(urlStr)) {
    urlStr = new URL2(urlStr).toString();
  }
  return parse_url(urlStr);
}
function isRequest(input) {
  return typeof input === "object" && typeof input[INTERNALS$2] === "object";
}
function isAbortSignal(signal) {
  const proto2 = signal && typeof signal === "object" && Object.getPrototypeOf(signal);
  return !!(proto2 && proto2.constructor.name === "AbortSignal");
}
function getNodeRequestOptions(request4) {
  const parsedURL = request4[INTERNALS$2].parsedURL;
  const headers = new Headers3(request4[INTERNALS$2].headers);
  if (!headers.has("Accept")) {
    headers.set("Accept", "*/*");
  }
  if (!parsedURL.protocol || !parsedURL.hostname) {
    throw new TypeError("Only absolute URLs are supported");
  }
  if (!/^https?:$/.test(parsedURL.protocol)) {
    throw new TypeError("Only HTTP(S) protocols are supported");
  }
  if (request4.signal && request4.body instanceof Stream__namespace.default.Readable && !streamDestructionSupported) {
    throw new Error("Cancellation of streamed requests with AbortSignal is not supported in node < 8");
  }
  let contentLengthValue = null;
  if (request4.body == null && /^(POST|PUT)$/i.test(request4.method)) {
    contentLengthValue = "0";
  }
  if (request4.body != null) {
    const totalBytes = getTotalBytes(request4);
    if (typeof totalBytes === "number") {
      contentLengthValue = String(totalBytes);
    }
  }
  if (contentLengthValue) {
    headers.set("Content-Length", contentLengthValue);
  }
  if (!headers.has("User-Agent")) {
    headers.set("User-Agent", "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)");
  }
  if (request4.compress && !headers.has("Accept-Encoding")) {
    headers.set("Accept-Encoding", "gzip,deflate");
  }
  let agent = request4.agent;
  if (typeof agent === "function") {
    agent = agent(parsedURL);
  }
  return Object.assign({}, parsedURL, {
    method: request4.method,
    headers: exportNodeCompatibleHeaders(headers),
    agent
  });
}
function AbortError(message) {
  Error.call(this, message);
  this.type = "aborted";
  this.message = message;
  Error.captureStackTrace(this, this.constructor);
}
function fetch5(url4, opts) {
  if (!fetch5.Promise) {
    throw new Error("native promise missing, set fetch.Promise to your favorite alternative");
  }
  Body.Promise = fetch5.Promise;
  return new fetch5.Promise(function(resolve32, reject) {
    const request4 = new Request3(url4, opts);
    const options = getNodeRequestOptions(request4);
    const send = (options.protocol === "https:" ? https__namespace.default : http__namespace.default).request;
    const signal = request4.signal;
    let response = null;
    const abort = /* @__PURE__ */ __name(function abort2() {
      let error2 = new AbortError("The user aborted a request.");
      reject(error2);
      if (request4.body && request4.body instanceof Stream__namespace.default.Readable) {
        destroyStream(request4.body, error2);
      }
      if (!response || !response.body) return;
      response.body.emit("error", error2);
    }, "abort");
    if (signal && signal.aborted) {
      abort();
      return;
    }
    const abortAndFinalize = /* @__PURE__ */ __name(function abortAndFinalize2() {
      abort();
      finalize();
    }, "abortAndFinalize");
    const req = send(options);
    let reqTimeout;
    if (signal) {
      signal.addEventListener("abort", abortAndFinalize);
    }
    function finalize() {
      req.abort();
      if (signal) signal.removeEventListener("abort", abortAndFinalize);
      clearTimeout(reqTimeout);
    }
    __name(finalize, "finalize");
    if (request4.timeout) {
      req.once("socket", function(socket) {
        reqTimeout = setTimeout(function() {
          reject(new FetchError(`network timeout at: ${request4.url}`, "request-timeout"));
          finalize();
        }, request4.timeout);
      });
    }
    req.on("error", function(err) {
      reject(new FetchError(`request to ${request4.url} failed, reason: ${err.message}`, "system", err));
      if (response && response.body) {
        destroyStream(response.body, err);
      }
      finalize();
    });
    fixResponseChunkedTransferBadEnding(req, function(err) {
      if (signal && signal.aborted) {
        return;
      }
      if (response && response.body) {
        destroyStream(response.body, err);
      }
    });
    if (parseInt(process.version.substring(1)) < 14) {
      req.on("socket", function(s7) {
        s7.addListener("close", function(hadError) {
          const hasDataListener = s7.listenerCount("data") > 0;
          if (response && hasDataListener && !hadError && !(signal && signal.aborted)) {
            const err = new Error("Premature close");
            err.code = "ERR_STREAM_PREMATURE_CLOSE";
            response.body.emit("error", err);
          }
        });
      });
    }
    req.on("response", function(res) {
      clearTimeout(reqTimeout);
      const headers = createHeadersLenient(res.headers);
      if (fetch5.isRedirect(res.statusCode)) {
        const location = headers.get("Location");
        let locationURL = null;
        try {
          locationURL = location === null ? null : new URL$1(location, request4.url).toString();
        } catch (err) {
          if (request4.redirect !== "manual") {
            reject(new FetchError(`uri requested responds with an invalid redirect URL: ${location}`, "invalid-redirect"));
            finalize();
            return;
          }
        }
        switch (request4.redirect) {
          case "error":
            reject(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${request4.url}`, "no-redirect"));
            finalize();
            return;
          case "manual":
            if (locationURL !== null) {
              try {
                headers.set("Location", locationURL);
              } catch (err) {
                reject(err);
              }
            }
            break;
          case "follow":
            if (locationURL === null) {
              break;
            }
            if (request4.counter >= request4.follow) {
              reject(new FetchError(`maximum redirect reached at: ${request4.url}`, "max-redirect"));
              finalize();
              return;
            }
            const requestOpts = {
              headers: new Headers3(request4.headers),
              follow: request4.follow,
              counter: request4.counter + 1,
              agent: request4.agent,
              compress: request4.compress,
              method: request4.method,
              body: request4.body,
              signal: request4.signal,
              timeout: request4.timeout,
              size: request4.size
            };
            if (!isDomainOrSubdomain(request4.url, locationURL) || !isSameProtocol(request4.url, locationURL)) {
              for (const name2 of ["authorization", "www-authenticate", "cookie", "cookie2"]) {
                requestOpts.headers.delete(name2);
              }
            }
            if (res.statusCode !== 303 && request4.body && getTotalBytes(request4) === null) {
              reject(new FetchError("Cannot follow redirect with body being a readable stream", "unsupported-redirect"));
              finalize();
              return;
            }
            if (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request4.method === "POST") {
              requestOpts.method = "GET";
              requestOpts.body = void 0;
              requestOpts.headers.delete("content-length");
            }
            resolve32(fetch5(new Request3(locationURL, requestOpts)));
            finalize();
            return;
        }
      }
      res.once("end", function() {
        if (signal) signal.removeEventListener("abort", abortAndFinalize);
      });
      let body = res.pipe(new PassThrough$1());
      const response_options = {
        url: request4.url,
        status: res.statusCode,
        statusText: res.statusMessage,
        headers,
        size: request4.size,
        timeout: request4.timeout,
        counter: request4.counter
      };
      const codings = headers.get("Content-Encoding");
      if (!request4.compress || request4.method === "HEAD" || codings === null || res.statusCode === 204 || res.statusCode === 304) {
        response = new Response3(body, response_options);
        resolve32(response);
        return;
      }
      const zlibOptions = {
        flush: zlib__namespace.default.Z_SYNC_FLUSH,
        finishFlush: zlib__namespace.default.Z_SYNC_FLUSH
      };
      if (codings == "gzip" || codings == "x-gzip") {
        body = body.pipe(zlib__namespace.default.createGunzip(zlibOptions));
        response = new Response3(body, response_options);
        resolve32(response);
        return;
      }
      if (codings == "deflate" || codings == "x-deflate") {
        const raw = res.pipe(new PassThrough$1());
        raw.once("data", function(chunk) {
          if ((chunk[0] & 15) === 8) {
            body = body.pipe(zlib__namespace.default.createInflate());
          } else {
            body = body.pipe(zlib__namespace.default.createInflateRaw());
          }
          response = new Response3(body, response_options);
          resolve32(response);
        });
        raw.on("end", function() {
          if (!response) {
            response = new Response3(body, response_options);
            resolve32(response);
          }
        });
        return;
      }
      if (codings == "br" && typeof zlib__namespace.default.createBrotliDecompress === "function") {
        body = body.pipe(zlib__namespace.default.createBrotliDecompress());
        response = new Response3(body, response_options);
        resolve32(response);
        return;
      }
      response = new Response3(body, response_options);
      resolve32(response);
    });
    writeToStream(req, request4);
  });
}
function fixResponseChunkedTransferBadEnding(request4, errorCallback2) {
  let socket;
  request4.on("socket", function(s7) {
    socket = s7;
  });
  request4.on("response", function(response) {
    const headers = response.headers;
    if (headers["transfer-encoding"] === "chunked" && !headers["content-length"]) {
      response.once("close", function(hadError) {
        const hasDataListener = socket && socket.listenerCount("data") > 0;
        if (hasDataListener && !hadError) {
          const err = new Error("Premature close");
          err.code = "ERR_STREAM_PREMATURE_CLOSE";
          errorCallback2(err);
        }
      });
    }
  });
}
function destroyStream(stream2, err) {
  if (stream2.destroy) {
    stream2.destroy(err);
  } else {
    stream2.emit("error", err);
    stream2.end();
  }
}
var import_whatwg_url, Readable, BUFFER, TYPE, Blob3, convert, INTERNALS, PassThrough, invalidTokenRegex, invalidHeaderCharRegex, MAP, Headers3, INTERNAL, HeadersIteratorPrototype, INTERNALS$1, STATUS_CODES, Response3, INTERNALS$2, URL2, parse_url, format_url, streamDestructionSupported, Request3, URL$1, PassThrough$1, isDomainOrSubdomain, isSameProtocol, lib_default2;
var init_lib4 = __esm({
  "../../node_modules/.pnpm/node-fetch@2.7.0_encoding@0.1.13/node_modules/node-fetch/lib/index.mjs"() {
    init_import_meta_url();
    import_whatwg_url = __toESM(require_public_api(), 1);
    Readable = Stream__namespace.default.Readable;
    BUFFER = Symbol("buffer");
    TYPE = Symbol("type");
    Blob3 = class _Blob {
      static {
        __name(this, "Blob");
      }
      constructor() {
        this[TYPE] = "";
        const blobParts = arguments[0];
        const options = arguments[1];
        const buffers = [];
        let size = 0;
        if (blobParts) {
          const a7 = blobParts;
          const length = Number(a7.length);
          for (let i7 = 0; i7 < length; i7++) {
            const element = a7[i7];
            let buffer;
            if (element instanceof Buffer) {
              buffer = element;
            } else if (ArrayBuffer.isView(element)) {
              buffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength);
            } else if (element instanceof ArrayBuffer) {
              buffer = Buffer.from(element);
            } else if (element instanceof _Blob) {
              buffer = element[BUFFER];
            } else {
              buffer = Buffer.from(typeof element === "string" ? element : String(element));
            }
            size += buffer.length;
            buffers.push(buffer);
          }
        }
        this[BUFFER] = Buffer.concat(buffers);
        let type = options && options.type !== void 0 && String(options.type).toLowerCase();
        if (type && !/[^\u0020-\u007E]/.test(type)) {
          this[TYPE] = type;
        }
      }
      get size() {
        return this[BUFFER].length;
      }
      get type() {
        return this[TYPE];
      }
      text() {
        return Promise.resolve(this[BUFFER].toString());
      }
      arrayBuffer() {
        const buf = this[BUFFER];
        const ab2 = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
        return Promise.resolve(ab2);
      }
      stream() {
        const readable = new Readable();
        readable._read = function() {
        };
        readable.push(this[BUFFER]);
        readable.push(null);
        return readable;
      }
      toString() {
        return "[object Blob]";
      }
      slice() {
        const size = this.size;
        const start = arguments[0];
        const end = arguments[1];
        let relativeStart, relativeEnd;
        if (start === void 0) {
          relativeStart = 0;
        } else if (start < 0) {
          relativeStart = Math.max(size + start, 0);
        } else {
          relativeStart = Math.min(start, size);
        }
        if (end === void 0) {
          relativeEnd = size;
        } else if (end < 0) {
          relativeEnd = Math.max(size + end, 0);
        } else {
          relativeEnd = Math.min(end, size);
        }
        const span = Math.max(relativeEnd - relativeStart, 0);
        const buffer = this[BUFFER];
        const slicedBuffer = buffer.slice(relativeStart, relativeStart + span);
        const blob = new _Blob([], { type: arguments[2] });
        blob[BUFFER] = slicedBuffer;
        return blob;
      }
    };
    Object.defineProperties(Blob3.prototype, {
      size: { enumerable: true },
      type: { enumerable: true },
      slice: { enumerable: true }
    });
    Object.defineProperty(Blob3.prototype, Symbol.toStringTag, {
      value: "Blob",
      writable: false,
      enumerable: false,
      configurable: true
    });
    __name(FetchError, "FetchError");
    FetchError.prototype = Object.create(Error.prototype);
    FetchError.prototype.constructor = FetchError;
    FetchError.prototype.name = "FetchError";
    try {
      convert = require_encoding2().convert;
    } catch (e10) {
    }
    INTERNALS = Symbol("Body internals");
    PassThrough = Stream__namespace.default.PassThrough;
    __name(Body, "Body");
    Body.prototype = {
      get body() {
        return this[INTERNALS].body;
      },
      get bodyUsed() {
        return this[INTERNALS].disturbed;
      },
      /**
       * Decode response as ArrayBuffer
       *
       * @return  Promise
       */
      arrayBuffer() {
        return consumeBody.call(this).then(function(buf) {
          return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
        });
      },
      /**
       * Return raw response as Blob
       *
       * @return Promise
       */
      blob() {
        let ct3 = this.headers && this.headers.get("content-type") || "";
        return consumeBody.call(this).then(function(buf) {
          return Object.assign(
            // Prevent copying
            new Blob3([], {
              type: ct3.toLowerCase()
            }),
            {
              [BUFFER]: buf
            }
          );
        });
      },
      /**
       * Decode response as json
       *
       * @return  Promise
       */
      json() {
        var _this2 = this;
        return consumeBody.call(this).then(function(buffer) {
          try {
            return JSON.parse(buffer.toString());
          } catch (err) {
            return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, "invalid-json"));
          }
        });
      },
      /**
       * Decode response as text
       *
       * @return  Promise
       */
      text() {
        return consumeBody.call(this).then(function(buffer) {
          return buffer.toString();
        });
      },
      /**
       * Decode response as buffer (non-spec api)
       *
       * @return  Promise
       */
      buffer() {
        return consumeBody.call(this);
      },
      /**
       * Decode response as text, while automatically detecting the encoding and
       * trying to decode to UTF-8 (non-spec api)
       *
       * @return  Promise
       */
      textConverted() {
        var _this3 = this;
        return consumeBody.call(this).then(function(buffer) {
          return convertBody(buffer, _this3.headers);
        });
      }
    };
    Object.defineProperties(Body.prototype, {
      body: { enumerable: true },
      bodyUsed: { enumerable: true },
      arrayBuffer: { enumerable: true },
      blob: { enumerable: true },
      json: { enumerable: true },
      text: { enumerable: true }
    });
    Body.mixIn = function(proto2) {
      for (const name2 of Object.getOwnPropertyNames(Body.prototype)) {
        if (!(name2 in proto2)) {
          const desc = Object.getOwnPropertyDescriptor(Body.prototype, name2);
          Object.defineProperty(proto2, name2, desc);
        }
      }
    };
    __name(consumeBody, "consumeBody");
    __name(convertBody, "convertBody");
    __name(isURLSearchParams, "isURLSearchParams");
    __name(isBlob2, "isBlob");
    __name(clone, "clone");
    __name(extractContentType, "extractContentType");
    __name(getTotalBytes, "getTotalBytes");
    __name(writeToStream, "writeToStream");
    Body.Promise = global.Promise;
    invalidTokenRegex = /[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/;
    invalidHeaderCharRegex = /[^\t\x20-\x7e\x80-\xff]/;
    __name(validateName, "validateName");
    __name(validateValue, "validateValue");
    __name(find, "find");
    MAP = Symbol("map");
    Headers3 = class _Headers {
      static {
        __name(this, "Headers");
      }
      /**
       * Headers class
       *
       * @param   Object  headers  Response headers
       * @return  Void
       */
      constructor() {
        let init4 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : void 0;
        this[MAP] = /* @__PURE__ */ Object.create(null);
        if (init4 instanceof _Headers) {
          const rawHeaders = init4.raw();
          const headerNames = Object.keys(rawHeaders);
          for (const headerName of headerNames) {
            for (const value of rawHeaders[headerName]) {
              this.append(headerName, value);
            }
          }
          return;
        }
        if (init4 == null) ;
        else if (typeof init4 === "object") {
          const method = init4[Symbol.iterator];
          if (method != null) {
            if (typeof method !== "function") {
              throw new TypeError("Header pairs must be iterable");
            }
            const pairs = [];
            for (const pair of init4) {
              if (typeof pair !== "object" || typeof pair[Symbol.iterator] !== "function") {
                throw new TypeError("Each header pair must be iterable");
              }
              pairs.push(Array.from(pair));
            }
            for (const pair of pairs) {
              if (pair.length !== 2) {
                throw new TypeError("Each header pair must be a name/value tuple");
              }
              this.append(pair[0], pair[1]);
            }
          } else {
            for (const key of Object.keys(init4)) {
              const value = init4[key];
              this.append(key, value);
            }
          }
        } else {
          throw new TypeError("Provided initializer must be an object");
        }
      }
      /**
       * Return combined header value given name
       *
       * @param   String  name  Header name
       * @return  Mixed
       */
      get(name2) {
        name2 = `${name2}`;
        validateName(name2);
        const key = find(this[MAP], name2);
        if (key === void 0) {
          return null;
        }
        return this[MAP][key].join(", ");
      }
      /**
       * Iterate over all headers
       *
       * @param   Function  callback  Executed for each item with parameters (value, name, thisArg)
       * @param   Boolean   thisArg   `this` context for callback function
       * @return  Void
       */
      forEach(callback) {
        let thisArg = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : void 0;
        let pairs = getHeaders2(this);
        let i7 = 0;
        while (i7 < pairs.length) {
          var _pairs$i = pairs[i7];
          const name2 = _pairs$i[0], value = _pairs$i[1];
          callback.call(thisArg, value, name2, this);
          pairs = getHeaders2(this);
          i7++;
        }
      }
      /**
       * Overwrite header values given name
       *
       * @param   String  name   Header name
       * @param   String  value  Header value
       * @return  Void
       */
      set(name2, value) {
        name2 = `${name2}`;
        value = `${value}`;
        validateName(name2);
        validateValue(value);
        const key = find(this[MAP], name2);
        this[MAP][key !== void 0 ? key : name2] = [value];
      }
      /**
       * Append a value onto existing header
       *
       * @param   String  name   Header name
       * @param   String  value  Header value
       * @return  Void
       */
      append(name2, value) {
        name2 = `${name2}`;
        value = `${value}`;
        validateName(name2);
        validateValue(value);
        const key = find(this[MAP], name2);
        if (key !== void 0) {
          this[MAP][key].push(value);
        } else {
          this[MAP][name2] = [value];
        }
      }
      /**
       * Check for header name existence
       *
       * @param   String   name  Header name
       * @return  Boolean
       */
      has(name2) {
        name2 = `${name2}`;
        validateName(name2);
        return find(this[MAP], name2) !== void 0;
      }
      /**
       * Delete all header values given name
       *
       * @param   String  name  Header name
       * @return  Void
       */
      delete(name2) {
        name2 = `${name2}`;
        validateName(name2);
        const key = find(this[MAP], name2);
        if (key !== void 0) {
          delete this[MAP][key];
        }
      }
      /**
       * Return raw headers (non-spec api)
       *
       * @return  Object
       */
      raw() {
        return this[MAP];
      }
      /**
       * Get an iterator on keys.
       *
       * @return  Iterator
       */
      keys() {
        return createHeadersIterator(this, "key");
      }
      /**
       * Get an iterator on values.
       *
       * @return  Iterator
       */
      values() {
        return createHeadersIterator(this, "value");
      }
      /**
       * Get an iterator on entries.
       *
       * This is the default iterator of the Headers object.
       *
       * @return  Iterator
       */
      [Symbol.iterator]() {
        return createHeadersIterator(this, "key+value");
      }
    };
    Headers3.prototype.entries = Headers3.prototype[Symbol.iterator];
    Object.defineProperty(Headers3.prototype, Symbol.toStringTag, {
      value: "Headers",
      writable: false,
      enumerable: false,
      configurable: true
    });
    Object.defineProperties(Headers3.prototype, {
      get: { enumerable: true },
      forEach: { enumerable: true },
      set: { enumerable: true },
      append: { enumerable: true },
      has: { enumerable: true },
      delete: { enumerable: true },
      keys: { enumerable: true },
      values: { enumerable: true },
      entries: { enumerable: true }
    });
    __name(getHeaders2, "getHeaders");
    INTERNAL = Symbol("internal");
    __name(createHeadersIterator, "createHeadersIterator");
    HeadersIteratorPrototype = Object.setPrototypeOf({
      next() {
        if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) {
          throw new TypeError("Value of `this` is not a HeadersIterator");
        }
        var _INTERNAL = this[INTERNAL];
        const target = _INTERNAL.target, kind2 = _INTERNAL.kind, index = _INTERNAL.index;
        const values = getHeaders2(target, kind2);
        const len = values.length;
        if (index >= len) {
          return {
            value: void 0,
            done: true
          };
        }
        this[INTERNAL].index = index + 1;
        return {
          value: values[index],
          done: false
        };
      }
    }, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));
    Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, {
      value: "HeadersIterator",
      writable: false,
      enumerable: false,
      configurable: true
    });
    __name(exportNodeCompatibleHeaders, "exportNodeCompatibleHeaders");
    __name(createHeadersLenient, "createHeadersLenient");
    INTERNALS$1 = Symbol("Response internals");
    STATUS_CODES = http__namespace.default.STATUS_CODES;
    Response3 = class _Response {
      static {
        __name(this, "Response");
      }
      constructor() {
        let body = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : null;
        let opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
        Body.call(this, body, opts);
        const status2 = opts.status || 200;
        const headers = new Headers3(opts.headers);
        if (body != null && !headers.has("Content-Type")) {
          const contentType = extractContentType(body);
          if (contentType) {
            headers.append("Content-Type", contentType);
          }
        }
        this[INTERNALS$1] = {
          url: opts.url,
          status: status2,
          statusText: opts.statusText || STATUS_CODES[status2],
          headers,
          counter: opts.counter
        };
      }
      get url() {
        return this[INTERNALS$1].url || "";
      }
      get status() {
        return this[INTERNALS$1].status;
      }
      /**
       * Convenience property representing if the request ended normally
       */
      get ok() {
        return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;
      }
      get redirected() {
        return this[INTERNALS$1].counter > 0;
      }
      get statusText() {
        return this[INTERNALS$1].statusText;
      }
      get headers() {
        return this[INTERNALS$1].headers;
      }
      /**
       * Clone this response
       *
       * @return  Response
       */
      clone() {
        return new _Response(clone(this), {
          url: this.url,
          status: this.status,
          statusText: this.statusText,
          headers: this.headers,
          ok: this.ok,
          redirected: this.redirected
        });
      }
    };
    Body.mixIn(Response3.prototype);
    Object.defineProperties(Response3.prototype, {
      url: { enumerable: true },
      status: { enumerable: true },
      ok: { enumerable: true },
      redirected: { enumerable: true },
      statusText: { enumerable: true },
      headers: { enumerable: true },
      clone: { enumerable: true }
    });
    Object.defineProperty(Response3.prototype, Symbol.toStringTag, {
      value: "Response",
      writable: false,
      enumerable: false,
      configurable: true
    });
    INTERNALS$2 = Symbol("Request internals");
    URL2 = Url__default.default.URL || import_whatwg_url.default.URL;
    parse_url = Url__default.default.parse;
    format_url = Url__default.default.format;
    __name(parseURL, "parseURL");
    streamDestructionSupported = "destroy" in Stream__namespace.default.Readable.prototype;
    __name(isRequest, "isRequest");
    __name(isAbortSignal, "isAbortSignal");
    Request3 = class _Request {
      static {
        __name(this, "Request");
      }
      constructor(input) {
        let init4 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
        let parsedURL;
        if (!isRequest(input)) {
          if (input && input.href) {
            parsedURL = parseURL(input.href);
          } else {
            parsedURL = parseURL(`${input}`);
          }
          input = {};
        } else {
          parsedURL = parseURL(input.url);
        }
        let method = init4.method || input.method || "GET";
        method = method.toUpperCase();
        if ((init4.body != null || isRequest(input) && input.body !== null) && (method === "GET" || method === "HEAD")) {
          throw new TypeError("Request with GET/HEAD method cannot have body");
        }
        let inputBody = init4.body != null ? init4.body : isRequest(input) && input.body !== null ? clone(input) : null;
        Body.call(this, inputBody, {
          timeout: init4.timeout || input.timeout || 0,
          size: init4.size || input.size || 0
        });
        const headers = new Headers3(init4.headers || input.headers || {});
        if (inputBody != null && !headers.has("Content-Type")) {
          const contentType = extractContentType(inputBody);
          if (contentType) {
            headers.append("Content-Type", contentType);
          }
        }
        let signal = isRequest(input) ? input.signal : null;
        if ("signal" in init4) signal = init4.signal;
        if (signal != null && !isAbortSignal(signal)) {
          throw new TypeError("Expected signal to be an instanceof AbortSignal");
        }
        this[INTERNALS$2] = {
          method,
          redirect: init4.redirect || input.redirect || "follow",
          headers,
          parsedURL,
          signal
        };
        this.follow = init4.follow !== void 0 ? init4.follow : input.follow !== void 0 ? input.follow : 20;
        this.compress = init4.compress !== void 0 ? init4.compress : input.compress !== void 0 ? input.compress : true;
        this.counter = init4.counter || input.counter || 0;
        this.agent = init4.agent || input.agent;
      }
      get method() {
        return this[INTERNALS$2].method;
      }
      get url() {
        return format_url(this[INTERNALS$2].parsedURL);
      }
      get headers() {
        return this[INTERNALS$2].headers;
      }
      get redirect() {
        return this[INTERNALS$2].redirect;
      }
      get signal() {
        return this[INTERNALS$2].signal;
      }
      /**
       * Clone this request
       *
       * @return  Request
       */
      clone() {
        return new _Request(this);
      }
    };
    Body.mixIn(Request3.prototype);
    Object.defineProperty(Request3.prototype, Symbol.toStringTag, {
      value: "Request",
      writable: false,
      enumerable: false,
      configurable: true
    });
    Object.defineProperties(Request3.prototype, {
      method: { enumerable: true },
      url: { enumerable: true },
      headers: { enumerable: true },
      redirect: { enumerable: true },
      clone: { enumerable: true },
      signal: { enumerable: true }
    });
    __name(getNodeRequestOptions, "getNodeRequestOptions");
    __name(AbortError, "AbortError");
    AbortError.prototype = Object.create(Error.prototype);
    AbortError.prototype.constructor = AbortError;
    AbortError.prototype.name = "AbortError";
    URL$1 = Url__default.default.URL || import_whatwg_url.default.URL;
    PassThrough$1 = Stream__namespace.default.PassThrough;
    isDomainOrSubdomain = /* @__PURE__ */ __name(function isDomainOrSubdomain2(destination, original) {
      const orig = new URL$1(original).hostname;
      const dest = new URL$1(destination).hostname;
      return orig === dest || orig[orig.length - dest.length - 1] === "." && orig.endsWith(dest);
    }, "isDomainOrSubdomain");
    isSameProtocol = /* @__PURE__ */ __name(function isSameProtocol2(destination, original) {
      const orig = new URL$1(original).protocol;
      const dest = new URL$1(destination).protocol;
      return orig === dest;
    }, "isSameProtocol");
    __name(fetch5, "fetch");
    __name(fixResponseChunkedTransferBadEnding, "fixResponseChunkedTransferBadEnding");
    __name(destroyStream, "destroyStream");
    fetch5.isRedirect = function(code) {
      return code === 301 || code === 302 || code === 303 || code === 307 || code === 308;
    };
    fetch5.Promise = global.Promise;
    lib_default2 = fetch5;
  }
});

// ../../node_modules/.pnpm/web-streams-polyfill@4.0.0-beta.3/node_modules/web-streams-polyfill/dist/ponyfill.mjs
function t() {
}
function r2(e10) {
  return "object" == typeof e10 && null !== e10 || "function" == typeof e10;
}
function n(e10, t13) {
  try {
    Object.defineProperty(e10, "name", { value: t13, configurable: true });
  } catch (e11) {
  }
}
function u(e10) {
  return new a(e10);
}
function c2(e10) {
  return l2(e10);
}
function d2(e10) {
  return s(e10);
}
function f2(e10, t13, r10) {
  return i.call(e10, t13, r10);
}
function b2(e10, t13, r10) {
  f2(f2(e10, t13, r10), void 0, o);
}
function h2(e10, t13) {
  b2(e10, t13);
}
function _2(e10, t13) {
  b2(e10, void 0, t13);
}
function p2(e10, t13, r10) {
  return f2(e10, t13, r10);
}
function m2(e10) {
  f2(e10, void 0, o);
}
function g2(e10, t13, r10) {
  if ("function" != typeof e10) throw new TypeError("Argument is not a function");
  return Function.prototype.apply.call(e10, t13, r10);
}
function w2(e10, t13, r10) {
  try {
    return c2(g2(e10, t13, r10));
  } catch (e11) {
    return d2(e11);
  }
}
function E(e10, t13) {
  e10._ownerReadableStream = t13, t13._reader = e10, "readable" === t13._state ? O2(e10) : "closed" === t13._state ? function(e11) {
    O2(e11), j2(e11);
  }(e10) : B(e10, t13._storedError);
}
function P2(e10, t13) {
  return Gt(e10._ownerReadableStream, t13);
}
function W2(e10) {
  const t13 = e10._ownerReadableStream;
  "readable" === t13._state ? A(e10, new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")) : function(e11, t14) {
    B(e11, t14);
  }(e10, new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")), t13._readableStreamController[C](), t13._reader = void 0, e10._ownerReadableStream = void 0;
}
function k2(e10) {
  return new TypeError("Cannot " + e10 + " a stream using a released reader");
}
function O2(e10) {
  e10._closedPromise = u((t13, r10) => {
    e10._closedPromise_resolve = t13, e10._closedPromise_reject = r10;
  });
}
function B(e10, t13) {
  O2(e10), A(e10, t13);
}
function A(e10, t13) {
  void 0 !== e10._closedPromise_reject && (m2(e10._closedPromise), e10._closedPromise_reject(t13), e10._closedPromise_resolve = void 0, e10._closedPromise_reject = void 0);
}
function j2(e10) {
  void 0 !== e10._closedPromise_resolve && (e10._closedPromise_resolve(void 0), e10._closedPromise_resolve = void 0, e10._closedPromise_reject = void 0);
}
function F(e10, t13) {
  if (void 0 !== e10 && ("object" != typeof (r10 = e10) && "function" != typeof r10)) throw new TypeError(`${t13} is not an object.`);
  var r10;
}
function I2(e10, t13) {
  if ("function" != typeof e10) throw new TypeError(`${t13} is not a function.`);
}
function D(e10, t13) {
  if (!/* @__PURE__ */ function(e11) {
    return "object" == typeof e11 && null !== e11 || "function" == typeof e11;
  }(e10)) throw new TypeError(`${t13} is not an object.`);
}
function $2(e10, t13, r10) {
  if (void 0 === e10) throw new TypeError(`Parameter ${t13} is required in '${r10}'.`);
}
function M2(e10, t13, r10) {
  if (void 0 === e10) throw new TypeError(`${t13} is required in '${r10}'.`);
}
function Y2(e10) {
  return Number(e10);
}
function Q2(e10) {
  return 0 === e10 ? 0 : e10;
}
function N2(e10, t13) {
  const r10 = Number.MAX_SAFE_INTEGER;
  let o7 = Number(e10);
  if (o7 = Q2(o7), !z3(o7)) throw new TypeError(`${t13} is not a finite number`);
  if (o7 = function(e11) {
    return Q2(L2(e11));
  }(o7), o7 < 0 || o7 > r10) throw new TypeError(`${t13} is outside the accepted range of 0 to ${r10}, inclusive`);
  return z3(o7) && 0 !== o7 ? o7 : 0;
}
function H2(e10) {
  if (!r2(e10)) return false;
  if ("function" != typeof e10.getReader) return false;
  try {
    return "boolean" == typeof e10.locked;
  } catch (e11) {
    return false;
  }
}
function x2(e10) {
  if (!r2(e10)) return false;
  if ("function" != typeof e10.getWriter) return false;
  try {
    return "boolean" == typeof e10.locked;
  } catch (e11) {
    return false;
  }
}
function V2(e10, t13) {
  if (!Vt(e10)) throw new TypeError(`${t13} is not a ReadableStream.`);
}
function U2(e10, t13) {
  e10._reader._readRequests.push(t13);
}
function G2(e10, t13, r10) {
  const o7 = e10._reader._readRequests.shift();
  r10 ? o7._closeSteps() : o7._chunkSteps(t13);
}
function X2(e10) {
  return e10._reader._readRequests.length;
}
function J2(e10) {
  const t13 = e10._reader;
  return void 0 !== t13 && !!K2(t13);
}
function K2(e10) {
  return !!r2(e10) && (!!Object.prototype.hasOwnProperty.call(e10, "_readRequests") && e10 instanceof ReadableStreamDefaultReader);
}
function Z2(e10, t13) {
  const r10 = e10._readRequests;
  e10._readRequests = new S2(), r10.forEach((e11) => {
    e11._errorSteps(t13);
  });
}
function ee(e10) {
  return new TypeError(`ReadableStreamDefaultReader.prototype.${e10} can only be used on a ReadableStreamDefaultReader`);
}
function oe(e10) {
  if (!r2(e10)) return false;
  if (!Object.prototype.hasOwnProperty.call(e10, "_asyncIteratorImpl")) return false;
  try {
    return e10._asyncIteratorImpl instanceof te;
  } catch (e11) {
    return false;
  }
}
function ne(e10) {
  return new TypeError(`ReadableStreamAsyncIterator.${e10} can only be used on a ReadableSteamAsyncIterator`);
}
function ie(e10, t13, r10, o7, n9) {
  new Uint8Array(e10).set(new Uint8Array(r10, o7, n9), t13);
}
function le(e10) {
  const t13 = function(e11, t14, r10) {
    if (e11.slice) return e11.slice(t14, r10);
    const o7 = r10 - t14, n9 = new ArrayBuffer(o7);
    return ie(n9, 0, e11, t14, o7), n9;
  }(e10.buffer, e10.byteOffset, e10.byteOffset + e10.byteLength);
  return new Uint8Array(t13);
}
function se(e10) {
  const t13 = e10._queue.shift();
  return e10._queueTotalSize -= t13.size, e10._queueTotalSize < 0 && (e10._queueTotalSize = 0), t13.value;
}
function ue(e10, t13, r10) {
  if ("number" != typeof (o7 = r10) || ae(o7) || o7 < 0 || r10 === 1 / 0) throw new RangeError("Size must be a finite, non-NaN, non-negative number.");
  var o7;
  e10._queue.push({ value: t13, size: r10 }), e10._queueTotalSize += r10;
}
function ce(e10) {
  e10._queue = new S2(), e10._queueTotalSize = 0;
}
function de(e10) {
  return !!r2(e10) && (!!Object.prototype.hasOwnProperty.call(e10, "_controlledReadableByteStream") && e10 instanceof ReadableByteStreamController);
}
function fe(e10) {
  return !!r2(e10) && (!!Object.prototype.hasOwnProperty.call(e10, "_associatedReadableByteStreamController") && e10 instanceof ReadableStreamBYOBRequest);
}
function be(e10) {
  const t13 = function(e11) {
    const t14 = e11._controlledReadableByteStream;
    if ("readable" !== t14._state) return false;
    if (e11._closeRequested) return false;
    if (!e11._started) return false;
    if (J2(t14) && X2(t14) > 0) return true;
    if (Le(t14) && ze(t14) > 0) return true;
    if (ke(e11) > 0) return true;
    return false;
  }(e10);
  if (!t13) return;
  if (e10._pulling) return void (e10._pullAgain = true);
  e10._pulling = true;
  b2(e10._pullAlgorithm(), () => (e10._pulling = false, e10._pullAgain && (e10._pullAgain = false, be(e10)), null), (t14) => (Pe(e10, t14), null));
}
function he(e10) {
  Re(e10), e10._pendingPullIntos = new S2();
}
function _e(e10, t13) {
  let r10 = false;
  "closed" === e10._state && (r10 = true);
  const o7 = pe(t13);
  "default" === t13.readerType ? G2(e10, o7, r10) : function(e11, t14, r11) {
    const o8 = e11._reader._readIntoRequests.shift();
    r11 ? o8._closeSteps(t14) : o8._chunkSteps(t14);
  }(e10, o7, r10);
}
function pe(e10) {
  const t13 = e10.bytesFilled, r10 = e10.elementSize;
  return new e10.viewConstructor(e10.buffer, e10.byteOffset, t13 / r10);
}
function me(e10, t13, r10, o7) {
  e10._queue.push({ buffer: t13, byteOffset: r10, byteLength: o7 }), e10._queueTotalSize += o7;
}
function ye(e10, t13, r10, o7) {
  let n9;
  try {
    n9 = t13.slice(r10, r10 + o7);
  } catch (t14) {
    throw Pe(e10, t14), t14;
  }
  me(e10, n9, 0, o7);
}
function ge(e10, t13) {
  t13.bytesFilled > 0 && ye(e10, t13.buffer, t13.byteOffset, t13.bytesFilled), Ce(e10);
}
function we(e10, t13) {
  const r10 = t13.elementSize, o7 = t13.bytesFilled - t13.bytesFilled % r10, n9 = Math.min(e10._queueTotalSize, t13.byteLength - t13.bytesFilled), a7 = t13.bytesFilled + n9, i7 = a7 - a7 % r10;
  let l8 = n9, s7 = false;
  i7 > o7 && (l8 = i7 - t13.bytesFilled, s7 = true);
  const u7 = e10._queue;
  for (; l8 > 0; ) {
    const r11 = u7.peek(), o8 = Math.min(l8, r11.byteLength), n10 = t13.byteOffset + t13.bytesFilled;
    ie(t13.buffer, n10, r11.buffer, r11.byteOffset, o8), r11.byteLength === o8 ? u7.shift() : (r11.byteOffset += o8, r11.byteLength -= o8), e10._queueTotalSize -= o8, Se(e10, o8, t13), l8 -= o8;
  }
  return s7;
}
function Se(e10, t13, r10) {
  r10.bytesFilled += t13;
}
function ve(e10) {
  0 === e10._queueTotalSize && e10._closeRequested ? (Ee(e10), Xt(e10._controlledReadableByteStream)) : be(e10);
}
function Re(e10) {
  null !== e10._byobRequest && (e10._byobRequest._associatedReadableByteStreamController = void 0, e10._byobRequest._view = null, e10._byobRequest = null);
}
function Te(e10) {
  for (; e10._pendingPullIntos.length > 0; ) {
    if (0 === e10._queueTotalSize) return;
    const t13 = e10._pendingPullIntos.peek();
    we(e10, t13) && (Ce(e10), _e(e10._controlledReadableByteStream, t13));
  }
}
function qe(e10, t13) {
  const r10 = e10._pendingPullIntos.peek();
  Re(e10);
  "closed" === e10._controlledReadableByteStream._state ? function(e11, t14) {
    "none" === t14.readerType && Ce(e11);
    const r11 = e11._controlledReadableByteStream;
    if (Le(r11)) for (; ze(r11) > 0; ) _e(r11, Ce(e11));
  }(e10, r10) : function(e11, t14, r11) {
    if (Se(0, t14, r11), "none" === r11.readerType) return ge(e11, r11), void Te(e11);
    if (r11.bytesFilled < r11.elementSize) return;
    Ce(e11);
    const o7 = r11.bytesFilled % r11.elementSize;
    if (o7 > 0) {
      const t15 = r11.byteOffset + r11.bytesFilled;
      ye(e11, r11.buffer, t15 - o7, o7);
    }
    r11.bytesFilled -= o7, _e(e11._controlledReadableByteStream, r11), Te(e11);
  }(e10, t13, r10), be(e10);
}
function Ce(e10) {
  return e10._pendingPullIntos.shift();
}
function Ee(e10) {
  e10._pullAlgorithm = void 0, e10._cancelAlgorithm = void 0;
}
function Pe(e10, t13) {
  const r10 = e10._controlledReadableByteStream;
  "readable" === r10._state && (he(e10), ce(e10), Ee(e10), Jt(r10, t13));
}
function We(e10, t13) {
  const r10 = e10._queue.shift();
  e10._queueTotalSize -= r10.byteLength, ve(e10);
  const o7 = new Uint8Array(r10.buffer, r10.byteOffset, r10.byteLength);
  t13._chunkSteps(o7);
}
function ke(e10) {
  const t13 = e10._controlledReadableByteStream._state;
  return "errored" === t13 ? null : "closed" === t13 ? 0 : e10._strategyHWM - e10._queueTotalSize;
}
function Oe(e10, t13, r10) {
  const o7 = Object.create(ReadableByteStreamController.prototype);
  let n9, a7, i7;
  n9 = void 0 !== t13.start ? () => t13.start(o7) : () => {
  }, a7 = void 0 !== t13.pull ? () => t13.pull(o7) : () => c2(void 0), i7 = void 0 !== t13.cancel ? (e11) => t13.cancel(e11) : () => c2(void 0);
  const l8 = t13.autoAllocateChunkSize;
  if (0 === l8) throw new TypeError("autoAllocateChunkSize must be greater than 0");
  !function(e11, t14, r11, o8, n10, a8, i8) {
    t14._controlledReadableByteStream = e11, t14._pullAgain = false, t14._pulling = false, t14._byobRequest = null, t14._queue = t14._queueTotalSize = void 0, ce(t14), t14._closeRequested = false, t14._started = false, t14._strategyHWM = a8, t14._pullAlgorithm = o8, t14._cancelAlgorithm = n10, t14._autoAllocateChunkSize = i8, t14._pendingPullIntos = new S2(), e11._readableStreamController = t14, b2(c2(r11()), () => (t14._started = true, be(t14), null), (e12) => (Pe(t14, e12), null));
  }(e10, o7, n9, a7, i7, r10, l8);
}
function Be(e10) {
  return new TypeError(`ReadableStreamBYOBRequest.prototype.${e10} can only be used on a ReadableStreamBYOBRequest`);
}
function Ae(e10) {
  return new TypeError(`ReadableByteStreamController.prototype.${e10} can only be used on a ReadableByteStreamController`);
}
function je(e10, t13) {
  e10._reader._readIntoRequests.push(t13);
}
function ze(e10) {
  return e10._reader._readIntoRequests.length;
}
function Le(e10) {
  const t13 = e10._reader;
  return void 0 !== t13 && !!Fe(t13);
}
function Fe(e10) {
  return !!r2(e10) && (!!Object.prototype.hasOwnProperty.call(e10, "_readIntoRequests") && e10 instanceof ReadableStreamBYOBReader);
}
function Ie(e10, t13) {
  const r10 = e10._readIntoRequests;
  e10._readIntoRequests = new S2(), r10.forEach((e11) => {
    e11._errorSteps(t13);
  });
}
function De(e10) {
  return new TypeError(`ReadableStreamBYOBReader.prototype.${e10} can only be used on a ReadableStreamBYOBReader`);
}
function $e(e10, t13) {
  const { highWaterMark: r10 } = e10;
  if (void 0 === r10) return t13;
  if (ae(r10) || r10 < 0) throw new RangeError("Invalid highWaterMark");
  return r10;
}
function Me(e10) {
  const { size: t13 } = e10;
  return t13 || (() => 1);
}
function Ye(e10, t13) {
  F(e10, t13);
  const r10 = null == e10 ? void 0 : e10.highWaterMark, o7 = null == e10 ? void 0 : e10.size;
  return { highWaterMark: void 0 === r10 ? void 0 : Y2(r10), size: void 0 === o7 ? void 0 : Qe(o7, `${t13} has member 'size' that`) };
}
function Qe(e10, t13) {
  return I2(e10, t13), (t14) => Y2(e10(t14));
}
function Ne(e10, t13, r10) {
  return I2(e10, r10), (r11) => w2(e10, t13, [r11]);
}
function He(e10, t13, r10) {
  return I2(e10, r10), () => w2(e10, t13, []);
}
function xe(e10, t13, r10) {
  return I2(e10, r10), (r11) => g2(e10, t13, [r11]);
}
function Ve(e10, t13, r10) {
  return I2(e10, r10), (r11, o7) => w2(e10, t13, [r11, o7]);
}
function Ge(e10) {
  return !!r2(e10) && (!!Object.prototype.hasOwnProperty.call(e10, "_writableStreamController") && e10 instanceof WritableStream2);
}
function Xe(e10) {
  return void 0 !== e10._writer;
}
function Je(e10, t13) {
  var r10;
  if ("closed" === e10._state || "errored" === e10._state) return c2(void 0);
  e10._writableStreamController._abortReason = t13, null === (r10 = e10._writableStreamController._abortController) || void 0 === r10 || r10.abort(t13);
  const o7 = e10._state;
  if ("closed" === o7 || "errored" === o7) return c2(void 0);
  if (void 0 !== e10._pendingAbortRequest) return e10._pendingAbortRequest._promise;
  let n9 = false;
  "erroring" === o7 && (n9 = true, t13 = void 0);
  const a7 = u((r11, o8) => {
    e10._pendingAbortRequest = { _promise: void 0, _resolve: r11, _reject: o8, _reason: t13, _wasAlreadyErroring: n9 };
  });
  return e10._pendingAbortRequest._promise = a7, n9 || et(e10, t13), a7;
}
function Ke(e10) {
  const t13 = e10._state;
  if ("closed" === t13 || "errored" === t13) return d2(new TypeError(`The stream (in ${t13} state) is not in the writable state and cannot be closed`));
  const r10 = u((t14, r11) => {
    const o8 = { _resolve: t14, _reject: r11 };
    e10._closeRequest = o8;
  }), o7 = e10._writer;
  var n9;
  return void 0 !== o7 && e10._backpressure && "writable" === t13 && Et(o7), ue(n9 = e10._writableStreamController, lt, 0), dt(n9), r10;
}
function Ze(e10, t13) {
  "writable" !== e10._state ? tt(e10) : et(e10, t13);
}
function et(e10, t13) {
  const r10 = e10._writableStreamController;
  e10._state = "erroring", e10._storedError = t13;
  const o7 = e10._writer;
  void 0 !== o7 && it(o7, t13), !function(e11) {
    if (void 0 === e11._inFlightWriteRequest && void 0 === e11._inFlightCloseRequest) return false;
    return true;
  }(e10) && r10._started && tt(e10);
}
function tt(e10) {
  e10._state = "errored", e10._writableStreamController[R2]();
  const t13 = e10._storedError;
  if (e10._writeRequests.forEach((e11) => {
    e11._reject(t13);
  }), e10._writeRequests = new S2(), void 0 === e10._pendingAbortRequest) return void ot(e10);
  const r10 = e10._pendingAbortRequest;
  if (e10._pendingAbortRequest = void 0, r10._wasAlreadyErroring) return r10._reject(t13), void ot(e10);
  b2(e10._writableStreamController[v2](r10._reason), () => (r10._resolve(), ot(e10), null), (t14) => (r10._reject(t14), ot(e10), null));
}
function rt(e10) {
  return void 0 !== e10._closeRequest || void 0 !== e10._inFlightCloseRequest;
}
function ot(e10) {
  void 0 !== e10._closeRequest && (e10._closeRequest._reject(e10._storedError), e10._closeRequest = void 0);
  const t13 = e10._writer;
  void 0 !== t13 && St(t13, e10._storedError);
}
function nt(e10, t13) {
  const r10 = e10._writer;
  void 0 !== r10 && t13 !== e10._backpressure && (t13 ? function(e11) {
    Rt(e11);
  }(r10) : Et(r10)), e10._backpressure = t13;
}
function at(e10) {
  return !!r2(e10) && (!!Object.prototype.hasOwnProperty.call(e10, "_ownerWritableStream") && e10 instanceof WritableStreamDefaultWriter);
}
function it(e10, t13) {
  "pending" === e10._readyPromiseState ? Ct(e10, t13) : function(e11, t14) {
    Tt(e11, t14);
  }(e10, t13);
}
function st(e10) {
  return !!r2(e10) && (!!Object.prototype.hasOwnProperty.call(e10, "_controlledWritableStream") && e10 instanceof WritableStreamDefaultController);
}
function ut(e10) {
  e10._writeAlgorithm = void 0, e10._closeAlgorithm = void 0, e10._abortAlgorithm = void 0, e10._strategySizeAlgorithm = void 0;
}
function ct(e10) {
  return e10._strategyHWM - e10._queueTotalSize;
}
function dt(e10) {
  const t13 = e10._controlledWritableStream;
  if (!e10._started) return;
  if (void 0 !== t13._inFlightWriteRequest) return;
  if ("erroring" === t13._state) return void tt(t13);
  if (0 === e10._queue.length) return;
  const r10 = e10._queue.peek().value;
  r10 === lt ? function(e11) {
    const t14 = e11._controlledWritableStream;
    ((function(e12) {
      e12._inFlightCloseRequest = e12._closeRequest, e12._closeRequest = void 0;
    }))(t14), se(e11);
    const r11 = e11._closeAlgorithm();
    ut(e11), b2(r11, () => (function(e12) {
      e12._inFlightCloseRequest._resolve(void 0), e12._inFlightCloseRequest = void 0, "erroring" === e12._state && (e12._storedError = void 0, void 0 !== e12._pendingAbortRequest && (e12._pendingAbortRequest._resolve(), e12._pendingAbortRequest = void 0)), e12._state = "closed";
      const t15 = e12._writer;
      void 0 !== t15 && vt(t15);
    }(t14), null), (e12) => (function(e13, t15) {
      e13._inFlightCloseRequest._reject(t15), e13._inFlightCloseRequest = void 0, void 0 !== e13._pendingAbortRequest && (e13._pendingAbortRequest._reject(t15), e13._pendingAbortRequest = void 0), Ze(e13, t15);
    }(t14, e12), null));
  }(e10) : function(e11, t14) {
    const r11 = e11._controlledWritableStream;
    !function(e12) {
      e12._inFlightWriteRequest = e12._writeRequests.shift();
    }(r11);
    b2(e11._writeAlgorithm(t14), () => {
      !function(e12) {
        e12._inFlightWriteRequest._resolve(void 0), e12._inFlightWriteRequest = void 0;
      }(r11);
      const t15 = r11._state;
      if (se(e11), !rt(r11) && "writable" === t15) {
        const t16 = bt(e11);
        nt(r11, t16);
      }
      return dt(e11), null;
    }, (t15) => ("writable" === r11._state && ut(e11), function(e12, t16) {
      e12._inFlightWriteRequest._reject(t16), e12._inFlightWriteRequest = void 0, Ze(e12, t16);
    }(r11, t15), null));
  }(e10, r10);
}
function ft(e10, t13) {
  "writable" === e10._controlledWritableStream._state && ht(e10, t13);
}
function bt(e10) {
  return ct(e10) <= 0;
}
function ht(e10, t13) {
  const r10 = e10._controlledWritableStream;
  ut(e10), et(r10, t13);
}
function _t(e10) {
  return new TypeError(`WritableStream.prototype.${e10} can only be used on a WritableStream`);
}
function pt(e10) {
  return new TypeError(`WritableStreamDefaultController.prototype.${e10} can only be used on a WritableStreamDefaultController`);
}
function mt(e10) {
  return new TypeError(`WritableStreamDefaultWriter.prototype.${e10} can only be used on a WritableStreamDefaultWriter`);
}
function yt(e10) {
  return new TypeError("Cannot " + e10 + " a stream using a released writer");
}
function gt(e10) {
  e10._closedPromise = u((t13, r10) => {
    e10._closedPromise_resolve = t13, e10._closedPromise_reject = r10, e10._closedPromiseState = "pending";
  });
}
function wt(e10, t13) {
  gt(e10), St(e10, t13);
}
function St(e10, t13) {
  void 0 !== e10._closedPromise_reject && (m2(e10._closedPromise), e10._closedPromise_reject(t13), e10._closedPromise_resolve = void 0, e10._closedPromise_reject = void 0, e10._closedPromiseState = "rejected");
}
function vt(e10) {
  void 0 !== e10._closedPromise_resolve && (e10._closedPromise_resolve(void 0), e10._closedPromise_resolve = void 0, e10._closedPromise_reject = void 0, e10._closedPromiseState = "resolved");
}
function Rt(e10) {
  e10._readyPromise = u((t13, r10) => {
    e10._readyPromise_resolve = t13, e10._readyPromise_reject = r10;
  }), e10._readyPromiseState = "pending";
}
function Tt(e10, t13) {
  Rt(e10), Ct(e10, t13);
}
function qt(e10) {
  Rt(e10), Et(e10);
}
function Ct(e10, t13) {
  void 0 !== e10._readyPromise_reject && (m2(e10._readyPromise), e10._readyPromise_reject(t13), e10._readyPromise_resolve = void 0, e10._readyPromise_reject = void 0, e10._readyPromiseState = "rejected");
}
function Et(e10) {
  void 0 !== e10._readyPromise_resolve && (e10._readyPromise_resolve(void 0), e10._readyPromise_resolve = void 0, e10._readyPromise_reject = void 0, e10._readyPromiseState = "fulfilled");
}
function kt(e10, t13, r10, o7, n9, a7) {
  const i7 = e10.getReader(), l8 = t13.getWriter();
  Vt(e10) && (e10._disturbed = true);
  let s7, _5, g7, w7 = false, S4 = false, v8 = "readable", R4 = "writable", T4 = false, q7 = false;
  const C4 = u((e11) => {
    g7 = e11;
  });
  let E4 = Promise.resolve(void 0);
  return u((P4, W4) => {
    let k7;
    function O4() {
      if (w7) return;
      const e11 = u((e12, t14) => {
        !(/* @__PURE__ */ __name(function r11(o8) {
          o8 ? e12() : f2(function() {
            if (w7) return c2(true);
            return f2(l8.ready, () => f2(i7.read(), (e13) => !!e13.done || (E4 = l8.write(e13.value), m2(E4), false)));
          }(), r11, t14);
        }, "r"))(false);
      });
      m2(e11);
    }
    __name(O4, "O");
    function B4() {
      return v8 = "closed", r10 ? L4() : z7(() => (Ge(t13) && (T4 = rt(t13), R4 = t13._state), T4 || "closed" === R4 ? c2(void 0) : "erroring" === R4 || "errored" === R4 ? d2(_5) : (T4 = true, l8.close())), false, void 0), null;
    }
    __name(B4, "B");
    function A4(e11) {
      return w7 || (v8 = "errored", s7 = e11, o7 ? L4(true, e11) : z7(() => l8.abort(e11), true, e11)), null;
    }
    __name(A4, "A");
    function j7(e11) {
      return S4 || (R4 = "errored", _5 = e11, n9 ? L4(true, e11) : z7(() => i7.cancel(e11), true, e11)), null;
    }
    __name(j7, "j");
    if (void 0 !== a7 && (k7 = /* @__PURE__ */ __name(() => {
      const e11 = void 0 !== a7.reason ? a7.reason : new Wt("Aborted", "AbortError"), t14 = [];
      o7 || t14.push(() => "writable" === R4 ? l8.abort(e11) : c2(void 0)), n9 || t14.push(() => "readable" === v8 ? i7.cancel(e11) : c2(void 0)), z7(() => Promise.all(t14.map((e12) => e12())), true, e11);
    }, "k"), a7.aborted ? k7() : a7.addEventListener("abort", k7)), Vt(e10) && (v8 = e10._state, s7 = e10._storedError), Ge(t13) && (R4 = t13._state, _5 = t13._storedError, T4 = rt(t13)), Vt(e10) && Ge(t13) && (q7 = true, g7()), "errored" === v8) A4(s7);
    else if ("erroring" === R4 || "errored" === R4) j7(_5);
    else if ("closed" === v8) B4();
    else if (T4 || "closed" === R4) {
      const e11 = new TypeError("the destination writable stream closed before all data could be piped to it");
      n9 ? L4(true, e11) : z7(() => i7.cancel(e11), true, e11);
    }
    function z7(e11, t14, r11) {
      function o8() {
        return "writable" !== R4 || T4 ? n10() : h2(function() {
          let e12;
          return c2((/* @__PURE__ */ __name(function t15() {
            if (e12 !== E4) return e12 = E4, p2(E4, t15, t15);
          }, "t"))());
        }(), n10), null;
      }
      __name(o8, "o");
      function n10() {
        return e11 ? b2(e11(), () => F4(t14, r11), (e12) => F4(true, e12)) : F4(t14, r11), null;
      }
      __name(n10, "n");
      w7 || (w7 = true, q7 ? o8() : h2(C4, o8));
    }
    __name(z7, "z");
    function L4(e11, t14) {
      z7(void 0, e11, t14);
    }
    __name(L4, "L");
    function F4(e11, t14) {
      return S4 = true, l8.releaseLock(), i7.releaseLock(), void 0 !== a7 && a7.removeEventListener("abort", k7), e11 ? W4(t14) : P4(void 0), null;
    }
    __name(F4, "F");
    w7 || (b2(i7.closed, B4, A4), b2(l8.closed, function() {
      return S4 || (R4 = "closed"), null;
    }, j7)), q7 ? O4() : y2(() => {
      q7 = true, g7(), O4();
    });
  });
}
function Ot(e10, t13) {
  return function(e11) {
    try {
      return e11.getReader({ mode: "byob" }).releaseLock(), true;
    } catch (e12) {
      return false;
    }
  }(e10) ? function(e11) {
    let t14, r10, o7, n9, a7, i7 = e11.getReader(), l8 = false, s7 = false, d8 = false, f8 = false, h7 = false, p7 = false;
    const m7 = u((e12) => {
      a7 = e12;
    });
    function y5(e12) {
      _2(e12.closed, (t15) => (e12 !== i7 || (o7.error(t15), n9.error(t15), h7 && p7 || a7(void 0)), null));
    }
    __name(y5, "y");
    function g7() {
      l8 && (i7.releaseLock(), i7 = e11.getReader(), y5(i7), l8 = false), b2(i7.read(), (e12) => {
        var t15, r11;
        if (d8 = false, f8 = false, e12.done) return h7 || o7.close(), p7 || n9.close(), null === (t15 = o7.byobRequest) || void 0 === t15 || t15.respond(0), null === (r11 = n9.byobRequest) || void 0 === r11 || r11.respond(0), h7 && p7 || a7(void 0), null;
        const l9 = e12.value, u7 = l9;
        let c8 = l9;
        if (!h7 && !p7) try {
          c8 = le(l9);
        } catch (e13) {
          return o7.error(e13), n9.error(e13), a7(i7.cancel(e13)), null;
        }
        return h7 || o7.enqueue(u7), p7 || n9.enqueue(c8), s7 = false, d8 ? S4() : f8 && v8(), null;
      }, () => (s7 = false, null));
    }
    __name(g7, "g");
    function w7(t15, r11) {
      l8 || (i7.releaseLock(), i7 = e11.getReader({ mode: "byob" }), y5(i7), l8 = true);
      const u7 = r11 ? n9 : o7, c8 = r11 ? o7 : n9;
      b2(i7.read(t15), (e12) => {
        var t16;
        d8 = false, f8 = false;
        const o8 = r11 ? p7 : h7, n10 = r11 ? h7 : p7;
        if (e12.done) {
          o8 || u7.close(), n10 || c8.close();
          const r12 = e12.value;
          return void 0 !== r12 && (o8 || u7.byobRequest.respondWithNewView(r12), n10 || null === (t16 = c8.byobRequest) || void 0 === t16 || t16.respond(0)), o8 && n10 || a7(void 0), null;
        }
        const l9 = e12.value;
        if (n10) o8 || u7.byobRequest.respondWithNewView(l9);
        else {
          let e13;
          try {
            e13 = le(l9);
          } catch (e14) {
            return u7.error(e14), c8.error(e14), a7(i7.cancel(e14)), null;
          }
          o8 || u7.byobRequest.respondWithNewView(l9), c8.enqueue(e13);
        }
        return s7 = false, d8 ? S4() : f8 && v8(), null;
      }, () => (s7 = false, null));
    }
    __name(w7, "w");
    function S4() {
      if (s7) return d8 = true, c2(void 0);
      s7 = true;
      const e12 = o7.byobRequest;
      return null === e12 ? g7() : w7(e12.view, false), c2(void 0);
    }
    __name(S4, "S");
    function v8() {
      if (s7) return f8 = true, c2(void 0);
      s7 = true;
      const e12 = n9.byobRequest;
      return null === e12 ? g7() : w7(e12.view, true), c2(void 0);
    }
    __name(v8, "v");
    function R4(e12) {
      if (h7 = true, t14 = e12, p7) {
        const e13 = [t14, r10], o8 = i7.cancel(e13);
        a7(o8);
      }
      return m7;
    }
    __name(R4, "R");
    function T4(e12) {
      if (p7 = true, r10 = e12, h7) {
        const e13 = [t14, r10], o8 = i7.cancel(e13);
        a7(o8);
      }
      return m7;
    }
    __name(T4, "T");
    const q7 = new ReadableStream3({ type: "bytes", start(e12) {
      o7 = e12;
    }, pull: S4, cancel: R4 }), C4 = new ReadableStream3({ type: "bytes", start(e12) {
      n9 = e12;
    }, pull: v8, cancel: T4 });
    return y5(i7), [q7, C4];
  }(e10) : function(e11, t14) {
    const r10 = e11.getReader();
    let o7, n9, a7, i7, l8, s7 = false, d8 = false, f8 = false, h7 = false;
    const p7 = u((e12) => {
      l8 = e12;
    });
    function m7() {
      return s7 ? (d8 = true, c2(void 0)) : (s7 = true, b2(r10.read(), (e12) => {
        if (d8 = false, e12.done) return f8 || a7.close(), h7 || i7.close(), f8 && h7 || l8(void 0), null;
        const t15 = e12.value, r11 = t15, o8 = t15;
        return f8 || a7.enqueue(r11), h7 || i7.enqueue(o8), s7 = false, d8 && m7(), null;
      }, () => (s7 = false, null)), c2(void 0));
    }
    __name(m7, "m");
    function y5(e12) {
      if (f8 = true, o7 = e12, h7) {
        const e13 = [o7, n9], t15 = r10.cancel(e13);
        l8(t15);
      }
      return p7;
    }
    __name(y5, "y");
    function g7(e12) {
      if (h7 = true, n9 = e12, f8) {
        const e13 = [o7, n9], t15 = r10.cancel(e13);
        l8(t15);
      }
      return p7;
    }
    __name(g7, "g");
    const w7 = new ReadableStream3({ start(e12) {
      a7 = e12;
    }, pull: m7, cancel: y5 }), S4 = new ReadableStream3({ start(e12) {
      i7 = e12;
    }, pull: m7, cancel: g7 });
    return _2(r10.closed, (e12) => (a7.error(e12), i7.error(e12), f8 && h7 || l8(void 0), null)), [w7, S4];
  }(e10);
}
function Bt(e10) {
  return !!r2(e10) && (!!Object.prototype.hasOwnProperty.call(e10, "_controlledReadableStream") && e10 instanceof ReadableStreamDefaultController);
}
function At(e10) {
  const t13 = function(e11) {
    const t14 = e11._controlledReadableStream;
    if (!Ft(e11)) return false;
    if (!e11._started) return false;
    if (Ut(t14) && X2(t14) > 0) return true;
    if (Lt(e11) > 0) return true;
    return false;
  }(e10);
  if (!t13) return;
  if (e10._pulling) return void (e10._pullAgain = true);
  e10._pulling = true;
  b2(e10._pullAlgorithm(), () => (e10._pulling = false, e10._pullAgain && (e10._pullAgain = false, At(e10)), null), (t14) => (zt(e10, t14), null));
}
function jt(e10) {
  e10._pullAlgorithm = void 0, e10._cancelAlgorithm = void 0, e10._strategySizeAlgorithm = void 0;
}
function zt(e10, t13) {
  const r10 = e10._controlledReadableStream;
  "readable" === r10._state && (ce(e10), jt(e10), Jt(r10, t13));
}
function Lt(e10) {
  const t13 = e10._controlledReadableStream._state;
  return "errored" === t13 ? null : "closed" === t13 ? 0 : e10._strategyHWM - e10._queueTotalSize;
}
function Ft(e10) {
  return !e10._closeRequested && "readable" === e10._controlledReadableStream._state;
}
function It(e10, t13, r10, o7) {
  const n9 = Object.create(ReadableStreamDefaultController.prototype);
  let a7, i7, l8;
  a7 = void 0 !== t13.start ? () => t13.start(n9) : () => {
  }, i7 = void 0 !== t13.pull ? () => t13.pull(n9) : () => c2(void 0), l8 = void 0 !== t13.cancel ? (e11) => t13.cancel(e11) : () => c2(void 0), function(e11, t14, r11, o8, n10, a8, i8) {
    t14._controlledReadableStream = e11, t14._queue = void 0, t14._queueTotalSize = void 0, ce(t14), t14._started = false, t14._closeRequested = false, t14._pullAgain = false, t14._pulling = false, t14._strategySizeAlgorithm = i8, t14._strategyHWM = a8, t14._pullAlgorithm = o8, t14._cancelAlgorithm = n10, e11._readableStreamController = t14, b2(c2(r11()), () => (t14._started = true, At(t14), null), (e12) => (zt(t14, e12), null));
  }(e10, n9, a7, i7, l8, r10, o7);
}
function Dt(e10) {
  return new TypeError(`ReadableStreamDefaultController.prototype.${e10} can only be used on a ReadableStreamDefaultController`);
}
function $t(e10, t13, r10) {
  return I2(e10, r10), (r11) => w2(e10, t13, [r11]);
}
function Mt(e10, t13, r10) {
  return I2(e10, r10), (r11) => w2(e10, t13, [r11]);
}
function Yt(e10, t13, r10) {
  return I2(e10, r10), (r11) => g2(e10, t13, [r11]);
}
function Qt(e10, t13) {
  if ("bytes" !== (e10 = `${e10}`)) throw new TypeError(`${t13} '${e10}' is not a valid enumeration value for ReadableStreamType`);
  return e10;
}
function Nt(e10, t13) {
  if ("byob" !== (e10 = `${e10}`)) throw new TypeError(`${t13} '${e10}' is not a valid enumeration value for ReadableStreamReaderMode`);
  return e10;
}
function Ht(e10, t13) {
  F(e10, t13);
  const r10 = null == e10 ? void 0 : e10.preventAbort, o7 = null == e10 ? void 0 : e10.preventCancel, n9 = null == e10 ? void 0 : e10.preventClose, a7 = null == e10 ? void 0 : e10.signal;
  return void 0 !== a7 && function(e11, t14) {
    if (!function(e12) {
      if ("object" != typeof e12 || null === e12) return false;
      try {
        return "boolean" == typeof e12.aborted;
      } catch (e13) {
        return false;
      }
    }(e11)) throw new TypeError(`${t14} is not an AbortSignal.`);
  }(a7, `${t13} has member 'signal' that`), { preventAbort: Boolean(r10), preventCancel: Boolean(o7), preventClose: Boolean(n9), signal: a7 };
}
function xt(e10, t13) {
  F(e10, t13);
  const r10 = null == e10 ? void 0 : e10.readable;
  M2(r10, "readable", "ReadableWritablePair"), function(e11, t14) {
    if (!H2(e11)) throw new TypeError(`${t14} is not a ReadableStream.`);
  }(r10, `${t13} has member 'readable' that`);
  const o7 = null == e10 ? void 0 : e10.writable;
  return M2(o7, "writable", "ReadableWritablePair"), function(e11, t14) {
    if (!x2(e11)) throw new TypeError(`${t14} is not a WritableStream.`);
  }(o7, `${t13} has member 'writable' that`), { readable: r10, writable: o7 };
}
function Vt(e10) {
  return !!r2(e10) && (!!Object.prototype.hasOwnProperty.call(e10, "_readableStreamController") && e10 instanceof ReadableStream3);
}
function Ut(e10) {
  return void 0 !== e10._reader;
}
function Gt(e10, r10) {
  if (e10._disturbed = true, "closed" === e10._state) return c2(void 0);
  if ("errored" === e10._state) return d2(e10._storedError);
  Xt(e10);
  const o7 = e10._reader;
  if (void 0 !== o7 && Fe(o7)) {
    const e11 = o7._readIntoRequests;
    o7._readIntoRequests = new S2(), e11.forEach((e12) => {
      e12._closeSteps(void 0);
    });
  }
  return p2(e10._readableStreamController[T2](r10), t);
}
function Xt(e10) {
  e10._state = "closed";
  const t13 = e10._reader;
  if (void 0 !== t13 && (j2(t13), K2(t13))) {
    const e11 = t13._readRequests;
    t13._readRequests = new S2(), e11.forEach((e12) => {
      e12._closeSteps();
    });
  }
}
function Jt(e10, t13) {
  e10._state = "errored", e10._storedError = t13;
  const r10 = e10._reader;
  void 0 !== r10 && (A(r10, t13), K2(r10) ? Z2(r10, t13) : Ie(r10, t13));
}
function Kt(e10) {
  return new TypeError(`ReadableStream.prototype.${e10} can only be used on a ReadableStream`);
}
function Zt(e10, t13) {
  F(e10, t13);
  const r10 = null == e10 ? void 0 : e10.highWaterMark;
  return M2(r10, "highWaterMark", "QueuingStrategyInit"), { highWaterMark: Y2(r10) };
}
function tr(e10) {
  return new TypeError(`ByteLengthQueuingStrategy.prototype.${e10} can only be used on a ByteLengthQueuingStrategy`);
}
function rr(e10) {
  return !!r2(e10) && (!!Object.prototype.hasOwnProperty.call(e10, "_byteLengthQueuingStrategyHighWaterMark") && e10 instanceof ByteLengthQueuingStrategy);
}
function nr(e10) {
  return new TypeError(`CountQueuingStrategy.prototype.${e10} can only be used on a CountQueuingStrategy`);
}
function ar(e10) {
  return !!r2(e10) && (!!Object.prototype.hasOwnProperty.call(e10, "_countQueuingStrategyHighWaterMark") && e10 instanceof CountQueuingStrategy);
}
function ir(e10, t13, r10) {
  return I2(e10, r10), (r11) => w2(e10, t13, [r11]);
}
function lr(e10, t13, r10) {
  return I2(e10, r10), (r11) => g2(e10, t13, [r11]);
}
function sr(e10, t13, r10) {
  return I2(e10, r10), (r11, o7) => w2(e10, t13, [r11, o7]);
}
function ur(e10) {
  return !!r2(e10) && (!!Object.prototype.hasOwnProperty.call(e10, "_transformStreamController") && e10 instanceof TransformStream2);
}
function cr(e10, t13) {
  Sr(e10, t13), dr(e10, t13);
}
function dr(e10, t13) {
  hr(e10._transformStreamController), function(e11, t14) {
    e11._writableController.error(t14);
    "writable" === e11._writableState && Tr(e11, t14);
  }(e10, t13), e10._backpressure && fr(e10, false);
}
function fr(e10, t13) {
  void 0 !== e10._backpressureChangePromise && e10._backpressureChangePromise_resolve(), e10._backpressureChangePromise = u((t14) => {
    e10._backpressureChangePromise_resolve = t14;
  }), e10._backpressure = t13;
}
function br(e10) {
  return !!r2(e10) && (!!Object.prototype.hasOwnProperty.call(e10, "_controlledTransformStream") && e10 instanceof TransformStreamDefaultController);
}
function hr(e10) {
  e10._transformAlgorithm = void 0, e10._flushAlgorithm = void 0;
}
function _r(e10, t13) {
  const r10 = e10._controlledTransformStream;
  if (!gr(r10)) throw new TypeError("Readable side is not in a state that permits enqueue");
  try {
    !function(e11, t14) {
      e11._readablePulling = false;
      try {
        e11._readableController.enqueue(t14);
      } catch (t15) {
        throw Sr(e11, t15), t15;
      }
    }(r10, t13);
  } catch (e11) {
    throw dr(r10, e11), r10._readableStoredError;
  }
  const o7 = function(e11) {
    return !function(e12) {
      if (!gr(e12)) return false;
      if (e12._readablePulling) return true;
      if (vr(e12) > 0) return true;
      return false;
    }(e11);
  }(r10);
  o7 !== r10._backpressure && fr(r10, true);
}
function pr(e10, t13) {
  return p2(e10._transformAlgorithm(t13), void 0, (t14) => {
    throw cr(e10._controlledTransformStream, t14), t14;
  });
}
function mr(e10) {
  return new TypeError(`TransformStreamDefaultController.prototype.${e10} can only be used on a TransformStreamDefaultController`);
}
function yr(e10) {
  return new TypeError(`TransformStream.prototype.${e10} can only be used on a TransformStream`);
}
function gr(e10) {
  return !e10._readableCloseRequested && "readable" === e10._readableState;
}
function wr(e10) {
  e10._readableState = "closed", e10._readableCloseRequested = true, e10._readableController.close();
}
function Sr(e10, t13) {
  "readable" === e10._readableState && (e10._readableState = "errored", e10._readableStoredError = t13), e10._readableController.error(t13);
}
function vr(e10) {
  return e10._readableController.desiredSize;
}
function Rr(e10, t13) {
  "writable" !== e10._writableState ? qr(e10) : Tr(e10, t13);
}
function Tr(e10, t13) {
  e10._writableState = "erroring", e10._writableStoredError = t13, !function(e11) {
    return e11._writableHasInFlightOperation;
  }(e10) && e10._writableStarted && qr(e10);
}
function qr(e10) {
  e10._writableState = "errored";
}
function Cr(e10) {
  "erroring" === e10._writableState && qr(e10);
}
var e, o, a, i, l2, s, y2, S2, v2, R2, T2, q2, C, z3, L2, ReadableStreamDefaultReader, te, re, ae, ReadableStreamBYOBRequest, ReadableByteStreamController, ReadableStreamBYOBReader, Ue, WritableStream2, WritableStreamDefaultWriter, lt, WritableStreamDefaultController, Pt, Wt, ReadableStreamDefaultController, ReadableStream3, er, ByteLengthQueuingStrategy, or, CountQueuingStrategy, TransformStream2, TransformStreamDefaultController;
var init_ponyfill = __esm({
  "../../node_modules/.pnpm/web-streams-polyfill@4.0.0-beta.3/node_modules/web-streams-polyfill/dist/ponyfill.mjs"() {
    init_import_meta_url();
    e = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? Symbol : (e10) => `Symbol(${e10})`;
    __name(t, "t");
    __name(r2, "r");
    o = t;
    __name(n, "n");
    a = Promise;
    i = Promise.prototype.then;
    l2 = Promise.resolve.bind(a);
    s = Promise.reject.bind(a);
    __name(u, "u");
    __name(c2, "c");
    __name(d2, "d");
    __name(f2, "f");
    __name(b2, "b");
    __name(h2, "h");
    __name(_2, "_");
    __name(p2, "p");
    __name(m2, "m");
    y2 = /* @__PURE__ */ __name((e10) => {
      if ("function" == typeof queueMicrotask) y2 = queueMicrotask;
      else {
        const e11 = c2(void 0);
        y2 = /* @__PURE__ */ __name((t13) => f2(e11, t13), "y");
      }
      return y2(e10);
    }, "y");
    __name(g2, "g");
    __name(w2, "w");
    S2 = class {
      static {
        __name(this, "S");
      }
      constructor() {
        this._cursor = 0, this._size = 0, this._front = { _elements: [], _next: void 0 }, this._back = this._front, this._cursor = 0, this._size = 0;
      }
      get length() {
        return this._size;
      }
      push(e10) {
        const t13 = this._back;
        let r10 = t13;
        16383 === t13._elements.length && (r10 = { _elements: [], _next: void 0 }), t13._elements.push(e10), r10 !== t13 && (this._back = r10, t13._next = r10), ++this._size;
      }
      shift() {
        const e10 = this._front;
        let t13 = e10;
        const r10 = this._cursor;
        let o7 = r10 + 1;
        const n9 = e10._elements, a7 = n9[r10];
        return 16384 === o7 && (t13 = e10._next, o7 = 0), --this._size, this._cursor = o7, e10 !== t13 && (this._front = t13), n9[r10] = void 0, a7;
      }
      forEach(e10) {
        let t13 = this._cursor, r10 = this._front, o7 = r10._elements;
        for (; !(t13 === o7.length && void 0 === r10._next || t13 === o7.length && (r10 = r10._next, o7 = r10._elements, t13 = 0, 0 === o7.length)); ) e10(o7[t13]), ++t13;
      }
      peek() {
        const e10 = this._front, t13 = this._cursor;
        return e10._elements[t13];
      }
    };
    v2 = e("[[AbortSteps]]");
    R2 = e("[[ErrorSteps]]");
    T2 = e("[[CancelSteps]]");
    q2 = e("[[PullSteps]]");
    C = e("[[ReleaseSteps]]");
    __name(E, "E");
    __name(P2, "P");
    __name(W2, "W");
    __name(k2, "k");
    __name(O2, "O");
    __name(B, "B");
    __name(A, "A");
    __name(j2, "j");
    z3 = Number.isFinite || function(e10) {
      return "number" == typeof e10 && isFinite(e10);
    };
    L2 = Math.trunc || function(e10) {
      return e10 < 0 ? Math.ceil(e10) : Math.floor(e10);
    };
    __name(F, "F");
    __name(I2, "I");
    __name(D, "D");
    __name($2, "$");
    __name(M2, "M");
    __name(Y2, "Y");
    __name(Q2, "Q");
    __name(N2, "N");
    __name(H2, "H");
    __name(x2, "x");
    __name(V2, "V");
    __name(U2, "U");
    __name(G2, "G");
    __name(X2, "X");
    __name(J2, "J");
    ReadableStreamDefaultReader = class {
      static {
        __name(this, "ReadableStreamDefaultReader");
      }
      constructor(e10) {
        if ($2(e10, 1, "ReadableStreamDefaultReader"), V2(e10, "First parameter"), Ut(e10)) throw new TypeError("This stream has already been locked for exclusive reading by another reader");
        E(this, e10), this._readRequests = new S2();
      }
      get closed() {
        return K2(this) ? this._closedPromise : d2(ee("closed"));
      }
      cancel(e10) {
        return K2(this) ? void 0 === this._ownerReadableStream ? d2(k2("cancel")) : P2(this, e10) : d2(ee("cancel"));
      }
      read() {
        if (!K2(this)) return d2(ee("read"));
        if (void 0 === this._ownerReadableStream) return d2(k2("read from"));
        let e10, t13;
        const r10 = u((r11, o7) => {
          e10 = r11, t13 = o7;
        });
        return function(e11, t14) {
          const r11 = e11._ownerReadableStream;
          r11._disturbed = true, "closed" === r11._state ? t14._closeSteps() : "errored" === r11._state ? t14._errorSteps(r11._storedError) : r11._readableStreamController[q2](t14);
        }(this, { _chunkSteps: /* @__PURE__ */ __name((t14) => e10({ value: t14, done: false }), "_chunkSteps"), _closeSteps: /* @__PURE__ */ __name(() => e10({ value: void 0, done: true }), "_closeSteps"), _errorSteps: /* @__PURE__ */ __name((e11) => t13(e11), "_errorSteps") }), r10;
      }
      releaseLock() {
        if (!K2(this)) throw ee("releaseLock");
        void 0 !== this._ownerReadableStream && function(e10) {
          W2(e10);
          const t13 = new TypeError("Reader was released");
          Z2(e10, t13);
        }(this);
      }
    };
    __name(K2, "K");
    __name(Z2, "Z");
    __name(ee, "ee");
    Object.defineProperties(ReadableStreamDefaultReader.prototype, { cancel: { enumerable: true }, read: { enumerable: true }, releaseLock: { enumerable: true }, closed: { enumerable: true } }), n(ReadableStreamDefaultReader.prototype.cancel, "cancel"), n(ReadableStreamDefaultReader.prototype.read, "read"), n(ReadableStreamDefaultReader.prototype.releaseLock, "releaseLock"), "symbol" == typeof e.toStringTag && Object.defineProperty(ReadableStreamDefaultReader.prototype, e.toStringTag, { value: "ReadableStreamDefaultReader", configurable: true });
    te = class {
      static {
        __name(this, "te");
      }
      constructor(e10, t13) {
        this._ongoingPromise = void 0, this._isFinished = false, this._reader = e10, this._preventCancel = t13;
      }
      next() {
        const e10 = /* @__PURE__ */ __name(() => this._nextSteps(), "e");
        return this._ongoingPromise = this._ongoingPromise ? p2(this._ongoingPromise, e10, e10) : e10(), this._ongoingPromise;
      }
      return(e10) {
        const t13 = /* @__PURE__ */ __name(() => this._returnSteps(e10), "t");
        return this._ongoingPromise ? p2(this._ongoingPromise, t13, t13) : t13();
      }
      _nextSteps() {
        if (this._isFinished) return Promise.resolve({ value: void 0, done: true });
        const e10 = this._reader;
        return void 0 === e10 ? d2(k2("iterate")) : f2(e10.read(), (e11) => {
          var t13;
          return this._ongoingPromise = void 0, e11.done && (this._isFinished = true, null === (t13 = this._reader) || void 0 === t13 || t13.releaseLock(), this._reader = void 0), e11;
        }, (e11) => {
          var t13;
          throw this._ongoingPromise = void 0, this._isFinished = true, null === (t13 = this._reader) || void 0 === t13 || t13.releaseLock(), this._reader = void 0, e11;
        });
      }
      _returnSteps(e10) {
        if (this._isFinished) return Promise.resolve({ value: e10, done: true });
        this._isFinished = true;
        const t13 = this._reader;
        if (void 0 === t13) return d2(k2("finish iterating"));
        if (this._reader = void 0, !this._preventCancel) {
          const r10 = t13.cancel(e10);
          return t13.releaseLock(), p2(r10, () => ({ value: e10, done: true }));
        }
        return t13.releaseLock(), c2({ value: e10, done: true });
      }
    };
    re = { next() {
      return oe(this) ? this._asyncIteratorImpl.next() : d2(ne("next"));
    }, return(e10) {
      return oe(this) ? this._asyncIteratorImpl.return(e10) : d2(ne("return"));
    } };
    __name(oe, "oe");
    __name(ne, "ne");
    "symbol" == typeof e.asyncIterator && Object.defineProperty(re, e.asyncIterator, { value() {
      return this;
    }, writable: true, configurable: true });
    ae = Number.isNaN || function(e10) {
      return e10 != e10;
    };
    __name(ie, "ie");
    __name(le, "le");
    __name(se, "se");
    __name(ue, "ue");
    __name(ce, "ce");
    ReadableStreamBYOBRequest = class {
      static {
        __name(this, "ReadableStreamBYOBRequest");
      }
      constructor() {
        throw new TypeError("Illegal constructor");
      }
      get view() {
        if (!fe(this)) throw Be("view");
        return this._view;
      }
      respond(e10) {
        if (!fe(this)) throw Be("respond");
        if ($2(e10, 1, "respond"), e10 = N2(e10, "First parameter"), void 0 === this._associatedReadableByteStreamController) throw new TypeError("This BYOB request has been invalidated");
        this._view.buffer, function(e11, t13) {
          const r10 = e11._pendingPullIntos.peek();
          if ("closed" === e11._controlledReadableByteStream._state) {
            if (0 !== t13) throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream");
          } else {
            if (0 === t13) throw new TypeError("bytesWritten must be greater than 0 when calling respond() on a readable stream");
            if (r10.bytesFilled + t13 > r10.byteLength) throw new RangeError("bytesWritten out of range");
          }
          r10.buffer = r10.buffer, qe(e11, t13);
        }(this._associatedReadableByteStreamController, e10);
      }
      respondWithNewView(e10) {
        if (!fe(this)) throw Be("respondWithNewView");
        if ($2(e10, 1, "respondWithNewView"), !ArrayBuffer.isView(e10)) throw new TypeError("You can only respond with array buffer views");
        if (void 0 === this._associatedReadableByteStreamController) throw new TypeError("This BYOB request has been invalidated");
        e10.buffer, function(e11, t13) {
          const r10 = e11._pendingPullIntos.peek();
          if ("closed" === e11._controlledReadableByteStream._state) {
            if (0 !== t13.byteLength) throw new TypeError("The view's length must be 0 when calling respondWithNewView() on a closed stream");
          } else if (0 === t13.byteLength) throw new TypeError("The view's length must be greater than 0 when calling respondWithNewView() on a readable stream");
          if (r10.byteOffset + r10.bytesFilled !== t13.byteOffset) throw new RangeError("The region specified by view does not match byobRequest");
          if (r10.bufferByteLength !== t13.buffer.byteLength) throw new RangeError("The buffer of view has different capacity than byobRequest");
          if (r10.bytesFilled + t13.byteLength > r10.byteLength) throw new RangeError("The region specified by view is larger than byobRequest");
          const o7 = t13.byteLength;
          r10.buffer = t13.buffer, qe(e11, o7);
        }(this._associatedReadableByteStreamController, e10);
      }
    };
    Object.defineProperties(ReadableStreamBYOBRequest.prototype, { respond: { enumerable: true }, respondWithNewView: { enumerable: true }, view: { enumerable: true } }), n(ReadableStreamBYOBRequest.prototype.respond, "respond"), n(ReadableStreamBYOBRequest.prototype.respondWithNewView, "respondWithNewView"), "symbol" == typeof e.toStringTag && Object.defineProperty(ReadableStreamBYOBRequest.prototype, e.toStringTag, { value: "ReadableStreamBYOBRequest", configurable: true });
    ReadableByteStreamController = class {
      static {
        __name(this, "ReadableByteStreamController");
      }
      constructor() {
        throw new TypeError("Illegal constructor");
      }
      get byobRequest() {
        if (!de(this)) throw Ae("byobRequest");
        return function(e10) {
          if (null === e10._byobRequest && e10._pendingPullIntos.length > 0) {
            const t13 = e10._pendingPullIntos.peek(), r10 = new Uint8Array(t13.buffer, t13.byteOffset + t13.bytesFilled, t13.byteLength - t13.bytesFilled), o7 = Object.create(ReadableStreamBYOBRequest.prototype);
            !function(e11, t14, r11) {
              e11._associatedReadableByteStreamController = t14, e11._view = r11;
            }(o7, e10, r10), e10._byobRequest = o7;
          }
          return e10._byobRequest;
        }(this);
      }
      get desiredSize() {
        if (!de(this)) throw Ae("desiredSize");
        return ke(this);
      }
      close() {
        if (!de(this)) throw Ae("close");
        if (this._closeRequested) throw new TypeError("The stream has already been closed; do not close it again!");
        const e10 = this._controlledReadableByteStream._state;
        if ("readable" !== e10) throw new TypeError(`The stream (in ${e10} state) is not in the readable state and cannot be closed`);
        !function(e11) {
          const t13 = e11._controlledReadableByteStream;
          if (e11._closeRequested || "readable" !== t13._state) return;
          if (e11._queueTotalSize > 0) return void (e11._closeRequested = true);
          if (e11._pendingPullIntos.length > 0) {
            if (e11._pendingPullIntos.peek().bytesFilled > 0) {
              const t14 = new TypeError("Insufficient bytes to fill elements in the given buffer");
              throw Pe(e11, t14), t14;
            }
          }
          Ee(e11), Xt(t13);
        }(this);
      }
      enqueue(e10) {
        if (!de(this)) throw Ae("enqueue");
        if ($2(e10, 1, "enqueue"), !ArrayBuffer.isView(e10)) throw new TypeError("chunk must be an array buffer view");
        if (0 === e10.byteLength) throw new TypeError("chunk must have non-zero byteLength");
        if (0 === e10.buffer.byteLength) throw new TypeError("chunk's buffer must have non-zero byteLength");
        if (this._closeRequested) throw new TypeError("stream is closed or draining");
        const t13 = this._controlledReadableByteStream._state;
        if ("readable" !== t13) throw new TypeError(`The stream (in ${t13} state) is not in the readable state and cannot be enqueued to`);
        !function(e11, t14) {
          const r10 = e11._controlledReadableByteStream;
          if (e11._closeRequested || "readable" !== r10._state) return;
          const o7 = t14.buffer, n9 = t14.byteOffset, a7 = t14.byteLength, i7 = o7;
          if (e11._pendingPullIntos.length > 0) {
            const t15 = e11._pendingPullIntos.peek();
            t15.buffer, Re(e11), t15.buffer = t15.buffer, "none" === t15.readerType && ge(e11, t15);
          }
          if (J2(r10)) if (function(e12) {
            const t15 = e12._controlledReadableByteStream._reader;
            for (; t15._readRequests.length > 0; ) {
              if (0 === e12._queueTotalSize) return;
              We(e12, t15._readRequests.shift());
            }
          }(e11), 0 === X2(r10)) me(e11, i7, n9, a7);
          else {
            e11._pendingPullIntos.length > 0 && Ce(e11);
            G2(r10, new Uint8Array(i7, n9, a7), false);
          }
          else Le(r10) ? (me(e11, i7, n9, a7), Te(e11)) : me(e11, i7, n9, a7);
          be(e11);
        }(this, e10);
      }
      error(e10) {
        if (!de(this)) throw Ae("error");
        Pe(this, e10);
      }
      [T2](e10) {
        he(this), ce(this);
        const t13 = this._cancelAlgorithm(e10);
        return Ee(this), t13;
      }
      [q2](e10) {
        const t13 = this._controlledReadableByteStream;
        if (this._queueTotalSize > 0) return void We(this, e10);
        const r10 = this._autoAllocateChunkSize;
        if (void 0 !== r10) {
          let t14;
          try {
            t14 = new ArrayBuffer(r10);
          } catch (t15) {
            return void e10._errorSteps(t15);
          }
          const o7 = { buffer: t14, bufferByteLength: r10, byteOffset: 0, byteLength: r10, bytesFilled: 0, elementSize: 1, viewConstructor: Uint8Array, readerType: "default" };
          this._pendingPullIntos.push(o7);
        }
        U2(t13, e10), be(this);
      }
      [C]() {
        if (this._pendingPullIntos.length > 0) {
          const e10 = this._pendingPullIntos.peek();
          e10.readerType = "none", this._pendingPullIntos = new S2(), this._pendingPullIntos.push(e10);
        }
      }
    };
    __name(de, "de");
    __name(fe, "fe");
    __name(be, "be");
    __name(he, "he");
    __name(_e, "_e");
    __name(pe, "pe");
    __name(me, "me");
    __name(ye, "ye");
    __name(ge, "ge");
    __name(we, "we");
    __name(Se, "Se");
    __name(ve, "ve");
    __name(Re, "Re");
    __name(Te, "Te");
    __name(qe, "qe");
    __name(Ce, "Ce");
    __name(Ee, "Ee");
    __name(Pe, "Pe");
    __name(We, "We");
    __name(ke, "ke");
    __name(Oe, "Oe");
    __name(Be, "Be");
    __name(Ae, "Ae");
    __name(je, "je");
    __name(ze, "ze");
    __name(Le, "Le");
    Object.defineProperties(ReadableByteStreamController.prototype, { close: { enumerable: true }, enqueue: { enumerable: true }, error: { enumerable: true }, byobRequest: { enumerable: true }, desiredSize: { enumerable: true } }), n(ReadableByteStreamController.prototype.close, "close"), n(ReadableByteStreamController.prototype.enqueue, "enqueue"), n(ReadableByteStreamController.prototype.error, "error"), "symbol" == typeof e.toStringTag && Object.defineProperty(ReadableByteStreamController.prototype, e.toStringTag, { value: "ReadableByteStreamController", configurable: true });
    ReadableStreamBYOBReader = class {
      static {
        __name(this, "ReadableStreamBYOBReader");
      }
      constructor(e10) {
        if ($2(e10, 1, "ReadableStreamBYOBReader"), V2(e10, "First parameter"), Ut(e10)) throw new TypeError("This stream has already been locked for exclusive reading by another reader");
        if (!de(e10._readableStreamController)) throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");
        E(this, e10), this._readIntoRequests = new S2();
      }
      get closed() {
        return Fe(this) ? this._closedPromise : d2(De("closed"));
      }
      cancel(e10) {
        return Fe(this) ? void 0 === this._ownerReadableStream ? d2(k2("cancel")) : P2(this, e10) : d2(De("cancel"));
      }
      read(e10) {
        if (!Fe(this)) return d2(De("read"));
        if (!ArrayBuffer.isView(e10)) return d2(new TypeError("view must be an array buffer view"));
        if (0 === e10.byteLength) return d2(new TypeError("view must have non-zero byteLength"));
        if (0 === e10.buffer.byteLength) return d2(new TypeError("view's buffer must have non-zero byteLength"));
        if (e10.buffer, void 0 === this._ownerReadableStream) return d2(k2("read from"));
        let t13, r10;
        const o7 = u((e11, o8) => {
          t13 = e11, r10 = o8;
        });
        return function(e11, t14, r11) {
          const o8 = e11._ownerReadableStream;
          o8._disturbed = true, "errored" === o8._state ? r11._errorSteps(o8._storedError) : function(e12, t15, r12) {
            const o9 = e12._controlledReadableByteStream;
            let n9 = 1;
            t15.constructor !== DataView && (n9 = t15.constructor.BYTES_PER_ELEMENT);
            const a7 = t15.constructor, i7 = t15.buffer, l8 = { buffer: i7, bufferByteLength: i7.byteLength, byteOffset: t15.byteOffset, byteLength: t15.byteLength, bytesFilled: 0, elementSize: n9, viewConstructor: a7, readerType: "byob" };
            if (e12._pendingPullIntos.length > 0) return e12._pendingPullIntos.push(l8), void je(o9, r12);
            if ("closed" !== o9._state) {
              if (e12._queueTotalSize > 0) {
                if (we(e12, l8)) {
                  const t16 = pe(l8);
                  return ve(e12), void r12._chunkSteps(t16);
                }
                if (e12._closeRequested) {
                  const t16 = new TypeError("Insufficient bytes to fill elements in the given buffer");
                  return Pe(e12, t16), void r12._errorSteps(t16);
                }
              }
              e12._pendingPullIntos.push(l8), je(o9, r12), be(e12);
            } else {
              const e13 = new a7(l8.buffer, l8.byteOffset, 0);
              r12._closeSteps(e13);
            }
          }(o8._readableStreamController, t14, r11);
        }(this, e10, { _chunkSteps: /* @__PURE__ */ __name((e11) => t13({ value: e11, done: false }), "_chunkSteps"), _closeSteps: /* @__PURE__ */ __name((e11) => t13({ value: e11, done: true }), "_closeSteps"), _errorSteps: /* @__PURE__ */ __name((e11) => r10(e11), "_errorSteps") }), o7;
      }
      releaseLock() {
        if (!Fe(this)) throw De("releaseLock");
        void 0 !== this._ownerReadableStream && function(e10) {
          W2(e10);
          const t13 = new TypeError("Reader was released");
          Ie(e10, t13);
        }(this);
      }
    };
    __name(Fe, "Fe");
    __name(Ie, "Ie");
    __name(De, "De");
    __name($e, "$e");
    __name(Me, "Me");
    __name(Ye, "Ye");
    __name(Qe, "Qe");
    __name(Ne, "Ne");
    __name(He, "He");
    __name(xe, "xe");
    __name(Ve, "Ve");
    Object.defineProperties(ReadableStreamBYOBReader.prototype, { cancel: { enumerable: true }, read: { enumerable: true }, releaseLock: { enumerable: true }, closed: { enumerable: true } }), n(ReadableStreamBYOBReader.prototype.cancel, "cancel"), n(ReadableStreamBYOBReader.prototype.read, "read"), n(ReadableStreamBYOBReader.prototype.releaseLock, "releaseLock"), "symbol" == typeof e.toStringTag && Object.defineProperty(ReadableStreamBYOBReader.prototype, e.toStringTag, { value: "ReadableStreamBYOBReader", configurable: true });
    Ue = "function" == typeof AbortController;
    WritableStream2 = class {
      static {
        __name(this, "WritableStream");
      }
      constructor(e10 = {}, t13 = {}) {
        void 0 === e10 ? e10 = null : D(e10, "First parameter");
        const r10 = Ye(t13, "Second parameter"), o7 = function(e11, t14) {
          F(e11, t14);
          const r11 = null == e11 ? void 0 : e11.abort, o8 = null == e11 ? void 0 : e11.close, n10 = null == e11 ? void 0 : e11.start, a8 = null == e11 ? void 0 : e11.type, i7 = null == e11 ? void 0 : e11.write;
          return { abort: void 0 === r11 ? void 0 : Ne(r11, e11, `${t14} has member 'abort' that`), close: void 0 === o8 ? void 0 : He(o8, e11, `${t14} has member 'close' that`), start: void 0 === n10 ? void 0 : xe(n10, e11, `${t14} has member 'start' that`), write: void 0 === i7 ? void 0 : Ve(i7, e11, `${t14} has member 'write' that`), type: a8 };
        }(e10, "First parameter");
        var n9;
        (n9 = this)._state = "writable", n9._storedError = void 0, n9._writer = void 0, n9._writableStreamController = void 0, n9._writeRequests = new S2(), n9._inFlightWriteRequest = void 0, n9._closeRequest = void 0, n9._inFlightCloseRequest = void 0, n9._pendingAbortRequest = void 0, n9._backpressure = false;
        if (void 0 !== o7.type) throw new RangeError("Invalid type is specified");
        const a7 = Me(r10);
        !function(e11, t14, r11, o8) {
          const n10 = Object.create(WritableStreamDefaultController.prototype);
          let a8, i7, l8, s7;
          a8 = void 0 !== t14.start ? () => t14.start(n10) : () => {
          };
          i7 = void 0 !== t14.write ? (e12) => t14.write(e12, n10) : () => c2(void 0);
          l8 = void 0 !== t14.close ? () => t14.close() : () => c2(void 0);
          s7 = void 0 !== t14.abort ? (e12) => t14.abort(e12) : () => c2(void 0);
          !function(e12, t15, r12, o9, n11, a9, i8, l9) {
            t15._controlledWritableStream = e12, e12._writableStreamController = t15, t15._queue = void 0, t15._queueTotalSize = void 0, ce(t15), t15._abortReason = void 0, t15._abortController = function() {
              if (Ue) return new AbortController();
            }(), t15._started = false, t15._strategySizeAlgorithm = l9, t15._strategyHWM = i8, t15._writeAlgorithm = o9, t15._closeAlgorithm = n11, t15._abortAlgorithm = a9;
            const s8 = bt(t15);
            nt(e12, s8);
            const u7 = r12();
            b2(c2(u7), () => (t15._started = true, dt(t15), null), (r13) => (t15._started = true, Ze(e12, r13), null));
          }(e11, n10, a8, i7, l8, s7, r11, o8);
        }(this, o7, $e(r10, 1), a7);
      }
      get locked() {
        if (!Ge(this)) throw _t("locked");
        return Xe(this);
      }
      abort(e10) {
        return Ge(this) ? Xe(this) ? d2(new TypeError("Cannot abort a stream that already has a writer")) : Je(this, e10) : d2(_t("abort"));
      }
      close() {
        return Ge(this) ? Xe(this) ? d2(new TypeError("Cannot close a stream that already has a writer")) : rt(this) ? d2(new TypeError("Cannot close an already-closing stream")) : Ke(this) : d2(_t("close"));
      }
      getWriter() {
        if (!Ge(this)) throw _t("getWriter");
        return new WritableStreamDefaultWriter(this);
      }
    };
    __name(Ge, "Ge");
    __name(Xe, "Xe");
    __name(Je, "Je");
    __name(Ke, "Ke");
    __name(Ze, "Ze");
    __name(et, "et");
    __name(tt, "tt");
    __name(rt, "rt");
    __name(ot, "ot");
    __name(nt, "nt");
    Object.defineProperties(WritableStream2.prototype, { abort: { enumerable: true }, close: { enumerable: true }, getWriter: { enumerable: true }, locked: { enumerable: true } }), n(WritableStream2.prototype.abort, "abort"), n(WritableStream2.prototype.close, "close"), n(WritableStream2.prototype.getWriter, "getWriter"), "symbol" == typeof e.toStringTag && Object.defineProperty(WritableStream2.prototype, e.toStringTag, { value: "WritableStream", configurable: true });
    WritableStreamDefaultWriter = class {
      static {
        __name(this, "WritableStreamDefaultWriter");
      }
      constructor(e10) {
        if ($2(e10, 1, "WritableStreamDefaultWriter"), function(e11, t14) {
          if (!Ge(e11)) throw new TypeError(`${t14} is not a WritableStream.`);
        }(e10, "First parameter"), Xe(e10)) throw new TypeError("This stream has already been locked for exclusive writing by another writer");
        this._ownerWritableStream = e10, e10._writer = this;
        const t13 = e10._state;
        if ("writable" === t13) !rt(e10) && e10._backpressure ? Rt(this) : qt(this), gt(this);
        else if ("erroring" === t13) Tt(this, e10._storedError), gt(this);
        else if ("closed" === t13) qt(this), gt(r10 = this), vt(r10);
        else {
          const t14 = e10._storedError;
          Tt(this, t14), wt(this, t14);
        }
        var r10;
      }
      get closed() {
        return at(this) ? this._closedPromise : d2(mt("closed"));
      }
      get desiredSize() {
        if (!at(this)) throw mt("desiredSize");
        if (void 0 === this._ownerWritableStream) throw yt("desiredSize");
        return function(e10) {
          const t13 = e10._ownerWritableStream, r10 = t13._state;
          if ("errored" === r10 || "erroring" === r10) return null;
          if ("closed" === r10) return 0;
          return ct(t13._writableStreamController);
        }(this);
      }
      get ready() {
        return at(this) ? this._readyPromise : d2(mt("ready"));
      }
      abort(e10) {
        return at(this) ? void 0 === this._ownerWritableStream ? d2(yt("abort")) : function(e11, t13) {
          return Je(e11._ownerWritableStream, t13);
        }(this, e10) : d2(mt("abort"));
      }
      close() {
        if (!at(this)) return d2(mt("close"));
        const e10 = this._ownerWritableStream;
        return void 0 === e10 ? d2(yt("close")) : rt(e10) ? d2(new TypeError("Cannot close an already-closing stream")) : Ke(this._ownerWritableStream);
      }
      releaseLock() {
        if (!at(this)) throw mt("releaseLock");
        void 0 !== this._ownerWritableStream && function(e10) {
          const t13 = e10._ownerWritableStream, r10 = new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");
          it(e10, r10), function(e11, t14) {
            "pending" === e11._closedPromiseState ? St(e11, t14) : function(e12, t15) {
              wt(e12, t15);
            }(e11, t14);
          }(e10, r10), t13._writer = void 0, e10._ownerWritableStream = void 0;
        }(this);
      }
      write(e10) {
        return at(this) ? void 0 === this._ownerWritableStream ? d2(yt("write to")) : function(e11, t13) {
          const r10 = e11._ownerWritableStream, o7 = r10._writableStreamController, n9 = function(e12, t14) {
            try {
              return e12._strategySizeAlgorithm(t14);
            } catch (t15) {
              return ft(e12, t15), 1;
            }
          }(o7, t13);
          if (r10 !== e11._ownerWritableStream) return d2(yt("write to"));
          const a7 = r10._state;
          if ("errored" === a7) return d2(r10._storedError);
          if (rt(r10) || "closed" === a7) return d2(new TypeError("The stream is closing or closed and cannot be written to"));
          if ("erroring" === a7) return d2(r10._storedError);
          const i7 = function(e12) {
            return u((t14, r11) => {
              const o8 = { _resolve: t14, _reject: r11 };
              e12._writeRequests.push(o8);
            });
          }(r10);
          return function(e12, t14, r11) {
            try {
              ue(e12, t14, r11);
            } catch (t15) {
              return void ft(e12, t15);
            }
            const o8 = e12._controlledWritableStream;
            if (!rt(o8) && "writable" === o8._state) {
              nt(o8, bt(e12));
            }
            dt(e12);
          }(o7, t13, n9), i7;
        }(this, e10) : d2(mt("write"));
      }
    };
    __name(at, "at");
    __name(it, "it");
    Object.defineProperties(WritableStreamDefaultWriter.prototype, { abort: { enumerable: true }, close: { enumerable: true }, releaseLock: { enumerable: true }, write: { enumerable: true }, closed: { enumerable: true }, desiredSize: { enumerable: true }, ready: { enumerable: true } }), n(WritableStreamDefaultWriter.prototype.abort, "abort"), n(WritableStreamDefaultWriter.prototype.close, "close"), n(WritableStreamDefaultWriter.prototype.releaseLock, "releaseLock"), n(WritableStreamDefaultWriter.prototype.write, "write"), "symbol" == typeof e.toStringTag && Object.defineProperty(WritableStreamDefaultWriter.prototype, e.toStringTag, { value: "WritableStreamDefaultWriter", configurable: true });
    lt = {};
    WritableStreamDefaultController = class {
      static {
        __name(this, "WritableStreamDefaultController");
      }
      constructor() {
        throw new TypeError("Illegal constructor");
      }
      get abortReason() {
        if (!st(this)) throw pt("abortReason");
        return this._abortReason;
      }
      get signal() {
        if (!st(this)) throw pt("signal");
        if (void 0 === this._abortController) throw new TypeError("WritableStreamDefaultController.prototype.signal is not supported");
        return this._abortController.signal;
      }
      error(e10) {
        if (!st(this)) throw pt("error");
        "writable" === this._controlledWritableStream._state && ht(this, e10);
      }
      [v2](e10) {
        const t13 = this._abortAlgorithm(e10);
        return ut(this), t13;
      }
      [R2]() {
        ce(this);
      }
    };
    __name(st, "st");
    __name(ut, "ut");
    __name(ct, "ct");
    __name(dt, "dt");
    __name(ft, "ft");
    __name(bt, "bt");
    __name(ht, "ht");
    __name(_t, "_t");
    __name(pt, "pt");
    __name(mt, "mt");
    __name(yt, "yt");
    __name(gt, "gt");
    __name(wt, "wt");
    __name(St, "St");
    __name(vt, "vt");
    __name(Rt, "Rt");
    __name(Tt, "Tt");
    __name(qt, "qt");
    __name(Ct, "Ct");
    __name(Et, "Et");
    Object.defineProperties(WritableStreamDefaultController.prototype, { abortReason: { enumerable: true }, signal: { enumerable: true }, error: { enumerable: true } }), "symbol" == typeof e.toStringTag && Object.defineProperty(WritableStreamDefaultController.prototype, e.toStringTag, { value: "WritableStreamDefaultController", configurable: true });
    Pt = "undefined" != typeof DOMException ? DOMException : void 0;
    Wt = function(e10) {
      if ("function" != typeof e10 && "object" != typeof e10) return false;
      try {
        return new e10(), true;
      } catch (e11) {
        return false;
      }
    }(Pt) ? Pt : function() {
      const e10 = /* @__PURE__ */ __name(function(e11, t13) {
        this.message = e11 || "", this.name = t13 || "Error", Error.captureStackTrace && Error.captureStackTrace(this, this.constructor);
      }, "e");
      return e10.prototype = Object.create(Error.prototype), Object.defineProperty(e10.prototype, "constructor", { value: e10, writable: true, configurable: true }), e10;
    }();
    __name(kt, "kt");
    __name(Ot, "Ot");
    ReadableStreamDefaultController = class {
      static {
        __name(this, "ReadableStreamDefaultController");
      }
      constructor() {
        throw new TypeError("Illegal constructor");
      }
      get desiredSize() {
        if (!Bt(this)) throw Dt("desiredSize");
        return Lt(this);
      }
      close() {
        if (!Bt(this)) throw Dt("close");
        if (!Ft(this)) throw new TypeError("The stream is not in a state that permits close");
        !function(e10) {
          if (!Ft(e10)) return;
          const t13 = e10._controlledReadableStream;
          e10._closeRequested = true, 0 === e10._queue.length && (jt(e10), Xt(t13));
        }(this);
      }
      enqueue(e10) {
        if (!Bt(this)) throw Dt("enqueue");
        if (!Ft(this)) throw new TypeError("The stream is not in a state that permits enqueue");
        return function(e11, t13) {
          if (!Ft(e11)) return;
          const r10 = e11._controlledReadableStream;
          if (Ut(r10) && X2(r10) > 0) G2(r10, t13, false);
          else {
            let r11;
            try {
              r11 = e11._strategySizeAlgorithm(t13);
            } catch (t14) {
              throw zt(e11, t14), t14;
            }
            try {
              ue(e11, t13, r11);
            } catch (t14) {
              throw zt(e11, t14), t14;
            }
          }
          At(e11);
        }(this, e10);
      }
      error(e10) {
        if (!Bt(this)) throw Dt("error");
        zt(this, e10);
      }
      [T2](e10) {
        ce(this);
        const t13 = this._cancelAlgorithm(e10);
        return jt(this), t13;
      }
      [q2](e10) {
        const t13 = this._controlledReadableStream;
        if (this._queue.length > 0) {
          const r10 = se(this);
          this._closeRequested && 0 === this._queue.length ? (jt(this), Xt(t13)) : At(this), e10._chunkSteps(r10);
        } else U2(t13, e10), At(this);
      }
      [C]() {
      }
    };
    __name(Bt, "Bt");
    __name(At, "At");
    __name(jt, "jt");
    __name(zt, "zt");
    __name(Lt, "Lt");
    __name(Ft, "Ft");
    __name(It, "It");
    __name(Dt, "Dt");
    __name($t, "$t");
    __name(Mt, "Mt");
    __name(Yt, "Yt");
    __name(Qt, "Qt");
    __name(Nt, "Nt");
    __name(Ht, "Ht");
    __name(xt, "xt");
    Object.defineProperties(ReadableStreamDefaultController.prototype, { close: { enumerable: true }, enqueue: { enumerable: true }, error: { enumerable: true }, desiredSize: { enumerable: true } }), n(ReadableStreamDefaultController.prototype.close, "close"), n(ReadableStreamDefaultController.prototype.enqueue, "enqueue"), n(ReadableStreamDefaultController.prototype.error, "error"), "symbol" == typeof e.toStringTag && Object.defineProperty(ReadableStreamDefaultController.prototype, e.toStringTag, { value: "ReadableStreamDefaultController", configurable: true });
    ReadableStream3 = class {
      static {
        __name(this, "ReadableStream");
      }
      constructor(e10 = {}, t13 = {}) {
        void 0 === e10 ? e10 = null : D(e10, "First parameter");
        const r10 = Ye(t13, "Second parameter"), o7 = function(e11, t14) {
          F(e11, t14);
          const r11 = e11, o8 = null == r11 ? void 0 : r11.autoAllocateChunkSize, n10 = null == r11 ? void 0 : r11.cancel, a7 = null == r11 ? void 0 : r11.pull, i7 = null == r11 ? void 0 : r11.start, l8 = null == r11 ? void 0 : r11.type;
          return { autoAllocateChunkSize: void 0 === o8 ? void 0 : N2(o8, `${t14} has member 'autoAllocateChunkSize' that`), cancel: void 0 === n10 ? void 0 : $t(n10, r11, `${t14} has member 'cancel' that`), pull: void 0 === a7 ? void 0 : Mt(a7, r11, `${t14} has member 'pull' that`), start: void 0 === i7 ? void 0 : Yt(i7, r11, `${t14} has member 'start' that`), type: void 0 === l8 ? void 0 : Qt(l8, `${t14} has member 'type' that`) };
        }(e10, "First parameter");
        var n9;
        if ((n9 = this)._state = "readable", n9._reader = void 0, n9._storedError = void 0, n9._disturbed = false, "bytes" === o7.type) {
          if (void 0 !== r10.size) throw new RangeError("The strategy for a byte stream cannot have a size function");
          Oe(this, o7, $e(r10, 0));
        } else {
          const e11 = Me(r10);
          It(this, o7, $e(r10, 1), e11);
        }
      }
      get locked() {
        if (!Vt(this)) throw Kt("locked");
        return Ut(this);
      }
      cancel(e10) {
        return Vt(this) ? Ut(this) ? d2(new TypeError("Cannot cancel a stream that already has a reader")) : Gt(this, e10) : d2(Kt("cancel"));
      }
      getReader(e10) {
        if (!Vt(this)) throw Kt("getReader");
        return void 0 === function(e11, t13) {
          F(e11, t13);
          const r10 = null == e11 ? void 0 : e11.mode;
          return { mode: void 0 === r10 ? void 0 : Nt(r10, `${t13} has member 'mode' that`) };
        }(e10, "First parameter").mode ? new ReadableStreamDefaultReader(this) : function(e11) {
          return new ReadableStreamBYOBReader(e11);
        }(this);
      }
      pipeThrough(e10, t13 = {}) {
        if (!H2(this)) throw Kt("pipeThrough");
        $2(e10, 1, "pipeThrough");
        const r10 = xt(e10, "First parameter"), o7 = Ht(t13, "Second parameter");
        if (this.locked) throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");
        if (r10.writable.locked) throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");
        return m2(kt(this, r10.writable, o7.preventClose, o7.preventAbort, o7.preventCancel, o7.signal)), r10.readable;
      }
      pipeTo(e10, t13 = {}) {
        if (!H2(this)) return d2(Kt("pipeTo"));
        if (void 0 === e10) return d2("Parameter 1 is required in 'pipeTo'.");
        if (!x2(e10)) return d2(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));
        let r10;
        try {
          r10 = Ht(t13, "Second parameter");
        } catch (e11) {
          return d2(e11);
        }
        return this.locked ? d2(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")) : e10.locked ? d2(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")) : kt(this, e10, r10.preventClose, r10.preventAbort, r10.preventCancel, r10.signal);
      }
      tee() {
        if (!H2(this)) throw Kt("tee");
        if (this.locked) throw new TypeError("Cannot tee a stream that already has a reader");
        return Ot(this);
      }
      values(e10) {
        if (!H2(this)) throw Kt("values");
        return function(e11, t13) {
          const r10 = e11.getReader(), o7 = new te(r10, t13), n9 = Object.create(re);
          return n9._asyncIteratorImpl = o7, n9;
        }(this, function(e11, t13) {
          F(e11, t13);
          const r10 = null == e11 ? void 0 : e11.preventCancel;
          return { preventCancel: Boolean(r10) };
        }(e10, "First parameter").preventCancel);
      }
    };
    __name(Vt, "Vt");
    __name(Ut, "Ut");
    __name(Gt, "Gt");
    __name(Xt, "Xt");
    __name(Jt, "Jt");
    __name(Kt, "Kt");
    __name(Zt, "Zt");
    Object.defineProperties(ReadableStream3.prototype, { cancel: { enumerable: true }, getReader: { enumerable: true }, pipeThrough: { enumerable: true }, pipeTo: { enumerable: true }, tee: { enumerable: true }, values: { enumerable: true }, locked: { enumerable: true } }), n(ReadableStream3.prototype.cancel, "cancel"), n(ReadableStream3.prototype.getReader, "getReader"), n(ReadableStream3.prototype.pipeThrough, "pipeThrough"), n(ReadableStream3.prototype.pipeTo, "pipeTo"), n(ReadableStream3.prototype.tee, "tee"), n(ReadableStream3.prototype.values, "values"), "symbol" == typeof e.toStringTag && Object.defineProperty(ReadableStream3.prototype, e.toStringTag, { value: "ReadableStream", configurable: true }), "symbol" == typeof e.asyncIterator && Object.defineProperty(ReadableStream3.prototype, e.asyncIterator, { value: ReadableStream3.prototype.values, writable: true, configurable: true });
    er = /* @__PURE__ */ __name((e10) => e10.byteLength, "er");
    n(er, "size");
    ByteLengthQueuingStrategy = class {
      static {
        __name(this, "ByteLengthQueuingStrategy");
      }
      constructor(e10) {
        $2(e10, 1, "ByteLengthQueuingStrategy"), e10 = Zt(e10, "First parameter"), this._byteLengthQueuingStrategyHighWaterMark = e10.highWaterMark;
      }
      get highWaterMark() {
        if (!rr(this)) throw tr("highWaterMark");
        return this._byteLengthQueuingStrategyHighWaterMark;
      }
      get size() {
        if (!rr(this)) throw tr("size");
        return er;
      }
    };
    __name(tr, "tr");
    __name(rr, "rr");
    Object.defineProperties(ByteLengthQueuingStrategy.prototype, { highWaterMark: { enumerable: true }, size: { enumerable: true } }), "symbol" == typeof e.toStringTag && Object.defineProperty(ByteLengthQueuingStrategy.prototype, e.toStringTag, { value: "ByteLengthQueuingStrategy", configurable: true });
    or = /* @__PURE__ */ __name(() => 1, "or");
    n(or, "size");
    CountQueuingStrategy = class {
      static {
        __name(this, "CountQueuingStrategy");
      }
      constructor(e10) {
        $2(e10, 1, "CountQueuingStrategy"), e10 = Zt(e10, "First parameter"), this._countQueuingStrategyHighWaterMark = e10.highWaterMark;
      }
      get highWaterMark() {
        if (!ar(this)) throw nr("highWaterMark");
        return this._countQueuingStrategyHighWaterMark;
      }
      get size() {
        if (!ar(this)) throw nr("size");
        return or;
      }
    };
    __name(nr, "nr");
    __name(ar, "ar");
    __name(ir, "ir");
    __name(lr, "lr");
    __name(sr, "sr");
    Object.defineProperties(CountQueuingStrategy.prototype, { highWaterMark: { enumerable: true }, size: { enumerable: true } }), "symbol" == typeof e.toStringTag && Object.defineProperty(CountQueuingStrategy.prototype, e.toStringTag, { value: "CountQueuingStrategy", configurable: true });
    TransformStream2 = class {
      static {
        __name(this, "TransformStream");
      }
      constructor(e10 = {}, t13 = {}, r10 = {}) {
        void 0 === e10 && (e10 = null);
        const o7 = Ye(t13, "Second parameter"), n9 = Ye(r10, "Third parameter"), a7 = function(e11, t14) {
          F(e11, t14);
          const r11 = null == e11 ? void 0 : e11.flush, o8 = null == e11 ? void 0 : e11.readableType, n10 = null == e11 ? void 0 : e11.start, a8 = null == e11 ? void 0 : e11.transform, i8 = null == e11 ? void 0 : e11.writableType;
          return { flush: void 0 === r11 ? void 0 : ir(r11, e11, `${t14} has member 'flush' that`), readableType: o8, start: void 0 === n10 ? void 0 : lr(n10, e11, `${t14} has member 'start' that`), transform: void 0 === a8 ? void 0 : sr(a8, e11, `${t14} has member 'transform' that`), writableType: i8 };
        }(e10, "First parameter");
        if (void 0 !== a7.readableType) throw new RangeError("Invalid readableType specified");
        if (void 0 !== a7.writableType) throw new RangeError("Invalid writableType specified");
        const i7 = $e(n9, 0), l8 = Me(n9), s7 = $e(o7, 1), f8 = Me(o7);
        let b11;
        !function(e11, t14, r11, o8, n10, a8) {
          function i8() {
            return t14;
          }
          __name(i8, "i");
          function l9(t15) {
            return function(e12, t16) {
              const r12 = e12._transformStreamController;
              if (e12._backpressure) {
                return p2(e12._backpressureChangePromise, () => {
                  if ("erroring" === (Ge(e12._writable) ? e12._writable._state : e12._writableState)) throw Ge(e12._writable) ? e12._writable._storedError : e12._writableStoredError;
                  return pr(r12, t16);
                });
              }
              return pr(r12, t16);
            }(e11, t15);
          }
          __name(l9, "l");
          function s8(t15) {
            return function(e12, t16) {
              return cr(e12, t16), c2(void 0);
            }(e11, t15);
          }
          __name(s8, "s");
          function u7() {
            return function(e12) {
              const t15 = e12._transformStreamController, r12 = t15._flushAlgorithm();
              return hr(t15), p2(r12, () => {
                if ("errored" === e12._readableState) throw e12._readableStoredError;
                gr(e12) && wr(e12);
              }, (t16) => {
                throw cr(e12, t16), e12._readableStoredError;
              });
            }(e11);
          }
          __name(u7, "u");
          function d8() {
            return function(e12) {
              return fr(e12, false), e12._backpressureChangePromise;
            }(e11);
          }
          __name(d8, "d");
          function f9(t15) {
            return dr(e11, t15), c2(void 0);
          }
          __name(f9, "f");
          e11._writableState = "writable", e11._writableStoredError = void 0, e11._writableHasInFlightOperation = false, e11._writableStarted = false, e11._writable = function(e12, t15, r12, o9, n11, a9, i9) {
            return new WritableStream2({ start(r13) {
              e12._writableController = r13;
              try {
                const t16 = r13.signal;
                void 0 !== t16 && t16.addEventListener("abort", () => {
                  "writable" === e12._writableState && (e12._writableState = "erroring", t16.reason && (e12._writableStoredError = t16.reason));
                });
              } catch (e13) {
              }
              return p2(t15(), () => (e12._writableStarted = true, Cr(e12), null), (t16) => {
                throw e12._writableStarted = true, Rr(e12, t16), t16;
              });
            }, write: /* @__PURE__ */ __name((t16) => (function(e13) {
              e13._writableHasInFlightOperation = true;
            }(e12), p2(r12(t16), () => (function(e13) {
              e13._writableHasInFlightOperation = false;
            }(e12), Cr(e12), null), (t17) => {
              throw function(e13, t18) {
                e13._writableHasInFlightOperation = false, Rr(e13, t18);
              }(e12, t17), t17;
            })), "write"), close: /* @__PURE__ */ __name(() => (function(e13) {
              e13._writableHasInFlightOperation = true;
            }(e12), p2(o9(), () => (function(e13) {
              e13._writableHasInFlightOperation = false;
              "erroring" === e13._writableState && (e13._writableStoredError = void 0);
              e13._writableState = "closed";
            }(e12), null), (t16) => {
              throw function(e13, t17) {
                e13._writableHasInFlightOperation = false, e13._writableState, Rr(e13, t17);
              }(e12, t16), t16;
            })), "close"), abort: /* @__PURE__ */ __name((t16) => (e12._writableState = "errored", e12._writableStoredError = t16, n11(t16)), "abort") }, { highWaterMark: a9, size: i9 });
          }(e11, i8, l9, u7, s8, r11, o8), e11._readableState = "readable", e11._readableStoredError = void 0, e11._readableCloseRequested = false, e11._readablePulling = false, e11._readable = function(e12, t15, r12, o9, n11, a9) {
            return new ReadableStream3({ start: /* @__PURE__ */ __name((r13) => (e12._readableController = r13, t15().catch((t16) => {
              Sr(e12, t16);
            })), "start"), pull: /* @__PURE__ */ __name(() => (e12._readablePulling = true, r12().catch((t16) => {
              Sr(e12, t16);
            })), "pull"), cancel: /* @__PURE__ */ __name((t16) => (e12._readableState = "closed", o9(t16)), "cancel") }, { highWaterMark: n11, size: a9 });
          }(e11, i8, d8, f9, n10, a8), e11._backpressure = void 0, e11._backpressureChangePromise = void 0, e11._backpressureChangePromise_resolve = void 0, fr(e11, true), e11._transformStreamController = void 0;
        }(this, u((e11) => {
          b11 = e11;
        }), s7, f8, i7, l8), function(e11, t14) {
          const r11 = Object.create(TransformStreamDefaultController.prototype);
          let o8, n10;
          o8 = void 0 !== t14.transform ? (e12) => t14.transform(e12, r11) : (e12) => {
            try {
              return _r(r11, e12), c2(void 0);
            } catch (e13) {
              return d2(e13);
            }
          };
          n10 = void 0 !== t14.flush ? () => t14.flush(r11) : () => c2(void 0);
          !function(e12, t15, r12, o9) {
            t15._controlledTransformStream = e12, e12._transformStreamController = t15, t15._transformAlgorithm = r12, t15._flushAlgorithm = o9;
          }(e11, r11, o8, n10);
        }(this, a7), void 0 !== a7.start ? b11(a7.start(this._transformStreamController)) : b11(void 0);
      }
      get readable() {
        if (!ur(this)) throw yr("readable");
        return this._readable;
      }
      get writable() {
        if (!ur(this)) throw yr("writable");
        return this._writable;
      }
    };
    __name(ur, "ur");
    __name(cr, "cr");
    __name(dr, "dr");
    __name(fr, "fr");
    Object.defineProperties(TransformStream2.prototype, { readable: { enumerable: true }, writable: { enumerable: true } }), "symbol" == typeof e.toStringTag && Object.defineProperty(TransformStream2.prototype, e.toStringTag, { value: "TransformStream", configurable: true });
    TransformStreamDefaultController = class {
      static {
        __name(this, "TransformStreamDefaultController");
      }
      constructor() {
        throw new TypeError("Illegal constructor");
      }
      get desiredSize() {
        if (!br(this)) throw mr("desiredSize");
        return vr(this._controlledTransformStream);
      }
      enqueue(e10) {
        if (!br(this)) throw mr("enqueue");
        _r(this, e10);
      }
      error(e10) {
        if (!br(this)) throw mr("error");
        var t13;
        t13 = e10, cr(this._controlledTransformStream, t13);
      }
      terminate() {
        if (!br(this)) throw mr("terminate");
        !function(e10) {
          const t13 = e10._controlledTransformStream;
          gr(t13) && wr(t13);
          const r10 = new TypeError("TransformStream terminated");
          dr(t13, r10);
        }(this);
      }
    };
    __name(br, "br");
    __name(hr, "hr");
    __name(_r, "_r");
    __name(pr, "pr");
    __name(mr, "mr");
    __name(yr, "yr");
    __name(gr, "gr");
    __name(wr, "wr");
    __name(Sr, "Sr");
    __name(vr, "vr");
    __name(Rr, "Rr");
    __name(Tr, "Tr");
    __name(qr, "qr");
    __name(Cr, "Cr");
    Object.defineProperties(TransformStreamDefaultController.prototype, { enqueue: { enumerable: true }, error: { enumerable: true }, terminate: { enumerable: true }, desiredSize: { enumerable: true } }), n(TransformStreamDefaultController.prototype.enqueue, "enqueue"), n(TransformStreamDefaultController.prototype.error, "error"), n(TransformStreamDefaultController.prototype.terminate, "terminate"), "symbol" == typeof e.toStringTag && Object.defineProperty(TransformStreamDefaultController.prototype, e.toStringTag, { value: "TransformStreamDefaultController", configurable: true });
  }
});

// ../../node_modules/.pnpm/formdata-node@4.4.1/node_modules/formdata-node/lib/esm/isFunction.js
var isFunction;
var init_isFunction = __esm({
  "../../node_modules/.pnpm/formdata-node@4.4.1/node_modules/formdata-node/lib/esm/isFunction.js"() {
    init_import_meta_url();
    isFunction = /* @__PURE__ */ __name((value) => typeof value === "function", "isFunction");
  }
});

// ../../node_modules/.pnpm/formdata-node@4.4.1/node_modules/formdata-node/lib/esm/blobHelpers.js
async function* clonePart(part) {
  const end = part.byteOffset + part.byteLength;
  let position = part.byteOffset;
  while (position !== end) {
    const size = Math.min(end - position, CHUNK_SIZE);
    const chunk = part.buffer.slice(position, position + size);
    position += chunk.byteLength;
    yield new Uint8Array(chunk);
  }
}
async function* consumeNodeBlob(blob) {
  let position = 0;
  while (position !== blob.size) {
    const chunk = blob.slice(position, Math.min(blob.size, position + CHUNK_SIZE));
    const buffer = await chunk.arrayBuffer();
    position += buffer.byteLength;
    yield new Uint8Array(buffer);
  }
}
async function* consumeBlobParts(parts, clone2 = false) {
  for (const part of parts) {
    if (ArrayBuffer.isView(part)) {
      if (clone2) {
        yield* clonePart(part);
      } else {
        yield part;
      }
    } else if (isFunction(part.stream)) {
      yield* part.stream();
    } else {
      yield* consumeNodeBlob(part);
    }
  }
}
function* sliceBlob(blobParts, blobSize, start = 0, end) {
  end !== null && end !== void 0 ? end : end = blobSize;
  let relativeStart = start < 0 ? Math.max(blobSize + start, 0) : Math.min(start, blobSize);
  let relativeEnd = end < 0 ? Math.max(blobSize + end, 0) : Math.min(end, blobSize);
  const span = Math.max(relativeEnd - relativeStart, 0);
  let added = 0;
  for (const part of blobParts) {
    if (added >= span) {
      break;
    }
    const partSize = ArrayBuffer.isView(part) ? part.byteLength : part.size;
    if (relativeStart && partSize <= relativeStart) {
      relativeStart -= partSize;
      relativeEnd -= partSize;
    } else {
      let chunk;
      if (ArrayBuffer.isView(part)) {
        chunk = part.subarray(relativeStart, Math.min(partSize, relativeEnd));
        added += chunk.byteLength;
      } else {
        chunk = part.slice(relativeStart, Math.min(partSize, relativeEnd));
        added += chunk.size;
      }
      relativeEnd -= partSize;
      relativeStart = 0;
      yield chunk;
    }
  }
}
var CHUNK_SIZE;
var init_blobHelpers = __esm({
  "../../node_modules/.pnpm/formdata-node@4.4.1/node_modules/formdata-node/lib/esm/blobHelpers.js"() {
    init_import_meta_url();
    init_isFunction();
    CHUNK_SIZE = 65536;
    __name(clonePart, "clonePart");
    __name(consumeNodeBlob, "consumeNodeBlob");
    __name(consumeBlobParts, "consumeBlobParts");
    __name(sliceBlob, "sliceBlob");
  }
});

// ../../node_modules/.pnpm/formdata-node@4.4.1/node_modules/formdata-node/lib/esm/Blob.js
var __classPrivateFieldGet2, __classPrivateFieldSet, _Blob_parts, _Blob_type, _Blob_size, Blob4;
var init_Blob = __esm({
  "../../node_modules/.pnpm/formdata-node@4.4.1/node_modules/formdata-node/lib/esm/Blob.js"() {
    init_import_meta_url();
    init_ponyfill();
    init_isFunction();
    init_blobHelpers();
    __classPrivateFieldGet2 = function(receiver, state2, kind2, f8) {
      if (kind2 === "a" && !f8) throw new TypeError("Private accessor was defined without a getter");
      if (typeof state2 === "function" ? receiver !== state2 || !f8 : !state2.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
      return kind2 === "m" ? f8 : kind2 === "a" ? f8.call(receiver) : f8 ? f8.value : state2.get(receiver);
    };
    __classPrivateFieldSet = function(receiver, state2, value, kind2, f8) {
      if (kind2 === "m") throw new TypeError("Private method is not writable");
      if (kind2 === "a" && !f8) throw new TypeError("Private accessor was defined without a setter");
      if (typeof state2 === "function" ? receiver !== state2 || !f8 : !state2.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
      return kind2 === "a" ? f8.call(receiver, value) : f8 ? f8.value = value : state2.set(receiver, value), value;
    };
    Blob4 = class _Blob {
      static {
        __name(this, "Blob");
      }
      constructor(blobParts = [], options = {}) {
        _Blob_parts.set(this, []);
        _Blob_type.set(this, "");
        _Blob_size.set(this, 0);
        options !== null && options !== void 0 ? options : options = {};
        if (typeof blobParts !== "object" || blobParts === null) {
          throw new TypeError("Failed to construct 'Blob': The provided value cannot be converted to a sequence.");
        }
        if (!isFunction(blobParts[Symbol.iterator])) {
          throw new TypeError("Failed to construct 'Blob': The object must have a callable @@iterator property.");
        }
        if (typeof options !== "object" && !isFunction(options)) {
          throw new TypeError("Failed to construct 'Blob': parameter 2 cannot convert to dictionary.");
        }
        const encoder = new TextEncoder();
        for (const raw of blobParts) {
          let part;
          if (ArrayBuffer.isView(raw)) {
            part = new Uint8Array(raw.buffer.slice(raw.byteOffset, raw.byteOffset + raw.byteLength));
          } else if (raw instanceof ArrayBuffer) {
            part = new Uint8Array(raw.slice(0));
          } else if (raw instanceof _Blob) {
            part = raw;
          } else {
            part = encoder.encode(String(raw));
          }
          __classPrivateFieldSet(this, _Blob_size, __classPrivateFieldGet2(this, _Blob_size, "f") + (ArrayBuffer.isView(part) ? part.byteLength : part.size), "f");
          __classPrivateFieldGet2(this, _Blob_parts, "f").push(part);
        }
        const type = options.type === void 0 ? "" : String(options.type);
        __classPrivateFieldSet(this, _Blob_type, /^[\x20-\x7E]*$/.test(type) ? type : "", "f");
      }
      static [(_Blob_parts = /* @__PURE__ */ new WeakMap(), _Blob_type = /* @__PURE__ */ new WeakMap(), _Blob_size = /* @__PURE__ */ new WeakMap(), Symbol.hasInstance)](value) {
        return Boolean(value && typeof value === "object" && isFunction(value.constructor) && (isFunction(value.stream) || isFunction(value.arrayBuffer)) && /^(Blob|File)$/.test(value[Symbol.toStringTag]));
      }
      get type() {
        return __classPrivateFieldGet2(this, _Blob_type, "f");
      }
      get size() {
        return __classPrivateFieldGet2(this, _Blob_size, "f");
      }
      slice(start, end, contentType) {
        return new _Blob(sliceBlob(__classPrivateFieldGet2(this, _Blob_parts, "f"), this.size, start, end), {
          type: contentType
        });
      }
      async text() {
        const decoder = new TextDecoder();
        let result = "";
        for await (const chunk of consumeBlobParts(__classPrivateFieldGet2(this, _Blob_parts, "f"))) {
          result += decoder.decode(chunk, { stream: true });
        }
        result += decoder.decode();
        return result;
      }
      async arrayBuffer() {
        const view = new Uint8Array(this.size);
        let offset = 0;
        for await (const chunk of consumeBlobParts(__classPrivateFieldGet2(this, _Blob_parts, "f"))) {
          view.set(chunk, offset);
          offset += chunk.length;
        }
        return view.buffer;
      }
      stream() {
        const iterator = consumeBlobParts(__classPrivateFieldGet2(this, _Blob_parts, "f"), true);
        return new ReadableStream3({
          async pull(controller) {
            const { value, done } = await iterator.next();
            if (done) {
              return queueMicrotask(() => controller.close());
            }
            controller.enqueue(value);
          },
          async cancel() {
            await iterator.return();
          }
        });
      }
      get [Symbol.toStringTag]() {
        return "Blob";
      }
    };
    Object.defineProperties(Blob4.prototype, {
      type: { enumerable: true },
      size: { enumerable: true },
      slice: { enumerable: true },
      stream: { enumerable: true },
      text: { enumerable: true },
      arrayBuffer: { enumerable: true }
    });
  }
});

// ../../node_modules/.pnpm/formdata-node@4.4.1/node_modules/formdata-node/lib/esm/File.js
var __classPrivateFieldSet2, __classPrivateFieldGet3, _File_name, _File_lastModified, File3;
var init_File = __esm({
  "../../node_modules/.pnpm/formdata-node@4.4.1/node_modules/formdata-node/lib/esm/File.js"() {
    init_import_meta_url();
    init_Blob();
    __classPrivateFieldSet2 = function(receiver, state2, value, kind2, f8) {
      if (kind2 === "m") throw new TypeError("Private method is not writable");
      if (kind2 === "a" && !f8) throw new TypeError("Private accessor was defined without a setter");
      if (typeof state2 === "function" ? receiver !== state2 || !f8 : !state2.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
      return kind2 === "a" ? f8.call(receiver, value) : f8 ? f8.value = value : state2.set(receiver, value), value;
    };
    __classPrivateFieldGet3 = function(receiver, state2, kind2, f8) {
      if (kind2 === "a" && !f8) throw new TypeError("Private accessor was defined without a getter");
      if (typeof state2 === "function" ? receiver !== state2 || !f8 : !state2.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
      return kind2 === "m" ? f8 : kind2 === "a" ? f8.call(receiver) : f8 ? f8.value : state2.get(receiver);
    };
    File3 = class extends Blob4 {
      static {
        __name(this, "File");
      }
      constructor(fileBits, name2, options = {}) {
        super(fileBits, options);
        _File_name.set(this, void 0);
        _File_lastModified.set(this, 0);
        if (arguments.length < 2) {
          throw new TypeError(`Failed to construct 'File': 2 arguments required, but only ${arguments.length} present.`);
        }
        __classPrivateFieldSet2(this, _File_name, String(name2), "f");
        const lastModified = options.lastModified === void 0 ? Date.now() : Number(options.lastModified);
        if (!Number.isNaN(lastModified)) {
          __classPrivateFieldSet2(this, _File_lastModified, lastModified, "f");
        }
      }
      static [(_File_name = /* @__PURE__ */ new WeakMap(), _File_lastModified = /* @__PURE__ */ new WeakMap(), Symbol.hasInstance)](value) {
        return value instanceof Blob4 && value[Symbol.toStringTag] === "File" && typeof value.name === "string";
      }
      get name() {
        return __classPrivateFieldGet3(this, _File_name, "f");
      }
      get lastModified() {
        return __classPrivateFieldGet3(this, _File_lastModified, "f");
      }
      get webkitRelativePath() {
        return "";
      }
      get [Symbol.toStringTag]() {
        return "File";
      }
    };
  }
});

// ../../node_modules/.pnpm/formdata-node@4.4.1/node_modules/formdata-node/lib/esm/isFile.js
var isFile;
var init_isFile = __esm({
  "../../node_modules/.pnpm/formdata-node@4.4.1/node_modules/formdata-node/lib/esm/isFile.js"() {
    init_import_meta_url();
    init_File();
    isFile = /* @__PURE__ */ __name((value) => value instanceof File3, "isFile");
  }
});

// ../../node_modules/.pnpm/formdata-node@4.4.1/node_modules/formdata-node/lib/esm/isBlob.js
var isBlob3;
var init_isBlob = __esm({
  "../../node_modules/.pnpm/formdata-node@4.4.1/node_modules/formdata-node/lib/esm/isBlob.js"() {
    init_import_meta_url();
    init_Blob();
    isBlob3 = /* @__PURE__ */ __name((value) => value instanceof Blob4, "isBlob");
  }
});
var deprecateConstructorEntries;
var init_deprecateConstructorEntries = __esm({
  "../../node_modules/.pnpm/formdata-node@4.4.1/node_modules/formdata-node/lib/esm/deprecateConstructorEntries.js"() {
    init_import_meta_url();
    deprecateConstructorEntries = util4.deprecate(() => {
    }, 'Constructor "entries" argument is not spec-compliant and will be removed in next major release.');
  }
});
var __classPrivateFieldGet4, _FormData_instances, _FormData_entries, _FormData_setEntry, FormData3;
var init_FormData = __esm({
  "../../node_modules/.pnpm/formdata-node@4.4.1/node_modules/formdata-node/lib/esm/FormData.js"() {
    init_import_meta_url();
    init_File();
    init_isFile();
    init_isBlob();
    init_isFunction();
    init_deprecateConstructorEntries();
    __classPrivateFieldGet4 = function(receiver, state2, kind2, f8) {
      if (kind2 === "a" && !f8) throw new TypeError("Private accessor was defined without a getter");
      if (typeof state2 === "function" ? receiver !== state2 || !f8 : !state2.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
      return kind2 === "m" ? f8 : kind2 === "a" ? f8.call(receiver) : f8 ? f8.value : state2.get(receiver);
    };
    FormData3 = class {
      static {
        __name(this, "FormData");
      }
      constructor(entries2) {
        _FormData_instances.add(this);
        _FormData_entries.set(this, /* @__PURE__ */ new Map());
        if (entries2) {
          deprecateConstructorEntries();
          entries2.forEach(({ name: name2, value, fileName }) => this.append(name2, value, fileName));
        }
      }
      static [(_FormData_entries = /* @__PURE__ */ new WeakMap(), _FormData_instances = /* @__PURE__ */ new WeakSet(), Symbol.hasInstance)](value) {
        return Boolean(value && isFunction(value.constructor) && value[Symbol.toStringTag] === "FormData" && isFunction(value.append) && isFunction(value.set) && isFunction(value.get) && isFunction(value.getAll) && isFunction(value.has) && isFunction(value.delete) && isFunction(value.entries) && isFunction(value.values) && isFunction(value.keys) && isFunction(value[Symbol.iterator]) && isFunction(value.forEach));
      }
      append(name2, value, fileName) {
        __classPrivateFieldGet4(this, _FormData_instances, "m", _FormData_setEntry).call(this, {
          name: name2,
          fileName,
          append: true,
          rawValue: value,
          argsLength: arguments.length
        });
      }
      set(name2, value, fileName) {
        __classPrivateFieldGet4(this, _FormData_instances, "m", _FormData_setEntry).call(this, {
          name: name2,
          fileName,
          append: false,
          rawValue: value,
          argsLength: arguments.length
        });
      }
      get(name2) {
        const field = __classPrivateFieldGet4(this, _FormData_entries, "f").get(String(name2));
        if (!field) {
          return null;
        }
        return field[0];
      }
      getAll(name2) {
        const field = __classPrivateFieldGet4(this, _FormData_entries, "f").get(String(name2));
        if (!field) {
          return [];
        }
        return field.slice();
      }
      has(name2) {
        return __classPrivateFieldGet4(this, _FormData_entries, "f").has(String(name2));
      }
      delete(name2) {
        __classPrivateFieldGet4(this, _FormData_entries, "f").delete(String(name2));
      }
      *keys() {
        for (const key of __classPrivateFieldGet4(this, _FormData_entries, "f").keys()) {
          yield key;
        }
      }
      *entries() {
        for (const name2 of this.keys()) {
          const values = this.getAll(name2);
          for (const value of values) {
            yield [name2, value];
          }
        }
      }
      *values() {
        for (const [, value] of this) {
          yield value;
        }
      }
      [(_FormData_setEntry = /* @__PURE__ */ __name(function _FormData_setEntry2({ name: name2, rawValue, append, fileName, argsLength }) {
        const methodName = append ? "append" : "set";
        if (argsLength < 2) {
          throw new TypeError(`Failed to execute '${methodName}' on 'FormData': 2 arguments required, but only ${argsLength} present.`);
        }
        name2 = String(name2);
        let value;
        if (isFile(rawValue)) {
          value = fileName === void 0 ? rawValue : new File3([rawValue], fileName, {
            type: rawValue.type,
            lastModified: rawValue.lastModified
          });
        } else if (isBlob3(rawValue)) {
          value = new File3([rawValue], fileName === void 0 ? "blob" : fileName, {
            type: rawValue.type
          });
        } else if (fileName) {
          throw new TypeError(`Failed to execute '${methodName}' on 'FormData': parameter 2 is not of type 'Blob'.`);
        } else {
          value = String(rawValue);
        }
        const values = __classPrivateFieldGet4(this, _FormData_entries, "f").get(name2);
        if (!values) {
          return void __classPrivateFieldGet4(this, _FormData_entries, "f").set(name2, [value]);
        }
        if (!append) {
          return void __classPrivateFieldGet4(this, _FormData_entries, "f").set(name2, [value]);
        }
        values.push(value);
      }, "_FormData_setEntry"), Symbol.iterator)]() {
        return this.entries();
      }
      forEach(callback, thisArg) {
        for (const [name2, value] of this) {
          callback.call(thisArg, value, name2, this);
        }
      }
      get [Symbol.toStringTag]() {
        return "FormData";
      }
      [util4.inspect.custom]() {
        return this[Symbol.toStringTag];
      }
    };
  }
});

// ../../node_modules/.pnpm/formdata-node@4.4.1/node_modules/formdata-node/lib/esm/index.js
var init_esm3 = __esm({
  "../../node_modules/.pnpm/formdata-node@4.4.1/node_modules/formdata-node/lib/esm/index.js"() {
    init_import_meta_url();
    init_FormData();
    init_Blob();
    init_File();
  }
});

// ../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js
var require_ms = __commonJS({
  "../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js"(exports, module2) {
    init_import_meta_url();
    var s7 = 1e3;
    var m7 = s7 * 60;
    var h7 = m7 * 60;
    var d8 = h7 * 24;
    var w7 = d8 * 7;
    var y5 = d8 * 365.25;
    module2.exports = function(val2, options) {
      options = options || {};
      var type = typeof val2;
      if (type === "string" && val2.length > 0) {
        return parse17(val2);
      } else if (type === "number" && isFinite(val2)) {
        return options.long ? fmtLong(val2) : fmtShort(val2);
      }
      throw new Error(
        "val is not a non-empty string or a valid number. val=" + JSON.stringify(val2)
      );
    };
    function parse17(str) {
      str = String(str);
      if (str.length > 100) {
        return;
      }
      var match3 = /^(-?(?:\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 (!match3) {
        return;
      }
      var n9 = parseFloat(match3[1]);
      var type = (match3[2] || "ms").toLowerCase();
      switch (type) {
        case "years":
        case "year":
        case "yrs":
        case "yr":
        case "y":
          return n9 * y5;
        case "weeks":
        case "week":
        case "w":
          return n9 * w7;
        case "days":
        case "day":
        case "d":
          return n9 * d8;
        case "hours":
        case "hour":
        case "hrs":
        case "hr":
        case "h":
          return n9 * h7;
        case "minutes":
        case "minute":
        case "mins":
        case "min":
        case "m":
          return n9 * m7;
        case "seconds":
        case "second":
        case "secs":
        case "sec":
        case "s":
          return n9 * s7;
        case "milliseconds":
        case "millisecond":
        case "msecs":
        case "msec":
        case "ms":
          return n9;
        default:
          return void 0;
      }
    }
    __name(parse17, "parse");
    function fmtShort(ms) {
      var msAbs = Math.abs(ms);
      if (msAbs >= d8) {
        return Math.round(ms / d8) + "d";
      }
      if (msAbs >= h7) {
        return Math.round(ms / h7) + "h";
      }
      if (msAbs >= m7) {
        return Math.round(ms / m7) + "m";
      }
      if (msAbs >= s7) {
        return Math.round(ms / s7) + "s";
      }
      return ms + "ms";
    }
    __name(fmtShort, "fmtShort");
    function fmtLong(ms) {
      var msAbs = Math.abs(ms);
      if (msAbs >= d8) {
        return plural2(ms, msAbs, d8, "day");
      }
      if (msAbs >= h7) {
        return plural2(ms, msAbs, h7, "hour");
      }
      if (msAbs >= m7) {
        return plural2(ms, msAbs, m7, "minute");
      }
      if (msAbs >= s7) {
        return plural2(ms, msAbs, s7, "second");
      }
      return ms + " ms";
    }
    __name(fmtLong, "fmtLong");
    function plural2(ms, msAbs, n9, name2) {
      var isPlural = msAbs >= n9 * 1.5;
      return Math.round(ms / n9) + " " + name2 + (isPlural ? "s" : "");
    }
    __name(plural2, "plural");
  }
});

// ../../node_modules/.pnpm/humanize-ms@1.2.1/node_modules/humanize-ms/index.js
var require_humanize_ms = __commonJS({
  "../../node_modules/.pnpm/humanize-ms@1.2.1/node_modules/humanize-ms/index.js"(exports, module2) {
    init_import_meta_url();
    var util5 = __require("util");
    var ms = require_ms();
    module2.exports = function(t13) {
      if (typeof t13 === "number") return t13;
      var r10 = ms(t13);
      if (r10 === void 0) {
        var err = new Error(util5.format("humanize-ms(%j) result undefined", t13));
        console.warn(err.stack);
      }
      return r10;
    };
  }
});

// ../../node_modules/.pnpm/agentkeepalive@4.6.0/node_modules/agentkeepalive/lib/constants.js
var require_constants6 = __commonJS({
  "../../node_modules/.pnpm/agentkeepalive@4.6.0/node_modules/agentkeepalive/lib/constants.js"(exports, module2) {
    init_import_meta_url();
    module2.exports = {
      // agent
      CURRENT_ID: Symbol("agentkeepalive#currentId"),
      CREATE_ID: Symbol("agentkeepalive#createId"),
      INIT_SOCKET: Symbol("agentkeepalive#initSocket"),
      CREATE_HTTPS_CONNECTION: Symbol("agentkeepalive#createHttpsConnection"),
      // socket
      SOCKET_CREATED_TIME: Symbol("agentkeepalive#socketCreatedTime"),
      SOCKET_NAME: Symbol("agentkeepalive#socketName"),
      SOCKET_REQUEST_COUNT: Symbol("agentkeepalive#socketRequestCount"),
      SOCKET_REQUEST_FINISHED_COUNT: Symbol("agentkeepalive#socketRequestFinishedCount")
    };
  }
});

// ../../node_modules/.pnpm/agentkeepalive@4.6.0/node_modules/agentkeepalive/lib/agent.js
var require_agent2 = __commonJS({
  "../../node_modules/.pnpm/agentkeepalive@4.6.0/node_modules/agentkeepalive/lib/agent.js"(exports, module2) {
    init_import_meta_url();
    var OriginalAgent = __require("http").Agent;
    var ms = require_humanize_ms();
    var debug2 = __require("util").debuglog("agentkeepalive");
    var {
      INIT_SOCKET,
      CURRENT_ID,
      CREATE_ID,
      SOCKET_CREATED_TIME,
      SOCKET_NAME,
      SOCKET_REQUEST_COUNT,
      SOCKET_REQUEST_FINISHED_COUNT
    } = require_constants6();
    var defaultTimeoutListenerCount = 1;
    var majorVersion = parseInt(process.version.split(".", 1)[0].substring(1));
    if (majorVersion >= 11 && majorVersion <= 12) {
      defaultTimeoutListenerCount = 2;
    } else if (majorVersion >= 13) {
      defaultTimeoutListenerCount = 3;
    }
    function deprecate2(message) {
      console.log("[agentkeepalive:deprecated] %s", message);
    }
    __name(deprecate2, "deprecate");
    var Agent = class extends OriginalAgent {
      static {
        __name(this, "Agent");
      }
      constructor(options) {
        options = options || {};
        options.keepAlive = options.keepAlive !== false;
        if (options.freeSocketTimeout === void 0) {
          options.freeSocketTimeout = 4e3;
        }
        if (options.keepAliveTimeout) {
          deprecate2("options.keepAliveTimeout is deprecated, please use options.freeSocketTimeout instead");
          options.freeSocketTimeout = options.keepAliveTimeout;
          delete options.keepAliveTimeout;
        }
        if (options.freeSocketKeepAliveTimeout) {
          deprecate2("options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead");
          options.freeSocketTimeout = options.freeSocketKeepAliveTimeout;
          delete options.freeSocketKeepAliveTimeout;
        }
        if (options.timeout === void 0) {
          options.timeout = Math.max(options.freeSocketTimeout * 2, 8e3);
        }
        options.timeout = ms(options.timeout);
        options.freeSocketTimeout = ms(options.freeSocketTimeout);
        options.socketActiveTTL = options.socketActiveTTL ? ms(options.socketActiveTTL) : 0;
        super(options);
        this[CURRENT_ID] = 0;
        this.createSocketCount = 0;
        this.createSocketCountLastCheck = 0;
        this.createSocketErrorCount = 0;
        this.createSocketErrorCountLastCheck = 0;
        this.closeSocketCount = 0;
        this.closeSocketCountLastCheck = 0;
        this.errorSocketCount = 0;
        this.errorSocketCountLastCheck = 0;
        this.requestCount = 0;
        this.requestCountLastCheck = 0;
        this.timeoutSocketCount = 0;
        this.timeoutSocketCountLastCheck = 0;
        this.on("free", (socket) => {
          const timeout2 = this.calcSocketTimeout(socket);
          if (timeout2 > 0 && socket.timeout !== timeout2) {
            socket.setTimeout(timeout2);
          }
        });
      }
      get freeSocketKeepAliveTimeout() {
        deprecate2("agent.freeSocketKeepAliveTimeout is deprecated, please use agent.options.freeSocketTimeout instead");
        return this.options.freeSocketTimeout;
      }
      get timeout() {
        deprecate2("agent.timeout is deprecated, please use agent.options.timeout instead");
        return this.options.timeout;
      }
      get socketActiveTTL() {
        deprecate2("agent.socketActiveTTL is deprecated, please use agent.options.socketActiveTTL instead");
        return this.options.socketActiveTTL;
      }
      calcSocketTimeout(socket) {
        let freeSocketTimeout = this.options.freeSocketTimeout;
        const socketActiveTTL = this.options.socketActiveTTL;
        if (socketActiveTTL) {
          const aliveTime = Date.now() - socket[SOCKET_CREATED_TIME];
          const diff = socketActiveTTL - aliveTime;
          if (diff <= 0) {
            return diff;
          }
          if (freeSocketTimeout && diff < freeSocketTimeout) {
            freeSocketTimeout = diff;
          }
        }
        if (freeSocketTimeout) {
          const customFreeSocketTimeout = socket.freeSocketTimeout || socket.freeSocketKeepAliveTimeout;
          return customFreeSocketTimeout || freeSocketTimeout;
        }
      }
      keepSocketAlive(socket) {
        const result = super.keepSocketAlive(socket);
        if (!result) return result;
        const customTimeout = this.calcSocketTimeout(socket);
        if (typeof customTimeout === "undefined") {
          return true;
        }
        if (customTimeout <= 0) {
          debug2(
            "%s(requests: %s, finished: %s) free but need to destroy by TTL, request count %s, diff is %s",
            socket[SOCKET_NAME],
            socket[SOCKET_REQUEST_COUNT],
            socket[SOCKET_REQUEST_FINISHED_COUNT],
            customTimeout
          );
          return false;
        }
        if (socket.timeout !== customTimeout) {
          socket.setTimeout(customTimeout);
        }
        return true;
      }
      // only call on addRequest
      reuseSocket(...args) {
        super.reuseSocket(...args);
        const socket = args[0];
        const req = args[1];
        req.reusedSocket = true;
        const agentTimeout = this.options.timeout;
        if (getSocketTimeout(socket) !== agentTimeout) {
          socket.setTimeout(agentTimeout);
          debug2("%s reset timeout to %sms", socket[SOCKET_NAME], agentTimeout);
        }
        socket[SOCKET_REQUEST_COUNT]++;
        debug2(
          "%s(requests: %s, finished: %s) reuse on addRequest, timeout %sms",
          socket[SOCKET_NAME],
          socket[SOCKET_REQUEST_COUNT],
          socket[SOCKET_REQUEST_FINISHED_COUNT],
          getSocketTimeout(socket)
        );
      }
      [CREATE_ID]() {
        const id = this[CURRENT_ID]++;
        if (this[CURRENT_ID] === Number.MAX_SAFE_INTEGER) this[CURRENT_ID] = 0;
        return id;
      }
      [INIT_SOCKET](socket, options) {
        if (options.timeout) {
          const timeout2 = getSocketTimeout(socket);
          if (!timeout2) {
            socket.setTimeout(options.timeout);
          }
        }
        if (this.options.keepAlive) {
          socket.setNoDelay(true);
        }
        this.createSocketCount++;
        if (this.options.socketActiveTTL) {
          socket[SOCKET_CREATED_TIME] = Date.now();
        }
        socket[SOCKET_NAME] = `sock[${this[CREATE_ID]()}#${options._agentKey}]`.split("-----BEGIN", 1)[0];
        socket[SOCKET_REQUEST_COUNT] = 1;
        socket[SOCKET_REQUEST_FINISHED_COUNT] = 0;
        installListeners(this, socket, options);
      }
      createConnection(options, oncreate) {
        let called = false;
        const onNewCreate = /* @__PURE__ */ __name((err, socket) => {
          if (called) return;
          called = true;
          if (err) {
            this.createSocketErrorCount++;
            return oncreate(err);
          }
          this[INIT_SOCKET](socket, options);
          oncreate(err, socket);
        }, "onNewCreate");
        const newSocket = super.createConnection(options, onNewCreate);
        if (newSocket) onNewCreate(null, newSocket);
        return newSocket;
      }
      get statusChanged() {
        const changed = this.createSocketCount !== this.createSocketCountLastCheck || this.createSocketErrorCount !== this.createSocketErrorCountLastCheck || this.closeSocketCount !== this.closeSocketCountLastCheck || this.errorSocketCount !== this.errorSocketCountLastCheck || this.timeoutSocketCount !== this.timeoutSocketCountLastCheck || this.requestCount !== this.requestCountLastCheck;
        if (changed) {
          this.createSocketCountLastCheck = this.createSocketCount;
          this.createSocketErrorCountLastCheck = this.createSocketErrorCount;
          this.closeSocketCountLastCheck = this.closeSocketCount;
          this.errorSocketCountLastCheck = this.errorSocketCount;
          this.timeoutSocketCountLastCheck = this.timeoutSocketCount;
          this.requestCountLastCheck = this.requestCount;
        }
        return changed;
      }
      getCurrentStatus() {
        return {
          createSocketCount: this.createSocketCount,
          createSocketErrorCount: this.createSocketErrorCount,
          closeSocketCount: this.closeSocketCount,
          errorSocketCount: this.errorSocketCount,
          timeoutSocketCount: this.timeoutSocketCount,
          requestCount: this.requestCount,
          freeSockets: inspect3(this.freeSockets),
          sockets: inspect3(this.sockets),
          requests: inspect3(this.requests)
        };
      }
    };
    function getSocketTimeout(socket) {
      return socket.timeout || socket._idleTimeout;
    }
    __name(getSocketTimeout, "getSocketTimeout");
    function installListeners(agent, socket, options) {
      debug2("%s create, timeout %sms", socket[SOCKET_NAME], getSocketTimeout(socket));
      function onFree() {
        if (!socket._httpMessage && socket[SOCKET_REQUEST_COUNT] === 1) return;
        socket[SOCKET_REQUEST_FINISHED_COUNT]++;
        agent.requestCount++;
        debug2(
          "%s(requests: %s, finished: %s) free",
          socket[SOCKET_NAME],
          socket[SOCKET_REQUEST_COUNT],
          socket[SOCKET_REQUEST_FINISHED_COUNT]
        );
        const name2 = agent.getName(options);
        if (socket.writable && agent.requests[name2] && agent.requests[name2].length) {
          socket[SOCKET_REQUEST_COUNT]++;
          debug2(
            "%s(requests: %s, finished: %s) will be reuse on agent free event",
            socket[SOCKET_NAME],
            socket[SOCKET_REQUEST_COUNT],
            socket[SOCKET_REQUEST_FINISHED_COUNT]
          );
        }
      }
      __name(onFree, "onFree");
      socket.on("free", onFree);
      function onClose(isError2) {
        debug2(
          "%s(requests: %s, finished: %s) close, isError: %s",
          socket[SOCKET_NAME],
          socket[SOCKET_REQUEST_COUNT],
          socket[SOCKET_REQUEST_FINISHED_COUNT],
          isError2
        );
        agent.closeSocketCount++;
      }
      __name(onClose, "onClose");
      socket.on("close", onClose);
      function onTimeout() {
        const listenerCount = socket.listeners("timeout").length;
        const timeout2 = getSocketTimeout(socket);
        const req = socket._httpMessage;
        const reqTimeoutListenerCount = req && req.listeners("timeout").length || 0;
        debug2(
          "%s(requests: %s, finished: %s) timeout after %sms, listeners %s, defaultTimeoutListenerCount %s, hasHttpRequest %s, HttpRequest timeoutListenerCount %s",
          socket[SOCKET_NAME],
          socket[SOCKET_REQUEST_COUNT],
          socket[SOCKET_REQUEST_FINISHED_COUNT],
          timeout2,
          listenerCount,
          defaultTimeoutListenerCount,
          !!req,
          reqTimeoutListenerCount
        );
        if (debug2.enabled) {
          debug2("timeout listeners: %s", socket.listeners("timeout").map((f8) => f8.name).join(", "));
        }
        agent.timeoutSocketCount++;
        const name2 = agent.getName(options);
        if (agent.freeSockets[name2] && agent.freeSockets[name2].indexOf(socket) !== -1) {
          socket.destroy();
          agent.removeSocket(socket, options);
          debug2("%s is free, destroy quietly", socket[SOCKET_NAME]);
        } else {
          if (reqTimeoutListenerCount === 0) {
            const error2 = new Error("Socket timeout");
            error2.code = "ERR_SOCKET_TIMEOUT";
            error2.timeout = timeout2;
            socket.destroy(error2);
            agent.removeSocket(socket, options);
            debug2("%s destroy with timeout error", socket[SOCKET_NAME]);
          }
        }
      }
      __name(onTimeout, "onTimeout");
      socket.on("timeout", onTimeout);
      function onError(err) {
        const listenerCount = socket.listeners("error").length;
        debug2(
          "%s(requests: %s, finished: %s) error: %s, listenerCount: %s",
          socket[SOCKET_NAME],
          socket[SOCKET_REQUEST_COUNT],
          socket[SOCKET_REQUEST_FINISHED_COUNT],
          err,
          listenerCount
        );
        agent.errorSocketCount++;
        if (listenerCount === 1) {
          debug2("%s emit uncaught error event", socket[SOCKET_NAME]);
          socket.removeListener("error", onError);
          socket.emit("error", err);
        }
      }
      __name(onError, "onError");
      socket.on("error", onError);
      function onRemove() {
        debug2(
          "%s(requests: %s, finished: %s) agentRemove",
          socket[SOCKET_NAME],
          socket[SOCKET_REQUEST_COUNT],
          socket[SOCKET_REQUEST_FINISHED_COUNT]
        );
        socket.removeListener("close", onClose);
        socket.removeListener("error", onError);
        socket.removeListener("free", onFree);
        socket.removeListener("timeout", onTimeout);
        socket.removeListener("agentRemove", onRemove);
      }
      __name(onRemove, "onRemove");
      socket.on("agentRemove", onRemove);
    }
    __name(installListeners, "installListeners");
    module2.exports = Agent;
    function inspect3(obj) {
      const res = {};
      for (const key in obj) {
        res[key] = obj[key].length;
      }
      return res;
    }
    __name(inspect3, "inspect");
  }
});

// ../../node_modules/.pnpm/agentkeepalive@4.6.0/node_modules/agentkeepalive/lib/https_agent.js
var require_https_agent = __commonJS({
  "../../node_modules/.pnpm/agentkeepalive@4.6.0/node_modules/agentkeepalive/lib/https_agent.js"(exports, module2) {
    init_import_meta_url();
    var OriginalHttpsAgent = __require("https").Agent;
    var HttpAgent = require_agent2();
    var {
      INIT_SOCKET,
      CREATE_HTTPS_CONNECTION
    } = require_constants6();
    var HttpsAgent = class extends HttpAgent {
      static {
        __name(this, "HttpsAgent");
      }
      constructor(options) {
        super(options);
        this.defaultPort = 443;
        this.protocol = "https:";
        this.maxCachedSessions = this.options.maxCachedSessions;
        if (this.maxCachedSessions === void 0) {
          this.maxCachedSessions = 100;
        }
        this._sessionCache = {
          map: {},
          list: []
        };
      }
      createConnection(options, oncreate) {
        const socket = this[CREATE_HTTPS_CONNECTION](options, oncreate);
        this[INIT_SOCKET](socket, options);
        return socket;
      }
    };
    HttpsAgent.prototype[CREATE_HTTPS_CONNECTION] = OriginalHttpsAgent.prototype.createConnection;
    [
      "getName",
      "_getSession",
      "_cacheSession",
      // https://github.com/nodejs/node/pull/4982
      "_evictSession"
    ].forEach(function(method) {
      if (typeof OriginalHttpsAgent.prototype[method] === "function") {
        HttpsAgent.prototype[method] = OriginalHttpsAgent.prototype[method];
      }
    });
    module2.exports = HttpsAgent;
  }
});

// ../../node_modules/.pnpm/agentkeepalive@4.6.0/node_modules/agentkeepalive/index.js
var require_agentkeepalive = __commonJS({
  "../../node_modules/.pnpm/agentkeepalive@4.6.0/node_modules/agentkeepalive/index.js"(exports, module2) {
    init_import_meta_url();
    var HttpAgent = require_agent2();
    module2.exports = HttpAgent;
    module2.exports.HttpAgent = HttpAgent;
    module2.exports.HttpsAgent = require_https_agent();
    module2.exports.constants = require_constants6();
  }
});

// ../../node_modules/.pnpm/event-target-shim@5.0.1/node_modules/event-target-shim/dist/event-target-shim.js
var require_event_target_shim = __commonJS({
  "../../node_modules/.pnpm/event-target-shim@5.0.1/node_modules/event-target-shim/dist/event-target-shim.js"(exports, module2) {
    init_import_meta_url();
    Object.defineProperty(exports, "__esModule", { value: true });
    var privateData = /* @__PURE__ */ new WeakMap();
    var wrappers = /* @__PURE__ */ new WeakMap();
    function pd(event) {
      const retv = privateData.get(event);
      console.assert(
        retv != null,
        "'this' is expected an Event object, but got",
        event
      );
      return retv;
    }
    __name(pd, "pd");
    function setCancelFlag(data) {
      if (data.passiveListener != null) {
        if (typeof console !== "undefined" && typeof console.error === "function") {
          console.error(
            "Unable to preventDefault inside passive event listener invocation.",
            data.passiveListener
          );
        }
        return;
      }
      if (!data.event.cancelable) {
        return;
      }
      data.canceled = true;
      if (typeof data.event.preventDefault === "function") {
        data.event.preventDefault();
      }
    }
    __name(setCancelFlag, "setCancelFlag");
    function Event2(eventTarget, event) {
      privateData.set(this, {
        eventTarget,
        event,
        eventPhase: 2,
        currentTarget: eventTarget,
        canceled: false,
        stopped: false,
        immediateStopped: false,
        passiveListener: null,
        timeStamp: event.timeStamp || Date.now()
      });
      Object.defineProperty(this, "isTrusted", { value: false, enumerable: true });
      const keys = Object.keys(event);
      for (let i7 = 0; i7 < keys.length; ++i7) {
        const key = keys[i7];
        if (!(key in this)) {
          Object.defineProperty(this, key, defineRedirectDescriptor(key));
        }
      }
    }
    __name(Event2, "Event");
    Event2.prototype = {
      /**
       * The type of this event.
       * @type {string}
       */
      get type() {
        return pd(this).event.type;
      },
      /**
       * The target of this event.
       * @type {EventTarget}
       */
      get target() {
        return pd(this).eventTarget;
      },
      /**
       * The target of this event.
       * @type {EventTarget}
       */
      get currentTarget() {
        return pd(this).currentTarget;
      },
      /**
       * @returns {EventTarget[]} The composed path of this event.
       */
      composedPath() {
        const currentTarget = pd(this).currentTarget;
        if (currentTarget == null) {
          return [];
        }
        return [currentTarget];
      },
      /**
       * Constant of NONE.
       * @type {number}
       */
      get NONE() {
        return 0;
      },
      /**
       * Constant of CAPTURING_PHASE.
       * @type {number}
       */
      get CAPTURING_PHASE() {
        return 1;
      },
      /**
       * Constant of AT_TARGET.
       * @type {number}
       */
      get AT_TARGET() {
        return 2;
      },
      /**
       * Constant of BUBBLING_PHASE.
       * @type {number}
       */
      get BUBBLING_PHASE() {
        return 3;
      },
      /**
       * The target of this event.
       * @type {number}
       */
      get eventPhase() {
        return pd(this).eventPhase;
      },
      /**
       * Stop event bubbling.
       * @returns {void}
       */
      stopPropagation() {
        const data = pd(this);
        data.stopped = true;
        if (typeof data.event.stopPropagation === "function") {
          data.event.stopPropagation();
        }
      },
      /**
       * Stop event bubbling.
       * @returns {void}
       */
      stopImmediatePropagation() {
        const data = pd(this);
        data.stopped = true;
        data.immediateStopped = true;
        if (typeof data.event.stopImmediatePropagation === "function") {
          data.event.stopImmediatePropagation();
        }
      },
      /**
       * The flag to be bubbling.
       * @type {boolean}
       */
      get bubbles() {
        return Boolean(pd(this).event.bubbles);
      },
      /**
       * The flag to be cancelable.
       * @type {boolean}
       */
      get cancelable() {
        return Boolean(pd(this).event.cancelable);
      },
      /**
       * Cancel this event.
       * @returns {void}
       */
      preventDefault() {
        setCancelFlag(pd(this));
      },
      /**
       * The flag to indicate cancellation state.
       * @type {boolean}
       */
      get defaultPrevented() {
        return pd(this).canceled;
      },
      /**
       * The flag to be composed.
       * @type {boolean}
       */
      get composed() {
        return Boolean(pd(this).event.composed);
      },
      /**
       * The unix time of this event.
       * @type {number}
       */
      get timeStamp() {
        return pd(this).timeStamp;
      },
      /**
       * The target of this event.
       * @type {EventTarget}
       * @deprecated
       */
      get srcElement() {
        return pd(this).eventTarget;
      },
      /**
       * The flag to stop event bubbling.
       * @type {boolean}
       * @deprecated
       */
      get cancelBubble() {
        return pd(this).stopped;
      },
      set cancelBubble(value) {
        if (!value) {
          return;
        }
        const data = pd(this);
        data.stopped = true;
        if (typeof data.event.cancelBubble === "boolean") {
          data.event.cancelBubble = true;
        }
      },
      /**
       * The flag to indicate cancellation state.
       * @type {boolean}
       * @deprecated
       */
      get returnValue() {
        return !pd(this).canceled;
      },
      set returnValue(value) {
        if (!value) {
          setCancelFlag(pd(this));
        }
      },
      /**
       * Initialize this event object. But do nothing under event dispatching.
       * @param {string} type The event type.
       * @param {boolean} [bubbles=false] The flag to be possible to bubble up.
       * @param {boolean} [cancelable=false] The flag to be possible to cancel.
       * @deprecated
       */
      initEvent() {
      }
    };
    Object.defineProperty(Event2.prototype, "constructor", {
      value: Event2,
      configurable: true,
      writable: true
    });
    if (typeof window !== "undefined" && typeof window.Event !== "undefined") {
      Object.setPrototypeOf(Event2.prototype, window.Event.prototype);
      wrappers.set(window.Event.prototype, Event2);
    }
    function defineRedirectDescriptor(key) {
      return {
        get() {
          return pd(this).event[key];
        },
        set(value) {
          pd(this).event[key] = value;
        },
        configurable: true,
        enumerable: true
      };
    }
    __name(defineRedirectDescriptor, "defineRedirectDescriptor");
    function defineCallDescriptor(key) {
      return {
        value() {
          const event = pd(this).event;
          return event[key].apply(event, arguments);
        },
        configurable: true,
        enumerable: true
      };
    }
    __name(defineCallDescriptor, "defineCallDescriptor");
    function defineWrapper(BaseEvent, proto2) {
      const keys = Object.keys(proto2);
      if (keys.length === 0) {
        return BaseEvent;
      }
      function CustomEvent2(eventTarget, event) {
        BaseEvent.call(this, eventTarget, event);
      }
      __name(CustomEvent2, "CustomEvent");
      CustomEvent2.prototype = Object.create(BaseEvent.prototype, {
        constructor: { value: CustomEvent2, configurable: true, writable: true }
      });
      for (let i7 = 0; i7 < keys.length; ++i7) {
        const key = keys[i7];
        if (!(key in BaseEvent.prototype)) {
          const descriptor = Object.getOwnPropertyDescriptor(proto2, key);
          const isFunc = typeof descriptor.value === "function";
          Object.defineProperty(
            CustomEvent2.prototype,
            key,
            isFunc ? defineCallDescriptor(key) : defineRedirectDescriptor(key)
          );
        }
      }
      return CustomEvent2;
    }
    __name(defineWrapper, "defineWrapper");
    function getWrapper(proto2) {
      if (proto2 == null || proto2 === Object.prototype) {
        return Event2;
      }
      let wrapper = wrappers.get(proto2);
      if (wrapper == null) {
        wrapper = defineWrapper(getWrapper(Object.getPrototypeOf(proto2)), proto2);
        wrappers.set(proto2, wrapper);
      }
      return wrapper;
    }
    __name(getWrapper, "getWrapper");
    function wrapEvent(eventTarget, event) {
      const Wrapper = getWrapper(Object.getPrototypeOf(event));
      return new Wrapper(eventTarget, event);
    }
    __name(wrapEvent, "wrapEvent");
    function isStopped(event) {
      return pd(event).immediateStopped;
    }
    __name(isStopped, "isStopped");
    function setEventPhase(event, eventPhase) {
      pd(event).eventPhase = eventPhase;
    }
    __name(setEventPhase, "setEventPhase");
    function setCurrentTarget(event, currentTarget) {
      pd(event).currentTarget = currentTarget;
    }
    __name(setCurrentTarget, "setCurrentTarget");
    function setPassiveListener(event, passiveListener) {
      pd(event).passiveListener = passiveListener;
    }
    __name(setPassiveListener, "setPassiveListener");
    var listenersMap = /* @__PURE__ */ new WeakMap();
    var CAPTURE = 1;
    var BUBBLE = 2;
    var ATTRIBUTE = 3;
    function isObject5(x7) {
      return x7 !== null && typeof x7 === "object";
    }
    __name(isObject5, "isObject");
    function getListeners(eventTarget) {
      const listeners = listenersMap.get(eventTarget);
      if (listeners == null) {
        throw new TypeError(
          "'this' is expected an EventTarget object, but got another value."
        );
      }
      return listeners;
    }
    __name(getListeners, "getListeners");
    function defineEventAttributeDescriptor(eventName) {
      return {
        get() {
          const listeners = getListeners(this);
          let node2 = listeners.get(eventName);
          while (node2 != null) {
            if (node2.listenerType === ATTRIBUTE) {
              return node2.listener;
            }
            node2 = node2.next;
          }
          return null;
        },
        set(listener) {
          if (typeof listener !== "function" && !isObject5(listener)) {
            listener = null;
          }
          const listeners = getListeners(this);
          let prev = null;
          let node2 = listeners.get(eventName);
          while (node2 != null) {
            if (node2.listenerType === ATTRIBUTE) {
              if (prev !== null) {
                prev.next = node2.next;
              } else if (node2.next !== null) {
                listeners.set(eventName, node2.next);
              } else {
                listeners.delete(eventName);
              }
            } else {
              prev = node2;
            }
            node2 = node2.next;
          }
          if (listener !== null) {
            const newNode = {
              listener,
              listenerType: ATTRIBUTE,
              passive: false,
              once: false,
              next: null
            };
            if (prev === null) {
              listeners.set(eventName, newNode);
            } else {
              prev.next = newNode;
            }
          }
        },
        configurable: true,
        enumerable: true
      };
    }
    __name(defineEventAttributeDescriptor, "defineEventAttributeDescriptor");
    function defineEventAttribute(eventTargetPrototype, eventName) {
      Object.defineProperty(
        eventTargetPrototype,
        `on${eventName}`,
        defineEventAttributeDescriptor(eventName)
      );
    }
    __name(defineEventAttribute, "defineEventAttribute");
    function defineCustomEventTarget(eventNames) {
      function CustomEventTarget() {
        EventTarget2.call(this);
      }
      __name(CustomEventTarget, "CustomEventTarget");
      CustomEventTarget.prototype = Object.create(EventTarget2.prototype, {
        constructor: {
          value: CustomEventTarget,
          configurable: true,
          writable: true
        }
      });
      for (let i7 = 0; i7 < eventNames.length; ++i7) {
        defineEventAttribute(CustomEventTarget.prototype, eventNames[i7]);
      }
      return CustomEventTarget;
    }
    __name(defineCustomEventTarget, "defineCustomEventTarget");
    function EventTarget2() {
      if (this instanceof EventTarget2) {
        listenersMap.set(this, /* @__PURE__ */ new Map());
        return;
      }
      if (arguments.length === 1 && Array.isArray(arguments[0])) {
        return defineCustomEventTarget(arguments[0]);
      }
      if (arguments.length > 0) {
        const types13 = new Array(arguments.length);
        for (let i7 = 0; i7 < arguments.length; ++i7) {
          types13[i7] = arguments[i7];
        }
        return defineCustomEventTarget(types13);
      }
      throw new TypeError("Cannot call a class as a function");
    }
    __name(EventTarget2, "EventTarget");
    EventTarget2.prototype = {
      /**
       * Add a given listener to this event target.
       * @param {string} eventName The event name to add.
       * @param {Function} listener The listener to add.
       * @param {boolean|{capture?:boolean,passive?:boolean,once?:boolean}} [options] The options for this listener.
       * @returns {void}
       */
      addEventListener(eventName, listener, options) {
        if (listener == null) {
          return;
        }
        if (typeof listener !== "function" && !isObject5(listener)) {
          throw new TypeError("'listener' should be a function or an object.");
        }
        const listeners = getListeners(this);
        const optionsIsObj = isObject5(options);
        const capture = optionsIsObj ? Boolean(options.capture) : Boolean(options);
        const listenerType = capture ? CAPTURE : BUBBLE;
        const newNode = {
          listener,
          listenerType,
          passive: optionsIsObj && Boolean(options.passive),
          once: optionsIsObj && Boolean(options.once),
          next: null
        };
        let node2 = listeners.get(eventName);
        if (node2 === void 0) {
          listeners.set(eventName, newNode);
          return;
        }
        let prev = null;
        while (node2 != null) {
          if (node2.listener === listener && node2.listenerType === listenerType) {
            return;
          }
          prev = node2;
          node2 = node2.next;
        }
        prev.next = newNode;
      },
      /**
       * Remove a given listener from this event target.
       * @param {string} eventName The event name to remove.
       * @param {Function} listener The listener to remove.
       * @param {boolean|{capture?:boolean,passive?:boolean,once?:boolean}} [options] The options for this listener.
       * @returns {void}
       */
      removeEventListener(eventName, listener, options) {
        if (listener == null) {
          return;
        }
        const listeners = getListeners(this);
        const capture = isObject5(options) ? Boolean(options.capture) : Boolean(options);
        const listenerType = capture ? CAPTURE : BUBBLE;
        let prev = null;
        let node2 = listeners.get(eventName);
        while (node2 != null) {
          if (node2.listener === listener && node2.listenerType === listenerType) {
            if (prev !== null) {
              prev.next = node2.next;
            } else if (node2.next !== null) {
              listeners.set(eventName, node2.next);
            } else {
              listeners.delete(eventName);
            }
            return;
          }
          prev = node2;
          node2 = node2.next;
        }
      },
      /**
       * Dispatch a given event.
       * @param {Event|{type:string}} event The event to dispatch.
       * @returns {boolean} `false` if canceled.
       */
      dispatchEvent(event) {
        if (event == null || typeof event.type !== "string") {
          throw new TypeError('"event.type" should be a string.');
        }
        const listeners = getListeners(this);
        const eventName = event.type;
        let node2 = listeners.get(eventName);
        if (node2 == null) {
          return true;
        }
        const wrappedEvent = wrapEvent(this, event);
        let prev = null;
        while (node2 != null) {
          if (node2.once) {
            if (prev !== null) {
              prev.next = node2.next;
            } else if (node2.next !== null) {
              listeners.set(eventName, node2.next);
            } else {
              listeners.delete(eventName);
            }
          } else {
            prev = node2;
          }
          setPassiveListener(
            wrappedEvent,
            node2.passive ? node2.listener : null
          );
          if (typeof node2.listener === "function") {
            try {
              node2.listener.call(this, wrappedEvent);
            } catch (err) {
              if (typeof console !== "undefined" && typeof console.error === "function") {
                console.error(err);
              }
            }
          } else if (node2.listenerType !== ATTRIBUTE && typeof node2.listener.handleEvent === "function") {
            node2.listener.handleEvent(wrappedEvent);
          }
          if (isStopped(wrappedEvent)) {
            break;
          }
          node2 = node2.next;
        }
        setPassiveListener(wrappedEvent, null);
        setEventPhase(wrappedEvent, 0);
        setCurrentTarget(wrappedEvent, null);
        return !wrappedEvent.defaultPrevented;
      }
    };
    Object.defineProperty(EventTarget2.prototype, "constructor", {
      value: EventTarget2,
      configurable: true,
      writable: true
    });
    if (typeof window !== "undefined" && typeof window.EventTarget !== "undefined") {
      Object.setPrototypeOf(EventTarget2.prototype, window.EventTarget.prototype);
    }
    exports.defineEventAttribute = defineEventAttribute;
    exports.EventTarget = EventTarget2;
    exports.default = EventTarget2;
    module2.exports = EventTarget2;
    module2.exports.EventTarget = module2.exports["default"] = EventTarget2;
    module2.exports.defineEventAttribute = defineEventAttribute;
  }
});

// ../../node_modules/.pnpm/abort-controller@3.0.0/node_modules/abort-controller/dist/abort-controller.js
var require_abort_controller = __commonJS({
  "../../node_modules/.pnpm/abort-controller@3.0.0/node_modules/abort-controller/dist/abort-controller.js"(exports, module2) {
    init_import_meta_url();
    Object.defineProperty(exports, "__esModule", { value: true });
    var eventTargetShim = require_event_target_shim();
    var AbortSignal2 = class extends eventTargetShim.EventTarget {
      static {
        __name(this, "AbortSignal");
      }
      /**
       * AbortSignal cannot be constructed directly.
       */
      constructor() {
        super();
        throw new TypeError("AbortSignal cannot be constructed directly");
      }
      /**
       * Returns `true` if this `AbortSignal`'s `AbortController` has signaled to abort, and `false` otherwise.
       */
      get aborted() {
        const aborted = abortedFlags.get(this);
        if (typeof aborted !== "boolean") {
          throw new TypeError(`Expected 'this' to be an 'AbortSignal' object, but got ${this === null ? "null" : typeof this}`);
        }
        return aborted;
      }
    };
    eventTargetShim.defineEventAttribute(AbortSignal2.prototype, "abort");
    function createAbortSignal() {
      const signal = Object.create(AbortSignal2.prototype);
      eventTargetShim.EventTarget.call(signal);
      abortedFlags.set(signal, false);
      return signal;
    }
    __name(createAbortSignal, "createAbortSignal");
    function abortSignal(signal) {
      if (abortedFlags.get(signal) !== false) {
        return;
      }
      abortedFlags.set(signal, true);
      signal.dispatchEvent({ type: "abort" });
    }
    __name(abortSignal, "abortSignal");
    var abortedFlags = /* @__PURE__ */ new WeakMap();
    Object.defineProperties(AbortSignal2.prototype, {
      aborted: { enumerable: true }
    });
    if (typeof Symbol === "function" && typeof Symbol.toStringTag === "symbol") {
      Object.defineProperty(AbortSignal2.prototype, Symbol.toStringTag, {
        configurable: true,
        value: "AbortSignal"
      });
    }
    var AbortController2 = class {
      static {
        __name(this, "AbortController");
      }
      /**
       * Initialize this controller.
       */
      constructor() {
        signals.set(this, createAbortSignal());
      }
      /**
       * Returns the `AbortSignal` object associated with this object.
       */
      get signal() {
        return getSignal(this);
      }
      /**
       * Abort and signal to any observers that the associated activity is to be aborted.
       */
      abort() {
        abortSignal(getSignal(this));
      }
    };
    var signals = /* @__PURE__ */ new WeakMap();
    function getSignal(controller) {
      const signal = signals.get(controller);
      if (signal == null) {
        throw new TypeError(`Expected 'this' to be an 'AbortController' object, but got ${controller === null ? "null" : typeof controller}`);
      }
      return signal;
    }
    __name(getSignal, "getSignal");
    Object.defineProperties(AbortController2.prototype, {
      signal: { enumerable: true },
      abort: { enumerable: true }
    });
    if (typeof Symbol === "function" && typeof Symbol.toStringTag === "symbol") {
      Object.defineProperty(AbortController2.prototype, Symbol.toStringTag, {
        configurable: true,
        value: "AbortController"
      });
    }
    exports.AbortController = AbortController2;
    exports.AbortSignal = AbortSignal2;
    exports.default = AbortController2;
    module2.exports = AbortController2;
    module2.exports.AbortController = module2.exports["default"] = AbortController2;
    module2.exports.AbortSignal = AbortSignal2;
  }
});

// ../../node_modules/.pnpm/form-data-encoder@1.7.2/node_modules/form-data-encoder/lib/esm/util/createBoundary.js
function createBoundary() {
  let size = 16;
  let res = "";
  while (size--) {
    res += alphabet[Math.random() * alphabet.length << 0];
  }
  return res;
}
var alphabet, createBoundary_default;
var init_createBoundary = __esm({
  "../../node_modules/.pnpm/form-data-encoder@1.7.2/node_modules/form-data-encoder/lib/esm/util/createBoundary.js"() {
    init_import_meta_url();
    alphabet = "abcdefghijklmnopqrstuvwxyz0123456789";
    __name(createBoundary, "createBoundary");
    createBoundary_default = createBoundary;
  }
});

// ../../node_modules/.pnpm/form-data-encoder@1.7.2/node_modules/form-data-encoder/lib/esm/util/isPlainObject.js
function isPlainObject(value) {
  if (getType(value) !== "object") {
    return false;
  }
  const pp = Object.getPrototypeOf(value);
  if (pp === null || pp === void 0) {
    return true;
  }
  const Ctor = pp.constructor && pp.constructor.toString();
  return Ctor === Object.toString();
}
var getType, isPlainObject_default;
var init_isPlainObject = __esm({
  "../../node_modules/.pnpm/form-data-encoder@1.7.2/node_modules/form-data-encoder/lib/esm/util/isPlainObject.js"() {
    init_import_meta_url();
    getType = /* @__PURE__ */ __name((value) => Object.prototype.toString.call(value).slice(8, -1).toLowerCase(), "getType");
    __name(isPlainObject, "isPlainObject");
    isPlainObject_default = isPlainObject;
  }
});

// ../../node_modules/.pnpm/form-data-encoder@1.7.2/node_modules/form-data-encoder/lib/esm/util/normalizeValue.js
var normalizeValue, normalizeValue_default;
var init_normalizeValue = __esm({
  "../../node_modules/.pnpm/form-data-encoder@1.7.2/node_modules/form-data-encoder/lib/esm/util/normalizeValue.js"() {
    init_import_meta_url();
    normalizeValue = /* @__PURE__ */ __name((value) => String(value).replace(/\r|\n/g, (match3, i7, str) => {
      if (match3 === "\r" && str[i7 + 1] !== "\n" || match3 === "\n" && str[i7 - 1] !== "\r") {
        return "\r\n";
      }
      return match3;
    }), "normalizeValue");
    normalizeValue_default = normalizeValue;
  }
});

// ../../node_modules/.pnpm/form-data-encoder@1.7.2/node_modules/form-data-encoder/lib/esm/util/escapeName.js
var escapeName, escapeName_default;
var init_escapeName = __esm({
  "../../node_modules/.pnpm/form-data-encoder@1.7.2/node_modules/form-data-encoder/lib/esm/util/escapeName.js"() {
    init_import_meta_url();
    escapeName = /* @__PURE__ */ __name((name2) => String(name2).replace(/\r/g, "%0D").replace(/\n/g, "%0A").replace(/"/g, "%22"), "escapeName");
    escapeName_default = escapeName;
  }
});

// ../../node_modules/.pnpm/form-data-encoder@1.7.2/node_modules/form-data-encoder/lib/esm/util/isFunction.js
var isFunction2, isFunction_default;
var init_isFunction2 = __esm({
  "../../node_modules/.pnpm/form-data-encoder@1.7.2/node_modules/form-data-encoder/lib/esm/util/isFunction.js"() {
    init_import_meta_url();
    isFunction2 = /* @__PURE__ */ __name((value) => typeof value === "function", "isFunction");
    isFunction_default = isFunction2;
  }
});

// ../../node_modules/.pnpm/form-data-encoder@1.7.2/node_modules/form-data-encoder/lib/esm/util/isFileLike.js
var isFileLike;
var init_isFileLike = __esm({
  "../../node_modules/.pnpm/form-data-encoder@1.7.2/node_modules/form-data-encoder/lib/esm/util/isFileLike.js"() {
    init_import_meta_url();
    init_isFunction2();
    isFileLike = /* @__PURE__ */ __name((value) => Boolean(value && typeof value === "object" && isFunction_default(value.constructor) && value[Symbol.toStringTag] === "File" && isFunction_default(value.stream) && value.name != null && value.size != null && value.lastModified != null), "isFileLike");
  }
});

// ../../node_modules/.pnpm/form-data-encoder@1.7.2/node_modules/form-data-encoder/lib/esm/util/isFormData.js
var isFormData;
var init_isFormData = __esm({
  "../../node_modules/.pnpm/form-data-encoder@1.7.2/node_modules/form-data-encoder/lib/esm/util/isFormData.js"() {
    init_import_meta_url();
    init_isFunction2();
    isFormData = /* @__PURE__ */ __name((value) => Boolean(value && isFunction_default(value.constructor) && value[Symbol.toStringTag] === "FormData" && isFunction_default(value.append) && isFunction_default(value.getAll) && isFunction_default(value.entries) && isFunction_default(value[Symbol.iterator])), "isFormData");
  }
});

// ../../node_modules/.pnpm/form-data-encoder@1.7.2/node_modules/form-data-encoder/lib/esm/FormDataEncoder.js
var __classPrivateFieldSet3, __classPrivateFieldGet5, _FormDataEncoder_instances, _FormDataEncoder_CRLF, _FormDataEncoder_CRLF_BYTES, _FormDataEncoder_CRLF_BYTES_LENGTH, _FormDataEncoder_DASHES, _FormDataEncoder_encoder, _FormDataEncoder_footer, _FormDataEncoder_form, _FormDataEncoder_options, _FormDataEncoder_getFieldHeader, defaultOptions, FormDataEncoder;
var init_FormDataEncoder = __esm({
  "../../node_modules/.pnpm/form-data-encoder@1.7.2/node_modules/form-data-encoder/lib/esm/FormDataEncoder.js"() {
    init_import_meta_url();
    init_createBoundary();
    init_isPlainObject();
    init_normalizeValue();
    init_escapeName();
    init_isFileLike();
    init_isFormData();
    __classPrivateFieldSet3 = function(receiver, state2, value, kind2, f8) {
      if (kind2 === "m") throw new TypeError("Private method is not writable");
      if (kind2 === "a" && !f8) throw new TypeError("Private accessor was defined without a setter");
      if (typeof state2 === "function" ? receiver !== state2 || !f8 : !state2.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
      return kind2 === "a" ? f8.call(receiver, value) : f8 ? f8.value = value : state2.set(receiver, value), value;
    };
    __classPrivateFieldGet5 = function(receiver, state2, kind2, f8) {
      if (kind2 === "a" && !f8) throw new TypeError("Private accessor was defined without a getter");
      if (typeof state2 === "function" ? receiver !== state2 || !f8 : !state2.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
      return kind2 === "m" ? f8 : kind2 === "a" ? f8.call(receiver) : f8 ? f8.value : state2.get(receiver);
    };
    defaultOptions = {
      enableAdditionalHeaders: false
    };
    FormDataEncoder = class {
      static {
        __name(this, "FormDataEncoder");
      }
      constructor(form, boundaryOrOptions, options) {
        _FormDataEncoder_instances.add(this);
        _FormDataEncoder_CRLF.set(this, "\r\n");
        _FormDataEncoder_CRLF_BYTES.set(this, void 0);
        _FormDataEncoder_CRLF_BYTES_LENGTH.set(this, void 0);
        _FormDataEncoder_DASHES.set(this, "-".repeat(2));
        _FormDataEncoder_encoder.set(this, new TextEncoder());
        _FormDataEncoder_footer.set(this, void 0);
        _FormDataEncoder_form.set(this, void 0);
        _FormDataEncoder_options.set(this, void 0);
        if (!isFormData(form)) {
          throw new TypeError("Expected first argument to be a FormData instance.");
        }
        let boundary;
        if (isPlainObject_default(boundaryOrOptions)) {
          options = boundaryOrOptions;
        } else {
          boundary = boundaryOrOptions;
        }
        if (!boundary) {
          boundary = createBoundary_default();
        }
        if (typeof boundary !== "string") {
          throw new TypeError("Expected boundary argument to be a string.");
        }
        if (options && !isPlainObject_default(options)) {
          throw new TypeError("Expected options argument to be an object.");
        }
        __classPrivateFieldSet3(this, _FormDataEncoder_form, form, "f");
        __classPrivateFieldSet3(this, _FormDataEncoder_options, { ...defaultOptions, ...options }, "f");
        __classPrivateFieldSet3(this, _FormDataEncoder_CRLF_BYTES, __classPrivateFieldGet5(this, _FormDataEncoder_encoder, "f").encode(__classPrivateFieldGet5(this, _FormDataEncoder_CRLF, "f")), "f");
        __classPrivateFieldSet3(this, _FormDataEncoder_CRLF_BYTES_LENGTH, __classPrivateFieldGet5(this, _FormDataEncoder_CRLF_BYTES, "f").byteLength, "f");
        this.boundary = `form-data-boundary-${boundary}`;
        this.contentType = `multipart/form-data; boundary=${this.boundary}`;
        __classPrivateFieldSet3(this, _FormDataEncoder_footer, __classPrivateFieldGet5(this, _FormDataEncoder_encoder, "f").encode(`${__classPrivateFieldGet5(this, _FormDataEncoder_DASHES, "f")}${this.boundary}${__classPrivateFieldGet5(this, _FormDataEncoder_DASHES, "f")}${__classPrivateFieldGet5(this, _FormDataEncoder_CRLF, "f").repeat(2)}`), "f");
        this.contentLength = String(this.getContentLength());
        this.headers = Object.freeze({
          "Content-Type": this.contentType,
          "Content-Length": this.contentLength
        });
        Object.defineProperties(this, {
          boundary: { writable: false, configurable: false },
          contentType: { writable: false, configurable: false },
          contentLength: { writable: false, configurable: false },
          headers: { writable: false, configurable: false }
        });
      }
      getContentLength() {
        let length = 0;
        for (const [name2, raw] of __classPrivateFieldGet5(this, _FormDataEncoder_form, "f")) {
          const value = isFileLike(raw) ? raw : __classPrivateFieldGet5(this, _FormDataEncoder_encoder, "f").encode(normalizeValue_default(raw));
          length += __classPrivateFieldGet5(this, _FormDataEncoder_instances, "m", _FormDataEncoder_getFieldHeader).call(this, name2, value).byteLength;
          length += isFileLike(value) ? value.size : value.byteLength;
          length += __classPrivateFieldGet5(this, _FormDataEncoder_CRLF_BYTES_LENGTH, "f");
        }
        return length + __classPrivateFieldGet5(this, _FormDataEncoder_footer, "f").byteLength;
      }
      *values() {
        for (const [name2, raw] of __classPrivateFieldGet5(this, _FormDataEncoder_form, "f").entries()) {
          const value = isFileLike(raw) ? raw : __classPrivateFieldGet5(this, _FormDataEncoder_encoder, "f").encode(normalizeValue_default(raw));
          yield __classPrivateFieldGet5(this, _FormDataEncoder_instances, "m", _FormDataEncoder_getFieldHeader).call(this, name2, value);
          yield value;
          yield __classPrivateFieldGet5(this, _FormDataEncoder_CRLF_BYTES, "f");
        }
        yield __classPrivateFieldGet5(this, _FormDataEncoder_footer, "f");
      }
      async *encode() {
        for (const part of this.values()) {
          if (isFileLike(part)) {
            yield* part.stream();
          } else {
            yield part;
          }
        }
      }
      [(_FormDataEncoder_CRLF = /* @__PURE__ */ new WeakMap(), _FormDataEncoder_CRLF_BYTES = /* @__PURE__ */ new WeakMap(), _FormDataEncoder_CRLF_BYTES_LENGTH = /* @__PURE__ */ new WeakMap(), _FormDataEncoder_DASHES = /* @__PURE__ */ new WeakMap(), _FormDataEncoder_encoder = /* @__PURE__ */ new WeakMap(), _FormDataEncoder_footer = /* @__PURE__ */ new WeakMap(), _FormDataEncoder_form = /* @__PURE__ */ new WeakMap(), _FormDataEncoder_options = /* @__PURE__ */ new WeakMap(), _FormDataEncoder_instances = /* @__PURE__ */ new WeakSet(), _FormDataEncoder_getFieldHeader = /* @__PURE__ */ __name(function _FormDataEncoder_getFieldHeader2(name2, value) {
        let header = "";
        header += `${__classPrivateFieldGet5(this, _FormDataEncoder_DASHES, "f")}${this.boundary}${__classPrivateFieldGet5(this, _FormDataEncoder_CRLF, "f")}`;
        header += `Content-Disposition: form-data; name="${escapeName_default(name2)}"`;
        if (isFileLike(value)) {
          header += `; filename="${escapeName_default(value.name)}"${__classPrivateFieldGet5(this, _FormDataEncoder_CRLF, "f")}`;
          header += `Content-Type: ${value.type || "application/octet-stream"}`;
        }
        if (__classPrivateFieldGet5(this, _FormDataEncoder_options, "f").enableAdditionalHeaders === true) {
          header += `${__classPrivateFieldGet5(this, _FormDataEncoder_CRLF, "f")}Content-Length: ${isFileLike(value) ? value.size : value.byteLength}`;
        }
        return __classPrivateFieldGet5(this, _FormDataEncoder_encoder, "f").encode(`${header}${__classPrivateFieldGet5(this, _FormDataEncoder_CRLF, "f").repeat(2)}`);
      }, "_FormDataEncoder_getFieldHeader"), Symbol.iterator)]() {
        return this.values();
      }
      [Symbol.asyncIterator]() {
        return this.encode();
      }
    };
  }
});

// ../../node_modules/.pnpm/form-data-encoder@1.7.2/node_modules/form-data-encoder/lib/esm/FileLike.js
var init_FileLike = __esm({
  "../../node_modules/.pnpm/form-data-encoder@1.7.2/node_modules/form-data-encoder/lib/esm/FileLike.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/form-data-encoder@1.7.2/node_modules/form-data-encoder/lib/esm/FormDataLike.js
var init_FormDataLike = __esm({
  "../../node_modules/.pnpm/form-data-encoder@1.7.2/node_modules/form-data-encoder/lib/esm/FormDataLike.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/form-data-encoder@1.7.2/node_modules/form-data-encoder/lib/esm/index.js
var init_esm4 = __esm({
  "../../node_modules/.pnpm/form-data-encoder@1.7.2/node_modules/form-data-encoder/lib/esm/index.js"() {
    init_import_meta_url();
    init_FormDataEncoder();
    init_FileLike();
    init_FormDataLike();
    init_isFileLike();
    init_isFormData();
  }
});

// ../../node_modules/.pnpm/node-domexception@1.0.0/node_modules/node-domexception/index.js
var require_node_domexception = __commonJS({
  "../../node_modules/.pnpm/node-domexception@1.0.0/node_modules/node-domexception/index.js"(exports, module2) {
    init_import_meta_url();
    if (!globalThis.DOMException) {
      try {
        const { MessageChannel } = __require("worker_threads"), port = new MessageChannel().port1, ab2 = new ArrayBuffer();
        port.postMessage(ab2, [ab2, ab2]);
      } catch (err) {
        err.constructor.name === "DOMException" && (globalThis.DOMException = err.constructor);
      }
    }
    module2.exports = globalThis.DOMException;
  }
});

// ../../node_modules/.pnpm/formdata-node@4.4.1/node_modules/formdata-node/lib/esm/isPlainObject.js
function isPlainObject2(value) {
  if (getType2(value) !== "object") {
    return false;
  }
  const pp = Object.getPrototypeOf(value);
  if (pp === null || pp === void 0) {
    return true;
  }
  const Ctor = pp.constructor && pp.constructor.toString();
  return Ctor === Object.toString();
}
var getType2, isPlainObject_default2;
var init_isPlainObject2 = __esm({
  "../../node_modules/.pnpm/formdata-node@4.4.1/node_modules/formdata-node/lib/esm/isPlainObject.js"() {
    init_import_meta_url();
    getType2 = /* @__PURE__ */ __name((value) => Object.prototype.toString.call(value).slice(8, -1).toLowerCase(), "getType");
    __name(isPlainObject2, "isPlainObject");
    isPlainObject_default2 = isPlainObject2;
  }
});

// ../../node_modules/.pnpm/formdata-node@4.4.1/node_modules/formdata-node/lib/esm/fileFromPath.js
var fileFromPath_exports = {};
__export(fileFromPath_exports, {
  fileFromPath: () => fileFromPath2,
  fileFromPathSync: () => fileFromPathSync,
  isFile: () => isFile
});
function createFileFromPath(path84, { mtimeMs, size }, filenameOrOptions, options = {}) {
  let filename;
  if (isPlainObject_default2(filenameOrOptions)) {
    [options, filename] = [filenameOrOptions, void 0];
  } else {
    filename = filenameOrOptions;
  }
  const file3 = new FileFromPath({ path: path84, size, lastModified: mtimeMs });
  if (!filename) {
    filename = file3.name;
  }
  return new File3([file3], filename, {
    ...options,
    lastModified: file3.lastModified
  });
}
function fileFromPathSync(path84, filenameOrOptions, options = {}) {
  const stats = fs29.statSync(path84);
  return createFileFromPath(path84, stats, filenameOrOptions, options);
}
async function fileFromPath2(path84, filenameOrOptions, options) {
  const stats = await fs29.promises.stat(path84);
  return createFileFromPath(path84, stats, filenameOrOptions, options);
}
var import_node_domexception, __classPrivateFieldSet4, __classPrivateFieldGet6, _FileFromPath_path, _FileFromPath_start, MESSAGE, FileFromPath;
var init_fileFromPath = __esm({
  "../../node_modules/.pnpm/formdata-node@4.4.1/node_modules/formdata-node/lib/esm/fileFromPath.js"() {
    init_import_meta_url();
    import_node_domexception = __toESM(require_node_domexception(), 1);
    init_File();
    init_isPlainObject2();
    init_isFile();
    __classPrivateFieldSet4 = function(receiver, state2, value, kind2, f8) {
      if (kind2 === "m") throw new TypeError("Private method is not writable");
      if (kind2 === "a" && !f8) throw new TypeError("Private accessor was defined without a setter");
      if (typeof state2 === "function" ? receiver !== state2 || !f8 : !state2.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
      return kind2 === "a" ? f8.call(receiver, value) : f8 ? f8.value = value : state2.set(receiver, value), value;
    };
    __classPrivateFieldGet6 = function(receiver, state2, kind2, f8) {
      if (kind2 === "a" && !f8) throw new TypeError("Private accessor was defined without a getter");
      if (typeof state2 === "function" ? receiver !== state2 || !f8 : !state2.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
      return kind2 === "m" ? f8 : kind2 === "a" ? f8.call(receiver) : f8 ? f8.value : state2.get(receiver);
    };
    MESSAGE = "The requested file could not be read, typically due to permission problems that have occurred after a reference to a file was acquired.";
    FileFromPath = class _FileFromPath {
      static {
        __name(this, "FileFromPath");
      }
      constructor(input) {
        _FileFromPath_path.set(this, void 0);
        _FileFromPath_start.set(this, void 0);
        __classPrivateFieldSet4(this, _FileFromPath_path, input.path, "f");
        __classPrivateFieldSet4(this, _FileFromPath_start, input.start || 0, "f");
        this.name = path3.basename(__classPrivateFieldGet6(this, _FileFromPath_path, "f"));
        this.size = input.size;
        this.lastModified = input.lastModified;
      }
      slice(start, end) {
        return new _FileFromPath({
          path: __classPrivateFieldGet6(this, _FileFromPath_path, "f"),
          lastModified: this.lastModified,
          size: end - start,
          start
        });
      }
      async *stream() {
        const { mtimeMs } = await fs29.promises.stat(__classPrivateFieldGet6(this, _FileFromPath_path, "f"));
        if (mtimeMs > this.lastModified) {
          throw new import_node_domexception.default(MESSAGE, "NotReadableError");
        }
        if (this.size) {
          yield* fs29.createReadStream(__classPrivateFieldGet6(this, _FileFromPath_path, "f"), {
            start: __classPrivateFieldGet6(this, _FileFromPath_start, "f"),
            end: __classPrivateFieldGet6(this, _FileFromPath_start, "f") + this.size - 1
          });
        }
      }
      get [(_FileFromPath_path = /* @__PURE__ */ new WeakMap(), _FileFromPath_start = /* @__PURE__ */ new WeakMap(), Symbol.toStringTag)]() {
        return "File";
      }
    };
    __name(createFileFromPath, "createFileFromPath");
    __name(fileFromPathSync, "fileFromPathSync");
    __name(fileFromPath2, "fileFromPath");
  }
});
async function fileFromPath3(path84, ...args) {
  const { fileFromPath: _fileFromPath } = await Promise.resolve().then(() => (init_fileFromPath(), fileFromPath_exports));
  if (!fileFromPathWarned) {
    console.warn(`fileFromPath is deprecated; use fs.createReadStream(${JSON.stringify(path84)}) instead`);
    fileFromPathWarned = true;
  }
  return await _fileFromPath(path84, ...args);
}
async function getMultipartRequestOptions2(form, opts) {
  const encoder = new FormDataEncoder(form);
  const readable = Stream.Readable.from(encoder);
  const body = new MultipartBody(readable);
  const headers = {
    ...opts.headers,
    ...encoder.headers,
    "Content-Length": encoder.contentLength
  };
  return { ...opts, body, headers };
}
function getRuntime2() {
  if (typeof AbortController === "undefined") {
    globalThis.AbortController = import_abort_controller.AbortController;
  }
  return {
    kind: "node",
    fetch: lib_default2,
    Request: Request3,
    Response: Response3,
    Headers: Headers3,
    FormData: FormData3,
    Blob: Blob4,
    File: File3,
    ReadableStream: web.ReadableStream,
    getMultipartRequestOptions: getMultipartRequestOptions2,
    getDefaultAgent: /* @__PURE__ */ __name((url4) => url4.startsWith("https") ? defaultHttpsAgent : defaultHttpAgent, "getDefaultAgent"),
    fileFromPath: fileFromPath3,
    isFsReadStream: /* @__PURE__ */ __name((value) => value instanceof fs29.ReadStream, "isFsReadStream")
  };
}
var import_agentkeepalive, import_abort_controller, fileFromPathWarned, defaultHttpAgent, defaultHttpsAgent;
var init_node_runtime = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/_shims/node-runtime.mjs"() {
    init_import_meta_url();
    init_lib4();
    init_esm3();
    import_agentkeepalive = __toESM(require_agentkeepalive(), 1);
    import_abort_controller = __toESM(require_abort_controller(), 1);
    init_esm4();
    init_MultipartBody();
    fileFromPathWarned = false;
    __name(fileFromPath3, "fileFromPath");
    defaultHttpAgent = new import_agentkeepalive.default({ keepAlive: true, timeout: 5 * 60 * 1e3 });
    defaultHttpsAgent = new import_agentkeepalive.default.HttpsAgent({ keepAlive: true, timeout: 5 * 60 * 1e3 });
    __name(getMultipartRequestOptions2, "getMultipartRequestOptions");
    __name(getRuntime2, "getRuntime");
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/_shims/auto/runtime-node.mjs
var init_runtime_node = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/_shims/auto/runtime-node.mjs"() {
    init_import_meta_url();
    init_node_runtime();
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/_shims/index.mjs
var init;
var init_shims = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/_shims/index.mjs"() {
    init_import_meta_url();
    init_registry();
    init_runtime_node();
    init_registry();
    init = /* @__PURE__ */ __name(() => {
      if (!kind) setShims(getRuntime2(), { auto: true });
    }, "init");
    init();
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/uploads.mjs
async function toFile(value, name2, options) {
  value = await value;
  if (isFileLike2(value)) {
    return value;
  }
  if (isResponseLike(value)) {
    const blob = await value.blob();
    name2 || (name2 = new URL(value.url).pathname.split(/[\\/]/).pop() ?? "unknown_file");
    const data = isBlobLike(blob) ? [await blob.arrayBuffer()] : [blob];
    return new File2(data, name2, options);
  }
  const bits = await getBytes(value);
  name2 || (name2 = getName2(value) ?? "unknown_file");
  if (!options?.type) {
    const type = bits[0]?.type;
    if (typeof type === "string") {
      options = { ...options, type };
    }
  }
  return new File2(bits, name2, options);
}
async function getBytes(value) {
  let parts = [];
  if (typeof value === "string" || ArrayBuffer.isView(value) || // includes Uint8Array, Buffer, etc.
  value instanceof ArrayBuffer) {
    parts.push(value);
  } else if (isBlobLike(value)) {
    parts.push(await value.arrayBuffer());
  } else if (isAsyncIterableIterator(value)) {
    for await (const chunk of value) {
      parts.push(chunk);
    }
  } else {
    throw new Error(`Unexpected data type: ${typeof value}; constructor: ${value?.constructor?.name}; props: ${propsForError(value)}`);
  }
  return parts;
}
function propsForError(value) {
  const props = Object.getOwnPropertyNames(value);
  return `[${props.map((p7) => `"${p7}"`).join(", ")}]`;
}
function getName2(value) {
  return getStringFromMaybeBuffer(value.name) || getStringFromMaybeBuffer(value.filename) || // For fs.ReadStream
  getStringFromMaybeBuffer(value.path)?.split(/[\\/]/).pop();
}
var isResponseLike, isFileLike2, isBlobLike, isUploadable, getStringFromMaybeBuffer, isAsyncIterableIterator, isMultipartBody, maybeMultipartFormRequestOptions, multipartFormRequestOptions, createForm, hasUploadableValue, addFormValue, addFormValueJson;
var init_uploads = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/uploads.mjs"() {
    init_import_meta_url();
    init_shims();
    init_shims();
    isResponseLike = /* @__PURE__ */ __name((value) => value != null && typeof value === "object" && typeof value.url === "string" && typeof value.blob === "function", "isResponseLike");
    isFileLike2 = /* @__PURE__ */ __name((value) => value != null && typeof value === "object" && typeof value.name === "string" && typeof value.lastModified === "number" && isBlobLike(value), "isFileLike");
    isBlobLike = /* @__PURE__ */ __name((value) => value != null && typeof value === "object" && typeof value.size === "number" && typeof value.type === "string" && typeof value.text === "function" && typeof value.slice === "function" && typeof value.arrayBuffer === "function", "isBlobLike");
    isUploadable = /* @__PURE__ */ __name((value) => {
      return isFileLike2(value) || isResponseLike(value) || isFsReadStream(value);
    }, "isUploadable");
    __name(toFile, "toFile");
    __name(getBytes, "getBytes");
    __name(propsForError, "propsForError");
    __name(getName2, "getName");
    getStringFromMaybeBuffer = /* @__PURE__ */ __name((x7) => {
      if (typeof x7 === "string")
        return x7;
      if (typeof Buffer !== "undefined" && x7 instanceof Buffer)
        return String(x7);
      return void 0;
    }, "getStringFromMaybeBuffer");
    isAsyncIterableIterator = /* @__PURE__ */ __name((value) => value != null && typeof value === "object" && typeof value[Symbol.asyncIterator] === "function", "isAsyncIterableIterator");
    isMultipartBody = /* @__PURE__ */ __name((body) => body && typeof body === "object" && body.body && body[Symbol.toStringTag] === "MultipartBody", "isMultipartBody");
    maybeMultipartFormRequestOptions = /* @__PURE__ */ __name(async (opts) => {
      if (!hasUploadableValue(opts.body))
        return opts;
      const form = await createForm(opts.body, opts);
      return getMultipartRequestOptions(form, opts);
    }, "maybeMultipartFormRequestOptions");
    multipartFormRequestOptions = /* @__PURE__ */ __name(async (opts) => {
      const form = await createForm(opts.body, opts);
      return getMultipartRequestOptions(form, opts);
    }, "multipartFormRequestOptions");
    createForm = /* @__PURE__ */ __name(async (body, opts) => {
      const form = new FormData2();
      await Promise.all(Object.entries(body || {}).map(([key, value]) => addFormValue(form, key, value, opts)));
      return form;
    }, "createForm");
    hasUploadableValue = /* @__PURE__ */ __name((value) => {
      if (isUploadable(value))
        return true;
      if (Array.isArray(value))
        return value.some(hasUploadableValue);
      if (value && typeof value === "object") {
        for (const k7 in value) {
          if (hasUploadableValue(value[k7]))
            return true;
        }
      }
      return false;
    }, "hasUploadableValue");
    addFormValue = /* @__PURE__ */ __name(async (form, key, value, opts) => {
      if (opts?.__multipartSyntax === "json") {
        return await addFormValueJson(form, key, value);
      }
      if (value === void 0)
        return;
      if (value == null) {
        throw new TypeError(`Received null for "${key}"; to pass null in FormData, you must use the string 'null'`);
      }
      if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
        form.append(key, String(value));
      } else if (isUploadable(value)) {
        const file3 = await toFile(value);
        form.append(key, file3);
      } else if (Array.isArray(value)) {
        await Promise.all(value.map((entry) => addFormValue(form, key + "[]", entry)));
      } else if (typeof value === "object") {
        await Promise.all(Object.entries(value).map(([name2, prop]) => addFormValue(form, `${key}[${name2}]`, prop)));
      }
    }, "addFormValue");
    addFormValueJson = /* @__PURE__ */ __name(async (form, key, value) => {
      if (value === void 0)
        return;
      if (value == null) {
        throw new TypeError(`Received null for "${key}"; to pass null in FormData, you must use the string 'null'`);
      }
      if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
        form.append(key, String(value));
        return;
      }
      if (isUploadable(value)) {
        const file3 = await toFile(value);
        form.append(key, file3);
        return;
      }
      if (Array.isArray(value) && value.some((e10) => isUploadable(e10))) {
        for (const entry of value) {
          form.append(key, await toFile(entry));
        }
        return;
      }
      if (Array.isArray(value) || typeof value === "object") {
        form.append(key, new File2([JSON.stringify(value)], key, { type: "application/json" }));
        return;
      }
      throw new TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${value} instead`);
    }, "addFormValueJson");
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/core.mjs
async function defaultParseResponse(props) {
  const { response } = props;
  if (response.status === 204) {
    return null;
  }
  if (props.options.__binaryResponse) {
    return response;
  }
  const contentType = response.headers.get("content-type");
  const mediaType = contentType?.split(";")[0]?.trim();
  const isJSON = mediaType?.includes("application/json") || mediaType?.endsWith("+json");
  if (isJSON) {
    const json = await response.json();
    debug("response", response.status, response.url, response.headers, json);
    return json;
  }
  const text = await response.text();
  debug("response", response.status, response.url, response.headers, text);
  return text;
}
function getBrowserInfo() {
  if (typeof navigator === "undefined" || !navigator) {
    return null;
  }
  const browserPatterns = [
    { key: "edge", pattern: /Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/ },
    { key: "ie", pattern: /MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/ },
    { key: "ie", pattern: /Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/ },
    { key: "chrome", pattern: /Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/ },
    { key: "firefox", pattern: /Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/ },
    { key: "safari", pattern: /(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/ }
  ];
  for (const { key, pattern } of browserPatterns) {
    const match3 = pattern.exec(navigator.userAgent);
    if (match3) {
      const major = match3[1] || 0;
      const minor = match3[2] || 0;
      const patch = match3[3] || 0;
      return { browser: key, version: `${major}.${minor}.${patch}` };
    }
  }
  return null;
}
function isEmptyObj(obj) {
  if (!obj)
    return true;
  for (const _k in obj)
    return false;
  return true;
}
function hasOwn(obj, key) {
  return Object.prototype.hasOwnProperty.call(obj, key);
}
function applyHeadersMut(targetHeaders, newHeaders) {
  for (const k7 in newHeaders) {
    if (!hasOwn(newHeaders, k7))
      continue;
    const lowerKey = k7.toLowerCase();
    if (!lowerKey)
      continue;
    const val2 = newHeaders[k7];
    if (val2 === null) {
      delete targetHeaders[lowerKey];
    } else if (val2 !== void 0) {
      targetHeaders[lowerKey] = val2;
    }
  }
}
function debug(action, ...args) {
  if (typeof process !== "undefined" && process?.env?.["DEBUG"] === "true") {
    console.log(`Cloudflare:DEBUG:${action}`, ...args);
  }
}
var __classPrivateFieldSet5, __classPrivateFieldGet7, _APIClient_baseURLOverridden, _AbstractPage_client, APIPromise, APIClient, AbstractPage, PagePromise, createResponseHeaders, requestOptionsKeys, isRequestOptions, getPlatformProperties, normalizeArch, normalizePlatform, _platformHeaders, getPlatformHeaders, safeJSON, startsWithSchemeRegexp, isAbsoluteURL, sleep, validatePositiveInteger, castToError, readEnv, uuid4, isHeadersProtocol, getHeader;
var init_core2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/core.mjs"() {
    init_import_meta_url();
    init_version();
    init_error4();
    init_shims();
    init_uploads();
    init_uploads();
    __classPrivateFieldSet5 = function(receiver, state2, value, kind2, f8) {
      if (kind2 === "m") throw new TypeError("Private method is not writable");
      if (kind2 === "a" && !f8) throw new TypeError("Private accessor was defined without a setter");
      if (typeof state2 === "function" ? receiver !== state2 || !f8 : !state2.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
      return kind2 === "a" ? f8.call(receiver, value) : f8 ? f8.value = value : state2.set(receiver, value), value;
    };
    __classPrivateFieldGet7 = function(receiver, state2, kind2, f8) {
      if (kind2 === "a" && !f8) throw new TypeError("Private accessor was defined without a getter");
      if (typeof state2 === "function" ? receiver !== state2 || !f8 : !state2.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
      return kind2 === "m" ? f8 : kind2 === "a" ? f8.call(receiver) : f8 ? f8.value : state2.get(receiver);
    };
    init();
    __name(defaultParseResponse, "defaultParseResponse");
    APIPromise = class _APIPromise extends Promise {
      static {
        __name(this, "APIPromise");
      }
      constructor(responsePromise, parseResponse = defaultParseResponse) {
        super((resolve32) => {
          resolve32(null);
        });
        this.responsePromise = responsePromise;
        this.parseResponse = parseResponse;
      }
      _thenUnwrap(transform) {
        return new _APIPromise(this.responsePromise, async (props) => transform(await this.parseResponse(props), props));
      }
      /**
       * Gets the raw `Response` instance instead of parsing the response
       * data.
       *
       * If you want to parse the response body but still get the `Response`
       * instance, you can use {@link withResponse()}.
       *
       * 👋 Getting the wrong TypeScript type for `Response`?
       * Try setting `"moduleResolution": "NodeNext"` if you can,
       * or add one of these imports before your first `import … from 'cloudflare'`:
       * - `import 'cloudflare/shims/node'` (if you're running on Node)
       * - `import 'cloudflare/shims/web'` (otherwise)
       */
      asResponse() {
        return this.responsePromise.then((p7) => p7.response);
      }
      /**
       * Gets the parsed response data and the raw `Response` instance.
       *
       * If you just want to get the raw `Response` instance without parsing it,
       * you can use {@link asResponse()}.
       *
       *
       * 👋 Getting the wrong TypeScript type for `Response`?
       * Try setting `"moduleResolution": "NodeNext"` if you can,
       * or add one of these imports before your first `import … from 'cloudflare'`:
       * - `import 'cloudflare/shims/node'` (if you're running on Node)
       * - `import 'cloudflare/shims/web'` (otherwise)
       */
      async withResponse() {
        const [data, response] = await Promise.all([this.parse(), this.asResponse()]);
        return { data, response };
      }
      parse() {
        if (!this.parsedPromise) {
          this.parsedPromise = this.responsePromise.then(this.parseResponse);
        }
        return this.parsedPromise;
      }
      then(onfulfilled, onrejected) {
        return this.parse().then(onfulfilled, onrejected);
      }
      catch(onrejected) {
        return this.parse().catch(onrejected);
      }
      finally(onfinally) {
        return this.parse().finally(onfinally);
      }
    };
    APIClient = class {
      static {
        __name(this, "APIClient");
      }
      constructor({
        baseURL,
        apiVersion,
        baseURLOverridden,
        maxRetries = 2,
        timeout: timeout2 = 6e4,
        // 1 minute
        httpAgent,
        fetch: overriddenFetch
      }) {
        _APIClient_baseURLOverridden.set(this, void 0);
        this.baseURL = baseURL;
        this.apiVersion = apiVersion;
        __classPrivateFieldSet5(this, _APIClient_baseURLOverridden, baseURLOverridden, "f");
        this.maxRetries = validatePositiveInteger("maxRetries", maxRetries);
        this.timeout = validatePositiveInteger("timeout", timeout2);
        this.httpAgent = httpAgent;
        this.fetch = overriddenFetch ?? fetch2;
      }
      authHeaders(opts) {
        return {};
      }
      /**
       * Override this to add your own default headers, for example:
       *
       *  {
       *    ...super.defaultHeaders(),
       *    Authorization: 'Bearer 123',
       *  }
       */
      defaultHeaders(opts) {
        return {
          Accept: "application/json",
          ...["head", "get"].includes(opts.method) ? {} : { "Content-Type": "application/json" },
          "User-Agent": this.getUserAgent(),
          "api-version": this.getAPIVerson(),
          ...getPlatformHeaders(),
          ...this.authHeaders(opts)
        };
      }
      /**
       * Override this to add your own headers validation:
       */
      validateHeaders(headers, customHeaders, usingCustomFetch) {
      }
      defaultIdempotencyKey() {
        return `stainless-node-retry-${uuid4()}`;
      }
      get(path84, opts) {
        return this.methodRequest("get", path84, opts);
      }
      post(path84, opts) {
        return this.methodRequest("post", path84, opts);
      }
      patch(path84, opts) {
        return this.methodRequest("patch", path84, opts);
      }
      put(path84, opts) {
        return this.methodRequest("put", path84, opts);
      }
      delete(path84, opts) {
        return this.methodRequest("delete", path84, opts);
      }
      methodRequest(method, path84, opts) {
        return this.request(Promise.resolve(opts).then(async (opts2) => {
          const body = opts2 && isBlobLike(opts2?.body) ? new DataView(await opts2.body.arrayBuffer()) : opts2?.body instanceof DataView ? opts2.body : opts2?.body instanceof ArrayBuffer ? new DataView(opts2.body) : opts2 && ArrayBuffer.isView(opts2?.body) ? new DataView(opts2.body.buffer) : opts2?.body;
          return { method, path: path84, ...opts2, body };
        }));
      }
      getAPIList(path84, Page2, opts) {
        return this.requestAPIList(Page2, { method: "get", path: path84, ...opts });
      }
      calculateContentLength(body) {
        if (typeof body === "string") {
          if (typeof Buffer !== "undefined") {
            return Buffer.byteLength(body, "utf8").toString();
          }
          if (typeof TextEncoder !== "undefined") {
            const encoder = new TextEncoder();
            const encoded = encoder.encode(body);
            return encoded.length.toString();
          }
        } else if (ArrayBuffer.isView(body)) {
          return body.byteLength.toString();
        }
        return null;
      }
      async buildRequest(inputOptions, { retryCount = 0 } = {}) {
        const options = { ...inputOptions };
        const { method, path: path84, query, defaultBaseURL, headers = {} } = options;
        const body = ArrayBuffer.isView(options.body) || options.__binaryRequest && typeof options.body === "string" ? options.body : isMultipartBody(options.body) ? options.body.body : options.body ? JSON.stringify(options.body, null, 2) : null;
        const contentLength = this.calculateContentLength(body);
        const url4 = this.buildURL(path84, query, defaultBaseURL);
        if ("timeout" in options)
          validatePositiveInteger("timeout", options.timeout);
        options.timeout = options.timeout ?? this.timeout;
        const httpAgent = options.httpAgent ?? this.httpAgent ?? getDefaultAgent(url4);
        const minAgentTimeout = options.timeout + 1e3;
        if (typeof httpAgent?.options?.timeout === "number" && minAgentTimeout > (httpAgent.options.timeout ?? 0)) {
          httpAgent.options.timeout = minAgentTimeout;
        }
        if (this.idempotencyHeader && method !== "get") {
          if (!inputOptions.idempotencyKey)
            inputOptions.idempotencyKey = this.defaultIdempotencyKey();
          headers[this.idempotencyHeader] = inputOptions.idempotencyKey;
        }
        const reqHeaders = this.buildHeaders({ options, headers, contentLength, retryCount });
        const req = {
          method,
          ...body && { body },
          headers: reqHeaders,
          ...httpAgent && { agent: httpAgent },
          // @ts-ignore node-fetch uses a custom AbortSignal type that is
          // not compatible with standard web types
          signal: options.signal ?? null
        };
        return { req, url: url4, timeout: options.timeout };
      }
      buildHeaders({ options, headers, contentLength, retryCount }) {
        const reqHeaders = {};
        if (contentLength) {
          reqHeaders["content-length"] = contentLength;
        }
        const defaultHeaders = this.defaultHeaders(options);
        applyHeadersMut(reqHeaders, defaultHeaders);
        applyHeadersMut(reqHeaders, headers);
        if (isMultipartBody(options.body) && kind !== "node") {
          delete reqHeaders["content-type"];
        }
        if (getHeader(defaultHeaders, "x-stainless-retry-count") === void 0 && getHeader(headers, "x-stainless-retry-count") === void 0) {
          reqHeaders["x-stainless-retry-count"] = String(retryCount);
        }
        if (getHeader(defaultHeaders, "x-stainless-timeout") === void 0 && getHeader(headers, "x-stainless-timeout") === void 0 && options.timeout) {
          reqHeaders["x-stainless-timeout"] = String(options.timeout);
        }
        this.validateHeaders(reqHeaders, headers, this.fetch !== fetch2);
        return reqHeaders;
      }
      /**
       * Used as a callback for mutating the given `FinalRequestOptions` object.
       */
      async prepareOptions(options) {
      }
      /**
       * Used as a callback for mutating the given `RequestInit` object.
       *
       * This is useful for cases where you want to add certain headers based off of
       * the request properties, e.g. `method` or `url`.
       */
      async prepareRequest(request4, { url: url4, options }) {
      }
      parseHeaders(headers) {
        return !headers ? {} : Symbol.iterator in headers ? Object.fromEntries(Array.from(headers).map((header) => [...header])) : { ...headers };
      }
      makeStatusError(status2, error2, message, headers) {
        return APIError2.generate(status2, error2, message, headers);
      }
      request(options, remainingRetries = null) {
        return new APIPromise(this.makeRequest(options, remainingRetries));
      }
      async makeRequest(optionsInput, retriesRemaining) {
        const options = await optionsInput;
        const maxRetries = options.maxRetries ?? this.maxRetries;
        if (retriesRemaining == null) {
          retriesRemaining = maxRetries;
        }
        await this.prepareOptions(options);
        const { req, url: url4, timeout: timeout2 } = await this.buildRequest(options, {
          retryCount: maxRetries - retriesRemaining
        });
        await this.prepareRequest(req, { url: url4, options });
        debug("request", url4, options, req.headers);
        if (options.signal?.aborted) {
          throw new APIUserAbortError();
        }
        const controller = new AbortController();
        const response = await this.fetchWithTimeout(url4, req, timeout2, controller).catch(castToError);
        if (response instanceof Error) {
          if (options.signal?.aborted) {
            throw new APIUserAbortError();
          }
          if (retriesRemaining) {
            return this.retryRequest(options, retriesRemaining);
          }
          if (response.name === "AbortError") {
            throw new APIConnectionTimeoutError();
          }
          throw new APIConnectionError({ cause: response });
        }
        const responseHeaders = createResponseHeaders(response.headers);
        if (!response.ok) {
          if (retriesRemaining && this.shouldRetry(response)) {
            const retryMessage2 = `retrying, ${retriesRemaining} attempts remaining`;
            debug(`response (error; ${retryMessage2})`, response.status, url4, responseHeaders);
            return this.retryRequest(options, retriesRemaining, responseHeaders);
          }
          const errText = await response.text().catch((e10) => castToError(e10).message);
          const errJSON = safeJSON(errText);
          const errMessage = errJSON ? void 0 : errText;
          const retryMessage = retriesRemaining ? `(error; no more retries left)` : `(error; not retryable)`;
          debug(`response (error; ${retryMessage})`, response.status, url4, responseHeaders, errMessage);
          const err = this.makeStatusError(response.status, errJSON, errMessage, responseHeaders);
          throw err;
        }
        return { response, options, controller };
      }
      requestAPIList(Page2, options) {
        const request4 = this.makeRequest(options, null);
        return new PagePromise(this, request4, Page2);
      }
      buildURL(path84, query, defaultBaseURL) {
        const baseURL = !__classPrivateFieldGet7(this, _APIClient_baseURLOverridden, "f") && defaultBaseURL || this.baseURL;
        const url4 = isAbsoluteURL(path84) ? new URL(path84) : new URL(baseURL + (baseURL.endsWith("/") && path84.startsWith("/") ? path84.slice(1) : path84));
        const defaultQuery = this.defaultQuery();
        if (!isEmptyObj(defaultQuery)) {
          query = { ...defaultQuery, ...query };
        }
        if (typeof query === "object" && query && !Array.isArray(query)) {
          url4.search = this.stringifyQuery(query);
        }
        return url4.toString();
      }
      stringifyQuery(query) {
        return Object.entries(query).filter(([_5, value]) => typeof value !== "undefined").map(([key, value]) => {
          if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
            return `${encodeURIComponent(key)}=${encodeURIComponent(value)}`;
          }
          if (value === null) {
            return `${encodeURIComponent(key)}=`;
          }
          throw new CloudflareError(`Cannot stringify type ${typeof value}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`);
        }).join("&");
      }
      async fetchWithTimeout(url4, init4, ms, controller) {
        const { signal, ...options } = init4 || {};
        if (signal)
          signal.addEventListener("abort", () => controller.abort());
        const timeout2 = setTimeout(() => controller.abort(), ms);
        const fetchOptions = {
          signal: controller.signal,
          ...options
        };
        if (fetchOptions.method) {
          fetchOptions.method = fetchOptions.method.toUpperCase();
        }
        return (
          // use undefined this binding; fetch errors if bound to something else in browser/cloudflare
          this.fetch.call(void 0, url4, fetchOptions).finally(() => {
            clearTimeout(timeout2);
          })
        );
      }
      shouldRetry(response) {
        const shouldRetryHeader = response.headers.get("x-should-retry");
        if (shouldRetryHeader === "true")
          return true;
        if (shouldRetryHeader === "false")
          return false;
        if (response.status === 408)
          return true;
        if (response.status === 409)
          return true;
        if (response.status === 429)
          return true;
        if (response.status >= 500)
          return true;
        return false;
      }
      async retryRequest(options, retriesRemaining, responseHeaders) {
        let timeoutMillis;
        const retryAfterMillisHeader = responseHeaders?.["retry-after-ms"];
        if (retryAfterMillisHeader) {
          const timeoutMs = parseFloat(retryAfterMillisHeader);
          if (!Number.isNaN(timeoutMs)) {
            timeoutMillis = timeoutMs;
          }
        }
        const retryAfterHeader = responseHeaders?.["retry-after"];
        if (retryAfterHeader && !timeoutMillis) {
          const timeoutSeconds = parseFloat(retryAfterHeader);
          if (!Number.isNaN(timeoutSeconds)) {
            timeoutMillis = timeoutSeconds * 1e3;
          } else {
            timeoutMillis = Date.parse(retryAfterHeader) - Date.now();
          }
        }
        if (!(timeoutMillis && 0 <= timeoutMillis && timeoutMillis < 60 * 1e3)) {
          const maxRetries = options.maxRetries ?? this.maxRetries;
          timeoutMillis = this.calculateDefaultRetryTimeoutMillis(retriesRemaining, maxRetries);
        }
        await sleep(timeoutMillis);
        return this.makeRequest(options, retriesRemaining - 1);
      }
      calculateDefaultRetryTimeoutMillis(retriesRemaining, maxRetries) {
        const initialRetryDelay = 0.5;
        const maxRetryDelay = 8;
        const numRetries = maxRetries - retriesRemaining;
        const sleepSeconds = Math.min(initialRetryDelay * Math.pow(2, numRetries), maxRetryDelay);
        const jitter = 1 - Math.random() * 0.25;
        return sleepSeconds * jitter * 1e3;
      }
      getUserAgent() {
        return `${this.constructor.name}/JS ${VERSION}`;
      }
      getAPIVerson() {
        return this.apiVersion;
      }
    };
    _APIClient_baseURLOverridden = /* @__PURE__ */ new WeakMap();
    AbstractPage = class {
      static {
        __name(this, "AbstractPage");
      }
      constructor(client, response, body, options) {
        _AbstractPage_client.set(this, void 0);
        __classPrivateFieldSet5(this, _AbstractPage_client, client, "f");
        this.options = options;
        this.response = response;
        this.body = body;
      }
      hasNextPage() {
        const items = this.getPaginatedItems();
        if (!items.length)
          return false;
        return this.nextPageInfo() != null;
      }
      async getNextPage() {
        const nextInfo = this.nextPageInfo();
        if (!nextInfo) {
          throw new CloudflareError("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");
        }
        const nextOptions = { ...this.options };
        if ("params" in nextInfo && typeof nextOptions.query === "object") {
          nextOptions.query = { ...nextOptions.query, ...nextInfo.params };
        } else if ("url" in nextInfo) {
          const params = [...Object.entries(nextOptions.query || {}), ...nextInfo.url.searchParams.entries()];
          for (const [key, value] of params) {
            nextInfo.url.searchParams.set(key, value);
          }
          nextOptions.query = void 0;
          nextOptions.path = nextInfo.url.toString();
        }
        return await __classPrivateFieldGet7(this, _AbstractPage_client, "f").requestAPIList(this.constructor, nextOptions);
      }
      async *iterPages() {
        let page = this;
        yield page;
        while (page.hasNextPage()) {
          page = await page.getNextPage();
          yield page;
        }
      }
      async *[(_AbstractPage_client = /* @__PURE__ */ new WeakMap(), Symbol.asyncIterator)]() {
        for await (const page of this.iterPages()) {
          for (const item of page.getPaginatedItems()) {
            yield item;
          }
        }
      }
    };
    PagePromise = class extends APIPromise {
      static {
        __name(this, "PagePromise");
      }
      constructor(client, request4, Page2) {
        super(request4, async (props) => new Page2(client, props.response, await defaultParseResponse(props), props.options));
      }
      /**
       * Allow auto-paginating iteration on an unawaited list call, eg:
       *
       *    for await (const item of client.items.list()) {
       *      console.log(item)
       *    }
       */
      async *[Symbol.asyncIterator]() {
        const page = await this;
        for await (const item of page) {
          yield item;
        }
      }
    };
    createResponseHeaders = /* @__PURE__ */ __name((headers) => {
      return new Proxy(Object.fromEntries(
        // @ts-ignore
        headers.entries()
      ), {
        get(target, name2) {
          const key = name2.toString();
          return target[key.toLowerCase()] || target[key];
        }
      });
    }, "createResponseHeaders");
    requestOptionsKeys = {
      method: true,
      path: true,
      query: true,
      body: true,
      headers: true,
      defaultBaseURL: true,
      maxRetries: true,
      stream: true,
      timeout: true,
      httpAgent: true,
      signal: true,
      idempotencyKey: true,
      __multipartSyntax: true,
      __binaryRequest: true,
      __binaryResponse: true
    };
    isRequestOptions = /* @__PURE__ */ __name((obj) => {
      return typeof obj === "object" && obj !== null && !isEmptyObj(obj) && Object.keys(obj).every((k7) => hasOwn(requestOptionsKeys, k7));
    }, "isRequestOptions");
    getPlatformProperties = /* @__PURE__ */ __name(() => {
      if (typeof Deno !== "undefined" && Deno.build != null) {
        return {
          "X-Stainless-Lang": "js",
          "X-Stainless-Package-Version": VERSION,
          "X-Stainless-OS": normalizePlatform(Deno.build.os),
          "X-Stainless-Arch": normalizeArch(Deno.build.arch),
          "X-Stainless-Runtime": "deno",
          "X-Stainless-Runtime-Version": typeof Deno.version === "string" ? Deno.version : Deno.version?.deno ?? "unknown"
        };
      }
      if (typeof EdgeRuntime !== "undefined") {
        return {
          "X-Stainless-Lang": "js",
          "X-Stainless-Package-Version": VERSION,
          "X-Stainless-OS": "Unknown",
          "X-Stainless-Arch": `other:${EdgeRuntime}`,
          "X-Stainless-Runtime": "edge",
          "X-Stainless-Runtime-Version": process.version
        };
      }
      if (Object.prototype.toString.call(typeof process !== "undefined" ? process : 0) === "[object process]") {
        return {
          "X-Stainless-Lang": "js",
          "X-Stainless-Package-Version": VERSION,
          "X-Stainless-OS": normalizePlatform(process.platform),
          "X-Stainless-Arch": normalizeArch(process.arch),
          "X-Stainless-Runtime": "node",
          "X-Stainless-Runtime-Version": process.version
        };
      }
      const browserInfo = getBrowserInfo();
      if (browserInfo) {
        return {
          "X-Stainless-Lang": "js",
          "X-Stainless-Package-Version": VERSION,
          "X-Stainless-OS": "Unknown",
          "X-Stainless-Arch": "unknown",
          "X-Stainless-Runtime": `browser:${browserInfo.browser}`,
          "X-Stainless-Runtime-Version": browserInfo.version
        };
      }
      return {
        "X-Stainless-Lang": "js",
        "X-Stainless-Package-Version": VERSION,
        "X-Stainless-OS": "Unknown",
        "X-Stainless-Arch": "unknown",
        "X-Stainless-Runtime": "unknown",
        "X-Stainless-Runtime-Version": "unknown"
      };
    }, "getPlatformProperties");
    __name(getBrowserInfo, "getBrowserInfo");
    normalizeArch = /* @__PURE__ */ __name((arch4) => {
      if (arch4 === "x32")
        return "x32";
      if (arch4 === "x86_64" || arch4 === "x64")
        return "x64";
      if (arch4 === "arm")
        return "arm";
      if (arch4 === "aarch64" || arch4 === "arm64")
        return "arm64";
      if (arch4)
        return `other:${arch4}`;
      return "unknown";
    }, "normalizeArch");
    normalizePlatform = /* @__PURE__ */ __name((platform4) => {
      platform4 = platform4.toLowerCase();
      if (platform4.includes("ios"))
        return "iOS";
      if (platform4 === "android")
        return "Android";
      if (platform4 === "darwin")
        return "MacOS";
      if (platform4 === "win32")
        return "Windows";
      if (platform4 === "freebsd")
        return "FreeBSD";
      if (platform4 === "openbsd")
        return "OpenBSD";
      if (platform4 === "linux")
        return "Linux";
      if (platform4)
        return `Other:${platform4}`;
      return "Unknown";
    }, "normalizePlatform");
    getPlatformHeaders = /* @__PURE__ */ __name(() => {
      return _platformHeaders ?? (_platformHeaders = getPlatformProperties());
    }, "getPlatformHeaders");
    safeJSON = /* @__PURE__ */ __name((text) => {
      try {
        return JSON.parse(text);
      } catch (err) {
        return void 0;
      }
    }, "safeJSON");
    startsWithSchemeRegexp = /^[a-z][a-z0-9+.-]*:/i;
    isAbsoluteURL = /* @__PURE__ */ __name((url4) => {
      return startsWithSchemeRegexp.test(url4);
    }, "isAbsoluteURL");
    sleep = /* @__PURE__ */ __name((ms) => new Promise((resolve32) => setTimeout(resolve32, ms)), "sleep");
    validatePositiveInteger = /* @__PURE__ */ __name((name2, n9) => {
      if (typeof n9 !== "number" || !Number.isInteger(n9)) {
        throw new CloudflareError(`${name2} must be an integer`);
      }
      if (n9 < 0) {
        throw new CloudflareError(`${name2} must be a positive integer`);
      }
      return n9;
    }, "validatePositiveInteger");
    castToError = /* @__PURE__ */ __name((err) => {
      if (err instanceof Error)
        return err;
      if (typeof err === "object" && err !== null) {
        try {
          return new Error(JSON.stringify(err));
        } catch {
        }
      }
      return new Error(err);
    }, "castToError");
    readEnv = /* @__PURE__ */ __name((env6) => {
      if (typeof process !== "undefined") {
        return process.env?.[env6]?.trim() ?? void 0;
      }
      if (typeof Deno !== "undefined") {
        return Deno.env?.get?.(env6)?.trim();
      }
      return void 0;
    }, "readEnv");
    __name(isEmptyObj, "isEmptyObj");
    __name(hasOwn, "hasOwn");
    __name(applyHeadersMut, "applyHeadersMut");
    __name(debug, "debug");
    uuid4 = /* @__PURE__ */ __name(() => {
      return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c8) => {
        const r10 = Math.random() * 16 | 0;
        const v8 = c8 === "x" ? r10 : r10 & 3 | 8;
        return v8.toString(16);
      });
    }, "uuid4");
    isHeadersProtocol = /* @__PURE__ */ __name((headers) => {
      return typeof headers?.get === "function";
    }, "isHeadersProtocol");
    getHeader = /* @__PURE__ */ __name((headers, header) => {
      const lowerCasedHeader = header.toLowerCase();
      if (isHeadersProtocol(headers)) {
        const intercapsHeader = header[0]?.toUpperCase() + header.substring(1).replace(/([^\w])(\w)/g, (_m3, g1, g22) => g1 + g22.toUpperCase());
        for (const key of [header, lowerCasedHeader, header.toUpperCase(), intercapsHeader]) {
          const value = headers.get(key);
          if (value) {
            return value;
          }
        }
      }
      for (const [key, value] of Object.entries(headers)) {
        if (key.toLowerCase() === lowerCasedHeader) {
          if (Array.isArray(value)) {
            if (value.length <= 1)
              return value[0];
            console.warn(`Received ${value.length} entries for the ${header} header, using the first entry.`);
            return value[0];
          }
          return value;
        }
      }
      return void 0;
    }, "getHeader");
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/pagination.mjs
var V4PagePagination, V4PagePaginationArray, CursorPagination, CursorPaginationAfter, SinglePage;
var init_pagination = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/pagination.mjs"() {
    init_import_meta_url();
    init_core2();
    V4PagePagination = class extends AbstractPage {
      static {
        __name(this, "V4PagePagination");
      }
      constructor(client, response, body, options) {
        super(client, response, body, options);
        this.result = body.result || {};
        this.result_info = body.result_info || {};
      }
      getPaginatedItems() {
        return this.result?.items ?? [];
      }
      // @deprecated Please use `nextPageInfo()` instead
      nextPageParams() {
        const info = this.nextPageInfo();
        if (!info)
          return null;
        if ("params" in info)
          return info.params;
        const params = Object.fromEntries(info.url.searchParams);
        if (!Object.keys(params).length)
          return null;
        return params;
      }
      nextPageInfo() {
        const query = this.options.query;
        const currentPage = query?.page ?? 1;
        return { params: { page: currentPage + 1 } };
      }
    };
    V4PagePaginationArray = class extends AbstractPage {
      static {
        __name(this, "V4PagePaginationArray");
      }
      constructor(client, response, body, options) {
        super(client, response, body, options);
        this.result = body.result || [];
        this.result_info = body.result_info || {};
      }
      getPaginatedItems() {
        return this.result ?? [];
      }
      // @deprecated Please use `nextPageInfo()` instead
      nextPageParams() {
        const info = this.nextPageInfo();
        if (!info)
          return null;
        if ("params" in info)
          return info.params;
        const params = Object.fromEntries(info.url.searchParams);
        if (!Object.keys(params).length)
          return null;
        return params;
      }
      nextPageInfo() {
        const query = this.options.query;
        const currentPage = query?.page ?? 1;
        return { params: { page: currentPage + 1 } };
      }
    };
    CursorPagination = class extends AbstractPage {
      static {
        __name(this, "CursorPagination");
      }
      constructor(client, response, body, options) {
        super(client, response, body, options);
        this.result = body.result || [];
        this.result_info = body.result_info || {};
      }
      getPaginatedItems() {
        return this.result ?? [];
      }
      // @deprecated Please use `nextPageInfo()` instead
      nextPageParams() {
        const info = this.nextPageInfo();
        if (!info)
          return null;
        if ("params" in info)
          return info.params;
        const params = Object.fromEntries(info.url.searchParams);
        if (!Object.keys(params).length)
          return null;
        return params;
      }
      nextPageInfo() {
        const cursor = this.result_info?.cursor;
        if (!cursor) {
          return null;
        }
        return {
          params: {
            cursor
          }
        };
      }
    };
    CursorPaginationAfter = class extends AbstractPage {
      static {
        __name(this, "CursorPaginationAfter");
      }
      constructor(client, response, body, options) {
        super(client, response, body, options);
        this.result = body.result || [];
        this.result_info = body.result_info || {};
      }
      getPaginatedItems() {
        return this.result ?? [];
      }
      // @deprecated Please use `nextPageInfo()` instead
      nextPageParams() {
        const info = this.nextPageInfo();
        if (!info)
          return null;
        if ("params" in info)
          return info.params;
        const params = Object.fromEntries(info.url.searchParams);
        if (!Object.keys(params).length)
          return null;
        return params;
      }
      nextPageInfo() {
        const cursor = this.result_info?.cursors?.after;
        if (!cursor) {
          return null;
        }
        return {
          params: {
            cursor
          }
        };
      }
    };
    SinglePage = class extends AbstractPage {
      static {
        __name(this, "SinglePage");
      }
      constructor(client, response, body, options) {
        super(client, response, body, options);
        this.result = body.result || [];
      }
      getPaginatedItems() {
        return this.result ?? [];
      }
      // @deprecated Please use `nextPageInfo()` instead
      /**
       * This page represents a response that isn't actually paginated at the API level
       * so there will never be any next page params.
       */
      nextPageParams() {
        return null;
      }
      nextPageInfo() {
        return null;
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/shared.mjs
var MembersV4PagePaginationArray, RolesV4PagePaginationArray, SubscriptionsSinglePage, TokensV4PagePaginationArray, AuditLogsV4PagePaginationArray;
var init_shared = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/shared.mjs"() {
    init_import_meta_url();
    init_pagination();
    MembersV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "MembersV4PagePaginationArray");
      }
    };
    RolesV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "RolesV4PagePaginationArray");
      }
    };
    SubscriptionsSinglePage = class extends SinglePage {
      static {
        __name(this, "SubscriptionsSinglePage");
      }
    };
    TokensV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "TokensV4PagePaginationArray");
      }
    };
    AuditLogsV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "AuditLogsV4PagePaginationArray");
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resource.mjs
var APIResource;
var init_resource = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resource.mjs"() {
    init_import_meta_url();
    APIResource = class {
      static {
        __name(this, "APIResource");
      }
      constructor(client) {
        this._client = client;
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/acm/total-tls.mjs
var TotalTLS;
var init_total_tls = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/acm/total-tls.mjs"() {
    init_import_meta_url();
    init_resource();
    TotalTLS = class extends APIResource {
      static {
        __name(this, "TotalTLS");
      }
      /**
       * Set Total TLS Settings or disable the feature for a Zone.
       *
       * @example
       * ```ts
       * const totalTLS = await client.acm.totalTLS.create({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   enabled: true,
       * });
       * ```
       */
      create(params, options) {
        const { zone_id, ...body } = params;
        return this._client.post(`/zones/${zone_id}/acm/total_tls`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get Total TLS Settings for a Zone.
       *
       * @example
       * ```ts
       * const totalTLS = await client.acm.totalTLS.get({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      get(params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/acm/total_tls`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/acm/acm.mjs
var ACM;
var init_acm = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/acm/acm.mjs"() {
    init_import_meta_url();
    init_resource();
    init_total_tls();
    init_total_tls();
    ACM = class extends APIResource {
      static {
        __name(this, "ACM");
      }
      constructor() {
        super(...arguments);
        this.totalTLS = new TotalTLS(this._client);
      }
    };
    ACM.TotalTLS = TotalTLS;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/ai/authors.mjs
var Authors, AuthorListResponsesSinglePage;
var init_authors = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/ai/authors.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Authors = class extends APIResource {
      static {
        __name(this, "Authors");
      }
      /**
       * Author Search
       */
      list(params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/ai/authors/search`, AuthorListResponsesSinglePage, options);
      }
    };
    AuthorListResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "AuthorListResponsesSinglePage");
      }
    };
    Authors.AuthorListResponsesSinglePage = AuthorListResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/ai/tasks.mjs
var Tasks, TaskListResponsesSinglePage;
var init_tasks = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/ai/tasks.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Tasks = class extends APIResource {
      static {
        __name(this, "Tasks");
      }
      /**
       * Task Search
       */
      list(params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/ai/tasks/search`, TaskListResponsesSinglePage, options);
      }
    };
    TaskListResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "TaskListResponsesSinglePage");
      }
    };
    Tasks.TaskListResponsesSinglePage = TaskListResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/ai/to-markdown.mjs
var ToMarkdown, ToMarkdownTransformResponsesSinglePage;
var init_to_markdown = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/ai/to-markdown.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    ToMarkdown = class extends APIResource {
      static {
        __name(this, "ToMarkdown");
      }
      /**
       * Convert Files into Markdown
       */
      transform(file3, params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/ai/tomarkdown`, ToMarkdownTransformResponsesSinglePage, {
          body: file3,
          method: "post",
          ...options,
          headers: { "Content-Type": "application/octet-stream", ...options?.headers },
          __binaryRequest: true
        });
      }
    };
    ToMarkdownTransformResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "ToMarkdownTransformResponsesSinglePage");
      }
    };
    ToMarkdown.ToMarkdownTransformResponsesSinglePage = ToMarkdownTransformResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/ai/finetunes/assets.mjs
var Assets;
var init_assets = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/ai/finetunes/assets.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    Assets = class extends APIResource {
      static {
        __name(this, "Assets");
      }
      /**
       * Upload a Finetune Asset
       */
      create(finetuneId, params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/ai/finetunes/${finetuneId}/finetune-assets`, multipartFormRequestOptions({ body, ...options }));
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/ai/finetunes/public.mjs
var Public, PublicListResponsesSinglePage;
var init_public = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/ai/finetunes/public.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Public = class extends APIResource {
      static {
        __name(this, "Public");
      }
      /**
       * List Public Finetunes
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/ai/finetunes/public`, PublicListResponsesSinglePage, { query, ...options });
      }
    };
    PublicListResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "PublicListResponsesSinglePage");
      }
    };
    Public.PublicListResponsesSinglePage = PublicListResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/ai/finetunes/finetunes.mjs
var Finetunes;
var init_finetunes = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/ai/finetunes/finetunes.mjs"() {
    init_import_meta_url();
    init_resource();
    init_assets();
    init_assets();
    init_public();
    init_public();
    Finetunes = class extends APIResource {
      static {
        __name(this, "Finetunes");
      }
      constructor() {
        super(...arguments);
        this.assets = new Assets(this._client);
        this.public = new Public(this._client);
      }
      /**
       * Create a new Finetune
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/ai/finetunes`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List Finetunes
       */
      list(params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/ai/finetunes`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    Finetunes.Assets = Assets;
    Finetunes.Public = Public;
    Finetunes.PublicListResponsesSinglePage = PublicListResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/ai/models/schema.mjs
var Schema;
var init_schema = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/ai/models/schema.mjs"() {
    init_import_meta_url();
    init_resource();
    Schema = class extends APIResource {
      static {
        __name(this, "Schema");
      }
      /**
       * Get Model Schema
       */
      get(params, options) {
        const { account_id, ...query } = params;
        return this._client.get(`/accounts/${account_id}/ai/models/schema`, { query, ...options })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/ai/models/models.mjs
var Models, ModelListResponsesV4PagePaginationArray;
var init_models = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/ai/models/models.mjs"() {
    init_import_meta_url();
    init_resource();
    init_schema();
    init_schema();
    init_pagination();
    Models = class extends APIResource {
      static {
        __name(this, "Models");
      }
      constructor() {
        super(...arguments);
        this.schema = new Schema(this._client);
      }
      /**
       * Model Search
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/ai/models/search`, ModelListResponsesV4PagePaginationArray, { query, ...options });
      }
    };
    ModelListResponsesV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "ModelListResponsesV4PagePaginationArray");
      }
    };
    Models.ModelListResponsesV4PagePaginationArray = ModelListResponsesV4PagePaginationArray;
    Models.Schema = Schema;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/ai/ai.mjs
var AI;
var init_ai = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/ai/ai.mjs"() {
    init_import_meta_url();
    init_resource();
    init_authors();
    init_authors();
    init_tasks();
    init_tasks();
    init_to_markdown();
    init_to_markdown();
    init_finetunes();
    init_finetunes();
    init_models();
    init_models();
    AI = class extends APIResource {
      static {
        __name(this, "AI");
      }
      constructor() {
        super(...arguments);
        this.finetunes = new Finetunes(this._client);
        this.authors = new Authors(this._client);
        this.tasks = new Tasks(this._client);
        this.models = new Models(this._client);
        this.toMarkdown = new ToMarkdown(this._client);
      }
      /**
       * This endpoint provides users with the capability to run specific AI models
       * on-demand.
       *
       * By submitting the required input data, users can receive real-time predictions
       * or results generated by the chosen AI model. The endpoint supports various AI
       * model types, ensuring flexibility and adaptability for diverse use cases.
       *
       * Model specific inputs available in
       * [Cloudflare Docs](https://developers.cloudflare.com/workers-ai/models/).
       */
      run(modelName, params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/ai/run/${modelName}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
    AI.Finetunes = Finetunes;
    AI.Authors = Authors;
    AI.AuthorListResponsesSinglePage = AuthorListResponsesSinglePage;
    AI.Tasks = Tasks;
    AI.TaskListResponsesSinglePage = TaskListResponsesSinglePage;
    AI.Models = Models;
    AI.ModelListResponsesV4PagePaginationArray = ModelListResponsesV4PagePaginationArray;
    AI.ToMarkdown = ToMarkdown;
    AI.ToMarkdownTransformResponsesSinglePage = ToMarkdownTransformResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/ai-gateway/datasets.mjs
var Datasets, DatasetListResponsesV4PagePaginationArray;
var init_datasets = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/ai-gateway/datasets.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Datasets = class extends APIResource {
      static {
        __name(this, "Datasets");
      }
      /**
       * Create a new Dataset
       *
       * @example
       * ```ts
       * const dataset = await client.aiGateway.datasets.create(
       *   'my-gateway',
       *   {
       *     account_id: '3ebbcb006d4d46d7bb6a8c7f14676cb0',
       *     enable: true,
       *     filters: [
       *       {
       *         key: 'created_at',
       *         operator: 'eq',
       *         value: ['string'],
       *       },
       *     ],
       *     name: 'name',
       *   },
       * );
       * ```
       */
      create(gatewayId, params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/ai-gateway/gateways/${gatewayId}/datasets`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Update a Dataset
       *
       * @example
       * ```ts
       * const dataset = await client.aiGateway.datasets.update(
       *   'my-gateway',
       *   'id',
       *   {
       *     account_id: '3ebbcb006d4d46d7bb6a8c7f14676cb0',
       *     enable: true,
       *     filters: [
       *       {
       *         key: 'created_at',
       *         operator: 'eq',
       *         value: ['string'],
       *       },
       *     ],
       *     name: 'name',
       *   },
       * );
       * ```
       */
      update(gatewayId, id, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/ai-gateway/gateways/${gatewayId}/datasets/${id}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List Datasets
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const datasetListResponse of client.aiGateway.datasets.list(
       *   'my-gateway',
       *   { account_id: '3ebbcb006d4d46d7bb6a8c7f14676cb0' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(gatewayId, params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/ai-gateway/gateways/${gatewayId}/datasets`, DatasetListResponsesV4PagePaginationArray, { query, ...options });
      }
      /**
       * Delete a Dataset
       *
       * @example
       * ```ts
       * const dataset = await client.aiGateway.datasets.delete(
       *   'my-gateway',
       *   'id',
       *   { account_id: '3ebbcb006d4d46d7bb6a8c7f14676cb0' },
       * );
       * ```
       */
      delete(gatewayId, id, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/ai-gateway/gateways/${gatewayId}/datasets/${id}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetch a Dataset
       *
       * @example
       * ```ts
       * const dataset = await client.aiGateway.datasets.get(
       *   'my-gateway',
       *   'id',
       *   { account_id: '3ebbcb006d4d46d7bb6a8c7f14676cb0' },
       * );
       * ```
       */
      get(gatewayId, id, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/ai-gateway/gateways/${gatewayId}/datasets/${id}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    DatasetListResponsesV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "DatasetListResponsesV4PagePaginationArray");
      }
    };
    Datasets.DatasetListResponsesV4PagePaginationArray = DatasetListResponsesV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/ai-gateway/evaluation-types.mjs
var EvaluationTypes, EvaluationTypeListResponsesV4PagePaginationArray;
var init_evaluation_types = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/ai-gateway/evaluation-types.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    EvaluationTypes = class extends APIResource {
      static {
        __name(this, "EvaluationTypes");
      }
      /**
       * List Evaluators
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const evaluationTypeListResponse of client.aiGateway.evaluationTypes.list(
       *   { account_id: '0d37909e38d3e99c29fa2cd343ac421a' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/ai-gateway/evaluation-types`, EvaluationTypeListResponsesV4PagePaginationArray, { query, ...options });
      }
    };
    EvaluationTypeListResponsesV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "EvaluationTypeListResponsesV4PagePaginationArray");
      }
    };
    EvaluationTypes.EvaluationTypeListResponsesV4PagePaginationArray = EvaluationTypeListResponsesV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/ai-gateway/evaluations.mjs
var Evaluations, EvaluationListResponsesV4PagePaginationArray;
var init_evaluations = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/ai-gateway/evaluations.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Evaluations = class extends APIResource {
      static {
        __name(this, "Evaluations");
      }
      /**
       * Create a new Evaluation
       *
       * @example
       * ```ts
       * const evaluation =
       *   await client.aiGateway.evaluations.create('my-gateway', {
       *     account_id: '3ebbcb006d4d46d7bb6a8c7f14676cb0',
       *     dataset_ids: ['string'],
       *     evaluation_type_ids: ['string'],
       *     name: 'name',
       *   });
       * ```
       */
      create(gatewayId, params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/ai-gateway/gateways/${gatewayId}/evaluations`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List Evaluations
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const evaluationListResponse of client.aiGateway.evaluations.list(
       *   'my-gateway',
       *   { account_id: '3ebbcb006d4d46d7bb6a8c7f14676cb0' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(gatewayId, params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/ai-gateway/gateways/${gatewayId}/evaluations`, EvaluationListResponsesV4PagePaginationArray, { query, ...options });
      }
      /**
       * Delete a Evaluation
       *
       * @example
       * ```ts
       * const evaluation =
       *   await client.aiGateway.evaluations.delete(
       *     'my-gateway',
       *     'id',
       *     { account_id: '3ebbcb006d4d46d7bb6a8c7f14676cb0' },
       *   );
       * ```
       */
      delete(gatewayId, id, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/ai-gateway/gateways/${gatewayId}/evaluations/${id}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetch a Evaluation
       *
       * @example
       * ```ts
       * const evaluation = await client.aiGateway.evaluations.get(
       *   'my-gateway',
       *   'id',
       *   { account_id: '3ebbcb006d4d46d7bb6a8c7f14676cb0' },
       * );
       * ```
       */
      get(gatewayId, id, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/ai-gateway/gateways/${gatewayId}/evaluations/${id}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    EvaluationListResponsesV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "EvaluationListResponsesV4PagePaginationArray");
      }
    };
    Evaluations.EvaluationListResponsesV4PagePaginationArray = EvaluationListResponsesV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/ai-gateway/logs.mjs
var Logs, LogListResponsesV4PagePaginationArray;
var init_logs = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/ai-gateway/logs.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Logs = class extends APIResource {
      static {
        __name(this, "Logs");
      }
      /**
       * List Gateway Logs
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const logListResponse of client.aiGateway.logs.list(
       *   'my-gateway',
       *   { account_id: '0d37909e38d3e99c29fa2cd343ac421a' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(gatewayId, params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/ai-gateway/gateways/${gatewayId}/logs`, LogListResponsesV4PagePaginationArray, { query, ...options });
      }
      /**
       * Delete Gateway Logs
       *
       * @example
       * ```ts
       * const log = await client.aiGateway.logs.delete(
       *   'my-gateway',
       *   { account_id: '0d37909e38d3e99c29fa2cd343ac421a' },
       * );
       * ```
       */
      delete(gatewayId, params, options) {
        const { account_id, filters, limit: limit2, order_by, order_by_direction } = params;
        return this._client.delete(`/accounts/${account_id}/ai-gateway/gateways/${gatewayId}/logs`, {
          query: { filters, limit: limit2, order_by, order_by_direction },
          ...options
        });
      }
      /**
       * Patch Gateway Log
       *
       * @example
       * ```ts
       * const response = await client.aiGateway.logs.edit(
       *   'my-gateway',
       *   'id',
       *   { account_id: '0d37909e38d3e99c29fa2cd343ac421a' },
       * );
       * ```
       */
      edit(gatewayId, id, params, options) {
        const { account_id, ...body } = params;
        return this._client.patch(`/accounts/${account_id}/ai-gateway/gateways/${gatewayId}/logs/${id}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get Gateway Log Detail
       *
       * @example
       * ```ts
       * const log = await client.aiGateway.logs.get(
       *   'my-gateway',
       *   'id',
       *   { account_id: '0d37909e38d3e99c29fa2cd343ac421a' },
       * );
       * ```
       */
      get(gatewayId, id, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/ai-gateway/gateways/${gatewayId}/logs/${id}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get Gateway Log Request
       *
       * @example
       * ```ts
       * const response = await client.aiGateway.logs.request(
       *   'my-gateway',
       *   'id',
       *   { account_id: '0d37909e38d3e99c29fa2cd343ac421a' },
       * );
       * ```
       */
      request(gatewayId, id, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/ai-gateway/gateways/${gatewayId}/logs/${id}/request`, options);
      }
      /**
       * Get Gateway Log Response
       *
       * @example
       * ```ts
       * const response = await client.aiGateway.logs.response(
       *   'my-gateway',
       *   'id',
       *   { account_id: '0d37909e38d3e99c29fa2cd343ac421a' },
       * );
       * ```
       */
      response(gatewayId, id, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/ai-gateway/gateways/${gatewayId}/logs/${id}/response`, options);
      }
    };
    LogListResponsesV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "LogListResponsesV4PagePaginationArray");
      }
    };
    Logs.LogListResponsesV4PagePaginationArray = LogListResponsesV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/ai-gateway/urls.mjs
var URLs;
var init_urls = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/ai-gateway/urls.mjs"() {
    init_import_meta_url();
    init_resource();
    URLs = class extends APIResource {
      static {
        __name(this, "URLs");
      }
      /**
       * Get Gateway URL
       *
       * @example
       * ```ts
       * const url = await client.aiGateway.urls.get(
       *   'my-gateway',
       *   'workers-ai',
       *   { account_id: '0d37909e38d3e99c29fa2cd343ac421a' },
       * );
       * ```
       */
      get(gatewayId, provider, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/ai-gateway/gateways/${gatewayId}/url/${provider}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/ai-gateway/ai-gateway.mjs
var AIGateway, AIGatewayListResponsesV4PagePaginationArray;
var init_ai_gateway = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/ai-gateway/ai-gateway.mjs"() {
    init_import_meta_url();
    init_resource();
    init_datasets();
    init_datasets();
    init_evaluation_types();
    init_evaluation_types();
    init_evaluations();
    init_evaluations();
    init_logs();
    init_logs();
    init_urls();
    init_urls();
    init_pagination();
    AIGateway = class extends APIResource {
      static {
        __name(this, "AIGateway");
      }
      constructor() {
        super(...arguments);
        this.evaluationTypes = new EvaluationTypes(this._client);
        this.logs = new Logs(this._client);
        this.datasets = new Datasets(this._client);
        this.evaluations = new Evaluations(this._client);
        this.urls = new URLs(this._client);
      }
      /**
       * Create a new Gateway
       *
       * @example
       * ```ts
       * const aiGateway = await client.aiGateway.create({
       *   account_id: '3ebbcb006d4d46d7bb6a8c7f14676cb0',
       *   id: 'my-gateway',
       *   cache_invalidate_on_update: true,
       *   cache_ttl: 0,
       *   collect_logs: true,
       *   rate_limiting_interval: 0,
       *   rate_limiting_limit: 0,
       *   rate_limiting_technique: 'fixed',
       * });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/ai-gateway/gateways`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Update a Gateway
       *
       * @example
       * ```ts
       * const aiGateway = await client.aiGateway.update(
       *   'my-gateway',
       *   {
       *     account_id: '3ebbcb006d4d46d7bb6a8c7f14676cb0',
       *     cache_invalidate_on_update: true,
       *     cache_ttl: 0,
       *     collect_logs: true,
       *     rate_limiting_interval: 0,
       *     rate_limiting_limit: 0,
       *     rate_limiting_technique: 'fixed',
       *   },
       * );
       * ```
       */
      update(id, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/ai-gateway/gateways/${id}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List Gateways
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const aiGatewayListResponse of client.aiGateway.list(
       *   { account_id: '3ebbcb006d4d46d7bb6a8c7f14676cb0' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/ai-gateway/gateways`, AIGatewayListResponsesV4PagePaginationArray, { query, ...options });
      }
      /**
       * Delete a Gateway
       *
       * @example
       * ```ts
       * const aiGateway = await client.aiGateway.delete(
       *   'my-gateway',
       *   { account_id: '3ebbcb006d4d46d7bb6a8c7f14676cb0' },
       * );
       * ```
       */
      delete(id, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/ai-gateway/gateways/${id}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetch a Gateway
       *
       * @example
       * ```ts
       * const aiGateway = await client.aiGateway.get('my-gateway', {
       *   account_id: '3ebbcb006d4d46d7bb6a8c7f14676cb0',
       * });
       * ```
       */
      get(id, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/ai-gateway/gateways/${id}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    AIGatewayListResponsesV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "AIGatewayListResponsesV4PagePaginationArray");
      }
    };
    AIGateway.AIGatewayListResponsesV4PagePaginationArray = AIGatewayListResponsesV4PagePaginationArray;
    AIGateway.EvaluationTypes = EvaluationTypes;
    AIGateway.EvaluationTypeListResponsesV4PagePaginationArray = EvaluationTypeListResponsesV4PagePaginationArray;
    AIGateway.Logs = Logs;
    AIGateway.LogListResponsesV4PagePaginationArray = LogListResponsesV4PagePaginationArray;
    AIGateway.Datasets = Datasets;
    AIGateway.DatasetListResponsesV4PagePaginationArray = DatasetListResponsesV4PagePaginationArray;
    AIGateway.Evaluations = Evaluations;
    AIGateway.EvaluationListResponsesV4PagePaginationArray = EvaluationListResponsesV4PagePaginationArray;
    AIGateway.URLs = URLs;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/api-gateway/configurations.mjs
var Configurations;
var init_configurations = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/api-gateway/configurations.mjs"() {
    init_import_meta_url();
    init_resource();
    Configurations = class extends APIResource {
      static {
        __name(this, "Configurations");
      }
      /**
       * Set configuration properties
       *
       * @example
       * ```ts
       * const configuration =
       *   await client.apiGateway.configurations.update({
       *     zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     auth_id_characteristics: [
       *       { name: 'authorization', type: 'header' },
       *     ],
       *   });
       * ```
       */
      update(params, options) {
        const { zone_id, ...body } = params;
        return this._client.put(`/zones/${zone_id}/api_gateway/configuration`, { body, ...options });
      }
      /**
       * Retrieve information about specific configuration properties
       *
       * @example
       * ```ts
       * const configuration =
       *   await client.apiGateway.configurations.get({
       *     zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   });
       * ```
       */
      get(params, options) {
        const { zone_id, ...query } = params;
        return this._client.get(`/zones/${zone_id}/api_gateway/configuration`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/api-gateway/schemas.mjs
var Schemas;
var init_schemas = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/api-gateway/schemas.mjs"() {
    init_import_meta_url();
    init_resource();
    Schemas = class extends APIResource {
      static {
        __name(this, "Schemas");
      }
      /**
       * Retrieve operations and features as OpenAPI schemas
       *
       * @example
       * ```ts
       * const schemas = await client.apiGateway.schemas.list({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      list(params, options) {
        const { zone_id, ...query } = params;
        return this._client.get(`/zones/${zone_id}/api_gateway/schemas`, { query, ...options })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/api-gateway/discovery/operations.mjs
var Operations;
var init_operations = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/api-gateway/discovery/operations.mjs"() {
    init_import_meta_url();
    init_resource();
    init_discovery();
    Operations = class extends APIResource {
      static {
        __name(this, "Operations");
      }
      /**
       * Retrieve the most up to date view of discovered operations
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const discoveryOperation of client.apiGateway.discovery.operations.list(
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { zone_id, ...query } = params;
        return this._client.getAPIList(`/zones/${zone_id}/api_gateway/discovery/operations`, DiscoveryOperationsV4PagePaginationArray, { query, ...options });
      }
      /**
       * Update the `state` on one or more discovered operations
       *
       * @example
       * ```ts
       * const response =
       *   await client.apiGateway.discovery.operations.bulkEdit({
       *     zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     body: {
       *       '3818d821-5901-4147-a474-f5f5aec1d54e': {},
       *       'b17c8043-99a0-4202-b7d9-8f7cdbee02cd': {},
       *     },
       *   });
       * ```
       */
      bulkEdit(params, options) {
        const { zone_id, body } = params;
        return this._client.patch(`/zones/${zone_id}/api_gateway/discovery/operations`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Update the `state` on a discovered operation
       *
       * @example
       * ```ts
       * const response =
       *   await client.apiGateway.discovery.operations.edit(
       *     'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *     { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      edit(operationId, params, options) {
        const { zone_id, ...body } = params;
        return this._client.patch(`/zones/${zone_id}/api_gateway/discovery/operations/${operationId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/api-gateway/discovery/discovery.mjs
var Discovery, DiscoveryOperationsV4PagePaginationArray;
var init_discovery = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/api-gateway/discovery/discovery.mjs"() {
    init_import_meta_url();
    init_resource();
    init_operations();
    init_operations();
    init_pagination();
    Discovery = class extends APIResource {
      static {
        __name(this, "Discovery");
      }
      constructor() {
        super(...arguments);
        this.operations = new Operations(this._client);
      }
      /**
       * Retrieve the most up to date view of discovered operations, rendered as OpenAPI
       * schemas
       *
       * @example
       * ```ts
       * const discovery = await client.apiGateway.discovery.get({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      get(params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/api_gateway/discovery`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    DiscoveryOperationsV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "DiscoveryOperationsV4PagePaginationArray");
      }
    };
    Discovery.Operations = Operations;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/api-gateway/expression-template/fallthrough.mjs
var Fallthrough;
var init_fallthrough = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/api-gateway/expression-template/fallthrough.mjs"() {
    init_import_meta_url();
    init_resource();
    Fallthrough = class extends APIResource {
      static {
        __name(this, "Fallthrough");
      }
      /**
       * Generate fallthrough WAF expression template from a set of API hosts
       *
       * @example
       * ```ts
       * const fallthrough =
       *   await client.apiGateway.expressionTemplate.fallthrough.create(
       *     {
       *       zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *       hosts: ['{zone}.domain1.tld', 'domain2.tld'],
       *     },
       *   );
       * ```
       */
      create(params, options) {
        const { zone_id, ...body } = params;
        return this._client.post(`/zones/${zone_id}/api_gateway/expression-template/fallthrough`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/api-gateway/expression-template/expression-template.mjs
var ExpressionTemplate;
var init_expression_template = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/api-gateway/expression-template/expression-template.mjs"() {
    init_import_meta_url();
    init_resource();
    init_fallthrough();
    init_fallthrough();
    ExpressionTemplate = class extends APIResource {
      static {
        __name(this, "ExpressionTemplate");
      }
      constructor() {
        super(...arguments);
        this.fallthrough = new Fallthrough(this._client);
      }
    };
    ExpressionTemplate.Fallthrough = Fallthrough;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/api-gateway/operations/schema-validation.mjs
var SchemaValidation;
var init_schema_validation = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/api-gateway/operations/schema-validation.mjs"() {
    init_import_meta_url();
    init_resource();
    SchemaValidation = class extends APIResource {
      static {
        __name(this, "SchemaValidation");
      }
      /**
       * Updates operation-level schema validation settings on the zone
       *
       * @deprecated Use [Schema Validation API](https://developers.cloudflare.com/api/resources/schema_validation/) instead.
       */
      update(operationId, params, options) {
        const { zone_id, ...body } = params;
        return this._client.put(`/zones/${zone_id}/api_gateway/operations/${operationId}/schema_validation`, {
          body,
          ...options
        });
      }
      /**
       * Updates multiple operation-level schema validation settings on the zone
       *
       * @deprecated Use [Schema Validation API](https://developers.cloudflare.com/api/resources/schema_validation/) instead.
       */
      edit(params, options) {
        const { zone_id, settings_multiple_request } = params;
        return this._client.patch(`/zones/${zone_id}/api_gateway/operations/schema_validation`, {
          body: settings_multiple_request,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Retrieves operation-level schema validation settings on the zone
       *
       * @deprecated Use [Schema Validation API](https://developers.cloudflare.com/api/resources/schema_validation/) instead.
       */
      get(operationId, params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/api_gateway/operations/${operationId}/schema_validation`, options);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/api-gateway/operations/operations.mjs
var Operations2, OperationListResponsesV4PagePaginationArray, OperationBulkCreateResponsesSinglePage;
var init_operations2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/api-gateway/operations/operations.mjs"() {
    init_import_meta_url();
    init_resource();
    init_schema_validation();
    init_schema_validation();
    init_pagination();
    Operations2 = class extends APIResource {
      static {
        __name(this, "Operations");
      }
      constructor() {
        super(...arguments);
        this.schemaValidation = new SchemaValidation(this._client);
      }
      /**
       * Add one operation to a zone. Endpoints can contain path variables. Host, method,
       * endpoint will be normalized to a canoncial form when creating an operation and
       * must be unique on the zone. Inserting an operation that matches an existing one
       * will return the record of the already existing operation and update its
       * last_updated date.
       *
       * @example
       * ```ts
       * const operation = await client.apiGateway.operations.create(
       *   {
       *     zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     endpoint: '/api/v1/users/{var1}',
       *     host: 'www.example.com',
       *     method: 'GET',
       *   },
       * );
       * ```
       */
      create(params, options) {
        const { zone_id, ...body } = params;
        return this._client.post(`/zones/${zone_id}/api_gateway/operations/item`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Retrieve information about all operations on a zone
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const operationListResponse of client.apiGateway.operations.list(
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { zone_id, ...query } = params;
        return this._client.getAPIList(`/zones/${zone_id}/api_gateway/operations`, OperationListResponsesV4PagePaginationArray, { query, ...options });
      }
      /**
       * Delete an operation
       *
       * @example
       * ```ts
       * const operation = await client.apiGateway.operations.delete(
       *   'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      delete(operationId, params, options) {
        const { zone_id } = params;
        return this._client.delete(`/zones/${zone_id}/api_gateway/operations/${operationId}`, options);
      }
      /**
       * Add one or more operations to a zone. Endpoints can contain path variables.
       * Host, method, endpoint will be normalized to a canoncial form when creating an
       * operation and must be unique on the zone. Inserting an operation that matches an
       * existing one will return the record of the already existing operation and update
       * its last_updated date.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const operationBulkCreateResponse of client.apiGateway.operations.bulkCreate(
       *   {
       *     zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     body: [
       *       {
       *         endpoint: '/api/v1/users/{var1}',
       *         host: 'www.example.com',
       *         method: 'GET',
       *       },
       *     ],
       *   },
       * )) {
       *   // ...
       * }
       * ```
       */
      bulkCreate(params, options) {
        const { zone_id, body } = params;
        return this._client.getAPIList(`/zones/${zone_id}/api_gateway/operations`, OperationBulkCreateResponsesSinglePage, { body, method: "post", ...options });
      }
      /**
       * Delete multiple operations
       *
       * @example
       * ```ts
       * const response =
       *   await client.apiGateway.operations.bulkDelete({
       *     zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   });
       * ```
       */
      bulkDelete(params, options) {
        const { zone_id } = params;
        return this._client.delete(`/zones/${zone_id}/api_gateway/operations`, options);
      }
      /**
       * Retrieve information about an operation
       *
       * @example
       * ```ts
       * const operation = await client.apiGateway.operations.get(
       *   'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(operationId, params, options) {
        const { zone_id, ...query } = params;
        return this._client.get(`/zones/${zone_id}/api_gateway/operations/${operationId}`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
    OperationListResponsesV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "OperationListResponsesV4PagePaginationArray");
      }
    };
    OperationBulkCreateResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "OperationBulkCreateResponsesSinglePage");
      }
    };
    Operations2.OperationListResponsesV4PagePaginationArray = OperationListResponsesV4PagePaginationArray;
    Operations2.OperationBulkCreateResponsesSinglePage = OperationBulkCreateResponsesSinglePage;
    Operations2.SchemaValidation = SchemaValidation;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/api-gateway/settings/schema-validation.mjs
var SchemaValidation2;
var init_schema_validation2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/api-gateway/settings/schema-validation.mjs"() {
    init_import_meta_url();
    init_resource();
    SchemaValidation2 = class extends APIResource {
      static {
        __name(this, "SchemaValidation");
      }
      /**
       * Updates zone level schema validation settings on the zone
       *
       * @deprecated Use [Schema Validation API](https://developers.cloudflare.com/api/resources/schema_validation/) instead.
       */
      update(params, options) {
        const { zone_id, ...body } = params;
        return this._client.put(`/zones/${zone_id}/api_gateway/settings/schema_validation`, { body, ...options });
      }
      /**
       * Updates zone level schema validation settings on the zone
       *
       * @deprecated Use [Schema Validation API](https://developers.cloudflare.com/api/resources/schema_validation/) instead.
       */
      edit(params, options) {
        const { zone_id, ...body } = params;
        return this._client.patch(`/zones/${zone_id}/api_gateway/settings/schema_validation`, {
          body,
          ...options
        });
      }
      /**
       * Retrieves zone level schema validation settings currently set on the zone
       *
       * @deprecated Use [Schema Validation API](https://developers.cloudflare.com/api/resources/schema_validation/) instead.
       */
      get(params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/api_gateway/settings/schema_validation`, options);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/api-gateway/settings/settings.mjs
var Settings;
var init_settings = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/api-gateway/settings/settings.mjs"() {
    init_import_meta_url();
    init_resource();
    init_schema_validation2();
    init_schema_validation2();
    Settings = class extends APIResource {
      static {
        __name(this, "Settings");
      }
      constructor() {
        super(...arguments);
        this.schemaValidation = new SchemaValidation2(this._client);
      }
    };
    Settings.SchemaValidation = SchemaValidation2;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/api-gateway/user-schemas/hosts.mjs
var Hosts, HostListResponsesV4PagePaginationArray;
var init_hosts = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/api-gateway/user-schemas/hosts.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Hosts = class extends APIResource {
      static {
        __name(this, "Hosts");
      }
      /**
       * Retrieve schema hosts in a zone
       *
       * @deprecated Use [Schema Validation API](https://developers.cloudflare.com/api/resources/schema_validation/) instead.
       */
      list(params, options) {
        const { zone_id, ...query } = params;
        return this._client.getAPIList(`/zones/${zone_id}/api_gateway/user_schemas/hosts`, HostListResponsesV4PagePaginationArray, { query, ...options });
      }
    };
    HostListResponsesV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "HostListResponsesV4PagePaginationArray");
      }
    };
    Hosts.HostListResponsesV4PagePaginationArray = HostListResponsesV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/api-gateway/user-schemas/operations.mjs
var Operations3, OperationListResponsesV4PagePaginationArray2;
var init_operations3 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/api-gateway/user-schemas/operations.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Operations3 = class extends APIResource {
      static {
        __name(this, "Operations");
      }
      /**
       * Retrieves all operations from the schema. Operations that already exist in API
       * Shield Endpoint Management will be returned as full operations.
       *
       * @deprecated Use [Schema Validation API](https://developers.cloudflare.com/api/resources/schema_validation/) instead.
       */
      list(schemaId, params, options) {
        const { zone_id, ...query } = params;
        return this._client.getAPIList(`/zones/${zone_id}/api_gateway/user_schemas/${schemaId}/operations`, OperationListResponsesV4PagePaginationArray2, { query, ...options });
      }
    };
    OperationListResponsesV4PagePaginationArray2 = class extends V4PagePaginationArray {
      static {
        __name(this, "OperationListResponsesV4PagePaginationArray");
      }
    };
    Operations3.OperationListResponsesV4PagePaginationArray = OperationListResponsesV4PagePaginationArray2;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/api-gateway/user-schemas/user-schemas.mjs
var UserSchemas, PublicSchemasV4PagePaginationArray;
var init_user_schemas = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/api-gateway/user-schemas/user-schemas.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    init_hosts();
    init_hosts();
    init_operations3();
    init_operations3();
    init_pagination();
    UserSchemas = class extends APIResource {
      static {
        __name(this, "UserSchemas");
      }
      constructor() {
        super(...arguments);
        this.operations = new Operations3(this._client);
        this.hosts = new Hosts(this._client);
      }
      /**
       * Upload a schema to a zone
       *
       * @deprecated Use [Schema Validation API](https://developers.cloudflare.com/api/resources/schema_validation/) instead.
       */
      create(params, options) {
        const { zone_id, ...body } = params;
        return this._client.post(`/zones/${zone_id}/api_gateway/user_schemas`, multipartFormRequestOptions({ body, ...options }))._thenUnwrap((obj) => obj.result);
      }
      /**
       * Retrieve information about all schemas on a zone
       *
       * @deprecated Use [Schema Validation API](https://developers.cloudflare.com/api/resources/schema_validation/) instead.
       */
      list(params, options) {
        const { zone_id, ...query } = params;
        return this._client.getAPIList(`/zones/${zone_id}/api_gateway/user_schemas`, PublicSchemasV4PagePaginationArray, { query, ...options });
      }
      /**
       * Delete a schema
       *
       * @deprecated Use [Schema Validation API](https://developers.cloudflare.com/api/resources/schema_validation/) instead.
       */
      delete(schemaId, params, options) {
        const { zone_id } = params;
        return this._client.delete(`/zones/${zone_id}/api_gateway/user_schemas/${schemaId}`, options);
      }
      /**
       * Enable validation for a schema
       *
       * @deprecated Use [Schema Validation API](https://developers.cloudflare.com/api/resources/schema_validation/) instead.
       */
      edit(schemaId, params, options) {
        const { zone_id, ...body } = params;
        return this._client.patch(`/zones/${zone_id}/api_gateway/user_schemas/${schemaId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Retrieve information about a specific schema on a zone
       *
       * @deprecated Use [Schema Validation API](https://developers.cloudflare.com/api/resources/schema_validation/) instead.
       */
      get(schemaId, params, options) {
        const { zone_id, ...query } = params;
        return this._client.get(`/zones/${zone_id}/api_gateway/user_schemas/${schemaId}`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
    PublicSchemasV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "PublicSchemasV4PagePaginationArray");
      }
    };
    UserSchemas.PublicSchemasV4PagePaginationArray = PublicSchemasV4PagePaginationArray;
    UserSchemas.Operations = Operations3;
    UserSchemas.OperationListResponsesV4PagePaginationArray = OperationListResponsesV4PagePaginationArray2;
    UserSchemas.Hosts = Hosts;
    UserSchemas.HostListResponsesV4PagePaginationArray = HostListResponsesV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/api-gateway/api-gateway.mjs
var APIGateway;
var init_api_gateway = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/api-gateway/api-gateway.mjs"() {
    init_import_meta_url();
    init_resource();
    init_configurations();
    init_configurations();
    init_schemas();
    init_schemas();
    init_discovery();
    init_discovery();
    init_expression_template();
    init_expression_template();
    init_operations2();
    init_operations2();
    init_settings();
    init_user_schemas();
    init_user_schemas();
    APIGateway = class extends APIResource {
      static {
        __name(this, "APIGateway");
      }
      constructor() {
        super(...arguments);
        this.configurations = new Configurations(this._client);
        this.discovery = new Discovery(this._client);
        this.operations = new Operations2(this._client);
        this.schemas = new Schemas(this._client);
        this.settings = new Settings(this._client);
        this.userSchemas = new UserSchemas(this._client);
        this.expressionTemplate = new ExpressionTemplate(this._client);
      }
    };
    APIGateway.Configurations = Configurations;
    APIGateway.Discovery = Discovery;
    APIGateway.Operations = Operations2;
    APIGateway.OperationListResponsesV4PagePaginationArray = OperationListResponsesV4PagePaginationArray;
    APIGateway.OperationBulkCreateResponsesSinglePage = OperationBulkCreateResponsesSinglePage;
    APIGateway.Schemas = Schemas;
    APIGateway.UserSchemas = UserSchemas;
    APIGateway.PublicSchemasV4PagePaginationArray = PublicSchemasV4PagePaginationArray;
    APIGateway.ExpressionTemplate = ExpressionTemplate;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/abuse-reports.mjs
var AbuseReports;
var init_abuse_reports = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/abuse-reports.mjs"() {
    init_import_meta_url();
    init_resource();
    AbuseReports = class extends APIResource {
      static {
        __name(this, "AbuseReports");
      }
      /**
       * Submit the Abuse Report of a particular type
       */
      create(reportType, params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/abuse-reports/${reportType}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/accounts/members.mjs
var Members;
var init_members = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/accounts/members.mjs"() {
    init_import_meta_url();
    init_resource();
    init_shared();
    Members = class extends APIResource {
      static {
        __name(this, "Members");
      }
      /**
       * Add a user to the list of members for this account.
       *
       * @example
       * ```ts
       * const member = await client.accounts.members.create({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   email: 'user@example.com',
       *   roles: ['3536bcfad5faccb999b47003c79917fb'],
       * });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/members`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Modify an account member.
       *
       * @example
       * ```ts
       * const member = await client.accounts.members.update(
       *   '4536bcfad5faccb111b47003c79917fa',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      update(memberId, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/members/${memberId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List all members of an account.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const member of client.accounts.members.list({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * })) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/members`, MembersV4PagePaginationArray, {
          query,
          ...options
        });
      }
      /**
       * Remove a member from an account.
       *
       * @example
       * ```ts
       * const member = await client.accounts.members.delete(
       *   '4536bcfad5faccb111b47003c79917fa',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      delete(memberId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/members/${memberId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get information about a specific member of an account.
       *
       * @example
       * ```ts
       * const member = await client.accounts.members.get(
       *   '4536bcfad5faccb111b47003c79917fa',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(memberId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/members/${memberId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/accounts/roles.mjs
var Roles;
var init_roles = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/accounts/roles.mjs"() {
    init_import_meta_url();
    init_resource();
    init_shared();
    Roles = class extends APIResource {
      static {
        __name(this, "Roles");
      }
      /**
       * Get all available roles for an account.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const role of client.accounts.roles.list({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * })) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/roles`, RolesV4PagePaginationArray, {
          query,
          ...options
        });
      }
      /**
       * Get information about a specific role for an account.
       *
       * @example
       * ```ts
       * const role = await client.accounts.roles.get(
       *   '3536bcfad5faccb999b47003c79917fb',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(roleId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/roles/${roleId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/accounts/subscriptions.mjs
var Subscriptions;
var init_subscriptions = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/accounts/subscriptions.mjs"() {
    init_import_meta_url();
    init_resource();
    init_shared();
    Subscriptions = class extends APIResource {
      static {
        __name(this, "Subscriptions");
      }
      /**
       * Creates an account subscription.
       *
       * @example
       * ```ts
       * const subscription =
       *   await client.accounts.subscriptions.create({
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/subscriptions`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Updates an account subscription.
       *
       * @example
       * ```ts
       * const subscription =
       *   await client.accounts.subscriptions.update(
       *     '506e3185e9c882d175a2d0cb0093d9f2',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      update(subscriptionIdentifier, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/subscriptions/${subscriptionIdentifier}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Deletes an account's subscription.
       *
       * @example
       * ```ts
       * const subscription =
       *   await client.accounts.subscriptions.delete(
       *     '506e3185e9c882d175a2d0cb0093d9f2',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      delete(subscriptionIdentifier, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/subscriptions/${subscriptionIdentifier}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Lists all of an account's subscriptions.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const subscription of client.accounts.subscriptions.get(
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      get(params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/subscriptions`, SubscriptionsSinglePage, options);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/accounts/logs/audit.mjs
var Audit, AuditListResponsesCursorPaginationAfter;
var init_audit = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/accounts/logs/audit.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Audit = class extends APIResource {
      static {
        __name(this, "Audit");
      }
      /**
       * Gets a list of audit logs for an account. <br /> <br /> This is the beta release
       * of Audit Logs Version 2. Since this is a beta version, there may be gaps or
       * missing entries in the available audit logs. Be aware of the following
       * limitations. <br /> <ul> <li>Audit logs are available only for the past 30 days.
       * <br /></li> <li>Error handling is not yet implemented. <br /> </li> </ul>
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const auditListResponse of client.accounts.logs.audit.list(
       *   {
       *     account_id: 'a67e14daa5f8dceeb91fe5449ba496ef',
       *     before: '2024-10-31',
       *     since: '2024-10-30',
       *   },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/logs/audit`, AuditListResponsesCursorPaginationAfter, { query, ...options });
      }
    };
    AuditListResponsesCursorPaginationAfter = class extends CursorPaginationAfter {
      static {
        __name(this, "AuditListResponsesCursorPaginationAfter");
      }
    };
    Audit.AuditListResponsesCursorPaginationAfter = AuditListResponsesCursorPaginationAfter;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/accounts/logs/logs.mjs
var Logs2;
var init_logs2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/accounts/logs/logs.mjs"() {
    init_import_meta_url();
    init_resource();
    init_audit();
    init_audit();
    Logs2 = class extends APIResource {
      static {
        __name(this, "Logs");
      }
      constructor() {
        super(...arguments);
        this.audit = new Audit(this._client);
      }
    };
    Logs2.Audit = Audit;
    Logs2.AuditListResponsesCursorPaginationAfter = AuditListResponsesCursorPaginationAfter;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/accounts/tokens/permission-groups.mjs
var PermissionGroups, PermissionGroupListResponsesSinglePage;
var init_permission_groups = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/accounts/tokens/permission-groups.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    PermissionGroups = class extends APIResource {
      static {
        __name(this, "PermissionGroups");
      }
      /**
       * Find all available permission groups for Account Owned API Tokens
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const permissionGroupListResponse of client.accounts.tokens.permissionGroups.list(
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/tokens/permission_groups`, PermissionGroupListResponsesSinglePage, { query, ...options });
      }
      /**
       * Find all available permission groups for Account Owned API Tokens
       *
       * @example
       * ```ts
       * const permissionGroups =
       *   await client.accounts.tokens.permissionGroups.get({
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   });
       * ```
       */
      get(params, options) {
        const { account_id, ...query } = params;
        return this._client.get(`/accounts/${account_id}/tokens/permission_groups`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
    PermissionGroupListResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "PermissionGroupListResponsesSinglePage");
      }
    };
    PermissionGroups.PermissionGroupListResponsesSinglePage = PermissionGroupListResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/accounts/tokens/value.mjs
var Value;
var init_value = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/accounts/tokens/value.mjs"() {
    init_import_meta_url();
    init_resource();
    Value = class extends APIResource {
      static {
        __name(this, "Value");
      }
      /**
       * Roll the Account Owned API token secret.
       *
       * @example
       * ```ts
       * const tokenValue =
       *   await client.accounts.tokens.value.update(
       *     'ed17574386854bf78a67040be0a770b0',
       *     {
       *       account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *       body: {},
       *     },
       *   );
       * ```
       */
      update(tokenId, params, options) {
        const { account_id, body } = params;
        return this._client.put(`/accounts/${account_id}/tokens/${tokenId}/value`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/accounts/tokens/tokens.mjs
var Tokens;
var init_tokens = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/accounts/tokens/tokens.mjs"() {
    init_import_meta_url();
    init_resource();
    init_shared();
    init_permission_groups();
    init_permission_groups();
    init_value();
    init_value();
    Tokens = class extends APIResource {
      static {
        __name(this, "Tokens");
      }
      constructor() {
        super(...arguments);
        this.permissionGroups = new PermissionGroups(this._client);
        this.value = new Value(this._client);
      }
      /**
       * Create a new Account Owned API token.
       *
       * @example
       * ```ts
       * const token = await client.accounts.tokens.create({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   name: 'readonly token',
       *   policies: [
       *     {
       *       effect: 'allow',
       *       permission_groups: [
       *         { id: 'c8fed203ed3043cba015a93ad1616f1f' },
       *         { id: '82e64a83756745bbbb1c9c2701bf816b' },
       *       ],
       *       resources: { foo: 'string' },
       *     },
       *   ],
       * });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/tokens`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Update an existing token.
       *
       * @example
       * ```ts
       * const token = await client.accounts.tokens.update(
       *   'ed17574386854bf78a67040be0a770b0',
       *   {
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     name: 'readonly token',
       *     policies: [
       *       {
       *         effect: 'allow',
       *         permission_groups: [
       *           { id: 'c8fed203ed3043cba015a93ad1616f1f' },
       *           { id: '82e64a83756745bbbb1c9c2701bf816b' },
       *         ],
       *         resources: { foo: 'string' },
       *       },
       *     ],
       *   },
       * );
       * ```
       */
      update(tokenId, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/tokens/${tokenId}`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List all Account Owned API tokens created for this account.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const token of client.accounts.tokens.list({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * })) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/tokens`, TokensV4PagePaginationArray, {
          query,
          ...options
        });
      }
      /**
       * Destroy an Account Owned API token.
       *
       * @example
       * ```ts
       * const token = await client.accounts.tokens.delete(
       *   'ed17574386854bf78a67040be0a770b0',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      delete(tokenId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/tokens/${tokenId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get information about a specific Account Owned API token.
       *
       * @example
       * ```ts
       * const token = await client.accounts.tokens.get(
       *   'ed17574386854bf78a67040be0a770b0',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(tokenId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/tokens/${tokenId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Test whether a token works.
       *
       * @example
       * ```ts
       * const response = await client.accounts.tokens.verify({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      verify(params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/tokens/verify`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    Tokens.PermissionGroups = PermissionGroups;
    Tokens.PermissionGroupListResponsesSinglePage = PermissionGroupListResponsesSinglePage;
    Tokens.Value = Value;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/accounts/accounts.mjs
var Accounts, AccountsV4PagePaginationArray;
var init_accounts = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/accounts/accounts.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    init_members();
    init_members();
    init_roles();
    init_roles();
    init_subscriptions();
    init_subscriptions();
    init_logs2();
    init_logs2();
    init_tokens();
    init_tokens();
    init_pagination();
    Accounts = class extends APIResource {
      static {
        __name(this, "Accounts");
      }
      constructor() {
        super(...arguments);
        this.members = new Members(this._client);
        this.roles = new Roles(this._client);
        this.subscriptions = new Subscriptions(this._client);
        this.tokens = new Tokens(this._client);
        this.logs = new Logs2(this._client);
      }
      /**
       * Create an account (only available for tenant admins at this time)
       *
       * @example
       * ```ts
       * const account = await client.accounts.create({
       *   name: 'name',
       * });
       * ```
       */
      create(body, options) {
        return this._client.post("/accounts", { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Update an existing account.
       *
       * @example
       * ```ts
       * const account = await client.accounts.update({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   name: 'Demo Account',
       *   type: 'standard',
       * });
       * ```
       */
      update(params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      list(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.list({}, query);
        }
        return this._client.getAPIList("/accounts", AccountsV4PagePaginationArray, { query, ...options });
      }
      /**
       * Delete a specific account (only available for tenant admins at this time). This
       * is a permanent operation that will delete any zones or other resources under the
       * account
       *
       * @example
       * ```ts
       * const account = await client.accounts.delete({
       *   account_id: 'account_id',
       * });
       * ```
       */
      delete(params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get information about a specific account that you are a member of.
       *
       * @example
       * ```ts
       * const account = await client.accounts.get({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      get(params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    AccountsV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "AccountsV4PagePaginationArray");
      }
    };
    Accounts.AccountsV4PagePaginationArray = AccountsV4PagePaginationArray;
    Accounts.Members = Members;
    Accounts.Roles = Roles;
    Accounts.Subscriptions = Subscriptions;
    Accounts.Tokens = Tokens;
    Accounts.Logs = Logs2;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/addressing/loa-documents.mjs
var LOADocuments;
var init_loa_documents = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/addressing/loa-documents.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    LOADocuments = class extends APIResource {
      static {
        __name(this, "LOADocuments");
      }
      /**
       * Submit LOA document (pdf format) under the account.
       *
       * @example
       * ```ts
       * const loaDocument =
       *   await client.addressing.loaDocuments.create({
       *     account_id: '258def64c72dae45f3e4c8516e2111f2',
       *     loa_document: '@document.pdf',
       *   });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/addressing/loa_documents`, multipartFormRequestOptions({ body, ...options }))._thenUnwrap((obj) => obj.result);
      }
      /**
       * Download specified LOA document under the account.
       *
       * @example
       * ```ts
       * const loaDocument =
       *   await client.addressing.loaDocuments.get(
       *     'd933b1530bc56c9953cf8ce166da8004',
       *     { account_id: '258def64c72dae45f3e4c8516e2111f2' },
       *   );
       *
       * const content = await loaDocument.blob();
       * console.log(content);
       * ```
       */
      get(loaDocumentId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/addressing/loa_documents/${loaDocumentId}/download`, {
          ...options,
          headers: { Accept: "application/pdf", ...options?.headers },
          __binaryResponse: true
        });
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/addressing/services.mjs
var Services, ServiceListResponsesSinglePage;
var init_services = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/addressing/services.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Services = class extends APIResource {
      static {
        __name(this, "Services");
      }
      /**
       * Bring-Your-Own IP (BYOIP) prefixes onboarded to Cloudflare must be bound to a
       * service running on the Cloudflare network to enable a Cloudflare product on the
       * IP addresses. This endpoint can be used as a reference of available services on
       * the Cloudflare network, and their service IDs.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const serviceListResponse of client.addressing.services.list(
       *   { account_id: '258def64c72dae45f3e4c8516e2111f2' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/addressing/services`, ServiceListResponsesSinglePage, options);
      }
    };
    ServiceListResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "ServiceListResponsesSinglePage");
      }
    };
    Services.ServiceListResponsesSinglePage = ServiceListResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/addressing/address-maps/accounts.mjs
var Accounts2;
var init_accounts2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/addressing/address-maps/accounts.mjs"() {
    init_import_meta_url();
    init_resource();
    Accounts2 = class extends APIResource {
      static {
        __name(this, "Accounts");
      }
      /**
       * Add an account as a member of a particular address map.
       *
       * @example
       * ```ts
       * const account =
       *   await client.addressing.addressMaps.accounts.update(
       *     '055817b111884e0227e1be16a0be6ee0',
       *     {
       *       account_id: '258def64c72dae45f3e4c8516e2111f2',
       *       body: {},
       *     },
       *   );
       * ```
       */
      update(addressMapId, params, options) {
        const { account_id, body } = params;
        return this._client.put(`/accounts/${account_id}/addressing/address_maps/${addressMapId}/accounts/${account_id}`, { body, ...options });
      }
      /**
       * Remove an account as a member of a particular address map.
       *
       * @example
       * ```ts
       * const account =
       *   await client.addressing.addressMaps.accounts.delete(
       *     '055817b111884e0227e1be16a0be6ee0',
       *     { account_id: '258def64c72dae45f3e4c8516e2111f2' },
       *   );
       * ```
       */
      delete(addressMapId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/addressing/address_maps/${addressMapId}/accounts/${account_id}`, options);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/addressing/address-maps/ips.mjs
var IPs;
var init_ips = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/addressing/address-maps/ips.mjs"() {
    init_import_meta_url();
    init_resource();
    IPs = class extends APIResource {
      static {
        __name(this, "IPs");
      }
      /**
       * Add an IP from a prefix owned by the account to a particular address map.
       *
       * @example
       * ```ts
       * const ip = await client.addressing.addressMaps.ips.update(
       *   '055817b111884e0227e1be16a0be6ee0',
       *   '192.0.2.1',
       *   {
       *     account_id: '258def64c72dae45f3e4c8516e2111f2',
       *     body: {},
       *   },
       * );
       * ```
       */
      update(addressMapId, ipAddress, params, options) {
        const { account_id, body } = params;
        return this._client.put(`/accounts/${account_id}/addressing/address_maps/${addressMapId}/ips/${ipAddress}`, { body, ...options });
      }
      /**
       * Remove an IP from a particular address map.
       *
       * @example
       * ```ts
       * const ip = await client.addressing.addressMaps.ips.delete(
       *   '055817b111884e0227e1be16a0be6ee0',
       *   '192.0.2.1',
       *   { account_id: '258def64c72dae45f3e4c8516e2111f2' },
       * );
       * ```
       */
      delete(addressMapId, ipAddress, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/addressing/address_maps/${addressMapId}/ips/${ipAddress}`, options);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/addressing/address-maps/zones.mjs
var Zones;
var init_zones = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/addressing/address-maps/zones.mjs"() {
    init_import_meta_url();
    init_resource();
    Zones = class extends APIResource {
      static {
        __name(this, "Zones");
      }
      /**
       * Add a zone as a member of a particular address map.
       *
       * @example
       * ```ts
       * const zone =
       *   await client.addressing.addressMaps.zones.update(
       *     '055817b111884e0227e1be16a0be6ee0',
       *     {
       *       zone_id: '8ac8489932db6327334c9b6d58544cfe',
       *       account_id: '258def64c72dae45f3e4c8516e2111f2',
       *       body: {},
       *     },
       *   );
       * ```
       */
      update(addressMapId, params, options) {
        const { zone_id, account_id, body } = params;
        return this._client.put(`/accounts/${account_id}/addressing/address_maps/${addressMapId}/zones/${zone_id}`, { body, ...options });
      }
      /**
       * Remove a zone as a member of a particular address map.
       *
       * @example
       * ```ts
       * const zone =
       *   await client.addressing.addressMaps.zones.delete(
       *     '055817b111884e0227e1be16a0be6ee0',
       *     {
       *       zone_id: '8ac8489932db6327334c9b6d58544cfe',
       *       account_id: '258def64c72dae45f3e4c8516e2111f2',
       *     },
       *   );
       * ```
       */
      delete(addressMapId, params, options) {
        const { zone_id, account_id } = params;
        return this._client.delete(`/accounts/${account_id}/addressing/address_maps/${addressMapId}/zones/${zone_id}`, options);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/addressing/address-maps/address-maps.mjs
var AddressMaps, AddressMapsSinglePage;
var init_address_maps = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/addressing/address-maps/address-maps.mjs"() {
    init_import_meta_url();
    init_resource();
    init_accounts2();
    init_accounts2();
    init_ips();
    init_ips();
    init_zones();
    init_zones();
    init_pagination();
    AddressMaps = class extends APIResource {
      static {
        __name(this, "AddressMaps");
      }
      constructor() {
        super(...arguments);
        this.accounts = new Accounts2(this._client);
        this.ips = new IPs(this._client);
        this.zones = new Zones(this._client);
      }
      /**
       * Create a new address map under the account.
       *
       * @example
       * ```ts
       * const addressMap =
       *   await client.addressing.addressMaps.create({
       *     account_id: '258def64c72dae45f3e4c8516e2111f2',
       *   });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/addressing/address_maps`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List all address maps owned by the account.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const addressMap of client.addressing.addressMaps.list(
       *   { account_id: '258def64c72dae45f3e4c8516e2111f2' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/addressing/address_maps`, AddressMapsSinglePage, options);
      }
      /**
       * Delete a particular address map owned by the account. An Address Map must be
       * disabled before it can be deleted.
       *
       * @example
       * ```ts
       * const addressMap =
       *   await client.addressing.addressMaps.delete(
       *     '055817b111884e0227e1be16a0be6ee0',
       *     { account_id: '258def64c72dae45f3e4c8516e2111f2' },
       *   );
       * ```
       */
      delete(addressMapId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/addressing/address_maps/${addressMapId}`, options);
      }
      /**
       * Modify properties of an address map owned by the account.
       *
       * @example
       * ```ts
       * const addressMap = await client.addressing.addressMaps.edit(
       *   '055817b111884e0227e1be16a0be6ee0',
       *   { account_id: '258def64c72dae45f3e4c8516e2111f2' },
       * );
       * ```
       */
      edit(addressMapId, params, options) {
        const { account_id, ...body } = params;
        return this._client.patch(`/accounts/${account_id}/addressing/address_maps/${addressMapId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Show a particular address map owned by the account.
       *
       * @example
       * ```ts
       * const addressMap = await client.addressing.addressMaps.get(
       *   '055817b111884e0227e1be16a0be6ee0',
       *   { account_id: '258def64c72dae45f3e4c8516e2111f2' },
       * );
       * ```
       */
      get(addressMapId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/addressing/address_maps/${addressMapId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    AddressMapsSinglePage = class extends SinglePage {
      static {
        __name(this, "AddressMapsSinglePage");
      }
    };
    AddressMaps.AddressMapsSinglePage = AddressMapsSinglePage;
    AddressMaps.Accounts = Accounts2;
    AddressMaps.IPs = IPs;
    AddressMaps.Zones = Zones;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/addressing/prefixes/advertisement-status.mjs
var AdvertisementStatus;
var init_advertisement_status = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/addressing/prefixes/advertisement-status.mjs"() {
    init_import_meta_url();
    init_resource();
    AdvertisementStatus = class extends APIResource {
      static {
        __name(this, "AdvertisementStatus");
      }
      /**
       * Advertise or withdraw the BGP route for a prefix.
       *
       * **Deprecated:** Prefer the BGP Prefixes endpoints, which additionally allow for
       * advertising and withdrawing subnets of an IP prefix.
       *
       * @deprecated
       */
      edit(prefixId, params, options) {
        const { account_id, ...body } = params;
        return this._client.patch(`/accounts/${account_id}/addressing/prefixes/${prefixId}/bgp/status`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * View the current advertisement state for a prefix.
       *
       * **Deprecated:** Prefer the BGP Prefixes endpoints, which additionally allow for
       * advertising and withdrawing subnets of an IP prefix.
       *
       * @deprecated
       */
      get(prefixId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/addressing/prefixes/${prefixId}/bgp/status`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/addressing/prefixes/bgp-prefixes.mjs
var BGPPrefixes, BGPPrefixesSinglePage;
var init_bgp_prefixes = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/addressing/prefixes/bgp-prefixes.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    BGPPrefixes = class extends APIResource {
      static {
        __name(this, "BGPPrefixes");
      }
      /**
       * Create a BGP prefix, controlling the BGP advertisement status of a specific
       * subnet. When created, BGP prefixes are initially withdrawn, and can be
       * advertised with the Update BGP Prefix API.
       *
       * @example
       * ```ts
       * const bgpPrefix =
       *   await client.addressing.prefixes.bgpPrefixes.create(
       *     '2af39739cc4e3b5910c918468bb89828',
       *     { account_id: '258def64c72dae45f3e4c8516e2111f2' },
       *   );
       * ```
       */
      create(prefixId, params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/addressing/prefixes/${prefixId}/bgp/prefixes`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List all BGP Prefixes within the specified IP Prefix. BGP Prefixes are used to
       * control which specific subnets are advertised to the Internet. It is possible to
       * advertise subnets more specific than an IP Prefix by creating more specific BGP
       * Prefixes.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const bgpPrefix of client.addressing.prefixes.bgpPrefixes.list(
       *   '2af39739cc4e3b5910c918468bb89828',
       *   { account_id: '258def64c72dae45f3e4c8516e2111f2' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(prefixId, params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/addressing/prefixes/${prefixId}/bgp/prefixes`, BGPPrefixesSinglePage, options);
      }
      /**
       * Update the properties of a BGP Prefix, such as the on demand advertisement
       * status (advertised or withdrawn).
       *
       * @example
       * ```ts
       * const bgpPrefix =
       *   await client.addressing.prefixes.bgpPrefixes.edit(
       *     '2af39739cc4e3b5910c918468bb89828',
       *     '7009ba364c7a5760798ceb430e603b74',
       *     { account_id: '258def64c72dae45f3e4c8516e2111f2' },
       *   );
       * ```
       */
      edit(prefixId, bgpPrefixId, params, options) {
        const { account_id, ...body } = params;
        return this._client.patch(`/accounts/${account_id}/addressing/prefixes/${prefixId}/bgp/prefixes/${bgpPrefixId}`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Retrieve a single BGP Prefix according to its identifier
       *
       * @example
       * ```ts
       * const bgpPrefix =
       *   await client.addressing.prefixes.bgpPrefixes.get(
       *     '2af39739cc4e3b5910c918468bb89828',
       *     '7009ba364c7a5760798ceb430e603b74',
       *     { account_id: '258def64c72dae45f3e4c8516e2111f2' },
       *   );
       * ```
       */
      get(prefixId, bgpPrefixId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/addressing/prefixes/${prefixId}/bgp/prefixes/${bgpPrefixId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    BGPPrefixesSinglePage = class extends SinglePage {
      static {
        __name(this, "BGPPrefixesSinglePage");
      }
    };
    BGPPrefixes.BGPPrefixesSinglePage = BGPPrefixesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/addressing/prefixes/delegations.mjs
var Delegations, DelegationsSinglePage;
var init_delegations = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/addressing/prefixes/delegations.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Delegations = class extends APIResource {
      static {
        __name(this, "Delegations");
      }
      /**
       * Create a new account delegation for a given IP prefix.
       *
       * @example
       * ```ts
       * const delegations =
       *   await client.addressing.prefixes.delegations.create(
       *     '2af39739cc4e3b5910c918468bb89828',
       *     {
       *       account_id: '258def64c72dae45f3e4c8516e2111f2',
       *       cidr: '192.0.2.0/24',
       *       delegated_account_id:
       *         'b1946ac92492d2347c6235b4d2611184',
       *     },
       *   );
       * ```
       */
      create(prefixId, params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/addressing/prefixes/${prefixId}/delegations`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List all delegations for a given account IP prefix.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const delegations of client.addressing.prefixes.delegations.list(
       *   '2af39739cc4e3b5910c918468bb89828',
       *   { account_id: '258def64c72dae45f3e4c8516e2111f2' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(prefixId, params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/addressing/prefixes/${prefixId}/delegations`, DelegationsSinglePage, options);
      }
      /**
       * Delete an account delegation for a given IP prefix.
       *
       * @example
       * ```ts
       * const delegation =
       *   await client.addressing.prefixes.delegations.delete(
       *     '2af39739cc4e3b5910c918468bb89828',
       *     'd933b1530bc56c9953cf8ce166da8004',
       *     { account_id: '258def64c72dae45f3e4c8516e2111f2' },
       *   );
       * ```
       */
      delete(prefixId, delegationId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/addressing/prefixes/${prefixId}/delegations/${delegationId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    DelegationsSinglePage = class extends SinglePage {
      static {
        __name(this, "DelegationsSinglePage");
      }
    };
    Delegations.DelegationsSinglePage = DelegationsSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/addressing/prefixes/service-bindings.mjs
var ServiceBindings, ServiceBindingsSinglePage;
var init_service_bindings = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/addressing/prefixes/service-bindings.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    ServiceBindings = class extends APIResource {
      static {
        __name(this, "ServiceBindings");
      }
      /**
       * Creates a new Service Binding, routing traffic to IPs within the given CIDR to a
       * service running on Cloudflare's network. **Note:** This API may only be used on
       * prefixes currently configured with a Magic Transit/Cloudflare CDN/Cloudflare
       * Spectrum service binding, and only allows creating upgrade service bindings for
       * the Cloudflare CDN or Cloudflare Spectrum.
       *
       * @example
       * ```ts
       * const serviceBinding =
       *   await client.addressing.prefixes.serviceBindings.create(
       *     '2af39739cc4e3b5910c918468bb89828',
       *     { account_id: '258def64c72dae45f3e4c8516e2111f2' },
       *   );
       * ```
       */
      create(prefixId, params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/addressing/prefixes/${prefixId}/bindings`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List the Cloudflare services this prefix is currently bound to. Traffic sent to
       * an address within an IP prefix will be routed to the Cloudflare service of the
       * most-specific Service Binding matching the address. **Example:** binding
       * `192.0.2.0/24` to Cloudflare Magic Transit and `192.0.2.1/32` to the Cloudflare
       * CDN would route traffic for `192.0.2.1` to the CDN, and traffic for all other
       * IPs in the prefix to Cloudflare Magic Transit.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const serviceBinding of client.addressing.prefixes.serviceBindings.list(
       *   '2af39739cc4e3b5910c918468bb89828',
       *   { account_id: '258def64c72dae45f3e4c8516e2111f2' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(prefixId, params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/addressing/prefixes/${prefixId}/bindings`, ServiceBindingsSinglePage, options);
      }
      /**
       * Delete a Service Binding
       *
       * @example
       * ```ts
       * const serviceBinding =
       *   await client.addressing.prefixes.serviceBindings.delete(
       *     '2af39739cc4e3b5910c918468bb89828',
       *     '0429b49b6a5155297b78e75a44b09e14',
       *     { account_id: '258def64c72dae45f3e4c8516e2111f2' },
       *   );
       * ```
       */
      delete(prefixId, bindingId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/addressing/prefixes/${prefixId}/bindings/${bindingId}`, options);
      }
      /**
       * Fetch a single Service Binding
       *
       * @example
       * ```ts
       * const serviceBinding =
       *   await client.addressing.prefixes.serviceBindings.get(
       *     '2af39739cc4e3b5910c918468bb89828',
       *     '0429b49b6a5155297b78e75a44b09e14',
       *     { account_id: '258def64c72dae45f3e4c8516e2111f2' },
       *   );
       * ```
       */
      get(prefixId, bindingId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/addressing/prefixes/${prefixId}/bindings/${bindingId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    ServiceBindingsSinglePage = class extends SinglePage {
      static {
        __name(this, "ServiceBindingsSinglePage");
      }
    };
    ServiceBindings.ServiceBindingsSinglePage = ServiceBindingsSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/addressing/prefixes/prefixes.mjs
var Prefixes, PrefixesSinglePage;
var init_prefixes = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/addressing/prefixes/prefixes.mjs"() {
    init_import_meta_url();
    init_resource();
    init_advertisement_status();
    init_advertisement_status();
    init_bgp_prefixes();
    init_bgp_prefixes();
    init_delegations();
    init_delegations();
    init_service_bindings();
    init_service_bindings();
    init_pagination();
    Prefixes = class extends APIResource {
      static {
        __name(this, "Prefixes");
      }
      constructor() {
        super(...arguments);
        this.serviceBindings = new ServiceBindings(this._client);
        this.bgpPrefixes = new BGPPrefixes(this._client);
        this.advertisementStatus = new AdvertisementStatus(this._client);
        this.delegations = new Delegations(this._client);
      }
      /**
       * Add a new prefix under the account.
       *
       * @example
       * ```ts
       * const prefix = await client.addressing.prefixes.create({
       *   account_id: '258def64c72dae45f3e4c8516e2111f2',
       *   asn: 209242,
       *   cidr: '192.0.2.0/24',
       *   loa_document_id: 'd933b1530bc56c9953cf8ce166da8004',
       * });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/addressing/prefixes`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List all prefixes owned by the account.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const prefix of client.addressing.prefixes.list({
       *   account_id: '258def64c72dae45f3e4c8516e2111f2',
       * })) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/addressing/prefixes`, PrefixesSinglePage, options);
      }
      /**
       * Delete an unapproved prefix owned by the account.
       *
       * @example
       * ```ts
       * const prefix = await client.addressing.prefixes.delete(
       *   '2af39739cc4e3b5910c918468bb89828',
       *   { account_id: '258def64c72dae45f3e4c8516e2111f2' },
       * );
       * ```
       */
      delete(prefixId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/addressing/prefixes/${prefixId}`, options);
      }
      /**
       * Modify the description for a prefix owned by the account.
       *
       * @example
       * ```ts
       * const prefix = await client.addressing.prefixes.edit(
       *   '2af39739cc4e3b5910c918468bb89828',
       *   {
       *     account_id: '258def64c72dae45f3e4c8516e2111f2',
       *     description: 'Internal test prefix',
       *   },
       * );
       * ```
       */
      edit(prefixId, params, options) {
        const { account_id, ...body } = params;
        return this._client.patch(`/accounts/${account_id}/addressing/prefixes/${prefixId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List a particular prefix owned by the account.
       *
       * @example
       * ```ts
       * const prefix = await client.addressing.prefixes.get(
       *   '2af39739cc4e3b5910c918468bb89828',
       *   { account_id: '258def64c72dae45f3e4c8516e2111f2' },
       * );
       * ```
       */
      get(prefixId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/addressing/prefixes/${prefixId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    PrefixesSinglePage = class extends SinglePage {
      static {
        __name(this, "PrefixesSinglePage");
      }
    };
    Prefixes.PrefixesSinglePage = PrefixesSinglePage;
    Prefixes.ServiceBindings = ServiceBindings;
    Prefixes.ServiceBindingsSinglePage = ServiceBindingsSinglePage;
    Prefixes.BGPPrefixes = BGPPrefixes;
    Prefixes.BGPPrefixesSinglePage = BGPPrefixesSinglePage;
    Prefixes.AdvertisementStatus = AdvertisementStatus;
    Prefixes.DelegationsSinglePage = DelegationsSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/addressing/regional-hostnames/regions.mjs
var Regions, RegionListResponsesSinglePage;
var init_regions = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/addressing/regional-hostnames/regions.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Regions = class extends APIResource {
      static {
        __name(this, "Regions");
      }
      /**
       * List all Regional Services regions available for use by this account.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const regionListResponse of client.addressing.regionalHostnames.regions.list(
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/addressing/regional_hostnames/regions`, RegionListResponsesSinglePage, options);
      }
    };
    RegionListResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "RegionListResponsesSinglePage");
      }
    };
    Regions.RegionListResponsesSinglePage = RegionListResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/addressing/regional-hostnames/regional-hostnames.mjs
var RegionalHostnames, RegionalHostnameListResponsesSinglePage;
var init_regional_hostnames = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/addressing/regional-hostnames/regional-hostnames.mjs"() {
    init_import_meta_url();
    init_resource();
    init_regions();
    init_regions();
    init_pagination();
    RegionalHostnames = class extends APIResource {
      static {
        __name(this, "RegionalHostnames");
      }
      constructor() {
        super(...arguments);
        this.regions = new Regions(this._client);
      }
      /**
       * Create a new Regional Hostname entry. Cloudflare will only use data centers that
       * are physically located within the chosen region to decrypt and service HTTPS
       * traffic. Learn more about
       * [Regional Services](https://developers.cloudflare.com/data-localization/regional-services/get-started/).
       *
       * @example
       * ```ts
       * const regionalHostname =
       *   await client.addressing.regionalHostnames.create({
       *     zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     hostname: 'foo.example.com',
       *     region_key: 'ca',
       *   });
       * ```
       */
      create(params, options) {
        const { zone_id, ...body } = params;
        return this._client.post(`/zones/${zone_id}/addressing/regional_hostnames`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List all Regional Hostnames within a zone.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const regionalHostnameListResponse of client.addressing.regionalHostnames.list(
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { zone_id } = params;
        return this._client.getAPIList(`/zones/${zone_id}/addressing/regional_hostnames`, RegionalHostnameListResponsesSinglePage, options);
      }
      /**
       * Delete the region configuration for a specific Regional Hostname.
       *
       * @example
       * ```ts
       * const regionalHostname =
       *   await client.addressing.regionalHostnames.delete(
       *     'foo.example.com',
       *     { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      delete(hostname2, params, options) {
        const { zone_id } = params;
        return this._client.delete(`/zones/${zone_id}/addressing/regional_hostnames/${hostname2}`, options);
      }
      /**
       * Update the configuration for a specific Regional Hostname. Only the region_key
       * of a hostname is mutable.
       *
       * @example
       * ```ts
       * const response =
       *   await client.addressing.regionalHostnames.edit(
       *     'foo.example.com',
       *     {
       *       zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *       region_key: 'ca',
       *     },
       *   );
       * ```
       */
      edit(hostname2, params, options) {
        const { zone_id, ...body } = params;
        return this._client.patch(`/zones/${zone_id}/addressing/regional_hostnames/${hostname2}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetch the configuration for a specific Regional Hostname, within a zone.
       *
       * @example
       * ```ts
       * const regionalHostname =
       *   await client.addressing.regionalHostnames.get(
       *     'foo.example.com',
       *     { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      get(hostname2, params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/addressing/regional_hostnames/${hostname2}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    RegionalHostnameListResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "RegionalHostnameListResponsesSinglePage");
      }
    };
    RegionalHostnames.RegionalHostnameListResponsesSinglePage = RegionalHostnameListResponsesSinglePage;
    RegionalHostnames.Regions = Regions;
    RegionalHostnames.RegionListResponsesSinglePage = RegionListResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/addressing/addressing.mjs
var Addressing;
var init_addressing = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/addressing/addressing.mjs"() {
    init_import_meta_url();
    init_resource();
    init_loa_documents();
    init_loa_documents();
    init_services();
    init_services();
    init_address_maps();
    init_address_maps();
    init_prefixes();
    init_prefixes();
    init_regional_hostnames();
    init_regional_hostnames();
    Addressing = class extends APIResource {
      static {
        __name(this, "Addressing");
      }
      constructor() {
        super(...arguments);
        this.regionalHostnames = new RegionalHostnames(this._client);
        this.services = new Services(this._client);
        this.addressMaps = new AddressMaps(this._client);
        this.loaDocuments = new LOADocuments(this._client);
        this.prefixes = new Prefixes(this._client);
      }
    };
    Addressing.RegionalHostnames = RegionalHostnames;
    Addressing.RegionalHostnameListResponsesSinglePage = RegionalHostnameListResponsesSinglePage;
    Addressing.Services = Services;
    Addressing.ServiceListResponsesSinglePage = ServiceListResponsesSinglePage;
    Addressing.AddressMaps = AddressMaps;
    Addressing.AddressMapsSinglePage = AddressMapsSinglePage;
    Addressing.LOADocuments = LOADocuments;
    Addressing.Prefixes = Prefixes;
    Addressing.PrefixesSinglePage = PrefixesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/alerting/available-alerts.mjs
var AvailableAlerts;
var init_available_alerts = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/alerting/available-alerts.mjs"() {
    init_import_meta_url();
    init_resource();
    AvailableAlerts = class extends APIResource {
      static {
        __name(this, "AvailableAlerts");
      }
      /**
       * Gets a list of all alert types for which an account is eligible.
       *
       * @example
       * ```ts
       * const availableAlerts =
       *   await client.alerting.availableAlerts.list({
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   });
       * ```
       */
      list(params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/alerting/v3/available_alerts`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/alerting/history.mjs
var HistoryResource, HistoriesV4PagePaginationArray;
var init_history = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/alerting/history.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    HistoryResource = class extends APIResource {
      static {
        __name(this, "HistoryResource");
      }
      /**
       * Gets a list of history records for notifications sent to an account. The records
       * are displayed for last `x` number of days based on the zone plan (free = 30, pro
       * = 30, biz = 30, ent = 90).
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const history of client.alerting.history.list({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * })) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/alerting/v3/history`, HistoriesV4PagePaginationArray, { query, ...options });
      }
    };
    HistoriesV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "HistoriesV4PagePaginationArray");
      }
    };
    HistoryResource.HistoriesV4PagePaginationArray = HistoriesV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/alerting/policies.mjs
var Policies, PoliciesSinglePage;
var init_policies = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/alerting/policies.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Policies = class extends APIResource {
      static {
        __name(this, "Policies");
      }
      /**
       * Creates a new Notification policy.
       *
       * @example
       * ```ts
       * const policy = await client.alerting.policies.create({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   alert_type: 'universal_ssl_event_type',
       *   enabled: true,
       *   mechanisms: {},
       *   name: 'SSL Notification Event Policy',
       * });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/alerting/v3/policies`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Update a Notification policy.
       *
       * @example
       * ```ts
       * const policy = await client.alerting.policies.update(
       *   '0da2b59e-f118-439d-8097-bdfb215203c9',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      update(policyId, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/alerting/v3/policies/${policyId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get a list of all Notification policies.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const policy of client.alerting.policies.list({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * })) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/alerting/v3/policies`, PoliciesSinglePage, options);
      }
      /**
       * Delete a Notification policy.
       *
       * @example
       * ```ts
       * const policy = await client.alerting.policies.delete(
       *   '0da2b59e-f118-439d-8097-bdfb215203c9',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      delete(policyId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/alerting/v3/policies/${policyId}`, options);
      }
      /**
       * Get details for a single policy.
       *
       * @example
       * ```ts
       * const policy = await client.alerting.policies.get(
       *   '0da2b59e-f118-439d-8097-bdfb215203c9',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(policyId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/alerting/v3/policies/${policyId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    PoliciesSinglePage = class extends SinglePage {
      static {
        __name(this, "PoliciesSinglePage");
      }
    };
    Policies.PoliciesSinglePage = PoliciesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/alerting/destinations/eligible.mjs
var Eligible;
var init_eligible = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/alerting/destinations/eligible.mjs"() {
    init_import_meta_url();
    init_resource();
    Eligible = class extends APIResource {
      static {
        __name(this, "Eligible");
      }
      /**
       * Get a list of all delivery mechanism types for which an account is eligible.
       *
       * @example
       * ```ts
       * const eligible =
       *   await client.alerting.destinations.eligible.get({
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   });
       * ```
       */
      get(params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/alerting/v3/destinations/eligible`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/alerting/destinations/pagerduty.mjs
var PagerdutyResource, PagerdutiesSinglePage;
var init_pagerduty = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/alerting/destinations/pagerduty.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    PagerdutyResource = class extends APIResource {
      static {
        __name(this, "PagerdutyResource");
      }
      /**
       * Creates a new token for integrating with PagerDuty.
       *
       * @example
       * ```ts
       * const pagerduty =
       *   await client.alerting.destinations.pagerduty.create({
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   });
       * ```
       */
      create(params, options) {
        const { account_id } = params;
        return this._client.post(`/accounts/${account_id}/alerting/v3/destinations/pagerduty/connect`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Deletes all the PagerDuty Services connected to the account.
       *
       * @example
       * ```ts
       * const pagerduty =
       *   await client.alerting.destinations.pagerduty.delete({
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   });
       * ```
       */
      delete(params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/alerting/v3/destinations/pagerduty`, options);
      }
      /**
       * Get a list of all configured PagerDuty services.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const pagerduty of client.alerting.destinations.pagerduty.get(
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      get(params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/alerting/v3/destinations/pagerduty`, PagerdutiesSinglePage, options);
      }
      /**
       * Links PagerDuty with the account using the integration token.
       *
       * @example
       * ```ts
       * const response =
       *   await client.alerting.destinations.pagerduty.link(
       *     '8c71e667571b4f61b94d9e4b12158038',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      link(tokenId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/alerting/v3/destinations/pagerduty/connect/${tokenId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    PagerdutiesSinglePage = class extends SinglePage {
      static {
        __name(this, "PagerdutiesSinglePage");
      }
    };
    PagerdutyResource.PagerdutiesSinglePage = PagerdutiesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/alerting/destinations/webhooks.mjs
var Webhooks, WebhooksSinglePage;
var init_webhooks = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/alerting/destinations/webhooks.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Webhooks = class extends APIResource {
      static {
        __name(this, "Webhooks");
      }
      /**
       * Creates a new webhook destination.
       *
       * @example
       * ```ts
       * const webhook =
       *   await client.alerting.destinations.webhooks.create({
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     name: 'Slack Webhook',
       *     url: 'https://hooks.slack.com/services/Ds3fdBFbV/456464Gdd',
       *   });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/alerting/v3/destinations/webhooks`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Update a webhook destination.
       *
       * @example
       * ```ts
       * const webhook =
       *   await client.alerting.destinations.webhooks.update(
       *     'b115d5ec-15c6-41ee-8b76-92c449b5227b',
       *     {
       *       account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *       name: 'Slack Webhook',
       *       url: 'https://hooks.slack.com/services/Ds3fdBFbV/456464Gdd',
       *     },
       *   );
       * ```
       */
      update(webhookId, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/alerting/v3/destinations/webhooks/${webhookId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Gets a list of all configured webhook destinations.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const webhooks of client.alerting.destinations.webhooks.list(
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/alerting/v3/destinations/webhooks`, WebhooksSinglePage, options);
      }
      /**
       * Delete a configured webhook destination.
       *
       * @example
       * ```ts
       * const webhook =
       *   await client.alerting.destinations.webhooks.delete(
       *     'b115d5ec-15c6-41ee-8b76-92c449b5227b',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      delete(webhookId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/alerting/v3/destinations/webhooks/${webhookId}`, options);
      }
      /**
       * Get details for a single webhooks destination.
       *
       * @example
       * ```ts
       * const webhooks =
       *   await client.alerting.destinations.webhooks.get(
       *     'b115d5ec-15c6-41ee-8b76-92c449b5227b',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      get(webhookId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/alerting/v3/destinations/webhooks/${webhookId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    WebhooksSinglePage = class extends SinglePage {
      static {
        __name(this, "WebhooksSinglePage");
      }
    };
    Webhooks.WebhooksSinglePage = WebhooksSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/alerting/destinations/destinations.mjs
var Destinations;
var init_destinations = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/alerting/destinations/destinations.mjs"() {
    init_import_meta_url();
    init_resource();
    init_eligible();
    init_eligible();
    init_pagerduty();
    init_pagerduty();
    init_webhooks();
    init_webhooks();
    Destinations = class extends APIResource {
      static {
        __name(this, "Destinations");
      }
      constructor() {
        super(...arguments);
        this.eligible = new Eligible(this._client);
        this.pagerduty = new PagerdutyResource(this._client);
        this.webhooks = new Webhooks(this._client);
      }
    };
    Destinations.Eligible = Eligible;
    Destinations.PagerdutyResource = PagerdutyResource;
    Destinations.PagerdutiesSinglePage = PagerdutiesSinglePage;
    Destinations.WebhooksSinglePage = WebhooksSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/alerting/alerting.mjs
var Alerting;
var init_alerting = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/alerting/alerting.mjs"() {
    init_import_meta_url();
    init_resource();
    init_available_alerts();
    init_available_alerts();
    init_history();
    init_history();
    init_policies();
    init_policies();
    init_destinations();
    init_destinations();
    Alerting = class extends APIResource {
      static {
        __name(this, "Alerting");
      }
      constructor() {
        super(...arguments);
        this.availableAlerts = new AvailableAlerts(this._client);
        this.destinations = new Destinations(this._client);
        this.history = new HistoryResource(this._client);
        this.policies = new Policies(this._client);
      }
    };
    Alerting.AvailableAlerts = AvailableAlerts;
    Alerting.Destinations = Destinations;
    Alerting.HistoryResource = HistoryResource;
    Alerting.HistoriesV4PagePaginationArray = HistoriesV4PagePaginationArray;
    Alerting.Policies = Policies;
    Alerting.PoliciesSinglePage = PoliciesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/argo/smart-routing.mjs
var SmartRouting;
var init_smart_routing = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/argo/smart-routing.mjs"() {
    init_import_meta_url();
    init_resource();
    SmartRouting = class extends APIResource {
      static {
        __name(this, "SmartRouting");
      }
      /**
       * Configures the value of the Argo Smart Routing enablement setting.
       *
       * @example
       * ```ts
       * const response = await client.argo.smartRouting.edit({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   value: 'on',
       * });
       * ```
       */
      edit(params, options) {
        const { zone_id, ...body } = params;
        return this._client.patch(`/zones/${zone_id}/argo/smart_routing`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Retrieves the value of Argo Smart Routing enablement setting.
       *
       * @example
       * ```ts
       * const smartRouting = await client.argo.smartRouting.get({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      get(params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/argo/smart_routing`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/argo/tiered-caching.mjs
var TieredCaching;
var init_tiered_caching = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/argo/tiered-caching.mjs"() {
    init_import_meta_url();
    init_resource();
    TieredCaching = class extends APIResource {
      static {
        __name(this, "TieredCaching");
      }
      /**
       * Tiered Cache works by dividing Cloudflare's data centers into a hierarchy of
       * lower-tiers and upper-tiers. If content is not cached in lower-tier data centers
       * (generally the ones closest to a visitor), the lower-tier must ask an upper-tier
       * to see if it has the content. If the upper-tier does not have the content, only
       * the upper-tier can ask the origin for content. This practice improves bandwidth
       * efficiency by limiting the number of data centers that can ask the origin for
       * content, which reduces origin load and makes websites more cost-effective to
       * operate. Additionally, Tiered Cache concentrates connections to origin servers
       * so they come from a small number of data centers rather than the full set of
       * network locations. This results in fewer open connections using server
       * resources.
       *
       * @example
       * ```ts
       * const response = await client.argo.tieredCaching.edit({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   value: 'on',
       * });
       * ```
       */
      edit(params, options) {
        const { zone_id, ...body } = params;
        return this._client.patch(`/zones/${zone_id}/argo/tiered_caching`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Tiered Cache works by dividing Cloudflare's data centers into a hierarchy of
       * lower-tiers and upper-tiers. If content is not cached in lower-tier data centers
       * (generally the ones closest to a visitor), the lower-tier must ask an upper-tier
       * to see if it has the content. If the upper-tier does not have the content, only
       * the upper-tier can ask the origin for content. This practice improves bandwidth
       * efficiency by limiting the number of data centers that can ask the origin for
       * content, which reduces origin load and makes websites more cost-effective to
       * operate. Additionally, Tiered Cache concentrates connections to origin servers
       * so they come from a small number of data centers rather than the full set of
       * network locations. This results in fewer open connections using server
       * resources.
       *
       * @example
       * ```ts
       * const tieredCaching = await client.argo.tieredCaching.get({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      get(params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/argo/tiered_caching`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/argo/argo.mjs
var Argo;
var init_argo = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/argo/argo.mjs"() {
    init_import_meta_url();
    init_resource();
    init_smart_routing();
    init_smart_routing();
    init_tiered_caching();
    init_tiered_caching();
    Argo = class extends APIResource {
      static {
        __name(this, "Argo");
      }
      constructor() {
        super(...arguments);
        this.smartRouting = new SmartRouting(this._client);
        this.tieredCaching = new TieredCaching(this._client);
      }
    };
    Argo.SmartRouting = SmartRouting;
    Argo.TieredCaching = TieredCaching;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/audit-logs.mjs
var AuditLogs;
var init_audit_logs = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/audit-logs.mjs"() {
    init_import_meta_url();
    init_resource();
    init_shared();
    AuditLogs = class extends APIResource {
      static {
        __name(this, "AuditLogs");
      }
      /**
       * Gets a list of audit logs for an account. Can be filtered by who made the
       * change, on which zone, and the timeframe of the change.
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/audit_logs`, AuditLogsV4PagePaginationArray, {
          query,
          ...options
        });
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/billing/profiles.mjs
var Profiles;
var init_profiles = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/billing/profiles.mjs"() {
    init_import_meta_url();
    init_resource();
    Profiles = class extends APIResource {
      static {
        __name(this, "Profiles");
      }
      /**
       * Gets the current billing profile for the account.
       *
       * @deprecated
       */
      get(params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/billing/profile`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/billing/billing.mjs
var Billing;
var init_billing = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/billing/billing.mjs"() {
    init_import_meta_url();
    init_resource();
    init_profiles();
    init_profiles();
    Billing = class extends APIResource {
      static {
        __name(this, "Billing");
      }
      constructor() {
        super(...arguments);
        this.profiles = new Profiles(this._client);
      }
    };
    Billing.Profiles = Profiles;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/bot-management.mjs
var BotManagement;
var init_bot_management = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/bot-management.mjs"() {
    init_import_meta_url();
    init_resource();
    BotManagement = class extends APIResource {
      static {
        __name(this, "BotManagement");
      }
      /**
       * Updates the Bot Management configuration for a zone.
       *
       * This API is used to update:
       *
       * - **Bot Fight Mode**
       * - **Super Bot Fight Mode**
       * - **Bot Management for Enterprise**
       *
       * See [Bot Plans](https://developers.cloudflare.com/bots/plans/) for more
       * information on the different plans \
       * If you recently upgraded or downgraded your plan, refer to the following examples
       * to clean up old configurations. Copy and paste the example body to remove old zone
       * configurations based on your current plan.
       *
       * #### Clean up configuration for Bot Fight Mode plan
       *
       * ```json
       * {
       *   "sbfm_likely_automated": "allow",
       *   "sbfm_definitely_automated": "allow",
       *   "sbfm_verified_bots": "allow",
       *   "sbfm_static_resource_protection": false,
       *   "optimize_wordpress": false,
       *   "suppress_session_score": false
       * }
       * ```
       *
       * #### Clean up configuration for SBFM Pro plan
       *
       * ```json
       * {
       *   "sbfm_likely_automated": "allow",
       *   "fight_mode": false
       * }
       * ```
       *
       * #### Clean up configuration for SBFM Biz plan
       *
       * ```json
       * {
       *   "fight_mode": false
       * }
       * ```
       *
       * #### Clean up configuration for BM Enterprise Subscription plan
       *
       * It is strongly recommended that you ensure you have
       * [custom rules](https://developers.cloudflare.com/waf/custom-rules/) in place to
       * protect your zone before disabling the SBFM rules. Without these protections,
       * your zone is vulnerable to attacks.
       *
       * ```json
       * {
       *   "sbfm_likely_automated": "allow",
       *   "sbfm_definitely_automated": "allow",
       *   "sbfm_verified_bots": "allow",
       *   "sbfm_static_resource_protection": false,
       *   "optimize_wordpress": false,
       *   "fight_mode": false
       * }
       * ```
       *
       * @example
       * ```ts
       * const botManagement = await client.botManagement.update({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   ai_bots_protection: 'disabled',
       *   cf_robots_variant: 'off',
       *   crawler_protection: 'disabled',
       *   enable_js: true,
       *   fight_mode: true,
       * });
       * ```
       */
      update(params, options) {
        const { zone_id, ...body } = params;
        return this._client.put(`/zones/${zone_id}/bot_management`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Retrieve a zone's Bot Management Config
       *
       * @example
       * ```ts
       * const botManagement = await client.botManagement.get({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      get(params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/bot_management`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/botnet-feed/asn.mjs
var ASN;
var init_asn = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/botnet-feed/asn.mjs"() {
    init_import_meta_url();
    init_resource();
    ASN = class extends APIResource {
      static {
        __name(this, "ASN");
      }
      /**
       * Gets all the data the botnet tracking database has for a given ASN registered to
       * user account for given date. If no date is given, it will return results for the
       * previous day.
       */
      dayReport(asnId, params, options) {
        const { account_id, ...query } = params;
        return this._client.get(`/accounts/${account_id}/botnet_feed/asn/${asnId}/day_report`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Gets all the data the botnet threat feed tracking database has for a given ASN
       * registered to user account.
       */
      fullReport(asnId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/botnet_feed/asn/${asnId}/full_report`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/botnet-feed/configs/asn.mjs
var ASN2;
var init_asn2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/botnet-feed/configs/asn.mjs"() {
    init_import_meta_url();
    init_resource();
    ASN2 = class extends APIResource {
      static {
        __name(this, "ASN");
      }
      /**
       * Delete an ASN from botnet threat feed for a given user.
       */
      delete(asnId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/botnet_feed/configs/asn/${asnId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Gets a list of all ASNs registered for a user for the DDoS Botnet Feed API.
       */
      get(params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/botnet_feed/configs/asn`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/botnet-feed/configs/configs.mjs
var Configs;
var init_configs = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/botnet-feed/configs/configs.mjs"() {
    init_import_meta_url();
    init_resource();
    init_asn2();
    init_asn2();
    Configs = class extends APIResource {
      static {
        __name(this, "Configs");
      }
      constructor() {
        super(...arguments);
        this.asn = new ASN2(this._client);
      }
    };
    Configs.ASN = ASN2;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/botnet-feed/botnet-feed.mjs
var BotnetFeed;
var init_botnet_feed = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/botnet-feed/botnet-feed.mjs"() {
    init_import_meta_url();
    init_resource();
    init_asn();
    init_asn();
    init_configs();
    init_configs();
    BotnetFeed = class extends APIResource {
      static {
        __name(this, "BotnetFeed");
      }
      constructor() {
        super(...arguments);
        this.asn = new ASN(this._client);
        this.configs = new Configs(this._client);
      }
    };
    BotnetFeed.ASN = ASN;
    BotnetFeed.Configs = Configs;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/brand-protection/logo-matches.mjs
var LogoMatches;
var init_logo_matches = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/brand-protection/logo-matches.mjs"() {
    init_import_meta_url();
    init_resource();
    LogoMatches = class extends APIResource {
      static {
        __name(this, "LogoMatches");
      }
      /**
       * Return matches as CSV for logo queries based on ID
       */
      download(params, options) {
        const { account_id, ...query } = params;
        return this._client.get(`/accounts/${account_id}/brand-protection/logo-matches/download`, {
          query,
          ...options
        });
      }
      /**
       * Return matches for logo queries based on ID
       */
      get(params, options) {
        const { account_id, ...query } = params;
        return this._client.get(`/accounts/${account_id}/brand-protection/logo-matches`, { query, ...options });
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/brand-protection/logos.mjs
var Logos;
var init_logos = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/brand-protection/logos.mjs"() {
    init_import_meta_url();
    init_resource();
    Logos = class extends APIResource {
      static {
        __name(this, "Logos");
      }
      /**
       * Return new saved logo queries created from image files
       */
      create(params, options) {
        const { account_id, match_type, tag, threshold, ...body } = params;
        return this._client.post(`/accounts/${account_id}/brand-protection/logos`, {
          query: { match_type, tag, threshold },
          body,
          ...options,
          headers: { "Content-Type": "application/x-www-form-urlencoded", ...options?.headers }
        });
      }
      /**
       * Return a success message after deleting saved logo queries by ID
       */
      delete(logoId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/brand-protection/logos/${logoId}`, {
          ...options,
          headers: { Accept: "*/*", ...options?.headers }
        });
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/brand-protection/matches.mjs
var Matches;
var init_matches = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/brand-protection/matches.mjs"() {
    init_import_meta_url();
    init_resource();
    Matches = class extends APIResource {
      static {
        __name(this, "Matches");
      }
      /**
       * Return matches as CSV for string queries based on ID
       */
      download(params, options) {
        const { account_id, ...query } = params;
        return this._client.get(`/accounts/${account_id}/brand-protection/matches/download`, {
          query,
          ...options
        });
      }
      /**
       * Return matches for string queries based on ID
       */
      get(params, options) {
        const { account_id, ...query } = params;
        return this._client.get(`/accounts/${account_id}/brand-protection/matches`, { query, ...options });
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/brand-protection/queries.mjs
var Queries;
var init_queries = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/brand-protection/queries.mjs"() {
    init_import_meta_url();
    init_resource();
    Queries = class extends APIResource {
      static {
        __name(this, "Queries");
      }
      /**
       * Return a success message after creating new saved string queries
       */
      create(params, options) {
        const { account_id, id, query_scan, query_tag, ...body } = params;
        return this._client.post(`/accounts/${account_id}/brand-protection/queries`, {
          query: { id, scan: query_scan, tag: query_tag },
          body,
          ...options,
          headers: { Accept: "*/*", ...options?.headers }
        });
      }
      /**
       * Return a success message after deleting saved string queries by ID
       */
      delete(params, options) {
        const { account_id, id, scan, tag } = params;
        return this._client.delete(`/accounts/${account_id}/brand-protection/queries`, {
          query: { id, scan, tag },
          ...options,
          headers: { Accept: "*/*", ...options?.headers }
        });
      }
      /**
       * Return a success message after creating new saved string queries in bulk
       */
      bulk(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/brand-protection/queries/bulk`, {
          body,
          ...options,
          headers: { Accept: "*/*", ...options?.headers }
        });
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/brand-protection/brand-protection.mjs
var BrandProtection, BrandProtectionURLInfoResponsesSinglePage;
var init_brand_protection = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/brand-protection/brand-protection.mjs"() {
    init_import_meta_url();
    init_resource();
    init_logo_matches();
    init_logo_matches();
    init_logos();
    init_logos();
    init_matches();
    init_matches();
    init_queries();
    init_queries();
    init_pagination();
    BrandProtection = class extends APIResource {
      static {
        __name(this, "BrandProtection");
      }
      constructor() {
        super(...arguments);
        this.queries = new Queries(this._client);
        this.matches = new Matches(this._client);
        this.logos = new Logos(this._client);
        this.logoMatches = new LogoMatches(this._client);
      }
      /**
       * Return new URL submissions
       */
      submit(params, options) {
        const { account_id } = params;
        return this._client.post(`/accounts/${account_id}/brand-protection/submit`, options);
      }
      /**
       * Return submitted URLs based on ID
       */
      urlInfo(params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/brand-protection/url-info`, BrandProtectionURLInfoResponsesSinglePage, options);
      }
    };
    BrandProtectionURLInfoResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "BrandProtectionURLInfoResponsesSinglePage");
      }
    };
    BrandProtection.BrandProtectionURLInfoResponsesSinglePage = BrandProtectionURLInfoResponsesSinglePage;
    BrandProtection.Queries = Queries;
    BrandProtection.Matches = Matches;
    BrandProtection.Logos = Logos;
    BrandProtection.LogoMatches = LogoMatches;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/browser-rendering/content.mjs
var Content;
var init_content = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/browser-rendering/content.mjs"() {
    init_import_meta_url();
    init_resource();
    Content = class extends APIResource {
      static {
        __name(this, "Content");
      }
      /**
       * Fetches rendered HTML content from provided URL or HTML. Check available options
       * like `gotoOptions` and `waitFor*` to control page load behaviour.
       */
      create(params, options) {
        const { account_id, cacheTTL, ...body } = params;
        return this._client.post(`/accounts/${account_id}/browser-rendering/content`, {
          query: { cacheTTL },
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/browser-rendering/json.mjs
var Json;
var init_json = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/browser-rendering/json.mjs"() {
    init_import_meta_url();
    init_resource();
    Json = class extends APIResource {
      static {
        __name(this, "Json");
      }
      /**
       * Gets json from a webpage from a provided URL or HTML. Pass `prompt` or `schema`
       * in the body. Control page loading with `gotoOptions` and `waitFor*` options.
       */
      create(params, options) {
        const { account_id, cacheTTL, ...body } = params;
        return this._client.post(`/accounts/${account_id}/browser-rendering/json`, {
          query: { cacheTTL },
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/browser-rendering/links.mjs
var Links;
var init_links = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/browser-rendering/links.mjs"() {
    init_import_meta_url();
    init_resource();
    Links = class extends APIResource {
      static {
        __name(this, "Links");
      }
      /**
       * Get links from a web page.
       */
      create(params, options) {
        const { account_id, cacheTTL, ...body } = params;
        return this._client.post(`/accounts/${account_id}/browser-rendering/links`, {
          query: { cacheTTL },
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/browser-rendering/markdown.mjs
var Markdown;
var init_markdown = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/browser-rendering/markdown.mjs"() {
    init_import_meta_url();
    init_resource();
    Markdown = class extends APIResource {
      static {
        __name(this, "Markdown");
      }
      /**
       * Gets markdown of a webpage from provided URL or HTML. Control page loading with
       * `gotoOptions` and `waitFor*` options.
       */
      create(params, options) {
        const { account_id, cacheTTL, ...body } = params;
        return this._client.post(`/accounts/${account_id}/browser-rendering/markdown`, {
          query: { cacheTTL },
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/browser-rendering/pdf.mjs
var PDF;
var init_pdf = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/browser-rendering/pdf.mjs"() {
    init_import_meta_url();
    init_resource();
    PDF = class extends APIResource {
      static {
        __name(this, "PDF");
      }
      /**
       * Fetches rendered PDF from provided URL or HTML. Check available options like
       * `gotoOptions` and `waitFor*` to control page load behaviour.
       */
      create(params, options) {
        const { account_id, cacheTTL, ...body } = params;
        return this._client.post(`/accounts/${account_id}/browser-rendering/pdf`, {
          query: { cacheTTL },
          body,
          ...options,
          headers: { Accept: "application/pdf", ...options?.headers },
          __binaryResponse: true
        });
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/browser-rendering/scrape.mjs
var Scrape;
var init_scrape = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/browser-rendering/scrape.mjs"() {
    init_import_meta_url();
    init_resource();
    Scrape = class extends APIResource {
      static {
        __name(this, "Scrape");
      }
      /**
       * Get meta attributes like height, width, text and others of selected elements.
       */
      create(params, options) {
        const { account_id, cacheTTL, ...body } = params;
        return this._client.post(`/accounts/${account_id}/browser-rendering/scrape`, {
          query: { cacheTTL },
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/browser-rendering/screenshot.mjs
var Screenshot;
var init_screenshot = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/browser-rendering/screenshot.mjs"() {
    init_import_meta_url();
    init_resource();
    Screenshot = class extends APIResource {
      static {
        __name(this, "Screenshot");
      }
      /**
       * Takes a screenshot of a webpage from provided URL or HTML. Control page loading
       * with `gotoOptions` and `waitFor*` options. Customize screenshots with
       * `viewport`, `fullPage`, `clip` and others.
       */
      create(params, options) {
        const { account_id, cacheTTL, ...body } = params;
        return this._client.post(`/accounts/${account_id}/browser-rendering/screenshot`, {
          query: { cacheTTL },
          body,
          ...options
        });
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/browser-rendering/snapshot.mjs
var Snapshot;
var init_snapshot = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/browser-rendering/snapshot.mjs"() {
    init_import_meta_url();
    init_resource();
    Snapshot = class extends APIResource {
      static {
        __name(this, "Snapshot");
      }
      /**
       * Returns the page's HTML content and screenshot. Control page loading with
       * `gotoOptions` and `waitFor*` options. Customize screenshots with `viewport`,
       * `fullPage`, `clip` and others.
       */
      create(params, options) {
        const { account_id, cacheTTL, ...body } = params;
        return this._client.post(`/accounts/${account_id}/browser-rendering/snapshot`, {
          query: { cacheTTL },
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/browser-rendering/browser-rendering.mjs
var BrowserRendering;
var init_browser_rendering = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/browser-rendering/browser-rendering.mjs"() {
    init_import_meta_url();
    init_resource();
    init_content();
    init_content();
    init_json();
    init_json();
    init_links();
    init_links();
    init_markdown();
    init_markdown();
    init_pdf();
    init_pdf();
    init_scrape();
    init_scrape();
    init_screenshot();
    init_screenshot();
    init_snapshot();
    init_snapshot();
    BrowserRendering = class extends APIResource {
      static {
        __name(this, "BrowserRendering");
      }
      constructor() {
        super(...arguments);
        this.content = new Content(this._client);
        this.pdf = new PDF(this._client);
        this.scrape = new Scrape(this._client);
        this.screenshot = new Screenshot(this._client);
        this.snapshot = new Snapshot(this._client);
        this.json = new Json(this._client);
        this.links = new Links(this._client);
        this.markdown = new Markdown(this._client);
      }
    };
    BrowserRendering.Content = Content;
    BrowserRendering.PDF = PDF;
    BrowserRendering.Scrape = Scrape;
    BrowserRendering.Screenshot = Screenshot;
    BrowserRendering.Snapshot = Snapshot;
    BrowserRendering.Json = Json;
    BrowserRendering.Links = Links;
    BrowserRendering.Markdown = Markdown;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/cache/cache-reserve.mjs
var CacheReserveResource;
var init_cache_reserve = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/cache/cache-reserve.mjs"() {
    init_import_meta_url();
    init_resource();
    CacheReserveResource = class extends APIResource {
      static {
        __name(this, "CacheReserveResource");
      }
      /**
       * You can use Cache Reserve Clear to clear your Cache Reserve, but you must first
       * disable Cache Reserve. In most cases, this will be accomplished within 24 hours.
       * You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind
       * that you cannot undo or cancel this operation.
       *
       * @example
       * ```ts
       * const response = await client.cache.cacheReserve.clear({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   body: {},
       * });
       * ```
       */
      clear(params, options) {
        const { zone_id, body } = params;
        return this._client.post(`/zones/${zone_id}/cache/cache_reserve_clear`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Increase cache lifetimes by automatically storing all cacheable files into
       * Cloudflare's persistent object storage buckets. Requires Cache Reserve
       * subscription. Note: using Tiered Cache with Cache Reserve is highly recommended
       * to reduce Reserve operations costs. See the
       * [developer docs](https://developers.cloudflare.com/cache/about/cache-reserve)
       * for more information.
       *
       * @example
       * ```ts
       * const response = await client.cache.cacheReserve.edit({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   value: 'on',
       * });
       * ```
       */
      edit(params, options) {
        const { zone_id, ...body } = params;
        return this._client.patch(`/zones/${zone_id}/cache/cache_reserve`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Increase cache lifetimes by automatically storing all cacheable files into
       * Cloudflare's persistent object storage buckets. Requires Cache Reserve
       * subscription. Note: using Tiered Cache with Cache Reserve is highly recommended
       * to reduce Reserve operations costs. See the
       * [developer docs](https://developers.cloudflare.com/cache/about/cache-reserve)
       * for more information.
       *
       * @example
       * ```ts
       * const cacheReserve = await client.cache.cacheReserve.get({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      get(params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/cache/cache_reserve`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * You can use Cache Reserve Clear to clear your Cache Reserve, but you must first
       * disable Cache Reserve. In most cases, this will be accomplished within 24 hours.
       * You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind
       * that you cannot undo or cancel this operation.
       *
       * @example
       * ```ts
       * const response = await client.cache.cacheReserve.status({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      status(params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/cache/cache_reserve_clear`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/cache/regional-tiered-cache.mjs
var RegionalTieredCacheResource;
var init_regional_tiered_cache = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/cache/regional-tiered-cache.mjs"() {
    init_import_meta_url();
    init_resource();
    RegionalTieredCacheResource = class extends APIResource {
      static {
        __name(this, "RegionalTieredCacheResource");
      }
      /**
       * Instructs Cloudflare to check a regional hub data center on the way to your
       * upper tier. This can help improve performance for smart and custom tiered cache
       * topologies.
       *
       * @example
       * ```ts
       * const response =
       *   await client.cache.regionalTieredCache.edit({
       *     zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     value: 'on',
       *   });
       * ```
       */
      edit(params, options) {
        const { zone_id, ...body } = params;
        return this._client.patch(`/zones/${zone_id}/cache/regional_tiered_cache`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Instructs Cloudflare to check a regional hub data center on the way to your
       * upper tier. This can help improve performance for smart and custom tiered cache
       * topologies.
       *
       * @example
       * ```ts
       * const regionalTieredCache =
       *   await client.cache.regionalTieredCache.get({
       *     zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   });
       * ```
       */
      get(params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/cache/regional_tiered_cache`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/cache/smart-tiered-cache.mjs
var SmartTieredCache;
var init_smart_tiered_cache = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/cache/smart-tiered-cache.mjs"() {
    init_import_meta_url();
    init_resource();
    SmartTieredCache = class extends APIResource {
      static {
        __name(this, "SmartTieredCache");
      }
      /**
       * Smart Tiered Cache dynamically selects the single closest upper tier for each of
       * your website’s origins with no configuration required, using our in-house
       * performance and routing data. Cloudflare collects latency data for each request
       * to an origin, and uses the latency data to determine how well any upper-tier
       * data center is connected with an origin. As a result, Cloudflare can select the
       * data center with the lowest latency to be the upper-tier for an origin.
       *
       * @example
       * ```ts
       * const smartTieredCache =
       *   await client.cache.smartTieredCache.delete({
       *     zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   });
       * ```
       */
      delete(params, options) {
        const { zone_id } = params;
        return this._client.delete(`/zones/${zone_id}/cache/tiered_cache_smart_topology_enable`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Smart Tiered Cache dynamically selects the single closest upper tier for each of
       * your website’s origins with no configuration required, using our in-house
       * performance and routing data. Cloudflare collects latency data for each request
       * to an origin, and uses the latency data to determine how well any upper-tier
       * data center is connected with an origin. As a result, Cloudflare can select the
       * data center with the lowest latency to be the upper-tier for an origin.
       *
       * @example
       * ```ts
       * const response = await client.cache.smartTieredCache.edit({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   value: 'on',
       * });
       * ```
       */
      edit(params, options) {
        const { zone_id, ...body } = params;
        return this._client.patch(`/zones/${zone_id}/cache/tiered_cache_smart_topology_enable`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Smart Tiered Cache dynamically selects the single closest upper tier for each of
       * your website’s origins with no configuration required, using our in-house
       * performance and routing data. Cloudflare collects latency data for each request
       * to an origin, and uses the latency data to determine how well any upper-tier
       * data center is connected with an origin. As a result, Cloudflare can select the
       * data center with the lowest latency to be the upper-tier for an origin.
       *
       * @example
       * ```ts
       * const smartTieredCache =
       *   await client.cache.smartTieredCache.get({
       *     zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   });
       * ```
       */
      get(params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/cache/tiered_cache_smart_topology_enable`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/cache/variants.mjs
var Variants;
var init_variants = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/cache/variants.mjs"() {
    init_import_meta_url();
    init_resource();
    Variants = class extends APIResource {
      static {
        __name(this, "Variants");
      }
      /**
       * Variant support enables caching variants of images with certain file extensions
       * in addition to the original. This only applies when the origin server sends the
       * 'Vary: Accept' response header. If the origin server sends 'Vary: Accept' but
       * does not serve the variant requested, the response will not be cached. This will
       * be indicated with BYPASS cache status in the response headers.
       *
       * @example
       * ```ts
       * const variant = await client.cache.variants.delete({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      delete(params, options) {
        const { zone_id } = params;
        return this._client.delete(`/zones/${zone_id}/cache/variants`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Variant support enables caching variants of images with certain file extensions
       * in addition to the original. This only applies when the origin server sends the
       * 'Vary: Accept' response header. If the origin server sends 'Vary: Accept' but
       * does not serve the variant requested, the response will not be cached. This will
       * be indicated with BYPASS cache status in the response headers.
       *
       * @example
       * ```ts
       * const response = await client.cache.variants.edit({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   value: {},
       * });
       * ```
       */
      edit(params, options) {
        const { zone_id, ...body } = params;
        return this._client.patch(`/zones/${zone_id}/cache/variants`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Variant support enables caching variants of images with certain file extensions
       * in addition to the original. This only applies when the origin server sends the
       * 'Vary: Accept' response header. If the origin server sends 'Vary: Accept' but
       * does not serve the variant requested, the response will not be cached. This will
       * be indicated with BYPASS cache status in the response headers.
       *
       * @example
       * ```ts
       * const variant = await client.cache.variants.get({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      get(params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/cache/variants`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/cache/cache.mjs
var Cache;
var init_cache = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/cache/cache.mjs"() {
    init_import_meta_url();
    init_resource();
    init_cache_reserve();
    init_cache_reserve();
    init_regional_tiered_cache();
    init_regional_tiered_cache();
    init_smart_tiered_cache();
    init_smart_tiered_cache();
    init_variants();
    init_variants();
    Cache = class extends APIResource {
      static {
        __name(this, "Cache");
      }
      constructor() {
        super(...arguments);
        this.cacheReserve = new CacheReserveResource(this._client);
        this.smartTieredCache = new SmartTieredCache(this._client);
        this.variants = new Variants(this._client);
        this.regionalTieredCache = new RegionalTieredCacheResource(this._client);
      }
      /**
       * ### Purge All Cached Content
       *
       * Removes ALL files from Cloudflare's cache. All tiers can purge everything.
       *
       * ```
       * {"purge_everything": true}
       * ```
       *
       * ### Purge Cached Content by URL
       *
       * Granularly removes one or more files from Cloudflare's cache by specifying URLs.
       * All tiers can purge by URL.
       *
       * To purge files with custom cache keys, include the headers used to compute the
       * cache key as in the example. If you have a device type or geo in your cache key,
       * you will need to include the CF-Device-Type or CF-IPCountry headers. If you have
       * lang in your cache key, you will need to include the Accept-Language header.
       *
       * **NB:** When including the Origin header, be sure to include the **scheme** and
       * **hostname**. The port number can be omitted if it is the default port (80 for
       * http, 443 for https), but must be included otherwise.
       *
       * Single file purge example with files:
       *
       * ```
       * {"files": ["http://www.example.com/css/styles.css", "http://www.example.com/js/index.js"]}
       * ```
       *
       * Single file purge example with url and header pairs:
       *
       * ```
       * {"files": [{url: "http://www.example.com/cat_picture.jpg", headers: { "CF-IPCountry": "US", "CF-Device-Type": "desktop", "Accept-Language": "zh-CN" }}, {url: "http://www.example.com/dog_picture.jpg", headers: { "CF-IPCountry": "EU", "CF-Device-Type": "mobile", "Accept-Language": "en-US" }}]}
       * ```
       *
       * ### Purge Cached Content by Tag, Host or Prefix
       *
       * Granularly removes one or more files from Cloudflare's cache either by
       * specifying the host, the associated Cache-Tag, or a Prefix.
       *
       * Flex purge with tags:
       *
       * ```
       * {"tags": ["a-cache-tag", "another-cache-tag"]}
       * ```
       *
       * Flex purge with hosts:
       *
       * ```
       * {"hosts": ["www.example.com", "images.example.com"]}
       * ```
       *
       * Flex purge with prefixes:
       *
       * ```
       * {"prefixes": ["www.example.com/foo", "images.example.com/bar/baz"]}
       * ```
       *
       * ### Availability and limits
       *
       * please refer to
       * [purge cache availability and limits documentation page](https://developers.cloudflare.com/cache/how-to/purge-cache/#availability-and-limits).
       *
       * @example
       * ```ts
       * const response = await client.cache.purge({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      purge(params, options) {
        const { zone_id, ...body } = params;
        return this._client.post(`/zones/${zone_id}/purge_cache`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
    };
    Cache.CacheReserveResource = CacheReserveResource;
    Cache.SmartTieredCache = SmartTieredCache;
    Cache.Variants = Variants;
    Cache.RegionalTieredCacheResource = RegionalTieredCacheResource;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/calls/sfu.mjs
var SFU, SFUListResponsesSinglePage;
var init_sfu = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/calls/sfu.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    SFU = class extends APIResource {
      static {
        __name(this, "SFU");
      }
      /**
       * Creates a new Cloudflare calls app. An app is an unique enviroment where each
       * Session can access all Tracks within the app.
       *
       * @example
       * ```ts
       * const sfu = await client.calls.sfu.create({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/calls/apps`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Edit details for a single app.
       *
       * @example
       * ```ts
       * const sfu = await client.calls.sfu.update(
       *   '2a95132c15732412d22c1476fa83f27a',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      update(appId, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/calls/apps/${appId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Lists all apps in the Cloudflare account
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const sfuListResponse of client.calls.sfu.list({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * })) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/calls/apps`, SFUListResponsesSinglePage, options);
      }
      /**
       * Deletes an app from Cloudflare Calls
       *
       * @example
       * ```ts
       * const sfu = await client.calls.sfu.delete(
       *   '2a95132c15732412d22c1476fa83f27a',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      delete(appId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/calls/apps/${appId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetches details for a single Calls app.
       *
       * @example
       * ```ts
       * const sfu = await client.calls.sfu.get(
       *   '2a95132c15732412d22c1476fa83f27a',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(appId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/calls/apps/${appId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    SFUListResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "SFUListResponsesSinglePage");
      }
    };
    SFU.SFUListResponsesSinglePage = SFUListResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/calls/turn.mjs
var TURN, TURNListResponsesSinglePage;
var init_turn = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/calls/turn.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    TURN = class extends APIResource {
      static {
        __name(this, "TURN");
      }
      /**
       * Creates a new Cloudflare Calls TURN key.
       *
       * @example
       * ```ts
       * const turn = await client.calls.turn.create({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/calls/turn_keys`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Edit details for a single TURN key.
       *
       * @example
       * ```ts
       * const turn = await client.calls.turn.update(
       *   '2a95132c15732412d22c1476fa83f27a',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      update(keyId, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/calls/turn_keys/${keyId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Lists all TURN keys in the Cloudflare account
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const turnListResponse of client.calls.turn.list(
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/calls/turn_keys`, TURNListResponsesSinglePage, options);
      }
      /**
       * Deletes a TURN key from Cloudflare Calls
       *
       * @example
       * ```ts
       * const turn = await client.calls.turn.delete(
       *   '2a95132c15732412d22c1476fa83f27a',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      delete(keyId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/calls/turn_keys/${keyId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetches details for a single TURN key.
       *
       * @example
       * ```ts
       * const turn = await client.calls.turn.get(
       *   '2a95132c15732412d22c1476fa83f27a',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(keyId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/calls/turn_keys/${keyId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    TURNListResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "TURNListResponsesSinglePage");
      }
    };
    TURN.TURNListResponsesSinglePage = TURNListResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/calls/calls.mjs
var Calls;
var init_calls = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/calls/calls.mjs"() {
    init_import_meta_url();
    init_resource();
    init_sfu();
    init_sfu();
    init_turn();
    init_turn();
    Calls = class extends APIResource {
      static {
        __name(this, "Calls");
      }
      constructor() {
        super(...arguments);
        this.sfu = new SFU(this._client);
        this.turn = new TURN(this._client);
      }
    };
    Calls.SFU = SFU;
    Calls.SFUListResponsesSinglePage = SFUListResponsesSinglePage;
    Calls.TURN = TURN;
    Calls.TURNListResponsesSinglePage = TURNListResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/certificate-authorities/hostname-associations.mjs
var HostnameAssociations;
var init_hostname_associations = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/certificate-authorities/hostname-associations.mjs"() {
    init_import_meta_url();
    init_resource();
    HostnameAssociations = class extends APIResource {
      static {
        __name(this, "HostnameAssociations");
      }
      /**
       * Replace Hostname Associations
       */
      update(params, options) {
        const { zone_id, ...body } = params;
        return this._client.put(`/zones/${zone_id}/certificate_authorities/hostname_associations`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List Hostname Associations
       */
      get(params, options) {
        const { zone_id, ...query } = params;
        return this._client.get(`/zones/${zone_id}/certificate_authorities/hostname_associations`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/certificate-authorities/certificate-authorities.mjs
var CertificateAuthorities;
var init_certificate_authorities = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/certificate-authorities/certificate-authorities.mjs"() {
    init_import_meta_url();
    init_resource();
    init_hostname_associations();
    init_hostname_associations();
    CertificateAuthorities = class extends APIResource {
      static {
        __name(this, "CertificateAuthorities");
      }
      constructor() {
        super(...arguments);
        this.hostnameAssociations = new HostnameAssociations(this._client);
      }
    };
    CertificateAuthorities.HostnameAssociations = HostnameAssociations;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/client-certificates.mjs
var ClientCertificates, ClientCertificatesV4PagePaginationArray;
var init_client_certificates = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/client-certificates.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    ClientCertificates = class extends APIResource {
      static {
        __name(this, "ClientCertificates");
      }
      /**
       * Create a new API Shield mTLS Client Certificate
       *
       * @example
       * ```ts
       * const clientCertificate =
       *   await client.clientCertificates.create({
       *     zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     csr: '-----BEGIN CERTIFICATE REQUEST-----\\nMIICY....\\n-----END CERTIFICATE REQUEST-----\\n',
       *     validity_days: 3650,
       *   });
       * ```
       */
      create(params, options) {
        const { zone_id, ...body } = params;
        return this._client.post(`/zones/${zone_id}/client_certificates`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List all of your Zone's API Shield mTLS Client Certificates by Status and/or
       * using Pagination
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const clientCertificate of client.clientCertificates.list(
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { zone_id, ...query } = params;
        return this._client.getAPIList(`/zones/${zone_id}/client_certificates`, ClientCertificatesV4PagePaginationArray, { query, ...options });
      }
      /**
       * Set a API Shield mTLS Client Certificate to pending_revocation status for
       * processing to revoked status.
       *
       * @example
       * ```ts
       * const clientCertificate =
       *   await client.clientCertificates.delete(
       *     '023e105f4ecef8ad9ca31a8372d0c353',
       *     { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      delete(clientCertificateId, params, options) {
        const { zone_id } = params;
        return this._client.delete(`/zones/${zone_id}/client_certificates/${clientCertificateId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * If a API Shield mTLS Client Certificate is in a pending_revocation state, you
       * may reactivate it with this endpoint.
       *
       * @example
       * ```ts
       * const clientCertificate =
       *   await client.clientCertificates.edit(
       *     '023e105f4ecef8ad9ca31a8372d0c353',
       *     { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      edit(clientCertificateId, params, options) {
        const { zone_id } = params;
        return this._client.patch(`/zones/${zone_id}/client_certificates/${clientCertificateId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get Details for a single mTLS API Shield Client Certificate
       *
       * @example
       * ```ts
       * const clientCertificate =
       *   await client.clientCertificates.get(
       *     '023e105f4ecef8ad9ca31a8372d0c353',
       *     { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      get(clientCertificateId, params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/client_certificates/${clientCertificateId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    ClientCertificatesV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "ClientCertificatesV4PagePaginationArray");
      }
    };
    ClientCertificates.ClientCertificatesV4PagePaginationArray = ClientCertificatesV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/cloud-connector/rules.mjs
var Rules, RuleUpdateResponsesSinglePage, RuleListResponsesSinglePage;
var init_rules2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/cloud-connector/rules.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Rules = class extends APIResource {
      static {
        __name(this, "Rules");
      }
      /**
       * Put Rules
       */
      update(params, options) {
        const { zone_id, rules } = params ?? {};
        return this._client.getAPIList(`/zones/${zone_id}/cloud_connector/rules`, RuleUpdateResponsesSinglePage, {
          body: rules,
          method: "put",
          ...options
        });
      }
      /**
       * Rules
       */
      list(params, options) {
        const { zone_id } = params;
        return this._client.getAPIList(`/zones/${zone_id}/cloud_connector/rules`, RuleListResponsesSinglePage, options);
      }
    };
    RuleUpdateResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "RuleUpdateResponsesSinglePage");
      }
    };
    RuleListResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "RuleListResponsesSinglePage");
      }
    };
    Rules.RuleUpdateResponsesSinglePage = RuleUpdateResponsesSinglePage;
    Rules.RuleListResponsesSinglePage = RuleListResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/cloud-connector/cloud-connector.mjs
var CloudConnector;
var init_cloud_connector = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/cloud-connector/cloud-connector.mjs"() {
    init_import_meta_url();
    init_resource();
    init_rules2();
    init_rules2();
    CloudConnector = class extends APIResource {
      static {
        __name(this, "CloudConnector");
      }
      constructor() {
        super(...arguments);
        this.rules = new Rules(this._client);
      }
    };
    CloudConnector.Rules = Rules;
    CloudConnector.RuleUpdateResponsesSinglePage = RuleUpdateResponsesSinglePage;
    CloudConnector.RuleListResponsesSinglePage = RuleListResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/cloudforce-one/binary-storage.mjs
var BinaryStorage;
var init_binary_storage = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/cloudforce-one/binary-storage.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    BinaryStorage = class extends APIResource {
      static {
        __name(this, "BinaryStorage");
      }
      /**
       * Posts a file to Binary Storage
       *
       * @example
       * ```ts
       * const binaryStorage =
       *   await client.cloudforceOne.binaryStorage.create({
       *     account_id: 'account_id',
       *     file: fs.createReadStream('path/to/file'),
       *   });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/cloudforce-one/binary`, multipartFormRequestOptions({ body, ...options }));
      }
      /**
       * Retrieves a file from Binary Storage
       *
       * @example
       * ```ts
       * await client.cloudforceOne.binaryStorage.get('hash', {
       *   account_id: 'account_id',
       * });
       * ```
       */
      get(hash, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/cloudforce-one/binary/${hash}`, {
          ...options,
          headers: { Accept: "*/*", ...options?.headers }
        });
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/cloudforce-one/requests/assets.mjs
var Assets2, AssetCreateResponsesSinglePage, AssetGetResponsesSinglePage;
var init_assets2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/cloudforce-one/requests/assets.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Assets2 = class extends APIResource {
      static {
        __name(this, "Assets");
      }
      /**
       * List Request Assets
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const assetCreateResponse of client.cloudforceOne.requests.assets.create(
       *   'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *   {
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     page: 0,
       *     per_page: 10,
       *   },
       * )) {
       *   // ...
       * }
       * ```
       */
      create(requestId, params, options) {
        const { account_id, ...body } = params;
        return this._client.getAPIList(`/accounts/${account_id}/cloudforce-one/requests/${requestId}/asset`, AssetCreateResponsesSinglePage, { body, method: "post", ...options });
      }
      /**
       * Update a Request Asset
       *
       * @example
       * ```ts
       * const asset =
       *   await client.cloudforceOne.requests.assets.update(
       *     'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *     'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      update(requestId, assetId, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/cloudforce-one/requests/${requestId}/asset/${assetId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Delete a Request Asset
       *
       * @example
       * ```ts
       * const asset =
       *   await client.cloudforceOne.requests.assets.delete(
       *     'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *     'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      delete(requestId, assetId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/cloudforce-one/requests/${requestId}/asset/${assetId}`, options);
      }
      /**
       * Get a Request Asset
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const assetGetResponse of client.cloudforceOne.requests.assets.get(
       *   'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *   'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      get(requestId, assetId, params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/cloudforce-one/requests/${requestId}/asset/${assetId}`, AssetGetResponsesSinglePage, options);
      }
    };
    AssetCreateResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "AssetCreateResponsesSinglePage");
      }
    };
    AssetGetResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "AssetGetResponsesSinglePage");
      }
    };
    Assets2.AssetCreateResponsesSinglePage = AssetCreateResponsesSinglePage;
    Assets2.AssetGetResponsesSinglePage = AssetGetResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/cloudforce-one/requests/message.mjs
var MessageResource, MessagesSinglePage;
var init_message = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/cloudforce-one/requests/message.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    MessageResource = class extends APIResource {
      static {
        __name(this, "MessageResource");
      }
      /**
       * Create a New Request Message
       *
       * @example
       * ```ts
       * const message =
       *   await client.cloudforceOne.requests.message.create(
       *     'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      create(requestId, params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/cloudforce-one/requests/${requestId}/message/new`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Update a Request Message
       *
       * @example
       * ```ts
       * const message =
       *   await client.cloudforceOne.requests.message.update(
       *     'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *     0,
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      update(requestId, messageId, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/cloudforce-one/requests/${requestId}/message/${messageId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Delete a Request Message
       *
       * @example
       * ```ts
       * const message =
       *   await client.cloudforceOne.requests.message.delete(
       *     'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *     0,
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      delete(requestId, messageId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/cloudforce-one/requests/${requestId}/message/${messageId}`, options);
      }
      /**
       * List Request Messages
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const message of client.cloudforceOne.requests.message.get(
       *   'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *   {
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     page: 0,
       *     per_page: 10,
       *   },
       * )) {
       *   // ...
       * }
       * ```
       */
      get(requestId, params, options) {
        const { account_id, ...body } = params;
        return this._client.getAPIList(`/accounts/${account_id}/cloudforce-one/requests/${requestId}/message`, MessagesSinglePage, { body, method: "post", ...options });
      }
    };
    MessagesSinglePage = class extends SinglePage {
      static {
        __name(this, "MessagesSinglePage");
      }
    };
    MessageResource.MessagesSinglePage = MessagesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/cloudforce-one/requests/priority.mjs
var PriorityResource;
var init_priority = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/cloudforce-one/requests/priority.mjs"() {
    init_import_meta_url();
    init_resource();
    PriorityResource = class extends APIResource {
      static {
        __name(this, "PriorityResource");
      }
      /**
       * Create a New Priority Intelligence Requirement
       *
       * @example
       * ```ts
       * const priority =
       *   await client.cloudforceOne.requests.priority.create({
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     labels: ['DoS', 'CVE'],
       *     priority: 1,
       *     requirement: 'DoS attacks carried out by CVEs',
       *     tlp: 'clear',
       *   });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/cloudforce-one/requests/priority/new`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Update a Priority Intelligence Requirement
       *
       * @example
       * ```ts
       * const item =
       *   await client.cloudforceOne.requests.priority.update(
       *     'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *     {
       *       account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *       labels: ['DoS', 'CVE'],
       *       priority: 1,
       *       requirement: 'DoS attacks carried out by CVEs',
       *       tlp: 'clear',
       *     },
       *   );
       * ```
       */
      update(priorityId, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/cloudforce-one/requests/priority/${priorityId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Delete a Priority Intelligence Requirement
       *
       * @example
       * ```ts
       * const priority =
       *   await client.cloudforceOne.requests.priority.delete(
       *     'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      delete(priorityId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/cloudforce-one/requests/priority/${priorityId}`, options);
      }
      /**
       * Get a Priority Intelligence Requirement
       *
       * @example
       * ```ts
       * const item =
       *   await client.cloudforceOne.requests.priority.get(
       *     'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      get(priorityId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/cloudforce-one/requests/priority/${priorityId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get Priority Intelligence Requirement Quota
       *
       * @example
       * ```ts
       * const quota =
       *   await client.cloudforceOne.requests.priority.quota({
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   });
       * ```
       */
      quota(params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/cloudforce-one/requests/priority/quota`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/cloudforce-one/requests/requests.mjs
var Requests, ListItemsSinglePage, RequestTypesResponsesSinglePage;
var init_requests = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/cloudforce-one/requests/requests.mjs"() {
    init_import_meta_url();
    init_resource();
    init_assets2();
    init_assets2();
    init_message();
    init_message();
    init_priority();
    init_priority();
    init_pagination();
    Requests = class extends APIResource {
      static {
        __name(this, "Requests");
      }
      constructor() {
        super(...arguments);
        this.message = new MessageResource(this._client);
        this.priority = new PriorityResource(this._client);
        this.assets = new Assets2(this._client);
      }
      /**
       * Creating a request adds the request into the Cloudforce One queue for analysis.
       * In addition to the content, a short title, type, priority, and releasability
       * should be provided. If one is not provided, a default will be assigned.
       *
       * @example
       * ```ts
       * const item = await client.cloudforceOne.requests.create({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/cloudforce-one/requests/new`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Updating a request alters the request in the Cloudforce One queue. This API may
       * be used to update any attributes of the request after the initial submission.
       * Only fields that you choose to update need to be add to the request body.
       *
       * @example
       * ```ts
       * const item = await client.cloudforceOne.requests.update(
       *   'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      update(requestId, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/cloudforce-one/requests/${requestId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List Requests
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const listItem of client.cloudforceOne.requests.list(
       *   {
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     page: 0,
       *     per_page: 10,
       *   },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id, ...body } = params;
        return this._client.getAPIList(`/accounts/${account_id}/cloudforce-one/requests`, ListItemsSinglePage, {
          body,
          method: "post",
          ...options
        });
      }
      /**
       * Delete a Request
       *
       * @example
       * ```ts
       * const request = await client.cloudforceOne.requests.delete(
       *   'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      delete(requestId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/cloudforce-one/requests/${requestId}`, options);
      }
      /**
       * Get Request Priority, Status, and TLP constants
       *
       * @example
       * ```ts
       * const requestConstants =
       *   await client.cloudforceOne.requests.constants({
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   });
       * ```
       */
      constants(params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/cloudforce-one/requests/constants`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get a Request
       *
       * @example
       * ```ts
       * const item = await client.cloudforceOne.requests.get(
       *   'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(requestId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/cloudforce-one/requests/${requestId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get Request Quota
       *
       * @example
       * ```ts
       * const quota = await client.cloudforceOne.requests.quota({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      quota(params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/cloudforce-one/requests/quota`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get Request Types
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const requestTypesResponse of client.cloudforceOne.requests.types(
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      types(params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/cloudforce-one/requests/types`, RequestTypesResponsesSinglePage, options);
      }
    };
    ListItemsSinglePage = class extends SinglePage {
      static {
        __name(this, "ListItemsSinglePage");
      }
    };
    RequestTypesResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "RequestTypesResponsesSinglePage");
      }
    };
    Requests.ListItemsSinglePage = ListItemsSinglePage;
    Requests.RequestTypesResponsesSinglePage = RequestTypesResponsesSinglePage;
    Requests.MessageResource = MessageResource;
    Requests.MessagesSinglePage = MessagesSinglePage;
    Requests.PriorityResource = PriorityResource;
    Requests.Assets = Assets2;
    Requests.AssetCreateResponsesSinglePage = AssetCreateResponsesSinglePage;
    Requests.AssetGetResponsesSinglePage = AssetGetResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/cloudforce-one/scans/config.mjs
var Config, ConfigListResponsesSinglePage;
var init_config2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/cloudforce-one/scans/config.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Config = class extends APIResource {
      static {
        __name(this, "Config");
      }
      /**
       * Create a new Scan Config
       *
       * @example
       * ```ts
       * const config =
       *   await client.cloudforceOne.scans.config.create({
       *     account_id: 'account_id',
       *     ips: ['1.1.1.1', '2606:4700:4700::1111'],
       *   });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/cloudforce-one/scans/config`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List Scan Configs
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const configListResponse of client.cloudforceOne.scans.config.list(
       *   { account_id: 'account_id' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/cloudforce-one/scans/config`, ConfigListResponsesSinglePage, options);
      }
      /**
       * Delete a Scan Config
       *
       * @example
       * ```ts
       * const config =
       *   await client.cloudforceOne.scans.config.delete(
       *     'config_id',
       *     { account_id: 'account_id' },
       *   );
       * ```
       */
      delete(configId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/cloudforce-one/scans/config/${configId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Update an existing Scan Config
       *
       * @example
       * ```ts
       * const response =
       *   await client.cloudforceOne.scans.config.edit(
       *     'config_id',
       *     { account_id: 'account_id' },
       *   );
       * ```
       */
      edit(configId, params, options) {
        const { account_id, ...body } = params;
        return this._client.patch(`/accounts/${account_id}/cloudforce-one/scans/config/${configId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
    ConfigListResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "ConfigListResponsesSinglePage");
      }
    };
    Config.ConfigListResponsesSinglePage = ConfigListResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/cloudforce-one/scans/results.mjs
var Results;
var init_results = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/cloudforce-one/scans/results.mjs"() {
    init_import_meta_url();
    init_resource();
    Results = class extends APIResource {
      static {
        __name(this, "Results");
      }
      /**
       * Get the Latest Scan Result
       *
       * @example
       * ```ts
       * const result = await client.cloudforceOne.scans.results.get(
       *   'config_id',
       *   { account_id: 'account_id' },
       * );
       * ```
       */
      get(configId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/cloudforce-one/scans/results/${configId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/cloudforce-one/scans/scans.mjs
var Scans;
var init_scans = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/cloudforce-one/scans/scans.mjs"() {
    init_import_meta_url();
    init_resource();
    init_config2();
    init_config2();
    init_results();
    init_results();
    Scans = class extends APIResource {
      static {
        __name(this, "Scans");
      }
      constructor() {
        super(...arguments);
        this.results = new Results(this._client);
        this.config = new Config(this._client);
      }
    };
    Scans.Results = Results;
    Scans.Config = Config;
    Scans.ConfigListResponsesSinglePage = ConfigListResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/cloudforce-one/threat-events/attackers.mjs
var Attackers;
var init_attackers = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/cloudforce-one/threat-events/attackers.mjs"() {
    init_import_meta_url();
    init_resource();
    Attackers = class extends APIResource {
      static {
        __name(this, "Attackers");
      }
      /**
       * Lists attackers
       *
       * @example
       * ```ts
       * const attackers =
       *   await client.cloudforceOne.threatEvents.attackers.list({
       *     account_id: 'account_id',
       *   });
       * ```
       */
      list(params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/cloudforce-one/events/attackers`, options);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/cloudforce-one/threat-events/categories.mjs
var Categories;
var init_categories = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/cloudforce-one/threat-events/categories.mjs"() {
    init_import_meta_url();
    init_resource();
    Categories = class extends APIResource {
      static {
        __name(this, "Categories");
      }
      /**
       * Creates a new category
       *
       * @example
       * ```ts
       * const category =
       *   await client.cloudforceOne.threatEvents.categories.create(
       *     {
       *       account_id: 'account_id',
       *       killChain: 0,
       *       name: 'name',
       *     },
       *   );
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/cloudforce-one/events/categories/create`, {
          body,
          ...options
        });
      }
      /**
       * Lists categories
       *
       * @example
       * ```ts
       * const categories =
       *   await client.cloudforceOne.threatEvents.categories.list({
       *     account_id: 'account_id',
       *   });
       * ```
       */
      list(params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/cloudforce-one/events/categories`, options);
      }
      /**
       * Deletes a category
       *
       * @example
       * ```ts
       * const category =
       *   await client.cloudforceOne.threatEvents.categories.delete(
       *     '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
       *     { account_id: 'account_id' },
       *   );
       * ```
       */
      delete(categoryId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/cloudforce-one/events/categories/${categoryId}`, options);
      }
      /**
       * Updates a category
       *
       * @example
       * ```ts
       * const response =
       *   await client.cloudforceOne.threatEvents.categories.edit(
       *     '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
       *     { account_id: 'account_id' },
       *   );
       * ```
       */
      edit(categoryId, params, options) {
        const { account_id, ...body } = params;
        return this._client.patch(`/accounts/${account_id}/cloudforce-one/events/categories/${categoryId}`, {
          body,
          ...options
        });
      }
      /**
       * Reads a category
       *
       * @example
       * ```ts
       * const category =
       *   await client.cloudforceOne.threatEvents.categories.get(
       *     '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
       *     { account_id: 'account_id' },
       *   );
       * ```
       */
      get(categoryId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/cloudforce-one/events/categories/${categoryId}`, options);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/cloudforce-one/threat-events/countries.mjs
var Countries;
var init_countries = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/cloudforce-one/threat-events/countries.mjs"() {
    init_import_meta_url();
    init_resource();
    Countries = class extends APIResource {
      static {
        __name(this, "Countries");
      }
      /**
       * Retrieves countries information for all countries
       *
       * @example
       * ```ts
       * const countries =
       *   await client.cloudforceOne.threatEvents.countries.list({
       *     account_id: 'account_id',
       *   });
       * ```
       */
      list(params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/cloudforce-one/events/countries`, options);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/cloudforce-one/threat-events/crons.mjs
var Crons;
var init_crons = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/cloudforce-one/threat-events/crons.mjs"() {
    init_import_meta_url();
    init_resource();
    Crons = class extends APIResource {
      static {
        __name(this, "Crons");
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/cloudforce-one/threat-events/event-tags.mjs
var EventTags;
var init_event_tags = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/cloudforce-one/threat-events/event-tags.mjs"() {
    init_import_meta_url();
    init_resource();
    EventTags = class extends APIResource {
      static {
        __name(this, "EventTags");
      }
      /**
       * Adds a tag to an event
       *
       * @example
       * ```ts
       * const eventTag =
       *   await client.cloudforceOne.threatEvents.eventTags.create(
       *     'event_id',
       *     { account_id: 'account_id', tags: ['botnet'] },
       *   );
       * ```
       */
      create(eventId, params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/cloudforce-one/events/event_tag/${eventId}/create`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Removes a tag from an event
       *
       * @example
       * ```ts
       * const eventTag =
       *   await client.cloudforceOne.threatEvents.eventTags.delete(
       *     'event_id',
       *     { account_id: 'account_id' },
       *   );
       * ```
       */
      delete(eventId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/cloudforce-one/events/event_tag/${eventId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/cloudforce-one/threat-events/indicator-types.mjs
var IndicatorTypes;
var init_indicator_types = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/cloudforce-one/threat-events/indicator-types.mjs"() {
    init_import_meta_url();
    init_resource();
    IndicatorTypes = class extends APIResource {
      static {
        __name(this, "IndicatorTypes");
      }
      /**
       * Lists all indicator types
       *
       * @example
       * ```ts
       * const indicatorTypes =
       *   await client.cloudforceOne.threatEvents.indicatorTypes.list(
       *     { account_id: 'account_id' },
       *   );
       * ```
       */
      list(params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/cloudforce-one/events/indicatorTypes`, options);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/cloudforce-one/threat-events/insights.mjs
var Insights;
var init_insights = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/cloudforce-one/threat-events/insights.mjs"() {
    init_import_meta_url();
    init_resource();
    Insights = class extends APIResource {
      static {
        __name(this, "Insights");
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/cloudforce-one/threat-events/raw.mjs
var Raw;
var init_raw = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/cloudforce-one/threat-events/raw.mjs"() {
    init_import_meta_url();
    init_resource();
    Raw = class extends APIResource {
      static {
        __name(this, "Raw");
      }
      /**
       * Updates a raw event
       *
       * @example
       * ```ts
       * const response =
       *   await client.cloudforceOne.threatEvents.raw.edit(
       *     'event_id',
       *     'raw_id',
       *     { account_id: 'account_id' },
       *   );
       * ```
       */
      edit(eventId, rawId, params, options) {
        const { account_id, ...body } = params;
        return this._client.patch(`/accounts/${account_id}/cloudforce-one/events/${eventId}/raw/${rawId}`, {
          body,
          ...options
        });
      }
      /**
       * Reads data for a raw event
       *
       * @example
       * ```ts
       * const raw = await client.cloudforceOne.threatEvents.raw.get(
       *   'event_id',
       *   'raw_id',
       *   { account_id: 'account_id' },
       * );
       * ```
       */
      get(eventId, rawId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/cloudforce-one/events/${eventId}/raw/${rawId}`, options);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/cloudforce-one/threat-events/relate.mjs
var Relate;
var init_relate = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/cloudforce-one/threat-events/relate.mjs"() {
    init_import_meta_url();
    init_resource();
    Relate = class extends APIResource {
      static {
        __name(this, "Relate");
      }
      /**
       * Removes an event reference
       *
       * @example
       * ```ts
       * const relate =
       *   await client.cloudforceOne.threatEvents.relate.delete(
       *     'event_id',
       *     { account_id: 'account_id' },
       *   );
       * ```
       */
      delete(eventId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/cloudforce-one/events/relate/${eventId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/cloudforce-one/threat-events/tags.mjs
var Tags;
var init_tags = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/cloudforce-one/threat-events/tags.mjs"() {
    init_import_meta_url();
    init_resource();
    Tags = class extends APIResource {
      static {
        __name(this, "Tags");
      }
      /**
       * Creates a new tag to be used accross threat events.
       *
       * @example
       * ```ts
       * const tag =
       *   await client.cloudforceOne.threatEvents.tags.create({
       *     account_id: 'account_id',
       *     value: 'APT28',
       *   });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/cloudforce-one/events/tags/create`, {
          body,
          ...options
        });
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/cloudforce-one/threat-events/target-industries.mjs
var TargetIndustries;
var init_target_industries = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/cloudforce-one/threat-events/target-industries.mjs"() {
    init_import_meta_url();
    init_resource();
    TargetIndustries = class extends APIResource {
      static {
        __name(this, "TargetIndustries");
      }
      /**
       * Lists all target industries
       *
       * @example
       * ```ts
       * const targetIndustries =
       *   await client.cloudforceOne.threatEvents.targetIndustries.list(
       *     { account_id: 'account_id' },
       *   );
       * ```
       */
      list(params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/cloudforce-one/events/targetIndustries`, options);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/cloudforce-one/threat-events/datasets/health.mjs
var Health;
var init_health = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/cloudforce-one/threat-events/datasets/health.mjs"() {
    init_import_meta_url();
    init_resource();
    Health = class extends APIResource {
      static {
        __name(this, "Health");
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/cloudforce-one/threat-events/datasets/datasets.mjs
var Datasets2;
var init_datasets2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/cloudforce-one/threat-events/datasets/datasets.mjs"() {
    init_import_meta_url();
    init_resource();
    init_health();
    init_health();
    Datasets2 = class extends APIResource {
      static {
        __name(this, "Datasets");
      }
      constructor() {
        super(...arguments);
        this.health = new Health(this._client);
      }
      /**
       * Creates a dataset
       *
       * @example
       * ```ts
       * const dataset =
       *   await client.cloudforceOne.threatEvents.datasets.create({
       *     account_id: 'account_id',
       *     isPublic: true,
       *     name: 'x',
       *   });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/cloudforce-one/events/dataset/create`, {
          body,
          ...options
        });
      }
      /**
       * Lists all datasets in an account
       *
       * @example
       * ```ts
       * const datasets =
       *   await client.cloudforceOne.threatEvents.datasets.list({
       *     account_id: 'account_id',
       *   });
       * ```
       */
      list(params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/cloudforce-one/events/dataset`, options);
      }
      /**
       * Updates an existing dataset
       *
       * @example
       * ```ts
       * const response =
       *   await client.cloudforceOne.threatEvents.datasets.edit(
       *     '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
       *     { account_id: 'account_id', isPublic: true, name: 'x' },
       *   );
       * ```
       */
      edit(datasetId, params, options) {
        const { account_id, ...body } = params;
        return this._client.patch(`/accounts/${account_id}/cloudforce-one/events/dataset/${datasetId}`, {
          body,
          ...options
        });
      }
      /**
       * Reads a dataset
       *
       * @example
       * ```ts
       * const dataset =
       *   await client.cloudforceOne.threatEvents.datasets.get(
       *     '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
       *     { account_id: 'account_id' },
       *   );
       * ```
       */
      get(datasetId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/cloudforce-one/events/dataset/${datasetId}`, options);
      }
      /**
       * Reads data for a raw event
       *
       * @example
       * ```ts
       * const response =
       *   await client.cloudforceOne.threatEvents.datasets.raw(
       *     'dataset_id',
       *     'event_id',
       *     { account_id: 'account_id' },
       *   );
       * ```
       */
      raw(datasetId, eventId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/cloudforce-one/events/raw/${datasetId}/${eventId}`, options);
      }
    };
    Datasets2.Health = Health;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/cloudforce-one/threat-events/threat-events.mjs
var ThreatEvents;
var init_threat_events = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/cloudforce-one/threat-events/threat-events.mjs"() {
    init_import_meta_url();
    init_resource();
    init_attackers();
    init_attackers();
    init_categories();
    init_categories();
    init_countries();
    init_countries();
    init_crons();
    init_crons();
    init_event_tags();
    init_event_tags();
    init_indicator_types();
    init_indicator_types();
    init_insights();
    init_insights();
    init_raw();
    init_raw();
    init_relate();
    init_relate();
    init_tags();
    init_tags();
    init_target_industries();
    init_target_industries();
    init_datasets2();
    init_datasets2();
    ThreatEvents = class extends APIResource {
      static {
        __name(this, "ThreatEvents");
      }
      constructor() {
        super(...arguments);
        this.attackers = new Attackers(this._client);
        this.categories = new Categories(this._client);
        this.countries = new Countries(this._client);
        this.crons = new Crons(this._client);
        this.datasets = new Datasets2(this._client);
        this.indicatorTypes = new IndicatorTypes(this._client);
        this.raw = new Raw(this._client);
        this.relate = new Relate(this._client);
        this.tags = new Tags(this._client);
        this.eventTags = new EventTags(this._client);
        this.targetIndustries = new TargetIndustries(this._client);
        this.insights = new Insights(this._client);
      }
      /**
       * To create a dataset, see the
       * [`Create Dataset`](https://developers.cloudflare.com/api/resources/cloudforce_one/subresources/threat_events/subresources/datasets/methods/create/)
       * endpoint. When `datasetId` parameter is unspecified, it will be created in a
       * default dataset named `Cloudforce One Threat Events`.
       *
       * @example
       * ```ts
       * const threatEvent =
       *   await client.cloudforceOne.threatEvents.create({
       *     account_id: 'account_id',
       *     category: 'Domain Resolution',
       *     date: '2022-04-01T00:00:00Z',
       *     event: 'An attacker registered the domain domain.com',
       *     indicatorType: 'domain',
       *     raw: { data: { foo: 'bar' } },
       *     tlp: 'amber',
       *   });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/cloudforce-one/events/create`, { body, ...options });
      }
      /**
       * When `datasetId` is unspecified, events will be listed from the
       * `Cloudforce One Threat Events` dataset. To list existing datasets (and their
       * IDs), use the
       * [`List Datasets`](https://developers.cloudflare.com/api/resources/cloudforce_one/subresources/threat_events/subresources/datasets/methods/list/)
       * endpoint). Also, must provide query parameters.
       *
       * @example
       * ```ts
       * const threatEvents =
       *   await client.cloudforceOne.threatEvents.list({
       *     account_id: 'account_id',
       *   });
       * ```
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.get(`/accounts/${account_id}/cloudforce-one/events`, { query, ...options });
      }
      /**
       * The `datasetId` parameter must be defined. To list existing datasets (and their
       * IDs) in your account, use the
       * [`List Datasets`](https://developers.cloudflare.com/api/resources/cloudforce_one/subresources/threat_events/subresources/datasets/methods/list/)
       * endpoint.
       *
       * @example
       * ```ts
       * const threatEvent =
       *   await client.cloudforceOne.threatEvents.delete(
       *     'event_id',
       *     { account_id: 'account_id' },
       *   );
       * ```
       */
      delete(eventId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/cloudforce-one/events/${eventId}`, options);
      }
      /**
       * The `datasetId` parameter must be defined. To list existing datasets (and their
       * IDs) in your account, use the
       * [`List Datasets`](https://developers.cloudflare.com/api/resources/cloudforce_one/subresources/threat_events/subresources/datasets/methods/list/)
       * endpoint.
       *
       * @example
       * ```ts
       * const response =
       *   await client.cloudforceOne.threatEvents.bulkCreate({
       *     account_id: 'account_id',
       *     data: [
       *       {
       *         category: 'Domain Resolution',
       *         date: '2022-04-01T00:00:00Z',
       *         event:
       *           'An attacker registered the domain domain.com',
       *         indicatorType: 'domain',
       *         raw: { data: { foo: 'bar' } },
       *         tlp: 'amber',
       *       },
       *     ],
       *     datasetId: 'durableObjectName',
       *   });
       * ```
       */
      bulkCreate(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/cloudforce-one/events/create/bulk`, {
          body,
          ...options
        });
      }
      /**
       * Updates an event
       *
       * @example
       * ```ts
       * const response =
       *   await client.cloudforceOne.threatEvents.edit('event_id', {
       *     account_id: 'account_id',
       *   });
       * ```
       */
      edit(eventId, params, options) {
        const { account_id, ...body } = params;
        return this._client.patch(`/accounts/${account_id}/cloudforce-one/events/${eventId}`, {
          body,
          ...options
        });
      }
      /**
       * Reads an event
       *
       * @example
       * ```ts
       * const threatEvent =
       *   await client.cloudforceOne.threatEvents.get('event_id', {
       *     account_id: 'account_id',
       *   });
       * ```
       */
      get(eventId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/cloudforce-one/events/${eventId}`, options);
      }
    };
    ThreatEvents.Attackers = Attackers;
    ThreatEvents.Categories = Categories;
    ThreatEvents.Countries = Countries;
    ThreatEvents.Crons = Crons;
    ThreatEvents.Datasets = Datasets2;
    ThreatEvents.IndicatorTypes = IndicatorTypes;
    ThreatEvents.Raw = Raw;
    ThreatEvents.Relate = Relate;
    ThreatEvents.Tags = Tags;
    ThreatEvents.EventTags = EventTags;
    ThreatEvents.TargetIndustries = TargetIndustries;
    ThreatEvents.Insights = Insights;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/cloudforce-one/cloudforce-one.mjs
var CloudforceOne;
var init_cloudforce_one = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/cloudforce-one/cloudforce-one.mjs"() {
    init_import_meta_url();
    init_resource();
    init_binary_storage();
    init_binary_storage();
    init_requests();
    init_requests();
    init_scans();
    init_scans();
    init_threat_events();
    init_threat_events();
    CloudforceOne = class extends APIResource {
      static {
        __name(this, "CloudforceOne");
      }
      constructor() {
        super(...arguments);
        this.scans = new Scans(this._client);
        this.binaryStorage = new BinaryStorage(this._client);
        this.requests = new Requests(this._client);
        this.threatEvents = new ThreatEvents(this._client);
      }
    };
    CloudforceOne.Scans = Scans;
    CloudforceOne.BinaryStorage = BinaryStorage;
    CloudforceOne.Requests = Requests;
    CloudforceOne.ListItemsSinglePage = ListItemsSinglePage;
    CloudforceOne.RequestTypesResponsesSinglePage = RequestTypesResponsesSinglePage;
    CloudforceOne.ThreatEvents = ThreatEvents;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/content-scanning/payloads.mjs
var Payloads, PayloadCreateResponsesSinglePage, PayloadListResponsesSinglePage, PayloadDeleteResponsesSinglePage;
var init_payloads = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/content-scanning/payloads.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Payloads = class extends APIResource {
      static {
        __name(this, "Payloads");
      }
      /**
       * Add custom scan expressions for Content Scanning.
       */
      create(params, options) {
        const { zone_id, body } = params;
        return this._client.getAPIList(`/zones/${zone_id}/content-upload-scan/payloads`, PayloadCreateResponsesSinglePage, { body, method: "post", ...options });
      }
      /**
       * Get a list of existing custom scan expressions for Content Scanning.
       */
      list(params, options) {
        const { zone_id } = params;
        return this._client.getAPIList(`/zones/${zone_id}/content-upload-scan/payloads`, PayloadListResponsesSinglePage, options);
      }
      /**
       * Delete a Content Scan Custom Expression.
       */
      delete(expressionId, params, options) {
        const { zone_id } = params;
        return this._client.getAPIList(`/zones/${zone_id}/content-upload-scan/payloads/${expressionId}`, PayloadDeleteResponsesSinglePage, { method: "delete", ...options });
      }
    };
    PayloadCreateResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "PayloadCreateResponsesSinglePage");
      }
    };
    PayloadListResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "PayloadListResponsesSinglePage");
      }
    };
    PayloadDeleteResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "PayloadDeleteResponsesSinglePage");
      }
    };
    Payloads.PayloadCreateResponsesSinglePage = PayloadCreateResponsesSinglePage;
    Payloads.PayloadListResponsesSinglePage = PayloadListResponsesSinglePage;
    Payloads.PayloadDeleteResponsesSinglePage = PayloadDeleteResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/content-scanning/settings.mjs
var Settings2;
var init_settings2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/content-scanning/settings.mjs"() {
    init_import_meta_url();
    init_resource();
    Settings2 = class extends APIResource {
      static {
        __name(this, "Settings");
      }
      /**
       * Retrieve the current status of Content Scanning.
       */
      get(params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/content-upload-scan/settings`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/content-scanning/content-scanning.mjs
var ContentScanning;
var init_content_scanning = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/content-scanning/content-scanning.mjs"() {
    init_import_meta_url();
    init_resource();
    init_payloads();
    init_payloads();
    init_settings2();
    init_settings2();
    ContentScanning = class extends APIResource {
      static {
        __name(this, "ContentScanning");
      }
      constructor() {
        super(...arguments);
        this.payloads = new Payloads(this._client);
        this.settings = new Settings2(this._client);
      }
      /**
       * Disable Content Scanning.
       */
      disable(params, options) {
        const { zone_id } = params;
        return this._client.post(`/zones/${zone_id}/content-upload-scan/disable`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Enable Content Scanning.
       */
      enable(params, options) {
        const { zone_id } = params;
        return this._client.post(`/zones/${zone_id}/content-upload-scan/enable`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    ContentScanning.Payloads = Payloads;
    ContentScanning.PayloadCreateResponsesSinglePage = PayloadCreateResponsesSinglePage;
    ContentScanning.PayloadListResponsesSinglePage = PayloadListResponsesSinglePage;
    ContentScanning.PayloadDeleteResponsesSinglePage = PayloadDeleteResponsesSinglePage;
    ContentScanning.Settings = Settings2;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/custom-certificates/prioritize.mjs
var Prioritize;
var init_prioritize = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/custom-certificates/prioritize.mjs"() {
    init_import_meta_url();
    init_resource();
    init_custom_certificates();
    Prioritize = class extends APIResource {
      static {
        __name(this, "Prioritize");
      }
      /**
       * If a zone has multiple SSL certificates, you can set the order in which they
       * should be used during a request. The higher priority will break ties across
       * overlapping 'legacy_custom' certificates.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const customCertificate of client.customCertificates.prioritize.update(
       *   {
       *     zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     certificates: [{}, {}],
       *   },
       * )) {
       *   // ...
       * }
       * ```
       */
      update(params, options) {
        const { zone_id, ...body } = params;
        return this._client.getAPIList(`/zones/${zone_id}/custom_certificates/prioritize`, CustomCertificatesSinglePage, { body, method: "put", ...options });
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/custom-certificates/custom-certificates.mjs
var CustomCertificates, CustomCertificatesV4PagePaginationArray, CustomCertificatesSinglePage;
var init_custom_certificates = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/custom-certificates/custom-certificates.mjs"() {
    init_import_meta_url();
    init_resource();
    init_prioritize();
    init_prioritize();
    init_pagination();
    CustomCertificates = class extends APIResource {
      static {
        __name(this, "CustomCertificates");
      }
      constructor() {
        super(...arguments);
        this.prioritize = new Prioritize(this._client);
      }
      /**
       * Upload a new SSL certificate for a zone.
       *
       * @example
       * ```ts
       * const customCertificate =
       *   await client.customCertificates.create({
       *     zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     certificate:
       *       '-----BEGIN CERTIFICATE-----\nMIIDtTCCAp2gAwIBAgIJAMHAwfXZ5/PWMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV\nBAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX\naWRnaXRzIFB0eSBMdGQwHhcNMTYwODI0MTY0MzAxWhcNMTYxMTIyMTY0MzAxWjBF\nMQswCQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50\nZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\nCgKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmGdtcGbg/1\nCGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKnabIRuGvB\nKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpidtnKX/a+5\n0GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+pyFxIXjbEI\ndZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pEewooaeO2\nizNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABo4GnMIGkMB0GA1UdDgQWBBT/LbE4\n9rWf288N6sJA5BRb6FJIGDB1BgNVHSMEbjBsgBT/LbE49rWf288N6sJA5BRb6FJI\nGKFJpEcwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNV\nBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAMHAwfXZ5/PWMAwGA1UdEwQF\nMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAHHFwl0tH0quUYZYO0dZYt4R7SJ0pCm2\n2satiyzHl4OnXcHDpekAo7/a09c6Lz6AU83cKy/+x3/djYHXWba7HpEu0dR3ugQP\nMlr4zrhd9xKZ0KZKiYmtJH+ak4OM4L3FbT0owUZPyjLSlhMtJVcoRp5CJsjAMBUG\nSvD8RX+T01wzox/Qb+lnnNnOlaWpqu8eoOenybxKp1a9ULzIVvN/LAcc+14vioFq\n2swRWtmocBAs8QR9n4uvbpiYvS8eYueDCWMM4fvFfBhaDZ3N9IbtySh3SpFdQDhw\nYbjM2rxXiyLGxB4Bol7QTv4zHif7Zt89FReT/NBy4rzaskDJY5L6xmY=\n-----END CERTIFICATE-----\n',
       *     private_key:
       *       '-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmG\ndtcGbg/1CGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKn\nabIRuGvBKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpid\ntnKX/a+50GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+py\nFxIXjbEIdZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pE\newooaeO2izNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABAoIBACbhTYXBZYKmYPCb\nHBR1IBlCQA2nLGf0qRuJNJZg5iEzXows/6tc8YymZkQE7nolapWsQ+upk2y5Xdp/\naxiuprIs9JzkYK8Ox0r+dlwCG1kSW+UAbX0bQ/qUqlsTvU6muVuMP8vZYHxJ3wmb\n+ufRBKztPTQ/rYWaYQcgC0RWI20HTFBMxlTAyNxYNWzX7RKFkGVVyB9RsAtmcc8g\n+j4OdosbfNoJPS0HeIfNpAznDfHKdxDk2Yc1tV6RHBrC1ynyLE9+TaflIAdo2MVv\nKLMLq51GqYKtgJFIlBRPQqKoyXdz3fGvXrTkf/WY9QNq0J1Vk5ERePZ54mN8iZB7\n9lwy/AkCgYEA6FXzosxswaJ2wQLeoYc7ceaweX/SwTvxHgXzRyJIIT0eJWgx13Wo\n/WA3Iziimsjf6qE+SI/8laxPp2A86VMaIt3Z3mJN/CqSVGw8LK2AQst+OwdPyDMu\niacE8lj/IFGC8mwNUAb9CzGU3JpU4PxxGFjS/eMtGeRXCWkK4NE+G08CgYEA1Kp9\nN2JrVlqUz+gAX+LPmE9OEMAS9WQSQsfCHGogIFDGGcNf7+uwBM7GAaSJIP01zcoe\nVAgWdzXCv3FLhsaZoJ6RyLOLay5phbu1iaTr4UNYm5WtYTzMzqh8l1+MFFDl9xDB\nvULuCIIrglM5MeS/qnSg1uMoH2oVPj9TVst/ir8CgYEAxrI7Ws9Zc4Bt70N1As+U\nlySjaEVZCMkqvHJ6TCuVZFfQoE0r0whdLdRLU2PsLFP+q7qaeZQqgBaNSKeVcDYR\n9B+nY/jOmQoPewPVsp/vQTCnE/R81spu0mp0YI6cIheT1Z9zAy322svcc43JaWB7\nmEbeqyLOP4Z4qSOcmghZBSECgYACvR9Xs0DGn+wCsW4vze/2ei77MD4OQvepPIFX\ndFZtlBy5ADcgE9z0cuVB6CiL8DbdK5kwY9pGNr8HUCI03iHkW6Zs+0L0YmihfEVe\nPG19PSzK9CaDdhD9KFZSbLyVFmWfxOt50H7YRTTiPMgjyFpfi5j2q348yVT0tEQS\nfhRqaQKBgAcWPokmJ7EbYQGeMbS7HC8eWO/RyamlnSffdCdSc7ue3zdVJxpAkQ8W\nqu80pEIF6raIQfAf8MXiiZ7auFOSnHQTXUbhCpvDLKi0Mwq3G8Pl07l+2s6dQG6T\nlv6XTQaMyf6n1yjzL+fzDrH3qXMxHMO/b13EePXpDMpY7HQpoLDi\n-----END RSA PRIVATE KEY-----\n',
       *   });
       * ```
       */
      create(params, options) {
        const { zone_id, ...body } = params;
        return this._client.post(`/zones/${zone_id}/custom_certificates`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List, search, and filter all of your custom SSL certificates. The higher
       * priority will break ties across overlapping 'legacy_custom' certificates, but
       * 'legacy_custom' certificates will always supercede 'sni_custom' certificates.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const customCertificate of client.customCertificates.list(
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { zone_id, ...query } = params;
        return this._client.getAPIList(`/zones/${zone_id}/custom_certificates`, CustomCertificatesV4PagePaginationArray, { query, ...options });
      }
      /**
       * Remove a SSL certificate from a zone.
       *
       * @example
       * ```ts
       * const customCertificate =
       *   await client.customCertificates.delete(
       *     '023e105f4ecef8ad9ca31a8372d0c353',
       *     { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      delete(customCertificateId, params, options) {
        const { zone_id } = params;
        return this._client.delete(`/zones/${zone_id}/custom_certificates/${customCertificateId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Upload a new private key and/or PEM/CRT for the SSL certificate. Note: PATCHing
       * a configuration for sni_custom certificates will result in a new resource id
       * being returned, and the previous one being deleted.
       *
       * @example
       * ```ts
       * const customCertificate =
       *   await client.customCertificates.edit(
       *     '023e105f4ecef8ad9ca31a8372d0c353',
       *     { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      edit(customCertificateId, params, options) {
        const { zone_id, ...body } = params;
        return this._client.patch(`/zones/${zone_id}/custom_certificates/${customCertificateId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * SSL Configuration Details
       *
       * @example
       * ```ts
       * const customCertificate =
       *   await client.customCertificates.get(
       *     '023e105f4ecef8ad9ca31a8372d0c353',
       *     { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      get(customCertificateId, params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/custom_certificates/${customCertificateId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    CustomCertificatesV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "CustomCertificatesV4PagePaginationArray");
      }
    };
    CustomCertificatesSinglePage = class extends SinglePage {
      static {
        __name(this, "CustomCertificatesSinglePage");
      }
    };
    CustomCertificates.CustomCertificatesV4PagePaginationArray = CustomCertificatesV4PagePaginationArray;
    CustomCertificates.Prioritize = Prioritize;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/custom-hostnames/fallback-origin.mjs
var FallbackOrigin;
var init_fallback_origin = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/custom-hostnames/fallback-origin.mjs"() {
    init_import_meta_url();
    init_resource();
    FallbackOrigin = class extends APIResource {
      static {
        __name(this, "FallbackOrigin");
      }
      /**
       * Update Fallback Origin for Custom Hostnames
       *
       * @example
       * ```ts
       * const fallbackOrigin =
       *   await client.customHostnames.fallbackOrigin.update({
       *     zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     origin: 'fallback.example.com',
       *   });
       * ```
       */
      update(params, options) {
        const { zone_id, ...body } = params;
        return this._client.put(`/zones/${zone_id}/custom_hostnames/fallback_origin`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Delete Fallback Origin for Custom Hostnames
       *
       * @example
       * ```ts
       * const fallbackOrigin =
       *   await client.customHostnames.fallbackOrigin.delete({
       *     zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   });
       * ```
       */
      delete(params, options) {
        const { zone_id } = params;
        return this._client.delete(`/zones/${zone_id}/custom_hostnames/fallback_origin`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get Fallback Origin for Custom Hostnames
       *
       * @example
       * ```ts
       * const fallbackOrigin =
       *   await client.customHostnames.fallbackOrigin.get({
       *     zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   });
       * ```
       */
      get(params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/custom_hostnames/fallback_origin`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/custom-hostnames/certificate-pack/certificates.mjs
var Certificates;
var init_certificates = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/custom-hostnames/certificate-pack/certificates.mjs"() {
    init_import_meta_url();
    init_resource();
    Certificates = class extends APIResource {
      static {
        __name(this, "Certificates");
      }
      /**
       * Replace a single custom certificate within a certificate pack that contains two
       * bundled certificates. The replacement must adhere to the following constraints.
       * You can only replace an RSA certificate with another RSA certificate or an ECDSA
       * certificate with another ECDSA certificate.
       *
       * @example
       * ```ts
       * const certificate =
       *   await client.customHostnames.certificatePack.certificates.update(
       *     '023e105f4ecef8ad9ca31a8372d0c353',
       *     '023e105f4ecef8ad9ca31a8372d0c353',
       *     '023e105f4ecef8ad9ca31a8372d0c353',
       *     {
       *       zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *       custom_certificate:
       *         '-----BEGIN CERTIFICATE-----\nMIIDdjCCAl6gAwIBAgIJAPnMg0Fs+/B0MA0GCSqGSIb3DQEBCwUAMFsx...\n-----END CERTIFICATE-----\n',
       *       custom_key:
       *         '-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC/SCB5...\n-----END PRIVATE KEY-----\n',
       *     },
       *   );
       * ```
       */
      update(customHostnameId, certificatePackId, certificateId, params, options) {
        const { zone_id, ...body } = params;
        return this._client.put(`/zones/${zone_id}/custom_hostnames/${customHostnameId}/certificate_pack/${certificatePackId}/certificates/${certificateId}`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Delete a single custom certificate from a certificate pack that contains two
       * bundled certificates. Deletion is subject to the following constraints. You
       * cannot delete a certificate if it is the only remaining certificate in the pack.
       * At least one certificate must remain in the pack.
       *
       * @example
       * ```ts
       * const certificate =
       *   await client.customHostnames.certificatePack.certificates.delete(
       *     '023e105f4ecef8ad9ca31a8372d0c353',
       *     '023e105f4ecef8ad9ca31a8372d0c353',
       *     '023e105f4ecef8ad9ca31a8372d0c353',
       *     { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      delete(customHostnameId, certificatePackId, certificateId, params, options) {
        const { zone_id } = params;
        return this._client.delete(`/zones/${zone_id}/custom_hostnames/${customHostnameId}/certificate_pack/${certificatePackId}/certificates/${certificateId}`, options);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/custom-hostnames/certificate-pack/certificate-pack.mjs
var CertificatePack;
var init_certificate_pack = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/custom-hostnames/certificate-pack/certificate-pack.mjs"() {
    init_import_meta_url();
    init_resource();
    init_certificates();
    init_certificates();
    CertificatePack = class extends APIResource {
      static {
        __name(this, "CertificatePack");
      }
      constructor() {
        super(...arguments);
        this.certificates = new Certificates(this._client);
      }
    };
    CertificatePack.Certificates = Certificates;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/custom-hostnames/custom-hostnames.mjs
var CustomHostnames, CustomHostnameListResponsesV4PagePaginationArray;
var init_custom_hostnames = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/custom-hostnames/custom-hostnames.mjs"() {
    init_import_meta_url();
    init_resource();
    init_fallback_origin();
    init_fallback_origin();
    init_certificate_pack();
    init_certificate_pack();
    init_pagination();
    CustomHostnames = class extends APIResource {
      static {
        __name(this, "CustomHostnames");
      }
      constructor() {
        super(...arguments);
        this.fallbackOrigin = new FallbackOrigin(this._client);
        this.certificatePack = new CertificatePack(this._client);
      }
      /**
       * Add a new custom hostname and request that an SSL certificate be issued for it.
       * One of three validation methods—http, txt, email—should be used, with 'http'
       * recommended if the CNAME is already in place (or will be soon). Specifying
       * 'email' will send an email to the WHOIS contacts on file for the base domain
       * plus hostmaster, postmaster, webmaster, admin, administrator. If http is used
       * and the domain is not already pointing to the Managed CNAME host, the PATCH
       * method must be used once it is (to complete validation). Enable bundling of
       * certificates using the custom_cert_bundle field. The bundling process requires
       * the following condition One certificate in the bundle must use an RSA, and the
       * other must use an ECDSA.
       *
       * @example
       * ```ts
       * const customHostname = await client.customHostnames.create({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   hostname: 'app.example.com',
       *   ssl: {},
       * });
       * ```
       */
      create(params, options) {
        const { zone_id, ...body } = params;
        return this._client.post(`/zones/${zone_id}/custom_hostnames`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List, search, sort, and filter all of your custom hostnames.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const customHostnameListResponse of client.customHostnames.list(
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { zone_id, ...query } = params;
        return this._client.getAPIList(`/zones/${zone_id}/custom_hostnames`, CustomHostnameListResponsesV4PagePaginationArray, { query, ...options });
      }
      /**
       * Delete Custom Hostname (and any issued SSL certificates)
       *
       * @example
       * ```ts
       * const customHostname = await client.customHostnames.delete(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      delete(customHostnameId, params, options) {
        const { zone_id } = params;
        return this._client.delete(`/zones/${zone_id}/custom_hostnames/${customHostnameId}`, options);
      }
      /**
       * Modify SSL configuration for a custom hostname. When sent with SSL config that
       * matches existing config, used to indicate that hostname should pass domain
       * control validation (DCV). Can also be used to change validation type, e.g., from
       * 'http' to 'email'. Bundle an existing certificate with another certificate by
       * using the "custom_cert_bundle" field. The bundling process supports combining
       * certificates as long as the following condition is met. One certificate must use
       * the RSA algorithm, and the other must use the ECDSA algorithm.
       *
       * @example
       * ```ts
       * const response = await client.customHostnames.edit(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      edit(customHostnameId, params, options) {
        const { zone_id, ...body } = params;
        return this._client.patch(`/zones/${zone_id}/custom_hostnames/${customHostnameId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Custom Hostname Details
       *
       * @example
       * ```ts
       * const customHostname = await client.customHostnames.get(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(customHostnameId, params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/custom_hostnames/${customHostnameId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    CustomHostnameListResponsesV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "CustomHostnameListResponsesV4PagePaginationArray");
      }
    };
    CustomHostnames.CustomHostnameListResponsesV4PagePaginationArray = CustomHostnameListResponsesV4PagePaginationArray;
    CustomHostnames.FallbackOrigin = FallbackOrigin;
    CustomHostnames.CertificatePack = CertificatePack;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/custom-nameservers.mjs
var CustomNameservers, CustomNameserverDeleteResponsesSinglePage, CustomNameserversSinglePage;
var init_custom_nameservers = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/custom-nameservers.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    CustomNameservers = class extends APIResource {
      static {
        __name(this, "CustomNameservers");
      }
      /**
       * Add Account Custom Nameserver
       *
       * @example
       * ```ts
       * const customNameserver =
       *   await client.customNameservers.create({
       *     account_id: '372e67954025e0ba6aaa6d586b9e0b59',
       *     ns_name: 'ns1.example.com',
       *   });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/custom_ns`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Delete Account Custom Nameserver
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const customNameserverDeleteResponse of client.customNameservers.delete(
       *   'ns1.example.com',
       *   { account_id: '372e67954025e0ba6aaa6d586b9e0b59' },
       * )) {
       *   // ...
       * }
       * ```
       */
      delete(customNSId, params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/custom_ns/${customNSId}`, CustomNameserverDeleteResponsesSinglePage, { method: "delete", ...options });
      }
      /**
       * List an account's custom nameservers.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const customNameserver of client.customNameservers.get(
       *   { account_id: '372e67954025e0ba6aaa6d586b9e0b59' },
       * )) {
       *   // ...
       * }
       * ```
       */
      get(params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/custom_ns`, CustomNameserversSinglePage, options);
      }
    };
    CustomNameserverDeleteResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "CustomNameserverDeleteResponsesSinglePage");
      }
    };
    CustomNameserversSinglePage = class extends SinglePage {
      static {
        __name(this, "CustomNameserversSinglePage");
      }
    };
    CustomNameservers.CustomNameserverDeleteResponsesSinglePage = CustomNameserverDeleteResponsesSinglePage;
    CustomNameservers.CustomNameserversSinglePage = CustomNameserversSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/custom-pages.mjs
var CustomPages, CustomPageListResponsesSinglePage;
var init_custom_pages = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/custom-pages.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    init_error4();
    init_pagination();
    CustomPages = class extends APIResource {
      static {
        __name(this, "CustomPages");
      }
      /**
       * Updates the configuration of an existing custom page.
       *
       * @example
       * ```ts
       * const customPage = await client.customPages.update(
       *   'ratelimit_block',
       *   {
       *     state: 'default',
       *     url: 'http://www.example.com',
       *     account_id: 'account_id',
       *   },
       * );
       * ```
       */
      update(identifier, params, options) {
        const { account_id, zone_id, ...body } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.put(`/${accountOrZone}/${accountOrZoneId}/custom_pages/${identifier}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      list(params = {}, options) {
        if (isRequestOptions(params)) {
          return this.list({}, params);
        }
        const { account_id, zone_id } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.getAPIList(`/${accountOrZone}/${accountOrZoneId}/custom_pages`, CustomPageListResponsesSinglePage, options);
      }
      get(identifier, params = {}, options) {
        if (isRequestOptions(params)) {
          return this.get(identifier, {}, params);
        }
        const { account_id, zone_id } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.get(`/${accountOrZone}/${accountOrZoneId}/custom_pages/${identifier}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    CustomPageListResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "CustomPageListResponsesSinglePage");
      }
    };
    CustomPages.CustomPageListResponsesSinglePage = CustomPageListResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/d1/database.mjs
var Database, DatabaseListResponsesV4PagePaginationArray, QueryResultsSinglePage, DatabaseRawResponsesSinglePage;
var init_database = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/d1/database.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Database = class extends APIResource {
      static {
        __name(this, "Database");
      }
      /**
       * Returns the created D1 database.
       *
       * @example
       * ```ts
       * const d1 = await client.d1.database.create({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   name: 'my-database',
       * });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/d1/database`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Updates the specified D1 database.
       *
       * @example
       * ```ts
       * const d1 = await client.d1.database.update(
       *   'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
       *   {
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     read_replication: { mode: 'auto' },
       *   },
       * );
       * ```
       */
      update(databaseId, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/d1/database/${databaseId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Returns a list of D1 databases.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const databaseListResponse of client.d1.database.list(
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/d1/database`, DatabaseListResponsesV4PagePaginationArray, { query, ...options });
      }
      /**
       * Deletes the specified D1 database.
       *
       * @example
       * ```ts
       * const database = await client.d1.database.delete(
       *   'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      delete(databaseId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/d1/database/${databaseId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Updates partially the specified D1 database.
       *
       * @example
       * ```ts
       * const d1 = await client.d1.database.edit(
       *   'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      edit(databaseId, params, options) {
        const { account_id, ...body } = params;
        return this._client.patch(`/accounts/${account_id}/d1/database/${databaseId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Returns a URL where the SQL contents of your D1 can be downloaded. Note: this
       * process may take some time for larger DBs, during which your D1 will be
       * unavailable to serve queries. To avoid blocking your DB unnecessarily, an
       * in-progress export must be continually polled or will automatically cancel.
       *
       * @example
       * ```ts
       * const response = await client.d1.database.export(
       *   'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
       *   {
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     output_format: 'polling',
       *   },
       * );
       * ```
       */
      export(databaseId, params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/d1/database/${databaseId}/export`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Returns the specified D1 database.
       *
       * @example
       * ```ts
       * const d1 = await client.d1.database.get(
       *   'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(databaseId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/d1/database/${databaseId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Generates a temporary URL for uploading an SQL file to, then instructing the D1
       * to import it and polling it for status updates. Imports block the D1 for their
       * duration.
       *
       * @example
       * ```ts
       * const response = await client.d1.database.import(
       *   'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
       *   {
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     action: 'init',
       *     etag: 'etag',
       *   },
       * );
       * ```
       */
      import(databaseId, params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/d1/database/${databaseId}/import`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Returns the query result as an object.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const queryResult of client.d1.database.query(
       *   'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
       *   {
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     sql: 'SELECT * FROM myTable WHERE field = ? OR field = ?;',
       *   },
       * )) {
       *   // ...
       * }
       * ```
       */
      query(databaseId, params, options) {
        const { account_id, ...body } = params;
        return this._client.getAPIList(`/accounts/${account_id}/d1/database/${databaseId}/query`, QueryResultsSinglePage, { body, method: "post", ...options });
      }
      /**
       * Returns the query result rows as arrays rather than objects. This is a
       * performance-optimized version of the /query endpoint.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const databaseRawResponse of client.d1.database.raw(
       *   'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
       *   {
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     sql: 'SELECT * FROM myTable WHERE field = ? OR field = ?;',
       *   },
       * )) {
       *   // ...
       * }
       * ```
       */
      raw(databaseId, params, options) {
        const { account_id, ...body } = params;
        return this._client.getAPIList(`/accounts/${account_id}/d1/database/${databaseId}/raw`, DatabaseRawResponsesSinglePage, { body, method: "post", ...options });
      }
    };
    DatabaseListResponsesV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "DatabaseListResponsesV4PagePaginationArray");
      }
    };
    QueryResultsSinglePage = class extends SinglePage {
      static {
        __name(this, "QueryResultsSinglePage");
      }
    };
    DatabaseRawResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "DatabaseRawResponsesSinglePage");
      }
    };
    Database.DatabaseListResponsesV4PagePaginationArray = DatabaseListResponsesV4PagePaginationArray;
    Database.QueryResultsSinglePage = QueryResultsSinglePage;
    Database.DatabaseRawResponsesSinglePage = DatabaseRawResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/d1/d1.mjs
var D1Resource;
var init_d1 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/d1/d1.mjs"() {
    init_import_meta_url();
    init_resource();
    init_database();
    init_database();
    D1Resource = class extends APIResource {
      static {
        __name(this, "D1Resource");
      }
      constructor() {
        super(...arguments);
        this.database = new Database(this._client);
      }
    };
    D1Resource.Database = Database;
    D1Resource.DatabaseListResponsesV4PagePaginationArray = DatabaseListResponsesV4PagePaginationArray;
    D1Resource.QueryResultsSinglePage = QueryResultsSinglePage;
    D1Resource.DatabaseRawResponsesSinglePage = DatabaseRawResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/dcv-delegation.mjs
var DCVDelegation;
var init_dcv_delegation = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/dcv-delegation.mjs"() {
    init_import_meta_url();
    init_resource();
    DCVDelegation = class extends APIResource {
      static {
        __name(this, "DCVDelegation");
      }
      /**
       * Retrieve the account and zone specific unique identifier used as part of the
       * CNAME target for DCV Delegation.
       */
      get(params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/dcv_delegation/uuid`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/dns/dnssec.mjs
var DNSSECResource;
var init_dnssec = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/dns/dnssec.mjs"() {
    init_import_meta_url();
    init_resource();
    DNSSECResource = class extends APIResource {
      static {
        __name(this, "DNSSECResource");
      }
      /**
       * Delete DNSSEC.
       *
       * @example
       * ```ts
       * const dnssec = await client.dns.dnssec.delete({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      delete(params, options) {
        const { zone_id } = params;
        return this._client.delete(`/zones/${zone_id}/dnssec`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Enable or disable DNSSEC.
       *
       * @example
       * ```ts
       * const dnssec = await client.dns.dnssec.edit({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      edit(params, options) {
        const { zone_id, ...body } = params;
        return this._client.patch(`/zones/${zone_id}/dnssec`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Details about DNSSEC status and configuration.
       *
       * @example
       * ```ts
       * const dnssec = await client.dns.dnssec.get({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      get(params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/dnssec`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/dns/records.mjs
var Records, RecordResponsesV4PagePaginationArray, RecordResponsesSinglePage;
var init_records = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/dns/records.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    init_pagination();
    Records = class extends APIResource {
      static {
        __name(this, "Records");
      }
      /**
       * Create a new DNS record for a zone.
       *
       * Notes:
       *
       * - A/AAAA records cannot exist on the same name as CNAME records.
       * - NS records cannot exist on the same name as any other record type.
       * - Domain names are always represented in Punycode, even if Unicode characters
       *   were used when creating the record.
       *
       * @example
       * ```ts
       * const recordResponse = await client.dns.records.create({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   name: 'example.com',
       *   ttl: 3600,
       *   type: 'A',
       * });
       * ```
       */
      create(params, options) {
        const { zone_id, ...body } = params;
        return this._client.post(`/zones/${zone_id}/dns_records`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Overwrite an existing DNS record.
       *
       * Notes:
       *
       * - A/AAAA records cannot exist on the same name as CNAME records.
       * - NS records cannot exist on the same name as any other record type.
       * - Domain names are always represented in Punycode, even if Unicode characters
       *   were used when creating the record.
       *
       * @example
       * ```ts
       * const recordResponse = await client.dns.records.update(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   {
       *     zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     name: 'example.com',
       *     ttl: 3600,
       *     type: 'A',
       *   },
       * );
       * ```
       */
      update(dnsRecordId, params, options) {
        const { zone_id, ...body } = params;
        return this._client.put(`/zones/${zone_id}/dns_records/${dnsRecordId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List, search, sort, and filter a zones' DNS records.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const recordResponse of client.dns.records.list({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * })) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { zone_id, ...query } = params;
        return this._client.getAPIList(`/zones/${zone_id}/dns_records`, RecordResponsesV4PagePaginationArray, {
          query,
          ...options
        });
      }
      /**
       * Delete DNS Record
       *
       * @example
       * ```ts
       * const record = await client.dns.records.delete(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      delete(dnsRecordId, params, options) {
        const { zone_id } = params;
        return this._client.delete(`/zones/${zone_id}/dns_records/${dnsRecordId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Send a Batch of DNS Record API calls to be executed together.
       *
       * Notes:
       *
       * - Although Cloudflare will execute the batched operations in a single database
       *   transaction, Cloudflare's distributed KV store must treat each record change
       *   as a single key-value pair. This means that the propagation of changes is not
       *   atomic. See
       *   [the documentation](https://developers.cloudflare.com/dns/manage-dns-records/how-to/batch-record-changes/ "Batch DNS records")
       *   for more information.
       * - The operations you specify within the /batch request body are always executed
       *   in the following order:
       *
       *   - Deletes
       *   - Patches
       *   - Puts
       *   - Posts
       *
       * @example
       * ```ts
       * const response = await client.dns.records.batch({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      batch(params, options) {
        const { zone_id, ...body } = params;
        return this._client.post(`/zones/${zone_id}/dns_records/batch`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Update an existing DNS record.
       *
       * Notes:
       *
       * - A/AAAA records cannot exist on the same name as CNAME records.
       * - NS records cannot exist on the same name as any other record type.
       * - Domain names are always represented in Punycode, even if Unicode characters
       *   were used when creating the record.
       *
       * @example
       * ```ts
       * const recordResponse = await client.dns.records.edit(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   {
       *     zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     name: 'example.com',
       *     ttl: 3600,
       *     type: 'A',
       *   },
       * );
       * ```
       */
      edit(dnsRecordId, params, options) {
        const { zone_id, ...body } = params;
        return this._client.patch(`/zones/${zone_id}/dns_records/${dnsRecordId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * You can export your
       * [BIND config](https://en.wikipedia.org/wiki/Zone_file "Zone file") through this
       * endpoint.
       *
       * See
       * [the documentation](https://developers.cloudflare.com/dns/manage-dns-records/how-to/import-and-export/ "Import and export records")
       * for more information.
       *
       * @example
       * ```ts
       * const response = await client.dns.records.export({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      export(params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/dns_records/export`, {
          ...options,
          headers: { Accept: "text/plain", ...options?.headers }
        });
      }
      /**
       * DNS Record Details
       *
       * @example
       * ```ts
       * const recordResponse = await client.dns.records.get(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(dnsRecordId, params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/dns_records/${dnsRecordId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * You can upload your
       * [BIND config](https://en.wikipedia.org/wiki/Zone_file "Zone file") through this
       * endpoint. It assumes that cURL is called from a location with bind_config.txt
       * (valid BIND config) present.
       *
       * See
       * [the documentation](https://developers.cloudflare.com/dns/manage-dns-records/how-to/import-and-export/ "Import and export records")
       * for more information.
       *
       * @example
       * ```ts
       * const response = await client.dns.records.import({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   file: 'www.example.com. 300 IN  A 127.0.0.1',
       * });
       * ```
       */
      import(params, options) {
        const { zone_id, ...body } = params;
        return this._client.post(`/zones/${zone_id}/dns_records/import`, multipartFormRequestOptions({ body, ...options }))._thenUnwrap((obj) => obj.result);
      }
      /**
       * Scan for common DNS records on your domain and automatically add them to your
       * zone. Useful if you haven't updated your nameservers yet.
       *
       * @deprecated This endpoint is deprecated in favor of a new asynchronous version. Please use the [/scan/trigger](https://developers.cloudflare.com/api/resources/dns/subresources/records/methods/scan/trigger) and [/scan/review](https://developers.cloudflare.com/api/resources/dns/subresources/records/methods/scan/review) endpoints instead.
       */
      scan(params, options) {
        const { zone_id, body } = params;
        return this._client.post(`/zones/${zone_id}/dns_records/scan`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Retrieves the list of DNS records discovered up to this point by the
       * asynchronous scan. These records are temporary until explicitly accepted or
       * rejected via `POST /scan/review`. Additional records may be discovered by the
       * scan later.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const recordResponse of client.dns.records.scanList(
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      scanList(params, options) {
        const { zone_id } = params;
        return this._client.getAPIList(`/zones/${zone_id}/dns_records/scan/review`, RecordResponsesSinglePage, options);
      }
      /**
       * Accept or reject DNS records found by the DNS records scan. Accepted records
       * will be permanently added to the zone, while rejected records will be
       * permanently deleted.
       *
       * @example
       * ```ts
       * const response = await client.dns.records.scanReview({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      scanReview(params, options) {
        const { zone_id, ...body } = params;
        return this._client.post(`/zones/${zone_id}/dns_records/scan/review`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Initiates an asynchronous scan for common DNS records on your domain. Note that
       * this **does not** automatically add records to your zone. The scan runs in the
       * background, and results can be reviewed later using the `/scan/review`
       * endpoints. Useful if you haven't updated your nameservers yet.
       *
       * @example
       * ```ts
       * const response = await client.dns.records.scanTrigger({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      scanTrigger(params, options) {
        const { zone_id } = params;
        return this._client.post(`/zones/${zone_id}/dns_records/scan/trigger`, options);
      }
    };
    RecordResponsesV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "RecordResponsesV4PagePaginationArray");
      }
    };
    RecordResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "RecordResponsesSinglePage");
      }
    };
    Records.RecordResponsesV4PagePaginationArray = RecordResponsesV4PagePaginationArray;
    Records.RecordResponsesSinglePage = RecordResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/dns/analytics/reports/bytimes.mjs
var Bytimes;
var init_bytimes = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/dns/analytics/reports/bytimes.mjs"() {
    init_import_meta_url();
    init_resource();
    Bytimes = class extends APIResource {
      static {
        __name(this, "Bytimes");
      }
      /**
       * Retrieves a list of aggregate metrics grouped by time interval.
       *
       * See
       * [Analytics API properties](https://developers.cloudflare.com/dns/reference/analytics-api-properties/)
       * for detailed information about the available query parameters.
       *
       * @example
       * ```ts
       * const byTime =
       *   await client.dns.analytics.reports.bytimes.get({
       *     zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   });
       * ```
       */
      get(params, options) {
        const { zone_id, ...query } = params;
        return this._client.get(`/zones/${zone_id}/dns_analytics/report/bytime`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/dns/analytics/reports/reports.mjs
var Reports;
var init_reports = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/dns/analytics/reports/reports.mjs"() {
    init_import_meta_url();
    init_resource();
    init_bytimes();
    init_bytimes();
    Reports = class extends APIResource {
      static {
        __name(this, "Reports");
      }
      constructor() {
        super(...arguments);
        this.bytimes = new Bytimes(this._client);
      }
      /**
       * Retrieves a list of summarised aggregate metrics over a given time period.
       *
       * See
       * [Analytics API properties](https://developers.cloudflare.com/dns/reference/analytics-api-properties/)
       * for detailed information about the available query parameters.
       *
       * @example
       * ```ts
       * const report = await client.dns.analytics.reports.get({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      get(params, options) {
        const { zone_id, ...query } = params;
        return this._client.get(`/zones/${zone_id}/dns_analytics/report`, { query, ...options })._thenUnwrap((obj) => obj.result);
      }
    };
    Reports.Bytimes = Bytimes;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/dns/analytics/analytics.mjs
var Analytics;
var init_analytics = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/dns/analytics/analytics.mjs"() {
    init_import_meta_url();
    init_resource();
    init_reports();
    init_reports();
    Analytics = class extends APIResource {
      static {
        __name(this, "Analytics");
      }
      constructor() {
        super(...arguments);
        this.reports = new Reports(this._client);
      }
    };
    Analytics.Reports = Reports;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/dns/settings/zone.mjs
var Zone;
var init_zone = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/dns/settings/zone.mjs"() {
    init_import_meta_url();
    init_resource();
    Zone = class extends APIResource {
      static {
        __name(this, "Zone");
      }
      /**
       * Update DNS settings for a zone
       *
       * @example
       * ```ts
       * const response = await client.dns.settings.zone.edit({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      edit(params, options) {
        const { zone_id, ...body } = params;
        return this._client.patch(`/zones/${zone_id}/dns_settings`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Show DNS settings for a zone
       *
       * @example
       * ```ts
       * const zone = await client.dns.settings.zone.get({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      get(params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/dns_settings`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/dns/settings/account/views.mjs
var Views, ViewListResponsesV4PagePaginationArray;
var init_views = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/dns/settings/account/views.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Views = class extends APIResource {
      static {
        __name(this, "Views");
      }
      /**
       * Create Internal DNS View for an account
       *
       * @example
       * ```ts
       * const view = await client.dns.settings.account.views.create(
       *   {
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     name: 'my view',
       *     zones: ['372e67954025e0ba6aaa6d586b9e0b59'],
       *   },
       * );
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/dns_settings/views`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List DNS Internal Views for an Account
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const viewListResponse of client.dns.settings.account.views.list(
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/dns_settings/views`, ViewListResponsesV4PagePaginationArray, { query, ...options });
      }
      /**
       * Delete an existing Internal DNS View
       *
       * @example
       * ```ts
       * const view = await client.dns.settings.account.views.delete(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      delete(viewId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/dns_settings/views/${viewId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Update an existing Internal DNS View
       *
       * @example
       * ```ts
       * const response =
       *   await client.dns.settings.account.views.edit(
       *     '023e105f4ecef8ad9ca31a8372d0c353',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      edit(viewId, params, options) {
        const { account_id, ...body } = params;
        return this._client.patch(`/accounts/${account_id}/dns_settings/views/${viewId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get DNS Internal View
       *
       * @example
       * ```ts
       * const view = await client.dns.settings.account.views.get(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(viewId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/dns_settings/views/${viewId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    ViewListResponsesV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "ViewListResponsesV4PagePaginationArray");
      }
    };
    Views.ViewListResponsesV4PagePaginationArray = ViewListResponsesV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/dns/settings/account/account.mjs
var Account;
var init_account = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/dns/settings/account/account.mjs"() {
    init_import_meta_url();
    init_resource();
    init_views();
    init_views();
    Account = class extends APIResource {
      static {
        __name(this, "Account");
      }
      constructor() {
        super(...arguments);
        this.views = new Views(this._client);
      }
      /**
       * Update DNS settings for an account
       *
       * @example
       * ```ts
       * const response = await client.dns.settings.account.edit({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      edit(params, options) {
        const { account_id, ...body } = params;
        return this._client.patch(`/accounts/${account_id}/dns_settings`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Show DNS settings for an account
       *
       * @example
       * ```ts
       * const account = await client.dns.settings.account.get({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      get(params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/dns_settings`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    Account.Views = Views;
    Account.ViewListResponsesV4PagePaginationArray = ViewListResponsesV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/dns/settings/settings.mjs
var Settings3;
var init_settings3 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/dns/settings/settings.mjs"() {
    init_import_meta_url();
    init_resource();
    init_zone();
    init_zone();
    init_account();
    init_account();
    Settings3 = class extends APIResource {
      static {
        __name(this, "Settings");
      }
      constructor() {
        super(...arguments);
        this.zone = new Zone(this._client);
        this.account = new Account(this._client);
      }
    };
    Settings3.Zone = Zone;
    Settings3.Account = Account;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/dns/zone-transfers/acls.mjs
var ACLs, ACLsSinglePage;
var init_acls = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/dns/zone-transfers/acls.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    ACLs = class extends APIResource {
      static {
        __name(this, "ACLs");
      }
      /**
       * Create ACL.
       *
       * @example
       * ```ts
       * const acl = await client.dns.zoneTransfers.acls.create({
       *   account_id: '01a7362d577a6c3019a474fd6f485823',
       *   ip_range: '192.0.2.53/28',
       *   name: 'my-acl-1',
       * });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/secondary_dns/acls`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Modify ACL.
       *
       * @example
       * ```ts
       * const acl = await client.dns.zoneTransfers.acls.update(
       *   '23ff594956f20c2a721606e94745a8aa',
       *   {
       *     account_id: '01a7362d577a6c3019a474fd6f485823',
       *     ip_range: '192.0.2.53/28',
       *     name: 'my-acl-1',
       *   },
       * );
       * ```
       */
      update(aclId, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/secondary_dns/acls/${aclId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List ACLs.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const acl of client.dns.zoneTransfers.acls.list({
       *   account_id: '01a7362d577a6c3019a474fd6f485823',
       * })) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/secondary_dns/acls`, ACLsSinglePage, options);
      }
      /**
       * Delete ACL.
       *
       * @example
       * ```ts
       * const acl = await client.dns.zoneTransfers.acls.delete(
       *   '23ff594956f20c2a721606e94745a8aa',
       *   { account_id: '01a7362d577a6c3019a474fd6f485823' },
       * );
       * ```
       */
      delete(aclId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/secondary_dns/acls/${aclId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get ACL.
       *
       * @example
       * ```ts
       * const acl = await client.dns.zoneTransfers.acls.get(
       *   '23ff594956f20c2a721606e94745a8aa',
       *   { account_id: '01a7362d577a6c3019a474fd6f485823' },
       * );
       * ```
       */
      get(aclId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/secondary_dns/acls/${aclId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    ACLsSinglePage = class extends SinglePage {
      static {
        __name(this, "ACLsSinglePage");
      }
    };
    ACLs.ACLsSinglePage = ACLsSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/dns/zone-transfers/force-axfr.mjs
var ForceAXFRResource;
var init_force_axfr = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/dns/zone-transfers/force-axfr.mjs"() {
    init_import_meta_url();
    init_resource();
    ForceAXFRResource = class extends APIResource {
      static {
        __name(this, "ForceAXFRResource");
      }
      /**
       * Sends AXFR zone transfer request to primary nameserver(s).
       *
       * @example
       * ```ts
       * const forceAXFR =
       *   await client.dns.zoneTransfers.forceAXFR.create({
       *     zone_id: '269d8f4853475ca241c4e730be286b20',
       *     body: {},
       *   });
       * ```
       */
      create(params, options) {
        const { zone_id, body } = params;
        return this._client.post(`/zones/${zone_id}/secondary_dns/force_axfr`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/dns/zone-transfers/incoming.mjs
var IncomingResource;
var init_incoming = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/dns/zone-transfers/incoming.mjs"() {
    init_import_meta_url();
    init_resource();
    IncomingResource = class extends APIResource {
      static {
        __name(this, "IncomingResource");
      }
      /**
       * Create secondary zone configuration for incoming zone transfers.
       *
       * @example
       * ```ts
       * const incoming =
       *   await client.dns.zoneTransfers.incoming.create({
       *     zone_id: '269d8f4853475ca241c4e730be286b20',
       *     auto_refresh_seconds: 86400,
       *     name: 'www.example.com.',
       *     peers: [
       *       '23ff594956f20c2a721606e94745a8aa',
       *       '00920f38ce07c2e2f4df50b1f61d4194',
       *     ],
       *   });
       * ```
       */
      create(params, options) {
        const { zone_id, ...body } = params;
        return this._client.post(`/zones/${zone_id}/secondary_dns/incoming`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Update secondary zone configuration for incoming zone transfers.
       *
       * @example
       * ```ts
       * const incoming =
       *   await client.dns.zoneTransfers.incoming.update({
       *     zone_id: '269d8f4853475ca241c4e730be286b20',
       *     auto_refresh_seconds: 86400,
       *     name: 'www.example.com.',
       *     peers: [
       *       '23ff594956f20c2a721606e94745a8aa',
       *       '00920f38ce07c2e2f4df50b1f61d4194',
       *     ],
       *   });
       * ```
       */
      update(params, options) {
        const { zone_id, ...body } = params;
        return this._client.put(`/zones/${zone_id}/secondary_dns/incoming`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Delete secondary zone configuration for incoming zone transfers.
       *
       * @example
       * ```ts
       * const incoming =
       *   await client.dns.zoneTransfers.incoming.delete({
       *     zone_id: '269d8f4853475ca241c4e730be286b20',
       *   });
       * ```
       */
      delete(params, options) {
        const { zone_id } = params;
        return this._client.delete(`/zones/${zone_id}/secondary_dns/incoming`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get secondary zone configuration for incoming zone transfers.
       *
       * @example
       * ```ts
       * const incoming =
       *   await client.dns.zoneTransfers.incoming.get({
       *     zone_id: '269d8f4853475ca241c4e730be286b20',
       *   });
       * ```
       */
      get(params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/secondary_dns/incoming`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/dns/zone-transfers/peers.mjs
var Peers, PeersSinglePage;
var init_peers = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/dns/zone-transfers/peers.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Peers = class extends APIResource {
      static {
        __name(this, "Peers");
      }
      /**
       * Create Peer.
       *
       * @example
       * ```ts
       * const peer = await client.dns.zoneTransfers.peers.create({
       *   account_id: '01a7362d577a6c3019a474fd6f485823',
       *   name: 'my-peer-1',
       * });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/secondary_dns/peers`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Modify Peer.
       *
       * @example
       * ```ts
       * const peer = await client.dns.zoneTransfers.peers.update(
       *   '23ff594956f20c2a721606e94745a8aa',
       *   {
       *     account_id: '01a7362d577a6c3019a474fd6f485823',
       *     name: 'my-peer-1',
       *   },
       * );
       * ```
       */
      update(peerId, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/secondary_dns/peers/${peerId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List Peers.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const peer of client.dns.zoneTransfers.peers.list(
       *   { account_id: '01a7362d577a6c3019a474fd6f485823' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/secondary_dns/peers`, PeersSinglePage, options);
      }
      /**
       * Delete Peer.
       *
       * @example
       * ```ts
       * const peer = await client.dns.zoneTransfers.peers.delete(
       *   '23ff594956f20c2a721606e94745a8aa',
       *   { account_id: '01a7362d577a6c3019a474fd6f485823' },
       * );
       * ```
       */
      delete(peerId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/secondary_dns/peers/${peerId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get Peer.
       *
       * @example
       * ```ts
       * const peer = await client.dns.zoneTransfers.peers.get(
       *   '23ff594956f20c2a721606e94745a8aa',
       *   { account_id: '01a7362d577a6c3019a474fd6f485823' },
       * );
       * ```
       */
      get(peerId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/secondary_dns/peers/${peerId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    PeersSinglePage = class extends SinglePage {
      static {
        __name(this, "PeersSinglePage");
      }
    };
    Peers.PeersSinglePage = PeersSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/dns/zone-transfers/tsigs.mjs
var TSIGs, TSIGsSinglePage;
var init_tsigs = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/dns/zone-transfers/tsigs.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    TSIGs = class extends APIResource {
      static {
        __name(this, "TSIGs");
      }
      /**
       * Create TSIG.
       *
       * @example
       * ```ts
       * const tsig = await client.dns.zoneTransfers.tsigs.create({
       *   account_id: '01a7362d577a6c3019a474fd6f485823',
       *   algo: 'hmac-sha512.',
       *   name: 'tsig.customer.cf.',
       *   secret:
       *     'caf79a7804b04337c9c66ccd7bef9190a1e1679b5dd03d8aa10f7ad45e1a9dab92b417896c15d4d007c7c14194538d2a5d0feffdecc5a7f0e1c570cfa700837c',
       * });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/secondary_dns/tsigs`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Modify TSIG.
       *
       * @example
       * ```ts
       * const tsig = await client.dns.zoneTransfers.tsigs.update(
       *   '69cd1e104af3e6ed3cb344f263fd0d5a',
       *   {
       *     account_id: '01a7362d577a6c3019a474fd6f485823',
       *     algo: 'hmac-sha512.',
       *     name: 'tsig.customer.cf.',
       *     secret:
       *       'caf79a7804b04337c9c66ccd7bef9190a1e1679b5dd03d8aa10f7ad45e1a9dab92b417896c15d4d007c7c14194538d2a5d0feffdecc5a7f0e1c570cfa700837c',
       *   },
       * );
       * ```
       */
      update(tsigId, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/secondary_dns/tsigs/${tsigId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List TSIGs.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const tsig of client.dns.zoneTransfers.tsigs.list(
       *   { account_id: '01a7362d577a6c3019a474fd6f485823' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/secondary_dns/tsigs`, TSIGsSinglePage, options);
      }
      /**
       * Delete TSIG.
       *
       * @example
       * ```ts
       * const tsig = await client.dns.zoneTransfers.tsigs.delete(
       *   '69cd1e104af3e6ed3cb344f263fd0d5a',
       *   { account_id: '01a7362d577a6c3019a474fd6f485823' },
       * );
       * ```
       */
      delete(tsigId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/secondary_dns/tsigs/${tsigId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get TSIG.
       *
       * @example
       * ```ts
       * const tsig = await client.dns.zoneTransfers.tsigs.get(
       *   '69cd1e104af3e6ed3cb344f263fd0d5a',
       *   { account_id: '01a7362d577a6c3019a474fd6f485823' },
       * );
       * ```
       */
      get(tsigId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/secondary_dns/tsigs/${tsigId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    TSIGsSinglePage = class extends SinglePage {
      static {
        __name(this, "TSIGsSinglePage");
      }
    };
    TSIGs.TSIGsSinglePage = TSIGsSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/dns/zone-transfers/outgoing/status.mjs
var Status;
var init_status = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/dns/zone-transfers/outgoing/status.mjs"() {
    init_import_meta_url();
    init_resource();
    Status = class extends APIResource {
      static {
        __name(this, "Status");
      }
      /**
       * Get primary zone transfer status.
       *
       * @example
       * ```ts
       * const enableTransfer =
       *   await client.dns.zoneTransfers.outgoing.status.get({
       *     zone_id: '269d8f4853475ca241c4e730be286b20',
       *   });
       * ```
       */
      get(params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/secondary_dns/outgoing/status`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/dns/zone-transfers/outgoing/outgoing.mjs
var OutgoingResource;
var init_outgoing = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/dns/zone-transfers/outgoing/outgoing.mjs"() {
    init_import_meta_url();
    init_resource();
    init_status();
    init_status();
    OutgoingResource = class extends APIResource {
      static {
        __name(this, "OutgoingResource");
      }
      constructor() {
        super(...arguments);
        this.status = new Status(this._client);
      }
      /**
       * Create primary zone configuration for outgoing zone transfers.
       *
       * @example
       * ```ts
       * const outgoing =
       *   await client.dns.zoneTransfers.outgoing.create({
       *     zone_id: '269d8f4853475ca241c4e730be286b20',
       *     name: 'www.example.com.',
       *     peers: [
       *       '23ff594956f20c2a721606e94745a8aa',
       *       '00920f38ce07c2e2f4df50b1f61d4194',
       *     ],
       *   });
       * ```
       */
      create(params, options) {
        const { zone_id, ...body } = params;
        return this._client.post(`/zones/${zone_id}/secondary_dns/outgoing`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Update primary zone configuration for outgoing zone transfers.
       *
       * @example
       * ```ts
       * const outgoing =
       *   await client.dns.zoneTransfers.outgoing.update({
       *     zone_id: '269d8f4853475ca241c4e730be286b20',
       *     name: 'www.example.com.',
       *     peers: [
       *       '23ff594956f20c2a721606e94745a8aa',
       *       '00920f38ce07c2e2f4df50b1f61d4194',
       *     ],
       *   });
       * ```
       */
      update(params, options) {
        const { zone_id, ...body } = params;
        return this._client.put(`/zones/${zone_id}/secondary_dns/outgoing`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Delete primary zone configuration for outgoing zone transfers.
       *
       * @example
       * ```ts
       * const outgoing =
       *   await client.dns.zoneTransfers.outgoing.delete({
       *     zone_id: '269d8f4853475ca241c4e730be286b20',
       *   });
       * ```
       */
      delete(params, options) {
        const { zone_id } = params;
        return this._client.delete(`/zones/${zone_id}/secondary_dns/outgoing`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Disable outgoing zone transfers for primary zone and clears IXFR backlog of
       * primary zone.
       *
       * @example
       * ```ts
       * const disableTransfer =
       *   await client.dns.zoneTransfers.outgoing.disable({
       *     zone_id: '269d8f4853475ca241c4e730be286b20',
       *     body: {},
       *   });
       * ```
       */
      disable(params, options) {
        const { zone_id, body } = params;
        return this._client.post(`/zones/${zone_id}/secondary_dns/outgoing/disable`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Enable outgoing zone transfers for primary zone.
       *
       * @example
       * ```ts
       * const enableTransfer =
       *   await client.dns.zoneTransfers.outgoing.enable({
       *     zone_id: '269d8f4853475ca241c4e730be286b20',
       *     body: {},
       *   });
       * ```
       */
      enable(params, options) {
        const { zone_id, body } = params;
        return this._client.post(`/zones/${zone_id}/secondary_dns/outgoing/enable`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Notifies the secondary nameserver(s) and clears IXFR backlog of primary zone.
       *
       * @example
       * ```ts
       * const response =
       *   await client.dns.zoneTransfers.outgoing.forceNotify({
       *     zone_id: '269d8f4853475ca241c4e730be286b20',
       *     body: {},
       *   });
       * ```
       */
      forceNotify(params, options) {
        const { zone_id, body } = params;
        return this._client.post(`/zones/${zone_id}/secondary_dns/outgoing/force_notify`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get primary zone configuration for outgoing zone transfers.
       *
       * @example
       * ```ts
       * const outgoing =
       *   await client.dns.zoneTransfers.outgoing.get({
       *     zone_id: '269d8f4853475ca241c4e730be286b20',
       *   });
       * ```
       */
      get(params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/secondary_dns/outgoing`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    OutgoingResource.Status = Status;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/dns/zone-transfers/zone-transfers.mjs
var ZoneTransfers;
var init_zone_transfers = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/dns/zone-transfers/zone-transfers.mjs"() {
    init_import_meta_url();
    init_resource();
    init_acls();
    init_acls();
    init_force_axfr();
    init_force_axfr();
    init_incoming();
    init_incoming();
    init_peers();
    init_peers();
    init_tsigs();
    init_tsigs();
    init_outgoing();
    init_outgoing();
    ZoneTransfers = class extends APIResource {
      static {
        __name(this, "ZoneTransfers");
      }
      constructor() {
        super(...arguments);
        this.forceAXFR = new ForceAXFRResource(this._client);
        this.incoming = new IncomingResource(this._client);
        this.outgoing = new OutgoingResource(this._client);
        this.acls = new ACLs(this._client);
        this.peers = new Peers(this._client);
        this.tsigs = new TSIGs(this._client);
      }
    };
    ZoneTransfers.ForceAXFRResource = ForceAXFRResource;
    ZoneTransfers.IncomingResource = IncomingResource;
    ZoneTransfers.OutgoingResource = OutgoingResource;
    ZoneTransfers.ACLs = ACLs;
    ZoneTransfers.ACLsSinglePage = ACLsSinglePage;
    ZoneTransfers.Peers = Peers;
    ZoneTransfers.PeersSinglePage = PeersSinglePage;
    ZoneTransfers.TSIGs = TSIGs;
    ZoneTransfers.TSIGsSinglePage = TSIGsSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/dns/dns.mjs
var DNS;
var init_dns = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/dns/dns.mjs"() {
    init_import_meta_url();
    init_resource();
    init_dnssec();
    init_dnssec();
    init_records();
    init_records();
    init_analytics();
    init_analytics();
    init_settings3();
    init_settings3();
    init_zone_transfers();
    init_zone_transfers();
    DNS = class extends APIResource {
      static {
        __name(this, "DNS");
      }
      constructor() {
        super(...arguments);
        this.dnssec = new DNSSECResource(this._client);
        this.records = new Records(this._client);
        this.settings = new Settings3(this._client);
        this.analytics = new Analytics(this._client);
        this.zoneTransfers = new ZoneTransfers(this._client);
      }
    };
    DNS.DNSSECResource = DNSSECResource;
    DNS.Records = Records;
    DNS.RecordResponsesV4PagePaginationArray = RecordResponsesV4PagePaginationArray;
    DNS.RecordResponsesSinglePage = RecordResponsesSinglePage;
    DNS.Settings = Settings3;
    DNS.Analytics = Analytics;
    DNS.ZoneTransfers = ZoneTransfers;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/dns-firewall/reverse-dns.mjs
var ReverseDNS;
var init_reverse_dns = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/dns-firewall/reverse-dns.mjs"() {
    init_import_meta_url();
    init_resource();
    ReverseDNS = class extends APIResource {
      static {
        __name(this, "ReverseDNS");
      }
      /**
       * Update reverse DNS configuration (PTR records) for a DNS Firewall cluster
       *
       * @example
       * ```ts
       * const response = await client.dnsFirewall.reverseDNS.edit(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      edit(dnsFirewallId, params, options) {
        const { account_id, ...body } = params;
        return this._client.patch(`/accounts/${account_id}/dns_firewall/${dnsFirewallId}/reverse_dns`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Show reverse DNS configuration (PTR records) for a DNS Firewall cluster
       *
       * @example
       * ```ts
       * const reverseDNS = await client.dnsFirewall.reverseDNS.get(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(dnsFirewallId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/dns_firewall/${dnsFirewallId}/reverse_dns`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/dns-firewall/analytics/reports/bytimes.mjs
var Bytimes2;
var init_bytimes2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/dns-firewall/analytics/reports/bytimes.mjs"() {
    init_import_meta_url();
    init_resource();
    Bytimes2 = class extends APIResource {
      static {
        __name(this, "Bytimes");
      }
      /**
       * Retrieves a list of aggregate metrics grouped by time interval.
       *
       * See
       * [Analytics API properties](https://developers.cloudflare.com/dns/reference/analytics-api-properties/)
       * for detailed information about the available query parameters.
       *
       * @example
       * ```ts
       * const byTime =
       *   await client.dnsFirewall.analytics.reports.bytimes.get(
       *     '023e105f4ecef8ad9ca31a8372d0c353',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      get(dnsFirewallId, params, options) {
        const { account_id, ...query } = params;
        return this._client.get(`/accounts/${account_id}/dns_firewall/${dnsFirewallId}/dns_analytics/report/bytime`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/dns-firewall/analytics/reports/reports.mjs
var Reports2;
var init_reports2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/dns-firewall/analytics/reports/reports.mjs"() {
    init_import_meta_url();
    init_resource();
    init_bytimes2();
    init_bytimes2();
    Reports2 = class extends APIResource {
      static {
        __name(this, "Reports");
      }
      constructor() {
        super(...arguments);
        this.bytimes = new Bytimes2(this._client);
      }
      /**
       * Retrieves a list of summarised aggregate metrics over a given time period.
       *
       * See
       * [Analytics API properties](https://developers.cloudflare.com/dns/reference/analytics-api-properties/)
       * for detailed information about the available query parameters.
       *
       * @example
       * ```ts
       * const report =
       *   await client.dnsFirewall.analytics.reports.get(
       *     '023e105f4ecef8ad9ca31a8372d0c353',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      get(dnsFirewallId, params, options) {
        const { account_id, ...query } = params;
        return this._client.get(`/accounts/${account_id}/dns_firewall/${dnsFirewallId}/dns_analytics/report`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
    Reports2.Bytimes = Bytimes2;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/dns-firewall/analytics/analytics.mjs
var Analytics2;
var init_analytics2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/dns-firewall/analytics/analytics.mjs"() {
    init_import_meta_url();
    init_resource();
    init_reports2();
    init_reports2();
    Analytics2 = class extends APIResource {
      static {
        __name(this, "Analytics");
      }
      constructor() {
        super(...arguments);
        this.reports = new Reports2(this._client);
      }
    };
    Analytics2.Reports = Reports2;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/dns-firewall/dns-firewall.mjs
var DNSFirewall, DNSFirewallListResponsesV4PagePaginationArray;
var init_dns_firewall = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/dns-firewall/dns-firewall.mjs"() {
    init_import_meta_url();
    init_resource();
    init_reverse_dns();
    init_reverse_dns();
    init_analytics2();
    init_analytics2();
    init_pagination();
    DNSFirewall = class extends APIResource {
      static {
        __name(this, "DNSFirewall");
      }
      constructor() {
        super(...arguments);
        this.analytics = new Analytics2(this._client);
        this.reverseDNS = new ReverseDNS(this._client);
      }
      /**
       * Create a DNS Firewall cluster
       *
       * @example
       * ```ts
       * const dnsFirewall = await client.dnsFirewall.create({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   name: 'My Awesome DNS Firewall cluster',
       *   upstream_ips: [
       *     '192.0.2.1',
       *     '198.51.100.1',
       *     '2001:DB8:100::CF',
       *   ],
       * });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/dns_firewall`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List DNS Firewall clusters for an account
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const dnsFirewallListResponse of client.dnsFirewall.list(
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/dns_firewall`, DNSFirewallListResponsesV4PagePaginationArray, { query, ...options });
      }
      /**
       * Delete a DNS Firewall cluster
       *
       * @example
       * ```ts
       * const dnsFirewall = await client.dnsFirewall.delete(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      delete(dnsFirewallId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/dns_firewall/${dnsFirewallId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Modify the configuration of a DNS Firewall cluster
       *
       * @example
       * ```ts
       * const response = await client.dnsFirewall.edit(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      edit(dnsFirewallId, params, options) {
        const { account_id, ...body } = params;
        return this._client.patch(`/accounts/${account_id}/dns_firewall/${dnsFirewallId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Show a single DNS Firewall cluster for an account
       *
       * @example
       * ```ts
       * const dnsFirewall = await client.dnsFirewall.get(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(dnsFirewallId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/dns_firewall/${dnsFirewallId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    DNSFirewallListResponsesV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "DNSFirewallListResponsesV4PagePaginationArray");
      }
    };
    DNSFirewall.DNSFirewallListResponsesV4PagePaginationArray = DNSFirewallListResponsesV4PagePaginationArray;
    DNSFirewall.Analytics = Analytics2;
    DNSFirewall.ReverseDNS = ReverseDNS;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/diagnostics/endpoint-healthchecks.mjs
var EndpointHealthchecks;
var init_endpoint_healthchecks = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/diagnostics/endpoint-healthchecks.mjs"() {
    init_import_meta_url();
    init_resource();
    EndpointHealthchecks = class extends APIResource {
      static {
        __name(this, "EndpointHealthchecks");
      }
      /**
       * Create Endpoint Health Check.
       *
       * @example
       * ```ts
       * const endpointHealthcheck =
       *   await client.diagnostics.endpointHealthchecks.create({
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     check_type: 'icmp',
       *     endpoint: '203.0.113.1',
       *   });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/diagnostics/endpoint-healthchecks`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Update a Endpoint Health Check.
       *
       * @example
       * ```ts
       * const endpointHealthcheck =
       *   await client.diagnostics.endpointHealthchecks.update(
       *     'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *     {
       *       account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *       check_type: 'icmp',
       *       endpoint: '203.0.113.1',
       *     },
       *   );
       * ```
       */
      update(id, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/diagnostics/endpoint-healthchecks/${id}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List Endpoint Health Checks.
       *
       * @example
       * ```ts
       * const endpointHealthchecks =
       *   await client.diagnostics.endpointHealthchecks.list({
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   });
       * ```
       */
      list(params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/diagnostics/endpoint-healthchecks`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Delete Endpoint Health Check.
       *
       * @example
       * ```ts
       * const endpointHealthcheck =
       *   await client.diagnostics.endpointHealthchecks.delete(
       *     'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      delete(id, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/diagnostics/endpoint-healthchecks/${id}`, options);
      }
      /**
       * Get a single Endpoint Health Check.
       *
       * @example
       * ```ts
       * const endpointHealthcheck =
       *   await client.diagnostics.endpointHealthchecks.get(
       *     'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      get(id, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/diagnostics/endpoint-healthchecks/${id}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/diagnostics/traceroutes.mjs
var Traceroutes, TraceroutesSinglePage;
var init_traceroutes = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/diagnostics/traceroutes.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Traceroutes = class extends APIResource {
      static {
        __name(this, "Traceroutes");
      }
      /**
       * Run traceroutes from Cloudflare colos.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const traceroute of client.diagnostics.traceroutes.create(
       *   {
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     targets: ['203.0.113.1', 'cloudflare.com'],
       *   },
       * )) {
       *   // ...
       * }
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.getAPIList(`/accounts/${account_id}/diagnostics/traceroute`, TraceroutesSinglePage, {
          body,
          method: "post",
          ...options
        });
      }
    };
    TraceroutesSinglePage = class extends SinglePage {
      static {
        __name(this, "TraceroutesSinglePage");
      }
    };
    Traceroutes.TraceroutesSinglePage = TraceroutesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/diagnostics/diagnostics.mjs
var Diagnostics2;
var init_diagnostics = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/diagnostics/diagnostics.mjs"() {
    init_import_meta_url();
    init_resource();
    init_endpoint_healthchecks();
    init_endpoint_healthchecks();
    init_traceroutes();
    init_traceroutes();
    Diagnostics2 = class extends APIResource {
      static {
        __name(this, "Diagnostics");
      }
      constructor() {
        super(...arguments);
        this.traceroutes = new Traceroutes(this._client);
        this.endpointHealthchecks = new EndpointHealthchecks(this._client);
      }
    };
    Diagnostics2.Traceroutes = Traceroutes;
    Diagnostics2.TraceroutesSinglePage = TraceroutesSinglePage;
    Diagnostics2.EndpointHealthchecks = EndpointHealthchecks;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/durable-objects/namespaces/objects.mjs
var Objects, DurableObjectsCursorPaginationAfter;
var init_objects = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/durable-objects/namespaces/objects.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Objects = class extends APIResource {
      static {
        __name(this, "Objects");
      }
      /**
       * Returns the Durable Objects in a given namespace.
       */
      list(id, params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/workers/durable_objects/namespaces/${id}/objects`, DurableObjectsCursorPaginationAfter, { query, ...options });
      }
    };
    DurableObjectsCursorPaginationAfter = class extends CursorPaginationAfter {
      static {
        __name(this, "DurableObjectsCursorPaginationAfter");
      }
    };
    Objects.DurableObjectsCursorPaginationAfter = DurableObjectsCursorPaginationAfter;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/durable-objects/namespaces/namespaces.mjs
var Namespaces, NamespacesV4PagePaginationArray;
var init_namespaces = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/durable-objects/namespaces/namespaces.mjs"() {
    init_import_meta_url();
    init_resource();
    init_objects();
    init_objects();
    init_pagination();
    Namespaces = class extends APIResource {
      static {
        __name(this, "Namespaces");
      }
      constructor() {
        super(...arguments);
        this.objects = new Objects(this._client);
      }
      /**
       * Returns the Durable Object namespaces owned by an account.
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/workers/durable_objects/namespaces`, NamespacesV4PagePaginationArray, { query, ...options });
      }
    };
    NamespacesV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "NamespacesV4PagePaginationArray");
      }
    };
    Namespaces.NamespacesV4PagePaginationArray = NamespacesV4PagePaginationArray;
    Namespaces.Objects = Objects;
    Namespaces.DurableObjectsCursorPaginationAfter = DurableObjectsCursorPaginationAfter;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/durable-objects/durable-objects.mjs
var DurableObjects;
var init_durable_objects = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/durable-objects/durable-objects.mjs"() {
    init_import_meta_url();
    init_resource();
    init_namespaces();
    init_namespaces();
    DurableObjects = class extends APIResource {
      static {
        __name(this, "DurableObjects");
      }
      constructor() {
        super(...arguments);
        this.namespaces = new Namespaces(this._client);
      }
    };
    DurableObjects.Namespaces = Namespaces;
    DurableObjects.NamespacesV4PagePaginationArray = NamespacesV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/email-routing/addresses.mjs
var Addresses, AddressesV4PagePaginationArray;
var init_addresses = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/email-routing/addresses.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Addresses = class extends APIResource {
      static {
        __name(this, "Addresses");
      }
      /**
       * Create a destination address to forward your emails to. Destination addresses
       * need to be verified before they can be used.
       *
       * @example
       * ```ts
       * const address = await client.emailRouting.addresses.create({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   email: 'user@example.com',
       * });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/email/routing/addresses`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Lists existing destination addresses.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const address of client.emailRouting.addresses.list(
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/email/routing/addresses`, AddressesV4PagePaginationArray, { query, ...options });
      }
      /**
       * Deletes a specific destination address.
       *
       * @example
       * ```ts
       * const address = await client.emailRouting.addresses.delete(
       *   'ea95132c15732412d22c1476fa83f27a',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      delete(destinationAddressIdentifier, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/email/routing/addresses/${destinationAddressIdentifier}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Gets information for a specific destination email already created.
       *
       * @example
       * ```ts
       * const address = await client.emailRouting.addresses.get(
       *   'ea95132c15732412d22c1476fa83f27a',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(destinationAddressIdentifier, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/email/routing/addresses/${destinationAddressIdentifier}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    AddressesV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "AddressesV4PagePaginationArray");
      }
    };
    Addresses.AddressesV4PagePaginationArray = AddressesV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/email-routing/dns.mjs
var DNS2, DNSRecordsSinglePage;
var init_dns2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/email-routing/dns.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    DNS2 = class extends APIResource {
      static {
        __name(this, "DNS");
      }
      /**
       * Enable you Email Routing zone. Add and lock the necessary MX and SPF records.
       *
       * @example
       * ```ts
       * const settings = await client.emailRouting.dns.create({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      create(params, options) {
        const { zone_id, ...body } = params;
        return this._client.post(`/zones/${zone_id}/email/routing/dns`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Disable your Email Routing zone. Also removes additional MX records previously
       * required for Email Routing to work.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const dnsRecord of client.emailRouting.dns.delete(
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      delete(params, options) {
        const { zone_id } = params;
        return this._client.getAPIList(`/zones/${zone_id}/email/routing/dns`, DNSRecordsSinglePage, {
          method: "delete",
          ...options
        });
      }
      /**
       * Unlock MX Records previously locked by Email Routing.
       *
       * @example
       * ```ts
       * const settings = await client.emailRouting.dns.edit({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      edit(params, options) {
        const { zone_id, ...body } = params;
        return this._client.patch(`/zones/${zone_id}/email/routing/dns`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Show the DNS records needed to configure your Email Routing zone.
       *
       * @example
       * ```ts
       * const dns = await client.emailRouting.dns.get({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      get(params, options) {
        const { zone_id, ...query } = params;
        return this._client.get(`/zones/${zone_id}/email/routing/dns`, { query, ...options });
      }
    };
    DNSRecordsSinglePage = class extends SinglePage {
      static {
        __name(this, "DNSRecordsSinglePage");
      }
    };
    DNS2.DNSRecordsSinglePage = DNSRecordsSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/email-routing/rules/catch-alls.mjs
var CatchAlls;
var init_catch_alls = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/email-routing/rules/catch-alls.mjs"() {
    init_import_meta_url();
    init_resource();
    CatchAlls = class extends APIResource {
      static {
        __name(this, "CatchAlls");
      }
      /**
       * Enable or disable catch-all routing rule, or change action to forward to
       * specific destination address.
       *
       * @example
       * ```ts
       * const catchAll =
       *   await client.emailRouting.rules.catchAlls.update({
       *     zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     actions: [{ type: 'forward' }],
       *     matchers: [{ type: 'all' }],
       *   });
       * ```
       */
      update(params, options) {
        const { zone_id, ...body } = params;
        return this._client.put(`/zones/${zone_id}/email/routing/rules/catch_all`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get information on the default catch-all routing rule.
       *
       * @example
       * ```ts
       * const catchAll =
       *   await client.emailRouting.rules.catchAlls.get({
       *     zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   });
       * ```
       */
      get(params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/email/routing/rules/catch_all`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/email-routing/rules/rules.mjs
var Rules2, EmailRoutingRulesV4PagePaginationArray;
var init_rules3 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/email-routing/rules/rules.mjs"() {
    init_import_meta_url();
    init_resource();
    init_catch_alls();
    init_catch_alls();
    init_pagination();
    Rules2 = class extends APIResource {
      static {
        __name(this, "Rules");
      }
      constructor() {
        super(...arguments);
        this.catchAlls = new CatchAlls(this._client);
      }
      /**
       * Rules consist of a set of criteria for matching emails (such as an email being
       * sent to a specific custom email address) plus a set of actions to take on the
       * email (like forwarding it to a specific destination address).
       *
       * @example
       * ```ts
       * const emailRoutingRule =
       *   await client.emailRouting.rules.create({
       *     zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     actions: [{ type: 'forward' }],
       *     matchers: [{ type: 'literal' }],
       *   });
       * ```
       */
      create(params, options) {
        const { zone_id, ...body } = params;
        return this._client.post(`/zones/${zone_id}/email/routing/rules`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Update actions and matches, or enable/disable specific routing rules.
       *
       * @example
       * ```ts
       * const emailRoutingRule =
       *   await client.emailRouting.rules.update(
       *     'a7e6fb77503c41d8a7f3113c6918f10c',
       *     {
       *       zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *       actions: [{ type: 'forward' }],
       *       matchers: [{ type: 'literal' }],
       *     },
       *   );
       * ```
       */
      update(ruleIdentifier, params, options) {
        const { zone_id, ...body } = params;
        return this._client.put(`/zones/${zone_id}/email/routing/rules/${ruleIdentifier}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Lists existing routing rules.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const emailRoutingRule of client.emailRouting.rules.list(
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { zone_id, ...query } = params;
        return this._client.getAPIList(`/zones/${zone_id}/email/routing/rules`, EmailRoutingRulesV4PagePaginationArray, { query, ...options });
      }
      /**
       * Delete a specific routing rule.
       *
       * @example
       * ```ts
       * const emailRoutingRule =
       *   await client.emailRouting.rules.delete(
       *     'a7e6fb77503c41d8a7f3113c6918f10c',
       *     { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      delete(ruleIdentifier, params, options) {
        const { zone_id } = params;
        return this._client.delete(`/zones/${zone_id}/email/routing/rules/${ruleIdentifier}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get information for a specific routing rule already created.
       *
       * @example
       * ```ts
       * const emailRoutingRule =
       *   await client.emailRouting.rules.get(
       *     'a7e6fb77503c41d8a7f3113c6918f10c',
       *     { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      get(ruleIdentifier, params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/email/routing/rules/${ruleIdentifier}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    EmailRoutingRulesV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "EmailRoutingRulesV4PagePaginationArray");
      }
    };
    Rules2.EmailRoutingRulesV4PagePaginationArray = EmailRoutingRulesV4PagePaginationArray;
    Rules2.CatchAlls = CatchAlls;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/email-routing/email-routing.mjs
var EmailRouting;
var init_email_routing = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/email-routing/email-routing.mjs"() {
    init_import_meta_url();
    init_resource();
    init_addresses();
    init_addresses();
    init_dns2();
    init_dns2();
    init_rules3();
    init_rules3();
    EmailRouting = class extends APIResource {
      static {
        __name(this, "EmailRouting");
      }
      constructor() {
        super(...arguments);
        this.dns = new DNS2(this._client);
        this.rules = new Rules2(this._client);
        this.addresses = new Addresses(this._client);
      }
      /**
       * Disable your Email Routing zone. Also removes additional MX records previously
       * required for Email Routing to work.
       *
       * @deprecated
       */
      disable(params, options) {
        const { zone_id, body } = params;
        return this._client.post(`/zones/${zone_id}/email/routing/disable`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Enable you Email Routing zone. Add and lock the necessary MX and SPF records.
       *
       * @deprecated
       */
      enable(params, options) {
        const { zone_id, body } = params;
        return this._client.post(`/zones/${zone_id}/email/routing/enable`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get information about the settings for your Email Routing zone.
       *
       * @example
       * ```ts
       * const settings = await client.emailRouting.get({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      get(params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/email/routing`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    EmailRouting.DNS = DNS2;
    EmailRouting.DNSRecordsSinglePage = DNSRecordsSinglePage;
    EmailRouting.Rules = Rules2;
    EmailRouting.EmailRoutingRulesV4PagePaginationArray = EmailRoutingRulesV4PagePaginationArray;
    EmailRouting.Addresses = Addresses;
    EmailRouting.AddressesV4PagePaginationArray = AddressesV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/email-security/submissions.mjs
var Submissions, SubmissionListResponsesV4PagePaginationArray;
var init_submissions = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/email-security/submissions.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Submissions = class extends APIResource {
      static {
        __name(this, "Submissions");
      }
      /**
       * This endpoint returns information for submissions to made to reclassify emails.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const submissionListResponse of client.emailSecurity.submissions.list(
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/email-security/submissions`, SubmissionListResponsesV4PagePaginationArray, { query, ...options });
      }
    };
    SubmissionListResponsesV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "SubmissionListResponsesV4PagePaginationArray");
      }
    };
    Submissions.SubmissionListResponsesV4PagePaginationArray = SubmissionListResponsesV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/email-security/investigate/detections.mjs
var Detections;
var init_detections = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/email-security/investigate/detections.mjs"() {
    init_import_meta_url();
    init_resource();
    Detections = class extends APIResource {
      static {
        __name(this, "Detections");
      }
      /**
       * Returns detection details such as threat categories and sender information for
       * non-benign messages.
       *
       * @example
       * ```ts
       * const detection =
       *   await client.emailSecurity.investigate.detections.get(
       *     '4Njp3P0STMz2c02Q',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      get(postfixId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/email-security/investigate/${postfixId}/detections`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/email-security/investigate/move.mjs
var Move, MoveCreateResponsesSinglePage, MoveBulkResponsesSinglePage;
var init_move = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/email-security/investigate/move.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Move = class extends APIResource {
      static {
        __name(this, "Move");
      }
      /**
       * Move a message
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const moveCreateResponse of client.emailSecurity.investigate.move.create(
       *   '4Njp3P0STMz2c02Q',
       *   {
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     destination: 'Inbox',
       *   },
       * )) {
       *   // ...
       * }
       * ```
       */
      create(postfixId, params, options) {
        const { account_id, ...body } = params;
        return this._client.getAPIList(`/accounts/${account_id}/email-security/investigate/${postfixId}/move`, MoveCreateResponsesSinglePage, { body, method: "post", ...options });
      }
      /**
       * Move multiple messages
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const moveBulkResponse of client.emailSecurity.investigate.move.bulk(
       *   {
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     destination: 'Inbox',
       *     postfix_ids: ['4Njp3P0STMz2c02Q'],
       *   },
       * )) {
       *   // ...
       * }
       * ```
       */
      bulk(params, options) {
        const { account_id, ...body } = params;
        return this._client.getAPIList(`/accounts/${account_id}/email-security/investigate/move`, MoveBulkResponsesSinglePage, { body, method: "post", ...options });
      }
    };
    MoveCreateResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "MoveCreateResponsesSinglePage");
      }
    };
    MoveBulkResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "MoveBulkResponsesSinglePage");
      }
    };
    Move.MoveCreateResponsesSinglePage = MoveCreateResponsesSinglePage;
    Move.MoveBulkResponsesSinglePage = MoveBulkResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/email-security/investigate/preview.mjs
var Preview;
var init_preview = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/email-security/investigate/preview.mjs"() {
    init_import_meta_url();
    init_resource();
    Preview = class extends APIResource {
      static {
        __name(this, "Preview");
      }
      /**
       * Preview for non-detection messages
       *
       * @example
       * ```ts
       * const preview =
       *   await client.emailSecurity.investigate.preview.create({
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     postfix_id: '4Njp3P0STMz2c02Q',
       *   });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/email-security/investigate/preview`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Returns a preview of the message body as a base64 encoded PNG image for
       * non-benign messages.
       *
       * @example
       * ```ts
       * const preview =
       *   await client.emailSecurity.investigate.preview.get(
       *     '4Njp3P0STMz2c02Q',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      get(postfixId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/email-security/investigate/${postfixId}/preview`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/email-security/investigate/raw.mjs
var Raw2;
var init_raw2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/email-security/investigate/raw.mjs"() {
    init_import_meta_url();
    init_resource();
    Raw2 = class extends APIResource {
      static {
        __name(this, "Raw");
      }
      /**
       * Returns the raw eml of any non-benign message.
       *
       * @example
       * ```ts
       * const raw = await client.emailSecurity.investigate.raw.get(
       *   '4Njp3P0STMz2c02Q',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(postfixId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/email-security/investigate/${postfixId}/raw`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/email-security/investigate/reclassify.mjs
var Reclassify;
var init_reclassify = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/email-security/investigate/reclassify.mjs"() {
    init_import_meta_url();
    init_resource();
    Reclassify = class extends APIResource {
      static {
        __name(this, "Reclassify");
      }
      /**
       * Change email classfication
       *
       * @example
       * ```ts
       * const reclassify =
       *   await client.emailSecurity.investigate.reclassify.create(
       *     '4Njp3P0STMz2c02Q',
       *     {
       *       account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *       expected_disposition: 'NONE',
       *     },
       *   );
       * ```
       */
      create(postfixId, params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/email-security/investigate/${postfixId}/reclassify`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/email-security/investigate/release.mjs
var Release, ReleaseBulkResponsesSinglePage;
var init_release = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/email-security/investigate/release.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Release = class extends APIResource {
      static {
        __name(this, "Release");
      }
      /**
       * Release messages from quarantine
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const releaseBulkResponse of client.emailSecurity.investigate.release.bulk(
       *   {
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     body: ['4Njp3P0STMz2c02Q'],
       *   },
       * )) {
       *   // ...
       * }
       * ```
       */
      bulk(params, options) {
        const { account_id, body } = params;
        return this._client.getAPIList(`/accounts/${account_id}/email-security/investigate/release`, ReleaseBulkResponsesSinglePage, { body, method: "post", ...options });
      }
    };
    ReleaseBulkResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "ReleaseBulkResponsesSinglePage");
      }
    };
    Release.ReleaseBulkResponsesSinglePage = ReleaseBulkResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/email-security/investigate/trace.mjs
var Trace;
var init_trace = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/email-security/investigate/trace.mjs"() {
    init_import_meta_url();
    init_resource();
    Trace = class extends APIResource {
      static {
        __name(this, "Trace");
      }
      /**
       * Get email trace
       *
       * @example
       * ```ts
       * const trace =
       *   await client.emailSecurity.investigate.trace.get(
       *     '4Njp3P0STMz2c02Q',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      get(postfixId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/email-security/investigate/${postfixId}/trace`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/email-security/investigate/investigate.mjs
var Investigate, InvestigateListResponsesV4PagePaginationArray;
var init_investigate = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/email-security/investigate/investigate.mjs"() {
    init_import_meta_url();
    init_resource();
    init_detections();
    init_detections();
    init_move();
    init_move();
    init_preview();
    init_preview();
    init_raw2();
    init_raw2();
    init_reclassify();
    init_reclassify();
    init_release();
    init_release();
    init_trace();
    init_trace();
    init_pagination();
    Investigate = class extends APIResource {
      static {
        __name(this, "Investigate");
      }
      constructor() {
        super(...arguments);
        this.detections = new Detections(this._client);
        this.preview = new Preview(this._client);
        this.raw = new Raw2(this._client);
        this.trace = new Trace(this._client);
        this.move = new Move(this._client);
        this.reclassify = new Reclassify(this._client);
        this.release = new Release(this._client);
      }
      /**
       * Returns information for each email that matches the search parameter(s).
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const investigateListResponse of client.emailSecurity.investigate.list(
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/email-security/investigate`, InvestigateListResponsesV4PagePaginationArray, { query, ...options });
      }
      /**
       * Get message details
       *
       * @example
       * ```ts
       * const investigate =
       *   await client.emailSecurity.investigate.get(
       *     '4Njp3P0STMz2c02Q',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      get(postfixId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/email-security/investigate/${postfixId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    InvestigateListResponsesV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "InvestigateListResponsesV4PagePaginationArray");
      }
    };
    Investigate.InvestigateListResponsesV4PagePaginationArray = InvestigateListResponsesV4PagePaginationArray;
    Investigate.Detections = Detections;
    Investigate.Preview = Preview;
    Investigate.Raw = Raw2;
    Investigate.Trace = Trace;
    Investigate.Move = Move;
    Investigate.MoveCreateResponsesSinglePage = MoveCreateResponsesSinglePage;
    Investigate.MoveBulkResponsesSinglePage = MoveBulkResponsesSinglePage;
    Investigate.Reclassify = Reclassify;
    Investigate.Release = Release;
    Investigate.ReleaseBulkResponsesSinglePage = ReleaseBulkResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/email-security/settings/allow-policies.mjs
var AllowPolicies, AllowPolicyListResponsesV4PagePaginationArray;
var init_allow_policies = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/email-security/settings/allow-policies.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    AllowPolicies = class extends APIResource {
      static {
        __name(this, "AllowPolicies");
      }
      /**
       * Create an email allow policy
       *
       * @example
       * ```ts
       * const allowPolicy =
       *   await client.emailSecurity.settings.allowPolicies.create({
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     is_acceptable_sender: false,
       *     is_exempt_recipient: false,
       *     is_regex: false,
       *     is_trusted_sender: true,
       *     pattern: 'test@example.com',
       *     pattern_type: 'EMAIL',
       *     verify_sender: true,
       *   });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/email-security/settings/allow_policies`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Lists, searches, and sorts an account’s email allow policies.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const allowPolicyListResponse of client.emailSecurity.settings.allowPolicies.list(
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/email-security/settings/allow_policies`, AllowPolicyListResponsesV4PagePaginationArray, { query, ...options });
      }
      /**
       * Delete an email allow policy
       *
       * @example
       * ```ts
       * const allowPolicy =
       *   await client.emailSecurity.settings.allowPolicies.delete(
       *     2401,
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      delete(policyId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/email-security/settings/allow_policies/${policyId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Update an email allow policy
       *
       * @example
       * ```ts
       * const response =
       *   await client.emailSecurity.settings.allowPolicies.edit(
       *     2401,
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      edit(policyId, params, options) {
        const { account_id, ...body } = params;
        return this._client.patch(`/accounts/${account_id}/email-security/settings/allow_policies/${policyId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get an email allow policy
       *
       * @example
       * ```ts
       * const allowPolicy =
       *   await client.emailSecurity.settings.allowPolicies.get(
       *     2401,
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      get(policyId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/email-security/settings/allow_policies/${policyId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    AllowPolicyListResponsesV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "AllowPolicyListResponsesV4PagePaginationArray");
      }
    };
    AllowPolicies.AllowPolicyListResponsesV4PagePaginationArray = AllowPolicyListResponsesV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/email-security/settings/block-senders.mjs
var BlockSenders, BlockSenderListResponsesV4PagePaginationArray;
var init_block_senders = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/email-security/settings/block-senders.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    BlockSenders = class extends APIResource {
      static {
        __name(this, "BlockSenders");
      }
      /**
       * Create a blocked email sender
       *
       * @example
       * ```ts
       * const blockSender =
       *   await client.emailSecurity.settings.blockSenders.create({
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     is_regex: false,
       *     pattern: 'test@example.com',
       *     pattern_type: 'EMAIL',
       *   });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/email-security/settings/block_senders`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List blocked email senders
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const blockSenderListResponse of client.emailSecurity.settings.blockSenders.list(
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/email-security/settings/block_senders`, BlockSenderListResponsesV4PagePaginationArray, { query, ...options });
      }
      /**
       * Delete a blocked email sender
       *
       * @example
       * ```ts
       * const blockSender =
       *   await client.emailSecurity.settings.blockSenders.delete(
       *     2402,
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      delete(patternId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/email-security/settings/block_senders/${patternId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Update a blocked email sender
       *
       * @example
       * ```ts
       * const response =
       *   await client.emailSecurity.settings.blockSenders.edit(
       *     2402,
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      edit(patternId, params, options) {
        const { account_id, ...body } = params;
        return this._client.patch(`/accounts/${account_id}/email-security/settings/block_senders/${patternId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get a blocked email sender
       *
       * @example
       * ```ts
       * const blockSender =
       *   await client.emailSecurity.settings.blockSenders.get(
       *     2402,
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      get(patternId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/email-security/settings/block_senders/${patternId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    BlockSenderListResponsesV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "BlockSenderListResponsesV4PagePaginationArray");
      }
    };
    BlockSenders.BlockSenderListResponsesV4PagePaginationArray = BlockSenderListResponsesV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/email-security/settings/domains.mjs
var Domains, DomainListResponsesV4PagePaginationArray, DomainBulkDeleteResponsesSinglePage;
var init_domains = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/email-security/settings/domains.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Domains = class extends APIResource {
      static {
        __name(this, "Domains");
      }
      /**
       * Lists, searches, and sorts an account’s email domains.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const domainListResponse of client.emailSecurity.settings.domains.list(
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/email-security/settings/domains`, DomainListResponsesV4PagePaginationArray, { query, ...options });
      }
      /**
       * Unprotect an email domain
       *
       * @example
       * ```ts
       * const domain =
       *   await client.emailSecurity.settings.domains.delete(2400, {
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   });
       * ```
       */
      delete(domainId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/email-security/settings/domains/${domainId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Unprotect multiple email domains
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const domainBulkDeleteResponse of client.emailSecurity.settings.domains.bulkDelete(
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      bulkDelete(params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/email-security/settings/domains`, DomainBulkDeleteResponsesSinglePage, { method: "delete", ...options });
      }
      /**
       * Update an email domain
       *
       * @example
       * ```ts
       * const response =
       *   await client.emailSecurity.settings.domains.edit(2400, {
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     ip_restrictions: ['192.0.2.0/24', '2001:db8::/32'],
       *   });
       * ```
       */
      edit(domainId, params, options) {
        const { account_id, ...body } = params;
        return this._client.patch(`/accounts/${account_id}/email-security/settings/domains/${domainId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get an email domain
       *
       * @example
       * ```ts
       * const domain =
       *   await client.emailSecurity.settings.domains.get(2400, {
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   });
       * ```
       */
      get(domainId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/email-security/settings/domains/${domainId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    DomainListResponsesV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "DomainListResponsesV4PagePaginationArray");
      }
    };
    DomainBulkDeleteResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "DomainBulkDeleteResponsesSinglePage");
      }
    };
    Domains.DomainListResponsesV4PagePaginationArray = DomainListResponsesV4PagePaginationArray;
    Domains.DomainBulkDeleteResponsesSinglePage = DomainBulkDeleteResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/email-security/settings/impersonation-registry.mjs
var ImpersonationRegistry, ImpersonationRegistryListResponsesV4PagePaginationArray;
var init_impersonation_registry = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/email-security/settings/impersonation-registry.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    ImpersonationRegistry = class extends APIResource {
      static {
        __name(this, "ImpersonationRegistry");
      }
      /**
       * Create an entry in impersonation registry
       *
       * @example
       * ```ts
       * const impersonationRegistry =
       *   await client.emailSecurity.settings.impersonationRegistry.create(
       *     {
       *       account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *       email: 'email',
       *       is_email_regex: true,
       *       name: 'name',
       *     },
       *   );
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/email-security/settings/impersonation_registry`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Lists, searches, and sorts entries in the impersonation registry.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const impersonationRegistryListResponse of client.emailSecurity.settings.impersonationRegistry.list(
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/email-security/settings/impersonation_registry`, ImpersonationRegistryListResponsesV4PagePaginationArray, { query, ...options });
      }
      /**
       * Delete an entry from impersonation registry
       *
       * @example
       * ```ts
       * const impersonationRegistry =
       *   await client.emailSecurity.settings.impersonationRegistry.delete(
       *     2403,
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      delete(displayNameId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/email-security/settings/impersonation_registry/${displayNameId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Update an entry in impersonation registry
       *
       * @example
       * ```ts
       * const response =
       *   await client.emailSecurity.settings.impersonationRegistry.edit(
       *     2403,
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      edit(displayNameId, params, options) {
        const { account_id, ...body } = params;
        return this._client.patch(`/accounts/${account_id}/email-security/settings/impersonation_registry/${displayNameId}`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get an entry in impersonation registry
       *
       * @example
       * ```ts
       * const impersonationRegistry =
       *   await client.emailSecurity.settings.impersonationRegistry.get(
       *     2403,
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      get(displayNameId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/email-security/settings/impersonation_registry/${displayNameId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    ImpersonationRegistryListResponsesV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "ImpersonationRegistryListResponsesV4PagePaginationArray");
      }
    };
    ImpersonationRegistry.ImpersonationRegistryListResponsesV4PagePaginationArray = ImpersonationRegistryListResponsesV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/email-security/settings/trusted-domains.mjs
var TrustedDomains, TrustedDomainListResponsesV4PagePaginationArray;
var init_trusted_domains = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/email-security/settings/trusted-domains.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    TrustedDomains = class extends APIResource {
      static {
        __name(this, "TrustedDomains");
      }
      /**
       * Create a trusted email domain
       *
       * @example
       * ```ts
       * const trustedDomain =
       *   await client.emailSecurity.settings.trustedDomains.create(
       *     {
       *       account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *       is_recent: true,
       *       is_regex: false,
       *       is_similarity: false,
       *       pattern: 'example.com',
       *     },
       *   );
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/email-security/settings/trusted_domains`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Lists, searches, and sorts an account’s trusted email domains.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const trustedDomainListResponse of client.emailSecurity.settings.trustedDomains.list(
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/email-security/settings/trusted_domains`, TrustedDomainListResponsesV4PagePaginationArray, { query, ...options });
      }
      /**
       * Delete a trusted email domain
       *
       * @example
       * ```ts
       * const trustedDomain =
       *   await client.emailSecurity.settings.trustedDomains.delete(
       *     2401,
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      delete(trustedDomainId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/email-security/settings/trusted_domains/${trustedDomainId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Update a trusted email domain
       *
       * @example
       * ```ts
       * const response =
       *   await client.emailSecurity.settings.trustedDomains.edit(
       *     2401,
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      edit(trustedDomainId, params, options) {
        const { account_id, ...body } = params;
        return this._client.patch(`/accounts/${account_id}/email-security/settings/trusted_domains/${trustedDomainId}`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get a trusted email domain
       *
       * @example
       * ```ts
       * const trustedDomain =
       *   await client.emailSecurity.settings.trustedDomains.get(
       *     2401,
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      get(trustedDomainId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/email-security/settings/trusted_domains/${trustedDomainId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    TrustedDomainListResponsesV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "TrustedDomainListResponsesV4PagePaginationArray");
      }
    };
    TrustedDomains.TrustedDomainListResponsesV4PagePaginationArray = TrustedDomainListResponsesV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/email-security/settings/settings.mjs
var Settings4;
var init_settings4 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/email-security/settings/settings.mjs"() {
    init_import_meta_url();
    init_resource();
    init_allow_policies();
    init_allow_policies();
    init_block_senders();
    init_block_senders();
    init_domains();
    init_domains();
    init_impersonation_registry();
    init_impersonation_registry();
    init_trusted_domains();
    init_trusted_domains();
    Settings4 = class extends APIResource {
      static {
        __name(this, "Settings");
      }
      constructor() {
        super(...arguments);
        this.allowPolicies = new AllowPolicies(this._client);
        this.blockSenders = new BlockSenders(this._client);
        this.domains = new Domains(this._client);
        this.impersonationRegistry = new ImpersonationRegistry(this._client);
        this.trustedDomains = new TrustedDomains(this._client);
      }
    };
    Settings4.AllowPolicies = AllowPolicies;
    Settings4.AllowPolicyListResponsesV4PagePaginationArray = AllowPolicyListResponsesV4PagePaginationArray;
    Settings4.BlockSenders = BlockSenders;
    Settings4.BlockSenderListResponsesV4PagePaginationArray = BlockSenderListResponsesV4PagePaginationArray;
    Settings4.Domains = Domains;
    Settings4.DomainListResponsesV4PagePaginationArray = DomainListResponsesV4PagePaginationArray;
    Settings4.DomainBulkDeleteResponsesSinglePage = DomainBulkDeleteResponsesSinglePage;
    Settings4.ImpersonationRegistry = ImpersonationRegistry;
    Settings4.ImpersonationRegistryListResponsesV4PagePaginationArray = ImpersonationRegistryListResponsesV4PagePaginationArray;
    Settings4.TrustedDomains = TrustedDomains;
    Settings4.TrustedDomainListResponsesV4PagePaginationArray = TrustedDomainListResponsesV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/email-security/email-security.mjs
var EmailSecurity;
var init_email_security = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/email-security/email-security.mjs"() {
    init_import_meta_url();
    init_resource();
    init_submissions();
    init_submissions();
    init_investigate();
    init_investigate();
    init_settings4();
    init_settings4();
    EmailSecurity = class extends APIResource {
      static {
        __name(this, "EmailSecurity");
      }
      constructor() {
        super(...arguments);
        this.investigate = new Investigate(this._client);
        this.settings = new Settings4(this._client);
        this.submissions = new Submissions(this._client);
      }
    };
    EmailSecurity.Investigate = Investigate;
    EmailSecurity.InvestigateListResponsesV4PagePaginationArray = InvestigateListResponsesV4PagePaginationArray;
    EmailSecurity.Settings = Settings4;
    EmailSecurity.Submissions = Submissions;
    EmailSecurity.SubmissionListResponsesV4PagePaginationArray = SubmissionListResponsesV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/filters.mjs
var Filters, FirewallFiltersSinglePage, FirewallFiltersV4PagePaginationArray;
var init_filters = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/filters.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Filters = class extends APIResource {
      static {
        __name(this, "Filters");
      }
      /**
       * Creates one or more filters.
       *
       * @deprecated The Filters API is deprecated in favour of using the Ruleset Engine. See https://developers.cloudflare.com/fundamentals/api/reference/deprecations/#firewall-rules-api-and-filters-api for full details.
       */
      create(params, options) {
        const { zone_id, body } = params;
        return this._client.getAPIList(`/zones/${zone_id}/filters`, FirewallFiltersSinglePage, {
          body,
          method: "post",
          ...options
        });
      }
      /**
       * Updates an existing filter.
       *
       * @deprecated The Filters API is deprecated in favour of using the Ruleset Engine. See https://developers.cloudflare.com/fundamentals/api/reference/deprecations/#firewall-rules-api-and-filters-api for full details.
       */
      update(filterId, params, options) {
        const { zone_id, ...body } = params;
        return this._client.put(`/zones/${zone_id}/filters/${filterId}`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetches filters in a zone. You can filter the results using several optional
       * parameters.
       *
       * @deprecated The Filters API is deprecated in favour of using the Ruleset Engine. See https://developers.cloudflare.com/fundamentals/api/reference/deprecations/#firewall-rules-api-and-filters-api for full details.
       */
      list(params, options) {
        const { zone_id, ...query } = params;
        return this._client.getAPIList(`/zones/${zone_id}/filters`, FirewallFiltersV4PagePaginationArray, {
          query,
          ...options
        });
      }
      /**
       * Deletes an existing filter.
       *
       * @deprecated The Filters API is deprecated in favour of using the Ruleset Engine. See https://developers.cloudflare.com/fundamentals/api/reference/deprecations/#firewall-rules-api-and-filters-api for full details.
       */
      delete(filterId, params, options) {
        const { zone_id } = params;
        return this._client.delete(`/zones/${zone_id}/filters/${filterId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Deletes one or more existing filters.
       *
       * @deprecated The Filters API is deprecated in favour of using the Ruleset Engine. See https://developers.cloudflare.com/fundamentals/api/reference/deprecations/#firewall-rules-api-and-filters-api for full details.
       */
      bulkDelete(params, options) {
        const { zone_id, id } = params;
        return this._client.delete(`/zones/${zone_id}/filters`, { query: { id }, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Updates one or more existing filters.
       *
       * @deprecated The Filters API is deprecated in favour of using the Ruleset Engine. See https://developers.cloudflare.com/fundamentals/api/reference/deprecations/#firewall-rules-api-and-filters-api for full details.
       */
      bulkUpdate(params, options) {
        const { zone_id, body } = params;
        return this._client.getAPIList(`/zones/${zone_id}/filters`, FirewallFiltersSinglePage, {
          body,
          method: "put",
          ...options
        });
      }
      /**
       * Fetches the details of a filter.
       *
       * @deprecated The Filters API is deprecated in favour of using the Ruleset Engine. See https://developers.cloudflare.com/fundamentals/api/reference/deprecations/#firewall-rules-api-and-filters-api for full details.
       */
      get(filterId, params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/filters/${filterId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    FirewallFiltersSinglePage = class extends SinglePage {
      static {
        __name(this, "FirewallFiltersSinglePage");
      }
    };
    FirewallFiltersV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "FirewallFiltersV4PagePaginationArray");
      }
    };
    Filters.FirewallFiltersSinglePage = FirewallFiltersSinglePage;
    Filters.FirewallFiltersV4PagePaginationArray = FirewallFiltersV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/firewall/access-rules.mjs
var AccessRules, AccessRuleListResponsesV4PagePaginationArray;
var init_access_rules = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/firewall/access-rules.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    init_error4();
    init_pagination();
    AccessRules = class extends APIResource {
      static {
        __name(this, "AccessRules");
      }
      /**
       * Creates a new IP Access rule for an account or zone. The rule will apply to all
       * zones in the account or zone.
       *
       * Note: To create an IP Access rule that applies to a single zone, refer to the
       * [IP Access rules for a zone](#ip-access-rules-for-a-zone) endpoints.
       *
       * @example
       * ```ts
       * const accessRule = await client.firewall.accessRules.create(
       *   {
       *     configuration: {},
       *     mode: 'challenge',
       *     account_id: 'account_id',
       *   },
       * );
       * ```
       */
      create(params, options) {
        const { account_id, zone_id, ...body } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.post(`/${accountOrZone}/${accountOrZoneId}/firewall/access_rules/rules`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      list(params = {}, options) {
        if (isRequestOptions(params)) {
          return this.list({}, params);
        }
        const { account_id, zone_id, ...query } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.getAPIList(`/${accountOrZone}/${accountOrZoneId}/firewall/access_rules/rules`, AccessRuleListResponsesV4PagePaginationArray, { query, ...options });
      }
      delete(ruleId, params = {}, options) {
        if (isRequestOptions(params)) {
          return this.delete(ruleId, {}, params);
        }
        const { account_id, zone_id } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.delete(`/${accountOrZone}/${accountOrZoneId}/firewall/access_rules/rules/${ruleId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Updates an IP Access rule defined.
       *
       * Note: This operation will affect all zones in the account or zone.
       *
       * @example
       * ```ts
       * const response = await client.firewall.accessRules.edit(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   {
       *     configuration: {},
       *     mode: 'challenge',
       *     account_id: 'account_id',
       *   },
       * );
       * ```
       */
      edit(ruleId, params, options) {
        const { account_id, zone_id, ...body } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.patch(`/${accountOrZone}/${accountOrZoneId}/firewall/access_rules/rules/${ruleId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      get(ruleId, params = {}, options) {
        if (isRequestOptions(params)) {
          return this.get(ruleId, {}, params);
        }
        const { account_id, zone_id } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.get(`/${accountOrZone}/${accountOrZoneId}/firewall/access_rules/rules/${ruleId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    AccessRuleListResponsesV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "AccessRuleListResponsesV4PagePaginationArray");
      }
    };
    AccessRules.AccessRuleListResponsesV4PagePaginationArray = AccessRuleListResponsesV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/firewall/lockdowns.mjs
var Lockdowns, LockdownsV4PagePaginationArray;
var init_lockdowns = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/firewall/lockdowns.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Lockdowns = class extends APIResource {
      static {
        __name(this, "Lockdowns");
      }
      /**
       * Creates a new Zone Lockdown rule.
       *
       * @example
       * ```ts
       * const lockdown = await client.firewall.lockdowns.create({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   configurations: [{}],
       *   urls: ['shop.example.com/*'],
       * });
       * ```
       */
      create(params, options) {
        const { zone_id, ...body } = params;
        return this._client.post(`/zones/${zone_id}/firewall/lockdowns`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Updates an existing Zone Lockdown rule.
       *
       * @example
       * ```ts
       * const lockdown = await client.firewall.lockdowns.update(
       *   '372e67954025e0ba6aaa6d586b9e0b59',
       *   {
       *     zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     configurations: [{}],
       *     urls: ['shop.example.com/*'],
       *   },
       * );
       * ```
       */
      update(lockDownsId, params, options) {
        const { zone_id, ...body } = params;
        return this._client.put(`/zones/${zone_id}/firewall/lockdowns/${lockDownsId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetches Zone Lockdown rules. You can filter the results using several optional
       * parameters.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const lockdown of client.firewall.lockdowns.list(
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { zone_id, ...query } = params;
        return this._client.getAPIList(`/zones/${zone_id}/firewall/lockdowns`, LockdownsV4PagePaginationArray, {
          query,
          ...options
        });
      }
      /**
       * Deletes an existing Zone Lockdown rule.
       *
       * @example
       * ```ts
       * const lockdown = await client.firewall.lockdowns.delete(
       *   '372e67954025e0ba6aaa6d586b9e0b59',
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      delete(lockDownsId, params, options) {
        const { zone_id } = params;
        return this._client.delete(`/zones/${zone_id}/firewall/lockdowns/${lockDownsId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetches the details of a Zone Lockdown rule.
       *
       * @example
       * ```ts
       * const lockdown = await client.firewall.lockdowns.get(
       *   '372e67954025e0ba6aaa6d586b9e0b59',
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(lockDownsId, params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/firewall/lockdowns/${lockDownsId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    LockdownsV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "LockdownsV4PagePaginationArray");
      }
    };
    Lockdowns.LockdownsV4PagePaginationArray = LockdownsV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/firewall/rules.mjs
var Rules3, FirewallRulesSinglePage, FirewallRulesV4PagePaginationArray;
var init_rules4 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/firewall/rules.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Rules3 = class extends APIResource {
      static {
        __name(this, "Rules");
      }
      /**
       * Create one or more firewall rules.
       *
       * @deprecated The Firewall Rules API is deprecated in favour of using the Ruleset Engine. See https://developers.cloudflare.com/fundamentals/api/reference/deprecations/#firewall-rules-api-and-filters-api for full details.
       */
      create(params, options) {
        const { zone_id, ...body } = params;
        return this._client.getAPIList(`/zones/${zone_id}/firewall/rules`, FirewallRulesSinglePage, {
          body,
          method: "post",
          ...options
        });
      }
      /**
       * Updates an existing firewall rule.
       *
       * @deprecated The Firewall Rules API is deprecated in favour of using the Ruleset Engine. See https://developers.cloudflare.com/fundamentals/api/reference/deprecations/#firewall-rules-api-and-filters-api for full details.
       */
      update(ruleId, params, options) {
        const { zone_id, ...body } = params;
        return this._client.put(`/zones/${zone_id}/firewall/rules/${ruleId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetches firewall rules in a zone. You can filter the results using several
       * optional parameters.
       *
       * @deprecated The Firewall Rules API is deprecated in favour of using the Ruleset Engine. See https://developers.cloudflare.com/fundamentals/api/reference/deprecations/#firewall-rules-api-and-filters-api for full details.
       */
      list(params, options) {
        const { zone_id, ...query } = params;
        return this._client.getAPIList(`/zones/${zone_id}/firewall/rules`, FirewallRulesV4PagePaginationArray, {
          query,
          ...options
        });
      }
      /**
       * Deletes an existing firewall rule.
       *
       * @deprecated The Firewall Rules API is deprecated in favour of using the Ruleset Engine. See https://developers.cloudflare.com/fundamentals/api/reference/deprecations/#firewall-rules-api-and-filters-api for full details.
       */
      delete(ruleId, params, options) {
        const { zone_id } = params;
        return this._client.delete(`/zones/${zone_id}/firewall/rules/${ruleId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Deletes existing firewall rules.
       *
       * @deprecated The Firewall Rules API is deprecated in favour of using the Ruleset Engine. See https://developers.cloudflare.com/fundamentals/api/reference/deprecations/#firewall-rules-api-and-filters-api for full details.
       */
      bulkDelete(params, options) {
        const { zone_id } = params;
        return this._client.getAPIList(`/zones/${zone_id}/firewall/rules`, FirewallRulesSinglePage, {
          method: "delete",
          ...options
        });
      }
      /**
       * Updates the priority of existing firewall rules.
       *
       * @deprecated The Firewall Rules API is deprecated in favour of using the Ruleset Engine. See https://developers.cloudflare.com/fundamentals/api/reference/deprecations/#firewall-rules-api-and-filters-api for full details.
       */
      bulkEdit(params, options) {
        const { zone_id, body } = params;
        return this._client.getAPIList(`/zones/${zone_id}/firewall/rules`, FirewallRulesSinglePage, {
          body,
          method: "patch",
          ...options
        });
      }
      /**
       * Updates one or more existing firewall rules.
       *
       * @deprecated The Firewall Rules API is deprecated in favour of using the Ruleset Engine. See https://developers.cloudflare.com/fundamentals/api/reference/deprecations/#firewall-rules-api-and-filters-api for full details.
       */
      bulkUpdate(params, options) {
        const { zone_id, body } = params;
        return this._client.getAPIList(`/zones/${zone_id}/firewall/rules`, FirewallRulesSinglePage, {
          body,
          method: "put",
          ...options
        });
      }
      /**
       * Updates the priority of an existing firewall rule.
       *
       * @deprecated The Firewall Rules API is deprecated in favour of using the Ruleset Engine. See https://developers.cloudflare.com/fundamentals/api/reference/deprecations/#firewall-rules-api-and-filters-api for full details.
       */
      edit(ruleId, params, options) {
        const { zone_id, ...body } = params;
        return this._client.getAPIList(`/zones/${zone_id}/firewall/rules/${ruleId}`, FirewallRulesSinglePage, {
          body,
          method: "patch",
          ...options
        });
      }
      /**
       * Fetches the details of a firewall rule.
       *
       * @deprecated The Firewall Rules API is deprecated in favour of using the Ruleset Engine. See https://developers.cloudflare.com/fundamentals/api/reference/deprecations/#firewall-rules-api-and-filters-api for full details.
       */
      get(ruleId, params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/firewall/rules/${ruleId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    FirewallRulesSinglePage = class extends SinglePage {
      static {
        __name(this, "FirewallRulesSinglePage");
      }
    };
    FirewallRulesV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "FirewallRulesV4PagePaginationArray");
      }
    };
    Rules3.FirewallRulesSinglePage = FirewallRulesSinglePage;
    Rules3.FirewallRulesV4PagePaginationArray = FirewallRulesV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/firewall/ua-rules.mjs
var UARules, UARuleListResponsesV4PagePaginationArray;
var init_ua_rules = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/firewall/ua-rules.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    UARules = class extends APIResource {
      static {
        __name(this, "UARules");
      }
      /**
       * Creates a new User Agent Blocking rule in a zone.
       *
       * @example
       * ```ts
       * const uaRule = await client.firewall.uaRules.create({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   configuration: {},
       *   mode: 'challenge',
       * });
       * ```
       */
      create(params, options) {
        const { zone_id, ...body } = params;
        return this._client.post(`/zones/${zone_id}/firewall/ua_rules`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Updates an existing User Agent Blocking rule.
       *
       * @example
       * ```ts
       * const uaRule = await client.firewall.uaRules.update(
       *   '372e67954025e0ba6aaa6d586b9e0b59',
       *   {
       *     zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     configuration: {},
       *     mode: 'challenge',
       *   },
       * );
       * ```
       */
      update(uaRuleId, params, options) {
        const { zone_id, ...body } = params;
        return this._client.put(`/zones/${zone_id}/firewall/ua_rules/${uaRuleId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetches User Agent Blocking rules in a zone. You can filter the results using
       * several optional parameters.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const uaRuleListResponse of client.firewall.uaRules.list(
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { zone_id, ...query } = params;
        return this._client.getAPIList(`/zones/${zone_id}/firewall/ua_rules`, UARuleListResponsesV4PagePaginationArray, { query, ...options });
      }
      /**
       * Deletes an existing User Agent Blocking rule.
       *
       * @example
       * ```ts
       * const uaRule = await client.firewall.uaRules.delete(
       *   '372e67954025e0ba6aaa6d586b9e0b59',
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      delete(uaRuleId, params, options) {
        const { zone_id } = params;
        return this._client.delete(`/zones/${zone_id}/firewall/ua_rules/${uaRuleId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetches the details of a User Agent Blocking rule.
       *
       * @example
       * ```ts
       * const uaRule = await client.firewall.uaRules.get(
       *   '372e67954025e0ba6aaa6d586b9e0b59',
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(uaRuleId, params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/firewall/ua_rules/${uaRuleId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    UARuleListResponsesV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "UARuleListResponsesV4PagePaginationArray");
      }
    };
    UARules.UARuleListResponsesV4PagePaginationArray = UARuleListResponsesV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/firewall/waf/overrides.mjs
var Overrides, OverridesV4PagePaginationArray;
var init_overrides = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/firewall/waf/overrides.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Overrides = class extends APIResource {
      static {
        __name(this, "Overrides");
      }
      /**
       * Creates a URI-based WAF override for a zone.
       *
       * **Note:** Applies only to the
       * [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).
       *
       * @deprecated
       */
      create(params, options) {
        const { zone_id, ...body } = params;
        return this._client.post(`/zones/${zone_id}/firewall/waf/overrides`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Updates an existing URI-based WAF override.
       *
       * **Note:** Applies only to the
       * [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).
       *
       * @deprecated
       */
      update(overridesId, params, options) {
        const { zone_id, ...body } = params;
        return this._client.put(`/zones/${zone_id}/firewall/waf/overrides/${overridesId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetches the URI-based WAF overrides in a zone.
       *
       * **Note:** Applies only to the
       * [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).
       *
       * @deprecated
       */
      list(params, options) {
        const { zone_id, ...query } = params;
        return this._client.getAPIList(`/zones/${zone_id}/firewall/waf/overrides`, OverridesV4PagePaginationArray, { query, ...options });
      }
      /**
       * Deletes an existing URI-based WAF override.
       *
       * **Note:** Applies only to the
       * [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).
       *
       * @deprecated
       */
      delete(overridesId, params, options) {
        const { zone_id } = params;
        return this._client.delete(`/zones/${zone_id}/firewall/waf/overrides/${overridesId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetches the details of a URI-based WAF override.
       *
       * **Note:** Applies only to the
       * [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).
       *
       * @deprecated
       */
      get(overridesId, params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/firewall/waf/overrides/${overridesId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    OverridesV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "OverridesV4PagePaginationArray");
      }
    };
    Overrides.OverridesV4PagePaginationArray = OverridesV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/firewall/waf/packages/groups.mjs
var Groups, GroupsV4PagePaginationArray;
var init_groups = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/firewall/waf/packages/groups.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Groups = class extends APIResource {
      static {
        __name(this, "Groups");
      }
      /**
       * Fetches the WAF rule groups in a WAF package.
       *
       * **Note:** Applies only to the
       * [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).
       *
       * @deprecated
       */
      list(packageId, params, options) {
        const { zone_id, ...query } = params;
        return this._client.getAPIList(`/zones/${zone_id}/firewall/waf/packages/${packageId}/groups`, GroupsV4PagePaginationArray, { query, ...options });
      }
      /**
       * Updates a WAF rule group. You can update the state (`mode` parameter) of a rule
       * group.
       *
       * **Note:** Applies only to the
       * [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).
       *
       * @deprecated
       */
      edit(packageId, groupId, params, options) {
        const { zone_id, ...body } = params;
        return this._client.patch(`/zones/${zone_id}/firewall/waf/packages/${packageId}/groups/${groupId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetches the details of a WAF rule group.
       *
       * **Note:** Applies only to the
       * [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).
       *
       * @deprecated
       */
      get(packageId, groupId, params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/firewall/waf/packages/${packageId}/groups/${groupId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    GroupsV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "GroupsV4PagePaginationArray");
      }
    };
    Groups.GroupsV4PagePaginationArray = GroupsV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/firewall/waf/packages/rules.mjs
var Rules4, RuleListResponsesV4PagePaginationArray;
var init_rules5 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/firewall/waf/packages/rules.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Rules4 = class extends APIResource {
      static {
        __name(this, "Rules");
      }
      /**
       * Fetches WAF rules in a WAF package.
       *
       * **Note:** Applies only to the
       * [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).
       *
       * @deprecated
       */
      list(packageId, params, options) {
        const { zone_id, ...query } = params;
        return this._client.getAPIList(`/zones/${zone_id}/firewall/waf/packages/${packageId}/rules`, RuleListResponsesV4PagePaginationArray, { query, ...options });
      }
      /**
       * Updates a WAF rule. You can only update the mode/action of the rule.
       *
       * **Note:** Applies only to the
       * [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).
       *
       * @deprecated
       */
      edit(packageId, ruleId, params, options) {
        const { zone_id, ...body } = params;
        return this._client.patch(`/zones/${zone_id}/firewall/waf/packages/${packageId}/rules/${ruleId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetches the details of a WAF rule in a WAF package.
       *
       * **Note:** Applies only to the
       * [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).
       *
       * @deprecated
       */
      get(packageId, ruleId, params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/firewall/waf/packages/${packageId}/rules/${ruleId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    RuleListResponsesV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "RuleListResponsesV4PagePaginationArray");
      }
    };
    Rules4.RuleListResponsesV4PagePaginationArray = RuleListResponsesV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/firewall/waf/packages/packages.mjs
var Packages, PackageListResponsesV4PagePaginationArray;
var init_packages = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/firewall/waf/packages/packages.mjs"() {
    init_import_meta_url();
    init_resource();
    init_groups();
    init_groups();
    init_rules5();
    init_rules5();
    init_pagination();
    Packages = class extends APIResource {
      static {
        __name(this, "Packages");
      }
      constructor() {
        super(...arguments);
        this.groups = new Groups(this._client);
        this.rules = new Rules4(this._client);
      }
      /**
       * Fetches WAF packages for a zone.
       *
       * **Note:** Applies only to the
       * [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).
       *
       * @deprecated
       */
      list(params, options) {
        const { zone_id, ...query } = params;
        return this._client.getAPIList(`/zones/${zone_id}/firewall/waf/packages`, PackageListResponsesV4PagePaginationArray, { query, ...options });
      }
      /**
       * Fetches the details of a WAF package.
       *
       * **Note:** Applies only to the
       * [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).
       *
       * @deprecated
       */
      get(packageId, params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/firewall/waf/packages/${packageId}`, options);
      }
    };
    PackageListResponsesV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "PackageListResponsesV4PagePaginationArray");
      }
    };
    Packages.PackageListResponsesV4PagePaginationArray = PackageListResponsesV4PagePaginationArray;
    Packages.Groups = Groups;
    Packages.GroupsV4PagePaginationArray = GroupsV4PagePaginationArray;
    Packages.Rules = Rules4;
    Packages.RuleListResponsesV4PagePaginationArray = RuleListResponsesV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/firewall/waf/waf.mjs
var WAF;
var init_waf = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/firewall/waf/waf.mjs"() {
    init_import_meta_url();
    init_resource();
    init_overrides();
    init_overrides();
    init_packages();
    init_packages();
    WAF = class extends APIResource {
      static {
        __name(this, "WAF");
      }
      constructor() {
        super(...arguments);
        this.overrides = new Overrides(this._client);
        this.packages = new Packages(this._client);
      }
    };
    WAF.Overrides = Overrides;
    WAF.OverridesV4PagePaginationArray = OverridesV4PagePaginationArray;
    WAF.Packages = Packages;
    WAF.PackageListResponsesV4PagePaginationArray = PackageListResponsesV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/firewall/firewall.mjs
var Firewall;
var init_firewall = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/firewall/firewall.mjs"() {
    init_import_meta_url();
    init_resource();
    init_access_rules();
    init_access_rules();
    init_lockdowns();
    init_lockdowns();
    init_rules4();
    init_rules4();
    init_ua_rules();
    init_ua_rules();
    init_waf();
    init_waf();
    Firewall = class extends APIResource {
      static {
        __name(this, "Firewall");
      }
      constructor() {
        super(...arguments);
        this.lockdowns = new Lockdowns(this._client);
        this.rules = new Rules3(this._client);
        this.accessRules = new AccessRules(this._client);
        this.uaRules = new UARules(this._client);
        this.waf = new WAF(this._client);
      }
    };
    Firewall.Lockdowns = Lockdowns;
    Firewall.LockdownsV4PagePaginationArray = LockdownsV4PagePaginationArray;
    Firewall.Rules = Rules3;
    Firewall.FirewallRulesSinglePage = FirewallRulesSinglePage;
    Firewall.FirewallRulesV4PagePaginationArray = FirewallRulesV4PagePaginationArray;
    Firewall.AccessRules = AccessRules;
    Firewall.AccessRuleListResponsesV4PagePaginationArray = AccessRuleListResponsesV4PagePaginationArray;
    Firewall.UARules = UARules;
    Firewall.UARuleListResponsesV4PagePaginationArray = UARuleListResponsesV4PagePaginationArray;
    Firewall.WAF = WAF;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/healthchecks/previews.mjs
var Previews;
var init_previews = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/healthchecks/previews.mjs"() {
    init_import_meta_url();
    init_resource();
    Previews = class extends APIResource {
      static {
        __name(this, "Previews");
      }
      /**
       * Create a new preview health check.
       *
       * @example
       * ```ts
       * const healthcheck =
       *   await client.healthchecks.previews.create({
       *     zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     address: 'www.example.com',
       *     name: 'server-1',
       *   });
       * ```
       */
      create(params, options) {
        const { zone_id, ...body } = params;
        return this._client.post(`/zones/${zone_id}/healthchecks/preview`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Delete a health check.
       *
       * @example
       * ```ts
       * const preview = await client.healthchecks.previews.delete(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      delete(healthcheckId, params, options) {
        const { zone_id } = params;
        return this._client.delete(`/zones/${zone_id}/healthchecks/preview/${healthcheckId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetch a single configured health check preview.
       *
       * @example
       * ```ts
       * const healthcheck = await client.healthchecks.previews.get(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(healthcheckId, params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/healthchecks/preview/${healthcheckId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/healthchecks/healthchecks.mjs
var Healthchecks, HealthchecksV4PagePaginationArray;
var init_healthchecks = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/healthchecks/healthchecks.mjs"() {
    init_import_meta_url();
    init_resource();
    init_previews();
    init_previews();
    init_pagination();
    Healthchecks = class extends APIResource {
      static {
        __name(this, "Healthchecks");
      }
      constructor() {
        super(...arguments);
        this.previews = new Previews(this._client);
      }
      /**
       * Create a new health check.
       *
       * @example
       * ```ts
       * const healthcheck = await client.healthchecks.create({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   address: 'www.example.com',
       *   name: 'server-1',
       * });
       * ```
       */
      create(params, options) {
        const { zone_id, ...body } = params;
        return this._client.post(`/zones/${zone_id}/healthchecks`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Update a configured health check.
       *
       * @example
       * ```ts
       * const healthcheck = await client.healthchecks.update(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   {
       *     zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     address: 'www.example.com',
       *     name: 'server-1',
       *   },
       * );
       * ```
       */
      update(healthcheckId, params, options) {
        const { zone_id, ...body } = params;
        return this._client.put(`/zones/${zone_id}/healthchecks/${healthcheckId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List configured health checks.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const healthcheck of client.healthchecks.list({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * })) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { zone_id, ...query } = params;
        return this._client.getAPIList(`/zones/${zone_id}/healthchecks`, HealthchecksV4PagePaginationArray, {
          query,
          ...options
        });
      }
      /**
       * Delete a health check.
       *
       * @example
       * ```ts
       * const healthcheck = await client.healthchecks.delete(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      delete(healthcheckId, params, options) {
        const { zone_id } = params;
        return this._client.delete(`/zones/${zone_id}/healthchecks/${healthcheckId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Patch a configured health check.
       *
       * @example
       * ```ts
       * const healthcheck = await client.healthchecks.edit(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   {
       *     zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     address: 'www.example.com',
       *     name: 'server-1',
       *   },
       * );
       * ```
       */
      edit(healthcheckId, params, options) {
        const { zone_id, ...body } = params;
        return this._client.patch(`/zones/${zone_id}/healthchecks/${healthcheckId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetch a single configured health check.
       *
       * @example
       * ```ts
       * const healthcheck = await client.healthchecks.get(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(healthcheckId, params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/healthchecks/${healthcheckId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    HealthchecksV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "HealthchecksV4PagePaginationArray");
      }
    };
    Healthchecks.HealthchecksV4PagePaginationArray = HealthchecksV4PagePaginationArray;
    Healthchecks.Previews = Previews;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/hostnames/settings/tls.mjs
var TLS, TLSGetResponsesSinglePage;
var init_tls = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/hostnames/settings/tls.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    TLS = class extends APIResource {
      static {
        __name(this, "TLS");
      }
      /**
       * Update the tls setting value for the hostname.
       *
       * @example
       * ```ts
       * const setting = await client.hostnames.settings.tls.update(
       *   'ciphers',
       *   'app.example.com',
       *   {
       *     zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     value: [
       *       'ECDHE-RSA-AES128-GCM-SHA256',
       *       'AES128-GCM-SHA256',
       *     ],
       *   },
       * );
       * ```
       */
      update(settingId, hostname2, params, options) {
        const { zone_id, ...body } = params;
        return this._client.put(`/zones/${zone_id}/hostnames/settings/${settingId}/${hostname2}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Delete the tls setting value for the hostname.
       *
       * @example
       * ```ts
       * const tls = await client.hostnames.settings.tls.delete(
       *   'ciphers',
       *   'app.example.com',
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      delete(settingId, hostname2, params, options) {
        const { zone_id } = params;
        return this._client.delete(`/zones/${zone_id}/hostnames/settings/${settingId}/${hostname2}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * List the requested TLS setting for the hostnames under this zone.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const tlsGetResponse of client.hostnames.settings.tls.get(
       *   'ciphers',
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      get(settingId, params, options) {
        const { zone_id } = params;
        return this._client.getAPIList(`/zones/${zone_id}/hostnames/settings/${settingId}`, TLSGetResponsesSinglePage, options);
      }
    };
    TLSGetResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "TLSGetResponsesSinglePage");
      }
    };
    TLS.TLSGetResponsesSinglePage = TLSGetResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/hostnames/settings/settings.mjs
var Settings5;
var init_settings5 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/hostnames/settings/settings.mjs"() {
    init_import_meta_url();
    init_resource();
    init_tls();
    init_tls();
    Settings5 = class extends APIResource {
      static {
        __name(this, "Settings");
      }
      constructor() {
        super(...arguments);
        this.tls = new TLS(this._client);
      }
    };
    Settings5.TLS = TLS;
    Settings5.TLSGetResponsesSinglePage = TLSGetResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/hostnames/hostnames.mjs
var Hostnames;
var init_hostnames = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/hostnames/hostnames.mjs"() {
    init_import_meta_url();
    init_resource();
    init_settings5();
    init_settings5();
    Hostnames = class extends APIResource {
      static {
        __name(this, "Hostnames");
      }
      constructor() {
        super(...arguments);
        this.settings = new Settings5(this._client);
      }
    };
    Hostnames.Settings = Settings5;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/hyperdrive/configs.mjs
var Configs2;
var init_configs2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/hyperdrive/configs.mjs"() {
    init_import_meta_url();
    init_resource();
    init_hyperdrive();
    Configs2 = class extends APIResource {
      static {
        __name(this, "Configs");
      }
      /**
       * Creates and returns a new Hyperdrive configuration.
       *
       * @example
       * ```ts
       * const hyperdrive = await client.hyperdrive.configs.create({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   name: 'example-hyperdrive',
       *   origin: {
       *     database: 'postgres',
       *     host: 'database.example.com',
       *     password: 'password',
       *     port: 5432,
       *     scheme: 'postgres',
       *     user: 'postgres',
       *   },
       * });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/hyperdrive/configs`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Updates and returns the specified Hyperdrive configuration.
       *
       * @example
       * ```ts
       * const hyperdrive = await client.hyperdrive.configs.update(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   {
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     name: 'example-hyperdrive',
       *     origin: {
       *       database: 'postgres',
       *       host: 'database.example.com',
       *       password: 'password',
       *       port: 5432,
       *       scheme: 'postgres',
       *       user: 'postgres',
       *     },
       *   },
       * );
       * ```
       */
      update(hyperdriveId, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/hyperdrive/configs/${hyperdriveId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Returns a list of Hyperdrives.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const hyperdrive of client.hyperdrive.configs.list(
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/hyperdrive/configs`, HyperdrivesSinglePage, options);
      }
      /**
       * Deletes the specified Hyperdrive.
       *
       * @example
       * ```ts
       * const config = await client.hyperdrive.configs.delete(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      delete(hyperdriveId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/hyperdrive/configs/${hyperdriveId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Patches and returns the specified Hyperdrive configuration. Custom caching
       * settings are not kept if caching is disabled.
       *
       * @example
       * ```ts
       * const hyperdrive = await client.hyperdrive.configs.edit(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      edit(hyperdriveId, params, options) {
        const { account_id, ...body } = params;
        return this._client.patch(`/accounts/${account_id}/hyperdrive/configs/${hyperdriveId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Returns the specified Hyperdrive configuration.
       *
       * @example
       * ```ts
       * const hyperdrive = await client.hyperdrive.configs.get(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(hyperdriveId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/hyperdrive/configs/${hyperdriveId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/hyperdrive/hyperdrive.mjs
var HyperdriveResource, HyperdrivesSinglePage;
var init_hyperdrive = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/hyperdrive/hyperdrive.mjs"() {
    init_import_meta_url();
    init_resource();
    init_configs2();
    init_configs2();
    init_pagination();
    HyperdriveResource = class extends APIResource {
      static {
        __name(this, "HyperdriveResource");
      }
      constructor() {
        super(...arguments);
        this.configs = new Configs2(this._client);
      }
    };
    HyperdrivesSinglePage = class extends SinglePage {
      static {
        __name(this, "HyperdrivesSinglePage");
      }
    };
    HyperdriveResource.Configs = Configs2;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/iam/permission-groups.mjs
var PermissionGroups2, PermissionGroupListResponsesV4PagePaginationArray;
var init_permission_groups2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/iam/permission-groups.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    PermissionGroups2 = class extends APIResource {
      static {
        __name(this, "PermissionGroups");
      }
      /**
       * List all the permissions groups for an account.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const permissionGroupListResponse of client.iam.permissionGroups.list(
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/iam/permission_groups`, PermissionGroupListResponsesV4PagePaginationArray, { query, ...options });
      }
      /**
       * Get information about a specific permission group in an account.
       *
       * @example
       * ```ts
       * const permissionGroup =
       *   await client.iam.permissionGroups.get(
       *     '023e105f4ecef8ad9ca31a8372d0c353',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      get(permissionGroupId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/iam/permission_groups/${permissionGroupId}`, options);
      }
    };
    PermissionGroupListResponsesV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "PermissionGroupListResponsesV4PagePaginationArray");
      }
    };
    PermissionGroups2.PermissionGroupListResponsesV4PagePaginationArray = PermissionGroupListResponsesV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/iam/resource-groups.mjs
var ResourceGroups, ResourceGroupListResponsesSinglePage;
var init_resource_groups = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/iam/resource-groups.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    ResourceGroups = class extends APIResource {
      static {
        __name(this, "ResourceGroups");
      }
      /**
       * Create a new Resource Group under the specified account.
       *
       * @example
       * ```ts
       * const resourceGroup =
       *   await client.iam.resourceGroups.create({
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     name: 'NewResourceGroup',
       *     scope: {
       *       key: 'com.cloudflare.api.account.eb78d65290b24279ba6f44721b3ea3c4',
       *       objects: [
       *         {
       *           key: 'com.cloudflare.api.account.zone.23f8d65290b24279ba6f44721b3eaad5',
       *         },
       *       ],
       *     },
       *   });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/iam/resource_groups`, { body, ...options });
      }
      /**
       * Modify an existing resource group.
       *
       * @example
       * ```ts
       * const resourceGroup =
       *   await client.iam.resourceGroups.update(
       *     '023e105f4ecef8ad9ca31a8372d0c353',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      update(resourceGroupId, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/iam/resource_groups/${resourceGroupId}`, {
          body,
          ...options
        });
      }
      /**
       * List all the resource groups for an account.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const resourceGroupListResponse of client.iam.resourceGroups.list(
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/iam/resource_groups`, ResourceGroupListResponsesSinglePage, { query, ...options });
      }
      /**
       * Remove a resource group from an account.
       *
       * @example
       * ```ts
       * const resourceGroup =
       *   await client.iam.resourceGroups.delete(
       *     '023e105f4ecef8ad9ca31a8372d0c353',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      delete(resourceGroupId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/iam/resource_groups/${resourceGroupId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get information about a specific resource group in an account.
       *
       * @example
       * ```ts
       * const resourceGroup = await client.iam.resourceGroups.get(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(resourceGroupId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/iam/resource_groups/${resourceGroupId}`, options);
      }
    };
    ResourceGroupListResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "ResourceGroupListResponsesSinglePage");
      }
    };
    ResourceGroups.ResourceGroupListResponsesSinglePage = ResourceGroupListResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/iam/user-groups/members.mjs
var Members2, MemberUpdateResponsesSinglePage, MemberListResponsesV4PagePaginationArray;
var init_members2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/iam/user-groups/members.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Members2 = class extends APIResource {
      static {
        __name(this, "Members");
      }
      /**
       * Add members to a User Group.
       *
       * @example
       * ```ts
       * const member = await client.iam.userGroups.members.create(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   {
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     body: [{ id: '023e105f4ecef8ad9ca31a8372d0c353' }],
       *   },
       * );
       * ```
       */
      create(userGroupId, params, options) {
        const { account_id, body } = params;
        return this._client.post(`/accounts/${account_id}/iam/user_groups/${userGroupId}/members`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Replace the set of members attached to a User Group.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const memberUpdateResponse of client.iam.userGroups.members.update(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   {
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     body: [{ id: '023e105f4ecef8ad9ca31a8372d0c353' }],
       *   },
       * )) {
       *   // ...
       * }
       * ```
       */
      update(userGroupId, params, options) {
        const { account_id, body } = params;
        return this._client.getAPIList(`/accounts/${account_id}/iam/user_groups/${userGroupId}/members`, MemberUpdateResponsesSinglePage, { body, method: "put", ...options });
      }
      /**
       * List all the members attached to a user group.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const memberListResponse of client.iam.userGroups.members.list(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(userGroupId, params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/iam/user_groups/${userGroupId}/members`, MemberListResponsesV4PagePaginationArray, { query, ...options });
      }
      /**
       * Remove a member from User Group
       *
       * @example
       * ```ts
       * const member = await client.iam.userGroups.members.delete(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      delete(userGroupId, memberId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/iam/user_groups/${userGroupId}/members/${memberId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    MemberUpdateResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "MemberUpdateResponsesSinglePage");
      }
    };
    MemberListResponsesV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "MemberListResponsesV4PagePaginationArray");
      }
    };
    Members2.MemberUpdateResponsesSinglePage = MemberUpdateResponsesSinglePage;
    Members2.MemberListResponsesV4PagePaginationArray = MemberListResponsesV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/iam/user-groups/user-groups.mjs
var UserGroups, UserGroupListResponsesV4PagePaginationArray;
var init_user_groups = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/iam/user-groups/user-groups.mjs"() {
    init_import_meta_url();
    init_resource();
    init_members2();
    init_members2();
    init_pagination();
    UserGroups = class extends APIResource {
      static {
        __name(this, "UserGroups");
      }
      constructor() {
        super(...arguments);
        this.members = new Members2(this._client);
      }
      /**
       * Create a new user group under the specified account.
       *
       * @example
       * ```ts
       * const userGroup = await client.iam.userGroups.create({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   name: 'My New User Group',
       *   policies: [
       *     {
       *       access: 'allow',
       *       permission_groups: [
       *         { id: 'c8fed203ed3043cba015a93ad1616f1f' },
       *         { id: '82e64a83756745bbbb1c9c2701bf816b' },
       *       ],
       *       resource_groups: [
       *         { id: '6d7f2f5f5b1d4a0e9081fdc98d432fd1' },
       *       ],
       *     },
       *   ],
       * });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/iam/user_groups`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Modify an existing user group.
       *
       * @example
       * ```ts
       * const userGroup = await client.iam.userGroups.update(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      update(userGroupId, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/iam/user_groups/${userGroupId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List all the user groups for an account.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const userGroupListResponse of client.iam.userGroups.list(
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/iam/user_groups`, UserGroupListResponsesV4PagePaginationArray, { query, ...options });
      }
      /**
       * Remove a user group from an account.
       *
       * @example
       * ```ts
       * const userGroup = await client.iam.userGroups.delete(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      delete(userGroupId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/iam/user_groups/${userGroupId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get information about a specific user group in an account.
       *
       * @example
       * ```ts
       * const userGroup = await client.iam.userGroups.get(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(userGroupId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/iam/user_groups/${userGroupId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    UserGroupListResponsesV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "UserGroupListResponsesV4PagePaginationArray");
      }
    };
    UserGroups.UserGroupListResponsesV4PagePaginationArray = UserGroupListResponsesV4PagePaginationArray;
    UserGroups.Members = Members2;
    UserGroups.MemberUpdateResponsesSinglePage = MemberUpdateResponsesSinglePage;
    UserGroups.MemberListResponsesV4PagePaginationArray = MemberListResponsesV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/iam/iam.mjs
var IAM;
var init_iam = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/iam/iam.mjs"() {
    init_import_meta_url();
    init_resource();
    init_permission_groups2();
    init_permission_groups2();
    init_resource_groups();
    init_resource_groups();
    init_user_groups();
    init_user_groups();
    IAM = class extends APIResource {
      static {
        __name(this, "IAM");
      }
      constructor() {
        super(...arguments);
        this.permissionGroups = new PermissionGroups2(this._client);
        this.resourceGroups = new ResourceGroups(this._client);
        this.userGroups = new UserGroups(this._client);
      }
    };
    IAM.PermissionGroups = PermissionGroups2;
    IAM.PermissionGroupListResponsesV4PagePaginationArray = PermissionGroupListResponsesV4PagePaginationArray;
    IAM.ResourceGroups = ResourceGroups;
    IAM.ResourceGroupListResponsesSinglePage = ResourceGroupListResponsesSinglePage;
    IAM.UserGroups = UserGroups;
    IAM.UserGroupListResponsesV4PagePaginationArray = UserGroupListResponsesV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/ips.mjs
var IPs2;
var init_ips2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/ips.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    IPs2 = class extends APIResource {
      static {
        __name(this, "IPs");
      }
      list(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.list({}, query);
        }
        return this._client.get("/ips", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/images/v1/blobs.mjs
var Blobs;
var init_blobs = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/images/v1/blobs.mjs"() {
    init_import_meta_url();
    init_resource();
    Blobs = class extends APIResource {
      static {
        __name(this, "Blobs");
      }
      /**
       * Fetch base image. For most images this will be the originally uploaded file. For
       * larger images it can be a near-lossless version of the original.
       *
       * @example
       * ```ts
       * const blob = await client.images.v1.blobs.get('image_id', {
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       *
       * const content = await blob.blob();
       * console.log(content);
       * ```
       */
      get(imageId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/images/v1/${imageId}/blob`, {
          ...options,
          headers: { Accept: "image/*", ...options?.headers },
          __binaryResponse: true
        });
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/images/v1/keys.mjs
var Keys;
var init_keys = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/images/v1/keys.mjs"() {
    init_import_meta_url();
    init_resource();
    Keys = class extends APIResource {
      static {
        __name(this, "Keys");
      }
      /**
       * Create a new signing key with specified name. Returns all keys available.
       *
       * @example
       * ```ts
       * const key = await client.images.v1.keys.update('someKey', {
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      update(signingKeyName, params, options) {
        const { account_id } = params;
        return this._client.put(`/accounts/${account_id}/images/v1/keys/${signingKeyName}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Lists your signing keys. These can be found on your Cloudflare Images dashboard.
       *
       * @example
       * ```ts
       * const keys = await client.images.v1.keys.list({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      list(params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/images/v1/keys`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Delete signing key with specified name. Returns all keys available. When last
       * key is removed, a new default signing key will be generated.
       *
       * @example
       * ```ts
       * const key = await client.images.v1.keys.delete('someKey', {
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      delete(signingKeyName, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/images/v1/keys/${signingKeyName}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/images/v1/stats.mjs
var Stats;
var init_stats = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/images/v1/stats.mjs"() {
    init_import_meta_url();
    init_resource();
    Stats = class extends APIResource {
      static {
        __name(this, "Stats");
      }
      /**
       * Fetch image statistics details for Cloudflare Images. The returned statistics
       * detail storage usage, including the current image count vs this account's
       * allowance.
       *
       * @example
       * ```ts
       * const stat = await client.images.v1.stats.get({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      get(params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/images/v1/stats`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/images/v1/variants.mjs
var Variants2;
var init_variants2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/images/v1/variants.mjs"() {
    init_import_meta_url();
    init_resource();
    Variants2 = class extends APIResource {
      static {
        __name(this, "Variants");
      }
      /**
       * Specify variants that allow you to resize images for different use cases.
       *
       * @example
       * ```ts
       * const variant = await client.images.v1.variants.create({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   id: 'hero',
       *   options: {
       *     fit: 'scale-down',
       *     height: 768,
       *     metadata: 'none',
       *     width: 1366,
       *   },
       * });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/images/v1/variants`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Lists existing variants.
       *
       * @example
       * ```ts
       * const variant = await client.images.v1.variants.list({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      list(params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/images/v1/variants`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Deleting a variant purges the cache for all images associated with the variant.
       *
       * @example
       * ```ts
       * const variant = await client.images.v1.variants.delete(
       *   'hero',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      delete(variantId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/images/v1/variants/${variantId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Updating a variant purges the cache for all images associated with the variant.
       *
       * @example
       * ```ts
       * const response = await client.images.v1.variants.edit(
       *   'hero',
       *   {
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     options: {
       *       fit: 'scale-down',
       *       height: 768,
       *       metadata: 'none',
       *       width: 1366,
       *     },
       *   },
       * );
       * ```
       */
      edit(variantId, params, options) {
        const { account_id, ...body } = params;
        return this._client.patch(`/accounts/${account_id}/images/v1/variants/${variantId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetch details for a single variant.
       *
       * @example
       * ```ts
       * const variant = await client.images.v1.variants.get(
       *   'hero',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(variantId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/images/v1/variants/${variantId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/images/v1/v1.mjs
var V1, V1ListResponsesV4PagePagination;
var init_v1 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/images/v1/v1.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    init_blobs();
    init_blobs();
    init_keys();
    init_keys();
    init_stats();
    init_stats();
    init_variants2();
    init_variants2();
    init_pagination();
    V1 = class extends APIResource {
      static {
        __name(this, "V1");
      }
      constructor() {
        super(...arguments);
        this.keys = new Keys(this._client);
        this.stats = new Stats(this._client);
        this.variants = new Variants2(this._client);
        this.blobs = new Blobs(this._client);
      }
      /**
       * Upload an image with up to 10 Megabytes using a single HTTP POST
       * (multipart/form-data) request. An image can be uploaded by sending an image file
       * or passing an accessible to an API url.
       *
       * @example
       * ```ts
       * const image = await client.images.v1.create({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/images/v1`, multipartFormRequestOptions({ body, ...options }))._thenUnwrap((obj) => obj.result);
      }
      /**
       * List up to 100 images with one request. Use the optional parameters below to get
       * a specific range of images.
       *
       * @deprecated
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/images/v1`, V1ListResponsesV4PagePagination, {
          query,
          ...options
        });
      }
      /**
       * Delete an image on Cloudflare Images. On success, all copies of the image are
       * deleted and purged from cache.
       *
       * @example
       * ```ts
       * const v1 = await client.images.v1.delete('image_id', {
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      delete(imageId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/images/v1/${imageId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Update image access control. On access control change, all copies of the image
       * are purged from cache.
       *
       * @example
       * ```ts
       * const image = await client.images.v1.edit('image_id', {
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      edit(imageId, params, options) {
        const { account_id, ...body } = params;
        return this._client.patch(`/accounts/${account_id}/images/v1/${imageId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetch details for a single image.
       *
       * @example
       * ```ts
       * const image = await client.images.v1.get('image_id', {
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      get(imageId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/images/v1/${imageId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    V1ListResponsesV4PagePagination = class extends V4PagePagination {
      static {
        __name(this, "V1ListResponsesV4PagePagination");
      }
    };
    V1.V1ListResponsesV4PagePagination = V1ListResponsesV4PagePagination;
    V1.Keys = Keys;
    V1.Stats = Stats;
    V1.Variants = Variants2;
    V1.Blobs = Blobs;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/images/v2/direct-uploads.mjs
var DirectUploads;
var init_direct_uploads = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/images/v2/direct-uploads.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    DirectUploads = class extends APIResource {
      static {
        __name(this, "DirectUploads");
      }
      /**
       * Direct uploads allow users to upload images without API keys. A common use case
       * are web apps, client-side applications, or mobile devices where users upload
       * content directly to Cloudflare Images. This method creates a draft record for a
       * future image. It returns an upload URL and an image identifier. To verify if the
       * image itself has been uploaded, send an image details request
       * (accounts/:account_identifier/images/v1/:identifier), and check that the
       * `draft: true` property is not present.
       *
       * @example
       * ```ts
       * const directUpload =
       *   await client.images.v2.directUploads.create({
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/images/v2/direct_upload`, multipartFormRequestOptions({ body, ...options }))._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/images/v2/v2.mjs
var V22;
var init_v2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/images/v2/v2.mjs"() {
    init_import_meta_url();
    init_resource();
    init_direct_uploads();
    init_direct_uploads();
    V22 = class extends APIResource {
      static {
        __name(this, "V2");
      }
      constructor() {
        super(...arguments);
        this.directUploads = new DirectUploads(this._client);
      }
      /**
       * List up to 10000 images with one request. Use the optional parameters below to
       * get a specific range of images. Endpoint returns continuation_token if more
       * images are present.
       *
       * @example
       * ```ts
       * const v2s = await client.images.v2.list({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.get(`/accounts/${account_id}/images/v2`, { query, ...options })._thenUnwrap((obj) => obj.result);
      }
    };
    V22.DirectUploads = DirectUploads;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/images/images.mjs
var Images;
var init_images2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/images/images.mjs"() {
    init_import_meta_url();
    init_resource();
    init_v1();
    init_v1();
    init_v2();
    init_v2();
    Images = class extends APIResource {
      static {
        __name(this, "Images");
      }
      constructor() {
        super(...arguments);
        this.v1 = new V1(this._client);
        this.v2 = new V22(this._client);
      }
    };
    Images.V1 = V1;
    Images.V1ListResponsesV4PagePagination = V1ListResponsesV4PagePagination;
    Images.V2 = V22;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/intel/dns.mjs
var DNS3, DNSV4PagePagination;
var init_dns3 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/intel/dns.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    DNS3 = class extends APIResource {
      static {
        __name(this, "DNS");
      }
      /**
       * Gets a list of all the domains that have resolved to a specific IP address.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const dns of client.intel.dns.list({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * })) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/intel/dns`, DNSV4PagePagination, {
          query,
          ...options
        });
      }
    };
    DNSV4PagePagination = class extends V4PagePagination {
      static {
        __name(this, "DNSV4PagePagination");
      }
    };
    DNS3.DNSV4PagePagination = DNSV4PagePagination;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/intel/domain-history.mjs
var DomainHistoryResource;
var init_domain_history = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/intel/domain-history.mjs"() {
    init_import_meta_url();
    init_resource();
    DomainHistoryResource = class extends APIResource {
      static {
        __name(this, "DomainHistoryResource");
      }
      /**
       * Gets historical security threat and content categories currently and previously
       * assigned to a domain.
       *
       * @example
       * ```ts
       * const domainHistories =
       *   await client.intel.domainHistory.get({
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   });
       * ```
       */
      get(params, options) {
        const { account_id, ...query } = params;
        return this._client.get(`/accounts/${account_id}/intel/domain-history`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/intel/ip-lists.mjs
var IPLists, IPListsSinglePage;
var init_ip_lists = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/intel/ip-lists.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    IPLists = class extends APIResource {
      static {
        __name(this, "IPLists");
      }
      /**
       * Get IP Lists.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const ipList of client.intel.ipLists.get({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * })) {
       *   // ...
       * }
       * ```
       */
      get(params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/intel/ip-list`, IPListsSinglePage, options);
      }
    };
    IPListsSinglePage = class extends SinglePage {
      static {
        __name(this, "IPListsSinglePage");
      }
    };
    IPLists.IPListsSinglePage = IPListsSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/intel/ips.mjs
var IPs3;
var init_ips3 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/intel/ips.mjs"() {
    init_import_meta_url();
    init_resource();
    IPs3 = class extends APIResource {
      static {
        __name(this, "IPs");
      }
      /**
       * Gets the geolocation, ASN, infrastructure type of the ASN, and any security
       * threat categories of an IP address. **Must provide ip query parameters.** For
       * example, `/intel/ip?ipv4=1.1.1.1` or `/intel/ip?ipv6=2001:db8::1`.
       *
       * @example
       * ```ts
       * const ips = await client.intel.ips.get({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      get(params, options) {
        const { account_id, ...query } = params;
        return this._client.get(`/accounts/${account_id}/intel/ip`, { query, ...options })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/intel/miscategorizations.mjs
var Miscategorizations;
var init_miscategorizations = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/intel/miscategorizations.mjs"() {
    init_import_meta_url();
    init_resource();
    Miscategorizations = class extends APIResource {
      static {
        __name(this, "Miscategorizations");
      }
      /**
       * Allows you to submit requests to change a domain’s category.
       *
       * @example
       * ```ts
       * const miscategorization =
       *   await client.intel.miscategorizations.create({
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/intel/miscategorization`, { body, ...options });
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/intel/sinkholes.mjs
var Sinkholes, SinkholesSinglePage;
var init_sinkholes = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/intel/sinkholes.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Sinkholes = class extends APIResource {
      static {
        __name(this, "Sinkholes");
      }
      /**
       * List sinkholes owned by this account
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const sinkhole of client.intel.sinkholes.list({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * })) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/intel/sinkholes`, SinkholesSinglePage, options);
      }
    };
    SinkholesSinglePage = class extends SinglePage {
      static {
        __name(this, "SinkholesSinglePage");
      }
    };
    Sinkholes.SinkholesSinglePage = SinkholesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/intel/whois.mjs
var Whois;
var init_whois = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/intel/whois.mjs"() {
    init_import_meta_url();
    init_resource();
    Whois = class extends APIResource {
      static {
        __name(this, "Whois");
      }
      /**
       * Get WHOIS Record
       *
       * @example
       * ```ts
       * const whois = await client.intel.whois.get({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      get(params, options) {
        const { account_id, ...query } = params;
        return this._client.get(`/accounts/${account_id}/intel/whois`, { query, ...options })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/intel/asn/subnets.mjs
var Subnets;
var init_subnets = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/intel/asn/subnets.mjs"() {
    init_import_meta_url();
    init_resource();
    Subnets = class extends APIResource {
      static {
        __name(this, "Subnets");
      }
      /**
       * Get ASN Subnets.
       *
       * @example
       * ```ts
       * const subnet = await client.intel.asn.subnets.get(0, {
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      get(asn, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/intel/asn/${asn}/subnets`, options);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/intel/asn/asn.mjs
var ASN3;
var init_asn3 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/intel/asn/asn.mjs"() {
    init_import_meta_url();
    init_resource();
    init_subnets();
    init_subnets();
    ASN3 = class extends APIResource {
      static {
        __name(this, "ASN");
      }
      constructor() {
        super(...arguments);
        this.subnets = new Subnets(this._client);
      }
      /**
       * Gets an overview of the Autonomous System Number (ASN) and a list of subnets for
       * it.
       *
       * @example
       * ```ts
       * const asn = await client.intel.asn.get(0, {
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      get(asn, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/intel/asn/${asn}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    ASN3.Subnets = Subnets;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/intel/attack-surface-report/issue-types.mjs
var IssueTypes, IssueTypeGetResponsesSinglePage;
var init_issue_types = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/intel/attack-surface-report/issue-types.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    IssueTypes = class extends APIResource {
      static {
        __name(this, "IssueTypes");
      }
      /**
       * Get Security Center Issues Types
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const issueTypeGetResponse of client.intel.attackSurfaceReport.issueTypes.get(
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      get(params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/intel/attack-surface-report/issue-types`, IssueTypeGetResponsesSinglePage, options);
      }
    };
    IssueTypeGetResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "IssueTypeGetResponsesSinglePage");
      }
    };
    IssueTypes.IssueTypeGetResponsesSinglePage = IssueTypeGetResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/intel/attack-surface-report/issues.mjs
var Issues, IssueListResponsesV4PagePagination;
var init_issues = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/intel/attack-surface-report/issues.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Issues = class extends APIResource {
      static {
        __name(this, "Issues");
      }
      /**
       * Get Security Center Issues
       *
       * @deprecated
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/intel/attack-surface-report/issues`, IssueListResponsesV4PagePagination, { query, ...options });
      }
      /**
       * Get Security Center Issue Counts by Class
       *
       * @deprecated
       */
      class(params, options) {
        const { account_id, ...query } = params;
        return this._client.get(`/accounts/${account_id}/intel/attack-surface-report/issues/class`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Archive Security Center Insight
       *
       * @deprecated
       */
      dismiss(issueId, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/intel/attack-surface-report/${issueId}/dismiss`, {
          body,
          ...options
        });
      }
      /**
       * Get Security Center Issue Counts by Severity
       *
       * @deprecated
       */
      severity(params, options) {
        const { account_id, ...query } = params;
        return this._client.get(`/accounts/${account_id}/intel/attack-surface-report/issues/severity`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get Security Center Issue Counts by Type
       *
       * @deprecated
       */
      type(params, options) {
        const { account_id, ...query } = params;
        return this._client.get(`/accounts/${account_id}/intel/attack-surface-report/issues/type`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
    IssueListResponsesV4PagePagination = class extends V4PagePagination {
      static {
        __name(this, "IssueListResponsesV4PagePagination");
      }
    };
    Issues.IssueListResponsesV4PagePagination = IssueListResponsesV4PagePagination;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/intel/attack-surface-report/attack-surface-report.mjs
var AttackSurfaceReport;
var init_attack_surface_report = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/intel/attack-surface-report/attack-surface-report.mjs"() {
    init_import_meta_url();
    init_resource();
    init_issue_types();
    init_issue_types();
    init_issues();
    init_issues();
    AttackSurfaceReport = class extends APIResource {
      static {
        __name(this, "AttackSurfaceReport");
      }
      constructor() {
        super(...arguments);
        this.issueTypes = new IssueTypes(this._client);
        this.issues = new Issues(this._client);
      }
    };
    AttackSurfaceReport.IssueTypes = IssueTypes;
    AttackSurfaceReport.IssueTypeGetResponsesSinglePage = IssueTypeGetResponsesSinglePage;
    AttackSurfaceReport.Issues = Issues;
    AttackSurfaceReport.IssueListResponsesV4PagePagination = IssueListResponsesV4PagePagination;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/intel/domains/bulks.mjs
var Bulks;
var init_bulks = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/intel/domains/bulks.mjs"() {
    init_import_meta_url();
    init_resource();
    Bulks = class extends APIResource {
      static {
        __name(this, "Bulks");
      }
      /**
       * Same as summary.
       *
       * @example
       * ```ts
       * const bulks = await client.intel.domains.bulks.get({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      get(params, options) {
        const { account_id, ...query } = params;
        return this._client.get(`/accounts/${account_id}/intel/domain/bulk`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/intel/domains/domains.mjs
var Domains2;
var init_domains2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/intel/domains/domains.mjs"() {
    init_import_meta_url();
    init_resource();
    init_bulks();
    init_bulks();
    Domains2 = class extends APIResource {
      static {
        __name(this, "Domains");
      }
      constructor() {
        super(...arguments);
        this.bulks = new Bulks(this._client);
      }
      /**
       * Gets security details and statistics about a domain.
       *
       * @example
       * ```ts
       * const domain = await client.intel.domains.get({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      get(params, options) {
        const { account_id, ...query } = params;
        return this._client.get(`/accounts/${account_id}/intel/domain`, { query, ...options })._thenUnwrap((obj) => obj.result);
      }
    };
    Domains2.Bulks = Bulks;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/intel/indicator-feeds/downloads.mjs
var Downloads;
var init_downloads = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/intel/indicator-feeds/downloads.mjs"() {
    init_import_meta_url();
    init_resource();
    Downloads = class extends APIResource {
      static {
        __name(this, "Downloads");
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/intel/indicator-feeds/permissions.mjs
var Permissions;
var init_permissions = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/intel/indicator-feeds/permissions.mjs"() {
    init_import_meta_url();
    init_resource();
    Permissions = class extends APIResource {
      static {
        __name(this, "Permissions");
      }
      /**
       * Grant permission to indicator feed
       *
       * @example
       * ```ts
       * const permission =
       *   await client.intel.indicatorFeeds.permissions.create({
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/intel/indicator-feeds/permissions/add`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List indicator feed permissions
       *
       * @example
       * ```ts
       * const permissions =
       *   await client.intel.indicatorFeeds.permissions.list({
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   });
       * ```
       */
      list(params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/intel/indicator-feeds/permissions/view`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Revoke permission to indicator feed
       *
       * @example
       * ```ts
       * const permission =
       *   await client.intel.indicatorFeeds.permissions.delete({
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   });
       * ```
       */
      delete(params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/intel/indicator-feeds/permissions/remove`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/intel/indicator-feeds/snapshots.mjs
var Snapshots;
var init_snapshots = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/intel/indicator-feeds/snapshots.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    Snapshots = class extends APIResource {
      static {
        __name(this, "Snapshots");
      }
      /**
       * Update indicator feed data
       *
       * @example
       * ```ts
       * const snapshot =
       *   await client.intel.indicatorFeeds.snapshots.update(12, {
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   });
       * ```
       */
      update(feedId, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/intel/indicator-feeds/${feedId}/snapshot`, multipartFormRequestOptions({ body, ...options }))._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/intel/indicator-feeds/indicator-feeds.mjs
var IndicatorFeeds, IndicatorFeedListResponsesSinglePage;
var init_indicator_feeds = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/intel/indicator-feeds/indicator-feeds.mjs"() {
    init_import_meta_url();
    init_resource();
    init_downloads();
    init_downloads();
    init_permissions();
    init_permissions();
    init_snapshots();
    init_snapshots();
    init_pagination();
    IndicatorFeeds = class extends APIResource {
      static {
        __name(this, "IndicatorFeeds");
      }
      constructor() {
        super(...arguments);
        this.snapshots = new Snapshots(this._client);
        this.permissions = new Permissions(this._client);
        this.downloads = new Downloads(this._client);
      }
      /**
       * Create new indicator feed
       *
       * @example
       * ```ts
       * const indicatorFeed =
       *   await client.intel.indicatorFeeds.create({
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/intel/indicator-feeds`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Update indicator feed metadata
       *
       * @example
       * ```ts
       * const indicatorFeed =
       *   await client.intel.indicatorFeeds.update(12, {
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   });
       * ```
       */
      update(feedId, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/intel/indicator-feeds/${feedId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get indicator feeds owned by this account
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const indicatorFeedListResponse of client.intel.indicatorFeeds.list(
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/intel/indicator-feeds`, IndicatorFeedListResponsesSinglePage, options);
      }
      /**
       * Get indicator feed data
       *
       * @example
       * ```ts
       * const response = await client.intel.indicatorFeeds.data(
       *   12,
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      data(feedId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/intel/indicator-feeds/${feedId}/data`, {
          ...options,
          headers: { Accept: "text/csv", ...options?.headers }
        });
      }
      /**
       * Get indicator feed metadata
       *
       * @example
       * ```ts
       * const indicatorFeed = await client.intel.indicatorFeeds.get(
       *   12,
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(feedId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/intel/indicator-feeds/${feedId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    IndicatorFeedListResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "IndicatorFeedListResponsesSinglePage");
      }
    };
    IndicatorFeeds.IndicatorFeedListResponsesSinglePage = IndicatorFeedListResponsesSinglePage;
    IndicatorFeeds.Snapshots = Snapshots;
    IndicatorFeeds.Permissions = Permissions;
    IndicatorFeeds.Downloads = Downloads;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/intel/intel.mjs
var Intel;
var init_intel = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/intel/intel.mjs"() {
    init_import_meta_url();
    init_resource();
    init_dns3();
    init_dns3();
    init_domain_history();
    init_domain_history();
    init_ip_lists();
    init_ip_lists();
    init_ips3();
    init_ips3();
    init_miscategorizations();
    init_miscategorizations();
    init_sinkholes();
    init_sinkholes();
    init_whois();
    init_asn3();
    init_asn3();
    init_attack_surface_report();
    init_attack_surface_report();
    init_domains2();
    init_domains2();
    init_indicator_feeds();
    init_indicator_feeds();
    Intel = class extends APIResource {
      static {
        __name(this, "Intel");
      }
      constructor() {
        super(...arguments);
        this.asn = new ASN3(this._client);
        this.dns = new DNS3(this._client);
        this.domains = new Domains2(this._client);
        this.domainHistory = new DomainHistoryResource(this._client);
        this.ips = new IPs3(this._client);
        this.ipLists = new IPLists(this._client);
        this.miscategorizations = new Miscategorizations(this._client);
        this.whois = new Whois(this._client);
        this.indicatorFeeds = new IndicatorFeeds(this._client);
        this.sinkholes = new Sinkholes(this._client);
        this.attackSurfaceReport = new AttackSurfaceReport(this._client);
      }
    };
    Intel.ASN = ASN3;
    Intel.DNSV4PagePagination = DNSV4PagePagination;
    Intel.Domains = Domains2;
    Intel.DomainHistoryResource = DomainHistoryResource;
    Intel.IPs = IPs3;
    Intel.IPLists = IPLists;
    Intel.IPListsSinglePage = IPListsSinglePage;
    Intel.Miscategorizations = Miscategorizations;
    Intel.IndicatorFeeds = IndicatorFeeds;
    Intel.IndicatorFeedListResponsesSinglePage = IndicatorFeedListResponsesSinglePage;
    Intel.Sinkholes = Sinkholes;
    Intel.SinkholesSinglePage = SinkholesSinglePage;
    Intel.AttackSurfaceReport = AttackSurfaceReport;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/kv/namespaces/keys.mjs
var Keys2, KeysCursorPaginationAfter;
var init_keys2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/kv/namespaces/keys.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Keys2 = class extends APIResource {
      static {
        __name(this, "Keys");
      }
      /**
       * Lists a namespace's keys.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const key of client.kv.namespaces.keys.list(
       *   '0f2ac74b498b48028cb68387c421e279',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(namespaceId, params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/storage/kv/namespaces/${namespaceId}/keys`, KeysCursorPaginationAfter, { query, ...options });
      }
      /**
       * Remove multiple KV pairs from the namespace. Body should be an array of up to
       * 10,000 keys to be removed.
       *
       * @deprecated Please use kv.namespaces.bulk_delete instead
       */
      bulkDelete(namespaceId, params, options) {
        const { account_id, body } = params;
        return this._client.post(`/accounts/${account_id}/storage/kv/namespaces/${namespaceId}/bulk/delete`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Retrieve up to 100 KV pairs from the namespace. Keys must contain text-based
       * values. JSON values can optionally be parsed instead of being returned as a
       * string value. Metadata can be included if `withMetadata` is true.
       *
       * @deprecated Please use kv.namespaces.bulk_get instead
       */
      bulkGet(namespaceId, params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/storage/kv/namespaces/${namespaceId}/bulk/get`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Write multiple keys and values at once. Body should be an array of up to 10,000
       * key-value pairs to be stored, along with optional expiration information.
       * Existing values and expirations will be overwritten. If neither `expiration` nor
       * `expiration_ttl` is specified, the key-value pair will never expire. If both are
       * set, `expiration_ttl` is used and `expiration` is ignored. The entire request
       * size must be 100 megabytes or less.
       *
       * @deprecated Please use kv.namespaces.bulk_update instead
       */
      bulkUpdate(namespaceId, params, options) {
        const { account_id, body } = params;
        return this._client.put(`/accounts/${account_id}/storage/kv/namespaces/${namespaceId}/bulk`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
    KeysCursorPaginationAfter = class extends CursorPaginationAfter {
      static {
        __name(this, "KeysCursorPaginationAfter");
      }
    };
    Keys2.KeysCursorPaginationAfter = KeysCursorPaginationAfter;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/kv/namespaces/metadata.mjs
var Metadata;
var init_metadata = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/kv/namespaces/metadata.mjs"() {
    init_import_meta_url();
    init_resource();
    Metadata = class extends APIResource {
      static {
        __name(this, "Metadata");
      }
      /**
       * Returns the metadata associated with the given key in the given namespace. Use
       * URL-encoding to use special characters (for example, `:`, `!`, `%`) in the key
       * name.
       *
       * @example
       * ```ts
       * const metadata = await client.kv.namespaces.metadata.get(
       *   '0f2ac74b498b48028cb68387c421e279',
       *   'My-Key',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(namespaceId, keyName, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/storage/kv/namespaces/${namespaceId}/metadata/${keyName}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/kv/namespaces/values.mjs
var Values;
var init_values = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/kv/namespaces/values.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    Values = class extends APIResource {
      static {
        __name(this, "Values");
      }
      /**
       * Write a value identified by a key. Use URL-encoding to use special characters
       * (for example, `:`, `!`, `%`) in the key name. Body should be the value to be
       * stored. If JSON metadata to be associated with the key/value pair is needed, use
       * `multipart/form-data` content type for your PUT request (see dropdown below in
       * `REQUEST BODY SCHEMA`). Existing values, expirations, and metadata will be
       * overwritten. If neither `expiration` nor `expiration_ttl` is specified, the
       * key-value pair will never expire. If both are set, `expiration_ttl` is used and
       * `expiration` is ignored.
       *
       * @example
       * ```ts
       * const value = await client.kv.namespaces.values.update(
       *   '0f2ac74b498b48028cb68387c421e279',
       *   'My-Key',
       *   {
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     value: 'Some Value',
       *   },
       * );
       * ```
       */
      update(namespaceId, keyName, params, options) {
        const { account_id, expiration, expiration_ttl, ...body } = params;
        return this._client.put(`/accounts/${account_id}/storage/kv/namespaces/${namespaceId}/values/${keyName}`, multipartFormRequestOptions({
          query: { expiration, expiration_ttl },
          body,
          __multipartSyntax: "json",
          ...options
        }))._thenUnwrap((obj) => obj.result);
      }
      /**
       * Remove a KV pair from the namespace. Use URL-encoding to use special characters
       * (for example, `:`, `!`, `%`) in the key name.
       *
       * @example
       * ```ts
       * const value = await client.kv.namespaces.values.delete(
       *   '0f2ac74b498b48028cb68387c421e279',
       *   'My-Key',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      delete(namespaceId, keyName, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/storage/kv/namespaces/${namespaceId}/values/${keyName}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Returns the value associated with the given key in the given namespace. Use
       * URL-encoding to use special characters (for example, `:`, `!`, `%`) in the key
       * name. If the KV-pair is set to expire at some point, the expiration time as
       * measured in seconds since the UNIX epoch will be returned in the `expiration`
       * response header.
       *
       * @example
       * ```ts
       * const value = await client.kv.namespaces.values.get(
       *   '0f2ac74b498b48028cb68387c421e279',
       *   'My-Key',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       *
       * const content = await value.blob();
       * console.log(content);
       * ```
       */
      get(namespaceId, keyName, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/storage/kv/namespaces/${namespaceId}/values/${keyName}`, {
          ...options,
          headers: { Accept: "application/octet-stream", ...options?.headers },
          __binaryResponse: true
        });
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/kv/namespaces/namespaces.mjs
var Namespaces2, NamespacesV4PagePaginationArray2;
var init_namespaces2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/kv/namespaces/namespaces.mjs"() {
    init_import_meta_url();
    init_resource();
    init_keys2();
    init_keys2();
    init_metadata();
    init_metadata();
    init_values();
    init_values();
    init_pagination();
    Namespaces2 = class extends APIResource {
      static {
        __name(this, "Namespaces");
      }
      constructor() {
        super(...arguments);
        this.keys = new Keys2(this._client);
        this.metadata = new Metadata(this._client);
        this.values = new Values(this._client);
      }
      /**
       * Creates a namespace under the given title. A `400` is returned if the account
       * already owns a namespace with this title. A namespace must be explicitly deleted
       * to be replaced.
       *
       * @example
       * ```ts
       * const namespace = await client.kv.namespaces.create({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   title: 'My Own Namespace',
       * });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/storage/kv/namespaces`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Modifies a namespace's title.
       *
       * @example
       * ```ts
       * const namespace = await client.kv.namespaces.update(
       *   '0f2ac74b498b48028cb68387c421e279',
       *   {
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     title: 'My Own Namespace',
       *   },
       * );
       * ```
       */
      update(namespaceId, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/storage/kv/namespaces/${namespaceId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Returns the namespaces owned by an account.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const namespace of client.kv.namespaces.list({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * })) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/storage/kv/namespaces`, NamespacesV4PagePaginationArray2, { query, ...options });
      }
      /**
       * Deletes the namespace corresponding to the given ID.
       *
       * @example
       * ```ts
       * const namespace = await client.kv.namespaces.delete(
       *   '0f2ac74b498b48028cb68387c421e279',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      delete(namespaceId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/storage/kv/namespaces/${namespaceId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Remove multiple KV pairs from the namespace. Body should be an array of up to
       * 10,000 keys to be removed.
       *
       * @example
       * ```ts
       * const response = await client.kv.namespaces.bulkDelete(
       *   '0f2ac74b498b48028cb68387c421e279',
       *   {
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     body: ['My-Key'],
       *   },
       * );
       * ```
       */
      bulkDelete(namespaceId, params, options) {
        const { account_id, body } = params;
        return this._client.post(`/accounts/${account_id}/storage/kv/namespaces/${namespaceId}/bulk/delete`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Retrieve up to 100 KV pairs from the namespace. Keys must contain text-based
       * values. JSON values can optionally be parsed instead of being returned as a
       * string value. Metadata can be included if `withMetadata` is true.
       *
       * @example
       * ```ts
       * const response = await client.kv.namespaces.bulkGet(
       *   '0f2ac74b498b48028cb68387c421e279',
       *   {
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     keys: ['My-Key'],
       *   },
       * );
       * ```
       */
      bulkGet(namespaceId, params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/storage/kv/namespaces/${namespaceId}/bulk/get`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Write multiple keys and values at once. Body should be an array of up to 10,000
       * key-value pairs to be stored, along with optional expiration information.
       * Existing values and expirations will be overwritten. If neither `expiration` nor
       * `expiration_ttl` is specified, the key-value pair will never expire. If both are
       * set, `expiration_ttl` is used and `expiration` is ignored. The entire request
       * size must be 100 megabytes or less.
       *
       * @example
       * ```ts
       * const response = await client.kv.namespaces.bulkUpdate(
       *   '0f2ac74b498b48028cb68387c421e279',
       *   {
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     body: [{ key: 'My-Key', value: 'Some string' }],
       *   },
       * );
       * ```
       */
      bulkUpdate(namespaceId, params, options) {
        const { account_id, body } = params;
        return this._client.put(`/accounts/${account_id}/storage/kv/namespaces/${namespaceId}/bulk`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get the namespace corresponding to the given ID.
       *
       * @example
       * ```ts
       * const namespace = await client.kv.namespaces.get(
       *   '0f2ac74b498b48028cb68387c421e279',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(namespaceId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/storage/kv/namespaces/${namespaceId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    NamespacesV4PagePaginationArray2 = class extends V4PagePaginationArray {
      static {
        __name(this, "NamespacesV4PagePaginationArray");
      }
    };
    Namespaces2.NamespacesV4PagePaginationArray = NamespacesV4PagePaginationArray2;
    Namespaces2.Keys = Keys2;
    Namespaces2.KeysCursorPaginationAfter = KeysCursorPaginationAfter;
    Namespaces2.Metadata = Metadata;
    Namespaces2.Values = Values;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/kv/kv.mjs
var KV;
var init_kv = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/kv/kv.mjs"() {
    init_import_meta_url();
    init_resource();
    init_namespaces2();
    init_namespaces2();
    KV = class extends APIResource {
      static {
        __name(this, "KV");
      }
      constructor() {
        super(...arguments);
        this.namespaces = new Namespaces2(this._client);
      }
    };
    KV.Namespaces = Namespaces2;
    KV.NamespacesV4PagePaginationArray = NamespacesV4PagePaginationArray2;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/keyless-certificates.mjs
var KeylessCertificates, KeylessCertificatesSinglePage;
var init_keyless_certificates = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/keyless-certificates.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    KeylessCertificates = class extends APIResource {
      static {
        __name(this, "KeylessCertificates");
      }
      /**
       * Create Keyless SSL Configuration
       *
       * @example
       * ```ts
       * const keylessCertificate =
       *   await client.keylessCertificates.create({
       *     zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     certificate:
       *       '-----BEGIN CERTIFICATE----- MIIDtTCCAp2gAwIBAgIJAM15n7fdxhRtMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNV BAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX aWRnaXRzIFB0eSBMdGQwHhcNMTQwMzExMTkyMTU5WhcNMTQwNDEwMTkyMTU5WjBF MQswCQYDVQQGEwJVUzETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50 ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB CgKCAQEAvq3sKsHpeduJHimOK+fvQdKsI8z8A05MZyyLp2/R/GE8FjNv+hkVY1WQ LIyTNNQH7CJecE1nbTfo8Y56S7x/rhxC6/DJ8MIulapFPnorq46KU6yRxiM0MQ3N nTJHlHA2ozZta6YBBfVfhHWl1F0IfNbXCLKvGwWWMbCx43OfW6KTkbRnE6gFWKuO fSO5h2u5TaWVuSIzBvYs7Vza6m+gtYAvKAJV2nSZ+eSEFPDo29corOy8+huEOUL8 5FAw4BFPsr1TlrlGPFitduQUHGrSL7skk1ESGza0to3bOtrodKei2s9bk5MXm7lZ qI+WZJX4Zu9+mzZhc9pCVi8r/qlXuQIDAQABo4GnMIGkMB0GA1UdDgQWBBRvavf+ sWM4IwKiH9X9w1vl6nUVRDB1BgNVHSMEbjBsgBRvavf+sWM4IwKiH9X9w1vl6nUV RKFJpEcwRTELMAkGA1UEBhMCVVMxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNV BAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAM15n7fdxhRtMAwGA1UdEwQF MAMBAf8wDQYJKoZIhvcNAQEFBQADggEBABY2ZzBaW0dMsAAT7tPJzrVWVzQx6KU4 UEBLudIlWPlkAwTnINCWR/8eNjCCmGA4heUdHmazdpPa8RzwOmc0NT1NQqzSyktt vTqb4iHD7+8f9MqJ9/FssCfTtqr/Qst/hGH4Wmdf1EJ/6FqYAAb5iRlPgshFZxU8 uXtA8hWn6fK6eISD9HBdcAFToUvKNZ1BIDPvh9f95Ine8ar6yGd56TUNrHR8eHBs ESxz5ddVR/oWRysNJ+aGAyYqHS8S/ttmC7r4XCAHqXptkHPCGRqkAhsterYhd4I8 /cBzejUobNCjjHFbtkAL/SjxZOLW+pNkZwfeYdM8iPkD54Uua1v2tdw= -----END CERTIFICATE-----',
       *     host: 'example.com',
       *     port: 24008,
       *   });
       * ```
       */
      create(params, options) {
        const { zone_id, ...body } = params;
        return this._client.post(`/zones/${zone_id}/keyless_certificates`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List all Keyless SSL configurations for a given zone.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const keylessCertificate of client.keylessCertificates.list(
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { zone_id } = params;
        return this._client.getAPIList(`/zones/${zone_id}/keyless_certificates`, KeylessCertificatesSinglePage, options);
      }
      /**
       * Delete Keyless SSL Configuration
       *
       * @example
       * ```ts
       * const keylessCertificate =
       *   await client.keylessCertificates.delete(
       *     '023e105f4ecef8ad9ca31a8372d0c353',
       *     { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      delete(keylessCertificateId, params, options) {
        const { zone_id } = params;
        return this._client.delete(`/zones/${zone_id}/keyless_certificates/${keylessCertificateId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * This will update attributes of a Keyless SSL. Consists of one or more of the
       * following: host,name,port.
       *
       * @example
       * ```ts
       * const keylessCertificate =
       *   await client.keylessCertificates.edit(
       *     '023e105f4ecef8ad9ca31a8372d0c353',
       *     { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      edit(keylessCertificateId, params, options) {
        const { zone_id, ...body } = params;
        return this._client.patch(`/zones/${zone_id}/keyless_certificates/${keylessCertificateId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get details for one Keyless SSL configuration.
       *
       * @example
       * ```ts
       * const keylessCertificate =
       *   await client.keylessCertificates.get(
       *     '023e105f4ecef8ad9ca31a8372d0c353',
       *     { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      get(keylessCertificateId, params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/keyless_certificates/${keylessCertificateId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    KeylessCertificatesSinglePage = class extends SinglePage {
      static {
        __name(this, "KeylessCertificatesSinglePage");
      }
    };
    KeylessCertificates.KeylessCertificatesSinglePage = KeylessCertificatesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/leaked-credential-checks/detections.mjs
var Detections2, DetectionListResponsesSinglePage;
var init_detections2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/leaked-credential-checks/detections.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Detections2 = class extends APIResource {
      static {
        __name(this, "Detections");
      }
      /**
       * Create user-defined detection pattern for Leaked Credential Checks.
       *
       * @example
       * ```ts
       * const detection =
       *   await client.leakedCredentialChecks.detections.create({
       *     zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   });
       * ```
       */
      create(params, options) {
        const { zone_id, ...body } = params;
        return this._client.post(`/zones/${zone_id}/leaked-credential-checks/detections`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Update user-defined detection pattern for Leaked Credential Checks.
       *
       * @example
       * ```ts
       * const detection =
       *   await client.leakedCredentialChecks.detections.update(
       *     '18a14bafaa8eb1df04ce683ec18c765e',
       *     { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      update(detectionId, params, options) {
        const { zone_id, ...body } = params;
        return this._client.put(`/zones/${zone_id}/leaked-credential-checks/detections/${detectionId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List user-defined detection patterns for Leaked Credential Checks.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const detectionListResponse of client.leakedCredentialChecks.detections.list(
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { zone_id } = params;
        return this._client.getAPIList(`/zones/${zone_id}/leaked-credential-checks/detections`, DetectionListResponsesSinglePage, options);
      }
      /**
       * Remove user-defined detection pattern for Leaked Credential Checks.
       *
       * @example
       * ```ts
       * const detection =
       *   await client.leakedCredentialChecks.detections.delete(
       *     '18a14bafaa8eb1df04ce683ec18c765e',
       *     { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      delete(detectionId, params, options) {
        const { zone_id } = params;
        return this._client.delete(`/zones/${zone_id}/leaked-credential-checks/detections/${detectionId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    DetectionListResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "DetectionListResponsesSinglePage");
      }
    };
    Detections2.DetectionListResponsesSinglePage = DetectionListResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/leaked-credential-checks/leaked-credential-checks.mjs
var LeakedCredentialChecks;
var init_leaked_credential_checks = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/leaked-credential-checks/leaked-credential-checks.mjs"() {
    init_import_meta_url();
    init_resource();
    init_detections2();
    init_detections2();
    LeakedCredentialChecks = class extends APIResource {
      static {
        __name(this, "LeakedCredentialChecks");
      }
      constructor() {
        super(...arguments);
        this.detections = new Detections2(this._client);
      }
      /**
       * Updates the current status of Leaked Credential Checks.
       *
       * @example
       * ```ts
       * const leakedCredentialCheck =
       *   await client.leakedCredentialChecks.create({
       *     zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   });
       * ```
       */
      create(params, options) {
        const { zone_id, ...body } = params;
        return this._client.post(`/zones/${zone_id}/leaked-credential-checks`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Retrieves the current status of Leaked Credential Checks.
       *
       * @example
       * ```ts
       * const leakedCredentialCheck =
       *   await client.leakedCredentialChecks.get({
       *     zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   });
       * ```
       */
      get(params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/leaked-credential-checks`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    LeakedCredentialChecks.Detections = Detections2;
    LeakedCredentialChecks.DetectionListResponsesSinglePage = DetectionListResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/load-balancers/monitor-groups.mjs
var MonitorGroups, MonitorGroupsSinglePage;
var init_monitor_groups = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/load-balancers/monitor-groups.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    MonitorGroups = class extends APIResource {
      static {
        __name(this, "MonitorGroups");
      }
      /**
       * Create a new monitor group.
       *
       * @example
       * ```ts
       * const monitorGroup =
       *   await client.loadBalancers.monitorGroups.create({
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     id: 'id',
       *     description: 'Primary datacenter monitors',
       *     members: [
       *       {
       *         enabled: true,
       *         monitor_id: 'monitor_id',
       *         monitoring_only: false,
       *         must_be_healthy: true,
       *       },
       *     ],
       *   });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/load_balancers/monitor_groups`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Modify a configured monitor group.
       *
       * @example
       * ```ts
       * const monitorGroup =
       *   await client.loadBalancers.monitorGroups.update(
       *     '17b5962d775c646f3f9725cbc7a53df4',
       *     {
       *       account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *       id: 'id',
       *       description: 'Primary datacenter monitors',
       *       members: [
       *         {
       *           enabled: true,
       *           monitor_id: 'monitor_id',
       *           monitoring_only: false,
       *           must_be_healthy: true,
       *         },
       *       ],
       *     },
       *   );
       * ```
       */
      update(monitorGroupId, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/load_balancers/monitor_groups/${monitorGroupId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List configured monitor groups.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const monitorGroup of client.loadBalancers.monitorGroups.list(
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/load_balancers/monitor_groups`, MonitorGroupsSinglePage, options);
      }
      /**
       * Delete a configured monitor group.
       *
       * @example
       * ```ts
       * const monitorGroup =
       *   await client.loadBalancers.monitorGroups.delete(
       *     '17b5962d775c646f3f9725cbc7a53df4',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      delete(monitorGroupId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/load_balancers/monitor_groups/${monitorGroupId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Apply changes to an existing monitor group, overwriting the supplied properties.
       *
       * @example
       * ```ts
       * const monitorGroup =
       *   await client.loadBalancers.monitorGroups.edit(
       *     '17b5962d775c646f3f9725cbc7a53df4',
       *     {
       *       account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *       id: 'id',
       *       description: 'Primary datacenter monitors',
       *       members: [
       *         {
       *           enabled: true,
       *           monitor_id: 'monitor_id',
       *           monitoring_only: false,
       *           must_be_healthy: true,
       *         },
       *       ],
       *     },
       *   );
       * ```
       */
      edit(monitorGroupId, params, options) {
        const { account_id, ...body } = params;
        return this._client.patch(`/accounts/${account_id}/load_balancers/monitor_groups/${monitorGroupId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetch a single configured monitor group.
       *
       * @example
       * ```ts
       * const monitorGroup =
       *   await client.loadBalancers.monitorGroups.get(
       *     '17b5962d775c646f3f9725cbc7a53df4',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      get(monitorGroupId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/load_balancers/monitor_groups/${monitorGroupId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    MonitorGroupsSinglePage = class extends SinglePage {
      static {
        __name(this, "MonitorGroupsSinglePage");
      }
    };
    MonitorGroups.MonitorGroupsSinglePage = MonitorGroupsSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/load-balancers/previews.mjs
var Previews2;
var init_previews2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/load-balancers/previews.mjs"() {
    init_import_meta_url();
    init_resource();
    Previews2 = class extends APIResource {
      static {
        __name(this, "Previews");
      }
      /**
       * Get the result of a previous preview operation using the provided preview_id.
       *
       * @example
       * ```ts
       * const preview = await client.loadBalancers.previews.get(
       *   'p1aba936b94213e5b8dca0c0dbf1f9cc',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(previewId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/load_balancers/preview/${previewId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/load-balancers/regions.mjs
var Regions2;
var init_regions2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/load-balancers/regions.mjs"() {
    init_import_meta_url();
    init_resource();
    Regions2 = class extends APIResource {
      static {
        __name(this, "Regions");
      }
      /**
       * List all region mappings.
       *
       * @example
       * ```ts
       * const regions = await client.loadBalancers.regions.list({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.get(`/accounts/${account_id}/load_balancers/regions`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get a single region mapping.
       *
       * @example
       * ```ts
       * const region = await client.loadBalancers.regions.get(
       *   'WNAM',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(regionId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/load_balancers/regions/${regionId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/load-balancers/searches.mjs
var Searches, SearchListResponsesV4PagePagination;
var init_searches = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/load-balancers/searches.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Searches = class extends APIResource {
      static {
        __name(this, "Searches");
      }
      /**
       * Search for Load Balancing resources.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const searchListResponse of client.loadBalancers.searches.list(
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/load_balancers/search`, SearchListResponsesV4PagePagination, { query, ...options });
      }
    };
    SearchListResponsesV4PagePagination = class extends V4PagePagination {
      static {
        __name(this, "SearchListResponsesV4PagePagination");
      }
    };
    Searches.SearchListResponsesV4PagePagination = SearchListResponsesV4PagePagination;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/load-balancers/monitors/previews.mjs
var Previews3;
var init_previews3 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/load-balancers/monitors/previews.mjs"() {
    init_import_meta_url();
    init_resource();
    Previews3 = class extends APIResource {
      static {
        __name(this, "Previews");
      }
      /**
       * Preview pools using the specified monitor with provided monitor details. The
       * returned preview_id can be used in the preview endpoint to retrieve the results.
       *
       * @example
       * ```ts
       * const preview =
       *   await client.loadBalancers.monitors.previews.create(
       *     'f1aba936b94213e5b8dca0c0dbf1f9cc',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      create(monitorId, params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/load_balancers/monitors/${monitorId}/preview`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/load-balancers/monitors/references.mjs
var References, ReferenceGetResponsesSinglePage;
var init_references = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/load-balancers/monitors/references.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    References = class extends APIResource {
      static {
        __name(this, "References");
      }
      /**
       * Get the list of resources that reference the provided monitor.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const referenceGetResponse of client.loadBalancers.monitors.references.get(
       *   'f1aba936b94213e5b8dca0c0dbf1f9cc',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      get(monitorId, params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/load_balancers/monitors/${monitorId}/references`, ReferenceGetResponsesSinglePage, options);
      }
    };
    ReferenceGetResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "ReferenceGetResponsesSinglePage");
      }
    };
    References.ReferenceGetResponsesSinglePage = ReferenceGetResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/load-balancers/monitors/monitors.mjs
var Monitors, MonitorsSinglePage;
var init_monitors = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/load-balancers/monitors/monitors.mjs"() {
    init_import_meta_url();
    init_resource();
    init_previews3();
    init_previews3();
    init_references();
    init_references();
    init_pagination();
    Monitors = class extends APIResource {
      static {
        __name(this, "Monitors");
      }
      constructor() {
        super(...arguments);
        this.previews = new Previews3(this._client);
        this.references = new References(this._client);
      }
      /**
       * Create a configured monitor.
       *
       * @example
       * ```ts
       * const monitor = await client.loadBalancers.monitors.create({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/load_balancers/monitors`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Modify a configured monitor.
       *
       * @example
       * ```ts
       * const monitor = await client.loadBalancers.monitors.update(
       *   'f1aba936b94213e5b8dca0c0dbf1f9cc',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      update(monitorId, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/load_balancers/monitors/${monitorId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List configured monitors for an account.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const monitor of client.loadBalancers.monitors.list(
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/load_balancers/monitors`, MonitorsSinglePage, options);
      }
      /**
       * Delete a configured monitor.
       *
       * @example
       * ```ts
       * const monitor = await client.loadBalancers.monitors.delete(
       *   'f1aba936b94213e5b8dca0c0dbf1f9cc',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      delete(monitorId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/load_balancers/monitors/${monitorId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Apply changes to an existing monitor, overwriting the supplied properties.
       *
       * @example
       * ```ts
       * const monitor = await client.loadBalancers.monitors.edit(
       *   'f1aba936b94213e5b8dca0c0dbf1f9cc',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      edit(monitorId, params, options) {
        const { account_id, ...body } = params;
        return this._client.patch(`/accounts/${account_id}/load_balancers/monitors/${monitorId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List a single configured monitor for an account.
       *
       * @example
       * ```ts
       * const monitor = await client.loadBalancers.monitors.get(
       *   'f1aba936b94213e5b8dca0c0dbf1f9cc',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(monitorId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/load_balancers/monitors/${monitorId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    MonitorsSinglePage = class extends SinglePage {
      static {
        __name(this, "MonitorsSinglePage");
      }
    };
    Monitors.MonitorsSinglePage = MonitorsSinglePage;
    Monitors.Previews = Previews3;
    Monitors.References = References;
    Monitors.ReferenceGetResponsesSinglePage = ReferenceGetResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/load-balancers/pools/health.mjs
var Health2;
var init_health2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/load-balancers/pools/health.mjs"() {
    init_import_meta_url();
    init_resource();
    Health2 = class extends APIResource {
      static {
        __name(this, "Health");
      }
      /**
       * Preview pool health using provided monitor details. The returned preview_id can
       * be used in the preview endpoint to retrieve the results.
       *
       * @example
       * ```ts
       * const health =
       *   await client.loadBalancers.pools.health.create(
       *     '17b5962d775c646f3f9725cbc7a53df4',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      create(poolId, params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/load_balancers/pools/${poolId}/preview`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetch the latest pool health status for a single pool.
       *
       * @example
       * ```ts
       * const health = await client.loadBalancers.pools.health.get(
       *   '17b5962d775c646f3f9725cbc7a53df4',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(poolId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/load_balancers/pools/${poolId}/health`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/load-balancers/pools/references.mjs
var References2, ReferenceGetResponsesSinglePage2;
var init_references2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/load-balancers/pools/references.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    References2 = class extends APIResource {
      static {
        __name(this, "References");
      }
      /**
       * Get the list of resources that reference the provided pool.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const referenceGetResponse of client.loadBalancers.pools.references.get(
       *   '17b5962d775c646f3f9725cbc7a53df4',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      get(poolId, params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/load_balancers/pools/${poolId}/references`, ReferenceGetResponsesSinglePage2, options);
      }
    };
    ReferenceGetResponsesSinglePage2 = class extends SinglePage {
      static {
        __name(this, "ReferenceGetResponsesSinglePage");
      }
    };
    References2.ReferenceGetResponsesSinglePage = ReferenceGetResponsesSinglePage2;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/load-balancers/pools/pools.mjs
var Pools, PoolsSinglePage;
var init_pools = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/load-balancers/pools/pools.mjs"() {
    init_import_meta_url();
    init_resource();
    init_health2();
    init_health2();
    init_references2();
    init_references2();
    init_pagination();
    Pools = class extends APIResource {
      static {
        __name(this, "Pools");
      }
      constructor() {
        super(...arguments);
        this.health = new Health2(this._client);
        this.references = new References2(this._client);
      }
      /**
       * Create a new pool.
       *
       * @example
       * ```ts
       * const pool = await client.loadBalancers.pools.create({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   name: 'primary-dc-1',
       *   origins: [{}],
       * });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/load_balancers/pools`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Modify a configured pool.
       *
       * @example
       * ```ts
       * const pool = await client.loadBalancers.pools.update(
       *   '17b5962d775c646f3f9725cbc7a53df4',
       *   {
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     name: 'primary-dc-1',
       *     origins: [{}],
       *   },
       * );
       * ```
       */
      update(poolId, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/load_balancers/pools/${poolId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List configured pools.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const pool of client.loadBalancers.pools.list({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * })) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/load_balancers/pools`, PoolsSinglePage, {
          query,
          ...options
        });
      }
      /**
       * Delete a configured pool.
       *
       * @example
       * ```ts
       * const pool = await client.loadBalancers.pools.delete(
       *   '17b5962d775c646f3f9725cbc7a53df4',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      delete(poolId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/load_balancers/pools/${poolId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Apply changes to a number of existing pools, overwriting the supplied
       * properties. Pools are ordered by ascending `name`. Returns the list of affected
       * pools. Supports the standard pagination query parameters, either
       * `limit`/`offset` or `per_page`/`page`.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const pool of client.loadBalancers.pools.bulkEdit(
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      bulkEdit(params, options) {
        const { account_id, ...body } = params;
        return this._client.getAPIList(`/accounts/${account_id}/load_balancers/pools`, PoolsSinglePage, {
          body,
          method: "patch",
          ...options
        });
      }
      /**
       * Apply changes to an existing pool, overwriting the supplied properties.
       *
       * @example
       * ```ts
       * const pool = await client.loadBalancers.pools.edit(
       *   '17b5962d775c646f3f9725cbc7a53df4',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      edit(poolId, params, options) {
        const { account_id, ...body } = params;
        return this._client.patch(`/accounts/${account_id}/load_balancers/pools/${poolId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetch a single configured pool.
       *
       * @example
       * ```ts
       * const pool = await client.loadBalancers.pools.get(
       *   '17b5962d775c646f3f9725cbc7a53df4',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(poolId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/load_balancers/pools/${poolId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    PoolsSinglePage = class extends SinglePage {
      static {
        __name(this, "PoolsSinglePage");
      }
    };
    Pools.PoolsSinglePage = PoolsSinglePage;
    Pools.Health = Health2;
    Pools.References = References2;
    Pools.ReferenceGetResponsesSinglePage = ReferenceGetResponsesSinglePage2;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/load-balancers/load-balancers.mjs
var LoadBalancers, LoadBalancersSinglePage;
var init_load_balancers = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/load-balancers/load-balancers.mjs"() {
    init_import_meta_url();
    init_resource();
    init_monitor_groups();
    init_monitor_groups();
    init_previews2();
    init_previews2();
    init_regions2();
    init_regions2();
    init_searches();
    init_searches();
    init_monitors();
    init_monitors();
    init_pools();
    init_pools();
    init_pagination();
    LoadBalancers = class extends APIResource {
      static {
        __name(this, "LoadBalancers");
      }
      constructor() {
        super(...arguments);
        this.monitors = new Monitors(this._client);
        this.monitorGroups = new MonitorGroups(this._client);
        this.pools = new Pools(this._client);
        this.previews = new Previews2(this._client);
        this.regions = new Regions2(this._client);
        this.searches = new Searches(this._client);
      }
      /**
       * Create a new load balancer.
       *
       * @example
       * ```ts
       * const loadBalancer = await client.loadBalancers.create({
       *   zone_id: '699d98642c564d2e855e9661899b7252',
       *   default_pools: [
       *     '17b5962d775c646f3f9725cbc7a53df4',
       *     '9290f38c5d07c2e2f4df57b1f61d4196',
       *     '00920f38ce07c2e2f4df50b1f61d4194',
       *   ],
       *   fallback_pool: 'fallback_pool',
       *   name: 'www.example.com',
       * });
       * ```
       */
      create(params, options) {
        const { zone_id, ...body } = params;
        return this._client.post(`/zones/${zone_id}/load_balancers`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Update a configured load balancer.
       *
       * @example
       * ```ts
       * const loadBalancer = await client.loadBalancers.update(
       *   '699d98642c564d2e855e9661899b7252',
       *   {
       *     zone_id: '699d98642c564d2e855e9661899b7252',
       *     default_pools: [
       *       '17b5962d775c646f3f9725cbc7a53df4',
       *       '9290f38c5d07c2e2f4df57b1f61d4196',
       *       '00920f38ce07c2e2f4df50b1f61d4194',
       *     ],
       *     fallback_pool: 'fallback_pool',
       *     name: 'www.example.com',
       *   },
       * );
       * ```
       */
      update(loadBalancerId, params, options) {
        const { zone_id, ...body } = params;
        return this._client.put(`/zones/${zone_id}/load_balancers/${loadBalancerId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List configured load balancers.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const loadBalancer of client.loadBalancers.list({
       *   zone_id: '699d98642c564d2e855e9661899b7252',
       * })) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { zone_id } = params;
        return this._client.getAPIList(`/zones/${zone_id}/load_balancers`, LoadBalancersSinglePage, options);
      }
      /**
       * Delete a configured load balancer.
       *
       * @example
       * ```ts
       * const loadBalancer = await client.loadBalancers.delete(
       *   '699d98642c564d2e855e9661899b7252',
       *   { zone_id: '699d98642c564d2e855e9661899b7252' },
       * );
       * ```
       */
      delete(loadBalancerId, params, options) {
        const { zone_id } = params;
        return this._client.delete(`/zones/${zone_id}/load_balancers/${loadBalancerId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Apply changes to an existing load balancer, overwriting the supplied properties.
       *
       * @example
       * ```ts
       * const loadBalancer = await client.loadBalancers.edit(
       *   '699d98642c564d2e855e9661899b7252',
       *   { zone_id: '699d98642c564d2e855e9661899b7252' },
       * );
       * ```
       */
      edit(loadBalancerId, params, options) {
        const { zone_id, ...body } = params;
        return this._client.patch(`/zones/${zone_id}/load_balancers/${loadBalancerId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetch a single configured load balancer.
       *
       * @example
       * ```ts
       * const loadBalancer = await client.loadBalancers.get(
       *   '699d98642c564d2e855e9661899b7252',
       *   { zone_id: '699d98642c564d2e855e9661899b7252' },
       * );
       * ```
       */
      get(loadBalancerId, params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/load_balancers/${loadBalancerId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    LoadBalancersSinglePage = class extends SinglePage {
      static {
        __name(this, "LoadBalancersSinglePage");
      }
    };
    LoadBalancers.LoadBalancersSinglePage = LoadBalancersSinglePage;
    LoadBalancers.Monitors = Monitors;
    LoadBalancers.MonitorsSinglePage = MonitorsSinglePage;
    LoadBalancers.MonitorGroups = MonitorGroups;
    LoadBalancers.MonitorGroupsSinglePage = MonitorGroupsSinglePage;
    LoadBalancers.Pools = Pools;
    LoadBalancers.PoolsSinglePage = PoolsSinglePage;
    LoadBalancers.Previews = Previews2;
    LoadBalancers.Regions = Regions2;
    LoadBalancers.Searches = Searches;
    LoadBalancers.SearchListResponsesV4PagePagination = SearchListResponsesV4PagePagination;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/logpush/edge.mjs
var Edge, InstantLogpushJobsSinglePage;
var init_edge = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/logpush/edge.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Edge = class extends APIResource {
      static {
        __name(this, "Edge");
      }
      /**
       * Creates a new Instant Logs job for a zone.
       *
       * @example
       * ```ts
       * const instantLogpushJob = await client.logpush.edge.create({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      create(params, options) {
        const { zone_id, ...body } = params;
        return this._client.post(`/zones/${zone_id}/logpush/edge/jobs`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Lists Instant Logs jobs for a zone.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const instantLogpushJob of client.logpush.edge.get(
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      get(params, options) {
        const { zone_id } = params;
        return this._client.getAPIList(`/zones/${zone_id}/logpush/edge/jobs`, InstantLogpushJobsSinglePage, options);
      }
    };
    InstantLogpushJobsSinglePage = class extends SinglePage {
      static {
        __name(this, "InstantLogpushJobsSinglePage");
      }
    };
    Edge.InstantLogpushJobsSinglePage = InstantLogpushJobsSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/logpush/jobs.mjs
var Jobs, LogpushJobsSinglePage;
var init_jobs = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/logpush/jobs.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    init_error4();
    init_pagination();
    Jobs = class extends APIResource {
      static {
        __name(this, "Jobs");
      }
      /**
       * Creates a new Logpush job for an account or zone.
       *
       * @example
       * ```ts
       * const logpushJob = await client.logpush.jobs.create({
       *   destination_conf: 's3://mybucket/logs?region=us-west-2',
       *   account_id: 'account_id',
       *   dataset: 'gateway_dns',
       *   filter:
       *     '{"where":{"and":[{"key":"ClientRequestPath","operator":"contains","value":"/static"},{"key":"ClientRequestHost","operator":"eq","value":"example.com"}]}}',
       *   max_upload_bytes: 5000000,
       *   max_upload_interval_seconds: 30,
       *   max_upload_records: 1000,
       *   name: 'example.com',
       *   output_options: {
       *     'CVE-2021-44228': false,
       *     batch_prefix: '',
       *     batch_suffix: '',
       *     field_delimiter: ',',
       *     field_names: ['Datetime', 'DstIP', 'SrcIP'],
       *     output_type: 'ndjson',
       *     record_delimiter: '',
       *     record_prefix: '{',
       *     record_suffix: '}\n',
       *     sample_rate: 1,
       *     timestamp_format: 'unixnano',
       *   },
       *   ownership_challenge: '00000000000000000000',
       * });
       * ```
       */
      create(params, options) {
        const { account_id, zone_id, ...body } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.post(`/${accountOrZone}/${accountOrZoneId}/logpush/jobs`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Updates a Logpush job.
       *
       * @example
       * ```ts
       * const logpushJob = await client.logpush.jobs.update(1, {
       *   account_id: 'account_id',
       *   destination_conf: 's3://mybucket/logs?region=us-west-2',
       *   filter:
       *     '{"where":{"and":[{"key":"ClientRequestPath","operator":"contains","value":"/static"},{"key":"ClientRequestHost","operator":"eq","value":"example.com"}]}}',
       *   max_upload_bytes: 5000000,
       *   max_upload_interval_seconds: 30,
       *   max_upload_records: 1000,
       *   output_options: {
       *     'CVE-2021-44228': false,
       *     batch_prefix: '',
       *     batch_suffix: '',
       *     field_delimiter: ',',
       *     field_names: ['Datetime', 'DstIP', 'SrcIP'],
       *     output_type: 'ndjson',
       *     record_delimiter: '',
       *     record_prefix: '{',
       *     record_suffix: '}\n',
       *     sample_rate: 1,
       *     timestamp_format: 'unixnano',
       *   },
       *   ownership_challenge: '00000000000000000000',
       * });
       * ```
       */
      update(jobId, params, options) {
        const { account_id, zone_id, ...body } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.put(`/${accountOrZone}/${accountOrZoneId}/logpush/jobs/${jobId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      list(params = {}, options) {
        if (isRequestOptions(params)) {
          return this.list({}, params);
        }
        const { account_id, zone_id } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.getAPIList(`/${accountOrZone}/${accountOrZoneId}/logpush/jobs`, LogpushJobsSinglePage, options);
      }
      delete(jobId, params = {}, options) {
        if (isRequestOptions(params)) {
          return this.delete(jobId, {}, params);
        }
        const { account_id, zone_id } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.delete(`/${accountOrZone}/${accountOrZoneId}/logpush/jobs/${jobId}`, options)._thenUnwrap((obj) => obj.result);
      }
      get(jobId, params = {}, options) {
        if (isRequestOptions(params)) {
          return this.get(jobId, {}, params);
        }
        const { account_id, zone_id } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.get(`/${accountOrZone}/${accountOrZoneId}/logpush/jobs/${jobId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    LogpushJobsSinglePage = class extends SinglePage {
      static {
        __name(this, "LogpushJobsSinglePage");
      }
    };
    Jobs.LogpushJobsSinglePage = LogpushJobsSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/logpush/ownership.mjs
var Ownership;
var init_ownership = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/logpush/ownership.mjs"() {
    init_import_meta_url();
    init_resource();
    init_error4();
    Ownership = class extends APIResource {
      static {
        __name(this, "Ownership");
      }
      /**
       * Gets a new ownership challenge sent to your destination.
       *
       * @example
       * ```ts
       * const ownership = await client.logpush.ownership.create({
       *   destination_conf: 's3://mybucket/logs?region=us-west-2',
       *   account_id: 'account_id',
       * });
       * ```
       */
      create(params, options) {
        const { account_id, zone_id, ...body } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.post(`/${accountOrZone}/${accountOrZoneId}/logpush/ownership`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Validates ownership challenge of the destination.
       *
       * @example
       * ```ts
       * const ownershipValidation =
       *   await client.logpush.ownership.validate({
       *     destination_conf: 's3://mybucket/logs?region=us-west-2',
       *     ownership_challenge: '00000000000000000000',
       *     account_id: 'account_id',
       *   });
       * ```
       */
      validate(params, options) {
        const { account_id, zone_id, ...body } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.post(`/${accountOrZone}/${accountOrZoneId}/logpush/ownership/validate`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/logpush/validate.mjs
var Validate;
var init_validate = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/logpush/validate.mjs"() {
    init_import_meta_url();
    init_resource();
    init_error4();
    Validate = class extends APIResource {
      static {
        __name(this, "Validate");
      }
      /**
       * Validates destination.
       *
       * @example
       * ```ts
       * const response = await client.logpush.validate.destination({
       *   destination_conf: 's3://mybucket/logs?region=us-west-2',
       *   account_id: 'account_id',
       * });
       * ```
       */
      destination(params, options) {
        const { account_id, zone_id, ...body } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.post(`/${accountOrZone}/${accountOrZoneId}/logpush/validate/destination`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Checks if there is an existing job with a destination.
       *
       * @example
       * ```ts
       * const response =
       *   await client.logpush.validate.destinationExists({
       *     destination_conf: 's3://mybucket/logs?region=us-west-2',
       *     account_id: 'account_id',
       *   });
       * ```
       */
      destinationExists(params, options) {
        const { account_id, zone_id, ...body } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.post(`/${accountOrZone}/${accountOrZoneId}/logpush/validate/destination/exists`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Validates logpull origin with logpull_options.
       *
       * @example
       * ```ts
       * const response = await client.logpush.validate.origin({
       *   logpull_options:
       *     'fields=RayID,ClientIP,EdgeStartTimestamp&timestamps=rfc3339',
       *   account_id: 'account_id',
       * });
       * ```
       */
      origin(params, options) {
        const { account_id, zone_id, ...body } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.post(`/${accountOrZone}/${accountOrZoneId}/logpush/validate/origin`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/logpush/datasets/fields.mjs
var Fields;
var init_fields = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/logpush/datasets/fields.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    init_error4();
    Fields = class extends APIResource {
      static {
        __name(this, "Fields");
      }
      get(datasetId, params = {}, options) {
        if (isRequestOptions(params)) {
          return this.get(datasetId, {}, params);
        }
        const { account_id, zone_id } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.get(`/${accountOrZone}/${accountOrZoneId}/logpush/datasets/${datasetId}/fields`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/logpush/datasets/jobs.mjs
var Jobs2;
var init_jobs2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/logpush/datasets/jobs.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    init_jobs();
    init_error4();
    Jobs2 = class extends APIResource {
      static {
        __name(this, "Jobs");
      }
      get(datasetId, params = {}, options) {
        if (isRequestOptions(params)) {
          return this.get(datasetId, {}, params);
        }
        const { account_id, zone_id } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.getAPIList(`/${accountOrZone}/${accountOrZoneId}/logpush/datasets/${datasetId}/jobs`, LogpushJobsSinglePage, options);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/logpush/datasets/datasets.mjs
var Datasets3;
var init_datasets3 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/logpush/datasets/datasets.mjs"() {
    init_import_meta_url();
    init_resource();
    init_fields();
    init_fields();
    init_jobs2();
    init_jobs2();
    Datasets3 = class extends APIResource {
      static {
        __name(this, "Datasets");
      }
      constructor() {
        super(...arguments);
        this.fields = new Fields(this._client);
        this.jobs = new Jobs2(this._client);
      }
    };
    Datasets3.Fields = Fields;
    Datasets3.Jobs = Jobs2;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/logpush/logpush.mjs
var Logpush;
var init_logpush = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/logpush/logpush.mjs"() {
    init_import_meta_url();
    init_resource();
    init_edge();
    init_edge();
    init_jobs();
    init_jobs();
    init_ownership();
    init_ownership();
    init_validate();
    init_validate();
    init_datasets3();
    init_datasets3();
    Logpush = class extends APIResource {
      static {
        __name(this, "Logpush");
      }
      constructor() {
        super(...arguments);
        this.datasets = new Datasets3(this._client);
        this.edge = new Edge(this._client);
        this.jobs = new Jobs(this._client);
        this.ownership = new Ownership(this._client);
        this.validate = new Validate(this._client);
      }
    };
    Logpush.Datasets = Datasets3;
    Logpush.Edge = Edge;
    Logpush.InstantLogpushJobsSinglePage = InstantLogpushJobsSinglePage;
    Logpush.Jobs = Jobs;
    Logpush.LogpushJobsSinglePage = LogpushJobsSinglePage;
    Logpush.Ownership = Ownership;
    Logpush.Validate = Validate;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/logs/rayid.mjs
var RayID;
var init_rayid = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/logs/rayid.mjs"() {
    init_import_meta_url();
    init_resource();
    RayID = class extends APIResource {
      static {
        __name(this, "RayID");
      }
      /**
       * The `/rayids` api route allows lookups by specific rayid. The rayids route will
       * return zero, one, or more records (ray ids are not unique).
       *
       * @example
       * ```ts
       * const RayID = await client.logs.RayID.get(
       *   '41ddf1740f67442d',
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(RayID2, params, options) {
        const { zone_id, ...query } = params;
        return this._client.get(`/zones/${zone_id}/logs/rayids/${RayID2}`, { query, ...options });
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/logs/control/retention.mjs
var Retention;
var init_retention = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/logs/control/retention.mjs"() {
    init_import_meta_url();
    init_resource();
    Retention = class extends APIResource {
      static {
        __name(this, "Retention");
      }
      /**
       * Updates log retention flag for Logpull API.
       *
       * @example
       * ```ts
       * const retention =
       *   await client.logs.control.retention.create({
       *     zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   });
       * ```
       */
      create(params, options) {
        const { zone_id, ...body } = params;
        return this._client.post(`/zones/${zone_id}/logs/control/retention/flag`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Gets log retention flag for Logpull API.
       *
       * @example
       * ```ts
       * const retention = await client.logs.control.retention.get({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      get(params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/logs/control/retention/flag`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/logs/control/cmb/config.mjs
var Config2;
var init_config3 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/logs/control/cmb/config.mjs"() {
    init_import_meta_url();
    init_resource();
    Config2 = class extends APIResource {
      static {
        __name(this, "Config");
      }
      /**
       * Updates CMB config.
       *
       * @example
       * ```ts
       * const cmbConfig =
       *   await client.logs.control.cmb.config.create({
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/logs/control/cmb/config`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Deletes CMB config.
       *
       * @example
       * ```ts
       * const config = await client.logs.control.cmb.config.delete({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      delete(params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/logs/control/cmb/config`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Gets CMB config.
       *
       * @example
       * ```ts
       * const cmbConfig = await client.logs.control.cmb.config.get({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      get(params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/logs/control/cmb/config`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/logs/control/cmb/cmb.mjs
var Cmb;
var init_cmb = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/logs/control/cmb/cmb.mjs"() {
    init_import_meta_url();
    init_resource();
    init_config3();
    init_config3();
    Cmb = class extends APIResource {
      static {
        __name(this, "Cmb");
      }
      constructor() {
        super(...arguments);
        this.config = new Config2(this._client);
      }
    };
    Cmb.Config = Config2;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/logs/control/control.mjs
var Control;
var init_control = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/logs/control/control.mjs"() {
    init_import_meta_url();
    init_resource();
    init_retention();
    init_retention();
    init_cmb();
    init_cmb();
    Control = class extends APIResource {
      static {
        __name(this, "Control");
      }
      constructor() {
        super(...arguments);
        this.retention = new Retention(this._client);
        this.cmb = new Cmb(this._client);
      }
    };
    Control.Retention = Retention;
    Control.Cmb = Cmb;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/logs/received/fields.mjs
var Fields2;
var init_fields2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/logs/received/fields.mjs"() {
    init_import_meta_url();
    init_resource();
    Fields2 = class extends APIResource {
      static {
        __name(this, "Fields");
      }
      /**
       * Lists all fields available. The response is json object with key-value pairs,
       * where keys are field names, and values are descriptions.
       *
       * @example
       * ```ts
       * const field = await client.logs.received.fields.get({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      get(params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/logs/received/fields`, options);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/logs/received/received.mjs
var Received;
var init_received = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/logs/received/received.mjs"() {
    init_import_meta_url();
    init_resource();
    init_fields2();
    init_fields2();
    Received = class extends APIResource {
      static {
        __name(this, "Received");
      }
      constructor() {
        super(...arguments);
        this.fields = new Fields2(this._client);
      }
      /**
       * The `/received` api route allows customers to retrieve their edge HTTP logs. The
       * basic access pattern is "give me all the logs for zone Z for minute M", where
       * the minute M refers to the time records were received at Cloudflare's central
       * data center. `start` is inclusive, and `end` is exclusive. Because of that, to
       * get all data, at minutely cadence, starting at 10AM, the proper values are:
       * `start=2018-05-20T10:00:00Z&end=2018-05-20T10:01:00Z`, then
       * `start=2018-05-20T10:01:00Z&end=2018-05-20T10:02:00Z` and so on; the overlap
       * will be handled properly.
       *
       * @example
       * ```ts
       * const received = await client.logs.received.get({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   end: '2018-05-20T10:01:00Z',
       * });
       * ```
       */
      get(params, options) {
        const { zone_id, ...query } = params;
        return this._client.get(`/zones/${zone_id}/logs/received`, { query, ...options });
      }
    };
    Received.Fields = Fields2;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/logs/logs.mjs
var Logs3;
var init_logs3 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/logs/logs.mjs"() {
    init_import_meta_url();
    init_resource();
    init_rayid();
    init_rayid();
    init_control();
    init_control();
    init_received();
    init_received();
    Logs3 = class extends APIResource {
      static {
        __name(this, "Logs");
      }
      constructor() {
        super(...arguments);
        this.control = new Control(this._client);
        this.RayID = new RayID(this._client);
        this.received = new Received(this._client);
      }
    };
    Logs3.Control = Control;
    Logs3.RayID = RayID;
    Logs3.Received = Received;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/mtls-certificates/associations.mjs
var Associations, CertificateAsssociationsSinglePage;
var init_associations = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/mtls-certificates/associations.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Associations = class extends APIResource {
      static {
        __name(this, "Associations");
      }
      /**
       * Lists all active associations between the certificate and Cloudflare services.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const certificateAsssociation of client.mtlsCertificates.associations.get(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      get(mtlsCertificateId, params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/mtls_certificates/${mtlsCertificateId}/associations`, CertificateAsssociationsSinglePage, options);
      }
    };
    CertificateAsssociationsSinglePage = class extends SinglePage {
      static {
        __name(this, "CertificateAsssociationsSinglePage");
      }
    };
    Associations.CertificateAsssociationsSinglePage = CertificateAsssociationsSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/mtls-certificates/mtls-certificates.mjs
var MTLSCertificates, MTLSCertificatesSinglePage;
var init_mtls_certificates = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/mtls-certificates/mtls-certificates.mjs"() {
    init_import_meta_url();
    init_resource();
    init_associations();
    init_associations();
    init_pagination();
    MTLSCertificates = class extends APIResource {
      static {
        __name(this, "MTLSCertificates");
      }
      constructor() {
        super(...arguments);
        this.associations = new Associations(this._client);
      }
      /**
       * Upload a certificate that you want to use with mTLS-enabled Cloudflare services.
       *
       * @example
       * ```ts
       * const mtlsCertificate =
       *   await client.mtlsCertificates.create({
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     ca: true,
       *     certificates:
       *       '-----BEGIN CERTIFICATE-----\nMIIDmDCCAoCgAwIBAgIUKTOAZNjcXVZRj4oQt0SHsl1c1vMwDQYJKoZIhvcNAQELBQAwUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgMDVNhbiBGcmFuY2lzY28xEzARBgNVBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4YW1wbGUgSW5jLjAgFw0yMjExMjIxNjU5NDdaGA8yMTIyMTAyOTE2NTk0N1owUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgMDVNhbiBGcmFuY2lzY28xEzARBgNVBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4YW1wbGUgSW5jLjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMRcORwgJFTdcG/2GKI+cFYiOBNDKjCZUXEOvXWY42BkH9wxiMT869CO+enA1w5pIrXow6kCM1sQspHHaVmJUlotEMJxyoLFfA/8Kt1EKFyobOjuZs2SwyVyJ2sStvQuUQEosULZCNGZEqoH5g6zhMPxaxm7ZLrrsDZ9maNGVqo7EWLWHrZ57Q/5MtTrbxQL+eXjUmJ9K3kS+3uEwMdqR6Z3BluU1ivanpPc1CN2GNhdO0/hSY4YkGEnuLsqJyDd3cIiB1MxuCBJ4ZaqOd2viV1WcP3oU3dxVPm4MWyfYIldMWB14FahScxLhWdRnM9YZ/i9IFcLypXsuz7DjrJPtPUCAwEAAaNmMGQwHQYDVR0OBBYEFP5JzLUawNF+c3AXsYTEWHh7z2czMB8GA1UdIwQYMBaAFP5JzLUawNF+c3AXsYTEWHh7z2czMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMBAf8ECDAGAQH/AgEBMA0GCSqGSIb3DQEBCwUAA4IBAQBc+Be7NDhpE09y7hLPZGRPl1cSKBw4RI0XIv6rlbSTFs5EebpTGjhx/whNxwEZhB9HZ7111Oa1YlT8xkI9DshB78mjAHCKBAJ76moK8tkG0aqdYpJ4ZcJTVBB7l98Rvgc7zfTii7WemTy72deBbSeiEtXavm4EF0mWjHhQ5Nxpnp00Bqn5g1x8CyTDypgmugnep+xG+iFzNmTdsz7WI9T/7kDMXqB7M/FPWBORyS98OJqNDswCLF8bIZYwUBEe+bRHFomoShMzaC3tvim7WCb16noDkSTMlfKO4pnvKhpcVdSgwcruATV7y+W+Lvmz2OT/Gui4JhqeoTewsxndhDDE\n-----END CERTIFICATE-----',
       *   });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/mtls_certificates`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Lists all mTLS certificates.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const mtlsCertificate of client.mtlsCertificates.list(
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/mtls_certificates`, MTLSCertificatesSinglePage, options);
      }
      /**
       * Deletes the mTLS certificate unless the certificate is in use by one or more
       * Cloudflare services.
       *
       * @example
       * ```ts
       * const mtlsCertificate =
       *   await client.mtlsCertificates.delete(
       *     '023e105f4ecef8ad9ca31a8372d0c353',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      delete(mtlsCertificateId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/mtls_certificates/${mtlsCertificateId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetches a single mTLS certificate.
       *
       * @example
       * ```ts
       * const mtlsCertificate = await client.mtlsCertificates.get(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(mtlsCertificateId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/mtls_certificates/${mtlsCertificateId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    MTLSCertificatesSinglePage = class extends SinglePage {
      static {
        __name(this, "MTLSCertificatesSinglePage");
      }
    };
    MTLSCertificates.MTLSCertificatesSinglePage = MTLSCertificatesSinglePage;
    MTLSCertificates.Associations = Associations;
    MTLSCertificates.CertificateAsssociationsSinglePage = CertificateAsssociationsSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/magic-cloud-networking/cloud-integrations.mjs
var CloudIntegrations, CloudIntegrationListResponsesSinglePage;
var init_cloud_integrations = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/magic-cloud-networking/cloud-integrations.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    CloudIntegrations = class extends APIResource {
      static {
        __name(this, "CloudIntegrations");
      }
      /**
       * Create a new Cloud Integration (Closed Beta).
       */
      create(params, options) {
        const { account_id, forwarded, ...body } = params;
        return this._client.post(`/accounts/${account_id}/magic/cloud/providers`, {
          body,
          ...options,
          headers: { ...forwarded != null ? { forwarded } : void 0, ...options?.headers }
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Update a Cloud Integration (Closed Beta).
       */
      update(providerId, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/magic/cloud/providers/${providerId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List Cloud Integrations (Closed Beta).
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/magic/cloud/providers`, CloudIntegrationListResponsesSinglePage, { query, ...options });
      }
      /**
       * Delete a Cloud Integration (Closed Beta).
       */
      delete(providerId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/magic/cloud/providers/${providerId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Run discovery for a Cloud Integration (Closed Beta).
       */
      discover(providerId, params, options) {
        const { account_id, v2: v22 } = params;
        return this._client.post(`/accounts/${account_id}/magic/cloud/providers/${providerId}/discover`, {
          query: { v2: v22 },
          ...options
        });
      }
      /**
       * Run discovery for all Cloud Integrations in an account (Closed Beta).
       */
      discoverAll(params, options) {
        const { account_id } = params;
        return this._client.post(`/accounts/${account_id}/magic/cloud/providers/discover`, options);
      }
      /**
       * Update a Cloud Integration (Closed Beta).
       */
      edit(providerId, params, options) {
        const { account_id, ...body } = params;
        return this._client.patch(`/accounts/${account_id}/magic/cloud/providers/${providerId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Read a Cloud Integration (Closed Beta).
       */
      get(providerId, params, options) {
        const { account_id, ...query } = params;
        return this._client.get(`/accounts/${account_id}/magic/cloud/providers/${providerId}`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get initial configuration to complete Cloud Integration setup (Closed Beta).
       */
      initialSetup(providerId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/magic/cloud/providers/${providerId}/initial_setup`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    CloudIntegrationListResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "CloudIntegrationListResponsesSinglePage");
      }
    };
    CloudIntegrations.CloudIntegrationListResponsesSinglePage = CloudIntegrationListResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/magic-cloud-networking/resources.mjs
var Resources, ResourceListResponsesV4PagePaginationArray;
var init_resources = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/magic-cloud-networking/resources.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Resources = class extends APIResource {
      static {
        __name(this, "Resources");
      }
      /**
       * List resources in the Resource Catalog (Closed Beta).
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/magic/cloud/resources`, ResourceListResponsesV4PagePaginationArray, { query, ...options });
      }
      /**
       * Export resources in the Resource Catalog as a JSON file (Closed Beta).
       */
      export(params, options) {
        const { account_id, ...query } = params;
        return this._client.get(`/accounts/${account_id}/magic/cloud/resources/export`, {
          query,
          ...options,
          headers: { Accept: "application/octet-stream", ...options?.headers },
          __binaryResponse: true
        });
      }
      /**
       * Read an resource from the Resource Catalog (Closed Beta).
       */
      get(resourceId, params, options) {
        const { account_id, ...query } = params;
        return this._client.get(`/accounts/${account_id}/magic/cloud/resources/${resourceId}`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Preview Rego query result against the latest resource catalog (Closed Beta).
       */
      policyPreview(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/magic/cloud/resources/policy-preview`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
    ResourceListResponsesV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "ResourceListResponsesV4PagePaginationArray");
      }
    };
    Resources.ResourceListResponsesV4PagePaginationArray = ResourceListResponsesV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/magic-cloud-networking/catalog-syncs/prebuilt-policies.mjs
var PrebuiltPolicies, PrebuiltPolicyListResponsesSinglePage;
var init_prebuilt_policies = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/magic-cloud-networking/catalog-syncs/prebuilt-policies.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    PrebuiltPolicies = class extends APIResource {
      static {
        __name(this, "PrebuiltPolicies");
      }
      /**
       * List prebuilt catalog sync policies (Closed Beta).
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/magic/cloud/catalog-syncs/prebuilt-policies`, PrebuiltPolicyListResponsesSinglePage, { query, ...options });
      }
    };
    PrebuiltPolicyListResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "PrebuiltPolicyListResponsesSinglePage");
      }
    };
    PrebuiltPolicies.PrebuiltPolicyListResponsesSinglePage = PrebuiltPolicyListResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/magic-cloud-networking/catalog-syncs/catalog-syncs.mjs
var CatalogSyncs, CatalogSyncListResponsesSinglePage;
var init_catalog_syncs = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/magic-cloud-networking/catalog-syncs/catalog-syncs.mjs"() {
    init_import_meta_url();
    init_resource();
    init_prebuilt_policies();
    init_prebuilt_policies();
    init_pagination();
    CatalogSyncs = class extends APIResource {
      static {
        __name(this, "CatalogSyncs");
      }
      constructor() {
        super(...arguments);
        this.prebuiltPolicies = new PrebuiltPolicies(this._client);
      }
      /**
       * Create a new Catalog Sync (Closed Beta).
       */
      create(params, options) {
        const { account_id, forwarded, ...body } = params;
        return this._client.post(`/accounts/${account_id}/magic/cloud/catalog-syncs`, {
          body,
          ...options,
          headers: { ...forwarded != null ? { forwarded } : void 0, ...options?.headers }
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Update a Catalog Sync (Closed Beta).
       */
      update(syncId, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/magic/cloud/catalog-syncs/${syncId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List Catalog Syncs (Closed Beta).
       */
      list(params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/magic/cloud/catalog-syncs`, CatalogSyncListResponsesSinglePage, options);
      }
      /**
       * Delete a Catalog Sync (Closed Beta).
       */
      delete(syncId, params, options) {
        const { account_id, delete_destination } = params;
        return this._client.delete(`/accounts/${account_id}/magic/cloud/catalog-syncs/${syncId}`, {
          query: { delete_destination },
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Update a Catalog Sync (Closed Beta).
       */
      edit(syncId, params, options) {
        const { account_id, ...body } = params;
        return this._client.patch(`/accounts/${account_id}/magic/cloud/catalog-syncs/${syncId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Read a Catalog Sync (Closed Beta).
       */
      get(syncId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/magic/cloud/catalog-syncs/${syncId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Refresh a Catalog Sync's destination by running the sync policy against latest
       * resource catalog (Closed Beta).
       */
      refresh(syncId, params, options) {
        const { account_id } = params;
        return this._client.post(`/accounts/${account_id}/magic/cloud/catalog-syncs/${syncId}/refresh`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    CatalogSyncListResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "CatalogSyncListResponsesSinglePage");
      }
    };
    CatalogSyncs.CatalogSyncListResponsesSinglePage = CatalogSyncListResponsesSinglePage;
    CatalogSyncs.PrebuiltPolicies = PrebuiltPolicies;
    CatalogSyncs.PrebuiltPolicyListResponsesSinglePage = PrebuiltPolicyListResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/magic-cloud-networking/on-ramps/address-spaces.mjs
var AddressSpaces;
var init_address_spaces = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/magic-cloud-networking/on-ramps/address-spaces.mjs"() {
    init_import_meta_url();
    init_resource();
    AddressSpaces = class extends APIResource {
      static {
        __name(this, "AddressSpaces");
      }
      /**
       * Update the Magic WAN Address Space (Closed Beta).
       */
      update(params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/magic/cloud/onramps/magic_wan_address_space`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Read the Magic WAN Address Space (Closed Beta).
       */
      list(params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/magic/cloud/onramps/magic_wan_address_space`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Update the Magic WAN Address Space (Closed Beta).
       */
      edit(params, options) {
        const { account_id, ...body } = params;
        return this._client.patch(`/accounts/${account_id}/magic/cloud/onramps/magic_wan_address_space`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/magic-cloud-networking/on-ramps/on-ramps.mjs
var OnRamps, OnRampListResponsesSinglePage;
var init_on_ramps = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/magic-cloud-networking/on-ramps/on-ramps.mjs"() {
    init_import_meta_url();
    init_resource();
    init_address_spaces();
    init_address_spaces();
    init_pagination();
    OnRamps = class extends APIResource {
      static {
        __name(this, "OnRamps");
      }
      constructor() {
        super(...arguments);
        this.addressSpaces = new AddressSpaces(this._client);
      }
      /**
       * Create a new On-ramp (Closed Beta).
       */
      create(params, options) {
        const { account_id, forwarded, ...body } = params;
        return this._client.post(`/accounts/${account_id}/magic/cloud/onramps`, {
          body,
          ...options,
          headers: { ...forwarded != null ? { forwarded } : void 0, ...options?.headers }
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Update an On-ramp (Closed Beta).
       */
      update(onrampId, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/magic/cloud/onramps/${onrampId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List On-ramps (Closed Beta).
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/magic/cloud/onramps`, OnRampListResponsesSinglePage, { query, ...options });
      }
      /**
       * Delete an On-ramp (Closed Beta).
       */
      delete(onrampId, params, options) {
        const { account_id, destroy, force } = params;
        return this._client.delete(`/accounts/${account_id}/magic/cloud/onramps/${onrampId}`, {
          query: { destroy, force },
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Apply an On-ramp (Closed Beta).
       */
      apply(onrampId, params, options) {
        const { account_id } = params;
        return this._client.post(`/accounts/${account_id}/magic/cloud/onramps/${onrampId}/apply`, options);
      }
      /**
       * Update an On-ramp (Closed Beta).
       */
      edit(onrampId, params, options) {
        const { account_id, ...body } = params;
        return this._client.patch(`/accounts/${account_id}/magic/cloud/onramps/${onrampId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Export an On-ramp to terraform ready file(s) (Closed Beta).
       */
      export(onrampId, params, options) {
        const { account_id } = params;
        return this._client.post(`/accounts/${account_id}/magic/cloud/onramps/${onrampId}/export`, {
          ...options,
          headers: { Accept: "application/zip", ...options?.headers },
          __binaryResponse: true
        });
      }
      /**
       * Read an On-ramp (Closed Beta).
       */
      get(onrampId, params, options) {
        const { account_id, ...query } = params;
        return this._client.get(`/accounts/${account_id}/magic/cloud/onramps/${onrampId}`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Plan an On-ramp (Closed Beta).
       */
      plan(onrampId, params, options) {
        const { account_id } = params;
        return this._client.post(`/accounts/${account_id}/magic/cloud/onramps/${onrampId}/plan`, options);
      }
    };
    OnRampListResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "OnRampListResponsesSinglePage");
      }
    };
    OnRamps.OnRampListResponsesSinglePage = OnRampListResponsesSinglePage;
    OnRamps.AddressSpaces = AddressSpaces;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/magic-cloud-networking/magic-cloud-networking.mjs
var MagicCloudNetworking;
var init_magic_cloud_networking = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/magic-cloud-networking/magic-cloud-networking.mjs"() {
    init_import_meta_url();
    init_resource();
    init_cloud_integrations();
    init_cloud_integrations();
    init_resources();
    init_resources();
    init_catalog_syncs();
    init_catalog_syncs();
    init_on_ramps();
    init_on_ramps();
    MagicCloudNetworking = class extends APIResource {
      static {
        __name(this, "MagicCloudNetworking");
      }
      constructor() {
        super(...arguments);
        this.catalogSyncs = new CatalogSyncs(this._client);
        this.onRamps = new OnRamps(this._client);
        this.cloudIntegrations = new CloudIntegrations(this._client);
        this.resources = new Resources(this._client);
      }
    };
    MagicCloudNetworking.CatalogSyncs = CatalogSyncs;
    MagicCloudNetworking.CatalogSyncListResponsesSinglePage = CatalogSyncListResponsesSinglePage;
    MagicCloudNetworking.OnRamps = OnRamps;
    MagicCloudNetworking.OnRampListResponsesSinglePage = OnRampListResponsesSinglePage;
    MagicCloudNetworking.CloudIntegrations = CloudIntegrations;
    MagicCloudNetworking.CloudIntegrationListResponsesSinglePage = CloudIntegrationListResponsesSinglePage;
    MagicCloudNetworking.Resources = Resources;
    MagicCloudNetworking.ResourceListResponsesV4PagePaginationArray = ResourceListResponsesV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/magic-network-monitoring/configs/full.mjs
var Full;
var init_full = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/magic-network-monitoring/configs/full.mjs"() {
    init_import_meta_url();
    init_resource();
    Full = class extends APIResource {
      static {
        __name(this, "Full");
      }
      /**
       * Lists default sampling, router IPs, warp devices, and rules for account.
       *
       * @example
       * ```ts
       * const configuration =
       *   await client.magicNetworkMonitoring.configs.full.get({
       *     account_id: '6f91088a406011ed95aed352566e8d4c',
       *   });
       * ```
       */
      get(params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/mnm/config/full`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/magic-network-monitoring/configs/configs.mjs
var Configs3;
var init_configs3 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/magic-network-monitoring/configs/configs.mjs"() {
    init_import_meta_url();
    init_resource();
    init_full();
    init_full();
    Configs3 = class extends APIResource {
      static {
        __name(this, "Configs");
      }
      constructor() {
        super(...arguments);
        this.full = new Full(this._client);
      }
      /**
       * Create a new network monitoring configuration.
       *
       * @example
       * ```ts
       * const configuration =
       *   await client.magicNetworkMonitoring.configs.create({
       *     account_id: '6f91088a406011ed95aed352566e8d4c',
       *     default_sampling: 1,
       *     name: "cloudflare user's account",
       *   });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/mnm/config`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Update an existing network monitoring configuration, requires the entire
       * configuration to be updated at once.
       *
       * @example
       * ```ts
       * const configuration =
       *   await client.magicNetworkMonitoring.configs.update({
       *     account_id: '6f91088a406011ed95aed352566e8d4c',
       *     default_sampling: 1,
       *     name: "cloudflare user's account",
       *   });
       * ```
       */
      update(params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/mnm/config`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Delete an existing network monitoring configuration.
       *
       * @example
       * ```ts
       * const configuration =
       *   await client.magicNetworkMonitoring.configs.delete({
       *     account_id: '6f91088a406011ed95aed352566e8d4c',
       *   });
       * ```
       */
      delete(params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/mnm/config`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Update fields in an existing network monitoring configuration.
       *
       * @example
       * ```ts
       * const configuration =
       *   await client.magicNetworkMonitoring.configs.edit({
       *     account_id: '6f91088a406011ed95aed352566e8d4c',
       *   });
       * ```
       */
      edit(params, options) {
        const { account_id, ...body } = params;
        return this._client.patch(`/accounts/${account_id}/mnm/config`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Lists default sampling, router IPs and warp devices for account.
       *
       * @example
       * ```ts
       * const configuration =
       *   await client.magicNetworkMonitoring.configs.get({
       *     account_id: '6f91088a406011ed95aed352566e8d4c',
       *   });
       * ```
       */
      get(params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/mnm/config`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    Configs3.Full = Full;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/magic-network-monitoring/rules/advertisements.mjs
var Advertisements;
var init_advertisements = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/magic-network-monitoring/rules/advertisements.mjs"() {
    init_import_meta_url();
    init_resource();
    Advertisements = class extends APIResource {
      static {
        __name(this, "Advertisements");
      }
      /**
       * Update advertisement for rule.
       *
       * @example
       * ```ts
       * const advertisement =
       *   await client.magicNetworkMonitoring.rules.advertisements.edit(
       *     '2890e6fa406311ed9b5a23f70f6fb8cf',
       *     {
       *       account_id: '6f91088a406011ed95aed352566e8d4c',
       *       body: {},
       *     },
       *   );
       * ```
       */
      edit(ruleId, params, options) {
        const { account_id, body } = params;
        return this._client.patch(`/accounts/${account_id}/mnm/rules/${ruleId}/advertisement`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/magic-network-monitoring/rules/rules.mjs
var Rules5, MagicNetworkMonitoringRulesSinglePage;
var init_rules6 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/magic-network-monitoring/rules/rules.mjs"() {
    init_import_meta_url();
    init_resource();
    init_advertisements();
    init_advertisements();
    init_pagination();
    Rules5 = class extends APIResource {
      static {
        __name(this, "Rules");
      }
      constructor() {
        super(...arguments);
        this.advertisements = new Advertisements(this._client);
      }
      /**
       * Create network monitoring rules for account. Currently only supports creating a
       * single rule per API request.
       *
       * @example
       * ```ts
       * const magicNetworkMonitoringRule =
       *   await client.magicNetworkMonitoring.rules.create({
       *     account_id: '6f91088a406011ed95aed352566e8d4c',
       *     duration: '1m',
       *     name: 'my_rule_1',
       *   });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/mnm/rules`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Update network monitoring rules for account.
       *
       * @example
       * ```ts
       * const magicNetworkMonitoringRule =
       *   await client.magicNetworkMonitoring.rules.update({
       *     account_id: '6f91088a406011ed95aed352566e8d4c',
       *     duration: '1m',
       *     name: 'my_rule_1',
       *   });
       * ```
       */
      update(params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/mnm/rules`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Lists network monitoring rules for account.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const magicNetworkMonitoringRule of client.magicNetworkMonitoring.rules.list(
       *   { account_id: '6f91088a406011ed95aed352566e8d4c' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/mnm/rules`, MagicNetworkMonitoringRulesSinglePage, options);
      }
      /**
       * Delete a network monitoring rule for account.
       *
       * @example
       * ```ts
       * const magicNetworkMonitoringRule =
       *   await client.magicNetworkMonitoring.rules.delete(
       *     '2890e6fa406311ed9b5a23f70f6fb8cf',
       *     { account_id: '6f91088a406011ed95aed352566e8d4c' },
       *   );
       * ```
       */
      delete(ruleId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/mnm/rules/${ruleId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Update a network monitoring rule for account.
       *
       * @example
       * ```ts
       * const magicNetworkMonitoringRule =
       *   await client.magicNetworkMonitoring.rules.edit(
       *     '2890e6fa406311ed9b5a23f70f6fb8cf',
       *     { account_id: '6f91088a406011ed95aed352566e8d4c' },
       *   );
       * ```
       */
      edit(ruleId, params, options) {
        const { account_id, ...body } = params;
        return this._client.patch(`/accounts/${account_id}/mnm/rules/${ruleId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List a single network monitoring rule for account.
       *
       * @example
       * ```ts
       * const magicNetworkMonitoringRule =
       *   await client.magicNetworkMonitoring.rules.get(
       *     '2890e6fa406311ed9b5a23f70f6fb8cf',
       *     { account_id: '6f91088a406011ed95aed352566e8d4c' },
       *   );
       * ```
       */
      get(ruleId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/mnm/rules/${ruleId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    MagicNetworkMonitoringRulesSinglePage = class extends SinglePage {
      static {
        __name(this, "MagicNetworkMonitoringRulesSinglePage");
      }
    };
    Rules5.MagicNetworkMonitoringRulesSinglePage = MagicNetworkMonitoringRulesSinglePage;
    Rules5.Advertisements = Advertisements;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/magic-network-monitoring/vpc-flows/tokens.mjs
var Tokens2;
var init_tokens2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/magic-network-monitoring/vpc-flows/tokens.mjs"() {
    init_import_meta_url();
    init_resource();
    Tokens2 = class extends APIResource {
      static {
        __name(this, "Tokens");
      }
      /**
       * Generate authentication token for VPC flow logs export.
       *
       * @example
       * ```ts
       * const token =
       *   await client.magicNetworkMonitoring.vpcFlows.tokens.create(
       *     { account_id: '6f91088a406011ed95aed352566e8d4c' },
       *   );
       * ```
       */
      create(params, options) {
        const { account_id } = params;
        return this._client.post(`/accounts/${account_id}/mnm/vpc-flows/token`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/magic-network-monitoring/vpc-flows/vpc-flows.mjs
var VPCFlows;
var init_vpc_flows = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/magic-network-monitoring/vpc-flows/vpc-flows.mjs"() {
    init_import_meta_url();
    init_resource();
    init_tokens2();
    init_tokens2();
    VPCFlows = class extends APIResource {
      static {
        __name(this, "VPCFlows");
      }
      constructor() {
        super(...arguments);
        this.tokens = new Tokens2(this._client);
      }
    };
    VPCFlows.Tokens = Tokens2;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/magic-network-monitoring/magic-network-monitoring.mjs
var MagicNetworkMonitoring;
var init_magic_network_monitoring = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/magic-network-monitoring/magic-network-monitoring.mjs"() {
    init_import_meta_url();
    init_resource();
    init_configs3();
    init_configs3();
    init_rules6();
    init_rules6();
    init_vpc_flows();
    init_vpc_flows();
    MagicNetworkMonitoring = class extends APIResource {
      static {
        __name(this, "MagicNetworkMonitoring");
      }
      constructor() {
        super(...arguments);
        this.vpcFlows = new VPCFlows(this._client);
        this.configs = new Configs3(this._client);
        this.rules = new Rules5(this._client);
      }
    };
    MagicNetworkMonitoring.VPCFlows = VPCFlows;
    MagicNetworkMonitoring.Configs = Configs3;
    MagicNetworkMonitoring.Rules = Rules5;
    MagicNetworkMonitoring.MagicNetworkMonitoringRulesSinglePage = MagicNetworkMonitoringRulesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/magic-transit/apps.mjs
var Apps, AppListResponsesSinglePage;
var init_apps = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/magic-transit/apps.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Apps = class extends APIResource {
      static {
        __name(this, "Apps");
      }
      /**
       * Creates a new App for an account
       *
       * @example
       * ```ts
       * const app = await client.magicTransit.apps.create({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   name: 'Cloudflare Dashboard',
       *   type: 'Development',
       * });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/magic/apps`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Updates an Account App
       *
       * @example
       * ```ts
       * const app = await client.magicTransit.apps.update(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      update(accountAppId, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/magic/apps/${accountAppId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Lists Apps associated with an account.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const appListResponse of client.magicTransit.apps.list(
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/magic/apps`, AppListResponsesSinglePage, options);
      }
      /**
       * Deletes specific Account App.
       *
       * @example
       * ```ts
       * const app = await client.magicTransit.apps.delete(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      delete(accountAppId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/magic/apps/${accountAppId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Updates an Account App
       *
       * @example
       * ```ts
       * const response = await client.magicTransit.apps.edit(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      edit(accountAppId, params, options) {
        const { account_id, ...body } = params;
        return this._client.patch(`/accounts/${account_id}/magic/apps/${accountAppId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
    AppListResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "AppListResponsesSinglePage");
      }
    };
    Apps.AppListResponsesSinglePage = AppListResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/magic-transit/cf-interconnects.mjs
var CfInterconnects;
var init_cf_interconnects = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/magic-transit/cf-interconnects.mjs"() {
    init_import_meta_url();
    init_resource();
    CfInterconnects = class extends APIResource {
      static {
        __name(this, "CfInterconnects");
      }
      /**
       * Updates a specific interconnect associated with an account. Use
       * `?validate_only=true` as an optional query parameter to only run validation
       * without persisting changes.
       *
       * @example
       * ```ts
       * const cfInterconnect =
       *   await client.magicTransit.cfInterconnects.update(
       *     '023e105f4ecef8ad9ca31a8372d0c353',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      update(cfInterconnectId, params, options) {
        const { account_id, "x-magic-new-hc-target": xMagicNewHcTarget, ...body } = params;
        return this._client.put(`/accounts/${account_id}/magic/cf_interconnects/${cfInterconnectId}`, {
          body,
          ...options,
          headers: {
            ...xMagicNewHcTarget?.toString() != null ? { "x-magic-new-hc-target": xMagicNewHcTarget?.toString() } : void 0,
            ...options?.headers
          }
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Lists interconnects associated with an account.
       *
       * @example
       * ```ts
       * const cfInterconnects =
       *   await client.magicTransit.cfInterconnects.list({
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   });
       * ```
       */
      list(params, options) {
        const { account_id, "x-magic-new-hc-target": xMagicNewHcTarget } = params;
        return this._client.get(`/accounts/${account_id}/magic/cf_interconnects`, {
          ...options,
          headers: {
            ...xMagicNewHcTarget?.toString() != null ? { "x-magic-new-hc-target": xMagicNewHcTarget?.toString() } : void 0,
            ...options?.headers
          }
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Updates multiple interconnects associated with an account. Use
       * `?validate_only=true` as an optional query parameter to only run validation
       * without persisting changes.
       *
       * @example
       * ```ts
       * const response =
       *   await client.magicTransit.cfInterconnects.bulkUpdate({
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     body: {},
       *   });
       * ```
       */
      bulkUpdate(params, options) {
        const { account_id, body, "x-magic-new-hc-target": xMagicNewHcTarget } = params;
        return this._client.put(`/accounts/${account_id}/magic/cf_interconnects`, {
          body,
          ...options,
          headers: {
            ...xMagicNewHcTarget?.toString() != null ? { "x-magic-new-hc-target": xMagicNewHcTarget?.toString() } : void 0,
            ...options?.headers
          }
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Lists details for a specific interconnect.
       *
       * @example
       * ```ts
       * const cfInterconnect =
       *   await client.magicTransit.cfInterconnects.get(
       *     '023e105f4ecef8ad9ca31a8372d0c353',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      get(cfInterconnectId, params, options) {
        const { account_id, "x-magic-new-hc-target": xMagicNewHcTarget } = params;
        return this._client.get(`/accounts/${account_id}/magic/cf_interconnects/${cfInterconnectId}`, {
          ...options,
          headers: {
            ...xMagicNewHcTarget?.toString() != null ? { "x-magic-new-hc-target": xMagicNewHcTarget?.toString() } : void 0,
            ...options?.headers
          }
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/magic-transit/gre-tunnels.mjs
var GRETunnels;
var init_gre_tunnels = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/magic-transit/gre-tunnels.mjs"() {
    init_import_meta_url();
    init_resource();
    GRETunnels = class extends APIResource {
      static {
        __name(this, "GRETunnels");
      }
      /**
       * Creates a new GRE tunnel. Use `?validate_only=true` as an optional query
       * parameter to only run validation without persisting changes.
       *
       * @example
       * ```ts
       * const greTunnel =
       *   await client.magicTransit.greTunnels.create({
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     cloudflare_gre_endpoint: '203.0.113.1',
       *     customer_gre_endpoint: '203.0.113.1',
       *     interface_address: '192.0.2.0/31',
       *     name: 'GRE_1',
       *   });
       * ```
       */
      create(params, options) {
        const { account_id, "x-magic-new-hc-target": xMagicNewHcTarget, ...body } = params;
        return this._client.post(`/accounts/${account_id}/magic/gre_tunnels`, {
          body,
          ...options,
          headers: {
            ...xMagicNewHcTarget?.toString() != null ? { "x-magic-new-hc-target": xMagicNewHcTarget?.toString() } : void 0,
            ...options?.headers
          }
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Updates a specific GRE tunnel. Use `?validate_only=true` as an optional query
       * parameter to only run validation without persisting changes.
       *
       * @example
       * ```ts
       * const greTunnel =
       *   await client.magicTransit.greTunnels.update(
       *     '023e105f4ecef8ad9ca31a8372d0c353',
       *     {
       *       account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *       cloudflare_gre_endpoint: '203.0.113.1',
       *       customer_gre_endpoint: '203.0.113.1',
       *       interface_address: '192.0.2.0/31',
       *       name: 'GRE_1',
       *     },
       *   );
       * ```
       */
      update(greTunnelId, params, options) {
        const { account_id, "x-magic-new-hc-target": xMagicNewHcTarget, ...body } = params;
        return this._client.put(`/accounts/${account_id}/magic/gre_tunnels/${greTunnelId}`, {
          body,
          ...options,
          headers: {
            ...xMagicNewHcTarget?.toString() != null ? { "x-magic-new-hc-target": xMagicNewHcTarget?.toString() } : void 0,
            ...options?.headers
          }
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Lists GRE tunnels associated with an account.
       *
       * @example
       * ```ts
       * const greTunnels =
       *   await client.magicTransit.greTunnels.list({
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   });
       * ```
       */
      list(params, options) {
        const { account_id, "x-magic-new-hc-target": xMagicNewHcTarget } = params;
        return this._client.get(`/accounts/${account_id}/magic/gre_tunnels`, {
          ...options,
          headers: {
            ...xMagicNewHcTarget?.toString() != null ? { "x-magic-new-hc-target": xMagicNewHcTarget?.toString() } : void 0,
            ...options?.headers
          }
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Disables and removes a specific static GRE tunnel. Use `?validate_only=true` as
       * an optional query parameter to only run validation without persisting changes.
       *
       * @example
       * ```ts
       * const greTunnel =
       *   await client.magicTransit.greTunnels.delete(
       *     '023e105f4ecef8ad9ca31a8372d0c353',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      delete(greTunnelId, params, options) {
        const { account_id, "x-magic-new-hc-target": xMagicNewHcTarget } = params;
        return this._client.delete(`/accounts/${account_id}/magic/gre_tunnels/${greTunnelId}`, {
          ...options,
          headers: {
            ...xMagicNewHcTarget?.toString() != null ? { "x-magic-new-hc-target": xMagicNewHcTarget?.toString() } : void 0,
            ...options?.headers
          }
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Updates multiple GRE tunnels. Use `?validate_only=true` as an optional query
       * parameter to only run validation without persisting changes.
       *
       * @example
       * ```ts
       * const response =
       *   await client.magicTransit.greTunnels.bulkUpdate({
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     body: {},
       *   });
       * ```
       */
      bulkUpdate(params, options) {
        const { account_id, body, "x-magic-new-hc-target": xMagicNewHcTarget } = params;
        return this._client.put(`/accounts/${account_id}/magic/gre_tunnels`, {
          body,
          ...options,
          headers: {
            ...xMagicNewHcTarget?.toString() != null ? { "x-magic-new-hc-target": xMagicNewHcTarget?.toString() } : void 0,
            ...options?.headers
          }
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Lists informtion for a specific GRE tunnel.
       *
       * @example
       * ```ts
       * const greTunnel = await client.magicTransit.greTunnels.get(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(greTunnelId, params, options) {
        const { account_id, "x-magic-new-hc-target": xMagicNewHcTarget } = params;
        return this._client.get(`/accounts/${account_id}/magic/gre_tunnels/${greTunnelId}`, {
          ...options,
          headers: {
            ...xMagicNewHcTarget?.toString() != null ? { "x-magic-new-hc-target": xMagicNewHcTarget?.toString() } : void 0,
            ...options?.headers
          }
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/magic-transit/ipsec-tunnels.mjs
var IPSECTunnels;
var init_ipsec_tunnels = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/magic-transit/ipsec-tunnels.mjs"() {
    init_import_meta_url();
    init_resource();
    IPSECTunnels = class extends APIResource {
      static {
        __name(this, "IPSECTunnels");
      }
      /**
       * Creates a new IPsec tunnel associated with an account. Use `?validate_only=true`
       * as an optional query parameter to only run validation without persisting
       * changes.
       *
       * @example
       * ```ts
       * const ipsecTunnel =
       *   await client.magicTransit.ipsecTunnels.create({
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     cloudflare_endpoint: '203.0.113.1',
       *     interface_address: '192.0.2.0/31',
       *     name: 'IPsec_1',
       *   });
       * ```
       */
      create(params, options) {
        const { account_id, "x-magic-new-hc-target": xMagicNewHcTarget, ...body } = params;
        return this._client.post(`/accounts/${account_id}/magic/ipsec_tunnels`, {
          body,
          ...options,
          headers: {
            ...xMagicNewHcTarget?.toString() != null ? { "x-magic-new-hc-target": xMagicNewHcTarget?.toString() } : void 0,
            ...options?.headers
          }
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Updates a specific IPsec tunnel associated with an account. Use
       * `?validate_only=true` as an optional query parameter to only run validation
       * without persisting changes.
       *
       * @example
       * ```ts
       * const ipsecTunnel =
       *   await client.magicTransit.ipsecTunnels.update(
       *     '023e105f4ecef8ad9ca31a8372d0c353',
       *     {
       *       account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *       cloudflare_endpoint: '203.0.113.1',
       *       interface_address: '192.0.2.0/31',
       *       name: 'IPsec_1',
       *     },
       *   );
       * ```
       */
      update(ipsecTunnelId, params, options) {
        const { account_id, "x-magic-new-hc-target": xMagicNewHcTarget, ...body } = params;
        return this._client.put(`/accounts/${account_id}/magic/ipsec_tunnels/${ipsecTunnelId}`, {
          body,
          ...options,
          headers: {
            ...xMagicNewHcTarget?.toString() != null ? { "x-magic-new-hc-target": xMagicNewHcTarget?.toString() } : void 0,
            ...options?.headers
          }
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Lists IPsec tunnels associated with an account.
       *
       * @example
       * ```ts
       * const ipsecTunnels =
       *   await client.magicTransit.ipsecTunnels.list({
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   });
       * ```
       */
      list(params, options) {
        const { account_id, "x-magic-new-hc-target": xMagicNewHcTarget } = params;
        return this._client.get(`/accounts/${account_id}/magic/ipsec_tunnels`, {
          ...options,
          headers: {
            ...xMagicNewHcTarget?.toString() != null ? { "x-magic-new-hc-target": xMagicNewHcTarget?.toString() } : void 0,
            ...options?.headers
          }
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Disables and removes a specific static IPsec Tunnel associated with an account.
       * Use `?validate_only=true` as an optional query parameter to only run validation
       * without persisting changes.
       *
       * @example
       * ```ts
       * const ipsecTunnel =
       *   await client.magicTransit.ipsecTunnels.delete(
       *     '023e105f4ecef8ad9ca31a8372d0c353',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      delete(ipsecTunnelId, params, options) {
        const { account_id, "x-magic-new-hc-target": xMagicNewHcTarget } = params;
        return this._client.delete(`/accounts/${account_id}/magic/ipsec_tunnels/${ipsecTunnelId}`, {
          ...options,
          headers: {
            ...xMagicNewHcTarget?.toString() != null ? { "x-magic-new-hc-target": xMagicNewHcTarget?.toString() } : void 0,
            ...options?.headers
          }
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Update multiple IPsec tunnels associated with an account. Use
       * `?validate_only=true` as an optional query parameter to only run validation
       * without persisting changes.
       *
       * @example
       * ```ts
       * const response =
       *   await client.magicTransit.ipsecTunnels.bulkUpdate({
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     body: {},
       *   });
       * ```
       */
      bulkUpdate(params, options) {
        const { account_id, body, "x-magic-new-hc-target": xMagicNewHcTarget } = params;
        return this._client.put(`/accounts/${account_id}/magic/ipsec_tunnels`, {
          body,
          ...options,
          headers: {
            ...xMagicNewHcTarget?.toString() != null ? { "x-magic-new-hc-target": xMagicNewHcTarget?.toString() } : void 0,
            ...options?.headers
          }
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Lists details for a specific IPsec tunnel.
       *
       * @example
       * ```ts
       * const ipsecTunnel =
       *   await client.magicTransit.ipsecTunnels.get(
       *     '023e105f4ecef8ad9ca31a8372d0c353',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      get(ipsecTunnelId, params, options) {
        const { account_id, "x-magic-new-hc-target": xMagicNewHcTarget } = params;
        return this._client.get(`/accounts/${account_id}/magic/ipsec_tunnels/${ipsecTunnelId}`, {
          ...options,
          headers: {
            ...xMagicNewHcTarget?.toString() != null ? { "x-magic-new-hc-target": xMagicNewHcTarget?.toString() } : void 0,
            ...options?.headers
          }
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Generates a Pre Shared Key for a specific IPsec tunnel used in the IKE session.
       * Use `?validate_only=true` as an optional query parameter to only run validation
       * without persisting changes. After a PSK is generated, the PSK is immediately
       * persisted to Cloudflare's edge and cannot be retrieved later. Note the PSK in a
       * safe place.
       *
       * @example
       * ```ts
       * const response =
       *   await client.magicTransit.ipsecTunnels.pskGenerate(
       *     '023e105f4ecef8ad9ca31a8372d0c353',
       *     {
       *       account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *       body: {},
       *     },
       *   );
       * ```
       */
      pskGenerate(ipsecTunnelId, params, options) {
        const { account_id, body } = params;
        return this._client.post(`/accounts/${account_id}/magic/ipsec_tunnels/${ipsecTunnelId}/psk_generate`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/magic-transit/routes.mjs
var Routes;
var init_routes = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/magic-transit/routes.mjs"() {
    init_import_meta_url();
    init_resource();
    Routes = class extends APIResource {
      static {
        __name(this, "Routes");
      }
      /**
       * Creates a new Magic static route. Use `?validate_only=true` as an optional query
       * parameter to run validation only without persisting changes.
       *
       * @example
       * ```ts
       * const route = await client.magicTransit.routes.create({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   nexthop: '203.0.113.1',
       *   prefix: '192.0.2.0/24',
       *   priority: 0,
       * });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/magic/routes`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Update a specific Magic static route. Use `?validate_only=true` as an optional
       * query parameter to run validation only without persisting changes.
       *
       * @example
       * ```ts
       * const route = await client.magicTransit.routes.update(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   {
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     nexthop: '203.0.113.1',
       *     prefix: '192.0.2.0/24',
       *     priority: 0,
       *   },
       * );
       * ```
       */
      update(routeId, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/magic/routes/${routeId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List all Magic static routes.
       *
       * @example
       * ```ts
       * const routes = await client.magicTransit.routes.list({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      list(params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/magic/routes`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Disable and remove a specific Magic static route.
       *
       * @example
       * ```ts
       * const route = await client.magicTransit.routes.delete(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      delete(routeId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/magic/routes/${routeId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Update multiple Magic static routes. Use `?validate_only=true` as an optional
       * query parameter to run validation only without persisting changes. Only fields
       * for a route that need to be changed need be provided.
       *
       * @example
       * ```ts
       * const response =
       *   await client.magicTransit.routes.bulkUpdate({
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     routes: [
       *       {
       *         id: '023e105f4ecef8ad9ca31a8372d0c353',
       *         nexthop: '203.0.113.1',
       *         prefix: '192.0.2.0/24',
       *         priority: 0,
       *       },
       *     ],
       *   });
       * ```
       */
      bulkUpdate(params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/magic/routes`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Delete multiple Magic static routes.
       *
       * @example
       * ```ts
       * const response = await client.magicTransit.routes.empty({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      empty(params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/magic/routes`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get a specific Magic static route.
       *
       * @example
       * ```ts
       * const route = await client.magicTransit.routes.get(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(routeId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/magic/routes/${routeId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/magic-transit/connectors/events/latest.mjs
var Latest;
var init_latest = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/magic-transit/connectors/events/latest.mjs"() {
    init_import_meta_url();
    init_resource();
    Latest = class extends APIResource {
      static {
        __name(this, "Latest");
      }
      /**
       * Get latest Events
       *
       * @example
       * ```ts
       * const latests =
       *   await client.magicTransit.connectors.events.latest.list(
       *     'connector_id',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      list(connectorId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/magic/connectors/${connectorId}/telemetry/events/latest`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/magic-transit/connectors/events/events.mjs
var Events;
var init_events2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/magic-transit/connectors/events/events.mjs"() {
    init_import_meta_url();
    init_resource();
    init_latest();
    init_latest();
    Events = class extends APIResource {
      static {
        __name(this, "Events");
      }
      constructor() {
        super(...arguments);
        this.latest = new Latest(this._client);
      }
      /**
       * List Events
       *
       * @example
       * ```ts
       * const events =
       *   await client.magicTransit.connectors.events.list(
       *     'connector_id',
       *     {
       *       account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *       from: 0,
       *       to: 0,
       *     },
       *   );
       * ```
       */
      list(connectorId, params, options) {
        const { account_id, ...query } = params;
        return this._client.get(`/accounts/${account_id}/magic/connectors/${connectorId}/telemetry/events`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get Event
       *
       * @example
       * ```ts
       * const event =
       *   await client.magicTransit.connectors.events.get(
       *     'connector_id',
       *     0,
       *     0,
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      get(connectorId, eventT, eventN, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/magic/connectors/${connectorId}/telemetry/events/${eventT}.${eventN}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    Events.Latest = Latest;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/magic-transit/connectors/snapshots/latest.mjs
var Latest2;
var init_latest2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/magic-transit/connectors/snapshots/latest.mjs"() {
    init_import_meta_url();
    init_resource();
    Latest2 = class extends APIResource {
      static {
        __name(this, "Latest");
      }
      /**
       * Get latest Snapshots
       *
       * @example
       * ```ts
       * const latests =
       *   await client.magicTransit.connectors.snapshots.latest.list(
       *     'connector_id',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      list(connectorId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/magic/connectors/${connectorId}/telemetry/snapshots/latest`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/magic-transit/connectors/snapshots/snapshots.mjs
var Snapshots2;
var init_snapshots2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/magic-transit/connectors/snapshots/snapshots.mjs"() {
    init_import_meta_url();
    init_resource();
    init_latest2();
    init_latest2();
    Snapshots2 = class extends APIResource {
      static {
        __name(this, "Snapshots");
      }
      constructor() {
        super(...arguments);
        this.latest = new Latest2(this._client);
      }
      /**
       * List Snapshots
       *
       * @example
       * ```ts
       * const snapshots =
       *   await client.magicTransit.connectors.snapshots.list(
       *     'connector_id',
       *     {
       *       account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *       from: 0,
       *       to: 0,
       *     },
       *   );
       * ```
       */
      list(connectorId, params, options) {
        const { account_id, ...query } = params;
        return this._client.get(`/accounts/${account_id}/magic/connectors/${connectorId}/telemetry/snapshots`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get Snapshot
       *
       * @example
       * ```ts
       * const snapshot =
       *   await client.magicTransit.connectors.snapshots.get(
       *     'connector_id',
       *     0,
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      get(connectorId, snapshotT, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/magic/connectors/${connectorId}/telemetry/snapshots/${snapshotT}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    Snapshots2.Latest = Latest2;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/magic-transit/connectors/connectors.mjs
var Connectors, ConnectorListResponsesSinglePage;
var init_connectors = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/magic-transit/connectors/connectors.mjs"() {
    init_import_meta_url();
    init_resource();
    init_events2();
    init_events2();
    init_snapshots2();
    init_snapshots2();
    init_pagination();
    Connectors = class extends APIResource {
      static {
        __name(this, "Connectors");
      }
      constructor() {
        super(...arguments);
        this.events = new Events(this._client);
        this.snapshots = new Snapshots2(this._client);
      }
      /**
       * Add a connector to your account
       *
       * @example
       * ```ts
       * const connector =
       *   await client.magicTransit.connectors.create({
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     device: {},
       *   });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/magic/connectors`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Replace Connector
       *
       * @example
       * ```ts
       * const connector =
       *   await client.magicTransit.connectors.update(
       *     'connector_id',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      update(connectorId, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/magic/connectors/${connectorId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List Connectors
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const connectorListResponse of client.magicTransit.connectors.list(
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/magic/connectors`, ConnectorListResponsesSinglePage, options);
      }
      /**
       * Remove a connector from your account
       *
       * @example
       * ```ts
       * const connector =
       *   await client.magicTransit.connectors.delete(
       *     'connector_id',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      delete(connectorId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/magic/connectors/${connectorId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Edit Connector to update specific properties
       *
       * @example
       * ```ts
       * const response = await client.magicTransit.connectors.edit(
       *   'connector_id',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      edit(connectorId, params, options) {
        const { account_id, ...body } = params;
        return this._client.patch(`/accounts/${account_id}/magic/connectors/${connectorId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetch Connector
       *
       * @example
       * ```ts
       * const connector = await client.magicTransit.connectors.get(
       *   'connector_id',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(connectorId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/magic/connectors/${connectorId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    ConnectorListResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "ConnectorListResponsesSinglePage");
      }
    };
    Connectors.ConnectorListResponsesSinglePage = ConnectorListResponsesSinglePage;
    Connectors.Events = Events;
    Connectors.Snapshots = Snapshots2;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/magic-transit/pcaps/download.mjs
var Download;
var init_download = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/magic-transit/pcaps/download.mjs"() {
    init_import_meta_url();
    init_resource();
    Download = class extends APIResource {
      static {
        __name(this, "Download");
      }
      /**
       * Download PCAP information into a file. Response is a binary PCAP file.
       *
       * @example
       * ```ts
       * const download =
       *   await client.magicTransit.pcaps.download.get(
       *     '023e105f4ecef8ad9ca31a8372d0c353',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       *
       * const content = await download.blob();
       * console.log(content);
       * ```
       */
      get(pcapId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/pcaps/${pcapId}/download`, {
          ...options,
          headers: { Accept: "application/vnd.tcpdump.pcap", ...options?.headers },
          __binaryResponse: true
        });
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/magic-transit/pcaps/ownership.mjs
var OwnershipResource, OwnershipsSinglePage;
var init_ownership2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/magic-transit/pcaps/ownership.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    OwnershipResource = class extends APIResource {
      static {
        __name(this, "OwnershipResource");
      }
      /**
       * Adds an AWS or GCP bucket to use with full packet captures.
       *
       * @example
       * ```ts
       * const ownership =
       *   await client.magicTransit.pcaps.ownership.create({
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     destination_conf: 's3://pcaps-bucket?region=us-east-1',
       *   });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/pcaps/ownership`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Deletes buckets added to the packet captures API.
       *
       * @example
       * ```ts
       * await client.magicTransit.pcaps.ownership.delete(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      delete(ownershipId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/pcaps/ownership/${ownershipId}`, {
          ...options,
          headers: { Accept: "*/*", ...options?.headers }
        });
      }
      /**
       * List all buckets configured for use with PCAPs API.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const ownership of client.magicTransit.pcaps.ownership.get(
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      get(params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/pcaps/ownership`, OwnershipsSinglePage, options);
      }
      /**
       * Validates buckets added to the packet captures API.
       *
       * @example
       * ```ts
       * const ownership =
       *   await client.magicTransit.pcaps.ownership.validate({
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     destination_conf: 's3://pcaps-bucket?region=us-east-1',
       *     ownership_challenge:
       *       'ownership-challenge-9883874ecac311ec8475433579a6bf5f.txt',
       *   });
       * ```
       */
      validate(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/pcaps/ownership/validate`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
    OwnershipsSinglePage = class extends SinglePage {
      static {
        __name(this, "OwnershipsSinglePage");
      }
    };
    OwnershipResource.OwnershipsSinglePage = OwnershipsSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/magic-transit/pcaps/pcaps.mjs
var PCAPs, PCAPListResponsesSinglePage;
var init_pcaps = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/magic-transit/pcaps/pcaps.mjs"() {
    init_import_meta_url();
    init_resource();
    init_download();
    init_download();
    init_ownership2();
    init_ownership2();
    init_pagination();
    PCAPs = class extends APIResource {
      static {
        __name(this, "PCAPs");
      }
      constructor() {
        super(...arguments);
        this.ownership = new OwnershipResource(this._client);
        this.download = new Download(this._client);
      }
      /**
       * Create new PCAP request for account.
       *
       * @example
       * ```ts
       * const pcap = await client.magicTransit.pcaps.create({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   packet_limit: 10000,
       *   system: 'magic-transit',
       *   time_limit: 300,
       *   type: 'simple',
       * });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/pcaps`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Lists all packet capture requests for an account.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const pcapListResponse of client.magicTransit.pcaps.list(
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/pcaps`, PCAPListResponsesSinglePage, options);
      }
      /**
       * Get information for a PCAP request by id.
       *
       * @example
       * ```ts
       * const pcap = await client.magicTransit.pcaps.get(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(pcapId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/pcaps/${pcapId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Stop full PCAP.
       *
       * @example
       * ```ts
       * await client.magicTransit.pcaps.stop(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      stop(pcapId, params, options) {
        const { account_id } = params;
        return this._client.put(`/accounts/${account_id}/pcaps/${pcapId}/stop`, {
          ...options,
          headers: { Accept: "*/*", ...options?.headers }
        });
      }
    };
    PCAPListResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "PCAPListResponsesSinglePage");
      }
    };
    PCAPs.PCAPListResponsesSinglePage = PCAPListResponsesSinglePage;
    PCAPs.OwnershipResource = OwnershipResource;
    PCAPs.OwnershipsSinglePage = OwnershipsSinglePage;
    PCAPs.Download = Download;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/magic-transit/sites/acls.mjs
var ACLs2, ACLsSinglePage2;
var init_acls2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/magic-transit/sites/acls.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    ACLs2 = class extends APIResource {
      static {
        __name(this, "ACLs");
      }
      /**
       * Creates a new Site ACL.
       *
       * @example
       * ```ts
       * const acl = await client.magicTransit.sites.acls.create(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   {
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     lan_1: { lan_id: 'lan_id' },
       *     lan_2: { lan_id: 'lan_id' },
       *     name: 'PIN Pad - Cash Register',
       *   },
       * );
       * ```
       */
      create(siteId, params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/magic/sites/${siteId}/acls`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Update a specific Site ACL.
       *
       * @example
       * ```ts
       * const acl = await client.magicTransit.sites.acls.update(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      update(siteId, aclId, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/magic/sites/${siteId}/acls/${aclId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Lists Site ACLs associated with an account.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const acl of client.magicTransit.sites.acls.list(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(siteId, params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/magic/sites/${siteId}/acls`, ACLsSinglePage2, options);
      }
      /**
       * Remove a specific Site ACL.
       *
       * @example
       * ```ts
       * const acl = await client.magicTransit.sites.acls.delete(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      delete(siteId, aclId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/magic/sites/${siteId}/acls/${aclId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Patch a specific Site ACL.
       *
       * @example
       * ```ts
       * const acl = await client.magicTransit.sites.acls.edit(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      edit(siteId, aclId, params, options) {
        const { account_id, ...body } = params;
        return this._client.patch(`/accounts/${account_id}/magic/sites/${siteId}/acls/${aclId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get a specific Site ACL.
       *
       * @example
       * ```ts
       * const acl = await client.magicTransit.sites.acls.get(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(siteId, aclId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/magic/sites/${siteId}/acls/${aclId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    ACLsSinglePage2 = class extends SinglePage {
      static {
        __name(this, "ACLsSinglePage");
      }
    };
    ACLs2.ACLsSinglePage = ACLsSinglePage2;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/magic-transit/sites/lans.mjs
var LANs, LANsSinglePage;
var init_lans = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/magic-transit/sites/lans.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    LANs = class extends APIResource {
      static {
        __name(this, "LANs");
      }
      /**
       * Creates a new Site LAN. If the site is in high availability mode,
       * static_addressing is required along with secondary and virtual address.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const lan of client.magicTransit.sites.lans.create(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   {
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     physport: 1,
       *   },
       * )) {
       *   // ...
       * }
       * ```
       */
      create(siteId, params, options) {
        const { account_id, ...body } = params;
        return this._client.getAPIList(`/accounts/${account_id}/magic/sites/${siteId}/lans`, LANsSinglePage, {
          body,
          method: "post",
          ...options
        });
      }
      /**
       * Update a specific Site LAN.
       *
       * @example
       * ```ts
       * const lan = await client.magicTransit.sites.lans.update(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      update(siteId, lanId, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/magic/sites/${siteId}/lans/${lanId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Lists Site LANs associated with an account.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const lan of client.magicTransit.sites.lans.list(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(siteId, params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/magic/sites/${siteId}/lans`, LANsSinglePage, options);
      }
      /**
       * Remove a specific Site LAN.
       *
       * @example
       * ```ts
       * const lan = await client.magicTransit.sites.lans.delete(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      delete(siteId, lanId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/magic/sites/${siteId}/lans/${lanId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Patch a specific Site LAN.
       *
       * @example
       * ```ts
       * const lan = await client.magicTransit.sites.lans.edit(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      edit(siteId, lanId, params, options) {
        const { account_id, ...body } = params;
        return this._client.patch(`/accounts/${account_id}/magic/sites/${siteId}/lans/${lanId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get a specific Site LAN.
       *
       * @example
       * ```ts
       * const lan = await client.magicTransit.sites.lans.get(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(siteId, lanId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/magic/sites/${siteId}/lans/${lanId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    LANsSinglePage = class extends SinglePage {
      static {
        __name(this, "LANsSinglePage");
      }
    };
    LANs.LANsSinglePage = LANsSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/magic-transit/sites/wans.mjs
var WANs, WANsSinglePage;
var init_wans = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/magic-transit/sites/wans.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    WANs = class extends APIResource {
      static {
        __name(this, "WANs");
      }
      /**
       * Creates a new Site WAN.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const wan of client.magicTransit.sites.wans.create(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   {
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     physport: 1,
       *   },
       * )) {
       *   // ...
       * }
       * ```
       */
      create(siteId, params, options) {
        const { account_id, ...body } = params;
        return this._client.getAPIList(`/accounts/${account_id}/magic/sites/${siteId}/wans`, WANsSinglePage, {
          body,
          method: "post",
          ...options
        });
      }
      /**
       * Update a specific Site WAN.
       *
       * @example
       * ```ts
       * const wan = await client.magicTransit.sites.wans.update(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      update(siteId, wanId, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/magic/sites/${siteId}/wans/${wanId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Lists Site WANs associated with an account.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const wan of client.magicTransit.sites.wans.list(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(siteId, params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/magic/sites/${siteId}/wans`, WANsSinglePage, options);
      }
      /**
       * Remove a specific Site WAN.
       *
       * @example
       * ```ts
       * const wan = await client.magicTransit.sites.wans.delete(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      delete(siteId, wanId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/magic/sites/${siteId}/wans/${wanId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Patch a specific Site WAN.
       *
       * @example
       * ```ts
       * const wan = await client.magicTransit.sites.wans.edit(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      edit(siteId, wanId, params, options) {
        const { account_id, ...body } = params;
        return this._client.patch(`/accounts/${account_id}/magic/sites/${siteId}/wans/${wanId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get a specific Site WAN.
       *
       * @example
       * ```ts
       * const wan = await client.magicTransit.sites.wans.get(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(siteId, wanId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/magic/sites/${siteId}/wans/${wanId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    WANsSinglePage = class extends SinglePage {
      static {
        __name(this, "WANsSinglePage");
      }
    };
    WANs.WANsSinglePage = WANsSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/magic-transit/sites/sites.mjs
var Sites, SitesSinglePage;
var init_sites = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/magic-transit/sites/sites.mjs"() {
    init_import_meta_url();
    init_resource();
    init_acls2();
    init_acls2();
    init_lans();
    init_lans();
    init_wans();
    init_wans();
    init_pagination();
    Sites = class extends APIResource {
      static {
        __name(this, "Sites");
      }
      constructor() {
        super(...arguments);
        this.acls = new ACLs2(this._client);
        this.lans = new LANs(this._client);
        this.wans = new WANs(this._client);
      }
      /**
       * Creates a new Site
       *
       * @example
       * ```ts
       * const site = await client.magicTransit.sites.create({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   name: 'site_1',
       * });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/magic/sites`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Update a specific Site.
       *
       * @example
       * ```ts
       * const site = await client.magicTransit.sites.update(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      update(siteId, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/magic/sites/${siteId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Lists Sites associated with an account. Use connectorid query param to return
       * sites where connectorid matches either site.ConnectorID or
       * site.SecondaryConnectorID.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const site of client.magicTransit.sites.list({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * })) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/magic/sites`, SitesSinglePage, {
          query,
          ...options
        });
      }
      /**
       * Remove a specific Site.
       *
       * @example
       * ```ts
       * const site = await client.magicTransit.sites.delete(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      delete(siteId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/magic/sites/${siteId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Patch a specific Site.
       *
       * @example
       * ```ts
       * const site = await client.magicTransit.sites.edit(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      edit(siteId, params, options) {
        const { account_id, ...body } = params;
        return this._client.patch(`/accounts/${account_id}/magic/sites/${siteId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get a specific Site.
       *
       * @example
       * ```ts
       * const site = await client.magicTransit.sites.get(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(siteId, params, options) {
        const { account_id, "x-magic-new-hc-target": xMagicNewHcTarget } = params;
        return this._client.get(`/accounts/${account_id}/magic/sites/${siteId}`, {
          ...options,
          headers: {
            ...xMagicNewHcTarget?.toString() != null ? { "x-magic-new-hc-target": xMagicNewHcTarget?.toString() } : void 0,
            ...options?.headers
          }
        })._thenUnwrap((obj) => obj.result);
      }
    };
    SitesSinglePage = class extends SinglePage {
      static {
        __name(this, "SitesSinglePage");
      }
    };
    Sites.SitesSinglePage = SitesSinglePage;
    Sites.ACLs = ACLs2;
    Sites.ACLsSinglePage = ACLsSinglePage2;
    Sites.LANs = LANs;
    Sites.LANsSinglePage = LANsSinglePage;
    Sites.WANs = WANs;
    Sites.WANsSinglePage = WANsSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/magic-transit/magic-transit.mjs
var MagicTransit;
var init_magic_transit = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/magic-transit/magic-transit.mjs"() {
    init_import_meta_url();
    init_resource();
    init_apps();
    init_apps();
    init_cf_interconnects();
    init_cf_interconnects();
    init_gre_tunnels();
    init_gre_tunnels();
    init_ipsec_tunnels();
    init_ipsec_tunnels();
    init_routes();
    init_routes();
    init_connectors();
    init_connectors();
    init_pcaps();
    init_pcaps();
    init_sites();
    init_sites();
    MagicTransit = class extends APIResource {
      static {
        __name(this, "MagicTransit");
      }
      constructor() {
        super(...arguments);
        this.apps = new Apps(this._client);
        this.cfInterconnects = new CfInterconnects(this._client);
        this.greTunnels = new GRETunnels(this._client);
        this.ipsecTunnels = new IPSECTunnels(this._client);
        this.routes = new Routes(this._client);
        this.sites = new Sites(this._client);
        this.connectors = new Connectors(this._client);
        this.pcaps = new PCAPs(this._client);
      }
    };
    MagicTransit.Apps = Apps;
    MagicTransit.AppListResponsesSinglePage = AppListResponsesSinglePage;
    MagicTransit.CfInterconnects = CfInterconnects;
    MagicTransit.GRETunnels = GRETunnels;
    MagicTransit.IPSECTunnels = IPSECTunnels;
    MagicTransit.Routes = Routes;
    MagicTransit.Sites = Sites;
    MagicTransit.SitesSinglePage = SitesSinglePage;
    MagicTransit.Connectors = Connectors;
    MagicTransit.ConnectorListResponsesSinglePage = ConnectorListResponsesSinglePage;
    MagicTransit.PCAPs = PCAPs;
    MagicTransit.PCAPListResponsesSinglePage = PCAPListResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/managed-transforms.mjs
var ManagedTransforms;
var init_managed_transforms = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/managed-transforms.mjs"() {
    init_import_meta_url();
    init_resource();
    ManagedTransforms = class extends APIResource {
      static {
        __name(this, "ManagedTransforms");
      }
      /**
       * Fetches a list of all Managed Transforms.
       */
      list(params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/managed_headers`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Disables all Managed Transforms.
       */
      delete(params, options) {
        const { zone_id } = params;
        return this._client.delete(`/zones/${zone_id}/managed_headers`, {
          ...options,
          headers: { Accept: "*/*", ...options?.headers }
        });
      }
      /**
       * Updates the status of one or more Managed Transforms.
       */
      edit(params, options) {
        const { zone_id, ...body } = params;
        return this._client.patch(`/zones/${zone_id}/managed_headers`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/memberships.mjs
var Memberships, MembershipsV4PagePaginationArray;
var init_memberships = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/memberships.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    init_pagination();
    Memberships = class extends APIResource {
      static {
        __name(this, "Memberships");
      }
      /**
       * Accept or reject this account invitation.
       *
       * @example
       * ```ts
       * const membership = await client.memberships.update(
       *   '4536bcfad5faccb111b47003c79917fa',
       *   { status: 'accepted' },
       * );
       * ```
       */
      update(membershipId, body, options) {
        return this._client.put(`/memberships/${membershipId}`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      list(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.list({}, query);
        }
        return this._client.getAPIList("/memberships", MembershipsV4PagePaginationArray, { query, ...options });
      }
      /**
       * Remove the associated member from an account.
       *
       * @example
       * ```ts
       * const membership = await client.memberships.delete(
       *   '4536bcfad5faccb111b47003c79917fa',
       * );
       * ```
       */
      delete(membershipId, options) {
        return this._client.delete(`/memberships/${membershipId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get a specific membership.
       *
       * @example
       * ```ts
       * const membership = await client.memberships.get(
       *   '4536bcfad5faccb111b47003c79917fa',
       * );
       * ```
       */
      get(membershipId, options) {
        return this._client.get(`/memberships/${membershipId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    MembershipsV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "MembershipsV4PagePaginationArray");
      }
    };
    Memberships.MembershipsV4PagePaginationArray = MembershipsV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/network-interconnects/cnis.mjs
var CNIs;
var init_cnis = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/network-interconnects/cnis.mjs"() {
    init_import_meta_url();
    init_resource();
    CNIs = class extends APIResource {
      static {
        __name(this, "CNIs");
      }
      /**
       * Create a new CNI object
       *
       * @example
       * ```ts
       * const cni = await client.networkInterconnects.cnis.create({
       *   account_id: 'account_id',
       *   account: 'account',
       *   interconnect: 'interconnect',
       *   magic: {
       *     conduit_name: 'conduit_name',
       *     description: 'description',
       *     mtu: 0,
       *   },
       * });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/cni/cnis`, { body, ...options });
      }
      /**
       * Modify stored information about a CNI object
       *
       * @example
       * ```ts
       * const cni = await client.networkInterconnects.cnis.update(
       *   '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
       *   {
       *     account_id: 'account_id',
       *     id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
       *     account: 'account',
       *     cust_ip: '192.168.3.4/31',
       *     interconnect: 'interconnect',
       *     magic: {
       *       conduit_name: 'conduit_name',
       *       description: 'description',
       *       mtu: 0,
       *     },
       *     p2p_ip: '192.168.3.4/31',
       *   },
       * );
       * ```
       */
      update(cni, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/cni/cnis/${cni}`, { body, ...options });
      }
      /**
       * List existing CNI objects
       *
       * @example
       * ```ts
       * const cnis = await client.networkInterconnects.cnis.list({
       *   account_id: 'account_id',
       * });
       * ```
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.get(`/accounts/${account_id}/cni/cnis`, { query, ...options });
      }
      /**
       * Delete a specified CNI object
       *
       * @example
       * ```ts
       * await client.networkInterconnects.cnis.delete(
       *   '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
       *   { account_id: 'account_id' },
       * );
       * ```
       */
      delete(cni, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/cni/cnis/${cni}`, {
          ...options,
          headers: { Accept: "*/*", ...options?.headers }
        });
      }
      /**
       * Get information about a CNI object
       *
       * @example
       * ```ts
       * const cni = await client.networkInterconnects.cnis.get(
       *   '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
       *   { account_id: 'account_id' },
       * );
       * ```
       */
      get(cni, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/cni/cnis/${cni}`, options);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/network-interconnects/interconnects.mjs
var Interconnects;
var init_interconnects = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/network-interconnects/interconnects.mjs"() {
    init_import_meta_url();
    init_resource();
    Interconnects = class extends APIResource {
      static {
        __name(this, "Interconnects");
      }
      /**
       * Create a new interconnect
       *
       * @example
       * ```ts
       * const interconnect =
       *   await client.networkInterconnects.interconnects.create({
       *     account_id: 'account_id',
       *     account: 'account',
       *     slot_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
       *     type: 'type',
       *   });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/cni/interconnects`, { body, ...options });
      }
      /**
       * List existing interconnects
       *
       * @example
       * ```ts
       * const interconnects =
       *   await client.networkInterconnects.interconnects.list({
       *     account_id: 'account_id',
       *   });
       * ```
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.get(`/accounts/${account_id}/cni/interconnects`, { query, ...options });
      }
      /**
       * Delete an interconnect object
       *
       * @example
       * ```ts
       * await client.networkInterconnects.interconnects.delete(
       *   'icon',
       *   { account_id: 'account_id' },
       * );
       * ```
       */
      delete(icon, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/cni/interconnects/${icon}`, {
          ...options,
          headers: { Accept: "*/*", ...options?.headers }
        });
      }
      /**
       * Get information about an interconnect object
       *
       * @example
       * ```ts
       * const interconnect =
       *   await client.networkInterconnects.interconnects.get(
       *     'icon',
       *     { account_id: 'account_id' },
       *   );
       * ```
       */
      get(icon, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/cni/interconnects/${icon}`, options);
      }
      /**
       * Generate the Letter of Authorization (LOA) for a given interconnect
       *
       * @example
       * ```ts
       * await client.networkInterconnects.interconnects.loa(
       *   'icon',
       *   { account_id: 'account_id' },
       * );
       * ```
       */
      loa(icon, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/cni/interconnects/${icon}/loa`, {
          ...options,
          headers: { Accept: "*/*", ...options?.headers }
        });
      }
      /**
       * Get the current status of an interconnect object
       *
       * @example
       * ```ts
       * const response =
       *   await client.networkInterconnects.interconnects.status(
       *     'icon',
       *     { account_id: 'account_id' },
       *   );
       * ```
       */
      status(icon, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/cni/interconnects/${icon}/status`, options);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/network-interconnects/settings.mjs
var Settings6;
var init_settings6 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/network-interconnects/settings.mjs"() {
    init_import_meta_url();
    init_resource();
    Settings6 = class extends APIResource {
      static {
        __name(this, "Settings");
      }
      /**
       * Update the current settings for the active account
       *
       * @example
       * ```ts
       * const setting =
       *   await client.networkInterconnects.settings.update({
       *     account_id: 'account_id',
       *   });
       * ```
       */
      update(params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/cni/settings`, { body, ...options });
      }
      /**
       * Get the current settings for the active account
       *
       * @example
       * ```ts
       * const setting =
       *   await client.networkInterconnects.settings.get({
       *     account_id: 'account_id',
       *   });
       * ```
       */
      get(params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/cni/settings`, options);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/network-interconnects/slots.mjs
var Slots;
var init_slots = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/network-interconnects/slots.mjs"() {
    init_import_meta_url();
    init_resource();
    Slots = class extends APIResource {
      static {
        __name(this, "Slots");
      }
      /**
       * Retrieve a list of all slots matching the specified parameters
       *
       * @example
       * ```ts
       * const slots = await client.networkInterconnects.slots.list({
       *   account_id: 'account_id',
       * });
       * ```
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.get(`/accounts/${account_id}/cni/slots`, { query, ...options });
      }
      /**
       * Get information about the specified slot
       *
       * @example
       * ```ts
       * const slot = await client.networkInterconnects.slots.get(
       *   '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
       *   { account_id: 'account_id' },
       * );
       * ```
       */
      get(slot, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/cni/slots/${slot}`, options);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/network-interconnects/network-interconnects.mjs
var NetworkInterconnects;
var init_network_interconnects = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/network-interconnects/network-interconnects.mjs"() {
    init_import_meta_url();
    init_resource();
    init_cnis();
    init_cnis();
    init_interconnects();
    init_interconnects();
    init_settings6();
    init_settings6();
    init_slots();
    init_slots();
    NetworkInterconnects = class extends APIResource {
      static {
        __name(this, "NetworkInterconnects");
      }
      constructor() {
        super(...arguments);
        this.cnis = new CNIs(this._client);
        this.interconnects = new Interconnects(this._client);
        this.settings = new Settings6(this._client);
        this.slots = new Slots(this._client);
      }
    };
    NetworkInterconnects.CNIs = CNIs;
    NetworkInterconnects.Interconnects = Interconnects;
    NetworkInterconnects.Settings = Settings6;
    NetworkInterconnects.Slots = Slots;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/origin-ca-certificates.mjs
var OriginCACertificates, OriginCACertificatesV4PagePaginationArray;
var init_origin_ca_certificates = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/origin-ca-certificates.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    OriginCACertificates = class extends APIResource {
      static {
        __name(this, "OriginCACertificates");
      }
      /**
       * Create an Origin CA certificate. You can use an Origin CA Key as your User
       * Service Key or an API token when calling this endpoint ([see above](#requests)).
       *
       * @example
       * ```ts
       * const originCACertificate =
       *   await client.originCACertificates.create();
       * ```
       */
      create(body, options) {
        return this._client.post("/certificates", { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List all existing Origin CA certificates for a given zone. You can use an Origin
       * CA Key as your User Service Key or an API token when calling this endpoint
       * ([see above](#requests)).
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const originCACertificate of client.originCACertificates.list(
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(query, options) {
        return this._client.getAPIList("/certificates", OriginCACertificatesV4PagePaginationArray, {
          query,
          ...options
        });
      }
      /**
       * Revoke an existing Origin CA certificate by its serial number. You can use an
       * Origin CA Key as your User Service Key or an API token when calling this
       * endpoint ([see above](#requests)).
       *
       * @example
       * ```ts
       * const originCACertificate =
       *   await client.originCACertificates.delete(
       *     '023e105f4ecef8ad9ca31a8372d0c353',
       *   );
       * ```
       */
      delete(certificateId, options) {
        return this._client.delete(`/certificates/${certificateId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get an existing Origin CA certificate by its serial number. You can use an
       * Origin CA Key as your User Service Key or an API token when calling this
       * endpoint ([see above](#requests)).
       *
       * @example
       * ```ts
       * const originCACertificate =
       *   await client.originCACertificates.get(
       *     '023e105f4ecef8ad9ca31a8372d0c353',
       *   );
       * ```
       */
      get(certificateId, options) {
        return this._client.get(`/certificates/${certificateId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    OriginCACertificatesV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "OriginCACertificatesV4PagePaginationArray");
      }
    };
    OriginCACertificates.OriginCACertificatesV4PagePaginationArray = OriginCACertificatesV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/origin-post-quantum-encryption.mjs
var OriginPostQuantumEncryption;
var init_origin_post_quantum_encryption = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/origin-post-quantum-encryption.mjs"() {
    init_import_meta_url();
    init_resource();
    OriginPostQuantumEncryption = class extends APIResource {
      static {
        __name(this, "OriginPostQuantumEncryption");
      }
      /**
       * Instructs Cloudflare to use Post-Quantum (PQ) key agreement algorithms when
       * connecting to your origin. Preferred instructs Cloudflare to opportunistically
       * send a Post-Quantum keyshare in the first message to the origin (for fastest
       * connections when the origin supports and prefers PQ), supported means that PQ
       * algorithms are advertised but only used when requested by the origin, and off
       * means that PQ algorithms are not advertised.
       */
      update(params, options) {
        const { zone_id, ...body } = params;
        return this._client.put(`/zones/${zone_id}/cache/origin_post_quantum_encryption`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Instructs Cloudflare to use Post-Quantum (PQ) key agreement algorithms when
       * connecting to your origin. Preferred instructs Cloudflare to opportunistically
       * send a Post-Quantum keyshare in the first message to the origin (for fastest
       * connections when the origin supports and prefers PQ), supported means that PQ
       * algorithms are advertised but only used when requested by the origin, and off
       * means that PQ algorithms are not advertised.
       */
      get(params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/cache/origin_post_quantum_encryption`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/origin-tls-client-auth/settings.mjs
var Settings7;
var init_settings7 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/origin-tls-client-auth/settings.mjs"() {
    init_import_meta_url();
    init_resource();
    Settings7 = class extends APIResource {
      static {
        __name(this, "Settings");
      }
      /**
       * Enable or disable zone-level authenticated origin pulls. 'enabled' should be set
       * true either before/after the certificate is uploaded to see the certificate in
       * use.
       *
       * @example
       * ```ts
       * const setting =
       *   await client.originTLSClientAuth.settings.update({
       *     zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     enabled: true,
       *   });
       * ```
       */
      update(params, options) {
        const { zone_id, ...body } = params;
        return this._client.put(`/zones/${zone_id}/origin_tls_client_auth/settings`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get whether zone-level authenticated origin pulls is enabled or not. It is false
       * by default.
       *
       * @example
       * ```ts
       * const setting =
       *   await client.originTLSClientAuth.settings.get({
       *     zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   });
       * ```
       */
      get(params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/origin_tls_client_auth/settings`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/origin-tls-client-auth/hostnames/certificates.mjs
var Certificates2, CertificateListResponsesSinglePage;
var init_certificates2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/origin-tls-client-auth/hostnames/certificates.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Certificates2 = class extends APIResource {
      static {
        __name(this, "Certificates");
      }
      /**
       * Upload a certificate to be used for client authentication on a hostname. 10
       * hostname certificates per zone are allowed.
       *
       * @example
       * ```ts
       * const certificate =
       *   await client.originTLSClientAuth.hostnames.certificates.create(
       *     {
       *       zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *       certificate:
       *         '-----BEGIN CERTIFICATE-----\nMIIDtTCCAp2gAwIBAgIJAMHAwfXZ5/PWMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV\nBAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX\naWRnaXRzIFB0eSBMdGQwHhcNMTYwODI0MTY0MzAxWhcNMTYxMTIyMTY0MzAxWjBF\nMQswCQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50\nZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\nCgKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmGdtcGbg/1\nCGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKnabIRuGvB\nKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpidtnKX/a+5\n0GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+pyFxIXjbEI\ndZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pEewooaeO2\nizNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABo4GnMIGkMB0GA1UdDgQWBBT/LbE4\n9rWf288N6sJA5BRb6FJIGDB1BgNVHSMEbjBsgBT/LbE49rWf288N6sJA5BRb6FJI\nGKFJpEcwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNV\nBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAMHAwfXZ5/PWMAwGA1UdEwQF\nMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAHHFwl0tH0quUYZYO0dZYt4R7SJ0pCm2\n2satiyzHl4OnXcHDpekAo7/a09c6Lz6AU83cKy/+x3/djYHXWba7HpEu0dR3ugQP\nMlr4zrhd9xKZ0KZKiYmtJH+ak4OM4L3FbT0owUZPyjLSlhMtJVcoRp5CJsjAMBUG\nSvD8RX+T01wzox/Qb+lnnNnOlaWpqu8eoOenybxKp1a9ULzIVvN/LAcc+14vioFq\n2swRWtmocBAs8QR9n4uvbpiYvS8eYueDCWMM4fvFfBhaDZ3N9IbtySh3SpFdQDhw\nYbjM2rxXiyLGxB4Bol7QTv4zHif7Zt89FReT/NBy4rzaskDJY5L6xmY=\n-----END CERTIFICATE-----\n',
       *       private_key:
       *         '-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmG\ndtcGbg/1CGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKn\nabIRuGvBKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpid\ntnKX/a+50GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+py\nFxIXjbEIdZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pE\newooaeO2izNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABAoIBACbhTYXBZYKmYPCb\nHBR1IBlCQA2nLGf0qRuJNJZg5iEzXows/6tc8YymZkQE7nolapWsQ+upk2y5Xdp/\naxiuprIs9JzkYK8Ox0r+dlwCG1kSW+UAbX0bQ/qUqlsTvU6muVuMP8vZYHxJ3wmb\n+ufRBKztPTQ/rYWaYQcgC0RWI20HTFBMxlTAyNxYNWzX7RKFkGVVyB9RsAtmcc8g\n+j4OdosbfNoJPS0HeIfNpAznDfHKdxDk2Yc1tV6RHBrC1ynyLE9+TaflIAdo2MVv\nKLMLq51GqYKtgJFIlBRPQqKoyXdz3fGvXrTkf/WY9QNq0J1Vk5ERePZ54mN8iZB7\n9lwy/AkCgYEA6FXzosxswaJ2wQLeoYc7ceaweX/SwTvxHgXzRyJIIT0eJWgx13Wo\n/WA3Iziimsjf6qE+SI/8laxPp2A86VMaIt3Z3mJN/CqSVGw8LK2AQst+OwdPyDMu\niacE8lj/IFGC8mwNUAb9CzGU3JpU4PxxGFjS/eMtGeRXCWkK4NE+G08CgYEA1Kp9\nN2JrVlqUz+gAX+LPmE9OEMAS9WQSQsfCHGogIFDGGcNf7+uwBM7GAaSJIP01zcoe\nVAgWdzXCv3FLhsaZoJ6RyLOLay5phbu1iaTr4UNYm5WtYTzMzqh8l1+MFFDl9xDB\nvULuCIIrglM5MeS/qnSg1uMoH2oVPj9TVst/ir8CgYEAxrI7Ws9Zc4Bt70N1As+U\nlySjaEVZCMkqvHJ6TCuVZFfQoE0r0whdLdRLU2PsLFP+q7qaeZQqgBaNSKeVcDYR\n9B+nY/jOmQoPewPVsp/vQTCnE/R81spu0mp0YI6cIheT1Z9zAy322svcc43JaWB7\nmEbeqyLOP4Z4qSOcmghZBSECgYACvR9Xs0DGn+wCsW4vze/2ei77MD4OQvepPIFX\ndFZtlBy5ADcgE9z0cuVB6CiL8DbdK5kwY9pGNr8HUCI03iHkW6Zs+0L0YmihfEVe\nPG19PSzK9CaDdhD9KFZSbLyVFmWfxOt50H7YRTTiPMgjyFpfi5j2q348yVT0tEQS\nfhRqaQKBgAcWPokmJ7EbYQGeMbS7HC8eWO/RyamlnSffdCdSc7ue3zdVJxpAkQ8W\nqu80pEIF6raIQfAf8MXiiZ7auFOSnHQTXUbhCpvDLKi0Mwq3G8Pl07l+2s6dQG6T\nlv6XTQaMyf6n1yjzL+fzDrH3qXMxHMO/b13EePXpDMpY7HQpoLDi\n-----END RSA PRIVATE KEY-----\n',
       *     },
       *   );
       * ```
       */
      create(params, options) {
        const { zone_id, ...body } = params;
        return this._client.post(`/zones/${zone_id}/origin_tls_client_auth/hostnames/certificates`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List Certificates
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const certificateListResponse of client.originTLSClientAuth.hostnames.certificates.list(
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { zone_id } = params;
        return this._client.getAPIList(`/zones/${zone_id}/origin_tls_client_auth/hostnames/certificates`, CertificateListResponsesSinglePage, options);
      }
      /**
       * Delete Hostname Client Certificate
       *
       * @example
       * ```ts
       * const certificate =
       *   await client.originTLSClientAuth.hostnames.certificates.delete(
       *     '023e105f4ecef8ad9ca31a8372d0c353',
       *     { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      delete(certificateId, params, options) {
        const { zone_id } = params;
        return this._client.delete(`/zones/${zone_id}/origin_tls_client_auth/hostnames/certificates/${certificateId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get the certificate by ID to be used for client authentication on a hostname.
       *
       * @example
       * ```ts
       * const certificate =
       *   await client.originTLSClientAuth.hostnames.certificates.get(
       *     '023e105f4ecef8ad9ca31a8372d0c353',
       *     { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      get(certificateId, params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/origin_tls_client_auth/hostnames/certificates/${certificateId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    CertificateListResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "CertificateListResponsesSinglePage");
      }
    };
    Certificates2.CertificateListResponsesSinglePage = CertificateListResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/origin-tls-client-auth/hostnames/hostnames.mjs
var Hostnames2, HostnameUpdateResponsesSinglePage;
var init_hostnames2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/origin-tls-client-auth/hostnames/hostnames.mjs"() {
    init_import_meta_url();
    init_resource();
    init_certificates2();
    init_certificates2();
    init_pagination();
    Hostnames2 = class extends APIResource {
      static {
        __name(this, "Hostnames");
      }
      constructor() {
        super(...arguments);
        this.certificates = new Certificates2(this._client);
      }
      /**
       * Associate a hostname to a certificate and enable, disable or invalidate the
       * association. If disabled, client certificate will not be sent to the hostname
       * even if activated at the zone level. 100 maximum associations on a single
       * certificate are allowed. Note: Use a null value for parameter _enabled_ to
       * invalidate the association.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const hostnameUpdateResponse of client.originTLSClientAuth.hostnames.update(
       *   {
       *     zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     config: [{}],
       *   },
       * )) {
       *   // ...
       * }
       * ```
       */
      update(params, options) {
        const { zone_id, ...body } = params;
        return this._client.getAPIList(`/zones/${zone_id}/origin_tls_client_auth/hostnames`, HostnameUpdateResponsesSinglePage, { body, method: "put", ...options });
      }
      /**
       * Get the Hostname Status for Client Authentication
       *
       * @example
       * ```ts
       * const authenticatedOriginPull =
       *   await client.originTLSClientAuth.hostnames.get(
       *     'app.example.com',
       *     { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      get(hostname2, params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/origin_tls_client_auth/hostnames/${hostname2}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    HostnameUpdateResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "HostnameUpdateResponsesSinglePage");
      }
    };
    Hostnames2.HostnameUpdateResponsesSinglePage = HostnameUpdateResponsesSinglePage;
    Hostnames2.Certificates = Certificates2;
    Hostnames2.CertificateListResponsesSinglePage = CertificateListResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/origin-tls-client-auth/origin-tls-client-auth.mjs
var OriginTLSClientAuth, OriginTLSClientAuthListResponsesSinglePage;
var init_origin_tls_client_auth = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/origin-tls-client-auth/origin-tls-client-auth.mjs"() {
    init_import_meta_url();
    init_resource();
    init_settings7();
    init_settings7();
    init_hostnames2();
    init_hostnames2();
    init_pagination();
    OriginTLSClientAuth = class extends APIResource {
      static {
        __name(this, "OriginTLSClientAuth");
      }
      constructor() {
        super(...arguments);
        this.hostnames = new Hostnames2(this._client);
        this.settings = new Settings7(this._client);
      }
      /**
       * Upload your own certificate you want Cloudflare to use for edge-to-origin
       * communication to override the shared certificate. Please note that it is
       * important to keep only one certificate active. Also, make sure to enable
       * zone-level authenticated origin pulls by making a PUT call to settings endpoint
       * to see the uploaded certificate in use.
       *
       * @example
       * ```ts
       * const originTLSClientAuth =
       *   await client.originTLSClientAuth.create({
       *     zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     certificate:
       *       '-----BEGIN CERTIFICATE-----\nMIIDtTCCAp2gAwIBAgIJAMHAwfXZ5/PWMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV\nBAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX\naWRnaXRzIFB0eSBMdGQwHhcNMTYwODI0MTY0MzAxWhcNMTYxMTIyMTY0MzAxWjBF\nMQswCQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50\nZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\nCgKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmGdtcGbg/1\nCGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKnabIRuGvB\nKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpidtnKX/a+5\n0GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+pyFxIXjbEI\ndZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pEewooaeO2\nizNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABo4GnMIGkMB0GA1UdDgQWBBT/LbE4\n9rWf288N6sJA5BRb6FJIGDB1BgNVHSMEbjBsgBT/LbE49rWf288N6sJA5BRb6FJI\nGKFJpEcwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNV\nBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAMHAwfXZ5/PWMAwGA1UdEwQF\nMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAHHFwl0tH0quUYZYO0dZYt4R7SJ0pCm2\n2satiyzHl4OnXcHDpekAo7/a09c6Lz6AU83cKy/+x3/djYHXWba7HpEu0dR3ugQP\nMlr4zrhd9xKZ0KZKiYmtJH+ak4OM4L3FbT0owUZPyjLSlhMtJVcoRp5CJsjAMBUG\nSvD8RX+T01wzox/Qb+lnnNnOlaWpqu8eoOenybxKp1a9ULzIVvN/LAcc+14vioFq\n2swRWtmocBAs8QR9n4uvbpiYvS8eYueDCWMM4fvFfBhaDZ3N9IbtySh3SpFdQDhw\nYbjM2rxXiyLGxB4Bol7QTv4zHif7Zt89FReT/NBy4rzaskDJY5L6xmY=\n-----END CERTIFICATE-----\n',
       *     private_key:
       *       '-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmG\ndtcGbg/1CGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKn\nabIRuGvBKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpid\ntnKX/a+50GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+py\nFxIXjbEIdZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pE\newooaeO2izNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABAoIBACbhTYXBZYKmYPCb\nHBR1IBlCQA2nLGf0qRuJNJZg5iEzXows/6tc8YymZkQE7nolapWsQ+upk2y5Xdp/\naxiuprIs9JzkYK8Ox0r+dlwCG1kSW+UAbX0bQ/qUqlsTvU6muVuMP8vZYHxJ3wmb\n+ufRBKztPTQ/rYWaYQcgC0RWI20HTFBMxlTAyNxYNWzX7RKFkGVVyB9RsAtmcc8g\n+j4OdosbfNoJPS0HeIfNpAznDfHKdxDk2Yc1tV6RHBrC1ynyLE9+TaflIAdo2MVv\nKLMLq51GqYKtgJFIlBRPQqKoyXdz3fGvXrTkf/WY9QNq0J1Vk5ERePZ54mN8iZB7\n9lwy/AkCgYEA6FXzosxswaJ2wQLeoYc7ceaweX/SwTvxHgXzRyJIIT0eJWgx13Wo\n/WA3Iziimsjf6qE+SI/8laxPp2A86VMaIt3Z3mJN/CqSVGw8LK2AQst+OwdPyDMu\niacE8lj/IFGC8mwNUAb9CzGU3JpU4PxxGFjS/eMtGeRXCWkK4NE+G08CgYEA1Kp9\nN2JrVlqUz+gAX+LPmE9OEMAS9WQSQsfCHGogIFDGGcNf7+uwBM7GAaSJIP01zcoe\nVAgWdzXCv3FLhsaZoJ6RyLOLay5phbu1iaTr4UNYm5WtYTzMzqh8l1+MFFDl9xDB\nvULuCIIrglM5MeS/qnSg1uMoH2oVPj9TVst/ir8CgYEAxrI7Ws9Zc4Bt70N1As+U\nlySjaEVZCMkqvHJ6TCuVZFfQoE0r0whdLdRLU2PsLFP+q7qaeZQqgBaNSKeVcDYR\n9B+nY/jOmQoPewPVsp/vQTCnE/R81spu0mp0YI6cIheT1Z9zAy322svcc43JaWB7\nmEbeqyLOP4Z4qSOcmghZBSECgYACvR9Xs0DGn+wCsW4vze/2ei77MD4OQvepPIFX\ndFZtlBy5ADcgE9z0cuVB6CiL8DbdK5kwY9pGNr8HUCI03iHkW6Zs+0L0YmihfEVe\nPG19PSzK9CaDdhD9KFZSbLyVFmWfxOt50H7YRTTiPMgjyFpfi5j2q348yVT0tEQS\nfhRqaQKBgAcWPokmJ7EbYQGeMbS7HC8eWO/RyamlnSffdCdSc7ue3zdVJxpAkQ8W\nqu80pEIF6raIQfAf8MXiiZ7auFOSnHQTXUbhCpvDLKi0Mwq3G8Pl07l+2s6dQG6T\nlv6XTQaMyf6n1yjzL+fzDrH3qXMxHMO/b13EePXpDMpY7HQpoLDi\n-----END RSA PRIVATE KEY-----\n',
       *   });
       * ```
       */
      create(params, options) {
        const { zone_id, ...body } = params;
        return this._client.post(`/zones/${zone_id}/origin_tls_client_auth`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List Certificates
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const originTLSClientAuthListResponse of client.originTLSClientAuth.list(
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { zone_id } = params;
        return this._client.getAPIList(`/zones/${zone_id}/origin_tls_client_auth`, OriginTLSClientAuthListResponsesSinglePage, options);
      }
      /**
       * Delete Certificate
       *
       * @example
       * ```ts
       * const originTLSClientAuth =
       *   await client.originTLSClientAuth.delete(
       *     '023e105f4ecef8ad9ca31a8372d0c353',
       *     { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      delete(certificateId, params, options) {
        const { zone_id } = params;
        return this._client.delete(`/zones/${zone_id}/origin_tls_client_auth/${certificateId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get Certificate Details
       *
       * @example
       * ```ts
       * const originTLSClientAuth =
       *   await client.originTLSClientAuth.get(
       *     '023e105f4ecef8ad9ca31a8372d0c353',
       *     { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      get(certificateId, params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/origin_tls_client_auth/${certificateId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    OriginTLSClientAuthListResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "OriginTLSClientAuthListResponsesSinglePage");
      }
    };
    OriginTLSClientAuth.OriginTLSClientAuthListResponsesSinglePage = OriginTLSClientAuthListResponsesSinglePage;
    OriginTLSClientAuth.Hostnames = Hostnames2;
    OriginTLSClientAuth.HostnameUpdateResponsesSinglePage = HostnameUpdateResponsesSinglePage;
    OriginTLSClientAuth.Settings = Settings7;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/page-rules.mjs
var PageRules;
var init_page_rules = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/page-rules.mjs"() {
    init_import_meta_url();
    init_resource();
    PageRules = class extends APIResource {
      static {
        __name(this, "PageRules");
      }
      /**
       * Creates a new Page Rule.
       *
       * @example
       * ```ts
       * const pageRule = await client.pageRules.create({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   actions: [{ id: 'browser_check' }],
       *   targets: [
       *     {
       *       constraint: {
       *         operator: 'matches',
       *         value: '*example.com/images/*',
       *       },
       *       target: 'url',
       *     },
       *   ],
       * });
       * ```
       */
      create(params, options) {
        const { zone_id, ...body } = params;
        return this._client.post(`/zones/${zone_id}/pagerules`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Replaces the configuration of an existing Page Rule. The configuration of the
       * updated Page Rule will exactly match the data passed in the API request.
       *
       * @example
       * ```ts
       * const pageRule = await client.pageRules.update(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   {
       *     zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     actions: [{ id: 'browser_check' }],
       *     targets: [
       *       {
       *         constraint: {
       *           operator: 'matches',
       *           value: '*example.com/images/*',
       *         },
       *         target: 'url',
       *       },
       *     ],
       *   },
       * );
       * ```
       */
      update(pageruleId, params, options) {
        const { zone_id, ...body } = params;
        return this._client.put(`/zones/${zone_id}/pagerules/${pageruleId}`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetches Page Rules in a zone.
       *
       * @example
       * ```ts
       * const pageRules = await client.pageRules.list({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      list(params, options) {
        const { zone_id, ...query } = params;
        return this._client.get(`/zones/${zone_id}/pagerules`, { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Deletes an existing Page Rule.
       *
       * @example
       * ```ts
       * const pageRule = await client.pageRules.delete(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      delete(pageruleId, params, options) {
        const { zone_id } = params;
        return this._client.delete(`/zones/${zone_id}/pagerules/${pageruleId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Updates one or more fields of an existing Page Rule.
       *
       * @example
       * ```ts
       * const pageRule = await client.pageRules.edit(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      edit(pageruleId, params, options) {
        const { zone_id, ...body } = params;
        return this._client.patch(`/zones/${zone_id}/pagerules/${pageruleId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetches the details of a Page Rule.
       *
       * @example
       * ```ts
       * const pageRule = await client.pageRules.get(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(pageruleId, params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/pagerules/${pageruleId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/page-shield/connections.mjs
var Connections, ConnectionsSinglePage;
var init_connections = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/page-shield/connections.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Connections = class extends APIResource {
      static {
        __name(this, "Connections");
      }
      /**
       * Lists all connections detected by Page Shield.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const connection of client.pageShield.connections.list(
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { zone_id, ...query } = params;
        return this._client.getAPIList(`/zones/${zone_id}/page_shield/connections`, ConnectionsSinglePage, {
          query,
          ...options
        });
      }
      /**
       * Fetches a connection detected by Page Shield by connection ID.
       *
       * @example
       * ```ts
       * const connection = await client.pageShield.connections.get(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(connectionId, params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/page_shield/connections/${connectionId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    ConnectionsSinglePage = class extends SinglePage {
      static {
        __name(this, "ConnectionsSinglePage");
      }
    };
    Connections.ConnectionsSinglePage = ConnectionsSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/page-shield/cookies.mjs
var Cookies, CookieListResponsesSinglePage;
var init_cookies = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/page-shield/cookies.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Cookies = class extends APIResource {
      static {
        __name(this, "Cookies");
      }
      /**
       * Lists all cookies collected by Page Shield.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const cookieListResponse of client.pageShield.cookies.list(
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { zone_id, ...query } = params;
        return this._client.getAPIList(`/zones/${zone_id}/page_shield/cookies`, CookieListResponsesSinglePage, {
          query,
          ...options
        });
      }
      /**
       * Fetches a cookie collected by Page Shield by cookie ID.
       *
       * @example
       * ```ts
       * const cookie = await client.pageShield.cookies.get(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(cookieId, params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/page_shield/cookies/${cookieId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    CookieListResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "CookieListResponsesSinglePage");
      }
    };
    Cookies.CookieListResponsesSinglePage = CookieListResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/page-shield/policies.mjs
var Policies2, PolicyListResponsesSinglePage;
var init_policies2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/page-shield/policies.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Policies2 = class extends APIResource {
      static {
        __name(this, "Policies");
      }
      /**
       * Create a Page Shield policy.
       *
       * @example
       * ```ts
       * const policy = await client.pageShield.policies.create({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   action: 'allow',
       *   description: 'Checkout page CSP policy',
       *   enabled: true,
       *   expression:
       *     'ends_with(http.request.uri.path, "/checkout")',
       *   value: "script-src 'none';",
       * });
       * ```
       */
      create(params, options) {
        const { zone_id, ...body } = params;
        return this._client.post(`/zones/${zone_id}/page_shield/policies`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Update a Page Shield policy by ID.
       *
       * @example
       * ```ts
       * const policy = await client.pageShield.policies.update(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      update(policyId, params, options) {
        const { zone_id, ...body } = params;
        return this._client.put(`/zones/${zone_id}/page_shield/policies/${policyId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Lists all Page Shield policies.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const policyListResponse of client.pageShield.policies.list(
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { zone_id } = params;
        return this._client.getAPIList(`/zones/${zone_id}/page_shield/policies`, PolicyListResponsesSinglePage, options);
      }
      /**
       * Delete a Page Shield policy by ID.
       *
       * @example
       * ```ts
       * await client.pageShield.policies.delete(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      delete(policyId, params, options) {
        const { zone_id } = params;
        return this._client.delete(`/zones/${zone_id}/page_shield/policies/${policyId}`, {
          ...options,
          headers: { Accept: "*/*", ...options?.headers }
        });
      }
      /**
       * Fetches a Page Shield policy by ID.
       *
       * @example
       * ```ts
       * const policy = await client.pageShield.policies.get(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(policyId, params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/page_shield/policies/${policyId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    PolicyListResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "PolicyListResponsesSinglePage");
      }
    };
    Policies2.PolicyListResponsesSinglePage = PolicyListResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/page-shield/scripts.mjs
var Scripts, ScriptsSinglePage;
var init_scripts = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/page-shield/scripts.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Scripts = class extends APIResource {
      static {
        __name(this, "Scripts");
      }
      /**
       * Lists all scripts detected by Page Shield.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const script of client.pageShield.scripts.list({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * })) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { zone_id, ...query } = params;
        return this._client.getAPIList(`/zones/${zone_id}/page_shield/scripts`, ScriptsSinglePage, {
          query,
          ...options
        });
      }
      /**
       * Fetches a script detected by Page Shield by script ID.
       *
       * @example
       * ```ts
       * const script = await client.pageShield.scripts.get(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(scriptId, params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/page_shield/scripts/${scriptId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    ScriptsSinglePage = class extends SinglePage {
      static {
        __name(this, "ScriptsSinglePage");
      }
    };
    Scripts.ScriptsSinglePage = ScriptsSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/page-shield/page-shield.mjs
var PageShield;
var init_page_shield = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/page-shield/page-shield.mjs"() {
    init_import_meta_url();
    init_resource();
    init_connections();
    init_connections();
    init_cookies();
    init_cookies();
    init_policies2();
    init_policies2();
    init_scripts();
    init_scripts();
    PageShield = class extends APIResource {
      static {
        __name(this, "PageShield");
      }
      constructor() {
        super(...arguments);
        this.policies = new Policies2(this._client);
        this.connections = new Connections(this._client);
        this.scripts = new Scripts(this._client);
        this.cookies = new Cookies(this._client);
      }
      /**
       * Updates Page Shield settings.
       *
       * @example
       * ```ts
       * const pageShield = await client.pageShield.update({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      update(params, options) {
        const { zone_id, ...body } = params;
        return this._client.put(`/zones/${zone_id}/page_shield`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetches the Page Shield settings.
       *
       * @example
       * ```ts
       * const setting = await client.pageShield.get({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      get(params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/page_shield`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    PageShield.Policies = Policies2;
    PageShield.PolicyListResponsesSinglePage = PolicyListResponsesSinglePage;
    PageShield.Connections = Connections;
    PageShield.ConnectionsSinglePage = ConnectionsSinglePage;
    PageShield.Scripts = Scripts;
    PageShield.ScriptsSinglePage = ScriptsSinglePage;
    PageShield.Cookies = Cookies;
    PageShield.CookieListResponsesSinglePage = CookieListResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/pages/projects/domains.mjs
var Domains3, DomainListResponsesSinglePage;
var init_domains3 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/pages/projects/domains.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Domains3 = class extends APIResource {
      static {
        __name(this, "Domains");
      }
      /**
       * Add a new domain for the Pages project.
       *
       * @example
       * ```ts
       * const domain = await client.pages.projects.domains.create(
       *   'this-is-my-project-01',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      create(projectName, params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/pages/projects/${projectName}/domains`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetch a list of all domains associated with a Pages project.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const domainListResponse of client.pages.projects.domains.list(
       *   'this-is-my-project-01',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(projectName, params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/pages/projects/${projectName}/domains`, DomainListResponsesSinglePage, options);
      }
      /**
       * Delete a Pages project's domain.
       *
       * @example
       * ```ts
       * const domain = await client.pages.projects.domains.delete(
       *   'this-is-my-project-01',
       *   'this-is-my-domain-01.com',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      delete(projectName, domainName, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/pages/projects/${projectName}/domains/${domainName}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Retry the validation status of a single domain.
       *
       * @example
       * ```ts
       * const response = await client.pages.projects.domains.edit(
       *   'this-is-my-project-01',
       *   'this-is-my-domain-01.com',
       *   {
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     body: {},
       *   },
       * );
       * ```
       */
      edit(projectName, domainName, params, options) {
        const { account_id, body } = params;
        return this._client.patch(`/accounts/${account_id}/pages/projects/${projectName}/domains/${domainName}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetch a single domain.
       *
       * @example
       * ```ts
       * const domain = await client.pages.projects.domains.get(
       *   'this-is-my-project-01',
       *   'this-is-my-domain-01.com',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(projectName, domainName, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/pages/projects/${projectName}/domains/${domainName}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    DomainListResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "DomainListResponsesSinglePage");
      }
    };
    Domains3.DomainListResponsesSinglePage = DomainListResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/pages/projects/deployments/history/logs.mjs
var Logs4;
var init_logs4 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/pages/projects/deployments/history/logs.mjs"() {
    init_import_meta_url();
    init_resource();
    Logs4 = class extends APIResource {
      static {
        __name(this, "Logs");
      }
      /**
       * Fetch deployment logs for a project.
       *
       * @example
       * ```ts
       * const log =
       *   await client.pages.projects.deployments.history.logs.get(
       *     'this-is-my-project-01',
       *     '023e105f4ecef8ad9ca31a8372d0c353',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      get(projectName, deploymentId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/pages/projects/${projectName}/deployments/${deploymentId}/history/logs`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/pages/projects/deployments/history/history.mjs
var History;
var init_history2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/pages/projects/deployments/history/history.mjs"() {
    init_import_meta_url();
    init_resource();
    init_logs4();
    init_logs4();
    History = class extends APIResource {
      static {
        __name(this, "History");
      }
      constructor() {
        super(...arguments);
        this.logs = new Logs4(this._client);
      }
    };
    History.Logs = Logs4;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/pages/projects/deployments/deployments.mjs
var Deployments;
var init_deployments = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/pages/projects/deployments/deployments.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    init_projects();
    init_history2();
    init_history2();
    Deployments = class extends APIResource {
      static {
        __name(this, "Deployments");
      }
      constructor() {
        super(...arguments);
        this.history = new History(this._client);
      }
      /**
       * Start a new deployment from production. The repository and account must have
       * already been authorized on the Cloudflare Pages dashboard.
       *
       * @example
       * ```ts
       * const deployment =
       *   await client.pages.projects.deployments.create(
       *     'this-is-my-project-01',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      create(projectName, params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/pages/projects/${projectName}/deployments`, multipartFormRequestOptions({ body, ...options }))._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetch a list of project deployments.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const deployment of client.pages.projects.deployments.list(
       *   'this-is-my-project-01',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(projectName, params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/pages/projects/${projectName}/deployments`, DeploymentsSinglePage, { query, ...options });
      }
      /**
       * Delete a deployment.
       *
       * @example
       * ```ts
       * const deployment =
       *   await client.pages.projects.deployments.delete(
       *     'this-is-my-project-01',
       *     '023e105f4ecef8ad9ca31a8372d0c353',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      delete(projectName, deploymentId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/pages/projects/${projectName}/deployments/${deploymentId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetch information about a deployment.
       *
       * @example
       * ```ts
       * const deployment =
       *   await client.pages.projects.deployments.get(
       *     'this-is-my-project-01',
       *     '023e105f4ecef8ad9ca31a8372d0c353',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      get(projectName, deploymentId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/pages/projects/${projectName}/deployments/${deploymentId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Retry a previous deployment.
       *
       * @example
       * ```ts
       * const deployment =
       *   await client.pages.projects.deployments.retry(
       *     'this-is-my-project-01',
       *     '023e105f4ecef8ad9ca31a8372d0c353',
       *     {
       *       account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *       body: {},
       *     },
       *   );
       * ```
       */
      retry(projectName, deploymentId, params, options) {
        const { account_id, body } = params;
        return this._client.post(`/accounts/${account_id}/pages/projects/${projectName}/deployments/${deploymentId}/retry`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Rollback the production deployment to a previous deployment. You can only
       * rollback to succesful builds on production.
       *
       * @example
       * ```ts
       * const deployment =
       *   await client.pages.projects.deployments.rollback(
       *     'this-is-my-project-01',
       *     '023e105f4ecef8ad9ca31a8372d0c353',
       *     {
       *       account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *       body: {},
       *     },
       *   );
       * ```
       */
      rollback(projectName, deploymentId, params, options) {
        const { account_id, body } = params;
        return this._client.post(`/accounts/${account_id}/pages/projects/${projectName}/deployments/${deploymentId}/rollback`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
    };
    Deployments.History = History;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/pages/projects/projects.mjs
var Projects, DeploymentsSinglePage;
var init_projects = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/pages/projects/projects.mjs"() {
    init_import_meta_url();
    init_resource();
    init_domains3();
    init_domains3();
    init_deployments();
    init_deployments();
    init_pagination();
    Projects = class extends APIResource {
      static {
        __name(this, "Projects");
      }
      constructor() {
        super(...arguments);
        this.deployments = new Deployments(this._client);
        this.domains = new Domains3(this._client);
      }
      /**
       * Create a new project.
       *
       * @example
       * ```ts
       * const project = await client.pages.projects.create({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/pages/projects`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetch a list of all user projects.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const deployment of client.pages.projects.list({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * })) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/pages/projects`, DeploymentsSinglePage, options);
      }
      /**
       * Delete a project by name.
       *
       * @example
       * ```ts
       * const project = await client.pages.projects.delete(
       *   'this-is-my-project-01',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      delete(projectName, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/pages/projects/${projectName}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Set new attributes for an existing project. Modify environment variables. To
       * delete an environment variable, set the key to null.
       *
       * @example
       * ```ts
       * const project = await client.pages.projects.edit(
       *   'this-is-my-project-01',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      edit(projectName, params, options) {
        const { account_id, ...body } = params;
        return this._client.patch(`/accounts/${account_id}/pages/projects/${projectName}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetch a project by name.
       *
       * @example
       * ```ts
       * const project = await client.pages.projects.get(
       *   'this-is-my-project-01',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(projectName, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/pages/projects/${projectName}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Purge all cached build artifacts for a Pages project
       *
       * @example
       * ```ts
       * const response =
       *   await client.pages.projects.purgeBuildCache(
       *     'this-is-my-project-01',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      purgeBuildCache(projectName, params, options) {
        const { account_id } = params;
        return this._client.post(`/accounts/${account_id}/pages/projects/${projectName}/purge_build_cache`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    DeploymentsSinglePage = class extends SinglePage {
      static {
        __name(this, "DeploymentsSinglePage");
      }
    };
    Projects.DeploymentsSinglePage = DeploymentsSinglePage;
    Projects.Deployments = Deployments;
    Projects.Domains = Domains3;
    Projects.DomainListResponsesSinglePage = DomainListResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/pages/pages.mjs
var Pages;
var init_pages = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/pages/pages.mjs"() {
    init_import_meta_url();
    init_resource();
    init_projects();
    init_projects();
    Pages = class extends APIResource {
      static {
        __name(this, "Pages");
      }
      constructor() {
        super(...arguments);
        this.projects = new Projects(this._client);
      }
    };
    Pages.Projects = Projects;
    Pages.DeploymentsSinglePage = DeploymentsSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/pipelines.mjs
var Pipelines;
var init_pipelines = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/pipelines.mjs"() {
    init_import_meta_url();
    init_resource();
    Pipelines = class extends APIResource {
      static {
        __name(this, "Pipelines");
      }
      /**
       * Create a new pipeline.
       *
       * @example
       * ```ts
       * const pipeline = await client.pipelines.create({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   destination: {
       *     batch: {},
       *     compression: {},
       *     credentials: {
       *       access_key_id: '<access key id>',
       *       endpoint:
       *         'https://123f8a8258064ed892a347f173372359.r2.cloudflarestorage.com',
       *       secret_access_key: '<secret key>',
       *     },
       *     format: 'json',
       *     path: { bucket: 'bucket' },
       *     type: 'r2',
       *   },
       *   name: 'sample_pipeline',
       *   source: [{ format: 'json', type: 'type' }],
       * });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/pipelines`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Update an existing pipeline.
       *
       * @example
       * ```ts
       * const pipeline = await client.pipelines.update(
       *   'sample_pipeline',
       *   {
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     destination: {
       *       batch: {},
       *       compression: {},
       *       format: 'json',
       *       path: { bucket: 'bucket' },
       *       type: 'r2',
       *     },
       *     name: 'sample_pipeline',
       *     source: [{ format: 'json', type: 'type' }],
       *   },
       * );
       * ```
       */
      update(pipelineName, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/pipelines/${pipelineName}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List, filter, and paginate pipelines in an account.
       *
       * @example
       * ```ts
       * const pipelines = await client.pipelines.list({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.get(`/accounts/${account_id}/pipelines`, { query, ...options });
      }
      /**
       * Delete a pipeline.
       *
       * @example
       * ```ts
       * await client.pipelines.delete('sample_pipeline', {
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      delete(pipelineName, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/pipelines/${pipelineName}`, {
          ...options,
          headers: { Accept: "*/*", ...options?.headers }
        });
      }
      /**
       * Get configuration of a pipeline.
       *
       * @example
       * ```ts
       * const pipeline = await client.pipelines.get(
       *   'sample_pipeline',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(pipelineName, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/pipelines/${pipelineName}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/queues/consumers.mjs
var Consumers, ConsumersSinglePage;
var init_consumers = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/queues/consumers.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Consumers = class extends APIResource {
      static {
        __name(this, "Consumers");
      }
      /**
       * Creates a new consumer for a Queue
       *
       * @example
       * ```ts
       * const consumer = await client.queues.consumers.create(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      create(queueId, params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/queues/${queueId}/consumers`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Updates the consumer for a queue, or creates one if it does not exist.
       *
       * @example
       * ```ts
       * const consumer = await client.queues.consumers.update(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      update(queueId, consumerId, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/queues/${queueId}/consumers/${consumerId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Returns the consumers for a Queue
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const consumer of client.queues.consumers.list(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(queueId, params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/queues/${queueId}/consumers`, ConsumersSinglePage, options);
      }
      /**
       * Deletes the consumer for a queue.
       *
       * @example
       * ```ts
       * const consumer = await client.queues.consumers.delete(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      delete(queueId, consumerId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/queues/${queueId}/consumers/${consumerId}`, options);
      }
      /**
       * Fetches the consumer for a queue by consumer id
       *
       * @example
       * ```ts
       * const consumer = await client.queues.consumers.get(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(queueId, consumerId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/queues/${queueId}/consumers/${consumerId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    ConsumersSinglePage = class extends SinglePage {
      static {
        __name(this, "ConsumersSinglePage");
      }
    };
    Consumers.ConsumersSinglePage = ConsumersSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/queues/messages.mjs
var Messages;
var init_messages = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/queues/messages.mjs"() {
    init_import_meta_url();
    init_resource();
    Messages = class extends APIResource {
      static {
        __name(this, "Messages");
      }
      /**
       * Acknowledge + Retry messages from a Queue
       *
       * @example
       * ```ts
       * const response = await client.queues.messages.ack(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      ack(queueId, params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/queues/${queueId}/messages/ack`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Push a batch of message to a Queue
       *
       * @example
       * ```ts
       * const response = await client.queues.messages.bulkPush(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      bulkPush(queueId, params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/queues/${queueId}/messages/batch`, {
          body,
          ...options
        });
      }
      /**
       * Pull a batch of messages from a Queue
       *
       * @example
       * ```ts
       * const response = await client.queues.messages.pull(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      pull(queueId, params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/queues/${queueId}/messages/pull`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Push a message to a Queue
       *
       * @example
       * ```ts
       * const response = await client.queues.messages.push(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      push(queueId, params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/queues/${queueId}/messages`, { body, ...options });
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/queues/purge.mjs
var Purge;
var init_purge = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/queues/purge.mjs"() {
    init_import_meta_url();
    init_resource();
    Purge = class extends APIResource {
      static {
        __name(this, "Purge");
      }
      /**
       * Deletes all messages from the Queue.
       *
       * @example
       * ```ts
       * const queue = await client.queues.purge.start(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      start(queueId, params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/queues/${queueId}/purge`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get details about a Queue's purge status.
       *
       * @example
       * ```ts
       * const response = await client.queues.purge.status(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      status(queueId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/queues/${queueId}/purge`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/queues/subscriptions.mjs
var Subscriptions2, SubscriptionListResponsesV4PagePaginationArray;
var init_subscriptions2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/queues/subscriptions.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Subscriptions2 = class extends APIResource {
      static {
        __name(this, "Subscriptions");
      }
      /**
       * Create a new event subscription for a queue
       *
       * @example
       * ```ts
       * const subscription =
       *   await client.queues.subscriptions.create({
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/event_subscriptions/subscriptions`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Update an existing event subscription
       *
       * @example
       * ```ts
       * const subscription =
       *   await client.queues.subscriptions.update(
       *     '023e105f4ecef8ad9ca31a8372d0c353',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      update(subscriptionId, params, options) {
        const { account_id, ...body } = params;
        return this._client.patch(`/accounts/${account_id}/event_subscriptions/subscriptions/${subscriptionId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get a paginated list of event subscriptions with optional sorting and filtering
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const subscriptionListResponse of client.queues.subscriptions.list(
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/event_subscriptions/subscriptions`, SubscriptionListResponsesV4PagePaginationArray, { query, ...options });
      }
      /**
       * Delete an existing event subscription
       *
       * @example
       * ```ts
       * const subscription =
       *   await client.queues.subscriptions.delete(
       *     '023e105f4ecef8ad9ca31a8372d0c353',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      delete(subscriptionId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/event_subscriptions/subscriptions/${subscriptionId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    SubscriptionListResponsesV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "SubscriptionListResponsesV4PagePaginationArray");
      }
    };
    Subscriptions2.SubscriptionListResponsesV4PagePaginationArray = SubscriptionListResponsesV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/queues/queues.mjs
var Queues, QueuesSinglePage;
var init_queues = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/queues/queues.mjs"() {
    init_import_meta_url();
    init_resource();
    init_consumers();
    init_consumers();
    init_messages();
    init_messages();
    init_purge();
    init_purge();
    init_subscriptions2();
    init_subscriptions2();
    init_pagination();
    Queues = class extends APIResource {
      static {
        __name(this, "Queues");
      }
      constructor() {
        super(...arguments);
        this.messages = new Messages(this._client);
        this.purge = new Purge(this._client);
        this.consumers = new Consumers(this._client);
        this.subscriptions = new Subscriptions2(this._client);
      }
      /**
       * Create a new queue
       *
       * @example
       * ```ts
       * const queue = await client.queues.create({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   queue_name: 'example-queue',
       * });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/queues`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Updates a Queue. Note that this endpoint does not support partial updates. If
       * successful, the Queue's configuration is overwritten with the supplied
       * configuration.
       *
       * @example
       * ```ts
       * const queue = await client.queues.update(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      update(queueId, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/queues/${queueId}`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Returns the queues owned by an account.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const queue of client.queues.list({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * })) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/queues`, QueuesSinglePage, options);
      }
      /**
       * Deletes a queue
       *
       * @example
       * ```ts
       * const queue = await client.queues.delete(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      delete(queueId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/queues/${queueId}`, options);
      }
      /**
       * Updates a Queue.
       *
       * @example
       * ```ts
       * const queue = await client.queues.edit(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      edit(queueId, params, options) {
        const { account_id, ...body } = params;
        return this._client.patch(`/accounts/${account_id}/queues/${queueId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get details about a specific queue.
       *
       * @example
       * ```ts
       * const queue = await client.queues.get(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(queueId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/queues/${queueId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    QueuesSinglePage = class extends SinglePage {
      static {
        __name(this, "QueuesSinglePage");
      }
    };
    Queues.QueuesSinglePage = QueuesSinglePage;
    Queues.Messages = Messages;
    Queues.Purge = Purge;
    Queues.Consumers = Consumers;
    Queues.ConsumersSinglePage = ConsumersSinglePage;
    Queues.Subscriptions = Subscriptions2;
    Queues.SubscriptionListResponsesV4PagePaginationArray = SubscriptionListResponsesV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/r2/temporary-credentials.mjs
var TemporaryCredentials;
var init_temporary_credentials = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/r2/temporary-credentials.mjs"() {
    init_import_meta_url();
    init_resource();
    TemporaryCredentials = class extends APIResource {
      static {
        __name(this, "TemporaryCredentials");
      }
      /**
       * Creates temporary access credentials on a bucket that can be optionally scoped
       * to prefixes or objects.
       *
       * @example
       * ```ts
       * const temporaryCredential =
       *   await client.r2.temporaryCredentials.create({
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     bucket: 'example-bucket',
       *     parentAccessKeyId: 'example-access-key-id',
       *     permission: 'object-read-write',
       *     ttlSeconds: 3600,
       *   });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/r2/temp-access-credentials`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/r2/buckets/cors.mjs
var CORS;
var init_cors = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/r2/buckets/cors.mjs"() {
    init_import_meta_url();
    init_resource();
    CORS = class extends APIResource {
      static {
        __name(this, "CORS");
      }
      /**
       * Set the CORS policy for a bucket.
       *
       * @example
       * ```ts
       * const cors = await client.r2.buckets.cors.update(
       *   'example-bucket',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      update(bucketName, params, options) {
        const { account_id, jurisdiction, ...body } = params;
        return this._client.put(`/accounts/${account_id}/r2/buckets/${bucketName}/cors`, {
          body,
          ...options,
          headers: {
            ...jurisdiction?.toString() != null ? { "cf-r2-jurisdiction": jurisdiction?.toString() } : void 0,
            ...options?.headers
          }
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Delete the CORS policy for a bucket.
       *
       * @example
       * ```ts
       * const cors = await client.r2.buckets.cors.delete(
       *   'example-bucket',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      delete(bucketName, params, options) {
        const { account_id, jurisdiction } = params;
        return this._client.delete(`/accounts/${account_id}/r2/buckets/${bucketName}/cors`, {
          ...options,
          headers: {
            ...jurisdiction?.toString() != null ? { "cf-r2-jurisdiction": jurisdiction?.toString() } : void 0,
            ...options?.headers
          }
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get the CORS policy for a bucket.
       *
       * @example
       * ```ts
       * const cors = await client.r2.buckets.cors.get(
       *   'example-bucket',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(bucketName, params, options) {
        const { account_id, jurisdiction } = params;
        return this._client.get(`/accounts/${account_id}/r2/buckets/${bucketName}/cors`, {
          ...options,
          headers: {
            ...jurisdiction?.toString() != null ? { "cf-r2-jurisdiction": jurisdiction?.toString() } : void 0,
            ...options?.headers
          }
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/r2/buckets/event-notifications.mjs
var EventNotifications;
var init_event_notifications = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/r2/buckets/event-notifications.mjs"() {
    init_import_meta_url();
    init_resource();
    EventNotifications = class extends APIResource {
      static {
        __name(this, "EventNotifications");
      }
      /**
       * Create event notification rule.
       *
       * @example
       * ```ts
       * const eventNotification =
       *   await client.r2.buckets.eventNotifications.update(
       *     'example-bucket',
       *     'queue_id',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      update(bucketName, queueId, params, options) {
        const { account_id, jurisdiction, ...body } = params;
        return this._client.put(`/accounts/${account_id}/event_notifications/r2/${bucketName}/configuration/queues/${queueId}`, {
          body,
          ...options,
          headers: {
            ...jurisdiction?.toString() != null ? { "cf-r2-jurisdiction": jurisdiction?.toString() } : void 0,
            ...options?.headers
          }
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List all event notification rules for a bucket.
       *
       * @example
       * ```ts
       * const eventNotifications =
       *   await client.r2.buckets.eventNotifications.list(
       *     'example-bucket',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      list(bucketName, params, options) {
        const { account_id, jurisdiction } = params;
        return this._client.get(`/accounts/${account_id}/event_notifications/r2/${bucketName}/configuration`, {
          ...options,
          headers: {
            ...jurisdiction?.toString() != null ? { "cf-r2-jurisdiction": jurisdiction?.toString() } : void 0,
            ...options?.headers
          }
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Delete an event notification rule. **If no body is provided, all rules for
       * specified queue will be deleted**.
       *
       * @example
       * ```ts
       * const eventNotification =
       *   await client.r2.buckets.eventNotifications.delete(
       *     'example-bucket',
       *     'queue_id',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      delete(bucketName, queueId, params, options) {
        const { account_id, jurisdiction } = params;
        return this._client.delete(`/accounts/${account_id}/event_notifications/r2/${bucketName}/configuration/queues/${queueId}`, {
          ...options,
          headers: {
            ...jurisdiction?.toString() != null ? { "cf-r2-jurisdiction": jurisdiction?.toString() } : void 0,
            ...options?.headers
          }
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get a single event notification rule.
       *
       * @example
       * ```ts
       * const eventNotification =
       *   await client.r2.buckets.eventNotifications.get(
       *     'example-bucket',
       *     'queue_id',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      get(bucketName, queueId, params, options) {
        const { account_id, jurisdiction } = params;
        return this._client.get(`/accounts/${account_id}/event_notifications/r2/${bucketName}/configuration/queues/${queueId}`, {
          ...options,
          headers: {
            ...jurisdiction?.toString() != null ? { "cf-r2-jurisdiction": jurisdiction?.toString() } : void 0,
            ...options?.headers
          }
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/r2/buckets/lifecycle.mjs
var Lifecycle;
var init_lifecycle = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/r2/buckets/lifecycle.mjs"() {
    init_import_meta_url();
    init_resource();
    Lifecycle = class extends APIResource {
      static {
        __name(this, "Lifecycle");
      }
      /**
       * Set the object lifecycle rules for a bucket.
       *
       * @example
       * ```ts
       * const lifecycle = await client.r2.buckets.lifecycle.update(
       *   'example-bucket',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      update(bucketName, params, options) {
        const { account_id, jurisdiction, ...body } = params;
        return this._client.put(`/accounts/${account_id}/r2/buckets/${bucketName}/lifecycle`, {
          body,
          ...options,
          headers: {
            ...jurisdiction?.toString() != null ? { "cf-r2-jurisdiction": jurisdiction?.toString() } : void 0,
            ...options?.headers
          }
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get object lifecycle rules for a bucket.
       *
       * @example
       * ```ts
       * const lifecycle = await client.r2.buckets.lifecycle.get(
       *   'example-bucket',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(bucketName, params, options) {
        const { account_id, jurisdiction } = params;
        return this._client.get(`/accounts/${account_id}/r2/buckets/${bucketName}/lifecycle`, {
          ...options,
          headers: {
            ...jurisdiction?.toString() != null ? { "cf-r2-jurisdiction": jurisdiction?.toString() } : void 0,
            ...options?.headers
          }
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/r2/buckets/locks.mjs
var Locks;
var init_locks = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/r2/buckets/locks.mjs"() {
    init_import_meta_url();
    init_resource();
    Locks = class extends APIResource {
      static {
        __name(this, "Locks");
      }
      /**
       * Set lock rules for a bucket.
       *
       * @example
       * ```ts
       * const lock = await client.r2.buckets.locks.update(
       *   'example-bucket',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      update(bucketName, params, options) {
        const { account_id, jurisdiction, ...body } = params;
        return this._client.put(`/accounts/${account_id}/r2/buckets/${bucketName}/lock`, {
          body,
          ...options,
          headers: {
            ...jurisdiction?.toString() != null ? { "cf-r2-jurisdiction": jurisdiction?.toString() } : void 0,
            ...options?.headers
          }
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get lock rules for a bucket.
       *
       * @example
       * ```ts
       * const lock = await client.r2.buckets.locks.get(
       *   'example-bucket',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(bucketName, params, options) {
        const { account_id, jurisdiction } = params;
        return this._client.get(`/accounts/${account_id}/r2/buckets/${bucketName}/lock`, {
          ...options,
          headers: {
            ...jurisdiction?.toString() != null ? { "cf-r2-jurisdiction": jurisdiction?.toString() } : void 0,
            ...options?.headers
          }
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/r2/buckets/metrics.mjs
var Metrics;
var init_metrics2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/r2/buckets/metrics.mjs"() {
    init_import_meta_url();
    init_resource();
    Metrics = class extends APIResource {
      static {
        __name(this, "Metrics");
      }
      /**
       * Get Storage/Object Count Metrics across all buckets in your account. Note that
       * Account-Level Metrics may not immediately reflect the latest data.
       *
       * @example
       * ```ts
       * const metrics = await client.r2.buckets.metrics.list({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      list(params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/r2/metrics`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/r2/buckets/sippy.mjs
var SippyResource;
var init_sippy = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/r2/buckets/sippy.mjs"() {
    init_import_meta_url();
    init_resource();
    SippyResource = class extends APIResource {
      static {
        __name(this, "SippyResource");
      }
      /**
       * Sets configuration for Sippy for an existing R2 bucket.
       *
       * @example
       * ```ts
       * const sippy = await client.r2.buckets.sippy.update(
       *   'example-bucket',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      update(bucketName, params, options) {
        const { account_id, jurisdiction, ...body } = params;
        return this._client.put(`/accounts/${account_id}/r2/buckets/${bucketName}/sippy`, {
          body,
          ...options,
          headers: {
            ...jurisdiction?.toString() != null ? { "cf-r2-jurisdiction": jurisdiction?.toString() } : void 0,
            ...options?.headers
          }
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Disables Sippy on this bucket.
       *
       * @example
       * ```ts
       * const sippy = await client.r2.buckets.sippy.delete(
       *   'example-bucket',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      delete(bucketName, params, options) {
        const { account_id, jurisdiction } = params;
        return this._client.delete(`/accounts/${account_id}/r2/buckets/${bucketName}/sippy`, {
          ...options,
          headers: {
            ...jurisdiction?.toString() != null ? { "cf-r2-jurisdiction": jurisdiction?.toString() } : void 0,
            ...options?.headers
          }
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Gets configuration for Sippy for an existing R2 bucket.
       *
       * @example
       * ```ts
       * const sippy = await client.r2.buckets.sippy.get(
       *   'example-bucket',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(bucketName, params, options) {
        const { account_id, jurisdiction } = params;
        return this._client.get(`/accounts/${account_id}/r2/buckets/${bucketName}/sippy`, {
          ...options,
          headers: {
            ...jurisdiction?.toString() != null ? { "cf-r2-jurisdiction": jurisdiction?.toString() } : void 0,
            ...options?.headers
          }
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/r2/buckets/domains/custom.mjs
var Custom;
var init_custom = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/r2/buckets/domains/custom.mjs"() {
    init_import_meta_url();
    init_resource();
    Custom = class extends APIResource {
      static {
        __name(this, "Custom");
      }
      /**
       * Register a new custom domain for an existing R2 bucket.
       *
       * @example
       * ```ts
       * const custom =
       *   await client.r2.buckets.domains.custom.create(
       *     'example-bucket',
       *     {
       *       account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *       domain: 'prefix.example-domain.com',
       *       enabled: true,
       *       zoneId: '36ca64a6d92827b8a6b90be344bb1bfd',
       *     },
       *   );
       * ```
       */
      create(bucketName, params, options) {
        const { account_id, jurisdiction, ...body } = params;
        return this._client.post(`/accounts/${account_id}/r2/buckets/${bucketName}/domains/custom`, {
          body,
          ...options,
          headers: {
            ...jurisdiction?.toString() != null ? { "cf-r2-jurisdiction": jurisdiction?.toString() } : void 0,
            ...options?.headers
          }
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Edit the configuration for a custom domain on an existing R2 bucket.
       *
       * @example
       * ```ts
       * const custom =
       *   await client.r2.buckets.domains.custom.update(
       *     'example-bucket',
       *     'example-domain/custom-domain.com',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      update(bucketName, domain2, params, options) {
        const { account_id, jurisdiction, ...body } = params;
        return this._client.put(`/accounts/${account_id}/r2/buckets/${bucketName}/domains/custom/${domain2}`, {
          body,
          ...options,
          headers: {
            ...jurisdiction?.toString() != null ? { "cf-r2-jurisdiction": jurisdiction?.toString() } : void 0,
            ...options?.headers
          }
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Gets a list of all custom domains registered with an existing R2 bucket.
       *
       * @example
       * ```ts
       * const customs = await client.r2.buckets.domains.custom.list(
       *   'example-bucket',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      list(bucketName, params, options) {
        const { account_id, jurisdiction } = params;
        return this._client.get(`/accounts/${account_id}/r2/buckets/${bucketName}/domains/custom`, {
          ...options,
          headers: {
            ...jurisdiction?.toString() != null ? { "cf-r2-jurisdiction": jurisdiction?.toString() } : void 0,
            ...options?.headers
          }
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Remove custom domain registration from an existing R2 bucket.
       *
       * @example
       * ```ts
       * const custom =
       *   await client.r2.buckets.domains.custom.delete(
       *     'example-bucket',
       *     'example-domain/custom-domain.com',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      delete(bucketName, domain2, params, options) {
        const { account_id, jurisdiction } = params;
        return this._client.delete(`/accounts/${account_id}/r2/buckets/${bucketName}/domains/custom/${domain2}`, {
          ...options,
          headers: {
            ...jurisdiction?.toString() != null ? { "cf-r2-jurisdiction": jurisdiction?.toString() } : void 0,
            ...options?.headers
          }
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get the configuration for a custom domain on an existing R2 bucket.
       *
       * @example
       * ```ts
       * const custom = await client.r2.buckets.domains.custom.get(
       *   'example-bucket',
       *   'example-domain/custom-domain.com',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(bucketName, domain2, params, options) {
        const { account_id, jurisdiction } = params;
        return this._client.get(`/accounts/${account_id}/r2/buckets/${bucketName}/domains/custom/${domain2}`, {
          ...options,
          headers: {
            ...jurisdiction?.toString() != null ? { "cf-r2-jurisdiction": jurisdiction?.toString() } : void 0,
            ...options?.headers
          }
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/r2/buckets/domains/managed.mjs
var Managed;
var init_managed = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/r2/buckets/domains/managed.mjs"() {
    init_import_meta_url();
    init_resource();
    Managed = class extends APIResource {
      static {
        __name(this, "Managed");
      }
      /**
       * Updates state of public access over the bucket's R2-managed (r2.dev) domain.
       *
       * @example
       * ```ts
       * const managed =
       *   await client.r2.buckets.domains.managed.update(
       *     'example-bucket',
       *     {
       *       account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *       enabled: true,
       *     },
       *   );
       * ```
       */
      update(bucketName, params, options) {
        const { account_id, jurisdiction, ...body } = params;
        return this._client.put(`/accounts/${account_id}/r2/buckets/${bucketName}/domains/managed`, {
          body,
          ...options,
          headers: {
            ...jurisdiction?.toString() != null ? { "cf-r2-jurisdiction": jurisdiction?.toString() } : void 0,
            ...options?.headers
          }
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Gets state of public access over the bucket's R2-managed (r2.dev) domain.
       *
       * @example
       * ```ts
       * const manageds =
       *   await client.r2.buckets.domains.managed.list(
       *     'example-bucket',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      list(bucketName, params, options) {
        const { account_id, jurisdiction } = params;
        return this._client.get(`/accounts/${account_id}/r2/buckets/${bucketName}/domains/managed`, {
          ...options,
          headers: {
            ...jurisdiction?.toString() != null ? { "cf-r2-jurisdiction": jurisdiction?.toString() } : void 0,
            ...options?.headers
          }
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/r2/buckets/domains/domains.mjs
var Domains4;
var init_domains4 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/r2/buckets/domains/domains.mjs"() {
    init_import_meta_url();
    init_resource();
    init_custom();
    init_custom();
    init_managed();
    init_managed();
    Domains4 = class extends APIResource {
      static {
        __name(this, "Domains");
      }
      constructor() {
        super(...arguments);
        this.custom = new Custom(this._client);
        this.managed = new Managed(this._client);
      }
    };
    Domains4.Custom = Custom;
    Domains4.Managed = Managed;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/r2/buckets/buckets.mjs
var Buckets;
var init_buckets = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/r2/buckets/buckets.mjs"() {
    init_import_meta_url();
    init_resource();
    init_cors();
    init_cors();
    init_event_notifications();
    init_event_notifications();
    init_lifecycle();
    init_lifecycle();
    init_locks();
    init_locks();
    init_metrics2();
    init_metrics2();
    init_sippy();
    init_sippy();
    init_domains4();
    init_domains4();
    Buckets = class extends APIResource {
      static {
        __name(this, "Buckets");
      }
      constructor() {
        super(...arguments);
        this.lifecycle = new Lifecycle(this._client);
        this.cors = new CORS(this._client);
        this.domains = new Domains4(this._client);
        this.eventNotifications = new EventNotifications(this._client);
        this.locks = new Locks(this._client);
        this.metrics = new Metrics(this._client);
        this.sippy = new SippyResource(this._client);
      }
      /**
       * Creates a new R2 bucket.
       *
       * @example
       * ```ts
       * const bucket = await client.r2.buckets.create({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   name: 'example-bucket',
       * });
       * ```
       */
      create(params, options) {
        const { account_id, jurisdiction, ...body } = params;
        return this._client.post(`/accounts/${account_id}/r2/buckets`, {
          body,
          ...options,
          headers: {
            ...jurisdiction?.toString() != null ? { "cf-r2-jurisdiction": jurisdiction?.toString() } : void 0,
            ...options?.headers
          }
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Lists all R2 buckets on your account.
       *
       * @example
       * ```ts
       * const buckets = await client.r2.buckets.list({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      list(params, options) {
        const { account_id, jurisdiction, ...query } = params;
        return this._client.get(`/accounts/${account_id}/r2/buckets`, {
          query,
          ...options,
          headers: {
            ...jurisdiction?.toString() != null ? { "cf-r2-jurisdiction": jurisdiction?.toString() } : void 0,
            ...options?.headers
          }
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Deletes an existing R2 bucket.
       *
       * @example
       * ```ts
       * const bucket = await client.r2.buckets.delete(
       *   'example-bucket',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      delete(bucketName, params, options) {
        const { account_id, jurisdiction } = params;
        return this._client.delete(`/accounts/${account_id}/r2/buckets/${bucketName}`, {
          ...options,
          headers: {
            ...jurisdiction?.toString() != null ? { "cf-r2-jurisdiction": jurisdiction?.toString() } : void 0,
            ...options?.headers
          }
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Updates properties of an existing R2 bucket.
       *
       * @example
       * ```ts
       * const bucket = await client.r2.buckets.edit(
       *   'example-bucket',
       *   {
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     storage_class: 'Standard',
       *   },
       * );
       * ```
       */
      edit(bucketName, params, options) {
        const { account_id, storage_class, jurisdiction } = params;
        return this._client.patch(`/accounts/${account_id}/r2/buckets/${bucketName}`, {
          ...options,
          headers: {
            "cf-r2-storage-class": storage_class.toString(),
            ...jurisdiction?.toString() != null ? { "cf-r2-jurisdiction": jurisdiction?.toString() } : void 0,
            ...options?.headers
          }
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Gets properties of an existing R2 bucket.
       *
       * @example
       * ```ts
       * const bucket = await client.r2.buckets.get(
       *   'example-bucket',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(bucketName, params, options) {
        const { account_id, jurisdiction } = params;
        return this._client.get(`/accounts/${account_id}/r2/buckets/${bucketName}`, {
          ...options,
          headers: {
            ...jurisdiction?.toString() != null ? { "cf-r2-jurisdiction": jurisdiction?.toString() } : void 0,
            ...options?.headers
          }
        })._thenUnwrap((obj) => obj.result);
      }
    };
    Buckets.Lifecycle = Lifecycle;
    Buckets.CORS = CORS;
    Buckets.Domains = Domains4;
    Buckets.EventNotifications = EventNotifications;
    Buckets.Locks = Locks;
    Buckets.Metrics = Metrics;
    Buckets.SippyResource = SippyResource;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/r2/super-slurper/connectivity-precheck.mjs
var ConnectivityPrecheck;
var init_connectivity_precheck = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/r2/super-slurper/connectivity-precheck.mjs"() {
    init_import_meta_url();
    init_resource();
    ConnectivityPrecheck = class extends APIResource {
      static {
        __name(this, "ConnectivityPrecheck");
      }
      /**
       * Check whether tokens are valid against the source bucket
       *
       * @example
       * ```ts
       * const response =
       *   await client.r2.superSlurper.connectivityPrecheck.source({
       *     account_id: 'account_id',
       *   });
       * ```
       */
      source(params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/slurper/source/connectivity-precheck`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Check whether tokens are valid against the target bucket
       *
       * @example
       * ```ts
       * const response =
       *   await client.r2.superSlurper.connectivityPrecheck.target({
       *     account_id: 'account_id',
       *   });
       * ```
       */
      target(params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/slurper/target/connectivity-precheck`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/r2/super-slurper/jobs/logs.mjs
var Logs5, LogListResponsesSinglePage;
var init_logs5 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/r2/super-slurper/jobs/logs.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Logs5 = class extends APIResource {
      static {
        __name(this, "Logs");
      }
      /**
       * Get job logs
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const logListResponse of client.r2.superSlurper.jobs.logs.list(
       *   'job_id',
       *   { account_id: 'account_id' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(jobId, params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/slurper/jobs/${jobId}/logs`, LogListResponsesSinglePage, { query, ...options });
      }
    };
    LogListResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "LogListResponsesSinglePage");
      }
    };
    Logs5.LogListResponsesSinglePage = LogListResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/r2/super-slurper/jobs/jobs.mjs
var Jobs3, JobListResponsesSinglePage;
var init_jobs3 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/r2/super-slurper/jobs/jobs.mjs"() {
    init_import_meta_url();
    init_resource();
    init_logs5();
    init_logs5();
    init_pagination();
    Jobs3 = class extends APIResource {
      static {
        __name(this, "Jobs");
      }
      constructor() {
        super(...arguments);
        this.logs = new Logs5(this._client);
      }
      /**
       * Create a job
       *
       * @example
       * ```ts
       * const job = await client.r2.superSlurper.jobs.create({
       *   account_id: 'account_id',
       * });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/slurper/jobs`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List jobs
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const jobListResponse of client.r2.superSlurper.jobs.list(
       *   { account_id: 'account_id' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/slurper/jobs`, JobListResponsesSinglePage, {
          query,
          ...options
        });
      }
      /**
       * Abort a job
       *
       * @example
       * ```ts
       * const response = await client.r2.superSlurper.jobs.abort(
       *   'job_id',
       *   { account_id: 'account_id' },
       * );
       * ```
       */
      abort(jobId, params, options) {
        const { account_id } = params;
        return this._client.put(`/accounts/${account_id}/slurper/jobs/${jobId}/abort`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Abort all jobs
       *
       * @example
       * ```ts
       * const response = await client.r2.superSlurper.jobs.abortAll(
       *   { account_id: 'account_id' },
       * );
       * ```
       */
      abortAll(params, options) {
        const { account_id } = params;
        return this._client.put(`/accounts/${account_id}/slurper/jobs/abortAll`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get job details
       *
       * @example
       * ```ts
       * const job = await client.r2.superSlurper.jobs.get(
       *   'job_id',
       *   { account_id: 'account_id' },
       * );
       * ```
       */
      get(jobId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/slurper/jobs/${jobId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Pause a job
       *
       * @example
       * ```ts
       * const response = await client.r2.superSlurper.jobs.pause(
       *   'job_id',
       *   { account_id: 'account_id' },
       * );
       * ```
       */
      pause(jobId, params, options) {
        const { account_id } = params;
        return this._client.put(`/accounts/${account_id}/slurper/jobs/${jobId}/pause`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get job progress
       *
       * @example
       * ```ts
       * const response = await client.r2.superSlurper.jobs.progress(
       *   'job_id',
       *   { account_id: 'account_id' },
       * );
       * ```
       */
      progress(jobId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/slurper/jobs/${jobId}/progress`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Resume a job
       *
       * @example
       * ```ts
       * const response = await client.r2.superSlurper.jobs.resume(
       *   'job_id',
       *   { account_id: 'account_id' },
       * );
       * ```
       */
      resume(jobId, params, options) {
        const { account_id } = params;
        return this._client.put(`/accounts/${account_id}/slurper/jobs/${jobId}/resume`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    JobListResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "JobListResponsesSinglePage");
      }
    };
    Jobs3.JobListResponsesSinglePage = JobListResponsesSinglePage;
    Jobs3.Logs = Logs5;
    Jobs3.LogListResponsesSinglePage = LogListResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/r2/super-slurper/super-slurper.mjs
var SuperSlurper;
var init_super_slurper = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/r2/super-slurper/super-slurper.mjs"() {
    init_import_meta_url();
    init_resource();
    init_connectivity_precheck();
    init_connectivity_precheck();
    init_jobs3();
    init_jobs3();
    SuperSlurper = class extends APIResource {
      static {
        __name(this, "SuperSlurper");
      }
      constructor() {
        super(...arguments);
        this.jobs = new Jobs3(this._client);
        this.connectivityPrecheck = new ConnectivityPrecheck(this._client);
      }
    };
    SuperSlurper.Jobs = Jobs3;
    SuperSlurper.JobListResponsesSinglePage = JobListResponsesSinglePage;
    SuperSlurper.ConnectivityPrecheck = ConnectivityPrecheck;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/r2/r2.mjs
var R22;
var init_r2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/r2/r2.mjs"() {
    init_import_meta_url();
    init_resource();
    init_temporary_credentials();
    init_temporary_credentials();
    init_buckets();
    init_buckets();
    init_super_slurper();
    init_super_slurper();
    R22 = class extends APIResource {
      static {
        __name(this, "R2");
      }
      constructor() {
        super(...arguments);
        this.buckets = new Buckets(this._client);
        this.temporaryCredentials = new TemporaryCredentials(this._client);
        this.superSlurper = new SuperSlurper(this._client);
      }
    };
    R22.Buckets = Buckets;
    R22.TemporaryCredentials = TemporaryCredentials;
    R22.SuperSlurper = SuperSlurper;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/rum/rules.mjs
var Rules6;
var init_rules7 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/rum/rules.mjs"() {
    init_import_meta_url();
    init_resource();
    Rules6 = class extends APIResource {
      static {
        __name(this, "Rules");
      }
      /**
       * Creates a new rule in a Web Analytics ruleset.
       *
       * @example
       * ```ts
       * const rumRule = await client.rum.rules.create(
       *   'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      create(rulesetId, params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/rum/v2/${rulesetId}/rule`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Updates a rule in a Web Analytics ruleset.
       *
       * @example
       * ```ts
       * const rumRule = await client.rum.rules.update(
       *   'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *   'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      update(rulesetId, ruleId, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/rum/v2/${rulesetId}/rule/${ruleId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Lists all the rules in a Web Analytics ruleset.
       *
       * @example
       * ```ts
       * const rules = await client.rum.rules.list(
       *   'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      list(rulesetId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/rum/v2/${rulesetId}/rules`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Deletes an existing rule from a Web Analytics ruleset.
       *
       * @example
       * ```ts
       * const rule = await client.rum.rules.delete(
       *   'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *   'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      delete(rulesetId, ruleId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/rum/v2/${rulesetId}/rule/${ruleId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Modifies one or more rules in a Web Analytics ruleset with a single request.
       *
       * @example
       * ```ts
       * const response = await client.rum.rules.bulkCreate(
       *   'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      bulkCreate(rulesetId, params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/rum/v2/${rulesetId}/rules`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/rum/site-info.mjs
var SiteInfo, SitesV4PagePaginationArray;
var init_site_info = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/rum/site-info.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    SiteInfo = class extends APIResource {
      static {
        __name(this, "SiteInfo");
      }
      /**
       * Creates a new Web Analytics site.
       *
       * @example
       * ```ts
       * const site = await client.rum.siteInfo.create({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/rum/site_info`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Updates an existing Web Analytics site.
       *
       * @example
       * ```ts
       * const site = await client.rum.siteInfo.update(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      update(siteId, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/rum/site_info/${siteId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Lists all Web Analytics sites of an account.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const site of client.rum.siteInfo.list({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * })) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/rum/site_info/list`, SitesV4PagePaginationArray, {
          query,
          ...options
        });
      }
      /**
       * Deletes an existing Web Analytics site.
       *
       * @example
       * ```ts
       * const siteInfo = await client.rum.siteInfo.delete(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      delete(siteId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/rum/site_info/${siteId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Retrieves a Web Analytics site.
       *
       * @example
       * ```ts
       * const site = await client.rum.siteInfo.get(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(siteId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/rum/site_info/${siteId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    SitesV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "SitesV4PagePaginationArray");
      }
    };
    SiteInfo.SitesV4PagePaginationArray = SitesV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/rum/rum.mjs
var RUM;
var init_rum = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/rum/rum.mjs"() {
    init_import_meta_url();
    init_resource();
    init_rules7();
    init_rules7();
    init_site_info();
    init_site_info();
    RUM = class extends APIResource {
      static {
        __name(this, "RUM");
      }
      constructor() {
        super(...arguments);
        this.siteInfo = new SiteInfo(this._client);
        this.rules = new Rules6(this._client);
      }
    };
    RUM.SiteInfo = SiteInfo;
    RUM.SitesV4PagePaginationArray = SitesV4PagePaginationArray;
    RUM.Rules = Rules6;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/datasets.mjs
var Datasets4;
var init_datasets4 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/datasets.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    Datasets4 = class extends APIResource {
      static {
        __name(this, "Datasets");
      }
      list(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.list({}, query);
        }
        return this._client.get("/radar/datasets", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Retrieves an URL to download a single dataset.
       *
       * @example
       * ```ts
       * const response = await client.radar.datasets.download({
       *   datasetId: 3,
       * });
       * ```
       */
      download(params, options) {
        const { format: format11, ...body } = params;
        return this._client.post("/radar/datasets/download", {
          query: { format: format11 },
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Retrieves the CSV content of a given dataset by alias or ID. When getting the
       * content by alias the latest dataset is returned, optionally filtered by the
       * latest available at a given date.
       *
       * @example
       * ```ts
       * const dataset = await client.radar.datasets.get(
       *   'ranking_top_1000',
       * );
       * ```
       */
      get(alias, options) {
        return this._client.get(`/radar/datasets/${alias}`, {
          ...options,
          headers: { Accept: "text/csv", ...options?.headers }
        });
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/search.mjs
var Search;
var init_search = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/search.mjs"() {
    init_import_meta_url();
    init_resource();
    Search = class extends APIResource {
      static {
        __name(this, "Search");
      }
      /**
       * Searches for locations, autonomous systems, reports, bots, certificate logs,
       * certificate authorities, industries and verticals
       *
       * @example
       * ```ts
       * const response = await client.radar.search.global({
       *   query: 'United',
       * });
       * ```
       */
      global(query, options) {
        return this._client.get("/radar/search/global", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/tcp-resets-timeouts.mjs
var TCPResetsTimeouts;
var init_tcp_resets_timeouts = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/tcp-resets-timeouts.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    TCPResetsTimeouts = class extends APIResource {
      static {
        __name(this, "TCPResetsTimeouts");
      }
      summary(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.summary({}, query);
        }
        return this._client.get("/radar/tcp_resets_timeouts/summary", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      timeseriesGroups(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.timeseriesGroups({}, query);
        }
        return this._client.get("/radar/tcp_resets_timeouts/timeseries_groups", {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/ai/timeseries-groups.mjs
var TimeseriesGroups;
var init_timeseries_groups = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/ai/timeseries-groups.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    TimeseriesGroups = class extends APIResource {
      static {
        __name(this, "TimeseriesGroups");
      }
      summary(dimension, query = {}, options) {
        if (isRequestOptions(query)) {
          return this.summary(dimension, {}, query);
        }
        return this._client.get(`/radar/ai/bots/summary/${dimension}`, { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      timeseries(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.timeseries({}, query);
        }
        return this._client.get("/radar/ai/bots/timeseries", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      timeseriesGroups(dimension, query = {}, options) {
        if (isRequestOptions(query)) {
          return this.timeseriesGroups(dimension, {}, query);
        }
        return this._client.get(`/radar/ai/bots/timeseries_groups/${dimension}`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      userAgent(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.userAgent({}, query);
        }
        return this._client.get("/radar/ai/bots/timeseries_groups/user_agent", {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/ai/to-markdown.mjs
var ToMarkdown2, ToMarkdownCreateResponsesSinglePage;
var init_to_markdown2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/ai/to-markdown.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    ToMarkdown2 = class extends APIResource {
      static {
        __name(this, "ToMarkdown");
      }
      /**
       * Convert Files into Markdown
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const toMarkdownCreateResponse of client.radar.ai.toMarkdown.create(
       *   fs.createReadStream('path/to/file'),
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      create(body, params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/ai/tomarkdown`, ToMarkdownCreateResponsesSinglePage, {
          body,
          method: "post",
          ...options,
          headers: { "Content-Type": "application/octet-stream", ...options?.headers },
          __binaryRequest: true
        });
      }
    };
    ToMarkdownCreateResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "ToMarkdownCreateResponsesSinglePage");
      }
    };
    ToMarkdown2.ToMarkdownCreateResponsesSinglePage = ToMarkdownCreateResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/ai/bots/summary.mjs
var Summary;
var init_summary = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/ai/bots/summary.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    Summary = class extends APIResource {
      static {
        __name(this, "Summary");
      }
      userAgent(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.userAgent({}, query);
        }
        return this._client.get("/radar/ai/bots/summary/user_agent", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/ai/bots/bots.mjs
var Bots;
var init_bots = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/ai/bots/bots.mjs"() {
    init_import_meta_url();
    init_resource();
    init_summary();
    init_summary();
    Bots = class extends APIResource {
      static {
        __name(this, "Bots");
      }
      constructor() {
        super(...arguments);
        this.summary = new Summary(this._client);
      }
    };
    Bots.Summary = Summary;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/ai/inference/summary.mjs
var Summary2;
var init_summary2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/ai/inference/summary.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    Summary2 = class extends APIResource {
      static {
        __name(this, "Summary");
      }
      model(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.model({}, query);
        }
        return this._client.get("/radar/ai/inference/summary/model", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      task(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.task({}, query);
        }
        return this._client.get("/radar/ai/inference/summary/task", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/ai/inference/timeseries-groups/summary.mjs
var Summary3;
var init_summary3 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/ai/inference/timeseries-groups/summary.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    Summary3 = class extends APIResource {
      static {
        __name(this, "Summary");
      }
      model(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.model({}, query);
        }
        return this._client.get("/radar/ai/inference/timeseries_groups/model", {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      task(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.task({}, query);
        }
        return this._client.get("/radar/ai/inference/timeseries_groups/task", {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/ai/inference/timeseries-groups/timeseries-groups.mjs
var TimeseriesGroups2;
var init_timeseries_groups2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/ai/inference/timeseries-groups/timeseries-groups.mjs"() {
    init_import_meta_url();
    init_resource();
    init_summary3();
    init_summary3();
    TimeseriesGroups2 = class extends APIResource {
      static {
        __name(this, "TimeseriesGroups");
      }
      constructor() {
        super(...arguments);
        this.summary = new Summary3(this._client);
      }
    };
    TimeseriesGroups2.Summary = Summary3;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/ai/inference/inference.mjs
var Inference;
var init_inference = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/ai/inference/inference.mjs"() {
    init_import_meta_url();
    init_resource();
    init_summary2();
    init_summary2();
    init_timeseries_groups2();
    init_timeseries_groups2();
    Inference = class extends APIResource {
      static {
        __name(this, "Inference");
      }
      constructor() {
        super(...arguments);
        this.summary = new Summary2(this._client);
        this.timeseriesGroups = new TimeseriesGroups2(this._client);
      }
    };
    Inference.Summary = Summary2;
    Inference.TimeseriesGroups = TimeseriesGroups2;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/ai/ai.mjs
var AI2;
var init_ai2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/ai/ai.mjs"() {
    init_import_meta_url();
    init_resource();
    init_timeseries_groups();
    init_timeseries_groups();
    init_to_markdown2();
    init_to_markdown2();
    init_bots();
    init_bots();
    init_inference();
    init_inference();
    AI2 = class extends APIResource {
      static {
        __name(this, "AI");
      }
      constructor() {
        super(...arguments);
        this.toMarkdown = new ToMarkdown2(this._client);
        this.inference = new Inference(this._client);
        this.bots = new Bots(this._client);
        this.timeseriesGroups = new TimeseriesGroups(this._client);
      }
    };
    AI2.ToMarkdown = ToMarkdown2;
    AI2.ToMarkdownCreateResponsesSinglePage = ToMarkdownCreateResponsesSinglePage;
    AI2.Inference = Inference;
    AI2.Bots = Bots;
    AI2.TimeseriesGroups = TimeseriesGroups;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/annotations/outages.mjs
var Outages;
var init_outages = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/annotations/outages.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    Outages = class extends APIResource {
      static {
        __name(this, "Outages");
      }
      get(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.get({}, query);
        }
        return this._client.get("/radar/annotations/outages", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      locations(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.locations({}, query);
        }
        return this._client.get("/radar/annotations/outages/locations", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/annotations/annotations.mjs
var Annotations;
var init_annotations = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/annotations/annotations.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    init_outages();
    init_outages();
    Annotations = class extends APIResource {
      static {
        __name(this, "Annotations");
      }
      constructor() {
        super(...arguments);
        this.outages = new Outages(this._client);
      }
      list(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.list({}, query);
        }
        return this._client.get("/radar/annotations", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
    };
    Annotations.Outages = Outages;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/as112/summary.mjs
var Summary4;
var init_summary4 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/as112/summary.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    Summary4 = class extends APIResource {
      static {
        __name(this, "Summary");
      }
      dnssec(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.dnssec({}, query);
        }
        return this._client.get("/radar/as112/summary/dnssec", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      edns(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.edns({}, query);
        }
        return this._client.get("/radar/as112/summary/edns", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      ipVersion(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.ipVersion({}, query);
        }
        return this._client.get("/radar/as112/summary/ip_version", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      protocol(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.protocol({}, query);
        }
        return this._client.get("/radar/as112/summary/protocol", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      queryType(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.queryType({}, query);
        }
        return this._client.get("/radar/as112/summary/query_type", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      responseCodes(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.responseCodes({}, query);
        }
        return this._client.get("/radar/as112/summary/response_codes", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/as112/timeseries-groups.mjs
var TimeseriesGroups3;
var init_timeseries_groups3 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/as112/timeseries-groups.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    TimeseriesGroups3 = class extends APIResource {
      static {
        __name(this, "TimeseriesGroups");
      }
      dnssec(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.dnssec({}, query);
        }
        return this._client.get("/radar/as112/timeseries_groups/dnssec", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      edns(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.edns({}, query);
        }
        return this._client.get("/radar/as112/timeseries_groups/edns", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      ipVersion(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.ipVersion({}, query);
        }
        return this._client.get("/radar/as112/timeseries_groups/ip_version", {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      protocol(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.protocol({}, query);
        }
        return this._client.get("/radar/as112/timeseries_groups/protocol", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      queryType(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.queryType({}, query);
        }
        return this._client.get("/radar/as112/timeseries_groups/query_type", {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      responseCodes(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.responseCodes({}, query);
        }
        return this._client.get("/radar/as112/timeseries_groups/response_codes", {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/as112/top.mjs
var Top;
var init_top = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/as112/top.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    Top = class extends APIResource {
      static {
        __name(this, "Top");
      }
      dnssec(dnssec, query = {}, options) {
        if (isRequestOptions(query)) {
          return this.dnssec(dnssec, {}, query);
        }
        return this._client.get(`/radar/as112/top/locations/dnssec/${dnssec}`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      edns(edns, query = {}, options) {
        if (isRequestOptions(query)) {
          return this.edns(edns, {}, query);
        }
        return this._client.get(`/radar/as112/top/locations/edns/${edns}`, { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      ipVersion(ipVersion, query = {}, options) {
        if (isRequestOptions(query)) {
          return this.ipVersion(ipVersion, {}, query);
        }
        return this._client.get(`/radar/as112/top/locations/ip_version/${ipVersion}`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      locations(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.locations({}, query);
        }
        return this._client.get("/radar/as112/top/locations", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/as112/as112.mjs
var AS112;
var init_as112 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/as112/as112.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    init_summary4();
    init_summary4();
    init_timeseries_groups3();
    init_timeseries_groups3();
    init_top();
    init_top();
    AS112 = class extends APIResource {
      static {
        __name(this, "AS112");
      }
      constructor() {
        super(...arguments);
        this.summary = new Summary4(this._client);
        this.timeseriesGroups = new TimeseriesGroups3(this._client);
        this.top = new Top(this._client);
      }
      timeseries(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.timeseries({}, query);
        }
        return this._client.get("/radar/as112/timeseries", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
    };
    AS112.Summary = Summary4;
    AS112.TimeseriesGroups = TimeseriesGroups3;
    AS112.Top = Top;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/attacks/layer3/summary.mjs
var Summary5;
var init_summary5 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/attacks/layer3/summary.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    Summary5 = class extends APIResource {
      static {
        __name(this, "Summary");
      }
      bitrate(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.bitrate({}, query);
        }
        return this._client.get("/radar/attacks/layer3/summary/bitrate", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      duration(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.duration({}, query);
        }
        return this._client.get("/radar/attacks/layer3/summary/duration", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      industry(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.industry({}, query);
        }
        return this._client.get("/radar/attacks/layer3/summary/industry", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      ipVersion(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.ipVersion({}, query);
        }
        return this._client.get("/radar/attacks/layer3/summary/ip_version", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      protocol(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.protocol({}, query);
        }
        return this._client.get("/radar/attacks/layer3/summary/protocol", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      vector(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.vector({}, query);
        }
        return this._client.get("/radar/attacks/layer3/summary/vector", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      vertical(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.vertical({}, query);
        }
        return this._client.get("/radar/attacks/layer3/summary/vertical", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/attacks/layer3/timeseries-groups.mjs
var TimeseriesGroups4;
var init_timeseries_groups4 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/attacks/layer3/timeseries-groups.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    TimeseriesGroups4 = class extends APIResource {
      static {
        __name(this, "TimeseriesGroups");
      }
      bitrate(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.bitrate({}, query);
        }
        return this._client.get("/radar/attacks/layer3/timeseries_groups/bitrate", {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      duration(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.duration({}, query);
        }
        return this._client.get("/radar/attacks/layer3/timeseries_groups/duration", {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      industry(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.industry({}, query);
        }
        return this._client.get("/radar/attacks/layer3/timeseries_groups/industry", {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      ipVersion(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.ipVersion({}, query);
        }
        return this._client.get("/radar/attacks/layer3/timeseries_groups/ip_version", {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      protocol(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.protocol({}, query);
        }
        return this._client.get("/radar/attacks/layer3/timeseries_groups/protocol", {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      vector(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.vector({}, query);
        }
        return this._client.get("/radar/attacks/layer3/timeseries_groups/vector", {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      vertical(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.vertical({}, query);
        }
        return this._client.get("/radar/attacks/layer3/timeseries_groups/vertical", {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/attacks/layer3/top/locations.mjs
var Locations;
var init_locations = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/attacks/layer3/top/locations.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    Locations = class extends APIResource {
      static {
        __name(this, "Locations");
      }
      origin(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.origin({}, query);
        }
        return this._client.get("/radar/attacks/layer3/top/locations/origin", {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      target(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.target({}, query);
        }
        return this._client.get("/radar/attacks/layer3/top/locations/target", {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/attacks/layer3/top/top.mjs
var Top2;
var init_top2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/attacks/layer3/top/top.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    init_locations();
    init_locations();
    Top2 = class extends APIResource {
      static {
        __name(this, "Top");
      }
      constructor() {
        super(...arguments);
        this.locations = new Locations(this._client);
      }
      attacks(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.attacks({}, query);
        }
        return this._client.get("/radar/attacks/layer3/top/attacks", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      industry(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.industry({}, query);
        }
        return this._client.get("/radar/attacks/layer3/top/industry", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      vertical(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.vertical({}, query);
        }
        return this._client.get("/radar/attacks/layer3/top/vertical", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
    };
    Top2.Locations = Locations;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/attacks/layer3/layer3.mjs
var Layer3;
var init_layer3 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/attacks/layer3/layer3.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    init_summary5();
    init_summary5();
    init_timeseries_groups4();
    init_timeseries_groups4();
    init_top2();
    init_top2();
    Layer3 = class extends APIResource {
      static {
        __name(this, "Layer3");
      }
      constructor() {
        super(...arguments);
        this.summary = new Summary5(this._client);
        this.timeseriesGroups = new TimeseriesGroups4(this._client);
        this.top = new Top2(this._client);
      }
      timeseries(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.timeseries({}, query);
        }
        return this._client.get("/radar/attacks/layer3/timeseries", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
    };
    Layer3.Summary = Summary5;
    Layer3.TimeseriesGroups = TimeseriesGroups4;
    Layer3.Top = Top2;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/attacks/layer7/summary.mjs
var Summary6;
var init_summary6 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/attacks/layer7/summary.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    Summary6 = class extends APIResource {
      static {
        __name(this, "Summary");
      }
      httpMethod(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.httpMethod({}, query);
        }
        return this._client.get("/radar/attacks/layer7/summary/http_method", {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      httpVersion(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.httpVersion({}, query);
        }
        return this._client.get("/radar/attacks/layer7/summary/http_version", {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      industry(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.industry({}, query);
        }
        return this._client.get("/radar/attacks/layer7/summary/industry", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      ipVersion(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.ipVersion({}, query);
        }
        return this._client.get("/radar/attacks/layer7/summary/ip_version", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      managedRules(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.managedRules({}, query);
        }
        return this._client.get("/radar/attacks/layer7/summary/managed_rules", {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      mitigationProduct(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.mitigationProduct({}, query);
        }
        return this._client.get("/radar/attacks/layer7/summary/mitigation_product", {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      vertical(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.vertical({}, query);
        }
        return this._client.get("/radar/attacks/layer7/summary/vertical", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/attacks/layer7/timeseries-groups.mjs
var TimeseriesGroups5;
var init_timeseries_groups5 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/attacks/layer7/timeseries-groups.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    TimeseriesGroups5 = class extends APIResource {
      static {
        __name(this, "TimeseriesGroups");
      }
      httpMethod(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.httpMethod({}, query);
        }
        return this._client.get("/radar/attacks/layer7/timeseries_groups/http_method", {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      httpVersion(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.httpVersion({}, query);
        }
        return this._client.get("/radar/attacks/layer7/timeseries_groups/http_version", {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      industry(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.industry({}, query);
        }
        return this._client.get("/radar/attacks/layer7/timeseries_groups/industry", {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      ipVersion(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.ipVersion({}, query);
        }
        return this._client.get("/radar/attacks/layer7/timeseries_groups/ip_version", {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      managedRules(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.managedRules({}, query);
        }
        return this._client.get("/radar/attacks/layer7/timeseries_groups/managed_rules", {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      mitigationProduct(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.mitigationProduct({}, query);
        }
        return this._client.get("/radar/attacks/layer7/timeseries_groups/mitigation_product", {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      vertical(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.vertical({}, query);
        }
        return this._client.get("/radar/attacks/layer7/timeseries_groups/vertical", {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/attacks/layer7/top/ases.mjs
var Ases;
var init_ases = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/attacks/layer7/top/ases.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    Ases = class extends APIResource {
      static {
        __name(this, "Ases");
      }
      origin(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.origin({}, query);
        }
        return this._client.get("/radar/attacks/layer7/top/ases/origin", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/attacks/layer7/top/locations.mjs
var Locations2;
var init_locations2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/attacks/layer7/top/locations.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    Locations2 = class extends APIResource {
      static {
        __name(this, "Locations");
      }
      origin(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.origin({}, query);
        }
        return this._client.get("/radar/attacks/layer7/top/locations/origin", {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      target(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.target({}, query);
        }
        return this._client.get("/radar/attacks/layer7/top/locations/target", {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/attacks/layer7/top/top.mjs
var Top3;
var init_top3 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/attacks/layer7/top/top.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    init_ases();
    init_ases();
    init_locations2();
    init_locations2();
    Top3 = class extends APIResource {
      static {
        __name(this, "Top");
      }
      constructor() {
        super(...arguments);
        this.locations = new Locations2(this._client);
        this.ases = new Ases(this._client);
      }
      attacks(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.attacks({}, query);
        }
        return this._client.get("/radar/attacks/layer7/top/attacks", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      industry(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.industry({}, query);
        }
        return this._client.get("/radar/attacks/layer7/top/industry", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      vertical(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.vertical({}, query);
        }
        return this._client.get("/radar/attacks/layer7/top/vertical", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
    };
    Top3.Locations = Locations2;
    Top3.Ases = Ases;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/attacks/layer7/layer7.mjs
var Layer7;
var init_layer7 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/attacks/layer7/layer7.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    init_summary6();
    init_summary6();
    init_timeseries_groups5();
    init_timeseries_groups5();
    init_top3();
    init_top3();
    Layer7 = class extends APIResource {
      static {
        __name(this, "Layer7");
      }
      constructor() {
        super(...arguments);
        this.summary = new Summary6(this._client);
        this.timeseriesGroups = new TimeseriesGroups5(this._client);
        this.top = new Top3(this._client);
      }
      timeseries(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.timeseries({}, query);
        }
        return this._client.get("/radar/attacks/layer7/timeseries", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
    };
    Layer7.Summary = Summary6;
    Layer7.TimeseriesGroups = TimeseriesGroups5;
    Layer7.Top = Top3;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/attacks/attacks.mjs
var Attacks;
var init_attacks = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/attacks/attacks.mjs"() {
    init_import_meta_url();
    init_resource();
    init_layer3();
    init_layer3();
    init_layer7();
    init_layer7();
    Attacks = class extends APIResource {
      static {
        __name(this, "Attacks");
      }
      constructor() {
        super(...arguments);
        this.layer3 = new Layer3(this._client);
        this.layer7 = new Layer7(this._client);
      }
    };
    Attacks.Layer3 = Layer3;
    Attacks.Layer7 = Layer7;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/bgp/ips.mjs
var IPs4;
var init_ips4 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/bgp/ips.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    IPs4 = class extends APIResource {
      static {
        __name(this, "IPs");
      }
      timeseries(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.timeseries({}, query);
        }
        return this._client.get("/radar/bgp/ips/timeseries", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/bgp/routes.mjs
var Routes2;
var init_routes2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/bgp/routes.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    Routes2 = class extends APIResource {
      static {
        __name(this, "Routes");
      }
      ases(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.ases({}, query);
        }
        return this._client.get("/radar/bgp/routes/ases", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      moas(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.moas({}, query);
        }
        return this._client.get("/radar/bgp/routes/moas", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      pfx2as(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.pfx2as({}, query);
        }
        return this._client.get("/radar/bgp/routes/pfx2as", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      realtime(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.realtime({}, query);
        }
        return this._client.get("/radar/bgp/routes/realtime", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      stats(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.stats({}, query);
        }
        return this._client.get("/radar/bgp/routes/stats", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/bgp/hijacks/events.mjs
var Events2, EventListResponsesV4PagePagination;
var init_events3 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/bgp/hijacks/events.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    init_pagination();
    Events2 = class extends APIResource {
      static {
        __name(this, "Events");
      }
      list(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.list({}, query);
        }
        return this._client.getAPIList("/radar/bgp/hijacks/events", EventListResponsesV4PagePagination, {
          query,
          ...options
        });
      }
    };
    EventListResponsesV4PagePagination = class extends V4PagePagination {
      static {
        __name(this, "EventListResponsesV4PagePagination");
      }
    };
    Events2.EventListResponsesV4PagePagination = EventListResponsesV4PagePagination;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/bgp/hijacks/hijacks.mjs
var Hijacks;
var init_hijacks = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/bgp/hijacks/hijacks.mjs"() {
    init_import_meta_url();
    init_resource();
    init_events3();
    init_events3();
    Hijacks = class extends APIResource {
      static {
        __name(this, "Hijacks");
      }
      constructor() {
        super(...arguments);
        this.events = new Events2(this._client);
      }
    };
    Hijacks.Events = Events2;
    Hijacks.EventListResponsesV4PagePagination = EventListResponsesV4PagePagination;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/bgp/leaks/events.mjs
var Events3, EventListResponsesV4PagePagination2;
var init_events4 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/bgp/leaks/events.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    init_pagination();
    Events3 = class extends APIResource {
      static {
        __name(this, "Events");
      }
      list(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.list({}, query);
        }
        return this._client.getAPIList("/radar/bgp/leaks/events", EventListResponsesV4PagePagination2, {
          query,
          ...options
        });
      }
    };
    EventListResponsesV4PagePagination2 = class extends V4PagePagination {
      static {
        __name(this, "EventListResponsesV4PagePagination");
      }
    };
    Events3.EventListResponsesV4PagePagination = EventListResponsesV4PagePagination2;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/bgp/leaks/leaks.mjs
var Leaks;
var init_leaks = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/bgp/leaks/leaks.mjs"() {
    init_import_meta_url();
    init_resource();
    init_events4();
    init_events4();
    Leaks = class extends APIResource {
      static {
        __name(this, "Leaks");
      }
      constructor() {
        super(...arguments);
        this.events = new Events3(this._client);
      }
    };
    Leaks.Events = Events3;
    Leaks.EventListResponsesV4PagePagination = EventListResponsesV4PagePagination2;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/bgp/top/ases.mjs
var Ases2;
var init_ases2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/bgp/top/ases.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    Ases2 = class extends APIResource {
      static {
        __name(this, "Ases");
      }
      get(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.get({}, query);
        }
        return this._client.get("/radar/bgp/top/ases", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      prefixes(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.prefixes({}, query);
        }
        return this._client.get("/radar/bgp/top/ases/prefixes", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/bgp/top/top.mjs
var Top4;
var init_top4 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/bgp/top/top.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    init_ases2();
    init_ases2();
    Top4 = class extends APIResource {
      static {
        __name(this, "Top");
      }
      constructor() {
        super(...arguments);
        this.ases = new Ases2(this._client);
      }
      prefixes(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.prefixes({}, query);
        }
        return this._client.get("/radar/bgp/top/prefixes", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
    };
    Top4.Ases = Ases2;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/bgp/bgp.mjs
var BGP;
var init_bgp = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/bgp/bgp.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    init_ips4();
    init_ips4();
    init_routes2();
    init_routes2();
    init_hijacks();
    init_hijacks();
    init_leaks();
    init_leaks();
    init_top4();
    init_top4();
    BGP = class extends APIResource {
      static {
        __name(this, "BGP");
      }
      constructor() {
        super(...arguments);
        this.leaks = new Leaks(this._client);
        this.top = new Top4(this._client);
        this.hijacks = new Hijacks(this._client);
        this.routes = new Routes2(this._client);
        this.ips = new IPs4(this._client);
      }
      timeseries(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.timeseries({}, query);
        }
        return this._client.get("/radar/bgp/timeseries", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
    };
    BGP.Leaks = Leaks;
    BGP.Top = Top4;
    BGP.Hijacks = Hijacks;
    BGP.Routes = Routes2;
    BGP.IPs = IPs4;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/bots/web-crawlers.mjs
var WebCrawlers;
var init_web_crawlers = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/bots/web-crawlers.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    WebCrawlers = class extends APIResource {
      static {
        __name(this, "WebCrawlers");
      }
      summary(dimension, query = {}, options) {
        if (isRequestOptions(query)) {
          return this.summary(dimension, {}, query);
        }
        return this._client.get(`/radar/bots/crawlers/summary/${dimension}`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      timeseriesGroups(dimension, query = {}, options) {
        if (isRequestOptions(query)) {
          return this.timeseriesGroups(dimension, {}, query);
        }
        return this._client.get(`/radar/bots/crawlers/timeseries_groups/${dimension}`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/bots/bots.mjs
var Bots2;
var init_bots2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/bots/bots.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    init_web_crawlers();
    init_web_crawlers();
    Bots2 = class extends APIResource {
      static {
        __name(this, "Bots");
      }
      constructor() {
        super(...arguments);
        this.webCrawlers = new WebCrawlers(this._client);
      }
      list(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.list({}, query);
        }
        return this._client.get("/radar/bots", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      get(botSlug, query = {}, options) {
        if (isRequestOptions(query)) {
          return this.get(botSlug, {}, query);
        }
        return this._client.get(`/radar/bots/${botSlug}`, { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      summary(dimension, query = {}, options) {
        if (isRequestOptions(query)) {
          return this.summary(dimension, {}, query);
        }
        return this._client.get(`/radar/bots/summary/${dimension}`, { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      timeseries(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.timeseries({}, query);
        }
        return this._client.get("/radar/bots/timeseries", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      timeseriesGroups(dimension, query = {}, options) {
        if (isRequestOptions(query)) {
          return this.timeseriesGroups(dimension, {}, query);
        }
        return this._client.get(`/radar/bots/timeseries_groups/${dimension}`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
    Bots2.WebCrawlers = WebCrawlers;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/ct/authorities.mjs
var Authorities;
var init_authorities = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/ct/authorities.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    Authorities = class extends APIResource {
      static {
        __name(this, "Authorities");
      }
      list(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.list({}, query);
        }
        return this._client.get("/radar/ct/authorities", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      get(caSlug, query = {}, options) {
        if (isRequestOptions(query)) {
          return this.get(caSlug, {}, query);
        }
        return this._client.get(`/radar/ct/authorities/${caSlug}`, { query, ...options })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/ct/logs.mjs
var Logs6;
var init_logs6 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/ct/logs.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    Logs6 = class extends APIResource {
      static {
        __name(this, "Logs");
      }
      list(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.list({}, query);
        }
        return this._client.get("/radar/ct/logs", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      get(logSlug, query = {}, options) {
        if (isRequestOptions(query)) {
          return this.get(logSlug, {}, query);
        }
        return this._client.get(`/radar/ct/logs/${logSlug}`, { query, ...options })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/ct/ct.mjs
var Ct2;
var init_ct = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/ct/ct.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    init_authorities();
    init_authorities();
    init_logs6();
    init_logs6();
    Ct2 = class extends APIResource {
      static {
        __name(this, "Ct");
      }
      constructor() {
        super(...arguments);
        this.authorities = new Authorities(this._client);
        this.logs = new Logs6(this._client);
      }
      summary(dimension, query = {}, options) {
        if (isRequestOptions(query)) {
          return this.summary(dimension, {}, query);
        }
        return this._client.get(`/radar/ct/summary/${dimension}`, { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      timeseries(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.timeseries({}, query);
        }
        return this._client.get("/radar/ct/timeseries", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      timeseriesGroups(dimension, query = {}, options) {
        if (isRequestOptions(query)) {
          return this.timeseriesGroups(dimension, {}, query);
        }
        return this._client.get(`/radar/ct/timeseries_groups/${dimension}`, { query, ...options })._thenUnwrap((obj) => obj.result);
      }
    };
    Ct2.Authorities = Authorities;
    Ct2.Logs = Logs6;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/dns/summary.mjs
var Summary7;
var init_summary7 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/dns/summary.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    Summary7 = class extends APIResource {
      static {
        __name(this, "Summary");
      }
      cacheHit(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.cacheHit({}, query);
        }
        return this._client.get("/radar/dns/summary/cache_hit", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      dnssec(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.dnssec({}, query);
        }
        return this._client.get("/radar/dns/summary/dnssec", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      dnssecAware(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.dnssecAware({}, query);
        }
        return this._client.get("/radar/dns/summary/dnssec_aware", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      dnssecE2E(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.dnssecE2E({}, query);
        }
        return this._client.get("/radar/dns/summary/dnssec_e2e", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      ipVersion(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.ipVersion({}, query);
        }
        return this._client.get("/radar/dns/summary/ip_version", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      matchingAnswer(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.matchingAnswer({}, query);
        }
        return this._client.get("/radar/dns/summary/matching_answer", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      protocol(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.protocol({}, query);
        }
        return this._client.get("/radar/dns/summary/protocol", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      queryType(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.queryType({}, query);
        }
        return this._client.get("/radar/dns/summary/query_type", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      responseCode(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.responseCode({}, query);
        }
        return this._client.get("/radar/dns/summary/response_code", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      responseTTL(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.responseTTL({}, query);
        }
        return this._client.get("/radar/dns/summary/response_ttl", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/dns/timeseries-groups.mjs
var TimeseriesGroups6;
var init_timeseries_groups6 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/dns/timeseries-groups.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    TimeseriesGroups6 = class extends APIResource {
      static {
        __name(this, "TimeseriesGroups");
      }
      cacheHit(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.cacheHit({}, query);
        }
        return this._client.get("/radar/dns/timeseries_groups/cache_hit", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      dnssec(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.dnssec({}, query);
        }
        return this._client.get("/radar/dns/timeseries_groups/dnssec", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      dnssecAware(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.dnssecAware({}, query);
        }
        return this._client.get("/radar/dns/timeseries_groups/dnssec_aware", {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      dnssecE2E(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.dnssecE2E({}, query);
        }
        return this._client.get("/radar/dns/timeseries_groups/dnssec_e2e", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      ipVersion(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.ipVersion({}, query);
        }
        return this._client.get("/radar/dns/timeseries_groups/ip_version", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      matchingAnswer(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.matchingAnswer({}, query);
        }
        return this._client.get("/radar/dns/timeseries_groups/matching_answer", {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      protocol(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.protocol({}, query);
        }
        return this._client.get("/radar/dns/timeseries_groups/protocol", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      queryType(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.queryType({}, query);
        }
        return this._client.get("/radar/dns/timeseries_groups/query_type", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      responseCode(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.responseCode({}, query);
        }
        return this._client.get("/radar/dns/timeseries_groups/response_code", {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      responseTTL(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.responseTTL({}, query);
        }
        return this._client.get("/radar/dns/timeseries_groups/response_ttl", {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/dns/top.mjs
var Top5;
var init_top5 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/dns/top.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    Top5 = class extends APIResource {
      static {
        __name(this, "Top");
      }
      ases(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.ases({}, query);
        }
        return this._client.get("/radar/dns/top/ases", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      locations(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.locations({}, query);
        }
        return this._client.get("/radar/dns/top/locations", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/dns/dns.mjs
var DNS4;
var init_dns4 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/dns/dns.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    init_summary7();
    init_summary7();
    init_timeseries_groups6();
    init_timeseries_groups6();
    init_top5();
    init_top5();
    DNS4 = class extends APIResource {
      static {
        __name(this, "DNS");
      }
      constructor() {
        super(...arguments);
        this.top = new Top5(this._client);
        this.summary = new Summary7(this._client);
        this.timeseriesGroups = new TimeseriesGroups6(this._client);
      }
      timeseries(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.timeseries({}, query);
        }
        return this._client.get("/radar/dns/timeseries", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
    };
    DNS4.Top = Top5;
    DNS4.Summary = Summary7;
    DNS4.TimeseriesGroups = TimeseriesGroups6;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/email/routing/summary.mjs
var Summary8;
var init_summary8 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/email/routing/summary.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    Summary8 = class extends APIResource {
      static {
        __name(this, "Summary");
      }
      arc(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.arc({}, query);
        }
        return this._client.get("/radar/email/routing/summary/arc", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      dkim(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.dkim({}, query);
        }
        return this._client.get("/radar/email/routing/summary/dkim", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      dmarc(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.dmarc({}, query);
        }
        return this._client.get("/radar/email/routing/summary/dmarc", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      encrypted(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.encrypted({}, query);
        }
        return this._client.get("/radar/email/routing/summary/encrypted", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      ipVersion(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.ipVersion({}, query);
        }
        return this._client.get("/radar/email/routing/summary/ip_version", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      spf(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.spf({}, query);
        }
        return this._client.get("/radar/email/routing/summary/spf", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/email/routing/timeseries-groups.mjs
var TimeseriesGroups7;
var init_timeseries_groups7 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/email/routing/timeseries-groups.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    TimeseriesGroups7 = class extends APIResource {
      static {
        __name(this, "TimeseriesGroups");
      }
      arc(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.arc({}, query);
        }
        return this._client.get("/radar/email/routing/timeseries_groups/arc", {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      dkim(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.dkim({}, query);
        }
        return this._client.get("/radar/email/routing/timeseries_groups/dkim", {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      dmarc(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.dmarc({}, query);
        }
        return this._client.get("/radar/email/routing/timeseries_groups/dmarc", {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      encrypted(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.encrypted({}, query);
        }
        return this._client.get("/radar/email/routing/timeseries_groups/encrypted", {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      ipVersion(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.ipVersion({}, query);
        }
        return this._client.get("/radar/email/routing/timeseries_groups/ip_version", {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      spf(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.spf({}, query);
        }
        return this._client.get("/radar/email/routing/timeseries_groups/spf", {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/email/routing/routing.mjs
var Routing;
var init_routing = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/email/routing/routing.mjs"() {
    init_import_meta_url();
    init_resource();
    init_summary8();
    init_summary8();
    init_timeseries_groups7();
    init_timeseries_groups7();
    Routing = class extends APIResource {
      static {
        __name(this, "Routing");
      }
      constructor() {
        super(...arguments);
        this.summary = new Summary8(this._client);
        this.timeseriesGroups = new TimeseriesGroups7(this._client);
      }
    };
    Routing.Summary = Summary8;
    Routing.TimeseriesGroups = TimeseriesGroups7;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/email/security/summary.mjs
var Summary9;
var init_summary9 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/email/security/summary.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    Summary9 = class extends APIResource {
      static {
        __name(this, "Summary");
      }
      arc(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.arc({}, query);
        }
        return this._client.get("/radar/email/security/summary/arc", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      dkim(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.dkim({}, query);
        }
        return this._client.get("/radar/email/security/summary/dkim", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      dmarc(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.dmarc({}, query);
        }
        return this._client.get("/radar/email/security/summary/dmarc", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      malicious(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.malicious({}, query);
        }
        return this._client.get("/radar/email/security/summary/malicious", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      spam(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.spam({}, query);
        }
        return this._client.get("/radar/email/security/summary/spam", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      spf(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.spf({}, query);
        }
        return this._client.get("/radar/email/security/summary/spf", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      spoof(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.spoof({}, query);
        }
        return this._client.get("/radar/email/security/summary/spoof", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      threatCategory(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.threatCategory({}, query);
        }
        return this._client.get("/radar/email/security/summary/threat_category", {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      tlsVersion(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.tlsVersion({}, query);
        }
        return this._client.get("/radar/email/security/summary/tls_version", {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/email/security/timeseries-groups.mjs
var TimeseriesGroups8;
var init_timeseries_groups8 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/email/security/timeseries-groups.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    TimeseriesGroups8 = class extends APIResource {
      static {
        __name(this, "TimeseriesGroups");
      }
      arc(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.arc({}, query);
        }
        return this._client.get("/radar/email/security/timeseries_groups/arc", {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      dkim(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.dkim({}, query);
        }
        return this._client.get("/radar/email/security/timeseries_groups/dkim", {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      dmarc(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.dmarc({}, query);
        }
        return this._client.get("/radar/email/security/timeseries_groups/dmarc", {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      malicious(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.malicious({}, query);
        }
        return this._client.get("/radar/email/security/timeseries_groups/malicious", {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      spam(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.spam({}, query);
        }
        return this._client.get("/radar/email/security/timeseries_groups/spam", {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      spf(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.spf({}, query);
        }
        return this._client.get("/radar/email/security/timeseries_groups/spf", {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      spoof(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.spoof({}, query);
        }
        return this._client.get("/radar/email/security/timeseries_groups/spoof", {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      threatCategory(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.threatCategory({}, query);
        }
        return this._client.get("/radar/email/security/timeseries_groups/threat_category", {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      tlsVersion(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.tlsVersion({}, query);
        }
        return this._client.get("/radar/email/security/timeseries_groups/tls_version", {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/email/security/top/tlds/malicious.mjs
var Malicious;
var init_malicious = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/email/security/top/tlds/malicious.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    Malicious = class extends APIResource {
      static {
        __name(this, "Malicious");
      }
      get(malicious, query = {}, options) {
        if (isRequestOptions(query)) {
          return this.get(malicious, {}, query);
        }
        return this._client.get(`/radar/email/security/top/tlds/malicious/${malicious}`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/email/security/top/tlds/spam.mjs
var Spam;
var init_spam = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/email/security/top/tlds/spam.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    Spam = class extends APIResource {
      static {
        __name(this, "Spam");
      }
      get(spam, query = {}, options) {
        if (isRequestOptions(query)) {
          return this.get(spam, {}, query);
        }
        return this._client.get(`/radar/email/security/top/tlds/spam/${spam}`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/email/security/top/tlds/spoof.mjs
var Spoof;
var init_spoof = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/email/security/top/tlds/spoof.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    Spoof = class extends APIResource {
      static {
        __name(this, "Spoof");
      }
      get(spoof, query = {}, options) {
        if (isRequestOptions(query)) {
          return this.get(spoof, {}, query);
        }
        return this._client.get(`/radar/email/security/top/tlds/spoof/${spoof}`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/email/security/top/tlds/tlds.mjs
var Tlds;
var init_tlds = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/email/security/top/tlds/tlds.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    init_malicious();
    init_malicious();
    init_spam();
    init_spam();
    init_spoof();
    init_spoof();
    Tlds = class extends APIResource {
      static {
        __name(this, "Tlds");
      }
      constructor() {
        super(...arguments);
        this.malicious = new Malicious(this._client);
        this.spam = new Spam(this._client);
        this.spoof = new Spoof(this._client);
      }
      get(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.get({}, query);
        }
        return this._client.get("/radar/email/security/top/tlds", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
    };
    Tlds.Malicious = Malicious;
    Tlds.Spam = Spam;
    Tlds.Spoof = Spoof;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/email/security/top/top.mjs
var Top6;
var init_top6 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/email/security/top/top.mjs"() {
    init_import_meta_url();
    init_resource();
    init_tlds();
    init_tlds();
    Top6 = class extends APIResource {
      static {
        __name(this, "Top");
      }
      constructor() {
        super(...arguments);
        this.tlds = new Tlds(this._client);
      }
    };
    Top6.Tlds = Tlds;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/email/security/security.mjs
var Security;
var init_security = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/email/security/security.mjs"() {
    init_import_meta_url();
    init_resource();
    init_summary9();
    init_summary9();
    init_timeseries_groups8();
    init_timeseries_groups8();
    init_top6();
    init_top6();
    Security = class extends APIResource {
      static {
        __name(this, "Security");
      }
      constructor() {
        super(...arguments);
        this.top = new Top6(this._client);
        this.summary = new Summary9(this._client);
        this.timeseriesGroups = new TimeseriesGroups8(this._client);
      }
    };
    Security.Top = Top6;
    Security.Summary = Summary9;
    Security.TimeseriesGroups = TimeseriesGroups8;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/email/email.mjs
var Email;
var init_email = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/email/email.mjs"() {
    init_import_meta_url();
    init_resource();
    init_routing();
    init_routing();
    init_security();
    init_security();
    Email = class extends APIResource {
      static {
        __name(this, "Email");
      }
      constructor() {
        super(...arguments);
        this.routing = new Routing(this._client);
        this.security = new Security(this._client);
      }
    };
    Email.Routing = Routing;
    Email.Security = Security;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/entities/asns.mjs
var ASNs;
var init_asns = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/entities/asns.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    ASNs = class extends APIResource {
      static {
        __name(this, "ASNs");
      }
      list(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.list({}, query);
        }
        return this._client.get("/radar/entities/asns", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      asSet(asn, query = {}, options) {
        if (isRequestOptions(query)) {
          return this.asSet(asn, {}, query);
        }
        return this._client.get(`/radar/entities/asns/${asn}/as_set`, { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      get(asn, query = {}, options) {
        if (isRequestOptions(query)) {
          return this.get(asn, {}, query);
        }
        return this._client.get(`/radar/entities/asns/${asn}`, { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Retrieves the requested autonomous system information based on IP address.
       * Population estimates come from APNIC (refer to https://labs.apnic.net/?p=526).
       *
       * @example
       * ```ts
       * const response = await client.radar.entities.asns.ip({
       *   ip: '8.8.8.8',
       * });
       * ```
       */
      ip(query, options) {
        return this._client.get("/radar/entities/asns/ip", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      rel(asn, query = {}, options) {
        if (isRequestOptions(query)) {
          return this.rel(asn, {}, query);
        }
        return this._client.get(`/radar/entities/asns/${asn}/rel`, { query, ...options })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/entities/locations.mjs
var Locations3;
var init_locations3 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/entities/locations.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    Locations3 = class extends APIResource {
      static {
        __name(this, "Locations");
      }
      list(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.list({}, query);
        }
        return this._client.get("/radar/entities/locations", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      get(location, query = {}, options) {
        if (isRequestOptions(query)) {
          return this.get(location, {}, query);
        }
        return this._client.get(`/radar/entities/locations/${location}`, { query, ...options })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/entities/entities.mjs
var Entities;
var init_entities = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/entities/entities.mjs"() {
    init_import_meta_url();
    init_resource();
    init_asns();
    init_asns();
    init_locations3();
    init_locations3();
    Entities = class extends APIResource {
      static {
        __name(this, "Entities");
      }
      constructor() {
        super(...arguments);
        this.asns = new ASNs(this._client);
        this.locations = new Locations3(this._client);
      }
      /**
       * Retrieves IP address information.
       *
       * @example
       * ```ts
       * const entity = await client.radar.entities.get({
       *   ip: '8.8.8.8',
       * });
       * ```
       */
      get(query, options) {
        return this._client.get("/radar/entities/ip", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
    };
    Entities.ASNs = ASNs;
    Entities.Locations = Locations3;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/http/summary.mjs
var Summary10;
var init_summary10 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/http/summary.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    Summary10 = class extends APIResource {
      static {
        __name(this, "Summary");
      }
      botClass(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.botClass({}, query);
        }
        return this._client.get("/radar/http/summary/bot_class", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      deviceType(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.deviceType({}, query);
        }
        return this._client.get("/radar/http/summary/device_type", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      httpProtocol(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.httpProtocol({}, query);
        }
        return this._client.get("/radar/http/summary/http_protocol", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      httpVersion(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.httpVersion({}, query);
        }
        return this._client.get("/radar/http/summary/http_version", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      ipVersion(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.ipVersion({}, query);
        }
        return this._client.get("/radar/http/summary/ip_version", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      os(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.os({}, query);
        }
        return this._client.get("/radar/http/summary/os", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      postQuantum(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.postQuantum({}, query);
        }
        return this._client.get("/radar/http/summary/post_quantum", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      tlsVersion(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.tlsVersion({}, query);
        }
        return this._client.get("/radar/http/summary/tls_version", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/http/timeseries-groups.mjs
var TimeseriesGroups9;
var init_timeseries_groups9 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/http/timeseries-groups.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    TimeseriesGroups9 = class extends APIResource {
      static {
        __name(this, "TimeseriesGroups");
      }
      botClass(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.botClass({}, query);
        }
        return this._client.get("/radar/http/timeseries_groups/bot_class", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      browser(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.browser({}, query);
        }
        return this._client.get("/radar/http/timeseries_groups/browser", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      browserFamily(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.browserFamily({}, query);
        }
        return this._client.get("/radar/http/timeseries_groups/browser_family", {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      deviceType(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.deviceType({}, query);
        }
        return this._client.get("/radar/http/timeseries_groups/device_type", {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      httpProtocol(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.httpProtocol({}, query);
        }
        return this._client.get("/radar/http/timeseries_groups/http_protocol", {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      httpVersion(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.httpVersion({}, query);
        }
        return this._client.get("/radar/http/timeseries_groups/http_version", {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      ipVersion(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.ipVersion({}, query);
        }
        return this._client.get("/radar/http/timeseries_groups/ip_version", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      os(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.os({}, query);
        }
        return this._client.get("/radar/http/timeseries_groups/os", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      postQuantum(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.postQuantum({}, query);
        }
        return this._client.get("/radar/http/timeseries_groups/post_quantum", {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      tlsVersion(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.tlsVersion({}, query);
        }
        return this._client.get("/radar/http/timeseries_groups/tls_version", {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/http/top.mjs
var Top7;
var init_top7 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/http/top.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    Top7 = class extends APIResource {
      static {
        __name(this, "Top");
      }
      browser(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.browser({}, query);
        }
        return this._client.get("/radar/http/top/browser", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      browserFamily(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.browserFamily({}, query);
        }
        return this._client.get("/radar/http/top/browser_family", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/http/ases/bot-class.mjs
var BotClass;
var init_bot_class = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/http/ases/bot-class.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    BotClass = class extends APIResource {
      static {
        __name(this, "BotClass");
      }
      get(botClass, query = {}, options) {
        if (isRequestOptions(query)) {
          return this.get(botClass, {}, query);
        }
        return this._client.get(`/radar/http/top/ases/bot_class/${botClass}`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/http/ases/browser-family.mjs
var BrowserFamily;
var init_browser_family = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/http/ases/browser-family.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    BrowserFamily = class extends APIResource {
      static {
        __name(this, "BrowserFamily");
      }
      get(browserFamily, query = {}, options) {
        if (isRequestOptions(query)) {
          return this.get(browserFamily, {}, query);
        }
        return this._client.get(`/radar/http/top/ases/browser_family/${browserFamily}`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/http/ases/device-type.mjs
var DeviceType;
var init_device_type = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/http/ases/device-type.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    DeviceType = class extends APIResource {
      static {
        __name(this, "DeviceType");
      }
      get(deviceType, query = {}, options) {
        if (isRequestOptions(query)) {
          return this.get(deviceType, {}, query);
        }
        return this._client.get(`/radar/http/top/ases/device_type/${deviceType}`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/http/ases/http-method.mjs
var HTTPMethod2;
var init_http_method = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/http/ases/http-method.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    HTTPMethod2 = class extends APIResource {
      static {
        __name(this, "HTTPMethod");
      }
      get(httpVersion, query = {}, options) {
        if (isRequestOptions(query)) {
          return this.get(httpVersion, {}, query);
        }
        return this._client.get(`/radar/http/top/ases/http_version/${httpVersion}`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/http/ases/http-protocol.mjs
var HTTPProtocol;
var init_http_protocol = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/http/ases/http-protocol.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    HTTPProtocol = class extends APIResource {
      static {
        __name(this, "HTTPProtocol");
      }
      get(httpProtocol, query = {}, options) {
        if (isRequestOptions(query)) {
          return this.get(httpProtocol, {}, query);
        }
        return this._client.get(`/radar/http/top/ases/http_protocol/${httpProtocol}`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/http/ases/ip-version.mjs
var IPVersion;
var init_ip_version = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/http/ases/ip-version.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    IPVersion = class extends APIResource {
      static {
        __name(this, "IPVersion");
      }
      get(ipVersion, query = {}, options) {
        if (isRequestOptions(query)) {
          return this.get(ipVersion, {}, query);
        }
        return this._client.get(`/radar/http/top/ases/ip_version/${ipVersion}`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/http/ases/os.mjs
var OS;
var init_os = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/http/ases/os.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    OS = class extends APIResource {
      static {
        __name(this, "OS");
      }
      get(os13, query = {}, options) {
        if (isRequestOptions(query)) {
          return this.get(os13, {}, query);
        }
        return this._client.get(`/radar/http/top/ases/os/${os13}`, { query, ...options })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/http/ases/tls-version.mjs
var TLSVersion;
var init_tls_version = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/http/ases/tls-version.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    TLSVersion = class extends APIResource {
      static {
        __name(this, "TLSVersion");
      }
      get(tlsVersion, query = {}, options) {
        if (isRequestOptions(query)) {
          return this.get(tlsVersion, {}, query);
        }
        return this._client.get(`/radar/http/top/ases/tls_version/${tlsVersion}`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/http/ases/ases.mjs
var Ases3;
var init_ases3 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/http/ases/ases.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    init_bot_class();
    init_bot_class();
    init_browser_family();
    init_browser_family();
    init_device_type();
    init_device_type();
    init_http_method();
    init_http_method();
    init_http_protocol();
    init_http_protocol();
    init_ip_version();
    init_ip_version();
    init_os();
    init_os();
    init_tls_version();
    init_tls_version();
    Ases3 = class extends APIResource {
      static {
        __name(this, "Ases");
      }
      constructor() {
        super(...arguments);
        this.botClass = new BotClass(this._client);
        this.deviceType = new DeviceType(this._client);
        this.httpProtocol = new HTTPProtocol(this._client);
        this.httpMethod = new HTTPMethod2(this._client);
        this.ipVersion = new IPVersion(this._client);
        this.os = new OS(this._client);
        this.tlsVersion = new TLSVersion(this._client);
        this.browserFamily = new BrowserFamily(this._client);
      }
      get(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.get({}, query);
        }
        return this._client.get("/radar/http/top/ases", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
    };
    Ases3.BotClass = BotClass;
    Ases3.DeviceType = DeviceType;
    Ases3.HTTPProtocol = HTTPProtocol;
    Ases3.HTTPMethod = HTTPMethod2;
    Ases3.IPVersion = IPVersion;
    Ases3.OS = OS;
    Ases3.TLSVersion = TLSVersion;
    Ases3.BrowserFamily = BrowserFamily;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/http/locations/bot-class.mjs
var BotClass2;
var init_bot_class2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/http/locations/bot-class.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    BotClass2 = class extends APIResource {
      static {
        __name(this, "BotClass");
      }
      get(botClass, query = {}, options) {
        if (isRequestOptions(query)) {
          return this.get(botClass, {}, query);
        }
        return this._client.get(`/radar/http/top/locations/bot_class/${botClass}`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/http/locations/browser-family.mjs
var BrowserFamily2;
var init_browser_family2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/http/locations/browser-family.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    BrowserFamily2 = class extends APIResource {
      static {
        __name(this, "BrowserFamily");
      }
      get(browserFamily, query = {}, options) {
        if (isRequestOptions(query)) {
          return this.get(browserFamily, {}, query);
        }
        return this._client.get(`/radar/http/top/locations/browser_family/${browserFamily}`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/http/locations/device-type.mjs
var DeviceType2;
var init_device_type2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/http/locations/device-type.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    DeviceType2 = class extends APIResource {
      static {
        __name(this, "DeviceType");
      }
      get(deviceType, query = {}, options) {
        if (isRequestOptions(query)) {
          return this.get(deviceType, {}, query);
        }
        return this._client.get(`/radar/http/top/locations/device_type/${deviceType}`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/http/locations/http-method.mjs
var HTTPMethod3;
var init_http_method2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/http/locations/http-method.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    HTTPMethod3 = class extends APIResource {
      static {
        __name(this, "HTTPMethod");
      }
      get(httpVersion, query = {}, options) {
        if (isRequestOptions(query)) {
          return this.get(httpVersion, {}, query);
        }
        return this._client.get(`/radar/http/top/locations/http_version/${httpVersion}`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/http/locations/http-protocol.mjs
var HTTPProtocol2;
var init_http_protocol2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/http/locations/http-protocol.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    HTTPProtocol2 = class extends APIResource {
      static {
        __name(this, "HTTPProtocol");
      }
      get(httpProtocol, query = {}, options) {
        if (isRequestOptions(query)) {
          return this.get(httpProtocol, {}, query);
        }
        return this._client.get(`/radar/http/top/locations/http_protocol/${httpProtocol}`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/http/locations/ip-version.mjs
var IPVersion2;
var init_ip_version2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/http/locations/ip-version.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    IPVersion2 = class extends APIResource {
      static {
        __name(this, "IPVersion");
      }
      get(ipVersion, query = {}, options) {
        if (isRequestOptions(query)) {
          return this.get(ipVersion, {}, query);
        }
        return this._client.get(`/radar/http/top/locations/ip_version/${ipVersion}`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/http/locations/os.mjs
var OS2;
var init_os2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/http/locations/os.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    OS2 = class extends APIResource {
      static {
        __name(this, "OS");
      }
      get(os13, query = {}, options) {
        if (isRequestOptions(query)) {
          return this.get(os13, {}, query);
        }
        return this._client.get(`/radar/http/top/locations/os/${os13}`, { query, ...options })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/http/locations/tls-version.mjs
var TLSVersion2;
var init_tls_version2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/http/locations/tls-version.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    TLSVersion2 = class extends APIResource {
      static {
        __name(this, "TLSVersion");
      }
      get(tlsVersion, query = {}, options) {
        if (isRequestOptions(query)) {
          return this.get(tlsVersion, {}, query);
        }
        return this._client.get(`/radar/http/top/locations/tls_version/${tlsVersion}`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/http/locations/locations.mjs
var Locations4;
var init_locations4 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/http/locations/locations.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    init_bot_class2();
    init_bot_class2();
    init_browser_family2();
    init_browser_family2();
    init_device_type2();
    init_device_type2();
    init_http_method2();
    init_http_method2();
    init_http_protocol2();
    init_http_protocol2();
    init_ip_version2();
    init_ip_version2();
    init_os2();
    init_os2();
    init_tls_version2();
    init_tls_version2();
    Locations4 = class extends APIResource {
      static {
        __name(this, "Locations");
      }
      constructor() {
        super(...arguments);
        this.botClass = new BotClass2(this._client);
        this.deviceType = new DeviceType2(this._client);
        this.httpProtocol = new HTTPProtocol2(this._client);
        this.httpMethod = new HTTPMethod3(this._client);
        this.ipVersion = new IPVersion2(this._client);
        this.os = new OS2(this._client);
        this.tlsVersion = new TLSVersion2(this._client);
        this.browserFamily = new BrowserFamily2(this._client);
      }
      get(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.get({}, query);
        }
        return this._client.get("/radar/http/top/locations", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
    };
    Locations4.BotClass = BotClass2;
    Locations4.DeviceType = DeviceType2;
    Locations4.HTTPProtocol = HTTPProtocol2;
    Locations4.HTTPMethod = HTTPMethod3;
    Locations4.IPVersion = IPVersion2;
    Locations4.OS = OS2;
    Locations4.TLSVersion = TLSVersion2;
    Locations4.BrowserFamily = BrowserFamily2;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/http/http.mjs
var HTTP;
var init_http = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/http/http.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    init_summary10();
    init_summary10();
    init_timeseries_groups9();
    init_timeseries_groups9();
    init_top7();
    init_top7();
    init_ases3();
    init_ases3();
    init_locations4();
    init_locations4();
    HTTP = class extends APIResource {
      static {
        __name(this, "HTTP");
      }
      constructor() {
        super(...arguments);
        this.locations = new Locations4(this._client);
        this.ases = new Ases3(this._client);
        this.summary = new Summary10(this._client);
        this.timeseriesGroups = new TimeseriesGroups9(this._client);
        this.top = new Top7(this._client);
      }
      timeseries(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.timeseries({}, query);
        }
        return this._client.get("/radar/http/timeseries", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
    };
    HTTP.Locations = Locations4;
    HTTP.Ases = Ases3;
    HTTP.Summary = Summary10;
    HTTP.TimeseriesGroups = TimeseriesGroups9;
    HTTP.Top = Top7;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/leaked-credentials/summary.mjs
var Summary11;
var init_summary11 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/leaked-credentials/summary.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    Summary11 = class extends APIResource {
      static {
        __name(this, "Summary");
      }
      botClass(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.botClass({}, query);
        }
        return this._client.get("/radar/leaked_credential_checks/summary/bot_class", {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      compromised(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.compromised({}, query);
        }
        return this._client.get("/radar/leaked_credential_checks/summary/compromised", {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/leaked-credentials/timeseries-groups.mjs
var TimeseriesGroups10;
var init_timeseries_groups10 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/leaked-credentials/timeseries-groups.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    TimeseriesGroups10 = class extends APIResource {
      static {
        __name(this, "TimeseriesGroups");
      }
      botClass(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.botClass({}, query);
        }
        return this._client.get("/radar/leaked_credential_checks/timeseries_groups/bot_class", {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      compromised(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.compromised({}, query);
        }
        return this._client.get("/radar/leaked_credential_checks/timeseries_groups/compromised", {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/leaked-credentials/leaked-credentials.mjs
var LeakedCredentials;
var init_leaked_credentials = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/leaked-credentials/leaked-credentials.mjs"() {
    init_import_meta_url();
    init_resource();
    init_summary11();
    init_summary11();
    init_timeseries_groups10();
    init_timeseries_groups10();
    LeakedCredentials = class extends APIResource {
      static {
        __name(this, "LeakedCredentials");
      }
      constructor() {
        super(...arguments);
        this.summary = new Summary11(this._client);
        this.timeseriesGroups = new TimeseriesGroups10(this._client);
      }
    };
    LeakedCredentials.Summary = Summary11;
    LeakedCredentials.TimeseriesGroups = TimeseriesGroups10;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/netflows/top.mjs
var Top8;
var init_top8 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/netflows/top.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    Top8 = class extends APIResource {
      static {
        __name(this, "Top");
      }
      ases(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.ases({}, query);
        }
        return this._client.get("/radar/netflows/top/ases", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      locations(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.locations({}, query);
        }
        return this._client.get("/radar/netflows/top/locations", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/netflows/netflows.mjs
var Netflows;
var init_netflows = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/netflows/netflows.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    init_top8();
    init_top8();
    Netflows = class extends APIResource {
      static {
        __name(this, "Netflows");
      }
      constructor() {
        super(...arguments);
        this.top = new Top8(this._client);
      }
      summary(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.summary({}, query);
        }
        return this._client.get("/radar/netflows/summary", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      timeseries(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.timeseries({}, query);
        }
        return this._client.get("/radar/netflows/timeseries", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
    };
    Netflows.Top = Top8;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/quality/iqi.mjs
var IQI;
var init_iqi = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/quality/iqi.mjs"() {
    init_import_meta_url();
    init_resource();
    IQI = class extends APIResource {
      static {
        __name(this, "IQI");
      }
      /**
       * Retrieves a summary (percentiles) of bandwidth, latency, or DNS response time
       * from the Radar Internet Quality Index (IQI).
       *
       * @example
       * ```ts
       * const response = await client.radar.quality.iqi.summary({
       *   metric: 'BANDWIDTH',
       * });
       * ```
       */
      summary(query, options) {
        return this._client.get("/radar/quality/iqi/summary", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Retrieves a time series (percentiles) of bandwidth, latency, or DNS response
       * time from the Radar Internet Quality Index (IQI).
       *
       * @example
       * ```ts
       * const response =
       *   await client.radar.quality.iqi.timeseriesGroups({
       *     metric: 'BANDWIDTH',
       *   });
       * ```
       */
      timeseriesGroups(query, options) {
        return this._client.get("/radar/quality/iqi/timeseries_groups", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/quality/speed/top.mjs
var Top9;
var init_top9 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/quality/speed/top.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    Top9 = class extends APIResource {
      static {
        __name(this, "Top");
      }
      ases(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.ases({}, query);
        }
        return this._client.get("/radar/quality/speed/top/ases", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      locations(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.locations({}, query);
        }
        return this._client.get("/radar/quality/speed/top/locations", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/quality/speed/speed.mjs
var Speed;
var init_speed = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/quality/speed/speed.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    init_top9();
    init_top9();
    Speed = class extends APIResource {
      static {
        __name(this, "Speed");
      }
      constructor() {
        super(...arguments);
        this.top = new Top9(this._client);
      }
      histogram(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.histogram({}, query);
        }
        return this._client.get("/radar/quality/speed/histogram", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      summary(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.summary({}, query);
        }
        return this._client.get("/radar/quality/speed/summary", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
    };
    Speed.Top = Top9;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/quality/quality.mjs
var Quality;
var init_quality = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/quality/quality.mjs"() {
    init_import_meta_url();
    init_resource();
    init_iqi();
    init_iqi();
    init_speed();
    init_speed();
    Quality = class extends APIResource {
      static {
        __name(this, "Quality");
      }
      constructor() {
        super(...arguments);
        this.iqi = new IQI(this._client);
        this.speed = new Speed(this._client);
      }
    };
    Quality.IQI = IQI;
    Quality.Speed = Speed;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/ranking/domain.mjs
var Domain;
var init_domain = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/ranking/domain.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    Domain = class extends APIResource {
      static {
        __name(this, "Domain");
      }
      get(domain2, query = {}, options) {
        if (isRequestOptions(query)) {
          return this.get(domain2, {}, query);
        }
        return this._client.get(`/radar/ranking/domain/${domain2}`, { query, ...options })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/ranking/internet-services.mjs
var InternetServices;
var init_internet_services = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/ranking/internet-services.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    InternetServices = class extends APIResource {
      static {
        __name(this, "InternetServices");
      }
      categories(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.categories({}, query);
        }
        return this._client.get("/radar/ranking/internet_services/categories", {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      timeseriesGroups(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.timeseriesGroups({}, query);
        }
        return this._client.get("/radar/ranking/internet_services/timeseries_groups", {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      top(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.top({}, query);
        }
        return this._client.get("/radar/ranking/internet_services/top", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/ranking/ranking.mjs
var Ranking;
var init_ranking = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/ranking/ranking.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    init_domain();
    init_domain();
    init_internet_services();
    init_internet_services();
    Ranking = class extends APIResource {
      static {
        __name(this, "Ranking");
      }
      constructor() {
        super(...arguments);
        this.domain = new Domain(this._client);
        this.internetServices = new InternetServices(this._client);
      }
      timeseriesGroups(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.timeseriesGroups({}, query);
        }
        return this._client.get("/radar/ranking/timeseries_groups", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      top(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.top({}, query);
        }
        return this._client.get("/radar/ranking/top", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
    };
    Ranking.Domain = Domain;
    Ranking.InternetServices = InternetServices;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/robots-txt/top/user-agents.mjs
var UserAgents;
var init_user_agents = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/robots-txt/top/user-agents.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    UserAgents = class extends APIResource {
      static {
        __name(this, "UserAgents");
      }
      directive(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.directive({}, query);
        }
        return this._client.get("/radar/robots_txt/top/user_agents/directive", {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/robots-txt/top/top.mjs
var Top10;
var init_top10 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/robots-txt/top/top.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    init_user_agents();
    init_user_agents();
    Top10 = class extends APIResource {
      static {
        __name(this, "Top");
      }
      constructor() {
        super(...arguments);
        this.userAgents = new UserAgents(this._client);
      }
      domainCategories(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.domainCategories({}, query);
        }
        return this._client.get("/radar/robots_txt/top/domain_categories", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
    };
    Top10.UserAgents = UserAgents;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/robots-txt/robots-txt.mjs
var RobotsTXT;
var init_robots_txt = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/robots-txt/robots-txt.mjs"() {
    init_import_meta_url();
    init_resource();
    init_top10();
    init_top10();
    RobotsTXT = class extends APIResource {
      static {
        __name(this, "RobotsTXT");
      }
      constructor() {
        super(...arguments);
        this.top = new Top10(this._client);
      }
    };
    RobotsTXT.Top = Top10;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/traffic-anomalies/locations.mjs
var Locations5;
var init_locations5 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/traffic-anomalies/locations.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    Locations5 = class extends APIResource {
      static {
        __name(this, "Locations");
      }
      get(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.get({}, query);
        }
        return this._client.get("/radar/traffic_anomalies/locations", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/traffic-anomalies/traffic-anomalies.mjs
var TrafficAnomalies;
var init_traffic_anomalies = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/traffic-anomalies/traffic-anomalies.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    init_locations5();
    init_locations5();
    TrafficAnomalies = class extends APIResource {
      static {
        __name(this, "TrafficAnomalies");
      }
      constructor() {
        super(...arguments);
        this.locations = new Locations5(this._client);
      }
      get(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.get({}, query);
        }
        return this._client.get("/radar/traffic_anomalies", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
    };
    TrafficAnomalies.Locations = Locations5;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/verified-bots/top.mjs
var Top11;
var init_top11 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/verified-bots/top.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    Top11 = class extends APIResource {
      static {
        __name(this, "Top");
      }
      bots(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.bots({}, query);
        }
        return this._client.get("/radar/verified_bots/top/bots", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
      categories(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.categories({}, query);
        }
        return this._client.get("/radar/verified_bots/top/categories", { query, ...options })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/verified-bots/verified-bots.mjs
var VerifiedBots;
var init_verified_bots = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/verified-bots/verified-bots.mjs"() {
    init_import_meta_url();
    init_resource();
    init_top11();
    init_top11();
    VerifiedBots = class extends APIResource {
      static {
        __name(this, "VerifiedBots");
      }
      constructor() {
        super(...arguments);
        this.top = new Top11(this._client);
      }
    };
    VerifiedBots.Top = Top11;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/radar.mjs
var Radar;
var init_radar = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/radar/radar.mjs"() {
    init_import_meta_url();
    init_resource();
    init_datasets4();
    init_datasets4();
    init_search();
    init_search();
    init_tcp_resets_timeouts();
    init_tcp_resets_timeouts();
    init_ai2();
    init_ai2();
    init_annotations();
    init_annotations();
    init_as112();
    init_as112();
    init_attacks();
    init_attacks();
    init_bgp();
    init_bgp();
    init_bots2();
    init_bots2();
    init_ct();
    init_ct();
    init_dns4();
    init_dns4();
    init_email();
    init_email();
    init_entities();
    init_entities();
    init_http();
    init_http();
    init_leaked_credentials();
    init_leaked_credentials();
    init_netflows();
    init_netflows();
    init_quality();
    init_quality();
    init_ranking();
    init_ranking();
    init_robots_txt();
    init_robots_txt();
    init_traffic_anomalies();
    init_traffic_anomalies();
    init_verified_bots();
    init_verified_bots();
    Radar = class extends APIResource {
      static {
        __name(this, "Radar");
      }
      constructor() {
        super(...arguments);
        this.ai = new AI2(this._client);
        this.ct = new Ct2(this._client);
        this.annotations = new Annotations(this._client);
        this.bgp = new BGP(this._client);
        this.bots = new Bots2(this._client);
        this.datasets = new Datasets4(this._client);
        this.dns = new DNS4(this._client);
        this.netflows = new Netflows(this._client);
        this.search = new Search(this._client);
        this.verifiedBots = new VerifiedBots(this._client);
        this.as112 = new AS112(this._client);
        this.email = new Email(this._client);
        this.attacks = new Attacks(this._client);
        this.entities = new Entities(this._client);
        this.http = new HTTP(this._client);
        this.quality = new Quality(this._client);
        this.ranking = new Ranking(this._client);
        this.trafficAnomalies = new TrafficAnomalies(this._client);
        this.tcpResetsTimeouts = new TCPResetsTimeouts(this._client);
        this.robotsTXT = new RobotsTXT(this._client);
        this.leakedCredentials = new LeakedCredentials(this._client);
      }
    };
    Radar.AI = AI2;
    Radar.Ct = Ct2;
    Radar.Annotations = Annotations;
    Radar.BGP = BGP;
    Radar.Bots = Bots2;
    Radar.Datasets = Datasets4;
    Radar.DNS = DNS4;
    Radar.Netflows = Netflows;
    Radar.Search = Search;
    Radar.VerifiedBots = VerifiedBots;
    Radar.AS112 = AS112;
    Radar.Email = Email;
    Radar.Attacks = Attacks;
    Radar.Entities = Entities;
    Radar.HTTP = HTTP;
    Radar.Quality = Quality;
    Radar.Ranking = Ranking;
    Radar.TrafficAnomalies = TrafficAnomalies;
    Radar.TCPResetsTimeouts = TCPResetsTimeouts;
    Radar.RobotsTXT = RobotsTXT;
    Radar.LeakedCredentials = LeakedCredentials;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/rate-limits.mjs
var RateLimits, RateLimitsV4PagePaginationArray;
var init_rate_limits = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/rate-limits.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    RateLimits = class extends APIResource {
      static {
        __name(this, "RateLimits");
      }
      /**
       * Creates a new rate limit for a zone. Refer to the object definition for a list
       * of required attributes.
       *
       * @deprecated Rate limiting API is deprecated in favour of using the Ruleset Engine. See https://developers.cloudflare.com/fundamentals/api/reference/deprecations/#rate-limiting-api-previous-version for full details.
       */
      create(params, options) {
        const { zone_id, ...body } = params;
        return this._client.post(`/zones/${zone_id}/rate_limits`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetches the rate limits for a zone.
       *
       * @deprecated Rate limiting API is deprecated in favour of using the Ruleset Engine. See https://developers.cloudflare.com/fundamentals/api/reference/deprecations/#rate-limiting-api-previous-version for full details.
       */
      list(params, options) {
        const { zone_id, ...query } = params;
        return this._client.getAPIList(`/zones/${zone_id}/rate_limits`, RateLimitsV4PagePaginationArray, {
          query,
          ...options
        });
      }
      /**
       * Deletes an existing rate limit.
       *
       * @deprecated Rate limiting API is deprecated in favour of using the Ruleset Engine. See https://developers.cloudflare.com/fundamentals/api/reference/deprecations/#rate-limiting-api-previous-version for full details.
       */
      delete(rateLimitId, params, options) {
        const { zone_id } = params;
        return this._client.delete(`/zones/${zone_id}/rate_limits/${rateLimitId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Updates an existing rate limit.
       *
       * @deprecated Rate limiting API is deprecated in favour of using the Ruleset Engine. See https://developers.cloudflare.com/fundamentals/api/reference/deprecations/#rate-limiting-api-previous-version for full details.
       */
      edit(rateLimitId, params, options) {
        const { zone_id, ...body } = params;
        return this._client.put(`/zones/${zone_id}/rate_limits/${rateLimitId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetches the details of a rate limit.
       *
       * @deprecated Rate limiting API is deprecated in favour of using the Ruleset Engine. See https://developers.cloudflare.com/fundamentals/api/reference/deprecations/#rate-limiting-api-previous-version for full details.
       */
      get(rateLimitId, params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/rate_limits/${rateLimitId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    RateLimitsV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "RateLimitsV4PagePaginationArray");
      }
    };
    RateLimits.RateLimitsV4PagePaginationArray = RateLimitsV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/registrar/domains.mjs
var Domains5, DomainsSinglePage;
var init_domains5 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/registrar/domains.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Domains5 = class extends APIResource {
      static {
        __name(this, "Domains");
      }
      /**
       * Update individual domain.
       *
       * @example
       * ```ts
       * const domain = await client.registrar.domains.update(
       *   'cloudflare.com',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      update(domainName, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/registrar/domains/${domainName}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List domains handled by Registrar.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const domain of client.registrar.domains.list({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * })) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/registrar/domains`, DomainsSinglePage, options);
      }
      /**
       * Show individual domain.
       *
       * @example
       * ```ts
       * const domain = await client.registrar.domains.get(
       *   'cloudflare.com',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(domainName, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/registrar/domains/${domainName}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    DomainsSinglePage = class extends SinglePage {
      static {
        __name(this, "DomainsSinglePage");
      }
    };
    Domains5.DomainsSinglePage = DomainsSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/registrar/registrar.mjs
var Registrar;
var init_registrar = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/registrar/registrar.mjs"() {
    init_import_meta_url();
    init_resource();
    init_domains5();
    init_domains5();
    Registrar = class extends APIResource {
      static {
        __name(this, "Registrar");
      }
      constructor() {
        super(...arguments);
        this.domains = new Domains5(this._client);
      }
    };
    Registrar.Domains = Domains5;
    Registrar.DomainsSinglePage = DomainsSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/request-tracers/traces.mjs
var Traces;
var init_traces = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/request-tracers/traces.mjs"() {
    init_import_meta_url();
    init_resource();
    Traces = class extends APIResource {
      static {
        __name(this, "Traces");
      }
      /**
       * Request Trace
       *
       * @example
       * ```ts
       * const trace = await client.requestTracers.traces.create({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   method: 'PUT',
       *   url: 'https://some.zone/some_path',
       *   body: { base64: 'c29tZV9yZXF1ZXN0X2JvZHk=' },
       *   context: {
       *     geoloc: { city: 'London' },
       *     skip_challenge: true,
       *   },
       *   cookies: {
       *     cookie_name_1: 'cookie_value_1',
       *     cookie_name_2: 'cookie_value_2',
       *   },
       *   headers: {
       *     header_name_1: 'header_value_1',
       *     header_name_2: 'header_value_2',
       *   },
       *   protocol: 'HTTP/1.1',
       * });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/request-tracer/trace`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/request-tracers/request-tracers.mjs
var RequestTracers;
var init_request_tracers = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/request-tracers/request-tracers.mjs"() {
    init_import_meta_url();
    init_resource();
    init_traces();
    init_traces();
    RequestTracers = class extends APIResource {
      static {
        __name(this, "RequestTracers");
      }
      constructor() {
        super(...arguments);
        this.traces = new Traces(this._client);
      }
    };
    RequestTracers.Traces = Traces;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/resource-sharing/recipients.mjs
var Recipients, RecipientListResponsesV4PagePaginationArray;
var init_recipients = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/resource-sharing/recipients.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Recipients = class extends APIResource {
      static {
        __name(this, "Recipients");
      }
      /**
       * Create a new share recipient
       *
       * @example
       * ```ts
       * const recipient =
       *   await client.resourceSharing.recipients.create(
       *     '3fd85f74b32742f1bff64a85009dda07',
       *     { path_account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      create(shareId, params, options) {
        const { path_account_id, ...body } = params;
        return this._client.post(`/accounts/${path_account_id}/shares/${shareId}/recipients`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List share recipients by share ID.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const recipientListResponse of client.resourceSharing.recipients.list(
       *   '3fd85f74b32742f1bff64a85009dda07',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(shareId, params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/shares/${shareId}/recipients`, RecipientListResponsesV4PagePaginationArray, { query, ...options });
      }
      /**
       * Deletion is not immediate, an updated share recipient object with a new status
       * will be returned.
       *
       * @example
       * ```ts
       * const recipient =
       *   await client.resourceSharing.recipients.delete(
       *     '3fd85f74b32742f1bff64a85009dda07',
       *     '3fd85f74b32742f1bff64a85009dda07',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      delete(shareId, recipientId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/shares/${shareId}/recipients/${recipientId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get share recipient by ID.
       *
       * @example
       * ```ts
       * const recipient =
       *   await client.resourceSharing.recipients.get(
       *     '3fd85f74b32742f1bff64a85009dda07',
       *     '3fd85f74b32742f1bff64a85009dda07',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      get(shareId, recipientId, params, options) {
        const { account_id, ...query } = params;
        return this._client.get(`/accounts/${account_id}/shares/${shareId}/recipients/${recipientId}`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
    RecipientListResponsesV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "RecipientListResponsesV4PagePaginationArray");
      }
    };
    Recipients.RecipientListResponsesV4PagePaginationArray = RecipientListResponsesV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/resource-sharing/resources.mjs
var Resources2, ResourceListResponsesV4PagePaginationArray2;
var init_resources2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/resource-sharing/resources.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Resources2 = class extends APIResource {
      static {
        __name(this, "Resources");
      }
      /**
       * Create a new share resource
       *
       * @example
       * ```ts
       * const resource =
       *   await client.resourceSharing.resources.create(
       *     '3fd85f74b32742f1bff64a85009dda07',
       *     {
       *       account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *       meta: {},
       *       resource_account_id:
       *         '023e105f4ecef8ad9ca31a8372d0c353',
       *       resource_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *       resource_type: 'custom-ruleset',
       *     },
       *   );
       * ```
       */
      create(shareId, params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/shares/${shareId}/resources`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Update is not immediate, an updated share resource object with a new status will
       * be returned.
       *
       * @example
       * ```ts
       * const resource =
       *   await client.resourceSharing.resources.update(
       *     '3fd85f74b32742f1bff64a85009dda07',
       *     '023e105f4ecef8ad9ca31a8372d0c353',
       *     {
       *       account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *       meta: {},
       *     },
       *   );
       * ```
       */
      update(shareId, resourceId, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/shares/${shareId}/resources/${resourceId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List share resources by share ID.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const resourceListResponse of client.resourceSharing.resources.list(
       *   '3fd85f74b32742f1bff64a85009dda07',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(shareId, params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/shares/${shareId}/resources`, ResourceListResponsesV4PagePaginationArray2, { query, ...options });
      }
      /**
       * Deletion is not immediate, an updated share resource object with a new status
       * will be returned.
       *
       * @example
       * ```ts
       * const resource =
       *   await client.resourceSharing.resources.delete(
       *     '3fd85f74b32742f1bff64a85009dda07',
       *     '023e105f4ecef8ad9ca31a8372d0c353',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      delete(shareId, resourceId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/shares/${shareId}/resources/${resourceId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get share resource by ID.
       *
       * @example
       * ```ts
       * const resource = await client.resourceSharing.resources.get(
       *   '3fd85f74b32742f1bff64a85009dda07',
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(shareId, resourceId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/shares/${shareId}/resources/${resourceId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    ResourceListResponsesV4PagePaginationArray2 = class extends V4PagePaginationArray {
      static {
        __name(this, "ResourceListResponsesV4PagePaginationArray");
      }
    };
    Resources2.ResourceListResponsesV4PagePaginationArray = ResourceListResponsesV4PagePaginationArray2;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/resource-sharing/resource-sharing.mjs
var ResourceSharing, ResourceSharingListResponsesV4PagePaginationArray;
var init_resource_sharing = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/resource-sharing/resource-sharing.mjs"() {
    init_import_meta_url();
    init_resource();
    init_recipients();
    init_recipients();
    init_resources2();
    init_resources2();
    init_pagination();
    ResourceSharing = class extends APIResource {
      static {
        __name(this, "ResourceSharing");
      }
      constructor() {
        super(...arguments);
        this.recipients = new Recipients(this._client);
        this.resources = new Resources2(this._client);
      }
      /**
       * Create a new share
       *
       * @example
       * ```ts
       * const resourceSharing = await client.resourceSharing.create(
       *   {
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     name: 'My Shared WAF Managed Rule',
       *     recipients: [{}],
       *     resources: [
       *       {
       *         meta: {},
       *         resource_account_id:
       *           '023e105f4ecef8ad9ca31a8372d0c353',
       *         resource_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *         resource_type: 'custom-ruleset',
       *       },
       *     ],
       *   },
       * );
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/shares`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Updating is not immediate, an updated share object with a new status will be
       * returned.
       *
       * @example
       * ```ts
       * const resourceSharing = await client.resourceSharing.update(
       *   '3fd85f74b32742f1bff64a85009dda07',
       *   {
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     name: 'My Shared WAF Managed Rule',
       *   },
       * );
       * ```
       */
      update(shareId, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/shares/${shareId}`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Lists all account shares.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const resourceSharingListResponse of client.resourceSharing.list(
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/shares`, ResourceSharingListResponsesV4PagePaginationArray, { query, ...options });
      }
      /**
       * Deletion is not immediate, an updated share object with a new status will be
       * returned.
       *
       * @example
       * ```ts
       * const resourceSharing = await client.resourceSharing.delete(
       *   '3fd85f74b32742f1bff64a85009dda07',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      delete(shareId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/shares/${shareId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetches share by ID.
       *
       * @example
       * ```ts
       * const resourceSharing = await client.resourceSharing.get(
       *   '3fd85f74b32742f1bff64a85009dda07',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(shareId, params, options) {
        const { account_id, ...query } = params;
        return this._client.get(`/accounts/${account_id}/shares/${shareId}`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
    ResourceSharingListResponsesV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "ResourceSharingListResponsesV4PagePaginationArray");
      }
    };
    ResourceSharing.ResourceSharingListResponsesV4PagePaginationArray = ResourceSharingListResponsesV4PagePaginationArray;
    ResourceSharing.Recipients = Recipients;
    ResourceSharing.RecipientListResponsesV4PagePaginationArray = RecipientListResponsesV4PagePaginationArray;
    ResourceSharing.Resources = Resources2;
    ResourceSharing.ResourceListResponsesV4PagePaginationArray = ResourceListResponsesV4PagePaginationArray2;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/rules/lists/bulk-operations.mjs
var BulkOperations;
var init_bulk_operations = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/rules/lists/bulk-operations.mjs"() {
    init_import_meta_url();
    init_resource();
    BulkOperations = class extends APIResource {
      static {
        __name(this, "BulkOperations");
      }
      /**
       * Gets the current status of an asynchronous operation on a list.
       *
       * The `status` property can have one of the following values: `pending`,
       * `running`, `completed`, or `failed`. If the status is `failed`, the `error`
       * property will contain a message describing the error.
       *
       * @example
       * ```ts
       * const bulkOperation =
       *   await client.rules.lists.bulkOperations.get(
       *     '4da8780eeb215e6cb7f48dd981c4ea02',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      get(operationId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/rules/lists/bulk_operations/${operationId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/rules/lists/items.mjs
var Items, ItemListResponsesCursorPaginationAfter;
var init_items = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/rules/lists/items.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Items = class extends APIResource {
      static {
        __name(this, "Items");
      }
      /**
       * Appends new items to the list.
       *
       * This operation is asynchronous. To get current the operation status, invoke the
       * `Get bulk operation status` endpoint with the returned `operation_id`.
       *
       * There is a limit of 1 pending bulk operation per account. If an outstanding bulk
       * operation is in progress, the request will be rejected.
       *
       * @example
       * ```ts
       * const item = await client.rules.lists.items.create(
       *   '2c0fc9fa937b11eaa1b71c4d701ab86e',
       *   {
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     body: [{ ip: '10.0.0.1' }],
       *   },
       * );
       * ```
       */
      create(listId, params, options) {
        const { account_id, body } = params;
        return this._client.post(`/accounts/${account_id}/rules/lists/${listId}/items`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Removes all existing items from the list and adds the provided items to the
       * list.
       *
       * This operation is asynchronous. To get current the operation status, invoke the
       * `Get bulk operation status` endpoint with the returned `operation_id`.
       *
       * There is a limit of 1 pending bulk operation per account. If an outstanding bulk
       * operation is in progress, the request will be rejected.
       *
       * @example
       * ```ts
       * const item = await client.rules.lists.items.update(
       *   '2c0fc9fa937b11eaa1b71c4d701ab86e',
       *   {
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     body: [{ ip: '10.0.0.1' }],
       *   },
       * );
       * ```
       */
      update(listId, params, options) {
        const { account_id, body } = params;
        return this._client.put(`/accounts/${account_id}/rules/lists/${listId}/items`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetches all the items in the list.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const itemListResponse of client.rules.lists.items.list(
       *   '2c0fc9fa937b11eaa1b71c4d701ab86e',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(listId, params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/rules/lists/${listId}/items`, ItemListResponsesCursorPaginationAfter, { query, ...options });
      }
      /**
       * Removes one or more items from a list.
       *
       * This operation is asynchronous. To get current the operation status, invoke the
       * `Get bulk operation status` endpoint with the returned `operation_id`.
       *
       * There is a limit of 1 pending bulk operation per account. If an outstanding bulk
       * operation is in progress, the request will be rejected.
       *
       * @example
       * ```ts
       * const item = await client.rules.lists.items.delete(
       *   '2c0fc9fa937b11eaa1b71c4d701ab86e',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      delete(listId, params, options) {
        const { account_id, ...body } = params;
        return this._client.delete(`/accounts/${account_id}/rules/lists/${listId}/items`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetches a list item in the list.
       *
       * @example
       * ```ts
       * const item = await client.rules.lists.items.get(
       *   '2c0fc9fa937b11eaa1b71c4d701ab86e',
       *   '34b12448945f11eaa1b71c4d701ab86e',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(listId, itemId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/rules/lists/${listId}/items/${itemId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    ItemListResponsesCursorPaginationAfter = class extends CursorPaginationAfter {
      static {
        __name(this, "ItemListResponsesCursorPaginationAfter");
      }
    };
    Items.ItemListResponsesCursorPaginationAfter = ItemListResponsesCursorPaginationAfter;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/rules/lists/lists.mjs
var Lists, ListsListsSinglePage;
var init_lists = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/rules/lists/lists.mjs"() {
    init_import_meta_url();
    init_resource();
    init_bulk_operations();
    init_bulk_operations();
    init_items();
    init_items();
    init_pagination();
    Lists = class extends APIResource {
      static {
        __name(this, "Lists");
      }
      constructor() {
        super(...arguments);
        this.bulkOperations = new BulkOperations(this._client);
        this.items = new Items(this._client);
      }
      /**
       * Creates a new list of the specified kind.
       *
       * @example
       * ```ts
       * const list = await client.rules.lists.create({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   kind: 'ip',
       *   name: 'list1',
       * });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/rules/lists`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Updates the description of a list.
       *
       * @example
       * ```ts
       * const list = await client.rules.lists.update(
       *   '2c0fc9fa937b11eaa1b71c4d701ab86e',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      update(listId, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/rules/lists/${listId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetches all lists in the account.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const listsList of client.rules.lists.list({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * })) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/rules/lists`, ListsListsSinglePage, options);
      }
      /**
       * Deletes a specific list and all its items.
       *
       * @example
       * ```ts
       * const list = await client.rules.lists.delete(
       *   '2c0fc9fa937b11eaa1b71c4d701ab86e',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      delete(listId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/rules/lists/${listId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetches the details of a list.
       *
       * @example
       * ```ts
       * const list = await client.rules.lists.get(
       *   '2c0fc9fa937b11eaa1b71c4d701ab86e',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(listId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/rules/lists/${listId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    ListsListsSinglePage = class extends SinglePage {
      static {
        __name(this, "ListsListsSinglePage");
      }
    };
    Lists.ListsListsSinglePage = ListsListsSinglePage;
    Lists.BulkOperations = BulkOperations;
    Lists.Items = Items;
    Lists.ItemListResponsesCursorPaginationAfter = ItemListResponsesCursorPaginationAfter;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/rules/rules.mjs
var Rules7;
var init_rules8 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/rules/rules.mjs"() {
    init_import_meta_url();
    init_resource();
    init_lists();
    init_lists();
    Rules7 = class extends APIResource {
      static {
        __name(this, "Rules");
      }
      constructor() {
        super(...arguments);
        this.lists = new Lists(this._client);
      }
    };
    Rules7.Lists = Lists;
    Rules7.ListsListsSinglePage = ListsListsSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/rulesets/rules.mjs
var Rules8;
var init_rules9 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/rulesets/rules.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    init_error4();
    Rules8 = class extends APIResource {
      static {
        __name(this, "Rules");
      }
      /**
       * Adds a new rule to an account or zone ruleset. The rule will be added to the end
       * of the existing list of rules in the ruleset by default.
       *
       * @example
       * ```ts
       * const rule = await client.rulesets.rules.create(
       *   '2f2feab2026849078ba485f918791bdc',
       *   { account_id: 'account_id' },
       * );
       * ```
       */
      create(rulesetId, params, options) {
        const { account_id, zone_id, ...body } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.post(`/${accountOrZone}/${accountOrZoneId}/rulesets/${rulesetId}/rules`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      delete(rulesetId, ruleId, params = {}, options) {
        if (isRequestOptions(params)) {
          return this.delete(rulesetId, ruleId, {}, params);
        }
        const { account_id, zone_id } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.delete(`/${accountOrZone}/${accountOrZoneId}/rulesets/${rulesetId}/rules/${ruleId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Updates an existing rule in an account or zone ruleset.
       *
       * @example
       * ```ts
       * const response = await client.rulesets.rules.edit(
       *   '2f2feab2026849078ba485f918791bdc',
       *   '3a03d665bac047339bb530ecb439a90d',
       *   { account_id: 'account_id' },
       * );
       * ```
       */
      edit(rulesetId, ruleId, params, options) {
        const { account_id, zone_id, ...body } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.patch(`/${accountOrZone}/${accountOrZoneId}/rulesets/${rulesetId}/rules/${ruleId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/rulesets/versions.mjs
var Versions, VersionListResponsesSinglePage;
var init_versions = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/rulesets/versions.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    init_error4();
    init_pagination();
    Versions = class extends APIResource {
      static {
        __name(this, "Versions");
      }
      list(rulesetId, params = {}, options) {
        if (isRequestOptions(params)) {
          return this.list(rulesetId, {}, params);
        }
        const { account_id, zone_id } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.getAPIList(`/${accountOrZone}/${accountOrZoneId}/rulesets/${rulesetId}/versions`, VersionListResponsesSinglePage, options);
      }
      delete(rulesetId, rulesetVersion, params = {}, options) {
        if (isRequestOptions(params)) {
          return this.delete(rulesetId, rulesetVersion, {}, params);
        }
        const { account_id, zone_id } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.delete(`/${accountOrZone}/${accountOrZoneId}/rulesets/${rulesetId}/versions/${rulesetVersion}`, { ...options, headers: { Accept: "*/*", ...options?.headers } });
      }
      get(rulesetId, rulesetVersion, params = {}, options) {
        if (isRequestOptions(params)) {
          return this.get(rulesetId, rulesetVersion, {}, params);
        }
        const { account_id, zone_id } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.get(`/${accountOrZone}/${accountOrZoneId}/rulesets/${rulesetId}/versions/${rulesetVersion}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    VersionListResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "VersionListResponsesSinglePage");
      }
    };
    Versions.VersionListResponsesSinglePage = VersionListResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/rulesets/phases/versions.mjs
var Versions2, VersionListResponsesSinglePage2;
var init_versions2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/rulesets/phases/versions.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    init_error4();
    init_pagination();
    Versions2 = class extends APIResource {
      static {
        __name(this, "Versions");
      }
      list(rulesetPhase, params = {}, options) {
        if (isRequestOptions(params)) {
          return this.list(rulesetPhase, {}, params);
        }
        const { account_id, zone_id } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.getAPIList(`/${accountOrZone}/${accountOrZoneId}/rulesets/phases/${rulesetPhase}/entrypoint/versions`, VersionListResponsesSinglePage2, options);
      }
      get(rulesetPhase, rulesetVersion, params = {}, options) {
        if (isRequestOptions(params)) {
          return this.get(rulesetPhase, rulesetVersion, {}, params);
        }
        const { account_id, zone_id } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.get(`/${accountOrZone}/${accountOrZoneId}/rulesets/phases/${rulesetPhase}/entrypoint/versions/${rulesetVersion}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    VersionListResponsesSinglePage2 = class extends SinglePage {
      static {
        __name(this, "VersionListResponsesSinglePage");
      }
    };
    Versions2.VersionListResponsesSinglePage = VersionListResponsesSinglePage2;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/rulesets/phases/phases.mjs
var Phases;
var init_phases = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/rulesets/phases/phases.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    init_versions2();
    init_versions2();
    init_error4();
    Phases = class extends APIResource {
      static {
        __name(this, "Phases");
      }
      constructor() {
        super(...arguments);
        this.versions = new Versions2(this._client);
      }
      /**
       * Updates an account or zone entry point ruleset, creating a new version.
       *
       * @example
       * ```ts
       * const phase = await client.rulesets.phases.update(
       *   'http_request_firewall_custom',
       *   { account_id: 'account_id' },
       * );
       * ```
       */
      update(rulesetPhase, params, options) {
        const { account_id, zone_id, ...body } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.put(`/${accountOrZone}/${accountOrZoneId}/rulesets/phases/${rulesetPhase}/entrypoint`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      get(rulesetPhase, params = {}, options) {
        if (isRequestOptions(params)) {
          return this.get(rulesetPhase, {}, params);
        }
        const { account_id, zone_id } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.get(`/${accountOrZone}/${accountOrZoneId}/rulesets/phases/${rulesetPhase}/entrypoint`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    Phases.Versions = Versions2;
    Phases.VersionListResponsesSinglePage = VersionListResponsesSinglePage2;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/rulesets/rulesets.mjs
var Rulesets, RulesetListResponsesCursorPagination;
var init_rulesets = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/rulesets/rulesets.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    init_rules9();
    init_rules9();
    init_versions();
    init_versions();
    init_phases();
    init_phases();
    init_error4();
    init_pagination();
    Rulesets = class extends APIResource {
      static {
        __name(this, "Rulesets");
      }
      constructor() {
        super(...arguments);
        this.phases = new Phases(this._client);
        this.rules = new Rules8(this._client);
        this.versions = new Versions(this._client);
      }
      /**
       * Creates a ruleset.
       *
       * @example
       * ```ts
       * const ruleset = await client.rulesets.create({
       *   kind: 'root',
       *   name: 'My ruleset',
       *   phase: 'http_request_firewall_custom',
       *   account_id: 'account_id',
       * });
       * ```
       */
      create(params, options) {
        const { account_id, zone_id, ...body } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.post(`/${accountOrZone}/${accountOrZoneId}/rulesets`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Updates an account or zone ruleset, creating a new version.
       *
       * @example
       * ```ts
       * const ruleset = await client.rulesets.update(
       *   '2f2feab2026849078ba485f918791bdc',
       *   { account_id: 'account_id' },
       * );
       * ```
       */
      update(rulesetId, params, options) {
        const { account_id, zone_id, ...body } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.put(`/${accountOrZone}/${accountOrZoneId}/rulesets/${rulesetId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      list(params = {}, options) {
        if (isRequestOptions(params)) {
          return this.list({}, params);
        }
        const { account_id, zone_id, ...query } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.getAPIList(`/${accountOrZone}/${accountOrZoneId}/rulesets`, RulesetListResponsesCursorPagination, { query, ...options });
      }
      delete(rulesetId, params = {}, options) {
        if (isRequestOptions(params)) {
          return this.delete(rulesetId, {}, params);
        }
        const { account_id, zone_id } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.delete(`/${accountOrZone}/${accountOrZoneId}/rulesets/${rulesetId}`, {
          ...options,
          headers: { Accept: "*/*", ...options?.headers }
        });
      }
      get(rulesetId, params = {}, options) {
        if (isRequestOptions(params)) {
          return this.get(rulesetId, {}, params);
        }
        const { account_id, zone_id } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.get(`/${accountOrZone}/${accountOrZoneId}/rulesets/${rulesetId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    RulesetListResponsesCursorPagination = class extends CursorPagination {
      static {
        __name(this, "RulesetListResponsesCursorPagination");
      }
    };
    Rulesets.RulesetListResponsesCursorPagination = RulesetListResponsesCursorPagination;
    Rulesets.Phases = Phases;
    Rulesets.Rules = Rules8;
    Rulesets.Versions = Versions;
    Rulesets.VersionListResponsesSinglePage = VersionListResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/ssl/analyze.mjs
var Analyze;
var init_analyze = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/ssl/analyze.mjs"() {
    init_import_meta_url();
    init_resource();
    Analyze = class extends APIResource {
      static {
        __name(this, "Analyze");
      }
      /**
       * Returns the set of hostnames, the signature algorithm, and the expiration date
       * of the certificate.
       *
       * @example
       * ```ts
       * const analyze = await client.ssl.analyze.create({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      create(params, options) {
        const { zone_id, ...body } = params;
        return this._client.post(`/zones/${zone_id}/ssl/analyze`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/ssl/recommendations.mjs
var Recommendations;
var init_recommendations = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/ssl/recommendations.mjs"() {
    init_import_meta_url();
    init_resource();
    Recommendations = class extends APIResource {
      static {
        __name(this, "Recommendations");
      }
      /**
       * Retrieve the SSL/TLS Recommender's recommendation for a zone.
       *
       * @deprecated SSL/TLS Recommender has been decommissioned in favor of Automatic SSL/TLS
       */
      get(params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/ssl/recommendation`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/ssl/verification.mjs
var VerificationResource;
var init_verification = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/ssl/verification.mjs"() {
    init_import_meta_url();
    init_resource();
    VerificationResource = class extends APIResource {
      static {
        __name(this, "VerificationResource");
      }
      /**
       * Edit SSL validation method for a certificate pack. A PATCH request will request
       * an immediate validation check on any certificate, and return the updated status.
       * If a validation method is provided, the validation will be immediately attempted
       * using that method.
       *
       * @example
       * ```ts
       * const response = await client.ssl.verification.edit(
       *   'a77f8bd7-3b47-46b4-a6f1-75cf98109948',
       *   {
       *     zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     validation_method: 'txt',
       *   },
       * );
       * ```
       */
      edit(certificatePackId, params, options) {
        const { zone_id, ...body } = params;
        return this._client.patch(`/zones/${zone_id}/ssl/verification/${certificatePackId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get SSL Verification Info for a Zone.
       *
       * @example
       * ```ts
       * const verifications = await client.ssl.verification.get({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      get(params, options) {
        const { zone_id, ...query } = params;
        return this._client.get(`/zones/${zone_id}/ssl/verification`, { query, ...options })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/ssl/certificate-packs/quota.mjs
var Quota;
var init_quota = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/ssl/certificate-packs/quota.mjs"() {
    init_import_meta_url();
    init_resource();
    Quota = class extends APIResource {
      static {
        __name(this, "Quota");
      }
      /**
       * For a given zone, list certificate pack quotas.
       *
       * @example
       * ```ts
       * const quota = await client.ssl.certificatePacks.quota.get({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      get(params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/ssl/certificate_packs/quota`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/ssl/certificate-packs/certificate-packs.mjs
var CertificatePacks, CertificatePackListResponsesSinglePage;
var init_certificate_packs = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/ssl/certificate-packs/certificate-packs.mjs"() {
    init_import_meta_url();
    init_resource();
    init_quota();
    init_quota();
    init_pagination();
    CertificatePacks = class extends APIResource {
      static {
        __name(this, "CertificatePacks");
      }
      constructor() {
        super(...arguments);
        this.quota = new Quota(this._client);
      }
      /**
       * For a given zone, order an advanced certificate pack.
       *
       * @example
       * ```ts
       * const certificatePack =
       *   await client.ssl.certificatePacks.create({
       *     zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     certificate_authority: 'lets_encrypt',
       *     hosts: [
       *       'example.com',
       *       '*.example.com',
       *       'www.example.com',
       *     ],
       *     type: 'advanced',
       *     validation_method: 'txt',
       *     validity_days: 14,
       *   });
       * ```
       */
      create(params, options) {
        const { zone_id, ...body } = params;
        return this._client.post(`/zones/${zone_id}/ssl/certificate_packs/order`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * For a given zone, list all active certificate packs.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const certificatePackListResponse of client.ssl.certificatePacks.list(
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { zone_id, ...query } = params;
        return this._client.getAPIList(`/zones/${zone_id}/ssl/certificate_packs`, CertificatePackListResponsesSinglePage, { query, ...options });
      }
      /**
       * For a given zone, delete an advanced certificate pack.
       *
       * @example
       * ```ts
       * const certificatePack =
       *   await client.ssl.certificatePacks.delete(
       *     '023e105f4ecef8ad9ca31a8372d0c353',
       *     { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      delete(certificatePackId, params, options) {
        const { zone_id } = params;
        return this._client.delete(`/zones/${zone_id}/ssl/certificate_packs/${certificatePackId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * For a given zone, restart validation or add cloudflare branding for an advanced
       * certificate pack. The former is only a validation operation for a Certificate
       * Pack in a validation_timed_out status.
       *
       * @example
       * ```ts
       * const response = await client.ssl.certificatePacks.edit(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      edit(certificatePackId, params, options) {
        const { zone_id, ...body } = params;
        return this._client.patch(`/zones/${zone_id}/ssl/certificate_packs/${certificatePackId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * For a given zone, get a certificate pack.
       *
       * @example
       * ```ts
       * const certificatePack =
       *   await client.ssl.certificatePacks.get(
       *     '023e105f4ecef8ad9ca31a8372d0c353',
       *     { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      get(certificatePackId, params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/ssl/certificate_packs/${certificatePackId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    CertificatePackListResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "CertificatePackListResponsesSinglePage");
      }
    };
    CertificatePacks.CertificatePackListResponsesSinglePage = CertificatePackListResponsesSinglePage;
    CertificatePacks.Quota = Quota;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/ssl/universal/settings.mjs
var Settings8;
var init_settings8 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/ssl/universal/settings.mjs"() {
    init_import_meta_url();
    init_resource();
    Settings8 = class extends APIResource {
      static {
        __name(this, "Settings");
      }
      /**
       * Patch Universal SSL Settings for a Zone.
       *
       * @example
       * ```ts
       * const universalSSLSettings =
       *   await client.ssl.universal.settings.edit({
       *     zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   });
       * ```
       */
      edit(params, options) {
        const { zone_id, ...body } = params;
        return this._client.patch(`/zones/${zone_id}/ssl/universal/settings`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get Universal SSL Settings for a Zone.
       *
       * @example
       * ```ts
       * const universalSSLSettings =
       *   await client.ssl.universal.settings.get({
       *     zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   });
       * ```
       */
      get(params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/ssl/universal/settings`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/ssl/universal/universal.mjs
var Universal;
var init_universal = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/ssl/universal/universal.mjs"() {
    init_import_meta_url();
    init_resource();
    init_settings8();
    init_settings8();
    Universal = class extends APIResource {
      static {
        __name(this, "Universal");
      }
      constructor() {
        super(...arguments);
        this.settings = new Settings8(this._client);
      }
    };
    Universal.Settings = Settings8;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/ssl/ssl.mjs
var SSL;
var init_ssl = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/ssl/ssl.mjs"() {
    init_import_meta_url();
    init_resource();
    init_analyze();
    init_analyze();
    init_recommendations();
    init_recommendations();
    init_verification();
    init_verification();
    init_certificate_packs();
    init_certificate_packs();
    init_universal();
    init_universal();
    SSL = class extends APIResource {
      static {
        __name(this, "SSL");
      }
      constructor() {
        super(...arguments);
        this.analyze = new Analyze(this._client);
        this.certificatePacks = new CertificatePacks(this._client);
        this.recommendations = new Recommendations(this._client);
        this.universal = new Universal(this._client);
        this.verification = new VerificationResource(this._client);
      }
    };
    SSL.Analyze = Analyze;
    SSL.CertificatePacks = CertificatePacks;
    SSL.CertificatePackListResponsesSinglePage = CertificatePackListResponsesSinglePage;
    SSL.Recommendations = Recommendations;
    SSL.Universal = Universal;
    SSL.VerificationResource = VerificationResource;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/schema-validation/schemas.mjs
var Schemas2, SchemaListResponsesV4PagePaginationArray;
var init_schemas2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/schema-validation/schemas.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Schemas2 = class extends APIResource {
      static {
        __name(this, "Schemas");
      }
      /**
       * Upload a schema
       *
       * @example
       * ```ts
       * const schema = await client.schemaValidation.schemas.create(
       *   {
       *     zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     kind: 'openapi_v3',
       *     name: 'petstore schema',
       *     source: '<schema file contents>',
       *     validation_enabled: true,
       *   },
       * );
       * ```
       */
      create(params, options) {
        const { zone_id, ...body } = params;
        return this._client.post(`/zones/${zone_id}/schema_validation/schemas`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List all uploaded schemas
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const schemaListResponse of client.schemaValidation.schemas.list(
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { zone_id, ...query } = params;
        return this._client.getAPIList(`/zones/${zone_id}/schema_validation/schemas`, SchemaListResponsesV4PagePaginationArray, { query, ...options });
      }
      /**
       * Delete a schema
       *
       * @example
       * ```ts
       * const schema = await client.schemaValidation.schemas.delete(
       *   'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      delete(schemaId, params, options) {
        const { zone_id } = params;
        return this._client.delete(`/zones/${zone_id}/schema_validation/schemas/${schemaId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Edit details of a schema to enable validation
       *
       * @example
       * ```ts
       * const response = await client.schemaValidation.schemas.edit(
       *   'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      edit(schemaId, params, options) {
        const { zone_id, ...body } = params;
        return this._client.patch(`/zones/${zone_id}/schema_validation/schemas/${schemaId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get details of a schema
       *
       * @example
       * ```ts
       * const schema = await client.schemaValidation.schemas.get(
       *   'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(schemaId, params, options) {
        const { zone_id, ...query } = params;
        return this._client.get(`/zones/${zone_id}/schema_validation/schemas/${schemaId}`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
    SchemaListResponsesV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "SchemaListResponsesV4PagePaginationArray");
      }
    };
    Schemas2.SchemaListResponsesV4PagePaginationArray = SchemaListResponsesV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/schema-validation/settings/operations.mjs
var Operations4, OperationListResponsesV4PagePaginationArray3;
var init_operations4 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/schema-validation/settings/operations.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Operations4 = class extends APIResource {
      static {
        __name(this, "Operations");
      }
      /**
       * Update per-operation schema validation setting
       *
       * @example
       * ```ts
       * const operation =
       *   await client.schemaValidation.settings.operations.update(
       *     'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *     {
       *       zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *       mitigation_action: 'block',
       *     },
       *   );
       * ```
       */
      update(operationId, params, options) {
        const { zone_id, ...body } = params;
        return this._client.put(`/zones/${zone_id}/schema_validation/settings/operations/${operationId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List per-operation schema validation settings
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const operationListResponse of client.schemaValidation.settings.operations.list(
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { zone_id, ...query } = params;
        return this._client.getAPIList(`/zones/${zone_id}/schema_validation/settings/operations`, OperationListResponsesV4PagePaginationArray3, { query, ...options });
      }
      /**
       * Delete per-operation schema validation setting
       *
       * @example
       * ```ts
       * const operation =
       *   await client.schemaValidation.settings.operations.delete(
       *     'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *     { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      delete(operationId, params, options) {
        const { zone_id } = params;
        return this._client.delete(`/zones/${zone_id}/schema_validation/settings/operations/${operationId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Bulk edit per-operation schema validation settings
       *
       * @example
       * ```ts
       * const response =
       *   await client.schemaValidation.settings.operations.bulkEdit(
       *     {
       *       zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *       body: {
       *         '3818d821-5901-4147-a474-f5f5aec1d54e': {},
       *         'b17c8043-99a0-4202-b7d9-8f7cdbee02cd': {},
       *       },
       *     },
       *   );
       * ```
       */
      bulkEdit(params, options) {
        const { zone_id, body } = params;
        return this._client.patch(`/zones/${zone_id}/schema_validation/settings/operations`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get per-operation schema validation setting
       *
       * @example
       * ```ts
       * const operation =
       *   await client.schemaValidation.settings.operations.get(
       *     'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *     { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      get(operationId, params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/schema_validation/settings/operations/${operationId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    OperationListResponsesV4PagePaginationArray3 = class extends V4PagePaginationArray {
      static {
        __name(this, "OperationListResponsesV4PagePaginationArray");
      }
    };
    Operations4.OperationListResponsesV4PagePaginationArray = OperationListResponsesV4PagePaginationArray3;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/schema-validation/settings/settings.mjs
var Settings9;
var init_settings9 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/schema-validation/settings/settings.mjs"() {
    init_import_meta_url();
    init_resource();
    init_operations4();
    init_operations4();
    Settings9 = class extends APIResource {
      static {
        __name(this, "Settings");
      }
      constructor() {
        super(...arguments);
        this.operations = new Operations4(this._client);
      }
      /**
       * Update global schema validation settings
       *
       * @example
       * ```ts
       * const setting =
       *   await client.schemaValidation.settings.update({
       *     zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     validation_default_mitigation_action: 'block',
       *   });
       * ```
       */
      update(params, options) {
        const { zone_id, ...body } = params;
        return this._client.put(`/zones/${zone_id}/schema_validation/settings`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Edit global schema validation settings
       *
       * @example
       * ```ts
       * const response =
       *   await client.schemaValidation.settings.edit({
       *     zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   });
       * ```
       */
      edit(params, options) {
        const { zone_id, ...body } = params;
        return this._client.patch(`/zones/${zone_id}/schema_validation/settings`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get global schema validation settings
       *
       * @example
       * ```ts
       * const setting = await client.schemaValidation.settings.get({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      get(params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/schema_validation/settings`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    Settings9.Operations = Operations4;
    Settings9.OperationListResponsesV4PagePaginationArray = OperationListResponsesV4PagePaginationArray3;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/schema-validation/schema-validation.mjs
var SchemaValidation3;
var init_schema_validation3 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/schema-validation/schema-validation.mjs"() {
    init_import_meta_url();
    init_resource();
    init_schemas2();
    init_schemas2();
    init_settings9();
    init_settings9();
    SchemaValidation3 = class extends APIResource {
      static {
        __name(this, "SchemaValidation");
      }
      constructor() {
        super(...arguments);
        this.schemas = new Schemas2(this._client);
        this.settings = new Settings9(this._client);
      }
    };
    SchemaValidation3.Schemas = Schemas2;
    SchemaValidation3.SchemaListResponsesV4PagePaginationArray = SchemaListResponsesV4PagePaginationArray;
    SchemaValidation3.Settings = Settings9;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/secrets-store/quota.mjs
var Quota2;
var init_quota2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/secrets-store/quota.mjs"() {
    init_import_meta_url();
    init_resource();
    Quota2 = class extends APIResource {
      static {
        __name(this, "Quota");
      }
      /**
       * Lists the number of secrets used in the account.
       *
       * @example
       * ```ts
       * const quota = await client.secretsStore.quota.get({
       *   account_id: '985e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      get(params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/secrets_store/quota`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/secrets-store/stores/secrets.mjs
var Secrets, SecretCreateResponsesSinglePage, SecretListResponsesV4PagePaginationArray, SecretBulkDeleteResponsesSinglePage;
var init_secrets = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/secrets-store/stores/secrets.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Secrets = class extends APIResource {
      static {
        __name(this, "Secrets");
      }
      /**
       * Creates a secret in the account
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const secretCreateResponse of client.secretsStore.stores.secrets.create(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   {
       *     account_id: '985e105f4ecef8ad9ca31a8372d0c353',
       *     body: [
       *       {
       *         name: 'MY_API_KEY',
       *         scopes: ['workers', 'ai_gateway'],
       *         value: 'api-token-secret-123',
       *       },
       *     ],
       *   },
       * )) {
       *   // ...
       * }
       * ```
       */
      create(storeId, params, options) {
        const { account_id, body } = params;
        return this._client.getAPIList(`/accounts/${account_id}/secrets_store/stores/${storeId}/secrets`, SecretCreateResponsesSinglePage, { body, method: "post", ...options });
      }
      /**
       * Lists all store secrets
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const secretListResponse of client.secretsStore.stores.secrets.list(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { account_id: '985e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(storeId, params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/secrets_store/stores/${storeId}/secrets`, SecretListResponsesV4PagePaginationArray, { query, ...options });
      }
      /**
       * Deletes a single secret
       *
       * @example
       * ```ts
       * const secret =
       *   await client.secretsStore.stores.secrets.delete(
       *     '023e105f4ecef8ad9ca31a8372d0c353',
       *     '3fd85f74b32742f1bff64a85009dda07',
       *     { account_id: '985e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      delete(storeId, secretId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/secrets_store/stores/${storeId}/secrets/${secretId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Deletes one or more secrets
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const secretBulkDeleteResponse of client.secretsStore.stores.secrets.bulkDelete(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { account_id: '985e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      bulkDelete(storeId, params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/secrets_store/stores/${storeId}/secrets`, SecretBulkDeleteResponsesSinglePage, { method: "delete", ...options });
      }
      /**
       * Duplicates the secret, keeping the value
       *
       * @example
       * ```ts
       * const response =
       *   await client.secretsStore.stores.secrets.duplicate(
       *     '023e105f4ecef8ad9ca31a8372d0c353',
       *     '3fd85f74b32742f1bff64a85009dda07',
       *     {
       *       account_id: '985e105f4ecef8ad9ca31a8372d0c353',
       *       name: 'MY_API_KEY',
       *       scopes: ['workers', 'ai_gateway'],
       *     },
       *   );
       * ```
       */
      duplicate(storeId, secretId, params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/secrets_store/stores/${storeId}/secrets/${secretId}/duplicate`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Updates a single secret
       *
       * @example
       * ```ts
       * const response =
       *   await client.secretsStore.stores.secrets.edit(
       *     '023e105f4ecef8ad9ca31a8372d0c353',
       *     '3fd85f74b32742f1bff64a85009dda07',
       *     { account_id: '985e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      edit(storeId, secretId, params, options) {
        const { account_id, ...body } = params;
        return this._client.patch(`/accounts/${account_id}/secrets_store/stores/${storeId}/secrets/${secretId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Returns details of a single secret
       *
       * @example
       * ```ts
       * const secret = await client.secretsStore.stores.secrets.get(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   '3fd85f74b32742f1bff64a85009dda07',
       *   { account_id: '985e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(storeId, secretId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/secrets_store/stores/${storeId}/secrets/${secretId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    SecretCreateResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "SecretCreateResponsesSinglePage");
      }
    };
    SecretListResponsesV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "SecretListResponsesV4PagePaginationArray");
      }
    };
    SecretBulkDeleteResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "SecretBulkDeleteResponsesSinglePage");
      }
    };
    Secrets.SecretCreateResponsesSinglePage = SecretCreateResponsesSinglePage;
    Secrets.SecretListResponsesV4PagePaginationArray = SecretListResponsesV4PagePaginationArray;
    Secrets.SecretBulkDeleteResponsesSinglePage = SecretBulkDeleteResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/secrets-store/stores/stores.mjs
var Stores, StoreCreateResponsesSinglePage, StoreListResponsesV4PagePaginationArray;
var init_stores = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/secrets-store/stores/stores.mjs"() {
    init_import_meta_url();
    init_resource();
    init_secrets();
    init_secrets();
    init_pagination();
    Stores = class extends APIResource {
      static {
        __name(this, "Stores");
      }
      constructor() {
        super(...arguments);
        this.secrets = new Secrets(this._client);
      }
      /**
       * Creates a store in the account
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const storeCreateResponse of client.secretsStore.stores.create(
       *   {
       *     account_id: '985e105f4ecef8ad9ca31a8372d0c353',
       *     body: [{ name: 'service_x_keys' }],
       *   },
       * )) {
       *   // ...
       * }
       * ```
       */
      create(params, options) {
        const { account_id, body } = params;
        return this._client.getAPIList(`/accounts/${account_id}/secrets_store/stores`, StoreCreateResponsesSinglePage, { body, method: "post", ...options });
      }
      /**
       * Lists all the stores in an account
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const storeListResponse of client.secretsStore.stores.list(
       *   { account_id: '985e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/secrets_store/stores`, StoreListResponsesV4PagePaginationArray, { query, ...options });
      }
      /**
       * Deletes a single store
       *
       * @example
       * ```ts
       * const store = await client.secretsStore.stores.delete(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { account_id: '985e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      delete(storeId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/secrets_store/stores/${storeId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    StoreCreateResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "StoreCreateResponsesSinglePage");
      }
    };
    StoreListResponsesV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "StoreListResponsesV4PagePaginationArray");
      }
    };
    Stores.StoreCreateResponsesSinglePage = StoreCreateResponsesSinglePage;
    Stores.StoreListResponsesV4PagePaginationArray = StoreListResponsesV4PagePaginationArray;
    Stores.Secrets = Secrets;
    Stores.SecretCreateResponsesSinglePage = SecretCreateResponsesSinglePage;
    Stores.SecretListResponsesV4PagePaginationArray = SecretListResponsesV4PagePaginationArray;
    Stores.SecretBulkDeleteResponsesSinglePage = SecretBulkDeleteResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/secrets-store/secrets-store.mjs
var SecretsStore;
var init_secrets_store = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/secrets-store/secrets-store.mjs"() {
    init_import_meta_url();
    init_resource();
    init_quota2();
    init_quota2();
    init_stores();
    init_stores();
    SecretsStore = class extends APIResource {
      static {
        __name(this, "SecretsStore");
      }
      constructor() {
        super(...arguments);
        this.stores = new Stores(this._client);
        this.quota = new Quota2(this._client);
      }
    };
    SecretsStore.Stores = Stores;
    SecretsStore.StoreCreateResponsesSinglePage = StoreCreateResponsesSinglePage;
    SecretsStore.StoreListResponsesV4PagePaginationArray = StoreListResponsesV4PagePaginationArray;
    SecretsStore.Quota = Quota2;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/security-center/insights/class.mjs
var Class;
var init_class = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/security-center/insights/class.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    init_error4();
    Class = class extends APIResource {
      static {
        __name(this, "Class");
      }
      get(params = {}, options) {
        if (isRequestOptions(params)) {
          return this.get({}, params);
        }
        const { account_id, zone_id, ...query } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.get(`/${accountOrZone}/${accountOrZoneId}/security-center/insights/class`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/security-center/insights/severity.mjs
var Severity;
var init_severity = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/security-center/insights/severity.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    init_error4();
    Severity = class extends APIResource {
      static {
        __name(this, "Severity");
      }
      get(params = {}, options) {
        if (isRequestOptions(params)) {
          return this.get({}, params);
        }
        const { account_id, zone_id, ...query } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.get(`/${accountOrZone}/${accountOrZoneId}/security-center/insights/severity`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/security-center/insights/type.mjs
var Type;
var init_type = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/security-center/insights/type.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    init_error4();
    Type = class extends APIResource {
      static {
        __name(this, "Type");
      }
      get(params = {}, options) {
        if (isRequestOptions(params)) {
          return this.get({}, params);
        }
        const { account_id, zone_id, ...query } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.get(`/${accountOrZone}/${accountOrZoneId}/security-center/insights/type`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/security-center/insights/insights.mjs
var Insights2, InsightListResponsesV4PagePagination;
var init_insights2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/security-center/insights/insights.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    init_class();
    init_class();
    init_severity();
    init_severity();
    init_type();
    init_type();
    init_error4();
    init_pagination();
    Insights2 = class extends APIResource {
      static {
        __name(this, "Insights");
      }
      constructor() {
        super(...arguments);
        this.class = new Class(this._client);
        this.severity = new Severity(this._client);
        this.type = new Type(this._client);
      }
      list(params = {}, options) {
        if (isRequestOptions(params)) {
          return this.list({}, params);
        }
        const { account_id, zone_id, ...query } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.getAPIList(`/${accountOrZone}/${accountOrZoneId}/security-center/insights`, InsightListResponsesV4PagePagination, { query, ...options });
      }
      /**
       * Archive Security Center Insight
       */
      dismiss(issueId, params, options) {
        const { account_id, zone_id, ...body } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.put(`/${accountOrZone}/${accountOrZoneId}/security-center/insights/${issueId}/dismiss`, { body, ...options });
      }
    };
    InsightListResponsesV4PagePagination = class extends V4PagePagination {
      static {
        __name(this, "InsightListResponsesV4PagePagination");
      }
    };
    Insights2.InsightListResponsesV4PagePagination = InsightListResponsesV4PagePagination;
    Insights2.Class = Class;
    Insights2.Severity = Severity;
    Insights2.Type = Type;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/security-center/security-center.mjs
var SecurityCenter;
var init_security_center = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/security-center/security-center.mjs"() {
    init_import_meta_url();
    init_resource();
    init_insights2();
    init_insights2();
    SecurityCenter = class extends APIResource {
      static {
        __name(this, "SecurityCenter");
      }
      constructor() {
        super(...arguments);
        this.insights = new Insights2(this._client);
      }
    };
    SecurityCenter.Insights = Insights2;
    SecurityCenter.InsightListResponsesV4PagePagination = InsightListResponsesV4PagePagination;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/security-txt.mjs
var SecurityTXT;
var init_security_txt = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/security-txt.mjs"() {
    init_import_meta_url();
    init_resource();
    SecurityTXT = class extends APIResource {
      static {
        __name(this, "SecurityTXT");
      }
      /**
       * Update security.txt
       *
       * @example
       * ```ts
       * const securityTXT = await client.securityTXT.update({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      update(params, options) {
        const { zone_id, ...body } = params;
        return this._client.put(`/zones/${zone_id}/security-center/securitytxt`, { body, ...options });
      }
      /**
       * Delete security.txt
       *
       * @example
       * ```ts
       * const securityTXT = await client.securityTXT.delete({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      delete(params, options) {
        const { zone_id } = params;
        return this._client.delete(`/zones/${zone_id}/security-center/securitytxt`, options);
      }
      /**
       * Get security.txt
       *
       * @example
       * ```ts
       * const securityTXT = await client.securityTXT.get({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      get(params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/security-center/securitytxt`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/snippets/content.mjs
var Content2;
var init_content2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/snippets/content.mjs"() {
    init_import_meta_url();
    init_resource();
    Content2 = class extends APIResource {
      static {
        __name(this, "Content");
      }
      /**
       * Fetches the content of a snippet belonging to the zone.
       */
      get(snippetName, params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/snippets/${snippetName}/content`, {
          ...options,
          headers: { Accept: "multipart/form-data", ...options?.headers },
          __binaryResponse: true
        });
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/snippets/rules.mjs
var Rules9, RuleUpdateResponsesSinglePage2, RuleListResponsesSinglePage2, RuleDeleteResponsesSinglePage;
var init_rules10 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/snippets/rules.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Rules9 = class extends APIResource {
      static {
        __name(this, "Rules");
      }
      /**
       * Updates all snippet rules belonging to the zone.
       */
      update(params, options) {
        const { zone_id, ...body } = params;
        return this._client.getAPIList(`/zones/${zone_id}/snippets/snippet_rules`, RuleUpdateResponsesSinglePage2, { body, method: "put", ...options });
      }
      /**
       * Fetches all snippet rules belonging to the zone.
       */
      list(params, options) {
        const { zone_id } = params;
        return this._client.getAPIList(`/zones/${zone_id}/snippets/snippet_rules`, RuleListResponsesSinglePage2, options);
      }
      /**
       * Deletes all snippet rules belonging to the zone.
       */
      delete(params, options) {
        const { zone_id } = params;
        return this._client.getAPIList(`/zones/${zone_id}/snippets/snippet_rules`, RuleDeleteResponsesSinglePage, { method: "delete", ...options });
      }
    };
    RuleUpdateResponsesSinglePage2 = class extends SinglePage {
      static {
        __name(this, "RuleUpdateResponsesSinglePage");
      }
    };
    RuleListResponsesSinglePage2 = class extends SinglePage {
      static {
        __name(this, "RuleListResponsesSinglePage");
      }
    };
    RuleDeleteResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "RuleDeleteResponsesSinglePage");
      }
    };
    Rules9.RuleUpdateResponsesSinglePage = RuleUpdateResponsesSinglePage2;
    Rules9.RuleListResponsesSinglePage = RuleListResponsesSinglePage2;
    Rules9.RuleDeleteResponsesSinglePage = RuleDeleteResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/snippets/snippets.mjs
var Snippets, SnippetListResponsesV4PagePaginationArray;
var init_snippets = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/snippets/snippets.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    init_content2();
    init_content2();
    init_rules10();
    init_rules10();
    init_pagination();
    Snippets = class extends APIResource {
      static {
        __name(this, "Snippets");
      }
      constructor() {
        super(...arguments);
        this.content = new Content2(this._client);
        this.rules = new Rules9(this._client);
      }
      /**
       * Creates or updates a snippet belonging to the zone.
       */
      update(snippetName, params, options) {
        const { zone_id, ...body } = params;
        return this._client.put(`/zones/${zone_id}/snippets/${snippetName}`, multipartFormRequestOptions({ body, ...options, __multipartSyntax: "json" }))._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetches all snippets belonging to the zone.
       */
      list(params, options) {
        const { zone_id, ...query } = params;
        return this._client.getAPIList(`/zones/${zone_id}/snippets`, SnippetListResponsesV4PagePaginationArray, {
          query,
          ...options
        });
      }
      /**
       * Deletes a snippet belonging to the zone.
       */
      delete(snippetName, params, options) {
        const { zone_id } = params;
        return this._client.delete(`/zones/${zone_id}/snippets/${snippetName}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetches a snippet belonging to the zone.
       */
      get(snippetName, params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/snippets/${snippetName}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    SnippetListResponsesV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "SnippetListResponsesV4PagePaginationArray");
      }
    };
    Snippets.SnippetListResponsesV4PagePaginationArray = SnippetListResponsesV4PagePaginationArray;
    Snippets.Content = Content2;
    Snippets.Rules = Rules9;
    Snippets.RuleUpdateResponsesSinglePage = RuleUpdateResponsesSinglePage2;
    Snippets.RuleListResponsesSinglePage = RuleListResponsesSinglePage2;
    Snippets.RuleDeleteResponsesSinglePage = RuleDeleteResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/spectrum/apps.mjs
var Apps2, AppListResponsesV4PagePaginationArray;
var init_apps2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/spectrum/apps.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Apps2 = class extends APIResource {
      static {
        __name(this, "Apps");
      }
      /**
       * Creates a new Spectrum application from a configuration using a name for the
       * origin.
       *
       * @example
       * ```ts
       * const app = await client.spectrum.apps.create({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   dns: {},
       *   protocol: 'tcp/22',
       *   traffic_type: 'direct',
       * });
       * ```
       */
      create(params, options) {
        const { zone_id, ...body } = params;
        return this._client.post(`/zones/${zone_id}/spectrum/apps`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Updates a previously existing application's configuration that uses a name for
       * the origin.
       *
       * @example
       * ```ts
       * const app = await client.spectrum.apps.update(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   {
       *     zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     dns: {},
       *     protocol: 'tcp/22',
       *     traffic_type: 'direct',
       *   },
       * );
       * ```
       */
      update(appId, params, options) {
        const { zone_id, ...body } = params;
        return this._client.put(`/zones/${zone_id}/spectrum/apps/${appId}`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Retrieves a list of currently existing Spectrum applications inside a zone.
       */
      list(params, options) {
        const { zone_id, ...query } = params;
        return this._client.getAPIList(`/zones/${zone_id}/spectrum/apps`, AppListResponsesV4PagePaginationArray, {
          query,
          ...options
        });
      }
      /**
       * Deletes a previously existing application.
       */
      delete(appId, params, options) {
        const { zone_id } = params;
        return this._client.delete(`/zones/${zone_id}/spectrum/apps/${appId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Gets the application configuration of a specific application inside a zone.
       */
      get(appId, params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/spectrum/apps/${appId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    AppListResponsesV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "AppListResponsesV4PagePaginationArray");
      }
    };
    Apps2.AppListResponsesV4PagePaginationArray = AppListResponsesV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/spectrum/analytics/aggregates/currents.mjs
var Currents;
var init_currents = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/spectrum/analytics/aggregates/currents.mjs"() {
    init_import_meta_url();
    init_resource();
    Currents = class extends APIResource {
      static {
        __name(this, "Currents");
      }
      /**
       * Retrieves analytics aggregated from the last minute of usage on Spectrum
       * applications underneath a given zone.
       */
      get(params, options) {
        const { zone_id, ...query } = params;
        return this._client.get(`/zones/${zone_id}/spectrum/analytics/aggregate/current`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/spectrum/analytics/aggregates/aggregates.mjs
var Aggregates;
var init_aggregates = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/spectrum/analytics/aggregates/aggregates.mjs"() {
    init_import_meta_url();
    init_resource();
    init_currents();
    init_currents();
    Aggregates = class extends APIResource {
      static {
        __name(this, "Aggregates");
      }
      constructor() {
        super(...arguments);
        this.currents = new Currents(this._client);
      }
    };
    Aggregates.Currents = Currents;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/spectrum/analytics/events/bytimes.mjs
var Bytimes3;
var init_bytimes3 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/spectrum/analytics/events/bytimes.mjs"() {
    init_import_meta_url();
    init_resource();
    Bytimes3 = class extends APIResource {
      static {
        __name(this, "Bytimes");
      }
      /**
       * Retrieves a list of aggregate metrics grouped by time interval.
       */
      get(params, options) {
        const { zone_id, ...query } = params;
        return this._client.get(`/zones/${zone_id}/spectrum/analytics/events/bytime`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/spectrum/analytics/events/summaries.mjs
var Summaries;
var init_summaries = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/spectrum/analytics/events/summaries.mjs"() {
    init_import_meta_url();
    init_resource();
    Summaries = class extends APIResource {
      static {
        __name(this, "Summaries");
      }
      /**
       * Retrieves a list of summarised aggregate metrics over a given time period.
       */
      get(params, options) {
        const { zone_id, ...query } = params;
        return this._client.get(`/zones/${zone_id}/spectrum/analytics/events/summary`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/spectrum/analytics/events/events.mjs
var Events4;
var init_events5 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/spectrum/analytics/events/events.mjs"() {
    init_import_meta_url();
    init_resource();
    init_bytimes3();
    init_bytimes3();
    init_summaries();
    init_summaries();
    Events4 = class extends APIResource {
      static {
        __name(this, "Events");
      }
      constructor() {
        super(...arguments);
        this.bytimes = new Bytimes3(this._client);
        this.summaries = new Summaries(this._client);
      }
    };
    Events4.Bytimes = Bytimes3;
    Events4.Summaries = Summaries;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/spectrum/analytics/analytics.mjs
var Analytics3;
var init_analytics3 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/spectrum/analytics/analytics.mjs"() {
    init_import_meta_url();
    init_resource();
    init_aggregates();
    init_aggregates();
    init_events5();
    init_events5();
    Analytics3 = class extends APIResource {
      static {
        __name(this, "Analytics");
      }
      constructor() {
        super(...arguments);
        this.aggregates = new Aggregates(this._client);
        this.events = new Events4(this._client);
      }
    };
    Analytics3.Aggregates = Aggregates;
    Analytics3.Events = Events4;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/spectrum/spectrum.mjs
var Spectrum;
var init_spectrum = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/spectrum/spectrum.mjs"() {
    init_import_meta_url();
    init_resource();
    init_apps2();
    init_apps2();
    init_analytics3();
    init_analytics3();
    Spectrum = class extends APIResource {
      static {
        __name(this, "Spectrum");
      }
      constructor() {
        super(...arguments);
        this.analytics = new Analytics3(this._client);
        this.apps = new Apps2(this._client);
      }
    };
    Spectrum.Analytics = Analytics3;
    Spectrum.Apps = Apps2;
    Spectrum.AppListResponsesV4PagePaginationArray = AppListResponsesV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/speed/availabilities.mjs
var Availabilities;
var init_availabilities = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/speed/availabilities.mjs"() {
    init_import_meta_url();
    init_resource();
    Availabilities = class extends APIResource {
      static {
        __name(this, "Availabilities");
      }
      /**
       * Retrieves quota for all plans, as well as the current zone quota.
       *
       * @example
       * ```ts
       * const availability = await client.speed.availabilities.list(
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      list(params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/speed_api/availabilities`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/speed/schedule.mjs
var ScheduleResource;
var init_schedule = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/speed/schedule.mjs"() {
    init_import_meta_url();
    init_resource();
    ScheduleResource = class extends APIResource {
      static {
        __name(this, "ScheduleResource");
      }
      /**
       * Creates a scheduled test for a page.
       *
       * @example
       * ```ts
       * const schedule = await client.speed.schedule.create(
       *   'example.com',
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      create(url4, params, options) {
        const { zone_id, region } = params;
        return this._client.post(`/zones/${zone_id}/speed_api/schedule/${url4}`, {
          query: { region },
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Deletes a scheduled test for a page.
       *
       * @example
       * ```ts
       * const schedule = await client.speed.schedule.delete(
       *   'example.com',
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      delete(url4, params, options) {
        const { zone_id, region } = params;
        return this._client.delete(`/zones/${zone_id}/speed_api/schedule/${url4}`, {
          query: { region },
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Retrieves the test schedule for a page in a specific region.
       *
       * @example
       * ```ts
       * const schedule = await client.speed.schedule.get(
       *   'example.com',
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(url4, params, options) {
        const { zone_id, ...query } = params;
        return this._client.get(`/zones/${zone_id}/speed_api/schedule/${url4}`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/speed/pages/tests.mjs
var Tests, TestsV4PagePaginationArray;
var init_tests = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/speed/pages/tests.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Tests = class extends APIResource {
      static {
        __name(this, "Tests");
      }
      /**
       * Starts a test for a specific webpage, in a specific region.
       *
       * @example
       * ```ts
       * const test = await client.speed.pages.tests.create(
       *   'example.com',
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      create(url4, params, options) {
        const { zone_id, ...body } = params;
        return this._client.post(`/zones/${zone_id}/speed_api/pages/${url4}/tests`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Test history (list of tests) for a specific webpage.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const test of client.speed.pages.tests.list(
       *   'example.com',
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(url4, params, options) {
        const { zone_id, ...query } = params;
        return this._client.getAPIList(`/zones/${zone_id}/speed_api/pages/${url4}/tests`, TestsV4PagePaginationArray, { query, ...options });
      }
      /**
       * Deletes all tests for a specific webpage from a specific region. Deleted tests
       * are still counted as part of the quota.
       *
       * @example
       * ```ts
       * const test = await client.speed.pages.tests.delete(
       *   'example.com',
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      delete(url4, params, options) {
        const { zone_id, region } = params;
        return this._client.delete(`/zones/${zone_id}/speed_api/pages/${url4}/tests`, {
          query: { region },
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Retrieves the result of a specific test.
       *
       * @example
       * ```ts
       * const test = await client.speed.pages.tests.get(
       *   'example.com',
       *   'test_id',
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(url4, testId, params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/speed_api/pages/${url4}/tests/${testId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    TestsV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "TestsV4PagePaginationArray");
      }
    };
    Tests.TestsV4PagePaginationArray = TestsV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/speed/pages/pages.mjs
var Pages2, PageListResponsesSinglePage;
var init_pages2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/speed/pages/pages.mjs"() {
    init_import_meta_url();
    init_resource();
    init_tests();
    init_tests();
    init_pagination();
    Pages2 = class extends APIResource {
      static {
        __name(this, "Pages");
      }
      constructor() {
        super(...arguments);
        this.tests = new Tests(this._client);
      }
      /**
       * Lists all webpages which have been tested.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const pageListResponse of client.speed.pages.list(
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { zone_id } = params;
        return this._client.getAPIList(`/zones/${zone_id}/speed_api/pages`, PageListResponsesSinglePage, options);
      }
      /**
       * Lists the core web vital metrics trend over time for a specific page.
       *
       * @example
       * ```ts
       * const trend = await client.speed.pages.trend(
       *   'example.com',
       *   {
       *     zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     deviceType: 'DESKTOP',
       *     metrics: 'performanceScore,ttfb,fcp,si,lcp,tti,tbt,cls',
       *     region: 'us-central1',
       *     start: '2014-01-01T05:20:00.12345Z',
       *     tz: 'tz',
       *   },
       * );
       * ```
       */
      trend(url4, params, options) {
        const { zone_id, ...query } = params;
        return this._client.get(`/zones/${zone_id}/speed_api/pages/${url4}/trend`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
    PageListResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "PageListResponsesSinglePage");
      }
    };
    Pages2.PageListResponsesSinglePage = PageListResponsesSinglePage;
    Pages2.Tests = Tests;
    Pages2.TestsV4PagePaginationArray = TestsV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/speed/speed.mjs
var Speed2;
var init_speed2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/speed/speed.mjs"() {
    init_import_meta_url();
    init_resource();
    init_availabilities();
    init_availabilities();
    init_schedule();
    init_schedule();
    init_pages2();
    init_pages2();
    Speed2 = class extends APIResource {
      static {
        __name(this, "Speed");
      }
      constructor() {
        super(...arguments);
        this.schedule = new ScheduleResource(this._client);
        this.availabilities = new Availabilities(this._client);
        this.pages = new Pages2(this._client);
      }
    };
    Speed2.ScheduleResource = ScheduleResource;
    Speed2.Availabilities = Availabilities;
    Speed2.Pages = Pages2;
    Speed2.PageListResponsesSinglePage = PageListResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/stream/audio-tracks.mjs
var AudioTracks, AudioSinglePage;
var init_audio_tracks = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/stream/audio-tracks.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    AudioTracks = class extends APIResource {
      static {
        __name(this, "AudioTracks");
      }
      /**
       * Deletes additional audio tracks on a video. Deleting a default audio track is
       * not allowed. You must assign another audio track as default prior to deletion.
       *
       * @example
       * ```ts
       * const audioTrack = await client.stream.audioTracks.delete(
       *   'ea95132c15732412d22c1476fa83f27a',
       *   'ea95132c15732412d22c1476fa83f27a',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      delete(identifier, audioIdentifier, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/stream/${identifier}/audio/${audioIdentifier}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Adds an additional audio track to a video using the provided audio track URL.
       *
       * @example
       * ```ts
       * const audio = await client.stream.audioTracks.copy(
       *   'ea95132c15732412d22c1476fa83f27a',
       *   {
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     label: 'director commentary',
       *   },
       * );
       * ```
       */
      copy(identifier, params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/stream/${identifier}/audio/copy`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Edits additional audio tracks on a video. Editing the default status of an audio
       * track to `true` will mark all other audio tracks on the video default status to
       * `false`.
       *
       * @example
       * ```ts
       * const audio = await client.stream.audioTracks.edit(
       *   'ea95132c15732412d22c1476fa83f27a',
       *   'ea95132c15732412d22c1476fa83f27a',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      edit(identifier, audioIdentifier, params, options) {
        const { account_id, ...body } = params;
        return this._client.patch(`/accounts/${account_id}/stream/${identifier}/audio/${audioIdentifier}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Lists additional audio tracks on a video. Note this API will not return
       * information for audio attached to the video upload.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const audio of client.stream.audioTracks.get(
       *   'ea95132c15732412d22c1476fa83f27a',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      get(identifier, params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/stream/${identifier}/audio`, AudioSinglePage, options);
      }
    };
    AudioSinglePage = class extends SinglePage {
      static {
        __name(this, "AudioSinglePage");
      }
    };
    AudioTracks.AudioSinglePage = AudioSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/stream/clip.mjs
var ClipResource;
var init_clip = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/stream/clip.mjs"() {
    init_import_meta_url();
    init_resource();
    ClipResource = class extends APIResource {
      static {
        __name(this, "ClipResource");
      }
      /**
       * Clips a video based on the specified start and end times provided in seconds.
       *
       * @example
       * ```ts
       * const clip = await client.stream.clip.create({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   clippedFromVideoUID: '023e105f4ecef8ad9ca31a8372d0c353',
       *   endTimeSeconds: 0,
       *   startTimeSeconds: 0,
       * });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/stream/clip`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/stream/copy.mjs
var Copy;
var init_copy = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/stream/copy.mjs"() {
    init_import_meta_url();
    init_resource();
    Copy = class extends APIResource {
      static {
        __name(this, "Copy");
      }
      /**
       * Uploads a video to Stream from a provided URL.
       *
       * @example
       * ```ts
       * const video = await client.stream.copy.create({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   url: 'https://example.com/myvideo.mp4',
       * });
       * ```
       */
      create(params, options) {
        const { account_id, "Upload-Creator": uploadCreator, ...body } = params;
        return this._client.post(`/accounts/${account_id}/stream/copy`, {
          body,
          ...options,
          headers: {
            ...uploadCreator != null ? { "Upload-Creator": uploadCreator } : void 0,
            ...options?.headers
          }
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/stream/direct-upload.mjs
var DirectUpload;
var init_direct_upload = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/stream/direct-upload.mjs"() {
    init_import_meta_url();
    init_resource();
    DirectUpload = class extends APIResource {
      static {
        __name(this, "DirectUpload");
      }
      /**
       * Creates a direct upload that allows video uploads without an API key.
       *
       * @example
       * ```ts
       * const directUpload =
       *   await client.stream.directUpload.create({
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     maxDurationSeconds: 1,
       *   });
       * ```
       */
      create(params, options) {
        const { account_id, "Upload-Creator": uploadCreator, ...body } = params;
        return this._client.post(`/accounts/${account_id}/stream/direct_upload`, {
          body,
          ...options,
          headers: {
            ...uploadCreator != null ? { "Upload-Creator": uploadCreator } : void 0,
            ...options?.headers
          }
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/stream/downloads.mjs
var Downloads2;
var init_downloads2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/stream/downloads.mjs"() {
    init_import_meta_url();
    init_resource();
    Downloads2 = class extends APIResource {
      static {
        __name(this, "Downloads");
      }
      /**
       * Creates a download for a video when a video is ready to view. Use
       * `/downloads/{download_type}` instead for type-specific downloads.
       *
       * @example
       * ```ts
       * const download = await client.stream.downloads.create(
       *   'ea95132c15732412d22c1476fa83f27a',
       *   {
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     body: {},
       *   },
       * );
       * ```
       */
      create(identifier, params, options) {
        const { account_id, body } = params;
        return this._client.post(`/accounts/${account_id}/stream/${identifier}/downloads`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Delete the downloads for a video. Use `/downloads/{download_type}` instead for
       * type-specific downloads.
       *
       * @example
       * ```ts
       * const download = await client.stream.downloads.delete(
       *   'ea95132c15732412d22c1476fa83f27a',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      delete(identifier, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/stream/${identifier}/downloads`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Lists the downloads created for a video.
       *
       * @example
       * ```ts
       * const download = await client.stream.downloads.get(
       *   'ea95132c15732412d22c1476fa83f27a',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(identifier, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/stream/${identifier}/downloads`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/stream/embed.mjs
var Embed;
var init_embed = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/stream/embed.mjs"() {
    init_import_meta_url();
    init_resource();
    Embed = class extends APIResource {
      static {
        __name(this, "Embed");
      }
      /**
       * Fetches an HTML code snippet to embed a video in a web page delivered through
       * Cloudflare. On success, returns an HTML fragment for use on web pages to display
       * a video. On failure, returns a JSON response body.
       *
       * @example
       * ```ts
       * const embed = await client.stream.embed.get(
       *   'ea95132c15732412d22c1476fa83f27a',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(identifier, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/stream/${identifier}/embed`, options);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/stream/keys.mjs
var Keys3, KeyGetResponsesSinglePage;
var init_keys3 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/stream/keys.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Keys3 = class extends APIResource {
      static {
        __name(this, "Keys");
      }
      /**
       * Creates an RSA private key in PEM and JWK formats. Key files are only displayed
       * once after creation. Keys are created, used, and deleted independently of
       * videos, and every key can sign any video.
       *
       * @example
       * ```ts
       * const keys = await client.stream.keys.create({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   body: {},
       * });
       * ```
       */
      create(params, options) {
        const { account_id, body } = params;
        return this._client.post(`/accounts/${account_id}/stream/keys`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Deletes signing keys and revokes all signed URLs generated with the key.
       *
       * @example
       * ```ts
       * const key = await client.stream.keys.delete(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      delete(identifier, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/stream/keys/${identifier}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Lists the video ID and creation date and time when a signing key was created.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const keyGetResponse of client.stream.keys.get({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * })) {
       *   // ...
       * }
       * ```
       */
      get(params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/stream/keys`, KeyGetResponsesSinglePage, options);
      }
    };
    KeyGetResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "KeyGetResponsesSinglePage");
      }
    };
    Keys3.KeyGetResponsesSinglePage = KeyGetResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/stream/token.mjs
var Token;
var init_token = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/stream/token.mjs"() {
    init_import_meta_url();
    init_resource();
    Token = class extends APIResource {
      static {
        __name(this, "Token");
      }
      /**
       * Creates a signed URL token for a video. If a body is not provided in the
       * request, a token is created with default values.
       *
       * @example
       * ```ts
       * const token = await client.stream.token.create(
       *   'ea95132c15732412d22c1476fa83f27a',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      create(identifier, params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/stream/${identifier}/token`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/stream/videos.mjs
var Videos;
var init_videos = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/stream/videos.mjs"() {
    init_import_meta_url();
    init_resource();
    Videos = class extends APIResource {
      static {
        __name(this, "Videos");
      }
      /**
       * Returns information about an account's storage use.
       *
       * @example
       * ```ts
       * const response = await client.stream.videos.storageUsage({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      storageUsage(params, options) {
        const { account_id, ...query } = params;
        return this._client.get(`/accounts/${account_id}/stream/storage-usage`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/stream/watermarks.mjs
var Watermarks, WatermarksSinglePage;
var init_watermarks = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/stream/watermarks.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    init_pagination();
    Watermarks = class extends APIResource {
      static {
        __name(this, "Watermarks");
      }
      /**
       * Creates watermark profiles using a single `HTTP POST multipart/form-data`
       * request.
       *
       * @example
       * ```ts
       * const watermark = await client.stream.watermarks.create({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   file: '@/Users/rchen/Downloads/watermark.png',
       * });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/stream/watermarks`, multipartFormRequestOptions({ body, ...options }))._thenUnwrap((obj) => obj.result);
      }
      /**
       * Lists all watermark profiles for an account.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const watermark of client.stream.watermarks.list(
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/stream/watermarks`, WatermarksSinglePage, options);
      }
      /**
       * Deletes a watermark profile.
       *
       * @example
       * ```ts
       * const watermark = await client.stream.watermarks.delete(
       *   'ea95132c15732412d22c1476fa83f27a',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      delete(identifier, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/stream/watermarks/${identifier}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Retrieves details for a single watermark profile.
       *
       * @example
       * ```ts
       * const watermark = await client.stream.watermarks.get(
       *   'ea95132c15732412d22c1476fa83f27a',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(identifier, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/stream/watermarks/${identifier}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    WatermarksSinglePage = class extends SinglePage {
      static {
        __name(this, "WatermarksSinglePage");
      }
    };
    Watermarks.WatermarksSinglePage = WatermarksSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/stream/webhooks.mjs
var Webhooks2;
var init_webhooks2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/stream/webhooks.mjs"() {
    init_import_meta_url();
    init_resource();
    Webhooks2 = class extends APIResource {
      static {
        __name(this, "Webhooks");
      }
      /**
       * Creates a webhook notification.
       *
       * @example
       * ```ts
       * const webhook = await client.stream.webhooks.update({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   notificationUrl: 'https://example.com',
       * });
       * ```
       */
      update(params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/stream/webhook`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Deletes a webhook.
       *
       * @example
       * ```ts
       * const webhook = await client.stream.webhooks.delete({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      delete(params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/stream/webhook`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Retrieves a list of webhooks.
       *
       * @example
       * ```ts
       * const webhook = await client.stream.webhooks.get({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      get(params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/stream/webhook`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/stream/captions/language/vtt.mjs
var Vtt;
var init_vtt = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/stream/captions/language/vtt.mjs"() {
    init_import_meta_url();
    init_resource();
    Vtt = class extends APIResource {
      static {
        __name(this, "Vtt");
      }
      /**
       * Return WebVTT captions for a provided language.
       *
       * @example
       * ```ts
       * const vtt = await client.stream.captions.language.vtt.get(
       *   'ea95132c15732412d22c1476fa83f27a',
       *   'tr',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(identifier, language, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/stream/${identifier}/captions/${language}/vtt`, {
          ...options,
          headers: { Accept: "text/vtt", ...options?.headers }
        });
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/stream/captions/language/language.mjs
var Language;
var init_language = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/stream/captions/language/language.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    init_vtt();
    init_vtt();
    Language = class extends APIResource {
      static {
        __name(this, "Language");
      }
      constructor() {
        super(...arguments);
        this.vtt = new Vtt(this._client);
      }
      /**
       * Generate captions or subtitles for provided language via AI.
       *
       * @example
       * ```ts
       * const caption =
       *   await client.stream.captions.language.create(
       *     'ea95132c15732412d22c1476fa83f27a',
       *     'tr',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      create(identifier, language, params, options) {
        const { account_id } = params;
        return this._client.post(`/accounts/${account_id}/stream/${identifier}/captions/${language}/generate`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Uploads the caption or subtitle file to the endpoint for a specific BCP47
       * language. One caption or subtitle file per language is allowed.
       *
       * @example
       * ```ts
       * const caption =
       *   await client.stream.captions.language.update(
       *     'ea95132c15732412d22c1476fa83f27a',
       *     'tr',
       *     {
       *       account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *       file: '@/Users/kyle/Desktop/tr.vtt',
       *     },
       *   );
       * ```
       */
      update(identifier, language, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/stream/${identifier}/captions/${language}`, multipartFormRequestOptions({ body, ...options }))._thenUnwrap((obj) => obj.result);
      }
      /**
       * Removes the captions or subtitles from a video.
       *
       * @example
       * ```ts
       * const language =
       *   await client.stream.captions.language.delete(
       *     'ea95132c15732412d22c1476fa83f27a',
       *     'tr',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      delete(identifier, language, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/stream/${identifier}/captions/${language}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Lists the captions or subtitles for provided language.
       *
       * @example
       * ```ts
       * const caption = await client.stream.captions.language.get(
       *   'ea95132c15732412d22c1476fa83f27a',
       *   'tr',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(identifier, language, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/stream/${identifier}/captions/${language}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    Language.Vtt = Vtt;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/stream/captions/captions.mjs
var Captions, CaptionsSinglePage;
var init_captions = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/stream/captions/captions.mjs"() {
    init_import_meta_url();
    init_resource();
    init_language();
    init_language();
    init_pagination();
    Captions = class extends APIResource {
      static {
        __name(this, "Captions");
      }
      constructor() {
        super(...arguments);
        this.language = new Language(this._client);
      }
      /**
       * Lists the available captions or subtitles for a specific video.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const caption of client.stream.captions.get(
       *   'ea95132c15732412d22c1476fa83f27a',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      get(identifier, params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/stream/${identifier}/captions`, CaptionsSinglePage, options);
      }
    };
    CaptionsSinglePage = class extends SinglePage {
      static {
        __name(this, "CaptionsSinglePage");
      }
    };
    Captions.CaptionsSinglePage = CaptionsSinglePage;
    Captions.Language = Language;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/stream/live-inputs/outputs.mjs
var Outputs, OutputsSinglePage;
var init_outputs = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/stream/live-inputs/outputs.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Outputs = class extends APIResource {
      static {
        __name(this, "Outputs");
      }
      /**
       * Creates a new output that can be used to simulcast or restream live video to
       * other RTMP or SRT destinations. Outputs are always linked to a specific live
       * input — one live input can have many outputs.
       *
       * @example
       * ```ts
       * const output =
       *   await client.stream.liveInputs.outputs.create(
       *     '66be4bf738797e01e1fca35a7bdecdcd',
       *     {
       *       account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *       streamKey: 'uzya-f19y-g2g9-a2ee-51j2',
       *       url: 'rtmp://a.rtmp.youtube.com/live2',
       *     },
       *   );
       * ```
       */
      create(liveInputIdentifier, params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/stream/live_inputs/${liveInputIdentifier}/outputs`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Updates the state of an output.
       *
       * @example
       * ```ts
       * const output =
       *   await client.stream.liveInputs.outputs.update(
       *     '66be4bf738797e01e1fca35a7bdecdcd',
       *     'baea4d9c515887b80289d5c33cf01145',
       *     {
       *       account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *       enabled: true,
       *     },
       *   );
       * ```
       */
      update(liveInputIdentifier, outputIdentifier, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/stream/live_inputs/${liveInputIdentifier}/outputs/${outputIdentifier}`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Retrieves all outputs associated with a specified live input.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const output of client.stream.liveInputs.outputs.list(
       *   '66be4bf738797e01e1fca35a7bdecdcd',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(liveInputIdentifier, params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/stream/live_inputs/${liveInputIdentifier}/outputs`, OutputsSinglePage, options);
      }
      /**
       * Deletes an output and removes it from the associated live input.
       *
       * @example
       * ```ts
       * await client.stream.liveInputs.outputs.delete(
       *   '66be4bf738797e01e1fca35a7bdecdcd',
       *   'baea4d9c515887b80289d5c33cf01145',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      delete(liveInputIdentifier, outputIdentifier, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/stream/live_inputs/${liveInputIdentifier}/outputs/${outputIdentifier}`, { ...options, headers: { Accept: "*/*", ...options?.headers } });
      }
    };
    OutputsSinglePage = class extends SinglePage {
      static {
        __name(this, "OutputsSinglePage");
      }
    };
    Outputs.OutputsSinglePage = OutputsSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/stream/live-inputs/live-inputs.mjs
var LiveInputs;
var init_live_inputs = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/stream/live-inputs/live-inputs.mjs"() {
    init_import_meta_url();
    init_resource();
    init_outputs();
    init_outputs();
    LiveInputs = class extends APIResource {
      static {
        __name(this, "LiveInputs");
      }
      constructor() {
        super(...arguments);
        this.outputs = new Outputs(this._client);
      }
      /**
       * Creates a live input, and returns credentials that you or your users can use to
       * stream live video to Cloudflare Stream.
       *
       * @example
       * ```ts
       * const liveInput = await client.stream.liveInputs.create({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/stream/live_inputs`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Updates a specified live input.
       *
       * @example
       * ```ts
       * const liveInput = await client.stream.liveInputs.update(
       *   '66be4bf738797e01e1fca35a7bdecdcd',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      update(liveInputIdentifier, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/stream/live_inputs/${liveInputIdentifier}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Lists the live inputs created for an account. To get the credentials needed to
       * stream to a specific live input, request a single live input.
       *
       * @example
       * ```ts
       * const liveInputs = await client.stream.liveInputs.list({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.get(`/accounts/${account_id}/stream/live_inputs`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Prevents a live input from being streamed to and makes the live input
       * inaccessible to any future API calls.
       *
       * @example
       * ```ts
       * await client.stream.liveInputs.delete(
       *   '66be4bf738797e01e1fca35a7bdecdcd',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      delete(liveInputIdentifier, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/stream/live_inputs/${liveInputIdentifier}`, {
          ...options,
          headers: { Accept: "*/*", ...options?.headers }
        });
      }
      /**
       * Retrieves details of an existing live input.
       *
       * @example
       * ```ts
       * const liveInput = await client.stream.liveInputs.get(
       *   '66be4bf738797e01e1fca35a7bdecdcd',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(liveInputIdentifier, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/stream/live_inputs/${liveInputIdentifier}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    LiveInputs.Outputs = Outputs;
    LiveInputs.OutputsSinglePage = OutputsSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/stream/stream.mjs
var Stream2, VideosSinglePage;
var init_stream2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/stream/stream.mjs"() {
    init_import_meta_url();
    init_resource();
    init_audio_tracks();
    init_audio_tracks();
    init_clip();
    init_clip();
    init_copy();
    init_copy();
    init_direct_upload();
    init_direct_upload();
    init_downloads2();
    init_downloads2();
    init_embed();
    init_embed();
    init_keys3();
    init_keys3();
    init_token();
    init_token();
    init_videos();
    init_videos();
    init_watermarks();
    init_watermarks();
    init_webhooks2();
    init_webhooks2();
    init_captions();
    init_captions();
    init_live_inputs();
    init_live_inputs();
    init_pagination();
    Stream2 = class extends APIResource {
      static {
        __name(this, "Stream");
      }
      constructor() {
        super(...arguments);
        this.audioTracks = new AudioTracks(this._client);
        this.videos = new Videos(this._client);
        this.clip = new ClipResource(this._client);
        this.copy = new Copy(this._client);
        this.directUpload = new DirectUpload(this._client);
        this.keys = new Keys3(this._client);
        this.liveInputs = new LiveInputs(this._client);
        this.watermarks = new Watermarks(this._client);
        this.webhooks = new Webhooks2(this._client);
        this.captions = new Captions(this._client);
        this.downloads = new Downloads2(this._client);
        this.embed = new Embed(this._client);
        this.token = new Token(this._client);
      }
      /**
       * Initiates a video upload using the TUS protocol. On success, the server responds
       * with a status code 201 (created) and includes a `location` header to indicate
       * where the content should be uploaded. Refer to https://tus.io for protocol
       * details.
       *
       * @example
       * ```ts
       * await client.stream.create({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   body: {},
       *   'Tus-Resumable': '1.0.0',
       *   'Upload-Length': 0,
       * });
       * ```
       */
      create(params, options) {
        const { account_id, body, "Tus-Resumable": tusResumable, "Upload-Length": uploadLength, direct_user, "Upload-Creator": uploadCreator, "Upload-Metadata": uploadMetadata } = params;
        return this._client.post(`/accounts/${account_id}/stream`, {
          query: { direct_user },
          body,
          ...options,
          headers: {
            Accept: "*/*",
            "Tus-Resumable": tusResumable.toString(),
            "Upload-Length": uploadLength.toString(),
            ...uploadCreator != null ? { "Upload-Creator": uploadCreator } : void 0,
            ...uploadMetadata != null ? { "Upload-Metadata": uploadMetadata } : void 0,
            ...options?.headers
          }
        });
      }
      /**
       * Lists up to 1000 videos from a single request. For a specific range, refer to
       * the optional parameters.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const video of client.stream.list({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * })) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/stream`, VideosSinglePage, { query, ...options });
      }
      /**
       * Deletes a video and its copies from Cloudflare Stream.
       *
       * @example
       * ```ts
       * await client.stream.delete(
       *   'ea95132c15732412d22c1476fa83f27a',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      delete(identifier, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/stream/${identifier}`, {
          ...options,
          headers: { Accept: "*/*", ...options?.headers }
        });
      }
      /**
       * Edit details for a single video.
       *
       * @example
       * ```ts
       * const video = await client.stream.edit(
       *   'ea95132c15732412d22c1476fa83f27a',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      edit(identifier, params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/stream/${identifier}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetches details for a single video.
       *
       * @example
       * ```ts
       * const video = await client.stream.get(
       *   'ea95132c15732412d22c1476fa83f27a',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(identifier, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/stream/${identifier}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    VideosSinglePage = class extends SinglePage {
      static {
        __name(this, "VideosSinglePage");
      }
    };
    Stream2.VideosSinglePage = VideosSinglePage;
    Stream2.AudioTracks = AudioTracks;
    Stream2.AudioSinglePage = AudioSinglePage;
    Stream2.Videos = Videos;
    Stream2.ClipResource = ClipResource;
    Stream2.Copy = Copy;
    Stream2.DirectUpload = DirectUpload;
    Stream2.KeyGetResponsesSinglePage = KeyGetResponsesSinglePage;
    Stream2.LiveInputs = LiveInputs;
    Stream2.Watermarks = Watermarks;
    Stream2.WatermarksSinglePage = WatermarksSinglePage;
    Stream2.Webhooks = Webhooks2;
    Stream2.Captions = Captions;
    Stream2.CaptionsSinglePage = CaptionsSinglePage;
    Stream2.Downloads = Downloads2;
    Stream2.Embed = Embed;
    Stream2.Token = Token;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/turnstile/widgets.mjs
var Widgets, WidgetListResponsesV4PagePaginationArray;
var init_widgets = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/turnstile/widgets.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Widgets = class extends APIResource {
      static {
        __name(this, "Widgets");
      }
      /**
       * Lists challenge widgets.
       *
       * @example
       * ```ts
       * const widget = await client.turnstile.widgets.create({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   domains: [
       *     '203.0.113.1',
       *     'cloudflare.com',
       *     'blog.example.com',
       *   ],
       *   mode: 'invisible',
       *   name: 'blog.cloudflare.com login form',
       * });
       * ```
       */
      create(params, options) {
        const { account_id, direction, order, page, per_page, ...body } = params;
        return this._client.post(`/accounts/${account_id}/challenges/widgets`, {
          query: { direction, order, page, per_page },
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Update the configuration of a widget.
       *
       * @example
       * ```ts
       * const widget = await client.turnstile.widgets.update(
       *   '0x4AAF00AAAABn0R22HWm-YUc',
       *   {
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     domains: [
       *       '203.0.113.1',
       *       'cloudflare.com',
       *       'blog.example.com',
       *     ],
       *     mode: 'invisible',
       *     name: 'blog.cloudflare.com login form',
       *   },
       * );
       * ```
       */
      update(sitekey, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/challenges/widgets/${sitekey}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Lists all turnstile widgets of an account.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const widgetListResponse of client.turnstile.widgets.list(
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/challenges/widgets`, WidgetListResponsesV4PagePaginationArray, { query, ...options });
      }
      /**
       * Destroy a Turnstile Widget.
       *
       * @example
       * ```ts
       * const widget = await client.turnstile.widgets.delete(
       *   '0x4AAF00AAAABn0R22HWm-YUc',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      delete(sitekey, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/challenges/widgets/${sitekey}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Show a single challenge widget configuration.
       *
       * @example
       * ```ts
       * const widget = await client.turnstile.widgets.get(
       *   '0x4AAF00AAAABn0R22HWm-YUc',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(sitekey, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/challenges/widgets/${sitekey}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Generate a new secret key for this widget. If `invalidate_immediately` is set to
       * `false`, the previous secret remains valid for 2 hours.
       *
       * Note that secrets cannot be rotated again during the grace period.
       *
       * @example
       * ```ts
       * const widget = await client.turnstile.widgets.rotateSecret(
       *   '0x4AAF00AAAABn0R22HWm-YUc',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      rotateSecret(sitekey, params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/challenges/widgets/${sitekey}/rotate_secret`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
    WidgetListResponsesV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "WidgetListResponsesV4PagePaginationArray");
      }
    };
    Widgets.WidgetListResponsesV4PagePaginationArray = WidgetListResponsesV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/turnstile/turnstile.mjs
var Turnstile;
var init_turnstile = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/turnstile/turnstile.mjs"() {
    init_import_meta_url();
    init_resource();
    init_widgets();
    init_widgets();
    Turnstile = class extends APIResource {
      static {
        __name(this, "Turnstile");
      }
      constructor() {
        super(...arguments);
        this.widgets = new Widgets(this._client);
      }
    };
    Turnstile.Widgets = Widgets;
    Turnstile.WidgetListResponsesV4PagePaginationArray = WidgetListResponsesV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/url-normalization.mjs
var URLNormalization;
var init_url_normalization = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/url-normalization.mjs"() {
    init_import_meta_url();
    init_resource();
    URLNormalization = class extends APIResource {
      static {
        __name(this, "URLNormalization");
      }
      /**
       * Updates the URL Normalization settings.
       *
       * @example
       * ```ts
       * const urlNormalization =
       *   await client.urlNormalization.update({
       *     zone_id: '9f1839b6152d298aca64c4e906b6d074',
       *     scope: 'incoming',
       *     type: 'cloudflare',
       *   });
       * ```
       */
      update(params, options) {
        const { zone_id, ...body } = params;
        return this._client.put(`/zones/${zone_id}/url_normalization`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Deletes the URL Normalization settings.
       *
       * @example
       * ```ts
       * await client.urlNormalization.delete({
       *   zone_id: '9f1839b6152d298aca64c4e906b6d074',
       * });
       * ```
       */
      delete(params, options) {
        const { zone_id } = params;
        return this._client.delete(`/zones/${zone_id}/url_normalization`, {
          ...options,
          headers: { Accept: "*/*", ...options?.headers }
        });
      }
      /**
       * Fetches the current URL Normalization settings.
       *
       * @example
       * ```ts
       * const urlNormalization = await client.urlNormalization.get({
       *   zone_id: '9f1839b6152d298aca64c4e906b6d074',
       * });
       * ```
       */
      get(params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/url_normalization`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/url-scanner/responses.mjs
var Responses;
var init_responses = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/url-scanner/responses.mjs"() {
    init_import_meta_url();
    init_resource();
    Responses = class extends APIResource {
      static {
        __name(this, "Responses");
      }
      /**
       * Returns the raw response of the network request. Find the `response_id` in the
       * `data.requests.response.hash`.
       *
       * @example
       * ```ts
       * const response = await client.urlScanner.responses.get(
       *   'response_id',
       *   { account_id: 'account_id' },
       * );
       * ```
       */
      get(responseId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/urlscanner/v2/responses/${responseId}`, {
          ...options,
          headers: { Accept: "text/plain", ...options?.headers }
        });
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/url-scanner/scans.mjs
var Scans2;
var init_scans2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/url-scanner/scans.mjs"() {
    init_import_meta_url();
    init_resource();
    Scans2 = class extends APIResource {
      static {
        __name(this, "Scans");
      }
      /**
       * Submit a URL to scan. Check limits at
       * https://developers.cloudflare.com/security-center/investigate/scan-limits/.
       *
       * @example
       * ```ts
       * const scan = await client.urlScanner.scans.create({
       *   account_id: 'account_id',
       *   url: 'https://www.example.com',
       * });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/urlscanner/v2/scan`, { body, ...options });
      }
      /**
       * Use a subset of ElasticSearch Query syntax to filter scans. Some example
       * queries:<br/> <br/>- 'path:"/bundles/jquery.js"': Searches for scans who
       * requested resources with the given path.<br/>- 'page.asn:AS24940 AND hash:xxx':
       * Websites hosted in AS24940 where a resource with the given hash was
       * downloaded.<br/>- 'page.domain:microsoft\* AND verdicts.malicious:true AND NOT
       * page.domain:microsoft.com': malicious scans whose hostname starts with
       * "microsoft".<br/>- 'apikey:me AND date:[2025-01 TO 2025-02]': my scans from 2025
       * January to 2025 February.
       *
       * @example
       * ```ts
       * const scans = await client.urlScanner.scans.list({
       *   account_id: 'account_id',
       * });
       * ```
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.get(`/accounts/${account_id}/urlscanner/v2/search`, { query, ...options });
      }
      /**
       * Submit URLs to scan. Check limits at
       * https://developers.cloudflare.com/security-center/investigate/scan-limits/ and
       * take into account scans submitted in bulk have lower priority and may take
       * longer to finish.
       *
       * @example
       * ```ts
       * const response = await client.urlScanner.scans.bulkCreate({
       *   account_id: 'account_id',
       * });
       * ```
       */
      bulkCreate(params, options) {
        const { account_id, body } = params ?? {};
        return this._client.post(`/accounts/${account_id}/urlscanner/v2/bulk`, { body, ...options });
      }
      /**
       * Returns a plain text response, with the scan's DOM content as rendered by
       * Chrome.
       *
       * @example
       * ```ts
       * const response = await client.urlScanner.scans.dom(
       *   '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
       *   { account_id: 'account_id' },
       * );
       * ```
       */
      dom(scanId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/urlscanner/v2/dom/${scanId}`, {
          ...options,
          headers: { Accept: "text/plain", ...options?.headers }
        });
      }
      /**
       * Get URL scan by uuid
       *
       * @example
       * ```ts
       * const scan = await client.urlScanner.scans.get(
       *   '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
       *   { account_id: 'account_id' },
       * );
       * ```
       */
      get(scanId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/urlscanner/v2/result/${scanId}`, options);
      }
      /**
       * Get a URL scan's HAR file. See HAR spec at
       * http://www.softwareishard.com/blog/har-12-spec/.
       *
       * @example
       * ```ts
       * const response = await client.urlScanner.scans.har(
       *   '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
       *   { account_id: 'account_id' },
       * );
       * ```
       */
      har(scanId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/urlscanner/v2/har/${scanId}`, options);
      }
      /**
       * Get scan's screenshot by resolution (desktop/mobile/tablet).
       *
       * @example
       * ```ts
       * const response = await client.urlScanner.scans.screenshot(
       *   '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
       *   { account_id: 'account_id' },
       * );
       *
       * const content = await response.blob();
       * console.log(content);
       * ```
       */
      screenshot(scanId, params, options) {
        const { account_id, ...query } = params;
        return this._client.get(`/accounts/${account_id}/urlscanner/v2/screenshots/${scanId}.png`, {
          query,
          ...options,
          headers: { Accept: "image/png", ...options?.headers },
          __binaryResponse: true
        });
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/url-scanner/url-scanner.mjs
var URLScanner;
var init_url_scanner = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/url-scanner/url-scanner.mjs"() {
    init_import_meta_url();
    init_resource();
    init_responses();
    init_responses();
    init_scans2();
    init_scans2();
    URLScanner = class extends APIResource {
      static {
        __name(this, "URLScanner");
      }
      constructor() {
        super(...arguments);
        this.responses = new Responses(this._client);
        this.scans = new Scans2(this._client);
      }
    };
    URLScanner.Responses = Responses;
    URLScanner.Scans = Scans2;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/user/audit-logs.mjs
var AuditLogs2;
var init_audit_logs2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/user/audit-logs.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    init_shared();
    AuditLogs2 = class extends APIResource {
      static {
        __name(this, "AuditLogs");
      }
      list(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.list({}, query);
        }
        return this._client.getAPIList("/user/audit_logs", AuditLogsV4PagePaginationArray, { query, ...options });
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/user/invites.mjs
var Invites, InvitesSinglePage;
var init_invites = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/user/invites.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Invites = class extends APIResource {
      static {
        __name(this, "Invites");
      }
      /**
       * Lists all invitations associated with my user.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const invite of client.user.invites.list()) {
       *   // ...
       * }
       * ```
       */
      list(options) {
        return this._client.getAPIList("/user/invites", InvitesSinglePage, options);
      }
      /**
       * Responds to an invitation.
       *
       * @example
       * ```ts
       * const invite = await client.user.invites.edit(
       *   '4f5f0c14a2a41d5063dd301b2f829f04',
       *   { status: 'accepted' },
       * );
       * ```
       */
      edit(inviteId, body, options) {
        return this._client.patch(`/user/invites/${inviteId}`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Gets the details of an invitation.
       *
       * @example
       * ```ts
       * const invite = await client.user.invites.get(
       *   '4f5f0c14a2a41d5063dd301b2f829f04',
       * );
       * ```
       */
      get(inviteId, options) {
        return this._client.get(`/user/invites/${inviteId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    InvitesSinglePage = class extends SinglePage {
      static {
        __name(this, "InvitesSinglePage");
      }
    };
    Invites.InvitesSinglePage = InvitesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/user/organizations.mjs
var Organizations, OrganizationsV4PagePaginationArray;
var init_organizations = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/user/organizations.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    init_pagination();
    Organizations = class extends APIResource {
      static {
        __name(this, "Organizations");
      }
      list(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.list({}, query);
        }
        return this._client.getAPIList("/user/organizations", OrganizationsV4PagePaginationArray, {
          query,
          ...options
        });
      }
      /**
       * Removes association to an organization.
       *
       * @deprecated
       */
      delete(organizationId, options) {
        return this._client.delete(`/user/organizations/${organizationId}`, options);
      }
      /**
       * Gets a specific organization the user is associated with.
       *
       * @deprecated
       */
      get(organizationId, options) {
        return this._client.get(`/user/organizations/${organizationId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    OrganizationsV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "OrganizationsV4PagePaginationArray");
      }
    };
    Organizations.OrganizationsV4PagePaginationArray = OrganizationsV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/user/subscriptions.mjs
var Subscriptions3;
var init_subscriptions3 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/user/subscriptions.mjs"() {
    init_import_meta_url();
    init_resource();
    init_shared();
    Subscriptions3 = class extends APIResource {
      static {
        __name(this, "Subscriptions");
      }
      /**
       * Updates a user's subscriptions.
       *
       * @example
       * ```ts
       * const subscription = await client.user.subscriptions.update(
       *   '506e3185e9c882d175a2d0cb0093d9f2',
       * );
       * ```
       */
      update(identifier, body, options) {
        return this._client.put(`/user/subscriptions/${identifier}`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Deletes a user's subscription.
       *
       * @example
       * ```ts
       * const subscription = await client.user.subscriptions.delete(
       *   '506e3185e9c882d175a2d0cb0093d9f2',
       * );
       * ```
       */
      delete(identifier, options) {
        return this._client.delete(`/user/subscriptions/${identifier}`, options);
      }
      /**
       * Lists all of a user's subscriptions.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const subscription of client.user.subscriptions.get()) {
       *   // ...
       * }
       * ```
       */
      get(options) {
        return this._client.getAPIList("/user/subscriptions", SubscriptionsSinglePage, options);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/user/billing/history.mjs
var History2, BillingHistoriesV4PagePaginationArray;
var init_history3 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/user/billing/history.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    init_pagination();
    History2 = class extends APIResource {
      static {
        __name(this, "History");
      }
      list(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.list({}, query);
        }
        return this._client.getAPIList("/user/billing/history", BillingHistoriesV4PagePaginationArray, {
          query,
          ...options
        });
      }
    };
    BillingHistoriesV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "BillingHistoriesV4PagePaginationArray");
      }
    };
    History2.BillingHistoriesV4PagePaginationArray = BillingHistoriesV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/user/billing/profile.mjs
var Profile;
var init_profile = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/user/billing/profile.mjs"() {
    init_import_meta_url();
    init_resource();
    Profile = class extends APIResource {
      static {
        __name(this, "Profile");
      }
      /**
       * Accesses your billing profile object.
       *
       * @deprecated
       */
      get(options) {
        return this._client.get("/user/billing/profile", options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/user/billing/billing.mjs
var Billing2;
var init_billing2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/user/billing/billing.mjs"() {
    init_import_meta_url();
    init_resource();
    init_history3();
    init_history3();
    init_profile();
    init_profile();
    Billing2 = class extends APIResource {
      static {
        __name(this, "Billing");
      }
      constructor() {
        super(...arguments);
        this.history = new History2(this._client);
        this.profile = new Profile(this._client);
      }
    };
    Billing2.History = History2;
    Billing2.BillingHistoriesV4PagePaginationArray = BillingHistoriesV4PagePaginationArray;
    Billing2.Profile = Profile;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/user/tokens/permission-groups.mjs
var PermissionGroups3, PermissionGroupListResponsesSinglePage2;
var init_permission_groups3 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/user/tokens/permission-groups.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    init_pagination();
    PermissionGroups3 = class extends APIResource {
      static {
        __name(this, "PermissionGroups");
      }
      list(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.list({}, query);
        }
        return this._client.getAPIList("/user/tokens/permission_groups", PermissionGroupListResponsesSinglePage2, {
          query,
          ...options
        });
      }
    };
    PermissionGroupListResponsesSinglePage2 = class extends SinglePage {
      static {
        __name(this, "PermissionGroupListResponsesSinglePage");
      }
    };
    PermissionGroups3.PermissionGroupListResponsesSinglePage = PermissionGroupListResponsesSinglePage2;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/user/tokens/value.mjs
var Value2;
var init_value2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/user/tokens/value.mjs"() {
    init_import_meta_url();
    init_resource();
    Value2 = class extends APIResource {
      static {
        __name(this, "Value");
      }
      /**
       * Roll the token secret.
       *
       * @example
       * ```ts
       * const tokenValue = await client.user.tokens.value.update(
       *   'ed17574386854bf78a67040be0a770b0',
       *   {},
       * );
       * ```
       */
      update(tokenId, body, options) {
        return this._client.put(`/user/tokens/${tokenId}/value`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/user/tokens/tokens.mjs
var Tokens3;
var init_tokens3 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/user/tokens/tokens.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    init_shared();
    init_permission_groups3();
    init_permission_groups3();
    init_value2();
    init_value2();
    Tokens3 = class extends APIResource {
      static {
        __name(this, "Tokens");
      }
      constructor() {
        super(...arguments);
        this.permissionGroups = new PermissionGroups3(this._client);
        this.value = new Value2(this._client);
      }
      /**
       * Create a new access token.
       *
       * @example
       * ```ts
       * const token = await client.user.tokens.create({
       *   name: 'readonly token',
       *   policies: [
       *     {
       *       effect: 'allow',
       *       permission_groups: [
       *         { id: 'c8fed203ed3043cba015a93ad1616f1f' },
       *         { id: '82e64a83756745bbbb1c9c2701bf816b' },
       *       ],
       *       resources: { foo: 'string' },
       *     },
       *   ],
       * });
       * ```
       */
      create(body, options) {
        return this._client.post("/user/tokens", { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Update an existing token.
       *
       * @example
       * ```ts
       * const token = await client.user.tokens.update(
       *   'ed17574386854bf78a67040be0a770b0',
       *   {
       *     name: 'readonly token',
       *     policies: [
       *       {
       *         effect: 'allow',
       *         permission_groups: [
       *           { id: 'c8fed203ed3043cba015a93ad1616f1f' },
       *           { id: '82e64a83756745bbbb1c9c2701bf816b' },
       *         ],
       *         resources: { foo: 'string' },
       *       },
       *     ],
       *   },
       * );
       * ```
       */
      update(tokenId, body, options) {
        return this._client.put(`/user/tokens/${tokenId}`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      list(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.list({}, query);
        }
        return this._client.getAPIList("/user/tokens", TokensV4PagePaginationArray, { query, ...options });
      }
      /**
       * Destroy a token.
       *
       * @example
       * ```ts
       * const token = await client.user.tokens.delete(
       *   'ed17574386854bf78a67040be0a770b0',
       * );
       * ```
       */
      delete(tokenId, options) {
        return this._client.delete(`/user/tokens/${tokenId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get information about a specific token.
       *
       * @example
       * ```ts
       * const token = await client.user.tokens.get(
       *   'ed17574386854bf78a67040be0a770b0',
       * );
       * ```
       */
      get(tokenId, options) {
        return this._client.get(`/user/tokens/${tokenId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Test whether a token works.
       *
       * @example
       * ```ts
       * const response = await client.user.tokens.verify();
       * ```
       */
      verify(options) {
        return this._client.get("/user/tokens/verify", options)._thenUnwrap((obj) => obj.result);
      }
    };
    Tokens3.PermissionGroups = PermissionGroups3;
    Tokens3.PermissionGroupListResponsesSinglePage = PermissionGroupListResponsesSinglePage2;
    Tokens3.Value = Value2;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/user/user.mjs
var User;
var init_user = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/user/user.mjs"() {
    init_import_meta_url();
    init_resource();
    init_audit_logs2();
    init_audit_logs2();
    init_invites();
    init_invites();
    init_organizations();
    init_organizations();
    init_subscriptions3();
    init_subscriptions3();
    init_billing2();
    init_billing2();
    init_tokens3();
    init_tokens3();
    User = class extends APIResource {
      static {
        __name(this, "User");
      }
      constructor() {
        super(...arguments);
        this.auditLogs = new AuditLogs2(this._client);
        this.billing = new Billing2(this._client);
        this.invites = new Invites(this._client);
        this.organizations = new Organizations(this._client);
        this.subscriptions = new Subscriptions3(this._client);
        this.tokens = new Tokens3(this._client);
      }
      /**
       * Edit part of your user details.
       *
       * @example
       * ```ts
       * const response = await client.user.edit();
       * ```
       */
      edit(body, options) {
        return this._client.patch("/user", { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * User Details
       *
       * @example
       * ```ts
       * const user = await client.user.get();
       * ```
       */
      get(options) {
        return this._client.get("/user", options)._thenUnwrap((obj) => obj.result);
      }
    };
    User.AuditLogs = AuditLogs2;
    User.Billing = Billing2;
    User.Invites = Invites;
    User.InvitesSinglePage = InvitesSinglePage;
    User.Organizations = Organizations;
    User.OrganizationsV4PagePaginationArray = OrganizationsV4PagePaginationArray;
    User.Subscriptions = Subscriptions3;
    User.Tokens = Tokens3;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/vectorize/indexes/metadata-index.mjs
var MetadataIndex;
var init_metadata_index = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/vectorize/indexes/metadata-index.mjs"() {
    init_import_meta_url();
    init_resource();
    MetadataIndex = class extends APIResource {
      static {
        __name(this, "MetadataIndex");
      }
      /**
       * Enable metadata filtering based on metadata property. Limited to 10 properties.
       *
       * @example
       * ```ts
       * const metadataIndex =
       *   await client.vectorize.indexes.metadataIndex.create(
       *     'example-index',
       *     {
       *       account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *       indexType: 'string',
       *       propertyName: 'random_metadata_property',
       *     },
       *   );
       * ```
       */
      create(indexName, params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/vectorize/v2/indexes/${indexName}/metadata_index/create`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List Metadata Indexes for the specified Vectorize Index.
       *
       * @example
       * ```ts
       * const metadataIndices =
       *   await client.vectorize.indexes.metadataIndex.list(
       *     'example-index',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      list(indexName, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/vectorize/v2/indexes/${indexName}/metadata_index/list`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Allow Vectorize to delete the specified metadata index.
       *
       * @example
       * ```ts
       * const metadataIndex =
       *   await client.vectorize.indexes.metadataIndex.delete(
       *     'example-index',
       *     {
       *       account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *       propertyName: 'random_metadata_property',
       *     },
       *   );
       * ```
       */
      delete(indexName, params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/vectorize/v2/indexes/${indexName}/metadata_index/delete`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/vectorize/indexes/indexes.mjs
var Indexes, CreateIndicesSinglePage;
var init_indexes = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/vectorize/indexes/indexes.mjs"() {
    init_import_meta_url();
    init_resource();
    init_metadata_index();
    init_metadata_index();
    init_pagination();
    Indexes = class extends APIResource {
      static {
        __name(this, "Indexes");
      }
      constructor() {
        super(...arguments);
        this.metadataIndex = new MetadataIndex(this._client);
      }
      /**
       * Creates and returns a new Vectorize Index.
       *
       * @example
       * ```ts
       * const createIndex = await client.vectorize.indexes.create({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   config: { dimensions: 768, metric: 'cosine' },
       *   name: 'example-index',
       * });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/vectorize/v2/indexes`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Returns a list of Vectorize Indexes
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const createIndex of client.vectorize.indexes.list(
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/vectorize/v2/indexes`, CreateIndicesSinglePage, options);
      }
      /**
       * Deletes the specified Vectorize Index.
       *
       * @example
       * ```ts
       * const index = await client.vectorize.indexes.delete(
       *   'example-index',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      delete(indexName, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/vectorize/v2/indexes/${indexName}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Delete a set of vectors from an index by their vector identifiers.
       *
       * @example
       * ```ts
       * const response = await client.vectorize.indexes.deleteByIds(
       *   'example-index',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      deleteByIds(indexName, params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/vectorize/v2/indexes/${indexName}/delete_by_ids`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Returns the specified Vectorize Index.
       *
       * @example
       * ```ts
       * const createIndex = await client.vectorize.indexes.get(
       *   'example-index',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(indexName, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/vectorize/v2/indexes/${indexName}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get a set of vectors from an index by their vector identifiers.
       *
       * @example
       * ```ts
       * const response = await client.vectorize.indexes.getByIds(
       *   'example-index',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      getByIds(indexName, params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/vectorize/v2/indexes/${indexName}/get_by_ids`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get information about a vectorize index.
       *
       * @example
       * ```ts
       * const response = await client.vectorize.indexes.info(
       *   'example-index',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      info(indexName, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/vectorize/v2/indexes/${indexName}/info`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Inserts vectors into the specified index and returns a mutation id corresponding
       * to the vectors enqueued for insertion.
       *
       * @example
       * ```ts
       * const response = await client.vectorize.indexes.insert(
       *   'example-index',
       *   {
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     body: fs.createReadStream('path/to/file'),
       *   },
       * );
       * ```
       */
      insert(indexName, params, options) {
        const { account_id, body, "unparsable-behavior": unparsableBehavior } = params;
        return this._client.post(`/accounts/${account_id}/vectorize/v2/indexes/${indexName}/insert`, {
          query: { "unparsable-behavior": unparsableBehavior },
          body,
          ...options,
          headers: { "Content-Type": "application/x-ndjson", ...options?.headers },
          __binaryRequest: true
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Returns a paginated list of vector identifiers from the specified index.
       *
       * @example
       * ```ts
       * const response = await client.vectorize.indexes.listVectors(
       *   'example-index',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      listVectors(indexName, params, options) {
        const { account_id, ...query } = params;
        return this._client.get(`/accounts/${account_id}/vectorize/v2/indexes/${indexName}/list`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Finds vectors closest to a given vector in an index.
       *
       * @example
       * ```ts
       * const response = await client.vectorize.indexes.query(
       *   'example-index',
       *   {
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     vector: [0.5, 0.5, 0.5],
       *   },
       * );
       * ```
       */
      query(indexName, params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/vectorize/v2/indexes/${indexName}/query`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Upserts vectors into the specified index, creating them if they do not exist and
       * returns a mutation id corresponding to the vectors enqueued for upsertion.
       *
       * @example
       * ```ts
       * const response = await client.vectorize.indexes.upsert(
       *   'example-index',
       *   {
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     body: fs.createReadStream('path/to/file'),
       *   },
       * );
       * ```
       */
      upsert(indexName, params, options) {
        const { account_id, body, "unparsable-behavior": unparsableBehavior } = params;
        return this._client.post(`/accounts/${account_id}/vectorize/v2/indexes/${indexName}/upsert`, {
          query: { "unparsable-behavior": unparsableBehavior },
          body,
          ...options,
          headers: { "Content-Type": "application/x-ndjson", ...options?.headers },
          __binaryRequest: true
        })._thenUnwrap((obj) => obj.result);
      }
    };
    CreateIndicesSinglePage = class extends SinglePage {
      static {
        __name(this, "CreateIndicesSinglePage");
      }
    };
    Indexes.CreateIndicesSinglePage = CreateIndicesSinglePage;
    Indexes.MetadataIndex = MetadataIndex;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/vectorize/vectorize.mjs
var Vectorize;
var init_vectorize = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/vectorize/vectorize.mjs"() {
    init_import_meta_url();
    init_resource();
    init_indexes();
    init_indexes();
    Vectorize = class extends APIResource {
      static {
        __name(this, "Vectorize");
      }
      constructor() {
        super(...arguments);
        this.indexes = new Indexes(this._client);
      }
    };
    Vectorize.Indexes = Indexes;
    Vectorize.CreateIndicesSinglePage = CreateIndicesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/waiting-rooms/page.mjs
var Page;
var init_page = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/waiting-rooms/page.mjs"() {
    init_import_meta_url();
    init_resource();
    Page = class extends APIResource {
      static {
        __name(this, "Page");
      }
      /**
       * Creates a waiting room page preview. Upload a custom waiting room page for
       * preview. You will receive a preview URL in the form
       * `http://waitingrooms.dev/preview/<uuid>`. You can use the following query
       * parameters to change the state of the preview:
       *
       * 1. `force_queue`: Boolean indicating if all users will be queued in the waiting
       *    room and no one will be let into the origin website (also known as queueAll).
       * 2. `queue_is_full`: Boolean indicating if the waiting room's queue is currently
       *    full and not accepting new users at the moment.
       * 3. `queueing_method`: The queueing method currently used by the waiting room.
       *    - **fifo** indicates a FIFO queue.
       *    - **random** indicates a Random queue.
       *    - **passthrough** indicates a Passthrough queue. Keep in mind that the
       *      waiting room page will only be displayed if `force_queue=true` or
       *      `event=prequeueing` — for other cases the request will pass through to the
       *      origin. For our preview, this will be a fake origin website returning
       *      \"Welcome\".
       *    - **reject** indicates a Reject queue.
       * 4. `event`: Used to preview a waiting room event.
       *    - **none** indicates no event is occurring.
       *    - **prequeueing** indicates that an event is prequeueing (between
       *      `prequeue_start_time` and `event_start_time`).
       *    - **started** indicates that an event has started (between `event_start_time`
       *      and `event_end_time`).
       * 5. `shuffle_at_event_start`: Boolean indicating if the event will shuffle users
       *    in the prequeue when it starts. This can only be set to **true** if an event
       *    is active (`event` is not **none**).
       *
       * For example, you can make a request to
       * `http://waitingrooms.dev/preview/<uuid>?force_queue=false&queue_is_full=false&queueing_method=random&event=started&shuffle_at_event_start=true` 6.
       * `waitTime`: Non-zero, positive integer indicating the estimated wait time in
       * minutes. The default value is 10 minutes.
       *
       * For example, you can make a request to
       * `http://waitingrooms.dev/preview/<uuid>?waitTime=50` to configure the estimated
       * wait time as 50 minutes.
       *
       * @example
       * ```ts
       * const response = await client.waitingRooms.page.preview({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   custom_html:
       *     '{{#waitTimeKnown}} {{waitTime}} mins {{/waitTimeKnown}} {{^waitTimeKnown}} Queue all enabled {{/waitTimeKnown}}',
       * });
       * ```
       */
      preview(params, options) {
        const { zone_id, ...body } = params;
        return this._client.post(`/zones/${zone_id}/waiting_rooms/preview`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/waiting-rooms/rules.mjs
var Rules10, WaitingRoomRulesSinglePage;
var init_rules11 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/waiting-rooms/rules.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Rules10 = class extends APIResource {
      static {
        __name(this, "Rules");
      }
      /**
       * Only available for the Waiting Room Advanced subscription. Creates a rule for a
       * waiting room.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const waitingRoomRule of client.waitingRooms.rules.create(
       *   '699d98642c564d2e855e9661899b7252',
       *   {
       *     zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     rules: {
       *       action: 'bypass_waiting_room',
       *       expression: 'ip.src in {10.20.30.40}',
       *     },
       *   },
       * )) {
       *   // ...
       * }
       * ```
       */
      create(waitingRoomId, params, options) {
        const { zone_id, rules } = params;
        return this._client.getAPIList(`/zones/${zone_id}/waiting_rooms/${waitingRoomId}/rules`, WaitingRoomRulesSinglePage, { body: rules, method: "post", ...options });
      }
      /**
       * Only available for the Waiting Room Advanced subscription. Replaces all rules
       * for a waiting room.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const waitingRoomRule of client.waitingRooms.rules.update(
       *   '699d98642c564d2e855e9661899b7252',
       *   {
       *     zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     rules: [
       *       {
       *         action: 'bypass_waiting_room',
       *         expression: 'ip.src in {10.20.30.40}',
       *       },
       *     ],
       *   },
       * )) {
       *   // ...
       * }
       * ```
       */
      update(waitingRoomId, params, options) {
        const { zone_id, rules } = params;
        return this._client.getAPIList(`/zones/${zone_id}/waiting_rooms/${waitingRoomId}/rules`, WaitingRoomRulesSinglePage, { body: rules, method: "put", ...options });
      }
      /**
       * Deletes a rule for a waiting room.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const waitingRoomRule of client.waitingRooms.rules.delete(
       *   '699d98642c564d2e855e9661899b7252',
       *   '25756b2dfe6e378a06b033b670413757',
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      delete(waitingRoomId, ruleId, params, options) {
        const { zone_id } = params;
        return this._client.getAPIList(`/zones/${zone_id}/waiting_rooms/${waitingRoomId}/rules/${ruleId}`, WaitingRoomRulesSinglePage, { method: "delete", ...options });
      }
      /**
       * Patches a rule for a waiting room.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const waitingRoomRule of client.waitingRooms.rules.edit(
       *   '699d98642c564d2e855e9661899b7252',
       *   '25756b2dfe6e378a06b033b670413757',
       *   {
       *     zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     action: 'bypass_waiting_room',
       *     expression: 'ip.src in {10.20.30.40}',
       *   },
       * )) {
       *   // ...
       * }
       * ```
       */
      edit(waitingRoomId, ruleId, params, options) {
        const { zone_id, ...body } = params;
        return this._client.getAPIList(`/zones/${zone_id}/waiting_rooms/${waitingRoomId}/rules/${ruleId}`, WaitingRoomRulesSinglePage, { body, method: "patch", ...options });
      }
      /**
       * Lists rules for a waiting room.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const waitingRoomRule of client.waitingRooms.rules.get(
       *   '699d98642c564d2e855e9661899b7252',
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      get(waitingRoomId, params, options) {
        const { zone_id } = params;
        return this._client.getAPIList(`/zones/${zone_id}/waiting_rooms/${waitingRoomId}/rules`, WaitingRoomRulesSinglePage, options);
      }
    };
    WaitingRoomRulesSinglePage = class extends SinglePage {
      static {
        __name(this, "WaitingRoomRulesSinglePage");
      }
    };
    Rules10.WaitingRoomRulesSinglePage = WaitingRoomRulesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/waiting-rooms/settings.mjs
var Settings10;
var init_settings10 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/waiting-rooms/settings.mjs"() {
    init_import_meta_url();
    init_resource();
    Settings10 = class extends APIResource {
      static {
        __name(this, "Settings");
      }
      /**
       * Update zone-level Waiting Room settings
       *
       * @example
       * ```ts
       * const setting = await client.waitingRooms.settings.update({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      update(params, options) {
        const { zone_id, ...body } = params;
        return this._client.put(`/zones/${zone_id}/waiting_rooms/settings`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Patch zone-level Waiting Room settings
       *
       * @example
       * ```ts
       * const response = await client.waitingRooms.settings.edit({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      edit(params, options) {
        const { zone_id, ...body } = params;
        return this._client.patch(`/zones/${zone_id}/waiting_rooms/settings`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get zone-level Waiting Room settings
       *
       * @example
       * ```ts
       * const setting = await client.waitingRooms.settings.get({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      get(params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/waiting_rooms/settings`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/waiting-rooms/statuses.mjs
var Statuses;
var init_statuses = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/waiting-rooms/statuses.mjs"() {
    init_import_meta_url();
    init_resource();
    Statuses = class extends APIResource {
      static {
        __name(this, "Statuses");
      }
      /**
       * Fetches the status of a configured waiting room. Response fields include:
       *
       * 1. `status`: String indicating the status of the waiting room. The possible
       *    status are:
       *    - **not_queueing** indicates that the configured thresholds have not been met
       *      and all users are going through to the origin.
       *    - **queueing** indicates that the thresholds have been met and some users are
       *      held in the waiting room.
       *    - **event_prequeueing** indicates that an event is active and is currently
       *      prequeueing users before it starts.
       *    - **suspended** indicates that the room is suspended.
       * 2. `event_id`: String of the current event's `id` if an event is active,
       *    otherwise an empty string.
       * 3. `estimated_queued_users`: Integer of the estimated number of users currently
       *    waiting in the queue.
       * 4. `estimated_total_active_users`: Integer of the estimated number of users
       *    currently active on the origin.
       * 5. `max_estimated_time_minutes`: Integer of the maximum estimated time currently
       *    presented to the users.
       *
       * @example
       * ```ts
       * const status = await client.waitingRooms.statuses.get(
       *   '699d98642c564d2e855e9661899b7252',
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(waitingRoomId, params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/waiting_rooms/${waitingRoomId}/status`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/waiting-rooms/events/details.mjs
var Details;
var init_details = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/waiting-rooms/events/details.mjs"() {
    init_import_meta_url();
    init_resource();
    Details = class extends APIResource {
      static {
        __name(this, "Details");
      }
      /**
       * Previews an event's configuration as if it was active. Inherited fields from the
       * waiting room will be displayed with their current values.
       *
       * @example
       * ```ts
       * const detail = await client.waitingRooms.events.details.get(
       *   '699d98642c564d2e855e9661899b7252',
       *   '25756b2dfe6e378a06b033b670413757',
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(waitingRoomId, eventId, params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/waiting_rooms/${waitingRoomId}/events/${eventId}/details`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/waiting-rooms/events/events.mjs
var Events5, EventsV4PagePaginationArray;
var init_events6 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/waiting-rooms/events/events.mjs"() {
    init_import_meta_url();
    init_resource();
    init_details();
    init_details();
    init_pagination();
    Events5 = class extends APIResource {
      static {
        __name(this, "Events");
      }
      constructor() {
        super(...arguments);
        this.details = new Details(this._client);
      }
      /**
       * Only available for the Waiting Room Advanced subscription. Creates an event for
       * a waiting room. An event takes place during a specified period of time,
       * temporarily changing the behavior of a waiting room. While the event is active,
       * some of the properties in the event's configuration may either override or
       * inherit from the waiting room's configuration. Note that events cannot overlap
       * with each other, so only one event can be active at a time.
       *
       * @example
       * ```ts
       * const event = await client.waitingRooms.events.create(
       *   '699d98642c564d2e855e9661899b7252',
       *   {
       *     zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     event_end_time: '2021-09-28T17:00:00.000Z',
       *     event_start_time: '2021-09-28T15:30:00.000Z',
       *     name: 'production_webinar_event',
       *   },
       * );
       * ```
       */
      create(waitingRoomId, params, options) {
        const { zone_id, ...body } = params;
        return this._client.post(`/zones/${zone_id}/waiting_rooms/${waitingRoomId}/events`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Updates a configured event for a waiting room.
       *
       * @example
       * ```ts
       * const event = await client.waitingRooms.events.update(
       *   '699d98642c564d2e855e9661899b7252',
       *   '25756b2dfe6e378a06b033b670413757',
       *   {
       *     zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     event_end_time: '2021-09-28T17:00:00.000Z',
       *     event_start_time: '2021-09-28T15:30:00.000Z',
       *     name: 'production_webinar_event',
       *   },
       * );
       * ```
       */
      update(waitingRoomId, eventId, params, options) {
        const { zone_id, ...body } = params;
        return this._client.put(`/zones/${zone_id}/waiting_rooms/${waitingRoomId}/events/${eventId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Lists events for a waiting room.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const event of client.waitingRooms.events.list(
       *   '699d98642c564d2e855e9661899b7252',
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(waitingRoomId, params, options) {
        const { zone_id, ...query } = params;
        return this._client.getAPIList(`/zones/${zone_id}/waiting_rooms/${waitingRoomId}/events`, EventsV4PagePaginationArray, { query, ...options });
      }
      /**
       * Deletes an event for a waiting room.
       *
       * @example
       * ```ts
       * const event = await client.waitingRooms.events.delete(
       *   '699d98642c564d2e855e9661899b7252',
       *   '25756b2dfe6e378a06b033b670413757',
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      delete(waitingRoomId, eventId, params, options) {
        const { zone_id } = params;
        return this._client.delete(`/zones/${zone_id}/waiting_rooms/${waitingRoomId}/events/${eventId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Patches a configured event for a waiting room.
       *
       * @example
       * ```ts
       * const event = await client.waitingRooms.events.edit(
       *   '699d98642c564d2e855e9661899b7252',
       *   '25756b2dfe6e378a06b033b670413757',
       *   {
       *     zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     event_end_time: '2021-09-28T17:00:00.000Z',
       *     event_start_time: '2021-09-28T15:30:00.000Z',
       *     name: 'production_webinar_event',
       *   },
       * );
       * ```
       */
      edit(waitingRoomId, eventId, params, options) {
        const { zone_id, ...body } = params;
        return this._client.patch(`/zones/${zone_id}/waiting_rooms/${waitingRoomId}/events/${eventId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetches a single configured event for a waiting room.
       *
       * @example
       * ```ts
       * const event = await client.waitingRooms.events.get(
       *   '699d98642c564d2e855e9661899b7252',
       *   '25756b2dfe6e378a06b033b670413757',
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(waitingRoomId, eventId, params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/waiting_rooms/${waitingRoomId}/events/${eventId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    EventsV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "EventsV4PagePaginationArray");
      }
    };
    Events5.EventsV4PagePaginationArray = EventsV4PagePaginationArray;
    Events5.Details = Details;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/waiting-rooms/waiting-rooms.mjs
var WaitingRooms, WaitingRoomsV4PagePaginationArray;
var init_waiting_rooms = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/waiting-rooms/waiting-rooms.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    init_page();
    init_page();
    init_rules11();
    init_rules11();
    init_settings10();
    init_settings10();
    init_statuses();
    init_statuses();
    init_events6();
    init_events6();
    init_error4();
    init_pagination();
    WaitingRooms = class extends APIResource {
      static {
        __name(this, "WaitingRooms");
      }
      constructor() {
        super(...arguments);
        this.page = new Page(this._client);
        this.events = new Events5(this._client);
        this.rules = new Rules10(this._client);
        this.statuses = new Statuses(this._client);
        this.settings = new Settings10(this._client);
      }
      /**
       * Creates a new waiting room.
       *
       * @example
       * ```ts
       * const waitingRoom = await client.waitingRooms.create({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   host: 'shop.example.com',
       *   name: 'production_webinar',
       *   new_users_per_minute: 200,
       *   total_active_users: 200,
       * });
       * ```
       */
      create(params, options) {
        const { zone_id, ...body } = params;
        return this._client.post(`/zones/${zone_id}/waiting_rooms`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Updates a configured waiting room.
       *
       * @example
       * ```ts
       * const waitingRoom = await client.waitingRooms.update(
       *   '699d98642c564d2e855e9661899b7252',
       *   {
       *     zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     host: 'shop.example.com',
       *     name: 'production_webinar',
       *     new_users_per_minute: 200,
       *     total_active_users: 200,
       *   },
       * );
       * ```
       */
      update(waitingRoomId, params, options) {
        const { zone_id, ...body } = params;
        return this._client.put(`/zones/${zone_id}/waiting_rooms/${waitingRoomId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      list(params = {}, options) {
        if (isRequestOptions(params)) {
          return this.list({}, params);
        }
        const { account_id, zone_id, ...query } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.getAPIList(`/${accountOrZone}/${accountOrZoneId}/waiting_rooms`, WaitingRoomsV4PagePaginationArray, { query, ...options });
      }
      /**
       * Deletes a waiting room.
       *
       * @example
       * ```ts
       * const waitingRoom = await client.waitingRooms.delete(
       *   '699d98642c564d2e855e9661899b7252',
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      delete(waitingRoomId, params, options) {
        const { zone_id } = params;
        return this._client.delete(`/zones/${zone_id}/waiting_rooms/${waitingRoomId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Patches a configured waiting room.
       *
       * @example
       * ```ts
       * const waitingRoom = await client.waitingRooms.edit(
       *   '699d98642c564d2e855e9661899b7252',
       *   {
       *     zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     host: 'shop.example.com',
       *     name: 'production_webinar',
       *     new_users_per_minute: 200,
       *     total_active_users: 200,
       *   },
       * );
       * ```
       */
      edit(waitingRoomId, params, options) {
        const { zone_id, ...body } = params;
        return this._client.patch(`/zones/${zone_id}/waiting_rooms/${waitingRoomId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetches a single configured waiting room.
       *
       * @example
       * ```ts
       * const waitingRoom = await client.waitingRooms.get(
       *   '699d98642c564d2e855e9661899b7252',
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(waitingRoomId, params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/waiting_rooms/${waitingRoomId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    WaitingRoomsV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "WaitingRoomsV4PagePaginationArray");
      }
    };
    WaitingRooms.WaitingRoomsV4PagePaginationArray = WaitingRoomsV4PagePaginationArray;
    WaitingRooms.Page = Page;
    WaitingRooms.Events = Events5;
    WaitingRooms.EventsV4PagePaginationArray = EventsV4PagePaginationArray;
    WaitingRooms.Rules = Rules10;
    WaitingRooms.WaitingRoomRulesSinglePage = WaitingRoomRulesSinglePage;
    WaitingRooms.Statuses = Statuses;
    WaitingRooms.Settings = Settings10;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/web3/hostnames/ipfs-universal-paths/content-lists/entries.mjs
var Entries;
var init_entries = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/web3/hostnames/ipfs-universal-paths/content-lists/entries.mjs"() {
    init_import_meta_url();
    init_resource();
    Entries = class extends APIResource {
      static {
        __name(this, "Entries");
      }
      /**
       * Create IPFS Universal Path Gateway Content List Entry
       *
       * @example
       * ```ts
       * const entry =
       *   await client.web3.hostnames.ipfsUniversalPaths.contentLists.entries.create(
       *     '023e105f4ecef8ad9ca31a8372d0c353',
       *     {
       *       zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *       content:
       *         'QmPZ9gcCEpqKTo6aq61g2nXGUhM4iCL3ewB6LDXZCtioEB',
       *       type: 'cid',
       *     },
       *   );
       * ```
       */
      create(identifier, params, options) {
        const { zone_id, ...body } = params;
        return this._client.post(`/zones/${zone_id}/web3/hostnames/${identifier}/ipfs_universal_path/content_list/entries`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Edit IPFS Universal Path Gateway Content List Entry
       *
       * @example
       * ```ts
       * const entry =
       *   await client.web3.hostnames.ipfsUniversalPaths.contentLists.entries.update(
       *     '023e105f4ecef8ad9ca31a8372d0c353',
       *     '023e105f4ecef8ad9ca31a8372d0c353',
       *     {
       *       zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *       content:
       *         'QmPZ9gcCEpqKTo6aq61g2nXGUhM4iCL3ewB6LDXZCtioEB',
       *       type: 'cid',
       *     },
       *   );
       * ```
       */
      update(identifier, contentListEntryIdentifier, params, options) {
        const { zone_id, ...body } = params;
        return this._client.put(`/zones/${zone_id}/web3/hostnames/${identifier}/ipfs_universal_path/content_list/entries/${contentListEntryIdentifier}`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List IPFS Universal Path Gateway Content List Entries
       *
       * @example
       * ```ts
       * const entries =
       *   await client.web3.hostnames.ipfsUniversalPaths.contentLists.entries.list(
       *     '023e105f4ecef8ad9ca31a8372d0c353',
       *     { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      list(identifier, params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/web3/hostnames/${identifier}/ipfs_universal_path/content_list/entries`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Delete IPFS Universal Path Gateway Content List Entry
       *
       * @example
       * ```ts
       * const entry =
       *   await client.web3.hostnames.ipfsUniversalPaths.contentLists.entries.delete(
       *     '023e105f4ecef8ad9ca31a8372d0c353',
       *     '023e105f4ecef8ad9ca31a8372d0c353',
       *     { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      delete(identifier, contentListEntryIdentifier, params, options) {
        const { zone_id } = params;
        return this._client.delete(`/zones/${zone_id}/web3/hostnames/${identifier}/ipfs_universal_path/content_list/entries/${contentListEntryIdentifier}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * IPFS Universal Path Gateway Content List Entry Details
       *
       * @example
       * ```ts
       * const entry =
       *   await client.web3.hostnames.ipfsUniversalPaths.contentLists.entries.get(
       *     '023e105f4ecef8ad9ca31a8372d0c353',
       *     '023e105f4ecef8ad9ca31a8372d0c353',
       *     { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      get(identifier, contentListEntryIdentifier, params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/web3/hostnames/${identifier}/ipfs_universal_path/content_list/entries/${contentListEntryIdentifier}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/web3/hostnames/ipfs-universal-paths/content-lists/content-lists.mjs
var ContentLists;
var init_content_lists = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/web3/hostnames/ipfs-universal-paths/content-lists/content-lists.mjs"() {
    init_import_meta_url();
    init_resource();
    init_entries();
    init_entries();
    ContentLists = class extends APIResource {
      static {
        __name(this, "ContentLists");
      }
      constructor() {
        super(...arguments);
        this.entries = new Entries(this._client);
      }
      /**
       * Update IPFS Universal Path Gateway Content List
       *
       * @example
       * ```ts
       * const contentList =
       *   await client.web3.hostnames.ipfsUniversalPaths.contentLists.update(
       *     '023e105f4ecef8ad9ca31a8372d0c353',
       *     {
       *       zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *       action: 'block',
       *       entries: [{}],
       *     },
       *   );
       * ```
       */
      update(identifier, params, options) {
        const { zone_id, ...body } = params;
        return this._client.put(`/zones/${zone_id}/web3/hostnames/${identifier}/ipfs_universal_path/content_list`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * IPFS Universal Path Gateway Content List Details
       *
       * @example
       * ```ts
       * const contentList =
       *   await client.web3.hostnames.ipfsUniversalPaths.contentLists.get(
       *     '023e105f4ecef8ad9ca31a8372d0c353',
       *     { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      get(identifier, params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/web3/hostnames/${identifier}/ipfs_universal_path/content_list`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    ContentLists.Entries = Entries;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/web3/hostnames/ipfs-universal-paths/ipfs-universal-paths.mjs
var IPFSUniversalPaths;
var init_ipfs_universal_paths = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/web3/hostnames/ipfs-universal-paths/ipfs-universal-paths.mjs"() {
    init_import_meta_url();
    init_resource();
    init_content_lists();
    init_content_lists();
    IPFSUniversalPaths = class extends APIResource {
      static {
        __name(this, "IPFSUniversalPaths");
      }
      constructor() {
        super(...arguments);
        this.contentLists = new ContentLists(this._client);
      }
    };
    IPFSUniversalPaths.ContentLists = ContentLists;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/web3/hostnames/hostnames.mjs
var Hostnames3, HostnamesSinglePage;
var init_hostnames3 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/web3/hostnames/hostnames.mjs"() {
    init_import_meta_url();
    init_resource();
    init_ipfs_universal_paths();
    init_ipfs_universal_paths();
    init_pagination();
    Hostnames3 = class extends APIResource {
      static {
        __name(this, "Hostnames");
      }
      constructor() {
        super(...arguments);
        this.ipfsUniversalPaths = new IPFSUniversalPaths(this._client);
      }
      /**
       * Create Web3 Hostname
       *
       * @example
       * ```ts
       * const hostname = await client.web3.hostnames.create({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   name: 'gateway.example.com',
       *   target: 'ipfs',
       * });
       * ```
       */
      create(params, options) {
        const { zone_id, ...body } = params;
        return this._client.post(`/zones/${zone_id}/web3/hostnames`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List Web3 Hostnames
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const hostname of client.web3.hostnames.list({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * })) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { zone_id } = params;
        return this._client.getAPIList(`/zones/${zone_id}/web3/hostnames`, HostnamesSinglePage, options);
      }
      /**
       * Delete Web3 Hostname
       *
       * @example
       * ```ts
       * const hostname = await client.web3.hostnames.delete(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      delete(identifier, params, options) {
        const { zone_id } = params;
        return this._client.delete(`/zones/${zone_id}/web3/hostnames/${identifier}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Edit Web3 Hostname
       *
       * @example
       * ```ts
       * const hostname = await client.web3.hostnames.edit(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      edit(identifier, params, options) {
        const { zone_id, ...body } = params;
        return this._client.patch(`/zones/${zone_id}/web3/hostnames/${identifier}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Web3 Hostname Details
       *
       * @example
       * ```ts
       * const hostname = await client.web3.hostnames.get(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(identifier, params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/web3/hostnames/${identifier}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    HostnamesSinglePage = class extends SinglePage {
      static {
        __name(this, "HostnamesSinglePage");
      }
    };
    Hostnames3.HostnamesSinglePage = HostnamesSinglePage;
    Hostnames3.IPFSUniversalPaths = IPFSUniversalPaths;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/web3/web3.mjs
var Web3;
var init_web3 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/web3/web3.mjs"() {
    init_import_meta_url();
    init_resource();
    init_hostnames3();
    init_hostnames3();
    Web3 = class extends APIResource {
      static {
        __name(this, "Web3");
      }
      constructor() {
        super(...arguments);
        this.hostnames = new Hostnames3(this._client);
      }
    };
    Web3.Hostnames = Hostnames3;
    Web3.HostnamesSinglePage = HostnamesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workers/account-settings.mjs
var AccountSettings;
var init_account_settings = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workers/account-settings.mjs"() {
    init_import_meta_url();
    init_resource();
    AccountSettings = class extends APIResource {
      static {
        __name(this, "AccountSettings");
      }
      /**
       * Creates Worker account settings for an account.
       *
       * @example
       * ```ts
       * const accountSetting =
       *   await client.workers.accountSettings.update({
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   });
       * ```
       */
      update(params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/workers/account-settings`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetches Worker account settings for an account.
       *
       * @example
       * ```ts
       * const accountSetting =
       *   await client.workers.accountSettings.get({
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   });
       * ```
       */
      get(params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/workers/account-settings`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workers/domains.mjs
var Domains6, DomainsSinglePage2;
var init_domains6 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workers/domains.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Domains6 = class extends APIResource {
      static {
        __name(this, "Domains");
      }
      /**
       * Attaches a Worker to a zone and hostname.
       *
       * @example
       * ```ts
       * const domain = await client.workers.domains.update({
       *   account_id: '9a7806061c88ada191ed06f989cc3dac',
       *   environment: 'production',
       *   hostname: 'foo.example.com',
       *   service: 'foo',
       *   zone_id: '593c9c94de529bbbfaac7c53ced0447d',
       * });
       * ```
       */
      update(params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/workers/domains`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Lists all Worker Domains for an account.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const domain of client.workers.domains.list({
       *   account_id: '9a7806061c88ada191ed06f989cc3dac',
       * })) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/workers/domains`, DomainsSinglePage2, {
          query,
          ...options
        });
      }
      /**
       * Detaches a Worker from a zone and hostname.
       *
       * @example
       * ```ts
       * await client.workers.domains.delete(
       *   'dbe10b4bc17c295377eabd600e1787fd',
       *   { account_id: '9a7806061c88ada191ed06f989cc3dac' },
       * );
       * ```
       */
      delete(domainId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/workers/domains/${domainId}`, {
          ...options,
          headers: { Accept: "*/*", ...options?.headers }
        });
      }
      /**
       * Gets a Worker domain.
       *
       * @example
       * ```ts
       * const domain = await client.workers.domains.get(
       *   'dbe10b4bc17c295377eabd600e1787fd',
       *   { account_id: '9a7806061c88ada191ed06f989cc3dac' },
       * );
       * ```
       */
      get(domainId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/workers/domains/${domainId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    DomainsSinglePage2 = class extends SinglePage {
      static {
        __name(this, "DomainsSinglePage");
      }
    };
    Domains6.DomainsSinglePage = DomainsSinglePage2;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workers/routes.mjs
var Routes3, RouteListResponsesSinglePage;
var init_routes3 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workers/routes.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Routes3 = class extends APIResource {
      static {
        __name(this, "Routes");
      }
      /**
       * Creates a route that maps a URL pattern to a Worker.
       *
       * @example
       * ```ts
       * const route = await client.workers.routes.create({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   pattern: 'example.com/*',
       * });
       * ```
       */
      create(params, options) {
        const { zone_id, ...body } = params;
        return this._client.post(`/zones/${zone_id}/workers/routes`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Updates the URL pattern or Worker associated with a route.
       *
       * @example
       * ```ts
       * const route = await client.workers.routes.update(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   {
       *     zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     pattern: 'example.com/*',
       *   },
       * );
       * ```
       */
      update(routeId, params, options) {
        const { zone_id, ...body } = params;
        return this._client.put(`/zones/${zone_id}/workers/routes/${routeId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Returns routes for a zone.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const routeListResponse of client.workers.routes.list(
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { zone_id } = params;
        return this._client.getAPIList(`/zones/${zone_id}/workers/routes`, RouteListResponsesSinglePage, options);
      }
      /**
       * Deletes a route.
       *
       * @example
       * ```ts
       * const route = await client.workers.routes.delete(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      delete(routeId, params, options) {
        const { zone_id } = params;
        return this._client.delete(`/zones/${zone_id}/workers/routes/${routeId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Returns information about a route, including URL pattern and Worker.
       *
       * @example
       * ```ts
       * const route = await client.workers.routes.get(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(routeId, params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/workers/routes/${routeId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    RouteListResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "RouteListResponsesSinglePage");
      }
    };
    Routes3.RouteListResponsesSinglePage = RouteListResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workers/subdomains.mjs
var Subdomains;
var init_subdomains = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workers/subdomains.mjs"() {
    init_import_meta_url();
    init_resource();
    Subdomains = class extends APIResource {
      static {
        __name(this, "Subdomains");
      }
      /**
       * Creates a Workers subdomain for an account.
       *
       * @example
       * ```ts
       * const subdomain = await client.workers.subdomains.update({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   subdomain: 'my-subdomain',
       * });
       * ```
       */
      update(params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/workers/subdomain`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Returns a Workers subdomain for an account.
       *
       * @example
       * ```ts
       * const subdomain = await client.workers.subdomains.get({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      get(params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/workers/subdomain`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workers/assets/upload.mjs
var Upload;
var init_upload = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workers/assets/upload.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    Upload = class extends APIResource {
      static {
        __name(this, "Upload");
      }
      /**
       * Upload assets ahead of creating a Worker version. To learn more about the direct
       * uploads of assets, see
       * https://developers.cloudflare.com/workers/static-assets/direct-upload/.
       *
       * @example
       * ```ts
       * const upload = await client.workers.assets.upload.create({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   base64: true,
       *   body: { foo: 'string' },
       * });
       * ```
       */
      create(params, options) {
        const { account_id, base64: base642, body } = params;
        return this._client.post(`/accounts/${account_id}/workers/assets/upload`, multipartFormRequestOptions({ query: { base64: base642 }, body, ...options }))._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workers/assets/assets.mjs
var Assets3;
var init_assets3 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workers/assets/assets.mjs"() {
    init_import_meta_url();
    init_resource();
    init_upload();
    init_upload();
    Assets3 = class extends APIResource {
      static {
        __name(this, "Assets");
      }
      constructor() {
        super(...arguments);
        this.upload = new Upload(this._client);
      }
    };
    Assets3.Upload = Upload;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workers/beta/workers/versions.mjs
var Versions3, VersionsV4PagePaginationArray;
var init_versions3 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workers/beta/workers/versions.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Versions3 = class extends APIResource {
      static {
        __name(this, "Versions");
      }
      /**
       * Create a new version.
       *
       * @example
       * ```ts
       * const version =
       *   await client.workers.beta.workers.versions.create(
       *     'worker_id',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      create(workerId, params, options) {
        const { account_id, deploy: deploy3, ...body } = params;
        return this._client.post(`/accounts/${account_id}/workers/workers/${workerId}/versions`, {
          query: { deploy: deploy3 },
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List all versions for a Worker.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const version of client.workers.beta.workers.versions.list(
       *   'worker_id',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(workerId, params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/workers/workers/${workerId}/versions`, VersionsV4PagePaginationArray, { query, ...options });
      }
      /**
       * Delete a version.
       *
       * @example
       * ```ts
       * const version =
       *   await client.workers.beta.workers.versions.delete(
       *     'worker_id',
       *     'version_id',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      delete(workerId, versionId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/workers/workers/${workerId}/versions/${versionId}`, options);
      }
      /**
       * Get details about a specific version.
       *
       * @example
       * ```ts
       * const version =
       *   await client.workers.beta.workers.versions.get(
       *     'worker_id',
       *     'version_id',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      get(workerId, versionId, params, options) {
        const { account_id, ...query } = params;
        return this._client.get(`/accounts/${account_id}/workers/workers/${workerId}/versions/${versionId}`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
    VersionsV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "VersionsV4PagePaginationArray");
      }
    };
    Versions3.VersionsV4PagePaginationArray = VersionsV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workers/beta/workers/workers.mjs
var Workers, WorkersV4PagePaginationArray;
var init_workers = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workers/beta/workers/workers.mjs"() {
    init_import_meta_url();
    init_resource();
    init_versions3();
    init_versions3();
    init_pagination();
    Workers = class extends APIResource {
      static {
        __name(this, "Workers");
      }
      constructor() {
        super(...arguments);
        this.versions = new Versions3(this._client);
      }
      /**
       * Create a new Worker.
       *
       * @example
       * ```ts
       * const worker = await client.workers.beta.workers.create({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   name: 'my-worker',
       * });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/workers/workers`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Perform a complete replacement of a Worker, where omitted properties are set to
       * their default values. This is the exact same as the Create Worker endpoint, but
       * operates on an existing Worker. To perform a partial update instead, use the
       * Edit Worker endpoint.
       *
       * @example
       * ```ts
       * const worker = await client.workers.beta.workers.update(
       *   'worker_id',
       *   {
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     name: 'my-worker',
       *   },
       * );
       * ```
       */
      update(workerId, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/workers/workers/${workerId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List all Workers for an account.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const worker of client.workers.beta.workers.list(
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/workers/workers`, WorkersV4PagePaginationArray, {
          query,
          ...options
        });
      }
      /**
       * Delete a Worker and all its associated resources (versions, deployments, etc.).
       *
       * @example
       * ```ts
       * const worker = await client.workers.beta.workers.delete(
       *   'worker_id',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      delete(workerId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/workers/workers/${workerId}`, options);
      }
      /**
       * Perform a partial update on a Worker, where omitted properties are left
       * unchanged from their current values.
       *
       * @example
       * ```ts
       * const worker = await client.workers.beta.workers.edit(
       *   'worker_id',
       *   {
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     logpush: true,
       *     name: 'my-worker',
       *     observability: {},
       *     subdomain: {},
       *     tags: ['my-team', 'my-public-api'],
       *     tail_consumers: [{ name: 'my-tail-consumer' }],
       *   },
       * );
       * ```
       */
      edit(workerId, params, options) {
        const { account_id, ...body } = params;
        return this._client.patch(`/accounts/${account_id}/workers/workers/${workerId}`, {
          body,
          ...options,
          headers: { "Content-Type": "application/merge-patch+json", ...options?.headers }
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get details about a specific Worker.
       *
       * @example
       * ```ts
       * const worker = await client.workers.beta.workers.get(
       *   'worker_id',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(workerId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/workers/workers/${workerId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    WorkersV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "WorkersV4PagePaginationArray");
      }
    };
    Workers.WorkersV4PagePaginationArray = WorkersV4PagePaginationArray;
    Workers.Versions = Versions3;
    Workers.VersionsV4PagePaginationArray = VersionsV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workers/beta/beta.mjs
var Beta;
var init_beta = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workers/beta/beta.mjs"() {
    init_import_meta_url();
    init_resource();
    init_workers();
    init_workers();
    Beta = class extends APIResource {
      static {
        __name(this, "Beta");
      }
      constructor() {
        super(...arguments);
        this.workers = new Workers(this._client);
      }
    };
    Beta.Workers = Workers;
    Beta.WorkersV4PagePaginationArray = WorkersV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workers/observability/telemetry.mjs
var Telemetry, TelemetryKeysResponsesSinglePage, TelemetryValuesResponsesSinglePage;
var init_telemetry = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workers/observability/telemetry.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Telemetry = class extends APIResource {
      static {
        __name(this, "Telemetry");
      }
      /**
       * List all the keys in your telemetry events.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const telemetryKeysResponse of client.workers.observability.telemetry.keys(
       *   { account_id: 'account_id' },
       * )) {
       *   // ...
       * }
       * ```
       */
      keys(params, options) {
        const { account_id, ...body } = params;
        return this._client.getAPIList(`/accounts/${account_id}/workers/observability/telemetry/keys`, TelemetryKeysResponsesSinglePage, { body, method: "post", ...options });
      }
      /**
       * Runs a temporary or saved query
       *
       * @example
       * ```ts
       * const response =
       *   await client.workers.observability.telemetry.query({
       *     account_id: 'account_id',
       *     queryId: 'queryId',
       *     timeframe: { from: 0, to: 0 },
       *   });
       * ```
       */
      query(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/workers/observability/telemetry/query`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List unique values found in your events
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const telemetryValuesResponse of client.workers.observability.telemetry.values(
       *   {
       *     account_id: 'account_id',
       *     datasets: ['string'],
       *     key: 'key',
       *     timeframe: { from: 0, to: 0 },
       *     type: 'string',
       *   },
       * )) {
       *   // ...
       * }
       * ```
       */
      values(params, options) {
        const { account_id, ...body } = params;
        return this._client.getAPIList(`/accounts/${account_id}/workers/observability/telemetry/values`, TelemetryValuesResponsesSinglePage, { body, method: "post", ...options });
      }
    };
    TelemetryKeysResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "TelemetryKeysResponsesSinglePage");
      }
    };
    TelemetryValuesResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "TelemetryValuesResponsesSinglePage");
      }
    };
    Telemetry.TelemetryKeysResponsesSinglePage = TelemetryKeysResponsesSinglePage;
    Telemetry.TelemetryValuesResponsesSinglePage = TelemetryValuesResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workers/observability/observability.mjs
var Observability;
var init_observability = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workers/observability/observability.mjs"() {
    init_import_meta_url();
    init_resource();
    init_telemetry();
    init_telemetry();
    Observability = class extends APIResource {
      static {
        __name(this, "Observability");
      }
      constructor() {
        super(...arguments);
        this.telemetry = new Telemetry(this._client);
      }
    };
    Observability.Telemetry = Telemetry;
    Observability.TelemetryKeysResponsesSinglePage = TelemetryKeysResponsesSinglePage;
    Observability.TelemetryValuesResponsesSinglePage = TelemetryValuesResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workers/scripts/content.mjs
var Content3;
var init_content3 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workers/scripts/content.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    Content3 = class extends APIResource {
      static {
        __name(this, "Content");
      }
      /**
       * Put script content without touching config or metadata.
       *
       * @example
       * ```ts
       * const script = await client.workers.scripts.content.update(
       *   'this-is_my_script-01',
       *   {
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     metadata: {},
       *   },
       * );
       * ```
       */
      update(scriptName, params, options) {
        const { account_id, "CF-WORKER-BODY-PART": cfWorkerBodyPart, "CF-WORKER-MAIN-MODULE-PART": cfWorkerMainModulePart, ...body } = params;
        return this._client.put(`/accounts/${account_id}/workers/scripts/${scriptName}/content`, multipartFormRequestOptions({
          body,
          ...options,
          __multipartSyntax: "json",
          headers: {
            ...cfWorkerBodyPart != null ? { "CF-WORKER-BODY-PART": cfWorkerBodyPart } : void 0,
            ...cfWorkerMainModulePart != null ? { "CF-WORKER-MAIN-MODULE-PART": cfWorkerMainModulePart } : void 0,
            ...options?.headers
          }
        }))._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetch script content only.
       *
       * @example
       * ```ts
       * const content = await client.workers.scripts.content.get(
       *   'this-is_my_script-01',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       *
       * const data = await content.blob();
       * console.log(data);
       * ```
       */
      get(scriptName, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/workers/scripts/${scriptName}/content/v2`, {
          ...options,
          headers: { Accept: "string", ...options?.headers },
          __binaryResponse: true
        });
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workers/scripts/deployments.mjs
var Deployments2;
var init_deployments2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workers/scripts/deployments.mjs"() {
    init_import_meta_url();
    init_resource();
    Deployments2 = class extends APIResource {
      static {
        __name(this, "Deployments");
      }
      /**
       * Deployments configure how
       * [Worker Versions](https://developers.cloudflare.com/api/operations/worker-versions-list-versions)
       * are deployed to traffic. A deployment can consist of one or two versions of a
       * Worker.
       *
       * @example
       * ```ts
       * const deployment =
       *   await client.workers.scripts.deployments.create(
       *     'this-is_my_script-01',
       *     {
       *       account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *       strategy: 'percentage',
       *       versions: [
       *         {
       *           percentage: 100,
       *           version_id:
       *             '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
       *         },
       *       ],
       *     },
       *   );
       * ```
       */
      create(scriptName, params, options) {
        const { account_id, force, ...body } = params;
        return this._client.post(`/accounts/${account_id}/workers/scripts/${scriptName}/deployments`, {
          query: { force },
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List of Worker Deployments. The first deployment in the list is the latest
       * deployment actively serving traffic.
       *
       * @example
       * ```ts
       * const deployments =
       *   await client.workers.scripts.deployments.list(
       *     'this-is_my_script-01',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      list(scriptName, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/workers/scripts/${scriptName}/deployments`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Delete a Worker Deployment. The latest deployment, which is actively serving
       * traffic, cannot be deleted. All other deployments can be deleted.
       *
       * @example
       * ```ts
       * const deployment =
       *   await client.workers.scripts.deployments.delete(
       *     'this-is_my_script-01',
       *     '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      delete(scriptName, deploymentId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/workers/scripts/${scriptName}/deployments/${deploymentId}`, options);
      }
      /**
       * Get information about a Worker Deployment.
       *
       * @example
       * ```ts
       * const deployment =
       *   await client.workers.scripts.deployments.get(
       *     'this-is_my_script-01',
       *     '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      get(scriptName, deploymentId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/workers/scripts/${scriptName}/deployments/${deploymentId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workers/scripts/schedules.mjs
var Schedules;
var init_schedules = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workers/scripts/schedules.mjs"() {
    init_import_meta_url();
    init_resource();
    Schedules = class extends APIResource {
      static {
        __name(this, "Schedules");
      }
      /**
       * Updates Cron Triggers for a Worker.
       *
       * @example
       * ```ts
       * const schedule =
       *   await client.workers.scripts.schedules.update(
       *     'this-is_my_script-01',
       *     {
       *       account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *       body: [{ cron: '* /30 * * * *' }],
       *     },
       *   );
       * ```
       */
      update(scriptName, params, options) {
        const { account_id, body } = params;
        return this._client.put(`/accounts/${account_id}/workers/scripts/${scriptName}/schedules`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetches Cron Triggers for a Worker.
       *
       * @example
       * ```ts
       * const schedule = await client.workers.scripts.schedules.get(
       *   'this-is_my_script-01',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(scriptName, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/workers/scripts/${scriptName}/schedules`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workers/scripts/script-and-version-settings.mjs
var ScriptAndVersionSettings;
var init_script_and_version_settings = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workers/scripts/script-and-version-settings.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    ScriptAndVersionSettings = class extends APIResource {
      static {
        __name(this, "ScriptAndVersionSettings");
      }
      /**
       * Patch metadata or config, such as bindings or usage model.
       *
       * @example
       * ```ts
       * const response =
       *   await client.workers.scripts.scriptAndVersionSettings.edit(
       *     'this-is_my_script-01',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      edit(scriptName, params, options) {
        const { account_id, ...body } = params;
        return this._client.patch(`/accounts/${account_id}/workers/scripts/${scriptName}/settings`, multipartFormRequestOptions({ body, ...options, __multipartSyntax: "json" }))._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get metadata and config, such as bindings or usage model.
       *
       * @example
       * ```ts
       * const scriptAndVersionSetting =
       *   await client.workers.scripts.scriptAndVersionSettings.get(
       *     'this-is_my_script-01',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      get(scriptName, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/workers/scripts/${scriptName}/settings`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workers/scripts/secrets.mjs
var Secrets2, SecretListResponsesSinglePage;
var init_secrets2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workers/scripts/secrets.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Secrets2 = class extends APIResource {
      static {
        __name(this, "Secrets");
      }
      /**
       * Add a secret to a script.
       *
       * @example
       * ```ts
       * const secret = await client.workers.scripts.secrets.update(
       *   'this-is_my_script-01',
       *   {
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     name: 'myBinding',
       *     text: 'My secret.',
       *     type: 'secret_text',
       *   },
       * );
       * ```
       */
      update(scriptName, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/workers/scripts/${scriptName}/secrets`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List secrets bound to a script.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const secretListResponse of client.workers.scripts.secrets.list(
       *   'this-is_my_script-01',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(scriptName, params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/workers/scripts/${scriptName}/secrets`, SecretListResponsesSinglePage, options);
      }
      /**
       * Remove a secret from a script.
       *
       * @example
       * ```ts
       * const secret = await client.workers.scripts.secrets.delete(
       *   'this-is_my_script-01',
       *   'mySecret',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      delete(scriptName, secretName, params, options) {
        const { account_id, url_encoded } = params;
        return this._client.delete(`/accounts/${account_id}/workers/scripts/${scriptName}/secrets/${secretName}`, {
          query: { url_encoded },
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get a given secret binding (value omitted) on a script.
       *
       * @example
       * ```ts
       * const secret = await client.workers.scripts.secrets.get(
       *   'this-is_my_script-01',
       *   'mySecret',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(scriptName, secretName, params, options) {
        const { account_id, ...query } = params;
        return this._client.get(`/accounts/${account_id}/workers/scripts/${scriptName}/secrets/${secretName}`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
    SecretListResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "SecretListResponsesSinglePage");
      }
    };
    Secrets2.SecretListResponsesSinglePage = SecretListResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workers/scripts/settings.mjs
var Settings11;
var init_settings11 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workers/scripts/settings.mjs"() {
    init_import_meta_url();
    init_resource();
    Settings11 = class extends APIResource {
      static {
        __name(this, "Settings");
      }
      /**
       * Patch script-level settings when using
       * [Worker Versions](https://developers.cloudflare.com/api/operations/worker-versions-list-versions).
       * Including but not limited to Logpush and Tail Consumers.
       *
       * @example
       * ```ts
       * const scriptSetting =
       *   await client.workers.scripts.settings.edit(
       *     'this-is_my_script-01',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      edit(scriptName, params, options) {
        const { account_id, ...body } = params;
        return this._client.patch(`/accounts/${account_id}/workers/scripts/${scriptName}/script-settings`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get script-level settings when using
       * [Worker Versions](https://developers.cloudflare.com/api/operations/worker-versions-list-versions).
       * Includes Logpush and Tail Consumers.
       *
       * @example
       * ```ts
       * const scriptSetting =
       *   await client.workers.scripts.settings.get(
       *     'this-is_my_script-01',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      get(scriptName, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/workers/scripts/${scriptName}/script-settings`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workers/scripts/subdomain.mjs
var Subdomain;
var init_subdomain = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workers/scripts/subdomain.mjs"() {
    init_import_meta_url();
    init_resource();
    Subdomain = class extends APIResource {
      static {
        __name(this, "Subdomain");
      }
      /**
       * Enable or disable the Worker on the workers.dev subdomain.
       *
       * @example
       * ```ts
       * const subdomain =
       *   await client.workers.scripts.subdomain.create(
       *     'this-is_my_script-01',
       *     {
       *       account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *       enabled: true,
       *     },
       *   );
       * ```
       */
      create(scriptName, params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/workers/scripts/${scriptName}/subdomain`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Disable all workers.dev subdomains for a Worker.
       *
       * @example
       * ```ts
       * const subdomain =
       *   await client.workers.scripts.subdomain.delete(
       *     'this-is_my_script-01',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      delete(scriptName, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/workers/scripts/${scriptName}/subdomain`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get if the Worker is available on the workers.dev subdomain.
       *
       * @example
       * ```ts
       * const subdomain =
       *   await client.workers.scripts.subdomain.get(
       *     'this-is_my_script-01',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      get(scriptName, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/workers/scripts/${scriptName}/subdomain`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workers/scripts/tail.mjs
var Tail;
var init_tail = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workers/scripts/tail.mjs"() {
    init_import_meta_url();
    init_resource();
    Tail = class extends APIResource {
      static {
        __name(this, "Tail");
      }
      /**
       * Starts a tail that receives logs and exception from a Worker.
       *
       * @example
       * ```ts
       * const tail = await client.workers.scripts.tail.create(
       *   'this-is_my_script-01',
       *   {
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     body: {},
       *   },
       * );
       * ```
       */
      create(scriptName, params, options) {
        const { account_id, body } = params;
        return this._client.post(`/accounts/${account_id}/workers/scripts/${scriptName}/tails`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Deletes a tail from a Worker.
       *
       * @example
       * ```ts
       * const tail = await client.workers.scripts.tail.delete(
       *   'this-is_my_script-01',
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      delete(scriptName, id, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/workers/scripts/${scriptName}/tails/${id}`, options);
      }
      /**
       * Get list of tails currently deployed on a Worker.
       *
       * @example
       * ```ts
       * const tail = await client.workers.scripts.tail.get(
       *   'this-is_my_script-01',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(scriptName, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/workers/scripts/${scriptName}/tails`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workers/scripts/versions.mjs
var Versions4, VersionListResponsesV4PagePagination;
var init_versions4 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workers/scripts/versions.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    init_pagination();
    Versions4 = class extends APIResource {
      static {
        __name(this, "Versions");
      }
      /**
       * Upload a Worker Version without deploying to Cloudflare's network. You can find
       * more about the multipart metadata on our docs:
       * https://developers.cloudflare.com/workers/configuration/multipart-upload-metadata/.
       *
       * @example
       * ```ts
       * const version =
       *   await client.workers.scripts.versions.create(
       *     'this-is_my_script-01',
       *     {
       *       account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *       metadata: { main_module: 'worker.js' },
       *     },
       *   );
       * ```
       */
      create(scriptName, params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/workers/scripts/${scriptName}/versions`, multipartFormRequestOptions({ body, ...options, __multipartSyntax: "json" }))._thenUnwrap((obj) => obj.result);
      }
      /**
       * List of Worker Versions. The first version in the list is the latest version.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const versionListResponse of client.workers.scripts.versions.list(
       *   'this-is_my_script-01',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(scriptName, params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/workers/scripts/${scriptName}/versions`, VersionListResponsesV4PagePagination, { query, ...options });
      }
      /**
       * Get Version Detail
       *
       * @example
       * ```ts
       * const version = await client.workers.scripts.versions.get(
       *   'this-is_my_script-01',
       *   'bcf48806-b317-4351-9ee7-36e7d557d4de',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(scriptName, versionId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/workers/scripts/${scriptName}/versions/${versionId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    VersionListResponsesV4PagePagination = class extends V4PagePagination {
      static {
        __name(this, "VersionListResponsesV4PagePagination");
      }
    };
    Versions4.VersionListResponsesV4PagePagination = VersionListResponsesV4PagePagination;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workers/scripts/assets/upload.mjs
var Upload2;
var init_upload2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workers/scripts/assets/upload.mjs"() {
    init_import_meta_url();
    init_resource();
    Upload2 = class extends APIResource {
      static {
        __name(this, "Upload");
      }
      /**
       * Start uploading a collection of assets for use in a Worker version. To learn
       * more about the direct uploads of assets, see
       * https://developers.cloudflare.com/workers/static-assets/direct-upload/.
       *
       * @example
       * ```ts
       * const upload =
       *   await client.workers.scripts.assets.upload.create(
       *     'this-is_my_script-01',
       *     {
       *       account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *       manifest: { foo: { hash: 'hash', size: 0 } },
       *     },
       *   );
       * ```
       */
      create(scriptName, params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/workers/scripts/${scriptName}/assets-upload-session`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workers/scripts/assets/assets.mjs
var Assets4;
var init_assets4 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workers/scripts/assets/assets.mjs"() {
    init_import_meta_url();
    init_resource();
    init_upload2();
    init_upload2();
    Assets4 = class extends APIResource {
      static {
        __name(this, "Assets");
      }
      constructor() {
        super(...arguments);
        this.upload = new Upload2(this._client);
      }
    };
    Assets4.Upload = Upload2;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workers/scripts/scripts.mjs
var Scripts2, ScriptsSinglePage2;
var init_scripts2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workers/scripts/scripts.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    init_content3();
    init_content3();
    init_deployments2();
    init_deployments2();
    init_schedules();
    init_schedules();
    init_script_and_version_settings();
    init_script_and_version_settings();
    init_secrets2();
    init_secrets2();
    init_settings11();
    init_settings11();
    init_subdomain();
    init_subdomain();
    init_tail();
    init_tail();
    init_versions4();
    init_versions4();
    init_assets4();
    init_assets4();
    init_pagination();
    Scripts2 = class extends APIResource {
      static {
        __name(this, "Scripts");
      }
      constructor() {
        super(...arguments);
        this.assets = new Assets4(this._client);
        this.subdomain = new Subdomain(this._client);
        this.schedules = new Schedules(this._client);
        this.tail = new Tail(this._client);
        this.content = new Content3(this._client);
        this.settings = new Settings11(this._client);
        this.deployments = new Deployments2(this._client);
        this.versions = new Versions4(this._client);
        this.secrets = new Secrets2(this._client);
        this.scriptAndVersionSettings = new ScriptAndVersionSettings(this._client);
      }
      /**
       * Upload a worker module. You can find more about the multipart metadata on our
       * docs:
       * https://developers.cloudflare.com/workers/configuration/multipart-upload-metadata/.
       *
       * @example
       * ```ts
       * const script = await client.workers.scripts.update(
       *   'this-is_my_script-01',
       *   {
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     metadata: {},
       *   },
       * );
       * ```
       */
      update(scriptName, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/workers/scripts/${scriptName}`, maybeMultipartFormRequestOptions({
          body,
          ...options,
          __multipartSyntax: "json",
          headers: { "Content-Type": "application/javascript", ...options?.headers }
        }))._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetch a list of uploaded workers.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const script of client.workers.scripts.list({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * })) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/workers/scripts`, ScriptsSinglePage2, {
          query,
          ...options
        });
      }
      /**
       * Delete your worker. This call has no response body on a successful delete.
       *
       * @example
       * ```ts
       * const script = await client.workers.scripts.delete(
       *   'this-is_my_script-01',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      delete(scriptName, params, options) {
        const { account_id, force } = params;
        return this._client.delete(`/accounts/${account_id}/workers/scripts/${scriptName}`, {
          query: { force },
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetch raw script content for your worker. Note this is the original script
       * content, not JSON encoded.
       *
       * @example
       * ```ts
       * const script = await client.workers.scripts.get(
       *   'this-is_my_script-01',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(scriptName, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/workers/scripts/${scriptName}`, {
          ...options,
          headers: { Accept: "application/javascript", ...options?.headers }
        });
      }
      /**
       * Search for Workers in an account.
       *
       * @example
       * ```ts
       * const response = await client.workers.scripts.search({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      search(params, options) {
        const { account_id, ...query } = params;
        return this._client.get(`/accounts/${account_id}/workers/scripts-search`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
    ScriptsSinglePage2 = class extends SinglePage {
      static {
        __name(this, "ScriptsSinglePage");
      }
    };
    Scripts2.ScriptsSinglePage = ScriptsSinglePage2;
    Scripts2.Assets = Assets4;
    Scripts2.Subdomain = Subdomain;
    Scripts2.Schedules = Schedules;
    Scripts2.Tail = Tail;
    Scripts2.Content = Content3;
    Scripts2.Settings = Settings11;
    Scripts2.Deployments = Deployments2;
    Scripts2.Versions = Versions4;
    Scripts2.VersionListResponsesV4PagePagination = VersionListResponsesV4PagePagination;
    Scripts2.Secrets = Secrets2;
    Scripts2.SecretListResponsesSinglePage = SecretListResponsesSinglePage;
    Scripts2.ScriptAndVersionSettings = ScriptAndVersionSettings;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workers/workers.mjs
var Workers2;
var init_workers2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workers/workers.mjs"() {
    init_import_meta_url();
    init_resource();
    init_account_settings();
    init_account_settings();
    init_domains6();
    init_domains6();
    init_routes3();
    init_routes3();
    init_subdomains();
    init_subdomains();
    init_assets3();
    init_assets3();
    init_beta();
    init_beta();
    init_observability();
    init_observability();
    init_scripts2();
    init_scripts2();
    Workers2 = class extends APIResource {
      static {
        __name(this, "Workers");
      }
      constructor() {
        super(...arguments);
        this.beta = new Beta(this._client);
        this.routes = new Routes3(this._client);
        this.assets = new Assets3(this._client);
        this.scripts = new Scripts2(this._client);
        this.accountSettings = new AccountSettings(this._client);
        this.domains = new Domains6(this._client);
        this.subdomains = new Subdomains(this._client);
        this.observability = new Observability(this._client);
      }
    };
    Workers2.Beta = Beta;
    Workers2.Routes = Routes3;
    Workers2.RouteListResponsesSinglePage = RouteListResponsesSinglePage;
    Workers2.Assets = Assets3;
    Workers2.Scripts = Scripts2;
    Workers2.ScriptsSinglePage = ScriptsSinglePage2;
    Workers2.AccountSettings = AccountSettings;
    Workers2.Domains = Domains6;
    Workers2.DomainsSinglePage = DomainsSinglePage2;
    Workers2.Subdomains = Subdomains;
    Workers2.Observability = Observability;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workers-for-platforms/dispatch/namespaces/scripts/asset-upload.mjs
var AssetUpload;
var init_asset_upload = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workers-for-platforms/dispatch/namespaces/scripts/asset-upload.mjs"() {
    init_import_meta_url();
    init_resource();
    AssetUpload = class extends APIResource {
      static {
        __name(this, "AssetUpload");
      }
      /**
       * Start uploading a collection of assets for use in a Worker version. To learn
       * more about the direct uploads of assets, see
       * https://developers.cloudflare.com/workers/static-assets/direct-upload/.
       *
       * @example
       * ```ts
       * const assetUpload =
       *   await client.workersForPlatforms.dispatch.namespaces.scripts.assetUpload.create(
       *     'my-dispatch-namespace',
       *     'this-is_my_script-01',
       *     {
       *       account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *       manifest: { foo: { hash: 'hash', size: 0 } },
       *     },
       *   );
       * ```
       */
      create(dispatchNamespace, scriptName, params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/workers/dispatch/namespaces/${dispatchNamespace}/scripts/${scriptName}/assets-upload-session`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workers-for-platforms/dispatch/namespaces/scripts/bindings.mjs
var Bindings, BindingGetResponsesSinglePage;
var init_bindings = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workers-for-platforms/dispatch/namespaces/scripts/bindings.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Bindings = class extends APIResource {
      static {
        __name(this, "Bindings");
      }
      /**
       * Fetch script bindings from a script uploaded to a Workers for Platforms
       * namespace.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const bindingGetResponse of client.workersForPlatforms.dispatch.namespaces.scripts.bindings.get(
       *   'my-dispatch-namespace',
       *   'this-is_my_script-01',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      get(dispatchNamespace, scriptName, params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/workers/dispatch/namespaces/${dispatchNamespace}/scripts/${scriptName}/bindings`, BindingGetResponsesSinglePage, options);
      }
    };
    BindingGetResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "BindingGetResponsesSinglePage");
      }
    };
    Bindings.BindingGetResponsesSinglePage = BindingGetResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workers-for-platforms/dispatch/namespaces/scripts/content.mjs
var Content4;
var init_content4 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workers-for-platforms/dispatch/namespaces/scripts/content.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    Content4 = class extends APIResource {
      static {
        __name(this, "Content");
      }
      /**
       * Put script content for a script uploaded to a Workers for Platforms namespace.
       *
       * @example
       * ```ts
       * const script =
       *   await client.workersForPlatforms.dispatch.namespaces.scripts.content.update(
       *     'my-dispatch-namespace',
       *     'this-is_my_script-01',
       *     {
       *       account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *       metadata: {},
       *     },
       *   );
       * ```
       */
      update(dispatchNamespace, scriptName, params, options) {
        const { account_id, "CF-WORKER-BODY-PART": cfWorkerBodyPart, "CF-WORKER-MAIN-MODULE-PART": cfWorkerMainModulePart, ...body } = params;
        return this._client.put(`/accounts/${account_id}/workers/dispatch/namespaces/${dispatchNamespace}/scripts/${scriptName}/content`, multipartFormRequestOptions({
          body,
          ...options,
          __multipartSyntax: "json",
          headers: {
            ...cfWorkerBodyPart != null ? { "CF-WORKER-BODY-PART": cfWorkerBodyPart } : void 0,
            ...cfWorkerMainModulePart != null ? { "CF-WORKER-MAIN-MODULE-PART": cfWorkerMainModulePart } : void 0,
            ...options?.headers
          }
        }))._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetch script content from a script uploaded to a Workers for Platforms
       * namespace.
       *
       * @example
       * ```ts
       * const content =
       *   await client.workersForPlatforms.dispatch.namespaces.scripts.content.get(
       *     'my-dispatch-namespace',
       *     'this-is_my_script-01',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       *
       * const data = await content.blob();
       * console.log(data);
       * ```
       */
      get(dispatchNamespace, scriptName, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/workers/dispatch/namespaces/${dispatchNamespace}/scripts/${scriptName}/content`, { ...options, headers: { Accept: "string", ...options?.headers }, __binaryResponse: true });
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workers-for-platforms/dispatch/namespaces/scripts/secrets.mjs
var Secrets3, SecretListResponsesSinglePage2;
var init_secrets3 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workers-for-platforms/dispatch/namespaces/scripts/secrets.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Secrets3 = class extends APIResource {
      static {
        __name(this, "Secrets");
      }
      /**
       * Add a secret to a script uploaded to a Workers for Platforms namespace.
       *
       * @example
       * ```ts
       * const secret =
       *   await client.workersForPlatforms.dispatch.namespaces.scripts.secrets.update(
       *     'my-dispatch-namespace',
       *     'this-is_my_script-01',
       *     {
       *       account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *       name: 'myBinding',
       *       text: 'My secret.',
       *       type: 'secret_text',
       *     },
       *   );
       * ```
       */
      update(dispatchNamespace, scriptName, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/workers/dispatch/namespaces/${dispatchNamespace}/scripts/${scriptName}/secrets`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List secrets bound to a script uploaded to a Workers for Platforms namespace.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const secretListResponse of client.workersForPlatforms.dispatch.namespaces.scripts.secrets.list(
       *   'my-dispatch-namespace',
       *   'this-is_my_script-01',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(dispatchNamespace, scriptName, params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/workers/dispatch/namespaces/${dispatchNamespace}/scripts/${scriptName}/secrets`, SecretListResponsesSinglePage2, options);
      }
      /**
       * Remove a secret from a script uploaded to a Workers for Platforms namespace.
       *
       * @example
       * ```ts
       * const secret =
       *   await client.workersForPlatforms.dispatch.namespaces.scripts.secrets.delete(
       *     'my-dispatch-namespace',
       *     'this-is_my_script-01',
       *     'mySecret',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      delete(dispatchNamespace, scriptName, secretName, params, options) {
        const { account_id, url_encoded } = params;
        return this._client.delete(`/accounts/${account_id}/workers/dispatch/namespaces/${dispatchNamespace}/scripts/${scriptName}/secrets/${secretName}`, { query: { url_encoded }, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get a given secret binding (value omitted) on a script uploaded to a Workers for
       * Platforms namespace.
       *
       * @example
       * ```ts
       * const secret =
       *   await client.workersForPlatforms.dispatch.namespaces.scripts.secrets.get(
       *     'my-dispatch-namespace',
       *     'this-is_my_script-01',
       *     'mySecret',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      get(dispatchNamespace, scriptName, secretName, params, options) {
        const { account_id, ...query } = params;
        return this._client.get(`/accounts/${account_id}/workers/dispatch/namespaces/${dispatchNamespace}/scripts/${scriptName}/secrets/${secretName}`, { query, ...options })._thenUnwrap((obj) => obj.result);
      }
    };
    SecretListResponsesSinglePage2 = class extends SinglePage {
      static {
        __name(this, "SecretListResponsesSinglePage");
      }
    };
    Secrets3.SecretListResponsesSinglePage = SecretListResponsesSinglePage2;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workers-for-platforms/dispatch/namespaces/scripts/settings.mjs
var Settings12;
var init_settings12 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workers-for-platforms/dispatch/namespaces/scripts/settings.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    Settings12 = class extends APIResource {
      static {
        __name(this, "Settings");
      }
      /**
       * Patch script metadata, such as bindings.
       *
       * @example
       * ```ts
       * const response =
       *   await client.workersForPlatforms.dispatch.namespaces.scripts.settings.edit(
       *     'my-dispatch-namespace',
       *     'this-is_my_script-01',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      edit(dispatchNamespace, scriptName, params, options) {
        const { account_id, ...body } = params;
        return this._client.patch(`/accounts/${account_id}/workers/dispatch/namespaces/${dispatchNamespace}/scripts/${scriptName}/settings`, multipartFormRequestOptions({ body, ...options, __multipartSyntax: "json" }))._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get script settings from a script uploaded to a Workers for Platforms namespace.
       *
       * @example
       * ```ts
       * const setting =
       *   await client.workersForPlatforms.dispatch.namespaces.scripts.settings.get(
       *     'my-dispatch-namespace',
       *     'this-is_my_script-01',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      get(dispatchNamespace, scriptName, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/workers/dispatch/namespaces/${dispatchNamespace}/scripts/${scriptName}/settings`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workers-for-platforms/dispatch/namespaces/scripts/tags.mjs
var Tags2, TagUpdateResponsesSinglePage, TagListResponsesSinglePage;
var init_tags2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workers-for-platforms/dispatch/namespaces/scripts/tags.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Tags2 = class extends APIResource {
      static {
        __name(this, "Tags");
      }
      /**
       * Put script tags for a script uploaded to a Workers for Platforms namespace.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const tagUpdateResponse of client.workersForPlatforms.dispatch.namespaces.scripts.tags.update(
       *   'my-dispatch-namespace',
       *   'this-is_my_script-01',
       *   {
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     body: ['my-team', 'my-public-api'],
       *   },
       * )) {
       *   // ...
       * }
       * ```
       */
      update(dispatchNamespace, scriptName, params, options) {
        const { account_id, body } = params;
        return this._client.getAPIList(`/accounts/${account_id}/workers/dispatch/namespaces/${dispatchNamespace}/scripts/${scriptName}/tags`, TagUpdateResponsesSinglePage, { body, method: "put", ...options });
      }
      /**
       * Fetch tags from a script uploaded to a Workers for Platforms namespace.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const tagListResponse of client.workersForPlatforms.dispatch.namespaces.scripts.tags.list(
       *   'my-dispatch-namespace',
       *   'this-is_my_script-01',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(dispatchNamespace, scriptName, params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/workers/dispatch/namespaces/${dispatchNamespace}/scripts/${scriptName}/tags`, TagListResponsesSinglePage, options);
      }
      /**
       * Delete script tag for a script uploaded to a Workers for Platforms namespace.
       *
       * @example
       * ```ts
       * const tag =
       *   await client.workersForPlatforms.dispatch.namespaces.scripts.tags.delete(
       *     'my-dispatch-namespace',
       *     'this-is_my_script-01',
       *     'my-tag',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      delete(dispatchNamespace, scriptName, tag, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/workers/dispatch/namespaces/${dispatchNamespace}/scripts/${scriptName}/tags/${tag}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    TagUpdateResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "TagUpdateResponsesSinglePage");
      }
    };
    TagListResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "TagListResponsesSinglePage");
      }
    };
    Tags2.TagUpdateResponsesSinglePage = TagUpdateResponsesSinglePage;
    Tags2.TagListResponsesSinglePage = TagListResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workers-for-platforms/dispatch/namespaces/scripts/scripts.mjs
var Scripts3;
var init_scripts3 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workers-for-platforms/dispatch/namespaces/scripts/scripts.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    init_asset_upload();
    init_asset_upload();
    init_bindings();
    init_bindings();
    init_content4();
    init_content4();
    init_secrets3();
    init_secrets3();
    init_settings12();
    init_settings12();
    init_tags2();
    init_tags2();
    Scripts3 = class extends APIResource {
      static {
        __name(this, "Scripts");
      }
      constructor() {
        super(...arguments);
        this.assetUpload = new AssetUpload(this._client);
        this.content = new Content4(this._client);
        this.settings = new Settings12(this._client);
        this.bindings = new Bindings(this._client);
        this.secrets = new Secrets3(this._client);
        this.tags = new Tags2(this._client);
      }
      /**
       * Upload a worker module to a Workers for Platforms namespace. You can find more
       * about the multipart metadata on our docs:
       * https://developers.cloudflare.com/workers/configuration/multipart-upload-metadata/.
       *
       * @example
       * ```ts
       * const script =
       *   await client.workersForPlatforms.dispatch.namespaces.scripts.update(
       *     'my-dispatch-namespace',
       *     'this-is_my_script-01',
       *     {
       *       account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *       metadata: {},
       *     },
       *   );
       * ```
       */
      update(dispatchNamespace, scriptName, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/workers/dispatch/namespaces/${dispatchNamespace}/scripts/${scriptName}`, maybeMultipartFormRequestOptions({
          body,
          ...options,
          __multipartSyntax: "json",
          headers: { "Content-Type": "application/javascript", ...options?.headers }
        }))._thenUnwrap((obj) => obj.result);
      }
      /**
       * Delete a worker from a Workers for Platforms namespace. This call has no
       * response body on a successful delete.
       *
       * @example
       * ```ts
       * const script =
       *   await client.workersForPlatforms.dispatch.namespaces.scripts.delete(
       *     'my-dispatch-namespace',
       *     'this-is_my_script-01',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      delete(dispatchNamespace, scriptName, params, options) {
        const { account_id, force } = params;
        return this._client.delete(`/accounts/${account_id}/workers/dispatch/namespaces/${dispatchNamespace}/scripts/${scriptName}`, { query: { force }, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetch information about a script uploaded to a Workers for Platforms namespace.
       *
       * @example
       * ```ts
       * const script =
       *   await client.workersForPlatforms.dispatch.namespaces.scripts.get(
       *     'my-dispatch-namespace',
       *     'this-is_my_script-01',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      get(dispatchNamespace, scriptName, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/workers/dispatch/namespaces/${dispatchNamespace}/scripts/${scriptName}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    Scripts3.AssetUpload = AssetUpload;
    Scripts3.Content = Content4;
    Scripts3.Settings = Settings12;
    Scripts3.Bindings = Bindings;
    Scripts3.BindingGetResponsesSinglePage = BindingGetResponsesSinglePage;
    Scripts3.Secrets = Secrets3;
    Scripts3.SecretListResponsesSinglePage = SecretListResponsesSinglePage2;
    Scripts3.Tags = Tags2;
    Scripts3.TagUpdateResponsesSinglePage = TagUpdateResponsesSinglePage;
    Scripts3.TagListResponsesSinglePage = TagListResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workers-for-platforms/dispatch/namespaces/namespaces.mjs
var Namespaces3, NamespaceListResponsesSinglePage;
var init_namespaces3 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workers-for-platforms/dispatch/namespaces/namespaces.mjs"() {
    init_import_meta_url();
    init_resource();
    init_scripts3();
    init_scripts3();
    init_pagination();
    Namespaces3 = class extends APIResource {
      static {
        __name(this, "Namespaces");
      }
      constructor() {
        super(...arguments);
        this.scripts = new Scripts3(this._client);
      }
      /**
       * Create a new Workers for Platforms namespace.
       *
       * @example
       * ```ts
       * const namespace =
       *   await client.workersForPlatforms.dispatch.namespaces.create(
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/workers/dispatch/namespaces`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetch a list of Workers for Platforms namespaces.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const namespaceListResponse of client.workersForPlatforms.dispatch.namespaces.list(
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/workers/dispatch/namespaces`, NamespaceListResponsesSinglePage, options);
      }
      /**
       * Delete a Workers for Platforms namespace.
       *
       * @example
       * ```ts
       * const namespace =
       *   await client.workersForPlatforms.dispatch.namespaces.delete(
       *     'my-dispatch-namespace',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      delete(dispatchNamespace, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/workers/dispatch/namespaces/${dispatchNamespace}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get a Workers for Platforms namespace.
       *
       * @example
       * ```ts
       * const namespace =
       *   await client.workersForPlatforms.dispatch.namespaces.get(
       *     'my-dispatch-namespace',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      get(dispatchNamespace, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/workers/dispatch/namespaces/${dispatchNamespace}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    NamespaceListResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "NamespaceListResponsesSinglePage");
      }
    };
    Namespaces3.NamespaceListResponsesSinglePage = NamespaceListResponsesSinglePage;
    Namespaces3.Scripts = Scripts3;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workers-for-platforms/dispatch/dispatch.mjs
var Dispatch;
var init_dispatch = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workers-for-platforms/dispatch/dispatch.mjs"() {
    init_import_meta_url();
    init_resource();
    init_namespaces3();
    init_namespaces3();
    Dispatch = class extends APIResource {
      static {
        __name(this, "Dispatch");
      }
      constructor() {
        super(...arguments);
        this.namespaces = new Namespaces3(this._client);
      }
    };
    Dispatch.Namespaces = Namespaces3;
    Dispatch.NamespaceListResponsesSinglePage = NamespaceListResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workers-for-platforms/workers-for-platforms.mjs
var WorkersForPlatforms;
var init_workers_for_platforms = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workers-for-platforms/workers-for-platforms.mjs"() {
    init_import_meta_url();
    init_resource();
    init_dispatch();
    init_dispatch();
    WorkersForPlatforms = class extends APIResource {
      static {
        __name(this, "WorkersForPlatforms");
      }
      constructor() {
        super(...arguments);
        this.dispatch = new Dispatch(this._client);
      }
    };
    WorkersForPlatforms.Dispatch = Dispatch;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workflows/versions.mjs
var Versions5, VersionListResponsesV4PagePaginationArray;
var init_versions5 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workflows/versions.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Versions5 = class extends APIResource {
      static {
        __name(this, "Versions");
      }
      /**
       * List deployed Workflow versions
       */
      list(workflowName, params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/workflows/${workflowName}/versions`, VersionListResponsesV4PagePaginationArray, { query, ...options });
      }
      /**
       * Get Workflow version details
       */
      get(workflowName, versionId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/workflows/${workflowName}/versions/${versionId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    VersionListResponsesV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "VersionListResponsesV4PagePaginationArray");
      }
    };
    Versions5.VersionListResponsesV4PagePaginationArray = VersionListResponsesV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workflows/instances/events.mjs
var Events6;
var init_events7 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workflows/instances/events.mjs"() {
    init_import_meta_url();
    init_resource();
    Events6 = class extends APIResource {
      static {
        __name(this, "Events");
      }
      /**
       * Send event to instance
       */
      create(workflowName, instanceId, eventType, params, options) {
        const { account_id, body } = params ?? {};
        return this._client.post(`/accounts/${account_id}/workflows/${workflowName}/instances/${instanceId}/events/${eventType}`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workflows/instances/status.mjs
var Status2;
var init_status2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workflows/instances/status.mjs"() {
    init_import_meta_url();
    init_resource();
    Status2 = class extends APIResource {
      static {
        __name(this, "Status");
      }
      /**
       * Change status of instance
       */
      edit(workflowName, instanceId, params, options) {
        const { account_id, ...body } = params;
        return this._client.patch(`/accounts/${account_id}/workflows/${workflowName}/instances/${instanceId}/status`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workflows/instances/instances.mjs
var Instances, InstanceListResponsesV4PagePaginationArray, InstanceBulkResponsesSinglePage;
var init_instances = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workflows/instances/instances.mjs"() {
    init_import_meta_url();
    init_resource();
    init_events7();
    init_events7();
    init_status2();
    init_status2();
    init_pagination();
    Instances = class extends APIResource {
      static {
        __name(this, "Instances");
      }
      constructor() {
        super(...arguments);
        this.status = new Status2(this._client);
        this.events = new Events6(this._client);
      }
      /**
       * Create a new workflow instance
       */
      create(workflowName, params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/workflows/${workflowName}/instances`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List of workflow instances
       */
      list(workflowName, params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/workflows/${workflowName}/instances`, InstanceListResponsesV4PagePaginationArray, { query, ...options });
      }
      /**
       * Batch create new Workflow instances
       */
      bulk(workflowName, params, options) {
        const { account_id, body } = params ?? {};
        return this._client.getAPIList(`/accounts/${account_id}/workflows/${workflowName}/instances/batch`, InstanceBulkResponsesSinglePage, { body, method: "post", ...options });
      }
      /**
       * Get logs and status from instance
       */
      get(workflowName, instanceId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/workflows/${workflowName}/instances/${instanceId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    InstanceListResponsesV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "InstanceListResponsesV4PagePaginationArray");
      }
    };
    InstanceBulkResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "InstanceBulkResponsesSinglePage");
      }
    };
    Instances.InstanceListResponsesV4PagePaginationArray = InstanceListResponsesV4PagePaginationArray;
    Instances.InstanceBulkResponsesSinglePage = InstanceBulkResponsesSinglePage;
    Instances.Status = Status2;
    Instances.Events = Events6;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workflows/workflows.mjs
var Workflows, WorkflowListResponsesV4PagePaginationArray;
var init_workflows = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/workflows/workflows.mjs"() {
    init_import_meta_url();
    init_resource();
    init_versions5();
    init_versions5();
    init_instances();
    init_instances();
    init_pagination();
    Workflows = class extends APIResource {
      static {
        __name(this, "Workflows");
      }
      constructor() {
        super(...arguments);
        this.instances = new Instances(this._client);
        this.versions = new Versions5(this._client);
      }
      /**
       * Create/modify Workflow
       */
      update(workflowName, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/workflows/${workflowName}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List all Workflows
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/workflows`, WorkflowListResponsesV4PagePaginationArray, { query, ...options });
      }
      /**
       * Deletes a Workflow. This only deletes the Workflow and does not delete or modify
       * any Worker associated to this Workflow or bounded to it.
       */
      delete(workflowName, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/workflows/${workflowName}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get Workflow details
       */
      get(workflowName, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/workflows/${workflowName}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    WorkflowListResponsesV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "WorkflowListResponsesV4PagePaginationArray");
      }
    };
    Workflows.WorkflowListResponsesV4PagePaginationArray = WorkflowListResponsesV4PagePaginationArray;
    Workflows.Instances = Instances;
    Workflows.InstanceListResponsesV4PagePaginationArray = InstanceListResponsesV4PagePaginationArray;
    Workflows.InstanceBulkResponsesSinglePage = InstanceBulkResponsesSinglePage;
    Workflows.Versions = Versions5;
    Workflows.VersionListResponsesV4PagePaginationArray = VersionListResponsesV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zaraz/config.mjs
var Config3;
var init_config4 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zaraz/config.mjs"() {
    init_import_meta_url();
    init_resource();
    Config3 = class extends APIResource {
      static {
        __name(this, "Config");
      }
      /**
       * Updates Zaraz configuration for a zone.
       *
       * @example
       * ```ts
       * const configuration = await client.zaraz.config.update({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   dataLayer: true,
       *   debugKey: 'debugKey',
       *   settings: { autoInjectScript: true },
       *   tools: {
       *     foo: { ... },
       *   },
       *   triggers: {
       *     foo: { ... },
       *   },
       *   variables: {
       *     foo: { ... },
       *   },
       *   zarazVersion: 0,
       * });
       * ```
       */
      update(params, options) {
        const { zone_id, ...body } = params;
        return this._client.put(`/zones/${zone_id}/settings/zaraz/config`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Gets latest Zaraz configuration for a zone. It can be preview or published
       * configuration, whichever was the last updated. Secret variables values will not
       * be included.
       *
       * @example
       * ```ts
       * const configuration = await client.zaraz.config.get({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      get(params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/settings/zaraz/config`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zaraz/default.mjs
var Default;
var init_default = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zaraz/default.mjs"() {
    init_import_meta_url();
    init_resource();
    Default = class extends APIResource {
      static {
        __name(this, "Default");
      }
      /**
       * Gets default Zaraz configuration for a zone.
       *
       * @example
       * ```ts
       * const configuration = await client.zaraz.default.get({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      get(params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/settings/zaraz/default`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zaraz/export.mjs
var Export;
var init_export = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zaraz/export.mjs"() {
    init_import_meta_url();
    init_resource();
    Export = class extends APIResource {
      static {
        __name(this, "Export");
      }
      /**
       * Exports full current published Zaraz configuration for a zone, secret variables
       * included.
       *
       * @example
       * ```ts
       * const configuration = await client.zaraz.export.get({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      get(params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/settings/zaraz/export`, options);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zaraz/publish.mjs
var Publish;
var init_publish = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zaraz/publish.mjs"() {
    init_import_meta_url();
    init_resource();
    Publish = class extends APIResource {
      static {
        __name(this, "Publish");
      }
      /**
       * Publish current Zaraz preview configuration for a zone.
       *
       * @example
       * ```ts
       * const publish = await client.zaraz.publish.create({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      create(params, options) {
        const { zone_id, body } = params ?? {};
        return this._client.post(`/zones/${zone_id}/settings/zaraz/publish`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zaraz/workflow.mjs
var WorkflowResource;
var init_workflow = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zaraz/workflow.mjs"() {
    init_import_meta_url();
    init_resource();
    WorkflowResource = class extends APIResource {
      static {
        __name(this, "WorkflowResource");
      }
      /**
       * Gets Zaraz workflow for a zone.
       *
       * @example
       * ```ts
       * const workflow = await client.zaraz.workflow.get({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      get(params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/settings/zaraz/workflow`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zaraz/history/configs.mjs
var Configs4;
var init_configs4 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zaraz/history/configs.mjs"() {
    init_import_meta_url();
    init_resource();
    Configs4 = class extends APIResource {
      static {
        __name(this, "Configs");
      }
      /**
       * Gets a history of published Zaraz configurations by ID(s) for a zone.
       *
       * @example
       * ```ts
       * const config = await client.zaraz.history.configs.get({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   ids: [0],
       * });
       * ```
       */
      get(params, options) {
        const { zone_id, ...query } = params;
        return this._client.get(`/zones/${zone_id}/settings/zaraz/history/configs`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zaraz/history/history.mjs
var History3, HistoryListResponsesSinglePage;
var init_history4 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zaraz/history/history.mjs"() {
    init_import_meta_url();
    init_resource();
    init_configs4();
    init_configs4();
    init_pagination();
    History3 = class extends APIResource {
      static {
        __name(this, "History");
      }
      constructor() {
        super(...arguments);
        this.configs = new Configs4(this._client);
      }
      /**
       * Restores a historical published Zaraz configuration by ID for a zone.
       *
       * @example
       * ```ts
       * const configuration = await client.zaraz.history.update({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   body: 12345,
       * });
       * ```
       */
      update(params, options) {
        const { zone_id, body } = params;
        return this._client.put(`/zones/${zone_id}/settings/zaraz/history`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Lists a history of published Zaraz configuration records for a zone.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const historyListResponse of client.zaraz.history.list(
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { zone_id, ...query } = params;
        return this._client.getAPIList(`/zones/${zone_id}/settings/zaraz/history`, HistoryListResponsesSinglePage, { query, ...options });
      }
    };
    HistoryListResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "HistoryListResponsesSinglePage");
      }
    };
    History3.HistoryListResponsesSinglePage = HistoryListResponsesSinglePage;
    History3.Configs = Configs4;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zaraz/zaraz.mjs
var Zaraz;
var init_zaraz = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zaraz/zaraz.mjs"() {
    init_import_meta_url();
    init_resource();
    init_config4();
    init_config4();
    init_default();
    init_default();
    init_export();
    init_export();
    init_publish();
    init_publish();
    init_workflow();
    init_workflow();
    init_history4();
    init_history4();
    Zaraz = class extends APIResource {
      static {
        __name(this, "Zaraz");
      }
      constructor() {
        super(...arguments);
        this.config = new Config3(this._client);
        this.default = new Default(this._client);
        this.export = new Export(this._client);
        this.history = new History3(this._client);
        this.publish = new Publish(this._client);
        this.workflow = new WorkflowResource(this._client);
      }
      /**
       * Updates Zaraz workflow for a zone.
       *
       * @example
       * ```ts
       * const workflow = await client.zaraz.update({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   workflow: 'realtime',
       * });
       * ```
       */
      update(params, options) {
        const { zone_id, workflow } = params;
        return this._client.put(`/zones/${zone_id}/settings/zaraz/workflow`, {
          body: workflow,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
    Zaraz.Config = Config3;
    Zaraz.Default = Default;
    Zaraz.Export = Export;
    Zaraz.History = History3;
    Zaraz.HistoryListResponsesSinglePage = HistoryListResponsesSinglePage;
    Zaraz.Publish = Publish;
    Zaraz.WorkflowResource = WorkflowResource;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/connectivity-settings.mjs
var ConnectivitySettings;
var init_connectivity_settings = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/connectivity-settings.mjs"() {
    init_import_meta_url();
    init_resource();
    ConnectivitySettings = class extends APIResource {
      static {
        __name(this, "ConnectivitySettings");
      }
      /**
       * Updates the Zero Trust Connectivity Settings for the given account.
       *
       * @example
       * ```ts
       * const response =
       *   await client.zeroTrust.connectivitySettings.edit({
       *     account_id: '699d98642c564d2e855e9661899b7252',
       *   });
       * ```
       */
      edit(params, options) {
        const { account_id, ...body } = params;
        return this._client.patch(`/accounts/${account_id}/zerotrust/connectivity_settings`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Gets the Zero Trust Connectivity Settings for the given account.
       *
       * @example
       * ```ts
       * const connectivitySetting =
       *   await client.zeroTrust.connectivitySettings.get({
       *     account_id: '699d98642c564d2e855e9661899b7252',
       *   });
       * ```
       */
      get(params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/zerotrust/connectivity_settings`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/seats.mjs
var Seats, SeatsSinglePage;
var init_seats = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/seats.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Seats = class extends APIResource {
      static {
        __name(this, "Seats");
      }
      /**
       * Removes a user from a Zero Trust seat when both `access_seat` and `gateway_seat`
       * are set to false.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const seat of client.zeroTrust.seats.edit({
       *   account_id: '699d98642c564d2e855e9661899b7252',
       *   body: [
       *     {
       *       access_seat: false,
       *       gateway_seat: false,
       *       seat_uid: 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *     },
       *   ],
       * })) {
       *   // ...
       * }
       * ```
       */
      edit(params, options) {
        const { account_id, body } = params;
        return this._client.getAPIList(`/accounts/${account_id}/access/seats`, SeatsSinglePage, {
          body,
          method: "patch",
          ...options
        });
      }
    };
    SeatsSinglePage = class extends SinglePage {
      static {
        __name(this, "SeatsSinglePage");
      }
    };
    Seats.SeatsSinglePage = SeatsSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/access/bookmarks.mjs
var Bookmarks, BookmarksSinglePage;
var init_bookmarks = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/access/bookmarks.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Bookmarks = class extends APIResource {
      static {
        __name(this, "Bookmarks");
      }
      /**
       * Create a new Bookmark application.
       *
       * @deprecated
       */
      create(bookmarkId, params, options) {
        const { account_id, body } = params;
        return this._client.post(`/accounts/${account_id}/access/bookmarks/${bookmarkId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Updates a configured Bookmark application.
       *
       * @deprecated
       */
      update(bookmarkId, params, options) {
        const { account_id, body } = params;
        return this._client.put(`/accounts/${account_id}/access/bookmarks/${bookmarkId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Lists Bookmark applications.
       *
       * @deprecated
       */
      list(params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/access/bookmarks`, BookmarksSinglePage, options);
      }
      /**
       * Deletes a Bookmark application.
       *
       * @deprecated
       */
      delete(bookmarkId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/access/bookmarks/${bookmarkId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetches a single Bookmark application.
       *
       * @deprecated
       */
      get(bookmarkId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/access/bookmarks/${bookmarkId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    BookmarksSinglePage = class extends SinglePage {
      static {
        __name(this, "BookmarksSinglePage");
      }
    };
    Bookmarks.BookmarksSinglePage = BookmarksSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/access/custom-pages.mjs
var CustomPages2, CustomPageWithoutHTMLsV4PagePaginationArray;
var init_custom_pages2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/access/custom-pages.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    CustomPages2 = class extends APIResource {
      static {
        __name(this, "CustomPages");
      }
      /**
       * Create a custom page
       *
       * @example
       * ```ts
       * const customPageWithoutHTML =
       *   await client.zeroTrust.access.customPages.create({
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     custom_html:
       *       '<html><body><h1>Access Denied</h1></body></html>',
       *     name: 'name',
       *     type: 'identity_denied',
       *   });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/access/custom_pages`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Update a custom page
       *
       * @example
       * ```ts
       * const customPageWithoutHTML =
       *   await client.zeroTrust.access.customPages.update(
       *     'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *     {
       *       account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *       custom_html:
       *         '<html><body><h1>Access Denied</h1></body></html>',
       *       name: 'name',
       *       type: 'identity_denied',
       *     },
       *   );
       * ```
       */
      update(customPageId, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/access/custom_pages/${customPageId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List custom pages
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const customPageWithoutHTML of client.zeroTrust.access.customPages.list(
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/access/custom_pages`, CustomPageWithoutHTMLsV4PagePaginationArray, { query, ...options });
      }
      /**
       * Delete a custom page
       *
       * @example
       * ```ts
       * const customPage =
       *   await client.zeroTrust.access.customPages.delete(
       *     'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      delete(customPageId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/access/custom_pages/${customPageId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetches a custom page and also returns its HTML.
       *
       * @example
       * ```ts
       * const customPage =
       *   await client.zeroTrust.access.customPages.get(
       *     'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      get(customPageId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/access/custom_pages/${customPageId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    CustomPageWithoutHTMLsV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "CustomPageWithoutHTMLsV4PagePaginationArray");
      }
    };
    CustomPages2.CustomPageWithoutHTMLsV4PagePaginationArray = CustomPageWithoutHTMLsV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/access/gateway-ca.mjs
var GatewayCA, GatewayCAListResponsesSinglePage;
var init_gateway_ca = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/access/gateway-ca.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    GatewayCA = class extends APIResource {
      static {
        __name(this, "GatewayCA");
      }
      /**
       * Adds a new SSH Certificate Authority (CA).
       *
       * @example
       * ```ts
       * const gatewayCA =
       *   await client.zeroTrust.access.gatewayCA.create({
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   });
       * ```
       */
      create(params, options) {
        const { account_id } = params;
        return this._client.post(`/accounts/${account_id}/access/gateway_ca`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Lists SSH Certificate Authorities (CA).
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const gatewayCAListResponse of client.zeroTrust.access.gatewayCA.list(
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/access/gateway_ca`, GatewayCAListResponsesSinglePage, options);
      }
      /**
       * Deletes an SSH Certificate Authority.
       *
       * @example
       * ```ts
       * const gatewayCA =
       *   await client.zeroTrust.access.gatewayCA.delete(
       *     'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      delete(certificateId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/access/gateway_ca/${certificateId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    GatewayCAListResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "GatewayCAListResponsesSinglePage");
      }
    };
    GatewayCA.GatewayCAListResponsesSinglePage = GatewayCAListResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/access/groups.mjs
var Groups2, GroupListResponsesV4PagePaginationArray, ZeroTrustGroupsV4PagePaginationArray;
var init_groups2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/access/groups.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    init_error4();
    init_pagination();
    Groups2 = class extends APIResource {
      static {
        __name(this, "Groups");
      }
      /**
       * Creates a new Access group.
       *
       * @example
       * ```ts
       * const group = await client.zeroTrust.access.groups.create({
       *   include: [
       *     {
       *       group: { id: 'aa0a4aab-672b-4bdb-bc33-a59f1130a11f' },
       *     },
       *   ],
       *   name: 'Allow devs',
       *   account_id: 'account_id',
       * });
       * ```
       */
      create(params, options) {
        const { account_id, zone_id, ...body } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.post(`/${accountOrZone}/${accountOrZoneId}/access/groups`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Updates a configured Access group.
       *
       * @example
       * ```ts
       * const group = await client.zeroTrust.access.groups.update(
       *   'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *   {
       *     include: [
       *       {
       *         group: {
       *           id: 'aa0a4aab-672b-4bdb-bc33-a59f1130a11f',
       *         },
       *       },
       *     ],
       *     name: 'Allow devs',
       *     account_id: 'account_id',
       *   },
       * );
       * ```
       */
      update(groupId, params, options) {
        const { account_id, zone_id, ...body } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.put(`/${accountOrZone}/${accountOrZoneId}/access/groups/${groupId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      list(params = {}, options) {
        if (isRequestOptions(params)) {
          return this.list({}, params);
        }
        const { account_id, zone_id, ...query } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.getAPIList(`/${accountOrZone}/${accountOrZoneId}/access/groups`, GroupListResponsesV4PagePaginationArray, { query, ...options });
      }
      delete(groupId, params = {}, options) {
        if (isRequestOptions(params)) {
          return this.delete(groupId, {}, params);
        }
        const { account_id, zone_id } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.delete(`/${accountOrZone}/${accountOrZoneId}/access/groups/${groupId}`, options)._thenUnwrap((obj) => obj.result);
      }
      get(groupId, params = {}, options) {
        if (isRequestOptions(params)) {
          return this.get(groupId, {}, params);
        }
        const { account_id, zone_id } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.get(`/${accountOrZone}/${accountOrZoneId}/access/groups/${groupId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    GroupListResponsesV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "GroupListResponsesV4PagePaginationArray");
      }
    };
    ZeroTrustGroupsV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "ZeroTrustGroupsV4PagePaginationArray");
      }
    };
    Groups2.GroupListResponsesV4PagePaginationArray = GroupListResponsesV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/access/keys.mjs
var Keys4;
var init_keys4 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/access/keys.mjs"() {
    init_import_meta_url();
    init_resource();
    Keys4 = class extends APIResource {
      static {
        __name(this, "Keys");
      }
      /**
       * Updates the Access key rotation settings for an account.
       *
       * @example
       * ```ts
       * const key = await client.zeroTrust.access.keys.update({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   key_rotation_interval_days: 30,
       * });
       * ```
       */
      update(params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/access/keys`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Gets the Access key rotation settings for an account.
       *
       * @example
       * ```ts
       * const key = await client.zeroTrust.access.keys.get({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      get(params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/access/keys`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Perfoms a key rotation for an account.
       *
       * @example
       * ```ts
       * const response = await client.zeroTrust.access.keys.rotate({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      rotate(params, options) {
        const { account_id } = params;
        return this._client.post(`/accounts/${account_id}/access/keys/rotate`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/access/policies.mjs
var Policies3, PolicyListResponsesV4PagePaginationArray;
var init_policies3 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/access/policies.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Policies3 = class extends APIResource {
      static {
        __name(this, "Policies");
      }
      /**
       * Creates a new Access reusable policy.
       *
       * @example
       * ```ts
       * const policy =
       *   await client.zeroTrust.access.policies.create({
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     decision: 'allow',
       *     include: [
       *       {
       *         group: {
       *           id: 'aa0a4aab-672b-4bdb-bc33-a59f1130a11f',
       *         },
       *       },
       *     ],
       *     name: 'Allow devs',
       *   });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/access/policies`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Updates a Access reusable policy.
       *
       * @example
       * ```ts
       * const policy =
       *   await client.zeroTrust.access.policies.update(
       *     'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *     {
       *       account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *       decision: 'allow',
       *       include: [
       *         {
       *           group: {
       *             id: 'aa0a4aab-672b-4bdb-bc33-a59f1130a11f',
       *           },
       *         },
       *       ],
       *       name: 'Allow devs',
       *     },
       *   );
       * ```
       */
      update(policyId, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/access/policies/${policyId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Lists Access reusable policies.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const policyListResponse of client.zeroTrust.access.policies.list(
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/access/policies`, PolicyListResponsesV4PagePaginationArray, { query, ...options });
      }
      /**
       * Deletes an Access reusable policy.
       *
       * @example
       * ```ts
       * const policy =
       *   await client.zeroTrust.access.policies.delete(
       *     'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      delete(policyId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/access/policies/${policyId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetches a single Access reusable policy.
       *
       * @example
       * ```ts
       * const policy = await client.zeroTrust.access.policies.get(
       *   'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(policyId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/access/policies/${policyId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    PolicyListResponsesV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "PolicyListResponsesV4PagePaginationArray");
      }
    };
    Policies3.PolicyListResponsesV4PagePaginationArray = PolicyListResponsesV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/access/service-tokens.mjs
var ServiceTokens, ServiceTokensV4PagePaginationArray;
var init_service_tokens = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/access/service-tokens.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    init_error4();
    init_pagination();
    ServiceTokens = class extends APIResource {
      static {
        __name(this, "ServiceTokens");
      }
      /**
       * Generates a new service token. **Note:** This is the only time you can get the
       * Client Secret. If you lose the Client Secret, you will have to rotate the Client
       * Secret or create a new service token.
       *
       * @example
       * ```ts
       * const serviceToken =
       *   await client.zeroTrust.access.serviceTokens.create({
       *     name: 'CI/CD token',
       *     account_id: 'account_id',
       *   });
       * ```
       */
      create(params, options) {
        const { account_id, zone_id, ...body } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.post(`/${accountOrZone}/${accountOrZoneId}/access/service_tokens`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Updates a configured service token.
       *
       * @example
       * ```ts
       * const serviceToken =
       *   await client.zeroTrust.access.serviceTokens.update(
       *     'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *     { account_id: 'account_id' },
       *   );
       * ```
       */
      update(serviceTokenId, params, options) {
        const { account_id, zone_id, ...body } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.put(`/${accountOrZone}/${accountOrZoneId}/access/service_tokens/${serviceTokenId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      list(params = {}, options) {
        if (isRequestOptions(params)) {
          return this.list({}, params);
        }
        const { account_id, zone_id, ...query } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.getAPIList(`/${accountOrZone}/${accountOrZoneId}/access/service_tokens`, ServiceTokensV4PagePaginationArray, { query, ...options });
      }
      delete(serviceTokenId, params = {}, options) {
        if (isRequestOptions(params)) {
          return this.delete(serviceTokenId, {}, params);
        }
        const { account_id, zone_id } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.delete(`/${accountOrZone}/${accountOrZoneId}/access/service_tokens/${serviceTokenId}`, options)._thenUnwrap((obj) => obj.result);
      }
      get(serviceTokenId, params = {}, options) {
        if (isRequestOptions(params)) {
          return this.get(serviceTokenId, {}, params);
        }
        const { account_id, zone_id } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.get(`/${accountOrZone}/${accountOrZoneId}/access/service_tokens/${serviceTokenId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Refreshes the expiration of a service token.
       *
       * @example
       * ```ts
       * const serviceToken =
       *   await client.zeroTrust.access.serviceTokens.refresh(
       *     'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      refresh(serviceTokenId, params, options) {
        const { account_id } = params;
        return this._client.post(`/accounts/${account_id}/access/service_tokens/${serviceTokenId}/refresh`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Generates a new Client Secret for a service token and revokes the old one.
       *
       * @example
       * ```ts
       * const response =
       *   await client.zeroTrust.access.serviceTokens.rotate(
       *     'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      rotate(serviceTokenId, params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/access/service_tokens/${serviceTokenId}/rotate`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
    ServiceTokensV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "ServiceTokensV4PagePaginationArray");
      }
    };
    ServiceTokens.ServiceTokensV4PagePaginationArray = ServiceTokensV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/access/tags.mjs
var Tags3, TagsV4PagePaginationArray;
var init_tags3 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/access/tags.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Tags3 = class extends APIResource {
      static {
        __name(this, "Tags");
      }
      /**
       * Create a tag
       *
       * @example
       * ```ts
       * const tag = await client.zeroTrust.access.tags.create({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/access/tags`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Update a tag
       *
       * @example
       * ```ts
       * const tag = await client.zeroTrust.access.tags.update(
       *   'engineers',
       *   {
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     name: 'engineers',
       *   },
       * );
       * ```
       */
      update(tagName, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/access/tags/${tagName}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List tags
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const tag of client.zeroTrust.access.tags.list({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * })) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/access/tags`, TagsV4PagePaginationArray, {
          query,
          ...options
        });
      }
      /**
       * Delete a tag
       *
       * @example
       * ```ts
       * const tag = await client.zeroTrust.access.tags.delete(
       *   'engineers',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      delete(tagName, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/access/tags/${tagName}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get a tag
       *
       * @example
       * ```ts
       * const tag = await client.zeroTrust.access.tags.get(
       *   'engineers',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(tagName, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/access/tags/${tagName}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    TagsV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "TagsV4PagePaginationArray");
      }
    };
    Tags3.TagsV4PagePaginationArray = TagsV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/access/applications/cas.mjs
var CAs, CAsV4PagePaginationArray;
var init_cas = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/access/applications/cas.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    init_error4();
    init_pagination();
    CAs = class extends APIResource {
      static {
        __name(this, "CAs");
      }
      create(appId, params = {}, options) {
        if (isRequestOptions(params)) {
          return this.create(appId, {}, params);
        }
        const { account_id, zone_id } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.post(`/${accountOrZone}/${accountOrZoneId}/access/apps/${appId}/ca`, options)._thenUnwrap((obj) => obj.result);
      }
      list(params = {}, options) {
        if (isRequestOptions(params)) {
          return this.list({}, params);
        }
        const { account_id, zone_id, ...query } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.getAPIList(`/${accountOrZone}/${accountOrZoneId}/access/apps/ca`, CAsV4PagePaginationArray, { query, ...options });
      }
      delete(appId, params = {}, options) {
        if (isRequestOptions(params)) {
          return this.delete(appId, {}, params);
        }
        const { account_id, zone_id } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.delete(`/${accountOrZone}/${accountOrZoneId}/access/apps/${appId}/ca`, options)._thenUnwrap((obj) => obj.result);
      }
      get(appId, params = {}, options) {
        if (isRequestOptions(params)) {
          return this.get(appId, {}, params);
        }
        const { account_id, zone_id } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.get(`/${accountOrZone}/${accountOrZoneId}/access/apps/${appId}/ca`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    CAsV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "CAsV4PagePaginationArray");
      }
    };
    CAs.CAsV4PagePaginationArray = CAsV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/access/applications/policies.mjs
var Policies4, PolicyListResponsesV4PagePaginationArray2;
var init_policies4 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/access/applications/policies.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    init_error4();
    init_pagination();
    Policies4 = class extends APIResource {
      static {
        __name(this, "Policies");
      }
      /**
       * Creates a policy applying exclusive to a single application that defines the
       * users or groups who can reach it. We recommend creating a reusable policy
       * instead and subsequently referencing its ID in the application's 'policies'
       * array.
       *
       * @example
       * ```ts
       * const policy =
       *   await client.zeroTrust.access.applications.policies.create(
       *     'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *     { account_id: 'account_id' },
       *   );
       * ```
       */
      create(appId, params, options) {
        const { account_id, zone_id, ...body } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.post(`/${accountOrZone}/${accountOrZoneId}/access/apps/${appId}/policies`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Updates an Access policy specific to an application. To update a reusable
       * policy, use the /account or zones/{account or zone_id}/policies/{uid} endpoint.
       *
       * @example
       * ```ts
       * const policy =
       *   await client.zeroTrust.access.applications.policies.update(
       *     'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *     'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *     { account_id: 'account_id' },
       *   );
       * ```
       */
      update(appId, policyId, params, options) {
        const { account_id, zone_id, ...body } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.put(`/${accountOrZone}/${accountOrZoneId}/access/apps/${appId}/policies/${policyId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      list(appId, params = {}, options) {
        if (isRequestOptions(params)) {
          return this.list(appId, {}, params);
        }
        const { account_id, zone_id, ...query } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.getAPIList(`/${accountOrZone}/${accountOrZoneId}/access/apps/${appId}/policies`, PolicyListResponsesV4PagePaginationArray2, { query, ...options });
      }
      delete(appId, policyId, params = {}, options) {
        if (isRequestOptions(params)) {
          return this.delete(appId, policyId, {}, params);
        }
        const { account_id, zone_id } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.delete(`/${accountOrZone}/${accountOrZoneId}/access/apps/${appId}/policies/${policyId}`, options)._thenUnwrap((obj) => obj.result);
      }
      get(appId, policyId, params = {}, options) {
        if (isRequestOptions(params)) {
          return this.get(appId, policyId, {}, params);
        }
        const { account_id, zone_id } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.get(`/${accountOrZone}/${accountOrZoneId}/access/apps/${appId}/policies/${policyId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    PolicyListResponsesV4PagePaginationArray2 = class extends V4PagePaginationArray {
      static {
        __name(this, "PolicyListResponsesV4PagePaginationArray");
      }
    };
    Policies4.PolicyListResponsesV4PagePaginationArray = PolicyListResponsesV4PagePaginationArray2;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/access/applications/settings.mjs
var Settings13;
var init_settings13 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/access/applications/settings.mjs"() {
    init_import_meta_url();
    init_resource();
    init_error4();
    Settings13 = class extends APIResource {
      static {
        __name(this, "Settings");
      }
      /**
       * Updates Access application settings.
       *
       * @example
       * ```ts
       * const setting =
       *   await client.zeroTrust.access.applications.settings.update(
       *     '023e105f4ecef8ad9ca31a8372d0c353',
       *     { account_id: 'account_id' },
       *   );
       * ```
       */
      update(appId, params, options) {
        const { account_id, zone_id, ...body } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.put(`/${accountOrZone}/${accountOrZoneId}/access/apps/${appId}/settings`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Updates Access application settings.
       *
       * @example
       * ```ts
       * const response =
       *   await client.zeroTrust.access.applications.settings.edit(
       *     '023e105f4ecef8ad9ca31a8372d0c353',
       *     { account_id: 'account_id' },
       *   );
       * ```
       */
      edit(appId, params, options) {
        const { account_id, zone_id, ...body } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.patch(`/${accountOrZone}/${accountOrZoneId}/access/apps/${appId}/settings`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/access/applications/user-policy-checks.mjs
var UserPolicyChecks;
var init_user_policy_checks = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/access/applications/user-policy-checks.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    init_error4();
    UserPolicyChecks = class extends APIResource {
      static {
        __name(this, "UserPolicyChecks");
      }
      list(appId, params = {}, options) {
        if (isRequestOptions(params)) {
          return this.list(appId, {}, params);
        }
        const { account_id, zone_id } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.get(`/${accountOrZone}/${accountOrZoneId}/access/apps/${appId}/user_policy_checks`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/access/applications/policy-tests/users.mjs
var Users, UserListResponsesV4PagePaginationArray;
var init_users = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/access/applications/policy-tests/users.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Users = class extends APIResource {
      static {
        __name(this, "Users");
      }
      /**
       * Fetches a single page of user results from an Access policy test.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const userListResponse of client.zeroTrust.access.applications.policyTests.users.list(
       *   'f1a8b3c9d4e5f6789a0b1c2d3e4f5678a9b0c1d2e3f4a5b67890c1d2e3f4b5a6',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(policyTestId, params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/access/policy-tests/${policyTestId}/users`, UserListResponsesV4PagePaginationArray, { query, ...options });
      }
    };
    UserListResponsesV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "UserListResponsesV4PagePaginationArray");
      }
    };
    Users.UserListResponsesV4PagePaginationArray = UserListResponsesV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/access/applications/policy-tests/policy-tests.mjs
var PolicyTests;
var init_policy_tests = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/access/applications/policy-tests/policy-tests.mjs"() {
    init_import_meta_url();
    init_resource();
    init_users();
    init_users();
    PolicyTests = class extends APIResource {
      static {
        __name(this, "PolicyTests");
      }
      constructor() {
        super(...arguments);
        this.users = new Users(this._client);
      }
      /**
       * Starts an Access policy test.
       *
       * @example
       * ```ts
       * const policyTest =
       *   await client.zeroTrust.access.applications.policyTests.create(
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/access/policy-tests`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetches the current status of a given Access policy test.
       *
       * @example
       * ```ts
       * const policyTest =
       *   await client.zeroTrust.access.applications.policyTests.get(
       *     'f1a8b3c9d4e5f6789a0b1c2d3e4f5678a9b0c1d2e3f4a5b67890c1d2e3f4b5a6',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      get(policyTestId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/access/policy-tests/${policyTestId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    PolicyTests.Users = Users;
    PolicyTests.UserListResponsesV4PagePaginationArray = UserListResponsesV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/access/applications/applications.mjs
var Applications, ApplicationListResponsesV4PagePaginationArray;
var init_applications = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/access/applications/applications.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    init_cas();
    init_cas();
    init_policies4();
    init_policies4();
    init_settings13();
    init_settings13();
    init_user_policy_checks();
    init_user_policy_checks();
    init_policy_tests();
    init_policy_tests();
    init_error4();
    init_pagination();
    Applications = class extends APIResource {
      static {
        __name(this, "Applications");
      }
      constructor() {
        super(...arguments);
        this.cas = new CAs(this._client);
        this.userPolicyChecks = new UserPolicyChecks(this._client);
        this.policies = new Policies4(this._client);
        this.policyTests = new PolicyTests(this._client);
        this.settings = new Settings13(this._client);
      }
      /**
       * Adds a new application to Access.
       *
       * @example
       * ```ts
       * const application =
       *   await client.zeroTrust.access.applications.create({
       *     domain: 'test.example.com/admin',
       *     type: 'self_hosted',
       *     account_id: 'account_id',
       *   });
       * ```
       */
      create(params, options) {
        const { account_id, zone_id, ...body } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.post(`/${accountOrZone}/${accountOrZoneId}/access/apps`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Updates an Access application.
       *
       * @example
       * ```ts
       * const application =
       *   await client.zeroTrust.access.applications.update(
       *     '023e105f4ecef8ad9ca31a8372d0c353',
       *     {
       *       domain: 'test.example.com/admin',
       *       type: 'self_hosted',
       *       account_id: 'account_id',
       *     },
       *   );
       * ```
       */
      update(appId, params, options) {
        const { account_id, zone_id, ...body } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.put(`/${accountOrZone}/${accountOrZoneId}/access/apps/${appId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      list(params = {}, options) {
        if (isRequestOptions(params)) {
          return this.list({}, params);
        }
        const { account_id, zone_id, ...query } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.getAPIList(`/${accountOrZone}/${accountOrZoneId}/access/apps`, ApplicationListResponsesV4PagePaginationArray, { query, ...options });
      }
      delete(appId, params = {}, options) {
        if (isRequestOptions(params)) {
          return this.delete(appId, {}, params);
        }
        const { account_id, zone_id } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.delete(`/${accountOrZone}/${accountOrZoneId}/access/apps/${appId}`, options)._thenUnwrap((obj) => obj.result);
      }
      get(appId, params = {}, options) {
        if (isRequestOptions(params)) {
          return this.get(appId, {}, params);
        }
        const { account_id, zone_id } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.get(`/${accountOrZone}/${accountOrZoneId}/access/apps/${appId}`, options)._thenUnwrap((obj) => obj.result);
      }
      revokeTokens(appId, params = {}, options) {
        if (isRequestOptions(params)) {
          return this.revokeTokens(appId, {}, params);
        }
        const { account_id, zone_id } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.post(`/${accountOrZone}/${accountOrZoneId}/access/apps/${appId}/revoke_tokens`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    ApplicationListResponsesV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "ApplicationListResponsesV4PagePaginationArray");
      }
    };
    Applications.ApplicationListResponsesV4PagePaginationArray = ApplicationListResponsesV4PagePaginationArray;
    Applications.CAs = CAs;
    Applications.CAsV4PagePaginationArray = CAsV4PagePaginationArray;
    Applications.UserPolicyChecks = UserPolicyChecks;
    Applications.Policies = Policies4;
    Applications.PolicyListResponsesV4PagePaginationArray = PolicyListResponsesV4PagePaginationArray2;
    Applications.PolicyTests = PolicyTests;
    Applications.Settings = Settings13;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/access/certificates/settings.mjs
var Settings14, CertificateSettingsSinglePage;
var init_settings14 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/access/certificates/settings.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    init_error4();
    init_pagination();
    Settings14 = class extends APIResource {
      static {
        __name(this, "Settings");
      }
      /**
       * Updates an mTLS certificate's hostname settings.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const certificateSettings of client.zeroTrust.access.certificates.settings.update(
       *   {
       *     settings: [
       *       {
       *         china_network: false,
       *         client_certificate_forwarding: true,
       *         hostname: 'admin.example.com',
       *       },
       *     ],
       *     account_id: 'account_id',
       *   },
       * )) {
       *   // ...
       * }
       * ```
       */
      update(params, options) {
        const { account_id, zone_id, ...body } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.getAPIList(`/${accountOrZone}/${accountOrZoneId}/access/certificates/settings`, CertificateSettingsSinglePage, { body, method: "put", ...options });
      }
      get(params = {}, options) {
        if (isRequestOptions(params)) {
          return this.get({}, params);
        }
        const { account_id, zone_id } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.getAPIList(`/${accountOrZone}/${accountOrZoneId}/access/certificates/settings`, CertificateSettingsSinglePage, options);
      }
    };
    CertificateSettingsSinglePage = class extends SinglePage {
      static {
        __name(this, "CertificateSettingsSinglePage");
      }
    };
    Settings14.CertificateSettingsSinglePage = CertificateSettingsSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/access/certificates/certificates.mjs
var Certificates3, CertificatesV4PagePaginationArray;
var init_certificates3 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/access/certificates/certificates.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    init_settings14();
    init_settings14();
    init_error4();
    init_pagination();
    Certificates3 = class extends APIResource {
      static {
        __name(this, "Certificates");
      }
      constructor() {
        super(...arguments);
        this.settings = new Settings14(this._client);
      }
      /**
       * Adds a new mTLS root certificate to Access.
       *
       * @example
       * ```ts
       * const certificate =
       *   await client.zeroTrust.access.certificates.create({
       *     certificate:
       *       '-----BEGIN CERTIFICATE-----\nMIIGAjCCA+qgAwIBAgIJAI7kymlF7CWT...N4RI7KKB7nikiuUf8vhULKy5IX10\nDrUtmu/B\n-----END CERTIFICATE-----',
       *     name: 'Allow devs',
       *     account_id: 'account_id',
       *   });
       * ```
       */
      create(params, options) {
        const { account_id, zone_id, ...body } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.post(`/${accountOrZone}/${accountOrZoneId}/access/certificates`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Updates a configured mTLS certificate.
       *
       * @example
       * ```ts
       * const certificate =
       *   await client.zeroTrust.access.certificates.update(
       *     'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *     {
       *       associated_hostnames: ['admin.example.com'],
       *       account_id: 'account_id',
       *     },
       *   );
       * ```
       */
      update(certificateId, params, options) {
        const { account_id, zone_id, ...body } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.put(`/${accountOrZone}/${accountOrZoneId}/access/certificates/${certificateId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      list(params = {}, options) {
        if (isRequestOptions(params)) {
          return this.list({}, params);
        }
        const { account_id, zone_id, ...query } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.getAPIList(`/${accountOrZone}/${accountOrZoneId}/access/certificates`, CertificatesV4PagePaginationArray, { query, ...options });
      }
      delete(certificateId, params = {}, options) {
        if (isRequestOptions(params)) {
          return this.delete(certificateId, {}, params);
        }
        const { account_id, zone_id } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.delete(`/${accountOrZone}/${accountOrZoneId}/access/certificates/${certificateId}`, options)._thenUnwrap((obj) => obj.result);
      }
      get(certificateId, params = {}, options) {
        if (isRequestOptions(params)) {
          return this.get(certificateId, {}, params);
        }
        const { account_id, zone_id } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.get(`/${accountOrZone}/${accountOrZoneId}/access/certificates/${certificateId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    CertificatesV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "CertificatesV4PagePaginationArray");
      }
    };
    Certificates3.CertificatesV4PagePaginationArray = CertificatesV4PagePaginationArray;
    Certificates3.Settings = Settings14;
    Certificates3.CertificateSettingsSinglePage = CertificateSettingsSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/access/infrastructure/targets.mjs
var Targets, TargetListResponsesV4PagePaginationArray, TargetBulkUpdateResponsesSinglePage;
var init_targets = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/access/infrastructure/targets.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Targets = class extends APIResource {
      static {
        __name(this, "Targets");
      }
      /**
       * Create new target
       *
       * @example
       * ```ts
       * const target =
       *   await client.zeroTrust.access.infrastructure.targets.create(
       *     {
       *       account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *       hostname: 'infra-access-target',
       *       ip: {},
       *     },
       *   );
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/infrastructure/targets`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Update target
       *
       * @example
       * ```ts
       * const target =
       *   await client.zeroTrust.access.infrastructure.targets.update(
       *     '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
       *     {
       *       account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *       hostname: 'infra-access-target',
       *       ip: {},
       *     },
       *   );
       * ```
       */
      update(targetId, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/infrastructure/targets/${targetId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Lists and sorts an account’s targets. Filters are optional and are ANDed
       * together.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const targetListResponse of client.zeroTrust.access.infrastructure.targets.list(
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/infrastructure/targets`, TargetListResponsesV4PagePaginationArray, { query, ...options });
      }
      /**
       * Delete target
       *
       * @example
       * ```ts
       * await client.zeroTrust.access.infrastructure.targets.delete(
       *   '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      delete(targetId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/infrastructure/targets/${targetId}`, {
          ...options,
          headers: { Accept: "*/*", ...options?.headers }
        });
      }
      /**
       * Removes one or more targets.
       *
       * @deprecated
       */
      bulkDelete(params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/infrastructure/targets/batch`, {
          ...options,
          headers: { Accept: "*/*", ...options?.headers }
        });
      }
      /**
       * Removes one or more targets.
       *
       * @example
       * ```ts
       * await client.zeroTrust.access.infrastructure.targets.bulkDeleteV2(
       *   {
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     target_ids: ['182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'],
       *   },
       * );
       * ```
       */
      bulkDeleteV2(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/infrastructure/targets/batch_delete`, {
          body,
          ...options,
          headers: { Accept: "*/*", ...options?.headers }
        });
      }
      /**
       * Adds one or more targets.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const targetBulkUpdateResponse of client.zeroTrust.access.infrastructure.targets.bulkUpdate(
       *   {
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     body: [{ hostname: 'infra-access-target', ip: {} }],
       *   },
       * )) {
       *   // ...
       * }
       * ```
       */
      bulkUpdate(params, options) {
        const { account_id, body } = params;
        return this._client.getAPIList(`/accounts/${account_id}/infrastructure/targets/batch`, TargetBulkUpdateResponsesSinglePage, { body, method: "put", ...options });
      }
      /**
       * Get target
       *
       * @example
       * ```ts
       * const target =
       *   await client.zeroTrust.access.infrastructure.targets.get(
       *     '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      get(targetId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/infrastructure/targets/${targetId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    TargetListResponsesV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "TargetListResponsesV4PagePaginationArray");
      }
    };
    TargetBulkUpdateResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "TargetBulkUpdateResponsesSinglePage");
      }
    };
    Targets.TargetListResponsesV4PagePaginationArray = TargetListResponsesV4PagePaginationArray;
    Targets.TargetBulkUpdateResponsesSinglePage = TargetBulkUpdateResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/access/infrastructure/infrastructure.mjs
var Infrastructure;
var init_infrastructure = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/access/infrastructure/infrastructure.mjs"() {
    init_import_meta_url();
    init_resource();
    init_targets();
    init_targets();
    Infrastructure = class extends APIResource {
      static {
        __name(this, "Infrastructure");
      }
      constructor() {
        super(...arguments);
        this.targets = new Targets(this._client);
      }
    };
    Infrastructure.Targets = Targets;
    Infrastructure.TargetListResponsesV4PagePaginationArray = TargetListResponsesV4PagePaginationArray;
    Infrastructure.TargetBulkUpdateResponsesSinglePage = TargetBulkUpdateResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/access/logs/access-requests.mjs
var AccessRequests;
var init_access_requests = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/access/logs/access-requests.mjs"() {
    init_import_meta_url();
    init_resource();
    AccessRequests = class extends APIResource {
      static {
        __name(this, "AccessRequests");
      }
      /**
       * Gets a list of Access authentication audit logs for an account.
       *
       * @example
       * ```ts
       * const accessRequests =
       *   await client.zeroTrust.access.logs.accessRequests.list({
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *   });
       * ```
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.get(`/accounts/${account_id}/access/logs/access_requests`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/access/logs/scim/updates.mjs
var Updates, UpdateListResponsesV4PagePaginationArray;
var init_updates = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/access/logs/scim/updates.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Updates = class extends APIResource {
      static {
        __name(this, "Updates");
      }
      /**
       * Lists Access SCIM update logs that maintain a record of updates made to User and
       * Group resources synced to Cloudflare via the System for Cross-domain Identity
       * Management (SCIM).
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const updateListResponse of client.zeroTrust.access.logs.scim.updates.list(
       *   {
       *     account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       *     idp_id: [
       *       'df7e2w5f-02b7-4d9d-af26-8d1988fca630',
       *       '0194ae2c-efcf-7cfb-8884-055f1a161fa5',
       *     ],
       *   },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/access/logs/scim/updates`, UpdateListResponsesV4PagePaginationArray, { query, ...options });
      }
    };
    UpdateListResponsesV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "UpdateListResponsesV4PagePaginationArray");
      }
    };
    Updates.UpdateListResponsesV4PagePaginationArray = UpdateListResponsesV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/access/logs/scim/scim.mjs
var SCIM;
var init_scim = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/access/logs/scim/scim.mjs"() {
    init_import_meta_url();
    init_resource();
    init_updates();
    init_updates();
    SCIM = class extends APIResource {
      static {
        __name(this, "SCIM");
      }
      constructor() {
        super(...arguments);
        this.updates = new Updates(this._client);
      }
    };
    SCIM.Updates = Updates;
    SCIM.UpdateListResponsesV4PagePaginationArray = UpdateListResponsesV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/access/logs/logs.mjs
var Logs7;
var init_logs7 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/access/logs/logs.mjs"() {
    init_import_meta_url();
    init_resource();
    init_access_requests();
    init_access_requests();
    init_scim();
    init_scim();
    Logs7 = class extends APIResource {
      static {
        __name(this, "Logs");
      }
      constructor() {
        super(...arguments);
        this.accessRequests = new AccessRequests(this._client);
        this.scim = new SCIM(this._client);
      }
    };
    Logs7.AccessRequests = AccessRequests;
    Logs7.SCIM = SCIM;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/access/users/active-sessions.mjs
var ActiveSessions, ActiveSessionListResponsesSinglePage;
var init_active_sessions = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/access/users/active-sessions.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    ActiveSessions = class extends APIResource {
      static {
        __name(this, "ActiveSessions");
      }
      /**
       * Get active sessions for a single user.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const activeSessionListResponse of client.zeroTrust.access.users.activeSessions.list(
       *   'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(userId, params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/access/users/${userId}/active_sessions`, ActiveSessionListResponsesSinglePage, options);
      }
      /**
       * Get an active session for a single user.
       *
       * @example
       * ```ts
       * const activeSession =
       *   await client.zeroTrust.access.users.activeSessions.get(
       *     'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *     'X1aXj1lFVcqqyoXF',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      get(userId, nonce, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/access/users/${userId}/active_sessions/${nonce}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    ActiveSessionListResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "ActiveSessionListResponsesSinglePage");
      }
    };
    ActiveSessions.ActiveSessionListResponsesSinglePage = ActiveSessionListResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/access/users/failed-logins.mjs
var FailedLogins, FailedLoginListResponsesSinglePage;
var init_failed_logins = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/access/users/failed-logins.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    FailedLogins = class extends APIResource {
      static {
        __name(this, "FailedLogins");
      }
      /**
       * Get all failed login attempts for a single user.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const failedLoginListResponse of client.zeroTrust.access.users.failedLogins.list(
       *   'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(userId, params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/access/users/${userId}/failed_logins`, FailedLoginListResponsesSinglePage, options);
      }
    };
    FailedLoginListResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "FailedLoginListResponsesSinglePage");
      }
    };
    FailedLogins.FailedLoginListResponsesSinglePage = FailedLoginListResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/access/users/last-seen-identity.mjs
var LastSeenIdentity;
var init_last_seen_identity = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/access/users/last-seen-identity.mjs"() {
    init_import_meta_url();
    init_resource();
    LastSeenIdentity = class extends APIResource {
      static {
        __name(this, "LastSeenIdentity");
      }
      /**
       * Get last seen identity for a single user.
       *
       * @example
       * ```ts
       * const identity =
       *   await client.zeroTrust.access.users.lastSeenIdentity.get(
       *     'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      get(userId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/access/users/${userId}/last_seen_identity`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/access/users/users.mjs
var Users2, UserListResponsesV4PagePaginationArray2, AccessUsersV4PagePaginationArray;
var init_users2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/access/users/users.mjs"() {
    init_import_meta_url();
    init_resource();
    init_active_sessions();
    init_active_sessions();
    init_failed_logins();
    init_failed_logins();
    init_last_seen_identity();
    init_last_seen_identity();
    init_pagination();
    Users2 = class extends APIResource {
      static {
        __name(this, "Users");
      }
      constructor() {
        super(...arguments);
        this.activeSessions = new ActiveSessions(this._client);
        this.lastSeenIdentity = new LastSeenIdentity(this._client);
        this.failedLogins = new FailedLogins(this._client);
      }
      /**
       * Gets a list of users for an account.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const userListResponse of client.zeroTrust.access.users.list(
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/access/users`, UserListResponsesV4PagePaginationArray2, { query, ...options });
      }
    };
    UserListResponsesV4PagePaginationArray2 = class extends V4PagePaginationArray {
      static {
        __name(this, "UserListResponsesV4PagePaginationArray");
      }
    };
    AccessUsersV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "AccessUsersV4PagePaginationArray");
      }
    };
    Users2.UserListResponsesV4PagePaginationArray = UserListResponsesV4PagePaginationArray2;
    Users2.ActiveSessions = ActiveSessions;
    Users2.ActiveSessionListResponsesSinglePage = ActiveSessionListResponsesSinglePage;
    Users2.LastSeenIdentity = LastSeenIdentity;
    Users2.FailedLogins = FailedLogins;
    Users2.FailedLoginListResponsesSinglePage = FailedLoginListResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/access/access.mjs
var Access;
var init_access2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/access/access.mjs"() {
    init_import_meta_url();
    init_resource();
    init_bookmarks();
    init_bookmarks();
    init_custom_pages2();
    init_custom_pages2();
    init_gateway_ca();
    init_gateway_ca();
    init_groups2();
    init_groups2();
    init_keys4();
    init_keys4();
    init_policies3();
    init_policies3();
    init_service_tokens();
    init_service_tokens();
    init_tags3();
    init_tags3();
    init_applications();
    init_applications();
    init_certificates3();
    init_certificates3();
    init_infrastructure();
    init_infrastructure();
    init_logs7();
    init_logs7();
    init_users2();
    init_users2();
    Access = class extends APIResource {
      static {
        __name(this, "Access");
      }
      constructor() {
        super(...arguments);
        this.gatewayCA = new GatewayCA(this._client);
        this.infrastructure = new Infrastructure(this._client);
        this.applications = new Applications(this._client);
        this.certificates = new Certificates3(this._client);
        this.groups = new Groups2(this._client);
        this.serviceTokens = new ServiceTokens(this._client);
        this.bookmarks = new Bookmarks(this._client);
        this.keys = new Keys4(this._client);
        this.logs = new Logs7(this._client);
        this.users = new Users2(this._client);
        this.customPages = new CustomPages2(this._client);
        this.tags = new Tags3(this._client);
        this.policies = new Policies3(this._client);
      }
    };
    Access.GatewayCA = GatewayCA;
    Access.GatewayCAListResponsesSinglePage = GatewayCAListResponsesSinglePage;
    Access.Infrastructure = Infrastructure;
    Access.Applications = Applications;
    Access.ApplicationListResponsesV4PagePaginationArray = ApplicationListResponsesV4PagePaginationArray;
    Access.Certificates = Certificates3;
    Access.CertificatesV4PagePaginationArray = CertificatesV4PagePaginationArray;
    Access.Groups = Groups2;
    Access.GroupListResponsesV4PagePaginationArray = GroupListResponsesV4PagePaginationArray;
    Access.ServiceTokens = ServiceTokens;
    Access.ServiceTokensV4PagePaginationArray = ServiceTokensV4PagePaginationArray;
    Access.Bookmarks = Bookmarks;
    Access.BookmarksSinglePage = BookmarksSinglePage;
    Access.Keys = Keys4;
    Access.Logs = Logs7;
    Access.Users = Users2;
    Access.UserListResponsesV4PagePaginationArray = UserListResponsesV4PagePaginationArray2;
    Access.CustomPages = CustomPages2;
    Access.CustomPageWithoutHTMLsV4PagePaginationArray = CustomPageWithoutHTMLsV4PagePaginationArray;
    Access.Tags = Tags3;
    Access.TagsV4PagePaginationArray = TagsV4PagePaginationArray;
    Access.Policies = Policies3;
    Access.PolicyListResponsesV4PagePaginationArray = PolicyListResponsesV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/devices/devices_.mjs
var Devices, DeviceListResponsesCursorPagination;
var init_devices = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/devices/devices_.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Devices = class extends APIResource {
      static {
        __name(this, "Devices");
      }
      /**
       * Lists WARP devices.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const deviceListResponse of client.zeroTrust.devices.devices.list(
       *   { account_id: 'account_id' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/devices/physical-devices`, DeviceListResponsesCursorPagination, { query, ...options });
      }
      /**
       * Deletes a WARP device.
       *
       * @example
       * ```ts
       * const device =
       *   await client.zeroTrust.devices.devices.delete(
       *     'device_id',
       *     { account_id: 'account_id' },
       *   );
       * ```
       */
      delete(deviceId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/devices/physical-devices/${deviceId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetches a single WARP device.
       *
       * @example
       * ```ts
       * const device = await client.zeroTrust.devices.devices.get(
       *   'device_id',
       *   { account_id: 'account_id' },
       * );
       * ```
       */
      get(deviceId, params, options) {
        const { account_id, ...query } = params;
        return this._client.get(`/accounts/${account_id}/devices/physical-devices/${deviceId}`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Revokes all WARP registrations associated with the specified device.
       *
       * @example
       * ```ts
       * const response =
       *   await client.zeroTrust.devices.devices.revoke(
       *     'device_id',
       *     { account_id: 'account_id' },
       *   );
       * ```
       */
      revoke(deviceId, params, options) {
        const { account_id } = params;
        return this._client.post(`/accounts/${account_id}/devices/physical-devices/${deviceId}/revoke`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    DeviceListResponsesCursorPagination = class extends CursorPagination {
      static {
        __name(this, "DeviceListResponsesCursorPagination");
      }
    };
    Devices.DeviceListResponsesCursorPagination = DeviceListResponsesCursorPagination;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/devices/dex-tests.mjs
var DEXTests, DEXTestListResponsesSinglePage;
var init_dex_tests = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/devices/dex-tests.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    DEXTests = class extends APIResource {
      static {
        __name(this, "DEXTests");
      }
      /**
       * Create a DEX test.
       *
       * @example
       * ```ts
       * const dexTest =
       *   await client.zeroTrust.devices.dexTests.create({
       *     account_id: '01a7362d577a6c3019a474fd6f485823',
       *     data: {},
       *     enabled: true,
       *     interval: '30m',
       *     name: 'HTTP dash health check',
       *   });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/dex/devices/dex_tests`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Update a DEX test.
       *
       * @example
       * ```ts
       * const dexTest =
       *   await client.zeroTrust.devices.dexTests.update(
       *     'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *     {
       *       account_id: '01a7362d577a6c3019a474fd6f485823',
       *       data: {},
       *       enabled: true,
       *       interval: '30m',
       *       name: 'HTTP dash health check',
       *     },
       *   );
       * ```
       */
      update(dexTestId, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/dex/devices/dex_tests/${dexTestId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetch all DEX tests
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const dexTestListResponse of client.zeroTrust.devices.dexTests.list(
       *   { account_id: '01a7362d577a6c3019a474fd6f485823' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/dex/devices/dex_tests`, DEXTestListResponsesSinglePage, options);
      }
      /**
       * Delete a Device DEX test. Returns the remaining device dex tests for the
       * account.
       *
       * @example
       * ```ts
       * const dexTest =
       *   await client.zeroTrust.devices.dexTests.delete(
       *     'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *     { account_id: '01a7362d577a6c3019a474fd6f485823' },
       *   );
       * ```
       */
      delete(dexTestId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/dex/devices/dex_tests/${dexTestId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetch a single DEX test.
       *
       * @example
       * ```ts
       * const dexTest = await client.zeroTrust.devices.dexTests.get(
       *   '372e67954025e0ba6aaa6d586b9e0b59',
       *   { account_id: '01a7362d577a6c3019a474fd6f485823' },
       * );
       * ```
       */
      get(dexTestId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/dex/devices/dex_tests/${dexTestId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    DEXTestListResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "DEXTestListResponsesSinglePage");
      }
    };
    DEXTests.DEXTestListResponsesSinglePage = DEXTestListResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/devices/fleet-status.mjs
var FleetStatus;
var init_fleet_status = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/devices/fleet-status.mjs"() {
    init_import_meta_url();
    init_resource();
    FleetStatus = class extends APIResource {
      static {
        __name(this, "FleetStatus");
      }
      /**
       * Get the live status of a latest device given device_id from the device_state
       * table
       *
       * @example
       * ```ts
       * const fleetStatus =
       *   await client.zeroTrust.devices.fleetStatus.get(
       *     'cb49c27f-7f97-49c5-b6f3-f7c01ead0fd7',
       *     {
       *       account_id: '01a7362d577a6c3019a474fd6f485823',
       *       since_minutes: 10,
       *     },
       *   );
       * ```
       */
      get(deviceId, params, options) {
        const { account_id, ...query } = params;
        return this._client.get(`/accounts/${account_id}/dex/devices/${deviceId}/fleet-status/live`, {
          query,
          ...options
        });
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/devices/networks.mjs
var Networks, DeviceNetworksSinglePage;
var init_networks = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/devices/networks.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Networks = class extends APIResource {
      static {
        __name(this, "Networks");
      }
      /**
       * Creates a new device managed network.
       *
       * @example
       * ```ts
       * const deviceNetwork =
       *   await client.zeroTrust.devices.networks.create({
       *     account_id: '699d98642c564d2e855e9661899b7252',
       *     config: { tls_sockaddr: 'foo.bar:1234' },
       *     name: 'managed-network-1',
       *     type: 'tls',
       *   });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/devices/networks`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Updates a configured device managed network.
       *
       * @example
       * ```ts
       * const deviceNetwork =
       *   await client.zeroTrust.devices.networks.update(
       *     'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *     { account_id: '699d98642c564d2e855e9661899b7252' },
       *   );
       * ```
       */
      update(networkId, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/devices/networks/${networkId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetches a list of managed networks for an account.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const deviceNetwork of client.zeroTrust.devices.networks.list(
       *   { account_id: '699d98642c564d2e855e9661899b7252' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/devices/networks`, DeviceNetworksSinglePage, options);
      }
      /**
       * Deletes a device managed network and fetches a list of the remaining device
       * managed networks for an account.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const deviceNetwork of client.zeroTrust.devices.networks.delete(
       *   'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *   { account_id: '699d98642c564d2e855e9661899b7252' },
       * )) {
       *   // ...
       * }
       * ```
       */
      delete(networkId, params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/devices/networks/${networkId}`, DeviceNetworksSinglePage, { method: "delete", ...options });
      }
      /**
       * Fetches details for a single managed network.
       *
       * @example
       * ```ts
       * const deviceNetwork =
       *   await client.zeroTrust.devices.networks.get(
       *     'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *     { account_id: '699d98642c564d2e855e9661899b7252' },
       *   );
       * ```
       */
      get(networkId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/devices/networks/${networkId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    DeviceNetworksSinglePage = class extends SinglePage {
      static {
        __name(this, "DeviceNetworksSinglePage");
      }
    };
    Networks.DeviceNetworksSinglePage = DeviceNetworksSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/devices/override-codes.mjs
var OverrideCodes, OverrideCodeListResponsesSinglePage;
var init_override_codes = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/devices/override-codes.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    OverrideCodes = class extends APIResource {
      static {
        __name(this, "OverrideCodes");
      }
      /**
       * Fetches a one-time use admin override code for a device. This relies on the
       * **Admin Override** setting being enabled in your device configuration. Not
       * supported when
       * [multi-user mode](https://developers.cloudflare.com/cloudflare-one/connections/connect-devices/warp/deployment/mdm-deployment/windows-multiuser/)
       * is enabled for the account. **Deprecated:** please use GET
       * /accounts/{account_id}/devices/registrations/{registration_id}/override_codes
       * instead.
       *
       * @deprecated
       */
      list(deviceId, params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/devices/${deviceId}/override_codes`, OverrideCodeListResponsesSinglePage, options);
      }
      /**
       * Fetches one-time use admin override codes for a registration. This relies on the
       * **Admin Override** setting being enabled in your device configuration.
       *
       * @example
       * ```ts
       * const overrideCode =
       *   await client.zeroTrust.devices.overrideCodes.get(
       *     'registration_id',
       *     { account_id: 'account_id' },
       *   );
       * ```
       */
      get(registrationId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/devices/registrations/${registrationId}/override_codes`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    OverrideCodeListResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "OverrideCodeListResponsesSinglePage");
      }
    };
    OverrideCodes.OverrideCodeListResponsesSinglePage = OverrideCodeListResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/devices/registrations.mjs
var Registrations, RegistrationListResponsesCursorPagination;
var init_registrations = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/devices/registrations.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Registrations = class extends APIResource {
      static {
        __name(this, "Registrations");
      }
      /**
       * Lists WARP registrations.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const registrationListResponse of client.zeroTrust.devices.registrations.list(
       *   { account_id: 'account_id' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/devices/registrations`, RegistrationListResponsesCursorPagination, { query, ...options });
      }
      /**
       * Deletes a WARP registration.
       *
       * @example
       * ```ts
       * const registration =
       *   await client.zeroTrust.devices.registrations.delete(
       *     'registration_id',
       *     { account_id: 'account_id' },
       *   );
       * ```
       */
      delete(registrationId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/devices/registrations/${registrationId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Deletes a list of WARP registrations.
       *
       * @example
       * ```ts
       * const response =
       *   await client.zeroTrust.devices.registrations.bulkDelete({
       *     account_id: 'account_id',
       *     id: ['string'],
       *   });
       * ```
       */
      bulkDelete(params, options) {
        const { account_id, id } = params;
        return this._client.delete(`/accounts/${account_id}/devices/registrations`, {
          query: { id },
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetches a single WARP registration.
       *
       * @example
       * ```ts
       * const registration =
       *   await client.zeroTrust.devices.registrations.get(
       *     'registration_id',
       *     { account_id: 'account_id' },
       *   );
       * ```
       */
      get(registrationId, params, options) {
        const { account_id, ...query } = params;
        return this._client.get(`/accounts/${account_id}/devices/registrations/${registrationId}`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Revokes a list of WARP registrations.
       *
       * @example
       * ```ts
       * const response =
       *   await client.zeroTrust.devices.registrations.revoke({
       *     account_id: 'account_id',
       *     id: ['string'],
       *   });
       * ```
       */
      revoke(params, options) {
        const { account_id, id } = params;
        return this._client.post(`/accounts/${account_id}/devices/registrations/revoke`, {
          query: { id },
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Unrevokes a list of WARP registrations.
       *
       * @example
       * ```ts
       * const response =
       *   await client.zeroTrust.devices.registrations.unrevoke({
       *     account_id: 'account_id',
       *     id: ['string'],
       *   });
       * ```
       */
      unrevoke(params, options) {
        const { account_id, id } = params;
        return this._client.post(`/accounts/${account_id}/devices/registrations/unrevoke`, {
          query: { id },
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
    RegistrationListResponsesCursorPagination = class extends CursorPagination {
      static {
        __name(this, "RegistrationListResponsesCursorPagination");
      }
    };
    Registrations.RegistrationListResponsesCursorPagination = RegistrationListResponsesCursorPagination;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/devices/revoke.mjs
var Revoke;
var init_revoke = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/devices/revoke.mjs"() {
    init_import_meta_url();
    init_resource();
    Revoke = class extends APIResource {
      static {
        __name(this, "Revoke");
      }
      /**
       * Revokes a list of devices. Not supported when
       * [multi-user mode](https://developers.cloudflare.com/cloudflare-one/connections/connect-devices/warp/deployment/mdm-deployment/windows-multiuser/)
       * is enabled.
       *
       * **Deprecated**: please use POST
       * /accounts/{account_id}/devices/registrations/revoke instead.
       *
       * @deprecated
       */
      create(params, options) {
        const { account_id, body } = params;
        return this._client.post(`/accounts/${account_id}/devices/revoke`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/devices/settings.mjs
var Settings15;
var init_settings15 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/devices/settings.mjs"() {
    init_import_meta_url();
    init_resource();
    Settings15 = class extends APIResource {
      static {
        __name(this, "Settings");
      }
      /**
       * Updates the current device settings for a Zero Trust account.
       *
       * @example
       * ```ts
       * const deviceSettings =
       *   await client.zeroTrust.devices.settings.update({
       *     account_id: '699d98642c564d2e855e9661899b7252',
       *   });
       * ```
       */
      update(params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/devices/settings`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Resets the current device settings for a Zero Trust account.
       *
       * @example
       * ```ts
       * const deviceSettings =
       *   await client.zeroTrust.devices.settings.delete({
       *     account_id: '699d98642c564d2e855e9661899b7252',
       *   });
       * ```
       */
      delete(params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/devices/settings`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Patches the current device settings for a Zero Trust account.
       *
       * @example
       * ```ts
       * const deviceSettings =
       *   await client.zeroTrust.devices.settings.edit({
       *     account_id: '699d98642c564d2e855e9661899b7252',
       *   });
       * ```
       */
      edit(params, options) {
        const { account_id, ...body } = params;
        return this._client.patch(`/accounts/${account_id}/devices/settings`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Describes the current device settings for a Zero Trust account.
       *
       * @example
       * ```ts
       * const deviceSettings =
       *   await client.zeroTrust.devices.settings.get({
       *     account_id: '699d98642c564d2e855e9661899b7252',
       *   });
       * ```
       */
      get(params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/devices/settings`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/devices/unrevoke.mjs
var Unrevoke;
var init_unrevoke = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/devices/unrevoke.mjs"() {
    init_import_meta_url();
    init_resource();
    Unrevoke = class extends APIResource {
      static {
        __name(this, "Unrevoke");
      }
      /**
       * Unrevokes a list of devices. Not supported when
       * [multi-user mode](https://developers.cloudflare.com/cloudflare-one/connections/connect-devices/warp/deployment/mdm-deployment/windows-multiuser/)
       * is enabled.
       *
       * **Deprecated**: please use POST
       * /accounts/{account_id}/devices/registrations/unrevoke instead.
       *
       * @deprecated
       */
      create(params, options) {
        const { account_id, body } = params;
        return this._client.post(`/accounts/${account_id}/devices/unrevoke`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/devices/policies/custom/excludes.mjs
var Excludes;
var init_excludes = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/devices/policies/custom/excludes.mjs"() {
    init_import_meta_url();
    init_resource();
    init_policies5();
    Excludes = class extends APIResource {
      static {
        __name(this, "Excludes");
      }
      /**
       * Sets the list of routes excluded from the WARP client's tunnel for a specific
       * device settings profile.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const splitTunnelExclude of client.zeroTrust.devices.policies.custom.excludes.update(
       *   'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *   {
       *     account_id: '699d98642c564d2e855e9661899b7252',
       *     body: [{ address: '192.0.2.0/24' }],
       *   },
       * )) {
       *   // ...
       * }
       * ```
       */
      update(policyId, params, options) {
        const { account_id, body } = params;
        return this._client.getAPIList(`/accounts/${account_id}/devices/policy/${policyId}/exclude`, SplitTunnelExcludesSinglePage, { body, method: "put", ...options });
      }
      /**
       * Fetches the list of routes excluded from the WARP client's tunnel for a specific
       * device settings profile.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const splitTunnelExclude of client.zeroTrust.devices.policies.custom.excludes.get(
       *   'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *   { account_id: '699d98642c564d2e855e9661899b7252' },
       * )) {
       *   // ...
       * }
       * ```
       */
      get(policyId, params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/devices/policy/${policyId}/exclude`, SplitTunnelExcludesSinglePage, options);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/devices/policies/custom/fallback-domains.mjs
var FallbackDomains;
var init_fallback_domains = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/devices/policies/custom/fallback-domains.mjs"() {
    init_import_meta_url();
    init_resource();
    init_policies5();
    FallbackDomains = class extends APIResource {
      static {
        __name(this, "FallbackDomains");
      }
      /**
       * Sets the list of domains to bypass Gateway DNS resolution. These domains will
       * use the specified local DNS resolver instead. This will only apply to the
       * specified device settings profile.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const fallbackDomain of client.zeroTrust.devices.policies.custom.fallbackDomains.update(
       *   'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *   {
       *     account_id: '699d98642c564d2e855e9661899b7252',
       *     domains: [{ suffix: 'example.com' }],
       *   },
       * )) {
       *   // ...
       * }
       * ```
       */
      update(policyId, params, options) {
        const { account_id, domains } = params;
        return this._client.getAPIList(`/accounts/${account_id}/devices/policy/${policyId}/fallback_domains`, FallbackDomainsSinglePage, { body: domains, method: "put", ...options });
      }
      /**
       * Fetches the list of domains to bypass Gateway DNS resolution from a specified
       * device settings profile. These domains will use the specified local DNS resolver
       * instead.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const fallbackDomain of client.zeroTrust.devices.policies.custom.fallbackDomains.get(
       *   'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *   { account_id: '699d98642c564d2e855e9661899b7252' },
       * )) {
       *   // ...
       * }
       * ```
       */
      get(policyId, params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/devices/policy/${policyId}/fallback_domains`, FallbackDomainsSinglePage, options);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/devices/policies/custom/includes.mjs
var Includes;
var init_includes = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/devices/policies/custom/includes.mjs"() {
    init_import_meta_url();
    init_resource();
    init_policies5();
    Includes = class extends APIResource {
      static {
        __name(this, "Includes");
      }
      /**
       * Sets the list of routes included in the WARP client's tunnel for a specific
       * device settings profile.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const splitTunnelInclude of client.zeroTrust.devices.policies.custom.includes.update(
       *   'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *   {
       *     account_id: '699d98642c564d2e855e9661899b7252',
       *     body: [{ address: '192.0.2.0/24' }],
       *   },
       * )) {
       *   // ...
       * }
       * ```
       */
      update(policyId, params, options) {
        const { account_id, body } = params;
        return this._client.getAPIList(`/accounts/${account_id}/devices/policy/${policyId}/include`, SplitTunnelIncludesSinglePage, { body, method: "put", ...options });
      }
      /**
       * Fetches the list of routes included in the WARP client's tunnel for a specific
       * device settings profile.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const splitTunnelInclude of client.zeroTrust.devices.policies.custom.includes.get(
       *   'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *   { account_id: '699d98642c564d2e855e9661899b7252' },
       * )) {
       *   // ...
       * }
       * ```
       */
      get(policyId, params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/devices/policy/${policyId}/include`, SplitTunnelIncludesSinglePage, options);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/devices/policies/custom/custom.mjs
var Custom2;
var init_custom2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/devices/policies/custom/custom.mjs"() {
    init_import_meta_url();
    init_resource();
    init_policies5();
    init_excludes();
    init_excludes();
    init_fallback_domains();
    init_fallback_domains();
    init_includes();
    init_includes();
    Custom2 = class extends APIResource {
      static {
        __name(this, "Custom");
      }
      constructor() {
        super(...arguments);
        this.excludes = new Excludes(this._client);
        this.includes = new Includes(this._client);
        this.fallbackDomains = new FallbackDomains(this._client);
      }
      /**
       * Creates a device settings profile to be applied to certain devices matching the
       * criteria.
       *
       * @example
       * ```ts
       * const settingsPolicy =
       *   await client.zeroTrust.devices.policies.custom.create({
       *     account_id: '699d98642c564d2e855e9661899b7252',
       *     match: 'identity.email == "test@cloudflare.com"',
       *     name: 'Allow Developers',
       *     precedence: 100,
       *   });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/devices/policy`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetches a list of the device settings profiles for an account.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const settingsPolicy of client.zeroTrust.devices.policies.custom.list(
       *   { account_id: '699d98642c564d2e855e9661899b7252' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/devices/policies`, SettingsPoliciesSinglePage, options);
      }
      /**
       * Deletes a device settings profile and fetches a list of the remaining profiles
       * for an account.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const settingsPolicy of client.zeroTrust.devices.policies.custom.delete(
       *   'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *   { account_id: '699d98642c564d2e855e9661899b7252' },
       * )) {
       *   // ...
       * }
       * ```
       */
      delete(policyId, params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/devices/policy/${policyId}`, SettingsPoliciesSinglePage, { method: "delete", ...options });
      }
      /**
       * Updates a configured device settings profile.
       *
       * @example
       * ```ts
       * const settingsPolicy =
       *   await client.zeroTrust.devices.policies.custom.edit(
       *     'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *     { account_id: '699d98642c564d2e855e9661899b7252' },
       *   );
       * ```
       */
      edit(policyId, params, options) {
        const { account_id, ...body } = params;
        return this._client.patch(`/accounts/${account_id}/devices/policy/${policyId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetches a device settings profile by ID.
       *
       * @example
       * ```ts
       * const settingsPolicy =
       *   await client.zeroTrust.devices.policies.custom.get(
       *     'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *     { account_id: '699d98642c564d2e855e9661899b7252' },
       *   );
       * ```
       */
      get(policyId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/devices/policy/${policyId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    Custom2.Excludes = Excludes;
    Custom2.Includes = Includes;
    Custom2.FallbackDomains = FallbackDomains;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/devices/policies/default/certificates.mjs
var Certificates4;
var init_certificates4 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/devices/policies/default/certificates.mjs"() {
    init_import_meta_url();
    init_resource();
    Certificates4 = class extends APIResource {
      static {
        __name(this, "Certificates");
      }
      /**
       * Enable Zero Trust Clients to provision a certificate, containing a x509 subject,
       * and referenced by Access device posture policies when the client visits MTLS
       * protected domains. This facilitates device posture without a WARP session.
       *
       * @example
       * ```ts
       * const devicePolicyCertificates =
       *   await client.zeroTrust.devices.policies.default.certificates.edit(
       *     {
       *       zone_id: '699d98642c564d2e855e9661899b7252',
       *       enabled: true,
       *     },
       *   );
       * ```
       */
      edit(params, options) {
        const { zone_id, ...body } = params;
        return this._client.patch(`/zones/${zone_id}/devices/policy/certificates`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetches device certificate provisioning.
       *
       * @example
       * ```ts
       * const devicePolicyCertificates =
       *   await client.zeroTrust.devices.policies.default.certificates.get(
       *     { zone_id: '699d98642c564d2e855e9661899b7252' },
       *   );
       * ```
       */
      get(params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/devices/policy/certificates`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/devices/policies/default/excludes.mjs
var Excludes2;
var init_excludes2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/devices/policies/default/excludes.mjs"() {
    init_import_meta_url();
    init_resource();
    init_policies5();
    Excludes2 = class extends APIResource {
      static {
        __name(this, "Excludes");
      }
      /**
       * Sets the list of routes excluded from the WARP client's tunnel.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const splitTunnelExclude of client.zeroTrust.devices.policies.default.excludes.update(
       *   {
       *     account_id: '699d98642c564d2e855e9661899b7252',
       *     body: [{ address: '192.0.2.0/24' }],
       *   },
       * )) {
       *   // ...
       * }
       * ```
       */
      update(params, options) {
        const { account_id, body } = params;
        return this._client.getAPIList(`/accounts/${account_id}/devices/policy/exclude`, SplitTunnelExcludesSinglePage, { body, method: "put", ...options });
      }
      /**
       * Fetches the list of routes excluded from the WARP client's tunnel.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const splitTunnelExclude of client.zeroTrust.devices.policies.default.excludes.get(
       *   { account_id: '699d98642c564d2e855e9661899b7252' },
       * )) {
       *   // ...
       * }
       * ```
       */
      get(params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/devices/policy/exclude`, SplitTunnelExcludesSinglePage, options);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/devices/policies/default/fallback-domains.mjs
var FallbackDomains2;
var init_fallback_domains2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/devices/policies/default/fallback-domains.mjs"() {
    init_import_meta_url();
    init_resource();
    init_policies5();
    FallbackDomains2 = class extends APIResource {
      static {
        __name(this, "FallbackDomains");
      }
      /**
       * Sets the list of domains to bypass Gateway DNS resolution. These domains will
       * use the specified local DNS resolver instead.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const fallbackDomain of client.zeroTrust.devices.policies.default.fallbackDomains.update(
       *   {
       *     account_id: '699d98642c564d2e855e9661899b7252',
       *     domains: [{ suffix: 'example.com' }],
       *   },
       * )) {
       *   // ...
       * }
       * ```
       */
      update(params, options) {
        const { account_id, domains } = params;
        return this._client.getAPIList(`/accounts/${account_id}/devices/policy/fallback_domains`, FallbackDomainsSinglePage, { body: domains, method: "put", ...options });
      }
      /**
       * Fetches a list of domains to bypass Gateway DNS resolution. These domains will
       * use the specified local DNS resolver instead.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const fallbackDomain of client.zeroTrust.devices.policies.default.fallbackDomains.get(
       *   { account_id: '699d98642c564d2e855e9661899b7252' },
       * )) {
       *   // ...
       * }
       * ```
       */
      get(params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/devices/policy/fallback_domains`, FallbackDomainsSinglePage, options);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/devices/policies/default/includes.mjs
var Includes2;
var init_includes2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/devices/policies/default/includes.mjs"() {
    init_import_meta_url();
    init_resource();
    init_policies5();
    Includes2 = class extends APIResource {
      static {
        __name(this, "Includes");
      }
      /**
       * Sets the list of routes included in the WARP client's tunnel.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const splitTunnelInclude of client.zeroTrust.devices.policies.default.includes.update(
       *   {
       *     account_id: '699d98642c564d2e855e9661899b7252',
       *     body: [{ address: '192.0.2.0/24' }],
       *   },
       * )) {
       *   // ...
       * }
       * ```
       */
      update(params, options) {
        const { account_id, body } = params;
        return this._client.getAPIList(`/accounts/${account_id}/devices/policy/include`, SplitTunnelIncludesSinglePage, { body, method: "put", ...options });
      }
      /**
       * Fetches the list of routes included in the WARP client's tunnel.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const splitTunnelInclude of client.zeroTrust.devices.policies.default.includes.get(
       *   { account_id: '699d98642c564d2e855e9661899b7252' },
       * )) {
       *   // ...
       * }
       * ```
       */
      get(params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/devices/policy/include`, SplitTunnelIncludesSinglePage, options);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/devices/policies/default/default.mjs
var Default2;
var init_default2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/devices/policies/default/default.mjs"() {
    init_import_meta_url();
    init_resource();
    init_certificates4();
    init_certificates4();
    init_excludes2();
    init_excludes2();
    init_fallback_domains2();
    init_fallback_domains2();
    init_includes2();
    init_includes2();
    Default2 = class extends APIResource {
      static {
        __name(this, "Default");
      }
      constructor() {
        super(...arguments);
        this.excludes = new Excludes2(this._client);
        this.includes = new Includes2(this._client);
        this.fallbackDomains = new FallbackDomains2(this._client);
        this.certificates = new Certificates4(this._client);
      }
      /**
       * Updates the default device settings profile for an account.
       *
       * @example
       * ```ts
       * const response =
       *   await client.zeroTrust.devices.policies.default.edit({
       *     account_id: '699d98642c564d2e855e9661899b7252',
       *   });
       * ```
       */
      edit(params, options) {
        const { account_id, ...body } = params;
        return this._client.patch(`/accounts/${account_id}/devices/policy`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetches the default device settings profile for an account.
       *
       * @example
       * ```ts
       * const _default =
       *   await client.zeroTrust.devices.policies.default.get({
       *     account_id: '699d98642c564d2e855e9661899b7252',
       *   });
       * ```
       */
      get(params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/devices/policy`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    Default2.Excludes = Excludes2;
    Default2.Includes = Includes2;
    Default2.FallbackDomains = FallbackDomains2;
    Default2.Certificates = Certificates4;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/devices/policies/policies.mjs
var Policies5, SplitTunnelExcludesSinglePage, SplitTunnelIncludesSinglePage, FallbackDomainsSinglePage, SettingsPoliciesSinglePage;
var init_policies5 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/devices/policies/policies.mjs"() {
    init_import_meta_url();
    init_resource();
    init_custom2();
    init_custom2();
    init_default2();
    init_default2();
    init_pagination();
    Policies5 = class extends APIResource {
      static {
        __name(this, "Policies");
      }
      constructor() {
        super(...arguments);
        this.default = new Default2(this._client);
        this.custom = new Custom2(this._client);
      }
    };
    SplitTunnelExcludesSinglePage = class extends SinglePage {
      static {
        __name(this, "SplitTunnelExcludesSinglePage");
      }
    };
    SplitTunnelIncludesSinglePage = class extends SinglePage {
      static {
        __name(this, "SplitTunnelIncludesSinglePage");
      }
    };
    FallbackDomainsSinglePage = class extends SinglePage {
      static {
        __name(this, "FallbackDomainsSinglePage");
      }
    };
    SettingsPoliciesSinglePage = class extends SinglePage {
      static {
        __name(this, "SettingsPoliciesSinglePage");
      }
    };
    Policies5.Default = Default2;
    Policies5.Custom = Custom2;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/devices/posture/integrations.mjs
var Integrations, IntegrationsSinglePage;
var init_integrations = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/devices/posture/integrations.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Integrations = class extends APIResource {
      static {
        __name(this, "Integrations");
      }
      /**
       * Create a new device posture integration.
       *
       * @example
       * ```ts
       * const integration =
       *   await client.zeroTrust.devices.posture.integrations.create(
       *     {
       *       account_id: '699d98642c564d2e855e9661899b7252',
       *       config: {
       *         api_url: 'https://as123.awmdm.com/API',
       *         auth_url:
       *           'https://na.uemauth.vmwservices.com/connect/token',
       *         client_id: 'example client id',
       *         client_secret: 'example client secret',
       *       },
       *       interval: '10m',
       *       name: 'My Workspace One Integration',
       *       type: 'workspace_one',
       *     },
       *   );
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/devices/posture/integration`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetches the list of device posture integrations for an account.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const integration of client.zeroTrust.devices.posture.integrations.list(
       *   { account_id: '699d98642c564d2e855e9661899b7252' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/devices/posture/integration`, IntegrationsSinglePage, options);
      }
      /**
       * Delete a configured device posture integration.
       *
       * @example
       * ```ts
       * const integration =
       *   await client.zeroTrust.devices.posture.integrations.delete(
       *     'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *     { account_id: '699d98642c564d2e855e9661899b7252' },
       *   );
       * ```
       */
      delete(integrationId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/devices/posture/integration/${integrationId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Updates a configured device posture integration.
       *
       * @example
       * ```ts
       * const integration =
       *   await client.zeroTrust.devices.posture.integrations.edit(
       *     'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *     { account_id: '699d98642c564d2e855e9661899b7252' },
       *   );
       * ```
       */
      edit(integrationId, params, options) {
        const { account_id, ...body } = params;
        return this._client.patch(`/accounts/${account_id}/devices/posture/integration/${integrationId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetches details for a single device posture integration.
       *
       * @example
       * ```ts
       * const integration =
       *   await client.zeroTrust.devices.posture.integrations.get(
       *     'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *     { account_id: '699d98642c564d2e855e9661899b7252' },
       *   );
       * ```
       */
      get(integrationId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/devices/posture/integration/${integrationId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    IntegrationsSinglePage = class extends SinglePage {
      static {
        __name(this, "IntegrationsSinglePage");
      }
    };
    Integrations.IntegrationsSinglePage = IntegrationsSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/devices/posture/posture.mjs
var Posture, DevicePostureRulesSinglePage;
var init_posture = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/devices/posture/posture.mjs"() {
    init_import_meta_url();
    init_resource();
    init_integrations();
    init_integrations();
    init_pagination();
    Posture = class extends APIResource {
      static {
        __name(this, "Posture");
      }
      constructor() {
        super(...arguments);
        this.integrations = new Integrations(this._client);
      }
      /**
       * Creates a new device posture rule.
       *
       * @example
       * ```ts
       * const devicePostureRule =
       *   await client.zeroTrust.devices.posture.create({
       *     account_id: '699d98642c564d2e855e9661899b7252',
       *     name: 'Admin Serial Numbers',
       *     type: 'file',
       *   });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/devices/posture`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Updates a device posture rule.
       *
       * @example
       * ```ts
       * const devicePostureRule =
       *   await client.zeroTrust.devices.posture.update(
       *     'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *     {
       *       account_id: '699d98642c564d2e855e9661899b7252',
       *       name: 'Admin Serial Numbers',
       *       type: 'file',
       *     },
       *   );
       * ```
       */
      update(ruleId, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/devices/posture/${ruleId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetches device posture rules for a Zero Trust account.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const devicePostureRule of client.zeroTrust.devices.posture.list(
       *   { account_id: '699d98642c564d2e855e9661899b7252' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/devices/posture`, DevicePostureRulesSinglePage, options);
      }
      /**
       * Deletes a device posture rule.
       *
       * @example
       * ```ts
       * const posture =
       *   await client.zeroTrust.devices.posture.delete(
       *     'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *     { account_id: '699d98642c564d2e855e9661899b7252' },
       *   );
       * ```
       */
      delete(ruleId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/devices/posture/${ruleId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetches a single device posture rule.
       *
       * @example
       * ```ts
       * const devicePostureRule =
       *   await client.zeroTrust.devices.posture.get(
       *     'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *     { account_id: '699d98642c564d2e855e9661899b7252' },
       *   );
       * ```
       */
      get(ruleId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/devices/posture/${ruleId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    DevicePostureRulesSinglePage = class extends SinglePage {
      static {
        __name(this, "DevicePostureRulesSinglePage");
      }
    };
    Posture.DevicePostureRulesSinglePage = DevicePostureRulesSinglePage;
    Posture.Integrations = Integrations;
    Posture.IntegrationsSinglePage = IntegrationsSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/devices/resilience/global-warp-override.mjs
var GlobalWARPOverride;
var init_global_warp_override = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/devices/resilience/global-warp-override.mjs"() {
    init_import_meta_url();
    init_resource();
    GlobalWARPOverride = class extends APIResource {
      static {
        __name(this, "GlobalWARPOverride");
      }
      /**
       * Sets the Global WARP override state.
       *
       * @example
       * ```ts
       * const globalWARPOverride =
       *   await client.zeroTrust.devices.resilience.globalWARPOverride.create(
       *     {
       *       account_id: '699d98642c564d2e855e9661899b7252',
       *       disconnect: false,
       *     },
       *   );
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/devices/resilience/disconnect`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetch the Global WARP override state.
       *
       * @example
       * ```ts
       * const globalWARPOverride =
       *   await client.zeroTrust.devices.resilience.globalWARPOverride.get(
       *     { account_id: '699d98642c564d2e855e9661899b7252' },
       *   );
       * ```
       */
      get(params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/devices/resilience/disconnect`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/devices/resilience/resilience.mjs
var Resilience;
var init_resilience = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/devices/resilience/resilience.mjs"() {
    init_import_meta_url();
    init_resource();
    init_global_warp_override();
    init_global_warp_override();
    Resilience = class extends APIResource {
      static {
        __name(this, "Resilience");
      }
      constructor() {
        super(...arguments);
        this.globalWARPOverride = new GlobalWARPOverride(this._client);
      }
    };
    Resilience.GlobalWARPOverride = GlobalWARPOverride;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/devices/devices.mjs
var Devices2, DevicesSinglePage;
var init_devices2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/devices/devices.mjs"() {
    init_import_meta_url();
    init_resource();
    init_devices();
    init_devices();
    init_dex_tests();
    init_dex_tests();
    init_fleet_status();
    init_fleet_status();
    init_networks();
    init_networks();
    init_override_codes();
    init_override_codes();
    init_registrations();
    init_registrations();
    init_revoke();
    init_revoke();
    init_settings15();
    init_settings15();
    init_unrevoke();
    init_unrevoke();
    init_policies5();
    init_policies5();
    init_posture();
    init_posture();
    init_resilience();
    init_resilience();
    init_pagination();
    Devices2 = class extends APIResource {
      static {
        __name(this, "Devices");
      }
      constructor() {
        super(...arguments);
        this.devices = new Devices(this._client);
        this.resilience = new Resilience(this._client);
        this.registrations = new Registrations(this._client);
        this.dexTests = new DEXTests(this._client);
        this.networks = new Networks(this._client);
        this.fleetStatus = new FleetStatus(this._client);
        this.policies = new Policies5(this._client);
        this.posture = new Posture(this._client);
        this.revoke = new Revoke(this._client);
        this.settings = new Settings15(this._client);
        this.unrevoke = new Unrevoke(this._client);
        this.overrideCodes = new OverrideCodes(this._client);
      }
      /**
       * List WARP devices. Not supported when
       * [multi-user mode](https://developers.cloudflare.com/cloudflare-one/connections/connect-devices/warp/deployment/mdm-deployment/windows-multiuser/)
       * is enabled for the account.
       *
       * **Deprecated**: please use one of the following endpoints instead:
       *
       * - GET /accounts/{account_id}/devices/physical-devices
       * - GET /accounts/{account_id}/devices/registrations
       *
       * @deprecated
       */
      list(params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/devices`, DevicesSinglePage, options);
      }
      /**
       * Fetches a single WARP device. Not supported when
       * [multi-user mode](https://developers.cloudflare.com/cloudflare-one/connections/connect-devices/warp/deployment/mdm-deployment/windows-multiuser/)
       * is enabled for the account.
       *
       * **Deprecated**: please use one of the following endpoints instead:
       *
       * - GET /accounts/{account_id}/devices/physical-devices/{device_id}
       * - GET /accounts/{account_id}/devices/registrations/{registration_id}
       *
       * @deprecated
       */
      get(deviceId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/devices/${deviceId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    DevicesSinglePage = class extends SinglePage {
      static {
        __name(this, "DevicesSinglePage");
      }
    };
    Devices2.DevicesSinglePage = DevicesSinglePage;
    Devices2.Devices = Devices;
    Devices2.DeviceListResponsesCursorPagination = DeviceListResponsesCursorPagination;
    Devices2.Resilience = Resilience;
    Devices2.Registrations = Registrations;
    Devices2.RegistrationListResponsesCursorPagination = RegistrationListResponsesCursorPagination;
    Devices2.DEXTests = DEXTests;
    Devices2.DEXTestListResponsesSinglePage = DEXTestListResponsesSinglePage;
    Devices2.Networks = Networks;
    Devices2.DeviceNetworksSinglePage = DeviceNetworksSinglePage;
    Devices2.FleetStatus = FleetStatus;
    Devices2.Policies = Policies5;
    Devices2.Posture = Posture;
    Devices2.DevicePostureRulesSinglePage = DevicePostureRulesSinglePage;
    Devices2.Revoke = Revoke;
    Devices2.Settings = Settings15;
    Devices2.Unrevoke = Unrevoke;
    Devices2.OverrideCodes = OverrideCodes;
    Devices2.OverrideCodeListResponsesSinglePage = OverrideCodeListResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/dex/colos.mjs
var Colos, ColoListResponsesSinglePage;
var init_colos = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/dex/colos.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Colos = class extends APIResource {
      static {
        __name(this, "Colos");
      }
      /**
       * List Cloudflare colos that account's devices were connected to during a time
       * period, sorted by usage starting from the most used colo. Colos without traffic
       * are also returned and sorted alphabetically.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const coloListResponse of client.zeroTrust.dex.colos.list(
       *   {
       *     account_id: '01a7362d577a6c3019a474fd6f485823',
       *     from: '2023-08-20T20:45:00Z',
       *     to: '2023-08-24T20:45:00Z',
       *   },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/dex/colos`, ColoListResponsesSinglePage, {
          query,
          ...options
        });
      }
    };
    ColoListResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "ColoListResponsesSinglePage");
      }
    };
    Colos.ColoListResponsesSinglePage = ColoListResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/dex/traceroute-tests.mjs
var TracerouteTests;
var init_traceroute_tests = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/dex/traceroute-tests.mjs"() {
    init_import_meta_url();
    init_resource();
    TracerouteTests = class extends APIResource {
      static {
        __name(this, "TracerouteTests");
      }
      /**
       * Get test details and aggregate performance metrics for an traceroute test for a
       * given time period between 1 hour and 7 days.
       *
       * @example
       * ```ts
       * const traceroute =
       *   await client.zeroTrust.dex.tracerouteTests.get(
       *     'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *     {
       *       account_id: '01a7362d577a6c3019a474fd6f485823',
       *       from: '1689520412000',
       *       interval: 'minute',
       *       to: '1689606812000',
       *     },
       *   );
       * ```
       */
      get(testId, params, options) {
        const { account_id, ...query } = params;
        return this._client.get(`/accounts/${account_id}/dex/traceroute-tests/${testId}`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get a breakdown of metrics by hop for individual traceroute test runs
       *
       * @example
       * ```ts
       * const networkPathResponse =
       *   await client.zeroTrust.dex.tracerouteTests.networkPath(
       *     'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *     {
       *       account_id: '01a7362d577a6c3019a474fd6f485823',
       *       deviceId: 'deviceId',
       *       from: '1689520412000',
       *       interval: 'minute',
       *       to: '1689606812000',
       *     },
       *   );
       * ```
       */
      networkPath(testId, params, options) {
        const { account_id, ...query } = params;
        return this._client.get(`/accounts/${account_id}/dex/traceroute-tests/${testId}/network-path`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get percentiles for a traceroute test for a given time period between 1 hour and
       * 7 days.
       *
       * @example
       * ```ts
       * const response =
       *   await client.zeroTrust.dex.tracerouteTests.percentiles(
       *     'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *     {
       *       account_id: '01a7362d577a6c3019a474fd6f485823',
       *       from: '2023-09-20T17:00:00Z',
       *       to: '2023-09-20T17:00:00Z',
       *     },
       *   );
       * ```
       */
      percentiles(testId, params, options) {
        const { account_id, ...query } = params;
        return this._client.get(`/accounts/${account_id}/dex/traceroute-tests/${testId}/percentiles`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/dex/warp-change-events.mjs
var WARPChangeEvents;
var init_warp_change_events = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/dex/warp-change-events.mjs"() {
    init_import_meta_url();
    init_resource();
    WARPChangeEvents = class extends APIResource {
      static {
        __name(this, "WARPChangeEvents");
      }
      /**
       * List WARP configuration and enablement toggle change events by device.
       *
       * @example
       * ```ts
       * const warpChangeEvents =
       *   await client.zeroTrust.dex.warpChangeEvents.get({
       *     account_id: '01a7362d577a6c3019a474fd6f485823',
       *     from: '2023-09-20T17:00:00Z',
       *     page: 1,
       *     per_page: 1,
       *     to: '2023-09-20T17:00:00Z',
       *   });
       * ```
       */
      get(params, options) {
        const { account_id, ...query } = params;
        return this._client.get(`/accounts/${account_id}/dex/warp-change-events`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/dex/commands/devices.mjs
var Devices3, DeviceListResponsesV4PagePagination;
var init_devices3 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/dex/commands/devices.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Devices3 = class extends APIResource {
      static {
        __name(this, "Devices");
      }
      /**
       * List devices with WARP client support for remote captures which have been
       * connected in the last 1 hour.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const deviceListResponse of client.zeroTrust.dex.commands.devices.list(
       *   {
       *     account_id: '01a7362d577a6c3019a474fd6f485823',
       *     page: 1,
       *     per_page: 1,
       *   },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/dex/commands/devices`, DeviceListResponsesV4PagePagination, { query, ...options });
      }
    };
    DeviceListResponsesV4PagePagination = class extends V4PagePagination {
      static {
        __name(this, "DeviceListResponsesV4PagePagination");
      }
    };
    Devices3.DeviceListResponsesV4PagePagination = DeviceListResponsesV4PagePagination;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/dex/commands/downloads.mjs
var Downloads3;
var init_downloads3 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/dex/commands/downloads.mjs"() {
    init_import_meta_url();
    init_resource();
    Downloads3 = class extends APIResource {
      static {
        __name(this, "Downloads");
      }
      /**
       * Downloads artifacts for an executed command. Bulk downloads are not supported
       *
       * @example
       * ```ts
       * const download =
       *   await client.zeroTrust.dex.commands.downloads.get(
       *     '5758fefe-ae7e-4538-a39b-1fef6abcb909',
       *     'filename',
       *     { account_id: '01a7362d577a6c3019a474fd6f485823' },
       *   );
       *
       * const content = await download.blob();
       * console.log(content);
       * ```
       */
      get(commandId, filename, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/dex/commands/${commandId}/downloads/${filename}`, {
          ...options,
          headers: { Accept: "application/zip", ...options?.headers },
          __binaryResponse: true
        });
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/dex/commands/quota.mjs
var Quota3;
var init_quota3 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/dex/commands/quota.mjs"() {
    init_import_meta_url();
    init_resource();
    Quota3 = class extends APIResource {
      static {
        __name(this, "Quota");
      }
      /**
       * Retrieves the current quota usage and limits for device commands within a
       * specific account, including the time when the quota will reset
       *
       * @example
       * ```ts
       * const quota = await client.zeroTrust.dex.commands.quota.get(
       *   { account_id: '01a7362d577a6c3019a474fd6f485823' },
       * );
       * ```
       */
      get(params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/dex/commands/quota`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/dex/commands/commands.mjs
var Commands, CommandListResponsesV4PagePagination;
var init_commands = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/dex/commands/commands.mjs"() {
    init_import_meta_url();
    init_resource();
    init_devices3();
    init_devices3();
    init_downloads3();
    init_downloads3();
    init_quota3();
    init_quota3();
    init_pagination();
    Commands = class extends APIResource {
      static {
        __name(this, "Commands");
      }
      constructor() {
        super(...arguments);
        this.devices = new Devices3(this._client);
        this.downloads = new Downloads3(this._client);
        this.quota = new Quota3(this._client);
      }
      /**
       * Initiate commands for up to 10 devices per account
       *
       * @example
       * ```ts
       * const command = await client.zeroTrust.dex.commands.create({
       *   account_id: '01a7362d577a6c3019a474fd6f485823',
       *   commands: [
       *     {
       *       command_type: 'pcap',
       *       device_id: 'device_id',
       *       user_email: 'user_email',
       *     },
       *   ],
       * });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/dex/commands`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Retrieves a paginated list of commands issued to devices under the specified
       * account, optionally filtered by time range, device, or other parameters
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const commandListResponse of client.zeroTrust.dex.commands.list(
       *   {
       *     account_id: '01a7362d577a6c3019a474fd6f485823',
       *     page: 1,
       *     per_page: 50,
       *   },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/dex/commands`, CommandListResponsesV4PagePagination, { query, ...options });
      }
    };
    CommandListResponsesV4PagePagination = class extends V4PagePagination {
      static {
        __name(this, "CommandListResponsesV4PagePagination");
      }
    };
    Commands.CommandListResponsesV4PagePagination = CommandListResponsesV4PagePagination;
    Commands.Devices = Devices3;
    Commands.DeviceListResponsesV4PagePagination = DeviceListResponsesV4PagePagination;
    Commands.Downloads = Downloads3;
    Commands.Quota = Quota3;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/dex/fleet-status/devices.mjs
var Devices4, DeviceListResponsesV4PagePaginationArray;
var init_devices4 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/dex/fleet-status/devices.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Devices4 = class extends APIResource {
      static {
        __name(this, "Devices");
      }
      /**
       * List details for devices using WARP
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const deviceListResponse of client.zeroTrust.dex.fleetStatus.devices.list(
       *   {
       *     account_id: '01a7362d577a6c3019a474fd6f485823',
       *     from: '2023-10-11T00:00:00Z',
       *     page: 1,
       *     per_page: 10,
       *     to: '2023-10-11T00:00:00Z',
       *   },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/dex/fleet-status/devices`, DeviceListResponsesV4PagePaginationArray, { query, ...options });
      }
    };
    DeviceListResponsesV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "DeviceListResponsesV4PagePaginationArray");
      }
    };
    Devices4.DeviceListResponsesV4PagePaginationArray = DeviceListResponsesV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/dex/fleet-status/fleet-status.mjs
var FleetStatus2;
var init_fleet_status2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/dex/fleet-status/fleet-status.mjs"() {
    init_import_meta_url();
    init_resource();
    init_devices4();
    init_devices4();
    FleetStatus2 = class extends APIResource {
      static {
        __name(this, "FleetStatus");
      }
      constructor() {
        super(...arguments);
        this.devices = new Devices4(this._client);
      }
      /**
       * List details for live (up to 60 minutes) devices using WARP
       *
       * @example
       * ```ts
       * const response =
       *   await client.zeroTrust.dex.fleetStatus.live({
       *     account_id: '01a7362d577a6c3019a474fd6f485823',
       *     since_minutes: 10,
       *   });
       * ```
       */
      live(params, options) {
        const { account_id, ...query } = params;
        return this._client.get(`/accounts/${account_id}/dex/fleet-status/live`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List details for devices using WARP, up to 7 days
       *
       * @example
       * ```ts
       * await client.zeroTrust.dex.fleetStatus.overTime({
       *   account_id: '01a7362d577a6c3019a474fd6f485823',
       *   from: '2023-10-11T00:00:00Z',
       *   to: '2023-10-11T00:00:00Z',
       * });
       * ```
       */
      overTime(params, options) {
        const { account_id, ...query } = params;
        return this._client.get(`/accounts/${account_id}/dex/fleet-status/over-time`, {
          query,
          ...options,
          headers: { Accept: "*/*", ...options?.headers }
        });
      }
    };
    FleetStatus2.Devices = Devices4;
    FleetStatus2.DeviceListResponsesV4PagePaginationArray = DeviceListResponsesV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/dex/http-tests/percentiles.mjs
var Percentiles;
var init_percentiles = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/dex/http-tests/percentiles.mjs"() {
    init_import_meta_url();
    init_resource();
    Percentiles = class extends APIResource {
      static {
        __name(this, "Percentiles");
      }
      /**
       * Get percentiles for an http test for a given time period between 1 hour and 7
       * days.
       *
       * @example
       * ```ts
       * const httpDetailsPercentiles =
       *   await client.zeroTrust.dex.httpTests.percentiles.get(
       *     'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *     {
       *       account_id: '01a7362d577a6c3019a474fd6f485823',
       *       from: '2023-09-20T17:00:00Z',
       *       to: '2023-09-20T17:00:00Z',
       *     },
       *   );
       * ```
       */
      get(testId, params, options) {
        const { account_id, ...query } = params;
        return this._client.get(`/accounts/${account_id}/dex/http-tests/${testId}/percentiles`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/dex/http-tests/http-tests.mjs
var HTTPTests;
var init_http_tests = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/dex/http-tests/http-tests.mjs"() {
    init_import_meta_url();
    init_resource();
    init_percentiles();
    init_percentiles();
    HTTPTests = class extends APIResource {
      static {
        __name(this, "HTTPTests");
      }
      constructor() {
        super(...arguments);
        this.percentiles = new Percentiles(this._client);
      }
      /**
       * Get test details and aggregate performance metrics for an http test for a given
       * time period between 1 hour and 7 days.
       *
       * @example
       * ```ts
       * const httpDetails =
       *   await client.zeroTrust.dex.httpTests.get(
       *     'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *     {
       *       account_id: '01a7362d577a6c3019a474fd6f485823',
       *       from: '1689520412000',
       *       interval: 'minute',
       *       to: '1689606812000',
       *     },
       *   );
       * ```
       */
      get(testId, params, options) {
        const { account_id, ...query } = params;
        return this._client.get(`/accounts/${account_id}/dex/http-tests/${testId}`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
    HTTPTests.Percentiles = Percentiles;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/dex/tests/unique-devices.mjs
var UniqueDevices;
var init_unique_devices = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/dex/tests/unique-devices.mjs"() {
    init_import_meta_url();
    init_resource();
    UniqueDevices = class extends APIResource {
      static {
        __name(this, "UniqueDevices");
      }
      /**
       * Returns unique count of devices that have run synthetic application monitoring
       * tests in the past 7 days.
       *
       * @example
       * ```ts
       * const uniqueDevices =
       *   await client.zeroTrust.dex.tests.uniqueDevices.list({
       *     account_id: '01a7362d577a6c3019a474fd6f485823',
       *   });
       * ```
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.get(`/accounts/${account_id}/dex/tests/unique-devices`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/dex/tests/tests.mjs
var Tests2, TestsV4PagePagination;
var init_tests2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/dex/tests/tests.mjs"() {
    init_import_meta_url();
    init_resource();
    init_unique_devices();
    init_pagination();
    Tests2 = class extends APIResource {
      static {
        __name(this, "Tests");
      }
      constructor() {
        super(...arguments);
        this.uniqueDevices = new UniqueDevices(this._client);
      }
      /**
       * List DEX tests with overview metrics
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const tests of client.zeroTrust.dex.tests.list({
       *   account_id: '01a7362d577a6c3019a474fd6f485823',
       * })) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/dex/tests/overview`, TestsV4PagePagination, {
          query,
          ...options
        });
      }
    };
    TestsV4PagePagination = class extends V4PagePagination {
      static {
        __name(this, "TestsV4PagePagination");
      }
    };
    Tests2.TestsV4PagePagination = TestsV4PagePagination;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/dex/traceroute-test-results/network-path.mjs
var NetworkPath;
var init_network_path = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/dex/traceroute-test-results/network-path.mjs"() {
    init_import_meta_url();
    init_resource();
    NetworkPath = class extends APIResource {
      static {
        __name(this, "NetworkPath");
      }
      /**
       * Get a breakdown of hops and performance metrics for a specific traceroute test
       * run
       *
       * @example
       * ```ts
       * const networkPath =
       *   await client.zeroTrust.dex.tracerouteTestResults.networkPath.get(
       *     'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *     { account_id: '01a7362d577a6c3019a474fd6f485823' },
       *   );
       * ```
       */
      get(testResultId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/dex/traceroute-test-results/${testResultId}/network-path`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/dex/traceroute-test-results/traceroute-test-results.mjs
var TracerouteTestResults;
var init_traceroute_test_results = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/dex/traceroute-test-results/traceroute-test-results.mjs"() {
    init_import_meta_url();
    init_resource();
    init_network_path();
    init_network_path();
    TracerouteTestResults = class extends APIResource {
      static {
        __name(this, "TracerouteTestResults");
      }
      constructor() {
        super(...arguments);
        this.networkPath = new NetworkPath(this._client);
      }
    };
    TracerouteTestResults.NetworkPath = NetworkPath;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/dex/dex.mjs
var DEX;
var init_dex = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/dex/dex.mjs"() {
    init_import_meta_url();
    init_resource();
    init_colos();
    init_colos();
    init_traceroute_tests();
    init_traceroute_tests();
    init_warp_change_events();
    init_warp_change_events();
    init_commands();
    init_commands();
    init_fleet_status2();
    init_fleet_status2();
    init_http_tests();
    init_http_tests();
    init_tests2();
    init_tests2();
    init_traceroute_test_results();
    init_traceroute_test_results();
    DEX = class extends APIResource {
      static {
        __name(this, "DEX");
      }
      constructor() {
        super(...arguments);
        this.warpChangeEvents = new WARPChangeEvents(this._client);
        this.commands = new Commands(this._client);
        this.colos = new Colos(this._client);
        this.fleetStatus = new FleetStatus2(this._client);
        this.httpTests = new HTTPTests(this._client);
        this.tests = new Tests2(this._client);
        this.tracerouteTestResults = new TracerouteTestResults(this._client);
        this.tracerouteTests = new TracerouteTests(this._client);
      }
    };
    DEX.WARPChangeEvents = WARPChangeEvents;
    DEX.Commands = Commands;
    DEX.CommandListResponsesV4PagePagination = CommandListResponsesV4PagePagination;
    DEX.Colos = Colos;
    DEX.ColoListResponsesSinglePage = ColoListResponsesSinglePage;
    DEX.FleetStatus = FleetStatus2;
    DEX.HTTPTests = HTTPTests;
    DEX.TestsV4PagePagination = TestsV4PagePagination;
    DEX.TracerouteTestResults = TracerouteTestResults;
    DEX.TracerouteTests = TracerouteTests;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/dlp/limits.mjs
var Limits;
var init_limits = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/dlp/limits.mjs"() {
    init_import_meta_url();
    init_resource();
    Limits = class extends APIResource {
      static {
        __name(this, "Limits");
      }
      /**
       * Fetch limits associated with DLP for account
       *
       * @example
       * ```ts
       * const limits = await client.zeroTrust.dlp.limits.list({
       *   account_id: 'account_id',
       * });
       * ```
       */
      list(params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/dlp/limits`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/dlp/patterns.mjs
var Patterns;
var init_patterns = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/dlp/patterns.mjs"() {
    init_import_meta_url();
    init_resource();
    Patterns = class extends APIResource {
      static {
        __name(this, "Patterns");
      }
      /**
       * Validates whether this pattern is a valid regular expression. Rejects it if the
       * regular expression is too complex or can match an unbounded-length string. The
       * regex will be rejected if it uses `*` or `+`. Bound the maximum number of
       * characters that can be matched using a range, e.g. `{1,100}`.
       *
       * @example
       * ```ts
       * const response =
       *   await client.zeroTrust.dlp.patterns.validate({
       *     account_id: 'account_id',
       *     regex: 'regex',
       *   });
       * ```
       */
      validate(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/dlp/patterns/validate`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/dlp/payload-logs.mjs
var PayloadLogs;
var init_payload_logs = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/dlp/payload-logs.mjs"() {
    init_import_meta_url();
    init_resource();
    PayloadLogs = class extends APIResource {
      static {
        __name(this, "PayloadLogs");
      }
      /**
       * Set payload log settings
       *
       * @example
       * ```ts
       * const payloadLog =
       *   await client.zeroTrust.dlp.payloadLogs.update({
       *     account_id: 'account_id',
       *   });
       * ```
       */
      update(params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/dlp/payload_log`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get payload log settings
       *
       * @example
       * ```ts
       * const payloadLog =
       *   await client.zeroTrust.dlp.payloadLogs.get({
       *     account_id: 'account_id',
       *   });
       * ```
       */
      get(params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/dlp/payload_log`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/dlp/datasets/upload.mjs
var Upload3;
var init_upload3 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/dlp/datasets/upload.mjs"() {
    init_import_meta_url();
    init_resource();
    Upload3 = class extends APIResource {
      static {
        __name(this, "Upload");
      }
      /**
       * Prepare to upload a new version of a dataset
       *
       * @example
       * ```ts
       * const newVersion =
       *   await client.zeroTrust.dlp.datasets.upload.create(
       *     '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
       *     { account_id: 'account_id' },
       *   );
       * ```
       */
      create(datasetId, params, options) {
        const { account_id } = params;
        return this._client.post(`/accounts/${account_id}/dlp/datasets/${datasetId}/upload`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * This is used for single-column EDMv1 and Custom Word Lists. The EDM format can
       * only be created in the Cloudflare dashboard. For other clients, this operation
       * can only be used for non-secret Custom Word Lists. The body must be a UTF-8
       * encoded, newline (NL or CRNL) separated list of words to be matched.
       *
       * @example
       * ```ts
       * const dataset =
       *   await client.zeroTrust.dlp.datasets.upload.edit(
       *     '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
       *     0,
       *     fs.createReadStream('path/to/file'),
       *     { account_id: 'account_id' },
       *   );
       * ```
       */
      edit(datasetId, version5, dataset, params, options) {
        const { account_id } = params;
        return this._client.post(`/accounts/${account_id}/dlp/datasets/${datasetId}/upload/${version5}`, {
          body: dataset,
          ...options,
          headers: { "Content-Type": "application/octet-stream", ...options?.headers },
          __binaryRequest: true
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/dlp/datasets/versions/entries.mjs
var Entries2;
var init_entries2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/dlp/datasets/versions/entries.mjs"() {
    init_import_meta_url();
    init_resource();
    Entries2 = class extends APIResource {
      static {
        __name(this, "Entries");
      }
      /**
       * This is used for multi-column EDMv2 datasets. The EDMv2 format can only be
       * created in the Cloudflare dashboard.
       *
       * @example
       * ```ts
       * const entry =
       *   await client.zeroTrust.dlp.datasets.versions.entries.create(
       *     '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
       *     0,
       *     '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
       *     fs.createReadStream('path/to/file'),
       *     { account_id: 'account_id' },
       *   );
       * ```
       */
      create(datasetId, version5, entryId, datasetVersionEntry, params, options) {
        const { account_id } = params;
        return this._client.post(`/accounts/${account_id}/dlp/datasets/${datasetId}/versions/${version5}/entries/${entryId}`, {
          body: datasetVersionEntry,
          ...options,
          headers: { "Content-Type": "application/octet-stream", ...options?.headers },
          __binaryRequest: true
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/dlp/datasets/versions/versions.mjs
var Versions6, VersionCreateResponsesSinglePage;
var init_versions6 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/dlp/datasets/versions/versions.mjs"() {
    init_import_meta_url();
    init_resource();
    init_entries2();
    init_entries2();
    init_pagination();
    Versions6 = class extends APIResource {
      static {
        __name(this, "Versions");
      }
      constructor() {
        super(...arguments);
        this.entries = new Entries2(this._client);
      }
      /**
       * This is used for multi-column EDMv2 datasets. The EDMv2 format can only be
       * created in the Cloudflare dashboard. The columns in the response appear in the
       * same order as in the request.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const versionCreateResponse of client.zeroTrust.dlp.datasets.versions.create(
       *   '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
       *   0,
       *   {
       *     account_id: 'account_id',
       *     body: [
       *       { entry_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' },
       *     ],
       *   },
       * )) {
       *   // ...
       * }
       * ```
       */
      create(datasetId, version5, params, options) {
        const { account_id, body } = params;
        return this._client.getAPIList(`/accounts/${account_id}/dlp/datasets/${datasetId}/versions/${version5}`, VersionCreateResponsesSinglePage, { body, method: "post", ...options });
      }
    };
    VersionCreateResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "VersionCreateResponsesSinglePage");
      }
    };
    Versions6.VersionCreateResponsesSinglePage = VersionCreateResponsesSinglePage;
    Versions6.Entries = Entries2;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/dlp/datasets/datasets.mjs
var Datasets5, DatasetsSinglePage;
var init_datasets5 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/dlp/datasets/datasets.mjs"() {
    init_import_meta_url();
    init_resource();
    init_upload3();
    init_upload3();
    init_versions6();
    init_versions6();
    init_pagination();
    Datasets5 = class extends APIResource {
      static {
        __name(this, "Datasets");
      }
      constructor() {
        super(...arguments);
        this.upload = new Upload3(this._client);
        this.versions = new Versions6(this._client);
      }
      /**
       * Create a new dataset
       *
       * @example
       * ```ts
       * const datasetCreation =
       *   await client.zeroTrust.dlp.datasets.create({
       *     account_id: 'account_id',
       *     name: 'name',
       *   });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/dlp/datasets`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Update details about a dataset
       *
       * @example
       * ```ts
       * const dataset = await client.zeroTrust.dlp.datasets.update(
       *   '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
       *   { account_id: 'account_id' },
       * );
       * ```
       */
      update(datasetId, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/dlp/datasets/${datasetId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetch all datasets
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const dataset of client.zeroTrust.dlp.datasets.list(
       *   { account_id: 'account_id' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/dlp/datasets`, DatasetsSinglePage, options);
      }
      /**
       * This deletes all versions of the dataset.
       *
       * @example
       * ```ts
       * await client.zeroTrust.dlp.datasets.delete(
       *   '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
       *   { account_id: 'account_id' },
       * );
       * ```
       */
      delete(datasetId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/dlp/datasets/${datasetId}`, {
          ...options,
          headers: { Accept: "*/*", ...options?.headers }
        });
      }
      /**
       * Fetch a specific dataset
       *
       * @example
       * ```ts
       * const dataset = await client.zeroTrust.dlp.datasets.get(
       *   '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
       *   { account_id: 'account_id' },
       * );
       * ```
       */
      get(datasetId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/dlp/datasets/${datasetId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    DatasetsSinglePage = class extends SinglePage {
      static {
        __name(this, "DatasetsSinglePage");
      }
    };
    Datasets5.DatasetsSinglePage = DatasetsSinglePage;
    Datasets5.Upload = Upload3;
    Datasets5.Versions = Versions6;
    Datasets5.VersionCreateResponsesSinglePage = VersionCreateResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/dlp/email/account-mapping.mjs
var AccountMapping;
var init_account_mapping = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/dlp/email/account-mapping.mjs"() {
    init_import_meta_url();
    init_resource();
    AccountMapping = class extends APIResource {
      static {
        __name(this, "AccountMapping");
      }
      /**
       * Create mapping
       *
       * @example
       * ```ts
       * const accountMapping =
       *   await client.zeroTrust.dlp.email.accountMapping.create({
       *     account_id: 'account_id',
       *     auth_requirements: {
       *       allowed_microsoft_organizations: ['string'],
       *       type: 'Org',
       *     },
       *   });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/dlp/email/account_mapping`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get mapping
       *
       * @example
       * ```ts
       * const accountMapping =
       *   await client.zeroTrust.dlp.email.accountMapping.get({
       *     account_id: 'account_id',
       *   });
       * ```
       */
      get(params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/dlp/email/account_mapping`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/dlp/email/rules.mjs
var Rules11, RuleListResponsesSinglePage3;
var init_rules12 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/dlp/email/rules.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Rules11 = class extends APIResource {
      static {
        __name(this, "Rules");
      }
      /**
       * Create email scanner rule
       *
       * @example
       * ```ts
       * const rule = await client.zeroTrust.dlp.email.rules.create({
       *   account_id: 'account_id',
       *   action: { action: 'Block' },
       *   conditions: [
       *     {
       *       operator: 'InList',
       *       selector: 'Recipients',
       *       value: ['string'],
       *     },
       *   ],
       *   enabled: true,
       *   name: 'name',
       * });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/dlp/email/rules`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Update email scanner rule
       *
       * @example
       * ```ts
       * const rule = await client.zeroTrust.dlp.email.rules.update(
       *   '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
       *   {
       *     account_id: 'account_id',
       *     action: { action: 'Block' },
       *     conditions: [
       *       {
       *         operator: 'InList',
       *         selector: 'Recipients',
       *         value: ['string'],
       *       },
       *     ],
       *     enabled: true,
       *     name: 'name',
       *   },
       * );
       * ```
       */
      update(ruleId, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/dlp/email/rules/${ruleId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Lists all email scanner rules for an account.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const ruleListResponse of client.zeroTrust.dlp.email.rules.list(
       *   { account_id: 'account_id' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/dlp/email/rules`, RuleListResponsesSinglePage3, options);
      }
      /**
       * Delete email scanner rule
       *
       * @example
       * ```ts
       * const rule = await client.zeroTrust.dlp.email.rules.delete(
       *   '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
       *   { account_id: 'account_id' },
       * );
       * ```
       */
      delete(ruleId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/dlp/email/rules/${ruleId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Update email scanner rule priorities
       *
       * @example
       * ```ts
       * const response =
       *   await client.zeroTrust.dlp.email.rules.bulkEdit({
       *     account_id: 'account_id',
       *     new_priorities: { foo: 0 },
       *   });
       * ```
       */
      bulkEdit(params, options) {
        const { account_id, ...body } = params;
        return this._client.patch(`/accounts/${account_id}/dlp/email/rules`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get an email scanner rule
       *
       * @example
       * ```ts
       * const rule = await client.zeroTrust.dlp.email.rules.get(
       *   '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
       *   { account_id: 'account_id' },
       * );
       * ```
       */
      get(ruleId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/dlp/email/rules/${ruleId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    RuleListResponsesSinglePage3 = class extends SinglePage {
      static {
        __name(this, "RuleListResponsesSinglePage");
      }
    };
    Rules11.RuleListResponsesSinglePage = RuleListResponsesSinglePage3;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/dlp/email/email.mjs
var Email2;
var init_email2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/dlp/email/email.mjs"() {
    init_import_meta_url();
    init_resource();
    init_account_mapping();
    init_account_mapping();
    init_rules12();
    init_rules12();
    Email2 = class extends APIResource {
      static {
        __name(this, "Email");
      }
      constructor() {
        super(...arguments);
        this.accountMapping = new AccountMapping(this._client);
        this.rules = new Rules11(this._client);
      }
    };
    Email2.AccountMapping = AccountMapping;
    Email2.Rules = Rules11;
    Email2.RuleListResponsesSinglePage = RuleListResponsesSinglePage3;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/dlp/entries/custom.mjs
var Custom3, CustomListResponsesSinglePage;
var init_custom3 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/dlp/entries/custom.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Custom3 = class extends APIResource {
      static {
        __name(this, "Custom");
      }
      /**
       * Creates a DLP custom entry.
       *
       * @example
       * ```ts
       * const custom =
       *   await client.zeroTrust.dlp.entries.custom.create({
       *     account_id: 'account_id',
       *     enabled: true,
       *     name: 'name',
       *     pattern: { regex: 'regex' },
       *     profile_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
       *   });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/dlp/entries`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Updates a DLP custom entry.
       *
       * @example
       * ```ts
       * const custom =
       *   await client.zeroTrust.dlp.entries.custom.update(
       *     '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
       *     {
       *       account_id: 'account_id',
       *       enabled: true,
       *       name: 'name',
       *       pattern: { regex: 'regex' },
       *     },
       *   );
       * ```
       */
      update(entryId, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/dlp/entries/custom/${entryId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Lists all DLP entries in an account.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const customListResponse of client.zeroTrust.dlp.entries.custom.list(
       *   { account_id: 'account_id' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/dlp/entries`, CustomListResponsesSinglePage, options);
      }
      /**
       * Deletes a DLP custom entry.
       *
       * @example
       * ```ts
       * const custom =
       *   await client.zeroTrust.dlp.entries.custom.delete(
       *     '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
       *     { account_id: 'account_id' },
       *   );
       * ```
       */
      delete(entryId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/dlp/entries/${entryId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetches a DLP entry by ID.
       *
       * @example
       * ```ts
       * const custom =
       *   await client.zeroTrust.dlp.entries.custom.get(
       *     '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
       *     { account_id: 'account_id' },
       *   );
       * ```
       */
      get(entryId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/dlp/entries/${entryId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    CustomListResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "CustomListResponsesSinglePage");
      }
    };
    Custom3.CustomListResponsesSinglePage = CustomListResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/dlp/entries/integration.mjs
var Integration, IntegrationListResponsesSinglePage;
var init_integration = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/dlp/entries/integration.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Integration = class extends APIResource {
      static {
        __name(this, "Integration");
      }
      /**
       * Integration entries can't be created, this will update an existing integration
       * entry This is needed for our generated terraform API
       *
       * @example
       * ```ts
       * const integration =
       *   await client.zeroTrust.dlp.entries.integration.create({
       *     account_id: 'account_id',
       *     enabled: true,
       *     entry_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
       *   });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/dlp/entries/integration`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Updates a DLP entry.
       *
       * @example
       * ```ts
       * const integration =
       *   await client.zeroTrust.dlp.entries.integration.update(
       *     '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
       *     { account_id: 'account_id', enabled: true },
       *   );
       * ```
       */
      update(entryId, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/dlp/entries/integration/${entryId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Lists all DLP entries in an account.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const integrationListResponse of client.zeroTrust.dlp.entries.integration.list(
       *   { account_id: 'account_id' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/dlp/entries`, IntegrationListResponsesSinglePage, options);
      }
      /**
       * This is a no-op as integration entires can't be deleted but is needed for our
       * generated terraform API
       *
       * @example
       * ```ts
       * const integration =
       *   await client.zeroTrust.dlp.entries.integration.delete(
       *     '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
       *     { account_id: 'account_id' },
       *   );
       * ```
       */
      delete(entryId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/dlp/entries/integration/${entryId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetches a DLP entry by ID.
       *
       * @example
       * ```ts
       * const integration =
       *   await client.zeroTrust.dlp.entries.integration.get(
       *     '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
       *     { account_id: 'account_id' },
       *   );
       * ```
       */
      get(entryId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/dlp/entries/${entryId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    IntegrationListResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "IntegrationListResponsesSinglePage");
      }
    };
    Integration.IntegrationListResponsesSinglePage = IntegrationListResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/dlp/entries/predefined.mjs
var Predefined, PredefinedListResponsesSinglePage;
var init_predefined = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/dlp/entries/predefined.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Predefined = class extends APIResource {
      static {
        __name(this, "Predefined");
      }
      /**
       * Predefined entries can't be created, this will update an existing predefined
       * entry This is needed for our generated terraform API
       *
       * @example
       * ```ts
       * const predefined =
       *   await client.zeroTrust.dlp.entries.predefined.create({
       *     account_id: 'account_id',
       *     enabled: true,
       *     entry_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
       *   });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/dlp/entries/predefined`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Updates a DLP entry.
       *
       * @example
       * ```ts
       * const predefined =
       *   await client.zeroTrust.dlp.entries.predefined.update(
       *     '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
       *     { account_id: 'account_id', enabled: true },
       *   );
       * ```
       */
      update(entryId, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/dlp/entries/predefined/${entryId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Lists all DLP entries in an account.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const predefinedListResponse of client.zeroTrust.dlp.entries.predefined.list(
       *   { account_id: 'account_id' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/dlp/entries`, PredefinedListResponsesSinglePage, options);
      }
      /**
       * This is a no-op as predefined entires can't be deleted but is needed for our
       * generated terraform API
       *
       * @example
       * ```ts
       * const predefined =
       *   await client.zeroTrust.dlp.entries.predefined.delete(
       *     '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
       *     { account_id: 'account_id' },
       *   );
       * ```
       */
      delete(entryId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/dlp/entries/predefined/${entryId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetches a DLP entry by ID.
       *
       * @example
       * ```ts
       * const predefined =
       *   await client.zeroTrust.dlp.entries.predefined.get(
       *     '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
       *     { account_id: 'account_id' },
       *   );
       * ```
       */
      get(entryId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/dlp/entries/${entryId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    PredefinedListResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "PredefinedListResponsesSinglePage");
      }
    };
    Predefined.PredefinedListResponsesSinglePage = PredefinedListResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/dlp/entries/entries.mjs
var Entries3, EntryListResponsesSinglePage;
var init_entries3 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/dlp/entries/entries.mjs"() {
    init_import_meta_url();
    init_resource();
    init_custom3();
    init_custom3();
    init_integration();
    init_integration();
    init_predefined();
    init_predefined();
    init_pagination();
    Entries3 = class extends APIResource {
      static {
        __name(this, "Entries");
      }
      constructor() {
        super(...arguments);
        this.custom = new Custom3(this._client);
        this.predefined = new Predefined(this._client);
        this.integration = new Integration(this._client);
      }
      /**
       * Creates a DLP custom entry.
       *
       * @example
       * ```ts
       * const entry = await client.zeroTrust.dlp.entries.create({
       *   account_id: 'account_id',
       *   enabled: true,
       *   name: 'name',
       *   pattern: { regex: 'regex' },
       *   profile_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
       * });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/dlp/entries`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Updates a DLP entry.
       *
       * @example
       * ```ts
       * const entry = await client.zeroTrust.dlp.entries.update(
       *   '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
       *   {
       *     account_id: 'account_id',
       *     name: 'name',
       *     pattern: { regex: 'regex' },
       *     type: 'custom',
       *   },
       * );
       * ```
       */
      update(entryId, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/dlp/entries/${entryId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Lists all DLP entries in an account.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const entryListResponse of client.zeroTrust.dlp.entries.list(
       *   { account_id: 'account_id' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/dlp/entries`, EntryListResponsesSinglePage, options);
      }
      /**
       * Deletes a DLP custom entry.
       *
       * @example
       * ```ts
       * const entry = await client.zeroTrust.dlp.entries.delete(
       *   '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
       *   { account_id: 'account_id' },
       * );
       * ```
       */
      delete(entryId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/dlp/entries/${entryId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetches a DLP entry by ID.
       *
       * @example
       * ```ts
       * const entry = await client.zeroTrust.dlp.entries.get(
       *   '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
       *   { account_id: 'account_id' },
       * );
       * ```
       */
      get(entryId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/dlp/entries/${entryId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    EntryListResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "EntryListResponsesSinglePage");
      }
    };
    Entries3.EntryListResponsesSinglePage = EntryListResponsesSinglePage;
    Entries3.Custom = Custom3;
    Entries3.CustomListResponsesSinglePage = CustomListResponsesSinglePage;
    Entries3.Predefined = Predefined;
    Entries3.PredefinedListResponsesSinglePage = PredefinedListResponsesSinglePage;
    Entries3.Integration = Integration;
    Entries3.IntegrationListResponsesSinglePage = IntegrationListResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/dlp/profiles/custom.mjs
var Custom4;
var init_custom4 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/dlp/profiles/custom.mjs"() {
    init_import_meta_url();
    init_resource();
    Custom4 = class extends APIResource {
      static {
        __name(this, "Custom");
      }
      /**
       * Creates a DLP custom profile.
       *
       * @example
       * ```ts
       * const profile =
       *   await client.zeroTrust.dlp.profiles.custom.create({
       *     account_id: 'account_id',
       *     name: 'name',
       *   });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/dlp/profiles/custom`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Updates a DLP custom profile.
       *
       * @example
       * ```ts
       * const profile =
       *   await client.zeroTrust.dlp.profiles.custom.update(
       *     '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
       *     { account_id: 'account_id', name: 'name' },
       *   );
       * ```
       */
      update(profileId, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/dlp/profiles/custom/${profileId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Deletes a DLP custom profile.
       *
       * @example
       * ```ts
       * const custom =
       *   await client.zeroTrust.dlp.profiles.custom.delete(
       *     '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
       *     { account_id: 'account_id' },
       *   );
       * ```
       */
      delete(profileId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/dlp/profiles/custom/${profileId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetches a custom DLP profile by id.
       *
       * @example
       * ```ts
       * const profile =
       *   await client.zeroTrust.dlp.profiles.custom.get(
       *     '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
       *     { account_id: 'account_id' },
       *   );
       * ```
       */
      get(profileId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/dlp/profiles/custom/${profileId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/dlp/profiles/predefined.mjs
var Predefined2;
var init_predefined2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/dlp/profiles/predefined.mjs"() {
    init_import_meta_url();
    init_resource();
    Predefined2 = class extends APIResource {
      static {
        __name(this, "Predefined");
      }
      /**
       * Creates a DLP predefined profile. Only supports enabling/disabling entries.
       *
       * @example
       * ```ts
       * const profile =
       *   await client.zeroTrust.dlp.profiles.predefined.create({
       *     account_id: 'account_id',
       *     profile_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
       *   });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/dlp/profiles/predefined`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Updates a DLP predefined profile. Only supports enabling/disabling entries.
       *
       * @example
       * ```ts
       * const profile =
       *   await client.zeroTrust.dlp.profiles.predefined.update(
       *     '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
       *     { account_id: 'account_id' },
       *   );
       * ```
       */
      update(profileId, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/dlp/profiles/predefined/${profileId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * This is a no-op as predefined profiles can't be deleted but is needed for our
       * generated terraform API
       *
       * @example
       * ```ts
       * const predefined =
       *   await client.zeroTrust.dlp.profiles.predefined.delete(
       *     '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
       *     { account_id: 'account_id' },
       *   );
       * ```
       */
      delete(profileId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/dlp/profiles/predefined/${profileId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetches a predefined DLP profile by id.
       *
       * @example
       * ```ts
       * const profile =
       *   await client.zeroTrust.dlp.profiles.predefined.get(
       *     '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
       *     { account_id: 'account_id' },
       *   );
       * ```
       */
      get(profileId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/dlp/profiles/predefined/${profileId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/dlp/profiles/profiles.mjs
var Profiles2, ProfilesSinglePage;
var init_profiles2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/dlp/profiles/profiles.mjs"() {
    init_import_meta_url();
    init_resource();
    init_custom4();
    init_custom4();
    init_predefined2();
    init_predefined2();
    init_pagination();
    Profiles2 = class extends APIResource {
      static {
        __name(this, "Profiles");
      }
      constructor() {
        super(...arguments);
        this.custom = new Custom4(this._client);
        this.predefined = new Predefined2(this._client);
      }
      /**
       * Lists all DLP profiles in an account.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const profile of client.zeroTrust.dlp.profiles.list(
       *   { account_id: 'account_id' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/dlp/profiles`, ProfilesSinglePage, {
          query,
          ...options
        });
      }
      /**
       * Fetches a DLP profile by ID.
       *
       * @example
       * ```ts
       * const profile = await client.zeroTrust.dlp.profiles.get(
       *   '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
       *   { account_id: 'account_id' },
       * );
       * ```
       */
      get(profileId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/dlp/profiles/${profileId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    ProfilesSinglePage = class extends SinglePage {
      static {
        __name(this, "ProfilesSinglePage");
      }
    };
    Profiles2.ProfilesSinglePage = ProfilesSinglePage;
    Profiles2.Custom = Custom4;
    Profiles2.Predefined = Predefined2;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/dlp/dlp.mjs
var DLP;
var init_dlp = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/dlp/dlp.mjs"() {
    init_import_meta_url();
    init_resource();
    init_limits();
    init_limits();
    init_patterns();
    init_patterns();
    init_payload_logs();
    init_payload_logs();
    init_datasets5();
    init_datasets5();
    init_email2();
    init_email2();
    init_entries3();
    init_entries3();
    init_profiles2();
    init_profiles2();
    DLP = class extends APIResource {
      static {
        __name(this, "DLP");
      }
      constructor() {
        super(...arguments);
        this.datasets = new Datasets5(this._client);
        this.patterns = new Patterns(this._client);
        this.payloadLogs = new PayloadLogs(this._client);
        this.email = new Email2(this._client);
        this.profiles = new Profiles2(this._client);
        this.limits = new Limits(this._client);
        this.entries = new Entries3(this._client);
      }
    };
    DLP.Datasets = Datasets5;
    DLP.DatasetsSinglePage = DatasetsSinglePage;
    DLP.Patterns = Patterns;
    DLP.PayloadLogs = PayloadLogs;
    DLP.Email = Email2;
    DLP.Profiles = Profiles2;
    DLP.ProfilesSinglePage = ProfilesSinglePage;
    DLP.Limits = Limits;
    DLP.Entries = Entries3;
    DLP.EntryListResponsesSinglePage = EntryListResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/gateway/app-types.mjs
var AppTypes, AppTypesSinglePage;
var init_app_types = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/gateway/app-types.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    AppTypes = class extends APIResource {
      static {
        __name(this, "AppTypes");
      }
      /**
       * List all application and application type mappings.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const appType of client.zeroTrust.gateway.appTypes.list(
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/gateway/app_types`, AppTypesSinglePage, options);
      }
    };
    AppTypesSinglePage = class extends SinglePage {
      static {
        __name(this, "AppTypesSinglePage");
      }
    };
    AppTypes.AppTypesSinglePage = AppTypesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/gateway/audit-ssh-settings.mjs
var AuditSSHSettings;
var init_audit_ssh_settings = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/gateway/audit-ssh-settings.mjs"() {
    init_import_meta_url();
    init_resource();
    AuditSSHSettings = class extends APIResource {
      static {
        __name(this, "AuditSSHSettings");
      }
      /**
       * Update Zero Trust Audit SSH and SSH with Access for Infrastructure settings for
       * an account.
       *
       * @example
       * ```ts
       * const gatewaySettings =
       *   await client.zeroTrust.gateway.auditSSHSettings.update({
       *     account_id: '699d98642c564d2e855e9661899b7252',
       *     public_key:
       *       '1pyl6I1tL7xfJuFYVzXlUW8uXXlpxegHXBzGCBKaSFA=',
       *   });
       * ```
       */
      update(params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/gateway/audit_ssh_settings`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Retrieve all Zero Trust Audit SSH and SSH with Access for Infrastructure
       * settings for an account.
       *
       * @example
       * ```ts
       * const gatewaySettings =
       *   await client.zeroTrust.gateway.auditSSHSettings.get({
       *     account_id: '699d98642c564d2e855e9661899b7252',
       *   });
       * ```
       */
      get(params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/gateway/audit_ssh_settings`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Rotate the SSH account seed that generates the host key identity when connecting
       * through the Cloudflare SSH Proxy.
       *
       * @example
       * ```ts
       * const gatewaySettings =
       *   await client.zeroTrust.gateway.auditSSHSettings.rotateSeed(
       *     { account_id: '699d98642c564d2e855e9661899b7252' },
       *   );
       * ```
       */
      rotateSeed(params, options) {
        const { account_id } = params;
        return this._client.post(`/accounts/${account_id}/gateway/audit_ssh_settings/rotate_seed`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/gateway/categories.mjs
var Categories2, CategoriesSinglePage;
var init_categories2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/gateway/categories.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Categories2 = class extends APIResource {
      static {
        __name(this, "Categories");
      }
      /**
       * List all categories.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const category of client.zeroTrust.gateway.categories.list(
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/gateway/categories`, CategoriesSinglePage, options);
      }
    };
    CategoriesSinglePage = class extends SinglePage {
      static {
        __name(this, "CategoriesSinglePage");
      }
    };
    Categories2.CategoriesSinglePage = CategoriesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/gateway/certificates.mjs
var Certificates5, CertificateListResponsesSinglePage2;
var init_certificates5 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/gateway/certificates.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Certificates5 = class extends APIResource {
      static {
        __name(this, "Certificates");
      }
      /**
       * Create a new Zero Trust certificate.
       *
       * @example
       * ```ts
       * const certificate =
       *   await client.zeroTrust.gateway.certificates.create({
       *     account_id: '699d98642c564d2e855e9661899b7252',
       *   });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/gateway/certificates`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List all Zero Trust certificates for an account.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const certificateListResponse of client.zeroTrust.gateway.certificates.list(
       *   { account_id: '699d98642c564d2e855e9661899b7252' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/gateway/certificates`, CertificateListResponsesSinglePage2, options);
      }
      /**
       * Delete a gateway-managed Zero Trust certificate. You must deactivate the
       * certificate from the edge (inactive) before deleting it.
       *
       * @example
       * ```ts
       * const certificate =
       *   await client.zeroTrust.gateway.certificates.delete(
       *     'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *     { account_id: '699d98642c564d2e855e9661899b7252' },
       *   );
       * ```
       */
      delete(certificateId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/gateway/certificates/${certificateId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Bind a single Zero Trust certificate to the edge.
       *
       * @example
       * ```ts
       * const response =
       *   await client.zeroTrust.gateway.certificates.activate(
       *     'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *     {
       *       account_id: '699d98642c564d2e855e9661899b7252',
       *       body: {},
       *     },
       *   );
       * ```
       */
      activate(certificateId, params, options) {
        const { account_id, body } = params;
        return this._client.post(`/accounts/${account_id}/gateway/certificates/${certificateId}/activate`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Unbind a single Zero Trust certificate from the edge.
       *
       * @example
       * ```ts
       * const response =
       *   await client.zeroTrust.gateway.certificates.deactivate(
       *     'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *     {
       *       account_id: '699d98642c564d2e855e9661899b7252',
       *       body: {},
       *     },
       *   );
       * ```
       */
      deactivate(certificateId, params, options) {
        const { account_id, body } = params;
        return this._client.post(`/accounts/${account_id}/gateway/certificates/${certificateId}/deactivate`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get a single Zero Trust certificate.
       *
       * @example
       * ```ts
       * const certificate =
       *   await client.zeroTrust.gateway.certificates.get(
       *     'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *     { account_id: '699d98642c564d2e855e9661899b7252' },
       *   );
       * ```
       */
      get(certificateId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/gateway/certificates/${certificateId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    CertificateListResponsesSinglePage2 = class extends SinglePage {
      static {
        __name(this, "CertificateListResponsesSinglePage");
      }
    };
    Certificates5.CertificateListResponsesSinglePage = CertificateListResponsesSinglePage2;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/gateway/locations.mjs
var Locations6, LocationsSinglePage;
var init_locations6 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/gateway/locations.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Locations6 = class extends APIResource {
      static {
        __name(this, "Locations");
      }
      /**
       * Create a new Zero Trust Gateway location.
       *
       * @example
       * ```ts
       * const location =
       *   await client.zeroTrust.gateway.locations.create({
       *     account_id: '699d98642c564d2e855e9661899b7252',
       *     name: 'Austin Office Location',
       *   });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/gateway/locations`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Update a configured Zero Trust Gateway location.
       *
       * @example
       * ```ts
       * const location =
       *   await client.zeroTrust.gateway.locations.update(
       *     'ed35569b41ce4d1facfe683550f54086',
       *     {
       *       account_id: '699d98642c564d2e855e9661899b7252',
       *       name: 'Austin Office Location',
       *     },
       *   );
       * ```
       */
      update(locationId, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/gateway/locations/${locationId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List Zero Trust Gateway locations for an account.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const location of client.zeroTrust.gateway.locations.list(
       *   { account_id: '699d98642c564d2e855e9661899b7252' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/gateway/locations`, LocationsSinglePage, options);
      }
      /**
       * Delete a configured Zero Trust Gateway location.
       *
       * @example
       * ```ts
       * const location =
       *   await client.zeroTrust.gateway.locations.delete(
       *     'ed35569b41ce4d1facfe683550f54086',
       *     { account_id: '699d98642c564d2e855e9661899b7252' },
       *   );
       * ```
       */
      delete(locationId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/gateway/locations/${locationId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get a single Zero Trust Gateway location.
       *
       * @example
       * ```ts
       * const location =
       *   await client.zeroTrust.gateway.locations.get(
       *     'ed35569b41ce4d1facfe683550f54086',
       *     { account_id: '699d98642c564d2e855e9661899b7252' },
       *   );
       * ```
       */
      get(locationId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/gateway/locations/${locationId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    LocationsSinglePage = class extends SinglePage {
      static {
        __name(this, "LocationsSinglePage");
      }
    };
    Locations6.LocationsSinglePage = LocationsSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/gateway/logging.mjs
var Logging;
var init_logging = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/gateway/logging.mjs"() {
    init_import_meta_url();
    init_resource();
    Logging = class extends APIResource {
      static {
        __name(this, "Logging");
      }
      /**
       * Update logging settings for the current Zero Trust account.
       *
       * @example
       * ```ts
       * const loggingSetting =
       *   await client.zeroTrust.gateway.logging.update({
       *     account_id: '699d98642c564d2e855e9661899b7252',
       *   });
       * ```
       */
      update(params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/gateway/logging`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Retrieve the current logging settings for the Zero Trust account.
       *
       * @example
       * ```ts
       * const loggingSetting =
       *   await client.zeroTrust.gateway.logging.get({
       *     account_id: '699d98642c564d2e855e9661899b7252',
       *   });
       * ```
       */
      get(params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/gateway/logging`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/gateway/proxy-endpoints.mjs
var ProxyEndpoints, ProxyEndpointsSinglePage;
var init_proxy_endpoints = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/gateway/proxy-endpoints.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    ProxyEndpoints = class extends APIResource {
      static {
        __name(this, "ProxyEndpoints");
      }
      /**
       * Create a new Zero Trust Gateway proxy endpoint.
       *
       * @example
       * ```ts
       * const proxyEndpoint =
       *   await client.zeroTrust.gateway.proxyEndpoints.create({
       *     account_id: '699d98642c564d2e855e9661899b7252',
       *     ips: ['192.0.2.1/32'],
       *     name: 'Devops team',
       *   });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/gateway/proxy_endpoints`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List all Zero Trust Gateway proxy endpoints for an account.
       *
       * @example
       * ```ts
       * const proxyEndpoint =
       *   await client.zeroTrust.gateway.proxyEndpoints.list({
       *     account_id: '699d98642c564d2e855e9661899b7252',
       *   });
       * ```
       */
      list(params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/gateway/proxy_endpoints`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Delete a configured Zero Trust Gateway proxy endpoint.
       *
       * @example
       * ```ts
       * const proxyEndpoint =
       *   await client.zeroTrust.gateway.proxyEndpoints.delete(
       *     'ed35569b41ce4d1facfe683550f54086',
       *     { account_id: '699d98642c564d2e855e9661899b7252' },
       *   );
       * ```
       */
      delete(proxyEndpointId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/gateway/proxy_endpoints/${proxyEndpointId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Update a configured Zero Trust Gateway proxy endpoint.
       *
       * @example
       * ```ts
       * const proxyEndpoint =
       *   await client.zeroTrust.gateway.proxyEndpoints.edit(
       *     'ed35569b41ce4d1facfe683550f54086',
       *     { account_id: '699d98642c564d2e855e9661899b7252' },
       *   );
       * ```
       */
      edit(proxyEndpointId, params, options) {
        const { account_id, ...body } = params;
        return this._client.patch(`/accounts/${account_id}/gateway/proxy_endpoints/${proxyEndpointId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get a single Zero Trust Gateway proxy endpoint.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const proxyEndpoint of client.zeroTrust.gateway.proxyEndpoints.get(
       *   'ed35569b41ce4d1facfe683550f54086',
       *   { account_id: '699d98642c564d2e855e9661899b7252' },
       * )) {
       *   // ...
       * }
       * ```
       */
      get(proxyEndpointId, params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/gateway/proxy_endpoints/${proxyEndpointId}`, ProxyEndpointsSinglePage, options);
      }
    };
    ProxyEndpointsSinglePage = class extends SinglePage {
      static {
        __name(this, "ProxyEndpointsSinglePage");
      }
    };
    ProxyEndpoints.ProxyEndpointsSinglePage = ProxyEndpointsSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/gateway/rules.mjs
var Rules12, GatewayRulesSinglePage;
var init_rules13 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/gateway/rules.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Rules12 = class extends APIResource {
      static {
        __name(this, "Rules");
      }
      /**
       * Create a new Zero Trust Gateway rule.
       *
       * @example
       * ```ts
       * const gatewayRule =
       *   await client.zeroTrust.gateway.rules.create({
       *     account_id: '699d98642c564d2e855e9661899b7252',
       *     action: 'allow',
       *     name: 'block bad websites',
       *   });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/gateway/rules`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Update a configured Zero Trust Gateway rule.
       *
       * @example
       * ```ts
       * const gatewayRule =
       *   await client.zeroTrust.gateway.rules.update(
       *     'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *     {
       *       account_id: '699d98642c564d2e855e9661899b7252',
       *       action: 'allow',
       *       name: 'block bad websites',
       *     },
       *   );
       * ```
       */
      update(ruleId, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/gateway/rules/${ruleId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List Zero Trust Gateway rules for an account.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const gatewayRule of client.zeroTrust.gateway.rules.list(
       *   { account_id: '699d98642c564d2e855e9661899b7252' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/gateway/rules`, GatewayRulesSinglePage, options);
      }
      /**
       * Delete a Zero Trust Gateway rule.
       *
       * @example
       * ```ts
       * const rule = await client.zeroTrust.gateway.rules.delete(
       *   'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *   { account_id: '699d98642c564d2e855e9661899b7252' },
       * );
       * ```
       */
      delete(ruleId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/gateway/rules/${ruleId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get a single Zero Trust Gateway rule.
       *
       * @example
       * ```ts
       * const gatewayRule =
       *   await client.zeroTrust.gateway.rules.get(
       *     'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *     { account_id: '699d98642c564d2e855e9661899b7252' },
       *   );
       * ```
       */
      get(ruleId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/gateway/rules/${ruleId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Resets the expiration of a Zero Trust Gateway Rule if its duration elapsed and
       * it has a default duration. The Zero Trust Gateway Rule must have values for both
       * `expiration.expires_at` and `expiration.duration`.
       *
       * @example
       * ```ts
       * const gatewayRule =
       *   await client.zeroTrust.gateway.rules.resetExpiration(
       *     'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *     { account_id: '699d98642c564d2e855e9661899b7252' },
       *   );
       * ```
       */
      resetExpiration(ruleId, params, options) {
        const { account_id } = params;
        return this._client.post(`/accounts/${account_id}/gateway/rules/${ruleId}/reset_expiration`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    GatewayRulesSinglePage = class extends SinglePage {
      static {
        __name(this, "GatewayRulesSinglePage");
      }
    };
    Rules12.GatewayRulesSinglePage = GatewayRulesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/gateway/configurations/custom-certificate.mjs
var CustomCertificate;
var init_custom_certificate = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/gateway/configurations/custom-certificate.mjs"() {
    init_import_meta_url();
    init_resource();
    CustomCertificate = class extends APIResource {
      static {
        __name(this, "CustomCertificate");
      }
      /**
       * Retrieve the current Zero Trust certificate configuration.
       *
       * @deprecated
       */
      get(params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/gateway/configuration/custom_certificate`, options);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/gateway/configurations/configurations.mjs
var Configurations2;
var init_configurations2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/gateway/configurations/configurations.mjs"() {
    init_import_meta_url();
    init_resource();
    init_custom_certificate();
    init_custom_certificate();
    Configurations2 = class extends APIResource {
      static {
        __name(this, "Configurations");
      }
      constructor() {
        super(...arguments);
        this.customCertificate = new CustomCertificate(this._client);
      }
      /**
       * Update the current Zero Trust account configuration.
       *
       * @example
       * ```ts
       * const configuration =
       *   await client.zeroTrust.gateway.configurations.update({
       *     account_id: '699d98642c564d2e855e9661899b7252',
       *   });
       * ```
       */
      update(params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/gateway/configuration`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Update (PATCH) a single subcollection of settings such as `antivirus`,
       * `tls_decrypt`, `activity_log`, `block_page`, `browser_isolation`, `fips`,
       * `body_scanning`, or `certificate` without updating the entire configuration
       * object. This endpoint returns an error if any settings collection lacks proper
       * configuration.
       *
       * @example
       * ```ts
       * const response =
       *   await client.zeroTrust.gateway.configurations.edit({
       *     account_id: '699d98642c564d2e855e9661899b7252',
       *   });
       * ```
       */
      edit(params, options) {
        const { account_id, ...body } = params;
        return this._client.patch(`/accounts/${account_id}/gateway/configuration`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Retrieve the current Zero Trust account configuration.
       *
       * @example
       * ```ts
       * const configuration =
       *   await client.zeroTrust.gateway.configurations.get({
       *     account_id: '699d98642c564d2e855e9661899b7252',
       *   });
       * ```
       */
      get(params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/gateway/configuration`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    Configurations2.CustomCertificate = CustomCertificate;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/gateway/lists/items.mjs
var Items2, ItemListResponsesSinglePage;
var init_items2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/gateway/lists/items.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Items2 = class extends APIResource {
      static {
        __name(this, "Items");
      }
      /**
       * Fetch all items in a single Zero Trust list.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const itemListResponse of client.zeroTrust.gateway.lists.items.list(
       *   'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *   { account_id: '699d98642c564d2e855e9661899b7252' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(listId, params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/gateway/lists/${listId}/items`, ItemListResponsesSinglePage, options);
      }
    };
    ItemListResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "ItemListResponsesSinglePage");
      }
    };
    Items2.ItemListResponsesSinglePage = ItemListResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/gateway/lists/lists.mjs
var Lists2, GatewayListsSinglePage;
var init_lists2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/gateway/lists/lists.mjs"() {
    init_import_meta_url();
    init_resource();
    init_items2();
    init_items2();
    init_pagination();
    Lists2 = class extends APIResource {
      static {
        __name(this, "Lists");
      }
      constructor() {
        super(...arguments);
        this.items = new Items2(this._client);
      }
      /**
       * Creates a new Zero Trust list.
       *
       * @example
       * ```ts
       * const list = await client.zeroTrust.gateway.lists.create({
       *   account_id: '699d98642c564d2e855e9661899b7252',
       *   name: 'Admin Serial Numbers',
       *   type: 'SERIAL',
       * });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/gateway/lists`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Updates a configured Zero Trust list. Skips updating list items if not included
       * in the payload. A non empty list items will overwrite the existing list.
       *
       * @example
       * ```ts
       * const gatewayList =
       *   await client.zeroTrust.gateway.lists.update(
       *     'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *     {
       *       account_id: '699d98642c564d2e855e9661899b7252',
       *       name: 'Admin Serial Numbers',
       *     },
       *   );
       * ```
       */
      update(listId, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/gateway/lists/${listId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetch all Zero Trust lists for an account.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const gatewayList of client.zeroTrust.gateway.lists.list(
       *   { account_id: '699d98642c564d2e855e9661899b7252' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/gateway/lists`, GatewayListsSinglePage, {
          query,
          ...options
        });
      }
      /**
       * Deletes a Zero Trust list.
       *
       * @example
       * ```ts
       * const list = await client.zeroTrust.gateway.lists.delete(
       *   'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *   { account_id: '699d98642c564d2e855e9661899b7252' },
       * );
       * ```
       */
      delete(listId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/gateway/lists/${listId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Appends or removes an item from a configured Zero Trust list.
       *
       * @example
       * ```ts
       * const gatewayList =
       *   await client.zeroTrust.gateway.lists.edit(
       *     'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *     { account_id: '699d98642c564d2e855e9661899b7252' },
       *   );
       * ```
       */
      edit(listId, params, options) {
        const { account_id, ...body } = params;
        return this._client.patch(`/accounts/${account_id}/gateway/lists/${listId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetch a single Zero Trust list.
       *
       * @example
       * ```ts
       * const gatewayList =
       *   await client.zeroTrust.gateway.lists.get(
       *     'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *     { account_id: '699d98642c564d2e855e9661899b7252' },
       *   );
       * ```
       */
      get(listId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/gateway/lists/${listId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    GatewayListsSinglePage = class extends SinglePage {
      static {
        __name(this, "GatewayListsSinglePage");
      }
    };
    Lists2.GatewayListsSinglePage = GatewayListsSinglePage;
    Lists2.Items = Items2;
    Lists2.ItemListResponsesSinglePage = ItemListResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/gateway/gateway.mjs
var Gateway;
var init_gateway = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/gateway/gateway.mjs"() {
    init_import_meta_url();
    init_resource();
    init_app_types();
    init_app_types();
    init_audit_ssh_settings();
    init_audit_ssh_settings();
    init_categories2();
    init_categories2();
    init_certificates5();
    init_certificates5();
    init_locations6();
    init_locations6();
    init_logging();
    init_logging();
    init_proxy_endpoints();
    init_proxy_endpoints();
    init_rules13();
    init_rules13();
    init_configurations2();
    init_configurations2();
    init_lists2();
    init_lists2();
    Gateway = class extends APIResource {
      static {
        __name(this, "Gateway");
      }
      constructor() {
        super(...arguments);
        this.auditSSHSettings = new AuditSSHSettings(this._client);
        this.categories = new Categories2(this._client);
        this.appTypes = new AppTypes(this._client);
        this.configurations = new Configurations2(this._client);
        this.lists = new Lists2(this._client);
        this.locations = new Locations6(this._client);
        this.logging = new Logging(this._client);
        this.proxyEndpoints = new ProxyEndpoints(this._client);
        this.rules = new Rules12(this._client);
        this.certificates = new Certificates5(this._client);
      }
      /**
       * Create a Zero Trust account for an existing Cloudflare account.
       *
       * @example
       * ```ts
       * const gateway = await client.zeroTrust.gateway.create({
       *   account_id: '699d98642c564d2e855e9661899b7252',
       * });
       * ```
       */
      create(params, options) {
        const { account_id } = params;
        return this._client.post(`/accounts/${account_id}/gateway`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Retrieve information about the current Zero Trust account.
       *
       * @example
       * ```ts
       * const gateways = await client.zeroTrust.gateway.list({
       *   account_id: '699d98642c564d2e855e9661899b7252',
       * });
       * ```
       */
      list(params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/gateway`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    Gateway.AuditSSHSettings = AuditSSHSettings;
    Gateway.Categories = Categories2;
    Gateway.CategoriesSinglePage = CategoriesSinglePage;
    Gateway.AppTypes = AppTypes;
    Gateway.AppTypesSinglePage = AppTypesSinglePage;
    Gateway.Configurations = Configurations2;
    Gateway.Lists = Lists2;
    Gateway.GatewayListsSinglePage = GatewayListsSinglePage;
    Gateway.Locations = Locations6;
    Gateway.LocationsSinglePage = LocationsSinglePage;
    Gateway.Logging = Logging;
    Gateway.ProxyEndpoints = ProxyEndpoints;
    Gateway.ProxyEndpointsSinglePage = ProxyEndpointsSinglePage;
    Gateway.Rules = Rules12;
    Gateway.GatewayRulesSinglePage = GatewayRulesSinglePage;
    Gateway.Certificates = Certificates5;
    Gateway.CertificateListResponsesSinglePage = CertificateListResponsesSinglePage2;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/identity-providers/scim/groups.mjs
var Groups3;
var init_groups3 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/identity-providers/scim/groups.mjs"() {
    init_import_meta_url();
    init_resource();
    init_groups2();
    Groups3 = class extends APIResource {
      static {
        __name(this, "Groups");
      }
      /**
       * Lists SCIM Group resources synced to Cloudflare via the System for Cross-domain
       * Identity Management (SCIM).
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const zeroTrustGroup of client.zeroTrust.identityProviders.scim.groups.list(
       *   'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(identityProviderId, params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/access/identity_providers/${identityProviderId}/scim/groups`, ZeroTrustGroupsV4PagePaginationArray, { query, ...options });
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/identity-providers/scim/users.mjs
var Users3;
var init_users3 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/identity-providers/scim/users.mjs"() {
    init_import_meta_url();
    init_resource();
    init_users2();
    Users3 = class extends APIResource {
      static {
        __name(this, "Users");
      }
      /**
       * Lists SCIM User resources synced to Cloudflare via the System for Cross-domain
       * Identity Management (SCIM).
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const accessUser of client.zeroTrust.identityProviders.scim.users.list(
       *   'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(identityProviderId, params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/access/identity_providers/${identityProviderId}/scim/users`, AccessUsersV4PagePaginationArray, { query, ...options });
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/identity-providers/scim/scim.mjs
var SCIM2;
var init_scim2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/identity-providers/scim/scim.mjs"() {
    init_import_meta_url();
    init_resource();
    init_groups3();
    init_groups3();
    init_users3();
    init_users3();
    SCIM2 = class extends APIResource {
      static {
        __name(this, "SCIM");
      }
      constructor() {
        super(...arguments);
        this.groups = new Groups3(this._client);
        this.users = new Users3(this._client);
      }
    };
    SCIM2.Groups = Groups3;
    SCIM2.Users = Users3;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/identity-providers/identity-providers.mjs
var IdentityProviders, IdentityProviderListResponsesV4PagePaginationArray;
var init_identity_providers = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/identity-providers/identity-providers.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    init_scim2();
    init_scim2();
    init_error4();
    init_pagination();
    IdentityProviders = class extends APIResource {
      static {
        __name(this, "IdentityProviders");
      }
      constructor() {
        super(...arguments);
        this.scim = new SCIM2(this._client);
      }
      /**
       * Adds a new identity provider to Access.
       *
       * @example
       * ```ts
       * const identityProvider =
       *   await client.zeroTrust.identityProviders.create({
       *     config: {},
       *     name: 'Widget Corps IDP',
       *     type: 'onetimepin',
       *     account_id: 'account_id',
       *   });
       * ```
       */
      create(params, options) {
        const { account_id, zone_id, ...body } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.post(`/${accountOrZone}/${accountOrZoneId}/access/identity_providers`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Updates a configured identity provider.
       *
       * @example
       * ```ts
       * const identityProvider =
       *   await client.zeroTrust.identityProviders.update(
       *     'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
       *     {
       *       config: {},
       *       name: 'Widget Corps IDP',
       *       type: 'onetimepin',
       *       account_id: 'account_id',
       *     },
       *   );
       * ```
       */
      update(identityProviderId, params, options) {
        const { account_id, zone_id, ...body } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.put(`/${accountOrZone}/${accountOrZoneId}/access/identity_providers/${identityProviderId}`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      list(params = {}, options) {
        if (isRequestOptions(params)) {
          return this.list({}, params);
        }
        const { account_id, zone_id, ...query } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.getAPIList(`/${accountOrZone}/${accountOrZoneId}/access/identity_providers`, IdentityProviderListResponsesV4PagePaginationArray, { query, ...options });
      }
      delete(identityProviderId, params = {}, options) {
        if (isRequestOptions(params)) {
          return this.delete(identityProviderId, {}, params);
        }
        const { account_id, zone_id } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.delete(`/${accountOrZone}/${accountOrZoneId}/access/identity_providers/${identityProviderId}`, options)._thenUnwrap((obj) => obj.result);
      }
      get(identityProviderId, params = {}, options) {
        if (isRequestOptions(params)) {
          return this.get(identityProviderId, {}, params);
        }
        const { account_id, zone_id } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.get(`/${accountOrZone}/${accountOrZoneId}/access/identity_providers/${identityProviderId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    IdentityProviderListResponsesV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "IdentityProviderListResponsesV4PagePaginationArray");
      }
    };
    IdentityProviders.IdentityProviderListResponsesV4PagePaginationArray = IdentityProviderListResponsesV4PagePaginationArray;
    IdentityProviders.SCIM = SCIM2;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/networks/hostname-routes.mjs
var HostnameRoutes, HostnameRoutesV4PagePaginationArray;
var init_hostname_routes = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/networks/hostname-routes.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    HostnameRoutes = class extends APIResource {
      static {
        __name(this, "HostnameRoutes");
      }
      /**
       * Create a hostname route.
       *
       * @example
       * ```ts
       * const hostnameRoute =
       *   await client.zeroTrust.networks.hostnameRoutes.create({
       *     account_id: '699d98642c564d2e855e9661899b7252',
       *   });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/zerotrust/routes/hostname`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Lists and filters hostname routes in an account.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const hostnameRoute of client.zeroTrust.networks.hostnameRoutes.list(
       *   { account_id: '699d98642c564d2e855e9661899b7252' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/zerotrust/routes/hostname`, HostnameRoutesV4PagePaginationArray, { query, ...options });
      }
      /**
       * Delete a hostname route.
       *
       * @example
       * ```ts
       * const hostnameRoute =
       *   await client.zeroTrust.networks.hostnameRoutes.delete(
       *     'f70ff985-a4ef-4643-bbbc-4a0ed4fc8415',
       *     { account_id: '699d98642c564d2e855e9661899b7252' },
       *   );
       * ```
       */
      delete(hostnameRouteId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/zerotrust/routes/hostname/${hostnameRouteId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Updates a hostname route.
       *
       * @example
       * ```ts
       * const hostnameRoute =
       *   await client.zeroTrust.networks.hostnameRoutes.edit(
       *     'f70ff985-a4ef-4643-bbbc-4a0ed4fc8415',
       *     { account_id: '699d98642c564d2e855e9661899b7252' },
       *   );
       * ```
       */
      edit(hostnameRouteId, params, options) {
        const { account_id, ...body } = params;
        return this._client.patch(`/accounts/${account_id}/zerotrust/routes/hostname/${hostnameRouteId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get a hostname route.
       *
       * @example
       * ```ts
       * const hostnameRoute =
       *   await client.zeroTrust.networks.hostnameRoutes.get(
       *     'f70ff985-a4ef-4643-bbbc-4a0ed4fc8415',
       *     { account_id: '699d98642c564d2e855e9661899b7252' },
       *   );
       * ```
       */
      get(hostnameRouteId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/zerotrust/routes/hostname/${hostnameRouteId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    HostnameRoutesV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "HostnameRoutesV4PagePaginationArray");
      }
    };
    HostnameRoutes.HostnameRoutesV4PagePaginationArray = HostnameRoutesV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/networks/virtual-networks.mjs
var VirtualNetworks, VirtualNetworksSinglePage;
var init_virtual_networks = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/networks/virtual-networks.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    VirtualNetworks = class extends APIResource {
      static {
        __name(this, "VirtualNetworks");
      }
      /**
       * Adds a new virtual network to an account.
       *
       * @example
       * ```ts
       * const virtualNetwork =
       *   await client.zeroTrust.networks.virtualNetworks.create({
       *     account_id: '699d98642c564d2e855e9661899b7252',
       *     name: 'us-east-1-vpc',
       *   });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/teamnet/virtual_networks`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Lists and filters virtual networks in an account.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const virtualNetwork of client.zeroTrust.networks.virtualNetworks.list(
       *   { account_id: '699d98642c564d2e855e9661899b7252' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/teamnet/virtual_networks`, VirtualNetworksSinglePage, { query, ...options });
      }
      /**
       * Deletes an existing virtual network.
       *
       * @example
       * ```ts
       * const virtualNetwork =
       *   await client.zeroTrust.networks.virtualNetworks.delete(
       *     'f70ff985-a4ef-4643-bbbc-4a0ed4fc8415',
       *     { account_id: '699d98642c564d2e855e9661899b7252' },
       *   );
       * ```
       */
      delete(virtualNetworkId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/teamnet/virtual_networks/${virtualNetworkId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Updates an existing virtual network.
       *
       * @example
       * ```ts
       * const virtualNetwork =
       *   await client.zeroTrust.networks.virtualNetworks.edit(
       *     'f70ff985-a4ef-4643-bbbc-4a0ed4fc8415',
       *     { account_id: '699d98642c564d2e855e9661899b7252' },
       *   );
       * ```
       */
      edit(virtualNetworkId, params, options) {
        const { account_id, ...body } = params;
        return this._client.patch(`/accounts/${account_id}/teamnet/virtual_networks/${virtualNetworkId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get a virtual network.
       *
       * @example
       * ```ts
       * const virtualNetwork =
       *   await client.zeroTrust.networks.virtualNetworks.get(
       *     'f70ff985-a4ef-4643-bbbc-4a0ed4fc8415',
       *     { account_id: '699d98642c564d2e855e9661899b7252' },
       *   );
       * ```
       */
      get(virtualNetworkId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/teamnet/virtual_networks/${virtualNetworkId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    VirtualNetworksSinglePage = class extends SinglePage {
      static {
        __name(this, "VirtualNetworksSinglePage");
      }
    };
    VirtualNetworks.VirtualNetworksSinglePage = VirtualNetworksSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/networks/routes/ips.mjs
var IPs5;
var init_ips5 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/networks/routes/ips.mjs"() {
    init_import_meta_url();
    init_resource();
    IPs5 = class extends APIResource {
      static {
        __name(this, "IPs");
      }
      /**
       * Fetches routes that contain the given IP address.
       *
       * @example
       * ```ts
       * const teamnet =
       *   await client.zeroTrust.networks.routes.ips.get(
       *     '10.1.0.137',
       *     { account_id: '699d98642c564d2e855e9661899b7252' },
       *   );
       * ```
       */
      get(ip, params, options) {
        const { account_id, ...query } = params;
        return this._client.get(`/accounts/${account_id}/teamnet/routes/ip/${ip}`, {
          query,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/networks/routes/networks.mjs
var Networks2;
var init_networks2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/networks/routes/networks.mjs"() {
    init_import_meta_url();
    init_resource();
    Networks2 = class extends APIResource {
      static {
        __name(this, "Networks");
      }
      /**
       * Routes a private network through a Cloudflare Tunnel. The CIDR in
       * `ip_network_encoded` must be written in URL-encoded format.
       *
       * @deprecated This endpoint and its related APIs are deprecated in favor of the equivalent Tunnel Route (without CIDR) APIs.
       */
      create(ipNetworkEncoded, params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/teamnet/routes/network/${ipNetworkEncoded}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Deletes a private network route from an account. The CIDR in
       * `ip_network_encoded` must be written in URL-encoded format. If no
       * virtual_network_id is provided it will delete the route from the default vnet.
       * If no tun_type is provided it will fetch the type from the tunnel_id or if that
       * is missing it will assume Cloudflare Tunnel as default. If tunnel_id is provided
       * it will delete the route from that tunnel, otherwise it will delete the route
       * based on the vnet and tun_type.
       *
       * @deprecated This endpoint and its related APIs are deprecated in favor of the equivalent Tunnel Route (without CIDR) APIs.
       */
      delete(ipNetworkEncoded, params, options) {
        const { account_id, tun_type, tunnel_id, virtual_network_id } = params;
        return this._client.delete(`/accounts/${account_id}/teamnet/routes/network/${ipNetworkEncoded}`, {
          query: { tun_type, tunnel_id, virtual_network_id },
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Updates an existing private network route in an account. The CIDR in
       * `ip_network_encoded` must be written in URL-encoded format.
       *
       * @deprecated This endpoint and its related APIs are deprecated in favor of the equivalent Tunnel Route (without CIDR) APIs.
       */
      edit(ipNetworkEncoded, params, options) {
        const { account_id } = params;
        return this._client.patch(`/accounts/${account_id}/teamnet/routes/network/${ipNetworkEncoded}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/networks/routes/routes.mjs
var Routes4, TeamnetsV4PagePaginationArray;
var init_routes4 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/networks/routes/routes.mjs"() {
    init_import_meta_url();
    init_resource();
    init_ips5();
    init_ips5();
    init_networks2();
    init_networks2();
    init_pagination();
    Routes4 = class extends APIResource {
      static {
        __name(this, "Routes");
      }
      constructor() {
        super(...arguments);
        this.ips = new IPs5(this._client);
        this.networks = new Networks2(this._client);
      }
      /**
       * Routes a private network through a Cloudflare Tunnel.
       *
       * @example
       * ```ts
       * const route = await client.zeroTrust.networks.routes.create(
       *   {
       *     account_id: '699d98642c564d2e855e9661899b7252',
       *     network: '172.16.0.0/16',
       *     tunnel_id: 'f70ff985-a4ef-4643-bbbc-4a0ed4fc8415',
       *   },
       * );
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/teamnet/routes`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Lists and filters private network routes in an account.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const teamnet of client.zeroTrust.networks.routes.list(
       *   { account_id: '699d98642c564d2e855e9661899b7252' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/teamnet/routes`, TeamnetsV4PagePaginationArray, {
          query,
          ...options
        });
      }
      /**
       * Deletes a private network route from an account.
       *
       * @example
       * ```ts
       * const route = await client.zeroTrust.networks.routes.delete(
       *   'f70ff985-a4ef-4643-bbbc-4a0ed4fc8415',
       *   { account_id: '699d98642c564d2e855e9661899b7252' },
       * );
       * ```
       */
      delete(routeId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/teamnet/routes/${routeId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Updates an existing private network route in an account. The fields that are
       * meant to be updated should be provided in the body of the request.
       *
       * @example
       * ```ts
       * const route = await client.zeroTrust.networks.routes.edit(
       *   'f70ff985-a4ef-4643-bbbc-4a0ed4fc8415',
       *   { account_id: '699d98642c564d2e855e9661899b7252' },
       * );
       * ```
       */
      edit(routeId, params, options) {
        const { account_id, ...body } = params;
        return this._client.patch(`/accounts/${account_id}/teamnet/routes/${routeId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get a private network route in an account.
       *
       * @example
       * ```ts
       * const route = await client.zeroTrust.networks.routes.get(
       *   'f70ff985-a4ef-4643-bbbc-4a0ed4fc8415',
       *   { account_id: '699d98642c564d2e855e9661899b7252' },
       * );
       * ```
       */
      get(routeId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/teamnet/routes/${routeId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    TeamnetsV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "TeamnetsV4PagePaginationArray");
      }
    };
    Routes4.TeamnetsV4PagePaginationArray = TeamnetsV4PagePaginationArray;
    Routes4.IPs = IPs5;
    Routes4.Networks = Networks2;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/networks/subnets/cloudflare-source.mjs
var CloudflareSource;
var init_cloudflare_source = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/networks/subnets/cloudflare-source.mjs"() {
    init_import_meta_url();
    init_resource();
    CloudflareSource = class extends APIResource {
      static {
        __name(this, "CloudflareSource");
      }
      /**
       * Updates the Cloudflare Source subnet of the given address family
       *
       * @example
       * ```ts
       * const cloudflareSource =
       *   await client.zeroTrust.networks.subnets.cloudflareSource.update(
       *     'v4',
       *     { account_id: '699d98642c564d2e855e9661899b7252' },
       *   );
       * ```
       */
      update(addressFamily, params, options) {
        const { account_id, ...body } = params;
        return this._client.patch(`/accounts/${account_id}/zerotrust/subnets/cloudflare_source/${addressFamily}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/networks/subnets/subnets.mjs
var Subnets2, SubnetListResponsesV4PagePaginationArray;
var init_subnets2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/networks/subnets/subnets.mjs"() {
    init_import_meta_url();
    init_resource();
    init_cloudflare_source();
    init_cloudflare_source();
    init_pagination();
    Subnets2 = class extends APIResource {
      static {
        __name(this, "Subnets");
      }
      constructor() {
        super(...arguments);
        this.cloudflareSource = new CloudflareSource(this._client);
      }
      /**
       * Lists and filters subnets in an account.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const subnetListResponse of client.zeroTrust.networks.subnets.list(
       *   { account_id: '699d98642c564d2e855e9661899b7252' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/zerotrust/subnets`, SubnetListResponsesV4PagePaginationArray, { query, ...options });
      }
    };
    SubnetListResponsesV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "SubnetListResponsesV4PagePaginationArray");
      }
    };
    Subnets2.SubnetListResponsesV4PagePaginationArray = SubnetListResponsesV4PagePaginationArray;
    Subnets2.CloudflareSource = CloudflareSource;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/networks/networks.mjs
var Networks3;
var init_networks3 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/networks/networks.mjs"() {
    init_import_meta_url();
    init_resource();
    init_hostname_routes();
    init_hostname_routes();
    init_virtual_networks();
    init_virtual_networks();
    init_routes4();
    init_routes4();
    init_subnets2();
    init_subnets2();
    Networks3 = class extends APIResource {
      static {
        __name(this, "Networks");
      }
      constructor() {
        super(...arguments);
        this.routes = new Routes4(this._client);
        this.virtualNetworks = new VirtualNetworks(this._client);
        this.subnets = new Subnets2(this._client);
        this.hostnameRoutes = new HostnameRoutes(this._client);
      }
    };
    Networks3.Routes = Routes4;
    Networks3.TeamnetsV4PagePaginationArray = TeamnetsV4PagePaginationArray;
    Networks3.VirtualNetworks = VirtualNetworks;
    Networks3.VirtualNetworksSinglePage = VirtualNetworksSinglePage;
    Networks3.Subnets = Subnets2;
    Networks3.SubnetListResponsesV4PagePaginationArray = SubnetListResponsesV4PagePaginationArray;
    Networks3.HostnameRoutes = HostnameRoutes;
    Networks3.HostnameRoutesV4PagePaginationArray = HostnameRoutesV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/organizations/doh.mjs
var DOH;
var init_doh = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/organizations/doh.mjs"() {
    init_import_meta_url();
    init_resource();
    DOH = class extends APIResource {
      static {
        __name(this, "DOH");
      }
      /**
       * Updates the DoH settings for your Zero Trust organization.
       *
       * @example
       * ```ts
       * const doh = await client.zeroTrust.organizations.doh.update(
       *   { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      update(params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/access/organizations/doh`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Returns the DoH settings for your Zero Trust organization.
       *
       * @example
       * ```ts
       * const doh = await client.zeroTrust.organizations.doh.get({
       *   account_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      get(params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/access/organizations/doh`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/organizations/organizations.mjs
var Organizations2;
var init_organizations2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/organizations/organizations.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    init_doh();
    init_doh();
    init_error4();
    Organizations2 = class extends APIResource {
      static {
        __name(this, "Organizations");
      }
      constructor() {
        super(...arguments);
        this.doh = new DOH(this._client);
      }
      /**
       * Sets up a Zero Trust organization for your account or zone.
       *
       * @example
       * ```ts
       * const organization =
       *   await client.zeroTrust.organizations.create({
       *     auth_domain: 'test.cloudflareaccess.com',
       *     name: 'Widget Corps Internal Applications',
       *     account_id: 'account_id',
       *   });
       * ```
       */
      create(params, options) {
        const { account_id, zone_id, ...body } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.post(`/${accountOrZone}/${accountOrZoneId}/access/organizations`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Updates the configuration for your Zero Trust organization.
       *
       * @example
       * ```ts
       * const organization =
       *   await client.zeroTrust.organizations.update({
       *     account_id: 'account_id',
       *   });
       * ```
       */
      update(params, options) {
        const { account_id, zone_id, ...body } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.put(`/${accountOrZone}/${accountOrZoneId}/access/organizations`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      list(params = {}, options) {
        if (isRequestOptions(params)) {
          return this.list({}, params);
        }
        const { account_id, zone_id } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.get(`/${accountOrZone}/${accountOrZoneId}/access/organizations`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Revokes a user's access across all applications.
       *
       * @example
       * ```ts
       * const response =
       *   await client.zeroTrust.organizations.revokeUsers({
       *     email: 'test@example.com',
       *     account_id: 'account_id',
       *   });
       * ```
       */
      revokeUsers(params, options) {
        const { account_id, zone_id, query_devices, ...body } = params;
        if (!account_id && !zone_id) {
          throw new CloudflareError("You must provide either account_id or zone_id.");
        }
        if (account_id && zone_id) {
          throw new CloudflareError("You cannot provide both account_id and zone_id.");
        }
        const { accountOrZone, accountOrZoneId } = account_id ? {
          accountOrZone: "accounts",
          accountOrZoneId: account_id
        } : {
          accountOrZone: "zones",
          accountOrZoneId: zone_id
        };
        return this._client.post(`/${accountOrZone}/${accountOrZoneId}/access/organizations/revoke_user`, {
          query: { devices: query_devices },
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
    Organizations2.DOH = DOH;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/risk-scoring/behaviours.mjs
var Behaviours;
var init_behaviours = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/risk-scoring/behaviours.mjs"() {
    init_import_meta_url();
    init_resource();
    Behaviours = class extends APIResource {
      static {
        __name(this, "Behaviours");
      }
      /**
       * Update configuration for risk behaviors
       *
       * @example
       * ```ts
       * const behaviour =
       *   await client.zeroTrust.riskScoring.behaviours.update({
       *     account_id: 'account_id',
       *     behaviors: {
       *       foo: { enabled: true, risk_level: 'low' },
       *     },
       *   });
       * ```
       */
      update(params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/zt_risk_scoring/behaviors`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get all behaviors and associated configuration
       *
       * @example
       * ```ts
       * const behaviour =
       *   await client.zeroTrust.riskScoring.behaviours.get({
       *     account_id: 'account_id',
       *   });
       * ```
       */
      get(params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/zt_risk_scoring/behaviors`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/risk-scoring/summary.mjs
var Summary12;
var init_summary12 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/risk-scoring/summary.mjs"() {
    init_import_meta_url();
    init_resource();
    Summary12 = class extends APIResource {
      static {
        __name(this, "Summary");
      }
      /**
       * Get risk score info for all users in the account
       *
       * @example
       * ```ts
       * const summary =
       *   await client.zeroTrust.riskScoring.summary.get({
       *     account_id: 'account_id',
       *   });
       * ```
       */
      get(params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/zt_risk_scoring/summary`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/risk-scoring/integrations/references.mjs
var References3;
var init_references3 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/risk-scoring/integrations/references.mjs"() {
    init_import_meta_url();
    init_resource();
    References3 = class extends APIResource {
      static {
        __name(this, "References");
      }
      /**
       * Get risk score integration by reference id.
       *
       * @example
       * ```ts
       * const reference =
       *   await client.zeroTrust.riskScoring.integrations.references.get(
       *     'reference_id',
       *     { account_id: 'account_id' },
       *   );
       * ```
       */
      get(referenceId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/zt_risk_scoring/integrations/reference_id/${referenceId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/risk-scoring/integrations/integrations.mjs
var Integrations2, IntegrationListResponsesSinglePage2;
var init_integrations2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/risk-scoring/integrations/integrations.mjs"() {
    init_import_meta_url();
    init_resource();
    init_references3();
    init_references3();
    init_pagination();
    Integrations2 = class extends APIResource {
      static {
        __name(this, "Integrations");
      }
      constructor() {
        super(...arguments);
        this.references = new References3(this._client);
      }
      /**
       * Create new risk score integration.
       *
       * @example
       * ```ts
       * const integration =
       *   await client.zeroTrust.riskScoring.integrations.create({
       *     account_id: 'account_id',
       *     integration_type: 'Okta',
       *     tenant_url: 'https://example.com',
       *   });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/zt_risk_scoring/integrations`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Overwrite the reference_id, tenant_url, and active values with the ones
       * provided.
       *
       * @example
       * ```ts
       * const integration =
       *   await client.zeroTrust.riskScoring.integrations.update(
       *     '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
       *     {
       *       account_id: 'account_id',
       *       active: true,
       *       tenant_url: 'https://example.com',
       *     },
       *   );
       * ```
       */
      update(integrationId, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/zt_risk_scoring/integrations/${integrationId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * List all risk score integrations for the account.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const integrationListResponse of client.zeroTrust.riskScoring.integrations.list(
       *   { account_id: 'account_id' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/zt_risk_scoring/integrations`, IntegrationListResponsesSinglePage2, options);
      }
      /**
       * Delete a risk score integration.
       *
       * @example
       * ```ts
       * const integration =
       *   await client.zeroTrust.riskScoring.integrations.delete(
       *     '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
       *     { account_id: 'account_id' },
       *   );
       * ```
       */
      delete(integrationId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/zt_risk_scoring/integrations/${integrationId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Get risk score integration by id.
       *
       * @example
       * ```ts
       * const integration =
       *   await client.zeroTrust.riskScoring.integrations.get(
       *     '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
       *     { account_id: 'account_id' },
       *   );
       * ```
       */
      get(integrationId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/zt_risk_scoring/integrations/${integrationId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    IntegrationListResponsesSinglePage2 = class extends SinglePage {
      static {
        __name(this, "IntegrationListResponsesSinglePage");
      }
    };
    Integrations2.IntegrationListResponsesSinglePage = IntegrationListResponsesSinglePage2;
    Integrations2.References = References3;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/risk-scoring/risk-scoring.mjs
var RiskScoring;
var init_risk_scoring = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/risk-scoring/risk-scoring.mjs"() {
    init_import_meta_url();
    init_resource();
    init_behaviours();
    init_behaviours();
    init_summary12();
    init_summary12();
    init_integrations2();
    init_integrations2();
    RiskScoring = class extends APIResource {
      static {
        __name(this, "RiskScoring");
      }
      constructor() {
        super(...arguments);
        this.behaviours = new Behaviours(this._client);
        this.summary = new Summary12(this._client);
        this.integrations = new Integrations2(this._client);
      }
      /**
       * Get risk event/score information for a specific user
       *
       * @example
       * ```ts
       * const riskScoring = await client.zeroTrust.riskScoring.get(
       *   '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
       *   { account_id: 'account_id' },
       * );
       * ```
       */
      get(userId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/zt_risk_scoring/${userId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Clear the risk score for a particular user
       *
       * @example
       * ```ts
       * const response = await client.zeroTrust.riskScoring.reset(
       *   '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
       *   { account_id: 'account_id' },
       * );
       * ```
       */
      reset(userId, params, options) {
        const { account_id } = params;
        return this._client.post(`/accounts/${account_id}/zt_risk_scoring/${userId}/reset`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    RiskScoring.Behaviours = Behaviours;
    RiskScoring.Summary = Summary12;
    RiskScoring.Integrations = Integrations2;
    RiskScoring.IntegrationListResponsesSinglePage = IntegrationListResponsesSinglePage2;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/tunnels/cloudflared/configurations.mjs
var Configurations3;
var init_configurations3 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/tunnels/cloudflared/configurations.mjs"() {
    init_import_meta_url();
    init_resource();
    Configurations3 = class extends APIResource {
      static {
        __name(this, "Configurations");
      }
      /**
       * Adds or updates the configuration for a remotely-managed tunnel.
       *
       * @example
       * ```ts
       * const configuration =
       *   await client.zeroTrust.tunnels.cloudflared.configurations.update(
       *     'f70ff985-a4ef-4643-bbbc-4a0ed4fc8415',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      update(tunnelId, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/cfd_tunnel/${tunnelId}/configurations`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Gets the configuration for a remotely-managed tunnel
       *
       * @example
       * ```ts
       * const configuration =
       *   await client.zeroTrust.tunnels.cloudflared.configurations.get(
       *     'f70ff985-a4ef-4643-bbbc-4a0ed4fc8415',
       *     { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       *   );
       * ```
       */
      get(tunnelId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/cfd_tunnel/${tunnelId}/configurations`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/tunnels/cloudflared/connections.mjs
var Connections2, ClientsSinglePage;
var init_connections2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/tunnels/cloudflared/connections.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Connections2 = class extends APIResource {
      static {
        __name(this, "Connections");
      }
      /**
       * Removes a connection (aka Cloudflare Tunnel Connector) from a Cloudflare Tunnel
       * independently of its current state. If no connector id (client_id) is provided
       * all connectors will be removed. We recommend running this command after rotating
       * tokens.
       *
       * @example
       * ```ts
       * const connection =
       *   await client.zeroTrust.tunnels.cloudflared.connections.delete(
       *     'f70ff985-a4ef-4643-bbbc-4a0ed4fc8415',
       *     { account_id: '699d98642c564d2e855e9661899b7252' },
       *   );
       * ```
       */
      delete(tunnelId, params, options) {
        const { account_id, client_id } = params;
        return this._client.delete(`/accounts/${account_id}/cfd_tunnel/${tunnelId}/connections`, {
          query: { client_id },
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetches connection details for a Cloudflare Tunnel.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const client of client.zeroTrust.tunnels.cloudflared.connections.get(
       *   'f70ff985-a4ef-4643-bbbc-4a0ed4fc8415',
       *   { account_id: '699d98642c564d2e855e9661899b7252' },
       * )) {
       *   // ...
       * }
       * ```
       */
      get(tunnelId, params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/cfd_tunnel/${tunnelId}/connections`, ClientsSinglePage, options);
      }
    };
    ClientsSinglePage = class extends SinglePage {
      static {
        __name(this, "ClientsSinglePage");
      }
    };
    Connections2.ClientsSinglePage = ClientsSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/tunnels/cloudflared/connectors.mjs
var Connectors2;
var init_connectors2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/tunnels/cloudflared/connectors.mjs"() {
    init_import_meta_url();
    init_resource();
    Connectors2 = class extends APIResource {
      static {
        __name(this, "Connectors");
      }
      /**
       * Fetches connector and connection details for a Cloudflare Tunnel.
       *
       * @example
       * ```ts
       * const client =
       *   await client.zeroTrust.tunnels.cloudflared.connectors.get(
       *     'f70ff985-a4ef-4643-bbbc-4a0ed4fc8415',
       *     '1bedc50d-42b3-473c-b108-ff3d10c0d925',
       *     { account_id: '699d98642c564d2e855e9661899b7252' },
       *   );
       * ```
       */
      get(tunnelId, connectorId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/cfd_tunnel/${tunnelId}/connectors/${connectorId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/tunnels/cloudflared/management.mjs
var Management;
var init_management = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/tunnels/cloudflared/management.mjs"() {
    init_import_meta_url();
    init_resource();
    Management = class extends APIResource {
      static {
        __name(this, "Management");
      }
      /**
       * Gets a management token used to access the management resources (i.e. Streaming
       * Logs) of a tunnel.
       *
       * @example
       * ```ts
       * const management =
       *   await client.zeroTrust.tunnels.cloudflared.management.create(
       *     'f70ff985-a4ef-4643-bbbc-4a0ed4fc8415',
       *     {
       *       account_id: '699d98642c564d2e855e9661899b7252',
       *       resources: ['logs'],
       *     },
       *   );
       * ```
       */
      create(tunnelId, params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/cfd_tunnel/${tunnelId}/management`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/tunnels/cloudflared/token.mjs
var Token2;
var init_token2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/tunnels/cloudflared/token.mjs"() {
    init_import_meta_url();
    init_resource();
    Token2 = class extends APIResource {
      static {
        __name(this, "Token");
      }
      /**
       * Gets the token used to associate cloudflared with a specific tunnel.
       *
       * @example
       * ```ts
       * const token =
       *   await client.zeroTrust.tunnels.cloudflared.token.get(
       *     'f70ff985-a4ef-4643-bbbc-4a0ed4fc8415',
       *     { account_id: '699d98642c564d2e855e9661899b7252' },
       *   );
       * ```
       */
      get(tunnelId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/cfd_tunnel/${tunnelId}/token`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/tunnels/cloudflared/cloudflared.mjs
var Cloudflared, CloudflaredListResponsesV4PagePaginationArray;
var init_cloudflared = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/tunnels/cloudflared/cloudflared.mjs"() {
    init_import_meta_url();
    init_resource();
    init_configurations3();
    init_configurations3();
    init_connections2();
    init_connections2();
    init_connectors2();
    init_connectors2();
    init_management();
    init_management();
    init_token2();
    init_token2();
    init_pagination();
    Cloudflared = class extends APIResource {
      static {
        __name(this, "Cloudflared");
      }
      constructor() {
        super(...arguments);
        this.configurations = new Configurations3(this._client);
        this.connections = new Connections2(this._client);
        this.token = new Token2(this._client);
        this.connectors = new Connectors2(this._client);
        this.management = new Management(this._client);
      }
      /**
       * Creates a new Cloudflare Tunnel in an account.
       *
       * @example
       * ```ts
       * const cloudflared =
       *   await client.zeroTrust.tunnels.cloudflared.create({
       *     account_id: '699d98642c564d2e855e9661899b7252',
       *     name: 'blog',
       *   });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/cfd_tunnel`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Lists and filters Cloudflare Tunnels in an account.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const cloudflaredListResponse of client.zeroTrust.tunnels.cloudflared.list(
       *   { account_id: '699d98642c564d2e855e9661899b7252' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/cfd_tunnel`, CloudflaredListResponsesV4PagePaginationArray, { query, ...options });
      }
      /**
       * Deletes a Cloudflare Tunnel from an account.
       *
       * @example
       * ```ts
       * const cloudflared =
       *   await client.zeroTrust.tunnels.cloudflared.delete(
       *     'f70ff985-a4ef-4643-bbbc-4a0ed4fc8415',
       *     { account_id: '699d98642c564d2e855e9661899b7252' },
       *   );
       * ```
       */
      delete(tunnelId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/cfd_tunnel/${tunnelId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Updates an existing Cloudflare Tunnel.
       *
       * @example
       * ```ts
       * const response =
       *   await client.zeroTrust.tunnels.cloudflared.edit(
       *     'f70ff985-a4ef-4643-bbbc-4a0ed4fc8415',
       *     { account_id: '699d98642c564d2e855e9661899b7252' },
       *   );
       * ```
       */
      edit(tunnelId, params, options) {
        const { account_id, ...body } = params;
        return this._client.patch(`/accounts/${account_id}/cfd_tunnel/${tunnelId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetches a single Cloudflare Tunnel.
       *
       * @example
       * ```ts
       * const cloudflared =
       *   await client.zeroTrust.tunnels.cloudflared.get(
       *     'f70ff985-a4ef-4643-bbbc-4a0ed4fc8415',
       *     { account_id: '699d98642c564d2e855e9661899b7252' },
       *   );
       * ```
       */
      get(tunnelId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/cfd_tunnel/${tunnelId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    CloudflaredListResponsesV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "CloudflaredListResponsesV4PagePaginationArray");
      }
    };
    Cloudflared.CloudflaredListResponsesV4PagePaginationArray = CloudflaredListResponsesV4PagePaginationArray;
    Cloudflared.Configurations = Configurations3;
    Cloudflared.Connections = Connections2;
    Cloudflared.ClientsSinglePage = ClientsSinglePage;
    Cloudflared.Token = Token2;
    Cloudflared.Connectors = Connectors2;
    Cloudflared.Management = Management;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/tunnels/warp-connector/token.mjs
var Token3;
var init_token3 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/tunnels/warp-connector/token.mjs"() {
    init_import_meta_url();
    init_resource();
    Token3 = class extends APIResource {
      static {
        __name(this, "Token");
      }
      /**
       * Gets the token used to associate warp device with a specific Warp Connector
       * tunnel.
       *
       * @example
       * ```ts
       * const token =
       *   await client.zeroTrust.tunnels.warpConnector.token.get(
       *     'f70ff985-a4ef-4643-bbbc-4a0ed4fc8415',
       *     { account_id: '699d98642c564d2e855e9661899b7252' },
       *   );
       * ```
       */
      get(tunnelId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/warp_connector/${tunnelId}/token`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/tunnels/warp-connector/warp-connector.mjs
var WARPConnector, WARPConnectorListResponsesV4PagePaginationArray;
var init_warp_connector = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/tunnels/warp-connector/warp-connector.mjs"() {
    init_import_meta_url();
    init_resource();
    init_token3();
    init_token3();
    init_pagination();
    WARPConnector = class extends APIResource {
      static {
        __name(this, "WARPConnector");
      }
      constructor() {
        super(...arguments);
        this.token = new Token3(this._client);
      }
      /**
       * Creates a new Warp Connector Tunnel in an account.
       *
       * @example
       * ```ts
       * const warpConnector =
       *   await client.zeroTrust.tunnels.warpConnector.create({
       *     account_id: '699d98642c564d2e855e9661899b7252',
       *     name: 'blog',
       *   });
       * ```
       */
      create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/warp_connector`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Lists and filters Warp Connector Tunnels in an account.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const warpConnectorListResponse of client.zeroTrust.tunnels.warpConnector.list(
       *   { account_id: '699d98642c564d2e855e9661899b7252' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/warp_connector`, WARPConnectorListResponsesV4PagePaginationArray, { query, ...options });
      }
      /**
       * Deletes a Warp Connector Tunnel from an account.
       *
       * @example
       * ```ts
       * const warpConnector =
       *   await client.zeroTrust.tunnels.warpConnector.delete(
       *     'f70ff985-a4ef-4643-bbbc-4a0ed4fc8415',
       *     { account_id: '699d98642c564d2e855e9661899b7252' },
       *   );
       * ```
       */
      delete(tunnelId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/warp_connector/${tunnelId}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Updates an existing Warp Connector Tunnel.
       *
       * @example
       * ```ts
       * const response =
       *   await client.zeroTrust.tunnels.warpConnector.edit(
       *     'f70ff985-a4ef-4643-bbbc-4a0ed4fc8415',
       *     { account_id: '699d98642c564d2e855e9661899b7252' },
       *   );
       * ```
       */
      edit(tunnelId, params, options) {
        const { account_id, ...body } = params;
        return this._client.patch(`/accounts/${account_id}/warp_connector/${tunnelId}`, {
          body,
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetches a single Warp Connector Tunnel.
       *
       * @example
       * ```ts
       * const warpConnector =
       *   await client.zeroTrust.tunnels.warpConnector.get(
       *     'f70ff985-a4ef-4643-bbbc-4a0ed4fc8415',
       *     { account_id: '699d98642c564d2e855e9661899b7252' },
       *   );
       * ```
       */
      get(tunnelId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/warp_connector/${tunnelId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    WARPConnectorListResponsesV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "WARPConnectorListResponsesV4PagePaginationArray");
      }
    };
    WARPConnector.WARPConnectorListResponsesV4PagePaginationArray = WARPConnectorListResponsesV4PagePaginationArray;
    WARPConnector.Token = Token3;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/tunnels/tunnels.mjs
var Tunnels, TunnelListResponsesV4PagePaginationArray;
var init_tunnels = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/tunnels/tunnels.mjs"() {
    init_import_meta_url();
    init_resource();
    init_cloudflared();
    init_cloudflared();
    init_warp_connector();
    init_warp_connector();
    init_pagination();
    Tunnels = class extends APIResource {
      static {
        __name(this, "Tunnels");
      }
      constructor() {
        super(...arguments);
        this.cloudflared = new Cloudflared(this._client);
        this.warpConnector = new WARPConnector(this._client);
      }
      /**
       * Lists and filters all types of Tunnels in an account.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const tunnelListResponse of client.zeroTrust.tunnels.list(
       *   { account_id: '699d98642c564d2e855e9661899b7252' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/tunnels`, TunnelListResponsesV4PagePaginationArray, { query, ...options });
      }
    };
    TunnelListResponsesV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "TunnelListResponsesV4PagePaginationArray");
      }
    };
    Tunnels.TunnelListResponsesV4PagePaginationArray = TunnelListResponsesV4PagePaginationArray;
    Tunnels.Cloudflared = Cloudflared;
    Tunnels.CloudflaredListResponsesV4PagePaginationArray = CloudflaredListResponsesV4PagePaginationArray;
    Tunnels.WARPConnector = WARPConnector;
    Tunnels.WARPConnectorListResponsesV4PagePaginationArray = WARPConnectorListResponsesV4PagePaginationArray;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/zero-trust.mjs
var ZeroTrust;
var init_zero_trust = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zero-trust/zero-trust.mjs"() {
    init_import_meta_url();
    init_resource();
    init_connectivity_settings();
    init_connectivity_settings();
    init_seats();
    init_seats();
    init_access2();
    init_access2();
    init_devices2();
    init_devices2();
    init_dex();
    init_dex();
    init_dlp();
    init_dlp();
    init_gateway();
    init_gateway();
    init_identity_providers();
    init_identity_providers();
    init_networks3();
    init_networks3();
    init_organizations2();
    init_organizations2();
    init_risk_scoring();
    init_risk_scoring();
    init_tunnels();
    init_tunnels();
    ZeroTrust = class extends APIResource {
      static {
        __name(this, "ZeroTrust");
      }
      constructor() {
        super(...arguments);
        this.devices = new Devices2(this._client);
        this.identityProviders = new IdentityProviders(this._client);
        this.organizations = new Organizations2(this._client);
        this.seats = new Seats(this._client);
        this.access = new Access(this._client);
        this.dex = new DEX(this._client);
        this.tunnels = new Tunnels(this._client);
        this.connectivitySettings = new ConnectivitySettings(this._client);
        this.dlp = new DLP(this._client);
        this.gateway = new Gateway(this._client);
        this.networks = new Networks3(this._client);
        this.riskScoring = new RiskScoring(this._client);
      }
    };
    ZeroTrust.Devices = Devices2;
    ZeroTrust.DevicesSinglePage = DevicesSinglePage;
    ZeroTrust.IdentityProviders = IdentityProviders;
    ZeroTrust.IdentityProviderListResponsesV4PagePaginationArray = IdentityProviderListResponsesV4PagePaginationArray;
    ZeroTrust.Organizations = Organizations2;
    ZeroTrust.Seats = Seats;
    ZeroTrust.SeatsSinglePage = SeatsSinglePage;
    ZeroTrust.Access = Access;
    ZeroTrust.DEX = DEX;
    ZeroTrust.Tunnels = Tunnels;
    ZeroTrust.TunnelListResponsesV4PagePaginationArray = TunnelListResponsesV4PagePaginationArray;
    ZeroTrust.ConnectivitySettings = ConnectivitySettings;
    ZeroTrust.DLP = DLP;
    ZeroTrust.Gateway = Gateway;
    ZeroTrust.Networks = Networks3;
    ZeroTrust.RiskScoring = RiskScoring;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zones/activation-check.mjs
var ActivationCheck;
var init_activation_check = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zones/activation-check.mjs"() {
    init_import_meta_url();
    init_resource();
    ActivationCheck = class extends APIResource {
      static {
        __name(this, "ActivationCheck");
      }
      /**
       * Triggeres a new activation check for a PENDING Zone. This can be triggered every
       * 5 min for paygo/ent customers, every hour for FREE Zones.
       *
       * @example
       * ```ts
       * const response = await client.zones.activationCheck.trigger(
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      trigger(params, options) {
        const { zone_id } = params;
        return this._client.put(`/zones/${zone_id}/activation_check`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zones/custom-nameservers.mjs
var CustomNameservers2, CustomNameserverUpdateResponsesSinglePage;
var init_custom_nameservers2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zones/custom-nameservers.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    CustomNameservers2 = class extends APIResource {
      static {
        __name(this, "CustomNameservers");
      }
      /**
       * Set metadata for account-level custom nameservers on a zone.
       *
       * If you would like new zones in the account to use account custom nameservers by
       * default, use PUT /accounts/:identifier to set the account setting
       * use_account_custom_ns_by_default to true.
       *
       * Deprecated in favor of
       * [Update DNS Settings](https://developers.cloudflare.com/api/operations/dns-settings-for-a-zone-update-dns-settings).
       *
       * @deprecated Use [DNS settings API](https://developers.cloudflare.com/api/resources/dns/subresources/settings/methods/put/) instead.
       */
      update(params, options) {
        const { zone_id, ...body } = params;
        return this._client.getAPIList(`/zones/${zone_id}/custom_ns`, CustomNameserverUpdateResponsesSinglePage, {
          body,
          method: "put",
          ...options
        });
      }
      /**
       * Get metadata for account-level custom nameservers on a zone.
       *
       * Deprecated in favor of
       * [Show DNS Settings](https://developers.cloudflare.com/api/operations/dns-settings-for-a-zone-list-dns-settings).
       *
       * @deprecated Use [DNS settings API](https://developers.cloudflare.com/api/resources/dns/subresources/settings/methods/get/) instead.
       */
      get(params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/custom_ns`, options);
      }
    };
    CustomNameserverUpdateResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "CustomNameserverUpdateResponsesSinglePage");
      }
    };
    CustomNameservers2.CustomNameserverUpdateResponsesSinglePage = CustomNameserverUpdateResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zones/holds.mjs
var Holds;
var init_holds = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zones/holds.mjs"() {
    init_import_meta_url();
    init_resource();
    Holds = class extends APIResource {
      static {
        __name(this, "Holds");
      }
      /**
       * Enforce a zone hold on the zone, blocking the creation and activation of zones
       * with this zone's hostname.
       *
       * @example
       * ```ts
       * const zoneHold = await client.zones.holds.create({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      create(params, options) {
        const { zone_id, include_subdomains } = params;
        return this._client.post(`/zones/${zone_id}/hold`, {
          query: { include_subdomains },
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Stop enforcement of a zone hold on the zone, permanently or temporarily,
       * allowing the creation and activation of zones with this zone's hostname.
       *
       * @example
       * ```ts
       * const zoneHold = await client.zones.holds.delete({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      delete(params, options) {
        const { zone_id, hold_after } = params;
        return this._client.delete(`/zones/${zone_id}/hold`, {
          query: { hold_after },
          ...options
        })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Update the `hold_after` and/or `include_subdomains` values on an existing zone
       * hold. The hold is enabled if the `hold_after` date-time value is in the past.
       *
       * @example
       * ```ts
       * const zoneHold = await client.zones.holds.edit({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      edit(params, options) {
        const { zone_id, ...body } = params;
        return this._client.patch(`/zones/${zone_id}/hold`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Retrieve whether the zone is subject to a zone hold, and metadata about the
       * hold.
       *
       * @example
       * ```ts
       * const zoneHold = await client.zones.holds.get({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      get(params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/hold`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zones/plans.mjs
var Plans, AvailableRatePlansSinglePage;
var init_plans = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zones/plans.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    Plans = class extends APIResource {
      static {
        __name(this, "Plans");
      }
      /**
       * Lists available plans the zone can subscribe to.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const availableRatePlan of client.zones.plans.list(
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      list(params, options) {
        const { zone_id } = params;
        return this._client.getAPIList(`/zones/${zone_id}/available_plans`, AvailableRatePlansSinglePage, options);
      }
      /**
       * Details of the available plan that the zone can subscribe to.
       *
       * @example
       * ```ts
       * const availableRatePlan = await client.zones.plans.get(
       *   '023e105f4ecef8ad9ca31a8372d0c353',
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(planIdentifier, params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/available_plans/${planIdentifier}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    AvailableRatePlansSinglePage = class extends SinglePage {
      static {
        __name(this, "AvailableRatePlansSinglePage");
      }
    };
    Plans.AvailableRatePlansSinglePage = AvailableRatePlansSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zones/rate-plans.mjs
var RatePlans, RatePlanGetResponsesSinglePage;
var init_rate_plans = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zones/rate-plans.mjs"() {
    init_import_meta_url();
    init_resource();
    init_pagination();
    RatePlans = class extends APIResource {
      static {
        __name(this, "RatePlans");
      }
      /**
       * Lists all rate plans the zone can subscribe to.
       *
       * @example
       * ```ts
       * // Automatically fetches more pages as needed.
       * for await (const ratePlanGetResponse of client.zones.ratePlans.get(
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * )) {
       *   // ...
       * }
       * ```
       */
      get(params, options) {
        const { zone_id } = params;
        return this._client.getAPIList(`/zones/${zone_id}/available_rate_plans`, RatePlanGetResponsesSinglePage, options);
      }
    };
    RatePlanGetResponsesSinglePage = class extends SinglePage {
      static {
        __name(this, "RatePlanGetResponsesSinglePage");
      }
    };
    RatePlans.RatePlanGetResponsesSinglePage = RatePlanGetResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zones/settings.mjs
var Settings16;
var init_settings16 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zones/settings.mjs"() {
    init_import_meta_url();
    init_resource();
    Settings16 = class extends APIResource {
      static {
        __name(this, "Settings");
      }
      /**
       * Updates a single zone setting by the identifier
       *
       * @example
       * ```ts
       * const response = await client.zones.settings.edit(
       *   'always_online',
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      edit(settingId, params, options) {
        const { zone_id, ...body } = params;
        return this._client.patch(`/zones/${zone_id}/settings/${settingId}`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Fetch a single zone setting by name
       *
       * @example
       * ```ts
       * const setting = await client.zones.settings.get(
       *   'always_online',
       *   { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
       * );
       * ```
       */
      get(settingId, params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/settings/${settingId}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zones/subscriptions.mjs
var Subscriptions4;
var init_subscriptions4 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zones/subscriptions.mjs"() {
    init_import_meta_url();
    init_resource();
    Subscriptions4 = class extends APIResource {
      static {
        __name(this, "Subscriptions");
      }
      /**
       * Create a zone subscription, either plan or add-ons.
       *
       * @example
       * ```ts
       * const subscription =
       *   await client.zones.subscriptions.create({
       *     zone_id: '506e3185e9c882d175a2d0cb0093d9f2',
       *   });
       * ```
       */
      create(params, options) {
        const { zone_id, ...body } = params;
        return this._client.post(`/zones/${zone_id}/subscription`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Updates zone subscriptions, either plan or add-ons.
       *
       * @example
       * ```ts
       * const subscription =
       *   await client.zones.subscriptions.update({
       *     zone_id: '506e3185e9c882d175a2d0cb0093d9f2',
       *   });
       * ```
       */
      update(params, options) {
        const { zone_id, ...body } = params;
        return this._client.put(`/zones/${zone_id}/subscription`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Lists zone subscription details.
       *
       * @example
       * ```ts
       * const subscription = await client.zones.subscriptions.get({
       *   zone_id: '506e3185e9c882d175a2d0cb0093d9f2',
       * });
       * ```
       */
      get(params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/subscription`, options)._thenUnwrap((obj) => obj.result);
      }
    };
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zones/zones.mjs
var Zones2, ZonesV4PagePaginationArray;
var init_zones2 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/zones/zones.mjs"() {
    init_import_meta_url();
    init_resource();
    init_core2();
    init_activation_check();
    init_activation_check();
    init_custom_nameservers2();
    init_custom_nameservers2();
    init_holds();
    init_holds();
    init_plans();
    init_plans();
    init_rate_plans();
    init_rate_plans();
    init_settings16();
    init_settings16();
    init_subscriptions4();
    init_subscriptions4();
    init_pagination();
    Zones2 = class extends APIResource {
      static {
        __name(this, "Zones");
      }
      constructor() {
        super(...arguments);
        this.activationCheck = new ActivationCheck(this._client);
        this.settings = new Settings16(this._client);
        this.customNameservers = new CustomNameservers2(this._client);
        this.holds = new Holds(this._client);
        this.subscriptions = new Subscriptions4(this._client);
        this.plans = new Plans(this._client);
        this.ratePlans = new RatePlans(this._client);
      }
      /**
       * Create Zone
       *
       * @example
       * ```ts
       * const zone = await client.zones.create({
       *   account: {},
       *   name: 'example.com',
       * });
       * ```
       */
      create(body, options) {
        return this._client.post("/zones", { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      list(query = {}, options) {
        if (isRequestOptions(query)) {
          return this.list({}, query);
        }
        return this._client.getAPIList("/zones", ZonesV4PagePaginationArray, { query, ...options });
      }
      /**
       * Deletes an existing zone.
       *
       * @example
       * ```ts
       * const zone = await client.zones.delete({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      delete(params, options) {
        const { zone_id } = params;
        return this._client.delete(`/zones/${zone_id}`, options)._thenUnwrap((obj) => obj.result);
      }
      /**
       * Edits a zone. Only one zone property can be changed at a time.
       *
       * @example
       * ```ts
       * const zone = await client.zones.edit({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      edit(params, options) {
        const { zone_id, ...body } = params;
        return this._client.patch(`/zones/${zone_id}`, { body, ...options })._thenUnwrap((obj) => obj.result);
      }
      /**
       * Zone Details
       *
       * @example
       * ```ts
       * const zone = await client.zones.get({
       *   zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
       * });
       * ```
       */
      get(params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}`, options)._thenUnwrap((obj) => obj.result);
      }
    };
    ZonesV4PagePaginationArray = class extends V4PagePaginationArray {
      static {
        __name(this, "ZonesV4PagePaginationArray");
      }
    };
    Zones2.ZonesV4PagePaginationArray = ZonesV4PagePaginationArray;
    Zones2.ActivationCheck = ActivationCheck;
    Zones2.Settings = Settings16;
    Zones2.CustomNameservers = CustomNameservers2;
    Zones2.CustomNameserverUpdateResponsesSinglePage = CustomNameserverUpdateResponsesSinglePage;
    Zones2.Holds = Holds;
    Zones2.Subscriptions = Subscriptions4;
    Zones2.Plans = Plans;
    Zones2.AvailableRatePlansSinglePage = AvailableRatePlansSinglePage;
    Zones2.RatePlans = RatePlans;
    Zones2.RatePlanGetResponsesSinglePage = RatePlanGetResponsesSinglePage;
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/index.mjs
var init_resources3 = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/resources/index.mjs"() {
    init_import_meta_url();
    init_shared();
    init_acm();
    init_ai();
    init_ai_gateway();
    init_api_gateway();
    init_abuse_reports();
    init_accounts();
    init_addressing();
    init_alerting();
    init_argo();
    init_audit_logs();
    init_billing();
    init_bot_management();
    init_botnet_feed();
    init_brand_protection();
    init_browser_rendering();
    init_cache();
    init_calls();
    init_certificate_authorities();
    init_client_certificates();
    init_cloud_connector();
    init_cloudforce_one();
    init_content_scanning();
    init_custom_certificates();
    init_custom_hostnames();
    init_custom_nameservers();
    init_custom_pages();
    init_d1();
    init_dcv_delegation();
    init_dns();
    init_dns_firewall();
    init_diagnostics();
    init_durable_objects();
    init_email_routing();
    init_email_security();
    init_filters();
    init_firewall();
    init_healthchecks();
    init_hostnames();
    init_hyperdrive();
    init_iam();
    init_ips2();
    init_images2();
    init_intel();
    init_kv();
    init_keyless_certificates();
    init_leaked_credential_checks();
    init_load_balancers();
    init_logpush();
    init_logs3();
    init_mtls_certificates();
    init_magic_cloud_networking();
    init_magic_network_monitoring();
    init_magic_transit();
    init_managed_transforms();
    init_memberships();
    init_network_interconnects();
    init_origin_ca_certificates();
    init_origin_post_quantum_encryption();
    init_origin_tls_client_auth();
    init_page_rules();
    init_page_shield();
    init_pages();
    init_pipelines();
    init_queues();
    init_r2();
    init_rum();
    init_radar();
    init_rate_limits();
    init_registrar();
    init_request_tracers();
    init_resource_sharing();
    init_rules8();
    init_rulesets();
    init_ssl();
    init_schema_validation3();
    init_secrets_store();
    init_security_center();
    init_security_txt();
    init_snippets();
    init_spectrum();
    init_speed2();
    init_stream2();
    init_turnstile();
    init_url_normalization();
    init_url_scanner();
    init_user();
    init_vectorize();
    init_waiting_rooms();
    init_web3();
    init_workers2();
    init_workers_for_platforms();
    init_workflows();
    init_zaraz();
    init_zero_trust();
    init_zones2();
  }
});

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/index.mjs
var _Cloudflare_instances, _a2, Cloudflare, cloudflare_default;
var init_cloudflare = __esm({
  "../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/index.mjs"() {
    init_import_meta_url();
    init_qs();
    init_core2();
    init_error4();
    init_uploads();
    init_resources3();
    init_abuse_reports();
    init_audit_logs();
    init_bot_management();
    init_client_certificates();
    init_custom_nameservers();
    init_custom_pages();
    init_dcv_delegation();
    init_filters();
    init_ips2();
    init_keyless_certificates();
    init_managed_transforms();
    init_memberships();
    init_origin_ca_certificates();
    init_origin_post_quantum_encryption();
    init_page_rules();
    init_pipelines();
    init_rate_limits();
    init_security_txt();
    init_url_normalization();
    init_accounts();
    init_acm();
    init_addressing();
    init_ai_gateway();
    init_ai();
    init_alerting();
    init_api_gateway();
    init_argo();
    init_billing();
    init_botnet_feed();
    init_brand_protection();
    init_browser_rendering();
    init_cache();
    init_calls();
    init_certificate_authorities();
    init_cloud_connector();
    init_cloudforce_one();
    init_content_scanning();
    init_custom_certificates();
    init_custom_hostnames();
    init_d1();
    init_diagnostics();
    init_dns_firewall();
    init_dns();
    init_durable_objects();
    init_email_routing();
    init_email_security();
    init_firewall();
    init_healthchecks();
    init_hostnames();
    init_hyperdrive();
    init_iam();
    init_images2();
    init_intel();
    init_kv();
    init_leaked_credential_checks();
    init_load_balancers();
    init_logpush();
    init_logs3();
    init_magic_cloud_networking();
    init_magic_network_monitoring();
    init_magic_transit();
    init_mtls_certificates();
    init_network_interconnects();
    init_origin_tls_client_auth();
    init_page_shield();
    init_pages();
    init_queues();
    init_r2();
    init_radar();
    init_registrar();
    init_request_tracers();
    init_resource_sharing();
    init_rules8();
    init_rulesets();
    init_rum();
    init_schema_validation3();
    init_secrets_store();
    init_security_center();
    init_snippets();
    init_spectrum();
    init_speed2();
    init_ssl();
    init_stream2();
    init_turnstile();
    init_url_scanner();
    init_user();
    init_vectorize();
    init_waiting_rooms();
    init_web3();
    init_workers_for_platforms();
    init_workers2();
    init_workflows();
    init_zaraz();
    init_zero_trust();
    init_zones2();
    Cloudflare = class extends APIClient {
      static {
        __name(this, "Cloudflare");
      }
      /**
       * API Client for interfacing with the Cloudflare API.
       *
       * @param {string | null | undefined} [opts.apiToken=process.env['CLOUDFLARE_API_TOKEN'] ?? null]
       * @param {string | null | undefined} [opts.apiKey=process.env['CLOUDFLARE_API_KEY'] ?? null]
       * @param {string | null | undefined} [opts.apiEmail=process.env['CLOUDFLARE_EMAIL'] ?? null]
       * @param {string | null | undefined} [opts.userServiceKey=process.env['CLOUDFLARE_API_USER_SERVICE_KEY'] ?? null]
       * @param {string} [opts.baseURL=process.env['CLOUDFLARE_BASE_URL'] ?? https://api.cloudflare.com/client/v4] - Override the default base URL for the API.
       * @param {string | null} [opts.apiVersion] - Define the version to target for the API.
       * @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
       * @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
       * @param {Core.Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
       * @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request.
       * @param {Core.Headers} opts.defaultHeaders - Default headers to include with every request to the API.
       * @param {Core.DefaultQuery} opts.defaultQuery - Default query parameters to include with every request to the API.
       */
      constructor({ baseURL = readEnv("CLOUDFLARE_BASE_URL"), apiVersion = null, apiToken = readEnv("CLOUDFLARE_API_TOKEN") ?? null, apiKey = readEnv("CLOUDFLARE_API_KEY") ?? null, apiEmail = readEnv("CLOUDFLARE_EMAIL") ?? null, userServiceKey = readEnv("CLOUDFLARE_API_USER_SERVICE_KEY") ?? null, ...opts } = {}) {
        const options = {
          apiToken,
          apiKey,
          apiEmail,
          userServiceKey,
          ...opts,
          baseURL: baseURL || `https://api.cloudflare.com/client/v4`,
          apiVersion: apiVersion || (/* @__PURE__ */ new Date()).toISOString().slice(0, 10)
        };
        super({
          baseURL: options.baseURL,
          apiVersion: options.apiVersion,
          baseURLOverridden: baseURL ? baseURL !== "https://api.cloudflare.com/client/v4" : false,
          timeout: options.timeout ?? 6e4,
          httpAgent: options.httpAgent,
          maxRetries: options.maxRetries,
          fetch: options.fetch
        });
        _Cloudflare_instances.add(this);
        this.accounts = new Accounts(this);
        this.originCACertificates = new OriginCACertificates(this);
        this.ips = new IPs2(this);
        this.memberships = new Memberships(this);
        this.user = new User(this);
        this.zones = new Zones2(this);
        this.loadBalancers = new LoadBalancers(this);
        this.cache = new Cache(this);
        this.ssl = new SSL(this);
        this.acm = new ACM(this);
        this.argo = new Argo(this);
        this.certificateAuthorities = new CertificateAuthorities(this);
        this.clientCertificates = new ClientCertificates(this);
        this.customCertificates = new CustomCertificates(this);
        this.customHostnames = new CustomHostnames(this);
        this.customNameservers = new CustomNameservers(this);
        this.dnsFirewall = new DNSFirewall(this);
        this.dns = new DNS(this);
        this.emailSecurity = new EmailSecurity(this);
        this.emailRouting = new EmailRouting(this);
        this.filters = new Filters(this);
        this.firewall = new Firewall(this);
        this.healthchecks = new Healthchecks(this);
        this.keylessCertificates = new KeylessCertificates(this);
        this.logpush = new Logpush(this);
        this.logs = new Logs3(this);
        this.originTLSClientAuth = new OriginTLSClientAuth(this);
        this.pageRules = new PageRules(this);
        this.rateLimits = new RateLimits(this);
        this.waitingRooms = new WaitingRooms(this);
        this.web3 = new Web3(this);
        this.workers = new Workers2(this);
        this.kv = new KV(this);
        this.durableObjects = new DurableObjects(this);
        this.queues = new Queues(this);
        this.apiGateway = new APIGateway(this);
        this.managedTransforms = new ManagedTransforms(this);
        this.pageShield = new PageShield(this);
        this.rulesets = new Rulesets(this);
        this.urlNormalization = new URLNormalization(this);
        this.spectrum = new Spectrum(this);
        this.addressing = new Addressing(this);
        this.auditLogs = new AuditLogs(this);
        this.billing = new Billing(this);
        this.brandProtection = new BrandProtection(this);
        this.diagnostics = new Diagnostics2(this);
        this.images = new Images(this);
        this.intel = new Intel(this);
        this.magicTransit = new MagicTransit(this);
        this.magicNetworkMonitoring = new MagicNetworkMonitoring(this);
        this.magicCloudNetworking = new MagicCloudNetworking(this);
        this.networkInterconnects = new NetworkInterconnects(this);
        this.mtlsCertificates = new MTLSCertificates(this);
        this.pages = new Pages(this);
        this.registrar = new Registrar(this);
        this.requestTracers = new RequestTracers(this);
        this.rules = new Rules7(this);
        this.stream = new Stream2(this);
        this.alerting = new Alerting(this);
        this.d1 = new D1Resource(this);
        this.r2 = new R22(this);
        this.workersForPlatforms = new WorkersForPlatforms(this);
        this.zeroTrust = new ZeroTrust(this);
        this.turnstile = new Turnstile(this);
        this.hyperdrive = new HyperdriveResource(this);
        this.rum = new RUM(this);
        this.vectorize = new Vectorize(this);
        this.urlScanner = new URLScanner(this);
        this.radar = new Radar(this);
        this.botManagement = new BotManagement(this);
        this.originPostQuantumEncryption = new OriginPostQuantumEncryption(this);
        this.zaraz = new Zaraz(this);
        this.speed = new Speed2(this);
        this.dcvDelegation = new DCVDelegation(this);
        this.hostnames = new Hostnames(this);
        this.snippets = new Snippets(this);
        this.calls = new Calls(this);
        this.cloudforceOne = new CloudforceOne(this);
        this.aiGateway = new AIGateway(this);
        this.iam = new IAM(this);
        this.cloudConnector = new CloudConnector(this);
        this.botnetFeed = new BotnetFeed(this);
        this.securityTXT = new SecurityTXT(this);
        this.workflows = new Workflows(this);
        this.resourceSharing = new ResourceSharing(this);
        this.leakedCredentialChecks = new LeakedCredentialChecks(this);
        this.contentScanning = new ContentScanning(this);
        this.abuseReports = new AbuseReports(this);
        this.ai = new AI(this);
        this.securityCenter = new SecurityCenter(this);
        this.browserRendering = new BrowserRendering(this);
        this.customPages = new CustomPages(this);
        this.secretsStore = new SecretsStore(this);
        this.pipelines = new Pipelines(this);
        this.schemaValidation = new SchemaValidation3(this);
        this._options = options;
        this.apiToken = apiToken;
        this.apiKey = apiKey;
        this.apiEmail = apiEmail;
        this.userServiceKey = userServiceKey;
      }
      defaultQuery() {
        return this._options.defaultQuery;
      }
      defaultHeaders(opts) {
        return {
          ...super.defaultHeaders(opts),
          "X-Auth-Key": this.apiKey,
          "X-Auth-Email": this.apiEmail,
          ...this._options.defaultHeaders
        };
      }
      validateHeaders(headers, customHeaders, usingCustomFetch) {
        if (this.apiEmail && headers["x-auth-email"]) {
          return;
        }
        if (customHeaders["x-auth-email"] === null) {
          return;
        }
        if (this.apiKey && headers["x-auth-key"]) {
          return;
        }
        if (customHeaders["x-auth-key"] === null) {
          return;
        }
        if (this.apiToken && headers["authorization"]) {
          return;
        }
        if (customHeaders["authorization"] === null) {
          return;
        }
        if (this.userServiceKey && headers["x-auth-user-service-key"]) {
          return;
        }
        if (customHeaders["x-auth-user-service-key"] === null) {
          return;
        }
        if (usingCustomFetch) {
          return;
        }
        throw new Error('Could not resolve authentication method. Expected one of apiEmail, apiKey, apiToken or userServiceKey to be set. Or for one of the "X-Auth-Email", "X-Auth-Key", "Authorization" or "X-Auth-User-Service-Key" headers to be explicitly omitted');
      }
      authHeaders(opts) {
        const apiEmailAuth = this.apiEmailAuth(opts);
        const apiKeyAuth = this.apiKeyAuth(opts);
        const apiTokenAuth = this.apiTokenAuth(opts);
        const userServiceKeyAuth = this.userServiceKeyAuth(opts);
        if (apiEmailAuth != null && !isEmptyObj(apiEmailAuth) && apiKeyAuth != null && !isEmptyObj(apiKeyAuth)) {
          return { ...apiEmailAuth, ...apiKeyAuth };
        }
        if (apiTokenAuth != null && !isEmptyObj(apiTokenAuth)) {
          return apiTokenAuth;
        }
        if (userServiceKeyAuth != null && !isEmptyObj(userServiceKeyAuth)) {
          return userServiceKeyAuth;
        }
        return {};
      }
      apiEmailAuth(opts) {
        if (this.apiEmail == null) {
          return {};
        }
        return { "X-Auth-Email": this.apiEmail };
      }
      apiKeyAuth(opts) {
        if (this.apiKey == null) {
          return {};
        }
        return { "X-Auth-Key": this.apiKey };
      }
      apiTokenAuth(opts) {
        if (this.apiToken == null) {
          return {};
        }
        return { Authorization: `Bearer ${this.apiToken}` };
      }
      userServiceKeyAuth(opts) {
        if (this.userServiceKey == null) {
          return {};
        }
        return { "X-Auth-User-Service-Key": this.userServiceKey };
      }
      stringifyQuery(query) {
        return stringify3(query, { allowDots: true, arrayFormat: "repeat" });
      }
    };
    _a2 = Cloudflare, _Cloudflare_instances = /* @__PURE__ */ new WeakSet();
    Cloudflare.Cloudflare = _a2;
    Cloudflare.DEFAULT_TIMEOUT = 6e4;
    Cloudflare.CloudflareError = CloudflareError;
    Cloudflare.APIError = APIError2;
    Cloudflare.APIConnectionError = APIConnectionError;
    Cloudflare.APIConnectionTimeoutError = APIConnectionTimeoutError;
    Cloudflare.APIUserAbortError = APIUserAbortError;
    Cloudflare.NotFoundError = NotFoundError;
    Cloudflare.ConflictError = ConflictError;
    Cloudflare.RateLimitError = RateLimitError;
    Cloudflare.BadRequestError = BadRequestError;
    Cloudflare.AuthenticationError = AuthenticationError;
    Cloudflare.InternalServerError = InternalServerError;
    Cloudflare.PermissionDeniedError = PermissionDeniedError;
    Cloudflare.UnprocessableEntityError = UnprocessableEntityError;
    Cloudflare.toFile = toFile;
    Cloudflare.fileFromPath = fileFromPath;
    Cloudflare.Accounts = Accounts;
    Cloudflare.OriginCACertificates = OriginCACertificates;
    Cloudflare.IPs = IPs2;
    Cloudflare.Memberships = Memberships;
    Cloudflare.User = User;
    Cloudflare.Zones = Zones2;
    Cloudflare.LoadBalancers = LoadBalancers;
    Cloudflare.Cache = Cache;
    Cloudflare.SSL = SSL;
    Cloudflare.ACM = ACM;
    Cloudflare.Argo = Argo;
    Cloudflare.CertificateAuthorities = CertificateAuthorities;
    Cloudflare.ClientCertificates = ClientCertificates;
    Cloudflare.CustomCertificates = CustomCertificates;
    Cloudflare.CustomHostnames = CustomHostnames;
    Cloudflare.CustomNameservers = CustomNameservers;
    Cloudflare.DNSFirewall = DNSFirewall;
    Cloudflare.DNS = DNS;
    Cloudflare.EmailSecurity = EmailSecurity;
    Cloudflare.EmailRouting = EmailRouting;
    Cloudflare.Filters = Filters;
    Cloudflare.Firewall = Firewall;
    Cloudflare.Healthchecks = Healthchecks;
    Cloudflare.KeylessCertificates = KeylessCertificates;
    Cloudflare.Logpush = Logpush;
    Cloudflare.Logs = Logs3;
    Cloudflare.OriginTLSClientAuth = OriginTLSClientAuth;
    Cloudflare.PageRules = PageRules;
    Cloudflare.RateLimits = RateLimits;
    Cloudflare.WaitingRooms = WaitingRooms;
    Cloudflare.Web3 = Web3;
    Cloudflare.Workers = Workers2;
    Cloudflare.KV = KV;
    Cloudflare.DurableObjects = DurableObjects;
    Cloudflare.Queues = Queues;
    Cloudflare.APIGateway = APIGateway;
    Cloudflare.ManagedTransforms = ManagedTransforms;
    Cloudflare.PageShield = PageShield;
    Cloudflare.Rulesets = Rulesets;
    Cloudflare.URLNormalization = URLNormalization;
    Cloudflare.Spectrum = Spectrum;
    Cloudflare.Addressing = Addressing;
    Cloudflare.AuditLogs = AuditLogs;
    Cloudflare.Billing = Billing;
    Cloudflare.BrandProtection = BrandProtection;
    Cloudflare.Diagnostics = Diagnostics2;
    Cloudflare.Images = Images;
    Cloudflare.Intel = Intel;
    Cloudflare.MagicTransit = MagicTransit;
    Cloudflare.MagicNetworkMonitoring = MagicNetworkMonitoring;
    Cloudflare.MagicCloudNetworking = MagicCloudNetworking;
    Cloudflare.NetworkInterconnects = NetworkInterconnects;
    Cloudflare.MTLSCertificates = MTLSCertificates;
    Cloudflare.Pages = Pages;
    Cloudflare.Registrar = Registrar;
    Cloudflare.RequestTracers = RequestTracers;
    Cloudflare.Rules = Rules7;
    Cloudflare.Stream = Stream2;
    Cloudflare.Alerting = Alerting;
    Cloudflare.D1Resource = D1Resource;
    Cloudflare.R2 = R22;
    Cloudflare.WorkersForPlatforms = WorkersForPlatforms;
    Cloudflare.ZeroTrust = ZeroTrust;
    Cloudflare.Turnstile = Turnstile;
    Cloudflare.HyperdriveResource = HyperdriveResource;
    Cloudflare.RUM = RUM;
    Cloudflare.Vectorize = Vectorize;
    Cloudflare.URLScanner = URLScanner;
    Cloudflare.Radar = Radar;
    Cloudflare.BotManagement = BotManagement;
    Cloudflare.OriginPostQuantumEncryption = OriginPostQuantumEncryption;
    Cloudflare.Zaraz = Zaraz;
    Cloudflare.Speed = Speed2;
    Cloudflare.DCVDelegation = DCVDelegation;
    Cloudflare.Hostnames = Hostnames;
    Cloudflare.Snippets = Snippets;
    Cloudflare.Calls = Calls;
    Cloudflare.CloudforceOne = CloudforceOne;
    Cloudflare.AIGateway = AIGateway;
    Cloudflare.IAM = IAM;
    Cloudflare.CloudConnector = CloudConnector;
    Cloudflare.BotnetFeed = BotnetFeed;
    Cloudflare.SecurityTXT = SecurityTXT;
    Cloudflare.Workflows = Workflows;
    Cloudflare.ResourceSharing = ResourceSharing;
    Cloudflare.LeakedCredentialChecks = LeakedCredentialChecks;
    Cloudflare.ContentScanning = ContentScanning;
    Cloudflare.AbuseReports = AbuseReports;
    Cloudflare.AI = AI;
    Cloudflare.SecurityCenter = SecurityCenter;
    Cloudflare.BrowserRendering = BrowserRendering;
    Cloudflare.CustomPages = CustomPages;
    Cloudflare.SecretsStore = SecretsStore;
    Cloudflare.Pipelines = Pipelines;
    Cloudflare.SchemaValidation = SchemaValidation3;
    cloudflare_default = Cloudflare;
  }
});
async function logRequest(request4, init4) {
  logger.debug(`-- START CF API REQUEST: ${request4.method} ${request4.url}`);
  const logRequestHeaders = cloneHeaders(request4.headers);
  logRequestHeaders.delete("Authorization");
  logger.debugWithSanitization(
    "HEADERS:",
    JSON.stringify(logRequestHeaders, null, 2)
  );
  logger.debugWithSanitization("INIT:", JSON.stringify({ ...init4 }, null, 2));
  if (request4.body instanceof import_undici3.FormData) {
    logger.debugWithSanitization(
      "BODY:",
      await new import_undici3.Response(request4.body).text(),
      null,
      2
    );
  }
  logger.debug("-- END CF API REQUEST");
}
async function logResponse(response) {
  const jsonText = await response.clone().text();
  logger.debug(
    "-- START CF API RESPONSE:",
    response.statusText,
    response.status
  );
  const logResponseHeaders = cloneHeaders(response.headers);
  logResponseHeaders.delete("Authorization");
  logger.debugWithSanitization(
    "HEADERS:",
    JSON.stringify(logResponseHeaders, null, 2)
  );
  logger.debugWithSanitization("RESPONSE:", jsonText);
  logger.debug("-- END CF API RESPONSE");
}
function createCloudflareClient(complianceConfig) {
  return new cloudflare_default({
    fetch: /* @__PURE__ */ __name(async (url4, init4) => {
      const request4 = new import_undici3.Request(url4, { ...init4, duplex: "half" });
      await requireLoggedIn(complianceConfig);
      const apiToken = requireApiToken();
      addAuthorizationHeader(
        request4.headers,
        apiToken,
        /* The CF SDK will inject `Bearer dummy` */
        true
      );
      addUserAgent(request4.headers);
      await logRequest(request4, init4);
      const response = await (0, import_undici3.fetch)(request4.url, request4);
      await logResponse(response);
      return response;
    }, "fetch"),
    baseURL: getCloudflareApiBaseUrl(complianceConfig)
  });
}
async function performApiFetch(complianceConfig, resource, init4 = {}, queryParams, abortSignal, apiToken) {
  const method = init4.method ?? "GET";
  assert53__default.default(
    resource.startsWith("/"),
    `CF API fetch - resource path must start with a "/" but got "${resource}"`
  );
  await requireLoggedIn(complianceConfig);
  apiToken ??= requireApiToken();
  const headers = cloneHeaders(new import_undici3.Headers(init4.headers));
  addAuthorizationHeader(headers, apiToken);
  addUserAgent(headers);
  maybeAddTraceHeader(headers);
  const queryString = queryParams ? `?${queryParams.toString()}` : "";
  logger.debug(
    `-- START CF API REQUEST: ${method} ${getCloudflareApiBaseUrl(complianceConfig)}${resource}`
  );
  logger.debugWithSanitization("QUERY STRING:", queryString);
  logHeaders(headers);
  logger.debugWithSanitization("INIT:", JSON.stringify({ ...init4 }, null, 2));
  if (init4.body instanceof import_undici3.FormData) {
    logger.debugWithSanitization(
      "BODY:",
      await new import_undici3.Response(init4.body).text(),
      null,
      2
    );
  }
  logger.debug("-- END CF API REQUEST");
  return await (0, import_undici3.fetch)(
    `${getCloudflareApiBaseUrl(complianceConfig)}${resource}${queryString}`,
    {
      method,
      ...init4,
      headers,
      signal: abortSignal
    }
  );
}
function logHeaders(headers) {
  headers = cloneHeaders(headers);
  headers.delete("Authorization");
  logger.debugWithSanitization(
    "HEADERS:",
    JSON.stringify(Object.fromEntries(headers), null, 2)
  );
}
async function fetchInternal(complianceConfig, resource, init4 = {}, queryParams, abortSignal, apiToken) {
  const method = init4.method ?? "GET";
  const response = await performApiFetch(
    complianceConfig,
    resource,
    init4,
    queryParams,
    abortSignal,
    apiToken
  );
  const jsonText = await response.text();
  logger.debug(
    "-- START CF API RESPONSE:",
    response.statusText,
    response.status
  );
  logHeaders(response.headers);
  logger.debugWithSanitization("RESPONSE:", jsonText);
  logger.debug("-- END CF API RESPONSE");
  if (!jsonText && (response.status === 204 || response.status === 205)) {
    return {
      response: {
        result: {},
        success: true,
        errors: [],
        messages: []
      },
      status: response.status
    };
  }
  try {
    const json = parseJSON(jsonText);
    return { response: json, status: response.status };
  } catch {
    throw new APIError({
      text: "Received a malformed response from the API",
      notes: [
        {
          text: truncate(jsonText, 100)
        },
        {
          text: `${method} ${resource} -> ${response.status} ${response.statusText}`
        }
      ],
      status: response.status
    });
  }
}
function truncate(text, maxLength) {
  const { length } = text;
  if (length <= maxLength) {
    return text;
  }
  return `${text.substring(0, maxLength)}... (length = ${length})`;
}
function cloneHeaders(headers) {
  return new import_undici3.Headers(headers);
}
async function requireLoggedIn(complianceConfig) {
  const loggedIn = await loginOrRefreshIfRequired(complianceConfig);
  if (!loggedIn) {
    throw new UserError("Not logged in.");
  }
}
function addAuthorizationHeader(headers, auth, overrideExisting = false) {
  if (!headers.has("Authorization") || overrideExisting) {
    if ("apiToken" in auth) {
      headers.set("Authorization", `Bearer ${auth.apiToken}`);
    } else {
      headers.set("X-Auth-Key", auth.authKey);
      headers.set("X-Auth-Email", auth.authEmail);
    }
  }
}
function addUserAgent(headers) {
  headers.set("User-Agent", `wrangler/${version}`);
}
function maybeAddTraceHeader(headers) {
  const traceHeader = getTraceHeader();
  if (traceHeader) {
    headers.set("Cf-Trace-Id", traceHeader);
  }
}
async function fetchKVGetValue(complianceConfig, accountId, namespaceId, key) {
  await requireLoggedIn(complianceConfig);
  const auth = requireApiToken();
  const headers = new import_undici3.Headers();
  addAuthorizationHeader(headers, auth);
  const resource = `${getCloudflareApiBaseUrl(complianceConfig)}/accounts/${accountId}/storage/kv/namespaces/${namespaceId}/values/${key}`;
  const response = await (0, import_undici3.fetch)(resource, {
    method: "GET",
    headers
  });
  if (response.ok) {
    return await response.arrayBuffer();
  } else {
    throw new Error(
      `Failed to fetch ${resource} - ${response.status}: ${response.statusText});`
    );
  }
}
async function fetchR2Objects(complianceConfig, resource, bodyInit = {}) {
  await requireLoggedIn(complianceConfig);
  const auth = requireApiToken();
  const headers = cloneHeaders(bodyInit.headers);
  addAuthorizationHeader(headers, auth);
  addUserAgent(headers);
  const response = await (0, import_undici3.fetch)(
    `${getCloudflareApiBaseUrl(complianceConfig)}${resource}`,
    {
      ...bodyInit,
      headers
    }
  );
  if (response.ok && response.body) {
    return response;
  } else if (response.status === 404) {
    return null;
  } else {
    const notes = [];
    let errorCode;
    try {
      const bodyText = await response.text();
      try {
        const json = JSON.parse(bodyText);
        errorCode = json.errors?.[0]?.code;
      } catch {
      }
      notes.push({ text: bodyText });
    } catch {
    }
    const apiError = new APIError({
      text: `Failed to fetch ${resource} - ${response.status}: ${response.statusText};`,
      status: response.status,
      notes
    });
    if (errorCode !== void 0) {
      apiError.code = errorCode;
    }
    throw apiError;
  }
}
async function fetchWorkerDefinitionFromDash(complianceConfig, resource, bodyInit = {}) {
  await requireLoggedIn(complianceConfig);
  const auth = requireApiToken();
  const headers = cloneHeaders(bodyInit.headers);
  addAuthorizationHeader(headers, auth);
  addUserAgent(headers);
  let response = await (0, import_undici3.fetch)(
    `${getCloudflareApiBaseUrl(complianceConfig)}${resource}`,
    {
      ...bodyInit,
      headers
    }
  );
  if (!response.ok || !response.body) {
    logger.error(response.ok, response.body);
    throw new Error(
      `Failed to fetch ${resource} - ${response.status}: ${response.statusText});`
    );
  }
  const usesModules = response.headers.get("content-type")?.startsWith("multipart");
  if (usesModules) {
    if (!response.formData) {
      response = new import_undici3.Response(await response.text(), response);
    }
    const form = await response.formData();
    const files = Array.from(form.entries()).map(
      ([filename, contents]) => contents instanceof File ? contents : new File([contents], filename)
    );
    return {
      entrypoint: response.headers.get("cf-entrypoint") ?? "src/index.js",
      modules: files
    };
  } else {
    const contents = await response.text();
    const file3 = new File([contents], "index.js", { type: "text" });
    return {
      entrypoint: "index.js",
      modules: [file3]
    };
  }
}
var import_undici3;
var init_internal = __esm({
  "src/cfetch/internal.ts"() {
    init_import_meta_url();
    init_dist();
    init_cloudflare();
    import_undici3 = __toESM(require_undici());
    init_package();
    init_logger();
    init_user3();
    __name(logRequest, "logRequest");
    __name(logResponse, "logResponse");
    __name(createCloudflareClient, "createCloudflareClient");
    __name(performApiFetch, "performApiFetch");
    __name(logHeaders, "logHeaders");
    __name(fetchInternal, "fetchInternal");
    __name(truncate, "truncate");
    __name(cloneHeaders, "cloneHeaders");
    __name(requireLoggedIn, "requireLoggedIn");
    __name(addAuthorizationHeader, "addAuthorizationHeader");
    __name(addUserAgent, "addUserAgent");
    __name(maybeAddTraceHeader, "maybeAddTraceHeader");
    __name(fetchKVGetValue, "fetchKVGetValue");
    __name(fetchR2Objects, "fetchR2Objects");
    __name(fetchWorkerDefinitionFromDash, "fetchWorkerDefinitionFromDash");
  }
});
async function fetchResult(complianceConfig, resource, init4 = {}, queryParams, abortSignal, apiToken) {
  const { response: json, status: status2 } = await fetchInternal(complianceConfig, resource, init4, queryParams, abortSignal, apiToken);
  if (json.success) {
    return json.result;
  } else {
    throwFetchError(resource, json, status2);
  }
}
async function fetchGraphqlResult(complianceConfig, init4 = {}, abortSignal) {
  const { response: json } = await fetchInternal(
    complianceConfig,
    "/graphql",
    { ...init4, method: "POST" },
    //Cloudflare API v4 doesn't allow GETs to /graphql
    void 0,
    abortSignal
  );
  if (json) {
    return json;
  } else {
    throw new Error("A request to the Cloudflare API (/graphql) failed.");
  }
}
async function fetchListResult(complianceConfig, resource, init4 = {}, queryParams) {
  const results = [];
  let getMoreResults = true;
  let cursor;
  while (getMoreResults) {
    if (cursor) {
      queryParams = new Url.URLSearchParams(queryParams);
      queryParams.set("cursor", cursor);
    }
    const { response: json, status: status2 } = await fetchInternal(complianceConfig, resource, init4, queryParams);
    if (json.success) {
      results.push(...json.result);
      if (hasCursor(json.result_info)) {
        cursor = json.result_info?.cursor;
      } else {
        getMoreResults = false;
      }
    } else {
      throwFetchError(resource, json, status2);
    }
  }
  return results;
}
async function fetchPagedListResult(complianceConfig, resource, init4 = {}, queryParams) {
  const results = [];
  let getMoreResults = true;
  let page = 1;
  while (getMoreResults) {
    queryParams = new Url.URLSearchParams(queryParams);
    queryParams.set("page", String(page));
    const { response: json, status: status2 } = await fetchInternal(complianceConfig, resource, init4, queryParams);
    if (json.success) {
      results.push(...json.result);
      if (hasMorePages(json.result_info)) {
        page = page + 1;
      } else {
        getMoreResults = false;
      }
    } else {
      throwFetchError(resource, json, status2);
    }
  }
  return results;
}
async function fetchCursorPage(complianceConfig, resource, init4 = {}, queryParams) {
  let cursor;
  let results = [];
  const page = parseInt(queryParams?.get("page") ?? "1", 10);
  queryParams?.delete("page");
  for (let currentPage = 1; currentPage <= page; currentPage++) {
    const pageQueryParams = new Url.URLSearchParams(queryParams);
    if (cursor) {
      pageQueryParams.set("cursor", cursor);
    }
    const { response: json, status: status2 } = await fetchInternal(complianceConfig, resource, init4, pageQueryParams);
    if (json.success) {
      if (currentPage === page) {
        results = json.result;
      }
      if (hasCursor(json.result_info)) {
        cursor = json.result_info.cursor;
      } else {
        if (currentPage < page) {
          return [];
        }
        break;
      }
    } else {
      throwFetchError(resource, json, status2);
    }
  }
  return results;
}
function hasMorePages(result_info) {
  const page = result_info?.page;
  const per_page = result_info?.per_page;
  const total = result_info?.total_count;
  return page !== void 0 && per_page !== void 0 && total !== void 0 && page * per_page < total;
}
function throwFetchError(resource, response, status2) {
  if (typeof vitest !== "undefined" && !("errors" in response)) {
    throw response;
  }
  const errors = response.errors ?? [];
  for (const error3 of errors) {
    maybeThrowFriendlyError(error3);
  }
  const notes = [
    ...errors.map((err) => ({ text: renderError(err) })),
    ...response.messages?.map((msg) => ({
      text: typeof msg === "string" ? msg : msg.message ?? String(msg)
    })) ?? []
  ];
  if (notes.length === 0) {
    const raw = response;
    const fallbackMessage = typeof raw.error === "string" ? `${raw.error}${raw.code ? ` [code: ${raw.code}]` : ""}` : void 0;
    if (fallbackMessage) {
      notes.push({ text: fallbackMessage });
    }
  }
  const error2 = new APIError({
    text: `A request to the Cloudflare API (${resource}) failed.`,
    notes,
    status: status2
  });
  const code = errors[0]?.code;
  if (code) {
    error2.code = code;
  }
  error2.accountTag = extractAccountTag(resource);
  throw error2;
}
function extractAccountTag(resource) {
  const re2 = new RegExp("/accounts/([a-zA-Z0-9]+)/?");
  const matches = re2.exec(resource);
  return matches?.[1];
}
function hasCursor(result_info) {
  const cursor = result_info?.cursor;
  return cursor !== void 0 && cursor !== null && cursor !== "";
}
function renderError(err, level = 0) {
  const indent = "  ".repeat(level);
  const chainedMessages = "error_chain" in err ? err.error_chain?.map(
    (chainedError) => `

${indent}- ${renderError(chainedError, level + 1)}`
  ).join("\n") ?? "" : "";
  return (err.code ? `${err.message} [code: ${err.code}]` : err.message) + (err.documentation_url ? `
${indent}To learn more about this error, visit: ${err.documentation_url}` : "") + chainedMessages;
}
var init_cfetch = __esm({
  "src/cfetch/index.ts"() {
    init_import_meta_url();
    init_dist();
    init_errors3();
    init_internal();
    init_internal();
    __name(fetchResult, "fetchResult");
    __name(fetchGraphqlResult, "fetchGraphqlResult");
    __name(fetchListResult, "fetchListResult");
    __name(fetchPagedListResult, "fetchPagedListResult");
    __name(fetchCursorPage, "fetchCursorPage");
    __name(hasMorePages, "hasMorePages");
    __name(throwFetchError, "throwFetchError");
    __name(extractAccountTag, "extractAccountTag");
    __name(hasCursor, "hasCursor");
    __name(renderError, "renderError");
  }
});

// src/user/choose-account.ts
async function getAccountChoices(complianceConfig) {
  const accountIdFromEnv = getCloudflareAccountIdFromEnv();
  if (accountIdFromEnv) {
    return [{ id: accountIdFromEnv, name: "" }];
  } else {
    try {
      const response = await fetchPagedListResult(complianceConfig, `/memberships`);
      const accounts = response.map((r10) => r10.account);
      if (accounts.length === 0) {
        throw new UserError(
          `Failed to automatically retrieve account IDs for the logged in user.
In a non-interactive environment, it is mandatory to specify an account ID, either by assigning its value to CLOUDFLARE_ACCOUNT_ID, or as \`account_id\` in your ${configFileName(void 0)} file.`
        );
      } else {
        return accounts;
      }
    } catch (err) {
      if (err.code === 9109) {
        throw new UserError(
          `Failed to automatically retrieve account IDs for the logged in user.
You may have incorrect permissions on your API token. You can skip this account check by adding an \`account_id\` in your ${configFileName(void 0)} file, or by setting the value of CLOUDFLARE_ACCOUNT_ID"`
        );
      } else {
        throw err;
      }
    }
  }
}
var init_choose_account = __esm({
  "src/user/choose-account.ts"() {
    init_import_meta_url();
    init_dist();
    init_cfetch();
    init_auth_variables();
    __name(getAccountChoices, "getAccountChoices");
  }
});

// src/user/generate-auth-url.ts
var OAUTH_CALLBACK_URL, generateAuthUrl;
var init_generate_auth_url = __esm({
  "src/user/generate-auth-url.ts"() {
    init_import_meta_url();
    OAUTH_CALLBACK_URL = "http://localhost:8976/oauth/callback";
    generateAuthUrl = /* @__PURE__ */ __name(({
      authUrl,
      clientId,
      scopes,
      stateQueryParam,
      codeChallenge
    }) => {
      return authUrl + `?response_type=code&client_id=${encodeURIComponent(clientId)}&redirect_uri=${encodeURIComponent(OAUTH_CALLBACK_URL)}&scope=${encodeURIComponent([...scopes, "offline_access"].join(" "))}&state=${stateQueryParam}&code_challenge=${encodeURIComponent(codeChallenge)}&code_challenge_method=S256`;
    }, "generateAuthUrl");
  }
});
function generateRandomState(lengthOfState) {
  const output = new Uint32Array(lengthOfState);
  crypto2.webcrypto.getRandomValues(output);
  return Array.from(output).map((num) => PKCE_CHARSET[num % PKCE_CHARSET.length]).join("");
}
var init_generate_random_state = __esm({
  "src/user/generate-random-state.ts"() {
    init_import_meta_url();
    init_user3();
    __name(generateRandomState, "generateRandomState");
  }
});
function getAuthFromEnv() {
  const globalApiKey = getCloudflareGlobalAuthKeyFromEnv();
  const globalApiEmail = getCloudflareGlobalAuthEmailFromEnv();
  const apiToken = getCloudflareAPITokenFromEnv();
  if (globalApiKey && globalApiEmail) {
    return { authKey: globalApiKey, authEmail: globalApiEmail };
  } else if (apiToken) {
    return { apiToken };
  }
}
function validateScopeKeys(scopes) {
  return scopes.every((scope) => scope in DefaultScopes);
}
function getAuthTokens(config) {
  try {
    if (getAuthFromEnv()) {
      return;
    }
    const { oauth_token, refresh_token, expiration_time, scopes, api_token } = config || readAuthConfigFile();
    if (oauth_token) {
      return {
        accessToken: {
          value: oauth_token,
          // If there is no `expiration_time` field then set it to an old date, to cause it to expire immediately.
          expiry: expiration_time ?? "2000-01-01:00:00:00+00:00"
        },
        refreshToken: { value: refresh_token ?? "" },
        scopes
      };
    } else if (api_token) {
      logger.warn(
        `It looks like you have used Wrangler v1's \`config\` command to login with an API token
from ${config === void 0 ? getAuthConfigFilePath() : "in-memory config"}.
This is no longer supported in the current version of Wrangler.
If you wish to authenticate via an API token then please set the \`CLOUDFLARE_API_TOKEN\` environment variable.`
      );
      return { apiToken: api_token };
    }
  } catch {
    return void 0;
  }
}
function reinitialiseAuthTokens(config) {
  localState = {
    ...getAuthTokens(config)
  };
}
function getAPIToken() {
  if (localState.apiToken) {
    return { apiToken: localState.apiToken };
  }
  const localAPIToken = getAuthFromEnv();
  if (localAPIToken) {
    return localAPIToken;
  }
  const storedAccessToken = localState.accessToken?.value;
  if (storedAccessToken) {
    return { apiToken: storedAccessToken };
  }
  return void 0;
}
function toErrorClass(rawError) {
  switch (rawError) {
    case "invalid_request":
      return new ErrorInvalidRequest(rawError);
    case "invalid_grant":
      return new ErrorInvalidGrant(rawError);
    case "unauthorized_client":
      return new ErrorUnauthorizedClient(rawError);
    case "access_denied":
      return new ErrorAccessDenied(rawError);
    case "unsupported_response_type":
      return new ErrorUnsupportedResponseType(rawError);
    case "invalid_scope":
      return new ErrorInvalidScope(rawError);
    case "server_error":
      return new ErrorServerError(rawError);
    case "temporarily_unavailable":
      return new ErrorTemporarilyUnavailable(rawError);
    case "invalid_client":
      return new ErrorInvalidClient(rawError);
    case "unsupported_grant_type":
      return new ErrorUnsupportedGrantType(rawError);
    case "invalid_json":
      return new ErrorInvalidJson(rawError);
    case "invalid_token":
      return new ErrorInvalidToken(rawError);
    default:
      return new ErrorUnknown(rawError);
  }
}
function isReturningFromAuthServer(query) {
  if (query.error) {
    if (Array.isArray(query.error)) {
      throw toErrorClass(query.error[0]);
    }
    throw toErrorClass(query.error);
  }
  const code = query.code;
  if (!code) {
    return false;
  }
  const state2 = localState;
  const stateQueryParam = query.state;
  if (stateQueryParam !== state2.stateQueryParam) {
    logger.warn(
      "Received query string parameter doesn't match the one sent! Possible malicious activity somewhere."
    );
    throw new ErrorInvalidReturnedStateParam();
  }
  assert53__default.default(!Array.isArray(code));
  state2.authorizationCode = code;
  state2.hasAuthCodeBeenExchangedForAccessToken = false;
  return true;
}
async function getAuthURL(scopes, clientId) {
  const { codeChallenge, codeVerifier } = await generatePKCECodes();
  const stateQueryParam = generateRandomState(RECOMMENDED_STATE_LENGTH);
  Object.assign(localState, {
    codeChallenge,
    codeVerifier,
    stateQueryParam
  });
  return generateAuthUrl({
    authUrl: getAuthUrlFromEnv(),
    clientId,
    scopes,
    stateQueryParam,
    codeChallenge
  });
}
async function exchangeRefreshTokenForAccessToken() {
  if (!localState.refreshToken) {
    logger.warn("No refresh token is present.");
  }
  const params = new URLSearchParams({
    grant_type: "refresh_token",
    refresh_token: localState.refreshToken?.value ?? "",
    client_id: getClientIdFromEnv()
  });
  const response = await fetchAuthToken(params);
  if (response.status >= 400) {
    let tokenExchangeResErr = void 0;
    try {
      tokenExchangeResErr = await getJSONFromResponse(response);
    } catch (e10) {
      logger.error(e10);
    }
    if (tokenExchangeResErr !== void 0) {
      throw typeof tokenExchangeResErr === "string" ? new Error(tokenExchangeResErr) : tokenExchangeResErr;
    } else {
      throw new ErrorUnknown(
        "Failed to parse Error from exchangeRefreshTokenForAccessToken"
      );
    }
  } else {
    try {
      const json = await getJSONFromResponse(response);
      if ("error" in json) {
        throw json.error;
      }
      const { access_token, expires_in, refresh_token, scope } = json;
      let scopes = [];
      const accessToken = {
        value: access_token,
        expiry: new Date(Date.now() + expires_in * 1e3).toISOString()
      };
      localState.accessToken = accessToken;
      if (refresh_token) {
        localState.refreshToken = {
          value: refresh_token
        };
      }
      if (scope) {
        scopes = scope.split(" ");
        localState.scopes = scopes;
      }
      const accessContext = {
        token: accessToken,
        scopes,
        refreshToken: localState.refreshToken
      };
      return accessContext;
    } catch (error2) {
      if (typeof error2 === "string") {
        throw toErrorClass(error2);
      } else {
        throw error2;
      }
    }
  }
}
async function exchangeAuthCodeForAccessToken() {
  const { authorizationCode, codeVerifier = "" } = localState;
  if (!codeVerifier) {
    logger.warn("No code verifier is being sent.");
  } else if (!authorizationCode) {
    logger.warn("No authorization grant code is being passed.");
  }
  const params = new URLSearchParams({
    grant_type: `authorization_code`,
    code: authorizationCode ?? "",
    redirect_uri: OAUTH_CALLBACK_URL,
    client_id: getClientIdFromEnv(),
    code_verifier: codeVerifier
  });
  const response = await fetchAuthToken(params);
  if (!response.ok) {
    const { error: error2 } = await getJSONFromResponse(response);
    if (error2 === "invalid_grant") {
      logger.log("Expired! Auth code or refresh token needs to be renewed.");
    }
    throw toErrorClass(error2);
  }
  const json = await getJSONFromResponse(response);
  if ("error" in json) {
    throw new Error(json.error);
  }
  const { access_token, expires_in, refresh_token, scope } = json;
  let scopes = [];
  localState.hasAuthCodeBeenExchangedForAccessToken = true;
  const expiryDate = new Date(Date.now() + expires_in * 1e3);
  const accessToken = {
    value: access_token,
    expiry: expiryDate.toISOString()
  };
  localState.accessToken = accessToken;
  if (refresh_token) {
    localState.refreshToken = {
      value: refresh_token
    };
  }
  if (scope) {
    scopes = scope.split(" ");
    localState.scopes = scopes;
  }
  const accessContext = {
    token: accessToken,
    scopes,
    refreshToken: localState.refreshToken
  };
  return accessContext;
}
function base64urlEncode(value) {
  let base642 = btoa(value);
  base642 = base642.replace(/\+/g, "-");
  base642 = base642.replace(/\//g, "_");
  base642 = base642.replace(/=/g, "");
  return base642;
}
async function generatePKCECodes() {
  const output = new Uint32Array(RECOMMENDED_CODE_VERIFIER_LENGTH);
  crypto2.webcrypto.getRandomValues(output);
  const codeVerifier = base64urlEncode(
    Array.from(output).map((num) => PKCE_CHARSET[num % PKCE_CHARSET.length]).join("")
  );
  const buffer = await crypto2.webcrypto.subtle.digest(
    "SHA-256",
    new util4.TextEncoder().encode(codeVerifier)
  );
  const hash = new Uint8Array(buffer);
  let binary = "";
  const hashLength = hash.byteLength;
  for (let i7 = 0; i7 < hashLength; i7++) {
    binary += String.fromCharCode(hash[i7]);
  }
  const codeChallenge = base64urlEncode(binary);
  return { codeChallenge, codeVerifier };
}
function getAuthConfigFilePath() {
  const environment = getCloudflareApiEnvironmentFromEnv();
  const filePath = `${USER_AUTH_CONFIG_PATH}/${environment === "production" ? "default.toml" : `${environment}.toml`}`;
  return path3__namespace.default.join(getGlobalWranglerConfigPath(), filePath);
}
function writeAuthConfigFile(config) {
  const configPath = getAuthConfigFilePath();
  fs29.mkdirSync(path3__namespace.default.dirname(configPath), {
    recursive: true
  });
  fs29.writeFileSync(path3__namespace.default.join(configPath), dist_default2.stringify(config), {
    encoding: "utf-8"
  });
  reinitialiseAuthTokens();
}
function readAuthConfigFile() {
  return parseTOML(readFileSync(getAuthConfigFilePath()));
}
async function loginOrRefreshIfRequired(complianceConfig, props) {
  if (!getAPIToken()) {
    return !isNonInteractiveOrCI() && await login(complianceConfig, props);
  } else if (isAccessTokenExpired()) {
    const didRefresh = await refreshToken();
    if (didRefresh) {
      return true;
    } else {
      return !isNonInteractiveOrCI() && await login(complianceConfig, props);
    }
  } else {
    return true;
  }
}
async function getOAuthTokenFromLocalState() {
  if (!localState.accessToken) {
    return void 0;
  }
  if (isAccessTokenExpired()) {
    const didRefresh = await refreshToken();
    if (!didRefresh) {
      return void 0;
    }
  }
  return localState.accessToken?.value;
}
async function getOauthToken(options) {
  const urlToOpen = await getAuthURL(options.scopes, options.clientId);
  let server;
  let loginTimeoutHandle;
  const timerPromise = new Promise((_5, reject) => {
    loginTimeoutHandle = setTimeout(() => {
      server.close();
      clearTimeout(loginTimeoutHandle);
      reject(
        new UserError(
          "Timed out waiting for authorization code, please try again."
        )
      );
    }, 12e4);
  });
  const loginPromise = new Promise((resolve32, reject) => {
    server = http__namespace.default.createServer(async (req, res) => {
      function finish(token, error2) {
        clearTimeout(loginTimeoutHandle);
        server.close((closeErr) => {
          if (error2 || closeErr) {
            reject(error2 || closeErr);
          } else {
            assert53__default.default(token);
            resolve32(token);
          }
        });
      }
      __name(finish, "finish");
      assert53__default.default(req.url, "This request doesn't have a URL");
      const { pathname, query } = Url__default.default.parse(req.url, true);
      if (req.method !== "GET") {
        return res.end("OK");
      }
      switch (pathname) {
        case "/oauth/callback": {
          let hasAuthCode = false;
          try {
            hasAuthCode = isReturningFromAuthServer(query);
          } catch (err) {
            if (err instanceof ErrorAccessDenied) {
              res.writeHead(307, {
                Location: options.denied.url
              });
              res.end(() => {
                finish(null, new UserError(options.denied.error));
              });
              return;
            } else {
              finish(null, err);
              return;
            }
          }
          if (!hasAuthCode) {
            finish(null, new ErrorNoAuthCode());
            return;
          } else {
            const exchange = await exchangeAuthCodeForAccessToken();
            res.writeHead(307, {
              Location: options.granted.url
            });
            res.end(() => {
              finish(exchange);
            });
            return;
          }
        }
      }
    });
    if (options.callbackHost !== "localhost" || options.callbackPort !== 8976) {
      logger.log(
        `Temporary login server listening on ${options.callbackHost}:${options.callbackPort}`
      );
      logger.log(
        "Note that the OAuth login page will always redirect to `localhost:8976`.\nIf you have changed the callback host or port because you are running in a container, then ensure that you have port forwarding set up correctly."
      );
    }
    server.listen(options.callbackPort, options.callbackHost);
  });
  if (options.browser) {
    logger.log(`Opening a link in your default browser: ${urlToOpen}`);
    await openInBrowser(urlToOpen);
  } else {
    logger.log(`Visit this link to authenticate: ${urlToOpen}`);
  }
  return Promise.race([timerPromise, loginPromise]);
}
async function login(complianceConfig, props = {
  browser: true,
  callbackHost: "localhost",
  callbackPort: 8976
}) {
  const authFromEnv = getAuthFromEnv();
  if (authFromEnv) {
    logger.error(
      "You are logged in with an API Token. Unset the CLOUDFLARE_API_TOKEN in the environment to log in via OAuth."
    );
    return false;
  }
  const complianceRegion = getCloudflareComplianceRegion(complianceConfig);
  if (complianceRegion === "fedramp_high") {
    const configurationSource = complianceConfig?.compliance_region ? "`compliance_region` configuration property" : "`CLOUDFLARE_API_ENVIRONMENT` environment variable";
    throw new UserError(esm_default3`
			OAuth login is not supported in the \`${complianceRegion}\` compliance region.
			Please use a Cloudflare API token (\`CLOUDFLARE_API_TOKEN\` environment variable) or remove the ${configurationSource}.
		`);
  }
  logger.log("Attempting to login via OAuth...");
  const oauth = await getOauthToken({
    browser: !!props.browser,
    scopes: props.scopes ?? DefaultScopeKeys,
    clientId: getClientIdFromEnv(),
    denied: {
      url: "https://welcome.developers.workers.dev/wrangler-oauth-consent-denied",
      error: "Error: Consent denied. You must grant consent to Wrangler in order to login.\nIf you don't want to do this consider passing an API token via the `CLOUDFLARE_API_TOKEN` environment variable"
    },
    granted: {
      url: "https://welcome.developers.workers.dev/wrangler-oauth-consent-granted"
    },
    callbackHost: props.callbackHost,
    callbackPort: props.callbackPort
  });
  writeAuthConfigFile({
    oauth_token: oauth.token?.value ?? "",
    expiration_time: oauth.token?.expiry,
    refresh_token: oauth.refreshToken?.value,
    scopes: oauth.scopes
  });
  logger.log(`Successfully logged in.`);
  purgeConfigCaches();
  return true;
}
function isAccessTokenExpired() {
  const { accessToken } = localState;
  return Boolean(accessToken && /* @__PURE__ */ new Date() >= new Date(accessToken.expiry));
}
async function refreshToken() {
  try {
    const {
      token: { value: oauth_token, expiry: expiration_time } = {
        value: "",
        expiry: ""
      },
      refreshToken: { value: refresh_token } = {},
      scopes
    } = await exchangeRefreshTokenForAccessToken();
    writeAuthConfigFile({
      oauth_token,
      expiration_time,
      refresh_token,
      scopes
    });
    return true;
  } catch {
    return false;
  }
}
async function logout() {
  const authFromEnv = getAuthFromEnv();
  if (authFromEnv) {
    logger.log(
      "You are logged in with an API Token. Unset the CLOUDFLARE_API_TOKEN in the environment to log out."
    );
    return;
  }
  if (!localState.accessToken) {
    if (!localState.refreshToken) {
      logger.log("Not logged in, exiting...");
      return;
    }
    const body2 = `client_id=${encodeURIComponent(getClientIdFromEnv())}&token_type_hint=refresh_token&token=${encodeURIComponent(localState.refreshToken?.value || "")}`;
    const response2 = await (0, import_undici4.fetch)(getRevokeUrlFromEnv(), {
      method: "POST",
      body: body2,
      headers: {
        "Content-Type": "application/x-www-form-urlencoded"
      }
    });
    await response2.text();
    logger.log(
      "\u{1F481}  Wrangler is configured with an OAuth token. The token has been successfully revoked"
    );
  }
  const body = `client_id=${encodeURIComponent(getClientIdFromEnv())}&token_type_hint=refresh_token&token=${encodeURIComponent(localState.refreshToken?.value || "")}`;
  const response = await (0, import_undici4.fetch)(getRevokeUrlFromEnv(), {
    method: "POST",
    body,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded"
    }
  });
  await response.text();
  fs29.rmSync(getAuthConfigFilePath());
  logger.log(`Successfully logged out.`);
}
function listScopes(message = "\u{1F481} Available scopes:") {
  logger.log(message);
  printScopes(DefaultScopeKeys);
}
async function getAccountId(config) {
  if (config.account_id) {
    return config.account_id;
  }
  const cachedAccount2 = getAccountFromCache();
  if (cachedAccount2 && !getCloudflareAccountIdFromEnv()) {
    return cachedAccount2.id;
  }
  const accounts = await getAccountChoices(config);
  if (accounts.length === 1) {
    saveAccountToCache({ id: accounts[0].id, name: accounts[0].name });
    return accounts[0].id;
  }
  try {
    const accountID = await select("Select an account", {
      choices: accounts.map((account2) => ({
        title: account2.name,
        value: account2.id
      }))
    });
    const account = accounts.find((a7) => a7.id === accountID);
    saveAccountToCache({ id: account.id, name: account.name });
    return accountID;
  } catch (e10) {
    if (e10 instanceof NoDefaultValueProvided) {
      const redactAccountName = import_ci_info4.default.isCI;
      throw new UserError(
        `More than one account available but unable to select one in non-interactive mode.
Please set the appropriate \`account_id\` in your ${configFileName(void 0)} file or assign it to the \`CLOUDFLARE_ACCOUNT_ID\` environment variable.
Available accounts are (\`<name>\`: \`<account_id>\`):
${accounts.map(
          (account) => `  \`${redactAccountName ? "(redacted)" : account.name}\`: \`${account.id}\``
        ).join("\n")}`
      );
    }
    throw e10;
  }
}
async function requireAuth(config) {
  const loggedIn = await loginOrRefreshIfRequired(config);
  if (!loggedIn) {
    if (isNonInteractiveOrCI()) {
      throw new UserError(
        "In a non-interactive environment, it's necessary to set a CLOUDFLARE_API_TOKEN environment variable for wrangler to work. Please go to https://developers.cloudflare.com/fundamentals/api/get-started/create-token/ for instructions on how to create an api token, and assign its value to CLOUDFLARE_API_TOKEN."
      );
    } else {
      throw new UserError("Did not login, quitting...");
    }
  }
  const accountId = await getAccountId(config);
  if (!accountId) {
    throw new UserError("No account id found, quitting...");
  }
  return accountId;
}
function requireApiToken() {
  const credentials = getAPIToken();
  if (!credentials) {
    throw new UserError("No API token found.");
  }
  return credentials;
}
function saveAccountToCache(account) {
  localState.account = account;
  saveToConfigCache("wrangler-account.json", { account });
}
function getAccountFromCache() {
  if (localState.account) {
    return localState.account;
  }
  return getConfigCache("wrangler-account.json").account;
}
function getScopes() {
  return localState.scopes;
}
function printScopes(scopes) {
  const data = scopes.map((scope) => ({
    Scope: scope,
    Description: DefaultScopes[scope]
  }));
  logger.table(data);
}
async function fetchAuthToken(body) {
  const headers = {
    "Content-Type": "application/x-www-form-urlencoded"
  };
  logger.debug("fetching auth token", body.toString());
  if (await domainUsesAccess(getAuthDomainFromEnv())) {
    logger.debug(
      "Using Cloudflare Access to get an access token for the auth request"
    );
    const accessHeaders = await getCloudflareAccessHeaders();
    Object.assign(headers, accessHeaders);
  }
  logger.debug("Fetching auth token from", getTokenUrlFromEnv());
  try {
    const response = await (0, import_undici4.fetch)(getTokenUrlFromEnv(), {
      method: "POST",
      body: body.toString(),
      headers
    });
    if (!response.ok) {
      logger.error(
        "Failed to fetch auth token:",
        response.status,
        response.statusText
      );
    }
    return response;
  } catch (e10) {
    logger.error("Failed to fetch auth token:", e10);
    throw e10;
  }
}
async function getJSONFromResponse(response) {
  const text = await response.text();
  try {
    return JSON.parse(text);
  } catch (e10) {
    if (text.match(/<!DOCTYPE html>/)) {
      logger.error(
        "The body of the response was HTML rather than JSON. Check the debug logs to see the full body of the response."
      );
      if (text.match(/challenge-platform/)) {
        logger.error(
          `It looks like you might have hit a bot challenge page. This may be transient but if not, please contact Cloudflare to find out what can be done. When you contact Cloudflare, please provide your Ray ID: ${response.headers.get("cf-ray")}`
        );
      }
    }
    logger.debug("Full body of response\n\n", text);
    throw new Error(
      `Invalid JSON in response: status: ${response.status} ${response.statusText}`,
      { cause: e10 }
    );
  }
}
var import_ci_info4, import_undici4, USER_AUTH_CONFIG_PATH, DefaultScopes, DefaultScopeKeys, localState, ErrorOAuth2, ErrorUnknown, ErrorNoAuthCode, ErrorInvalidReturnedStateParam, ErrorInvalidJson, ErrorInvalidScope, ErrorInvalidRequest, ErrorInvalidToken, ErrorAuthenticationGrant, ErrorUnauthorizedClient, ErrorAccessDenied, ErrorUnsupportedResponseType, ErrorServerError, ErrorTemporarilyUnavailable, ErrorAccessTokenResponse, ErrorInvalidClient, ErrorInvalidGrant, ErrorUnsupportedGrantType, RECOMMENDED_CODE_VERIFIER_LENGTH, RECOMMENDED_STATE_LENGTH, PKCE_CHARSET;
var init_user2 = __esm({
  "src/user/user.ts"() {
    init_import_meta_url();
    init_dist();
    import_ci_info4 = __toESM(require_ci_info());
    init_dist5();
    init_esm2();
    import_undici4 = __toESM(require_undici());
    init_config_cache();
    init_dialogs();
    init_is_interactive();
    init_logger();
    init_open_in_browser();
    init_access();
    init_auth_variables();
    init_choose_account();
    init_generate_auth_url();
    init_generate_random_state();
    __name(getAuthFromEnv, "getAuthFromEnv");
    USER_AUTH_CONFIG_PATH = "config";
    DefaultScopes = {
      "account:read": "See your account info such as account details, analytics, and memberships.",
      "user:read": "See your user info such as name, email address, and account memberships.",
      "workers:write": "See and change Cloudflare Workers data such as zones, KV storage, namespaces, scripts, and routes.",
      "workers_kv:write": "See and change Cloudflare Workers KV Storage data such as keys and namespaces.",
      "workers_routes:write": "See and change Cloudflare Workers data such as filters and routes.",
      "workers_scripts:write": "See and change Cloudflare Workers scripts, durable objects, subdomains, triggers, and tail data.",
      "workers_tail:read": "See Cloudflare Workers tail and script data.",
      "d1:write": "See and change D1 Databases.",
      "pages:write": "See and change Cloudflare Pages projects, settings and deployments.",
      "zone:read": "Grants read level access to account zone.",
      "ssl_certs:write": "See and manage mTLS certificates for your account",
      "ai:write": "See and change Workers AI catalog and assets",
      "ai-search:write": "See and change AI Search data",
      "ai-search:run": "Run search queries on your AI Search instances",
      "queues:write": "See and change Cloudflare Queues settings and data",
      "pipelines:write": "See and change Cloudflare Pipelines configurations and data",
      "secrets_store:write": "See and change secrets + stores within the Secrets Store",
      "artifacts:write": "See and change Cloudflare Artifacts data such as registries and artifacts",
      "flagship:read": "See Flagship feature flags and apps",
      "flagship:write": "See and change Flagship feature flags and apps",
      "containers:write": "Manage Workers Containers",
      "cloudchamber:write": "Manage Cloudchamber",
      "connectivity:admin": "See, change, and bind to Connectivity Directory services, including creating services targeting Cloudflare Tunnel.",
      "email_routing:write": "See and change Email Routing settings, rules, and destination addresses.",
      "email_sending:write": "See and change Email Sending settings and configuration.",
      "browser:write": "See and manage Browser Rendering sessions"
    };
    DefaultScopeKeys = Object.keys(DefaultScopes);
    __name(validateScopeKeys, "validateScopeKeys");
    localState = {
      ...getAuthTokens()
    };
    __name(getAuthTokens, "getAuthTokens");
    __name(reinitialiseAuthTokens, "reinitialiseAuthTokens");
    __name(getAPIToken, "getAPIToken");
    ErrorOAuth2 = class extends UserError {
      static {
        __name(this, "ErrorOAuth2");
      }
      toString() {
        return "ErrorOAuth2";
      }
    };
    ErrorUnknown = class extends UserError {
      static {
        __name(this, "ErrorUnknown");
      }
      toString() {
        return "ErrorUnknown";
      }
    };
    ErrorNoAuthCode = class extends ErrorOAuth2 {
      static {
        __name(this, "ErrorNoAuthCode");
      }
      toString() {
        return "ErrorNoAuthCode";
      }
    };
    ErrorInvalidReturnedStateParam = class extends ErrorOAuth2 {
      static {
        __name(this, "ErrorInvalidReturnedStateParam");
      }
      toString() {
        return "ErrorInvalidReturnedStateParam";
      }
    };
    ErrorInvalidJson = class extends ErrorOAuth2 {
      static {
        __name(this, "ErrorInvalidJson");
      }
      toString() {
        return "ErrorInvalidJson";
      }
    };
    ErrorInvalidScope = class extends ErrorOAuth2 {
      static {
        __name(this, "ErrorInvalidScope");
      }
      toString() {
        return "ErrorInvalidScope";
      }
    };
    ErrorInvalidRequest = class extends ErrorOAuth2 {
      static {
        __name(this, "ErrorInvalidRequest");
      }
      toString() {
        return "ErrorInvalidRequest";
      }
    };
    ErrorInvalidToken = class extends ErrorOAuth2 {
      static {
        __name(this, "ErrorInvalidToken");
      }
      toString() {
        return "ErrorInvalidToken";
      }
    };
    ErrorAuthenticationGrant = class extends ErrorOAuth2 {
      static {
        __name(this, "ErrorAuthenticationGrant");
      }
      toString() {
        return "ErrorAuthenticationGrant";
      }
    };
    ErrorUnauthorizedClient = class extends ErrorAuthenticationGrant {
      static {
        __name(this, "ErrorUnauthorizedClient");
      }
      toString() {
        return "ErrorUnauthorizedClient";
      }
    };
    ErrorAccessDenied = class extends ErrorAuthenticationGrant {
      static {
        __name(this, "ErrorAccessDenied");
      }
      toString() {
        return "ErrorAccessDenied";
      }
    };
    ErrorUnsupportedResponseType = class extends ErrorAuthenticationGrant {
      static {
        __name(this, "ErrorUnsupportedResponseType");
      }
      toString() {
        return "ErrorUnsupportedResponseType";
      }
    };
    ErrorServerError = class extends ErrorAuthenticationGrant {
      static {
        __name(this, "ErrorServerError");
      }
      toString() {
        return "ErrorServerError";
      }
    };
    ErrorTemporarilyUnavailable = class extends ErrorAuthenticationGrant {
      static {
        __name(this, "ErrorTemporarilyUnavailable");
      }
      toString() {
        return "ErrorTemporarilyUnavailable";
      }
    };
    ErrorAccessTokenResponse = class extends ErrorOAuth2 {
      static {
        __name(this, "ErrorAccessTokenResponse");
      }
      toString() {
        return "ErrorAccessTokenResponse";
      }
    };
    ErrorInvalidClient = class extends ErrorAccessTokenResponse {
      static {
        __name(this, "ErrorInvalidClient");
      }
      toString() {
        return "ErrorInvalidClient";
      }
    };
    ErrorInvalidGrant = class extends ErrorAccessTokenResponse {
      static {
        __name(this, "ErrorInvalidGrant");
      }
      toString() {
        return "ErrorInvalidGrant";
      }
    };
    ErrorUnsupportedGrantType = class extends ErrorAccessTokenResponse {
      static {
        __name(this, "ErrorUnsupportedGrantType");
      }
      toString() {
        return "ErrorUnsupportedGrantType";
      }
    };
    __name(toErrorClass, "toErrorClass");
    RECOMMENDED_CODE_VERIFIER_LENGTH = 96;
    RECOMMENDED_STATE_LENGTH = 32;
    PKCE_CHARSET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~";
    __name(isReturningFromAuthServer, "isReturningFromAuthServer");
    __name(getAuthURL, "getAuthURL");
    __name(exchangeRefreshTokenForAccessToken, "exchangeRefreshTokenForAccessToken");
    __name(exchangeAuthCodeForAccessToken, "exchangeAuthCodeForAccessToken");
    __name(base64urlEncode, "base64urlEncode");
    __name(generatePKCECodes, "generatePKCECodes");
    __name(getAuthConfigFilePath, "getAuthConfigFilePath");
    __name(writeAuthConfigFile, "writeAuthConfigFile");
    __name(readAuthConfigFile, "readAuthConfigFile");
    __name(loginOrRefreshIfRequired, "loginOrRefreshIfRequired");
    __name(getOAuthTokenFromLocalState, "getOAuthTokenFromLocalState");
    __name(getOauthToken, "getOauthToken");
    __name(login, "login");
    __name(isAccessTokenExpired, "isAccessTokenExpired");
    __name(refreshToken, "refreshToken");
    __name(logout, "logout");
    __name(listScopes, "listScopes");
    __name(getAccountId, "getAccountId");
    __name(requireAuth, "requireAuth");
    __name(requireApiToken, "requireApiToken");
    __name(saveAccountToCache, "saveAccountToCache");
    __name(getAccountFromCache, "getAccountFromCache");
    __name(getScopes, "getScopes");
    __name(printScopes, "printScopes");
    __name(fetchAuthToken, "fetchAuthToken");
    __name(getJSONFromResponse, "getJSONFromResponse");
  }
});

// src/user/index.ts
var init_user3 = __esm({
  "src/user/index.ts"() {
    init_import_meta_url();
    init_user2();
    init_choose_account();
  }
});
function rewriteNodeCompatBuildFailure(errors, compatMode = null) {
  for (const error2 of errors) {
    const match3 = nodeBuiltinResolveErrorText.exec(error2.text);
    if (match3 !== null) {
      let text = `The package "${match3[1]}" wasn't found on the file system but is built into node.
`;
      if (compatMode === null || compatMode === "als") {
        text += `- Add the "nodejs_compat" compatibility flag to your project.
`;
      } else if (compatMode === "v1" && !match3[1].startsWith("node:")) {
        text += `- Make sure to prefix the module name with "node:" or update your compatibility_date to 2024-09-23 or later.
`;
      }
      error2.notes = [
        {
          location: null,
          text
        }
      ];
    }
  }
}
function rewriteUnresolvedModuleBuildFailure(errors) {
  for (const error2 of errors) {
    const match3 = couldNotResolveErrorText.exec(error2.text);
    if (match3 !== null && !nodeBuiltinResolveErrorText.test(error2.text)) {
      const hasExternalSuggestion = error2.notes?.some(
        (note) => note.text?.includes(markAsExternalNoteText)
      );
      if (hasExternalSuggestion) {
        error2.notes = [
          ...(error2.notes ?? []).filter(
            (note) => !note.text?.includes(markAsExternalNoteText)
          ),
          {
            location: null,
            text: `To fix this, you can add an entry to "alias" in your Wrangler configuration.
For more guidance see: https://developers.cloudflare.com/workers/wrangler/configuration/#bundling-issues
`
          }
        ];
      }
    }
  }
}
function isBuildFailure(err) {
  return typeof err === "object" && err !== null && "errors" in err && "warnings" in err;
}
function isBuildFailureFromCause(err) {
  return typeof err === "object" && err !== null && "cause" in err && isBuildFailure(err.cause);
}
var nodeBuiltinResolveErrorText, couldNotResolveErrorText, markAsExternalNoteText;
var init_build_failures = __esm({
  "src/deployment-bundle/build-failures.ts"() {
    init_import_meta_url();
    nodeBuiltinResolveErrorText = new RegExp(
      '^Could not resolve "(' + module$1.builtinModules.join("|") + "|" + module$1.builtinModules.map((module2) => "node:" + module2).join("|") + ')"$'
    );
    __name(rewriteNodeCompatBuildFailure, "rewriteNodeCompatBuildFailure");
    couldNotResolveErrorText = /^Could not resolve "(.+?)"$/;
    markAsExternalNoteText = "as external to exclude it from the bundle";
    __name(rewriteUnresolvedModuleBuildFailure, "rewriteUnresolvedModuleBuildFailure");
    __name(isBuildFailure, "isBuildFailure");
    __name(isBuildFailureFromCause, "isBuildFailureFromCause");
  }
});
function defaultOptions2() {
  return {
    root: ".",
    fileFilter: /* @__PURE__ */ __name((_path) => true, "fileFilter"),
    directoryFilter: /* @__PURE__ */ __name((_path) => true, "directoryFilter"),
    type: FILE_TYPE,
    lstat: false,
    depth: 2147483648,
    alwaysStat: false,
    highWaterMark: 4096
  };
}
var RECURSIVE_ERROR_CODE, NORMAL_FLOW_ERRORS, FILE_TYPE, DIR_TYPE, FILE_DIR_TYPE, EVERYTHING_TYPE, ALL_TYPES, DIR_TYPES, FILE_TYPES, isNormalFlowError, wantBigintFsStats, emptyFn, normalizeFilter, ReaddirpStream, readdirp;
var init_esm5 = __esm({
  "../../node_modules/.pnpm/readdirp@4.0.1/node_modules/readdirp/esm/index.js"() {
    init_import_meta_url();
    __name(defaultOptions2, "defaultOptions");
    RECURSIVE_ERROR_CODE = "READDIRP_RECURSIVE_ERROR";
    NORMAL_FLOW_ERRORS = /* @__PURE__ */ new Set(["ENOENT", "EPERM", "EACCES", "ELOOP", RECURSIVE_ERROR_CODE]);
    FILE_TYPE = "files";
    DIR_TYPE = "directories";
    FILE_DIR_TYPE = "files_directories";
    EVERYTHING_TYPE = "all";
    ALL_TYPES = [FILE_TYPE, DIR_TYPE, FILE_DIR_TYPE, EVERYTHING_TYPE];
    DIR_TYPES = /* @__PURE__ */ new Set([DIR_TYPE, FILE_DIR_TYPE, EVERYTHING_TYPE]);
    FILE_TYPES = /* @__PURE__ */ new Set([FILE_TYPE, FILE_DIR_TYPE, EVERYTHING_TYPE]);
    isNormalFlowError = /* @__PURE__ */ __name((error2) => NORMAL_FLOW_ERRORS.has(error2.code), "isNormalFlowError");
    wantBigintFsStats = process.platform === "win32";
    emptyFn = /* @__PURE__ */ __name((_path) => true, "emptyFn");
    normalizeFilter = /* @__PURE__ */ __name((filter2) => {
      if (filter2 === void 0)
        return emptyFn;
      if (typeof filter2 === "function")
        return filter2;
      if (typeof filter2 === "string") {
        const fl = filter2.trim();
        return (entry) => entry.basename === fl;
      }
      if (Array.isArray(filter2)) {
        const trItems = filter2.map((item) => item.trim());
        return (entry) => trItems.some((f8) => entry.basename === f8);
      }
      return emptyFn;
    }, "normalizeFilter");
    ReaddirpStream = class extends Stream.Readable {
      static {
        __name(this, "ReaddirpStream");
      }
      constructor(options = {}) {
        super({
          objectMode: true,
          autoDestroy: true,
          highWaterMark: options.highWaterMark
        });
        const opts = { ...defaultOptions2(), ...options };
        const { root, type } = opts;
        this._fileFilter = normalizeFilter(opts.fileFilter);
        this._directoryFilter = normalizeFilter(opts.directoryFilter);
        const statMethod = opts.lstat ? fs29.lstatSync : fs29.statSync;
        if (wantBigintFsStats) {
          this._stat = (path84) => statMethod(path84, { bigint: true });
        } else {
          this._stat = statMethod;
        }
        this._maxDepth = opts.depth;
        this._wantsDir = DIR_TYPES.has(type);
        this._wantsFile = FILE_TYPES.has(type);
        this._wantsEverything = type === EVERYTHING_TYPE;
        this._root = path3.resolve(root);
        this._isDirent = !opts.alwaysStat;
        this._statsProp = this._isDirent ? "dirent" : "stats";
        this._rdOptions = { encoding: "utf8", withFileTypes: this._isDirent };
        this.parents = [this._exploreDir(root, 1)];
        this.reading = false;
        this.parent = void 0;
      }
      async _read(batch) {
        if (this.reading)
          return;
        this.reading = true;
        try {
          while (!this.destroyed && batch > 0) {
            const par = this.parent;
            const fil = par && par.files;
            if (fil && fil.length > 0) {
              const { path: path84, depth } = par;
              const slice = fil.splice(0, batch).map((dirent) => this._formatEntry(dirent, path84));
              for (const entry of slice) {
                if (!entry) {
                  batch--;
                  return;
                }
                if (this.destroyed)
                  return;
                const entryType = await this._getEntryType(entry);
                if (entryType === "directory" && this._directoryFilter(entry)) {
                  if (depth <= this._maxDepth) {
                    this.parents.push(this._exploreDir(entry.fullPath, depth + 1));
                  }
                  if (this._wantsDir) {
                    this.push(entry);
                    batch--;
                  }
                } else if ((entryType === "file" || this._includeAsFile(entry)) && this._fileFilter(entry)) {
                  if (this._wantsFile) {
                    this.push(entry);
                    batch--;
                  }
                }
              }
            } else {
              const parent = this.parents.pop();
              if (!parent) {
                this.push(null);
                break;
              }
              this.parent = await parent;
              if (this.destroyed)
                return;
            }
          }
        } catch (error2) {
          this.destroy(error2);
        } finally {
          this.reading = false;
        }
      }
      async _exploreDir(path84, depth) {
        let files;
        try {
          files = await fs9.readdir(path84, this._rdOptions);
        } catch (error2) {
          this._onError(error2);
        }
        return { files, depth, path: path84 };
      }
      _formatEntry(dirent, path84) {
        let entry;
        const basename11 = this._isDirent ? dirent.name : dirent;
        try {
          const fullPath = path3.resolve(path3.join(path84, basename11));
          entry = { path: path3.relative(this._root, fullPath), fullPath, basename: basename11 };
          entry[this._statsProp] = this._isDirent ? dirent : this._stat(fullPath);
        } catch (err) {
          this._onError(err);
          return;
        }
        return entry;
      }
      _onError(err) {
        if (isNormalFlowError(err) && !this.destroyed) {
          this.emit("warn", err);
        } else {
          this.destroy(err);
        }
      }
      async _getEntryType(entry) {
        if (!entry && this._statsProp in entry) {
          return "";
        }
        const stats = entry[this._statsProp];
        if (stats.isFile())
          return "file";
        if (stats.isDirectory())
          return "directory";
        if (stats && stats.isSymbolicLink()) {
          const full = entry.fullPath;
          try {
            const entryRealPath = await fs9.realpath(full);
            const entryRealPathStats = fs29.lstatSync(entryRealPath);
            if (entryRealPathStats.isFile()) {
              return "file";
            }
            if (entryRealPathStats.isDirectory()) {
              const len = entryRealPath.length;
              if (full.startsWith(entryRealPath) && full.substr(len, 1) === path3.sep) {
                const recursiveError = new Error(`Circular symlink detected: "${full}" points to "${entryRealPath}"`);
                recursiveError.code = RECURSIVE_ERROR_CODE;
                return this._onError(recursiveError);
              }
              return "directory";
            }
          } catch (error2) {
            this._onError(error2);
            return "";
          }
        }
      }
      _includeAsFile(entry) {
        const stats = entry && entry[this._statsProp];
        return stats && this._wantsEverything && !stats.isDirectory();
      }
    };
    readdirp = /* @__PURE__ */ __name((root, options = {}) => {
      let type = options.entryType || options.type;
      if (type === "both")
        type = FILE_DIR_TYPE;
      if (type)
        options.type = type;
      if (!root) {
        throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");
      } else if (typeof root !== "string") {
        throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");
      } else if (type && !ALL_TYPES.includes(type)) {
        throw new Error(`readdirp: Invalid type passed. Use one of ${ALL_TYPES.join(", ")}`);
      }
      options.root = root;
      return new ReaddirpStream(options);
    }, "readdirp");
  }
});
function createFsWatchInstance(path84, options, listener, errHandler, emitRaw) {
  const handleEvent = /* @__PURE__ */ __name((rawEvent, evPath) => {
    listener(path84);
    emitRaw(rawEvent, evPath, { watchedPath: path84 });
    if (evPath && path84 !== evPath) {
      fsWatchBroadcast(path3__namespace.resolve(path84, evPath), KEY_LISTENERS, path3__namespace.join(path84, evPath));
    }
  }, "handleEvent");
  try {
    return fs29.watch(path84, {
      persistent: options.persistent
    }, handleEvent);
  } catch (error2) {
    errHandler(error2);
    return void 0;
  }
}
var STR_DATA, STR_END, STR_CLOSE, EMPTY_FN, pl, isWindows2, isMacos, isLinux, isIBMi, EVENTS, EV, THROTTLE_MODE_WATCH, statMethods, KEY_LISTENERS, KEY_ERR, KEY_RAW, HANDLER_KEYS, binaryExtensions, isBinaryPath, foreach, addAndConvert, clearItem, delFromSet, isEmptySet, FsWatchInstances, fsWatchBroadcast, setFsWatchListener, FsWatchFileInstances, setFsWatchFileListener, NodeFsHandler;
var init_handler = __esm({
  "../../node_modules/.pnpm/chokidar@4.0.1/node_modules/chokidar/esm/handler.js"() {
    init_import_meta_url();
    STR_DATA = "data";
    STR_END = "end";
    STR_CLOSE = "close";
    EMPTY_FN = /* @__PURE__ */ __name(() => {
    }, "EMPTY_FN");
    pl = process.platform;
    isWindows2 = pl === "win32";
    isMacos = pl === "darwin";
    isLinux = pl === "linux";
    isIBMi = os11.type() === "OS400";
    EVENTS = {
      ALL: "all",
      READY: "ready",
      ADD: "add",
      CHANGE: "change",
      ADD_DIR: "addDir",
      UNLINK: "unlink",
      UNLINK_DIR: "unlinkDir",
      RAW: "raw",
      ERROR: "error"
    };
    EV = EVENTS;
    THROTTLE_MODE_WATCH = "watch";
    statMethods = { lstat: fs9.lstat, stat: fs9.stat };
    KEY_LISTENERS = "listeners";
    KEY_ERR = "errHandlers";
    KEY_RAW = "rawEmitters";
    HANDLER_KEYS = [KEY_LISTENERS, KEY_ERR, KEY_RAW];
    binaryExtensions = /* @__PURE__ */ new Set([
      "3dm",
      "3ds",
      "3g2",
      "3gp",
      "7z",
      "a",
      "aac",
      "adp",
      "afdesign",
      "afphoto",
      "afpub",
      "ai",
      "aif",
      "aiff",
      "alz",
      "ape",
      "apk",
      "appimage",
      "ar",
      "arj",
      "asf",
      "au",
      "avi",
      "bak",
      "baml",
      "bh",
      "bin",
      "bk",
      "bmp",
      "btif",
      "bz2",
      "bzip2",
      "cab",
      "caf",
      "cgm",
      "class",
      "cmx",
      "cpio",
      "cr2",
      "cur",
      "dat",
      "dcm",
      "deb",
      "dex",
      "djvu",
      "dll",
      "dmg",
      "dng",
      "doc",
      "docm",
      "docx",
      "dot",
      "dotm",
      "dra",
      "DS_Store",
      "dsk",
      "dts",
      "dtshd",
      "dvb",
      "dwg",
      "dxf",
      "ecelp4800",
      "ecelp7470",
      "ecelp9600",
      "egg",
      "eol",
      "eot",
      "epub",
      "exe",
      "f4v",
      "fbs",
      "fh",
      "fla",
      "flac",
      "flatpak",
      "fli",
      "flv",
      "fpx",
      "fst",
      "fvt",
      "g3",
      "gh",
      "gif",
      "graffle",
      "gz",
      "gzip",
      "h261",
      "h263",
      "h264",
      "icns",
      "ico",
      "ief",
      "img",
      "ipa",
      "iso",
      "jar",
      "jpeg",
      "jpg",
      "jpgv",
      "jpm",
      "jxr",
      "key",
      "ktx",
      "lha",
      "lib",
      "lvp",
      "lz",
      "lzh",
      "lzma",
      "lzo",
      "m3u",
      "m4a",
      "m4v",
      "mar",
      "mdi",
      "mht",
      "mid",
      "midi",
      "mj2",
      "mka",
      "mkv",
      "mmr",
      "mng",
      "mobi",
      "mov",
      "movie",
      "mp3",
      "mp4",
      "mp4a",
      "mpeg",
      "mpg",
      "mpga",
      "mxu",
      "nef",
      "npx",
      "numbers",
      "nupkg",
      "o",
      "odp",
      "ods",
      "odt",
      "oga",
      "ogg",
      "ogv",
      "otf",
      "ott",
      "pages",
      "pbm",
      "pcx",
      "pdb",
      "pdf",
      "pea",
      "pgm",
      "pic",
      "png",
      "pnm",
      "pot",
      "potm",
      "potx",
      "ppa",
      "ppam",
      "ppm",
      "pps",
      "ppsm",
      "ppsx",
      "ppt",
      "pptm",
      "pptx",
      "psd",
      "pya",
      "pyc",
      "pyo",
      "pyv",
      "qt",
      "rar",
      "ras",
      "raw",
      "resources",
      "rgb",
      "rip",
      "rlc",
      "rmf",
      "rmvb",
      "rpm",
      "rtf",
      "rz",
      "s3m",
      "s7z",
      "scpt",
      "sgi",
      "shar",
      "snap",
      "sil",
      "sketch",
      "slk",
      "smv",
      "snk",
      "so",
      "stl",
      "suo",
      "sub",
      "swf",
      "tar",
      "tbz",
      "tbz2",
      "tga",
      "tgz",
      "thmx",
      "tif",
      "tiff",
      "tlz",
      "ttc",
      "ttf",
      "txz",
      "udf",
      "uvh",
      "uvi",
      "uvm",
      "uvp",
      "uvs",
      "uvu",
      "viv",
      "vob",
      "war",
      "wav",
      "wax",
      "wbmp",
      "wdp",
      "weba",
      "webm",
      "webp",
      "whl",
      "wim",
      "wm",
      "wma",
      "wmv",
      "wmx",
      "woff",
      "woff2",
      "wrm",
      "wvx",
      "xbm",
      "xif",
      "xla",
      "xlam",
      "xls",
      "xlsb",
      "xlsm",
      "xlsx",
      "xlt",
      "xltm",
      "xltx",
      "xm",
      "xmind",
      "xpi",
      "xpm",
      "xwd",
      "xz",
      "z",
      "zip",
      "zipx"
    ]);
    isBinaryPath = /* @__PURE__ */ __name((filePath) => binaryExtensions.has(path3__namespace.extname(filePath).slice(1).toLowerCase()), "isBinaryPath");
    foreach = /* @__PURE__ */ __name((val2, fn2) => {
      if (val2 instanceof Set) {
        val2.forEach(fn2);
      } else {
        fn2(val2);
      }
    }, "foreach");
    addAndConvert = /* @__PURE__ */ __name((main2, prop, item) => {
      let container = main2[prop];
      if (!(container instanceof Set)) {
        main2[prop] = container = /* @__PURE__ */ new Set([container]);
      }
      container.add(item);
    }, "addAndConvert");
    clearItem = /* @__PURE__ */ __name((cont) => (key) => {
      const set = cont[key];
      if (set instanceof Set) {
        set.clear();
      } else {
        delete cont[key];
      }
    }, "clearItem");
    delFromSet = /* @__PURE__ */ __name((main2, prop, item) => {
      const container = main2[prop];
      if (container instanceof Set) {
        container.delete(item);
      } else if (container === item) {
        delete main2[prop];
      }
    }, "delFromSet");
    isEmptySet = /* @__PURE__ */ __name((val2) => val2 instanceof Set ? val2.size === 0 : !val2, "isEmptySet");
    FsWatchInstances = /* @__PURE__ */ new Map();
    __name(createFsWatchInstance, "createFsWatchInstance");
    fsWatchBroadcast = /* @__PURE__ */ __name((fullPath, listenerType, val1, val2, val3) => {
      const cont = FsWatchInstances.get(fullPath);
      if (!cont)
        return;
      foreach(cont[listenerType], (listener) => {
        listener(val1, val2, val3);
      });
    }, "fsWatchBroadcast");
    setFsWatchListener = /* @__PURE__ */ __name((path84, fullPath, options, handlers2) => {
      const { listener, errHandler, rawEmitter } = handlers2;
      let cont = FsWatchInstances.get(fullPath);
      let watcher;
      if (!options.persistent) {
        watcher = createFsWatchInstance(path84, options, listener, errHandler, rawEmitter);
        if (!watcher)
          return;
        return watcher.close.bind(watcher);
      }
      if (cont) {
        addAndConvert(cont, KEY_LISTENERS, listener);
        addAndConvert(cont, KEY_ERR, errHandler);
        addAndConvert(cont, KEY_RAW, rawEmitter);
      } else {
        watcher = createFsWatchInstance(
          path84,
          options,
          fsWatchBroadcast.bind(null, fullPath, KEY_LISTENERS),
          errHandler,
          // no need to use broadcast here
          fsWatchBroadcast.bind(null, fullPath, KEY_RAW)
        );
        if (!watcher)
          return;
        watcher.on(EV.ERROR, async (error2) => {
          const broadcastErr = fsWatchBroadcast.bind(null, fullPath, KEY_ERR);
          if (cont)
            cont.watcherUnusable = true;
          if (isWindows2 && error2.code === "EPERM") {
            try {
              const fd = await fs9.open(path84, "r");
              await fd.close();
              broadcastErr(error2);
            } catch (err) {
            }
          } else {
            broadcastErr(error2);
          }
        });
        cont = {
          listeners: listener,
          errHandlers: errHandler,
          rawEmitters: rawEmitter,
          watcher
        };
        FsWatchInstances.set(fullPath, cont);
      }
      return () => {
        delFromSet(cont, KEY_LISTENERS, listener);
        delFromSet(cont, KEY_ERR, errHandler);
        delFromSet(cont, KEY_RAW, rawEmitter);
        if (isEmptySet(cont.listeners)) {
          cont.watcher.close();
          FsWatchInstances.delete(fullPath);
          HANDLER_KEYS.forEach(clearItem(cont));
          cont.watcher = void 0;
          Object.freeze(cont);
        }
      };
    }, "setFsWatchListener");
    FsWatchFileInstances = /* @__PURE__ */ new Map();
    setFsWatchFileListener = /* @__PURE__ */ __name((path84, fullPath, options, handlers2) => {
      const { listener, rawEmitter } = handlers2;
      let cont = FsWatchFileInstances.get(fullPath);
      const copts = cont && cont.options;
      if (copts && (copts.persistent < options.persistent || copts.interval > options.interval)) {
        fs29.unwatchFile(fullPath);
        cont = void 0;
      }
      if (cont) {
        addAndConvert(cont, KEY_LISTENERS, listener);
        addAndConvert(cont, KEY_RAW, rawEmitter);
      } else {
        cont = {
          listeners: listener,
          rawEmitters: rawEmitter,
          options,
          watcher: fs29.watchFile(fullPath, options, (curr, prev) => {
            foreach(cont.rawEmitters, (rawEmitter2) => {
              rawEmitter2(EV.CHANGE, fullPath, { curr, prev });
            });
            const currmtime = curr.mtimeMs;
            if (curr.size !== prev.size || currmtime > prev.mtimeMs || currmtime === 0) {
              foreach(cont.listeners, (listener2) => listener2(path84, curr));
            }
          })
        };
        FsWatchFileInstances.set(fullPath, cont);
      }
      return () => {
        delFromSet(cont, KEY_LISTENERS, listener);
        delFromSet(cont, KEY_RAW, rawEmitter);
        if (isEmptySet(cont.listeners)) {
          FsWatchFileInstances.delete(fullPath);
          fs29.unwatchFile(fullPath);
          cont.options = cont.watcher = void 0;
          Object.freeze(cont);
        }
      };
    }, "setFsWatchFileListener");
    NodeFsHandler = class {
      static {
        __name(this, "NodeFsHandler");
      }
      constructor(fsW) {
        this.fsw = fsW;
        this._boundHandleError = (error2) => fsW._handleError(error2);
      }
      /**
       * Watch file for changes with fs_watchFile or fs_watch.
       * @param path to file or dir
       * @param listener on fs change
       * @returns closer for the watcher instance
       */
      _watchWithNodeFs(path84, listener) {
        const opts = this.fsw.options;
        const directory = path3__namespace.dirname(path84);
        const basename11 = path3__namespace.basename(path84);
        const parent = this.fsw._getWatchedDir(directory);
        parent.add(basename11);
        const absolutePath = path3__namespace.resolve(path84);
        const options = {
          persistent: opts.persistent
        };
        if (!listener)
          listener = EMPTY_FN;
        let closer;
        if (opts.usePolling) {
          const enableBin = opts.interval !== opts.binaryInterval;
          options.interval = enableBin && isBinaryPath(basename11) ? opts.binaryInterval : opts.interval;
          closer = setFsWatchFileListener(path84, absolutePath, options, {
            listener,
            rawEmitter: this.fsw._emitRaw
          });
        } else {
          closer = setFsWatchListener(path84, absolutePath, options, {
            listener,
            errHandler: this._boundHandleError,
            rawEmitter: this.fsw._emitRaw
          });
        }
        return closer;
      }
      /**
       * Watch a file and emit add event if warranted.
       * @returns closer for the watcher instance
       */
      _handleFile(file3, stats, initialAdd) {
        if (this.fsw.closed) {
          return;
        }
        const dirname22 = path3__namespace.dirname(file3);
        const basename11 = path3__namespace.basename(file3);
        const parent = this.fsw._getWatchedDir(dirname22);
        let prevStats = stats;
        if (parent.has(basename11))
          return;
        const listener = /* @__PURE__ */ __name(async (path84, newStats) => {
          if (!this.fsw._throttle(THROTTLE_MODE_WATCH, file3, 5))
            return;
          if (!newStats || newStats.mtimeMs === 0) {
            try {
              const newStats2 = await fs9.stat(file3);
              if (this.fsw.closed)
                return;
              const at3 = newStats2.atimeMs;
              const mt2 = newStats2.mtimeMs;
              if (!at3 || at3 <= mt2 || mt2 !== prevStats.mtimeMs) {
                this.fsw._emit(EV.CHANGE, file3, newStats2);
              }
              if ((isMacos || isLinux) && prevStats.ino !== newStats2.ino) {
                this.fsw._closeFile(path84);
                prevStats = newStats2;
                const closer2 = this._watchWithNodeFs(file3, listener);
                if (closer2)
                  this.fsw._addPathCloser(path84, closer2);
              } else {
                prevStats = newStats2;
              }
            } catch (error2) {
              this.fsw._remove(dirname22, basename11);
            }
          } else if (parent.has(basename11)) {
            const at3 = newStats.atimeMs;
            const mt2 = newStats.mtimeMs;
            if (!at3 || at3 <= mt2 || mt2 !== prevStats.mtimeMs) {
              this.fsw._emit(EV.CHANGE, file3, newStats);
            }
            prevStats = newStats;
          }
        }, "listener");
        const closer = this._watchWithNodeFs(file3, listener);
        if (!(initialAdd && this.fsw.options.ignoreInitial) && this.fsw._isntIgnored(file3)) {
          if (!this.fsw._throttle(EV.ADD, file3, 0))
            return;
          this.fsw._emit(EV.ADD, file3, stats);
        }
        return closer;
      }
      /**
       * Handle symlinks encountered while reading a dir.
       * @param entry returned by readdirp
       * @param directory path of dir being read
       * @param path of this item
       * @param item basename of this item
       * @returns true if no more processing is needed for this entry.
       */
      async _handleSymlink(entry, directory, path84, item) {
        if (this.fsw.closed) {
          return;
        }
        const full = entry.fullPath;
        const dir2 = this.fsw._getWatchedDir(directory);
        if (!this.fsw.options.followSymlinks) {
          this.fsw._incrReadyCount();
          let linkPath;
          try {
            linkPath = await fs9.realpath(path84);
          } catch (e10) {
            this.fsw._emitReady();
            return true;
          }
          if (this.fsw.closed)
            return;
          if (dir2.has(item)) {
            if (this.fsw._symlinkPaths.get(full) !== linkPath) {
              this.fsw._symlinkPaths.set(full, linkPath);
              this.fsw._emit(EV.CHANGE, path84, entry.stats);
            }
          } else {
            dir2.add(item);
            this.fsw._symlinkPaths.set(full, linkPath);
            this.fsw._emit(EV.ADD, path84, entry.stats);
          }
          this.fsw._emitReady();
          return true;
        }
        if (this.fsw._symlinkPaths.has(full)) {
          return true;
        }
        this.fsw._symlinkPaths.set(full, true);
      }
      _handleRead(directory, initialAdd, wh, target, dir2, depth, throttler) {
        directory = path3__namespace.join(directory, "");
        throttler = this.fsw._throttle("readdir", directory, 1e3);
        if (!throttler)
          return;
        const previous = this.fsw._getWatchedDir(wh.path);
        const current = /* @__PURE__ */ new Set();
        let stream2 = this.fsw._readdirp(directory, {
          fileFilter: /* @__PURE__ */ __name((entry) => wh.filterPath(entry), "fileFilter"),
          directoryFilter: /* @__PURE__ */ __name((entry) => wh.filterDir(entry), "directoryFilter")
        });
        if (!stream2)
          return;
        stream2.on(STR_DATA, async (entry) => {
          if (this.fsw.closed) {
            stream2 = void 0;
            return;
          }
          const item = entry.path;
          let path84 = path3__namespace.join(directory, item);
          current.add(item);
          if (entry.stats.isSymbolicLink() && await this._handleSymlink(entry, directory, path84, item)) {
            return;
          }
          if (this.fsw.closed) {
            stream2 = void 0;
            return;
          }
          if (item === target || !target && !previous.has(item)) {
            this.fsw._incrReadyCount();
            path84 = path3__namespace.join(dir2, path3__namespace.relative(dir2, path84));
            this._addToNodeFs(path84, initialAdd, wh, depth + 1);
          }
        }).on(EV.ERROR, this._boundHandleError);
        return new Promise((resolve32, reject) => {
          if (!stream2)
            return reject();
          stream2.once(STR_END, () => {
            if (this.fsw.closed) {
              stream2 = void 0;
              return;
            }
            const wasThrottled = throttler ? throttler.clear() : false;
            resolve32(void 0);
            previous.getChildren().filter((item) => {
              return item !== directory && !current.has(item);
            }).forEach((item) => {
              this.fsw._remove(directory, item);
            });
            stream2 = void 0;
            if (wasThrottled)
              this._handleRead(directory, false, wh, target, dir2, depth, throttler);
          });
        });
      }
      /**
       * Read directory to add / remove files from `@watched` list and re-read it on change.
       * @param dir fs path
       * @param stats
       * @param initialAdd
       * @param depth relative to user-supplied path
       * @param target child path targeted for watch
       * @param wh Common watch helpers for this path
       * @param realpath
       * @returns closer for the watcher instance.
       */
      async _handleDir(dir2, stats, initialAdd, depth, target, wh, realpath2) {
        const parentDir = this.fsw._getWatchedDir(path3__namespace.dirname(dir2));
        const tracked = parentDir.has(path3__namespace.basename(dir2));
        if (!(initialAdd && this.fsw.options.ignoreInitial) && !target && !tracked) {
          this.fsw._emit(EV.ADD_DIR, dir2, stats);
        }
        parentDir.add(path3__namespace.basename(dir2));
        this.fsw._getWatchedDir(dir2);
        let throttler;
        let closer;
        const oDepth = this.fsw.options.depth;
        if ((oDepth == null || depth <= oDepth) && !this.fsw._symlinkPaths.has(realpath2)) {
          if (!target) {
            await this._handleRead(dir2, initialAdd, wh, target, dir2, depth, throttler);
            if (this.fsw.closed)
              return;
          }
          closer = this._watchWithNodeFs(dir2, (dirPath, stats2) => {
            if (stats2 && stats2.mtimeMs === 0)
              return;
            this._handleRead(dirPath, false, wh, target, dir2, depth, throttler);
          });
        }
        return closer;
      }
      /**
       * Handle added file, directory, or glob pattern.
       * Delegates call to _handleFile / _handleDir after checks.
       * @param path to file or ir
       * @param initialAdd was the file added at watch instantiation?
       * @param priorWh depth relative to user-supplied path
       * @param depth Child path actually targeted for watch
       * @param target Child path actually targeted for watch
       */
      async _addToNodeFs(path84, initialAdd, priorWh, depth, target) {
        const ready = this.fsw._emitReady;
        if (this.fsw._isIgnored(path84) || this.fsw.closed) {
          ready();
          return false;
        }
        const wh = this.fsw._getWatchHelpers(path84);
        if (priorWh) {
          wh.filterPath = (entry) => priorWh.filterPath(entry);
          wh.filterDir = (entry) => priorWh.filterDir(entry);
        }
        try {
          const stats = await statMethods[wh.statMethod](wh.watchPath);
          if (this.fsw.closed)
            return;
          if (this.fsw._isIgnored(wh.watchPath, stats)) {
            ready();
            return false;
          }
          const follow = this.fsw.options.followSymlinks;
          let closer;
          if (stats.isDirectory()) {
            const absPath = path3__namespace.resolve(path84);
            const targetPath = follow ? await fs9.realpath(path84) : path84;
            if (this.fsw.closed)
              return;
            closer = await this._handleDir(wh.watchPath, stats, initialAdd, depth, target, wh, targetPath);
            if (this.fsw.closed)
              return;
            if (absPath !== targetPath && targetPath !== void 0) {
              this.fsw._symlinkPaths.set(absPath, targetPath);
            }
          } else if (stats.isSymbolicLink()) {
            const targetPath = follow ? await fs9.realpath(path84) : path84;
            if (this.fsw.closed)
              return;
            const parent = path3__namespace.dirname(wh.watchPath);
            this.fsw._getWatchedDir(parent).add(wh.watchPath);
            this.fsw._emit(EV.ADD, wh.watchPath, stats);
            closer = await this._handleDir(parent, stats, initialAdd, depth, path84, wh, targetPath);
            if (this.fsw.closed)
              return;
            if (targetPath !== void 0) {
              this.fsw._symlinkPaths.set(path3__namespace.resolve(path84), targetPath);
            }
          } else {
            closer = this._handleFile(wh.watchPath, stats, initialAdd);
          }
          ready();
          if (closer)
            this.fsw._addPathCloser(path84, closer);
          return false;
        } catch (error2) {
          if (this.fsw._handleError(error2)) {
            ready();
            return path84;
          }
        }
      }
    };
  }
});
function arrify(item) {
  return Array.isArray(item) ? item : [item];
}
function createPattern(matcher) {
  if (typeof matcher === "function")
    return matcher;
  if (typeof matcher === "string")
    return (string) => matcher === string;
  if (matcher instanceof RegExp)
    return (string) => matcher.test(string);
  if (typeof matcher === "object" && matcher !== null) {
    return (string) => {
      if (matcher.path === string)
        return true;
      if (matcher.recursive) {
        const relative16 = path3__namespace.relative(matcher.path, string);
        if (!relative16) {
          return false;
        }
        return !relative16.startsWith("..") && !path3__namespace.isAbsolute(relative16);
      }
      return false;
    };
  }
  return () => false;
}
function normalizePath(path84) {
  if (typeof path84 !== "string")
    throw new Error("string expected");
  path84 = path3__namespace.normalize(path84);
  path84 = path84.replace(/\\/g, "/");
  let prepend = false;
  if (path84.startsWith("//"))
    prepend = true;
  const DOUBLE_SLASH_RE2 = /\/\//;
  while (path84.match(DOUBLE_SLASH_RE2))
    path84 = path84.replace(DOUBLE_SLASH_RE2, "/");
  if (prepend)
    path84 = "/" + path84;
  return path84;
}
function matchPatterns(patterns, testString, stats) {
  const path84 = normalizePath(testString);
  for (let index = 0; index < patterns.length; index++) {
    const pattern = patterns[index];
    if (pattern(path84, stats)) {
      return true;
    }
  }
  return false;
}
function anymatch(matchers, testString) {
  if (matchers == null) {
    throw new TypeError("anymatch: specify first argument");
  }
  const matchersArray = arrify(matchers);
  const patterns = matchersArray.map((matcher) => createPattern(matcher));
  if (testString == null) {
    return (testString2, stats) => {
      return matchPatterns(patterns, testString2, stats);
    };
  }
  return matchPatterns(patterns, testString);
}
function watch(paths, options = {}) {
  const watcher = new FSWatcher(options);
  watcher.add(paths);
  return watcher;
}
var SLASH, SLASH_SLASH, ONE_DOT, TWO_DOTS, STRING_TYPE, BACK_SLASH_RE, DOUBLE_SLASH_RE, DOT_RE, REPLACER_RE, isMatcherObject, unifyPaths, toUnix, normalizePathToUnix, normalizeIgnored, getAbsolutePath, EMPTY_SET, DirEntry, STAT_METHOD_F, STAT_METHOD_L, WatchHelper, FSWatcher;
var init_esm6 = __esm({
  "../../node_modules/.pnpm/chokidar@4.0.1/node_modules/chokidar/esm/index.js"() {
    init_import_meta_url();
    init_esm5();
    init_handler();
    SLASH = "/";
    SLASH_SLASH = "//";
    ONE_DOT = ".";
    TWO_DOTS = "..";
    STRING_TYPE = "string";
    BACK_SLASH_RE = /\\/g;
    DOUBLE_SLASH_RE = /\/\//;
    DOT_RE = /\..*\.(sw[px])$|~$|\.subl.*\.tmp/;
    REPLACER_RE = /^\.[/\\]/;
    __name(arrify, "arrify");
    isMatcherObject = /* @__PURE__ */ __name((matcher) => typeof matcher === "object" && matcher !== null && !(matcher instanceof RegExp), "isMatcherObject");
    __name(createPattern, "createPattern");
    __name(normalizePath, "normalizePath");
    __name(matchPatterns, "matchPatterns");
    __name(anymatch, "anymatch");
    unifyPaths = /* @__PURE__ */ __name((paths_) => {
      const paths = arrify(paths_).flat();
      if (!paths.every((p7) => typeof p7 === STRING_TYPE)) {
        throw new TypeError(`Non-string provided as watch path: ${paths}`);
      }
      return paths.map(normalizePathToUnix);
    }, "unifyPaths");
    toUnix = /* @__PURE__ */ __name((string) => {
      let str = string.replace(BACK_SLASH_RE, SLASH);
      let prepend = false;
      if (str.startsWith(SLASH_SLASH)) {
        prepend = true;
      }
      while (str.match(DOUBLE_SLASH_RE)) {
        str = str.replace(DOUBLE_SLASH_RE, SLASH);
      }
      if (prepend) {
        str = SLASH + str;
      }
      return str;
    }, "toUnix");
    normalizePathToUnix = /* @__PURE__ */ __name((path84) => toUnix(path3__namespace.normalize(toUnix(path84))), "normalizePathToUnix");
    normalizeIgnored = /* @__PURE__ */ __name((cwd2 = "") => (path84) => {
      if (typeof path84 === "string") {
        return normalizePathToUnix(path3__namespace.isAbsolute(path84) ? path84 : path3__namespace.join(cwd2, path84));
      } else {
        return path84;
      }
    }, "normalizeIgnored");
    getAbsolutePath = /* @__PURE__ */ __name((path84, cwd2) => {
      if (path3__namespace.isAbsolute(path84)) {
        return path84;
      }
      return path3__namespace.join(cwd2, path84);
    }, "getAbsolutePath");
    EMPTY_SET = Object.freeze(/* @__PURE__ */ new Set());
    DirEntry = class {
      static {
        __name(this, "DirEntry");
      }
      constructor(dir2, removeWatcher) {
        this.path = dir2;
        this._removeWatcher = removeWatcher;
        this.items = /* @__PURE__ */ new Set();
      }
      add(item) {
        const { items } = this;
        if (!items)
          return;
        if (item !== ONE_DOT && item !== TWO_DOTS)
          items.add(item);
      }
      async remove(item) {
        const { items } = this;
        if (!items)
          return;
        items.delete(item);
        if (items.size > 0)
          return;
        const dir2 = this.path;
        try {
          await fs9.readdir(dir2);
        } catch (err) {
          if (this._removeWatcher) {
            this._removeWatcher(path3__namespace.dirname(dir2), path3__namespace.basename(dir2));
          }
        }
      }
      has(item) {
        const { items } = this;
        if (!items)
          return;
        return items.has(item);
      }
      getChildren() {
        const { items } = this;
        if (!items)
          return [];
        return [...items.values()];
      }
      dispose() {
        this.items.clear();
        this.path = "";
        this._removeWatcher = EMPTY_FN;
        this.items = EMPTY_SET;
        Object.freeze(this);
      }
    };
    STAT_METHOD_F = "stat";
    STAT_METHOD_L = "lstat";
    WatchHelper = class {
      static {
        __name(this, "WatchHelper");
      }
      constructor(path84, follow, fsw) {
        this.fsw = fsw;
        const watchPath = path84;
        this.path = path84 = path84.replace(REPLACER_RE, "");
        this.watchPath = watchPath;
        this.fullWatchPath = path3__namespace.resolve(watchPath);
        this.dirParts = [];
        this.dirParts.forEach((parts) => {
          if (parts.length > 1)
            parts.pop();
        });
        this.followSymlinks = follow;
        this.statMethod = follow ? STAT_METHOD_F : STAT_METHOD_L;
      }
      entryPath(entry) {
        return path3__namespace.join(this.watchPath, path3__namespace.relative(this.watchPath, entry.fullPath));
      }
      filterPath(entry) {
        const { stats } = entry;
        if (stats && stats.isSymbolicLink())
          return this.filterDir(entry);
        const resolvedPath2 = this.entryPath(entry);
        return this.fsw._isntIgnored(resolvedPath2, stats) && this.fsw._hasReadPermissions(stats);
      }
      filterDir(entry) {
        return this.fsw._isntIgnored(this.entryPath(entry), entry.stats);
      }
    };
    FSWatcher = class extends events.EventEmitter {
      static {
        __name(this, "FSWatcher");
      }
      // Not indenting methods for history sake; for now.
      constructor(_opts = {}) {
        super();
        this.closed = false;
        this._closers = /* @__PURE__ */ new Map();
        this._ignoredPaths = /* @__PURE__ */ new Set();
        this._throttled = /* @__PURE__ */ new Map();
        this._streams = /* @__PURE__ */ new Set();
        this._symlinkPaths = /* @__PURE__ */ new Map();
        this._watched = /* @__PURE__ */ new Map();
        this._pendingWrites = /* @__PURE__ */ new Map();
        this._pendingUnlinks = /* @__PURE__ */ new Map();
        this._readyCount = 0;
        this._readyEmitted = false;
        const awf = _opts.awaitWriteFinish;
        const DEF_AWF = { stabilityThreshold: 2e3, pollInterval: 100 };
        const opts = {
          // Defaults
          persistent: true,
          ignoreInitial: false,
          ignorePermissionErrors: false,
          interval: 100,
          binaryInterval: 300,
          followSymlinks: true,
          usePolling: false,
          // useAsync: false,
          atomic: true,
          // NOTE: overwritten later (depends on usePolling)
          ..._opts,
          // Change format
          ignored: _opts.ignored ? arrify(_opts.ignored) : arrify([]),
          awaitWriteFinish: awf === true ? DEF_AWF : typeof awf === "object" ? { ...DEF_AWF, ...awf } : false
        };
        if (isIBMi)
          opts.usePolling = true;
        if (opts.atomic === void 0)
          opts.atomic = !opts.usePolling;
        const envPoll = process.env.CHOKIDAR_USEPOLLING;
        if (envPoll !== void 0) {
          const envLower = envPoll.toLowerCase();
          if (envLower === "false" || envLower === "0")
            opts.usePolling = false;
          else if (envLower === "true" || envLower === "1")
            opts.usePolling = true;
          else
            opts.usePolling = !!envLower;
        }
        const envInterval = process.env.CHOKIDAR_INTERVAL;
        if (envInterval)
          opts.interval = Number.parseInt(envInterval, 10);
        let readyCalls = 0;
        this._emitReady = () => {
          readyCalls++;
          if (readyCalls >= this._readyCount) {
            this._emitReady = EMPTY_FN;
            this._readyEmitted = true;
            process.nextTick(() => this.emit(EVENTS.READY));
          }
        };
        this._emitRaw = (...args) => this.emit(EVENTS.RAW, ...args);
        this._boundRemove = this._remove.bind(this);
        this.options = opts;
        this._nodeFsHandler = new NodeFsHandler(this);
        Object.freeze(opts);
      }
      _addIgnoredPath(matcher) {
        if (isMatcherObject(matcher)) {
          for (const ignored of this._ignoredPaths) {
            if (isMatcherObject(ignored) && ignored.path === matcher.path && ignored.recursive === matcher.recursive) {
              return;
            }
          }
        }
        this._ignoredPaths.add(matcher);
      }
      _removeIgnoredPath(matcher) {
        this._ignoredPaths.delete(matcher);
        if (typeof matcher === "string") {
          for (const ignored of this._ignoredPaths) {
            if (isMatcherObject(ignored) && ignored.path === matcher) {
              this._ignoredPaths.delete(ignored);
            }
          }
        }
      }
      // Public methods
      /**
       * Adds paths to be watched on an existing FSWatcher instance.
       * @param paths_ file or file list. Other arguments are unused
       */
      add(paths_, _origAdd, _internal) {
        const { cwd: cwd2 } = this.options;
        this.closed = false;
        this._closePromise = void 0;
        let paths = unifyPaths(paths_);
        if (cwd2) {
          paths = paths.map((path84) => {
            const absPath = getAbsolutePath(path84, cwd2);
            return absPath;
          });
        }
        paths.forEach((path84) => {
          this._removeIgnoredPath(path84);
        });
        this._userIgnored = void 0;
        if (!this._readyCount)
          this._readyCount = 0;
        this._readyCount += paths.length;
        Promise.all(paths.map(async (path84) => {
          const res = await this._nodeFsHandler._addToNodeFs(path84, !_internal, void 0, 0, _origAdd);
          if (res)
            this._emitReady();
          return res;
        })).then((results) => {
          if (this.closed)
            return;
          results.forEach((item) => {
            if (item)
              this.add(path3__namespace.dirname(item), path3__namespace.basename(_origAdd || item));
          });
        });
        return this;
      }
      /**
       * Close watchers or start ignoring events from specified paths.
       */
      unwatch(paths_) {
        if (this.closed)
          return this;
        const paths = unifyPaths(paths_);
        const { cwd: cwd2 } = this.options;
        paths.forEach((path84) => {
          if (!path3__namespace.isAbsolute(path84) && !this._closers.has(path84)) {
            if (cwd2)
              path84 = path3__namespace.join(cwd2, path84);
            path84 = path3__namespace.resolve(path84);
          }
          this._closePath(path84);
          this._addIgnoredPath(path84);
          if (this._watched.has(path84)) {
            this._addIgnoredPath({
              path: path84,
              recursive: true
            });
          }
          this._userIgnored = void 0;
        });
        return this;
      }
      /**
       * Close watchers and remove all listeners from watched paths.
       */
      close() {
        if (this._closePromise) {
          return this._closePromise;
        }
        this.closed = true;
        this.removeAllListeners();
        const closers = [];
        this._closers.forEach((closerList) => closerList.forEach((closer) => {
          const promise = closer();
          if (promise instanceof Promise)
            closers.push(promise);
        }));
        this._streams.forEach((stream2) => stream2.destroy());
        this._userIgnored = void 0;
        this._readyCount = 0;
        this._readyEmitted = false;
        this._watched.forEach((dirent) => dirent.dispose());
        this._closers.clear();
        this._watched.clear();
        this._streams.clear();
        this._symlinkPaths.clear();
        this._throttled.clear();
        this._closePromise = closers.length ? Promise.all(closers).then(() => void 0) : Promise.resolve();
        return this._closePromise;
      }
      /**
       * Expose list of watched paths
       * @returns for chaining
       */
      getWatched() {
        const watchList = {};
        this._watched.forEach((entry, dir2) => {
          const key = this.options.cwd ? path3__namespace.relative(this.options.cwd, dir2) : dir2;
          const index = key || ONE_DOT;
          watchList[index] = entry.getChildren().sort();
        });
        return watchList;
      }
      emitWithAll(event, args) {
        this.emit(...args);
        if (event !== EVENTS.ERROR)
          this.emit(EVENTS.ALL, ...args);
      }
      // Common helpers
      // --------------
      /**
       * Normalize and emit events.
       * Calling _emit DOES NOT MEAN emit() would be called!
       * @param event Type of event
       * @param path File or directory path
       * @param stats arguments to be passed with event
       * @returns the error if defined, otherwise the value of the FSWatcher instance's `closed` flag
       */
      async _emit(event, path84, stats) {
        if (this.closed)
          return;
        const opts = this.options;
        if (isWindows2)
          path84 = path3__namespace.normalize(path84);
        if (opts.cwd)
          path84 = path3__namespace.relative(opts.cwd, path84);
        const args = [event, path84];
        if (stats != null)
          args.push(stats);
        const awf = opts.awaitWriteFinish;
        let pw;
        if (awf && (pw = this._pendingWrites.get(path84))) {
          pw.lastChange = /* @__PURE__ */ new Date();
          return this;
        }
        if (opts.atomic) {
          if (event === EVENTS.UNLINK) {
            this._pendingUnlinks.set(path84, args);
            setTimeout(() => {
              this._pendingUnlinks.forEach((entry, path85) => {
                this.emit(...entry);
                this.emit(EVENTS.ALL, ...entry);
                this._pendingUnlinks.delete(path85);
              });
            }, typeof opts.atomic === "number" ? opts.atomic : 100);
            return this;
          }
          if (event === EVENTS.ADD && this._pendingUnlinks.has(path84)) {
            event = args[0] = EVENTS.CHANGE;
            this._pendingUnlinks.delete(path84);
          }
        }
        if (awf && (event === EVENTS.ADD || event === EVENTS.CHANGE) && this._readyEmitted) {
          const awfEmit = /* @__PURE__ */ __name((err, stats2) => {
            if (err) {
              event = args[0] = EVENTS.ERROR;
              args[1] = err;
              this.emitWithAll(event, args);
            } else if (stats2) {
              if (args.length > 2) {
                args[2] = stats2;
              } else {
                args.push(stats2);
              }
              this.emitWithAll(event, args);
            }
          }, "awfEmit");
          this._awaitWriteFinish(path84, awf.stabilityThreshold, event, awfEmit);
          return this;
        }
        if (event === EVENTS.CHANGE) {
          const isThrottled = !this._throttle(EVENTS.CHANGE, path84, 50);
          if (isThrottled)
            return this;
        }
        if (opts.alwaysStat && stats === void 0 && (event === EVENTS.ADD || event === EVENTS.ADD_DIR || event === EVENTS.CHANGE)) {
          const fullPath = opts.cwd ? path3__namespace.join(opts.cwd, path84) : path84;
          let stats2;
          try {
            stats2 = await fs9.stat(fullPath);
          } catch (err) {
          }
          if (!stats2 || this.closed)
            return;
          args.push(stats2);
        }
        this.emitWithAll(event, args);
        return this;
      }
      /**
       * Common handler for errors
       * @returns The error if defined, otherwise the value of the FSWatcher instance's `closed` flag
       */
      _handleError(error2) {
        const code = error2 && error2.code;
        if (error2 && code !== "ENOENT" && code !== "ENOTDIR" && (!this.options.ignorePermissionErrors || code !== "EPERM" && code !== "EACCES")) {
          this.emit(EVENTS.ERROR, error2);
        }
        return error2 || this.closed;
      }
      /**
       * Helper utility for throttling
       * @param actionType type being throttled
       * @param path being acted upon
       * @param timeout duration of time to suppress duplicate actions
       * @returns tracking object or false if action should be suppressed
       */
      _throttle(actionType, path84, timeout2) {
        if (!this._throttled.has(actionType)) {
          this._throttled.set(actionType, /* @__PURE__ */ new Map());
        }
        const action = this._throttled.get(actionType);
        if (!action)
          throw new Error("invalid throttle");
        const actionPath = action.get(path84);
        if (actionPath) {
          actionPath.count++;
          return false;
        }
        let timeoutObject;
        const clear = /* @__PURE__ */ __name(() => {
          const item = action.get(path84);
          const count = item ? item.count : 0;
          action.delete(path84);
          clearTimeout(timeoutObject);
          if (item)
            clearTimeout(item.timeoutObject);
          return count;
        }, "clear");
        timeoutObject = setTimeout(clear, timeout2);
        const thr = { timeoutObject, clear, count: 0 };
        action.set(path84, thr);
        return thr;
      }
      _incrReadyCount() {
        return this._readyCount++;
      }
      /**
       * Awaits write operation to finish.
       * Polls a newly created file for size variations. When files size does not change for 'threshold' milliseconds calls callback.
       * @param path being acted upon
       * @param threshold Time in milliseconds a file size must be fixed before acknowledging write OP is finished
       * @param event
       * @param awfEmit Callback to be called when ready for event to be emitted.
       */
      _awaitWriteFinish(path84, threshold, event, awfEmit) {
        const awf = this.options.awaitWriteFinish;
        if (typeof awf !== "object")
          return;
        const pollInterval = awf.pollInterval;
        let timeoutHandler;
        let fullPath = path84;
        if (this.options.cwd && !path3__namespace.isAbsolute(path84)) {
          fullPath = path3__namespace.join(this.options.cwd, path84);
        }
        const now = /* @__PURE__ */ new Date();
        const writes = this._pendingWrites;
        function awaitWriteFinishFn(prevStat) {
          fs29.stat(fullPath, (err, curStat) => {
            if (err || !writes.has(path84)) {
              if (err && err.code !== "ENOENT")
                awfEmit(err);
              return;
            }
            const now2 = Number(/* @__PURE__ */ new Date());
            if (prevStat && curStat.size !== prevStat.size) {
              writes.get(path84).lastChange = now2;
            }
            const pw = writes.get(path84);
            const df = now2 - pw.lastChange;
            if (df >= threshold) {
              writes.delete(path84);
              awfEmit(void 0, curStat);
            } else {
              timeoutHandler = setTimeout(awaitWriteFinishFn, pollInterval, curStat);
            }
          });
        }
        __name(awaitWriteFinishFn, "awaitWriteFinishFn");
        if (!writes.has(path84)) {
          writes.set(path84, {
            lastChange: now,
            cancelWait: /* @__PURE__ */ __name(() => {
              writes.delete(path84);
              clearTimeout(timeoutHandler);
              return event;
            }, "cancelWait")
          });
          timeoutHandler = setTimeout(awaitWriteFinishFn, pollInterval);
        }
      }
      /**
       * Determines whether user has asked to ignore this path.
       */
      _isIgnored(path84, stats) {
        if (this.options.atomic && DOT_RE.test(path84))
          return true;
        if (!this._userIgnored) {
          const { cwd: cwd2 } = this.options;
          const ign = this.options.ignored;
          const ignored = (ign || []).map(normalizeIgnored(cwd2));
          const ignoredPaths = [...this._ignoredPaths];
          const list = [...ignoredPaths.map(normalizeIgnored(cwd2)), ...ignored];
          this._userIgnored = anymatch(list, void 0);
        }
        return this._userIgnored(path84, stats);
      }
      _isntIgnored(path84, stat9) {
        return !this._isIgnored(path84, stat9);
      }
      /**
       * Provides a set of common helpers and properties relating to symlink handling.
       * @param path file or directory pattern being watched
       */
      _getWatchHelpers(path84) {
        return new WatchHelper(path84, this.options.followSymlinks, this);
      }
      // Directory helpers
      // -----------------
      /**
       * Provides directory tracking objects
       * @param directory path of the directory
       */
      _getWatchedDir(directory) {
        const dir2 = path3__namespace.resolve(directory);
        if (!this._watched.has(dir2))
          this._watched.set(dir2, new DirEntry(dir2, this._boundRemove));
        return this._watched.get(dir2);
      }
      // File helpers
      // ------------
      /**
       * Check for read permissions: https://stackoverflow.com/a/11781404/1358405
       */
      _hasReadPermissions(stats) {
        if (this.options.ignorePermissionErrors)
          return true;
        return Boolean(Number(stats.mode) & 256);
      }
      /**
       * Handles emitting unlink events for
       * files and directories, and via recursion, for
       * files and directories within directories that are unlinked
       * @param directory within which the following item is located
       * @param item      base path of item/directory
       */
      _remove(directory, item, isDirectory3) {
        const path84 = path3__namespace.join(directory, item);
        const fullPath = path3__namespace.resolve(path84);
        isDirectory3 = isDirectory3 != null ? isDirectory3 : this._watched.has(path84) || this._watched.has(fullPath);
        if (!this._throttle("remove", path84, 100))
          return;
        if (!isDirectory3 && this._watched.size === 1) {
          this.add(directory, item, true);
        }
        const wp = this._getWatchedDir(path84);
        const nestedDirectoryChildren = wp.getChildren();
        nestedDirectoryChildren.forEach((nested) => this._remove(path84, nested));
        const parent = this._getWatchedDir(directory);
        const wasTracked = parent.has(item);
        parent.remove(item);
        if (this._symlinkPaths.has(fullPath)) {
          this._symlinkPaths.delete(fullPath);
        }
        let relPath = path84;
        if (this.options.cwd)
          relPath = path3__namespace.relative(this.options.cwd, path84);
        if (this.options.awaitWriteFinish && this._pendingWrites.has(relPath)) {
          const event = this._pendingWrites.get(relPath).cancelWait();
          if (event === EVENTS.ADD)
            return;
        }
        this._watched.delete(path84);
        this._watched.delete(fullPath);
        const eventName = isDirectory3 ? EVENTS.UNLINK_DIR : EVENTS.UNLINK;
        if (wasTracked && !this._isIgnored(path84))
          this._emit(eventName, path84);
        this._closePath(path84);
      }
      /**
       * Closes all watchers for a path
       */
      _closePath(path84) {
        this._closeFile(path84);
        const dir2 = path3__namespace.dirname(path84);
        this._getWatchedDir(dir2).remove(path3__namespace.basename(path84));
      }
      /**
       * Closes only file-specific watchers
       */
      _closeFile(path84) {
        const closers = this._closers.get(path84);
        if (!closers)
          return;
        closers.forEach((closer) => closer());
        this._closers.delete(path84);
      }
      _addPathCloser(path84, closer) {
        if (!closer)
          return;
        let list = this._closers.get(path84);
        if (!list) {
          list = [];
          this._closers.set(path84, list);
        }
        list.push(closer);
      }
      _readdirp(root, opts) {
        if (this.closed)
          return;
        const options = { type: EVENTS.ALL, alwaysStat: true, lstat: true, ...opts, depth: 0 };
        let stream2 = readdirp(root, options);
        this._streams.add(stream2);
        stream2.once(STR_CLOSE, () => {
          stream2 = void 0;
        });
        stream2.once(STR_END, () => {
          if (stream2) {
            this._streams.delete(stream2);
            stream2 = void 0;
          }
        });
        return stream2;
      }
    };
    __name(watch, "watch");
  }
});
function dedent3(strings, ...values) {
  const raw = String.raw({ raw: strings }, ...values);
  let lines = raw.split("\n");
  assert53__default.default(lines.length > 0);
  if (lines[lines.length - 1].trim() === "") {
    lines = lines.slice(0, lines.length - 1);
  }
  let minIndent = "";
  let minIndentLength = Infinity;
  for (const line of lines.slice(1)) {
    const indent = line.match(/^[ \t]*/)?.[0];
    if (indent != null && indent.length < minIndentLength) {
      minIndent = indent;
      minIndentLength = indent.length;
    }
  }
  if (lines.length > 0 && lines[0].trim() === "") {
    lines = lines.slice(1);
  }
  lines = lines.map(
    (line) => line.startsWith(minIndent) ? line.substring(minIndent.length) : line
  );
  return lines.join("\n");
}
var init_dedent = __esm({
  "src/utils/dedent.ts"() {
    init_import_meta_url();
    __name(dedent3, "dedent");
  }
});
async function applyMiddlewareLoaderFacade(entry, tmpDirPath, middleware) {
  tmpDirPath = fs29__namespace.realpathSync(tmpDirPath);
  const middlewareIdentifiers = middleware.map((m7, index) => [
    `__MIDDLEWARE_${index}__`,
    path3__namespace.resolve(getBasePath(), m7.path)
  ]);
  const dynamicFacadePath = path3__namespace.join(
    tmpDirPath,
    "middleware-insertion-facade.js"
  );
  const imports = middlewareIdentifiers.map(
    ([id, middlewarePath]) => (
      /*javascript*/
      `import * as ${id} from "${prepareFilePath(
        middlewarePath
      )}";`
    )
  ).join("\n");
  const middlewareFns = middlewareIdentifiers.map(([m7]) => `${m7}.default`).join(",");
  if (entry.format === "modules") {
    await fs29__namespace.promises.writeFile(
      dynamicFacadePath,
      dedent3`
				import worker, * as OTHER_EXPORTS from "${prepareFilePath(entry.file)}";
				${imports}

				export * from "${prepareFilePath(entry.file)}";
				const MIDDLEWARE_TEST_INJECT = "__INJECT_FOR_TESTING_WRANGLER_MIDDLEWARE__";
				export const __INTERNAL_WRANGLER_MIDDLEWARE__ = [
					${""}
					${middlewareFns}
				]
				export default worker;
			`
    );
    const targetPathLoader = path3__namespace.join(
      tmpDirPath,
      "middleware-loader.entry.ts"
    );
    const loaderPath = path3__namespace.resolve(
      getBasePath(),
      "templates/middleware/loader-modules.ts"
    );
    const baseLoader = await fs29__namespace.promises.readFile(loaderPath, "utf-8");
    const transformedLoader = baseLoader.replaceAll("__ENTRY_POINT__", prepareFilePath(dynamicFacadePath)).replace(
      "./common",
      prepareFilePath(
        path3__namespace.resolve(getBasePath(), "templates/middleware/common.ts")
      )
    );
    await fs29__namespace.promises.writeFile(targetPathLoader, transformedLoader);
    return {
      entry: {
        ...entry,
        file: targetPathLoader
      }
    };
  } else {
    const loaderSwPath = path3__namespace.resolve(
      getBasePath(),
      "templates/middleware/loader-sw.ts"
    );
    await fs29__namespace.promises.writeFile(
      dynamicFacadePath,
      dedent3`
				import { __facade_registerInternal__ } from "${prepareFilePath(loaderSwPath)}";
				${imports}
				__facade_registerInternal__([${middlewareFns}])
			`
    );
    return {
      entry,
      inject: [dynamicFacadePath]
    };
  }
}
function prepareFilePath(filePath) {
  return JSON.stringify(filePath).slice(1, -1);
}
var init_apply_middleware = __esm({
  "src/deployment-bundle/apply-middleware.ts"() {
    init_import_meta_url();
    init_paths();
    init_dedent();
    __name(applyMiddlewareLoaderFacade, "applyMiddlewareLoaderFacade");
    __name(prepareFilePath, "prepareFilePath");
  }
});

// src/deployment-bundle/dedupe-modules.ts
function dedupeModulesByName(modules) {
  return Object.values(
    modules.reduce(
      (moduleMap, module2) => {
        moduleMap[module2.name] = module2;
        return moduleMap;
      },
      {}
    )
  );
}
var init_dedupe_modules = __esm({
  "src/deployment-bundle/dedupe-modules.ts"() {
    init_import_meta_url();
    __name(dedupeModulesByName, "dedupeModulesByName");
  }
});
function getEntryPointFromMetafile(entryFile, metafile) {
  const entryPoints = Object.entries(metafile.outputs).filter(
    ([_path, output]) => output.entryPoint !== void 0
  );
  if (entryPoints.length !== 1) {
    const entryPointList = entryPoints.map(([_input, output]) => output.entryPoint).join("\n");
    assert53__default.default(
      entryPoints.length > 0,
      `Cannot find entry-point "${entryFile}" in generated bundle.
${entryPointList}`
    );
    assert53__default.default(
      entryPoints.length < 2,
      `More than one entry-point found for generated bundle.
${entryPointList}`
    );
  }
  const [relativePath, entryPoint] = entryPoints[0];
  return {
    relativePath,
    exports: entryPoint.exports,
    dependencies: entryPoint.inputs
  };
}
var init_entry_point_from_metafile = __esm({
  "src/deployment-bundle/entry-point-from-metafile.ts"() {
    init_import_meta_url();
    __name(getEntryPointFromMetafile, "getEntryPointFromMetafile");
  }
});

// src/deployment-bundle/esbuild-plugins/cloudflare-internal.ts
var cloudflareInternalPlugin;
var init_cloudflare_internal = __esm({
  "src/deployment-bundle/esbuild-plugins/cloudflare-internal.ts"() {
    init_import_meta_url();
    init_dedent();
    cloudflareInternalPlugin = {
      name: "cloudflare-internal-imports",
      setup(pluginBuild) {
        const paths = /* @__PURE__ */ new Set();
        pluginBuild.onStart(() => paths.clear());
        pluginBuild.onResolve({ filter: /^cloudflare:.*/ }, (args) => {
          paths.add(args.path);
          return { external: true };
        });
        pluginBuild.onEnd(() => {
          if (pluginBuild.initialOptions.format === "iife" && paths.size > 0) {
            const pathList = new Intl.ListFormat("en-US").format(
              Array.from(paths.keys()).map((p7) => `"${p7}"`).sort()
            );
            return {
              errors: [
                {
                  text: dedent3`
								Unexpected external import of ${pathList}.
								Your worker has no default export, which means it is assumed to be a Service Worker format Worker.
								Did you mean to create a ES Module format Worker?
								If so, try adding \`export default { ... }\` in your entry-point.
								See https://developers.cloudflare.com/workers/reference/migrate-to-module-workers/.
							`
                }
              ]
            };
          }
        });
      }
    };
  }
});

// src/deployment-bundle/esbuild-plugins/config-provider.ts
function configProviderPlugin(config) {
  return {
    name: "middleware-config-provider",
    setup(build5) {
      build5.onResolve({ filter: /^config:/ }, (args) => ({
        path: args.path,
        namespace: "wrangler-config"
      }));
      build5.onLoad(
        { filter: /.*/, namespace: "wrangler-config" },
        async (args) => {
          const middleware = args.path.split("config:middleware/")[1];
          if (!config[middleware]) {
            throw new Error(`No config found for ${middleware}`);
          }
          return {
            loader: "json",
            contents: JSON.stringify(config[middleware])
          };
        }
      );
    }
  };
}
var init_config_provider = __esm({
  "src/deployment-bundle/esbuild-plugins/config-provider.ts"() {
    init_import_meta_url();
    __name(configProviderPlugin, "configProviderPlugin");
  }
});

// src/deployment-bundle/esbuild-plugins/als-external.ts
var asyncLocalStoragePlugin;
var init_als_external = __esm({
  "src/deployment-bundle/esbuild-plugins/als-external.ts"() {
    init_import_meta_url();
    asyncLocalStoragePlugin = {
      name: "async-local-storage-imports",
      setup(pluginBuild) {
        pluginBuild.onResolve({ filter: /^node:async_hooks(\/|$)/ }, () => {
          return { external: true };
        });
      }
    };
  }
});
function nodejsHybridPlugin({
  compatibilityDate,
  compatibilityFlags
}) {
  return {
    name: "hybrid-nodejs_compat",
    async setup(build5) {
      const { defineEnv } = await import('unenv');
      const { getCloudflarePreset, nonPrefixedNodeModules } = await import('@cloudflare/unenv-preset');
      const { alias, inject, external, polyfill: polyfill2 } = defineEnv({
        presets: [
          getCloudflarePreset({
            compatibilityDate,
            compatibilityFlags
          }),
          {
            alias: {
              // Force esbuild to use the node implementation of debug instead of unenv's no-op stub.
              // The alias is processed by handleUnenvAliasedPackages which uses require.resolve().
              debug: "debug"
            }
          }
        ],
        npmShims: true
      }).env;
      const nodeJsModuleRegexp = new RegExp(
        `^(${nonPrefixedNodeModules.join("|")}|node:.+)$`
      );
      errorOnServiceWorkerFormat(build5, nodeJsModuleRegexp);
      handleRequireCallsToNodeJSBuiltins(build5, nodeJsModuleRegexp);
      handleUnenvAliasedPackages(build5, alias, external);
      handleNodeJSGlobals(build5, inject, polyfill2);
    }
  };
}
function errorOnServiceWorkerFormat(build5, nodeJsModuleRegexp) {
  const paths = /* @__PURE__ */ new Set();
  build5.onStart(() => paths.clear());
  build5.onResolve({ filter: nodeJsModuleRegexp }, (args) => {
    paths.add(args.path);
    return null;
  });
  build5.onEnd(() => {
    if (build5.initialOptions.format === "iife" && paths.size > 0) {
      const pathList = new Intl.ListFormat("en-US").format(
        Array.from(paths.keys()).map((p7) => `"${p7}"`).sort()
      );
      return {
        errors: [
          {
            text: esm_default3`
							Unexpected external import of ${pathList}.
							Your worker has no default export, which means it is assumed to be a Service Worker format Worker.
							Did you mean to create a ES Module format Worker?
							If so, try adding \`export default { ... }\` in your entry-point.
							See https://developers.cloudflare.com/workers/reference/migrate-to-module-workers/.
						`
          }
        ]
      };
    }
  });
}
function handleRequireCallsToNodeJSBuiltins(build5, nodeJsModuleRegexp) {
  build5.onResolve({ filter: nodeJsModuleRegexp }, (args) => {
    if (args.kind === "require-call") {
      return {
        path: args.path,
        namespace: REQUIRED_NODE_BUILT_IN_NAMESPACE
      };
    }
  });
  build5.onLoad(
    { filter: /.*/, namespace: REQUIRED_NODE_BUILT_IN_NAMESPACE },
    ({ path: path84 }) => {
      return {
        contents: esm_default3`
					import libDefault from '${path84}';
					module.exports = libDefault;`,
        loader: "js"
      };
    }
  );
}
function handleUnenvAliasedPackages(build5, alias, external) {
  const aliasAbsolute = {};
  for (const [module2, unresolvedAlias] of Object.entries(alias)) {
    try {
      aliasAbsolute[module2] = __require.resolve(unresolvedAlias);
    } catch {
    }
  }
  const UNENV_ALIAS_RE = new RegExp(
    `^(${Object.keys(aliasAbsolute).join("|")})$`
  );
  build5.onResolve({ filter: UNENV_ALIAS_RE }, (args) => {
    const unresolvedAlias = alias[args.path];
    if (args.kind === "require-call" && (unresolvedAlias.startsWith("unenv/npm/") || unresolvedAlias.startsWith("unenv/mock/"))) {
      return {
        path: args.path,
        namespace: REQUIRED_UNENV_ALIAS_NAMESPACE
      };
    }
    return {
      path: aliasAbsolute[args.path],
      external: external.includes(unresolvedAlias)
    };
  });
  build5.onLoad(
    { filter: /.*/, namespace: REQUIRED_UNENV_ALIAS_NAMESPACE },
    ({ path: path84 }) => {
      return {
        contents: esm_default3`
					import * as esm from '${path84}';
					module.exports = Object.entries(esm)
								.filter(([k,]) => k !== 'default')
								.reduce((cjs, [k, value]) =>
									Object.defineProperty(cjs, k, { value, enumerable: true }),
									"default" in esm ? esm.default : {}
								);
				`,
        loader: "js"
      };
    }
  );
}
function handleNodeJSGlobals(build5, inject, polyfill2) {
  const UNENV_VIRTUAL_MODULE_RE = /_virtual_unenv_global_polyfill-(.+)$/;
  const prefix = path3__namespace.default.resolve(
    getBasePath(),
    "_virtual_unenv_global_polyfill-"
  );
  const injectsByModule = /* @__PURE__ */ new Map();
  const virtualModulePathToSpecifier = /* @__PURE__ */ new Map();
  for (const [injectedName, moduleSpecifier] of Object.entries(inject)) {
    const [module2, exportName, importName] = Array.isArray(moduleSpecifier) ? [moduleSpecifier[0], moduleSpecifier[1], moduleSpecifier[1]] : [moduleSpecifier, "default", "defaultExport"];
    if (!injectsByModule.has(module2)) {
      injectsByModule.set(module2, []);
      virtualModulePathToSpecifier.set(
        prefix + module2.replaceAll("/", "-"),
        module2
      );
    }
    injectsByModule.get(module2).push({ injectedName, exportName, importName });
  }
  build5.initialOptions.inject = [
    ...build5.initialOptions.inject ?? [],
    // Inject the virtual modules
    ...virtualModulePathToSpecifier.keys(),
    // Inject the polyfills - needs an absolute path
    ...polyfill2.map((m7) => __require.resolve(m7))
  ];
  build5.onResolve({ filter: UNENV_VIRTUAL_MODULE_RE }, ({ path: path84 }) => ({
    path: path84
  }));
  build5.onLoad({ filter: UNENV_VIRTUAL_MODULE_RE }, ({ path: path84 }) => {
    const module2 = virtualModulePathToSpecifier.get(path84);
    assert53__default.default(module2, `Expected ${path84} to be mapped to a module specifier`);
    const injects = injectsByModule.get(module2);
    assert53__default.default(injects, `Expected ${module2} to inject values`);
    const imports = injects.map(
      ({ exportName, importName }) => importName === exportName ? exportName : `${exportName} as ${importName}`
    );
    return {
      contents: esm_default3`
				import { ${imports.join(", ")} } from "${module2}";
				${injects.map(({ injectedName, importName }) => `globalThis.${injectedName} = ${importName};`).join("\n")}
			`
    };
  });
}
var REQUIRED_NODE_BUILT_IN_NAMESPACE, REQUIRED_UNENV_ALIAS_NAMESPACE;
var init_hybrid_nodejs_compat = __esm({
  "src/deployment-bundle/esbuild-plugins/hybrid-nodejs-compat.ts"() {
    init_import_meta_url();
    init_esm2();
    init_paths();
    REQUIRED_NODE_BUILT_IN_NAMESPACE = "node-built-in-modules";
    REQUIRED_UNENV_ALIAS_NAMESPACE = "required-unenv-alias";
    __name(nodejsHybridPlugin, "nodejsHybridPlugin");
    __name(errorOnServiceWorkerFormat, "errorOnServiceWorkerFormat");
    __name(handleRequireCallsToNodeJSBuiltins, "handleRequireCallsToNodeJSBuiltins");
    __name(handleUnenvAliasedPackages, "handleUnenvAliasedPackages");
    __name(handleNodeJSGlobals, "handleNodeJSGlobals");
  }
});
function toList(items, absWorkingDir) {
  return items.map((i7) => ` - ${source_default.blue(path3.relative(absWorkingDir ?? "/", i7))}`).join("\n");
}
var nodejsCompatPlugin;
var init_nodejs_compat = __esm({
  "src/deployment-bundle/esbuild-plugins/nodejs-compat.ts"() {
    init_import_meta_url();
    init_source();
    init_logger();
    init_dedent();
    nodejsCompatPlugin = /* @__PURE__ */ __name((mode) => ({
      name: "nodejs_compat-imports",
      setup(pluginBuild) {
        const seen = /* @__PURE__ */ new Set();
        const warnedPackages = /* @__PURE__ */ new Map();
        pluginBuild.onStart(() => {
          seen.clear();
          warnedPackages.clear();
        });
        pluginBuild.onResolve(
          { filter: /node:.*/ },
          async ({ path: path84, kind: kind2, resolveDir, importer }) => {
            const specifier = `${path84}:${kind2}:${resolveDir}:${importer}`;
            if (seen.has(specifier)) {
              return;
            }
            seen.add(specifier);
            const result = await pluginBuild.resolve(path84, {
              kind: kind2,
              resolveDir,
              importer
            });
            if (result.errors.length > 0) {
              const pathWarnedPackages = warnedPackages.get(path84) ?? [];
              pathWarnedPackages.push(importer);
              warnedPackages.set(path84, pathWarnedPackages);
              return { external: true };
            }
            return result;
          }
        );
        pluginBuild.onEnd(() => {
          if (pluginBuild.initialOptions.format === "iife" && warnedPackages.size > 0) {
            const paths = new Intl.ListFormat("en-US").format(
              Array.from(warnedPackages.keys()).map((p7) => `"${p7}"`).sort()
            );
            return {
              errors: [
                {
                  text: dedent3`
								Unexpected external import of ${paths}.
								Your worker has no default export, which means it is assumed to be a Service Worker format Worker.
								Did you mean to create a ES Module format Worker?
								If so, try adding \`export default { ... }\` in your entry-point.
								See https://developers.cloudflare.com/workers/reference/migrate-to-module-workers/.
							`
                }
              ]
            };
          }
        });
        pluginBuild.onEnd(() => {
          if (mode !== "v1") {
            warnedPackages.forEach((importers, path84) => {
              logger.warn(
                dedent3`
						The package "${path84}" wasn't found on the file system but is built into node.
						Your Worker may throw errors at runtime unless you enable the "nodejs_compat" compatibility flag. Refer to https://developers.cloudflare.com/workers/runtime-apis/nodejs/ for more details. Imported from:
						${toList(importers, pluginBuild.initialOptions.absWorkingDir)}`
              );
            });
          }
        });
      }
    }), "nodejsCompatPlugin");
    __name(toList, "toList");
  }
});

// src/deployment-bundle/esbuild-plugins/nodejs-plugins.ts
function getNodeJSCompatPlugins({
  mode,
  compatibilityDate,
  compatibilityFlags
}) {
  switch (mode) {
    case "als":
      return [asyncLocalStoragePlugin, nodejsCompatPlugin(mode)];
    case "v1":
      return [nodejsCompatPlugin(mode)];
    case "v2":
      return [nodejsHybridPlugin({ compatibilityDate, compatibilityFlags })];
    case null:
      return [nodejsCompatPlugin(mode)];
  }
}
var init_nodejs_plugins = __esm({
  "src/deployment-bundle/esbuild-plugins/nodejs-plugins.ts"() {
    init_import_meta_url();
    init_als_external();
    init_hybrid_nodejs_compat();
    init_nodejs_compat();
    __name(getNodeJSCompatPlugins, "getNodeJSCompatPlugins");
  }
});
function getBuildConditions() {
  const envVar = getBuildConditionsFromEnv();
  if (envVar !== void 0) {
    return envVar.split(",");
  } else {
    return ["workerd", "worker", "browser"];
  }
}
function getBuildPlatform() {
  const platform4 = getBuildPlatformFromEnv();
  if (platform4 !== void 0 && !["browser", "node", "neutral"].includes(platform4)) {
    throw new UserError(
      "Invalid esbuild platform configuration defined in the WRANGLER_BUILD_PLATFORM environment variable.\nValid platform values are: 'browser', 'node' and 'neutral'."
    );
  }
  return platform4;
}
async function bundleWorker(entry, destination, {
  bundle,
  moduleCollector = noopModuleCollector,
  additionalModules = [],
  doBindings,
  workflowBindings,
  jsxFactory,
  jsxFragment,
  entryName,
  watch: watch2,
  tsconfig,
  minify,
  keepNames,
  nodejsCompatMode,
  compatibilityDate,
  compatibilityFlags,
  alias,
  define: define2,
  checkFetch,
  targetConsumer,
  testScheduled,
  inject: injectOption,
  sourcemap,
  plugins,
  isOutfile,
  local,
  projectRoot,
  defineNavigatorUserAgent,
  external,
  metafile
}) {
  const tmpDir = getWranglerTmpDir(projectRoot, "bundle");
  const entryFile = entry.file;
  const middlewareToLoad = [];
  if (targetConsumer === "dev" && !process.env.WRANGLER_DISABLE_REQUEST_BODY_DRAINING) {
    middlewareToLoad.push({
      name: "ensure-req-body-drained",
      path: "templates/middleware/middleware-ensure-req-body-drained.ts",
      supports: ["modules", "service-worker"]
    });
  }
  if (targetConsumer === "dev" && !!testScheduled) {
    middlewareToLoad.push({
      name: "scheduled",
      path: "templates/middleware/middleware-scheduled.ts",
      supports: ["modules", "service-worker"]
    });
  }
  if (targetConsumer === "dev" && local) {
    middlewareToLoad.push({
      name: "miniflare3-json-error",
      path: "templates/middleware/middleware-miniflare3-json-error.ts",
      supports: ["modules", "service-worker"]
    });
  }
  let initialBuildResult;
  const initialBuildResultPromise = new Promise(
    (resolve32) => initialBuildResult = resolve32
  );
  const buildResultPlugin = {
    name: "Initial build result plugin",
    setup(build5) {
      build5.onEnd(initialBuildResult);
    }
  };
  const inject = injectOption ?? [];
  if (checkFetch) {
    const checkedFetchFileToInject = path3__namespace.join(tmpDir.path, "checked-fetch.js");
    if (checkFetch && !fs29__namespace.existsSync(checkedFetchFileToInject)) {
      fs29__namespace.writeFileSync(
        checkedFetchFileToInject,
        fs29__namespace.readFileSync(
          path3__namespace.resolve(getBasePath(), "templates/checked-fetch.js")
        )
      );
    }
    inject.push(checkedFetchFileToInject);
  }
  if (getFlag("MULTIWORKER")) {
    middlewareToLoad.push({
      name: "patch-console-prefix",
      path: "templates/middleware/middleware-patch-console-prefix.ts",
      supports: ["modules", "service-worker"],
      config: {
        prefix: source_default.blue(`[${entry.name}]`)
      }
    });
  }
  for (const middleware of middlewareToLoad) {
    if (!middleware.supports.includes(entry.format)) {
      throw new UserError(
        `Your Worker is written using the "${entry.format}" format, which isn't supported by the "${middleware.name}" middleware. To use "${middleware.name}" middleware, convert your Worker to the "${middleware.supports[0]}" format`
      );
    }
  }
  if (middlewareToLoad.length > 0 || process.env.EXPERIMENTAL_MIDDLEWARE === "true") {
    const result2 = await applyMiddlewareLoaderFacade(
      entry,
      tmpDir.path,
      middlewareToLoad
    );
    entry = result2.entry;
    inject.push(...result2.inject ?? []);
  }
  if (watch2) {
    inject.push(path3__namespace.resolve(getBasePath(), "templates/modules-watch-stub.js"));
  }
  const aliasPlugin = {
    name: "alias",
    setup(build5) {
      if (!alias) {
        return;
      }
      const filter2 = new RegExp(
        Object.keys(alias).map((key) => escapeRegex(key)).join("|")
      );
      build5.onResolve({ filter: filter2 }, (args) => {
        const aliasPath = alias[args.path];
        if (aliasPath) {
          return {
            // resolve with node resolution
            path: __require.resolve(aliasPath, {
              // From the esbuild alias docs: "Note that when an import path is substituted using an alias, the resulting import path is resolved in the working directory instead of in the directory containing the source file with the import path."
              // https://esbuild.github.io/api/#alias:~:text=Note%20that%20when%20an%20import%20path%20is%20substituted%20using%20an%20alias%2C%20the%20resulting%20import%20path%20is%20resolved%20in%20the%20working%20directory%20instead%20of%20in%20the%20directory%20containing%20the%20source%20file%20with%20the%20import%20path.
              paths: [entry.projectRoot]
            })
          };
        }
      });
    }
  };
  const nodeEnvReplacement = JSON.stringify(
    // use process.env["NODE_ENV" + ""] so that esbuild doesn't replace it
    // when we do a build of wrangler. (re: https://github.com/cloudflare/workers-sdk/issues/1477)
    process.env["NODE_ENV"] || (targetConsumer === "deploy" ? "production" : "development")
  );
  const buildOptions = {
    // Don't use entryFile here as the file may have been changed when applying the middleware
    entryPoints: [entry.file],
    bundle,
    absWorkingDir: entry.projectRoot,
    keepNames,
    ...isOutfile ? {
      outdir: void 0,
      outfile: destination,
      entryNames: void 0
    } : {
      outdir: destination,
      outfile: void 0,
      entryNames: entryName || path3__namespace.parse(entryFile).name
    },
    inject,
    external: bundle ? ["__STATIC_CONTENT_MANIFEST", ...external ? external : []] : void 0,
    format: entry.format === "modules" ? "esm" : "iife",
    target: COMMON_ESBUILD_OPTIONS.target,
    supported: COMMON_ESBUILD_OPTIONS.supported,
    sourcemap: sourcemap ?? true,
    // Include a reference to the output folder in the sourcemap.
    // This is omitted by default, but we need it to properly resolve source paths in error output.
    sourceRoot: destination,
    minify,
    metafile: true,
    conditions: getBuildConditions(),
    platform: getBuildPlatform(),
    define: {
      ...defineNavigatorUserAgent ? { "navigator.userAgent": `"Cloudflare-Workers"` } : {},
      "process.env.NODE_ENV": nodeEnvReplacement,
      "global.process.env.NODE_ENV": nodeEnvReplacement,
      "globalThis.process.env.NODE_ENV": nodeEnvReplacement,
      ...define2
    },
    loader: COMMON_ESBUILD_OPTIONS.loader,
    plugins: [
      aliasPlugin,
      moduleCollector.plugin,
      ...getNodeJSCompatPlugins({
        mode: nodejsCompatMode ?? null,
        compatibilityDate,
        compatibilityFlags
      }),
      cloudflareInternalPlugin,
      buildResultPlugin,
      ...plugins || [],
      configProviderPlugin(
        Object.fromEntries(
          middlewareToLoad.filter((m7) => m7.config !== void 0).map((m7) => [m7.name, m7.config])
        )
      )
    ],
    ...jsxFactory && { jsxFactory },
    ...jsxFragment && { jsxFragment },
    ...tsconfig && { tsconfig },
    // The default logLevel is "warning". So that we can rewrite errors before
    // logging, we disable esbuild's default logging, and log build failures
    // ourselves.
    logLevel: "silent"
  };
  let result;
  let stop;
  try {
    if (watch2) {
      const ctx = await esbuild__namespace.context(buildOptions);
      await ctx.watch();
      result = await initialBuildResultPromise;
      if (result.errors.length > 0) {
        throw new BuildFailure(
          "Initial build failed.",
          result.errors,
          result.warnings
        );
      }
      stop = /* @__PURE__ */ __name(async function() {
        tmpDir.remove();
        await ctx.dispose();
      }, "stop");
    } else {
      result = await esbuild__namespace.build(buildOptions);
      if (metafile && result.metafile) {
        let metaFilePath;
        if (typeof metafile === "string") {
          metaFilePath = path3__namespace.resolve(metafile);
        } else if (isOutfile) {
          metaFilePath = `${destination}.bundle-meta.json`;
        } else {
          metaFilePath = path3__namespace.join(destination, "bundle-meta.json");
        }
        const metaJson = JSON.stringify(result.metafile, null, 2);
        fs29__namespace.writeFileSync(metaFilePath, metaJson);
      }
      stop = /* @__PURE__ */ __name(async function() {
        tmpDir.remove();
      }, "stop");
    }
  } catch (e10) {
    if (isBuildFailure(e10)) {
      rewriteNodeCompatBuildFailure(e10.errors, nodejsCompatMode);
      rewriteUnresolvedModuleBuildFailure(e10.errors);
    }
    throw e10;
  }
  const entryPoint = getEntryPointFromMetafile(entryFile, result.metafile);
  const notExportedDOs = doBindings.filter((x7) => !x7.script_name && !entryPoint.exports.includes(x7.class_name)).map((x7) => x7.class_name);
  if (notExportedDOs.length) {
    const relativePath = path3__namespace.relative(process.cwd(), entryFile);
    throw new UserError(
      `Your Worker depends on the following Durable Objects, which are not exported in your entrypoint file: ${notExportedDOs.join(
        ", "
      )}.
You should export these objects from your entrypoint, ${relativePath}.`
    );
  }
  const notExportedWorkflows = workflowBindings.filter((x7) => !x7.script_name && !entryPoint.exports.includes(x7.class_name)).map((x7) => x7.class_name);
  if (notExportedWorkflows.length) {
    const relativePath = path3__namespace.relative(process.cwd(), entryFile);
    throw new UserError(
      `Your Worker depends on the following Workflows, which are not exported in your entrypoint file: ${notExportedWorkflows.join(
        ", "
      )}.
You should export these objects from your entrypoint, ${relativePath}.`
    );
  }
  const bundleType = entryPoint.exports.length > 0 ? "esm" : "commonjs";
  const sourceMapPath = Object.keys(result.metafile.outputs).filter(
    (_path) => _path.includes(".map")
  )[0];
  const resolvedEntryPointPath = path3__namespace.resolve(
    entry.projectRoot,
    entryPoint.relativePath
  );
  const modules = dedupeModulesByName([
    ...moduleCollector.modules,
    ...additionalModules
  ]);
  await writeAdditionalModules(modules, path3__namespace.dirname(resolvedEntryPointPath));
  return {
    modules,
    dependencies: entryPoint.dependencies,
    resolvedEntryPointPath,
    bundleType,
    stop,
    sourceMapPath,
    sourceMapMetadata: {
      tmpDir: tmpDir.path,
      entryDirectory: entry.projectRoot
    }
  };
}
function shouldCheckFetch(compatibilityDate = "2000-01-01", compatibilityFlags = []) {
  if (compatibilityFlags.includes("ignore_custom_ports")) {
    return true;
  }
  if (compatibilityFlags.includes("allow_custom_ports")) {
    return false;
  }
  return compatibilityDate < "2024-09-02";
}
var ESCAPE_REGEX_CHARACTERS, escapeRegex, COMMON_ESBUILD_OPTIONS, BuildFailure;
var init_bundle = __esm({
  "src/deployment-bundle/bundle.ts"() {
    init_import_meta_url();
    init_dist();
    init_source();
    init_experimental_flags();
    init_paths();
    init_apply_middleware();
    init_build_failures();
    init_dedupe_modules();
    init_entry_point_from_metafile();
    init_cloudflare_internal();
    init_config_provider();
    init_nodejs_plugins();
    init_find_additional_modules();
    init_module_collection();
    ESCAPE_REGEX_CHARACTERS = /[-/\\^$*+?.()|[\]{}]/g;
    escapeRegex = /* @__PURE__ */ __name((str) => {
      return str.replace(ESCAPE_REGEX_CHARACTERS, "\\$&");
    }, "escapeRegex");
    COMMON_ESBUILD_OPTIONS = {
      // v8 supports es2024 features as of 11.9
      // workerd uses [v8 version 14.2 as of 2025-10-17](https://developers.cloudflare.com/workers/platform/changelog/#2025-10-17)
      target: "es2024",
      supported: { "import-source": true },
      loader: { ".js": "jsx", ".mjs": "jsx", ".cjs": "jsx" }
    };
    __name(getBuildConditions, "getBuildConditions");
    __name(getBuildPlatform, "getBuildPlatform");
    __name(bundleWorker, "bundleWorker");
    BuildFailure = class extends Error {
      constructor(message, errors, warnings) {
        super(message);
        this.errors = errors;
        this.warnings = warnings;
      }
      static {
        __name(this, "BuildFailure");
      }
    };
    __name(shouldCheckFetch, "shouldCheckFetch");
  }
});

// src/deployment-bundle/no-bundle-worker.ts
async function noBundleWorker(entry, rules, outDir, pythonModulesExcludes = []) {
  const modules = await findAdditionalModules(
    entry,
    rules,
    false,
    pythonModulesExcludes
  );
  if (outDir) {
    await writeAdditionalModules(modules, outDir);
  }
  const bundleType = getBundleType(entry.format, entry.file);
  return {
    modules,
    dependencies: {},
    resolvedEntryPointPath: entry.file,
    bundleType
  };
}
var init_no_bundle_worker = __esm({
  "src/deployment-bundle/no-bundle-worker.ts"() {
    init_import_meta_url();
    init_bundle_type();
    init_find_additional_modules();
    __name(noBundleWorker, "noBundleWorker");
  }
});
async function runCommand(command2, cwd2, prefix = "[custom build]", wranglerCommand) {
  logger.log(source_default.blue(prefix), "Running:", command2);
  try {
    const res = execaCommand(command2, {
      shell: true,
      cwd: cwd2,
      env: {
        ...process.env,
        ...wranglerCommand ? { WRANGLER_COMMAND: wranglerCommand } : {}
      }
    });
    res.stdout?.pipe(
      new Stream.Writable({
        write(chunk, _5, callback) {
          const lines = chunk.toString().split("\n");
          for (const line of lines) {
            logger.log(source_default.blue(prefix), line);
          }
          callback();
        }
      })
    );
    res.stderr?.pipe(
      new Stream.Writable({
        write(chunk, _5, callback) {
          const lines = chunk.toString().split("\n");
          for (const line of lines) {
            logger.log(source_default.red(prefix), line);
          }
          callback();
        }
      })
    );
    await res;
  } catch (e10) {
    logger.error(e10);
    throw new UserError(
      `Running custom build \`${command2}\` failed. There are likely more logs from your build command above.`,
      {
        cause: e10
      }
    );
  }
}
async function runCustomBuild(expectedEntryAbsolute, expectedEntryRelative, build5, configPath, wranglerCommand) {
  if (build5.command) {
    await runCommand(
      build5.command,
      build5.cwd,
      "[custom build]",
      wranglerCommand
    );
    assertEntryPointExists(
      expectedEntryAbsolute,
      expectedEntryRelative,
      build5.command,
      configPath
    );
  } else {
    assertEntryPointExists(expectedEntryAbsolute, expectedEntryRelative);
  }
}
function assertEntryPointExists(expectedEntryAbsolute, expectedEntryRelative, customBuildCommand, configPath) {
  if (!fileExists(expectedEntryAbsolute)) {
    throw new UserError(
      getMissingEntryPointMessage(
        expectedEntryAbsolute,
        expectedEntryRelative,
        customBuildCommand,
        configPath
      )
    );
  }
}
function getMissingEntryPointMessage(absoluteEntryPointPath, relativeEntryPointPath, customBuildCommand, configPath) {
  if (fs29.existsSync(absoluteEntryPointPath) && fs29.statSync(absoluteEntryPointPath).isDirectory()) {
    let message = `The provided entry-point path, "${relativeEntryPointPath}", points to a directory, rather than a file.
`;
    const possiblePaths = [];
    for (const basenamePath of [
      "worker",
      "dist/worker",
      "index",
      "dist/index"
    ]) {
      for (const extension of [".ts", ".tsx", ".js", ".jsx"]) {
        const filePath = basenamePath + extension;
        if (fileExists(path3__namespace.default.resolve(absoluteEntryPointPath, filePath))) {
          possiblePaths.push(path3__namespace.default.join(relativeEntryPointPath, filePath));
        }
      }
    }
    if (possiblePaths.length > 0) {
      message += `
Did you mean to set the main field to${possiblePaths.length > 1 ? " one of" : ""}:
\`\`\`
` + possiblePaths.map((filePath) => `main = "./${filePath}"
`).join("") + "```";
    } else {
      message += `
 If you want to deploy a directory of static assets, you can do so by using the \`--assets\` flag. For example:

wrangler deploy --assets=./${relativeEntryPointPath}
`;
    }
    return message;
  }
  if (customBuildCommand) {
    return esm_default3`
			The expected output file at "${relativeEntryPointPath}" was not found after running custom build: ${customBuildCommand}.
			The \`main\` property in your ${configFileName(configPath)} file should point to the file generated by the custom build.
		`;
  }
  return esm_default3`
			The entry-point file at "${relativeEntryPointPath}" was not found.

			This might mean that your entry-point file needs to be generated (which is the general case when a framework is being used).
			If that's the case please run your project's build command and try again.
		`;
}
function fileExists(filePath) {
  const SOURCE_FILE_EXTENSIONS = [".ts", ".tsx", ".js", ".jsx"];
  if (path3__namespace.default.extname(filePath) !== "") {
    return fs29.existsSync(filePath);
  }
  const base = path3__namespace.default.join(path3__namespace.default.dirname(filePath), path3__namespace.default.basename(filePath));
  for (const ext2 of SOURCE_FILE_EXTENSIONS) {
    if (fs29.existsSync(base + ext2)) {
      return true;
    }
  }
  return false;
}
var init_run_custom_build = __esm({
  "src/deployment-bundle/run-custom-build.ts"() {
    init_import_meta_url();
    init_dist();
    init_source();
    init_execa();
    init_esm2();
    init_logger();
    __name(runCommand, "runCommand");
    __name(runCustomBuild, "runCustomBuild");
    __name(assertEntryPointExists, "assertEntryPointExists");
    __name(getMissingEntryPointMessage, "getMissingEntryPointMessage");
    __name(fileExists, "fileExists");
  }
});

// ../../node_modules/.pnpm/@webcontainer+env@1.1.0/node_modules/@webcontainer/env/dist/index.js
var require_dist2 = __commonJS({
  "../../node_modules/.pnpm/@webcontainer+env@1.1.0/node_modules/@webcontainer/env/dist/index.js"(exports, module2) {
    init_import_meta_url();
    var c8 = Object.defineProperty;
    var g7 = Object.getOwnPropertyDescriptor;
    var y5 = Object.getOwnPropertyNames;
    var d8 = Object.prototype.hasOwnProperty;
    var a7 = /* @__PURE__ */ __name((e10, t13) => c8(e10, "name", { value: t13, configurable: true }), "a");
    var b11 = /* @__PURE__ */ __name((e10, t13) => {
      for (var o7 in t13) c8(e10, o7, { get: t13[o7], enumerable: true });
    }, "b");
    var P4 = /* @__PURE__ */ __name((e10, t13, o7, u7) => {
      if (t13 && typeof t13 == "object" || typeof t13 == "function") for (let s7 of y5(t13)) !d8.call(e10, s7) && s7 !== o7 && c8(e10, s7, { get: /* @__PURE__ */ __name(() => t13[s7], "get"), enumerable: !(u7 = g7(t13, s7)) || u7.enumerable });
      return e10;
    }, "P");
    var U4 = /* @__PURE__ */ __name((e10) => P4(c8({}, "__esModule", { value: true }), e10), "U");
    var x7 = {};
    b11(x7, { HostURL: /* @__PURE__ */ __name(() => n9, "HostURL"), isWebContainer: /* @__PURE__ */ __name(() => h7, "isWebContainer") });
    module2.exports = U4(x7);
    var r10;
    try {
      r10 = __require("@blitz/internal/env");
    } catch (e10) {
    }
    function h7() {
      return r10 != null && process.versions.webcontainer != null;
    }
    __name(h7, "h");
    a7(h7, "isWebContainer");
    function p7(e10) {
      let t13 = r10 == null ? void 0 : r10.createServiceHostname(e10);
      if (!t13) throw new Error("Failed to construct service hostname");
      return t13;
    }
    __name(p7, "p");
    a7(p7, "_createServiceHostname");
    function f8(e10) {
      return r10 == null ? void 0 : r10.isServiceUrl(e10);
    }
    __name(f8, "f");
    a7(f8, "_isServiceUrl");
    function l8(e10) {
      return r10 == null ? void 0 : r10.isLocalhost(e10);
    }
    __name(l8, "l");
    a7(l8, "_isLocalhost");
    var n9 = class {
      static {
        __name(this, "n");
      }
      constructor(t13) {
        this._url = t13;
        if (this._port = this._url.port, h7() && l8(this._url.hostname)) {
          let o7 = p7(this._port);
          this._url.host = o7, this._port === this._url.port && (this._url.port = "");
        }
      }
      static parse(t13) {
        return t13 = typeof t13 == "string" ? new URL(t13) : t13, new n9(t13);
      }
      get port() {
        return h7() ? this._port : this._url.port;
      }
      get hash() {
        return this._url.hash;
      }
      get host() {
        return this._url.host;
      }
      get hostname() {
        return this._url.hostname;
      }
      get href() {
        return this._url.href;
      }
      get origin() {
        return this._url.origin;
      }
      get username() {
        return this._url.username;
      }
      get password() {
        return this._url.password;
      }
      get pathname() {
        return this._url.pathname;
      }
      get protocol() {
        return this._url.protocol;
      }
      get search() {
        return this._url.search;
      }
      get searchParams() {
        return this._url.searchParams;
      }
      update(t13) {
        var u7;
        let o7 = h7();
        for (let s7 in t13) {
          let i7 = (u7 = t13[s7]) != null ? u7 : "";
          if (o7) switch (s7) {
            case "port": {
              if (this._port = i7, (l8(this._url.hostname) || f8(this._url.hostname)) && (this._url.host = p7(i7), this._port !== this._url.port)) continue;
              break;
            }
            case "host": {
              let [m7, _5 = this._port] = i7.split(":");
              this._port = _5, l8(m7) && (i7 = p7(_5));
              break;
            }
            case "hostname": {
              if (l8(i7)) {
                if (/\/|:/.test(i7)) continue;
                i7 = p7(this._port);
              } else this._url.port = this._port;
              break;
            }
            case "href": {
              this._url = n9.parse(i7);
              continue;
            }
          }
          this._url[s7] = i7;
        }
        return this;
      }
      toString() {
        return this._url.toString();
      }
      toJSON() {
        return this._url.toJSON();
      }
    };
    a7(n9, "HostURL");
  }
});

// ../workers-shared/utils/configuration/parseStaticRouting.ts
function parseStaticRouting(input) {
  if (input.length === 0) {
    throw new Error(
      "No `run_worker_first` rules were provided; must provide at least 1 rule."
    );
  }
  if (input.length > MAX_ROUTES_RULES) {
    throw new Error(
      `Too many \`run_worker_first\` rules were provided; ${input.length} rules provided exceeds max of ${MAX_ROUTES_RULES}.`
    );
  }
  const rawAssetWorkerRules = [];
  const assetWorkerRules = [];
  const userWorkerRules = [];
  const invalidRules = [];
  for (const rule of input) {
    if (rule.startsWith("!/")) {
      assetWorkerRules.push(rule.slice(1));
      rawAssetWorkerRules.push(rule);
    } else if (rule.startsWith("/")) {
      userWorkerRules.push(rule);
    } else if (rule.startsWith("!")) {
      invalidRules.push(`'${rule}': negative rules must start with '!/'`);
    } else {
      invalidRules.push(`'${rule}': rules must start with '/' or '!/'`);
    }
  }
  if (assetWorkerRules.length > 0 && userWorkerRules.length === 0) {
    throw new Error(
      "Only negative `run_worker_first` rules were provided; must provide at least 1 non-negative rule"
    );
  }
  const invalidAssetWorkerRules = validateStaticRoutingRules(rawAssetWorkerRules);
  const invalidUserWorkerRules = validateStaticRoutingRules(userWorkerRules);
  const errorMessage = formatInvalidRoutes([
    ...invalidRules,
    ...invalidUserWorkerRules,
    ...invalidAssetWorkerRules
  ]);
  if (errorMessage) {
    throw new Error(errorMessage);
  }
  return { asset_worker: assetWorkerRules, user_worker: userWorkerRules };
}
function validateStaticRoutingRules(rules) {
  const invalid = [];
  const seen = /* @__PURE__ */ new Set();
  for (const rule of rules) {
    if (rule.length > MAX_ROUTES_RULE_LENGTH) {
      invalid.push(
        `'${rule}': all rules must be less than ${MAX_ROUTES_RULE_LENGTH} characters in length`
      );
    }
    if (seen.has(rule)) {
      invalid.push(`'${rule}': rule is a duplicate; rules must be unique`);
    }
    if (rule.endsWith("*")) {
      for (const otherRule of rules) {
        if (otherRule !== rule && otherRule.startsWith(rule.slice(0, -1))) {
          invalid.push(`'${otherRule}': rule '${rule}' makes it redundant`);
        }
      }
    }
    seen.add(rule);
  }
  return invalid;
}
var formatInvalidRoutes;
var init_parseStaticRouting = __esm({
  "../workers-shared/utils/configuration/parseStaticRouting.ts"() {
    init_import_meta_url();
    init_constants2();
    __name(parseStaticRouting, "parseStaticRouting");
    __name(validateStaticRoutingRules, "validateStaticRoutingRules");
    formatInvalidRoutes = /* @__PURE__ */ __name((invalidRules) => {
      if (invalidRules.length === 0) {
        return void 0;
      }
      return `Invalid routes in \`run_worker_first\`:
` + invalidRules.join("\n");
    }, "formatInvalidRoutes");
  }
});

// ../../node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.js
var require_eventemitter3 = __commonJS({
  "../../node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.js"(exports, module2) {
    init_import_meta_url();
    var has2 = Object.prototype.hasOwnProperty;
    var prefix = "~";
    function Events7() {
    }
    __name(Events7, "Events");
    if (Object.create) {
      Events7.prototype = /* @__PURE__ */ Object.create(null);
      if (!new Events7().__proto__) prefix = false;
    }
    function EE(fn2, context2, once) {
      this.fn = fn2;
      this.context = context2;
      this.once = once || false;
    }
    __name(EE, "EE");
    function addListener(emitter, event, fn2, context2, once) {
      if (typeof fn2 !== "function") {
        throw new TypeError("The listener must be a function");
      }
      var listener = new EE(fn2, context2 || emitter, once), evt = prefix ? prefix + event : event;
      if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;
      else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);
      else emitter._events[evt] = [emitter._events[evt], listener];
      return emitter;
    }
    __name(addListener, "addListener");
    function clearEvent(emitter, evt) {
      if (--emitter._eventsCount === 0) emitter._events = new Events7();
      else delete emitter._events[evt];
    }
    __name(clearEvent, "clearEvent");
    function EventEmitter5() {
      this._events = new Events7();
      this._eventsCount = 0;
    }
    __name(EventEmitter5, "EventEmitter");
    EventEmitter5.prototype.eventNames = /* @__PURE__ */ __name(function eventNames() {
      var names = [], events6, name2;
      if (this._eventsCount === 0) return names;
      for (name2 in events6 = this._events) {
        if (has2.call(events6, name2)) names.push(prefix ? name2.slice(1) : name2);
      }
      if (Object.getOwnPropertySymbols) {
        return names.concat(Object.getOwnPropertySymbols(events6));
      }
      return names;
    }, "eventNames");
    EventEmitter5.prototype.listeners = /* @__PURE__ */ __name(function listeners(event) {
      var evt = prefix ? prefix + event : event, handlers2 = this._events[evt];
      if (!handlers2) return [];
      if (handlers2.fn) return [handlers2.fn];
      for (var i7 = 0, l8 = handlers2.length, ee2 = new Array(l8); i7 < l8; i7++) {
        ee2[i7] = handlers2[i7].fn;
      }
      return ee2;
    }, "listeners");
    EventEmitter5.prototype.listenerCount = /* @__PURE__ */ __name(function listenerCount(event) {
      var evt = prefix ? prefix + event : event, listeners = this._events[evt];
      if (!listeners) return 0;
      if (listeners.fn) return 1;
      return listeners.length;
    }, "listenerCount");
    EventEmitter5.prototype.emit = /* @__PURE__ */ __name(function emit(event, a1, a22, a32, a42, a52) {
      var evt = prefix ? prefix + event : event;
      if (!this._events[evt]) return false;
      var listeners = this._events[evt], len = arguments.length, args, i7;
      if (listeners.fn) {
        if (listeners.once) this.removeListener(event, listeners.fn, void 0, true);
        switch (len) {
          case 1:
            return listeners.fn.call(listeners.context), true;
          case 2:
            return listeners.fn.call(listeners.context, a1), true;
          case 3:
            return listeners.fn.call(listeners.context, a1, a22), true;
          case 4:
            return listeners.fn.call(listeners.context, a1, a22, a32), true;
          case 5:
            return listeners.fn.call(listeners.context, a1, a22, a32, a42), true;
          case 6:
            return listeners.fn.call(listeners.context, a1, a22, a32, a42, a52), true;
        }
        for (i7 = 1, args = new Array(len - 1); i7 < len; i7++) {
          args[i7 - 1] = arguments[i7];
        }
        listeners.fn.apply(listeners.context, args);
      } else {
        var length = listeners.length, j7;
        for (i7 = 0; i7 < length; i7++) {
          if (listeners[i7].once) this.removeListener(event, listeners[i7].fn, void 0, true);
          switch (len) {
            case 1:
              listeners[i7].fn.call(listeners[i7].context);
              break;
            case 2:
              listeners[i7].fn.call(listeners[i7].context, a1);
              break;
            case 3:
              listeners[i7].fn.call(listeners[i7].context, a1, a22);
              break;
            case 4:
              listeners[i7].fn.call(listeners[i7].context, a1, a22, a32);
              break;
            default:
              if (!args) for (j7 = 1, args = new Array(len - 1); j7 < len; j7++) {
                args[j7 - 1] = arguments[j7];
              }
              listeners[i7].fn.apply(listeners[i7].context, args);
          }
        }
      }
      return true;
    }, "emit");
    EventEmitter5.prototype.on = /* @__PURE__ */ __name(function on(event, fn2, context2) {
      return addListener(this, event, fn2, context2, false);
    }, "on");
    EventEmitter5.prototype.once = /* @__PURE__ */ __name(function once(event, fn2, context2) {
      return addListener(this, event, fn2, context2, true);
    }, "once");
    EventEmitter5.prototype.removeListener = /* @__PURE__ */ __name(function removeListener(event, fn2, context2, once) {
      var evt = prefix ? prefix + event : event;
      if (!this._events[evt]) return this;
      if (!fn2) {
        clearEvent(this, evt);
        return this;
      }
      var listeners = this._events[evt];
      if (listeners.fn) {
        if (listeners.fn === fn2 && (!once || listeners.once) && (!context2 || listeners.context === context2)) {
          clearEvent(this, evt);
        }
      } else {
        for (var i7 = 0, events6 = [], length = listeners.length; i7 < length; i7++) {
          if (listeners[i7].fn !== fn2 || once && !listeners[i7].once || context2 && listeners[i7].context !== context2) {
            events6.push(listeners[i7]);
          }
        }
        if (events6.length) this._events[evt] = events6.length === 1 ? events6[0] : events6;
        else clearEvent(this, evt);
      }
      return this;
    }, "removeListener");
    EventEmitter5.prototype.removeAllListeners = /* @__PURE__ */ __name(function removeAllListeners(event) {
      var evt;
      if (event) {
        evt = prefix ? prefix + event : event;
        if (this._events[evt]) clearEvent(this, evt);
      } else {
        this._events = new Events7();
        this._eventsCount = 0;
      }
      return this;
    }, "removeAllListeners");
    EventEmitter5.prototype.off = EventEmitter5.prototype.removeListener;
    EventEmitter5.prototype.addListener = EventEmitter5.prototype.on;
    EventEmitter5.prefixed = prefix;
    EventEmitter5.EventEmitter = EventEmitter5;
    if ("undefined" !== typeof module2) {
      module2.exports = EventEmitter5;
    }
  }
});

// ../../node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.mjs
var import_index2;
var init_eventemitter3 = __esm({
  "../../node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.mjs"() {
    init_import_meta_url();
    import_index2 = __toESM(require_eventemitter3(), 1);
  }
});

// ../../node_modules/.pnpm/p-timeout@7.0.1/node_modules/p-timeout/index.js
function pTimeout(promise, options) {
  const {
    milliseconds,
    fallback,
    message,
    customTimers = { setTimeout, clearTimeout },
    signal
  } = options;
  let timer;
  let abortHandler;
  const wrappedPromise = new Promise((resolve32, reject) => {
    if (typeof milliseconds !== "number" || Math.sign(milliseconds) !== 1) {
      throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${milliseconds}\``);
    }
    if (signal?.aborted) {
      reject(getAbortedReason(signal));
      return;
    }
    if (signal) {
      abortHandler = /* @__PURE__ */ __name(() => {
        reject(getAbortedReason(signal));
      }, "abortHandler");
      signal.addEventListener("abort", abortHandler, { once: true });
    }
    promise.then(resolve32, reject);
    if (milliseconds === Number.POSITIVE_INFINITY) {
      return;
    }
    const timeoutError = new TimeoutError();
    timer = customTimers.setTimeout.call(void 0, () => {
      if (fallback) {
        try {
          resolve32(fallback());
        } catch (error2) {
          reject(error2);
        }
        return;
      }
      if (typeof promise.cancel === "function") {
        promise.cancel();
      }
      if (message === false) {
        resolve32();
      } else if (message instanceof Error) {
        reject(message);
      } else {
        timeoutError.message = message ?? `Promise timed out after ${milliseconds} milliseconds`;
        reject(timeoutError);
      }
    }, milliseconds);
  });
  const cancelablePromise = wrappedPromise.finally(() => {
    cancelablePromise.clear();
    if (abortHandler && signal) {
      signal.removeEventListener("abort", abortHandler);
    }
  });
  cancelablePromise.clear = () => {
    customTimers.clearTimeout.call(void 0, timer);
    timer = void 0;
  };
  return cancelablePromise;
}
var TimeoutError, getAbortedReason;
var init_p_timeout = __esm({
  "../../node_modules/.pnpm/p-timeout@7.0.1/node_modules/p-timeout/index.js"() {
    init_import_meta_url();
    TimeoutError = class _TimeoutError extends Error {
      static {
        __name(this, "TimeoutError");
      }
      name = "TimeoutError";
      constructor(message, options) {
        super(message, options);
        Error.captureStackTrace?.(this, _TimeoutError);
      }
    };
    getAbortedReason = /* @__PURE__ */ __name((signal) => signal.reason ?? new DOMException("This operation was aborted.", "AbortError"), "getAbortedReason");
    __name(pTimeout, "pTimeout");
  }
});

// ../../node_modules/.pnpm/p-queue@9.0.0/node_modules/p-queue/dist/lower-bound.js
function lowerBound(array, value, comparator) {
  let first = 0;
  let count = array.length;
  while (count > 0) {
    const step = Math.trunc(count / 2);
    let it2 = first + step;
    if (comparator(array[it2], value) <= 0) {
      first = ++it2;
      count -= step + 1;
    } else {
      count = step;
    }
  }
  return first;
}
var init_lower_bound = __esm({
  "../../node_modules/.pnpm/p-queue@9.0.0/node_modules/p-queue/dist/lower-bound.js"() {
    init_import_meta_url();
    __name(lowerBound, "lowerBound");
  }
});

// ../../node_modules/.pnpm/p-queue@9.0.0/node_modules/p-queue/dist/priority-queue.js
var PriorityQueue;
var init_priority_queue = __esm({
  "../../node_modules/.pnpm/p-queue@9.0.0/node_modules/p-queue/dist/priority-queue.js"() {
    init_import_meta_url();
    init_lower_bound();
    PriorityQueue = class {
      static {
        __name(this, "PriorityQueue");
      }
      #queue = [];
      enqueue(run2, options) {
        const { priority = 0, id } = options ?? {};
        const element = {
          priority,
          id,
          run: run2
        };
        if (this.size === 0 || this.#queue[this.size - 1].priority >= priority) {
          this.#queue.push(element);
          return;
        }
        const index = lowerBound(this.#queue, element, (a7, b11) => b11.priority - a7.priority);
        this.#queue.splice(index, 0, element);
      }
      setPriority(id, priority) {
        const index = this.#queue.findIndex((element) => element.id === id);
        if (index === -1) {
          throw new ReferenceError(`No promise function with the id "${id}" exists in the queue.`);
        }
        const [item] = this.#queue.splice(index, 1);
        this.enqueue(item.run, { priority, id });
      }
      dequeue() {
        const item = this.#queue.shift();
        return item?.run;
      }
      filter(options) {
        return this.#queue.filter((element) => element.priority === options.priority).map((element) => element.run);
      }
      get size() {
        return this.#queue.length;
      }
    };
  }
});

// ../../node_modules/.pnpm/p-queue@9.0.0/node_modules/p-queue/dist/index.js
var PQueue;
var init_dist6 = __esm({
  "../../node_modules/.pnpm/p-queue@9.0.0/node_modules/p-queue/dist/index.js"() {
    init_import_meta_url();
    init_eventemitter3();
    init_p_timeout();
    init_priority_queue();
    PQueue = class extends import_index2.default {
      static {
        __name(this, "PQueue");
      }
      #carryoverIntervalCount;
      #isIntervalIgnored;
      #intervalCount = 0;
      #intervalCap;
      #rateLimitedInInterval = false;
      #rateLimitFlushScheduled = false;
      #interval;
      #intervalEnd = 0;
      #lastExecutionTime = 0;
      #intervalId;
      #timeoutId;
      #queue;
      #queueClass;
      #pending = 0;
      // The `!` is needed because of https://github.com/microsoft/TypeScript/issues/32194
      #concurrency;
      #isPaused;
      // Use to assign a unique identifier to a promise function, if not explicitly specified
      #idAssigner = 1n;
      // Track currently running tasks for debugging
      #runningTasks = /* @__PURE__ */ new Map();
      /**
          Get or set the default timeout for all tasks. Can be changed at runtime.
      
          Operations will throw a `TimeoutError` if they don't complete within the specified time.
      
          The timeout begins when the operation is dequeued and starts execution, not while it's waiting in the queue.
      
          @example
          ```
          const queue = new PQueue({timeout: 5000});
      
          // Change timeout for all future tasks
          queue.timeout = 10000;
          ```
          */
      timeout;
      constructor(options) {
        super();
        options = {
          carryoverIntervalCount: false,
          intervalCap: Number.POSITIVE_INFINITY,
          interval: 0,
          concurrency: Number.POSITIVE_INFINITY,
          autoStart: true,
          queueClass: PriorityQueue,
          ...options
        };
        if (!(typeof options.intervalCap === "number" && options.intervalCap >= 1)) {
          throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${options.intervalCap?.toString() ?? ""}\` (${typeof options.intervalCap})`);
        }
        if (options.interval === void 0 || !(Number.isFinite(options.interval) && options.interval >= 0)) {
          throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${options.interval?.toString() ?? ""}\` (${typeof options.interval})`);
        }
        this.#carryoverIntervalCount = options.carryoverIntervalCount ?? options.carryoverConcurrencyCount ?? false;
        this.#isIntervalIgnored = options.intervalCap === Number.POSITIVE_INFINITY || options.interval === 0;
        this.#intervalCap = options.intervalCap;
        this.#interval = options.interval;
        this.#queue = new options.queueClass();
        this.#queueClass = options.queueClass;
        this.concurrency = options.concurrency;
        if (options.timeout !== void 0 && !(Number.isFinite(options.timeout) && options.timeout > 0)) {
          throw new TypeError(`Expected \`timeout\` to be a positive finite number, got \`${options.timeout}\` (${typeof options.timeout})`);
        }
        this.timeout = options.timeout;
        this.#isPaused = options.autoStart === false;
        this.#setupRateLimitTracking();
      }
      get #doesIntervalAllowAnother() {
        return this.#isIntervalIgnored || this.#intervalCount < this.#intervalCap;
      }
      get #doesConcurrentAllowAnother() {
        return this.#pending < this.#concurrency;
      }
      #next() {
        this.#pending--;
        if (this.#pending === 0) {
          this.emit("pendingZero");
        }
        this.#tryToStartAnother();
        this.emit("next");
      }
      #onResumeInterval() {
        this.#onInterval();
        this.#initializeIntervalIfNeeded();
        this.#timeoutId = void 0;
      }
      get #isIntervalPaused() {
        const now = Date.now();
        if (this.#intervalId === void 0) {
          const delay = this.#intervalEnd - now;
          if (delay < 0) {
            if (this.#lastExecutionTime > 0) {
              const timeSinceLastExecution = now - this.#lastExecutionTime;
              if (timeSinceLastExecution < this.#interval) {
                this.#createIntervalTimeout(this.#interval - timeSinceLastExecution);
                return true;
              }
            }
            this.#intervalCount = this.#carryoverIntervalCount ? this.#pending : 0;
          } else {
            this.#createIntervalTimeout(delay);
            return true;
          }
        }
        return false;
      }
      #createIntervalTimeout(delay) {
        if (this.#timeoutId !== void 0) {
          return;
        }
        this.#timeoutId = setTimeout(() => {
          this.#onResumeInterval();
        }, delay);
      }
      #clearIntervalTimer() {
        if (this.#intervalId) {
          clearInterval(this.#intervalId);
          this.#intervalId = void 0;
        }
      }
      #clearTimeoutTimer() {
        if (this.#timeoutId) {
          clearTimeout(this.#timeoutId);
          this.#timeoutId = void 0;
        }
      }
      #tryToStartAnother() {
        if (this.#queue.size === 0) {
          this.#clearIntervalTimer();
          this.emit("empty");
          if (this.#pending === 0) {
            this.#clearTimeoutTimer();
            this.emit("idle");
          }
          return false;
        }
        let taskStarted = false;
        if (!this.#isPaused) {
          const canInitializeInterval = !this.#isIntervalPaused;
          if (this.#doesIntervalAllowAnother && this.#doesConcurrentAllowAnother) {
            const job = this.#queue.dequeue();
            if (!this.#isIntervalIgnored) {
              this.#intervalCount++;
              this.#scheduleRateLimitUpdate();
            }
            this.emit("active");
            this.#lastExecutionTime = Date.now();
            job();
            if (canInitializeInterval) {
              this.#initializeIntervalIfNeeded();
            }
            taskStarted = true;
          }
        }
        return taskStarted;
      }
      #initializeIntervalIfNeeded() {
        if (this.#isIntervalIgnored || this.#intervalId !== void 0) {
          return;
        }
        this.#intervalId = setInterval(() => {
          this.#onInterval();
        }, this.#interval);
        this.#intervalEnd = Date.now() + this.#interval;
      }
      #onInterval() {
        if (this.#intervalCount === 0 && this.#pending === 0 && this.#intervalId) {
          this.#clearIntervalTimer();
        }
        this.#intervalCount = this.#carryoverIntervalCount ? this.#pending : 0;
        this.#processQueue();
        this.#scheduleRateLimitUpdate();
      }
      /**
      Executes all queued functions until it reaches the limit.
      */
      #processQueue() {
        while (this.#tryToStartAnother()) {
        }
      }
      get concurrency() {
        return this.#concurrency;
      }
      set concurrency(newConcurrency) {
        if (!(typeof newConcurrency === "number" && newConcurrency >= 1)) {
          throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${newConcurrency}\` (${typeof newConcurrency})`);
        }
        this.#concurrency = newConcurrency;
        this.#processQueue();
      }
      async #throwOnAbort(signal) {
        return new Promise((_resolve, reject) => {
          signal.addEventListener("abort", () => {
            reject(signal.reason);
          }, { once: true });
        });
      }
      /**
          Updates the priority of a promise function by its id, affecting its execution order. Requires a defined concurrency limit to take effect.
      
          For example, this can be used to prioritize a promise function to run earlier.
      
          ```js
          import PQueue from 'p-queue';
      
          const queue = new PQueue({concurrency: 1});
      
          queue.add(async () => '🦄', {priority: 1});
          queue.add(async () => '🦀', {priority: 0, id: '🦀'});
          queue.add(async () => '🦄', {priority: 1});
          queue.add(async () => '🦄', {priority: 1});
      
          queue.setPriority('🦀', 2);
          ```
      
          In this case, the promise function with `id: '🦀'` runs second.
      
          You can also deprioritize a promise function to delay its execution:
      
          ```js
          import PQueue from 'p-queue';
      
          const queue = new PQueue({concurrency: 1});
      
          queue.add(async () => '🦄', {priority: 1});
          queue.add(async () => '🦀', {priority: 1, id: '🦀'});
          queue.add(async () => '🦄');
          queue.add(async () => '🦄', {priority: 0});
      
          queue.setPriority('🦀', -1);
          ```
          Here, the promise function with `id: '🦀'` executes last.
          */
      setPriority(id, priority) {
        if (typeof priority !== "number" || !Number.isFinite(priority)) {
          throw new TypeError(`Expected \`priority\` to be a finite number, got \`${priority}\` (${typeof priority})`);
        }
        this.#queue.setPriority(id, priority);
      }
      async add(function_, options = {}) {
        options.id ??= (this.#idAssigner++).toString();
        options = {
          timeout: this.timeout,
          ...options
        };
        return new Promise((resolve32, reject) => {
          const taskSymbol = Symbol(`task-${options.id}`);
          this.#queue.enqueue(async () => {
            this.#pending++;
            this.#runningTasks.set(taskSymbol, {
              id: options.id,
              priority: options.priority ?? 0,
              // Match priority-queue default
              startTime: Date.now(),
              timeout: options.timeout
            });
            try {
              try {
                options.signal?.throwIfAborted();
              } catch (error2) {
                if (!this.#isIntervalIgnored) {
                  this.#intervalCount--;
                }
                this.#runningTasks.delete(taskSymbol);
                throw error2;
              }
              let operation = function_({ signal: options.signal });
              if (options.timeout) {
                operation = pTimeout(Promise.resolve(operation), {
                  milliseconds: options.timeout,
                  message: `Task timed out after ${options.timeout}ms (queue has ${this.#pending} running, ${this.#queue.size} waiting)`
                });
              }
              if (options.signal) {
                operation = Promise.race([operation, this.#throwOnAbort(options.signal)]);
              }
              const result = await operation;
              resolve32(result);
              this.emit("completed", result);
            } catch (error2) {
              reject(error2);
              this.emit("error", error2);
            } finally {
              this.#runningTasks.delete(taskSymbol);
              queueMicrotask(() => {
                this.#next();
              });
            }
          }, options);
          this.emit("add");
          this.#tryToStartAnother();
        });
      }
      async addAll(functions, options) {
        return Promise.all(functions.map(async (function_) => this.add(function_, options)));
      }
      /**
      Start (or resume) executing enqueued tasks within concurrency limit. No need to call this if queue is not paused (via `options.autoStart = false` or by `.pause()` method.)
      */
      start() {
        if (!this.#isPaused) {
          return this;
        }
        this.#isPaused = false;
        this.#processQueue();
        return this;
      }
      /**
      Put queue execution on hold.
      */
      pause() {
        this.#isPaused = true;
      }
      /**
      Clear the queue.
      */
      clear() {
        this.#queue = new this.#queueClass();
        this.#updateRateLimitState();
      }
      /**
          Can be called multiple times. Useful if you for example add additional items at a later time.
      
          @returns A promise that settles when the queue becomes empty.
          */
      async onEmpty() {
        if (this.#queue.size === 0) {
          return;
        }
        await this.#onEvent("empty");
      }
      /**
          @returns A promise that settles when the queue size is less than the given limit: `queue.size < limit`.
      
          If you want to avoid having the queue grow beyond a certain size you can `await queue.onSizeLessThan()` before adding a new item.
      
          Note that this only limits the number of items waiting to start. There could still be up to `concurrency` jobs already running that this call does not include in its calculation.
          */
      async onSizeLessThan(limit2) {
        if (this.#queue.size < limit2) {
          return;
        }
        await this.#onEvent("next", () => this.#queue.size < limit2);
      }
      /**
          The difference with `.onEmpty` is that `.onIdle` guarantees that all work from the queue has finished. `.onEmpty` merely signals that the queue is empty, but it could mean that some promises haven't completed yet.
      
          @returns A promise that settles when the queue becomes empty, and all promises have completed; `queue.size === 0 && queue.pending === 0`.
          */
      async onIdle() {
        if (this.#pending === 0 && this.#queue.size === 0) {
          return;
        }
        await this.#onEvent("idle");
      }
      /**
          The difference with `.onIdle` is that `.onPendingZero` only waits for currently running tasks to finish, ignoring queued tasks.
      
          @returns A promise that settles when all currently running tasks have completed; `queue.pending === 0`.
          */
      async onPendingZero() {
        if (this.#pending === 0) {
          return;
        }
        await this.#onEvent("pendingZero");
      }
      /**
      @returns A promise that settles when the queue becomes rate-limited due to intervalCap.
      */
      async onRateLimit() {
        if (this.isRateLimited) {
          return;
        }
        await this.#onEvent("rateLimit");
      }
      /**
      @returns A promise that settles when the queue is no longer rate-limited.
      */
      async onRateLimitCleared() {
        if (!this.isRateLimited) {
          return;
        }
        await this.#onEvent("rateLimitCleared");
      }
      /**
          @returns A promise that rejects when any task in the queue errors.
      
          Use with `Promise.race([queue.onError(), queue.onIdle()])` to fail fast on the first error while still resolving normally when the queue goes idle.
      
          Important: The promise returned by `add()` still rejects. You must handle each `add()` promise (for example, `.catch(() => {})`) to avoid unhandled rejections.
      
          @example
          ```
          import PQueue from 'p-queue';
      
          const queue = new PQueue({concurrency: 2});
      
          queue.add(() => fetchData(1)).catch(() => {});
          queue.add(() => fetchData(2)).catch(() => {});
          queue.add(() => fetchData(3)).catch(() => {});
      
          // Stop processing on first error
          try {
              await Promise.race([
                  queue.onError(),
                  queue.onIdle()
              ]);
          } catch (error) {
              queue.pause(); // Stop processing remaining tasks
              console.error('Queue failed:', error);
          }
          ```
          */
      // eslint-disable-next-line @typescript-eslint/promise-function-async
      async onError() {
        return new Promise((_resolve, reject) => {
          const handleError2 = /* @__PURE__ */ __name((error2) => {
            this.off("error", handleError2);
            reject(error2);
          }, "handleError");
          this.on("error", handleError2);
        });
      }
      async #onEvent(event, filter2) {
        return new Promise((resolve32) => {
          const listener = /* @__PURE__ */ __name(() => {
            if (filter2 && !filter2()) {
              return;
            }
            this.off(event, listener);
            resolve32();
          }, "listener");
          this.on(event, listener);
        });
      }
      /**
      Size of the queue, the number of queued items waiting to run.
      */
      get size() {
        return this.#queue.size;
      }
      /**
          Size of the queue, filtered by the given options.
      
          For example, this can be used to find the number of items remaining in the queue with a specific priority level.
          */
      sizeBy(options) {
        return this.#queue.filter(options).length;
      }
      /**
      Number of running items (no longer in the queue).
      */
      get pending() {
        return this.#pending;
      }
      /**
      Whether the queue is currently paused.
      */
      get isPaused() {
        return this.#isPaused;
      }
      #setupRateLimitTracking() {
        if (this.#isIntervalIgnored) {
          return;
        }
        this.on("add", () => {
          if (this.#queue.size > 0) {
            this.#scheduleRateLimitUpdate();
          }
        });
        this.on("next", () => {
          this.#scheduleRateLimitUpdate();
        });
      }
      #scheduleRateLimitUpdate() {
        if (this.#isIntervalIgnored || this.#rateLimitFlushScheduled) {
          return;
        }
        this.#rateLimitFlushScheduled = true;
        queueMicrotask(() => {
          this.#rateLimitFlushScheduled = false;
          this.#updateRateLimitState();
        });
      }
      #updateRateLimitState() {
        const previous = this.#rateLimitedInInterval;
        const shouldBeRateLimited = !this.#isIntervalIgnored && this.#intervalCount >= this.#intervalCap && this.#queue.size > 0;
        if (shouldBeRateLimited !== previous) {
          this.#rateLimitedInInterval = shouldBeRateLimited;
          this.emit(shouldBeRateLimited ? "rateLimit" : "rateLimitCleared");
        }
      }
      /**
      Whether the queue is currently rate-limited due to intervalCap.
      */
      get isRateLimited() {
        return this.#rateLimitedInInterval;
      }
      /**
          Whether the queue is saturated. Returns `true` when:
          - All concurrency slots are occupied and tasks are waiting, OR
          - The queue is rate-limited and tasks are waiting
      
          Useful for detecting backpressure and potential hanging tasks.
      
          ```js
          import PQueue from 'p-queue';
      
          const queue = new PQueue({concurrency: 2});
      
          // Backpressure handling
          if (queue.isSaturated) {
              console.log('Queue is saturated, waiting for capacity...');
              await queue.onSizeLessThan(queue.concurrency);
          }
      
          // Monitoring for stuck tasks
          setInterval(() => {
              if (queue.isSaturated) {
                  console.warn(`Queue saturated: ${queue.pending} running, ${queue.size} waiting`);
              }
          }, 60000);
          ```
          */
      get isSaturated() {
        return this.#pending === this.#concurrency && this.#queue.size > 0 || this.isRateLimited && this.#queue.size > 0;
      }
      /**
          The tasks currently being executed. Each task includes its `id`, `priority`, `startTime`, and `timeout` (if set).
      
          Returns an array of task info objects.
      
          ```js
          import PQueue from 'p-queue';
      
          const queue = new PQueue({concurrency: 2});
      
          // Add tasks with IDs for better debugging
          queue.add(() => fetchUser(123), {id: 'user-123'});
          queue.add(() => fetchPosts(456), {id: 'posts-456', priority: 1});
      
          // Check what's running
          console.log(queue.runningTasks);
          // => [{
          //   id: 'user-123',
          //   priority: 0,
          //   startTime: 1759253001716,
          //   timeout: undefined
          // }, {
          //   id: 'posts-456',
          //   priority: 1,
          //   startTime: 1759253001916,
          //   timeout: undefined
          // }]
          ```
          */
      get runningTasks() {
        return [...this.#runningTasks.values()].map((task) => ({ ...task }));
      }
    };
  }
});

// ../../node_modules/.pnpm/pretty-bytes@6.1.1/node_modules/pretty-bytes/index.js
function prettyBytes(number, options) {
  if (!Number.isFinite(number)) {
    throw new TypeError(`Expected a finite number, got ${typeof number}: ${number}`);
  }
  options = {
    bits: false,
    binary: false,
    space: true,
    ...options
  };
  const UNITS = options.bits ? options.binary ? BIBIT_UNITS : BIT_UNITS : options.binary ? BIBYTE_UNITS : BYTE_UNITS;
  const separator = options.space ? " " : "";
  if (options.signed && number === 0) {
    return ` 0${separator}${UNITS[0]}`;
  }
  const isNegative = number < 0;
  const prefix = isNegative ? "-" : options.signed ? "+" : "";
  if (isNegative) {
    number = -number;
  }
  let localeOptions;
  if (options.minimumFractionDigits !== void 0) {
    localeOptions = { minimumFractionDigits: options.minimumFractionDigits };
  }
  if (options.maximumFractionDigits !== void 0) {
    localeOptions = { maximumFractionDigits: options.maximumFractionDigits, ...localeOptions };
  }
  if (number < 1) {
    const numberString2 = toLocaleString(number, options.locale, localeOptions);
    return prefix + numberString2 + separator + UNITS[0];
  }
  const exponent = Math.min(Math.floor(options.binary ? Math.log(number) / Math.log(1024) : Math.log10(number) / 3), UNITS.length - 1);
  number /= (options.binary ? 1024 : 1e3) ** exponent;
  if (!localeOptions) {
    number = number.toPrecision(3);
  }
  const numberString = toLocaleString(Number(number), options.locale, localeOptions);
  const unit = UNITS[exponent];
  return prefix + numberString + separator + unit;
}
var BYTE_UNITS, BIBYTE_UNITS, BIT_UNITS, BIBIT_UNITS, toLocaleString;
var init_pretty_bytes = __esm({
  "../../node_modules/.pnpm/pretty-bytes@6.1.1/node_modules/pretty-bytes/index.js"() {
    init_import_meta_url();
    BYTE_UNITS = [
      "B",
      "kB",
      "MB",
      "GB",
      "TB",
      "PB",
      "EB",
      "ZB",
      "YB"
    ];
    BIBYTE_UNITS = [
      "B",
      "KiB",
      "MiB",
      "GiB",
      "TiB",
      "PiB",
      "EiB",
      "ZiB",
      "YiB"
    ];
    BIT_UNITS = [
      "b",
      "kbit",
      "Mbit",
      "Gbit",
      "Tbit",
      "Pbit",
      "Ebit",
      "Zbit",
      "Ybit"
    ];
    BIBIT_UNITS = [
      "b",
      "kibit",
      "Mibit",
      "Gibit",
      "Tibit",
      "Pibit",
      "Eibit",
      "Zibit",
      "Yibit"
    ];
    toLocaleString = /* @__PURE__ */ __name((number, locale, options) => {
      let result = number;
      if (typeof locale === "string" || Array.isArray(locale)) {
        result = number.toLocaleString(locale, options);
      } else if (locale === true || options !== void 0) {
        result = number.toLocaleString(void 0, options);
      }
      return result;
    }, "toLocaleString");
    __name(prettyBytes, "prettyBytes");
  }
});

// src/core/create-command.ts
function createCommand(definition) {
  return definition;
}
function createNamespace(definition) {
  return definition;
}
function createAlias(definition) {
  return definition;
}
var init_create_command = __esm({
  "src/core/create-command.ts"() {
    init_import_meta_url();
    __name(createCommand, "createCommand");
    __name(createNamespace, "createNamespace");
    __name(createAlias, "createAlias");
  }
});

// src/core/helpers.ts
function demandOneOfOption(...options) {
  return function(argv) {
    const count = options.filter((option) => argv[option]).length;
    const lastOption = options.pop();
    if (count === 0) {
      throw new CommandLineArgsError(
        `Exactly one of the arguments ${options.join(
          ", "
        )} and ${lastOption} is required`
      );
    } else if (count > 1) {
      throw new CommandLineArgsError(
        `Arguments ${options.join(
          ", "
        )} and ${lastOption} are mutually exclusive`
      );
    }
    return true;
  };
}
function demandSingleValue(key, allow) {
  return function(argv) {
    if (Array.isArray(argv[key]) && !allow?.(argv)) {
      throw new CommandLineArgsError(
        `The argument "--${key}" expects a single value, but received multiple: ${JSON.stringify(argv[key])}.`
      );
    }
    return true;
  };
}
function isAliasDefinition(def) {
  return def.aliasOf !== void 0;
}
function isCommandDefinition(def) {
  return def.handler !== void 0;
}
function isNamespaceDefinition(def) {
  return !isAliasDefinition(def) && !isCommandDefinition(def);
}
var init_helpers3 = __esm({
  "src/core/helpers.ts"() {
    init_import_meta_url();
    init_dist();
    __name(demandOneOfOption, "demandOneOfOption");
    __name(demandSingleValue, "demandSingleValue");
    __name(isAliasDefinition, "isAliasDefinition");
    __name(isCommandDefinition, "isCommandDefinition");
    __name(isNamespaceDefinition, "isNamespaceDefinition");
  }
});
function constructStatusMessage(command2, status2) {
  const indefiniteArticle = "aeiou".includes(status2[0]) ? "an" : "a";
  return `\u{1F6A7} \`${command2}\` is ${indefiniteArticle} ${status2} command. Please report any issues to https://github.com/cloudflare/workers-sdk/issues/new/choose`;
}
var BETA_CMD_COLOR, COMMAND_CATEGORY_ORDER, CommandRegistry, CommandRegistrationError;
var init_CommandRegistry = __esm({
  "src/core/CommandRegistry.ts"() {
    init_import_meta_url();
    init_source();
    init_helpers3();
    BETA_CMD_COLOR = "#BD5B08";
    COMMAND_CATEGORY_ORDER = [
      "Account",
      "Compute & AI",
      "Storage & databases",
      "Networking & security"
    ];
    CommandRegistry = class {
      static {
        __name(this, "CommandRegistry");
      }
      /**
       * Root node of the definition tree.
       */
      #DefinitionTreeRoot;
      /**
       * Set of registered namespaces.
       */
      #registeredNamespaces;
      /**
       * Function to register a command.
       */
      #registerCommand;
      /**
       * The tree structure representing all command definitions.
       */
      #tree;
      /**
       * Map of category names to command segments.
       * Used for grouping commands in the help output.
       */
      #categories;
      /**
       * Set of legacy command names registered outside the `CommandRegistry` class.
       * Used to track commands like `containers`, `pubsub`, etc.
       */
      #legacyCommands;
      /**
       * Initializes the command registry with the given command registration function.
       */
      constructor(registerCommand) {
        this.#DefinitionTreeRoot = { subtree: /* @__PURE__ */ new Map() };
        this.#registeredNamespaces = /* @__PURE__ */ new Set();
        this.#registerCommand = registerCommand;
        this.#tree = this.#DefinitionTreeRoot.subtree;
        this.#categories = /* @__PURE__ */ new Map();
        this.#legacyCommands = /* @__PURE__ */ new Set();
      }
      /**
       * Defines multiple commands and their corresponding definitions.
       */
      define(defs) {
        for (const def of defs) {
          this.#defineOne(def);
        }
      }
      getDefinitionTreeRoot() {
        return this.#DefinitionTreeRoot;
      }
      /**
       * Registers all commands in the command registry, walking through the definition tree.
       */
      registerAll() {
        for (const [segment, node2] of this.#tree.entries()) {
          if (this.#registeredNamespaces.has(segment)) {
            continue;
          }
          this.#registeredNamespaces.add(segment);
          this.#walkTreeAndRegister(segment, node2, `wrangler ${segment}`);
        }
      }
      /**
       * Registers a specific namespace if not already registered.
       * TODO: Remove this once all commands use the command registry.
       * See https://github.com/cloudflare/workers-sdk/pull/7357#discussion_r1862138470 for more details.
       */
      registerNamespace(namespace) {
        if (this.#registeredNamespaces.has(namespace)) {
          return;
        }
        const node2 = this.#tree.get(namespace);
        if (!node2?.definition) {
          throw new CommandRegistrationError(
            `Missing namespace definition for 'wrangler ${namespace}'`
          );
        }
        this.#registeredNamespaces.add(namespace);
        this.#walkTreeAndRegister(namespace, node2, `wrangler ${namespace}`);
      }
      /**
       * Get a set of all top-level command names.
       *
       * Includes both registry-defined commands & legacy commands.
       */
      get topLevelCommands() {
        const commands5 = new Set(this.#tree.keys());
        for (const legacyCmd of this.#legacyCommands) {
          commands5.add(legacyCmd);
        }
        return commands5;
      }
      /**
       * Returns the map of categories to command segments, ordered according to
       * the category order. Commands within each category are sorted alphabetically.
       * Used for grouping commands in the help output.
       */
      get orderedCategories() {
        const orderedCategories = /* @__PURE__ */ new Map();
        for (const category of COMMAND_CATEGORY_ORDER) {
          if (!this.#categories.has(category)) {
            continue;
          }
          const commands5 = this.#categories.get(category) ?? [];
          orderedCategories.set(category, [...commands5].sort());
        }
        const remainingCategories = Array.from(this.#categories.keys()).filter(
          (cat) => !COMMAND_CATEGORY_ORDER.includes(cat)
        ).sort();
        for (const category of remainingCategories) {
          const commands5 = this.#categories.get(category) ?? [];
          orderedCategories.set(category, [...commands5].sort());
        }
        return orderedCategories;
      }
      /**
       * Registers a legacy command that doesn't use the `CommandRegistry` class.
       * This is used for hidden commands like `cloudchamber` that use the old yargs pattern.
       */
      registerLegacyCommand(command2) {
        this.#legacyCommands.add(command2);
      }
      /**
       * Registers a category for a legacy command that doesn't use the CommandRegistry.
       * This is used for commands like `containers`, etc, that use the old yargs pattern.
       */
      registerLegacyCommandCategory(command2, category) {
        this.#legacyCommands.add(command2);
        const existing = this.#categories.get(category) ?? [];
        if (existing.includes(command2)) {
          return;
        }
        existing.push(command2);
        this.#categories.set(category, existing);
      }
      /**
       * Defines a single command and its corresponding definition.
       */
      #defineOne({
        command: command2,
        definition
      }) {
        if (isAliasDefinition(definition)) {
          this.#upsertDefinition({ type: "alias", command: command2, ...definition });
        }
        if (isCommandDefinition(definition)) {
          this.#upsertDefinition({ type: "command", command: command2, ...definition });
          this.#trackCategory(command2, definition.metadata?.category);
        } else if (isNamespaceDefinition(definition)) {
          this.#upsertDefinition({ type: "namespace", command: command2, ...definition });
          this.#trackCategory(command2, definition.metadata?.category);
        }
      }
      /**
       * Adds a top-level command (e.g., "wrangler r2") to the `#categories` map for help output grouping.
       * Subcommands (e.g., "wrangler r2 bucket") are ignored since the parent already represents them.
       */
      #trackCategory(command2, category) {
        const segments = command2.split(" ").slice(1);
        if (segments.length !== 1) {
          return;
        }
        if (!category) {
          return;
        }
        const segment = segments[0];
        const existing = this.#categories.get(category) ?? [];
        if (!existing.includes(segment)) {
          existing.push(segment);
          this.#categories.set(category, existing);
        }
      }
      /**
       * Finds a node in the definition tree for the given command.
       *
       * @example
       *
       * this.#upsertDefinition({
       *   type: 'command',
       *   command: 'wrangler hello',
       *   handler: "helloHandlerFunction",
       *   metadata: {
       *     description: "Say hello",
       *     status: "stable",
       *     owner: "Cloudflare Team"
       *   }
       * });
       *
       * const node = this.#findNodeFor('wrangler hello');
       * console.log(node.definition.command); // Output: 'wrangler hello'
       *
       * const nonExistentNode = this.#findNodeFor('wrangler unknown');
       * console.log(nonExistentNode); // Output: undefined
       */
      #findNodeFor(command2) {
        const segments = command2.split(" ").slice(1);
        let node2 = this.#DefinitionTreeRoot;
        for (const segment of segments) {
          const child = node2.subtree.get(segment);
          if (!child) {
            return void 0;
          }
          node2 = child;
        }
        return node2;
      }
      /**
       * Finds the parent node of a command in the tree.
       *
       * @example
       *
       * this.#upsertDefinition({
       *   type: 'namespace',
       *   command: 'wrangler interact',
       *   metadata: {
       *     description: "Greet",
       *     status: "stable",
       *   }
       * });
       * this.#upsertDefinition({
       *   type: 'command',
       *   command: 'wrangler interact hello',
       *   handler: () => {},
       *   metadata: {
       *     description: "Say hello",
       *     status: "stable",
       *     owner: "Cloudflare Team"
       *   }
       * });
       *
       * const parentNode = this.#findParentFor('wrangler interact hello');
       * console.log(parentNode.definition.command); // Output: 'wrangler interact'
       */
      #findParentFor(command2) {
        const parentCommand = command2.split(" ").slice(0, -2).join(" ");
        return this.#findNodeFor(parentCommand);
      }
      /**
       * Resolves the definition chain for a given command, following aliases and parent commands.
       *
       * @example
       *
       * this.#upsertDefinition({
       *   type: 'alias',
       *   command: 'wrangler greet',
       *   aliasOf: 'wrangler hello',
       *   metadata: {
       *     description: "A greeting alias for hello",
       *     status: "stable"
       *   }
       * });
       *
       * const chain = this.#resolveDefinitionChain({
       *   type: 'alias',
       *   command: 'wrangler greet',
       *   aliasOf: 'wrangler hello',
       *   metadata: {
       *     description: "A greeting alias for hello",
       *     status: "stable"
       *   }
       * });
       * console.log(chain.map(def => def.command)); // Output: ['"wrangler greet" => "wrangler hello"']
       *
       * // The example throws an error because of a circular reference
       * this.#upsertDefinition({
       *   type: 'alias',
       *   command: 'wrangler hello',
       *   aliasOf: 'wrangler greet',
       *   metadata: {
       *     description: "Alias for greet",
       *     status: "stable"
       *   }
       * });
       * const chain = this.#resolveDefinitionChain({
       *   type: 'alias',
       *   command: 'wrangler greet',
       *   aliasOf: 'wrangler hello',
       *   metadata: {
       *     description: "A greeting alias for hello",
       *     status: "stable"
       *   }
       * });
       */
      #resolveDefinitionChain(def) {
        const chain2 = [];
        const stringifyChain = /* @__PURE__ */ __name((...extra) => [...chain2, ...extra].map(({ command: command2 }) => `"${command2}"`).join(" => "), "stringifyChain");
        while (true) {
          if (chain2.includes(def)) {
            throw new CommandRegistrationError(
              `Circular reference detected for alias definition: "${def.command}" (resolving from ${stringifyChain(def)})`
            );
          }
          chain2.push(def);
          const node2 = def.type === "alias" ? this.#findNodeFor(def.aliasOf) : this.#findParentFor(def.command);
          if (node2 === this.#DefinitionTreeRoot) {
            return chain2;
          }
          if (!node2?.definition) {
            throw new CommandRegistrationError(
              `Missing definition for "${def.type === "alias" ? def.aliasOf : def.command}" (resolving from ${stringifyChain()})`
            );
          }
          def = node2.definition;
        }
      }
      /**
       * Resolves a definition node, returning a non-alias definition and its associated metadata.
       *
       * @example
       *
       * this.#upsertDefinition({
       *   type: 'command',
       *   command: 'wrangler hello',
       *   handler: (args, { config }) => {},
       *   metadata: {
       *     description: "Say hello",
       *     status: "stable",
       *     owner: "Cloudflare Team"
       *   }
       * });
       * this.#upsertDefinition({
       *   type: 'alias',
       *   command: 'wrangler greet',
       *   aliasOf: 'wrangler hello',
       *   metadata: {
       *     description: "A greeting alias for hello",
       *     status: "stable"
       *   }
       * });
       *
       * const { definition, subtree } = this.#resolveDefinitionNode({
       *   type: 'alias',
       *   command: 'wrangler greet',
       *   aliasOf: 'wrangler hello',
       *   metadata: {
       *     description: "A greeting alias for hello",
       *     status: "stable"
       *   }
       * });
       * console.log(definition.command); // Output: 'wrangler hello'
       * console.log(subtree); // Output: empty Map if 'wrangler hello' has no further subcommands
       */
      #resolveDefinitionNode(node2) {
        assert53__default.default(node2.definition);
        const chain2 = this.#resolveDefinitionChain(node2.definition);
        const resolvedDef = chain2.find((def) => def.type !== "alias");
        assert53__default.default(resolvedDef);
        const { subtree } = node2.definition.type !== "alias" ? node2 : this.#findNodeFor(resolvedDef.command) ?? node2;
        const definition = {
          // take all properties from the resolved alias
          ...resolvedDef,
          // keep the original command
          command: node2.definition.command,
          // flatten metadata from entire chain (decreasing precedence)
          metadata: Object.assign(
            {},
            ...chain2.map((def) => def.metadata).reverse()
          )
        };
        return { definition, subtree };
      }
      /**
       * Inserts or updates a command definition in the tree. When a command, alias, or namespace is added to the tree
       * it will first split it into segments, e.g.
       *
       * `wrangler namespace-a` => ["namespace-a", "command-a"]
       *
       * Then it will walk through the segments and create a new node for each segment, creating an empty definition and
       * a subtree for each. The next segment is then defined on that subtree.
       *
       * When the last segment is reached, the definition is added. This way, only commands and aliases have definitions, while
       * namespaces are just nodes in the tree.
       *
       * @example
       *
       * this.#upsertDefinition({ type: 'command', command: 'wrangler command-a', ... });
       * this.#upsertDefinition({ type: 'namespace', command: 'wrangler namespace-b', ... });
       * this.#upsertDefinition({ type: 'command', command: 'wrangler command-b', ... });
       *
       * // Resulting tree:
       *
       * this.#DefinitionTreeRoot: {
       *   "subtree": {
       *     "command-a": {
       *       "definition": {
       *         "type": "command",
       *         "command": "wrangler command-a",
       *         "handler": (args, { config }) => {},
       *         "metadata": { "description": "Command a" }
       *       },
       *       "subtree": new Map()
       *     },
       *     "namespace-b": {
       *       "subtree": {
       *         "command-b": {
       *           "definition": {
       *             "type": "command",
       *             "command": "wrangler namespace-b command-b",
       *             "handler": (args, { config }) => {},
       *             "metadata": { "description": "Command b" }
       *           },
       *           "subtree": new Map()
       *         }
       *       }
       *     }
       *   }
       * }
       */
      #upsertDefinition(def) {
        const segments = def.command.split(" ").slice(1);
        let node2 = this.#DefinitionTreeRoot;
        for (const segment of segments) {
          const subtree = node2.subtree;
          let child = subtree.get(segment);
          if (!child) {
            child = {
              definition: void 0,
              subtree: /* @__PURE__ */ new Map()
            };
            subtree.set(segment, child);
          }
          node2 = child;
        }
        if (node2.definition) {
          throw new CommandRegistrationError(
            `Duplicate definition for "${def.command}"`
          );
        }
        node2.definition = def;
        return node2;
      }
      /**
       * Walks through the definition tree and registers all subcommands for a given segment.
       */
      #walkTreeAndRegister(segment, node2, fullCommand) {
        if (!node2.definition) {
          throw new CommandRegistrationError(
            `Missing namespace definition for '${fullCommand}'`
          );
        }
        const aliasOf = node2.definition.type === "alias" && node2.definition.aliasOf;
        const { definition: def, subtree } = this.#resolveDefinitionNode(node2);
        if (aliasOf) {
          def.metadata.description += `

Alias for "${aliasOf}".`;
        }
        if (def.metadata.deprecated) {
          def.metadata.deprecatedMessage ??= `Deprecated: "${def.command}" is deprecated`;
        }
        if (def.metadata.status !== "stable") {
          def.metadata.description += source_default.hex(BETA_CMD_COLOR)(
            ` [${def.metadata.status}]`
          );
          def.metadata.statusMessage ??= constructStatusMessage(
            def.command,
            def.metadata.status
          );
        }
        if (def.type === "command") {
          const commandPositionalArgsSuffix = def.positionalArgs?.map((key) => {
            const { demandOption, array } = def.args?.[key] ?? {};
            return demandOption ? `<${key}${array ? ".." : ""}>` : `[${key}${array ? ".." : ""}]`;
          }).join(" ");
          if (commandPositionalArgsSuffix) {
            segment += " " + commandPositionalArgsSuffix;
          }
        }
        const registerSubTreeCallback = /* @__PURE__ */ __name(() => {
          for (const [nextSegment, nextNode] of subtree.entries()) {
            this.#walkTreeAndRegister(
              nextSegment,
              nextNode,
              `${fullCommand} ${nextSegment}`
            );
          }
        }, "registerSubTreeCallback");
        this.#registerCommand(segment, def, registerSubTreeCallback);
      }
    };
    CommandRegistrationError = class extends Error {
      static {
        __name(this, "CommandRegistrationError");
      }
    };
    __name(constructStatusMessage, "constructStatusMessage");
  }
});

// ../../node_modules/.pnpm/semiver@1.1.0/node_modules/semiver/dist/semiver.mjs
function semiver_default(a7, b11, bool) {
  a7 = a7.split(".");
  b11 = b11.split(".");
  return fn(a7[0], b11[0]) || fn(a7[1], b11[1]) || (b11[2] = b11.slice(2).join("."), bool = /[.-]/.test(a7[2] = a7.slice(2).join(".")), bool == /[.-]/.test(b11[2]) ? fn(a7[2], b11[2]) : bool ? -1 : 1);
}
var fn;
var init_semiver = __esm({
  "../../node_modules/.pnpm/semiver@1.1.0/node_modules/semiver/dist/semiver.mjs"() {
    init_import_meta_url();
    fn = new Intl.Collator(0, { numeric: 1 }).compare;
    __name(semiver_default, "default");
  }
});

// ../../node_modules/.pnpm/supports-color@9.2.2/node_modules/supports-color/index.js
var supports_color_exports = {};
__export(supports_color_exports, {
  createSupportsColor: () => createSupportsColor2,
  default: () => supports_color_default2
});
function hasFlag2(flag, argv = process7__default.default.argv) {
  const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
  const position = argv.indexOf(prefix + flag);
  const terminatorPosition = argv.indexOf("--");
  return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
}
function envForceColor2() {
  if ("FORCE_COLOR" in env4) {
    if (env4.FORCE_COLOR === "true") {
      return 1;
    }
    if (env4.FORCE_COLOR === "false") {
      return 0;
    }
    return env4.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env4.FORCE_COLOR, 10), 3);
  }
}
function translateLevel2(level) {
  if (level === 0) {
    return false;
  }
  return {
    level,
    hasBasic: true,
    has256: level >= 2,
    has16m: level >= 3
  };
}
function _supportsColor2(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
  const noFlagForceColor = envForceColor2();
  if (noFlagForceColor !== void 0) {
    flagForceColor2 = noFlagForceColor;
  }
  const forceColor = sniffFlags ? flagForceColor2 : noFlagForceColor;
  if (forceColor === 0) {
    return 0;
  }
  if (sniffFlags) {
    if (hasFlag2("color=16m") || hasFlag2("color=full") || hasFlag2("color=truecolor")) {
      return 3;
    }
    if (hasFlag2("color=256")) {
      return 2;
    }
  }
  if (haveStream && !streamIsTTY && forceColor === void 0) {
    return 0;
  }
  const min = forceColor || 0;
  if (env4.TERM === "dumb") {
    return min;
  }
  if (process7__default.default.platform === "win32") {
    const osRelease = os11__namespace.default.release().split(".");
    if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
      return Number(osRelease[2]) >= 14931 ? 3 : 2;
    }
    return 1;
  }
  if ("CI" in env4) {
    if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE", "DRONE"].some((sign) => sign in env4) || env4.CI_NAME === "codeship") {
      return 1;
    }
    return min;
  }
  if ("TEAMCITY_VERSION" in env4) {
    return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env4.TEAMCITY_VERSION) ? 1 : 0;
  }
  if ("TF_BUILD" in env4 && "AGENT_NAME" in env4) {
    return 1;
  }
  if (env4.COLORTERM === "truecolor") {
    return 3;
  }
  if ("TERM_PROGRAM" in env4) {
    const version5 = Number.parseInt((env4.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
    switch (env4.TERM_PROGRAM) {
      case "iTerm.app":
        return version5 >= 3 ? 3 : 2;
      case "Apple_Terminal":
        return 2;
    }
  }
  if (/-256(color)?$/i.test(env4.TERM)) {
    return 2;
  }
  if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env4.TERM)) {
    return 1;
  }
  if ("COLORTERM" in env4) {
    return 1;
  }
  return min;
}
function createSupportsColor2(stream2, options = {}) {
  const level = _supportsColor2(stream2, {
    streamIsTTY: stream2 && stream2.isTTY,
    ...options
  });
  return translateLevel2(level);
}
var env4, flagForceColor2, supportsColor2, supports_color_default2;
var init_supports_color2 = __esm({
  "../../node_modules/.pnpm/supports-color@9.2.2/node_modules/supports-color/index.js"() {
    init_import_meta_url();
    __name(hasFlag2, "hasFlag");
    ({ env: env4 } = process7__default.default);
    if (hasFlag2("no-color") || hasFlag2("no-colors") || hasFlag2("color=false") || hasFlag2("color=never")) {
      flagForceColor2 = 0;
    } else if (hasFlag2("color") || hasFlag2("colors") || hasFlag2("color=true") || hasFlag2("color=always")) {
      flagForceColor2 = 1;
    }
    __name(envForceColor2, "envForceColor");
    __name(translateLevel2, "translateLevel");
    __name(_supportsColor2, "_supportsColor");
    __name(createSupportsColor2, "createSupportsColor");
    supportsColor2 = {
      stdout: createSupportsColor2({ isTTY: tty__default.default.isatty(1) }),
      stderr: createSupportsColor2({ isTTY: tty__default.default.isatty(2) })
    };
    supports_color_default2 = supportsColor2;
  }
});
async function printWranglerBanner(performUpdateCheck = true) {
  if (getWranglerHideBanner()) {
    return;
  }
  let text = typeof WRANGLER_PRERELEASE_LABEL === "undefined" ? ` \u26C5\uFE0F wrangler ${version}` : ` \u26C5\uFE0F wrangler ${version} (${source_default.blue(WRANGLER_PRERELEASE_LABEL)})`;
  let maybeNewVersion;
  if (performUpdateCheck) {
    maybeNewVersion = await updateCheck();
    if (maybeNewVersion !== void 0) {
      text += ` (update available ${source_default.green(maybeNewVersion)})`;
    }
  }
  logger.log(
    "\n" + text + "\n" + (supports_color_default2.stdout ? source_default.hex("#FF8800")(
      "\u2500".repeat(util4.stripVTControlCharacters(text).length)
    ) : "\u2500".repeat(text.length))
  );
  if (semiver_default(process.versions.node, MIN_NODE_VERSION) < 0) {
    logger.warn(
      `Wrangler requires at least Node.js v${MIN_NODE_VERSION}. You are using v${process.versions.node}. Please update your version of Node.js.`
    );
  }
  if (maybeNewVersion !== void 0) {
    const currentMajor = parseInt(version.split(".")[0]);
    const newMajor = parseInt(maybeNewVersion.split(".")[0]);
    if (newMajor > currentMajor) {
      logger.warn(
        `The version of Wrangler you are using is now out-of-date.
Please update to the latest version to prevent critical errors.
Run \`npm install --save-dev wrangler@${newMajor}\` to update to the latest version.
After installation, run Wrangler with \`npx wrangler\`.`
      );
    }
  }
}
var MIN_NODE_VERSION;
var init_wrangler_banner = __esm({
  "src/wrangler-banner.ts"() {
    init_import_meta_url();
    init_dist();
    init_source();
    init_semiver();
    init_supports_color2();
    init_package();
    init_logger();
    init_update_check();
    MIN_NODE_VERSION = "20.0.0";
    __name(printWranglerBanner, "printWranglerBanner");
  }
});

// src/cloudchamber/helpers/wrap.ts
async function wrap2(fn2) {
  return fn2.then((data) => [data, null]).catch((err) => [null, err]);
}
var init_wrap = __esm({
  "src/cloudchamber/helpers/wrap.ts"() {
    init_import_meta_url();
    __name(wrap2, "wrap");
  }
});

// src/cloudchamber/locations.ts
async function loadAccount() {
  if (cachedAccount !== void 0) {
    return cachedAccount;
  }
  const account = await AccountService.getMe();
  cachedAccount = account;
  return cachedAccount;
}
async function getLocations() {
  return (await loadAccount()).locations;
}
function idToLocationName(locationId) {
  if (!cachedAccount) {
    throw new Error("Needs a call to loadAccount beforehand");
  }
  const locations = cachedAccount.locations;
  for (const location of locations) {
    if (location.location === locationId) {
      return location.name;
    }
  }
  return `Other (${locationId})`;
}
var cachedAccount;
var init_locations7 = __esm({
  "src/cloudchamber/locations.ts"() {
    init_import_meta_url();
    init_containers_shared();
    __name(loadAccount, "loadAccount");
    __name(getLocations, "getLocations");
    __name(idToLocationName, "idToLocationName");
  }
});

// src/cloudchamber/common.ts
function parseImageName(value) {
  const matches = value.match(imageRe);
  if (matches === null) {
    return {
      err: "Invalid image format: expected NAME:TAG[@DIGEST] or NAME@DIGEST"
    };
  }
  const name2 = matches[1];
  const tag = matches[2];
  const digest = matches[3] ?? matches[4];
  if (tag === "latest") {
    return { err: '"latest" tag is not allowed' };
  }
  return { name: name2, tag, digest };
}
async function getAPIUrl(config, accountId, scope) {
  const api = getCloudflareApiBaseUrl(config);
  const endpoint = scope === cloudchamberScope ? "cloudchamber" : "containers";
  return `${api}/accounts/${accountId}/${endpoint}`;
}
async function promiseSpinner(promise, {
  message
} = {
  message: "Loading"
}) {
  if (isNonInteractiveOrCI()) {
    return promise;
  }
  const { start, stop } = spinner();
  start(message);
  const t13 = await promise.catch((err) => {
    stop();
    throw err;
  });
  stop();
  return t13;
}
async function fillOpenAPIConfiguration(config, scope) {
  const headers = new Headers();
  const accountId = await requireAuth(config);
  const auth = requireApiToken();
  const scopes = getScopes();
  if (scopes !== void 0 && !scopes.includes(scope)) {
    logger.error(`You don't have '${scope}' in your list of scopes`);
    printScopes(scopes ?? []);
    throw new UserError(
      `You need '${scope}', try logging in again or creating an appropiate API token`
    );
  }
  addAuthorizationHeader(headers, auth);
  addUserAgent(headers);
  OpenAPI.CREDENTIALS = "omit";
  if (OpenAPI.BASE.length === 0) {
    const [base, errApiURL] = await wrap2(getAPIUrl(config, accountId, scope));
    if (errApiURL) {
      throw new UserError("getting the API url: " + errApiURL.message);
    }
    OpenAPI.BASE = base;
  }
  OpenAPI.HEADERS = {
    ...OpenAPI.HEADERS ?? {},
    ...Object.fromEntries(headers.entries())
  };
  OpenAPI.LOGGER = logger;
}
function checkEverythingIsSet(object, keys) {
  keys.forEach((key) => {
    if (object[key] === void 0) {
      throw new Error(
        `${key} is required but it's not passed as an argument`
      );
    }
  });
  return object;
}
function renderDeploymentConfiguration(action, {
  image,
  location,
  instanceType,
  vcpu,
  memoryMib,
  environmentVariables,
  labels,
  env: env6,
  network
}) {
  let environmentVariablesText = "[]";
  if (environmentVariables !== void 0) {
    if (environmentVariables.length !== 0) {
      environmentVariablesText = "\n" + environmentVariables.map((ev) => "- " + dim(ev.name + ":" + ev.value)).join("\n").trim();
    }
  } else if (action === "create") {
    environmentVariablesText = `
No environment variables added! You can set some under [${env6 ? "env." + env6 + "." : ""}vars] and via command line`;
  }
  let labelsText = "[]";
  if (labels !== void 0 && labels.length !== 0) {
    labelsText = "\n" + labels.map((ev) => "- " + dim(ev.name + ":" + ev.value)).join("\n").trim();
  }
  const containerInformation = [
    ["image", image],
    ["location", idToLocationName(location)],
    ["environment variables", environmentVariablesText],
    ["labels", labelsText],
    ...network === void 0 ? [] : [["IPv4", network.assign_ipv4 === "predefined" ? "yes" : "no"]],
    ...instanceType === void 0 ? [
      ["vCPU", `${vcpu}`],
      ["memory", `${memoryMib} MiB`]
    ] : [["instance type", `${instanceType}`]]
  ];
  updateStatus(
    `You're about to ${action} a container with the following configuration
` + containerInformation.map(([key, text]) => `${brandColor(key)} ${dim(text)}`).join("\n")
  );
}
function renderDeploymentMutationError(account, err) {
  if (!(err instanceof ApiError)) {
    throw new UserError(err.message);
  }
  if (typeof err.body === "string") {
    throw new UserError("There has been an internal error, please try again!");
  }
  if (!("error" in err.body)) {
    throw new UserError(err.message);
  }
  const errorMessage = err.body.error;
  if (!(errorMessage in DeploymentMutationError)) {
    throw new UserError(err.message);
  }
  const details = err.body.details ?? {};
  function renderAccountLimits() {
    return [
      `${space(2)}${brandColor("Maximum VCPU per deployment")} ${account.limits.vcpu_per_deployment}`,
      `${space(2)}${brandColor("Maximum total VCPU in your account")} ${account.limits.total_vcpu}`,
      `${space(2)}${brandColor("Maximum memory per deployment")} ${account.limits.memory_mib_per_deployment} MiB`,
      `${space(2)}${brandColor("Maximum total memory in your account")} ${account.limits.total_memory_mib} MiB`
    ].join("\n");
  }
  __name(renderAccountLimits, "renderAccountLimits");
  function renderInvalidInputDetails(inputDetails) {
    return `${Object.keys(inputDetails).map((key) => `${space(2)}- ${key}: ${inputDetails[key]}`).join("\n")}`;
  }
  __name(renderInvalidInputDetails, "renderInvalidInputDetails");
  const errorEnum = errorMessage;
  const errorEnumToErrorMessage = {
    ["LOCATION_NOT_ALLOWED" /* LOCATION_NOT_ALLOWED */]: () => "The location you have chosen is not allowed, try with another one",
    ["LOCATION_SURPASSED_BASE_LIMITS" /* LOCATION_SURPASSED_BASE_LIMITS */]: () => "The location you have chosen doesn't allow that deployment configuration due to its limits",
    ["SURPASSED_BASE_LIMITS" /* SURPASSED_BASE_LIMITS */]: () => "You deployment surpasses the base limits of your account\n" + renderAccountLimits(),
    ["VALIDATE_INPUT" /* VALIDATE_INPUT */]: () => "Your deployment configuration has invalid inputs\n" + renderInvalidInputDetails(err.body.details),
    ["SURPASSED_TOTAL_LIMITS" /* SURPASSED_TOTAL_LIMITS */]: () => "You have surpassed the limits of your account\n" + renderAccountLimits(),
    ["IMAGE_REGISTRY_NOT_CONFIGURED" /* IMAGE_REGISTRY_NOT_CONFIGURED */]: () => "The image registry you are trying to use is not configured. Use the 'wrangler cloudchamber registries configure' command to configure the registry.\n"
  };
  throw new UserError(
    details["reason"] ?? errorEnumToErrorMessage[errorEnum]()
  );
}
function sortEnvironmentVariables(environmentVariables) {
  environmentVariables.sort((a7, b11) => a7.name.localeCompare(b11.name));
}
function collectEnvironmentVariables(deploymentEnv, config, envArgs) {
  const envMap = /* @__PURE__ */ new Map();
  if (deploymentEnv !== void 0) {
    deploymentEnv.forEach((ev) => envMap.set(ev.name, ev.value));
  }
  Object.entries(config.vars).forEach(
    ([name2, value]) => envMap.set(name2, value?.toString() ?? "")
  );
  if (envArgs !== void 0) {
    envArgs.forEach((v8) => {
      const [name2, ...value] = v8.split(":");
      envMap.set(name2, value.join(":"));
    });
  }
  if (envMap.size === 0) {
    return void 0;
  }
  const env6 = Array.from(envMap).map(
    ([name2, value]) => ({ name: name2, value })
  );
  sortEnvironmentVariables(env6);
  return env6;
}
async function promptForEnvironmentVariables(environmentVariables, initiallySelected, allowSkipping) {
  if (environmentVariables === void 0 || environmentVariables.length == 0) {
    return void 0;
  }
  let options = [
    { label: "Use all of them", value: "all" },
    { label: "Use some", value: "select" },
    { label: "Do not use any", value: "none" }
  ];
  if (allowSkipping) {
    options = [{ label: "Do not modify", value: "skip" }].concat(options);
  }
  const action = await inputPrompt({
    question: "You have environment variables defined, what do you want to do for this deployment?",
    label: "",
    defaultValue: false,
    helpText: "",
    type: "select",
    options
  });
  if (action === "skip") {
    return void 0;
  }
  if (action === "all") {
    return environmentVariables;
  }
  if (action === "select") {
    const selectedNames = await inputPrompt({
      question: "Select the environment variables you want to use",
      label: "",
      defaultValue: initiallySelected,
      helpText: "Use the 'space' key to select. Submit with 'enter'",
      type: "multiselect",
      options: environmentVariables.map((ev) => ({
        label: ev.name,
        value: ev.name
      })),
      validate: /* @__PURE__ */ __name((values) => {
        if (!Array.isArray(values)) {
          return "unknown error";
        }
      }, "validate")
    });
    const selectedNamesSet = new Set(selectedNames);
    const selectedEnvironmentVariables = [];
    for (const ev of environmentVariables) {
      if (selectedNamesSet.has(ev.name)) {
        selectedEnvironmentVariables.push(ev);
      }
    }
    return selectedEnvironmentVariables;
  }
  return [];
}
function sortLabels(labels) {
  labels.sort((a7, b11) => a7.name.localeCompare(b11.name));
}
function collectLabels(labelArgs) {
  const labelMap = /* @__PURE__ */ new Map();
  if (labelArgs !== void 0) {
    labelArgs.forEach((v8) => {
      const [name2, ...value] = v8.split(":");
      labelMap.set(name2, value.join(":"));
    });
  }
  if (labelMap.size === 0) {
    return void 0;
  }
  const labels = Array.from(labelMap).map(([name2, value]) => ({
    name: name2,
    value
  }));
  sortLabels(labels);
  return labels;
}
async function promptForLabels(labels, initiallySelected, allowSkipping) {
  if (labels === void 0 || labels.length == 0) {
    return void 0;
  }
  let options = [
    { label: "Use all of them", value: "all" },
    { label: "Use some", value: "select" },
    { label: "Do not use any", value: "none" }
  ];
  if (allowSkipping) {
    options = [{ label: "Do not modify", value: "skip" }].concat(options);
  }
  const action = await inputPrompt({
    question: "You have labels defined, what do you want to do for this deployment?",
    label: "",
    defaultValue: false,
    helpText: "",
    type: "select",
    options
  });
  if (action === "skip") {
    return void 0;
  }
  if (action === "all") {
    return labels;
  }
  if (action === "select") {
    const selectedNames = await inputPrompt({
      question: "Select the labels you want to use",
      label: "",
      defaultValue: initiallySelected,
      helpText: "Use the 'space' key to select. Submit with 'enter'",
      type: "multiselect",
      options: labels.map((label) => ({
        label: label.name,
        value: label.name
      })),
      validate: /* @__PURE__ */ __name((values) => {
        if (!Array.isArray(values)) {
          return "unknown error";
        }
      }, "validate")
    });
    const selectedNamesSet = new Set(selectedNames);
    const selectedLabels = [];
    for (const ev of labels) {
      if (selectedNamesSet.has(ev.name)) {
        selectedLabels.push(ev);
      }
    }
    return selectedLabels;
  }
  return [];
}
function resolveMemory(args, config) {
  const MiB2 = 1024 * 1024;
  const memory = args.memory ?? config.memory;
  if (memory !== void 0) {
    return Math.round(parseByteSize(memory, 1024) / MiB2);
  }
  return void 0;
}
var cloudchamberScope, imageRe;
var init_common = __esm({
  "src/cloudchamber/common.ts"() {
    init_import_meta_url();
    init_cli();
    init_colors();
    init_interactive();
    init_containers_shared();
    init_dist();
    init_internal();
    init_config();
    init_CommandRegistry();
    init_is_interactive();
    init_logger();
    init_user3();
    init_wrangler_banner();
    init_wrap();
    init_locations7();
    cloudchamberScope = "cloudchamber:write";
    imageRe = (() => {
      const alphaNumeric = "[a-z0-9]+";
      const separator = "(?:\\.|_|__|-+)";
      const port = ":[0-9]+";
      const domain2 = `${alphaNumeric}(?:${separator}${alphaNumeric})*`;
      const name2 = `(?:${domain2}(?:${port})?/)?(?:${domain2}/)*(?:${domain2})`;
      const tag = ":([a-zA-Z0-9_][a-zA-Z0-9._-]{0,127})";
      const digest = "@(sha256:[A-Fa-f0-9]+)";
      const reference = `(?:${tag}(?:${digest})?|${digest})`;
      return new RegExp(`^(${name2})${reference}$`);
    })();
    __name(parseImageName, "parseImageName");
    __name(getAPIUrl, "getAPIUrl");
    __name(promiseSpinner, "promiseSpinner");
    __name(fillOpenAPIConfiguration, "fillOpenAPIConfiguration");
    __name(checkEverythingIsSet, "checkEverythingIsSet");
    __name(renderDeploymentConfiguration, "renderDeploymentConfiguration");
    __name(renderDeploymentMutationError, "renderDeploymentMutationError");
    __name(sortEnvironmentVariables, "sortEnvironmentVariables");
    __name(collectEnvironmentVariables, "collectEnvironmentVariables");
    __name(promptForEnvironmentVariables, "promptForEnvironmentVariables");
    __name(sortLabels, "sortLabels");
    __name(collectLabels, "collectLabels");
    __name(promptForLabels, "promptForLabels");
    __name(resolveMemory, "resolveMemory");
  }
});

// src/cloudchamber/instance-type/instance-type.ts
async function promptForInstanceType(allowSkipping) {
  let options = [
    { label: "lite: 1/16 vCPU, 256 MiB memory, 2 GB disk", value: "lite" },
    { label: "basic: 1/4 vCPU, 1 GiB memory, 4 GB disk", value: "basic" },
    {
      label: "standard-1: 1/2 vCPU, 4 GiB memory, 8 GB disk",
      value: "standard-1"
    },
    {
      label: "standard-2: 1/2 vCPU, 4 GiB memory, 12 GB disk",
      value: "standard-2"
    },
    {
      label: "standard-3: 1/2 vCPU, 4 GiB memory, 16 GB disk",
      value: "standard-3"
    },
    {
      label: "standard-4: 4 vCPU, 4 GiB memory, 20 GB disk",
      value: "standard-4"
    }
  ];
  if (allowSkipping) {
    options = [{ label: "Do not set", value: "skip" }].concat(options);
  }
  const action = await inputPrompt({
    question: "Which instance type should we use for your container?",
    label: "",
    defaultValue: false,
    helpText: "",
    type: "select",
    options
  });
  if (instanceTypeNames.includes(action)) {
    return action;
  }
  return void 0;
}
function checkInstanceType(args, config) {
  const instance_type = args.instanceType ?? config.instance_type;
  if (instance_type === void 0) {
    return;
  }
  if (args.memory !== void 0 || args.vcpu !== void 0) {
    throw new UserError(
      `Field "instance_type" is mutually exclusive with "memory" and "vcpu". These fields cannot be set together.`
    );
  }
  if (instanceTypeNames.includes(instance_type)) {
    return instance_type;
  } else {
    throw new UserError(
      `"instance_type" field value is expected to be one of 'lite', 'basic', 'standard-1', 'standard-2', 'standard-3', 'standard-4', but got "${instance_type}"`
    );
  }
}
function getInstanceTypeUsage(instanceType) {
  return instanceTypes[instanceType];
}
function inferInstanceType(config) {
  for (const [instanceType, configuration] of Object.entries(instanceTypes)) {
    if (config.vcpu === configuration.vcpu && config.memory_mib === configuration.memory_mib && config.disk?.size_mb === configuration.disk_mb) {
      return instanceType;
    }
  }
}
function cleanForInstanceType(app) {
  if (!("configuration" in app)) {
    return app;
  }
  const instance_type = inferInstanceType(app.configuration);
  if (instance_type !== void 0) {
    app.configuration.instance_type = instance_type;
  }
  delete app.configuration.disk;
  delete app.configuration.memory;
  delete app.configuration.memory_mib;
  delete app.configuration.vcpu;
  return app;
}
var instanceTypes, instanceTypeNames;
var init_instance_type = __esm({
  "src/cloudchamber/instance-type/instance-type.ts"() {
    init_import_meta_url();
    init_interactive();
    init_dist();
    instanceTypes = {
      // lite is the default instance type when REQUIRE_INSTANCE_TYPE is set
      lite: {
        vcpu: 0.0625,
        memory_mib: 256,
        disk_mb: 2e3
      },
      dev: {
        vcpu: 0.0625,
        memory_mib: 256,
        disk_mb: 2e3
      },
      basic: {
        vcpu: 0.25,
        memory_mib: 1024,
        disk_mb: 4e3
      },
      standard: {
        vcpu: 0.5,
        memory_mib: 4096,
        disk_mb: 8e3
      },
      "standard-1": {
        vcpu: 0.5,
        memory_mib: 4096,
        disk_mb: 8e3
      },
      "standard-2": {
        vcpu: 1,
        memory_mib: 6144,
        disk_mb: 12e3
      },
      "standard-3": {
        vcpu: 2,
        memory_mib: 8192,
        disk_mb: 16e3
      },
      "standard-4": {
        vcpu: 4,
        memory_mib: 12288,
        disk_mb: 2e4
      }
    };
    instanceTypeNames = Object.keys(instanceTypes);
    __name(promptForInstanceType, "promptForInstanceType");
    __name(checkInstanceType, "checkInstanceType");
    __name(getInstanceTypeUsage, "getInstanceTypeUsage");
    __name(inferInstanceType, "inferInstanceType");
    __name(cleanForInstanceType, "cleanForInstanceType");
  }
});

// src/cloudchamber/limits.ts
function configToUsage(containerConfig) {
  if ("instance_type" in containerConfig) {
    return getInstanceTypeUsage(containerConfig.instance_type);
  }
  return {
    vcpu: containerConfig.vcpu,
    memory_mib: containerConfig.memory_mib,
    disk_mb: containerConfig.disk_bytes / MB
  };
}
function accountToLimits(account) {
  return {
    vcpu: account.limits.vcpu_per_deployment,
    memory_mib: account.limits.memory_mib_per_deployment,
    disk_mb: account.limits.disk_mb_per_deployment
  };
}
async function ensureContainerLimits(options) {
  const limits = accountToLimits(options.account);
  if (!options.containerConfig) {
    await ensureImageFitsLimits({
      availableSizeInBytes: limits.disk_mb * MB,
      pathToDocker: options.pathToDocker,
      imageTag: options.imageTag
    });
    return;
  }
  const usage2 = configToUsage(options.containerConfig);
  const errors = [];
  if (usage2.vcpu > limits.vcpu) {
    errors.push(
      `Your container configuration uses ${usage2.vcpu} vCPU which exceeds the account limit of ${limits.vcpu} vCPU.`
    );
  }
  if (usage2.memory_mib > limits.memory_mib) {
    errors.push(
      `Your container configuration uses ${usage2.memory_mib} MiB of memory which exceeds the account limit of ${limits.memory_mib} MiB.`
    );
  }
  if (usage2.disk_mb > limits.disk_mb) {
    errors.push(
      `Your container configuration uses ${usage2.disk_mb} MB of disk which exceeds the account limit of ${limits.disk_mb} MB.`
    );
  }
  if (errors.length > 0) {
    throw new UserError(`Exceeded account limits: ${errors.join(" ")}`);
  }
  await ensureImageFitsLimits({
    availableSizeInBytes: usage2.disk_mb * MB,
    pathToDocker: options.pathToDocker,
    imageTag: options.imageTag
  });
}
async function ensureImageFitsLimits(options) {
  const inspectOutput = await dockerImageInspect(options.pathToDocker, {
    imageTag: options.imageTag,
    formatString: "{{ .Size }} {{ len .RootFS.Layers }}"
  });
  const [sizeStr, layerStr] = inspectOutput.split(" ");
  const size = parseInt(sizeStr, 10);
  const layers = parseInt(layerStr, 10);
  const requiredSizeInBytes = Math.ceil(size * 1.1 + layers * 16 * MiB);
  logger.debug(
    `Disk size limits when building container image: availableSize=${Math.ceil(options.availableSizeInBytes / MB)}MB, requiredSize=${Math.ceil(requiredSizeInBytes / MB)}MB`
  );
  if (options.availableSizeInBytes < requiredSizeInBytes) {
    throw new UserError(
      `Image too large: needs ${Math.ceil(requiredSizeInBytes / MB)}MB, but your app is limited to images with size ${options.availableSizeInBytes / MB}MB. Your need more disk for this image.`
    );
  }
}
var MB, MiB;
var init_limits2 = __esm({
  "src/cloudchamber/limits.ts"() {
    init_import_meta_url();
    init_containers_shared();
    init_dist();
    init_logger();
    init_instance_type();
    MB = 1e3 * 1e3;
    MiB = 1024 * 1024;
    __name(configToUsage, "configToUsage");
    __name(accountToLimits, "accountToLimits");
    __name(ensureContainerLimits, "ensureContainerLimits");
    __name(ensureImageFitsLimits, "ensureImageFitsLimits");
  }
});
async function buildAndMaybePush(args, pathToDocker, push2, containerConfig) {
  try {
    const imageTag = args.tag;
    const { buildCmd, dockerfile } = await constructBuildCommand(
      {
        tag: imageTag,
        pathToDockerfile: args.pathToDockerfile,
        buildContext: args.buildContext,
        args: args.args,
        platform: args.platform,
        setNetworkToHost: Boolean(getCIOverrideNetworkModeHost())
      },
      logger
    );
    await dockerBuild(pathToDocker, {
      buildCmd,
      dockerfile
    }).ready;
    if (push2) {
      const imageInfo = await dockerImageInspect(pathToDocker, {
        imageTag,
        formatString: "{{ json .RepoDigests }}"
      });
      logger.debug(`'docker image inspect ${imageTag}':`, imageInfo);
      const account = await loadAccount();
      await ensureContainerLimits({
        pathToDocker,
        imageTag,
        account,
        containerConfig
      });
      await dockerLoginImageRegistry(
        pathToDocker,
        // Won't be an external registry since this is building from a Dockerfile
        // rather than specifying an image uri.
        getCloudflareContainerRegistry()
      );
      try {
        const [digests] = imageInfo.split(" ");
        const parsedDigests = JSON.parse(digests);
        if (!Array.isArray(parsedDigests)) {
          throw new Error(
            `Expected RepoDigests from docker inspect to be an array but got ${JSON.stringify(parsedDigests)}`
          );
        }
        const imageUrl = new URL(
          `http://${resolveImageName(account.external_account_id, imageTag)}`
        );
        const repositoryOnly = `${imageUrl.host}${imageUrl.pathname.split(":")[0]}`;
        logger.debug("respositoryOnly:", repositoryOnly);
        const digest = parsedDigests.find((d8) => {
          const resolved = resolveImageName(account.external_account_id, d8);
          logger.debug(
            `Comparing ${resolved.split("@")[0]} to ${repositoryOnly}`
          );
          return typeof d8 === "string" && resolved.split("@")[0] === repositoryOnly;
        });
        if (!digest) {
          throw new Error(
            `Could not find a digest for the image ${repositoryOnly}. Found digests: ${parsedDigests.join(", ")}`
          );
        }
        const [image, hash] = digest.split("@");
        const resolvedImage = resolveImageName(
          account.external_account_id,
          image
        );
        const remoteDigest = `${resolvedImage}@${hash}`;
        logger.debug(
          `'docker manifest inspect -v ${resolveImageName(account.external_account_id, remoteDigest)}:`
        );
        const remoteManifest = runDockerCmdWithOutput(pathToDocker, [
          "manifest",
          "inspect",
          "-v",
          resolveImageName(account.external_account_id, remoteDigest)
        ]);
        const parsedRemoteManifest = JSON.parse(remoteManifest);
        if (parsedRemoteManifest.Descriptor.digest === hash) {
          logger.log("Image already exists remotely, skipping push");
          logger.debug(
            `Untagging built image: ${args.tag} since there was no change.`
          );
          await runDockerCmd(pathToDocker, ["image", "rm", imageTag]);
          return { remoteDigest };
        }
      } catch (error2) {
        if (error2 instanceof Error) {
          logger.debug(
            `Checking for local image ${args.tag} failed with error: ${error2.message}`
          );
        }
      }
      const namespacedImageTag = resolveImageName(
        account.external_account_id,
        args.tag
      );
      logger.log(
        `Image does not exist remotely, pushing: ${namespacedImageTag}`
      );
      await runDockerCmd(pathToDocker, ["tag", imageTag, namespacedImageTag]);
      await runDockerCmd(pathToDocker, ["push", namespacedImageTag]);
    }
    return { newTag: imageTag };
  } catch (error2) {
    if (error2 instanceof Error) {
      throw new UserError(error2.message, { cause: error2 });
    }
    throw new UserError("An unknown error occurred");
  }
}
async function buildCommand(args) {
  if (fs29.existsSync(args.PATH) && !isDirectory(args.PATH)) {
    throw new UserError(
      `${args.PATH} is not a directory. Please specify a valid directory path.`
    );
  }
  if (args.platform !== "linux/amd64") {
    throw new UserError(
      `Unsupported platform: Platform "${args.platform}" is unsupported. Please use "linux/amd64" instead.`
    );
  }
  const pathToDockerfile = path3.join(args.PATH, "Dockerfile");
  await buildAndMaybePush(
    {
      tag: args.tag,
      pathToDockerfile,
      buildContext: args.PATH,
      platform: args.platform
      // no option to add env vars at build time...?
    },
    getDockerPath() ?? args.pathToDocker,
    args.push,
    // this means we aren't validating defined limits for a container when building an image
    // we will, however, still validate the image size against account level disk limits
    void 0
  );
}
async function pushCommand(args, config) {
  try {
    await dockerLoginImageRegistry(
      args.pathToDocker,
      getCloudflareContainerRegistry()
    );
    const accountId = await getAccountId(config);
    const newTag = resolveImageName(accountId, args.TAG);
    const dockerPath = args.pathToDocker ?? getDockerPath();
    await checkImagePlatform(dockerPath, args.TAG);
    await runDockerCmd(dockerPath, ["tag", args.TAG, newTag]);
    await runDockerCmd(dockerPath, ["push", newTag]);
    logger.log(`Pushed image: ${newTag}`);
  } catch (error2) {
    if (error2 instanceof Error) {
      throw new UserError(error2.message);
    }
    throw new UserError("An unknown error occurred");
  }
}
async function checkImagePlatform(pathToDocker, imageTag, expectedPlatform = "linux/amd64") {
  const platform4 = await dockerImageInspect(pathToDocker, {
    imageTag,
    formatString: "{{ .Os }}/{{ .Architecture }}"
  });
  if (platform4 !== expectedPlatform) {
    throw new Error(
      `Unsupported platform: Image platform (${platform4}) does not match the expected platform (${expectedPlatform})`
    );
  }
}
var cloudchamberBuildCommand, cloudchamberPushCommand;
var init_build2 = __esm({
  "src/cloudchamber/build.ts"() {
    init_import_meta_url();
    init_containers_shared();
    init_dist();
    init_create_command();
    init_logger();
    init_user3();
    init_common();
    init_limits2();
    init_locations7();
    __name(buildAndMaybePush, "buildAndMaybePush");
    __name(buildCommand, "buildCommand");
    __name(pushCommand, "pushCommand");
    __name(checkImagePlatform, "checkImagePlatform");
    cloudchamberBuildCommand = createCommand({
      metadata: {
        description: "Build a container image",
        status: "alpha",
        owner: "Product: Cloudchamber",
        hidden: false
      },
      args: {
        PATH: {
          type: "string",
          describe: "Path for the directory containing the Dockerfile to build",
          demandOption: true
        },
        tag: {
          alias: "t",
          type: "string",
          demandOption: true,
          describe: 'Name and optionally a tag (format: "name:tag")'
        },
        "path-to-docker": {
          type: "string",
          default: "docker",
          describe: "Path to your docker binary if it's not on $PATH",
          demandOption: false
        },
        push: {
          alias: "p",
          type: "boolean",
          describe: "Push the built image to Cloudflare's managed registry",
          default: false
        },
        platform: {
          type: "string",
          default: "linux/amd64",
          describe: "Platform to build for. Defaults to the architecture support by Workers (linux/amd64)",
          demandOption: false,
          hidden: true,
          deprecated: true
        }
      },
      positionalArgs: ["PATH"],
      async handler(args, { config }) {
        await fillOpenAPIConfiguration(config, cloudchamberScope);
        await buildCommand(args);
      }
    });
    cloudchamberPushCommand = createCommand({
      metadata: {
        description: "Push a local image to the Cloudflare managed registry",
        status: "alpha",
        owner: "Product: Cloudchamber",
        hidden: false
      },
      args: {
        TAG: {
          type: "string",
          demandOption: true,
          describe: "The tag of the local image to push"
        },
        "path-to-docker": {
          type: "string",
          default: "docker",
          describe: "Path to your docker binary if it's not on $PATH",
          demandOption: false
        }
      },
      positionalArgs: ["TAG"],
      async handler(args, { config }) {
        await fillOpenAPIConfiguration(config, cloudchamberScope);
        await pushCommand(args, config);
      }
    });
  }
});
function onKeyPress(callback, options) {
  const stream2 = new Stream.PassThrough();
  process.stdin.pipe(stream2);
  let rl;
  if (isInteractive3()) {
    rl = S__default.default.createInterface({
      input: stream2,
      ...options
    });
    S__default.default.emitKeypressEvents(stream2, rl);
    process.stdin.setRawMode(true);
  }
  const handler = /* @__PURE__ */ __name(async (_char, key) => {
    if (key) {
      callback(key);
    }
  }, "handler");
  stream2.on("keypress", handler);
  return () => {
    if (isInteractive3()) {
      process.stdin.setRawMode(false);
    }
    rl?.close();
    stream2.off("keypress", handler);
    stream2.destroy();
  };
}
var init_onKeyPress = __esm({
  "src/utils/onKeyPress.ts"() {
    init_import_meta_url();
    init_is_interactive();
    __name(onKeyPress, "onKeyPress");
  }
});

// src/containers/list.ts
function deriveContainerState(app) {
  const h7 = app.health.instances;
  if (h7.failed > 0) {
    return "degraded";
  }
  if (h7.starting > 0 || h7.scheduling > 0) {
    return "provisioning";
  }
  if (h7.active > 0) {
    return "active";
  }
  return "ready";
}
function colorState(state2) {
  switch (state2) {
    case "active":
      return green(state2);
    case "degraded":
      return red(state2);
    default:
      return state2;
  }
}
async function fetchContainerPage(perPage, pageToken) {
  try {
    const page = await ApplicationsService.listDashApplications(
      perPage,
      pageToken
    );
    return {
      data: page.data,
      nextPageToken: page.resultInfo?.next_page_token
    };
  } catch (err) {
    if (!(err instanceof Error)) {
      throw err;
    }
    if (err instanceof ApiError) {
      if (err.status === 400 || err.status === 404) {
        throw new UserError(
          `There has been an error listing containers.
${err.body.error}`
        );
      }
      throw new Error(
        `There has been an unknown error listing containers.
${JSON.stringify(err.body)}`
      );
    }
    throw new Error(
      `There has been an internal error listing containers.
${err.message}`
    );
  }
}
function renderContainerTable(apps2) {
  logger.table(
    apps2.map((app) => {
      const state2 = deriveContainerState(app);
      return {
        ID: app.id,
        NAME: app.name,
        STATE: colorState(state2),
        "LIVE INSTANCES": String(app.instances),
        "LAST MODIFIED": app.updated_at
      };
    })
  );
}
function appsToJsonOutput(apps2) {
  return apps2.map((app) => ({
    id: app.id,
    name: app.name,
    state: deriveContainerState(app),
    instances: app.instances,
    image: app.image,
    version: app.version,
    updated_at: app.updated_at,
    created_at: app.created_at
  }));
}
async function listCommand(args) {
  if (args.json) {
    try {
      const { data } = await fetchContainerPage();
      logger.json(appsToJsonOutput(data));
      return;
    } catch (err) {
      if (err instanceof UserError) {
        throw err;
      }
      const message = err instanceof Error ? err.message : "Unknown error";
      throw new JsonFriendlyFatalError(JSON.stringify({ error: message }));
    }
  }
  if (isNonInteractiveOrCI()) {
    const { data } = await fetchContainerPage();
    if (data.length === 0) {
      logger.log("No containers found.");
      return;
    }
    renderContainerTable(data);
    return;
  }
  const { start, stop } = spinner();
  let pageToken;
  let totalShown = 0;
  let stopped = false;
  let buffer = [];
  do {
    if (buffer.length === 0) {
      start("Loading containers");
      try {
        const { data, nextPageToken } = await fetchContainerPage(
          args.perPage,
          pageToken
        );
        buffer = data;
        pageToken = nextPageToken;
      } finally {
        stop();
      }
    }
    if (buffer.length === 0 && totalShown === 0) {
      logger.log("No containers found.");
      return;
    }
    const chunk = buffer.splice(0, args.perPage);
    if (chunk.length > 0) {
      renderContainerTable(chunk);
      totalShown += chunk.length;
    }
    const hasMore = buffer.length > 0 || pageToken;
    if (hasMore) {
      logger.log(
        dim(
          `Showing ${totalShown} containers. Press Enter to load ${args.perPage} more, or q/Esc to stop.`
        )
      );
      await new Promise((resolve32) => {
        const cleanup = onKeyPress(
          (key) => {
            if (key.name === "return") {
              cleanup();
              resolve32();
            } else if (key.name === "escape" || key.name === "q" || key.name === "c" && key.ctrl) {
              cleanup();
              stopped = true;
              resolve32();
            }
          },
          { escapeCodeTimeout: 25 }
        );
      });
    }
  } while ((buffer.length > 0 || pageToken) && !stopped);
}
var listArgs, containersListCommand;
var init_list = __esm({
  "src/containers/list.ts"() {
    init_import_meta_url();
    init_colors();
    init_interactive();
    init_containers_shared();
    init_dist();
    init_common();
    init_create_command();
    init_is_interactive();
    init_logger();
    init_onKeyPress();
    init_containers2();
    __name(deriveContainerState, "deriveContainerState");
    __name(colorState, "colorState");
    __name(fetchContainerPage, "fetchContainerPage");
    __name(renderContainerTable, "renderContainerTable");
    __name(appsToJsonOutput, "appsToJsonOutput");
    listArgs = {
      "per-page": {
        describe: "Number of containers per page",
        type: "number",
        default: 25,
        coerce: /* @__PURE__ */ __name((val2) => {
          if (val2 < 1) {
            throw new UserError("--per-page must be at least 1");
          }
          return val2;
        }, "coerce")
      },
      json: {
        describe: "Return output as JSON",
        type: "boolean",
        default: false
      }
    };
    __name(listCommand, "listCommand");
    containersListCommand = createCommand({
      metadata: {
        description: "List containers",
        status: "open beta",
        owner: "Product: Cloudchamber"
      },
      behaviour: {
        printBanner: /* @__PURE__ */ __name((args) => !args.json && !isNonInteractiveOrCI(), "printBanner")
      },
      args: listArgs,
      async handler(args, { config }) {
        await fillOpenAPIConfiguration(config, containersScope);
        await listCommand(args);
      }
    });
  }
});

// ../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/nodes/identity.js
var require_identity = __commonJS({
  "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/nodes/identity.js"(exports) {
    init_import_meta_url();
    var ALIAS = Symbol.for("yaml.alias");
    var DOC = Symbol.for("yaml.document");
    var MAP2 = Symbol.for("yaml.map");
    var PAIR = Symbol.for("yaml.pair");
    var SCALAR = Symbol.for("yaml.scalar");
    var SEQ = Symbol.for("yaml.seq");
    var NODE_TYPE = Symbol.for("yaml.node.type");
    var isAlias = /* @__PURE__ */ __name((node2) => !!node2 && typeof node2 === "object" && node2[NODE_TYPE] === ALIAS, "isAlias");
    var isDocument = /* @__PURE__ */ __name((node2) => !!node2 && typeof node2 === "object" && node2[NODE_TYPE] === DOC, "isDocument");
    var isMap = /* @__PURE__ */ __name((node2) => !!node2 && typeof node2 === "object" && node2[NODE_TYPE] === MAP2, "isMap");
    var isPair = /* @__PURE__ */ __name((node2) => !!node2 && typeof node2 === "object" && node2[NODE_TYPE] === PAIR, "isPair");
    var isScalar = /* @__PURE__ */ __name((node2) => !!node2 && typeof node2 === "object" && node2[NODE_TYPE] === SCALAR, "isScalar");
    var isSeq = /* @__PURE__ */ __name((node2) => !!node2 && typeof node2 === "object" && node2[NODE_TYPE] === SEQ, "isSeq");
    function isCollection(node2) {
      if (node2 && typeof node2 === "object")
        switch (node2[NODE_TYPE]) {
          case MAP2:
          case SEQ:
            return true;
        }
      return false;
    }
    __name(isCollection, "isCollection");
    function isNode(node2) {
      if (node2 && typeof node2 === "object")
        switch (node2[NODE_TYPE]) {
          case ALIAS:
          case MAP2:
          case SCALAR:
          case SEQ:
            return true;
        }
      return false;
    }
    __name(isNode, "isNode");
    var hasAnchor = /* @__PURE__ */ __name((node2) => (isScalar(node2) || isCollection(node2)) && !!node2.anchor, "hasAnchor");
    exports.ALIAS = ALIAS;
    exports.DOC = DOC;
    exports.MAP = MAP2;
    exports.NODE_TYPE = NODE_TYPE;
    exports.PAIR = PAIR;
    exports.SCALAR = SCALAR;
    exports.SEQ = SEQ;
    exports.hasAnchor = hasAnchor;
    exports.isAlias = isAlias;
    exports.isCollection = isCollection;
    exports.isDocument = isDocument;
    exports.isMap = isMap;
    exports.isNode = isNode;
    exports.isPair = isPair;
    exports.isScalar = isScalar;
    exports.isSeq = isSeq;
  }
});

// ../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/visit.js
var require_visit = __commonJS({
  "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/visit.js"(exports) {
    init_import_meta_url();
    var identity = require_identity();
    var BREAK = Symbol("break visit");
    var SKIP = Symbol("skip children");
    var REMOVE = Symbol("remove node");
    function visit5(node2, visitor) {
      const visitor_ = initVisitor(visitor);
      if (identity.isDocument(node2)) {
        const cd2 = visit_(null, node2.contents, visitor_, Object.freeze([node2]));
        if (cd2 === REMOVE)
          node2.contents = null;
      } else
        visit_(null, node2, visitor_, Object.freeze([]));
    }
    __name(visit5, "visit");
    visit5.BREAK = BREAK;
    visit5.SKIP = SKIP;
    visit5.REMOVE = REMOVE;
    function visit_(key, node2, visitor, path84) {
      const ctrl = callVisitor(key, node2, visitor, path84);
      if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
        replaceNode(key, path84, ctrl);
        return visit_(key, ctrl, visitor, path84);
      }
      if (typeof ctrl !== "symbol") {
        if (identity.isCollection(node2)) {
          path84 = Object.freeze(path84.concat(node2));
          for (let i7 = 0; i7 < node2.items.length; ++i7) {
            const ci7 = visit_(i7, node2.items[i7], visitor, path84);
            if (typeof ci7 === "number")
              i7 = ci7 - 1;
            else if (ci7 === BREAK)
              return BREAK;
            else if (ci7 === REMOVE) {
              node2.items.splice(i7, 1);
              i7 -= 1;
            }
          }
        } else if (identity.isPair(node2)) {
          path84 = Object.freeze(path84.concat(node2));
          const ck2 = visit_("key", node2.key, visitor, path84);
          if (ck2 === BREAK)
            return BREAK;
          else if (ck2 === REMOVE)
            node2.key = null;
          const cv2 = visit_("value", node2.value, visitor, path84);
          if (cv2 === BREAK)
            return BREAK;
          else if (cv2 === REMOVE)
            node2.value = null;
        }
      }
      return ctrl;
    }
    __name(visit_, "visit_");
    async function visitAsync(node2, visitor) {
      const visitor_ = initVisitor(visitor);
      if (identity.isDocument(node2)) {
        const cd2 = await visitAsync_(null, node2.contents, visitor_, Object.freeze([node2]));
        if (cd2 === REMOVE)
          node2.contents = null;
      } else
        await visitAsync_(null, node2, visitor_, Object.freeze([]));
    }
    __name(visitAsync, "visitAsync");
    visitAsync.BREAK = BREAK;
    visitAsync.SKIP = SKIP;
    visitAsync.REMOVE = REMOVE;
    async function visitAsync_(key, node2, visitor, path84) {
      const ctrl = await callVisitor(key, node2, visitor, path84);
      if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
        replaceNode(key, path84, ctrl);
        return visitAsync_(key, ctrl, visitor, path84);
      }
      if (typeof ctrl !== "symbol") {
        if (identity.isCollection(node2)) {
          path84 = Object.freeze(path84.concat(node2));
          for (let i7 = 0; i7 < node2.items.length; ++i7) {
            const ci7 = await visitAsync_(i7, node2.items[i7], visitor, path84);
            if (typeof ci7 === "number")
              i7 = ci7 - 1;
            else if (ci7 === BREAK)
              return BREAK;
            else if (ci7 === REMOVE) {
              node2.items.splice(i7, 1);
              i7 -= 1;
            }
          }
        } else if (identity.isPair(node2)) {
          path84 = Object.freeze(path84.concat(node2));
          const ck2 = await visitAsync_("key", node2.key, visitor, path84);
          if (ck2 === BREAK)
            return BREAK;
          else if (ck2 === REMOVE)
            node2.key = null;
          const cv2 = await visitAsync_("value", node2.value, visitor, path84);
          if (cv2 === BREAK)
            return BREAK;
          else if (cv2 === REMOVE)
            node2.value = null;
        }
      }
      return ctrl;
    }
    __name(visitAsync_, "visitAsync_");
    function initVisitor(visitor) {
      if (typeof visitor === "object" && (visitor.Collection || visitor.Node || visitor.Value)) {
        return Object.assign({
          Alias: visitor.Node,
          Map: visitor.Node,
          Scalar: visitor.Node,
          Seq: visitor.Node
        }, visitor.Value && {
          Map: visitor.Value,
          Scalar: visitor.Value,
          Seq: visitor.Value
        }, visitor.Collection && {
          Map: visitor.Collection,
          Seq: visitor.Collection
        }, visitor);
      }
      return visitor;
    }
    __name(initVisitor, "initVisitor");
    function callVisitor(key, node2, visitor, path84) {
      if (typeof visitor === "function")
        return visitor(key, node2, path84);
      if (identity.isMap(node2))
        return visitor.Map?.(key, node2, path84);
      if (identity.isSeq(node2))
        return visitor.Seq?.(key, node2, path84);
      if (identity.isPair(node2))
        return visitor.Pair?.(key, node2, path84);
      if (identity.isScalar(node2))
        return visitor.Scalar?.(key, node2, path84);
      if (identity.isAlias(node2))
        return visitor.Alias?.(key, node2, path84);
      return void 0;
    }
    __name(callVisitor, "callVisitor");
    function replaceNode(key, path84, node2) {
      const parent = path84[path84.length - 1];
      if (identity.isCollection(parent)) {
        parent.items[key] = node2;
      } else if (identity.isPair(parent)) {
        if (key === "key")
          parent.key = node2;
        else
          parent.value = node2;
      } else if (identity.isDocument(parent)) {
        parent.contents = node2;
      } else {
        const pt2 = identity.isAlias(parent) ? "alias" : "scalar";
        throw new Error(`Cannot replace node with ${pt2} parent`);
      }
    }
    __name(replaceNode, "replaceNode");
    exports.visit = visit5;
    exports.visitAsync = visitAsync;
  }
});

// ../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/doc/directives.js
var require_directives = __commonJS({
  "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/doc/directives.js"(exports) {
    init_import_meta_url();
    var identity = require_identity();
    var visit5 = require_visit();
    var escapeChars = {
      "!": "%21",
      ",": "%2C",
      "[": "%5B",
      "]": "%5D",
      "{": "%7B",
      "}": "%7D"
    };
    var escapeTagName = /* @__PURE__ */ __name((tn) => tn.replace(/[!,[\]{}]/g, (ch2) => escapeChars[ch2]), "escapeTagName");
    var Directives = class _Directives {
      static {
        __name(this, "Directives");
      }
      constructor(yaml, tags) {
        this.docStart = null;
        this.docEnd = false;
        this.yaml = Object.assign({}, _Directives.defaultYaml, yaml);
        this.tags = Object.assign({}, _Directives.defaultTags, tags);
      }
      clone() {
        const copy = new _Directives(this.yaml, this.tags);
        copy.docStart = this.docStart;
        return copy;
      }
      /**
       * During parsing, get a Directives instance for the current document and
       * update the stream state according to the current version's spec.
       */
      atDocument() {
        const res = new _Directives(this.yaml, this.tags);
        switch (this.yaml.version) {
          case "1.1":
            this.atNextDocument = true;
            break;
          case "1.2":
            this.atNextDocument = false;
            this.yaml = {
              explicit: _Directives.defaultYaml.explicit,
              version: "1.2"
            };
            this.tags = Object.assign({}, _Directives.defaultTags);
            break;
        }
        return res;
      }
      /**
       * @param onError - May be called even if the action was successful
       * @returns `true` on success
       */
      add(line, onError) {
        if (this.atNextDocument) {
          this.yaml = { explicit: _Directives.defaultYaml.explicit, version: "1.1" };
          this.tags = Object.assign({}, _Directives.defaultTags);
          this.atNextDocument = false;
        }
        const parts = line.trim().split(/[ \t]+/);
        const name2 = parts.shift();
        switch (name2) {
          case "%TAG": {
            if (parts.length !== 2) {
              onError(0, "%TAG directive should contain exactly two parts");
              if (parts.length < 2)
                return false;
            }
            const [handle, prefix] = parts;
            this.tags[handle] = prefix;
            return true;
          }
          case "%YAML": {
            this.yaml.explicit = true;
            if (parts.length !== 1) {
              onError(0, "%YAML directive should contain exactly one part");
              return false;
            }
            const [version5] = parts;
            if (version5 === "1.1" || version5 === "1.2") {
              this.yaml.version = version5;
              return true;
            } else {
              const isValid4 = /^\d+\.\d+$/.test(version5);
              onError(6, `Unsupported YAML version ${version5}`, isValid4);
              return false;
            }
          }
          default:
            onError(0, `Unknown directive ${name2}`, true);
            return false;
        }
      }
      /**
       * Resolves a tag, matching handles to those defined in %TAG directives.
       *
       * @returns Resolved tag, which may also be the non-specific tag `'!'` or a
       *   `'!local'` tag, or `null` if unresolvable.
       */
      tagName(source, onError) {
        if (source === "!")
          return "!";
        if (source[0] !== "!") {
          onError(`Not a valid tag: ${source}`);
          return null;
        }
        if (source[1] === "<") {
          const verbatim = source.slice(2, -1);
          if (verbatim === "!" || verbatim === "!!") {
            onError(`Verbatim tags aren't resolved, so ${source} is invalid.`);
            return null;
          }
          if (source[source.length - 1] !== ">")
            onError("Verbatim tags must end with a >");
          return verbatim;
        }
        const [, handle, suffix] = source.match(/^(.*!)([^!]*)$/s);
        if (!suffix)
          onError(`The ${source} tag has no suffix`);
        const prefix = this.tags[handle];
        if (prefix) {
          try {
            return prefix + decodeURIComponent(suffix);
          } catch (error2) {
            onError(String(error2));
            return null;
          }
        }
        if (handle === "!")
          return source;
        onError(`Could not resolve tag: ${source}`);
        return null;
      }
      /**
       * Given a fully resolved tag, returns its printable string form,
       * taking into account current tag prefixes and defaults.
       */
      tagString(tag) {
        for (const [handle, prefix] of Object.entries(this.tags)) {
          if (tag.startsWith(prefix))
            return handle + escapeTagName(tag.substring(prefix.length));
        }
        return tag[0] === "!" ? tag : `!<${tag}>`;
      }
      toString(doc) {
        const lines = this.yaml.explicit ? [`%YAML ${this.yaml.version || "1.2"}`] : [];
        const tagEntries = Object.entries(this.tags);
        let tagNames;
        if (doc && tagEntries.length > 0 && identity.isNode(doc.contents)) {
          const tags = {};
          visit5.visit(doc.contents, (_key, node2) => {
            if (identity.isNode(node2) && node2.tag)
              tags[node2.tag] = true;
          });
          tagNames = Object.keys(tags);
        } else
          tagNames = [];
        for (const [handle, prefix] of tagEntries) {
          if (handle === "!!" && prefix === "tag:yaml.org,2002:")
            continue;
          if (!doc || tagNames.some((tn) => tn.startsWith(prefix)))
            lines.push(`%TAG ${handle} ${prefix}`);
        }
        return lines.join("\n");
      }
    };
    Directives.defaultYaml = { explicit: false, version: "1.2" };
    Directives.defaultTags = { "!!": "tag:yaml.org,2002:" };
    exports.Directives = Directives;
  }
});

// ../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/doc/anchors.js
var require_anchors = __commonJS({
  "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/doc/anchors.js"(exports) {
    init_import_meta_url();
    var identity = require_identity();
    var visit5 = require_visit();
    function anchorIsValid(anchor) {
      if (/[\x00-\x19\s,[\]{}]/.test(anchor)) {
        const sa = JSON.stringify(anchor);
        const msg = `Anchor must not contain whitespace or control characters: ${sa}`;
        throw new Error(msg);
      }
      return true;
    }
    __name(anchorIsValid, "anchorIsValid");
    function anchorNames(root) {
      const anchors = /* @__PURE__ */ new Set();
      visit5.visit(root, {
        Value(_key, node2) {
          if (node2.anchor)
            anchors.add(node2.anchor);
        }
      });
      return anchors;
    }
    __name(anchorNames, "anchorNames");
    function findNewAnchor(prefix, exclude) {
      for (let i7 = 1; true; ++i7) {
        const name2 = `${prefix}${i7}`;
        if (!exclude.has(name2))
          return name2;
      }
    }
    __name(findNewAnchor, "findNewAnchor");
    function createNodeAnchors(doc, prefix) {
      const aliasObjects = [];
      const sourceObjects = /* @__PURE__ */ new Map();
      let prevAnchors = null;
      return {
        onAnchor: /* @__PURE__ */ __name((source) => {
          aliasObjects.push(source);
          prevAnchors ?? (prevAnchors = anchorNames(doc));
          const anchor = findNewAnchor(prefix, prevAnchors);
          prevAnchors.add(anchor);
          return anchor;
        }, "onAnchor"),
        /**
         * With circular references, the source node is only resolved after all
         * of its child nodes are. This is why anchors are set only after all of
         * the nodes have been created.
         */
        setAnchors: /* @__PURE__ */ __name(() => {
          for (const source of aliasObjects) {
            const ref = sourceObjects.get(source);
            if (typeof ref === "object" && ref.anchor && (identity.isScalar(ref.node) || identity.isCollection(ref.node))) {
              ref.node.anchor = ref.anchor;
            } else {
              const error2 = new Error("Failed to resolve repeated object (this should not happen)");
              error2.source = source;
              throw error2;
            }
          }
        }, "setAnchors"),
        sourceObjects
      };
    }
    __name(createNodeAnchors, "createNodeAnchors");
    exports.anchorIsValid = anchorIsValid;
    exports.anchorNames = anchorNames;
    exports.createNodeAnchors = createNodeAnchors;
    exports.findNewAnchor = findNewAnchor;
  }
});

// ../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/doc/applyReviver.js
var require_applyReviver = __commonJS({
  "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/doc/applyReviver.js"(exports) {
    init_import_meta_url();
    function applyReviver(reviver, obj, key, val2) {
      if (val2 && typeof val2 === "object") {
        if (Array.isArray(val2)) {
          for (let i7 = 0, len = val2.length; i7 < len; ++i7) {
            const v0 = val2[i7];
            const v1 = applyReviver(reviver, val2, String(i7), v0);
            if (v1 === void 0)
              delete val2[i7];
            else if (v1 !== v0)
              val2[i7] = v1;
          }
        } else if (val2 instanceof Map) {
          for (const k7 of Array.from(val2.keys())) {
            const v0 = val2.get(k7);
            const v1 = applyReviver(reviver, val2, k7, v0);
            if (v1 === void 0)
              val2.delete(k7);
            else if (v1 !== v0)
              val2.set(k7, v1);
          }
        } else if (val2 instanceof Set) {
          for (const v0 of Array.from(val2)) {
            const v1 = applyReviver(reviver, val2, v0, v0);
            if (v1 === void 0)
              val2.delete(v0);
            else if (v1 !== v0) {
              val2.delete(v0);
              val2.add(v1);
            }
          }
        } else {
          for (const [k7, v0] of Object.entries(val2)) {
            const v1 = applyReviver(reviver, val2, k7, v0);
            if (v1 === void 0)
              delete val2[k7];
            else if (v1 !== v0)
              val2[k7] = v1;
          }
        }
      }
      return reviver.call(obj, key, val2);
    }
    __name(applyReviver, "applyReviver");
    exports.applyReviver = applyReviver;
  }
});

// ../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/nodes/toJS.js
var require_toJS = __commonJS({
  "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/nodes/toJS.js"(exports) {
    init_import_meta_url();
    var identity = require_identity();
    function toJS(value, arg, ctx) {
      if (Array.isArray(value))
        return value.map((v8, i7) => toJS(v8, String(i7), ctx));
      if (value && typeof value.toJSON === "function") {
        if (!ctx || !identity.hasAnchor(value))
          return value.toJSON(arg, ctx);
        const data = { aliasCount: 0, count: 1, res: void 0 };
        ctx.anchors.set(value, data);
        ctx.onCreate = (res2) => {
          data.res = res2;
          delete ctx.onCreate;
        };
        const res = value.toJSON(arg, ctx);
        if (ctx.onCreate)
          ctx.onCreate(res);
        return res;
      }
      if (typeof value === "bigint" && !ctx?.keep)
        return Number(value);
      return value;
    }
    __name(toJS, "toJS");
    exports.toJS = toJS;
  }
});

// ../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/nodes/Node.js
var require_Node = __commonJS({
  "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/nodes/Node.js"(exports) {
    init_import_meta_url();
    var applyReviver = require_applyReviver();
    var identity = require_identity();
    var toJS = require_toJS();
    var NodeBase = class {
      static {
        __name(this, "NodeBase");
      }
      constructor(type) {
        Object.defineProperty(this, identity.NODE_TYPE, { value: type });
      }
      /** Create a copy of this node.  */
      clone() {
        const copy = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this));
        if (this.range)
          copy.range = this.range.slice();
        return copy;
      }
      /** A plain JavaScript representation of this node. */
      toJS(doc, { mapAsMap, maxAliasCount, onAnchor, reviver } = {}) {
        if (!identity.isDocument(doc))
          throw new TypeError("A document argument is required");
        const ctx = {
          anchors: /* @__PURE__ */ new Map(),
          doc,
          keep: true,
          mapAsMap: mapAsMap === true,
          mapKeyWarned: false,
          maxAliasCount: typeof maxAliasCount === "number" ? maxAliasCount : 100
        };
        const res = toJS.toJS(this, "", ctx);
        if (typeof onAnchor === "function")
          for (const { count, res: res2 } of ctx.anchors.values())
            onAnchor(res2, count);
        return typeof reviver === "function" ? applyReviver.applyReviver(reviver, { "": res }, "", res) : res;
      }
    };
    exports.NodeBase = NodeBase;
  }
});

// ../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/nodes/Alias.js
var require_Alias = __commonJS({
  "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/nodes/Alias.js"(exports) {
    init_import_meta_url();
    var anchors = require_anchors();
    var visit5 = require_visit();
    var identity = require_identity();
    var Node3 = require_Node();
    var toJS = require_toJS();
    var Alias = class extends Node3.NodeBase {
      static {
        __name(this, "Alias");
      }
      constructor(source) {
        super(identity.ALIAS);
        this.source = source;
        Object.defineProperty(this, "tag", {
          set() {
            throw new Error("Alias nodes cannot have tags");
          }
        });
      }
      /**
       * Resolve the value of this alias within `doc`, finding the last
       * instance of the `source` anchor before this node.
       */
      resolve(doc, ctx) {
        let nodes;
        if (ctx?.aliasResolveCache) {
          nodes = ctx.aliasResolveCache;
        } else {
          nodes = [];
          visit5.visit(doc, {
            Node: /* @__PURE__ */ __name((_key, node2) => {
              if (identity.isAlias(node2) || identity.hasAnchor(node2))
                nodes.push(node2);
            }, "Node")
          });
          if (ctx)
            ctx.aliasResolveCache = nodes;
        }
        let found = void 0;
        for (const node2 of nodes) {
          if (node2 === this)
            break;
          if (node2.anchor === this.source)
            found = node2;
        }
        return found;
      }
      toJSON(_arg, ctx) {
        if (!ctx)
          return { source: this.source };
        const { anchors: anchors2, doc, maxAliasCount } = ctx;
        const source = this.resolve(doc, ctx);
        if (!source) {
          const msg = `Unresolved alias (the anchor must be set before the alias): ${this.source}`;
          throw new ReferenceError(msg);
        }
        let data = anchors2.get(source);
        if (!data) {
          toJS.toJS(source, null, ctx);
          data = anchors2.get(source);
        }
        if (!data || data.res === void 0) {
          const msg = "This should not happen: Alias anchor was not resolved?";
          throw new ReferenceError(msg);
        }
        if (maxAliasCount >= 0) {
          data.count += 1;
          if (data.aliasCount === 0)
            data.aliasCount = getAliasCount(doc, source, anchors2);
          if (data.count * data.aliasCount > maxAliasCount) {
            const msg = "Excessive alias count indicates a resource exhaustion attack";
            throw new ReferenceError(msg);
          }
        }
        return data.res;
      }
      toString(ctx, _onComment, _onChompKeep) {
        const src = `*${this.source}`;
        if (ctx) {
          anchors.anchorIsValid(this.source);
          if (ctx.options.verifyAliasOrder && !ctx.anchors.has(this.source)) {
            const msg = `Unresolved alias (the anchor must be set before the alias): ${this.source}`;
            throw new Error(msg);
          }
          if (ctx.implicitKey)
            return `${src} `;
        }
        return src;
      }
    };
    function getAliasCount(doc, node2, anchors2) {
      if (identity.isAlias(node2)) {
        const source = node2.resolve(doc);
        const anchor = anchors2 && source && anchors2.get(source);
        return anchor ? anchor.count * anchor.aliasCount : 0;
      } else if (identity.isCollection(node2)) {
        let count = 0;
        for (const item of node2.items) {
          const c8 = getAliasCount(doc, item, anchors2);
          if (c8 > count)
            count = c8;
        }
        return count;
      } else if (identity.isPair(node2)) {
        const kc = getAliasCount(doc, node2.key, anchors2);
        const vc = getAliasCount(doc, node2.value, anchors2);
        return Math.max(kc, vc);
      }
      return 1;
    }
    __name(getAliasCount, "getAliasCount");
    exports.Alias = Alias;
  }
});

// ../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/nodes/Scalar.js
var require_Scalar = __commonJS({
  "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/nodes/Scalar.js"(exports) {
    init_import_meta_url();
    var identity = require_identity();
    var Node3 = require_Node();
    var toJS = require_toJS();
    var isScalarValue = /* @__PURE__ */ __name((value) => !value || typeof value !== "function" && typeof value !== "object", "isScalarValue");
    var Scalar = class extends Node3.NodeBase {
      static {
        __name(this, "Scalar");
      }
      constructor(value) {
        super(identity.SCALAR);
        this.value = value;
      }
      toJSON(arg, ctx) {
        return ctx?.keep ? this.value : toJS.toJS(this.value, arg, ctx);
      }
      toString() {
        return String(this.value);
      }
    };
    Scalar.BLOCK_FOLDED = "BLOCK_FOLDED";
    Scalar.BLOCK_LITERAL = "BLOCK_LITERAL";
    Scalar.PLAIN = "PLAIN";
    Scalar.QUOTE_DOUBLE = "QUOTE_DOUBLE";
    Scalar.QUOTE_SINGLE = "QUOTE_SINGLE";
    exports.Scalar = Scalar;
    exports.isScalarValue = isScalarValue;
  }
});

// ../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/doc/createNode.js
var require_createNode = __commonJS({
  "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/doc/createNode.js"(exports) {
    init_import_meta_url();
    var Alias = require_Alias();
    var identity = require_identity();
    var Scalar = require_Scalar();
    var defaultTagPrefix = "tag:yaml.org,2002:";
    function findTagObject(value, tagName, tags) {
      if (tagName) {
        const match3 = tags.filter((t13) => t13.tag === tagName);
        const tagObj = match3.find((t13) => !t13.format) ?? match3[0];
        if (!tagObj)
          throw new Error(`Tag ${tagName} not found`);
        return tagObj;
      }
      return tags.find((t13) => t13.identify?.(value) && !t13.format);
    }
    __name(findTagObject, "findTagObject");
    function createNode(value, tagName, ctx) {
      if (identity.isDocument(value))
        value = value.contents;
      if (identity.isNode(value))
        return value;
      if (identity.isPair(value)) {
        const map2 = ctx.schema[identity.MAP].createNode?.(ctx.schema, null, ctx);
        map2.items.push(value);
        return map2;
      }
      if (value instanceof String || value instanceof Number || value instanceof Boolean || typeof BigInt !== "undefined" && value instanceof BigInt) {
        value = value.valueOf();
      }
      const { aliasDuplicateObjects, onAnchor, onTagObj, schema, sourceObjects } = ctx;
      let ref = void 0;
      if (aliasDuplicateObjects && value && typeof value === "object") {
        ref = sourceObjects.get(value);
        if (ref) {
          ref.anchor ?? (ref.anchor = onAnchor(value));
          return new Alias.Alias(ref.anchor);
        } else {
          ref = { anchor: null, node: null };
          sourceObjects.set(value, ref);
        }
      }
      if (tagName?.startsWith("!!"))
        tagName = defaultTagPrefix + tagName.slice(2);
      let tagObj = findTagObject(value, tagName, schema.tags);
      if (!tagObj) {
        if (value && typeof value.toJSON === "function") {
          value = value.toJSON();
        }
        if (!value || typeof value !== "object") {
          const node3 = new Scalar.Scalar(value);
          if (ref)
            ref.node = node3;
          return node3;
        }
        tagObj = value instanceof Map ? schema[identity.MAP] : Symbol.iterator in Object(value) ? schema[identity.SEQ] : schema[identity.MAP];
      }
      if (onTagObj) {
        onTagObj(tagObj);
        delete ctx.onTagObj;
      }
      const node2 = tagObj?.createNode ? tagObj.createNode(ctx.schema, value, ctx) : typeof tagObj?.nodeClass?.from === "function" ? tagObj.nodeClass.from(ctx.schema, value, ctx) : new Scalar.Scalar(value);
      if (tagName)
        node2.tag = tagName;
      else if (!tagObj.default)
        node2.tag = tagObj.tag;
      if (ref)
        ref.node = node2;
      return node2;
    }
    __name(createNode, "createNode");
    exports.createNode = createNode;
  }
});

// ../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/nodes/Collection.js
var require_Collection = __commonJS({
  "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/nodes/Collection.js"(exports) {
    init_import_meta_url();
    var createNode = require_createNode();
    var identity = require_identity();
    var Node3 = require_Node();
    function collectionFromPath(schema, path84, value) {
      let v8 = value;
      for (let i7 = path84.length - 1; i7 >= 0; --i7) {
        const k7 = path84[i7];
        if (typeof k7 === "number" && Number.isInteger(k7) && k7 >= 0) {
          const a7 = [];
          a7[k7] = v8;
          v8 = a7;
        } else {
          v8 = /* @__PURE__ */ new Map([[k7, v8]]);
        }
      }
      return createNode.createNode(v8, void 0, {
        aliasDuplicateObjects: false,
        keepUndefined: false,
        onAnchor: /* @__PURE__ */ __name(() => {
          throw new Error("This should not happen, please report a bug.");
        }, "onAnchor"),
        schema,
        sourceObjects: /* @__PURE__ */ new Map()
      });
    }
    __name(collectionFromPath, "collectionFromPath");
    var isEmptyPath = /* @__PURE__ */ __name((path84) => path84 == null || typeof path84 === "object" && !!path84[Symbol.iterator]().next().done, "isEmptyPath");
    var Collection = class extends Node3.NodeBase {
      static {
        __name(this, "Collection");
      }
      constructor(type, schema) {
        super(type);
        Object.defineProperty(this, "schema", {
          value: schema,
          configurable: true,
          enumerable: false,
          writable: true
        });
      }
      /**
       * Create a copy of this collection.
       *
       * @param schema - If defined, overwrites the original's schema
       */
      clone(schema) {
        const copy = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this));
        if (schema)
          copy.schema = schema;
        copy.items = copy.items.map((it2) => identity.isNode(it2) || identity.isPair(it2) ? it2.clone(schema) : it2);
        if (this.range)
          copy.range = this.range.slice();
        return copy;
      }
      /**
       * Adds a value to the collection. For `!!map` and `!!omap` the value must
       * be a Pair instance or a `{ key, value }` object, which may not have a key
       * that already exists in the map.
       */
      addIn(path84, value) {
        if (isEmptyPath(path84))
          this.add(value);
        else {
          const [key, ...rest] = path84;
          const node2 = this.get(key, true);
          if (identity.isCollection(node2))
            node2.addIn(rest, value);
          else if (node2 === void 0 && this.schema)
            this.set(key, collectionFromPath(this.schema, rest, value));
          else
            throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest}`);
        }
      }
      /**
       * Removes a value from the collection.
       * @returns `true` if the item was found and removed.
       */
      deleteIn(path84) {
        const [key, ...rest] = path84;
        if (rest.length === 0)
          return this.delete(key);
        const node2 = this.get(key, true);
        if (identity.isCollection(node2))
          return node2.deleteIn(rest);
        else
          throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest}`);
      }
      /**
       * Returns item at `key`, or `undefined` if not found. By default unwraps
       * scalar values from their surrounding node; to disable set `keepScalar` to
       * `true` (collections are always returned intact).
       */
      getIn(path84, keepScalar) {
        const [key, ...rest] = path84;
        const node2 = this.get(key, true);
        if (rest.length === 0)
          return !keepScalar && identity.isScalar(node2) ? node2.value : node2;
        else
          return identity.isCollection(node2) ? node2.getIn(rest, keepScalar) : void 0;
      }
      hasAllNullValues(allowScalar) {
        return this.items.every((node2) => {
          if (!identity.isPair(node2))
            return false;
          const n9 = node2.value;
          return n9 == null || allowScalar && identity.isScalar(n9) && n9.value == null && !n9.commentBefore && !n9.comment && !n9.tag;
        });
      }
      /**
       * Checks if the collection includes a value with the key `key`.
       */
      hasIn(path84) {
        const [key, ...rest] = path84;
        if (rest.length === 0)
          return this.has(key);
        const node2 = this.get(key, true);
        return identity.isCollection(node2) ? node2.hasIn(rest) : false;
      }
      /**
       * Sets a value in this collection. For `!!set`, `value` needs to be a
       * boolean to add/remove the item from the set.
       */
      setIn(path84, value) {
        const [key, ...rest] = path84;
        if (rest.length === 0) {
          this.set(key, value);
        } else {
          const node2 = this.get(key, true);
          if (identity.isCollection(node2))
            node2.setIn(rest, value);
          else if (node2 === void 0 && this.schema)
            this.set(key, collectionFromPath(this.schema, rest, value));
          else
            throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest}`);
        }
      }
    };
    exports.Collection = Collection;
    exports.collectionFromPath = collectionFromPath;
    exports.isEmptyPath = isEmptyPath;
  }
});

// ../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/stringify/stringifyComment.js
var require_stringifyComment = __commonJS({
  "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/stringify/stringifyComment.js"(exports) {
    init_import_meta_url();
    var stringifyComment = /* @__PURE__ */ __name((str) => str.replace(/^(?!$)(?: $)?/gm, "#"), "stringifyComment");
    function indentComment(comment, indent) {
      if (/^\n+$/.test(comment))
        return comment.substring(1);
      return indent ? comment.replace(/^(?! *$)/gm, indent) : comment;
    }
    __name(indentComment, "indentComment");
    var lineComment = /* @__PURE__ */ __name((str, indent, comment) => str.endsWith("\n") ? indentComment(comment, indent) : comment.includes("\n") ? "\n" + indentComment(comment, indent) : (str.endsWith(" ") ? "" : " ") + comment, "lineComment");
    exports.indentComment = indentComment;
    exports.lineComment = lineComment;
    exports.stringifyComment = stringifyComment;
  }
});

// ../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/stringify/foldFlowLines.js
var require_foldFlowLines = __commonJS({
  "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/stringify/foldFlowLines.js"(exports) {
    init_import_meta_url();
    var FOLD_FLOW = "flow";
    var FOLD_BLOCK = "block";
    var FOLD_QUOTED = "quoted";
    function foldFlowLines(text, indent, mode = "flow", { indentAtStart, lineWidth = 80, minContentWidth = 20, onFold, onOverflow } = {}) {
      if (!lineWidth || lineWidth < 0)
        return text;
      if (lineWidth < minContentWidth)
        minContentWidth = 0;
      const endStep = Math.max(1 + minContentWidth, 1 + lineWidth - indent.length);
      if (text.length <= endStep)
        return text;
      const folds = [];
      const escapedFolds = {};
      let end = lineWidth - indent.length;
      if (typeof indentAtStart === "number") {
        if (indentAtStart > lineWidth - Math.max(2, minContentWidth))
          folds.push(0);
        else
          end = lineWidth - indentAtStart;
      }
      let split = void 0;
      let prev = void 0;
      let overflow = false;
      let i7 = -1;
      let escStart = -1;
      let escEnd = -1;
      if (mode === FOLD_BLOCK) {
        i7 = consumeMoreIndentedLines(text, i7, indent.length);
        if (i7 !== -1)
          end = i7 + endStep;
      }
      for (let ch2; ch2 = text[i7 += 1]; ) {
        if (mode === FOLD_QUOTED && ch2 === "\\") {
          escStart = i7;
          switch (text[i7 + 1]) {
            case "x":
              i7 += 3;
              break;
            case "u":
              i7 += 5;
              break;
            case "U":
              i7 += 9;
              break;
            default:
              i7 += 1;
          }
          escEnd = i7;
        }
        if (ch2 === "\n") {
          if (mode === FOLD_BLOCK)
            i7 = consumeMoreIndentedLines(text, i7, indent.length);
          end = i7 + indent.length + endStep;
          split = void 0;
        } else {
          if (ch2 === " " && prev && prev !== " " && prev !== "\n" && prev !== "	") {
            const next = text[i7 + 1];
            if (next && next !== " " && next !== "\n" && next !== "	")
              split = i7;
          }
          if (i7 >= end) {
            if (split) {
              folds.push(split);
              end = split + endStep;
              split = void 0;
            } else if (mode === FOLD_QUOTED) {
              while (prev === " " || prev === "	") {
                prev = ch2;
                ch2 = text[i7 += 1];
                overflow = true;
              }
              const j7 = i7 > escEnd + 1 ? i7 - 2 : escStart - 1;
              if (escapedFolds[j7])
                return text;
              folds.push(j7);
              escapedFolds[j7] = true;
              end = j7 + endStep;
              split = void 0;
            } else {
              overflow = true;
            }
          }
        }
        prev = ch2;
      }
      if (overflow && onOverflow)
        onOverflow();
      if (folds.length === 0)
        return text;
      if (onFold)
        onFold();
      let res = text.slice(0, folds[0]);
      for (let i8 = 0; i8 < folds.length; ++i8) {
        const fold = folds[i8];
        const end2 = folds[i8 + 1] || text.length;
        if (fold === 0)
          res = `
${indent}${text.slice(0, end2)}`;
        else {
          if (mode === FOLD_QUOTED && escapedFolds[fold])
            res += `${text[fold]}\\`;
          res += `
${indent}${text.slice(fold + 1, end2)}`;
        }
      }
      return res;
    }
    __name(foldFlowLines, "foldFlowLines");
    function consumeMoreIndentedLines(text, i7, indent) {
      let end = i7;
      let start = i7 + 1;
      let ch2 = text[start];
      while (ch2 === " " || ch2 === "	") {
        if (i7 < start + indent) {
          ch2 = text[++i7];
        } else {
          do {
            ch2 = text[++i7];
          } while (ch2 && ch2 !== "\n");
          end = i7;
          start = i7 + 1;
          ch2 = text[start];
        }
      }
      return end;
    }
    __name(consumeMoreIndentedLines, "consumeMoreIndentedLines");
    exports.FOLD_BLOCK = FOLD_BLOCK;
    exports.FOLD_FLOW = FOLD_FLOW;
    exports.FOLD_QUOTED = FOLD_QUOTED;
    exports.foldFlowLines = foldFlowLines;
  }
});

// ../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/stringify/stringifyString.js
var require_stringifyString = __commonJS({
  "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/stringify/stringifyString.js"(exports) {
    init_import_meta_url();
    var Scalar = require_Scalar();
    var foldFlowLines = require_foldFlowLines();
    var getFoldOptions = /* @__PURE__ */ __name((ctx, isBlock) => ({
      indentAtStart: isBlock ? ctx.indent.length : ctx.indentAtStart,
      lineWidth: ctx.options.lineWidth,
      minContentWidth: ctx.options.minContentWidth
    }), "getFoldOptions");
    var containsDocumentMarker = /* @__PURE__ */ __name((str) => /^(%|---|\.\.\.)/m.test(str), "containsDocumentMarker");
    function lineLengthOverLimit(str, lineWidth, indentLength) {
      if (!lineWidth || lineWidth < 0)
        return false;
      const limit2 = lineWidth - indentLength;
      const strLen = str.length;
      if (strLen <= limit2)
        return false;
      for (let i7 = 0, start = 0; i7 < strLen; ++i7) {
        if (str[i7] === "\n") {
          if (i7 - start > limit2)
            return true;
          start = i7 + 1;
          if (strLen - start <= limit2)
            return false;
        }
      }
      return true;
    }
    __name(lineLengthOverLimit, "lineLengthOverLimit");
    function doubleQuotedString(value, ctx) {
      const json = JSON.stringify(value);
      if (ctx.options.doubleQuotedAsJSON)
        return json;
      const { implicitKey } = ctx;
      const minMultiLineLength = ctx.options.doubleQuotedMinMultiLineLength;
      const indent = ctx.indent || (containsDocumentMarker(value) ? "  " : "");
      let str = "";
      let start = 0;
      for (let i7 = 0, ch2 = json[i7]; ch2; ch2 = json[++i7]) {
        if (ch2 === " " && json[i7 + 1] === "\\" && json[i7 + 2] === "n") {
          str += json.slice(start, i7) + "\\ ";
          i7 += 1;
          start = i7;
          ch2 = "\\";
        }
        if (ch2 === "\\")
          switch (json[i7 + 1]) {
            case "u":
              {
                str += json.slice(start, i7);
                const code = json.substr(i7 + 2, 4);
                switch (code) {
                  case "0000":
                    str += "\\0";
                    break;
                  case "0007":
                    str += "\\a";
                    break;
                  case "000b":
                    str += "\\v";
                    break;
                  case "001b":
                    str += "\\e";
                    break;
                  case "0085":
                    str += "\\N";
                    break;
                  case "00a0":
                    str += "\\_";
                    break;
                  case "2028":
                    str += "\\L";
                    break;
                  case "2029":
                    str += "\\P";
                    break;
                  default:
                    if (code.substr(0, 2) === "00")
                      str += "\\x" + code.substr(2);
                    else
                      str += json.substr(i7, 6);
                }
                i7 += 5;
                start = i7 + 1;
              }
              break;
            case "n":
              if (implicitKey || json[i7 + 2] === '"' || json.length < minMultiLineLength) {
                i7 += 1;
              } else {
                str += json.slice(start, i7) + "\n\n";
                while (json[i7 + 2] === "\\" && json[i7 + 3] === "n" && json[i7 + 4] !== '"') {
                  str += "\n";
                  i7 += 2;
                }
                str += indent;
                if (json[i7 + 2] === " ")
                  str += "\\";
                i7 += 1;
                start = i7 + 1;
              }
              break;
            default:
              i7 += 1;
          }
      }
      str = start ? str + json.slice(start) : json;
      return implicitKey ? str : foldFlowLines.foldFlowLines(str, indent, foldFlowLines.FOLD_QUOTED, getFoldOptions(ctx, false));
    }
    __name(doubleQuotedString, "doubleQuotedString");
    function singleQuotedString(value, ctx) {
      if (ctx.options.singleQuote === false || ctx.implicitKey && value.includes("\n") || /[ \t]\n|\n[ \t]/.test(value))
        return doubleQuotedString(value, ctx);
      const indent = ctx.indent || (containsDocumentMarker(value) ? "  " : "");
      const res = "'" + value.replace(/'/g, "''").replace(/\n+/g, `$&
${indent}`) + "'";
      return ctx.implicitKey ? res : foldFlowLines.foldFlowLines(res, indent, foldFlowLines.FOLD_FLOW, getFoldOptions(ctx, false));
    }
    __name(singleQuotedString, "singleQuotedString");
    function quotedString(value, ctx) {
      const { singleQuote } = ctx.options;
      let qs;
      if (singleQuote === false)
        qs = doubleQuotedString;
      else {
        const hasDouble = value.includes('"');
        const hasSingle = value.includes("'");
        if (hasDouble && !hasSingle)
          qs = singleQuotedString;
        else if (hasSingle && !hasDouble)
          qs = doubleQuotedString;
        else
          qs = singleQuote ? singleQuotedString : doubleQuotedString;
      }
      return qs(value, ctx);
    }
    __name(quotedString, "quotedString");
    var blockEndNewlines;
    try {
      blockEndNewlines = new RegExp("(^|(?<!\n))\n+(?!\n|$)", "g");
    } catch {
      blockEndNewlines = /\n+(?!\n|$)/g;
    }
    function blockString({ comment, type, value }, ctx, onComment, onChompKeep) {
      const { blockQuote, commentString, lineWidth } = ctx.options;
      if (!blockQuote || /\n[\t ]+$/.test(value)) {
        return quotedString(value, ctx);
      }
      const indent = ctx.indent || (ctx.forceBlockIndent || containsDocumentMarker(value) ? "  " : "");
      const literal = blockQuote === "literal" ? true : blockQuote === "folded" || type === Scalar.Scalar.BLOCK_FOLDED ? false : type === Scalar.Scalar.BLOCK_LITERAL ? true : !lineLengthOverLimit(value, lineWidth, indent.length);
      if (!value)
        return literal ? "|\n" : ">\n";
      let chomp;
      let endStart;
      for (endStart = value.length; endStart > 0; --endStart) {
        const ch2 = value[endStart - 1];
        if (ch2 !== "\n" && ch2 !== "	" && ch2 !== " ")
          break;
      }
      let end = value.substring(endStart);
      const endNlPos = end.indexOf("\n");
      if (endNlPos === -1) {
        chomp = "-";
      } else if (value === end || endNlPos !== end.length - 1) {
        chomp = "+";
        if (onChompKeep)
          onChompKeep();
      } else {
        chomp = "";
      }
      if (end) {
        value = value.slice(0, -end.length);
        if (end[end.length - 1] === "\n")
          end = end.slice(0, -1);
        end = end.replace(blockEndNewlines, `$&${indent}`);
      }
      let startWithSpace = false;
      let startEnd;
      let startNlPos = -1;
      for (startEnd = 0; startEnd < value.length; ++startEnd) {
        const ch2 = value[startEnd];
        if (ch2 === " ")
          startWithSpace = true;
        else if (ch2 === "\n")
          startNlPos = startEnd;
        else
          break;
      }
      let start = value.substring(0, startNlPos < startEnd ? startNlPos + 1 : startEnd);
      if (start) {
        value = value.substring(start.length);
        start = start.replace(/\n+/g, `$&${indent}`);
      }
      const indentSize = indent ? "2" : "1";
      let header = (startWithSpace ? indentSize : "") + chomp;
      if (comment) {
        header += " " + commentString(comment.replace(/ ?[\r\n]+/g, " "));
        if (onComment)
          onComment();
      }
      if (!literal) {
        const foldedValue = value.replace(/\n+/g, "\n$&").replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, "$1$2").replace(/\n+/g, `$&${indent}`);
        let literalFallback = false;
        const foldOptions = getFoldOptions(ctx, true);
        if (blockQuote !== "folded" && type !== Scalar.Scalar.BLOCK_FOLDED) {
          foldOptions.onOverflow = () => {
            literalFallback = true;
          };
        }
        const body = foldFlowLines.foldFlowLines(`${start}${foldedValue}${end}`, indent, foldFlowLines.FOLD_BLOCK, foldOptions);
        if (!literalFallback)
          return `>${header}
${indent}${body}`;
      }
      value = value.replace(/\n+/g, `$&${indent}`);
      return `|${header}
${indent}${start}${value}${end}`;
    }
    __name(blockString, "blockString");
    function plainString(item, ctx, onComment, onChompKeep) {
      const { type, value } = item;
      const { actualString, implicitKey, indent, indentStep, inFlow } = ctx;
      if (implicitKey && value.includes("\n") || inFlow && /[[\]{},]/.test(value)) {
        return quotedString(value, ctx);
      }
      if (/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(value)) {
        return implicitKey || inFlow || !value.includes("\n") ? quotedString(value, ctx) : blockString(item, ctx, onComment, onChompKeep);
      }
      if (!implicitKey && !inFlow && type !== Scalar.Scalar.PLAIN && value.includes("\n")) {
        return blockString(item, ctx, onComment, onChompKeep);
      }
      if (containsDocumentMarker(value)) {
        if (indent === "") {
          ctx.forceBlockIndent = true;
          return blockString(item, ctx, onComment, onChompKeep);
        } else if (implicitKey && indent === indentStep) {
          return quotedString(value, ctx);
        }
      }
      const str = value.replace(/\n+/g, `$&
${indent}`);
      if (actualString) {
        const test = /* @__PURE__ */ __name((tag) => tag.default && tag.tag !== "tag:yaml.org,2002:str" && tag.test?.test(str), "test");
        const { compat, tags } = ctx.doc.schema;
        if (tags.some(test) || compat?.some(test))
          return quotedString(value, ctx);
      }
      return implicitKey ? str : foldFlowLines.foldFlowLines(str, indent, foldFlowLines.FOLD_FLOW, getFoldOptions(ctx, false));
    }
    __name(plainString, "plainString");
    function stringifyString(item, ctx, onComment, onChompKeep) {
      const { implicitKey, inFlow } = ctx;
      const ss = typeof item.value === "string" ? item : Object.assign({}, item, { value: String(item.value) });
      let { type } = item;
      if (type !== Scalar.Scalar.QUOTE_DOUBLE) {
        if (/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(ss.value))
          type = Scalar.Scalar.QUOTE_DOUBLE;
      }
      const _stringify = /* @__PURE__ */ __name((_type) => {
        switch (_type) {
          case Scalar.Scalar.BLOCK_FOLDED:
          case Scalar.Scalar.BLOCK_LITERAL:
            return implicitKey || inFlow ? quotedString(ss.value, ctx) : blockString(ss, ctx, onComment, onChompKeep);
          case Scalar.Scalar.QUOTE_DOUBLE:
            return doubleQuotedString(ss.value, ctx);
          case Scalar.Scalar.QUOTE_SINGLE:
            return singleQuotedString(ss.value, ctx);
          case Scalar.Scalar.PLAIN:
            return plainString(ss, ctx, onComment, onChompKeep);
          default:
            return null;
        }
      }, "_stringify");
      let res = _stringify(type);
      if (res === null) {
        const { defaultKeyType, defaultStringType } = ctx.options;
        const t13 = implicitKey && defaultKeyType || defaultStringType;
        res = _stringify(t13);
        if (res === null)
          throw new Error(`Unsupported default string type ${t13}`);
      }
      return res;
    }
    __name(stringifyString, "stringifyString");
    exports.stringifyString = stringifyString;
  }
});

// ../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/stringify/stringify.js
var require_stringify = __commonJS({
  "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/stringify/stringify.js"(exports) {
    init_import_meta_url();
    var anchors = require_anchors();
    var identity = require_identity();
    var stringifyComment = require_stringifyComment();
    var stringifyString = require_stringifyString();
    function createStringifyContext(doc, options) {
      const opt = Object.assign({
        blockQuote: true,
        commentString: stringifyComment.stringifyComment,
        defaultKeyType: null,
        defaultStringType: "PLAIN",
        directives: null,
        doubleQuotedAsJSON: false,
        doubleQuotedMinMultiLineLength: 40,
        falseStr: "false",
        flowCollectionPadding: true,
        indentSeq: true,
        lineWidth: 80,
        minContentWidth: 20,
        nullStr: "null",
        simpleKeys: false,
        singleQuote: null,
        trueStr: "true",
        verifyAliasOrder: true
      }, doc.schema.toStringOptions, options);
      let inFlow;
      switch (opt.collectionStyle) {
        case "block":
          inFlow = false;
          break;
        case "flow":
          inFlow = true;
          break;
        default:
          inFlow = null;
      }
      return {
        anchors: /* @__PURE__ */ new Set(),
        doc,
        flowCollectionPadding: opt.flowCollectionPadding ? " " : "",
        indent: "",
        indentStep: typeof opt.indent === "number" ? " ".repeat(opt.indent) : "  ",
        inFlow,
        options: opt
      };
    }
    __name(createStringifyContext, "createStringifyContext");
    function getTagObject(tags, item) {
      if (item.tag) {
        const match3 = tags.filter((t13) => t13.tag === item.tag);
        if (match3.length > 0)
          return match3.find((t13) => t13.format === item.format) ?? match3[0];
      }
      let tagObj = void 0;
      let obj;
      if (identity.isScalar(item)) {
        obj = item.value;
        let match3 = tags.filter((t13) => t13.identify?.(obj));
        if (match3.length > 1) {
          const testMatch = match3.filter((t13) => t13.test);
          if (testMatch.length > 0)
            match3 = testMatch;
        }
        tagObj = match3.find((t13) => t13.format === item.format) ?? match3.find((t13) => !t13.format);
      } else {
        obj = item;
        tagObj = tags.find((t13) => t13.nodeClass && obj instanceof t13.nodeClass);
      }
      if (!tagObj) {
        const name2 = obj?.constructor?.name ?? (obj === null ? "null" : typeof obj);
        throw new Error(`Tag not resolved for ${name2} value`);
      }
      return tagObj;
    }
    __name(getTagObject, "getTagObject");
    function stringifyProps(node2, tagObj, { anchors: anchors$1, doc }) {
      if (!doc.directives)
        return "";
      const props = [];
      const anchor = (identity.isScalar(node2) || identity.isCollection(node2)) && node2.anchor;
      if (anchor && anchors.anchorIsValid(anchor)) {
        anchors$1.add(anchor);
        props.push(`&${anchor}`);
      }
      const tag = node2.tag ?? (tagObj.default ? null : tagObj.tag);
      if (tag)
        props.push(doc.directives.tagString(tag));
      return props.join(" ");
    }
    __name(stringifyProps, "stringifyProps");
    function stringify4(item, ctx, onComment, onChompKeep) {
      if (identity.isPair(item))
        return item.toString(ctx, onComment, onChompKeep);
      if (identity.isAlias(item)) {
        if (ctx.doc.directives)
          return item.toString(ctx);
        if (ctx.resolvedAliases?.has(item)) {
          throw new TypeError(`Cannot stringify circular structure without alias nodes`);
        } else {
          if (ctx.resolvedAliases)
            ctx.resolvedAliases.add(item);
          else
            ctx.resolvedAliases = /* @__PURE__ */ new Set([item]);
          item = item.resolve(ctx.doc);
        }
      }
      let tagObj = void 0;
      const node2 = identity.isNode(item) ? item : ctx.doc.createNode(item, { onTagObj: /* @__PURE__ */ __name((o7) => tagObj = o7, "onTagObj") });
      tagObj ?? (tagObj = getTagObject(ctx.doc.schema.tags, node2));
      const props = stringifyProps(node2, tagObj, ctx);
      if (props.length > 0)
        ctx.indentAtStart = (ctx.indentAtStart ?? 0) + props.length + 1;
      const str = typeof tagObj.stringify === "function" ? tagObj.stringify(node2, ctx, onComment, onChompKeep) : identity.isScalar(node2) ? stringifyString.stringifyString(node2, ctx, onComment, onChompKeep) : node2.toString(ctx, onComment, onChompKeep);
      if (!props)
        return str;
      return identity.isScalar(node2) || str[0] === "{" || str[0] === "[" ? `${props} ${str}` : `${props}
${ctx.indent}${str}`;
    }
    __name(stringify4, "stringify");
    exports.createStringifyContext = createStringifyContext;
    exports.stringify = stringify4;
  }
});

// ../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/stringify/stringifyPair.js
var require_stringifyPair = __commonJS({
  "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/stringify/stringifyPair.js"(exports) {
    init_import_meta_url();
    var identity = require_identity();
    var Scalar = require_Scalar();
    var stringify4 = require_stringify();
    var stringifyComment = require_stringifyComment();
    function stringifyPair({ key, value }, ctx, onComment, onChompKeep) {
      const { allNullValues, doc, indent, indentStep, options: { commentString, indentSeq, simpleKeys } } = ctx;
      let keyComment = identity.isNode(key) && key.comment || null;
      if (simpleKeys) {
        if (keyComment) {
          throw new Error("With simple keys, key nodes cannot have comments");
        }
        if (identity.isCollection(key) || !identity.isNode(key) && typeof key === "object") {
          const msg = "With simple keys, collection cannot be used as a key value";
          throw new Error(msg);
        }
      }
      let explicitKey = !simpleKeys && (!key || keyComment && value == null && !ctx.inFlow || identity.isCollection(key) || (identity.isScalar(key) ? key.type === Scalar.Scalar.BLOCK_FOLDED || key.type === Scalar.Scalar.BLOCK_LITERAL : typeof key === "object"));
      ctx = Object.assign({}, ctx, {
        allNullValues: false,
        implicitKey: !explicitKey && (simpleKeys || !allNullValues),
        indent: indent + indentStep
      });
      let keyCommentDone = false;
      let chompKeep = false;
      let str = stringify4.stringify(key, ctx, () => keyCommentDone = true, () => chompKeep = true);
      if (!explicitKey && !ctx.inFlow && str.length > 1024) {
        if (simpleKeys)
          throw new Error("With simple keys, single line scalar must not span more than 1024 characters");
        explicitKey = true;
      }
      if (ctx.inFlow) {
        if (allNullValues || value == null) {
          if (keyCommentDone && onComment)
            onComment();
          return str === "" ? "?" : explicitKey ? `? ${str}` : str;
        }
      } else if (allNullValues && !simpleKeys || value == null && explicitKey) {
        str = `? ${str}`;
        if (keyComment && !keyCommentDone) {
          str += stringifyComment.lineComment(str, ctx.indent, commentString(keyComment));
        } else if (chompKeep && onChompKeep)
          onChompKeep();
        return str;
      }
      if (keyCommentDone)
        keyComment = null;
      if (explicitKey) {
        if (keyComment)
          str += stringifyComment.lineComment(str, ctx.indent, commentString(keyComment));
        str = `? ${str}
${indent}:`;
      } else {
        str = `${str}:`;
        if (keyComment)
          str += stringifyComment.lineComment(str, ctx.indent, commentString(keyComment));
      }
      let vsb, vcb, valueComment;
      if (identity.isNode(value)) {
        vsb = !!value.spaceBefore;
        vcb = value.commentBefore;
        valueComment = value.comment;
      } else {
        vsb = false;
        vcb = null;
        valueComment = null;
        if (value && typeof value === "object")
          value = doc.createNode(value);
      }
      ctx.implicitKey = false;
      if (!explicitKey && !keyComment && identity.isScalar(value))
        ctx.indentAtStart = str.length + 1;
      chompKeep = false;
      if (!indentSeq && indentStep.length >= 2 && !ctx.inFlow && !explicitKey && identity.isSeq(value) && !value.flow && !value.tag && !value.anchor) {
        ctx.indent = ctx.indent.substring(2);
      }
      let valueCommentDone = false;
      const valueStr = stringify4.stringify(value, ctx, () => valueCommentDone = true, () => chompKeep = true);
      let ws = " ";
      if (keyComment || vsb || vcb) {
        ws = vsb ? "\n" : "";
        if (vcb) {
          const cs2 = commentString(vcb);
          ws += `
${stringifyComment.indentComment(cs2, ctx.indent)}`;
        }
        if (valueStr === "" && !ctx.inFlow) {
          if (ws === "\n")
            ws = "\n\n";
        } else {
          ws += `
${ctx.indent}`;
        }
      } else if (!explicitKey && identity.isCollection(value)) {
        const vs0 = valueStr[0];
        const nl0 = valueStr.indexOf("\n");
        const hasNewline = nl0 !== -1;
        const flow = ctx.inFlow ?? value.flow ?? value.items.length === 0;
        if (hasNewline || !flow) {
          let hasPropsLine = false;
          if (hasNewline && (vs0 === "&" || vs0 === "!")) {
            let sp0 = valueStr.indexOf(" ");
            if (vs0 === "&" && sp0 !== -1 && sp0 < nl0 && valueStr[sp0 + 1] === "!") {
              sp0 = valueStr.indexOf(" ", sp0 + 1);
            }
            if (sp0 === -1 || nl0 < sp0)
              hasPropsLine = true;
          }
          if (!hasPropsLine)
            ws = `
${ctx.indent}`;
        }
      } else if (valueStr === "" || valueStr[0] === "\n") {
        ws = "";
      }
      str += ws + valueStr;
      if (ctx.inFlow) {
        if (valueCommentDone && onComment)
          onComment();
      } else if (valueComment && !valueCommentDone) {
        str += stringifyComment.lineComment(str, ctx.indent, commentString(valueComment));
      } else if (chompKeep && onChompKeep) {
        onChompKeep();
      }
      return str;
    }
    __name(stringifyPair, "stringifyPair");
    exports.stringifyPair = stringifyPair;
  }
});

// ../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/log.js
var require_log = __commonJS({
  "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/log.js"(exports) {
    init_import_meta_url();
    var node_process = __require("process");
    function debug2(logLevel, ...messages) {
      if (logLevel === "debug")
        console.log(...messages);
    }
    __name(debug2, "debug");
    function warn2(logLevel, warning) {
      if (logLevel === "debug" || logLevel === "warn") {
        if (typeof node_process.emitWarning === "function")
          node_process.emitWarning(warning);
        else
          console.warn(warning);
      }
    }
    __name(warn2, "warn");
    exports.debug = debug2;
    exports.warn = warn2;
  }
});

// ../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/schema/yaml-1.1/merge.js
var require_merge = __commonJS({
  "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/schema/yaml-1.1/merge.js"(exports) {
    init_import_meta_url();
    var identity = require_identity();
    var Scalar = require_Scalar();
    var MERGE_KEY = "<<";
    var merge = {
      identify: /* @__PURE__ */ __name((value) => value === MERGE_KEY || typeof value === "symbol" && value.description === MERGE_KEY, "identify"),
      default: "key",
      tag: "tag:yaml.org,2002:merge",
      test: /^<<$/,
      resolve: /* @__PURE__ */ __name(() => Object.assign(new Scalar.Scalar(Symbol(MERGE_KEY)), {
        addToJSMap: addMergeToJSMap
      }), "resolve"),
      stringify: /* @__PURE__ */ __name(() => MERGE_KEY, "stringify")
    };
    var isMergeKey = /* @__PURE__ */ __name((ctx, key) => (merge.identify(key) || identity.isScalar(key) && (!key.type || key.type === Scalar.Scalar.PLAIN) && merge.identify(key.value)) && ctx?.doc.schema.tags.some((tag) => tag.tag === merge.tag && tag.default), "isMergeKey");
    function addMergeToJSMap(ctx, map2, value) {
      value = ctx && identity.isAlias(value) ? value.resolve(ctx.doc) : value;
      if (identity.isSeq(value))
        for (const it2 of value.items)
          mergeValue(ctx, map2, it2);
      else if (Array.isArray(value))
        for (const it2 of value)
          mergeValue(ctx, map2, it2);
      else
        mergeValue(ctx, map2, value);
    }
    __name(addMergeToJSMap, "addMergeToJSMap");
    function mergeValue(ctx, map2, value) {
      const source = ctx && identity.isAlias(value) ? value.resolve(ctx.doc) : value;
      if (!identity.isMap(source))
        throw new Error("Merge sources must be maps or map aliases");
      const srcMap = source.toJSON(null, ctx, Map);
      for (const [key, value2] of srcMap) {
        if (map2 instanceof Map) {
          if (!map2.has(key))
            map2.set(key, value2);
        } else if (map2 instanceof Set) {
          map2.add(key);
        } else if (!Object.prototype.hasOwnProperty.call(map2, key)) {
          Object.defineProperty(map2, key, {
            value: value2,
            writable: true,
            enumerable: true,
            configurable: true
          });
        }
      }
      return map2;
    }
    __name(mergeValue, "mergeValue");
    exports.addMergeToJSMap = addMergeToJSMap;
    exports.isMergeKey = isMergeKey;
    exports.merge = merge;
  }
});

// ../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/nodes/addPairToJSMap.js
var require_addPairToJSMap = __commonJS({
  "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/nodes/addPairToJSMap.js"(exports) {
    init_import_meta_url();
    var log2 = require_log();
    var merge = require_merge();
    var stringify4 = require_stringify();
    var identity = require_identity();
    var toJS = require_toJS();
    function addPairToJSMap(ctx, map2, { key, value }) {
      if (identity.isNode(key) && key.addToJSMap)
        key.addToJSMap(ctx, map2, value);
      else if (merge.isMergeKey(ctx, key))
        merge.addMergeToJSMap(ctx, map2, value);
      else {
        const jsKey = toJS.toJS(key, "", ctx);
        if (map2 instanceof Map) {
          map2.set(jsKey, toJS.toJS(value, jsKey, ctx));
        } else if (map2 instanceof Set) {
          map2.add(jsKey);
        } else {
          const stringKey = stringifyKey(key, jsKey, ctx);
          const jsValue = toJS.toJS(value, stringKey, ctx);
          if (stringKey in map2)
            Object.defineProperty(map2, stringKey, {
              value: jsValue,
              writable: true,
              enumerable: true,
              configurable: true
            });
          else
            map2[stringKey] = jsValue;
        }
      }
      return map2;
    }
    __name(addPairToJSMap, "addPairToJSMap");
    function stringifyKey(key, jsKey, ctx) {
      if (jsKey === null)
        return "";
      if (typeof jsKey !== "object")
        return String(jsKey);
      if (identity.isNode(key) && ctx?.doc) {
        const strCtx = stringify4.createStringifyContext(ctx.doc, {});
        strCtx.anchors = /* @__PURE__ */ new Set();
        for (const node2 of ctx.anchors.keys())
          strCtx.anchors.add(node2.anchor);
        strCtx.inFlow = true;
        strCtx.inStringifyKey = true;
        const strKey = key.toString(strCtx);
        if (!ctx.mapKeyWarned) {
          let jsonStr = JSON.stringify(strKey);
          if (jsonStr.length > 40)
            jsonStr = jsonStr.substring(0, 36) + '..."';
          log2.warn(ctx.doc.options.logLevel, `Keys with collection values will be stringified due to JS Object restrictions: ${jsonStr}. Set mapAsMap: true to use object keys.`);
          ctx.mapKeyWarned = true;
        }
        return strKey;
      }
      return JSON.stringify(jsKey);
    }
    __name(stringifyKey, "stringifyKey");
    exports.addPairToJSMap = addPairToJSMap;
  }
});

// ../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/nodes/Pair.js
var require_Pair = __commonJS({
  "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/nodes/Pair.js"(exports) {
    init_import_meta_url();
    var createNode = require_createNode();
    var stringifyPair = require_stringifyPair();
    var addPairToJSMap = require_addPairToJSMap();
    var identity = require_identity();
    function createPair(key, value, ctx) {
      const k7 = createNode.createNode(key, void 0, ctx);
      const v8 = createNode.createNode(value, void 0, ctx);
      return new Pair(k7, v8);
    }
    __name(createPair, "createPair");
    var Pair = class _Pair {
      static {
        __name(this, "Pair");
      }
      constructor(key, value = null) {
        Object.defineProperty(this, identity.NODE_TYPE, { value: identity.PAIR });
        this.key = key;
        this.value = value;
      }
      clone(schema) {
        let { key, value } = this;
        if (identity.isNode(key))
          key = key.clone(schema);
        if (identity.isNode(value))
          value = value.clone(schema);
        return new _Pair(key, value);
      }
      toJSON(_5, ctx) {
        const pair = ctx?.mapAsMap ? /* @__PURE__ */ new Map() : {};
        return addPairToJSMap.addPairToJSMap(ctx, pair, this);
      }
      toString(ctx, onComment, onChompKeep) {
        return ctx?.doc ? stringifyPair.stringifyPair(this, ctx, onComment, onChompKeep) : JSON.stringify(this);
      }
    };
    exports.Pair = Pair;
    exports.createPair = createPair;
  }
});

// ../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/stringify/stringifyCollection.js
var require_stringifyCollection = __commonJS({
  "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/stringify/stringifyCollection.js"(exports) {
    init_import_meta_url();
    var identity = require_identity();
    var stringify4 = require_stringify();
    var stringifyComment = require_stringifyComment();
    function stringifyCollection(collection, ctx, options) {
      const flow = ctx.inFlow ?? collection.flow;
      const stringify5 = flow ? stringifyFlowCollection : stringifyBlockCollection;
      return stringify5(collection, ctx, options);
    }
    __name(stringifyCollection, "stringifyCollection");
    function stringifyBlockCollection({ comment, items }, ctx, { blockItemPrefix, flowChars, itemIndent, onChompKeep, onComment }) {
      const { indent, options: { commentString } } = ctx;
      const itemCtx = Object.assign({}, ctx, { indent: itemIndent, type: null });
      let chompKeep = false;
      const lines = [];
      for (let i7 = 0; i7 < items.length; ++i7) {
        const item = items[i7];
        let comment2 = null;
        if (identity.isNode(item)) {
          if (!chompKeep && item.spaceBefore)
            lines.push("");
          addCommentBefore(ctx, lines, item.commentBefore, chompKeep);
          if (item.comment)
            comment2 = item.comment;
        } else if (identity.isPair(item)) {
          const ik = identity.isNode(item.key) ? item.key : null;
          if (ik) {
            if (!chompKeep && ik.spaceBefore)
              lines.push("");
            addCommentBefore(ctx, lines, ik.commentBefore, chompKeep);
          }
        }
        chompKeep = false;
        let str2 = stringify4.stringify(item, itemCtx, () => comment2 = null, () => chompKeep = true);
        if (comment2)
          str2 += stringifyComment.lineComment(str2, itemIndent, commentString(comment2));
        if (chompKeep && comment2)
          chompKeep = false;
        lines.push(blockItemPrefix + str2);
      }
      let str;
      if (lines.length === 0) {
        str = flowChars.start + flowChars.end;
      } else {
        str = lines[0];
        for (let i7 = 1; i7 < lines.length; ++i7) {
          const line = lines[i7];
          str += line ? `
${indent}${line}` : "\n";
        }
      }
      if (comment) {
        str += "\n" + stringifyComment.indentComment(commentString(comment), indent);
        if (onComment)
          onComment();
      } else if (chompKeep && onChompKeep)
        onChompKeep();
      return str;
    }
    __name(stringifyBlockCollection, "stringifyBlockCollection");
    function stringifyFlowCollection({ items }, ctx, { flowChars, itemIndent }) {
      const { indent, indentStep, flowCollectionPadding: fcPadding, options: { commentString } } = ctx;
      itemIndent += indentStep;
      const itemCtx = Object.assign({}, ctx, {
        indent: itemIndent,
        inFlow: true,
        type: null
      });
      let reqNewline = false;
      let linesAtValue = 0;
      const lines = [];
      for (let i7 = 0; i7 < items.length; ++i7) {
        const item = items[i7];
        let comment = null;
        if (identity.isNode(item)) {
          if (item.spaceBefore)
            lines.push("");
          addCommentBefore(ctx, lines, item.commentBefore, false);
          if (item.comment)
            comment = item.comment;
        } else if (identity.isPair(item)) {
          const ik = identity.isNode(item.key) ? item.key : null;
          if (ik) {
            if (ik.spaceBefore)
              lines.push("");
            addCommentBefore(ctx, lines, ik.commentBefore, false);
            if (ik.comment)
              reqNewline = true;
          }
          const iv = identity.isNode(item.value) ? item.value : null;
          if (iv) {
            if (iv.comment)
              comment = iv.comment;
            if (iv.commentBefore)
              reqNewline = true;
          } else if (item.value == null && ik?.comment) {
            comment = ik.comment;
          }
        }
        if (comment)
          reqNewline = true;
        let str = stringify4.stringify(item, itemCtx, () => comment = null);
        if (i7 < items.length - 1)
          str += ",";
        if (comment)
          str += stringifyComment.lineComment(str, itemIndent, commentString(comment));
        if (!reqNewline && (lines.length > linesAtValue || str.includes("\n")))
          reqNewline = true;
        lines.push(str);
        linesAtValue = lines.length;
      }
      const { start, end } = flowChars;
      if (lines.length === 0) {
        return start + end;
      } else {
        if (!reqNewline) {
          const len = lines.reduce((sum, line) => sum + line.length + 2, 2);
          reqNewline = ctx.options.lineWidth > 0 && len > ctx.options.lineWidth;
        }
        if (reqNewline) {
          let str = start;
          for (const line of lines)
            str += line ? `
${indentStep}${indent}${line}` : "\n";
          return `${str}
${indent}${end}`;
        } else {
          return `${start}${fcPadding}${lines.join(" ")}${fcPadding}${end}`;
        }
      }
    }
    __name(stringifyFlowCollection, "stringifyFlowCollection");
    function addCommentBefore({ indent, options: { commentString } }, lines, comment, chompKeep) {
      if (comment && chompKeep)
        comment = comment.replace(/^\n+/, "");
      if (comment) {
        const ic = stringifyComment.indentComment(commentString(comment), indent);
        lines.push(ic.trimStart());
      }
    }
    __name(addCommentBefore, "addCommentBefore");
    exports.stringifyCollection = stringifyCollection;
  }
});

// ../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/nodes/YAMLMap.js
var require_YAMLMap = __commonJS({
  "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/nodes/YAMLMap.js"(exports) {
    init_import_meta_url();
    var stringifyCollection = require_stringifyCollection();
    var addPairToJSMap = require_addPairToJSMap();
    var Collection = require_Collection();
    var identity = require_identity();
    var Pair = require_Pair();
    var Scalar = require_Scalar();
    function findPair(items, key) {
      const k7 = identity.isScalar(key) ? key.value : key;
      for (const it2 of items) {
        if (identity.isPair(it2)) {
          if (it2.key === key || it2.key === k7)
            return it2;
          if (identity.isScalar(it2.key) && it2.key.value === k7)
            return it2;
        }
      }
      return void 0;
    }
    __name(findPair, "findPair");
    var YAMLMap = class extends Collection.Collection {
      static {
        __name(this, "YAMLMap");
      }
      static get tagName() {
        return "tag:yaml.org,2002:map";
      }
      constructor(schema) {
        super(identity.MAP, schema);
        this.items = [];
      }
      /**
       * A generic collection parsing method that can be extended
       * to other node classes that inherit from YAMLMap
       */
      static from(schema, obj, ctx) {
        const { keepUndefined, replacer: replacer2 } = ctx;
        const map2 = new this(schema);
        const add = /* @__PURE__ */ __name((key, value) => {
          if (typeof replacer2 === "function")
            value = replacer2.call(obj, key, value);
          else if (Array.isArray(replacer2) && !replacer2.includes(key))
            return;
          if (value !== void 0 || keepUndefined)
            map2.items.push(Pair.createPair(key, value, ctx));
        }, "add");
        if (obj instanceof Map) {
          for (const [key, value] of obj)
            add(key, value);
        } else if (obj && typeof obj === "object") {
          for (const key of Object.keys(obj))
            add(key, obj[key]);
        }
        if (typeof schema.sortMapEntries === "function") {
          map2.items.sort(schema.sortMapEntries);
        }
        return map2;
      }
      /**
       * Adds a value to the collection.
       *
       * @param overwrite - If not set `true`, using a key that is already in the
       *   collection will throw. Otherwise, overwrites the previous value.
       */
      add(pair, overwrite) {
        let _pair;
        if (identity.isPair(pair))
          _pair = pair;
        else if (!pair || typeof pair !== "object" || !("key" in pair)) {
          _pair = new Pair.Pair(pair, pair?.value);
        } else
          _pair = new Pair.Pair(pair.key, pair.value);
        const prev = findPair(this.items, _pair.key);
        const sortEntries = this.schema?.sortMapEntries;
        if (prev) {
          if (!overwrite)
            throw new Error(`Key ${_pair.key} already set`);
          if (identity.isScalar(prev.value) && Scalar.isScalarValue(_pair.value))
            prev.value.value = _pair.value;
          else
            prev.value = _pair.value;
        } else if (sortEntries) {
          const i7 = this.items.findIndex((item) => sortEntries(_pair, item) < 0);
          if (i7 === -1)
            this.items.push(_pair);
          else
            this.items.splice(i7, 0, _pair);
        } else {
          this.items.push(_pair);
        }
      }
      delete(key) {
        const it2 = findPair(this.items, key);
        if (!it2)
          return false;
        const del = this.items.splice(this.items.indexOf(it2), 1);
        return del.length > 0;
      }
      get(key, keepScalar) {
        const it2 = findPair(this.items, key);
        const node2 = it2?.value;
        return (!keepScalar && identity.isScalar(node2) ? node2.value : node2) ?? void 0;
      }
      has(key) {
        return !!findPair(this.items, key);
      }
      set(key, value) {
        this.add(new Pair.Pair(key, value), true);
      }
      /**
       * @param ctx - Conversion context, originally set in Document#toJS()
       * @param {Class} Type - If set, forces the returned collection type
       * @returns Instance of Type, Map, or Object
       */
      toJSON(_5, ctx, Type2) {
        const map2 = Type2 ? new Type2() : ctx?.mapAsMap ? /* @__PURE__ */ new Map() : {};
        if (ctx?.onCreate)
          ctx.onCreate(map2);
        for (const item of this.items)
          addPairToJSMap.addPairToJSMap(ctx, map2, item);
        return map2;
      }
      toString(ctx, onComment, onChompKeep) {
        if (!ctx)
          return JSON.stringify(this);
        for (const item of this.items) {
          if (!identity.isPair(item))
            throw new Error(`Map items must all be pairs; found ${JSON.stringify(item)} instead`);
        }
        if (!ctx.allNullValues && this.hasAllNullValues(false))
          ctx = Object.assign({}, ctx, { allNullValues: true });
        return stringifyCollection.stringifyCollection(this, ctx, {
          blockItemPrefix: "",
          flowChars: { start: "{", end: "}" },
          itemIndent: ctx.indent || "",
          onChompKeep,
          onComment
        });
      }
    };
    exports.YAMLMap = YAMLMap;
    exports.findPair = findPair;
  }
});

// ../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/schema/common/map.js
var require_map = __commonJS({
  "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/schema/common/map.js"(exports) {
    init_import_meta_url();
    var identity = require_identity();
    var YAMLMap = require_YAMLMap();
    var map2 = {
      collection: "map",
      default: true,
      nodeClass: YAMLMap.YAMLMap,
      tag: "tag:yaml.org,2002:map",
      resolve(map3, onError) {
        if (!identity.isMap(map3))
          onError("Expected a mapping for this tag");
        return map3;
      },
      createNode: /* @__PURE__ */ __name((schema, obj, ctx) => YAMLMap.YAMLMap.from(schema, obj, ctx), "createNode")
    };
    exports.map = map2;
  }
});

// ../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/nodes/YAMLSeq.js
var require_YAMLSeq = __commonJS({
  "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/nodes/YAMLSeq.js"(exports) {
    init_import_meta_url();
    var createNode = require_createNode();
    var stringifyCollection = require_stringifyCollection();
    var Collection = require_Collection();
    var identity = require_identity();
    var Scalar = require_Scalar();
    var toJS = require_toJS();
    var YAMLSeq = class extends Collection.Collection {
      static {
        __name(this, "YAMLSeq");
      }
      static get tagName() {
        return "tag:yaml.org,2002:seq";
      }
      constructor(schema) {
        super(identity.SEQ, schema);
        this.items = [];
      }
      add(value) {
        this.items.push(value);
      }
      /**
       * Removes a value from the collection.
       *
       * `key` must contain a representation of an integer for this to succeed.
       * It may be wrapped in a `Scalar`.
       *
       * @returns `true` if the item was found and removed.
       */
      delete(key) {
        const idx = asItemIndex(key);
        if (typeof idx !== "number")
          return false;
        const del = this.items.splice(idx, 1);
        return del.length > 0;
      }
      get(key, keepScalar) {
        const idx = asItemIndex(key);
        if (typeof idx !== "number")
          return void 0;
        const it2 = this.items[idx];
        return !keepScalar && identity.isScalar(it2) ? it2.value : it2;
      }
      /**
       * Checks if the collection includes a value with the key `key`.
       *
       * `key` must contain a representation of an integer for this to succeed.
       * It may be wrapped in a `Scalar`.
       */
      has(key) {
        const idx = asItemIndex(key);
        return typeof idx === "number" && idx < this.items.length;
      }
      /**
       * Sets a value in this collection. For `!!set`, `value` needs to be a
       * boolean to add/remove the item from the set.
       *
       * If `key` does not contain a representation of an integer, this will throw.
       * It may be wrapped in a `Scalar`.
       */
      set(key, value) {
        const idx = asItemIndex(key);
        if (typeof idx !== "number")
          throw new Error(`Expected a valid index, not ${key}.`);
        const prev = this.items[idx];
        if (identity.isScalar(prev) && Scalar.isScalarValue(value))
          prev.value = value;
        else
          this.items[idx] = value;
      }
      toJSON(_5, ctx) {
        const seq = [];
        if (ctx?.onCreate)
          ctx.onCreate(seq);
        let i7 = 0;
        for (const item of this.items)
          seq.push(toJS.toJS(item, String(i7++), ctx));
        return seq;
      }
      toString(ctx, onComment, onChompKeep) {
        if (!ctx)
          return JSON.stringify(this);
        return stringifyCollection.stringifyCollection(this, ctx, {
          blockItemPrefix: "- ",
          flowChars: { start: "[", end: "]" },
          itemIndent: (ctx.indent || "") + "  ",
          onChompKeep,
          onComment
        });
      }
      static from(schema, obj, ctx) {
        const { replacer: replacer2 } = ctx;
        const seq = new this(schema);
        if (obj && Symbol.iterator in Object(obj)) {
          let i7 = 0;
          for (let it2 of obj) {
            if (typeof replacer2 === "function") {
              const key = obj instanceof Set ? it2 : String(i7++);
              it2 = replacer2.call(obj, key, it2);
            }
            seq.items.push(createNode.createNode(it2, void 0, ctx));
          }
        }
        return seq;
      }
    };
    function asItemIndex(key) {
      let idx = identity.isScalar(key) ? key.value : key;
      if (idx && typeof idx === "string")
        idx = Number(idx);
      return typeof idx === "number" && Number.isInteger(idx) && idx >= 0 ? idx : null;
    }
    __name(asItemIndex, "asItemIndex");
    exports.YAMLSeq = YAMLSeq;
  }
});

// ../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/schema/common/seq.js
var require_seq = __commonJS({
  "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/schema/common/seq.js"(exports) {
    init_import_meta_url();
    var identity = require_identity();
    var YAMLSeq = require_YAMLSeq();
    var seq = {
      collection: "seq",
      default: true,
      nodeClass: YAMLSeq.YAMLSeq,
      tag: "tag:yaml.org,2002:seq",
      resolve(seq2, onError) {
        if (!identity.isSeq(seq2))
          onError("Expected a sequence for this tag");
        return seq2;
      },
      createNode: /* @__PURE__ */ __name((schema, obj, ctx) => YAMLSeq.YAMLSeq.from(schema, obj, ctx), "createNode")
    };
    exports.seq = seq;
  }
});

// ../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/schema/common/string.js
var require_string = __commonJS({
  "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/schema/common/string.js"(exports) {
    init_import_meta_url();
    var stringifyString = require_stringifyString();
    var string = {
      identify: /* @__PURE__ */ __name((value) => typeof value === "string", "identify"),
      default: true,
      tag: "tag:yaml.org,2002:str",
      resolve: /* @__PURE__ */ __name((str) => str, "resolve"),
      stringify(item, ctx, onComment, onChompKeep) {
        ctx = Object.assign({ actualString: true }, ctx);
        return stringifyString.stringifyString(item, ctx, onComment, onChompKeep);
      }
    };
    exports.string = string;
  }
});

// ../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/schema/common/null.js
var require_null = __commonJS({
  "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/schema/common/null.js"(exports) {
    init_import_meta_url();
    var Scalar = require_Scalar();
    var nullTag = {
      identify: /* @__PURE__ */ __name((value) => value == null, "identify"),
      createNode: /* @__PURE__ */ __name(() => new Scalar.Scalar(null), "createNode"),
      default: true,
      tag: "tag:yaml.org,2002:null",
      test: /^(?:~|[Nn]ull|NULL)?$/,
      resolve: /* @__PURE__ */ __name(() => new Scalar.Scalar(null), "resolve"),
      stringify: /* @__PURE__ */ __name(({ source }, ctx) => typeof source === "string" && nullTag.test.test(source) ? source : ctx.options.nullStr, "stringify")
    };
    exports.nullTag = nullTag;
  }
});

// ../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/schema/core/bool.js
var require_bool = __commonJS({
  "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/schema/core/bool.js"(exports) {
    init_import_meta_url();
    var Scalar = require_Scalar();
    var boolTag = {
      identify: /* @__PURE__ */ __name((value) => typeof value === "boolean", "identify"),
      default: true,
      tag: "tag:yaml.org,2002:bool",
      test: /^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,
      resolve: /* @__PURE__ */ __name((str) => new Scalar.Scalar(str[0] === "t" || str[0] === "T"), "resolve"),
      stringify({ source, value }, ctx) {
        if (source && boolTag.test.test(source)) {
          const sv = source[0] === "t" || source[0] === "T";
          if (value === sv)
            return source;
        }
        return value ? ctx.options.trueStr : ctx.options.falseStr;
      }
    };
    exports.boolTag = boolTag;
  }
});

// ../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/stringify/stringifyNumber.js
var require_stringifyNumber = __commonJS({
  "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/stringify/stringifyNumber.js"(exports) {
    init_import_meta_url();
    function stringifyNumber({ format: format11, minFractionDigits, tag, value }) {
      if (typeof value === "bigint")
        return String(value);
      const num = typeof value === "number" ? value : Number(value);
      if (!isFinite(num))
        return isNaN(num) ? ".nan" : num < 0 ? "-.inf" : ".inf";
      let n9 = JSON.stringify(value);
      if (!format11 && minFractionDigits && (!tag || tag === "tag:yaml.org,2002:float") && /^\d/.test(n9)) {
        let i7 = n9.indexOf(".");
        if (i7 < 0) {
          i7 = n9.length;
          n9 += ".";
        }
        let d8 = minFractionDigits - (n9.length - i7 - 1);
        while (d8-- > 0)
          n9 += "0";
      }
      return n9;
    }
    __name(stringifyNumber, "stringifyNumber");
    exports.stringifyNumber = stringifyNumber;
  }
});

// ../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/schema/core/float.js
var require_float = __commonJS({
  "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/schema/core/float.js"(exports) {
    init_import_meta_url();
    var Scalar = require_Scalar();
    var stringifyNumber = require_stringifyNumber();
    var floatNaN = {
      identify: /* @__PURE__ */ __name((value) => typeof value === "number", "identify"),
      default: true,
      tag: "tag:yaml.org,2002:float",
      test: /^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,
      resolve: /* @__PURE__ */ __name((str) => str.slice(-3).toLowerCase() === "nan" ? NaN : str[0] === "-" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY, "resolve"),
      stringify: stringifyNumber.stringifyNumber
    };
    var floatExp = {
      identify: /* @__PURE__ */ __name((value) => typeof value === "number", "identify"),
      default: true,
      tag: "tag:yaml.org,2002:float",
      format: "EXP",
      test: /^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,
      resolve: /* @__PURE__ */ __name((str) => parseFloat(str), "resolve"),
      stringify(node2) {
        const num = Number(node2.value);
        return isFinite(num) ? num.toExponential() : stringifyNumber.stringifyNumber(node2);
      }
    };
    var float = {
      identify: /* @__PURE__ */ __name((value) => typeof value === "number", "identify"),
      default: true,
      tag: "tag:yaml.org,2002:float",
      test: /^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,
      resolve(str) {
        const node2 = new Scalar.Scalar(parseFloat(str));
        const dot = str.indexOf(".");
        if (dot !== -1 && str[str.length - 1] === "0")
          node2.minFractionDigits = str.length - dot - 1;
        return node2;
      },
      stringify: stringifyNumber.stringifyNumber
    };
    exports.float = float;
    exports.floatExp = floatExp;
    exports.floatNaN = floatNaN;
  }
});

// ../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/schema/core/int.js
var require_int = __commonJS({
  "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/schema/core/int.js"(exports) {
    init_import_meta_url();
    var stringifyNumber = require_stringifyNumber();
    var intIdentify = /* @__PURE__ */ __name((value) => typeof value === "bigint" || Number.isInteger(value), "intIdentify");
    var intResolve = /* @__PURE__ */ __name((str, offset, radix, { intAsBigInt }) => intAsBigInt ? BigInt(str) : parseInt(str.substring(offset), radix), "intResolve");
    function intStringify(node2, radix, prefix) {
      const { value } = node2;
      if (intIdentify(value) && value >= 0)
        return prefix + value.toString(radix);
      return stringifyNumber.stringifyNumber(node2);
    }
    __name(intStringify, "intStringify");
    var intOct = {
      identify: /* @__PURE__ */ __name((value) => intIdentify(value) && value >= 0, "identify"),
      default: true,
      tag: "tag:yaml.org,2002:int",
      format: "OCT",
      test: /^0o[0-7]+$/,
      resolve: /* @__PURE__ */ __name((str, _onError, opt) => intResolve(str, 2, 8, opt), "resolve"),
      stringify: /* @__PURE__ */ __name((node2) => intStringify(node2, 8, "0o"), "stringify")
    };
    var int = {
      identify: intIdentify,
      default: true,
      tag: "tag:yaml.org,2002:int",
      test: /^[-+]?[0-9]+$/,
      resolve: /* @__PURE__ */ __name((str, _onError, opt) => intResolve(str, 0, 10, opt), "resolve"),
      stringify: stringifyNumber.stringifyNumber
    };
    var intHex = {
      identify: /* @__PURE__ */ __name((value) => intIdentify(value) && value >= 0, "identify"),
      default: true,
      tag: "tag:yaml.org,2002:int",
      format: "HEX",
      test: /^0x[0-9a-fA-F]+$/,
      resolve: /* @__PURE__ */ __name((str, _onError, opt) => intResolve(str, 2, 16, opt), "resolve"),
      stringify: /* @__PURE__ */ __name((node2) => intStringify(node2, 16, "0x"), "stringify")
    };
    exports.int = int;
    exports.intHex = intHex;
    exports.intOct = intOct;
  }
});

// ../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/schema/core/schema.js
var require_schema = __commonJS({
  "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/schema/core/schema.js"(exports) {
    init_import_meta_url();
    var map2 = require_map();
    var _null = require_null();
    var seq = require_seq();
    var string = require_string();
    var bool = require_bool();
    var float = require_float();
    var int = require_int();
    var schema = [
      map2.map,
      seq.seq,
      string.string,
      _null.nullTag,
      bool.boolTag,
      int.intOct,
      int.int,
      int.intHex,
      float.floatNaN,
      float.floatExp,
      float.float
    ];
    exports.schema = schema;
  }
});

// ../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/schema/json/schema.js
var require_schema2 = __commonJS({
  "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/schema/json/schema.js"(exports) {
    init_import_meta_url();
    var Scalar = require_Scalar();
    var map2 = require_map();
    var seq = require_seq();
    function intIdentify(value) {
      return typeof value === "bigint" || Number.isInteger(value);
    }
    __name(intIdentify, "intIdentify");
    var stringifyJSON = /* @__PURE__ */ __name(({ value }) => JSON.stringify(value), "stringifyJSON");
    var jsonScalars = [
      {
        identify: /* @__PURE__ */ __name((value) => typeof value === "string", "identify"),
        default: true,
        tag: "tag:yaml.org,2002:str",
        resolve: /* @__PURE__ */ __name((str) => str, "resolve"),
        stringify: stringifyJSON
      },
      {
        identify: /* @__PURE__ */ __name((value) => value == null, "identify"),
        createNode: /* @__PURE__ */ __name(() => new Scalar.Scalar(null), "createNode"),
        default: true,
        tag: "tag:yaml.org,2002:null",
        test: /^null$/,
        resolve: /* @__PURE__ */ __name(() => null, "resolve"),
        stringify: stringifyJSON
      },
      {
        identify: /* @__PURE__ */ __name((value) => typeof value === "boolean", "identify"),
        default: true,
        tag: "tag:yaml.org,2002:bool",
        test: /^true$|^false$/,
        resolve: /* @__PURE__ */ __name((str) => str === "true", "resolve"),
        stringify: stringifyJSON
      },
      {
        identify: intIdentify,
        default: true,
        tag: "tag:yaml.org,2002:int",
        test: /^-?(?:0|[1-9][0-9]*)$/,
        resolve: /* @__PURE__ */ __name((str, _onError, { intAsBigInt }) => intAsBigInt ? BigInt(str) : parseInt(str, 10), "resolve"),
        stringify: /* @__PURE__ */ __name(({ value }) => intIdentify(value) ? value.toString() : JSON.stringify(value), "stringify")
      },
      {
        identify: /* @__PURE__ */ __name((value) => typeof value === "number", "identify"),
        default: true,
        tag: "tag:yaml.org,2002:float",
        test: /^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,
        resolve: /* @__PURE__ */ __name((str) => parseFloat(str), "resolve"),
        stringify: stringifyJSON
      }
    ];
    var jsonError = {
      default: true,
      tag: "",
      test: /^/,
      resolve(str, onError) {
        onError(`Unresolved plain scalar ${JSON.stringify(str)}`);
        return str;
      }
    };
    var schema = [map2.map, seq.seq].concat(jsonScalars, jsonError);
    exports.schema = schema;
  }
});

// ../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/schema/yaml-1.1/binary.js
var require_binary = __commonJS({
  "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/schema/yaml-1.1/binary.js"(exports) {
    init_import_meta_url();
    var node_buffer = __require("buffer");
    var Scalar = require_Scalar();
    var stringifyString = require_stringifyString();
    var binary = {
      identify: /* @__PURE__ */ __name((value) => value instanceof Uint8Array, "identify"),
      // Buffer inherits from Uint8Array
      default: false,
      tag: "tag:yaml.org,2002:binary",
      /**
       * Returns a Buffer in node and an Uint8Array in browsers
       *
       * To use the resulting buffer as an image, you'll want to do something like:
       *
       *   const blob = new Blob([buffer], { type: 'image/jpeg' })
       *   document.querySelector('#photo').src = URL.createObjectURL(blob)
       */
      resolve(src, onError) {
        if (typeof node_buffer.Buffer === "function") {
          return node_buffer.Buffer.from(src, "base64");
        } else if (typeof atob === "function") {
          const str = atob(src.replace(/[\n\r]/g, ""));
          const buffer = new Uint8Array(str.length);
          for (let i7 = 0; i7 < str.length; ++i7)
            buffer[i7] = str.charCodeAt(i7);
          return buffer;
        } else {
          onError("This environment does not support reading binary tags; either Buffer or atob is required");
          return src;
        }
      },
      stringify({ comment, type, value }, ctx, onComment, onChompKeep) {
        if (!value)
          return "";
        const buf = value;
        let str;
        if (typeof node_buffer.Buffer === "function") {
          str = buf instanceof node_buffer.Buffer ? buf.toString("base64") : node_buffer.Buffer.from(buf.buffer).toString("base64");
        } else if (typeof btoa === "function") {
          let s7 = "";
          for (let i7 = 0; i7 < buf.length; ++i7)
            s7 += String.fromCharCode(buf[i7]);
          str = btoa(s7);
        } else {
          throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");
        }
        type ?? (type = Scalar.Scalar.BLOCK_LITERAL);
        if (type !== Scalar.Scalar.QUOTE_DOUBLE) {
          const lineWidth = Math.max(ctx.options.lineWidth - ctx.indent.length, ctx.options.minContentWidth);
          const n9 = Math.ceil(str.length / lineWidth);
          const lines = new Array(n9);
          for (let i7 = 0, o7 = 0; i7 < n9; ++i7, o7 += lineWidth) {
            lines[i7] = str.substr(o7, lineWidth);
          }
          str = lines.join(type === Scalar.Scalar.BLOCK_LITERAL ? "\n" : " ");
        }
        return stringifyString.stringifyString({ comment, type, value: str }, ctx, onComment, onChompKeep);
      }
    };
    exports.binary = binary;
  }
});

// ../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/schema/yaml-1.1/pairs.js
var require_pairs = __commonJS({
  "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/schema/yaml-1.1/pairs.js"(exports) {
    init_import_meta_url();
    var identity = require_identity();
    var Pair = require_Pair();
    var Scalar = require_Scalar();
    var YAMLSeq = require_YAMLSeq();
    function resolvePairs(seq, onError) {
      if (identity.isSeq(seq)) {
        for (let i7 = 0; i7 < seq.items.length; ++i7) {
          let item = seq.items[i7];
          if (identity.isPair(item))
            continue;
          else if (identity.isMap(item)) {
            if (item.items.length > 1)
              onError("Each pair must have its own sequence indicator");
            const pair = item.items[0] || new Pair.Pair(new Scalar.Scalar(null));
            if (item.commentBefore)
              pair.key.commentBefore = pair.key.commentBefore ? `${item.commentBefore}
${pair.key.commentBefore}` : item.commentBefore;
            if (item.comment) {
              const cn2 = pair.value ?? pair.key;
              cn2.comment = cn2.comment ? `${item.comment}
${cn2.comment}` : item.comment;
            }
            item = pair;
          }
          seq.items[i7] = identity.isPair(item) ? item : new Pair.Pair(item);
        }
      } else
        onError("Expected a sequence for this tag");
      return seq;
    }
    __name(resolvePairs, "resolvePairs");
    function createPairs(schema, iterable, ctx) {
      const { replacer: replacer2 } = ctx;
      const pairs2 = new YAMLSeq.YAMLSeq(schema);
      pairs2.tag = "tag:yaml.org,2002:pairs";
      let i7 = 0;
      if (iterable && Symbol.iterator in Object(iterable))
        for (let it2 of iterable) {
          if (typeof replacer2 === "function")
            it2 = replacer2.call(iterable, String(i7++), it2);
          let key, value;
          if (Array.isArray(it2)) {
            if (it2.length === 2) {
              key = it2[0];
              value = it2[1];
            } else
              throw new TypeError(`Expected [key, value] tuple: ${it2}`);
          } else if (it2 && it2 instanceof Object) {
            const keys = Object.keys(it2);
            if (keys.length === 1) {
              key = keys[0];
              value = it2[key];
            } else {
              throw new TypeError(`Expected tuple with one key, not ${keys.length} keys`);
            }
          } else {
            key = it2;
          }
          pairs2.items.push(Pair.createPair(key, value, ctx));
        }
      return pairs2;
    }
    __name(createPairs, "createPairs");
    var pairs = {
      collection: "seq",
      default: false,
      tag: "tag:yaml.org,2002:pairs",
      resolve: resolvePairs,
      createNode: createPairs
    };
    exports.createPairs = createPairs;
    exports.pairs = pairs;
    exports.resolvePairs = resolvePairs;
  }
});

// ../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/schema/yaml-1.1/omap.js
var require_omap = __commonJS({
  "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/schema/yaml-1.1/omap.js"(exports) {
    init_import_meta_url();
    var identity = require_identity();
    var toJS = require_toJS();
    var YAMLMap = require_YAMLMap();
    var YAMLSeq = require_YAMLSeq();
    var pairs = require_pairs();
    var YAMLOMap = class _YAMLOMap extends YAMLSeq.YAMLSeq {
      static {
        __name(this, "YAMLOMap");
      }
      constructor() {
        super();
        this.add = YAMLMap.YAMLMap.prototype.add.bind(this);
        this.delete = YAMLMap.YAMLMap.prototype.delete.bind(this);
        this.get = YAMLMap.YAMLMap.prototype.get.bind(this);
        this.has = YAMLMap.YAMLMap.prototype.has.bind(this);
        this.set = YAMLMap.YAMLMap.prototype.set.bind(this);
        this.tag = _YAMLOMap.tag;
      }
      /**
       * If `ctx` is given, the return type is actually `Map<unknown, unknown>`,
       * but TypeScript won't allow widening the signature of a child method.
       */
      toJSON(_5, ctx) {
        if (!ctx)
          return super.toJSON(_5);
        const map2 = /* @__PURE__ */ new Map();
        if (ctx?.onCreate)
          ctx.onCreate(map2);
        for (const pair of this.items) {
          let key, value;
          if (identity.isPair(pair)) {
            key = toJS.toJS(pair.key, "", ctx);
            value = toJS.toJS(pair.value, key, ctx);
          } else {
            key = toJS.toJS(pair, "", ctx);
          }
          if (map2.has(key))
            throw new Error("Ordered maps must not include duplicate keys");
          map2.set(key, value);
        }
        return map2;
      }
      static from(schema, iterable, ctx) {
        const pairs$1 = pairs.createPairs(schema, iterable, ctx);
        const omap2 = new this();
        omap2.items = pairs$1.items;
        return omap2;
      }
    };
    YAMLOMap.tag = "tag:yaml.org,2002:omap";
    var omap = {
      collection: "seq",
      identify: /* @__PURE__ */ __name((value) => value instanceof Map, "identify"),
      nodeClass: YAMLOMap,
      default: false,
      tag: "tag:yaml.org,2002:omap",
      resolve(seq, onError) {
        const pairs$1 = pairs.resolvePairs(seq, onError);
        const seenKeys = [];
        for (const { key } of pairs$1.items) {
          if (identity.isScalar(key)) {
            if (seenKeys.includes(key.value)) {
              onError(`Ordered maps must not include duplicate keys: ${key.value}`);
            } else {
              seenKeys.push(key.value);
            }
          }
        }
        return Object.assign(new YAMLOMap(), pairs$1);
      },
      createNode: /* @__PURE__ */ __name((schema, iterable, ctx) => YAMLOMap.from(schema, iterable, ctx), "createNode")
    };
    exports.YAMLOMap = YAMLOMap;
    exports.omap = omap;
  }
});

// ../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/schema/yaml-1.1/bool.js
var require_bool2 = __commonJS({
  "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/schema/yaml-1.1/bool.js"(exports) {
    init_import_meta_url();
    var Scalar = require_Scalar();
    function boolStringify({ value, source }, ctx) {
      const boolObj = value ? trueTag : falseTag;
      if (source && boolObj.test.test(source))
        return source;
      return value ? ctx.options.trueStr : ctx.options.falseStr;
    }
    __name(boolStringify, "boolStringify");
    var trueTag = {
      identify: /* @__PURE__ */ __name((value) => value === true, "identify"),
      default: true,
      tag: "tag:yaml.org,2002:bool",
      test: /^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,
      resolve: /* @__PURE__ */ __name(() => new Scalar.Scalar(true), "resolve"),
      stringify: boolStringify
    };
    var falseTag = {
      identify: /* @__PURE__ */ __name((value) => value === false, "identify"),
      default: true,
      tag: "tag:yaml.org,2002:bool",
      test: /^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,
      resolve: /* @__PURE__ */ __name(() => new Scalar.Scalar(false), "resolve"),
      stringify: boolStringify
    };
    exports.falseTag = falseTag;
    exports.trueTag = trueTag;
  }
});

// ../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/schema/yaml-1.1/float.js
var require_float2 = __commonJS({
  "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/schema/yaml-1.1/float.js"(exports) {
    init_import_meta_url();
    var Scalar = require_Scalar();
    var stringifyNumber = require_stringifyNumber();
    var floatNaN = {
      identify: /* @__PURE__ */ __name((value) => typeof value === "number", "identify"),
      default: true,
      tag: "tag:yaml.org,2002:float",
      test: /^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,
      resolve: /* @__PURE__ */ __name((str) => str.slice(-3).toLowerCase() === "nan" ? NaN : str[0] === "-" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY, "resolve"),
      stringify: stringifyNumber.stringifyNumber
    };
    var floatExp = {
      identify: /* @__PURE__ */ __name((value) => typeof value === "number", "identify"),
      default: true,
      tag: "tag:yaml.org,2002:float",
      format: "EXP",
      test: /^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,
      resolve: /* @__PURE__ */ __name((str) => parseFloat(str.replace(/_/g, "")), "resolve"),
      stringify(node2) {
        const num = Number(node2.value);
        return isFinite(num) ? num.toExponential() : stringifyNumber.stringifyNumber(node2);
      }
    };
    var float = {
      identify: /* @__PURE__ */ __name((value) => typeof value === "number", "identify"),
      default: true,
      tag: "tag:yaml.org,2002:float",
      test: /^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,
      resolve(str) {
        const node2 = new Scalar.Scalar(parseFloat(str.replace(/_/g, "")));
        const dot = str.indexOf(".");
        if (dot !== -1) {
          const f8 = str.substring(dot + 1).replace(/_/g, "");
          if (f8[f8.length - 1] === "0")
            node2.minFractionDigits = f8.length;
        }
        return node2;
      },
      stringify: stringifyNumber.stringifyNumber
    };
    exports.float = float;
    exports.floatExp = floatExp;
    exports.floatNaN = floatNaN;
  }
});

// ../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/schema/yaml-1.1/int.js
var require_int2 = __commonJS({
  "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/schema/yaml-1.1/int.js"(exports) {
    init_import_meta_url();
    var stringifyNumber = require_stringifyNumber();
    var intIdentify = /* @__PURE__ */ __name((value) => typeof value === "bigint" || Number.isInteger(value), "intIdentify");
    function intResolve(str, offset, radix, { intAsBigInt }) {
      const sign = str[0];
      if (sign === "-" || sign === "+")
        offset += 1;
      str = str.substring(offset).replace(/_/g, "");
      if (intAsBigInt) {
        switch (radix) {
          case 2:
            str = `0b${str}`;
            break;
          case 8:
            str = `0o${str}`;
            break;
          case 16:
            str = `0x${str}`;
            break;
        }
        const n10 = BigInt(str);
        return sign === "-" ? BigInt(-1) * n10 : n10;
      }
      const n9 = parseInt(str, radix);
      return sign === "-" ? -1 * n9 : n9;
    }
    __name(intResolve, "intResolve");
    function intStringify(node2, radix, prefix) {
      const { value } = node2;
      if (intIdentify(value)) {
        const str = value.toString(radix);
        return value < 0 ? "-" + prefix + str.substr(1) : prefix + str;
      }
      return stringifyNumber.stringifyNumber(node2);
    }
    __name(intStringify, "intStringify");
    var intBin = {
      identify: intIdentify,
      default: true,
      tag: "tag:yaml.org,2002:int",
      format: "BIN",
      test: /^[-+]?0b[0-1_]+$/,
      resolve: /* @__PURE__ */ __name((str, _onError, opt) => intResolve(str, 2, 2, opt), "resolve"),
      stringify: /* @__PURE__ */ __name((node2) => intStringify(node2, 2, "0b"), "stringify")
    };
    var intOct = {
      identify: intIdentify,
      default: true,
      tag: "tag:yaml.org,2002:int",
      format: "OCT",
      test: /^[-+]?0[0-7_]+$/,
      resolve: /* @__PURE__ */ __name((str, _onError, opt) => intResolve(str, 1, 8, opt), "resolve"),
      stringify: /* @__PURE__ */ __name((node2) => intStringify(node2, 8, "0"), "stringify")
    };
    var int = {
      identify: intIdentify,
      default: true,
      tag: "tag:yaml.org,2002:int",
      test: /^[-+]?[0-9][0-9_]*$/,
      resolve: /* @__PURE__ */ __name((str, _onError, opt) => intResolve(str, 0, 10, opt), "resolve"),
      stringify: stringifyNumber.stringifyNumber
    };
    var intHex = {
      identify: intIdentify,
      default: true,
      tag: "tag:yaml.org,2002:int",
      format: "HEX",
      test: /^[-+]?0x[0-9a-fA-F_]+$/,
      resolve: /* @__PURE__ */ __name((str, _onError, opt) => intResolve(str, 2, 16, opt), "resolve"),
      stringify: /* @__PURE__ */ __name((node2) => intStringify(node2, 16, "0x"), "stringify")
    };
    exports.int = int;
    exports.intBin = intBin;
    exports.intHex = intHex;
    exports.intOct = intOct;
  }
});

// ../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/schema/yaml-1.1/set.js
var require_set = __commonJS({
  "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/schema/yaml-1.1/set.js"(exports) {
    init_import_meta_url();
    var identity = require_identity();
    var Pair = require_Pair();
    var YAMLMap = require_YAMLMap();
    var YAMLSet = class _YAMLSet extends YAMLMap.YAMLMap {
      static {
        __name(this, "YAMLSet");
      }
      constructor(schema) {
        super(schema);
        this.tag = _YAMLSet.tag;
      }
      add(key) {
        let pair;
        if (identity.isPair(key))
          pair = key;
        else if (key && typeof key === "object" && "key" in key && "value" in key && key.value === null)
          pair = new Pair.Pair(key.key, null);
        else
          pair = new Pair.Pair(key, null);
        const prev = YAMLMap.findPair(this.items, pair.key);
        if (!prev)
          this.items.push(pair);
      }
      /**
       * If `keepPair` is `true`, returns the Pair matching `key`.
       * Otherwise, returns the value of that Pair's key.
       */
      get(key, keepPair) {
        const pair = YAMLMap.findPair(this.items, key);
        return !keepPair && identity.isPair(pair) ? identity.isScalar(pair.key) ? pair.key.value : pair.key : pair;
      }
      set(key, value) {
        if (typeof value !== "boolean")
          throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof value}`);
        const prev = YAMLMap.findPair(this.items, key);
        if (prev && !value) {
          this.items.splice(this.items.indexOf(prev), 1);
        } else if (!prev && value) {
          this.items.push(new Pair.Pair(key));
        }
      }
      toJSON(_5, ctx) {
        return super.toJSON(_5, ctx, Set);
      }
      toString(ctx, onComment, onChompKeep) {
        if (!ctx)
          return JSON.stringify(this);
        if (this.hasAllNullValues(true))
          return super.toString(Object.assign({}, ctx, { allNullValues: true }), onComment, onChompKeep);
        else
          throw new Error("Set items must all have null values");
      }
      static from(schema, iterable, ctx) {
        const { replacer: replacer2 } = ctx;
        const set2 = new this(schema);
        if (iterable && Symbol.iterator in Object(iterable))
          for (let value of iterable) {
            if (typeof replacer2 === "function")
              value = replacer2.call(iterable, value, value);
            set2.items.push(Pair.createPair(value, null, ctx));
          }
        return set2;
      }
    };
    YAMLSet.tag = "tag:yaml.org,2002:set";
    var set = {
      collection: "map",
      identify: /* @__PURE__ */ __name((value) => value instanceof Set, "identify"),
      nodeClass: YAMLSet,
      default: false,
      tag: "tag:yaml.org,2002:set",
      createNode: /* @__PURE__ */ __name((schema, iterable, ctx) => YAMLSet.from(schema, iterable, ctx), "createNode"),
      resolve(map2, onError) {
        if (identity.isMap(map2)) {
          if (map2.hasAllNullValues(true))
            return Object.assign(new YAMLSet(), map2);
          else
            onError("Set items must all have null values");
        } else
          onError("Expected a mapping for this tag");
        return map2;
      }
    };
    exports.YAMLSet = YAMLSet;
    exports.set = set;
  }
});

// ../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js
var require_timestamp = __commonJS({
  "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js"(exports) {
    init_import_meta_url();
    var stringifyNumber = require_stringifyNumber();
    function parseSexagesimal(str, asBigInt) {
      const sign = str[0];
      const parts = sign === "-" || sign === "+" ? str.substring(1) : str;
      const num = /* @__PURE__ */ __name((n9) => asBigInt ? BigInt(n9) : Number(n9), "num");
      const res = parts.replace(/_/g, "").split(":").reduce((res2, p7) => res2 * num(60) + num(p7), num(0));
      return sign === "-" ? num(-1) * res : res;
    }
    __name(parseSexagesimal, "parseSexagesimal");
    function stringifySexagesimal(node2) {
      let { value } = node2;
      let num = /* @__PURE__ */ __name((n9) => n9, "num");
      if (typeof value === "bigint")
        num = /* @__PURE__ */ __name((n9) => BigInt(n9), "num");
      else if (isNaN(value) || !isFinite(value))
        return stringifyNumber.stringifyNumber(node2);
      let sign = "";
      if (value < 0) {
        sign = "-";
        value *= num(-1);
      }
      const _60 = num(60);
      const parts = [value % _60];
      if (value < 60) {
        parts.unshift(0);
      } else {
        value = (value - parts[0]) / _60;
        parts.unshift(value % _60);
        if (value >= 60) {
          value = (value - parts[0]) / _60;
          parts.unshift(value);
        }
      }
      return sign + parts.map((n9) => String(n9).padStart(2, "0")).join(":").replace(/000000\d*$/, "");
    }
    __name(stringifySexagesimal, "stringifySexagesimal");
    var intTime = {
      identify: /* @__PURE__ */ __name((value) => typeof value === "bigint" || Number.isInteger(value), "identify"),
      default: true,
      tag: "tag:yaml.org,2002:int",
      format: "TIME",
      test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,
      resolve: /* @__PURE__ */ __name((str, _onError, { intAsBigInt }) => parseSexagesimal(str, intAsBigInt), "resolve"),
      stringify: stringifySexagesimal
    };
    var floatTime = {
      identify: /* @__PURE__ */ __name((value) => typeof value === "number", "identify"),
      default: true,
      tag: "tag:yaml.org,2002:float",
      format: "TIME",
      test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,
      resolve: /* @__PURE__ */ __name((str) => parseSexagesimal(str, false), "resolve"),
      stringify: stringifySexagesimal
    };
    var timestamp = {
      identify: /* @__PURE__ */ __name((value) => value instanceof Date, "identify"),
      default: true,
      tag: "tag:yaml.org,2002:timestamp",
      // If the time zone is omitted, the timestamp is assumed to be specified in UTC. The time part
      // may be omitted altogether, resulting in a date format. In such a case, the time part is
      // assumed to be 00:00:00Z (start of day, UTC).
      test: RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),
      resolve(str) {
        const match3 = str.match(timestamp.test);
        if (!match3)
          throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");
        const [, year, month, day, hour, minute, second] = match3.map(Number);
        const millisec = match3[7] ? Number((match3[7] + "00").substr(1, 3)) : 0;
        let date = Date.UTC(year, month - 1, day, hour || 0, minute || 0, second || 0, millisec);
        const tz = match3[8];
        if (tz && tz !== "Z") {
          let d8 = parseSexagesimal(tz, false);
          if (Math.abs(d8) < 30)
            d8 *= 60;
          date -= 6e4 * d8;
        }
        return new Date(date);
      },
      stringify: /* @__PURE__ */ __name(({ value }) => value?.toISOString().replace(/(T00:00:00)?\.000Z$/, "") ?? "", "stringify")
    };
    exports.floatTime = floatTime;
    exports.intTime = intTime;
    exports.timestamp = timestamp;
  }
});

// ../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/schema/yaml-1.1/schema.js
var require_schema3 = __commonJS({
  "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/schema/yaml-1.1/schema.js"(exports) {
    init_import_meta_url();
    var map2 = require_map();
    var _null = require_null();
    var seq = require_seq();
    var string = require_string();
    var binary = require_binary();
    var bool = require_bool2();
    var float = require_float2();
    var int = require_int2();
    var merge = require_merge();
    var omap = require_omap();
    var pairs = require_pairs();
    var set = require_set();
    var timestamp = require_timestamp();
    var schema = [
      map2.map,
      seq.seq,
      string.string,
      _null.nullTag,
      bool.trueTag,
      bool.falseTag,
      int.intBin,
      int.intOct,
      int.int,
      int.intHex,
      float.floatNaN,
      float.floatExp,
      float.float,
      binary.binary,
      merge.merge,
      omap.omap,
      pairs.pairs,
      set.set,
      timestamp.intTime,
      timestamp.floatTime,
      timestamp.timestamp
    ];
    exports.schema = schema;
  }
});

// ../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/schema/tags.js
var require_tags = __commonJS({
  "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/schema/tags.js"(exports) {
    init_import_meta_url();
    var map2 = require_map();
    var _null = require_null();
    var seq = require_seq();
    var string = require_string();
    var bool = require_bool();
    var float = require_float();
    var int = require_int();
    var schema = require_schema();
    var schema$1 = require_schema2();
    var binary = require_binary();
    var merge = require_merge();
    var omap = require_omap();
    var pairs = require_pairs();
    var schema$2 = require_schema3();
    var set = require_set();
    var timestamp = require_timestamp();
    var schemas = /* @__PURE__ */ new Map([
      ["core", schema.schema],
      ["failsafe", [map2.map, seq.seq, string.string]],
      ["json", schema$1.schema],
      ["yaml11", schema$2.schema],
      ["yaml-1.1", schema$2.schema]
    ]);
    var tagsByName = {
      binary: binary.binary,
      bool: bool.boolTag,
      float: float.float,
      floatExp: float.floatExp,
      floatNaN: float.floatNaN,
      floatTime: timestamp.floatTime,
      int: int.int,
      intHex: int.intHex,
      intOct: int.intOct,
      intTime: timestamp.intTime,
      map: map2.map,
      merge: merge.merge,
      null: _null.nullTag,
      omap: omap.omap,
      pairs: pairs.pairs,
      seq: seq.seq,
      set: set.set,
      timestamp: timestamp.timestamp
    };
    var coreKnownTags = {
      "tag:yaml.org,2002:binary": binary.binary,
      "tag:yaml.org,2002:merge": merge.merge,
      "tag:yaml.org,2002:omap": omap.omap,
      "tag:yaml.org,2002:pairs": pairs.pairs,
      "tag:yaml.org,2002:set": set.set,
      "tag:yaml.org,2002:timestamp": timestamp.timestamp
    };
    function getTags(customTags, schemaName, addMergeTag) {
      const schemaTags = schemas.get(schemaName);
      if (schemaTags && !customTags) {
        return addMergeTag && !schemaTags.includes(merge.merge) ? schemaTags.concat(merge.merge) : schemaTags.slice();
      }
      let tags = schemaTags;
      if (!tags) {
        if (Array.isArray(customTags))
          tags = [];
        else {
          const keys = Array.from(schemas.keys()).filter((key) => key !== "yaml11").map((key) => JSON.stringify(key)).join(", ");
          throw new Error(`Unknown schema "${schemaName}"; use one of ${keys} or define customTags array`);
        }
      }
      if (Array.isArray(customTags)) {
        for (const tag of customTags)
          tags = tags.concat(tag);
      } else if (typeof customTags === "function") {
        tags = customTags(tags.slice());
      }
      if (addMergeTag)
        tags = tags.concat(merge.merge);
      return tags.reduce((tags2, tag) => {
        const tagObj = typeof tag === "string" ? tagsByName[tag] : tag;
        if (!tagObj) {
          const tagName = JSON.stringify(tag);
          const keys = Object.keys(tagsByName).map((key) => JSON.stringify(key)).join(", ");
          throw new Error(`Unknown custom tag ${tagName}; use one of ${keys}`);
        }
        if (!tags2.includes(tagObj))
          tags2.push(tagObj);
        return tags2;
      }, []);
    }
    __name(getTags, "getTags");
    exports.coreKnownTags = coreKnownTags;
    exports.getTags = getTags;
  }
});

// ../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/schema/Schema.js
var require_Schema = __commonJS({
  "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/schema/Schema.js"(exports) {
    init_import_meta_url();
    var identity = require_identity();
    var map2 = require_map();
    var seq = require_seq();
    var string = require_string();
    var tags = require_tags();
    var sortMapEntriesByKey = /* @__PURE__ */ __name((a7, b11) => a7.key < b11.key ? -1 : a7.key > b11.key ? 1 : 0, "sortMapEntriesByKey");
    var Schema2 = class _Schema {
      static {
        __name(this, "Schema");
      }
      constructor({ compat, customTags, merge, resolveKnownTags, schema, sortMapEntries, toStringDefaults }) {
        this.compat = Array.isArray(compat) ? tags.getTags(compat, "compat") : compat ? tags.getTags(null, compat) : null;
        this.name = typeof schema === "string" && schema || "core";
        this.knownTags = resolveKnownTags ? tags.coreKnownTags : {};
        this.tags = tags.getTags(customTags, this.name, merge);
        this.toStringOptions = toStringDefaults ?? null;
        Object.defineProperty(this, identity.MAP, { value: map2.map });
        Object.defineProperty(this, identity.SCALAR, { value: string.string });
        Object.defineProperty(this, identity.SEQ, { value: seq.seq });
        this.sortMapEntries = typeof sortMapEntries === "function" ? sortMapEntries : sortMapEntries === true ? sortMapEntriesByKey : null;
      }
      clone() {
        const copy = Object.create(_Schema.prototype, Object.getOwnPropertyDescriptors(this));
        copy.tags = this.tags.slice();
        return copy;
      }
    };
    exports.Schema = Schema2;
  }
});

// ../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/stringify/stringifyDocument.js
var require_stringifyDocument = __commonJS({
  "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/stringify/stringifyDocument.js"(exports) {
    init_import_meta_url();
    var identity = require_identity();
    var stringify4 = require_stringify();
    var stringifyComment = require_stringifyComment();
    function stringifyDocument(doc, options) {
      const lines = [];
      let hasDirectives = options.directives === true;
      if (options.directives !== false && doc.directives) {
        const dir2 = doc.directives.toString(doc);
        if (dir2) {
          lines.push(dir2);
          hasDirectives = true;
        } else if (doc.directives.docStart)
          hasDirectives = true;
      }
      if (hasDirectives)
        lines.push("---");
      const ctx = stringify4.createStringifyContext(doc, options);
      const { commentString } = ctx.options;
      if (doc.commentBefore) {
        if (lines.length !== 1)
          lines.unshift("");
        const cs2 = commentString(doc.commentBefore);
        lines.unshift(stringifyComment.indentComment(cs2, ""));
      }
      let chompKeep = false;
      let contentComment = null;
      if (doc.contents) {
        if (identity.isNode(doc.contents)) {
          if (doc.contents.spaceBefore && hasDirectives)
            lines.push("");
          if (doc.contents.commentBefore) {
            const cs2 = commentString(doc.contents.commentBefore);
            lines.push(stringifyComment.indentComment(cs2, ""));
          }
          ctx.forceBlockIndent = !!doc.comment;
          contentComment = doc.contents.comment;
        }
        const onChompKeep = contentComment ? void 0 : () => chompKeep = true;
        let body = stringify4.stringify(doc.contents, ctx, () => contentComment = null, onChompKeep);
        if (contentComment)
          body += stringifyComment.lineComment(body, "", commentString(contentComment));
        if ((body[0] === "|" || body[0] === ">") && lines[lines.length - 1] === "---") {
          lines[lines.length - 1] = `--- ${body}`;
        } else
          lines.push(body);
      } else {
        lines.push(stringify4.stringify(doc.contents, ctx));
      }
      if (doc.directives?.docEnd) {
        if (doc.comment) {
          const cs2 = commentString(doc.comment);
          if (cs2.includes("\n")) {
            lines.push("...");
            lines.push(stringifyComment.indentComment(cs2, ""));
          } else {
            lines.push(`... ${cs2}`);
          }
        } else {
          lines.push("...");
        }
      } else {
        let dc = doc.comment;
        if (dc && chompKeep)
          dc = dc.replace(/^\n+/, "");
        if (dc) {
          if ((!chompKeep || contentComment) && lines[lines.length - 1] !== "")
            lines.push("");
          lines.push(stringifyComment.indentComment(commentString(dc), ""));
        }
      }
      return lines.join("\n") + "\n";
    }
    __name(stringifyDocument, "stringifyDocument");
    exports.stringifyDocument = stringifyDocument;
  }
});

// ../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/doc/Document.js
var require_Document = __commonJS({
  "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/doc/Document.js"(exports) {
    init_import_meta_url();
    var Alias = require_Alias();
    var Collection = require_Collection();
    var identity = require_identity();
    var Pair = require_Pair();
    var toJS = require_toJS();
    var Schema2 = require_Schema();
    var stringifyDocument = require_stringifyDocument();
    var anchors = require_anchors();
    var applyReviver = require_applyReviver();
    var createNode = require_createNode();
    var directives = require_directives();
    var Document = class _Document {
      static {
        __name(this, "Document");
      }
      constructor(value, replacer2, options) {
        this.commentBefore = null;
        this.comment = null;
        this.errors = [];
        this.warnings = [];
        Object.defineProperty(this, identity.NODE_TYPE, { value: identity.DOC });
        let _replacer = null;
        if (typeof replacer2 === "function" || Array.isArray(replacer2)) {
          _replacer = replacer2;
        } else if (options === void 0 && replacer2) {
          options = replacer2;
          replacer2 = void 0;
        }
        const opt = Object.assign({
          intAsBigInt: false,
          keepSourceTokens: false,
          logLevel: "warn",
          prettyErrors: true,
          strict: true,
          stringKeys: false,
          uniqueKeys: true,
          version: "1.2"
        }, options);
        this.options = opt;
        let { version: version5 } = opt;
        if (options?._directives) {
          this.directives = options._directives.atDocument();
          if (this.directives.yaml.explicit)
            version5 = this.directives.yaml.version;
        } else
          this.directives = new directives.Directives({ version: version5 });
        this.setSchema(version5, options);
        this.contents = value === void 0 ? null : this.createNode(value, _replacer, options);
      }
      /**
       * Create a deep copy of this Document and its contents.
       *
       * Custom Node values that inherit from `Object` still refer to their original instances.
       */
      clone() {
        const copy = Object.create(_Document.prototype, {
          [identity.NODE_TYPE]: { value: identity.DOC }
        });
        copy.commentBefore = this.commentBefore;
        copy.comment = this.comment;
        copy.errors = this.errors.slice();
        copy.warnings = this.warnings.slice();
        copy.options = Object.assign({}, this.options);
        if (this.directives)
          copy.directives = this.directives.clone();
        copy.schema = this.schema.clone();
        copy.contents = identity.isNode(this.contents) ? this.contents.clone(copy.schema) : this.contents;
        if (this.range)
          copy.range = this.range.slice();
        return copy;
      }
      /** Adds a value to the document. */
      add(value) {
        if (assertCollection(this.contents))
          this.contents.add(value);
      }
      /** Adds a value to the document. */
      addIn(path84, value) {
        if (assertCollection(this.contents))
          this.contents.addIn(path84, value);
      }
      /**
       * Create a new `Alias` node, ensuring that the target `node` has the required anchor.
       *
       * If `node` already has an anchor, `name` is ignored.
       * Otherwise, the `node.anchor` value will be set to `name`,
       * or if an anchor with that name is already present in the document,
       * `name` will be used as a prefix for a new unique anchor.
       * If `name` is undefined, the generated anchor will use 'a' as a prefix.
       */
      createAlias(node2, name2) {
        if (!node2.anchor) {
          const prev = anchors.anchorNames(this);
          node2.anchor = // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
          !name2 || prev.has(name2) ? anchors.findNewAnchor(name2 || "a", prev) : name2;
        }
        return new Alias.Alias(node2.anchor);
      }
      createNode(value, replacer2, options) {
        let _replacer = void 0;
        if (typeof replacer2 === "function") {
          value = replacer2.call({ "": value }, "", value);
          _replacer = replacer2;
        } else if (Array.isArray(replacer2)) {
          const keyToStr = /* @__PURE__ */ __name((v8) => typeof v8 === "number" || v8 instanceof String || v8 instanceof Number, "keyToStr");
          const asStr = replacer2.filter(keyToStr).map(String);
          if (asStr.length > 0)
            replacer2 = replacer2.concat(asStr);
          _replacer = replacer2;
        } else if (options === void 0 && replacer2) {
          options = replacer2;
          replacer2 = void 0;
        }
        const { aliasDuplicateObjects, anchorPrefix, flow, keepUndefined, onTagObj, tag } = options ?? {};
        const { onAnchor, setAnchors, sourceObjects } = anchors.createNodeAnchors(
          this,
          // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
          anchorPrefix || "a"
        );
        const ctx = {
          aliasDuplicateObjects: aliasDuplicateObjects ?? true,
          keepUndefined: keepUndefined ?? false,
          onAnchor,
          onTagObj,
          replacer: _replacer,
          schema: this.schema,
          sourceObjects
        };
        const node2 = createNode.createNode(value, tag, ctx);
        if (flow && identity.isCollection(node2))
          node2.flow = true;
        setAnchors();
        return node2;
      }
      /**
       * Convert a key and a value into a `Pair` using the current schema,
       * recursively wrapping all values as `Scalar` or `Collection` nodes.
       */
      createPair(key, value, options = {}) {
        const k7 = this.createNode(key, null, options);
        const v8 = this.createNode(value, null, options);
        return new Pair.Pair(k7, v8);
      }
      /**
       * Removes a value from the document.
       * @returns `true` if the item was found and removed.
       */
      delete(key) {
        return assertCollection(this.contents) ? this.contents.delete(key) : false;
      }
      /**
       * Removes a value from the document.
       * @returns `true` if the item was found and removed.
       */
      deleteIn(path84) {
        if (Collection.isEmptyPath(path84)) {
          if (this.contents == null)
            return false;
          this.contents = null;
          return true;
        }
        return assertCollection(this.contents) ? this.contents.deleteIn(path84) : false;
      }
      /**
       * Returns item at `key`, or `undefined` if not found. By default unwraps
       * scalar values from their surrounding node; to disable set `keepScalar` to
       * `true` (collections are always returned intact).
       */
      get(key, keepScalar) {
        return identity.isCollection(this.contents) ? this.contents.get(key, keepScalar) : void 0;
      }
      /**
       * Returns item at `path`, or `undefined` if not found. By default unwraps
       * scalar values from their surrounding node; to disable set `keepScalar` to
       * `true` (collections are always returned intact).
       */
      getIn(path84, keepScalar) {
        if (Collection.isEmptyPath(path84))
          return !keepScalar && identity.isScalar(this.contents) ? this.contents.value : this.contents;
        return identity.isCollection(this.contents) ? this.contents.getIn(path84, keepScalar) : void 0;
      }
      /**
       * Checks if the document includes a value with the key `key`.
       */
      has(key) {
        return identity.isCollection(this.contents) ? this.contents.has(key) : false;
      }
      /**
       * Checks if the document includes a value at `path`.
       */
      hasIn(path84) {
        if (Collection.isEmptyPath(path84))
          return this.contents !== void 0;
        return identity.isCollection(this.contents) ? this.contents.hasIn(path84) : false;
      }
      /**
       * Sets a value in this document. For `!!set`, `value` needs to be a
       * boolean to add/remove the item from the set.
       */
      set(key, value) {
        if (this.contents == null) {
          this.contents = Collection.collectionFromPath(this.schema, [key], value);
        } else if (assertCollection(this.contents)) {
          this.contents.set(key, value);
        }
      }
      /**
       * Sets a value in this document. For `!!set`, `value` needs to be a
       * boolean to add/remove the item from the set.
       */
      setIn(path84, value) {
        if (Collection.isEmptyPath(path84)) {
          this.contents = value;
        } else if (this.contents == null) {
          this.contents = Collection.collectionFromPath(this.schema, Array.from(path84), value);
        } else if (assertCollection(this.contents)) {
          this.contents.setIn(path84, value);
        }
      }
      /**
       * Change the YAML version and schema used by the document.
       * A `null` version disables support for directives, explicit tags, anchors, and aliases.
       * It also requires the `schema` option to be given as a `Schema` instance value.
       *
       * Overrides all previously set schema options.
       */
      setSchema(version5, options = {}) {
        if (typeof version5 === "number")
          version5 = String(version5);
        let opt;
        switch (version5) {
          case "1.1":
            if (this.directives)
              this.directives.yaml.version = "1.1";
            else
              this.directives = new directives.Directives({ version: "1.1" });
            opt = { resolveKnownTags: false, schema: "yaml-1.1" };
            break;
          case "1.2":
          case "next":
            if (this.directives)
              this.directives.yaml.version = version5;
            else
              this.directives = new directives.Directives({ version: version5 });
            opt = { resolveKnownTags: true, schema: "core" };
            break;
          case null:
            if (this.directives)
              delete this.directives;
            opt = null;
            break;
          default: {
            const sv = JSON.stringify(version5);
            throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${sv}`);
          }
        }
        if (options.schema instanceof Object)
          this.schema = options.schema;
        else if (opt)
          this.schema = new Schema2.Schema(Object.assign(opt, options));
        else
          throw new Error(`With a null YAML version, the { schema: Schema } option is required`);
      }
      // json & jsonArg are only used from toJSON()
      toJS({ json, jsonArg, mapAsMap, maxAliasCount, onAnchor, reviver } = {}) {
        const ctx = {
          anchors: /* @__PURE__ */ new Map(),
          doc: this,
          keep: !json,
          mapAsMap: mapAsMap === true,
          mapKeyWarned: false,
          maxAliasCount: typeof maxAliasCount === "number" ? maxAliasCount : 100
        };
        const res = toJS.toJS(this.contents, jsonArg ?? "", ctx);
        if (typeof onAnchor === "function")
          for (const { count, res: res2 } of ctx.anchors.values())
            onAnchor(res2, count);
        return typeof reviver === "function" ? applyReviver.applyReviver(reviver, { "": res }, "", res) : res;
      }
      /**
       * A JSON representation of the document `contents`.
       *
       * @param jsonArg Used by `JSON.stringify` to indicate the array index or
       *   property name.
       */
      toJSON(jsonArg, onAnchor) {
        return this.toJS({ json: true, jsonArg, mapAsMap: false, onAnchor });
      }
      /** A YAML representation of the document. */
      toString(options = {}) {
        if (this.errors.length > 0)
          throw new Error("Document with errors cannot be stringified");
        if ("indent" in options && (!Number.isInteger(options.indent) || Number(options.indent) <= 0)) {
          const s7 = JSON.stringify(options.indent);
          throw new Error(`"indent" option must be a positive integer, not ${s7}`);
        }
        return stringifyDocument.stringifyDocument(this, options);
      }
    };
    function assertCollection(contents) {
      if (identity.isCollection(contents))
        return true;
      throw new Error("Expected a YAML collection as document contents");
    }
    __name(assertCollection, "assertCollection");
    exports.Document = Document;
  }
});

// ../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/errors.js
var require_errors2 = __commonJS({
  "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/errors.js"(exports) {
    init_import_meta_url();
    var YAMLError = class extends Error {
      static {
        __name(this, "YAMLError");
      }
      constructor(name2, pos, code, message) {
        super();
        this.name = name2;
        this.code = code;
        this.message = message;
        this.pos = pos;
      }
    };
    var YAMLParseError = class extends YAMLError {
      static {
        __name(this, "YAMLParseError");
      }
      constructor(pos, code, message) {
        super("YAMLParseError", pos, code, message);
      }
    };
    var YAMLWarning = class extends YAMLError {
      static {
        __name(this, "YAMLWarning");
      }
      constructor(pos, code, message) {
        super("YAMLWarning", pos, code, message);
      }
    };
    var prettifyError = /* @__PURE__ */ __name((src, lc) => (error2) => {
      if (error2.pos[0] === -1)
        return;
      error2.linePos = error2.pos.map((pos) => lc.linePos(pos));
      const { line, col } = error2.linePos[0];
      error2.message += ` at line ${line}, column ${col}`;
      let ci7 = col - 1;
      let lineStr = src.substring(lc.lineStarts[line - 1], lc.lineStarts[line]).replace(/[\n\r]+$/, "");
      if (ci7 >= 60 && lineStr.length > 80) {
        const trimStart = Math.min(ci7 - 39, lineStr.length - 79);
        lineStr = "\u2026" + lineStr.substring(trimStart);
        ci7 -= trimStart - 1;
      }
      if (lineStr.length > 80)
        lineStr = lineStr.substring(0, 79) + "\u2026";
      if (line > 1 && /^ *$/.test(lineStr.substring(0, ci7))) {
        let prev = src.substring(lc.lineStarts[line - 2], lc.lineStarts[line - 1]);
        if (prev.length > 80)
          prev = prev.substring(0, 79) + "\u2026\n";
        lineStr = prev + lineStr;
      }
      if (/[^ ]/.test(lineStr)) {
        let count = 1;
        const end = error2.linePos[1];
        if (end && end.line === line && end.col > col) {
          count = Math.max(1, Math.min(end.col - col, 80 - ci7));
        }
        const pointer = " ".repeat(ci7) + "^".repeat(count);
        error2.message += `:

${lineStr}
${pointer}
`;
      }
    }, "prettifyError");
    exports.YAMLError = YAMLError;
    exports.YAMLParseError = YAMLParseError;
    exports.YAMLWarning = YAMLWarning;
    exports.prettifyError = prettifyError;
  }
});

// ../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/compose/resolve-props.js
var require_resolve_props = __commonJS({
  "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/compose/resolve-props.js"(exports) {
    init_import_meta_url();
    function resolveProps(tokens, { flow, indicator, next, offset, onError, parentIndent, startOnNewline }) {
      let spaceBefore = false;
      let atNewline = startOnNewline;
      let hasSpace = startOnNewline;
      let comment = "";
      let commentSep = "";
      let hasNewline = false;
      let reqSpace = false;
      let tab = null;
      let anchor = null;
      let tag = null;
      let newlineAfterProp = null;
      let comma = null;
      let found = null;
      let start = null;
      for (const token of tokens) {
        if (reqSpace) {
          if (token.type !== "space" && token.type !== "newline" && token.type !== "comma")
            onError(token.offset, "MISSING_CHAR", "Tags and anchors must be separated from the next token by white space");
          reqSpace = false;
        }
        if (tab) {
          if (atNewline && token.type !== "comment" && token.type !== "newline") {
            onError(tab, "TAB_AS_INDENT", "Tabs are not allowed as indentation");
          }
          tab = null;
        }
        switch (token.type) {
          case "space":
            if (!flow && (indicator !== "doc-start" || next?.type !== "flow-collection") && token.source.includes("	")) {
              tab = token;
            }
            hasSpace = true;
            break;
          case "comment": {
            if (!hasSpace)
              onError(token, "MISSING_CHAR", "Comments must be separated from other tokens by white space characters");
            const cb2 = token.source.substring(1) || " ";
            if (!comment)
              comment = cb2;
            else
              comment += commentSep + cb2;
            commentSep = "";
            atNewline = false;
            break;
          }
          case "newline":
            if (atNewline) {
              if (comment)
                comment += token.source;
              else if (!found || indicator !== "seq-item-ind")
                spaceBefore = true;
            } else
              commentSep += token.source;
            atNewline = true;
            hasNewline = true;
            if (anchor || tag)
              newlineAfterProp = token;
            hasSpace = true;
            break;
          case "anchor":
            if (anchor)
              onError(token, "MULTIPLE_ANCHORS", "A node can have at most one anchor");
            if (token.source.endsWith(":"))
              onError(token.offset + token.source.length - 1, "BAD_ALIAS", "Anchor ending in : is ambiguous", true);
            anchor = token;
            start ?? (start = token.offset);
            atNewline = false;
            hasSpace = false;
            reqSpace = true;
            break;
          case "tag": {
            if (tag)
              onError(token, "MULTIPLE_TAGS", "A node can have at most one tag");
            tag = token;
            start ?? (start = token.offset);
            atNewline = false;
            hasSpace = false;
            reqSpace = true;
            break;
          }
          case indicator:
            if (anchor || tag)
              onError(token, "BAD_PROP_ORDER", `Anchors and tags must be after the ${token.source} indicator`);
            if (found)
              onError(token, "UNEXPECTED_TOKEN", `Unexpected ${token.source} in ${flow ?? "collection"}`);
            found = token;
            atNewline = indicator === "seq-item-ind" || indicator === "explicit-key-ind";
            hasSpace = false;
            break;
          case "comma":
            if (flow) {
              if (comma)
                onError(token, "UNEXPECTED_TOKEN", `Unexpected , in ${flow}`);
              comma = token;
              atNewline = false;
              hasSpace = false;
              break;
            }
          // else fallthrough
          default:
            onError(token, "UNEXPECTED_TOKEN", `Unexpected ${token.type} token`);
            atNewline = false;
            hasSpace = false;
        }
      }
      const last = tokens[tokens.length - 1];
      const end = last ? last.offset + last.source.length : offset;
      if (reqSpace && next && next.type !== "space" && next.type !== "newline" && next.type !== "comma" && (next.type !== "scalar" || next.source !== "")) {
        onError(next.offset, "MISSING_CHAR", "Tags and anchors must be separated from the next token by white space");
      }
      if (tab && (atNewline && tab.indent <= parentIndent || next?.type === "block-map" || next?.type === "block-seq"))
        onError(tab, "TAB_AS_INDENT", "Tabs are not allowed as indentation");
      return {
        comma,
        found,
        spaceBefore,
        comment,
        hasNewline,
        anchor,
        tag,
        newlineAfterProp,
        end,
        start: start ?? end
      };
    }
    __name(resolveProps, "resolveProps");
    exports.resolveProps = resolveProps;
  }
});

// ../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/compose/util-contains-newline.js
var require_util_contains_newline = __commonJS({
  "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/compose/util-contains-newline.js"(exports) {
    init_import_meta_url();
    function containsNewline(key) {
      if (!key)
        return null;
      switch (key.type) {
        case "alias":
        case "scalar":
        case "double-quoted-scalar":
        case "single-quoted-scalar":
          if (key.source.includes("\n"))
            return true;
          if (key.end) {
            for (const st2 of key.end)
              if (st2.type === "newline")
                return true;
          }
          return false;
        case "flow-collection":
          for (const it2 of key.items) {
            for (const st2 of it2.start)
              if (st2.type === "newline")
                return true;
            if (it2.sep) {
              for (const st2 of it2.sep)
                if (st2.type === "newline")
                  return true;
            }
            if (containsNewline(it2.key) || containsNewline(it2.value))
              return true;
          }
          return false;
        default:
          return true;
      }
    }
    __name(containsNewline, "containsNewline");
    exports.containsNewline = containsNewline;
  }
});

// ../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/compose/util-flow-indent-check.js
var require_util_flow_indent_check = __commonJS({
  "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/compose/util-flow-indent-check.js"(exports) {
    init_import_meta_url();
    var utilContainsNewline = require_util_contains_newline();
    function flowIndentCheck(indent, fc, onError) {
      if (fc?.type === "flow-collection") {
        const end = fc.end[0];
        if (end.indent === indent && (end.source === "]" || end.source === "}") && utilContainsNewline.containsNewline(fc)) {
          const msg = "Flow end indicator should be more indented than parent";
          onError(end, "BAD_INDENT", msg, true);
        }
      }
    }
    __name(flowIndentCheck, "flowIndentCheck");
    exports.flowIndentCheck = flowIndentCheck;
  }
});

// ../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/compose/util-map-includes.js
var require_util_map_includes = __commonJS({
  "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/compose/util-map-includes.js"(exports) {
    init_import_meta_url();
    var identity = require_identity();
    function mapIncludes(ctx, items, search) {
      const { uniqueKeys } = ctx.options;
      if (uniqueKeys === false)
        return false;
      const isEqual = typeof uniqueKeys === "function" ? uniqueKeys : (a7, b11) => a7 === b11 || identity.isScalar(a7) && identity.isScalar(b11) && a7.value === b11.value;
      return items.some((pair) => isEqual(pair.key, search));
    }
    __name(mapIncludes, "mapIncludes");
    exports.mapIncludes = mapIncludes;
  }
});

// ../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/compose/resolve-block-map.js
var require_resolve_block_map = __commonJS({
  "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/compose/resolve-block-map.js"(exports) {
    init_import_meta_url();
    var Pair = require_Pair();
    var YAMLMap = require_YAMLMap();
    var resolveProps = require_resolve_props();
    var utilContainsNewline = require_util_contains_newline();
    var utilFlowIndentCheck = require_util_flow_indent_check();
    var utilMapIncludes = require_util_map_includes();
    var startColMsg = "All mapping items must start at the same column";
    function resolveBlockMap({ composeNode, composeEmptyNode }, ctx, bm2, onError, tag) {
      const NodeClass = tag?.nodeClass ?? YAMLMap.YAMLMap;
      const map2 = new NodeClass(ctx.schema);
      if (ctx.atRoot)
        ctx.atRoot = false;
      let offset = bm2.offset;
      let commentEnd = null;
      for (const collItem of bm2.items) {
        const { start, key, sep: sep6, value } = collItem;
        const keyProps = resolveProps.resolveProps(start, {
          indicator: "explicit-key-ind",
          next: key ?? sep6?.[0],
          offset,
          onError,
          parentIndent: bm2.indent,
          startOnNewline: true
        });
        const implicitKey = !keyProps.found;
        if (implicitKey) {
          if (key) {
            if (key.type === "block-seq")
              onError(offset, "BLOCK_AS_IMPLICIT_KEY", "A block sequence may not be used as an implicit map key");
            else if ("indent" in key && key.indent !== bm2.indent)
              onError(offset, "BAD_INDENT", startColMsg);
          }
          if (!keyProps.anchor && !keyProps.tag && !sep6) {
            commentEnd = keyProps.end;
            if (keyProps.comment) {
              if (map2.comment)
                map2.comment += "\n" + keyProps.comment;
              else
                map2.comment = keyProps.comment;
            }
            continue;
          }
          if (keyProps.newlineAfterProp || utilContainsNewline.containsNewline(key)) {
            onError(key ?? start[start.length - 1], "MULTILINE_IMPLICIT_KEY", "Implicit keys need to be on a single line");
          }
        } else if (keyProps.found?.indent !== bm2.indent) {
          onError(offset, "BAD_INDENT", startColMsg);
        }
        ctx.atKey = true;
        const keyStart = keyProps.end;
        const keyNode = key ? composeNode(ctx, key, keyProps, onError) : composeEmptyNode(ctx, keyStart, start, null, keyProps, onError);
        if (ctx.schema.compat)
          utilFlowIndentCheck.flowIndentCheck(bm2.indent, key, onError);
        ctx.atKey = false;
        if (utilMapIncludes.mapIncludes(ctx, map2.items, keyNode))
          onError(keyStart, "DUPLICATE_KEY", "Map keys must be unique");
        const valueProps = resolveProps.resolveProps(sep6 ?? [], {
          indicator: "map-value-ind",
          next: value,
          offset: keyNode.range[2],
          onError,
          parentIndent: bm2.indent,
          startOnNewline: !key || key.type === "block-scalar"
        });
        offset = valueProps.end;
        if (valueProps.found) {
          if (implicitKey) {
            if (value?.type === "block-map" && !valueProps.hasNewline)
              onError(offset, "BLOCK_AS_IMPLICIT_KEY", "Nested mappings are not allowed in compact mappings");
            if (ctx.options.strict && keyProps.start < valueProps.found.offset - 1024)
              onError(keyNode.range, "KEY_OVER_1024_CHARS", "The : indicator must be at most 1024 chars after the start of an implicit block mapping key");
          }
          const valueNode = value ? composeNode(ctx, value, valueProps, onError) : composeEmptyNode(ctx, offset, sep6, null, valueProps, onError);
          if (ctx.schema.compat)
            utilFlowIndentCheck.flowIndentCheck(bm2.indent, value, onError);
          offset = valueNode.range[2];
          const pair = new Pair.Pair(keyNode, valueNode);
          if (ctx.options.keepSourceTokens)
            pair.srcToken = collItem;
          map2.items.push(pair);
        } else {
          if (implicitKey)
            onError(keyNode.range, "MISSING_CHAR", "Implicit map keys need to be followed by map values");
          if (valueProps.comment) {
            if (keyNode.comment)
              keyNode.comment += "\n" + valueProps.comment;
            else
              keyNode.comment = valueProps.comment;
          }
          const pair = new Pair.Pair(keyNode);
          if (ctx.options.keepSourceTokens)
            pair.srcToken = collItem;
          map2.items.push(pair);
        }
      }
      if (commentEnd && commentEnd < offset)
        onError(commentEnd, "IMPOSSIBLE", "Map comment with trailing content");
      map2.range = [bm2.offset, offset, commentEnd ?? offset];
      return map2;
    }
    __name(resolveBlockMap, "resolveBlockMap");
    exports.resolveBlockMap = resolveBlockMap;
  }
});

// ../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/compose/resolve-block-seq.js
var require_resolve_block_seq = __commonJS({
  "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/compose/resolve-block-seq.js"(exports) {
    init_import_meta_url();
    var YAMLSeq = require_YAMLSeq();
    var resolveProps = require_resolve_props();
    var utilFlowIndentCheck = require_util_flow_indent_check();
    function resolveBlockSeq({ composeNode, composeEmptyNode }, ctx, bs2, onError, tag) {
      const NodeClass = tag?.nodeClass ?? YAMLSeq.YAMLSeq;
      const seq = new NodeClass(ctx.schema);
      if (ctx.atRoot)
        ctx.atRoot = false;
      if (ctx.atKey)
        ctx.atKey = false;
      let offset = bs2.offset;
      let commentEnd = null;
      for (const { start, value } of bs2.items) {
        const props = resolveProps.resolveProps(start, {
          indicator: "seq-item-ind",
          next: value,
          offset,
          onError,
          parentIndent: bs2.indent,
          startOnNewline: true
        });
        if (!props.found) {
          if (props.anchor || props.tag || value) {
            if (value && value.type === "block-seq")
              onError(props.end, "BAD_INDENT", "All sequence items must start at the same column");
            else
              onError(offset, "MISSING_CHAR", "Sequence item without - indicator");
          } else {
            commentEnd = props.end;
            if (props.comment)
              seq.comment = props.comment;
            continue;
          }
        }
        const node2 = value ? composeNode(ctx, value, props, onError) : composeEmptyNode(ctx, props.end, start, null, props, onError);
        if (ctx.schema.compat)
          utilFlowIndentCheck.flowIndentCheck(bs2.indent, value, onError);
        offset = node2.range[2];
        seq.items.push(node2);
      }
      seq.range = [bs2.offset, offset, commentEnd ?? offset];
      return seq;
    }
    __name(resolveBlockSeq, "resolveBlockSeq");
    exports.resolveBlockSeq = resolveBlockSeq;
  }
});

// ../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/compose/resolve-end.js
var require_resolve_end = __commonJS({
  "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/compose/resolve-end.js"(exports) {
    init_import_meta_url();
    function resolveEnd(end, offset, reqSpace, onError) {
      let comment = "";
      if (end) {
        let hasSpace = false;
        let sep6 = "";
        for (const token of end) {
          const { source, type } = token;
          switch (type) {
            case "space":
              hasSpace = true;
              break;
            case "comment": {
              if (reqSpace && !hasSpace)
                onError(token, "MISSING_CHAR", "Comments must be separated from other tokens by white space characters");
              const cb2 = source.substring(1) || " ";
              if (!comment)
                comment = cb2;
              else
                comment += sep6 + cb2;
              sep6 = "";
              break;
            }
            case "newline":
              if (comment)
                sep6 += source;
              hasSpace = true;
              break;
            default:
              onError(token, "UNEXPECTED_TOKEN", `Unexpected ${type} at node end`);
          }
          offset += source.length;
        }
      }
      return { comment, offset };
    }
    __name(resolveEnd, "resolveEnd");
    exports.resolveEnd = resolveEnd;
  }
});

// ../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/compose/resolve-flow-collection.js
var require_resolve_flow_collection = __commonJS({
  "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/compose/resolve-flow-collection.js"(exports) {
    init_import_meta_url();
    var identity = require_identity();
    var Pair = require_Pair();
    var YAMLMap = require_YAMLMap();
    var YAMLSeq = require_YAMLSeq();
    var resolveEnd = require_resolve_end();
    var resolveProps = require_resolve_props();
    var utilContainsNewline = require_util_contains_newline();
    var utilMapIncludes = require_util_map_includes();
    var blockMsg = "Block collections are not allowed within flow collections";
    var isBlock = /* @__PURE__ */ __name((token) => token && (token.type === "block-map" || token.type === "block-seq"), "isBlock");
    function resolveFlowCollection({ composeNode, composeEmptyNode }, ctx, fc, onError, tag) {
      const isMap = fc.start.source === "{";
      const fcName = isMap ? "flow map" : "flow sequence";
      const NodeClass = tag?.nodeClass ?? (isMap ? YAMLMap.YAMLMap : YAMLSeq.YAMLSeq);
      const coll = new NodeClass(ctx.schema);
      coll.flow = true;
      const atRoot = ctx.atRoot;
      if (atRoot)
        ctx.atRoot = false;
      if (ctx.atKey)
        ctx.atKey = false;
      let offset = fc.offset + fc.start.source.length;
      for (let i7 = 0; i7 < fc.items.length; ++i7) {
        const collItem = fc.items[i7];
        const { start, key, sep: sep6, value } = collItem;
        const props = resolveProps.resolveProps(start, {
          flow: fcName,
          indicator: "explicit-key-ind",
          next: key ?? sep6?.[0],
          offset,
          onError,
          parentIndent: fc.indent,
          startOnNewline: false
        });
        if (!props.found) {
          if (!props.anchor && !props.tag && !sep6 && !value) {
            if (i7 === 0 && props.comma)
              onError(props.comma, "UNEXPECTED_TOKEN", `Unexpected , in ${fcName}`);
            else if (i7 < fc.items.length - 1)
              onError(props.start, "UNEXPECTED_TOKEN", `Unexpected empty item in ${fcName}`);
            if (props.comment) {
              if (coll.comment)
                coll.comment += "\n" + props.comment;
              else
                coll.comment = props.comment;
            }
            offset = props.end;
            continue;
          }
          if (!isMap && ctx.options.strict && utilContainsNewline.containsNewline(key))
            onError(
              key,
              // checked by containsNewline()
              "MULTILINE_IMPLICIT_KEY",
              "Implicit keys of flow sequence pairs need to be on a single line"
            );
        }
        if (i7 === 0) {
          if (props.comma)
            onError(props.comma, "UNEXPECTED_TOKEN", `Unexpected , in ${fcName}`);
        } else {
          if (!props.comma)
            onError(props.start, "MISSING_CHAR", `Missing , between ${fcName} items`);
          if (props.comment) {
            let prevItemComment = "";
            loop: for (const st2 of start) {
              switch (st2.type) {
                case "comma":
                case "space":
                  break;
                case "comment":
                  prevItemComment = st2.source.substring(1);
                  break loop;
                default:
                  break loop;
              }
            }
            if (prevItemComment) {
              let prev = coll.items[coll.items.length - 1];
              if (identity.isPair(prev))
                prev = prev.value ?? prev.key;
              if (prev.comment)
                prev.comment += "\n" + prevItemComment;
              else
                prev.comment = prevItemComment;
              props.comment = props.comment.substring(prevItemComment.length + 1);
            }
          }
        }
        if (!isMap && !sep6 && !props.found) {
          const valueNode = value ? composeNode(ctx, value, props, onError) : composeEmptyNode(ctx, props.end, sep6, null, props, onError);
          coll.items.push(valueNode);
          offset = valueNode.range[2];
          if (isBlock(value))
            onError(valueNode.range, "BLOCK_IN_FLOW", blockMsg);
        } else {
          ctx.atKey = true;
          const keyStart = props.end;
          const keyNode = key ? composeNode(ctx, key, props, onError) : composeEmptyNode(ctx, keyStart, start, null, props, onError);
          if (isBlock(key))
            onError(keyNode.range, "BLOCK_IN_FLOW", blockMsg);
          ctx.atKey = false;
          const valueProps = resolveProps.resolveProps(sep6 ?? [], {
            flow: fcName,
            indicator: "map-value-ind",
            next: value,
            offset: keyNode.range[2],
            onError,
            parentIndent: fc.indent,
            startOnNewline: false
          });
          if (valueProps.found) {
            if (!isMap && !props.found && ctx.options.strict) {
              if (sep6)
                for (const st2 of sep6) {
                  if (st2 === valueProps.found)
                    break;
                  if (st2.type === "newline") {
                    onError(st2, "MULTILINE_IMPLICIT_KEY", "Implicit keys of flow sequence pairs need to be on a single line");
                    break;
                  }
                }
              if (props.start < valueProps.found.offset - 1024)
                onError(valueProps.found, "KEY_OVER_1024_CHARS", "The : indicator must be at most 1024 chars after the start of an implicit flow sequence key");
            }
          } else if (value) {
            if ("source" in value && value.source && value.source[0] === ":")
              onError(value, "MISSING_CHAR", `Missing space after : in ${fcName}`);
            else
              onError(valueProps.start, "MISSING_CHAR", `Missing , or : between ${fcName} items`);
          }
          const valueNode = value ? composeNode(ctx, value, valueProps, onError) : valueProps.found ? composeEmptyNode(ctx, valueProps.end, sep6, null, valueProps, onError) : null;
          if (valueNode) {
            if (isBlock(value))
              onError(valueNode.range, "BLOCK_IN_FLOW", blockMsg);
          } else if (valueProps.comment) {
            if (keyNode.comment)
              keyNode.comment += "\n" + valueProps.comment;
            else
              keyNode.comment = valueProps.comment;
          }
          const pair = new Pair.Pair(keyNode, valueNode);
          if (ctx.options.keepSourceTokens)
            pair.srcToken = collItem;
          if (isMap) {
            const map2 = coll;
            if (utilMapIncludes.mapIncludes(ctx, map2.items, keyNode))
              onError(keyStart, "DUPLICATE_KEY", "Map keys must be unique");
            map2.items.push(pair);
          } else {
            const map2 = new YAMLMap.YAMLMap(ctx.schema);
            map2.flow = true;
            map2.items.push(pair);
            const endRange = (valueNode ?? keyNode).range;
            map2.range = [keyNode.range[0], endRange[1], endRange[2]];
            coll.items.push(map2);
          }
          offset = valueNode ? valueNode.range[2] : valueProps.end;
        }
      }
      const expectedEnd = isMap ? "}" : "]";
      const [ce3, ...ee2] = fc.end;
      let cePos = offset;
      if (ce3 && ce3.source === expectedEnd)
        cePos = ce3.offset + ce3.source.length;
      else {
        const name2 = fcName[0].toUpperCase() + fcName.substring(1);
        const msg = atRoot ? `${name2} must end with a ${expectedEnd}` : `${name2} in block collection must be sufficiently indented and end with a ${expectedEnd}`;
        onError(offset, atRoot ? "MISSING_CHAR" : "BAD_INDENT", msg);
        if (ce3 && ce3.source.length !== 1)
          ee2.unshift(ce3);
      }
      if (ee2.length > 0) {
        const end = resolveEnd.resolveEnd(ee2, cePos, ctx.options.strict, onError);
        if (end.comment) {
          if (coll.comment)
            coll.comment += "\n" + end.comment;
          else
            coll.comment = end.comment;
        }
        coll.range = [fc.offset, cePos, end.offset];
      } else {
        coll.range = [fc.offset, cePos, cePos];
      }
      return coll;
    }
    __name(resolveFlowCollection, "resolveFlowCollection");
    exports.resolveFlowCollection = resolveFlowCollection;
  }
});

// ../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/compose/compose-collection.js
var require_compose_collection = __commonJS({
  "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/compose/compose-collection.js"(exports) {
    init_import_meta_url();
    var identity = require_identity();
    var Scalar = require_Scalar();
    var YAMLMap = require_YAMLMap();
    var YAMLSeq = require_YAMLSeq();
    var resolveBlockMap = require_resolve_block_map();
    var resolveBlockSeq = require_resolve_block_seq();
    var resolveFlowCollection = require_resolve_flow_collection();
    function resolveCollection(CN, ctx, token, onError, tagName, tag) {
      const coll = token.type === "block-map" ? resolveBlockMap.resolveBlockMap(CN, ctx, token, onError, tag) : token.type === "block-seq" ? resolveBlockSeq.resolveBlockSeq(CN, ctx, token, onError, tag) : resolveFlowCollection.resolveFlowCollection(CN, ctx, token, onError, tag);
      const Coll = coll.constructor;
      if (tagName === "!" || tagName === Coll.tagName) {
        coll.tag = Coll.tagName;
        return coll;
      }
      if (tagName)
        coll.tag = tagName;
      return coll;
    }
    __name(resolveCollection, "resolveCollection");
    function composeCollection(CN, ctx, token, props, onError) {
      const tagToken = props.tag;
      const tagName = !tagToken ? null : ctx.directives.tagName(tagToken.source, (msg) => onError(tagToken, "TAG_RESOLVE_FAILED", msg));
      if (token.type === "block-seq") {
        const { anchor, newlineAfterProp: nl } = props;
        const lastProp = anchor && tagToken ? anchor.offset > tagToken.offset ? anchor : tagToken : anchor ?? tagToken;
        if (lastProp && (!nl || nl.offset < lastProp.offset)) {
          const message = "Missing newline after block sequence props";
          onError(lastProp, "MISSING_CHAR", message);
        }
      }
      const expType = token.type === "block-map" ? "map" : token.type === "block-seq" ? "seq" : token.start.source === "{" ? "map" : "seq";
      if (!tagToken || !tagName || tagName === "!" || tagName === YAMLMap.YAMLMap.tagName && expType === "map" || tagName === YAMLSeq.YAMLSeq.tagName && expType === "seq") {
        return resolveCollection(CN, ctx, token, onError, tagName);
      }
      let tag = ctx.schema.tags.find((t13) => t13.tag === tagName && t13.collection === expType);
      if (!tag) {
        const kt2 = ctx.schema.knownTags[tagName];
        if (kt2 && kt2.collection === expType) {
          ctx.schema.tags.push(Object.assign({}, kt2, { default: false }));
          tag = kt2;
        } else {
          if (kt2) {
            onError(tagToken, "BAD_COLLECTION_TYPE", `${kt2.tag} used for ${expType} collection, but expects ${kt2.collection ?? "scalar"}`, true);
          } else {
            onError(tagToken, "TAG_RESOLVE_FAILED", `Unresolved tag: ${tagName}`, true);
          }
          return resolveCollection(CN, ctx, token, onError, tagName);
        }
      }
      const coll = resolveCollection(CN, ctx, token, onError, tagName, tag);
      const res = tag.resolve?.(coll, (msg) => onError(tagToken, "TAG_RESOLVE_FAILED", msg), ctx.options) ?? coll;
      const node2 = identity.isNode(res) ? res : new Scalar.Scalar(res);
      node2.range = coll.range;
      node2.tag = tagName;
      if (tag?.format)
        node2.format = tag.format;
      return node2;
    }
    __name(composeCollection, "composeCollection");
    exports.composeCollection = composeCollection;
  }
});

// ../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/compose/resolve-block-scalar.js
var require_resolve_block_scalar = __commonJS({
  "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/compose/resolve-block-scalar.js"(exports) {
    init_import_meta_url();
    var Scalar = require_Scalar();
    function resolveBlockScalar(ctx, scalar, onError) {
      const start = scalar.offset;
      const header = parseBlockScalarHeader(scalar, ctx.options.strict, onError);
      if (!header)
        return { value: "", type: null, comment: "", range: [start, start, start] };
      const type = header.mode === ">" ? Scalar.Scalar.BLOCK_FOLDED : Scalar.Scalar.BLOCK_LITERAL;
      const lines = scalar.source ? splitLines(scalar.source) : [];
      let chompStart = lines.length;
      for (let i7 = lines.length - 1; i7 >= 0; --i7) {
        const content = lines[i7][1];
        if (content === "" || content === "\r")
          chompStart = i7;
        else
          break;
      }
      if (chompStart === 0) {
        const value2 = header.chomp === "+" && lines.length > 0 ? "\n".repeat(Math.max(1, lines.length - 1)) : "";
        let end2 = start + header.length;
        if (scalar.source)
          end2 += scalar.source.length;
        return { value: value2, type, comment: header.comment, range: [start, end2, end2] };
      }
      let trimIndent = scalar.indent + header.indent;
      let offset = scalar.offset + header.length;
      let contentStart = 0;
      for (let i7 = 0; i7 < chompStart; ++i7) {
        const [indent, content] = lines[i7];
        if (content === "" || content === "\r") {
          if (header.indent === 0 && indent.length > trimIndent)
            trimIndent = indent.length;
        } else {
          if (indent.length < trimIndent) {
            const message = "Block scalars with more-indented leading empty lines must use an explicit indentation indicator";
            onError(offset + indent.length, "MISSING_CHAR", message);
          }
          if (header.indent === 0)
            trimIndent = indent.length;
          contentStart = i7;
          if (trimIndent === 0 && !ctx.atRoot) {
            const message = "Block scalar values in collections must be indented";
            onError(offset, "BAD_INDENT", message);
          }
          break;
        }
        offset += indent.length + content.length + 1;
      }
      for (let i7 = lines.length - 1; i7 >= chompStart; --i7) {
        if (lines[i7][0].length > trimIndent)
          chompStart = i7 + 1;
      }
      let value = "";
      let sep6 = "";
      let prevMoreIndented = false;
      for (let i7 = 0; i7 < contentStart; ++i7)
        value += lines[i7][0].slice(trimIndent) + "\n";
      for (let i7 = contentStart; i7 < chompStart; ++i7) {
        let [indent, content] = lines[i7];
        offset += indent.length + content.length + 1;
        const crlf = content[content.length - 1] === "\r";
        if (crlf)
          content = content.slice(0, -1);
        if (content && indent.length < trimIndent) {
          const src = header.indent ? "explicit indentation indicator" : "first line";
          const message = `Block scalar lines must not be less indented than their ${src}`;
          onError(offset - content.length - (crlf ? 2 : 1), "BAD_INDENT", message);
          indent = "";
        }
        if (type === Scalar.Scalar.BLOCK_LITERAL) {
          value += sep6 + indent.slice(trimIndent) + content;
          sep6 = "\n";
        } else if (indent.length > trimIndent || content[0] === "	") {
          if (sep6 === " ")
            sep6 = "\n";
          else if (!prevMoreIndented && sep6 === "\n")
            sep6 = "\n\n";
          value += sep6 + indent.slice(trimIndent) + content;
          sep6 = "\n";
          prevMoreIndented = true;
        } else if (content === "") {
          if (sep6 === "\n")
            value += "\n";
          else
            sep6 = "\n";
        } else {
          value += sep6 + content;
          sep6 = " ";
          prevMoreIndented = false;
        }
      }
      switch (header.chomp) {
        case "-":
          break;
        case "+":
          for (let i7 = chompStart; i7 < lines.length; ++i7)
            value += "\n" + lines[i7][0].slice(trimIndent);
          if (value[value.length - 1] !== "\n")
            value += "\n";
          break;
        default:
          value += "\n";
      }
      const end = start + header.length + scalar.source.length;
      return { value, type, comment: header.comment, range: [start, end, end] };
    }
    __name(resolveBlockScalar, "resolveBlockScalar");
    function parseBlockScalarHeader({ offset, props }, strict, onError) {
      if (props[0].type !== "block-scalar-header") {
        onError(props[0], "IMPOSSIBLE", "Block scalar header not found");
        return null;
      }
      const { source } = props[0];
      const mode = source[0];
      let indent = 0;
      let chomp = "";
      let error2 = -1;
      for (let i7 = 1; i7 < source.length; ++i7) {
        const ch2 = source[i7];
        if (!chomp && (ch2 === "-" || ch2 === "+"))
          chomp = ch2;
        else {
          const n9 = Number(ch2);
          if (!indent && n9)
            indent = n9;
          else if (error2 === -1)
            error2 = offset + i7;
        }
      }
      if (error2 !== -1)
        onError(error2, "UNEXPECTED_TOKEN", `Block scalar header includes extra characters: ${source}`);
      let hasSpace = false;
      let comment = "";
      let length = source.length;
      for (let i7 = 1; i7 < props.length; ++i7) {
        const token = props[i7];
        switch (token.type) {
          case "space":
            hasSpace = true;
          // fallthrough
          case "newline":
            length += token.source.length;
            break;
          case "comment":
            if (strict && !hasSpace) {
              const message = "Comments must be separated from other tokens by white space characters";
              onError(token, "MISSING_CHAR", message);
            }
            length += token.source.length;
            comment = token.source.substring(1);
            break;
          case "error":
            onError(token, "UNEXPECTED_TOKEN", token.message);
            length += token.source.length;
            break;
          /* istanbul ignore next should not happen */
          default: {
            const message = `Unexpected token in block scalar header: ${token.type}`;
            onError(token, "UNEXPECTED_TOKEN", message);
            const ts = token.source;
            if (ts && typeof ts === "string")
              length += ts.length;
          }
        }
      }
      return { mode, indent, chomp, comment, length };
    }
    __name(parseBlockScalarHeader, "parseBlockScalarHeader");
    function splitLines(source) {
      const split = source.split(/\n( *)/);
      const first = split[0];
      const m7 = first.match(/^( *)/);
      const line0 = m7?.[1] ? [m7[1], first.slice(m7[1].length)] : ["", first];
      const lines = [line0];
      for (let i7 = 1; i7 < split.length; i7 += 2)
        lines.push([split[i7], split[i7 + 1]]);
      return lines;
    }
    __name(splitLines, "splitLines");
    exports.resolveBlockScalar = resolveBlockScalar;
  }
});

// ../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/compose/resolve-flow-scalar.js
var require_resolve_flow_scalar = __commonJS({
  "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/compose/resolve-flow-scalar.js"(exports) {
    init_import_meta_url();
    var Scalar = require_Scalar();
    var resolveEnd = require_resolve_end();
    function resolveFlowScalar(scalar, strict, onError) {
      const { offset, type, source, end } = scalar;
      let _type;
      let value;
      const _onError = /* @__PURE__ */ __name((rel, code, msg) => onError(offset + rel, code, msg), "_onError");
      switch (type) {
        case "scalar":
          _type = Scalar.Scalar.PLAIN;
          value = plainValue(source, _onError);
          break;
        case "single-quoted-scalar":
          _type = Scalar.Scalar.QUOTE_SINGLE;
          value = singleQuotedValue(source, _onError);
          break;
        case "double-quoted-scalar":
          _type = Scalar.Scalar.QUOTE_DOUBLE;
          value = doubleQuotedValue(source, _onError);
          break;
        /* istanbul ignore next should not happen */
        default:
          onError(scalar, "UNEXPECTED_TOKEN", `Expected a flow scalar value, but found: ${type}`);
          return {
            value: "",
            type: null,
            comment: "",
            range: [offset, offset + source.length, offset + source.length]
          };
      }
      const valueEnd = offset + source.length;
      const re2 = resolveEnd.resolveEnd(end, valueEnd, strict, onError);
      return {
        value,
        type: _type,
        comment: re2.comment,
        range: [offset, valueEnd, re2.offset]
      };
    }
    __name(resolveFlowScalar, "resolveFlowScalar");
    function plainValue(source, onError) {
      let badChar = "";
      switch (source[0]) {
        /* istanbul ignore next should not happen */
        case "	":
          badChar = "a tab character";
          break;
        case ",":
          badChar = "flow indicator character ,";
          break;
        case "%":
          badChar = "directive indicator character %";
          break;
        case "|":
        case ">": {
          badChar = `block scalar indicator ${source[0]}`;
          break;
        }
        case "@":
        case "`": {
          badChar = `reserved character ${source[0]}`;
          break;
        }
      }
      if (badChar)
        onError(0, "BAD_SCALAR_START", `Plain value cannot start with ${badChar}`);
      return foldLines(source);
    }
    __name(plainValue, "plainValue");
    function singleQuotedValue(source, onError) {
      if (source[source.length - 1] !== "'" || source.length === 1)
        onError(source.length, "MISSING_CHAR", "Missing closing 'quote");
      return foldLines(source.slice(1, -1)).replace(/''/g, "'");
    }
    __name(singleQuotedValue, "singleQuotedValue");
    function foldLines(source) {
      let first, line;
      try {
        first = new RegExp("(.*?)(?<![ 	])[ 	]*\r?\n", "sy");
        line = new RegExp("[ 	]*(.*?)(?:(?<![ 	])[ 	]*)?\r?\n", "sy");
      } catch {
        first = /(.*?)[ \t]*\r?\n/sy;
        line = /[ \t]*(.*?)[ \t]*\r?\n/sy;
      }
      let match3 = first.exec(source);
      if (!match3)
        return source;
      let res = match3[1];
      let sep6 = " ";
      let pos = first.lastIndex;
      line.lastIndex = pos;
      while (match3 = line.exec(source)) {
        if (match3[1] === "") {
          if (sep6 === "\n")
            res += sep6;
          else
            sep6 = "\n";
        } else {
          res += sep6 + match3[1];
          sep6 = " ";
        }
        pos = line.lastIndex;
      }
      const last = /[ \t]*(.*)/sy;
      last.lastIndex = pos;
      match3 = last.exec(source);
      return res + sep6 + (match3?.[1] ?? "");
    }
    __name(foldLines, "foldLines");
    function doubleQuotedValue(source, onError) {
      let res = "";
      for (let i7 = 1; i7 < source.length - 1; ++i7) {
        const ch2 = source[i7];
        if (ch2 === "\r" && source[i7 + 1] === "\n")
          continue;
        if (ch2 === "\n") {
          const { fold, offset } = foldNewline(source, i7);
          res += fold;
          i7 = offset;
        } else if (ch2 === "\\") {
          let next = source[++i7];
          const cc2 = escapeCodes[next];
          if (cc2)
            res += cc2;
          else if (next === "\n") {
            next = source[i7 + 1];
            while (next === " " || next === "	")
              next = source[++i7 + 1];
          } else if (next === "\r" && source[i7 + 1] === "\n") {
            next = source[++i7 + 1];
            while (next === " " || next === "	")
              next = source[++i7 + 1];
          } else if (next === "x" || next === "u" || next === "U") {
            const length = { x: 2, u: 4, U: 8 }[next];
            res += parseCharCode(source, i7 + 1, length, onError);
            i7 += length;
          } else {
            const raw = source.substr(i7 - 1, 2);
            onError(i7 - 1, "BAD_DQ_ESCAPE", `Invalid escape sequence ${raw}`);
            res += raw;
          }
        } else if (ch2 === " " || ch2 === "	") {
          const wsStart = i7;
          let next = source[i7 + 1];
          while (next === " " || next === "	")
            next = source[++i7 + 1];
          if (next !== "\n" && !(next === "\r" && source[i7 + 2] === "\n"))
            res += i7 > wsStart ? source.slice(wsStart, i7 + 1) : ch2;
        } else {
          res += ch2;
        }
      }
      if (source[source.length - 1] !== '"' || source.length === 1)
        onError(source.length, "MISSING_CHAR", 'Missing closing "quote');
      return res;
    }
    __name(doubleQuotedValue, "doubleQuotedValue");
    function foldNewline(source, offset) {
      let fold = "";
      let ch2 = source[offset + 1];
      while (ch2 === " " || ch2 === "	" || ch2 === "\n" || ch2 === "\r") {
        if (ch2 === "\r" && source[offset + 2] !== "\n")
          break;
        if (ch2 === "\n")
          fold += "\n";
        offset += 1;
        ch2 = source[offset + 1];
      }
      if (!fold)
        fold = " ";
      return { fold, offset };
    }
    __name(foldNewline, "foldNewline");
    var escapeCodes = {
      "0": "\0",
      // null character
      a: "\x07",
      // bell character
      b: "\b",
      // backspace
      e: "\x1B",
      // escape character
      f: "\f",
      // form feed
      n: "\n",
      // line feed
      r: "\r",
      // carriage return
      t: "	",
      // horizontal tab
      v: "\v",
      // vertical tab
      N: "\x85",
      // Unicode next line
      _: "\xA0",
      // Unicode non-breaking space
      L: "\u2028",
      // Unicode line separator
      P: "\u2029",
      // Unicode paragraph separator
      " ": " ",
      '"': '"',
      "/": "/",
      "\\": "\\",
      "	": "	"
    };
    function parseCharCode(source, offset, length, onError) {
      const cc2 = source.substr(offset, length);
      const ok = cc2.length === length && /^[0-9a-fA-F]+$/.test(cc2);
      const code = ok ? parseInt(cc2, 16) : NaN;
      if (isNaN(code)) {
        const raw = source.substr(offset - 2, length + 2);
        onError(offset - 2, "BAD_DQ_ESCAPE", `Invalid escape sequence ${raw}`);
        return raw;
      }
      return String.fromCodePoint(code);
    }
    __name(parseCharCode, "parseCharCode");
    exports.resolveFlowScalar = resolveFlowScalar;
  }
});

// ../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/compose/compose-scalar.js
var require_compose_scalar = __commonJS({
  "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/compose/compose-scalar.js"(exports) {
    init_import_meta_url();
    var identity = require_identity();
    var Scalar = require_Scalar();
    var resolveBlockScalar = require_resolve_block_scalar();
    var resolveFlowScalar = require_resolve_flow_scalar();
    function composeScalar(ctx, token, tagToken, onError) {
      const { value, type, comment, range } = token.type === "block-scalar" ? resolveBlockScalar.resolveBlockScalar(ctx, token, onError) : resolveFlowScalar.resolveFlowScalar(token, ctx.options.strict, onError);
      const tagName = tagToken ? ctx.directives.tagName(tagToken.source, (msg) => onError(tagToken, "TAG_RESOLVE_FAILED", msg)) : null;
      let tag;
      if (ctx.options.stringKeys && ctx.atKey) {
        tag = ctx.schema[identity.SCALAR];
      } else if (tagName)
        tag = findScalarTagByName(ctx.schema, value, tagName, tagToken, onError);
      else if (token.type === "scalar")
        tag = findScalarTagByTest(ctx, value, token, onError);
      else
        tag = ctx.schema[identity.SCALAR];
      let scalar;
      try {
        const res = tag.resolve(value, (msg) => onError(tagToken ?? token, "TAG_RESOLVE_FAILED", msg), ctx.options);
        scalar = identity.isScalar(res) ? res : new Scalar.Scalar(res);
      } catch (error2) {
        const msg = error2 instanceof Error ? error2.message : String(error2);
        onError(tagToken ?? token, "TAG_RESOLVE_FAILED", msg);
        scalar = new Scalar.Scalar(value);
      }
      scalar.range = range;
      scalar.source = value;
      if (type)
        scalar.type = type;
      if (tagName)
        scalar.tag = tagName;
      if (tag.format)
        scalar.format = tag.format;
      if (comment)
        scalar.comment = comment;
      return scalar;
    }
    __name(composeScalar, "composeScalar");
    function findScalarTagByName(schema, value, tagName, tagToken, onError) {
      if (tagName === "!")
        return schema[identity.SCALAR];
      const matchWithTest = [];
      for (const tag of schema.tags) {
        if (!tag.collection && tag.tag === tagName) {
          if (tag.default && tag.test)
            matchWithTest.push(tag);
          else
            return tag;
        }
      }
      for (const tag of matchWithTest)
        if (tag.test?.test(value))
          return tag;
      const kt2 = schema.knownTags[tagName];
      if (kt2 && !kt2.collection) {
        schema.tags.push(Object.assign({}, kt2, { default: false, test: void 0 }));
        return kt2;
      }
      onError(tagToken, "TAG_RESOLVE_FAILED", `Unresolved tag: ${tagName}`, tagName !== "tag:yaml.org,2002:str");
      return schema[identity.SCALAR];
    }
    __name(findScalarTagByName, "findScalarTagByName");
    function findScalarTagByTest({ atKey, directives, schema }, value, token, onError) {
      const tag = schema.tags.find((tag2) => (tag2.default === true || atKey && tag2.default === "key") && tag2.test?.test(value)) || schema[identity.SCALAR];
      if (schema.compat) {
        const compat = schema.compat.find((tag2) => tag2.default && tag2.test?.test(value)) ?? schema[identity.SCALAR];
        if (tag.tag !== compat.tag) {
          const ts = directives.tagString(tag.tag);
          const cs2 = directives.tagString(compat.tag);
          const msg = `Value may be parsed as either ${ts} or ${cs2}`;
          onError(token, "TAG_RESOLVE_FAILED", msg, true);
        }
      }
      return tag;
    }
    __name(findScalarTagByTest, "findScalarTagByTest");
    exports.composeScalar = composeScalar;
  }
});

// ../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/compose/util-empty-scalar-position.js
var require_util_empty_scalar_position = __commonJS({
  "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/compose/util-empty-scalar-position.js"(exports) {
    init_import_meta_url();
    function emptyScalarPosition(offset, before, pos) {
      if (before) {
        pos ?? (pos = before.length);
        for (let i7 = pos - 1; i7 >= 0; --i7) {
          let st2 = before[i7];
          switch (st2.type) {
            case "space":
            case "comment":
            case "newline":
              offset -= st2.source.length;
              continue;
          }
          st2 = before[++i7];
          while (st2?.type === "space") {
            offset += st2.source.length;
            st2 = before[++i7];
          }
          break;
        }
      }
      return offset;
    }
    __name(emptyScalarPosition, "emptyScalarPosition");
    exports.emptyScalarPosition = emptyScalarPosition;
  }
});

// ../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/compose/compose-node.js
var require_compose_node = __commonJS({
  "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/compose/compose-node.js"(exports) {
    init_import_meta_url();
    var Alias = require_Alias();
    var identity = require_identity();
    var composeCollection = require_compose_collection();
    var composeScalar = require_compose_scalar();
    var resolveEnd = require_resolve_end();
    var utilEmptyScalarPosition = require_util_empty_scalar_position();
    var CN = { composeNode, composeEmptyNode };
    function composeNode(ctx, token, props, onError) {
      const atKey = ctx.atKey;
      const { spaceBefore, comment, anchor, tag } = props;
      let node2;
      let isSrcToken = true;
      switch (token.type) {
        case "alias":
          node2 = composeAlias(ctx, token, onError);
          if (anchor || tag)
            onError(token, "ALIAS_PROPS", "An alias node must not specify any properties");
          break;
        case "scalar":
        case "single-quoted-scalar":
        case "double-quoted-scalar":
        case "block-scalar":
          node2 = composeScalar.composeScalar(ctx, token, tag, onError);
          if (anchor)
            node2.anchor = anchor.source.substring(1);
          break;
        case "block-map":
        case "block-seq":
        case "flow-collection":
          node2 = composeCollection.composeCollection(CN, ctx, token, props, onError);
          if (anchor)
            node2.anchor = anchor.source.substring(1);
          break;
        default: {
          const message = token.type === "error" ? token.message : `Unsupported token (type: ${token.type})`;
          onError(token, "UNEXPECTED_TOKEN", message);
          node2 = composeEmptyNode(ctx, token.offset, void 0, null, props, onError);
          isSrcToken = false;
        }
      }
      if (anchor && node2.anchor === "")
        onError(anchor, "BAD_ALIAS", "Anchor cannot be an empty string");
      if (atKey && ctx.options.stringKeys && (!identity.isScalar(node2) || typeof node2.value !== "string" || node2.tag && node2.tag !== "tag:yaml.org,2002:str")) {
        const msg = "With stringKeys, all keys must be strings";
        onError(tag ?? token, "NON_STRING_KEY", msg);
      }
      if (spaceBefore)
        node2.spaceBefore = true;
      if (comment) {
        if (token.type === "scalar" && token.source === "")
          node2.comment = comment;
        else
          node2.commentBefore = comment;
      }
      if (ctx.options.keepSourceTokens && isSrcToken)
        node2.srcToken = token;
      return node2;
    }
    __name(composeNode, "composeNode");
    function composeEmptyNode(ctx, offset, before, pos, { spaceBefore, comment, anchor, tag, end }, onError) {
      const token = {
        type: "scalar",
        offset: utilEmptyScalarPosition.emptyScalarPosition(offset, before, pos),
        indent: -1,
        source: ""
      };
      const node2 = composeScalar.composeScalar(ctx, token, tag, onError);
      if (anchor) {
        node2.anchor = anchor.source.substring(1);
        if (node2.anchor === "")
          onError(anchor, "BAD_ALIAS", "Anchor cannot be an empty string");
      }
      if (spaceBefore)
        node2.spaceBefore = true;
      if (comment) {
        node2.comment = comment;
        node2.range[2] = end;
      }
      return node2;
    }
    __name(composeEmptyNode, "composeEmptyNode");
    function composeAlias({ options }, { offset, source, end }, onError) {
      const alias = new Alias.Alias(source.substring(1));
      if (alias.source === "")
        onError(offset, "BAD_ALIAS", "Alias cannot be an empty string");
      if (alias.source.endsWith(":"))
        onError(offset + source.length - 1, "BAD_ALIAS", "Alias ending in : is ambiguous", true);
      const valueEnd = offset + source.length;
      const re2 = resolveEnd.resolveEnd(end, valueEnd, options.strict, onError);
      alias.range = [offset, valueEnd, re2.offset];
      if (re2.comment)
        alias.comment = re2.comment;
      return alias;
    }
    __name(composeAlias, "composeAlias");
    exports.composeEmptyNode = composeEmptyNode;
    exports.composeNode = composeNode;
  }
});

// ../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/compose/compose-doc.js
var require_compose_doc = __commonJS({
  "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/compose/compose-doc.js"(exports) {
    init_import_meta_url();
    var Document = require_Document();
    var composeNode = require_compose_node();
    var resolveEnd = require_resolve_end();
    var resolveProps = require_resolve_props();
    function composeDoc(options, directives, { offset, start, value, end }, onError) {
      const opts = Object.assign({ _directives: directives }, options);
      const doc = new Document.Document(void 0, opts);
      const ctx = {
        atKey: false,
        atRoot: true,
        directives: doc.directives,
        options: doc.options,
        schema: doc.schema
      };
      const props = resolveProps.resolveProps(start, {
        indicator: "doc-start",
        next: value ?? end?.[0],
        offset,
        onError,
        parentIndent: 0,
        startOnNewline: true
      });
      if (props.found) {
        doc.directives.docStart = true;
        if (value && (value.type === "block-map" || value.type === "block-seq") && !props.hasNewline)
          onError(props.end, "MISSING_CHAR", "Block collection cannot start on same line with directives-end marker");
      }
      doc.contents = value ? composeNode.composeNode(ctx, value, props, onError) : composeNode.composeEmptyNode(ctx, props.end, start, null, props, onError);
      const contentEnd = doc.contents.range[2];
      const re2 = resolveEnd.resolveEnd(end, contentEnd, false, onError);
      if (re2.comment)
        doc.comment = re2.comment;
      doc.range = [offset, contentEnd, re2.offset];
      return doc;
    }
    __name(composeDoc, "composeDoc");
    exports.composeDoc = composeDoc;
  }
});

// ../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/compose/composer.js
var require_composer = __commonJS({
  "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/compose/composer.js"(exports) {
    init_import_meta_url();
    var node_process = __require("process");
    var directives = require_directives();
    var Document = require_Document();
    var errors = require_errors2();
    var identity = require_identity();
    var composeDoc = require_compose_doc();
    var resolveEnd = require_resolve_end();
    function getErrorPos(src) {
      if (typeof src === "number")
        return [src, src + 1];
      if (Array.isArray(src))
        return src.length === 2 ? src : [src[0], src[1]];
      const { offset, source } = src;
      return [offset, offset + (typeof source === "string" ? source.length : 1)];
    }
    __name(getErrorPos, "getErrorPos");
    function parsePrelude(prelude) {
      let comment = "";
      let atComment = false;
      let afterEmptyLine = false;
      for (let i7 = 0; i7 < prelude.length; ++i7) {
        const source = prelude[i7];
        switch (source[0]) {
          case "#":
            comment += (comment === "" ? "" : afterEmptyLine ? "\n\n" : "\n") + (source.substring(1) || " ");
            atComment = true;
            afterEmptyLine = false;
            break;
          case "%":
            if (prelude[i7 + 1]?.[0] !== "#")
              i7 += 1;
            atComment = false;
            break;
          default:
            if (!atComment)
              afterEmptyLine = true;
            atComment = false;
        }
      }
      return { comment, afterEmptyLine };
    }
    __name(parsePrelude, "parsePrelude");
    var Composer = class {
      static {
        __name(this, "Composer");
      }
      constructor(options = {}) {
        this.doc = null;
        this.atDirectives = false;
        this.prelude = [];
        this.errors = [];
        this.warnings = [];
        this.onError = (source, code, message, warning) => {
          const pos = getErrorPos(source);
          if (warning)
            this.warnings.push(new errors.YAMLWarning(pos, code, message));
          else
            this.errors.push(new errors.YAMLParseError(pos, code, message));
        };
        this.directives = new directives.Directives({ version: options.version || "1.2" });
        this.options = options;
      }
      decorate(doc, afterDoc) {
        const { comment, afterEmptyLine } = parsePrelude(this.prelude);
        if (comment) {
          const dc = doc.contents;
          if (afterDoc) {
            doc.comment = doc.comment ? `${doc.comment}
${comment}` : comment;
          } else if (afterEmptyLine || doc.directives.docStart || !dc) {
            doc.commentBefore = comment;
          } else if (identity.isCollection(dc) && !dc.flow && dc.items.length > 0) {
            let it2 = dc.items[0];
            if (identity.isPair(it2))
              it2 = it2.key;
            const cb2 = it2.commentBefore;
            it2.commentBefore = cb2 ? `${comment}
${cb2}` : comment;
          } else {
            const cb2 = dc.commentBefore;
            dc.commentBefore = cb2 ? `${comment}
${cb2}` : comment;
          }
        }
        if (afterDoc) {
          Array.prototype.push.apply(doc.errors, this.errors);
          Array.prototype.push.apply(doc.warnings, this.warnings);
        } else {
          doc.errors = this.errors;
          doc.warnings = this.warnings;
        }
        this.prelude = [];
        this.errors = [];
        this.warnings = [];
      }
      /**
       * Current stream status information.
       *
       * Mostly useful at the end of input for an empty stream.
       */
      streamInfo() {
        return {
          comment: parsePrelude(this.prelude).comment,
          directives: this.directives,
          errors: this.errors,
          warnings: this.warnings
        };
      }
      /**
       * Compose tokens into documents.
       *
       * @param forceDoc - If the stream contains no document, still emit a final document including any comments and directives that would be applied to a subsequent document.
       * @param endOffset - Should be set if `forceDoc` is also set, to set the document range end and to indicate errors correctly.
       */
      *compose(tokens, forceDoc = false, endOffset = -1) {
        for (const token of tokens)
          yield* this.next(token);
        yield* this.end(forceDoc, endOffset);
      }
      /** Advance the composer by one CST token. */
      *next(token) {
        if (node_process.env.LOG_STREAM)
          console.dir(token, { depth: null });
        switch (token.type) {
          case "directive":
            this.directives.add(token.source, (offset, message, warning) => {
              const pos = getErrorPos(token);
              pos[0] += offset;
              this.onError(pos, "BAD_DIRECTIVE", message, warning);
            });
            this.prelude.push(token.source);
            this.atDirectives = true;
            break;
          case "document": {
            const doc = composeDoc.composeDoc(this.options, this.directives, token, this.onError);
            if (this.atDirectives && !doc.directives.docStart)
              this.onError(token, "MISSING_CHAR", "Missing directives-end/doc-start indicator line");
            this.decorate(doc, false);
            if (this.doc)
              yield this.doc;
            this.doc = doc;
            this.atDirectives = false;
            break;
          }
          case "byte-order-mark":
          case "space":
            break;
          case "comment":
          case "newline":
            this.prelude.push(token.source);
            break;
          case "error": {
            const msg = token.source ? `${token.message}: ${JSON.stringify(token.source)}` : token.message;
            const error2 = new errors.YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", msg);
            if (this.atDirectives || !this.doc)
              this.errors.push(error2);
            else
              this.doc.errors.push(error2);
            break;
          }
          case "doc-end": {
            if (!this.doc) {
              const msg = "Unexpected doc-end without preceding document";
              this.errors.push(new errors.YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", msg));
              break;
            }
            this.doc.directives.docEnd = true;
            const end = resolveEnd.resolveEnd(token.end, token.offset + token.source.length, this.doc.options.strict, this.onError);
            this.decorate(this.doc, true);
            if (end.comment) {
              const dc = this.doc.comment;
              this.doc.comment = dc ? `${dc}
${end.comment}` : end.comment;
            }
            this.doc.range[2] = end.offset;
            break;
          }
          default:
            this.errors.push(new errors.YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", `Unsupported token ${token.type}`));
        }
      }
      /**
       * Call at end of input to yield any remaining document.
       *
       * @param forceDoc - If the stream contains no document, still emit a final document including any comments and directives that would be applied to a subsequent document.
       * @param endOffset - Should be set if `forceDoc` is also set, to set the document range end and to indicate errors correctly.
       */
      *end(forceDoc = false, endOffset = -1) {
        if (this.doc) {
          this.decorate(this.doc, true);
          yield this.doc;
          this.doc = null;
        } else if (forceDoc) {
          const opts = Object.assign({ _directives: this.directives }, this.options);
          const doc = new Document.Document(void 0, opts);
          if (this.atDirectives)
            this.onError(endOffset, "MISSING_CHAR", "Missing directives-end indicator line");
          doc.range = [0, endOffset, endOffset];
          this.decorate(doc, false);
          yield doc;
        }
      }
    };
    exports.Composer = Composer;
  }
});

// ../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/parse/cst-scalar.js
var require_cst_scalar = __commonJS({
  "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/parse/cst-scalar.js"(exports) {
    init_import_meta_url();
    var resolveBlockScalar = require_resolve_block_scalar();
    var resolveFlowScalar = require_resolve_flow_scalar();
    var errors = require_errors2();
    var stringifyString = require_stringifyString();
    function resolveAsScalar(token, strict = true, onError) {
      if (token) {
        const _onError = /* @__PURE__ */ __name((pos, code, message) => {
          const offset = typeof pos === "number" ? pos : Array.isArray(pos) ? pos[0] : pos.offset;
          if (onError)
            onError(offset, code, message);
          else
            throw new errors.YAMLParseError([offset, offset + 1], code, message);
        }, "_onError");
        switch (token.type) {
          case "scalar":
          case "single-quoted-scalar":
          case "double-quoted-scalar":
            return resolveFlowScalar.resolveFlowScalar(token, strict, _onError);
          case "block-scalar":
            return resolveBlockScalar.resolveBlockScalar({ options: { strict } }, token, _onError);
        }
      }
      return null;
    }
    __name(resolveAsScalar, "resolveAsScalar");
    function createScalarToken(value, context2) {
      const { implicitKey = false, indent, inFlow = false, offset = -1, type = "PLAIN" } = context2;
      const source = stringifyString.stringifyString({ type, value }, {
        implicitKey,
        indent: indent > 0 ? " ".repeat(indent) : "",
        inFlow,
        options: { blockQuote: true, lineWidth: -1 }
      });
      const end = context2.end ?? [
        { type: "newline", offset: -1, indent, source: "\n" }
      ];
      switch (source[0]) {
        case "|":
        case ">": {
          const he2 = source.indexOf("\n");
          const head = source.substring(0, he2);
          const body = source.substring(he2 + 1) + "\n";
          const props = [
            { type: "block-scalar-header", offset, indent, source: head }
          ];
          if (!addEndtoBlockProps(props, end))
            props.push({ type: "newline", offset: -1, indent, source: "\n" });
          return { type: "block-scalar", offset, indent, props, source: body };
        }
        case '"':
          return { type: "double-quoted-scalar", offset, indent, source, end };
        case "'":
          return { type: "single-quoted-scalar", offset, indent, source, end };
        default:
          return { type: "scalar", offset, indent, source, end };
      }
    }
    __name(createScalarToken, "createScalarToken");
    function setScalarValue(token, value, context2 = {}) {
      let { afterKey = false, implicitKey = false, inFlow = false, type } = context2;
      let indent = "indent" in token ? token.indent : null;
      if (afterKey && typeof indent === "number")
        indent += 2;
      if (!type)
        switch (token.type) {
          case "single-quoted-scalar":
            type = "QUOTE_SINGLE";
            break;
          case "double-quoted-scalar":
            type = "QUOTE_DOUBLE";
            break;
          case "block-scalar": {
            const header = token.props[0];
            if (header.type !== "block-scalar-header")
              throw new Error("Invalid block scalar header");
            type = header.source[0] === ">" ? "BLOCK_FOLDED" : "BLOCK_LITERAL";
            break;
          }
          default:
            type = "PLAIN";
        }
      const source = stringifyString.stringifyString({ type, value }, {
        implicitKey: implicitKey || indent === null,
        indent: indent !== null && indent > 0 ? " ".repeat(indent) : "",
        inFlow,
        options: { blockQuote: true, lineWidth: -1 }
      });
      switch (source[0]) {
        case "|":
        case ">":
          setBlockScalarValue(token, source);
          break;
        case '"':
          setFlowScalarValue(token, source, "double-quoted-scalar");
          break;
        case "'":
          setFlowScalarValue(token, source, "single-quoted-scalar");
          break;
        default:
          setFlowScalarValue(token, source, "scalar");
      }
    }
    __name(setScalarValue, "setScalarValue");
    function setBlockScalarValue(token, source) {
      const he2 = source.indexOf("\n");
      const head = source.substring(0, he2);
      const body = source.substring(he2 + 1) + "\n";
      if (token.type === "block-scalar") {
        const header = token.props[0];
        if (header.type !== "block-scalar-header")
          throw new Error("Invalid block scalar header");
        header.source = head;
        token.source = body;
      } else {
        const { offset } = token;
        const indent = "indent" in token ? token.indent : -1;
        const props = [
          { type: "block-scalar-header", offset, indent, source: head }
        ];
        if (!addEndtoBlockProps(props, "end" in token ? token.end : void 0))
          props.push({ type: "newline", offset: -1, indent, source: "\n" });
        for (const key of Object.keys(token))
          if (key !== "type" && key !== "offset")
            delete token[key];
        Object.assign(token, { type: "block-scalar", indent, props, source: body });
      }
    }
    __name(setBlockScalarValue, "setBlockScalarValue");
    function addEndtoBlockProps(props, end) {
      if (end)
        for (const st2 of end)
          switch (st2.type) {
            case "space":
            case "comment":
              props.push(st2);
              break;
            case "newline":
              props.push(st2);
              return true;
          }
      return false;
    }
    __name(addEndtoBlockProps, "addEndtoBlockProps");
    function setFlowScalarValue(token, source, type) {
      switch (token.type) {
        case "scalar":
        case "double-quoted-scalar":
        case "single-quoted-scalar":
          token.type = type;
          token.source = source;
          break;
        case "block-scalar": {
          const end = token.props.slice(1);
          let oa = source.length;
          if (token.props[0].type === "block-scalar-header")
            oa -= token.props[0].source.length;
          for (const tok of end)
            tok.offset += oa;
          delete token.props;
          Object.assign(token, { type, source, end });
          break;
        }
        case "block-map":
        case "block-seq": {
          const offset = token.offset + source.length;
          const nl = { type: "newline", offset, indent: token.indent, source: "\n" };
          delete token.items;
          Object.assign(token, { type, source, end: [nl] });
          break;
        }
        default: {
          const indent = "indent" in token ? token.indent : -1;
          const end = "end" in token && Array.isArray(token.end) ? token.end.filter((st2) => st2.type === "space" || st2.type === "comment" || st2.type === "newline") : [];
          for (const key of Object.keys(token))
            if (key !== "type" && key !== "offset")
              delete token[key];
          Object.assign(token, { type, indent, source, end });
        }
      }
    }
    __name(setFlowScalarValue, "setFlowScalarValue");
    exports.createScalarToken = createScalarToken;
    exports.resolveAsScalar = resolveAsScalar;
    exports.setScalarValue = setScalarValue;
  }
});

// ../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/parse/cst-stringify.js
var require_cst_stringify = __commonJS({
  "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/parse/cst-stringify.js"(exports) {
    init_import_meta_url();
    var stringify4 = /* @__PURE__ */ __name((cst) => "type" in cst ? stringifyToken(cst) : stringifyItem(cst), "stringify");
    function stringifyToken(token) {
      switch (token.type) {
        case "block-scalar": {
          let res = "";
          for (const tok of token.props)
            res += stringifyToken(tok);
          return res + token.source;
        }
        case "block-map":
        case "block-seq": {
          let res = "";
          for (const item of token.items)
            res += stringifyItem(item);
          return res;
        }
        case "flow-collection": {
          let res = token.start.source;
          for (const item of token.items)
            res += stringifyItem(item);
          for (const st2 of token.end)
            res += st2.source;
          return res;
        }
        case "document": {
          let res = stringifyItem(token);
          if (token.end)
            for (const st2 of token.end)
              res += st2.source;
          return res;
        }
        default: {
          let res = token.source;
          if ("end" in token && token.end)
            for (const st2 of token.end)
              res += st2.source;
          return res;
        }
      }
    }
    __name(stringifyToken, "stringifyToken");
    function stringifyItem({ start, key, sep: sep6, value }) {
      let res = "";
      for (const st2 of start)
        res += st2.source;
      if (key)
        res += stringifyToken(key);
      if (sep6)
        for (const st2 of sep6)
          res += st2.source;
      if (value)
        res += stringifyToken(value);
      return res;
    }
    __name(stringifyItem, "stringifyItem");
    exports.stringify = stringify4;
  }
});

// ../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/parse/cst-visit.js
var require_cst_visit = __commonJS({
  "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/parse/cst-visit.js"(exports) {
    init_import_meta_url();
    var BREAK = Symbol("break visit");
    var SKIP = Symbol("skip children");
    var REMOVE = Symbol("remove item");
    function visit5(cst, visitor) {
      if ("type" in cst && cst.type === "document")
        cst = { start: cst.start, value: cst.value };
      _visit(Object.freeze([]), cst, visitor);
    }
    __name(visit5, "visit");
    visit5.BREAK = BREAK;
    visit5.SKIP = SKIP;
    visit5.REMOVE = REMOVE;
    visit5.itemAtPath = (cst, path84) => {
      let item = cst;
      for (const [field, index] of path84) {
        const tok = item?.[field];
        if (tok && "items" in tok) {
          item = tok.items[index];
        } else
          return void 0;
      }
      return item;
    };
    visit5.parentCollection = (cst, path84) => {
      const parent = visit5.itemAtPath(cst, path84.slice(0, -1));
      const field = path84[path84.length - 1][0];
      const coll = parent?.[field];
      if (coll && "items" in coll)
        return coll;
      throw new Error("Parent collection not found");
    };
    function _visit(path84, item, visitor) {
      let ctrl = visitor(item, path84);
      if (typeof ctrl === "symbol")
        return ctrl;
      for (const field of ["key", "value"]) {
        const token = item[field];
        if (token && "items" in token) {
          for (let i7 = 0; i7 < token.items.length; ++i7) {
            const ci7 = _visit(Object.freeze(path84.concat([[field, i7]])), token.items[i7], visitor);
            if (typeof ci7 === "number")
              i7 = ci7 - 1;
            else if (ci7 === BREAK)
              return BREAK;
            else if (ci7 === REMOVE) {
              token.items.splice(i7, 1);
              i7 -= 1;
            }
          }
          if (typeof ctrl === "function" && field === "key")
            ctrl = ctrl(item, path84);
        }
      }
      return typeof ctrl === "function" ? ctrl(item, path84) : ctrl;
    }
    __name(_visit, "_visit");
    exports.visit = visit5;
  }
});

// ../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/parse/cst.js
var require_cst = __commonJS({
  "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/parse/cst.js"(exports) {
    init_import_meta_url();
    var cstScalar = require_cst_scalar();
    var cstStringify = require_cst_stringify();
    var cstVisit = require_cst_visit();
    var BOM = "\uFEFF";
    var DOCUMENT = "";
    var FLOW_END = "";
    var SCALAR = "";
    var isCollection = /* @__PURE__ */ __name((token) => !!token && "items" in token, "isCollection");
    var isScalar = /* @__PURE__ */ __name((token) => !!token && (token.type === "scalar" || token.type === "single-quoted-scalar" || token.type === "double-quoted-scalar" || token.type === "block-scalar"), "isScalar");
    function prettyToken(token) {
      switch (token) {
        case BOM:
          return "<BOM>";
        case DOCUMENT:
          return "<DOC>";
        case FLOW_END:
          return "<FLOW_END>";
        case SCALAR:
          return "<SCALAR>";
        default:
          return JSON.stringify(token);
      }
    }
    __name(prettyToken, "prettyToken");
    function tokenType(source) {
      switch (source) {
        case BOM:
          return "byte-order-mark";
        case DOCUMENT:
          return "doc-mode";
        case FLOW_END:
          return "flow-error-end";
        case SCALAR:
          return "scalar";
        case "---":
          return "doc-start";
        case "...":
          return "doc-end";
        case "":
        case "\n":
        case "\r\n":
          return "newline";
        case "-":
          return "seq-item-ind";
        case "?":
          return "explicit-key-ind";
        case ":":
          return "map-value-ind";
        case "{":
          return "flow-map-start";
        case "}":
          return "flow-map-end";
        case "[":
          return "flow-seq-start";
        case "]":
          return "flow-seq-end";
        case ",":
          return "comma";
      }
      switch (source[0]) {
        case " ":
        case "	":
          return "space";
        case "#":
          return "comment";
        case "%":
          return "directive-line";
        case "*":
          return "alias";
        case "&":
          return "anchor";
        case "!":
          return "tag";
        case "'":
          return "single-quoted-scalar";
        case '"':
          return "double-quoted-scalar";
        case "|":
        case ">":
          return "block-scalar-header";
      }
      return null;
    }
    __name(tokenType, "tokenType");
    exports.createScalarToken = cstScalar.createScalarToken;
    exports.resolveAsScalar = cstScalar.resolveAsScalar;
    exports.setScalarValue = cstScalar.setScalarValue;
    exports.stringify = cstStringify.stringify;
    exports.visit = cstVisit.visit;
    exports.BOM = BOM;
    exports.DOCUMENT = DOCUMENT;
    exports.FLOW_END = FLOW_END;
    exports.SCALAR = SCALAR;
    exports.isCollection = isCollection;
    exports.isScalar = isScalar;
    exports.prettyToken = prettyToken;
    exports.tokenType = tokenType;
  }
});

// ../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/parse/lexer.js
var require_lexer = __commonJS({
  "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/parse/lexer.js"(exports) {
    init_import_meta_url();
    var cst = require_cst();
    function isEmpty(ch2) {
      switch (ch2) {
        case void 0:
        case " ":
        case "\n":
        case "\r":
        case "	":
          return true;
        default:
          return false;
      }
    }
    __name(isEmpty, "isEmpty");
    var hexDigits = new Set("0123456789ABCDEFabcdef");
    var tagChars = new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()");
    var flowIndicatorChars = new Set(",[]{}");
    var invalidAnchorChars = new Set(" ,[]{}\n\r	");
    var isNotAnchorChar = /* @__PURE__ */ __name((ch2) => !ch2 || invalidAnchorChars.has(ch2), "isNotAnchorChar");
    var Lexer = class {
      static {
        __name(this, "Lexer");
      }
      constructor() {
        this.atEnd = false;
        this.blockScalarIndent = -1;
        this.blockScalarKeep = false;
        this.buffer = "";
        this.flowKey = false;
        this.flowLevel = 0;
        this.indentNext = 0;
        this.indentValue = 0;
        this.lineEndPos = null;
        this.next = null;
        this.pos = 0;
      }
      /**
       * Generate YAML tokens from the `source` string. If `incomplete`,
       * a part of the last line may be left as a buffer for the next call.
       *
       * @returns A generator of lexical tokens
       */
      *lex(source, incomplete = false) {
        if (source) {
          if (typeof source !== "string")
            throw TypeError("source is not a string");
          this.buffer = this.buffer ? this.buffer + source : source;
          this.lineEndPos = null;
        }
        this.atEnd = !incomplete;
        let next = this.next ?? "stream";
        while (next && (incomplete || this.hasChars(1)))
          next = yield* this.parseNext(next);
      }
      atLineEnd() {
        let i7 = this.pos;
        let ch2 = this.buffer[i7];
        while (ch2 === " " || ch2 === "	")
          ch2 = this.buffer[++i7];
        if (!ch2 || ch2 === "#" || ch2 === "\n")
          return true;
        if (ch2 === "\r")
          return this.buffer[i7 + 1] === "\n";
        return false;
      }
      charAt(n9) {
        return this.buffer[this.pos + n9];
      }
      continueScalar(offset) {
        let ch2 = this.buffer[offset];
        if (this.indentNext > 0) {
          let indent = 0;
          while (ch2 === " ")
            ch2 = this.buffer[++indent + offset];
          if (ch2 === "\r") {
            const next = this.buffer[indent + offset + 1];
            if (next === "\n" || !next && !this.atEnd)
              return offset + indent + 1;
          }
          return ch2 === "\n" || indent >= this.indentNext || !ch2 && !this.atEnd ? offset + indent : -1;
        }
        if (ch2 === "-" || ch2 === ".") {
          const dt2 = this.buffer.substr(offset, 3);
          if ((dt2 === "---" || dt2 === "...") && isEmpty(this.buffer[offset + 3]))
            return -1;
        }
        return offset;
      }
      getLine() {
        let end = this.lineEndPos;
        if (typeof end !== "number" || end !== -1 && end < this.pos) {
          end = this.buffer.indexOf("\n", this.pos);
          this.lineEndPos = end;
        }
        if (end === -1)
          return this.atEnd ? this.buffer.substring(this.pos) : null;
        if (this.buffer[end - 1] === "\r")
          end -= 1;
        return this.buffer.substring(this.pos, end);
      }
      hasChars(n9) {
        return this.pos + n9 <= this.buffer.length;
      }
      setNext(state2) {
        this.buffer = this.buffer.substring(this.pos);
        this.pos = 0;
        this.lineEndPos = null;
        this.next = state2;
        return null;
      }
      peek(n9) {
        return this.buffer.substr(this.pos, n9);
      }
      *parseNext(next) {
        switch (next) {
          case "stream":
            return yield* this.parseStream();
          case "line-start":
            return yield* this.parseLineStart();
          case "block-start":
            return yield* this.parseBlockStart();
          case "doc":
            return yield* this.parseDocument();
          case "flow":
            return yield* this.parseFlowCollection();
          case "quoted-scalar":
            return yield* this.parseQuotedScalar();
          case "block-scalar":
            return yield* this.parseBlockScalar();
          case "plain-scalar":
            return yield* this.parsePlainScalar();
        }
      }
      *parseStream() {
        let line = this.getLine();
        if (line === null)
          return this.setNext("stream");
        if (line[0] === cst.BOM) {
          yield* this.pushCount(1);
          line = line.substring(1);
        }
        if (line[0] === "%") {
          let dirEnd = line.length;
          let cs2 = line.indexOf("#");
          while (cs2 !== -1) {
            const ch2 = line[cs2 - 1];
            if (ch2 === " " || ch2 === "	") {
              dirEnd = cs2 - 1;
              break;
            } else {
              cs2 = line.indexOf("#", cs2 + 1);
            }
          }
          while (true) {
            const ch2 = line[dirEnd - 1];
            if (ch2 === " " || ch2 === "	")
              dirEnd -= 1;
            else
              break;
          }
          const n9 = (yield* this.pushCount(dirEnd)) + (yield* this.pushSpaces(true));
          yield* this.pushCount(line.length - n9);
          this.pushNewline();
          return "stream";
        }
        if (this.atLineEnd()) {
          const sp = yield* this.pushSpaces(true);
          yield* this.pushCount(line.length - sp);
          yield* this.pushNewline();
          return "stream";
        }
        yield cst.DOCUMENT;
        return yield* this.parseLineStart();
      }
      *parseLineStart() {
        const ch2 = this.charAt(0);
        if (!ch2 && !this.atEnd)
          return this.setNext("line-start");
        if (ch2 === "-" || ch2 === ".") {
          if (!this.atEnd && !this.hasChars(4))
            return this.setNext("line-start");
          const s7 = this.peek(3);
          if ((s7 === "---" || s7 === "...") && isEmpty(this.charAt(3))) {
            yield* this.pushCount(3);
            this.indentValue = 0;
            this.indentNext = 0;
            return s7 === "---" ? "doc" : "stream";
          }
        }
        this.indentValue = yield* this.pushSpaces(false);
        if (this.indentNext > this.indentValue && !isEmpty(this.charAt(1)))
          this.indentNext = this.indentValue;
        return yield* this.parseBlockStart();
      }
      *parseBlockStart() {
        const [ch0, ch1] = this.peek(2);
        if (!ch1 && !this.atEnd)
          return this.setNext("block-start");
        if ((ch0 === "-" || ch0 === "?" || ch0 === ":") && isEmpty(ch1)) {
          const n9 = (yield* this.pushCount(1)) + (yield* this.pushSpaces(true));
          this.indentNext = this.indentValue + 1;
          this.indentValue += n9;
          return yield* this.parseBlockStart();
        }
        return "doc";
      }
      *parseDocument() {
        yield* this.pushSpaces(true);
        const line = this.getLine();
        if (line === null)
          return this.setNext("doc");
        let n9 = yield* this.pushIndicators();
        switch (line[n9]) {
          case "#":
            yield* this.pushCount(line.length - n9);
          // fallthrough
          case void 0:
            yield* this.pushNewline();
            return yield* this.parseLineStart();
          case "{":
          case "[":
            yield* this.pushCount(1);
            this.flowKey = false;
            this.flowLevel = 1;
            return "flow";
          case "}":
          case "]":
            yield* this.pushCount(1);
            return "doc";
          case "*":
            yield* this.pushUntil(isNotAnchorChar);
            return "doc";
          case '"':
          case "'":
            return yield* this.parseQuotedScalar();
          case "|":
          case ">":
            n9 += yield* this.parseBlockScalarHeader();
            n9 += yield* this.pushSpaces(true);
            yield* this.pushCount(line.length - n9);
            yield* this.pushNewline();
            return yield* this.parseBlockScalar();
          default:
            return yield* this.parsePlainScalar();
        }
      }
      *parseFlowCollection() {
        let nl, sp;
        let indent = -1;
        do {
          nl = yield* this.pushNewline();
          if (nl > 0) {
            sp = yield* this.pushSpaces(false);
            this.indentValue = indent = sp;
          } else {
            sp = 0;
          }
          sp += yield* this.pushSpaces(true);
        } while (nl + sp > 0);
        const line = this.getLine();
        if (line === null)
          return this.setNext("flow");
        if (indent !== -1 && indent < this.indentNext && line[0] !== "#" || indent === 0 && (line.startsWith("---") || line.startsWith("...")) && isEmpty(line[3])) {
          const atFlowEndMarker = indent === this.indentNext - 1 && this.flowLevel === 1 && (line[0] === "]" || line[0] === "}");
          if (!atFlowEndMarker) {
            this.flowLevel = 0;
            yield cst.FLOW_END;
            return yield* this.parseLineStart();
          }
        }
        let n9 = 0;
        while (line[n9] === ",") {
          n9 += yield* this.pushCount(1);
          n9 += yield* this.pushSpaces(true);
          this.flowKey = false;
        }
        n9 += yield* this.pushIndicators();
        switch (line[n9]) {
          case void 0:
            return "flow";
          case "#":
            yield* this.pushCount(line.length - n9);
            return "flow";
          case "{":
          case "[":
            yield* this.pushCount(1);
            this.flowKey = false;
            this.flowLevel += 1;
            return "flow";
          case "}":
          case "]":
            yield* this.pushCount(1);
            this.flowKey = true;
            this.flowLevel -= 1;
            return this.flowLevel ? "flow" : "doc";
          case "*":
            yield* this.pushUntil(isNotAnchorChar);
            return "flow";
          case '"':
          case "'":
            this.flowKey = true;
            return yield* this.parseQuotedScalar();
          case ":": {
            const next = this.charAt(1);
            if (this.flowKey || isEmpty(next) || next === ",") {
              this.flowKey = false;
              yield* this.pushCount(1);
              yield* this.pushSpaces(true);
              return "flow";
            }
          }
          // fallthrough
          default:
            this.flowKey = false;
            return yield* this.parsePlainScalar();
        }
      }
      *parseQuotedScalar() {
        const quote2 = this.charAt(0);
        let end = this.buffer.indexOf(quote2, this.pos + 1);
        if (quote2 === "'") {
          while (end !== -1 && this.buffer[end + 1] === "'")
            end = this.buffer.indexOf("'", end + 2);
        } else {
          while (end !== -1) {
            let n9 = 0;
            while (this.buffer[end - 1 - n9] === "\\")
              n9 += 1;
            if (n9 % 2 === 0)
              break;
            end = this.buffer.indexOf('"', end + 1);
          }
        }
        const qb = this.buffer.substring(0, end);
        let nl = qb.indexOf("\n", this.pos);
        if (nl !== -1) {
          while (nl !== -1) {
            const cs2 = this.continueScalar(nl + 1);
            if (cs2 === -1)
              break;
            nl = qb.indexOf("\n", cs2);
          }
          if (nl !== -1) {
            end = nl - (qb[nl - 1] === "\r" ? 2 : 1);
          }
        }
        if (end === -1) {
          if (!this.atEnd)
            return this.setNext("quoted-scalar");
          end = this.buffer.length;
        }
        yield* this.pushToIndex(end + 1, false);
        return this.flowLevel ? "flow" : "doc";
      }
      *parseBlockScalarHeader() {
        this.blockScalarIndent = -1;
        this.blockScalarKeep = false;
        let i7 = this.pos;
        while (true) {
          const ch2 = this.buffer[++i7];
          if (ch2 === "+")
            this.blockScalarKeep = true;
          else if (ch2 > "0" && ch2 <= "9")
            this.blockScalarIndent = Number(ch2) - 1;
          else if (ch2 !== "-")
            break;
        }
        return yield* this.pushUntil((ch2) => isEmpty(ch2) || ch2 === "#");
      }
      *parseBlockScalar() {
        let nl = this.pos - 1;
        let indent = 0;
        let ch2;
        loop: for (let i8 = this.pos; ch2 = this.buffer[i8]; ++i8) {
          switch (ch2) {
            case " ":
              indent += 1;
              break;
            case "\n":
              nl = i8;
              indent = 0;
              break;
            case "\r": {
              const next = this.buffer[i8 + 1];
              if (!next && !this.atEnd)
                return this.setNext("block-scalar");
              if (next === "\n")
                break;
            }
            // fallthrough
            default:
              break loop;
          }
        }
        if (!ch2 && !this.atEnd)
          return this.setNext("block-scalar");
        if (indent >= this.indentNext) {
          if (this.blockScalarIndent === -1)
            this.indentNext = indent;
          else {
            this.indentNext = this.blockScalarIndent + (this.indentNext === 0 ? 1 : this.indentNext);
          }
          do {
            const cs2 = this.continueScalar(nl + 1);
            if (cs2 === -1)
              break;
            nl = this.buffer.indexOf("\n", cs2);
          } while (nl !== -1);
          if (nl === -1) {
            if (!this.atEnd)
              return this.setNext("block-scalar");
            nl = this.buffer.length;
          }
        }
        let i7 = nl + 1;
        ch2 = this.buffer[i7];
        while (ch2 === " ")
          ch2 = this.buffer[++i7];
        if (ch2 === "	") {
          while (ch2 === "	" || ch2 === " " || ch2 === "\r" || ch2 === "\n")
            ch2 = this.buffer[++i7];
          nl = i7 - 1;
        } else if (!this.blockScalarKeep) {
          do {
            let i8 = nl - 1;
            let ch3 = this.buffer[i8];
            if (ch3 === "\r")
              ch3 = this.buffer[--i8];
            const lastChar = i8;
            while (ch3 === " ")
              ch3 = this.buffer[--i8];
            if (ch3 === "\n" && i8 >= this.pos && i8 + 1 + indent > lastChar)
              nl = i8;
            else
              break;
          } while (true);
        }
        yield cst.SCALAR;
        yield* this.pushToIndex(nl + 1, true);
        return yield* this.parseLineStart();
      }
      *parsePlainScalar() {
        const inFlow = this.flowLevel > 0;
        let end = this.pos - 1;
        let i7 = this.pos - 1;
        let ch2;
        while (ch2 = this.buffer[++i7]) {
          if (ch2 === ":") {
            const next = this.buffer[i7 + 1];
            if (isEmpty(next) || inFlow && flowIndicatorChars.has(next))
              break;
            end = i7;
          } else if (isEmpty(ch2)) {
            let next = this.buffer[i7 + 1];
            if (ch2 === "\r") {
              if (next === "\n") {
                i7 += 1;
                ch2 = "\n";
                next = this.buffer[i7 + 1];
              } else
                end = i7;
            }
            if (next === "#" || inFlow && flowIndicatorChars.has(next))
              break;
            if (ch2 === "\n") {
              const cs2 = this.continueScalar(i7 + 1);
              if (cs2 === -1)
                break;
              i7 = Math.max(i7, cs2 - 2);
            }
          } else {
            if (inFlow && flowIndicatorChars.has(ch2))
              break;
            end = i7;
          }
        }
        if (!ch2 && !this.atEnd)
          return this.setNext("plain-scalar");
        yield cst.SCALAR;
        yield* this.pushToIndex(end + 1, true);
        return inFlow ? "flow" : "doc";
      }
      *pushCount(n9) {
        if (n9 > 0) {
          yield this.buffer.substr(this.pos, n9);
          this.pos += n9;
          return n9;
        }
        return 0;
      }
      *pushToIndex(i7, allowEmpty) {
        const s7 = this.buffer.slice(this.pos, i7);
        if (s7) {
          yield s7;
          this.pos += s7.length;
          return s7.length;
        } else if (allowEmpty)
          yield "";
        return 0;
      }
      *pushIndicators() {
        switch (this.charAt(0)) {
          case "!":
            return (yield* this.pushTag()) + (yield* this.pushSpaces(true)) + (yield* this.pushIndicators());
          case "&":
            return (yield* this.pushUntil(isNotAnchorChar)) + (yield* this.pushSpaces(true)) + (yield* this.pushIndicators());
          case "-":
          // this is an error
          case "?":
          // this is an error outside flow collections
          case ":": {
            const inFlow = this.flowLevel > 0;
            const ch1 = this.charAt(1);
            if (isEmpty(ch1) || inFlow && flowIndicatorChars.has(ch1)) {
              if (!inFlow)
                this.indentNext = this.indentValue + 1;
              else if (this.flowKey)
                this.flowKey = false;
              return (yield* this.pushCount(1)) + (yield* this.pushSpaces(true)) + (yield* this.pushIndicators());
            }
          }
        }
        return 0;
      }
      *pushTag() {
        if (this.charAt(1) === "<") {
          let i7 = this.pos + 2;
          let ch2 = this.buffer[i7];
          while (!isEmpty(ch2) && ch2 !== ">")
            ch2 = this.buffer[++i7];
          return yield* this.pushToIndex(ch2 === ">" ? i7 + 1 : i7, false);
        } else {
          let i7 = this.pos + 1;
          let ch2 = this.buffer[i7];
          while (ch2) {
            if (tagChars.has(ch2))
              ch2 = this.buffer[++i7];
            else if (ch2 === "%" && hexDigits.has(this.buffer[i7 + 1]) && hexDigits.has(this.buffer[i7 + 2])) {
              ch2 = this.buffer[i7 += 3];
            } else
              break;
          }
          return yield* this.pushToIndex(i7, false);
        }
      }
      *pushNewline() {
        const ch2 = this.buffer[this.pos];
        if (ch2 === "\n")
          return yield* this.pushCount(1);
        else if (ch2 === "\r" && this.charAt(1) === "\n")
          return yield* this.pushCount(2);
        else
          return 0;
      }
      *pushSpaces(allowTabs) {
        let i7 = this.pos - 1;
        let ch2;
        do {
          ch2 = this.buffer[++i7];
        } while (ch2 === " " || allowTabs && ch2 === "	");
        const n9 = i7 - this.pos;
        if (n9 > 0) {
          yield this.buffer.substr(this.pos, n9);
          this.pos = i7;
        }
        return n9;
      }
      *pushUntil(test) {
        let i7 = this.pos;
        let ch2 = this.buffer[i7];
        while (!test(ch2))
          ch2 = this.buffer[++i7];
        return yield* this.pushToIndex(i7, false);
      }
    };
    exports.Lexer = Lexer;
  }
});

// ../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/parse/line-counter.js
var require_line_counter = __commonJS({
  "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/parse/line-counter.js"(exports) {
    init_import_meta_url();
    var LineCounter = class {
      static {
        __name(this, "LineCounter");
      }
      constructor() {
        this.lineStarts = [];
        this.addNewLine = (offset) => this.lineStarts.push(offset);
        this.linePos = (offset) => {
          let low = 0;
          let high = this.lineStarts.length;
          while (low < high) {
            const mid = low + high >> 1;
            if (this.lineStarts[mid] < offset)
              low = mid + 1;
            else
              high = mid;
          }
          if (this.lineStarts[low] === offset)
            return { line: low + 1, col: 1 };
          if (low === 0)
            return { line: 0, col: offset };
          const start = this.lineStarts[low - 1];
          return { line: low, col: offset - start + 1 };
        };
      }
    };
    exports.LineCounter = LineCounter;
  }
});

// ../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/parse/parser.js
var require_parser = __commonJS({
  "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/parse/parser.js"(exports) {
    init_import_meta_url();
    var node_process = __require("process");
    var cst = require_cst();
    var lexer = require_lexer();
    function includesToken(list, type) {
      for (let i7 = 0; i7 < list.length; ++i7)
        if (list[i7].type === type)
          return true;
      return false;
    }
    __name(includesToken, "includesToken");
    function findNonEmptyIndex(list) {
      for (let i7 = 0; i7 < list.length; ++i7) {
        switch (list[i7].type) {
          case "space":
          case "comment":
          case "newline":
            break;
          default:
            return i7;
        }
      }
      return -1;
    }
    __name(findNonEmptyIndex, "findNonEmptyIndex");
    function isFlowToken(token) {
      switch (token?.type) {
        case "alias":
        case "scalar":
        case "single-quoted-scalar":
        case "double-quoted-scalar":
        case "flow-collection":
          return true;
        default:
          return false;
      }
    }
    __name(isFlowToken, "isFlowToken");
    function getPrevProps(parent) {
      switch (parent.type) {
        case "document":
          return parent.start;
        case "block-map": {
          const it2 = parent.items[parent.items.length - 1];
          return it2.sep ?? it2.start;
        }
        case "block-seq":
          return parent.items[parent.items.length - 1].start;
        /* istanbul ignore next should not happen */
        default:
          return [];
      }
    }
    __name(getPrevProps, "getPrevProps");
    function getFirstKeyStartProps(prev) {
      if (prev.length === 0)
        return [];
      let i7 = prev.length;
      loop: while (--i7 >= 0) {
        switch (prev[i7].type) {
          case "doc-start":
          case "explicit-key-ind":
          case "map-value-ind":
          case "seq-item-ind":
          case "newline":
            break loop;
        }
      }
      while (prev[++i7]?.type === "space") {
      }
      return prev.splice(i7, prev.length);
    }
    __name(getFirstKeyStartProps, "getFirstKeyStartProps");
    function fixFlowSeqItems(fc) {
      if (fc.start.type === "flow-seq-start") {
        for (const it2 of fc.items) {
          if (it2.sep && !it2.value && !includesToken(it2.start, "explicit-key-ind") && !includesToken(it2.sep, "map-value-ind")) {
            if (it2.key)
              it2.value = it2.key;
            delete it2.key;
            if (isFlowToken(it2.value)) {
              if (it2.value.end)
                Array.prototype.push.apply(it2.value.end, it2.sep);
              else
                it2.value.end = it2.sep;
            } else
              Array.prototype.push.apply(it2.start, it2.sep);
            delete it2.sep;
          }
        }
      }
    }
    __name(fixFlowSeqItems, "fixFlowSeqItems");
    var Parser2 = class {
      static {
        __name(this, "Parser");
      }
      /**
       * @param onNewLine - If defined, called separately with the start position of
       *   each new line (in `parse()`, including the start of input).
       */
      constructor(onNewLine) {
        this.atNewLine = true;
        this.atScalar = false;
        this.indent = 0;
        this.offset = 0;
        this.onKeyLine = false;
        this.stack = [];
        this.source = "";
        this.type = "";
        this.lexer = new lexer.Lexer();
        this.onNewLine = onNewLine;
      }
      /**
       * Parse `source` as a YAML stream.
       * If `incomplete`, a part of the last line may be left as a buffer for the next call.
       *
       * Errors are not thrown, but yielded as `{ type: 'error', message }` tokens.
       *
       * @returns A generator of tokens representing each directive, document, and other structure.
       */
      *parse(source, incomplete = false) {
        if (this.onNewLine && this.offset === 0)
          this.onNewLine(0);
        for (const lexeme of this.lexer.lex(source, incomplete))
          yield* this.next(lexeme);
        if (!incomplete)
          yield* this.end();
      }
      /**
       * Advance the parser by the `source` of one lexical token.
       */
      *next(source) {
        this.source = source;
        if (node_process.env.LOG_TOKENS)
          console.log("|", cst.prettyToken(source));
        if (this.atScalar) {
          this.atScalar = false;
          yield* this.step();
          this.offset += source.length;
          return;
        }
        const type = cst.tokenType(source);
        if (!type) {
          const message = `Not a YAML token: ${source}`;
          yield* this.pop({ type: "error", offset: this.offset, message, source });
          this.offset += source.length;
        } else if (type === "scalar") {
          this.atNewLine = false;
          this.atScalar = true;
          this.type = "scalar";
        } else {
          this.type = type;
          yield* this.step();
          switch (type) {
            case "newline":
              this.atNewLine = true;
              this.indent = 0;
              if (this.onNewLine)
                this.onNewLine(this.offset + source.length);
              break;
            case "space":
              if (this.atNewLine && source[0] === " ")
                this.indent += source.length;
              break;
            case "explicit-key-ind":
            case "map-value-ind":
            case "seq-item-ind":
              if (this.atNewLine)
                this.indent += source.length;
              break;
            case "doc-mode":
            case "flow-error-end":
              return;
            default:
              this.atNewLine = false;
          }
          this.offset += source.length;
        }
      }
      /** Call at end of input to push out any remaining constructions */
      *end() {
        while (this.stack.length > 0)
          yield* this.pop();
      }
      get sourceToken() {
        const st2 = {
          type: this.type,
          offset: this.offset,
          indent: this.indent,
          source: this.source
        };
        return st2;
      }
      *step() {
        const top2 = this.peek(1);
        if (this.type === "doc-end" && (!top2 || top2.type !== "doc-end")) {
          while (this.stack.length > 0)
            yield* this.pop();
          this.stack.push({
            type: "doc-end",
            offset: this.offset,
            source: this.source
          });
          return;
        }
        if (!top2)
          return yield* this.stream();
        switch (top2.type) {
          case "document":
            return yield* this.document(top2);
          case "alias":
          case "scalar":
          case "single-quoted-scalar":
          case "double-quoted-scalar":
            return yield* this.scalar(top2);
          case "block-scalar":
            return yield* this.blockScalar(top2);
          case "block-map":
            return yield* this.blockMap(top2);
          case "block-seq":
            return yield* this.blockSequence(top2);
          case "flow-collection":
            return yield* this.flowCollection(top2);
          case "doc-end":
            return yield* this.documentEnd(top2);
        }
        yield* this.pop();
      }
      peek(n9) {
        return this.stack[this.stack.length - n9];
      }
      *pop(error2) {
        const token = error2 ?? this.stack.pop();
        if (!token) {
          const message = "Tried to pop an empty stack";
          yield { type: "error", offset: this.offset, source: "", message };
        } else if (this.stack.length === 0) {
          yield token;
        } else {
          const top2 = this.peek(1);
          if (token.type === "block-scalar") {
            token.indent = "indent" in top2 ? top2.indent : 0;
          } else if (token.type === "flow-collection" && top2.type === "document") {
            token.indent = 0;
          }
          if (token.type === "flow-collection")
            fixFlowSeqItems(token);
          switch (top2.type) {
            case "document":
              top2.value = token;
              break;
            case "block-scalar":
              top2.props.push(token);
              break;
            case "block-map": {
              const it2 = top2.items[top2.items.length - 1];
              if (it2.value) {
                top2.items.push({ start: [], key: token, sep: [] });
                this.onKeyLine = true;
                return;
              } else if (it2.sep) {
                it2.value = token;
              } else {
                Object.assign(it2, { key: token, sep: [] });
                this.onKeyLine = !it2.explicitKey;
                return;
              }
              break;
            }
            case "block-seq": {
              const it2 = top2.items[top2.items.length - 1];
              if (it2.value)
                top2.items.push({ start: [], value: token });
              else
                it2.value = token;
              break;
            }
            case "flow-collection": {
              const it2 = top2.items[top2.items.length - 1];
              if (!it2 || it2.value)
                top2.items.push({ start: [], key: token, sep: [] });
              else if (it2.sep)
                it2.value = token;
              else
                Object.assign(it2, { key: token, sep: [] });
              return;
            }
            /* istanbul ignore next should not happen */
            default:
              yield* this.pop();
              yield* this.pop(token);
          }
          if ((top2.type === "document" || top2.type === "block-map" || top2.type === "block-seq") && (token.type === "block-map" || token.type === "block-seq")) {
            const last = token.items[token.items.length - 1];
            if (last && !last.sep && !last.value && last.start.length > 0 && findNonEmptyIndex(last.start) === -1 && (token.indent === 0 || last.start.every((st2) => st2.type !== "comment" || st2.indent < token.indent))) {
              if (top2.type === "document")
                top2.end = last.start;
              else
                top2.items.push({ start: last.start });
              token.items.splice(-1, 1);
            }
          }
        }
      }
      *stream() {
        switch (this.type) {
          case "directive-line":
            yield { type: "directive", offset: this.offset, source: this.source };
            return;
          case "byte-order-mark":
          case "space":
          case "comment":
          case "newline":
            yield this.sourceToken;
            return;
          case "doc-mode":
          case "doc-start": {
            const doc = {
              type: "document",
              offset: this.offset,
              start: []
            };
            if (this.type === "doc-start")
              doc.start.push(this.sourceToken);
            this.stack.push(doc);
            return;
          }
        }
        yield {
          type: "error",
          offset: this.offset,
          message: `Unexpected ${this.type} token in YAML stream`,
          source: this.source
        };
      }
      *document(doc) {
        if (doc.value)
          return yield* this.lineEnd(doc);
        switch (this.type) {
          case "doc-start": {
            if (findNonEmptyIndex(doc.start) !== -1) {
              yield* this.pop();
              yield* this.step();
            } else
              doc.start.push(this.sourceToken);
            return;
          }
          case "anchor":
          case "tag":
          case "space":
          case "comment":
          case "newline":
            doc.start.push(this.sourceToken);
            return;
        }
        const bv2 = this.startBlockValue(doc);
        if (bv2)
          this.stack.push(bv2);
        else {
          yield {
            type: "error",
            offset: this.offset,
            message: `Unexpected ${this.type} token in YAML document`,
            source: this.source
          };
        }
      }
      *scalar(scalar) {
        if (this.type === "map-value-ind") {
          const prev = getPrevProps(this.peek(2));
          const start = getFirstKeyStartProps(prev);
          let sep6;
          if (scalar.end) {
            sep6 = scalar.end;
            sep6.push(this.sourceToken);
            delete scalar.end;
          } else
            sep6 = [this.sourceToken];
          const map2 = {
            type: "block-map",
            offset: scalar.offset,
            indent: scalar.indent,
            items: [{ start, key: scalar, sep: sep6 }]
          };
          this.onKeyLine = true;
          this.stack[this.stack.length - 1] = map2;
        } else
          yield* this.lineEnd(scalar);
      }
      *blockScalar(scalar) {
        switch (this.type) {
          case "space":
          case "comment":
          case "newline":
            scalar.props.push(this.sourceToken);
            return;
          case "scalar":
            scalar.source = this.source;
            this.atNewLine = true;
            this.indent = 0;
            if (this.onNewLine) {
              let nl = this.source.indexOf("\n") + 1;
              while (nl !== 0) {
                this.onNewLine(this.offset + nl);
                nl = this.source.indexOf("\n", nl) + 1;
              }
            }
            yield* this.pop();
            break;
          /* istanbul ignore next should not happen */
          default:
            yield* this.pop();
            yield* this.step();
        }
      }
      *blockMap(map2) {
        const it2 = map2.items[map2.items.length - 1];
        switch (this.type) {
          case "newline":
            this.onKeyLine = false;
            if (it2.value) {
              const end = "end" in it2.value ? it2.value.end : void 0;
              const last = Array.isArray(end) ? end[end.length - 1] : void 0;
              if (last?.type === "comment")
                end?.push(this.sourceToken);
              else
                map2.items.push({ start: [this.sourceToken] });
            } else if (it2.sep) {
              it2.sep.push(this.sourceToken);
            } else {
              it2.start.push(this.sourceToken);
            }
            return;
          case "space":
          case "comment":
            if (it2.value) {
              map2.items.push({ start: [this.sourceToken] });
            } else if (it2.sep) {
              it2.sep.push(this.sourceToken);
            } else {
              if (this.atIndentedComment(it2.start, map2.indent)) {
                const prev = map2.items[map2.items.length - 2];
                const end = prev?.value?.end;
                if (Array.isArray(end)) {
                  Array.prototype.push.apply(end, it2.start);
                  end.push(this.sourceToken);
                  map2.items.pop();
                  return;
                }
              }
              it2.start.push(this.sourceToken);
            }
            return;
        }
        if (this.indent >= map2.indent) {
          const atMapIndent = !this.onKeyLine && this.indent === map2.indent;
          const atNextItem = atMapIndent && (it2.sep || it2.explicitKey) && this.type !== "seq-item-ind";
          let start = [];
          if (atNextItem && it2.sep && !it2.value) {
            const nl = [];
            for (let i7 = 0; i7 < it2.sep.length; ++i7) {
              const st2 = it2.sep[i7];
              switch (st2.type) {
                case "newline":
                  nl.push(i7);
                  break;
                case "space":
                  break;
                case "comment":
                  if (st2.indent > map2.indent)
                    nl.length = 0;
                  break;
                default:
                  nl.length = 0;
              }
            }
            if (nl.length >= 2)
              start = it2.sep.splice(nl[1]);
          }
          switch (this.type) {
            case "anchor":
            case "tag":
              if (atNextItem || it2.value) {
                start.push(this.sourceToken);
                map2.items.push({ start });
                this.onKeyLine = true;
              } else if (it2.sep) {
                it2.sep.push(this.sourceToken);
              } else {
                it2.start.push(this.sourceToken);
              }
              return;
            case "explicit-key-ind":
              if (!it2.sep && !it2.explicitKey) {
                it2.start.push(this.sourceToken);
                it2.explicitKey = true;
              } else if (atNextItem || it2.value) {
                start.push(this.sourceToken);
                map2.items.push({ start, explicitKey: true });
              } else {
                this.stack.push({
                  type: "block-map",
                  offset: this.offset,
                  indent: this.indent,
                  items: [{ start: [this.sourceToken], explicitKey: true }]
                });
              }
              this.onKeyLine = true;
              return;
            case "map-value-ind":
              if (it2.explicitKey) {
                if (!it2.sep) {
                  if (includesToken(it2.start, "newline")) {
                    Object.assign(it2, { key: null, sep: [this.sourceToken] });
                  } else {
                    const start2 = getFirstKeyStartProps(it2.start);
                    this.stack.push({
                      type: "block-map",
                      offset: this.offset,
                      indent: this.indent,
                      items: [{ start: start2, key: null, sep: [this.sourceToken] }]
                    });
                  }
                } else if (it2.value) {
                  map2.items.push({ start: [], key: null, sep: [this.sourceToken] });
                } else if (includesToken(it2.sep, "map-value-ind")) {
                  this.stack.push({
                    type: "block-map",
                    offset: this.offset,
                    indent: this.indent,
                    items: [{ start, key: null, sep: [this.sourceToken] }]
                  });
                } else if (isFlowToken(it2.key) && !includesToken(it2.sep, "newline")) {
                  const start2 = getFirstKeyStartProps(it2.start);
                  const key = it2.key;
                  const sep6 = it2.sep;
                  sep6.push(this.sourceToken);
                  delete it2.key;
                  delete it2.sep;
                  this.stack.push({
                    type: "block-map",
                    offset: this.offset,
                    indent: this.indent,
                    items: [{ start: start2, key, sep: sep6 }]
                  });
                } else if (start.length > 0) {
                  it2.sep = it2.sep.concat(start, this.sourceToken);
                } else {
                  it2.sep.push(this.sourceToken);
                }
              } else {
                if (!it2.sep) {
                  Object.assign(it2, { key: null, sep: [this.sourceToken] });
                } else if (it2.value || atNextItem) {
                  map2.items.push({ start, key: null, sep: [this.sourceToken] });
                } else if (includesToken(it2.sep, "map-value-ind")) {
                  this.stack.push({
                    type: "block-map",
                    offset: this.offset,
                    indent: this.indent,
                    items: [{ start: [], key: null, sep: [this.sourceToken] }]
                  });
                } else {
                  it2.sep.push(this.sourceToken);
                }
              }
              this.onKeyLine = true;
              return;
            case "alias":
            case "scalar":
            case "single-quoted-scalar":
            case "double-quoted-scalar": {
              const fs33 = this.flowScalar(this.type);
              if (atNextItem || it2.value) {
                map2.items.push({ start, key: fs33, sep: [] });
                this.onKeyLine = true;
              } else if (it2.sep) {
                this.stack.push(fs33);
              } else {
                Object.assign(it2, { key: fs33, sep: [] });
                this.onKeyLine = true;
              }
              return;
            }
            default: {
              const bv2 = this.startBlockValue(map2);
              if (bv2) {
                if (bv2.type === "block-seq") {
                  if (!it2.explicitKey && it2.sep && !includesToken(it2.sep, "newline")) {
                    yield* this.pop({
                      type: "error",
                      offset: this.offset,
                      message: "Unexpected block-seq-ind on same line with key",
                      source: this.source
                    });
                    return;
                  }
                } else if (atMapIndent) {
                  map2.items.push({ start });
                }
                this.stack.push(bv2);
                return;
              }
            }
          }
        }
        yield* this.pop();
        yield* this.step();
      }
      *blockSequence(seq) {
        const it2 = seq.items[seq.items.length - 1];
        switch (this.type) {
          case "newline":
            if (it2.value) {
              const end = "end" in it2.value ? it2.value.end : void 0;
              const last = Array.isArray(end) ? end[end.length - 1] : void 0;
              if (last?.type === "comment")
                end?.push(this.sourceToken);
              else
                seq.items.push({ start: [this.sourceToken] });
            } else
              it2.start.push(this.sourceToken);
            return;
          case "space":
          case "comment":
            if (it2.value)
              seq.items.push({ start: [this.sourceToken] });
            else {
              if (this.atIndentedComment(it2.start, seq.indent)) {
                const prev = seq.items[seq.items.length - 2];
                const end = prev?.value?.end;
                if (Array.isArray(end)) {
                  Array.prototype.push.apply(end, it2.start);
                  end.push(this.sourceToken);
                  seq.items.pop();
                  return;
                }
              }
              it2.start.push(this.sourceToken);
            }
            return;
          case "anchor":
          case "tag":
            if (it2.value || this.indent <= seq.indent)
              break;
            it2.start.push(this.sourceToken);
            return;
          case "seq-item-ind":
            if (this.indent !== seq.indent)
              break;
            if (it2.value || includesToken(it2.start, "seq-item-ind"))
              seq.items.push({ start: [this.sourceToken] });
            else
              it2.start.push(this.sourceToken);
            return;
        }
        if (this.indent > seq.indent) {
          const bv2 = this.startBlockValue(seq);
          if (bv2) {
            this.stack.push(bv2);
            return;
          }
        }
        yield* this.pop();
        yield* this.step();
      }
      *flowCollection(fc) {
        const it2 = fc.items[fc.items.length - 1];
        if (this.type === "flow-error-end") {
          let top2;
          do {
            yield* this.pop();
            top2 = this.peek(1);
          } while (top2 && top2.type === "flow-collection");
        } else if (fc.end.length === 0) {
          switch (this.type) {
            case "comma":
            case "explicit-key-ind":
              if (!it2 || it2.sep)
                fc.items.push({ start: [this.sourceToken] });
              else
                it2.start.push(this.sourceToken);
              return;
            case "map-value-ind":
              if (!it2 || it2.value)
                fc.items.push({ start: [], key: null, sep: [this.sourceToken] });
              else if (it2.sep)
                it2.sep.push(this.sourceToken);
              else
                Object.assign(it2, { key: null, sep: [this.sourceToken] });
              return;
            case "space":
            case "comment":
            case "newline":
            case "anchor":
            case "tag":
              if (!it2 || it2.value)
                fc.items.push({ start: [this.sourceToken] });
              else if (it2.sep)
                it2.sep.push(this.sourceToken);
              else
                it2.start.push(this.sourceToken);
              return;
            case "alias":
            case "scalar":
            case "single-quoted-scalar":
            case "double-quoted-scalar": {
              const fs33 = this.flowScalar(this.type);
              if (!it2 || it2.value)
                fc.items.push({ start: [], key: fs33, sep: [] });
              else if (it2.sep)
                this.stack.push(fs33);
              else
                Object.assign(it2, { key: fs33, sep: [] });
              return;
            }
            case "flow-map-end":
            case "flow-seq-end":
              fc.end.push(this.sourceToken);
              return;
          }
          const bv2 = this.startBlockValue(fc);
          if (bv2)
            this.stack.push(bv2);
          else {
            yield* this.pop();
            yield* this.step();
          }
        } else {
          const parent = this.peek(2);
          if (parent.type === "block-map" && (this.type === "map-value-ind" && parent.indent === fc.indent || this.type === "newline" && !parent.items[parent.items.length - 1].sep)) {
            yield* this.pop();
            yield* this.step();
          } else if (this.type === "map-value-ind" && parent.type !== "flow-collection") {
            const prev = getPrevProps(parent);
            const start = getFirstKeyStartProps(prev);
            fixFlowSeqItems(fc);
            const sep6 = fc.end.splice(1, fc.end.length);
            sep6.push(this.sourceToken);
            const map2 = {
              type: "block-map",
              offset: fc.offset,
              indent: fc.indent,
              items: [{ start, key: fc, sep: sep6 }]
            };
            this.onKeyLine = true;
            this.stack[this.stack.length - 1] = map2;
          } else {
            yield* this.lineEnd(fc);
          }
        }
      }
      flowScalar(type) {
        if (this.onNewLine) {
          let nl = this.source.indexOf("\n") + 1;
          while (nl !== 0) {
            this.onNewLine(this.offset + nl);
            nl = this.source.indexOf("\n", nl) + 1;
          }
        }
        return {
          type,
          offset: this.offset,
          indent: this.indent,
          source: this.source
        };
      }
      startBlockValue(parent) {
        switch (this.type) {
          case "alias":
          case "scalar":
          case "single-quoted-scalar":
          case "double-quoted-scalar":
            return this.flowScalar(this.type);
          case "block-scalar-header":
            return {
              type: "block-scalar",
              offset: this.offset,
              indent: this.indent,
              props: [this.sourceToken],
              source: ""
            };
          case "flow-map-start":
          case "flow-seq-start":
            return {
              type: "flow-collection",
              offset: this.offset,
              indent: this.indent,
              start: this.sourceToken,
              items: [],
              end: []
            };
          case "seq-item-ind":
            return {
              type: "block-seq",
              offset: this.offset,
              indent: this.indent,
              items: [{ start: [this.sourceToken] }]
            };
          case "explicit-key-ind": {
            this.onKeyLine = true;
            const prev = getPrevProps(parent);
            const start = getFirstKeyStartProps(prev);
            start.push(this.sourceToken);
            return {
              type: "block-map",
              offset: this.offset,
              indent: this.indent,
              items: [{ start, explicitKey: true }]
            };
          }
          case "map-value-ind": {
            this.onKeyLine = true;
            const prev = getPrevProps(parent);
            const start = getFirstKeyStartProps(prev);
            return {
              type: "block-map",
              offset: this.offset,
              indent: this.indent,
              items: [{ start, key: null, sep: [this.sourceToken] }]
            };
          }
        }
        return null;
      }
      atIndentedComment(start, indent) {
        if (this.type !== "comment")
          return false;
        if (this.indent <= indent)
          return false;
        return start.every((st2) => st2.type === "newline" || st2.type === "space");
      }
      *documentEnd(docEnd) {
        if (this.type !== "doc-mode") {
          if (docEnd.end)
            docEnd.end.push(this.sourceToken);
          else
            docEnd.end = [this.sourceToken];
          if (this.type === "newline")
            yield* this.pop();
        }
      }
      *lineEnd(token) {
        switch (this.type) {
          case "comma":
          case "doc-start":
          case "doc-end":
          case "flow-seq-end":
          case "flow-map-end":
          case "map-value-ind":
            yield* this.pop();
            yield* this.step();
            break;
          case "newline":
            this.onKeyLine = false;
          // fallthrough
          case "space":
          case "comment":
          default:
            if (token.end)
              token.end.push(this.sourceToken);
            else
              token.end = [this.sourceToken];
            if (this.type === "newline")
              yield* this.pop();
        }
      }
    };
    exports.Parser = Parser2;
  }
});

// ../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/public-api.js
var require_public_api2 = __commonJS({
  "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/public-api.js"(exports) {
    init_import_meta_url();
    var composer = require_composer();
    var Document = require_Document();
    var errors = require_errors2();
    var log2 = require_log();
    var identity = require_identity();
    var lineCounter = require_line_counter();
    var parser2 = require_parser();
    function parseOptions(options) {
      const prettyErrors = options.prettyErrors !== false;
      const lineCounter$1 = options.lineCounter || prettyErrors && new lineCounter.LineCounter() || null;
      return { lineCounter: lineCounter$1, prettyErrors };
    }
    __name(parseOptions, "parseOptions");
    function parseAllDocuments(source, options = {}) {
      const { lineCounter: lineCounter2, prettyErrors } = parseOptions(options);
      const parser$1 = new parser2.Parser(lineCounter2?.addNewLine);
      const composer$1 = new composer.Composer(options);
      const docs2 = Array.from(composer$1.compose(parser$1.parse(source)));
      if (prettyErrors && lineCounter2)
        for (const doc of docs2) {
          doc.errors.forEach(errors.prettifyError(source, lineCounter2));
          doc.warnings.forEach(errors.prettifyError(source, lineCounter2));
        }
      if (docs2.length > 0)
        return docs2;
      return Object.assign([], { empty: true }, composer$1.streamInfo());
    }
    __name(parseAllDocuments, "parseAllDocuments");
    function parseDocument(source, options = {}) {
      const { lineCounter: lineCounter2, prettyErrors } = parseOptions(options);
      const parser$1 = new parser2.Parser(lineCounter2?.addNewLine);
      const composer$1 = new composer.Composer(options);
      let doc = null;
      for (const _doc of composer$1.compose(parser$1.parse(source), true, source.length)) {
        if (!doc)
          doc = _doc;
        else if (doc.options.logLevel !== "silent") {
          doc.errors.push(new errors.YAMLParseError(_doc.range.slice(0, 2), "MULTIPLE_DOCS", "Source contains multiple documents; please use YAML.parseAllDocuments()"));
          break;
        }
      }
      if (prettyErrors && lineCounter2) {
        doc.errors.forEach(errors.prettifyError(source, lineCounter2));
        doc.warnings.forEach(errors.prettifyError(source, lineCounter2));
      }
      return doc;
    }
    __name(parseDocument, "parseDocument");
    function parse17(src, reviver, options) {
      let _reviver = void 0;
      if (typeof reviver === "function") {
        _reviver = reviver;
      } else if (options === void 0 && reviver && typeof reviver === "object") {
        options = reviver;
      }
      const doc = parseDocument(src, options);
      if (!doc)
        return null;
      doc.warnings.forEach((warning) => log2.warn(doc.options.logLevel, warning));
      if (doc.errors.length > 0) {
        if (doc.options.logLevel !== "silent")
          throw doc.errors[0];
        else
          doc.errors = [];
      }
      return doc.toJS(Object.assign({ reviver: _reviver }, options));
    }
    __name(parse17, "parse");
    function stringify4(value, replacer2, options) {
      let _replacer = null;
      if (typeof replacer2 === "function" || Array.isArray(replacer2)) {
        _replacer = replacer2;
      } else if (options === void 0 && replacer2) {
        options = replacer2;
      }
      if (typeof options === "string")
        options = options.length;
      if (typeof options === "number") {
        const indent = Math.round(options);
        options = indent < 1 ? void 0 : indent > 8 ? { indent: 8 } : { indent };
      }
      if (value === void 0) {
        const { keepUndefined } = options ?? replacer2 ?? {};
        if (!keepUndefined)
          return void 0;
      }
      if (identity.isDocument(value) && !_replacer)
        return value.toString(options);
      return new Document.Document(value, _replacer, options).toString(options);
    }
    __name(stringify4, "stringify");
    exports.parse = parse17;
    exports.parseAllDocuments = parseAllDocuments;
    exports.parseDocument = parseDocument;
    exports.stringify = stringify4;
  }
});

// ../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/index.js
var require_dist3 = __commonJS({
  "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/index.js"(exports) {
    init_import_meta_url();
    var composer = require_composer();
    var Document = require_Document();
    var Schema2 = require_Schema();
    var errors = require_errors2();
    var Alias = require_Alias();
    var identity = require_identity();
    var Pair = require_Pair();
    var Scalar = require_Scalar();
    var YAMLMap = require_YAMLMap();
    var YAMLSeq = require_YAMLSeq();
    var cst = require_cst();
    var lexer = require_lexer();
    var lineCounter = require_line_counter();
    var parser2 = require_parser();
    var publicApi = require_public_api2();
    var visit5 = require_visit();
    exports.Composer = composer.Composer;
    exports.Document = Document.Document;
    exports.Schema = Schema2.Schema;
    exports.YAMLError = errors.YAMLError;
    exports.YAMLParseError = errors.YAMLParseError;
    exports.YAMLWarning = errors.YAMLWarning;
    exports.Alias = Alias.Alias;
    exports.isAlias = identity.isAlias;
    exports.isCollection = identity.isCollection;
    exports.isDocument = identity.isDocument;
    exports.isMap = identity.isMap;
    exports.isNode = identity.isNode;
    exports.isPair = identity.isPair;
    exports.isScalar = identity.isScalar;
    exports.isSeq = identity.isSeq;
    exports.Pair = Pair.Pair;
    exports.Scalar = Scalar.Scalar;
    exports.YAMLMap = YAMLMap.YAMLMap;
    exports.YAMLSeq = YAMLSeq.YAMLSeq;
    exports.CST = cst;
    exports.Lexer = lexer.Lexer;
    exports.LineCounter = lineCounter.LineCounter;
    exports.Parser = parser2.Parser;
    exports.parse = publicApi.parse;
    exports.parseAllDocuments = publicApi.parseAllDocuments;
    exports.parseDocument = publicApi.parseDocument;
    exports.stringify = publicApi.stringify;
    exports.visit = visit5.visit;
    exports.visitAsync = visit5.visitAsync;
  }
});

// src/containers/containers.ts
async function deleteCommand(deleteArgs, _config) {
  const uuidRegex4 = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
  if (!uuidRegex4.test(deleteArgs.ID)) {
    throw new UserError(
      `Expected a container ID but got ${deleteArgs.ID}. Use \`wrangler containers list\` to view your containers and corresponding IDs.`
    );
  }
  startSection("Delete your container");
  if (!isNonInteractiveOrCI()) {
    const yes = await inputPrompt({
      question: "Are you sure that you want to delete these containers? The associated DO container will lose access to the containers.",
      type: "confirm",
      label: ""
    });
    if (!yes) {
      cancel("The operation has been cancelled");
      return;
    }
  }
  try {
    await ApplicationsService.deleteApplication(deleteArgs.ID);
  } catch (err) {
    if (!(err instanceof Error)) {
      throw err;
    }
    if (err instanceof ApiError) {
      if (err.status === 400 || err.status === 404) {
        throw new UserError(
          `There has been an error deleting the container.
${err.body.error}`
        );
      }
      throw new Error(
        `There has been an unknown error deleting the container.
${JSON.stringify(err.body)}`
      );
    }
    throw new Error(
      `There has been an internal error deleting your containers.
${err.message}`
    );
  }
  endSection("Your container has been deleted");
}
async function infoCommand(infoArgs, _config) {
  if (!infoArgs.ID) {
    throw new Error(
      "You must provide an ID. Use 'wrangler containers list` to view your containers."
    );
  }
  if (isNonInteractiveOrCI()) {
    const application2 = await ApplicationsService.getApplication(infoArgs.ID);
    logger.json(application2);
    return;
  }
  const [application, err] = await wrap2(
    ApplicationsService.getApplication(infoArgs.ID)
  );
  if (err) {
    throw new UserError(
      `There has been an internal error requesting your containers.
 ${err.message}`
    );
  }
  const applicationDetails = {
    label: `${application.name} (${application.created_at})`,
    details: import_yaml.default.stringify(application).split("\n"),
    value: application.id
  };
  await inputPrompt({
    type: "list",
    question: "Container",
    options: [applicationDetails],
    label: "Exiting"
  });
}
var import_yaml, containersInfoCommand, containersDeleteCommand;
var init_containers = __esm({
  "src/containers/containers.ts"() {
    init_import_meta_url();
    init_cli();
    init_interactive();
    init_containers_shared();
    init_dist();
    import_yaml = __toESM(require_dist3());
    init_common();
    init_wrap();
    init_create_command();
    init_is_interactive();
    init_logger();
    init_containers2();
    __name(deleteCommand, "deleteCommand");
    __name(infoCommand, "infoCommand");
    containersInfoCommand = createCommand({
      metadata: {
        description: "Get information about a specific container",
        status: "open beta",
        owner: "Product: Cloudchamber"
      },
      behaviour: {
        printBanner: /* @__PURE__ */ __name(() => !isNonInteractiveOrCI(), "printBanner")
      },
      args: {
        ID: {
          describe: "ID of the container to view",
          type: "string",
          demandOption: true
        }
      },
      positionalArgs: ["ID"],
      async handler(args, { config }) {
        await fillOpenAPIConfiguration(config, containersScope);
        await infoCommand(args);
      }
    });
    containersDeleteCommand = createCommand({
      metadata: {
        description: "Delete a container",
        status: "open beta",
        owner: "Product: Cloudchamber"
      },
      args: {
        ID: {
          describe: "ID of the container to delete",
          type: "string",
          demandOption: true
        }
      },
      positionalArgs: ["ID"],
      async handler(args, { config }) {
        await fillOpenAPIConfiguration(config, containersScope);
        await deleteCommand(args);
      }
    });
  }
});

// src/containers/instances.ts
function deriveInstanceState(instance) {
  const status2 = instance.current_placement?.status;
  if (!status2) {
    return "unknown";
  }
  const raw = status2.container_status ?? status2.health;
  switch (raw) {
    case "placed":
      return "provisioning";
    case "running":
    case "failed":
    case "stopping":
    case "stopped":
    case "unhealthy":
      return raw;
    default:
      return "unknown";
  }
}
function colorState2(state2) {
  switch (state2) {
    case "running":
      return green(state2);
    case "failed":
    case "unhealthy":
    case "stopped":
    case "stopping":
      return red(state2);
    default:
      return state2;
  }
}
function buildInstanceRows(data) {
  const doList = data.durable_objects ?? [];
  if (doList.length === 0) {
    return data.instances.map((instance) => ({ instance }));
  }
  const instanceByDeploymentId = /* @__PURE__ */ new Map();
  for (const inst of data.instances) {
    instanceByDeploymentId.set(inst.id, inst);
  }
  return doList.map((doInst) => ({
    instance: doInst.deployment_id ? instanceByDeploymentId.get(doInst.deployment_id) : void 0,
    durableObject: doInst
  }));
}
async function fetchPage(applicationId, perPage, pageToken) {
  try {
    const page = await ApplicationsService.listDashApplicationInstances(
      applicationId,
      perPage,
      pageToken
    );
    return {
      data: page.data,
      nextPageToken: page.resultInfo?.next_page_token
    };
  } catch (err) {
    if (!(err instanceof Error)) {
      throw err;
    }
    if (err instanceof ApiError) {
      if (err.status === 400 || err.status === 404) {
        throw new UserError(
          `There has been an error fetching instances.
${err.body.error}
Use \`wrangler containers list\` to view your containers and corresponding IDs.`
        );
      }
      throw new Error(
        `There has been an unknown error fetching instances.
${JSON.stringify(err.body)}`
      );
    }
    throw new Error(
      `There has been an internal error fetching instances.
${err.message}`
    );
  }
}
function rowsToJsonOutput(rows) {
  const hasDurableObjects = rows.some((r10) => r10.durableObject);
  if (hasDurableObjects) {
    return rows.map((row) => {
      const state2 = row.instance ? deriveInstanceState(row.instance) : "inactive";
      return {
        id: row.durableObject?.id ?? row.instance?.id ?? null,
        name: row.durableObject?.name ?? null,
        state: state2,
        location: row.instance?.location ?? null,
        version: row.instance?.app_version ?? null,
        created: row.instance?.created_at ?? row.durableObject?.assigned_at ?? null
      };
    });
  }
  return rows.map((row) => {
    const state2 = row.instance ? deriveInstanceState(row.instance) : "unknown";
    return {
      id: row.instance?.id ?? null,
      state: state2,
      location: row.instance?.location ?? null,
      version: row.instance?.app_version ?? null,
      created: row.instance?.created_at ?? null
    };
  });
}
function renderTable(rows) {
  const hasDurableObjects = rows.some((r10) => r10.durableObject);
  if (hasDurableObjects) {
    logger.table(
      rows.map((row) => {
        const state2 = row.instance ? deriveInstanceState(row.instance) : "inactive";
        return {
          INSTANCE: row.durableObject?.id ?? row.instance?.id ?? "-",
          NAME: row.durableObject?.name ?? "-",
          STATE: colorState2(state2),
          LOCATION: row.instance?.location ?? "-",
          VERSION: row.instance ? String(row.instance.app_version) : "-",
          CREATED: row.instance?.created_at ?? row.durableObject?.assigned_at ?? "-"
        };
      })
    );
  } else {
    logger.table(
      rows.map((row) => {
        const state2 = row.instance ? deriveInstanceState(row.instance) : "unknown";
        return {
          INSTANCE: row.instance?.id ?? "-",
          STATE: colorState2(state2),
          LOCATION: row.instance?.location ?? "-",
          VERSION: row.instance ? String(row.instance.app_version) : "-",
          CREATED: row.instance?.created_at ?? "-"
        };
      })
    );
  }
}
async function instancesCommand(args) {
  const uuidRegex4 = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
  if (!uuidRegex4.test(args.ID)) {
    throw new UserError(
      `Expected an application ID but got ${args.ID}. Use \`wrangler containers list\` to view your containers and corresponding IDs.`
    );
  }
  if (args.json) {
    try {
      const { data } = await fetchPage(args.ID);
      const rows = buildInstanceRows(data);
      logger.json(rowsToJsonOutput(rows));
      return;
    } catch (err) {
      if (err instanceof UserError) {
        throw err;
      }
      const message = err instanceof Error ? err.message : "Unknown error";
      throw new JsonFriendlyFatalError(JSON.stringify({ error: message }));
    }
  }
  if (isNonInteractiveOrCI()) {
    const { data } = await fetchPage(args.ID);
    const rows = buildInstanceRows(data);
    if (rows.length === 0) {
      logger.log(
        "No instances found for this application. The application may not have any running containers."
      );
      return;
    }
    renderTable(rows);
    return;
  }
  const { start, stop } = spinner();
  let pageToken;
  let totalShown = 0;
  let stopped = false;
  do {
    start("Loading instances");
    let data;
    let nextPageToken;
    try {
      const result = await fetchPage(args.ID, args.perPage, pageToken);
      data = result.data;
      nextPageToken = result.nextPageToken;
    } finally {
      stop();
    }
    const rows = buildInstanceRows(data);
    if (rows.length === 0 && totalShown === 0) {
      logger.log(
        "No instances found for this application. The application may not have any running containers."
      );
      return;
    }
    if (rows.length > 0) {
      renderTable(rows);
      totalShown += rows.length;
    }
    pageToken = nextPageToken;
    if (pageToken) {
      logger.log(
        dim(
          `Showing ${totalShown} instances. Press Enter to load ${args.perPage} more, or q/Esc to stop.`
        )
      );
      await new Promise((resolve32) => {
        const cleanup = onKeyPress(
          (key) => {
            if (key.name === "return") {
              cleanup();
              resolve32();
            } else if (key.name === "escape" || key.name === "q" || key.name === "c" && key.ctrl) {
              cleanup();
              stopped = true;
              resolve32();
            }
          },
          { escapeCodeTimeout: 25 }
        );
      });
    }
  } while (pageToken && !stopped);
}
var instancesArgs, containersInstancesCommand;
var init_instances2 = __esm({
  "src/containers/instances.ts"() {
    init_import_meta_url();
    init_colors();
    init_interactive();
    init_containers_shared();
    init_dist();
    init_common();
    init_create_command();
    init_is_interactive();
    init_logger();
    init_onKeyPress();
    init_containers2();
    __name(deriveInstanceState, "deriveInstanceState");
    __name(colorState2, "colorState");
    __name(buildInstanceRows, "buildInstanceRows");
    __name(fetchPage, "fetchPage");
    __name(rowsToJsonOutput, "rowsToJsonOutput");
    __name(renderTable, "renderTable");
    instancesArgs = {
      ID: {
        describe: "ID of the application to list instances for",
        type: "string",
        demandOption: true
      },
      "per-page": {
        describe: "Number of instances per page",
        type: "number",
        default: 25,
        coerce: /* @__PURE__ */ __name((val2) => {
          if (val2 < 1) {
            throw new UserError("--per-page must be at least 1");
          }
          return val2;
        }, "coerce")
      },
      json: {
        describe: "Return output as JSON",
        type: "boolean",
        default: false
      }
    };
    __name(instancesCommand, "instancesCommand");
    containersInstancesCommand = createCommand({
      metadata: {
        description: "List container instances for an application",
        status: "open beta",
        owner: "Product: Cloudchamber"
      },
      behaviour: {
        printBanner: /* @__PURE__ */ __name((args) => !args.json && !isNonInteractiveOrCI(), "printBanner")
      },
      args: instancesArgs,
      positionalArgs: ["ID"],
      async handler(args, { config }) {
        await fillOpenAPIConfiguration(config, containersScope);
        await instancesCommand(args);
      }
    });
  }
});

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

// ../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/constants.js
var require_constants7 = __commonJS({
  "../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/constants.js"(exports, module2) {
    init_import_meta_url();
    var BINARY_TYPES = ["nodebuffer", "arraybuffer", "fragments"];
    var hasBlob = typeof Blob !== "undefined";
    if (hasBlob) BINARY_TYPES.push("blob");
    module2.exports = {
      BINARY_TYPES,
      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: /* @__PURE__ */ __name(() => {
      }, "NOOP")
    };
  }
});

// ../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/buffer-util.js
var require_buffer_util = __commonJS({
  "../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/buffer-util.js"(exports, module2) {
    init_import_meta_url();
    var { EMPTY_BUFFER } = require_constants7();
    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 i7 = 0; i7 < list.length; i7++) {
        const buf = list[i7];
        target.set(buf, offset);
        offset += buf.length;
      }
      if (offset < totalLength) {
        return new FastBuffer(target.buffer, target.byteOffset, offset);
      }
      return target;
    }
    __name(concat, "concat");
    function _mask(source, mask, output, offset, length) {
      for (let i7 = 0; i7 < length; i7++) {
        output[offset + i7] = source[i7] ^ mask[i7 & 3];
      }
    }
    __name(_mask, "_mask");
    function _unmask(buffer, mask) {
      for (let i7 = 0; i7 < buffer.length; i7++) {
        buffer[i7] ^= mask[i7 & 3];
      }
    }
    __name(_unmask, "_unmask");
    function toArrayBuffer(buf) {
      if (buf.length === buf.buffer.byteLength) {
        return buf.buffer;
      }
      return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.length);
    }
    __name(toArrayBuffer, "toArrayBuffer");
    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;
    }
    __name(toBuffer, "toBuffer");
    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 (e10) {
      }
    }
  }
});

// ../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/limiter.js
var require_limiter = __commonJS({
  "../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/limiter.js"(exports, module2) {
    init_import_meta_url();
    var kDone = Symbol("kDone");
    var kRun = Symbol("kRun");
    var Limiter = class {
      static {
        __name(this, "Limiter");
      }
      /**
       * 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.18.0/node_modules/ws/lib/permessage-deflate.js
var require_permessage_deflate2 = __commonJS({
  "../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/permessage-deflate.js"(exports, module2) {
    init_import_meta_url();
    var zlib3 = __require("zlib");
    var bufferUtil = require_buffer_util();
    var Limiter = require_limiter();
    var { kStatusCode } = require_constants7();
    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 {
      static {
        __name(this, "PerMessageDeflate");
      }
      /**
       * 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" ? zlib3.Z_DEFAULT_WINDOWBITS : this.params[key];
          this._inflate = zlib3.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" ? zlib3.Z_DEFAULT_WINDOWBITS : this.params[key];
          this._deflate = zlib3.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(zlib3.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;
    }
    __name(deflateOnData, "deflateOnData");
    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();
    }
    __name(inflateOnData, "inflateOnData");
    function inflateOnError(err) {
      this[kPerMessageDeflate]._inflate = null;
      err[kStatusCode] = 1007;
      this[kCallback](err);
    }
    __name(inflateOnError, "inflateOnError");
  }
});

// ../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/validation.js
var require_validation = __commonJS({
  "../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/validation.js"(exports, module2) {
    init_import_meta_url();
    var { isUtf8 } = __require("buffer");
    var { hasBlob } = require_constants7();
    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;
    }
    __name(isValidStatusCode, "isValidStatusCode");
    function _isValidUTF8(buf) {
      const len = buf.length;
      let i7 = 0;
      while (i7 < len) {
        if ((buf[i7] & 128) === 0) {
          i7++;
        } else if ((buf[i7] & 224) === 192) {
          if (i7 + 1 === len || (buf[i7 + 1] & 192) !== 128 || (buf[i7] & 254) === 192) {
            return false;
          }
          i7 += 2;
        } else if ((buf[i7] & 240) === 224) {
          if (i7 + 2 >= len || (buf[i7 + 1] & 192) !== 128 || (buf[i7 + 2] & 192) !== 128 || buf[i7] === 224 && (buf[i7 + 1] & 224) === 128 || // Overlong
          buf[i7] === 237 && (buf[i7 + 1] & 224) === 160) {
            return false;
          }
          i7 += 3;
        } else if ((buf[i7] & 248) === 240) {
          if (i7 + 3 >= len || (buf[i7 + 1] & 192) !== 128 || (buf[i7 + 2] & 192) !== 128 || (buf[i7 + 3] & 192) !== 128 || buf[i7] === 240 && (buf[i7 + 1] & 240) === 128 || // Overlong
          buf[i7] === 244 && buf[i7 + 1] > 143 || buf[i7] > 244) {
            return false;
          }
          i7 += 4;
        } else {
          return false;
        }
      }
      return true;
    }
    __name(_isValidUTF8, "_isValidUTF8");
    function isBlob5(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");
    }
    __name(isBlob5, "isBlob");
    module2.exports = {
      isBlob: isBlob5,
      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 (e10) {
      }
    }
  }
});

// ../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/receiver.js
var require_receiver2 = __commonJS({
  "../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/receiver.js"(exports, module2) {
    init_import_meta_url();
    var { Writable: Writable5 } = __require("stream");
    var PerMessageDeflate = require_permessage_deflate2();
    var {
      BINARY_TYPES,
      EMPTY_BUFFER,
      kStatusCode,
      kWebSocket
    } = require_constants7();
    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 Writable5 {
      static {
        __name(this, "Receiver");
      }
      /**
       * 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, cb2) {
        if (this._opcode === 8 && this._state == GET_INFO) return cb2();
        this._bufferedBytes += chunk.length;
        this._buffers.push(chunk);
        this.startLoop(cb2);
      }
      /**
       * Consumes `n` bytes from the buffered data.
       *
       * @param {Number} n The number of bytes to consume
       * @return {Buffer} The consumed bytes
       * @private
       */
      consume(n9) {
        this._bufferedBytes -= n9;
        if (n9 === this._buffers[0].length) return this._buffers.shift();
        if (n9 < this._buffers[0].length) {
          const buf = this._buffers[0];
          this._buffers[0] = new FastBuffer(
            buf.buffer,
            buf.byteOffset + n9,
            buf.length - n9
          );
          return new FastBuffer(buf.buffer, buf.byteOffset, n9);
        }
        const dst = Buffer.allocUnsafe(n9);
        do {
          const buf = this._buffers[0];
          const offset = dst.length - n9;
          if (n9 >= buf.length) {
            dst.set(this._buffers.shift(), offset);
          } else {
            dst.set(new Uint8Array(buf.buffer, buf.byteOffset, n9), offset);
            this._buffers[0] = new FastBuffer(
              buf.buffer,
              buf.byteOffset + n9,
              buf.length - n9
            );
          }
          n9 -= buf.length;
        } while (n9 > 0);
        return dst;
      }
      /**
       * Starts the parsing loop.
       *
       * @param {Function} cb Callback
       * @private
       */
      startLoop(cb2) {
        this._loop = true;
        do {
          switch (this._state) {
            case GET_INFO:
              this.getInfo(cb2);
              break;
            case GET_PAYLOAD_LENGTH_16:
              this.getPayloadLength16(cb2);
              break;
            case GET_PAYLOAD_LENGTH_64:
              this.getPayloadLength64(cb2);
              break;
            case GET_MASK:
              this.getMask();
              break;
            case GET_DATA:
              this.getData(cb2);
              break;
            case INFLATING:
            case DEFER_EVENT:
              this._loop = false;
              return;
          }
        } while (this._loop);
        if (!this._errored) cb2();
      }
      /**
       * Reads the first two bytes of a frame.
       *
       * @param {Function} cb Callback
       * @private
       */
      getInfo(cb2) {
        if (this._bufferedBytes < 2) {
          this._loop = false;
          return;
        }
        const buf = this.consume(2);
        if ((buf[0] & 48) !== 0) {
          const error2 = this.createError(
            RangeError,
            "RSV2 and RSV3 must be clear",
            true,
            1002,
            "WS_ERR_UNEXPECTED_RSV_2_3"
          );
          cb2(error2);
          return;
        }
        const compressed = (buf[0] & 64) === 64;
        if (compressed && !this._extensions[PerMessageDeflate.extensionName]) {
          const error2 = this.createError(
            RangeError,
            "RSV1 must be clear",
            true,
            1002,
            "WS_ERR_UNEXPECTED_RSV_1"
          );
          cb2(error2);
          return;
        }
        this._fin = (buf[0] & 128) === 128;
        this._opcode = buf[0] & 15;
        this._payloadLength = buf[1] & 127;
        if (this._opcode === 0) {
          if (compressed) {
            const error2 = this.createError(
              RangeError,
              "RSV1 must be clear",
              true,
              1002,
              "WS_ERR_UNEXPECTED_RSV_1"
            );
            cb2(error2);
            return;
          }
          if (!this._fragmented) {
            const error2 = this.createError(
              RangeError,
              "invalid opcode 0",
              true,
              1002,
              "WS_ERR_INVALID_OPCODE"
            );
            cb2(error2);
            return;
          }
          this._opcode = this._fragmented;
        } else if (this._opcode === 1 || this._opcode === 2) {
          if (this._fragmented) {
            const error2 = this.createError(
              RangeError,
              `invalid opcode ${this._opcode}`,
              true,
              1002,
              "WS_ERR_INVALID_OPCODE"
            );
            cb2(error2);
            return;
          }
          this._compressed = compressed;
        } else if (this._opcode > 7 && this._opcode < 11) {
          if (!this._fin) {
            const error2 = this.createError(
              RangeError,
              "FIN must be set",
              true,
              1002,
              "WS_ERR_EXPECTED_FIN"
            );
            cb2(error2);
            return;
          }
          if (compressed) {
            const error2 = this.createError(
              RangeError,
              "RSV1 must be clear",
              true,
              1002,
              "WS_ERR_UNEXPECTED_RSV_1"
            );
            cb2(error2);
            return;
          }
          if (this._payloadLength > 125 || this._opcode === 8 && this._payloadLength === 1) {
            const error2 = this.createError(
              RangeError,
              `invalid payload length ${this._payloadLength}`,
              true,
              1002,
              "WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH"
            );
            cb2(error2);
            return;
          }
        } else {
          const error2 = this.createError(
            RangeError,
            `invalid opcode ${this._opcode}`,
            true,
            1002,
            "WS_ERR_INVALID_OPCODE"
          );
          cb2(error2);
          return;
        }
        if (!this._fin && !this._fragmented) this._fragmented = this._opcode;
        this._masked = (buf[1] & 128) === 128;
        if (this._isServer) {
          if (!this._masked) {
            const error2 = this.createError(
              RangeError,
              "MASK must be set",
              true,
              1002,
              "WS_ERR_EXPECTED_MASK"
            );
            cb2(error2);
            return;
          }
        } else if (this._masked) {
          const error2 = this.createError(
            RangeError,
            "MASK must be clear",
            true,
            1002,
            "WS_ERR_UNEXPECTED_MASK"
          );
          cb2(error2);
          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(cb2);
      }
      /**
       * Gets extended payload length (7+16).
       *
       * @param {Function} cb Callback
       * @private
       */
      getPayloadLength16(cb2) {
        if (this._bufferedBytes < 2) {
          this._loop = false;
          return;
        }
        this._payloadLength = this.consume(2).readUInt16BE(0);
        this.haveLength(cb2);
      }
      /**
       * Gets extended payload length (7+64).
       *
       * @param {Function} cb Callback
       * @private
       */
      getPayloadLength64(cb2) {
        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 error2 = this.createError(
            RangeError,
            "Unsupported WebSocket frame: payload length > 2^53 - 1",
            false,
            1009,
            "WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH"
          );
          cb2(error2);
          return;
        }
        this._payloadLength = num * Math.pow(2, 32) + buf.readUInt32BE(4);
        this.haveLength(cb2);
      }
      /**
       * Payload length has been read.
       *
       * @param {Function} cb Callback
       * @private
       */
      haveLength(cb2) {
        if (this._payloadLength && this._opcode < 8) {
          this._totalPayloadLength += this._payloadLength;
          if (this._totalPayloadLength > this._maxPayload && this._maxPayload > 0) {
            const error2 = this.createError(
              RangeError,
              "Max payload size exceeded",
              false,
              1009,
              "WS_ERR_UNSUPPORTED_MESSAGE_LENGTH"
            );
            cb2(error2);
            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(cb2) {
        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, cb2);
          return;
        }
        if (this._compressed) {
          this._state = INFLATING;
          this.decompress(data, cb2);
          return;
        }
        if (data.length) {
          this._messageLength = this._totalPayloadLength;
          this._fragments.push(data);
        }
        this.dataMessage(cb2);
      }
      /**
       * Decompresses data.
       *
       * @param {Buffer} data Compressed data
       * @param {Function} cb Callback
       * @private
       */
      decompress(data, cb2) {
        const perMessageDeflate = this._extensions[PerMessageDeflate.extensionName];
        perMessageDeflate.decompress(data, this._fin, (err, buf) => {
          if (err) return cb2(err);
          if (buf.length) {
            this._messageLength += buf.length;
            if (this._messageLength > this._maxPayload && this._maxPayload > 0) {
              const error2 = this.createError(
                RangeError,
                "Max payload size exceeded",
                false,
                1009,
                "WS_ERR_UNSUPPORTED_MESSAGE_LENGTH"
              );
              cb2(error2);
              return;
            }
            this._fragments.push(buf);
          }
          this.dataMessage(cb2);
          if (this._state === GET_INFO) this.startLoop(cb2);
        });
      }
      /**
       * Handles a data message.
       *
       * @param {Function} cb Callback
       * @private
       */
      dataMessage(cb2) {
        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(cb2);
            });
          }
        } else {
          const buf = concat(fragments, messageLength);
          if (!this._skipUTF8Validation && !isValidUTF8(buf)) {
            const error2 = this.createError(
              Error,
              "invalid UTF-8 sequence",
              true,
              1007,
              "WS_ERR_INVALID_UTF8"
            );
            cb2(error2);
            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(cb2);
            });
          }
        }
      }
      /**
       * Handles a control message.
       *
       * @param {Buffer} data Data to handle
       * @return {(Error|RangeError|undefined)} A possible error
       * @private
       */
      controlMessage(data, cb2) {
        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 error2 = this.createError(
                RangeError,
                `invalid status code ${code}`,
                true,
                1002,
                "WS_ERR_INVALID_CLOSE_CODE"
              );
              cb2(error2);
              return;
            }
            const buf = new FastBuffer(
              data.buffer,
              data.byteOffset + 2,
              data.length - 2
            );
            if (!this._skipUTF8Validation && !isValidUTF8(buf)) {
              const error2 = this.createError(
                Error,
                "invalid UTF-8 sequence",
                true,
                1007,
                "WS_ERR_INVALID_UTF8"
              );
              cb2(error2);
              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(cb2);
          });
        }
      }
      /**
       * 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.18.0/node_modules/ws/lib/sender.js
var require_sender2 = __commonJS({
  "../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/sender.js"(exports, module2) {
    init_import_meta_url();
    var { Duplex: Duplex2 } = __require("stream");
    var { randomFillSync } = __require("crypto");
    var PerMessageDeflate = require_permessage_deflate2();
    var { EMPTY_BUFFER, kWebSocket, NOOP } = require_constants7();
    var { isBlob: isBlob5, 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 {
      static {
        __name(this, "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, cb2) {
        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, cb2]);
        } else {
          this.sendFrame(_Sender.frame(buf, options), cb2);
        }
      }
      /**
       * 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, cb2) {
        let byteLength;
        let readOnly;
        if (typeof data === "string") {
          byteLength = Buffer.byteLength(data);
          readOnly = false;
        } else if (isBlob5(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 (isBlob5(data)) {
          if (this._state !== DEFAULT) {
            this.enqueue([this.getBlobData, data, false, options, cb2]);
          } else {
            this.getBlobData(data, false, options, cb2);
          }
        } else if (this._state !== DEFAULT) {
          this.enqueue([this.dispatch, data, false, options, cb2]);
        } else {
          this.sendFrame(_Sender.frame(data, options), cb2);
        }
      }
      /**
       * 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, cb2) {
        let byteLength;
        let readOnly;
        if (typeof data === "string") {
          byteLength = Buffer.byteLength(data);
          readOnly = false;
        } else if (isBlob5(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 (isBlob5(data)) {
          if (this._state !== DEFAULT) {
            this.enqueue([this.getBlobData, data, false, options, cb2]);
          } else {
            this.getBlobData(data, false, options, cb2);
          }
        } else if (this._state !== DEFAULT) {
          this.enqueue([this.dispatch, data, false, options, cb2]);
        } else {
          this.sendFrame(_Sender.frame(data, options), cb2);
        }
      }
      /**
       * 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, cb2) {
        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 (isBlob5(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 (isBlob5(data)) {
          if (this._state !== DEFAULT) {
            this.enqueue([this.getBlobData, data, this._compress, opts, cb2]);
          } else {
            this.getBlobData(data, this._compress, opts, cb2);
          }
        } else if (this._state !== DEFAULT) {
          this.enqueue([this.dispatch, data, this._compress, opts, cb2]);
        } else {
          this.dispatch(data, this._compress, opts, cb2);
        }
      }
      /**
       * 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, cb2) {
        this._bufferedBytes += options[kByteLength];
        this._state = GET_BLOB_DATA;
        blob.arrayBuffer().then((arrayBuffer2) => {
          if (this._socket.destroyed) {
            const err = new Error(
              "The socket was closed while the blob was being read"
            );
            process.nextTick(callCallbacks, this, err, cb2);
            return;
          }
          this._bufferedBytes -= options[kByteLength];
          const data = toBuffer(arrayBuffer2);
          if (!compress) {
            this._state = DEFAULT;
            this.sendFrame(_Sender.frame(data, options), cb2);
            this.dequeue();
          } else {
            this.dispatch(data, compress, options, cb2);
          }
        }).catch((err) => {
          process.nextTick(onError, this, err, cb2);
        });
      }
      /**
       * 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, cb2) {
        if (!compress) {
          this.sendFrame(_Sender.frame(data, options), cb2);
          return;
        }
        const perMessageDeflate = this._extensions[PerMessageDeflate.extensionName];
        this._bufferedBytes += options[kByteLength];
        this._state = DEFLATING;
        perMessageDeflate.compress(data, options.fin, (_5, buf) => {
          if (this._socket.destroyed) {
            const err = new Error(
              "The socket was closed while data was being compressed"
            );
            callCallbacks(this, err, cb2);
            return;
          }
          this._bufferedBytes -= options[kByteLength];
          this._state = DEFAULT;
          options.readOnly = false;
          this.sendFrame(_Sender.frame(buf, options), cb2);
          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[]} list The frame to send
       * @param {Function} [cb] Callback
       * @private
       */
      sendFrame(list, cb2) {
        if (list.length === 2) {
          this._socket.cork();
          this._socket.write(list[0]);
          this._socket.write(list[1], cb2);
          this._socket.uncork();
        } else {
          this._socket.write(list[0], cb2);
        }
      }
    };
    module2.exports = Sender2;
    function callCallbacks(sender, err, cb2) {
      if (typeof cb2 === "function") cb2(err);
      for (let i7 = 0; i7 < sender._queue.length; i7++) {
        const params = sender._queue[i7];
        const callback = params[params.length - 1];
        if (typeof callback === "function") callback(err);
      }
    }
    __name(callCallbacks, "callCallbacks");
    function onError(sender, err, cb2) {
      callCallbacks(sender, err, cb2);
      sender.onerror(err);
    }
    __name(onError, "onError");
  }
});

// ../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/event-target.js
var require_event_target = __commonJS({
  "../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/event-target.js"(exports, module2) {
    init_import_meta_url();
    var { kForOnEventAttribute, kListener } = require_constants7();
    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 Event2 = class {
      static {
        __name(this, "Event");
      }
      /**
       * 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(Event2.prototype, "target", { enumerable: true });
    Object.defineProperty(Event2.prototype, "type", { enumerable: true });
    var CloseEvent = class extends Event2 {
      static {
        __name(this, "CloseEvent");
      }
      /**
       * 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 Event2 {
      static {
        __name(this, "ErrorEvent");
      }
      /**
       * 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 Event2 {
      static {
        __name(this, "MessageEvent");
      }
      /**
       * 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 EventTarget2 = {
      /**
       * 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 = /* @__PURE__ */ __name(function onMessage(data, isBinary) {
            const event = new MessageEvent("message", {
              data: isBinary ? data : data.toString()
            });
            event[kTarget] = this;
            callListener(handler, this, event);
          }, "onMessage");
        } else if (type === "close") {
          wrapper = /* @__PURE__ */ __name(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);
          }, "onClose");
        } else if (type === "error") {
          wrapper = /* @__PURE__ */ __name(function onError(error2) {
            const event = new ErrorEvent("error", {
              error: error2,
              message: error2.message
            });
            event[kTarget] = this;
            callListener(handler, this, event);
          }, "onError");
        } else if (type === "open") {
          wrapper = /* @__PURE__ */ __name(function onOpen() {
            const event = new Event2("open");
            event[kTarget] = this;
            callListener(handler, this, event);
          }, "onOpen");
        } 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: Event2,
      EventTarget: EventTarget2,
      MessageEvent
    };
    function callListener(listener, thisArg, event) {
      if (typeof listener === "object" && listener.handleEvent) {
        listener.handleEvent.call(listener, event);
      } else {
        listener.call(thisArg, event);
      }
    }
    __name(callListener, "callListener");
  }
});

// ../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/extension.js
var require_extension = __commonJS({
  "../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/extension.js"(exports, module2) {
    init_import_meta_url();
    var { tokenChars } = require_validation();
    function push2(dest, name2, elem) {
      if (dest[name2] === void 0) dest[name2] = [elem];
      else dest[name2].push(elem);
    }
    __name(push2, "push");
    function parse17(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 i7 = 0;
      for (; i7 < header.length; i7++) {
        code = header.charCodeAt(i7);
        if (extensionName === void 0) {
          if (end === -1 && tokenChars[code] === 1) {
            if (start === -1) start = i7;
          } else if (i7 !== 0 && (code === 32 || code === 9)) {
            if (end === -1 && start !== -1) end = i7;
          } else if (code === 59 || code === 44) {
            if (start === -1) {
              throw new SyntaxError(`Unexpected character at index ${i7}`);
            }
            if (end === -1) end = i7;
            const name2 = header.slice(start, end);
            if (code === 44) {
              push2(offers, name2, params);
              params = /* @__PURE__ */ Object.create(null);
            } else {
              extensionName = name2;
            }
            start = end = -1;
          } else {
            throw new SyntaxError(`Unexpected character at index ${i7}`);
          }
        } else if (paramName === void 0) {
          if (end === -1 && tokenChars[code] === 1) {
            if (start === -1) start = i7;
          } else if (code === 32 || code === 9) {
            if (end === -1 && start !== -1) end = i7;
          } else if (code === 59 || code === 44) {
            if (start === -1) {
              throw new SyntaxError(`Unexpected character at index ${i7}`);
            }
            if (end === -1) end = i7;
            push2(params, header.slice(start, end), true);
            if (code === 44) {
              push2(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, i7);
            start = end = -1;
          } else {
            throw new SyntaxError(`Unexpected character at index ${i7}`);
          }
        } else {
          if (isEscaping) {
            if (tokenChars[code] !== 1) {
              throw new SyntaxError(`Unexpected character at index ${i7}`);
            }
            if (start === -1) start = i7;
            else if (!mustUnescape) mustUnescape = true;
            isEscaping = false;
          } else if (inQuotes) {
            if (tokenChars[code] === 1) {
              if (start === -1) start = i7;
            } else if (code === 34 && start !== -1) {
              inQuotes = false;
              end = i7;
            } else if (code === 92) {
              isEscaping = true;
            } else {
              throw new SyntaxError(`Unexpected character at index ${i7}`);
            }
          } else if (code === 34 && header.charCodeAt(i7 - 1) === 61) {
            inQuotes = true;
          } else if (end === -1 && tokenChars[code] === 1) {
            if (start === -1) start = i7;
          } else if (start !== -1 && (code === 32 || code === 9)) {
            if (end === -1) end = i7;
          } else if (code === 59 || code === 44) {
            if (start === -1) {
              throw new SyntaxError(`Unexpected character at index ${i7}`);
            }
            if (end === -1) end = i7;
            let value = header.slice(start, end);
            if (mustUnescape) {
              value = value.replace(/\\/g, "");
              mustUnescape = false;
            }
            push2(params, paramName, value);
            if (code === 44) {
              push2(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 ${i7}`);
          }
        }
      }
      if (start === -1 || inQuotes || code === 32 || code === 9) {
        throw new SyntaxError("Unexpected end of input");
      }
      if (end === -1) end = i7;
      const token = header.slice(start, end);
      if (extensionName === void 0) {
        push2(offers, token, params);
      } else {
        if (paramName === void 0) {
          push2(params, token, true);
        } else if (mustUnescape) {
          push2(params, paramName, token.replace(/\\/g, ""));
        } else {
          push2(params, paramName, token);
        }
        push2(offers, extensionName, params);
      }
      return offers;
    }
    __name(parse17, "parse");
    function format11(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((k7) => {
              let values = params[k7];
              if (!Array.isArray(values)) values = [values];
              return values.map((v8) => v8 === true ? k7 : `${k7}=${v8}`).join("; ");
            })
          ).join("; ");
        }).join(", ");
      }).join(", ");
    }
    __name(format11, "format");
    module2.exports = { format: format11, parse: parse17 };
  }
});

// ../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/websocket.js
var require_websocket2 = __commonJS({
  "../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/websocket.js"(exports, module2) {
    init_import_meta_url();
    var EventEmitter5 = __require("events");
    var https3 = __require("https");
    var http6 = __require("http");
    var net3 = __require("net");
    var tls = __require("tls");
    var { randomBytes: randomBytes2, createHash: createHash9 } = __require("crypto");
    var { Duplex: Duplex2, Readable: Readable11 } = __require("stream");
    var { URL: URL8 } = __require("url");
    var PerMessageDeflate = require_permessage_deflate2();
    var Receiver2 = require_receiver2();
    var Sender2 = require_sender2();
    var { isBlob: isBlob5 } = require_validation();
    var {
      BINARY_TYPES,
      EMPTY_BUFFER,
      GUID,
      kForOnEventAttribute,
      kListener,
      kStatusCode,
      kWebSocket,
      NOOP
    } = require_constants7();
    var {
      EventTarget: { addEventListener, removeEventListener }
    } = require_event_target();
    var { format: format11, parse: parse17 } = require_extension();
    var { toBuffer } = require_buffer_util();
    var closeTimeout = 30 * 1e3;
    var kAborted = Symbol("kAborted");
    var protocolVersions = [8, 13];
    var readyStates = ["CONNECTING", "OPEN", "CLOSING", "CLOSED"];
    var subprotocolRegex = /^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/;
    var WebSocket2 = class _WebSocket extends EventEmitter5 {
      static {
        __name(this, "WebSocket");
      }
      /**
       * 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._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, cb2) {
        if (this.readyState === _WebSocket.CONNECTING) {
          throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");
        }
        if (typeof data === "function") {
          cb2 = data;
          data = mask = void 0;
        } else if (typeof mask === "function") {
          cb2 = mask;
          mask = void 0;
        }
        if (typeof data === "number") data = data.toString();
        if (this.readyState !== _WebSocket.OPEN) {
          sendAfterClose(this, data, cb2);
          return;
        }
        if (mask === void 0) mask = !this._isServer;
        this._sender.ping(data || EMPTY_BUFFER, mask, cb2);
      }
      /**
       * 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, cb2) {
        if (this.readyState === _WebSocket.CONNECTING) {
          throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");
        }
        if (typeof data === "function") {
          cb2 = data;
          data = mask = void 0;
        } else if (typeof mask === "function") {
          cb2 = mask;
          mask = void 0;
        }
        if (typeof data === "number") data = data.toString();
        if (this.readyState !== _WebSocket.OPEN) {
          sendAfterClose(this, data, cb2);
          return;
        }
        if (mask === void 0) mask = !this._isServer;
        this._sender.pong(data || EMPTY_BUFFER, mask, cb2);
      }
      /**
       * 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, cb2) {
        if (this.readyState === _WebSocket.CONNECTING) {
          throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");
        }
        if (typeof options === "function") {
          cb2 = options;
          options = {};
        }
        if (typeof data === "number") data = data.toString();
        if (this.readyState !== _WebSocket.OPEN) {
          sendAfterClose(this, data, cb2);
          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, cb2);
      }
      /**
       * 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(WebSocket2, "CONNECTING", {
      enumerable: true,
      value: readyStates.indexOf("CONNECTING")
    });
    Object.defineProperty(WebSocket2.prototype, "CONNECTING", {
      enumerable: true,
      value: readyStates.indexOf("CONNECTING")
    });
    Object.defineProperty(WebSocket2, "OPEN", {
      enumerable: true,
      value: readyStates.indexOf("OPEN")
    });
    Object.defineProperty(WebSocket2.prototype, "OPEN", {
      enumerable: true,
      value: readyStates.indexOf("OPEN")
    });
    Object.defineProperty(WebSocket2, "CLOSING", {
      enumerable: true,
      value: readyStates.indexOf("CLOSING")
    });
    Object.defineProperty(WebSocket2.prototype, "CLOSING", {
      enumerable: true,
      value: readyStates.indexOf("CLOSING")
    });
    Object.defineProperty(WebSocket2, "CLOSED", {
      enumerable: true,
      value: readyStates.indexOf("CLOSED")
    });
    Object.defineProperty(WebSocket2.prototype, "CLOSED", {
      enumerable: true,
      value: readyStates.indexOf("CLOSED")
    });
    [
      "binaryType",
      "bufferedAmount",
      "extensions",
      "isPaused",
      "protocol",
      "readyState",
      "url"
    ].forEach((property) => {
      Object.defineProperty(WebSocket2.prototype, property, { enumerable: true });
    });
    ["open", "error", "close", "message"].forEach((method) => {
      Object.defineProperty(WebSocket2.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
          });
        }
      });
    });
    WebSocket2.prototype.addEventListener = addEventListener;
    WebSocket2.prototype.removeEventListener = removeEventListener;
    module2.exports = WebSocket2;
    function initAsClient(websocket, address, protocols, options) {
      const opts = {
        allowSynchronousEvents: true,
        autoPong: true,
        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;
      if (!protocolVersions.includes(opts.protocolVersion)) {
        throw new RangeError(
          `Unsupported protocol version: ${opts.protocolVersion} (supported versions: ${protocolVersions.join(", ")})`
        );
      }
      let parsedUrl;
      if (address instanceof URL8) {
        parsedUrl = address;
      } else {
        try {
          parsedUrl = new URL8(address);
        } catch (e10) {
          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 = randomBytes2(16).toString("base64");
      const request4 = isSecure ? https3.request : http6.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"] = format11({
          [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 = request4(opts);
        if (websocket._redirects) {
          websocket.emit("redirect", websocket.url, req);
        }
      } else {
        req = websocket._req = request4(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 URL8(location, address);
          } catch (e10) {
            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 !== WebSocket2.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 = createHash9("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 = parse17(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();
      }
    }
    __name(initAsClient, "initAsClient");
    function emitErrorAndClose(websocket, err) {
      websocket._readyState = WebSocket2.CLOSING;
      websocket._errorEmitted = true;
      websocket.emit("error", err);
      websocket.emitClose();
    }
    __name(emitErrorAndClose, "emitErrorAndClose");
    function netConnect(options) {
      options.path = options.socketPath;
      return net3.connect(options);
    }
    __name(netConnect, "netConnect");
    function tlsConnect(options) {
      options.path = void 0;
      if (!options.servername && options.servername !== "") {
        options.servername = net3.isIP(options.host) ? "" : options.host;
      }
      return tls.connect(options);
    }
    __name(tlsConnect, "tlsConnect");
    function abortHandshake(websocket, stream2, message) {
      websocket._readyState = WebSocket2.CLOSING;
      const err = new Error(message);
      Error.captureStackTrace(err, abortHandshake);
      if (stream2.setHeader) {
        stream2[kAborted] = true;
        stream2.abort();
        if (stream2.socket && !stream2.socket.destroyed) {
          stream2.socket.destroy();
        }
        process.nextTick(emitErrorAndClose, websocket, err);
      } else {
        stream2.destroy(err);
        stream2.once("error", websocket.emit.bind(websocket, "error"));
        stream2.once("close", websocket.emitClose.bind(websocket));
      }
    }
    __name(abortHandshake, "abortHandshake");
    function sendAfterClose(websocket, data, cb2) {
      if (data) {
        const length = isBlob5(data) ? data.size : toBuffer(data).length;
        if (websocket._socket) websocket._sender._bufferedBytes += length;
        else websocket._bufferedAmount += length;
      }
      if (cb2) {
        const err = new Error(
          `WebSocket is not open: readyState ${websocket.readyState} (${readyStates[websocket.readyState]})`
        );
        process.nextTick(cb2, err);
      }
    }
    __name(sendAfterClose, "sendAfterClose");
    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);
    }
    __name(receiverOnConclude, "receiverOnConclude");
    function receiverOnDrain() {
      const websocket = this[kWebSocket];
      if (!websocket.isPaused) websocket._socket.resume();
    }
    __name(receiverOnDrain, "receiverOnDrain");
    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);
      }
    }
    __name(receiverOnError, "receiverOnError");
    function receiverOnFinish() {
      this[kWebSocket].emitClose();
    }
    __name(receiverOnFinish, "receiverOnFinish");
    function receiverOnMessage(data, isBinary) {
      this[kWebSocket].emit("message", data, isBinary);
    }
    __name(receiverOnMessage, "receiverOnMessage");
    function receiverOnPing(data) {
      const websocket = this[kWebSocket];
      if (websocket._autoPong) websocket.pong(data, !this._isServer, NOOP);
      websocket.emit("ping", data);
    }
    __name(receiverOnPing, "receiverOnPing");
    function receiverOnPong(data) {
      this[kWebSocket].emit("pong", data);
    }
    __name(receiverOnPong, "receiverOnPong");
    function resume(stream2) {
      stream2.resume();
    }
    __name(resume, "resume");
    function senderOnError(err) {
      const websocket = this[kWebSocket];
      if (websocket.readyState === WebSocket2.CLOSED) return;
      if (websocket.readyState === WebSocket2.OPEN) {
        websocket._readyState = WebSocket2.CLOSING;
        setCloseTimer(websocket);
      }
      this._socket.end();
      if (!websocket._errorEmitted) {
        websocket._errorEmitted = true;
        websocket.emit("error", err);
      }
    }
    __name(senderOnError, "senderOnError");
    function setCloseTimer(websocket) {
      websocket._closeTimer = setTimeout(
        websocket._socket.destroy.bind(websocket._socket),
        closeTimeout
      );
    }
    __name(setCloseTimer, "setCloseTimer");
    function socketOnClose() {
      const websocket = this[kWebSocket];
      this.removeListener("close", socketOnClose);
      this.removeListener("data", socketOnData);
      this.removeListener("end", socketOnEnd);
      websocket._readyState = WebSocket2.CLOSING;
      let chunk;
      if (!this._readableState.endEmitted && !websocket._closeFrameReceived && !websocket._receiver._writableState.errorEmitted && (chunk = websocket._socket.read()) !== null) {
        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);
      }
    }
    __name(socketOnClose, "socketOnClose");
    function socketOnData(chunk) {
      if (!this[kWebSocket]._receiver.write(chunk)) {
        this.pause();
      }
    }
    __name(socketOnData, "socketOnData");
    function socketOnEnd() {
      const websocket = this[kWebSocket];
      websocket._readyState = WebSocket2.CLOSING;
      websocket._receiver.end();
      this.end();
    }
    __name(socketOnEnd, "socketOnEnd");
    function socketOnError() {
      const websocket = this[kWebSocket];
      this.removeListener("error", socketOnError);
      this.on("error", NOOP);
      if (websocket) {
        websocket._readyState = WebSocket2.CLOSING;
        this.destroy();
      }
    }
    __name(socketOnError, "socketOnError");
  }
});

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

// ../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/websocket-server.js
var require_websocket_server = __commonJS({
  "../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/websocket-server.js"(exports, module2) {
    init_import_meta_url();
    var EventEmitter5 = __require("events");
    var http6 = __require("http");
    var { Duplex: Duplex2 } = __require("stream");
    var { createHash: createHash9 } = __require("crypto");
    var extension = require_extension();
    var PerMessageDeflate = require_permessage_deflate2();
    var subprotocol = require_subprotocol();
    var WebSocket2 = require_websocket2();
    var { GUID, kWebSocket } = require_constants7();
    var keyRegex = /^[+/0-9A-Za-z]{22}==$/;
    var RUNNING = 0;
    var CLOSING = 1;
    var CLOSED = 2;
    var WebSocketServer2 = class extends EventEmitter5 {
      static {
        __name(this, "WebSocketServer");
      }
      /**
       * 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 {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,
          verifyClient: null,
          noServer: false,
          backlog: null,
          // use default (511 as implemented in net.js)
          server: null,
          host: null,
          path: null,
          port: null,
          WebSocket: WebSocket2,
          ...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 = http6.createServer((req, res) => {
            const body = http6.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: /* @__PURE__ */ __name((req, socket, head) => {
              this.handleUpgrade(req, socket, head, emitConnection);
            }, "upgrade")
          });
        }
        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(cb2) {
        if (this._state === CLOSED) {
          if (cb2) {
            this.once("close", () => {
              cb2(new Error("The server is not running"));
            });
          }
          process.nextTick(emitClose, this);
          return;
        }
        if (cb2) this.once("close", cb2);
        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, cb2) {
        socket.on("error", socketOnError);
        const key = req.headers["sec-websocket-key"];
        const upgrade = req.headers.upgrade;
        const version5 = +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 (version5 !== 8 && version5 !== 13) {
          const message = "Missing or invalid Sec-WebSocket-Version header";
          abortHandshakeOrEmitwsClientError(this, req, socket, 400, message);
          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[`${version5 === 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,
                cb2
              );
            });
            return;
          }
          if (!this.options.verifyClient(info)) return abortHandshake(socket, 401);
        }
        this.completeUpgrade(extensions, key, protocols, req, socket, head, cb2);
      }
      /**
       * 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, cb2) {
        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 = createHash9("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);
            }
          });
        }
        cb2(ws, req);
      }
    };
    module2.exports = WebSocketServer2;
    function addListeners(server, map2) {
      for (const event of Object.keys(map2)) server.on(event, map2[event]);
      return /* @__PURE__ */ __name(function removeListeners() {
        for (const event of Object.keys(map2)) {
          server.removeListener(event, map2[event]);
        }
      }, "removeListeners");
    }
    __name(addListeners, "addListeners");
    function emitClose(server) {
      server._state = CLOSED;
      server.emit("close");
    }
    __name(emitClose, "emitClose");
    function socketOnError() {
      this.destroy();
    }
    __name(socketOnError, "socketOnError");
    function abortHandshake(socket, code, message, headers) {
      message = message || http6.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} ${http6.STATUS_CODES[code]}\r
` + Object.keys(headers).map((h7) => `${h7}: ${headers[h7]}`).join("\r\n") + "\r\n\r\n" + message
      );
    }
    __name(abortHandshake, "abortHandshake");
    function abortHandshakeOrEmitwsClientError(server, req, socket, code, message) {
      if (server.listenerCount("wsClientError")) {
        const err = new Error(message);
        Error.captureStackTrace(err, abortHandshakeOrEmitwsClientError);
        server.emit("wsClientError", err, socket, req);
      } else {
        abortHandshake(socket, code, message);
      }
    }
    __name(abortHandshakeOrEmitwsClientError, "abortHandshakeOrEmitwsClientError");
  }
});

// ../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/wrapper.mjs
var import_websocket, wrapper_default;
var init_wrapper = __esm({
  "../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/wrapper.mjs"() {
    init_import_meta_url();
    __toESM(require_stream(), 1);
    __toESM(require_receiver2(), 1);
    __toESM(require_sender2(), 1);
    import_websocket = __toESM(require_websocket2(), 1);
    __toESM(require_websocket_server(), 1);
    wrapper_default = import_websocket.default;
  }
});
async function sshCommand(sshArgs, _config) {
  if (sshArgs.ID.length !== 64) {
    throw new UserError(`Expected an instance ID but got ${sshArgs.ID}`);
  }
  let sshResponse;
  try {
    sshResponse = await promiseSpinner(
      DeploymentsService.containerWranglerSsh(sshArgs.ID),
      { message: "Authenticating" }
    );
  } catch (e10) {
    if (e10 instanceof ApiError) {
      if (e10.status === 404) {
        throw new Error(`Instance ${sshArgs.ID} not found`);
      }
      let msg = `Error verifying SSH access`;
      if (e10.body.error !== void 0) {
        msg += `: ${e10.body.error}`;
      }
      throw new Error(msg);
    }
    throw e10;
  }
  const proxy2 = createSshTcpProxy(sshResponse);
  const proxyController = new AbortController();
  proxy2.listen({ port: 0, signal: proxyController.signal });
  const proxyAddress = proxy2.address();
  if (proxyAddress === null || typeof proxyAddress !== "object") {
    throw new Error("Couldn't get local SSH TCP proxy address");
  }
  await verifySshInstalled("ssh");
  const [, , ...rest] = sshArgs._;
  const child = childProcess.spawn(
    "ssh",
    [
      "cloudchamber@127.0.0.1",
      "-p",
      `${proxyAddress.port}`,
      ...buildSshArgs(sshArgs),
      "--",
      ...rest.map((v8) => v8.toString())
    ],
    {
      stdio: ["inherit", "inherit", "inherit"],
      detached: true,
      signal: proxyController.signal
    }
  );
  const childKilled = new Promise((resolve32, reject) => {
    child.on("close", () => {
      resolve32(void 0);
    });
    child.on("error", reject);
    child.on("exit", (code) => {
      if (code !== 255) {
        resolve32(void 0);
      } else {
        reject(
          new Error(
            [
              "SSH exited unsuccessfully. Is the container running?",
              `${bold("NOTE:")} SSH does not automatically wake a container or count as activity to keep a container alive`
            ].join("\n")
          )
        );
      }
    });
  });
  showCursor(true);
  await childKilled;
  showCursor(false);
  proxyController.abort();
}
function verifySshInstalled(sshPath) {
  return new Promise((resolve32, reject) => {
    const child = childProcess.spawn(sshPath, ["-V"]);
    let errorHandled = false;
    child.on("close", (code) => {
      if (code === 0) {
        resolve32(void 0);
      } else if (!errorHandled) {
        errorHandled = true;
        reject(new Error(`ssh exited with status code: ${code}`));
      }
    });
    child.on("error", (err) => {
      if (!errorHandled) {
        errorHandled = true;
        reject(new Error(`Verifying SSH installation failed: ${err.message}`));
      }
    });
  });
}
function createSshTcpProxy(sshResponse) {
  let hasConnection = false;
  const proxy2 = net.createServer((inbound) => {
    if (hasConnection) {
      inbound.end();
      return;
    }
    hasConnection = true;
    inbound.on("error", (err) => {
      logger.error("Proxy error: ", err);
    });
    const ws = new import_websocket.default(sshResponse.url, {
      headers: {
        authorization: `Bearer ${sshResponse.token}`,
        "user-agent": "wrangler"
      }
    });
    ws.binaryType = "arraybuffer";
    ws.addEventListener("error", (err) => {
      logger.error("Web socket error:", err.message);
      inbound.end();
      proxy2.close();
    });
    ws.addEventListener("open", () => {
      inbound.on("data", (data) => {
        ws.send(data);
      });
      inbound.on("close", () => {
        ws.close();
        proxy2.close();
      });
      ws.on("message", (data) => {
        const arr = new Uint8Array(data);
        inbound.write(arr);
      });
      ws.addEventListener("close", () => {
        inbound.end();
        proxy2.close();
      });
    });
  });
  return proxy2;
}
function buildSshArgs(sshArgs) {
  const flags2 = [
    // Never use a control socket.
    "-o",
    "ControlMaster=no",
    "-o",
    "ControlPersist=no",
    // Disable writing host keys to user known hosts file.
    "-o",
    "UserKnownHostsFile=/dev/null",
    // Do not perform strict host key checking: we use the same IP
    // address to connect to every container, all of which can have
    // separate host keys.
    "-o",
    "StrictHostKeyChecking=no"
  ];
  if (process.env.WRANGLER_LOG !== "debug") {
    flags2.push("-o", "LogLevel=ERROR");
  }
  if (sshArgs.cipher !== void 0) {
    flags2.push("-c", sshArgs.cipher);
  }
  if (sshArgs.logFile !== void 0) {
    flags2.push("-E", sshArgs.logFile);
  }
  if (sshArgs.escapeChar !== void 0) {
    flags2.push("-e", sshArgs.escapeChar);
  }
  if (sshArgs.configFile !== void 0) {
    flags2.push("-F", sshArgs.configFile);
  }
  if (sshArgs.pkcs11 !== void 0) {
    flags2.push("-I", sshArgs.pkcs11);
  }
  if (sshArgs.identityFile !== void 0) {
    flags2.push("-i", sshArgs.identityFile);
  }
  if (sshArgs.macSpec !== void 0) {
    flags2.push("-m", sshArgs.macSpec);
  }
  if (sshArgs.option !== void 0) {
    const options = Array.isArray(sshArgs.option) ? sshArgs.option : [sshArgs.option];
    options.forEach((o7) => flags2.push("-o", o7));
  }
  if (sshArgs.tag !== void 0) {
    flags2.push("-P", sshArgs.tag);
  }
  return flags2;
}
var sshArgDefs, containersSshCommand;
var init_ssh = __esm({
  "src/containers/ssh.ts"() {
    init_import_meta_url();
    init_cli();
    init_colors();
    init_containers_shared();
    init_dist();
    init_wrapper();
    init_common();
    init_create_command();
    init_logger();
    init_containers2();
    sshArgDefs = {
      ID: {
        describe: "ID of the container instance",
        type: "string",
        demandOption: true
      },
      cipher: {
        describe: "Sets `ssh -c`: Select the cipher specification for encrypting the session",
        type: "string",
        hidden: true,
        deprecated: true
      },
      "log-file": {
        describe: "Sets `ssh -E`: Append debug logs to log_file instead of standard error",
        type: "string",
        hidden: true,
        deprecated: true
      },
      "escape-char": {
        describe: "Sets `ssh -e`: Set the escape character for sessions with a pty (default: '~')",
        type: "string",
        hidden: true,
        deprecated: true
      },
      "config-file": {
        alias: "F",
        describe: "Sets `ssh -F`: Specify an alternative per-user ssh configuration file",
        type: "string",
        hidden: true,
        deprecated: true
      },
      pkcs11: {
        describe: "Sets `ssh -I`: Specify the PKCS#11 shared library ssh should use to communicate with a PKCS#11 token providing keys for user authentication",
        type: "string",
        hidden: true,
        deprecated: true
      },
      "identity-file": {
        alias: "i",
        describe: "Sets `ssh -i`: Select a file from which the identity (private key) for public key authentication is read",
        type: "string",
        hidden: true,
        deprecated: true
      },
      "mac-spec": {
        describe: "Sets `ssh -m`: A comma-separated list of MAC (message authentication code) algorithms, specified in order of preference",
        type: "string",
        hidden: true,
        deprecated: true
      },
      option: {
        alias: "o",
        describe: "Sets `ssh -o`: Set options in the format used in the ssh configuration file. May be repeated",
        type: "string",
        hidden: true,
        deprecated: true
      },
      tag: {
        describe: "Sets `ssh -P`: Specify a tag name that may be used to select configuration in ssh_config",
        type: "string",
        hidden: true,
        deprecated: true
      }
    };
    __name(sshCommand, "sshCommand");
    __name(verifySshInstalled, "verifySshInstalled");
    __name(createSshTcpProxy, "createSshTcpProxy");
    __name(buildSshArgs, "buildSshArgs");
    containersSshCommand = createCommand({
      metadata: {
        description: "SSH into a container",
        status: "open beta",
        owner: "Product: Cloudchamber",
        hidden: true
      },
      args: sshArgDefs,
      positionalArgs: ["ID"],
      async handler(args, { config }) {
        await fillOpenAPIConfiguration(config, containersScope);
        await sshCommand(args);
      }
    });
  }
});

// src/secrets-store/client.ts
async function createStore(complianceConfig, accountId, body) {
  return await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/secrets_store/stores`,
    {
      method: "POST",
      body: JSON.stringify(body)
    }
  );
}
async function deleteStore(complianceConfig, accountId, storeId) {
  return await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/secrets_store/stores/${storeId}`,
    {
      method: "DELETE"
    }
  );
}
async function listStores(complianceConfig, accountId, urlParams) {
  return await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/secrets_store/stores`,
    {
      method: "GET"
    },
    urlParams
  );
}
async function listSecrets(complianceConfig, accountId, storeId, urlParams) {
  return await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/secrets_store/stores/${storeId}/secrets`,
    {
      method: "GET"
    },
    urlParams
  );
}
async function getSecret(complianceConfig, accountId, storeId, secretId) {
  return await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/secrets_store/stores/${storeId}/secrets/${secretId}`,
    {
      method: "GET"
    }
  );
}
async function getSecretByName(complianceConfig, accountId, storeId, secretName) {
  const urlSearchParams = new URLSearchParams();
  urlSearchParams.append("search", secretName);
  const secrets = await listSecrets(
    complianceConfig,
    accountId,
    storeId,
    urlSearchParams
  );
  const secret = secrets.find((s7) => s7.name === secretName);
  return secret?.id;
}
async function createSecret(complianceConfig, accountId, storeId, body) {
  return await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/secrets_store/stores/${storeId}/secrets`,
    {
      method: "POST",
      body: JSON.stringify([body])
    }
  );
}
async function updateSecret(complianceConfig, accountId, storeId, secretId, body) {
  return await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/secrets_store/stores/${storeId}/secrets/${secretId}`,
    {
      method: "PATCH",
      body: JSON.stringify(body)
    }
  );
}
async function deleteSecret(complianceConfig, accountId, storeId, secretId) {
  return await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/secrets_store/stores/${storeId}/secrets/${secretId}`,
    {
      method: "DELETE"
    }
  );
}
async function duplicateSecret(complianceConfig, accountId, storeId, secretId, body) {
  return await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/secrets_store/stores/${storeId}/secrets/${secretId}/duplicate`,
    {
      method: "POST",
      body: JSON.stringify(body)
    }
  );
}
var init_client2 = __esm({
  "src/secrets-store/client.ts"() {
    init_import_meta_url();
    init_cfetch();
    __name(createStore, "createStore");
    __name(deleteStore, "deleteStore");
    __name(listStores, "listStores");
    __name(listSecrets, "listSecrets");
    __name(getSecret, "getSecret");
    __name(getSecretByName, "getSecretByName");
    __name(createSecret, "createSecret");
    __name(updateSecret, "updateSecret");
    __name(deleteSecret, "deleteSecret");
    __name(duplicateSecret, "duplicateSecret");
  }
});
function getLocalPersistencePath(persistTo, { userConfigPath }) {
  if (persistTo === false) {
    return false;
  }
  return persistTo ? (
    // If path specified, always treat it as relative to cwd()
    path3__namespace.default.resolve(process.cwd(), persistTo)
  ) : (
    // Otherwise, treat it as relative to the Wrangler configuration file,
    // if one can be found, otherwise cwd()
    path3__namespace.default.resolve(
      userConfigPath ? path3__namespace.default.dirname(userConfigPath) : process.cwd(),
      ".wrangler/state"
    )
  );
}
var init_get_local_persistence_path = __esm({
  "src/dev/get-local-persistence-path.ts"() {
    init_import_meta_url();
    __name(getLocalPersistencePath, "getLocalPersistencePath");
  }
});

// src/utils/std.ts
function trimTrailingWhitespace(str) {
  return str.trimEnd();
}
function readFromStdin() {
  return new Promise((resolve32, reject) => {
    const stdin = process.stdin;
    const chunks = [];
    stdin.on("readable", () => {
      let chunk;
      while (null !== (chunk = stdin.read())) {
        chunks.push(chunk);
      }
    });
    stdin.on("end", () => {
      resolve32(chunks.join(""));
    });
    stdin.on("error", (err) => {
      reject(err);
    });
  });
}
var init_std = __esm({
  "src/utils/std.ts"() {
    init_import_meta_url();
    __name(trimTrailingWhitespace, "trimTrailingWhitespace");
    __name(readFromStdin, "readFromStdin");
  }
});
async function usingLocalSecretsStoreSecretAPI(persistTo, config, storeId, secretName, closure) {
  const persist = getLocalPersistencePath(persistTo, config);
  const defaultPersistRoot = getDefaultPersistRoot(persist);
  const mf = new miniflare.Miniflare({
    script: 'addEventListener("fetch", (e) => e.respondWith(new Response(null, { status: 404 })))',
    defaultPersistRoot,
    secretsStoreSecrets: {
      SECRET: {
        store_id: storeId,
        secret_name: secretName
      }
    }
  });
  const namespace = await mf.getSecretsStoreSecretAPI("SECRET");
  try {
    return await closure(namespace());
  } finally {
    await mf.dispose();
  }
}
var secretsStoreStoreCreateCommand, secretsStoreStoreDeleteCommand, secretsStoreStoreListCommand, secretsStoreSecretListCommand, secretsStoreSecretGetCommand, secretsStoreSecretCreateCommand, secretsStoreSecretUpdateCommand, secretsStoreSecretDeleteCommand, secretsStoreSecretDuplicateCommand, validateSecretName;
var init_commands2 = __esm({
  "src/secrets-store/commands.ts"() {
    init_import_meta_url();
    init_dist();
    init_create_command();
    init_get_local_persistence_path();
    init_miniflare();
    init_dialogs();
    init_logger();
    init_user3();
    init_std();
    init_client2();
    __name(usingLocalSecretsStoreSecretAPI, "usingLocalSecretsStoreSecretAPI");
    secretsStoreStoreCreateCommand = createCommand({
      metadata: {
        description: "Create a store within an account",
        status: "open beta",
        owner: "Product: SSL",
        category: "Storage & databases"
      },
      positionalArgs: ["name"],
      args: {
        name: {
          type: "string",
          description: "Name of the store",
          demandOption: true,
          requiresArg: true
        },
        remote: {
          type: "boolean",
          description: "Execute command against remote Secrets Store",
          default: false
        }
      },
      async handler(args, { config }) {
        let store;
        logger.log(`\u{1F510} Creating store... (Name: ${args.name})`);
        if (args.remote) {
          const accountId = await getAccountId(config);
          store = await createStore(config, accountId, { name: args.name });
        } else {
          throw new UserError(
            "Local secrets stores are automatically created for you on use. To create a Secrets Store on your account, use the --remote flag.",
            { telemetryMessage: true }
          );
        }
        logger.log(`\u2705 Created store! (Name: ${args.name}, ID: ${store.id})`);
      }
    });
    secretsStoreStoreDeleteCommand = createCommand({
      metadata: {
        description: "Delete a store within an account",
        status: "open beta",
        owner: "Product: SSL"
      },
      positionalArgs: ["store-id"],
      args: {
        "store-id": {
          type: "string",
          description: "ID of the store",
          demandOption: true,
          requiresArg: true
        },
        remote: {
          type: "boolean",
          description: "Execute command against remote Secrets Store",
          default: false
        }
      },
      async handler(args, { config }) {
        logger.log(`\u{1F510} Deleting store... (Name: ${args.storeId})`);
        if (args.remote) {
          const accountId = await getAccountId(config);
          await deleteStore(config, accountId, args.storeId);
        } else {
          throw new UserError(
            "This command is not supported in local mode. Use `wrangler <cmd> --remote` to delete a Secrets Store from your account.",
            { telemetryMessage: true }
          );
        }
        logger.log(`\u2705 Deleted store! (ID: ${args.storeId})`);
      }
    });
    secretsStoreStoreListCommand = createCommand({
      metadata: {
        description: "List stores within an account",
        status: "open beta",
        owner: "Product: SSL"
      },
      args: {
        page: {
          describe: 'Page number of stores listing results, can configure page size using "per-page"',
          type: "number",
          default: 1
        },
        "per-page": {
          describe: "Number of stores to show per page",
          type: "number",
          default: 10
        },
        remote: {
          type: "boolean",
          description: "Execute command against remote Secrets Store",
          default: false
        }
      },
      async handler(args, { config }) {
        const urlParams = new URLSearchParams();
        urlParams.set("per_page", args.perPage.toString());
        urlParams.set("page", args.page.toString());
        logger.log(`\u{1F510} Listing stores...`);
        let stores;
        if (args.remote) {
          const accountId = await getAccountId(config);
          stores = await listStores(config, accountId, urlParams);
        } else {
          throw new UserError(
            "This command is not supported in local mode. Use `wrangler <cmd> --remote` to list Secrets Stores on your account.",
            { telemetryMessage: true }
          );
        }
        if (stores.length === 0) {
          throw new UserError("List request returned no stores.", {
            telemetryMessage: true
          });
        } else {
          const prettierStores = stores.sort((a7, b11) => a7.name.localeCompare(b11.name)).map((store) => ({
            Name: store.name,
            ID: store.id,
            AccountID: store.account_id,
            Created: new Date(store.created).toLocaleString(),
            Modified: new Date(store.modified).toLocaleString()
          }));
          logger.table(prettierStores);
        }
      }
    });
    secretsStoreSecretListCommand = createCommand({
      metadata: {
        description: "List secrets within a store",
        status: "open beta",
        owner: "Product: SSL"
      },
      positionalArgs: ["store-id"],
      args: {
        "store-id": {
          describe: "ID of the store in which to list secrets",
          type: "string",
          demandOption: true,
          requiresArg: true
        },
        page: {
          describe: 'Page number of secrets listing results, can configure page size using "per-page"',
          type: "number",
          default: 1
        },
        "per-page": {
          describe: "Number of secrets to show per page",
          type: "number",
          default: 10
        },
        remote: {
          type: "boolean",
          description: "Execute command against remote Secrets Store",
          default: false
        },
        "persist-to": {
          type: "string",
          describe: "Directory for local persistence"
        }
      },
      async handler(args, { config }) {
        const urlParams = new URLSearchParams();
        urlParams.set("per_page", args.perPage.toString());
        urlParams.set("page", args.page.toString());
        logger.log(
          `\u{1F510} Listing secrets... (store-id: ${args.storeId}, page: ${args.page}, per-page: ${args.perPage})`
        );
        let secrets;
        if (args.remote) {
          const accountId = await getAccountId(config);
          secrets = await listSecrets(config, accountId, args.storeId, urlParams);
        } else {
          secrets = (await usingLocalSecretsStoreSecretAPI(
            args.persistTo,
            config,
            args.storeId,
            "",
            (api) => api.list()
          )).map((key) => ({
            // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
            id: key.metadata.uuid,
            store_id: args.storeId,
            name: key.name,
            comment: "",
            scopes: [],
            created: (/* @__PURE__ */ new Date()).toISOString(),
            modified: (/* @__PURE__ */ new Date()).toISOString(),
            status: "active"
          }));
        }
        if (secrets.length === 0) {
          throw new FatalError("List request returned no secrets.", 1, {
            telemetryMessage: true
          });
        } else {
          const prettierSecrets = secrets.map((secret) => ({
            Name: secret.name,
            ID: secret.id,
            Comment: secret.comment,
            Scopes: secret.scopes.join(", "),
            Status: secret.status === "active" ? "active " : "pending",
            Created: new Date(secret.created).toLocaleString(),
            Modified: new Date(secret.modified).toLocaleString()
          }));
          logger.table(prettierSecrets);
        }
      }
    });
    secretsStoreSecretGetCommand = createCommand({
      metadata: {
        description: "Get a secret within a store",
        status: "open beta",
        owner: "Product: SSL"
      },
      positionalArgs: ["store-id"],
      args: {
        "store-id": {
          describe: "ID of the store in which the secret resides",
          type: "string",
          demandOption: true,
          requiresArg: true
        },
        "secret-id": {
          describe: "ID of the secret to retrieve",
          type: "string",
          demandOption: true,
          requiresArg: true
        },
        remote: {
          type: "boolean",
          description: "Execute command against remote Secrets Store",
          default: false
        },
        "persist-to": {
          type: "string",
          describe: "Directory for local persistence"
        }
      },
      async handler(args, { config }) {
        logger.log(`\u{1F510} Getting secret... (ID: ${args.secretId})`);
        let secret;
        if (args.remote) {
          const accountId = await getAccountId(config);
          secret = await getSecret(config, accountId, args.storeId, args.secretId);
        } else {
          const name2 = await usingLocalSecretsStoreSecretAPI(
            args.persistTo,
            config,
            args.storeId,
            "",
            (api) => api.get(args.secretId)
          );
          secret = {
            id: args.secretId,
            store_id: args.storeId,
            name: name2,
            comment: "",
            scopes: [],
            created: (/* @__PURE__ */ new Date()).toISOString(),
            modified: (/* @__PURE__ */ new Date()).toISOString(),
            status: "active"
          };
        }
        const prettierSecret = [
          {
            Name: secret.name,
            ID: secret.id,
            StoreID: secret.store_id,
            Comment: secret.comment,
            Scopes: secret.scopes.join(", "),
            Status: secret.status === "active" ? "active " : "pending",
            Created: new Date(secret.created).toLocaleString(),
            Modified: new Date(secret.modified).toLocaleString()
          }
        ];
        logger.table(prettierSecret);
      }
    });
    secretsStoreSecretCreateCommand = createCommand({
      metadata: {
        description: "Create a secret within a store",
        status: "open beta",
        owner: "Product: SSL"
      },
      positionalArgs: ["store-id"],
      args: {
        "store-id": {
          describe: "ID of the store in which the secret resides",
          type: "string",
          requiresArg: true,
          demandOption: true
        },
        name: {
          describe: "Name of the secret",
          type: "string",
          requiresArg: true,
          demandOption: true
        },
        value: {
          describe: "Value of the secret (Note: Only for testing. Not secure as this will leave secret value in plain-text in terminal history, exclude this flag and use automatic prompt instead)",
          type: "string"
        },
        scopes: {
          describe: 'Scopes for the secret (comma-separated list of scopes eg:"workers")',
          type: "string",
          requiresArg: true,
          demandOption: true
        },
        comment: {
          describe: "Comment for the secret",
          type: "string"
        },
        remote: {
          type: "boolean",
          description: "Execute command against remote Secrets Store",
          default: false
        },
        "persist-to": {
          type: "string",
          describe: "Directory for local persistence"
        }
      },
      validateArgs(args) {
        validateSecretName(args.name);
      },
      async handler(args, { config }) {
        let secretValue = "";
        if (!args.value) {
          const isInteractive4 = process.stdin.isTTY;
          secretValue = trimTrailingWhitespace(
            isInteractive4 ? await prompt("Enter a secret value:", { isSecret: true }) : await readFromStdin()
          );
        } else {
          secretValue = args.value;
        }
        if (!secretValue) {
          throw new UserError("Need to pass in a value when creating a secret.");
        }
        logger.log(
          `
\u{1F510} Creating secret... (Name: ${args.name}, Value: REDACTED, Scopes: ${args.scopes}, Comment: ${args.comment})`
        );
        let secrets;
        if (args.remote) {
          const accountId = await getAccountId(config);
          secrets = await createSecret(config, accountId, args.storeId, {
            name: args.name,
            value: secretValue,
            scopes: args.scopes.split(","),
            comment: args.comment
          });
        } else {
          secrets = [
            await usingLocalSecretsStoreSecretAPI(
              args.persistTo,
              config,
              args.storeId,
              args.name,
              (api) => api.create(secretValue)
            )
          ].map((id) => ({
            id,
            store_id: args.storeId,
            name: args.name,
            comment: args.comment ?? "",
            scopes: args.scopes.split(","),
            created: (/* @__PURE__ */ new Date()).toISOString(),
            modified: (/* @__PURE__ */ new Date()).toISOString(),
            status: "pending"
          }));
        }
        if (secrets.length === 0) {
          throw new FatalError("Failed to create a secret.", 1, {
            telemetryMessage: true
          });
        }
        const secret = secrets[0];
        logger.log(`\u2705 Created secret! (ID: ${secret.id})`);
        const prettierSecret = [
          {
            Name: secret.name,
            ID: secret.id,
            StoreID: secret.store_id,
            Comment: secret.comment,
            Scopes: secret.scopes.join(", "),
            Status: secret.status,
            Created: new Date(secret.created).toLocaleString(),
            Modified: new Date(secret.modified).toLocaleString()
          }
        ];
        logger.table(prettierSecret);
      }
    });
    secretsStoreSecretUpdateCommand = createCommand({
      metadata: {
        description: "Update a secret within a store",
        status: "open beta",
        owner: "Product: SSL"
      },
      positionalArgs: ["store-id"],
      args: {
        "store-id": {
          describe: "ID of the store in which the secret resides",
          type: "string",
          requiresArg: true,
          demandOption: true
        },
        "secret-id": {
          describe: "ID of the secret to update",
          type: "string",
          requiresArg: true,
          demandOption: true
        },
        value: {
          describe: "Updated value of the secret (Note: Only for testing. Not secure as this will leave secret value in plain-text in terminal history, exclude this flag and use automatic prompt instead)",
          type: "string"
        },
        scopes: {
          describe: 'Updated scopes for the secret (comma-separated list of scopes eg:"workers")',
          type: "string"
        },
        comment: {
          describe: "Updated comment for the secret",
          type: "string"
        },
        remote: {
          type: "boolean",
          description: "Execute command against remote Secrets Store",
          default: false
        },
        "persist-to": {
          type: "string",
          describe: "Directory for local persistence"
        }
      },
      async handler(args, { config }) {
        let secretValue = "";
        if (!args.value) {
          const confirmValueUpdate = await confirm(
            "Do you want to update the secret value?",
            { defaultValue: false }
          );
          if (confirmValueUpdate) {
            const isInteractive4 = process.stdin.isTTY;
            secretValue = trimTrailingWhitespace(
              isInteractive4 ? await prompt("Enter a secret value:", { isSecret: true }) : await readFromStdin()
            );
          }
        } else {
          secretValue = args.value;
        }
        if (!secretValue && !args.scopes && !args.comment) {
          throw new UserError(
            "Need to pass in a new field using `--value`, `--scopes`, or `--comment` to update a secret."
          );
        }
        logger.log(`\u{1F510} Updating secret... (ID: ${args.secretId})`);
        let secret;
        if (args.remote) {
          const accountId = await getAccountId(config);
          secret = await updateSecret(
            config,
            accountId,
            args.storeId,
            args.secretId,
            {
              ...secretValue && { value: secretValue },
              ...args.scopes && { scopes: args.scopes.split(",") },
              ...args.comment && { comment: args.comment }
            }
          );
        } else {
          const name2 = await usingLocalSecretsStoreSecretAPI(
            args.persistTo,
            config,
            args.storeId,
            "",
            (api) => api.update(secretValue, args.secretId)
          );
          secret = {
            id: args.secretId,
            store_id: args.storeId,
            name: name2,
            comment: "",
            scopes: [],
            created: (/* @__PURE__ */ new Date()).toISOString(),
            modified: (/* @__PURE__ */ new Date()).toISOString(),
            status: "active"
          };
        }
        logger.log(`\u2705 Updated secret! (ID: ${secret.id})`);
        const prettierSecret = [
          {
            Name: secret.name,
            ID: secret.id,
            StoreID: secret.store_id,
            Comment: secret.comment,
            Scopes: secret.scopes.join(", "),
            Status: secret.status,
            Created: new Date(secret.created).toLocaleString(),
            Modified: new Date(secret.modified).toLocaleString()
          }
        ];
        logger.table(prettierSecret);
      }
    });
    secretsStoreSecretDeleteCommand = createCommand({
      metadata: {
        description: "Delete a secret within a store",
        status: "open beta",
        owner: "Product: SSL"
      },
      positionalArgs: ["store-id"],
      args: {
        "store-id": {
          describe: "ID of the store in which the secret resides",
          type: "string",
          requiresArg: true,
          demandOption: true
        },
        "secret-id": {
          describe: "ID of the secret to delete",
          type: "string",
          requiresArg: true,
          demandOption: true
        },
        remote: {
          type: "boolean",
          description: "Execute command against remote Secrets Store",
          default: false
        },
        "persist-to": {
          type: "string",
          describe: "Directory for local persistence"
        }
      },
      async handler(args, { config }) {
        logger.log(`\u{1F510} Deleting secret... (ID: ${args.secretId})`);
        if (args.remote) {
          const accountId = await getAccountId(config);
          await deleteSecret(config, accountId, args.storeId, args.secretId);
        } else {
          await usingLocalSecretsStoreSecretAPI(
            args.persistTo,
            config,
            args.storeId,
            "",
            (api) => api.delete(args.secretId)
          );
        }
        logger.log(`\u2705 Deleted secret! (ID: ${args.secretId})`);
      }
    });
    secretsStoreSecretDuplicateCommand = createCommand({
      metadata: {
        description: "Duplicate a secret within a store",
        status: "open beta",
        owner: "Product: SSL"
      },
      positionalArgs: ["store-id"],
      args: {
        "store-id": {
          describe: "ID of the store in which the secret resides",
          type: "string",
          requiresArg: true,
          demandOption: true
        },
        "secret-id": {
          describe: "ID of the secret to duplicate the secret value of",
          type: "string",
          requiresArg: true,
          demandOption: true
        },
        name: {
          describe: "Name of the new secret",
          type: "string",
          requiresArg: true,
          demandOption: true
        },
        scopes: {
          describe: "Scopes for the new secret",
          type: "string",
          requiresArg: true,
          demandOption: true
        },
        comment: {
          describe: "Comment for the new secret",
          type: "string"
        },
        remote: {
          type: "boolean",
          description: "Execute command against remote Secrets Store",
          default: false
        },
        "persist-to": {
          type: "string",
          describe: "Directory for local persistence"
        }
      },
      validateArgs(args) {
        validateSecretName(args.name);
      },
      async handler(args, { config }) {
        logger.log(`\u{1F510} Duplicating secret... (ID: ${args.secretId})`);
        let duplicatedSecret;
        if (args.remote) {
          const accountId = await getAccountId(config);
          duplicatedSecret = await duplicateSecret(
            config,
            accountId,
            args.storeId,
            args.secretId,
            {
              name: args.name,
              scopes: args.scopes.split(","),
              comment: args.comment || ""
            }
          );
        } else {
          const duplicatedSecretId = await usingLocalSecretsStoreSecretAPI(
            args.persistTo,
            config,
            args.storeId,
            "",
            (api) => api.duplicate(args.secretId, args.name)
          );
          duplicatedSecret = {
            id: duplicatedSecretId,
            store_id: args.storeId,
            name: args.name,
            comment: "",
            scopes: [],
            created: (/* @__PURE__ */ new Date()).toISOString(),
            modified: (/* @__PURE__ */ new Date()).toISOString(),
            status: "active"
          };
        }
        logger.log(`\u2705 Duplicated secret! (ID: ${duplicatedSecret.id})`);
        const prettierSecret = [
          {
            Name: duplicatedSecret.name,
            ID: duplicatedSecret.id,
            StoreID: duplicatedSecret.store_id,
            Comment: duplicatedSecret.comment,
            Scopes: duplicatedSecret.scopes.join(", "),
            Status: duplicatedSecret.status,
            Created: new Date(duplicatedSecret.created).toLocaleString(),
            Modified: new Date(duplicatedSecret.modified).toLocaleString()
          }
        ];
        logger.table(prettierSecret);
      }
    });
    validateSecretName = /* @__PURE__ */ __name((name2) => {
      const validName = /^[A-z0-9-_]+$/;
      if (!validName.test(name2)) {
        throw new UserError(
          "Secret name may only contain alphanumeric characters, underscores, or dashes."
        );
      }
    }, "validateSecretName");
  }
});

// src/utils/diff.ts
function tokenize(value) {
  const retLines = [];
  const linesAndNewlines = value.split(/(\n|\r\n)/);
  if (!linesAndNewlines[linesAndNewlines.length - 1]) {
    linesAndNewlines.pop();
  }
  for (let i7 = 0; i7 < linesAndNewlines.length; i7++) {
    const line = linesAndNewlines[i7];
    retLines.push(line);
  }
  return retLines.filter((s7) => s7 !== "");
}
var Diff;
var init_diff = __esm({
  "src/utils/diff.ts"() {
    init_import_meta_url();
    init_cli();
    init_colors();
    Diff = class {
      static {
        __name(this, "Diff");
      }
      #results = [];
      get changes() {
        return this.#results.filter((r10) => r10.added || r10.removed).length;
      }
      constructor(a7, b11) {
        const oldString = tokenize(a7);
        const newString = tokenize(b11);
        const newLen = newString.length;
        const oldLen = oldString.length;
        let editLength = 1;
        const bestPath = [
          { oldPos: -1, lastComponent: void 0 }
        ];
        if (bestPath[0] === void 0) {
          throw new Error("unreachable");
        }
        let newPos = this.#extractCommon(bestPath[0], newString, oldString, 0);
        if (bestPath[0].oldPos + 1 >= oldLen && newPos + 1 >= newLen) {
          this.#results = this.#buildValues(
            bestPath[0].lastComponent,
            newString,
            oldString,
            false
          );
          return;
        }
        let minDiagonalToConsider = -Infinity;
        let maxDiagonalToConsider = Infinity;
        let done = false;
        while (!done) {
          for (let diagonalPath = Math.max(minDiagonalToConsider, -editLength); diagonalPath <= Math.min(maxDiagonalToConsider, editLength); diagonalPath += 2) {
            let basePath;
            const removePath = bestPath[diagonalPath - 1];
            const addPath = bestPath[diagonalPath + 1];
            if (removePath) {
              bestPath[diagonalPath - 1] = void 0;
            }
            let canAdd = false;
            if (addPath) {
              const addPathNewPos = addPath.oldPos - diagonalPath;
              canAdd = addPath && 0 <= addPathNewPos && addPathNewPos < newLen;
            }
            const canRemove = removePath && removePath.oldPos + 1 < oldLen;
            if (!canAdd && !canRemove) {
              bestPath[diagonalPath] = void 0;
              continue;
            }
            if (addPath && (!canRemove || canAdd && (removePath?.oldPos ?? 0) < (addPath?.oldPos ?? 0))) {
              basePath = this.#addToPath(addPath, true, false, 0);
            } else if (removePath) {
              basePath = this.#addToPath(removePath, false, true, 1);
            } else {
              throw new Error("unreachable");
            }
            newPos = this.#extractCommon(
              basePath,
              newString,
              oldString,
              diagonalPath
            );
            if (basePath.oldPos + 1 >= oldLen && newPos + 1 >= newLen) {
              this.#results = this.#buildValues(
                basePath.lastComponent,
                newString,
                oldString,
                false
              );
              done = true;
              break;
            }
            bestPath[diagonalPath] = basePath;
            if (basePath.oldPos + 1 >= oldLen) {
              maxDiagonalToConsider = Math.min(
                maxDiagonalToConsider,
                diagonalPath - 1
              );
            }
            if (newPos + 1 >= newLen) {
              minDiagonalToConsider = Math.max(
                minDiagonalToConsider,
                diagonalPath + 1
              );
            }
          }
          editLength++;
        }
      }
      /**
       * Results but refined to be printed/stringified.
       *
       * In particular the results returned here are ordered to try to avoid cases
       * in which an addition/removal is incorrectly split.
       *
       * For example, the standard results can produce something like:
       * ```
       *  ...
       * - "vars": {
       * + "vars": {},
       * -   "MY_VAR": "variable set in the dash"
       * - },
       *  ...
       * ```
       * (notice how the first removal is separated from the last two,
       * making the diff much less readable).
       * Such change in the refined results will instead look like:
       * ```
       *  ...
       * + "vars": {},
       * - "vars": {
       * -   "MY_VAR": "variable set in the dash"
       * - },
       *  ...
       * ```
       */
      get #resultsForPrint() {
        const results = [
          ...this.#results.filter((r10) => !!r10.value && r10.value !== "\n")
        ];
        const swapLines = /* @__PURE__ */ __name((i7, j7) => {
          const tmp = results[i7];
          results[i7] = results[j7];
          results[j7] = tmp;
        }, "swapLines");
        const numOfLines = /* @__PURE__ */ __name((str) => str.split("\n").length, "numOfLines");
        const isLoneResult = /* @__PURE__ */ __name((index, target) => {
          const currentIdx = index;
          const adjacentIdx = currentIdx + target;
          const nextIdx = currentIdx + target + target;
          if (!results[adjacentIdx] || !results[nextIdx] || !results[nextIdx]) {
            return false;
          }
          const previousIdx = index - target;
          const isAlternation = /* @__PURE__ */ __name((type) => results[currentIdx][type] === true && results[previousIdx]?.[type] !== results[currentIdx][type] && results[adjacentIdx][type === "added" ? "removed" : "added"] === true && results[nextIdx][type] === true, "isAlternation");
          if (!isAlternation("added") && !isAlternation("removed")) {
            return false;
          }
          return numOfLines(results[currentIdx].value ?? "") === 1 && numOfLines(results[adjacentIdx].value ?? "") === 1 && numOfLines(results[nextIdx].value ?? "") > 1;
        }, "isLoneResult");
        for (let i7 = 0; i7 < results.length; i7++) {
          if (isLoneResult(i7, 1)) {
            swapLines(i7, i7 + 1);
            continue;
          }
          if (isLoneResult(i7, -1)) {
            swapLines(i7, i7 - 1);
            continue;
          }
        }
        return results;
      }
      toString(options = {
        contextLines: 3
      }) {
        let output = "";
        let state2 = "init";
        const context2 = [];
        for (const result of this.#resultsForPrint) {
          if (result.value === void 0) {
            continue;
          }
          if (result.added || result.removed) {
            if (state2 === "diff") {
              context2.splice(0, options.contextLines).filter(Boolean).forEach((c8) => {
                output += `  ${c8}
`;
              });
              if (context2.length > options.contextLines) {
                output += "\n  ...\n\n";
              }
            }
            context2.splice(0, context2.length - options.contextLines);
            if (state2 === "init") {
              while (context2.length > 0 && context2[0].trim() === "") {
                context2.shift();
              }
            }
            context2.filter(Boolean).forEach((c8) => {
              output += `  ${c8}
`;
            });
            context2.length = 0;
            for (const l8 of result.value.split("\n")) {
              if (l8) {
                output += `${result.added ? green("+") : red("-")} ${l8}
`;
              }
            }
            state2 = "diff";
          } else {
            const lines = result.value.replace(/^\n|\n$/g, "").split("\n");
            context2.push(...lines);
          }
        }
        if (state2 === "diff") {
          context2.splice(options.contextLines);
          while (context2.length > 0 && context2[context2.length - 1].trim() === "") {
            context2.pop();
          }
          context2.filter(Boolean).forEach((c8) => {
            output += `  ${c8}
`;
          });
        }
        return output.replace(/\n$/, "");
      }
      print(options = {
        contextLines: 3
      }) {
        log(this.toString(options));
      }
      #addToPath(path84, added, removed, oldPosInc) {
        const last = path84.lastComponent;
        if (last && last.added === added && last.removed === removed) {
          return {
            oldPos: path84.oldPos + oldPosInc,
            lastComponent: {
              count: last.count + 1,
              added,
              removed,
              previousComponent: last.previousComponent
            }
          };
        }
        return {
          oldPos: path84.oldPos + oldPosInc,
          lastComponent: {
            count: 1,
            added,
            removed,
            previousComponent: last
          }
        };
      }
      #extractCommon(basePath, newString, oldString, diagonalPath) {
        const newLen = newString.length;
        const oldLen = oldString.length;
        let oldPos = basePath.oldPos, newPos = oldPos - diagonalPath, commonCount = 0;
        while (newPos + 1 < newLen && oldPos + 1 < oldLen && oldString[oldPos + 1] === newString[newPos + 1]) {
          newPos++;
          oldPos++;
          commonCount++;
        }
        if (commonCount) {
          basePath.lastComponent = {
            count: commonCount,
            previousComponent: basePath.lastComponent,
            added: false,
            removed: false
          };
        }
        basePath.oldPos = oldPos;
        return newPos;
      }
      #buildValues(lastComponent, newString, oldString, useLongestToken) {
        const components = [];
        let nextComponent;
        while (lastComponent) {
          components.push(lastComponent);
          nextComponent = lastComponent.previousComponent;
          delete lastComponent.previousComponent;
          lastComponent = nextComponent;
        }
        components.reverse();
        const componentLen = components.length;
        let componentPos = 0, newPos = 0, oldPos = 0;
        for (; componentPos < componentLen; componentPos++) {
          const component = components[componentPos];
          if (!component.removed) {
            if (!component.added && useLongestToken) {
              let value = newString.slice(newPos, newPos + component.count);
              value = value.map((el, i7) => {
                const oldValue = oldString[oldPos + i7];
                return oldValue.length > el.length ? oldValue : el;
              });
              component.value = value.join("");
            } else {
              component.value = newString.slice(newPos, newPos + component.count).join("");
            }
            newPos += component.count;
            if (!component.added) {
              oldPos += component.count;
            }
          } else {
            component.value = oldString.slice(oldPos, oldPos + component.count).join("");
            oldPos += component.count;
          }
        }
        return components;
      }
    };
    __name(tokenize, "tokenize");
  }
});

// src/utils/sortObjectRecursive.ts
function stripUndefined(r10) {
  for (const k7 in r10) {
    if (r10[k7] === void 0) {
      delete r10[k7];
    }
  }
  return r10;
}
function sortObjectKeys(unordered) {
  if (Array.isArray(unordered)) {
    return unordered;
  }
  return Object.keys(unordered).sort().reduce(
    (obj, key) => {
      obj[key] = unordered[key];
      return obj;
    },
    {}
  );
}
function sortObjectRecursive(object) {
  if (typeof object !== "object") {
    return object;
  }
  if (Array.isArray(object)) {
    return object.map((obj) => sortObjectRecursive(obj));
  }
  const objectCopy = { ...object };
  for (const [key, value] of Object.entries(object)) {
    if (typeof value === "object") {
      if (value === null) {
        continue;
      }
      objectCopy[key] = sortObjectRecursive(
        value
      );
    }
  }
  return sortObjectKeys(objectCopy);
}
var init_sortObjectRecursive = __esm({
  "src/utils/sortObjectRecursive.ts"() {
    init_import_meta_url();
    __name(stripUndefined, "stripUndefined");
    __name(sortObjectKeys, "sortObjectKeys");
    __name(sortObjectRecursive, "sortObjectRecursive");
  }
});

// src/versions/api.ts
async function fetchVersion(complianceConfig, accountId, workerName, versionId, versionCache) {
  const cachedVersion = versionCache?.get(versionId);
  if (cachedVersion) {
    return cachedVersion;
  }
  const version5 = await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/workers/scripts/${workerName}/versions/${versionId}`
  );
  versionCache?.set(version5.id, version5);
  return version5;
}
async function fetchVersions(complianceConfig, accountId, workerName, versionCache, ...versionIds) {
  return Promise.all(
    versionIds.map(
      (versionId) => fetchVersion(
        complianceConfig,
        accountId,
        workerName,
        versionId,
        versionCache
      )
    )
  );
}
async function fetchLatestDeployments(complianceConfig, accountId, workerName) {
  const { deployments } = await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/workers/scripts/${workerName}/deployments`
  );
  return deployments;
}
async function fetchLatestDeployment(complianceConfig, accountId, workerName) {
  const deployments = await fetchLatestDeployments(
    complianceConfig,
    accountId,
    workerName
  );
  return deployments.at(0);
}
async function fetchDeploymentVersions(complianceConfig, accountId, workerName, deployment, versionCache) {
  if (!deployment) {
    return [[], /* @__PURE__ */ new Map()];
  }
  const versionTraffic = new Map(
    deployment.versions.map((v8) => [v8.version_id, v8.percentage])
  );
  const versions2 = await fetchVersions(
    complianceConfig,
    accountId,
    workerName,
    versionCache,
    ...versionTraffic.keys()
  );
  return [versions2, versionTraffic];
}
async function fetchDeployableVersions(complianceConfig, accountId, workerName, versionCache) {
  const { items: versions2 } = await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/workers/scripts/${workerName}/versions?deployable=true`
  );
  for (const version5 of versions2) {
    versionCache.set(version5.id, version5);
  }
  return versions2;
}
async function createDeployment(complianceConfig, accountId, workerName, versionTraffic, message, force) {
  return await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/workers/scripts/${workerName}/deployments${force ? "?force=true" : ""}`,
    {
      method: "POST",
      headers: { "Content-Type": "application/json" },
      body: JSON.stringify({
        strategy: "percentage",
        versions: Array.from(versionTraffic).map(
          ([version_id, percentage]) => ({ version_id, percentage })
        ),
        annotations: {
          "workers/message": message
        }
      })
    }
  );
}
async function patchNonVersionedScriptSettings(complianceConfig, accountId, workerName, settings) {
  const res = await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/workers/scripts/${workerName}/script-settings`,
    {
      method: "PATCH",
      headers: { "Content-Type": "application/json" },
      body: JSON.stringify(settings)
    }
  );
  return res;
}
var init_api = __esm({
  "src/versions/api.ts"() {
    init_import_meta_url();
    init_cfetch();
    __name(fetchVersion, "fetchVersion");
    __name(fetchVersions, "fetchVersions");
    __name(fetchLatestDeployments, "fetchLatestDeployments");
    __name(fetchLatestDeployment, "fetchLatestDeployment");
    __name(fetchDeploymentVersions, "fetchDeploymentVersions");
    __name(fetchDeployableVersions, "fetchDeployableVersions");
    __name(createDeployment, "createDeployment");
    __name(patchNonVersionedScriptSettings, "patchNonVersionedScriptSettings");
  }
});
async function deployContainers(config, normalisedContainerConfig, { versionId, accountId, scriptName }) {
  await fillOpenAPIConfiguration(config, containersScope);
  const pathToDocker = getDockerPath();
  const boundDOs = new Set(
    config.durable_objects.bindings.map((b11) => b11.class_name)
  );
  let imageRef;
  let maybeVersionInfo;
  let maybeAllDurableObjects;
  for (const container of normalisedContainerConfig) {
    if ("dockerfile" in container) {
      imageRef = await buildContainer(
        container,
        versionId,
        false,
        // dry runs will have already exited by this point
        pathToDocker
      );
    } else {
      imageRef = { newTag: container.image_uri };
    }
    if (boundDOs.has(container.class_name)) {
      maybeVersionInfo ??= await fetchVersion(
        config,
        accountId,
        scriptName,
        versionId
      );
      const targetDurableObject = maybeVersionInfo.resources.bindings.find(
        (binding) => binding.type === "durable_object_namespace" && binding.class_name === container.class_name && // DO cannot be defined in a different script to the container
        (binding.script_name === void 0 || binding.script_name === scriptName) && binding.namespace_id !== void 0
      );
      if (!targetDurableObject) {
        throw new UserError(
          "Could not deploy container application as durable object was not found in list of bindings"
        );
      }
      assert53__default.default(
        targetDurableObject && targetDurableObject.namespace_id !== void 0
      );
      await apply(
        {
          imageRef,
          durable_object_namespace_id: targetDurableObject.namespace_id
        },
        container,
        config
      );
    } else {
      maybeAllDurableObjects ??= await listDurableObjects(config, accountId);
      const targetDurableObject = maybeAllDurableObjects.find(
        (durableObject) => durableObject.class === container.class_name && durableObject.script === scriptName
      );
      assert53__default.default(targetDurableObject, "Durable Object not returned from list API");
      await apply(
        {
          imageRef,
          durable_object_namespace_id: targetDurableObject.id
        },
        container,
        config
      );
    }
  }
}
async function listDurableObjects(complianceConfig, accountId) {
  return await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/workers/durable_objects/namespaces`,
    {},
    new URLSearchParams({ per_page: "1000" })
  );
}
function mergeDeep2(target, source) {
  if (typeof target !== "object" || target === null) {
    return source;
  }
  if (typeof source !== "object" || source === null) {
    return target;
  }
  const result = { ...target };
  for (const key of Object.keys(source)) {
    const srcVal = source[key];
    const tgtVal = target[key];
    if (isObject(tgtVal) && isObject(srcVal)) {
      result[key] = mergeDeep2(tgtVal, srcVal);
    } else {
      result[key] = srcVal;
    }
  }
  return result;
}
function isObject(value) {
  return typeof value === "object" && value !== null && !Array.isArray(value);
}
function createApplicationToModifyApplication(req) {
  return {
    configuration: req.configuration,
    max_instances: req.max_instances,
    constraints: req.constraints,
    affinities: req.affinities,
    scheduling_policy: req.scheduling_policy,
    rollout_active_grace_period: req.rollout_active_grace_period
  };
}
function observabilityToConfiguration(observabilityFromConfig, existingObservabilityConfig) {
  const logsAlreadyEnabled = existingObservabilityConfig?.logs?.enabled;
  if (observabilityFromConfig) {
    return { logs: { enabled: true } };
  } else if (logsAlreadyEnabled === void 0) {
    return void 0;
  } else {
    return { logs: { enabled: false } };
  }
}
function containerConfigToCreateRequest(accountId, containerApp, imageRef, durableObjectNamespaceId, prevApp) {
  return {
    name: containerApp.name,
    scheduling_policy: containerApp.scheduling_policy,
    configuration: {
      // De-sugar image name
      image: resolveImageName(accountId, imageRef),
      // if disk/memory/vcpu is not defined in config, AND instance_type is also not defined, this will already have been defaulted to 'dev'
      ..."instance_type" in containerApp ? { instance_type: containerApp.instance_type } : {
        disk: { size_mb: containerApp.disk_bytes / (1e3 * 1e3) },
        memory_mib: containerApp.memory_mib,
        vcpu: containerApp.vcpu
      },
      observability: observabilityToConfiguration(
        containerApp.observability.logs_enabled,
        prevApp?.configuration.observability
      ),
      wrangler_ssh: containerApp.wrangler_ssh,
      authorized_keys: containerApp.authorized_keys,
      trusted_user_ca_keys: containerApp.trusted_user_ca_keys
    },
    // deprecated in favour of max_instances
    instances: 0,
    max_instances: containerApp.max_instances,
    constraints: containerApp.constraints,
    affinities: containerApp.affinities,
    durable_objects: {
      namespace_id: durableObjectNamespaceId
    },
    rollout_active_grace_period: containerApp.rollout_active_grace_period
  };
}
async function apply(args, containerConfig, config) {
  if (!config.containers || config.containers.length === 0) {
    return;
  }
  startSection(
    "Deploy a container application",
    "deploy changes to your application"
  );
  const existingApplications = await promiseSpinner(
    ApplicationsService.listApplications(),
    { message: "Loading applications" }
  );
  const prevApp = existingApplications.find(
    (app) => app.name === containerConfig.name
  );
  const imageRef = "remoteDigest" in args.imageRef ? prevApp?.configuration.image ?? args.imageRef.remoteDigest : args.imageRef.newTag;
  log(dim("Container application changes\n"));
  const accountId = config.account_id || await getAccountId(config);
  const appConfig = mergeIfUnsafe(
    config,
    containerConfigToCreateRequest(
      accountId,
      containerConfig,
      imageRef,
      args.durable_object_namespace_id,
      prevApp
    ),
    containerConfig.name
  );
  if (prevApp !== void 0 && prevApp !== null) {
    if (!prevApp.durable_objects?.namespace_id) {
      throw new FatalError(
        "The previous deploy of this container application was not associated with a durable object"
      );
    }
    if (prevApp.durable_objects.namespace_id !== args.durable_object_namespace_id) {
      throw new UserError(
        `There is already an application with the name ${containerConfig.name} deployed that is associated with a different durable object namespace (${prevApp.durable_objects.namespace_id}). Either change the container name or delete the existing application first.`,
        {
          telemetryMessage: "trying to redeploy container to different durable object"
        }
      );
    }
    const normalisedPrevApp = sortObjectRecursive(
      stripUndefined(
        cleanApplicationFromAPI(prevApp, containerConfig, accountId)
      )
    );
    const modifyReq = mergeIfUnsafe(
      config,
      createApplicationToModifyApplication(appConfig),
      appConfig.name
    );
    const nowContainer = mergeDeep2(
      normalisedPrevApp,
      sortObjectRecursive(modifyReq)
    );
    const prev = formatConfigSnippet(
      // note this really is a CreateApplicationRequest, not a ContainerApp
      // but this function doesn't actually care about the type
      { containers: [normalisedPrevApp] },
      config.configPath
    );
    const now = formatConfigSnippet(
      { containers: [nowContainer] },
      config.configPath
    );
    const diff = new Diff(prev, now);
    if (diff.changes === 0) {
      updateStatus(`no changes ${brandColor(prevApp.name)}`);
      endSection("No changes to be made");
      return;
    }
    updateStatus(`${brandColor.underline("EDIT")} ${prevApp.name}`, false);
    newline();
    diff.print();
    newline();
    if (containerConfig.rollout_kind !== "none") {
      await doAction({
        action: "modify",
        application: modifyReq,
        id: prevApp.id,
        name: prevApp.name,
        rollout_step_percentage: containerConfig.rollout_step_percentage,
        rollout_kind: containerConfig.rollout_kind == "full_manual" ? CreateApplicationRolloutRequest.kind.FULL_MANUAL : CreateApplicationRolloutRequest.kind.FULL_AUTO
      });
    } else {
      log("Skipping application rollout");
      newline();
    }
  } else {
    updateStatus(bold.underline(green.underline("NEW")) + ` ${appConfig.name}`);
    const configStr = formatConfigSnippet(
      { containers: [appConfig] },
      config.configPath
    );
    configStr.trimEnd().split("\n").forEach((el) => log(`  ${el}`));
    newline();
    await doAction({
      action: "create",
      application: appConfig
    });
  }
  newline();
  endSection("Applied changes");
}
function mergeIfUnsafe(fullConfig, containerConfig, name2) {
  const unsafeContainerConfig = fullConfig.containers?.find((original) => {
    return original.name === name2 && original.unsafe !== void 0;
  });
  if (unsafeContainerConfig) {
    return mergeDeep2(
      containerConfig,
      unsafeContainerConfig.unsafe
    );
  } else {
    return containerConfig;
  }
}
function formatError(err) {
  try {
    const maybeError = JSON.parse(err.body.error);
    if (maybeError.error !== void 0) {
      const message = [];
      message.push(`${maybeError.error}`);
      if (maybeError.details !== void 0 && typeof maybeError.details === "object") {
        for (const key in maybeError.details) {
          message.push(`${brandColor(key)} ${maybeError.details[key]}`);
        }
      }
      return message.join("\n");
    }
  } catch {
  }
  return JSON.stringify(err.body);
}
function cleanApplicationFromAPI(prev, currentConfig, accountId) {
  const cleanedPreviousApp = {
    configuration: {
      ...prev.configuration,
      image: resolveImageName(accountId, prev.configuration.image)
    },
    constraints: prev.constraints,
    max_instances: prev.max_instances,
    name: prev.name,
    scheduling_policy: prev.scheduling_policy,
    affinities: prev.affinities,
    rollout_active_grace_period: prev.rollout_active_grace_period
  };
  if ("instance_type" in currentConfig) {
    const instance_type = inferInstanceType(cleanedPreviousApp.configuration);
    if (!instance_type) {
      return prev;
    }
    cleanedPreviousApp.configuration.instance_type = instance_type;
    delete cleanedPreviousApp.configuration.disk;
    delete cleanedPreviousApp.configuration.memory;
    delete cleanedPreviousApp.configuration.memory_mib;
    delete cleanedPreviousApp.configuration.vcpu;
  }
  return cleanedPreviousApp;
}
var doAction, configRolloutStepsToAPI;
var init_deploy = __esm({
  "src/containers/deploy.ts"() {
    init_import_meta_url();
    init_cli();
    init_colors();
    init_containers_shared();
    init_dist();
    init_cfetch();
    init_common();
    init_instance_type();
    init_build3();
    init_user3();
    init_diff();
    init_sortObjectRecursive();
    init_api();
    init_containers2();
    __name(deployContainers, "deployContainers");
    __name(listDurableObjects, "listDurableObjects");
    __name(mergeDeep2, "mergeDeep");
    __name(isObject, "isObject");
    __name(createApplicationToModifyApplication, "createApplicationToModifyApplication");
    __name(observabilityToConfiguration, "observabilityToConfiguration");
    __name(containerConfigToCreateRequest, "containerConfigToCreateRequest");
    __name(apply, "apply");
    __name(mergeIfUnsafe, "mergeIfUnsafe");
    __name(formatError, "formatError");
    doAction = /* @__PURE__ */ __name(async (action) => {
      if (action.action === "create") {
        let application;
        try {
          application = await promiseSpinner(
            ApplicationsService.createApplication(action.application),
            { message: `Creating "${action.application.name}"` }
          );
        } catch (err) {
          if (!(err instanceof Error)) {
            throw err;
          }
          if (!(err instanceof ApiError)) {
            throw new FatalError(
              `Unexpected error creating application: ${err.message}`
            );
          }
          if (err.status === 400) {
            throw new UserError(
              `Error creating application due to a misconfiguration:
${formatError(err)}`
            );
          }
          throw new UserError(`Error creating application:
${formatError(err)}`);
        }
        success(
          `Created application ${brandColor(action.application.name)} (Application ID: ${application.id})`,
          {
            shape: shapes.bar
          }
        );
      }
      if (action.action === "modify") {
        try {
          await promiseSpinner(
            ApplicationsService.modifyApplication(action.id, action.application),
            { message: `Modifying ${action.application.name}` }
          );
        } catch (err) {
          if (!(err instanceof Error)) {
            throw err;
          }
          if (!(err instanceof ApiError)) {
            throw new UserError(
              `Unexpected error modifying application "${action.name}": ${err.message}`
            );
          }
          if (err.status === 400) {
            throw new UserError(
              `Error modifying application "${action.name}" due to a misconfiguration:

	${formatError(err)}`
            );
          }
          throw new UserError(
            `Error modifying application "${action.name}":
${formatError(err)}`
          );
        }
        try {
          await promiseSpinner(
            RolloutsService.createApplicationRollout(action.id, {
              description: "Progressive update",
              strategy: CreateApplicationRolloutRequest.strategy.ROLLING,
              target_configuration: action.application.configuration ?? {},
              ...configRolloutStepsToAPI(action.rollout_step_percentage),
              kind: action.rollout_kind
            }),
            {
              message: `rolling out container version ${action.name}`
            }
          );
        } catch (err) {
          if (!(err instanceof Error)) {
            throw err;
          }
          if (!(err instanceof ApiError)) {
            throw new UserError(
              `Unexpected error rolling out application "${action.name}":
${err.message}`
            );
          }
          if (err.status === 400) {
            throw new UserError(
              `Error rolling out application "${action.name}" due to a misconfiguration:

	${formatError(err)}`
            );
          }
          throw new UserError(
            `Error rolling out application "${action.name}":
${formatError(err)}`
          );
        }
        success(
          `Modified application ${brandColor(action.name)} (Application ID: ${action.id})`,
          {
            shape: shapes.bar
          }
        );
      }
    }, "doAction");
    __name(cleanApplicationFromAPI, "cleanApplicationFromAPI");
    configRolloutStepsToAPI = /* @__PURE__ */ __name((rolloutSteps) => {
      if (typeof rolloutSteps === "number") {
        return { step_percentage: rolloutSteps };
      } else {
        const output = [];
        let index = 1;
        for (const step of rolloutSteps) {
          output.push({
            step_size: { percentage: step },
            description: `Step ${index} of ${rolloutSteps.length} - rollout at ${step}% of instances`
          });
          index++;
        }
        return { steps: output };
      }
    }, "configRolloutStepsToAPI");
  }
});

// src/containers/registries.ts
async function registryConfigureCommand(configureArgs, config) {
  startSection("Configure a container registry");
  const registryType = getAndValidateRegistryType(configureArgs.DOMAIN);
  if (registryType.type === "cloudflare") {
    log(
      "You do not need to configure credentials for Cloudflare managed registries.\n"
    );
    endSection("No configuration required");
    return;
  }
  const publicCredential = configureArgs.awsAccessKeyId ?? configureArgs.dockerhubUsername ?? configureArgs.publicCredential;
  if (!publicCredential) {
    const arg = registryType.type === "DockerHub" /* DOCKER_HUB */ ? "dockerhub-username" : registryType.type === "ECR" /* ECR */ ? "aws-access-key-id" : "public-credential";
    throw new UserError(`Missing required argument: ${arg}`);
  }
  log(`Configuring ${registryType.name} registry: ${configureArgs.DOMAIN}
`);
  const isFedRAMPHigh = getCloudflareComplianceRegion(config) === "fedramp_high";
  if (isFedRAMPHigh) {
    if (!configureArgs.disableSecretsStore) {
      throw new UserError(
        "Secrets Store is not supported in FedRAMP compliance regions. You must set --disable-secrets-store."
      );
    }
  } else {
    if (configureArgs.disableSecretsStore) {
      throw new UserError(
        "Secrets Store can only be disabled in FedRAMP compliance regions."
      );
    }
  }
  let secretStoreId = configureArgs.secretStoreId;
  let secretName = configureArgs.secretName;
  if (configureArgs.secretName) {
    validateSecretName(configureArgs.secretName);
  }
  log(`Getting ${registryType.secretType}...
`);
  const privateCredential = await promptForRegistryPrivateCredential(
    registryType.secretType
  );
  let private_credential;
  if (!isFedRAMPHigh) {
    log("\nSetting up integration with Secrets Store...\n");
    const accountId = await getAccountId(config);
    if (!secretStoreId) {
      const stores = await listStores(config, accountId);
      if (stores.length === 0) {
        const defaultStoreName = "default_secret_store";
        if (!configureArgs.skipConfirmation) {
          const yes = await confirm(
            `No existing Secret Stores found. Create a Secret Store to store your registry credentials?`
          );
          if (!yes) {
            endSection("Cancelled.");
            return;
          }
        }
        const res = await promiseSpinner(
          createStore(config, accountId, { name: defaultStoreName })
        );
        log(`New Secret Store ${defaultStoreName} created with id: ${res.id}`);
        secretStoreId = res.id;
      } else if (stores.length > 1) {
        throw new UserError(
          `Multiple Secret Stores found. Please specify a Secret Store ID using --secret-store-id.`
        );
      } else {
        secretStoreId = stores[0].id;
        log(
          `Using existing Secret Store ${stores[0].name} with id: ${stores[0].id}`
        );
      }
    }
    log("\n");
    secretName = await getOrCreateSecret({
      configureArgs,
      config,
      accountId,
      storeId: secretStoreId,
      privateCredential,
      secretType: registryType.secretType
    });
    private_credential = {
      store_id: secretStoreId,
      secret_name: secretName
    };
  } else {
    private_credential = privateCredential;
  }
  try {
    await promiseSpinner(
      ImageRegistriesService.createImageRegistry({
        domain: configureArgs.DOMAIN,
        is_public: false,
        auth: {
          public_credential: publicCredential,
          private_credential
        },
        kind: registryType.type
      })
    );
  } catch (e10) {
    if (e10 instanceof ApiError) {
      if (e10.status === 409) {
        throw new UserError(
          `A registry with the domain ${configureArgs.DOMAIN} already exists. Use "wrangler containers registries delete ${configureArgs.DOMAIN}" to delete it first if you want to reconfigure it.`
        );
      }
      throw new APIError({
        status: e10.status,
        text: "Error configuring container registry:\n" + formatError(e10)
      });
    } else {
      throw e10;
    }
  }
  endSection("Registry configuration completed");
}
async function promptForSecretName(secretType) {
  while (true) {
    try {
      const res = await prompt(`Secret name:`, {
        defaultValue: `${secretType?.replaceAll(" ", "_")}`
      });
      validateSecretName(res);
      return res;
    } catch (e10) {
      log(e10.message);
      continue;
    }
  }
}
async function getOrCreateSecret(options) {
  let secretName = options.configureArgs.secretName ?? await promptForSecretName(options.secretType);
  while (true) {
    const existingSecretId = await getSecretByName(
      options.config,
      options.accountId,
      options.storeId,
      secretName
    );
    if (!existingSecretId) {
      await promiseSpinner(
        createSecret(options.config, options.accountId, options.storeId, {
          name: secretName,
          value: options.privateCredential,
          scopes: ["containers"],
          comment: `Created by Wrangler: credentials for image registry ${options.configureArgs.DOMAIN}`
        })
      );
      log(
        `Container-scoped secret "${secretName}" created in Secrets Store.
`
      );
      return secretName;
    }
    if (options.configureArgs.skipConfirmation) {
      log(
        `Using existing secret "${secretName}" from secret store with id: ${options.storeId}.
`
      );
      return secretName;
    }
    startSection(
      `The provided secret name "${secretName}" is already in-use within the secret store. (Store ID: ${options.storeId})`
    );
    const reuseExisting = await confirm(
      `Do you want to reuse the existing secret? If not, then you'll be prompted to pick a new name.`
    );
    if (reuseExisting) {
      log(
        `Using existing secret "${secretName}" from secret store with id: ${options.storeId}.
`
      );
      return secretName;
    }
    secretName = await promptForSecretName(options.secretType);
  }
}
async function promptForRegistryPrivateCredential(secretType) {
  if (isNonInteractiveOrCI()) {
    const stdinInput = trimTrailingWhitespace(await readFromStdin());
    if (!stdinInput) {
      throw new UserError(
        `No input provided. In non-interactive mode, please pipe in the ${secretType} secret via stdin.`
      );
    }
    return stdinInput;
  }
  const secret = await prompt(`Enter ${secretType ?? "secret"}:`, {
    isSecret: true
  });
  if (!secret) {
    throw new UserError("Secret cannot be empty.");
  }
  return secret;
}
async function registryListCommand(listArgs2) {
  if (!listArgs2.json && !isNonInteractiveOrCI()) {
    startSection("List configured container registries");
  }
  try {
    const res = await promiseSpinner(
      ImageRegistriesService.listImageRegistries()
    );
    if (listArgs2.json || isNonInteractiveOrCI()) {
      logger.json(res);
    } else if (res.length === 0) {
      endSection("No registries configured for this account");
    } else {
      res.forEach((registry) => {
        updateStatus(registry.domain);
      });
      endSection(`End`);
    }
  } catch (e10) {
    if (e10 instanceof ApiError) {
      throw new APIError({
        status: e10.status,
        text: "Error listing container registries:\n" + formatError(e10)
      });
    } else {
      throw e10;
    }
  }
}
async function registryDeleteCommand(deleteArgs, config) {
  startSection(`Delete registry ${deleteArgs.DOMAIN}`);
  if (!deleteArgs.skipConfirmation) {
    const yes = await confirm(
      `Are you sure you want to delete the registry credentials for ${deleteArgs.DOMAIN}? This action cannot be undone.`
    );
    if (!yes) {
      cancel("The operation has been cancelled");
      return;
    }
  }
  let res;
  try {
    res = await promiseSpinner(
      ImageRegistriesService.deleteImageRegistry(deleteArgs.DOMAIN)
    );
  } catch (e10) {
    if (e10 instanceof ApiError) {
      if (e10.status === 404) {
        throw new UserError(
          `The registry ${deleteArgs.DOMAIN} does not exist.`
        );
      }
      throw new APIError({
        status: e10.status,
        text: `Error deleting container registry:
` + formatError(e10)
      });
    } else {
      throw e10;
    }
  }
  endSection(`Deleted registry ${deleteArgs.DOMAIN}
`);
  if (res.secrets_store_ref) {
    const [storeId, secretName] = res.secrets_store_ref.split(":");
    startSection("Warning: A dangling secret was left behind.");
    if (!deleteArgs.skipConfirmation) {
      const yes = await confirm(
        `Do you want to delete the secret "${secretName}"? (Store ID: ${storeId})`
      );
      if (!yes) {
        endSection("The secret was not deleted.");
        return;
      }
    }
    const accountId = await getAccountId(config);
    try {
      const secretId = await promiseSpinner(
        getSecretByName(config, accountId, storeId, secretName)
      );
      if (!secretId) {
        endSection(
          `Secret "${secretName}" not found in store. It may have already been deleted.`
        );
        return;
      }
      await promiseSpinner(deleteSecret(config, accountId, storeId, secretId));
    } catch (e10) {
      if (e10 instanceof ApiError) {
        throw new APIError({
          status: e10.status,
          text: `Error deleting secret:
` + formatError(e10)
        });
      } else {
        throw e10;
      }
    }
    endSection(`Deleted secret ${res.secrets_store_ref}`);
  }
}
async function registryCredentialsCommand(credentialsArgs) {
  const cloudflareRegistry = getCloudflareContainerRegistry();
  const domain2 = credentialsArgs.DOMAIN || cloudflareRegistry;
  if (domain2 !== cloudflareRegistry) {
    throw new UserError(
      `The credentials command only accepts the Cloudflare managed registry (${cloudflareRegistry}).`
    );
  }
  if (!credentialsArgs.pull && !credentialsArgs.push && !credentialsArgs.libraryPush) {
    throw new UserError(
      "You have to specify either --push or --pull in the command."
    );
  }
  const credentials = await ImageRegistriesService.generateImageRegistryCredentials(domain2, {
    expiration_minutes: credentialsArgs.expirationMinutes,
    permissions: [
      ...credentialsArgs.push ? ["push"] : [],
      ...credentialsArgs.pull ? ["pull"] : [],
      ...credentialsArgs.libraryPush ? ["library_push"] : []
    ]
  });
  if (credentialsArgs.json) {
    logger.json(credentials);
  } else {
    logger.log(credentials.password);
  }
}
var registryConfigureArgs, registryListArgs, registryDeleteArgs, containersRegistriesNamespace, containersRegistriesConfigureCommand, containersRegistriesListCommand, containersRegistriesDeleteCommand, containersRegistriesCredentialsCommand;
var init_registries = __esm({
  "src/containers/registries.ts"() {
    init_import_meta_url();
    init_cli();
    init_containers_shared();
    init_dist();
    init_common();
    init_create_command();
    init_dialogs();
    init_is_interactive();
    init_logger();
    init_client2();
    init_commands2();
    init_user3();
    init_std();
    init_deploy();
    init_containers2();
    registryConfigureArgs = {
      DOMAIN: {
        describe: "Domain to configure for the registry",
        type: "string",
        demandOption: true
      },
      "public-credential": {
        type: "string",
        demandOption: false,
        hidden: true,
        deprecated: true,
        conflicts: ["dockerhub-username", "aws-access-key-id"]
      },
      "aws-access-key-id": {
        type: "string",
        description: "When configuring Amazon ECR, `AWS_ACCESS_KEY_ID`",
        demandOption: false,
        conflicts: ["public-credential", "dockerhub-username"]
      },
      "dockerhub-username": {
        type: "string",
        description: "When configuring DockerHub, the DockerHub username",
        demandOption: false,
        conflicts: ["public-credential", "aws-access-key-id"]
      },
      "secret-store-id": {
        type: "string",
        description: "The ID of the secret store to use to store the registry credentials.",
        demandOption: false,
        conflicts: "disable-secrets-store"
      },
      "secret-name": {
        type: "string",
        description: "The name for the secret the private registry credentials should be stored under.",
        demandOption: false,
        conflicts: "disable-secrets-store"
      },
      "disable-secrets-store": {
        type: "boolean",
        description: "Whether to disable secrets store integration. This should be set iff the compliance region is FedRAMP High.",
        demandOption: false,
        conflicts: ["secret-store-id", "secret-name"]
      },
      "skip-confirmation": {
        type: "boolean",
        description: "Skip confirmation prompts",
        alias: "y",
        default: false
      }
    };
    __name(registryConfigureCommand, "registryConfigureCommand");
    __name(promptForSecretName, "promptForSecretName");
    __name(getOrCreateSecret, "getOrCreateSecret");
    __name(promptForRegistryPrivateCredential, "promptForRegistryPrivateCredential");
    registryListArgs = {
      json: {
        type: "boolean",
        description: "Format output as JSON",
        default: false
      }
    };
    __name(registryListCommand, "registryListCommand");
    registryDeleteArgs = {
      DOMAIN: {
        describe: "Domain of the registry to delete",
        type: "string",
        demandOption: true
      },
      "skip-confirmation": {
        type: "boolean",
        description: "Skip confirmation prompts for registry and secret deletion",
        alias: "y",
        default: false
      }
    };
    __name(registryDeleteCommand, "registryDeleteCommand");
    __name(registryCredentialsCommand, "registryCredentialsCommand");
    containersRegistriesNamespace = createNamespace({
      metadata: {
        description: "Configure and manage non-Cloudflare registries",
        status: "open beta",
        owner: "Product: Cloudchamber"
      }
    });
    containersRegistriesConfigureCommand = createCommand({
      metadata: {
        description: "Configure credentials for a non-Cloudflare container registry",
        status: "open beta",
        owner: "Product: Cloudchamber"
      },
      args: registryConfigureArgs,
      positionalArgs: ["DOMAIN"],
      validateArgs(args) {
        if (args.skipConfirmation && !args.secretName && !args.disableSecretsStore) {
          throw new UserError(
            "--secret-name is required when using --skip-confirmation"
          );
        }
      },
      async handler(args, { config }) {
        await fillOpenAPIConfiguration(config, containersScope);
        await registryConfigureCommand(args, config);
      }
    });
    containersRegistriesListCommand = createCommand({
      metadata: {
        description: "List all configured container registries",
        status: "open beta",
        owner: "Product: Cloudchamber"
      },
      behaviour: {
        printBanner: /* @__PURE__ */ __name((args) => !args.json && !isNonInteractiveOrCI(), "printBanner")
      },
      args: registryListArgs,
      async handler(args, { config }) {
        await fillOpenAPIConfiguration(config, containersScope);
        await registryListCommand(args);
      }
    });
    containersRegistriesDeleteCommand = createCommand({
      metadata: {
        description: "Delete a configured container registry",
        status: "open beta",
        owner: "Product: Cloudchamber"
      },
      args: registryDeleteArgs,
      positionalArgs: ["DOMAIN"],
      async handler(args, { config }) {
        await fillOpenAPIConfiguration(config, containersScope);
        await registryDeleteCommand(args, config);
      }
    });
    containersRegistriesCredentialsCommand = createCommand({
      metadata: {
        description: "Get a temporary password for a specific domain",
        status: "open beta",
        owner: "Product: Cloudchamber"
      },
      behaviour: {
        printBanner: /* @__PURE__ */ __name((args) => !args.json && !isNonInteractiveOrCI(), "printBanner")
      },
      args: {
        DOMAIN: {
          type: "string",
          describe: "Domain to get credentials for"
        },
        "expiration-minutes": {
          type: "number",
          default: 15,
          description: "How long the credentials should be valid for (in minutes)"
        },
        push: {
          type: "boolean",
          description: "If you want these credentials to be able to push"
        },
        pull: {
          type: "boolean",
          description: "If you want these credentials to be able to pull"
        },
        "library-push": {
          type: "boolean",
          description: "If you want these credentials to be able to push to the public library namespace",
          hidden: true
        },
        json: {
          type: "boolean",
          description: "Format output as JSON",
          default: false
        }
      },
      positionalArgs: ["DOMAIN"],
      async handler(args, { config }) {
        await fillOpenAPIConfiguration(config, containersScope);
        await registryCredentialsCommand(args);
      }
    });
  }
});

// src/containers/images.ts
async function handleDeleteImageCommand(args, config) {
  if (!args.image.includes(":")) {
    throw new Error("Invalid image format. Expected IMAGE:TAG");
  }
  const digest = await promiseSpinner(
    getCreds().then(async (creds) => {
      const accountId = await getAccountId(config);
      const url4 = new URL(`https://${getCloudflareContainerRegistry()}`);
      const baseUrl = `${url4.protocol}//${url4.host}`;
      const [image, tag] = args.image.split(":");
      const digest_ = await deleteTag(baseUrl, accountId, image, tag, creds);
      const gcUrl = `${baseUrl}/v2/gc/layers`;
      const gcResponse = await (0, import_undici5.fetch)(gcUrl, {
        method: "PUT",
        headers: {
          Authorization: `Basic ${creds}`,
          "Content-Type": "application/json"
        }
      });
      if (!gcResponse.ok) {
        throw new Error(
          `Failed to delete image ${args.image}: ${gcResponse.status} ${gcResponse.statusText}`
        );
      }
      return digest_;
    }),
    { message: `Deleting ${args.image}` }
  );
  logger.log(`Deleted ${args.image} (${digest})`);
}
async function handleListImagesCommand(args, config) {
  const responses = await promiseSpinner(
    getCreds().then(async (creds) => {
      const repos = await listReposWithTags(creds);
      const processed = [];
      const accountId = await getAccountId(config);
      const accountIdPrefix = new RegExp(`^${accountId}/`);
      const filter2 = new RegExp(args.filter ?? "");
      for (const [repo, tags] of Object.entries(repos)) {
        const stripped = repo.replace(/^\/+/, "");
        if (filter2.test(stripped)) {
          const name2 = stripped.replace(accountIdPrefix, "");
          processed.push({ name: name2, tags });
        }
      }
      return processed;
    }),
    { message: "Listing" }
  );
  await listImages(responses, false, args.json);
}
async function listImages(responses, digests = false, json = false) {
  if (!digests) {
    responses = responses.map((resp) => {
      return {
        name: resp.name,
        tags: resp.tags.filter((t13) => !t13.startsWith("sha256"))
      };
    });
  }
  responses = responses.filter((resp) => {
    return resp.tags !== void 0 && resp.tags.length != 0;
  });
  if (json) {
    logger.log(JSON.stringify(responses, null, 2));
  } else {
    const rows = responses.flatMap((r10) => r10.tags.map((t13) => [r10.name, t13]));
    const headers = ["REPOSITORY", "TAG"];
    const widths = new Array(headers.length).fill(0);
    for (let i7 = 0; i7 < widths.length - 1; i7++) {
      widths[i7] = rows.map((r10) => r10[i7].length).reduce((a7, b11) => Math.max(a7, b11), headers[i7].length);
    }
    logger.log(headers.map((h7, i7) => h7.padEnd(widths[i7], " ")).join("  "));
    for (const row of rows) {
      logger.log(row.map((v8, i7) => v8.padEnd(widths[i7], " ")).join("  "));
    }
  }
}
async function listReposWithTags(creds) {
  const url4 = new URL(`https://${getCloudflareContainerRegistry()}`);
  const catalogUrl = `${url4.protocol}//${url4.host}/v2/_catalog?tags=true`;
  const response = await (0, import_undici5.fetch)(catalogUrl, {
    method: "GET",
    headers: {
      Authorization: `Basic ${creds}`
    }
  });
  if (!response.ok) {
    logger.log(JSON.stringify(response));
    throw new Error(
      `Failed to fetch repository catalog: ${response.status} ${response.statusText}`
    );
  }
  const data = await response.json();
  return data.repositories ?? {};
}
async function deleteTag(baseUrl, accountId, image, tag, creds) {
  const manifestAcceptHeader = "application/vnd.oci.image.manifest.v1+json, application/vnd.docker.distribution.manifest.v2+json";
  const manifestUrl = `${baseUrl}/v2/${accountId}/${image}/manifests/${tag}`;
  const headResponse = await (0, import_undici5.fetch)(manifestUrl, {
    method: "HEAD",
    headers: {
      Authorization: `Basic ${creds}`,
      Accept: manifestAcceptHeader
    }
  });
  if (!headResponse.ok) {
    throw new Error(
      `Failed to retrieve info for ${image}:${tag}: ${headResponse.status} ${headResponse.statusText}`
    );
  }
  const digest = headResponse.headers.get("Docker-Content-Digest");
  if (!digest) {
    throw new Error(`Digest not found for ${image}:${tag}.`);
  }
  const deleteUrl = `${baseUrl}/v2/${accountId}/${image}/manifests/${tag}`;
  const deleteResponse = await (0, import_undici5.fetch)(deleteUrl, {
    method: "DELETE",
    headers: {
      Authorization: `Basic ${creds}`,
      Accept: manifestAcceptHeader
    }
  });
  if (!deleteResponse.ok) {
    throw new Error(
      `Failed to delete ${image}:${tag} (digest: ${digest}): ${deleteResponse.status} ${deleteResponse.statusText}`
    );
  }
  return digest;
}
async function getCreds() {
  const credentials = await ImageRegistriesService.generateImageRegistryCredentials(
    getCloudflareContainerRegistry(),
    {
      expiration_minutes: 5,
      permissions: ["pull", "push"]
    }
  );
  return Buffer.from(`v1:${credentials.password}`).toString("base64");
}
var import_undici5, containersImagesNamespace, containersImagesListCommand, containersImagesDeleteCommand;
var init_images3 = __esm({
  "src/containers/images.ts"() {
    init_import_meta_url();
    init_containers_shared();
    import_undici5 = __toESM(require_undici());
    init_common();
    init_create_command();
    init_is_interactive();
    init_logger();
    init_user3();
    init_containers2();
    containersImagesNamespace = createNamespace({
      metadata: {
        description: "Manage images in the Cloudflare managed registry",
        status: "open beta",
        owner: "Product: Cloudchamber"
      }
    });
    containersImagesListCommand = createCommand({
      metadata: {
        description: "List images in the Cloudflare managed registry",
        status: "open beta",
        owner: "Product: Cloudchamber"
      },
      behaviour: {
        printBanner: /* @__PURE__ */ __name((args) => !args.json && !isNonInteractiveOrCI(), "printBanner")
      },
      args: {
        filter: {
          type: "string",
          description: "Regex to filter results"
        },
        json: {
          type: "boolean",
          description: "Format output as JSON",
          default: false
        }
      },
      async handler(args, { config }) {
        await fillOpenAPIConfiguration(config, containersScope);
        await handleListImagesCommand(args, config);
      }
    });
    containersImagesDeleteCommand = createCommand({
      metadata: {
        description: "Remove an image from the Cloudflare managed registry",
        status: "open beta",
        owner: "Product: Cloudchamber"
      },
      behaviour: {
        printBanner: /* @__PURE__ */ __name(() => !isNonInteractiveOrCI(), "printBanner")
      },
      args: {
        image: {
          type: "string",
          description: "Image and tag to delete, of the form IMAGE:TAG",
          demandOption: true
        }
      },
      positionalArgs: ["image"],
      async handler(args, { config }) {
        await fillOpenAPIConfiguration(config, containersScope);
        await handleDeleteImageCommand(args, config);
      }
    });
    __name(handleDeleteImageCommand, "handleDeleteImageCommand");
    __name(handleListImagesCommand, "handleListImagesCommand");
    __name(listImages, "listImages");
    __name(listReposWithTags, "listReposWithTags");
    __name(deleteTag, "deleteTag");
    __name(getCreds, "getCreds");
  }
});

// src/containers/index.ts
var containersScope, containersNamespace;
var init_containers2 = __esm({
  "src/containers/index.ts"() {
    init_import_meta_url();
    init_create_command();
    init_list();
    init_containers();
    init_instances2();
    init_ssh();
    init_registries();
    init_build3();
    init_images3();
    containersScope = "containers:write";
    containersNamespace = createNamespace({
      metadata: {
        description: "\u{1F4E6} Manage Containers",
        status: "open beta",
        owner: "Product: Cloudchamber"
      }
    });
  }
});

// src/containers/build.ts
async function buildContainer(containerConfig, imageTag, dryRun, pathToDocker) {
  const imageFullName = containerConfig.name + ":" + imageTag.split("-")[0];
  logger.log("Building image", imageFullName);
  return await buildAndMaybePush(
    {
      tag: imageFullName,
      pathToDockerfile: containerConfig.dockerfile,
      buildContext: containerConfig.image_build_context,
      args: containerConfig.image_vars
    },
    pathToDocker,
    !dryRun,
    containerConfig
  );
}
var containersBuildCommand, containersPushCommand;
var init_build3 = __esm({
  "src/containers/build.ts"() {
    init_import_meta_url();
    init_build2();
    init_common();
    init_create_command();
    init_logger();
    init_containers2();
    containersBuildCommand = createCommand({
      metadata: {
        description: "Build a container image",
        status: "open beta",
        owner: "Product: Cloudchamber"
      },
      args: {
        PATH: {
          type: "string",
          describe: "Path for the directory containing the Dockerfile to build",
          demandOption: true
        },
        tag: {
          alias: "t",
          type: "string",
          demandOption: true,
          describe: 'Name and optionally a tag (format: "name:tag")'
        },
        "path-to-docker": {
          type: "string",
          default: "docker",
          describe: "Path to your docker binary if it's not on $PATH",
          demandOption: false
        },
        push: {
          alias: "p",
          type: "boolean",
          describe: "Push the built image to Cloudflare's managed registry",
          default: false
        },
        platform: {
          type: "string",
          default: "linux/amd64",
          describe: "Platform to build for. Defaults to the architecture support by Workers (linux/amd64)",
          demandOption: false,
          hidden: true,
          deprecated: true
        }
      },
      positionalArgs: ["PATH"],
      async handler(args, { config }) {
        await fillOpenAPIConfiguration(config, containersScope);
        await buildCommand(args);
      }
    });
    containersPushCommand = createCommand({
      metadata: {
        description: "Push a local image to the Cloudflare managed registry",
        status: "open beta",
        owner: "Product: Cloudchamber"
      },
      args: {
        TAG: {
          type: "string",
          demandOption: true,
          describe: "The tag of the local image to push"
        },
        "path-to-docker": {
          type: "string",
          default: "docker",
          describe: "Path to your docker binary if it's not on $PATH",
          demandOption: false
        }
      },
      positionalArgs: ["TAG"],
      async handler(args, { config }) {
        await fillOpenAPIConfiguration(config, containersScope);
        await pushCommand(args, config);
      }
    });
    __name(buildContainer, "buildContainer");
  }
});
function convertContainerAffinitiesForApi(container) {
  if (container.affinities === void 0) {
    return void 0;
  }
  const affinities = {
    colocation: container.affinities?.colocation,
    hardware_generation: container.affinities?.hardware_generation
  };
  return affinities;
}
var getNormalizedContainerOptions;
var init_config5 = __esm({
  "src/containers/config.ts"() {
    init_import_meta_url();
    init_containers_shared();
    init_dist();
    init_class_names_sqlite();
    init_user3();
    __name(convertContainerAffinitiesForApi, "convertContainerAffinitiesForApi");
    getNormalizedContainerOptions = /* @__PURE__ */ __name(async (config, args) => {
      if (!config.containers || config.containers.length === 0) {
        return [];
      }
      const normalizedContainers = [];
      for (const container of config.containers) {
        assert53__default.default(container.name, "container name should have been set by validation");
        const allDOs = getDurableObjectClassNameToUseSQLiteMap(config.migrations);
        if (!allDOs.has(container.class_name) && config.durable_objects.bindings.find(
          (doBinding) => doBinding.class_name === container.class_name
        ) === void 0) {
          throw new UserError(
            `The container class_name ${container.class_name} does not match any durable object class_name defined in your Wrangler config file. Note that the durable object must be defined in the same script as the container.`,
            { telemetryMessage: "no DO defined that matches container class_name" }
          );
        }
        const maybeBoundDO = config.durable_objects.bindings.find(
          (durableObject) => durableObject.class_name === container.class_name
        );
        if (maybeBoundDO && maybeBoundDO.script_name !== void 0) {
          throw new UserError(
            `The container ${container.name} is referencing the durable object ${container.class_name}, which appears to be defined on the ${maybeBoundDO.script_name} Worker instead (via the 'script_name' field). You cannot configure a container on a Durable Object that is defined in another Worker.`,
            {
              telemetryMessage: "contaienr class_name refers to an external durable object"
            }
          );
        }
        const rolloutStepPercentageFallback = (container.max_instances ?? 0) < 2 ? 100 : [10, 100];
        let tiers;
        if (container.constraints?.tiers) {
          tiers = container.constraints.tiers;
        } else if (container.constraints?.tier === -1) {
          tiers = void 0;
        } else if (container.constraints?.tier) {
          tiers = [container.constraints.tier];
        } else {
          tiers = [1, 2];
        }
        const shared = {
          name: container.name,
          class_name: container.class_name,
          max_instances: container.max_instances ?? 20,
          scheduling_policy: container.scheduling_policy ?? "default" /* DEFAULT */,
          constraints: {
            tiers,
            regions: container.constraints?.regions?.map(
              (region) => region.toUpperCase()
            ),
            cities: container.constraints?.cities?.map(
              (city) => city.toLowerCase()
            )
          },
          affinities: convertContainerAffinitiesForApi(container),
          rollout_step_percentage: args?.containersRollout === "immediate" ? 100 : container.rollout_step_percentage ?? rolloutStepPercentageFallback,
          rollout_kind: container.rollout_kind ?? "full_auto",
          rollout_active_grace_period: container.rollout_active_grace_period ?? 0,
          observability: {
            logs_enabled: config.observability?.logs?.enabled ?? config.observability?.enabled === true
          },
          wrangler_ssh: container.wrangler_ssh,
          authorized_keys: container.authorized_keys,
          trusted_user_ca_keys: container.trusted_user_ca_keys
        };
        let instanceTypeOrLimits;
        const MB2 = 1e3 * 1e3;
        if (container.configuration?.disk !== void 0 || container.configuration?.vcpu !== void 0 || container.configuration?.memory_mib !== void 0) {
          instanceTypeOrLimits = {
            disk_bytes: (container.configuration?.disk?.size_mb ?? 2e3) * MB2,
            // defaults to 2GB in bytes
            vcpu: container.configuration?.vcpu ?? 0.0625,
            memory_mib: container.configuration?.memory_mib ?? 256
          };
        } else if (typeof container.instance_type === "string" || container.instance_type === void 0) {
          instanceTypeOrLimits = {
            instance_type: container.instance_type ?? "lite" /* LITE */
          };
        } else {
          instanceTypeOrLimits = {
            disk_bytes: (container.instance_type.disk_mb ?? 2e3) * MB2,
            vcpu: container.instance_type.vcpu ?? 0.0625,
            memory_mib: container.instance_type.memory_mib ?? 256
          };
        }
        const maybeDockerfile = isDockerfile(container.image, config.configPath);
        if (maybeDockerfile) {
          assert53__default.default(
            path3__namespace.default.isAbsolute(container.image),
            "Dockerfile path should be absolute"
          );
          const imageBuildContext = container.image_build_context ?? path3.dirname(container.image);
          assert53__default.default(
            path3__namespace.default.isAbsolute(imageBuildContext),
            "resolved image_build_context should be defined"
          );
          normalizedContainers.push({
            ...shared,
            ...instanceTypeOrLimits,
            dockerfile: container.image,
            image_build_context: imageBuildContext,
            image_vars: container.image_vars
          });
        } else {
          normalizedContainers.push({
            ...shared,
            ...instanceTypeOrLimits,
            image_uri: args.dryRun ? container.image : resolveImageName(await getAccountId(config), container.image)
            // if it is not a dockerfile, it must be an image uri or have thrown an error
          });
        }
      }
      return normalizedContainers;
    }, "getNormalizedContainerOptions");
  }
});

// ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/typings/common-types.js
function assertNotStrictEqual(actual, expected, shim3, message) {
  shim3.assert.notStrictEqual(actual, expected, message);
}
function assertSingleKey(actual, shim3) {
  shim3.assert.strictEqual(typeof actual, "string");
}
function objectKeys(object) {
  return Object.keys(object);
}
var init_common_types = __esm({
  "../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/typings/common-types.js"() {
    init_import_meta_url();
    __name(assertNotStrictEqual, "assertNotStrictEqual");
    __name(assertSingleKey, "assertSingleKey");
    __name(objectKeys, "objectKeys");
  }
});

// ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/utils/is-promise.js
function isPromise(maybePromise) {
  return !!maybePromise && !!maybePromise.then && typeof maybePromise.then === "function";
}
var init_is_promise = __esm({
  "../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/utils/is-promise.js"() {
    init_import_meta_url();
    __name(isPromise, "isPromise");
  }
});

// ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/parse-command.js
function parseCommand2(cmd) {
  const extraSpacesStrippedCommand = cmd.replace(/\s{2,}/g, " ");
  const splitCommand = extraSpacesStrippedCommand.split(/\s+(?![^[]*]|[^<]*>)/);
  const bregex = /\.*[\][<>]/g;
  const firstCommand = splitCommand.shift();
  if (!firstCommand)
    throw new Error(`No command found in: ${cmd}`);
  const parsedCommand = {
    cmd: firstCommand.replace(bregex, ""),
    demanded: [],
    optional: []
  };
  splitCommand.forEach((cmd2, i7) => {
    let variadic = false;
    cmd2 = cmd2.replace(/\s/g, "");
    if (/\.+[\]>]/.test(cmd2) && i7 === splitCommand.length - 1)
      variadic = true;
    if (/^\[/.test(cmd2)) {
      parsedCommand.optional.push({
        cmd: cmd2.replace(bregex, "").split("|"),
        variadic
      });
    } else {
      parsedCommand.demanded.push({
        cmd: cmd2.replace(bregex, "").split("|"),
        variadic
      });
    }
  });
  return parsedCommand;
}
var init_parse_command = __esm({
  "../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/parse-command.js"() {
    init_import_meta_url();
    __name(parseCommand2, "parseCommand");
  }
});

// ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/argsert.js
function argsert(arg1, arg2, arg3) {
  function parseArgs() {
    return typeof arg1 === "object" ? [{ demanded: [], optional: [] }, arg1, arg2] : [
      parseCommand2(`cmd ${arg1}`),
      arg2,
      arg3
    ];
  }
  __name(parseArgs, "parseArgs");
  try {
    let position = 0;
    const [parsed, callerArguments, _length] = parseArgs();
    const args = [].slice.call(callerArguments);
    while (args.length && args[args.length - 1] === void 0)
      args.pop();
    const length = _length || args.length;
    if (length < parsed.demanded.length) {
      throw new YError(`Not enough arguments provided. Expected ${parsed.demanded.length} but received ${args.length}.`);
    }
    const totalCommands = parsed.demanded.length + parsed.optional.length;
    if (length > totalCommands) {
      throw new YError(`Too many arguments provided. Expected max ${totalCommands} but received ${length}.`);
    }
    parsed.demanded.forEach((demanded) => {
      const arg = args.shift();
      const observedType = guessType(arg);
      const matchingTypes = demanded.cmd.filter((type) => type === observedType || type === "*");
      if (matchingTypes.length === 0)
        argumentTypeError(observedType, demanded.cmd, position);
      position += 1;
    });
    parsed.optional.forEach((optional) => {
      if (args.length === 0)
        return;
      const arg = args.shift();
      const observedType = guessType(arg);
      const matchingTypes = optional.cmd.filter((type) => type === observedType || type === "*");
      if (matchingTypes.length === 0)
        argumentTypeError(observedType, optional.cmd, position);
      position += 1;
    });
  } catch (err) {
    console.warn(err.stack);
  }
}
function guessType(arg) {
  if (Array.isArray(arg)) {
    return "array";
  } else if (arg === null) {
    return "null";
  }
  return typeof arg;
}
function argumentTypeError(observedType, allowedTypes, position) {
  throw new YError(`Invalid ${positionName[position] || "manyith"} argument. Expected ${allowedTypes.join(" or ")} but received ${observedType}.`);
}
var positionName;
var init_argsert = __esm({
  "../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/argsert.js"() {
    init_import_meta_url();
    init_yerror();
    init_parse_command();
    positionName = ["first", "second", "third", "fourth", "fifth", "sixth"];
    __name(argsert, "argsert");
    __name(guessType, "guessType");
    __name(argumentTypeError, "argumentTypeError");
  }
});

// ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/middleware.js
function commandMiddlewareFactory(commandMiddleware) {
  if (!commandMiddleware)
    return [];
  return commandMiddleware.map((middleware) => {
    middleware.applyBeforeValidation = false;
    return middleware;
  });
}
function applyMiddleware(argv, yargs, middlewares, beforeValidation) {
  return middlewares.reduce((acc, middleware) => {
    if (middleware.applyBeforeValidation !== beforeValidation) {
      return acc;
    }
    if (middleware.mutates) {
      if (middleware.applied)
        return acc;
      middleware.applied = true;
    }
    if (isPromise(acc)) {
      return acc.then((initialObj) => Promise.all([initialObj, middleware(initialObj, yargs)])).then(([initialObj, middlewareObj]) => Object.assign(initialObj, middlewareObj));
    } else {
      const result = middleware(acc, yargs);
      return isPromise(result) ? result.then((middlewareObj) => Object.assign(acc, middlewareObj)) : Object.assign(acc, result);
    }
  }, argv);
}
var GlobalMiddleware;
var init_middleware = __esm({
  "../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/middleware.js"() {
    init_import_meta_url();
    init_argsert();
    init_is_promise();
    GlobalMiddleware = class {
      static {
        __name(this, "GlobalMiddleware");
      }
      constructor(yargs) {
        this.globalMiddleware = [];
        this.frozens = [];
        this.yargs = yargs;
      }
      addMiddleware(callback, applyBeforeValidation, global2 = true, mutates = false) {
        argsert("<array|function> [boolean] [boolean] [boolean]", [callback, applyBeforeValidation, global2], arguments.length);
        if (Array.isArray(callback)) {
          for (let i7 = 0; i7 < callback.length; i7++) {
            if (typeof callback[i7] !== "function") {
              throw Error("middleware must be a function");
            }
            const m7 = callback[i7];
            m7.applyBeforeValidation = applyBeforeValidation;
            m7.global = global2;
          }
          Array.prototype.push.apply(this.globalMiddleware, callback);
        } else if (typeof callback === "function") {
          const m7 = callback;
          m7.applyBeforeValidation = applyBeforeValidation;
          m7.global = global2;
          m7.mutates = mutates;
          this.globalMiddleware.push(callback);
        }
        return this.yargs;
      }
      addCoerceMiddleware(callback, option) {
        const aliases2 = this.yargs.getAliases();
        this.globalMiddleware = this.globalMiddleware.filter((m7) => {
          const toCheck = [...aliases2[option] || [], option];
          if (!m7.option)
            return true;
          else
            return !toCheck.includes(m7.option);
        });
        callback.option = option;
        return this.addMiddleware(callback, true, true, true);
      }
      getMiddleware() {
        return this.globalMiddleware;
      }
      freeze() {
        this.frozens.push([...this.globalMiddleware]);
      }
      unfreeze() {
        const frozen = this.frozens.pop();
        if (frozen !== void 0)
          this.globalMiddleware = frozen;
      }
      reset() {
        this.globalMiddleware = this.globalMiddleware.filter((m7) => m7.global);
      }
    };
    __name(commandMiddlewareFactory, "commandMiddlewareFactory");
    __name(applyMiddleware, "applyMiddleware");
  }
});

// ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/utils/maybe-async-result.js
function maybeAsyncResult(getResult, resultHandler, errorHandler = (err) => {
  throw err;
}) {
  try {
    const result = isFunction3(getResult) ? getResult() : getResult;
    return isPromise(result) ? result.then((result2) => resultHandler(result2)) : resultHandler(result);
  } catch (err) {
    return errorHandler(err);
  }
}
function isFunction3(arg) {
  return typeof arg === "function";
}
var init_maybe_async_result = __esm({
  "../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/utils/maybe-async-result.js"() {
    init_import_meta_url();
    init_is_promise();
    __name(maybeAsyncResult, "maybeAsyncResult");
    __name(isFunction3, "isFunction");
  }
});

// ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/utils/which-module.js
function whichModule(exported) {
  if (typeof __require === "undefined")
    return null;
  for (let i7 = 0, files = Object.keys(__require.cache), mod; i7 < files.length; i7++) {
    mod = __require.cache[files[i7]];
    if (mod.exports === exported)
      return mod;
  }
  return null;
}
var init_which_module = __esm({
  "../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/utils/which-module.js"() {
    init_import_meta_url();
    __name(whichModule, "whichModule");
  }
});

// ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/command.js
function command(usage2, validation2, globalMiddleware, shim3) {
  return new CommandInstance(usage2, validation2, globalMiddleware, shim3);
}
function isCommandBuilderDefinition(builder) {
  return typeof builder === "object" && !!builder.builder && typeof builder.handler === "function";
}
function isCommandAndAliases(cmd) {
  return cmd.every((c8) => typeof c8 === "string");
}
function isCommandBuilderCallback(builder) {
  return typeof builder === "function";
}
function isCommandBuilderOptionDefinitions(builder) {
  return typeof builder === "object";
}
function isCommandHandlerDefinition(cmd) {
  return typeof cmd === "object" && !Array.isArray(cmd);
}
var DEFAULT_MARKER, CommandInstance;
var init_command2 = __esm({
  "../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/command.js"() {
    init_import_meta_url();
    init_common_types();
    init_is_promise();
    init_middleware();
    init_parse_command();
    init_yargs_factory();
    init_maybe_async_result();
    init_which_module();
    DEFAULT_MARKER = /(^\*)|(^\$0)/;
    CommandInstance = class {
      static {
        __name(this, "CommandInstance");
      }
      constructor(usage2, validation2, globalMiddleware, shim3) {
        this.requireCache = /* @__PURE__ */ new Set();
        this.handlers = {};
        this.aliasMap = {};
        this.frozens = [];
        this.shim = shim3;
        this.usage = usage2;
        this.globalMiddleware = globalMiddleware;
        this.validation = validation2;
      }
      addDirectory(dir2, req, callerFile, opts) {
        opts = opts || {};
        if (typeof opts.recurse !== "boolean")
          opts.recurse = false;
        if (!Array.isArray(opts.extensions))
          opts.extensions = ["js"];
        const parentVisit = typeof opts.visit === "function" ? opts.visit : (o7) => o7;
        opts.visit = (obj, joined, filename) => {
          const visited = parentVisit(obj, joined, filename);
          if (visited) {
            if (this.requireCache.has(joined))
              return visited;
            else
              this.requireCache.add(joined);
            this.addHandler(visited);
          }
          return visited;
        };
        this.shim.requireDirectory({ require: req, filename: callerFile }, dir2, opts);
      }
      addHandler(cmd, description, builder, handler, commandMiddleware, deprecated3) {
        let aliases2 = [];
        const middlewares = commandMiddlewareFactory(commandMiddleware);
        handler = handler || (() => {
        });
        if (Array.isArray(cmd)) {
          if (isCommandAndAliases(cmd)) {
            [cmd, ...aliases2] = cmd;
          } else {
            for (const command2 of cmd) {
              this.addHandler(command2);
            }
          }
        } else if (isCommandHandlerDefinition(cmd)) {
          let command2 = Array.isArray(cmd.command) || typeof cmd.command === "string" ? cmd.command : this.moduleName(cmd);
          if (cmd.aliases)
            command2 = [].concat(command2).concat(cmd.aliases);
          this.addHandler(command2, this.extractDesc(cmd), cmd.builder, cmd.handler, cmd.middlewares, cmd.deprecated);
          return;
        } else if (isCommandBuilderDefinition(builder)) {
          this.addHandler([cmd].concat(aliases2), description, builder.builder, builder.handler, builder.middlewares, builder.deprecated);
          return;
        }
        if (typeof cmd === "string") {
          const parsedCommand = parseCommand2(cmd);
          aliases2 = aliases2.map((alias) => parseCommand2(alias).cmd);
          let isDefault = false;
          const parsedAliases = [parsedCommand.cmd].concat(aliases2).filter((c8) => {
            if (DEFAULT_MARKER.test(c8)) {
              isDefault = true;
              return false;
            }
            return true;
          });
          if (parsedAliases.length === 0 && isDefault)
            parsedAliases.push("$0");
          if (isDefault) {
            parsedCommand.cmd = parsedAliases[0];
            aliases2 = parsedAliases.slice(1);
            cmd = cmd.replace(DEFAULT_MARKER, parsedCommand.cmd);
          }
          aliases2.forEach((alias) => {
            this.aliasMap[alias] = parsedCommand.cmd;
          });
          if (description !== false) {
            this.usage.command(cmd, description, isDefault, aliases2, deprecated3);
          }
          this.handlers[parsedCommand.cmd] = {
            original: cmd,
            description,
            handler,
            builder: builder || {},
            middlewares,
            deprecated: deprecated3,
            demanded: parsedCommand.demanded,
            optional: parsedCommand.optional
          };
          if (isDefault)
            this.defaultCommand = this.handlers[parsedCommand.cmd];
        }
      }
      getCommandHandlers() {
        return this.handlers;
      }
      getCommands() {
        return Object.keys(this.handlers).concat(Object.keys(this.aliasMap));
      }
      hasDefaultCommand() {
        return !!this.defaultCommand;
      }
      runCommand(command2, yargs, parsed, commandIndex, helpOnly, helpOrVersionSet) {
        const commandHandler = this.handlers[command2] || this.handlers[this.aliasMap[command2]] || this.defaultCommand;
        const currentContext = yargs.getInternalMethods().getContext();
        const parentCommands = currentContext.commands.slice();
        const isDefaultCommand = !command2;
        if (command2) {
          currentContext.commands.push(command2);
          currentContext.fullCommands.push(commandHandler.original);
        }
        const builderResult = this.applyBuilderUpdateUsageAndParse(isDefaultCommand, commandHandler, yargs, parsed.aliases, parentCommands, commandIndex, helpOnly, helpOrVersionSet);
        return isPromise(builderResult) ? builderResult.then((result) => this.applyMiddlewareAndGetResult(isDefaultCommand, commandHandler, result.innerArgv, currentContext, helpOnly, result.aliases, yargs)) : this.applyMiddlewareAndGetResult(isDefaultCommand, commandHandler, builderResult.innerArgv, currentContext, helpOnly, builderResult.aliases, yargs);
      }
      applyBuilderUpdateUsageAndParse(isDefaultCommand, commandHandler, yargs, aliases2, parentCommands, commandIndex, helpOnly, helpOrVersionSet) {
        const builder = commandHandler.builder;
        let innerYargs = yargs;
        if (isCommandBuilderCallback(builder)) {
          yargs.getInternalMethods().getUsageInstance().freeze();
          const builderOutput = builder(yargs.getInternalMethods().reset(aliases2), helpOrVersionSet);
          if (isPromise(builderOutput)) {
            return builderOutput.then((output) => {
              innerYargs = isYargsInstance(output) ? output : yargs;
              return this.parseAndUpdateUsage(isDefaultCommand, commandHandler, innerYargs, parentCommands, commandIndex, helpOnly);
            });
          }
        } else if (isCommandBuilderOptionDefinitions(builder)) {
          yargs.getInternalMethods().getUsageInstance().freeze();
          innerYargs = yargs.getInternalMethods().reset(aliases2);
          Object.keys(commandHandler.builder).forEach((key) => {
            innerYargs.option(key, builder[key]);
          });
        }
        return this.parseAndUpdateUsage(isDefaultCommand, commandHandler, innerYargs, parentCommands, commandIndex, helpOnly);
      }
      parseAndUpdateUsage(isDefaultCommand, commandHandler, innerYargs, parentCommands, commandIndex, helpOnly) {
        if (isDefaultCommand)
          innerYargs.getInternalMethods().getUsageInstance().unfreeze(true);
        if (this.shouldUpdateUsage(innerYargs)) {
          innerYargs.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(parentCommands, commandHandler), commandHandler.description);
        }
        const innerArgv = innerYargs.getInternalMethods().runYargsParserAndExecuteCommands(null, void 0, true, commandIndex, helpOnly);
        return isPromise(innerArgv) ? innerArgv.then((argv) => ({
          aliases: innerYargs.parsed.aliases,
          innerArgv: argv
        })) : {
          aliases: innerYargs.parsed.aliases,
          innerArgv
        };
      }
      shouldUpdateUsage(yargs) {
        return !yargs.getInternalMethods().getUsageInstance().getUsageDisabled() && yargs.getInternalMethods().getUsageInstance().getUsage().length === 0;
      }
      usageFromParentCommandsCommandHandler(parentCommands, commandHandler) {
        const c8 = DEFAULT_MARKER.test(commandHandler.original) ? commandHandler.original.replace(DEFAULT_MARKER, "").trim() : commandHandler.original;
        const pc = parentCommands.filter((c9) => {
          return !DEFAULT_MARKER.test(c9);
        });
        pc.push(c8);
        return `$0 ${pc.join(" ")}`;
      }
      handleValidationAndGetResult(isDefaultCommand, commandHandler, innerArgv, currentContext, aliases2, yargs, middlewares, positionalMap) {
        if (!yargs.getInternalMethods().getHasOutput()) {
          const validation2 = yargs.getInternalMethods().runValidation(aliases2, positionalMap, yargs.parsed.error, isDefaultCommand);
          innerArgv = maybeAsyncResult(innerArgv, (result) => {
            validation2(result);
            return result;
          });
        }
        if (commandHandler.handler && !yargs.getInternalMethods().getHasOutput()) {
          yargs.getInternalMethods().setHasOutput();
          const populateDoubleDash = !!yargs.getOptions().configuration["populate--"];
          yargs.getInternalMethods().postProcess(innerArgv, populateDoubleDash, false, false);
          innerArgv = applyMiddleware(innerArgv, yargs, middlewares, false);
          innerArgv = maybeAsyncResult(innerArgv, (result) => {
            const handlerResult = commandHandler.handler(result);
            return isPromise(handlerResult) ? handlerResult.then(() => result) : result;
          });
          if (!isDefaultCommand) {
            yargs.getInternalMethods().getUsageInstance().cacheHelpMessage();
          }
          if (isPromise(innerArgv) && !yargs.getInternalMethods().hasParseCallback()) {
            innerArgv.catch((error2) => {
              try {
                yargs.getInternalMethods().getUsageInstance().fail(null, error2);
              } catch (_err) {
              }
            });
          }
        }
        if (!isDefaultCommand) {
          currentContext.commands.pop();
          currentContext.fullCommands.pop();
        }
        return innerArgv;
      }
      applyMiddlewareAndGetResult(isDefaultCommand, commandHandler, innerArgv, currentContext, helpOnly, aliases2, yargs) {
        let positionalMap = {};
        if (helpOnly)
          return innerArgv;
        if (!yargs.getInternalMethods().getHasOutput()) {
          positionalMap = this.populatePositionals(commandHandler, innerArgv, currentContext, yargs);
        }
        const middlewares = this.globalMiddleware.getMiddleware().slice(0).concat(commandHandler.middlewares);
        const maybePromiseArgv = applyMiddleware(innerArgv, yargs, middlewares, true);
        return isPromise(maybePromiseArgv) ? maybePromiseArgv.then((resolvedInnerArgv) => this.handleValidationAndGetResult(isDefaultCommand, commandHandler, resolvedInnerArgv, currentContext, aliases2, yargs, middlewares, positionalMap)) : this.handleValidationAndGetResult(isDefaultCommand, commandHandler, maybePromiseArgv, currentContext, aliases2, yargs, middlewares, positionalMap);
      }
      populatePositionals(commandHandler, argv, context2, yargs) {
        argv._ = argv._.slice(context2.commands.length);
        const demanded = commandHandler.demanded.slice(0);
        const optional = commandHandler.optional.slice(0);
        const positionalMap = {};
        this.validation.positionalCount(demanded.length, argv._.length);
        while (demanded.length) {
          const demand = demanded.shift();
          this.populatePositional(demand, argv, positionalMap);
        }
        while (optional.length) {
          const maybe = optional.shift();
          this.populatePositional(maybe, argv, positionalMap);
        }
        argv._ = context2.commands.concat(argv._.map((a7) => "" + a7));
        this.postProcessPositionals(argv, positionalMap, this.cmdToParseOptions(commandHandler.original), yargs);
        return positionalMap;
      }
      populatePositional(positional, argv, positionalMap) {
        const cmd = positional.cmd[0];
        if (positional.variadic) {
          positionalMap[cmd] = argv._.splice(0).map(String);
        } else {
          if (argv._.length)
            positionalMap[cmd] = [String(argv._.shift())];
        }
      }
      cmdToParseOptions(cmdString) {
        const parseOptions = {
          array: [],
          default: {},
          alias: {},
          demand: {}
        };
        const parsed = parseCommand2(cmdString);
        parsed.demanded.forEach((d8) => {
          const [cmd, ...aliases2] = d8.cmd;
          if (d8.variadic) {
            parseOptions.array.push(cmd);
            parseOptions.default[cmd] = [];
          }
          parseOptions.alias[cmd] = aliases2;
          parseOptions.demand[cmd] = true;
        });
        parsed.optional.forEach((o7) => {
          const [cmd, ...aliases2] = o7.cmd;
          if (o7.variadic) {
            parseOptions.array.push(cmd);
            parseOptions.default[cmd] = [];
          }
          parseOptions.alias[cmd] = aliases2;
        });
        return parseOptions;
      }
      postProcessPositionals(argv, positionalMap, parseOptions, yargs) {
        const options = Object.assign({}, yargs.getOptions());
        options.default = Object.assign(parseOptions.default, options.default);
        for (const key of Object.keys(parseOptions.alias)) {
          options.alias[key] = (options.alias[key] || []).concat(parseOptions.alias[key]);
        }
        options.array = options.array.concat(parseOptions.array);
        options.config = {};
        const unparsed = [];
        Object.keys(positionalMap).forEach((key) => {
          positionalMap[key].map((value) => {
            if (options.configuration["unknown-options-as-args"])
              options.key[key] = true;
            unparsed.push(`--${key}`);
            unparsed.push(value);
          });
        });
        if (!unparsed.length)
          return;
        const config = Object.assign({}, options.configuration, {
          "populate--": false
        });
        const parsed = this.shim.Parser.detailed(unparsed, Object.assign({}, options, {
          configuration: config
        }));
        if (parsed.error) {
          yargs.getInternalMethods().getUsageInstance().fail(parsed.error.message, parsed.error);
        } else {
          const positionalKeys = Object.keys(positionalMap);
          Object.keys(positionalMap).forEach((key) => {
            positionalKeys.push(...parsed.aliases[key]);
          });
          Object.keys(parsed.argv).forEach((key) => {
            if (positionalKeys.includes(key)) {
              if (!positionalMap[key])
                positionalMap[key] = parsed.argv[key];
              if (!this.isInConfigs(yargs, key) && !this.isDefaulted(yargs, key) && Object.prototype.hasOwnProperty.call(argv, key) && Object.prototype.hasOwnProperty.call(parsed.argv, key) && (Array.isArray(argv[key]) || Array.isArray(parsed.argv[key]))) {
                argv[key] = [].concat(argv[key], parsed.argv[key]);
              } else {
                argv[key] = parsed.argv[key];
              }
            }
          });
        }
      }
      isDefaulted(yargs, key) {
        const { default: defaults3 } = yargs.getOptions();
        return Object.prototype.hasOwnProperty.call(defaults3, key) || Object.prototype.hasOwnProperty.call(defaults3, this.shim.Parser.camelCase(key));
      }
      isInConfigs(yargs, key) {
        const { configObjects } = yargs.getOptions();
        return configObjects.some((c8) => Object.prototype.hasOwnProperty.call(c8, key)) || configObjects.some((c8) => Object.prototype.hasOwnProperty.call(c8, this.shim.Parser.camelCase(key)));
      }
      runDefaultBuilderOn(yargs) {
        if (!this.defaultCommand)
          return;
        if (this.shouldUpdateUsage(yargs)) {
          const commandString = DEFAULT_MARKER.test(this.defaultCommand.original) ? this.defaultCommand.original : this.defaultCommand.original.replace(/^[^[\]<>]*/, "$0 ");
          yargs.getInternalMethods().getUsageInstance().usage(commandString, this.defaultCommand.description);
        }
        const builder = this.defaultCommand.builder;
        if (isCommandBuilderCallback(builder)) {
          return builder(yargs, true);
        } else if (!isCommandBuilderDefinition(builder)) {
          Object.keys(builder).forEach((key) => {
            yargs.option(key, builder[key]);
          });
        }
        return void 0;
      }
      moduleName(obj) {
        const mod = whichModule(obj);
        if (!mod)
          throw new Error(`No command name given for module: ${this.shim.inspect(obj)}`);
        return this.commandFromFilename(mod.filename);
      }
      commandFromFilename(filename) {
        return this.shim.path.basename(filename, this.shim.path.extname(filename));
      }
      extractDesc({ describe, description, desc }) {
        for (const test of [describe, description, desc]) {
          if (typeof test === "string" || test === false)
            return test;
          assertNotStrictEqual(test, true, this.shim);
        }
        return false;
      }
      freeze() {
        this.frozens.push({
          handlers: this.handlers,
          aliasMap: this.aliasMap,
          defaultCommand: this.defaultCommand
        });
      }
      unfreeze() {
        const frozen = this.frozens.pop();
        assertNotStrictEqual(frozen, void 0, this.shim);
        ({
          handlers: this.handlers,
          aliasMap: this.aliasMap,
          defaultCommand: this.defaultCommand
        } = frozen);
      }
      reset() {
        this.handlers = {};
        this.aliasMap = {};
        this.defaultCommand = void 0;
        this.requireCache = /* @__PURE__ */ new Set();
        return this;
      }
    };
    __name(command, "command");
    __name(isCommandBuilderDefinition, "isCommandBuilderDefinition");
    __name(isCommandAndAliases, "isCommandAndAliases");
    __name(isCommandBuilderCallback, "isCommandBuilderCallback");
    __name(isCommandBuilderOptionDefinitions, "isCommandBuilderOptionDefinitions");
    __name(isCommandHandlerDefinition, "isCommandHandlerDefinition");
  }
});

// ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/utils/obj-filter.js
function objFilter(original = {}, filter2 = () => true) {
  const obj = {};
  objectKeys(original).forEach((key) => {
    if (filter2(key, original[key])) {
      obj[key] = original[key];
    }
  });
  return obj;
}
var init_obj_filter = __esm({
  "../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/utils/obj-filter.js"() {
    init_import_meta_url();
    init_common_types();
    __name(objFilter, "objFilter");
  }
});

// ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/utils/set-blocking.js
function setBlocking(blocking) {
  if (typeof process === "undefined")
    return;
  [process.stdout, process.stderr].forEach((_stream) => {
    const stream2 = _stream;
    if (stream2._handle && stream2.isTTY && typeof stream2._handle.setBlocking === "function") {
      stream2._handle.setBlocking(blocking);
    }
  });
}
var init_set_blocking = __esm({
  "../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/utils/set-blocking.js"() {
    init_import_meta_url();
    __name(setBlocking, "setBlocking");
  }
});

// ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/usage.js
function isBoolean2(fail) {
  return typeof fail === "boolean";
}
function usage(yargs, shim3) {
  const __ = shim3.y18n.__;
  const self2 = {};
  const fails = [];
  self2.failFn = /* @__PURE__ */ __name(function failFn(f8) {
    fails.push(f8);
  }, "failFn");
  let failMessage = null;
  let globalFailMessage = null;
  let showHelpOnFail = true;
  self2.showHelpOnFail = /* @__PURE__ */ __name(function showHelpOnFailFn(arg1 = true, arg2) {
    const [enabled, message] = typeof arg1 === "string" ? [true, arg1] : [arg1, arg2];
    if (yargs.getInternalMethods().isGlobalContext()) {
      globalFailMessage = message;
    }
    failMessage = message;
    showHelpOnFail = enabled;
    return self2;
  }, "showHelpOnFailFn");
  let failureOutput = false;
  self2.fail = /* @__PURE__ */ __name(function fail(msg, err) {
    const logger4 = yargs.getInternalMethods().getLoggerInstance();
    if (fails.length) {
      for (let i7 = fails.length - 1; i7 >= 0; --i7) {
        const fail2 = fails[i7];
        if (isBoolean2(fail2)) {
          if (err)
            throw err;
          else if (msg)
            throw Error(msg);
        } else {
          fail2(msg, err, self2);
        }
      }
    } else {
      if (yargs.getExitProcess())
        setBlocking(true);
      if (!failureOutput) {
        failureOutput = true;
        if (showHelpOnFail) {
          yargs.showHelp("error");
          logger4.error();
        }
        if (msg || err)
          logger4.error(msg || err);
        const globalOrCommandFailMessage = failMessage || globalFailMessage;
        if (globalOrCommandFailMessage) {
          if (msg || err)
            logger4.error("");
          logger4.error(globalOrCommandFailMessage);
        }
      }
      err = err || new YError(msg);
      if (yargs.getExitProcess()) {
        return yargs.exit(1);
      } else if (yargs.getInternalMethods().hasParseCallback()) {
        return yargs.exit(1, err);
      } else {
        throw err;
      }
    }
  }, "fail");
  let usages = [];
  let usageDisabled = false;
  self2.usage = (msg, description) => {
    if (msg === null) {
      usageDisabled = true;
      usages = [];
      return self2;
    }
    usageDisabled = false;
    usages.push([msg, description || ""]);
    return self2;
  };
  self2.getUsage = () => {
    return usages;
  };
  self2.getUsageDisabled = () => {
    return usageDisabled;
  };
  self2.getPositionalGroupName = () => {
    return __("Positionals:");
  };
  let examples = [];
  self2.example = (cmd, description) => {
    examples.push([cmd, description || ""]);
  };
  let commands5 = [];
  self2.command = /* @__PURE__ */ __name(function command2(cmd, description, isDefault, aliases2, deprecated3 = false) {
    if (isDefault) {
      commands5 = commands5.map((cmdArray) => {
        cmdArray[2] = false;
        return cmdArray;
      });
    }
    commands5.push([cmd, description || "", isDefault, aliases2, deprecated3]);
  }, "command");
  self2.getCommands = () => commands5;
  let descriptions = {};
  self2.describe = /* @__PURE__ */ __name(function describe(keyOrKeys, desc) {
    if (Array.isArray(keyOrKeys)) {
      keyOrKeys.forEach((k7) => {
        self2.describe(k7, desc);
      });
    } else if (typeof keyOrKeys === "object") {
      Object.keys(keyOrKeys).forEach((k7) => {
        self2.describe(k7, keyOrKeys[k7]);
      });
    } else {
      descriptions[keyOrKeys] = desc;
    }
  }, "describe");
  self2.getDescriptions = () => descriptions;
  let epilogs = [];
  self2.epilog = (msg) => {
    epilogs.push(msg);
  };
  let wrapSet = false;
  let wrap4;
  self2.wrap = (cols) => {
    wrapSet = true;
    wrap4 = cols;
  };
  self2.getWrap = () => {
    if (shim3.getEnv("YARGS_DISABLE_WRAP")) {
      return null;
    }
    if (!wrapSet) {
      wrap4 = windowWidth();
      wrapSet = true;
    }
    return wrap4;
  };
  const deferY18nLookupPrefix = "__yargsString__:";
  self2.deferY18nLookup = (str) => deferY18nLookupPrefix + str;
  self2.help = /* @__PURE__ */ __name(function help() {
    if (cachedHelpMessage)
      return cachedHelpMessage;
    normalizeAliases();
    const base$0 = yargs.customScriptName ? yargs.$0 : shim3.path.basename(yargs.$0);
    const demandedOptions = yargs.getDemandedOptions();
    const demandedCommands = yargs.getDemandedCommands();
    const deprecatedOptions = yargs.getDeprecatedOptions();
    const groups = yargs.getGroups();
    const options = yargs.getOptions();
    let keys = [];
    keys = keys.concat(Object.keys(descriptions));
    keys = keys.concat(Object.keys(demandedOptions));
    keys = keys.concat(Object.keys(demandedCommands));
    keys = keys.concat(Object.keys(options.default));
    keys = keys.filter(filterHiddenOptions);
    keys = Object.keys(keys.reduce((acc, key) => {
      if (key !== "_")
        acc[key] = true;
      return acc;
    }, {}));
    const theWrap = self2.getWrap();
    const ui2 = shim3.cliui({
      width: theWrap,
      wrap: !!theWrap
    });
    if (!usageDisabled) {
      if (usages.length) {
        usages.forEach((usage2) => {
          ui2.div({ text: `${usage2[0].replace(/\$0/g, base$0)}` });
          if (usage2[1]) {
            ui2.div({ text: `${usage2[1]}`, padding: [1, 0, 0, 0] });
          }
        });
        ui2.div();
      } else if (commands5.length) {
        let u7 = null;
        if (demandedCommands._) {
          u7 = `${base$0} <${__("command")}>
`;
        } else {
          u7 = `${base$0} [${__("command")}]
`;
        }
        ui2.div(`${u7}`);
      }
    }
    if (commands5.length > 1 || commands5.length === 1 && !commands5[0][2]) {
      ui2.div(__("Commands:"));
      const context2 = yargs.getInternalMethods().getContext();
      const parentCommands = context2.commands.length ? `${context2.commands.join(" ")} ` : "";
      if (yargs.getInternalMethods().getParserConfiguration()["sort-commands"] === true) {
        commands5 = commands5.sort((a7, b11) => a7[0].localeCompare(b11[0]));
      }
      const prefix = base$0 ? `${base$0} ` : "";
      commands5.forEach((command2) => {
        const commandString = `${prefix}${parentCommands}${command2[0].replace(/^\$0 ?/, "")}`;
        ui2.span({
          text: commandString,
          padding: [0, 2, 0, 2],
          width: maxWidth(commands5, theWrap, `${base$0}${parentCommands}`) + 4
        }, { text: command2[1] });
        const hints = [];
        if (command2[2])
          hints.push(`[${__("default")}]`);
        if (command2[3] && command2[3].length) {
          hints.push(`[${__("aliases:")} ${command2[3].join(", ")}]`);
        }
        if (command2[4]) {
          if (typeof command2[4] === "string") {
            hints.push(`[${__("deprecated: %s", command2[4])}]`);
          } else {
            hints.push(`[${__("deprecated")}]`);
          }
        }
        if (hints.length) {
          ui2.div({
            text: hints.join(" "),
            padding: [0, 0, 0, 2],
            align: "right"
          });
        } else {
          ui2.div();
        }
      });
      ui2.div();
    }
    const aliasKeys = (Object.keys(options.alias) || []).concat(Object.keys(yargs.parsed.newAliases) || []);
    keys = keys.filter((key) => !yargs.parsed.newAliases[key] && aliasKeys.every((alias) => (options.alias[alias] || []).indexOf(key) === -1));
    const defaultGroup = __("Options:");
    if (!groups[defaultGroup])
      groups[defaultGroup] = [];
    addUngroupedKeys(keys, options.alias, groups, defaultGroup);
    const isLongSwitch = /* @__PURE__ */ __name((sw) => /^--/.test(getText(sw)), "isLongSwitch");
    const displayedGroups = Object.keys(groups).filter((groupName) => groups[groupName].length > 0).map((groupName) => {
      const normalizedKeys = groups[groupName].filter(filterHiddenOptions).map((key) => {
        if (aliasKeys.includes(key))
          return key;
        for (let i7 = 0, aliasKey; (aliasKey = aliasKeys[i7]) !== void 0; i7++) {
          if ((options.alias[aliasKey] || []).includes(key))
            return aliasKey;
        }
        return key;
      });
      return { groupName, normalizedKeys };
    }).filter(({ normalizedKeys }) => normalizedKeys.length > 0).map(({ groupName, normalizedKeys }) => {
      const switches = normalizedKeys.reduce((acc, key) => {
        acc[key] = [key].concat(options.alias[key] || []).map((sw) => {
          if (groupName === self2.getPositionalGroupName())
            return sw;
          else {
            return (/^[0-9]$/.test(sw) ? options.boolean.includes(key) ? "-" : "--" : sw.length > 1 ? "--" : "-") + sw;
          }
        }).sort((sw1, sw2) => isLongSwitch(sw1) === isLongSwitch(sw2) ? 0 : isLongSwitch(sw1) ? 1 : -1).join(", ");
        return acc;
      }, {});
      return { groupName, normalizedKeys, switches };
    });
    const shortSwitchesUsed = displayedGroups.filter(({ groupName }) => groupName !== self2.getPositionalGroupName()).some(({ normalizedKeys, switches }) => !normalizedKeys.every((key) => isLongSwitch(switches[key])));
    if (shortSwitchesUsed) {
      displayedGroups.filter(({ groupName }) => groupName !== self2.getPositionalGroupName()).forEach(({ normalizedKeys, switches }) => {
        normalizedKeys.forEach((key) => {
          if (isLongSwitch(switches[key])) {
            switches[key] = addIndentation(switches[key], "-x, ".length);
          }
        });
      });
    }
    displayedGroups.forEach(({ groupName, normalizedKeys, switches }) => {
      ui2.div(groupName);
      normalizedKeys.forEach((key) => {
        const kswitch = switches[key];
        let desc = descriptions[key] || "";
        let type = null;
        if (desc.includes(deferY18nLookupPrefix))
          desc = __(desc.substring(deferY18nLookupPrefix.length));
        if (options.boolean.includes(key))
          type = `[${__("boolean")}]`;
        if (options.count.includes(key))
          type = `[${__("count")}]`;
        if (options.string.includes(key))
          type = `[${__("string")}]`;
        if (options.normalize.includes(key))
          type = `[${__("string")}]`;
        if (options.array.includes(key))
          type = `[${__("array")}]`;
        if (options.number.includes(key))
          type = `[${__("number")}]`;
        const deprecatedExtra = /* @__PURE__ */ __name((deprecated3) => typeof deprecated3 === "string" ? `[${__("deprecated: %s", deprecated3)}]` : `[${__("deprecated")}]`, "deprecatedExtra");
        const extra = [
          key in deprecatedOptions ? deprecatedExtra(deprecatedOptions[key]) : null,
          type,
          key in demandedOptions ? `[${__("required")}]` : null,
          options.choices && options.choices[key] ? `[${__("choices:")} ${self2.stringifiedValues(options.choices[key])}]` : null,
          defaultString(options.default[key], options.defaultDescription[key])
        ].filter(Boolean).join(" ");
        ui2.span({
          text: getText(kswitch),
          padding: [0, 2, 0, 2 + getIndentation(kswitch)],
          width: maxWidth(switches, theWrap) + 4
        }, desc);
        const shouldHideOptionExtras = yargs.getInternalMethods().getUsageConfiguration()["hide-types"] === true;
        if (extra && !shouldHideOptionExtras)
          ui2.div({ text: extra, padding: [0, 0, 0, 2], align: "right" });
        else
          ui2.div();
      });
      ui2.div();
    });
    if (examples.length) {
      ui2.div(__("Examples:"));
      examples.forEach((example) => {
        example[0] = example[0].replace(/\$0/g, base$0);
      });
      examples.forEach((example) => {
        if (example[1] === "") {
          ui2.div({
            text: example[0],
            padding: [0, 2, 0, 2]
          });
        } else {
          ui2.div({
            text: example[0],
            padding: [0, 2, 0, 2],
            width: maxWidth(examples, theWrap) + 4
          }, {
            text: example[1]
          });
        }
      });
      ui2.div();
    }
    if (epilogs.length > 0) {
      const e10 = epilogs.map((epilog) => epilog.replace(/\$0/g, base$0)).join("\n");
      ui2.div(`${e10}
`);
    }
    return ui2.toString().replace(/\s*$/, "");
  }, "help");
  function maxWidth(table, theWrap, modifier) {
    let width = 0;
    if (!Array.isArray(table)) {
      table = Object.values(table).map((v8) => [v8]);
    }
    table.forEach((v8) => {
      width = Math.max(shim3.stringWidth(modifier ? `${modifier} ${getText(v8[0])}` : getText(v8[0])) + getIndentation(v8[0]), width);
    });
    if (theWrap)
      width = Math.min(width, parseInt((theWrap * 0.5).toString(), 10));
    return width;
  }
  __name(maxWidth, "maxWidth");
  function normalizeAliases() {
    const demandedOptions = yargs.getDemandedOptions();
    const options = yargs.getOptions();
    (Object.keys(options.alias) || []).forEach((key) => {
      options.alias[key].forEach((alias) => {
        if (descriptions[alias])
          self2.describe(key, descriptions[alias]);
        if (alias in demandedOptions)
          yargs.demandOption(key, demandedOptions[alias]);
        if (options.boolean.includes(alias))
          yargs.boolean(key);
        if (options.count.includes(alias))
          yargs.count(key);
        if (options.string.includes(alias))
          yargs.string(key);
        if (options.normalize.includes(alias))
          yargs.normalize(key);
        if (options.array.includes(alias))
          yargs.array(key);
        if (options.number.includes(alias))
          yargs.number(key);
      });
    });
  }
  __name(normalizeAliases, "normalizeAliases");
  let cachedHelpMessage;
  self2.cacheHelpMessage = function() {
    cachedHelpMessage = this.help();
  };
  self2.clearCachedHelpMessage = function() {
    cachedHelpMessage = void 0;
  };
  self2.hasCachedHelpMessage = function() {
    return !!cachedHelpMessage;
  };
  function addUngroupedKeys(keys, aliases2, groups, defaultGroup) {
    let groupedKeys = [];
    let toCheck = null;
    Object.keys(groups).forEach((group) => {
      groupedKeys = groupedKeys.concat(groups[group]);
    });
    keys.forEach((key) => {
      toCheck = [key].concat(aliases2[key]);
      if (!toCheck.some((k7) => groupedKeys.indexOf(k7) !== -1)) {
        groups[defaultGroup].push(key);
      }
    });
    return groupedKeys;
  }
  __name(addUngroupedKeys, "addUngroupedKeys");
  function filterHiddenOptions(key) {
    return yargs.getOptions().hiddenOptions.indexOf(key) < 0 || yargs.parsed.argv[yargs.getOptions().showHiddenOpt];
  }
  __name(filterHiddenOptions, "filterHiddenOptions");
  self2.showHelp = (level) => {
    const logger4 = yargs.getInternalMethods().getLoggerInstance();
    if (!level)
      level = "error";
    const emit = typeof level === "function" ? level : logger4[level];
    emit(self2.help());
  };
  self2.functionDescription = (fn2) => {
    const description = fn2.name ? shim3.Parser.decamelize(fn2.name, "-") : __("generated-value");
    return ["(", description, ")"].join("");
  };
  self2.stringifiedValues = /* @__PURE__ */ __name(function stringifiedValues(values, separator) {
    let string = "";
    const sep6 = separator || ", ";
    const array = [].concat(values);
    if (!values || !array.length)
      return string;
    array.forEach((value) => {
      if (string.length)
        string += sep6;
      string += JSON.stringify(value);
    });
    return string;
  }, "stringifiedValues");
  function defaultString(value, defaultDescription) {
    let string = `[${__("default:")} `;
    if (value === void 0 && !defaultDescription)
      return null;
    if (defaultDescription) {
      string += defaultDescription;
    } else {
      switch (typeof value) {
        case "string":
          string += `"${value}"`;
          break;
        case "object":
          string += JSON.stringify(value);
          break;
        default:
          string += value;
      }
    }
    return `${string}]`;
  }
  __name(defaultString, "defaultString");
  function windowWidth() {
    const maxWidth2 = 80;
    if (shim3.process.stdColumns) {
      return Math.min(maxWidth2, shim3.process.stdColumns);
    } else {
      return maxWidth2;
    }
  }
  __name(windowWidth, "windowWidth");
  let version5 = null;
  self2.version = (ver) => {
    version5 = ver;
  };
  self2.showVersion = (level) => {
    const logger4 = yargs.getInternalMethods().getLoggerInstance();
    if (!level)
      level = "error";
    const emit = typeof level === "function" ? level : logger4[level];
    emit(version5);
  };
  self2.reset = /* @__PURE__ */ __name(function reset(localLookup) {
    failMessage = null;
    failureOutput = false;
    usages = [];
    usageDisabled = false;
    epilogs = [];
    examples = [];
    commands5 = [];
    descriptions = objFilter(descriptions, (k7) => !localLookup[k7]);
    return self2;
  }, "reset");
  const frozens = [];
  self2.freeze = /* @__PURE__ */ __name(function freeze() {
    frozens.push({
      failMessage,
      failureOutput,
      usages,
      usageDisabled,
      epilogs,
      examples,
      commands: commands5,
      descriptions
    });
  }, "freeze");
  self2.unfreeze = /* @__PURE__ */ __name(function unfreeze(defaultCommand = false) {
    const frozen = frozens.pop();
    if (!frozen)
      return;
    if (defaultCommand) {
      descriptions = { ...frozen.descriptions, ...descriptions };
      commands5 = [...frozen.commands, ...commands5];
      usages = [...frozen.usages, ...usages];
      examples = [...frozen.examples, ...examples];
      epilogs = [...frozen.epilogs, ...epilogs];
    } else {
      ({
        failMessage,
        failureOutput,
        usages,
        usageDisabled,
        epilogs,
        examples,
        commands: commands5,
        descriptions
      } = frozen);
    }
  }, "unfreeze");
  return self2;
}
function isIndentedText(text) {
  return typeof text === "object";
}
function addIndentation(text, indent) {
  return isIndentedText(text) ? { text: text.text, indentation: text.indentation + indent } : { text, indentation: indent };
}
function getIndentation(text) {
  return isIndentedText(text) ? text.indentation : 0;
}
function getText(text) {
  return isIndentedText(text) ? text.text : text;
}
var init_usage = __esm({
  "../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/usage.js"() {
    init_import_meta_url();
    init_obj_filter();
    init_yerror();
    init_set_blocking();
    __name(isBoolean2, "isBoolean");
    __name(usage, "usage");
    __name(isIndentedText, "isIndentedText");
    __name(addIndentation, "addIndentation");
    __name(getIndentation, "getIndentation");
    __name(getText, "getText");
  }
});

// ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/completion-templates.js
var completionShTemplate, completionZshTemplate;
var init_completion_templates = __esm({
  "../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/completion-templates.js"() {
    init_import_meta_url();
    completionShTemplate = `###-begin-{{app_name}}-completions-###
#
# yargs command completion script
#
# Installation: {{app_path}} {{completion_command}} >> ~/.bashrc
#    or {{app_path}} {{completion_command}} >> ~/.bash_profile on OSX.
#
_{{app_name}}_yargs_completions()
{
    local cur_word args type_list

    cur_word="\${COMP_WORDS[COMP_CWORD]}"
    args=("\${COMP_WORDS[@]}")

    # ask yargs to generate completions.
    type_list=$({{app_path}} --get-yargs-completions "\${args[@]}")

    COMPREPLY=( $(compgen -W "\${type_list}" -- \${cur_word}) )

    # if no match was found, fall back to filename completion
    if [ \${#COMPREPLY[@]} -eq 0 ]; then
      COMPREPLY=()
    fi

    return 0
}
complete -o bashdefault -o default -F _{{app_name}}_yargs_completions {{app_name}}
###-end-{{app_name}}-completions-###
`;
    completionZshTemplate = `#compdef {{app_name}}
###-begin-{{app_name}}-completions-###
#
# yargs command completion script
#
# Installation: {{app_path}} {{completion_command}} >> ~/.zshrc
#    or {{app_path}} {{completion_command}} >> ~/.zprofile on OSX.
#
_{{app_name}}_yargs_completions()
{
  local reply
  local si=$IFS
  IFS=$'
' reply=($(COMP_CWORD="$((CURRENT-1))" COMP_LINE="$BUFFER" COMP_POINT="$CURSOR" {{app_path}} --get-yargs-completions "\${words[@]}"))
  IFS=$si
  _describe 'values' reply
}
compdef _{{app_name}}_yargs_completions {{app_name}}
###-end-{{app_name}}-completions-###
`;
  }
});

// ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/completion.js
function completion(yargs, usage2, command2, shim3) {
  return new Completion(yargs, usage2, command2, shim3);
}
function isSyncCompletionFunction(completionFunction) {
  return completionFunction.length < 3;
}
function isFallbackCompletionFunction(completionFunction) {
  return completionFunction.length > 3;
}
var Completion;
var init_completion = __esm({
  "../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/completion.js"() {
    init_import_meta_url();
    init_command2();
    init_common_types();
    init_completion_templates();
    init_is_promise();
    init_parse_command();
    Completion = class {
      static {
        __name(this, "Completion");
      }
      constructor(yargs, usage2, command2, shim3) {
        var _a5, _b2, _c3;
        this.yargs = yargs;
        this.usage = usage2;
        this.command = command2;
        this.shim = shim3;
        this.completionKey = "get-yargs-completions";
        this.aliases = null;
        this.customCompletionFunction = null;
        this.indexAfterLastReset = 0;
        this.zshShell = (_c3 = ((_a5 = this.shim.getEnv("SHELL")) === null || _a5 === void 0 ? void 0 : _a5.includes("zsh")) || ((_b2 = this.shim.getEnv("ZSH_NAME")) === null || _b2 === void 0 ? void 0 : _b2.includes("zsh"))) !== null && _c3 !== void 0 ? _c3 : false;
      }
      defaultCompletion(args, argv, current, done) {
        const handlers2 = this.command.getCommandHandlers();
        for (let i7 = 0, ii = args.length; i7 < ii; ++i7) {
          if (handlers2[args[i7]] && handlers2[args[i7]].builder) {
            const builder = handlers2[args[i7]].builder;
            if (isCommandBuilderCallback(builder)) {
              this.indexAfterLastReset = i7 + 1;
              const y5 = this.yargs.getInternalMethods().reset();
              builder(y5, true);
              return y5.argv;
            }
          }
        }
        const completions = [];
        this.commandCompletions(completions, args, current);
        this.optionCompletions(completions, args, argv, current);
        this.choicesFromOptionsCompletions(completions, args, argv, current);
        this.choicesFromPositionalsCompletions(completions, args, argv, current);
        done(null, completions);
      }
      commandCompletions(completions, args, current) {
        const parentCommands = this.yargs.getInternalMethods().getContext().commands;
        if (!current.match(/^-/) && parentCommands[parentCommands.length - 1] !== current && !this.previousArgHasChoices(args)) {
          this.usage.getCommands().forEach((usageCommand) => {
            const commandName = parseCommand2(usageCommand[0]).cmd;
            if (args.indexOf(commandName) === -1) {
              if (!this.zshShell) {
                completions.push(commandName);
              } else {
                const desc = usageCommand[1] || "";
                completions.push(commandName.replace(/:/g, "\\:") + ":" + desc);
              }
            }
          });
        }
      }
      optionCompletions(completions, args, argv, current) {
        if ((current.match(/^-/) || current === "" && completions.length === 0) && !this.previousArgHasChoices(args)) {
          const options = this.yargs.getOptions();
          const positionalKeys = this.yargs.getGroups()[this.usage.getPositionalGroupName()] || [];
          Object.keys(options.key).forEach((key) => {
            const negable = !!options.configuration["boolean-negation"] && options.boolean.includes(key);
            const isPositionalKey = positionalKeys.includes(key);
            if (!isPositionalKey && !options.hiddenOptions.includes(key) && !this.argsContainKey(args, key, negable)) {
              this.completeOptionKey(key, completions, current, negable && !!options.default[key]);
            }
          });
        }
      }
      choicesFromOptionsCompletions(completions, args, argv, current) {
        if (this.previousArgHasChoices(args)) {
          const choices = this.getPreviousArgChoices(args);
          if (choices && choices.length > 0) {
            completions.push(...choices.map((c8) => c8.replace(/:/g, "\\:")));
          }
        }
      }
      choicesFromPositionalsCompletions(completions, args, argv, current) {
        if (current === "" && completions.length > 0 && this.previousArgHasChoices(args)) {
          return;
        }
        const positionalKeys = this.yargs.getGroups()[this.usage.getPositionalGroupName()] || [];
        const offset = Math.max(this.indexAfterLastReset, this.yargs.getInternalMethods().getContext().commands.length + 1);
        const positionalKey = positionalKeys[argv._.length - offset - 1];
        if (!positionalKey) {
          return;
        }
        const choices = this.yargs.getOptions().choices[positionalKey] || [];
        for (const choice of choices) {
          if (choice.startsWith(current)) {
            completions.push(choice.replace(/:/g, "\\:"));
          }
        }
      }
      getPreviousArgChoices(args) {
        if (args.length < 1)
          return;
        let previousArg = args[args.length - 1];
        let filter2 = "";
        if (!previousArg.startsWith("-") && args.length > 1) {
          filter2 = previousArg;
          previousArg = args[args.length - 2];
        }
        if (!previousArg.startsWith("-"))
          return;
        const previousArgKey = previousArg.replace(/^-+/, "");
        const options = this.yargs.getOptions();
        const possibleAliases = [
          previousArgKey,
          ...this.yargs.getAliases()[previousArgKey] || []
        ];
        let choices;
        for (const possibleAlias of possibleAliases) {
          if (Object.prototype.hasOwnProperty.call(options.key, possibleAlias) && Array.isArray(options.choices[possibleAlias])) {
            choices = options.choices[possibleAlias];
            break;
          }
        }
        if (choices) {
          return choices.filter((choice) => !filter2 || choice.startsWith(filter2));
        }
      }
      previousArgHasChoices(args) {
        const choices = this.getPreviousArgChoices(args);
        return choices !== void 0 && choices.length > 0;
      }
      argsContainKey(args, key, negable) {
        const argsContains = /* @__PURE__ */ __name((s7) => args.indexOf((/^[^0-9]$/.test(s7) ? "-" : "--") + s7) !== -1, "argsContains");
        if (argsContains(key))
          return true;
        if (negable && argsContains(`no-${key}`))
          return true;
        if (this.aliases) {
          for (const alias of this.aliases[key]) {
            if (argsContains(alias))
              return true;
          }
        }
        return false;
      }
      completeOptionKey(key, completions, current, negable) {
        var _a5, _b2, _c3, _d2;
        let keyWithDesc = key;
        if (this.zshShell) {
          const descs = this.usage.getDescriptions();
          const aliasKey = (_b2 = (_a5 = this === null || this === void 0 ? void 0 : this.aliases) === null || _a5 === void 0 ? void 0 : _a5[key]) === null || _b2 === void 0 ? void 0 : _b2.find((alias) => {
            const desc2 = descs[alias];
            return typeof desc2 === "string" && desc2.length > 0;
          });
          const descFromAlias = aliasKey ? descs[aliasKey] : void 0;
          const desc = (_d2 = (_c3 = descs[key]) !== null && _c3 !== void 0 ? _c3 : descFromAlias) !== null && _d2 !== void 0 ? _d2 : "";
          keyWithDesc = `${key.replace(/:/g, "\\:")}:${desc.replace("__yargsString__:", "").replace(/(\r\n|\n|\r)/gm, " ")}`;
        }
        const startsByTwoDashes = /* @__PURE__ */ __name((s7) => /^--/.test(s7), "startsByTwoDashes");
        const isShortOption = /* @__PURE__ */ __name((s7) => /^[^0-9]$/.test(s7), "isShortOption");
        const dashes = !startsByTwoDashes(current) && isShortOption(key) ? "-" : "--";
        completions.push(dashes + keyWithDesc);
        if (negable) {
          completions.push(dashes + "no-" + keyWithDesc);
        }
      }
      customCompletion(args, argv, current, done) {
        assertNotStrictEqual(this.customCompletionFunction, null, this.shim);
        if (isSyncCompletionFunction(this.customCompletionFunction)) {
          const result = this.customCompletionFunction(current, argv);
          if (isPromise(result)) {
            return result.then((list) => {
              this.shim.process.nextTick(() => {
                done(null, list);
              });
            }).catch((err) => {
              this.shim.process.nextTick(() => {
                done(err, void 0);
              });
            });
          }
          return done(null, result);
        } else if (isFallbackCompletionFunction(this.customCompletionFunction)) {
          return this.customCompletionFunction(current, argv, (onCompleted = done) => this.defaultCompletion(args, argv, current, onCompleted), (completions) => {
            done(null, completions);
          });
        } else {
          return this.customCompletionFunction(current, argv, (completions) => {
            done(null, completions);
          });
        }
      }
      getCompletion(args, done) {
        const current = args.length ? args[args.length - 1] : "";
        const argv = this.yargs.parse(args, true);
        const completionFunction = this.customCompletionFunction ? (argv2) => this.customCompletion(args, argv2, current, done) : (argv2) => this.defaultCompletion(args, argv2, current, done);
        return isPromise(argv) ? argv.then(completionFunction) : completionFunction(argv);
      }
      generateCompletionScript($0, cmd) {
        let script = this.zshShell ? completionZshTemplate : completionShTemplate;
        const name2 = this.shim.path.basename($0);
        if ($0.match(/\.js$/))
          $0 = `./${$0}`;
        script = script.replace(/{{app_name}}/g, name2);
        script = script.replace(/{{completion_command}}/g, cmd);
        return script.replace(/{{app_path}}/g, $0);
      }
      registerFunction(fn2) {
        this.customCompletionFunction = fn2;
      }
      setParsed(parsed) {
        this.aliases = parsed.aliases;
      }
    };
    __name(completion, "completion");
    __name(isSyncCompletionFunction, "isSyncCompletionFunction");
    __name(isFallbackCompletionFunction, "isFallbackCompletionFunction");
  }
});

// ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/utils/levenshtein.js
function levenshtein(a7, b11) {
  if (a7.length === 0)
    return b11.length;
  if (b11.length === 0)
    return a7.length;
  const matrix = [];
  let i7;
  for (i7 = 0; i7 <= b11.length; i7++) {
    matrix[i7] = [i7];
  }
  let j7;
  for (j7 = 0; j7 <= a7.length; j7++) {
    matrix[0][j7] = j7;
  }
  for (i7 = 1; i7 <= b11.length; i7++) {
    for (j7 = 1; j7 <= a7.length; j7++) {
      if (b11.charAt(i7 - 1) === a7.charAt(j7 - 1)) {
        matrix[i7][j7] = matrix[i7 - 1][j7 - 1];
      } else {
        if (i7 > 1 && j7 > 1 && b11.charAt(i7 - 2) === a7.charAt(j7 - 1) && b11.charAt(i7 - 1) === a7.charAt(j7 - 2)) {
          matrix[i7][j7] = matrix[i7 - 2][j7 - 2] + 1;
        } else {
          matrix[i7][j7] = Math.min(matrix[i7 - 1][j7 - 1] + 1, Math.min(matrix[i7][j7 - 1] + 1, matrix[i7 - 1][j7] + 1));
        }
      }
    }
  }
  return matrix[b11.length][a7.length];
}
var init_levenshtein = __esm({
  "../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/utils/levenshtein.js"() {
    init_import_meta_url();
    __name(levenshtein, "levenshtein");
  }
});

// ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/validation.js
function validation(yargs, usage2, shim3) {
  const __ = shim3.y18n.__;
  const __n = shim3.y18n.__n;
  const self2 = {};
  self2.nonOptionCount = /* @__PURE__ */ __name(function nonOptionCount(argv) {
    const demandedCommands = yargs.getDemandedCommands();
    const positionalCount = argv._.length + (argv["--"] ? argv["--"].length : 0);
    const _s2 = positionalCount - yargs.getInternalMethods().getContext().commands.length;
    if (demandedCommands._ && (_s2 < demandedCommands._.min || _s2 > demandedCommands._.max)) {
      if (_s2 < demandedCommands._.min) {
        if (demandedCommands._.minMsg !== void 0) {
          usage2.fail(demandedCommands._.minMsg ? demandedCommands._.minMsg.replace(/\$0/g, _s2.toString()).replace(/\$1/, demandedCommands._.min.toString()) : null);
        } else {
          usage2.fail(__n("Not enough non-option arguments: got %s, need at least %s", "Not enough non-option arguments: got %s, need at least %s", _s2, _s2.toString(), demandedCommands._.min.toString()));
        }
      } else if (_s2 > demandedCommands._.max) {
        if (demandedCommands._.maxMsg !== void 0) {
          usage2.fail(demandedCommands._.maxMsg ? demandedCommands._.maxMsg.replace(/\$0/g, _s2.toString()).replace(/\$1/, demandedCommands._.max.toString()) : null);
        } else {
          usage2.fail(__n("Too many non-option arguments: got %s, maximum of %s", "Too many non-option arguments: got %s, maximum of %s", _s2, _s2.toString(), demandedCommands._.max.toString()));
        }
      }
    }
  }, "nonOptionCount");
  self2.positionalCount = /* @__PURE__ */ __name(function positionalCount(required, observed) {
    if (observed < required) {
      usage2.fail(__n("Not enough non-option arguments: got %s, need at least %s", "Not enough non-option arguments: got %s, need at least %s", observed, observed + "", required + ""));
    }
  }, "positionalCount");
  self2.requiredArguments = /* @__PURE__ */ __name(function requiredArguments(argv, demandedOptions) {
    let missing = null;
    for (const key of Object.keys(demandedOptions)) {
      if (!Object.prototype.hasOwnProperty.call(argv, key) || typeof argv[key] === "undefined") {
        missing = missing || {};
        missing[key] = demandedOptions[key];
      }
    }
    if (missing) {
      const customMsgs = [];
      for (const key of Object.keys(missing)) {
        const msg = missing[key];
        if (msg && customMsgs.indexOf(msg) < 0) {
          customMsgs.push(msg);
        }
      }
      const customMsg = customMsgs.length ? `
${customMsgs.join("\n")}` : "";
      usage2.fail(__n("Missing required argument: %s", "Missing required arguments: %s", Object.keys(missing).length, Object.keys(missing).join(", ") + customMsg));
    }
  }, "requiredArguments");
  self2.unknownArguments = /* @__PURE__ */ __name(function unknownArguments(argv, aliases2, positionalMap, isDefaultCommand, checkPositionals = true) {
    var _a5;
    const commandKeys = yargs.getInternalMethods().getCommandInstance().getCommands();
    const unknown = [];
    const currentContext = yargs.getInternalMethods().getContext();
    Object.keys(argv).forEach((key) => {
      if (!specialKeys.includes(key) && !Object.prototype.hasOwnProperty.call(positionalMap, key) && !Object.prototype.hasOwnProperty.call(yargs.getInternalMethods().getParseContext(), key) && !self2.isValidAndSomeAliasIsNotNew(key, aliases2)) {
        unknown.push(key);
      }
    });
    if (checkPositionals && (currentContext.commands.length > 0 || commandKeys.length > 0 || isDefaultCommand)) {
      argv._.slice(currentContext.commands.length).forEach((key) => {
        if (!commandKeys.includes("" + key)) {
          unknown.push("" + key);
        }
      });
    }
    if (checkPositionals) {
      const demandedCommands = yargs.getDemandedCommands();
      const maxNonOptDemanded = ((_a5 = demandedCommands._) === null || _a5 === void 0 ? void 0 : _a5.max) || 0;
      const expected = currentContext.commands.length + maxNonOptDemanded;
      if (expected < argv._.length) {
        argv._.slice(expected).forEach((key) => {
          key = String(key);
          if (!currentContext.commands.includes(key) && !unknown.includes(key)) {
            unknown.push(key);
          }
        });
      }
    }
    if (unknown.length) {
      usage2.fail(__n("Unknown argument: %s", "Unknown arguments: %s", unknown.length, unknown.map((s7) => s7.trim() ? s7 : `"${s7}"`).join(", ")));
    }
  }, "unknownArguments");
  self2.unknownCommands = /* @__PURE__ */ __name(function unknownCommands(argv) {
    const commandKeys = yargs.getInternalMethods().getCommandInstance().getCommands();
    const unknown = [];
    const currentContext = yargs.getInternalMethods().getContext();
    if (currentContext.commands.length > 0 || commandKeys.length > 0) {
      argv._.slice(currentContext.commands.length).forEach((key) => {
        if (!commandKeys.includes("" + key)) {
          unknown.push("" + key);
        }
      });
    }
    if (unknown.length > 0) {
      usage2.fail(__n("Unknown command: %s", "Unknown commands: %s", unknown.length, unknown.join(", ")));
      return true;
    } else {
      return false;
    }
  }, "unknownCommands");
  self2.isValidAndSomeAliasIsNotNew = /* @__PURE__ */ __name(function isValidAndSomeAliasIsNotNew(key, aliases2) {
    if (!Object.prototype.hasOwnProperty.call(aliases2, key)) {
      return false;
    }
    const newAliases = yargs.parsed.newAliases;
    return [key, ...aliases2[key]].some((a7) => !Object.prototype.hasOwnProperty.call(newAliases, a7) || !newAliases[key]);
  }, "isValidAndSomeAliasIsNotNew");
  self2.limitedChoices = /* @__PURE__ */ __name(function limitedChoices(argv) {
    const options = yargs.getOptions();
    const invalid = {};
    if (!Object.keys(options.choices).length)
      return;
    Object.keys(argv).forEach((key) => {
      if (specialKeys.indexOf(key) === -1 && Object.prototype.hasOwnProperty.call(options.choices, key)) {
        [].concat(argv[key]).forEach((value) => {
          if (options.choices[key].indexOf(value) === -1 && value !== void 0) {
            invalid[key] = (invalid[key] || []).concat(value);
          }
        });
      }
    });
    const invalidKeys = Object.keys(invalid);
    if (!invalidKeys.length)
      return;
    let msg = __("Invalid values:");
    invalidKeys.forEach((key) => {
      msg += `
  ${__("Argument: %s, Given: %s, Choices: %s", key, usage2.stringifiedValues(invalid[key]), usage2.stringifiedValues(options.choices[key]))}`;
    });
    usage2.fail(msg);
  }, "limitedChoices");
  let implied = {};
  self2.implies = /* @__PURE__ */ __name(function implies(key, value) {
    argsert("<string|object> [array|number|string]", [key, value], arguments.length);
    if (typeof key === "object") {
      Object.keys(key).forEach((k7) => {
        self2.implies(k7, key[k7]);
      });
    } else {
      yargs.global(key);
      if (!implied[key]) {
        implied[key] = [];
      }
      if (Array.isArray(value)) {
        value.forEach((i7) => self2.implies(key, i7));
      } else {
        assertNotStrictEqual(value, void 0, shim3);
        implied[key].push(value);
      }
    }
  }, "implies");
  self2.getImplied = /* @__PURE__ */ __name(function getImplied() {
    return implied;
  }, "getImplied");
  function keyExists(argv, val2) {
    const num = Number(val2);
    val2 = isNaN(num) ? val2 : num;
    if (typeof val2 === "number") {
      val2 = argv._.length >= val2;
    } else if (val2.match(/^--no-.+/)) {
      val2 = val2.match(/^--no-(.+)/)[1];
      val2 = !Object.prototype.hasOwnProperty.call(argv, val2);
    } else {
      val2 = Object.prototype.hasOwnProperty.call(argv, val2);
    }
    return val2;
  }
  __name(keyExists, "keyExists");
  self2.implications = /* @__PURE__ */ __name(function implications(argv) {
    const implyFail = [];
    Object.keys(implied).forEach((key) => {
      const origKey = key;
      (implied[key] || []).forEach((value) => {
        let key2 = origKey;
        const origValue = value;
        key2 = keyExists(argv, key2);
        value = keyExists(argv, value);
        if (key2 && !value) {
          implyFail.push(` ${origKey} -> ${origValue}`);
        }
      });
    });
    if (implyFail.length) {
      let msg = `${__("Implications failed:")}
`;
      implyFail.forEach((value) => {
        msg += value;
      });
      usage2.fail(msg);
    }
  }, "implications");
  let conflicting = {};
  self2.conflicts = /* @__PURE__ */ __name(function conflicts(key, value) {
    argsert("<string|object> [array|string]", [key, value], arguments.length);
    if (typeof key === "object") {
      Object.keys(key).forEach((k7) => {
        self2.conflicts(k7, key[k7]);
      });
    } else {
      yargs.global(key);
      if (!conflicting[key]) {
        conflicting[key] = [];
      }
      if (Array.isArray(value)) {
        value.forEach((i7) => self2.conflicts(key, i7));
      } else {
        conflicting[key].push(value);
      }
    }
  }, "conflicts");
  self2.getConflicting = () => conflicting;
  self2.conflicting = /* @__PURE__ */ __name(function conflictingFn(argv) {
    Object.keys(argv).forEach((key) => {
      if (conflicting[key]) {
        conflicting[key].forEach((value) => {
          if (value && argv[key] !== void 0 && argv[value] !== void 0) {
            usage2.fail(__("Arguments %s and %s are mutually exclusive", key, value));
          }
        });
      }
    });
    if (yargs.getInternalMethods().getParserConfiguration()["strip-dashed"]) {
      Object.keys(conflicting).forEach((key) => {
        conflicting[key].forEach((value) => {
          if (value && argv[shim3.Parser.camelCase(key)] !== void 0 && argv[shim3.Parser.camelCase(value)] !== void 0) {
            usage2.fail(__("Arguments %s and %s are mutually exclusive", key, value));
          }
        });
      });
    }
  }, "conflictingFn");
  self2.recommendCommands = /* @__PURE__ */ __name(function recommendCommands(cmd, potentialCommands) {
    const threshold = 3;
    potentialCommands = potentialCommands.sort((a7, b11) => b11.length - a7.length);
    let recommended = null;
    let bestDistance = Infinity;
    for (let i7 = 0, candidate; (candidate = potentialCommands[i7]) !== void 0; i7++) {
      const d8 = levenshtein(cmd, candidate);
      if (d8 <= threshold && d8 < bestDistance) {
        bestDistance = d8;
        recommended = candidate;
      }
    }
    if (recommended)
      usage2.fail(__("Did you mean %s?", recommended));
  }, "recommendCommands");
  self2.reset = /* @__PURE__ */ __name(function reset(localLookup) {
    implied = objFilter(implied, (k7) => !localLookup[k7]);
    conflicting = objFilter(conflicting, (k7) => !localLookup[k7]);
    return self2;
  }, "reset");
  const frozens = [];
  self2.freeze = /* @__PURE__ */ __name(function freeze() {
    frozens.push({
      implied,
      conflicting
    });
  }, "freeze");
  self2.unfreeze = /* @__PURE__ */ __name(function unfreeze() {
    const frozen = frozens.pop();
    assertNotStrictEqual(frozen, void 0, shim3);
    ({ implied, conflicting } = frozen);
  }, "unfreeze");
  return self2;
}
var specialKeys;
var init_validation = __esm({
  "../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/validation.js"() {
    init_import_meta_url();
    init_argsert();
    init_common_types();
    init_levenshtein();
    init_obj_filter();
    specialKeys = ["$0", "--", "_"];
    __name(validation, "validation");
  }
});

// ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/yargs-factory.js
function YargsFactory(_shim) {
  return (processArgs = [], cwd2 = _shim.process.cwd(), parentRequire) => {
    const yargs = new YargsInstance(processArgs, cwd2, parentRequire, _shim);
    Object.defineProperty(yargs, "argv", {
      get: /* @__PURE__ */ __name(() => {
        return yargs.parse();
      }, "get"),
      enumerable: true
    });
    yargs.help();
    yargs.version();
    return yargs;
  };
}
function isYargsInstance(y5) {
  return !!y5 && typeof y5.getInternalMethods === "function";
}
var __classPrivateFieldSet6, __classPrivateFieldGet8, _YargsInstance_command, _YargsInstance_cwd, _YargsInstance_context, _YargsInstance_completion, _YargsInstance_completionCommand, _YargsInstance_defaultShowHiddenOpt, _YargsInstance_exitError, _YargsInstance_detectLocale, _YargsInstance_emittedWarnings, _YargsInstance_exitProcess, _YargsInstance_frozens, _YargsInstance_globalMiddleware, _YargsInstance_groups, _YargsInstance_hasOutput, _YargsInstance_helpOpt, _YargsInstance_isGlobalContext, _YargsInstance_logger, _YargsInstance_output, _YargsInstance_options, _YargsInstance_parentRequire, _YargsInstance_parserConfig, _YargsInstance_parseFn, _YargsInstance_parseContext, _YargsInstance_pkgs, _YargsInstance_preservedGroups, _YargsInstance_processArgs, _YargsInstance_recommendCommands, _YargsInstance_shim, _YargsInstance_strict, _YargsInstance_strictCommands, _YargsInstance_strictOptions, _YargsInstance_usage, _YargsInstance_usageConfig, _YargsInstance_versionOpt, _YargsInstance_validation, kCopyDoubleDash, kCreateLogger, kDeleteFromParserHintObject, kEmitWarning, kFreeze, kGetDollarZero, kGetParserConfiguration, kGetUsageConfiguration, kGuessLocale, kGuessVersion, kParsePositionalNumbers, kPkgUp, kPopulateParserHintArray, kPopulateParserHintSingleValueDictionary, kPopulateParserHintArrayDictionary, kPopulateParserHintDictionary, kSanitizeKey, kSetKey, kUnfreeze, kValidateAsync, kGetCommandInstance, kGetContext, kGetHasOutput, kGetLoggerInstance, kGetParseContext, kGetUsageInstance, kGetValidationInstance, kHasParseCallback, kIsGlobalContext, kPostProcess, kRebase, kReset, kRunYargsParserAndExecuteCommands, kRunValidation, kSetHasOutput, kTrackManuallySetKeys, YargsInstance;
var init_yargs_factory = __esm({
  "../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/yargs-factory.js"() {
    init_import_meta_url();
    init_command2();
    init_common_types();
    init_yerror();
    init_usage();
    init_argsert();
    init_completion();
    init_validation();
    init_obj_filter();
    init_apply_extends();
    init_middleware();
    init_is_promise();
    init_maybe_async_result();
    init_set_blocking();
    __classPrivateFieldSet6 = function(receiver, state2, value, kind2, f8) {
      if (kind2 === "m") throw new TypeError("Private method is not writable");
      if (kind2 === "a" && !f8) throw new TypeError("Private accessor was defined without a setter");
      if (typeof state2 === "function" ? receiver !== state2 || !f8 : !state2.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
      return kind2 === "a" ? f8.call(receiver, value) : f8 ? f8.value = value : state2.set(receiver, value), value;
    };
    __classPrivateFieldGet8 = function(receiver, state2, kind2, f8) {
      if (kind2 === "a" && !f8) throw new TypeError("Private accessor was defined without a getter");
      if (typeof state2 === "function" ? receiver !== state2 || !f8 : !state2.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
      return kind2 === "m" ? f8 : kind2 === "a" ? f8.call(receiver) : f8 ? f8.value : state2.get(receiver);
    };
    __name(YargsFactory, "YargsFactory");
    kCopyDoubleDash = Symbol("copyDoubleDash");
    kCreateLogger = Symbol("copyDoubleDash");
    kDeleteFromParserHintObject = Symbol("deleteFromParserHintObject");
    kEmitWarning = Symbol("emitWarning");
    kFreeze = Symbol("freeze");
    kGetDollarZero = Symbol("getDollarZero");
    kGetParserConfiguration = Symbol("getParserConfiguration");
    kGetUsageConfiguration = Symbol("getUsageConfiguration");
    kGuessLocale = Symbol("guessLocale");
    kGuessVersion = Symbol("guessVersion");
    kParsePositionalNumbers = Symbol("parsePositionalNumbers");
    kPkgUp = Symbol("pkgUp");
    kPopulateParserHintArray = Symbol("populateParserHintArray");
    kPopulateParserHintSingleValueDictionary = Symbol("populateParserHintSingleValueDictionary");
    kPopulateParserHintArrayDictionary = Symbol("populateParserHintArrayDictionary");
    kPopulateParserHintDictionary = Symbol("populateParserHintDictionary");
    kSanitizeKey = Symbol("sanitizeKey");
    kSetKey = Symbol("setKey");
    kUnfreeze = Symbol("unfreeze");
    kValidateAsync = Symbol("validateAsync");
    kGetCommandInstance = Symbol("getCommandInstance");
    kGetContext = Symbol("getContext");
    kGetHasOutput = Symbol("getHasOutput");
    kGetLoggerInstance = Symbol("getLoggerInstance");
    kGetParseContext = Symbol("getParseContext");
    kGetUsageInstance = Symbol("getUsageInstance");
    kGetValidationInstance = Symbol("getValidationInstance");
    kHasParseCallback = Symbol("hasParseCallback");
    kIsGlobalContext = Symbol("isGlobalContext");
    kPostProcess = Symbol("postProcess");
    kRebase = Symbol("rebase");
    kReset = Symbol("reset");
    kRunYargsParserAndExecuteCommands = Symbol("runYargsParserAndExecuteCommands");
    kRunValidation = Symbol("runValidation");
    kSetHasOutput = Symbol("setHasOutput");
    kTrackManuallySetKeys = Symbol("kTrackManuallySetKeys");
    YargsInstance = class {
      static {
        __name(this, "YargsInstance");
      }
      constructor(processArgs = [], cwd2, parentRequire, shim3) {
        this.customScriptName = false;
        this.parsed = false;
        _YargsInstance_command.set(this, void 0);
        _YargsInstance_cwd.set(this, void 0);
        _YargsInstance_context.set(this, { commands: [], fullCommands: [] });
        _YargsInstance_completion.set(this, null);
        _YargsInstance_completionCommand.set(this, null);
        _YargsInstance_defaultShowHiddenOpt.set(this, "show-hidden");
        _YargsInstance_exitError.set(this, null);
        _YargsInstance_detectLocale.set(this, true);
        _YargsInstance_emittedWarnings.set(this, {});
        _YargsInstance_exitProcess.set(this, true);
        _YargsInstance_frozens.set(this, []);
        _YargsInstance_globalMiddleware.set(this, void 0);
        _YargsInstance_groups.set(this, {});
        _YargsInstance_hasOutput.set(this, false);
        _YargsInstance_helpOpt.set(this, null);
        _YargsInstance_isGlobalContext.set(this, true);
        _YargsInstance_logger.set(this, void 0);
        _YargsInstance_output.set(this, "");
        _YargsInstance_options.set(this, void 0);
        _YargsInstance_parentRequire.set(this, void 0);
        _YargsInstance_parserConfig.set(this, {});
        _YargsInstance_parseFn.set(this, null);
        _YargsInstance_parseContext.set(this, null);
        _YargsInstance_pkgs.set(this, {});
        _YargsInstance_preservedGroups.set(this, {});
        _YargsInstance_processArgs.set(this, void 0);
        _YargsInstance_recommendCommands.set(this, false);
        _YargsInstance_shim.set(this, void 0);
        _YargsInstance_strict.set(this, false);
        _YargsInstance_strictCommands.set(this, false);
        _YargsInstance_strictOptions.set(this, false);
        _YargsInstance_usage.set(this, void 0);
        _YargsInstance_usageConfig.set(this, {});
        _YargsInstance_versionOpt.set(this, null);
        _YargsInstance_validation.set(this, void 0);
        __classPrivateFieldSet6(this, _YargsInstance_shim, shim3, "f");
        __classPrivateFieldSet6(this, _YargsInstance_processArgs, processArgs, "f");
        __classPrivateFieldSet6(this, _YargsInstance_cwd, cwd2, "f");
        __classPrivateFieldSet6(this, _YargsInstance_parentRequire, parentRequire, "f");
        __classPrivateFieldSet6(this, _YargsInstance_globalMiddleware, new GlobalMiddleware(this), "f");
        this.$0 = this[kGetDollarZero]();
        this[kReset]();
        __classPrivateFieldSet6(this, _YargsInstance_command, __classPrivateFieldGet8(this, _YargsInstance_command, "f"), "f");
        __classPrivateFieldSet6(this, _YargsInstance_usage, __classPrivateFieldGet8(this, _YargsInstance_usage, "f"), "f");
        __classPrivateFieldSet6(this, _YargsInstance_validation, __classPrivateFieldGet8(this, _YargsInstance_validation, "f"), "f");
        __classPrivateFieldSet6(this, _YargsInstance_options, __classPrivateFieldGet8(this, _YargsInstance_options, "f"), "f");
        __classPrivateFieldGet8(this, _YargsInstance_options, "f").showHiddenOpt = __classPrivateFieldGet8(this, _YargsInstance_defaultShowHiddenOpt, "f");
        __classPrivateFieldSet6(this, _YargsInstance_logger, this[kCreateLogger](), "f");
      }
      addHelpOpt(opt, msg) {
        const defaultHelpOpt = "help";
        argsert("[string|boolean] [string]", [opt, msg], arguments.length);
        if (__classPrivateFieldGet8(this, _YargsInstance_helpOpt, "f")) {
          this[kDeleteFromParserHintObject](__classPrivateFieldGet8(this, _YargsInstance_helpOpt, "f"));
          __classPrivateFieldSet6(this, _YargsInstance_helpOpt, null, "f");
        }
        if (opt === false && msg === void 0)
          return this;
        __classPrivateFieldSet6(this, _YargsInstance_helpOpt, typeof opt === "string" ? opt : defaultHelpOpt, "f");
        this.boolean(__classPrivateFieldGet8(this, _YargsInstance_helpOpt, "f"));
        this.describe(__classPrivateFieldGet8(this, _YargsInstance_helpOpt, "f"), msg || __classPrivateFieldGet8(this, _YargsInstance_usage, "f").deferY18nLookup("Show help"));
        return this;
      }
      help(opt, msg) {
        return this.addHelpOpt(opt, msg);
      }
      addShowHiddenOpt(opt, msg) {
        argsert("[string|boolean] [string]", [opt, msg], arguments.length);
        if (opt === false && msg === void 0)
          return this;
        const showHiddenOpt = typeof opt === "string" ? opt : __classPrivateFieldGet8(this, _YargsInstance_defaultShowHiddenOpt, "f");
        this.boolean(showHiddenOpt);
        this.describe(showHiddenOpt, msg || __classPrivateFieldGet8(this, _YargsInstance_usage, "f").deferY18nLookup("Show hidden options"));
        __classPrivateFieldGet8(this, _YargsInstance_options, "f").showHiddenOpt = showHiddenOpt;
        return this;
      }
      showHidden(opt, msg) {
        return this.addShowHiddenOpt(opt, msg);
      }
      alias(key, value) {
        argsert("<object|string|array> [string|array]", [key, value], arguments.length);
        this[kPopulateParserHintArrayDictionary](this.alias.bind(this), "alias", key, value);
        return this;
      }
      array(keys) {
        argsert("<array|string>", [keys], arguments.length);
        this[kPopulateParserHintArray]("array", keys);
        this[kTrackManuallySetKeys](keys);
        return this;
      }
      boolean(keys) {
        argsert("<array|string>", [keys], arguments.length);
        this[kPopulateParserHintArray]("boolean", keys);
        this[kTrackManuallySetKeys](keys);
        return this;
      }
      check(f8, global2) {
        argsert("<function> [boolean]", [f8, global2], arguments.length);
        this.middleware((argv, _yargs) => {
          return maybeAsyncResult(() => {
            return f8(argv, _yargs.getOptions());
          }, (result) => {
            if (!result) {
              __classPrivateFieldGet8(this, _YargsInstance_usage, "f").fail(__classPrivateFieldGet8(this, _YargsInstance_shim, "f").y18n.__("Argument check failed: %s", f8.toString()));
            } else if (typeof result === "string" || result instanceof Error) {
              __classPrivateFieldGet8(this, _YargsInstance_usage, "f").fail(result.toString(), result);
            }
            return argv;
          }, (err) => {
            __classPrivateFieldGet8(this, _YargsInstance_usage, "f").fail(err.message ? err.message : err.toString(), err);
            return argv;
          });
        }, false, global2);
        return this;
      }
      choices(key, value) {
        argsert("<object|string|array> [string|array]", [key, value], arguments.length);
        this[kPopulateParserHintArrayDictionary](this.choices.bind(this), "choices", key, value);
        return this;
      }
      coerce(keys, value) {
        argsert("<object|string|array> [function]", [keys, value], arguments.length);
        if (Array.isArray(keys)) {
          if (!value) {
            throw new YError("coerce callback must be provided");
          }
          for (const key of keys) {
            this.coerce(key, value);
          }
          return this;
        } else if (typeof keys === "object") {
          for (const key of Object.keys(keys)) {
            this.coerce(key, keys[key]);
          }
          return this;
        }
        if (!value) {
          throw new YError("coerce callback must be provided");
        }
        __classPrivateFieldGet8(this, _YargsInstance_options, "f").key[keys] = true;
        __classPrivateFieldGet8(this, _YargsInstance_globalMiddleware, "f").addCoerceMiddleware((argv, yargs) => {
          let aliases2;
          const shouldCoerce = Object.prototype.hasOwnProperty.call(argv, keys);
          if (!shouldCoerce) {
            return argv;
          }
          return maybeAsyncResult(() => {
            aliases2 = yargs.getAliases();
            return value(argv[keys]);
          }, (result) => {
            argv[keys] = result;
            const stripAliased = yargs.getInternalMethods().getParserConfiguration()["strip-aliased"];
            if (aliases2[keys] && stripAliased !== true) {
              for (const alias of aliases2[keys]) {
                argv[alias] = result;
              }
            }
            return argv;
          }, (err) => {
            throw new YError(err.message);
          });
        }, keys);
        return this;
      }
      conflicts(key1, key2) {
        argsert("<string|object> [string|array]", [key1, key2], arguments.length);
        __classPrivateFieldGet8(this, _YargsInstance_validation, "f").conflicts(key1, key2);
        return this;
      }
      config(key = "config", msg, parseFn) {
        argsert("[object|string] [string|function] [function]", [key, msg, parseFn], arguments.length);
        if (typeof key === "object" && !Array.isArray(key)) {
          key = applyExtends(key, __classPrivateFieldGet8(this, _YargsInstance_cwd, "f"), this[kGetParserConfiguration]()["deep-merge-config"] || false, __classPrivateFieldGet8(this, _YargsInstance_shim, "f"));
          __classPrivateFieldGet8(this, _YargsInstance_options, "f").configObjects = (__classPrivateFieldGet8(this, _YargsInstance_options, "f").configObjects || []).concat(key);
          return this;
        }
        if (typeof msg === "function") {
          parseFn = msg;
          msg = void 0;
        }
        this.describe(key, msg || __classPrivateFieldGet8(this, _YargsInstance_usage, "f").deferY18nLookup("Path to JSON config file"));
        (Array.isArray(key) ? key : [key]).forEach((k7) => {
          __classPrivateFieldGet8(this, _YargsInstance_options, "f").config[k7] = parseFn || true;
        });
        return this;
      }
      completion(cmd, desc, fn2) {
        argsert("[string] [string|boolean|function] [function]", [cmd, desc, fn2], arguments.length);
        if (typeof desc === "function") {
          fn2 = desc;
          desc = void 0;
        }
        __classPrivateFieldSet6(this, _YargsInstance_completionCommand, cmd || __classPrivateFieldGet8(this, _YargsInstance_completionCommand, "f") || "completion", "f");
        if (!desc && desc !== false) {
          desc = "generate completion script";
        }
        this.command(__classPrivateFieldGet8(this, _YargsInstance_completionCommand, "f"), desc);
        if (fn2)
          __classPrivateFieldGet8(this, _YargsInstance_completion, "f").registerFunction(fn2);
        return this;
      }
      command(cmd, description, builder, handler, middlewares, deprecated3) {
        argsert("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]", [cmd, description, builder, handler, middlewares, deprecated3], arguments.length);
        __classPrivateFieldGet8(this, _YargsInstance_command, "f").addHandler(cmd, description, builder, handler, middlewares, deprecated3);
        return this;
      }
      commands(cmd, description, builder, handler, middlewares, deprecated3) {
        return this.command(cmd, description, builder, handler, middlewares, deprecated3);
      }
      commandDir(dir2, opts) {
        argsert("<string> [object]", [dir2, opts], arguments.length);
        const req = __classPrivateFieldGet8(this, _YargsInstance_parentRequire, "f") || __classPrivateFieldGet8(this, _YargsInstance_shim, "f").require;
        __classPrivateFieldGet8(this, _YargsInstance_command, "f").addDirectory(dir2, req, __classPrivateFieldGet8(this, _YargsInstance_shim, "f").getCallerFile(), opts);
        return this;
      }
      count(keys) {
        argsert("<array|string>", [keys], arguments.length);
        this[kPopulateParserHintArray]("count", keys);
        this[kTrackManuallySetKeys](keys);
        return this;
      }
      default(key, value, defaultDescription) {
        argsert("<object|string|array> [*] [string]", [key, value, defaultDescription], arguments.length);
        if (defaultDescription) {
          assertSingleKey(key, __classPrivateFieldGet8(this, _YargsInstance_shim, "f"));
          __classPrivateFieldGet8(this, _YargsInstance_options, "f").defaultDescription[key] = defaultDescription;
        }
        if (typeof value === "function") {
          assertSingleKey(key, __classPrivateFieldGet8(this, _YargsInstance_shim, "f"));
          if (!__classPrivateFieldGet8(this, _YargsInstance_options, "f").defaultDescription[key])
            __classPrivateFieldGet8(this, _YargsInstance_options, "f").defaultDescription[key] = __classPrivateFieldGet8(this, _YargsInstance_usage, "f").functionDescription(value);
          value = value.call();
        }
        this[kPopulateParserHintSingleValueDictionary](this.default.bind(this), "default", key, value);
        return this;
      }
      defaults(key, value, defaultDescription) {
        return this.default(key, value, defaultDescription);
      }
      demandCommand(min = 1, max, minMsg, maxMsg) {
        argsert("[number] [number|string] [string|null|undefined] [string|null|undefined]", [min, max, minMsg, maxMsg], arguments.length);
        if (typeof max !== "number") {
          minMsg = max;
          max = Infinity;
        }
        this.global("_", false);
        __classPrivateFieldGet8(this, _YargsInstance_options, "f").demandedCommands._ = {
          min,
          max,
          minMsg,
          maxMsg
        };
        return this;
      }
      demand(keys, max, msg) {
        if (Array.isArray(max)) {
          max.forEach((key) => {
            assertNotStrictEqual(msg, true, __classPrivateFieldGet8(this, _YargsInstance_shim, "f"));
            this.demandOption(key, msg);
          });
          max = Infinity;
        } else if (typeof max !== "number") {
          msg = max;
          max = Infinity;
        }
        if (typeof keys === "number") {
          assertNotStrictEqual(msg, true, __classPrivateFieldGet8(this, _YargsInstance_shim, "f"));
          this.demandCommand(keys, max, msg, msg);
        } else if (Array.isArray(keys)) {
          keys.forEach((key) => {
            assertNotStrictEqual(msg, true, __classPrivateFieldGet8(this, _YargsInstance_shim, "f"));
            this.demandOption(key, msg);
          });
        } else {
          if (typeof msg === "string") {
            this.demandOption(keys, msg);
          } else if (msg === true || typeof msg === "undefined") {
            this.demandOption(keys);
          }
        }
        return this;
      }
      demandOption(keys, msg) {
        argsert("<object|string|array> [string]", [keys, msg], arguments.length);
        this[kPopulateParserHintSingleValueDictionary](this.demandOption.bind(this), "demandedOptions", keys, msg);
        return this;
      }
      deprecateOption(option, message) {
        argsert("<string> [string|boolean]", [option, message], arguments.length);
        __classPrivateFieldGet8(this, _YargsInstance_options, "f").deprecatedOptions[option] = message;
        return this;
      }
      describe(keys, description) {
        argsert("<object|string|array> [string]", [keys, description], arguments.length);
        this[kSetKey](keys, true);
        __classPrivateFieldGet8(this, _YargsInstance_usage, "f").describe(keys, description);
        return this;
      }
      detectLocale(detect) {
        argsert("<boolean>", [detect], arguments.length);
        __classPrivateFieldSet6(this, _YargsInstance_detectLocale, detect, "f");
        return this;
      }
      env(prefix) {
        argsert("[string|boolean]", [prefix], arguments.length);
        if (prefix === false)
          delete __classPrivateFieldGet8(this, _YargsInstance_options, "f").envPrefix;
        else
          __classPrivateFieldGet8(this, _YargsInstance_options, "f").envPrefix = prefix || "";
        return this;
      }
      epilogue(msg) {
        argsert("<string>", [msg], arguments.length);
        __classPrivateFieldGet8(this, _YargsInstance_usage, "f").epilog(msg);
        return this;
      }
      epilog(msg) {
        return this.epilogue(msg);
      }
      example(cmd, description) {
        argsert("<string|array> [string]", [cmd, description], arguments.length);
        if (Array.isArray(cmd)) {
          cmd.forEach((exampleParams) => this.example(...exampleParams));
        } else {
          __classPrivateFieldGet8(this, _YargsInstance_usage, "f").example(cmd, description);
        }
        return this;
      }
      exit(code, err) {
        __classPrivateFieldSet6(this, _YargsInstance_hasOutput, true, "f");
        __classPrivateFieldSet6(this, _YargsInstance_exitError, err, "f");
        if (__classPrivateFieldGet8(this, _YargsInstance_exitProcess, "f"))
          __classPrivateFieldGet8(this, _YargsInstance_shim, "f").process.exit(code);
      }
      exitProcess(enabled = true) {
        argsert("[boolean]", [enabled], arguments.length);
        __classPrivateFieldSet6(this, _YargsInstance_exitProcess, enabled, "f");
        return this;
      }
      fail(f8) {
        argsert("<function|boolean>", [f8], arguments.length);
        if (typeof f8 === "boolean" && f8 !== false) {
          throw new YError("Invalid first argument. Expected function or boolean 'false'");
        }
        __classPrivateFieldGet8(this, _YargsInstance_usage, "f").failFn(f8);
        return this;
      }
      getAliases() {
        return this.parsed ? this.parsed.aliases : {};
      }
      async getCompletion(args, done) {
        argsert("<array> [function]", [args, done], arguments.length);
        if (!done) {
          return new Promise((resolve32, reject) => {
            __classPrivateFieldGet8(this, _YargsInstance_completion, "f").getCompletion(args, (err, completions) => {
              if (err)
                reject(err);
              else
                resolve32(completions);
            });
          });
        } else {
          return __classPrivateFieldGet8(this, _YargsInstance_completion, "f").getCompletion(args, done);
        }
      }
      getDemandedOptions() {
        argsert([], 0);
        return __classPrivateFieldGet8(this, _YargsInstance_options, "f").demandedOptions;
      }
      getDemandedCommands() {
        argsert([], 0);
        return __classPrivateFieldGet8(this, _YargsInstance_options, "f").demandedCommands;
      }
      getDeprecatedOptions() {
        argsert([], 0);
        return __classPrivateFieldGet8(this, _YargsInstance_options, "f").deprecatedOptions;
      }
      getDetectLocale() {
        return __classPrivateFieldGet8(this, _YargsInstance_detectLocale, "f");
      }
      getExitProcess() {
        return __classPrivateFieldGet8(this, _YargsInstance_exitProcess, "f");
      }
      getGroups() {
        return Object.assign({}, __classPrivateFieldGet8(this, _YargsInstance_groups, "f"), __classPrivateFieldGet8(this, _YargsInstance_preservedGroups, "f"));
      }
      getHelp() {
        __classPrivateFieldSet6(this, _YargsInstance_hasOutput, true, "f");
        if (!__classPrivateFieldGet8(this, _YargsInstance_usage, "f").hasCachedHelpMessage()) {
          if (!this.parsed) {
            const parse17 = this[kRunYargsParserAndExecuteCommands](__classPrivateFieldGet8(this, _YargsInstance_processArgs, "f"), void 0, void 0, 0, true);
            if (isPromise(parse17)) {
              return parse17.then(() => {
                return __classPrivateFieldGet8(this, _YargsInstance_usage, "f").help();
              });
            }
          }
          const builderResponse = __classPrivateFieldGet8(this, _YargsInstance_command, "f").runDefaultBuilderOn(this);
          if (isPromise(builderResponse)) {
            return builderResponse.then(() => {
              return __classPrivateFieldGet8(this, _YargsInstance_usage, "f").help();
            });
          }
        }
        return Promise.resolve(__classPrivateFieldGet8(this, _YargsInstance_usage, "f").help());
      }
      getOptions() {
        return __classPrivateFieldGet8(this, _YargsInstance_options, "f");
      }
      getStrict() {
        return __classPrivateFieldGet8(this, _YargsInstance_strict, "f");
      }
      getStrictCommands() {
        return __classPrivateFieldGet8(this, _YargsInstance_strictCommands, "f");
      }
      getStrictOptions() {
        return __classPrivateFieldGet8(this, _YargsInstance_strictOptions, "f");
      }
      global(globals, global2) {
        argsert("<string|array> [boolean]", [globals, global2], arguments.length);
        globals = [].concat(globals);
        if (global2 !== false) {
          __classPrivateFieldGet8(this, _YargsInstance_options, "f").local = __classPrivateFieldGet8(this, _YargsInstance_options, "f").local.filter((l8) => globals.indexOf(l8) === -1);
        } else {
          globals.forEach((g7) => {
            if (!__classPrivateFieldGet8(this, _YargsInstance_options, "f").local.includes(g7))
              __classPrivateFieldGet8(this, _YargsInstance_options, "f").local.push(g7);
          });
        }
        return this;
      }
      group(opts, groupName) {
        argsert("<string|array> <string>", [opts, groupName], arguments.length);
        const existing = __classPrivateFieldGet8(this, _YargsInstance_preservedGroups, "f")[groupName] || __classPrivateFieldGet8(this, _YargsInstance_groups, "f")[groupName];
        if (__classPrivateFieldGet8(this, _YargsInstance_preservedGroups, "f")[groupName]) {
          delete __classPrivateFieldGet8(this, _YargsInstance_preservedGroups, "f")[groupName];
        }
        const seen = {};
        __classPrivateFieldGet8(this, _YargsInstance_groups, "f")[groupName] = (existing || []).concat(opts).filter((key) => {
          if (seen[key])
            return false;
          return seen[key] = true;
        });
        return this;
      }
      hide(key) {
        argsert("<string>", [key], arguments.length);
        __classPrivateFieldGet8(this, _YargsInstance_options, "f").hiddenOptions.push(key);
        return this;
      }
      implies(key, value) {
        argsert("<string|object> [number|string|array]", [key, value], arguments.length);
        __classPrivateFieldGet8(this, _YargsInstance_validation, "f").implies(key, value);
        return this;
      }
      locale(locale) {
        argsert("[string]", [locale], arguments.length);
        if (locale === void 0) {
          this[kGuessLocale]();
          return __classPrivateFieldGet8(this, _YargsInstance_shim, "f").y18n.getLocale();
        }
        __classPrivateFieldSet6(this, _YargsInstance_detectLocale, false, "f");
        __classPrivateFieldGet8(this, _YargsInstance_shim, "f").y18n.setLocale(locale);
        return this;
      }
      middleware(callback, applyBeforeValidation, global2) {
        return __classPrivateFieldGet8(this, _YargsInstance_globalMiddleware, "f").addMiddleware(callback, !!applyBeforeValidation, global2);
      }
      nargs(key, value) {
        argsert("<string|object|array> [number]", [key, value], arguments.length);
        this[kPopulateParserHintSingleValueDictionary](this.nargs.bind(this), "narg", key, value);
        return this;
      }
      normalize(keys) {
        argsert("<array|string>", [keys], arguments.length);
        this[kPopulateParserHintArray]("normalize", keys);
        return this;
      }
      number(keys) {
        argsert("<array|string>", [keys], arguments.length);
        this[kPopulateParserHintArray]("number", keys);
        this[kTrackManuallySetKeys](keys);
        return this;
      }
      option(key, opt) {
        argsert("<string|object> [object]", [key, opt], arguments.length);
        if (typeof key === "object") {
          Object.keys(key).forEach((k7) => {
            this.options(k7, key[k7]);
          });
        } else {
          if (typeof opt !== "object") {
            opt = {};
          }
          this[kTrackManuallySetKeys](key);
          if (__classPrivateFieldGet8(this, _YargsInstance_versionOpt, "f") && (key === "version" || (opt === null || opt === void 0 ? void 0 : opt.alias) === "version")) {
            this[kEmitWarning]([
              '"version" is a reserved word.',
              "Please do one of the following:",
              '- Disable version with `yargs.version(false)` if using "version" as an option',
              "- Use the built-in `yargs.version` method instead (if applicable)",
              "- Use a different option key",
              "https://yargs.js.org/docs/#api-reference-version"
            ].join("\n"), void 0, "versionWarning");
          }
          __classPrivateFieldGet8(this, _YargsInstance_options, "f").key[key] = true;
          if (opt.alias)
            this.alias(key, opt.alias);
          const deprecate2 = opt.deprecate || opt.deprecated;
          if (deprecate2) {
            this.deprecateOption(key, deprecate2);
          }
          const demand = opt.demand || opt.required || opt.require;
          if (demand) {
            this.demand(key, demand);
          }
          if (opt.demandOption) {
            this.demandOption(key, typeof opt.demandOption === "string" ? opt.demandOption : void 0);
          }
          if (opt.conflicts) {
            this.conflicts(key, opt.conflicts);
          }
          if ("default" in opt) {
            this.default(key, opt.default);
          }
          if (opt.implies !== void 0) {
            this.implies(key, opt.implies);
          }
          if (opt.nargs !== void 0) {
            this.nargs(key, opt.nargs);
          }
          if (opt.config) {
            this.config(key, opt.configParser);
          }
          if (opt.normalize) {
            this.normalize(key);
          }
          if (opt.choices) {
            this.choices(key, opt.choices);
          }
          if (opt.coerce) {
            this.coerce(key, opt.coerce);
          }
          if (opt.group) {
            this.group(key, opt.group);
          }
          if (opt.boolean || opt.type === "boolean") {
            this.boolean(key);
            if (opt.alias)
              this.boolean(opt.alias);
          }
          if (opt.array || opt.type === "array") {
            this.array(key);
            if (opt.alias)
              this.array(opt.alias);
          }
          if (opt.number || opt.type === "number") {
            this.number(key);
            if (opt.alias)
              this.number(opt.alias);
          }
          if (opt.string || opt.type === "string") {
            this.string(key);
            if (opt.alias)
              this.string(opt.alias);
          }
          if (opt.count || opt.type === "count") {
            this.count(key);
          }
          if (typeof opt.global === "boolean") {
            this.global(key, opt.global);
          }
          if (opt.defaultDescription) {
            __classPrivateFieldGet8(this, _YargsInstance_options, "f").defaultDescription[key] = opt.defaultDescription;
          }
          if (opt.skipValidation) {
            this.skipValidation(key);
          }
          const desc = opt.describe || opt.description || opt.desc;
          const descriptions = __classPrivateFieldGet8(this, _YargsInstance_usage, "f").getDescriptions();
          if (!Object.prototype.hasOwnProperty.call(descriptions, key) || typeof desc === "string") {
            this.describe(key, desc);
          }
          if (opt.hidden) {
            this.hide(key);
          }
          if (opt.requiresArg) {
            this.requiresArg(key);
          }
        }
        return this;
      }
      options(key, opt) {
        return this.option(key, opt);
      }
      parse(args, shortCircuit, _parseFn) {
        argsert("[string|array] [function|boolean|object] [function]", [args, shortCircuit, _parseFn], arguments.length);
        this[kFreeze]();
        if (typeof args === "undefined") {
          args = __classPrivateFieldGet8(this, _YargsInstance_processArgs, "f");
        }
        if (typeof shortCircuit === "object") {
          __classPrivateFieldSet6(this, _YargsInstance_parseContext, shortCircuit, "f");
          shortCircuit = _parseFn;
        }
        if (typeof shortCircuit === "function") {
          __classPrivateFieldSet6(this, _YargsInstance_parseFn, shortCircuit, "f");
          shortCircuit = false;
        }
        if (!shortCircuit)
          __classPrivateFieldSet6(this, _YargsInstance_processArgs, args, "f");
        if (__classPrivateFieldGet8(this, _YargsInstance_parseFn, "f"))
          __classPrivateFieldSet6(this, _YargsInstance_exitProcess, false, "f");
        const parsed = this[kRunYargsParserAndExecuteCommands](args, !!shortCircuit);
        const tmpParsed = this.parsed;
        __classPrivateFieldGet8(this, _YargsInstance_completion, "f").setParsed(this.parsed);
        if (isPromise(parsed)) {
          return parsed.then((argv) => {
            if (__classPrivateFieldGet8(this, _YargsInstance_parseFn, "f"))
              __classPrivateFieldGet8(this, _YargsInstance_parseFn, "f").call(this, __classPrivateFieldGet8(this, _YargsInstance_exitError, "f"), argv, __classPrivateFieldGet8(this, _YargsInstance_output, "f"));
            return argv;
          }).catch((err) => {
            if (__classPrivateFieldGet8(this, _YargsInstance_parseFn, "f")) {
              __classPrivateFieldGet8(this, _YargsInstance_parseFn, "f")(err, this.parsed.argv, __classPrivateFieldGet8(this, _YargsInstance_output, "f"));
            }
            throw err;
          }).finally(() => {
            this[kUnfreeze]();
            this.parsed = tmpParsed;
          });
        } else {
          if (__classPrivateFieldGet8(this, _YargsInstance_parseFn, "f"))
            __classPrivateFieldGet8(this, _YargsInstance_parseFn, "f").call(this, __classPrivateFieldGet8(this, _YargsInstance_exitError, "f"), parsed, __classPrivateFieldGet8(this, _YargsInstance_output, "f"));
          this[kUnfreeze]();
          this.parsed = tmpParsed;
        }
        return parsed;
      }
      parseAsync(args, shortCircuit, _parseFn) {
        const maybePromise = this.parse(args, shortCircuit, _parseFn);
        return !isPromise(maybePromise) ? Promise.resolve(maybePromise) : maybePromise;
      }
      parseSync(args, shortCircuit, _parseFn) {
        const maybePromise = this.parse(args, shortCircuit, _parseFn);
        if (isPromise(maybePromise)) {
          throw new YError(".parseSync() must not be used with asynchronous builders, handlers, or middleware");
        }
        return maybePromise;
      }
      parserConfiguration(config) {
        argsert("<object>", [config], arguments.length);
        __classPrivateFieldSet6(this, _YargsInstance_parserConfig, config, "f");
        return this;
      }
      pkgConf(key, rootPath) {
        argsert("<string> [string]", [key, rootPath], arguments.length);
        let conf = null;
        const obj = this[kPkgUp](rootPath || __classPrivateFieldGet8(this, _YargsInstance_cwd, "f"));
        if (obj[key] && typeof obj[key] === "object") {
          conf = applyExtends(obj[key], rootPath || __classPrivateFieldGet8(this, _YargsInstance_cwd, "f"), this[kGetParserConfiguration]()["deep-merge-config"] || false, __classPrivateFieldGet8(this, _YargsInstance_shim, "f"));
          __classPrivateFieldGet8(this, _YargsInstance_options, "f").configObjects = (__classPrivateFieldGet8(this, _YargsInstance_options, "f").configObjects || []).concat(conf);
        }
        return this;
      }
      positional(key, opts) {
        argsert("<string> <object>", [key, opts], arguments.length);
        const supportedOpts = [
          "default",
          "defaultDescription",
          "implies",
          "normalize",
          "choices",
          "conflicts",
          "coerce",
          "type",
          "describe",
          "desc",
          "description",
          "alias"
        ];
        opts = objFilter(opts, (k7, v8) => {
          if (k7 === "type" && !["string", "number", "boolean"].includes(v8))
            return false;
          return supportedOpts.includes(k7);
        });
        const fullCommand = __classPrivateFieldGet8(this, _YargsInstance_context, "f").fullCommands[__classPrivateFieldGet8(this, _YargsInstance_context, "f").fullCommands.length - 1];
        const parseOptions = fullCommand ? __classPrivateFieldGet8(this, _YargsInstance_command, "f").cmdToParseOptions(fullCommand) : {
          array: [],
          alias: {},
          default: {},
          demand: {}
        };
        objectKeys(parseOptions).forEach((pk) => {
          const parseOption = parseOptions[pk];
          if (Array.isArray(parseOption)) {
            if (parseOption.indexOf(key) !== -1)
              opts[pk] = true;
          } else {
            if (parseOption[key] && !(pk in opts))
              opts[pk] = parseOption[key];
          }
        });
        this.group(key, __classPrivateFieldGet8(this, _YargsInstance_usage, "f").getPositionalGroupName());
        return this.option(key, opts);
      }
      recommendCommands(recommend = true) {
        argsert("[boolean]", [recommend], arguments.length);
        __classPrivateFieldSet6(this, _YargsInstance_recommendCommands, recommend, "f");
        return this;
      }
      required(keys, max, msg) {
        return this.demand(keys, max, msg);
      }
      require(keys, max, msg) {
        return this.demand(keys, max, msg);
      }
      requiresArg(keys) {
        argsert("<array|string|object> [number]", [keys], arguments.length);
        if (typeof keys === "string" && __classPrivateFieldGet8(this, _YargsInstance_options, "f").narg[keys]) {
          return this;
        } else {
          this[kPopulateParserHintSingleValueDictionary](this.requiresArg.bind(this), "narg", keys, NaN);
        }
        return this;
      }
      showCompletionScript($0, cmd) {
        argsert("[string] [string]", [$0, cmd], arguments.length);
        $0 = $0 || this.$0;
        __classPrivateFieldGet8(this, _YargsInstance_logger, "f").log(__classPrivateFieldGet8(this, _YargsInstance_completion, "f").generateCompletionScript($0, cmd || __classPrivateFieldGet8(this, _YargsInstance_completionCommand, "f") || "completion"));
        return this;
      }
      showHelp(level) {
        argsert("[string|function]", [level], arguments.length);
        __classPrivateFieldSet6(this, _YargsInstance_hasOutput, true, "f");
        if (!__classPrivateFieldGet8(this, _YargsInstance_usage, "f").hasCachedHelpMessage()) {
          if (!this.parsed) {
            const parse17 = this[kRunYargsParserAndExecuteCommands](__classPrivateFieldGet8(this, _YargsInstance_processArgs, "f"), void 0, void 0, 0, true);
            if (isPromise(parse17)) {
              parse17.then(() => {
                __classPrivateFieldGet8(this, _YargsInstance_usage, "f").showHelp(level);
              });
              return this;
            }
          }
          const builderResponse = __classPrivateFieldGet8(this, _YargsInstance_command, "f").runDefaultBuilderOn(this);
          if (isPromise(builderResponse)) {
            builderResponse.then(() => {
              __classPrivateFieldGet8(this, _YargsInstance_usage, "f").showHelp(level);
            });
            return this;
          }
        }
        __classPrivateFieldGet8(this, _YargsInstance_usage, "f").showHelp(level);
        return this;
      }
      scriptName(scriptName) {
        this.customScriptName = true;
        this.$0 = scriptName;
        return this;
      }
      showHelpOnFail(enabled, message) {
        argsert("[boolean|string] [string]", [enabled, message], arguments.length);
        __classPrivateFieldGet8(this, _YargsInstance_usage, "f").showHelpOnFail(enabled, message);
        return this;
      }
      showVersion(level) {
        argsert("[string|function]", [level], arguments.length);
        __classPrivateFieldGet8(this, _YargsInstance_usage, "f").showVersion(level);
        return this;
      }
      skipValidation(keys) {
        argsert("<array|string>", [keys], arguments.length);
        this[kPopulateParserHintArray]("skipValidation", keys);
        return this;
      }
      strict(enabled) {
        argsert("[boolean]", [enabled], arguments.length);
        __classPrivateFieldSet6(this, _YargsInstance_strict, enabled !== false, "f");
        return this;
      }
      strictCommands(enabled) {
        argsert("[boolean]", [enabled], arguments.length);
        __classPrivateFieldSet6(this, _YargsInstance_strictCommands, enabled !== false, "f");
        return this;
      }
      strictOptions(enabled) {
        argsert("[boolean]", [enabled], arguments.length);
        __classPrivateFieldSet6(this, _YargsInstance_strictOptions, enabled !== false, "f");
        return this;
      }
      string(keys) {
        argsert("<array|string>", [keys], arguments.length);
        this[kPopulateParserHintArray]("string", keys);
        this[kTrackManuallySetKeys](keys);
        return this;
      }
      terminalWidth() {
        argsert([], 0);
        return __classPrivateFieldGet8(this, _YargsInstance_shim, "f").process.stdColumns;
      }
      updateLocale(obj) {
        return this.updateStrings(obj);
      }
      updateStrings(obj) {
        argsert("<object>", [obj], arguments.length);
        __classPrivateFieldSet6(this, _YargsInstance_detectLocale, false, "f");
        __classPrivateFieldGet8(this, _YargsInstance_shim, "f").y18n.updateLocale(obj);
        return this;
      }
      usage(msg, description, builder, handler) {
        argsert("<string|null|undefined> [string|boolean] [function|object] [function]", [msg, description, builder, handler], arguments.length);
        if (description !== void 0) {
          assertNotStrictEqual(msg, null, __classPrivateFieldGet8(this, _YargsInstance_shim, "f"));
          if ((msg || "").match(/^\$0( |$)/)) {
            return this.command(msg, description, builder, handler);
          } else {
            throw new YError(".usage() description must start with $0 if being used as alias for .command()");
          }
        } else {
          __classPrivateFieldGet8(this, _YargsInstance_usage, "f").usage(msg);
          return this;
        }
      }
      usageConfiguration(config) {
        argsert("<object>", [config], arguments.length);
        __classPrivateFieldSet6(this, _YargsInstance_usageConfig, config, "f");
        return this;
      }
      version(opt, msg, ver) {
        const defaultVersionOpt = "version";
        argsert("[boolean|string] [string] [string]", [opt, msg, ver], arguments.length);
        if (__classPrivateFieldGet8(this, _YargsInstance_versionOpt, "f")) {
          this[kDeleteFromParserHintObject](__classPrivateFieldGet8(this, _YargsInstance_versionOpt, "f"));
          __classPrivateFieldGet8(this, _YargsInstance_usage, "f").version(void 0);
          __classPrivateFieldSet6(this, _YargsInstance_versionOpt, null, "f");
        }
        if (arguments.length === 0) {
          ver = this[kGuessVersion]();
          opt = defaultVersionOpt;
        } else if (arguments.length === 1) {
          if (opt === false) {
            return this;
          }
          ver = opt;
          opt = defaultVersionOpt;
        } else if (arguments.length === 2) {
          ver = msg;
          msg = void 0;
        }
        __classPrivateFieldSet6(this, _YargsInstance_versionOpt, typeof opt === "string" ? opt : defaultVersionOpt, "f");
        msg = msg || __classPrivateFieldGet8(this, _YargsInstance_usage, "f").deferY18nLookup("Show version number");
        __classPrivateFieldGet8(this, _YargsInstance_usage, "f").version(ver || void 0);
        this.boolean(__classPrivateFieldGet8(this, _YargsInstance_versionOpt, "f"));
        this.describe(__classPrivateFieldGet8(this, _YargsInstance_versionOpt, "f"), msg);
        return this;
      }
      wrap(cols) {
        argsert("<number|null|undefined>", [cols], arguments.length);
        __classPrivateFieldGet8(this, _YargsInstance_usage, "f").wrap(cols);
        return this;
      }
      [(_YargsInstance_command = /* @__PURE__ */ new WeakMap(), _YargsInstance_cwd = /* @__PURE__ */ new WeakMap(), _YargsInstance_context = /* @__PURE__ */ new WeakMap(), _YargsInstance_completion = /* @__PURE__ */ new WeakMap(), _YargsInstance_completionCommand = /* @__PURE__ */ new WeakMap(), _YargsInstance_defaultShowHiddenOpt = /* @__PURE__ */ new WeakMap(), _YargsInstance_exitError = /* @__PURE__ */ new WeakMap(), _YargsInstance_detectLocale = /* @__PURE__ */ new WeakMap(), _YargsInstance_emittedWarnings = /* @__PURE__ */ new WeakMap(), _YargsInstance_exitProcess = /* @__PURE__ */ new WeakMap(), _YargsInstance_frozens = /* @__PURE__ */ new WeakMap(), _YargsInstance_globalMiddleware = /* @__PURE__ */ new WeakMap(), _YargsInstance_groups = /* @__PURE__ */ new WeakMap(), _YargsInstance_hasOutput = /* @__PURE__ */ new WeakMap(), _YargsInstance_helpOpt = /* @__PURE__ */ new WeakMap(), _YargsInstance_isGlobalContext = /* @__PURE__ */ new WeakMap(), _YargsInstance_logger = /* @__PURE__ */ new WeakMap(), _YargsInstance_output = /* @__PURE__ */ new WeakMap(), _YargsInstance_options = /* @__PURE__ */ new WeakMap(), _YargsInstance_parentRequire = /* @__PURE__ */ new WeakMap(), _YargsInstance_parserConfig = /* @__PURE__ */ new WeakMap(), _YargsInstance_parseFn = /* @__PURE__ */ new WeakMap(), _YargsInstance_parseContext = /* @__PURE__ */ new WeakMap(), _YargsInstance_pkgs = /* @__PURE__ */ new WeakMap(), _YargsInstance_preservedGroups = /* @__PURE__ */ new WeakMap(), _YargsInstance_processArgs = /* @__PURE__ */ new WeakMap(), _YargsInstance_recommendCommands = /* @__PURE__ */ new WeakMap(), _YargsInstance_shim = /* @__PURE__ */ new WeakMap(), _YargsInstance_strict = /* @__PURE__ */ new WeakMap(), _YargsInstance_strictCommands = /* @__PURE__ */ new WeakMap(), _YargsInstance_strictOptions = /* @__PURE__ */ new WeakMap(), _YargsInstance_usage = /* @__PURE__ */ new WeakMap(), _YargsInstance_usageConfig = /* @__PURE__ */ new WeakMap(), _YargsInstance_versionOpt = /* @__PURE__ */ new WeakMap(), _YargsInstance_validation = /* @__PURE__ */ new WeakMap(), kCopyDoubleDash)](argv) {
        if (!argv._ || !argv["--"])
          return argv;
        argv._.push.apply(argv._, argv["--"]);
        try {
          delete argv["--"];
        } catch (_err) {
        }
        return argv;
      }
      [kCreateLogger]() {
        return {
          log: /* @__PURE__ */ __name((...args) => {
            if (!this[kHasParseCallback]())
              console.log(...args);
            __classPrivateFieldSet6(this, _YargsInstance_hasOutput, true, "f");
            if (__classPrivateFieldGet8(this, _YargsInstance_output, "f").length)
              __classPrivateFieldSet6(this, _YargsInstance_output, __classPrivateFieldGet8(this, _YargsInstance_output, "f") + "\n", "f");
            __classPrivateFieldSet6(this, _YargsInstance_output, __classPrivateFieldGet8(this, _YargsInstance_output, "f") + args.join(" "), "f");
          }, "log"),
          error: /* @__PURE__ */ __name((...args) => {
            if (!this[kHasParseCallback]())
              console.error(...args);
            __classPrivateFieldSet6(this, _YargsInstance_hasOutput, true, "f");
            if (__classPrivateFieldGet8(this, _YargsInstance_output, "f").length)
              __classPrivateFieldSet6(this, _YargsInstance_output, __classPrivateFieldGet8(this, _YargsInstance_output, "f") + "\n", "f");
            __classPrivateFieldSet6(this, _YargsInstance_output, __classPrivateFieldGet8(this, _YargsInstance_output, "f") + args.join(" "), "f");
          }, "error")
        };
      }
      [kDeleteFromParserHintObject](optionKey) {
        objectKeys(__classPrivateFieldGet8(this, _YargsInstance_options, "f")).forEach((hintKey) => {
          if (/* @__PURE__ */ ((key) => key === "configObjects")(hintKey))
            return;
          const hint = __classPrivateFieldGet8(this, _YargsInstance_options, "f")[hintKey];
          if (Array.isArray(hint)) {
            if (hint.includes(optionKey))
              hint.splice(hint.indexOf(optionKey), 1);
          } else if (typeof hint === "object") {
            delete hint[optionKey];
          }
        });
        delete __classPrivateFieldGet8(this, _YargsInstance_usage, "f").getDescriptions()[optionKey];
      }
      [kEmitWarning](warning, type, deduplicationId) {
        if (!__classPrivateFieldGet8(this, _YargsInstance_emittedWarnings, "f")[deduplicationId]) {
          __classPrivateFieldGet8(this, _YargsInstance_shim, "f").process.emitWarning(warning, type);
          __classPrivateFieldGet8(this, _YargsInstance_emittedWarnings, "f")[deduplicationId] = true;
        }
      }
      [kFreeze]() {
        __classPrivateFieldGet8(this, _YargsInstance_frozens, "f").push({
          options: __classPrivateFieldGet8(this, _YargsInstance_options, "f"),
          configObjects: __classPrivateFieldGet8(this, _YargsInstance_options, "f").configObjects.slice(0),
          exitProcess: __classPrivateFieldGet8(this, _YargsInstance_exitProcess, "f"),
          groups: __classPrivateFieldGet8(this, _YargsInstance_groups, "f"),
          strict: __classPrivateFieldGet8(this, _YargsInstance_strict, "f"),
          strictCommands: __classPrivateFieldGet8(this, _YargsInstance_strictCommands, "f"),
          strictOptions: __classPrivateFieldGet8(this, _YargsInstance_strictOptions, "f"),
          completionCommand: __classPrivateFieldGet8(this, _YargsInstance_completionCommand, "f"),
          output: __classPrivateFieldGet8(this, _YargsInstance_output, "f"),
          exitError: __classPrivateFieldGet8(this, _YargsInstance_exitError, "f"),
          hasOutput: __classPrivateFieldGet8(this, _YargsInstance_hasOutput, "f"),
          parsed: this.parsed,
          parseFn: __classPrivateFieldGet8(this, _YargsInstance_parseFn, "f"),
          parseContext: __classPrivateFieldGet8(this, _YargsInstance_parseContext, "f")
        });
        __classPrivateFieldGet8(this, _YargsInstance_usage, "f").freeze();
        __classPrivateFieldGet8(this, _YargsInstance_validation, "f").freeze();
        __classPrivateFieldGet8(this, _YargsInstance_command, "f").freeze();
        __classPrivateFieldGet8(this, _YargsInstance_globalMiddleware, "f").freeze();
      }
      [kGetDollarZero]() {
        let $0 = "";
        let default$0;
        if (/\b(node|iojs|electron)(\.exe)?$/.test(__classPrivateFieldGet8(this, _YargsInstance_shim, "f").process.argv()[0])) {
          default$0 = __classPrivateFieldGet8(this, _YargsInstance_shim, "f").process.argv().slice(1, 2);
        } else {
          default$0 = __classPrivateFieldGet8(this, _YargsInstance_shim, "f").process.argv().slice(0, 1);
        }
        $0 = default$0.map((x7) => {
          const b11 = this[kRebase](__classPrivateFieldGet8(this, _YargsInstance_cwd, "f"), x7);
          return x7.match(/^(\/|([a-zA-Z]:)?\\)/) && b11.length < x7.length ? b11 : x7;
        }).join(" ").trim();
        if (__classPrivateFieldGet8(this, _YargsInstance_shim, "f").getEnv("_") && __classPrivateFieldGet8(this, _YargsInstance_shim, "f").getProcessArgvBin() === __classPrivateFieldGet8(this, _YargsInstance_shim, "f").getEnv("_")) {
          $0 = __classPrivateFieldGet8(this, _YargsInstance_shim, "f").getEnv("_").replace(`${__classPrivateFieldGet8(this, _YargsInstance_shim, "f").path.dirname(__classPrivateFieldGet8(this, _YargsInstance_shim, "f").process.execPath())}/`, "");
        }
        return $0;
      }
      [kGetParserConfiguration]() {
        return __classPrivateFieldGet8(this, _YargsInstance_parserConfig, "f");
      }
      [kGetUsageConfiguration]() {
        return __classPrivateFieldGet8(this, _YargsInstance_usageConfig, "f");
      }
      [kGuessLocale]() {
        if (!__classPrivateFieldGet8(this, _YargsInstance_detectLocale, "f"))
          return;
        const locale = __classPrivateFieldGet8(this, _YargsInstance_shim, "f").getEnv("LC_ALL") || __classPrivateFieldGet8(this, _YargsInstance_shim, "f").getEnv("LC_MESSAGES") || __classPrivateFieldGet8(this, _YargsInstance_shim, "f").getEnv("LANG") || __classPrivateFieldGet8(this, _YargsInstance_shim, "f").getEnv("LANGUAGE") || "en_US";
        this.locale(locale.replace(/[.:].*/, ""));
      }
      [kGuessVersion]() {
        const obj = this[kPkgUp]();
        return obj.version || "unknown";
      }
      [kParsePositionalNumbers](argv) {
        const args = argv["--"] ? argv["--"] : argv._;
        for (let i7 = 0, arg; (arg = args[i7]) !== void 0; i7++) {
          if (__classPrivateFieldGet8(this, _YargsInstance_shim, "f").Parser.looksLikeNumber(arg) && Number.isSafeInteger(Math.floor(parseFloat(`${arg}`)))) {
            args[i7] = Number(arg);
          }
        }
        return argv;
      }
      [kPkgUp](rootPath) {
        const npath = rootPath || "*";
        if (__classPrivateFieldGet8(this, _YargsInstance_pkgs, "f")[npath])
          return __classPrivateFieldGet8(this, _YargsInstance_pkgs, "f")[npath];
        let obj = {};
        try {
          let startDir = rootPath || __classPrivateFieldGet8(this, _YargsInstance_shim, "f").mainFilename;
          if (!rootPath && __classPrivateFieldGet8(this, _YargsInstance_shim, "f").path.extname(startDir)) {
            startDir = __classPrivateFieldGet8(this, _YargsInstance_shim, "f").path.dirname(startDir);
          }
          const pkgJsonPath = __classPrivateFieldGet8(this, _YargsInstance_shim, "f").findUp(startDir, (dir2, names) => {
            if (names.includes("package.json")) {
              return "package.json";
            } else {
              return void 0;
            }
          });
          assertNotStrictEqual(pkgJsonPath, void 0, __classPrivateFieldGet8(this, _YargsInstance_shim, "f"));
          obj = JSON.parse(__classPrivateFieldGet8(this, _YargsInstance_shim, "f").readFileSync(pkgJsonPath, "utf8"));
        } catch (_noop) {
        }
        __classPrivateFieldGet8(this, _YargsInstance_pkgs, "f")[npath] = obj || {};
        return __classPrivateFieldGet8(this, _YargsInstance_pkgs, "f")[npath];
      }
      [kPopulateParserHintArray](type, keys) {
        keys = [].concat(keys);
        keys.forEach((key) => {
          key = this[kSanitizeKey](key);
          __classPrivateFieldGet8(this, _YargsInstance_options, "f")[type].push(key);
        });
      }
      [kPopulateParserHintSingleValueDictionary](builder, type, key, value) {
        this[kPopulateParserHintDictionary](builder, type, key, value, (type2, key2, value2) => {
          __classPrivateFieldGet8(this, _YargsInstance_options, "f")[type2][key2] = value2;
        });
      }
      [kPopulateParserHintArrayDictionary](builder, type, key, value) {
        this[kPopulateParserHintDictionary](builder, type, key, value, (type2, key2, value2) => {
          __classPrivateFieldGet8(this, _YargsInstance_options, "f")[type2][key2] = (__classPrivateFieldGet8(this, _YargsInstance_options, "f")[type2][key2] || []).concat(value2);
        });
      }
      [kPopulateParserHintDictionary](builder, type, key, value, singleKeyHandler) {
        if (Array.isArray(key)) {
          key.forEach((k7) => {
            builder(k7, value);
          });
        } else if (/* @__PURE__ */ ((key2) => typeof key2 === "object")(key)) {
          for (const k7 of objectKeys(key)) {
            builder(k7, key[k7]);
          }
        } else {
          singleKeyHandler(type, this[kSanitizeKey](key), value);
        }
      }
      [kSanitizeKey](key) {
        if (key === "__proto__")
          return "___proto___";
        return key;
      }
      [kSetKey](key, set) {
        this[kPopulateParserHintSingleValueDictionary](this[kSetKey].bind(this), "key", key, set);
        return this;
      }
      [kUnfreeze]() {
        var _a5, _b2, _c3, _d2, _e3, _f, _g, _h, _j, _k, _l2, _m3;
        const frozen = __classPrivateFieldGet8(this, _YargsInstance_frozens, "f").pop();
        assertNotStrictEqual(frozen, void 0, __classPrivateFieldGet8(this, _YargsInstance_shim, "f"));
        let configObjects;
        _a5 = this, _b2 = this, _c3 = this, _d2 = this, _e3 = this, _f = this, _g = this, _h = this, _j = this, _k = this, _l2 = this, _m3 = this, {
          options: { set value(_o) {
            __classPrivateFieldSet6(_a5, _YargsInstance_options, _o, "f");
          } }.value,
          configObjects,
          exitProcess: { set value(_o) {
            __classPrivateFieldSet6(_b2, _YargsInstance_exitProcess, _o, "f");
          } }.value,
          groups: { set value(_o) {
            __classPrivateFieldSet6(_c3, _YargsInstance_groups, _o, "f");
          } }.value,
          output: { set value(_o) {
            __classPrivateFieldSet6(_d2, _YargsInstance_output, _o, "f");
          } }.value,
          exitError: { set value(_o) {
            __classPrivateFieldSet6(_e3, _YargsInstance_exitError, _o, "f");
          } }.value,
          hasOutput: { set value(_o) {
            __classPrivateFieldSet6(_f, _YargsInstance_hasOutput, _o, "f");
          } }.value,
          parsed: this.parsed,
          strict: { set value(_o) {
            __classPrivateFieldSet6(_g, _YargsInstance_strict, _o, "f");
          } }.value,
          strictCommands: { set value(_o) {
            __classPrivateFieldSet6(_h, _YargsInstance_strictCommands, _o, "f");
          } }.value,
          strictOptions: { set value(_o) {
            __classPrivateFieldSet6(_j, _YargsInstance_strictOptions, _o, "f");
          } }.value,
          completionCommand: { set value(_o) {
            __classPrivateFieldSet6(_k, _YargsInstance_completionCommand, _o, "f");
          } }.value,
          parseFn: { set value(_o) {
            __classPrivateFieldSet6(_l2, _YargsInstance_parseFn, _o, "f");
          } }.value,
          parseContext: { set value(_o) {
            __classPrivateFieldSet6(_m3, _YargsInstance_parseContext, _o, "f");
          } }.value
        } = frozen;
        __classPrivateFieldGet8(this, _YargsInstance_options, "f").configObjects = configObjects;
        __classPrivateFieldGet8(this, _YargsInstance_usage, "f").unfreeze();
        __classPrivateFieldGet8(this, _YargsInstance_validation, "f").unfreeze();
        __classPrivateFieldGet8(this, _YargsInstance_command, "f").unfreeze();
        __classPrivateFieldGet8(this, _YargsInstance_globalMiddleware, "f").unfreeze();
      }
      [kValidateAsync](validation2, argv) {
        return maybeAsyncResult(argv, (result) => {
          validation2(result);
          return result;
        });
      }
      getInternalMethods() {
        return {
          getCommandInstance: this[kGetCommandInstance].bind(this),
          getContext: this[kGetContext].bind(this),
          getHasOutput: this[kGetHasOutput].bind(this),
          getLoggerInstance: this[kGetLoggerInstance].bind(this),
          getParseContext: this[kGetParseContext].bind(this),
          getParserConfiguration: this[kGetParserConfiguration].bind(this),
          getUsageConfiguration: this[kGetUsageConfiguration].bind(this),
          getUsageInstance: this[kGetUsageInstance].bind(this),
          getValidationInstance: this[kGetValidationInstance].bind(this),
          hasParseCallback: this[kHasParseCallback].bind(this),
          isGlobalContext: this[kIsGlobalContext].bind(this),
          postProcess: this[kPostProcess].bind(this),
          reset: this[kReset].bind(this),
          runValidation: this[kRunValidation].bind(this),
          runYargsParserAndExecuteCommands: this[kRunYargsParserAndExecuteCommands].bind(this),
          setHasOutput: this[kSetHasOutput].bind(this)
        };
      }
      [kGetCommandInstance]() {
        return __classPrivateFieldGet8(this, _YargsInstance_command, "f");
      }
      [kGetContext]() {
        return __classPrivateFieldGet8(this, _YargsInstance_context, "f");
      }
      [kGetHasOutput]() {
        return __classPrivateFieldGet8(this, _YargsInstance_hasOutput, "f");
      }
      [kGetLoggerInstance]() {
        return __classPrivateFieldGet8(this, _YargsInstance_logger, "f");
      }
      [kGetParseContext]() {
        return __classPrivateFieldGet8(this, _YargsInstance_parseContext, "f") || {};
      }
      [kGetUsageInstance]() {
        return __classPrivateFieldGet8(this, _YargsInstance_usage, "f");
      }
      [kGetValidationInstance]() {
        return __classPrivateFieldGet8(this, _YargsInstance_validation, "f");
      }
      [kHasParseCallback]() {
        return !!__classPrivateFieldGet8(this, _YargsInstance_parseFn, "f");
      }
      [kIsGlobalContext]() {
        return __classPrivateFieldGet8(this, _YargsInstance_isGlobalContext, "f");
      }
      [kPostProcess](argv, populateDoubleDash, calledFromCommand, runGlobalMiddleware) {
        if (calledFromCommand)
          return argv;
        if (isPromise(argv))
          return argv;
        if (!populateDoubleDash) {
          argv = this[kCopyDoubleDash](argv);
        }
        const parsePositionalNumbers = this[kGetParserConfiguration]()["parse-positional-numbers"] || this[kGetParserConfiguration]()["parse-positional-numbers"] === void 0;
        if (parsePositionalNumbers) {
          argv = this[kParsePositionalNumbers](argv);
        }
        if (runGlobalMiddleware) {
          argv = applyMiddleware(argv, this, __classPrivateFieldGet8(this, _YargsInstance_globalMiddleware, "f").getMiddleware(), false);
        }
        return argv;
      }
      [kReset](aliases2 = {}) {
        __classPrivateFieldSet6(this, _YargsInstance_options, __classPrivateFieldGet8(this, _YargsInstance_options, "f") || {}, "f");
        const tmpOptions = {};
        tmpOptions.local = __classPrivateFieldGet8(this, _YargsInstance_options, "f").local || [];
        tmpOptions.configObjects = __classPrivateFieldGet8(this, _YargsInstance_options, "f").configObjects || [];
        const localLookup = {};
        tmpOptions.local.forEach((l8) => {
          localLookup[l8] = true;
          (aliases2[l8] || []).forEach((a7) => {
            localLookup[a7] = true;
          });
        });
        Object.assign(__classPrivateFieldGet8(this, _YargsInstance_preservedGroups, "f"), Object.keys(__classPrivateFieldGet8(this, _YargsInstance_groups, "f")).reduce((acc, groupName) => {
          const keys = __classPrivateFieldGet8(this, _YargsInstance_groups, "f")[groupName].filter((key) => !(key in localLookup));
          if (keys.length > 0) {
            acc[groupName] = keys;
          }
          return acc;
        }, {}));
        __classPrivateFieldSet6(this, _YargsInstance_groups, {}, "f");
        const arrayOptions = [
          "array",
          "boolean",
          "string",
          "skipValidation",
          "count",
          "normalize",
          "number",
          "hiddenOptions"
        ];
        const objectOptions = [
          "narg",
          "key",
          "alias",
          "default",
          "defaultDescription",
          "config",
          "choices",
          "demandedOptions",
          "demandedCommands",
          "deprecatedOptions"
        ];
        arrayOptions.forEach((k7) => {
          tmpOptions[k7] = (__classPrivateFieldGet8(this, _YargsInstance_options, "f")[k7] || []).filter((k8) => !localLookup[k8]);
        });
        objectOptions.forEach((k7) => {
          tmpOptions[k7] = objFilter(__classPrivateFieldGet8(this, _YargsInstance_options, "f")[k7], (k8) => !localLookup[k8]);
        });
        tmpOptions.envPrefix = __classPrivateFieldGet8(this, _YargsInstance_options, "f").envPrefix;
        __classPrivateFieldSet6(this, _YargsInstance_options, tmpOptions, "f");
        __classPrivateFieldSet6(this, _YargsInstance_usage, __classPrivateFieldGet8(this, _YargsInstance_usage, "f") ? __classPrivateFieldGet8(this, _YargsInstance_usage, "f").reset(localLookup) : usage(this, __classPrivateFieldGet8(this, _YargsInstance_shim, "f")), "f");
        __classPrivateFieldSet6(this, _YargsInstance_validation, __classPrivateFieldGet8(this, _YargsInstance_validation, "f") ? __classPrivateFieldGet8(this, _YargsInstance_validation, "f").reset(localLookup) : validation(this, __classPrivateFieldGet8(this, _YargsInstance_usage, "f"), __classPrivateFieldGet8(this, _YargsInstance_shim, "f")), "f");
        __classPrivateFieldSet6(this, _YargsInstance_command, __classPrivateFieldGet8(this, _YargsInstance_command, "f") ? __classPrivateFieldGet8(this, _YargsInstance_command, "f").reset() : command(__classPrivateFieldGet8(this, _YargsInstance_usage, "f"), __classPrivateFieldGet8(this, _YargsInstance_validation, "f"), __classPrivateFieldGet8(this, _YargsInstance_globalMiddleware, "f"), __classPrivateFieldGet8(this, _YargsInstance_shim, "f")), "f");
        if (!__classPrivateFieldGet8(this, _YargsInstance_completion, "f"))
          __classPrivateFieldSet6(this, _YargsInstance_completion, completion(this, __classPrivateFieldGet8(this, _YargsInstance_usage, "f"), __classPrivateFieldGet8(this, _YargsInstance_command, "f"), __classPrivateFieldGet8(this, _YargsInstance_shim, "f")), "f");
        __classPrivateFieldGet8(this, _YargsInstance_globalMiddleware, "f").reset();
        __classPrivateFieldSet6(this, _YargsInstance_completionCommand, null, "f");
        __classPrivateFieldSet6(this, _YargsInstance_output, "", "f");
        __classPrivateFieldSet6(this, _YargsInstance_exitError, null, "f");
        __classPrivateFieldSet6(this, _YargsInstance_hasOutput, false, "f");
        this.parsed = false;
        return this;
      }
      [kRebase](base, dir2) {
        return __classPrivateFieldGet8(this, _YargsInstance_shim, "f").path.relative(base, dir2);
      }
      [kRunYargsParserAndExecuteCommands](args, shortCircuit, calledFromCommand, commandIndex = 0, helpOnly = false) {
        let skipValidation = !!calledFromCommand || helpOnly;
        args = args || __classPrivateFieldGet8(this, _YargsInstance_processArgs, "f");
        __classPrivateFieldGet8(this, _YargsInstance_options, "f").__ = __classPrivateFieldGet8(this, _YargsInstance_shim, "f").y18n.__;
        __classPrivateFieldGet8(this, _YargsInstance_options, "f").configuration = this[kGetParserConfiguration]();
        const populateDoubleDash = !!__classPrivateFieldGet8(this, _YargsInstance_options, "f").configuration["populate--"];
        const config = Object.assign({}, __classPrivateFieldGet8(this, _YargsInstance_options, "f").configuration, {
          "populate--": true
        });
        const parsed = __classPrivateFieldGet8(this, _YargsInstance_shim, "f").Parser.detailed(args, Object.assign({}, __classPrivateFieldGet8(this, _YargsInstance_options, "f"), {
          configuration: { "parse-positional-numbers": false, ...config }
        }));
        const argv = Object.assign(parsed.argv, __classPrivateFieldGet8(this, _YargsInstance_parseContext, "f"));
        let argvPromise = void 0;
        const aliases2 = parsed.aliases;
        let helpOptSet = false;
        let versionOptSet = false;
        Object.keys(argv).forEach((key) => {
          if (key === __classPrivateFieldGet8(this, _YargsInstance_helpOpt, "f") && argv[key]) {
            helpOptSet = true;
          } else if (key === __classPrivateFieldGet8(this, _YargsInstance_versionOpt, "f") && argv[key]) {
            versionOptSet = true;
          }
        });
        argv.$0 = this.$0;
        this.parsed = parsed;
        if (commandIndex === 0) {
          __classPrivateFieldGet8(this, _YargsInstance_usage, "f").clearCachedHelpMessage();
        }
        try {
          this[kGuessLocale]();
          if (shortCircuit) {
            return this[kPostProcess](argv, populateDoubleDash, !!calledFromCommand, false);
          }
          if (__classPrivateFieldGet8(this, _YargsInstance_helpOpt, "f")) {
            const helpCmds = [__classPrivateFieldGet8(this, _YargsInstance_helpOpt, "f")].concat(aliases2[__classPrivateFieldGet8(this, _YargsInstance_helpOpt, "f")] || []).filter((k7) => k7.length > 1);
            if (helpCmds.includes("" + argv._[argv._.length - 1])) {
              argv._.pop();
              helpOptSet = true;
            }
          }
          __classPrivateFieldSet6(this, _YargsInstance_isGlobalContext, false, "f");
          const handlerKeys = __classPrivateFieldGet8(this, _YargsInstance_command, "f").getCommands();
          const requestCompletions = __classPrivateFieldGet8(this, _YargsInstance_completion, "f").completionKey in argv;
          const skipRecommendation = helpOptSet || requestCompletions || helpOnly;
          if (argv._.length) {
            if (handlerKeys.length) {
              let firstUnknownCommand;
              for (let i7 = commandIndex || 0, cmd; argv._[i7] !== void 0; i7++) {
                cmd = String(argv._[i7]);
                if (handlerKeys.includes(cmd) && cmd !== __classPrivateFieldGet8(this, _YargsInstance_completionCommand, "f")) {
                  const innerArgv = __classPrivateFieldGet8(this, _YargsInstance_command, "f").runCommand(cmd, this, parsed, i7 + 1, helpOnly, helpOptSet || versionOptSet || helpOnly);
                  return this[kPostProcess](innerArgv, populateDoubleDash, !!calledFromCommand, false);
                } else if (!firstUnknownCommand && cmd !== __classPrivateFieldGet8(this, _YargsInstance_completionCommand, "f")) {
                  firstUnknownCommand = cmd;
                  break;
                }
              }
              if (!__classPrivateFieldGet8(this, _YargsInstance_command, "f").hasDefaultCommand() && __classPrivateFieldGet8(this, _YargsInstance_recommendCommands, "f") && firstUnknownCommand && !skipRecommendation) {
                __classPrivateFieldGet8(this, _YargsInstance_validation, "f").recommendCommands(firstUnknownCommand, handlerKeys);
              }
            }
            if (__classPrivateFieldGet8(this, _YargsInstance_completionCommand, "f") && argv._.includes(__classPrivateFieldGet8(this, _YargsInstance_completionCommand, "f")) && !requestCompletions) {
              if (__classPrivateFieldGet8(this, _YargsInstance_exitProcess, "f"))
                setBlocking(true);
              this.showCompletionScript();
              this.exit(0);
            }
          }
          if (__classPrivateFieldGet8(this, _YargsInstance_command, "f").hasDefaultCommand() && !skipRecommendation) {
            const innerArgv = __classPrivateFieldGet8(this, _YargsInstance_command, "f").runCommand(null, this, parsed, 0, helpOnly, helpOptSet || versionOptSet || helpOnly);
            return this[kPostProcess](innerArgv, populateDoubleDash, !!calledFromCommand, false);
          }
          if (requestCompletions) {
            if (__classPrivateFieldGet8(this, _YargsInstance_exitProcess, "f"))
              setBlocking(true);
            args = [].concat(args);
            const completionArgs = args.slice(args.indexOf(`--${__classPrivateFieldGet8(this, _YargsInstance_completion, "f").completionKey}`) + 1);
            __classPrivateFieldGet8(this, _YargsInstance_completion, "f").getCompletion(completionArgs, (err, completions) => {
              if (err)
                throw new YError(err.message);
              (completions || []).forEach((completion2) => {
                __classPrivateFieldGet8(this, _YargsInstance_logger, "f").log(completion2);
              });
              this.exit(0);
            });
            return this[kPostProcess](argv, !populateDoubleDash, !!calledFromCommand, false);
          }
          if (!__classPrivateFieldGet8(this, _YargsInstance_hasOutput, "f")) {
            if (helpOptSet) {
              if (__classPrivateFieldGet8(this, _YargsInstance_exitProcess, "f"))
                setBlocking(true);
              skipValidation = true;
              this.showHelp("log");
              this.exit(0);
            } else if (versionOptSet) {
              if (__classPrivateFieldGet8(this, _YargsInstance_exitProcess, "f"))
                setBlocking(true);
              skipValidation = true;
              __classPrivateFieldGet8(this, _YargsInstance_usage, "f").showVersion("log");
              this.exit(0);
            }
          }
          if (!skipValidation && __classPrivateFieldGet8(this, _YargsInstance_options, "f").skipValidation.length > 0) {
            skipValidation = Object.keys(argv).some((key) => __classPrivateFieldGet8(this, _YargsInstance_options, "f").skipValidation.indexOf(key) >= 0 && argv[key] === true);
          }
          if (!skipValidation) {
            if (parsed.error)
              throw new YError(parsed.error.message);
            if (!requestCompletions) {
              const validation2 = this[kRunValidation](aliases2, {}, parsed.error);
              if (!calledFromCommand) {
                argvPromise = applyMiddleware(argv, this, __classPrivateFieldGet8(this, _YargsInstance_globalMiddleware, "f").getMiddleware(), true);
              }
              argvPromise = this[kValidateAsync](validation2, argvPromise !== null && argvPromise !== void 0 ? argvPromise : argv);
              if (isPromise(argvPromise) && !calledFromCommand) {
                argvPromise = argvPromise.then(() => {
                  return applyMiddleware(argv, this, __classPrivateFieldGet8(this, _YargsInstance_globalMiddleware, "f").getMiddleware(), false);
                });
              }
            }
          }
        } catch (err) {
          if (err instanceof YError)
            __classPrivateFieldGet8(this, _YargsInstance_usage, "f").fail(err.message, err);
          else
            throw err;
        }
        return this[kPostProcess](argvPromise !== null && argvPromise !== void 0 ? argvPromise : argv, populateDoubleDash, !!calledFromCommand, true);
      }
      [kRunValidation](aliases2, positionalMap, parseErrors, isDefaultCommand) {
        const demandedOptions = { ...this.getDemandedOptions() };
        return (argv) => {
          if (parseErrors)
            throw new YError(parseErrors.message);
          __classPrivateFieldGet8(this, _YargsInstance_validation, "f").nonOptionCount(argv);
          __classPrivateFieldGet8(this, _YargsInstance_validation, "f").requiredArguments(argv, demandedOptions);
          let failedStrictCommands = false;
          if (__classPrivateFieldGet8(this, _YargsInstance_strictCommands, "f")) {
            failedStrictCommands = __classPrivateFieldGet8(this, _YargsInstance_validation, "f").unknownCommands(argv);
          }
          if (__classPrivateFieldGet8(this, _YargsInstance_strict, "f") && !failedStrictCommands) {
            __classPrivateFieldGet8(this, _YargsInstance_validation, "f").unknownArguments(argv, aliases2, positionalMap, !!isDefaultCommand);
          } else if (__classPrivateFieldGet8(this, _YargsInstance_strictOptions, "f")) {
            __classPrivateFieldGet8(this, _YargsInstance_validation, "f").unknownArguments(argv, aliases2, {}, false, false);
          }
          __classPrivateFieldGet8(this, _YargsInstance_validation, "f").limitedChoices(argv);
          __classPrivateFieldGet8(this, _YargsInstance_validation, "f").implications(argv);
          __classPrivateFieldGet8(this, _YargsInstance_validation, "f").conflicting(argv);
        };
      }
      [kSetHasOutput]() {
        __classPrivateFieldSet6(this, _YargsInstance_hasOutput, true, "f");
      }
      [kTrackManuallySetKeys](keys) {
        if (typeof keys === "string") {
          __classPrivateFieldGet8(this, _YargsInstance_options, "f").key[keys] = true;
        } else {
          for (const k7 of keys) {
            __classPrivateFieldGet8(this, _YargsInstance_options, "f").key[k7] = true;
          }
        }
      }
    };
    __name(isYargsInstance, "isYargsInstance");
  }
});

// ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/index.mjs
var Yargs, yargs_default;
var init_yargs = __esm({
  "../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/index.mjs"() {
    init_import_meta_url();
    init_esm();
    init_yargs_factory();
    Yargs = YargsFactory(esm_default2);
    yargs_default = Yargs;
  }
});

// src/ai/index.ts
var aiNamespace, aiFineTuneNamespace;
var init_ai3 = __esm({
  "src/ai/index.ts"() {
    init_import_meta_url();
    init_create_command();
    aiNamespace = createNamespace({
      metadata: {
        description: "\u{1F916} Manage AI models",
        status: "stable",
        owner: "Product: AI",
        category: "Compute & AI"
      }
    });
    aiFineTuneNamespace = createNamespace({
      metadata: {
        description: "Interact with finetune files",
        status: "stable",
        owner: "Product: AI"
      }
    });
  }
});

// src/r2/helpers/bucket.ts
async function listR2Buckets(complianceConfig, accountId, jurisdiction) {
  const headers = {};
  if (jurisdiction !== void 0) {
    headers["cf-r2-jurisdiction"] = jurisdiction;
  }
  const results = await fetchResult(complianceConfig, `/accounts/${accountId}/r2/buckets`, { headers });
  return results.buckets;
}
function tableFromR2BucketsListResponse(buckets) {
  const rows = [];
  for (const bucket of buckets) {
    rows.push({
      name: bucket.name,
      creation_date: bucket.creation_date
    });
  }
  return rows;
}
async function getR2Bucket(complianceConfig, accountId, bucketName, jurisdiction) {
  const headers = {};
  if (jurisdiction !== void 0) {
    headers["cf-r2-jurisdiction"] = jurisdiction;
  }
  const result = await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/r2/buckets/${bucketName}`,
    {
      method: "GET",
      headers
    }
  );
  return result;
}
async function getR2BucketMetrics(complianceConfig, accountId, bucketName, jurisdiction) {
  const today = /* @__PURE__ */ new Date();
  const yesterday = new Date(new Date(today).setDate(today.getDate() - 1));
  let fullBucketName = bucketName;
  if (jurisdiction) {
    fullBucketName = `${jurisdiction}_${bucketName}`;
  }
  const storageMetricsQuery = `
    query getR2StorageMetrics($accountTag: String, $filter: R2StorageAdaptiveGroupsFilter_InputObject) {
      viewer {
        accounts(filter: { accountTag: $accountTag }) {
          r2StorageAdaptiveGroups(
            limit: 1
            filter: $filter
            orderBy: [datetime_DESC]
          ) {
            max {
              objectCount
              payloadSize
              metadataSize
            }
            dimensions {
              datetime
            }
          }
        }
      }
    }
    `;
  const variables = {
    accountTag: accountId,
    filter: {
      datetime_geq: yesterday.toISOString(),
      datetime_leq: today.toISOString(),
      bucketName: fullBucketName
    }
  };
  const storageMetricsResult = await fetchGraphqlResult(complianceConfig, {
    method: "POST",
    body: JSON.stringify({
      query: storageMetricsQuery,
      operationName: "getR2StorageMetrics",
      variables
    }),
    headers: {
      "Content-Type": "application/json"
    }
  });
  if (storageMetricsResult) {
    const metricsData = storageMetricsResult.data?.viewer?.accounts[0]?.r2StorageAdaptiveGroups?.[0];
    if (metricsData && metricsData.max) {
      const objectCount = metricsData.max.objectCount || 0;
      const totalSize = (metricsData.max.payloadSize || 0) + (metricsData.max.metadataSize || 0);
      return {
        objectCount,
        totalSize: prettyBytes(totalSize)
      };
    }
  }
  return { objectCount: 0, totalSize: "0 B" };
}
async function createR2Bucket(complianceConfig, accountId, bucketName, location, jurisdiction, storageClass) {
  const headers = {};
  if (jurisdiction !== void 0) {
    headers["cf-r2-jurisdiction"] = jurisdiction;
  }
  return await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/r2/buckets`,
    {
      method: "POST",
      body: JSON.stringify({
        name: bucketName,
        ...storageClass !== void 0 && { storageClass },
        ...location !== void 0 && { locationHint: location }
      }),
      headers
    }
  );
}
async function updateR2BucketStorageClass(complianceConfig, accountId, bucketName, storageClass, jurisdiction) {
  const headers = {};
  if (jurisdiction !== void 0) {
    headers["cf-r2-jurisdiction"] = jurisdiction;
  }
  headers["cf-r2-storage-class"] = storageClass;
  return await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/r2/buckets/${bucketName}`,
    {
      method: "PATCH",
      headers
    }
  );
}
async function deleteR2Bucket(complianceConfig, accountId, bucketName, jurisdiction) {
  const headers = {};
  if (jurisdiction !== void 0) {
    headers["cf-r2-jurisdiction"] = jurisdiction;
  }
  return await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/r2/buckets/${bucketName}`,
    { method: "DELETE", headers }
  );
}
async function getCORSPolicy(complianceConfig, accountId, bucketName, jurisdiction) {
  const headers = {};
  if (jurisdiction) {
    headers["cf-r2-jurisdiction"] = jurisdiction;
  }
  const result = await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/r2/buckets/${bucketName}/cors`,
    {
      method: "GET",
      headers
    }
  );
  return result.rules;
}
function tableFromCORSPolicyResponse(rules) {
  const rows = [];
  for (const rule of rules) {
    rows.push({
      allowed_origins: rule.allowed?.origins?.join(", ") || "(no origins)",
      allowed_methods: rule.allowed?.methods?.join(", ") || "(no methods)",
      allowed_headers: rule.allowed?.headers?.join(", ") || "(no headers)",
      exposed_headers: rule.exposeHeaders?.join(", ") || "(no exposed headers)",
      max_age_seconds: rule.maxAgeSeconds?.toString() || "(0 seconds)"
    });
  }
  return rows;
}
async function putCORSPolicy(complianceConfig, accountId, bucketName, rules, jurisdiction) {
  const headers = {
    "Content-Type": "application/json"
  };
  if (jurisdiction) {
    headers["cf-r2-jurisdiction"] = jurisdiction;
  }
  await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/r2/buckets/${bucketName}/cors`,
    {
      method: "PUT",
      headers,
      body: JSON.stringify({ rules })
    }
  );
}
async function deleteCORSPolicy(complianceConfig, accountId, bucketName, jurisdiction) {
  const headers = {};
  if (jurisdiction) {
    headers["cf-r2-jurisdiction"] = jurisdiction;
  }
  await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/r2/buckets/${bucketName}/cors`,
    {
      method: "DELETE",
      headers
    }
  );
}
function tableFromBucketLockRulesResponse(rules) {
  const rows = [];
  for (const rule of rules) {
    const conditionString = formatLockCondition(rule.condition);
    rows.push({
      name: rule.id,
      enabled: rule.enabled ? "Yes" : "No",
      prefix: rule.prefix || "(all prefixes)",
      condition: conditionString
    });
  }
  return rows;
}
function formatLockCondition(condition) {
  if (condition.type === "Age" && typeof condition.maxAgeSeconds === "number") {
    const days = condition.maxAgeSeconds / 86400;
    if (days == 1) {
      return `after ${days} day`;
    } else {
      return `after ${days} days`;
    }
  } else if (condition.type === "Date" && condition.date) {
    const date = new Date(condition.date);
    const displayDate = date.toISOString().split("T")[0];
    return `on ${displayDate}`;
  }
  return `indefinitely`;
}
async function getBucketLockRules(complianceConfig, accountId, bucket, jurisdiction) {
  const headers = {};
  if (jurisdiction) {
    headers["cf-r2-jurisdiction"] = jurisdiction;
  }
  const result = await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/r2/buckets/${bucket}/lock`,
    {
      method: "GET",
      headers
    }
  );
  return result.rules;
}
async function putBucketLockRules(complianceConfig, accountId, bucket, rules, jurisdiction) {
  const headers = {
    "Content-Type": "application/json"
  };
  if (jurisdiction) {
    headers["cf-r2-jurisdiction"] = jurisdiction;
  }
  await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/r2/buckets/${bucket}/lock`,
    {
      method: "PUT",
      headers,
      body: JSON.stringify({ rules })
    }
  );
}
function formatCondition(condition) {
  if (condition.type === "Age" && typeof condition.maxAge === "number") {
    const days = condition.maxAge / 86400;
    return `after ${days} days`;
  } else if (condition.type === "Date" && condition.date) {
    const date = new Date(condition.date);
    const displayDate = date.toISOString().split("T")[0];
    return `on ${displayDate}`;
  }
  return "";
}
function tableFromLifecycleRulesResponse(rules) {
  const rows = [];
  for (const rule of rules) {
    const actions = [];
    if (rule.deleteObjectsTransition) {
      const action = "Expire objects";
      const condition = formatCondition(rule.deleteObjectsTransition.condition);
      actions.push(`${action} ${condition}`);
    }
    if (rule.storageClassTransitions && rule.storageClassTransitions.length > 0) {
      for (const transition of rule.storageClassTransitions) {
        const action = "Transition to Infrequent Access";
        const condition = formatCondition(transition.condition);
        actions.push(`${action} ${condition}`);
      }
    }
    if (rule.abortMultipartUploadsTransition) {
      const action = "Abort incomplete multipart uploads";
      const condition = formatCondition(
        rule.abortMultipartUploadsTransition.condition
      );
      actions.push(`${action} ${condition}`);
    }
    rows.push({
      name: rule.id,
      enabled: rule.enabled ? "Yes" : "No",
      prefix: rule.conditions.prefix || "(all prefixes)",
      action: actions.join(", ") || "(none)"
    });
  }
  return rows;
}
async function getLifecycleRules(complianceConfig, accountId, bucket, jurisdiction) {
  const headers = {};
  if (jurisdiction) {
    headers["cf-r2-jurisdiction"] = jurisdiction;
  }
  const result = await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/r2/buckets/${bucket}/lifecycle`,
    {
      method: "GET",
      headers
    }
  );
  return result.rules;
}
async function putLifecycleRules(complianceConfig, accountId, bucket, rules, force, jurisdiction) {
  const headers = {
    "Content-Type": "application/json"
  };
  if (jurisdiction) {
    headers["cf-r2-jurisdiction"] = jurisdiction;
  }
  if (!force) {
    headers["cf-r2-data-catalog-check"] = "true";
  }
  await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/r2/buckets/${bucket}/lifecycle`,
    {
      method: "PUT",
      headers,
      body: JSON.stringify({ rules })
    }
  );
}
var init_bucket = __esm({
  "src/r2/helpers/bucket.ts"() {
    init_import_meta_url();
    init_pretty_bytes();
    init_cfetch();
    __name(listR2Buckets, "listR2Buckets");
    __name(tableFromR2BucketsListResponse, "tableFromR2BucketsListResponse");
    __name(getR2Bucket, "getR2Bucket");
    __name(getR2BucketMetrics, "getR2BucketMetrics");
    __name(createR2Bucket, "createR2Bucket");
    __name(updateR2BucketStorageClass, "updateR2BucketStorageClass");
    __name(deleteR2Bucket, "deleteR2Bucket");
    __name(getCORSPolicy, "getCORSPolicy");
    __name(tableFromCORSPolicyResponse, "tableFromCORSPolicyResponse");
    __name(putCORSPolicy, "putCORSPolicy");
    __name(deleteCORSPolicy, "deleteCORSPolicy");
    __name(tableFromBucketLockRulesResponse, "tableFromBucketLockRulesResponse");
    __name(formatLockCondition, "formatLockCondition");
    __name(getBucketLockRules, "getBucketLockRules");
    __name(putBucketLockRules, "putBucketLockRules");
    __name(formatCondition, "formatCondition");
    __name(tableFromLifecycleRulesResponse, "tableFromLifecycleRulesResponse");
    __name(getLifecycleRules, "getLifecycleRules");
    __name(putLifecycleRules, "putLifecycleRules");
  }
});

// src/ai-search/client.ts
function baseInstanceUrl(accountId) {
  return `/accounts/${accountId}/ai-search/instances`;
}
function baseTokenUrl(accountId) {
  return `/accounts/${accountId}/ai-search/tokens`;
}
async function listInstances(config, queryParams) {
  const accountId = await requireAuth(config);
  return await fetchResult(
    config,
    baseInstanceUrl(accountId),
    { method: "GET" },
    queryParams
  );
}
async function createInstance(config, accountId, body) {
  return await fetchResult(
    config,
    baseInstanceUrl(accountId),
    {
      method: "POST",
      headers: { "content-type": jsonContentType },
      body: JSON.stringify(body)
    }
  );
}
async function getInstance(config, name2) {
  const accountId = await requireAuth(config);
  return await fetchResult(
    config,
    `${baseInstanceUrl(accountId)}/${name2}`,
    { method: "GET" }
  );
}
async function updateInstance(config, name2, body) {
  const accountId = await requireAuth(config);
  return await fetchResult(
    config,
    `${baseInstanceUrl(accountId)}/${name2}`,
    {
      method: "PUT",
      headers: { "content-type": jsonContentType },
      body: JSON.stringify(body)
    }
  );
}
async function deleteInstance(config, name2) {
  const accountId = await requireAuth(config);
  return await fetchResult(
    config,
    `${baseInstanceUrl(accountId)}/${name2}`,
    { method: "DELETE" }
  );
}
async function getInstanceStats(config, name2) {
  const accountId = await requireAuth(config);
  return await fetchResult(
    config,
    `${baseInstanceUrl(accountId)}/${name2}/stats`,
    { method: "GET" }
  );
}
async function searchInstance(config, name2, body) {
  const accountId = await requireAuth(config);
  return await fetchResult(
    config,
    `${baseInstanceUrl(accountId)}/${name2}/search`,
    {
      method: "POST",
      headers: { "content-type": jsonContentType },
      body: JSON.stringify(body)
    }
  );
}
async function listTokens(config, accountId) {
  return await fetchListResult(config, baseTokenUrl(accountId), {
    method: "GET"
  });
}
var jsonContentType;
var init_client3 = __esm({
  "src/ai-search/client.ts"() {
    init_import_meta_url();
    init_cfetch();
    init_user3();
    jsonContentType = "application/json; charset=utf-8;";
    __name(baseInstanceUrl, "baseInstanceUrl");
    __name(baseTokenUrl, "baseTokenUrl");
    __name(listInstances, "listInstances");
    __name(createInstance, "createInstance");
    __name(getInstance, "getInstance");
    __name(updateInstance, "updateInstance");
    __name(deleteInstance, "deleteInstance");
    __name(getInstanceStats, "getInstanceStats");
    __name(searchInstance, "searchInstance");
    __name(listTokens, "listTokens");
  }
});

// src/ai-search/create.ts
var CREATE_NEW_BUCKET, aiSearchCreateCommand;
var init_create = __esm({
  "src/ai-search/create.ts"() {
    init_import_meta_url();
    init_dist();
    init_cfetch();
    init_create_command();
    init_dialogs();
    init_is_interactive();
    init_logger();
    init_bucket();
    init_user3();
    init_client3();
    CREATE_NEW_BUCKET = "__create_new__";
    aiSearchCreateCommand = createCommand({
      metadata: {
        description: "Create a new AI Search instance",
        status: "open beta",
        owner: "Product: AI Search"
      },
      behaviour: {
        printBanner: /* @__PURE__ */ __name((args) => !args.json, "printBanner")
      },
      args: {
        name: {
          type: "string",
          demandOption: true,
          description: "The name of the AI Search instance to create (must be unique)."
        },
        source: {
          type: "string",
          description: "Data source identifier (R2 bucket name or web URL)."
        },
        type: {
          type: "string",
          choices: ["r2", "web-crawler"],
          description: "The source type for the instance."
        },
        "embedding-model": {
          type: "string",
          description: "Embedding model to use."
        },
        "generation-model": {
          type: "string",
          description: "LLM model for chat completions."
        },
        "chunk-size": {
          type: "number",
          description: "Chunk size for document splitting (min: 64)."
        },
        "chunk-overlap": {
          type: "number",
          description: "Overlap between document chunks."
        },
        "max-num-results": {
          type: "number",
          description: "Maximum search results per query."
        },
        reranking: {
          type: "boolean",
          description: "Enable reranking of search results."
        },
        "reranking-model": {
          type: "string",
          description: "Model to use for reranking."
        },
        "hybrid-search": {
          type: "boolean",
          description: "Enable hybrid (keyword + vector) search."
        },
        cache: {
          type: "boolean",
          description: "Enable response caching."
        },
        "score-threshold": {
          type: "number",
          description: "Minimum relevance score threshold (0-1)."
        },
        prefix: {
          type: "string",
          description: "R2 key prefix to scope indexing."
        },
        "include-items": {
          type: "array",
          string: true,
          description: "Glob patterns for items to include."
        },
        "exclude-items": {
          type: "array",
          string: true,
          description: "Glob patterns for items to exclude."
        },
        json: {
          type: "boolean",
          default: false,
          description: "Return output as clean JSON"
        }
      },
      positionalArgs: ["name"],
      async handler(args, { config }) {
        const accountId = await requireAuth(config);
        const existingTokens = await listTokens(config, accountId);
        if (existingTokens.length === 0) {
          if (isNonInteractiveOrCI()) {
            throw new UserError(
              `No AI Search API token found. Create one at:
  https://dash.cloudflare.com/${accountId}/ai/ai-search/tokens
Then re-run this command.`
            );
          }
          logger.log(
            `No AI Search API token found. Create one at:
  https://dash.cloudflare.com/${accountId}/ai/ai-search/tokens`
          );
          let hasToken = false;
          while (!hasToken) {
            const ready = await confirm("Have you created a token?");
            if (!ready) {
              throw new UserError("AI Search instance creation cancelled.");
            }
            const tokens = await listTokens(config, accountId);
            if (tokens.length > 0) {
              hasToken = true;
            } else {
              logger.log(
                "No token found yet. Please create one before continuing."
              );
            }
          }
        }
        const instanceName = args.name;
        let instanceType = args.type;
        if (!instanceType) {
          if (isNonInteractiveOrCI()) {
            throw new UserError(
              "Missing required flag in non-interactive mode: --type\n  Pass --type r2 or --type web-crawler."
            );
          }
          instanceType = await select("Select the source type:", {
            choices: [
              {
                title: "R2",
                description: "Index files from an R2 bucket",
                value: "r2"
              },
              {
                title: "Web",
                description: "Index content from a website",
                value: "web-crawler"
              }
            ],
            defaultOption: 0
          });
        }
        let instanceSource = args.source;
        let webParseType;
        if (instanceType === "r2" && !instanceSource) {
          if (isNonInteractiveOrCI()) {
            throw new UserError(
              "Missing required flag in non-interactive mode: --source\n  Pass --source <r2-bucket-name>."
            );
          }
          const buckets = await listR2Buckets(config, accountId);
          const bucketChoices = [
            ...buckets.map((b11) => ({
              title: b11.name,
              value: b11.name
            })),
            {
              title: "Create new bucket",
              description: "Create a new R2 bucket for this instance",
              value: CREATE_NEW_BUCKET
            }
          ];
          const selectedBucket = await select("Select an R2 bucket:", {
            choices: bucketChoices,
            defaultOption: 0
          });
          if (selectedBucket === CREATE_NEW_BUCKET) {
            const newBucketName = await prompt(
              "Enter a name for the new R2 bucket:",
              {
                validate: /* @__PURE__ */ __name((value) => value.length > 0 || "Bucket name is required.", "validate")
              }
            );
            logger.log(`Creating R2 bucket "${newBucketName}"...`);
            await createR2Bucket(config, accountId, newBucketName);
            logger.log(`Successfully created R2 bucket "${newBucketName}".`);
            instanceSource = newBucketName;
          } else {
            instanceSource = selectedBucket;
          }
        } else if (instanceType === "web-crawler" && !instanceSource) {
          if (isNonInteractiveOrCI()) {
            throw new UserError(
              "Missing required flag in non-interactive mode: --source\n  Pass --source <url> (e.g. --source https://example.com)."
            );
          }
          webParseType = await select("Select the web source type:", {
            choices: [
              {
                title: "Sitemap",
                description: "Crawl and index pages from a sitemap",
                value: "sitemap"
              }
            ],
            defaultOption: 0,
            fallbackOption: 0
          });
          const zones = await fetchPagedListResult(
            config,
            "/zones",
            {},
            new URLSearchParams({ "account.id": accountId })
          );
          if (zones.length === 0) {
            instanceSource = await prompt("Enter the website URL to index:", {
              validate: /* @__PURE__ */ __name((value) => {
                if (value.length === 0) {
                  return "Source is required.";
                }
                try {
                  new URL(value);
                  return true;
                } catch {
                  return "Please enter a valid URL (e.g. https://example.com).";
                }
              }, "validate")
            });
          } else {
            const selectedZone = await select("Select a zone:", {
              choices: zones.map((z7) => ({
                title: z7.name,
                description: z7.id,
                value: z7.name
              })),
              defaultOption: 0
            });
            instanceSource = `https://${selectedZone}`;
          }
        }
        const body = {
          id: instanceName,
          source: instanceSource,
          type: instanceType
        };
        if (args.embeddingModel !== void 0) {
          body.embedding_model = args.embeddingModel;
        }
        if (args.generationModel !== void 0) {
          body.ai_search_model = args.generationModel;
        }
        if (args.chunkSize !== void 0) {
          body.chunk_size = args.chunkSize;
        }
        if (args.chunkOverlap !== void 0) {
          body.chunk_overlap = args.chunkOverlap;
        }
        if (args.maxNumResults !== void 0) {
          body.max_num_results = args.maxNumResults;
        }
        if (args.reranking !== void 0) {
          body.reranking = args.reranking;
        }
        if (args.rerankingModel !== void 0) {
          body.reranking_model = args.rerankingModel;
        }
        if (args.hybridSearch !== void 0) {
          body.hybrid_search_enabled = args.hybridSearch;
        }
        if (args.cache !== void 0) {
          body.cache = args.cache;
        }
        if (args.scoreThreshold !== void 0) {
          body.score_threshold = args.scoreThreshold;
        }
        const sourceParams = {};
        if (args.prefix) {
          sourceParams.prefix = args.prefix;
        }
        if (args.includeItems) {
          sourceParams.include_items = args.includeItems;
        }
        if (args.excludeItems) {
          sourceParams.exclude_items = args.excludeItems;
        }
        if (webParseType) {
          sourceParams.web_crawler = {
            parse_type: webParseType
          };
        }
        if (Object.keys(sourceParams).length > 0) {
          body.source_params = sourceParams;
        }
        if (!args.json) {
          logger.log(`Creating AI Search instance "${instanceName}"...`);
        }
        const instance = await createInstance(config, accountId, body);
        if (args.json) {
          logger.log(JSON.stringify(instance, null, 2));
        } else {
          logger.log(
            `Successfully created AI Search instance "${instance.id}"
  Name:       ${instance.id}
  Type:       ${instance.type}
  Source:     ${instance.source}
  Model:      ${instance.ai_search_model ?? "default"}
  Embedding:  ${instance.embedding_model ?? "default"}`
          );
        }
      }
    });
  }
});

// src/ai-search/delete.ts
var aiSearchDeleteCommand;
var init_delete = __esm({
  "src/ai-search/delete.ts"() {
    init_import_meta_url();
    init_create_command();
    init_dialogs();
    init_logger();
    init_client3();
    aiSearchDeleteCommand = createCommand({
      metadata: {
        description: "Delete an AI Search instance",
        status: "open beta",
        owner: "Product: AI Search"
      },
      args: {
        name: {
          type: "string",
          demandOption: true,
          description: "The name of the AI Search instance to delete."
        },
        force: {
          type: "boolean",
          alias: "y",
          default: false,
          description: "Skip confirmation"
        }
      },
      positionalArgs: ["name"],
      async handler({ name: name2, force }, { config }) {
        if (!force) {
          const confirmedDeletion = await confirm(
            `OK to delete the AI Search instance "${name2}"?`
          );
          if (!confirmedDeletion) {
            logger.log("Deletion cancelled.");
            return;
          }
        }
        logger.log(`Deleting AI Search instance "${name2}"...`);
        await deleteInstance(config, name2);
        logger.log(`Successfully deleted AI Search instance "${name2}"`);
      }
    });
  }
});

// src/ai-search/get.ts
var aiSearchGetCommand;
var init_get = __esm({
  "src/ai-search/get.ts"() {
    init_import_meta_url();
    init_create_command();
    init_logger();
    init_client3();
    aiSearchGetCommand = createCommand({
      metadata: {
        description: "Get details of an AI Search instance",
        status: "open beta",
        owner: "Product: AI Search"
      },
      behaviour: {
        printBanner: /* @__PURE__ */ __name((args) => !args.json, "printBanner")
      },
      args: {
        name: {
          type: "string",
          demandOption: true,
          description: "The name of the AI Search instance."
        },
        json: {
          type: "boolean",
          default: false,
          description: "Return output as clean JSON"
        }
      },
      positionalArgs: ["name"],
      async handler({ name: name2, json }, { config }) {
        const instance = await getInstance(config, name2);
        if (json) {
          logger.log(JSON.stringify(instance, null, 2));
          return;
        }
        logger.table([
          {
            name: instance.id,
            type: instance.type,
            status: instance.status ?? "",
            source: instance.source,
            model: instance.ai_search_model ?? "",
            embedding: instance.embedding_model ?? "",
            created: instance.created_at,
            modified: instance.modified_at
          }
        ]);
      }
    });
  }
});

// src/ai-search/index.ts
var aiSearchNamespace;
var init_ai_search = __esm({
  "src/ai-search/index.ts"() {
    init_import_meta_url();
    init_create_command();
    aiSearchNamespace = createNamespace({
      metadata: {
        description: "\u{1F50D} Manage AI Search instances",
        status: "open beta",
        owner: "Product: AI Search",
        category: "Compute & AI"
      }
    });
  }
});

// src/ai-search/list.ts
var aiSearchListCommand;
var init_list2 = __esm({
  "src/ai-search/list.ts"() {
    init_import_meta_url();
    init_create_command();
    init_logger();
    init_client3();
    aiSearchListCommand = createCommand({
      metadata: {
        description: "List all AI Search instances",
        status: "open beta",
        owner: "Product: AI Search"
      },
      behaviour: {
        printBanner: /* @__PURE__ */ __name((args) => !args.json, "printBanner")
      },
      args: {
        json: {
          type: "boolean",
          default: false,
          description: "Return output as clean JSON"
        },
        page: {
          describe: 'Page number of the results, can configure page size using "per-page"',
          type: "number",
          default: 1
        },
        "per-page": {
          describe: "Number of instances to show per page",
          type: "number"
        }
      },
      async handler(args, { config }) {
        const urlParams = new URLSearchParams();
        urlParams.set("page", args.page.toString());
        if (args.perPage !== void 0) {
          urlParams.set("per_page", args.perPage.toString());
        }
        const instances = await listInstances(config, urlParams);
        if (args.json) {
          logger.log(JSON.stringify(instances, null, 2));
          return;
        }
        if (instances.length === 0 && args.page === 1) {
          logger.warn(`You haven't created any AI Search instances on this account.

Use 'wrangler ai-search create <name>' to create one, or visit
https://developers.cloudflare.com/ai-search/ to get started.`);
          return;
        }
        if (instances.length === 0 && args.page > 1) {
          logger.warn(
            `No instances found on page ${args.page}. Please try a smaller page number.`
          );
          return;
        }
        logger.info(
          `Showing ${instances.length} instance${instances.length !== 1 ? "s" : ""} from page ${args.page}:`
        );
        logger.table(
          instances.map((instance) => ({
            name: instance.id,
            type: instance.type,
            status: instance.status ?? "",
            source: instance.source,
            created: instance.created_at
          }))
        );
      }
    });
  }
});

// src/ai-search/utils.ts
function parseFilters(filters) {
  if (!filters || filters.length === 0) {
    return void 0;
  }
  const result = {};
  for (const f8 of filters) {
    const eqIndex = f8.indexOf("=");
    if (eqIndex === -1) {
      logger.warn(`Ignoring malformed filter "${f8}" (expected key=value)`);
      continue;
    }
    const key = f8.slice(0, eqIndex);
    const value = f8.slice(eqIndex + 1);
    result[key] = value;
  }
  return Object.keys(result).length > 0 ? result : void 0;
}
var init_utils4 = __esm({
  "src/ai-search/utils.ts"() {
    init_import_meta_url();
    init_logger();
    __name(parseFilters, "parseFilters");
  }
});

// src/ai-search/search.ts
var aiSearchSearchCommand;
var init_search2 = __esm({
  "src/ai-search/search.ts"() {
    init_import_meta_url();
    init_create_command();
    init_logger();
    init_client3();
    init_utils4();
    aiSearchSearchCommand = createCommand({
      metadata: {
        description: "Execute a semantic search query against an AI Search instance",
        status: "open beta",
        owner: "Product: AI Search"
      },
      behaviour: {
        printBanner: /* @__PURE__ */ __name((args) => !args.json, "printBanner")
      },
      args: {
        name: {
          type: "string",
          demandOption: true,
          description: "The name of the AI Search instance."
        },
        query: {
          type: "string",
          demandOption: true,
          description: "The search query text."
        },
        "max-num-results": {
          type: "number",
          description: "Override maximum number of results."
        },
        "score-threshold": {
          type: "number",
          description: "Override minimum relevance score (0-1)."
        },
        reranking: {
          type: "boolean",
          description: "Override reranking setting."
        },
        filter: {
          type: "array",
          string: true,
          description: "Metadata filter as key=value (repeatable, e.g. --filter type=docs --filter lang=en)."
        },
        json: {
          type: "boolean",
          default: false,
          description: "Return output as clean JSON"
        }
      },
      positionalArgs: ["name"],
      async handler(args, { config }) {
        const messages = [{ role: "user", content: args.query }];
        const filterStrings = args.filter?.map(String);
        const filters = parseFilters(filterStrings);
        const body = { messages, filters };
        if (args.maxNumResults !== void 0) {
          body.max_num_results = args.maxNumResults;
        }
        if (args.scoreThreshold !== void 0) {
          body.score_threshold = args.scoreThreshold;
        }
        if (args.reranking !== void 0) {
          body.reranking = args.reranking;
        }
        const result = await searchInstance(config, args.name, body);
        if (args.json) {
          logger.log(JSON.stringify(result, null, 2));
          return;
        }
        logger.log(
          `Search query: "${result.search_query}"  (${result.chunks.length} results)
`
        );
        if (result.chunks.length === 0) {
          logger.log("No results found.");
          return;
        }
        logger.table(
          result.chunks.map((chunk, i7) => ({
            "#": String(i7 + 1),
            score: chunk.score.toFixed(4),
            key: chunk.item?.key ?? "",
            text: chunk.text.length > 80 ? chunk.text.slice(0, 80) + "..." : chunk.text,
            type: chunk.type
          }))
        );
      }
    });
  }
});

// src/ai-search/stats.ts
var aiSearchStatsCommand;
var init_stats2 = __esm({
  "src/ai-search/stats.ts"() {
    init_import_meta_url();
    init_create_command();
    init_logger();
    init_client3();
    aiSearchStatsCommand = createCommand({
      metadata: {
        description: "Get usage statistics for an AI Search instance",
        status: "open beta",
        owner: "Product: AI Search"
      },
      behaviour: {
        printBanner: /* @__PURE__ */ __name((args) => !args.json, "printBanner")
      },
      args: {
        name: {
          type: "string",
          demandOption: true,
          description: "The name of the AI Search instance."
        },
        json: {
          type: "boolean",
          default: false,
          description: "Return output as clean JSON"
        }
      },
      positionalArgs: ["name"],
      async handler({ name: name2, json }, { config }) {
        const stats = await getInstanceStats(config, name2);
        if (json) {
          logger.log(JSON.stringify(stats, null, 2));
          return;
        }
        logger.table([
          {
            Queued: String(stats.queued),
            Processing: String(stats.running),
            Indexed: String(stats.completed),
            Skipped: String(stats.skipped),
            Outdated: String(stats.outdated),
            Errors: String(stats.error)
          }
        ]);
      }
    });
  }
});

// src/ai-search/update.ts
var aiSearchUpdateCommand;
var init_update = __esm({
  "src/ai-search/update.ts"() {
    init_import_meta_url();
    init_dist();
    init_create_command();
    init_logger();
    init_client3();
    aiSearchUpdateCommand = createCommand({
      metadata: {
        description: "Update an AI Search instance configuration",
        status: "open beta",
        owner: "Product: AI Search"
      },
      behaviour: {
        printBanner: /* @__PURE__ */ __name((args) => !args.json, "printBanner")
      },
      args: {
        name: {
          type: "string",
          demandOption: true,
          description: "The name of the AI Search instance to update."
        },
        "embedding-model": {
          type: "string",
          description: "Update the embedding model."
        },
        "generation-model": {
          type: "string",
          description: "Update the LLM model for chat completions."
        },
        "chunk-size": {
          type: "number",
          description: "Update the chunk size."
        },
        "chunk-overlap": {
          type: "number",
          description: "Update the chunk overlap."
        },
        "max-num-results": {
          type: "number",
          description: "Update max search results per query."
        },
        reranking: {
          type: "boolean",
          description: "Enable or disable reranking."
        },
        "reranking-model": {
          type: "string",
          description: "Update the reranking model."
        },
        "hybrid-search": {
          type: "boolean",
          description: "Enable or disable hybrid search."
        },
        cache: {
          type: "boolean",
          description: "Enable or disable caching."
        },
        "score-threshold": {
          type: "number",
          description: "Update the minimum relevance score threshold (0-1)."
        },
        paused: {
          type: "boolean",
          description: "Pause or resume the instance."
        },
        json: {
          type: "boolean",
          default: false,
          description: "Return output as clean JSON"
        }
      },
      positionalArgs: ["name"],
      async handler(args, { config }) {
        const body = {};
        if (args.embeddingModel !== void 0) {
          body.embedding_model = args.embeddingModel;
        }
        if (args.generationModel !== void 0) {
          body.ai_search_model = args.generationModel;
        }
        if (args.chunkSize !== void 0) {
          body.chunk_size = args.chunkSize;
        }
        if (args.chunkOverlap !== void 0) {
          body.chunk_overlap = args.chunkOverlap;
        }
        if (args.maxNumResults !== void 0) {
          body.max_num_results = args.maxNumResults;
        }
        if (args.reranking !== void 0) {
          body.reranking = args.reranking;
        }
        if (args.rerankingModel !== void 0) {
          body.reranking_model = args.rerankingModel;
        }
        if (args.hybridSearch !== void 0) {
          body.hybrid_search_enabled = args.hybridSearch;
        }
        if (args.cache !== void 0) {
          body.cache = args.cache;
        }
        if (args.scoreThreshold !== void 0) {
          body.score_threshold = args.scoreThreshold;
        }
        if (args.paused !== void 0) {
          body.paused = args.paused;
        }
        if (Object.keys(body).length === 0) {
          throw new UserError(
            "No fields to update. Provide at least one flag (e.g. --paused, --cache)."
          );
        }
        if (!args.json) {
          logger.log(`Updating AI Search instance "${args.name}"...`);
        }
        const instance = await updateInstance(config, args.name, body);
        if (args.json) {
          logger.log(JSON.stringify(instance, null, 2));
          return;
        }
        logger.log(`Successfully updated AI Search instance "${instance.id}"`);
      }
    });
  }
});

// src/ai/utils.ts
function getErrorMessage(error2) {
  return `${error2.text || error2.toString()}${error2.notes ? ` ${error2.notes.map((note) => note.text).join(", ")}` : ""}`;
}
function truncate2(str, maxLen) {
  return str.slice(0, maxLen) + (str.length > maxLen ? "..." : "");
}
function truncateDescription(description, alreadyUsed) {
  if (description === void 0 || description === null) {
    return "";
  }
  if (process.stdout.columns === void 0) {
    return truncate2(description, 100);
  }
  return truncate2(description, process.stdout.columns - alreadyUsed);
}
async function aiCatalogList(complianceConfig, accountId, partialUrl) {
  const pageSize = 50;
  let page = 1;
  const results = [];
  while (results.length % pageSize === 0) {
    const json = await fetchResult(
      complianceConfig,
      `/accounts/${accountId}/ai/${partialUrl}`,
      {},
      new URLSearchParams({
        per_page: pageSize.toString(),
        page: page.toString()
      })
    );
    page++;
    results.push(...json);
    if (json.length < pageSize) {
      break;
    }
  }
  return results;
}
async function aiFinetuneList(complianceConfig, accountId) {
  const results = await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/ai/finetunes`,
    {},
    new URLSearchParams({})
  );
  return results;
}
var listCatalogEntries, listFinetuneEntries;
var init_utils5 = __esm({
  "src/ai/utils.ts"() {
    init_import_meta_url();
    init_cfetch();
    __name(getErrorMessage, "getErrorMessage");
    __name(truncate2, "truncate");
    __name(truncateDescription, "truncateDescription");
    __name(aiCatalogList, "aiCatalogList");
    __name(aiFinetuneList, "aiFinetuneList");
    listCatalogEntries = /* @__PURE__ */ __name(async (complianceConfig, accountId) => {
      return await aiCatalogList(complianceConfig, accountId, "models/search");
    }, "listCatalogEntries");
    listFinetuneEntries = /* @__PURE__ */ __name(async (complianceConfig, accountId) => {
      return await aiFinetuneList(complianceConfig, accountId);
    }, "listFinetuneEntries");
  }
});
var import_undici6, requiredAssets, aiFineTuneCreateCommand;
var init_createFinetune = __esm({
  "src/ai/createFinetune.ts"() {
    init_import_meta_url();
    import_undici6 = __toESM(require_undici());
    init_cfetch();
    init_create_command();
    init_logger();
    init_user3();
    init_utils5();
    requiredAssets = ["adapter_config.json", "adapter_model.safetensors"];
    aiFineTuneCreateCommand = createCommand({
      metadata: {
        description: "Create finetune and upload assets",
        status: "stable",
        owner: "Product: AI"
      },
      args: {
        model_name: {
          type: "string",
          demandOption: true,
          description: "The catalog model name"
        },
        finetune_name: {
          type: "string",
          demandOption: true,
          description: "The finetune name"
        },
        folder_path: {
          type: "string",
          demandOption: true,
          description: "The folder path containing the finetune assets"
        }
      },
      positionalArgs: ["model_name", "finetune_name", "folder_path"],
      async handler({ finetune_name, model_name, folder_path }, { config }) {
        const accountId = await requireAuth(config);
        logger.log(
          `\u{1F300} Creating new finetune "${finetune_name}" for model "${model_name}"...`
        );
        try {
          const files = fs29__namespace.default.readdirSync(folder_path, {
            withFileTypes: true
          });
          if (requiredAssets.every(
            (asset) => files.some((file3) => file3.name === asset)
          )) {
            try {
              const finetune = await fetchResult(
                config,
                `/accounts/${accountId}/ai/finetunes`,
                {
                  method: "POST",
                  body: JSON.stringify({
                    model: model_name,
                    name: finetune_name,
                    description: ""
                  })
                }
              );
              for (let i7 = 0; i7 < files.length; i7++) {
                const file3 = files[i7];
                if (requiredAssets.includes(file3.name)) {
                  const filePath = path3__namespace.default.join(folder_path, file3.name);
                  logger.log(
                    `\u{1F300} Uploading file "${filePath}" to "${finetune_name}"...`
                  );
                  try {
                    const formdata = new import_undici6.FormData();
                    formdata.set("file_name", file3.name);
                    formdata.set("file", new Blob([fs29__namespace.default.readFileSync(filePath)]));
                    await fetchResult(
                      config,
                      `/accounts/${accountId}/ai/finetunes/${finetune.id}/finetune-assets`,
                      {
                        method: "POST",
                        body: formdata
                      }
                    );
                  } catch (e10) {
                    logger.error(
                      `\u{1F6A8} Couldn't upload file: ${getErrorMessage(
                        e10
                      )}, quiting...`
                    );
                    return;
                  }
                }
              }
              logger.log(
                `\u2705 Assets uploaded, finetune "${finetune_name}" is ready to use.`
              );
            } catch (e10) {
              logger.error(
                `\u{1F6A8} Finetune couldn't be created: ${getErrorMessage(e10)}`
              );
            }
          } else {
            logger.error(
              `\u{1F6A8} Asset missing. Required assets: ${requiredAssets.join(", ")}`
            );
          }
        } catch (e10) {
          logger.error(
            `\u{1F6A8} Folder does not exist: ${getErrorMessage(e10)}`
          );
        }
      }
    });
  }
});

// src/ai/listCatalog.ts
var aiModelsCommand;
var init_listCatalog = __esm({
  "src/ai/listCatalog.ts"() {
    init_import_meta_url();
    init_create_command();
    init_logger();
    init_user3();
    init_utils5();
    aiModelsCommand = createCommand({
      metadata: {
        description: "List catalog models",
        status: "stable",
        owner: "Product: AI"
      },
      behaviour: {
        printBanner: /* @__PURE__ */ __name((args) => !args.json, "printBanner")
      },
      args: {
        json: {
          type: "boolean",
          description: "Return output as JSON",
          default: false
        }
      },
      async handler({ json }, { config }) {
        const accountId = await requireAuth(config);
        const entries2 = await listCatalogEntries(config, accountId);
        if (json) {
          logger.log(JSON.stringify(entries2, null, 2));
        } else {
          if (entries2.length === 0) {
            logger.log(`No models found.`);
          } else {
            logger.table(
              entries2.map((entry) => ({
                model: entry.id,
                name: entry.name,
                description: truncateDescription(
                  entry.description,
                  entry.id.length + entry.name.length + (entry.task ? entry.task.name.length : 0) + 10
                ),
                task: entry.task ? entry.task.name : ""
              }))
            );
          }
        }
      }
    });
  }
});

// src/ai/listFinetune.ts
var aiFineTuneListCommand;
var init_listFinetune = __esm({
  "src/ai/listFinetune.ts"() {
    init_import_meta_url();
    init_create_command();
    init_logger();
    init_user3();
    init_utils5();
    aiFineTuneListCommand = createCommand({
      metadata: {
        description: "List your finetune files",
        status: "stable",
        owner: "Product: AI"
      },
      behaviour: {
        printBanner: /* @__PURE__ */ __name((args) => !args.json, "printBanner")
      },
      args: {
        json: {
          type: "boolean",
          description: "Return output as JSON",
          default: false
        }
      },
      async handler({ json }, { config }) {
        const accountId = await requireAuth(config);
        const entries2 = await listFinetuneEntries(config, accountId);
        if (json) {
          logger.log(JSON.stringify(entries2, null, 2));
        } else {
          if (entries2.length === 0) {
            logger.log(`No finetune assets found.`);
          } else {
            logger.table(
              entries2.map((entry) => ({
                finetune_id: entry.id,
                name: entry.name,
                description: truncateDescription(
                  entry.description,
                  entry.id.length + entry.name.length + 10
                )
              }))
            );
          }
        }
      }
    });
  }
});

// src/browser-rendering/utils.ts
function parseErrorMessage(text) {
  try {
    const errorJson = JSON.parse(text);
    if (errorJson.errors && Array.isArray(errorJson.errors)) {
      return errorJson.errors.map((e10) => e10.message || JSON.stringify(e10)).join(", ");
    } else if (errorJson.error) {
      return errorJson.error;
    } else if (errorJson.message) {
      return errorJson.message;
    }
  } catch {
  }
  return text;
}
async function fetchBrowserRendering(config, resource, options = {}) {
  const { method = "GET", queryParams } = options;
  let url4 = resource;
  if (queryParams && Object.keys(queryParams).length > 0) {
    const params = new URLSearchParams();
    for (const [key, value] of Object.entries(queryParams)) {
      params.append(key, String(value));
    }
    url4 = `${resource}?${params.toString()}`;
  }
  const response = await performApiFetch(config, url4, { method });
  const text = await response.text();
  if (!response.ok) {
    const errorMessage = parseErrorMessage(text);
    throw new APIError({
      text: `Browser Rendering API error: ${errorMessage}`,
      notes: [{ text: `${method} ${url4} -> ${response.status}` }],
      status: response.status
    });
  }
  try {
    return JSON.parse(text);
  } catch {
    throw new APIError({
      text: "Received a malformed response from the Browser Rendering API",
      notes: [
        { text: text.length > 100 ? `${text.substring(0, 100)}...` : text },
        { text: `${method} ${url4} -> ${response.status}` }
      ],
      status: response.status
    });
  }
}
var init_utils6 = __esm({
  "src/browser-rendering/utils.ts"() {
    init_import_meta_url();
    init_dist();
    init_cfetch();
    __name(parseErrorMessage, "parseErrorMessage");
    __name(fetchBrowserRendering, "fetchBrowserRendering");
  }
});

// src/browser-rendering/create.ts
var MIN_KEEP_ALIVE_SECONDS, MAX_KEEP_ALIVE_SECONDS, browserCreateCommand;
var init_create2 = __esm({
  "src/browser-rendering/create.ts"() {
    init_import_meta_url();
    init_dist();
    init_create_command();
    init_is_interactive();
    init_logger();
    init_open_in_browser();
    init_user3();
    init_utils6();
    MIN_KEEP_ALIVE_SECONDS = 60;
    MAX_KEEP_ALIVE_SECONDS = 600;
    browserCreateCommand = createCommand({
      metadata: {
        description: "Create a new browser rendering session",
        status: "open beta",
        owner: "Product: Browser Rendering"
      },
      behaviour: {
        printBanner: /* @__PURE__ */ __name((args) => !args.json, "printBanner")
      },
      args: {
        lab: {
          type: "boolean",
          description: "Enable lab browser session with experimental Chrome features (e.g., WebMCP)",
          default: false
        },
        keepAlive: {
          type: "number",
          alias: "k",
          description: `Keep-alive duration in seconds (${MIN_KEEP_ALIVE_SECONDS}-${MAX_KEEP_ALIVE_SECONDS})`
        },
        json: {
          type: "boolean",
          description: "Return session info as JSON",
          default: false
        },
        open: {
          type: "boolean",
          description: "Open DevTools in browser (default: true in interactive mode)"
        }
      },
      async handler({ lab, keepAlive, json, open: open3 }, { config }) {
        if (keepAlive !== void 0) {
          const inRange = keepAlive >= MIN_KEEP_ALIVE_SECONDS && keepAlive <= MAX_KEEP_ALIVE_SECONDS;
          if (!inRange) {
            throw new UserError(
              `--keep-alive must be between ${MIN_KEEP_ALIVE_SECONDS} and ${MAX_KEEP_ALIVE_SECONDS} seconds`
            );
          }
        }
        const accountId = await requireAuth(config);
        const queryParams = {
          targets: true
        };
        if (lab) {
          queryParams.lab = true;
        }
        if (keepAlive !== void 0) {
          queryParams.keep_alive = keepAlive * 1e3;
        }
        const response = await fetchBrowserRendering(
          config,
          `/accounts/${accountId}/browser-rendering/devtools/browser`,
          { method: "POST", queryParams }
        );
        if (response.targets.length === 0) {
          throw new UserError(
            `Session created (${response.sessionId}) but no targets found`
          );
        }
        if (json) {
          logger.json(response);
        } else {
          const pageTarget = response.targets.find((t13) => t13.type === "page") ?? response.targets[0];
          const shouldOpen = open3 ?? !isNonInteractiveOrCI();
          logger.log(`Session created: ${response.sessionId}`);
          if (pageTarget.devtoolsFrontendUrl) {
            if (shouldOpen) {
              logger.log(`Opening DevTools...`);
              await openInBrowser(pageTarget.devtoolsFrontendUrl);
            } else {
              logger.log(pageTarget.devtoolsFrontendUrl);
            }
          } else {
            logger.log(`No DevTools URL available for target "${pageTarget.id}"`);
          }
        }
      }
    });
  }
});

// src/browser-rendering/close.ts
var browserCloseCommand;
var init_close = __esm({
  "src/browser-rendering/close.ts"() {
    init_import_meta_url();
    init_create_command();
    init_logger();
    init_user3();
    init_utils6();
    browserCloseCommand = createCommand({
      metadata: {
        description: "Close a browser rendering session",
        status: "open beta",
        owner: "Product: Browser Rendering"
      },
      behaviour: {
        printBanner: /* @__PURE__ */ __name((args) => !args.json, "printBanner")
      },
      positionalArgs: ["sessionId"],
      args: {
        sessionId: {
          type: "string",
          description: "The session ID to close",
          demandOption: true
        },
        json: {
          type: "boolean",
          description: "Return result as JSON",
          default: false
        }
      },
      async handler({ sessionId, json }, { config }) {
        const accountId = await requireAuth(config);
        const response = await fetchBrowserRendering(
          config,
          `/accounts/${accountId}/browser-rendering/devtools/browser/${sessionId}`,
          { method: "DELETE" }
        );
        if (json) {
          logger.json({
            sessionId,
            status: response.status
          });
        } else {
          logger.log(`Session ${sessionId} ${response.status}.`);
        }
      }
    });
  }
});

// src/browser-rendering/list.ts
var browserListCommand;
var init_list3 = __esm({
  "src/browser-rendering/list.ts"() {
    init_import_meta_url();
    init_create_command();
    init_logger();
    init_user3();
    init_utils6();
    browserListCommand = createCommand({
      metadata: {
        description: "List active browser rendering sessions",
        status: "open beta",
        owner: "Product: Browser Rendering"
      },
      behaviour: {
        printBanner: /* @__PURE__ */ __name((args) => !args.json, "printBanner")
      },
      args: {
        json: {
          type: "boolean",
          description: "Return output as JSON",
          default: false
        }
      },
      async handler({ json }, { config }) {
        const accountId = await requireAuth(config);
        const sessions = await fetchBrowserRendering(
          config,
          `/accounts/${accountId}/browser-rendering/devtools/session`
        );
        if (json) {
          logger.json(sessions);
          return;
        }
        if (sessions.length === 0) {
          logger.log("No active browser rendering sessions found.");
          return;
        }
        logger.table(
          sessions.map((session) => ({
            "Session ID": session.sessionId,
            "Start Time": new Date(session.startTime).toLocaleString(),
            "Connection ID": session.connectionId ?? "-",
            "Connected At": session.connectionStartTime ? new Date(session.connectionStartTime).toLocaleString() : "-"
          }))
        );
      }
    });
  }
});

// src/browser-rendering/view.ts
function throwIfNonInteractive(message, json) {
  if (json) {
    throw new JsonFriendlyFatalError(JSON.stringify({ error: message }));
  }
  if (isNonInteractiveOrCI()) {
    throw new UserError(message);
  }
}
function findTargetBySelector(targets, selector) {
  const byId = targets.filter((t13) => t13.id === selector);
  if (byId.length > 0) {
    return byId;
  }
  const byUrl = targets.filter((t13) => t13.url?.includes(selector));
  if (byUrl.length > 0) {
    return byUrl;
  }
  const selectorLower = selector.toLowerCase();
  const byTitle = targets.filter(
    (t13) => t13.title?.toLowerCase().includes(selectorLower)
  );
  return byTitle;
}
function formatTargetForDisplay(target) {
  if (target.url && target.title) {
    return `${target.title} (${target.url})`;
  }
  if (target.title) {
    return target.title;
  }
  if (target.url) {
    return target.url;
  }
  return target.id;
}
function formatSessionForDisplay(session) {
  const date = new Date(session.startTime);
  const dateStr = date.toLocaleString();
  return `${session.sessionId} (started ${dateStr})`;
}
var browserViewCommand;
var init_view = __esm({
  "src/browser-rendering/view.ts"() {
    init_import_meta_url();
    init_dist();
    init_create_command();
    init_dialogs();
    init_is_interactive();
    init_logger();
    init_open_in_browser();
    init_user3();
    init_utils6();
    __name(throwIfNonInteractive, "throwIfNonInteractive");
    __name(findTargetBySelector, "findTargetBySelector");
    __name(formatTargetForDisplay, "formatTargetForDisplay");
    __name(formatSessionForDisplay, "formatSessionForDisplay");
    browserViewCommand = createCommand({
      metadata: {
        description: "View a live browser session",
        status: "open beta",
        owner: "Product: Browser Rendering"
      },
      behaviour: {
        printBanner: /* @__PURE__ */ __name((args) => !args.json, "printBanner")
      },
      positionalArgs: ["sessionId"],
      args: {
        sessionId: {
          type: "string",
          description: "The session ID to inspect (optional if only one session exists)"
        },
        target: {
          type: "string",
          description: "Target selector (matches id exactly, or url/title by substring)"
        },
        json: {
          type: "boolean",
          description: "Return live browser session URL(s) as JSON",
          default: false
        },
        open: {
          type: "boolean",
          description: "Open in browser (default: true in interactive mode)"
        }
      },
      async handler({ sessionId: providedSessionId, target: targetSelector, json, open: open3 }, { config }) {
        const accountId = await requireAuth(config);
        let sessionId;
        if (providedSessionId) {
          sessionId = providedSessionId;
        } else {
          const sessions = await fetchBrowserRendering(
            config,
            `/accounts/${accountId}/browser-rendering/devtools/session`
          );
          if (sessions.length === 0) {
            throw new UserError(
              "No active browser rendering sessions found. Use `wrangler browser create` to create one."
            );
          }
          if (sessions.length === 1) {
            sessionId = sessions[0].sessionId;
          } else {
            throwIfNonInteractive(
              "Multiple sessions found. Provide a session ID explicitly.",
              json
            );
            sessionId = await select("Select a session:", {
              choices: sessions.map((s7) => ({
                title: formatSessionForDisplay(s7),
                value: s7.sessionId
              })),
              defaultOption: 0
            });
          }
        }
        const targets = await fetchBrowserRendering(
          config,
          `/accounts/${accountId}/browser-rendering/devtools/browser/${sessionId}/json`
        );
        if (targets.length === 0) {
          throw new UserError(`No targets found for session "${sessionId}"`);
        }
        const pageTargets = targets.filter((t13) => t13.type === "page");
        const selectableTargets = pageTargets.length > 0 ? pageTargets : targets;
        let selectedTarget;
        if (targetSelector) {
          const matchedTargets = findTargetBySelector(targets, targetSelector);
          if (matchedTargets.length === 0) {
            throw new UserError(
              `No target found matching "${targetSelector}". Available targets:
${targets.map((t13) => `  - ${t13.id}: ${formatTargetForDisplay(t13)}`).join("\n")}`
            );
          }
          if (matchedTargets.length > 1) {
            throw new UserError(
              `Multiple targets match "${targetSelector}". Please be more specific:
${matchedTargets.map((t13) => `  - ${t13.id}: ${formatTargetForDisplay(t13)}`).join("\n")}`
            );
          }
          selectedTarget = matchedTargets[0];
        } else if (selectableTargets.length === 1) {
          selectedTarget = selectableTargets[0];
        } else {
          throwIfNonInteractive(
            "Multiple targets found. Use --target <selector> to specify which one.",
            json
          );
          const selectedId = await select(
            `Multiple targets found. Select a target:`,
            {
              choices: selectableTargets.map((t13) => ({
                title: formatTargetForDisplay(t13),
                value: t13.id
              })),
              defaultOption: 0
            }
          );
          const found = selectableTargets.find((t13) => t13.id === selectedId);
          if (!found) {
            throw new UserError(`Target "${selectedId}" not found`);
          }
          selectedTarget = found;
        }
        const shouldOpen = open3 ?? (!json && !isNonInteractiveOrCI());
        if (json) {
          logger.json(selectedTarget);
        } else if (selectedTarget.devtoolsFrontendUrl) {
          if (shouldOpen) {
            logger.log(`Opening live browser session "${sessionId}"...`);
            await openInBrowser(selectedTarget.devtoolsFrontendUrl);
          } else {
            logger.log(selectedTarget.devtoolsFrontendUrl);
          }
        } else {
          logger.log(
            `No live browser session URL available for target "${selectedTarget.id}" in session ${sessionId}`
          );
        }
      }
    });
  }
});

// src/browser-rendering/index.ts
var browserNamespace;
var init_browser_rendering2 = __esm({
  "src/browser-rendering/index.ts"() {
    init_import_meta_url();
    init_create_command();
    init_create2();
    init_close();
    init_list3();
    init_view();
    browserNamespace = createNamespace({
      metadata: {
        description: "\u{1F310} Manage Browser Rendering sessions",
        status: "open beta",
        owner: "Product: Browser Rendering",
        category: "Compute & AI"
      }
    });
  }
});

// src/build/index.ts
var buildCommand2;
var init_build4 = __esm({
  "src/build/index.ts"() {
    init_import_meta_url();
    init_create_command();
    init_src3();
    buildCommand2 = createCommand({
      metadata: {
        description: "\u{1F528} Build a Worker",
        owner: "Workers: Authoring and Testing",
        status: "stable",
        hidden: true
      },
      behaviour: {
        printBanner: false,
        provideConfig: false
      },
      async handler(buildArgs) {
        const { wrangler } = createCLIParser([
          "deploy",
          "--dry-run",
          "--outdir=dist",
          ...buildArgs.env ? ["--env", buildArgs.env] : [],
          ...buildArgs.config ? ["--config", buildArgs.config] : []
        ]);
        await wrangler.parse();
      }
    });
  }
});

// src/api/mtls-certificate.ts
async function uploadMTlsCertificateFromFs(complianceConfig, accountId, details) {
  return await uploadMTlsCertificate(complianceConfig, accountId, {
    certificateChain: readFileSync(details.certificateChainFilename),
    privateKey: readFileSync(details.privateKeyFilename),
    name: details.name
  });
}
async function uploadCaCertificateFromFs(complianceConfig, accountId, details) {
  return await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/mtls_certificates`,
    {
      method: "POST",
      body: JSON.stringify({
        name: details.name,
        certificates: readFileSync(details.certificates),
        ca: details.ca
      })
    }
  );
}
async function uploadMTlsCertificate(complianceConfig, accountId, body) {
  return await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/mtls_certificates`,
    {
      method: "POST",
      body: JSON.stringify({
        name: body.name,
        certificates: body.certificateChain,
        private_key: body.privateKey,
        ca: false
      })
    }
  );
}
async function getMTlsCertificate(complianceConfig, accountId, id) {
  return await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/mtls_certificates/${id}`,
    {}
  );
}
async function listMTlsCertificates(complianceConfig, accountId, filter2, ca2 = false) {
  const params = new URLSearchParams();
  if (!ca2) {
    params.append("ca", String(false));
  }
  if (filter2.name) {
    params.append("name", filter2.name);
  }
  return await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/mtls_certificates`,
    {},
    params
  );
}
async function getMTlsCertificateByName(complianceConfig, accountId, name2, ca2 = false) {
  const certificates = await listMTlsCertificates(
    complianceConfig,
    accountId,
    { name: name2 },
    ca2
  );
  if (certificates.length === 0) {
    throw new ErrorMTlsCertificateNameNotFound(
      `certificate not found with name "${name2}"`
    );
  }
  if (certificates.length > 1) {
    throw new ErrorMTlsCertificateManyNamesMatch(
      `multiple certificates found with name "${name2}"`
    );
  }
  const certificate = certificates[0];
  return certificate;
}
async function deleteMTlsCertificate(complianceConfig, accountId, certificateId) {
  return await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/mtls_certificates/${certificateId}`,
    { method: "DELETE" }
  );
}
var ErrorMTlsCertificateNameNotFound, ErrorMTlsCertificateManyNamesMatch;
var init_mtls_certificate = __esm({
  "src/api/mtls-certificate.ts"() {
    init_import_meta_url();
    init_dist();
    init_cfetch();
    ErrorMTlsCertificateNameNotFound = class extends UserError {
      static {
        __name(this, "ErrorMTlsCertificateNameNotFound");
      }
    };
    ErrorMTlsCertificateManyNamesMatch = class extends UserError {
      static {
        __name(this, "ErrorMTlsCertificateManyNamesMatch");
      }
    };
    __name(uploadMTlsCertificateFromFs, "uploadMTlsCertificateFromFs");
    __name(uploadCaCertificateFromFs, "uploadCaCertificateFromFs");
    __name(uploadMTlsCertificate, "uploadMTlsCertificate");
    __name(getMTlsCertificate, "getMTlsCertificate");
    __name(listMTlsCertificates, "listMTlsCertificates");
    __name(getMTlsCertificateByName, "getMTlsCertificateByName");
    __name(deleteMTlsCertificate, "deleteMTlsCertificate");
  }
});

// src/cert/cert.ts
var certNamespace, certUploadNamespace, certUploadMtlsCommand, certUploadCaCertCommand, certListCommand, certDeleteCommand;
var init_cert = __esm({
  "src/cert/cert.ts"() {
    init_import_meta_url();
    init_mtls_certificate();
    init_create_command();
    init_dialogs();
    init_logger();
    init_user3();
    certNamespace = createNamespace({
      metadata: {
        description: "\u{1FAAA} Manage client mTLS certificates and CA certificate chains used for secured connections",
        status: "open beta",
        owner: "Product: SSL",
        category: "Networking & security"
      }
    });
    certUploadNamespace = createNamespace({
      metadata: {
        description: "Upload a new cert",
        status: "open beta",
        owner: "Product: SSL"
      }
    });
    certUploadMtlsCommand = createCommand({
      metadata: {
        description: "Upload an mTLS certificate",
        status: "stable",
        owner: "Product: SSL"
      },
      args: {
        cert: {
          description: "The path to a certificate file (.pem) containing a chain of certificates to upload",
          type: "string",
          demandOption: true
        },
        key: {
          description: "The path to a file containing the private key for your leaf certificate",
          type: "string",
          demandOption: true
        },
        name: {
          description: "The name for the certificate",
          type: "string"
        }
      },
      async handler({ cert, key, name: name2 }, { config }) {
        const accountId = await requireAuth(config);
        logger.log(
          name2 ? `Uploading mTLS Certificate ${name2}...` : `Uploading mTLS Certificate...`
        );
        const certResponse = await uploadMTlsCertificateFromFs(config, accountId, {
          certificateChainFilename: cert,
          privateKeyFilename: key,
          name: name2
        });
        const expiresOn = new Date(certResponse.expires_on).toLocaleDateString();
        logger.log(
          name2 ? `Success! Uploaded mTLS Certificate ${name2}` : `Success! Uploaded mTLS Certificate`
        );
        logger.log(`ID: ${certResponse.id}`);
        logger.log(`Issuer: ${certResponse.issuer}`);
        logger.log(`Expires on ${expiresOn}`);
      }
    });
    certUploadCaCertCommand = createCommand({
      metadata: {
        description: "Upload a CA certificate chain",
        status: "stable",
        owner: "Product: SSL"
      },
      args: {
        name: {
          describe: "The name for the certificate",
          type: "string"
        },
        "ca-cert": {
          description: "The path to a certificate file (.pem) containing a chain of CA certificates to upload",
          type: "string",
          demandOption: true
        }
      },
      async handler({ caCert, name: name2 }, { config }) {
        const accountId = await requireAuth(config);
        logger.log(
          name2 ? `Uploading CA Certificate ${name2}...` : `Uploading CA Certificate...`
        );
        const certResponse = await uploadCaCertificateFromFs(config, accountId, {
          certificates: caCert,
          ca: true,
          name: name2
        });
        const expiresOn = new Date(certResponse.expires_on).toLocaleDateString();
        logger.log(
          name2 ? `Success! Uploaded CA Certificate ${name2}` : `Success! Uploaded CA Certificate`
        );
        logger.log(`ID: ${certResponse.id}`);
        logger.log(`Issuer: ${certResponse.issuer}`);
        logger.log(`Expires on ${expiresOn}`);
      }
    });
    certListCommand = createCommand({
      metadata: {
        description: "List uploaded mTLS certificates",
        status: "stable",
        owner: "Product: SSL"
      },
      async handler(_5, { config }) {
        const accountId = await requireAuth(config);
        const certificates = await listMTlsCertificates(
          config,
          accountId,
          {},
          true
        );
        for (const certificate of certificates) {
          logger.log(`ID: ${certificate.id}`);
          if (certificate.name) {
            logger.log(`Name: ${certificate.name}`);
          }
          logger.log(`Issuer: ${certificate.issuer}`);
          logger.log(
            `Created on: ${new Date(certificate.uploaded_on).toLocaleDateString()}`
          );
          logger.log(
            `Expires on: ${new Date(certificate.expires_on).toLocaleDateString()}`
          );
          if (certificate.ca) {
            logger.log(`CA: ${certificate.ca}`);
          }
          logger.log("\n");
        }
      }
    });
    certDeleteCommand = createCommand({
      metadata: {
        description: "Delete an mTLS certificate",
        status: "stable",
        owner: "Product: SSL"
      },
      args: {
        id: {
          description: "The id of the mTLS certificate to delete",
          type: "string"
        },
        name: {
          description: "The name of the mTLS certificate record to delete",
          type: "string"
        }
      },
      async handler({ id, name: name2 }, { config }) {
        const accountId = await requireAuth(config);
        if (id && name2) {
          return logger.error(`Can't provide both --id and --name.`);
        } else if (!id && !name2) {
          return logger.error(`Must provide --id or --name.`);
        }
        let certificate;
        if (id) {
          certificate = await getMTlsCertificate(config, accountId, id);
        } else {
          certificate = await getMTlsCertificateByName(
            config,
            accountId,
            name2,
            true
          );
        }
        const response = await confirm(
          `Are you sure you want to delete certificate ${certificate.id}${certificate.name ? ` (${certificate.name})` : ""}?`
        );
        if (!response) {
          logger.log("Not deleting");
          return;
        }
        await deleteMTlsCertificate(config, accountId, certificate.id);
        logger.log(
          `Deleted certificate ${certificate.id} ${certificate.name ? `(${certificate.name})` : ""} successfully`
        );
      }
    });
  }
});

// ../../node_modules/.pnpm/command-exists@1.2.9/node_modules/command-exists/lib/command-exists.js
var require_command_exists = __commonJS({
  "../../node_modules/.pnpm/command-exists@1.2.9/node_modules/command-exists/lib/command-exists.js"(exports, module2) {
    init_import_meta_url();
    var exec3 = __require("child_process").exec;
    var execSync8 = __require("child_process").execSync;
    var fs33 = __require("fs");
    var path84 = __require("path");
    var access4 = fs33.access;
    var accessSync2 = fs33.accessSync;
    var constants5 = fs33.constants || fs33;
    var isUsingWindows = process.platform == "win32";
    var fileNotExists = /* @__PURE__ */ __name(function(commandName, callback) {
      access4(
        commandName,
        constants5.F_OK,
        function(err) {
          callback(!err);
        }
      );
    }, "fileNotExists");
    var fileNotExistsSync = /* @__PURE__ */ __name(function(commandName) {
      try {
        accessSync2(commandName, constants5.F_OK);
        return false;
      } catch (e10) {
        return true;
      }
    }, "fileNotExistsSync");
    var localExecutable = /* @__PURE__ */ __name(function(commandName, callback) {
      access4(
        commandName,
        constants5.F_OK | constants5.X_OK,
        function(err) {
          callback(null, !err);
        }
      );
    }, "localExecutable");
    var localExecutableSync = /* @__PURE__ */ __name(function(commandName) {
      try {
        accessSync2(commandName, constants5.F_OK | constants5.X_OK);
        return true;
      } catch (e10) {
        return false;
      }
    }, "localExecutableSync");
    var commandExistsUnix = /* @__PURE__ */ __name(function(commandName, cleanedCommandName, callback) {
      fileNotExists(commandName, function(isFile2) {
        if (!isFile2) {
          exec3(
            "command -v " + cleanedCommandName + " 2>/dev/null && { echo >&1 " + cleanedCommandName + "; exit 0; }",
            function(error2, stdout2, stderr2) {
              callback(null, !!stdout2);
            }
          );
          return;
        }
        localExecutable(commandName, callback);
      });
    }, "commandExistsUnix");
    var commandExistsWindows = /* @__PURE__ */ __name(function(commandName, cleanedCommandName, callback) {
      if (!/^(?!(?:.*\s|.*\.|\W+)$)(?:[a-zA-Z]:)?(?:(?:[^<>:"\|\?\*\n])+(?:\/\/|\/|\\\\|\\)?)+$/m.test(commandName)) {
        callback(null, false);
        return;
      }
      exec3(
        "where " + cleanedCommandName,
        function(error2) {
          if (error2 !== null) {
            callback(null, false);
          } else {
            callback(null, true);
          }
        }
      );
    }, "commandExistsWindows");
    var commandExistsUnixSync = /* @__PURE__ */ __name(function(commandName, cleanedCommandName) {
      if (fileNotExistsSync(commandName)) {
        try {
          var stdout2 = execSync8(
            "command -v " + cleanedCommandName + " 2>/dev/null && { echo >&1 " + cleanedCommandName + "; exit 0; }"
          );
          return !!stdout2;
        } catch (error2) {
          return false;
        }
      }
      return localExecutableSync(commandName);
    }, "commandExistsUnixSync");
    var commandExistsWindowsSync = /* @__PURE__ */ __name(function(commandName, cleanedCommandName, callback) {
      if (!/^(?!(?:.*\s|.*\.|\W+)$)(?:[a-zA-Z]:)?(?:(?:[^<>:"\|\?\*\n])+(?:\/\/|\/|\\\\|\\)?)+$/m.test(commandName)) {
        return false;
      }
      try {
        var stdout2 = execSync8("where " + cleanedCommandName, { stdio: [] });
        return !!stdout2;
      } catch (error2) {
        return false;
      }
    }, "commandExistsWindowsSync");
    var cleanInput = /* @__PURE__ */ __name(function(s7) {
      if (/[^A-Za-z0-9_\/:=-]/.test(s7)) {
        s7 = "'" + s7.replace(/'/g, "'\\''") + "'";
        s7 = s7.replace(/^(?:'')+/g, "").replace(/\\'''/g, "\\'");
      }
      return s7;
    }, "cleanInput");
    if (isUsingWindows) {
      cleanInput = /* @__PURE__ */ __name(function(s7) {
        var isPathName = /[\\]/.test(s7);
        if (isPathName) {
          var dirname22 = '"' + path84.dirname(s7) + '"';
          var basename11 = '"' + path84.basename(s7) + '"';
          return dirname22 + ":" + basename11;
        }
        return '"' + s7 + '"';
      }, "cleanInput");
    }
    module2.exports = /* @__PURE__ */ __name(function commandExists(commandName, callback) {
      var cleanedCommandName = cleanInput(commandName);
      if (!callback && typeof Promise !== "undefined") {
        return new Promise(function(resolve32, reject) {
          commandExists(commandName, function(error2, output) {
            if (output) {
              resolve32(commandName);
            } else {
              reject(error2);
            }
          });
        });
      }
      if (isUsingWindows) {
        commandExistsWindows(commandName, cleanedCommandName, callback);
      } else {
        commandExistsUnix(commandName, cleanedCommandName, callback);
      }
    }, "commandExists");
    module2.exports.sync = function(commandName) {
      var cleanedCommandName = cleanInput(commandName);
      if (isUsingWindows) {
        return commandExistsWindowsSync(commandName, cleanedCommandName);
      } else {
        return commandExistsUnixSync(commandName, cleanedCommandName);
      }
    };
  }
});

// ../../node_modules/.pnpm/command-exists@1.2.9/node_modules/command-exists/index.js
var require_command_exists2 = __commonJS({
  "../../node_modules/.pnpm/command-exists@1.2.9/node_modules/command-exists/index.js"(exports, module2) {
    init_import_meta_url();
    module2.exports = require_command_exists();
  }
});
function handleUnsafeCapnp(capnp) {
  if (capnp.compiled_schema) {
    return fs29.readFileSync(path3.resolve(capnp.compiled_schema));
  }
  const { base_path, source_schemas } = capnp;
  const capnpSchemas = (source_schemas ?? []).map(
    (x7) => path3.resolve(base_path, x7)
  );
  if (!(0, import_command_exists.sync)("capnp")) {
    throw new UserError(
      "The capnp compiler is required to upload capnp schemas, but is not present."
    );
  }
  const srcPrefix = path3.resolve(base_path ?? ".");
  const capnpProcess = childProcess.spawnSync(
    "capnp",
    ["compile", "-o-", `--src-prefix=${srcPrefix}`, ...capnpSchemas],
    // This number was chosen arbitrarily. If you get ENOBUFS because your compiled schema is still
    // too large, then we may need to bump this again or figure out another approach.
    // https://github.com/cloudflare/workers-sdk/pull/10217
    { maxBuffer: 3 * 1024 * 1024 }
  );
  if (capnpProcess.error) {
    throw capnpProcess.error;
  }
  if (capnpProcess.stderr.length) {
    throw new Error(capnpProcess.stderr.toString());
  }
  return capnpProcess.stdout;
}
var import_command_exists;
var init_capnp = __esm({
  "src/deployment-bundle/capnp.ts"() {
    init_import_meta_url();
    init_dist();
    import_command_exists = __toESM(require_command_exists2());
    __name(handleUnsafeCapnp, "handleUnsafeCapnp");
  }
});
function toMimeType(type) {
  const mimeType = moduleTypeMimeType[type];
  if (mimeType === void 0) {
    throw new TypeError("Unsupported module: " + type);
  }
  return mimeType;
}
function fromMimeType(mimeType) {
  const moduleType = Object.keys(moduleTypeMimeType).find(
    (type) => moduleTypeMimeType[type] === mimeType
  );
  if (moduleType === void 0) {
    throw new TypeError("Unsupported mime type: " + mimeType);
  }
  return moduleType;
}
function createWorkerUploadForm(worker, bindings, options) {
  const formData = new import_undici7.FormData();
  const {
    main: main2,
    sourceMaps,
    migrations,
    compatibility_date,
    compatibility_flags,
    keepVars,
    keepSecrets,
    keepBindings,
    logpush,
    placement,
    tail_consumers,
    streaming_tail_consumers,
    limits,
    annotations,
    keep_assets,
    assets,
    observability,
    cache: cache5
  } = worker;
  const assetConfig = {
    html_handling: assets?.assetConfig?.html_handling,
    not_found_handling: assets?.assetConfig?.not_found_handling,
    run_worker_first: assets?.run_worker_first,
    _redirects: assets?._redirects,
    _headers: assets?._headers
  };
  if (assets && !assets.routerConfig.has_user_worker) {
    formData.set(
      "metadata",
      JSON.stringify({
        assets: {
          jwt: assets.jwt,
          config: assetConfig
        },
        ...annotations && { annotations },
        ...compatibility_date && { compatibility_date },
        ...compatibility_flags && { compatibility_flags }
      })
    );
    return formData;
  }
  let { modules } = worker;
  const metadataBindings = [];
  const plain_text = extractBindingsOfType("plain_text", bindings);
  const json_bindings = extractBindingsOfType("json", bindings);
  const secret_text = extractBindingsOfType("secret_text", bindings);
  const kv_namespaces = extractBindingsOfType("kv_namespace", bindings);
  const send_email = extractBindingsOfType("send_email", bindings);
  const durable_objects = extractBindingsOfType(
    "durable_object_namespace",
    bindings
  );
  const workflows = extractBindingsOfType("workflow", bindings);
  const queues = extractBindingsOfType("queue", bindings);
  const r2_buckets = extractBindingsOfType("r2_bucket", bindings);
  const d1_databases = extractBindingsOfType("d1", bindings);
  const vectorize = extractBindingsOfType("vectorize", bindings);
  const ai_search_namespaces = extractBindingsOfType(
    "ai_search_namespace",
    bindings
  );
  const ai_search = extractBindingsOfType("ai_search", bindings);
  const hyperdrive = extractBindingsOfType("hyperdrive", bindings);
  const secrets_store_secrets = extractBindingsOfType(
    "secrets_store_secret",
    bindings
  );
  const unsafe_hello_world = extractBindingsOfType(
    "unsafe_hello_world",
    bindings
  );
  const flagship = extractBindingsOfType("flagship", bindings);
  const ratelimits = extractBindingsOfType("ratelimit", bindings);
  const vpc_services = extractBindingsOfType("vpc_service", bindings);
  const vpc_networks = extractBindingsOfType("vpc_network", bindings);
  const services = extractBindingsOfType("service", bindings);
  const analytics_engine_datasets = extractBindingsOfType(
    "analytics_engine",
    bindings
  );
  const dispatch_namespaces = extractBindingsOfType(
    "dispatch_namespace",
    bindings
  );
  const mtls_certificates = extractBindingsOfType("mtls_certificate", bindings);
  const pipelines = extractBindingsOfType("pipeline", bindings);
  const worker_loaders = extractBindingsOfType("worker_loader", bindings);
  const logfwdr = extractBindingsOfType("logfwdr", bindings);
  const wasm_modules = extractBindingsOfType("wasm_module", bindings);
  const browser = extractBindingsOfType("browser", bindings)[0];
  const ai2 = extractBindingsOfType("ai", bindings)[0];
  const images = extractBindingsOfType("images", bindings)[0];
  const stream2 = extractBindingsOfType("stream", bindings)[0];
  const media = extractBindingsOfType("media", bindings)[0];
  const version_metadata = extractBindingsOfType(
    "version_metadata",
    bindings
  )[0];
  const assetsBinding = extractBindingsOfType("assets", bindings)[0];
  const text_blobs = extractBindingsOfType("text_blob", bindings);
  const data_blobs = extractBindingsOfType("data_blob", bindings);
  const inherit_bindings = extractBindingsOfType("inherit", bindings);
  inherit_bindings.forEach(({ binding }) => {
    metadataBindings.push({ name: binding, type: "inherit" });
  });
  plain_text.forEach(({ binding, value }) => {
    metadataBindings.push({ name: binding, type: "plain_text", text: value });
  });
  json_bindings.forEach(({ binding, value }) => {
    metadataBindings.push({ name: binding, type: "json", json: value });
  });
  secret_text.forEach(({ binding, value }) => {
    metadataBindings.push({ name: binding, type: "secret_text", text: value });
  });
  kv_namespaces.forEach(({ id, binding, raw }) => {
    if (options?.dryRun) {
      id ??= INHERIT_SYMBOL;
    }
    if (id === void 0) {
      throw new UserError(`${binding} bindings must have an "id" field`);
    }
    if (id === INHERIT_SYMBOL) {
      metadataBindings.push({
        name: binding,
        type: "inherit"
      });
    } else {
      metadataBindings.push({
        name: binding,
        type: "kv_namespace",
        namespace_id: id,
        raw
      });
    }
  });
  send_email.forEach((emailBinding) => {
    const destination_address = "destination_address" in emailBinding ? emailBinding.destination_address : void 0;
    const allowed_destination_addresses = "allowed_destination_addresses" in emailBinding ? emailBinding.allowed_destination_addresses : void 0;
    const allowed_sender_addresses = "allowed_sender_addresses" in emailBinding ? emailBinding.allowed_sender_addresses : void 0;
    metadataBindings.push({
      name: emailBinding.name,
      type: "send_email",
      destination_address,
      allowed_destination_addresses,
      allowed_sender_addresses
    });
  });
  durable_objects.forEach(({ name: name2, class_name, script_name, environment }) => {
    metadataBindings.push({
      name: name2,
      type: "durable_object_namespace",
      class_name,
      ...script_name && { script_name },
      ...environment && { environment }
    });
  });
  workflows.forEach(({ binding, name: name2, class_name, script_name, raw }) => {
    metadataBindings.push({
      type: "workflow",
      name: binding,
      workflow_name: name2,
      class_name,
      script_name,
      raw
    });
  });
  queues.forEach(({ binding, queue_name, delivery_delay, raw }) => {
    metadataBindings.push({
      type: "queue",
      name: binding,
      queue_name,
      delivery_delay,
      raw
    });
  });
  r2_buckets.forEach(({ binding, bucket_name, jurisdiction, raw }) => {
    if (options?.dryRun) {
      bucket_name ??= INHERIT_SYMBOL;
    }
    if (bucket_name === void 0) {
      throw new UserError(
        `${binding} bindings must have a "bucket_name" field`
      );
    }
    if (bucket_name === INHERIT_SYMBOL) {
      metadataBindings.push({
        name: binding,
        type: "inherit"
      });
    } else {
      metadataBindings.push({
        name: binding,
        type: "r2_bucket",
        bucket_name,
        jurisdiction,
        raw
      });
    }
  });
  d1_databases.forEach(
    ({ binding, database_id, database_internal_env, raw }) => {
      if (options?.dryRun) {
        database_id ??= INHERIT_SYMBOL;
      }
      if (database_id === void 0) {
        throw new UserError(
          `${binding} bindings must have a "database_id" field`
        );
      }
      if (database_id === INHERIT_SYMBOL) {
        metadataBindings.push({
          name: binding,
          type: "inherit"
        });
      } else {
        metadataBindings.push({
          name: binding,
          type: "d1",
          id: database_id,
          internalEnv: database_internal_env,
          raw
        });
      }
    }
  );
  vectorize.forEach(({ binding, index_name, raw }) => {
    metadataBindings.push({
      name: binding,
      type: "vectorize",
      index_name,
      raw
    });
  });
  ai_search_namespaces.forEach(({ binding, namespace }) => {
    if (options?.dryRun) {
      namespace ??= INHERIT_SYMBOL;
    }
    if (namespace === void 0) {
      throw new UserError(`${binding} bindings must have a "namespace" field`);
    }
    if (namespace === INHERIT_SYMBOL) {
      metadataBindings.push({
        name: binding,
        type: "inherit"
      });
    } else {
      metadataBindings.push({
        name: binding,
        type: "ai_search_namespace",
        namespace
      });
    }
  });
  ai_search.forEach(({ binding, instance_name }) => {
    metadataBindings.push({
      name: binding,
      type: "ai_search",
      instance_name
    });
  });
  hyperdrive.forEach(({ binding, id }) => {
    metadataBindings.push({
      name: binding,
      type: "hyperdrive",
      id
    });
  });
  secrets_store_secrets.forEach(({ binding, store_id, secret_name }) => {
    metadataBindings.push({
      name: binding,
      type: "secrets_store_secret",
      store_id,
      secret_name
    });
  });
  unsafe_hello_world.forEach(({ binding, enable_timer }) => {
    metadataBindings.push({
      name: binding,
      type: "unsafe_hello_world",
      enable_timer
    });
  });
  flagship.forEach(({ binding, app_id }) => {
    metadataBindings.push({
      name: binding,
      type: "flagship",
      app_id
    });
  });
  ratelimits.forEach(({ name: name2, namespace_id, simple }) => {
    metadataBindings.push({
      name: name2,
      type: "ratelimit",
      namespace_id,
      simple
    });
  });
  vpc_services.forEach(({ binding, service_id }) => {
    metadataBindings.push({
      name: binding,
      type: "vpc_service",
      service_id
    });
  });
  vpc_networks.forEach(({ binding, tunnel_id, network_id }) => {
    metadataBindings.push({
      name: binding,
      type: "vpc_network",
      ...tunnel_id !== void 0 ? { tunnel_id } : { network_id }
    });
  });
  services.forEach(
    ({
      binding,
      service,
      environment,
      entrypoint,
      props,
      cross_account_grant
    }) => {
      metadataBindings.push({
        name: binding,
        type: "service",
        service,
        cross_account_grant,
        ...environment && { environment },
        ...entrypoint && { entrypoint },
        ...props && { props }
      });
    }
  );
  analytics_engine_datasets.forEach(({ binding, dataset }) => {
    metadataBindings.push({
      name: binding,
      type: "analytics_engine",
      dataset
    });
  });
  dispatch_namespaces.forEach(({ binding, namespace, outbound }) => {
    metadataBindings.push({
      name: binding,
      type: "dispatch_namespace",
      namespace,
      ...outbound && {
        outbound: {
          worker: {
            service: outbound.service,
            environment: outbound.environment
          },
          params: outbound.parameters?.map((p7) => ({ name: p7 }))
        }
      }
    });
  });
  mtls_certificates.forEach(({ binding, certificate_id }) => {
    metadataBindings.push({
      name: binding,
      type: "mtls_certificate",
      certificate_id
    });
  });
  pipelines.forEach(({ binding, pipeline }) => {
    metadataBindings.push({
      name: binding,
      type: "pipelines",
      pipeline
    });
  });
  worker_loaders.forEach(({ binding }) => {
    metadataBindings.push({
      name: binding,
      type: "worker_loader"
    });
  });
  logfwdr.forEach(({ name: name2, destination }) => {
    metadataBindings.push({
      name: name2,
      type: "logfwdr",
      destination
    });
  });
  wasm_modules.forEach(({ binding: name2, source }) => {
    metadataBindings.push({
      name: name2,
      type: "wasm_module",
      part: name2
    });
    formData.set(
      name2,
      new File(
        [
          "contents" in source ? source.contents : fs29.readFileSync(source.path)
        ],
        "path" in source ? source.path ?? name2 : name2,
        { type: "application/wasm" }
      )
    );
  });
  if (browser !== void 0) {
    metadataBindings.push({
      name: browser.binding,
      type: "browser",
      raw: browser.raw
    });
  }
  if (ai2 !== void 0) {
    metadataBindings.push({
      name: ai2.binding,
      staging: ai2.staging,
      type: "ai",
      raw: ai2.raw
    });
  }
  if (images !== void 0) {
    metadataBindings.push({
      name: images.binding,
      type: "images",
      raw: images.raw
    });
  }
  if (stream2 !== void 0) {
    metadataBindings.push({
      name: stream2.binding,
      type: "stream"
    });
  }
  if (media !== void 0) {
    metadataBindings.push({
      name: media.binding,
      type: "media"
    });
  }
  if (version_metadata !== void 0) {
    metadataBindings.push({
      name: version_metadata.binding,
      type: "version_metadata"
    });
  }
  if (assetsBinding !== void 0) {
    metadataBindings.push({
      name: assetsBinding.binding,
      type: "assets"
    });
  }
  text_blobs.forEach(({ binding: name2, source }) => {
    metadataBindings.push({
      name: name2,
      type: "text_blob",
      part: name2
    });
    if (name2 !== "__STATIC_CONTENT_MANIFEST") {
      if ("contents" in source) {
        formData.set(
          name2,
          new File([source.contents], source.path ?? name2, {
            type: "text/plain"
          })
        );
      } else {
        formData.set(
          name2,
          new File([fs29.readFileSync(source.path)], source.path, {
            type: "text/plain"
          })
        );
      }
    }
  });
  data_blobs.forEach(({ binding: name2, source }) => {
    metadataBindings.push({
      name: name2,
      type: "data_blob",
      part: name2
    });
    formData.set(
      name2,
      new File(
        [
          "contents" in source ? source.contents : fs29.readFileSync(source.path)
        ],
        "path" in source ? source.path ?? name2 : name2,
        { type: "application/octet-stream" }
      )
    );
  });
  for (const [bindingName, config] of Object.entries(bindings ?? {})) {
    if (isUnsafeBindingType(config.type) && config.type !== "unsafe_hello_world") {
      const { type, ...data } = config;
      metadataBindings.push({
        name: bindingName,
        type: type.slice("unsafe_".length),
        ...data
      });
    }
  }
  const manifestModuleName = "__STATIC_CONTENT_MANIFEST";
  const hasManifest = modules?.some(({ name: name2 }) => name2 === manifestModuleName);
  if (hasManifest && main2.type === "esm") {
    assert53__default.default(modules !== void 0);
    const subDirs = new Set(
      modules.map((module2) => path3__namespace.default.posix.dirname(module2.name))
    );
    for (const subDir of subDirs) {
      if (subDir === ".") {
        continue;
      }
      const relativePath = path3__namespace.default.posix.relative(subDir, manifestModuleName);
      const filePath = path3__namespace.default.posix.join(subDir, manifestModuleName);
      modules.push({
        name: filePath,
        filePath,
        content: `export { default } from ${JSON.stringify(relativePath)};`,
        type: "esm"
      });
    }
  }
  if (main2.type === "commonjs") {
    for (const module2 of Object.values([...modules || []])) {
      if (module2.name === "__STATIC_CONTENT_MANIFEST") {
        formData.set(
          module2.name,
          new File([module2.content], module2.name, {
            type: "text/plain"
          })
        );
        modules = modules?.filter((m7) => m7 !== module2);
      } else if (module2.type === "compiled-wasm" || module2.type === "text" || module2.type === "buffer") {
        const name2 = module2.name.replace(/[^a-zA-Z0-9_$]/g, "_");
        metadataBindings.push({
          name: name2,
          type: module2.type === "compiled-wasm" ? "wasm_module" : module2.type === "text" ? "text_blob" : "data_blob",
          part: name2
        });
        formData.set(
          name2,
          new File([module2.content], module2.name, {
            type: module2.type === "compiled-wasm" ? "application/wasm" : module2.type === "text" ? "text/plain" : "application/octet-stream"
          })
        );
        modules = modules?.filter((m7) => m7 !== module2);
      }
    }
  }
  let capnpSchemaOutputFile;
  if (options?.unsafe?.capnp) {
    const capnpOutput = handleUnsafeCapnp(options.unsafe.capnp);
    capnpSchemaOutputFile = `./capnp-${Date.now()}.compiled`;
    formData.set(
      capnpSchemaOutputFile,
      new File([capnpOutput], capnpSchemaOutputFile, {
        type: "application/octet-stream"
      })
    );
  }
  let keep_bindings = void 0;
  if (keepVars) {
    keep_bindings ??= [];
    keep_bindings.push("plain_text", "json");
  }
  if (keepSecrets) {
    keep_bindings ??= [];
    keep_bindings.push("secret_text", "secret_key");
  }
  if (keepBindings) {
    keep_bindings ??= [];
    keep_bindings.push(...keepBindings);
  }
  const metadata = {
    ...main2.type !== "commonjs" ? { main_module: main2.name } : { body_part: main2.name },
    bindings: metadataBindings,
    containers: worker.containers === void 0 ? void 0 : worker.containers.map((c8) => ({ class_name: c8.class_name })),
    ...compatibility_date && { compatibility_date },
    ...compatibility_flags && {
      compatibility_flags
    },
    ...migrations && { migrations },
    capnp_schema: capnpSchemaOutputFile,
    ...keep_bindings && { keep_bindings },
    ...logpush !== void 0 && { logpush },
    ...placement && { placement },
    ...tail_consumers && { tail_consumers },
    ...streaming_tail_consumers && { streaming_tail_consumers },
    ...limits && { limits },
    ...annotations && { annotations },
    ...keep_assets !== void 0 && { keep_assets },
    ...assets && {
      assets: {
        jwt: assets.jwt,
        config: assetConfig
      }
    },
    ...observability && { observability },
    ...cache5 && { cache_options: cache5 }
  };
  if (options?.unsafe?.metadata !== void 0) {
    for (const key of Object.keys(options.unsafe.metadata)) {
      metadata[key] = options.unsafe.metadata[key];
    }
  }
  formData.set("metadata", JSON.stringify(metadata));
  if (main2.type === "commonjs" && modules && modules.length > 0) {
    throw new TypeError(
      "More than one module can only be specified when type = 'esm'"
    );
  }
  for (const module2 of [main2].concat(modules || [])) {
    formData.set(
      module2.name,
      new File([module2.content], module2.name, {
        type: toMimeType(module2.type ?? main2.type ?? "esm")
      })
    );
  }
  for (const sourceMap of sourceMaps || []) {
    formData.set(
      sourceMap.name,
      new File([sourceMap.content], sourceMap.name, {
        type: "application/source-map"
      })
    );
  }
  return formData;
}
var import_undici7, moduleTypeMimeType;
var init_create_worker_upload_form = __esm({
  "src/deployment-bundle/create-worker-upload-form.ts"() {
    init_import_meta_url();
    init_dist();
    import_undici7 = __toESM(require_undici());
    init_utils2();
    init_capnp();
    moduleTypeMimeType = {
      esm: "application/javascript+module",
      commonjs: "application/javascript",
      "compiled-wasm": "application/wasm",
      buffer: "application/octet-stream",
      text: "text/plain",
      python: "text/x-python",
      "python-requirement": "text/x-python-requirement"
    };
    __name(toMimeType, "toMimeType");
    __name(fromMimeType, "fromMimeType");
    __name(createWorkerUploadForm, "createWorkerUploadForm");
  }
});
async function checkStartupHandler({
  outfile,
  args,
  workerBundle,
  pages
}, { config }) {
  if (workerBundle === void 0) {
    const tmpDir = getWranglerTmpDir(void 0, "startup-profile");
    workerBundle = path3__namespace.default.join(tmpDir.path, "worker.bundle");
    if (config.pages_build_output_dir || pages) {
      log("Pages project detected");
      log("");
    }
    if (logger.loggerLevel !== "debug") {
      logger.loggerLevel = "error";
    }
    await spinnerWhile({
      promise: /* @__PURE__ */ __name(async () => {
        const { wrangler } = createCLIParser(
          config.pages_build_output_dir || pages ? [
            "pages",
            "functions",
            "build",
            ...args?.split(" ") ?? [],
            `--outfile=${workerBundle}`
          ] : [
            "deploy",
            ...args?.split(" ") ?? [],
            "--dry-run",
            `--outfile=${workerBundle}`
          ]
        );
        await wrangler.parse();
      }, "promise"),
      startMessage: "Building your Worker",
      endMessage: source_default.green("Worker Built! \u{1F389}")
    });
    logger.resetLoggerLevel();
  }
  const cpuProfileResult = await spinnerWhile({
    promise: analyseBundle(workerBundle),
    startMessage: "Analysing",
    endMessage: source_default.green("Startup phase analysed")
  });
  await fs9.writeFile(outfile, JSON.stringify(await cpuProfileResult));
  log(
    [
      `CPU Profile has been written to ${outfile}. Load it into the Chrome DevTools profiler (or directly in VSCode) to view a flamegraph.`,
      "",
      "Note that the CPU Profile was measured on your Worker running locally on your machine, which has a different CPU than when your Worker runs on Cloudflare.",
      "",
      "As such, CPU Profile can be used to understand where time is spent at startup, but the overall startup time in the profile should not be expected to exactly match what your Worker's startup time will be when deploying to Cloudflare."
    ].join("\n")
  );
}
async function getEntryValue(entry) {
  if (entry instanceof Blob) {
    return new Uint8Array(await entry.arrayBuffer());
  } else {
    return entry;
  }
}
function getModuleType(entry) {
  if (entry instanceof Blob) {
    const type = ModuleTypeToRuleType[mimeTypeModuleType[entry.type]];
    if (!type) {
      throw new Error(
        `Unable to determine module type for ${entry.type} mime type`
      );
    }
    return type;
  } else {
    return "Text";
  }
}
async function convertWorkerBundleToModules(workerBundle) {
  return await Promise.all(
    [...workerBundle.entries()].filter(
      (m7) => m7[1] instanceof Blob && m7[1].type !== "application/source-map"
    ).map(
      async (m7) => ({
        type: getModuleType(m7[1]),
        path: m7[0],
        contents: await getEntryValue(m7[1])
      })
    )
  );
}
async function parseFormDataFromFile(file3) {
  const bundle = await fs9.readFile(file3);
  const firstLine = bundle.findIndex((v8) => v8 === 10);
  const boundary = Uint8Array.prototype.slice.call(bundle, 2, firstLine).toString();
  return await new Response(bundle, {
    headers: {
      "Content-Type": "multipart/form-data; boundary=" + boundary
    }
  }).formData();
}
async function analyseBundle(workerBundle) {
  if (typeof workerBundle === "string") {
    workerBundle = await parseFormDataFromFile(workerBundle);
  }
  const metadata = JSON.parse(workerBundle.get("metadata"));
  if (!("main_module" in metadata)) {
    throw new UserError(
      "`wrangler check startup` does not support service-worker format Workers. Refer to https://developers.cloudflare.com/workers/reference/migrate-to-module-workers/ for migration guidance."
    );
  }
  const mf = new miniflare.Miniflare({
    name: "profiler",
    compatibilityDate: metadata.compatibility_date,
    compatibilityFlags: metadata.compatibility_flags,
    modulesRoot: "/",
    modules: [
      {
        type: "ESModule",
        // Make sure the entrypoint path doesn't conflict with a user worker module
        path: crypto2.randomUUID(),
        contents: (
          /* javascript */
          `
					async function startup() {
						await import("${metadata.main_module}");
					}
					export default {
						async fetch() {
							await startup()
							return new Response("ok")
						}
					}
					`
        )
      },
      ...await convertWorkerBundleToModules(workerBundle)
    ],
    inspectorPort: 0
  });
  await mf.ready;
  const inspectorUrl = await mf.getInspectorURL();
  const ws = new import_websocket.default(new URL("/core:user:profiler", inspectorUrl.href));
  await events__default.default.once(ws, "open");
  ws.send(JSON.stringify({ id: 1, method: "Profiler.enable", params: {} }));
  ws.send(JSON.stringify({ id: 2, method: "Profiler.start", params: {} }));
  const cpuProfileResult = new Promise((accept) => {
    ws.addEventListener("message", (e10) => {
      const data = JSON.parse(e10.data);
      if (data.method === "Profiler.stop") {
        void mf.dispose().then(() => accept(data.result.profile));
      }
    });
  });
  await (await mf.dispatchFetch("https://example.com")).text();
  ws.send(JSON.stringify({ id: 3, method: "Profiler.stop", params: {} }));
  return cpuProfileResult;
}
var mimeTypeModuleType, checkNamespace, checkStartupCommand;
var init_commands3 = __esm({
  "src/check/commands.ts"() {
    init_import_meta_url();
    init_cli();
    init_interactive();
    init_dist();
    init_source();
    init_wrapper();
    init_src3();
    init_create_command();
    init_create_worker_upload_form();
    init_module_collection();
    init_logger();
    init_paths();
    mimeTypeModuleType = flipObject(moduleTypeMimeType);
    checkNamespace = createNamespace({
      metadata: {
        description: "\u2611\uFE0E Run checks on your Worker",
        owner: "Workers: Authoring and Testing",
        status: "alpha",
        hidden: true
      }
    });
    __name(checkStartupHandler, "checkStartupHandler");
    checkStartupCommand = createCommand({
      args: {
        outfile: {
          describe: "Output file for startup phase cpuprofile",
          type: "string",
          default: "worker-startup.cpuprofile"
        },
        workerBundle: {
          alias: "worker",
          describe: "Path to a prebuilt worker bundle i.e the output of `wrangler deploy --outfile worker.bundle",
          type: "string"
        },
        pages: {
          describe: "Force this project to be treated as a Pages project",
          type: "boolean"
        },
        args: {
          describe: "Additional arguments passed to `wrangler deploy` or `wrangler pages functions build` e.g. `--no-bundle`",
          type: "string"
        }
      },
      validateArgs({ args, workerBundle }) {
        if (workerBundle && args) {
          throw new UserError(
            "`--args` and `--worker` are mutually exclusive\u2014please only specify one"
          );
        }
        if (args?.includes("outfile") || args?.includes("outdir")) {
          throw new UserError(
            "`--args` should not contain `--outfile` or `--outdir`"
          );
        }
      },
      metadata: {
        description: "\u231B Profile your Worker's startup performance",
        owner: "Workers: Authoring and Testing",
        status: "alpha"
      },
      handler: checkStartupHandler
    });
    __name(getEntryValue, "getEntryValue");
    __name(getModuleType, "getModuleType");
    __name(convertWorkerBundleToModules, "convertWorkerBundleToModules");
    __name(parseFormDataFromFile, "parseFormDataFromFile");
    __name(analyseBundle, "analyseBundle");
  }
});

// src/utils/strings.ts
function capitalize(str) {
  return str.length > 0 ? str[0].toUpperCase() + str.substring(1) : str;
}
var init_strings = __esm({
  "src/utils/strings.ts"() {
    init_import_meta_url();
    __name(capitalize, "capitalize");
  }
});

// ../cli/args.ts
var processArgument;
var init_args = __esm({
  "../cli/args.ts"() {
    init_import_meta_url();
    init_interactive();
    processArgument = /* @__PURE__ */ __name(async (args, name2, promptConfig) => {
      const value = args[name2];
      const result = await inputPrompt({
        ...promptConfig,
        // Accept the default value if the arg is already set
        acceptDefault: promptConfig.acceptDefault ?? value !== void 0,
        defaultValue: value ?? promptConfig.defaultValue
      });
      args[name2] = result;
      return result;
    }, "processArgument");
  }
});

// src/cloudchamber/cli/util.ts
function statusToColored(status2) {
  if (!status2) {
    return bgYellow("PLACING");
  }
  const mappings = {
    placed: bgYellow,
    running: bgGreen,
    stopped: bgYellow,
    stopping: bgYellow,
    failed: bgRed,
    unhealthy: bgRed
  };
  if (!(status2 in mappings)) {
    return bgYellow(status2);
  }
  return mappings[status2](status2.toUpperCase());
}
var init_util3 = __esm({
  "src/cloudchamber/cli/util.ts"() {
    init_import_meta_url();
    init_colors();
    __name(statusToColored, "statusToColored");
  }
});
function ipv6(placement) {
  if (!placement) {
    return yellow("no ipv6 yet");
  }
  if (!placement.status["ipv6Address"]) {
    return yellow("no ipv6 yet");
  }
  return placement.status["ipv6Address"];
}
function uptime(placement) {
  if (!placement) {
    return yellow("inactive");
  }
  const ms = Date.now() - new Date(placement.created_at).getTime();
  const days = Math.floor(ms / 864e5);
  const hours = new Date(ms).getUTCHours();
  const minutes = new Date(ms).getUTCMinutes();
  const seconds = new Date(ms).getUTCSeconds();
  const uptimeString = `${days ? days + "d " : ""}${hours ? hours + "h " : ""}${minutes ? minutes + "m " : ""}${seconds}s`;
  return uptimeString;
}
function version2(deployment) {
  if (!deployment.current_placement) {
    return "";
  }
  if (deployment.current_placement.deployment_version !== deployment.version) {
    return ` (${yellow(
      `version ${deployment.current_placement.deployment_version}`
    )})`;
  }
  return ` (version ${deployment.version})`;
}
function health(placement) {
  if (!placement) {
    return statusToColored();
  }
  if (!placement.status["health"]) {
    return statusToColored();
  }
  return statusToColored(placement.status["health"]);
}
async function loadDeployments(deploymentIdPrefix, deploymentsParams) {
  const { start, stop } = spinner();
  start("Loading deployments");
  const [deploymentsResponse, err] = await wrap2(
    DeploymentsService.listDeploymentsV2(
      void 0,
      deploymentsParams?.location,
      deploymentsParams?.image,
      deploymentsParams?.state,
      deploymentsParams?.state,
      deploymentsParams?.labels
    )
  );
  stop();
  if (err) {
    throw new UserError(
      "There has been an error while loading your deployments: \n " + err.message
    );
  }
  const deployments = deploymentsResponse.filter(
    (d8) => d8.id.startsWith(deploymentIdPrefix ?? "")
  );
  if (deployments.length === 0 && !deploymentIdPrefix) {
    endSection(
      "you don't have any deployments in your account",
      "You can create one with\n	" + brandColor("wrangler cloudchamber create")
    );
    process7.exit(0);
  }
  if (deployments.length === 0 && deploymentIdPrefix) {
    endSection(
      "you don't have any deployments that match the id " + deploymentIdPrefix
    );
    process7.exit(0);
  }
  return deployments;
}
async function listDeploymentsAndChoose(deployments, args = {}) {
  const ips = /* @__PURE__ */ __name((d8) => {
    const ipsList = [];
    if (d8.network?.ipv4 !== void 0) {
      ipsList.push(`IPV4: ${dim(d8.network.ipv4)}`);
    }
    ipsList.push(`IPV6: ${dim(ipv6(d8.current_placement))}`);
    return ipsList;
  }, "ips");
  const deployment = await processArgument(args, "deploymentId", {
    type: "list",
    question: "Deployments",
    helpText: "Choose one by pressing the enter/return key",
    options: deployments.map((d8) => ({
      label: "Deployment " + d8.id,
      value: d8.id,
      details: [
        `ID: ${dim(`${d8.id}`)}`,
        `Uptime: ${dim(`${uptime(d8.current_placement)}`)}`,
        `Version: ${dim(`${d8.version}`)}`,
        `Location: ${dim(`${idToLocationName(d8.location.name)}`)}`,
        `Image: ${dim(d8.image)}`,
        ...ips(d8),
        `Current Placement${version2(d8)}: ${health(d8.current_placement)}`
      ]
    })),
    label: "deployment"
  });
  return deployments.find((d8) => d8.id === deployment);
}
async function pickDeployment(deploymentIdPrefix) {
  const deployments = await loadDeployments(deploymentIdPrefix);
  const deploymentId = deployments.length === 1 ? deployments[0].id : void 0;
  const deployment = await listDeploymentsAndChoose(deployments, {
    deploymentId
  });
  if (!deployment) {
    cancel("Cancelling deployment selection");
    process7.exit(0);
  }
  return deployment;
}
function logDeployment(deployment) {
  log(`${brandColor("image")} ${dim(deployment.image)}`);
  log(
    `${brandColor("location")} ${dim(idToLocationName(deployment.location.name))}`
  );
  log(`${brandColor("version")} ${dim(`${deployment.version}`)}`);
  newline();
}
var init_deployments3 = __esm({
  "src/cloudchamber/cli/deployments.ts"() {
    init_import_meta_url();
    init_cli();
    init_args();
    init_colors();
    init_interactive();
    init_containers_shared();
    init_dist();
    init_wrap();
    init_locations7();
    init_util3();
    __name(ipv6, "ipv6");
    __name(uptime, "uptime");
    __name(version2, "version");
    __name(health, "health");
    __name(loadDeployments, "loadDeployments");
    __name(listDeploymentsAndChoose, "listDeploymentsAndChoose");
    __name(pickDeployment, "pickDeployment");
    __name(logDeployment, "logDeployment");
  }
});

// src/cloudchamber/list.ts
async function listCommand2(deploymentArgs, config) {
  const prefix = deploymentArgs.deploymentIdPrefix ?? "";
  if (isNonInteractiveOrCI()) {
    const deployments = (await DeploymentsService.listDeploymentsV2(
      void 0,
      deploymentArgs.location,
      deploymentArgs.image,
      deploymentArgs.state,
      deploymentArgs.ipv4,
      deploymentArgs.label
    )).filter((deployment) => deployment.id.startsWith(prefix));
    if (deployments.length === 1) {
      const placements = await PlacementsService.listPlacements(
        deployments[0].id
      );
      logger.json({
        ...deployments[0],
        placements
      });
      return;
    }
    logger.json(deployments);
    return;
  }
  await listCommandHandle(prefix, deploymentArgs, config);
}
function eventMessage(event, lastEvent) {
  let { message } = event;
  message = capitalize(message);
  const name2 = event.name;
  const health2 = event.statusChange["health"];
  if (health2 === "failed") {
    message = `${bgRed(" X ")} ${dim(message)}`;
  } else if (lastEvent && name2 === "VMStopped") {
    message = `${yellow(message)}`;
  } else if (lastEvent && name2 === "VMStarted" || name2 === "SSHStarted") {
    message = `${green(message)}`;
  } else if (lastEvent) {
    message = `${brandColor(message)}`;
  } else {
    message = dim(message);
  }
  return `${message} (${event.time})`;
}
var listCommandHandle, cloudchamberListCommand;
var init_list4 = __esm({
  "src/cloudchamber/list.ts"() {
    init_import_meta_url();
    init_cli();
    init_colors();
    init_interactive();
    init_containers_shared();
    init_create_command();
    init_is_interactive();
    init_logger();
    init_strings();
    init_deployments3();
    init_util3();
    init_common();
    __name(listCommand2, "listCommand");
    __name(eventMessage, "eventMessage");
    listCommandHandle = /* @__PURE__ */ __name(async (deploymentIdPrefix, args, _config) => {
      const keepListIter = true;
      while (keepListIter) {
        logRaw(gray(shapes.bar));
        const deployments = await loadDeployments(deploymentIdPrefix, args);
        const deployment = await listDeploymentsAndChoose(deployments);
        const placementToOptions = /* @__PURE__ */ __name((p7) => {
          return {
            label: `Placement ${p7.id.slice(0, 6)} (${p7.created_at})`,
            details: [
              `ID: ${dim(p7.id)}`,
              `Version: ${dim(`${p7.deployment_version}`)}`,
              `Status: ${statusToColored(p7.status["health"])}`,
              `${bgCyan(white(`Events`))}`,
              ...p7.events.map(
                (event, i7) => space(1) + eventMessage(event, i7 === p7.events.length - 1)
              )
            ],
            value: p7.id
          };
        }, "placementToOptions");
        const loadPlacements = /* @__PURE__ */ __name(() => {
          return PlacementsService.listPlacements(deployment.id);
        }, "loadPlacements");
        const placements = await promiseSpinner(loadPlacements(), {
          message: "Loading placements"
        });
        const { start, stop } = spinner();
        let refresh = false;
        await inputPrompt({
          type: "list",
          question: "Placements",
          helpText: "Hint: Press R to refresh! Or press return to go back",
          options: placements.map(placementToOptions),
          label: "going back",
          onRefresh: /* @__PURE__ */ __name(async () => {
            start("Refreshing placements");
            const options = (await loadPlacements()).map(placementToOptions);
            if (refresh) {
              return [];
            }
            stop();
            if (options.length) {
              options[0].label += ", last refresh: " + (/* @__PURE__ */ new Date()).toLocaleString();
            }
            return options;
          }, "onRefresh")
        });
        refresh = true;
        stop();
      }
    }, "listCommandHandle");
    cloudchamberListCommand = createCommand({
      metadata: {
        description: "List and view status of deployments",
        status: "alpha",
        owner: "Product: Cloudchamber",
        hidden: false
      },
      behaviour: {
        printBanner: /* @__PURE__ */ __name(() => !isNonInteractiveOrCI(), "printBanner")
      },
      args: {
        deploymentIdPrefix: {
          describe: "Optional deploymentId to filter deployments. This means that 'list' will only showcase deployments that contain this ID prefix",
          type: "string"
        },
        location: {
          requiresArg: true,
          type: "string",
          demandOption: false,
          describe: "Filter deployments by location"
        },
        image: {
          requiresArg: true,
          type: "string",
          demandOption: false,
          describe: "Filter deployments by image"
        },
        state: {
          requiresArg: true,
          type: "string",
          demandOption: false,
          describe: "Filter deployments by deployment state"
        },
        ipv4: {
          requiresArg: true,
          type: "string",
          demandOption: false,
          describe: "Filter deployments by ipv4 address"
        },
        label: {
          requiresArg: true,
          type: "array",
          demandOption: false,
          describe: "Filter deployments by labels",
          coerce: /* @__PURE__ */ __name((arg) => arg.map((a7) => a7?.toString() ?? ""), "coerce")
        }
      },
      positionalArgs: ["deploymentIdPrefix"],
      async handler(args, { config }) {
        await fillOpenAPIConfiguration(config, cloudchamberScope);
        await listCommand2(args, config);
      }
    });
  }
});

// src/cloudchamber/cli/index.ts
function pollRegistriesUntilCondition(onRegistries) {
  return new Promise((res, rej) => {
    let errCount = 0;
    const poll = /* @__PURE__ */ __name(() => {
      ImageRegistriesService.listImageRegistries().then((registries) => {
        try {
          if (!onRegistries(registries)) {
            setTimeout(() => poll(), 500);
          } else {
            res(registries);
          }
        } catch (err) {
          rej(err);
        }
      }).catch((err) => {
        errCount++;
        if (errCount > 3) {
          rej(err);
          return;
        }
        poll();
      });
    }, "poll");
    poll();
  });
}
function pollSSHKeysUntilCondition(onSSHKeys) {
  return new Promise((res, rej) => {
    let errCount = 0;
    const poll = /* @__PURE__ */ __name(() => {
      SshPublicKeysService.listSshPublicKeys().then((sshKeys) => {
        try {
          if (!onSSHKeys(sshKeys)) {
            setTimeout(() => poll(), 500);
          } else {
            res(sshKeys);
          }
        } catch (err) {
          rej(err);
        }
      }).catch((err) => {
        errCount++;
        if (errCount > 3) {
          rej(err);
          return;
        }
        poll();
      });
    }, "poll");
    poll();
  });
}
async function pollDeploymentUntilCondition(deploymentId, onDeployment) {
  return new Promise((res, rej) => {
    let errCount = 0;
    const poll = /* @__PURE__ */ __name(() => {
      DeploymentsService.getDeploymentV2(deploymentId).then((deployment) => {
        errCount = 0;
        try {
          if (!onDeployment(deployment)) {
            setTimeout(() => poll(), 500);
          } else {
            res(deployment);
          }
        } catch (err) {
          rej(err);
        }
      }).catch((err) => {
        errCount++;
        if (errCount > 3) {
          rej(err);
        }
      });
    }, "poll");
    poll();
  });
}
async function pollDeploymentUntilConditionWithPlacement(placementId, onPlacement) {
  return new Promise((res, rej) => {
    let errCount = 0;
    const poll = /* @__PURE__ */ __name(() => {
      PlacementsService.getPlacement(placementId).then((placement) => {
        errCount = 0;
        if (!onPlacement(placement)) {
          setTimeout(() => poll(), 500);
        } else {
          res(placement);
        }
      }).catch((err) => {
        errCount++;
        if (errCount > 3) {
          rej(err);
        }
      });
    }, "poll");
    poll();
  });
}
function unexpectedLastEvent(placement) {
  throw new WaitForAnotherPlacement(
    `There has been an unknown error creating the container. (${placement.events[placement.events.length - 1].name})`
  );
}
async function waitForEvent(deployment, ...eventName) {
  if (!deployment.current_placement) {
    throw new Error("unexpected null current placement");
  }
  let foundEvent;
  const placement = await pollDeploymentUntilConditionWithPlacement(
    deployment.current_placement.id,
    (p7) => {
      const event = p7.events.find(
        (e10) => eventName.includes(e10.name)
      );
      if (!event) {
        if (p7.status["health"] === "failed") {
          return true;
        }
        if (p7.status["health"] == "stopped") {
          return true;
        }
        return false;
      }
      foundEvent = event;
      return true;
    }
  );
  return { event: foundEvent, placement };
}
async function waitForImagePull(deployment) {
  const s7 = spinner();
  s7.start("Pulling your image");
  const [eventPlacement, err] = await wrap2(
    waitForEvent(deployment, "ImagePulled", "ImagePullError")
  );
  s7.stop();
  if (err) {
    throw new UserError(err.message);
  }
  if (eventPlacement.event == void 0 || eventPlacement.event.name === "ImagePullError" && eventPlacement.event.type !== "UserError") {
    checkPlacementStatus(eventPlacement.placement);
    return;
  }
  if (eventPlacement.event.name == "ImagePullError") {
    if (eventPlacement.event.message.includes("404")) {
      throw new UserError(
        `Your container image couldn't be pulled, (404 not found). Did you specify the correct URL?
	Run ${brandColor(
          process.argv0 + " cloudchamber modify " + deployment.id
        )} to change the deployment image`
      );
    }
    throw new UserError(capitalize(eventPlacement.event.message));
  }
  updateStatus("Pulled your image");
  log(
    `${brandColor("pulled image")} ${dim(
      `in ${eventPlacement.event.details["duration"]}`
    )}
`
  );
}
function checkPlacementStatus(placement) {
  if (placement.status["health"] === "stopped") {
    throw new WaitForAnotherPlacement(
      `The container stopped while waiting for the deployment to be created.
Either the deployment has been modified, changed location, or your container is in a reboot loop!`
    );
  }
  unexpectedLastEvent(placement);
}
async function waitForVMToStart(deployment) {
  const s7 = spinner();
  s7.start("Creating your container");
  const [eventPlacement, err] = await wrap2(
    waitForEvent(deployment, "VMStarted")
  );
  s7.stop();
  if (err) {
    throw new UserError(err.message);
  }
  if (!eventPlacement.event) {
    checkPlacementStatus(eventPlacement.placement);
  }
  const ipv4 = eventPlacement.placement.status["ipv4Address"];
  if (ipv4) {
    log(`${brandColor("assigned IPv4 address")} ${dim(ipv4)}
`);
  }
  const ipv62 = eventPlacement.placement.status["ipv6Address"];
  if (ipv62) {
    log(`${brandColor("assigned IPv6 address")} ${dim(ipv62)}
`);
  }
  endSection("Done");
  logRaw(status.success + " Created your container\n");
  logRaw(
    `Run ${brandColor(
      `wrangler cloudchamber list ${deployment.id.slice(0, 6)}`
    )} to check its status`
  );
}
async function waitForPlacementInstance(deployment) {
  const s7 = spinner();
  s7.start(
    "Assigning a placement in " + idToLocationName(deployment.location.name)
  );
  const [d8, err] = await wrap2(
    pollDeploymentUntilCondition(deployment.id, (newDeployment) => {
      if (newDeployment.current_placement && !deployment.current_placement) {
        return true;
      }
      if (!newDeployment.current_placement) {
        return false;
      }
      if (newDeployment.version > deployment.version) {
        s7.stop();
        throw new WaitForAnotherPlacement(
          `There is a new version of the deployment modified in another wrangler session, new version is ${newDeployment.version}`
        );
      }
      if (newDeployment.current_placement.deployment_version < deployment.version) {
        return false;
      }
      return newDeployment.current_placement.id !== deployment.current_placement?.id;
    })
  );
  s7.stop();
  if (err instanceof WaitForAnotherPlacement) {
    throw err;
  }
  if (err) {
    throw new UserError(err.message);
  }
  updateStatus(
    "Assigned placement in " + idToLocationName(deployment.location.name),
    false
  );
  if (d8.current_placement !== void 0) {
    log(
      `${brandColor("version")} ${dim(d8.current_placement.deployment_version)}`
    );
    log(`${brandColor("id")} ${dim(d8.current_placement?.id)}`);
    newline();
  }
  deployment.current_placement = d8.current_placement;
}
async function waitForPlacement(deployment) {
  let currentDeployment = { ...deployment };
  let keepIterating = true;
  while (keepIterating) {
    try {
      await waitForPlacementInstance(currentDeployment);
      await waitForImagePull(currentDeployment);
      await waitForVMToStart(currentDeployment);
      keepIterating = false;
    } catch (err) {
      if (err instanceof WaitForAnotherPlacement) {
        updateStatus(status.error + " " + err.message);
        log(
          "We will retry by waiting for another placement. You can see more details about your deployment with \n" + brandColor("wrangler cloudchamber list " + currentDeployment.id) + "\n"
        );
        const [newDeployment, getDeploymentError] = await wrap2(
          DeploymentsService.getDeploymentV2(deployment.id)
        );
        if (getDeploymentError) {
          throw new UserError(
            "Couldn't retrieve a new deployment: " + getDeploymentError.message
          );
        }
        currentDeployment = newDeployment;
        continue;
      }
      throw err;
    }
  }
}
var WaitForAnotherPlacement;
var init_cli2 = __esm({
  "src/cloudchamber/cli/index.ts"() {
    init_import_meta_url();
    init_cli();
    init_colors();
    init_interactive();
    init_containers_shared();
    init_dist();
    init_strings();
    init_wrap();
    init_locations7();
    __name(pollRegistriesUntilCondition, "pollRegistriesUntilCondition");
    __name(pollSSHKeysUntilCondition, "pollSSHKeysUntilCondition");
    __name(pollDeploymentUntilCondition, "pollDeploymentUntilCondition");
    __name(pollDeploymentUntilConditionWithPlacement, "pollDeploymentUntilConditionWithPlacement");
    __name(unexpectedLastEvent, "unexpectedLastEvent");
    WaitForAnotherPlacement = class extends Error {
      static {
        __name(this, "WaitForAnotherPlacement");
      }
      constructor(message) {
        super(message);
      }
    };
    __name(waitForEvent, "waitForEvent");
    __name(waitForImagePull, "waitForImagePull");
    __name(checkPlacementStatus, "checkPlacementStatus");
    __name(waitForVMToStart, "waitForVMToStart");
    __name(waitForPlacementInstance, "waitForPlacementInstance");
    __name(waitForPlacement, "waitForPlacement");
  }
});

// src/cloudchamber/cli/locations.ts
function plural(word, size) {
  if (size > 1) {
    return `${word}s`;
  }
  return word;
}
async function getLocation(args, options = {}) {
  const locations = await getLocations();
  if (args.location !== void 0 && !locations.find((location2) => location2.location === args.location)) {
    locations.push({
      name: `Other (${args.location})`,
      location: args.location,
      region: ""
    });
  }
  if (args.location !== void 0) {
    const location2 = await processArgument(args, "location", {
      question: whichLocationQuestion,
      label: "location",
      defaultValue: args.location ?? "",
      type: "select",
      maxItemsPerPage: 6,
      options: locations.map((locationOption) => ({
        label: locationOption.name,
        value: locationOption.location
      }))
    });
    return location2;
  }
  const regionsToLocation = {};
  for (const location2 of locations) {
    regionsToLocation[location2.region] ??= [];
    regionsToLocation[location2.region].push(location2);
  }
  if (options.skipLocation) {
    regionsToLocation["Skip"] = [];
  }
  const region = await inputPrompt({
    question: whichRegionQuestion,
    label: "region",
    defaultValue: args.location ?? "",
    type: "select",
    maxItemsPerPage: 4,
    options: Object.keys(regionsToLocation).map((r10) => ({
      value: r10,
      label: `${r10} ${r10 === "Skip" ? "" : `(${regionsToLocation[r10].length} ${plural(
        "location",
        regionsToLocation[r10].length
      )})`}`
    }))
  });
  if (region === "Skip") {
    return "Skip";
  }
  const locationsToChoose = regionsToLocation[region];
  const locationToPops = {};
  for (const location2 of locationsToChoose) {
    locationToPops[location2.name] ??= [];
    locationToPops[location2.name].push(location2);
  }
  const location = await inputPrompt({
    question: whichLocationQuestion,
    label: "location",
    defaultValue: args.location ?? "",
    type: "select",
    maxItemsPerPage: 6,
    options: Object.keys(locationToPops).map((locationOption) => ({
      value: locationOption,
      label: locationOption
    }))
  });
  const pops = locationToPops[location];
  if (pops.length === 1) {
    return pops.pop().location;
  }
  const chosenPop = await inputPrompt({
    question: `There is multiple points of presence in ${location}, which one do you want to be in?`,
    label: "location",
    defaultValue: args.location ?? "",
    type: "select",
    maxItemsPerPage: 6,
    options: pops.map((locationOpt) => ({
      label: `${locationOpt.name} (${locationOpt.location})`,
      value: locationOpt.location
    }))
  });
  return chosenPop;
}
var whichLocationQuestion, whichRegionQuestion;
var init_locations8 = __esm({
  "src/cloudchamber/cli/locations.ts"() {
    init_import_meta_url();
    init_args();
    init_interactive();
    init_locations7();
    whichLocationQuestion = "Choose where you want to deploy your container";
    whichRegionQuestion = "Choose which region you want to deploy your container in";
    __name(plural, "plural");
    __name(getLocation, "getLocation");
  }
});

// src/cloudchamber/network/network.ts
async function getNetworkInput(args) {
  const ipv4 = await processArgument(args, "ipv4", {
    question: "Add an IPv4 to the deployment?",
    helpText: "Your deployment will have IPv4 network connectivity if you select yes. Your deployment will always have an IPv6",
    label: "Include IPv4",
    type: "confirm"
  });
  return ipv4 === true ? { assign_ipv4: "predefined" /* PREDEFINED */ } : { assign_ipv6: "predefined" /* PREDEFINED */ };
}
var init_network = __esm({
  "src/cloudchamber/network/network.ts"() {
    init_import_meta_url();
    init_args();
    init_containers_shared();
    __name(getNetworkInput, "getNetworkInput");
  }
});
function validateSSHKey(line) {
  const supportedSyntaxInfo = "Syntax is space-separated: keytype, base64-encoded key, comment(optional). Example: 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIC0chNcjRotdsxXTwPPNoqVCGn4EcEWdUkkBPNm/v4gm cool-public-key'";
  const supportedKeyTypes = ["ssh-ed25519"];
  const syntaxError = `Invalid Authorized Key format.`;
  const keyTypeError = `Invalid key type. Supported key types are: ${supportedKeyTypes.join(
    ","
  )}. ${supportedSyntaxInfo}`;
  const invalidKey = `Invalid public key. ${supportedSyntaxInfo}`;
  const parts = line.split(" ");
  if (![2, 3].includes(parts.length)) {
    throw new Error(syntaxError);
  }
  const keyType = parts[0];
  if (!supportedKeyTypes.includes(keyType)) {
    throw new Error(keyTypeError);
  }
  const base64Key = parts[1];
  try {
    atob(base64Key);
  } catch {
    throw new Error(invalidKey);
  }
}
function validatePublicSSHKeyCLI(line, { json }) {
  const bail = /* @__PURE__ */ __name((reason) => {
    if (!json) {
      throw new UserError(reason);
    } else {
      logger.json({ error: reason });
      process7.exit(1);
    }
  }, "bail");
  try {
    validateSSHKey(line);
  } catch (err) {
    if (err instanceof Error) {
      bail(err.message);
    }
    bail("unknown error validating ssh key");
  }
}
var init_validate2 = __esm({
  "src/cloudchamber/ssh/validate.ts"() {
    init_import_meta_url();
    init_dist();
    init_logger();
    __name(validateSSHKey, "validateSSHKey");
    __name(validatePublicSSHKeyCLI, "validatePublicSSHKeyCLI");
  }
});
async function retrieveSSHKey(sshKeyPath, { json } = { json: false }) {
  try {
    const file3 = (await fs9.readFile(sshKeyPath)).toString();
    validatePublicSSHKeyCLI(file3, { json });
    return file3;
  } catch {
    if (!json) {
      logger.debug("couldn't read the file, assuming input is an ssh key");
    }
    validatePublicSSHKeyCLI(sshKeyPath, { json });
    return sshKeyPath;
  }
}
async function sshPrompts(args, keys = void 0) {
  const [key, prompt2] = await shouldPromptForNewSSHKeyAppear(keys);
  if (prompt2) {
    const yes = await inputPrompt({
      question: "You didn't add any public keys from your .ssh folder, do you want to add one?",
      label: "",
      defaultValue: false,
      helpText: "If you don't add a public ssh key, you won't be able to ssh into your container unless you set it up",
      type: "confirm"
    });
    if (yes) {
      const sshKey = await promptForSSHKey({
        ...args,
        name: void 0,
        publicKey: void 0
      });
      updateStatus(
        "You will be able to ssh into containers where you add this ssh key from now on!"
      );
      return sshKey.id;
    }
    return key || void 0;
  }
  return key || void 0;
}
async function sshListHandler(sshArgs, config) {
  if (isNonInteractiveOrCI()) {
    const sshKeys = await SshPublicKeysService.listSshPublicKeys();
    logger.json(sshKeys);
    return;
  }
  await handleListSSHKeysCommand();
}
async function sshCreateHandler(sshArgs) {
  if (isNonInteractiveOrCI()) {
    const body = checkEverythingIsSet(sshArgs, ["publicKey", "name"]);
    const sshKey = await retrieveSSHKey(body.publicKey, {
      json: true
    });
    const addedSSHKey = await SshPublicKeysService.createSshPublicKey({
      ...body,
      public_key: sshKey.trim()
    });
    logger.json(addedSSHKey);
    return;
  }
  await handleCreateSSHPublicKeyCommand(sshArgs);
}
async function tryToRetrieveAllDefaultSSHKeyPaths() {
  const HOME = os11.homedir();
  const path84 = `${HOME}/.ssh`;
  const paths = [];
  try {
    const dirList = await fs9.readdir(path84);
    for (const file3 of dirList) {
      if (file3.endsWith(".pub")) {
        const s7 = await fs9.stat(`${path84}/${file3}`);
        if (s7.isFile()) {
          paths.push(`${path84}/${file3}`);
        }
      }
    }
  } catch {
    return [];
  }
  return paths;
}
async function tryToRetrieveADefaultPath() {
  const paths = await tryToRetrieveAllDefaultSSHKeyPaths();
  const path84 = paths.pop();
  return path84 ?? "";
}
function clipPublicSSHKey(value) {
  return value.split(" ").slice(1).map(
    (val2, i7) => dim(val2.length >= 10 && i7 === 0 ? val2.slice(0, 10) + "..." : val2)
  ).join(" ");
}
async function shouldPromptForNewSSHKeyAppear(keys = void 0) {
  try {
    const { start, stop } = spinner();
    start("Loading");
    const [sshKeys, err] = keys !== void 0 ? [keys, null] : await wrap2(pollSSHKeysUntilCondition(() => true));
    stop();
    if (err !== null) {
      log(
        "\n" + status.warning + " We couldn't load the ssh public keys of the account, so Wrangler doesn't know if you have your SSH keys configured right. Try again?\n"
      );
      return [void 0, false];
    }
    const defaultSSHKeyPaths = await tryToRetrieveAllDefaultSSHKeyPaths();
    if (defaultSSHKeyPaths.length === 0) {
      return [void 0, false];
    }
    let foundValidSSHKeyThatDontExist = false;
    for (const defaultSSHKeyPath of defaultSSHKeyPaths) {
      const file3 = (await fs9.readFile(defaultSSHKeyPath)).toString().trim();
      try {
        validateSSHKey(file3);
      } catch {
        continue;
      }
      const key = sshKeys.find((k7) => k7.public_key?.includes(file3));
      if (key) {
        return [key.id, false];
      }
      foundValidSSHKeyThatDontExist = true;
    }
    return [void 0, foundValidSSHKeyThatDontExist];
  } catch {
    return [void 0, false];
  }
}
async function handleListSSHKeysCommand(_args, _config) {
  startSection("SSH Keys", "", false);
  const { start, stop } = spinner();
  start("Loading your ssh keys");
  const [sshKeys, err] = await wrap2(pollSSHKeysUntilCondition(() => true));
  stop();
  if (err) {
    throw err;
  }
  if (sshKeys.length === 0) {
    endSection(
      "No ssh keys added to your account!",
      "You can add one with\n" + brandColor("wrangler cloudchamber ssh create")
    );
    return;
  }
  for (const sshKey of sshKeys) {
    newline();
    updateStatus(
      `${sshKey.name}
ID: ${dim(sshKey.id)}
Key: ${dim(
        (sshKey.public_key ?? "").trim()
      )}`,
      false
    );
  }
  endSection("");
}
async function handleCreateSSHPublicKeyCommand(args) {
  startSection(
    "Choose an ssh key to add",
    "It will allow you to ssh into new containers"
  );
  await promptForSSHKey(args);
  success("You are now able to ssh into your containers");
  logRaw(
    dim(
      "\nRemember that you will have to wait for a container restart until you're able to ssh into it"
    )
  );
}
async function promptForSSHKey(args) {
  const { username } = os11.userInfo();
  const name2 = await inputPrompt({
    question: "Name your ssh key in a recognisable format for later",
    label: "name",
    validate: /* @__PURE__ */ __name((value) => {
      if (typeof value !== "string") {
        return "unknown error";
      }
      if (value.length === 0) {
        return "you should fill this input";
      }
    }, "validate"),
    defaultValue: args.name ?? "",
    initialValue: args.name ?? "",
    helpText: `for example: 'ssh-key-${username || "me"}'`,
    type: "text"
  });
  const defaultSSHKeyPath = await tryToRetrieveADefaultPath();
  const sshKeyPath = await inputPrompt({
    question: "Insert the path to your public ssh key",
    label: "ssh_key",
    validate: /* @__PURE__ */ __name((value) => {
      if (typeof value !== "string") {
        return "unknown error";
      }
      if (value.length === 0) {
        return "you should fill this input";
      }
    }, "validate"),
    defaultValue: args.publicKey ?? defaultSSHKeyPath,
    initialValue: args.publicKey ?? defaultSSHKeyPath,
    helpText: "Or insert the key directly",
    type: "text"
  });
  const sshKey = await retrieveSSHKey(sshKeyPath);
  log(
    `${brandColor("Verified")} public key successfully!
` + brandColor(sshKey.split(" ").slice(0, 1).join(" ")) + " " + clipPublicSSHKey(sshKey)
  );
  const { start, stop } = spinner();
  start("Adding your ssh key");
  const [res, err] = await wrap2(
    SshPublicKeysService.createSshPublicKey({
      public_key: sshKey.trim(),
      name: name2
    })
  );
  stop();
  if (err != null) {
    throw new UserError("Error adding your public ssh key: " + err.message);
  }
  return res;
}
var cloudchamberSshNamespace, cloudchamberSshListCommand, cloudchamberSshCreateCommand;
var init_ssh2 = __esm({
  "src/cloudchamber/ssh/ssh.ts"() {
    init_import_meta_url();
    init_cli();
    init_colors();
    init_interactive();
    init_containers_shared();
    init_dist();
    init_create_command();
    init_is_interactive();
    init_logger();
    init_cli2();
    init_common();
    init_wrap();
    init_validate2();
    __name(retrieveSSHKey, "retrieveSSHKey");
    __name(sshPrompts, "sshPrompts");
    __name(sshListHandler, "sshListHandler");
    __name(sshCreateHandler, "sshCreateHandler");
    __name(tryToRetrieveAllDefaultSSHKeyPaths, "tryToRetrieveAllDefaultSSHKeyPaths");
    __name(tryToRetrieveADefaultPath, "tryToRetrieveADefaultPath");
    __name(clipPublicSSHKey, "clipPublicSSHKey");
    __name(shouldPromptForNewSSHKeyAppear, "shouldPromptForNewSSHKeyAppear");
    __name(handleListSSHKeysCommand, "handleListSSHKeysCommand");
    __name(handleCreateSSHPublicKeyCommand, "handleCreateSSHPublicKeyCommand");
    __name(promptForSSHKey, "promptForSSHKey");
    cloudchamberSshNamespace = createNamespace({
      metadata: {
        description: "Manage the ssh keys of your account",
        status: "alpha",
        owner: "Product: Cloudchamber",
        hidden: false
      }
    });
    cloudchamberSshListCommand = createCommand({
      metadata: {
        description: "List the ssh keys added to your account",
        status: "alpha",
        owner: "Product: Cloudchamber",
        hidden: false
      },
      behaviour: {
        printBanner: /* @__PURE__ */ __name(() => !isNonInteractiveOrCI(), "printBanner")
      },
      args: {},
      async handler(args, { config }) {
        await fillOpenAPIConfiguration(config, cloudchamberScope);
        await sshListHandler();
      }
    });
    cloudchamberSshCreateCommand = createCommand({
      metadata: {
        description: "Create an ssh key",
        status: "alpha",
        owner: "Product: Cloudchamber",
        hidden: false
      },
      behaviour: {
        printBanner: /* @__PURE__ */ __name(() => !isNonInteractiveOrCI(), "printBanner")
      },
      args: {
        name: {
          type: "string",
          describe: "The alias to your ssh key, you can put a recognisable name for you here"
        },
        "public-key": {
          type: "string",
          describe: "An SSH public key, you can specify either a path or the ssh key directly here"
        }
      },
      async handler(args, { config }) {
        await fillOpenAPIConfiguration(config, cloudchamberScope);
        await sshCreateHandler(args);
      }
    });
  }
});

// src/cloudchamber/create.ts
async function handleCloudchamberCreateCommand(args, config) {
  const environmentVariables = collectEnvironmentVariables(
    [],
    config,
    args.var
  );
  const labels = collectLabels(args.label);
  if (isNonInteractiveOrCI()) {
    if (config.cloudchamber.image != void 0 && args.image == void 0) {
      args.image = config.cloudchamber.image;
    }
    if (config.cloudchamber.location != void 0 && args.location == void 0) {
      args.location = config.cloudchamber.location;
    }
    const body = checkEverythingIsSet(args, ["image", "location"]);
    const { err } = parseImageName(body.image);
    if (err !== void 0) {
      throw new Error(err);
    }
    const keysToAdd = args.allSshKeys ? (await pollSSHKeysUntilCondition(() => true)).map((key) => key.id) : [];
    const useIpv4 = args.ipv4 ?? config.cloudchamber.ipv4;
    const network = useIpv4 === true ? { assign_ipv4: "predefined" /* PREDEFINED */ } : { assign_ipv6: "predefined" /* PREDEFINED */ };
    const memoryMib = resolveMemory(args, config.cloudchamber);
    const vcpu = args.vcpu ?? config.cloudchamber.vcpu;
    const instanceType = checkInstanceType(args, config.cloudchamber);
    const deploymentRequest = {
      image: body.image,
      location: body.location,
      ssh_public_key_ids: keysToAdd,
      environment_variables: environmentVariables,
      labels,
      instance_type: instanceType,
      network
    };
    if (instanceType === void 0) {
      deploymentRequest.vcpu = vcpu;
      deploymentRequest.memory_mib = memoryMib;
    }
    const deployment = await DeploymentsService.createDeploymentV2(deploymentRequest);
    logger.json(deployment);
    return;
  }
  await handleInteractiveCloudchamberCreateCommand(
    args,
    config,
    environmentVariables,
    labels
  );
}
async function askWhichSSHKeysDoTheyWantToAdd(args, key) {
  const keyItems = await pollSSHKeysUntilCondition(() => true);
  const keys = keyItems.map((keyItem) => keyItem.id);
  if (args.allSshKeys === true) {
    return keys;
  }
  if (args.sshKeyId && args.sshKeyId.length) {
    return key ? [...args.sshKeyId, key] : args.sshKeyId;
  }
  if (keys.length === 1) {
    const yes = await inputPrompt({
      question: `Do you want to add the SSH key ${keyItems[0].name}?`,
      type: "confirm",
      helpText: "You need this to SSH into the VM",
      defaultValue: false,
      label: ""
    });
    if (yes) {
      return keys;
    }
    return [];
  }
  if (keys.length <= 1) {
    return [];
  }
  const res = await inputPrompt({
    question: "You have multiple SSH keys in your account, what do you want to do for this new deployment?",
    label: "ssh",
    defaultValue: false,
    helpText: "",
    type: "select",
    options: [
      { label: "Add all of them", value: "all" },
      { label: "Select the keys", value: "select" },
      { label: "Don't add any SSH keys", value: "none" }
    ]
  });
  if (res === "all") {
    return keys;
  }
  if (res === "select") {
    const resKeys = await inputPrompt({
      question: "Select the keys you want to add",
      label: "",
      defaultValue: [],
      helpText: "Select one key with the 'space' key. Submit with 'enter'",
      type: "multiselect",
      options: keyItems.map((keyOpt) => ({
        label: keyOpt.name,
        value: keyOpt.id
      })),
      validate: /* @__PURE__ */ __name((values) => {
        if (!Array.isArray(values)) {
          return "unknown error";
        }
        if (values.length === 0) {
          return "Select atleast one ssh key!";
        }
        return;
      }, "validate")
    });
    return resKeys;
  }
  return [];
}
async function handleInteractiveCloudchamberCreateCommand(args, config, environmentVariables, labels) {
  startSection("Create a Cloudflare container", "Step 1 of 2");
  const sshKeyID = await sshPrompts(args);
  const givenImage = args.image ?? config.cloudchamber.image;
  const image = await processArgument({ image: givenImage }, "image", {
    question: whichImageQuestion,
    label: "image",
    validate: /* @__PURE__ */ __name((value) => {
      if (typeof value !== "string") {
        return "Unknown error";
      }
      if (value.length === 0) {
        value = defaultContainerImage;
      }
      const { err: err2 } = parseImageName(value);
      return err2;
    }, "validate"),
    defaultValue: givenImage ?? defaultContainerImage,
    helpText: 'NAME:TAG ("latest" tag is not allowed)',
    type: "text"
  });
  const location = await getLocation({
    location: args.location ?? config.cloudchamber.location
  });
  const keys = await askWhichSSHKeysDoTheyWantToAdd(args, sshKeyID);
  const network = await getNetworkInput({
    ipv4: args.ipv4 ?? config.cloudchamber.ipv4
  });
  const selectedEnvironmentVariables = await promptForEnvironmentVariables(
    environmentVariables,
    [],
    false
  );
  const selectedLabels = await promptForLabels(labels, [], false);
  const account = await loadAccount();
  const memoryMib = resolveMemory(args, config.cloudchamber) ?? account.defaults.memory_mib ?? Math.round(
    parseByteSize(account.defaults.memory ?? "2000MiB", 1024) / (1024 * 1024)
  );
  const vcpu = args.vcpu ?? config.cloudchamber.vcpu ?? account.defaults.vcpus;
  const instanceType = await promptForInstanceType(true);
  renderDeploymentConfiguration("create", {
    image,
    location,
    network,
    instanceType,
    vcpu,
    memoryMib,
    environmentVariables: selectedEnvironmentVariables,
    labels: selectedLabels,
    env: args.env
  });
  const yes = await inputPrompt({
    type: "confirm",
    question: "Proceed?",
    label: ""
  });
  if (!yes) {
    cancel("Not creating the container");
    return;
  }
  const { start, stop } = spinner();
  start("Creating your container", "your container will be created shortly");
  const deploymentRequest = {
    image,
    location,
    ssh_public_key_ids: keys,
    environment_variables: environmentVariables,
    labels,
    instance_type: instanceType,
    vcpu: void 0,
    memory_mib: void 0,
    network
  };
  if (instanceType === void 0) {
    deploymentRequest.vcpu = vcpu;
    deploymentRequest.memory_mib = memoryMib;
  }
  const [deployment, err] = await wrap2(
    DeploymentsService.createDeploymentV2(deploymentRequest)
  );
  if (err) {
    stop();
    renderDeploymentMutationError(account, err);
    return;
  }
  stop();
  updateStatus("Created deployment", false);
  log(`${brandColor("id")} ${dim(deployment.id)}
`);
  endSection("Creating a placement for your container");
  startSection("Create a Cloudflare container", "Step 2 of 2");
  await waitForPlacement(deployment);
}
var defaultContainerImage, whichImageQuestion, cloudchamberCreateCommand;
var init_create3 = __esm({
  "src/cloudchamber/create.ts"() {
    init_import_meta_url();
    init_cli();
    init_args();
    init_colors();
    init_interactive();
    init_containers_shared();
    init_dist();
    init_create_command();
    init_is_interactive();
    init_logger();
    init_cli2();
    init_locations8();
    init_common();
    init_wrap();
    init_instance_type();
    init_locations7();
    init_network();
    init_ssh2();
    defaultContainerImage = "docker.io/cloudflare/hello-world:1.0";
    __name(handleCloudchamberCreateCommand, "handleCloudchamberCreateCommand");
    __name(askWhichSSHKeysDoTheyWantToAdd, "askWhichSSHKeysDoTheyWantToAdd");
    __name(handleInteractiveCloudchamberCreateCommand, "handleInteractiveCloudchamberCreateCommand");
    whichImageQuestion = "Which image should we use for your container?";
    cloudchamberCreateCommand = createCommand({
      metadata: {
        description: "Create a new deployment",
        status: "alpha",
        owner: "Product: Cloudchamber",
        hidden: false
      },
      behaviour: {
        printBanner: /* @__PURE__ */ __name(() => !isNonInteractiveOrCI(), "printBanner")
      },
      args: {
        image: {
          requiresArg: true,
          type: "string",
          demandOption: false,
          describe: "Image to use for your deployment"
        },
        location: {
          requiresArg: true,
          type: "string",
          demandOption: false,
          describe: "Location on Cloudflare's network where your deployment will run"
        },
        var: {
          requiresArg: true,
          type: "string",
          array: true,
          demandOption: false,
          describe: "Container environment variables",
          coerce: /* @__PURE__ */ __name((arg) => arg.map((a7) => a7?.toString() ?? ""), "coerce")
        },
        label: {
          requiresArg: true,
          type: "array",
          demandOption: false,
          describe: "Deployment labels",
          coerce: /* @__PURE__ */ __name((arg) => arg.map((a7) => a7?.toString() ?? ""), "coerce")
        },
        "all-ssh-keys": {
          requiresArg: false,
          type: "boolean",
          demandOption: false,
          describe: "To add all SSH keys configured on your account to be added to this deployment, set this option to true"
        },
        "ssh-key-id": {
          requiresArg: false,
          type: "string",
          array: true,
          demandOption: false,
          describe: "ID of the SSH key to add to the deployment"
        },
        "instance-type": {
          requiresArg: true,
          choices: [
            "lite",
            "basic",
            "standard-1",
            "standard-2",
            "standard-3",
            "standard-4"
          ],
          demandOption: false,
          describe: "Instance type to allocate to this deployment"
        },
        vcpu: {
          requiresArg: true,
          type: "number",
          demandOption: false,
          describe: "Number of vCPUs to allocate to this deployment."
        },
        memory: {
          requiresArg: true,
          type: "string",
          demandOption: false,
          describe: "Amount of memory (GiB, MiB...) to allocate to this deployment. Ex: 4GiB."
        },
        ipv4: {
          requiresArg: false,
          type: "boolean",
          demandOption: false,
          describe: "Include an IPv4 in the deployment"
        }
      },
      async handler(args, { config }) {
        await fillOpenAPIConfiguration(config, cloudchamberScope);
        await handleCloudchamberCreateCommand(args, config);
      }
    });
  }
});

// src/cloudchamber/delete.ts
async function deleteCommand2(deleteArgs, config) {
  if (isNonInteractiveOrCI()) {
    if (!deleteArgs.deploymentId) {
      throw new Error(
        "there needs to be a deploymentId when you can't interact with the wrangler cli"
      );
    }
    const deployment = await DeploymentsService.deleteDeploymentV2(
      deleteArgs.deploymentId
    );
    logger.json(deployment);
    return;
  }
  await handleDeleteCommand(deleteArgs);
}
async function handleDeleteCommand(args, _config) {
  startSection("Delete your deployment");
  const deployment = await pickDeployment(args.deploymentId);
  logDeployment(deployment);
  const yes = await inputPrompt({
    question: "Are you sure that you want to delete this deployment?",
    type: "confirm",
    label: ""
  });
  if (!yes) {
    cancel("The operation has been cancelled");
    return;
  }
  const [, err] = await wrap2(
    DeploymentsService.deleteDeploymentV2(deployment.id)
  );
  if (err) {
    throw new UserError(
      `There has been an internal error deleting your deployment.
 ${err.message}`
    );
  }
  endSection("Your container has been deleted");
}
var cloudchamberDeleteCommand;
var init_delete2 = __esm({
  "src/cloudchamber/delete.ts"() {
    init_import_meta_url();
    init_cli();
    init_interactive();
    init_containers_shared();
    init_dist();
    init_create_command();
    init_is_interactive();
    init_logger();
    init_deployments3();
    init_common();
    init_wrap();
    __name(deleteCommand2, "deleteCommand");
    __name(handleDeleteCommand, "handleDeleteCommand");
    cloudchamberDeleteCommand = createCommand({
      metadata: {
        description: "Delete an existing deployment that is running in the Cloudflare edge",
        status: "alpha",
        owner: "Product: Cloudchamber",
        hidden: false
      },
      behaviour: {
        printBanner: /* @__PURE__ */ __name(() => !isNonInteractiveOrCI(), "printBanner")
      },
      args: {
        deploymentId: {
          type: "string",
          demandOption: false,
          describe: "Deployment you want to delete"
        }
      },
      positionalArgs: ["deploymentId"],
      async handler(args, { config }) {
        await fillOpenAPIConfiguration(config, cloudchamberScope);
        await deleteCommand2(args);
      }
    });
  }
});

// src/cloudchamber/modify.ts
async function modifyCommand(modifyArgs, config) {
  if (isNonInteractiveOrCI()) {
    if (!modifyArgs.deploymentId) {
      throw new Error(
        "there needs to be a deploymentId when you can't interact with the wrangler cli"
      );
    }
    const environmentVariables = collectEnvironmentVariables(
      [],
      config,
      modifyArgs.var
    );
    const labels = collectLabels(modifyArgs.label);
    const memoryMib = resolveMemory(modifyArgs, config.cloudchamber);
    const vcpu = modifyArgs.vcpu ?? config.cloudchamber.vcpu;
    const instanceType = checkInstanceType(modifyArgs, config.cloudchamber);
    const modifyRequest = {
      image: modifyArgs.image ?? config.cloudchamber.image,
      location: modifyArgs.location ?? config.cloudchamber.location,
      environment_variables: environmentVariables,
      labels,
      ssh_public_key_ids: modifyArgs.sshPublicKeyId,
      instance_type: instanceType,
      vcpu: void 0,
      memory_mib: void 0
    };
    if (instanceType === void 0) {
      modifyRequest.vcpu = vcpu;
      modifyRequest.memory_mib = memoryMib;
    }
    const deployment = await DeploymentsService.modifyDeploymentV2(
      modifyArgs.deploymentId,
      modifyRequest
    );
    logger.json(deployment);
    return;
  }
  await handleModifyCommand(modifyArgs, config);
}
async function handleSSH(args, config, deployment) {
  if (args.sshPublicKeyId !== void 0) {
    return args.sshPublicKeyId;
  }
  await sshPrompts(args);
  const keys = await pollSSHKeysUntilCondition(() => true);
  let keysToAdd = [...deployment.ssh_public_key_ids ?? []];
  const yes = await inputPrompt({
    type: "confirm",
    question: "Do you want to modify existing ssh keys from the deployment?",
    label: "",
    defaultValue: false
  });
  if (!yes) {
    return void 0;
  }
  if ((deployment.ssh_public_key_ids?.length || 0) > 0) {
    const keysSelected = await inputPrompt({
      type: "multiselect",
      question: "Select the keys you want to remove from the deployment",
      helpText: "You can select pressing 'space'. Submit with 'enter'",
      options: keys.filter((k7) => deployment.ssh_public_key_ids?.includes(k7.id)).map((key) => ({ label: key.name, value: key.id })),
      label: "removing"
    });
    keysToAdd = keys.filter((key) => deployment.ssh_public_key_ids?.includes(key.id)).filter((key) => !keysSelected.includes(key.id)).map((k7) => k7.id);
  }
  const addKeysOptions = keys.filter((k7) => !deployment.ssh_public_key_ids?.includes(k7.id)).map((key) => ({ label: key.name, value: key.id }));
  if (addKeysOptions.length > 0) {
    const newKeys = await inputPrompt({
      type: "multiselect",
      question: "Select the keys you want to add to the deployment",
      options: addKeysOptions,
      label: "adding",
      defaultValue: []
    });
    keysToAdd = [...newKeys, ...keysToAdd];
  }
  return keysToAdd;
}
async function handleModifyCommand(args, config) {
  startSection("Modify deployment");
  const deployment = await pickDeployment(args.deploymentId);
  const keys = await handleSSH(args, config, deployment);
  const givenImage = args.image ?? config.cloudchamber.image;
  const image = await processArgument({ image: givenImage }, "image", {
    question: modifyImageQuestion,
    label: "",
    validate: /* @__PURE__ */ __name((value) => {
      if (typeof value !== "string") {
        return "Unknown error";
      }
      const { err: err2 } = parseImageName(value);
      return err2;
    }, "validate"),
    defaultValue: givenImage ?? deployment.image,
    initialValue: givenImage ?? deployment.image,
    helpText: "press Return to leave unchanged",
    type: "text"
  });
  const locationPick = await getLocation(
    { location: args.location ?? config.cloudchamber.location },
    { skipLocation: true }
  );
  const location = locationPick === "Skip" ? void 0 : locationPick;
  const environmentVariables = collectEnvironmentVariables(
    deployment.environment_variables,
    config,
    args.var
  );
  const selectedEnvironmentVariables = await promptForEnvironmentVariables(
    environmentVariables,
    (deployment.environment_variables ?? []).map((v8) => v8.name),
    true
  );
  const labels = collectLabels(args.label);
  const selectedLabels = await promptForLabels(
    labels,
    (deployment.labels ?? []).map((v8) => v8.name),
    true
  );
  const memoryMib = resolveMemory(args, config.cloudchamber);
  const instanceType = await promptForInstanceType(true);
  renderDeploymentConfiguration("modify", {
    image,
    location: location ?? deployment.location.name,
    instanceType,
    vcpu: args.vcpu ?? config.cloudchamber.vcpu ?? deployment.vcpu,
    memoryMib: memoryMib ?? deployment.memory_mib,
    env: args.env,
    environmentVariables: selectedEnvironmentVariables !== void 0 ? selectedEnvironmentVariables : deployment.environment_variables,
    // show the existing environment variables if any
    labels: selectedLabels !== void 0 ? selectedLabels : deployment.labels
    // show the existing labels if any
  });
  const yesOrNo = await inputPrompt({
    question: "Modify the deployment?",
    label: "",
    type: "confirm"
  });
  if (!yesOrNo) {
    cancel("Not modifying the deployment");
    return;
  }
  const { start, stop } = spinner();
  start(
    "Modifying your container",
    "shortly your container will be modified to a new version"
  );
  const modifyRequest = {
    image,
    location,
    ssh_public_key_ids: keys,
    environment_variables: selectedEnvironmentVariables,
    labels: selectedLabels,
    instance_type: instanceType
  };
  if (instanceType === void 0) {
    modifyRequest.vcpu = args.vcpu ?? config.cloudchamber.vcpu;
    modifyRequest.memory_mib = memoryMib;
  }
  const [newDeployment, err] = await wrap2(
    DeploymentsService.modifyDeploymentV2(deployment.id, modifyRequest)
  );
  stop();
  if (err) {
    renderDeploymentMutationError(await loadAccount(), err);
    return;
  }
  await waitForPlacement(newDeployment);
}
var modifyImageQuestion, cloudchamberModifyCommand;
var init_modify = __esm({
  "src/cloudchamber/modify.ts"() {
    init_import_meta_url();
    init_cli();
    init_args();
    init_interactive();
    init_containers_shared();
    init_create_command();
    init_is_interactive();
    init_logger();
    init_cli2();
    init_deployments3();
    init_locations8();
    init_common();
    init_wrap();
    init_instance_type();
    init_locations7();
    init_ssh2();
    __name(modifyCommand, "modifyCommand");
    __name(handleSSH, "handleSSH");
    __name(handleModifyCommand, "handleModifyCommand");
    modifyImageQuestion = "URL of the image to use in your deployment";
    cloudchamberModifyCommand = createCommand({
      metadata: {
        description: "Modify an existing deployment",
        status: "alpha",
        owner: "Product: Cloudchamber",
        hidden: false
      },
      behaviour: {
        printBanner: /* @__PURE__ */ __name(() => !isNonInteractiveOrCI(), "printBanner")
      },
      args: {
        deploymentId: {
          type: "string",
          demandOption: false,
          describe: "The deployment you want to modify"
        },
        var: {
          requiresArg: true,
          type: "array",
          demandOption: false,
          describe: "Container environment variables",
          coerce: /* @__PURE__ */ __name((arg) => arg.map((a7) => a7?.toString() ?? ""), "coerce")
        },
        label: {
          requiresArg: true,
          type: "array",
          demandOption: false,
          describe: "Deployment labels",
          coerce: /* @__PURE__ */ __name((arg) => arg.map((a7) => a7?.toString() ?? ""), "coerce")
        },
        "ssh-public-key-id": {
          requiresArg: true,
          type: "string",
          array: true,
          demandOption: false,
          describe: "Public SSH key IDs to include in this container. You can add one to your account with `wrangler cloudchamber ssh create"
        },
        image: {
          requiresArg: true,
          type: "string",
          demandOption: false,
          describe: "The new image that the deployment will have from now on"
        },
        location: {
          requiresArg: true,
          type: "string",
          demandOption: false,
          describe: "The new location that the deployment will have from now on"
        },
        "instance-type": {
          requiresArg: true,
          choices: ["dev", "basic", "standard"],
          demandOption: false,
          describe: "The new instance type that the deployment will have from now on"
        },
        vcpu: {
          requiresArg: true,
          type: "number",
          demandOption: false,
          describe: "The new vcpu that the deployment will have from now on"
        },
        memory: {
          requiresArg: true,
          type: "string",
          demandOption: false,
          describe: "The new memory that the deployment will have from now on"
        }
      },
      positionalArgs: ["deploymentId"],
      async handler(args, { config }) {
        await fillOpenAPIConfiguration(config, cloudchamberScope);
        await modifyCommand(args, config);
      }
    });
  }
});

// src/cloudchamber/apply.ts
function mergeDeep3(target, source) {
  if (typeof target !== "object" || target === null) {
    return source;
  }
  if (typeof source !== "object" || source === null) {
    return target;
  }
  const result = { ...target };
  for (const key of Object.keys(source)) {
    const srcVal = source[key];
    const tgtVal = target[key];
    if (isObject2(tgtVal) && isObject2(srcVal)) {
      result[key] = mergeDeep3(tgtVal, srcVal);
    } else {
      result[key] = srcVal;
    }
  }
  return result;
}
function isObject2(value) {
  return typeof value === "object" && value !== null && !Array.isArray(value);
}
function createApplicationToModifyApplication2(req) {
  return {
    configuration: req.configuration,
    instances: req.max_instances !== void 0 ? 0 : req.instances,
    max_instances: req.max_instances,
    constraints: req.constraints,
    affinities: req.affinities,
    scheduling_policy: req.scheduling_policy
  };
}
function applicationToCreateApplication(accountId, application) {
  const app = {
    configuration: {
      ...application.configuration,
      image: resolveImageName(accountId, application.configuration.image)
    },
    constraints: application.constraints,
    max_instances: application.max_instances,
    name: application.name,
    scheduling_policy: application.scheduling_policy,
    affinities: application.affinities,
    instances: application.max_instances !== void 0 ? 0 : application.instances,
    jobs: application.jobs ? true : void 0,
    durable_objects: application.durable_objects
  };
  return app;
}
function observabilityToConfiguration2(observability, existingObservabilityConfig) {
  const observabilityLogsEnabled = observability?.logs?.enabled === true || observability?.enabled === true && observability?.logs?.enabled !== false;
  const logsAlreadyEnabled = existingObservabilityConfig?.logs?.enabled;
  if (observabilityLogsEnabled) {
    return { logs: { enabled: true } };
  } else {
    if (logsAlreadyEnabled === void 0) {
      return void 0;
    } else {
      return { logs: { enabled: false } };
    }
  }
}
function containerAppToInstanceType(containerApp) {
  let configuration = containerApp.configuration ?? {};
  if (containerApp.instance_type !== void 0) {
    if (typeof containerApp.instance_type === "string") {
      return { instance_type: containerApp.instance_type };
    }
    configuration = {
      vcpu: containerApp.instance_type.vcpu,
      memory_mib: containerApp.instance_type.memory_mib,
      disk: {
        size_mb: containerApp.instance_type.disk_mb
      }
    };
  }
  if (configuration.disk?.size_mb === void 0 && configuration.vcpu === void 0 && configuration.memory_mib === void 0) {
    return { instance_type: "lite" /* LITE */ };
  }
  return configuration;
}
function convertContainerAffinitiesForApi2(container) {
  if (container.affinities === void 0) {
    return void 0;
  }
  const affinities = {
    colocation: container.affinities?.colocation,
    hardware_generation: container.affinities?.hardware_generation
  };
  return affinities;
}
function containerAppToCreateApplication(accountId, containerApp, observability, existingApp, skipDefaults = false) {
  const observabilityConfiguration = observabilityToConfiguration2(
    observability,
    existingApp?.configuration.observability
  );
  const instanceType = containerAppToInstanceType(containerApp);
  const configuration = {
    ...containerApp.configuration,
    ...instanceType,
    observability: observabilityConfiguration
  };
  if (containerApp.name === void 0) {
    throw new FatalError("Container application name failed to be set", 1, {
      telemetryMessage: true
    });
  }
  const app = {
    ...containerApp,
    name: containerApp.name,
    configuration: {
      ...configuration,
      // De-sugar image name
      image: resolveImageName(accountId, configuration.image)
    },
    instances: containerApp.instances ?? 0,
    scheduling_policy: containerApp.scheduling_policy ?? "default" /* DEFAULT */,
    constraints: {
      ...containerApp.constraints ?? (!skipDefaults ? { tier: 1 } : void 0),
      cities: containerApp.constraints?.cities?.map(
        (city) => city.toLowerCase()
      ),
      regions: containerApp.constraints?.regions?.map(
        (region) => region.toUpperCase()
      )
    },
    affinities: convertContainerAffinitiesForApi2(containerApp)
  };
  delete app["class_name"];
  delete app["image"];
  delete app["image_build_context"];
  delete app["image_vars"];
  delete app["rollout_step_percentage"];
  delete app["rollout_kind"];
  delete app["instance_type"];
  return app;
}
async function apply2(args, config) {
  startSection(
    "Deploy a container application",
    "deploy changes to your application"
  );
  config.containers ??= [];
  if (config.containers.length === 0) {
    endSection(
      "You don't have any container applications defined in your wrangler.toml",
      "You can set the following configuration in your wrangler.toml"
    );
    const configuration = {
      image: "docker.io/cloudflare/hello-world:1.0",
      instances: 2,
      name: config.name ?? "my-containers-application",
      instance_type: "lite"
    };
    const endConfig = args.env !== void 0 ? {
      env: { [args.env]: { containers: [configuration] } }
    } : { containers: [configuration] };
    formatConfigSnippet(endConfig, config.configPath).split("\n").forEach((el) => logRaw(`    ${el}`));
    return;
  }
  const applications = await promiseSpinner(
    ApplicationsService.listApplications(),
    { message: "Loading applications" }
  );
  const applicationByNames = {};
  for (const application of applications) {
    applicationByNames[application.name] = application;
  }
  const actions = [];
  log(dim("Container application changes\n"));
  for (const appConfigNoDefaults of config.containers) {
    appConfigNoDefaults.configuration ??= {};
    appConfigNoDefaults.configuration.image = appConfigNoDefaults.image;
    const application = applicationByNames[appConfigNoDefaults.name ?? // we should never actually reach this point, but just in case
    `${config.name}-${appConfigNoDefaults.class_name}`];
    const accountId = await getAccountId(config);
    const appConfig = containerAppToCreateApplication(
      accountId,
      appConfigNoDefaults,
      config.observability,
      application,
      args.skipDefaults
    );
    if (application !== void 0 && application !== null) {
      const prevApp = sortObjectRecursive(
        stripUndefined(applicationToCreateApplication(accountId, application))
      );
      if (appConfigNoDefaults.scheduling_policy === void 0) {
        appConfig.scheduling_policy = prevApp.scheduling_policy;
      }
      if (prevApp.durable_objects !== void 0 && appConfigNoDefaults.durable_objects !== void 0 && prevApp.durable_objects.namespace_id !== appConfigNoDefaults.durable_objects.namespace_id) {
        throw new UserError(
          `Application "${prevApp.name}" is assigned to durable object ${prevApp.durable_objects.namespace_id}, but a new DO namespace is being assigned to the application,
					you should delete the container application and deploy again`
        );
      }
      const prevContainer = appConfig.configuration.instance_type !== void 0 ? cleanForInstanceType(prevApp) : prevApp;
      const nowContainer = mergeDeep3(
        prevContainer,
        sortObjectRecursive(appConfig)
      );
      const prev = formatConfigSnippet(
        { containers: [prevContainer] },
        config.configPath
      );
      const now = formatConfigSnippet(
        { containers: [nowContainer] },
        config.configPath
      );
      const diff = new Diff(prev, now);
      if (diff.changes === 0) {
        updateStatus(`no changes ${brandColor(application.name)}`);
        continue;
      }
      updateStatus(
        `${brandColor.underline("EDIT")} ${application.name}`,
        false
      );
      newline();
      diff.print();
      newline();
      if (appConfigNoDefaults.rollout_kind !== "none") {
        actions.push({
          action: "modify",
          application: createApplicationToModifyApplication2(appConfig),
          id: application.id,
          name: application.name,
          rollout_step_percentage: application.durable_objects !== void 0 ? appConfigNoDefaults.rollout_step_percentage ?? 25 : appConfigNoDefaults.rollout_step_percentage,
          rollout_kind: appConfigNoDefaults.rollout_kind == "full_manual" ? CreateApplicationRolloutRequest.kind.FULL_MANUAL : CreateApplicationRolloutRequest.kind.FULL_AUTO
        });
      } else {
        log("Skipping application rollout");
        newline();
      }
      continue;
    }
    updateStatus(bold.underline(green.underline("NEW")) + ` ${appConfig.name}`);
    const s7 = formatConfigSnippet(
      {
        containers: [
          {
            ...appConfig,
            instances: appConfig.max_instances !== void 0 ? (
              // trick until we allow setting instances to undefined in the API
              void 0
            ) : appConfig.instances
          }
        ]
      },
      config.configPath
    );
    s7.trimEnd().split("\n").forEach((el) => log(`  ${el}`));
    newline();
    const configToPush = { ...appConfig };
    actions.push({
      action: "create",
      application: configToPush
    });
  }
  if (actions.length == 0) {
    endSection("No changes to be made");
    return;
  }
  function formatError2(err) {
    if (err.body.error === "VALIDATE_INPUT" /* VALIDATE_INPUT */ && err.body.details !== void 0) {
      let message = "";
      for (const key in err.body.details) {
        message += `  ${brandColor(key)} ${err.body.details[key]}
`;
      }
      return message;
    }
    if (err.body.error !== void 0) {
      return `  ${err.body.error}`;
    }
    return JSON.stringify(err.body);
  }
  __name(formatError2, "formatError");
  for (const action of actions) {
    if (action.action === "create") {
      let application;
      try {
        application = await promiseSpinner(
          ApplicationsService.createApplication(action.application),
          { message: `Creating ${action.application.name}` }
        );
      } catch (err) {
        if (!(err instanceof Error)) {
          throw err;
        }
        if (!(err instanceof ApiError)) {
          throw new UserError(
            `Unexpected error creating application: ${err.message}`
          );
        }
        if (err.status === 400) {
          throw new UserError(
            `Error creating application due to a misconfiguration
${formatError2(err)}`
          );
        }
        throw new UserError(
          `Error creating application due to an internal error (request id: ${err.body.request_id}):
${formatError2(err)}`
        );
      }
      success(
        `Created application ${brandColor(action.application.name)} (Application ID: ${application.id})`,
        {
          shape: shapes.bar
        }
      );
      continue;
    }
    if (action.action === "modify") {
      try {
        await promiseSpinner(
          ApplicationsService.modifyApplication(action.id, {
            ...action.application,
            instances: action.application.max_instances !== void 0 ? void 0 : action.application.instances
          }),
          { message: `Modifying ${action.application.name}` }
        );
      } catch (err) {
        if (!(err instanceof Error)) {
          throw err;
        }
        if (!(err instanceof ApiError)) {
          throw new UserError(
            `Unexpected error modifying application ${action.name}: ${err.message}`
          );
        }
        if (err.status === 400) {
          throw new UserError(
            `Error modifying application ${action.name} due to a misconfiguration:

	${formatError2(err)}`
          );
        }
        throw new UserError(
          `Error modifying application ${action.name} due to an internal error (request id: ${err.body.request_id}):
${formatError2(err)}`
        );
      }
      if (action.rollout_step_percentage !== void 0) {
        try {
          await promiseSpinner(
            RolloutsService.createApplicationRollout(action.id, {
              description: "Progressive update",
              strategy: CreateApplicationRolloutRequest.strategy.ROLLING,
              target_configuration: action.application.configuration ?? {},
              ...configRolloutStepsToAPI(action.rollout_step_percentage),
              kind: action.rollout_kind
            }),
            {
              message: `rolling out container version ${action.name}`
            }
          );
        } catch (err) {
          if (!(err instanceof Error)) {
            throw err;
          }
          if (!(err instanceof ApiError)) {
            throw new UserError(
              `Unexpected error rolling out application ${action.name}:
${err.message}`
            );
          }
          if (err.status === 400) {
            throw new UserError(
              `Error rolling out application ${action.name} due to a misconfiguration:

	${formatError2(err)}`
            );
          }
          throw new UserError(
            `Error rolling out application ${action.name} due to an internal error (request id: ${err.body.request_id}): ${formatError2(err)}`
          );
        }
      }
      success(`Modified application ${brandColor(action.name)}`, {
        shape: shapes.bar
      });
      continue;
    }
  }
  newline();
  endSection("Applied changes");
}
async function applyCommand(args, config) {
  return apply2(
    {
      skipDefaults: args.skipDefaults,
      env: args.env
    },
    config
  );
}
var cloudchamberApplyCommand;
var init_apply = __esm({
  "src/cloudchamber/apply.ts"() {
    init_import_meta_url();
    init_cli();
    init_colors();
    init_containers_shared();
    init_dist();
    init_deploy();
    init_create_command();
    init_user3();
    init_diff();
    init_sortObjectRecursive();
    init_common();
    init_instance_type();
    __name(mergeDeep3, "mergeDeep");
    __name(isObject2, "isObject");
    __name(createApplicationToModifyApplication2, "createApplicationToModifyApplication");
    __name(applicationToCreateApplication, "applicationToCreateApplication");
    __name(observabilityToConfiguration2, "observabilityToConfiguration");
    __name(containerAppToInstanceType, "containerAppToInstanceType");
    __name(convertContainerAffinitiesForApi2, "convertContainerAffinitiesForApi");
    __name(containerAppToCreateApplication, "containerAppToCreateApplication");
    __name(apply2, "apply");
    __name(applyCommand, "applyCommand");
    cloudchamberApplyCommand = createCommand({
      metadata: {
        description: "Apply the changes in the container applications to deploy",
        status: "alpha",
        owner: "Product: Cloudchamber",
        hidden: true,
        deprecated: true,
        deprecatedMessage: "`wrangler cloudchamber apply` is deprecated and will be removed in the next major version.\nPlease use `wrangler deploy` instead."
      },
      args: {
        "skip-defaults": {
          requiresArg: true,
          type: "boolean",
          demandOption: false,
          describe: "Skips recommended defaults added by apply"
        }
      },
      async handler(args, { config }) {
        await fillOpenAPIConfiguration(config, cloudchamberScope);
        await applyCommand(args, config);
      }
    });
  }
});
function formatLabelledValues(view, {
  formatLabel = /* @__PURE__ */ __name((label) => white(label + ":"), "formatLabel"),
  formatValue = /* @__PURE__ */ __name((value) => gray(value), "formatValue"),
  spacerCount = 2,
  indentationCount = 0,
  valuesAlignmentColumn: valuesAlignment = Math.max(
    ...Object.keys(view).map(
      (label) => util4.stripVTControlCharacters(formatLabel(label)).length
    )
  ),
  lineSeparator = "\n",
  labelJustification = "left"
} = {}) {
  const labelLengthsWithoutANSI = Object.keys(view).map(
    (label) => util4.stripVTControlCharacters(formatLabel(label)).length
  );
  const formattedLines = Object.entries(view).map(([label, value], i7) => {
    const indentation = indentationCount ? " ".repeat(indentationCount) : "";
    const labelAlignment = labelJustification === "left" ? "" : " ".repeat(valuesAlignment - labelLengthsWithoutANSI[i7]);
    const formattedAndAlignedLabel = labelAlignment + formatLabel(label);
    const formattedAndAlignedMultilineValue = formatValue(value).split("\n").map((line, lineNo) => {
      const prefixSpacing = " ".repeat(
        lineNo === 0 ? valuesAlignment + spacerCount - labelLengthsWithoutANSI[i7] - labelAlignment.length : valuesAlignment + spacerCount + indentationCount
      );
      return prefixSpacing + line;
    }).join("\n");
    return indentation + formattedAndAlignedLabel + formattedAndAlignedMultilineValue;
  });
  const output = formattedLines.join(lineSeparator);
  return collapseWhiteSpaceLines(output);
}
function collapseWhiteSpaceLines(input) {
  return input.replaceAll(/^\s+$/gm, "");
}
var init_render_labelled_values = __esm({
  "src/utils/render-labelled-values.ts"() {
    init_import_meta_url();
    init_colors();
    __name(formatLabelledValues, "formatLabelledValues");
    __name(collapseWhiteSpaceLines, "collapseWhiteSpaceLines");
  }
});
async function curlCommand(args, config) {
  await requestFromCmd(args);
}
async function read(stream2) {
  const chunks = [];
  for await (const chunk of stream2) {
    chunks.push(chunk);
  }
  return Buffer.concat(chunks).toString("utf8");
}
async function requestFromCmd(args, _config) {
  const requestId = `wrangler-${crypto2.randomUUID()}`;
  if (args.verbose && !args.silent) {
    logRaw(bold(brandColor("Request ID: " + requestId)));
  }
  if (args.useStdin) {
    args.data = await read(process.stdin);
  }
  try {
    const headers = (args.header ?? []).reduce(
      (prev, now) => ({
        ...prev,
        [now.toString().split(":")[0].trim()]: now.toString().split(":")[1].trim()
      }),
      { "coordinator-request-id": requestId }
    );
    const data = args.data ?? args.dataDeprecated;
    const res = await request(OpenAPI, {
      url: args.path,
      method: args.method,
      body: data ? JSON.parse(data) : void 0,
      mediaType: "application/json",
      headers
    });
    if (args.silent) {
      logRaw(
        JSON.stringify(
          !args.verbose ? res : {
            res,
            headers,
            request_id: requestId
          },
          null,
          4
        )
      );
    } else {
      if (args.verbose) {
        logRaw(cyanBright(">> Headers"));
        logRaw(
          formatLabelledValues(headers, {
            indentationCount: 4,
            formatLabel: /* @__PURE__ */ __name(function(label) {
              return yellow(label + ":");
            }, "formatLabel"),
            formatValue: yellow
          })
        );
        logRaw(cyanBright(">> Body"));
      }
      const text = JSON.stringify(res, null, 4);
      logRaw(text);
    }
    return;
  } catch (error2) {
    if (error2 instanceof ApiError) {
      logRaw(
        JSON.stringify({
          request: error2.request,
          status: error2.status,
          statusText: error2.statusText,
          body: error2.body
        })
      );
    } else {
      logRaw(String(error2));
    }
  }
}
var cloudchamberCurlCommand;
var init_curl = __esm({
  "src/cloudchamber/curl.ts"() {
    init_import_meta_url();
    init_cli();
    init_colors();
    init_containers_shared();
    init_request();
    init_create_command();
    init_render_labelled_values();
    init_common();
    __name(curlCommand, "curlCommand");
    __name(read, "read");
    __name(requestFromCmd, "requestFromCmd");
    cloudchamberCurlCommand = createCommand({
      metadata: {
        description: "Send a request to an arbitrary Cloudchamber endpoint",
        status: "alpha",
        owner: "Product: Cloudchamber",
        hidden: false
      },
      args: {
        path: {
          type: "string",
          default: "/",
          demandOption: true
        },
        header: {
          type: "array",
          alias: "H",
          describe: "Add headers in the form of --header <name>:<value>"
        },
        data: {
          type: "string",
          describe: "Add a JSON body to the request",
          alias: "d"
        },
        "data-deprecated": {
          type: "string",
          hidden: true,
          alias: "D"
        },
        method: {
          type: "string",
          alias: "X",
          default: "GET"
        },
        silent: {
          describe: "Only output response",
          type: "boolean",
          alias: "s"
        },
        verbose: {
          describe: "Print everything, like request id, or headers",
          type: "boolean",
          alias: "v"
        },
        "use-stdin": {
          describe: "Equivalent of using --data-binary @- in curl",
          type: "boolean",
          alias: "stdin"
        }
      },
      positionalArgs: ["path"],
      async handler(args, { config }) {
        await fillOpenAPIConfiguration(config, cloudchamberScope);
        await curlCommand(args);
      }
    });
  }
});

// src/cloudchamber/images/registries.ts
async function registriesConfigureHandler(imageArgs, config) {
  if (isNonInteractiveOrCI()) {
    const body = checkEverythingIsSet(imageArgs, ["domain", "public"]);
    const registry = await ImageRegistriesService.createImageRegistry({
      domain: body.domain,
      is_public: body.public
    });
    logger.log(JSON.stringify(registry, null, 4));
    return;
  }
  await handleConfigureImageRegistryCommand(imageArgs);
}
async function registriesCredentialsHandler(imageArgs) {
  if (!imageArgs.pull && !imageArgs.push) {
    throw new UserError(
      "You have to specify either --push or --pull in the command."
    );
  }
  const credentials = await ImageRegistriesService.generateImageRegistryCredentials(
    imageArgs.domain,
    {
      expiration_minutes: imageArgs.expirationMinutes,
      permissions: [
        ...imageArgs.push ? ["push"] : [],
        ...imageArgs.pull ? ["pull"] : []
      ]
    }
  );
  logger.log(credentials.password);
}
async function registriesRemoveHandler(imageArgs) {
  const registry = await ImageRegistriesService.deleteImageRegistry(
    imageArgs.domain
  );
  logger.log(JSON.stringify(registry, null, 4));
}
async function registriesListHandler(_args, config) {
  if (isNonInteractiveOrCI()) {
    const registries = await ImageRegistriesService.listImageRegistries();
    logger.log(JSON.stringify(registries, null, 4));
    return;
  }
  await handleListImageRegistriesCommand();
}
async function handleListImageRegistriesCommand(_args, _config) {
  startSection("Registries", "", false);
  const [registries, err] = await wrap2(
    promiseSpinner(pollRegistriesUntilCondition(() => true))
  );
  if (err) {
    throw err;
  }
  if (registries.length === 0) {
    endSection(
      "No registries added to your account!",
      "You can add one with\n" + brandColor("wrangler cloudchamber registry configure")
    );
    return;
  }
  for (const registry of registries) {
    newline();
    updateStatus(
      `${registry.domain}
public_key: ${dim(
        (registry.public_key ?? "").trim()
      )}`,
      false
    );
  }
  endSection("");
}
async function handleConfigureImageRegistryCommand(args, _config) {
  startSection("Configure a Docker registry in Cloudflare");
  const domain2 = await processArgument({ domain: args.domain }, "domain", {
    type: "text",
    question: "What is the domain of your registry?",
    validate: /* @__PURE__ */ __name((text) => {
      const t13 = text?.toString();
      if (t13?.includes("://")) {
        return "a proto like https:// shouldn't be included";
      }
    }, "validate"),
    label: "domain",
    defaultValue: "",
    helpText: "example.com, example-with-port:8080. Remember to not include https!"
  });
  const isPublic = await processArgument({ public: args.public }, "public", {
    type: "confirm",
    question: "Is the domain public?",
    label: "is public",
    helpText: "if the domain is not owned by you or you want it to be public, mark as yes"
  });
  const [registry, err] = await wrap2(
    promiseSpinner(
      ImageRegistriesService.createImageRegistry({
        domain: domain2,
        is_public: isPublic
      })
    )
  );
  if (err instanceof ApiError) {
    const { error: errString } = err.body;
    switch (errString) {
      case ImageRegistryAlreadyExistsError.error.IMAGE_REGISTRY_ALREADY_EXISTS:
        throw new UserError("The domain already exists!");
      case ImageRegistryNotAllowedError.error.IMAGE_REGISTRY_NOT_ALLOWED:
        throw new UserError("This domain is not allowed!");
      default:
        throw new UserError(
          "An unexpected error happened, please try again or send us the error for troubleshooting\n" + errString
        );
    }
  }
  if (err) {
    throw new UserError(
      "There has been an internal error: " + JSON.stringify(err)
    );
  }
  endSection(
    `Docker registry configured`,
    registry?.public_key && "set the following public key in the registry if necessary:\n" + registry?.public_key
  );
}
var cloudchamberRegistriesNamespace, cloudchamberRegistriesConfigureCommand, cloudchamberRegistriesCredentialsCommand, cloudchamberRegistriesRemoveCommand, cloudchamberRegistriesListCommand;
var init_registries2 = __esm({
  "src/cloudchamber/images/registries.ts"() {
    init_import_meta_url();
    init_cli();
    init_args();
    init_colors();
    init_containers_shared();
    init_dist();
    init_create_command();
    init_is_interactive();
    init_logger();
    init_cli2();
    init_common();
    init_wrap();
    __name(registriesConfigureHandler, "registriesConfigureHandler");
    __name(registriesCredentialsHandler, "registriesCredentialsHandler");
    __name(registriesRemoveHandler, "registriesRemoveHandler");
    __name(registriesListHandler, "registriesListHandler");
    __name(handleListImageRegistriesCommand, "handleListImageRegistriesCommand");
    __name(handleConfigureImageRegistryCommand, "handleConfigureImageRegistryCommand");
    cloudchamberRegistriesNamespace = createNamespace({
      metadata: {
        description: "Configure registries via Cloudchamber",
        status: "alpha",
        owner: "Product: Cloudchamber",
        hidden: false
      }
    });
    cloudchamberRegistriesConfigureCommand = createCommand({
      metadata: {
        description: "Configure Cloudchamber to pull from specific registries",
        status: "alpha",
        owner: "Product: Cloudchamber",
        hidden: false
      },
      behaviour: {
        printBanner: /* @__PURE__ */ __name(() => !isNonInteractiveOrCI(), "printBanner")
      },
      args: {
        domain: {
          description: "Domain of your registry. Don't include the proto part of the URL, like 'http://'",
          type: "string"
        },
        public: {
          description: "If the registry is public and you don't want credentials configured, set this to true",
          type: "boolean"
        }
      },
      async handler(args, { config }) {
        await fillOpenAPIConfiguration(config, cloudchamberScope);
        await registriesConfigureHandler(args);
      }
    });
    cloudchamberRegistriesCredentialsCommand = createCommand({
      metadata: {
        description: "Get a temporary password for a specific domain",
        status: "alpha",
        owner: "Product: Cloudchamber",
        hidden: false
      },
      behaviour: {
        printBanner: /* @__PURE__ */ __name(() => !isNonInteractiveOrCI(), "printBanner")
      },
      args: {
        domain: {
          type: "string",
          demandOption: true
        },
        "expiration-minutes": {
          type: "number",
          default: 15
        },
        push: {
          type: "boolean",
          description: "If you want these credentials to be able to push"
        },
        pull: {
          type: "boolean",
          description: "If you want these credentials to be able to pull"
        }
      },
      positionalArgs: ["domain"],
      async handler(args, { config }) {
        await fillOpenAPIConfiguration(config, cloudchamberScope);
        await registriesCredentialsHandler(args);
      }
    });
    cloudchamberRegistriesRemoveCommand = createCommand({
      metadata: {
        description: "Remove the registry at the given domain",
        status: "alpha",
        owner: "Product: Cloudchamber",
        hidden: false
      },
      behaviour: {
        printBanner: /* @__PURE__ */ __name(() => !isNonInteractiveOrCI(), "printBanner")
      },
      args: {
        domain: {
          type: "string",
          demandOption: true
        }
      },
      positionalArgs: ["domain"],
      async handler(args, { config }) {
        await fillOpenAPIConfiguration(config, cloudchamberScope);
        await registriesRemoveHandler(args);
      }
    });
    cloudchamberRegistriesListCommand = createCommand({
      metadata: {
        description: "List registries configured for this account",
        status: "alpha",
        owner: "Product: Cloudchamber",
        hidden: false
      },
      behaviour: {
        printBanner: /* @__PURE__ */ __name(() => !isNonInteractiveOrCI(), "printBanner")
      },
      args: {},
      async handler(args, { config }) {
        await fillOpenAPIConfiguration(config, cloudchamberScope);
        await registriesListHandler();
      }
    });
  }
});

// src/cloudchamber/images/images.ts
async function handleDeleteImageCommand2(args, config) {
  if (!args.image.includes(":")) {
    throw new Error("Invalid image format. Expected IMAGE:TAG");
  }
  const digest = await promiseSpinner(
    getCreds2().then(async (creds) => {
      const accountId = await getAccountId(config);
      const url4 = new URL(`https://${getCloudflareContainerRegistry()}`);
      const baseUrl = `${url4.protocol}//${url4.host}`;
      const [image, tag] = args.image.split(":");
      const digest_ = await deleteTag2(baseUrl, accountId, image, tag, creds);
      const gcUrl = `${baseUrl}/v2/gc/layers`;
      const gcResponse = await (0, import_undici8.fetch)(gcUrl, {
        method: "PUT",
        headers: {
          Authorization: `Basic ${creds}`,
          "Content-Type": "application/json"
        }
      });
      if (!gcResponse.ok) {
        throw new Error(
          `Failed to delete image ${args.image}: ${gcResponse.status} ${gcResponse.statusText}`
        );
      }
      return digest_;
    }),
    { message: `Deleting ${args.image}` }
  );
  logger.log(`Deleted ${args.image} (${digest})`);
}
async function handleListImagesCommand2(args, config) {
  const responses = await promiseSpinner(
    getCreds2().then(async (creds) => {
      const repos = await listReposWithTags2(creds);
      const processed = [];
      const accountId = await getAccountId(config);
      const accountIdPrefix = new RegExp(`^${accountId}/`);
      const filter2 = new RegExp(args.filter ?? "");
      for (const [repo, tags] of Object.entries(repos)) {
        const stripped = repo.replace(/^\/+/, "");
        if (filter2.test(stripped)) {
          const name2 = stripped.replace(accountIdPrefix, "");
          processed.push({ name: name2, tags });
        }
      }
      return processed;
    }),
    { message: "Listing" }
  );
  await listImages2(responses, false, args.json);
}
async function listImages2(responses, digests = false, json = false) {
  if (!digests) {
    responses = responses.map((resp) => {
      return {
        name: resp.name,
        tags: resp.tags.filter((t13) => !t13.startsWith("sha256"))
      };
    });
  }
  responses = responses.filter((resp) => {
    return resp.tags !== void 0 && resp.tags.length != 0;
  });
  if (json) {
    logger.log(JSON.stringify(responses, null, 2));
  } else {
    const rows = responses.flatMap((r10) => r10.tags.map((t13) => [r10.name, t13]));
    const headers = ["REPOSITORY", "TAG"];
    const widths = new Array(headers.length).fill(0);
    for (let i7 = 0; i7 < widths.length - 1; i7++) {
      widths[i7] = rows.map((r10) => r10[i7].length).reduce((a7, b11) => Math.max(a7, b11), headers[i7].length);
    }
    logger.log(headers.map((h7, i7) => h7.padEnd(widths[i7], " ")).join("  "));
    for (const row of rows) {
      logger.log(row.map((v8, i7) => v8.padEnd(widths[i7], " ")).join("  "));
    }
  }
}
async function listReposWithTags2(creds) {
  const url4 = new URL(`https://${getCloudflareContainerRegistry()}`);
  const catalogUrl = `${url4.protocol}//${url4.host}/v2/_catalog?tags=true`;
  const response = await (0, import_undici8.fetch)(catalogUrl, {
    method: "GET",
    headers: {
      Authorization: `Basic ${creds}`
    }
  });
  if (!response.ok) {
    logger.log(JSON.stringify(response));
    throw new Error(
      `Failed to fetch repository catalog: ${response.status} ${response.statusText}`
    );
  }
  const data = await response.json();
  return data.repositories ?? {};
}
async function deleteTag2(baseUrl, accountId, image, tag, creds) {
  const manifestAcceptHeader = "application/vnd.oci.image.manifest.v1+json, application/vnd.docker.distribution.manifest.v2+json";
  const manifestUrl = `${baseUrl}/v2/${accountId}/${image}/manifests/${tag}`;
  const headResponse = await (0, import_undici8.fetch)(manifestUrl, {
    method: "HEAD",
    headers: {
      Authorization: `Basic ${creds}`,
      Accept: manifestAcceptHeader
    }
  });
  if (!headResponse.ok) {
    throw new Error(
      `Failed to retrieve info for ${image}:${tag}: ${headResponse.status} ${headResponse.statusText}`
    );
  }
  const digest = headResponse.headers.get("Docker-Content-Digest");
  if (!digest) {
    throw new Error(`Digest not found for ${image}:${tag}.`);
  }
  const deleteUrl = `${baseUrl}/v2/${accountId}/${image}/manifests/${tag}`;
  const deleteResponse = await (0, import_undici8.fetch)(deleteUrl, {
    method: "DELETE",
    headers: {
      Authorization: `Basic ${creds}`,
      Accept: manifestAcceptHeader
    }
  });
  if (!deleteResponse.ok) {
    throw new Error(
      `Failed to delete ${image}:${tag} (digest: ${digest}): ${deleteResponse.status} ${deleteResponse.statusText}`
    );
  }
  return digest;
}
async function getCreds2() {
  const credentials = await ImageRegistriesService.generateImageRegistryCredentials(
    getCloudflareContainerRegistry(),
    {
      expiration_minutes: 5,
      permissions: ["pull", "push"]
    }
  );
  return Buffer.from(`v1:${credentials.password}`).toString("base64");
}
var import_undici8, cloudchamberImagesNamespace, cloudchamberImagesListCommand, cloudchamberImagesDeleteCommand;
var init_images4 = __esm({
  "src/cloudchamber/images/images.ts"() {
    init_import_meta_url();
    init_containers_shared();
    import_undici8 = __toESM(require_undici());
    init_create_command();
    init_is_interactive();
    init_logger();
    init_user3();
    init_common();
    __name(handleDeleteImageCommand2, "handleDeleteImageCommand");
    __name(handleListImagesCommand2, "handleListImagesCommand");
    __name(listImages2, "listImages");
    __name(listReposWithTags2, "listReposWithTags");
    __name(deleteTag2, "deleteTag");
    __name(getCreds2, "getCreds");
    cloudchamberImagesNamespace = createNamespace({
      metadata: {
        description: "Manage images in the Cloudflare managed registry",
        status: "alpha",
        owner: "Product: Cloudchamber",
        hidden: false
      }
    });
    cloudchamberImagesListCommand = createCommand({
      metadata: {
        description: "List images in the Cloudflare managed registry",
        status: "alpha",
        owner: "Product: Cloudchamber",
        hidden: false
      },
      behaviour: {
        printBanner: /* @__PURE__ */ __name((args) => !args.json && !isNonInteractiveOrCI(), "printBanner")
      },
      args: {
        filter: {
          type: "string",
          description: "Regex to filter results"
        },
        json: {
          type: "boolean",
          description: "Format output as JSON",
          default: false
        }
      },
      async handler(args, { config }) {
        await fillOpenAPIConfiguration(config, cloudchamberScope);
        await handleListImagesCommand2(args, config);
      }
    });
    cloudchamberImagesDeleteCommand = createCommand({
      metadata: {
        description: "Remove an image from the Cloudflare managed registry",
        status: "alpha",
        owner: "Product: Cloudchamber",
        hidden: false
      },
      behaviour: {
        printBanner: /* @__PURE__ */ __name(() => !isNonInteractiveOrCI(), "printBanner")
      },
      args: {
        image: {
          type: "string",
          description: "Image and tag to delete, of the form IMAGE:TAG",
          demandOption: true
        }
      },
      positionalArgs: ["image"],
      async handler(args, { config }) {
        await fillOpenAPIConfiguration(config, cloudchamberScope);
        await handleDeleteImageCommand2(args, config);
      }
    });
  }
});

// src/cloudchamber/index.ts
var cloudchamberNamespace;
var init_cloudchamber = __esm({
  "src/cloudchamber/index.ts"() {
    init_import_meta_url();
    init_create_command();
    init_list4();
    init_create3();
    init_delete2();
    init_modify();
    init_apply();
    init_curl();
    init_build2();
    init_ssh2();
    init_registries2();
    init_images4();
    cloudchamberNamespace = createNamespace({
      metadata: {
        description: "Manage Cloudchamber",
        status: "alpha",
        owner: "Product: Cloudchamber",
        hidden: true
      }
    });
  }
});
function t2(e10, t13) {
  return `#compdef ${e10}
compdef _${e10} ${e10}

# zsh completion for ${e10} -*- shell-script -*-

__${e10}_debug() {
    local file="$BASH_COMP_DEBUG_FILE"
    if [[ -n \${file} ]]; then
        echo "$*" >> "\${file}"
    fi
}

_${e10}() {
    local shellCompDirectiveError=${a2.ShellCompDirectiveError}
    local shellCompDirectiveNoSpace=${a2.ShellCompDirectiveNoSpace}
    local shellCompDirectiveNoFileComp=${a2.ShellCompDirectiveNoFileComp}
    local shellCompDirectiveFilterFileExt=${a2.ShellCompDirectiveFilterFileExt}
    local shellCompDirectiveFilterDirs=${a2.ShellCompDirectiveFilterDirs}
    local shellCompDirectiveKeepOrder=${a2.ShellCompDirectiveKeepOrder}

    local lastParam lastChar flagPrefix requestComp out directive comp lastComp noSpace keepOrder
    local -a completions

    __${e10}_debug "\\n========= starting completion logic =========="
    __${e10}_debug "CURRENT: \${CURRENT}, words[*]: \${words[*]}"

    # The user could have moved the cursor backwards on the command-line.
    # We need to trigger completion from the $CURRENT location, so we need
    # to truncate the command-line ($words) up to the $CURRENT location.
    # (We cannot use $CURSOR as its value does not work when a command is an alias.)
    words=( "\${=words[1,CURRENT]}" )
    __${e10}_debug "Truncated words[*]: \${words[*]},"

    lastParam=\${words[-1]}
    lastChar=\${lastParam[-1]}
    __${e10}_debug "lastParam: \${lastParam}, lastChar: \${lastChar}"

    # For zsh, when completing a flag with an = (e.g., ${e10} -n=<TAB>)
    # completions must be prefixed with the flag
    setopt local_options BASH_REMATCH
    if [[ "\${lastParam}" =~ '-.*=' ]]; then
        # We are dealing with a flag with an =
        flagPrefix="-P \${BASH_REMATCH}"
    fi

    # Prepare the command to obtain completions, ensuring arguments are quoted for eval
    local -a args_to_quote=("\${(@)words[2,-1]}")
    if [ "\${lastChar}" = "" ]; then
        # If the last parameter is complete (there is a space following it)
        # We add an extra empty parameter so we can indicate this to the go completion code.
        __${e10}_debug "Adding extra empty parameter"
        args_to_quote+=("")
    fi

    # Use Zsh's (q) flag to quote each argument safely for eval
    local quoted_args=("\${(@q)args_to_quote}")

    # Join the main command and the quoted arguments into a single string for eval
    requestComp="${t13} complete -- \${quoted_args[*]}"

    __${e10}_debug "About to call: eval \${requestComp}"

    # Use eval to handle any environment variables and such
    out=$(eval \${requestComp} 2>/dev/null)
    __${e10}_debug "completion output: \${out}"

    # Extract the directive integer following a : from the last line
    local lastLine
    while IFS='
' read -r line; do
        lastLine=\${line}
    done < <(printf "%s
" "\${out[@]}")
    __${e10}_debug "last line: \${lastLine}"

    if [ "\${lastLine[1]}" = : ]; then
        directive=\${lastLine[2,-1]}
        # Remove the directive including the : and the newline
        local suffix
        (( suffix=\${#lastLine}+2))
        out=\${out[1,-$suffix]}
    else
        # There is no directive specified.  Leave $out as is.
        __${e10}_debug "No directive found.  Setting to default"
        directive=0
    fi

    __${e10}_debug "directive: \${directive}"
    __${e10}_debug "completions: \${out}"
    __${e10}_debug "flagPrefix: \${flagPrefix}"

    if [ $((directive & shellCompDirectiveError)) -ne 0 ]; then
        __${e10}_debug "Completion received error. Ignoring completions."
        return
    fi

    local activeHelpMarker="%"
    local endIndex=\${#activeHelpMarker}
    local startIndex=$((\${#activeHelpMarker}+1))
    local hasActiveHelp=0
    while IFS='
' read -r comp; do
        # Check if this is an activeHelp statement (i.e., prefixed with $activeHelpMarker)
        if [ "\${comp[1,$endIndex]}" = "$activeHelpMarker" ];then
            __${e10}_debug "ActiveHelp found: $comp"
            comp="\${comp[$startIndex,-1]}"
            if [ -n "$comp" ]; then
                compadd -x "\${comp}"
                __${e10}_debug "ActiveHelp will need delimiter"
                hasActiveHelp=1
            fi
            continue
        fi

        if [ -n "$comp" ]; then
            # If requested, completions are returned with a description.
            # The description is preceded by a TAB character.
            # For zsh's _describe, we need to use a : instead of a TAB.
            # We first need to escape any : as part of the completion itself.
            comp=\${comp//:/\\:}

            local tab="$(printf '\\t')"
            comp=\${comp//$tab/:}

            __${e10}_debug "Adding completion: \${comp}"
            completions+=\${comp}
            lastComp=$comp
        fi
    done < <(printf "%s
" "\${out[@]}")

    # Add a delimiter after the activeHelp statements, but only if:
    # - there are completions following the activeHelp statements, or
    # - file completion will be performed (so there will be choices after the activeHelp)
    if [ $hasActiveHelp -eq 1 ]; then
        if [ \${#completions} -ne 0 ] || [ $((directive & shellCompDirectiveNoFileComp)) -eq 0 ]; then
            __${e10}_debug "Adding activeHelp delimiter"
            compadd -x "--"
            hasActiveHelp=0
        fi
    fi

    if [ $((directive & shellCompDirectiveNoSpace)) -ne 0 ]; then
        __${e10}_debug "Activating nospace."
        noSpace="-S ''"
    fi

    if [ $((directive & shellCompDirectiveKeepOrder)) -ne 0 ]; then
        __${e10}_debug "Activating keep order."
        keepOrder="-V"
    fi

    if [ $((directive & shellCompDirectiveFilterFileExt)) -ne 0 ]; then
        # File extension filtering
        local filteringCmd
        filteringCmd='_files'
        for filter in \${completions[@]}; do
            if [ \${filter[1]} != '*' ]; then
                # zsh requires a glob pattern to do file filtering
                filter="\\*.$filter"
            fi
            filteringCmd+=" -g $filter"
        done
        filteringCmd+=" \${flagPrefix}"

        __${e10}_debug "File filtering command: $filteringCmd"
        _arguments '*:filename:'"$filteringCmd"
    elif [ $((directive & shellCompDirectiveFilterDirs)) -ne 0 ]; then
        # File completion for directories only
        local subdir
        subdir="\${completions[1]}"
        if [ -n "$subdir" ]; then
            __${e10}_debug "Listing directories in $subdir"
            pushd "\${subdir}" >/dev/null 2>&1
        else
            __${e10}_debug "Listing directories in ."
        fi

        local result
        _arguments '*:dirname:_files -/'" \${flagPrefix}"
        result=$?
        if [ -n "$subdir" ]; then
            popd >/dev/null 2>&1
        fi
        return $result
    else
        __${e10}_debug "Calling _describe"
        if eval _describe $keepOrder "completions" completions -Q \${flagPrefix} \${noSpace}; then
            __${e10}_debug "_describe found some completions"

            # Return the success of having called _describe
            return 0
        else
            __${e10}_debug "_describe did not find completions."
            __${e10}_debug "Checking if we should do file completion."
            if [ $((directive & shellCompDirectiveNoFileComp)) -ne 0 ]; then
                __${e10}_debug "deactivating file completion"

                # Return 0 to indicate completion is finished and prevent zsh from
                # trying other completion algorithms (which could cause hanging).
                # We use NoFileComp directive to explicitly disable file completion.
                return 0
            else
                # Perform file completion
                __${e10}_debug "Activating file completion"

                # We must return the result of this command, so it must be the
                # last command, or else we must store its result to return it.
                _arguments '*:filename:_files'" \${flagPrefix}"
            fi
        fi
    fi
}

# don't run the completion function when being sourced or eval-ed
if [ "\${funcstack[1]}" = "_${e10}" ]; then
    _${e10}
fi
`;
}
function n2(e10, t13) {
  let n9 = e10.replace(/[-:]/g, `_`);
  return `# bash completion for ${e10}

# Define shell completion directives
readonly ShellCompDirectiveError=${a2.ShellCompDirectiveError}
readonly ShellCompDirectiveNoSpace=${a2.ShellCompDirectiveNoSpace}
readonly ShellCompDirectiveNoFileComp=${a2.ShellCompDirectiveNoFileComp}
readonly ShellCompDirectiveFilterFileExt=${a2.ShellCompDirectiveFilterFileExt}
readonly ShellCompDirectiveFilterDirs=${a2.ShellCompDirectiveFilterDirs}
readonly ShellCompDirectiveKeepOrder=${a2.ShellCompDirectiveKeepOrder}

# Function to debug completion
__${n9}_debug() {
    if [[ -n \${BASH_COMP_DEBUG_FILE:-} ]]; then
        echo "$*" >> "\${BASH_COMP_DEBUG_FILE}"
    fi
}

# Function to handle completions
__${n9}_complete() {
    local cur prev words cword
    _get_comp_words_by_ref -n "=:" cur prev words cword

    local requestComp out directive
    
    # Build the command to get completions
    requestComp="${t13} complete -- \${words[@]:1}"
    
    # Add an empty parameter if the last parameter is complete
    if [[ -z "$cur" ]]; then
        requestComp="$requestComp ''"
    fi
    
    # Get completions from the program
    out=$(eval "$requestComp" 2>/dev/null)
    
    # Extract directive if present
    directive=0
    if [[ "$out" == *:* ]]; then
        directive=\${out##*:}
        out=\${out%:*}
    fi
    
    # Process completions based on directive
    if [[ $((directive & $ShellCompDirectiveError)) -ne 0 ]]; then
        # Error, no completion
        return
    fi
    
    # Apply directives
    if [[ $((directive & $ShellCompDirectiveNoSpace)) -ne 0 ]]; then
        compopt -o nospace
    fi
    if [[ $((directive & $ShellCompDirectiveKeepOrder)) -ne 0 ]]; then
        compopt -o nosort
    fi
    if [[ $((directive & $ShellCompDirectiveNoFileComp)) -ne 0 ]]; then
        compopt +o default
    fi
    
    # Handle file extension filtering
    if [[ $((directive & $ShellCompDirectiveFilterFileExt)) -ne 0 ]]; then
        local filter=""
        for ext in $out; do
            filter="$filter|$ext"
        done
        filter="\\.($filter)"
        compopt -o filenames
        COMPREPLY=( $(compgen -f -X "!$filter" -- "$cur") )
        return
    fi
    
    # Handle directory filtering
    if [[ $((directive & $ShellCompDirectiveFilterDirs)) -ne 0 ]]; then
        compopt -o dirnames
        COMPREPLY=( $(compgen -d -- "$cur") )
        return
    fi
    
    # Process completions
    local IFS=$'\\n'
    local tab=$(printf '\\t')
    
    # Parse completions with descriptions
    local completions=()
    while read -r comp; do
        if [[ "$comp" == *$tab* ]]; then
            # Split completion and description
            local value=\${comp%%$tab*}
            local desc=\${comp#*$tab}
            completions+=("$value")
        else
            completions+=("$comp")
        fi
    done <<< "$out"
    
    # Return completions
    COMPREPLY=( $(compgen -W "\${completions[*]}" -- "$cur") )
}

# Register completion function
complete -F __${n9}_complete ${e10}
`;
}
function r3(e10, t13) {
  let n9 = e10.replace(/[-:]/g, `_`), r10 = a2.ShellCompDirectiveError, i7 = a2.ShellCompDirectiveNoSpace, o7 = a2.ShellCompDirectiveNoFileComp, s7 = a2.ShellCompDirectiveFilterFileExt, c8 = a2.ShellCompDirectiveFilterDirs;
  return `# fish completion for ${e10} -*- shell-script -*-

function __${n9}_debug
    set -l file "$BASH_COMP_DEBUG_FILE"
    if test -n "$file"
        echo "$argv" >> $file
    end
end

function __${n9}_perform_completion
    __${n9}_debug "Starting __${n9}_perform_completion"

    # Extract all args except the last one
    set -l args (commandline -opc)
    # Extract the last arg and escape it in case it is a space or wildcard
    set -l lastArg (string escape -- (commandline -ct))

    __${n9}_debug "args: $args"
    __${n9}_debug "last arg: $lastArg"

    # Build the completion request command
    set -l requestComp "${t13} complete -- (string join ' ' -- (string escape -- $args[2..-1])) $lastArg"

    __${n9}_debug "Calling $requestComp"
    set -l results (eval $requestComp 2> /dev/null)

    # Some programs may output extra empty lines after the directive.
    # Let's ignore them or else it will break completion.
    # Ref: https://github.com/spf13/cobra/issues/1279
    for line in $results[-1..1]
        if test (string trim -- $line) = ""
            # Found an empty line, remove it
            set results $results[1..-2]
        else
            # Found non-empty line, we have our proper output
            break
        end
    end

    set -l comps $results[1..-2]
    set -l directiveLine $results[-1]

    # For Fish, when completing a flag with an = (e.g., <program> -n=<TAB>)
    # completions must be prefixed with the flag
    set -l flagPrefix (string match -r -- '-.*=' "$lastArg")

    __${n9}_debug "Comps: $comps"
    __${n9}_debug "DirectiveLine: $directiveLine"
    __${n9}_debug "flagPrefix: $flagPrefix"

    for comp in $comps
        printf "%s%s\\n" "$flagPrefix" "$comp"
    end

    printf "%s\\n" "$directiveLine"
end

# This function limits calls to __${n9}_perform_completion, by caching the result
function __${n9}_perform_completion_once
    __${n9}_debug "Starting __${n9}_perform_completion_once"

    if test -n "$__${n9}_perform_completion_once_result"
        __${n9}_debug "Seems like a valid result already exists, skipping __${n9}_perform_completion"
        return 0
    end

    set --global __${n9}_perform_completion_once_result (__${n9}_perform_completion)
    if test -z "$__${n9}_perform_completion_once_result"
        __${n9}_debug "No completions, probably due to a failure"
        return 1
    end

    __${n9}_debug "Performed completions and set __${n9}_perform_completion_once_result"
    return 0
end

# This function is used to clear the cached result after completions are run
function __${n9}_clear_perform_completion_once_result
    __${n9}_debug ""
    __${n9}_debug "========= clearing previously set __${n9}_perform_completion_once_result variable =========="
    set --erase __${n9}_perform_completion_once_result
    __${n9}_debug "Successfully erased the variable __${n9}_perform_completion_once_result"
end

function __${n9}_requires_order_preservation
    __${n9}_debug ""
    __${n9}_debug "========= checking if order preservation is required =========="

    __${n9}_perform_completion_once
    if test -z "$__${n9}_perform_completion_once_result"
        __${n9}_debug "Error determining if order preservation is required"
        return 1
    end

    set -l directive (string sub --start 2 $__${n9}_perform_completion_once_result[-1])
    __${n9}_debug "Directive is: $directive"

    set -l shellCompDirectiveKeepOrder ${a2.ShellCompDirectiveKeepOrder}
    set -l keeporder (math (math --scale 0 $directive / $shellCompDirectiveKeepOrder) % 2)
    __${n9}_debug "Keeporder is: $keeporder"

    if test $keeporder -ne 0
        __${n9}_debug "This does require order preservation"
        return 0
    end

    __${n9}_debug "This doesn't require order preservation"
    return 1
end

# This function does two things:
# - Obtain the completions and store them in the global __${n9}_comp_results
# - Return false if file completion should be performed
function __${n9}_prepare_completions
    __${n9}_debug ""
    __${n9}_debug "========= starting completion logic =========="

    # Start fresh
    set --erase __${n9}_comp_results

    __${n9}_perform_completion_once
    __${n9}_debug "Completion results: $__${n9}_perform_completion_once_result"

    if test -z "$__${n9}_perform_completion_once_result"
        __${n9}_debug "No completion, probably due to a failure"
        # Might as well do file completion, in case it helps
        return 1
    end

    set -l directive (string sub --start 2 $__${n9}_perform_completion_once_result[-1])
    set --global __${n9}_comp_results $__${n9}_perform_completion_once_result[1..-2]

    __${n9}_debug "Completions are: $__${n9}_comp_results"
    __${n9}_debug "Directive is: $directive"

    set -l shellCompDirectiveError ${r10}
    set -l shellCompDirectiveNoSpace ${i7}
    set -l shellCompDirectiveNoFileComp ${o7}
    set -l shellCompDirectiveFilterFileExt ${s7}
    set -l shellCompDirectiveFilterDirs ${c8}

    if test -z "$directive"
        set directive 0
    end

    set -l compErr (math (math --scale 0 $directive / $shellCompDirectiveError) % 2)
    if test $compErr -eq 1
        __${n9}_debug "Received error directive: aborting."
        # Might as well do file completion, in case it helps
        return 1
    end

    set -l filefilter (math (math --scale 0 $directive / $shellCompDirectiveFilterFileExt) % 2)
    set -l dirfilter (math (math --scale 0 $directive / $shellCompDirectiveFilterDirs) % 2)
    if test $filefilter -eq 1; or test $dirfilter -eq 1
        __${n9}_debug "File extension filtering or directory filtering not supported"
        # Do full file completion instead
        return 1
    end

    set -l nospace (math (math --scale 0 $directive / $shellCompDirectiveNoSpace) % 2)
    set -l nofiles (math (math --scale 0 $directive / $shellCompDirectiveNoFileComp) % 2)

    __${n9}_debug "nospace: $nospace, nofiles: $nofiles"

    # If we want to prevent a space, or if file completion is NOT disabled,
    # we need to count the number of valid completions.
    # To do so, we will filter on prefix as the completions we have received
    # may not already be filtered so as to allow fish to match on different
    # criteria than the prefix.
    if test $nospace -ne 0; or test $nofiles -eq 0
        set -l prefix (commandline -t | string escape --style=regex)
        __${n9}_debug "prefix: $prefix"

        set -l completions (string match -r -- "^$prefix.*" $__${n9}_comp_results)
        set --global __${n9}_comp_results $completions
        __${n9}_debug "Filtered completions are: $__${n9}_comp_results"

        # Important not to quote the variable for count to work
        set -l numComps (count $__${n9}_comp_results)
        __${n9}_debug "numComps: $numComps"

        if test $numComps -eq 1; and test $nospace -ne 0
            # We must first split on \\t to get rid of the descriptions to be
            # able to check what the actual completion will be.
            # We don't need descriptions anyway since there is only a single
            # real completion which the shell will expand immediately.
            set -l split (string split --max 1 "\\t" $__${n9}_comp_results[1])

            # Fish won't add a space if the completion ends with any
            # of the following characters: @=/:.,
            set -l lastChar (string sub -s -1 -- $split)
            if not string match -r -q "[@=/:.,]" -- "$lastChar"
                # In other cases, to support the "nospace" directive we trick the shell
                # by outputting an extra, longer completion.
                __${n9}_debug "Adding second completion to perform nospace directive"
                set --global __${n9}_comp_results $split[1] $split[1].
                __${n9}_debug "Completions are now: $__${n9}_comp_results"
            end
        end

        if test $numComps -eq 0; and test $nofiles -eq 0
            # To be consistent with bash and zsh, we only trigger file
            # completion when there are no other completions
            __${n9}_debug "Requesting file completion"
            return 1
        end
    end

    return 0
end

# Since Fish completions are only loaded once the user triggers them, we trigger them ourselves
# so we can properly delete any completions provided by another script.
# Only do this if the program can be found, or else fish may print some errors; besides,
# the existing completions will only be loaded if the program can be found.
if type -q "${e10}"
    # The space after the program name is essential to trigger completion for the program
    # and not completion of the program name itself.
    # Also, we use '> /dev/null 2>&1' since '&>' is not supported in older versions of fish.
    complete --do-complete "${e10} " > /dev/null 2>&1
end

# Remove any pre-existing completions for the program since we will be handling all of them.
complete -c ${e10} -e

# This will get called after the two calls below and clear the cached result
complete -c ${e10} -n '__${n9}_clear_perform_completion_once_result'
# The call to __${n9}_prepare_completions will setup __${n9}_comp_results
# which provides the program's completion choices.
# If this doesn't require order preservation, we don't use the -k flag
complete -c ${e10} -n 'not __${n9}_requires_order_preservation && __${n9}_prepare_completions' -f -a '$__${n9}_comp_results'
# Otherwise we use the -k flag
complete -k -c ${e10} -n '__${n9}_requires_order_preservation && __${n9}_prepare_completions' -f -a '$__${n9}_comp_results'
`;
}
function i2(e10, t13) {
  let n9 = e10.replace(/[-:]/g, `_`);
  return `# powershell completion for ${e10} -*- shell-script -*-

  [Console]::OutputEncoding = [System.Text.Encoding]::UTF8
    function __${e10}_debug {
        if ($env:BASH_COMP_DEBUG_FILE) {
            "$args" | Out-File -Append -FilePath "$env:BASH_COMP_DEBUG_FILE"
        }
    }

    filter __${e10}_escapeStringWithSpecialChars {
        $_ -replace '\\s|#|@|\\$|;|,|''|\\{|\\}|\\(|\\)|"|\\||<|>|&','\`$&'
    }

[scriptblock]$__${n9}CompleterBlock = {
    param(
            $WordToComplete,
            $CommandAst,
            $CursorPosition
        )

    # Get the current command line and convert into a string
    $Command = $CommandAst.CommandElements
    $Command = "$Command"

    __${e10}_debug ""
    __${e10}_debug "========= starting completion logic =========="
    __${e10}_debug "WordToComplete: $WordToComplete Command: $Command CursorPosition: $CursorPosition"

    # The user could have moved the cursor backwards on the command-line.
    # We need to trigger completion from the $CursorPosition location, so we need
    # to truncate the command-line ($Command) up to the $CursorPosition location.
    # Make sure the $Command is longer then the $CursorPosition before we truncate.
    # This happens because the $Command does not include the last space.
    if ($Command.Length -gt $CursorPosition) {
        $Command = $Command.Substring(0, $CursorPosition)
    }
    __${e10}_debug "Truncated command: $Command"

    $ShellCompDirectiveError=${a2.ShellCompDirectiveError}
    $ShellCompDirectiveNoSpace=${a2.ShellCompDirectiveNoSpace}
    $ShellCompDirectiveNoFileComp=${a2.ShellCompDirectiveNoFileComp}
    $ShellCompDirectiveFilterFileExt=${a2.ShellCompDirectiveFilterFileExt}
    $ShellCompDirectiveFilterDirs=${a2.ShellCompDirectiveFilterDirs}
    $ShellCompDirectiveKeepOrder=${a2.ShellCompDirectiveKeepOrder}

    # Prepare the command to request completions for the program.
    # Split the command at the first space to separate the program and arguments.
    $Program, $Arguments = $Command.Split(" ", 2)

    $QuotedArgs = ($Arguments -split ' ' | ForEach-Object { "'" + ($_ -replace "'", "''") + "'" }) -join ' '
    __${e10}_debug "QuotedArgs: $QuotedArgs"

    $RequestComp = "& ${t13} complete '--' $QuotedArgs"
    __${e10}_debug "RequestComp: $RequestComp"

    # we cannot use $WordToComplete because it
    # has the wrong values if the cursor was moved
    # so use the last argument
    if ($WordToComplete -ne "" ) {
        $WordToComplete = $Arguments.Split(" ")[-1]
    }
    __${e10}_debug "New WordToComplete: $WordToComplete"


    # Check for flag with equal sign
    $IsEqualFlag = ($WordToComplete -Like "--*=*" )
    if ( $IsEqualFlag ) {
        __${e10}_debug "Completing equal sign flag"
        # Remove the flag part
        $Flag, $WordToComplete = $WordToComplete.Split("=", 2)
    }

    if ( $WordToComplete -eq "" -And ( -Not $IsEqualFlag )) {
        # If the last parameter is complete (there is a space following it)
        # We add an extra empty parameter so we can indicate this to the go method.
        __${e10}_debug "Adding extra empty parameter"
        # PowerShell 7.2+ changed the way how the arguments are passed to executables,
        # so for pre-7.2 or when Legacy argument passing is enabled we need to use
        if ($PSVersionTable.PsVersion -lt [version]'7.2.0' -or
            ($PSVersionTable.PsVersion -lt [version]'7.3.0' -and -not [ExperimentalFeature]::IsEnabled("PSNativeCommandArgumentPassing")) -or
            (($PSVersionTable.PsVersion -ge [version]'7.3.0' -or [ExperimentalFeature]::IsEnabled("PSNativeCommandArgumentPassing")) -and
              $PSNativeCommandArgumentPassing -eq 'Legacy')) {
             $RequestComp="$RequestComp" + ' \`"\`"'
        } else {
             $RequestComp = "$RequestComp" + ' ""'
        }
    }

    __${e10}_debug "Calling $RequestComp"
    # First disable ActiveHelp which is not supported for Powershell
    $env:ActiveHelp = 0

    # call the command store the output in $out and redirect stderr and stdout to null
    # $Out is an array contains each line per element
    Invoke-Expression -OutVariable out "$RequestComp" 2>&1 | Out-Null

    # get directive from last line
    [int]$Directive = $Out[-1].TrimStart(':')
    if ($Directive -eq "") {
        # There is no directive specified
        $Directive = 0
    }
    __${e10}_debug "The completion directive is: $Directive"

    # remove directive (last element) from out
    $Out = $Out | Where-Object { $_ -ne $Out[-1] }
    __${e10}_debug "The completions are: $Out"

    if (($Directive -band $ShellCompDirectiveError) -ne 0 ) {
        # Error code.  No completion.
        __${e10}_debug "Received error from custom completion go code"
        return
    }

    $Longest = 0
    [Array]$Values = $Out | ForEach-Object {
        # Split the output in name and description
        $Name, $Description = $_.Split("\`t", 2)
        __${e10}_debug "Name: $Name Description: $Description"

        # Look for the longest completion so that we can format things nicely
        if ($Longest -lt $Name.Length) {
            $Longest = $Name.Length
        }

        # Set the description to a one space string if there is none set.
        # This is needed because the CompletionResult does not accept an empty string as argument
        if (-Not $Description) {
            $Description = " "
        }
        @{ Name = "$Name"; Description = "$Description" }
    }


    $Space = " "
    if (($Directive -band $ShellCompDirectiveNoSpace) -ne 0 ) {
        # remove the space here
        __${e10}_debug "ShellCompDirectiveNoSpace is called"
        $Space = ""
    }

    if ((($Directive -band $ShellCompDirectiveFilterFileExt) -ne 0 ) -or
       (($Directive -band $ShellCompDirectiveFilterDirs) -ne 0 ))  {
        __${e10}_debug "ShellCompDirectiveFilterFileExt ShellCompDirectiveFilterDirs are not supported"

        # return here to prevent the completion of the extensions
        return
    }

    $Values = $Values | Where-Object {
        # filter the result
        $_.Name -like "$WordToComplete*"

        # Join the flag back if we have an equal sign flag
        if ( $IsEqualFlag ) {
            __${e10}_debug "Join the equal sign flag back to the completion value"
            $_.Name = $Flag + "=" + $_.Name
        }
    }

    # we sort the values in ascending order by name if keep order isn't passed
    if (($Directive -band $ShellCompDirectiveKeepOrder) -eq 0 ) {
        $Values = $Values | Sort-Object -Property Name
    }

    if (($Directive -band $ShellCompDirectiveNoFileComp) -ne 0 ) {
        __${e10}_debug "ShellCompDirectiveNoFileComp is called"

        if ($Values.Length -eq 0) {
            # Just print an empty string here so the
            # shell does not start to complete paths.
            # We cannot use CompletionResult here because
            # it does not accept an empty string as argument.
            ""
            return
        }
    }

    # Get the current mode
    $Mode = (Get-PSReadLineKeyHandler | Where-Object { $_.Key -eq "Tab" }).Function
    __${e10}_debug "Mode: $Mode"

    $Values | ForEach-Object {

        # store temporary because switch will overwrite $_
        $comp = $_

        # PowerShell supports three different completion modes
        # - TabCompleteNext (default windows style - on each key press the next option is displayed)
        # - Complete (works like bash)
        # - MenuComplete (works like zsh)
        # You set the mode with Set-PSReadLineKeyHandler -Key Tab -Function <mode>

        # CompletionResult Arguments:
        # 1) CompletionText text to be used as the auto completion result
        # 2) ListItemText   text to be displayed in the suggestion list
        # 3) ResultType     type of completion result
        # 4) ToolTip        text for the tooltip with details about the object

        switch ($Mode) {

            # bash like
            "Complete" {

                if ($Values.Length -eq 1) {
                    __${e10}_debug "Only one completion left"

                    # insert space after value
                    [System.Management.Automation.CompletionResult]::new($($comp.Name | __${e10}_escapeStringWithSpecialChars) + $Space, "$($comp.Name)", 'ParameterValue', "$($comp.Description)")

                } else {
                    # Add the proper number of spaces to align the descriptions
                    while($comp.Name.Length -lt $Longest) {
                        $comp.Name = $comp.Name + " "
                    }

                    # Check for empty description and only add parentheses if needed
                    if ($($comp.Description) -eq " " ) {
                        $Description = ""
                    } else {
                        $Description = "  ($($comp.Description))"
                    }

                    [System.Management.Automation.CompletionResult]::new("$($comp.Name)$Description", "$($comp.Name)$Description", 'ParameterValue', "$($comp.Description)")
                }
             }

            # zsh like
            "MenuComplete" {
                # insert space after value
                # MenuComplete will automatically show the ToolTip of
                # the highlighted value at the bottom of the suggestions.
                [System.Management.Automation.CompletionResult]::new($($comp.Name | __${e10}_escapeStringWithSpecialChars) + $Space, "$($comp.Name)", 'ParameterValue', "$($comp.Description)")
            }

            # TabCompleteNext and in case we get something unknown
            Default {
                # Like MenuComplete but we don't want to add a space here because
                # the user need to press space anyway to get the completion.
                # Description will not be shown because that's not possible with TabCompleteNext
                [System.Management.Automation.CompletionResult]::new($($comp.Name | __${e10}_escapeStringWithSpecialChars), "$($comp.Name)", 'ParameterValue', "$($comp.Description)")
            }
        }

    }
}

Register-ArgumentCompleter -CommandName '${e10}' -ScriptBlock $__${n9}CompleterBlock
`;
}
var a2, o2, s2, c3, l3, u2, f3;
var init_t_DYl0qC9V = __esm({
  "../../node_modules/.pnpm/@bomb.sh+tab@0.0.12_cac@6.7.14_citty@0.1.6/node_modules/@bomb.sh/tab/dist/t-DYl0qC9V.js"() {
    init_import_meta_url();
    __name(t2, "t");
    __name(n2, "n");
    __name(r3, "r");
    __name(i2, "i");
    a2 = { ShellCompDirectiveError: 1, ShellCompDirectiveNoSpace: 2, ShellCompDirectiveNoFileComp: 4, ShellCompDirectiveFilterFileExt: 8, ShellCompDirectiveFilterDirs: 16, ShellCompDirectiveKeepOrder: 32, shellCompDirectiveMaxValue: 64, ShellCompDirectiveDefault: 0 };
    o2 = class {
      static {
        __name(this, "o");
      }
      name;
      variadic;
      command;
      handler;
      constructor(e10, t13, n9, r10 = false) {
        this.command = e10, this.name = t13, this.handler = n9, this.variadic = r10;
      }
    };
    s2 = class {
      static {
        __name(this, "s");
      }
      value;
      description;
      command;
      handler;
      alias;
      isBoolean;
      constructor(e10, t13, n9, r10, i7, a7) {
        this.command = e10, this.value = t13, this.description = n9, this.handler = r10, this.alias = i7, this.isBoolean = a7;
      }
    };
    c3 = class {
      static {
        __name(this, "c");
      }
      value;
      description;
      options = /* @__PURE__ */ new Map();
      arguments = /* @__PURE__ */ new Map();
      parent;
      constructor(e10, t13) {
        this.value = e10, this.description = t13;
      }
      option(e10, t13, n9, r10) {
        let i7, a7, o7;
        typeof n9 == `function` ? (i7 = n9, a7 = r10, o7 = false) : typeof n9 == `string` ? (i7 = void 0, a7 = n9, o7 = true) : (i7 = void 0, a7 = void 0, o7 = true);
        let c8 = new s2(this, e10, t13, i7, a7, o7);
        return this.options.set(e10, c8), this;
      }
      argument(e10, t13, n9 = false) {
        let r10 = new o2(this, e10, t13, n9);
        return this.arguments.set(e10, r10), this;
      }
    };
    l3 = class extends c3 {
      static {
        __name(this, "l");
      }
      commands = /* @__PURE__ */ new Map();
      completions = [];
      directive = a2.ShellCompDirectiveDefault;
      constructor() {
        super(``, ``);
      }
      command(e10, t13) {
        let n9 = new c3(e10, t13);
        return this.commands.set(e10, n9), n9;
      }
      stripOptions(e10) {
        let t13 = [], n9 = 0;
        for (; n9 < e10.length; ) {
          let r10 = e10[n9];
          if (r10.startsWith(`-`)) {
            n9++;
            let t14 = false, i7 = this.findOption(this, r10);
            if (i7) t14 = i7.isBoolean ?? false;
            else for (let [, e11] of this.commands) {
              let n10 = this.findOption(e11, r10);
              if (n10) {
                t14 = n10.isBoolean ?? false;
                break;
              }
            }
            !t14 && n9 < e10.length && !e10[n9].startsWith(`-`) && n9++;
          } else t13.push(r10), n9++;
        }
        return t13;
      }
      matchCommand(e10) {
        e10 = this.stripOptions(e10);
        let t13 = [], n9 = [], r10 = null;
        for (let i7 = 0; i7 < e10.length; i7++) {
          let a7 = e10[i7];
          t13.push(a7);
          let o7 = this.commands.get(t13.join(` `));
          if (o7) r10 = o7;
          else {
            n9 = e10.slice(i7, e10.length);
            break;
          }
        }
        return [r10 || this, n9];
      }
      shouldCompleteFlags(e10, t13) {
        if (t13.startsWith(`-`)) return true;
        if (e10?.startsWith(`-`)) {
          let t14 = this.findOption(this, e10);
          if (!t14) {
            for (let [, n9] of this.commands) if (t14 = this.findOption(n9, e10), t14) break;
          }
          return !(t14 && t14.isBoolean);
        }
        return false;
      }
      shouldCompleteCommands(e10) {
        return !e10.startsWith(`-`);
      }
      handleFlagCompletion(e10, t13, n9, r10) {
        let i7;
        if (n9.includes(`=`)) {
          let [e11] = n9.split(`=`);
          i7 = e11;
        } else if (r10?.startsWith(`-`)) {
          let t14 = this.findOption(e10, r10);
          t14 && !t14.isBoolean && (i7 = r10);
        }
        if (i7) {
          let t14 = this.findOption(e10, i7);
          if (t14?.handler) {
            let n10 = [];
            t14.handler.call(t14, (e11, t15) => n10.push({ value: e11, description: t15 }), e10.options), this.completions = n10;
          }
          return;
        }
        if (n9.startsWith(`-`)) {
          let t14 = n9.startsWith(`-`) && !n9.startsWith(`--`), r11 = n9.replace(/^-+/, ``);
          for (let [i8, a7] of e10.options) t14 && a7.alias && `-${a7.alias}`.startsWith(n9) ? this.completions.push({ value: `-${a7.alias}`, description: a7.description }) : !t14 && i8.startsWith(r11) && this.completions.push({ value: `--${i8}`, description: a7.description });
        }
      }
      findOption(e10, t13) {
        let n9 = e10.options.get(t13);
        if (n9 || (n9 = e10.options.get(t13.replace(/^-+/, ``)), n9)) return n9;
        for (let [n10, r10] of e10.options) if (r10.alias && `-${r10.alias}` === t13) return r10;
      }
      handleCommandCompletion(e10, t13) {
        let n9 = this.stripOptions(e10);
        for (let [e11, r10] of this.commands) {
          if (e11 === ``) continue;
          let i7 = e11.split(` `);
          i7.slice(0, n9.length).every((e12, t14) => e12 === n9[t14]) && i7[n9.length]?.startsWith(t13) && this.completions.push({ value: i7[n9.length], description: r10.description });
        }
      }
      handlePositionalCompletion(e10, t13) {
        let n9 = e10.value.split(` `).length, r10 = Math.max(0, t13.length - n9), i7 = Array.from(e10.arguments.entries());
        if (i7.length > 0) {
          let t14;
          if (r10 < i7.length) {
            let [e11, n10] = i7[r10];
            t14 = n10;
          } else {
            let e11 = i7[i7.length - 1][1];
            e11.variadic && (t14 = e11);
          }
          if (t14 && t14.handler && typeof t14.handler == `function`) {
            let n10 = [];
            t14.handler.call(t14, (e11, t15) => n10.push({ value: e11, description: t15 }), e10.options), this.completions.push(...n10);
          }
        }
      }
      complete(e10) {
        this.directive = a2.ShellCompDirectiveNoFileComp;
        let t13 = /* @__PURE__ */ new Set();
        this.completions.filter((e11) => t13.has(e11.value) ? false : (t13.add(e11.value), true)).filter((t14) => {
          if (e10.includes(`=`)) {
            let [, n9] = e10.split(`=`);
            return t14.value.startsWith(n9);
          }
          return t14.value.startsWith(e10);
        }).forEach((e11) => console.log(`${e11.value}	${e11.description ?? ``}`)), console.log(`:${this.directive}`);
      }
      parse(e10) {
        this.completions = [];
        let t13 = e10[e10.length - 1] === ``;
        t13 && e10.pop();
        let n9 = e10[e10.length - 1] || ``, r10 = e10.slice(0, -1);
        t13 && (n9 !== `` && r10.push(n9), n9 = ``);
        let [i7] = this.matchCommand(r10), a7 = r10[r10.length - 1];
        if (this.shouldCompleteFlags(a7, n9)) this.handleFlagCompletion(i7, r10, n9, a7);
        else {
          if (a7?.startsWith(`-`) && n9 === `` && t13) {
            let e11 = this.findOption(this, a7);
            if (!e11) {
              for (let [, t14] of this.commands) if (e11 = this.findOption(t14, a7), e11) break;
            }
            if (e11 && e11.isBoolean) {
              this.complete(n9);
              return;
            }
          }
          this.shouldCompleteCommands(n9) && this.handleCommandCompletion(r10, n9), i7 && i7.arguments.size > 0 && this.handlePositionalCompletion(i7, r10);
        }
        this.complete(n9);
      }
      setup(a7, o7, s7) {
        switch (assert53__default.default(s7 === `zsh` || s7 === `bash` || s7 === `fish` || s7 === `powershell`, `Unsupported shell`), s7) {
          case `zsh`: {
            let e10 = t2(a7, o7);
            console.log(e10);
            break;
          }
          case `bash`: {
            let e10 = n2(a7, o7);
            console.log(e10);
            break;
          }
          case `fish`: {
            let e10 = r3(a7, o7);
            console.log(e10);
            break;
          }
          case `powershell`: {
            let e10 = i2(a7, o7);
            console.log(e10);
            break;
          }
        }
      }
    };
    u2 = new l3();
    f3 = u2;
  }
});

// ../../node_modules/.pnpm/@bomb.sh+tab@0.0.12_cac@6.7.14_citty@0.1.6/node_modules/@bomb.sh/tab/dist/t.js
var init_t = __esm({
  "../../node_modules/.pnpm/@bomb.sh+tab@0.0.12_cac@6.7.14_citty@0.1.6/node_modules/@bomb.sh/tab/dist/t.js"() {
    init_import_meta_url();
    init_t_DYl0qC9V();
  }
});

// src/experimental-commands-api.ts
function experimental_getWranglerCommands() {
  const { registry, globalFlags } = createCLIParser([]);
  return { registry: registry.getDefinitionTreeRoot(), globalFlags };
}
var init_experimental_commands_api = __esm({
  "src/experimental-commands-api.ts"() {
    init_import_meta_url();
    init_src3();
    __name(experimental_getWranglerCommands, "experimental_getWranglerCommands");
  }
});

// src/complete.ts
function setupCompletions() {
  const { registry, globalFlags } = experimental_getWranglerCommands();
  for (const [flagName, flagDef] of Object.entries(globalFlags)) {
    if ("hidden" in flagDef && flagDef.hidden) {
      continue;
    }
    const description = flagDef.describe || "";
    f3.option(flagName, description);
    if ("alias" in flagDef && flagDef.alias) {
      const aliases2 = Array.isArray(flagDef.alias) ? flagDef.alias : [flagDef.alias];
      for (const alias of aliases2) {
        f3.option(alias, `Alias for --${flagName}`);
      }
    }
  }
  function addCommandsFromTree(node2, parentPath = []) {
    for (const [name2, childNode] of node2.subtree.entries()) {
      const commandPath = [...parentPath, name2];
      const commandName = commandPath.join(" ");
      if (childNode.definition) {
        const def = childNode.definition;
        let description = "";
        if (def.metadata?.description) {
          description = def.metadata.description;
        }
        if (def.metadata?.status && def.metadata.status !== "stable" && !def.metadata.hidden) {
          const statusLabels = {
            experimental: "[experimental]",
            alpha: "[alpha]",
            "private beta": "[private beta]",
            "open beta": "[open beta]"
          };
          const statusLabel = statusLabels[def.metadata.status];
          if (statusLabel) {
            description = `${description} ${statusLabel}`;
          }
        }
        if (!def.metadata?.hidden) {
          const cmd = f3.command(commandName, description);
          if (def.type === "command" && "args" in def) {
            const args = def.args || {};
            for (const [argName, argDef] of Object.entries(args)) {
              if (argDef.hidden) {
                continue;
              }
              const argDescription = argDef.describe || "";
              if (argDef.choices && Array.isArray(argDef.choices)) {
                cmd.option(argName, argDescription, (complete) => {
                  for (const choice of argDef.choices) {
                    complete(choice, choice);
                  }
                });
              } else {
                cmd.option(argName, argDescription);
              }
              if (argDef.alias) {
                const aliases2 = Array.isArray(argDef.alias) ? argDef.alias : [argDef.alias];
                for (const alias of aliases2) {
                  cmd.option(alias, `Alias for --${argName}`);
                }
              }
            }
          }
        }
      }
      if (childNode.subtree.size > 0) {
        addCommandsFromTree(childNode, commandPath);
      }
    }
  }
  __name(addCommandsFromTree, "addCommandsFromTree");
  addCommandsFromTree(registry);
}
var completionsCommand;
var init_complete = __esm({
  "src/complete.ts"() {
    init_import_meta_url();
    init_t();
    init_dist();
    init_create_command();
    init_experimental_commands_api();
    __name(setupCompletions, "setupCompletions");
    completionsCommand = createCommand({
      metadata: {
        description: "\u2328\uFE0F Generate and handle shell completions",
        owner: "Workers: Authoring and Testing",
        status: "stable",
        examples: [
          {
            description: "Generate bash completion script",
            command: "wrangler complete bash"
          },
          {
            description: "Generate fish completion script",
            command: "wrangler complete fish"
          },
          {
            description: "Generate powershell completion script",
            command: "wrangler complete powershell"
          },
          {
            description: "Generate zsh completion script",
            command: "wrangler complete zsh"
          }
        ]
      },
      behaviour: {
        printBanner: false,
        provideConfig: false
      },
      positionalArgs: ["shell"],
      args: {
        shell: {
          choices: ["bash", "fish", "powershell", "zsh"],
          describe: "Shell type to generate completions for",
          type: "string"
        }
      },
      handler(args) {
        const rawArgs = args._ ?? [];
        const completionArgs = rawArgs.slice(rawArgs[0] === "complete" ? 1 : 0);
        if (completionArgs.length > 0) {
          setupCompletions();
          f3.parse(completionArgs);
          return;
        }
        if (!args.shell) {
          throw new CommandLineArgsError("Missing required argument: shell");
        }
        setupCompletions();
        f3.setup("wrangler", "wrangler", args.shell);
      }
    });
  }
});

// ../../node_modules/.pnpm/dotenv@16.3.1/node_modules/dotenv/package.json
var require_package = __commonJS({
  "../../node_modules/.pnpm/dotenv@16.3.1/node_modules/dotenv/package.json"(exports, module2) {
    module2.exports = {
      name: "dotenv",
      version: "16.3.1",
      description: "Loads environment variables from .env file",
      main: "lib/main.js",
      types: "lib/main.d.ts",
      exports: {
        ".": {
          types: "./lib/main.d.ts",
          require: "./lib/main.js",
          default: "./lib/main.js"
        },
        "./config": "./config.js",
        "./config.js": "./config.js",
        "./lib/env-options": "./lib/env-options.js",
        "./lib/env-options.js": "./lib/env-options.js",
        "./lib/cli-options": "./lib/cli-options.js",
        "./lib/cli-options.js": "./lib/cli-options.js",
        "./package.json": "./package.json"
      },
      scripts: {
        "dts-check": "tsc --project tests/types/tsconfig.json",
        lint: "standard",
        "lint-readme": "standard-markdown",
        pretest: "npm run lint && npm run dts-check",
        test: "tap tests/*.js --100 -Rspec",
        prerelease: "npm test",
        release: "standard-version"
      },
      repository: {
        type: "git",
        url: "git://github.com/motdotla/dotenv.git"
      },
      funding: "https://github.com/motdotla/dotenv?sponsor=1",
      keywords: [
        "dotenv",
        "env",
        ".env",
        "environment",
        "variables",
        "config",
        "settings"
      ],
      readmeFilename: "README.md",
      license: "BSD-2-Clause",
      devDependencies: {
        "@definitelytyped/dtslint": "^0.0.133",
        "@types/node": "^18.11.3",
        decache: "^4.6.1",
        sinon: "^14.0.1",
        standard: "^17.0.0",
        "standard-markdown": "^7.1.0",
        "standard-version": "^9.5.0",
        tap: "^16.3.0",
        tar: "^6.1.11",
        typescript: "^4.8.4"
      },
      engines: {
        node: ">=12"
      },
      browser: {
        fs: false
      }
    };
  }
});

// ../../node_modules/.pnpm/dotenv@16.3.1/node_modules/dotenv/lib/main.js
var require_main = __commonJS({
  "../../node_modules/.pnpm/dotenv@16.3.1/node_modules/dotenv/lib/main.js"(exports, module2) {
    init_import_meta_url();
    var fs33 = __require("fs");
    var path84 = __require("path");
    var os13 = __require("os");
    var crypto9 = __require("crypto");
    var packageJson = require_package();
    var version5 = packageJson.version;
    var LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;
    function parse17(src) {
      const obj = {};
      let lines = src.toString();
      lines = lines.replace(/\r\n?/mg, "\n");
      let match3;
      while ((match3 = LINE.exec(lines)) != null) {
        const key = match3[1];
        let value = match3[2] || "";
        value = value.trim();
        const maybeQuote = value[0];
        value = value.replace(/^(['"`])([\s\S]*)\1$/mg, "$2");
        if (maybeQuote === '"') {
          value = value.replace(/\\n/g, "\n");
          value = value.replace(/\\r/g, "\r");
        }
        obj[key] = value;
      }
      return obj;
    }
    __name(parse17, "parse");
    function _parseVault(options) {
      const vaultPath = _vaultPath(options);
      const result = DotenvModule.configDotenv({ path: vaultPath });
      if (!result.parsed) {
        throw new Error(`MISSING_DATA: Cannot parse ${vaultPath} for an unknown reason`);
      }
      const keys = _dotenvKey(options).split(",");
      const length = keys.length;
      let decrypted;
      for (let i7 = 0; i7 < length; i7++) {
        try {
          const key = keys[i7].trim();
          const attrs = _instructions(result, key);
          decrypted = DotenvModule.decrypt(attrs.ciphertext, attrs.key);
          break;
        } catch (error2) {
          if (i7 + 1 >= length) {
            throw error2;
          }
        }
      }
      return DotenvModule.parse(decrypted);
    }
    __name(_parseVault, "_parseVault");
    function _log2(message) {
      console.log(`[dotenv@${version5}][INFO] ${message}`);
    }
    __name(_log2, "_log");
    function _warn(message) {
      console.log(`[dotenv@${version5}][WARN] ${message}`);
    }
    __name(_warn, "_warn");
    function _debug(message) {
      console.log(`[dotenv@${version5}][DEBUG] ${message}`);
    }
    __name(_debug, "_debug");
    function _dotenvKey(options) {
      if (options && options.DOTENV_KEY && options.DOTENV_KEY.length > 0) {
        return options.DOTENV_KEY;
      }
      if (process.env.DOTENV_KEY && process.env.DOTENV_KEY.length > 0) {
        return process.env.DOTENV_KEY;
      }
      return "";
    }
    __name(_dotenvKey, "_dotenvKey");
    function _instructions(result, dotenvKey) {
      let uri;
      try {
        uri = new URL(dotenvKey);
      } catch (error2) {
        if (error2.code === "ERR_INVALID_URL") {
          throw new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenv.org/vault/.env.vault?environment=development");
        }
        throw error2;
      }
      const key = uri.password;
      if (!key) {
        throw new Error("INVALID_DOTENV_KEY: Missing key part");
      }
      const environment = uri.searchParams.get("environment");
      if (!environment) {
        throw new Error("INVALID_DOTENV_KEY: Missing environment part");
      }
      const environmentKey = `DOTENV_VAULT_${environment.toUpperCase()}`;
      const ciphertext = result.parsed[environmentKey];
      if (!ciphertext) {
        throw new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${environmentKey} in your .env.vault file.`);
      }
      return { ciphertext, key };
    }
    __name(_instructions, "_instructions");
    function _vaultPath(options) {
      let dotenvPath = path84.resolve(process.cwd(), ".env");
      if (options && options.path && options.path.length > 0) {
        dotenvPath = options.path;
      }
      return dotenvPath.endsWith(".vault") ? dotenvPath : `${dotenvPath}.vault`;
    }
    __name(_vaultPath, "_vaultPath");
    function _resolveHome(envPath) {
      return envPath[0] === "~" ? path84.join(os13.homedir(), envPath.slice(1)) : envPath;
    }
    __name(_resolveHome, "_resolveHome");
    function _configVault(options) {
      _log2("Loading env from encrypted .env.vault");
      const parsed = DotenvModule._parseVault(options);
      let processEnv = process.env;
      if (options && options.processEnv != null) {
        processEnv = options.processEnv;
      }
      DotenvModule.populate(processEnv, parsed, options);
      return { parsed };
    }
    __name(_configVault, "_configVault");
    function configDotenv(options) {
      let dotenvPath = path84.resolve(process.cwd(), ".env");
      let encoding = "utf8";
      const debug2 = Boolean(options && options.debug);
      if (options) {
        if (options.path != null) {
          dotenvPath = _resolveHome(options.path);
        }
        if (options.encoding != null) {
          encoding = options.encoding;
        }
      }
      try {
        const parsed = DotenvModule.parse(fs33.readFileSync(dotenvPath, { encoding }));
        let processEnv = process.env;
        if (options && options.processEnv != null) {
          processEnv = options.processEnv;
        }
        DotenvModule.populate(processEnv, parsed, options);
        return { parsed };
      } catch (e10) {
        if (debug2) {
          _debug(`Failed to load ${dotenvPath} ${e10.message}`);
        }
        return { error: e10 };
      }
    }
    __name(configDotenv, "configDotenv");
    function config(options) {
      const vaultPath = _vaultPath(options);
      if (_dotenvKey(options).length === 0) {
        return DotenvModule.configDotenv(options);
      }
      if (!fs33.existsSync(vaultPath)) {
        _warn(`You set DOTENV_KEY but you are missing a .env.vault file at ${vaultPath}. Did you forget to build it?`);
        return DotenvModule.configDotenv(options);
      }
      return DotenvModule._configVault(options);
    }
    __name(config, "config");
    function decrypt(encrypted, keyStr) {
      const key = Buffer.from(keyStr.slice(-64), "hex");
      let ciphertext = Buffer.from(encrypted, "base64");
      const nonce = ciphertext.slice(0, 12);
      const authTag = ciphertext.slice(-16);
      ciphertext = ciphertext.slice(12, -16);
      try {
        const aesgcm = crypto9.createDecipheriv("aes-256-gcm", key, nonce);
        aesgcm.setAuthTag(authTag);
        return `${aesgcm.update(ciphertext)}${aesgcm.final()}`;
      } catch (error2) {
        const isRange = error2 instanceof RangeError;
        const invalidKeyLength = error2.message === "Invalid key length";
        const decryptionFailed = error2.message === "Unsupported state or unable to authenticate data";
        if (isRange || invalidKeyLength) {
          const msg = "INVALID_DOTENV_KEY: It must be 64 characters long (or more)";
          throw new Error(msg);
        } else if (decryptionFailed) {
          const msg = "DECRYPTION_FAILED: Please check your DOTENV_KEY";
          throw new Error(msg);
        } else {
          console.error("Error: ", error2.code);
          console.error("Error: ", error2.message);
          throw error2;
        }
      }
    }
    __name(decrypt, "decrypt");
    function populate(processEnv, parsed, options = {}) {
      const debug2 = Boolean(options && options.debug);
      const override = Boolean(options && options.override);
      if (typeof parsed !== "object") {
        throw new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");
      }
      for (const key of Object.keys(parsed)) {
        if (Object.prototype.hasOwnProperty.call(processEnv, key)) {
          if (override === true) {
            processEnv[key] = parsed[key];
          }
          if (debug2) {
            if (override === true) {
              _debug(`"${key}" is already defined and WAS overwritten`);
            } else {
              _debug(`"${key}" is already defined and was NOT overwritten`);
            }
          }
        } else {
          processEnv[key] = parsed[key];
        }
      }
    }
    __name(populate, "populate");
    var DotenvModule = {
      configDotenv,
      _configVault,
      _parseVault,
      config,
      decrypt,
      parse: parse17,
      populate
    };
    module2.exports.configDotenv = DotenvModule.configDotenv;
    module2.exports._configVault = DotenvModule._configVault;
    module2.exports._parseVault = DotenvModule._parseVault;
    module2.exports.config = DotenvModule.config;
    module2.exports.decrypt = DotenvModule.decrypt;
    module2.exports.parse = DotenvModule.parse;
    module2.exports.populate = DotenvModule.populate;
    module2.exports = DotenvModule;
  }
});

// ../../node_modules/.pnpm/dotenv-expand@12.0.2/node_modules/dotenv-expand/lib/main.js
var require_main2 = __commonJS({
  "../../node_modules/.pnpm/dotenv-expand@12.0.2/node_modules/dotenv-expand/lib/main.js"(exports, module2) {
    init_import_meta_url();
    function _resolveEscapeSequences(value) {
      return value.replace(/\\\$/g, "$");
    }
    __name(_resolveEscapeSequences, "_resolveEscapeSequences");
    function expandValue(value, processEnv, runningParsed) {
      const env6 = { ...runningParsed, ...processEnv };
      const regex2 = /(?<!\\)\${([^{}]+)}|(?<!\\)\$([A-Za-z_][A-Za-z0-9_]*)/g;
      let result = value;
      let match3;
      const seen = /* @__PURE__ */ new Set();
      while ((match3 = regex2.exec(result)) !== null) {
        seen.add(result);
        const [template, bracedExpression, unbracedExpression] = match3;
        const expression = bracedExpression || unbracedExpression;
        const opRegex = /(:\+|\+|:-|-)/;
        const opMatch = expression.match(opRegex);
        const splitter = opMatch ? opMatch[0] : null;
        const r10 = expression.split(splitter);
        let defaultValue;
        let value2;
        const key = r10.shift();
        if ([":+", "+"].includes(splitter)) {
          defaultValue = env6[key] ? r10.join(splitter) : "";
          value2 = null;
        } else {
          defaultValue = r10.join(splitter);
          value2 = env6[key];
        }
        if (value2) {
          if (seen.has(value2)) {
            result = result.replace(template, defaultValue);
          } else {
            result = result.replace(template, value2);
          }
        } else {
          result = result.replace(template, defaultValue);
        }
        if (result === runningParsed[key]) {
          break;
        }
        regex2.lastIndex = 0;
      }
      return result;
    }
    __name(expandValue, "expandValue");
    function expand2(options) {
      const runningParsed = {};
      let processEnv = process.env;
      if (options && options.processEnv != null) {
        processEnv = options.processEnv;
      }
      for (const key in options.parsed) {
        let value = options.parsed[key];
        if (processEnv[key] && processEnv[key] !== value) {
          value = processEnv[key];
        } else {
          value = expandValue(value, processEnv, runningParsed);
        }
        options.parsed[key] = _resolveEscapeSequences(value);
        runningParsed[key] = _resolveEscapeSequences(value);
      }
      for (const processKey in options.parsed) {
        processEnv[processKey] = options.parsed[processKey];
      }
      return options;
    }
    __name(expand2, "expand");
    module2.exports.expand = expand2;
  }
});

// src/config/case-insensitive-env.ts
function caseInsensitiveEnv() {
  const tracked = /* @__PURE__ */ new Map();
  const targetObj = {};
  const canonical = /* @__PURE__ */ __name((property) => typeof property === "string" ? property.toLowerCase() : property, "canonical");
  return new Proxy(targetObj, {
    get(target, property, receiver) {
      const actualProperty = tracked.get(canonical(property));
      return actualProperty !== void 0 ? Reflect.get(target, actualProperty, receiver) : void 0;
    },
    set(target, property, value, receiver) {
      tracked.set(canonical(property), property);
      return Reflect.set(target, property, value, receiver);
    },
    has(target, property) {
      const actualProperty = tracked.get(canonical(property));
      return actualProperty !== void 0 ? Reflect.has(target, actualProperty) : false;
    },
    getOwnPropertyDescriptor(target, property) {
      const actualProperty = tracked.get(canonical(property));
      return actualProperty !== void 0 ? Reflect.getOwnPropertyDescriptor(target, actualProperty) : void 0;
    },
    defineProperty(target, property, descriptor) {
      tracked.set(canonical(property), property);
      return Reflect.defineProperty(target, property, descriptor);
    },
    deleteProperty(target, property) {
      tracked.delete(canonical(property));
      return Reflect.deleteProperty(target, property);
    }
  });
}
var init_case_insensitive_env = __esm({
  "src/config/case-insensitive-env.ts"() {
    init_import_meta_url();
    __name(caseInsensitiveEnv, "caseInsensitiveEnv");
  }
});
function getDefaultEnvFiles(env6) {
  const envFiles = [".env", ".env.local"];
  if (env6 !== void 0) {
    envFiles.push(`.env.${env6}`);
    envFiles.push(`.env.${env6}.local`);
  }
  return envFiles;
}
function loadDotEnv(envPaths, { includeProcessEnv, silent }) {
  const parsedEnv = isWindows3 ? caseInsensitiveEnv() : {};
  for (const envPath of envPaths) {
    const { error: error3, parsed } = import_dotenv.default.config({
      path: envPath,
      processEnv: parsedEnv,
      override: true
    });
    if (error3) {
      if ("code" in error3 && error3.code === "ENOENT") {
        logger.debug(
          `.env file not found at "${envPath}". Continuing... For more details, refer to https://developers.cloudflare.com/workers/wrangler/system-environment-variables/`
        );
      } else {
        logger.debug(`Failed to load .env file "${envPath}":`, error3);
      }
    } else if (parsed && !silent) {
      const relativePath = path3__namespace.default.relative(process.cwd(), envPath);
      logger.log(`Using secrets defined in ${relativePath}`);
    }
  }
  const expandedEnv = isWindows3 ? caseInsensitiveEnv() : {};
  if (includeProcessEnv) {
    Object.assign(expandedEnv, process.env);
    if (!silent) {
      logger.log("Using secrets defined in process.env");
    }
  }
  const { error: error2 } = import_dotenv_expand.default.expand({
    processEnv: expandedEnv,
    parsed: parsedEnv
  });
  if (error2) {
    logger.debug(`Failed to expand .env values:`, error2);
  }
  return expandedEnv;
}
var import_dotenv, import_dotenv_expand, isWindows3;
var init_dot_env = __esm({
  "src/config/dot-env.ts"() {
    init_import_meta_url();
    import_dotenv = __toESM(require_main());
    import_dotenv_expand = __toESM(require_main2());
    init_logger();
    init_case_insensitive_env();
    isWindows3 = process.platform === "win32";
    __name(getDefaultEnvFiles, "getDefaultEnvFiles");
    __name(loadDotEnv, "loadDotEnv");
  }
});

// src/core/index.ts
var init_core3 = __esm({
  "src/core/index.ts"() {
    init_import_meta_url();
    init_helpers3();
  }
});

// src/core/CommandHandledError.ts
var CommandHandledError;
var init_CommandHandledError = __esm({
  "src/core/CommandHandledError.ts"() {
    init_import_meta_url();
    CommandHandledError = class {
      constructor(originalError) {
        this.originalError = originalError;
      }
      static {
        __name(this, "CommandHandledError");
      }
    };
  }
});

// ../workers-utils/src/config/environment.ts
var init_environment = __esm({
  "../workers-utils/src/config/environment.ts"() {
    init_import_meta_url();
  }
});
var init_config6 = __esm({
  "../workers-utils/src/config/config.ts"() {
    init_import_meta_url();
    ({
      /* COMPUTED_FIELDS */
      configPath: void 0,
      userConfigPath: void 0,
      topLevelName: void 0,
      definedEnvironments: void 0,
      targetEnvironment: void 0,
      /*====================================================*/
      /*      Fields supported by both Workers & Pages      */
      /*====================================================*/
      /* TOP-LEVEL ONLY FIELDS */
      pages_build_output_dir: void 0,
      send_metrics: void 0,
      dev: {
        ip: process.platform === "win32" ? "127.0.0.1" : "localhost",
        port: void 0,
        // the default of 8787 is set at runtime
        inspector_port: void 0,
        // the default of 9229 is set at runtime
        inspector_ip: void 0,
        // the default of 127.0.0.1 is set at runtime
        local_protocol: "http",
        upstream_protocol: "http",
        host: void 0,
        // Note this one is also workers only
        enable_containers: true,
        container_engine: void 0,
        generate_types: false
      },
      /** INHERITABLE ENVIRONMENT FIELDS **/
      name: void 0,
      compatibility_date: void 0,
      compatibility_flags: [],
      limits: void 0,
      placement: void 0,
      /** NON-INHERITABLE ENVIRONMENT FIELDS **/
      vars: {},
      durable_objects: { bindings: [] },
      kv_namespaces: [],
      queues: {
        producers: [],
        consumers: []
        // WORKERS SUPPORT ONLY!!
      },
      r2_buckets: [],
      d1_databases: [],
      vectorize: [],
      ai_search_namespaces: [],
      ai_search: [],
      hyperdrive: [],
      workflows: [],
      secrets_store_secrets: [],
      services: [],
      analytics_engine_datasets: [],
      ai: void 0,
      images: void 0,
      stream: void 0,
      media: void 0,
      version_metadata: void 0,
      unsafe_hello_world: [],
      flagship: [],
      ratelimits: [],
      worker_loaders: [],
      /*====================================================*/
      /*           Fields supported by Workers only         */
      /*====================================================*/
      /* TOP-LEVEL ONLY FIELDS */
      legacy_env: true,
      site: void 0,
      wasm_modules: void 0,
      text_blobs: void 0,
      data_blobs: void 0,
      keep_vars: void 0,
      alias: void 0,
      /** INHERITABLE ENVIRONMENT FIELDS **/
      account_id: void 0,
      main: void 0,
      find_additional_modules: void 0,
      preserve_file_names: void 0,
      base_dir: void 0,
      workers_dev: void 0,
      preview_urls: void 0,
      route: void 0,
      routes: void 0,
      tsconfig: void 0,
      jsx_factory: "React.createElement",
      jsx_fragment: "React.Fragment",
      migrations: [],
      triggers: {
        crons: void 0
      },
      rules: [],
      build: { command: void 0, watch_dir: "./src", cwd: void 0 },
      no_bundle: void 0,
      minify: void 0,
      keep_names: void 0,
      dispatch_namespaces: [],
      first_party_worker: void 0,
      logfwdr: { bindings: [] },
      logpush: void 0,
      upload_source_maps: void 0,
      assets: void 0,
      observability: { enabled: true },
      cache: void 0,
      /** The default here is undefined so that we can delegate to the CLOUDFLARE_COMPLIANCE_REGION environment variable. */
      compliance_region: void 0,
      python_modules: { exclude: ["**/*.pyc"] },
      previews: void 0,
      /** NON-INHERITABLE ENVIRONMENT FIELDS **/
      define: {},
      cloudchamber: {},
      containers: void 0,
      send_email: [],
      browser: void 0,
      unsafe: {},
      mtls_certificates: [],
      tail_consumers: void 0,
      streaming_tail_consumers: void 0,
      pipelines: [],
      vpc_services: [],
      vpc_networks: []
    });
  }
});

// ../../node_modules/.pnpm/jsonc-parser@3.2.0/node_modules/jsonc-parser/lib/esm/impl/scanner.js
function createScanner2(text, ignoreTrivia = false) {
  const len = text.length;
  let pos = 0, value = "", tokenOffset = 0, token = 16, lineNumber = 0, lineStartOffset = 0, tokenLineStartOffset = 0, prevTokenLineStartOffset = 0, scanError = 0;
  function scanHexDigits(count, exact) {
    let digits2 = 0;
    let value2 = 0;
    while (digits2 < count || !exact) {
      let ch2 = text.charCodeAt(pos);
      if (ch2 >= 48 && ch2 <= 57) {
        value2 = value2 * 16 + ch2 - 48;
      } else if (ch2 >= 65 && ch2 <= 70) {
        value2 = value2 * 16 + ch2 - 65 + 10;
      } else if (ch2 >= 97 && ch2 <= 102) {
        value2 = value2 * 16 + ch2 - 97 + 10;
      } else {
        break;
      }
      pos++;
      digits2++;
    }
    if (digits2 < count) {
      value2 = -1;
    }
    return value2;
  }
  __name(scanHexDigits, "scanHexDigits");
  function setPosition(newPosition) {
    pos = newPosition;
    value = "";
    tokenOffset = 0;
    token = 16;
    scanError = 0;
  }
  __name(setPosition, "setPosition");
  function scanNumber() {
    let start = pos;
    if (text.charCodeAt(pos) === 48) {
      pos++;
    } else {
      pos++;
      while (pos < text.length && isDigit2(text.charCodeAt(pos))) {
        pos++;
      }
    }
    if (pos < text.length && text.charCodeAt(pos) === 46) {
      pos++;
      if (pos < text.length && isDigit2(text.charCodeAt(pos))) {
        pos++;
        while (pos < text.length && isDigit2(text.charCodeAt(pos))) {
          pos++;
        }
      } else {
        scanError = 3;
        return text.substring(start, pos);
      }
    }
    let end = pos;
    if (pos < text.length && (text.charCodeAt(pos) === 69 || text.charCodeAt(pos) === 101)) {
      pos++;
      if (pos < text.length && text.charCodeAt(pos) === 43 || text.charCodeAt(pos) === 45) {
        pos++;
      }
      if (pos < text.length && isDigit2(text.charCodeAt(pos))) {
        pos++;
        while (pos < text.length && isDigit2(text.charCodeAt(pos))) {
          pos++;
        }
        end = pos;
      } else {
        scanError = 3;
      }
    }
    return text.substring(start, end);
  }
  __name(scanNumber, "scanNumber");
  function scanString() {
    let result = "", start = pos;
    while (true) {
      if (pos >= len) {
        result += text.substring(start, pos);
        scanError = 2;
        break;
      }
      const ch2 = text.charCodeAt(pos);
      if (ch2 === 34) {
        result += text.substring(start, pos);
        pos++;
        break;
      }
      if (ch2 === 92) {
        result += text.substring(start, pos);
        pos++;
        if (pos >= len) {
          scanError = 2;
          break;
        }
        const ch22 = text.charCodeAt(pos++);
        switch (ch22) {
          case 34:
            result += '"';
            break;
          case 92:
            result += "\\";
            break;
          case 47:
            result += "/";
            break;
          case 98:
            result += "\b";
            break;
          case 102:
            result += "\f";
            break;
          case 110:
            result += "\n";
            break;
          case 114:
            result += "\r";
            break;
          case 116:
            result += "	";
            break;
          case 117:
            const ch3 = scanHexDigits(4, true);
            if (ch3 >= 0) {
              result += String.fromCharCode(ch3);
            } else {
              scanError = 4;
            }
            break;
          default:
            scanError = 5;
        }
        start = pos;
        continue;
      }
      if (ch2 >= 0 && ch2 <= 31) {
        if (isLineBreak2(ch2)) {
          result += text.substring(start, pos);
          scanError = 2;
          break;
        } else {
          scanError = 6;
        }
      }
      pos++;
    }
    return result;
  }
  __name(scanString, "scanString");
  function scanNext() {
    value = "";
    scanError = 0;
    tokenOffset = pos;
    lineStartOffset = lineNumber;
    prevTokenLineStartOffset = tokenLineStartOffset;
    if (pos >= len) {
      tokenOffset = len;
      return token = 17;
    }
    let code = text.charCodeAt(pos);
    if (isWhiteSpace2(code)) {
      do {
        pos++;
        value += String.fromCharCode(code);
        code = text.charCodeAt(pos);
      } while (isWhiteSpace2(code));
      return token = 15;
    }
    if (isLineBreak2(code)) {
      pos++;
      value += String.fromCharCode(code);
      if (code === 13 && text.charCodeAt(pos) === 10) {
        pos++;
        value += "\n";
      }
      lineNumber++;
      tokenLineStartOffset = pos;
      return token = 14;
    }
    switch (code) {
      // tokens: []{}:,
      case 123:
        pos++;
        return token = 1;
      case 125:
        pos++;
        return token = 2;
      case 91:
        pos++;
        return token = 3;
      case 93:
        pos++;
        return token = 4;
      case 58:
        pos++;
        return token = 6;
      case 44:
        pos++;
        return token = 5;
      // strings
      case 34:
        pos++;
        value = scanString();
        return token = 10;
      // comments
      case 47:
        const start = pos - 1;
        if (text.charCodeAt(pos + 1) === 47) {
          pos += 2;
          while (pos < len) {
            if (isLineBreak2(text.charCodeAt(pos))) {
              break;
            }
            pos++;
          }
          value = text.substring(start, pos);
          return token = 12;
        }
        if (text.charCodeAt(pos + 1) === 42) {
          pos += 2;
          const safeLength = len - 1;
          let commentClosed = false;
          while (pos < safeLength) {
            const ch2 = text.charCodeAt(pos);
            if (ch2 === 42 && text.charCodeAt(pos + 1) === 47) {
              pos += 2;
              commentClosed = true;
              break;
            }
            pos++;
            if (isLineBreak2(ch2)) {
              if (ch2 === 13 && text.charCodeAt(pos) === 10) {
                pos++;
              }
              lineNumber++;
              tokenLineStartOffset = pos;
            }
          }
          if (!commentClosed) {
            pos++;
            scanError = 1;
          }
          value = text.substring(start, pos);
          return token = 13;
        }
        value += String.fromCharCode(code);
        pos++;
        return token = 16;
      // numbers
      case 45:
        value += String.fromCharCode(code);
        pos++;
        if (pos === len || !isDigit2(text.charCodeAt(pos))) {
          return token = 16;
        }
      // found a minus, followed by a number so
      // we fall through to proceed with scanning
      // numbers
      case 48:
      case 49:
      case 50:
      case 51:
      case 52:
      case 53:
      case 54:
      case 55:
      case 56:
      case 57:
        value += scanNumber();
        return token = 11;
      // literals and unknown symbols
      default:
        while (pos < len && isUnknownContentCharacter(code)) {
          pos++;
          code = text.charCodeAt(pos);
        }
        if (tokenOffset !== pos) {
          value = text.substring(tokenOffset, pos);
          switch (value) {
            case "true":
              return token = 8;
            case "false":
              return token = 9;
            case "null":
              return token = 7;
          }
          return token = 16;
        }
        value += String.fromCharCode(code);
        pos++;
        return token = 16;
    }
  }
  __name(scanNext, "scanNext");
  function isUnknownContentCharacter(code) {
    if (isWhiteSpace2(code) || isLineBreak2(code)) {
      return false;
    }
    switch (code) {
      case 125:
      case 93:
      case 123:
      case 91:
      case 34:
      case 58:
      case 44:
      case 47:
        return false;
    }
    return true;
  }
  __name(isUnknownContentCharacter, "isUnknownContentCharacter");
  function scanNextNonTrivia() {
    let result;
    do {
      result = scanNext();
    } while (result >= 12 && result <= 15);
    return result;
  }
  __name(scanNextNonTrivia, "scanNextNonTrivia");
  return {
    setPosition,
    getPosition: /* @__PURE__ */ __name(() => pos, "getPosition"),
    scan: ignoreTrivia ? scanNextNonTrivia : scanNext,
    getToken: /* @__PURE__ */ __name(() => token, "getToken"),
    getTokenValue: /* @__PURE__ */ __name(() => value, "getTokenValue"),
    getTokenOffset: /* @__PURE__ */ __name(() => tokenOffset, "getTokenOffset"),
    getTokenLength: /* @__PURE__ */ __name(() => pos - tokenOffset, "getTokenLength"),
    getTokenStartLine: /* @__PURE__ */ __name(() => lineStartOffset, "getTokenStartLine"),
    getTokenStartCharacter: /* @__PURE__ */ __name(() => tokenOffset - prevTokenLineStartOffset, "getTokenStartCharacter"),
    getTokenError: /* @__PURE__ */ __name(() => scanError, "getTokenError")
  };
}
function isWhiteSpace2(ch2) {
  return ch2 === 32 || ch2 === 9;
}
function isLineBreak2(ch2) {
  return ch2 === 10 || ch2 === 13;
}
function isDigit2(ch2) {
  return ch2 >= 48 && ch2 <= 57;
}
var CharacterCodes2;
var init_scanner = __esm({
  "../../node_modules/.pnpm/jsonc-parser@3.2.0/node_modules/jsonc-parser/lib/esm/impl/scanner.js"() {
    init_import_meta_url();
    __name(createScanner2, "createScanner");
    __name(isWhiteSpace2, "isWhiteSpace");
    __name(isLineBreak2, "isLineBreak");
    __name(isDigit2, "isDigit");
    (function(CharacterCodes3) {
      CharacterCodes3[CharacterCodes3["lineFeed"] = 10] = "lineFeed";
      CharacterCodes3[CharacterCodes3["carriageReturn"] = 13] = "carriageReturn";
      CharacterCodes3[CharacterCodes3["space"] = 32] = "space";
      CharacterCodes3[CharacterCodes3["_0"] = 48] = "_0";
      CharacterCodes3[CharacterCodes3["_1"] = 49] = "_1";
      CharacterCodes3[CharacterCodes3["_2"] = 50] = "_2";
      CharacterCodes3[CharacterCodes3["_3"] = 51] = "_3";
      CharacterCodes3[CharacterCodes3["_4"] = 52] = "_4";
      CharacterCodes3[CharacterCodes3["_5"] = 53] = "_5";
      CharacterCodes3[CharacterCodes3["_6"] = 54] = "_6";
      CharacterCodes3[CharacterCodes3["_7"] = 55] = "_7";
      CharacterCodes3[CharacterCodes3["_8"] = 56] = "_8";
      CharacterCodes3[CharacterCodes3["_9"] = 57] = "_9";
      CharacterCodes3[CharacterCodes3["a"] = 97] = "a";
      CharacterCodes3[CharacterCodes3["b"] = 98] = "b";
      CharacterCodes3[CharacterCodes3["c"] = 99] = "c";
      CharacterCodes3[CharacterCodes3["d"] = 100] = "d";
      CharacterCodes3[CharacterCodes3["e"] = 101] = "e";
      CharacterCodes3[CharacterCodes3["f"] = 102] = "f";
      CharacterCodes3[CharacterCodes3["g"] = 103] = "g";
      CharacterCodes3[CharacterCodes3["h"] = 104] = "h";
      CharacterCodes3[CharacterCodes3["i"] = 105] = "i";
      CharacterCodes3[CharacterCodes3["j"] = 106] = "j";
      CharacterCodes3[CharacterCodes3["k"] = 107] = "k";
      CharacterCodes3[CharacterCodes3["l"] = 108] = "l";
      CharacterCodes3[CharacterCodes3["m"] = 109] = "m";
      CharacterCodes3[CharacterCodes3["n"] = 110] = "n";
      CharacterCodes3[CharacterCodes3["o"] = 111] = "o";
      CharacterCodes3[CharacterCodes3["p"] = 112] = "p";
      CharacterCodes3[CharacterCodes3["q"] = 113] = "q";
      CharacterCodes3[CharacterCodes3["r"] = 114] = "r";
      CharacterCodes3[CharacterCodes3["s"] = 115] = "s";
      CharacterCodes3[CharacterCodes3["t"] = 116] = "t";
      CharacterCodes3[CharacterCodes3["u"] = 117] = "u";
      CharacterCodes3[CharacterCodes3["v"] = 118] = "v";
      CharacterCodes3[CharacterCodes3["w"] = 119] = "w";
      CharacterCodes3[CharacterCodes3["x"] = 120] = "x";
      CharacterCodes3[CharacterCodes3["y"] = 121] = "y";
      CharacterCodes3[CharacterCodes3["z"] = 122] = "z";
      CharacterCodes3[CharacterCodes3["A"] = 65] = "A";
      CharacterCodes3[CharacterCodes3["B"] = 66] = "B";
      CharacterCodes3[CharacterCodes3["C"] = 67] = "C";
      CharacterCodes3[CharacterCodes3["D"] = 68] = "D";
      CharacterCodes3[CharacterCodes3["E"] = 69] = "E";
      CharacterCodes3[CharacterCodes3["F"] = 70] = "F";
      CharacterCodes3[CharacterCodes3["G"] = 71] = "G";
      CharacterCodes3[CharacterCodes3["H"] = 72] = "H";
      CharacterCodes3[CharacterCodes3["I"] = 73] = "I";
      CharacterCodes3[CharacterCodes3["J"] = 74] = "J";
      CharacterCodes3[CharacterCodes3["K"] = 75] = "K";
      CharacterCodes3[CharacterCodes3["L"] = 76] = "L";
      CharacterCodes3[CharacterCodes3["M"] = 77] = "M";
      CharacterCodes3[CharacterCodes3["N"] = 78] = "N";
      CharacterCodes3[CharacterCodes3["O"] = 79] = "O";
      CharacterCodes3[CharacterCodes3["P"] = 80] = "P";
      CharacterCodes3[CharacterCodes3["Q"] = 81] = "Q";
      CharacterCodes3[CharacterCodes3["R"] = 82] = "R";
      CharacterCodes3[CharacterCodes3["S"] = 83] = "S";
      CharacterCodes3[CharacterCodes3["T"] = 84] = "T";
      CharacterCodes3[CharacterCodes3["U"] = 85] = "U";
      CharacterCodes3[CharacterCodes3["V"] = 86] = "V";
      CharacterCodes3[CharacterCodes3["W"] = 87] = "W";
      CharacterCodes3[CharacterCodes3["X"] = 88] = "X";
      CharacterCodes3[CharacterCodes3["Y"] = 89] = "Y";
      CharacterCodes3[CharacterCodes3["Z"] = 90] = "Z";
      CharacterCodes3[CharacterCodes3["asterisk"] = 42] = "asterisk";
      CharacterCodes3[CharacterCodes3["backslash"] = 92] = "backslash";
      CharacterCodes3[CharacterCodes3["closeBrace"] = 125] = "closeBrace";
      CharacterCodes3[CharacterCodes3["closeBracket"] = 93] = "closeBracket";
      CharacterCodes3[CharacterCodes3["colon"] = 58] = "colon";
      CharacterCodes3[CharacterCodes3["comma"] = 44] = "comma";
      CharacterCodes3[CharacterCodes3["dot"] = 46] = "dot";
      CharacterCodes3[CharacterCodes3["doubleQuote"] = 34] = "doubleQuote";
      CharacterCodes3[CharacterCodes3["minus"] = 45] = "minus";
      CharacterCodes3[CharacterCodes3["openBrace"] = 123] = "openBrace";
      CharacterCodes3[CharacterCodes3["openBracket"] = 91] = "openBracket";
      CharacterCodes3[CharacterCodes3["plus"] = 43] = "plus";
      CharacterCodes3[CharacterCodes3["slash"] = 47] = "slash";
      CharacterCodes3[CharacterCodes3["formFeed"] = 12] = "formFeed";
      CharacterCodes3[CharacterCodes3["tab"] = 9] = "tab";
    })(CharacterCodes2 || (CharacterCodes2 = {}));
  }
});

// ../../node_modules/.pnpm/jsonc-parser@3.2.0/node_modules/jsonc-parser/lib/esm/impl/format.js
var init_format = __esm({
  "../../node_modules/.pnpm/jsonc-parser@3.2.0/node_modules/jsonc-parser/lib/esm/impl/format.js"() {
    init_import_meta_url();
    init_scanner();
  }
});

// ../../node_modules/.pnpm/jsonc-parser@3.2.0/node_modules/jsonc-parser/lib/esm/impl/parser.js
function parse6(text, errors = [], options = ParseOptions2.DEFAULT) {
  let currentProperty = null;
  let currentParent = [];
  const previousParents = [];
  function onValue(value) {
    if (Array.isArray(currentParent)) {
      currentParent.push(value);
    } else if (currentProperty !== null) {
      currentParent[currentProperty] = value;
    }
  }
  __name(onValue, "onValue");
  const visitor = {
    onObjectBegin: /* @__PURE__ */ __name(() => {
      const object = {};
      onValue(object);
      previousParents.push(currentParent);
      currentParent = object;
      currentProperty = null;
    }, "onObjectBegin"),
    onObjectProperty: /* @__PURE__ */ __name((name2) => {
      currentProperty = name2;
    }, "onObjectProperty"),
    onObjectEnd: /* @__PURE__ */ __name(() => {
      currentParent = previousParents.pop();
    }, "onObjectEnd"),
    onArrayBegin: /* @__PURE__ */ __name(() => {
      const array = [];
      onValue(array);
      previousParents.push(currentParent);
      currentParent = array;
      currentProperty = null;
    }, "onArrayBegin"),
    onArrayEnd: /* @__PURE__ */ __name(() => {
      currentParent = previousParents.pop();
    }, "onArrayEnd"),
    onLiteralValue: onValue,
    onError: /* @__PURE__ */ __name((error2, offset, length) => {
      errors.push({ error: error2, offset, length });
    }, "onError")
  };
  visit2(text, visitor, options);
  return currentParent[0];
}
function visit2(text, visitor, options = ParseOptions2.DEFAULT) {
  const _scanner = createScanner2(text, false);
  const _jsonPath = [];
  function toNoArgVisit(visitFunction) {
    return visitFunction ? () => visitFunction(_scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter()) : () => true;
  }
  __name(toNoArgVisit, "toNoArgVisit");
  function toNoArgVisitWithPath(visitFunction) {
    return visitFunction ? () => visitFunction(_scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter(), () => _jsonPath.slice()) : () => true;
  }
  __name(toNoArgVisitWithPath, "toNoArgVisitWithPath");
  function toOneArgVisit(visitFunction) {
    return visitFunction ? (arg) => visitFunction(arg, _scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter()) : () => true;
  }
  __name(toOneArgVisit, "toOneArgVisit");
  function toOneArgVisitWithPath(visitFunction) {
    return visitFunction ? (arg) => visitFunction(arg, _scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter(), () => _jsonPath.slice()) : () => true;
  }
  __name(toOneArgVisitWithPath, "toOneArgVisitWithPath");
  const onObjectBegin = toNoArgVisitWithPath(visitor.onObjectBegin), onObjectProperty = toOneArgVisitWithPath(visitor.onObjectProperty), onObjectEnd = toNoArgVisit(visitor.onObjectEnd), onArrayBegin = toNoArgVisitWithPath(visitor.onArrayBegin), onArrayEnd = toNoArgVisit(visitor.onArrayEnd), onLiteralValue = toOneArgVisitWithPath(visitor.onLiteralValue), onSeparator = toOneArgVisit(visitor.onSeparator), onComment = toNoArgVisit(visitor.onComment), onError = toOneArgVisit(visitor.onError);
  const disallowComments = options && options.disallowComments;
  const allowTrailingComma = options && options.allowTrailingComma;
  function scanNext() {
    while (true) {
      const token = _scanner.scan();
      switch (_scanner.getTokenError()) {
        case 4:
          handleError2(
            14
            /* ParseErrorCode.InvalidUnicode */
          );
          break;
        case 5:
          handleError2(
            15
            /* ParseErrorCode.InvalidEscapeCharacter */
          );
          break;
        case 3:
          handleError2(
            13
            /* ParseErrorCode.UnexpectedEndOfNumber */
          );
          break;
        case 1:
          if (!disallowComments) {
            handleError2(
              11
              /* ParseErrorCode.UnexpectedEndOfComment */
            );
          }
          break;
        case 2:
          handleError2(
            12
            /* ParseErrorCode.UnexpectedEndOfString */
          );
          break;
        case 6:
          handleError2(
            16
            /* ParseErrorCode.InvalidCharacter */
          );
          break;
      }
      switch (token) {
        case 12:
        case 13:
          if (disallowComments) {
            handleError2(
              10
              /* ParseErrorCode.InvalidCommentToken */
            );
          } else {
            onComment();
          }
          break;
        case 16:
          handleError2(
            1
            /* ParseErrorCode.InvalidSymbol */
          );
          break;
        case 15:
        case 14:
          break;
        default:
          return token;
      }
    }
  }
  __name(scanNext, "scanNext");
  function handleError2(error2, skipUntilAfter = [], skipUntil3 = []) {
    onError(error2);
    if (skipUntilAfter.length + skipUntil3.length > 0) {
      let token = _scanner.getToken();
      while (token !== 17) {
        if (skipUntilAfter.indexOf(token) !== -1) {
          scanNext();
          break;
        } else if (skipUntil3.indexOf(token) !== -1) {
          break;
        }
        token = scanNext();
      }
    }
  }
  __name(handleError2, "handleError");
  function parseString3(isValue) {
    const value = _scanner.getTokenValue();
    if (isValue) {
      onLiteralValue(value);
    } else {
      onObjectProperty(value);
      _jsonPath.push(value);
    }
    scanNext();
    return true;
  }
  __name(parseString3, "parseString");
  function parseLiteral() {
    switch (_scanner.getToken()) {
      case 11:
        const tokenValue = _scanner.getTokenValue();
        let value = Number(tokenValue);
        if (isNaN(value)) {
          handleError2(
            2
            /* ParseErrorCode.InvalidNumberFormat */
          );
          value = 0;
        }
        onLiteralValue(value);
        break;
      case 7:
        onLiteralValue(null);
        break;
      case 8:
        onLiteralValue(true);
        break;
      case 9:
        onLiteralValue(false);
        break;
      default:
        return false;
    }
    scanNext();
    return true;
  }
  __name(parseLiteral, "parseLiteral");
  function parseProperty() {
    if (_scanner.getToken() !== 10) {
      handleError2(3, [], [
        2,
        5
        /* SyntaxKind.CommaToken */
      ]);
      return false;
    }
    parseString3(false);
    if (_scanner.getToken() === 6) {
      onSeparator(":");
      scanNext();
      if (!parseValue3()) {
        handleError2(4, [], [
          2,
          5
          /* SyntaxKind.CommaToken */
        ]);
      }
    } else {
      handleError2(5, [], [
        2,
        5
        /* SyntaxKind.CommaToken */
      ]);
    }
    _jsonPath.pop();
    return true;
  }
  __name(parseProperty, "parseProperty");
  function parseObject() {
    onObjectBegin();
    scanNext();
    let needsComma = false;
    while (_scanner.getToken() !== 2 && _scanner.getToken() !== 17) {
      if (_scanner.getToken() === 5) {
        if (!needsComma) {
          handleError2(4, [], []);
        }
        onSeparator(",");
        scanNext();
        if (_scanner.getToken() === 2 && allowTrailingComma) {
          break;
        }
      } else if (needsComma) {
        handleError2(6, [], []);
      }
      if (!parseProperty()) {
        handleError2(4, [], [
          2,
          5
          /* SyntaxKind.CommaToken */
        ]);
      }
      needsComma = true;
    }
    onObjectEnd();
    if (_scanner.getToken() !== 2) {
      handleError2(7, [
        2
        /* SyntaxKind.CloseBraceToken */
      ], []);
    } else {
      scanNext();
    }
    return true;
  }
  __name(parseObject, "parseObject");
  function parseArray3() {
    onArrayBegin();
    scanNext();
    let isFirstElement = true;
    let needsComma = false;
    while (_scanner.getToken() !== 4 && _scanner.getToken() !== 17) {
      if (_scanner.getToken() === 5) {
        if (!needsComma) {
          handleError2(4, [], []);
        }
        onSeparator(",");
        scanNext();
        if (_scanner.getToken() === 4 && allowTrailingComma) {
          break;
        }
      } else if (needsComma) {
        handleError2(6, [], []);
      }
      if (isFirstElement) {
        _jsonPath.push(0);
        isFirstElement = false;
      } else {
        _jsonPath[_jsonPath.length - 1]++;
      }
      if (!parseValue3()) {
        handleError2(4, [], [
          4,
          5
          /* SyntaxKind.CommaToken */
        ]);
      }
      needsComma = true;
    }
    onArrayEnd();
    if (!isFirstElement) {
      _jsonPath.pop();
    }
    if (_scanner.getToken() !== 4) {
      handleError2(8, [
        4
        /* SyntaxKind.CloseBracketToken */
      ], []);
    } else {
      scanNext();
    }
    return true;
  }
  __name(parseArray3, "parseArray");
  function parseValue3() {
    switch (_scanner.getToken()) {
      case 3:
        return parseArray3();
      case 1:
        return parseObject();
      case 10:
        return parseString3(true);
      default:
        return parseLiteral();
    }
  }
  __name(parseValue3, "parseValue");
  scanNext();
  if (_scanner.getToken() === 17) {
    if (options.allowEmptyContent) {
      return true;
    }
    handleError2(4, [], []);
    return false;
  }
  if (!parseValue3()) {
    handleError2(4, [], []);
    return false;
  }
  if (_scanner.getToken() !== 17) {
    handleError2(9, [], []);
  }
  return true;
}
var ParseOptions2;
var init_parser = __esm({
  "../../node_modules/.pnpm/jsonc-parser@3.2.0/node_modules/jsonc-parser/lib/esm/impl/parser.js"() {
    init_import_meta_url();
    init_scanner();
    (function(ParseOptions3) {
      ParseOptions3.DEFAULT = {
        allowTrailingComma: false
      };
    })(ParseOptions2 || (ParseOptions2 = {}));
    __name(parse6, "parse");
    __name(visit2, "visit");
  }
});

// ../../node_modules/.pnpm/jsonc-parser@3.2.0/node_modules/jsonc-parser/lib/esm/impl/edit.js
var init_edit = __esm({
  "../../node_modules/.pnpm/jsonc-parser@3.2.0/node_modules/jsonc-parser/lib/esm/impl/edit.js"() {
    init_import_meta_url();
    init_format();
    init_parser();
  }
});

// ../../node_modules/.pnpm/jsonc-parser@3.2.0/node_modules/jsonc-parser/lib/esm/main.js
function printParseErrorCode2(code) {
  switch (code) {
    case 1:
      return "InvalidSymbol";
    case 2:
      return "InvalidNumberFormat";
    case 3:
      return "PropertyNameExpected";
    case 4:
      return "ValueExpected";
    case 5:
      return "ColonExpected";
    case 6:
      return "CommaExpected";
    case 7:
      return "CloseBraceExpected";
    case 8:
      return "CloseBracketExpected";
    case 9:
      return "EndOfFileExpected";
    case 10:
      return "InvalidCommentToken";
    case 11:
      return "UnexpectedEndOfComment";
    case 12:
      return "UnexpectedEndOfString";
    case 13:
      return "UnexpectedEndOfNumber";
    case 14:
      return "InvalidUnicode";
    case 15:
      return "InvalidEscapeCharacter";
    case 16:
      return "InvalidCharacter";
  }
  return "<unknown ParseErrorCode>";
}
var ScanError2, SyntaxKind2, parse7, ParseErrorCode2;
var init_main2 = __esm({
  "../../node_modules/.pnpm/jsonc-parser@3.2.0/node_modules/jsonc-parser/lib/esm/main.js"() {
    init_import_meta_url();
    init_format();
    init_edit();
    init_scanner();
    init_parser();
    (function(ScanError3) {
      ScanError3[ScanError3["None"] = 0] = "None";
      ScanError3[ScanError3["UnexpectedEndOfComment"] = 1] = "UnexpectedEndOfComment";
      ScanError3[ScanError3["UnexpectedEndOfString"] = 2] = "UnexpectedEndOfString";
      ScanError3[ScanError3["UnexpectedEndOfNumber"] = 3] = "UnexpectedEndOfNumber";
      ScanError3[ScanError3["InvalidUnicode"] = 4] = "InvalidUnicode";
      ScanError3[ScanError3["InvalidEscapeCharacter"] = 5] = "InvalidEscapeCharacter";
      ScanError3[ScanError3["InvalidCharacter"] = 6] = "InvalidCharacter";
    })(ScanError2 || (ScanError2 = {}));
    (function(SyntaxKind3) {
      SyntaxKind3[SyntaxKind3["OpenBraceToken"] = 1] = "OpenBraceToken";
      SyntaxKind3[SyntaxKind3["CloseBraceToken"] = 2] = "CloseBraceToken";
      SyntaxKind3[SyntaxKind3["OpenBracketToken"] = 3] = "OpenBracketToken";
      SyntaxKind3[SyntaxKind3["CloseBracketToken"] = 4] = "CloseBracketToken";
      SyntaxKind3[SyntaxKind3["CommaToken"] = 5] = "CommaToken";
      SyntaxKind3[SyntaxKind3["ColonToken"] = 6] = "ColonToken";
      SyntaxKind3[SyntaxKind3["NullKeyword"] = 7] = "NullKeyword";
      SyntaxKind3[SyntaxKind3["TrueKeyword"] = 8] = "TrueKeyword";
      SyntaxKind3[SyntaxKind3["FalseKeyword"] = 9] = "FalseKeyword";
      SyntaxKind3[SyntaxKind3["StringLiteral"] = 10] = "StringLiteral";
      SyntaxKind3[SyntaxKind3["NumericLiteral"] = 11] = "NumericLiteral";
      SyntaxKind3[SyntaxKind3["LineCommentTrivia"] = 12] = "LineCommentTrivia";
      SyntaxKind3[SyntaxKind3["BlockCommentTrivia"] = 13] = "BlockCommentTrivia";
      SyntaxKind3[SyntaxKind3["LineBreakTrivia"] = 14] = "LineBreakTrivia";
      SyntaxKind3[SyntaxKind3["Trivia"] = 15] = "Trivia";
      SyntaxKind3[SyntaxKind3["Unknown"] = 16] = "Unknown";
      SyntaxKind3[SyntaxKind3["EOF"] = 17] = "EOF";
    })(SyntaxKind2 || (SyntaxKind2 = {}));
    parse7 = parse6;
    (function(ParseErrorCode3) {
      ParseErrorCode3[ParseErrorCode3["InvalidSymbol"] = 1] = "InvalidSymbol";
      ParseErrorCode3[ParseErrorCode3["InvalidNumberFormat"] = 2] = "InvalidNumberFormat";
      ParseErrorCode3[ParseErrorCode3["PropertyNameExpected"] = 3] = "PropertyNameExpected";
      ParseErrorCode3[ParseErrorCode3["ValueExpected"] = 4] = "ValueExpected";
      ParseErrorCode3[ParseErrorCode3["ColonExpected"] = 5] = "ColonExpected";
      ParseErrorCode3[ParseErrorCode3["CommaExpected"] = 6] = "CommaExpected";
      ParseErrorCode3[ParseErrorCode3["CloseBraceExpected"] = 7] = "CloseBraceExpected";
      ParseErrorCode3[ParseErrorCode3["CloseBracketExpected"] = 8] = "CloseBracketExpected";
      ParseErrorCode3[ParseErrorCode3["EndOfFileExpected"] = 9] = "EndOfFileExpected";
      ParseErrorCode3[ParseErrorCode3["InvalidCommentToken"] = 10] = "InvalidCommentToken";
      ParseErrorCode3[ParseErrorCode3["UnexpectedEndOfComment"] = 11] = "UnexpectedEndOfComment";
      ParseErrorCode3[ParseErrorCode3["UnexpectedEndOfString"] = 12] = "UnexpectedEndOfString";
      ParseErrorCode3[ParseErrorCode3["UnexpectedEndOfNumber"] = 13] = "UnexpectedEndOfNumber";
      ParseErrorCode3[ParseErrorCode3["InvalidUnicode"] = 14] = "InvalidUnicode";
      ParseErrorCode3[ParseErrorCode3["InvalidEscapeCharacter"] = 15] = "InvalidEscapeCharacter";
      ParseErrorCode3[ParseErrorCode3["InvalidCharacter"] = 16] = "InvalidCharacter";
    })(ParseErrorCode2 || (ParseErrorCode2 = {}));
    __name(printParseErrorCode2, "printParseErrorCode");
  }
});

// ../workers-utils/src/errors.ts
var UserError2;
var init_errors4 = __esm({
  "../workers-utils/src/errors.ts"() {
    init_import_meta_url();
    UserError2 = class extends Error {
      static {
        __name(this, "UserError");
      }
      telemetryMessage;
      constructor(message, options) {
        super(message, options);
        Object.setPrototypeOf(this, new.target.prototype);
        this.telemetryMessage = options?.telemetryMessage === true ? message : options?.telemetryMessage;
      }
    };
  }
});
function parseTOML2(tomlContent, filePath) {
  try {
    return dist_default2.parse(tomlContent);
  } catch (err) {
    if (!(err instanceof TomlError2)) {
      throw err;
    }
    const location = {
      lineText: tomlContent.split("\n")[err.line - 1],
      line: err.line,
      column: err.column - 1,
      file: filePath,
      fileText: tomlContent
    };
    throw new ParseError2({
      text: err.message.substring(0, err.message.indexOf("\n")),
      location,
      telemetryMessage: "TOML parse error"
    });
  }
}
function parseJSONC2(input, file3, options = { allowTrailingComma: true }) {
  const errors = [];
  const data = parse7(input, errors, options);
  if (errors.length) {
    throw new ParseError2({
      text: printParseErrorCode2(errors[0].error),
      location: {
        ...indexLocation2({ file: file3, fileText: input }, errors[0].offset + 1),
        length: errors[0].length
      },
      telemetryMessage: "JSON(C) parse error"
    });
  }
  return data;
}
function readFileSync12(file3) {
  try {
    const buffer = fs29.readFileSync(file3);
    return removeBOMAndValidate2(buffer, file3);
  } catch (err) {
    if (err instanceof ParseError2) {
      throw err;
    }
    const { message } = err;
    throw new ParseError2({
      text: `Could not read file: ${file3}`,
      notes: [
        {
          text: message.replace(file3, path3.resolve(file3))
        }
      ],
      telemetryMessage: "Could not read file"
    });
  }
}
function indexLocation2(file3, index) {
  let lineText, line = 0, column = 0, cursor = 0;
  const { fileText = "" } = file3;
  for (const row of fileText.split("\n")) {
    line++;
    cursor += row.length + 1;
    if (cursor >= index) {
      lineText = row;
      column = row.length - (cursor - index);
      break;
    }
  }
  return { lineText, line, column, ...file3 };
}
function removeBOMAndValidate2(buffer, file3) {
  for (const bom of UNSUPPORTED_BOMS2) {
    if (buffer.length >= bom.buffer.length && buffer.subarray(0, bom.buffer.length).equals(bom.buffer)) {
      throw new ParseError2({
        text: `Configuration file contains ${bom.encoding} byte order marker`,
        notes: [
          {
            text: `The file "${file3}" appears to be encoded as ${bom.encoding}. Please save the file as UTF-8 without BOM.`
          }
        ],
        location: { file: file3, line: 1, column: 0 },
        telemetryMessage: `${bom.encoding} BOM detected`
      });
    }
  }
  const content = buffer.toString("utf-8");
  if (content.charCodeAt(0) === 65279) {
    return content.slice(1);
  }
  return content;
}
var ParseError2, UNSUPPORTED_BOMS2;
var init_parse2 = __esm({
  "../workers-utils/src/parse.ts"() {
    init_import_meta_url();
    init_main2();
    init_dist5();
    init_errors4();
    ParseError2 = class extends UserError2 {
      static {
        __name(this, "ParseError");
      }
      text;
      notes;
      location;
      kind;
      constructor({ text, notes, location, kind: kind2, telemetryMessage }) {
        super(text, { telemetryMessage });
        this.name = this.constructor.name;
        this.text = text;
        this.notes = notes ?? [];
        this.location = location;
        this.kind = kind2 ?? "error";
      }
    };
    __name(parseTOML2, "parseTOML");
    __name(parseJSONC2, "parseJSONC");
    __name(readFileSync12, "readFileSync");
    __name(indexLocation2, "indexLocation");
    UNSUPPORTED_BOMS2 = [
      {
        buffer: Buffer.from([0, 0, 254, 255]),
        encoding: "UTF-32 BE"
      },
      {
        buffer: Buffer.from([255, 254, 0, 0]),
        encoding: "UTF-32 LE"
      },
      {
        buffer: Buffer.from([254, 255]),
        encoding: "UTF-16 BE"
      },
      {
        buffer: Buffer.from([255, 254]),
        encoding: "UTF-16 LE"
      }
    ];
    __name(removeBOMAndValidate2, "removeBOMAndValidate");
  }
});

// ../workers-utils/src/constants.ts
var PATH_TO_DEPLOY_CONFIG2;
var init_constants4 = __esm({
  "../workers-utils/src/constants.ts"() {
    init_import_meta_url();
    PATH_TO_DEPLOY_CONFIG2 = ".wrangler/deploy/config.json";
  }
});
function resolveWranglerConfigPath2({
  config,
  script
}, options) {
  if (config !== void 0) {
    return {
      userConfigPath: config,
      configPath: config,
      deployConfigPath: void 0,
      redirected: false
    };
  }
  const leafPath = script !== void 0 ? path3__namespace.default.dirname(script) : process.cwd();
  return findWranglerConfig2(leafPath, options);
}
function findWranglerConfig2(referencePath = process.cwd(), { useRedirectIfAvailable = false } = {}) {
  const userConfigPath = file2(`wrangler.json`, { cwd: referencePath }) ?? file2(`wrangler.jsonc`, { cwd: referencePath }) ?? file2(`wrangler.toml`, { cwd: referencePath });
  if (!useRedirectIfAvailable) {
    return {
      userConfigPath,
      configPath: userConfigPath,
      deployConfigPath: void 0,
      redirected: false
    };
  }
  const { configPath, deployConfigPath, redirected } = findRedirectedWranglerConfig2(referencePath, userConfigPath);
  return {
    userConfigPath,
    configPath,
    deployConfigPath,
    redirected
  };
}
function findRedirectedWranglerConfig2(cwd2, userConfigPath) {
  const deployConfigPath = file2(PATH_TO_DEPLOY_CONFIG2, { cwd: cwd2 });
  if (deployConfigPath === void 0) {
    return { configPath: userConfigPath, deployConfigPath, redirected: false };
  }
  let redirectedConfigPath;
  const deployConfigFile = readFileSync12(deployConfigPath);
  try {
    const deployConfig = parseJSONC2(deployConfigFile, deployConfigPath);
    redirectedConfigPath = deployConfig.configPath && path3__namespace.default.resolve(path3__namespace.default.dirname(deployConfigPath), deployConfig.configPath);
  } catch (e10) {
    throw new UserError2(
      `Failed to parse the deploy configuration file at ${path3__namespace.default.relative(".", deployConfigPath)}`,
      { cause: e10 }
    );
  }
  if (!redirectedConfigPath) {
    throw new UserError2(esm_default3`
			A deploy configuration file was found at "${path3__namespace.default.relative(".", deployConfigPath)}".
			But this is not valid - the required "configPath" property was not found.
			Instead this file contains:
			\`\`\`
			${deployConfigFile}
			\`\`\`
		`);
  }
  if (!fs29.existsSync(redirectedConfigPath)) {
    throw new UserError2(esm_default3`
				There is a deploy configuration at "${path3__namespace.default.relative(".", deployConfigPath)}".
				But the redirected configuration path it points to, "${path3__namespace.default.relative(".", redirectedConfigPath)}", does not exist.
			`);
  }
  if (userConfigPath) {
    if (path3__namespace.default.join(path3__namespace.default.dirname(userConfigPath), PATH_TO_DEPLOY_CONFIG2) !== deployConfigPath) {
      throw new UserError2(esm_default3`
					Found both a user configuration file at "${path3__namespace.default.relative(".", userConfigPath)}"
					and a deploy configuration file at "${path3__namespace.default.relative(".", deployConfigPath)}".
					But these do not share the same base path so it is not clear which should be used.
				`);
    }
  }
  return {
    configPath: redirectedConfigPath,
    deployConfigPath,
    redirected: true
  };
}
var init_config_helpers = __esm({
  "../workers-utils/src/config/config-helpers.ts"() {
    init_import_meta_url();
    init_find();
    init_esm2();
    init_constants4();
    init_errors4();
    init_parse2();
    __name(resolveWranglerConfigPath2, "resolveWranglerConfigPath");
    __name(findWranglerConfig2, "findWranglerConfig");
    __name(findRedirectedWranglerConfig2, "findRedirectedWranglerConfig");
  }
});

// ../workers-utils/src/config/index.ts
var parseRawConfigFile2, experimental_readRawConfig2;
var init_config7 = __esm({
  "../workers-utils/src/config/index.ts"() {
    init_import_meta_url();
    init_dist5();
    init_parse2();
    init_config_helpers();
    parseRawConfigFile2 = /* @__PURE__ */ __name((configPath) => {
      if (configPath.endsWith(".toml")) {
        return parseTOML2(readFileSync12(configPath), configPath);
      }
      if (configPath.endsWith(".json") || configPath.endsWith(".jsonc")) {
        return parseJSONC2(readFileSync12(configPath), configPath);
      }
      return {};
    }, "parseRawConfigFile");
    experimental_readRawConfig2 = /* @__PURE__ */ __name((args, options = {}) => {
      const { configPath, userConfigPath, deployConfigPath, redirected } = resolveWranglerConfigPath2(args, options);
      const rawConfig = parseRawConfigFile2(configPath ?? "");
      return {
        rawConfig,
        configPath,
        userConfigPath,
        deployConfigPath,
        redirected
      };
    }, "experimental_readRawConfig");
  }
});
var init_patch_config = __esm({
  "../workers-utils/src/config/patch-config.ts"() {
    init_import_meta_url();
    init_main2();
    init_dist5();
    init_parse2();
  }
});

// ../workers-utils/src/worker.ts
var init_worker = __esm({
  "../workers-utils/src/worker.ts"() {
    init_import_meta_url();
  }
});

// ../workers-utils/src/types.ts
var init_types5 = __esm({
  "../workers-utils/src/types.ts"() {
    init_import_meta_url();
  }
});
var init_itty_time = __esm({
  "../../node_modules/.pnpm/itty-time@2.0.2/node_modules/itty-time/index.mjs"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/zod@3.22.3/node_modules/zod/lib/index.mjs
function setErrorMap3(map2) {
  overrideErrorMap3 = map2;
}
function getErrorMap3() {
  return overrideErrorMap3;
}
function addIssueToContext3(ctx, issueData) {
  const issue = makeIssue3({
    issueData,
    data: ctx.data,
    path: ctx.path,
    errorMaps: [
      ctx.common.contextualErrorMap,
      ctx.schemaErrorMap,
      getErrorMap3(),
      errorMap3
      // then global default map
    ].filter((x7) => !!x7)
  });
  ctx.common.issues.push(issue);
}
function processCreateParams3(params) {
  if (!params)
    return {};
  const { errorMap: errorMap4, invalid_type_error, required_error, description } = params;
  if (errorMap4 && (invalid_type_error || required_error)) {
    throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
  }
  if (errorMap4)
    return { errorMap: errorMap4, description };
  const customMap = /* @__PURE__ */ __name((iss, ctx) => {
    if (iss.code !== "invalid_type")
      return { message: ctx.defaultError };
    if (typeof ctx.data === "undefined") {
      return { message: required_error !== null && required_error !== void 0 ? required_error : ctx.defaultError };
    }
    return { message: invalid_type_error !== null && invalid_type_error !== void 0 ? invalid_type_error : ctx.defaultError };
  }, "customMap");
  return { errorMap: customMap, description };
}
function isValidIP3(ip, version5) {
  if ((version5 === "v4" || !version5) && ipv4Regex3.test(ip)) {
    return true;
  }
  if ((version5 === "v6" || !version5) && ipv6Regex3.test(ip)) {
    return true;
  }
  return false;
}
function floatSafeRemainder3(val2, step) {
  const valDecCount = (val2.toString().split(".")[1] || "").length;
  const stepDecCount = (step.toString().split(".")[1] || "").length;
  const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;
  const valInt = parseInt(val2.toFixed(decCount).replace(".", ""));
  const stepInt = parseInt(step.toFixed(decCount).replace(".", ""));
  return valInt % stepInt / Math.pow(10, decCount);
}
function deepPartialify3(schema) {
  if (schema instanceof ZodObject3) {
    const newShape = {};
    for (const key in schema.shape) {
      const fieldSchema = schema.shape[key];
      newShape[key] = ZodOptional3.create(deepPartialify3(fieldSchema));
    }
    return new ZodObject3({
      ...schema._def,
      shape: /* @__PURE__ */ __name(() => newShape, "shape")
    });
  } else if (schema instanceof ZodArray3) {
    return new ZodArray3({
      ...schema._def,
      type: deepPartialify3(schema.element)
    });
  } else if (schema instanceof ZodOptional3) {
    return ZodOptional3.create(deepPartialify3(schema.unwrap()));
  } else if (schema instanceof ZodNullable3) {
    return ZodNullable3.create(deepPartialify3(schema.unwrap()));
  } else if (schema instanceof ZodTuple3) {
    return ZodTuple3.create(schema.items.map((item) => deepPartialify3(item)));
  } else {
    return schema;
  }
}
function mergeValues3(a7, b11) {
  const aType = getParsedType3(a7);
  const bType = getParsedType3(b11);
  if (a7 === b11) {
    return { valid: true, data: a7 };
  } else if (aType === ZodParsedType3.object && bType === ZodParsedType3.object) {
    const bKeys = util3.objectKeys(b11);
    const sharedKeys = util3.objectKeys(a7).filter((key) => bKeys.indexOf(key) !== -1);
    const newObj = { ...a7, ...b11 };
    for (const key of sharedKeys) {
      const sharedValue = mergeValues3(a7[key], b11[key]);
      if (!sharedValue.valid) {
        return { valid: false };
      }
      newObj[key] = sharedValue.data;
    }
    return { valid: true, data: newObj };
  } else if (aType === ZodParsedType3.array && bType === ZodParsedType3.array) {
    if (a7.length !== b11.length) {
      return { valid: false };
    }
    const newArray = [];
    for (let index = 0; index < a7.length; index++) {
      const itemA = a7[index];
      const itemB = b11[index];
      const sharedValue = mergeValues3(itemA, itemB);
      if (!sharedValue.valid) {
        return { valid: false };
      }
      newArray.push(sharedValue.data);
    }
    return { valid: true, data: newArray };
  } else if (aType === ZodParsedType3.date && bType === ZodParsedType3.date && +a7 === +b11) {
    return { valid: true, data: a7 };
  } else {
    return { valid: false };
  }
}
function createZodEnum3(values, params) {
  return new ZodEnum3({
    values,
    typeName: ZodFirstPartyTypeKind3.ZodEnum,
    ...processCreateParams3(params)
  });
}
var util3, objectUtil3, ZodParsedType3, getParsedType3, ZodIssueCode3, quotelessJson3, ZodError3, errorMap3, overrideErrorMap3, makeIssue3, EMPTY_PATH3, ParseStatus3, INVALID3, DIRTY3, OK3, isAborted3, isDirty3, isValid3, isAsync3, errorUtil3, ParseInputLazyPath3, handleResult3, ZodType3, cuidRegex3, cuid2Regex3, ulidRegex3, uuidRegex3, emailRegex3, emojiRegex4, ipv4Regex3, ipv6Regex3, datetimeRegex3, ZodString3, ZodNumber3, ZodBigInt3, ZodBoolean3, ZodDate3, ZodSymbol3, ZodUndefined3, ZodNull3, ZodAny3, ZodUnknown3, ZodNever3, ZodVoid3, ZodArray3, ZodObject3, ZodUnion3, getDiscriminator3, ZodDiscriminatedUnion3, ZodIntersection3, ZodTuple3, ZodRecord3, ZodMap3, ZodSet3, ZodFunction3, ZodLazy3, ZodLiteral3, ZodEnum3, ZodNativeEnum3, ZodPromise3, ZodEffects3, ZodOptional3, ZodNullable3, ZodDefault3, ZodCatch3, ZodNaN3, BRAND3, ZodBranded3, ZodPipeline3, ZodReadonly3, custom3, late3, ZodFirstPartyTypeKind3, instanceOfType3, stringType3, numberType3, nanType3, bigIntType3, booleanType3, dateType3, symbolType3, undefinedType3, nullType3, anyType3, unknownType3, neverType3, voidType3, arrayType3, objectType3, strictObjectType3, unionType3, discriminatedUnionType3, intersectionType3, tupleType3, recordType3, mapType3, setType3, functionType3, lazyType3, literalType3, enumType3, nativeEnumType3, promiseType3, effectsType3, optionalType3, nullableType3, preprocessType3, pipelineType3, ostring3, onumber3, oboolean3, coerce3, NEVER3, z4;
var init_lib5 = __esm({
  "../../node_modules/.pnpm/zod@3.22.3/node_modules/zod/lib/index.mjs"() {
    init_import_meta_url();
    (function(util5) {
      util5.assertEqual = (val2) => val2;
      function assertIs(_arg) {
      }
      __name(assertIs, "assertIs");
      util5.assertIs = assertIs;
      function assertNever4(_x2) {
        throw new Error();
      }
      __name(assertNever4, "assertNever");
      util5.assertNever = assertNever4;
      util5.arrayToEnum = (items) => {
        const obj = {};
        for (const item of items) {
          obj[item] = item;
        }
        return obj;
      };
      util5.getValidEnumValues = (obj) => {
        const validKeys = util5.objectKeys(obj).filter((k7) => typeof obj[obj[k7]] !== "number");
        const filtered = {};
        for (const k7 of validKeys) {
          filtered[k7] = obj[k7];
        }
        return util5.objectValues(filtered);
      };
      util5.objectValues = (obj) => {
        return util5.objectKeys(obj).map(function(e10) {
          return obj[e10];
        });
      };
      util5.objectKeys = typeof Object.keys === "function" ? (obj) => Object.keys(obj) : (object) => {
        const keys = [];
        for (const key in object) {
          if (Object.prototype.hasOwnProperty.call(object, key)) {
            keys.push(key);
          }
        }
        return keys;
      };
      util5.find = (arr, checker) => {
        for (const item of arr) {
          if (checker(item))
            return item;
        }
        return void 0;
      };
      util5.isInteger = typeof Number.isInteger === "function" ? (val2) => Number.isInteger(val2) : (val2) => typeof val2 === "number" && isFinite(val2) && Math.floor(val2) === val2;
      function joinValues(array, separator = " | ") {
        return array.map((val2) => typeof val2 === "string" ? `'${val2}'` : val2).join(separator);
      }
      __name(joinValues, "joinValues");
      util5.joinValues = joinValues;
      util5.jsonStringifyReplacer = (_5, value) => {
        if (typeof value === "bigint") {
          return value.toString();
        }
        return value;
      };
    })(util3 || (util3 = {}));
    (function(objectUtil4) {
      objectUtil4.mergeShapes = (first, second) => {
        return {
          ...first,
          ...second
          // second overwrites first
        };
      };
    })(objectUtil3 || (objectUtil3 = {}));
    ZodParsedType3 = util3.arrayToEnum([
      "string",
      "nan",
      "number",
      "integer",
      "float",
      "boolean",
      "date",
      "bigint",
      "symbol",
      "function",
      "undefined",
      "null",
      "array",
      "object",
      "unknown",
      "promise",
      "void",
      "never",
      "map",
      "set"
    ]);
    getParsedType3 = /* @__PURE__ */ __name((data) => {
      const t13 = typeof data;
      switch (t13) {
        case "undefined":
          return ZodParsedType3.undefined;
        case "string":
          return ZodParsedType3.string;
        case "number":
          return isNaN(data) ? ZodParsedType3.nan : ZodParsedType3.number;
        case "boolean":
          return ZodParsedType3.boolean;
        case "function":
          return ZodParsedType3.function;
        case "bigint":
          return ZodParsedType3.bigint;
        case "symbol":
          return ZodParsedType3.symbol;
        case "object":
          if (Array.isArray(data)) {
            return ZodParsedType3.array;
          }
          if (data === null) {
            return ZodParsedType3.null;
          }
          if (data.then && typeof data.then === "function" && data.catch && typeof data.catch === "function") {
            return ZodParsedType3.promise;
          }
          if (typeof Map !== "undefined" && data instanceof Map) {
            return ZodParsedType3.map;
          }
          if (typeof Set !== "undefined" && data instanceof Set) {
            return ZodParsedType3.set;
          }
          if (typeof Date !== "undefined" && data instanceof Date) {
            return ZodParsedType3.date;
          }
          return ZodParsedType3.object;
        default:
          return ZodParsedType3.unknown;
      }
    }, "getParsedType");
    ZodIssueCode3 = util3.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"
    ]);
    quotelessJson3 = /* @__PURE__ */ __name((obj) => {
      const json = JSON.stringify(obj, null, 2);
      return json.replace(/"([^"]+)":/g, "$1:");
    }, "quotelessJson");
    ZodError3 = class extends Error {
      static {
        __name(this, "ZodError");
      }
      constructor(issues) {
        super();
        this.issues = [];
        this.addIssue = (sub) => {
          this.issues = [...this.issues, sub];
        };
        this.addIssues = (subs = []) => {
          this.issues = [...this.issues, ...subs];
        };
        const actualProto = new.target.prototype;
        if (Object.setPrototypeOf) {
          Object.setPrototypeOf(this, actualProto);
        } else {
          this.__proto__ = actualProto;
        }
        this.name = "ZodError";
        this.issues = issues;
      }
      get errors() {
        return this.issues;
      }
      format(_mapper) {
        const mapper = _mapper || function(issue) {
          return issue.message;
        };
        const fieldErrors = { _errors: [] };
        const processError = /* @__PURE__ */ __name((error2) => {
          for (const issue of error2.issues) {
            if (issue.code === "invalid_union") {
              issue.unionErrors.map(processError);
            } else if (issue.code === "invalid_return_type") {
              processError(issue.returnTypeError);
            } else if (issue.code === "invalid_arguments") {
              processError(issue.argumentsError);
            } else if (issue.path.length === 0) {
              fieldErrors._errors.push(mapper(issue));
            } else {
              let curr = fieldErrors;
              let i7 = 0;
              while (i7 < issue.path.length) {
                const el = issue.path[i7];
                const terminal = i7 === issue.path.length - 1;
                if (!terminal) {
                  curr[el] = curr[el] || { _errors: [] };
                } else {
                  curr[el] = curr[el] || { _errors: [] };
                  curr[el]._errors.push(mapper(issue));
                }
                curr = curr[el];
                i7++;
              }
            }
          }
        }, "processError");
        processError(this);
        return fieldErrors;
      }
      toString() {
        return this.message;
      }
      get message() {
        return JSON.stringify(this.issues, util3.jsonStringifyReplacer, 2);
      }
      get isEmpty() {
        return this.issues.length === 0;
      }
      flatten(mapper = (issue) => issue.message) {
        const fieldErrors = {};
        const formErrors = [];
        for (const sub of this.issues) {
          if (sub.path.length > 0) {
            fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || [];
            fieldErrors[sub.path[0]].push(mapper(sub));
          } else {
            formErrors.push(mapper(sub));
          }
        }
        return { formErrors, fieldErrors };
      }
      get formErrors() {
        return this.flatten();
      }
    };
    ZodError3.create = (issues) => {
      const error2 = new ZodError3(issues);
      return error2;
    };
    errorMap3 = /* @__PURE__ */ __name((issue, _ctx) => {
      let message;
      switch (issue.code) {
        case ZodIssueCode3.invalid_type:
          if (issue.received === ZodParsedType3.undefined) {
            message = "Required";
          } else {
            message = `Expected ${issue.expected}, received ${issue.received}`;
          }
          break;
        case ZodIssueCode3.invalid_literal:
          message = `Invalid literal value, expected ${JSON.stringify(issue.expected, util3.jsonStringifyReplacer)}`;
          break;
        case ZodIssueCode3.unrecognized_keys:
          message = `Unrecognized key(s) in object: ${util3.joinValues(issue.keys, ", ")}`;
          break;
        case ZodIssueCode3.invalid_union:
          message = `Invalid input`;
          break;
        case ZodIssueCode3.invalid_union_discriminator:
          message = `Invalid discriminator value. Expected ${util3.joinValues(issue.options)}`;
          break;
        case ZodIssueCode3.invalid_enum_value:
          message = `Invalid enum value. Expected ${util3.joinValues(issue.options)}, received '${issue.received}'`;
          break;
        case ZodIssueCode3.invalid_arguments:
          message = `Invalid function arguments`;
          break;
        case ZodIssueCode3.invalid_return_type:
          message = `Invalid function return type`;
          break;
        case ZodIssueCode3.invalid_date:
          message = `Invalid date`;
          break;
        case ZodIssueCode3.invalid_string:
          if (typeof issue.validation === "object") {
            if ("includes" in issue.validation) {
              message = `Invalid input: must include "${issue.validation.includes}"`;
              if (typeof issue.validation.position === "number") {
                message = `${message} at one or more positions greater than or equal to ${issue.validation.position}`;
              }
            } else if ("startsWith" in issue.validation) {
              message = `Invalid input: must start with "${issue.validation.startsWith}"`;
            } else if ("endsWith" in issue.validation) {
              message = `Invalid input: must end with "${issue.validation.endsWith}"`;
            } else {
              util3.assertNever(issue.validation);
            }
          } else if (issue.validation !== "regex") {
            message = `Invalid ${issue.validation}`;
          } else {
            message = "Invalid";
          }
          break;
        case ZodIssueCode3.too_small:
          if (issue.type === "array")
            message = `Array must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `more than`} ${issue.minimum} element(s)`;
          else if (issue.type === "string")
            message = `String must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`;
          else if (issue.type === "number")
            message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;
          else if (issue.type === "date")
            message = `Date must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${new Date(Number(issue.minimum))}`;
          else
            message = "Invalid input";
          break;
        case ZodIssueCode3.too_big:
          if (issue.type === "array")
            message = `Array must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `less than`} ${issue.maximum} element(s)`;
          else if (issue.type === "string")
            message = `String must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`;
          else if (issue.type === "number")
            message = `Number must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;
          else if (issue.type === "bigint")
            message = `BigInt must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;
          else if (issue.type === "date")
            message = `Date must be ${issue.exact ? `exactly` : issue.inclusive ? `smaller than or equal to` : `smaller than`} ${new Date(Number(issue.maximum))}`;
          else
            message = "Invalid input";
          break;
        case ZodIssueCode3.custom:
          message = `Invalid input`;
          break;
        case ZodIssueCode3.invalid_intersection_types:
          message = `Intersection results could not be merged`;
          break;
        case ZodIssueCode3.not_multiple_of:
          message = `Number must be a multiple of ${issue.multipleOf}`;
          break;
        case ZodIssueCode3.not_finite:
          message = "Number must be finite";
          break;
        default:
          message = _ctx.defaultError;
          util3.assertNever(issue);
      }
      return { message };
    }, "errorMap");
    overrideErrorMap3 = errorMap3;
    __name(setErrorMap3, "setErrorMap");
    __name(getErrorMap3, "getErrorMap");
    makeIssue3 = /* @__PURE__ */ __name((params) => {
      const { data, path: path84, errorMaps, issueData } = params;
      const fullPath = [...path84, ...issueData.path || []];
      const fullIssue = {
        ...issueData,
        path: fullPath
      };
      let errorMessage = "";
      const maps = errorMaps.filter((m7) => !!m7).slice().reverse();
      for (const map2 of maps) {
        errorMessage = map2(fullIssue, { data, defaultError: errorMessage }).message;
      }
      return {
        ...issueData,
        path: fullPath,
        message: issueData.message || errorMessage
      };
    }, "makeIssue");
    EMPTY_PATH3 = [];
    __name(addIssueToContext3, "addIssueToContext");
    ParseStatus3 = class _ParseStatus2 {
      static {
        __name(this, "ParseStatus");
      }
      constructor() {
        this.value = "valid";
      }
      dirty() {
        if (this.value === "valid")
          this.value = "dirty";
      }
      abort() {
        if (this.value !== "aborted")
          this.value = "aborted";
      }
      static mergeArray(status2, results) {
        const arrayValue = [];
        for (const s7 of results) {
          if (s7.status === "aborted")
            return INVALID3;
          if (s7.status === "dirty")
            status2.dirty();
          arrayValue.push(s7.value);
        }
        return { status: status2.value, value: arrayValue };
      }
      static async mergeObjectAsync(status2, pairs) {
        const syncPairs = [];
        for (const pair of pairs) {
          syncPairs.push({
            key: await pair.key,
            value: await pair.value
          });
        }
        return _ParseStatus2.mergeObjectSync(status2, syncPairs);
      }
      static mergeObjectSync(status2, pairs) {
        const finalObject = {};
        for (const pair of pairs) {
          const { key, value } = pair;
          if (key.status === "aborted")
            return INVALID3;
          if (value.status === "aborted")
            return INVALID3;
          if (key.status === "dirty")
            status2.dirty();
          if (value.status === "dirty")
            status2.dirty();
          if (key.value !== "__proto__" && (typeof value.value !== "undefined" || pair.alwaysSet)) {
            finalObject[key.value] = value.value;
          }
        }
        return { status: status2.value, value: finalObject };
      }
    };
    INVALID3 = Object.freeze({
      status: "aborted"
    });
    DIRTY3 = /* @__PURE__ */ __name((value) => ({ status: "dirty", value }), "DIRTY");
    OK3 = /* @__PURE__ */ __name((value) => ({ status: "valid", value }), "OK");
    isAborted3 = /* @__PURE__ */ __name((x7) => x7.status === "aborted", "isAborted");
    isDirty3 = /* @__PURE__ */ __name((x7) => x7.status === "dirty", "isDirty");
    isValid3 = /* @__PURE__ */ __name((x7) => x7.status === "valid", "isValid");
    isAsync3 = /* @__PURE__ */ __name((x7) => typeof Promise !== "undefined" && x7 instanceof Promise, "isAsync");
    (function(errorUtil4) {
      errorUtil4.errToObj = (message) => typeof message === "string" ? { message } : message || {};
      errorUtil4.toString = (message) => typeof message === "string" ? message : message === null || message === void 0 ? void 0 : message.message;
    })(errorUtil3 || (errorUtil3 = {}));
    ParseInputLazyPath3 = class {
      static {
        __name(this, "ParseInputLazyPath");
      }
      constructor(parent, value, path84, key) {
        this._cachedPath = [];
        this.parent = parent;
        this.data = value;
        this._path = path84;
        this._key = key;
      }
      get path() {
        if (!this._cachedPath.length) {
          if (this._key instanceof Array) {
            this._cachedPath.push(...this._path, ...this._key);
          } else {
            this._cachedPath.push(...this._path, this._key);
          }
        }
        return this._cachedPath;
      }
    };
    handleResult3 = /* @__PURE__ */ __name((ctx, result) => {
      if (isValid3(result)) {
        return { success: true, data: result.value };
      } else {
        if (!ctx.common.issues.length) {
          throw new Error("Validation failed but no issues detected.");
        }
        return {
          success: false,
          get error() {
            if (this._error)
              return this._error;
            const error2 = new ZodError3(ctx.common.issues);
            this._error = error2;
            return this._error;
          }
        };
      }
    }, "handleResult");
    __name(processCreateParams3, "processCreateParams");
    ZodType3 = class {
      static {
        __name(this, "ZodType");
      }
      constructor(def) {
        this.spa = this.safeParseAsync;
        this._def = def;
        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);
      }
      get description() {
        return this._def.description;
      }
      _getType(input) {
        return getParsedType3(input.data);
      }
      _getOrReturnCtx(input, ctx) {
        return ctx || {
          common: input.parent.common,
          data: input.data,
          parsedType: getParsedType3(input.data),
          schemaErrorMap: this._def.errorMap,
          path: input.path,
          parent: input.parent
        };
      }
      _processInputParams(input) {
        return {
          status: new ParseStatus3(),
          ctx: {
            common: input.parent.common,
            data: input.data,
            parsedType: getParsedType3(input.data),
            schemaErrorMap: this._def.errorMap,
            path: input.path,
            parent: input.parent
          }
        };
      }
      _parseSync(input) {
        const result = this._parse(input);
        if (isAsync3(result)) {
          throw new Error("Synchronous parse encountered promise.");
        }
        return result;
      }
      _parseAsync(input) {
        const result = this._parse(input);
        return Promise.resolve(result);
      }
      parse(data, params) {
        const result = this.safeParse(data, params);
        if (result.success)
          return result.data;
        throw result.error;
      }
      safeParse(data, params) {
        var _a5;
        const ctx = {
          common: {
            issues: [],
            async: (_a5 = params === null || params === void 0 ? void 0 : params.async) !== null && _a5 !== void 0 ? _a5 : false,
            contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap
          },
          path: (params === null || params === void 0 ? void 0 : params.path) || [],
          schemaErrorMap: this._def.errorMap,
          parent: null,
          data,
          parsedType: getParsedType3(data)
        };
        const result = this._parseSync({ data, path: ctx.path, parent: ctx });
        return handleResult3(ctx, result);
      }
      async parseAsync(data, params) {
        const result = await this.safeParseAsync(data, params);
        if (result.success)
          return result.data;
        throw result.error;
      }
      async safeParseAsync(data, params) {
        const ctx = {
          common: {
            issues: [],
            contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap,
            async: true
          },
          path: (params === null || params === void 0 ? void 0 : params.path) || [],
          schemaErrorMap: this._def.errorMap,
          parent: null,
          data,
          parsedType: getParsedType3(data)
        };
        const maybeAsyncResult2 = this._parse({ data, path: ctx.path, parent: ctx });
        const result = await (isAsync3(maybeAsyncResult2) ? maybeAsyncResult2 : Promise.resolve(maybeAsyncResult2));
        return handleResult3(ctx, result);
      }
      refine(check, message) {
        const getIssueProperties = /* @__PURE__ */ __name((val2) => {
          if (typeof message === "string" || typeof message === "undefined") {
            return { message };
          } else if (typeof message === "function") {
            return message(val2);
          } else {
            return message;
          }
        }, "getIssueProperties");
        return this._refinement((val2, ctx) => {
          const result = check(val2);
          const setError = /* @__PURE__ */ __name(() => ctx.addIssue({
            code: ZodIssueCode3.custom,
            ...getIssueProperties(val2)
          }), "setError");
          if (typeof Promise !== "undefined" && result instanceof Promise) {
            return result.then((data) => {
              if (!data) {
                setError();
                return false;
              } else {
                return true;
              }
            });
          }
          if (!result) {
            setError();
            return false;
          } else {
            return true;
          }
        });
      }
      refinement(check, refinementData) {
        return this._refinement((val2, ctx) => {
          if (!check(val2)) {
            ctx.addIssue(typeof refinementData === "function" ? refinementData(val2, ctx) : refinementData);
            return false;
          } else {
            return true;
          }
        });
      }
      _refinement(refinement) {
        return new ZodEffects3({
          schema: this,
          typeName: ZodFirstPartyTypeKind3.ZodEffects,
          effect: { type: "refinement", refinement }
        });
      }
      superRefine(refinement) {
        return this._refinement(refinement);
      }
      optional() {
        return ZodOptional3.create(this, this._def);
      }
      nullable() {
        return ZodNullable3.create(this, this._def);
      }
      nullish() {
        return this.nullable().optional();
      }
      array() {
        return ZodArray3.create(this, this._def);
      }
      promise() {
        return ZodPromise3.create(this, this._def);
      }
      or(option) {
        return ZodUnion3.create([this, option], this._def);
      }
      and(incoming) {
        return ZodIntersection3.create(this, incoming, this._def);
      }
      transform(transform) {
        return new ZodEffects3({
          ...processCreateParams3(this._def),
          schema: this,
          typeName: ZodFirstPartyTypeKind3.ZodEffects,
          effect: { type: "transform", transform }
        });
      }
      default(def) {
        const defaultValueFunc = typeof def === "function" ? def : () => def;
        return new ZodDefault3({
          ...processCreateParams3(this._def),
          innerType: this,
          defaultValue: defaultValueFunc,
          typeName: ZodFirstPartyTypeKind3.ZodDefault
        });
      }
      brand() {
        return new ZodBranded3({
          typeName: ZodFirstPartyTypeKind3.ZodBranded,
          type: this,
          ...processCreateParams3(this._def)
        });
      }
      catch(def) {
        const catchValueFunc = typeof def === "function" ? def : () => def;
        return new ZodCatch3({
          ...processCreateParams3(this._def),
          innerType: this,
          catchValue: catchValueFunc,
          typeName: ZodFirstPartyTypeKind3.ZodCatch
        });
      }
      describe(description) {
        const This = this.constructor;
        return new This({
          ...this._def,
          description
        });
      }
      pipe(target) {
        return ZodPipeline3.create(this, target);
      }
      readonly() {
        return ZodReadonly3.create(this);
      }
      isOptional() {
        return this.safeParse(void 0).success;
      }
      isNullable() {
        return this.safeParse(null).success;
      }
    };
    cuidRegex3 = /^c[^\s-]{8,}$/i;
    cuid2Regex3 = /^[a-z][a-z0-9]*$/;
    ulidRegex3 = /[0-9A-HJKMNP-TV-Z]{26}/;
    uuidRegex3 = /^[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;
    emailRegex3 = /^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;
    emojiRegex4 = /^(\p{Extended_Pictographic}|\p{Emoji_Component})+$/u;
    ipv4Regex3 = /^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/;
    ipv6Regex3 = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/;
    datetimeRegex3 = /* @__PURE__ */ __name((args) => {
      if (args.precision) {
        if (args.offset) {
          return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`);
        } else {
          return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}Z$`);
        }
      } else if (args.precision === 0) {
        if (args.offset) {
          return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$`);
        } else {
          return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$`);
        }
      } else {
        if (args.offset) {
          return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$`);
        } else {
          return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$`);
        }
      }
    }, "datetimeRegex");
    __name(isValidIP3, "isValidIP");
    ZodString3 = class _ZodString2 extends ZodType3 {
      static {
        __name(this, "ZodString");
      }
      constructor() {
        super(...arguments);
        this._regex = (regex2, validation2, message) => this.refinement((data) => regex2.test(data), {
          validation: validation2,
          code: ZodIssueCode3.invalid_string,
          ...errorUtil3.errToObj(message)
        });
        this.nonempty = (message) => this.min(1, errorUtil3.errToObj(message));
        this.trim = () => new _ZodString2({
          ...this._def,
          checks: [...this._def.checks, { kind: "trim" }]
        });
        this.toLowerCase = () => new _ZodString2({
          ...this._def,
          checks: [...this._def.checks, { kind: "toLowerCase" }]
        });
        this.toUpperCase = () => new _ZodString2({
          ...this._def,
          checks: [...this._def.checks, { kind: "toUpperCase" }]
        });
      }
      _parse(input) {
        if (this._def.coerce) {
          input.data = String(input.data);
        }
        const parsedType = this._getType(input);
        if (parsedType !== ZodParsedType3.string) {
          const ctx2 = this._getOrReturnCtx(input);
          addIssueToContext3(
            ctx2,
            {
              code: ZodIssueCode3.invalid_type,
              expected: ZodParsedType3.string,
              received: ctx2.parsedType
            }
            //
          );
          return INVALID3;
        }
        const status2 = new ParseStatus3();
        let ctx = void 0;
        for (const check of this._def.checks) {
          if (check.kind === "min") {
            if (input.data.length < check.value) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext3(ctx, {
                code: ZodIssueCode3.too_small,
                minimum: check.value,
                type: "string",
                inclusive: true,
                exact: false,
                message: check.message
              });
              status2.dirty();
            }
          } else if (check.kind === "max") {
            if (input.data.length > check.value) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext3(ctx, {
                code: ZodIssueCode3.too_big,
                maximum: check.value,
                type: "string",
                inclusive: true,
                exact: false,
                message: check.message
              });
              status2.dirty();
            }
          } else if (check.kind === "length") {
            const tooBig = input.data.length > check.value;
            const tooSmall = input.data.length < check.value;
            if (tooBig || tooSmall) {
              ctx = this._getOrReturnCtx(input, ctx);
              if (tooBig) {
                addIssueToContext3(ctx, {
                  code: ZodIssueCode3.too_big,
                  maximum: check.value,
                  type: "string",
                  inclusive: true,
                  exact: true,
                  message: check.message
                });
              } else if (tooSmall) {
                addIssueToContext3(ctx, {
                  code: ZodIssueCode3.too_small,
                  minimum: check.value,
                  type: "string",
                  inclusive: true,
                  exact: true,
                  message: check.message
                });
              }
              status2.dirty();
            }
          } else if (check.kind === "email") {
            if (!emailRegex3.test(input.data)) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext3(ctx, {
                validation: "email",
                code: ZodIssueCode3.invalid_string,
                message: check.message
              });
              status2.dirty();
            }
          } else if (check.kind === "emoji") {
            if (!emojiRegex4.test(input.data)) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext3(ctx, {
                validation: "emoji",
                code: ZodIssueCode3.invalid_string,
                message: check.message
              });
              status2.dirty();
            }
          } else if (check.kind === "uuid") {
            if (!uuidRegex3.test(input.data)) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext3(ctx, {
                validation: "uuid",
                code: ZodIssueCode3.invalid_string,
                message: check.message
              });
              status2.dirty();
            }
          } else if (check.kind === "cuid") {
            if (!cuidRegex3.test(input.data)) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext3(ctx, {
                validation: "cuid",
                code: ZodIssueCode3.invalid_string,
                message: check.message
              });
              status2.dirty();
            }
          } else if (check.kind === "cuid2") {
            if (!cuid2Regex3.test(input.data)) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext3(ctx, {
                validation: "cuid2",
                code: ZodIssueCode3.invalid_string,
                message: check.message
              });
              status2.dirty();
            }
          } else if (check.kind === "ulid") {
            if (!ulidRegex3.test(input.data)) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext3(ctx, {
                validation: "ulid",
                code: ZodIssueCode3.invalid_string,
                message: check.message
              });
              status2.dirty();
            }
          } else if (check.kind === "url") {
            try {
              new URL(input.data);
            } catch (_a5) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext3(ctx, {
                validation: "url",
                code: ZodIssueCode3.invalid_string,
                message: check.message
              });
              status2.dirty();
            }
          } else if (check.kind === "regex") {
            check.regex.lastIndex = 0;
            const testResult = check.regex.test(input.data);
            if (!testResult) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext3(ctx, {
                validation: "regex",
                code: ZodIssueCode3.invalid_string,
                message: check.message
              });
              status2.dirty();
            }
          } else if (check.kind === "trim") {
            input.data = input.data.trim();
          } else if (check.kind === "includes") {
            if (!input.data.includes(check.value, check.position)) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext3(ctx, {
                code: ZodIssueCode3.invalid_string,
                validation: { includes: check.value, position: check.position },
                message: check.message
              });
              status2.dirty();
            }
          } else if (check.kind === "toLowerCase") {
            input.data = input.data.toLowerCase();
          } else if (check.kind === "toUpperCase") {
            input.data = input.data.toUpperCase();
          } else if (check.kind === "startsWith") {
            if (!input.data.startsWith(check.value)) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext3(ctx, {
                code: ZodIssueCode3.invalid_string,
                validation: { startsWith: check.value },
                message: check.message
              });
              status2.dirty();
            }
          } else if (check.kind === "endsWith") {
            if (!input.data.endsWith(check.value)) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext3(ctx, {
                code: ZodIssueCode3.invalid_string,
                validation: { endsWith: check.value },
                message: check.message
              });
              status2.dirty();
            }
          } else if (check.kind === "datetime") {
            const regex2 = datetimeRegex3(check);
            if (!regex2.test(input.data)) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext3(ctx, {
                code: ZodIssueCode3.invalid_string,
                validation: "datetime",
                message: check.message
              });
              status2.dirty();
            }
          } else if (check.kind === "ip") {
            if (!isValidIP3(input.data, check.version)) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext3(ctx, {
                validation: "ip",
                code: ZodIssueCode3.invalid_string,
                message: check.message
              });
              status2.dirty();
            }
          } else {
            util3.assertNever(check);
          }
        }
        return { status: status2.value, value: input.data };
      }
      _addCheck(check) {
        return new _ZodString2({
          ...this._def,
          checks: [...this._def.checks, check]
        });
      }
      email(message) {
        return this._addCheck({ kind: "email", ...errorUtil3.errToObj(message) });
      }
      url(message) {
        return this._addCheck({ kind: "url", ...errorUtil3.errToObj(message) });
      }
      emoji(message) {
        return this._addCheck({ kind: "emoji", ...errorUtil3.errToObj(message) });
      }
      uuid(message) {
        return this._addCheck({ kind: "uuid", ...errorUtil3.errToObj(message) });
      }
      cuid(message) {
        return this._addCheck({ kind: "cuid", ...errorUtil3.errToObj(message) });
      }
      cuid2(message) {
        return this._addCheck({ kind: "cuid2", ...errorUtil3.errToObj(message) });
      }
      ulid(message) {
        return this._addCheck({ kind: "ulid", ...errorUtil3.errToObj(message) });
      }
      ip(options) {
        return this._addCheck({ kind: "ip", ...errorUtil3.errToObj(options) });
      }
      datetime(options) {
        var _a5;
        if (typeof options === "string") {
          return this._addCheck({
            kind: "datetime",
            precision: null,
            offset: false,
            message: options
          });
        }
        return this._addCheck({
          kind: "datetime",
          precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision,
          offset: (_a5 = options === null || options === void 0 ? void 0 : options.offset) !== null && _a5 !== void 0 ? _a5 : false,
          ...errorUtil3.errToObj(options === null || options === void 0 ? void 0 : options.message)
        });
      }
      regex(regex2, message) {
        return this._addCheck({
          kind: "regex",
          regex: regex2,
          ...errorUtil3.errToObj(message)
        });
      }
      includes(value, options) {
        return this._addCheck({
          kind: "includes",
          value,
          position: options === null || options === void 0 ? void 0 : options.position,
          ...errorUtil3.errToObj(options === null || options === void 0 ? void 0 : options.message)
        });
      }
      startsWith(value, message) {
        return this._addCheck({
          kind: "startsWith",
          value,
          ...errorUtil3.errToObj(message)
        });
      }
      endsWith(value, message) {
        return this._addCheck({
          kind: "endsWith",
          value,
          ...errorUtil3.errToObj(message)
        });
      }
      min(minLength, message) {
        return this._addCheck({
          kind: "min",
          value: minLength,
          ...errorUtil3.errToObj(message)
        });
      }
      max(maxLength, message) {
        return this._addCheck({
          kind: "max",
          value: maxLength,
          ...errorUtil3.errToObj(message)
        });
      }
      length(len, message) {
        return this._addCheck({
          kind: "length",
          value: len,
          ...errorUtil3.errToObj(message)
        });
      }
      get isDatetime() {
        return !!this._def.checks.find((ch2) => ch2.kind === "datetime");
      }
      get isEmail() {
        return !!this._def.checks.find((ch2) => ch2.kind === "email");
      }
      get isURL() {
        return !!this._def.checks.find((ch2) => ch2.kind === "url");
      }
      get isEmoji() {
        return !!this._def.checks.find((ch2) => ch2.kind === "emoji");
      }
      get isUUID() {
        return !!this._def.checks.find((ch2) => ch2.kind === "uuid");
      }
      get isCUID() {
        return !!this._def.checks.find((ch2) => ch2.kind === "cuid");
      }
      get isCUID2() {
        return !!this._def.checks.find((ch2) => ch2.kind === "cuid2");
      }
      get isULID() {
        return !!this._def.checks.find((ch2) => ch2.kind === "ulid");
      }
      get isIP() {
        return !!this._def.checks.find((ch2) => ch2.kind === "ip");
      }
      get minLength() {
        let min = null;
        for (const ch2 of this._def.checks) {
          if (ch2.kind === "min") {
            if (min === null || ch2.value > min)
              min = ch2.value;
          }
        }
        return min;
      }
      get maxLength() {
        let max = null;
        for (const ch2 of this._def.checks) {
          if (ch2.kind === "max") {
            if (max === null || ch2.value < max)
              max = ch2.value;
          }
        }
        return max;
      }
    };
    ZodString3.create = (params) => {
      var _a5;
      return new ZodString3({
        checks: [],
        typeName: ZodFirstPartyTypeKind3.ZodString,
        coerce: (_a5 = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a5 !== void 0 ? _a5 : false,
        ...processCreateParams3(params)
      });
    };
    __name(floatSafeRemainder3, "floatSafeRemainder");
    ZodNumber3 = class _ZodNumber2 extends ZodType3 {
      static {
        __name(this, "ZodNumber");
      }
      constructor() {
        super(...arguments);
        this.min = this.gte;
        this.max = this.lte;
        this.step = this.multipleOf;
      }
      _parse(input) {
        if (this._def.coerce) {
          input.data = Number(input.data);
        }
        const parsedType = this._getType(input);
        if (parsedType !== ZodParsedType3.number) {
          const ctx2 = this._getOrReturnCtx(input);
          addIssueToContext3(ctx2, {
            code: ZodIssueCode3.invalid_type,
            expected: ZodParsedType3.number,
            received: ctx2.parsedType
          });
          return INVALID3;
        }
        let ctx = void 0;
        const status2 = new ParseStatus3();
        for (const check of this._def.checks) {
          if (check.kind === "int") {
            if (!util3.isInteger(input.data)) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext3(ctx, {
                code: ZodIssueCode3.invalid_type,
                expected: "integer",
                received: "float",
                message: check.message
              });
              status2.dirty();
            }
          } else if (check.kind === "min") {
            const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value;
            if (tooSmall) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext3(ctx, {
                code: ZodIssueCode3.too_small,
                minimum: check.value,
                type: "number",
                inclusive: check.inclusive,
                exact: false,
                message: check.message
              });
              status2.dirty();
            }
          } else if (check.kind === "max") {
            const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value;
            if (tooBig) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext3(ctx, {
                code: ZodIssueCode3.too_big,
                maximum: check.value,
                type: "number",
                inclusive: check.inclusive,
                exact: false,
                message: check.message
              });
              status2.dirty();
            }
          } else if (check.kind === "multipleOf") {
            if (floatSafeRemainder3(input.data, check.value) !== 0) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext3(ctx, {
                code: ZodIssueCode3.not_multiple_of,
                multipleOf: check.value,
                message: check.message
              });
              status2.dirty();
            }
          } else if (check.kind === "finite") {
            if (!Number.isFinite(input.data)) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext3(ctx, {
                code: ZodIssueCode3.not_finite,
                message: check.message
              });
              status2.dirty();
            }
          } else {
            util3.assertNever(check);
          }
        }
        return { status: status2.value, value: input.data };
      }
      gte(value, message) {
        return this.setLimit("min", value, true, errorUtil3.toString(message));
      }
      gt(value, message) {
        return this.setLimit("min", value, false, errorUtil3.toString(message));
      }
      lte(value, message) {
        return this.setLimit("max", value, true, errorUtil3.toString(message));
      }
      lt(value, message) {
        return this.setLimit("max", value, false, errorUtil3.toString(message));
      }
      setLimit(kind2, value, inclusive, message) {
        return new _ZodNumber2({
          ...this._def,
          checks: [
            ...this._def.checks,
            {
              kind: kind2,
              value,
              inclusive,
              message: errorUtil3.toString(message)
            }
          ]
        });
      }
      _addCheck(check) {
        return new _ZodNumber2({
          ...this._def,
          checks: [...this._def.checks, check]
        });
      }
      int(message) {
        return this._addCheck({
          kind: "int",
          message: errorUtil3.toString(message)
        });
      }
      positive(message) {
        return this._addCheck({
          kind: "min",
          value: 0,
          inclusive: false,
          message: errorUtil3.toString(message)
        });
      }
      negative(message) {
        return this._addCheck({
          kind: "max",
          value: 0,
          inclusive: false,
          message: errorUtil3.toString(message)
        });
      }
      nonpositive(message) {
        return this._addCheck({
          kind: "max",
          value: 0,
          inclusive: true,
          message: errorUtil3.toString(message)
        });
      }
      nonnegative(message) {
        return this._addCheck({
          kind: "min",
          value: 0,
          inclusive: true,
          message: errorUtil3.toString(message)
        });
      }
      multipleOf(value, message) {
        return this._addCheck({
          kind: "multipleOf",
          value,
          message: errorUtil3.toString(message)
        });
      }
      finite(message) {
        return this._addCheck({
          kind: "finite",
          message: errorUtil3.toString(message)
        });
      }
      safe(message) {
        return this._addCheck({
          kind: "min",
          inclusive: true,
          value: Number.MIN_SAFE_INTEGER,
          message: errorUtil3.toString(message)
        })._addCheck({
          kind: "max",
          inclusive: true,
          value: Number.MAX_SAFE_INTEGER,
          message: errorUtil3.toString(message)
        });
      }
      get minValue() {
        let min = null;
        for (const ch2 of this._def.checks) {
          if (ch2.kind === "min") {
            if (min === null || ch2.value > min)
              min = ch2.value;
          }
        }
        return min;
      }
      get maxValue() {
        let max = null;
        for (const ch2 of this._def.checks) {
          if (ch2.kind === "max") {
            if (max === null || ch2.value < max)
              max = ch2.value;
          }
        }
        return max;
      }
      get isInt() {
        return !!this._def.checks.find((ch2) => ch2.kind === "int" || ch2.kind === "multipleOf" && util3.isInteger(ch2.value));
      }
      get isFinite() {
        let max = null, min = null;
        for (const ch2 of this._def.checks) {
          if (ch2.kind === "finite" || ch2.kind === "int" || ch2.kind === "multipleOf") {
            return true;
          } else if (ch2.kind === "min") {
            if (min === null || ch2.value > min)
              min = ch2.value;
          } else if (ch2.kind === "max") {
            if (max === null || ch2.value < max)
              max = ch2.value;
          }
        }
        return Number.isFinite(min) && Number.isFinite(max);
      }
    };
    ZodNumber3.create = (params) => {
      return new ZodNumber3({
        checks: [],
        typeName: ZodFirstPartyTypeKind3.ZodNumber,
        coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,
        ...processCreateParams3(params)
      });
    };
    ZodBigInt3 = class _ZodBigInt2 extends ZodType3 {
      static {
        __name(this, "ZodBigInt");
      }
      constructor() {
        super(...arguments);
        this.min = this.gte;
        this.max = this.lte;
      }
      _parse(input) {
        if (this._def.coerce) {
          input.data = BigInt(input.data);
        }
        const parsedType = this._getType(input);
        if (parsedType !== ZodParsedType3.bigint) {
          const ctx2 = this._getOrReturnCtx(input);
          addIssueToContext3(ctx2, {
            code: ZodIssueCode3.invalid_type,
            expected: ZodParsedType3.bigint,
            received: ctx2.parsedType
          });
          return INVALID3;
        }
        let ctx = void 0;
        const status2 = new ParseStatus3();
        for (const check of this._def.checks) {
          if (check.kind === "min") {
            const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value;
            if (tooSmall) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext3(ctx, {
                code: ZodIssueCode3.too_small,
                type: "bigint",
                minimum: check.value,
                inclusive: check.inclusive,
                message: check.message
              });
              status2.dirty();
            }
          } else if (check.kind === "max") {
            const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value;
            if (tooBig) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext3(ctx, {
                code: ZodIssueCode3.too_big,
                type: "bigint",
                maximum: check.value,
                inclusive: check.inclusive,
                message: check.message
              });
              status2.dirty();
            }
          } else if (check.kind === "multipleOf") {
            if (input.data % check.value !== BigInt(0)) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext3(ctx, {
                code: ZodIssueCode3.not_multiple_of,
                multipleOf: check.value,
                message: check.message
              });
              status2.dirty();
            }
          } else {
            util3.assertNever(check);
          }
        }
        return { status: status2.value, value: input.data };
      }
      gte(value, message) {
        return this.setLimit("min", value, true, errorUtil3.toString(message));
      }
      gt(value, message) {
        return this.setLimit("min", value, false, errorUtil3.toString(message));
      }
      lte(value, message) {
        return this.setLimit("max", value, true, errorUtil3.toString(message));
      }
      lt(value, message) {
        return this.setLimit("max", value, false, errorUtil3.toString(message));
      }
      setLimit(kind2, value, inclusive, message) {
        return new _ZodBigInt2({
          ...this._def,
          checks: [
            ...this._def.checks,
            {
              kind: kind2,
              value,
              inclusive,
              message: errorUtil3.toString(message)
            }
          ]
        });
      }
      _addCheck(check) {
        return new _ZodBigInt2({
          ...this._def,
          checks: [...this._def.checks, check]
        });
      }
      positive(message) {
        return this._addCheck({
          kind: "min",
          value: BigInt(0),
          inclusive: false,
          message: errorUtil3.toString(message)
        });
      }
      negative(message) {
        return this._addCheck({
          kind: "max",
          value: BigInt(0),
          inclusive: false,
          message: errorUtil3.toString(message)
        });
      }
      nonpositive(message) {
        return this._addCheck({
          kind: "max",
          value: BigInt(0),
          inclusive: true,
          message: errorUtil3.toString(message)
        });
      }
      nonnegative(message) {
        return this._addCheck({
          kind: "min",
          value: BigInt(0),
          inclusive: true,
          message: errorUtil3.toString(message)
        });
      }
      multipleOf(value, message) {
        return this._addCheck({
          kind: "multipleOf",
          value,
          message: errorUtil3.toString(message)
        });
      }
      get minValue() {
        let min = null;
        for (const ch2 of this._def.checks) {
          if (ch2.kind === "min") {
            if (min === null || ch2.value > min)
              min = ch2.value;
          }
        }
        return min;
      }
      get maxValue() {
        let max = null;
        for (const ch2 of this._def.checks) {
          if (ch2.kind === "max") {
            if (max === null || ch2.value < max)
              max = ch2.value;
          }
        }
        return max;
      }
    };
    ZodBigInt3.create = (params) => {
      var _a5;
      return new ZodBigInt3({
        checks: [],
        typeName: ZodFirstPartyTypeKind3.ZodBigInt,
        coerce: (_a5 = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a5 !== void 0 ? _a5 : false,
        ...processCreateParams3(params)
      });
    };
    ZodBoolean3 = class extends ZodType3 {
      static {
        __name(this, "ZodBoolean");
      }
      _parse(input) {
        if (this._def.coerce) {
          input.data = Boolean(input.data);
        }
        const parsedType = this._getType(input);
        if (parsedType !== ZodParsedType3.boolean) {
          const ctx = this._getOrReturnCtx(input);
          addIssueToContext3(ctx, {
            code: ZodIssueCode3.invalid_type,
            expected: ZodParsedType3.boolean,
            received: ctx.parsedType
          });
          return INVALID3;
        }
        return OK3(input.data);
      }
    };
    ZodBoolean3.create = (params) => {
      return new ZodBoolean3({
        typeName: ZodFirstPartyTypeKind3.ZodBoolean,
        coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,
        ...processCreateParams3(params)
      });
    };
    ZodDate3 = class _ZodDate2 extends ZodType3 {
      static {
        __name(this, "ZodDate");
      }
      _parse(input) {
        if (this._def.coerce) {
          input.data = new Date(input.data);
        }
        const parsedType = this._getType(input);
        if (parsedType !== ZodParsedType3.date) {
          const ctx2 = this._getOrReturnCtx(input);
          addIssueToContext3(ctx2, {
            code: ZodIssueCode3.invalid_type,
            expected: ZodParsedType3.date,
            received: ctx2.parsedType
          });
          return INVALID3;
        }
        if (isNaN(input.data.getTime())) {
          const ctx2 = this._getOrReturnCtx(input);
          addIssueToContext3(ctx2, {
            code: ZodIssueCode3.invalid_date
          });
          return INVALID3;
        }
        const status2 = new ParseStatus3();
        let ctx = void 0;
        for (const check of this._def.checks) {
          if (check.kind === "min") {
            if (input.data.getTime() < check.value) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext3(ctx, {
                code: ZodIssueCode3.too_small,
                message: check.message,
                inclusive: true,
                exact: false,
                minimum: check.value,
                type: "date"
              });
              status2.dirty();
            }
          } else if (check.kind === "max") {
            if (input.data.getTime() > check.value) {
              ctx = this._getOrReturnCtx(input, ctx);
              addIssueToContext3(ctx, {
                code: ZodIssueCode3.too_big,
                message: check.message,
                inclusive: true,
                exact: false,
                maximum: check.value,
                type: "date"
              });
              status2.dirty();
            }
          } else {
            util3.assertNever(check);
          }
        }
        return {
          status: status2.value,
          value: new Date(input.data.getTime())
        };
      }
      _addCheck(check) {
        return new _ZodDate2({
          ...this._def,
          checks: [...this._def.checks, check]
        });
      }
      min(minDate, message) {
        return this._addCheck({
          kind: "min",
          value: minDate.getTime(),
          message: errorUtil3.toString(message)
        });
      }
      max(maxDate, message) {
        return this._addCheck({
          kind: "max",
          value: maxDate.getTime(),
          message: errorUtil3.toString(message)
        });
      }
      get minDate() {
        let min = null;
        for (const ch2 of this._def.checks) {
          if (ch2.kind === "min") {
            if (min === null || ch2.value > min)
              min = ch2.value;
          }
        }
        return min != null ? new Date(min) : null;
      }
      get maxDate() {
        let max = null;
        for (const ch2 of this._def.checks) {
          if (ch2.kind === "max") {
            if (max === null || ch2.value < max)
              max = ch2.value;
          }
        }
        return max != null ? new Date(max) : null;
      }
    };
    ZodDate3.create = (params) => {
      return new ZodDate3({
        checks: [],
        coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,
        typeName: ZodFirstPartyTypeKind3.ZodDate,
        ...processCreateParams3(params)
      });
    };
    ZodSymbol3 = class extends ZodType3 {
      static {
        __name(this, "ZodSymbol");
      }
      _parse(input) {
        const parsedType = this._getType(input);
        if (parsedType !== ZodParsedType3.symbol) {
          const ctx = this._getOrReturnCtx(input);
          addIssueToContext3(ctx, {
            code: ZodIssueCode3.invalid_type,
            expected: ZodParsedType3.symbol,
            received: ctx.parsedType
          });
          return INVALID3;
        }
        return OK3(input.data);
      }
    };
    ZodSymbol3.create = (params) => {
      return new ZodSymbol3({
        typeName: ZodFirstPartyTypeKind3.ZodSymbol,
        ...processCreateParams3(params)
      });
    };
    ZodUndefined3 = class extends ZodType3 {
      static {
        __name(this, "ZodUndefined");
      }
      _parse(input) {
        const parsedType = this._getType(input);
        if (parsedType !== ZodParsedType3.undefined) {
          const ctx = this._getOrReturnCtx(input);
          addIssueToContext3(ctx, {
            code: ZodIssueCode3.invalid_type,
            expected: ZodParsedType3.undefined,
            received: ctx.parsedType
          });
          return INVALID3;
        }
        return OK3(input.data);
      }
    };
    ZodUndefined3.create = (params) => {
      return new ZodUndefined3({
        typeName: ZodFirstPartyTypeKind3.ZodUndefined,
        ...processCreateParams3(params)
      });
    };
    ZodNull3 = class extends ZodType3 {
      static {
        __name(this, "ZodNull");
      }
      _parse(input) {
        const parsedType = this._getType(input);
        if (parsedType !== ZodParsedType3.null) {
          const ctx = this._getOrReturnCtx(input);
          addIssueToContext3(ctx, {
            code: ZodIssueCode3.invalid_type,
            expected: ZodParsedType3.null,
            received: ctx.parsedType
          });
          return INVALID3;
        }
        return OK3(input.data);
      }
    };
    ZodNull3.create = (params) => {
      return new ZodNull3({
        typeName: ZodFirstPartyTypeKind3.ZodNull,
        ...processCreateParams3(params)
      });
    };
    ZodAny3 = class extends ZodType3 {
      static {
        __name(this, "ZodAny");
      }
      constructor() {
        super(...arguments);
        this._any = true;
      }
      _parse(input) {
        return OK3(input.data);
      }
    };
    ZodAny3.create = (params) => {
      return new ZodAny3({
        typeName: ZodFirstPartyTypeKind3.ZodAny,
        ...processCreateParams3(params)
      });
    };
    ZodUnknown3 = class extends ZodType3 {
      static {
        __name(this, "ZodUnknown");
      }
      constructor() {
        super(...arguments);
        this._unknown = true;
      }
      _parse(input) {
        return OK3(input.data);
      }
    };
    ZodUnknown3.create = (params) => {
      return new ZodUnknown3({
        typeName: ZodFirstPartyTypeKind3.ZodUnknown,
        ...processCreateParams3(params)
      });
    };
    ZodNever3 = class extends ZodType3 {
      static {
        __name(this, "ZodNever");
      }
      _parse(input) {
        const ctx = this._getOrReturnCtx(input);
        addIssueToContext3(ctx, {
          code: ZodIssueCode3.invalid_type,
          expected: ZodParsedType3.never,
          received: ctx.parsedType
        });
        return INVALID3;
      }
    };
    ZodNever3.create = (params) => {
      return new ZodNever3({
        typeName: ZodFirstPartyTypeKind3.ZodNever,
        ...processCreateParams3(params)
      });
    };
    ZodVoid3 = class extends ZodType3 {
      static {
        __name(this, "ZodVoid");
      }
      _parse(input) {
        const parsedType = this._getType(input);
        if (parsedType !== ZodParsedType3.undefined) {
          const ctx = this._getOrReturnCtx(input);
          addIssueToContext3(ctx, {
            code: ZodIssueCode3.invalid_type,
            expected: ZodParsedType3.void,
            received: ctx.parsedType
          });
          return INVALID3;
        }
        return OK3(input.data);
      }
    };
    ZodVoid3.create = (params) => {
      return new ZodVoid3({
        typeName: ZodFirstPartyTypeKind3.ZodVoid,
        ...processCreateParams3(params)
      });
    };
    ZodArray3 = class _ZodArray2 extends ZodType3 {
      static {
        __name(this, "ZodArray");
      }
      _parse(input) {
        const { ctx, status: status2 } = this._processInputParams(input);
        const def = this._def;
        if (ctx.parsedType !== ZodParsedType3.array) {
          addIssueToContext3(ctx, {
            code: ZodIssueCode3.invalid_type,
            expected: ZodParsedType3.array,
            received: ctx.parsedType
          });
          return INVALID3;
        }
        if (def.exactLength !== null) {
          const tooBig = ctx.data.length > def.exactLength.value;
          const tooSmall = ctx.data.length < def.exactLength.value;
          if (tooBig || tooSmall) {
            addIssueToContext3(ctx, {
              code: tooBig ? ZodIssueCode3.too_big : ZodIssueCode3.too_small,
              minimum: tooSmall ? def.exactLength.value : void 0,
              maximum: tooBig ? def.exactLength.value : void 0,
              type: "array",
              inclusive: true,
              exact: true,
              message: def.exactLength.message
            });
            status2.dirty();
          }
        }
        if (def.minLength !== null) {
          if (ctx.data.length < def.minLength.value) {
            addIssueToContext3(ctx, {
              code: ZodIssueCode3.too_small,
              minimum: def.minLength.value,
              type: "array",
              inclusive: true,
              exact: false,
              message: def.minLength.message
            });
            status2.dirty();
          }
        }
        if (def.maxLength !== null) {
          if (ctx.data.length > def.maxLength.value) {
            addIssueToContext3(ctx, {
              code: ZodIssueCode3.too_big,
              maximum: def.maxLength.value,
              type: "array",
              inclusive: true,
              exact: false,
              message: def.maxLength.message
            });
            status2.dirty();
          }
        }
        if (ctx.common.async) {
          return Promise.all([...ctx.data].map((item, i7) => {
            return def.type._parseAsync(new ParseInputLazyPath3(ctx, item, ctx.path, i7));
          })).then((result2) => {
            return ParseStatus3.mergeArray(status2, result2);
          });
        }
        const result = [...ctx.data].map((item, i7) => {
          return def.type._parseSync(new ParseInputLazyPath3(ctx, item, ctx.path, i7));
        });
        return ParseStatus3.mergeArray(status2, result);
      }
      get element() {
        return this._def.type;
      }
      min(minLength, message) {
        return new _ZodArray2({
          ...this._def,
          minLength: { value: minLength, message: errorUtil3.toString(message) }
        });
      }
      max(maxLength, message) {
        return new _ZodArray2({
          ...this._def,
          maxLength: { value: maxLength, message: errorUtil3.toString(message) }
        });
      }
      length(len, message) {
        return new _ZodArray2({
          ...this._def,
          exactLength: { value: len, message: errorUtil3.toString(message) }
        });
      }
      nonempty(message) {
        return this.min(1, message);
      }
    };
    ZodArray3.create = (schema, params) => {
      return new ZodArray3({
        type: schema,
        minLength: null,
        maxLength: null,
        exactLength: null,
        typeName: ZodFirstPartyTypeKind3.ZodArray,
        ...processCreateParams3(params)
      });
    };
    __name(deepPartialify3, "deepPartialify");
    ZodObject3 = class _ZodObject2 extends ZodType3 {
      static {
        __name(this, "ZodObject");
      }
      constructor() {
        super(...arguments);
        this._cached = null;
        this.nonstrict = this.passthrough;
        this.augment = this.extend;
      }
      _getCached() {
        if (this._cached !== null)
          return this._cached;
        const shape = this._def.shape();
        const keys = util3.objectKeys(shape);
        return this._cached = { shape, keys };
      }
      _parse(input) {
        const parsedType = this._getType(input);
        if (parsedType !== ZodParsedType3.object) {
          const ctx2 = this._getOrReturnCtx(input);
          addIssueToContext3(ctx2, {
            code: ZodIssueCode3.invalid_type,
            expected: ZodParsedType3.object,
            received: ctx2.parsedType
          });
          return INVALID3;
        }
        const { status: status2, ctx } = this._processInputParams(input);
        const { shape, keys: shapeKeys } = this._getCached();
        const extraKeys = [];
        if (!(this._def.catchall instanceof ZodNever3 && this._def.unknownKeys === "strip")) {
          for (const key in ctx.data) {
            if (!shapeKeys.includes(key)) {
              extraKeys.push(key);
            }
          }
        }
        const pairs = [];
        for (const key of shapeKeys) {
          const keyValidator = shape[key];
          const value = ctx.data[key];
          pairs.push({
            key: { status: "valid", value: key },
            value: keyValidator._parse(new ParseInputLazyPath3(ctx, value, ctx.path, key)),
            alwaysSet: key in ctx.data
          });
        }
        if (this._def.catchall instanceof ZodNever3) {
          const unknownKeys = this._def.unknownKeys;
          if (unknownKeys === "passthrough") {
            for (const key of extraKeys) {
              pairs.push({
                key: { status: "valid", value: key },
                value: { status: "valid", value: ctx.data[key] }
              });
            }
          } else if (unknownKeys === "strict") {
            if (extraKeys.length > 0) {
              addIssueToContext3(ctx, {
                code: ZodIssueCode3.unrecognized_keys,
                keys: extraKeys
              });
              status2.dirty();
            }
          } else if (unknownKeys === "strip") ;
          else {
            throw new Error(`Internal ZodObject error: invalid unknownKeys value.`);
          }
        } else {
          const catchall = this._def.catchall;
          for (const key of extraKeys) {
            const value = ctx.data[key];
            pairs.push({
              key: { status: "valid", value: key },
              value: catchall._parse(
                new ParseInputLazyPath3(ctx, value, ctx.path, key)
                //, ctx.child(key), value, getParsedType(value)
              ),
              alwaysSet: key in ctx.data
            });
          }
        }
        if (ctx.common.async) {
          return Promise.resolve().then(async () => {
            const syncPairs = [];
            for (const pair of pairs) {
              const key = await pair.key;
              syncPairs.push({
                key,
                value: await pair.value,
                alwaysSet: pair.alwaysSet
              });
            }
            return syncPairs;
          }).then((syncPairs) => {
            return ParseStatus3.mergeObjectSync(status2, syncPairs);
          });
        } else {
          return ParseStatus3.mergeObjectSync(status2, pairs);
        }
      }
      get shape() {
        return this._def.shape();
      }
      strict(message) {
        errorUtil3.errToObj;
        return new _ZodObject2({
          ...this._def,
          unknownKeys: "strict",
          ...message !== void 0 ? {
            errorMap: /* @__PURE__ */ __name((issue, ctx) => {
              var _a5, _b2, _c3, _d2;
              const defaultError = (_c3 = (_b2 = (_a5 = this._def).errorMap) === null || _b2 === void 0 ? void 0 : _b2.call(_a5, issue, ctx).message) !== null && _c3 !== void 0 ? _c3 : ctx.defaultError;
              if (issue.code === "unrecognized_keys")
                return {
                  message: (_d2 = errorUtil3.errToObj(message).message) !== null && _d2 !== void 0 ? _d2 : defaultError
                };
              return {
                message: defaultError
              };
            }, "errorMap")
          } : {}
        });
      }
      strip() {
        return new _ZodObject2({
          ...this._def,
          unknownKeys: "strip"
        });
      }
      passthrough() {
        return new _ZodObject2({
          ...this._def,
          unknownKeys: "passthrough"
        });
      }
      // const AugmentFactory =
      //   <Def extends ZodObjectDef>(def: Def) =>
      //   <Augmentation extends ZodRawShape>(
      //     augmentation: Augmentation
      //   ): ZodObject<
      //     extendShape<ReturnType<Def["shape"]>, Augmentation>,
      //     Def["unknownKeys"],
      //     Def["catchall"]
      //   > => {
      //     return new ZodObject({
      //       ...def,
      //       shape: () => ({
      //         ...def.shape(),
      //         ...augmentation,
      //       }),
      //     }) as any;
      //   };
      extend(augmentation) {
        return new _ZodObject2({
          ...this._def,
          shape: /* @__PURE__ */ __name(() => ({
            ...this._def.shape(),
            ...augmentation
          }), "shape")
        });
      }
      /**
       * Prior to zod@1.0.12 there was a bug in the
       * inferred type of merged objects. Please
       * upgrade if you are experiencing issues.
       */
      merge(merging) {
        const merged = new _ZodObject2({
          unknownKeys: merging._def.unknownKeys,
          catchall: merging._def.catchall,
          shape: /* @__PURE__ */ __name(() => ({
            ...this._def.shape(),
            ...merging._def.shape()
          }), "shape"),
          typeName: ZodFirstPartyTypeKind3.ZodObject
        });
        return merged;
      }
      // merge<
      //   Incoming extends AnyZodObject,
      //   Augmentation extends Incoming["shape"],
      //   NewOutput extends {
      //     [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation
      //       ? Augmentation[k]["_output"]
      //       : k extends keyof Output
      //       ? Output[k]
      //       : never;
      //   },
      //   NewInput extends {
      //     [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation
      //       ? Augmentation[k]["_input"]
      //       : k extends keyof Input
      //       ? Input[k]
      //       : never;
      //   }
      // >(
      //   merging: Incoming
      // ): ZodObject<
      //   extendShape<T, ReturnType<Incoming["_def"]["shape"]>>,
      //   Incoming["_def"]["unknownKeys"],
      //   Incoming["_def"]["catchall"],
      //   NewOutput,
      //   NewInput
      // > {
      //   const merged: any = new ZodObject({
      //     unknownKeys: merging._def.unknownKeys,
      //     catchall: merging._def.catchall,
      //     shape: () =>
      //       objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
      //     typeName: ZodFirstPartyTypeKind.ZodObject,
      //   }) as any;
      //   return merged;
      // }
      setKey(key, schema) {
        return this.augment({ [key]: schema });
      }
      // merge<Incoming extends AnyZodObject>(
      //   merging: Incoming
      // ): //ZodObject<T & Incoming["_shape"], UnknownKeys, Catchall> = (merging) => {
      // ZodObject<
      //   extendShape<T, ReturnType<Incoming["_def"]["shape"]>>,
      //   Incoming["_def"]["unknownKeys"],
      //   Incoming["_def"]["catchall"]
      // > {
      //   // const mergedShape = objectUtil.mergeShapes(
      //   //   this._def.shape(),
      //   //   merging._def.shape()
      //   // );
      //   const merged: any = new ZodObject({
      //     unknownKeys: merging._def.unknownKeys,
      //     catchall: merging._def.catchall,
      //     shape: () =>
      //       objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
      //     typeName: ZodFirstPartyTypeKind.ZodObject,
      //   }) as any;
      //   return merged;
      // }
      catchall(index) {
        return new _ZodObject2({
          ...this._def,
          catchall: index
        });
      }
      pick(mask) {
        const shape = {};
        util3.objectKeys(mask).forEach((key) => {
          if (mask[key] && this.shape[key]) {
            shape[key] = this.shape[key];
          }
        });
        return new _ZodObject2({
          ...this._def,
          shape: /* @__PURE__ */ __name(() => shape, "shape")
        });
      }
      omit(mask) {
        const shape = {};
        util3.objectKeys(this.shape).forEach((key) => {
          if (!mask[key]) {
            shape[key] = this.shape[key];
          }
        });
        return new _ZodObject2({
          ...this._def,
          shape: /* @__PURE__ */ __name(() => shape, "shape")
        });
      }
      /**
       * @deprecated
       */
      deepPartial() {
        return deepPartialify3(this);
      }
      partial(mask) {
        const newShape = {};
        util3.objectKeys(this.shape).forEach((key) => {
          const fieldSchema = this.shape[key];
          if (mask && !mask[key]) {
            newShape[key] = fieldSchema;
          } else {
            newShape[key] = fieldSchema.optional();
          }
        });
        return new _ZodObject2({
          ...this._def,
          shape: /* @__PURE__ */ __name(() => newShape, "shape")
        });
      }
      required(mask) {
        const newShape = {};
        util3.objectKeys(this.shape).forEach((key) => {
          if (mask && !mask[key]) {
            newShape[key] = this.shape[key];
          } else {
            const fieldSchema = this.shape[key];
            let newField = fieldSchema;
            while (newField instanceof ZodOptional3) {
              newField = newField._def.innerType;
            }
            newShape[key] = newField;
          }
        });
        return new _ZodObject2({
          ...this._def,
          shape: /* @__PURE__ */ __name(() => newShape, "shape")
        });
      }
      keyof() {
        return createZodEnum3(util3.objectKeys(this.shape));
      }
    };
    ZodObject3.create = (shape, params) => {
      return new ZodObject3({
        shape: /* @__PURE__ */ __name(() => shape, "shape"),
        unknownKeys: "strip",
        catchall: ZodNever3.create(),
        typeName: ZodFirstPartyTypeKind3.ZodObject,
        ...processCreateParams3(params)
      });
    };
    ZodObject3.strictCreate = (shape, params) => {
      return new ZodObject3({
        shape: /* @__PURE__ */ __name(() => shape, "shape"),
        unknownKeys: "strict",
        catchall: ZodNever3.create(),
        typeName: ZodFirstPartyTypeKind3.ZodObject,
        ...processCreateParams3(params)
      });
    };
    ZodObject3.lazycreate = (shape, params) => {
      return new ZodObject3({
        shape,
        unknownKeys: "strip",
        catchall: ZodNever3.create(),
        typeName: ZodFirstPartyTypeKind3.ZodObject,
        ...processCreateParams3(params)
      });
    };
    ZodUnion3 = class extends ZodType3 {
      static {
        __name(this, "ZodUnion");
      }
      _parse(input) {
        const { ctx } = this._processInputParams(input);
        const options = this._def.options;
        function handleResults(results) {
          for (const result of results) {
            if (result.result.status === "valid") {
              return result.result;
            }
          }
          for (const result of results) {
            if (result.result.status === "dirty") {
              ctx.common.issues.push(...result.ctx.common.issues);
              return result.result;
            }
          }
          const unionErrors = results.map((result) => new ZodError3(result.ctx.common.issues));
          addIssueToContext3(ctx, {
            code: ZodIssueCode3.invalid_union,
            unionErrors
          });
          return INVALID3;
        }
        __name(handleResults, "handleResults");
        if (ctx.common.async) {
          return Promise.all(options.map(async (option) => {
            const childCtx = {
              ...ctx,
              common: {
                ...ctx.common,
                issues: []
              },
              parent: null
            };
            return {
              result: await option._parseAsync({
                data: ctx.data,
                path: ctx.path,
                parent: childCtx
              }),
              ctx: childCtx
            };
          })).then(handleResults);
        } else {
          let dirty = void 0;
          const issues = [];
          for (const option of options) {
            const childCtx = {
              ...ctx,
              common: {
                ...ctx.common,
                issues: []
              },
              parent: null
            };
            const result = option._parseSync({
              data: ctx.data,
              path: ctx.path,
              parent: childCtx
            });
            if (result.status === "valid") {
              return result;
            } else if (result.status === "dirty" && !dirty) {
              dirty = { result, ctx: childCtx };
            }
            if (childCtx.common.issues.length) {
              issues.push(childCtx.common.issues);
            }
          }
          if (dirty) {
            ctx.common.issues.push(...dirty.ctx.common.issues);
            return dirty.result;
          }
          const unionErrors = issues.map((issues2) => new ZodError3(issues2));
          addIssueToContext3(ctx, {
            code: ZodIssueCode3.invalid_union,
            unionErrors
          });
          return INVALID3;
        }
      }
      get options() {
        return this._def.options;
      }
    };
    ZodUnion3.create = (types13, params) => {
      return new ZodUnion3({
        options: types13,
        typeName: ZodFirstPartyTypeKind3.ZodUnion,
        ...processCreateParams3(params)
      });
    };
    getDiscriminator3 = /* @__PURE__ */ __name((type) => {
      if (type instanceof ZodLazy3) {
        return getDiscriminator3(type.schema);
      } else if (type instanceof ZodEffects3) {
        return getDiscriminator3(type.innerType());
      } else if (type instanceof ZodLiteral3) {
        return [type.value];
      } else if (type instanceof ZodEnum3) {
        return type.options;
      } else if (type instanceof ZodNativeEnum3) {
        return Object.keys(type.enum);
      } else if (type instanceof ZodDefault3) {
        return getDiscriminator3(type._def.innerType);
      } else if (type instanceof ZodUndefined3) {
        return [void 0];
      } else if (type instanceof ZodNull3) {
        return [null];
      } else {
        return null;
      }
    }, "getDiscriminator");
    ZodDiscriminatedUnion3 = class _ZodDiscriminatedUnion2 extends ZodType3 {
      static {
        __name(this, "ZodDiscriminatedUnion");
      }
      _parse(input) {
        const { ctx } = this._processInputParams(input);
        if (ctx.parsedType !== ZodParsedType3.object) {
          addIssueToContext3(ctx, {
            code: ZodIssueCode3.invalid_type,
            expected: ZodParsedType3.object,
            received: ctx.parsedType
          });
          return INVALID3;
        }
        const discriminator = this.discriminator;
        const discriminatorValue = ctx.data[discriminator];
        const option = this.optionsMap.get(discriminatorValue);
        if (!option) {
          addIssueToContext3(ctx, {
            code: ZodIssueCode3.invalid_union_discriminator,
            options: Array.from(this.optionsMap.keys()),
            path: [discriminator]
          });
          return INVALID3;
        }
        if (ctx.common.async) {
          return option._parseAsync({
            data: ctx.data,
            path: ctx.path,
            parent: ctx
          });
        } else {
          return option._parseSync({
            data: ctx.data,
            path: ctx.path,
            parent: ctx
          });
        }
      }
      get discriminator() {
        return this._def.discriminator;
      }
      get options() {
        return this._def.options;
      }
      get optionsMap() {
        return this._def.optionsMap;
      }
      /**
       * The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor.
       * However, it only allows a union of objects, all of which need to share a discriminator property. This property must
       * have a different value for each object in the union.
       * @param discriminator the name of the discriminator property
       * @param types an array of object schemas
       * @param params
       */
      static create(discriminator, options, params) {
        const optionsMap = /* @__PURE__ */ new Map();
        for (const type of options) {
          const discriminatorValues = getDiscriminator3(type.shape[discriminator]);
          if (!discriminatorValues) {
            throw new Error(`A discriminator value for key \`${discriminator}\` could not be extracted from all schema options`);
          }
          for (const value of discriminatorValues) {
            if (optionsMap.has(value)) {
              throw new Error(`Discriminator property ${String(discriminator)} has duplicate value ${String(value)}`);
            }
            optionsMap.set(value, type);
          }
        }
        return new _ZodDiscriminatedUnion2({
          typeName: ZodFirstPartyTypeKind3.ZodDiscriminatedUnion,
          discriminator,
          options,
          optionsMap,
          ...processCreateParams3(params)
        });
      }
    };
    __name(mergeValues3, "mergeValues");
    ZodIntersection3 = class extends ZodType3 {
      static {
        __name(this, "ZodIntersection");
      }
      _parse(input) {
        const { status: status2, ctx } = this._processInputParams(input);
        const handleParsed = /* @__PURE__ */ __name((parsedLeft, parsedRight) => {
          if (isAborted3(parsedLeft) || isAborted3(parsedRight)) {
            return INVALID3;
          }
          const merged = mergeValues3(parsedLeft.value, parsedRight.value);
          if (!merged.valid) {
            addIssueToContext3(ctx, {
              code: ZodIssueCode3.invalid_intersection_types
            });
            return INVALID3;
          }
          if (isDirty3(parsedLeft) || isDirty3(parsedRight)) {
            status2.dirty();
          }
          return { status: status2.value, value: merged.data };
        }, "handleParsed");
        if (ctx.common.async) {
          return Promise.all([
            this._def.left._parseAsync({
              data: ctx.data,
              path: ctx.path,
              parent: ctx
            }),
            this._def.right._parseAsync({
              data: ctx.data,
              path: ctx.path,
              parent: ctx
            })
          ]).then(([left2, right2]) => handleParsed(left2, right2));
        } else {
          return handleParsed(this._def.left._parseSync({
            data: ctx.data,
            path: ctx.path,
            parent: ctx
          }), this._def.right._parseSync({
            data: ctx.data,
            path: ctx.path,
            parent: ctx
          }));
        }
      }
    };
    ZodIntersection3.create = (left2, right2, params) => {
      return new ZodIntersection3({
        left: left2,
        right: right2,
        typeName: ZodFirstPartyTypeKind3.ZodIntersection,
        ...processCreateParams3(params)
      });
    };
    ZodTuple3 = class _ZodTuple2 extends ZodType3 {
      static {
        __name(this, "ZodTuple");
      }
      _parse(input) {
        const { status: status2, ctx } = this._processInputParams(input);
        if (ctx.parsedType !== ZodParsedType3.array) {
          addIssueToContext3(ctx, {
            code: ZodIssueCode3.invalid_type,
            expected: ZodParsedType3.array,
            received: ctx.parsedType
          });
          return INVALID3;
        }
        if (ctx.data.length < this._def.items.length) {
          addIssueToContext3(ctx, {
            code: ZodIssueCode3.too_small,
            minimum: this._def.items.length,
            inclusive: true,
            exact: false,
            type: "array"
          });
          return INVALID3;
        }
        const rest = this._def.rest;
        if (!rest && ctx.data.length > this._def.items.length) {
          addIssueToContext3(ctx, {
            code: ZodIssueCode3.too_big,
            maximum: this._def.items.length,
            inclusive: true,
            exact: false,
            type: "array"
          });
          status2.dirty();
        }
        const items = [...ctx.data].map((item, itemIndex) => {
          const schema = this._def.items[itemIndex] || this._def.rest;
          if (!schema)
            return null;
          return schema._parse(new ParseInputLazyPath3(ctx, item, ctx.path, itemIndex));
        }).filter((x7) => !!x7);
        if (ctx.common.async) {
          return Promise.all(items).then((results) => {
            return ParseStatus3.mergeArray(status2, results);
          });
        } else {
          return ParseStatus3.mergeArray(status2, items);
        }
      }
      get items() {
        return this._def.items;
      }
      rest(rest) {
        return new _ZodTuple2({
          ...this._def,
          rest
        });
      }
    };
    ZodTuple3.create = (schemas, params) => {
      if (!Array.isArray(schemas)) {
        throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
      }
      return new ZodTuple3({
        items: schemas,
        typeName: ZodFirstPartyTypeKind3.ZodTuple,
        rest: null,
        ...processCreateParams3(params)
      });
    };
    ZodRecord3 = class _ZodRecord2 extends ZodType3 {
      static {
        __name(this, "ZodRecord");
      }
      get keySchema() {
        return this._def.keyType;
      }
      get valueSchema() {
        return this._def.valueType;
      }
      _parse(input) {
        const { status: status2, ctx } = this._processInputParams(input);
        if (ctx.parsedType !== ZodParsedType3.object) {
          addIssueToContext3(ctx, {
            code: ZodIssueCode3.invalid_type,
            expected: ZodParsedType3.object,
            received: ctx.parsedType
          });
          return INVALID3;
        }
        const pairs = [];
        const keyType = this._def.keyType;
        const valueType = this._def.valueType;
        for (const key in ctx.data) {
          pairs.push({
            key: keyType._parse(new ParseInputLazyPath3(ctx, key, ctx.path, key)),
            value: valueType._parse(new ParseInputLazyPath3(ctx, ctx.data[key], ctx.path, key))
          });
        }
        if (ctx.common.async) {
          return ParseStatus3.mergeObjectAsync(status2, pairs);
        } else {
          return ParseStatus3.mergeObjectSync(status2, pairs);
        }
      }
      get element() {
        return this._def.valueType;
      }
      static create(first, second, third) {
        if (second instanceof ZodType3) {
          return new _ZodRecord2({
            keyType: first,
            valueType: second,
            typeName: ZodFirstPartyTypeKind3.ZodRecord,
            ...processCreateParams3(third)
          });
        }
        return new _ZodRecord2({
          keyType: ZodString3.create(),
          valueType: first,
          typeName: ZodFirstPartyTypeKind3.ZodRecord,
          ...processCreateParams3(second)
        });
      }
    };
    ZodMap3 = class extends ZodType3 {
      static {
        __name(this, "ZodMap");
      }
      get keySchema() {
        return this._def.keyType;
      }
      get valueSchema() {
        return this._def.valueType;
      }
      _parse(input) {
        const { status: status2, ctx } = this._processInputParams(input);
        if (ctx.parsedType !== ZodParsedType3.map) {
          addIssueToContext3(ctx, {
            code: ZodIssueCode3.invalid_type,
            expected: ZodParsedType3.map,
            received: ctx.parsedType
          });
          return INVALID3;
        }
        const keyType = this._def.keyType;
        const valueType = this._def.valueType;
        const pairs = [...ctx.data.entries()].map(([key, value], index) => {
          return {
            key: keyType._parse(new ParseInputLazyPath3(ctx, key, ctx.path, [index, "key"])),
            value: valueType._parse(new ParseInputLazyPath3(ctx, value, ctx.path, [index, "value"]))
          };
        });
        if (ctx.common.async) {
          const finalMap = /* @__PURE__ */ new Map();
          return Promise.resolve().then(async () => {
            for (const pair of pairs) {
              const key = await pair.key;
              const value = await pair.value;
              if (key.status === "aborted" || value.status === "aborted") {
                return INVALID3;
              }
              if (key.status === "dirty" || value.status === "dirty") {
                status2.dirty();
              }
              finalMap.set(key.value, value.value);
            }
            return { status: status2.value, value: finalMap };
          });
        } else {
          const finalMap = /* @__PURE__ */ new Map();
          for (const pair of pairs) {
            const key = pair.key;
            const value = pair.value;
            if (key.status === "aborted" || value.status === "aborted") {
              return INVALID3;
            }
            if (key.status === "dirty" || value.status === "dirty") {
              status2.dirty();
            }
            finalMap.set(key.value, value.value);
          }
          return { status: status2.value, value: finalMap };
        }
      }
    };
    ZodMap3.create = (keyType, valueType, params) => {
      return new ZodMap3({
        valueType,
        keyType,
        typeName: ZodFirstPartyTypeKind3.ZodMap,
        ...processCreateParams3(params)
      });
    };
    ZodSet3 = class _ZodSet2 extends ZodType3 {
      static {
        __name(this, "ZodSet");
      }
      _parse(input) {
        const { status: status2, ctx } = this._processInputParams(input);
        if (ctx.parsedType !== ZodParsedType3.set) {
          addIssueToContext3(ctx, {
            code: ZodIssueCode3.invalid_type,
            expected: ZodParsedType3.set,
            received: ctx.parsedType
          });
          return INVALID3;
        }
        const def = this._def;
        if (def.minSize !== null) {
          if (ctx.data.size < def.minSize.value) {
            addIssueToContext3(ctx, {
              code: ZodIssueCode3.too_small,
              minimum: def.minSize.value,
              type: "set",
              inclusive: true,
              exact: false,
              message: def.minSize.message
            });
            status2.dirty();
          }
        }
        if (def.maxSize !== null) {
          if (ctx.data.size > def.maxSize.value) {
            addIssueToContext3(ctx, {
              code: ZodIssueCode3.too_big,
              maximum: def.maxSize.value,
              type: "set",
              inclusive: true,
              exact: false,
              message: def.maxSize.message
            });
            status2.dirty();
          }
        }
        const valueType = this._def.valueType;
        function finalizeSet(elements2) {
          const parsedSet = /* @__PURE__ */ new Set();
          for (const element of elements2) {
            if (element.status === "aborted")
              return INVALID3;
            if (element.status === "dirty")
              status2.dirty();
            parsedSet.add(element.value);
          }
          return { status: status2.value, value: parsedSet };
        }
        __name(finalizeSet, "finalizeSet");
        const elements = [...ctx.data.values()].map((item, i7) => valueType._parse(new ParseInputLazyPath3(ctx, item, ctx.path, i7)));
        if (ctx.common.async) {
          return Promise.all(elements).then((elements2) => finalizeSet(elements2));
        } else {
          return finalizeSet(elements);
        }
      }
      min(minSize, message) {
        return new _ZodSet2({
          ...this._def,
          minSize: { value: minSize, message: errorUtil3.toString(message) }
        });
      }
      max(maxSize, message) {
        return new _ZodSet2({
          ...this._def,
          maxSize: { value: maxSize, message: errorUtil3.toString(message) }
        });
      }
      size(size, message) {
        return this.min(size, message).max(size, message);
      }
      nonempty(message) {
        return this.min(1, message);
      }
    };
    ZodSet3.create = (valueType, params) => {
      return new ZodSet3({
        valueType,
        minSize: null,
        maxSize: null,
        typeName: ZodFirstPartyTypeKind3.ZodSet,
        ...processCreateParams3(params)
      });
    };
    ZodFunction3 = class _ZodFunction2 extends ZodType3 {
      static {
        __name(this, "ZodFunction");
      }
      constructor() {
        super(...arguments);
        this.validate = this.implement;
      }
      _parse(input) {
        const { ctx } = this._processInputParams(input);
        if (ctx.parsedType !== ZodParsedType3.function) {
          addIssueToContext3(ctx, {
            code: ZodIssueCode3.invalid_type,
            expected: ZodParsedType3.function,
            received: ctx.parsedType
          });
          return INVALID3;
        }
        function makeArgsIssue(args, error2) {
          return makeIssue3({
            data: args,
            path: ctx.path,
            errorMaps: [
              ctx.common.contextualErrorMap,
              ctx.schemaErrorMap,
              getErrorMap3(),
              errorMap3
            ].filter((x7) => !!x7),
            issueData: {
              code: ZodIssueCode3.invalid_arguments,
              argumentsError: error2
            }
          });
        }
        __name(makeArgsIssue, "makeArgsIssue");
        function makeReturnsIssue(returns, error2) {
          return makeIssue3({
            data: returns,
            path: ctx.path,
            errorMaps: [
              ctx.common.contextualErrorMap,
              ctx.schemaErrorMap,
              getErrorMap3(),
              errorMap3
            ].filter((x7) => !!x7),
            issueData: {
              code: ZodIssueCode3.invalid_return_type,
              returnTypeError: error2
            }
          });
        }
        __name(makeReturnsIssue, "makeReturnsIssue");
        const params = { errorMap: ctx.common.contextualErrorMap };
        const fn2 = ctx.data;
        if (this._def.returns instanceof ZodPromise3) {
          const me2 = this;
          return OK3(async function(...args) {
            const error2 = new ZodError3([]);
            const parsedArgs = await me2._def.args.parseAsync(args, params).catch((e10) => {
              error2.addIssue(makeArgsIssue(args, e10));
              throw error2;
            });
            const result = await Reflect.apply(fn2, this, parsedArgs);
            const parsedReturns = await me2._def.returns._def.type.parseAsync(result, params).catch((e10) => {
              error2.addIssue(makeReturnsIssue(result, e10));
              throw error2;
            });
            return parsedReturns;
          });
        } else {
          const me2 = this;
          return OK3(function(...args) {
            const parsedArgs = me2._def.args.safeParse(args, params);
            if (!parsedArgs.success) {
              throw new ZodError3([makeArgsIssue(args, parsedArgs.error)]);
            }
            const result = Reflect.apply(fn2, this, parsedArgs.data);
            const parsedReturns = me2._def.returns.safeParse(result, params);
            if (!parsedReturns.success) {
              throw new ZodError3([makeReturnsIssue(result, parsedReturns.error)]);
            }
            return parsedReturns.data;
          });
        }
      }
      parameters() {
        return this._def.args;
      }
      returnType() {
        return this._def.returns;
      }
      args(...items) {
        return new _ZodFunction2({
          ...this._def,
          args: ZodTuple3.create(items).rest(ZodUnknown3.create())
        });
      }
      returns(returnType) {
        return new _ZodFunction2({
          ...this._def,
          returns: returnType
        });
      }
      implement(func) {
        const validatedFunc = this.parse(func);
        return validatedFunc;
      }
      strictImplement(func) {
        const validatedFunc = this.parse(func);
        return validatedFunc;
      }
      static create(args, returns, params) {
        return new _ZodFunction2({
          args: args ? args : ZodTuple3.create([]).rest(ZodUnknown3.create()),
          returns: returns || ZodUnknown3.create(),
          typeName: ZodFirstPartyTypeKind3.ZodFunction,
          ...processCreateParams3(params)
        });
      }
    };
    ZodLazy3 = class extends ZodType3 {
      static {
        __name(this, "ZodLazy");
      }
      get schema() {
        return this._def.getter();
      }
      _parse(input) {
        const { ctx } = this._processInputParams(input);
        const lazySchema = this._def.getter();
        return lazySchema._parse({ data: ctx.data, path: ctx.path, parent: ctx });
      }
    };
    ZodLazy3.create = (getter, params) => {
      return new ZodLazy3({
        getter,
        typeName: ZodFirstPartyTypeKind3.ZodLazy,
        ...processCreateParams3(params)
      });
    };
    ZodLiteral3 = class extends ZodType3 {
      static {
        __name(this, "ZodLiteral");
      }
      _parse(input) {
        if (input.data !== this._def.value) {
          const ctx = this._getOrReturnCtx(input);
          addIssueToContext3(ctx, {
            received: ctx.data,
            code: ZodIssueCode3.invalid_literal,
            expected: this._def.value
          });
          return INVALID3;
        }
        return { status: "valid", value: input.data };
      }
      get value() {
        return this._def.value;
      }
    };
    ZodLiteral3.create = (value, params) => {
      return new ZodLiteral3({
        value,
        typeName: ZodFirstPartyTypeKind3.ZodLiteral,
        ...processCreateParams3(params)
      });
    };
    __name(createZodEnum3, "createZodEnum");
    ZodEnum3 = class _ZodEnum2 extends ZodType3 {
      static {
        __name(this, "ZodEnum");
      }
      _parse(input) {
        if (typeof input.data !== "string") {
          const ctx = this._getOrReturnCtx(input);
          const expectedValues = this._def.values;
          addIssueToContext3(ctx, {
            expected: util3.joinValues(expectedValues),
            received: ctx.parsedType,
            code: ZodIssueCode3.invalid_type
          });
          return INVALID3;
        }
        if (this._def.values.indexOf(input.data) === -1) {
          const ctx = this._getOrReturnCtx(input);
          const expectedValues = this._def.values;
          addIssueToContext3(ctx, {
            received: ctx.data,
            code: ZodIssueCode3.invalid_enum_value,
            options: expectedValues
          });
          return INVALID3;
        }
        return OK3(input.data);
      }
      get options() {
        return this._def.values;
      }
      get enum() {
        const enumValues = {};
        for (const val2 of this._def.values) {
          enumValues[val2] = val2;
        }
        return enumValues;
      }
      get Values() {
        const enumValues = {};
        for (const val2 of this._def.values) {
          enumValues[val2] = val2;
        }
        return enumValues;
      }
      get Enum() {
        const enumValues = {};
        for (const val2 of this._def.values) {
          enumValues[val2] = val2;
        }
        return enumValues;
      }
      extract(values) {
        return _ZodEnum2.create(values);
      }
      exclude(values) {
        return _ZodEnum2.create(this.options.filter((opt) => !values.includes(opt)));
      }
    };
    ZodEnum3.create = createZodEnum3;
    ZodNativeEnum3 = class extends ZodType3 {
      static {
        __name(this, "ZodNativeEnum");
      }
      _parse(input) {
        const nativeEnumValues = util3.getValidEnumValues(this._def.values);
        const ctx = this._getOrReturnCtx(input);
        if (ctx.parsedType !== ZodParsedType3.string && ctx.parsedType !== ZodParsedType3.number) {
          const expectedValues = util3.objectValues(nativeEnumValues);
          addIssueToContext3(ctx, {
            expected: util3.joinValues(expectedValues),
            received: ctx.parsedType,
            code: ZodIssueCode3.invalid_type
          });
          return INVALID3;
        }
        if (nativeEnumValues.indexOf(input.data) === -1) {
          const expectedValues = util3.objectValues(nativeEnumValues);
          addIssueToContext3(ctx, {
            received: ctx.data,
            code: ZodIssueCode3.invalid_enum_value,
            options: expectedValues
          });
          return INVALID3;
        }
        return OK3(input.data);
      }
      get enum() {
        return this._def.values;
      }
    };
    ZodNativeEnum3.create = (values, params) => {
      return new ZodNativeEnum3({
        values,
        typeName: ZodFirstPartyTypeKind3.ZodNativeEnum,
        ...processCreateParams3(params)
      });
    };
    ZodPromise3 = class extends ZodType3 {
      static {
        __name(this, "ZodPromise");
      }
      unwrap() {
        return this._def.type;
      }
      _parse(input) {
        const { ctx } = this._processInputParams(input);
        if (ctx.parsedType !== ZodParsedType3.promise && ctx.common.async === false) {
          addIssueToContext3(ctx, {
            code: ZodIssueCode3.invalid_type,
            expected: ZodParsedType3.promise,
            received: ctx.parsedType
          });
          return INVALID3;
        }
        const promisified = ctx.parsedType === ZodParsedType3.promise ? ctx.data : Promise.resolve(ctx.data);
        return OK3(promisified.then((data) => {
          return this._def.type.parseAsync(data, {
            path: ctx.path,
            errorMap: ctx.common.contextualErrorMap
          });
        }));
      }
    };
    ZodPromise3.create = (schema, params) => {
      return new ZodPromise3({
        type: schema,
        typeName: ZodFirstPartyTypeKind3.ZodPromise,
        ...processCreateParams3(params)
      });
    };
    ZodEffects3 = class extends ZodType3 {
      static {
        __name(this, "ZodEffects");
      }
      innerType() {
        return this._def.schema;
      }
      sourceType() {
        return this._def.schema._def.typeName === ZodFirstPartyTypeKind3.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
      }
      _parse(input) {
        const { status: status2, ctx } = this._processInputParams(input);
        const effect = this._def.effect || null;
        const checkCtx = {
          addIssue: /* @__PURE__ */ __name((arg) => {
            addIssueToContext3(ctx, arg);
            if (arg.fatal) {
              status2.abort();
            } else {
              status2.dirty();
            }
          }, "addIssue"),
          get path() {
            return ctx.path;
          }
        };
        checkCtx.addIssue = checkCtx.addIssue.bind(checkCtx);
        if (effect.type === "preprocess") {
          const processed = effect.transform(ctx.data, checkCtx);
          if (ctx.common.issues.length) {
            return {
              status: "dirty",
              value: ctx.data
            };
          }
          if (ctx.common.async) {
            return Promise.resolve(processed).then((processed2) => {
              return this._def.schema._parseAsync({
                data: processed2,
                path: ctx.path,
                parent: ctx
              });
            });
          } else {
            return this._def.schema._parseSync({
              data: processed,
              path: ctx.path,
              parent: ctx
            });
          }
        }
        if (effect.type === "refinement") {
          const executeRefinement = /* @__PURE__ */ __name((acc) => {
            const result = effect.refinement(acc, checkCtx);
            if (ctx.common.async) {
              return Promise.resolve(result);
            }
            if (result instanceof Promise) {
              throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");
            }
            return acc;
          }, "executeRefinement");
          if (ctx.common.async === false) {
            const inner = this._def.schema._parseSync({
              data: ctx.data,
              path: ctx.path,
              parent: ctx
            });
            if (inner.status === "aborted")
              return INVALID3;
            if (inner.status === "dirty")
              status2.dirty();
            executeRefinement(inner.value);
            return { status: status2.value, value: inner.value };
          } else {
            return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((inner) => {
              if (inner.status === "aborted")
                return INVALID3;
              if (inner.status === "dirty")
                status2.dirty();
              return executeRefinement(inner.value).then(() => {
                return { status: status2.value, value: inner.value };
              });
            });
          }
        }
        if (effect.type === "transform") {
          if (ctx.common.async === false) {
            const base = this._def.schema._parseSync({
              data: ctx.data,
              path: ctx.path,
              parent: ctx
            });
            if (!isValid3(base))
              return base;
            const result = effect.transform(base.value, checkCtx);
            if (result instanceof Promise) {
              throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);
            }
            return { status: status2.value, value: result };
          } else {
            return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((base) => {
              if (!isValid3(base))
                return base;
              return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({ status: status2.value, value: result }));
            });
          }
        }
        util3.assertNever(effect);
      }
    };
    ZodEffects3.create = (schema, effect, params) => {
      return new ZodEffects3({
        schema,
        typeName: ZodFirstPartyTypeKind3.ZodEffects,
        effect,
        ...processCreateParams3(params)
      });
    };
    ZodEffects3.createWithPreprocess = (preprocess, schema, params) => {
      return new ZodEffects3({
        schema,
        effect: { type: "preprocess", transform: preprocess },
        typeName: ZodFirstPartyTypeKind3.ZodEffects,
        ...processCreateParams3(params)
      });
    };
    ZodOptional3 = class extends ZodType3 {
      static {
        __name(this, "ZodOptional");
      }
      _parse(input) {
        const parsedType = this._getType(input);
        if (parsedType === ZodParsedType3.undefined) {
          return OK3(void 0);
        }
        return this._def.innerType._parse(input);
      }
      unwrap() {
        return this._def.innerType;
      }
    };
    ZodOptional3.create = (type, params) => {
      return new ZodOptional3({
        innerType: type,
        typeName: ZodFirstPartyTypeKind3.ZodOptional,
        ...processCreateParams3(params)
      });
    };
    ZodNullable3 = class extends ZodType3 {
      static {
        __name(this, "ZodNullable");
      }
      _parse(input) {
        const parsedType = this._getType(input);
        if (parsedType === ZodParsedType3.null) {
          return OK3(null);
        }
        return this._def.innerType._parse(input);
      }
      unwrap() {
        return this._def.innerType;
      }
    };
    ZodNullable3.create = (type, params) => {
      return new ZodNullable3({
        innerType: type,
        typeName: ZodFirstPartyTypeKind3.ZodNullable,
        ...processCreateParams3(params)
      });
    };
    ZodDefault3 = class extends ZodType3 {
      static {
        __name(this, "ZodDefault");
      }
      _parse(input) {
        const { ctx } = this._processInputParams(input);
        let data = ctx.data;
        if (ctx.parsedType === ZodParsedType3.undefined) {
          data = this._def.defaultValue();
        }
        return this._def.innerType._parse({
          data,
          path: ctx.path,
          parent: ctx
        });
      }
      removeDefault() {
        return this._def.innerType;
      }
    };
    ZodDefault3.create = (type, params) => {
      return new ZodDefault3({
        innerType: type,
        typeName: ZodFirstPartyTypeKind3.ZodDefault,
        defaultValue: typeof params.default === "function" ? params.default : () => params.default,
        ...processCreateParams3(params)
      });
    };
    ZodCatch3 = class extends ZodType3 {
      static {
        __name(this, "ZodCatch");
      }
      _parse(input) {
        const { ctx } = this._processInputParams(input);
        const newCtx = {
          ...ctx,
          common: {
            ...ctx.common,
            issues: []
          }
        };
        const result = this._def.innerType._parse({
          data: newCtx.data,
          path: newCtx.path,
          parent: {
            ...newCtx
          }
        });
        if (isAsync3(result)) {
          return result.then((result2) => {
            return {
              status: "valid",
              value: result2.status === "valid" ? result2.value : this._def.catchValue({
                get error() {
                  return new ZodError3(newCtx.common.issues);
                },
                input: newCtx.data
              })
            };
          });
        } else {
          return {
            status: "valid",
            value: result.status === "valid" ? result.value : this._def.catchValue({
              get error() {
                return new ZodError3(newCtx.common.issues);
              },
              input: newCtx.data
            })
          };
        }
      }
      removeCatch() {
        return this._def.innerType;
      }
    };
    ZodCatch3.create = (type, params) => {
      return new ZodCatch3({
        innerType: type,
        typeName: ZodFirstPartyTypeKind3.ZodCatch,
        catchValue: typeof params.catch === "function" ? params.catch : () => params.catch,
        ...processCreateParams3(params)
      });
    };
    ZodNaN3 = class extends ZodType3 {
      static {
        __name(this, "ZodNaN");
      }
      _parse(input) {
        const parsedType = this._getType(input);
        if (parsedType !== ZodParsedType3.nan) {
          const ctx = this._getOrReturnCtx(input);
          addIssueToContext3(ctx, {
            code: ZodIssueCode3.invalid_type,
            expected: ZodParsedType3.nan,
            received: ctx.parsedType
          });
          return INVALID3;
        }
        return { status: "valid", value: input.data };
      }
    };
    ZodNaN3.create = (params) => {
      return new ZodNaN3({
        typeName: ZodFirstPartyTypeKind3.ZodNaN,
        ...processCreateParams3(params)
      });
    };
    BRAND3 = Symbol("zod_brand");
    ZodBranded3 = class extends ZodType3 {
      static {
        __name(this, "ZodBranded");
      }
      _parse(input) {
        const { ctx } = this._processInputParams(input);
        const data = ctx.data;
        return this._def.type._parse({
          data,
          path: ctx.path,
          parent: ctx
        });
      }
      unwrap() {
        return this._def.type;
      }
    };
    ZodPipeline3 = class _ZodPipeline2 extends ZodType3 {
      static {
        __name(this, "ZodPipeline");
      }
      _parse(input) {
        const { status: status2, ctx } = this._processInputParams(input);
        if (ctx.common.async) {
          const handleAsync = /* @__PURE__ */ __name(async () => {
            const inResult = await this._def.in._parseAsync({
              data: ctx.data,
              path: ctx.path,
              parent: ctx
            });
            if (inResult.status === "aborted")
              return INVALID3;
            if (inResult.status === "dirty") {
              status2.dirty();
              return DIRTY3(inResult.value);
            } else {
              return this._def.out._parseAsync({
                data: inResult.value,
                path: ctx.path,
                parent: ctx
              });
            }
          }, "handleAsync");
          return handleAsync();
        } else {
          const inResult = this._def.in._parseSync({
            data: ctx.data,
            path: ctx.path,
            parent: ctx
          });
          if (inResult.status === "aborted")
            return INVALID3;
          if (inResult.status === "dirty") {
            status2.dirty();
            return {
              status: "dirty",
              value: inResult.value
            };
          } else {
            return this._def.out._parseSync({
              data: inResult.value,
              path: ctx.path,
              parent: ctx
            });
          }
        }
      }
      static create(a7, b11) {
        return new _ZodPipeline2({
          in: a7,
          out: b11,
          typeName: ZodFirstPartyTypeKind3.ZodPipeline
        });
      }
    };
    ZodReadonly3 = class extends ZodType3 {
      static {
        __name(this, "ZodReadonly");
      }
      _parse(input) {
        const result = this._def.innerType._parse(input);
        if (isValid3(result)) {
          result.value = Object.freeze(result.value);
        }
        return result;
      }
    };
    ZodReadonly3.create = (type, params) => {
      return new ZodReadonly3({
        innerType: type,
        typeName: ZodFirstPartyTypeKind3.ZodReadonly,
        ...processCreateParams3(params)
      });
    };
    custom3 = /* @__PURE__ */ __name((check, params = {}, fatal) => {
      if (check)
        return ZodAny3.create().superRefine((data, ctx) => {
          var _a5, _b2;
          if (!check(data)) {
            const p7 = typeof params === "function" ? params(data) : typeof params === "string" ? { message: params } : params;
            const _fatal = (_b2 = (_a5 = p7.fatal) !== null && _a5 !== void 0 ? _a5 : fatal) !== null && _b2 !== void 0 ? _b2 : true;
            const p22 = typeof p7 === "string" ? { message: p7 } : p7;
            ctx.addIssue({ code: "custom", ...p22, fatal: _fatal });
          }
        });
      return ZodAny3.create();
    }, "custom");
    late3 = {
      object: ZodObject3.lazycreate
    };
    (function(ZodFirstPartyTypeKind4) {
      ZodFirstPartyTypeKind4["ZodString"] = "ZodString";
      ZodFirstPartyTypeKind4["ZodNumber"] = "ZodNumber";
      ZodFirstPartyTypeKind4["ZodNaN"] = "ZodNaN";
      ZodFirstPartyTypeKind4["ZodBigInt"] = "ZodBigInt";
      ZodFirstPartyTypeKind4["ZodBoolean"] = "ZodBoolean";
      ZodFirstPartyTypeKind4["ZodDate"] = "ZodDate";
      ZodFirstPartyTypeKind4["ZodSymbol"] = "ZodSymbol";
      ZodFirstPartyTypeKind4["ZodUndefined"] = "ZodUndefined";
      ZodFirstPartyTypeKind4["ZodNull"] = "ZodNull";
      ZodFirstPartyTypeKind4["ZodAny"] = "ZodAny";
      ZodFirstPartyTypeKind4["ZodUnknown"] = "ZodUnknown";
      ZodFirstPartyTypeKind4["ZodNever"] = "ZodNever";
      ZodFirstPartyTypeKind4["ZodVoid"] = "ZodVoid";
      ZodFirstPartyTypeKind4["ZodArray"] = "ZodArray";
      ZodFirstPartyTypeKind4["ZodObject"] = "ZodObject";
      ZodFirstPartyTypeKind4["ZodUnion"] = "ZodUnion";
      ZodFirstPartyTypeKind4["ZodDiscriminatedUnion"] = "ZodDiscriminatedUnion";
      ZodFirstPartyTypeKind4["ZodIntersection"] = "ZodIntersection";
      ZodFirstPartyTypeKind4["ZodTuple"] = "ZodTuple";
      ZodFirstPartyTypeKind4["ZodRecord"] = "ZodRecord";
      ZodFirstPartyTypeKind4["ZodMap"] = "ZodMap";
      ZodFirstPartyTypeKind4["ZodSet"] = "ZodSet";
      ZodFirstPartyTypeKind4["ZodFunction"] = "ZodFunction";
      ZodFirstPartyTypeKind4["ZodLazy"] = "ZodLazy";
      ZodFirstPartyTypeKind4["ZodLiteral"] = "ZodLiteral";
      ZodFirstPartyTypeKind4["ZodEnum"] = "ZodEnum";
      ZodFirstPartyTypeKind4["ZodEffects"] = "ZodEffects";
      ZodFirstPartyTypeKind4["ZodNativeEnum"] = "ZodNativeEnum";
      ZodFirstPartyTypeKind4["ZodOptional"] = "ZodOptional";
      ZodFirstPartyTypeKind4["ZodNullable"] = "ZodNullable";
      ZodFirstPartyTypeKind4["ZodDefault"] = "ZodDefault";
      ZodFirstPartyTypeKind4["ZodCatch"] = "ZodCatch";
      ZodFirstPartyTypeKind4["ZodPromise"] = "ZodPromise";
      ZodFirstPartyTypeKind4["ZodBranded"] = "ZodBranded";
      ZodFirstPartyTypeKind4["ZodPipeline"] = "ZodPipeline";
      ZodFirstPartyTypeKind4["ZodReadonly"] = "ZodReadonly";
    })(ZodFirstPartyTypeKind3 || (ZodFirstPartyTypeKind3 = {}));
    instanceOfType3 = /* @__PURE__ */ __name((cls, params = {
      message: `Input not instance of ${cls.name}`
    }) => custom3((data) => data instanceof cls, params), "instanceOfType");
    stringType3 = ZodString3.create;
    numberType3 = ZodNumber3.create;
    nanType3 = ZodNaN3.create;
    bigIntType3 = ZodBigInt3.create;
    booleanType3 = ZodBoolean3.create;
    dateType3 = ZodDate3.create;
    symbolType3 = ZodSymbol3.create;
    undefinedType3 = ZodUndefined3.create;
    nullType3 = ZodNull3.create;
    anyType3 = ZodAny3.create;
    unknownType3 = ZodUnknown3.create;
    neverType3 = ZodNever3.create;
    voidType3 = ZodVoid3.create;
    arrayType3 = ZodArray3.create;
    objectType3 = ZodObject3.create;
    strictObjectType3 = ZodObject3.strictCreate;
    unionType3 = ZodUnion3.create;
    discriminatedUnionType3 = ZodDiscriminatedUnion3.create;
    intersectionType3 = ZodIntersection3.create;
    tupleType3 = ZodTuple3.create;
    recordType3 = ZodRecord3.create;
    mapType3 = ZodMap3.create;
    setType3 = ZodSet3.create;
    functionType3 = ZodFunction3.create;
    lazyType3 = ZodLazy3.create;
    literalType3 = ZodLiteral3.create;
    enumType3 = ZodEnum3.create;
    nativeEnumType3 = ZodNativeEnum3.create;
    promiseType3 = ZodPromise3.create;
    effectsType3 = ZodEffects3.create;
    optionalType3 = ZodOptional3.create;
    nullableType3 = ZodNullable3.create;
    preprocessType3 = ZodEffects3.createWithPreprocess;
    pipelineType3 = ZodPipeline3.create;
    ostring3 = /* @__PURE__ */ __name(() => stringType3().optional(), "ostring");
    onumber3 = /* @__PURE__ */ __name(() => numberType3().optional(), "onumber");
    oboolean3 = /* @__PURE__ */ __name(() => booleanType3().optional(), "oboolean");
    coerce3 = {
      string: /* @__PURE__ */ __name((arg) => ZodString3.create({ ...arg, coerce: true }), "string"),
      number: /* @__PURE__ */ __name((arg) => ZodNumber3.create({ ...arg, coerce: true }), "number"),
      boolean: /* @__PURE__ */ __name((arg) => ZodBoolean3.create({
        ...arg,
        coerce: true
      }), "boolean"),
      bigint: /* @__PURE__ */ __name((arg) => ZodBigInt3.create({ ...arg, coerce: true }), "bigint"),
      date: /* @__PURE__ */ __name((arg) => ZodDate3.create({ ...arg, coerce: true }), "date")
    };
    NEVER3 = INVALID3;
    z4 = /* @__PURE__ */ Object.freeze({
      __proto__: null,
      defaultErrorMap: errorMap3,
      setErrorMap: setErrorMap3,
      getErrorMap: getErrorMap3,
      makeIssue: makeIssue3,
      EMPTY_PATH: EMPTY_PATH3,
      addIssueToContext: addIssueToContext3,
      ParseStatus: ParseStatus3,
      INVALID: INVALID3,
      DIRTY: DIRTY3,
      OK: OK3,
      isAborted: isAborted3,
      isDirty: isDirty3,
      isValid: isValid3,
      isAsync: isAsync3,
      get util() {
        return util3;
      },
      get objectUtil() {
        return objectUtil3;
      },
      ZodParsedType: ZodParsedType3,
      getParsedType: getParsedType3,
      ZodType: ZodType3,
      ZodString: ZodString3,
      ZodNumber: ZodNumber3,
      ZodBigInt: ZodBigInt3,
      ZodBoolean: ZodBoolean3,
      ZodDate: ZodDate3,
      ZodSymbol: ZodSymbol3,
      ZodUndefined: ZodUndefined3,
      ZodNull: ZodNull3,
      ZodAny: ZodAny3,
      ZodUnknown: ZodUnknown3,
      ZodNever: ZodNever3,
      ZodVoid: ZodVoid3,
      ZodArray: ZodArray3,
      ZodObject: ZodObject3,
      ZodUnion: ZodUnion3,
      ZodDiscriminatedUnion: ZodDiscriminatedUnion3,
      ZodIntersection: ZodIntersection3,
      ZodTuple: ZodTuple3,
      ZodRecord: ZodRecord3,
      ZodMap: ZodMap3,
      ZodSet: ZodSet3,
      ZodFunction: ZodFunction3,
      ZodLazy: ZodLazy3,
      ZodLiteral: ZodLiteral3,
      ZodEnum: ZodEnum3,
      ZodNativeEnum: ZodNativeEnum3,
      ZodPromise: ZodPromise3,
      ZodEffects: ZodEffects3,
      ZodTransformer: ZodEffects3,
      ZodOptional: ZodOptional3,
      ZodNullable: ZodNullable3,
      ZodDefault: ZodDefault3,
      ZodCatch: ZodCatch3,
      ZodNaN: ZodNaN3,
      BRAND: BRAND3,
      ZodBranded: ZodBranded3,
      ZodPipeline: ZodPipeline3,
      ZodReadonly: ZodReadonly3,
      custom: custom3,
      Schema: ZodType3,
      ZodSchema: ZodType3,
      late: late3,
      get ZodFirstPartyTypeKind() {
        return ZodFirstPartyTypeKind3;
      },
      coerce: coerce3,
      any: anyType3,
      array: arrayType3,
      bigint: bigIntType3,
      boolean: booleanType3,
      date: dateType3,
      discriminatedUnion: discriminatedUnionType3,
      effect: effectsType3,
      "enum": enumType3,
      "function": functionType3,
      "instanceof": instanceOfType3,
      intersection: intersectionType3,
      lazy: lazyType3,
      literal: literalType3,
      map: mapType3,
      nan: nanType3,
      nativeEnum: nativeEnumType3,
      never: neverType3,
      "null": nullType3,
      nullable: nullableType3,
      number: numberType3,
      object: objectType3,
      oboolean: oboolean3,
      onumber: onumber3,
      optional: optionalType3,
      ostring: ostring3,
      pipeline: pipelineType3,
      preprocess: preprocessType3,
      promise: promiseType3,
      record: recordType3,
      set: setType3,
      strictObject: strictObjectType3,
      string: stringType3,
      symbol: symbolType3,
      transformer: effectsType3,
      tuple: tupleType3,
      "undefined": undefinedType3,
      union: unionType3,
      unknown: unknownType3,
      "void": voidType3,
      NEVER: NEVER3,
      ZodIssueCode: ZodIssueCode3,
      quotelessJson: quotelessJson3,
      ZodError: ZodError3
    });
  }
});
var init_validators = __esm({
  "../workflows-shared/src/lib/validators.ts"() {
    init_import_meta_url();
    init_itty_time();
    init_lib5();
    z4.object({
      retries: z4.object({
        delay: z4.number().gte(0).or(z4.string()),
        limit: z4.number().gte(0),
        backoff: z4.enum(["constant", "linear", "exponential"]).optional()
      }).strict().optional(),
      timeout: z4.number().gte(0).or(z4.string()).optional()
    }).strict();
  }
});

// ../../node_modules/.pnpm/xdg-app-paths@8.3.0/node_modules/xdg-app-paths/dist/cjs/lib/XDGAppPaths.js
var require_XDGAppPaths2 = __commonJS({
  "../../node_modules/.pnpm/xdg-app-paths@8.3.0/node_modules/xdg-app-paths/dist/cjs/lib/XDGAppPaths.js"(exports) {
    init_import_meta_url();
    exports.__esModule = true;
    exports.Adapt = void 0;
    function isBoolean4(t13) {
      return typeOf(t13) === "boolean";
    }
    __name(isBoolean4, "isBoolean");
    function isObject5(t13) {
      return typeOf(t13) === "object";
    }
    __name(isObject5, "isObject");
    function isString5(t13) {
      return typeOf(t13) === "string";
    }
    __name(isString5, "isString");
    function typeOf(t13) {
      return typeof t13;
    }
    __name(typeOf, "typeOf");
    function Adapt(adapter_) {
      var meta = adapter_.meta, path84 = adapter_.path, xdg = adapter_.xdg;
      var XDGAppPaths_ = /* @__PURE__ */ function() {
        function XDGAppPaths_2(options_) {
          if (options_ === void 0) {
            options_ = {};
          }
          var _a5, _b2, _c3;
          function XDGAppPaths(options2) {
            if (options2 === void 0) {
              options2 = {};
            }
            return new XDGAppPaths_2(options2);
          }
          __name(XDGAppPaths, "XDGAppPaths");
          var options = isObject5(options_) ? options_ : { name: options_ };
          var suffix = (_a5 = options.suffix) !== null && _a5 !== void 0 ? _a5 : "";
          var isolated_ = (_b2 = options.isolated) !== null && _b2 !== void 0 ? _b2 : true;
          var namePriorityList = [
            options.name,
            meta.pkgMainFilename(),
            meta.mainFilename()
          ];
          var nameFallback = "$eval";
          var name2 = path84.parse(((_c3 = namePriorityList.find(function(e10) {
            return isString5(e10);
          })) !== null && _c3 !== void 0 ? _c3 : nameFallback) + suffix).name;
          XDGAppPaths.$name = /* @__PURE__ */ __name(function $name() {
            return name2;
          }, "$name");
          XDGAppPaths.$isolated = /* @__PURE__ */ __name(function $isolated() {
            return isolated_;
          }, "$isolated");
          function isIsolated(dirOptions) {
            var _a6;
            dirOptions = dirOptions !== null && dirOptions !== void 0 ? dirOptions : { isolated: isolated_ };
            var isolated = isBoolean4(dirOptions) ? dirOptions : (_a6 = dirOptions.isolated) !== null && _a6 !== void 0 ? _a6 : isolated_;
            return isolated;
          }
          __name(isIsolated, "isIsolated");
          function finalPathSegment(dirOptions) {
            return isIsolated(dirOptions) ? name2 : "";
          }
          __name(finalPathSegment, "finalPathSegment");
          XDGAppPaths.cache = /* @__PURE__ */ __name(function cache5(dirOptions) {
            return path84.join(xdg.cache(), finalPathSegment(dirOptions));
          }, "cache");
          XDGAppPaths.config = /* @__PURE__ */ __name(function config(dirOptions) {
            return path84.join(xdg.config(), finalPathSegment(dirOptions));
          }, "config");
          XDGAppPaths.data = /* @__PURE__ */ __name(function data(dirOptions) {
            return path84.join(xdg.data(), finalPathSegment(dirOptions));
          }, "data");
          XDGAppPaths.runtime = /* @__PURE__ */ __name(function runtime(dirOptions) {
            return xdg.runtime() ? path84.join(xdg.runtime(), finalPathSegment(dirOptions)) : void 0;
          }, "runtime");
          XDGAppPaths.state = /* @__PURE__ */ __name(function state2(dirOptions) {
            return path84.join(xdg.state(), finalPathSegment(dirOptions));
          }, "state");
          XDGAppPaths.configDirs = /* @__PURE__ */ __name(function configDirs(dirOptions) {
            return xdg.configDirs().map(function(s7) {
              return path84.join(s7, finalPathSegment(dirOptions));
            });
          }, "configDirs");
          XDGAppPaths.dataDirs = /* @__PURE__ */ __name(function dataDirs(dirOptions) {
            return xdg.dataDirs().map(function(s7) {
              return path84.join(s7, finalPathSegment(dirOptions));
            });
          }, "dataDirs");
          return XDGAppPaths;
        }
        __name(XDGAppPaths_2, "XDGAppPaths_");
        return XDGAppPaths_2;
      }();
      return { XDGAppPaths: new XDGAppPaths_() };
    }
    __name(Adapt, "Adapt");
    exports.Adapt = Adapt;
  }
});

// ../../node_modules/.pnpm/xdg-portable@10.6.0/node_modules/xdg-portable/dist/cjs/lib/XDG.js
var require_XDG2 = __commonJS({
  "../../node_modules/.pnpm/xdg-portable@10.6.0/node_modules/xdg-portable/dist/cjs/lib/XDG.js"(exports) {
    init_import_meta_url();
    var __spreadArray2 = exports && exports.__spreadArray || function(to, from) {
      for (var i7 = 0, il = from.length, j7 = to.length; i7 < il; i7++, j7++)
        to[j7] = from[i7];
      return to;
    };
    exports.__esModule = true;
    exports.Adapt = void 0;
    function Adapt(adapter_) {
      var env6 = adapter_.env, osPaths = adapter_.osPaths, path84 = adapter_.path;
      var isMacOS = /^darwin$/i.test(adapter_.process.platform);
      var isWinOS = /^win/i.test(adapter_.process.platform);
      function baseDir() {
        return osPaths.home() || osPaths.temp();
      }
      __name(baseDir, "baseDir");
      function valOrPath(val2, pathSegments) {
        return val2 || path84.join.apply(path84, pathSegments);
      }
      __name(valOrPath, "valOrPath");
      var linux = /* @__PURE__ */ __name(function() {
        var cache5 = /* @__PURE__ */ __name(function() {
          return valOrPath(env6.get("XDG_CACHE_HOME"), [baseDir(), ".cache"]);
        }, "cache");
        var config = /* @__PURE__ */ __name(function() {
          return valOrPath(env6.get("XDG_CONFIG_HOME"), [baseDir(), ".config"]);
        }, "config");
        var data = /* @__PURE__ */ __name(function() {
          return valOrPath(env6.get("XDG_DATA_HOME"), [baseDir(), ".local", "share"]);
        }, "data");
        var runtime = /* @__PURE__ */ __name(function() {
          return env6.get("XDG_RUNTIME_DIR") || void 0;
        }, "runtime");
        var state2 = /* @__PURE__ */ __name(function() {
          return valOrPath(env6.get("XDG_STATE_HOME"), [baseDir(), ".local", "state"]);
        }, "state");
        return { cache: cache5, config, data, runtime, state: state2 };
      }, "linux");
      var macos = /* @__PURE__ */ __name(function() {
        var cache5 = /* @__PURE__ */ __name(function() {
          return valOrPath(env6.get("XDG_CACHE_HOME"), [baseDir(), "Library", "Caches"]);
        }, "cache");
        var config = /* @__PURE__ */ __name(function() {
          return valOrPath(env6.get("XDG_CONFIG_HOME"), [baseDir(), "Library", "Preferences"]);
        }, "config");
        var data = /* @__PURE__ */ __name(function() {
          return valOrPath(env6.get("XDG_DATA_HOME"), [baseDir(), "Library", "Application Support"]);
        }, "data");
        var runtime = /* @__PURE__ */ __name(function() {
          return env6.get("XDG_RUNTIME_DIR") || void 0;
        }, "runtime");
        var state2 = /* @__PURE__ */ __name(function() {
          return valOrPath(env6.get("XDG_STATE_HOME"), [baseDir(), "Library", "State"]);
        }, "state");
        return { cache: cache5, config, data, runtime, state: state2 };
      }, "macos");
      var windows = /* @__PURE__ */ __name(function() {
        function appData() {
          return valOrPath(env6.get("APPDATA"), [baseDir(), "AppData", "Roaming"]);
        }
        __name(appData, "appData");
        function localAppData() {
          return valOrPath(env6.get("LOCALAPPDATA"), [baseDir(), "AppData", "Local"]);
        }
        __name(localAppData, "localAppData");
        var cache5 = /* @__PURE__ */ __name(function() {
          return valOrPath(env6.get("XDG_CACHE_HOME"), [localAppData(), "xdg.cache"]);
        }, "cache");
        var config = /* @__PURE__ */ __name(function() {
          return valOrPath(env6.get("XDG_CONFIG_HOME"), [appData(), "xdg.config"]);
        }, "config");
        var data = /* @__PURE__ */ __name(function() {
          return valOrPath(env6.get("XDG_DATA_HOME"), [appData(), "xdg.data"]);
        }, "data");
        var runtime = /* @__PURE__ */ __name(function() {
          return env6.get("XDG_RUNTIME_DIR") || void 0;
        }, "runtime");
        var state2 = /* @__PURE__ */ __name(function() {
          return valOrPath(env6.get("XDG_STATE_HOME"), [localAppData(), "xdg.state"]);
        }, "state");
        return { cache: cache5, config, data, runtime, state: state2 };
      }, "windows");
      var XDG_ = /* @__PURE__ */ function() {
        function XDG_2() {
          function XDG() {
            return new XDG_2();
          }
          __name(XDG, "XDG");
          var extension = isMacOS ? macos() : isWinOS ? windows() : linux();
          XDG.cache = extension.cache;
          XDG.config = extension.config;
          XDG.data = extension.data;
          XDG.runtime = extension.runtime;
          XDG.state = extension.state;
          XDG.configDirs = /* @__PURE__ */ __name(function configDirs() {
            var pathList = env6.get("XDG_CONFIG_DIRS");
            return __spreadArray2([extension.config()], pathList ? pathList.split(path84.delimiter) : []);
          }, "configDirs");
          XDG.dataDirs = /* @__PURE__ */ __name(function dataDirs() {
            var pathList = env6.get("XDG_DATA_DIRS");
            return __spreadArray2([extension.data()], pathList ? pathList.split(path84.delimiter) : []);
          }, "dataDirs");
          return XDG;
        }
        __name(XDG_2, "XDG_");
        return XDG_2;
      }();
      return { XDG: new XDG_() };
    }
    __name(Adapt, "Adapt");
    exports.Adapt = Adapt;
  }
});

// ../../node_modules/.pnpm/os-paths@7.4.0/node_modules/os-paths/dist/cjs/lib/OSPaths.js
var require_OSPaths2 = __commonJS({
  "../../node_modules/.pnpm/os-paths@7.4.0/node_modules/os-paths/dist/cjs/lib/OSPaths.js"(exports) {
    init_import_meta_url();
    var __spreadArray2 = exports && exports.__spreadArray || function(to, from) {
      for (var i7 = 0, il = from.length, j7 = to.length; i7 < il; i7++, j7++)
        to[j7] = from[i7];
      return to;
    };
    exports.__esModule = true;
    exports.Adapt = void 0;
    function isEmpty(s7) {
      return !s7;
    }
    __name(isEmpty, "isEmpty");
    function Adapt(adapter_) {
      var env6 = adapter_.env, os13 = adapter_.os, path84 = adapter_.path;
      var isWinOS = /^win/i.test(adapter_.process.platform);
      function normalizePath2(path_) {
        return path_ ? adapter_.path.normalize(adapter_.path.join(path_, ".")) : void 0;
      }
      __name(normalizePath2, "normalizePath");
      function home() {
        var posix2 = /* @__PURE__ */ __name(function() {
          return normalizePath2((typeof os13.homedir === "function" ? os13.homedir() : void 0) || env6.get("HOME"));
        }, "posix");
        var windows = /* @__PURE__ */ __name(function() {
          var priorityList = [
            typeof os13.homedir === "function" ? os13.homedir() : void 0,
            env6.get("USERPROFILE"),
            env6.get("HOME"),
            env6.get("HOMEDRIVE") || env6.get("HOMEPATH") ? path84.join(env6.get("HOMEDRIVE") || "", env6.get("HOMEPATH") || "") : void 0
          ];
          return normalizePath2(priorityList.find(function(v8) {
            return !isEmpty(v8);
          }));
        }, "windows");
        return isWinOS ? windows() : posix2();
      }
      __name(home, "home");
      function temp() {
        function joinPathToBase(base, segments) {
          return base ? path84.join.apply(path84, __spreadArray2([base], segments)) : void 0;
        }
        __name(joinPathToBase, "joinPathToBase");
        function posix2() {
          var fallback = "/tmp";
          var priorityList = [
            typeof os13.tmpdir === "function" ? os13.tmpdir() : void 0,
            env6.get("TMPDIR"),
            env6.get("TEMP"),
            env6.get("TMP")
          ];
          return normalizePath2(priorityList.find(function(v8) {
            return !isEmpty(v8);
          })) || fallback;
        }
        __name(posix2, "posix");
        function windows() {
          var fallback = "C:\\Temp";
          var priorityListLazy = [
            typeof os13.tmpdir === "function" ? os13.tmpdir : function() {
              return void 0;
            },
            function() {
              return env6.get("TEMP");
            },
            function() {
              return env6.get("TMP");
            },
            function() {
              return joinPathToBase(env6.get("LOCALAPPDATA"), ["Temp"]);
            },
            function() {
              return joinPathToBase(home(), ["AppData", "Local", "Temp"]);
            },
            function() {
              return joinPathToBase(env6.get("ALLUSERSPROFILE"), ["Temp"]);
            },
            function() {
              return joinPathToBase(env6.get("SystemRoot"), ["Temp"]);
            },
            function() {
              return joinPathToBase(env6.get("windir"), ["Temp"]);
            },
            function() {
              return joinPathToBase(env6.get("SystemDrive"), ["\\", "Temp"]);
            }
          ];
          var v8 = priorityListLazy.find(function(v9) {
            return v9 && !isEmpty(v9());
          });
          return v8 && normalizePath2(v8()) || fallback;
        }
        __name(windows, "windows");
        return isWinOS ? windows() : posix2();
      }
      __name(temp, "temp");
      var OSPaths_ = /* @__PURE__ */ function() {
        function OSPaths_2() {
          function OSPaths() {
            return new OSPaths_2();
          }
          __name(OSPaths, "OSPaths");
          OSPaths.home = home;
          OSPaths.temp = temp;
          return OSPaths;
        }
        __name(OSPaths_2, "OSPaths_");
        return OSPaths_2;
      }();
      return { OSPaths: new OSPaths_() };
    }
    __name(Adapt, "Adapt");
    exports.Adapt = Adapt;
  }
});

// ../../node_modules/.pnpm/os-paths@7.4.0/node_modules/os-paths/dist/cjs/platform-adapters/node.js
var require_node4 = __commonJS({
  "../../node_modules/.pnpm/os-paths@7.4.0/node_modules/os-paths/dist/cjs/platform-adapters/node.js"(exports) {
    init_import_meta_url();
    var __createBinding2 = exports && exports.__createBinding || (Object.create ? function(o7, m7, k7, k22) {
      if (k22 === void 0) k22 = k7;
      Object.defineProperty(o7, k22, { enumerable: true, get: /* @__PURE__ */ __name(function() {
        return m7[k7];
      }, "get") });
    } : function(o7, m7, k7, k22) {
      if (k22 === void 0) k22 = k7;
      o7[k22] = m7[k7];
    });
    var __setModuleDefault2 = exports && exports.__setModuleDefault || (Object.create ? function(o7, v8) {
      Object.defineProperty(o7, "default", { enumerable: true, value: v8 });
    } : function(o7, v8) {
      o7["default"] = v8;
    });
    var __importStar2 = exports && exports.__importStar || function(mod) {
      if (mod && mod.__esModule) return mod;
      var result = {};
      if (mod != null) {
        for (var k7 in mod) if (k7 !== "default" && Object.prototype.hasOwnProperty.call(mod, k7)) __createBinding2(result, mod, k7);
      }
      __setModuleDefault2(result, mod);
      return result;
    };
    exports.__esModule = true;
    exports.adapter = void 0;
    var os13 = __importStar2(__require("os"));
    var path84 = __importStar2(__require("path"));
    exports.adapter = {
      atImportPermissions: { env: true },
      env: {
        get: /* @__PURE__ */ __name(function(s7) {
          return process.env[s7];
        }, "get")
      },
      os: os13,
      path: path84,
      process
    };
  }
});

// ../../node_modules/.pnpm/os-paths@7.4.0/node_modules/os-paths/dist/cjs/mod.cjs.js
var require_mod_cjs4 = __commonJS({
  "../../node_modules/.pnpm/os-paths@7.4.0/node_modules/os-paths/dist/cjs/mod.cjs.js"(exports, module2) {
    init_import_meta_url();
    var OSPaths_js_1 = require_OSPaths2();
    var node_js_1 = require_node4();
    module2.exports = OSPaths_js_1.Adapt(node_js_1.adapter).OSPaths;
  }
});

// ../../node_modules/.pnpm/xdg-portable@10.6.0/node_modules/xdg-portable/dist/cjs/platform-adapters/node.js
var require_node5 = __commonJS({
  "../../node_modules/.pnpm/xdg-portable@10.6.0/node_modules/xdg-portable/dist/cjs/platform-adapters/node.js"(exports) {
    init_import_meta_url();
    var __createBinding2 = exports && exports.__createBinding || (Object.create ? function(o7, m7, k7, k22) {
      if (k22 === void 0) k22 = k7;
      Object.defineProperty(o7, k22, { enumerable: true, get: /* @__PURE__ */ __name(function() {
        return m7[k7];
      }, "get") });
    } : function(o7, m7, k7, k22) {
      if (k22 === void 0) k22 = k7;
      o7[k22] = m7[k7];
    });
    var __setModuleDefault2 = exports && exports.__setModuleDefault || (Object.create ? function(o7, v8) {
      Object.defineProperty(o7, "default", { enumerable: true, value: v8 });
    } : function(o7, v8) {
      o7["default"] = v8;
    });
    var __importStar2 = exports && exports.__importStar || function(mod) {
      if (mod && mod.__esModule) return mod;
      var result = {};
      if (mod != null) {
        for (var k7 in mod) if (k7 !== "default" && Object.prototype.hasOwnProperty.call(mod, k7)) __createBinding2(result, mod, k7);
      }
      __setModuleDefault2(result, mod);
      return result;
    };
    var __importDefault2 = exports && exports.__importDefault || function(mod) {
      return mod && mod.__esModule ? mod : { "default": mod };
    };
    exports.__esModule = true;
    exports.adapter = void 0;
    var path84 = __importStar2(__require("path"));
    var os_paths_1 = __importDefault2(require_mod_cjs4());
    exports.adapter = {
      atImportPermissions: { env: true },
      env: {
        get: /* @__PURE__ */ __name(function(s7) {
          return process.env[s7];
        }, "get")
      },
      osPaths: os_paths_1["default"],
      path: path84,
      process
    };
  }
});

// ../../node_modules/.pnpm/xdg-portable@10.6.0/node_modules/xdg-portable/dist/cjs/mod.cjs.js
var require_mod_cjs5 = __commonJS({
  "../../node_modules/.pnpm/xdg-portable@10.6.0/node_modules/xdg-portable/dist/cjs/mod.cjs.js"(exports, module2) {
    init_import_meta_url();
    var XDG_js_1 = require_XDG2();
    var node_js_1 = require_node5();
    module2.exports = XDG_js_1.Adapt(node_js_1.adapter).XDG;
  }
});

// ../../node_modules/.pnpm/xdg-app-paths@8.3.0/node_modules/xdg-app-paths/dist/cjs/platform-adapters/node.js
var require_node6 = __commonJS({
  "../../node_modules/.pnpm/xdg-app-paths@8.3.0/node_modules/xdg-app-paths/dist/cjs/platform-adapters/node.js"(exports) {
    init_import_meta_url();
    var __createBinding2 = exports && exports.__createBinding || (Object.create ? function(o7, m7, k7, k22) {
      if (k22 === void 0) k22 = k7;
      Object.defineProperty(o7, k22, { enumerable: true, get: /* @__PURE__ */ __name(function() {
        return m7[k7];
      }, "get") });
    } : function(o7, m7, k7, k22) {
      if (k22 === void 0) k22 = k7;
      o7[k22] = m7[k7];
    });
    var __setModuleDefault2 = exports && exports.__setModuleDefault || (Object.create ? function(o7, v8) {
      Object.defineProperty(o7, "default", { enumerable: true, value: v8 });
    } : function(o7, v8) {
      o7["default"] = v8;
    });
    var __importStar2 = exports && exports.__importStar || function(mod) {
      if (mod && mod.__esModule) return mod;
      var result = {};
      if (mod != null) {
        for (var k7 in mod) if (k7 !== "default" && Object.prototype.hasOwnProperty.call(mod, k7)) __createBinding2(result, mod, k7);
      }
      __setModuleDefault2(result, mod);
      return result;
    };
    var __importDefault2 = exports && exports.__importDefault || function(mod) {
      return mod && mod.__esModule ? mod : { "default": mod };
    };
    exports.__esModule = true;
    exports.adapter = void 0;
    var path84 = __importStar2(__require("path"));
    var xdg_portable_1 = __importDefault2(require_mod_cjs5());
    exports.adapter = {
      atImportPermissions: { env: true, read: true },
      meta: {
        mainFilename: /* @__PURE__ */ __name(function() {
          var requireMain = typeof __require !== "undefined" && __require !== null && __require.main ? __require.main : { filename: void 0 };
          var requireMainFilename = requireMain.filename;
          var filename = (requireMainFilename !== process.execArgv[0] ? requireMainFilename : void 0) || (typeof process._eval === "undefined" ? process.argv[1] : void 0);
          return filename;
        }, "mainFilename"),
        pkgMainFilename: /* @__PURE__ */ __name(function() {
          return process.pkg ? process.execPath : void 0;
        }, "pkgMainFilename")
      },
      path: path84,
      process,
      xdg: xdg_portable_1["default"]
    };
  }
});

// ../../node_modules/.pnpm/xdg-app-paths@8.3.0/node_modules/xdg-app-paths/dist/cjs/mod.cjs.js
var require_mod_cjs6 = __commonJS({
  "../../node_modules/.pnpm/xdg-app-paths@8.3.0/node_modules/xdg-app-paths/dist/cjs/mod.cjs.js"(exports, module2) {
    init_import_meta_url();
    var XDGAppPaths_js_1 = require_XDGAppPaths2();
    var node_js_1 = require_node6();
    module2.exports = XDGAppPaths_js_1.Adapt(node_js_1.adapter).XDGAppPaths;
  }
});

// ../../node_modules/.pnpm/xdg-app-paths@8.3.0/node_modules/xdg-app-paths/dist/cjs/esm-wrapper/mod.esm.js
var mod_esm_exports2 = {};
__export(mod_esm_exports2, {
  default: () => mod_esm_default2
});
var import_mod_cjs2, mod_esm_default2;
var init_mod_esm = __esm({
  "../../node_modules/.pnpm/xdg-app-paths@8.3.0/node_modules/xdg-app-paths/dist/cjs/esm-wrapper/mod.esm.js"() {
    init_import_meta_url();
    import_mod_cjs2 = __toESM(require_mod_cjs6(), 1);
    __reExport(mod_esm_exports2, __toESM(require_mod_cjs6(), 1));
    mod_esm_default2 = import_mod_cjs2.default;
  }
});
function isDirectory2(path84) {
  return fs29__namespace.default.statSync(path84, { throwIfNoEntry: false })?.isDirectory() ?? false;
}
var init_fs_helpers = __esm({
  "../workers-utils/src/fs-helpers.ts"() {
    init_import_meta_url();
    __name(isDirectory2, "isDirectory");
  }
});
function getGlobalWranglerConfigPath2() {
  const configDir = mod_esm_default2(".wrangler").config();
  const legacyConfigDir = path3__namespace.default.join(os11__namespace.default.homedir(), ".wrangler");
  if (isDirectory2(legacyConfigDir)) {
    return legacyConfigDir;
  } else {
    return configDir;
  }
}
var init_global_wrangler_config_path = __esm({
  "../workers-utils/src/global-wrangler-config-path.ts"() {
    init_import_meta_url();
    init_mod_esm();
    init_fs_helpers();
    __name(getGlobalWranglerConfigPath2, "getGlobalWranglerConfigPath");
  }
});

// ../workers-utils/src/environment-variables/factory.ts
function getBooleanEnvironmentVariableFactory2(options) {
  return () => {
    if (!(options.variableName in process.env) || process.env[options.variableName] === void 0) {
      return typeof options.defaultValue === "function" ? options.defaultValue() : options.defaultValue;
    }
    switch (process.env[options.variableName]?.toLowerCase()) {
      case "true":
        return true;
      case "false":
        return false;
      default:
        throw new UserError2(
          `Expected ${options.variableName} to be "true" or "false", but got ${JSON.stringify(
            process.env[options.variableName]
          )}`
        );
    }
  };
}
function getEnvironmentVariableFactory2({
  variableName,
  deprecatedName,
  choices,
  defaultValue
}) {
  let hasWarned = false;
  return () => {
    if (variableName in process.env) {
      return getProcessEnv2(variableName, choices);
    }
    if (deprecatedName && deprecatedName in process.env) {
      if (!hasWarned) {
        hasWarned = true;
        console.warn(
          `Using "${deprecatedName}" environment variable. This is deprecated. Please use "${variableName}", instead.`
        );
      }
      return getProcessEnv2(deprecatedName, choices);
    }
    return defaultValue?.();
  };
}
function getProcessEnv2(variableName, choices) {
  assertOneOf2(choices, process.env[variableName]);
  return process.env[variableName];
}
function assertOneOf2(choices, value) {
  if (Array.isArray(choices) && !choices.includes(value)) {
    throw new UserError2(
      `Expected ${JSON.stringify(value)} to be one of ${JSON.stringify(choices)}`
    );
  }
}
var init_factory = __esm({
  "../workers-utils/src/environment-variables/factory.ts"() {
    init_import_meta_url();
    init_errors4();
    __name(getBooleanEnvironmentVariableFactory2, "getBooleanEnvironmentVariableFactory");
    __name(getEnvironmentVariableFactory2, "getEnvironmentVariableFactory");
    __name(getProcessEnv2, "getProcessEnv");
    __name(assertOneOf2, "assertOneOf");
  }
});
var init_misc_variables = __esm({
  "../workers-utils/src/environment-variables/misc-variables.ts"() {
    init_import_meta_url();
    init_esm2();
    init_errors4();
    init_global_wrangler_config_path();
    init_factory();
  }
});

// ../workers-utils/src/config/diagnostics.ts
var init_diagnostics2 = __esm({
  "../workers-utils/src/config/diagnostics.ts"() {
    init_import_meta_url();
  }
});

// ../workers-utils/src/config/validation-helpers.ts
var init_validation_helpers = __esm({
  "../workers-utils/src/config/validation-helpers.ts"() {
    init_import_meta_url();
  }
});
var init_validation2 = __esm({
  "../workers-utils/src/config/validation.ts"() {
    init_import_meta_url();
    init_validators();
    init_esm2();
    init_misc_variables();
    init_errors4();
    init_fs_helpers();
    init_config_helpers();
    init_diagnostics2();
    init_validation_helpers();
    init_config7();
  }
});

// ../workers-utils/src/config/validation-pages.ts
var init_validation_pages = __esm({
  "../workers-utils/src/config/validation-pages.ts"() {
    init_import_meta_url();
    init_errors4();
    init_config6();
    init_diagnostics2();
    init_validation_helpers();
  }
});

// ../workers-utils/src/assert-never.ts
var init_assert_never = __esm({
  "../workers-utils/src/assert-never.ts"() {
    init_import_meta_url();
  }
});

// ../workers-utils/src/map-worker-metadata-bindings.ts
var init_map_worker_metadata_bindings = __esm({
  "../workers-utils/src/map-worker-metadata-bindings.ts"() {
    init_import_meta_url();
    init_assert_never();
  }
});
var init_compatibility_date = __esm({
  "../workers-utils/src/compatibility-date.ts"() {
    init_import_meta_url();
  }
});

// ../workers-utils/src/construct-wrangler-config.ts
var init_construct_wrangler_config = __esm({
  "../workers-utils/src/construct-wrangler-config.ts"() {
    init_import_meta_url();
    init_compatibility_date();
    init_constants4();
    init_map_worker_metadata_bindings();
  }
});

// ../workers-utils/src/prometheus-metrics.ts
var init_prometheus_metrics = __esm({
  "../workers-utils/src/prometheus-metrics.ts"() {
    init_import_meta_url();
  }
});

// ../workers-utils/src/index.ts
var init_src2 = __esm({
  "../workers-utils/src/index.ts"() {
    init_import_meta_url();
    init_environment();
    init_config6();
    init_config7();
    init_patch_config();
    init_worker();
    init_types5();
    init_parse2();
    init_validation2();
    init_validation_pages();
    init_diagnostics2();
    init_validation_helpers();
    init_config_helpers();
    init_errors4();
    init_assert_never();
    init_constants4();
    init_map_worker_metadata_bindings();
    init_construct_wrangler_config();
    init_factory();
    init_misc_variables();
    init_global_wrangler_config_path();
    init_compatibility_date();
    init_validation2();
    init_fs_helpers();
    init_prometheus_metrics();
  }
});

// src/metrics/sanitization.ts
function sanitizeArgKeys(args, argv) {
  const special = /* @__PURE__ */ new Set(["$0", "_"]);
  const sanitizedArgs = {};
  for (const arg of Object.keys(args)) {
    if (!special.has(arg) && (argv === void 0 || argv.includes(`--${arg}`) || argv.includes(`-${arg[0]}`))) {
      sanitizedArgs[canonicalArg(arg)] = args[arg];
    }
  }
  return sanitizedArgs;
}
function getAllowedArgs(commandArgAllowList, command2) {
  let allowedArgs = {};
  const commandParts = command2.split(" ");
  while (commandParts.length > 0) {
    const subCommand = commandParts.join(" ");
    allowedArgs = { ...commandArgAllowList[subCommand], ...allowedArgs };
    commandParts.pop();
    if (commandParts.length > 0) {
      const wildcardCommand = commandParts.join(" ") + " *";
      allowedArgs = { ...commandArgAllowList[wildcardCommand], ...allowedArgs };
    }
  }
  return { ...commandArgAllowList["*"], ...allowedArgs };
}
function sanitizeArgValues(sanitizedArgs, allowedArgs) {
  const result = {};
  for (const [key, value] of Object.entries(sanitizedArgs)) {
    const allowedValuesForArg = allowedArgs[key];
    if (allowedValuesForArg === ALLOW) {
      result[key] = value;
    } else if (allowedValuesForArg === REDACT) {
      result[key] = "<REDACTED>";
    } else if (Array.isArray(allowedValuesForArg)) {
      result[key] = allowedValuesForArg.includes(value) ? value : "<REDACTED>";
    }
  }
  return result;
}
function canonicalArg(arg) {
  const camelize = /* @__PURE__ */ __name((str) => str.replace(/-./g, (x7) => x7[1].toUpperCase()), "camelize");
  return camelize(arg.replace("experimental", "x"));
}
function sanitizeError(error2) {
  return {
    errorType: getErrorType(error2),
    errorMessage: error2 instanceof UserError ? error2.telemetryMessage : void 0
  };
}
var REDACT, ALLOW, COMMAND_ARG_ALLOW_LIST;
var init_sanitization = __esm({
  "src/metrics/sanitization.ts"() {
    init_import_meta_url();
    init_dist();
    init_handle_errors();
    __name(sanitizeArgKeys, "sanitizeArgKeys");
    REDACT = Symbol("REDACT");
    ALLOW = Symbol("ALLOW");
    COMMAND_ARG_ALLOW_LIST = {
      // * applies to all commands
      "*": {
        format: ALLOW,
        logLevel: ALLOW
      },
      tail: { status: ALLOW },
      types: {
        xIncludeRuntime: [".wrangler/types/runtime.d.ts"],
        path: ["worker-configuration.d.ts"]
      }
    };
    __name(getAllowedArgs, "getAllowedArgs");
    __name(sanitizeArgValues, "sanitizeArgValues");
    __name(canonicalArg, "canonicalArg");
    __name(sanitizeError, "sanitizeError");
  }
});
function writeOutput(entry) {
  if (outputFilePath === void 0) {
    outputFilePath = getOutputFilePath();
  }
  if (outputFilePath !== null) {
    ensureDirectoryExistsSync(outputFilePath);
    const entryJSON = JSON.stringify({
      ...entry,
      timestamp: (/* @__PURE__ */ new Date()).toISOString()
    });
    fs29.appendFileSync(outputFilePath, entryJSON + "\n");
  }
}
function getOutputFilePath() {
  const outputFilePathFromEnv = getOutputFilePathFromEnv();
  if (outputFilePathFromEnv) {
    return outputFilePathFromEnv;
  }
  const outputFileDirectoryFromEnv = getOutputFileDirectoryFromEnv();
  if (outputFileDirectoryFromEnv) {
    const date = (/* @__PURE__ */ new Date()).toISOString().replaceAll(":", "-").replace(".", "_").replace("T", "_").replace("Z", "");
    return path3.resolve(
      outputFileDirectoryFromEnv,
      `wrangler-output-${date}-${crypto2.randomBytes(3).toString("hex")}.json`
    );
  }
  return null;
}
var outputFilePath;
var init_output = __esm({
  "src/output.ts"() {
    init_import_meta_url();
    init_dist();
    init_filesystem();
    __name(writeOutput, "writeOutput");
    outputFilePath = void 0;
    __name(getOutputFilePath, "getOutputFilePath");
  }
});

// ../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/is.js
function isError(wat) {
  switch (objectToString.call(wat)) {
    case "[object Error]":
    case "[object Exception]":
    case "[object DOMException]":
      return true;
    default:
      return isInstanceOf(wat, Error);
  }
}
function isBuiltin(wat, className) {
  return objectToString.call(wat) === `[object ${className}]`;
}
function isString4(wat) {
  return isBuiltin(wat, "String");
}
function isPrimitive(wat) {
  return wat === null || typeof wat !== "object" && typeof wat !== "function";
}
function isPlainObject3(wat) {
  return isBuiltin(wat, "Object");
}
function isEvent(wat) {
  return typeof Event !== "undefined" && isInstanceOf(wat, Event);
}
function isElement(wat) {
  return typeof Element !== "undefined" && isInstanceOf(wat, Element);
}
function isRegExp(wat) {
  return isBuiltin(wat, "RegExp");
}
function isThenable(wat) {
  return Boolean(wat && wat.then && typeof wat.then === "function");
}
function isSyntheticEvent(wat) {
  return isPlainObject3(wat) && "nativeEvent" in wat && "preventDefault" in wat && "stopPropagation" in wat;
}
function isNaN2(wat) {
  return typeof wat === "number" && wat !== wat;
}
function isInstanceOf(wat, base) {
  try {
    return wat instanceof base;
  } catch (_e3) {
    return false;
  }
}
function isVueViewModel(wat) {
  return !!(typeof wat === "object" && wat !== null && (wat.__isVue || wat._isVue));
}
var objectToString;
var init_is = __esm({
  "../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/is.js"() {
    init_import_meta_url();
    objectToString = Object.prototype.toString;
    __name(isError, "isError");
    __name(isBuiltin, "isBuiltin");
    __name(isString4, "isString");
    __name(isPrimitive, "isPrimitive");
    __name(isPlainObject3, "isPlainObject");
    __name(isEvent, "isEvent");
    __name(isElement, "isElement");
    __name(isRegExp, "isRegExp");
    __name(isThenable, "isThenable");
    __name(isSyntheticEvent, "isSyntheticEvent");
    __name(isNaN2, "isNaN");
    __name(isInstanceOf, "isInstanceOf");
    __name(isVueViewModel, "isVueViewModel");
  }
});

// ../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/string.js
function truncate3(str, max = 0) {
  if (typeof str !== "string" || max === 0) {
    return str;
  }
  return str.length <= max ? str : `${str.slice(0, max)}...`;
}
function snipLine(line, colno) {
  let newLine = line;
  const lineLength = newLine.length;
  if (lineLength <= 150) {
    return newLine;
  }
  if (colno > lineLength) {
    colno = lineLength;
  }
  let start = Math.max(colno - 60, 0);
  if (start < 5) {
    start = 0;
  }
  let end = Math.min(start + 140, lineLength);
  if (end > lineLength - 5) {
    end = lineLength;
  }
  if (end === lineLength) {
    start = Math.max(end - 140, 0);
  }
  newLine = newLine.slice(start, end);
  if (start > 0) {
    newLine = `'{snip} ${newLine}`;
  }
  if (end < lineLength) {
    newLine += " {snip}";
  }
  return newLine;
}
function isMatchingPattern(value, pattern, requireExactStringMatch = false) {
  if (!isString4(value)) {
    return false;
  }
  if (isRegExp(pattern)) {
    return pattern.test(value);
  }
  if (isString4(pattern)) {
    return requireExactStringMatch ? value === pattern : value.includes(pattern);
  }
  return false;
}
function stringMatchesSomePattern(testString, patterns = [], requireExactStringMatch = false) {
  return patterns.some((pattern) => isMatchingPattern(testString, pattern, requireExactStringMatch));
}
var init_string = __esm({
  "../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/string.js"() {
    init_import_meta_url();
    init_is();
    __name(truncate3, "truncate");
    __name(snipLine, "snipLine");
    __name(isMatchingPattern, "isMatchingPattern");
    __name(stringMatchesSomePattern, "stringMatchesSomePattern");
  }
});

// ../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/aggregate-errors.js
function applyAggregateErrorsToEvent(exceptionFromErrorImplementation, parser2, maxValueLimit = 250, key, limit2, event, hint) {
  if (!event.exception || !event.exception.values || !hint || !isInstanceOf(hint.originalException, Error)) {
    return;
  }
  const originalException = event.exception.values.length > 0 ? event.exception.values[event.exception.values.length - 1] : void 0;
  if (originalException) {
    event.exception.values = truncateAggregateExceptions(
      aggregateExceptionsFromError(
        exceptionFromErrorImplementation,
        parser2,
        limit2,
        hint.originalException,
        key,
        event.exception.values,
        originalException,
        0
      ),
      maxValueLimit
    );
  }
}
function aggregateExceptionsFromError(exceptionFromErrorImplementation, parser2, limit2, error2, key, prevExceptions, exception, exceptionId) {
  if (prevExceptions.length >= limit2 + 1) {
    return prevExceptions;
  }
  let newExceptions = [...prevExceptions];
  if (isInstanceOf(error2[key], Error)) {
    applyExceptionGroupFieldsForParentException(exception, exceptionId);
    const newException = exceptionFromErrorImplementation(parser2, error2[key]);
    const newExceptionId = newExceptions.length;
    applyExceptionGroupFieldsForChildException(newException, key, newExceptionId, exceptionId);
    newExceptions = aggregateExceptionsFromError(
      exceptionFromErrorImplementation,
      parser2,
      limit2,
      error2[key],
      key,
      [newException, ...newExceptions],
      newException,
      newExceptionId
    );
  }
  if (Array.isArray(error2.errors)) {
    error2.errors.forEach((childError, i7) => {
      if (isInstanceOf(childError, Error)) {
        applyExceptionGroupFieldsForParentException(exception, exceptionId);
        const newException = exceptionFromErrorImplementation(parser2, childError);
        const newExceptionId = newExceptions.length;
        applyExceptionGroupFieldsForChildException(newException, `errors[${i7}]`, newExceptionId, exceptionId);
        newExceptions = aggregateExceptionsFromError(
          exceptionFromErrorImplementation,
          parser2,
          limit2,
          childError,
          key,
          [newException, ...newExceptions],
          newException,
          newExceptionId
        );
      }
    });
  }
  return newExceptions;
}
function applyExceptionGroupFieldsForParentException(exception, exceptionId) {
  exception.mechanism = exception.mechanism || { type: "generic", handled: true };
  exception.mechanism = {
    ...exception.mechanism,
    is_exception_group: true,
    exception_id: exceptionId
  };
}
function applyExceptionGroupFieldsForChildException(exception, source, exceptionId, parentId) {
  exception.mechanism = exception.mechanism || { type: "generic", handled: true };
  exception.mechanism = {
    ...exception.mechanism,
    type: "chained",
    source,
    exception_id: exceptionId,
    parent_id: parentId
  };
}
function truncateAggregateExceptions(exceptions, maxValueLength) {
  return exceptions.map((exception) => {
    if (exception.value) {
      exception.value = truncate3(exception.value, maxValueLength);
    }
    return exception;
  });
}
var init_aggregate_errors = __esm({
  "../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/aggregate-errors.js"() {
    init_import_meta_url();
    init_is();
    init_string();
    __name(applyAggregateErrorsToEvent, "applyAggregateErrorsToEvent");
    __name(aggregateExceptionsFromError, "aggregateExceptionsFromError");
    __name(applyExceptionGroupFieldsForParentException, "applyExceptionGroupFieldsForParentException");
    __name(applyExceptionGroupFieldsForChildException, "applyExceptionGroupFieldsForChildException");
    __name(truncateAggregateExceptions, "truncateAggregateExceptions");
  }
});

// ../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/worldwide.js
function isGlobalObj(obj) {
  return obj && obj.Math == Math ? obj : void 0;
}
function getGlobalObject() {
  return GLOBAL_OBJ;
}
function getGlobalSingleton(name2, creator, obj) {
  const gbl = obj || GLOBAL_OBJ;
  const __SENTRY__ = gbl.__SENTRY__ = gbl.__SENTRY__ || {};
  const singleton = __SENTRY__[name2] || (__SENTRY__[name2] = creator());
  return singleton;
}
var GLOBAL_OBJ;
var init_worldwide = __esm({
  "../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/worldwide.js"() {
    init_import_meta_url();
    __name(isGlobalObj, "isGlobalObj");
    GLOBAL_OBJ = typeof globalThis == "object" && isGlobalObj(globalThis) || // eslint-disable-next-line no-restricted-globals
    typeof window == "object" && isGlobalObj(window) || typeof self == "object" && isGlobalObj(self) || typeof global == "object" && isGlobalObj(global) || /* @__PURE__ */ function() {
      return this;
    }() || {};
    __name(getGlobalObject, "getGlobalObject");
    __name(getGlobalSingleton, "getGlobalSingleton");
  }
});

// ../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/browser.js
function htmlTreeAsString(elem, options = {}) {
  if (!elem) {
    return "<unknown>";
  }
  try {
    let currentElem = elem;
    const MAX_TRAVERSE_HEIGHT = 5;
    const out = [];
    let height = 0;
    let len = 0;
    const separator = " > ";
    const sepLength = separator.length;
    let nextStr;
    const keyAttrs = Array.isArray(options) ? options : options.keyAttrs;
    const maxStringLength = !Array.isArray(options) && options.maxStringLength || DEFAULT_MAX_STRING_LENGTH;
    while (currentElem && height++ < MAX_TRAVERSE_HEIGHT) {
      nextStr = _htmlElementAsString(currentElem, keyAttrs);
      if (nextStr === "html" || height > 1 && len + out.length * sepLength + nextStr.length >= maxStringLength) {
        break;
      }
      out.push(nextStr);
      len += nextStr.length;
      currentElem = currentElem.parentNode;
    }
    return out.reverse().join(separator);
  } catch (_oO) {
    return "<unknown>";
  }
}
function _htmlElementAsString(el, keyAttrs) {
  const elem = el;
  const out = [];
  let className;
  let classes;
  let key;
  let attr;
  let i7;
  if (!elem || !elem.tagName) {
    return "";
  }
  out.push(elem.tagName.toLowerCase());
  const keyAttrPairs = keyAttrs && keyAttrs.length ? keyAttrs.filter((keyAttr) => elem.getAttribute(keyAttr)).map((keyAttr) => [keyAttr, elem.getAttribute(keyAttr)]) : null;
  if (keyAttrPairs && keyAttrPairs.length) {
    keyAttrPairs.forEach((keyAttrPair) => {
      out.push(`[${keyAttrPair[0]}="${keyAttrPair[1]}"]`);
    });
  } else {
    if (elem.id) {
      out.push(`#${elem.id}`);
    }
    className = elem.className;
    if (className && isString4(className)) {
      classes = className.split(/\s+/);
      for (i7 = 0; i7 < classes.length; i7++) {
        out.push(`.${classes[i7]}`);
      }
    }
  }
  const allowedAttrs = ["aria-label", "type", "name", "title", "alt"];
  for (i7 = 0; i7 < allowedAttrs.length; i7++) {
    key = allowedAttrs[i7];
    attr = elem.getAttribute(key);
    if (attr) {
      out.push(`[${key}="${attr}"]`);
    }
  }
  return out.join("");
}
var DEFAULT_MAX_STRING_LENGTH;
var init_browser = __esm({
  "../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/browser.js"() {
    init_import_meta_url();
    init_is();
    init_worldwide();
    DEFAULT_MAX_STRING_LENGTH = 80;
    __name(htmlTreeAsString, "htmlTreeAsString");
    __name(_htmlElementAsString, "_htmlElementAsString");
  }
});

// ../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/debug-build.js
var DEBUG_BUILD;
var init_debug_build = __esm({
  "../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/debug-build.js"() {
    init_import_meta_url();
    DEBUG_BUILD = typeof __SENTRY_DEBUG__ === "undefined" || __SENTRY_DEBUG__;
  }
});

// ../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/logger.js
function consoleSandbox(callback) {
  if (!("console" in GLOBAL_OBJ)) {
    return callback();
  }
  const console2 = GLOBAL_OBJ.console;
  const wrappedFuncs = {};
  const wrappedLevels = Object.keys(originalConsoleMethods);
  wrappedLevels.forEach((level) => {
    const originalConsoleMethod = originalConsoleMethods[level];
    wrappedFuncs[level] = console2[level];
    console2[level] = originalConsoleMethod;
  });
  try {
    return callback();
  } finally {
    wrappedLevels.forEach((level) => {
      console2[level] = wrappedFuncs[level];
    });
  }
}
function makeLogger() {
  let enabled = false;
  const logger4 = {
    enable: /* @__PURE__ */ __name(() => {
      enabled = true;
    }, "enable"),
    disable: /* @__PURE__ */ __name(() => {
      enabled = false;
    }, "disable"),
    isEnabled: /* @__PURE__ */ __name(() => enabled, "isEnabled")
  };
  if (DEBUG_BUILD) {
    CONSOLE_LEVELS.forEach((name2) => {
      logger4[name2] = (...args) => {
        if (enabled) {
          consoleSandbox(() => {
            GLOBAL_OBJ.console[name2](`${PREFIX}[${name2}]:`, ...args);
          });
        }
      };
    });
  } else {
    CONSOLE_LEVELS.forEach((name2) => {
      logger4[name2] = () => void 0;
    });
  }
  return logger4;
}
var PREFIX, CONSOLE_LEVELS, originalConsoleMethods, logger2;
var init_logger2 = __esm({
  "../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/logger.js"() {
    init_import_meta_url();
    init_debug_build();
    init_worldwide();
    PREFIX = "Sentry Logger ";
    CONSOLE_LEVELS = [
      "debug",
      "info",
      "warn",
      "error",
      "log",
      "assert",
      "trace"
    ];
    originalConsoleMethods = {};
    __name(consoleSandbox, "consoleSandbox");
    __name(makeLogger, "makeLogger");
    logger2 = makeLogger();
  }
});

// ../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/dsn.js
function isValidProtocol(protocol) {
  return protocol === "http" || protocol === "https";
}
function dsnToString(dsn, withPassword = false) {
  const { host, path: path84, pass: pass2, port, projectId, protocol, publicKey } = dsn;
  return `${protocol}://${publicKey}${withPassword && pass2 ? `:${pass2}` : ""}@${host}${port ? `:${port}` : ""}/${path84 ? `${path84}/` : path84}${projectId}`;
}
function dsnFromString(str) {
  const match3 = DSN_REGEX.exec(str);
  if (!match3) {
    consoleSandbox(() => {
      console.error(`Invalid Sentry Dsn: ${str}`);
    });
    return void 0;
  }
  const [protocol, publicKey, pass2 = "", host, port = "", lastPath] = match3.slice(1);
  let path84 = "";
  let projectId = lastPath;
  const split = projectId.split("/");
  if (split.length > 1) {
    path84 = split.slice(0, -1).join("/");
    projectId = split.pop();
  }
  if (projectId) {
    const projectMatch = projectId.match(/^\d+/);
    if (projectMatch) {
      projectId = projectMatch[0];
    }
  }
  return dsnFromComponents({ host, pass: pass2, path: path84, projectId, port, protocol, publicKey });
}
function dsnFromComponents(components) {
  return {
    protocol: components.protocol,
    publicKey: components.publicKey || "",
    pass: components.pass || "",
    host: components.host,
    port: components.port || "",
    path: components.path || "",
    projectId: components.projectId
  };
}
function validateDsn(dsn) {
  if (!DEBUG_BUILD) {
    return true;
  }
  const { port, projectId, protocol } = dsn;
  const requiredComponents = ["protocol", "publicKey", "host", "projectId"];
  const hasMissingRequiredComponent = requiredComponents.find((component) => {
    if (!dsn[component]) {
      logger2.error(`Invalid Sentry Dsn: ${component} missing`);
      return true;
    }
    return false;
  });
  if (hasMissingRequiredComponent) {
    return false;
  }
  if (!projectId.match(/^\d+$/)) {
    logger2.error(`Invalid Sentry Dsn: Invalid projectId ${projectId}`);
    return false;
  }
  if (!isValidProtocol(protocol)) {
    logger2.error(`Invalid Sentry Dsn: Invalid protocol ${protocol}`);
    return false;
  }
  if (port && isNaN(parseInt(port, 10))) {
    logger2.error(`Invalid Sentry Dsn: Invalid port ${port}`);
    return false;
  }
  return true;
}
function makeDsn(from) {
  const components = typeof from === "string" ? dsnFromString(from) : dsnFromComponents(from);
  if (!components || !validateDsn(components)) {
    return void 0;
  }
  return components;
}
var DSN_REGEX;
var init_dsn = __esm({
  "../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/dsn.js"() {
    init_import_meta_url();
    init_debug_build();
    init_logger2();
    DSN_REGEX = /^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;
    __name(isValidProtocol, "isValidProtocol");
    __name(dsnToString, "dsnToString");
    __name(dsnFromString, "dsnFromString");
    __name(dsnFromComponents, "dsnFromComponents");
    __name(validateDsn, "validateDsn");
    __name(makeDsn, "makeDsn");
  }
});

// ../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/error.js
var SentryError;
var init_error5 = __esm({
  "../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/error.js"() {
    init_import_meta_url();
    SentryError = class extends Error {
      static {
        __name(this, "SentryError");
      }
      /** Display name of this error instance. */
      constructor(message, logLevel = "warn") {
        super(message);
        this.message = message;
        this.name = new.target.prototype.constructor.name;
        Object.setPrototypeOf(this, new.target.prototype);
        this.logLevel = logLevel;
      }
    };
  }
});

// ../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/object.js
function fill(source, name2, replacementFactory) {
  if (!(name2 in source)) {
    return;
  }
  const original = source[name2];
  const wrapped = replacementFactory(original);
  if (typeof wrapped === "function") {
    markFunctionWrapped(wrapped, original);
  }
  source[name2] = wrapped;
}
function addNonEnumerableProperty(obj, name2, value) {
  try {
    Object.defineProperty(obj, name2, {
      // enumerable: false, // the default, so we can save on bundle size by not explicitly setting it
      value,
      writable: true,
      configurable: true
    });
  } catch (o_O) {
    DEBUG_BUILD && logger2.log(`Failed to add non-enumerable property "${name2}" to object`, obj);
  }
}
function markFunctionWrapped(wrapped, original) {
  try {
    const proto2 = original.prototype || {};
    wrapped.prototype = original.prototype = proto2;
    addNonEnumerableProperty(wrapped, "__sentry_original__", original);
  } catch (o_O) {
  }
}
function getOriginalFunction(func) {
  return func.__sentry_original__;
}
function urlEncode(object) {
  return Object.keys(object).map((key) => `${encodeURIComponent(key)}=${encodeURIComponent(object[key])}`).join("&");
}
function convertToPlainObject(value) {
  if (isError(value)) {
    return {
      message: value.message,
      name: value.name,
      stack: value.stack,
      ...getOwnProperties(value)
    };
  } else if (isEvent(value)) {
    const newObj = {
      type: value.type,
      target: serializeEventTarget(value.target),
      currentTarget: serializeEventTarget(value.currentTarget),
      ...getOwnProperties(value)
    };
    if (typeof CustomEvent !== "undefined" && isInstanceOf(value, CustomEvent)) {
      newObj.detail = value.detail;
    }
    return newObj;
  } else {
    return value;
  }
}
function serializeEventTarget(target) {
  try {
    return isElement(target) ? htmlTreeAsString(target) : Object.prototype.toString.call(target);
  } catch (_oO) {
    return "<unknown>";
  }
}
function getOwnProperties(obj) {
  if (typeof obj === "object" && obj !== null) {
    const extractedProps = {};
    for (const property in obj) {
      if (Object.prototype.hasOwnProperty.call(obj, property)) {
        extractedProps[property] = obj[property];
      }
    }
    return extractedProps;
  } else {
    return {};
  }
}
function extractExceptionKeysForMessage(exception, maxLength = 40) {
  const keys = Object.keys(convertToPlainObject(exception));
  keys.sort();
  if (!keys.length) {
    return "[object has no keys]";
  }
  if (keys[0].length >= maxLength) {
    return truncate3(keys[0], maxLength);
  }
  for (let includedKeys = keys.length; includedKeys > 0; includedKeys--) {
    const serialized = keys.slice(0, includedKeys).join(", ");
    if (serialized.length > maxLength) {
      continue;
    }
    if (includedKeys === keys.length) {
      return serialized;
    }
    return truncate3(serialized, maxLength);
  }
  return "";
}
function dropUndefinedKeys(inputValue) {
  const memoizationMap = /* @__PURE__ */ new Map();
  return _dropUndefinedKeys(inputValue, memoizationMap);
}
function _dropUndefinedKeys(inputValue, memoizationMap) {
  if (isPlainObject3(inputValue)) {
    const memoVal = memoizationMap.get(inputValue);
    if (memoVal !== void 0) {
      return memoVal;
    }
    const returnValue = {};
    memoizationMap.set(inputValue, returnValue);
    for (const key of Object.keys(inputValue)) {
      if (typeof inputValue[key] !== "undefined") {
        returnValue[key] = _dropUndefinedKeys(inputValue[key], memoizationMap);
      }
    }
    return returnValue;
  }
  if (Array.isArray(inputValue)) {
    const memoVal = memoizationMap.get(inputValue);
    if (memoVal !== void 0) {
      return memoVal;
    }
    const returnValue = [];
    memoizationMap.set(inputValue, returnValue);
    inputValue.forEach((item) => {
      returnValue.push(_dropUndefinedKeys(item, memoizationMap));
    });
    return returnValue;
  }
  return inputValue;
}
var init_object = __esm({
  "../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/object.js"() {
    init_import_meta_url();
    init_browser();
    init_debug_build();
    init_is();
    init_logger2();
    init_string();
    __name(fill, "fill");
    __name(addNonEnumerableProperty, "addNonEnumerableProperty");
    __name(markFunctionWrapped, "markFunctionWrapped");
    __name(getOriginalFunction, "getOriginalFunction");
    __name(urlEncode, "urlEncode");
    __name(convertToPlainObject, "convertToPlainObject");
    __name(serializeEventTarget, "serializeEventTarget");
    __name(getOwnProperties, "getOwnProperties");
    __name(extractExceptionKeysForMessage, "extractExceptionKeysForMessage");
    __name(dropUndefinedKeys, "dropUndefinedKeys");
    __name(_dropUndefinedKeys, "_dropUndefinedKeys");
  }
});

// ../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/node-stack-trace.js
function filenameIsInApp(filename, isNative = false) {
  const isInternal = isNative || filename && // It's not internal if it's an absolute linux path
  !filename.startsWith("/") && // It's not internal if it's an absolute windows path
  !filename.includes(":\\") && // It's not internal if the path is starting with a dot
  !filename.startsWith(".") && // It's not internal if the frame has a protocol. In node, this is usually the case if the file got pre-processed with a bundler like webpack
  !filename.match(/^[a-zA-Z]([a-zA-Z0-9.\-+])*:\/\//);
  return !isInternal && filename !== void 0 && !filename.includes("node_modules/");
}
function node(getModule) {
  const FILENAME_MATCH = /^\s*[-]{4,}$/;
  const FULL_MATCH = /at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/;
  return (line) => {
    const lineMatch = line.match(FULL_MATCH);
    if (lineMatch) {
      let object;
      let method;
      let functionName;
      let typeName;
      let methodName;
      if (lineMatch[1]) {
        functionName = lineMatch[1];
        let methodStart = functionName.lastIndexOf(".");
        if (functionName[methodStart - 1] === ".") {
          methodStart--;
        }
        if (methodStart > 0) {
          object = functionName.slice(0, methodStart);
          method = functionName.slice(methodStart + 1);
          const objectEnd = object.indexOf(".Module");
          if (objectEnd > 0) {
            functionName = functionName.slice(objectEnd + 1);
            object = object.slice(0, objectEnd);
          }
        }
        typeName = void 0;
      }
      if (method) {
        typeName = object;
        methodName = method;
      }
      if (method === "<anonymous>") {
        methodName = void 0;
        functionName = void 0;
      }
      if (functionName === void 0) {
        methodName = methodName || "<anonymous>";
        functionName = typeName ? `${typeName}.${methodName}` : methodName;
      }
      let filename = lineMatch[2] && lineMatch[2].startsWith("file://") ? lineMatch[2].slice(7) : lineMatch[2];
      const isNative = lineMatch[5] === "native";
      if (!filename && lineMatch[5] && !isNative) {
        filename = lineMatch[5];
      }
      return {
        filename,
        module: getModule ? getModule(filename) : void 0,
        function: functionName,
        lineno: parseInt(lineMatch[3], 10) || void 0,
        colno: parseInt(lineMatch[4], 10) || void 0,
        in_app: filenameIsInApp(filename, isNative)
      };
    }
    if (line.match(FILENAME_MATCH)) {
      return {
        filename: line
      };
    }
    return void 0;
  };
}
var init_node_stack_trace = __esm({
  "../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/node-stack-trace.js"() {
    init_import_meta_url();
    __name(filenameIsInApp, "filenameIsInApp");
    __name(node, "node");
  }
});

// ../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/stacktrace.js
function createStackParser(...parsers) {
  const sortedParsers = parsers.sort((a7, b11) => a7[0] - b11[0]).map((p7) => p7[1]);
  return (stack, skipFirst = 0) => {
    const frames = [];
    const lines = stack.split("\n");
    for (let i7 = skipFirst; i7 < lines.length; i7++) {
      const line = lines[i7];
      if (line.length > 1024) {
        continue;
      }
      const cleanedLine = WEBPACK_ERROR_REGEXP.test(line) ? line.replace(WEBPACK_ERROR_REGEXP, "$1") : line;
      if (cleanedLine.match(/\S*Error: /)) {
        continue;
      }
      for (const parser2 of sortedParsers) {
        const frame = parser2(cleanedLine);
        if (frame) {
          frames.push(frame);
          break;
        }
      }
      if (frames.length >= STACKTRACE_FRAME_LIMIT) {
        break;
      }
    }
    return stripSentryFramesAndReverse(frames);
  };
}
function stackParserFromStackParserOptions(stackParser) {
  if (Array.isArray(stackParser)) {
    return createStackParser(...stackParser);
  }
  return stackParser;
}
function stripSentryFramesAndReverse(stack) {
  if (!stack.length) {
    return [];
  }
  const localStack = Array.from(stack);
  if (/sentryWrapped/.test(localStack[localStack.length - 1].function || "")) {
    localStack.pop();
  }
  localStack.reverse();
  if (STRIP_FRAME_REGEXP.test(localStack[localStack.length - 1].function || "")) {
    localStack.pop();
    if (STRIP_FRAME_REGEXP.test(localStack[localStack.length - 1].function || "")) {
      localStack.pop();
    }
  }
  return localStack.slice(0, STACKTRACE_FRAME_LIMIT).map((frame) => ({
    ...frame,
    filename: frame.filename || localStack[localStack.length - 1].filename,
    function: frame.function || "?"
  }));
}
function getFunctionName(fn2) {
  try {
    if (!fn2 || typeof fn2 !== "function") {
      return defaultFunctionName;
    }
    return fn2.name || defaultFunctionName;
  } catch (e10) {
    return defaultFunctionName;
  }
}
function nodeStackLineParser(getModule) {
  return [90, node(getModule)];
}
var STACKTRACE_FRAME_LIMIT, WEBPACK_ERROR_REGEXP, STRIP_FRAME_REGEXP, defaultFunctionName;
var init_stacktrace = __esm({
  "../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/stacktrace.js"() {
    init_import_meta_url();
    init_node_stack_trace();
    STACKTRACE_FRAME_LIMIT = 50;
    WEBPACK_ERROR_REGEXP = /\(error: (.*)\)/;
    STRIP_FRAME_REGEXP = /captureMessage|captureException/;
    __name(createStackParser, "createStackParser");
    __name(stackParserFromStackParserOptions, "stackParserFromStackParserOptions");
    __name(stripSentryFramesAndReverse, "stripSentryFramesAndReverse");
    defaultFunctionName = "<anonymous>";
    __name(getFunctionName, "getFunctionName");
    __name(nodeStackLineParser, "nodeStackLineParser");
  }
});

// ../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/instrument/_handlers.js
function addHandler(type, handler) {
  handlers[type] = handlers[type] || [];
  handlers[type].push(handler);
}
function maybeInstrument(type, instrumentFn) {
  if (!instrumented[type]) {
    instrumentFn();
    instrumented[type] = true;
  }
}
function triggerHandlers(type, data) {
  const typeHandlers = type && handlers[type];
  if (!typeHandlers) {
    return;
  }
  for (const handler of typeHandlers) {
    try {
      handler(data);
    } catch (e10) {
      DEBUG_BUILD && logger2.error(
        `Error while triggering instrumentation handler.
Type: ${type}
Name: ${getFunctionName(handler)}
Error:`,
        e10
      );
    }
  }
}
var handlers, instrumented;
var init_handlers = __esm({
  "../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/instrument/_handlers.js"() {
    init_import_meta_url();
    init_debug_build();
    init_logger2();
    init_stacktrace();
    handlers = {};
    instrumented = {};
    __name(addHandler, "addHandler");
    __name(maybeInstrument, "maybeInstrument");
    __name(triggerHandlers, "triggerHandlers");
  }
});

// ../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/instrument/console.js
function addConsoleInstrumentationHandler(handler) {
  const type = "console";
  addHandler(type, handler);
  maybeInstrument(type, instrumentConsole);
}
function instrumentConsole() {
  if (!("console" in GLOBAL_OBJ)) {
    return;
  }
  CONSOLE_LEVELS.forEach(function(level) {
    if (!(level in GLOBAL_OBJ.console)) {
      return;
    }
    fill(GLOBAL_OBJ.console, level, function(originalConsoleMethod) {
      originalConsoleMethods[level] = originalConsoleMethod;
      return function(...args) {
        const handlerData = { args, level };
        triggerHandlers("console", handlerData);
        const log2 = originalConsoleMethods[level];
        log2 && log2.apply(GLOBAL_OBJ.console, args);
      };
    });
  });
}
var init_console = __esm({
  "../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/instrument/console.js"() {
    init_import_meta_url();
    init_logger2();
    init_object();
    init_worldwide();
    init_handlers();
    __name(addConsoleInstrumentationHandler, "addConsoleInstrumentationHandler");
    __name(instrumentConsole, "instrumentConsole");
  }
});

// ../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/misc.js
function uuid42() {
  const gbl = GLOBAL_OBJ;
  const crypto9 = gbl.crypto || gbl.msCrypto;
  let getRandomByte = /* @__PURE__ */ __name(() => Math.random() * 16, "getRandomByte");
  try {
    if (crypto9 && crypto9.randomUUID) {
      return crypto9.randomUUID().replace(/-/g, "");
    }
    if (crypto9 && crypto9.getRandomValues) {
      getRandomByte = /* @__PURE__ */ __name(() => crypto9.getRandomValues(new Uint8Array(1))[0], "getRandomByte");
    }
  } catch (_5) {
  }
  return ("10000000100040008000" + 1e11).replace(
    /[018]/g,
    (c8) => (
      // eslint-disable-next-line no-bitwise
      (c8 ^ (getRandomByte() & 15) >> c8 / 4).toString(16)
    )
  );
}
function getFirstException(event) {
  return event.exception && event.exception.values ? event.exception.values[0] : void 0;
}
function getEventDescription(event) {
  const { message, event_id: eventId } = event;
  if (message) {
    return message;
  }
  const firstException = getFirstException(event);
  if (firstException) {
    if (firstException.type && firstException.value) {
      return `${firstException.type}: ${firstException.value}`;
    }
    return firstException.type || firstException.value || eventId || "<unknown>";
  }
  return eventId || "<unknown>";
}
function addExceptionTypeValue(event, value, type) {
  const exception = event.exception = event.exception || {};
  const values = exception.values = exception.values || [];
  const firstException = values[0] = values[0] || {};
  if (!firstException.value) {
    firstException.value = value || "";
  }
  if (!firstException.type) {
    firstException.type = type || "Error";
  }
}
function addExceptionMechanism(event, newMechanism) {
  const firstException = getFirstException(event);
  if (!firstException) {
    return;
  }
  const defaultMechanism = { type: "generic", handled: true };
  const currentMechanism = firstException.mechanism;
  firstException.mechanism = { ...defaultMechanism, ...currentMechanism, ...newMechanism };
  if (newMechanism && "data" in newMechanism) {
    const mergedData = { ...currentMechanism && currentMechanism.data, ...newMechanism.data };
    firstException.mechanism.data = mergedData;
  }
}
function parseSemver(input) {
  const match3 = input.match(SEMVER_REGEXP) || [];
  const major = parseInt(match3[1], 10);
  const minor = parseInt(match3[2], 10);
  const patch = parseInt(match3[3], 10);
  return {
    buildmetadata: match3[5],
    major: isNaN(major) ? void 0 : major,
    minor: isNaN(minor) ? void 0 : minor,
    patch: isNaN(patch) ? void 0 : patch,
    prerelease: match3[4]
  };
}
function addContextToFrame(lines, frame, linesOfContext = 5) {
  if (frame.lineno === void 0) {
    return;
  }
  const maxLines = lines.length;
  const sourceLine = Math.max(Math.min(maxLines - 1, frame.lineno - 1), 0);
  frame.pre_context = lines.slice(Math.max(0, sourceLine - linesOfContext), sourceLine).map((line) => snipLine(line, 0));
  frame.context_line = snipLine(lines[Math.min(maxLines - 1, sourceLine)], frame.colno || 0);
  frame.post_context = lines.slice(Math.min(sourceLine + 1, maxLines), sourceLine + 1 + linesOfContext).map((line) => snipLine(line, 0));
}
function checkOrSetAlreadyCaught(exception) {
  if (exception && exception.__sentry_captured__) {
    return true;
  }
  try {
    addNonEnumerableProperty(exception, "__sentry_captured__", true);
  } catch (err) {
  }
  return false;
}
function arrayify(maybeArray) {
  return Array.isArray(maybeArray) ? maybeArray : [maybeArray];
}
var SEMVER_REGEXP;
var init_misc = __esm({
  "../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/misc.js"() {
    init_import_meta_url();
    init_object();
    init_string();
    init_worldwide();
    __name(uuid42, "uuid4");
    __name(getFirstException, "getFirstException");
    __name(getEventDescription, "getEventDescription");
    __name(addExceptionTypeValue, "addExceptionTypeValue");
    __name(addExceptionMechanism, "addExceptionMechanism");
    SEMVER_REGEXP = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/;
    __name(parseSemver, "parseSemver");
    __name(addContextToFrame, "addContextToFrame");
    __name(checkOrSetAlreadyCaught, "checkOrSetAlreadyCaught");
    __name(arrayify, "arrayify");
  }
});

// ../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/instrument/globalError.js
function addGlobalErrorInstrumentationHandler(handler) {
  const type = "error";
  addHandler(type, handler);
  maybeInstrument(type, instrumentError);
}
function instrumentError() {
  _oldOnErrorHandler = GLOBAL_OBJ.onerror;
  GLOBAL_OBJ.onerror = function(msg, url4, line, column, error2) {
    const handlerData = {
      column,
      error: error2,
      line,
      msg,
      url: url4
    };
    triggerHandlers("error", handlerData);
    if (_oldOnErrorHandler && !_oldOnErrorHandler.__SENTRY_LOADER__) {
      return _oldOnErrorHandler.apply(this, arguments);
    }
    return false;
  };
  GLOBAL_OBJ.onerror.__SENTRY_INSTRUMENTED__ = true;
}
var _oldOnErrorHandler;
var init_globalError = __esm({
  "../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/instrument/globalError.js"() {
    init_import_meta_url();
    init_worldwide();
    init_handlers();
    _oldOnErrorHandler = null;
    __name(addGlobalErrorInstrumentationHandler, "addGlobalErrorInstrumentationHandler");
    __name(instrumentError, "instrumentError");
  }
});

// ../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/instrument/globalUnhandledRejection.js
function addGlobalUnhandledRejectionInstrumentationHandler(handler) {
  const type = "unhandledrejection";
  addHandler(type, handler);
  maybeInstrument(type, instrumentUnhandledRejection);
}
function instrumentUnhandledRejection() {
  _oldOnUnhandledRejectionHandler = GLOBAL_OBJ.onunhandledrejection;
  GLOBAL_OBJ.onunhandledrejection = function(e10) {
    const handlerData = e10;
    triggerHandlers("unhandledrejection", handlerData);
    if (_oldOnUnhandledRejectionHandler && !_oldOnUnhandledRejectionHandler.__SENTRY_LOADER__) {
      return _oldOnUnhandledRejectionHandler.apply(this, arguments);
    }
    return true;
  };
  GLOBAL_OBJ.onunhandledrejection.__SENTRY_INSTRUMENTED__ = true;
}
var _oldOnUnhandledRejectionHandler;
var init_globalUnhandledRejection = __esm({
  "../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/instrument/globalUnhandledRejection.js"() {
    init_import_meta_url();
    init_worldwide();
    init_handlers();
    _oldOnUnhandledRejectionHandler = null;
    __name(addGlobalUnhandledRejectionInstrumentationHandler, "addGlobalUnhandledRejectionInstrumentationHandler");
    __name(instrumentUnhandledRejection, "instrumentUnhandledRejection");
  }
});

// ../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/env.js
function isBrowserBundle() {
  return typeof __SENTRY_BROWSER_BUNDLE__ !== "undefined" && !!__SENTRY_BROWSER_BUNDLE__;
}
var init_env = __esm({
  "../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/env.js"() {
    init_import_meta_url();
    __name(isBrowserBundle, "isBrowserBundle");
  }
});

// ../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/node.js
function isNodeEnv() {
  return !isBrowserBundle() && Object.prototype.toString.call(typeof process !== "undefined" ? process : 0) === "[object process]";
}
function dynamicRequire(mod, request4) {
  return mod.require(request4);
}
function loadModule(moduleName) {
  let mod;
  try {
    mod = dynamicRequire(module, moduleName);
  } catch (e10) {
  }
  try {
    const { cwd: cwd2 } = dynamicRequire(module, "process");
    mod = dynamicRequire(module, `${cwd2()}/node_modules/${moduleName}`);
  } catch (e10) {
  }
  return mod;
}
var init_node2 = __esm({
  "../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/node.js"() {
    init_import_meta_url();
    init_env();
    __name(isNodeEnv, "isNodeEnv");
    __name(dynamicRequire, "dynamicRequire");
    __name(loadModule, "loadModule");
  }
});

// ../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/memo.js
function memoBuilder() {
  const hasWeakSet = typeof WeakSet === "function";
  const inner = hasWeakSet ? /* @__PURE__ */ new WeakSet() : [];
  function memoize2(obj) {
    if (hasWeakSet) {
      if (inner.has(obj)) {
        return true;
      }
      inner.add(obj);
      return false;
    }
    for (let i7 = 0; i7 < inner.length; i7++) {
      const value = inner[i7];
      if (value === obj) {
        return true;
      }
    }
    inner.push(obj);
    return false;
  }
  __name(memoize2, "memoize");
  function unmemoize(obj) {
    if (hasWeakSet) {
      inner.delete(obj);
    } else {
      for (let i7 = 0; i7 < inner.length; i7++) {
        if (inner[i7] === obj) {
          inner.splice(i7, 1);
          break;
        }
      }
    }
  }
  __name(unmemoize, "unmemoize");
  return [memoize2, unmemoize];
}
var init_memo = __esm({
  "../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/memo.js"() {
    init_import_meta_url();
    __name(memoBuilder, "memoBuilder");
  }
});

// ../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/normalize.js
function normalize3(input, depth = 100, maxProperties = Infinity) {
  try {
    return visit3("", input, depth, maxProperties);
  } catch (err) {
    return { ERROR: `**non-serializable** (${err})` };
  }
}
function normalizeToSize(object, depth = 3, maxSize = 100 * 1024) {
  const normalized = normalize3(object, depth);
  if (jsonSize(normalized) > maxSize) {
    return normalizeToSize(object, depth - 1, maxSize);
  }
  return normalized;
}
function visit3(key, value, depth = Infinity, maxProperties = Infinity, memo = memoBuilder()) {
  const [memoize2, unmemoize] = memo;
  if (value == null || // this matches null and undefined -> eqeq not eqeqeq
  ["number", "boolean", "string"].includes(typeof value) && !isNaN2(value)) {
    return value;
  }
  const stringified = stringifyValue3(key, value);
  if (!stringified.startsWith("[object ")) {
    return stringified;
  }
  if (value["__sentry_skip_normalization__"]) {
    return value;
  }
  const remainingDepth = typeof value["__sentry_override_normalization_depth__"] === "number" ? value["__sentry_override_normalization_depth__"] : depth;
  if (remainingDepth === 0) {
    return stringified.replace("object ", "");
  }
  if (memoize2(value)) {
    return "[Circular ~]";
  }
  const valueWithToJSON = value;
  if (valueWithToJSON && typeof valueWithToJSON.toJSON === "function") {
    try {
      const jsonValue = valueWithToJSON.toJSON();
      return visit3("", jsonValue, remainingDepth - 1, maxProperties, memo);
    } catch (err) {
    }
  }
  const normalized = Array.isArray(value) ? [] : {};
  let numAdded = 0;
  const visitable = convertToPlainObject(value);
  for (const visitKey in visitable) {
    if (!Object.prototype.hasOwnProperty.call(visitable, visitKey)) {
      continue;
    }
    if (numAdded >= maxProperties) {
      normalized[visitKey] = "[MaxProperties ~]";
      break;
    }
    const visitValue = visitable[visitKey];
    normalized[visitKey] = visit3(visitKey, visitValue, remainingDepth - 1, maxProperties, memo);
    numAdded++;
  }
  unmemoize(value);
  return normalized;
}
function stringifyValue3(key, value) {
  try {
    if (key === "domain" && value && typeof value === "object" && value._events) {
      return "[Domain]";
    }
    if (key === "domainEmitter") {
      return "[DomainEmitter]";
    }
    if (typeof global !== "undefined" && value === global) {
      return "[Global]";
    }
    if (typeof window !== "undefined" && value === window) {
      return "[Window]";
    }
    if (typeof document !== "undefined" && value === document) {
      return "[Document]";
    }
    if (isVueViewModel(value)) {
      return "[VueViewModel]";
    }
    if (isSyntheticEvent(value)) {
      return "[SyntheticEvent]";
    }
    if (typeof value === "number" && value !== value) {
      return "[NaN]";
    }
    if (typeof value === "function") {
      return `[Function: ${getFunctionName(value)}]`;
    }
    if (typeof value === "symbol") {
      return `[${String(value)}]`;
    }
    if (typeof value === "bigint") {
      return `[BigInt: ${String(value)}]`;
    }
    const objName = getConstructorName(value);
    if (/^HTML(\w*)Element$/.test(objName)) {
      return `[HTMLElement: ${objName}]`;
    }
    return `[object ${objName}]`;
  } catch (err) {
    return `**non-serializable** (${err})`;
  }
}
function getConstructorName(value) {
  const prototype = Object.getPrototypeOf(value);
  return prototype ? prototype.constructor.name : "null prototype";
}
function utf8Length(value) {
  return ~-encodeURI(value).split(/%..|./).length;
}
function jsonSize(value) {
  return utf8Length(JSON.stringify(value));
}
var init_normalize = __esm({
  "../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/normalize.js"() {
    init_import_meta_url();
    init_is();
    init_memo();
    init_object();
    init_stacktrace();
    __name(normalize3, "normalize");
    __name(normalizeToSize, "normalizeToSize");
    __name(visit3, "visit");
    __name(stringifyValue3, "stringifyValue");
    __name(getConstructorName, "getConstructorName");
    __name(utf8Length, "utf8Length");
    __name(jsonSize, "jsonSize");
  }
});

// ../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/syncpromise.js
function resolvedSyncPromise(value) {
  return new SyncPromise((resolve32) => {
    resolve32(value);
  });
}
function rejectedSyncPromise(reason) {
  return new SyncPromise((_5, reject) => {
    reject(reason);
  });
}
var States, SyncPromise;
var init_syncpromise = __esm({
  "../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/syncpromise.js"() {
    init_import_meta_url();
    init_is();
    (function(States2) {
      const PENDING = 0;
      States2[States2["PENDING"] = PENDING] = "PENDING";
      const RESOLVED = 1;
      States2[States2["RESOLVED"] = RESOLVED] = "RESOLVED";
      const REJECTED = 2;
      States2[States2["REJECTED"] = REJECTED] = "REJECTED";
    })(States || (States = {}));
    __name(resolvedSyncPromise, "resolvedSyncPromise");
    __name(rejectedSyncPromise, "rejectedSyncPromise");
    SyncPromise = class _SyncPromise {
      static {
        __name(this, "SyncPromise");
      }
      constructor(executor) {
        _SyncPromise.prototype.__init.call(this);
        _SyncPromise.prototype.__init2.call(this);
        _SyncPromise.prototype.__init3.call(this);
        _SyncPromise.prototype.__init4.call(this);
        this._state = States.PENDING;
        this._handlers = [];
        try {
          executor(this._resolve, this._reject);
        } catch (e10) {
          this._reject(e10);
        }
      }
      /** JSDoc */
      then(onfulfilled, onrejected) {
        return new _SyncPromise((resolve32, reject) => {
          this._handlers.push([
            false,
            (result) => {
              if (!onfulfilled) {
                resolve32(result);
              } else {
                try {
                  resolve32(onfulfilled(result));
                } catch (e10) {
                  reject(e10);
                }
              }
            },
            (reason) => {
              if (!onrejected) {
                reject(reason);
              } else {
                try {
                  resolve32(onrejected(reason));
                } catch (e10) {
                  reject(e10);
                }
              }
            }
          ]);
          this._executeHandlers();
        });
      }
      /** JSDoc */
      catch(onrejected) {
        return this.then((val2) => val2, onrejected);
      }
      /** JSDoc */
      finally(onfinally) {
        return new _SyncPromise((resolve32, reject) => {
          let val2;
          let isRejected;
          return this.then(
            (value) => {
              isRejected = false;
              val2 = value;
              if (onfinally) {
                onfinally();
              }
            },
            (reason) => {
              isRejected = true;
              val2 = reason;
              if (onfinally) {
                onfinally();
              }
            }
          ).then(() => {
            if (isRejected) {
              reject(val2);
              return;
            }
            resolve32(val2);
          });
        });
      }
      /** JSDoc */
      __init() {
        this._resolve = (value) => {
          this._setResult(States.RESOLVED, value);
        };
      }
      /** JSDoc */
      __init2() {
        this._reject = (reason) => {
          this._setResult(States.REJECTED, reason);
        };
      }
      /** JSDoc */
      __init3() {
        this._setResult = (state2, value) => {
          if (this._state !== States.PENDING) {
            return;
          }
          if (isThenable(value)) {
            void value.then(this._resolve, this._reject);
            return;
          }
          this._state = state2;
          this._value = value;
          this._executeHandlers();
        };
      }
      /** JSDoc */
      __init4() {
        this._executeHandlers = () => {
          if (this._state === States.PENDING) {
            return;
          }
          const cachedHandlers = this._handlers.slice();
          this._handlers = [];
          cachedHandlers.forEach((handler) => {
            if (handler[0]) {
              return;
            }
            if (this._state === States.RESOLVED) {
              handler[1](this._value);
            }
            if (this._state === States.REJECTED) {
              handler[2](this._value);
            }
            handler[0] = true;
          });
        };
      }
    };
  }
});

// ../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/promisebuffer.js
function makePromiseBuffer(limit2) {
  const buffer = [];
  function isReady() {
    return limit2 === void 0 || buffer.length < limit2;
  }
  __name(isReady, "isReady");
  function remove(task) {
    return buffer.splice(buffer.indexOf(task), 1)[0];
  }
  __name(remove, "remove");
  function add(taskProducer) {
    if (!isReady()) {
      return rejectedSyncPromise(new SentryError("Not adding Promise because buffer limit was reached."));
    }
    const task = taskProducer();
    if (buffer.indexOf(task) === -1) {
      buffer.push(task);
    }
    void task.then(() => remove(task)).then(
      null,
      () => remove(task).then(null, () => {
      })
    );
    return task;
  }
  __name(add, "add");
  function drain(timeout2) {
    return new SyncPromise((resolve32, reject) => {
      let counter = buffer.length;
      if (!counter) {
        return resolve32(true);
      }
      const capturedSetTimeout = setTimeout(() => {
        if (timeout2 && timeout2 > 0) {
          resolve32(false);
        }
      }, timeout2);
      buffer.forEach((item) => {
        void resolvedSyncPromise(item).then(() => {
          if (!--counter) {
            clearTimeout(capturedSetTimeout);
            resolve32(true);
          }
        }, reject);
      });
    });
  }
  __name(drain, "drain");
  return {
    $: buffer,
    add,
    drain
  };
}
var init_promisebuffer = __esm({
  "../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/promisebuffer.js"() {
    init_import_meta_url();
    init_error5();
    init_syncpromise();
    __name(makePromiseBuffer, "makePromiseBuffer");
  }
});

// ../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/cookie.js
function parseCookie(str) {
  const obj = {};
  let index = 0;
  while (index < str.length) {
    const eqIdx = str.indexOf("=", index);
    if (eqIdx === -1) {
      break;
    }
    let endIdx = str.indexOf(";", index);
    if (endIdx === -1) {
      endIdx = str.length;
    } else if (endIdx < eqIdx) {
      index = str.lastIndexOf(";", eqIdx - 1) + 1;
      continue;
    }
    const key = str.slice(index, eqIdx).trim();
    if (void 0 === obj[key]) {
      let val2 = str.slice(eqIdx + 1, endIdx).trim();
      if (val2.charCodeAt(0) === 34) {
        val2 = val2.slice(1, -1);
      }
      try {
        obj[key] = val2.indexOf("%") !== -1 ? decodeURIComponent(val2) : val2;
      } catch (e10) {
        obj[key] = val2;
      }
    }
    index = endIdx + 1;
  }
  return obj;
}
var init_cookie = __esm({
  "../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/cookie.js"() {
    init_import_meta_url();
    __name(parseCookie, "parseCookie");
  }
});

// ../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/url.js
function parseUrl(url4) {
  if (!url4) {
    return {};
  }
  const match3 = url4.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);
  if (!match3) {
    return {};
  }
  const query = match3[6] || "";
  const fragment = match3[8] || "";
  return {
    host: match3[4],
    path: match3[5],
    protocol: match3[2],
    search: query,
    hash: fragment,
    relative: match3[5] + query + fragment
    // everything minus origin
  };
}
function stripUrlQueryAndFragment(urlPath) {
  return urlPath.split(/[\?#]/, 1)[0];
}
function getNumberOfUrlSegments(url4) {
  return url4.split(/\\?\//).filter((s7) => s7.length > 0 && s7 !== ",").length;
}
function getSanitizedUrlString(url4) {
  const { protocol, host, path: path84 } = url4;
  const filteredHost = host && host.replace(/^.*@/, "[filtered]:[filtered]@").replace(/(:80)$/, "").replace(/(:443)$/, "") || "";
  return `${protocol ? `${protocol}://` : ""}${filteredHost}${path84}`;
}
var init_url = __esm({
  "../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/url.js"() {
    init_import_meta_url();
    __name(parseUrl, "parseUrl");
    __name(stripUrlQueryAndFragment, "stripUrlQueryAndFragment");
    __name(getNumberOfUrlSegments, "getNumberOfUrlSegments");
    __name(getSanitizedUrlString, "getSanitizedUrlString");
  }
});

// ../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/requestdata.js
function extractPathForTransaction(req, options = {}) {
  const method = req.method && req.method.toUpperCase();
  let path84 = "";
  let source = "url";
  if (options.customRoute || req.route) {
    path84 = options.customRoute || `${req.baseUrl || ""}${req.route && req.route.path}`;
    source = "route";
  } else if (req.originalUrl || req.url) {
    path84 = stripUrlQueryAndFragment(req.originalUrl || req.url || "");
  }
  let name2 = "";
  if (options.method && method) {
    name2 += method;
  }
  if (options.method && options.path) {
    name2 += " ";
  }
  if (options.path && path84) {
    name2 += path84;
  }
  return [name2, source];
}
function extractTransaction(req, type) {
  switch (type) {
    case "path": {
      return extractPathForTransaction(req, { path: true })[0];
    }
    case "handler": {
      return req.route && req.route.stack && req.route.stack[0] && req.route.stack[0].name || "<anonymous>";
    }
    case "methodPath":
    default: {
      const customRoute = req._reconstructedRoute ? req._reconstructedRoute : void 0;
      return extractPathForTransaction(req, { path: true, method: true, customRoute })[0];
    }
  }
}
function extractUserData(user, keys) {
  const extractedUser = {};
  const attributes = Array.isArray(keys) ? keys : DEFAULT_USER_INCLUDES;
  attributes.forEach((key) => {
    if (user && key in user) {
      extractedUser[key] = user[key];
    }
  });
  return extractedUser;
}
function extractRequestData(req, options) {
  const { include = DEFAULT_REQUEST_INCLUDES, deps } = options || {};
  const requestData = {};
  const headers = req.headers || {};
  const method = req.method;
  const host = req.hostname || req.host || headers.host || "<no host>";
  const protocol = req.protocol === "https" || req.socket && req.socket.encrypted ? "https" : "http";
  const originalUrl = req.originalUrl || req.url || "";
  const absoluteUrl = originalUrl.startsWith(protocol) ? originalUrl : `${protocol}://${host}${originalUrl}`;
  include.forEach((key) => {
    switch (key) {
      case "headers": {
        requestData.headers = headers;
        if (!include.includes("cookies")) {
          delete requestData.headers.cookie;
        }
        break;
      }
      case "method": {
        requestData.method = method;
        break;
      }
      case "url": {
        requestData.url = absoluteUrl;
        break;
      }
      case "cookies": {
        requestData.cookies = // TODO (v8 / #5257): We're only sending the empty object for backwards compatibility, so the last bit can
        // come off in v8
        req.cookies || headers.cookie && parseCookie(headers.cookie) || {};
        break;
      }
      case "query_string": {
        requestData.query_string = extractQueryParams(req, deps);
        break;
      }
      case "data": {
        if (method === "GET" || method === "HEAD") {
          break;
        }
        if (req.body !== void 0) {
          requestData.data = isString4(req.body) ? req.body : JSON.stringify(normalize3(req.body));
        }
        break;
      }
      default: {
        if ({}.hasOwnProperty.call(req, key)) {
          requestData[key] = req[key];
        }
      }
    }
  });
  return requestData;
}
function addRequestDataToEvent(event, req, options) {
  const include = {
    ...DEFAULT_INCLUDES,
    ...options && options.include
  };
  if (include.request) {
    const extractedRequestData = Array.isArray(include.request) ? extractRequestData(req, { include: include.request, deps: options && options.deps }) : extractRequestData(req, { deps: options && options.deps });
    event.request = {
      ...event.request,
      ...extractedRequestData
    };
  }
  if (include.user) {
    const extractedUser = req.user && isPlainObject3(req.user) ? extractUserData(req.user, include.user) : {};
    if (Object.keys(extractedUser).length) {
      event.user = {
        ...event.user,
        ...extractedUser
      };
    }
  }
  if (include.ip) {
    const ip = req.ip || req.socket && req.socket.remoteAddress;
    if (ip) {
      event.user = {
        ...event.user,
        ip_address: ip
      };
    }
  }
  if (include.transaction && !event.transaction) {
    event.transaction = extractTransaction(req, include.transaction);
  }
  return event;
}
function extractQueryParams(req, deps) {
  let originalUrl = req.originalUrl || req.url || "";
  if (!originalUrl) {
    return;
  }
  if (originalUrl.startsWith("/")) {
    originalUrl = `http://dogs.are.great${originalUrl}`;
  }
  try {
    return req.query || typeof URL !== void 0 && new URL(originalUrl).search.slice(1) || // In Node 8, `URL` isn't in the global scope, so we have to use the built-in module from Node
    deps && deps.url && deps.url.parse(originalUrl).query || void 0;
  } catch (e22) {
    return void 0;
  }
}
var DEFAULT_INCLUDES, DEFAULT_REQUEST_INCLUDES, DEFAULT_USER_INCLUDES;
var init_requestdata = __esm({
  "../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/requestdata.js"() {
    init_import_meta_url();
    init_cookie();
    init_is();
    init_normalize();
    init_url();
    DEFAULT_INCLUDES = {
      ip: false,
      request: true,
      transaction: true,
      user: true
    };
    DEFAULT_REQUEST_INCLUDES = ["cookies", "data", "headers", "method", "query_string", "url"];
    DEFAULT_USER_INCLUDES = ["id", "username", "email"];
    __name(extractPathForTransaction, "extractPathForTransaction");
    __name(extractTransaction, "extractTransaction");
    __name(extractUserData, "extractUserData");
    __name(extractRequestData, "extractRequestData");
    __name(addRequestDataToEvent, "addRequestDataToEvent");
    __name(extractQueryParams, "extractQueryParams");
  }
});

// ../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/severity.js
function severityLevelFromString(level) {
  return level === "warn" ? "warning" : validSeverityLevels.includes(level) ? level : "log";
}
var validSeverityLevels;
var init_severity2 = __esm({
  "../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/severity.js"() {
    init_import_meta_url();
    validSeverityLevels = ["fatal", "error", "warning", "log", "info", "debug"];
    __name(severityLevelFromString, "severityLevelFromString");
  }
});

// ../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/time.js
function getBrowserPerformance() {
  const { performance: performance2 } = WINDOW2;
  if (!performance2 || !performance2.now) {
    return void 0;
  }
  const timeOrigin = Date.now() - performance2.now();
  return {
    now: /* @__PURE__ */ __name(() => performance2.now(), "now"),
    timeOrigin
  };
}
function getNodePerformance() {
  try {
    const perfHooks = dynamicRequire(module, "perf_hooks");
    return perfHooks.performance;
  } catch (_5) {
    return void 0;
  }
}
var WINDOW2, dateTimestampSource, platformPerformance, timestampSource, dateTimestampInSeconds, timestampInSeconds;
var init_time = __esm({
  "../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/time.js"() {
    init_import_meta_url();
    init_node2();
    init_worldwide();
    WINDOW2 = getGlobalObject();
    dateTimestampSource = {
      nowSeconds: /* @__PURE__ */ __name(() => Date.now() / 1e3, "nowSeconds")
    };
    __name(getBrowserPerformance, "getBrowserPerformance");
    __name(getNodePerformance, "getNodePerformance");
    platformPerformance = isNodeEnv() ? getNodePerformance() : getBrowserPerformance();
    timestampSource = platformPerformance === void 0 ? dateTimestampSource : {
      nowSeconds: /* @__PURE__ */ __name(() => (platformPerformance.timeOrigin + platformPerformance.now()) / 1e3, "nowSeconds")
    };
    dateTimestampInSeconds = dateTimestampSource.nowSeconds.bind(dateTimestampSource);
    timestampInSeconds = timestampSource.nowSeconds.bind(timestampSource);
    (() => {
      const { performance: performance2 } = WINDOW2;
      if (!performance2 || !performance2.now) {
        return void 0;
      }
      const threshold = 3600 * 1e3;
      const performanceNow = performance2.now();
      const dateNow = Date.now();
      const timeOriginDelta = performance2.timeOrigin ? Math.abs(performance2.timeOrigin + performanceNow - dateNow) : threshold;
      const timeOriginIsReliable = timeOriginDelta < threshold;
      const navigationStart = performance2.timing && performance2.timing.navigationStart;
      const hasNavigationStart = typeof navigationStart === "number";
      const navigationStartDelta = hasNavigationStart ? Math.abs(navigationStart + performanceNow - dateNow) : threshold;
      const navigationStartIsReliable = navigationStartDelta < threshold;
      if (timeOriginIsReliable || navigationStartIsReliable) {
        if (timeOriginDelta <= navigationStartDelta) {
          return performance2.timeOrigin;
        } else {
          return navigationStart;
        }
      }
      return dateNow;
    })();
  }
});

// ../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/baggage.js
function baggageHeaderToDynamicSamplingContext(baggageHeader) {
  if (!isString4(baggageHeader) && !Array.isArray(baggageHeader)) {
    return void 0;
  }
  let baggageObject = {};
  if (Array.isArray(baggageHeader)) {
    baggageObject = baggageHeader.reduce((acc, curr) => {
      const currBaggageObject = baggageHeaderToObject(curr);
      return {
        ...acc,
        ...currBaggageObject
      };
    }, {});
  } else {
    if (!baggageHeader) {
      return void 0;
    }
    baggageObject = baggageHeaderToObject(baggageHeader);
  }
  const dynamicSamplingContext = Object.entries(baggageObject).reduce((acc, [key, value]) => {
    if (key.match(SENTRY_BAGGAGE_KEY_PREFIX_REGEX)) {
      const nonPrefixedKey = key.slice(SENTRY_BAGGAGE_KEY_PREFIX.length);
      acc[nonPrefixedKey] = value;
    }
    return acc;
  }, {});
  if (Object.keys(dynamicSamplingContext).length > 0) {
    return dynamicSamplingContext;
  } else {
    return void 0;
  }
}
function dynamicSamplingContextToSentryBaggageHeader(dynamicSamplingContext) {
  if (!dynamicSamplingContext) {
    return void 0;
  }
  const sentryPrefixedDSC = Object.entries(dynamicSamplingContext).reduce(
    (acc, [dscKey, dscValue]) => {
      if (dscValue) {
        acc[`${SENTRY_BAGGAGE_KEY_PREFIX}${dscKey}`] = dscValue;
      }
      return acc;
    },
    {}
  );
  return objectToBaggageHeader(sentryPrefixedDSC);
}
function baggageHeaderToObject(baggageHeader) {
  return baggageHeader.split(",").map((baggageEntry) => baggageEntry.split("=").map((keyOrValue) => decodeURIComponent(keyOrValue.trim()))).reduce((acc, [key, value]) => {
    acc[key] = value;
    return acc;
  }, {});
}
function objectToBaggageHeader(object) {
  if (Object.keys(object).length === 0) {
    return void 0;
  }
  return Object.entries(object).reduce((baggageHeader, [objectKey, objectValue], currentIndex) => {
    const baggageEntry = `${encodeURIComponent(objectKey)}=${encodeURIComponent(objectValue)}`;
    const newBaggageHeader = currentIndex === 0 ? baggageEntry : `${baggageHeader},${baggageEntry}`;
    if (newBaggageHeader.length > MAX_BAGGAGE_STRING_LENGTH) {
      DEBUG_BUILD && logger2.warn(
        `Not adding key: ${objectKey} with val: ${objectValue} to baggage header due to exceeding baggage size limits.`
      );
      return baggageHeader;
    } else {
      return newBaggageHeader;
    }
  }, "");
}
var SENTRY_BAGGAGE_KEY_PREFIX, SENTRY_BAGGAGE_KEY_PREFIX_REGEX, MAX_BAGGAGE_STRING_LENGTH;
var init_baggage = __esm({
  "../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/baggage.js"() {
    init_import_meta_url();
    init_debug_build();
    init_is();
    init_logger2();
    SENTRY_BAGGAGE_KEY_PREFIX = "sentry-";
    SENTRY_BAGGAGE_KEY_PREFIX_REGEX = /^sentry-/;
    MAX_BAGGAGE_STRING_LENGTH = 8192;
    __name(baggageHeaderToDynamicSamplingContext, "baggageHeaderToDynamicSamplingContext");
    __name(dynamicSamplingContextToSentryBaggageHeader, "dynamicSamplingContextToSentryBaggageHeader");
    __name(baggageHeaderToObject, "baggageHeaderToObject");
    __name(objectToBaggageHeader, "objectToBaggageHeader");
  }
});

// ../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/tracing.js
function extractTraceparentData(traceparent) {
  if (!traceparent) {
    return void 0;
  }
  const matches = traceparent.match(TRACEPARENT_REGEXP);
  if (!matches) {
    return void 0;
  }
  let parentSampled;
  if (matches[3] === "1") {
    parentSampled = true;
  } else if (matches[3] === "0") {
    parentSampled = false;
  }
  return {
    traceId: matches[1],
    parentSampled,
    parentSpanId: matches[2]
  };
}
function tracingContextFromHeaders(sentryTrace, baggage) {
  const traceparentData = extractTraceparentData(sentryTrace);
  const dynamicSamplingContext = baggageHeaderToDynamicSamplingContext(baggage);
  const { traceId, parentSpanId, parentSampled } = traceparentData || {};
  const propagationContext = {
    traceId: traceId || uuid42(),
    spanId: uuid42().substring(16),
    sampled: parentSampled
  };
  if (parentSpanId) {
    propagationContext.parentSpanId = parentSpanId;
  }
  if (dynamicSamplingContext) {
    propagationContext.dsc = dynamicSamplingContext;
  }
  return {
    traceparentData,
    dynamicSamplingContext,
    propagationContext
  };
}
function generateSentryTraceHeader(traceId = uuid42(), spanId = uuid42().substring(16), sampled) {
  let sampledString = "";
  if (sampled !== void 0) {
    sampledString = sampled ? "-1" : "-0";
  }
  return `${traceId}-${spanId}${sampledString}`;
}
var TRACEPARENT_REGEXP;
var init_tracing = __esm({
  "../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/tracing.js"() {
    init_import_meta_url();
    init_baggage();
    init_misc();
    TRACEPARENT_REGEXP = new RegExp(
      "^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$"
      // whitespace
    );
    __name(extractTraceparentData, "extractTraceparentData");
    __name(tracingContextFromHeaders, "tracingContextFromHeaders");
    __name(generateSentryTraceHeader, "generateSentryTraceHeader");
  }
});

// ../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/envelope.js
function createEnvelope(headers, items = []) {
  return [headers, items];
}
function addItemToEnvelope(envelope, newItem) {
  const [headers, items] = envelope;
  return [headers, [...items, newItem]];
}
function forEachEnvelopeItem(envelope, callback) {
  const envelopeItems = envelope[1];
  for (const envelopeItem of envelopeItems) {
    const envelopeItemType = envelopeItem[0].type;
    const result = callback(envelopeItem, envelopeItemType);
    if (result) {
      return true;
    }
  }
  return false;
}
function encodeUTF8(input, textEncoder) {
  const utf8 = textEncoder || new TextEncoder();
  return utf8.encode(input);
}
function serializeEnvelope(envelope, textEncoder) {
  const [envHeaders, items] = envelope;
  let parts = JSON.stringify(envHeaders);
  function append(next) {
    if (typeof parts === "string") {
      parts = typeof next === "string" ? parts + next : [encodeUTF8(parts, textEncoder), next];
    } else {
      parts.push(typeof next === "string" ? encodeUTF8(next, textEncoder) : next);
    }
  }
  __name(append, "append");
  for (const item of items) {
    const [itemHeaders, payload] = item;
    append(`
${JSON.stringify(itemHeaders)}
`);
    if (typeof payload === "string" || payload instanceof Uint8Array) {
      append(payload);
    } else {
      let stringifiedPayload;
      try {
        stringifiedPayload = JSON.stringify(payload);
      } catch (e10) {
        stringifiedPayload = JSON.stringify(normalize3(payload));
      }
      append(stringifiedPayload);
    }
  }
  return typeof parts === "string" ? parts : concatBuffers(parts);
}
function concatBuffers(buffers) {
  const totalLength = buffers.reduce((acc, buf) => acc + buf.length, 0);
  const merged = new Uint8Array(totalLength);
  let offset = 0;
  for (const buffer of buffers) {
    merged.set(buffer, offset);
    offset += buffer.length;
  }
  return merged;
}
function createAttachmentEnvelopeItem(attachment, textEncoder) {
  const buffer = typeof attachment.data === "string" ? encodeUTF8(attachment.data, textEncoder) : attachment.data;
  return [
    dropUndefinedKeys({
      type: "attachment",
      length: buffer.length,
      filename: attachment.filename,
      content_type: attachment.contentType,
      attachment_type: attachment.attachmentType
    }),
    buffer
  ];
}
function envelopeItemTypeToDataCategory(type) {
  return ITEM_TYPE_TO_DATA_CATEGORY_MAP[type];
}
function getSdkMetadataForEnvelopeHeader(metadataOrEvent) {
  if (!metadataOrEvent || !metadataOrEvent.sdk) {
    return;
  }
  const { name: name2, version: version5 } = metadataOrEvent.sdk;
  return { name: name2, version: version5 };
}
function createEventEnvelopeHeaders(event, sdkInfo, tunnel, dsn) {
  const dynamicSamplingContext = event.sdkProcessingMetadata && event.sdkProcessingMetadata.dynamicSamplingContext;
  return {
    event_id: event.event_id,
    sent_at: (/* @__PURE__ */ new Date()).toISOString(),
    ...sdkInfo && { sdk: sdkInfo },
    ...!!tunnel && dsn && { dsn: dsnToString(dsn) },
    ...dynamicSamplingContext && {
      trace: dropUndefinedKeys({ ...dynamicSamplingContext })
    }
  };
}
var ITEM_TYPE_TO_DATA_CATEGORY_MAP;
var init_envelope = __esm({
  "../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/envelope.js"() {
    init_import_meta_url();
    init_dsn();
    init_normalize();
    init_object();
    __name(createEnvelope, "createEnvelope");
    __name(addItemToEnvelope, "addItemToEnvelope");
    __name(forEachEnvelopeItem, "forEachEnvelopeItem");
    __name(encodeUTF8, "encodeUTF8");
    __name(serializeEnvelope, "serializeEnvelope");
    __name(concatBuffers, "concatBuffers");
    __name(createAttachmentEnvelopeItem, "createAttachmentEnvelopeItem");
    ITEM_TYPE_TO_DATA_CATEGORY_MAP = {
      session: "session",
      sessions: "session",
      attachment: "attachment",
      transaction: "transaction",
      event: "error",
      client_report: "internal",
      user_report: "default",
      profile: "profile",
      replay_event: "replay",
      replay_recording: "replay",
      check_in: "monitor",
      feedback: "feedback",
      // TODO: This is a temporary workaround until we have a proper data category for metrics
      statsd: "unknown"
    };
    __name(envelopeItemTypeToDataCategory, "envelopeItemTypeToDataCategory");
    __name(getSdkMetadataForEnvelopeHeader, "getSdkMetadataForEnvelopeHeader");
    __name(createEventEnvelopeHeaders, "createEventEnvelopeHeaders");
  }
});

// ../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/ratelimit.js
function parseRetryAfterHeader(header, now = Date.now()) {
  const headerDelay = parseInt(`${header}`, 10);
  if (!isNaN(headerDelay)) {
    return headerDelay * 1e3;
  }
  const headerDate = Date.parse(`${header}`);
  if (!isNaN(headerDate)) {
    return headerDate - now;
  }
  return DEFAULT_RETRY_AFTER;
}
function disabledUntil(limits, category) {
  return limits[category] || limits.all || 0;
}
function isRateLimited(limits, category, now = Date.now()) {
  return disabledUntil(limits, category) > now;
}
function updateRateLimits(limits, { statusCode, headers }, now = Date.now()) {
  const updatedRateLimits = {
    ...limits
  };
  const rateLimitHeader = headers && headers["x-sentry-rate-limits"];
  const retryAfterHeader = headers && headers["retry-after"];
  if (rateLimitHeader) {
    for (const limit2 of rateLimitHeader.trim().split(",")) {
      const [retryAfter, categories] = limit2.split(":", 2);
      const headerDelay = parseInt(retryAfter, 10);
      const delay = (!isNaN(headerDelay) ? headerDelay : 60) * 1e3;
      if (!categories) {
        updatedRateLimits.all = now + delay;
      } else {
        for (const category of categories.split(";")) {
          updatedRateLimits[category] = now + delay;
        }
      }
    }
  } else if (retryAfterHeader) {
    updatedRateLimits.all = now + parseRetryAfterHeader(retryAfterHeader, now);
  } else if (statusCode === 429) {
    updatedRateLimits.all = now + 60 * 1e3;
  }
  return updatedRateLimits;
}
var DEFAULT_RETRY_AFTER;
var init_ratelimit = __esm({
  "../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/ratelimit.js"() {
    init_import_meta_url();
    DEFAULT_RETRY_AFTER = 60 * 1e3;
    __name(parseRetryAfterHeader, "parseRetryAfterHeader");
    __name(disabledUntil, "disabledUntil");
    __name(isRateLimited, "isRateLimited");
    __name(updateRateLimits, "updateRateLimits");
  }
});

// ../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/eventbuilder.js
function parseStackFrames(stackParser, error2) {
  return stackParser(error2.stack || "", 1);
}
function exceptionFromError(stackParser, error2) {
  const exception = {
    type: error2.name || error2.constructor.name,
    value: error2.message
  };
  const frames = parseStackFrames(stackParser, error2);
  if (frames.length) {
    exception.stacktrace = { frames };
  }
  return exception;
}
function getMessageForObject(exception) {
  if ("name" in exception && typeof exception.name === "string") {
    let message = `'${exception.name}' captured as exception`;
    if ("message" in exception && typeof exception.message === "string") {
      message += ` with message '${exception.message}'`;
    }
    return message;
  } else if ("message" in exception && typeof exception.message === "string") {
    return exception.message;
  } else {
    return `Object captured as exception with keys: ${extractExceptionKeysForMessage(
      exception
    )}`;
  }
}
function eventFromUnknownInput(getCurrentHub3, stackParser, exception, hint) {
  let ex = exception;
  const providedMechanism = hint && hint.data && hint.data.mechanism;
  const mechanism = providedMechanism || {
    handled: true,
    type: "generic"
  };
  if (!isError(exception)) {
    if (isPlainObject3(exception)) {
      const hub = getCurrentHub3();
      const client = hub.getClient();
      const normalizeDepth = client && client.getOptions().normalizeDepth;
      hub.configureScope((scope) => {
        scope.setExtra("__serialized__", normalizeToSize(exception, normalizeDepth));
      });
      const message = getMessageForObject(exception);
      ex = hint && hint.syntheticException || new Error(message);
      ex.message = message;
    } else {
      ex = hint && hint.syntheticException || new Error(exception);
      ex.message = exception;
    }
    mechanism.synthetic = true;
  }
  const event = {
    exception: {
      values: [exceptionFromError(stackParser, ex)]
    }
  };
  addExceptionTypeValue(event, void 0, void 0);
  addExceptionMechanism(event, mechanism);
  return {
    ...event,
    event_id: hint && hint.event_id
  };
}
function eventFromMessage(stackParser, message, level = "info", hint, attachStacktrace) {
  const event = {
    event_id: hint && hint.event_id,
    level,
    message
  };
  if (attachStacktrace && hint && hint.syntheticException) {
    const frames = parseStackFrames(stackParser, hint.syntheticException);
    if (frames.length) {
      event.exception = {
        values: [
          {
            value: message,
            stacktrace: { frames }
          }
        ]
      };
    }
  }
  return event;
}
var init_eventbuilder = __esm({
  "../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/eventbuilder.js"() {
    init_import_meta_url();
    init_is();
    init_misc();
    init_normalize();
    init_object();
    __name(parseStackFrames, "parseStackFrames");
    __name(exceptionFromError, "exceptionFromError");
    __name(getMessageForObject, "getMessageForObject");
    __name(eventFromUnknownInput, "eventFromUnknownInput");
    __name(eventFromMessage, "eventFromMessage");
  }
});

// ../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/lru.js
var LRUMap;
var init_lru = __esm({
  "../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/lru.js"() {
    init_import_meta_url();
    LRUMap = class {
      static {
        __name(this, "LRUMap");
      }
      constructor(_maxSize) {
        this._maxSize = _maxSize;
        this._cache = /* @__PURE__ */ new Map();
      }
      /** Get the current size of the cache */
      get size() {
        return this._cache.size;
      }
      /** Get an entry or undefined if it was not in the cache. Re-inserts to update the recently used order */
      get(key) {
        const value = this._cache.get(key);
        if (value === void 0) {
          return void 0;
        }
        this._cache.delete(key);
        this._cache.set(key, value);
        return value;
      }
      /** Insert an entry and evict an older entry if we've reached maxSize */
      set(key, value) {
        if (this._cache.size >= this._maxSize) {
          this._cache.delete(this._cache.keys().next().value);
        }
        this._cache.set(key, value);
      }
      /** Remove an entry and return the entry if it was in the cache */
      remove(key) {
        const value = this._cache.get(key);
        if (value) {
          this._cache.delete(key);
        }
        return value;
      }
      /** Clear all entries */
      clear() {
        this._cache.clear();
      }
      /** Get all the keys */
      keys() {
        return Array.from(this._cache.keys());
      }
      /** Get all the values */
      values() {
        const values = [];
        this._cache.forEach((value) => values.push(value));
        return values;
      }
    };
  }
});

// ../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/buildPolyfills/_nullishCoalesce.js
function _nullishCoalesce(lhs, rhsFn) {
  return lhs != null ? lhs : rhsFn();
}
var init_nullishCoalesce = __esm({
  "../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/buildPolyfills/_nullishCoalesce.js"() {
    init_import_meta_url();
    __name(_nullishCoalesce, "_nullishCoalesce");
  }
});

// ../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/buildPolyfills/_optionalChain.js
function _optionalChain(ops) {
  let lastAccessLHS = void 0;
  let value = ops[0];
  let i7 = 1;
  while (i7 < ops.length) {
    const op = ops[i7];
    const fn2 = ops[i7 + 1];
    i7 += 2;
    if ((op === "optionalAccess" || op === "optionalCall") && value == null) {
      return;
    }
    if (op === "access" || op === "optionalAccess") {
      lastAccessLHS = value;
      value = fn2(value);
    } else if (op === "call" || op === "optionalCall") {
      value = fn2((...args) => value.call(lastAccessLHS, ...args));
      lastAccessLHS = void 0;
    }
  }
  return value;
}
var init_optionalChain = __esm({
  "../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/buildPolyfills/_optionalChain.js"() {
    init_import_meta_url();
    __name(_optionalChain, "_optionalChain");
  }
});

// ../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/index.js
var init_esm7 = __esm({
  "../../node_modules/.pnpm/@sentry+utils@7.87.0/node_modules/@sentry/utils/esm/index.js"() {
    init_import_meta_url();
    init_aggregate_errors();
    init_dsn();
    init_error5();
    init_worldwide();
    init_is();
    init_logger2();
    init_misc();
    init_node2();
    init_normalize();
    init_object();
    init_promisebuffer();
    init_requestdata();
    init_severity2();
    init_stacktrace();
    init_string();
    init_syncpromise();
    init_time();
    init_tracing();
    init_envelope();
    init_ratelimit();
    init_baggage();
    init_url();
    init_eventbuilder();
    init_lru();
    init_nullishCoalesce();
    init_optionalChain();
    init_console();
    init_globalError();
    init_globalUnhandledRejection();
  }
});

// ../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/debug-build.js
var DEBUG_BUILD2;
var init_debug_build2 = __esm({
  "../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/debug-build.js"() {
    init_import_meta_url();
    DEBUG_BUILD2 = typeof __SENTRY_DEBUG__ === "undefined" || __SENTRY_DEBUG__;
  }
});

// ../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/constants.js
var DEFAULT_ENVIRONMENT;
var init_constants5 = __esm({
  "../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/constants.js"() {
    init_import_meta_url();
    DEFAULT_ENVIRONMENT = "production";
  }
});

// ../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/eventProcessors.js
function getGlobalEventProcessors() {
  return getGlobalSingleton("globalEventProcessors", () => []);
}
function addGlobalEventProcessor(callback) {
  getGlobalEventProcessors().push(callback);
}
function notifyEventProcessors(processors, event, hint, index = 0) {
  return new SyncPromise((resolve32, reject) => {
    const processor = processors[index];
    if (event === null || typeof processor !== "function") {
      resolve32(event);
    } else {
      const result = processor({ ...event }, hint);
      DEBUG_BUILD2 && processor.id && result === null && logger2.log(`Event processor "${processor.id}" dropped event`);
      if (isThenable(result)) {
        void result.then((final) => notifyEventProcessors(processors, final, hint, index + 1).then(resolve32)).then(null, reject);
      } else {
        void notifyEventProcessors(processors, result, hint, index + 1).then(resolve32).then(null, reject);
      }
    }
  });
}
var init_eventProcessors = __esm({
  "../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/eventProcessors.js"() {
    init_import_meta_url();
    init_esm7();
    init_debug_build2();
    __name(getGlobalEventProcessors, "getGlobalEventProcessors");
    __name(addGlobalEventProcessor, "addGlobalEventProcessor");
    __name(notifyEventProcessors, "notifyEventProcessors");
  }
});

// ../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/session.js
function makeSession(context2) {
  const startingTime = timestampInSeconds();
  const session = {
    sid: uuid42(),
    init: true,
    timestamp: startingTime,
    started: startingTime,
    duration: 0,
    status: "ok",
    errors: 0,
    ignoreDuration: false,
    toJSON: /* @__PURE__ */ __name(() => sessionToJSON(session), "toJSON")
  };
  if (context2) {
    updateSession(session, context2);
  }
  return session;
}
function updateSession(session, context2 = {}) {
  if (context2.user) {
    if (!session.ipAddress && context2.user.ip_address) {
      session.ipAddress = context2.user.ip_address;
    }
    if (!session.did && !context2.did) {
      session.did = context2.user.id || context2.user.email || context2.user.username;
    }
  }
  session.timestamp = context2.timestamp || timestampInSeconds();
  if (context2.abnormal_mechanism) {
    session.abnormal_mechanism = context2.abnormal_mechanism;
  }
  if (context2.ignoreDuration) {
    session.ignoreDuration = context2.ignoreDuration;
  }
  if (context2.sid) {
    session.sid = context2.sid.length === 32 ? context2.sid : uuid42();
  }
  if (context2.init !== void 0) {
    session.init = context2.init;
  }
  if (!session.did && context2.did) {
    session.did = `${context2.did}`;
  }
  if (typeof context2.started === "number") {
    session.started = context2.started;
  }
  if (session.ignoreDuration) {
    session.duration = void 0;
  } else if (typeof context2.duration === "number") {
    session.duration = context2.duration;
  } else {
    const duration = session.timestamp - session.started;
    session.duration = duration >= 0 ? duration : 0;
  }
  if (context2.release) {
    session.release = context2.release;
  }
  if (context2.environment) {
    session.environment = context2.environment;
  }
  if (!session.ipAddress && context2.ipAddress) {
    session.ipAddress = context2.ipAddress;
  }
  if (!session.userAgent && context2.userAgent) {
    session.userAgent = context2.userAgent;
  }
  if (typeof context2.errors === "number") {
    session.errors = context2.errors;
  }
  if (context2.status) {
    session.status = context2.status;
  }
}
function closeSession(session, status2) {
  let context2 = {};
  if (status2) {
    context2 = { status: status2 };
  } else if (session.status === "ok") {
    context2 = { status: "exited" };
  }
  updateSession(session, context2);
}
function sessionToJSON(session) {
  return dropUndefinedKeys({
    sid: `${session.sid}`,
    init: session.init,
    // Make sure that sec is converted to ms for date constructor
    started: new Date(session.started * 1e3).toISOString(),
    timestamp: new Date(session.timestamp * 1e3).toISOString(),
    status: session.status,
    errors: session.errors,
    did: typeof session.did === "number" || typeof session.did === "string" ? `${session.did}` : void 0,
    duration: session.duration,
    abnormal_mechanism: session.abnormal_mechanism,
    attrs: {
      release: session.release,
      environment: session.environment,
      ip_address: session.ipAddress,
      user_agent: session.userAgent
    }
  });
}
var init_session = __esm({
  "../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/session.js"() {
    init_import_meta_url();
    init_esm7();
    __name(makeSession, "makeSession");
    __name(updateSession, "updateSession");
    __name(closeSession, "closeSession");
    __name(sessionToJSON, "sessionToJSON");
  }
});

// ../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/scope.js
function generatePropagationContext() {
  return {
    traceId: uuid42(),
    spanId: uuid42().substring(16)
  };
}
var DEFAULT_MAX_BREADCRUMBS, Scope;
var init_scope = __esm({
  "../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/scope.js"() {
    init_import_meta_url();
    init_esm7();
    init_eventProcessors();
    init_session();
    DEFAULT_MAX_BREADCRUMBS = 100;
    Scope = class _Scope {
      static {
        __name(this, "Scope");
      }
      /** Flag if notifying is happening. */
      /** Callback for client to receive scope changes. */
      /** Callback list that will be called after {@link applyToEvent}. */
      /** Array of breadcrumbs. */
      /** User */
      /** Tags */
      /** Extra */
      /** Contexts */
      /** Attachments */
      /** Propagation Context for distributed tracing */
      /**
       * A place to stash data which is needed at some point in the SDK's event processing pipeline but which shouldn't get
       * sent to Sentry
       */
      /** Fingerprint */
      /** Severity */
      // eslint-disable-next-line deprecation/deprecation
      /** Transaction Name */
      /** Span */
      /** Session */
      /** Request Mode Session Status */
      // NOTE: Any field which gets added here should get added not only to the constructor but also to the `clone` method.
      constructor() {
        this._notifyingListeners = false;
        this._scopeListeners = [];
        this._eventProcessors = [];
        this._breadcrumbs = [];
        this._attachments = [];
        this._user = {};
        this._tags = {};
        this._extra = {};
        this._contexts = {};
        this._sdkProcessingMetadata = {};
        this._propagationContext = generatePropagationContext();
      }
      /**
       * Inherit values from the parent scope.
       * @deprecated Use `scope.clone()` and `new Scope()` instead.
       */
      static clone(scope) {
        return scope ? scope.clone() : new _Scope();
      }
      /**
       * Clone this scope instance.
       */
      clone() {
        const newScope = new _Scope();
        newScope._breadcrumbs = [...this._breadcrumbs];
        newScope._tags = { ...this._tags };
        newScope._extra = { ...this._extra };
        newScope._contexts = { ...this._contexts };
        newScope._user = this._user;
        newScope._level = this._level;
        newScope._span = this._span;
        newScope._session = this._session;
        newScope._transactionName = this._transactionName;
        newScope._fingerprint = this._fingerprint;
        newScope._eventProcessors = [...this._eventProcessors];
        newScope._requestSession = this._requestSession;
        newScope._attachments = [...this._attachments];
        newScope._sdkProcessingMetadata = { ...this._sdkProcessingMetadata };
        newScope._propagationContext = { ...this._propagationContext };
        return newScope;
      }
      /**
       * Add internal on change listener. Used for sub SDKs that need to store the scope.
       * @hidden
       */
      addScopeListener(callback) {
        this._scopeListeners.push(callback);
      }
      /**
       * @inheritDoc
       */
      addEventProcessor(callback) {
        this._eventProcessors.push(callback);
        return this;
      }
      /**
       * @inheritDoc
       */
      setUser(user) {
        this._user = user || {};
        if (this._session) {
          updateSession(this._session, { user });
        }
        this._notifyScopeListeners();
        return this;
      }
      /**
       * @inheritDoc
       */
      getUser() {
        return this._user;
      }
      /**
       * @inheritDoc
       */
      getRequestSession() {
        return this._requestSession;
      }
      /**
       * @inheritDoc
       */
      setRequestSession(requestSession) {
        this._requestSession = requestSession;
        return this;
      }
      /**
       * @inheritDoc
       */
      setTags(tags) {
        this._tags = {
          ...this._tags,
          ...tags
        };
        this._notifyScopeListeners();
        return this;
      }
      /**
       * @inheritDoc
       */
      setTag(key, value) {
        this._tags = { ...this._tags, [key]: value };
        this._notifyScopeListeners();
        return this;
      }
      /**
       * @inheritDoc
       */
      setExtras(extras) {
        this._extra = {
          ...this._extra,
          ...extras
        };
        this._notifyScopeListeners();
        return this;
      }
      /**
       * @inheritDoc
       */
      setExtra(key, extra) {
        this._extra = { ...this._extra, [key]: extra };
        this._notifyScopeListeners();
        return this;
      }
      /**
       * @inheritDoc
       */
      setFingerprint(fingerprint) {
        this._fingerprint = fingerprint;
        this._notifyScopeListeners();
        return this;
      }
      /**
       * @inheritDoc
       */
      setLevel(level) {
        this._level = level;
        this._notifyScopeListeners();
        return this;
      }
      /**
       * @inheritDoc
       */
      setTransactionName(name2) {
        this._transactionName = name2;
        this._notifyScopeListeners();
        return this;
      }
      /**
       * @inheritDoc
       */
      setContext(key, context2) {
        if (context2 === null) {
          delete this._contexts[key];
        } else {
          this._contexts[key] = context2;
        }
        this._notifyScopeListeners();
        return this;
      }
      /**
       * @inheritDoc
       */
      setSpan(span) {
        this._span = span;
        this._notifyScopeListeners();
        return this;
      }
      /**
       * @inheritDoc
       */
      getSpan() {
        return this._span;
      }
      /**
       * @inheritDoc
       */
      getTransaction() {
        const span = this.getSpan();
        return span && span.transaction;
      }
      /**
       * @inheritDoc
       */
      setSession(session) {
        if (!session) {
          delete this._session;
        } else {
          this._session = session;
        }
        this._notifyScopeListeners();
        return this;
      }
      /**
       * @inheritDoc
       */
      getSession() {
        return this._session;
      }
      /**
       * @inheritDoc
       */
      update(captureContext) {
        if (!captureContext) {
          return this;
        }
        if (typeof captureContext === "function") {
          const updatedScope = captureContext(this);
          return updatedScope instanceof _Scope ? updatedScope : this;
        }
        if (captureContext instanceof _Scope) {
          this._tags = { ...this._tags, ...captureContext._tags };
          this._extra = { ...this._extra, ...captureContext._extra };
          this._contexts = { ...this._contexts, ...captureContext._contexts };
          if (captureContext._user && Object.keys(captureContext._user).length) {
            this._user = captureContext._user;
          }
          if (captureContext._level) {
            this._level = captureContext._level;
          }
          if (captureContext._fingerprint) {
            this._fingerprint = captureContext._fingerprint;
          }
          if (captureContext._requestSession) {
            this._requestSession = captureContext._requestSession;
          }
          if (captureContext._propagationContext) {
            this._propagationContext = captureContext._propagationContext;
          }
        } else if (isPlainObject3(captureContext)) {
          captureContext = captureContext;
          this._tags = { ...this._tags, ...captureContext.tags };
          this._extra = { ...this._extra, ...captureContext.extra };
          this._contexts = { ...this._contexts, ...captureContext.contexts };
          if (captureContext.user) {
            this._user = captureContext.user;
          }
          if (captureContext.level) {
            this._level = captureContext.level;
          }
          if (captureContext.fingerprint) {
            this._fingerprint = captureContext.fingerprint;
          }
          if (captureContext.requestSession) {
            this._requestSession = captureContext.requestSession;
          }
          if (captureContext.propagationContext) {
            this._propagationContext = captureContext.propagationContext;
          }
        }
        return this;
      }
      /**
       * @inheritDoc
       */
      clear() {
        this._breadcrumbs = [];
        this._tags = {};
        this._extra = {};
        this._user = {};
        this._contexts = {};
        this._level = void 0;
        this._transactionName = void 0;
        this._fingerprint = void 0;
        this._requestSession = void 0;
        this._span = void 0;
        this._session = void 0;
        this._notifyScopeListeners();
        this._attachments = [];
        this._propagationContext = generatePropagationContext();
        return this;
      }
      /**
       * @inheritDoc
       */
      addBreadcrumb(breadcrumb, maxBreadcrumbs) {
        const maxCrumbs = typeof maxBreadcrumbs === "number" ? maxBreadcrumbs : DEFAULT_MAX_BREADCRUMBS;
        if (maxCrumbs <= 0) {
          return this;
        }
        const mergedBreadcrumb = {
          timestamp: dateTimestampInSeconds(),
          ...breadcrumb
        };
        const breadcrumbs = this._breadcrumbs;
        breadcrumbs.push(mergedBreadcrumb);
        this._breadcrumbs = breadcrumbs.length > maxCrumbs ? breadcrumbs.slice(-maxCrumbs) : breadcrumbs;
        this._notifyScopeListeners();
        return this;
      }
      /**
       * @inheritDoc
       */
      getLastBreadcrumb() {
        return this._breadcrumbs[this._breadcrumbs.length - 1];
      }
      /**
       * @inheritDoc
       */
      clearBreadcrumbs() {
        this._breadcrumbs = [];
        this._notifyScopeListeners();
        return this;
      }
      /**
       * @inheritDoc
       */
      addAttachment(attachment) {
        this._attachments.push(attachment);
        return this;
      }
      /**
       * @inheritDoc
       */
      getAttachments() {
        return this._attachments;
      }
      /**
       * @inheritDoc
       */
      clearAttachments() {
        this._attachments = [];
        return this;
      }
      /**
       * Applies data from the scope to the event and runs all event processors on it.
       *
       * @param event Event
       * @param hint Object containing additional information about the original exception, for use by the event processors.
       * @hidden
       */
      applyToEvent(event, hint = {}, additionalEventProcessors) {
        if (this._extra && Object.keys(this._extra).length) {
          event.extra = { ...this._extra, ...event.extra };
        }
        if (this._tags && Object.keys(this._tags).length) {
          event.tags = { ...this._tags, ...event.tags };
        }
        if (this._user && Object.keys(this._user).length) {
          event.user = { ...this._user, ...event.user };
        }
        if (this._contexts && Object.keys(this._contexts).length) {
          event.contexts = { ...this._contexts, ...event.contexts };
        }
        if (this._level) {
          event.level = this._level;
        }
        if (this._transactionName) {
          event.transaction = this._transactionName;
        }
        if (this._span) {
          event.contexts = { trace: this._span.getTraceContext(), ...event.contexts };
          const transaction = this._span.transaction;
          if (transaction) {
            event.sdkProcessingMetadata = {
              dynamicSamplingContext: transaction.getDynamicSamplingContext(),
              ...event.sdkProcessingMetadata
            };
            const transactionName = transaction.name;
            if (transactionName) {
              event.tags = { transaction: transactionName, ...event.tags };
            }
          }
        }
        this._applyFingerprint(event);
        const scopeBreadcrumbs = this._getBreadcrumbs();
        const breadcrumbs = [...event.breadcrumbs || [], ...scopeBreadcrumbs];
        event.breadcrumbs = breadcrumbs.length > 0 ? breadcrumbs : void 0;
        event.sdkProcessingMetadata = {
          ...event.sdkProcessingMetadata,
          ...this._sdkProcessingMetadata,
          propagationContext: this._propagationContext
        };
        return notifyEventProcessors(
          [
            ...additionalEventProcessors || [],
            // eslint-disable-next-line deprecation/deprecation
            ...getGlobalEventProcessors(),
            ...this._eventProcessors
          ],
          event,
          hint
        );
      }
      /**
       * Add data which will be accessible during event processing but won't get sent to Sentry
       */
      setSDKProcessingMetadata(newData) {
        this._sdkProcessingMetadata = { ...this._sdkProcessingMetadata, ...newData };
        return this;
      }
      /**
       * @inheritDoc
       */
      setPropagationContext(context2) {
        this._propagationContext = context2;
        return this;
      }
      /**
       * @inheritDoc
       */
      getPropagationContext() {
        return this._propagationContext;
      }
      /**
       * Get the breadcrumbs for this scope.
       */
      _getBreadcrumbs() {
        return this._breadcrumbs;
      }
      /**
       * This will be called on every set call.
       */
      _notifyScopeListeners() {
        if (!this._notifyingListeners) {
          this._notifyingListeners = true;
          this._scopeListeners.forEach((callback) => {
            callback(this);
          });
          this._notifyingListeners = false;
        }
      }
      /**
       * Applies fingerprint from the scope to the event if there's one,
       * uses message if there's one instead or get rid of empty fingerprint
       */
      _applyFingerprint(event) {
        event.fingerprint = event.fingerprint ? arrayify(event.fingerprint) : [];
        if (this._fingerprint) {
          event.fingerprint = event.fingerprint.concat(this._fingerprint);
        }
        if (event.fingerprint && !event.fingerprint.length) {
          delete event.fingerprint;
        }
      }
    };
    __name(generatePropagationContext, "generatePropagationContext");
  }
});

// ../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/version.js
var SDK_VERSION;
var init_version2 = __esm({
  "../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/version.js"() {
    init_import_meta_url();
    SDK_VERSION = "7.87.0";
  }
});

// ../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/hub.js
function getMainCarrier() {
  GLOBAL_OBJ.__SENTRY__ = GLOBAL_OBJ.__SENTRY__ || {
    extensions: {},
    hub: void 0
  };
  return GLOBAL_OBJ;
}
function makeMain(hub) {
  const registry = getMainCarrier();
  const oldHub = getHubFromCarrier(registry);
  setHubOnCarrier(registry, hub);
  return oldHub;
}
function getCurrentHub() {
  const registry = getMainCarrier();
  if (registry.__SENTRY__ && registry.__SENTRY__.acs) {
    const hub = registry.__SENTRY__.acs.getCurrentHub();
    if (hub) {
      return hub;
    }
  }
  return getGlobalHub(registry);
}
function getGlobalHub(registry = getMainCarrier()) {
  if (!hasHubOnCarrier(registry) || getHubFromCarrier(registry).isOlderThan(API_VERSION)) {
    setHubOnCarrier(registry, new Hub());
  }
  return getHubFromCarrier(registry);
}
function ensureHubOnCarrier(carrier, parent = getGlobalHub()) {
  if (!hasHubOnCarrier(carrier) || getHubFromCarrier(carrier).isOlderThan(API_VERSION)) {
    const globalHubTopStack = parent.getStackTop();
    setHubOnCarrier(carrier, new Hub(globalHubTopStack.client, globalHubTopStack.scope.clone()));
  }
}
function setAsyncContextStrategy(strategy) {
  const registry = getMainCarrier();
  registry.__SENTRY__ = registry.__SENTRY__ || {};
  registry.__SENTRY__.acs = strategy;
}
function hasHubOnCarrier(carrier) {
  return !!(carrier && carrier.__SENTRY__ && carrier.__SENTRY__.hub);
}
function getHubFromCarrier(carrier) {
  return getGlobalSingleton("hub", () => new Hub(), carrier);
}
function setHubOnCarrier(carrier, hub) {
  if (!carrier) return false;
  const __SENTRY__ = carrier.__SENTRY__ = carrier.__SENTRY__ || {};
  __SENTRY__.hub = hub;
  return true;
}
var API_VERSION, DEFAULT_BREADCRUMBS, Hub;
var init_hub = __esm({
  "../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/hub.js"() {
    init_import_meta_url();
    init_esm7();
    init_constants5();
    init_debug_build2();
    init_scope();
    init_session();
    init_version2();
    API_VERSION = parseFloat(SDK_VERSION);
    DEFAULT_BREADCRUMBS = 100;
    Hub = class {
      static {
        __name(this, "Hub");
      }
      /** Is a {@link Layer}[] containing the client and scope */
      /** Contains the last event id of a captured event.  */
      /**
       * Creates a new instance of the hub, will push one {@link Layer} into the
       * internal stack on creation.
       *
       * @param client bound to the hub.
       * @param scope bound to the hub.
       * @param version number, higher number means higher priority.
       */
      constructor(client, scope = new Scope(), _version = API_VERSION) {
        this._version = _version;
        this._stack = [{ scope }];
        if (client) {
          this.bindClient(client);
        }
      }
      /**
       * @inheritDoc
       */
      isOlderThan(version5) {
        return this._version < version5;
      }
      /**
       * @inheritDoc
       */
      bindClient(client) {
        const top2 = this.getStackTop();
        top2.client = client;
        if (client && client.setupIntegrations) {
          client.setupIntegrations();
        }
      }
      /**
       * @inheritDoc
       */
      pushScope() {
        const scope = this.getScope().clone();
        this.getStack().push({
          client: this.getClient(),
          scope
        });
        return scope;
      }
      /**
       * @inheritDoc
       */
      popScope() {
        if (this.getStack().length <= 1) return false;
        return !!this.getStack().pop();
      }
      /**
       * @inheritDoc
       */
      withScope(callback) {
        const scope = this.pushScope();
        try {
          callback(scope);
        } finally {
          this.popScope();
        }
      }
      /**
       * @inheritDoc
       */
      getClient() {
        return this.getStackTop().client;
      }
      /** Returns the scope of the top stack. */
      getScope() {
        return this.getStackTop().scope;
      }
      /** Returns the scope stack for domains or the process. */
      getStack() {
        return this._stack;
      }
      /** Returns the topmost scope layer in the order domain > local > process. */
      getStackTop() {
        return this._stack[this._stack.length - 1];
      }
      /**
       * @inheritDoc
       */
      captureException(exception, hint) {
        const eventId = this._lastEventId = hint && hint.event_id ? hint.event_id : uuid42();
        const syntheticException = new Error("Sentry syntheticException");
        this._withClient((client, scope) => {
          client.captureException(
            exception,
            {
              originalException: exception,
              syntheticException,
              ...hint,
              event_id: eventId
            },
            scope
          );
        });
        return eventId;
      }
      /**
       * @inheritDoc
       */
      captureMessage(message, level, hint) {
        const eventId = this._lastEventId = hint && hint.event_id ? hint.event_id : uuid42();
        const syntheticException = new Error(message);
        this._withClient((client, scope) => {
          client.captureMessage(
            message,
            level,
            {
              originalException: message,
              syntheticException,
              ...hint,
              event_id: eventId
            },
            scope
          );
        });
        return eventId;
      }
      /**
       * @inheritDoc
       */
      captureEvent(event, hint) {
        const eventId = hint && hint.event_id ? hint.event_id : uuid42();
        if (!event.type) {
          this._lastEventId = eventId;
        }
        this._withClient((client, scope) => {
          client.captureEvent(event, { ...hint, event_id: eventId }, scope);
        });
        return eventId;
      }
      /**
       * @inheritDoc
       */
      lastEventId() {
        return this._lastEventId;
      }
      /**
       * @inheritDoc
       */
      addBreadcrumb(breadcrumb, hint) {
        const { scope, client } = this.getStackTop();
        if (!client) return;
        const { beforeBreadcrumb = null, maxBreadcrumbs = DEFAULT_BREADCRUMBS } = client.getOptions && client.getOptions() || {};
        if (maxBreadcrumbs <= 0) return;
        const timestamp = dateTimestampInSeconds();
        const mergedBreadcrumb = { timestamp, ...breadcrumb };
        const finalBreadcrumb = beforeBreadcrumb ? consoleSandbox(() => beforeBreadcrumb(mergedBreadcrumb, hint)) : mergedBreadcrumb;
        if (finalBreadcrumb === null) return;
        if (client.emit) {
          client.emit("beforeAddBreadcrumb", finalBreadcrumb, hint);
        }
        scope.addBreadcrumb(finalBreadcrumb, maxBreadcrumbs);
      }
      /**
       * @inheritDoc
       */
      setUser(user) {
        this.getScope().setUser(user);
      }
      /**
       * @inheritDoc
       */
      setTags(tags) {
        this.getScope().setTags(tags);
      }
      /**
       * @inheritDoc
       */
      setExtras(extras) {
        this.getScope().setExtras(extras);
      }
      /**
       * @inheritDoc
       */
      setTag(key, value) {
        this.getScope().setTag(key, value);
      }
      /**
       * @inheritDoc
       */
      setExtra(key, extra) {
        this.getScope().setExtra(key, extra);
      }
      /**
       * @inheritDoc
       */
      // eslint-disable-next-line @typescript-eslint/no-explicit-any
      setContext(name2, context2) {
        this.getScope().setContext(name2, context2);
      }
      /**
       * @inheritDoc
       */
      configureScope(callback) {
        const { scope, client } = this.getStackTop();
        if (client) {
          callback(scope);
        }
      }
      /**
       * @inheritDoc
       */
      run(callback) {
        const oldHub = makeMain(this);
        try {
          callback(this);
        } finally {
          makeMain(oldHub);
        }
      }
      /**
       * @inheritDoc
       */
      getIntegration(integration) {
        const client = this.getClient();
        if (!client) return null;
        try {
          return client.getIntegration(integration);
        } catch (_oO) {
          DEBUG_BUILD2 && logger2.warn(`Cannot retrieve integration ${integration.id} from the current Hub`);
          return null;
        }
      }
      /**
       * @inheritDoc
       */
      startTransaction(context2, customSamplingContext) {
        const result = this._callExtensionMethod("startTransaction", context2, customSamplingContext);
        if (DEBUG_BUILD2 && !result) {
          const client = this.getClient();
          if (!client) {
            logger2.warn(
              "Tracing extension 'startTransaction' is missing. You should 'init' the SDK before calling 'startTransaction'"
            );
          } else {
            logger2.warn(`Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':
Sentry.addTracingExtensions();
Sentry.init({...});
`);
          }
        }
        return result;
      }
      /**
       * @inheritDoc
       */
      traceHeaders() {
        return this._callExtensionMethod("traceHeaders");
      }
      /**
       * @inheritDoc
       */
      captureSession(endSession = false) {
        if (endSession) {
          return this.endSession();
        }
        this._sendSessionUpdate();
      }
      /**
       * @inheritDoc
       */
      endSession() {
        const layer = this.getStackTop();
        const scope = layer.scope;
        const session = scope.getSession();
        if (session) {
          closeSession(session);
        }
        this._sendSessionUpdate();
        scope.setSession();
      }
      /**
       * @inheritDoc
       */
      startSession(context2) {
        const { scope, client } = this.getStackTop();
        const { release: release3, environment = DEFAULT_ENVIRONMENT } = client && client.getOptions() || {};
        const { userAgent } = GLOBAL_OBJ.navigator || {};
        const session = makeSession({
          release: release3,
          environment,
          user: scope.getUser(),
          ...userAgent && { userAgent },
          ...context2
        });
        const currentSession = scope.getSession && scope.getSession();
        if (currentSession && currentSession.status === "ok") {
          updateSession(currentSession, { status: "exited" });
        }
        this.endSession();
        scope.setSession(session);
        return session;
      }
      /**
       * Returns if default PII should be sent to Sentry and propagated in ourgoing requests
       * when Tracing is used.
       */
      shouldSendDefaultPii() {
        const client = this.getClient();
        const options = client && client.getOptions();
        return Boolean(options && options.sendDefaultPii);
      }
      /**
       * Sends the current Session on the scope
       */
      _sendSessionUpdate() {
        const { scope, client } = this.getStackTop();
        const session = scope.getSession();
        if (session && client && client.captureSession) {
          client.captureSession(session);
        }
      }
      /**
       * Internal helper function to call a method on the top client if it exists.
       *
       * @param method The method to call on the client.
       * @param args Arguments to pass to the client function.
       */
      _withClient(callback) {
        const { scope, client } = this.getStackTop();
        if (client) {
          callback(client, scope);
        }
      }
      /**
       * Calls global extension method and binding current instance to the function call
       */
      // @ts-expect-error Function lacks ending return statement and return type does not include 'undefined'. ts(2366)
      // eslint-disable-next-line @typescript-eslint/no-explicit-any
      _callExtensionMethod(method, ...args) {
        const carrier = getMainCarrier();
        const sentry = carrier.__SENTRY__;
        if (sentry && sentry.extensions && typeof sentry.extensions[method] === "function") {
          return sentry.extensions[method].apply(this, args);
        }
        DEBUG_BUILD2 && logger2.warn(`Extension method ${method} couldn't be found, doing nothing.`);
      }
    };
    __name(getMainCarrier, "getMainCarrier");
    __name(makeMain, "makeMain");
    __name(getCurrentHub, "getCurrentHub");
    __name(getGlobalHub, "getGlobalHub");
    __name(ensureHubOnCarrier, "ensureHubOnCarrier");
    __name(setAsyncContextStrategy, "setAsyncContextStrategy");
    __name(hasHubOnCarrier, "hasHubOnCarrier");
    __name(getHubFromCarrier, "getHubFromCarrier");
    __name(setHubOnCarrier, "setHubOnCarrier");
  }
});

// ../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/tracing/utils.js
function getActiveTransaction(maybeHub) {
  const hub = maybeHub || getCurrentHub();
  const scope = hub.getScope();
  return scope.getTransaction();
}
var init_utils7 = __esm({
  "../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/tracing/utils.js"() {
    init_import_meta_url();
    init_hub();
    __name(getActiveTransaction, "getActiveTransaction");
  }
});

// ../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/tracing/errors.js
function registerErrorInstrumentation() {
  if (errorsInstrumented) {
    return;
  }
  errorsInstrumented = true;
  addGlobalErrorInstrumentationHandler(errorCallback);
  addGlobalUnhandledRejectionInstrumentationHandler(errorCallback);
}
function errorCallback() {
  const activeTransaction = getActiveTransaction();
  if (activeTransaction) {
    const status2 = "internal_error";
    DEBUG_BUILD2 && logger2.log(`[Tracing] Transaction: ${status2} -> Global error occured`);
    activeTransaction.setStatus(status2);
  }
}
var errorsInstrumented;
var init_errors5 = __esm({
  "../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/tracing/errors.js"() {
    init_import_meta_url();
    init_esm7();
    init_debug_build2();
    init_utils7();
    errorsInstrumented = false;
    __name(registerErrorInstrumentation, "registerErrorInstrumentation");
    __name(errorCallback, "errorCallback");
    errorCallback.tag = "sentry_tracingErrorCallback";
  }
});

// ../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/tracing/span.js
function spanStatusfromHttpCode(httpStatus) {
  if (httpStatus < 400 && httpStatus >= 100) {
    return "ok";
  }
  if (httpStatus >= 400 && httpStatus < 500) {
    switch (httpStatus) {
      case 401:
        return "unauthenticated";
      case 403:
        return "permission_denied";
      case 404:
        return "not_found";
      case 409:
        return "already_exists";
      case 413:
        return "failed_precondition";
      case 429:
        return "resource_exhausted";
      default:
        return "invalid_argument";
    }
  }
  if (httpStatus >= 500 && httpStatus < 600) {
    switch (httpStatus) {
      case 501:
        return "unimplemented";
      case 503:
        return "unavailable";
      case 504:
        return "deadline_exceeded";
      default:
        return "internal_error";
    }
  }
  return "unknown_error";
}
var SpanRecorder, Span;
var init_span = __esm({
  "../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/tracing/span.js"() {
    init_import_meta_url();
    init_esm7();
    init_debug_build2();
    SpanRecorder = class {
      static {
        __name(this, "SpanRecorder");
      }
      constructor(maxlen = 1e3) {
        this._maxlen = maxlen;
        this.spans = [];
      }
      /**
       * This is just so that we don't run out of memory while recording a lot
       * of spans. At some point we just stop and flush out the start of the
       * trace tree (i.e.the first n spans with the smallest
       * start_timestamp).
       */
      add(span) {
        if (this.spans.length > this._maxlen) {
          span.spanRecorder = void 0;
        } else {
          this.spans.push(span);
        }
      }
    };
    Span = class _Span {
      static {
        __name(this, "Span");
      }
      /**
       * @inheritDoc
       */
      /**
       * @inheritDoc
       */
      /**
       * @inheritDoc
       */
      /**
       * Internal keeper of the status
       */
      /**
       * @inheritDoc
       */
      /**
       * Timestamp in seconds when the span was created.
       */
      /**
       * Timestamp in seconds when the span ended.
       */
      /**
       * @inheritDoc
       */
      /**
       * @inheritDoc
       */
      /**
       * @inheritDoc
       */
      /**
       * @inheritDoc
       */
      // eslint-disable-next-line @typescript-eslint/no-explicit-any
      /**
       * List of spans that were finalized
       */
      /**
       * @inheritDoc
       */
      /**
       * The instrumenter that created this span.
       */
      /**
       * The origin of the span, giving context about what created the span.
       */
      /**
       * You should never call the constructor manually, always use `Sentry.startTransaction()`
       * or call `startChild()` on an existing span.
       * @internal
       * @hideconstructor
       * @hidden
       */
      constructor(spanContext = {}) {
        this.traceId = spanContext.traceId || uuid42();
        this.spanId = spanContext.spanId || uuid42().substring(16);
        this.startTimestamp = spanContext.startTimestamp || timestampInSeconds();
        this.tags = spanContext.tags || {};
        this.data = spanContext.data || {};
        this.instrumenter = spanContext.instrumenter || "sentry";
        this.origin = spanContext.origin || "manual";
        if (spanContext.parentSpanId) {
          this.parentSpanId = spanContext.parentSpanId;
        }
        if ("sampled" in spanContext) {
          this.sampled = spanContext.sampled;
        }
        if (spanContext.op) {
          this.op = spanContext.op;
        }
        if (spanContext.description) {
          this.description = spanContext.description;
        }
        if (spanContext.name) {
          this.description = spanContext.name;
        }
        if (spanContext.status) {
          this.status = spanContext.status;
        }
        if (spanContext.endTimestamp) {
          this.endTimestamp = spanContext.endTimestamp;
        }
      }
      /** An alias for `description` of the Span. */
      get name() {
        return this.description || "";
      }
      /** Update the name of the span. */
      set name(name2) {
        this.setName(name2);
      }
      /**
       * @inheritDoc
       */
      startChild(spanContext) {
        const childSpan = new _Span({
          ...spanContext,
          parentSpanId: this.spanId,
          sampled: this.sampled,
          traceId: this.traceId
        });
        childSpan.spanRecorder = this.spanRecorder;
        if (childSpan.spanRecorder) {
          childSpan.spanRecorder.add(childSpan);
        }
        childSpan.transaction = this.transaction;
        if (DEBUG_BUILD2 && childSpan.transaction) {
          const opStr = spanContext && spanContext.op || "< unknown op >";
          const nameStr = childSpan.transaction.name || "< unknown name >";
          const idStr = childSpan.transaction.spanId;
          const logMessage = `[Tracing] Starting '${opStr}' span on transaction '${nameStr}' (${idStr}).`;
          childSpan.transaction.metadata.spanMetadata[childSpan.spanId] = { logMessage };
          logger2.log(logMessage);
        }
        return childSpan;
      }
      /**
       * @inheritDoc
       */
      setTag(key, value) {
        this.tags = { ...this.tags, [key]: value };
        return this;
      }
      /**
       * @inheritDoc
       */
      // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
      setData(key, value) {
        this.data = { ...this.data, [key]: value };
        return this;
      }
      /**
       * @inheritDoc
       */
      setStatus(value) {
        this.status = value;
        return this;
      }
      /**
       * @inheritDoc
       */
      setHttpStatus(httpStatus) {
        this.setTag("http.status_code", String(httpStatus));
        this.setData("http.response.status_code", httpStatus);
        const spanStatus = spanStatusfromHttpCode(httpStatus);
        if (spanStatus !== "unknown_error") {
          this.setStatus(spanStatus);
        }
        return this;
      }
      /**
       * @inheritDoc
       */
      setName(name2) {
        this.description = name2;
      }
      /**
       * @inheritDoc
       */
      isSuccess() {
        return this.status === "ok";
      }
      /**
       * @inheritDoc
       */
      finish(endTimestamp) {
        if (DEBUG_BUILD2 && // Don't call this for transactions
        this.transaction && this.transaction.spanId !== this.spanId) {
          const { logMessage } = this.transaction.metadata.spanMetadata[this.spanId];
          if (logMessage) {
            logger2.log(logMessage.replace("Starting", "Finishing"));
          }
        }
        this.endTimestamp = typeof endTimestamp === "number" ? endTimestamp : timestampInSeconds();
      }
      /**
       * @inheritDoc
       */
      toTraceparent() {
        return generateSentryTraceHeader(this.traceId, this.spanId, this.sampled);
      }
      /**
       * @inheritDoc
       */
      toContext() {
        return dropUndefinedKeys({
          data: this.data,
          description: this.description,
          endTimestamp: this.endTimestamp,
          op: this.op,
          parentSpanId: this.parentSpanId,
          sampled: this.sampled,
          spanId: this.spanId,
          startTimestamp: this.startTimestamp,
          status: this.status,
          tags: this.tags,
          traceId: this.traceId
        });
      }
      /**
       * @inheritDoc
       */
      updateWithContext(spanContext) {
        this.data = spanContext.data || {};
        this.description = spanContext.description;
        this.endTimestamp = spanContext.endTimestamp;
        this.op = spanContext.op;
        this.parentSpanId = spanContext.parentSpanId;
        this.sampled = spanContext.sampled;
        this.spanId = spanContext.spanId || this.spanId;
        this.startTimestamp = spanContext.startTimestamp || this.startTimestamp;
        this.status = spanContext.status;
        this.tags = spanContext.tags || {};
        this.traceId = spanContext.traceId || this.traceId;
        return this;
      }
      /**
       * @inheritDoc
       */
      getTraceContext() {
        return dropUndefinedKeys({
          data: Object.keys(this.data).length > 0 ? this.data : void 0,
          description: this.description,
          op: this.op,
          parent_span_id: this.parentSpanId,
          span_id: this.spanId,
          status: this.status,
          tags: Object.keys(this.tags).length > 0 ? this.tags : void 0,
          trace_id: this.traceId,
          origin: this.origin
        });
      }
      /**
       * @inheritDoc
       */
      toJSON() {
        return dropUndefinedKeys({
          data: Object.keys(this.data).length > 0 ? this.data : void 0,
          description: this.description,
          op: this.op,
          parent_span_id: this.parentSpanId,
          span_id: this.spanId,
          start_timestamp: this.startTimestamp,
          status: this.status,
          tags: Object.keys(this.tags).length > 0 ? this.tags : void 0,
          timestamp: this.endTimestamp,
          trace_id: this.traceId,
          origin: this.origin
        });
      }
    };
    __name(spanStatusfromHttpCode, "spanStatusfromHttpCode");
  }
});

// ../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/tracing/dynamicSamplingContext.js
function getDynamicSamplingContextFromClient(trace_id, client, scope) {
  const options = client.getOptions();
  const { publicKey: public_key } = client.getDsn() || {};
  const { segment: user_segment } = scope && scope.getUser() || {};
  const dsc = dropUndefinedKeys({
    environment: options.environment || DEFAULT_ENVIRONMENT,
    release: options.release,
    user_segment,
    public_key,
    trace_id
  });
  client.emit && client.emit("createDsc", dsc);
  return dsc;
}
var init_dynamicSamplingContext = __esm({
  "../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/tracing/dynamicSamplingContext.js"() {
    init_import_meta_url();
    init_esm7();
    init_constants5();
    __name(getDynamicSamplingContextFromClient, "getDynamicSamplingContextFromClient");
  }
});

// ../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/tracing/transaction.js
var Transaction;
var init_transaction = __esm({
  "../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/tracing/transaction.js"() {
    init_import_meta_url();
    init_esm7();
    init_debug_build2();
    init_hub();
    init_dynamicSamplingContext();
    init_span();
    Transaction = class extends Span {
      static {
        __name(this, "Transaction");
      }
      /**
       * The reference to the current hub.
       */
      /**
       * This constructor should never be called manually. Those instrumenting tracing should use
       * `Sentry.startTransaction()`, and internal methods should use `hub.startTransaction()`.
       * @internal
       * @hideconstructor
       * @hidden
       */
      constructor(transactionContext, hub) {
        super(transactionContext);
        delete this.description;
        this._measurements = {};
        this._contexts = {};
        this._hub = hub || getCurrentHub();
        this._name = transactionContext.name || "";
        this.metadata = {
          source: "custom",
          ...transactionContext.metadata,
          spanMetadata: {}
        };
        this._trimEnd = transactionContext.trimEnd;
        this.transaction = this;
        const incomingDynamicSamplingContext = this.metadata.dynamicSamplingContext;
        if (incomingDynamicSamplingContext) {
          this._frozenDynamicSamplingContext = { ...incomingDynamicSamplingContext };
        }
      }
      /** Getter for `name` property */
      get name() {
        return this._name;
      }
      /** Setter for `name` property, which also sets `source` as custom */
      set name(newName) {
        this.setName(newName);
      }
      /**
       * JSDoc
       */
      setName(name2, source = "custom") {
        this._name = name2;
        this.metadata.source = source;
      }
      /**
       * Attaches SpanRecorder to the span itself
       * @param maxlen maximum number of spans that can be recorded
       */
      initSpanRecorder(maxlen = 1e3) {
        if (!this.spanRecorder) {
          this.spanRecorder = new SpanRecorder(maxlen);
        }
        this.spanRecorder.add(this);
      }
      /**
       * @inheritDoc
       */
      setContext(key, context2) {
        if (context2 === null) {
          delete this._contexts[key];
        } else {
          this._contexts[key] = context2;
        }
      }
      /**
       * @inheritDoc
       */
      setMeasurement(name2, value, unit = "") {
        this._measurements[name2] = { value, unit };
      }
      /**
       * @inheritDoc
       */
      setMetadata(newMetadata) {
        this.metadata = { ...this.metadata, ...newMetadata };
      }
      /**
       * @inheritDoc
       */
      finish(endTimestamp) {
        const transaction = this._finishTransaction(endTimestamp);
        if (!transaction) {
          return void 0;
        }
        return this._hub.captureEvent(transaction);
      }
      /**
       * @inheritDoc
       */
      toContext() {
        const spanContext = super.toContext();
        return dropUndefinedKeys({
          ...spanContext,
          name: this.name,
          trimEnd: this._trimEnd
        });
      }
      /**
       * @inheritDoc
       */
      updateWithContext(transactionContext) {
        super.updateWithContext(transactionContext);
        this.name = transactionContext.name || "";
        this._trimEnd = transactionContext.trimEnd;
        return this;
      }
      /**
       * @inheritdoc
       *
       * @experimental
       */
      getDynamicSamplingContext() {
        if (this._frozenDynamicSamplingContext) {
          return this._frozenDynamicSamplingContext;
        }
        const hub = this._hub || getCurrentHub();
        const client = hub.getClient();
        if (!client) return {};
        const scope = hub.getScope();
        const dsc = getDynamicSamplingContextFromClient(this.traceId, client, scope);
        const maybeSampleRate = this.metadata.sampleRate;
        if (maybeSampleRate !== void 0) {
          dsc.sample_rate = `${maybeSampleRate}`;
        }
        const source = this.metadata.source;
        if (source && source !== "url") {
          dsc.transaction = this.name;
        }
        if (this.sampled !== void 0) {
          dsc.sampled = String(this.sampled);
        }
        return dsc;
      }
      /**
       * Override the current hub with a new one.
       * Used if you want another hub to finish the transaction.
       *
       * @internal
       */
      setHub(hub) {
        this._hub = hub;
      }
      /**
       * Finish the transaction & prepare the event to send to Sentry.
       */
      _finishTransaction(endTimestamp) {
        if (this.endTimestamp !== void 0) {
          return void 0;
        }
        if (!this.name) {
          DEBUG_BUILD2 && logger2.warn("Transaction has no name, falling back to `<unlabeled transaction>`.");
          this.name = "<unlabeled transaction>";
        }
        super.finish(endTimestamp);
        const client = this._hub.getClient();
        if (client && client.emit) {
          client.emit("finishTransaction", this);
        }
        if (this.sampled !== true) {
          DEBUG_BUILD2 && logger2.log("[Tracing] Discarding transaction because its trace was not chosen to be sampled.");
          if (client) {
            client.recordDroppedEvent("sample_rate", "transaction");
          }
          return void 0;
        }
        const finishedSpans = this.spanRecorder ? this.spanRecorder.spans.filter((s7) => s7 !== this && s7.endTimestamp) : [];
        if (this._trimEnd && finishedSpans.length > 0) {
          this.endTimestamp = finishedSpans.reduce((prev, current) => {
            if (prev.endTimestamp && current.endTimestamp) {
              return prev.endTimestamp > current.endTimestamp ? prev : current;
            }
            return prev;
          }).endTimestamp;
        }
        const metadata = this.metadata;
        const transaction = {
          contexts: {
            ...this._contexts,
            // We don't want to override trace context
            trace: this.getTraceContext()
          },
          spans: finishedSpans,
          start_timestamp: this.startTimestamp,
          tags: this.tags,
          timestamp: this.endTimestamp,
          transaction: this.name,
          type: "transaction",
          sdkProcessingMetadata: {
            ...metadata,
            dynamicSamplingContext: this.getDynamicSamplingContext()
          },
          ...metadata.source && {
            transaction_info: {
              source: metadata.source
            }
          }
        };
        const hasMeasurements = Object.keys(this._measurements).length > 0;
        if (hasMeasurements) {
          DEBUG_BUILD2 && logger2.log(
            "[Measurements] Adding measurements to transaction",
            JSON.stringify(this._measurements, void 0, 2)
          );
          transaction.measurements = this._measurements;
        }
        DEBUG_BUILD2 && logger2.log(`[Tracing] Finishing ${this.op} transaction: ${this.name}.`);
        return transaction;
      }
    };
  }
});

// ../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/utils/prepareEvent.js
function prepareEvent(options, event, hint, scope, client) {
  const { normalizeDepth = 3, normalizeMaxBreadth = 1e3 } = options;
  const prepared = {
    ...event,
    event_id: event.event_id || hint.event_id || uuid42(),
    timestamp: event.timestamp || dateTimestampInSeconds()
  };
  const integrations = hint.integrations || options.integrations.map((i7) => i7.name);
  applyClientOptions(prepared, options);
  applyIntegrationsMetadata(prepared, integrations);
  if (event.type === void 0) {
    applyDebugIds(prepared, options.stackParser);
  }
  const finalScope = getFinalScope(scope, hint.captureContext);
  if (hint.mechanism) {
    addExceptionMechanism(prepared, hint.mechanism);
  }
  let result = resolvedSyncPromise(prepared);
  const clientEventProcessors = client && client.getEventProcessors ? client.getEventProcessors() : [];
  if (finalScope) {
    if (finalScope.getAttachments) {
      const attachments = [...hint.attachments || [], ...finalScope.getAttachments()];
      if (attachments.length) {
        hint.attachments = attachments;
      }
    }
    result = finalScope.applyToEvent(prepared, hint, clientEventProcessors);
  } else {
    result = notifyEventProcessors(
      [
        ...clientEventProcessors,
        // eslint-disable-next-line deprecation/deprecation
        ...getGlobalEventProcessors()
      ],
      prepared,
      hint
    );
  }
  return result.then((evt) => {
    if (evt) {
      applyDebugMeta(evt);
    }
    if (typeof normalizeDepth === "number" && normalizeDepth > 0) {
      return normalizeEvent(evt, normalizeDepth, normalizeMaxBreadth);
    }
    return evt;
  });
}
function applyClientOptions(event, options) {
  const { environment, release: release3, dist, maxValueLength = 250 } = options;
  if (!("environment" in event)) {
    event.environment = "environment" in options ? environment : DEFAULT_ENVIRONMENT;
  }
  if (event.release === void 0 && release3 !== void 0) {
    event.release = release3;
  }
  if (event.dist === void 0 && dist !== void 0) {
    event.dist = dist;
  }
  if (event.message) {
    event.message = truncate3(event.message, maxValueLength);
  }
  const exception = event.exception && event.exception.values && event.exception.values[0];
  if (exception && exception.value) {
    exception.value = truncate3(exception.value, maxValueLength);
  }
  const request4 = event.request;
  if (request4 && request4.url) {
    request4.url = truncate3(request4.url, maxValueLength);
  }
}
function applyDebugIds(event, stackParser) {
  const debugIdMap = GLOBAL_OBJ._sentryDebugIds;
  if (!debugIdMap) {
    return;
  }
  let debugIdStackFramesCache;
  const cachedDebugIdStackFrameCache = debugIdStackParserCache.get(stackParser);
  if (cachedDebugIdStackFrameCache) {
    debugIdStackFramesCache = cachedDebugIdStackFrameCache;
  } else {
    debugIdStackFramesCache = /* @__PURE__ */ new Map();
    debugIdStackParserCache.set(stackParser, debugIdStackFramesCache);
  }
  const filenameDebugIdMap = Object.keys(debugIdMap).reduce((acc, debugIdStackTrace) => {
    let parsedStack;
    const cachedParsedStack = debugIdStackFramesCache.get(debugIdStackTrace);
    if (cachedParsedStack) {
      parsedStack = cachedParsedStack;
    } else {
      parsedStack = stackParser(debugIdStackTrace);
      debugIdStackFramesCache.set(debugIdStackTrace, parsedStack);
    }
    for (let i7 = parsedStack.length - 1; i7 >= 0; i7--) {
      const stackFrame = parsedStack[i7];
      if (stackFrame.filename) {
        acc[stackFrame.filename] = debugIdMap[debugIdStackTrace];
        break;
      }
    }
    return acc;
  }, {});
  try {
    event.exception.values.forEach((exception) => {
      exception.stacktrace.frames.forEach((frame) => {
        if (frame.filename) {
          frame.debug_id = filenameDebugIdMap[frame.filename];
        }
      });
    });
  } catch (e10) {
  }
}
function applyDebugMeta(event) {
  const filenameDebugIdMap = {};
  try {
    event.exception.values.forEach((exception) => {
      exception.stacktrace.frames.forEach((frame) => {
        if (frame.debug_id) {
          if (frame.abs_path) {
            filenameDebugIdMap[frame.abs_path] = frame.debug_id;
          } else if (frame.filename) {
            filenameDebugIdMap[frame.filename] = frame.debug_id;
          }
          delete frame.debug_id;
        }
      });
    });
  } catch (e10) {
  }
  if (Object.keys(filenameDebugIdMap).length === 0) {
    return;
  }
  event.debug_meta = event.debug_meta || {};
  event.debug_meta.images = event.debug_meta.images || [];
  const images = event.debug_meta.images;
  Object.keys(filenameDebugIdMap).forEach((filename) => {
    images.push({
      type: "sourcemap",
      code_file: filename,
      debug_id: filenameDebugIdMap[filename]
    });
  });
}
function applyIntegrationsMetadata(event, integrationNames) {
  if (integrationNames.length > 0) {
    event.sdk = event.sdk || {};
    event.sdk.integrations = [...event.sdk.integrations || [], ...integrationNames];
  }
}
function normalizeEvent(event, depth, maxBreadth) {
  if (!event) {
    return null;
  }
  const normalized = {
    ...event,
    ...event.breadcrumbs && {
      breadcrumbs: event.breadcrumbs.map((b11) => ({
        ...b11,
        ...b11.data && {
          data: normalize3(b11.data, depth, maxBreadth)
        }
      }))
    },
    ...event.user && {
      user: normalize3(event.user, depth, maxBreadth)
    },
    ...event.contexts && {
      contexts: normalize3(event.contexts, depth, maxBreadth)
    },
    ...event.extra && {
      extra: normalize3(event.extra, depth, maxBreadth)
    }
  };
  if (event.contexts && event.contexts.trace && normalized.contexts) {
    normalized.contexts.trace = event.contexts.trace;
    if (event.contexts.trace.data) {
      normalized.contexts.trace.data = normalize3(event.contexts.trace.data, depth, maxBreadth);
    }
  }
  if (event.spans) {
    normalized.spans = event.spans.map((span) => {
      if (span.data) {
        span.data = normalize3(span.data, depth, maxBreadth);
      }
      return span;
    });
  }
  return normalized;
}
function getFinalScope(scope, captureContext) {
  if (!captureContext) {
    return scope;
  }
  const finalScope = scope ? scope.clone() : new Scope();
  finalScope.update(captureContext);
  return finalScope;
}
function parseEventHintOrCaptureContext(hint) {
  if (!hint) {
    return void 0;
  }
  if (hintIsScopeOrFunction(hint)) {
    return { captureContext: hint };
  }
  if (hintIsScopeContext(hint)) {
    return {
      captureContext: hint
    };
  }
  return hint;
}
function hintIsScopeOrFunction(hint) {
  return hint instanceof Scope || typeof hint === "function";
}
function hintIsScopeContext(hint) {
  return Object.keys(hint).some((key) => captureContextKeys.includes(key));
}
var debugIdStackParserCache, captureContextKeys;
var init_prepareEvent = __esm({
  "../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/utils/prepareEvent.js"() {
    init_import_meta_url();
    init_esm7();
    init_constants5();
    init_eventProcessors();
    init_scope();
    __name(prepareEvent, "prepareEvent");
    __name(applyClientOptions, "applyClientOptions");
    debugIdStackParserCache = /* @__PURE__ */ new WeakMap();
    __name(applyDebugIds, "applyDebugIds");
    __name(applyDebugMeta, "applyDebugMeta");
    __name(applyIntegrationsMetadata, "applyIntegrationsMetadata");
    __name(normalizeEvent, "normalizeEvent");
    __name(getFinalScope, "getFinalScope");
    __name(parseEventHintOrCaptureContext, "parseEventHintOrCaptureContext");
    __name(hintIsScopeOrFunction, "hintIsScopeOrFunction");
    captureContextKeys = [
      "user",
      "level",
      "extra",
      "contexts",
      "tags",
      "fingerprint",
      "requestSession",
      "propagationContext"
    ];
    __name(hintIsScopeContext, "hintIsScopeContext");
  }
});

// ../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/exports.js
function captureException(exception, hint) {
  return getCurrentHub().captureException(exception, parseEventHintOrCaptureContext(hint));
}
function addBreadcrumb(breadcrumb) {
  getCurrentHub().addBreadcrumb(breadcrumb);
}
async function close(timeout2) {
  const client = getClient();
  if (client) {
    return client.close(timeout2);
  }
  DEBUG_BUILD2 && logger2.warn("Cannot flush events and disable SDK. No client defined.");
  return Promise.resolve(false);
}
function getClient() {
  return getCurrentHub().getClient();
}
var init_exports = __esm({
  "../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/exports.js"() {
    init_import_meta_url();
    init_esm7();
    init_debug_build2();
    init_hub();
    init_prepareEvent();
    __name(captureException, "captureException");
    __name(addBreadcrumb, "addBreadcrumb");
    __name(close, "close");
    __name(getClient, "getClient");
  }
});

// ../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/utils/hasTracingEnabled.js
function hasTracingEnabled(maybeOptions) {
  if (typeof __SENTRY_TRACING__ === "boolean" && !__SENTRY_TRACING__) {
    return false;
  }
  const client = getClient();
  const options = maybeOptions || client && client.getOptions();
  return !!options && (options.enableTracing || "tracesSampleRate" in options || "tracesSampler" in options);
}
var init_hasTracingEnabled = __esm({
  "../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/utils/hasTracingEnabled.js"() {
    init_import_meta_url();
    init_exports();
    __name(hasTracingEnabled, "hasTracingEnabled");
  }
});

// ../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/tracing/sampling.js
function sampleTransaction(transaction, options, samplingContext) {
  if (!hasTracingEnabled(options)) {
    transaction.sampled = false;
    return transaction;
  }
  if (transaction.sampled !== void 0) {
    transaction.setMetadata({
      sampleRate: Number(transaction.sampled)
    });
    return transaction;
  }
  let sampleRate;
  if (typeof options.tracesSampler === "function") {
    sampleRate = options.tracesSampler(samplingContext);
    transaction.setMetadata({
      sampleRate: Number(sampleRate)
    });
  } else if (samplingContext.parentSampled !== void 0) {
    sampleRate = samplingContext.parentSampled;
  } else if (typeof options.tracesSampleRate !== "undefined") {
    sampleRate = options.tracesSampleRate;
    transaction.setMetadata({
      sampleRate: Number(sampleRate)
    });
  } else {
    sampleRate = 1;
    transaction.setMetadata({
      sampleRate
    });
  }
  if (!isValidSampleRate(sampleRate)) {
    DEBUG_BUILD2 && logger2.warn("[Tracing] Discarding transaction because of invalid sample rate.");
    transaction.sampled = false;
    return transaction;
  }
  if (!sampleRate) {
    DEBUG_BUILD2 && logger2.log(
      `[Tracing] Discarding transaction because ${typeof options.tracesSampler === "function" ? "tracesSampler returned 0 or false" : "a negative sampling decision was inherited or tracesSampleRate is set to 0"}`
    );
    transaction.sampled = false;
    return transaction;
  }
  transaction.sampled = Math.random() < sampleRate;
  if (!transaction.sampled) {
    DEBUG_BUILD2 && logger2.log(
      `[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(
        sampleRate
      )})`
    );
    return transaction;
  }
  DEBUG_BUILD2 && logger2.log(`[Tracing] starting ${transaction.op} transaction - ${transaction.name}`);
  return transaction;
}
function isValidSampleRate(rate) {
  if (isNaN2(rate) || !(typeof rate === "number" || typeof rate === "boolean")) {
    DEBUG_BUILD2 && logger2.warn(
      `[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(
        rate
      )} of type ${JSON.stringify(typeof rate)}.`
    );
    return false;
  }
  if (rate < 0 || rate > 1) {
    DEBUG_BUILD2 && logger2.warn(`[Tracing] Given sample rate is invalid. Sample rate must be between 0 and 1. Got ${rate}.`);
    return false;
  }
  return true;
}
var init_sampling = __esm({
  "../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/tracing/sampling.js"() {
    init_import_meta_url();
    init_esm7();
    init_debug_build2();
    init_hasTracingEnabled();
    __name(sampleTransaction, "sampleTransaction");
    __name(isValidSampleRate, "isValidSampleRate");
  }
});

// ../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/tracing/hubextensions.js
function traceHeaders() {
  const scope = this.getScope();
  const span = scope.getSpan();
  return span ? {
    "sentry-trace": span.toTraceparent()
  } : {};
}
function _startTransaction(transactionContext, customSamplingContext) {
  const client = this.getClient();
  const options = client && client.getOptions() || {};
  const configInstrumenter = options.instrumenter || "sentry";
  const transactionInstrumenter = transactionContext.instrumenter || "sentry";
  if (configInstrumenter !== transactionInstrumenter) {
    DEBUG_BUILD2 && logger2.error(
      `A transaction was started with instrumenter=\`${transactionInstrumenter}\`, but the SDK is configured with the \`${configInstrumenter}\` instrumenter.
The transaction will not be sampled. Please use the ${configInstrumenter} instrumentation to start transactions.`
    );
    transactionContext.sampled = false;
  }
  let transaction = new Transaction(transactionContext, this);
  transaction = sampleTransaction(transaction, options, {
    parentSampled: transactionContext.parentSampled,
    transactionContext,
    ...customSamplingContext
  });
  if (transaction.sampled) {
    transaction.initSpanRecorder(options._experiments && options._experiments.maxSpans);
  }
  if (client && client.emit) {
    client.emit("startTransaction", transaction);
  }
  return transaction;
}
function addTracingExtensions() {
  const carrier = getMainCarrier();
  if (!carrier.__SENTRY__) {
    return;
  }
  carrier.__SENTRY__.extensions = carrier.__SENTRY__.extensions || {};
  if (!carrier.__SENTRY__.extensions.startTransaction) {
    carrier.__SENTRY__.extensions.startTransaction = _startTransaction;
  }
  if (!carrier.__SENTRY__.extensions.traceHeaders) {
    carrier.__SENTRY__.extensions.traceHeaders = traceHeaders;
  }
  registerErrorInstrumentation();
}
var init_hubextensions = __esm({
  "../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/tracing/hubextensions.js"() {
    init_import_meta_url();
    init_esm7();
    init_debug_build2();
    init_hub();
    init_errors5();
    init_sampling();
    init_transaction();
    __name(traceHeaders, "traceHeaders");
    __name(_startTransaction, "_startTransaction");
    __name(addTracingExtensions, "addTracingExtensions");
  }
});

// ../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/tracing/trace.js
function trace(context2, callback, onError = () => {
}) {
  const ctx = normalizeContext(context2);
  const hub = getCurrentHub();
  const scope = hub.getScope();
  const parentSpan = scope.getSpan();
  const activeSpan = createChildSpanOrTransaction(hub, parentSpan, ctx);
  scope.setSpan(activeSpan);
  function finishAndSetSpan() {
    activeSpan && activeSpan.finish();
    hub.getScope().setSpan(parentSpan);
  }
  __name(finishAndSetSpan, "finishAndSetSpan");
  let maybePromiseResult;
  try {
    maybePromiseResult = callback(activeSpan);
  } catch (e10) {
    activeSpan && activeSpan.setStatus("internal_error");
    onError(e10);
    finishAndSetSpan();
    throw e10;
  }
  if (isThenable(maybePromiseResult)) {
    Promise.resolve(maybePromiseResult).then(
      () => {
        finishAndSetSpan();
      },
      (e10) => {
        activeSpan && activeSpan.setStatus("internal_error");
        onError(e10);
        finishAndSetSpan();
      }
    );
  } else {
    finishAndSetSpan();
  }
  return maybePromiseResult;
}
function createChildSpanOrTransaction(hub, parentSpan, ctx) {
  if (!hasTracingEnabled()) {
    return void 0;
  }
  return parentSpan ? parentSpan.startChild(ctx) : hub.startTransaction(ctx);
}
function normalizeContext(context2) {
  const ctx = { ...context2 };
  if (ctx.name !== void 0 && ctx.description === void 0) {
    ctx.description = ctx.name;
  }
  return ctx;
}
var init_trace2 = __esm({
  "../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/tracing/trace.js"() {
    init_import_meta_url();
    init_esm7();
    init_hub();
    init_hasTracingEnabled();
    __name(trace, "trace");
    __name(createChildSpanOrTransaction, "createChildSpanOrTransaction");
    __name(normalizeContext, "normalizeContext");
  }
});

// ../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/envelope.js
function enhanceEventWithSdkInfo(event, sdkInfo) {
  if (!sdkInfo) {
    return event;
  }
  event.sdk = event.sdk || {};
  event.sdk.name = event.sdk.name || sdkInfo.name;
  event.sdk.version = event.sdk.version || sdkInfo.version;
  event.sdk.integrations = [...event.sdk.integrations || [], ...sdkInfo.integrations || []];
  event.sdk.packages = [...event.sdk.packages || [], ...sdkInfo.packages || []];
  return event;
}
function createSessionEnvelope(session, dsn, metadata, tunnel) {
  const sdkInfo = getSdkMetadataForEnvelopeHeader(metadata);
  const envelopeHeaders = {
    sent_at: (/* @__PURE__ */ new Date()).toISOString(),
    ...sdkInfo && { sdk: sdkInfo },
    ...!!tunnel && dsn && { dsn: dsnToString(dsn) }
  };
  const envelopeItem = "aggregates" in session ? [{ type: "sessions" }, session] : [{ type: "session" }, session.toJSON()];
  return createEnvelope(envelopeHeaders, [envelopeItem]);
}
function createEventEnvelope(event, dsn, metadata, tunnel) {
  const sdkInfo = getSdkMetadataForEnvelopeHeader(metadata);
  const eventType = event.type && event.type !== "replay_event" ? event.type : "event";
  enhanceEventWithSdkInfo(event, metadata && metadata.sdk);
  const envelopeHeaders = createEventEnvelopeHeaders(event, sdkInfo, tunnel, dsn);
  delete event.sdkProcessingMetadata;
  const eventItem = [{ type: eventType }, event];
  return createEnvelope(envelopeHeaders, [eventItem]);
}
var init_envelope2 = __esm({
  "../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/envelope.js"() {
    init_import_meta_url();
    init_esm7();
    __name(enhanceEventWithSdkInfo, "enhanceEventWithSdkInfo");
    __name(createSessionEnvelope, "createSessionEnvelope");
    __name(createEventEnvelope, "createEventEnvelope");
  }
});

// ../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/sessionflusher.js
var SessionFlusher;
var init_sessionflusher = __esm({
  "../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/sessionflusher.js"() {
    init_import_meta_url();
    init_esm7();
    init_hub();
    SessionFlusher = class {
      static {
        __name(this, "SessionFlusher");
      }
      constructor(client, attrs) {
        this._client = client;
        this.flushTimeout = 60;
        this._pendingAggregates = {};
        this._isEnabled = true;
        this._intervalId = setInterval(() => this.flush(), this.flushTimeout * 1e3);
        this._sessionAttrs = attrs;
      }
      /** Checks if `pendingAggregates` has entries, and if it does flushes them by calling `sendSession` */
      flush() {
        const sessionAggregates = this.getSessionAggregates();
        if (sessionAggregates.aggregates.length === 0) {
          return;
        }
        this._pendingAggregates = {};
        this._client.sendSession(sessionAggregates);
      }
      /** Massages the entries in `pendingAggregates` and returns aggregated sessions */
      getSessionAggregates() {
        const aggregates = Object.keys(this._pendingAggregates).map((key) => {
          return this._pendingAggregates[parseInt(key)];
        });
        const sessionAggregates = {
          attrs: this._sessionAttrs,
          aggregates
        };
        return dropUndefinedKeys(sessionAggregates);
      }
      /** JSDoc */
      close() {
        clearInterval(this._intervalId);
        this._isEnabled = false;
        this.flush();
      }
      /**
       * Wrapper function for _incrementSessionStatusCount that checks if the instance of SessionFlusher is enabled then
       * fetches the session status of the request from `Scope.getRequestSession().status` on the scope and passes them to
       * `_incrementSessionStatusCount` along with the start date
       */
      incrementSessionStatusCount() {
        if (!this._isEnabled) {
          return;
        }
        const scope = getCurrentHub().getScope();
        const requestSession = scope.getRequestSession();
        if (requestSession && requestSession.status) {
          this._incrementSessionStatusCount(requestSession.status, /* @__PURE__ */ new Date());
          scope.setRequestSession(void 0);
        }
      }
      /**
       * Increments status bucket in pendingAggregates buffer (internal state) corresponding to status of
       * the session received
       */
      _incrementSessionStatusCount(status2, date) {
        const sessionStartedTrunc = new Date(date).setSeconds(0, 0);
        this._pendingAggregates[sessionStartedTrunc] = this._pendingAggregates[sessionStartedTrunc] || {};
        const aggregationCounts = this._pendingAggregates[sessionStartedTrunc];
        if (!aggregationCounts.started) {
          aggregationCounts.started = new Date(sessionStartedTrunc).toISOString();
        }
        switch (status2) {
          case "errored":
            aggregationCounts.errored = (aggregationCounts.errored || 0) + 1;
            return aggregationCounts.errored;
          case "ok":
            aggregationCounts.exited = (aggregationCounts.exited || 0) + 1;
            return aggregationCounts.exited;
          default:
            aggregationCounts.crashed = (aggregationCounts.crashed || 0) + 1;
            return aggregationCounts.crashed;
        }
      }
    };
  }
});

// ../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/api.js
function getBaseApiEndpoint(dsn) {
  const protocol = dsn.protocol ? `${dsn.protocol}:` : "";
  const port = dsn.port ? `:${dsn.port}` : "";
  return `${protocol}//${dsn.host}${port}${dsn.path ? `/${dsn.path}` : ""}/api/`;
}
function _getIngestEndpoint(dsn) {
  return `${getBaseApiEndpoint(dsn)}${dsn.projectId}/envelope/`;
}
function _encodedAuth(dsn, sdkInfo) {
  return urlEncode({
    // We send only the minimum set of required information. See
    // https://github.com/getsentry/sentry-javascript/issues/2572.
    sentry_key: dsn.publicKey,
    sentry_version: SENTRY_API_VERSION,
    ...sdkInfo && { sentry_client: `${sdkInfo.name}/${sdkInfo.version}` }
  });
}
function getEnvelopeEndpointWithUrlEncodedAuth(dsn, tunnelOrOptions = {}) {
  const tunnel = typeof tunnelOrOptions === "string" ? tunnelOrOptions : tunnelOrOptions.tunnel;
  const sdkInfo = typeof tunnelOrOptions === "string" || !tunnelOrOptions._metadata ? void 0 : tunnelOrOptions._metadata.sdk;
  return tunnel ? tunnel : `${_getIngestEndpoint(dsn)}?${_encodedAuth(dsn, sdkInfo)}`;
}
var SENTRY_API_VERSION;
var init_api2 = __esm({
  "../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/api.js"() {
    init_import_meta_url();
    init_esm7();
    SENTRY_API_VERSION = "7";
    __name(getBaseApiEndpoint, "getBaseApiEndpoint");
    __name(_getIngestEndpoint, "_getIngestEndpoint");
    __name(_encodedAuth, "_encodedAuth");
    __name(getEnvelopeEndpointWithUrlEncodedAuth, "getEnvelopeEndpointWithUrlEncodedAuth");
  }
});

// ../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/integration.js
function filterDuplicates(integrations) {
  const integrationsByName = {};
  integrations.forEach((currentInstance) => {
    const { name: name2 } = currentInstance;
    const existingInstance = integrationsByName[name2];
    if (existingInstance && !existingInstance.isDefaultInstance && currentInstance.isDefaultInstance) {
      return;
    }
    integrationsByName[name2] = currentInstance;
  });
  return Object.keys(integrationsByName).map((k7) => integrationsByName[k7]);
}
function getIntegrationsToSetup(options) {
  const defaultIntegrations2 = options.defaultIntegrations || [];
  const userIntegrations = options.integrations;
  defaultIntegrations2.forEach((integration) => {
    integration.isDefaultInstance = true;
  });
  let integrations;
  if (Array.isArray(userIntegrations)) {
    integrations = [...defaultIntegrations2, ...userIntegrations];
  } else if (typeof userIntegrations === "function") {
    integrations = arrayify(userIntegrations(defaultIntegrations2));
  } else {
    integrations = defaultIntegrations2;
  }
  const finalIntegrations = filterDuplicates(integrations);
  const debugIndex = findIndex(finalIntegrations, (integration) => integration.name === "Debug");
  if (debugIndex !== -1) {
    const [debugInstance] = finalIntegrations.splice(debugIndex, 1);
    finalIntegrations.push(debugInstance);
  }
  return finalIntegrations;
}
function setupIntegrations(client, integrations) {
  const integrationIndex = {};
  integrations.forEach((integration) => {
    if (integration) {
      setupIntegration(client, integration, integrationIndex);
    }
  });
  return integrationIndex;
}
function setupIntegration(client, integration, integrationIndex) {
  integrationIndex[integration.name] = integration;
  if (installedIntegrations.indexOf(integration.name) === -1) {
    integration.setupOnce(addGlobalEventProcessor, getCurrentHub);
    installedIntegrations.push(integration.name);
  }
  if (integration.setup && typeof integration.setup === "function") {
    integration.setup(client);
  }
  if (client.on && typeof integration.preprocessEvent === "function") {
    const callback = integration.preprocessEvent.bind(integration);
    client.on("preprocessEvent", (event, hint) => callback(event, hint, client));
  }
  if (client.addEventProcessor && typeof integration.processEvent === "function") {
    const callback = integration.processEvent.bind(integration);
    const processor = Object.assign((event, hint) => callback(event, hint, client), {
      id: integration.name
    });
    client.addEventProcessor(processor);
  }
  DEBUG_BUILD2 && logger2.log(`Integration installed: ${integration.name}`);
}
function findIndex(arr, callback) {
  for (let i7 = 0; i7 < arr.length; i7++) {
    if (callback(arr[i7]) === true) {
      return i7;
    }
  }
  return -1;
}
var installedIntegrations;
var init_integration2 = __esm({
  "../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/integration.js"() {
    init_import_meta_url();
    init_esm7();
    init_debug_build2();
    init_eventProcessors();
    init_hub();
    installedIntegrations = [];
    __name(filterDuplicates, "filterDuplicates");
    __name(getIntegrationsToSetup, "getIntegrationsToSetup");
    __name(setupIntegrations, "setupIntegrations");
    __name(setupIntegration, "setupIntegration");
    __name(findIndex, "findIndex");
  }
});

// ../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/baseclient.js
function _validateBeforeSendResult(beforeSendResult, beforeSendLabel) {
  const invalidValueError = `${beforeSendLabel} must return \`null\` or a valid event.`;
  if (isThenable(beforeSendResult)) {
    return beforeSendResult.then(
      (event) => {
        if (!isPlainObject3(event) && event !== null) {
          throw new SentryError(invalidValueError);
        }
        return event;
      },
      (e10) => {
        throw new SentryError(`${beforeSendLabel} rejected with ${e10}`);
      }
    );
  } else if (!isPlainObject3(beforeSendResult) && beforeSendResult !== null) {
    throw new SentryError(invalidValueError);
  }
  return beforeSendResult;
}
function processBeforeSend(options, event, hint) {
  const { beforeSend, beforeSendTransaction } = options;
  if (isErrorEvent2(event) && beforeSend) {
    return beforeSend(event, hint);
  }
  if (isTransactionEvent(event) && beforeSendTransaction) {
    return beforeSendTransaction(event, hint);
  }
  return event;
}
function isErrorEvent2(event) {
  return event.type === void 0;
}
function isTransactionEvent(event) {
  return event.type === "transaction";
}
var ALREADY_SEEN_ERROR, BaseClient;
var init_baseclient = __esm({
  "../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/baseclient.js"() {
    init_import_meta_url();
    init_esm7();
    init_api2();
    init_debug_build2();
    init_envelope2();
    init_integration2();
    init_session();
    init_dynamicSamplingContext();
    init_prepareEvent();
    ALREADY_SEEN_ERROR = "Not capturing exception because it's already been captured.";
    BaseClient = class {
      static {
        __name(this, "BaseClient");
      }
      /** Options passed to the SDK. */
      /** The client Dsn, if specified in options. Without this Dsn, the SDK will be disabled. */
      /** Array of set up integrations. */
      /** Indicates whether this client's integrations have been set up. */
      /** Number of calls being processed */
      /** Holds flushable  */
      // eslint-disable-next-line @typescript-eslint/ban-types
      /**
       * Initializes this client instance.
       *
       * @param options Options for the client.
       */
      constructor(options) {
        this._options = options;
        this._integrations = {};
        this._integrationsInitialized = false;
        this._numProcessing = 0;
        this._outcomes = {};
        this._hooks = {};
        this._eventProcessors = [];
        if (options.dsn) {
          this._dsn = makeDsn(options.dsn);
        } else {
          DEBUG_BUILD2 && logger2.warn("No DSN provided, client will not send events.");
        }
        if (this._dsn) {
          const url4 = getEnvelopeEndpointWithUrlEncodedAuth(this._dsn, options);
          this._transport = options.transport({
            recordDroppedEvent: this.recordDroppedEvent.bind(this),
            ...options.transportOptions,
            url: url4
          });
        }
      }
      /**
       * @inheritDoc
       */
      // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
      captureException(exception, hint, scope) {
        if (checkOrSetAlreadyCaught(exception)) {
          DEBUG_BUILD2 && logger2.log(ALREADY_SEEN_ERROR);
          return;
        }
        let eventId = hint && hint.event_id;
        this._process(
          this.eventFromException(exception, hint).then((event) => this._captureEvent(event, hint, scope)).then((result) => {
            eventId = result;
          })
        );
        return eventId;
      }
      /**
       * @inheritDoc
       */
      captureMessage(message, level, hint, scope) {
        let eventId = hint && hint.event_id;
        const promisedEvent = isPrimitive(message) ? this.eventFromMessage(String(message), level, hint) : this.eventFromException(message, hint);
        this._process(
          promisedEvent.then((event) => this._captureEvent(event, hint, scope)).then((result) => {
            eventId = result;
          })
        );
        return eventId;
      }
      /**
       * @inheritDoc
       */
      captureEvent(event, hint, scope) {
        if (hint && hint.originalException && checkOrSetAlreadyCaught(hint.originalException)) {
          DEBUG_BUILD2 && logger2.log(ALREADY_SEEN_ERROR);
          return;
        }
        let eventId = hint && hint.event_id;
        this._process(
          this._captureEvent(event, hint, scope).then((result) => {
            eventId = result;
          })
        );
        return eventId;
      }
      /**
       * @inheritDoc
       */
      captureSession(session) {
        if (!(typeof session.release === "string")) {
          DEBUG_BUILD2 && logger2.warn("Discarded session because of missing or non-string release");
        } else {
          this.sendSession(session);
          updateSession(session, { init: false });
        }
      }
      /**
       * @inheritDoc
       */
      getDsn() {
        return this._dsn;
      }
      /**
       * @inheritDoc
       */
      getOptions() {
        return this._options;
      }
      /**
       * @see SdkMetadata in @sentry/types
       *
       * @return The metadata of the SDK
       */
      getSdkMetadata() {
        return this._options._metadata;
      }
      /**
       * @inheritDoc
       */
      getTransport() {
        return this._transport;
      }
      /**
       * @inheritDoc
       */
      flush(timeout2) {
        const transport = this._transport;
        if (transport) {
          return this._isClientDoneProcessing(timeout2).then((clientFinished) => {
            return transport.flush(timeout2).then((transportFlushed) => clientFinished && transportFlushed);
          });
        } else {
          return resolvedSyncPromise(true);
        }
      }
      /**
       * @inheritDoc
       */
      close(timeout2) {
        return this.flush(timeout2).then((result) => {
          this.getOptions().enabled = false;
          return result;
        });
      }
      /** Get all installed event processors. */
      getEventProcessors() {
        return this._eventProcessors;
      }
      /** @inheritDoc */
      addEventProcessor(eventProcessor) {
        this._eventProcessors.push(eventProcessor);
      }
      /**
       * Sets up the integrations
       */
      setupIntegrations(forceInitialize) {
        if (forceInitialize && !this._integrationsInitialized || this._isEnabled() && !this._integrationsInitialized) {
          this._integrations = setupIntegrations(this, this._options.integrations);
          this._integrationsInitialized = true;
        }
      }
      /**
       * Gets an installed integration by its `id`.
       *
       * @returns The installed integration or `undefined` if no integration with that `id` was installed.
       */
      getIntegrationById(integrationId) {
        return this._integrations[integrationId];
      }
      /**
       * @inheritDoc
       */
      getIntegration(integration) {
        try {
          return this._integrations[integration.id] || null;
        } catch (_oO) {
          DEBUG_BUILD2 && logger2.warn(`Cannot retrieve integration ${integration.id} from the current Client`);
          return null;
        }
      }
      /**
       * @inheritDoc
       */
      addIntegration(integration) {
        setupIntegration(this, integration, this._integrations);
      }
      /**
       * @inheritDoc
       */
      sendEvent(event, hint = {}) {
        this.emit("beforeSendEvent", event, hint);
        let env6 = createEventEnvelope(event, this._dsn, this._options._metadata, this._options.tunnel);
        for (const attachment of hint.attachments || []) {
          env6 = addItemToEnvelope(
            env6,
            createAttachmentEnvelopeItem(
              attachment,
              this._options.transportOptions && this._options.transportOptions.textEncoder
            )
          );
        }
        const promise = this._sendEnvelope(env6);
        if (promise) {
          promise.then((sendResponse) => this.emit("afterSendEvent", event, sendResponse), null);
        }
      }
      /**
       * @inheritDoc
       */
      sendSession(session) {
        const env6 = createSessionEnvelope(session, this._dsn, this._options._metadata, this._options.tunnel);
        void this._sendEnvelope(env6);
      }
      /**
       * @inheritDoc
       */
      recordDroppedEvent(reason, category, _event) {
        if (this._options.sendClientReports) {
          const key = `${reason}:${category}`;
          DEBUG_BUILD2 && logger2.log(`Adding outcome: "${key}"`);
          this._outcomes[key] = this._outcomes[key] + 1 || 1;
        }
      }
      // Keep on() & emit() signatures in sync with types' client.ts interface
      /* eslint-disable @typescript-eslint/unified-signatures */
      /** @inheritdoc */
      /** @inheritdoc */
      on(hook, callback) {
        if (!this._hooks[hook]) {
          this._hooks[hook] = [];
        }
        this._hooks[hook].push(callback);
      }
      /** @inheritdoc */
      /** @inheritdoc */
      emit(hook, ...rest) {
        if (this._hooks[hook]) {
          this._hooks[hook].forEach((callback) => callback(...rest));
        }
      }
      /* eslint-enable @typescript-eslint/unified-signatures */
      /** Updates existing session based on the provided event */
      _updateSessionFromEvent(session, event) {
        let crashed = false;
        let errored = false;
        const exceptions = event.exception && event.exception.values;
        if (exceptions) {
          errored = true;
          for (const ex of exceptions) {
            const mechanism = ex.mechanism;
            if (mechanism && mechanism.handled === false) {
              crashed = true;
              break;
            }
          }
        }
        const sessionNonTerminal = session.status === "ok";
        const shouldUpdateAndSend = sessionNonTerminal && session.errors === 0 || sessionNonTerminal && crashed;
        if (shouldUpdateAndSend) {
          updateSession(session, {
            ...crashed && { status: "crashed" },
            errors: session.errors || Number(errored || crashed)
          });
          this.captureSession(session);
        }
      }
      /**
       * Determine if the client is finished processing. Returns a promise because it will wait `timeout` ms before saying
       * "no" (resolving to `false`) in order to give the client a chance to potentially finish first.
       *
       * @param timeout The time, in ms, after which to resolve to `false` if the client is still busy. Passing `0` (or not
       * passing anything) will make the promise wait as long as it takes for processing to finish before resolving to
       * `true`.
       * @returns A promise which will resolve to `true` if processing is already done or finishes before the timeout, and
       * `false` otherwise
       */
      _isClientDoneProcessing(timeout2) {
        return new SyncPromise((resolve32) => {
          let ticked = 0;
          const tick = 1;
          const interval = setInterval(() => {
            if (this._numProcessing == 0) {
              clearInterval(interval);
              resolve32(true);
            } else {
              ticked += tick;
              if (timeout2 && ticked >= timeout2) {
                clearInterval(interval);
                resolve32(false);
              }
            }
          }, tick);
        });
      }
      /** Determines whether this SDK is enabled and a transport is present. */
      _isEnabled() {
        return this.getOptions().enabled !== false && this._transport !== void 0;
      }
      /**
       * Adds common information to events.
       *
       * The information includes release and environment from `options`,
       * breadcrumbs and context (extra, tags and user) from the scope.
       *
       * Information that is already present in the event is never overwritten. For
       * nested objects, such as the context, keys are merged.
       *
       * @param event The original event.
       * @param hint May contain additional information about the original exception.
       * @param scope A scope containing event metadata.
       * @returns A new event with more information.
       */
      _prepareEvent(event, hint, scope) {
        const options = this.getOptions();
        const integrations = Object.keys(this._integrations);
        if (!hint.integrations && integrations.length > 0) {
          hint.integrations = integrations;
        }
        this.emit("preprocessEvent", event, hint);
        return prepareEvent(options, event, hint, scope, this).then((evt) => {
          if (evt === null) {
            return evt;
          }
          const { propagationContext } = evt.sdkProcessingMetadata || {};
          const trace2 = evt.contexts && evt.contexts.trace;
          if (!trace2 && propagationContext) {
            const { traceId: trace_id, spanId, parentSpanId, dsc } = propagationContext;
            evt.contexts = {
              trace: {
                trace_id,
                span_id: spanId,
                parent_span_id: parentSpanId
              },
              ...evt.contexts
            };
            const dynamicSamplingContext = dsc ? dsc : getDynamicSamplingContextFromClient(trace_id, this, scope);
            evt.sdkProcessingMetadata = {
              dynamicSamplingContext,
              ...evt.sdkProcessingMetadata
            };
          }
          return evt;
        });
      }
      /**
       * Processes the event and logs an error in case of rejection
       * @param event
       * @param hint
       * @param scope
       */
      _captureEvent(event, hint = {}, scope) {
        return this._processEvent(event, hint, scope).then(
          (finalEvent) => {
            return finalEvent.event_id;
          },
          (reason) => {
            if (DEBUG_BUILD2) {
              const sentryError = reason;
              if (sentryError.logLevel === "log") {
                logger2.log(sentryError.message);
              } else {
                logger2.warn(sentryError);
              }
            }
            return void 0;
          }
        );
      }
      /**
       * Processes an event (either error or message) and sends it to Sentry.
       *
       * This also adds breadcrumbs and context information to the event. However,
       * platform specific meta data (such as the User's IP address) must be added
       * by the SDK implementor.
       *
       *
       * @param event The event to send to Sentry.
       * @param hint May contain additional information about the original exception.
       * @param scope A scope containing event metadata.
       * @returns A SyncPromise that resolves with the event or rejects in case event was/will not be send.
       */
      _processEvent(event, hint, scope) {
        const options = this.getOptions();
        const { sampleRate } = options;
        const isTransaction = isTransactionEvent(event);
        const isError2 = isErrorEvent2(event);
        const eventType = event.type || "error";
        const beforeSendLabel = `before send for type \`${eventType}\``;
        if (isError2 && typeof sampleRate === "number" && Math.random() > sampleRate) {
          this.recordDroppedEvent("sample_rate", "error", event);
          return rejectedSyncPromise(
            new SentryError(
              `Discarding event because it's not included in the random sample (sampling rate = ${sampleRate})`,
              "log"
            )
          );
        }
        const dataCategory = eventType === "replay_event" ? "replay" : eventType;
        return this._prepareEvent(event, hint, scope).then((prepared) => {
          if (prepared === null) {
            this.recordDroppedEvent("event_processor", dataCategory, event);
            throw new SentryError("An event processor returned `null`, will not send event.", "log");
          }
          const isInternalException = hint.data && hint.data.__sentry__ === true;
          if (isInternalException) {
            return prepared;
          }
          const result = processBeforeSend(options, prepared, hint);
          return _validateBeforeSendResult(result, beforeSendLabel);
        }).then((processedEvent) => {
          if (processedEvent === null) {
            this.recordDroppedEvent("before_send", dataCategory, event);
            throw new SentryError(`${beforeSendLabel} returned \`null\`, will not send event.`, "log");
          }
          const session = scope && scope.getSession();
          if (!isTransaction && session) {
            this._updateSessionFromEvent(session, processedEvent);
          }
          const transactionInfo = processedEvent.transaction_info;
          if (isTransaction && transactionInfo && processedEvent.transaction !== event.transaction) {
            const source = "custom";
            processedEvent.transaction_info = {
              ...transactionInfo,
              source
            };
          }
          this.sendEvent(processedEvent, hint);
          return processedEvent;
        }).then(null, (reason) => {
          if (reason instanceof SentryError) {
            throw reason;
          }
          this.captureException(reason, {
            data: {
              __sentry__: true
            },
            originalException: reason
          });
          throw new SentryError(
            `Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
Reason: ${reason}`
          );
        });
      }
      /**
       * Occupies the client with processing and event
       */
      _process(promise) {
        this._numProcessing++;
        void promise.then(
          (value) => {
            this._numProcessing--;
            return value;
          },
          (reason) => {
            this._numProcessing--;
            return reason;
          }
        );
      }
      /**
       * @inheritdoc
       */
      _sendEnvelope(envelope) {
        this.emit("beforeEnvelope", envelope);
        if (this._isEnabled() && this._transport) {
          return this._transport.send(envelope).then(null, (reason) => {
            DEBUG_BUILD2 && logger2.error("Error while sending event:", reason);
          });
        } else {
          DEBUG_BUILD2 && logger2.error("Transport disabled");
        }
      }
      /**
       * Clears outcomes on this client and returns them.
       */
      _clearOutcomes() {
        const outcomes = this._outcomes;
        this._outcomes = {};
        return Object.keys(outcomes).map((key) => {
          const [reason, category] = key.split(":");
          return {
            reason,
            category,
            quantity: outcomes[key]
          };
        });
      }
      /**
       * @inheritDoc
       */
      // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
    };
    __name(_validateBeforeSendResult, "_validateBeforeSendResult");
    __name(processBeforeSend, "processBeforeSend");
    __name(isErrorEvent2, "isErrorEvent");
    __name(isTransactionEvent, "isTransactionEvent");
  }
});

// ../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/checkin.js
function createCheckInEnvelope(checkIn, dynamicSamplingContext, metadata, tunnel, dsn) {
  const headers = {
    sent_at: (/* @__PURE__ */ new Date()).toISOString()
  };
  if (metadata && metadata.sdk) {
    headers.sdk = {
      name: metadata.sdk.name,
      version: metadata.sdk.version
    };
  }
  if (!!tunnel && !!dsn) {
    headers.dsn = dsnToString(dsn);
  }
  if (dynamicSamplingContext) {
    headers.trace = dropUndefinedKeys(dynamicSamplingContext);
  }
  const item = createCheckInEnvelopeItem(checkIn);
  return createEnvelope(headers, [item]);
}
function createCheckInEnvelopeItem(checkIn) {
  const checkInHeaders = {
    type: "check_in"
  };
  return [checkInHeaders, checkIn];
}
var init_checkin = __esm({
  "../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/checkin.js"() {
    init_import_meta_url();
    init_esm7();
    __name(createCheckInEnvelope, "createCheckInEnvelope");
    __name(createCheckInEnvelopeItem, "createCheckInEnvelopeItem");
  }
});

// ../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/server-runtime-client.js
var ServerRuntimeClient;
var init_server_runtime_client = __esm({
  "../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/server-runtime-client.js"() {
    init_import_meta_url();
    init_esm7();
    init_baseclient();
    init_checkin();
    init_debug_build2();
    init_hub();
    init_sessionflusher();
    init_hubextensions();
    init_dynamicSamplingContext();
    ServerRuntimeClient = class extends BaseClient {
      static {
        __name(this, "ServerRuntimeClient");
      }
      /**
       * Creates a new Edge SDK instance.
       * @param options Configuration options for this SDK.
       */
      constructor(options) {
        addTracingExtensions();
        super(options);
      }
      /**
       * @inheritDoc
       */
      eventFromException(exception, hint) {
        return resolvedSyncPromise(eventFromUnknownInput(getCurrentHub, this._options.stackParser, exception, hint));
      }
      /**
       * @inheritDoc
       */
      eventFromMessage(message, level = "info", hint) {
        return resolvedSyncPromise(
          eventFromMessage(this._options.stackParser, message, level, hint, this._options.attachStacktrace)
        );
      }
      /**
       * @inheritDoc
       */
      // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
      captureException(exception, hint, scope) {
        if (this._options.autoSessionTracking && this._sessionFlusher && scope) {
          const requestSession = scope.getRequestSession();
          if (requestSession && requestSession.status === "ok") {
            requestSession.status = "errored";
          }
        }
        return super.captureException(exception, hint, scope);
      }
      /**
       * @inheritDoc
       */
      captureEvent(event, hint, scope) {
        if (this._options.autoSessionTracking && this._sessionFlusher && scope) {
          const eventType = event.type || "exception";
          const isException = eventType === "exception" && event.exception && event.exception.values && event.exception.values.length > 0;
          if (isException) {
            const requestSession = scope.getRequestSession();
            if (requestSession && requestSession.status === "ok") {
              requestSession.status = "errored";
            }
          }
        }
        return super.captureEvent(event, hint, scope);
      }
      /**
       *
       * @inheritdoc
       */
      close(timeout2) {
        if (this._sessionFlusher) {
          this._sessionFlusher.close();
        }
        return super.close(timeout2);
      }
      /** Method that initialises an instance of SessionFlusher on Client */
      initSessionFlusher() {
        const { release: release3, environment } = this._options;
        if (!release3) {
          DEBUG_BUILD2 && logger2.warn("Cannot initialise an instance of SessionFlusher if no release is provided!");
        } else {
          this._sessionFlusher = new SessionFlusher(this, {
            release: release3,
            environment
          });
        }
      }
      /**
       * Create a cron monitor check in and send it to Sentry.
       *
       * @param checkIn An object that describes a check in.
       * @param upsertMonitorConfig An optional object that describes a monitor config. Use this if you want
       * to create a monitor automatically when sending a check in.
       */
      captureCheckIn(checkIn, monitorConfig, scope) {
        const id = "checkInId" in checkIn && checkIn.checkInId ? checkIn.checkInId : uuid42();
        if (!this._isEnabled()) {
          DEBUG_BUILD2 && logger2.warn("SDK not enabled, will not capture checkin.");
          return id;
        }
        const options = this.getOptions();
        const { release: release3, environment, tunnel } = options;
        const serializedCheckIn = {
          check_in_id: id,
          monitor_slug: checkIn.monitorSlug,
          status: checkIn.status,
          release: release3,
          environment
        };
        if ("duration" in checkIn) {
          serializedCheckIn.duration = checkIn.duration;
        }
        if (monitorConfig) {
          serializedCheckIn.monitor_config = {
            schedule: monitorConfig.schedule,
            checkin_margin: monitorConfig.checkinMargin,
            max_runtime: monitorConfig.maxRuntime,
            timezone: monitorConfig.timezone
          };
        }
        const [dynamicSamplingContext, traceContext] = this._getTraceInfoFromScope(scope);
        if (traceContext) {
          serializedCheckIn.contexts = {
            trace: traceContext
          };
        }
        const envelope = createCheckInEnvelope(
          serializedCheckIn,
          dynamicSamplingContext,
          this.getSdkMetadata(),
          tunnel,
          this.getDsn()
        );
        DEBUG_BUILD2 && logger2.info("Sending checkin:", checkIn.monitorSlug, checkIn.status);
        void this._sendEnvelope(envelope);
        return id;
      }
      /**
       * Method responsible for capturing/ending a request session by calling `incrementSessionStatusCount` to increment
       * appropriate session aggregates bucket
       */
      _captureRequestSession() {
        if (!this._sessionFlusher) {
          DEBUG_BUILD2 && logger2.warn("Discarded request mode session because autoSessionTracking option was disabled");
        } else {
          this._sessionFlusher.incrementSessionStatusCount();
        }
      }
      /**
       * @inheritDoc
       */
      _prepareEvent(event, hint, scope) {
        if (this._options.platform) {
          event.platform = event.platform || this._options.platform;
        }
        if (this._options.runtime) {
          event.contexts = {
            ...event.contexts,
            runtime: (event.contexts || {}).runtime || this._options.runtime
          };
        }
        if (this._options.serverName) {
          event.server_name = event.server_name || this._options.serverName;
        }
        return super._prepareEvent(event, hint, scope);
      }
      /** Extract trace information from scope */
      _getTraceInfoFromScope(scope) {
        if (!scope) {
          return [void 0, void 0];
        }
        const span = scope.getSpan();
        if (span) {
          const samplingContext = span.transaction ? span.transaction.getDynamicSamplingContext() : void 0;
          return [samplingContext, span.getTraceContext()];
        }
        const { traceId, spanId, parentSpanId, dsc } = scope.getPropagationContext();
        const traceContext = {
          trace_id: traceId,
          span_id: spanId,
          parent_span_id: parentSpanId
        };
        if (dsc) {
          return [dsc, traceContext];
        }
        return [getDynamicSamplingContextFromClient(traceId, this, scope), traceContext];
      }
    };
  }
});

// ../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/sdk.js
function initAndBind(clientClass, options) {
  if (options.debug === true) {
    if (DEBUG_BUILD2) {
      logger2.enable();
    } else {
      consoleSandbox(() => {
        console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.");
      });
    }
  }
  const hub = getCurrentHub();
  const scope = hub.getScope();
  scope.update(options.initialScope);
  const client = new clientClass(options);
  hub.bindClient(client);
}
var init_sdk = __esm({
  "../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/sdk.js"() {
    init_import_meta_url();
    init_esm7();
    init_debug_build2();
    init_hub();
    __name(initAndBind, "initAndBind");
  }
});

// ../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/transports/base.js
function createTransport(options, makeRequest, buffer = makePromiseBuffer(
  options.bufferSize || DEFAULT_TRANSPORT_BUFFER_SIZE
)) {
  let rateLimits = {};
  const flush2 = /* @__PURE__ */ __name((timeout2) => buffer.drain(timeout2), "flush");
  function send(envelope) {
    const filteredEnvelopeItems = [];
    forEachEnvelopeItem(envelope, (item, type) => {
      const envelopeItemDataCategory = envelopeItemTypeToDataCategory(type);
      if (isRateLimited(rateLimits, envelopeItemDataCategory)) {
        const event = getEventForEnvelopeItem(item, type);
        options.recordDroppedEvent("ratelimit_backoff", envelopeItemDataCategory, event);
      } else {
        filteredEnvelopeItems.push(item);
      }
    });
    if (filteredEnvelopeItems.length === 0) {
      return resolvedSyncPromise();
    }
    const filteredEnvelope = createEnvelope(envelope[0], filteredEnvelopeItems);
    const recordEnvelopeLoss = /* @__PURE__ */ __name((reason) => {
      forEachEnvelopeItem(filteredEnvelope, (item, type) => {
        const event = getEventForEnvelopeItem(item, type);
        options.recordDroppedEvent(reason, envelopeItemTypeToDataCategory(type), event);
      });
    }, "recordEnvelopeLoss");
    const requestTask = /* @__PURE__ */ __name(() => makeRequest({ body: serializeEnvelope(filteredEnvelope, options.textEncoder) }).then(
      (response) => {
        if (response.statusCode !== void 0 && (response.statusCode < 200 || response.statusCode >= 300)) {
          DEBUG_BUILD2 && logger2.warn(`Sentry responded with status code ${response.statusCode} to sent event.`);
        }
        rateLimits = updateRateLimits(rateLimits, response);
        return response;
      },
      (error2) => {
        recordEnvelopeLoss("network_error");
        throw error2;
      }
    ), "requestTask");
    return buffer.add(requestTask).then(
      (result) => result,
      (error2) => {
        if (error2 instanceof SentryError) {
          DEBUG_BUILD2 && logger2.error("Skipped sending event because buffer is full.");
          recordEnvelopeLoss("queue_overflow");
          return resolvedSyncPromise();
        } else {
          throw error2;
        }
      }
    );
  }
  __name(send, "send");
  send.__sentry__baseTransport__ = true;
  return {
    send,
    flush: flush2
  };
}
function getEventForEnvelopeItem(item, type) {
  if (type !== "event" && type !== "transaction") {
    return void 0;
  }
  return Array.isArray(item) ? item[1] : void 0;
}
var DEFAULT_TRANSPORT_BUFFER_SIZE;
var init_base = __esm({
  "../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/transports/base.js"() {
    init_import_meta_url();
    init_esm7();
    init_debug_build2();
    DEFAULT_TRANSPORT_BUFFER_SIZE = 30;
    __name(createTransport, "createTransport");
    __name(getEventForEnvelopeItem, "getEventForEnvelopeItem");
  }
});

// ../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/integrations/functiontostring.js
var originalFunctionToString, FunctionToString;
var init_functiontostring = __esm({
  "../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/integrations/functiontostring.js"() {
    init_import_meta_url();
    init_esm7();
    FunctionToString = class _FunctionToString {
      static {
        __name(this, "FunctionToString");
      }
      /**
       * @inheritDoc
       */
      static __initStatic() {
        this.id = "FunctionToString";
      }
      /**
       * @inheritDoc
       */
      constructor() {
        this.name = _FunctionToString.id;
      }
      /**
       * @inheritDoc
       */
      setupOnce() {
        originalFunctionToString = Function.prototype.toString;
        try {
          Function.prototype.toString = function(...args) {
            const context2 = getOriginalFunction(this) || this;
            return originalFunctionToString.apply(context2, args);
          };
        } catch (e10) {
        }
      }
    };
    FunctionToString.__initStatic();
  }
});

// ../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/integrations/inboundfilters.js
function _mergeOptions(internalOptions = {}, clientOptions = {}) {
  return {
    allowUrls: [...internalOptions.allowUrls || [], ...clientOptions.allowUrls || []],
    denyUrls: [...internalOptions.denyUrls || [], ...clientOptions.denyUrls || []],
    ignoreErrors: [
      ...internalOptions.ignoreErrors || [],
      ...clientOptions.ignoreErrors || [],
      ...internalOptions.disableErrorDefaults ? [] : DEFAULT_IGNORE_ERRORS
    ],
    ignoreTransactions: [
      ...internalOptions.ignoreTransactions || [],
      ...clientOptions.ignoreTransactions || [],
      ...internalOptions.disableTransactionDefaults ? [] : DEFAULT_IGNORE_TRANSACTIONS
    ],
    ignoreInternal: internalOptions.ignoreInternal !== void 0 ? internalOptions.ignoreInternal : true
  };
}
function _shouldDropEvent(event, options) {
  if (options.ignoreInternal && _isSentryError(event)) {
    DEBUG_BUILD2 && logger2.warn(`Event dropped due to being internal Sentry Error.
Event: ${getEventDescription(event)}`);
    return true;
  }
  if (_isIgnoredError(event, options.ignoreErrors)) {
    DEBUG_BUILD2 && logger2.warn(
      `Event dropped due to being matched by \`ignoreErrors\` option.
Event: ${getEventDescription(event)}`
    );
    return true;
  }
  if (_isIgnoredTransaction(event, options.ignoreTransactions)) {
    DEBUG_BUILD2 && logger2.warn(
      `Event dropped due to being matched by \`ignoreTransactions\` option.
Event: ${getEventDescription(event)}`
    );
    return true;
  }
  if (_isDeniedUrl(event, options.denyUrls)) {
    DEBUG_BUILD2 && logger2.warn(
      `Event dropped due to being matched by \`denyUrls\` option.
Event: ${getEventDescription(
        event
      )}.
Url: ${_getEventFilterUrl(event)}`
    );
    return true;
  }
  if (!_isAllowedUrl(event, options.allowUrls)) {
    DEBUG_BUILD2 && logger2.warn(
      `Event dropped due to not being matched by \`allowUrls\` option.
Event: ${getEventDescription(
        event
      )}.
Url: ${_getEventFilterUrl(event)}`
    );
    return true;
  }
  return false;
}
function _isIgnoredError(event, ignoreErrors) {
  if (event.type || !ignoreErrors || !ignoreErrors.length) {
    return false;
  }
  return _getPossibleEventMessages(event).some((message) => stringMatchesSomePattern(message, ignoreErrors));
}
function _isIgnoredTransaction(event, ignoreTransactions) {
  if (event.type !== "transaction" || !ignoreTransactions || !ignoreTransactions.length) {
    return false;
  }
  const name2 = event.transaction;
  return name2 ? stringMatchesSomePattern(name2, ignoreTransactions) : false;
}
function _isDeniedUrl(event, denyUrls) {
  if (!denyUrls || !denyUrls.length) {
    return false;
  }
  const url4 = _getEventFilterUrl(event);
  return !url4 ? false : stringMatchesSomePattern(url4, denyUrls);
}
function _isAllowedUrl(event, allowUrls) {
  if (!allowUrls || !allowUrls.length) {
    return true;
  }
  const url4 = _getEventFilterUrl(event);
  return !url4 ? true : stringMatchesSomePattern(url4, allowUrls);
}
function _getPossibleEventMessages(event) {
  const possibleMessages = [];
  if (event.message) {
    possibleMessages.push(event.message);
  }
  let lastException;
  try {
    lastException = event.exception.values[event.exception.values.length - 1];
  } catch (e10) {
  }
  if (lastException) {
    if (lastException.value) {
      possibleMessages.push(lastException.value);
      if (lastException.type) {
        possibleMessages.push(`${lastException.type}: ${lastException.value}`);
      }
    }
  }
  if (DEBUG_BUILD2 && possibleMessages.length === 0) {
    logger2.error(`Could not extract message for event ${getEventDescription(event)}`);
  }
  return possibleMessages;
}
function _isSentryError(event) {
  try {
    return event.exception.values[0].type === "SentryError";
  } catch (e10) {
  }
  return false;
}
function _getLastValidUrl(frames = []) {
  for (let i7 = frames.length - 1; i7 >= 0; i7--) {
    const frame = frames[i7];
    if (frame && frame.filename !== "<anonymous>" && frame.filename !== "[native code]") {
      return frame.filename || null;
    }
  }
  return null;
}
function _getEventFilterUrl(event) {
  try {
    let frames;
    try {
      frames = event.exception.values[0].stacktrace.frames;
    } catch (e10) {
    }
    return frames ? _getLastValidUrl(frames) : null;
  } catch (oO) {
    DEBUG_BUILD2 && logger2.error(`Cannot extract url for event ${getEventDescription(event)}`);
    return null;
  }
}
var DEFAULT_IGNORE_ERRORS, DEFAULT_IGNORE_TRANSACTIONS, InboundFilters;
var init_inboundfilters = __esm({
  "../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/integrations/inboundfilters.js"() {
    init_import_meta_url();
    init_esm7();
    init_debug_build2();
    DEFAULT_IGNORE_ERRORS = [/^Script error\.?$/, /^Javascript error: Script error\.? on line 0$/];
    DEFAULT_IGNORE_TRANSACTIONS = [
      /^.*\/healthcheck$/,
      /^.*\/healthy$/,
      /^.*\/live$/,
      /^.*\/ready$/,
      /^.*\/heartbeat$/,
      /^.*\/health$/,
      /^.*\/healthz$/
    ];
    InboundFilters = class _InboundFilters {
      static {
        __name(this, "InboundFilters");
      }
      /**
       * @inheritDoc
       */
      static __initStatic() {
        this.id = "InboundFilters";
      }
      /**
       * @inheritDoc
       */
      constructor(options = {}) {
        this.name = _InboundFilters.id;
        this._options = options;
      }
      /**
       * @inheritDoc
       */
      setupOnce(_addGlobalEventProcessor, _getCurrentHub) {
      }
      /** @inheritDoc */
      processEvent(event, _eventHint, client) {
        const clientOptions = client.getOptions();
        const options = _mergeOptions(this._options, clientOptions);
        return _shouldDropEvent(event, options) ? null : event;
      }
    };
    InboundFilters.__initStatic();
    __name(_mergeOptions, "_mergeOptions");
    __name(_shouldDropEvent, "_shouldDropEvent");
    __name(_isIgnoredError, "_isIgnoredError");
    __name(_isIgnoredTransaction, "_isIgnoredTransaction");
    __name(_isDeniedUrl, "_isDeniedUrl");
    __name(_isAllowedUrl, "_isAllowedUrl");
    __name(_getPossibleEventMessages, "_getPossibleEventMessages");
    __name(_isSentryError, "_isSentryError");
    __name(_getLastValidUrl, "_getLastValidUrl");
    __name(_getEventFilterUrl, "_getEventFilterUrl");
  }
});

// ../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/integrations/linkederrors.js
var DEFAULT_KEY, DEFAULT_LIMIT, LinkedErrors;
var init_linkederrors = __esm({
  "../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/integrations/linkederrors.js"() {
    init_import_meta_url();
    init_esm7();
    DEFAULT_KEY = "cause";
    DEFAULT_LIMIT = 5;
    LinkedErrors = class _LinkedErrors {
      static {
        __name(this, "LinkedErrors");
      }
      /**
       * @inheritDoc
       */
      static __initStatic() {
        this.id = "LinkedErrors";
      }
      /**
       * @inheritDoc
       */
      /**
       * @inheritDoc
       */
      /**
       * @inheritDoc
       */
      /**
       * @inheritDoc
       */
      constructor(options = {}) {
        this._key = options.key || DEFAULT_KEY;
        this._limit = options.limit || DEFAULT_LIMIT;
        this.name = _LinkedErrors.id;
      }
      /** @inheritdoc */
      setupOnce() {
      }
      /**
       * @inheritDoc
       */
      preprocessEvent(event, hint, client) {
        const options = client.getOptions();
        applyAggregateErrorsToEvent(
          exceptionFromError,
          options.stackParser,
          options.maxValueLength,
          this._key,
          this._limit,
          event,
          hint
        );
      }
    };
    LinkedErrors.__initStatic();
  }
});

// ../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/integrations/index.js
var integrations_exports3 = {};
__export(integrations_exports3, {
  FunctionToString: () => FunctionToString,
  InboundFilters: () => InboundFilters,
  LinkedErrors: () => LinkedErrors
});
var init_integrations3 = __esm({
  "../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/integrations/index.js"() {
    init_import_meta_url();
    init_functiontostring();
    init_inboundfilters();
    init_linkederrors();
  }
});

// ../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/utils/isSentryRequestUrl.js
function isSentryRequestUrl(url4, hub) {
  const client = hub.getClient();
  const dsn = client && client.getDsn();
  const tunnel = client && client.getOptions().tunnel;
  return checkDsn(url4, dsn) || checkTunnel(url4, tunnel);
}
function checkTunnel(url4, tunnel) {
  if (!tunnel) {
    return false;
  }
  return removeTrailingSlash(url4) === removeTrailingSlash(tunnel);
}
function checkDsn(url4, dsn) {
  return dsn ? url4.includes(dsn.host) : false;
}
function removeTrailingSlash(str) {
  return str[str.length - 1] === "/" ? str.slice(0, -1) : str;
}
var init_isSentryRequestUrl = __esm({
  "../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/utils/isSentryRequestUrl.js"() {
    init_import_meta_url();
    __name(isSentryRequestUrl, "isSentryRequestUrl");
    __name(checkTunnel, "checkTunnel");
    __name(checkDsn, "checkDsn");
    __name(removeTrailingSlash, "removeTrailingSlash");
  }
});

// ../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/integrations/requestdata.js
function convertReqDataIntegrationOptsToAddReqDataOpts(integrationOptions) {
  const {
    transactionNamingScheme,
    include: { ip, user, ...requestOptions }
  } = integrationOptions;
  const requestIncludeKeys = [];
  for (const [key, value] of Object.entries(requestOptions)) {
    if (value) {
      requestIncludeKeys.push(key);
    }
  }
  let addReqDataUserOpt;
  if (user === void 0) {
    addReqDataUserOpt = true;
  } else if (typeof user === "boolean") {
    addReqDataUserOpt = user;
  } else {
    const userIncludeKeys = [];
    for (const [key, value] of Object.entries(user)) {
      if (value) {
        userIncludeKeys.push(key);
      }
    }
    addReqDataUserOpt = userIncludeKeys;
  }
  return {
    include: {
      ip,
      user: addReqDataUserOpt,
      request: requestIncludeKeys.length !== 0 ? requestIncludeKeys : void 0,
      transaction: transactionNamingScheme
    }
  };
}
function getSDKName(hub) {
  try {
    return hub.getClient().getOptions()._metadata.sdk.name;
  } catch (err) {
    return void 0;
  }
}
var DEFAULT_OPTIONS, RequestData;
var init_requestdata2 = __esm({
  "../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/integrations/requestdata.js"() {
    init_import_meta_url();
    init_esm7();
    DEFAULT_OPTIONS = {
      include: {
        cookies: true,
        data: true,
        headers: true,
        ip: false,
        query_string: true,
        url: true,
        user: {
          id: true,
          username: true,
          email: true
        }
      },
      transactionNamingScheme: "methodPath"
    };
    RequestData = class _RequestData {
      static {
        __name(this, "RequestData");
      }
      /**
       * @inheritDoc
       */
      static __initStatic() {
        this.id = "RequestData";
      }
      /**
       * @inheritDoc
       */
      /**
       * Function for adding request data to event. Defaults to `addRequestDataToEvent` from `@sentry/node` for now, but
       * left as a property so this integration can be moved to `@sentry/core` as a base class in case we decide to use
       * something similar in browser-based SDKs in the future.
       */
      /**
       * @inheritDoc
       */
      constructor(options = {}) {
        this.name = _RequestData.id;
        this._addRequestData = addRequestDataToEvent;
        this._options = {
          ...DEFAULT_OPTIONS,
          ...options,
          include: {
            // @ts-expect-error It's mad because `method` isn't a known `include` key. (It's only here and not set by default in
            // `addRequestDataToEvent` for legacy reasons. TODO (v8): Change that.)
            method: true,
            ...DEFAULT_OPTIONS.include,
            ...options.include,
            user: options.include && typeof options.include.user === "boolean" ? options.include.user : {
              ...DEFAULT_OPTIONS.include.user,
              // Unclear why TS still thinks `options.include.user` could be a boolean at this point
              ...(options.include || {}).user
            }
          }
        };
      }
      /**
       * @inheritDoc
       */
      setupOnce(addGlobalEventProcessor2, getCurrentHub3) {
        const { transactionNamingScheme } = this._options;
        addGlobalEventProcessor2((event) => {
          const hub = getCurrentHub3();
          const self2 = hub.getIntegration(_RequestData);
          const { sdkProcessingMetadata = {} } = event;
          const req = sdkProcessingMetadata.request;
          if (!self2 || !req) {
            return event;
          }
          const addRequestDataOptions = sdkProcessingMetadata.requestDataOptionsFromExpressHandler || sdkProcessingMetadata.requestDataOptionsFromGCPWrapper || convertReqDataIntegrationOptsToAddReqDataOpts(this._options);
          const processedEvent = this._addRequestData(event, req, addRequestDataOptions);
          if (event.type === "transaction" || transactionNamingScheme === "handler") {
            return processedEvent;
          }
          const reqWithTransaction = req;
          const transaction = reqWithTransaction._sentryTransaction;
          if (transaction) {
            const shouldIncludeMethodInTransactionName = getSDKName(hub) === "sentry.javascript.nextjs" ? transaction.name.startsWith("/api") : transactionNamingScheme !== "path";
            const [transactionValue] = extractPathForTransaction(req, {
              path: true,
              method: shouldIncludeMethodInTransactionName,
              customRoute: transaction.name
            });
            processedEvent.transaction = transactionValue;
          }
          return processedEvent;
        });
      }
    };
    RequestData.__initStatic();
    __name(convertReqDataIntegrationOptsToAddReqDataOpts, "convertReqDataIntegrationOptsToAddReqDataOpts");
    __name(getSDKName, "getSDKName");
  }
});

// ../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/index.js
var init_esm8 = __esm({
  "../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/index.js"() {
    init_import_meta_url();
    init_trace2();
    init_dynamicSamplingContext();
    init_exports();
    init_hub();
    init_server_runtime_client();
    init_sdk();
    init_base();
    init_version2();
    init_integration2();
    init_integrations3();
    init_isSentryRequestUrl();
    init_requestdata2();
  }
});

// ../../node_modules/.pnpm/@sentry-internal+tracing@7.87.0/node_modules/@sentry-internal/tracing/esm/common/debug-build.js
var DEBUG_BUILD3;
var init_debug_build3 = __esm({
  "../../node_modules/.pnpm/@sentry-internal+tracing@7.87.0/node_modules/@sentry-internal/tracing/esm/common/debug-build.js"() {
    init_import_meta_url();
    DEBUG_BUILD3 = typeof __SENTRY_DEBUG__ === "undefined" || __SENTRY_DEBUG__;
  }
});

// ../../node_modules/.pnpm/@sentry-internal+tracing@7.87.0/node_modules/@sentry-internal/tracing/esm/node/integrations/utils/node-utils.js
function shouldDisableAutoInstrumentation(getCurrentHub3) {
  const clientOptions = _optionalChain([getCurrentHub3, "call", (_5) => _5(), "access", (_22) => _22.getClient, "call", (_32) => _32(), "optionalAccess", (_42) => _42.getOptions, "call", (_5) => _5()]);
  const instrumenter = _optionalChain([clientOptions, "optionalAccess", (_6) => _6.instrumenter]) || "sentry";
  return instrumenter !== "sentry";
}
var init_node_utils = __esm({
  "../../node_modules/.pnpm/@sentry-internal+tracing@7.87.0/node_modules/@sentry-internal/tracing/esm/node/integrations/utils/node-utils.js"() {
    init_import_meta_url();
    init_esm7();
    __name(shouldDisableAutoInstrumentation, "shouldDisableAutoInstrumentation");
  }
});

// ../../node_modules/.pnpm/@sentry-internal+tracing@7.87.0/node_modules/@sentry-internal/tracing/esm/node/integrations/express.js
function wrap3(fn2, method) {
  const arity = fn2.length;
  switch (arity) {
    case 2: {
      return function(req, res) {
        const transaction = res.__sentry_transaction;
        if (transaction) {
          const span = transaction.startChild({
            description: fn2.name,
            op: `middleware.express.${method}`,
            origin: "auto.middleware.express"
          });
          res.once("finish", () => {
            span.finish();
          });
        }
        return fn2.call(this, req, res);
      };
    }
    case 3: {
      return function(req, res, next) {
        const transaction = res.__sentry_transaction;
        const span = _optionalChain([transaction, "optionalAccess", (_22) => _22.startChild, "call", (_32) => _32({
          description: fn2.name,
          op: `middleware.express.${method}`,
          origin: "auto.middleware.express"
        })]);
        fn2.call(this, req, res, function(...args) {
          _optionalChain([span, "optionalAccess", (_42) => _42.finish, "call", (_5) => _5()]);
          next.call(this, ...args);
        });
      };
    }
    case 4: {
      return function(err, req, res, next) {
        const transaction = res.__sentry_transaction;
        const span = _optionalChain([transaction, "optionalAccess", (_6) => _6.startChild, "call", (_7) => _7({
          description: fn2.name,
          op: `middleware.express.${method}`,
          origin: "auto.middleware.express"
        })]);
        fn2.call(this, err, req, res, function(...args) {
          _optionalChain([span, "optionalAccess", (_8) => _8.finish, "call", (_9) => _9()]);
          next.call(this, ...args);
        });
      };
    }
    default: {
      throw new Error(`Express middleware takes 2-4 arguments. Got: ${arity}`);
    }
  }
}
function wrapMiddlewareArgs(args, method) {
  return args.map((arg) => {
    if (typeof arg === "function") {
      return wrap3(arg, method);
    }
    if (Array.isArray(arg)) {
      return arg.map((a7) => {
        if (typeof a7 === "function") {
          return wrap3(a7, method);
        }
        return a7;
      });
    }
    return arg;
  });
}
function patchMiddleware(router, method) {
  const originalCallback = router[method];
  router[method] = function(...args) {
    return originalCallback.call(this, ...wrapMiddlewareArgs(args, method));
  };
  return router;
}
function instrumentMiddlewares(router, methods = []) {
  methods.forEach((method) => patchMiddleware(router, method));
}
function instrumentRouter(appOrRouter) {
  const isApp = "settings" in appOrRouter;
  if (isApp && appOrRouter._router === void 0 && appOrRouter.lazyrouter) {
    appOrRouter.lazyrouter();
  }
  const router = isApp ? appOrRouter._router : appOrRouter;
  if (!router) {
    DEBUG_BUILD3 && logger2.debug("Cannot instrument router for URL Parameterization (did not find a valid router).");
    DEBUG_BUILD3 && logger2.debug("Routing instrumentation is currently only supported in Express 4.");
    return;
  }
  const routerProto = Object.getPrototypeOf(router);
  const originalProcessParams = routerProto.process_params;
  routerProto.process_params = /* @__PURE__ */ __name(function process_params(layer, called, req, res, done) {
    if (!req._reconstructedRoute) {
      req._reconstructedRoute = "";
    }
    const { layerRoutePath, isRegex, isArray, numExtraSegments } = getLayerRoutePathInfo(layer);
    if (layerRoutePath || isRegex || isArray) {
      req._hasParameters = true;
    }
    let partialRoute;
    if (layerRoutePath) {
      partialRoute = layerRoutePath;
    } else {
      partialRoute = preventDuplicateSegments(req.originalUrl, req._reconstructedRoute, layer.path) || "";
    }
    const finalPartialRoute = partialRoute.split("/").filter((segment) => segment.length > 0 && (isRegex || isArray || !segment.includes("*"))).join("/");
    if (finalPartialRoute && finalPartialRoute.length > 0) {
      req._reconstructedRoute += `/${finalPartialRoute}${isRegex ? "/" : ""}`;
    }
    const urlLength = getNumberOfUrlSegments(stripUrlQueryAndFragment(req.originalUrl || "")) + numExtraSegments;
    const routeLength = getNumberOfUrlSegments(req._reconstructedRoute);
    if (urlLength === routeLength) {
      if (!req._hasParameters) {
        if (req._reconstructedRoute !== req.originalUrl) {
          req._reconstructedRoute = req.originalUrl ? stripUrlQueryAndFragment(req.originalUrl) : req.originalUrl;
        }
      }
      const transaction = res.__sentry_transaction;
      if (transaction && transaction.metadata.source !== "custom") {
        const finalRoute = req._reconstructedRoute || "/";
        transaction.setName(...extractPathForTransaction(req, { path: true, method: true, customRoute: finalRoute }));
      }
    }
    return originalProcessParams.call(this, layer, called, req, res, done);
  }, "process_params");
}
function getLayerRoutePathInfo(layer) {
  let lrp = _optionalChain([layer, "access", (_12) => _12.route, "optionalAccess", (_13) => _13.path]);
  const isRegex = isRegExp(lrp);
  const isArray = Array.isArray(lrp);
  if (!lrp) {
    const [major] = GLOBAL_OBJ.process.versions.node.split(".").map(Number);
    if (major >= 16) {
      lrp = extractOriginalRoute(layer.path, layer.regexp, layer.keys);
    }
  }
  if (!lrp) {
    return { isRegex, isArray, numExtraSegments: 0 };
  }
  const numExtraSegments = isArray ? Math.max(getNumberOfArrayUrlSegments(lrp) - getNumberOfUrlSegments(layer.path || ""), 0) : 0;
  const layerRoutePath = getLayerRoutePathString(isArray, lrp);
  return { layerRoutePath, isRegex, isArray, numExtraSegments };
}
function getNumberOfArrayUrlSegments(routesArray) {
  return routesArray.reduce((accNumSegments, currentRoute) => {
    return accNumSegments + getNumberOfUrlSegments(currentRoute.toString());
  }, 0);
}
function getLayerRoutePathString(isArray, lrp) {
  if (isArray) {
    return lrp.map((r10) => r10.toString()).join(",");
  }
  return lrp && lrp.toString();
}
function preventDuplicateSegments(originalUrl, reconstructedRoute, layerPath) {
  const normalizeURL = stripUrlQueryAndFragment(originalUrl || "");
  const originalUrlSplit = _optionalChain([normalizeURL, "optionalAccess", (_14) => _14.split, "call", (_15) => _15("/"), "access", (_16) => _16.filter, "call", (_17) => _17((v8) => !!v8)]);
  let tempCounter = 0;
  const currentOffset = _optionalChain([reconstructedRoute, "optionalAccess", (_18) => _18.split, "call", (_19) => _19("/"), "access", (_20) => _20.filter, "call", (_21) => _21((v8) => !!v8), "access", (_22) => _22.length]) || 0;
  const result = _optionalChain([
    layerPath,
    "optionalAccess",
    (_23) => _23.split,
    "call",
    (_24) => _24("/"),
    "access",
    (_25) => _25.filter,
    "call",
    (_26) => _26((segment) => {
      if (_optionalChain([originalUrlSplit, "optionalAccess", (_27) => _27[currentOffset + tempCounter]]) === segment) {
        tempCounter += 1;
        return true;
      }
      return false;
    }),
    "access",
    (_28) => _28.join,
    "call",
    (_29) => _29("/")
  ]);
  return result;
}
var Express, extractOriginalRoute;
var init_express = __esm({
  "../../node_modules/.pnpm/@sentry-internal+tracing@7.87.0/node_modules/@sentry-internal/tracing/esm/node/integrations/express.js"() {
    init_import_meta_url();
    init_esm7();
    init_esm7();
    init_debug_build3();
    init_node_utils();
    Express = class _Express {
      static {
        __name(this, "Express");
      }
      /**
       * @inheritDoc
       */
      static __initStatic() {
        this.id = "Express";
      }
      /**
       * @inheritDoc
       */
      /**
       * Express App instance
       */
      /**
       * @inheritDoc
       */
      constructor(options = {}) {
        this.name = _Express.id;
        this._router = options.router || options.app;
        this._methods = (Array.isArray(options.methods) ? options.methods : []).concat("use");
      }
      /**
       * @inheritDoc
       */
      setupOnce(_5, getCurrentHub3) {
        if (!this._router) {
          DEBUG_BUILD3 && logger2.error("ExpressIntegration is missing an Express instance");
          return;
        }
        if (shouldDisableAutoInstrumentation(getCurrentHub3)) {
          DEBUG_BUILD3 && logger2.log("Express Integration is skipped because of instrumenter configuration.");
          return;
        }
        instrumentMiddlewares(this._router, this._methods);
        instrumentRouter(this._router);
      }
    };
    Express.__initStatic();
    __name(wrap3, "wrap");
    __name(wrapMiddlewareArgs, "wrapMiddlewareArgs");
    __name(patchMiddleware, "patchMiddleware");
    __name(instrumentMiddlewares, "instrumentMiddlewares");
    __name(instrumentRouter, "instrumentRouter");
    extractOriginalRoute = /* @__PURE__ */ __name((path84, regexp, keys) => {
      if (!path84 || !regexp || !keys || Object.keys(keys).length === 0 || !_optionalChain([keys, "access", (_10) => _10[0], "optionalAccess", (_11) => _11.offset])) {
        return void 0;
      }
      const orderedKeys = keys.sort((a7, b11) => a7.offset - b11.offset);
      const pathRegex = new RegExp(regexp, `${regexp.flags}d`);
      const execResult = pathRegex.exec(path84);
      if (!execResult || !execResult.indices) {
        return void 0;
      }
      const [, ...paramIndices] = execResult.indices;
      if (paramIndices.length !== orderedKeys.length) {
        return void 0;
      }
      let resultPath = path84;
      let indexShift = 0;
      paramIndices.forEach((item, index) => {
        if (item) {
          const [startOffset, endOffset] = item;
          const substr1 = resultPath.substring(0, startOffset - indexShift);
          const replacement = `:${orderedKeys[index].name}`;
          const substr2 = resultPath.substring(endOffset - indexShift);
          resultPath = substr1 + replacement + substr2;
          indexShift = indexShift + (endOffset - startOffset - replacement.length);
        }
      });
      return resultPath;
    }, "extractOriginalRoute");
    __name(getLayerRoutePathInfo, "getLayerRoutePathInfo");
    __name(getNumberOfArrayUrlSegments, "getNumberOfArrayUrlSegments");
    __name(getLayerRoutePathString, "getLayerRoutePathString");
    __name(preventDuplicateSegments, "preventDuplicateSegments");
  }
});

// ../../node_modules/.pnpm/@sentry-internal+tracing@7.87.0/node_modules/@sentry-internal/tracing/esm/node/integrations/postgres.js
var Postgres;
var init_postgres = __esm({
  "../../node_modules/.pnpm/@sentry-internal+tracing@7.87.0/node_modules/@sentry-internal/tracing/esm/node/integrations/postgres.js"() {
    init_import_meta_url();
    init_esm7();
    init_esm7();
    init_debug_build3();
    init_node_utils();
    Postgres = class _Postgres {
      static {
        __name(this, "Postgres");
      }
      /**
       * @inheritDoc
       */
      static __initStatic() {
        this.id = "Postgres";
      }
      /**
       * @inheritDoc
       */
      constructor(options = {}) {
        this.name = _Postgres.id;
        this._usePgNative = !!options.usePgNative;
        this._module = options.module;
      }
      /** @inheritdoc */
      loadDependency() {
        return this._module = this._module || loadModule("pg");
      }
      /**
       * @inheritDoc
       */
      setupOnce(_5, getCurrentHub3) {
        if (shouldDisableAutoInstrumentation(getCurrentHub3)) {
          DEBUG_BUILD3 && logger2.log("Postgres Integration is skipped because of instrumenter configuration.");
          return;
        }
        const pkg = this.loadDependency();
        if (!pkg) {
          DEBUG_BUILD3 && logger2.error("Postgres Integration was unable to require `pg` package.");
          return;
        }
        const Client2 = this._usePgNative ? _optionalChain([pkg, "access", (_22) => _22.native, "optionalAccess", (_32) => _32.Client]) : pkg.Client;
        if (!Client2) {
          DEBUG_BUILD3 && logger2.error("Postgres Integration was unable to access 'pg-native' bindings.");
          return;
        }
        fill(Client2.prototype, "query", function(orig) {
          return function(config, values, callback) {
            const scope = getCurrentHub3().getScope();
            const parentSpan = scope.getSpan();
            const data = {
              "db.system": "postgresql"
            };
            try {
              if (this.database) {
                data["db.name"] = this.database;
              }
              if (this.host) {
                data["server.address"] = this.host;
              }
              if (this.port) {
                data["server.port"] = this.port;
              }
              if (this.user) {
                data["db.user"] = this.user;
              }
            } catch (e10) {
            }
            const span = _optionalChain([parentSpan, "optionalAccess", (_42) => _42.startChild, "call", (_52) => _52({
              description: typeof config === "string" ? config : config.text,
              op: "db",
              origin: "auto.db.postgres",
              data
            })]);
            if (typeof callback === "function") {
              return orig.call(this, config, values, function(err, result) {
                _optionalChain([span, "optionalAccess", (_6) => _6.finish, "call", (_7) => _7()]);
                callback(err, result);
              });
            }
            if (typeof values === "function") {
              return orig.call(this, config, function(err, result) {
                _optionalChain([span, "optionalAccess", (_8) => _8.finish, "call", (_9) => _9()]);
                values(err, result);
              });
            }
            const rv = typeof values !== "undefined" ? orig.call(this, config, values) : orig.call(this, config);
            if (isThenable(rv)) {
              return rv.then((res) => {
                _optionalChain([span, "optionalAccess", (_10) => _10.finish, "call", (_11) => _11()]);
                return res;
              });
            }
            _optionalChain([span, "optionalAccess", (_12) => _12.finish, "call", (_13) => _13()]);
            return rv;
          };
        });
      }
    };
    Postgres.__initStatic();
  }
});

// ../../node_modules/.pnpm/@sentry-internal+tracing@7.87.0/node_modules/@sentry-internal/tracing/esm/node/integrations/mysql.js
var Mysql;
var init_mysql = __esm({
  "../../node_modules/.pnpm/@sentry-internal+tracing@7.87.0/node_modules/@sentry-internal/tracing/esm/node/integrations/mysql.js"() {
    init_import_meta_url();
    init_esm7();
    init_esm7();
    init_debug_build3();
    init_node_utils();
    Mysql = class _Mysql {
      static {
        __name(this, "Mysql");
      }
      /**
       * @inheritDoc
       */
      static __initStatic() {
        this.id = "Mysql";
      }
      /**
       * @inheritDoc
       */
      constructor() {
        this.name = _Mysql.id;
      }
      /** @inheritdoc */
      loadDependency() {
        return this._module = this._module || loadModule("mysql/lib/Connection.js");
      }
      /**
       * @inheritDoc
       */
      setupOnce(_5, getCurrentHub3) {
        if (shouldDisableAutoInstrumentation(getCurrentHub3)) {
          DEBUG_BUILD3 && logger2.log("Mysql Integration is skipped because of instrumenter configuration.");
          return;
        }
        const pkg = this.loadDependency();
        if (!pkg) {
          DEBUG_BUILD3 && logger2.error("Mysql Integration was unable to require `mysql` package.");
          return;
        }
        let mySqlConfig = void 0;
        try {
          pkg.prototype.connect = new Proxy(pkg.prototype.connect, {
            apply(wrappingTarget, thisArg, args) {
              if (!mySqlConfig) {
                mySqlConfig = thisArg.config;
              }
              return wrappingTarget.apply(thisArg, args);
            }
          });
        } catch (e10) {
          DEBUG_BUILD3 && logger2.error("Mysql Integration was unable to instrument `mysql` config.");
        }
        function spanDataFromConfig() {
          if (!mySqlConfig) {
            return {};
          }
          return {
            "server.address": mySqlConfig.host,
            "server.port": mySqlConfig.port,
            "db.user": mySqlConfig.user
          };
        }
        __name(spanDataFromConfig, "spanDataFromConfig");
        function finishSpan(span) {
          if (!span || span.endTimestamp) {
            return;
          }
          const data = spanDataFromConfig();
          Object.keys(data).forEach((key) => {
            span.setData(key, data[key]);
          });
          span.finish();
        }
        __name(finishSpan, "finishSpan");
        fill(pkg, "createQuery", function(orig) {
          return function(options, values, callback) {
            const scope = getCurrentHub3().getScope();
            const parentSpan = scope.getSpan();
            const span = _optionalChain([parentSpan, "optionalAccess", (_22) => _22.startChild, "call", (_32) => _32({
              description: typeof options === "string" ? options : options.sql,
              op: "db",
              origin: "auto.db.mysql",
              data: {
                "db.system": "mysql"
              }
            })]);
            if (typeof callback === "function") {
              return orig.call(this, options, values, function(err, result, fields) {
                finishSpan(span);
                callback(err, result, fields);
              });
            }
            if (typeof values === "function") {
              return orig.call(this, options, function(err, result, fields) {
                finishSpan(span);
                values(err, result, fields);
              });
            }
            const query = orig.call(this, options, values);
            query.on("end", () => {
              finishSpan(span);
            });
            return query;
          };
        });
      }
    };
    Mysql.__initStatic();
  }
});

// ../../node_modules/.pnpm/@sentry-internal+tracing@7.87.0/node_modules/@sentry-internal/tracing/esm/node/integrations/mongo.js
function isCursor(maybeCursor) {
  return maybeCursor && typeof maybeCursor === "object" && maybeCursor.once && typeof maybeCursor.once === "function";
}
var OPERATIONS, OPERATION_SIGNATURES, Mongo;
var init_mongo = __esm({
  "../../node_modules/.pnpm/@sentry-internal+tracing@7.87.0/node_modules/@sentry-internal/tracing/esm/node/integrations/mongo.js"() {
    init_import_meta_url();
    init_esm7();
    init_esm7();
    init_debug_build3();
    init_node_utils();
    OPERATIONS = [
      "aggregate",
      // aggregate(pipeline, options, callback)
      "bulkWrite",
      // bulkWrite(operations, options, callback)
      "countDocuments",
      // countDocuments(query, options, callback)
      "createIndex",
      // createIndex(fieldOrSpec, options, callback)
      "createIndexes",
      // createIndexes(indexSpecs, options, callback)
      "deleteMany",
      // deleteMany(filter, options, callback)
      "deleteOne",
      // deleteOne(filter, options, callback)
      "distinct",
      // distinct(key, query, options, callback)
      "drop",
      // drop(options, callback)
      "dropIndex",
      // dropIndex(indexName, options, callback)
      "dropIndexes",
      // dropIndexes(options, callback)
      "estimatedDocumentCount",
      // estimatedDocumentCount(options, callback)
      "find",
      // find(query, options, callback)
      "findOne",
      // findOne(query, options, callback)
      "findOneAndDelete",
      // findOneAndDelete(filter, options, callback)
      "findOneAndReplace",
      // findOneAndReplace(filter, replacement, options, callback)
      "findOneAndUpdate",
      // findOneAndUpdate(filter, update, options, callback)
      "indexes",
      // indexes(options, callback)
      "indexExists",
      // indexExists(indexes, options, callback)
      "indexInformation",
      // indexInformation(options, callback)
      "initializeOrderedBulkOp",
      // initializeOrderedBulkOp(options, callback)
      "insertMany",
      // insertMany(docs, options, callback)
      "insertOne",
      // insertOne(doc, options, callback)
      "isCapped",
      // isCapped(options, callback)
      "mapReduce",
      // mapReduce(map, reduce, options, callback)
      "options",
      // options(options, callback)
      "parallelCollectionScan",
      // parallelCollectionScan(options, callback)
      "rename",
      // rename(newName, options, callback)
      "replaceOne",
      // replaceOne(filter, doc, options, callback)
      "stats",
      // stats(options, callback)
      "updateMany",
      // updateMany(filter, update, options, callback)
      "updateOne"
      // updateOne(filter, update, options, callback)
    ];
    OPERATION_SIGNATURES = {
      // aggregate intentionally not included because `pipeline` arguments are too complex to serialize well
      // see https://github.com/getsentry/sentry-javascript/pull/3102
      bulkWrite: ["operations"],
      countDocuments: ["query"],
      createIndex: ["fieldOrSpec"],
      createIndexes: ["indexSpecs"],
      deleteMany: ["filter"],
      deleteOne: ["filter"],
      distinct: ["key", "query"],
      dropIndex: ["indexName"],
      find: ["query"],
      findOne: ["query"],
      findOneAndDelete: ["filter"],
      findOneAndReplace: ["filter", "replacement"],
      findOneAndUpdate: ["filter", "update"],
      indexExists: ["indexes"],
      insertMany: ["docs"],
      insertOne: ["doc"],
      mapReduce: ["map", "reduce"],
      rename: ["newName"],
      replaceOne: ["filter", "doc"],
      updateMany: ["filter", "update"],
      updateOne: ["filter", "update"]
    };
    __name(isCursor, "isCursor");
    Mongo = class _Mongo {
      static {
        __name(this, "Mongo");
      }
      /**
       * @inheritDoc
       */
      static __initStatic() {
        this.id = "Mongo";
      }
      /**
       * @inheritDoc
       */
      /**
       * @inheritDoc
       */
      constructor(options = {}) {
        this.name = _Mongo.id;
        this._operations = Array.isArray(options.operations) ? options.operations : OPERATIONS;
        this._describeOperations = "describeOperations" in options ? options.describeOperations : true;
        this._useMongoose = !!options.useMongoose;
      }
      /** @inheritdoc */
      loadDependency() {
        const moduleName = this._useMongoose ? "mongoose" : "mongodb";
        return this._module = this._module || loadModule(moduleName);
      }
      /**
       * @inheritDoc
       */
      setupOnce(_5, getCurrentHub3) {
        if (shouldDisableAutoInstrumentation(getCurrentHub3)) {
          DEBUG_BUILD3 && logger2.log("Mongo Integration is skipped because of instrumenter configuration.");
          return;
        }
        const pkg = this.loadDependency();
        if (!pkg) {
          const moduleName = this._useMongoose ? "mongoose" : "mongodb";
          DEBUG_BUILD3 && logger2.error(`Mongo Integration was unable to require \`${moduleName}\` package.`);
          return;
        }
        this._instrumentOperations(pkg.Collection, this._operations, getCurrentHub3);
      }
      /**
       * Patches original collection methods
       */
      _instrumentOperations(collection, operations, getCurrentHub3) {
        operations.forEach((operation) => this._patchOperation(collection, operation, getCurrentHub3));
      }
      /**
       * Patches original collection to utilize our tracing functionality
       */
      _patchOperation(collection, operation, getCurrentHub3) {
        if (!(operation in collection.prototype)) return;
        const getSpanContext = this._getSpanContextFromOperationArguments.bind(this);
        fill(collection.prototype, operation, function(orig) {
          return function(...args) {
            const lastArg = args[args.length - 1];
            const scope = getCurrentHub3().getScope();
            const parentSpan = scope.getSpan();
            if (typeof lastArg !== "function" || operation === "mapReduce" && args.length === 2) {
              const span2 = _optionalChain([parentSpan, "optionalAccess", (_22) => _22.startChild, "call", (_32) => _32(getSpanContext(this, operation, args))]);
              const maybePromiseOrCursor = orig.call(this, ...args);
              if (isThenable(maybePromiseOrCursor)) {
                return maybePromiseOrCursor.then((res) => {
                  _optionalChain([span2, "optionalAccess", (_42) => _42.finish, "call", (_5) => _5()]);
                  return res;
                });
              } else if (isCursor(maybePromiseOrCursor)) {
                const cursor = maybePromiseOrCursor;
                try {
                  cursor.once("close", () => {
                    _optionalChain([span2, "optionalAccess", (_6) => _6.finish, "call", (_7) => _7()]);
                  });
                } catch (e10) {
                  _optionalChain([span2, "optionalAccess", (_8) => _8.finish, "call", (_9) => _9()]);
                }
                return cursor;
              } else {
                _optionalChain([span2, "optionalAccess", (_10) => _10.finish, "call", (_11) => _11()]);
                return maybePromiseOrCursor;
              }
            }
            const span = _optionalChain([parentSpan, "optionalAccess", (_12) => _12.startChild, "call", (_13) => _13(getSpanContext(this, operation, args.slice(0, -1)))]);
            return orig.call(this, ...args.slice(0, -1), function(err, result) {
              _optionalChain([span, "optionalAccess", (_14) => _14.finish, "call", (_15) => _15()]);
              lastArg(err, result);
            });
          };
        });
      }
      /**
       * Form a SpanContext based on the user input to a given operation.
       */
      _getSpanContextFromOperationArguments(collection, operation, args) {
        const data = {
          "db.system": "mongodb",
          "db.name": collection.dbName,
          "db.operation": operation,
          "db.mongodb.collection": collection.collectionName
        };
        const spanContext = {
          op: "db",
          // TODO v8: Use `${collection.collectionName}.${operation}`
          origin: "auto.db.mongo",
          description: operation,
          data
        };
        const signature = OPERATION_SIGNATURES[operation];
        const shouldDescribe = Array.isArray(this._describeOperations) ? this._describeOperations.includes(operation) : this._describeOperations;
        if (!signature || !shouldDescribe) {
          return spanContext;
        }
        try {
          if (operation === "mapReduce") {
            const [map2, reduce] = args;
            data[signature[0]] = typeof map2 === "string" ? map2 : map2.name || "<anonymous>";
            data[signature[1]] = typeof reduce === "string" ? reduce : reduce.name || "<anonymous>";
          } else {
            for (let i7 = 0; i7 < signature.length; i7++) {
              data[`db.mongodb.${signature[i7]}`] = JSON.stringify(args[i7]);
            }
          }
        } catch (_oO) {
        }
        return spanContext;
      }
    };
    Mongo.__initStatic();
  }
});

// ../../node_modules/.pnpm/@sentry-internal+tracing@7.87.0/node_modules/@sentry-internal/tracing/esm/node/integrations/prisma.js
function isValidPrismaClient(possibleClient) {
  return !!possibleClient && !!possibleClient["$use"];
}
var Prisma;
var init_prisma = __esm({
  "../../node_modules/.pnpm/@sentry-internal+tracing@7.87.0/node_modules/@sentry-internal/tracing/esm/node/integrations/prisma.js"() {
    init_import_meta_url();
    init_esm8();
    init_esm7();
    init_debug_build3();
    init_node_utils();
    __name(isValidPrismaClient, "isValidPrismaClient");
    Prisma = class _Prisma {
      static {
        __name(this, "Prisma");
      }
      /**
       * @inheritDoc
       */
      static __initStatic() {
        this.id = "Prisma";
      }
      /**
       * @inheritDoc
       */
      /**
       * @inheritDoc
       */
      constructor(options = {}) {
        this.name = _Prisma.id;
        if (isValidPrismaClient(options.client) && !options.client._sentryInstrumented) {
          addNonEnumerableProperty(options.client, "_sentryInstrumented", true);
          const clientData = {};
          try {
            const engineConfig = options.client._engineConfig;
            if (engineConfig) {
              const { activeProvider, clientVersion } = engineConfig;
              if (activeProvider) {
                clientData["db.system"] = activeProvider;
              }
              if (clientVersion) {
                clientData["db.prisma.version"] = clientVersion;
              }
            }
          } catch (e10) {
          }
          options.client.$use((params, next) => {
            if (shouldDisableAutoInstrumentation(getCurrentHub)) {
              return next(params);
            }
            const action = params.action;
            const model = params.model;
            return trace(
              {
                name: model ? `${model} ${action}` : action,
                op: "db.prisma",
                origin: "auto.db.prisma",
                data: { ...clientData, "db.operation": action }
              },
              () => next(params)
            );
          });
        } else {
          DEBUG_BUILD3 && logger2.warn("Unsupported Prisma client provided to PrismaIntegration. Provided client:", options.client);
        }
      }
      /**
       * @inheritDoc
       */
      setupOnce() {
      }
    };
    Prisma.__initStatic();
  }
});

// ../../node_modules/.pnpm/@sentry-internal+tracing@7.87.0/node_modules/@sentry-internal/tracing/esm/node/integrations/graphql.js
var GraphQL;
var init_graphql = __esm({
  "../../node_modules/.pnpm/@sentry-internal+tracing@7.87.0/node_modules/@sentry-internal/tracing/esm/node/integrations/graphql.js"() {
    init_import_meta_url();
    init_esm7();
    init_esm7();
    init_debug_build3();
    init_node_utils();
    GraphQL = class _GraphQL {
      static {
        __name(this, "GraphQL");
      }
      /**
       * @inheritDoc
       */
      static __initStatic() {
        this.id = "GraphQL";
      }
      /**
       * @inheritDoc
       */
      constructor() {
        this.name = _GraphQL.id;
      }
      /** @inheritdoc */
      loadDependency() {
        return this._module = this._module || loadModule("graphql/execution/execute.js");
      }
      /**
       * @inheritDoc
       */
      setupOnce(_5, getCurrentHub3) {
        if (shouldDisableAutoInstrumentation(getCurrentHub3)) {
          DEBUG_BUILD3 && logger2.log("GraphQL Integration is skipped because of instrumenter configuration.");
          return;
        }
        const pkg = this.loadDependency();
        if (!pkg) {
          DEBUG_BUILD3 && logger2.error("GraphQL Integration was unable to require graphql/execution package.");
          return;
        }
        fill(pkg, "execute", function(orig) {
          return function(...args) {
            const scope = getCurrentHub3().getScope();
            const parentSpan = scope.getSpan();
            const span = _optionalChain([parentSpan, "optionalAccess", (_22) => _22.startChild, "call", (_32) => _32({
              description: "execute",
              op: "graphql.execute",
              origin: "auto.graphql.graphql"
            })]);
            _optionalChain([scope, "optionalAccess", (_42) => _42.setSpan, "call", (_52) => _52(span)]);
            const rv = orig.call(this, ...args);
            if (isThenable(rv)) {
              return rv.then((res) => {
                _optionalChain([span, "optionalAccess", (_6) => _6.finish, "call", (_7) => _7()]);
                _optionalChain([scope, "optionalAccess", (_8) => _8.setSpan, "call", (_9) => _9(parentSpan)]);
                return res;
              });
            }
            _optionalChain([span, "optionalAccess", (_10) => _10.finish, "call", (_11) => _11()]);
            _optionalChain([scope, "optionalAccess", (_12) => _12.setSpan, "call", (_13) => _13(parentSpan)]);
            return rv;
          };
        });
      }
    };
    GraphQL.__initStatic();
  }
});

// ../../node_modules/.pnpm/@sentry-internal+tracing@7.87.0/node_modules/@sentry-internal/tracing/esm/node/integrations/apollo.js
function instrumentResolvers(resolvers, getCurrentHub3) {
  return resolvers.map((model) => {
    Object.keys(model).forEach((resolverGroupName) => {
      Object.keys(model[resolverGroupName]).forEach((resolverName) => {
        if (typeof model[resolverGroupName][resolverName] !== "function") {
          return;
        }
        wrapResolver(model, resolverGroupName, resolverName, getCurrentHub3);
      });
    });
    return model;
  });
}
function wrapResolver(model, resolverGroupName, resolverName, getCurrentHub3) {
  fill(model[resolverGroupName], resolverName, function(orig) {
    return function(...args) {
      const scope = getCurrentHub3().getScope();
      const parentSpan = scope.getSpan();
      const span = _optionalChain([parentSpan, "optionalAccess", (_22) => _22.startChild, "call", (_32) => _32({
        description: `${resolverGroupName}.${resolverName}`,
        op: "graphql.resolve",
        origin: "auto.graphql.apollo"
      })]);
      const rv = orig.call(this, ...args);
      if (isThenable(rv)) {
        return rv.then((res) => {
          _optionalChain([span, "optionalAccess", (_42) => _42.finish, "call", (_5) => _5()]);
          return res;
        });
      }
      _optionalChain([span, "optionalAccess", (_6) => _6.finish, "call", (_7) => _7()]);
      return rv;
    };
  });
}
var Apollo;
var init_apollo = __esm({
  "../../node_modules/.pnpm/@sentry-internal+tracing@7.87.0/node_modules/@sentry-internal/tracing/esm/node/integrations/apollo.js"() {
    init_import_meta_url();
    init_esm7();
    init_esm7();
    init_debug_build3();
    init_node_utils();
    Apollo = class _Apollo {
      static {
        __name(this, "Apollo");
      }
      /**
       * @inheritDoc
       */
      static __initStatic() {
        this.id = "Apollo";
      }
      /**
       * @inheritDoc
       */
      /**
       * @inheritDoc
       */
      constructor(options = {
        useNestjs: false
      }) {
        this.name = _Apollo.id;
        this._useNest = !!options.useNestjs;
      }
      /** @inheritdoc */
      loadDependency() {
        if (this._useNest) {
          this._module = this._module || loadModule("@nestjs/graphql");
        } else {
          this._module = this._module || loadModule("apollo-server-core");
        }
        return this._module;
      }
      /**
       * @inheritDoc
       */
      setupOnce(_5, getCurrentHub3) {
        if (shouldDisableAutoInstrumentation(getCurrentHub3)) {
          DEBUG_BUILD3 && logger2.log("Apollo Integration is skipped because of instrumenter configuration.");
          return;
        }
        if (this._useNest) {
          const pkg = this.loadDependency();
          if (!pkg) {
            DEBUG_BUILD3 && logger2.error("Apollo-NestJS Integration was unable to require @nestjs/graphql package.");
            return;
          }
          fill(
            pkg.GraphQLFactory.prototype,
            "mergeWithSchema",
            function(orig) {
              return function(...args) {
                fill(this.resolversExplorerService, "explore", function(orig2) {
                  return function() {
                    const resolvers = arrayify(orig2.call(this));
                    const instrumentedResolvers = instrumentResolvers(resolvers, getCurrentHub3);
                    return instrumentedResolvers;
                  };
                });
                return orig.call(this, ...args);
              };
            }
          );
        } else {
          const pkg = this.loadDependency();
          if (!pkg) {
            DEBUG_BUILD3 && logger2.error("Apollo Integration was unable to require apollo-server-core package.");
            return;
          }
          fill(pkg.ApolloServerBase.prototype, "constructSchema", function(orig) {
            return function() {
              if (!this.config.resolvers) {
                if (DEBUG_BUILD3) {
                  if (this.config.schema) {
                    logger2.warn(
                      "Apollo integration is not able to trace `ApolloServer` instances constructed via `schema` property.If you are using NestJS with Apollo, please use `Sentry.Integrations.Apollo({ useNestjs: true })` instead."
                    );
                    logger2.warn();
                  } else if (this.config.modules) {
                    logger2.warn(
                      "Apollo integration is not able to trace `ApolloServer` instances constructed via `modules` property."
                    );
                  }
                  logger2.error("Skipping tracing as no resolvers found on the `ApolloServer` instance.");
                }
                return orig.call(this);
              }
              const resolvers = arrayify(this.config.resolvers);
              this.config.resolvers = instrumentResolvers(resolvers, getCurrentHub3);
              return orig.call(this);
            };
          });
        }
      }
    };
    Apollo.__initStatic();
    __name(instrumentResolvers, "instrumentResolvers");
    __name(wrapResolver, "wrapResolver");
  }
});

// ../../node_modules/.pnpm/@sentry-internal+tracing@7.87.0/node_modules/@sentry-internal/tracing/esm/index.js
var init_esm9 = __esm({
  "../../node_modules/.pnpm/@sentry-internal+tracing@7.87.0/node_modules/@sentry-internal/tracing/esm/index.js"() {
    init_import_meta_url();
    init_express();
    init_postgres();
    init_mysql();
    init_mongo();
    init_prisma();
    init_graphql();
    init_apollo();
  }
});
var NodeClient;
var init_client4 = __esm({
  "../../node_modules/.pnpm/@sentry+node@7.87.0_supports-color@9.2.2/node_modules/@sentry/node/esm/client.js"() {
    init_import_meta_url();
    init_esm8();
    NodeClient = class extends ServerRuntimeClient {
      static {
        __name(this, "NodeClient");
      }
      /**
       * Creates a new Node SDK instance.
       * @param options Configuration options for this SDK.
       */
      constructor(options) {
        options._metadata = options._metadata || {};
        options._metadata.sdk = options._metadata.sdk || {
          name: "sentry.javascript.node",
          packages: [
            {
              name: "npm:@sentry/node",
              version: SDK_VERSION
            }
          ],
          version: SDK_VERSION
        };
        options.transportOptions = {
          textEncoder: new util4.TextEncoder(),
          ...options.transportOptions
        };
        const clientOptions = {
          ...options,
          platform: "node",
          runtime: { name: "node", version: global.process.version },
          serverName: options.serverName || global.process.env.SENTRY_NAME || os11__namespace.hostname()
        };
        super(clientOptions);
      }
    };
  }
});

// ../../node_modules/.pnpm/debug@4.4.1_supports-color@9.2.2/node_modules/debug/src/common.js
var require_common = __commonJS({
  "../../node_modules/.pnpm/debug@4.4.1_supports-color@9.2.2/node_modules/debug/src/common.js"(exports, module2) {
    init_import_meta_url();
    function setup(env6) {
      createDebug.debug = createDebug;
      createDebug.default = createDebug;
      createDebug.coerce = coerce6;
      createDebug.disable = disable;
      createDebug.enable = enable;
      createDebug.enabled = enabled;
      createDebug.humanize = require_ms();
      createDebug.destroy = destroy;
      Object.keys(env6).forEach((key) => {
        createDebug[key] = env6[key];
      });
      createDebug.names = [];
      createDebug.skips = [];
      createDebug.formatters = {};
      function selectColor(namespace) {
        let hash = 0;
        for (let i7 = 0; i7 < namespace.length; i7++) {
          hash = (hash << 5) - hash + namespace.charCodeAt(i7);
          hash |= 0;
        }
        return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
      }
      __name(selectColor, "selectColor");
      createDebug.selectColor = selectColor;
      function createDebug(namespace) {
        let prevTime;
        let enableOverride = null;
        let namespacesCache;
        let enabledCache;
        function debug2(...args) {
          if (!debug2.enabled) {
            return;
          }
          const self2 = debug2;
          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, (match3, format11) => {
            if (match3 === "%%") {
              return "%";
            }
            index++;
            const formatter = createDebug.formatters[format11];
            if (typeof formatter === "function") {
              const val2 = args[index];
              match3 = formatter.call(self2, val2);
              args.splice(index, 1);
              index--;
            }
            return match3;
          });
          createDebug.formatArgs.call(self2, args);
          const logFn = self2.log || createDebug.log;
          logFn.apply(self2, args);
        }
        __name(debug2, "debug");
        debug2.namespace = namespace;
        debug2.useColors = createDebug.useColors();
        debug2.color = createDebug.selectColor(namespace);
        debug2.extend = extend;
        debug2.destroy = createDebug.destroy;
        Object.defineProperty(debug2, "enabled", {
          enumerable: true,
          configurable: false,
          get: /* @__PURE__ */ __name(() => {
            if (enableOverride !== null) {
              return enableOverride;
            }
            if (namespacesCache !== createDebug.namespaces) {
              namespacesCache = createDebug.namespaces;
              enabledCache = createDebug.enabled(namespace);
            }
            return enabledCache;
          }, "get"),
          set: /* @__PURE__ */ __name((v8) => {
            enableOverride = v8;
          }, "set")
        });
        if (typeof createDebug.init === "function") {
          createDebug.init(debug2);
        }
        return debug2;
      }
      __name(createDebug, "createDebug");
      function extend(namespace, delimiter) {
        const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace);
        newDebug.log = this.log;
        return newDebug;
      }
      __name(extend, "extend");
      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);
          }
        }
      }
      __name(enable, "enable");
      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;
      }
      __name(matchesTemplate, "matchesTemplate");
      function disable() {
        const namespaces = [
          ...createDebug.names,
          ...createDebug.skips.map((namespace) => "-" + namespace)
        ].join(",");
        createDebug.enable("");
        return namespaces;
      }
      __name(disable, "disable");
      function enabled(name2) {
        for (const skip of createDebug.skips) {
          if (matchesTemplate(name2, skip)) {
            return false;
          }
        }
        for (const ns of createDebug.names) {
          if (matchesTemplate(name2, ns)) {
            return true;
          }
        }
        return false;
      }
      __name(enabled, "enabled");
      function coerce6(val2) {
        if (val2 instanceof Error) {
          return val2.stack || val2.message;
        }
        return val2;
      }
      __name(coerce6, "coerce");
      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`.");
      }
      __name(destroy, "destroy");
      createDebug.enable(createDebug.load());
      return createDebug;
    }
    __name(setup, "setup");
    module2.exports = setup;
  }
});

// ../../node_modules/.pnpm/debug@4.4.1_supports-color@9.2.2/node_modules/debug/src/browser.js
var require_browser = __commonJS({
  "../../node_modules/.pnpm/debug@4.4.1_supports-color@9.2.2/node_modules/debug/src/browser.js"(exports, module2) {
    init_import_meta_url();
    exports.formatArgs = formatArgs;
    exports.save = save;
    exports.load = load;
    exports.useColors = useColors;
    exports.storage = localstorage();
    exports.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`.");
        }
      };
    })();
    exports.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 m7;
      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 && (m7 = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m7[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+)/);
    }
    __name(useColors, "useColors");
    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 c8 = "color: " + this.color;
      args.splice(1, 0, c8, "color: inherit");
      let index = 0;
      let lastC = 0;
      args[0].replace(/%[a-zA-Z%]/g, (match3) => {
        if (match3 === "%%") {
          return;
        }
        index++;
        if (match3 === "%c") {
          lastC = index;
        }
      });
      args.splice(lastC, 0, c8);
    }
    __name(formatArgs, "formatArgs");
    exports.log = console.debug || console.log || (() => {
    });
    function save(namespaces) {
      try {
        if (namespaces) {
          exports.storage.setItem("debug", namespaces);
        } else {
          exports.storage.removeItem("debug");
        }
      } catch (error2) {
      }
    }
    __name(save, "save");
    function load() {
      let r10;
      try {
        r10 = exports.storage.getItem("debug") || exports.storage.getItem("DEBUG");
      } catch (error2) {
      }
      if (!r10 && typeof process !== "undefined" && "env" in process) {
        r10 = process.env.DEBUG;
      }
      return r10;
    }
    __name(load, "load");
    function localstorage() {
      try {
        return localStorage;
      } catch (error2) {
      }
    }
    __name(localstorage, "localstorage");
    module2.exports = require_common()(exports);
    var { formatters: formatters2 } = module2.exports;
    formatters2.j = function(v8) {
      try {
        return JSON.stringify(v8);
      } catch (error2) {
        return "[UnexpectedJSONParseError]: " + error2.message;
      }
    };
  }
});

// ../../node_modules/.pnpm/debug@4.4.1_supports-color@9.2.2/node_modules/debug/src/node.js
var require_node7 = __commonJS({
  "../../node_modules/.pnpm/debug@4.4.1_supports-color@9.2.2/node_modules/debug/src/node.js"(exports, module2) {
    init_import_meta_url();
    var tty3 = __require("tty");
    var util5 = __require("util");
    exports.init = init4;
    exports.log = log2;
    exports.formatArgs = formatArgs;
    exports.save = save;
    exports.load = load;
    exports.useColors = useColors;
    exports.destroy = util5.deprecate(
      () => {
      },
      "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."
    );
    exports.colors = [6, 2, 3, 4, 5, 1];
    try {
      const supportsColor3 = (init_supports_color2(), __toCommonJS(supports_color_exports));
      if (supportsColor3 && (supportsColor3.stderr || supportsColor3).level >= 2) {
        exports.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 (error2) {
    }
    exports.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, (_5, k7) => {
        return k7.toUpperCase();
      });
      let val2 = process.env[key];
      if (/^(yes|on|true|enabled)$/i.test(val2)) {
        val2 = true;
      } else if (/^(no|off|false|disabled)$/i.test(val2)) {
        val2 = false;
      } else if (val2 === "null") {
        val2 = null;
      } else {
        val2 = Number(val2);
      }
      obj[prop] = val2;
      return obj;
    }, {});
    function useColors() {
      return "colors" in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty3.isatty(process.stderr.fd);
    }
    __name(useColors, "useColors");
    function formatArgs(args) {
      const { namespace: name2, useColors: useColors2 } = this;
      if (useColors2) {
        const c8 = this.color;
        const colorCode = "\x1B[3" + (c8 < 8 ? c8 : "8;5;" + c8);
        const prefix = `  ${colorCode};1m${name2} \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() + name2 + " " + args[0];
      }
    }
    __name(formatArgs, "formatArgs");
    function getDate() {
      if (exports.inspectOpts.hideDate) {
        return "";
      }
      return (/* @__PURE__ */ new Date()).toISOString() + " ";
    }
    __name(getDate, "getDate");
    function log2(...args) {
      return process.stderr.write(util5.formatWithOptions(exports.inspectOpts, ...args) + "\n");
    }
    __name(log2, "log");
    function save(namespaces) {
      if (namespaces) {
        process.env.DEBUG = namespaces;
      } else {
        delete process.env.DEBUG;
      }
    }
    __name(save, "save");
    function load() {
      return process.env.DEBUG;
    }
    __name(load, "load");
    function init4(debug2) {
      debug2.inspectOpts = {};
      const keys = Object.keys(exports.inspectOpts);
      for (let i7 = 0; i7 < keys.length; i7++) {
        debug2.inspectOpts[keys[i7]] = exports.inspectOpts[keys[i7]];
      }
    }
    __name(init4, "init");
    module2.exports = require_common()(exports);
    var { formatters: formatters2 } = module2.exports;
    formatters2.o = function(v8) {
      this.inspectOpts.colors = this.useColors;
      return util5.inspect(v8, this.inspectOpts).split("\n").map((str) => str.trim()).join(" ");
    };
    formatters2.O = function(v8) {
      this.inspectOpts.colors = this.useColors;
      return util5.inspect(v8, this.inspectOpts);
    };
  }
});

// ../../node_modules/.pnpm/debug@4.4.1_supports-color@9.2.2/node_modules/debug/src/index.js
var require_src3 = __commonJS({
  "../../node_modules/.pnpm/debug@4.4.1_supports-color@9.2.2/node_modules/debug/src/index.js"(exports, module2) {
    init_import_meta_url();
    if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) {
      module2.exports = require_browser();
    } else {
      module2.exports = require_node7();
    }
  }
});

// ../../node_modules/.pnpm/agent-base@6.0.2_supports-color@9.2.2/node_modules/agent-base/dist/src/promisify.js
var require_promisify = __commonJS({
  "../../node_modules/.pnpm/agent-base@6.0.2_supports-color@9.2.2/node_modules/agent-base/dist/src/promisify.js"(exports) {
    init_import_meta_url();
    Object.defineProperty(exports, "__esModule", { value: true });
    function promisify9(fn2) {
      return function(req, opts) {
        return new Promise((resolve32, reject) => {
          fn2.call(this, req, opts, (err, rtn) => {
            if (err) {
              reject(err);
            } else {
              resolve32(rtn);
            }
          });
        });
      };
    }
    __name(promisify9, "promisify");
    exports.default = promisify9;
  }
});

// ../../node_modules/.pnpm/agent-base@6.0.2_supports-color@9.2.2/node_modules/agent-base/dist/src/index.js
var require_src4 = __commonJS({
  "../../node_modules/.pnpm/agent-base@6.0.2_supports-color@9.2.2/node_modules/agent-base/dist/src/index.js"(exports, module2) {
    init_import_meta_url();
    var __importDefault2 = exports && exports.__importDefault || function(mod) {
      return mod && mod.__esModule ? mod : { "default": mod };
    };
    var events_1 = __require("events");
    var debug_1 = __importDefault2(require_src3());
    var promisify_1 = __importDefault2(require_promisify());
    var debug2 = debug_1.default("agent-base");
    function isAgent2(v8) {
      return Boolean(v8) && typeof v8.addRequest === "function";
    }
    __name(isAgent2, "isAgent");
    function isSecureEndpoint() {
      const { stack } = new Error();
      if (typeof stack !== "string")
        return false;
      return stack.split("\n").some((l8) => l8.indexOf("(https.js:") !== -1 || l8.indexOf("node:https:") !== -1);
    }
    __name(isSecureEndpoint, "isSecureEndpoint");
    function createAgent(callback, opts) {
      return new createAgent.Agent(callback, opts);
    }
    __name(createAgent, "createAgent");
    (function(createAgent2) {
      class Agent extends events_1.EventEmitter {
        static {
          __name(this, "Agent");
        }
        constructor(callback, _opts) {
          super();
          let opts = _opts;
          if (typeof callback === "function") {
            this.callback = callback;
          } else if (callback) {
            opts = callback;
          }
          this.timeout = null;
          if (opts && typeof opts.timeout === "number") {
            this.timeout = opts.timeout;
          }
          this.maxFreeSockets = 1;
          this.maxSockets = 1;
          this.maxTotalSockets = Infinity;
          this.sockets = {};
          this.freeSockets = {};
          this.requests = {};
          this.options = {};
        }
        get defaultPort() {
          if (typeof this.explicitDefaultPort === "number") {
            return this.explicitDefaultPort;
          }
          return isSecureEndpoint() ? 443 : 80;
        }
        set defaultPort(v8) {
          this.explicitDefaultPort = v8;
        }
        get protocol() {
          if (typeof this.explicitProtocol === "string") {
            return this.explicitProtocol;
          }
          return isSecureEndpoint() ? "https:" : "http:";
        }
        set protocol(v8) {
          this.explicitProtocol = v8;
        }
        callback(req, opts, fn2) {
          throw new Error('"agent-base" has no default implementation, you must subclass and override `callback()`');
        }
        /**
         * Called by node-core's "_http_client.js" module when creating
         * a new HTTP request with this Agent instance.
         *
         * @api public
         */
        addRequest(req, _opts) {
          const opts = Object.assign({}, _opts);
          if (typeof opts.secureEndpoint !== "boolean") {
            opts.secureEndpoint = isSecureEndpoint();
          }
          if (opts.host == null) {
            opts.host = "localhost";
          }
          if (opts.port == null) {
            opts.port = opts.secureEndpoint ? 443 : 80;
          }
          if (opts.protocol == null) {
            opts.protocol = opts.secureEndpoint ? "https:" : "http:";
          }
          if (opts.host && opts.path) {
            delete opts.path;
          }
          delete opts.agent;
          delete opts.hostname;
          delete opts._defaultAgent;
          delete opts.defaultPort;
          delete opts.createConnection;
          req._last = true;
          req.shouldKeepAlive = false;
          let timedOut = false;
          let timeoutId = null;
          const timeoutMs = opts.timeout || this.timeout;
          const onerror = /* @__PURE__ */ __name((err) => {
            if (req._hadError)
              return;
            req.emit("error", err);
            req._hadError = true;
          }, "onerror");
          const ontimeout = /* @__PURE__ */ __name(() => {
            timeoutId = null;
            timedOut = true;
            const err = new Error(`A "socket" was not created for HTTP request before ${timeoutMs}ms`);
            err.code = "ETIMEOUT";
            onerror(err);
          }, "ontimeout");
          const callbackError = /* @__PURE__ */ __name((err) => {
            if (timedOut)
              return;
            if (timeoutId !== null) {
              clearTimeout(timeoutId);
              timeoutId = null;
            }
            onerror(err);
          }, "callbackError");
          const onsocket = /* @__PURE__ */ __name((socket) => {
            if (timedOut)
              return;
            if (timeoutId != null) {
              clearTimeout(timeoutId);
              timeoutId = null;
            }
            if (isAgent2(socket)) {
              debug2("Callback returned another Agent instance %o", socket.constructor.name);
              socket.addRequest(req, opts);
              return;
            }
            if (socket) {
              socket.once("free", () => {
                this.freeSocket(socket, opts);
              });
              req.onSocket(socket);
              return;
            }
            const err = new Error(`no Duplex stream was returned to agent-base for \`${req.method} ${req.path}\``);
            onerror(err);
          }, "onsocket");
          if (typeof this.callback !== "function") {
            onerror(new Error("`callback` is not defined"));
            return;
          }
          if (!this.promisifiedCallback) {
            if (this.callback.length >= 3) {
              debug2("Converting legacy callback function to promise");
              this.promisifiedCallback = promisify_1.default(this.callback);
            } else {
              this.promisifiedCallback = this.callback;
            }
          }
          if (typeof timeoutMs === "number" && timeoutMs > 0) {
            timeoutId = setTimeout(ontimeout, timeoutMs);
          }
          if ("port" in opts && typeof opts.port !== "number") {
            opts.port = Number(opts.port);
          }
          try {
            debug2("Resolving socket for %o request: %o", opts.protocol, `${req.method} ${req.path}`);
            Promise.resolve(this.promisifiedCallback(req, opts)).then(onsocket, callbackError);
          } catch (err) {
            Promise.reject(err).catch(callbackError);
          }
        }
        freeSocket(socket, opts) {
          debug2("Freeing socket %o %o", socket.constructor.name, opts);
          socket.destroy();
        }
        destroy() {
          debug2("Destroying agent %o", this.constructor.name);
        }
      }
      createAgent2.Agent = Agent;
      createAgent2.prototype = createAgent2.Agent.prototype;
    })(createAgent || (createAgent = {}));
    module2.exports = createAgent;
  }
});

// ../../node_modules/.pnpm/https-proxy-agent@5.0.1_supports-color@9.2.2/node_modules/https-proxy-agent/dist/parse-proxy-response.js
var require_parse_proxy_response = __commonJS({
  "../../node_modules/.pnpm/https-proxy-agent@5.0.1_supports-color@9.2.2/node_modules/https-proxy-agent/dist/parse-proxy-response.js"(exports) {
    init_import_meta_url();
    var __importDefault2 = exports && exports.__importDefault || function(mod) {
      return mod && mod.__esModule ? mod : { "default": mod };
    };
    Object.defineProperty(exports, "__esModule", { value: true });
    var debug_1 = __importDefault2(require_src3());
    var debug2 = debug_1.default("https-proxy-agent:parse-proxy-response");
    function parseProxyResponse(socket) {
      return new Promise((resolve32, reject) => {
        let buffersLength = 0;
        const buffers = [];
        function read2() {
          const b11 = socket.read();
          if (b11)
            ondata(b11);
          else
            socket.once("readable", read2);
        }
        __name(read2, "read");
        function cleanup() {
          socket.removeListener("end", onend);
          socket.removeListener("error", onerror);
          socket.removeListener("close", onclose);
          socket.removeListener("readable", read2);
        }
        __name(cleanup, "cleanup");
        function onclose(err) {
          debug2("onclose had error %o", err);
        }
        __name(onclose, "onclose");
        function onend() {
          debug2("onend");
        }
        __name(onend, "onend");
        function onerror(err) {
          cleanup();
          debug2("onerror %o", err);
          reject(err);
        }
        __name(onerror, "onerror");
        function ondata(b11) {
          buffers.push(b11);
          buffersLength += b11.length;
          const buffered = Buffer.concat(buffers, buffersLength);
          const endOfHeaders = buffered.indexOf("\r\n\r\n");
          if (endOfHeaders === -1) {
            debug2("have not received end of HTTP headers yet...");
            read2();
            return;
          }
          const firstLine = buffered.toString("ascii", 0, buffered.indexOf("\r\n"));
          const statusCode = +firstLine.split(" ")[1];
          debug2("got proxy server response: %o", firstLine);
          resolve32({
            statusCode,
            buffered
          });
        }
        __name(ondata, "ondata");
        socket.on("error", onerror);
        socket.on("close", onclose);
        socket.on("end", onend);
        read2();
      });
    }
    __name(parseProxyResponse, "parseProxyResponse");
    exports.default = parseProxyResponse;
  }
});

// ../../node_modules/.pnpm/https-proxy-agent@5.0.1_supports-color@9.2.2/node_modules/https-proxy-agent/dist/agent.js
var require_agent3 = __commonJS({
  "../../node_modules/.pnpm/https-proxy-agent@5.0.1_supports-color@9.2.2/node_modules/https-proxy-agent/dist/agent.js"(exports) {
    init_import_meta_url();
    var __awaiter2 = exports && exports.__awaiter || function(thisArg, _arguments, P4, generator) {
      function adopt(value) {
        return value instanceof P4 ? value : new P4(function(resolve32) {
          resolve32(value);
        });
      }
      __name(adopt, "adopt");
      return new (P4 || (P4 = Promise))(function(resolve32, reject) {
        function fulfilled(value) {
          try {
            step(generator.next(value));
          } catch (e10) {
            reject(e10);
          }
        }
        __name(fulfilled, "fulfilled");
        function rejected(value) {
          try {
            step(generator["throw"](value));
          } catch (e10) {
            reject(e10);
          }
        }
        __name(rejected, "rejected");
        function step(result) {
          result.done ? resolve32(result.value) : adopt(result.value).then(fulfilled, rejected);
        }
        __name(step, "step");
        step((generator = generator.apply(thisArg, _arguments || [])).next());
      });
    };
    var __importDefault2 = exports && exports.__importDefault || function(mod) {
      return mod && mod.__esModule ? mod : { "default": mod };
    };
    Object.defineProperty(exports, "__esModule", { value: true });
    var net_1 = __importDefault2(__require("net"));
    var tls_1 = __importDefault2(__require("tls"));
    var url_1 = __importDefault2(__require("url"));
    var assert_1 = __importDefault2(__require("assert"));
    var debug_1 = __importDefault2(require_src3());
    var agent_base_1 = require_src4();
    var parse_proxy_response_1 = __importDefault2(require_parse_proxy_response());
    var debug2 = debug_1.default("https-proxy-agent:agent");
    var HttpsProxyAgent3 = class extends agent_base_1.Agent {
      static {
        __name(this, "HttpsProxyAgent");
      }
      constructor(_opts) {
        let opts;
        if (typeof _opts === "string") {
          opts = url_1.default.parse(_opts);
        } else {
          opts = _opts;
        }
        if (!opts) {
          throw new Error("an HTTP(S) proxy server `host` and `port` must be specified!");
        }
        debug2("creating new HttpsProxyAgent instance: %o", opts);
        super(opts);
        const proxy2 = Object.assign({}, opts);
        this.secureProxy = opts.secureProxy || isHTTPS(proxy2.protocol);
        proxy2.host = proxy2.hostname || proxy2.host;
        if (typeof proxy2.port === "string") {
          proxy2.port = parseInt(proxy2.port, 10);
        }
        if (!proxy2.port && proxy2.host) {
          proxy2.port = this.secureProxy ? 443 : 80;
        }
        if (this.secureProxy && !("ALPNProtocols" in proxy2)) {
          proxy2.ALPNProtocols = ["http 1.1"];
        }
        if (proxy2.host && proxy2.path) {
          delete proxy2.path;
          delete proxy2.pathname;
        }
        this.proxy = proxy2;
      }
      /**
       * Called when the node-core HTTP client library is creating a
       * new HTTP request.
       *
       * @api protected
       */
      callback(req, opts) {
        return __awaiter2(this, void 0, void 0, function* () {
          const { proxy: proxy2, secureProxy } = this;
          let socket;
          if (secureProxy) {
            debug2("Creating `tls.Socket`: %o", proxy2);
            socket = tls_1.default.connect(proxy2);
          } else {
            debug2("Creating `net.Socket`: %o", proxy2);
            socket = net_1.default.connect(proxy2);
          }
          const headers = Object.assign({}, proxy2.headers);
          const hostname2 = `${opts.host}:${opts.port}`;
          let payload = `CONNECT ${hostname2} HTTP/1.1\r
`;
          if (proxy2.auth) {
            headers["Proxy-Authorization"] = `Basic ${Buffer.from(proxy2.auth).toString("base64")}`;
          }
          let { host, port, secureEndpoint } = opts;
          if (!isDefaultPort(port, secureEndpoint)) {
            host += `:${port}`;
          }
          headers.Host = host;
          headers.Connection = "close";
          for (const name2 of Object.keys(headers)) {
            payload += `${name2}: ${headers[name2]}\r
`;
          }
          const proxyResponsePromise = parse_proxy_response_1.default(socket);
          socket.write(`${payload}\r
`);
          const { statusCode, buffered } = yield proxyResponsePromise;
          if (statusCode === 200) {
            req.once("socket", resume);
            if (opts.secureEndpoint) {
              debug2("Upgrading socket connection to TLS");
              const servername = opts.servername || opts.host;
              return tls_1.default.connect(Object.assign(Object.assign({}, omit(opts, "host", "hostname", "path", "port")), {
                socket,
                servername
              }));
            }
            return socket;
          }
          socket.destroy();
          const fakeSocket = new net_1.default.Socket({ writable: false });
          fakeSocket.readable = true;
          req.once("socket", (s7) => {
            debug2("replaying proxy buffer for failed request");
            assert_1.default(s7.listenerCount("data") > 0);
            s7.push(buffered);
            s7.push(null);
          });
          return fakeSocket;
        });
      }
    };
    exports.default = HttpsProxyAgent3;
    function resume(socket) {
      socket.resume();
    }
    __name(resume, "resume");
    function isDefaultPort(port, secure) {
      return Boolean(!secure && port === 80 || secure && port === 443);
    }
    __name(isDefaultPort, "isDefaultPort");
    function isHTTPS(protocol) {
      return typeof protocol === "string" ? /^https:?$/i.test(protocol) : false;
    }
    __name(isHTTPS, "isHTTPS");
    function omit(obj, ...keys) {
      const ret = {};
      let key;
      for (key in obj) {
        if (!keys.includes(key)) {
          ret[key] = obj[key];
        }
      }
      return ret;
    }
    __name(omit, "omit");
  }
});

// ../../node_modules/.pnpm/https-proxy-agent@5.0.1_supports-color@9.2.2/node_modules/https-proxy-agent/dist/index.js
var require_dist4 = __commonJS({
  "../../node_modules/.pnpm/https-proxy-agent@5.0.1_supports-color@9.2.2/node_modules/https-proxy-agent/dist/index.js"(exports, module2) {
    init_import_meta_url();
    var __importDefault2 = exports && exports.__importDefault || function(mod) {
      return mod && mod.__esModule ? mod : { "default": mod };
    };
    var agent_1 = __importDefault2(require_agent3());
    function createHttpsProxyAgent(opts) {
      return new agent_1.default(opts);
    }
    __name(createHttpsProxyAgent, "createHttpsProxyAgent");
    (function(createHttpsProxyAgent2) {
      createHttpsProxyAgent2.HttpsProxyAgent = agent_1.default;
      createHttpsProxyAgent2.prototype = agent_1.default.prototype;
    })(createHttpsProxyAgent || (createHttpsProxyAgent = {}));
    module2.exports = createHttpsProxyAgent;
  }
});
function streamFromBody(body) {
  return new Stream.Readable({
    read() {
      this.push(body);
      this.push(null);
    }
  });
}
function makeNodeTransport(options) {
  let urlSegments;
  try {
    urlSegments = new Url.URL(options.url);
  } catch (e10) {
    consoleSandbox(() => {
      console.warn(
        "[@sentry/node]: Invalid dsn or tunnel option, will not send any events. The tunnel option must be a full URL when used."
      );
    });
    return createTransport(options, () => Promise.resolve({}));
  }
  const isHttps = urlSegments.protocol === "https:";
  const proxy2 = applyNoProxyOption(
    urlSegments,
    options.proxy || (isHttps ? process.env.https_proxy : void 0) || process.env.http_proxy
  );
  const nativeHttpModule = isHttps ? https__namespace : http__namespace;
  const keepAlive = options.keepAlive === void 0 ? false : options.keepAlive;
  const agent = proxy2 ? new import_https_proxy_agent.HttpsProxyAgent(proxy2) : new nativeHttpModule.Agent({ keepAlive, maxSockets: 30, timeout: 2e3 });
  const requestExecutor = createRequestExecutor(options, _nullishCoalesce(options.httpModule, () => nativeHttpModule), agent);
  return createTransport(options, requestExecutor);
}
function applyNoProxyOption(transportUrlSegments, proxy2) {
  const { no_proxy } = process.env;
  const urlIsExemptFromProxy = no_proxy && no_proxy.split(",").some(
    (exemption) => transportUrlSegments.host.endsWith(exemption) || transportUrlSegments.hostname.endsWith(exemption)
  );
  if (urlIsExemptFromProxy) {
    return void 0;
  } else {
    return proxy2;
  }
}
function createRequestExecutor(options, httpModule, agent) {
  const { hostname: hostname2, pathname, port, protocol, search } = new Url.URL(options.url);
  return /* @__PURE__ */ __name(function makeRequest(request4) {
    return new Promise((resolve32, reject) => {
      let body = streamFromBody(request4.body);
      const headers = { ...options.headers };
      if (request4.body.length > GZIP_THRESHOLD) {
        headers["content-encoding"] = "gzip";
        body = body.pipe(zlib.createGzip());
      }
      const req = httpModule.request(
        {
          method: "POST",
          agent,
          headers,
          hostname: hostname2,
          path: `${pathname}${search}`,
          port,
          protocol,
          ca: options.caCerts
        },
        (res) => {
          res.on("data", () => {
          });
          res.on("end", () => {
          });
          res.setEncoding("utf8");
          const retryAfterHeader = _nullishCoalesce(res.headers["retry-after"], () => null);
          const rateLimitsHeader = _nullishCoalesce(res.headers["x-sentry-rate-limits"], () => null);
          resolve32({
            statusCode: res.statusCode,
            headers: {
              "retry-after": retryAfterHeader,
              "x-sentry-rate-limits": Array.isArray(rateLimitsHeader) ? rateLimitsHeader[0] : rateLimitsHeader
            }
          });
        }
      );
      req.on("error", reject);
      body.pipe(req);
    });
  }, "makeRequest");
}
var import_https_proxy_agent, GZIP_THRESHOLD;
var init_http2 = __esm({
  "../../node_modules/.pnpm/@sentry+node@7.87.0_supports-color@9.2.2/node_modules/@sentry/node/esm/transports/http.js"() {
    init_import_meta_url();
    init_esm7();
    init_esm8();
    init_esm7();
    import_https_proxy_agent = __toESM(require_dist4());
    GZIP_THRESHOLD = 1024 * 32;
    __name(streamFromBody, "streamFromBody");
    __name(makeNodeTransport, "makeNodeTransport");
    __name(applyNoProxyOption, "applyNoProxyOption");
    __name(createRequestExecutor, "createRequestExecutor");
  }
});
function normalizeWindowsPath(path84) {
  return path84.replace(/^[A-Z]:/, "").replace(/\\/g, "/");
}
function getModuleFromFilename(filename, normalizeWindowsPathSeparator = isWindowsPlatform) {
  if (!filename) {
    return;
  }
  const normalizedFilename = normalizeWindowsPathSeparator ? normalizeWindowsPath(filename) : filename;
  let { root, dir: dir2, base: basename11, ext: ext2 } = path3.posix.parse(normalizedFilename);
  const base = __require && __require.main && __require.main.filename && dir2 || global.process.cwd();
  const normalizedBase = `${base}/`;
  let file3 = basename11;
  if (ext2 === ".js" || ext2 === ".mjs" || ext2 === ".cjs") {
    file3 = file3.slice(0, ext2.length * -1);
  }
  if (!root && !dir2) {
    dir2 = ".";
  }
  let n9 = dir2.lastIndexOf("/node_modules/");
  if (n9 > -1) {
    return `${dir2.slice(n9 + 14).replace(/\//g, ".")}:${file3}`;
  }
  n9 = `${dir2}/`.lastIndexOf(normalizedBase, 0);
  if (n9 === 0) {
    let moduleName = dir2.slice(normalizedBase.length).replace(/\//g, ".");
    if (moduleName) {
      moduleName += ":";
    }
    moduleName += file3;
    return moduleName;
  }
  return file3;
}
var isWindowsPlatform;
var init_module = __esm({
  "../../node_modules/.pnpm/@sentry+node@7.87.0_supports-color@9.2.2/node_modules/@sentry/node/esm/module.js"() {
    init_import_meta_url();
    isWindowsPlatform = path3.sep === "\\";
    __name(normalizeWindowsPath, "normalizeWindowsPath");
    __name(getModuleFromFilename, "getModuleFromFilename");
  }
});

// ../../node_modules/.pnpm/@sentry+node@7.87.0_supports-color@9.2.2/node_modules/@sentry/node/esm/anr/index.js
function isAnrChildProcess() {
  return !!process.send && !!process.env.SENTRY_ANR_CHILD_PROCESS;
}
var init_anr = __esm({
  "../../node_modules/.pnpm/@sentry+node@7.87.0_supports-color@9.2.2/node_modules/@sentry/node/esm/anr/index.js"() {
    init_import_meta_url();
    __name(isAnrChildProcess, "isAnrChildProcess");
  }
});

// ../../node_modules/.pnpm/@sentry+node@7.87.0_supports-color@9.2.2/node_modules/@sentry/node/esm/nodeVersion.js
var NODE_VERSION;
var init_nodeVersion = __esm({
  "../../node_modules/.pnpm/@sentry+node@7.87.0_supports-color@9.2.2/node_modules/@sentry/node/esm/nodeVersion.js"() {
    init_import_meta_url();
    init_esm7();
    NODE_VERSION = parseSemver(process.versions.node);
  }
});
function getActiveDomain() {
  return domain__namespace.active;
}
function getCurrentHub2() {
  const activeDomain = getActiveDomain();
  if (!activeDomain) {
    return void 0;
  }
  ensureHubOnCarrier(activeDomain);
  return getHubFromCarrier(activeDomain);
}
function createNewHub(parent) {
  const carrier = {};
  ensureHubOnCarrier(carrier, parent);
  return getHubFromCarrier(carrier);
}
function runWithAsyncContext2(callback, options) {
  const activeDomain = getActiveDomain();
  if (activeDomain && _optionalChain([options, "optionalAccess", (_5) => _5.reuseExisting])) {
    return callback();
  }
  const local = domain__namespace.create();
  const parentHub = activeDomain ? getHubFromCarrier(activeDomain) : void 0;
  const newHub = createNewHub(parentHub);
  setHubOnCarrier(local, newHub);
  return local.bind(() => {
    return callback();
  })();
}
function setDomainAsyncContextStrategy() {
  setAsyncContextStrategy({ getCurrentHub: getCurrentHub2, runWithAsyncContext: runWithAsyncContext2 });
}
var init_domain2 = __esm({
  "../../node_modules/.pnpm/@sentry+node@7.87.0_supports-color@9.2.2/node_modules/@sentry/node/esm/async/domain.js"() {
    init_import_meta_url();
    init_esm7();
    init_esm8();
    __name(getActiveDomain, "getActiveDomain");
    __name(getCurrentHub2, "getCurrentHub");
    __name(createNewHub, "createNewHub");
    __name(runWithAsyncContext2, "runWithAsyncContext");
    __name(setDomainAsyncContextStrategy, "setDomainAsyncContextStrategy");
  }
});
function setHooksAsyncContextStrategy() {
  if (!asyncStorage) {
    asyncStorage = new async_hooks__namespace.AsyncLocalStorage();
  }
  function getCurrentHub3() {
    return asyncStorage.getStore();
  }
  __name(getCurrentHub3, "getCurrentHub");
  function createNewHub2(parent) {
    const carrier = {};
    ensureHubOnCarrier(carrier, parent);
    return getHubFromCarrier(carrier);
  }
  __name(createNewHub2, "createNewHub");
  function runWithAsyncContext3(callback, options) {
    const existingHub = getCurrentHub3();
    if (existingHub && _optionalChain([options, "optionalAccess", (_5) => _5.reuseExisting])) {
      return callback();
    }
    const newHub = createNewHub2(existingHub);
    return asyncStorage.run(newHub, () => {
      return callback();
    });
  }
  __name(runWithAsyncContext3, "runWithAsyncContext");
  setAsyncContextStrategy({ getCurrentHub: getCurrentHub3, runWithAsyncContext: runWithAsyncContext3 });
}
var asyncStorage;
var init_hooks = __esm({
  "../../node_modules/.pnpm/@sentry+node@7.87.0_supports-color@9.2.2/node_modules/@sentry/node/esm/async/hooks.js"() {
    init_import_meta_url();
    init_esm7();
    init_esm8();
    __name(setHooksAsyncContextStrategy, "setHooksAsyncContextStrategy");
  }
});

// ../../node_modules/.pnpm/@sentry+node@7.87.0_supports-color@9.2.2/node_modules/@sentry/node/esm/async/index.js
function setNodeAsyncContextStrategy() {
  if (NODE_VERSION.major && NODE_VERSION.major >= 14) {
    setHooksAsyncContextStrategy();
  } else {
    setDomainAsyncContextStrategy();
  }
}
var init_async = __esm({
  "../../node_modules/.pnpm/@sentry+node@7.87.0_supports-color@9.2.2/node_modules/@sentry/node/esm/async/index.js"() {
    init_import_meta_url();
    init_nodeVersion();
    init_domain2();
    init_hooks();
    __name(setNodeAsyncContextStrategy, "setNodeAsyncContextStrategy");
  }
});
var Console;
var init_console2 = __esm({
  "../../node_modules/.pnpm/@sentry+node@7.87.0_supports-color@9.2.2/node_modules/@sentry/node/esm/integrations/console.js"() {
    init_import_meta_url();
    init_esm8();
    init_esm7();
    Console = class _Console {
      static {
        __name(this, "Console");
      }
      constructor() {
        _Console.prototype.__init.call(this);
      }
      /**
       * @inheritDoc
       */
      static __initStatic() {
        this.id = "Console";
      }
      /**
       * @inheritDoc
       */
      __init() {
        this.name = _Console.id;
      }
      /**
       * @inheritDoc
       */
      setupOnce() {
        addConsoleInstrumentationHandler(({ args, level }) => {
          const hub = getCurrentHub();
          if (!hub.getIntegration(_Console)) {
            return;
          }
          hub.addBreadcrumb(
            {
              category: "console",
              level: severityLevelFromString(level),
              message: util4__namespace.format.apply(void 0, args)
            },
            {
              input: [...args],
              level
            }
          );
        });
      }
    };
    Console.__initStatic();
  }
});

// ../../node_modules/.pnpm/@sentry+node@7.87.0_supports-color@9.2.2/node_modules/@sentry/node/esm/debug-build.js
var DEBUG_BUILD4;
var init_debug_build4 = __esm({
  "../../node_modules/.pnpm/@sentry+node@7.87.0_supports-color@9.2.2/node_modules/@sentry/node/esm/debug-build.js"() {
    init_import_meta_url();
    DEBUG_BUILD4 = typeof __SENTRY_DEBUG__ === "undefined" || __SENTRY_DEBUG__;
  }
});
function extractRawUrl(requestOptions) {
  const { protocol, hostname: hostname2, port } = parseRequestOptions(requestOptions);
  const path84 = requestOptions.path ? requestOptions.path : "/";
  return `${protocol}//${hostname2}${port}${path84}`;
}
function extractUrl(requestOptions) {
  const { protocol, hostname: hostname2, port } = parseRequestOptions(requestOptions);
  const path84 = requestOptions.pathname || "/";
  const authority = requestOptions.auth ? redactAuthority(requestOptions.auth) : "";
  return `${protocol}//${authority}${hostname2}${port}${path84}`;
}
function redactAuthority(auth) {
  const [user, password] = auth.split(":");
  return `${user ? "[Filtered]" : ""}:${password ? "[Filtered]" : ""}@`;
}
function cleanSpanDescription(description, requestOptions, request4) {
  if (!description) {
    return description;
  }
  let [method, requestUrl] = description.split(" ");
  if (requestOptions.host && !requestOptions.protocol) {
    requestOptions.protocol = _optionalChain([request4, "optionalAccess", (_5) => _5.agent, "optionalAccess", (_22) => _22.protocol]);
    requestUrl = extractUrl(requestOptions);
  }
  if (_optionalChain([requestUrl, "optionalAccess", (_32) => _32.startsWith, "call", (_42) => _42("///")])) {
    requestUrl = requestUrl.slice(2);
  }
  return `${method} ${requestUrl}`;
}
function urlToOptions(url4) {
  const options = {
    protocol: url4.protocol,
    hostname: typeof url4.hostname === "string" && url4.hostname.startsWith("[") ? url4.hostname.slice(1, -1) : url4.hostname,
    hash: url4.hash,
    search: url4.search,
    pathname: url4.pathname,
    path: `${url4.pathname || ""}${url4.search || ""}`,
    href: url4.href
  };
  if (url4.port !== "") {
    options.port = Number(url4.port);
  }
  if (url4.username || url4.password) {
    options.auth = `${url4.username}:${url4.password}`;
  }
  return options;
}
function normalizeRequestArgs(httpModule, requestArgs) {
  let callback, requestOptions;
  if (typeof requestArgs[requestArgs.length - 1] === "function") {
    callback = requestArgs.pop();
  }
  if (typeof requestArgs[0] === "string") {
    requestOptions = urlToOptions(new Url.URL(requestArgs[0]));
  } else if (requestArgs[0] instanceof Url.URL) {
    requestOptions = urlToOptions(requestArgs[0]);
  } else {
    requestOptions = requestArgs[0];
    try {
      const parsed = new Url.URL(
        requestOptions.path || "",
        `${requestOptions.protocol || "http:"}//${requestOptions.hostname}`
      );
      requestOptions = {
        pathname: parsed.pathname,
        search: parsed.search,
        hash: parsed.hash,
        ...requestOptions
      };
    } catch (e10) {
    }
  }
  if (requestArgs.length === 2) {
    requestOptions = { ...requestOptions, ...requestArgs[1] };
  }
  if (requestOptions.protocol === void 0) {
    if (NODE_VERSION.major && NODE_VERSION.major > 8) {
      requestOptions.protocol = _optionalChain([_optionalChain([httpModule, "optionalAccess", (_5) => _5.globalAgent]), "optionalAccess", (_6) => _6.protocol]) || _optionalChain([requestOptions.agent, "optionalAccess", (_7) => _7.protocol]) || _optionalChain([requestOptions._defaultAgent, "optionalAccess", (_8) => _8.protocol]);
    } else {
      requestOptions.protocol = _optionalChain([requestOptions.agent, "optionalAccess", (_9) => _9.protocol]) || _optionalChain([requestOptions._defaultAgent, "optionalAccess", (_10) => _10.protocol]) || _optionalChain([_optionalChain([httpModule, "optionalAccess", (_11) => _11.globalAgent]), "optionalAccess", (_12) => _12.protocol]);
    }
  }
  if (callback) {
    return [requestOptions, callback];
  } else {
    return [requestOptions];
  }
}
function parseRequestOptions(requestOptions) {
  const protocol = requestOptions.protocol || "";
  const hostname2 = requestOptions.hostname || requestOptions.host || "";
  const port = !requestOptions.port || requestOptions.port === 80 || requestOptions.port === 443 || /^(.*):(\d+)$/.test(hostname2) ? "" : `:${requestOptions.port}`;
  return { protocol, hostname: hostname2, port };
}
var init_http3 = __esm({
  "../../node_modules/.pnpm/@sentry+node@7.87.0_supports-color@9.2.2/node_modules/@sentry/node/esm/integrations/utils/http.js"() {
    init_import_meta_url();
    init_esm7();
    init_nodeVersion();
    __name(extractRawUrl, "extractRawUrl");
    __name(extractUrl, "extractUrl");
    __name(redactAuthority, "redactAuthority");
    __name(cleanSpanDescription, "cleanSpanDescription");
    __name(urlToOptions, "urlToOptions");
    __name(normalizeRequestArgs, "normalizeRequestArgs");
    __name(parseRequestOptions, "parseRequestOptions");
  }
});

// ../../node_modules/.pnpm/@sentry+node@7.87.0_supports-color@9.2.2/node_modules/@sentry/node/esm/integrations/http.js
function _createWrappedRequestMethodFactory(httpModule, breadcrumbsEnabled, shouldCreateSpanForRequest, tracePropagationTargets) {
  const createSpanUrlMap = new LRUMap(100);
  const headersUrlMap = new LRUMap(100);
  const shouldCreateSpan = /* @__PURE__ */ __name((url4) => {
    if (shouldCreateSpanForRequest === void 0) {
      return true;
    }
    const cachedDecision = createSpanUrlMap.get(url4);
    if (cachedDecision !== void 0) {
      return cachedDecision;
    }
    const decision = shouldCreateSpanForRequest(url4);
    createSpanUrlMap.set(url4, decision);
    return decision;
  }, "shouldCreateSpan");
  const shouldAttachTraceData = /* @__PURE__ */ __name((url4) => {
    if (tracePropagationTargets === void 0) {
      return true;
    }
    const cachedDecision = headersUrlMap.get(url4);
    if (cachedDecision !== void 0) {
      return cachedDecision;
    }
    const decision = stringMatchesSomePattern(url4, tracePropagationTargets);
    headersUrlMap.set(url4, decision);
    return decision;
  }, "shouldAttachTraceData");
  function addRequestBreadcrumb(event, requestSpanData, req, res) {
    if (!getCurrentHub().getIntegration(Http)) {
      return;
    }
    getCurrentHub().addBreadcrumb(
      {
        category: "http",
        data: {
          status_code: res && res.statusCode,
          ...requestSpanData
        },
        type: "http"
      },
      {
        event,
        request: req,
        response: res
      }
    );
  }
  __name(addRequestBreadcrumb, "addRequestBreadcrumb");
  return /* @__PURE__ */ __name(function wrappedRequestMethodFactory(originalRequestMethod) {
    return /* @__PURE__ */ __name(function wrappedMethod(...args) {
      const requestArgs = normalizeRequestArgs(httpModule, args);
      const requestOptions = requestArgs[0];
      const rawRequestUrl = extractRawUrl(requestOptions);
      const requestUrl = extractUrl(requestOptions);
      if (isSentryRequestUrl(requestUrl, getCurrentHub())) {
        return originalRequestMethod.apply(httpModule, requestArgs);
      }
      const hub = getCurrentHub();
      const scope = hub.getScope();
      const parentSpan = scope.getSpan();
      const data = getRequestSpanData(requestUrl, requestOptions);
      const requestSpan = shouldCreateSpan(rawRequestUrl) ? _optionalChain([parentSpan, "optionalAccess", (_12) => _12.startChild, "call", (_13) => _13({
        op: "http.client",
        origin: "auto.http.node.http",
        description: `${data["http.method"]} ${data.url}`,
        data
      })]) : void 0;
      if (shouldAttachTraceData(rawRequestUrl)) {
        if (requestSpan) {
          const sentryTraceHeader = requestSpan.toTraceparent();
          const dynamicSamplingContext = _optionalChain([requestSpan, "optionalAccess", (_14) => _14.transaction, "optionalAccess", (_15) => _15.getDynamicSamplingContext, "call", (_16) => _16()]);
          addHeadersToRequestOptions(requestOptions, requestUrl, sentryTraceHeader, dynamicSamplingContext);
        } else {
          const client = hub.getClient();
          const { traceId, sampled, dsc } = scope.getPropagationContext();
          const sentryTraceHeader = generateSentryTraceHeader(traceId, void 0, sampled);
          const dynamicSamplingContext = dsc || (client ? getDynamicSamplingContextFromClient(traceId, client, scope) : void 0);
          addHeadersToRequestOptions(requestOptions, requestUrl, sentryTraceHeader, dynamicSamplingContext);
        }
      } else {
        DEBUG_BUILD4 && logger2.log(
          `[Tracing] Not adding sentry-trace header to outgoing request (${requestUrl}) due to mismatching tracePropagationTargets option.`
        );
      }
      return originalRequestMethod.apply(httpModule, requestArgs).once("response", function(res) {
        const req = this;
        if (breadcrumbsEnabled) {
          addRequestBreadcrumb("response", data, req, res);
        }
        if (requestSpan) {
          if (res.statusCode) {
            requestSpan.setHttpStatus(res.statusCode);
          }
          requestSpan.description = cleanSpanDescription(requestSpan.description, requestOptions, req);
          requestSpan.finish();
        }
      }).once("error", function() {
        const req = this;
        if (breadcrumbsEnabled) {
          addRequestBreadcrumb("error", data, req);
        }
        if (requestSpan) {
          requestSpan.setHttpStatus(500);
          requestSpan.description = cleanSpanDescription(requestSpan.description, requestOptions, req);
          requestSpan.finish();
        }
      });
    }, "wrappedMethod");
  }, "wrappedRequestMethodFactory");
}
function addHeadersToRequestOptions(requestOptions, requestUrl, sentryTraceHeader, dynamicSamplingContext) {
  const headers = requestOptions.headers || {};
  if (headers["sentry-trace"]) {
    return;
  }
  DEBUG_BUILD4 && logger2.log(`[Tracing] Adding sentry-trace header ${sentryTraceHeader} to outgoing request to "${requestUrl}": `);
  const sentryBaggage = dynamicSamplingContextToSentryBaggageHeader(dynamicSamplingContext);
  const sentryBaggageHeader = sentryBaggage && sentryBaggage.length > 0 ? normalizeBaggageHeader(requestOptions, sentryBaggage) : void 0;
  requestOptions.headers = {
    ...requestOptions.headers,
    "sentry-trace": sentryTraceHeader,
    // Setting a header to `undefined` will crash in node so we only set the baggage header when it's defined
    ...sentryBaggageHeader && { baggage: sentryBaggageHeader }
  };
}
function getRequestSpanData(requestUrl, requestOptions) {
  const method = requestOptions.method || "GET";
  const data = {
    url: requestUrl,
    "http.method": method
  };
  if (requestOptions.hash) {
    data["http.fragment"] = requestOptions.hash.substring(1);
  }
  if (requestOptions.search) {
    data["http.query"] = requestOptions.search.substring(1);
  }
  return data;
}
function normalizeBaggageHeader(requestOptions, sentryBaggageHeader) {
  if (!requestOptions.headers || !requestOptions.headers.baggage) {
    return sentryBaggageHeader;
  } else if (!sentryBaggageHeader) {
    return requestOptions.headers.baggage;
  } else if (Array.isArray(requestOptions.headers.baggage)) {
    return [...requestOptions.headers.baggage, sentryBaggageHeader];
  }
  return [requestOptions.headers.baggage, sentryBaggageHeader];
}
var Http;
var init_http4 = __esm({
  "../../node_modules/.pnpm/@sentry+node@7.87.0_supports-color@9.2.2/node_modules/@sentry/node/esm/integrations/http.js"() {
    init_import_meta_url();
    init_esm7();
    init_esm8();
    init_esm7();
    init_debug_build4();
    init_nodeVersion();
    init_http3();
    Http = class _Http {
      static {
        __name(this, "Http");
      }
      /**
       * @inheritDoc
       */
      static __initStatic() {
        this.id = "Http";
      }
      /**
       * @inheritDoc
       */
      __init() {
        this.name = _Http.id;
      }
      /**
       * @inheritDoc
       */
      constructor(options = {}) {
        _Http.prototype.__init.call(this);
        this._breadcrumbs = typeof options.breadcrumbs === "undefined" ? true : options.breadcrumbs;
        this._tracing = !options.tracing ? void 0 : options.tracing === true ? {} : options.tracing;
      }
      /**
       * @inheritDoc
       */
      setupOnce(_addGlobalEventProcessor, setupOnceGetCurrentHub) {
        if (!this._breadcrumbs && !this._tracing) {
          return;
        }
        const clientOptions = _optionalChain([setupOnceGetCurrentHub, "call", (_5) => _5(), "access", (_22) => _22.getClient, "call", (_32) => _32(), "optionalAccess", (_42) => _42.getOptions, "call", (_5) => _5()]);
        if (clientOptions && clientOptions.instrumenter !== "sentry") {
          DEBUG_BUILD4 && logger2.log("HTTP Integration is skipped because of instrumenter configuration.");
          return;
        }
        const shouldCreateSpanForRequest = (
          // eslint-disable-next-line deprecation/deprecation
          _optionalChain([this, "access", (_6) => _6._tracing, "optionalAccess", (_7) => _7.shouldCreateSpanForRequest]) || _optionalChain([clientOptions, "optionalAccess", (_8) => _8.shouldCreateSpanForRequest])
        );
        const tracePropagationTargets = _optionalChain([clientOptions, "optionalAccess", (_9) => _9.tracePropagationTargets]) || _optionalChain([this, "access", (_10) => _10._tracing, "optionalAccess", (_11) => _11.tracePropagationTargets]);
        const httpModule = __require("http");
        const wrappedHttpHandlerMaker = _createWrappedRequestMethodFactory(
          httpModule,
          this._breadcrumbs,
          shouldCreateSpanForRequest,
          tracePropagationTargets
        );
        fill(httpModule, "get", wrappedHttpHandlerMaker);
        fill(httpModule, "request", wrappedHttpHandlerMaker);
        if (NODE_VERSION.major && NODE_VERSION.major > 8) {
          const httpsModule = __require("https");
          const wrappedHttpsHandlerMaker = _createWrappedRequestMethodFactory(
            httpsModule,
            this._breadcrumbs,
            shouldCreateSpanForRequest,
            tracePropagationTargets
          );
          fill(httpsModule, "get", wrappedHttpsHandlerMaker);
          fill(httpsModule, "request", wrappedHttpsHandlerMaker);
        }
      }
    };
    Http.__initStatic();
    __name(_createWrappedRequestMethodFactory, "_createWrappedRequestMethodFactory");
    __name(addHeadersToRequestOptions, "addHeadersToRequestOptions");
    __name(getRequestSpanData, "getRequestSpanData");
    __name(normalizeBaggageHeader, "normalizeBaggageHeader");
  }
});

// ../../node_modules/.pnpm/@sentry+node@7.87.0_supports-color@9.2.2/node_modules/@sentry/node/esm/integrations/utils/errorhandling.js
function logAndExitProcess(error2) {
  consoleSandbox(() => {
    console.error(error2);
  });
  const client = getClient();
  if (client === void 0) {
    DEBUG_BUILD4 && logger2.warn("No NodeClient was defined, we are exiting the process now.");
    global.process.exit(1);
  }
  const options = client.getOptions();
  const timeout2 = options && options.shutdownTimeout && options.shutdownTimeout > 0 && options.shutdownTimeout || DEFAULT_SHUTDOWN_TIMEOUT;
  client.close(timeout2).then(
    (result) => {
      if (!result) {
        DEBUG_BUILD4 && logger2.warn("We reached the timeout for emptying the request buffer, still exiting now!");
      }
      global.process.exit(1);
    },
    (error3) => {
      DEBUG_BUILD4 && logger2.error(error3);
    }
  );
}
var DEFAULT_SHUTDOWN_TIMEOUT;
var init_errorhandling = __esm({
  "../../node_modules/.pnpm/@sentry+node@7.87.0_supports-color@9.2.2/node_modules/@sentry/node/esm/integrations/utils/errorhandling.js"() {
    init_import_meta_url();
    init_esm8();
    init_esm7();
    init_debug_build4();
    DEFAULT_SHUTDOWN_TIMEOUT = 2e3;
    __name(logAndExitProcess, "logAndExitProcess");
  }
});

// ../../node_modules/.pnpm/@sentry+node@7.87.0_supports-color@9.2.2/node_modules/@sentry/node/esm/integrations/onuncaughtexception.js
var OnUncaughtException;
var init_onuncaughtexception = __esm({
  "../../node_modules/.pnpm/@sentry+node@7.87.0_supports-color@9.2.2/node_modules/@sentry/node/esm/integrations/onuncaughtexception.js"() {
    init_import_meta_url();
    init_esm8();
    init_esm7();
    init_debug_build4();
    init_errorhandling();
    OnUncaughtException = class _OnUncaughtException {
      static {
        __name(this, "OnUncaughtException");
      }
      /**
       * @inheritDoc
       */
      static __initStatic() {
        this.id = "OnUncaughtException";
      }
      /**
       * @inheritDoc
       */
      __init() {
        this.name = _OnUncaughtException.id;
      }
      /**
       * @inheritDoc
       */
      __init2() {
        this.handler = this._makeErrorHandler();
      }
      // CAREFUL: Please think twice before updating the way _options looks because the Next.js SDK depends on it in `index.server.ts`
      /**
       * @inheritDoc
       */
      constructor(options = {}) {
        _OnUncaughtException.prototype.__init.call(this);
        _OnUncaughtException.prototype.__init2.call(this);
        this._options = {
          exitEvenIfOtherHandlersAreRegistered: true,
          ...options
        };
      }
      /**
       * @inheritDoc
       */
      setupOnce() {
        global.process.on("uncaughtException", this.handler);
      }
      /**
       * @hidden
       */
      _makeErrorHandler() {
        const timeout2 = 2e3;
        let caughtFirstError = false;
        let caughtSecondError = false;
        let calledFatalError = false;
        let firstError;
        return (error2) => {
          let onFatalError = logAndExitProcess;
          const client = getClient();
          if (this._options.onFatalError) {
            onFatalError = this._options.onFatalError;
          } else if (client && client.getOptions().onFatalError) {
            onFatalError = client.getOptions().onFatalError;
          }
          const userProvidedListenersCount = global.process.listeners("uncaughtException").reduce((acc, listener) => {
            if (
              // There are 3 listeners we ignore:
              listener.name === "domainUncaughtExceptionClear" || // as soon as we're using domains this listener is attached by node itself
              listener.tag && listener.tag === "sentry_tracingErrorCallback" || // the handler we register for tracing
              listener === this.handler
            ) {
              return acc;
            } else {
              return acc + 1;
            }
          }, 0);
          const processWouldExit = userProvidedListenersCount === 0;
          const shouldApplyFatalHandlingLogic = this._options.exitEvenIfOtherHandlersAreRegistered || processWouldExit;
          if (!caughtFirstError) {
            const hub = getCurrentHub();
            firstError = error2;
            caughtFirstError = true;
            if (hub.getIntegration(_OnUncaughtException)) {
              hub.withScope((scope) => {
                scope.setLevel("fatal");
                hub.captureException(error2, {
                  originalException: error2,
                  data: { mechanism: { handled: false, type: "onuncaughtexception" } }
                });
                if (!calledFatalError && shouldApplyFatalHandlingLogic) {
                  calledFatalError = true;
                  onFatalError(error2);
                }
              });
            } else {
              if (!calledFatalError && shouldApplyFatalHandlingLogic) {
                calledFatalError = true;
                onFatalError(error2);
              }
            }
          } else {
            if (shouldApplyFatalHandlingLogic) {
              if (calledFatalError) {
                DEBUG_BUILD4 && logger2.warn(
                  "uncaught exception after calling fatal error shutdown callback - this is bad! forcing shutdown"
                );
                logAndExitProcess(error2);
              } else if (!caughtSecondError) {
                caughtSecondError = true;
                setTimeout(() => {
                  if (!calledFatalError) {
                    calledFatalError = true;
                    onFatalError(firstError, error2);
                  }
                }, timeout2);
              }
            }
          }
        };
      }
    };
    OnUncaughtException.__initStatic();
  }
});

// ../../node_modules/.pnpm/@sentry+node@7.87.0_supports-color@9.2.2/node_modules/@sentry/node/esm/integrations/onunhandledrejection.js
var OnUnhandledRejection;
var init_onunhandledrejection = __esm({
  "../../node_modules/.pnpm/@sentry+node@7.87.0_supports-color@9.2.2/node_modules/@sentry/node/esm/integrations/onunhandledrejection.js"() {
    init_import_meta_url();
    init_esm8();
    init_esm7();
    init_errorhandling();
    OnUnhandledRejection = class _OnUnhandledRejection {
      static {
        __name(this, "OnUnhandledRejection");
      }
      /**
       * @inheritDoc
       */
      static __initStatic() {
        this.id = "OnUnhandledRejection";
      }
      /**
       * @inheritDoc
       */
      __init() {
        this.name = _OnUnhandledRejection.id;
      }
      /**
       * @inheritDoc
       */
      constructor(_options = { mode: "warn" }) {
        this._options = _options;
        _OnUnhandledRejection.prototype.__init.call(this);
      }
      /**
       * @inheritDoc
       */
      setupOnce() {
        global.process.on("unhandledRejection", this.sendUnhandledPromise.bind(this));
      }
      /**
       * Send an exception with reason
       * @param reason string
       * @param promise promise
       */
      sendUnhandledPromise(reason, promise) {
        const hub = getCurrentHub();
        if (hub.getIntegration(_OnUnhandledRejection)) {
          hub.withScope((scope) => {
            scope.setExtra("unhandledPromiseRejection", true);
            hub.captureException(reason, {
              originalException: promise,
              data: { mechanism: { handled: false, type: "onunhandledrejection" } }
            });
          });
        }
        this._handleRejection(reason);
      }
      /**
       * Handler for `mode` option
       */
      // eslint-disable-next-line @typescript-eslint/no-explicit-any
      _handleRejection(reason) {
        const rejectionWarning = "This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:";
        if (this._options.mode === "warn") {
          consoleSandbox(() => {
            console.warn(rejectionWarning);
            console.error(reason && reason.stack ? reason.stack : reason);
          });
        } else if (this._options.mode === "strict") {
          consoleSandbox(() => {
            console.warn(rejectionWarning);
          });
          logAndExitProcess(reason);
        }
      }
    };
    OnUnhandledRejection.__initStatic();
  }
});
function getPaths() {
  try {
    return __require.cache ? Object.keys(__require.cache) : [];
  } catch (e10) {
    return [];
  }
}
function collectModules() {
  const mainPaths = __require.main && __require.main.paths || [];
  const paths = getPaths();
  const infos = {};
  const seen = {};
  paths.forEach((path84) => {
    let dir2 = path84;
    const updir = /* @__PURE__ */ __name(() => {
      const orig = dir2;
      dir2 = path3.dirname(orig);
      if (!dir2 || orig === dir2 || seen[orig]) {
        return void 0;
      }
      if (mainPaths.indexOf(dir2) < 0) {
        return updir();
      }
      const pkgfile = path3.join(orig, "package.json");
      seen[orig] = true;
      if (!fs29.existsSync(pkgfile)) {
        return updir();
      }
      try {
        const info = JSON.parse(fs29.readFileSync(pkgfile, "utf8"));
        infos[info.name] = info.version;
      } catch (_oO) {
      }
    }, "updir");
    updir();
  });
  return infos;
}
var moduleCache, Modules;
var init_modules = __esm({
  "../../node_modules/.pnpm/@sentry+node@7.87.0_supports-color@9.2.2/node_modules/@sentry/node/esm/integrations/modules.js"() {
    init_import_meta_url();
    __name(getPaths, "getPaths");
    __name(collectModules, "collectModules");
    Modules = class _Modules {
      static {
        __name(this, "Modules");
      }
      constructor() {
        _Modules.prototype.__init.call(this);
      }
      /**
       * @inheritDoc
       */
      static __initStatic() {
        this.id = "Modules";
      }
      /**
       * @inheritDoc
       */
      __init() {
        this.name = _Modules.id;
      }
      /**
       * @inheritDoc
       */
      setupOnce(addGlobalEventProcessor2, getCurrentHub3) {
        addGlobalEventProcessor2((event) => {
          if (!getCurrentHub3().getIntegration(_Modules)) {
            return event;
          }
          return {
            ...event,
            modules: {
              ...event.modules,
              ...this._getModules()
            }
          };
        });
      }
      /** Fetches the list of modules and the versions loaded by the entry file for your node.js app. */
      _getModules() {
        if (!moduleCache) {
          moduleCache = collectModules();
        }
        return moduleCache;
      }
    };
    Modules.__initStatic();
  }
});
function readTextFileAsync(path84) {
  return new Promise((resolve32, reject) => {
    fs29.readFile(path84, "utf8", (err, data) => {
      if (err) reject(err);
      else resolve32(data);
    });
  });
}
async function _readSourceFile(filename) {
  const cachedFile = FILE_CONTENT_CACHE.get(filename);
  if (cachedFile === null) {
    return null;
  }
  if (cachedFile !== void 0) {
    return cachedFile;
  }
  let content = null;
  try {
    const rawFileContents = await readTextFileAsync(filename);
    content = rawFileContents.split("\n");
  } catch (_5) {
  }
  FILE_CONTENT_CACHE.set(filename, content);
  return content;
}
var FILE_CONTENT_CACHE, DEFAULT_LINES_OF_CONTEXT, ContextLines;
var init_contextlines = __esm({
  "../../node_modules/.pnpm/@sentry+node@7.87.0_supports-color@9.2.2/node_modules/@sentry/node/esm/integrations/contextlines.js"() {
    init_import_meta_url();
    init_esm7();
    init_esm7();
    FILE_CONTENT_CACHE = new LRUMap(100);
    DEFAULT_LINES_OF_CONTEXT = 7;
    __name(readTextFileAsync, "readTextFileAsync");
    ContextLines = class _ContextLines {
      static {
        __name(this, "ContextLines");
      }
      /**
       * @inheritDoc
       */
      static __initStatic() {
        this.id = "ContextLines";
      }
      /**
       * @inheritDoc
       */
      __init() {
        this.name = _ContextLines.id;
      }
      constructor(_options = {}) {
        this._options = _options;
        _ContextLines.prototype.__init.call(this);
      }
      /** Get's the number of context lines to add */
      get _contextLines() {
        return this._options.frameContextLines !== void 0 ? this._options.frameContextLines : DEFAULT_LINES_OF_CONTEXT;
      }
      /**
       * @inheritDoc
       */
      setupOnce(addGlobalEventProcessor2, getCurrentHub3) {
        addGlobalEventProcessor2((event) => {
          const self2 = getCurrentHub3().getIntegration(_ContextLines);
          if (!self2) {
            return event;
          }
          return this.addSourceContext(event);
        });
      }
      /** Processes an event and adds context lines */
      async addSourceContext(event) {
        const enqueuedReadSourceFileTasks = {};
        const readSourceFileTasks = [];
        if (this._contextLines > 0 && _optionalChain([event, "access", (_22) => _22.exception, "optionalAccess", (_32) => _32.values])) {
          for (const exception of event.exception.values) {
            if (!_optionalChain([exception, "access", (_42) => _42.stacktrace, "optionalAccess", (_5) => _5.frames])) {
              continue;
            }
            for (let i7 = exception.stacktrace.frames.length - 1; i7 >= 0; i7--) {
              const frame = exception.stacktrace.frames[i7];
              if (frame.filename && !enqueuedReadSourceFileTasks[frame.filename] && !FILE_CONTENT_CACHE.get(frame.filename)) {
                readSourceFileTasks.push(_readSourceFile(frame.filename));
                enqueuedReadSourceFileTasks[frame.filename] = 1;
              }
            }
          }
        }
        if (readSourceFileTasks.length > 0) {
          await Promise.all(readSourceFileTasks);
        }
        if (this._contextLines > 0 && _optionalChain([event, "access", (_6) => _6.exception, "optionalAccess", (_7) => _7.values])) {
          for (const exception of event.exception.values) {
            if (exception.stacktrace && exception.stacktrace.frames) {
              await this.addSourceContextToFrames(exception.stacktrace.frames);
            }
          }
        }
        return event;
      }
      /** Adds context lines to frames */
      addSourceContextToFrames(frames) {
        for (const frame of frames) {
          if (frame.filename && frame.context_line === void 0) {
            const sourceFileLines = FILE_CONTENT_CACHE.get(frame.filename);
            if (sourceFileLines) {
              try {
                addContextToFrame(sourceFileLines, frame, this._contextLines);
              } catch (e10) {
              }
            }
          }
        }
      }
    };
    ContextLines.__initStatic();
    __name(_readSourceFile, "_readSourceFile");
  }
});
async function getOsContext() {
  const platformId = os11__namespace.platform();
  switch (platformId) {
    case "darwin":
      return getDarwinInfo();
    case "linux":
      return getLinuxInfo();
    default:
      return {
        name: PLATFORM_NAMES[platformId] || platformId,
        version: os11__namespace.release()
      };
  }
}
function getCultureContext() {
  try {
    if (typeof process.versions.icu !== "string") {
      return;
    }
    const january = /* @__PURE__ */ new Date(9e8);
    const spanish = new Intl.DateTimeFormat("es", { month: "long" });
    if (spanish.format(january) === "enero") {
      const options = Intl.DateTimeFormat().resolvedOptions();
      return {
        locale: options.locale,
        timezone: options.timeZone
      };
    }
  } catch (err) {
  }
  return;
}
function getAppContext() {
  const app_memory = process.memoryUsage().rss;
  const app_start_time = new Date(Date.now() - process.uptime() * 1e3).toISOString();
  return { app_start_time, app_memory };
}
function getDeviceContext(deviceOpt) {
  const device = {};
  let uptime3;
  try {
    uptime3 = os11__namespace.uptime && os11__namespace.uptime();
  } catch (e10) {
  }
  if (typeof uptime3 === "number") {
    device.boot_time = new Date(Date.now() - uptime3 * 1e3).toISOString();
  }
  device.arch = os11__namespace.arch();
  if (deviceOpt === true || deviceOpt.memory) {
    device.memory_size = os11__namespace.totalmem();
    device.free_memory = os11__namespace.freemem();
  }
  if (deviceOpt === true || deviceOpt.cpu) {
    const cpuInfo = os11__namespace.cpus();
    if (cpuInfo && cpuInfo.length) {
      const firstCpu = cpuInfo[0];
      device.processor_count = cpuInfo.length;
      device.cpu_description = firstCpu.model;
      device.processor_frequency = firstCpu.speed;
    }
  }
  return device;
}
function matchFirst(regex2, text) {
  const match3 = regex2.exec(text);
  return match3 ? match3[1] : void 0;
}
async function getDarwinInfo() {
  const darwinInfo = {
    kernel_version: os11__namespace.release(),
    name: "Mac OS X",
    version: `10.${Number(os11__namespace.release().split(".")[0]) - 4}`
  };
  try {
    const output = await new Promise((resolve32, reject) => {
      childProcess.execFile("/usr/bin/sw_vers", (error2, stdout2) => {
        if (error2) {
          reject(error2);
          return;
        }
        resolve32(stdout2);
      });
    });
    darwinInfo.name = matchFirst(/^ProductName:\s+(.*)$/m, output);
    darwinInfo.version = matchFirst(/^ProductVersion:\s+(.*)$/m, output);
    darwinInfo.build = matchFirst(/^BuildVersion:\s+(.*)$/m, output);
  } catch (e10) {
  }
  return darwinInfo;
}
function getLinuxDistroId(name2) {
  return name2.split(" ")[0].toLowerCase();
}
async function getLinuxInfo() {
  const linuxInfo = {
    kernel_version: os11__namespace.release(),
    name: "Linux"
  };
  try {
    const etcFiles = await readDirAsync("/etc");
    const distroFile = LINUX_DISTROS.find((file3) => etcFiles.includes(file3.name));
    if (!distroFile) {
      return linuxInfo;
    }
    const distroPath = path3.join("/etc", distroFile.name);
    const contents = (await readFileAsync(distroPath, { encoding: "utf-8" })).toLowerCase();
    const { distros } = distroFile;
    linuxInfo.name = distros.find((d8) => contents.indexOf(getLinuxDistroId(d8)) >= 0) || distros[0];
    const id = getLinuxDistroId(linuxInfo.name);
    linuxInfo.version = LINUX_VERSIONS[id](contents);
  } catch (e10) {
  }
  return linuxInfo;
}
function getCloudResourceContext() {
  if (process.env.VERCEL) {
    return {
      "cloud.provider": "vercel",
      "cloud.region": process.env.VERCEL_REGION
    };
  } else if (process.env.AWS_REGION) {
    return {
      "cloud.provider": "aws",
      "cloud.region": process.env.AWS_REGION,
      "cloud.platform": process.env.AWS_EXECUTION_ENV
    };
  } else if (process.env.GCP_PROJECT) {
    return {
      "cloud.provider": "gcp"
    };
  } else if (process.env.ALIYUN_REGION_ID) {
    return {
      "cloud.provider": "alibaba_cloud",
      "cloud.region": process.env.ALIYUN_REGION_ID
    };
  } else if (process.env.WEBSITE_SITE_NAME && process.env.REGION_NAME) {
    return {
      "cloud.provider": "azure",
      "cloud.region": process.env.REGION_NAME
    };
  } else if (process.env.IBM_CLOUD_REGION) {
    return {
      "cloud.provider": "ibm_cloud",
      "cloud.region": process.env.IBM_CLOUD_REGION
    };
  } else if (process.env.TENCENTCLOUD_REGION) {
    return {
      "cloud.provider": "tencent_cloud",
      "cloud.region": process.env.TENCENTCLOUD_REGION,
      "cloud.account.id": process.env.TENCENTCLOUD_APPID,
      "cloud.availability_zone": process.env.TENCENTCLOUD_ZONE
    };
  } else if (process.env.NETLIFY) {
    return {
      "cloud.provider": "netlify"
    };
  } else if (process.env.FLY_REGION) {
    return {
      "cloud.provider": "fly.io",
      "cloud.region": process.env.FLY_REGION
    };
  } else if (process.env.DYNO) {
    return {
      "cloud.provider": "heroku"
    };
  } else {
    return void 0;
  }
}
var readFileAsync, readDirAsync, Context, PLATFORM_NAMES, LINUX_DISTROS, LINUX_VERSIONS;
var init_context = __esm({
  "../../node_modules/.pnpm/@sentry+node@7.87.0_supports-color@9.2.2/node_modules/@sentry/node/esm/integrations/context.js"() {
    init_import_meta_url();
    init_esm7();
    readFileAsync = util4.promisify(fs29.readFile);
    readDirAsync = util4.promisify(fs29.readdir);
    Context = class _Context {
      static {
        __name(this, "Context");
      }
      /**
       * @inheritDoc
       */
      static __initStatic() {
        this.id = "Context";
      }
      /**
       * @inheritDoc
       */
      __init() {
        this.name = _Context.id;
      }
      /**
       * Caches context so it's only evaluated once
       */
      constructor(_options = {
        app: true,
        os: true,
        device: true,
        culture: true,
        cloudResource: true
      }) {
        this._options = _options;
        _Context.prototype.__init.call(this);
      }
      /**
       * @inheritDoc
       */
      setupOnce(addGlobalEventProcessor2) {
        addGlobalEventProcessor2((event) => this.addContext(event));
      }
      /** Processes an event and adds context */
      async addContext(event) {
        if (this._cachedContext === void 0) {
          this._cachedContext = this._getContexts();
        }
        const updatedContext = this._updateContext(await this._cachedContext);
        event.contexts = {
          ...event.contexts,
          app: { ...updatedContext.app, ..._optionalChain([event, "access", (_5) => _5.contexts, "optionalAccess", (_22) => _22.app]) },
          os: { ...updatedContext.os, ..._optionalChain([event, "access", (_32) => _32.contexts, "optionalAccess", (_42) => _42.os]) },
          device: { ...updatedContext.device, ..._optionalChain([event, "access", (_5) => _5.contexts, "optionalAccess", (_6) => _6.device]) },
          culture: { ...updatedContext.culture, ..._optionalChain([event, "access", (_7) => _7.contexts, "optionalAccess", (_8) => _8.culture]) },
          cloud_resource: { ...updatedContext.cloud_resource, ..._optionalChain([event, "access", (_9) => _9.contexts, "optionalAccess", (_10) => _10.cloud_resource]) }
        };
        return event;
      }
      /**
       * Updates the context with dynamic values that can change
       */
      _updateContext(contexts) {
        if (_optionalChain([contexts, "optionalAccess", (_11) => _11.app, "optionalAccess", (_12) => _12.app_memory])) {
          contexts.app.app_memory = process.memoryUsage().rss;
        }
        if (_optionalChain([contexts, "optionalAccess", (_13) => _13.device, "optionalAccess", (_14) => _14.free_memory])) {
          contexts.device.free_memory = os11__namespace.freemem();
        }
        return contexts;
      }
      /**
       * Gets the contexts for the current environment
       */
      async _getContexts() {
        const contexts = {};
        if (this._options.os) {
          contexts.os = await getOsContext();
        }
        if (this._options.app) {
          contexts.app = getAppContext();
        }
        if (this._options.device) {
          contexts.device = getDeviceContext(this._options.device);
        }
        if (this._options.culture) {
          const culture = getCultureContext();
          if (culture) {
            contexts.culture = culture;
          }
        }
        if (this._options.cloudResource) {
          contexts.cloud_resource = getCloudResourceContext();
        }
        return contexts;
      }
    };
    Context.__initStatic();
    __name(getOsContext, "getOsContext");
    __name(getCultureContext, "getCultureContext");
    __name(getAppContext, "getAppContext");
    __name(getDeviceContext, "getDeviceContext");
    PLATFORM_NAMES = {
      aix: "IBM AIX",
      freebsd: "FreeBSD",
      openbsd: "OpenBSD",
      sunos: "SunOS",
      win32: "Windows"
    };
    LINUX_DISTROS = [
      { name: "fedora-release", distros: ["Fedora"] },
      { name: "redhat-release", distros: ["Red Hat Linux", "Centos"] },
      { name: "redhat_version", distros: ["Red Hat Linux"] },
      { name: "SuSE-release", distros: ["SUSE Linux"] },
      { name: "lsb-release", distros: ["Ubuntu Linux", "Arch Linux"] },
      { name: "debian_version", distros: ["Debian"] },
      { name: "debian_release", distros: ["Debian"] },
      { name: "arch-release", distros: ["Arch Linux"] },
      { name: "gentoo-release", distros: ["Gentoo Linux"] },
      { name: "novell-release", distros: ["SUSE Linux"] },
      { name: "alpine-release", distros: ["Alpine Linux"] }
    ];
    LINUX_VERSIONS = {
      alpine: /* @__PURE__ */ __name((content) => content, "alpine"),
      arch: /* @__PURE__ */ __name((content) => matchFirst(/distrib_release=(.*)/, content), "arch"),
      centos: /* @__PURE__ */ __name((content) => matchFirst(/release ([^ ]+)/, content), "centos"),
      debian: /* @__PURE__ */ __name((content) => content, "debian"),
      fedora: /* @__PURE__ */ __name((content) => matchFirst(/release (..)/, content), "fedora"),
      mint: /* @__PURE__ */ __name((content) => matchFirst(/distrib_release=(.*)/, content), "mint"),
      red: /* @__PURE__ */ __name((content) => matchFirst(/release ([^ ]+)/, content), "red"),
      suse: /* @__PURE__ */ __name((content) => matchFirst(/VERSION = (.*)\n/, content), "suse"),
      ubuntu: /* @__PURE__ */ __name((content) => matchFirst(/distrib_release=(.*)/, content), "ubuntu")
    };
    __name(matchFirst, "matchFirst");
    __name(getDarwinInfo, "getDarwinInfo");
    __name(getLinuxDistroId, "getLinuxDistroId");
    __name(getLinuxInfo, "getLinuxInfo");
    __name(getCloudResourceContext, "getCloudResourceContext");
  }
});

// ../../node_modules/.pnpm/@sentry+node@7.87.0_supports-color@9.2.2/node_modules/@sentry/node/esm/integrations/localvariables.js
function createRateLimiter(maxPerSecond, enable, disable) {
  let count = 0;
  let retrySeconds = 5;
  let disabledTimeout = 0;
  setInterval(() => {
    if (disabledTimeout === 0) {
      if (count > maxPerSecond) {
        retrySeconds *= 2;
        disable(retrySeconds);
        if (retrySeconds > 86400) {
          retrySeconds = 86400;
        }
        disabledTimeout = retrySeconds;
      }
    } else {
      disabledTimeout -= 1;
      if (disabledTimeout === 0) {
        enable();
      }
    }
    count = 0;
  }, 1e3).unref();
  return () => {
    count += 1;
  };
}
function createCallbackList(complete) {
  let callbacks = [];
  let completedCalled = false;
  function checkedComplete(result) {
    callbacks = [];
    if (completedCalled) {
      return;
    }
    completedCalled = true;
    complete(result);
  }
  __name(checkedComplete, "checkedComplete");
  callbacks.push(checkedComplete);
  function add(fn2) {
    callbacks.push(fn2);
  }
  __name(add, "add");
  function next(result) {
    const popped = callbacks.pop() || checkedComplete;
    try {
      popped(result);
    } catch (_5) {
      checkedComplete(result);
    }
  }
  __name(next, "next");
  return { add, next };
}
function tryNewAsyncSession() {
  try {
    return new AsyncSession();
  } catch (e10) {
    return void 0;
  }
}
function isAnonymous(name2) {
  return name2 !== void 0 && ["", "?", "<anonymous>"].includes(name2);
}
function functionNamesMatch(a7, b11) {
  return a7 === b11 || isAnonymous(a7) && isAnonymous(b11);
}
function hashFrames(frames) {
  if (frames === void 0) {
    return;
  }
  return frames.slice(-10).reduce((acc, frame) => `${acc},${frame.function},${frame.lineno},${frame.colno}`, "");
}
function hashFromStack(stackParser, stack) {
  if (stack === void 0) {
    return void 0;
  }
  return hashFrames(stackParser(stack, 1));
}
var AsyncSession, LocalVariables;
var init_localvariables = __esm({
  "../../node_modules/.pnpm/@sentry+node@7.87.0_supports-color@9.2.2/node_modules/@sentry/node/esm/integrations/localvariables.js"() {
    init_import_meta_url();
    init_esm7();
    init_esm7();
    init_nodeVersion();
    __name(createRateLimiter, "createRateLimiter");
    __name(createCallbackList, "createCallbackList");
    AsyncSession = class {
      static {
        __name(this, "AsyncSession");
      }
      /** Throws if inspector API is not available */
      constructor() {
        const { Session } = __require("inspector");
        this._session = new Session();
      }
      /** @inheritdoc */
      configureAndConnect(onPause, captureAll) {
        this._session.connect();
        this._session.on("Debugger.paused", (event) => {
          onPause(event, () => {
            this._session.post("Debugger.resume");
          });
        });
        this._session.post("Debugger.enable");
        this._session.post("Debugger.setPauseOnExceptions", { state: captureAll ? "all" : "uncaught" });
      }
      setPauseOnExceptions(captureAll) {
        this._session.post("Debugger.setPauseOnExceptions", { state: captureAll ? "all" : "uncaught" });
      }
      /** @inheritdoc */
      getLocalVariables(objectId, complete) {
        this._getProperties(objectId, (props) => {
          const { add, next } = createCallbackList(complete);
          for (const prop of props) {
            if (_optionalChain([prop, "optionalAccess", (_22) => _22.value, "optionalAccess", (_32) => _32.objectId]) && _optionalChain([prop, "optionalAccess", (_42) => _42.value, "access", (_5) => _5.className]) === "Array") {
              const id = prop.value.objectId;
              add((vars) => this._unrollArray(id, prop.name, vars, next));
            } else if (_optionalChain([prop, "optionalAccess", (_6) => _6.value, "optionalAccess", (_7) => _7.objectId]) && _optionalChain([prop, "optionalAccess", (_8) => _8.value, "optionalAccess", (_9) => _9.className]) === "Object") {
              const id = prop.value.objectId;
              add((vars) => this._unrollObject(id, prop.name, vars, next));
            } else if (_optionalChain([prop, "optionalAccess", (_10) => _10.value, "optionalAccess", (_11) => _11.value]) || _optionalChain([prop, "optionalAccess", (_12) => _12.value, "optionalAccess", (_13) => _13.description])) {
              add((vars) => this._unrollOther(prop, vars, next));
            }
          }
          next({});
        });
      }
      /**
       * Gets all the PropertyDescriptors of an object
       */
      _getProperties(objectId, next) {
        this._session.post(
          "Runtime.getProperties",
          {
            objectId,
            ownProperties: true
          },
          (err, params) => {
            if (err) {
              next([]);
            } else {
              next(params.result);
            }
          }
        );
      }
      /**
       * Unrolls an array property
       */
      _unrollArray(objectId, name2, vars, next) {
        this._getProperties(objectId, (props) => {
          vars[name2] = props.filter((v8) => v8.name !== "length" && !isNaN(parseInt(v8.name, 10))).sort((a7, b11) => parseInt(a7.name, 10) - parseInt(b11.name, 10)).map((v8) => _optionalChain([v8, "optionalAccess", (_14) => _14.value, "optionalAccess", (_15) => _15.value]));
          next(vars);
        });
      }
      /**
       * Unrolls an object property
       */
      _unrollObject(objectId, name2, vars, next) {
        this._getProperties(objectId, (props) => {
          vars[name2] = props.map((v8) => [v8.name, _optionalChain([v8, "optionalAccess", (_16) => _16.value, "optionalAccess", (_17) => _17.value])]).reduce((obj, [key, val2]) => {
            obj[key] = val2;
            return obj;
          }, {});
          next(vars);
        });
      }
      /**
       * Unrolls other properties
       */
      _unrollOther(prop, vars, next) {
        if (_optionalChain([prop, "optionalAccess", (_18) => _18.value, "optionalAccess", (_19) => _19.value])) {
          vars[prop.name] = prop.value.value;
        } else if (_optionalChain([prop, "optionalAccess", (_20) => _20.value, "optionalAccess", (_21) => _21.description]) && _optionalChain([prop, "optionalAccess", (_22) => _22.value, "optionalAccess", (_23) => _23.type]) !== "function") {
          vars[prop.name] = `<${prop.value.description}>`;
        }
        next(vars);
      }
    };
    __name(tryNewAsyncSession, "tryNewAsyncSession");
    __name(isAnonymous, "isAnonymous");
    __name(functionNamesMatch, "functionNamesMatch");
    __name(hashFrames, "hashFrames");
    __name(hashFromStack, "hashFromStack");
    LocalVariables = class _LocalVariables {
      static {
        __name(this, "LocalVariables");
      }
      static __initStatic() {
        this.id = "LocalVariables";
      }
      __init() {
        this.name = _LocalVariables.id;
      }
      __init2() {
        this._cachedFrames = new LRUMap(20);
      }
      constructor(_options = {}, _session = tryNewAsyncSession()) {
        this._options = _options;
        this._session = _session;
        _LocalVariables.prototype.__init.call(this);
        _LocalVariables.prototype.__init2.call(this);
      }
      /**
       * @inheritDoc
       */
      setupOnce(addGlobalEventProcessor2, getCurrentHub3) {
        this._setup(addGlobalEventProcessor2, _optionalChain([getCurrentHub3, "call", (_24) => _24(), "access", (_25) => _25.getClient, "call", (_26) => _26(), "optionalAccess", (_27) => _27.getOptions, "call", (_28) => _28()]));
      }
      /** Setup in a way that's easier to call from tests */
      _setup(addGlobalEventProcessor2, clientOptions) {
        if (this._session && _optionalChain([clientOptions, "optionalAccess", (_29) => _29.includeLocalVariables])) {
          const unsupportedNodeVersion = (NODE_VERSION.major || 0) < 18;
          if (unsupportedNodeVersion) {
            logger2.log("The `LocalVariables` integration is only supported on Node >= v18.");
            return;
          }
          const captureAll = this._options.captureAllExceptions !== false;
          this._session.configureAndConnect(
            (ev, complete) => this._handlePaused(clientOptions.stackParser, ev, complete),
            captureAll
          );
          if (captureAll) {
            const max = this._options.maxExceptionsPerSecond || 50;
            this._rateLimiter = createRateLimiter(
              max,
              () => {
                logger2.log("Local variables rate-limit lifted.");
                _optionalChain([this, "access", (_30) => _30._session, "optionalAccess", (_31) => _31.setPauseOnExceptions, "call", (_32) => _32(true)]);
              },
              (seconds) => {
                logger2.log(
                  `Local variables rate-limit exceeded. Disabling capturing of caught exceptions for ${seconds} seconds.`
                );
                _optionalChain([this, "access", (_33) => _33._session, "optionalAccess", (_34) => _34.setPauseOnExceptions, "call", (_35) => _35(false)]);
              }
            );
          }
          addGlobalEventProcessor2(async (event) => this._addLocalVariables(event));
        }
      }
      /**
       * Handle the pause event
       */
      _handlePaused(stackParser, { params: { reason, data, callFrames } }, complete) {
        if (reason !== "exception" && reason !== "promiseRejection") {
          complete();
          return;
        }
        _optionalChain([this, "access", (_36) => _36._rateLimiter, "optionalCall", (_37) => _37()]);
        const exceptionHash = hashFromStack(stackParser, _optionalChain([data, "optionalAccess", (_38) => _38.description]));
        if (exceptionHash == void 0) {
          complete();
          return;
        }
        const { add, next } = createCallbackList((frames) => {
          this._cachedFrames.set(exceptionHash, frames);
          complete();
        });
        for (let i7 = 0; i7 < Math.min(callFrames.length, 5); i7++) {
          const { scopeChain, functionName, this: obj } = callFrames[i7];
          const localScope = scopeChain.find((scope) => scope.type === "local");
          const fn2 = obj.className === "global" || !obj.className ? functionName : `${obj.className}.${functionName}`;
          if (_optionalChain([localScope, "optionalAccess", (_39) => _39.object, "access", (_40) => _40.objectId]) === void 0) {
            add((frames) => {
              frames[i7] = { function: fn2 };
              next(frames);
            });
          } else {
            const id = localScope.object.objectId;
            add(
              (frames) => _optionalChain([this, "access", (_41) => _41._session, "optionalAccess", (_42) => _42.getLocalVariables, "call", (_43) => _43(id, (vars) => {
                frames[i7] = { function: fn2, vars };
                next(frames);
              })])
            );
          }
        }
        next([]);
      }
      /**
       * Adds local variables event stack frames.
       */
      _addLocalVariables(event) {
        for (const exception of _optionalChain([event, "optionalAccess", (_44) => _44.exception, "optionalAccess", (_45) => _45.values]) || []) {
          this._addLocalVariablesToException(exception);
        }
        return event;
      }
      /**
       * Adds local variables to the exception stack frames.
       */
      _addLocalVariablesToException(exception) {
        const hash = hashFrames(_optionalChain([exception, "optionalAccess", (_46) => _46.stacktrace, "optionalAccess", (_47) => _47.frames]));
        if (hash === void 0) {
          return;
        }
        const cachedFrames = this._cachedFrames.remove(hash);
        if (cachedFrames === void 0) {
          return;
        }
        const frameCount = _optionalChain([exception, "access", (_48) => _48.stacktrace, "optionalAccess", (_49) => _49.frames, "optionalAccess", (_50) => _50.length]) || 0;
        for (let i7 = 0; i7 < frameCount; i7++) {
          const frameIndex = frameCount - i7 - 1;
          if (!_optionalChain([exception, "optionalAccess", (_51) => _51.stacktrace, "optionalAccess", (_52) => _52.frames, "optionalAccess", (_53) => _53[frameIndex]]) || !cachedFrames[i7]) {
            break;
          }
          if (
            // We need to have vars to add
            cachedFrames[i7].vars === void 0 || // We're not interested in frames that are not in_app because the vars are not relevant
            exception.stacktrace.frames[frameIndex].in_app === false || // The function names need to match
            !functionNamesMatch(exception.stacktrace.frames[frameIndex].function, cachedFrames[i7].function)
          ) {
            continue;
          }
          exception.stacktrace.frames[frameIndex].vars = cachedFrames[i7].vars;
        }
      }
    };
    LocalVariables.__initStatic();
  }
});

// ../../node_modules/.pnpm/@sentry+node@7.87.0_supports-color@9.2.2/node_modules/@sentry/node/esm/integrations/undici/index.js
function setHeadersOnRequest(request4, sentryTrace, sentryBaggageHeader) {
  const headerLines = request4.headers.split("\r\n");
  const hasSentryHeaders = headerLines.some((headerLine) => headerLine.startsWith("sentry-trace:"));
  if (hasSentryHeaders) {
    return;
  }
  request4.addHeader("sentry-trace", sentryTrace);
  if (sentryBaggageHeader) {
    request4.addHeader("baggage", sentryBaggageHeader);
  }
}
function createRequestSpan(activeSpan, request4, stringUrl) {
  const url4 = parseUrl(stringUrl);
  const method = request4.method || "GET";
  const data = {
    "http.method": method
  };
  if (url4.search) {
    data["http.query"] = url4.search;
  }
  if (url4.hash) {
    data["http.fragment"] = url4.hash;
  }
  return _optionalChain([activeSpan, "optionalAccess", (_7) => _7.startChild, "call", (_8) => _8({
    op: "http.client",
    origin: "auto.http.node.undici",
    description: `${method} ${getSanitizedUrlString(url4)}`,
    data
  })]);
}
var ChannelName, Undici;
var init_undici = __esm({
  "../../node_modules/.pnpm/@sentry+node@7.87.0_supports-color@9.2.2/node_modules/@sentry/node/esm/integrations/undici/index.js"() {
    init_import_meta_url();
    init_esm7();
    init_esm8();
    init_esm7();
    init_nodeVersion();
    (function(ChannelName2) {
      const RequestCreate = "undici:request:create";
      ChannelName2["RequestCreate"] = RequestCreate;
      const RequestEnd = "undici:request:headers";
      ChannelName2["RequestEnd"] = RequestEnd;
      const RequestError = "undici:request:error";
      ChannelName2["RequestError"] = RequestError;
    })(ChannelName || (ChannelName = {}));
    Undici = class _Undici {
      static {
        __name(this, "Undici");
      }
      /**
       * @inheritDoc
       */
      static __initStatic() {
        this.id = "Undici";
      }
      /**
       * @inheritDoc
       */
      __init() {
        this.name = _Undici.id;
      }
      __init2() {
        this._createSpanUrlMap = new LRUMap(100);
      }
      __init3() {
        this._headersUrlMap = new LRUMap(100);
      }
      constructor(_options = {}) {
        _Undici.prototype.__init.call(this);
        _Undici.prototype.__init2.call(this);
        _Undici.prototype.__init3.call(this);
        _Undici.prototype.__init4.call(this);
        _Undici.prototype.__init5.call(this);
        _Undici.prototype.__init6.call(this);
        this._options = {
          breadcrumbs: _options.breadcrumbs === void 0 ? true : _options.breadcrumbs,
          shouldCreateSpanForRequest: _options.shouldCreateSpanForRequest
        };
      }
      /**
       * @inheritDoc
       */
      setupOnce(_addGlobalEventProcessor) {
        if (NODE_VERSION.major && NODE_VERSION.major < 16) {
          return;
        }
        let ds;
        try {
          ds = dynamicRequire(module, "diagnostics_channel");
        } catch (e10) {
        }
        if (!ds || !ds.subscribe) {
          return;
        }
        ds.subscribe(ChannelName.RequestCreate, this._onRequestCreate);
        ds.subscribe(ChannelName.RequestEnd, this._onRequestEnd);
        ds.subscribe(ChannelName.RequestError, this._onRequestError);
      }
      /** Helper that wraps shouldCreateSpanForRequest option */
      _shouldCreateSpan(url4) {
        if (this._options.shouldCreateSpanForRequest === void 0) {
          return true;
        }
        const cachedDecision = this._createSpanUrlMap.get(url4);
        if (cachedDecision !== void 0) {
          return cachedDecision;
        }
        const decision = this._options.shouldCreateSpanForRequest(url4);
        this._createSpanUrlMap.set(url4, decision);
        return decision;
      }
      __init4() {
        this._onRequestCreate = (message) => {
          const hub = getCurrentHub();
          if (!hub.getIntegration(_Undici)) {
            return;
          }
          const { request: request4 } = message;
          const stringUrl = request4.origin ? request4.origin.toString() + request4.path : request4.path;
          if (isSentryRequestUrl(stringUrl, hub) || request4.__sentry_span__ !== void 0) {
            return;
          }
          const client = hub.getClient();
          if (!client) {
            return;
          }
          const clientOptions = client.getOptions();
          const scope = hub.getScope();
          const parentSpan = scope.getSpan();
          const span = this._shouldCreateSpan(stringUrl) ? createRequestSpan(parentSpan, request4, stringUrl) : void 0;
          if (span) {
            request4.__sentry_span__ = span;
          }
          const shouldAttachTraceData = /* @__PURE__ */ __name((url4) => {
            if (clientOptions.tracePropagationTargets === void 0) {
              return true;
            }
            const cachedDecision = this._headersUrlMap.get(url4);
            if (cachedDecision !== void 0) {
              return cachedDecision;
            }
            const decision = stringMatchesSomePattern(url4, clientOptions.tracePropagationTargets);
            this._headersUrlMap.set(url4, decision);
            return decision;
          }, "shouldAttachTraceData");
          if (shouldAttachTraceData(stringUrl)) {
            if (span) {
              const dynamicSamplingContext = _optionalChain([span, "optionalAccess", (_42) => _42.transaction, "optionalAccess", (_5) => _5.getDynamicSamplingContext, "call", (_6) => _6()]);
              const sentryBaggageHeader = dynamicSamplingContextToSentryBaggageHeader(dynamicSamplingContext);
              setHeadersOnRequest(request4, span.toTraceparent(), sentryBaggageHeader);
            } else {
              const { traceId, sampled, dsc } = scope.getPropagationContext();
              const sentryTrace = generateSentryTraceHeader(traceId, void 0, sampled);
              const dynamicSamplingContext = dsc || getDynamicSamplingContextFromClient(traceId, client, scope);
              const sentryBaggageHeader = dynamicSamplingContextToSentryBaggageHeader(dynamicSamplingContext);
              setHeadersOnRequest(request4, sentryTrace, sentryBaggageHeader);
            }
          }
        };
      }
      __init5() {
        this._onRequestEnd = (message) => {
          const hub = getCurrentHub();
          if (!hub.getIntegration(_Undici)) {
            return;
          }
          const { request: request4, response } = message;
          const stringUrl = request4.origin ? request4.origin.toString() + request4.path : request4.path;
          if (isSentryRequestUrl(stringUrl, hub)) {
            return;
          }
          const span = request4.__sentry_span__;
          if (span) {
            span.setHttpStatus(response.statusCode);
            span.finish();
          }
          if (this._options.breadcrumbs) {
            hub.addBreadcrumb(
              {
                category: "http",
                data: {
                  method: request4.method,
                  status_code: response.statusCode,
                  url: stringUrl
                },
                type: "http"
              },
              {
                event: "response",
                request: request4,
                response
              }
            );
          }
        };
      }
      __init6() {
        this._onRequestError = (message) => {
          const hub = getCurrentHub();
          if (!hub.getIntegration(_Undici)) {
            return;
          }
          const { request: request4 } = message;
          const stringUrl = request4.origin ? request4.origin.toString() + request4.path : request4.path;
          if (isSentryRequestUrl(stringUrl, hub)) {
            return;
          }
          const span = request4.__sentry_span__;
          if (span) {
            span.setStatus("internal_error");
            span.finish();
          }
          if (this._options.breadcrumbs) {
            hub.addBreadcrumb(
              {
                category: "http",
                data: {
                  method: request4.method,
                  url: stringUrl
                },
                level: "error",
                type: "http"
              },
              {
                event: "error",
                request: request4
              }
            );
          }
        };
      }
    };
    Undici.__initStatic();
    __name(setHeadersOnRequest, "setHeadersOnRequest");
    __name(createRequestSpan, "createRequestSpan");
  }
});
function connectToSpotlight(client, options) {
  const spotlightUrl = parseSidecarUrl(options.sidecarUrl);
  if (!spotlightUrl) {
    return;
  }
  let failedRequests = 0;
  if (typeof client.on !== "function") {
    logger2.warn("[Spotlight] Cannot connect to spotlight due to missing method on SDK client (`client.on`)");
    return;
  }
  client.on("beforeEnvelope", (envelope) => {
    if (failedRequests > 3) {
      logger2.warn("[Spotlight] Disabled Sentry -> Spotlight integration due to too many failed requests");
      return;
    }
    const serializedEnvelope = serializeEnvelope(envelope);
    const req = http__namespace.request(
      {
        method: "POST",
        path: spotlightUrl.pathname,
        hostname: spotlightUrl.hostname,
        port: spotlightUrl.port,
        headers: {
          "Content-Type": "application/x-sentry-envelope"
        }
      },
      (res) => {
        res.on("data", () => {
        });
        res.on("end", () => {
        });
        res.setEncoding("utf8");
      }
    );
    req.on("error", () => {
      failedRequests++;
      logger2.warn("[Spotlight] Failed to send envelope to Spotlight Sidecar");
    });
    req.write(serializedEnvelope);
    req.end();
  });
}
function parseSidecarUrl(url4) {
  try {
    return new Url.URL(`${url4}`);
  } catch (e10) {
    logger2.warn(`[Spotlight] Invalid sidecar URL: ${url4}`);
    return void 0;
  }
}
var Spotlight;
var init_spotlight = __esm({
  "../../node_modules/.pnpm/@sentry+node@7.87.0_supports-color@9.2.2/node_modules/@sentry/node/esm/integrations/spotlight.js"() {
    init_import_meta_url();
    init_esm7();
    init_esm7();
    Spotlight = class _Spotlight {
      static {
        __name(this, "Spotlight");
      }
      static __initStatic() {
        this.id = "Spotlight";
      }
      __init() {
        this.name = _Spotlight.id;
      }
      constructor(options) {
        _Spotlight.prototype.__init.call(this);
        this._options = {
          sidecarUrl: _optionalChain([options, "optionalAccess", (_5) => _5.sidecarUrl]) || "http://localhost:8969/stream"
        };
      }
      /**
       * JSDoc
       */
      setupOnce() {
      }
      /**
       * Sets up forwarding envelopes to the Spotlight Sidecar
       */
      setup(client) {
        if (typeof process === "object" && process.env && true) {
          logger2.warn("[Spotlight] It seems you're not in dev mode. Do you really want to have Spotlight enabled?");
        }
        connectToSpotlight(client, this._options);
      }
    };
    Spotlight.__initStatic();
    __name(connectToSpotlight, "connectToSpotlight");
    __name(parseSidecarUrl, "parseSidecarUrl");
  }
});

// ../../node_modules/.pnpm/@sentry+node@7.87.0_supports-color@9.2.2/node_modules/@sentry/node/esm/sdk.js
function init2(options = {}) {
  if (isAnrChildProcess()) {
    options.autoSessionTracking = false;
    options.tracesSampleRate = 0;
  }
  const carrier = getMainCarrier();
  setNodeAsyncContextStrategy();
  const autoloadedIntegrations = _optionalChain([carrier, "access", (_5) => _5.__SENTRY__, "optionalAccess", (_22) => _22.integrations]) || [];
  options.defaultIntegrations = options.defaultIntegrations === false ? [] : [
    ...Array.isArray(options.defaultIntegrations) ? options.defaultIntegrations : defaultIntegrations,
    ...autoloadedIntegrations
  ];
  if (options.dsn === void 0 && process.env.SENTRY_DSN) {
    options.dsn = process.env.SENTRY_DSN;
  }
  const sentryTracesSampleRate = process.env.SENTRY_TRACES_SAMPLE_RATE;
  if (options.tracesSampleRate === void 0 && sentryTracesSampleRate) {
    const tracesSampleRate = parseFloat(sentryTracesSampleRate);
    if (isFinite(tracesSampleRate)) {
      options.tracesSampleRate = tracesSampleRate;
    }
  }
  if (options.release === void 0) {
    const detectedRelease = getSentryRelease();
    if (detectedRelease !== void 0) {
      options.release = detectedRelease;
    } else {
      options.autoSessionTracking = false;
    }
  }
  if (options.environment === void 0 && process.env.SENTRY_ENVIRONMENT) {
    options.environment = process.env.SENTRY_ENVIRONMENT;
  }
  if (options.autoSessionTracking === void 0 && options.dsn !== void 0) {
    options.autoSessionTracking = true;
  }
  if (options.instrumenter === void 0) {
    options.instrumenter = "sentry";
  }
  const clientOptions = {
    ...options,
    stackParser: stackParserFromStackParserOptions(options.stackParser || defaultStackParser),
    integrations: getIntegrationsToSetup(options),
    transport: options.transport || makeNodeTransport
  };
  initAndBind(options.clientClass || NodeClient, clientOptions);
  if (options.autoSessionTracking) {
    startSessionTracking();
  }
  updateScopeFromEnvVariables();
  if (options.spotlight) {
    const client = getCurrentHub().getClient();
    if (client && client.addIntegration) {
      client.setupIntegrations(true);
      client.addIntegration(
        new Spotlight({ sidecarUrl: typeof options.spotlight === "string" ? options.spotlight : void 0 })
      );
    }
  }
}
function getSentryRelease(fallback) {
  if (process.env.SENTRY_RELEASE) {
    return process.env.SENTRY_RELEASE;
  }
  if (GLOBAL_OBJ.SENTRY_RELEASE && GLOBAL_OBJ.SENTRY_RELEASE.id) {
    return GLOBAL_OBJ.SENTRY_RELEASE.id;
  }
  return (
    // GitHub Actions - https://help.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables#default-environment-variables
    process.env.GITHUB_SHA || // Netlify - https://docs.netlify.com/configure-builds/environment-variables/#build-metadata
    process.env.COMMIT_REF || // Vercel - https://vercel.com/docs/v2/build-step#system-environment-variables
    process.env.VERCEL_GIT_COMMIT_SHA || process.env.VERCEL_GITHUB_COMMIT_SHA || process.env.VERCEL_GITLAB_COMMIT_SHA || process.env.VERCEL_BITBUCKET_COMMIT_SHA || // Zeit (now known as Vercel)
    process.env.ZEIT_GITHUB_COMMIT_SHA || process.env.ZEIT_GITLAB_COMMIT_SHA || process.env.ZEIT_BITBUCKET_COMMIT_SHA || // Cloudflare Pages - https://developers.cloudflare.com/pages/platform/build-configuration/#environment-variables
    process.env.CF_PAGES_COMMIT_SHA || fallback
  );
}
function startSessionTracking() {
  const hub = getCurrentHub();
  hub.startSession();
  process.on("beforeExit", () => {
    const session = hub.getScope().getSession();
    const terminalStates = ["exited", "crashed"];
    if (session && !terminalStates.includes(session.status)) hub.endSession();
  });
}
function updateScopeFromEnvVariables() {
  const sentryUseEnvironment = (process.env.SENTRY_USE_ENVIRONMENT || "").toLowerCase();
  if (!["false", "n", "no", "off", "0"].includes(sentryUseEnvironment)) {
    const sentryTraceEnv = process.env.SENTRY_TRACE;
    const baggageEnv = process.env.SENTRY_BAGGAGE;
    const { propagationContext } = tracingContextFromHeaders(sentryTraceEnv, baggageEnv);
    getCurrentHub().getScope().setPropagationContext(propagationContext);
  }
}
var defaultIntegrations, defaultStackParser;
var init_sdk2 = __esm({
  "../../node_modules/.pnpm/@sentry+node@7.87.0_supports-color@9.2.2/node_modules/@sentry/node/esm/sdk.js"() {
    init_import_meta_url();
    init_esm7();
    init_esm8();
    init_esm7();
    init_anr();
    init_async();
    init_client4();
    init_console2();
    init_http4();
    init_onuncaughtexception();
    init_onunhandledrejection();
    init_modules();
    init_contextlines();
    init_context();
    init_localvariables();
    init_undici();
    init_spotlight();
    init_module();
    init_http2();
    defaultIntegrations = [
      // Common
      new integrations_exports3.InboundFilters(),
      new integrations_exports3.FunctionToString(),
      new integrations_exports3.LinkedErrors(),
      // Native Wrappers
      new Console(),
      new Http(),
      new Undici(),
      // Global Handlers
      new OnUncaughtException(),
      new OnUnhandledRejection(),
      // Event Info
      new ContextLines(),
      new LocalVariables(),
      new Context(),
      new Modules(),
      new RequestData()
    ];
    __name(init2, "init");
    __name(getSentryRelease, "getSentryRelease");
    defaultStackParser = createStackParser(nodeStackLineParser(getModuleFromFilename));
    __name(startSessionTracking, "startSessionTracking");
    __name(updateScopeFromEnvVariables, "updateScopeFromEnvVariables");
  }
});

// ../../node_modules/.pnpm/@sentry+node@7.87.0_supports-color@9.2.2/node_modules/@sentry/node/esm/integrations/index.js
var integrations_exports4 = {};
__export(integrations_exports4, {
  Console: () => Console,
  Context: () => Context,
  ContextLines: () => ContextLines,
  Http: () => Http,
  LocalVariables: () => LocalVariables,
  Modules: () => Modules,
  OnUncaughtException: () => OnUncaughtException,
  OnUnhandledRejection: () => OnUnhandledRejection,
  RequestData: () => RequestData,
  Spotlight: () => Spotlight,
  Undici: () => Undici
});
var init_integrations4 = __esm({
  "../../node_modules/.pnpm/@sentry+node@7.87.0_supports-color@9.2.2/node_modules/@sentry/node/esm/integrations/index.js"() {
    init_import_meta_url();
    init_console2();
    init_http4();
    init_onuncaughtexception();
    init_onunhandledrejection();
    init_modules();
    init_contextlines();
    init_context();
    init_esm8();
    init_localvariables();
    init_undici();
    init_spotlight();
  }
});

// ../../node_modules/.pnpm/@sentry+node@7.87.0_supports-color@9.2.2/node_modules/@sentry/node/esm/tracing/integrations.js
var integrations_exports5 = {};
__export(integrations_exports5, {
  Apollo: () => Apollo,
  Express: () => Express,
  GraphQL: () => GraphQL,
  Mongo: () => Mongo,
  Mysql: () => Mysql,
  Postgres: () => Postgres,
  Prisma: () => Prisma
});
var init_integrations5 = __esm({
  "../../node_modules/.pnpm/@sentry+node@7.87.0_supports-color@9.2.2/node_modules/@sentry/node/esm/tracing/integrations.js"() {
    init_import_meta_url();
    init_esm9();
  }
});
var init_esm10 = __esm({
  "../../node_modules/.pnpm/@sentry+node@7.87.0_supports-color@9.2.2/node_modules/@sentry/node/esm/index.js"() {
    init_import_meta_url();
    init_esm8();
    init_esm8();
    init_sdk2();
    init_integrations4();
    init_integrations5();
    ({
      ...integrations_exports3,
      ...integrations_exports4,
      ...integrations_exports5
    });
  }
});

// src/sentry/index.ts
function setupSentry() {
  if (typeof SENTRY_DSN !== "undefined") {
    init2({
      release: `wrangler@${version}`,
      dsn: SENTRY_DSN,
      transport: makeSentry10Transport,
      integrations(defaultIntegrations2) {
        return defaultIntegrations2.filter(
          ({ name: name2 }) => !disabledDefaultIntegrations.includes(name2)
        );
      },
      beforeSend(event) {
        delete event.server_name;
        if (event.contexts !== void 0) {
          delete event.contexts.culture;
        }
        const fakeInstallPath = process.platform === "win32" ? "C:\\Project\\" : "/project/";
        for (const exception of event.exception?.values ?? []) {
          for (const frame of exception.stacktrace?.frames ?? []) {
            if (frame.filename === void 0) {
              continue;
            }
            const nodeModulesIndex = frame.filename.indexOf("node_modules");
            if (nodeModulesIndex === -1) {
              continue;
            }
            frame.filename = fakeInstallPath + frame.filename.substring(nodeModulesIndex);
          }
        }
        return event;
      }
    });
  }
}
function addBreadcrumb2(message, level = "log") {
  if (typeof SENTRY_DSN !== "undefined") {
    addBreadcrumb({
      message,
      level
    });
  }
}
async function captureGlobalException(e10) {
  if (typeof SENTRY_DSN !== "undefined") {
    const sendErrorReportsEnvVar = getWranglerSendErrorReportsFromEnv();
    sentryReportingAllowed = sendErrorReportsEnvVar !== void 0 ? sendErrorReportsEnvVar : await confirm(
      "Would you like to report this error to Cloudflare? Wrangler's output and the error details will be shared with the Wrangler team to help us diagnose and fix the issue.",
      { fallbackValue: false }
    );
    if (!sentryReportingAllowed) {
      logger.debug(`Sentry: Reporting disabled - would have sent ${e10}.`);
      return;
    }
    logger.debug(`Sentry: Capturing exception ${e10}`);
    captureException(e10);
  }
}
async function closeSentry() {
  if (typeof SENTRY_DSN !== "undefined") {
    await close();
  }
}
var import_undici11, sentryReportingAllowed, makeSentry10Transport, disabledDefaultIntegrations;
var init_sentry = __esm({
  "src/sentry/index.ts"() {
    init_import_meta_url();
    init_dist();
    init_esm10();
    init_esm7();
    import_undici11 = __toESM(require_undici());
    init_package();
    init_dialogs();
    init_logger();
    sentryReportingAllowed = false;
    makeSentry10Transport = /* @__PURE__ */ __name((options) => {
      let eventQueue = [];
      const transportSentry10 = /* @__PURE__ */ __name(async (request4) => {
        const sentryWorkerPayload = {
          envelope: request4.body,
          url: options.url
        };
        try {
          if (sentryReportingAllowed) {
            const eventsToSend = [...eventQueue];
            eventQueue = [];
            for (const event of eventsToSend) {
              await (0, import_undici11.fetch)(event[0], event[1]);
            }
            const response = await (0, import_undici11.fetch)(
              `https://platform.dash.cloudflare.com/sentry/envelope`,
              {
                method: "POST",
                headers: {
                  Accept: "*/*",
                  "Content-Type": "application/json"
                },
                body: JSON.stringify(sentryWorkerPayload)
              }
            );
            return {
              statusCode: response.status,
              headers: {
                "x-sentry-rate-limits": response.headers.get(
                  "X-Sentry-Rate-Limits"
                ),
                "retry-after": response.headers.get("Retry-After")
              }
            };
          } else {
            eventQueue.push([
              `https://platform.dash.cloudflare.com/sentry/envelope`,
              {
                method: "POST",
                headers: {
                  Accept: "*/*",
                  "Content-Type": "application/json"
                },
                body: JSON.stringify(sentryWorkerPayload)
              }
            ]);
            return {
              statusCode: 200
            };
          }
        } catch (err) {
          logger.error(err);
          return rejectedSyncPromise(err);
        }
      }, "transportSentry10");
      return createTransport(options, transportSentry10);
    }, "makeSentry10Transport");
    disabledDefaultIntegrations = [
      "LocalVariables",
      // Local variables may contain tokens and PII
      "Http",
      // Only captures method/URL/response status, but URL may contain PII
      "Undici",
      // Same as "Http"
      "RequestData"
      // Request data to Wrangler's HTTP servers may contain PII
    ];
    __name(setupSentry, "setupSentry");
    __name(addBreadcrumb2, "addBreadcrumb");
    __name(captureGlobalException, "captureGlobalException");
    __name(closeSentry, "closeSentry");
  }
});

// src/utils/is-local.ts
function isLocal(args, defaultValue = true) {
  if (args.local === void 0 && args.remote === void 0) {
    return defaultValue;
  }
  return args.local === true || args.remote === false;
}
function printResourceLocation(location) {
  logger.log(source_default.hex("#BD5B08").bold("Resource location:"), location, "\n");
}
var init_is_local = __esm({
  "src/utils/is-local.ts"() {
    init_import_meta_url();
    init_source();
    init_logger();
    __name(isLocal, "isLocal");
    __name(printResourceLocation, "printResourceLocation");
  }
});

// src/core/register-yargs-command.ts
function createRegisterYargsCommand(yargs, subHelp, argv) {
  return /* @__PURE__ */ __name(function registerCommand(segment, def, registerSubTreeCallback) {
    yargs.command(
      segment,
      def.metadata?.hidden ? false : def.metadata?.description,
      // Cast to satisfy TypeScript overload selection
      (subYargs) => {
        if (def.type === "command") {
          const args = def.args ?? {};
          const positionalArgs = new Set(def.positionalArgs);
          const nonPositional = Object.fromEntries(
            Object.entries(args).filter(([key]) => !positionalArgs.has(key)).map(([name2, opts]) => [
              name2,
              {
                ...opts,
                group: "group" in opts ? source_default.bold(opts.group) : void 0
              }
            ])
          );
          subYargs.options(nonPositional).epilogue(def.metadata?.epilogue ?? "").example(
            def.metadata.examples?.map((ex) => [
              ex.command,
              ex.description
            ]) ?? []
          );
          for (const hide of def.metadata.hideGlobalFlags ?? []) {
            subYargs.hide(hide);
          }
          for (const [key, opt] of Object.entries(args)) {
            if (!opt.array && opt.type !== "array") {
              subYargs.check(demandSingleValue(key));
            }
          }
          for (const key of def.positionalArgs ?? []) {
            subYargs.positional(key, args[key]);
          }
        } else if (def.type === "namespace") {
          for (const hide of def.metadata.hideGlobalFlags ?? []) {
            subYargs.hide(hide);
          }
          subYargs.command(subHelp);
        }
        registerSubTreeCallback();
      },
      // Only attach the handler for commands, not namespaces
      def.type === "command" ? createHandler(def, argv) : void 0
    );
  }, "registerCommand");
}
function createHandler(def, argv) {
  const sanitizedCommand = def.command.replace(/^wrangler\s+/, "");
  return /* @__PURE__ */ __name(async function handler(args) {
    const startTime = Date.now();
    addBreadcrumb2(def.command);
    try {
      const shouldPrintBanner = def.behaviour?.printBanner ?? true;
      if (shouldPrintBanner === true || typeof shouldPrintBanner === "function" && shouldPrintBanner(args) === true) {
        await printWranglerBanner();
      }
      if (!getWranglerHideBanner()) {
        if (def.metadata.deprecated) {
          logger.warn(def.metadata.deprecatedMessage);
        }
        if (def.metadata.statusMessage) {
          logger.warn(def.metadata.statusMessage);
        }
      }
      await def.validateArgs?.(args);
      const shouldPrintResourceLocation = typeof def.behaviour?.printResourceLocation === "function" ? def.behaviour?.printResourceLocation(args) : def.behaviour?.printResourceLocation;
      if (shouldPrintResourceLocation) {
        const remote = "remote" in args && typeof args.remote === "boolean" ? args.remote : void 0;
        const local = "local" in args && typeof args.local === "boolean" ? args.local : void 0;
        const resourceIsLocal = isLocal({ remote, local });
        if (resourceIsLocal) {
          printResourceLocation("local");
          logger.log(
            `Use --remote if you want to access the remote instance.
`
          );
        } else {
          printResourceLocation("remote");
        }
      }
      const experimentalFlags = def.behaviour?.overrideExperimentalFlags ? def.behaviour?.overrideExperimentalFlags(args) : {
        MULTIWORKER: false,
        RESOURCES_PROVISION: args.experimentalProvision ?? false,
        AUTOCREATE_RESOURCES: args.experimentalAutoCreate
      };
      await run(experimentalFlags, async () => {
        const config = def.behaviour?.provideConfig ?? true ? readConfig(args, {
          hideWarnings: !(def.behaviour?.printConfigWarnings ?? true),
          useRedirectIfAvailable: def.behaviour?.useConfigRedirectIfAvailable
        }) : exports.unstable_defaultWranglerConfig;
        const dispatcher = getMetricsDispatcher({
          sendMetrics: config.send_metrics,
          hasAssets: !!config.assets?.directory,
          configPath: config.configPath,
          argv
        });
        if (def.behaviour?.warnIfMultipleEnvsConfiguredButNoneSpecified) {
          if (!("env" in args) && config.configPath) {
            const { rawConfig } = experimental_readRawConfig2(
              {
                config: config.configPath
              },
              { hideWarnings: true }
            );
            const availableEnvs = Object.keys(rawConfig.env ?? {});
            if (availableEnvs.length > 0) {
              logger.warn(
                dedent3`
										Multiple environments are defined in the Wrangler configuration file, but no target environment was specified for the ${sanitizedCommand} command.
										To avoid unintentional changes to the wrong environment, it is recommended to explicitly specify the target environment using the \`-e|--env\` flag.
										If your intention is to use the top-level environment of your configuration simply pass an empty string to the flag to target such environment. For example \`--env=""\`.
									`
              );
            }
          }
        }
        const allowedArgs = getAllowedArgs(
          COMMAND_ARG_ALLOW_LIST,
          sanitizedCommand
        );
        const argsWithSanitizedKeys = sanitizeArgKeys(args, argv);
        const sanitizedArgs = sanitizeArgValues(
          argsWithSanitizedKeys,
          allowedArgs
        );
        const argsUsed = Object.keys(argsWithSanitizedKeys).sort();
        dispatcher.sendCommandEvent(
          "wrangler command started",
          {
            sanitizedCommand,
            sanitizedArgs,
            argsUsed
          },
          def.behaviour
        );
        try {
          const result = await def.handler(args, {
            sdk: createCloudflareClient(config),
            config,
            errors: { UserError, FatalError },
            logger,
            fetchResult
          });
          const durationMs = Date.now() - startTime;
          dispatcher.sendCommandEvent(
            "wrangler command completed",
            {
              sanitizedCommand,
              sanitizedArgs,
              argsUsed,
              durationMs
            },
            def.behaviour
          );
          return result;
        } catch (err) {
          if (err instanceof CommandHandledError) {
            throw err;
          }
          const durationMs = Date.now() - startTime;
          dispatcher.sendCommandEvent(
            "wrangler command errored",
            {
              sanitizedCommand,
              sanitizedArgs,
              argsUsed,
              durationMs,
              errorType: getErrorType(err),
              errorMessage: err instanceof UserError ? err.telemetryMessage : void 0
            },
            def.behaviour
          );
          await handleError(err, args, argv);
          throw new CommandHandledError(err);
        }
      });
    } catch (err) {
      const outputErr = err instanceof CommandHandledError ? err.originalError : err;
      if (outputErr instanceof Error) {
        const code = "code" in outputErr ? outputErr.code : void 0;
        writeOutput({
          type: "command-failed",
          version: 1,
          code,
          message: outputErr.message
        });
      }
      throw err;
    }
  }, "handler");
}
var init_register_yargs_command = __esm({
  "src/core/register-yargs-command.ts"() {
    init_import_meta_url();
    init_dist();
    init_source();
    init_src2();
    init_cfetch();
    init_internal();
    init_config();
    init_experimental_flags();
    init_logger();
    init_metrics();
    init_sanitization();
    init_output();
    init_sentry();
    init_dedent();
    init_is_local();
    init_wrangler_banner();
    init_CommandHandledError();
    init_handle_errors();
    init_helpers3();
    __name(createRegisterYargsCommand, "createRegisterYargsCommand");
    __name(createHandler, "createHandler");
  }
});

// src/d1/index.ts
var d1Namespace;
var init_d12 = __esm({
  "src/d1/index.ts"() {
    init_import_meta_url();
    init_create_command();
    d1Namespace = createNamespace({
      metadata: {
        description: "\u{1F5C4}\uFE0F Manage Workers D1 databases",
        status: "stable",
        owner: "Product: D1",
        category: "Storage & databases"
      }
    });
  }
});

// src/utils/add-created-resource-config.ts
async function createdResourceConfig(resource, snippet, configPath, env6, defaults3) {
  const envString = env6 ? ` in the "${env6}" environment` : "";
  logger.log(
    `To access your new ${friendlyBindingNames[resource]} in your Worker, add the following snippet to your configuration file${envString}:`
  );
  logger.log(
    formatConfigSnippet(
      {
        [resource]: [
          {
            ...snippet(defaults3?.binding),
            ...defaults3?.useRemote === true ? { remote: true } : {}
          }
        ]
      },
      configPath
    )
  );
  const format11 = configFormat(configPath);
  if (configPath && JSON_CONFIG_FORMATS.includes(format11)) {
    const writeToConfig = defaults3?.binding ?? defaults3?.updateConfig ?? await confirm("Would you like Wrangler to add it on your behalf?", {
      defaultValue: true,
      // We don't want to automatically write to config in CI
      fallbackValue: false
    });
    if (writeToConfig) {
      const bindingName = defaults3?.binding ?? await prompt("What binding name would you like to use?", {
        defaultValue: snippet().binding
      });
      const useRemote = defaults3?.useRemote ?? (defaults3?.binding || defaults3?.updateConfig ? false : await confirm(
        "For local dev, do you want to connect to the remote resource instead of a local resource?",
        { defaultValue: false }
      ));
      const configFilePatch = {
        [resource]: [
          { ...snippet(bindingName), ...useRemote ? { remote: true } : {} }
        ]
      };
      exports.experimental_patchConfig(
        configPath,
        env6 ? { env: { [env6]: configFilePatch } } : configFilePatch,
        true
      );
    }
  }
}
var sharedResourceCreationArgs;
var init_add_created_resource_config = __esm({
  "src/utils/add-created-resource-config.ts"() {
    init_import_meta_url();
    init_dist();
    init_dialogs();
    init_logger();
    sharedResourceCreationArgs = {
      "use-remote": {
        type: "boolean",
        description: "Use a remote binding when adding the newly created resource to your config"
      },
      "update-config": {
        type: "boolean",
        description: "Automatically update your config file with the newly added resource"
      },
      binding: {
        type: "string",
        description: "The binding name of this resource in your Worker"
      }
    };
    __name(createdResourceConfig, "createdResourceConfig");
  }
});

// src/utils/getValidBindingName.ts
function getValidBindingName(name2, fallback) {
  let bindingName = name2.replace(/[\s-]/g, "_");
  bindingName = bindingName.replace(/[^a-zA-Z0-9_]/g, "");
  bindingName = bindingName.replace(/_+/g, "_");
  if (/^[0-9]/.test(bindingName)) {
    bindingName = "_" + bindingName;
  }
  if (!bindingName.length || /^_+$/.test(bindingName)) {
    return fallback;
  }
  return bindingName;
}
var init_getValidBindingName = __esm({
  "src/utils/getValidBindingName.ts"() {
    init_import_meta_url();
    __name(getValidBindingName, "getValidBindingName");
  }
});

// src/d1/constants.ts
var DEFAULT_MIGRATION_PATH, DEFAULT_MIGRATION_TABLE, LOCATION_CHOICES, JURISDICTION_CHOICES, D1_DOCS_URL;
var init_constants6 = __esm({
  "src/d1/constants.ts"() {
    init_import_meta_url();
    DEFAULT_MIGRATION_PATH = "./migrations";
    DEFAULT_MIGRATION_TABLE = "d1_migrations";
    LOCATION_CHOICES = ["weur", "eeur", "apac", "oc", "wnam", "enam"];
    JURISDICTION_CHOICES = ["eu", "fedramp"];
    D1_DOCS_URL = "https://developers.cloudflare.com/d1/";
  }
});

// src/d1/create.ts
async function createD1Database(complianceConfig, accountId, name2, location, jurisdiction) {
  try {
    return await fetchResult(
      complianceConfig,
      `/accounts/${accountId}/d1/database`,
      {
        method: "POST",
        headers: {
          "Content-Type": "application/json"
        },
        body: JSON.stringify({
          name: name2,
          ...location && { primary_location_hint: location },
          ...jurisdiction && { jurisdiction }
        })
      }
    );
  } catch (e10) {
    const errorCode = e10.code;
    if (errorCode === 7502) {
      throw new UserError("A database with that name already exists");
    }
    if (errorCode === 7406) {
      throw new UserError(
        esm_default3`
					You have reached the maximum number of D1 databases for your account.
					Please consider deleting unused databases, or visit the D1 documentation to learn more: ${D1_DOCS_URL}

					To list your existing databases, run: wrangler d1 list
					To delete a database, run: wrangler d1 delete <database-name>
				`
      );
    }
    throw e10;
  }
}
var d1CreateCommand;
var init_create4 = __esm({
  "src/d1/create.ts"() {
    init_import_meta_url();
    init_dist();
    init_esm2();
    init_cfetch();
    init_create_command();
    init_logger();
    init_user3();
    init_add_created_resource_config();
    init_getValidBindingName();
    init_constants6();
    __name(createD1Database, "createD1Database");
    d1CreateCommand = createCommand({
      metadata: {
        description: "Creates a new D1 database, and provides the binding and UUID that you will put in your config file",
        epilogue: "This command acts on remote D1 Databases.",
        status: "stable",
        owner: "Product: D1"
      },
      args: {
        name: {
          type: "string",
          demandOption: true,
          description: "The name of the new D1 database"
        },
        location: {
          type: "string",
          choices: [
            ...LOCATION_CHOICES,
            ...getD1ExtraLocationChoices()?.split(",") ?? []
          ],
          description: esm_default3`
					A hint for the primary location of the new DB. Options:
						weur: Western Europe
						eeur: Eastern Europe
						apac: Asia Pacific
						oc: Oceania
						wnam: Western North America
						enam: Eastern North America

					`
        },
        jurisdiction: {
          type: "string",
          choices: [...JURISDICTION_CHOICES],
          description: esm_default3`
				The location to restrict the D1 database to run and store data within to comply with local regulations. Note that if jurisdictions are set, the location hint is ignored. Options:
					eu: The European Union
					fedramp: FedRAMP-compliant data centers
			`
        },
        ...sharedResourceCreationArgs
      },
      positionalArgs: ["name"],
      async handler({ name: name2, location, jurisdiction, env: env6, ...args }, { config }) {
        const accountId = await requireAuth(config);
        const db = await createD1Database(
          config,
          accountId,
          name2,
          location,
          jurisdiction
        );
        logger.log(
          `\u2705 Successfully created DB '${db.name}'${db.created_in_region ? ` in region ${db.created_in_region}` : location ? ` using primary location hint ${location}` : ``}`
        );
        logger.log("Created your new D1 database.\n");
        await createdResourceConfig(
          "d1_databases",
          (bindingName) => ({
            binding: getValidBindingName(bindingName ?? db.name, "DB"),
            database_name: db.name,
            database_id: db.uuid
          }),
          config.configPath,
          env6,
          args
        );
      }
    });
  }
});

// src/d1/list.ts
var d1ListCommand, listDatabases;
var init_list5 = __esm({
  "src/d1/list.ts"() {
    init_import_meta_url();
    init_cfetch();
    init_create_command();
    init_logger();
    init_user3();
    d1ListCommand = createCommand({
      metadata: {
        description: "List all D1 databases in your account",
        epilogue: "This command acts on remote D1 Databases.",
        status: "stable",
        owner: "Product: D1"
      },
      behaviour: {
        printBanner: /* @__PURE__ */ __name((args) => !args.json, "printBanner")
      },
      args: {
        json: {
          type: "boolean",
          description: "Return output as JSON",
          default: false
        }
      },
      async handler({ json }, { config }) {
        const accountId = await requireAuth(config);
        const dbs = await listDatabases(config, accountId);
        if (json) {
          logger.log(JSON.stringify(dbs, null, 2));
        } else {
          logger.table(
            dbs.map(
              (db) => Object.fromEntries(
                Object.entries(db).map(([k7, v8]) => [k7, String(v8 ?? "")])
              )
            )
          );
        }
      }
    });
    listDatabases = /* @__PURE__ */ __name(async (complianceConfig, accountId, limitCalls = false, pageSize = 10) => {
      let page = 1;
      const results = [];
      while (results.length % pageSize === 0) {
        const json = await fetchResult(
          complianceConfig,
          `/accounts/${accountId}/d1/database`,
          {},
          new URLSearchParams({
            per_page: pageSize.toString(),
            page: page.toString()
          })
        );
        page++;
        results.push(...json);
        if (limitCalls && page > 3) {
          break;
        }
        if (json.length < pageSize) {
          break;
        }
      }
      return results;
    }, "listDatabases");
  }
});

// src/d1/utils.ts
function getDatabaseInfoFromConfig(config, name2, options) {
  const requireDatabaseId = options?.requireDatabaseId ?? true;
  for (const d1Database of config.d1_databases) {
    if (name2 === d1Database.database_name || name2 === d1Database.binding) {
      if (requireDatabaseId && !d1Database.database_id) {
        throw new UserError(
          `Found a database with name or binding ${name2} but it is missing a database_id, which is needed for operations on remote resources. Please create the remote D1 database by deploying your project or running 'wrangler d1 create ${name2}'.`
        );
      }
      const uuid = d1Database.database_id ?? d1Database.binding;
      return {
        uuid,
        previewDatabaseUuid: d1Database.preview_database_id,
        binding: d1Database.binding,
        name: d1Database.database_name,
        migrationsTableName: d1Database.migrations_table || DEFAULT_MIGRATION_TABLE,
        migrationsFolderPath: d1Database.migrations_dir || DEFAULT_MIGRATION_PATH,
        internal_env: d1Database.database_internal_env
      };
    }
  }
  return null;
}
var getDatabaseByNameOrBinding, getDatabaseInfoFromIdOrName;
var init_utils8 = __esm({
  "src/d1/utils.ts"() {
    init_import_meta_url();
    init_dist();
    init_cfetch();
    init_constants6();
    init_list5();
    __name(getDatabaseInfoFromConfig, "getDatabaseInfoFromConfig");
    getDatabaseByNameOrBinding = /* @__PURE__ */ __name(async (config, accountId, name2) => {
      const dbFromConfig = getDatabaseInfoFromConfig(config, name2);
      if (dbFromConfig) {
        return dbFromConfig;
      }
      const allDBs = await listDatabases(config, accountId);
      const matchingDB = allDBs.find((db) => db.name === name2);
      if (!matchingDB) {
        throw new UserError(`Couldn't find DB with name '${name2}'`);
      }
      return matchingDB;
    }, "getDatabaseByNameOrBinding");
    getDatabaseInfoFromIdOrName = /* @__PURE__ */ __name(async (complianceConfig, accountId, databaseIdOrName) => {
      return await fetchResult(
        complianceConfig,
        `/accounts/${accountId}/d1/database/${databaseIdOrName}`,
        {
          headers: {
            "Content-Type": "application/json"
          }
        }
      );
    }, "getDatabaseInfoFromIdOrName");
  }
});

// src/d1/delete.ts
var d1DeleteCommand;
var init_delete3 = __esm({
  "src/d1/delete.ts"() {
    init_import_meta_url();
    init_source();
    init_cfetch();
    init_create_command();
    init_dialogs();
    init_logger();
    init_user3();
    init_is_local();
    init_utils8();
    d1DeleteCommand = createCommand({
      metadata: {
        description: "Delete a D1 database",
        status: "stable",
        epilogue: "This command acts on remote D1 Databases.",
        owner: "Product: D1"
      },
      behaviour: {
        printBanner: true
      },
      args: {
        name: {
          type: "string",
          demandOption: true,
          description: "The name or binding of the DB"
        },
        "skip-confirmation": {
          type: "boolean",
          description: "Skip confirmation",
          alias: "y",
          default: false
        }
      },
      positionalArgs: ["name"],
      async handler({ name: name2, skipConfirmation }, { config }) {
        const accountId = await requireAuth(config);
        const db = await getDatabaseByNameOrBinding(
          config,
          accountId,
          name2
        );
        printResourceLocation("remote");
        logger.log(
          `About to delete ${source_default.bold("remote")} database DB '${name2}' (${db.uuid}).
This action is irreversible and will permanently delete all data in the database.
`
        );
        if (!skipConfirmation) {
          const response = await confirm(`Ok to proceed?`);
          if (!response) {
            logger.log(`Not deleting.`);
            return;
          }
        }
        logger.log("Deleting...");
        await fetchResult(config, `/accounts/${accountId}/d1/database/${db.uuid}`, {
          method: "DELETE"
        });
        logger.log(`Deleted '${name2}' successfully.`);
      }
    });
  }
});

// ../../node_modules/.pnpm/md5-file@5.0.0/node_modules/md5-file/index.js
var require_md5_file = __commonJS({
  "../../node_modules/.pnpm/md5-file@5.0.0/node_modules/md5-file/index.js"(exports, module2) {
    init_import_meta_url();
    var crypto9 = __require("crypto");
    var fs33 = __require("fs");
    var BUFFER_SIZE = 8192;
    function md5FileSync(path84) {
      const fd = fs33.openSync(path84, "r");
      const hash = crypto9.createHash("md5");
      const buffer = Buffer.alloc(BUFFER_SIZE);
      try {
        let bytesRead;
        do {
          bytesRead = fs33.readSync(fd, buffer, 0, BUFFER_SIZE);
          hash.update(buffer.slice(0, bytesRead));
        } while (bytesRead === BUFFER_SIZE);
      } finally {
        fs33.closeSync(fd);
      }
      return hash.digest("hex");
    }
    __name(md5FileSync, "md5FileSync");
    function md5File2(path84) {
      return new Promise((resolve32, reject) => {
        const output = crypto9.createHash("md5");
        const input = fs33.createReadStream(path84);
        input.on("error", (err) => {
          reject(err);
        });
        output.once("readable", () => {
          resolve32(output.read().toString("hex"));
        });
        input.pipe(output);
      });
    }
    __name(md5File2, "md5File");
    module2.exports = md5File2;
    module2.exports.sync = md5FileSync;
  }
});

// src/d1/trimmer.ts
function trimSqlQuery(sql) {
  if (!mayContainTransaction(sql)) {
    return sql;
  }
  const trimmedSql = sql.replace("BEGIN TRANSACTION;", "").replace("COMMIT;", "");
  if (mayContainTransaction(trimmedSql)) {
    throw new UserError(
      "Wrangler could not process the provided SQL file, as it contains several transactions.\nD1 runs your SQL in a transaction for you.\nPlease export an SQL file from your SQLite database and try again."
    );
  }
  return trimmedSql;
}
function mayContainTransaction(sql) {
  return sql.includes("BEGIN TRANSACTION");
}
var init_trimmer = __esm({
  "src/d1/trimmer.ts"() {
    init_import_meta_url();
    init_dist();
    __name(trimSqlQuery, "trimSqlQuery");
    __name(mayContainTransaction, "mayContainTransaction");
  }
});

// src/d1/splitter.ts
function mayContainMultipleStatements(sql) {
  const trimmed = sql.trimEnd();
  const semiColonIndex = trimmed.indexOf(";");
  return semiColonIndex !== -1 && semiColonIndex !== trimmed.length - 1;
}
function splitSqlQuery(sql) {
  const trimmedSql = trimSqlQuery(sql);
  if (!mayContainMultipleStatements(trimmedSql)) {
    return [trimmedSql];
  }
  const split = splitSqlIntoStatements(trimmedSql);
  if (split.length === 0) {
    return [trimmedSql];
  } else {
    return split;
  }
}
function splitSqlIntoStatements(sql) {
  const statements = [];
  let str = "";
  const compoundStatementStack = [];
  const iterator = sql[Symbol.iterator]();
  let next = iterator.next();
  while (!next.done) {
    const char = next.value;
    if (compoundStatementStack[0]?.(str + char)) {
      compoundStatementStack.shift();
    }
    switch (char) {
      case `'`:
      case `"`:
      case "`":
        str += char + consumeUntilMarker(iterator, char);
        break;
      case `$`: {
        const dollarQuote = "$" + consumeWhile(iterator, isDollarQuoteIdentifier);
        str += dollarQuote;
        if (dollarQuote.endsWith("$")) {
          str += consumeUntilMarker(iterator, dollarQuote);
        }
        break;
      }
      case `-`:
        next = iterator.next();
        if (!next.done && next.value === "-") {
          consumeUntilMarker(iterator, "\n");
          str += "\n";
          break;
        } else {
          str += char;
          continue;
        }
      case `/`:
        next = iterator.next();
        if (!next.done && next.value === "*") {
          consumeUntilMarker(iterator, "*/");
          break;
        } else {
          str += char;
          continue;
        }
      case `;`:
        if (compoundStatementStack.length === 0) {
          statements.push(str);
          str = "";
        } else {
          str += char;
        }
        break;
      default:
        str += char;
        break;
    }
    if (isCompoundStatementStart(str)) {
      compoundStatementStack.unshift(isCompoundStatementEnd);
    }
    next = iterator.next();
  }
  statements.push(str);
  return statements.map((statement) => statement.trim()).filter((statement) => statement.length > 0);
}
function consumeWhile(iterator, predicate) {
  let next = iterator.next();
  let str = "";
  while (!next.done) {
    str += next.value;
    if (!predicate(str)) {
      break;
    }
    next = iterator.next();
  }
  return str;
}
function consumeUntilMarker(iterator, endMarker) {
  return consumeWhile(iterator, (str) => !str.endsWith(endMarker));
}
function isDollarQuoteIdentifier(str) {
  const lastChar = str.slice(-1);
  return (
    // The $ marks the end of the identifier
    lastChar !== "$" && // we allow numbers, underscore and letters with diacritical marks
    (/[0-9_]/i.test(lastChar) || lastChar.toLowerCase() !== lastChar.toUpperCase())
  );
}
function isCompoundStatementStart(str) {
  return /\s(BEGIN|CASE)\s$/i.test(str);
}
function isCompoundStatementEnd(str) {
  return /\sEND[;\s]$/.test(str);
}
var init_splitter = __esm({
  "src/d1/splitter.ts"() {
    init_import_meta_url();
    init_trimmer();
    __name(mayContainMultipleStatements, "mayContainMultipleStatements");
    __name(splitSqlQuery, "splitSqlQuery");
    __name(splitSqlIntoStatements, "splitSqlIntoStatements");
    __name(consumeWhile, "consumeWhile");
    __name(consumeUntilMarker, "consumeUntilMarker");
    __name(isDollarQuoteIdentifier, "isDollarQuoteIdentifier");
    __name(isCompoundStatementStart, "isCompoundStatementStart");
    __name(isCompoundStatementEnd, "isCompoundStatementEnd");
  }
});
async function executeSql({
  local,
  remote,
  config,
  name: name2,
  shouldPrompt,
  persistTo,
  file: file3,
  command: command2,
  json,
  preview
}) {
  const existingLogLevel = logger.loggerLevel;
  if (json) {
    logger.loggerLevel = "error";
  }
  const input = file3 ? { file: file3 } : command2 ? { command: command2 } : null;
  if (!input) {
    throw new UserError(`Error: must provide --command or --file.`);
  }
  if (local && remote) {
    throw new UserError(
      `Error: can't use --local and --remote at the same time`
    );
  }
  if (preview && !remote) {
    throw new UserError(`Error: can't use --preview without --remote`);
  }
  if (persistTo && !local) {
    throw new UserError(`Error: can't use --persist-to without --local`);
  }
  if (input.file) {
    await checkForSQLiteBinary(input.file);
  }
  const result = remote || preview ? await executeRemotely({
    config,
    name: name2,
    shouldPrompt,
    input,
    preview
  }) : await executeLocally({
    config,
    name: name2,
    input,
    persistTo
  });
  if (json) {
    logger.loggerLevel = existingLogLevel;
  }
  return result;
}
async function executeLocally({
  config,
  name: name2,
  input,
  persistTo
}) {
  const localDB = getDatabaseInfoFromConfig(config, name2, {
    requireDatabaseId: false
  });
  if (!localDB) {
    throw new UserError(
      `Couldn't find a D1 DB with the name or binding '${name2}' in your ${configFileName(config.configPath)} file.`
    );
  }
  const id = localDB.previewDatabaseUuid ?? localDB.uuid;
  const persistencePath = getLocalPersistencePath(persistTo, config);
  const d1Persist = path3__namespace.default.join(persistencePath, "v3", "d1");
  logger.log(
    `\u{1F300} Executing on local database ${name2} (${id}) from ${readableRelative(
      d1Persist
    )}:`
  );
  logger.log(
    "\u{1F300} To execute on your remote database, add a --remote flag to your wrangler command."
  );
  const mf = new miniflare.Miniflare({
    modules: true,
    script: "",
    d1Persist,
    d1Databases: { DATABASE: id }
  });
  const db = await mf.getD1Database("DATABASE");
  const sql = input.file ? readFileSync(input.file) : input.command;
  const queries = splitSqlQuery(sql);
  let results;
  try {
    results = await db.batch(queries.map((query) => db.prepare(query)));
  } catch (e10) {
    const cause = e10?.cause ?? e10;
    throw new UserError(cause.message);
  } finally {
    await mf.dispose();
  }
  assert53__default.default(Array.isArray(results));
  const allResults = results.map((result) => ({
    results: (result.results ?? []).map(
      (row) => Object.fromEntries(
        Object.entries(row).map(([key, value]) => {
          if (Array.isArray(value)) {
            value = `[${value.join(", ")}]`;
          }
          return [key, value];
        })
      )
    ),
    success: result.success,
    meta: { duration: result.meta?.duration }
  }));
  if (allResults.every((r10) => r10.success)) {
    logger.log(
      `\u{1F6A3} ${allResults.length} command${allResults.length === 1 ? "" : "s"} executed successfully.`
    );
  }
  return allResults;
}
async function executeRemotely({
  config,
  name: name2,
  shouldPrompt,
  input,
  preview
}) {
  if (input.file) {
    const warning = `\u26A0\uFE0F This process may take some time, during which your D1 database will be unavailable to serve queries.`;
    if (shouldPrompt) {
      const ok = await confirm(`${warning}
  Ok to proceed?`);
      if (!ok) {
        return null;
      }
    } else {
      logger.warn(warning);
    }
  }
  const accountId = await requireAuth(config);
  const db = await getDatabaseByNameOrBinding(
    config,
    accountId,
    name2
  );
  if (preview) {
    if (!db.previewDatabaseUuid) {
      throw new UserError(
        `Please define a \`preview_database_id\` in your ${configFileName(config.configPath)} file to execute your queries against a preview database`
      );
    }
    db.uuid = db.previewDatabaseUuid;
  }
  logger.log(
    `\u{1F300} Executing on ${db.previewDatabaseUuid ? "preview" : "remote"} database ${name2} (${db.uuid}):`
  );
  logger.log(
    "\u{1F300} To execute on your local development database, remove the --remote flag from your wrangler command."
  );
  if (input.file) {
    const etag = await (0, import_md5_file.default)(input.file);
    logger.log(
      source_default.gray(
        `Note: if the execution fails to complete, your DB will return to its original state and you can safely retry.`
      )
    );
    const initResponse = await spinnerWhile({
      promise: d1ApiPost(config, accountId, db, "import", { action: "init", etag }),
      startMessage: "Checking if file needs uploading"
    });
    const uploadRequired = "upload_url" in initResponse;
    if (!uploadRequired) {
      logger.log(`\u{1F300} File already uploaded. Processing.`);
    }
    const firstPollResponse = uploadRequired ? (
      // Upload the file to R2, then inform D1 to start processing it. The server delays before responding
      // in case the file is quite small and can be processed without a second round-trip.
      await uploadAndBeginIngestion(
        config,
        accountId,
        db,
        input.file,
        etag,
        initResponse
      )
    ) : initResponse;
    const finalResponse = await pollUntilComplete(
      firstPollResponse,
      config,
      accountId,
      db
    );
    if (finalResponse.status !== "complete") {
      throw new APIError({ text: `D1 reset before execute completed!` });
    }
    const {
      result: { num_queries, final_bookmark, meta }
    } = finalResponse;
    logger.log(
      `\u{1F6A3} Executed ${num_queries} queries in ${meta.duration.toFixed(
        2
      )}ms (${meta.rows_read} rows read, ${meta.rows_written} rows written)
` + source_default.gray(`   Database is currently at bookmark ${final_bookmark}.`)
    );
    return [
      {
        results: [
          {
            "Total queries executed": num_queries,
            "Rows read": meta.rows_read,
            "Rows written": meta.rows_written,
            "Database size (MB)": (meta.size_after / 1e6).toFixed(2)
          }
        ],
        success: true,
        finalBookmark: final_bookmark,
        meta
      }
    ];
  } else {
    const result = await d1ApiPost(
      config,
      accountId,
      db,
      "query",
      {
        sql: input.command
      }
    );
    logResult(result);
    return result;
  }
}
async function uploadAndBeginIngestion(complianceConfig, accountId, db, file3, etag, initResponse) {
  const { upload_url, filename } = initResponse;
  const { size } = await fs29.promises.stat(file3);
  const uploadResponse = await spinnerWhile({
    promise: (0, import_undici12.fetch)(upload_url, {
      method: "PUT",
      headers: {
        "Content-length": `${size}`
      },
      body: fs29.createReadStream(file3),
      duplex: "half"
      // required for NodeJS streams over .fetch ?
    }),
    startMessage: `\u{1F300} Uploading ${filename}`,
    endMessage: `\u{1F300} Uploading complete.`
  });
  if (uploadResponse.status !== 200) {
    throw new UserError(
      `File could not be uploaded. Please retry.
Got response: ${await uploadResponse.text()}`
    );
  }
  const etagResponse = uploadResponse.headers.get("etag");
  if (!etagResponse) {
    throw new UserError(`File did not upload successfully. Please retry.`);
  }
  if (etag !== etagResponse.replace(/^"|"$/g, "")) {
    throw new UserError(
      `File contents did not upload successfully. Please retry.`
    );
  }
  return await d1ApiPost(
    complianceConfig,
    accountId,
    db,
    "import",
    { action: "ingest", filename, etag }
  );
}
async function pollUntilComplete(response, complianceConfig, accountId, db) {
  if (!response.success) {
    throw new UserError(response.error);
  }
  response.messages.forEach((line) => {
    logger.log(`\u{1F300} ${line}`);
  });
  if (response.status === "complete") {
    return response;
  } else if (response.status === "error") {
    throw new APIError({
      text: response.errors?.join("\n"),
      notes: response.messages.map((text) => ({ text }))
    });
  } else {
    const newResponse = await d1ApiPost(
      complianceConfig,
      accountId,
      db,
      "import",
      {
        action: "poll",
        current_bookmark: response.at_bookmark
      }
    );
    return await pollUntilComplete(
      newResponse,
      complianceConfig,
      accountId,
      db
    );
  }
}
async function d1ApiPost(complianceConfig, accountId, db, action, body) {
  try {
    return await fetchResult(
      complianceConfig,
      `/accounts/${accountId}/d1/database/${db.uuid}/${action}`,
      {
        method: "POST",
        headers: {
          "Content-Type": "application/json",
          ...db.internal_env ? { "x-d1-internal-env": db.internal_env } : {}
        },
        body: JSON.stringify(body)
      }
    );
  } catch (x7) {
    if (x7 instanceof APIError) {
      x7.preventReport();
    }
    throw x7;
  }
}
function logResult(r10) {
  const commandsCount = Array.isArray(r10) && r10.length !== 1 ? `${r10.length} commands` : "1 command";
  const durationMs = Array.isArray(r10) ? r10.map((d8) => d8.meta?.duration || 0).reduce((a7, b11) => a7 + b11, 0) : r10.meta?.duration ?? 0;
  logger.log(`\u{1F6A3} Executed ${commandsCount} in ${durationMs.toFixed(2)}ms`);
}
function shorten(query, length) {
  return query && query.length > length ? query.slice(0, length) + "..." : query;
}
async function checkForSQLiteBinary(filename) {
  const buffer = Buffer.alloc(15);
  let fd;
  try {
    fd = await fs29.promises.open(filename, "r");
    await fd.read(buffer, 0, 15);
  } catch {
    throw new UserError(
      `Unable to read SQL text file "${filename}". Please check the file path and try again.`
    );
  } finally {
    await fd?.close();
  }
  if (buffer.toString("utf8") === "SQLite format 3") {
    throw new UserError(
      "Provided file is a binary SQLite database file instead of an SQL text file. The execute command can only process SQL text files. Please export an SQL file from your SQLite database and try again."
    );
  }
}
var import_md5_file, import_undici12, d1ExecuteCommand;
var init_execute = __esm({
  "src/d1/execute.ts"() {
    init_import_meta_url();
    init_interactive();
    init_dist();
    init_source();
    import_md5_file = __toESM(require_md5_file());
    import_undici12 = __toESM(require_undici());
    init_cfetch();
    init_create_command();
    init_get_local_persistence_path();
    init_dialogs();
    init_logger();
    init_paths();
    init_user3();
    init_splitter();
    init_utils8();
    d1ExecuteCommand = createCommand({
      metadata: {
        description: "Execute a command or SQL file",
        status: "stable",
        owner: "Product: D1",
        epilogue: "You must provide either --command or --file for this command to run successfully."
      },
      behaviour: {
        printBanner: /* @__PURE__ */ __name((args) => !args.json, "printBanner"),
        printResourceLocation: /* @__PURE__ */ __name((args) => !args.json, "printResourceLocation")
      },
      args: {
        database: {
          type: "string",
          demandOption: true,
          description: "The name or binding of the DB"
        },
        command: {
          type: "string",
          description: "The SQL query you wish to execute, or multiple queries separated by ';'"
        },
        file: {
          type: "string",
          description: "A .sql file to ingest"
        },
        yes: {
          type: "boolean",
          description: 'Answer "yes" to any prompts',
          alias: "y"
        },
        local: {
          type: "boolean",
          description: "Execute commands/files against a local DB for use with wrangler dev"
        },
        remote: {
          type: "boolean",
          description: "Execute commands/files against a remote D1 database for use with remote bindings or your deployed Worker"
        },
        "persist-to": {
          type: "string",
          description: "Specify directory to use for local persistence (for use with --local)",
          requiresArg: true
        },
        json: {
          type: "boolean",
          description: "Return output as JSON",
          default: false
        },
        preview: {
          type: "boolean",
          description: "Execute commands/files against a preview D1 database",
          default: false
        }
      },
      positionalArgs: ["database"],
      async handler(args, { config }) {
        const {
          local,
          remote,
          database,
          yes,
          persistTo,
          file: file3,
          command: command2,
          json,
          preview
        } = args;
        const existingLogLevel = logger.loggerLevel;
        if (json) {
          logger.loggerLevel = "error";
        }
        if (file3 && command2) {
          throw createFatalError(
            `Error: can't provide both --command and --file.`,
            json,
            void 0,
            { telemetryMessage: true }
          );
        }
        const isInteractive4 = process.stdout.isTTY;
        try {
          const response = await executeSql({
            local,
            remote,
            config,
            name: database,
            shouldPrompt: isInteractive4 && !yes && !json,
            persistTo,
            file: file3,
            command: command2,
            json,
            preview
          });
          if (!response) {
            return;
          }
          if (isInteractive4 && !json) {
            for (const result of response) {
              if (!Array.isArray(result)) {
                const { results, query } = result;
                if (Array.isArray(results) && results.length > 0) {
                  const shortQuery = shorten(query, 48);
                  if (shortQuery) {
                    logger.log(source_default.dim(shortQuery));
                  }
                  logger.table(
                    results.map(
                      (r10) => Object.fromEntries(
                        Object.entries(r10).map(([k7, v8]) => [k7, String(v8)])
                      )
                    )
                  );
                }
              }
            }
          } else {
            logger.loggerLevel = existingLogLevel;
            logger.log(JSON.stringify(response, null, 2));
          }
        } catch (error2) {
          if (json && error2 instanceof Error) {
            logger.loggerLevel = existingLogLevel;
            const messageToDisplay = error2.name === "APIError" ? error2 : { text: error2.message };
            throw new JsonFriendlyFatalError(
              JSON.stringify({ error: messageToDisplay }, null, 2)
            );
          } else {
            throw error2;
          }
        }
      }
    });
    __name(executeSql, "executeSql");
    __name(executeLocally, "executeLocally");
    __name(executeRemotely, "executeRemotely");
    __name(uploadAndBeginIngestion, "uploadAndBeginIngestion");
    __name(pollUntilComplete, "pollUntilComplete");
    __name(d1ApiPost, "d1ApiPost");
    __name(logResult, "logResult");
    __name(shorten, "shorten");
    __name(checkForSQLiteBinary, "checkForSQLiteBinary");
  }
});
async function exportLocal(config, name2, output, tables, noSchema, noData) {
  const localDB = getDatabaseInfoFromConfig(config, name2, {
    requireDatabaseId: false
  });
  if (!localDB) {
    throw new UserError(
      `Couldn't find a D1 DB with the name or binding '${name2}' in your ${configFileName(config.configPath)} file.`
    );
  }
  const id = localDB.previewDatabaseUuid ?? localDB.uuid;
  const persistencePath = getLocalPersistencePath(void 0, config);
  const d1Persist = path3__namespace.default.join(persistencePath, "v3", "d1");
  logger.log(
    `\u{1F300} Exporting local database ${name2} (${id}) from ${readableRelative(
      d1Persist
    )}:`
  );
  logger.log(
    "\u{1F300} To export your remote database, add a --remote flag to your wrangler command."
  );
  const mf = new miniflare.Miniflare({
    modules: true,
    script: "export default {}",
    d1Persist,
    d1Databases: { DATABASE: id }
  });
  const db = await mf.getD1Database("DATABASE");
  logger.log(`\u{1F300} Exporting SQL to ${output}...`);
  try {
    const dump = await db.prepare(`PRAGMA miniflare_d1_export(?,?,?);`).bind(noSchema, noData, ...tables).raw();
    await fs9__default.default.writeFile(output, dump[0].join("\n"));
  } catch (e10) {
    throw new UserError(e10.message);
  } finally {
    await mf.dispose();
  }
  logger.log(`Done!`);
}
async function exportRemotely(config, name2, output, tables, noSchema, noData) {
  const accountId = await requireAuth(config);
  const db = await getDatabaseByNameOrBinding(
    config,
    accountId,
    name2
  );
  logger.log(`\u{1F300} Executing on remote database ${name2} (${db.uuid}):`);
  const dumpOptions = {
    no_schema: noSchema,
    no_data: noData,
    tables
  };
  const s7 = spinner();
  const finalResponse = await spinnerWhile({
    spinner: s7,
    promise: /* @__PURE__ */ __name(() => pollExport(s7, config, accountId, db, dumpOptions, void 0), "promise"),
    startMessage: `Creating export`
  });
  if (finalResponse.status !== "complete") {
    throw new APIError({ text: `D1 reset before export completed!` });
  }
  logger.log(
    source_default.gray(
      `You can also download your export from the following URL manually. This link will be valid for one hour: ${finalResponse.result.signed_url}`
    )
  );
  await spinnerWhile({
    startMessage: `Downloading SQL to ${output}`,
    async promise() {
      const contents = await (0, import_undici13.fetch)(finalResponse.result.signed_url);
      if (!contents.ok) {
        throw new Error(
          `There was an error while downloading from the presigned URL with status code: ${contents.status}`
        );
      }
      await fs9__default.default.writeFile(output, contents.body || "");
    }
  });
  logger.log(`\u{1F300} Downloaded to ${output} successfully!`);
}
async function pollExport(s7, complianceConfig, accountId, db, dumpOptions, currentBookmark, num_parts_uploaded = 0) {
  const response = await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/d1/database/${db.uuid}/export`,
    {
      method: "POST",
      headers: {
        ...db.internal_env ? { "x-d1-internal-env": db.internal_env } : {},
        "content-type": "application/json"
      },
      body: JSON.stringify({
        output_format: "polling",
        dump_options: dumpOptions,
        current_bookmark: currentBookmark
      })
    }
  );
  if (!response.success) {
    throw new Error(response.error);
  }
  response.messages.forEach((line) => {
    if (line.startsWith(`Uploaded part`)) {
      s7.update(`Uploaded part ${++num_parts_uploaded}`);
    } else {
      s7.update(line);
    }
  });
  if (response.status === "complete") {
    return response;
  } else if (response.status === "error") {
    throw new APIError({
      text: response.error,
      notes: response.messages.map((text) => ({ text }))
    });
  } else {
    return await pollExport(
      s7,
      complianceConfig,
      accountId,
      db,
      dumpOptions,
      response.at_bookmark,
      num_parts_uploaded
    );
  }
}
var import_undici13, d1ExportCommand;
var init_export2 = __esm({
  "src/d1/export.ts"() {
    init_import_meta_url();
    init_interactive();
    init_dist();
    init_source();
    import_undici13 = __toESM(require_undici());
    init_cfetch();
    init_create_command();
    init_get_local_persistence_path();
    init_logger();
    init_paths();
    init_user3();
    init_utils8();
    d1ExportCommand = createCommand({
      metadata: {
        description: "Export the contents or schema of your database as a .sql file",
        status: "stable",
        owner: "Product: D1"
      },
      behaviour: {
        printResourceLocation: true
      },
      args: {
        name: {
          type: "string",
          demandOption: true,
          description: "The name of the D1 database to export"
        },
        local: {
          type: "boolean",
          description: "Export from your local DB you use with wrangler dev",
          conflicts: "remote"
        },
        remote: {
          type: "boolean",
          description: "Export from a remote D1 database",
          conflicts: "local"
        },
        output: {
          type: "string",
          description: "Path to the SQL file for your export",
          demandOption: true
        },
        table: {
          type: "string",
          description: "Specify which tables to include in export",
          array: true
        },
        "no-schema": {
          type: "boolean",
          description: "Only output table contents, not the DB schema",
          conflicts: "no-data"
        },
        "no-data": {
          type: "boolean",
          description: "Only output table schema, not the contents of the DBs themselves",
          conflicts: "no-schema"
        },
        // For --no-schema and --no-data to work, we need their positive versions
        // to be defined. But keep them hidden as they default to true
        schema: {
          type: "boolean",
          hidden: true,
          default: true
        },
        data: {
          type: "boolean",
          hidden: true,
          default: true
        }
      },
      positionalArgs: ["name"],
      async handler(args, { config }) {
        const { remote, name: name2, output, schema, data, table } = args;
        if (!schema && !data) {
          throw new UserError(`You cannot specify both --no-schema and --no-data`);
        }
        const stats = fs29.statSync(output, { throwIfNoEntry: false });
        if (stats?.isDirectory()) {
          throw new UserError(
            `Please specify a file path for --output, not a directory.`
          );
        }
        const tables = table ?? [];
        if (remote) {
          return await exportRemotely(config, name2, output, tables, !schema, !data);
        } else {
          return await exportLocal(config, name2, output, tables, !schema, !data);
        }
      }
    });
    __name(exportLocal, "exportLocal");
    __name(exportRemotely, "exportRemotely");
    __name(pollExport, "pollExport");
  }
});

// src/d1/info.ts
var d1InfoCommand;
var init_info = __esm({
  "src/d1/info.ts"() {
    init_import_meta_url();
    init_pretty_bytes();
    init_cfetch();
    init_create_command();
    init_logger();
    init_user3();
    init_utils8();
    d1InfoCommand = createCommand({
      metadata: {
        description: "Get information about a D1 database, including the current database size and state",
        epilogue: "This command acts on remote D1 Databases.",
        status: "stable",
        owner: "Product: D1"
      },
      behaviour: {
        printBanner: /* @__PURE__ */ __name((args) => !args.json, "printBanner")
      },
      args: {
        name: {
          type: "string",
          demandOption: true,
          description: "The name of the DB"
        },
        json: {
          type: "boolean",
          description: "Return output as JSON",
          default: false
        }
      },
      positionalArgs: ["name"],
      async handler({ name: name2, json }, { config }) {
        const accountId = await requireAuth(config);
        const db = await getDatabaseByNameOrBinding(
          config,
          accountId,
          name2
        );
        const result = await getDatabaseInfoFromIdOrName(
          config,
          accountId,
          db.uuid
        );
        const output = { ...result };
        if (output["file_size"]) {
          output["database_size"] = output["file_size"];
          delete output["file_size"];
        }
        if (output["version"] !== "alpha") {
          delete output["version"];
        }
        if (result.version !== "alpha") {
          const today = /* @__PURE__ */ new Date();
          const yesterday = new Date(new Date(today).setDate(today.getDate() - 1));
          const graphqlResult = await fetchGraphqlResult(
            config,
            {
              method: "POST",
              body: JSON.stringify({
                query: `query getD1MetricsOverviewQuery($accountTag: string, $filter: ZoneWorkersRequestsFilter_InputObject) {
								viewer {
									accounts(filter: {accountTag: $accountTag}) {
										d1AnalyticsAdaptiveGroups(limit: 10000, filter: $filter) {
											sum {
												readQueries
												writeQueries
												rowsRead
												rowsWritten
										}
										dimensions {
												datetimeHour
										}
									}
								}
							}
						}`,
                operationName: "getD1MetricsOverviewQuery",
                variables: {
                  accountTag: accountId,
                  filter: {
                    AND: [
                      {
                        datetimeHour_geq: yesterday.toISOString(),
                        datetimeHour_leq: today.toISOString(),
                        databaseId: db.uuid
                      }
                    ]
                  }
                }
              }),
              headers: {
                "Content-Type": "application/json"
              }
            }
          );
          const metrics = {
            readQueries: 0,
            writeQueries: 0,
            rowsRead: 0,
            rowsWritten: 0
          };
          if (graphqlResult) {
            graphqlResult.data?.viewer?.accounts[0]?.d1AnalyticsAdaptiveGroups?.forEach(
              (row) => {
                metrics.readQueries += row?.sum?.readQueries ?? 0;
                metrics.writeQueries += row?.sum?.writeQueries ?? 0;
                metrics.rowsRead += row?.sum?.rowsRead ?? 0;
                metrics.rowsWritten += row?.sum?.rowsWritten ?? 0;
              }
            );
            output.read_queries_24h = metrics.readQueries;
            output.write_queries_24h = metrics.writeQueries;
            output.rows_read_24h = metrics.rowsRead;
            output.rows_written_24h = metrics.rowsWritten;
          }
        }
        if (json) {
          logger.log(JSON.stringify(output, null, 2));
        } else {
          if (result.read_replication) {
            output["read_replication.mode"] = result.read_replication.mode;
            delete output["read_replication"];
          }
          const entries2 = Object.entries(output).filter(
            // also remove any version that isn't "alpha"
            ([k7, v8]) => k7 !== "uuid" && !(k7 === "version" && v8 !== "alpha")
          );
          const data = entries2.map(([k7, v8]) => {
            let value;
            if (k7 === "database_size") {
              value = prettyBytes(Number(v8));
            } else if (k7 === "read_queries_24h" || k7 === "write_queries_24h" || k7 === "rows_read_24h" || k7 === "rows_written_24h") {
              value = v8.toLocaleString();
            } else if (typeof v8 === "object") {
              value = JSON.stringify(v8);
            } else {
              value = String(v8);
            }
            return {
              [db.binding || ""]: k7,
              [db.uuid]: value
            };
          });
          logger.table(data);
        }
      }
    });
  }
});

// src/d1/insights.ts
function getDurationDates(durationString) {
  const endDate = /* @__PURE__ */ new Date();
  const durationValue = parseInt(durationString.slice(0, -1));
  const durationUnit = durationString.slice(-1);
  let startDate;
  switch (durationUnit) {
    case "d":
      if (durationValue > 31) {
        throw new Error("Duration cannot be greater than 31 days");
      }
      startDate = new Date(
        endDate.getTime() - durationValue * 24 * 60 * 60 * 1e3
      );
      break;
    case "m":
      if (durationValue > 31 * 24 * 60) {
        throw new Error(
          `Duration cannot be greater than ${31 * 24 * 60} minutes (31 days)`
        );
      }
      startDate = new Date(endDate.getTime() - durationValue * 60 * 1e3);
      break;
    case "h":
      if (durationValue > 31 * 24) {
        throw new Error(
          `Duration cannot be greater than ${31 * 24} hours (31 days)`
        );
      }
      startDate = new Date(endDate.getTime() - durationValue * 60 * 60 * 1e3);
      break;
    default:
      throw new Error("Invalid duration unit");
  }
  return [startDate.toISOString(), endDate.toISOString()];
}
var cliOptionToGraphQLOption, d1InsightsCommand;
var init_insights3 = __esm({
  "src/d1/insights.ts"() {
    init_import_meta_url();
    init_cfetch();
    init_create_command();
    init_logger();
    init_user3();
    init_utils8();
    cliOptionToGraphQLOption = {
      time: "queryDurationMs",
      reads: "rowsRead",
      writes: "rowsWritten",
      count: "count"
    };
    __name(getDurationDates, "getDurationDates");
    d1InsightsCommand = createCommand({
      metadata: {
        description: "Get information about the queries run on a D1 database",
        epilogue: "This command acts on remote D1 Databases.",
        status: "experimental",
        owner: "Product: D1"
      },
      behaviour: {
        printBanner: /* @__PURE__ */ __name((args) => !args.json, "printBanner")
      },
      args: {
        name: {
          type: "string",
          demandOption: true,
          description: "The name of the DB"
        },
        "time-period": {
          type: "string",
          description: "Fetch data from now to the provided time period",
          default: "1d"
        },
        "sort-type": {
          type: "string",
          description: "Choose the operation you want to sort insights by",
          choices: ["sum", "avg"],
          default: "sum"
        },
        "sort-by": {
          type: "string",
          description: "Choose the field you want to sort insights by",
          choices: ["time", "reads", "writes", "count"],
          default: "time"
        },
        "sort-direction": {
          type: "string",
          description: "Choose a sort direction",
          choices: ["ASC", "DESC"],
          default: "DESC"
        },
        limit: {
          type: "number",
          description: "fetch insights about the first X queries",
          default: 5
        },
        count: {
          type: "number",
          description: "Same as --limit",
          default: 5,
          deprecated: true,
          hidden: true
        },
        json: {
          type: "boolean",
          description: "return output as JSON",
          default: false
        }
      },
      positionalArgs: ["name"],
      async handler({ name: name2, json, limit: limit2, timePeriod, sortType, sortBy, sortDirection }, { config }) {
        const accountId = await requireAuth(config);
        const db = await getDatabaseByNameOrBinding(
          config,
          accountId,
          name2
        );
        const result = await getDatabaseInfoFromIdOrName(
          config,
          accountId,
          db.uuid
        );
        const output = [];
        if (result.version !== "alpha") {
          const [startDate, endDate] = getDurationDates(timePeriod);
          const parsedSortBy = cliOptionToGraphQLOption[sortBy];
          const orderByClause = parsedSortBy === "count" ? `${parsedSortBy}_${sortDirection}` : `${sortType}_${parsedSortBy}_${sortDirection}`;
          const graphqlQueriesResult = await fetchGraphqlResult(config, {
            method: "POST",
            body: JSON.stringify({
              query: `query getD1QueriesOverviewQuery($accountTag: string, $filter: ZoneWorkersRequestsFilter_InputObject) {
								viewer {
									accounts(filter: {accountTag: $accountTag}) {
										d1QueriesAdaptiveGroups(limit: ${limit2}, filter: $filter, orderBy: [${orderByClause}]) {
											sum {
												queryDurationMs
												rowsRead
												rowsWritten
												rowsReturned
											}
											avg {
												queryDurationMs
												rowsRead
												rowsWritten
												rowsReturned
											}
											count
											dimensions {
													query
											}
										}
									}
								}
							}`,
              operationName: "getD1QueriesOverviewQuery",
              variables: {
                accountTag: accountId,
                filter: {
                  AND: [
                    {
                      datetimeHour_geq: startDate,
                      datetimeHour_leq: endDate,
                      databaseId: db.uuid
                    }
                  ]
                }
              }
            }),
            headers: {
              "Content-Type": "application/json"
            }
          });
          graphqlQueriesResult?.data?.viewer?.accounts[0]?.d1QueriesAdaptiveGroups?.forEach(
            (row) => {
              if (!row.dimensions.query) {
                return;
              }
              output.push({
                query: row.dimensions.query,
                avgRowsRead: row?.avg?.rowsRead ?? 0,
                totalRowsRead: row?.sum?.rowsRead ?? 0,
                avgRowsWritten: row?.avg?.rowsWritten ?? 0,
                totalRowsWritten: row?.sum?.rowsWritten ?? 0,
                avgDurationMs: row?.avg?.queryDurationMs ?? 0,
                totalDurationMs: row?.sum?.queryDurationMs ?? 0,
                numberOfTimesRun: row?.count ?? 0,
                queryEfficiency: row?.avg?.rowsReturned && row?.avg?.rowsRead ? row?.avg?.rowsReturned / row?.avg?.rowsRead : 0
              });
            }
          );
        }
        if (json) {
          logger.log(JSON.stringify(output, null, 2));
        } else {
          logger.log(JSON.stringify(output, null, 2));
        }
      }
    });
  }
});

// src/d1/migrations/index.ts
var d1MigrationsNamespace;
var init_migrations = __esm({
  "src/d1/migrations/index.ts"() {
    init_import_meta_url();
    init_create_command();
    d1MigrationsNamespace = createNamespace({
      metadata: {
        description: "Interact with D1 migrations",
        status: "stable",
        owner: "Product: D1"
      }
    });
  }
});
async function getMigrationsPath({
  projectPath,
  migrationsFolderPath,
  createIfMissing,
  configPath
}) {
  const dir2 = path3__namespace.default.resolve(projectPath, migrationsFolderPath);
  if (fs29__namespace.default.existsSync(dir2)) {
    return dir2;
  }
  const warning = `No migrations folder found.${migrationsFolderPath === DEFAULT_MIGRATION_PATH ? ` Set \`migrations_dir\` in your ${configFileName(configPath)} file to choose a different path.` : ""}`;
  if (createIfMissing && await confirm(`${warning}
Ok to create ${dir2}?`)) {
    fs29__namespace.default.mkdirSync(dir2, { recursive: true });
    return dir2;
  } else {
    logger.warn(warning);
  }
  throw new UserError(`No migrations present at ${dir2}.`);
}
async function getUnappliedMigrations({
  migrationsTableName,
  migrationsPath,
  local,
  remote,
  config,
  name: name2,
  persistTo,
  preview
}) {
  const appliedMigrations = (await listAppliedMigrations({
    migrationsTableName,
    local,
    remote,
    config,
    name: name2,
    persistTo,
    preview
  })).map((migration) => {
    return migration.name;
  });
  const projectMigrations = getMigrationNames(migrationsPath);
  const unappliedMigrations = [];
  for (const migration of projectMigrations) {
    if (!appliedMigrations.includes(migration)) {
      unappliedMigrations.push(migration);
    }
  }
  return unappliedMigrations;
}
function getMigrationNames(migrationsPath) {
  const migrations = [];
  const dir2 = fs29__namespace.default.opendirSync(migrationsPath);
  let dirent;
  while ((dirent = dir2.readSync()) !== null) {
    if (dirent.name.endsWith(".sql")) {
      migrations.push(dirent.name);
    }
  }
  dir2.closeSync();
  return migrations.toSorted();
}
function getNextMigrationNumber(migrationsPath) {
  const migrationNumbers = getMigrationNames(migrationsPath).map(
    (migration) => parseInt(migration.split("_")[0])
  );
  const highestMigrationNumber = Math.max(...migrationNumbers, 0);
  return highestMigrationNumber + 1;
}
var listAppliedMigrations, initMigrationsTable;
var init_helpers4 = __esm({
  "src/d1/migrations/helpers.ts"() {
    init_import_meta_url();
    init_dist();
    init_dialogs();
    init_is_interactive();
    init_logger();
    init_constants6();
    init_execute();
    __name(getMigrationsPath, "getMigrationsPath");
    __name(getUnappliedMigrations, "getUnappliedMigrations");
    listAppliedMigrations = /* @__PURE__ */ __name(async ({
      migrationsTableName,
      local,
      remote,
      config,
      name: name2,
      persistTo,
      preview
    }) => {
      const response = await executeSql({
        local,
        remote,
        config,
        name: name2,
        shouldPrompt: !isNonInteractiveOrCI(),
        persistTo,
        command: `SELECT *
		FROM ${migrationsTableName}
		ORDER BY id`,
        file: void 0,
        json: true,
        preview
      });
      if (!response || response[0].results.length === 0) {
        return [];
      }
      return response[0].results;
    }, "listAppliedMigrations");
    __name(getMigrationNames, "getMigrationNames");
    __name(getNextMigrationNumber, "getNextMigrationNumber");
    initMigrationsTable = /* @__PURE__ */ __name(async ({
      migrationsTableName,
      local,
      remote,
      config,
      name: name2,
      persistTo,
      preview
    }) => {
      return executeSql({
        local,
        remote,
        config,
        name: name2,
        shouldPrompt: !isNonInteractiveOrCI(),
        persistTo,
        command: `CREATE TABLE IF NOT EXISTS ${migrationsTableName}(
		id         INTEGER PRIMARY KEY AUTOINCREMENT,
		name       TEXT UNIQUE,
		applied_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL
);`,
        file: void 0,
        json: true,
        preview
      });
    }, "initMigrationsTable");
  }
});
var d1MigrationsApplyCommand;
var init_apply2 = __esm({
  "src/d1/migrations/apply.ts"() {
    init_import_meta_url();
    init_dist();
    init_esm2();
    init_create_command();
    init_dialogs();
    init_is_interactive();
    init_logger();
    init_is_local();
    init_constants6();
    init_execute();
    init_utils8();
    init_helpers4();
    d1MigrationsApplyCommand = createCommand({
      metadata: {
        description: "Apply any unapplied D1 migrations",
        epilogue: esm_default3`
			This command will prompt you to confirm the migrations you are about to apply.
			Confirm that you would like to proceed. After applying, a backup will be captured.

			The progress of each migration will be printed in the console.

			When running the apply command in a CI/CD environment or another non-interactive
			command line, the confirmation step will be skipped, but the backup will still be
			captured.

			If applying a migration results in an error, this migration will be rolled back,
			and the previous successful migration will remain applied.
		`,
        status: "stable",
        owner: "Product: D1"
      },
      behaviour: {
        printResourceLocation: true
      },
      args: {
        database: {
          type: "string",
          demandOption: true,
          description: "The name or binding of the DB"
        },
        local: {
          type: "boolean",
          description: "Execute commands/files against a local DB for use with wrangler dev"
        },
        remote: {
          type: "boolean",
          description: "Execute commands/files against a remote DB for use with wrangler dev --remote"
        },
        preview: {
          type: "boolean",
          description: "Execute commands/files against a preview D1 DB",
          default: false
        },
        "persist-to": {
          type: "string",
          description: "Specify directory to use for local persistence (you must use --local with this flag)",
          requiresArg: true
        }
      },
      positionalArgs: ["database"],
      async handler({ database, local, remote, persistTo, preview }, { config }) {
        if (!config.configPath) {
          throw new UserError(
            "No configuration file found. Create a wrangler.jsonc file to define your D1 database."
          );
        }
        const databaseInfo = getDatabaseInfoFromConfig(config, database, {
          requireDatabaseId: !isLocal({ local, remote })
        });
        if (!databaseInfo && remote) {
          throw new UserError(
            `Couldn't find a D1 DB with the name or binding '${database}' in your ${configFileName(config.configPath)} file.`
          );
        }
        const migrationsPath = await getMigrationsPath({
          projectPath: path3__namespace.default.dirname(config.configPath),
          migrationsFolderPath: databaseInfo?.migrationsFolderPath ?? DEFAULT_MIGRATION_PATH,
          createIfMissing: false,
          configPath: config.configPath
        });
        const migrationsTableName = databaseInfo?.migrationsTableName ?? DEFAULT_MIGRATION_TABLE;
        await initMigrationsTable({
          migrationsTableName,
          local,
          remote,
          config,
          name: database,
          persistTo,
          preview
        });
        const unappliedMigrations = (await getUnappliedMigrations({
          migrationsTableName,
          migrationsPath,
          local,
          remote,
          config,
          name: database,
          persistTo,
          preview
        })).map((migration) => {
          return {
            name: migration,
            status: "\u{1F552}\uFE0F"
          };
        }).sort((a7, b11) => {
          const migrationNumberA = parseInt(a7.name.split("_")[0]);
          const migrationNumberB = parseInt(b11.name.split("_")[0]);
          if (migrationNumberA < migrationNumberB) {
            return -1;
          }
          if (migrationNumberA > migrationNumberB) {
            return 1;
          }
          return 0;
        });
        if (unappliedMigrations.length === 0) {
          logger.log("\u2705 No migrations to apply!");
          return;
        }
        logger.log("Migrations to be applied:");
        logger.table(unappliedMigrations.map((m7) => ({ name: m7.name })));
        const ok = await confirm(
          `About to apply ${unappliedMigrations.length} migration(s)
Your database may not be available to serve requests during the migration, continue?`
        );
        if (!ok) {
          return;
        }
        for (const migration of unappliedMigrations) {
          let query = fs29__namespace.default.readFileSync(
            `${migrationsPath}/${migration.name}`,
            "utf8"
          );
          query += `
								INSERT INTO ${migrationsTableName} (name)
								values ('${migration.name}');
						`;
          let success2 = true;
          let errorNotes = [];
          try {
            const response = await executeSql({
              local,
              remote,
              config,
              name: database,
              shouldPrompt: !isNonInteractiveOrCI(),
              persistTo,
              command: query,
              file: void 0,
              json: void 0,
              preview
            });
            if (response === null) {
              return;
            }
            for (const result of response) {
              if (Array.isArray(result)) {
                for (const subResult of result) {
                  if (!subResult.success) {
                    success2 = false;
                  }
                }
              } else {
                if (!result.success) {
                  success2 = false;
                }
              }
            }
          } catch (e10) {
            const err = e10;
            const maybeCause = err.cause ?? err;
            success2 = false;
            errorNotes = err.notes?.map((msg) => msg.text) ?? [
              maybeCause?.message ?? maybeCause.toString()
            ];
          }
          migration.status = success2 ? "\u2705" : "\u274C";
          logger.table(
            unappliedMigrations.map((m7) => ({ name: m7.name, status: m7.status }))
          );
          if (errorNotes.length > 0) {
            logger.error(
              `Migration ${migration.name} failed with the following errors:`
            );
          }
          if (errorNotes.length > 0) {
            throw new UserError(
              errorNotes.map((err) => {
                return err;
              }).join("\n")
            );
          }
        }
      }
    });
  }
});
function pad(num, size) {
  let newNum = num.toString();
  while (newNum.length < size) {
    newNum = "0" + newNum;
  }
  return newNum;
}
var d1MigrationsCreateCommand;
var init_create5 = __esm({
  "src/d1/migrations/create.ts"() {
    init_import_meta_url();
    init_dist();
    init_esm2();
    init_create_command();
    init_logger();
    init_constants6();
    init_utils8();
    init_helpers4();
    d1MigrationsCreateCommand = createCommand({
      metadata: {
        description: "Create a new migration",
        epilogue: esm_default3`
			This will generate a new versioned file inside the 'migrations' folder. Name
			your migration file as a description of your change. This will make it easier
			for you to find your migration in the 'migrations' folder. An example filename
			looks like:

				0000_create_user_table.sql

			The filename will include a version number and the migration name you specify.`,
        status: "stable",
        owner: "Product: D1"
      },
      behaviour: {
        printBanner: true
      },
      args: {
        database: {
          type: "string",
          demandOption: true,
          description: "The name or binding of the DB"
        },
        message: {
          type: "string",
          demandOption: true,
          description: "The Migration message"
        }
      },
      positionalArgs: ["database", "message"],
      async handler({ database, message }, { config }) {
        if (!config.configPath) {
          throw new UserError(
            "No configuration file found. Create a wrangler.jsonc file to define your D1 database."
          );
        }
        const databaseInfo = getDatabaseInfoFromConfig(config, database, {
          requireDatabaseId: false
        });
        if (!databaseInfo) {
          throw new UserError(
            `Couldn't find a D1 DB with the name or binding '${database}' in your ${configFileName(config.configPath)} file.`
          );
        }
        const migrationsPath = await getMigrationsPath({
          projectPath: path3__namespace.default.dirname(config.configPath),
          migrationsFolderPath: databaseInfo.migrationsFolderPath ?? DEFAULT_MIGRATION_PATH,
          createIfMissing: true,
          configPath: config.configPath
        });
        const nextMigrationNumber = pad(getNextMigrationNumber(migrationsPath), 4);
        const migrationName = message.replaceAll(" ", "_");
        const newMigrationName = `${nextMigrationNumber}_${migrationName}.sql`;
        fs29__namespace.default.writeFileSync(
          `${migrationsPath}/${newMigrationName}`,
          `-- Migration number: ${nextMigrationNumber} 	 ${(/* @__PURE__ */ new Date()).toISOString()}
`
        );
        logger.log(`\u2705 Successfully created Migration '${newMigrationName}'!
`);
        logger.log(`The migration is available for editing here`);
        logger.log(`${migrationsPath}/${newMigrationName}`);
      }
    });
    __name(pad, "pad");
  }
});
var d1MigrationsListCommand;
var init_list6 = __esm({
  "src/d1/migrations/list.ts"() {
    init_import_meta_url();
    init_dist();
    init_create_command();
    init_logger();
    init_user3();
    init_is_local();
    init_constants6();
    init_utils8();
    init_helpers4();
    d1MigrationsListCommand = createCommand({
      metadata: {
        description: "View a list of unapplied migration files",
        status: "stable",
        owner: "Product: D1"
      },
      behaviour: {
        printResourceLocation: true
      },
      args: {
        database: {
          type: "string",
          demandOption: true,
          description: "The name or binding of the DB"
        },
        local: {
          type: "boolean",
          description: "Check migrations against a local DB for use with wrangler dev"
        },
        remote: {
          type: "boolean",
          description: "Check migrations against a remote DB for use with wrangler dev --remote"
        },
        preview: {
          type: "boolean",
          description: "Check migrations against a preview D1 DB",
          default: false
        },
        "persist-to": {
          type: "string",
          description: "Specify directory to use for local persistence (you must use --local with this flag)",
          requiresArg: true
        }
      },
      positionalArgs: ["database"],
      async handler({ database, local, remote, persistTo, preview }, { config }) {
        if (remote) {
          await requireAuth({});
        }
        if (!config.configPath) {
          throw new UserError(
            "No configuration file found. Create a wrangler.jsonc file to define your D1 database."
          );
        }
        const databaseInfo = getDatabaseInfoFromConfig(config, database, {
          requireDatabaseId: !isLocal({ local, remote })
          // Only require database_id for remote operations
        });
        if (!databaseInfo && remote) {
          throw new UserError(
            `Couldn't find a D1 DB with the name or binding '${database}' in your ${configFileName(config.configPath)} file.`
          );
        }
        const migrationsPath = await getMigrationsPath({
          projectPath: path3__namespace.default.dirname(config.configPath),
          migrationsFolderPath: databaseInfo?.migrationsFolderPath ?? DEFAULT_MIGRATION_PATH,
          createIfMissing: false,
          configPath: config.configPath
        });
        const migrationsTableName = databaseInfo?.migrationsTableName ?? DEFAULT_MIGRATION_TABLE;
        await initMigrationsTable({
          migrationsTableName,
          local,
          remote,
          config,
          name: database,
          persistTo,
          preview
        });
        const unappliedMigrations = (await getUnappliedMigrations({
          migrationsTableName,
          migrationsPath,
          local,
          remote,
          config,
          name: database,
          persistTo,
          preview
        })).map((migration) => {
          return {
            Name: migration
          };
        });
        if (unappliedMigrations.length === 0) {
          logger.log("\u2705 No migrations to apply!");
          return;
        }
        logger.log("Migrations to be applied:");
        logger.table(unappliedMigrations.map((m7) => ({ Name: m7.Name })));
      }
    });
  }
});

// src/d1/timeTravel/index.ts
var d1TimeTravelNamespace;
var init_timeTravel = __esm({
  "src/d1/timeTravel/index.ts"() {
    init_import_meta_url();
    init_create_command();
    d1TimeTravelNamespace = createNamespace({
      metadata: {
        description: "Use Time Travel to restore, fork or copy a database at a specific point-in-time",
        status: "stable",
        owner: "Product: D1"
      }
    });
  }
});

// src/d1/timeTravel/utils.ts
function isISODate(date) {
  return ISO_DATE_REG_EXP.test(date);
}
function getLocalISOString(date) {
  const offset = date.getTimezoneOffset();
  const offsetAbs = Math.abs(offset);
  const isoString = new Date(date.getTime() - offset * 60 * 1e3).toISOString();
  return `${isoString.slice(0, -1)}${offset > 0 ? "-" : "+"}${String(
    Math.floor(offsetAbs / 60)
  ).padStart(2, "0")}:${String(offsetAbs % 60).padStart(2, "0")}`;
}
var getBookmarkIdFromTimestamp, throwIfDatabaseIsAlpha, ISO_DATE_REG_EXP, convertTimestampToISO;
var init_utils9 = __esm({
  "src/d1/timeTravel/utils.ts"() {
    init_import_meta_url();
    init_dist();
    init_cfetch();
    init_utils8();
    getBookmarkIdFromTimestamp = /* @__PURE__ */ __name(async (complianceConfig, accountId, databaseId, timestamp) => {
      const searchParams = new URLSearchParams();
      if (timestamp) {
        searchParams.append("timestamp", convertTimestampToISO(timestamp));
      }
      const bookmarkResult = await fetchResult(
        complianceConfig,
        `/accounts/${accountId}/d1/database/${databaseId}/time_travel/bookmark?${searchParams.toString()}`,
        {
          headers: {
            "Content-Type": "application/json"
          }
        }
      );
      return bookmarkResult;
    }, "getBookmarkIdFromTimestamp");
    throwIfDatabaseIsAlpha = /* @__PURE__ */ __name(async (complianceConfig, accountId, databaseId) => {
      const dbInfo = await getDatabaseInfoFromIdOrName(
        complianceConfig,
        accountId,
        databaseId
      );
      if (dbInfo.version === "alpha") {
        throw new UserError(
          "Time travel is not available for alpha D1 databases. You will need to migrate to a new database for access to this feature."
        );
      }
    }, "throwIfDatabaseIsAlpha");
    ISO_DATE_REG_EXP = new RegExp(
      /(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))/
    );
    __name(isISODate, "isISODate");
    __name(getLocalISOString, "getLocalISOString");
    convertTimestampToISO = /* @__PURE__ */ __name((timestamp) => {
      const parsedTimestamp = isISODate(timestamp) ? new Date(timestamp) : new Date(Number(timestamp.length === 10 ? timestamp + "000" : timestamp));
      if (parsedTimestamp.toString() === "Invalid Date") {
        throw new UserError(
          `Invalid timestamp '${timestamp}'. Please provide a valid Unix timestamp or ISO string, for example: ${getLocalISOString(
            /* @__PURE__ */ new Date()
          )}
For accepted format, see: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#date_time_string_format`
        );
      }
      const now = /* @__PURE__ */ new Date();
      const thirtyDaysAgo = /* @__PURE__ */ new Date();
      thirtyDaysAgo.setDate(thirtyDaysAgo.getDate() - 30);
      if (parsedTimestamp > now) {
        throw new UserError(
          `Invalid timestamp '${timestamp}'. Please provide a timestamp in the past`
        );
      }
      if (parsedTimestamp < thirtyDaysAgo) {
        throw new UserError(
          `Invalid timestamp '${timestamp}'. Please provide a timestamp within the last 30 days`
        );
      }
      return parsedTimestamp.toISOString();
    }, "convertTimestampToISO");
  }
});

// src/d1/timeTravel/info.ts
var d1TimeTravelInfoCommand;
var init_info2 = __esm({
  "src/d1/timeTravel/info.ts"() {
    init_import_meta_url();
    init_esm2();
    init_create_command();
    init_logger();
    init_user3();
    init_is_local();
    init_utils8();
    init_utils9();
    d1TimeTravelInfoCommand = createCommand({
      metadata: {
        description: "Retrieve information about a database at a specific point-in-time using Time Travel",
        epilogue: esm_default3`
			This command acts on remote D1 Databases.

			For more information about Time Travel, see https://developers.cloudflare.com/d1/reference/time-travel/`,
        status: "stable",
        owner: "Product: D1"
      },
      behaviour: {
        printBanner: /* @__PURE__ */ __name((args) => !args.json, "printBanner")
      },
      args: {
        database: {
          type: "string",
          demandOption: true,
          description: "The name or binding of the DB"
        },
        timestamp: {
          type: "string",
          description: "Accepts a Unix (seconds from epoch) or RFC3339 timestamp (e.g. 2023-07-13T08:46:42.228Z) to retrieve a bookmark for"
        },
        json: {
          type: "boolean",
          description: "Return output as JSON",
          default: false
        }
      },
      positionalArgs: ["database"],
      async handler({ database, json, timestamp }, { config }) {
        const accountId = await requireAuth(config);
        if (!json) {
          printResourceLocation("remote");
        }
        const db = await getDatabaseByNameOrBinding(config, accountId, database);
        await throwIfDatabaseIsAlpha(config, accountId, db.uuid);
        const result = await getBookmarkIdFromTimestamp(
          config,
          accountId,
          db.uuid,
          timestamp
        );
        if (json) {
          logger.log(JSON.stringify(result, null, 2));
        } else {
          logger.log("\u{1F6A7} Time Traveling...");
          logger.log(
            timestamp ? `\u26A0\uFE0F Timestamp '${timestamp}' corresponds with bookmark '${result.bookmark}'` : `\u26A0\uFE0F The current bookmark is '${result.bookmark}'`
          );
          logger.log(`\u26A1\uFE0F To restore to this specific bookmark, run:
 \`wrangler d1 time-travel restore ${database} --bookmark=${result.bookmark}\`
      `);
        }
      }
    });
  }
});

// src/d1/timeTravel/restore.ts
var d1TimeTravelRestoreCommand, handleRestore;
var init_restore = __esm({
  "src/d1/timeTravel/restore.ts"() {
    init_import_meta_url();
    init_dist();
    init_esm2();
    init_cfetch();
    init_create_command();
    init_dialogs();
    init_logger();
    init_user3();
    init_is_local();
    init_utils8();
    init_utils9();
    d1TimeTravelRestoreCommand = createCommand({
      metadata: {
        description: "Restore a database back to a specific point-in-time",
        epilogue: esm_default3`
			This command acts on remote D1 Databases.

			For more information about Time Travel, see https://developers.cloudflare.com/d1/reference/time-travel/`,
        status: "stable",
        owner: "Product: D1"
      },
      behaviour: {
        printBanner: /* @__PURE__ */ __name((args) => !args.json, "printBanner")
      },
      args: {
        database: {
          type: "string",
          demandOption: true,
          description: "The name or binding of the DB"
        },
        bookmark: {
          type: "string",
          description: "Bookmark to use for time travel"
        },
        timestamp: {
          type: "string",
          description: "Accepts a Unix (seconds from epoch) or RFC3339 timestamp (e.g. 2023-07-13T08:46:42.228Z) to retrieve a bookmark for (within the last 30 days)"
        },
        json: {
          type: "boolean",
          description: "Return output as JSON",
          default: false
        }
      },
      positionalArgs: ["database"],
      validateArgs(args) {
        if (args.timestamp && args.bookmark) {
          throw new UserError(
            "Provide either a timestamp, or a bookmark - not both."
          );
        } else if (!args.timestamp && !args.bookmark) {
          throw new UserError("Provide either a timestamp or a bookmark");
        }
      },
      async handler({ database, json, timestamp, bookmark }, { config }) {
        const accountId = await requireAuth(config);
        if (!json) {
          printResourceLocation("remote");
        }
        const db = await getDatabaseByNameOrBinding(config, accountId, database);
        await throwIfDatabaseIsAlpha(config, accountId, db.uuid);
        const searchParams = new URLSearchParams();
        if (timestamp) {
          const bookmarkResult = await getBookmarkIdFromTimestamp(
            config,
            accountId,
            db.uuid,
            timestamp
          );
          searchParams.set("bookmark", bookmarkResult.bookmark);
        } else if (bookmark) {
          searchParams.set("bookmark", bookmark);
        }
        if (json) {
          const result = await handleRestore(
            config,
            accountId,
            db.uuid,
            searchParams
          );
          logger.log(JSON.stringify(result, null, 2));
        } else {
          logger.log(`\u{1F6A7} Restoring database ${database} from bookmark ${searchParams.get(
            "bookmark"
          )}
			`);
          logger.log(`\u26A0\uFE0F This will overwrite all data in database ${database}. 
In-flight queries and transactions will be cancelled.
			`);
          if (await confirm("OK to proceed (y/N)", { defaultValue: false })) {
            logger.log("\u26A1\uFE0F Time travel in progress...");
            const result = await handleRestore(
              config,
              accountId,
              db.uuid,
              searchParams
            );
            logger.log(`\u2705 Database ${database} restored back to bookmark ${result.bookmark}
				`);
            logger.log(
              `\u21A9\uFE0F To undo this operation, you can restore to the previous bookmark: ${result.previous_bookmark}`
            );
          }
        }
      }
    });
    handleRestore = /* @__PURE__ */ __name(async (complianceConfig, accountId, databaseId, searchParams) => {
      return await fetchResult(
        complianceConfig,
        `/accounts/${accountId}/d1/database/${databaseId}/time_travel/restore?${searchParams.toString()}`,
        {
          headers: {
            "Content-Type": "application/json"
          },
          method: "POST"
        }
      );
    }, "handleRestore");
  }
});

// src/ai-search.ts
async function getAISearchNamespace(complianceConfig, accountId, namespaceName) {
  try {
    return await fetchResult(
      complianceConfig,
      `/accounts/${accountId}/ai-search/namespaces/${namespaceName}`,
      { method: "GET" }
    );
  } catch (e10) {
    if (e10 instanceof APIError && e10.status === 404) {
      return null;
    }
    throw e10;
  }
}
async function createAISearchNamespace(complianceConfig, accountId, namespaceName) {
  await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/ai-search/namespaces`,
    {
      method: "POST",
      headers: { "Content-Type": "application/json" },
      body: JSON.stringify({ name: namespaceName })
    }
  );
}
var init_ai_search2 = __esm({
  "src/ai-search.ts"() {
    init_import_meta_url();
    init_dist();
    init_cfetch();
    __name(getAISearchNamespace, "getAISearchNamespace");
    __name(createAISearchNamespace, "createAISearchNamespace");
  }
});

// src/utils/useServiceEnvironments.ts
function useServiceEnvironments(config) {
  return "legacy_env" in config ? !config.legacy_env : Boolean(config.legacy.useServiceEnvironments);
}
var init_useServiceEnvironments = __esm({
  "src/utils/useServiceEnvironments.ts"() {
    init_import_meta_url();
    __name(useServiceEnvironments, "useServiceEnvironments");
  }
});
function getBindings(config, options) {
  if (!config) {
    return {};
  }
  return convertConfigToBindings(config, {
    usePreviewIds: false,
    pages: options?.pages
  });
}
function isProvisionableBinding(binding) {
  return binding.type in HANDLERS;
}
function createHandler2(bindingName, binding, complianceConfig, accountId) {
  switch (binding.type) {
    case "kv_namespace":
      return new KVHandler(bindingName, binding, complianceConfig, accountId);
    case "d1":
      return new D1Handler(bindingName, binding, complianceConfig, accountId);
    case "r2_bucket":
      return new R2Handler(bindingName, binding, complianceConfig, accountId);
    case "ai_search_namespace":
      return new AISearchNamespaceHandler(
        bindingName,
        binding,
        complianceConfig,
        accountId
      );
  }
}
function toConfigBinding(bindingName, binding) {
  switch (binding.type) {
    case "kv_namespace":
      return HANDLERS.kv_namespace.toConfig(bindingName, binding);
    case "d1":
      return HANDLERS.d1.toConfig(bindingName, binding);
    case "r2_bucket":
      return HANDLERS.r2_bucket.toConfig(bindingName, binding);
    case "ai_search_namespace":
      return HANDLERS.ai_search_namespace.toConfig(bindingName, binding);
  }
}
async function collectPendingResources(complianceConfig, accountId, scriptName, bindings, requireRemote) {
  let settings;
  try {
    settings = await getSettings(complianceConfig, accountId, scriptName);
  } catch {
    logger.debug("No settings found");
  }
  const pendingResources = [];
  for (const [bindingName, binding] of Object.entries(bindings ?? {})) {
    if (!isProvisionableBinding(binding)) {
      continue;
    }
    if (requireRemote && !("remote" in binding && binding.remote)) {
      continue;
    }
    const h7 = createHandler2(bindingName, binding, complianceConfig, accountId);
    if (await h7.shouldProvision(settings)) {
      pendingResources.push({
        binding: bindingName,
        resourceType: binding.type,
        handler: h7
      });
    }
  }
  return pendingResources.sort(
    (a7, b11) => HANDLERS[a7.resourceType].sort - HANDLERS[b11.resourceType].sort
  );
}
async function provisionBindings(bindings, accountId, scriptName, autoCreate, config, requireRemote = false) {
  const configPath = config.userConfigPath ?? config.configPath;
  const pendingResources = await collectPendingResources(
    config,
    accountId,
    scriptName,
    bindings,
    requireRemote
  );
  if (pendingResources.length > 0) {
    assert53__default.default(
      configPath,
      "Provisioning resources is not possible without a config file"
    );
    if (useServiceEnvironments(config)) {
      throw new UserError(
        "Provisioning resources is not supported with a service environment"
      );
    }
    logger.log();
    printBindings(
      Object.fromEntries(
        pendingResources.map((r10) => [r10.binding, { type: r10.resourceType }])
      ),
      config.tail_consumers,
      config.streaming_tail_consumers,
      config.containers,
      { provisioning: true }
    );
    logger.log();
    const existingResources = {};
    for (const resource of pendingResources) {
      existingResources[resource.resourceType] ??= await HANDLERS[resource.resourceType].load(config, accountId);
      await runProvisioningFlow(
        resource,
        existingResources[resource.resourceType],
        HANDLERS[resource.resourceType].name,
        scriptName,
        autoCreate
      );
    }
    const patch = {};
    const existingBindingNames = /* @__PURE__ */ new Set();
    const isUsingRedirectedConfig = config.userConfigPath && config.userConfigPath !== config.configPath;
    if (isUsingRedirectedConfig) {
      const { rawConfig: unredirectedConfig } = await exports.experimental_readRawConfig(
        { config: config.userConfigPath },
        { useRedirectIfAvailable: false }
      );
      for (const resourceType of Object.keys(
        HANDLERS
      )) {
        const configField = HANDLERS[resourceType].configField;
        for (const binding of unredirectedConfig[configField] ?? []) {
          existingBindingNames.add(binding.binding);
        }
      }
    }
    for (const [bindingName, binding] of Object.entries(bindings ?? {})) {
      if (!isProvisionableBinding(binding)) {
        continue;
      }
      if (isUsingRedirectedConfig && !existingBindingNames.has(bindingName)) {
        continue;
      }
      const resourceType = HANDLERS[binding.type].configField;
      patch[resourceType] ??= [];
      const bindingToWrite = toConfigBinding(bindingName, binding);
      patch[resourceType].push(
        Object.fromEntries(
          Object.entries(bindingToWrite).filter(
            // Make sure all the values are JSON serialisable.
            // Otherwise we end up with "undefined" in the config
            ([_5, value]) => typeof value === "string"
          )
        )
      );
    }
    if (!isNonInteractiveOrCI()) {
      try {
        await exports.experimental_patchConfig(configPath, patch, false);
        logger.log(
          "Your Worker was deployed with provisioned resources. We've written the IDs of these resources to your config file, which you can choose to save or discard. Either way future deploys will continue to work."
        );
      } catch (e10) {
        if (!(e10 instanceof PatchConfigError)) {
          throw e10;
        }
      }
    }
    const resourceCount = pendingResources.reduce(
      (acc, resource) => {
        acc[resource.resourceType] ??= 0;
        acc[resource.resourceType]++;
        return acc;
      },
      {}
    );
    logger.log(`\u{1F389} All resources provisioned, continuing with deployment...
`);
    sendMetricsEvent("provision resources", resourceCount, {
      sendMetrics: config.send_metrics
    });
  }
}
function getSettings(complianceConfig, accountId, scriptName) {
  return fetchResult(
    complianceConfig,
    `/accounts/${accountId}/workers/scripts/${scriptName}/settings`
  );
}
function printDivider() {
  logger.log();
}
async function runProvisioningFlow(item, preExisting, friendlyBindingName, scriptName, autoCreate) {
  const NEW_OPTION_VALUE = "__WRANGLER_INTERNAL_NEW";
  const SEARCH_OPTION_VALUE = "__WRANGLER_INTERNAL_SEARCH";
  const MAX_OPTIONS = 4;
  const options = preExisting.slice(0, MAX_OPTIONS - 1);
  if (options.length < preExisting.length) {
    options.push({
      title: "Other (too many to list)",
      value: SEARCH_OPTION_VALUE
    });
  }
  const defaultName = `${scriptName}-${item.binding.toLowerCase().replaceAll("_", "-")}`;
  logger.log("Provisioning", item.binding, `(${friendlyBindingName})...`);
  if (item.handler.name) {
    logger.log("Resource name found in config:", item.handler.name);
    logger.log(
      `\u{1F300} Creating new ${friendlyBindingName} "${item.handler.name}"...`
    );
    await item.handler.provision(item.handler.name);
  } else if (autoCreate) {
    logger.log(`\u{1F300} Creating new ${friendlyBindingName} "${defaultName}"...`);
    await item.handler.provision(defaultName);
  } else {
    let action = NEW_OPTION_VALUE;
    if (options.length > 0) {
      action = await select(
        `Would you like to connect an existing ${friendlyBindingName} or create a new one?`,
        {
          choices: options.concat([
            { title: "Create new", value: NEW_OPTION_VALUE }
          ]),
          defaultOption: options.length,
          fallbackOption: options.length
        }
      );
    }
    if (action === NEW_OPTION_VALUE) {
      const name2 = await prompt(
        `Enter a name for your new ${friendlyBindingName}`,
        {
          defaultValue: defaultName
        }
      );
      logger.log(`\u{1F300} Creating new ${friendlyBindingName} "${name2}"...`);
      await item.handler.provision(name2);
    } else if (action === SEARCH_OPTION_VALUE) {
      let foundResource;
      while (foundResource === void 0) {
        const input = await prompt(
          `Enter the ${HANDLERS[item.resourceType].keyDescription} for an existing ${friendlyBindingName}`
        );
        foundResource = preExisting.find(
          (r10) => r10.title === input || r10.value === input
        );
        if (foundResource) {
          item.handler.connect(foundResource.value);
        } else {
          logger.log(
            `No ${friendlyBindingName} with that ${HANDLERS[item.resourceType].keyDescription} "${input}" found. Please try again.`
          );
        }
      }
    } else {
      item.handler.connect(action);
    }
  }
  logger.log(`\u2728 ${item.binding} provisioned \u{1F389}`);
  printDivider();
}
var ProvisionResourceHandler, R2Handler, AISearchNamespaceHandler, KVHandler, D1Handler, HANDLERS;
var init_bindings2 = __esm({
  "src/deployment-bundle/bindings.ts"() {
    init_import_meta_url();
    init_dist();
    init_ai_search2();
    init_utils2();
    init_cfetch();
    init_create4();
    init_list5();
    init_utils8();
    init_dialogs();
    init_is_interactive();
    init_helpers5();
    init_logger();
    init_metrics();
    init_bucket();
    init_print_bindings();
    init_useServiceEnvironments();
    __name(getBindings, "getBindings");
    ProvisionResourceHandler = class {
      constructor(type, bindingName, binding, idField, complianceConfig, accountId) {
        this.type = type;
        this.bindingName = bindingName;
        this.binding = binding;
        this.idField = idField;
        this.complianceConfig = complianceConfig;
        this.accountId = accountId;
      }
      static {
        __name(this, "ProvisionResourceHandler");
      }
      inherit() {
        this.binding[this.idField] = INHERIT_SYMBOL;
      }
      connect(id) {
        this.binding[this.idField] = id;
      }
      async provision(name2) {
        const id = await this.create(name2);
        this.connect(id);
      }
      // This binding is fully specified and can't/shouldn't be provisioned
      // This is usually when it has an id (e.g. D1 `database_id`)
      isFullySpecified() {
        return false;
      }
      // Does this binding need to be provisioned?
      // Some bindings are not fully specified, but don't need provisioning
      // (e.g. R2 binding, with a bucket_name that already exists)
      async isConnectedToExistingResource() {
        return false;
      }
      // Should this resource be provisioned?
      async shouldProvision(settings) {
        if (!this.isFullySpecified()) {
          if (await this.canInherit(settings)) {
            this.inherit();
          } else {
            const connected = await this.isConnectedToExistingResource();
            if (connected) {
              if (typeof connected === "string") {
                this.connect(connected);
              }
              return false;
            }
            return true;
          }
        }
        return false;
      }
    };
    R2Handler = class extends ProvisionResourceHandler {
      static {
        __name(this, "R2Handler");
      }
      get name() {
        return this.binding.bucket_name;
      }
      async create(name2) {
        await createR2Bucket(
          this.complianceConfig,
          this.accountId,
          name2,
          void 0,
          this.binding.jurisdiction
        );
        return name2;
      }
      constructor(bindingName, binding, complianceConfig, accountId) {
        super(
          "r2_bucket",
          bindingName,
          binding,
          "bucket_name",
          complianceConfig,
          accountId
        );
      }
      /**
       * Inheriting an R2 binding replaces the id property (bucket_name for R2) with the inheritance symbol.
       * This works when deploying (and is appropriate for all other binding types), but it means that the
       * bucket_name for an R2 bucket is not displayed when deploying. As such, only use the inheritance symbol
       * if the R2 binding has no `bucket_name`.
       */
      inherit() {
        this.binding.bucket_name ??= INHERIT_SYMBOL;
      }
      /**
       * R2 bindings can be inherited if the binding name and jurisdiction match.
       * Additionally, if the user has specified a bucket_name in config, make sure that matches
       */
      canInherit(settings) {
        return !!settings?.bindings.find(
          (existing) => existing.type === this.type && existing.name === this.bindingName && existing.jurisdiction === this.binding.jurisdiction && (this.binding.bucket_name ? this.binding.bucket_name === existing.bucket_name : true)
        );
      }
      async isConnectedToExistingResource() {
        assert53__default.default(typeof this.binding.bucket_name !== "symbol");
        if (!this.binding.bucket_name) {
          return false;
        }
        try {
          await getR2Bucket(
            this.complianceConfig,
            this.accountId,
            this.binding.bucket_name,
            this.binding.jurisdiction
          );
          return true;
        } catch (e10) {
          if (!(e10 instanceof APIError && e10.code === 10006)) {
            throw e10;
          }
          return false;
        }
      }
    };
    AISearchNamespaceHandler = class extends ProvisionResourceHandler {
      static {
        __name(this, "AISearchNamespaceHandler");
      }
      get name() {
        return this.binding.namespace;
      }
      async create(name2) {
        await createAISearchNamespace(this.complianceConfig, this.accountId, name2);
        return name2;
      }
      constructor(bindingName, binding, complianceConfig, accountId) {
        super(
          "ai_search_namespace",
          bindingName,
          binding,
          "namespace",
          complianceConfig,
          accountId
        );
      }
      canInherit(settings) {
        return !!settings?.bindings.find(
          (existing) => existing.type === this.type && existing.name === this.bindingName && (this.binding.namespace ? this.binding.namespace === existing.namespace : true)
        );
      }
      async isConnectedToExistingResource() {
        assert53__default.default(typeof this.binding.namespace !== "symbol");
        if (!this.binding.namespace) {
          return false;
        }
        const namespace = await getAISearchNamespace(
          this.complianceConfig,
          this.accountId,
          this.binding.namespace
        );
        return namespace !== null;
      }
    };
    KVHandler = class extends ProvisionResourceHandler {
      static {
        __name(this, "KVHandler");
      }
      get name() {
        return void 0;
      }
      async create(name2) {
        return await createKVNamespace(this.complianceConfig, this.accountId, name2);
      }
      constructor(bindingName, binding, complianceConfig, accountId) {
        super(
          "kv_namespace",
          bindingName,
          binding,
          "id",
          complianceConfig,
          accountId
        );
      }
      canInherit(settings) {
        return !!settings?.bindings.find(
          (existing) => existing.type === this.type && existing.name === this.bindingName
        );
      }
      isFullySpecified() {
        return !!this.binding.id;
      }
    };
    D1Handler = class extends ProvisionResourceHandler {
      static {
        __name(this, "D1Handler");
      }
      get name() {
        return this.binding.database_name;
      }
      async create(name2) {
        const db = await createD1Database(
          this.complianceConfig,
          this.accountId,
          name2
        );
        return db.uuid;
      }
      constructor(bindingName, binding, complianceConfig, accountId) {
        super(
          "d1",
          bindingName,
          binding,
          "database_id",
          complianceConfig,
          accountId
        );
      }
      async canInherit(settings) {
        const maybeInherited = settings?.bindings.find(
          (existing) => existing.type === this.type && existing.name === this.bindingName
        );
        if (maybeInherited) {
          if (!this.binding.database_name) {
            return true;
          }
          const dbFromId = await getDatabaseInfoFromIdOrName(
            this.complianceConfig,
            this.accountId,
            maybeInherited.id
          );
          if (this.binding.database_name === dbFromId.name) {
            return true;
          }
        }
        return false;
      }
      async isConnectedToExistingResource() {
        assert53__default.default(typeof this.binding.database_name !== "symbol");
        if (!this.binding.database_name) {
          return false;
        }
        try {
          const db = await getDatabaseInfoFromIdOrName(
            this.complianceConfig,
            this.accountId,
            this.binding.database_name
          );
          return db.uuid;
        } catch (e10) {
          if (!(e10 instanceof APIError && e10.code === 7404)) {
            throw e10;
          }
          return false;
        }
      }
      isFullySpecified() {
        return !!this.binding.database_id;
      }
    };
    HANDLERS = {
      kv_namespace: {
        Handler: KVHandler,
        sort: 0,
        name: "KV Namespace",
        keyDescription: "title or id",
        configField: "kv_namespaces",
        load: /* @__PURE__ */ __name(async (complianceConfig, accountId) => {
          const preExistingKV = await listKVNamespaces(
            complianceConfig,
            accountId,
            true
          );
          return preExistingKV.map((ns) => ({ title: ns.title, value: ns.id }));
        }, "load"),
        toConfig: /* @__PURE__ */ __name((bindingName, binding) => {
          const { type: _5, ...rest } = binding;
          return {
            ...rest,
            binding: bindingName
          };
        }, "toConfig")
      },
      d1: {
        Handler: D1Handler,
        sort: 1,
        name: "D1 Database",
        keyDescription: "name or id",
        configField: "d1_databases",
        load: /* @__PURE__ */ __name(async (complianceConfig, accountId) => {
          const preExisting = await listDatabases(
            complianceConfig,
            accountId,
            true,
            1e3
          );
          return preExisting.map((db) => ({ title: db.name, value: db.uuid }));
        }, "load"),
        toConfig: /* @__PURE__ */ __name((bindingName, binding) => {
          const { type: _5, ...rest } = binding;
          return {
            ...rest,
            binding: bindingName
          };
        }, "toConfig")
      },
      r2_bucket: {
        Handler: R2Handler,
        sort: 2,
        name: "R2 Bucket",
        keyDescription: "name",
        configField: "r2_buckets",
        load: /* @__PURE__ */ __name(async (complianceConfig, accountId) => {
          const preExisting = await listR2Buckets(complianceConfig, accountId);
          return preExisting.map((bucket) => ({
            title: bucket.name,
            value: bucket.name
          }));
        }, "load"),
        toConfig: /* @__PURE__ */ __name((bindingName, binding) => {
          const { type: _5, ...rest } = binding;
          return {
            ...rest,
            binding: bindingName
          };
        }, "toConfig")
      },
      ai_search_namespace: {
        Handler: AISearchNamespaceHandler,
        sort: 3,
        name: "AI Search Namespace",
        keyDescription: "namespace name",
        configField: "ai_search_namespaces",
        load: /* @__PURE__ */ __name(async (_complianceConfig, _accountId) => {
          return [];
        }, "load"),
        toConfig: /* @__PURE__ */ __name((bindingName, binding) => {
          const { type: _5, ...rest } = binding;
          return {
            ...rest,
            binding: bindingName
          };
        }, "toConfig")
      }
    };
    __name(isProvisionableBinding, "isProvisionableBinding");
    __name(createHandler2, "createHandler");
    __name(toConfigBinding, "toConfigBinding");
    __name(collectPendingResources, "collectPendingResources");
    __name(provisionBindings, "provisionBindings");
    __name(getSettings, "getSettings");
    __name(printDivider, "printDivider");
    __name(runProvisioningFlow, "runProvisioningFlow");
  }
});
async function createKVNamespace(complianceConfig, accountId, title) {
  const response = await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/storage/kv/namespaces`,
    {
      method: "POST",
      headers: {
        "Content-Type": "application/json"
      },
      body: JSON.stringify({
        title
      })
    }
  );
  return response.id;
}
async function listKVNamespaces(complianceConfig, accountId, limitCalls = false) {
  const pageSize = 100;
  let page = 1;
  const results = [];
  while (results.length % pageSize === 0) {
    const json = await fetchResult(
      complianceConfig,
      `/accounts/${accountId}/storage/kv/namespaces`,
      {},
      new Url.URLSearchParams({
        per_page: pageSize.toString(),
        order: "title",
        direction: "asc",
        page: page.toString()
      })
    );
    page++;
    results.push(...json);
    if (limitCalls) {
      break;
    }
    if (json.length < pageSize) {
      break;
    }
  }
  return results;
}
async function listKVNamespaceKeys(complianceConfig, accountId, namespaceId, prefix = "") {
  return await fetchListResult(
    complianceConfig,
    `/accounts/${accountId}/storage/kv/namespaces/${namespaceId}/keys`,
    {},
    new Url.URLSearchParams({ prefix })
  );
}
async function updateKVNamespace(complianceConfig, accountId, namespaceId, title) {
  return await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/storage/kv/namespaces/${namespaceId}`,
    {
      method: "PUT",
      headers: {
        "Content-Type": "application/json"
      },
      body: JSON.stringify({
        title
      })
    }
  );
}
async function deleteKVNamespace(complianceConfig, accountId, namespaceId) {
  return await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/storage/kv/namespaces/${namespaceId}`,
    { method: "DELETE" }
  );
}
function isKVKeyValue(keyValue) {
  return keyValue !== null && typeof keyValue === "object" && isRequiredProperty(keyValue, "key", "string") && isRequiredProperty(keyValue, "value", "string") && isOptionalProperty(keyValue, "expiration", "number") && isOptionalProperty(keyValue, "expiration_ttl", "number") && isOptionalProperty(keyValue, "base64", "boolean") && isOptionalProperty(keyValue, "metadata", "object");
}
function unexpectedKVKeyValueProps(keyValue) {
  const props = Object.keys(keyValue);
  return props.filter((prop) => !KeyValueKeys.has(prop));
}
function asFormData(fields) {
  const formData = new import_undici14.FormData();
  for (const [name2, value] of Object.entries(fields)) {
    formData.append(name2, Buffer.isBuffer(value) ? new buffer.Blob([value]) : value);
  }
  return formData;
}
async function putKVKeyValue(complianceConfig, accountId, namespaceId, keyValue) {
  let searchParams;
  if (keyValue.expiration || keyValue.expiration_ttl) {
    searchParams = new Url.URLSearchParams();
    if (keyValue.expiration) {
      searchParams.set("expiration", `${keyValue.expiration}`);
    }
    if (keyValue.expiration_ttl) {
      searchParams.set("expiration_ttl", `${keyValue.expiration_ttl}`);
    }
  }
  return await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/storage/kv/namespaces/${namespaceId}/values/${encodeURIComponent(
      keyValue.key
    )}`,
    {
      method: "PUT",
      body: keyValue.metadata ? asFormData({
        value: keyValue.value,
        metadata: JSON.stringify(keyValue.metadata)
      }) : keyValue.value
    },
    searchParams
  );
}
async function getKVKeyValue(complianceConfig, accountId, namespaceId, key) {
  return await fetchKVGetValue(
    complianceConfig,
    accountId,
    namespaceId,
    encodeURIComponent(key)
  );
}
async function deleteKVKeyValue(complianceConfig, accountId, namespaceId, key) {
  return await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/storage/kv/namespaces/${namespaceId}/values/${encodeURIComponent(
      key
    )}`,
    { method: "DELETE" }
  );
}
function logBulkProgress(operation, index, total) {
  logger.log(
    `${operation === "put" ? "Uploaded" : "Deleted"} ${Math.floor(
      100 * index / total
    )}% (${formatNumber(index)} out of ${formatNumber(total)})`
  );
}
async function getKVBulkKeyValue(complianceConfig, accountId, namespaceId, keys) {
  const requestPayload = { keys };
  const result = await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/storage/kv/namespaces/${namespaceId}/bulk/get`,
    {
      method: "POST",
      body: JSON.stringify(requestPayload),
      headers: { "Content-Type": "application/json" }
    }
  );
  return result.values;
}
async function putKVBulkKeyValue(complianceConfig, accountId, namespaceId, keyValues, quiet = false, abortSignal) {
  for (let index = 0; index < keyValues.length; index += BATCH_KEY_MAX) {
    if (!quiet && keyValues.length > BATCH_KEY_MAX) {
      logBulkProgress("put", index, keyValues.length);
    }
    await fetchResult(
      complianceConfig,
      `/accounts/${accountId}/storage/kv/namespaces/${namespaceId}/bulk`,
      {
        method: "PUT",
        body: JSON.stringify(keyValues.slice(index, index + BATCH_KEY_MAX)),
        headers: { "Content-Type": "application/json" }
      },
      void 0,
      abortSignal
    );
  }
  if (!quiet && keyValues.length > BATCH_KEY_MAX) {
    logBulkProgress("put", keyValues.length, keyValues.length);
  }
}
async function deleteKVBulkKeyValue(complianceConfig, accountId, namespaceId, keys, quiet = false) {
  for (let index = 0; index < keys.length; index += BATCH_KEY_MAX) {
    if (!quiet && keys.length > BATCH_KEY_MAX) {
      logBulkProgress("delete", index, keys.length);
    }
    await fetchResult(
      complianceConfig,
      `/accounts/${accountId}/storage/kv/namespaces/${namespaceId}/bulk`,
      {
        method: "DELETE",
        body: JSON.stringify(keys.slice(index, index + BATCH_KEY_MAX)),
        headers: { "Content-Type": "application/json" }
      }
    );
  }
  if (!quiet && keys.length > BATCH_KEY_MAX) {
    logBulkProgress("delete", keys.length, keys.length);
  }
}
async function getIdFromSettings(config, binding, isLocal2) {
  if (isLocal2) {
    return binding;
  }
  const accountId = await requireAuth(config);
  if (!config.name) {
    throw new UserError("No Worker name found in config");
  }
  const settings = await getSettings(config, accountId, config.name);
  const existingKV = settings?.bindings.find(
    (existing) => existing.type === "kv_namespace" && existing.name === binding
  );
  if (!existingKV || !("namespace_id" in existingKV)) {
    throw new UserError(
      `No namespace ID found for binding "${binding}". Add one to your wrangler config file or pass it via \`--namespace-id\`.`
    );
  }
  return existingKV.namespace_id;
}
async function getKVNamespaceId({ namespace, preview, binding, "namespace-id": namespaceId }, config, isLocal2) {
  if (namespaceId) {
    return { namespaceId, displayName: `id: "${namespaceId}"` };
  }
  if (namespace) {
    const accountId = await requireAuth(config);
    const namespaces = await listKVNamespaces(config, accountId);
    const found = namespaces.find((ns) => ns.title === namespace);
    if (!found) {
      throw new UserError(
        `No namespace found with the name "${namespace}". Use --namespace-id or --binding instead, or check available namespaces with "wrangler kv namespace list".`
      );
    }
    return {
      namespaceId: found.id,
      displayName: `name: "${namespace}" (id: "${found.id}")`
    };
  }
  if (binding && !config) {
    throw new UserError("--binding specified, but no config file was found.");
  }
  if (!config) {
    throw new UserError(
      "Failed to find a config file.\nEither use --namespace-id to upload directly or create a configuration file with a binding."
    );
  }
  if (!config.kv_namespaces || config.kv_namespaces.length === 0) {
    throw new UserError(
      "No KV Namespaces configured! Either use --namespace-id to upload directly or add a KV namespace to your wrangler config file."
    );
  }
  const configNamespace = config.kv_namespaces.find(
    (ns) => ns.binding === binding
  );
  if (!configNamespace) {
    throw new UserError(
      `A namespace with binding name "${binding}" was not found in the configured "kv_namespaces".`
    );
  }
  const formatDisplayName = /* @__PURE__ */ __name((nsId) => `binding: "${binding}" (id: "${nsId}")`, "formatDisplayName");
  if (preview && configNamespace.preview_id) {
    const nsId = configNamespace.preview_id;
    return { namespaceId: nsId, displayName: formatDisplayName(nsId) };
  } else if (preview) {
    throw new UserError(
      `No preview ID found for ${binding}. Add one to your wrangler config file to use a separate namespace for previewing your worker.`
    );
  }
  const previewIsDefined = typeof preview !== "undefined";
  if (previewIsDefined && configNamespace.id) {
    const nsId = configNamespace.id;
    return { namespaceId: nsId, displayName: formatDisplayName(nsId) };
  } else if (previewIsDefined) {
    if (getFlag("RESOURCES_PROVISION")) {
      assert53__default.default(binding);
      const nsId = await getIdFromSettings(config, binding, isLocal2);
      return { namespaceId: nsId, displayName: formatDisplayName(nsId) };
    }
    throw new UserError(
      `No namespace ID found for ${binding}. Add one to your wrangler config file or pass it via \`--namespace-id\`.`
    );
  }
  const bindingHasOnlyOneId = configNamespace.id && !configNamespace.preview_id || !configNamespace.id && configNamespace.preview_id;
  if (bindingHasOnlyOneId) {
    const nsId = configNamespace.id || configNamespace.preview_id;
    assert53__default.default(nsId);
    return { namespaceId: nsId, displayName: formatDisplayName(nsId) };
  } else if (getFlag("RESOURCES_PROVISION") && !configNamespace.id && !configNamespace.preview_id) {
    assert53__default.default(binding);
    const nsId = await getIdFromSettings(config, binding, isLocal2);
    return { namespaceId: nsId, displayName: formatDisplayName(nsId) };
  } else {
    throw new UserError(
      `${binding} has both a namespace ID and a preview ID. Specify "--preview" or "--preview false" to avoid writing data to the wrong namespace.`
    );
  }
}
async function usingLocalNamespace(persistTo, config, namespaceId, closure) {
  const persist = getLocalPersistencePath(persistTo, config);
  const defaultPersistRoot = getDefaultPersistRoot(persist);
  const mf = new miniflare.Miniflare({
    script: 'addEventListener("fetch", (e) => e.respondWith(new Response(null, { status: 404 })))',
    defaultPersistRoot,
    kvNamespaces: { NAMESPACE: namespaceId }
  });
  const namespace = await mf.getKVNamespace("NAMESPACE");
  try {
    return await closure(namespace);
  } finally {
    await mf.dispose();
  }
}
var import_undici14, API_MAX, BATCH_KEY_MAX, BATCH_MAX_ERRORS_WARNINGS, KeyValueKeys, formatNumber;
var init_helpers5 = __esm({
  "src/kv/helpers.ts"() {
    init_import_meta_url();
    init_dist();
    import_undici14 = __toESM(require_undici());
    init_cfetch();
    init_bindings2();
    init_get_local_persistence_path();
    init_miniflare();
    init_experimental_flags();
    init_logger();
    init_user3();
    API_MAX = 1e4;
    BATCH_KEY_MAX = API_MAX / 10;
    BATCH_MAX_ERRORS_WARNINGS = 12;
    __name(createKVNamespace, "createKVNamespace");
    __name(listKVNamespaces, "listKVNamespaces");
    __name(listKVNamespaceKeys, "listKVNamespaceKeys");
    __name(updateKVNamespace, "updateKVNamespace");
    __name(deleteKVNamespace, "deleteKVNamespace");
    KeyValueKeys = /* @__PURE__ */ new Set([
      "key",
      "value",
      "expiration",
      "expiration_ttl",
      "metadata",
      "base64"
    ]);
    __name(isKVKeyValue, "isKVKeyValue");
    __name(unexpectedKVKeyValueProps, "unexpectedKVKeyValueProps");
    __name(asFormData, "asFormData");
    __name(putKVKeyValue, "putKVKeyValue");
    __name(getKVKeyValue, "getKVKeyValue");
    __name(deleteKVKeyValue, "deleteKVKeyValue");
    formatNumber = new Intl.NumberFormat("en-US", {
      notation: "standard"
    }).format;
    __name(logBulkProgress, "logBulkProgress");
    __name(getKVBulkKeyValue, "getKVBulkKeyValue");
    __name(putKVBulkKeyValue, "putKVBulkKeyValue");
    __name(deleteKVBulkKeyValue, "deleteKVBulkKeyValue");
    __name(getIdFromSettings, "getIdFromSettings");
    __name(getKVNamespaceId, "getKVNamespaceId");
    __name(usingLocalNamespace, "usingLocalNamespace");
  }
});

// src/utils/getScriptName.ts
function getScriptName(args, config) {
  return args.name ?? config.name;
}
var init_getScriptName = __esm({
  "src/utils/getScriptName.ts"() {
    init_import_meta_url();
    __name(getScriptName, "getScriptName");
  }
});
async function deleteSiteNamespaceIfExisting(complianceConfig, scriptName, accountId) {
  const title = `__${scriptName}-workers_sites_assets`;
  const previewTitle = `__${scriptName}-workers_sites_assets_preview`;
  const allNamespaces = await listKVNamespaces(complianceConfig, accountId);
  const namespacesToDelete = allNamespaces.filter(
    (ns) => ns.title === title || ns.title === previewTitle
  );
  for (const ns of namespacesToDelete) {
    await deleteKVNamespace(complianceConfig, accountId, ns.id);
    logger.log(`\u{1F300} Deleted asset namespace for Workers Site "${ns.title}"`);
  }
}
function renderScriptName(details) {
  let service;
  let environment;
  if ("script" in details) {
    service = details.script;
  } else {
    service = details.service;
    environment = details.environment;
  }
  return environment ? `${service} (${environment})` : service;
}
function isUsedAsServiceBinding(references) {
  return (references.services?.incoming.length || 0) > 0;
}
function isUsedByPagesFunction(references) {
  return references.services?.pages_function === true;
}
function isUsedAsDurableObjectNamespace(references, scriptName) {
  return (references.durable_objects?.filter((ref) => ref.service !== scriptName)?.length || 0) > 0;
}
function isUsedAsDispatchOutbound(references) {
  return references.dispatch_outbounds?.length || 0;
}
function isUsedAsTailConsumer(tailProducers) {
  return tailProducers.length > 0;
}
async function checkAndConfirmForceDeleteIfNecessary(complianceConfig, scriptName, accountId) {
  const references = await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/workers/scripts/${scriptName}/references`
  );
  const tailProducers = await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/workers/tails/by-consumer/${scriptName}`
  );
  const isDependentService = isUsedAsServiceBinding(references) || isUsedByPagesFunction(references) || isUsedAsDurableObjectNamespace(references, scriptName) || isUsedAsDispatchOutbound(references) || isUsedAsTailConsumer(tailProducers);
  if (!isDependentService) {
    return false;
  }
  const dependentMessages = [];
  for (const serviceBindingReference of references.services?.incoming || []) {
    const dependentScript = renderScriptName(serviceBindingReference);
    dependentMessages.push(
      `- Worker ${dependentScript} uses this Worker as a Service Binding`
    );
  }
  if (isUsedByPagesFunction(references)) {
    dependentMessages.push(
      `- A Pages project has a Service Binding to this Worker`
    );
  }
  for (const implementedDOBindingReference of references.durable_objects || []) {
    if (implementedDOBindingReference.service === scriptName) {
      continue;
    }
    const dependentScript = renderScriptName(implementedDOBindingReference);
    dependentMessages.push(
      `- Worker ${dependentScript} has a binding to the Durable Object Namespace "${implementedDOBindingReference.durable_object_namespace_name}" implemented by this Worker`
    );
  }
  for (const dispatchNamespaceOutboundReference of references.dispatch_outbounds || []) {
    const dependentScript = renderScriptName(
      dispatchNamespaceOutboundReference
    );
    dependentMessages.push(
      `- Worker ${dependentScript} uses this Worker as an Outbound Worker for the Dynamic Dispatch Namespace "${dispatchNamespaceOutboundReference.namespace}"`
    );
  }
  for (const consumingTail of tailProducers) {
    const dependentScript = renderScriptName(consumingTail.producer);
    dependentMessages.push(
      `- Worker ${dependentScript} uses this Worker as a Tail Worker`
    );
  }
  const extraConfirmed = await confirm(`${scriptName} is currently in use by other Workers:

${dependentMessages.join("\n")}

You can still delete this Worker, but doing so WILL BREAK the Workers that depend on it. This will cause unexpected failures, and cannot be undone.
Are you sure you want to continue?`);
  return extraConfirmed ? true : null;
}
var deleteCommand3;
var init_delete4 = __esm({
  "src/delete.ts"() {
    init_import_meta_url();
    init_dist();
    init_cfetch();
    init_create_command();
    init_dialogs();
    init_helpers5();
    init_logger();
    init_metrics();
    init_user3();
    init_getScriptName();
    deleteCommand3 = createCommand({
      metadata: {
        description: "\u{1F5D1}\uFE0F Delete a Worker from Cloudflare",
        owner: "Workers: Authoring and Testing",
        status: "stable",
        category: "Compute & AI"
      },
      args: {
        script: {
          describe: "The path to an entry point for your worker",
          type: "string",
          requiresArg: true,
          // TODO: the script argument is meaningless for the delete command, we haven't removed it as that could be
          //       considered a breaking change, we should do so in the next major Wrangler release
          hidden: true
        },
        name: {
          describe: "Name of the worker",
          type: "string",
          requiresArg: true
        },
        "dry-run": {
          describe: "Don't actually delete",
          type: "boolean"
        },
        force: {
          describe: "Delete even if doing so will break other Workers that depend on this one",
          type: "boolean"
        },
        "legacy-env": {
          type: "boolean",
          describe: "Use legacy environments",
          hidden: true
        }
      },
      positionalArgs: ["name"],
      async handler(args, { config }) {
        if (config.pages_build_output_dir) {
          throw new UserError(
            "It looks like you've run a Workers-specific command in a Pages project.\nFor Pages, please run `wrangler pages project delete` instead.",
            { telemetryMessage: true }
          );
        }
        sendMetricsEvent(
          "delete worker script",
          {},
          { sendMetrics: config.send_metrics }
        );
        const accountId = args.dryRun ? void 0 : await requireAuth(config);
        const scriptName = getScriptName(args, config);
        if (!scriptName) {
          throw new UserError(
            `A worker name must be defined, either via --name, or in your ${configFileName(config.configPath)} file`,
            {
              telemetryMessage: "`A worker name must be defined, either via --name, or in your config file"
            }
          );
        }
        if (args.dryRun) {
          logger.log(`--dry-run: exiting now.`);
          return;
        }
        assert53__default.default(accountId, "Missing accountId");
        const confirmed = args.force || await confirm(
          `Are you sure you want to delete ${scriptName}? This action cannot be undone.`
        );
        if (confirmed) {
          const needsForceDelete = args.force || await checkAndConfirmForceDeleteIfNecessary(
            config,
            scriptName,
            accountId
          );
          if (needsForceDelete === null) {
            return;
          }
          await fetchResult(
            config,
            `/accounts/${accountId}/workers/services/${scriptName}`,
            { method: "DELETE" },
            new URLSearchParams({ force: needsForceDelete.toString() })
          );
          await deleteSiteNamespaceIfExisting(config, scriptName, accountId);
          logger.log("Successfully deleted", scriptName);
        }
      }
    });
    __name(deleteSiteNamespaceIfExisting, "deleteSiteNamespaceIfExisting");
    __name(renderScriptName, "renderScriptName");
    __name(isUsedAsServiceBinding, "isUsedAsServiceBinding");
    __name(isUsedByPagesFunction, "isUsedByPagesFunction");
    __name(isUsedAsDurableObjectNamespace, "isUsedAsDurableObjectNamespace");
    __name(isUsedAsDispatchOutbound, "isUsedAsDispatchOutbound");
    __name(isUsedAsTailConsumer, "isUsedAsTailConsumer");
    __name(checkAndConfirmForceDeleteIfNecessary, "checkAndConfirmForceDeleteIfNecessary");
  }
});

// ../../node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.mjs
var tslib_es6_exports = {};
__export(tslib_es6_exports, {
  __addDisposableResource: () => __addDisposableResource,
  __assign: () => __assign,
  __asyncDelegator: () => __asyncDelegator,
  __asyncGenerator: () => __asyncGenerator,
  __asyncValues: () => __asyncValues,
  __await: () => __await,
  __awaiter: () => __awaiter,
  __classPrivateFieldGet: () => __classPrivateFieldGet9,
  __classPrivateFieldIn: () => __classPrivateFieldIn,
  __classPrivateFieldSet: () => __classPrivateFieldSet7,
  __createBinding: () => __createBinding,
  __decorate: () => __decorate,
  __disposeResources: () => __disposeResources,
  __esDecorate: () => __esDecorate,
  __exportStar: () => __exportStar,
  __extends: () => __extends,
  __generator: () => __generator,
  __importDefault: () => __importDefault,
  __importStar: () => __importStar,
  __makeTemplateObject: () => __makeTemplateObject,
  __metadata: () => __metadata,
  __param: () => __param,
  __propKey: () => __propKey,
  __read: () => __read,
  __rest: () => __rest,
  __rewriteRelativeImportExtension: () => __rewriteRelativeImportExtension,
  __runInitializers: () => __runInitializers,
  __setFunctionName: () => __setFunctionName,
  __spread: () => __spread,
  __spreadArray: () => __spreadArray,
  __spreadArrays: () => __spreadArrays,
  __values: () => __values,
  default: () => tslib_es6_default
});
function __extends(d8, b11) {
  if (typeof b11 !== "function" && b11 !== null)
    throw new TypeError("Class extends value " + String(b11) + " is not a constructor or null");
  extendStatics(d8, b11);
  function __() {
    this.constructor = d8;
  }
  __name(__, "__");
  d8.prototype = b11 === null ? Object.create(b11) : (__.prototype = b11.prototype, new __());
}
function __rest(s7, e10) {
  var t13 = {};
  for (var p7 in s7) if (Object.prototype.hasOwnProperty.call(s7, p7) && e10.indexOf(p7) < 0)
    t13[p7] = s7[p7];
  if (s7 != null && typeof Object.getOwnPropertySymbols === "function")
    for (var i7 = 0, p7 = Object.getOwnPropertySymbols(s7); i7 < p7.length; i7++) {
      if (e10.indexOf(p7[i7]) < 0 && Object.prototype.propertyIsEnumerable.call(s7, p7[i7]))
        t13[p7[i7]] = s7[p7[i7]];
    }
  return t13;
}
function __decorate(decorators, target, key, desc) {
  var c8 = arguments.length, r10 = c8 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d8;
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r10 = Reflect.decorate(decorators, target, key, desc);
  else for (var i7 = decorators.length - 1; i7 >= 0; i7--) if (d8 = decorators[i7]) r10 = (c8 < 3 ? d8(r10) : c8 > 3 ? d8(target, key, r10) : d8(target, key)) || r10;
  return c8 > 3 && r10 && Object.defineProperty(target, key, r10), r10;
}
function __param(paramIndex, decorator) {
  return function(target, key) {
    decorator(target, key, paramIndex);
  };
}
function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
  function accept(f8) {
    if (f8 !== void 0 && typeof f8 !== "function") throw new TypeError("Function expected");
    return f8;
  }
  __name(accept, "accept");
  var kind2 = contextIn.kind, key = kind2 === "getter" ? "get" : kind2 === "setter" ? "set" : "value";
  var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
  var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
  var _5, done = false;
  for (var i7 = decorators.length - 1; i7 >= 0; i7--) {
    var context2 = {};
    for (var p7 in contextIn) context2[p7] = p7 === "access" ? {} : contextIn[p7];
    for (var p7 in contextIn.access) context2.access[p7] = contextIn.access[p7];
    context2.addInitializer = function(f8) {
      if (done) throw new TypeError("Cannot add initializers after decoration has completed");
      extraInitializers.push(accept(f8 || null));
    };
    var result = (0, decorators[i7])(kind2 === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context2);
    if (kind2 === "accessor") {
      if (result === void 0) continue;
      if (result === null || typeof result !== "object") throw new TypeError("Object expected");
      if (_5 = accept(result.get)) descriptor.get = _5;
      if (_5 = accept(result.set)) descriptor.set = _5;
      if (_5 = accept(result.init)) initializers.unshift(_5);
    } else if (_5 = accept(result)) {
      if (kind2 === "field") initializers.unshift(_5);
      else descriptor[key] = _5;
    }
  }
  if (target) Object.defineProperty(target, contextIn.name, descriptor);
  done = true;
}
function __runInitializers(thisArg, initializers, value) {
  var useValue = arguments.length > 2;
  for (var i7 = 0; i7 < initializers.length; i7++) {
    value = useValue ? initializers[i7].call(thisArg, value) : initializers[i7].call(thisArg);
  }
  return useValue ? value : void 0;
}
function __propKey(x7) {
  return typeof x7 === "symbol" ? x7 : "".concat(x7);
}
function __setFunctionName(f8, name2, prefix) {
  if (typeof name2 === "symbol") name2 = name2.description ? "[".concat(name2.description, "]") : "";
  return Object.defineProperty(f8, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name2) : name2 });
}
function __metadata(metadataKey, metadataValue) {
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
}
function __awaiter(thisArg, _arguments, P4, generator) {
  function adopt(value) {
    return value instanceof P4 ? value : new P4(function(resolve32) {
      resolve32(value);
    });
  }
  __name(adopt, "adopt");
  return new (P4 || (P4 = Promise))(function(resolve32, reject) {
    function fulfilled(value) {
      try {
        step(generator.next(value));
      } catch (e10) {
        reject(e10);
      }
    }
    __name(fulfilled, "fulfilled");
    function rejected(value) {
      try {
        step(generator["throw"](value));
      } catch (e10) {
        reject(e10);
      }
    }
    __name(rejected, "rejected");
    function step(result) {
      result.done ? resolve32(result.value) : adopt(result.value).then(fulfilled, rejected);
    }
    __name(step, "step");
    step((generator = generator.apply(thisArg, _arguments || [])).next());
  });
}
function __generator(thisArg, body) {
  var _5 = { label: 0, sent: /* @__PURE__ */ __name(function() {
    if (t13[0] & 1) throw t13[1];
    return t13[1];
  }, "sent"), trys: [], ops: [] }, f8, y5, t13, g7 = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
  return g7.next = verb(0), g7["throw"] = verb(1), g7["return"] = verb(2), typeof Symbol === "function" && (g7[Symbol.iterator] = function() {
    return this;
  }), g7;
  function verb(n9) {
    return function(v8) {
      return step([n9, v8]);
    };
  }
  function step(op) {
    if (f8) throw new TypeError("Generator is already executing.");
    while (g7 && (g7 = 0, op[0] && (_5 = 0)), _5) try {
      if (f8 = 1, y5 && (t13 = op[0] & 2 ? y5["return"] : op[0] ? y5["throw"] || ((t13 = y5["return"]) && t13.call(y5), 0) : y5.next) && !(t13 = t13.call(y5, op[1])).done) return t13;
      if (y5 = 0, t13) op = [op[0] & 2, t13.value];
      switch (op[0]) {
        case 0:
        case 1:
          t13 = op;
          break;
        case 4:
          _5.label++;
          return { value: op[1], done: false };
        case 5:
          _5.label++;
          y5 = op[1];
          op = [0];
          continue;
        case 7:
          op = _5.ops.pop();
          _5.trys.pop();
          continue;
        default:
          if (!(t13 = _5.trys, t13 = t13.length > 0 && t13[t13.length - 1]) && (op[0] === 6 || op[0] === 2)) {
            _5 = 0;
            continue;
          }
          if (op[0] === 3 && (!t13 || op[1] > t13[0] && op[1] < t13[3])) {
            _5.label = op[1];
            break;
          }
          if (op[0] === 6 && _5.label < t13[1]) {
            _5.label = t13[1];
            t13 = op;
            break;
          }
          if (t13 && _5.label < t13[2]) {
            _5.label = t13[2];
            _5.ops.push(op);
            break;
          }
          if (t13[2]) _5.ops.pop();
          _5.trys.pop();
          continue;
      }
      op = body.call(thisArg, _5);
    } catch (e10) {
      op = [6, e10];
      y5 = 0;
    } finally {
      f8 = t13 = 0;
    }
    if (op[0] & 5) throw op[1];
    return { value: op[0] ? op[1] : void 0, done: true };
  }
}
function __exportStar(m7, o7) {
  for (var p7 in m7) if (p7 !== "default" && !Object.prototype.hasOwnProperty.call(o7, p7)) __createBinding(o7, m7, p7);
}
function __values(o7) {
  var s7 = typeof Symbol === "function" && Symbol.iterator, m7 = s7 && o7[s7], i7 = 0;
  if (m7) return m7.call(o7);
  if (o7 && typeof o7.length === "number") return {
    next: /* @__PURE__ */ __name(function() {
      if (o7 && i7 >= o7.length) o7 = void 0;
      return { value: o7 && o7[i7++], done: !o7 };
    }, "next")
  };
  throw new TypeError(s7 ? "Object is not iterable." : "Symbol.iterator is not defined.");
}
function __read(o7, n9) {
  var m7 = typeof Symbol === "function" && o7[Symbol.iterator];
  if (!m7) return o7;
  var i7 = m7.call(o7), r10, ar3 = [], e10;
  try {
    while ((n9 === void 0 || n9-- > 0) && !(r10 = i7.next()).done) ar3.push(r10.value);
  } catch (error2) {
    e10 = { error: error2 };
  } finally {
    try {
      if (r10 && !r10.done && (m7 = i7["return"])) m7.call(i7);
    } finally {
      if (e10) throw e10.error;
    }
  }
  return ar3;
}
function __spread() {
  for (var ar3 = [], i7 = 0; i7 < arguments.length; i7++)
    ar3 = ar3.concat(__read(arguments[i7]));
  return ar3;
}
function __spreadArrays() {
  for (var s7 = 0, i7 = 0, il = arguments.length; i7 < il; i7++) s7 += arguments[i7].length;
  for (var r10 = Array(s7), k7 = 0, i7 = 0; i7 < il; i7++)
    for (var a7 = arguments[i7], j7 = 0, jl = a7.length; j7 < jl; j7++, k7++)
      r10[k7] = a7[j7];
  return r10;
}
function __spreadArray(to, from, pack) {
  if (pack || arguments.length === 2) for (var i7 = 0, l8 = from.length, ar3; i7 < l8; i7++) {
    if (ar3 || !(i7 in from)) {
      if (!ar3) ar3 = Array.prototype.slice.call(from, 0, i7);
      ar3[i7] = from[i7];
    }
  }
  return to.concat(ar3 || Array.prototype.slice.call(from));
}
function __await(v8) {
  return this instanceof __await ? (this.v = v8, this) : new __await(v8);
}
function __asyncGenerator(thisArg, _arguments, generator) {
  if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  var g7 = generator.apply(thisArg, _arguments || []), i7, q7 = [];
  return i7 = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i7[Symbol.asyncIterator] = function() {
    return this;
  }, i7;
  function awaitReturn(f8) {
    return function(v8) {
      return Promise.resolve(v8).then(f8, reject);
    };
  }
  function verb(n9, f8) {
    if (g7[n9]) {
      i7[n9] = function(v8) {
        return new Promise(function(a7, b11) {
          q7.push([n9, v8, a7, b11]) > 1 || resume(n9, v8);
        });
      };
      if (f8) i7[n9] = f8(i7[n9]);
    }
  }
  function resume(n9, v8) {
    try {
      step(g7[n9](v8));
    } catch (e10) {
      settle(q7[0][3], e10);
    }
  }
  function step(r10) {
    r10.value instanceof __await ? Promise.resolve(r10.value.v).then(fulfill, reject) : settle(q7[0][2], r10);
  }
  function fulfill(value) {
    resume("next", value);
  }
  function reject(value) {
    resume("throw", value);
  }
  function settle(f8, v8) {
    if (f8(v8), q7.shift(), q7.length) resume(q7[0][0], q7[0][1]);
  }
}
function __asyncDelegator(o7) {
  var i7, p7;
  return i7 = {}, verb("next"), verb("throw", function(e10) {
    throw e10;
  }), verb("return"), i7[Symbol.iterator] = function() {
    return this;
  }, i7;
  function verb(n9, f8) {
    i7[n9] = o7[n9] ? function(v8) {
      return (p7 = !p7) ? { value: __await(o7[n9](v8)), done: false } : f8 ? f8(v8) : v8;
    } : f8;
  }
}
function __asyncValues(o7) {
  if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  var m7 = o7[Symbol.asyncIterator], i7;
  return m7 ? m7.call(o7) : (o7 = typeof __values === "function" ? __values(o7) : o7[Symbol.iterator](), i7 = {}, verb("next"), verb("throw"), verb("return"), i7[Symbol.asyncIterator] = function() {
    return this;
  }, i7);
  function verb(n9) {
    i7[n9] = o7[n9] && function(v8) {
      return new Promise(function(resolve32, reject) {
        v8 = o7[n9](v8), settle(resolve32, reject, v8.done, v8.value);
      });
    };
  }
  function settle(resolve32, reject, d8, v8) {
    Promise.resolve(v8).then(function(v9) {
      resolve32({ value: v9, done: d8 });
    }, reject);
  }
}
function __makeTemplateObject(cooked, raw) {
  if (Object.defineProperty) {
    Object.defineProperty(cooked, "raw", { value: raw });
  } else {
    cooked.raw = raw;
  }
  return cooked;
}
function __importStar(mod) {
  if (mod && mod.__esModule) return mod;
  var result = {};
  if (mod != null) {
    for (var k7 = ownKeys(mod), i7 = 0; i7 < k7.length; i7++) if (k7[i7] !== "default") __createBinding(result, mod, k7[i7]);
  }
  __setModuleDefault(result, mod);
  return result;
}
function __importDefault(mod) {
  return mod && mod.__esModule ? mod : { default: mod };
}
function __classPrivateFieldGet9(receiver, state2, kind2, f8) {
  if (kind2 === "a" && !f8) throw new TypeError("Private accessor was defined without a getter");
  if (typeof state2 === "function" ? receiver !== state2 || !f8 : !state2.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
  return kind2 === "m" ? f8 : kind2 === "a" ? f8.call(receiver) : f8 ? f8.value : state2.get(receiver);
}
function __classPrivateFieldSet7(receiver, state2, value, kind2, f8) {
  if (kind2 === "m") throw new TypeError("Private method is not writable");
  if (kind2 === "a" && !f8) throw new TypeError("Private accessor was defined without a setter");
  if (typeof state2 === "function" ? receiver !== state2 || !f8 : !state2.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
  return kind2 === "a" ? f8.call(receiver, value) : f8 ? f8.value = value : state2.set(receiver, value), value;
}
function __classPrivateFieldIn(state2, receiver) {
  if (receiver === null || typeof receiver !== "object" && typeof receiver !== "function") throw new TypeError("Cannot use 'in' operator on non-object");
  return typeof state2 === "function" ? receiver === state2 : state2.has(receiver);
}
function __addDisposableResource(env6, value, async) {
  if (value !== null && value !== void 0) {
    if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
    var dispose, inner;
    if (async) {
      if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
      dispose = value[Symbol.asyncDispose];
    }
    if (dispose === void 0) {
      if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
      dispose = value[Symbol.dispose];
      if (async) inner = dispose;
    }
    if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
    if (inner) dispose = /* @__PURE__ */ __name(function() {
      try {
        inner.call(this);
      } catch (e10) {
        return Promise.reject(e10);
      }
    }, "dispose");
    env6.stack.push({ value, dispose, async });
  } else if (async) {
    env6.stack.push({ async: true });
  }
  return value;
}
function __disposeResources(env6) {
  function fail(e10) {
    env6.error = env6.hasError ? new _SuppressedError(e10, env6.error, "An error was suppressed during disposal.") : e10;
    env6.hasError = true;
  }
  __name(fail, "fail");
  var r10, s7 = 0;
  function next() {
    while (r10 = env6.stack.pop()) {
      try {
        if (!r10.async && s7 === 1) return s7 = 0, env6.stack.push(r10), Promise.resolve().then(next);
        if (r10.dispose) {
          var result = r10.dispose.call(r10.value);
          if (r10.async) return s7 |= 2, Promise.resolve(result).then(next, function(e10) {
            fail(e10);
            return next();
          });
        } else s7 |= 1;
      } catch (e10) {
        fail(e10);
      }
    }
    if (s7 === 1) return env6.hasError ? Promise.reject(env6.error) : Promise.resolve();
    if (env6.hasError) throw env6.error;
  }
  __name(next, "next");
  return next();
}
function __rewriteRelativeImportExtension(path84, preserveJsx) {
  if (typeof path84 === "string" && /^\.\.?\//.test(path84)) {
    return path84.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m7, tsx, d8, ext2, cm2) {
      return tsx ? preserveJsx ? ".jsx" : ".js" : d8 && (!ext2 || !cm2) ? m7 : d8 + ext2 + "." + cm2.toLowerCase() + "js";
    });
  }
  return path84;
}
var extendStatics, __assign, __createBinding, __setModuleDefault, ownKeys, _SuppressedError, tslib_es6_default;
var init_tslib_es6 = __esm({
  "../../node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.mjs"() {
    init_import_meta_url();
    extendStatics = /* @__PURE__ */ __name(function(d8, b11) {
      extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d9, b12) {
        d9.__proto__ = b12;
      } || function(d9, b12) {
        for (var p7 in b12) if (Object.prototype.hasOwnProperty.call(b12, p7)) d9[p7] = b12[p7];
      };
      return extendStatics(d8, b11);
    }, "extendStatics");
    __name(__extends, "__extends");
    __assign = /* @__PURE__ */ __name(function() {
      __assign = Object.assign || /* @__PURE__ */ __name(function __assign2(t13) {
        for (var s7, i7 = 1, n9 = arguments.length; i7 < n9; i7++) {
          s7 = arguments[i7];
          for (var p7 in s7) if (Object.prototype.hasOwnProperty.call(s7, p7)) t13[p7] = s7[p7];
        }
        return t13;
      }, "__assign");
      return __assign.apply(this, arguments);
    }, "__assign");
    __name(__rest, "__rest");
    __name(__decorate, "__decorate");
    __name(__param, "__param");
    __name(__esDecorate, "__esDecorate");
    __name(__runInitializers, "__runInitializers");
    __name(__propKey, "__propKey");
    __name(__setFunctionName, "__setFunctionName");
    __name(__metadata, "__metadata");
    __name(__awaiter, "__awaiter");
    __name(__generator, "__generator");
    __createBinding = Object.create ? function(o7, m7, k7, k22) {
      if (k22 === void 0) k22 = k7;
      var desc = Object.getOwnPropertyDescriptor(m7, k7);
      if (!desc || ("get" in desc ? !m7.__esModule : desc.writable || desc.configurable)) {
        desc = { enumerable: true, get: /* @__PURE__ */ __name(function() {
          return m7[k7];
        }, "get") };
      }
      Object.defineProperty(o7, k22, desc);
    } : function(o7, m7, k7, k22) {
      if (k22 === void 0) k22 = k7;
      o7[k22] = m7[k7];
    };
    __name(__exportStar, "__exportStar");
    __name(__values, "__values");
    __name(__read, "__read");
    __name(__spread, "__spread");
    __name(__spreadArrays, "__spreadArrays");
    __name(__spreadArray, "__spreadArray");
    __name(__await, "__await");
    __name(__asyncGenerator, "__asyncGenerator");
    __name(__asyncDelegator, "__asyncDelegator");
    __name(__asyncValues, "__asyncValues");
    __name(__makeTemplateObject, "__makeTemplateObject");
    __setModuleDefault = Object.create ? function(o7, v8) {
      Object.defineProperty(o7, "default", { enumerable: true, value: v8 });
    } : function(o7, v8) {
      o7["default"] = v8;
    };
    ownKeys = /* @__PURE__ */ __name(function(o7) {
      ownKeys = Object.getOwnPropertyNames || function(o8) {
        var ar3 = [];
        for (var k7 in o8) if (Object.prototype.hasOwnProperty.call(o8, k7)) ar3[ar3.length] = k7;
        return ar3;
      };
      return ownKeys(o7);
    }, "ownKeys");
    __name(__importStar, "__importStar");
    __name(__importDefault, "__importDefault");
    __name(__classPrivateFieldGet9, "__classPrivateFieldGet");
    __name(__classPrivateFieldSet7, "__classPrivateFieldSet");
    __name(__classPrivateFieldIn, "__classPrivateFieldIn");
    __name(__addDisposableResource, "__addDisposableResource");
    _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function(error2, suppressed, message) {
      var e10 = new Error(message);
      return e10.name = "SuppressedError", e10.error = error2, e10.suppressed = suppressed, e10;
    };
    __name(__disposeResources, "__disposeResources");
    __name(__rewriteRelativeImportExtension, "__rewriteRelativeImportExtension");
    tslib_es6_default = {
      __extends,
      __assign,
      __rest,
      __decorate,
      __param,
      __esDecorate,
      __runInitializers,
      __propKey,
      __setFunctionName,
      __metadata,
      __awaiter,
      __generator,
      __createBinding,
      __exportStar,
      __values,
      __read,
      __spread,
      __spreadArrays,
      __spreadArray,
      __await,
      __asyncGenerator,
      __asyncDelegator,
      __asyncValues,
      __makeTemplateObject,
      __importStar,
      __importDefault,
      __classPrivateFieldGet: __classPrivateFieldGet9,
      __classPrivateFieldSet: __classPrivateFieldSet7,
      __classPrivateFieldIn,
      __addDisposableResource,
      __disposeResources,
      __rewriteRelativeImportExtension
    };
  }
});

// ../../node_modules/.pnpm/ast-types@0.16.1/node_modules/ast-types/lib/shared.js
var require_shared = __commonJS({
  "../../node_modules/.pnpm/ast-types@0.16.1/node_modules/ast-types/lib/shared.js"(exports) {
    init_import_meta_url();
    Object.defineProperty(exports, "__esModule", { value: true });
    exports.maybeSetModuleExports = void 0;
    var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
    var types_1 = tslib_1.__importDefault(require_types());
    function default_1(fork) {
      var types13 = fork.use(types_1.default);
      var Type2 = types13.Type;
      var builtin = types13.builtInTypes;
      var isNumber = builtin.number;
      function geq(than) {
        return Type2.from(function(value) {
          return isNumber.check(value) && value >= than;
        }, isNumber + " >= " + than);
      }
      __name(geq, "geq");
      var defaults3 = {
        // Functions were used because (among other reasons) that's the most
        // elegant way to allow for the emptyArray one always to give a new
        // array instance.
        "null": /* @__PURE__ */ __name(function() {
          return null;
        }, "null"),
        "emptyArray": /* @__PURE__ */ __name(function() {
          return [];
        }, "emptyArray"),
        "false": /* @__PURE__ */ __name(function() {
          return false;
        }, "false"),
        "true": /* @__PURE__ */ __name(function() {
          return true;
        }, "true"),
        "undefined": /* @__PURE__ */ __name(function() {
        }, "undefined"),
        "use strict": /* @__PURE__ */ __name(function() {
          return "use strict";
        }, "use strict")
      };
      var naiveIsPrimitive = Type2.or(builtin.string, builtin.number, builtin.boolean, builtin.null, builtin.undefined);
      var isPrimitive2 = Type2.from(function(value) {
        if (value === null)
          return true;
        var type = typeof value;
        if (type === "object" || type === "function") {
          return false;
        }
        return true;
      }, naiveIsPrimitive.toString());
      return {
        geq,
        defaults: defaults3,
        isPrimitive: isPrimitive2
      };
    }
    __name(default_1, "default_1");
    exports.default = default_1;
    function maybeSetModuleExports(moduleGetter) {
      try {
        var nodeModule = moduleGetter();
        var originalExports = nodeModule.exports;
        var defaultExport = originalExports["default"];
      } catch (_a5) {
        return;
      }
      if (defaultExport && defaultExport !== originalExports && typeof originalExports === "object") {
        Object.assign(defaultExport, originalExports, { "default": defaultExport });
        if (originalExports.__esModule) {
          Object.defineProperty(defaultExport, "__esModule", { value: true });
        }
        nodeModule.exports = defaultExport;
      }
    }
    __name(maybeSetModuleExports, "maybeSetModuleExports");
    exports.maybeSetModuleExports = maybeSetModuleExports;
  }
});

// ../../node_modules/.pnpm/ast-types@0.16.1/node_modules/ast-types/lib/types.js
var require_types = __commonJS({
  "../../node_modules/.pnpm/ast-types@0.16.1/node_modules/ast-types/lib/types.js"(exports, module2) {
    init_import_meta_url();
    Object.defineProperty(exports, "__esModule", { value: true });
    exports.Def = void 0;
    var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
    var shared_1 = require_shared();
    var Op = Object.prototype;
    var objToStr = Op.toString;
    var hasOwn2 = Op.hasOwnProperty;
    var BaseType = (
      /** @class */
      function() {
        function BaseType2() {
        }
        __name(BaseType2, "BaseType");
        BaseType2.prototype.assert = function(value, deep) {
          if (!this.check(value, deep)) {
            var str = shallowStringify(value);
            throw new Error(str + " does not match type " + this);
          }
          return true;
        };
        BaseType2.prototype.arrayOf = function() {
          var elemType = this;
          return new ArrayType(elemType);
        };
        return BaseType2;
      }()
    );
    var ArrayType = (
      /** @class */
      function(_super) {
        tslib_1.__extends(ArrayType2, _super);
        function ArrayType2(elemType) {
          var _this = _super.call(this) || this;
          _this.elemType = elemType;
          _this.kind = "ArrayType";
          return _this;
        }
        __name(ArrayType2, "ArrayType");
        ArrayType2.prototype.toString = function() {
          return "[" + this.elemType + "]";
        };
        ArrayType2.prototype.check = function(value, deep) {
          var _this = this;
          return Array.isArray(value) && value.every(function(elem) {
            return _this.elemType.check(elem, deep);
          });
        };
        return ArrayType2;
      }(BaseType)
    );
    var IdentityType = (
      /** @class */
      function(_super) {
        tslib_1.__extends(IdentityType2, _super);
        function IdentityType2(value) {
          var _this = _super.call(this) || this;
          _this.value = value;
          _this.kind = "IdentityType";
          return _this;
        }
        __name(IdentityType2, "IdentityType");
        IdentityType2.prototype.toString = function() {
          return String(this.value);
        };
        IdentityType2.prototype.check = function(value, deep) {
          var result = value === this.value;
          if (!result && typeof deep === "function") {
            deep(this, value);
          }
          return result;
        };
        return IdentityType2;
      }(BaseType)
    );
    var ObjectType = (
      /** @class */
      function(_super) {
        tslib_1.__extends(ObjectType2, _super);
        function ObjectType2(fields) {
          var _this = _super.call(this) || this;
          _this.fields = fields;
          _this.kind = "ObjectType";
          return _this;
        }
        __name(ObjectType2, "ObjectType");
        ObjectType2.prototype.toString = function() {
          return "{ " + this.fields.join(", ") + " }";
        };
        ObjectType2.prototype.check = function(value, deep) {
          return objToStr.call(value) === objToStr.call({}) && this.fields.every(function(field) {
            return field.type.check(value[field.name], deep);
          });
        };
        return ObjectType2;
      }(BaseType)
    );
    var OrType = (
      /** @class */
      function(_super) {
        tslib_1.__extends(OrType2, _super);
        function OrType2(types13) {
          var _this = _super.call(this) || this;
          _this.types = types13;
          _this.kind = "OrType";
          return _this;
        }
        __name(OrType2, "OrType");
        OrType2.prototype.toString = function() {
          return this.types.join(" | ");
        };
        OrType2.prototype.check = function(value, deep) {
          if (this.types.some(function(type) {
            return type.check(value, !!deep);
          })) {
            return true;
          }
          if (typeof deep === "function") {
            deep(this, value);
          }
          return false;
        };
        return OrType2;
      }(BaseType)
    );
    var PredicateType = (
      /** @class */
      function(_super) {
        tslib_1.__extends(PredicateType2, _super);
        function PredicateType2(name2, predicate) {
          var _this = _super.call(this) || this;
          _this.name = name2;
          _this.predicate = predicate;
          _this.kind = "PredicateType";
          return _this;
        }
        __name(PredicateType2, "PredicateType");
        PredicateType2.prototype.toString = function() {
          return this.name;
        };
        PredicateType2.prototype.check = function(value, deep) {
          var result = this.predicate(value, deep);
          if (!result && typeof deep === "function") {
            deep(this, value);
          }
          return result;
        };
        return PredicateType2;
      }(BaseType)
    );
    var Def = (
      /** @class */
      function() {
        function Def2(type, typeName) {
          this.type = type;
          this.typeName = typeName;
          this.baseNames = [];
          this.ownFields = /* @__PURE__ */ Object.create(null);
          this.allSupertypes = /* @__PURE__ */ Object.create(null);
          this.supertypeList = [];
          this.allFields = /* @__PURE__ */ Object.create(null);
          this.fieldNames = [];
          this.finalized = false;
          this.buildable = false;
          this.buildParams = [];
        }
        __name(Def2, "Def");
        Def2.prototype.isSupertypeOf = function(that) {
          if (that instanceof Def2) {
            if (this.finalized !== true || that.finalized !== true) {
              throw new Error("");
            }
            return hasOwn2.call(that.allSupertypes, this.typeName);
          } else {
            throw new Error(that + " is not a Def");
          }
        };
        Def2.prototype.checkAllFields = function(value, deep) {
          var allFields = this.allFields;
          if (this.finalized !== true) {
            throw new Error("" + this.typeName);
          }
          function checkFieldByName(name2) {
            var field = allFields[name2];
            var type = field.type;
            var child = field.getValue(value);
            return type.check(child, deep);
          }
          __name(checkFieldByName, "checkFieldByName");
          return value !== null && typeof value === "object" && Object.keys(allFields).every(checkFieldByName);
        };
        Def2.prototype.bases = function() {
          var supertypeNames = [];
          for (var _i2 = 0; _i2 < arguments.length; _i2++) {
            supertypeNames[_i2] = arguments[_i2];
          }
          var bases = this.baseNames;
          if (this.finalized) {
            if (supertypeNames.length !== bases.length) {
              throw new Error("");
            }
            for (var i7 = 0; i7 < supertypeNames.length; i7++) {
              if (supertypeNames[i7] !== bases[i7]) {
                throw new Error("");
              }
            }
            return this;
          }
          supertypeNames.forEach(function(baseName) {
            if (bases.indexOf(baseName) < 0) {
              bases.push(baseName);
            }
          });
          return this;
        };
        return Def2;
      }()
    );
    exports.Def = Def;
    var Field = (
      /** @class */
      function() {
        function Field2(name2, type, defaultFn, hidden2) {
          this.name = name2;
          this.type = type;
          this.defaultFn = defaultFn;
          this.hidden = !!hidden2;
        }
        __name(Field2, "Field");
        Field2.prototype.toString = function() {
          return JSON.stringify(this.name) + ": " + this.type;
        };
        Field2.prototype.getValue = function(obj) {
          var value = obj[this.name];
          if (typeof value !== "undefined") {
            return value;
          }
          if (typeof this.defaultFn === "function") {
            value = this.defaultFn.call(obj);
          }
          return value;
        };
        return Field2;
      }()
    );
    function shallowStringify(value) {
      if (Array.isArray(value)) {
        return "[" + value.map(shallowStringify).join(", ") + "]";
      }
      if (value && typeof value === "object") {
        return "{ " + Object.keys(value).map(function(key) {
          return key + ": " + value[key];
        }).join(", ") + " }";
      }
      return JSON.stringify(value);
    }
    __name(shallowStringify, "shallowStringify");
    function typesPlugin(_fork) {
      var Type2 = {
        or: /* @__PURE__ */ __name(function() {
          var types13 = [];
          for (var _i2 = 0; _i2 < arguments.length; _i2++) {
            types13[_i2] = arguments[_i2];
          }
          return new OrType(types13.map(function(type) {
            return Type2.from(type);
          }));
        }, "or"),
        from: /* @__PURE__ */ __name(function(value, name2) {
          if (value instanceof ArrayType || value instanceof IdentityType || value instanceof ObjectType || value instanceof OrType || value instanceof PredicateType) {
            return value;
          }
          if (value instanceof Def) {
            return value.type;
          }
          if (isArray.check(value)) {
            if (value.length !== 1) {
              throw new Error("only one element type is permitted for typed arrays");
            }
            return new ArrayType(Type2.from(value[0]));
          }
          if (isObject5.check(value)) {
            return new ObjectType(Object.keys(value).map(function(name3) {
              return new Field(name3, Type2.from(value[name3], name3));
            }));
          }
          if (typeof value === "function") {
            var bicfIndex = builtInCtorFns.indexOf(value);
            if (bicfIndex >= 0) {
              return builtInCtorTypes[bicfIndex];
            }
            if (typeof name2 !== "string") {
              throw new Error("missing name");
            }
            return new PredicateType(name2, value);
          }
          return new IdentityType(value);
        }, "from"),
        // Define a type whose name is registered in a namespace (the defCache) so
        // that future definitions will return the same type given the same name.
        // In particular, this system allows for circular and forward definitions.
        // The Def object d returned from Type.def may be used to configure the
        // type d.type by calling methods such as d.bases, d.build, and d.field.
        def: /* @__PURE__ */ __name(function(typeName) {
          return hasOwn2.call(defCache, typeName) ? defCache[typeName] : defCache[typeName] = new DefImpl(typeName);
        }, "def"),
        hasDef: /* @__PURE__ */ __name(function(typeName) {
          return hasOwn2.call(defCache, typeName);
        }, "hasDef")
      };
      var builtInCtorFns = [];
      var builtInCtorTypes = [];
      function defBuiltInType(name2, example) {
        var objStr = objToStr.call(example);
        var type = new PredicateType(name2, function(value) {
          return objToStr.call(value) === objStr;
        });
        if (example && typeof example.constructor === "function") {
          builtInCtorFns.push(example.constructor);
          builtInCtorTypes.push(type);
        }
        return type;
      }
      __name(defBuiltInType, "defBuiltInType");
      var isString5 = defBuiltInType("string", "truthy");
      var isFunction5 = defBuiltInType("function", function() {
      });
      var isArray = defBuiltInType("array", []);
      var isObject5 = defBuiltInType("object", {});
      var isRegExp2 = defBuiltInType("RegExp", /./);
      var isDate = defBuiltInType("Date", /* @__PURE__ */ new Date());
      var isNumber = defBuiltInType("number", 3);
      var isBoolean4 = defBuiltInType("boolean", true);
      var isNull = defBuiltInType("null", null);
      var isUndefined = defBuiltInType("undefined", void 0);
      var isBigInt = typeof BigInt === "function" ? defBuiltInType("BigInt", BigInt(1234)) : new PredicateType("BigInt", function() {
        return false;
      });
      var builtInTypes = {
        string: isString5,
        function: isFunction5,
        array: isArray,
        object: isObject5,
        RegExp: isRegExp2,
        Date: isDate,
        number: isNumber,
        boolean: isBoolean4,
        null: isNull,
        undefined: isUndefined,
        BigInt: isBigInt
      };
      var defCache = /* @__PURE__ */ Object.create(null);
      function defFromValue(value) {
        if (value && typeof value === "object") {
          var type = value.type;
          if (typeof type === "string" && hasOwn2.call(defCache, type)) {
            var d8 = defCache[type];
            if (d8.finalized) {
              return d8;
            }
          }
        }
        return null;
      }
      __name(defFromValue, "defFromValue");
      var DefImpl = (
        /** @class */
        function(_super) {
          tslib_1.__extends(DefImpl2, _super);
          function DefImpl2(typeName) {
            var _this = _super.call(this, new PredicateType(typeName, function(value, deep) {
              return _this.check(value, deep);
            }), typeName) || this;
            return _this;
          }
          __name(DefImpl2, "DefImpl");
          DefImpl2.prototype.check = function(value, deep) {
            if (this.finalized !== true) {
              throw new Error("prematurely checking unfinalized type " + this.typeName);
            }
            if (value === null || typeof value !== "object") {
              return false;
            }
            var vDef = defFromValue(value);
            if (!vDef) {
              if (this.typeName === "SourceLocation" || this.typeName === "Position") {
                return this.checkAllFields(value, deep);
              }
              return false;
            }
            if (deep && vDef === this) {
              return this.checkAllFields(value, deep);
            }
            if (!this.isSupertypeOf(vDef)) {
              return false;
            }
            if (!deep) {
              return true;
            }
            return vDef.checkAllFields(value, deep) && this.checkAllFields(value, false);
          };
          DefImpl2.prototype.build = function() {
            var _this = this;
            var buildParams = [];
            for (var _i2 = 0; _i2 < arguments.length; _i2++) {
              buildParams[_i2] = arguments[_i2];
            }
            this.buildParams = buildParams;
            if (this.buildable) {
              return this;
            }
            this.field("type", String, function() {
              return _this.typeName;
            });
            this.buildable = true;
            var addParam = /* @__PURE__ */ __name(function(built, param, arg, isArgAvailable) {
              if (hasOwn2.call(built, param))
                return;
              var all3 = _this.allFields;
              if (!hasOwn2.call(all3, param)) {
                throw new Error("" + param);
              }
              var field = all3[param];
              var type = field.type;
              var value;
              if (isArgAvailable) {
                value = arg;
              } else if (field.defaultFn) {
                value = field.defaultFn.call(built);
              } else {
                var message = "no value or default function given for field " + JSON.stringify(param) + " of " + _this.typeName + "(" + _this.buildParams.map(function(name2) {
                  return all3[name2];
                }).join(", ") + ")";
                throw new Error(message);
              }
              if (!type.check(value)) {
                throw new Error(shallowStringify(value) + " does not match field " + field + " of type " + _this.typeName);
              }
              built[param] = value;
            }, "addParam");
            var builder = /* @__PURE__ */ __name(function() {
              var args = [];
              for (var _i3 = 0; _i3 < arguments.length; _i3++) {
                args[_i3] = arguments[_i3];
              }
              var argc = args.length;
              if (!_this.finalized) {
                throw new Error("attempting to instantiate unfinalized type " + _this.typeName);
              }
              var built = Object.create(nodePrototype);
              _this.buildParams.forEach(function(param, i7) {
                if (i7 < argc) {
                  addParam(built, param, args[i7], true);
                } else {
                  addParam(built, param, null, false);
                }
              });
              Object.keys(_this.allFields).forEach(function(param) {
                addParam(built, param, null, false);
              });
              if (built.type !== _this.typeName) {
                throw new Error("");
              }
              return built;
            }, "builder");
            builder.from = function(obj) {
              if (!_this.finalized) {
                throw new Error("attempting to instantiate unfinalized type " + _this.typeName);
              }
              var built = Object.create(nodePrototype);
              Object.keys(_this.allFields).forEach(function(param) {
                if (hasOwn2.call(obj, param)) {
                  addParam(built, param, obj[param], true);
                } else {
                  addParam(built, param, null, false);
                }
              });
              if (built.type !== _this.typeName) {
                throw new Error("");
              }
              return built;
            };
            Object.defineProperty(builders, getBuilderName(this.typeName), {
              enumerable: true,
              value: builder
            });
            return this;
          };
          DefImpl2.prototype.field = function(name2, type, defaultFn, hidden2) {
            if (this.finalized) {
              console.error("Ignoring attempt to redefine field " + JSON.stringify(name2) + " of finalized type " + JSON.stringify(this.typeName));
              return this;
            }
            this.ownFields[name2] = new Field(name2, Type2.from(type), defaultFn, hidden2);
            return this;
          };
          DefImpl2.prototype.finalize = function() {
            var _this = this;
            if (!this.finalized) {
              var allFields = this.allFields;
              var allSupertypes = this.allSupertypes;
              this.baseNames.forEach(function(name2) {
                var def = defCache[name2];
                if (def instanceof Def) {
                  def.finalize();
                  extend(allFields, def.allFields);
                  extend(allSupertypes, def.allSupertypes);
                } else {
                  var message = "unknown supertype name " + JSON.stringify(name2) + " for subtype " + JSON.stringify(_this.typeName);
                  throw new Error(message);
                }
              });
              extend(allFields, this.ownFields);
              allSupertypes[this.typeName] = this;
              this.fieldNames.length = 0;
              for (var fieldName in allFields) {
                if (hasOwn2.call(allFields, fieldName) && !allFields[fieldName].hidden) {
                  this.fieldNames.push(fieldName);
                }
              }
              Object.defineProperty(namedTypes, this.typeName, {
                enumerable: true,
                value: this.type
              });
              this.finalized = true;
              populateSupertypeList(this.typeName, this.supertypeList);
              if (this.buildable && this.supertypeList.lastIndexOf("Expression") >= 0) {
                wrapExpressionBuilderWithStatement(this.typeName);
              }
            }
          };
          return DefImpl2;
        }(Def)
      );
      function getSupertypeNames(typeName) {
        if (!hasOwn2.call(defCache, typeName)) {
          throw new Error("");
        }
        var d8 = defCache[typeName];
        if (d8.finalized !== true) {
          throw new Error("");
        }
        return d8.supertypeList.slice(1);
      }
      __name(getSupertypeNames, "getSupertypeNames");
      function computeSupertypeLookupTable(candidates) {
        var table = {};
        var typeNames = Object.keys(defCache);
        var typeNameCount = typeNames.length;
        for (var i7 = 0; i7 < typeNameCount; ++i7) {
          var typeName = typeNames[i7];
          var d8 = defCache[typeName];
          if (d8.finalized !== true) {
            throw new Error("" + typeName);
          }
          for (var j7 = 0; j7 < d8.supertypeList.length; ++j7) {
            var superTypeName = d8.supertypeList[j7];
            if (hasOwn2.call(candidates, superTypeName)) {
              table[typeName] = superTypeName;
              break;
            }
          }
        }
        return table;
      }
      __name(computeSupertypeLookupTable, "computeSupertypeLookupTable");
      var builders = /* @__PURE__ */ Object.create(null);
      var nodePrototype = {};
      function defineMethod(name2, func) {
        var old = nodePrototype[name2];
        if (isUndefined.check(func)) {
          delete nodePrototype[name2];
        } else {
          isFunction5.assert(func);
          Object.defineProperty(nodePrototype, name2, {
            enumerable: true,
            configurable: true,
            value: func
          });
        }
        return old;
      }
      __name(defineMethod, "defineMethod");
      function getBuilderName(typeName) {
        return typeName.replace(/^[A-Z]+/, function(upperCasePrefix) {
          var len = upperCasePrefix.length;
          switch (len) {
            case 0:
              return "";
            // If there's only one initial capital letter, just lower-case it.
            case 1:
              return upperCasePrefix.toLowerCase();
            default:
              return upperCasePrefix.slice(0, len - 1).toLowerCase() + upperCasePrefix.charAt(len - 1);
          }
        });
      }
      __name(getBuilderName, "getBuilderName");
      function getStatementBuilderName(typeName) {
        typeName = getBuilderName(typeName);
        return typeName.replace(/(Expression)?$/, "Statement");
      }
      __name(getStatementBuilderName, "getStatementBuilderName");
      var namedTypes = {};
      function getFieldNames(object) {
        var d8 = defFromValue(object);
        if (d8) {
          return d8.fieldNames.slice(0);
        }
        if ("type" in object) {
          throw new Error("did not recognize object of type " + JSON.stringify(object.type));
        }
        return Object.keys(object);
      }
      __name(getFieldNames, "getFieldNames");
      function getFieldValue(object, fieldName) {
        var d8 = defFromValue(object);
        if (d8) {
          var field = d8.allFields[fieldName];
          if (field) {
            return field.getValue(object);
          }
        }
        return object && object[fieldName];
      }
      __name(getFieldValue, "getFieldValue");
      function eachField(object, callback, context2) {
        getFieldNames(object).forEach(function(name2) {
          callback.call(this, name2, getFieldValue(object, name2));
        }, context2);
      }
      __name(eachField, "eachField");
      function someField(object, callback, context2) {
        return getFieldNames(object).some(function(name2) {
          return callback.call(this, name2, getFieldValue(object, name2));
        }, context2);
      }
      __name(someField, "someField");
      function wrapExpressionBuilderWithStatement(typeName) {
        var wrapperName = getStatementBuilderName(typeName);
        if (builders[wrapperName])
          return;
        var wrapped = builders[getBuilderName(typeName)];
        if (!wrapped)
          return;
        var builder = /* @__PURE__ */ __name(function() {
          var args = [];
          for (var _i2 = 0; _i2 < arguments.length; _i2++) {
            args[_i2] = arguments[_i2];
          }
          return builders.expressionStatement(wrapped.apply(builders, args));
        }, "builder");
        builder.from = function() {
          var args = [];
          for (var _i2 = 0; _i2 < arguments.length; _i2++) {
            args[_i2] = arguments[_i2];
          }
          return builders.expressionStatement(wrapped.from.apply(builders, args));
        };
        builders[wrapperName] = builder;
      }
      __name(wrapExpressionBuilderWithStatement, "wrapExpressionBuilderWithStatement");
      function populateSupertypeList(typeName, list) {
        list.length = 0;
        list.push(typeName);
        var lastSeen = /* @__PURE__ */ Object.create(null);
        for (var pos = 0; pos < list.length; ++pos) {
          typeName = list[pos];
          var d8 = defCache[typeName];
          if (d8.finalized !== true) {
            throw new Error("");
          }
          if (hasOwn2.call(lastSeen, typeName)) {
            delete list[lastSeen[typeName]];
          }
          lastSeen[typeName] = pos;
          list.push.apply(list, d8.baseNames);
        }
        for (var to = 0, from = to, len = list.length; from < len; ++from) {
          if (hasOwn2.call(list, from)) {
            list[to++] = list[from];
          }
        }
        list.length = to;
      }
      __name(populateSupertypeList, "populateSupertypeList");
      function extend(into, from) {
        Object.keys(from).forEach(function(name2) {
          into[name2] = from[name2];
        });
        return into;
      }
      __name(extend, "extend");
      function finalize() {
        Object.keys(defCache).forEach(function(name2) {
          defCache[name2].finalize();
        });
      }
      __name(finalize, "finalize");
      return {
        Type: Type2,
        builtInTypes,
        getSupertypeNames,
        computeSupertypeLookupTable,
        builders,
        defineMethod,
        getBuilderName,
        getStatementBuilderName,
        namedTypes,
        getFieldNames,
        getFieldValue,
        eachField,
        someField,
        finalize
      };
    }
    __name(typesPlugin, "typesPlugin");
    exports.default = typesPlugin;
    (0, shared_1.maybeSetModuleExports)(function() {
      return module2;
    });
  }
});

// ../../node_modules/.pnpm/ast-types@0.16.1/node_modules/ast-types/lib/path.js
var require_path = __commonJS({
  "../../node_modules/.pnpm/ast-types@0.16.1/node_modules/ast-types/lib/path.js"(exports, module2) {
    init_import_meta_url();
    Object.defineProperty(exports, "__esModule", { value: true });
    var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
    var shared_1 = require_shared();
    var types_1 = tslib_1.__importDefault(require_types());
    var Op = Object.prototype;
    var hasOwn2 = Op.hasOwnProperty;
    function pathPlugin(fork) {
      var types13 = fork.use(types_1.default);
      var isArray = types13.builtInTypes.array;
      var isNumber = types13.builtInTypes.number;
      var Path = /* @__PURE__ */ __name(function Path2(value, parentPath, name2) {
        if (!(this instanceof Path2)) {
          throw new Error("Path constructor cannot be invoked without 'new'");
        }
        if (parentPath) {
          if (!(parentPath instanceof Path2)) {
            throw new Error("");
          }
        } else {
          parentPath = null;
          name2 = null;
        }
        this.value = value;
        this.parentPath = parentPath;
        this.name = name2;
        this.__childCache = null;
      }, "Path");
      var Pp = Path.prototype;
      function getChildCache(path84) {
        return path84.__childCache || (path84.__childCache = /* @__PURE__ */ Object.create(null));
      }
      __name(getChildCache, "getChildCache");
      function getChildPath(path84, name2) {
        var cache5 = getChildCache(path84);
        var actualChildValue = path84.getValueProperty(name2);
        var childPath = cache5[name2];
        if (!hasOwn2.call(cache5, name2) || // Ensure consistency between cache and reality.
        childPath.value !== actualChildValue) {
          childPath = cache5[name2] = new path84.constructor(actualChildValue, path84, name2);
        }
        return childPath;
      }
      __name(getChildPath, "getChildPath");
      Pp.getValueProperty = /* @__PURE__ */ __name(function getValueProperty(name2) {
        return this.value[name2];
      }, "getValueProperty");
      Pp.get = /* @__PURE__ */ __name(function get2() {
        var names = [];
        for (var _i2 = 0; _i2 < arguments.length; _i2++) {
          names[_i2] = arguments[_i2];
        }
        var path84 = this;
        var count = names.length;
        for (var i7 = 0; i7 < count; ++i7) {
          path84 = getChildPath(path84, names[i7]);
        }
        return path84;
      }, "get");
      Pp.each = /* @__PURE__ */ __name(function each(callback, context2) {
        var childPaths = [];
        var len = this.value.length;
        var i7 = 0;
        for (var i7 = 0; i7 < len; ++i7) {
          if (hasOwn2.call(this.value, i7)) {
            childPaths[i7] = this.get(i7);
          }
        }
        context2 = context2 || this;
        for (i7 = 0; i7 < len; ++i7) {
          if (hasOwn2.call(childPaths, i7)) {
            callback.call(context2, childPaths[i7]);
          }
        }
      }, "each");
      Pp.map = /* @__PURE__ */ __name(function map2(callback, context2) {
        var result = [];
        this.each(function(childPath) {
          result.push(callback.call(this, childPath));
        }, context2);
        return result;
      }, "map");
      Pp.filter = /* @__PURE__ */ __name(function filter2(callback, context2) {
        var result = [];
        this.each(function(childPath) {
          if (callback.call(this, childPath)) {
            result.push(childPath);
          }
        }, context2);
        return result;
      }, "filter");
      function emptyMoves() {
      }
      __name(emptyMoves, "emptyMoves");
      function getMoves(path84, offset, start, end) {
        isArray.assert(path84.value);
        if (offset === 0) {
          return emptyMoves;
        }
        var length = path84.value.length;
        if (length < 1) {
          return emptyMoves;
        }
        var argc = arguments.length;
        if (argc === 2) {
          start = 0;
          end = length;
        } else if (argc === 3) {
          start = Math.max(start, 0);
          end = length;
        } else {
          start = Math.max(start, 0);
          end = Math.min(end, length);
        }
        isNumber.assert(start);
        isNumber.assert(end);
        var moves = /* @__PURE__ */ Object.create(null);
        var cache5 = getChildCache(path84);
        for (var i7 = start; i7 < end; ++i7) {
          if (hasOwn2.call(path84.value, i7)) {
            var childPath = path84.get(i7);
            if (childPath.name !== i7) {
              throw new Error("");
            }
            var newIndex = i7 + offset;
            childPath.name = newIndex;
            moves[newIndex] = childPath;
            delete cache5[i7];
          }
        }
        delete cache5.length;
        return function() {
          for (var newIndex2 in moves) {
            var childPath2 = moves[newIndex2];
            if (childPath2.name !== +newIndex2) {
              throw new Error("");
            }
            cache5[newIndex2] = childPath2;
            path84.value[newIndex2] = childPath2.value;
          }
        };
      }
      __name(getMoves, "getMoves");
      Pp.shift = /* @__PURE__ */ __name(function shift() {
        var move = getMoves(this, -1);
        var result = this.value.shift();
        move();
        return result;
      }, "shift");
      Pp.unshift = /* @__PURE__ */ __name(function unshift() {
        var args = [];
        for (var _i2 = 0; _i2 < arguments.length; _i2++) {
          args[_i2] = arguments[_i2];
        }
        var move = getMoves(this, args.length);
        var result = this.value.unshift.apply(this.value, args);
        move();
        return result;
      }, "unshift");
      Pp.push = /* @__PURE__ */ __name(function push2() {
        var args = [];
        for (var _i2 = 0; _i2 < arguments.length; _i2++) {
          args[_i2] = arguments[_i2];
        }
        isArray.assert(this.value);
        delete getChildCache(this).length;
        return this.value.push.apply(this.value, args);
      }, "push");
      Pp.pop = /* @__PURE__ */ __name(function pop() {
        isArray.assert(this.value);
        var cache5 = getChildCache(this);
        delete cache5[this.value.length - 1];
        delete cache5.length;
        return this.value.pop();
      }, "pop");
      Pp.insertAt = /* @__PURE__ */ __name(function insertAt(index) {
        var argc = arguments.length;
        var move = getMoves(this, argc - 1, index);
        if (move === emptyMoves && argc <= 1) {
          return this;
        }
        index = Math.max(index, 0);
        for (var i7 = 1; i7 < argc; ++i7) {
          this.value[index + i7 - 1] = arguments[i7];
        }
        move();
        return this;
      }, "insertAt");
      Pp.insertBefore = /* @__PURE__ */ __name(function insertBefore() {
        var args = [];
        for (var _i2 = 0; _i2 < arguments.length; _i2++) {
          args[_i2] = arguments[_i2];
        }
        var pp = this.parentPath;
        var argc = args.length;
        var insertAtArgs = [this.name];
        for (var i7 = 0; i7 < argc; ++i7) {
          insertAtArgs.push(args[i7]);
        }
        return pp.insertAt.apply(pp, insertAtArgs);
      }, "insertBefore");
      Pp.insertAfter = /* @__PURE__ */ __name(function insertAfter() {
        var args = [];
        for (var _i2 = 0; _i2 < arguments.length; _i2++) {
          args[_i2] = arguments[_i2];
        }
        var pp = this.parentPath;
        var argc = args.length;
        var insertAtArgs = [this.name + 1];
        for (var i7 = 0; i7 < argc; ++i7) {
          insertAtArgs.push(args[i7]);
        }
        return pp.insertAt.apply(pp, insertAtArgs);
      }, "insertAfter");
      function repairRelationshipWithParent(path84) {
        if (!(path84 instanceof Path)) {
          throw new Error("");
        }
        var pp = path84.parentPath;
        if (!pp) {
          return path84;
        }
        var parentValue = pp.value;
        var parentCache = getChildCache(pp);
        if (parentValue[path84.name] === path84.value) {
          parentCache[path84.name] = path84;
        } else if (isArray.check(parentValue)) {
          var i7 = parentValue.indexOf(path84.value);
          if (i7 >= 0) {
            parentCache[path84.name = i7] = path84;
          }
        } else {
          parentValue[path84.name] = path84.value;
          parentCache[path84.name] = path84;
        }
        if (parentValue[path84.name] !== path84.value) {
          throw new Error("");
        }
        if (path84.parentPath.get(path84.name) !== path84) {
          throw new Error("");
        }
        return path84;
      }
      __name(repairRelationshipWithParent, "repairRelationshipWithParent");
      Pp.replace = /* @__PURE__ */ __name(function replace(replacement) {
        var results = [];
        var parentValue = this.parentPath.value;
        var parentCache = getChildCache(this.parentPath);
        var count = arguments.length;
        repairRelationshipWithParent(this);
        if (isArray.check(parentValue)) {
          var originalLength = parentValue.length;
          var move = getMoves(this.parentPath, count - 1, this.name + 1);
          var spliceArgs = [this.name, 1];
          for (var i7 = 0; i7 < count; ++i7) {
            spliceArgs.push(arguments[i7]);
          }
          var splicedOut = parentValue.splice.apply(parentValue, spliceArgs);
          if (splicedOut[0] !== this.value) {
            throw new Error("");
          }
          if (parentValue.length !== originalLength - 1 + count) {
            throw new Error("");
          }
          move();
          if (count === 0) {
            delete this.value;
            delete parentCache[this.name];
            this.__childCache = null;
          } else {
            if (parentValue[this.name] !== replacement) {
              throw new Error("");
            }
            if (this.value !== replacement) {
              this.value = replacement;
              this.__childCache = null;
            }
            for (i7 = 0; i7 < count; ++i7) {
              results.push(this.parentPath.get(this.name + i7));
            }
            if (results[0] !== this) {
              throw new Error("");
            }
          }
        } else if (count === 1) {
          if (this.value !== replacement) {
            this.__childCache = null;
          }
          this.value = parentValue[this.name] = replacement;
          results.push(this);
        } else if (count === 0) {
          delete parentValue[this.name];
          delete this.value;
          this.__childCache = null;
        } else {
          throw new Error("Could not replace path");
        }
        return results;
      }, "replace");
      return Path;
    }
    __name(pathPlugin, "pathPlugin");
    exports.default = pathPlugin;
    (0, shared_1.maybeSetModuleExports)(function() {
      return module2;
    });
  }
});

// ../../node_modules/.pnpm/ast-types@0.16.1/node_modules/ast-types/lib/scope.js
var require_scope = __commonJS({
  "../../node_modules/.pnpm/ast-types@0.16.1/node_modules/ast-types/lib/scope.js"(exports, module2) {
    init_import_meta_url();
    Object.defineProperty(exports, "__esModule", { value: true });
    var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
    var shared_1 = require_shared();
    var types_1 = tslib_1.__importDefault(require_types());
    var hasOwn2 = Object.prototype.hasOwnProperty;
    function scopePlugin(fork) {
      var types13 = fork.use(types_1.default);
      var Type2 = types13.Type;
      var namedTypes = types13.namedTypes;
      var Node3 = namedTypes.Node;
      var Expression = namedTypes.Expression;
      var isArray = types13.builtInTypes.array;
      var b11 = types13.builders;
      var Scope2 = /* @__PURE__ */ __name(function Scope3(path84, parentScope) {
        if (!(this instanceof Scope3)) {
          throw new Error("Scope constructor cannot be invoked without 'new'");
        }
        if (!TypeParameterScopeType.check(path84.value)) {
          ScopeType.assert(path84.value);
        }
        var depth;
        if (parentScope) {
          if (!(parentScope instanceof Scope3)) {
            throw new Error("");
          }
          depth = parentScope.depth + 1;
        } else {
          parentScope = null;
          depth = 0;
        }
        Object.defineProperties(this, {
          path: { value: path84 },
          node: { value: path84.value },
          isGlobal: { value: !parentScope, enumerable: true },
          depth: { value: depth },
          parent: { value: parentScope },
          bindings: { value: {} },
          types: { value: {} }
        });
      }, "Scope");
      var ScopeType = Type2.or(
        // Program nodes introduce global scopes.
        namedTypes.Program,
        // Function is the supertype of FunctionExpression,
        // FunctionDeclaration, ArrowExpression, etc.
        namedTypes.Function,
        // In case you didn't know, the caught parameter shadows any variable
        // of the same name in an outer scope.
        namedTypes.CatchClause
      );
      var TypeParameterScopeType = Type2.or(namedTypes.Function, namedTypes.ClassDeclaration, namedTypes.ClassExpression, namedTypes.InterfaceDeclaration, namedTypes.TSInterfaceDeclaration, namedTypes.TypeAlias, namedTypes.TSTypeAliasDeclaration);
      var FlowOrTSTypeParameterType = Type2.or(namedTypes.TypeParameter, namedTypes.TSTypeParameter);
      Scope2.isEstablishedBy = function(node2) {
        return ScopeType.check(node2) || TypeParameterScopeType.check(node2);
      };
      var Sp = Scope2.prototype;
      Sp.didScan = false;
      Sp.declares = function(name2) {
        this.scan();
        return hasOwn2.call(this.bindings, name2);
      };
      Sp.declaresType = function(name2) {
        this.scan();
        return hasOwn2.call(this.types, name2);
      };
      Sp.declareTemporary = function(prefix) {
        if (prefix) {
          if (!/^[a-z$_]/i.test(prefix)) {
            throw new Error("");
          }
        } else {
          prefix = "t$";
        }
        prefix += this.depth.toString(36) + "$";
        this.scan();
        var index = 0;
        while (this.declares(prefix + index)) {
          ++index;
        }
        var name2 = prefix + index;
        return this.bindings[name2] = types13.builders.identifier(name2);
      };
      Sp.injectTemporary = function(identifier, init4) {
        identifier || (identifier = this.declareTemporary());
        var bodyPath = this.path.get("body");
        if (namedTypes.BlockStatement.check(bodyPath.value)) {
          bodyPath = bodyPath.get("body");
        }
        bodyPath.unshift(b11.variableDeclaration("var", [b11.variableDeclarator(identifier, init4 || null)]));
        return identifier;
      };
      Sp.scan = function(force) {
        if (force || !this.didScan) {
          for (var name2 in this.bindings) {
            delete this.bindings[name2];
          }
          for (var name2 in this.types) {
            delete this.types[name2];
          }
          scanScope(this.path, this.bindings, this.types);
          this.didScan = true;
        }
      };
      Sp.getBindings = function() {
        this.scan();
        return this.bindings;
      };
      Sp.getTypes = function() {
        this.scan();
        return this.types;
      };
      function scanScope(path84, bindings, scopeTypes) {
        var node2 = path84.value;
        if (TypeParameterScopeType.check(node2)) {
          var params = path84.get("typeParameters", "params");
          if (isArray.check(params.value)) {
            params.each(function(childPath) {
              addTypeParameter(childPath, scopeTypes);
            });
          }
        }
        if (ScopeType.check(node2)) {
          if (namedTypes.CatchClause.check(node2)) {
            addPattern(path84.get("param"), bindings);
          } else {
            recursiveScanScope(path84, bindings, scopeTypes);
          }
        }
      }
      __name(scanScope, "scanScope");
      function recursiveScanScope(path84, bindings, scopeTypes) {
        var node2 = path84.value;
        if (path84.parent && namedTypes.FunctionExpression.check(path84.parent.node) && path84.parent.node.id) {
          addPattern(path84.parent.get("id"), bindings);
        }
        if (!node2) ; else if (isArray.check(node2)) {
          path84.each(function(childPath) {
            recursiveScanChild(childPath, bindings, scopeTypes);
          });
        } else if (namedTypes.Function.check(node2)) {
          path84.get("params").each(function(paramPath) {
            addPattern(paramPath, bindings);
          });
          recursiveScanChild(path84.get("body"), bindings, scopeTypes);
          recursiveScanScope(path84.get("typeParameters"), bindings, scopeTypes);
        } else if (namedTypes.TypeAlias && namedTypes.TypeAlias.check(node2) || namedTypes.InterfaceDeclaration && namedTypes.InterfaceDeclaration.check(node2) || namedTypes.TSTypeAliasDeclaration && namedTypes.TSTypeAliasDeclaration.check(node2) || namedTypes.TSInterfaceDeclaration && namedTypes.TSInterfaceDeclaration.check(node2)) {
          addTypePattern(path84.get("id"), scopeTypes);
        } else if (namedTypes.VariableDeclarator.check(node2)) {
          addPattern(path84.get("id"), bindings);
          recursiveScanChild(path84.get("init"), bindings, scopeTypes);
        } else if (node2.type === "ImportSpecifier" || node2.type === "ImportNamespaceSpecifier" || node2.type === "ImportDefaultSpecifier") {
          addPattern(
            // Esprima used to use the .name field to refer to the local
            // binding identifier for ImportSpecifier nodes, but .id for
            // ImportNamespaceSpecifier and ImportDefaultSpecifier nodes.
            // ESTree/Acorn/ESpree use .local for all three node types.
            path84.get(node2.local ? "local" : node2.name ? "name" : "id"),
            bindings
          );
        } else if (Node3.check(node2) && !Expression.check(node2)) {
          types13.eachField(node2, function(name2, child) {
            var childPath = path84.get(name2);
            if (!pathHasValue(childPath, child)) {
              throw new Error("");
            }
            recursiveScanChild(childPath, bindings, scopeTypes);
          });
        }
      }
      __name(recursiveScanScope, "recursiveScanScope");
      function pathHasValue(path84, value) {
        if (path84.value === value) {
          return true;
        }
        if (Array.isArray(path84.value) && path84.value.length === 0 && Array.isArray(value) && value.length === 0) {
          return true;
        }
        return false;
      }
      __name(pathHasValue, "pathHasValue");
      function recursiveScanChild(path84, bindings, scopeTypes) {
        var node2 = path84.value;
        if (!node2 || Expression.check(node2)) ; else if (namedTypes.FunctionDeclaration.check(node2) && node2.id !== null) {
          addPattern(path84.get("id"), bindings);
        } else if (namedTypes.ClassDeclaration && namedTypes.ClassDeclaration.check(node2) && node2.id !== null) {
          addPattern(path84.get("id"), bindings);
          recursiveScanScope(path84.get("typeParameters"), bindings, scopeTypes);
        } else if (namedTypes.InterfaceDeclaration && namedTypes.InterfaceDeclaration.check(node2) || namedTypes.TSInterfaceDeclaration && namedTypes.TSInterfaceDeclaration.check(node2)) {
          addTypePattern(path84.get("id"), scopeTypes);
        } else if (ScopeType.check(node2)) {
          if (namedTypes.CatchClause.check(node2) && // TODO Broaden this to accept any pattern.
          namedTypes.Identifier.check(node2.param)) {
            var catchParamName = node2.param.name;
            var hadBinding = hasOwn2.call(bindings, catchParamName);
            recursiveScanScope(path84.get("body"), bindings, scopeTypes);
            if (!hadBinding) {
              delete bindings[catchParamName];
            }
          }
        } else {
          recursiveScanScope(path84, bindings, scopeTypes);
        }
      }
      __name(recursiveScanChild, "recursiveScanChild");
      function addPattern(patternPath, bindings) {
        var pattern = patternPath.value;
        namedTypes.Pattern.assert(pattern);
        if (namedTypes.Identifier.check(pattern)) {
          if (hasOwn2.call(bindings, pattern.name)) {
            bindings[pattern.name].push(patternPath);
          } else {
            bindings[pattern.name] = [patternPath];
          }
        } else if (namedTypes.AssignmentPattern && namedTypes.AssignmentPattern.check(pattern)) {
          addPattern(patternPath.get("left"), bindings);
        } else if (namedTypes.ObjectPattern && namedTypes.ObjectPattern.check(pattern)) {
          patternPath.get("properties").each(function(propertyPath) {
            var property = propertyPath.value;
            if (namedTypes.Pattern.check(property)) {
              addPattern(propertyPath, bindings);
            } else if (namedTypes.Property.check(property) || namedTypes.ObjectProperty && namedTypes.ObjectProperty.check(property)) {
              addPattern(propertyPath.get("value"), bindings);
            } else if (namedTypes.SpreadProperty && namedTypes.SpreadProperty.check(property)) {
              addPattern(propertyPath.get("argument"), bindings);
            }
          });
        } else if (namedTypes.ArrayPattern && namedTypes.ArrayPattern.check(pattern)) {
          patternPath.get("elements").each(function(elementPath) {
            var element = elementPath.value;
            if (namedTypes.Pattern.check(element)) {
              addPattern(elementPath, bindings);
            } else if (namedTypes.SpreadElement && namedTypes.SpreadElement.check(element)) {
              addPattern(elementPath.get("argument"), bindings);
            }
          });
        } else if (namedTypes.PropertyPattern && namedTypes.PropertyPattern.check(pattern)) {
          addPattern(patternPath.get("pattern"), bindings);
        } else if (namedTypes.SpreadElementPattern && namedTypes.SpreadElementPattern.check(pattern) || namedTypes.RestElement && namedTypes.RestElement.check(pattern) || namedTypes.SpreadPropertyPattern && namedTypes.SpreadPropertyPattern.check(pattern)) {
          addPattern(patternPath.get("argument"), bindings);
        }
      }
      __name(addPattern, "addPattern");
      function addTypePattern(patternPath, types14) {
        var pattern = patternPath.value;
        namedTypes.Pattern.assert(pattern);
        if (namedTypes.Identifier.check(pattern)) {
          if (hasOwn2.call(types14, pattern.name)) {
            types14[pattern.name].push(patternPath);
          } else {
            types14[pattern.name] = [patternPath];
          }
        }
      }
      __name(addTypePattern, "addTypePattern");
      function addTypeParameter(parameterPath, types14) {
        var parameter = parameterPath.value;
        FlowOrTSTypeParameterType.assert(parameter);
        if (hasOwn2.call(types14, parameter.name)) {
          types14[parameter.name].push(parameterPath);
        } else {
          types14[parameter.name] = [parameterPath];
        }
      }
      __name(addTypeParameter, "addTypeParameter");
      Sp.lookup = function(name2) {
        for (var scope = this; scope; scope = scope.parent)
          if (scope.declares(name2))
            break;
        return scope;
      };
      Sp.lookupType = function(name2) {
        for (var scope = this; scope; scope = scope.parent)
          if (scope.declaresType(name2))
            break;
        return scope;
      };
      Sp.getGlobalScope = function() {
        var scope = this;
        while (!scope.isGlobal)
          scope = scope.parent;
        return scope;
      };
      return Scope2;
    }
    __name(scopePlugin, "scopePlugin");
    exports.default = scopePlugin;
    (0, shared_1.maybeSetModuleExports)(function() {
      return module2;
    });
  }
});

// ../../node_modules/.pnpm/ast-types@0.16.1/node_modules/ast-types/lib/node-path.js
var require_node_path = __commonJS({
  "../../node_modules/.pnpm/ast-types@0.16.1/node_modules/ast-types/lib/node-path.js"(exports, module2) {
    init_import_meta_url();
    Object.defineProperty(exports, "__esModule", { value: true });
    var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
    var types_1 = tslib_1.__importDefault(require_types());
    var path_1 = tslib_1.__importDefault(require_path());
    var scope_1 = tslib_1.__importDefault(require_scope());
    var shared_1 = require_shared();
    function nodePathPlugin(fork) {
      var types13 = fork.use(types_1.default);
      var n9 = types13.namedTypes;
      var b11 = types13.builders;
      var isNumber = types13.builtInTypes.number;
      var isArray = types13.builtInTypes.array;
      var Path = fork.use(path_1.default);
      var Scope2 = fork.use(scope_1.default);
      var NodePath = /* @__PURE__ */ __name(function NodePath2(value, parentPath, name2) {
        if (!(this instanceof NodePath2)) {
          throw new Error("NodePath constructor cannot be invoked without 'new'");
        }
        Path.call(this, value, parentPath, name2);
      }, "NodePath");
      var NPp = NodePath.prototype = Object.create(Path.prototype, {
        constructor: {
          value: NodePath,
          enumerable: false,
          writable: true,
          configurable: true
        }
      });
      Object.defineProperties(NPp, {
        node: {
          get: /* @__PURE__ */ __name(function() {
            Object.defineProperty(this, "node", {
              configurable: true,
              value: this._computeNode()
            });
            return this.node;
          }, "get")
        },
        parent: {
          get: /* @__PURE__ */ __name(function() {
            Object.defineProperty(this, "parent", {
              configurable: true,
              value: this._computeParent()
            });
            return this.parent;
          }, "get")
        },
        scope: {
          get: /* @__PURE__ */ __name(function() {
            Object.defineProperty(this, "scope", {
              configurable: true,
              value: this._computeScope()
            });
            return this.scope;
          }, "get")
        }
      });
      NPp.replace = function() {
        delete this.node;
        delete this.parent;
        delete this.scope;
        return Path.prototype.replace.apply(this, arguments);
      };
      NPp.prune = function() {
        var remainingNodePath = this.parent;
        this.replace();
        return cleanUpNodesAfterPrune(remainingNodePath);
      };
      NPp._computeNode = function() {
        var value = this.value;
        if (n9.Node.check(value)) {
          return value;
        }
        var pp = this.parentPath;
        return pp && pp.node || null;
      };
      NPp._computeParent = function() {
        var value = this.value;
        var pp = this.parentPath;
        if (!n9.Node.check(value)) {
          while (pp && !n9.Node.check(pp.value)) {
            pp = pp.parentPath;
          }
          if (pp) {
            pp = pp.parentPath;
          }
        }
        while (pp && !n9.Node.check(pp.value)) {
          pp = pp.parentPath;
        }
        return pp || null;
      };
      NPp._computeScope = function() {
        var value = this.value;
        var pp = this.parentPath;
        var scope = pp && pp.scope;
        if (n9.Node.check(value) && Scope2.isEstablishedBy(value)) {
          scope = new Scope2(this, scope);
        }
        return scope || null;
      };
      NPp.getValueProperty = function(name2) {
        return types13.getFieldValue(this.value, name2);
      };
      NPp.needsParens = function(assumeExpressionContext) {
        var pp = this.parentPath;
        if (!pp) {
          return false;
        }
        var node2 = this.value;
        if (!n9.Expression.check(node2)) {
          return false;
        }
        if (node2.type === "Identifier") {
          return false;
        }
        while (!n9.Node.check(pp.value)) {
          pp = pp.parentPath;
          if (!pp) {
            return false;
          }
        }
        var parent = pp.value;
        switch (node2.type) {
          case "UnaryExpression":
          case "SpreadElement":
          case "SpreadProperty":
            return parent.type === "MemberExpression" && this.name === "object" && parent.object === node2;
          case "BinaryExpression":
          case "LogicalExpression":
            switch (parent.type) {
              case "CallExpression":
                return this.name === "callee" && parent.callee === node2;
              case "UnaryExpression":
              case "SpreadElement":
              case "SpreadProperty":
                return true;
              case "MemberExpression":
                return this.name === "object" && parent.object === node2;
              case "BinaryExpression":
              case "LogicalExpression": {
                var n_1 = node2;
                var po = parent.operator;
                var pp_1 = PRECEDENCE[po];
                var no = n_1.operator;
                var np = PRECEDENCE[no];
                if (pp_1 > np) {
                  return true;
                }
                if (pp_1 === np && this.name === "right") {
                  if (parent.right !== n_1) {
                    throw new Error("Nodes must be equal");
                  }
                  return true;
                }
              }
              default:
                return false;
            }
          case "SequenceExpression":
            switch (parent.type) {
              case "ForStatement":
                return false;
              case "ExpressionStatement":
                return this.name !== "expression";
              default:
                return true;
            }
          case "YieldExpression":
            switch (parent.type) {
              case "BinaryExpression":
              case "LogicalExpression":
              case "UnaryExpression":
              case "SpreadElement":
              case "SpreadProperty":
              case "CallExpression":
              case "MemberExpression":
              case "NewExpression":
              case "ConditionalExpression":
              case "YieldExpression":
                return true;
              default:
                return false;
            }
          case "Literal":
            return parent.type === "MemberExpression" && isNumber.check(node2.value) && this.name === "object" && parent.object === node2;
          case "AssignmentExpression":
          case "ConditionalExpression":
            switch (parent.type) {
              case "UnaryExpression":
              case "SpreadElement":
              case "SpreadProperty":
              case "BinaryExpression":
              case "LogicalExpression":
                return true;
              case "CallExpression":
                return this.name === "callee" && parent.callee === node2;
              case "ConditionalExpression":
                return this.name === "test" && parent.test === node2;
              case "MemberExpression":
                return this.name === "object" && parent.object === node2;
              default:
                return false;
            }
          default:
            if (parent.type === "NewExpression" && this.name === "callee" && parent.callee === node2) {
              return containsCallExpression(node2);
            }
        }
        if (assumeExpressionContext !== true && !this.canBeFirstInStatement() && this.firstInStatement())
          return true;
        return false;
      };
      function isBinary(node2) {
        return n9.BinaryExpression.check(node2) || n9.LogicalExpression.check(node2);
      }
      __name(isBinary, "isBinary");
      function isUnaryLike(node2) {
        return n9.UnaryExpression.check(node2) || n9.SpreadElement && n9.SpreadElement.check(node2) || n9.SpreadProperty && n9.SpreadProperty.check(node2);
      }
      __name(isUnaryLike, "isUnaryLike");
      var PRECEDENCE = {};
      [
        ["||"],
        ["&&"],
        ["|"],
        ["^"],
        ["&"],
        ["==", "===", "!=", "!=="],
        ["<", ">", "<=", ">=", "in", "instanceof"],
        [">>", "<<", ">>>"],
        ["+", "-"],
        ["*", "/", "%"]
      ].forEach(function(tier, i7) {
        tier.forEach(function(op) {
          PRECEDENCE[op] = i7;
        });
      });
      function containsCallExpression(node2) {
        if (n9.CallExpression.check(node2)) {
          return true;
        }
        if (isArray.check(node2)) {
          return node2.some(containsCallExpression);
        }
        if (n9.Node.check(node2)) {
          return types13.someField(node2, function(_name, child) {
            return containsCallExpression(child);
          });
        }
        return false;
      }
      __name(containsCallExpression, "containsCallExpression");
      NPp.canBeFirstInStatement = function() {
        var node2 = this.node;
        return !n9.FunctionExpression.check(node2) && !n9.ObjectExpression.check(node2);
      };
      NPp.firstInStatement = function() {
        return firstInStatement(this);
      };
      function firstInStatement(path84) {
        for (var node2, parent; path84.parent; path84 = path84.parent) {
          node2 = path84.node;
          parent = path84.parent.node;
          if (n9.BlockStatement.check(parent) && path84.parent.name === "body" && path84.name === 0) {
            if (parent.body[0] !== node2) {
              throw new Error("Nodes must be equal");
            }
            return true;
          }
          if (n9.ExpressionStatement.check(parent) && path84.name === "expression") {
            if (parent.expression !== node2) {
              throw new Error("Nodes must be equal");
            }
            return true;
          }
          if (n9.SequenceExpression.check(parent) && path84.parent.name === "expressions" && path84.name === 0) {
            if (parent.expressions[0] !== node2) {
              throw new Error("Nodes must be equal");
            }
            continue;
          }
          if (n9.CallExpression.check(parent) && path84.name === "callee") {
            if (parent.callee !== node2) {
              throw new Error("Nodes must be equal");
            }
            continue;
          }
          if (n9.MemberExpression.check(parent) && path84.name === "object") {
            if (parent.object !== node2) {
              throw new Error("Nodes must be equal");
            }
            continue;
          }
          if (n9.ConditionalExpression.check(parent) && path84.name === "test") {
            if (parent.test !== node2) {
              throw new Error("Nodes must be equal");
            }
            continue;
          }
          if (isBinary(parent) && path84.name === "left") {
            if (parent.left !== node2) {
              throw new Error("Nodes must be equal");
            }
            continue;
          }
          if (n9.UnaryExpression.check(parent) && !parent.prefix && path84.name === "argument") {
            if (parent.argument !== node2) {
              throw new Error("Nodes must be equal");
            }
            continue;
          }
          return false;
        }
        return true;
      }
      __name(firstInStatement, "firstInStatement");
      function cleanUpNodesAfterPrune(remainingNodePath) {
        if (n9.VariableDeclaration.check(remainingNodePath.node)) {
          var declarations = remainingNodePath.get("declarations").value;
          if (!declarations || declarations.length === 0) {
            return remainingNodePath.prune();
          }
        } else if (n9.ExpressionStatement.check(remainingNodePath.node)) {
          if (!remainingNodePath.get("expression").value) {
            return remainingNodePath.prune();
          }
        } else if (n9.IfStatement.check(remainingNodePath.node)) {
          cleanUpIfStatementAfterPrune(remainingNodePath);
        }
        return remainingNodePath;
      }
      __name(cleanUpNodesAfterPrune, "cleanUpNodesAfterPrune");
      function cleanUpIfStatementAfterPrune(ifStatement) {
        var testExpression = ifStatement.get("test").value;
        var alternate = ifStatement.get("alternate").value;
        var consequent = ifStatement.get("consequent").value;
        if (!consequent && !alternate) {
          var testExpressionStatement = b11.expressionStatement(testExpression);
          ifStatement.replace(testExpressionStatement);
        } else if (!consequent && alternate) {
          var negatedTestExpression = b11.unaryExpression("!", testExpression, true);
          if (n9.UnaryExpression.check(testExpression) && testExpression.operator === "!") {
            negatedTestExpression = testExpression.argument;
          }
          ifStatement.get("test").replace(negatedTestExpression);
          ifStatement.get("consequent").replace(alternate);
          ifStatement.get("alternate").replace();
        }
      }
      __name(cleanUpIfStatementAfterPrune, "cleanUpIfStatementAfterPrune");
      return NodePath;
    }
    __name(nodePathPlugin, "nodePathPlugin");
    exports.default = nodePathPlugin;
    (0, shared_1.maybeSetModuleExports)(function() {
      return module2;
    });
  }
});

// ../../node_modules/.pnpm/ast-types@0.16.1/node_modules/ast-types/lib/path-visitor.js
var require_path_visitor = __commonJS({
  "../../node_modules/.pnpm/ast-types@0.16.1/node_modules/ast-types/lib/path-visitor.js"(exports, module2) {
    init_import_meta_url();
    Object.defineProperty(exports, "__esModule", { value: true });
    var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
    var types_1 = tslib_1.__importDefault(require_types());
    var node_path_1 = tslib_1.__importDefault(require_node_path());
    var shared_1 = require_shared();
    var hasOwn2 = Object.prototype.hasOwnProperty;
    function pathVisitorPlugin(fork) {
      var types13 = fork.use(types_1.default);
      var NodePath = fork.use(node_path_1.default);
      var isArray = types13.builtInTypes.array;
      var isObject5 = types13.builtInTypes.object;
      var isFunction5 = types13.builtInTypes.function;
      var undefined2;
      var PathVisitor = /* @__PURE__ */ __name(function PathVisitor2() {
        if (!(this instanceof PathVisitor2)) {
          throw new Error("PathVisitor constructor cannot be invoked without 'new'");
        }
        this._reusableContextStack = [];
        this._methodNameTable = computeMethodNameTable(this);
        this._shouldVisitComments = hasOwn2.call(this._methodNameTable, "Block") || hasOwn2.call(this._methodNameTable, "Line");
        this.Context = makeContextConstructor(this);
        this._visiting = false;
        this._changeReported = false;
      }, "PathVisitor");
      function computeMethodNameTable(visitor) {
        var typeNames = /* @__PURE__ */ Object.create(null);
        for (var methodName in visitor) {
          if (/^visit[A-Z]/.test(methodName)) {
            typeNames[methodName.slice("visit".length)] = true;
          }
        }
        var supertypeTable = types13.computeSupertypeLookupTable(typeNames);
        var methodNameTable = /* @__PURE__ */ Object.create(null);
        var typeNameKeys = Object.keys(supertypeTable);
        var typeNameCount = typeNameKeys.length;
        for (var i7 = 0; i7 < typeNameCount; ++i7) {
          var typeName = typeNameKeys[i7];
          methodName = "visit" + supertypeTable[typeName];
          if (isFunction5.check(visitor[methodName])) {
            methodNameTable[typeName] = methodName;
          }
        }
        return methodNameTable;
      }
      __name(computeMethodNameTable, "computeMethodNameTable");
      PathVisitor.fromMethodsObject = /* @__PURE__ */ __name(function fromMethodsObject(methods) {
        if (methods instanceof PathVisitor) {
          return methods;
        }
        if (!isObject5.check(methods)) {
          return new PathVisitor();
        }
        var Visitor = /* @__PURE__ */ __name(function Visitor2() {
          if (!(this instanceof Visitor2)) {
            throw new Error("Visitor constructor cannot be invoked without 'new'");
          }
          PathVisitor.call(this);
        }, "Visitor");
        var Vp = Visitor.prototype = Object.create(PVp);
        Vp.constructor = Visitor;
        extend(Vp, methods);
        extend(Visitor, PathVisitor);
        isFunction5.assert(Visitor.fromMethodsObject);
        isFunction5.assert(Visitor.visit);
        return new Visitor();
      }, "fromMethodsObject");
      function extend(target, source) {
        for (var property in source) {
          if (hasOwn2.call(source, property)) {
            target[property] = source[property];
          }
        }
        return target;
      }
      __name(extend, "extend");
      PathVisitor.visit = /* @__PURE__ */ __name(function visit5(node2, methods) {
        return PathVisitor.fromMethodsObject(methods).visit(node2);
      }, "visit");
      var PVp = PathVisitor.prototype;
      PVp.visit = function() {
        if (this._visiting) {
          throw new Error("Recursively calling visitor.visit(path) resets visitor state. Try this.visit(path) or this.traverse(path) instead.");
        }
        this._visiting = true;
        this._changeReported = false;
        this._abortRequested = false;
        var argc = arguments.length;
        var args = new Array(argc);
        for (var i7 = 0; i7 < argc; ++i7) {
          args[i7] = arguments[i7];
        }
        if (!(args[0] instanceof NodePath)) {
          args[0] = new NodePath({ root: args[0] }).get("root");
        }
        this.reset.apply(this, args);
        var didNotThrow;
        try {
          var root = this.visitWithoutReset(args[0]);
          didNotThrow = true;
        } finally {
          this._visiting = false;
          if (!didNotThrow && this._abortRequested) {
            return args[0].value;
          }
        }
        return root;
      };
      PVp.AbortRequest = /* @__PURE__ */ __name(function AbortRequest() {
      }, "AbortRequest");
      PVp.abort = function() {
        var visitor = this;
        visitor._abortRequested = true;
        var request4 = new visitor.AbortRequest();
        request4.cancel = function() {
          visitor._abortRequested = false;
        };
        throw request4;
      };
      PVp.reset = function(_path) {
      };
      PVp.visitWithoutReset = function(path84) {
        if (this instanceof this.Context) {
          return this.visitor.visitWithoutReset(path84);
        }
        if (!(path84 instanceof NodePath)) {
          throw new Error("");
        }
        var value = path84.value;
        var methodName = value && typeof value === "object" && typeof value.type === "string" && this._methodNameTable[value.type];
        if (methodName) {
          var context2 = this.acquireContext(path84);
          try {
            return context2.invokeVisitorMethod(methodName);
          } finally {
            this.releaseContext(context2);
          }
        } else {
          return visitChildren(path84, this);
        }
      };
      function visitChildren(path84, visitor) {
        if (!(path84 instanceof NodePath)) {
          throw new Error("");
        }
        if (!(visitor instanceof PathVisitor)) {
          throw new Error("");
        }
        var value = path84.value;
        if (isArray.check(value)) {
          path84.each(visitor.visitWithoutReset, visitor);
        } else if (!isObject5.check(value)) ; else {
          var childNames = types13.getFieldNames(value);
          if (visitor._shouldVisitComments && value.comments && childNames.indexOf("comments") < 0) {
            childNames.push("comments");
          }
          var childCount = childNames.length;
          var childPaths = [];
          for (var i7 = 0; i7 < childCount; ++i7) {
            var childName = childNames[i7];
            if (!hasOwn2.call(value, childName)) {
              value[childName] = types13.getFieldValue(value, childName);
            }
            childPaths.push(path84.get(childName));
          }
          for (var i7 = 0; i7 < childCount; ++i7) {
            visitor.visitWithoutReset(childPaths[i7]);
          }
        }
        return path84.value;
      }
      __name(visitChildren, "visitChildren");
      PVp.acquireContext = function(path84) {
        if (this._reusableContextStack.length === 0) {
          return new this.Context(path84);
        }
        return this._reusableContextStack.pop().reset(path84);
      };
      PVp.releaseContext = function(context2) {
        if (!(context2 instanceof this.Context)) {
          throw new Error("");
        }
        this._reusableContextStack.push(context2);
        context2.currentPath = null;
      };
      PVp.reportChanged = function() {
        this._changeReported = true;
      };
      PVp.wasChangeReported = function() {
        return this._changeReported;
      };
      function makeContextConstructor(visitor) {
        function Context2(path84) {
          if (!(this instanceof Context2)) {
            throw new Error("");
          }
          if (!(this instanceof PathVisitor)) {
            throw new Error("");
          }
          if (!(path84 instanceof NodePath)) {
            throw new Error("");
          }
          Object.defineProperty(this, "visitor", {
            value: visitor,
            writable: false,
            enumerable: true,
            configurable: false
          });
          this.currentPath = path84;
          this.needToCallTraverse = true;
          Object.seal(this);
        }
        __name(Context2, "Context");
        if (!(visitor instanceof PathVisitor)) {
          throw new Error("");
        }
        var Cp = Context2.prototype = Object.create(visitor);
        Cp.constructor = Context2;
        extend(Cp, sharedContextProtoMethods);
        return Context2;
      }
      __name(makeContextConstructor, "makeContextConstructor");
      var sharedContextProtoMethods = /* @__PURE__ */ Object.create(null);
      sharedContextProtoMethods.reset = /* @__PURE__ */ __name(function reset(path84) {
        if (!(this instanceof this.Context)) {
          throw new Error("");
        }
        if (!(path84 instanceof NodePath)) {
          throw new Error("");
        }
        this.currentPath = path84;
        this.needToCallTraverse = true;
        return this;
      }, "reset");
      sharedContextProtoMethods.invokeVisitorMethod = /* @__PURE__ */ __name(function invokeVisitorMethod(methodName) {
        if (!(this instanceof this.Context)) {
          throw new Error("");
        }
        if (!(this.currentPath instanceof NodePath)) {
          throw new Error("");
        }
        var result = this.visitor[methodName].call(this, this.currentPath);
        if (result === false) {
          this.needToCallTraverse = false;
        } else if (result !== undefined2) {
          this.currentPath = this.currentPath.replace(result)[0];
          if (this.needToCallTraverse) {
            this.traverse(this.currentPath);
          }
        }
        if (this.needToCallTraverse !== false) {
          throw new Error("Must either call this.traverse or return false in " + methodName);
        }
        var path84 = this.currentPath;
        return path84 && path84.value;
      }, "invokeVisitorMethod");
      sharedContextProtoMethods.traverse = /* @__PURE__ */ __name(function traverse(path84, newVisitor) {
        if (!(this instanceof this.Context)) {
          throw new Error("");
        }
        if (!(path84 instanceof NodePath)) {
          throw new Error("");
        }
        if (!(this.currentPath instanceof NodePath)) {
          throw new Error("");
        }
        this.needToCallTraverse = false;
        return visitChildren(path84, PathVisitor.fromMethodsObject(newVisitor || this.visitor));
      }, "traverse");
      sharedContextProtoMethods.visit = /* @__PURE__ */ __name(function visit5(path84, newVisitor) {
        if (!(this instanceof this.Context)) {
          throw new Error("");
        }
        if (!(path84 instanceof NodePath)) {
          throw new Error("");
        }
        if (!(this.currentPath instanceof NodePath)) {
          throw new Error("");
        }
        this.needToCallTraverse = false;
        return PathVisitor.fromMethodsObject(newVisitor || this.visitor).visitWithoutReset(path84);
      }, "visit");
      sharedContextProtoMethods.reportChanged = /* @__PURE__ */ __name(function reportChanged() {
        this.visitor.reportChanged();
      }, "reportChanged");
      sharedContextProtoMethods.abort = /* @__PURE__ */ __name(function abort() {
        this.needToCallTraverse = false;
        this.visitor.abort();
      }, "abort");
      return PathVisitor;
    }
    __name(pathVisitorPlugin, "pathVisitorPlugin");
    exports.default = pathVisitorPlugin;
    (0, shared_1.maybeSetModuleExports)(function() {
      return module2;
    });
  }
});

// ../../node_modules/.pnpm/ast-types@0.16.1/node_modules/ast-types/lib/equiv.js
var require_equiv = __commonJS({
  "../../node_modules/.pnpm/ast-types@0.16.1/node_modules/ast-types/lib/equiv.js"(exports, module2) {
    init_import_meta_url();
    Object.defineProperty(exports, "__esModule", { value: true });
    var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
    var shared_1 = require_shared();
    var types_1 = tslib_1.__importDefault(require_types());
    function default_1(fork) {
      var types13 = fork.use(types_1.default);
      var getFieldNames = types13.getFieldNames;
      var getFieldValue = types13.getFieldValue;
      var isArray = types13.builtInTypes.array;
      var isObject5 = types13.builtInTypes.object;
      var isDate = types13.builtInTypes.Date;
      var isRegExp2 = types13.builtInTypes.RegExp;
      var hasOwn2 = Object.prototype.hasOwnProperty;
      function astNodesAreEquivalent(a7, b11, problemPath) {
        if (isArray.check(problemPath)) {
          problemPath.length = 0;
        } else {
          problemPath = null;
        }
        return areEquivalent(a7, b11, problemPath);
      }
      __name(astNodesAreEquivalent, "astNodesAreEquivalent");
      astNodesAreEquivalent.assert = function(a7, b11) {
        var problemPath = [];
        if (!astNodesAreEquivalent(a7, b11, problemPath)) {
          if (problemPath.length === 0) {
            if (a7 !== b11) {
              throw new Error("Nodes must be equal");
            }
          } else {
            throw new Error("Nodes differ in the following path: " + problemPath.map(subscriptForProperty).join(""));
          }
        }
      };
      function subscriptForProperty(property) {
        if (/[_$a-z][_$a-z0-9]*/i.test(property)) {
          return "." + property;
        }
        return "[" + JSON.stringify(property) + "]";
      }
      __name(subscriptForProperty, "subscriptForProperty");
      function areEquivalent(a7, b11, problemPath) {
        if (a7 === b11) {
          return true;
        }
        if (isArray.check(a7)) {
          return arraysAreEquivalent(a7, b11, problemPath);
        }
        if (isObject5.check(a7)) {
          return objectsAreEquivalent(a7, b11, problemPath);
        }
        if (isDate.check(a7)) {
          return isDate.check(b11) && +a7 === +b11;
        }
        if (isRegExp2.check(a7)) {
          return isRegExp2.check(b11) && (a7.source === b11.source && a7.global === b11.global && a7.multiline === b11.multiline && a7.ignoreCase === b11.ignoreCase);
        }
        return a7 == b11;
      }
      __name(areEquivalent, "areEquivalent");
      function arraysAreEquivalent(a7, b11, problemPath) {
        isArray.assert(a7);
        var aLength = a7.length;
        if (!isArray.check(b11) || b11.length !== aLength) {
          if (problemPath) {
            problemPath.push("length");
          }
          return false;
        }
        for (var i7 = 0; i7 < aLength; ++i7) {
          if (problemPath) {
            problemPath.push(i7);
          }
          if (i7 in a7 !== i7 in b11) {
            return false;
          }
          if (!areEquivalent(a7[i7], b11[i7], problemPath)) {
            return false;
          }
          if (problemPath) {
            var problemPathTail = problemPath.pop();
            if (problemPathTail !== i7) {
              throw new Error("" + problemPathTail);
            }
          }
        }
        return true;
      }
      __name(arraysAreEquivalent, "arraysAreEquivalent");
      function objectsAreEquivalent(a7, b11, problemPath) {
        isObject5.assert(a7);
        if (!isObject5.check(b11)) {
          return false;
        }
        if (a7.type !== b11.type) {
          if (problemPath) {
            problemPath.push("type");
          }
          return false;
        }
        var aNames = getFieldNames(a7);
        var aNameCount = aNames.length;
        var bNames = getFieldNames(b11);
        var bNameCount = bNames.length;
        if (aNameCount === bNameCount) {
          for (var i7 = 0; i7 < aNameCount; ++i7) {
            var name2 = aNames[i7];
            var aChild = getFieldValue(a7, name2);
            var bChild = getFieldValue(b11, name2);
            if (problemPath) {
              problemPath.push(name2);
            }
            if (!areEquivalent(aChild, bChild, problemPath)) {
              return false;
            }
            if (problemPath) {
              var problemPathTail = problemPath.pop();
              if (problemPathTail !== name2) {
                throw new Error("" + problemPathTail);
              }
            }
          }
          return true;
        }
        if (!problemPath) {
          return false;
        }
        var seenNames = /* @__PURE__ */ Object.create(null);
        for (i7 = 0; i7 < aNameCount; ++i7) {
          seenNames[aNames[i7]] = true;
        }
        for (i7 = 0; i7 < bNameCount; ++i7) {
          name2 = bNames[i7];
          if (!hasOwn2.call(seenNames, name2)) {
            problemPath.push(name2);
            return false;
          }
          delete seenNames[name2];
        }
        for (name2 in seenNames) {
          problemPath.push(name2);
          break;
        }
        return false;
      }
      __name(objectsAreEquivalent, "objectsAreEquivalent");
      return astNodesAreEquivalent;
    }
    __name(default_1, "default_1");
    exports.default = default_1;
    (0, shared_1.maybeSetModuleExports)(function() {
      return module2;
    });
  }
});

// ../../node_modules/.pnpm/ast-types@0.16.1/node_modules/ast-types/lib/fork.js
var require_fork = __commonJS({
  "../../node_modules/.pnpm/ast-types@0.16.1/node_modules/ast-types/lib/fork.js"(exports, module2) {
    init_import_meta_url();
    Object.defineProperty(exports, "__esModule", { value: true });
    var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
    var types_1 = tslib_1.__importDefault(require_types());
    var path_visitor_1 = tslib_1.__importDefault(require_path_visitor());
    var equiv_1 = tslib_1.__importDefault(require_equiv());
    var path_1 = tslib_1.__importDefault(require_path());
    var node_path_1 = tslib_1.__importDefault(require_node_path());
    var shared_1 = require_shared();
    function default_1(plugins) {
      var fork = createFork();
      var types13 = fork.use(types_1.default);
      plugins.forEach(fork.use);
      types13.finalize();
      var PathVisitor = fork.use(path_visitor_1.default);
      return {
        Type: types13.Type,
        builtInTypes: types13.builtInTypes,
        namedTypes: types13.namedTypes,
        builders: types13.builders,
        defineMethod: types13.defineMethod,
        getFieldNames: types13.getFieldNames,
        getFieldValue: types13.getFieldValue,
        eachField: types13.eachField,
        someField: types13.someField,
        getSupertypeNames: types13.getSupertypeNames,
        getBuilderName: types13.getBuilderName,
        astNodesAreEquivalent: fork.use(equiv_1.default),
        finalize: types13.finalize,
        Path: fork.use(path_1.default),
        NodePath: fork.use(node_path_1.default),
        PathVisitor,
        use: fork.use,
        visit: PathVisitor.visit
      };
    }
    __name(default_1, "default_1");
    exports.default = default_1;
    function createFork() {
      var used = [];
      var usedResult = [];
      function use(plugin) {
        var idx = used.indexOf(plugin);
        if (idx === -1) {
          idx = used.length;
          used.push(plugin);
          usedResult[idx] = plugin(fork);
        }
        return usedResult[idx];
      }
      __name(use, "use");
      var fork = { use };
      return fork;
    }
    __name(createFork, "createFork");
    (0, shared_1.maybeSetModuleExports)(function() {
      return module2;
    });
  }
});

// ../../node_modules/.pnpm/ast-types@0.16.1/node_modules/ast-types/lib/def/operators/core.js
var require_core4 = __commonJS({
  "../../node_modules/.pnpm/ast-types@0.16.1/node_modules/ast-types/lib/def/operators/core.js"(exports, module2) {
    init_import_meta_url();
    Object.defineProperty(exports, "__esModule", { value: true });
    var shared_1 = require_shared();
    function default_1() {
      return {
        BinaryOperators: [
          "==",
          "!=",
          "===",
          "!==",
          "<",
          "<=",
          ">",
          ">=",
          "<<",
          ">>",
          ">>>",
          "+",
          "-",
          "*",
          "/",
          "%",
          "&",
          "|",
          "^",
          "in",
          "instanceof"
        ],
        AssignmentOperators: [
          "=",
          "+=",
          "-=",
          "*=",
          "/=",
          "%=",
          "<<=",
          ">>=",
          ">>>=",
          "|=",
          "^=",
          "&="
        ],
        LogicalOperators: [
          "||",
          "&&"
        ]
      };
    }
    __name(default_1, "default_1");
    exports.default = default_1;
    (0, shared_1.maybeSetModuleExports)(function() {
      return module2;
    });
  }
});

// ../../node_modules/.pnpm/ast-types@0.16.1/node_modules/ast-types/lib/def/operators/es2016.js
var require_es2016 = __commonJS({
  "../../node_modules/.pnpm/ast-types@0.16.1/node_modules/ast-types/lib/def/operators/es2016.js"(exports, module2) {
    init_import_meta_url();
    Object.defineProperty(exports, "__esModule", { value: true });
    var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
    var shared_1 = require_shared();
    var core_1 = tslib_1.__importDefault(require_core4());
    function default_1(fork) {
      var result = fork.use(core_1.default);
      if (result.BinaryOperators.indexOf("**") < 0) {
        result.BinaryOperators.push("**");
      }
      if (result.AssignmentOperators.indexOf("**=") < 0) {
        result.AssignmentOperators.push("**=");
      }
      return result;
    }
    __name(default_1, "default_1");
    exports.default = default_1;
    (0, shared_1.maybeSetModuleExports)(function() {
      return module2;
    });
  }
});

// ../../node_modules/.pnpm/ast-types@0.16.1/node_modules/ast-types/lib/def/operators/es2020.js
var require_es2020 = __commonJS({
  "../../node_modules/.pnpm/ast-types@0.16.1/node_modules/ast-types/lib/def/operators/es2020.js"(exports, module2) {
    init_import_meta_url();
    Object.defineProperty(exports, "__esModule", { value: true });
    var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
    var shared_1 = require_shared();
    var es2016_1 = tslib_1.__importDefault(require_es2016());
    function default_1(fork) {
      var result = fork.use(es2016_1.default);
      if (result.LogicalOperators.indexOf("??") < 0) {
        result.LogicalOperators.push("??");
      }
      return result;
    }
    __name(default_1, "default_1");
    exports.default = default_1;
    (0, shared_1.maybeSetModuleExports)(function() {
      return module2;
    });
  }
});

// ../../node_modules/.pnpm/ast-types@0.16.1/node_modules/ast-types/lib/def/operators/es2021.js
var require_es2021 = __commonJS({
  "../../node_modules/.pnpm/ast-types@0.16.1/node_modules/ast-types/lib/def/operators/es2021.js"(exports, module2) {
    init_import_meta_url();
    Object.defineProperty(exports, "__esModule", { value: true });
    var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
    var shared_1 = require_shared();
    var es2020_1 = tslib_1.__importDefault(require_es2020());
    function default_1(fork) {
      var result = fork.use(es2020_1.default);
      result.LogicalOperators.forEach(function(op) {
        var assignOp = op + "=";
        if (result.AssignmentOperators.indexOf(assignOp) < 0) {
          result.AssignmentOperators.push(assignOp);
        }
      });
      return result;
    }
    __name(default_1, "default_1");
    exports.default = default_1;
    (0, shared_1.maybeSetModuleExports)(function() {
      return module2;
    });
  }
});

// ../../node_modules/.pnpm/ast-types@0.16.1/node_modules/ast-types/lib/def/core.js
var require_core5 = __commonJS({
  "../../node_modules/.pnpm/ast-types@0.16.1/node_modules/ast-types/lib/def/core.js"(exports, module2) {
    init_import_meta_url();
    Object.defineProperty(exports, "__esModule", { value: true });
    var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
    var core_1 = tslib_1.__importDefault(require_core4());
    var types_1 = tslib_1.__importDefault(require_types());
    var shared_1 = tslib_1.__importStar(require_shared());
    function default_1(fork) {
      var types13 = fork.use(types_1.default);
      var Type2 = types13.Type;
      var def = Type2.def;
      var or2 = Type2.or;
      var shared = fork.use(shared_1.default);
      var defaults3 = shared.defaults;
      var geq = shared.geq;
      var _a5 = fork.use(core_1.default), BinaryOperators = _a5.BinaryOperators, AssignmentOperators = _a5.AssignmentOperators, LogicalOperators = _a5.LogicalOperators;
      def("Printable").field("loc", or2(def("SourceLocation"), null), defaults3["null"], true);
      def("Node").bases("Printable").field("type", String).field("comments", or2([def("Comment")], null), defaults3["null"], true);
      def("SourceLocation").field("start", def("Position")).field("end", def("Position")).field("source", or2(String, null), defaults3["null"]);
      def("Position").field("line", geq(1)).field("column", geq(0));
      def("File").bases("Node").build("program", "name").field("program", def("Program")).field("name", or2(String, null), defaults3["null"]);
      def("Program").bases("Node").build("body").field("body", [def("Statement")]);
      def("Function").bases("Node").field("id", or2(def("Identifier"), null), defaults3["null"]).field("params", [def("Pattern")]).field("body", def("BlockStatement")).field("generator", Boolean, defaults3["false"]).field("async", Boolean, defaults3["false"]);
      def("Statement").bases("Node");
      def("EmptyStatement").bases("Statement").build();
      def("BlockStatement").bases("Statement").build("body").field("body", [def("Statement")]);
      def("ExpressionStatement").bases("Statement").build("expression").field("expression", def("Expression"));
      def("IfStatement").bases("Statement").build("test", "consequent", "alternate").field("test", def("Expression")).field("consequent", def("Statement")).field("alternate", or2(def("Statement"), null), defaults3["null"]);
      def("LabeledStatement").bases("Statement").build("label", "body").field("label", def("Identifier")).field("body", def("Statement"));
      def("BreakStatement").bases("Statement").build("label").field("label", or2(def("Identifier"), null), defaults3["null"]);
      def("ContinueStatement").bases("Statement").build("label").field("label", or2(def("Identifier"), null), defaults3["null"]);
      def("WithStatement").bases("Statement").build("object", "body").field("object", def("Expression")).field("body", def("Statement"));
      def("SwitchStatement").bases("Statement").build("discriminant", "cases", "lexical").field("discriminant", def("Expression")).field("cases", [def("SwitchCase")]).field("lexical", Boolean, defaults3["false"]);
      def("ReturnStatement").bases("Statement").build("argument").field("argument", or2(def("Expression"), null));
      def("ThrowStatement").bases("Statement").build("argument").field("argument", def("Expression"));
      def("TryStatement").bases("Statement").build("block", "handler", "finalizer").field("block", def("BlockStatement")).field("handler", or2(def("CatchClause"), null), function() {
        return this.handlers && this.handlers[0] || null;
      }).field("handlers", [def("CatchClause")], function() {
        return this.handler ? [this.handler] : [];
      }, true).field("guardedHandlers", [def("CatchClause")], defaults3.emptyArray).field("finalizer", or2(def("BlockStatement"), null), defaults3["null"]);
      def("CatchClause").bases("Node").build("param", "guard", "body").field("param", def("Pattern")).field("guard", or2(def("Expression"), null), defaults3["null"]).field("body", def("BlockStatement"));
      def("WhileStatement").bases("Statement").build("test", "body").field("test", def("Expression")).field("body", def("Statement"));
      def("DoWhileStatement").bases("Statement").build("body", "test").field("body", def("Statement")).field("test", def("Expression"));
      def("ForStatement").bases("Statement").build("init", "test", "update", "body").field("init", or2(def("VariableDeclaration"), def("Expression"), null)).field("test", or2(def("Expression"), null)).field("update", or2(def("Expression"), null)).field("body", def("Statement"));
      def("ForInStatement").bases("Statement").build("left", "right", "body").field("left", or2(def("VariableDeclaration"), def("Expression"))).field("right", def("Expression")).field("body", def("Statement"));
      def("DebuggerStatement").bases("Statement").build();
      def("Declaration").bases("Statement");
      def("FunctionDeclaration").bases("Function", "Declaration").build("id", "params", "body").field("id", def("Identifier"));
      def("FunctionExpression").bases("Function", "Expression").build("id", "params", "body");
      def("VariableDeclaration").bases("Declaration").build("kind", "declarations").field("kind", or2("var", "let", "const")).field("declarations", [def("VariableDeclarator")]);
      def("VariableDeclarator").bases("Node").build("id", "init").field("id", def("Pattern")).field("init", or2(def("Expression"), null), defaults3["null"]);
      def("Expression").bases("Node");
      def("ThisExpression").bases("Expression").build();
      def("ArrayExpression").bases("Expression").build("elements").field("elements", [or2(def("Expression"), null)]);
      def("ObjectExpression").bases("Expression").build("properties").field("properties", [def("Property")]);
      def("Property").bases("Node").build("kind", "key", "value").field("kind", or2("init", "get", "set")).field("key", or2(def("Literal"), def("Identifier"))).field("value", def("Expression"));
      def("SequenceExpression").bases("Expression").build("expressions").field("expressions", [def("Expression")]);
      var UnaryOperator = or2("-", "+", "!", "~", "typeof", "void", "delete");
      def("UnaryExpression").bases("Expression").build("operator", "argument", "prefix").field("operator", UnaryOperator).field("argument", def("Expression")).field("prefix", Boolean, defaults3["true"]);
      var BinaryOperator = or2.apply(void 0, BinaryOperators);
      def("BinaryExpression").bases("Expression").build("operator", "left", "right").field("operator", BinaryOperator).field("left", def("Expression")).field("right", def("Expression"));
      var AssignmentOperator = or2.apply(void 0, AssignmentOperators);
      def("AssignmentExpression").bases("Expression").build("operator", "left", "right").field("operator", AssignmentOperator).field("left", or2(def("Pattern"), def("MemberExpression"))).field("right", def("Expression"));
      var UpdateOperator = or2("++", "--");
      def("UpdateExpression").bases("Expression").build("operator", "argument", "prefix").field("operator", UpdateOperator).field("argument", def("Expression")).field("prefix", Boolean);
      var LogicalOperator = or2.apply(void 0, LogicalOperators);
      def("LogicalExpression").bases("Expression").build("operator", "left", "right").field("operator", LogicalOperator).field("left", def("Expression")).field("right", def("Expression"));
      def("ConditionalExpression").bases("Expression").build("test", "consequent", "alternate").field("test", def("Expression")).field("consequent", def("Expression")).field("alternate", def("Expression"));
      def("NewExpression").bases("Expression").build("callee", "arguments").field("callee", def("Expression")).field("arguments", [def("Expression")]);
      def("CallExpression").bases("Expression").build("callee", "arguments").field("callee", def("Expression")).field("arguments", [def("Expression")]);
      def("MemberExpression").bases("Expression").build("object", "property", "computed").field("object", def("Expression")).field("property", or2(def("Identifier"), def("Expression"))).field("computed", Boolean, function() {
        var type = this.property.type;
        if (type === "Literal" || type === "MemberExpression" || type === "BinaryExpression") {
          return true;
        }
        return false;
      });
      def("Pattern").bases("Node");
      def("SwitchCase").bases("Node").build("test", "consequent").field("test", or2(def("Expression"), null)).field("consequent", [def("Statement")]);
      def("Identifier").bases("Expression", "Pattern").build("name").field("name", String).field("optional", Boolean, defaults3["false"]);
      def("Literal").bases("Expression").build("value").field("value", or2(String, Boolean, null, Number, RegExp, BigInt));
      def("Comment").bases("Printable").field("value", String).field("leading", Boolean, defaults3["true"]).field("trailing", Boolean, defaults3["false"]);
    }
    __name(default_1, "default_1");
    exports.default = default_1;
    (0, shared_1.maybeSetModuleExports)(function() {
      return module2;
    });
  }
});

// ../../node_modules/.pnpm/ast-types@0.16.1/node_modules/ast-types/lib/def/es6.js
var require_es6 = __commonJS({
  "../../node_modules/.pnpm/ast-types@0.16.1/node_modules/ast-types/lib/def/es6.js"(exports, module2) {
    init_import_meta_url();
    Object.defineProperty(exports, "__esModule", { value: true });
    var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
    var core_1 = tslib_1.__importDefault(require_core5());
    var types_1 = tslib_1.__importDefault(require_types());
    var shared_1 = tslib_1.__importStar(require_shared());
    function default_1(fork) {
      fork.use(core_1.default);
      var types13 = fork.use(types_1.default);
      var def = types13.Type.def;
      var or2 = types13.Type.or;
      var defaults3 = fork.use(shared_1.default).defaults;
      def("Function").field("generator", Boolean, defaults3["false"]).field("expression", Boolean, defaults3["false"]).field("defaults", [or2(def("Expression"), null)], defaults3.emptyArray).field("rest", or2(def("Identifier"), null), defaults3["null"]);
      def("RestElement").bases("Pattern").build("argument").field("argument", def("Pattern")).field(
        "typeAnnotation",
        // for Babylon. Flow parser puts it on the identifier
        or2(def("TypeAnnotation"), def("TSTypeAnnotation"), null),
        defaults3["null"]
      );
      def("SpreadElementPattern").bases("Pattern").build("argument").field("argument", def("Pattern"));
      def("FunctionDeclaration").build("id", "params", "body", "generator", "expression").field("id", or2(def("Identifier"), null));
      def("FunctionExpression").build("id", "params", "body", "generator", "expression");
      def("ArrowFunctionExpression").bases("Function", "Expression").build("params", "body", "expression").field("id", null, defaults3["null"]).field("body", or2(def("BlockStatement"), def("Expression"))).field("generator", false, defaults3["false"]);
      def("ForOfStatement").bases("Statement").build("left", "right", "body").field("left", or2(def("VariableDeclaration"), def("Pattern"))).field("right", def("Expression")).field("body", def("Statement"));
      def("YieldExpression").bases("Expression").build("argument", "delegate").field("argument", or2(def("Expression"), null)).field("delegate", Boolean, defaults3["false"]);
      def("GeneratorExpression").bases("Expression").build("body", "blocks", "filter").field("body", def("Expression")).field("blocks", [def("ComprehensionBlock")]).field("filter", or2(def("Expression"), null));
      def("ComprehensionExpression").bases("Expression").build("body", "blocks", "filter").field("body", def("Expression")).field("blocks", [def("ComprehensionBlock")]).field("filter", or2(def("Expression"), null));
      def("ComprehensionBlock").bases("Node").build("left", "right", "each").field("left", def("Pattern")).field("right", def("Expression")).field("each", Boolean);
      def("Property").field("key", or2(def("Literal"), def("Identifier"), def("Expression"))).field("value", or2(def("Expression"), def("Pattern"))).field("method", Boolean, defaults3["false"]).field("shorthand", Boolean, defaults3["false"]).field("computed", Boolean, defaults3["false"]);
      def("ObjectProperty").field("shorthand", Boolean, defaults3["false"]);
      def("PropertyPattern").bases("Pattern").build("key", "pattern").field("key", or2(def("Literal"), def("Identifier"), def("Expression"))).field("pattern", def("Pattern")).field("computed", Boolean, defaults3["false"]);
      def("ObjectPattern").bases("Pattern").build("properties").field("properties", [or2(def("PropertyPattern"), def("Property"))]);
      def("ArrayPattern").bases("Pattern").build("elements").field("elements", [or2(def("Pattern"), null)]);
      def("SpreadElement").bases("Node").build("argument").field("argument", def("Expression"));
      def("ArrayExpression").field("elements", [or2(def("Expression"), def("SpreadElement"), def("RestElement"), null)]);
      def("NewExpression").field("arguments", [or2(def("Expression"), def("SpreadElement"))]);
      def("CallExpression").field("arguments", [or2(def("Expression"), def("SpreadElement"))]);
      def("AssignmentPattern").bases("Pattern").build("left", "right").field("left", def("Pattern")).field("right", def("Expression"));
      def("MethodDefinition").bases("Declaration").build("kind", "key", "value", "static").field("kind", or2("constructor", "method", "get", "set")).field("key", def("Expression")).field("value", def("Function")).field("computed", Boolean, defaults3["false"]).field("static", Boolean, defaults3["false"]);
      var ClassBodyElement = or2(def("MethodDefinition"), def("VariableDeclarator"), def("ClassPropertyDefinition"), def("ClassProperty"), def("StaticBlock"));
      def("ClassProperty").bases("Declaration").build("key").field("key", or2(def("Literal"), def("Identifier"), def("Expression"))).field("computed", Boolean, defaults3["false"]);
      def("ClassPropertyDefinition").bases("Declaration").build("definition").field("definition", ClassBodyElement);
      def("ClassBody").bases("Declaration").build("body").field("body", [ClassBodyElement]);
      def("ClassDeclaration").bases("Declaration").build("id", "body", "superClass").field("id", or2(def("Identifier"), null)).field("body", def("ClassBody")).field("superClass", or2(def("Expression"), null), defaults3["null"]);
      def("ClassExpression").bases("Expression").build("id", "body", "superClass").field("id", or2(def("Identifier"), null), defaults3["null"]).field("body", def("ClassBody")).field("superClass", or2(def("Expression"), null), defaults3["null"]);
      def("Super").bases("Expression").build();
      def("Specifier").bases("Node");
      def("ModuleSpecifier").bases("Specifier").field("local", or2(def("Identifier"), null), defaults3["null"]).field("id", or2(def("Identifier"), null), defaults3["null"]).field("name", or2(def("Identifier"), null), defaults3["null"]);
      def("ImportSpecifier").bases("ModuleSpecifier").build("imported", "local").field("imported", def("Identifier"));
      def("ImportDefaultSpecifier").bases("ModuleSpecifier").build("local");
      def("ImportNamespaceSpecifier").bases("ModuleSpecifier").build("local");
      def("ImportDeclaration").bases("Declaration").build("specifiers", "source", "importKind").field("specifiers", [or2(def("ImportSpecifier"), def("ImportNamespaceSpecifier"), def("ImportDefaultSpecifier"))], defaults3.emptyArray).field("source", def("Literal")).field("importKind", or2("value", "type"), function() {
        return "value";
      });
      def("ExportNamedDeclaration").bases("Declaration").build("declaration", "specifiers", "source").field("declaration", or2(def("Declaration"), null)).field("specifiers", [def("ExportSpecifier")], defaults3.emptyArray).field("source", or2(def("Literal"), null), defaults3["null"]);
      def("ExportSpecifier").bases("ModuleSpecifier").build("local", "exported").field("exported", def("Identifier"));
      def("ExportDefaultDeclaration").bases("Declaration").build("declaration").field("declaration", or2(def("Declaration"), def("Expression")));
      def("ExportAllDeclaration").bases("Declaration").build("source").field("source", def("Literal"));
      def("TaggedTemplateExpression").bases("Expression").build("tag", "quasi").field("tag", def("Expression")).field("quasi", def("TemplateLiteral"));
      def("TemplateLiteral").bases("Expression").build("quasis", "expressions").field("quasis", [def("TemplateElement")]).field("expressions", [def("Expression")]);
      def("TemplateElement").bases("Node").build("value", "tail").field("value", { "cooked": String, "raw": String }).field("tail", Boolean);
      def("MetaProperty").bases("Expression").build("meta", "property").field("meta", def("Identifier")).field("property", def("Identifier"));
    }
    __name(default_1, "default_1");
    exports.default = default_1;
    (0, shared_1.maybeSetModuleExports)(function() {
      return module2;
    });
  }
});

// ../../node_modules/.pnpm/ast-types@0.16.1/node_modules/ast-types/lib/def/es2016.js
var require_es20162 = __commonJS({
  "../../node_modules/.pnpm/ast-types@0.16.1/node_modules/ast-types/lib/def/es2016.js"(exports, module2) {
    init_import_meta_url();
    Object.defineProperty(exports, "__esModule", { value: true });
    var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
    var es2016_1 = tslib_1.__importDefault(require_es2016());
    var es6_1 = tslib_1.__importDefault(require_es6());
    var shared_1 = require_shared();
    function default_1(fork) {
      fork.use(es2016_1.default);
      fork.use(es6_1.default);
    }
    __name(default_1, "default_1");
    exports.default = default_1;
    (0, shared_1.maybeSetModuleExports)(function() {
      return module2;
    });
  }
});

// ../../node_modules/.pnpm/ast-types@0.16.1/node_modules/ast-types/lib/def/es2017.js
var require_es2017 = __commonJS({
  "../../node_modules/.pnpm/ast-types@0.16.1/node_modules/ast-types/lib/def/es2017.js"(exports, module2) {
    init_import_meta_url();
    Object.defineProperty(exports, "__esModule", { value: true });
    var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
    var es2016_1 = tslib_1.__importDefault(require_es20162());
    var types_1 = tslib_1.__importDefault(require_types());
    var shared_1 = tslib_1.__importStar(require_shared());
    function default_1(fork) {
      fork.use(es2016_1.default);
      var types13 = fork.use(types_1.default);
      var def = types13.Type.def;
      var defaults3 = fork.use(shared_1.default).defaults;
      def("Function").field("async", Boolean, defaults3["false"]);
      def("AwaitExpression").bases("Expression").build("argument").field("argument", def("Expression"));
    }
    __name(default_1, "default_1");
    exports.default = default_1;
    (0, shared_1.maybeSetModuleExports)(function() {
      return module2;
    });
  }
});

// ../../node_modules/.pnpm/ast-types@0.16.1/node_modules/ast-types/lib/def/es2018.js
var require_es2018 = __commonJS({
  "../../node_modules/.pnpm/ast-types@0.16.1/node_modules/ast-types/lib/def/es2018.js"(exports, module2) {
    init_import_meta_url();
    Object.defineProperty(exports, "__esModule", { value: true });
    var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
    var es2017_1 = tslib_1.__importDefault(require_es2017());
    var types_1 = tslib_1.__importDefault(require_types());
    var shared_1 = tslib_1.__importStar(require_shared());
    function default_1(fork) {
      fork.use(es2017_1.default);
      var types13 = fork.use(types_1.default);
      var def = types13.Type.def;
      var or2 = types13.Type.or;
      var defaults3 = fork.use(shared_1.default).defaults;
      def("ForOfStatement").field("await", Boolean, defaults3["false"]);
      def("SpreadProperty").bases("Node").build("argument").field("argument", def("Expression"));
      def("ObjectExpression").field("properties", [or2(
        def("Property"),
        def("SpreadProperty"),
        // Legacy
        def("SpreadElement")
      )]);
      def("TemplateElement").field("value", { "cooked": or2(String, null), "raw": String });
      def("SpreadPropertyPattern").bases("Pattern").build("argument").field("argument", def("Pattern"));
      def("ObjectPattern").field("properties", [or2(def("PropertyPattern"), def("Property"), def("RestElement"), def("SpreadPropertyPattern"))]);
    }
    __name(default_1, "default_1");
    exports.default = default_1;
    (0, shared_1.maybeSetModuleExports)(function() {
      return module2;
    });
  }
});

// ../../node_modules/.pnpm/ast-types@0.16.1/node_modules/ast-types/lib/def/es2019.js
var require_es2019 = __commonJS({
  "../../node_modules/.pnpm/ast-types@0.16.1/node_modules/ast-types/lib/def/es2019.js"(exports, module2) {
    init_import_meta_url();
    Object.defineProperty(exports, "__esModule", { value: true });
    var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
    var es2018_1 = tslib_1.__importDefault(require_es2018());
    var types_1 = tslib_1.__importDefault(require_types());
    var shared_1 = tslib_1.__importStar(require_shared());
    function default_1(fork) {
      fork.use(es2018_1.default);
      var types13 = fork.use(types_1.default);
      var def = types13.Type.def;
      var or2 = types13.Type.or;
      var defaults3 = fork.use(shared_1.default).defaults;
      def("CatchClause").field("param", or2(def("Pattern"), null), defaults3["null"]);
    }
    __name(default_1, "default_1");
    exports.default = default_1;
    (0, shared_1.maybeSetModuleExports)(function() {
      return module2;
    });
  }
});

// ../../node_modules/.pnpm/ast-types@0.16.1/node_modules/ast-types/lib/def/es2020.js
var require_es20202 = __commonJS({
  "../../node_modules/.pnpm/ast-types@0.16.1/node_modules/ast-types/lib/def/es2020.js"(exports, module2) {
    init_import_meta_url();
    Object.defineProperty(exports, "__esModule", { value: true });
    var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
    var es2020_1 = tslib_1.__importDefault(require_es2020());
    var es2019_1 = tslib_1.__importDefault(require_es2019());
    var types_1 = tslib_1.__importDefault(require_types());
    var shared_1 = tslib_1.__importStar(require_shared());
    function default_1(fork) {
      fork.use(es2020_1.default);
      fork.use(es2019_1.default);
      var types13 = fork.use(types_1.default);
      var def = types13.Type.def;
      var or2 = types13.Type.or;
      var shared = fork.use(shared_1.default);
      var defaults3 = shared.defaults;
      def("ImportExpression").bases("Expression").build("source").field("source", def("Expression"));
      def("ExportAllDeclaration").bases("Declaration").build("source", "exported").field("source", def("Literal")).field("exported", or2(def("Identifier"), null, void 0), defaults3["null"]);
      def("ChainElement").bases("Node").field("optional", Boolean, defaults3["false"]);
      def("CallExpression").bases("Expression", "ChainElement");
      def("MemberExpression").bases("Expression", "ChainElement");
      def("ChainExpression").bases("Expression").build("expression").field("expression", def("ChainElement"));
      def("OptionalCallExpression").bases("CallExpression").build("callee", "arguments", "optional").field("optional", Boolean, defaults3["true"]);
      def("OptionalMemberExpression").bases("MemberExpression").build("object", "property", "computed", "optional").field("optional", Boolean, defaults3["true"]);
    }
    __name(default_1, "default_1");
    exports.default = default_1;
    (0, shared_1.maybeSetModuleExports)(function() {
      return module2;
    });
  }
});

// ../../node_modules/.pnpm/ast-types@0.16.1/node_modules/ast-types/lib/def/es2021.js
var require_es20212 = __commonJS({
  "../../node_modules/.pnpm/ast-types@0.16.1/node_modules/ast-types/lib/def/es2021.js"(exports, module2) {
    init_import_meta_url();
    Object.defineProperty(exports, "__esModule", { value: true });
    var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
    var es2021_1 = tslib_1.__importDefault(require_es2021());
    var es2020_1 = tslib_1.__importDefault(require_es20202());
    var shared_1 = require_shared();
    function default_1(fork) {
      fork.use(es2021_1.default);
      fork.use(es2020_1.default);
    }
    __name(default_1, "default_1");
    exports.default = default_1;
    (0, shared_1.maybeSetModuleExports)(function() {
      return module2;
    });
  }
});

// ../../node_modules/.pnpm/ast-types@0.16.1/node_modules/ast-types/lib/def/es2022.js
var require_es2022 = __commonJS({
  "../../node_modules/.pnpm/ast-types@0.16.1/node_modules/ast-types/lib/def/es2022.js"(exports, module2) {
    init_import_meta_url();
    Object.defineProperty(exports, "__esModule", { value: true });
    var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
    var es2021_1 = tslib_1.__importDefault(require_es20212());
    var types_1 = tslib_1.__importDefault(require_types());
    var shared_1 = require_shared();
    function default_1(fork) {
      fork.use(es2021_1.default);
      var types13 = fork.use(types_1.default);
      var def = types13.Type.def;
      def("StaticBlock").bases("Declaration").build("body").field("body", [def("Statement")]);
    }
    __name(default_1, "default_1");
    exports.default = default_1;
    (0, shared_1.maybeSetModuleExports)(function() {
      return module2;
    });
  }
});

// ../../node_modules/.pnpm/ast-types@0.16.1/node_modules/ast-types/lib/def/es-proposals.js
var require_es_proposals = __commonJS({
  "../../node_modules/.pnpm/ast-types@0.16.1/node_modules/ast-types/lib/def/es-proposals.js"(exports, module2) {
    init_import_meta_url();
    Object.defineProperty(exports, "__esModule", { value: true });
    var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
    var types_1 = tslib_1.__importDefault(require_types());
    var shared_1 = tslib_1.__importStar(require_shared());
    var es2022_1 = tslib_1.__importDefault(require_es2022());
    function default_1(fork) {
      fork.use(es2022_1.default);
      var types13 = fork.use(types_1.default);
      var Type2 = types13.Type;
      var def = types13.Type.def;
      var or2 = Type2.or;
      var shared = fork.use(shared_1.default);
      var defaults3 = shared.defaults;
      def("AwaitExpression").build("argument", "all").field("argument", or2(def("Expression"), null)).field("all", Boolean, defaults3["false"]);
      def("Decorator").bases("Node").build("expression").field("expression", def("Expression"));
      def("Property").field("decorators", or2([def("Decorator")], null), defaults3["null"]);
      def("MethodDefinition").field("decorators", or2([def("Decorator")], null), defaults3["null"]);
      def("PrivateName").bases("Expression", "Pattern").build("id").field("id", def("Identifier"));
      def("ClassPrivateProperty").bases("ClassProperty").build("key", "value").field("key", def("PrivateName")).field("value", or2(def("Expression"), null), defaults3["null"]);
      def("ImportAttribute").bases("Node").build("key", "value").field("key", or2(def("Identifier"), def("Literal"))).field("value", def("Expression"));
      [
        "ImportDeclaration",
        "ExportAllDeclaration",
        "ExportNamedDeclaration"
      ].forEach(function(decl) {
        def(decl).field("assertions", [def("ImportAttribute")], defaults3.emptyArray);
      });
      def("RecordExpression").bases("Expression").build("properties").field("properties", [or2(def("ObjectProperty"), def("ObjectMethod"), def("SpreadElement"))]);
      def("TupleExpression").bases("Expression").build("elements").field("elements", [or2(def("Expression"), def("SpreadElement"), null)]);
      def("ModuleExpression").bases("Node").build("body").field("body", def("Program"));
    }
    __name(default_1, "default_1");
    exports.default = default_1;
    (0, shared_1.maybeSetModuleExports)(function() {
      return module2;
    });
  }
});

// ../../node_modules/.pnpm/ast-types@0.16.1/node_modules/ast-types/lib/def/jsx.js
var require_jsx = __commonJS({
  "../../node_modules/.pnpm/ast-types@0.16.1/node_modules/ast-types/lib/def/jsx.js"(exports, module2) {
    init_import_meta_url();
    Object.defineProperty(exports, "__esModule", { value: true });
    var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
    var es_proposals_1 = tslib_1.__importDefault(require_es_proposals());
    var types_1 = tslib_1.__importDefault(require_types());
    var shared_1 = tslib_1.__importStar(require_shared());
    function default_1(fork) {
      fork.use(es_proposals_1.default);
      var types13 = fork.use(types_1.default);
      var def = types13.Type.def;
      var or2 = types13.Type.or;
      var defaults3 = fork.use(shared_1.default).defaults;
      def("JSXAttribute").bases("Node").build("name", "value").field("name", or2(def("JSXIdentifier"), def("JSXNamespacedName"))).field("value", or2(
        def("Literal"),
        // attr="value"
        def("JSXExpressionContainer"),
        // attr={value}
        def("JSXElement"),
        // attr=<div />
        def("JSXFragment"),
        // attr=<></>
        null
        // attr= or just attr
      ), defaults3["null"]);
      def("JSXIdentifier").bases("Identifier").build("name").field("name", String);
      def("JSXNamespacedName").bases("Node").build("namespace", "name").field("namespace", def("JSXIdentifier")).field("name", def("JSXIdentifier"));
      def("JSXMemberExpression").bases("MemberExpression").build("object", "property").field("object", or2(def("JSXIdentifier"), def("JSXMemberExpression"))).field("property", def("JSXIdentifier")).field("computed", Boolean, defaults3.false);
      var JSXElementName = or2(def("JSXIdentifier"), def("JSXNamespacedName"), def("JSXMemberExpression"));
      def("JSXSpreadAttribute").bases("Node").build("argument").field("argument", def("Expression"));
      var JSXAttributes = [or2(def("JSXAttribute"), def("JSXSpreadAttribute"))];
      def("JSXExpressionContainer").bases("Expression").build("expression").field("expression", or2(def("Expression"), def("JSXEmptyExpression")));
      var JSXChildren = [or2(
        def("JSXText"),
        def("JSXExpressionContainer"),
        def("JSXSpreadChild"),
        def("JSXElement"),
        def("JSXFragment"),
        def("Literal")
        // Legacy: Esprima should return JSXText instead.
      )];
      def("JSXElement").bases("Expression").build("openingElement", "closingElement", "children").field("openingElement", def("JSXOpeningElement")).field("closingElement", or2(def("JSXClosingElement"), null), defaults3["null"]).field("children", JSXChildren, defaults3.emptyArray).field("name", JSXElementName, function() {
        return this.openingElement.name;
      }, true).field("selfClosing", Boolean, function() {
        return this.openingElement.selfClosing;
      }, true).field("attributes", JSXAttributes, function() {
        return this.openingElement.attributes;
      }, true);
      def("JSXOpeningElement").bases("Node").build("name", "attributes", "selfClosing").field("name", JSXElementName).field("attributes", JSXAttributes, defaults3.emptyArray).field("selfClosing", Boolean, defaults3["false"]);
      def("JSXClosingElement").bases("Node").build("name").field("name", JSXElementName);
      def("JSXFragment").bases("Expression").build("openingFragment", "closingFragment", "children").field("openingFragment", def("JSXOpeningFragment")).field("closingFragment", def("JSXClosingFragment")).field("children", JSXChildren, defaults3.emptyArray);
      def("JSXOpeningFragment").bases("Node").build();
      def("JSXClosingFragment").bases("Node").build();
      def("JSXText").bases("Literal").build("value", "raw").field("value", String).field("raw", String, function() {
        return this.value;
      });
      def("JSXEmptyExpression").bases("Node").build();
      def("JSXSpreadChild").bases("Node").build("expression").field("expression", def("Expression"));
    }
    __name(default_1, "default_1");
    exports.default = default_1;
    (0, shared_1.maybeSetModuleExports)(function() {
      return module2;
    });
  }
});

// ../../node_modules/.pnpm/ast-types@0.16.1/node_modules/ast-types/lib/def/type-annotations.js
var require_type_annotations = __commonJS({
  "../../node_modules/.pnpm/ast-types@0.16.1/node_modules/ast-types/lib/def/type-annotations.js"(exports, module2) {
    init_import_meta_url();
    Object.defineProperty(exports, "__esModule", { value: true });
    var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
    var types_1 = tslib_1.__importDefault(require_types());
    var shared_1 = tslib_1.__importStar(require_shared());
    function default_1(fork) {
      var types13 = fork.use(types_1.default);
      var def = types13.Type.def;
      var or2 = types13.Type.or;
      var defaults3 = fork.use(shared_1.default).defaults;
      var TypeAnnotation = or2(def("TypeAnnotation"), def("TSTypeAnnotation"), null);
      var TypeParamDecl = or2(def("TypeParameterDeclaration"), def("TSTypeParameterDeclaration"), null);
      def("Identifier").field("typeAnnotation", TypeAnnotation, defaults3["null"]);
      def("ObjectPattern").field("typeAnnotation", TypeAnnotation, defaults3["null"]);
      def("Function").field("returnType", TypeAnnotation, defaults3["null"]).field("typeParameters", TypeParamDecl, defaults3["null"]);
      def("ClassProperty").build("key", "value", "typeAnnotation", "static").field("value", or2(def("Expression"), null)).field("static", Boolean, defaults3["false"]).field("typeAnnotation", TypeAnnotation, defaults3["null"]);
      [
        "ClassDeclaration",
        "ClassExpression"
      ].forEach(function(typeName) {
        def(typeName).field("typeParameters", TypeParamDecl, defaults3["null"]).field("superTypeParameters", or2(def("TypeParameterInstantiation"), def("TSTypeParameterInstantiation"), null), defaults3["null"]).field("implements", or2([def("ClassImplements")], [def("TSExpressionWithTypeArguments")]), defaults3.emptyArray);
      });
    }
    __name(default_1, "default_1");
    exports.default = default_1;
    (0, shared_1.maybeSetModuleExports)(function() {
      return module2;
    });
  }
});

// ../../node_modules/.pnpm/ast-types@0.16.1/node_modules/ast-types/lib/def/flow.js
var require_flow = __commonJS({
  "../../node_modules/.pnpm/ast-types@0.16.1/node_modules/ast-types/lib/def/flow.js"(exports, module2) {
    init_import_meta_url();
    Object.defineProperty(exports, "__esModule", { value: true });
    var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
    var es_proposals_1 = tslib_1.__importDefault(require_es_proposals());
    var type_annotations_1 = tslib_1.__importDefault(require_type_annotations());
    var types_1 = tslib_1.__importDefault(require_types());
    var shared_1 = tslib_1.__importStar(require_shared());
    function default_1(fork) {
      fork.use(es_proposals_1.default);
      fork.use(type_annotations_1.default);
      var types13 = fork.use(types_1.default);
      var def = types13.Type.def;
      var or2 = types13.Type.or;
      var defaults3 = fork.use(shared_1.default).defaults;
      def("Flow").bases("Node");
      def("FlowType").bases("Flow");
      def("AnyTypeAnnotation").bases("FlowType").build();
      def("EmptyTypeAnnotation").bases("FlowType").build();
      def("MixedTypeAnnotation").bases("FlowType").build();
      def("VoidTypeAnnotation").bases("FlowType").build();
      def("SymbolTypeAnnotation").bases("FlowType").build();
      def("NumberTypeAnnotation").bases("FlowType").build();
      def("BigIntTypeAnnotation").bases("FlowType").build();
      def("NumberLiteralTypeAnnotation").bases("FlowType").build("value", "raw").field("value", Number).field("raw", String);
      def("NumericLiteralTypeAnnotation").bases("FlowType").build("value", "raw").field("value", Number).field("raw", String);
      def("BigIntLiteralTypeAnnotation").bases("FlowType").build("value", "raw").field("value", null).field("raw", String);
      def("StringTypeAnnotation").bases("FlowType").build();
      def("StringLiteralTypeAnnotation").bases("FlowType").build("value", "raw").field("value", String).field("raw", String);
      def("BooleanTypeAnnotation").bases("FlowType").build();
      def("BooleanLiteralTypeAnnotation").bases("FlowType").build("value", "raw").field("value", Boolean).field("raw", String);
      def("TypeAnnotation").bases("Node").build("typeAnnotation").field("typeAnnotation", def("FlowType"));
      def("NullableTypeAnnotation").bases("FlowType").build("typeAnnotation").field("typeAnnotation", def("FlowType"));
      def("NullLiteralTypeAnnotation").bases("FlowType").build();
      def("NullTypeAnnotation").bases("FlowType").build();
      def("ThisTypeAnnotation").bases("FlowType").build();
      def("ExistsTypeAnnotation").bases("FlowType").build();
      def("ExistentialTypeParam").bases("FlowType").build();
      def("FunctionTypeAnnotation").bases("FlowType").build("params", "returnType", "rest", "typeParameters").field("params", [def("FunctionTypeParam")]).field("returnType", def("FlowType")).field("rest", or2(def("FunctionTypeParam"), null)).field("typeParameters", or2(def("TypeParameterDeclaration"), null));
      def("FunctionTypeParam").bases("Node").build("name", "typeAnnotation", "optional").field("name", or2(def("Identifier"), null)).field("typeAnnotation", def("FlowType")).field("optional", Boolean);
      def("ArrayTypeAnnotation").bases("FlowType").build("elementType").field("elementType", def("FlowType"));
      def("ObjectTypeAnnotation").bases("FlowType").build("properties", "indexers", "callProperties").field("properties", [
        or2(def("ObjectTypeProperty"), def("ObjectTypeSpreadProperty"))
      ]).field("indexers", [def("ObjectTypeIndexer")], defaults3.emptyArray).field("callProperties", [def("ObjectTypeCallProperty")], defaults3.emptyArray).field("inexact", or2(Boolean, void 0), defaults3["undefined"]).field("exact", Boolean, defaults3["false"]).field("internalSlots", [def("ObjectTypeInternalSlot")], defaults3.emptyArray);
      def("Variance").bases("Node").build("kind").field("kind", or2("plus", "minus"));
      var LegacyVariance = or2(def("Variance"), "plus", "minus", null);
      def("ObjectTypeProperty").bases("Node").build("key", "value", "optional").field("key", or2(def("Literal"), def("Identifier"))).field("value", def("FlowType")).field("optional", Boolean).field("variance", LegacyVariance, defaults3["null"]);
      def("ObjectTypeIndexer").bases("Node").build("id", "key", "value").field("id", def("Identifier")).field("key", def("FlowType")).field("value", def("FlowType")).field("variance", LegacyVariance, defaults3["null"]).field("static", Boolean, defaults3["false"]);
      def("ObjectTypeCallProperty").bases("Node").build("value").field("value", def("FunctionTypeAnnotation")).field("static", Boolean, defaults3["false"]);
      def("QualifiedTypeIdentifier").bases("Node").build("qualification", "id").field("qualification", or2(def("Identifier"), def("QualifiedTypeIdentifier"))).field("id", def("Identifier"));
      def("GenericTypeAnnotation").bases("FlowType").build("id", "typeParameters").field("id", or2(def("Identifier"), def("QualifiedTypeIdentifier"))).field("typeParameters", or2(def("TypeParameterInstantiation"), null));
      def("MemberTypeAnnotation").bases("FlowType").build("object", "property").field("object", def("Identifier")).field("property", or2(def("MemberTypeAnnotation"), def("GenericTypeAnnotation")));
      def("IndexedAccessType").bases("FlowType").build("objectType", "indexType").field("objectType", def("FlowType")).field("indexType", def("FlowType"));
      def("OptionalIndexedAccessType").bases("FlowType").build("objectType", "indexType", "optional").field("objectType", def("FlowType")).field("indexType", def("FlowType")).field("optional", Boolean);
      def("UnionTypeAnnotation").bases("FlowType").build("types").field("types", [def("FlowType")]);
      def("IntersectionTypeAnnotation").bases("FlowType").build("types").field("types", [def("FlowType")]);
      def("TypeofTypeAnnotation").bases("FlowType").build("argument").field("argument", def("FlowType"));
      def("ObjectTypeSpreadProperty").bases("Node").build("argument").field("argument", def("FlowType"));
      def("ObjectTypeInternalSlot").bases("Node").build("id", "value", "optional", "static", "method").field("id", def("Identifier")).field("value", def("FlowType")).field("optional", Boolean).field("static", Boolean).field("method", Boolean);
      def("TypeParameterDeclaration").bases("Node").build("params").field("params", [def("TypeParameter")]);
      def("TypeParameterInstantiation").bases("Node").build("params").field("params", [def("FlowType")]);
      def("TypeParameter").bases("FlowType").build("name", "variance", "bound", "default").field("name", String).field("variance", LegacyVariance, defaults3["null"]).field("bound", or2(def("TypeAnnotation"), null), defaults3["null"]).field("default", or2(def("FlowType"), null), defaults3["null"]);
      def("ClassProperty").field("variance", LegacyVariance, defaults3["null"]);
      def("ClassImplements").bases("Node").build("id").field("id", def("Identifier")).field("superClass", or2(def("Expression"), null), defaults3["null"]).field("typeParameters", or2(def("TypeParameterInstantiation"), null), defaults3["null"]);
      def("InterfaceTypeAnnotation").bases("FlowType").build("body", "extends").field("body", def("ObjectTypeAnnotation")).field("extends", or2([def("InterfaceExtends")], null), defaults3["null"]);
      def("InterfaceDeclaration").bases("Declaration").build("id", "body", "extends").field("id", def("Identifier")).field("typeParameters", or2(def("TypeParameterDeclaration"), null), defaults3["null"]).field("body", def("ObjectTypeAnnotation")).field("extends", [def("InterfaceExtends")]);
      def("DeclareInterface").bases("InterfaceDeclaration").build("id", "body", "extends");
      def("InterfaceExtends").bases("Node").build("id").field("id", def("Identifier")).field("typeParameters", or2(def("TypeParameterInstantiation"), null), defaults3["null"]);
      def("TypeAlias").bases("Declaration").build("id", "typeParameters", "right").field("id", def("Identifier")).field("typeParameters", or2(def("TypeParameterDeclaration"), null)).field("right", def("FlowType"));
      def("DeclareTypeAlias").bases("TypeAlias").build("id", "typeParameters", "right");
      def("OpaqueType").bases("Declaration").build("id", "typeParameters", "impltype", "supertype").field("id", def("Identifier")).field("typeParameters", or2(def("TypeParameterDeclaration"), null)).field("impltype", def("FlowType")).field("supertype", or2(def("FlowType"), null));
      def("DeclareOpaqueType").bases("OpaqueType").build("id", "typeParameters", "supertype").field("impltype", or2(def("FlowType"), null));
      def("TypeCastExpression").bases("Expression").build("expression", "typeAnnotation").field("expression", def("Expression")).field("typeAnnotation", def("TypeAnnotation"));
      def("TupleTypeAnnotation").bases("FlowType").build("types").field("types", [def("FlowType")]);
      def("DeclareVariable").bases("Statement").build("id").field("id", def("Identifier"));
      def("DeclareFunction").bases("Statement").build("id").field("id", def("Identifier")).field("predicate", or2(def("FlowPredicate"), null), defaults3["null"]);
      def("DeclareClass").bases("InterfaceDeclaration").build("id");
      def("DeclareModule").bases("Statement").build("id", "body").field("id", or2(def("Identifier"), def("Literal"))).field("body", def("BlockStatement"));
      def("DeclareModuleExports").bases("Statement").build("typeAnnotation").field("typeAnnotation", def("TypeAnnotation"));
      def("DeclareExportDeclaration").bases("Declaration").build("default", "declaration", "specifiers", "source").field("default", Boolean).field("declaration", or2(
        def("DeclareVariable"),
        def("DeclareFunction"),
        def("DeclareClass"),
        def("FlowType"),
        // Implies default.
        def("TypeAlias"),
        // Implies named type
        def("DeclareOpaqueType"),
        // Implies named opaque type
        def("InterfaceDeclaration"),
        null
      )).field("specifiers", [or2(def("ExportSpecifier"), def("ExportBatchSpecifier"))], defaults3.emptyArray).field("source", or2(def("Literal"), null), defaults3["null"]);
      def("DeclareExportAllDeclaration").bases("Declaration").build("source").field("source", or2(def("Literal"), null), defaults3["null"]);
      def("ImportDeclaration").field("importKind", or2("value", "type", "typeof"), function() {
        return "value";
      });
      def("FlowPredicate").bases("Flow");
      def("InferredPredicate").bases("FlowPredicate").build();
      def("DeclaredPredicate").bases("FlowPredicate").build("value").field("value", def("Expression"));
      def("Function").field("predicate", or2(def("FlowPredicate"), null), defaults3["null"]);
      def("CallExpression").field("typeArguments", or2(null, def("TypeParameterInstantiation")), defaults3["null"]);
      def("NewExpression").field("typeArguments", or2(null, def("TypeParameterInstantiation")), defaults3["null"]);
      def("EnumDeclaration").bases("Declaration").build("id", "body").field("id", def("Identifier")).field("body", or2(def("EnumBooleanBody"), def("EnumNumberBody"), def("EnumStringBody"), def("EnumSymbolBody")));
      def("EnumBooleanBody").build("members", "explicitType").field("members", [def("EnumBooleanMember")]).field("explicitType", Boolean);
      def("EnumNumberBody").build("members", "explicitType").field("members", [def("EnumNumberMember")]).field("explicitType", Boolean);
      def("EnumStringBody").build("members", "explicitType").field("members", or2([def("EnumStringMember")], [def("EnumDefaultedMember")])).field("explicitType", Boolean);
      def("EnumSymbolBody").build("members").field("members", [def("EnumDefaultedMember")]);
      def("EnumBooleanMember").build("id", "init").field("id", def("Identifier")).field("init", or2(def("Literal"), Boolean));
      def("EnumNumberMember").build("id", "init").field("id", def("Identifier")).field("init", def("Literal"));
      def("EnumStringMember").build("id", "init").field("id", def("Identifier")).field("init", def("Literal"));
      def("EnumDefaultedMember").build("id").field("id", def("Identifier"));
    }
    __name(default_1, "default_1");
    exports.default = default_1;
    (0, shared_1.maybeSetModuleExports)(function() {
      return module2;
    });
  }
});

// ../../node_modules/.pnpm/ast-types@0.16.1/node_modules/ast-types/lib/def/esprima.js
var require_esprima = __commonJS({
  "../../node_modules/.pnpm/ast-types@0.16.1/node_modules/ast-types/lib/def/esprima.js"(exports, module2) {
    init_import_meta_url();
    Object.defineProperty(exports, "__esModule", { value: true });
    var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
    var es_proposals_1 = tslib_1.__importDefault(require_es_proposals());
    var types_1 = tslib_1.__importDefault(require_types());
    var shared_1 = tslib_1.__importStar(require_shared());
    function default_1(fork) {
      fork.use(es_proposals_1.default);
      var types13 = fork.use(types_1.default);
      var defaults3 = fork.use(shared_1.default).defaults;
      var def = types13.Type.def;
      var or2 = types13.Type.or;
      def("VariableDeclaration").field("declarations", [or2(
        def("VariableDeclarator"),
        def("Identifier")
        // Esprima deviation.
      )]);
      def("Property").field("value", or2(
        def("Expression"),
        def("Pattern")
        // Esprima deviation.
      ));
      def("ArrayPattern").field("elements", [or2(def("Pattern"), def("SpreadElement"), null)]);
      def("ObjectPattern").field("properties", [or2(
        def("Property"),
        def("PropertyPattern"),
        def("SpreadPropertyPattern"),
        def("SpreadProperty")
        // Used by Esprima.
      )]);
      def("ExportSpecifier").bases("ModuleSpecifier").build("id", "name");
      def("ExportBatchSpecifier").bases("Specifier").build();
      def("ExportDeclaration").bases("Declaration").build("default", "declaration", "specifiers", "source").field("default", Boolean).field("declaration", or2(
        def("Declaration"),
        def("Expression"),
        // Implies default.
        null
      )).field("specifiers", [or2(def("ExportSpecifier"), def("ExportBatchSpecifier"))], defaults3.emptyArray).field("source", or2(def("Literal"), null), defaults3["null"]);
      def("Block").bases("Comment").build(
        "value",
        /*optional:*/
        "leading",
        "trailing"
      );
      def("Line").bases("Comment").build(
        "value",
        /*optional:*/
        "leading",
        "trailing"
      );
    }
    __name(default_1, "default_1");
    exports.default = default_1;
    (0, shared_1.maybeSetModuleExports)(function() {
      return module2;
    });
  }
});

// ../../node_modules/.pnpm/ast-types@0.16.1/node_modules/ast-types/lib/def/babel-core.js
var require_babel_core = __commonJS({
  "../../node_modules/.pnpm/ast-types@0.16.1/node_modules/ast-types/lib/def/babel-core.js"(exports, module2) {
    init_import_meta_url();
    Object.defineProperty(exports, "__esModule", { value: true });
    var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
    var es_proposals_1 = tslib_1.__importDefault(require_es_proposals());
    var types_1 = tslib_1.__importDefault(require_types());
    var shared_1 = tslib_1.__importStar(require_shared());
    function default_1(fork) {
      var _a5, _b2, _c3, _d2, _e3;
      fork.use(es_proposals_1.default);
      var types13 = fork.use(types_1.default);
      var defaults3 = fork.use(shared_1.default).defaults;
      var def = types13.Type.def;
      var or2 = types13.Type.or;
      var isUndefined = types13.builtInTypes.undefined;
      def("Noop").bases("Statement").build();
      def("DoExpression").bases("Expression").build("body").field("body", [def("Statement")]);
      def("BindExpression").bases("Expression").build("object", "callee").field("object", or2(def("Expression"), null)).field("callee", def("Expression"));
      def("ParenthesizedExpression").bases("Expression").build("expression").field("expression", def("Expression"));
      def("ExportNamespaceSpecifier").bases("Specifier").build("exported").field("exported", def("Identifier"));
      def("ExportDefaultSpecifier").bases("Specifier").build("exported").field("exported", def("Identifier"));
      def("CommentBlock").bases("Comment").build(
        "value",
        /*optional:*/
        "leading",
        "trailing"
      );
      def("CommentLine").bases("Comment").build(
        "value",
        /*optional:*/
        "leading",
        "trailing"
      );
      def("Directive").bases("Node").build("value").field("value", def("DirectiveLiteral"));
      def("DirectiveLiteral").bases("Node", "Expression").build("value").field("value", String, defaults3["use strict"]);
      def("InterpreterDirective").bases("Node").build("value").field("value", String);
      def("BlockStatement").bases("Statement").build("body").field("body", [def("Statement")]).field("directives", [def("Directive")], defaults3.emptyArray);
      def("Program").bases("Node").build("body").field("body", [def("Statement")]).field("directives", [def("Directive")], defaults3.emptyArray).field("interpreter", or2(def("InterpreterDirective"), null), defaults3["null"]);
      function makeLiteralExtra(rawValueType, toRaw) {
        if (rawValueType === void 0) {
          rawValueType = String;
        }
        return [
          "extra",
          {
            rawValue: rawValueType,
            raw: String
          },
          /* @__PURE__ */ __name(function getDefault() {
            var value = types13.getFieldValue(this, "value");
            return {
              rawValue: value,
              raw: toRaw ? toRaw(value) : String(value)
            };
          }, "getDefault")
        ];
      }
      __name(makeLiteralExtra, "makeLiteralExtra");
      (_a5 = def("StringLiteral").bases("Literal").build("value").field("value", String)).field.apply(_a5, makeLiteralExtra(String, function(val2) {
        return JSON.stringify(val2);
      }));
      (_b2 = def("NumericLiteral").bases("Literal").build("value").field("value", Number).field("raw", or2(String, null), defaults3["null"])).field.apply(_b2, makeLiteralExtra(Number));
      (_c3 = def("BigIntLiteral").bases("Literal").build("value").field("value", or2(String, Number))).field.apply(_c3, makeLiteralExtra(String, function(val2) {
        return val2 + "n";
      }));
      (_d2 = def("DecimalLiteral").bases("Literal").build("value").field("value", String)).field.apply(_d2, makeLiteralExtra(String, function(val2) {
        return val2 + "m";
      }));
      def("NullLiteral").bases("Literal").build().field("value", null, defaults3["null"]);
      def("BooleanLiteral").bases("Literal").build("value").field("value", Boolean);
      (_e3 = def("RegExpLiteral").bases("Literal").build("pattern", "flags").field("pattern", String).field("flags", String).field("value", RegExp, function() {
        return new RegExp(this.pattern, this.flags);
      })).field.apply(_e3, makeLiteralExtra(or2(RegExp, isUndefined), function(exp) {
        return "/".concat(exp.pattern, "/").concat(exp.flags || "");
      })).field("regex", {
        pattern: String,
        flags: String
      }, function() {
        return {
          pattern: this.pattern,
          flags: this.flags
        };
      });
      var ObjectExpressionProperty = or2(def("Property"), def("ObjectMethod"), def("ObjectProperty"), def("SpreadProperty"), def("SpreadElement"));
      def("ObjectExpression").bases("Expression").build("properties").field("properties", [ObjectExpressionProperty]);
      def("ObjectMethod").bases("Node", "Function").build("kind", "key", "params", "body", "computed").field("kind", or2("method", "get", "set")).field("key", or2(def("Literal"), def("Identifier"), def("Expression"))).field("params", [def("Pattern")]).field("body", def("BlockStatement")).field("computed", Boolean, defaults3["false"]).field("generator", Boolean, defaults3["false"]).field("async", Boolean, defaults3["false"]).field(
        "accessibility",
        // TypeScript
        or2(def("Literal"), null),
        defaults3["null"]
      ).field("decorators", or2([def("Decorator")], null), defaults3["null"]);
      def("ObjectProperty").bases("Node").build("key", "value").field("key", or2(def("Literal"), def("Identifier"), def("Expression"))).field("value", or2(def("Expression"), def("Pattern"))).field(
        "accessibility",
        // TypeScript
        or2(def("Literal"), null),
        defaults3["null"]
      ).field("computed", Boolean, defaults3["false"]);
      var ClassBodyElement = or2(def("MethodDefinition"), def("VariableDeclarator"), def("ClassPropertyDefinition"), def("ClassProperty"), def("ClassPrivateProperty"), def("ClassMethod"), def("ClassPrivateMethod"), def("ClassAccessorProperty"), def("StaticBlock"));
      def("ClassBody").bases("Declaration").build("body").field("body", [ClassBodyElement]);
      def("ClassMethod").bases("Declaration", "Function").build("kind", "key", "params", "body", "computed", "static").field("key", or2(def("Literal"), def("Identifier"), def("Expression")));
      def("ClassPrivateMethod").bases("Declaration", "Function").build("key", "params", "body", "kind", "computed", "static").field("key", def("PrivateName"));
      def("ClassAccessorProperty").bases("Declaration").build("key", "value", "decorators", "computed", "static").field("key", or2(
        def("Literal"),
        def("Identifier"),
        def("PrivateName"),
        // Only when .computed is true (TODO enforce this)
        def("Expression")
      )).field("value", or2(def("Expression"), null), defaults3["null"]);
      [
        "ClassMethod",
        "ClassPrivateMethod"
      ].forEach(function(typeName) {
        def(typeName).field("kind", or2("get", "set", "method", "constructor"), function() {
          return "method";
        }).field("body", def("BlockStatement")).field("access", or2("public", "private", "protected", null), defaults3["null"]);
      });
      [
        "ClassMethod",
        "ClassPrivateMethod",
        "ClassAccessorProperty"
      ].forEach(function(typeName) {
        def(typeName).field("computed", Boolean, defaults3["false"]).field("static", Boolean, defaults3["false"]).field("abstract", Boolean, defaults3["false"]).field("accessibility", or2("public", "private", "protected", null), defaults3["null"]).field("decorators", or2([def("Decorator")], null), defaults3["null"]).field("definite", Boolean, defaults3["false"]).field("optional", Boolean, defaults3["false"]).field("override", Boolean, defaults3["false"]).field("readonly", Boolean, defaults3["false"]);
      });
      var ObjectPatternProperty = or2(
        def("Property"),
        def("PropertyPattern"),
        def("SpreadPropertyPattern"),
        def("SpreadProperty"),
        // Used by Esprima
        def("ObjectProperty"),
        // Babel 6
        def("RestProperty"),
        // Babel 6
        def("RestElement")
      );
      def("ObjectPattern").bases("Pattern").build("properties").field("properties", [ObjectPatternProperty]).field("decorators", or2([def("Decorator")], null), defaults3["null"]);
      def("SpreadProperty").bases("Node").build("argument").field("argument", def("Expression"));
      def("RestProperty").bases("Node").build("argument").field("argument", def("Expression"));
      def("ForAwaitStatement").bases("Statement").build("left", "right", "body").field("left", or2(def("VariableDeclaration"), def("Expression"))).field("right", def("Expression")).field("body", def("Statement"));
      def("Import").bases("Expression").build();
    }
    __name(default_1, "default_1");
    exports.default = default_1;
    (0, shared_1.maybeSetModuleExports)(function() {
      return module2;
    });
  }
});

// ../../node_modules/.pnpm/ast-types@0.16.1/node_modules/ast-types/lib/def/babel.js
var require_babel = __commonJS({
  "../../node_modules/.pnpm/ast-types@0.16.1/node_modules/ast-types/lib/def/babel.js"(exports, module2) {
    init_import_meta_url();
    Object.defineProperty(exports, "__esModule", { value: true });
    var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
    var types_1 = tslib_1.__importDefault(require_types());
    var babel_core_1 = tslib_1.__importDefault(require_babel_core());
    var flow_1 = tslib_1.__importDefault(require_flow());
    var shared_1 = require_shared();
    function default_1(fork) {
      var types13 = fork.use(types_1.default);
      var def = types13.Type.def;
      fork.use(babel_core_1.default);
      fork.use(flow_1.default);
      def("V8IntrinsicIdentifier").bases("Expression").build("name").field("name", String);
      def("TopicReference").bases("Expression").build();
    }
    __name(default_1, "default_1");
    exports.default = default_1;
    (0, shared_1.maybeSetModuleExports)(function() {
      return module2;
    });
  }
});

// ../../node_modules/.pnpm/ast-types@0.16.1/node_modules/ast-types/lib/def/typescript.js
var require_typescript = __commonJS({
  "../../node_modules/.pnpm/ast-types@0.16.1/node_modules/ast-types/lib/def/typescript.js"(exports, module2) {
    init_import_meta_url();
    Object.defineProperty(exports, "__esModule", { value: true });
    var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
    var babel_core_1 = tslib_1.__importDefault(require_babel_core());
    var type_annotations_1 = tslib_1.__importDefault(require_type_annotations());
    var types_1 = tslib_1.__importDefault(require_types());
    var shared_1 = tslib_1.__importStar(require_shared());
    function default_1(fork) {
      fork.use(babel_core_1.default);
      fork.use(type_annotations_1.default);
      var types13 = fork.use(types_1.default);
      var n9 = types13.namedTypes;
      var def = types13.Type.def;
      var or2 = types13.Type.or;
      var defaults3 = fork.use(shared_1.default).defaults;
      var StringLiteral = types13.Type.from(function(value, deep) {
        if (n9.StringLiteral && n9.StringLiteral.check(value, deep)) {
          return true;
        }
        if (n9.Literal && n9.Literal.check(value, deep) && typeof value.value === "string") {
          return true;
        }
        return false;
      }, "StringLiteral");
      def("TSType").bases("Node");
      var TSEntityName = or2(def("Identifier"), def("TSQualifiedName"));
      def("TSTypeReference").bases("TSType", "TSHasOptionalTypeParameterInstantiation").build("typeName", "typeParameters").field("typeName", TSEntityName);
      def("TSHasOptionalTypeParameterInstantiation").field("typeParameters", or2(def("TSTypeParameterInstantiation"), null), defaults3["null"]);
      def("TSHasOptionalTypeParameters").field("typeParameters", or2(def("TSTypeParameterDeclaration"), null, void 0), defaults3["null"]);
      def("TSHasOptionalTypeAnnotation").field("typeAnnotation", or2(def("TSTypeAnnotation"), null), defaults3["null"]);
      def("TSQualifiedName").bases("Node").build("left", "right").field("left", TSEntityName).field("right", TSEntityName);
      def("TSAsExpression").bases("Expression", "Pattern").build("expression", "typeAnnotation").field("expression", def("Expression")).field("typeAnnotation", def("TSType")).field("extra", or2({ parenthesized: Boolean }, null), defaults3["null"]);
      def("TSTypeCastExpression").bases("Expression").build("expression", "typeAnnotation").field("expression", def("Expression")).field("typeAnnotation", def("TSType"));
      def("TSSatisfiesExpression").bases("Expression", "Pattern").build("expression", "typeAnnotation").field("expression", def("Expression")).field("typeAnnotation", def("TSType"));
      def("TSNonNullExpression").bases("Expression", "Pattern").build("expression").field("expression", def("Expression"));
      [
        "TSAnyKeyword",
        "TSBigIntKeyword",
        "TSBooleanKeyword",
        "TSNeverKeyword",
        "TSNullKeyword",
        "TSNumberKeyword",
        "TSObjectKeyword",
        "TSStringKeyword",
        "TSSymbolKeyword",
        "TSUndefinedKeyword",
        "TSUnknownKeyword",
        "TSVoidKeyword",
        "TSIntrinsicKeyword",
        "TSThisType"
      ].forEach(function(keywordType) {
        def(keywordType).bases("TSType").build();
      });
      def("TSArrayType").bases("TSType").build("elementType").field("elementType", def("TSType"));
      def("TSLiteralType").bases("TSType").build("literal").field("literal", or2(def("NumericLiteral"), def("StringLiteral"), def("BooleanLiteral"), def("TemplateLiteral"), def("UnaryExpression"), def("BigIntLiteral")));
      def("TemplateLiteral").field("expressions", or2([def("Expression")], [def("TSType")]));
      [
        "TSUnionType",
        "TSIntersectionType"
      ].forEach(function(typeName) {
        def(typeName).bases("TSType").build("types").field("types", [def("TSType")]);
      });
      def("TSConditionalType").bases("TSType").build("checkType", "extendsType", "trueType", "falseType").field("checkType", def("TSType")).field("extendsType", def("TSType")).field("trueType", def("TSType")).field("falseType", def("TSType"));
      def("TSInferType").bases("TSType").build("typeParameter").field("typeParameter", def("TSTypeParameter"));
      def("TSParenthesizedType").bases("TSType").build("typeAnnotation").field("typeAnnotation", def("TSType"));
      var ParametersType = [or2(def("Identifier"), def("RestElement"), def("ArrayPattern"), def("ObjectPattern"))];
      [
        "TSFunctionType",
        "TSConstructorType"
      ].forEach(function(typeName) {
        def(typeName).bases("TSType", "TSHasOptionalTypeParameters", "TSHasOptionalTypeAnnotation").build("parameters").field("parameters", ParametersType);
      });
      def("TSDeclareFunction").bases("Declaration", "TSHasOptionalTypeParameters").build("id", "params", "returnType").field("declare", Boolean, defaults3["false"]).field("async", Boolean, defaults3["false"]).field("generator", Boolean, defaults3["false"]).field("id", or2(def("Identifier"), null), defaults3["null"]).field("params", [def("Pattern")]).field("returnType", or2(
        def("TSTypeAnnotation"),
        def("Noop"),
        // Still used?
        null
      ), defaults3["null"]);
      def("TSDeclareMethod").bases("Declaration", "TSHasOptionalTypeParameters").build("key", "params", "returnType").field("async", Boolean, defaults3["false"]).field("generator", Boolean, defaults3["false"]).field("params", [def("Pattern")]).field("abstract", Boolean, defaults3["false"]).field("accessibility", or2("public", "private", "protected", void 0), defaults3["undefined"]).field("static", Boolean, defaults3["false"]).field("computed", Boolean, defaults3["false"]).field("optional", Boolean, defaults3["false"]).field("key", or2(
        def("Identifier"),
        def("StringLiteral"),
        def("NumericLiteral"),
        // Only allowed if .computed is true.
        def("Expression")
      )).field("kind", or2("get", "set", "method", "constructor"), /* @__PURE__ */ __name(function getDefault() {
        return "method";
      }, "getDefault")).field(
        "access",
        // Not "accessibility"?
        or2("public", "private", "protected", void 0),
        defaults3["undefined"]
      ).field("decorators", or2([def("Decorator")], null), defaults3["null"]).field("returnType", or2(
        def("TSTypeAnnotation"),
        def("Noop"),
        // Still used?
        null
      ), defaults3["null"]);
      def("TSMappedType").bases("TSType").build("typeParameter", "typeAnnotation").field("readonly", or2(Boolean, "+", "-"), defaults3["false"]).field("typeParameter", def("TSTypeParameter")).field("optional", or2(Boolean, "+", "-"), defaults3["false"]).field("typeAnnotation", or2(def("TSType"), null), defaults3["null"]);
      def("TSTupleType").bases("TSType").build("elementTypes").field("elementTypes", [or2(def("TSType"), def("TSNamedTupleMember"))]);
      def("TSNamedTupleMember").bases("TSType").build("label", "elementType", "optional").field("label", def("Identifier")).field("optional", Boolean, defaults3["false"]).field("elementType", def("TSType"));
      def("TSRestType").bases("TSType").build("typeAnnotation").field("typeAnnotation", def("TSType"));
      def("TSOptionalType").bases("TSType").build("typeAnnotation").field("typeAnnotation", def("TSType"));
      def("TSIndexedAccessType").bases("TSType").build("objectType", "indexType").field("objectType", def("TSType")).field("indexType", def("TSType"));
      def("TSTypeOperator").bases("TSType").build("operator").field("operator", String).field("typeAnnotation", def("TSType"));
      def("TSTypeAnnotation").bases("Node").build("typeAnnotation").field("typeAnnotation", or2(def("TSType"), def("TSTypeAnnotation")));
      def("TSIndexSignature").bases("Declaration", "TSHasOptionalTypeAnnotation").build("parameters", "typeAnnotation").field("parameters", [def("Identifier")]).field("readonly", Boolean, defaults3["false"]);
      def("TSPropertySignature").bases("Declaration", "TSHasOptionalTypeAnnotation").build("key", "typeAnnotation", "optional").field("key", def("Expression")).field("computed", Boolean, defaults3["false"]).field("readonly", Boolean, defaults3["false"]).field("optional", Boolean, defaults3["false"]).field("initializer", or2(def("Expression"), null), defaults3["null"]);
      def("TSMethodSignature").bases("Declaration", "TSHasOptionalTypeParameters", "TSHasOptionalTypeAnnotation").build("key", "parameters", "typeAnnotation").field("key", def("Expression")).field("computed", Boolean, defaults3["false"]).field("optional", Boolean, defaults3["false"]).field("parameters", ParametersType);
      def("TSTypePredicate").bases("TSTypeAnnotation", "TSType").build("parameterName", "typeAnnotation", "asserts").field("parameterName", or2(def("Identifier"), def("TSThisType"))).field("typeAnnotation", or2(def("TSTypeAnnotation"), null), defaults3["null"]).field("asserts", Boolean, defaults3["false"]);
      [
        "TSCallSignatureDeclaration",
        "TSConstructSignatureDeclaration"
      ].forEach(function(typeName) {
        def(typeName).bases("Declaration", "TSHasOptionalTypeParameters", "TSHasOptionalTypeAnnotation").build("parameters", "typeAnnotation").field("parameters", ParametersType);
      });
      def("TSEnumMember").bases("Node").build("id", "initializer").field("id", or2(def("Identifier"), StringLiteral)).field("initializer", or2(def("Expression"), null), defaults3["null"]);
      def("TSTypeQuery").bases("TSType").build("exprName").field("exprName", or2(TSEntityName, def("TSImportType")));
      var TSTypeMember = or2(def("TSCallSignatureDeclaration"), def("TSConstructSignatureDeclaration"), def("TSIndexSignature"), def("TSMethodSignature"), def("TSPropertySignature"));
      def("TSTypeLiteral").bases("TSType").build("members").field("members", [TSTypeMember]);
      def("TSTypeParameter").bases("Identifier").build("name", "constraint", "default").field("name", or2(def("Identifier"), String)).field("constraint", or2(def("TSType"), void 0), defaults3["undefined"]).field("default", or2(def("TSType"), void 0), defaults3["undefined"]);
      def("TSTypeAssertion").bases("Expression", "Pattern").build("typeAnnotation", "expression").field("typeAnnotation", def("TSType")).field("expression", def("Expression")).field("extra", or2({ parenthesized: Boolean }, null), defaults3["null"]);
      def("TSTypeParameterDeclaration").bases("Declaration").build("params").field("params", [def("TSTypeParameter")]);
      def("TSInstantiationExpression").bases("Expression", "TSHasOptionalTypeParameterInstantiation").build("expression", "typeParameters").field("expression", def("Expression"));
      def("TSTypeParameterInstantiation").bases("Node").build("params").field("params", [def("TSType")]);
      def("TSEnumDeclaration").bases("Declaration").build("id", "members").field("id", def("Identifier")).field("const", Boolean, defaults3["false"]).field("declare", Boolean, defaults3["false"]).field("members", [def("TSEnumMember")]).field("initializer", or2(def("Expression"), null), defaults3["null"]);
      def("TSTypeAliasDeclaration").bases("Declaration", "TSHasOptionalTypeParameters").build("id", "typeAnnotation").field("id", def("Identifier")).field("declare", Boolean, defaults3["false"]).field("typeAnnotation", def("TSType"));
      def("TSModuleBlock").bases("Node").build("body").field("body", [def("Statement")]);
      def("TSModuleDeclaration").bases("Declaration").build("id", "body").field("id", or2(StringLiteral, TSEntityName)).field("declare", Boolean, defaults3["false"]).field("global", Boolean, defaults3["false"]).field("body", or2(def("TSModuleBlock"), def("TSModuleDeclaration"), null), defaults3["null"]);
      def("TSImportType").bases("TSType", "TSHasOptionalTypeParameterInstantiation").build("argument", "qualifier", "typeParameters").field("argument", StringLiteral).field("qualifier", or2(TSEntityName, void 0), defaults3["undefined"]);
      def("TSImportEqualsDeclaration").bases("Declaration").build("id", "moduleReference").field("id", def("Identifier")).field("isExport", Boolean, defaults3["false"]).field("moduleReference", or2(TSEntityName, def("TSExternalModuleReference")));
      def("TSExternalModuleReference").bases("Declaration").build("expression").field("expression", StringLiteral);
      def("TSExportAssignment").bases("Statement").build("expression").field("expression", def("Expression"));
      def("TSNamespaceExportDeclaration").bases("Declaration").build("id").field("id", def("Identifier"));
      def("TSInterfaceBody").bases("Node").build("body").field("body", [TSTypeMember]);
      def("TSExpressionWithTypeArguments").bases("TSType", "TSHasOptionalTypeParameterInstantiation").build("expression", "typeParameters").field("expression", TSEntityName);
      def("TSInterfaceDeclaration").bases("Declaration", "TSHasOptionalTypeParameters").build("id", "body").field("id", TSEntityName).field("declare", Boolean, defaults3["false"]).field("extends", or2([def("TSExpressionWithTypeArguments")], null), defaults3["null"]).field("body", def("TSInterfaceBody"));
      def("TSParameterProperty").bases("Pattern").build("parameter").field("accessibility", or2("public", "private", "protected", void 0), defaults3["undefined"]).field("readonly", Boolean, defaults3["false"]).field("parameter", or2(def("Identifier"), def("AssignmentPattern")));
      def("ClassProperty").field(
        "access",
        // Not "accessibility"?
        or2("public", "private", "protected", void 0),
        defaults3["undefined"]
      );
      def("ClassAccessorProperty").bases("Declaration", "TSHasOptionalTypeAnnotation");
      def("ClassBody").field("body", [or2(
        def("MethodDefinition"),
        def("VariableDeclarator"),
        def("ClassPropertyDefinition"),
        def("ClassProperty"),
        def("ClassPrivateProperty"),
        def("ClassAccessorProperty"),
        def("ClassMethod"),
        def("ClassPrivateMethod"),
        def("StaticBlock"),
        // Just need to add these types:
        def("TSDeclareMethod"),
        TSTypeMember
      )]);
    }
    __name(default_1, "default_1");
    exports.default = default_1;
    (0, shared_1.maybeSetModuleExports)(function() {
      return module2;
    });
  }
});

// ../../node_modules/.pnpm/ast-types@0.16.1/node_modules/ast-types/lib/gen/namedTypes.js
var require_namedTypes = __commonJS({
  "../../node_modules/.pnpm/ast-types@0.16.1/node_modules/ast-types/lib/gen/namedTypes.js"(exports) {
    init_import_meta_url();
    Object.defineProperty(exports, "__esModule", { value: true });
    exports.namedTypes = void 0;
    /* @__PURE__ */ (function(namedTypes2) {
    })(exports.namedTypes || (exports.namedTypes = {}));
  }
});

// ../../node_modules/.pnpm/ast-types@0.16.1/node_modules/ast-types/lib/main.js
var require_main3 = __commonJS({
  "../../node_modules/.pnpm/ast-types@0.16.1/node_modules/ast-types/lib/main.js"(exports) {
    init_import_meta_url();
    Object.defineProperty(exports, "__esModule", { value: true });
    exports.visit = exports.use = exports.Type = exports.someField = exports.PathVisitor = exports.Path = exports.NodePath = exports.namedTypes = exports.getSupertypeNames = exports.getFieldValue = exports.getFieldNames = exports.getBuilderName = exports.finalize = exports.eachField = exports.defineMethod = exports.builtInTypes = exports.builders = exports.astNodesAreEquivalent = void 0;
    var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
    var fork_1 = tslib_1.__importDefault(require_fork());
    var es_proposals_1 = tslib_1.__importDefault(require_es_proposals());
    var jsx_1 = tslib_1.__importDefault(require_jsx());
    var flow_1 = tslib_1.__importDefault(require_flow());
    var esprima_1 = tslib_1.__importDefault(require_esprima());
    var babel_1 = tslib_1.__importDefault(require_babel());
    var typescript_1 = tslib_1.__importDefault(require_typescript());
    var namedTypes_1 = require_namedTypes();
    Object.defineProperty(exports, "namedTypes", { enumerable: true, get: /* @__PURE__ */ __name(function() {
      return namedTypes_1.namedTypes;
    }, "get") });
    var _a5 = (0, fork_1.default)([
      // Feel free to add to or remove from this list of extension modules to
      // configure the precise type hierarchy that you need.
      es_proposals_1.default,
      jsx_1.default,
      flow_1.default,
      esprima_1.default,
      babel_1.default,
      typescript_1.default
    ]);
    var astNodesAreEquivalent = _a5.astNodesAreEquivalent;
    var builders = _a5.builders;
    var builtInTypes = _a5.builtInTypes;
    var defineMethod = _a5.defineMethod;
    var eachField = _a5.eachField;
    var finalize = _a5.finalize;
    var getBuilderName = _a5.getBuilderName;
    var getFieldNames = _a5.getFieldNames;
    var getFieldValue = _a5.getFieldValue;
    var getSupertypeNames = _a5.getSupertypeNames;
    var n9 = _a5.namedTypes;
    var NodePath = _a5.NodePath;
    var Path = _a5.Path;
    var PathVisitor = _a5.PathVisitor;
    var someField = _a5.someField;
    var Type2 = _a5.Type;
    var use = _a5.use;
    var visit5 = _a5.visit;
    exports.astNodesAreEquivalent = astNodesAreEquivalent;
    exports.builders = builders;
    exports.builtInTypes = builtInTypes;
    exports.defineMethod = defineMethod;
    exports.eachField = eachField;
    exports.finalize = finalize;
    exports.getBuilderName = getBuilderName;
    exports.getFieldNames = getFieldNames;
    exports.getFieldValue = getFieldValue;
    exports.getSupertypeNames = getSupertypeNames;
    exports.NodePath = NodePath;
    exports.Path = Path;
    exports.PathVisitor = PathVisitor;
    exports.someField = someField;
    exports.Type = Type2;
    exports.use = use;
    exports.visit = visit5;
    Object.assign(namedTypes_1.namedTypes, n9);
  }
});

// ../../node_modules/.pnpm/tiny-invariant@1.3.3/node_modules/tiny-invariant/dist/tiny-invariant.cjs.js
var require_tiny_invariant_cjs = __commonJS({
  "../../node_modules/.pnpm/tiny-invariant@1.3.3/node_modules/tiny-invariant/dist/tiny-invariant.cjs.js"(exports, module2) {
    init_import_meta_url();
    var prefix = "Invariant failed";
    function invariant(condition, message) {
      if (condition) {
        return;
      }
      {
        throw new Error(prefix);
      }
    }
    __name(invariant, "invariant");
    module2.exports = invariant;
  }
});

// ../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/base64.js
var require_base642 = __commonJS({
  "../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/base64.js"(exports) {
    init_import_meta_url();
    var intToCharMap = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");
    exports.encode = function(number) {
      if (0 <= number && number < intToCharMap.length) {
        return intToCharMap[number];
      }
      throw new TypeError("Must be between 0 and 63: " + number);
    };
    exports.decode = function(charCode) {
      var bigA = 65;
      var bigZ = 90;
      var littleA = 97;
      var littleZ = 122;
      var zero = 48;
      var nine = 57;
      var plus = 43;
      var slash = 47;
      var littleOffset = 26;
      var numberOffset = 52;
      if (bigA <= charCode && charCode <= bigZ) {
        return charCode - bigA;
      }
      if (littleA <= charCode && charCode <= littleZ) {
        return charCode - littleA + littleOffset;
      }
      if (zero <= charCode && charCode <= nine) {
        return charCode - zero + numberOffset;
      }
      if (charCode == plus) {
        return 62;
      }
      if (charCode == slash) {
        return 63;
      }
      return -1;
    };
  }
});

// ../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/base64-vlq.js
var require_base64_vlq = __commonJS({
  "../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/base64-vlq.js"(exports) {
    init_import_meta_url();
    var base642 = require_base642();
    var VLQ_BASE_SHIFT = 5;
    var VLQ_BASE = 1 << VLQ_BASE_SHIFT;
    var VLQ_BASE_MASK = VLQ_BASE - 1;
    var VLQ_CONTINUATION_BIT = VLQ_BASE;
    function toVLQSigned(aValue) {
      return aValue < 0 ? (-aValue << 1) + 1 : (aValue << 1) + 0;
    }
    __name(toVLQSigned, "toVLQSigned");
    function fromVLQSigned(aValue) {
      var isNegative = (aValue & 1) === 1;
      var shifted = aValue >> 1;
      return isNegative ? -shifted : shifted;
    }
    __name(fromVLQSigned, "fromVLQSigned");
    exports.encode = /* @__PURE__ */ __name(function base64VLQ_encode(aValue) {
      var encoded = "";
      var digit;
      var vlq = toVLQSigned(aValue);
      do {
        digit = vlq & VLQ_BASE_MASK;
        vlq >>>= VLQ_BASE_SHIFT;
        if (vlq > 0) {
          digit |= VLQ_CONTINUATION_BIT;
        }
        encoded += base642.encode(digit);
      } while (vlq > 0);
      return encoded;
    }, "base64VLQ_encode");
    exports.decode = /* @__PURE__ */ __name(function base64VLQ_decode(aStr, aIndex, aOutParam) {
      var strLen = aStr.length;
      var result = 0;
      var shift = 0;
      var continuation, digit;
      do {
        if (aIndex >= strLen) {
          throw new Error("Expected more digits in base 64 VLQ value.");
        }
        digit = base642.decode(aStr.charCodeAt(aIndex++));
        if (digit === -1) {
          throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1));
        }
        continuation = !!(digit & VLQ_CONTINUATION_BIT);
        digit &= VLQ_BASE_MASK;
        result = result + (digit << shift);
        shift += VLQ_BASE_SHIFT;
      } while (continuation);
      aOutParam.value = fromVLQSigned(result);
      aOutParam.rest = aIndex;
    }, "base64VLQ_decode");
  }
});

// ../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/util.js
var require_util9 = __commonJS({
  "../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/util.js"(exports) {
    init_import_meta_url();
    function getArg(aArgs, aName, aDefaultValue) {
      if (aName in aArgs) {
        return aArgs[aName];
      } else if (arguments.length === 3) {
        return aDefaultValue;
      } else {
        throw new Error('"' + aName + '" is a required argument.');
      }
    }
    __name(getArg, "getArg");
    exports.getArg = getArg;
    var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/;
    var dataUrlRegexp = /^data:.+\,.+$/;
    function urlParse(aUrl) {
      var match3 = aUrl.match(urlRegexp);
      if (!match3) {
        return null;
      }
      return {
        scheme: match3[1],
        auth: match3[2],
        host: match3[3],
        port: match3[4],
        path: match3[5]
      };
    }
    __name(urlParse, "urlParse");
    exports.urlParse = urlParse;
    function urlGenerate(aParsedUrl) {
      var url4 = "";
      if (aParsedUrl.scheme) {
        url4 += aParsedUrl.scheme + ":";
      }
      url4 += "//";
      if (aParsedUrl.auth) {
        url4 += aParsedUrl.auth + "@";
      }
      if (aParsedUrl.host) {
        url4 += aParsedUrl.host;
      }
      if (aParsedUrl.port) {
        url4 += ":" + aParsedUrl.port;
      }
      if (aParsedUrl.path) {
        url4 += aParsedUrl.path;
      }
      return url4;
    }
    __name(urlGenerate, "urlGenerate");
    exports.urlGenerate = urlGenerate;
    function normalize6(aPath) {
      var path84 = aPath;
      var url4 = urlParse(aPath);
      if (url4) {
        if (!url4.path) {
          return aPath;
        }
        path84 = url4.path;
      }
      var isAbsolute6 = exports.isAbsolute(path84);
      var parts = path84.split(/\/+/);
      for (var part, up3 = 0, i7 = parts.length - 1; i7 >= 0; i7--) {
        part = parts[i7];
        if (part === ".") {
          parts.splice(i7, 1);
        } else if (part === "..") {
          up3++;
        } else if (up3 > 0) {
          if (part === "") {
            parts.splice(i7 + 1, up3);
            up3 = 0;
          } else {
            parts.splice(i7, 2);
            up3--;
          }
        }
      }
      path84 = parts.join("/");
      if (path84 === "") {
        path84 = isAbsolute6 ? "/" : ".";
      }
      if (url4) {
        url4.path = path84;
        return urlGenerate(url4);
      }
      return path84;
    }
    __name(normalize6, "normalize");
    exports.normalize = normalize6;
    function join36(aRoot, aPath) {
      if (aRoot === "") {
        aRoot = ".";
      }
      if (aPath === "") {
        aPath = ".";
      }
      var aPathUrl = urlParse(aPath);
      var aRootUrl = urlParse(aRoot);
      if (aRootUrl) {
        aRoot = aRootUrl.path || "/";
      }
      if (aPathUrl && !aPathUrl.scheme) {
        if (aRootUrl) {
          aPathUrl.scheme = aRootUrl.scheme;
        }
        return urlGenerate(aPathUrl);
      }
      if (aPathUrl || aPath.match(dataUrlRegexp)) {
        return aPath;
      }
      if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {
        aRootUrl.host = aPath;
        return urlGenerate(aRootUrl);
      }
      var joined = aPath.charAt(0) === "/" ? aPath : normalize6(aRoot.replace(/\/+$/, "") + "/" + aPath);
      if (aRootUrl) {
        aRootUrl.path = joined;
        return urlGenerate(aRootUrl);
      }
      return joined;
    }
    __name(join36, "join");
    exports.join = join36;
    exports.isAbsolute = function(aPath) {
      return aPath.charAt(0) === "/" || urlRegexp.test(aPath);
    };
    function relative16(aRoot, aPath) {
      if (aRoot === "") {
        aRoot = ".";
      }
      aRoot = aRoot.replace(/\/$/, "");
      var level = 0;
      while (aPath.indexOf(aRoot + "/") !== 0) {
        var index = aRoot.lastIndexOf("/");
        if (index < 0) {
          return aPath;
        }
        aRoot = aRoot.slice(0, index);
        if (aRoot.match(/^([^\/]+:\/)?\/*$/)) {
          return aPath;
        }
        ++level;
      }
      return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1);
    }
    __name(relative16, "relative");
    exports.relative = relative16;
    var supportsNullProto = function() {
      var obj = /* @__PURE__ */ Object.create(null);
      return !("__proto__" in obj);
    }();
    function identity(s7) {
      return s7;
    }
    __name(identity, "identity");
    function toSetString(aStr) {
      if (isProtoString(aStr)) {
        return "$" + aStr;
      }
      return aStr;
    }
    __name(toSetString, "toSetString");
    exports.toSetString = supportsNullProto ? identity : toSetString;
    function fromSetString(aStr) {
      if (isProtoString(aStr)) {
        return aStr.slice(1);
      }
      return aStr;
    }
    __name(fromSetString, "fromSetString");
    exports.fromSetString = supportsNullProto ? identity : fromSetString;
    function isProtoString(s7) {
      if (!s7) {
        return false;
      }
      var length = s7.length;
      if (length < 9) {
        return false;
      }
      if (s7.charCodeAt(length - 1) !== 95 || s7.charCodeAt(length - 2) !== 95 || s7.charCodeAt(length - 3) !== 111 || s7.charCodeAt(length - 4) !== 116 || s7.charCodeAt(length - 5) !== 111 || s7.charCodeAt(length - 6) !== 114 || s7.charCodeAt(length - 7) !== 112 || s7.charCodeAt(length - 8) !== 95 || s7.charCodeAt(length - 9) !== 95) {
        return false;
      }
      for (var i7 = length - 10; i7 >= 0; i7--) {
        if (s7.charCodeAt(i7) !== 36) {
          return false;
        }
      }
      return true;
    }
    __name(isProtoString, "isProtoString");
    function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {
      var cmp = strcmp(mappingA.source, mappingB.source);
      if (cmp !== 0) {
        return cmp;
      }
      cmp = mappingA.originalLine - mappingB.originalLine;
      if (cmp !== 0) {
        return cmp;
      }
      cmp = mappingA.originalColumn - mappingB.originalColumn;
      if (cmp !== 0 || onlyCompareOriginal) {
        return cmp;
      }
      cmp = mappingA.generatedColumn - mappingB.generatedColumn;
      if (cmp !== 0) {
        return cmp;
      }
      cmp = mappingA.generatedLine - mappingB.generatedLine;
      if (cmp !== 0) {
        return cmp;
      }
      return strcmp(mappingA.name, mappingB.name);
    }
    __name(compareByOriginalPositions, "compareByOriginalPositions");
    exports.compareByOriginalPositions = compareByOriginalPositions;
    function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {
      var cmp = mappingA.generatedLine - mappingB.generatedLine;
      if (cmp !== 0) {
        return cmp;
      }
      cmp = mappingA.generatedColumn - mappingB.generatedColumn;
      if (cmp !== 0 || onlyCompareGenerated) {
        return cmp;
      }
      cmp = strcmp(mappingA.source, mappingB.source);
      if (cmp !== 0) {
        return cmp;
      }
      cmp = mappingA.originalLine - mappingB.originalLine;
      if (cmp !== 0) {
        return cmp;
      }
      cmp = mappingA.originalColumn - mappingB.originalColumn;
      if (cmp !== 0) {
        return cmp;
      }
      return strcmp(mappingA.name, mappingB.name);
    }
    __name(compareByGeneratedPositionsDeflated, "compareByGeneratedPositionsDeflated");
    exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;
    function strcmp(aStr1, aStr2) {
      if (aStr1 === aStr2) {
        return 0;
      }
      if (aStr1 === null) {
        return 1;
      }
      if (aStr2 === null) {
        return -1;
      }
      if (aStr1 > aStr2) {
        return 1;
      }
      return -1;
    }
    __name(strcmp, "strcmp");
    function compareByGeneratedPositionsInflated(mappingA, mappingB) {
      var cmp = mappingA.generatedLine - mappingB.generatedLine;
      if (cmp !== 0) {
        return cmp;
      }
      cmp = mappingA.generatedColumn - mappingB.generatedColumn;
      if (cmp !== 0) {
        return cmp;
      }
      cmp = strcmp(mappingA.source, mappingB.source);
      if (cmp !== 0) {
        return cmp;
      }
      cmp = mappingA.originalLine - mappingB.originalLine;
      if (cmp !== 0) {
        return cmp;
      }
      cmp = mappingA.originalColumn - mappingB.originalColumn;
      if (cmp !== 0) {
        return cmp;
      }
      return strcmp(mappingA.name, mappingB.name);
    }
    __name(compareByGeneratedPositionsInflated, "compareByGeneratedPositionsInflated");
    exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;
    function parseSourceMapInput(str) {
      return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, ""));
    }
    __name(parseSourceMapInput, "parseSourceMapInput");
    exports.parseSourceMapInput = parseSourceMapInput;
    function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) {
      sourceURL = sourceURL || "";
      if (sourceRoot) {
        if (sourceRoot[sourceRoot.length - 1] !== "/" && sourceURL[0] !== "/") {
          sourceRoot += "/";
        }
        sourceURL = sourceRoot + sourceURL;
      }
      if (sourceMapURL) {
        var parsed = urlParse(sourceMapURL);
        if (!parsed) {
          throw new Error("sourceMapURL could not be parsed");
        }
        if (parsed.path) {
          var index = parsed.path.lastIndexOf("/");
          if (index >= 0) {
            parsed.path = parsed.path.substring(0, index + 1);
          }
        }
        sourceURL = join36(urlGenerate(parsed), sourceURL);
      }
      return normalize6(sourceURL);
    }
    __name(computeSourceURL, "computeSourceURL");
    exports.computeSourceURL = computeSourceURL;
  }
});

// ../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/array-set.js
var require_array_set = __commonJS({
  "../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/array-set.js"(exports) {
    init_import_meta_url();
    var util5 = require_util9();
    var has2 = Object.prototype.hasOwnProperty;
    var hasNativeMap = typeof Map !== "undefined";
    function ArraySet() {
      this._array = [];
      this._set = hasNativeMap ? /* @__PURE__ */ new Map() : /* @__PURE__ */ Object.create(null);
    }
    __name(ArraySet, "ArraySet");
    ArraySet.fromArray = /* @__PURE__ */ __name(function ArraySet_fromArray(aArray, aAllowDuplicates) {
      var set = new ArraySet();
      for (var i7 = 0, len = aArray.length; i7 < len; i7++) {
        set.add(aArray[i7], aAllowDuplicates);
      }
      return set;
    }, "ArraySet_fromArray");
    ArraySet.prototype.size = /* @__PURE__ */ __name(function ArraySet_size() {
      return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length;
    }, "ArraySet_size");
    ArraySet.prototype.add = /* @__PURE__ */ __name(function ArraySet_add(aStr, aAllowDuplicates) {
      var sStr = hasNativeMap ? aStr : util5.toSetString(aStr);
      var isDuplicate = hasNativeMap ? this.has(aStr) : has2.call(this._set, sStr);
      var idx = this._array.length;
      if (!isDuplicate || aAllowDuplicates) {
        this._array.push(aStr);
      }
      if (!isDuplicate) {
        if (hasNativeMap) {
          this._set.set(aStr, idx);
        } else {
          this._set[sStr] = idx;
        }
      }
    }, "ArraySet_add");
    ArraySet.prototype.has = /* @__PURE__ */ __name(function ArraySet_has(aStr) {
      if (hasNativeMap) {
        return this._set.has(aStr);
      } else {
        var sStr = util5.toSetString(aStr);
        return has2.call(this._set, sStr);
      }
    }, "ArraySet_has");
    ArraySet.prototype.indexOf = /* @__PURE__ */ __name(function ArraySet_indexOf(aStr) {
      if (hasNativeMap) {
        var idx = this._set.get(aStr);
        if (idx >= 0) {
          return idx;
        }
      } else {
        var sStr = util5.toSetString(aStr);
        if (has2.call(this._set, sStr)) {
          return this._set[sStr];
        }
      }
      throw new Error('"' + aStr + '" is not in the set.');
    }, "ArraySet_indexOf");
    ArraySet.prototype.at = /* @__PURE__ */ __name(function ArraySet_at(aIdx) {
      if (aIdx >= 0 && aIdx < this._array.length) {
        return this._array[aIdx];
      }
      throw new Error("No element indexed by " + aIdx);
    }, "ArraySet_at");
    ArraySet.prototype.toArray = /* @__PURE__ */ __name(function ArraySet_toArray() {
      return this._array.slice();
    }, "ArraySet_toArray");
    exports.ArraySet = ArraySet;
  }
});

// ../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/mapping-list.js
var require_mapping_list = __commonJS({
  "../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/mapping-list.js"(exports) {
    init_import_meta_url();
    var util5 = require_util9();
    function generatedPositionAfter(mappingA, mappingB) {
      var lineA = mappingA.generatedLine;
      var lineB = mappingB.generatedLine;
      var columnA = mappingA.generatedColumn;
      var columnB = mappingB.generatedColumn;
      return lineB > lineA || lineB == lineA && columnB >= columnA || util5.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;
    }
    __name(generatedPositionAfter, "generatedPositionAfter");
    function MappingList() {
      this._array = [];
      this._sorted = true;
      this._last = { generatedLine: -1, generatedColumn: 0 };
    }
    __name(MappingList, "MappingList");
    MappingList.prototype.unsortedForEach = /* @__PURE__ */ __name(function MappingList_forEach(aCallback, aThisArg) {
      this._array.forEach(aCallback, aThisArg);
    }, "MappingList_forEach");
    MappingList.prototype.add = /* @__PURE__ */ __name(function MappingList_add(aMapping) {
      if (generatedPositionAfter(this._last, aMapping)) {
        this._last = aMapping;
        this._array.push(aMapping);
      } else {
        this._sorted = false;
        this._array.push(aMapping);
      }
    }, "MappingList_add");
    MappingList.prototype.toArray = /* @__PURE__ */ __name(function MappingList_toArray() {
      if (!this._sorted) {
        this._array.sort(util5.compareByGeneratedPositionsInflated);
        this._sorted = true;
      }
      return this._array;
    }, "MappingList_toArray");
    exports.MappingList = MappingList;
  }
});

// ../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/source-map-generator.js
var require_source_map_generator = __commonJS({
  "../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/source-map-generator.js"(exports) {
    init_import_meta_url();
    var base64VLQ = require_base64_vlq();
    var util5 = require_util9();
    var ArraySet = require_array_set().ArraySet;
    var MappingList = require_mapping_list().MappingList;
    function SourceMapGenerator(aArgs) {
      if (!aArgs) {
        aArgs = {};
      }
      this._file = util5.getArg(aArgs, "file", null);
      this._sourceRoot = util5.getArg(aArgs, "sourceRoot", null);
      this._skipValidation = util5.getArg(aArgs, "skipValidation", false);
      this._sources = new ArraySet();
      this._names = new ArraySet();
      this._mappings = new MappingList();
      this._sourcesContents = null;
    }
    __name(SourceMapGenerator, "SourceMapGenerator");
    SourceMapGenerator.prototype._version = 3;
    SourceMapGenerator.fromSourceMap = /* @__PURE__ */ __name(function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) {
      var sourceRoot = aSourceMapConsumer.sourceRoot;
      var generator = new SourceMapGenerator({
        file: aSourceMapConsumer.file,
        sourceRoot
      });
      aSourceMapConsumer.eachMapping(function(mapping) {
        var newMapping = {
          generated: {
            line: mapping.generatedLine,
            column: mapping.generatedColumn
          }
        };
        if (mapping.source != null) {
          newMapping.source = mapping.source;
          if (sourceRoot != null) {
            newMapping.source = util5.relative(sourceRoot, newMapping.source);
          }
          newMapping.original = {
            line: mapping.originalLine,
            column: mapping.originalColumn
          };
          if (mapping.name != null) {
            newMapping.name = mapping.name;
          }
        }
        generator.addMapping(newMapping);
      });
      aSourceMapConsumer.sources.forEach(function(sourceFile) {
        var sourceRelative = sourceFile;
        if (sourceRoot !== null) {
          sourceRelative = util5.relative(sourceRoot, sourceFile);
        }
        if (!generator._sources.has(sourceRelative)) {
          generator._sources.add(sourceRelative);
        }
        var content = aSourceMapConsumer.sourceContentFor(sourceFile);
        if (content != null) {
          generator.setSourceContent(sourceFile, content);
        }
      });
      return generator;
    }, "SourceMapGenerator_fromSourceMap");
    SourceMapGenerator.prototype.addMapping = /* @__PURE__ */ __name(function SourceMapGenerator_addMapping(aArgs) {
      var generated = util5.getArg(aArgs, "generated");
      var original = util5.getArg(aArgs, "original", null);
      var source = util5.getArg(aArgs, "source", null);
      var name2 = util5.getArg(aArgs, "name", null);
      if (!this._skipValidation) {
        this._validateMapping(generated, original, source, name2);
      }
      if (source != null) {
        source = String(source);
        if (!this._sources.has(source)) {
          this._sources.add(source);
        }
      }
      if (name2 != null) {
        name2 = String(name2);
        if (!this._names.has(name2)) {
          this._names.add(name2);
        }
      }
      this._mappings.add({
        generatedLine: generated.line,
        generatedColumn: generated.column,
        originalLine: original != null && original.line,
        originalColumn: original != null && original.column,
        source,
        name: name2
      });
    }, "SourceMapGenerator_addMapping");
    SourceMapGenerator.prototype.setSourceContent = /* @__PURE__ */ __name(function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {
      var source = aSourceFile;
      if (this._sourceRoot != null) {
        source = util5.relative(this._sourceRoot, source);
      }
      if (aSourceContent != null) {
        if (!this._sourcesContents) {
          this._sourcesContents = /* @__PURE__ */ Object.create(null);
        }
        this._sourcesContents[util5.toSetString(source)] = aSourceContent;
      } else if (this._sourcesContents) {
        delete this._sourcesContents[util5.toSetString(source)];
        if (Object.keys(this._sourcesContents).length === 0) {
          this._sourcesContents = null;
        }
      }
    }, "SourceMapGenerator_setSourceContent");
    SourceMapGenerator.prototype.applySourceMap = /* @__PURE__ */ __name(function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {
      var sourceFile = aSourceFile;
      if (aSourceFile == null) {
        if (aSourceMapConsumer.file == null) {
          throw new Error(
            `SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`
          );
        }
        sourceFile = aSourceMapConsumer.file;
      }
      var sourceRoot = this._sourceRoot;
      if (sourceRoot != null) {
        sourceFile = util5.relative(sourceRoot, sourceFile);
      }
      var newSources = new ArraySet();
      var newNames = new ArraySet();
      this._mappings.unsortedForEach(function(mapping) {
        if (mapping.source === sourceFile && mapping.originalLine != null) {
          var original = aSourceMapConsumer.originalPositionFor({
            line: mapping.originalLine,
            column: mapping.originalColumn
          });
          if (original.source != null) {
            mapping.source = original.source;
            if (aSourceMapPath != null) {
              mapping.source = util5.join(aSourceMapPath, mapping.source);
            }
            if (sourceRoot != null) {
              mapping.source = util5.relative(sourceRoot, mapping.source);
            }
            mapping.originalLine = original.line;
            mapping.originalColumn = original.column;
            if (original.name != null) {
              mapping.name = original.name;
            }
          }
        }
        var source = mapping.source;
        if (source != null && !newSources.has(source)) {
          newSources.add(source);
        }
        var name2 = mapping.name;
        if (name2 != null && !newNames.has(name2)) {
          newNames.add(name2);
        }
      }, this);
      this._sources = newSources;
      this._names = newNames;
      aSourceMapConsumer.sources.forEach(function(sourceFile2) {
        var content = aSourceMapConsumer.sourceContentFor(sourceFile2);
        if (content != null) {
          if (aSourceMapPath != null) {
            sourceFile2 = util5.join(aSourceMapPath, sourceFile2);
          }
          if (sourceRoot != null) {
            sourceFile2 = util5.relative(sourceRoot, sourceFile2);
          }
          this.setSourceContent(sourceFile2, content);
        }
      }, this);
    }, "SourceMapGenerator_applySourceMap");
    SourceMapGenerator.prototype._validateMapping = /* @__PURE__ */ __name(function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, aName) {
      if (aOriginal && typeof aOriginal.line !== "number" && typeof aOriginal.column !== "number") {
        throw new Error(
          "original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values."
        );
      }
      if (aGenerated && "line" in aGenerated && "column" in aGenerated && aGenerated.line > 0 && aGenerated.column >= 0 && !aOriginal && !aSource && !aName) {
        return;
      } else if (aGenerated && "line" in aGenerated && "column" in aGenerated && aOriginal && "line" in aOriginal && "column" in aOriginal && aGenerated.line > 0 && aGenerated.column >= 0 && aOriginal.line > 0 && aOriginal.column >= 0 && aSource) {
        return;
      } else {
        throw new Error("Invalid mapping: " + JSON.stringify({
          generated: aGenerated,
          source: aSource,
          original: aOriginal,
          name: aName
        }));
      }
    }, "SourceMapGenerator_validateMapping");
    SourceMapGenerator.prototype._serializeMappings = /* @__PURE__ */ __name(function SourceMapGenerator_serializeMappings() {
      var previousGeneratedColumn = 0;
      var previousGeneratedLine = 1;
      var previousOriginalColumn = 0;
      var previousOriginalLine = 0;
      var previousName = 0;
      var previousSource = 0;
      var result = "";
      var next;
      var mapping;
      var nameIdx;
      var sourceIdx;
      var mappings = this._mappings.toArray();
      for (var i7 = 0, len = mappings.length; i7 < len; i7++) {
        mapping = mappings[i7];
        next = "";
        if (mapping.generatedLine !== previousGeneratedLine) {
          previousGeneratedColumn = 0;
          while (mapping.generatedLine !== previousGeneratedLine) {
            next += ";";
            previousGeneratedLine++;
          }
        } else {
          if (i7 > 0) {
            if (!util5.compareByGeneratedPositionsInflated(mapping, mappings[i7 - 1])) {
              continue;
            }
            next += ",";
          }
        }
        next += base64VLQ.encode(mapping.generatedColumn - previousGeneratedColumn);
        previousGeneratedColumn = mapping.generatedColumn;
        if (mapping.source != null) {
          sourceIdx = this._sources.indexOf(mapping.source);
          next += base64VLQ.encode(sourceIdx - previousSource);
          previousSource = sourceIdx;
          next += base64VLQ.encode(mapping.originalLine - 1 - previousOriginalLine);
          previousOriginalLine = mapping.originalLine - 1;
          next += base64VLQ.encode(mapping.originalColumn - previousOriginalColumn);
          previousOriginalColumn = mapping.originalColumn;
          if (mapping.name != null) {
            nameIdx = this._names.indexOf(mapping.name);
            next += base64VLQ.encode(nameIdx - previousName);
            previousName = nameIdx;
          }
        }
        result += next;
      }
      return result;
    }, "SourceMapGenerator_serializeMappings");
    SourceMapGenerator.prototype._generateSourcesContent = /* @__PURE__ */ __name(function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {
      return aSources.map(function(source) {
        if (!this._sourcesContents) {
          return null;
        }
        if (aSourceRoot != null) {
          source = util5.relative(aSourceRoot, source);
        }
        var key = util5.toSetString(source);
        return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) ? this._sourcesContents[key] : null;
      }, this);
    }, "SourceMapGenerator_generateSourcesContent");
    SourceMapGenerator.prototype.toJSON = /* @__PURE__ */ __name(function SourceMapGenerator_toJSON() {
      var map2 = {
        version: this._version,
        sources: this._sources.toArray(),
        names: this._names.toArray(),
        mappings: this._serializeMappings()
      };
      if (this._file != null) {
        map2.file = this._file;
      }
      if (this._sourceRoot != null) {
        map2.sourceRoot = this._sourceRoot;
      }
      if (this._sourcesContents) {
        map2.sourcesContent = this._generateSourcesContent(map2.sources, map2.sourceRoot);
      }
      return map2;
    }, "SourceMapGenerator_toJSON");
    SourceMapGenerator.prototype.toString = /* @__PURE__ */ __name(function SourceMapGenerator_toString() {
      return JSON.stringify(this.toJSON());
    }, "SourceMapGenerator_toString");
    exports.SourceMapGenerator = SourceMapGenerator;
  }
});

// ../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/binary-search.js
var require_binary_search = __commonJS({
  "../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/binary-search.js"(exports) {
    init_import_meta_url();
    exports.GREATEST_LOWER_BOUND = 1;
    exports.LEAST_UPPER_BOUND = 2;
    function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {
      var mid = Math.floor((aHigh - aLow) / 2) + aLow;
      var cmp = aCompare(aNeedle, aHaystack[mid], true);
      if (cmp === 0) {
        return mid;
      } else if (cmp > 0) {
        if (aHigh - mid > 1) {
          return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);
        }
        if (aBias == exports.LEAST_UPPER_BOUND) {
          return aHigh < aHaystack.length ? aHigh : -1;
        } else {
          return mid;
        }
      } else {
        if (mid - aLow > 1) {
          return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);
        }
        if (aBias == exports.LEAST_UPPER_BOUND) {
          return mid;
        } else {
          return aLow < 0 ? -1 : aLow;
        }
      }
    }
    __name(recursiveSearch, "recursiveSearch");
    exports.search = /* @__PURE__ */ __name(function search(aNeedle, aHaystack, aCompare, aBias) {
      if (aHaystack.length === 0) {
        return -1;
      }
      var index = recursiveSearch(
        -1,
        aHaystack.length,
        aNeedle,
        aHaystack,
        aCompare,
        aBias || exports.GREATEST_LOWER_BOUND
      );
      if (index < 0) {
        return -1;
      }
      while (index - 1 >= 0) {
        if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {
          break;
        }
        --index;
      }
      return index;
    }, "search");
  }
});

// ../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/quick-sort.js
var require_quick_sort = __commonJS({
  "../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/quick-sort.js"(exports) {
    init_import_meta_url();
    function swap(ary, x7, y5) {
      var temp = ary[x7];
      ary[x7] = ary[y5];
      ary[y5] = temp;
    }
    __name(swap, "swap");
    function randomIntInRange(low, high) {
      return Math.round(low + Math.random() * (high - low));
    }
    __name(randomIntInRange, "randomIntInRange");
    function doQuickSort(ary, comparator, p7, r10) {
      if (p7 < r10) {
        var pivotIndex = randomIntInRange(p7, r10);
        var i7 = p7 - 1;
        swap(ary, pivotIndex, r10);
        var pivot = ary[r10];
        for (var j7 = p7; j7 < r10; j7++) {
          if (comparator(ary[j7], pivot) <= 0) {
            i7 += 1;
            swap(ary, i7, j7);
          }
        }
        swap(ary, i7 + 1, j7);
        var q7 = i7 + 1;
        doQuickSort(ary, comparator, p7, q7 - 1);
        doQuickSort(ary, comparator, q7 + 1, r10);
      }
    }
    __name(doQuickSort, "doQuickSort");
    exports.quickSort = function(ary, comparator) {
      doQuickSort(ary, comparator, 0, ary.length - 1);
    };
  }
});

// ../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/source-map-consumer.js
var require_source_map_consumer = __commonJS({
  "../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/source-map-consumer.js"(exports) {
    init_import_meta_url();
    var util5 = require_util9();
    var binarySearch = require_binary_search();
    var ArraySet = require_array_set().ArraySet;
    var base64VLQ = require_base64_vlq();
    var quickSort = require_quick_sort().quickSort;
    function SourceMapConsumer(aSourceMap, aSourceMapURL) {
      var sourceMap = aSourceMap;
      if (typeof aSourceMap === "string") {
        sourceMap = util5.parseSourceMapInput(aSourceMap);
      }
      return sourceMap.sections != null ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL) : new BasicSourceMapConsumer(sourceMap, aSourceMapURL);
    }
    __name(SourceMapConsumer, "SourceMapConsumer");
    SourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) {
      return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL);
    };
    SourceMapConsumer.prototype._version = 3;
    SourceMapConsumer.prototype.__generatedMappings = null;
    Object.defineProperty(SourceMapConsumer.prototype, "_generatedMappings", {
      configurable: true,
      enumerable: true,
      get: /* @__PURE__ */ __name(function() {
        if (!this.__generatedMappings) {
          this._parseMappings(this._mappings, this.sourceRoot);
        }
        return this.__generatedMappings;
      }, "get")
    });
    SourceMapConsumer.prototype.__originalMappings = null;
    Object.defineProperty(SourceMapConsumer.prototype, "_originalMappings", {
      configurable: true,
      enumerable: true,
      get: /* @__PURE__ */ __name(function() {
        if (!this.__originalMappings) {
          this._parseMappings(this._mappings, this.sourceRoot);
        }
        return this.__originalMappings;
      }, "get")
    });
    SourceMapConsumer.prototype._charIsMappingSeparator = /* @__PURE__ */ __name(function SourceMapConsumer_charIsMappingSeparator(aStr, index) {
      var c8 = aStr.charAt(index);
      return c8 === ";" || c8 === ",";
    }, "SourceMapConsumer_charIsMappingSeparator");
    SourceMapConsumer.prototype._parseMappings = /* @__PURE__ */ __name(function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
      throw new Error("Subclasses must implement _parseMappings");
    }, "SourceMapConsumer_parseMappings");
    SourceMapConsumer.GENERATED_ORDER = 1;
    SourceMapConsumer.ORIGINAL_ORDER = 2;
    SourceMapConsumer.GREATEST_LOWER_BOUND = 1;
    SourceMapConsumer.LEAST_UPPER_BOUND = 2;
    SourceMapConsumer.prototype.eachMapping = /* @__PURE__ */ __name(function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {
      var context2 = aContext || null;
      var order = aOrder || SourceMapConsumer.GENERATED_ORDER;
      var mappings;
      switch (order) {
        case SourceMapConsumer.GENERATED_ORDER:
          mappings = this._generatedMappings;
          break;
        case SourceMapConsumer.ORIGINAL_ORDER:
          mappings = this._originalMappings;
          break;
        default:
          throw new Error("Unknown order of iteration.");
      }
      var sourceRoot = this.sourceRoot;
      mappings.map(function(mapping) {
        var source = mapping.source === null ? null : this._sources.at(mapping.source);
        source = util5.computeSourceURL(sourceRoot, source, this._sourceMapURL);
        return {
          source,
          generatedLine: mapping.generatedLine,
          generatedColumn: mapping.generatedColumn,
          originalLine: mapping.originalLine,
          originalColumn: mapping.originalColumn,
          name: mapping.name === null ? null : this._names.at(mapping.name)
        };
      }, this).forEach(aCallback, context2);
    }, "SourceMapConsumer_eachMapping");
    SourceMapConsumer.prototype.allGeneratedPositionsFor = /* @__PURE__ */ __name(function SourceMapConsumer_allGeneratedPositionsFor(aArgs) {
      var line = util5.getArg(aArgs, "line");
      var needle = {
        source: util5.getArg(aArgs, "source"),
        originalLine: line,
        originalColumn: util5.getArg(aArgs, "column", 0)
      };
      needle.source = this._findSourceIndex(needle.source);
      if (needle.source < 0) {
        return [];
      }
      var mappings = [];
      var index = this._findMapping(
        needle,
        this._originalMappings,
        "originalLine",
        "originalColumn",
        util5.compareByOriginalPositions,
        binarySearch.LEAST_UPPER_BOUND
      );
      if (index >= 0) {
        var mapping = this._originalMappings[index];
        if (aArgs.column === void 0) {
          var originalLine = mapping.originalLine;
          while (mapping && mapping.originalLine === originalLine) {
            mappings.push({
              line: util5.getArg(mapping, "generatedLine", null),
              column: util5.getArg(mapping, "generatedColumn", null),
              lastColumn: util5.getArg(mapping, "lastGeneratedColumn", null)
            });
            mapping = this._originalMappings[++index];
          }
        } else {
          var originalColumn = mapping.originalColumn;
          while (mapping && mapping.originalLine === line && mapping.originalColumn == originalColumn) {
            mappings.push({
              line: util5.getArg(mapping, "generatedLine", null),
              column: util5.getArg(mapping, "generatedColumn", null),
              lastColumn: util5.getArg(mapping, "lastGeneratedColumn", null)
            });
            mapping = this._originalMappings[++index];
          }
        }
      }
      return mappings;
    }, "SourceMapConsumer_allGeneratedPositionsFor");
    exports.SourceMapConsumer = SourceMapConsumer;
    function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) {
      var sourceMap = aSourceMap;
      if (typeof aSourceMap === "string") {
        sourceMap = util5.parseSourceMapInput(aSourceMap);
      }
      var version5 = util5.getArg(sourceMap, "version");
      var sources = util5.getArg(sourceMap, "sources");
      var names = util5.getArg(sourceMap, "names", []);
      var sourceRoot = util5.getArg(sourceMap, "sourceRoot", null);
      var sourcesContent = util5.getArg(sourceMap, "sourcesContent", null);
      var mappings = util5.getArg(sourceMap, "mappings");
      var file3 = util5.getArg(sourceMap, "file", null);
      if (version5 != this._version) {
        throw new Error("Unsupported version: " + version5);
      }
      if (sourceRoot) {
        sourceRoot = util5.normalize(sourceRoot);
      }
      sources = sources.map(String).map(util5.normalize).map(function(source) {
        return sourceRoot && util5.isAbsolute(sourceRoot) && util5.isAbsolute(source) ? util5.relative(sourceRoot, source) : source;
      });
      this._names = ArraySet.fromArray(names.map(String), true);
      this._sources = ArraySet.fromArray(sources, true);
      this._absoluteSources = this._sources.toArray().map(function(s7) {
        return util5.computeSourceURL(sourceRoot, s7, aSourceMapURL);
      });
      this.sourceRoot = sourceRoot;
      this.sourcesContent = sourcesContent;
      this._mappings = mappings;
      this._sourceMapURL = aSourceMapURL;
      this.file = file3;
    }
    __name(BasicSourceMapConsumer, "BasicSourceMapConsumer");
    BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
    BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer;
    BasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) {
      var relativeSource = aSource;
      if (this.sourceRoot != null) {
        relativeSource = util5.relative(this.sourceRoot, relativeSource);
      }
      if (this._sources.has(relativeSource)) {
        return this._sources.indexOf(relativeSource);
      }
      var i7;
      for (i7 = 0; i7 < this._absoluteSources.length; ++i7) {
        if (this._absoluteSources[i7] == aSource) {
          return i7;
        }
      }
      return -1;
    };
    BasicSourceMapConsumer.fromSourceMap = /* @__PURE__ */ __name(function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) {
      var smc = Object.create(BasicSourceMapConsumer.prototype);
      var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);
      var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);
      smc.sourceRoot = aSourceMap._sourceRoot;
      smc.sourcesContent = aSourceMap._generateSourcesContent(
        smc._sources.toArray(),
        smc.sourceRoot
      );
      smc.file = aSourceMap._file;
      smc._sourceMapURL = aSourceMapURL;
      smc._absoluteSources = smc._sources.toArray().map(function(s7) {
        return util5.computeSourceURL(smc.sourceRoot, s7, aSourceMapURL);
      });
      var generatedMappings = aSourceMap._mappings.toArray().slice();
      var destGeneratedMappings = smc.__generatedMappings = [];
      var destOriginalMappings = smc.__originalMappings = [];
      for (var i7 = 0, length = generatedMappings.length; i7 < length; i7++) {
        var srcMapping = generatedMappings[i7];
        var destMapping = new Mapping();
        destMapping.generatedLine = srcMapping.generatedLine;
        destMapping.generatedColumn = srcMapping.generatedColumn;
        if (srcMapping.source) {
          destMapping.source = sources.indexOf(srcMapping.source);
          destMapping.originalLine = srcMapping.originalLine;
          destMapping.originalColumn = srcMapping.originalColumn;
          if (srcMapping.name) {
            destMapping.name = names.indexOf(srcMapping.name);
          }
          destOriginalMappings.push(destMapping);
        }
        destGeneratedMappings.push(destMapping);
      }
      quickSort(smc.__originalMappings, util5.compareByOriginalPositions);
      return smc;
    }, "SourceMapConsumer_fromSourceMap");
    BasicSourceMapConsumer.prototype._version = 3;
    Object.defineProperty(BasicSourceMapConsumer.prototype, "sources", {
      get: /* @__PURE__ */ __name(function() {
        return this._absoluteSources.slice();
      }, "get")
    });
    function Mapping() {
      this.generatedLine = 0;
      this.generatedColumn = 0;
      this.source = null;
      this.originalLine = null;
      this.originalColumn = null;
      this.name = null;
    }
    __name(Mapping, "Mapping");
    BasicSourceMapConsumer.prototype._parseMappings = /* @__PURE__ */ __name(function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
      var generatedLine = 1;
      var previousGeneratedColumn = 0;
      var previousOriginalLine = 0;
      var previousOriginalColumn = 0;
      var previousSource = 0;
      var previousName = 0;
      var length = aStr.length;
      var index = 0;
      var cachedSegments = {};
      var temp = {};
      var originalMappings = [];
      var generatedMappings = [];
      var mapping, str, segment, end, value;
      while (index < length) {
        if (aStr.charAt(index) === ";") {
          generatedLine++;
          index++;
          previousGeneratedColumn = 0;
        } else if (aStr.charAt(index) === ",") {
          index++;
        } else {
          mapping = new Mapping();
          mapping.generatedLine = generatedLine;
          for (end = index; end < length; end++) {
            if (this._charIsMappingSeparator(aStr, end)) {
              break;
            }
          }
          str = aStr.slice(index, end);
          segment = cachedSegments[str];
          if (segment) {
            index += str.length;
          } else {
            segment = [];
            while (index < end) {
              base64VLQ.decode(aStr, index, temp);
              value = temp.value;
              index = temp.rest;
              segment.push(value);
            }
            if (segment.length === 2) {
              throw new Error("Found a source, but no line and column");
            }
            if (segment.length === 3) {
              throw new Error("Found a source and line, but no column");
            }
            cachedSegments[str] = segment;
          }
          mapping.generatedColumn = previousGeneratedColumn + segment[0];
          previousGeneratedColumn = mapping.generatedColumn;
          if (segment.length > 1) {
            mapping.source = previousSource + segment[1];
            previousSource += segment[1];
            mapping.originalLine = previousOriginalLine + segment[2];
            previousOriginalLine = mapping.originalLine;
            mapping.originalLine += 1;
            mapping.originalColumn = previousOriginalColumn + segment[3];
            previousOriginalColumn = mapping.originalColumn;
            if (segment.length > 4) {
              mapping.name = previousName + segment[4];
              previousName += segment[4];
            }
          }
          generatedMappings.push(mapping);
          if (typeof mapping.originalLine === "number") {
            originalMappings.push(mapping);
          }
        }
      }
      quickSort(generatedMappings, util5.compareByGeneratedPositionsDeflated);
      this.__generatedMappings = generatedMappings;
      quickSort(originalMappings, util5.compareByOriginalPositions);
      this.__originalMappings = originalMappings;
    }, "SourceMapConsumer_parseMappings");
    BasicSourceMapConsumer.prototype._findMapping = /* @__PURE__ */ __name(function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, aColumnName, aComparator, aBias) {
      if (aNeedle[aLineName] <= 0) {
        throw new TypeError("Line must be greater than or equal to 1, got " + aNeedle[aLineName]);
      }
      if (aNeedle[aColumnName] < 0) {
        throw new TypeError("Column must be greater than or equal to 0, got " + aNeedle[aColumnName]);
      }
      return binarySearch.search(aNeedle, aMappings, aComparator, aBias);
    }, "SourceMapConsumer_findMapping");
    BasicSourceMapConsumer.prototype.computeColumnSpans = /* @__PURE__ */ __name(function SourceMapConsumer_computeColumnSpans() {
      for (var index = 0; index < this._generatedMappings.length; ++index) {
        var mapping = this._generatedMappings[index];
        if (index + 1 < this._generatedMappings.length) {
          var nextMapping = this._generatedMappings[index + 1];
          if (mapping.generatedLine === nextMapping.generatedLine) {
            mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1;
            continue;
          }
        }
        mapping.lastGeneratedColumn = Infinity;
      }
    }, "SourceMapConsumer_computeColumnSpans");
    BasicSourceMapConsumer.prototype.originalPositionFor = /* @__PURE__ */ __name(function SourceMapConsumer_originalPositionFor(aArgs) {
      var needle = {
        generatedLine: util5.getArg(aArgs, "line"),
        generatedColumn: util5.getArg(aArgs, "column")
      };
      var index = this._findMapping(
        needle,
        this._generatedMappings,
        "generatedLine",
        "generatedColumn",
        util5.compareByGeneratedPositionsDeflated,
        util5.getArg(aArgs, "bias", SourceMapConsumer.GREATEST_LOWER_BOUND)
      );
      if (index >= 0) {
        var mapping = this._generatedMappings[index];
        if (mapping.generatedLine === needle.generatedLine) {
          var source = util5.getArg(mapping, "source", null);
          if (source !== null) {
            source = this._sources.at(source);
            source = util5.computeSourceURL(this.sourceRoot, source, this._sourceMapURL);
          }
          var name2 = util5.getArg(mapping, "name", null);
          if (name2 !== null) {
            name2 = this._names.at(name2);
          }
          return {
            source,
            line: util5.getArg(mapping, "originalLine", null),
            column: util5.getArg(mapping, "originalColumn", null),
            name: name2
          };
        }
      }
      return {
        source: null,
        line: null,
        column: null,
        name: null
      };
    }, "SourceMapConsumer_originalPositionFor");
    BasicSourceMapConsumer.prototype.hasContentsOfAllSources = /* @__PURE__ */ __name(function BasicSourceMapConsumer_hasContentsOfAllSources() {
      if (!this.sourcesContent) {
        return false;
      }
      return this.sourcesContent.length >= this._sources.size() && !this.sourcesContent.some(function(sc) {
        return sc == null;
      });
    }, "BasicSourceMapConsumer_hasContentsOfAllSources");
    BasicSourceMapConsumer.prototype.sourceContentFor = /* @__PURE__ */ __name(function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
      if (!this.sourcesContent) {
        return null;
      }
      var index = this._findSourceIndex(aSource);
      if (index >= 0) {
        return this.sourcesContent[index];
      }
      var relativeSource = aSource;
      if (this.sourceRoot != null) {
        relativeSource = util5.relative(this.sourceRoot, relativeSource);
      }
      var url4;
      if (this.sourceRoot != null && (url4 = util5.urlParse(this.sourceRoot))) {
        var fileUriAbsPath = relativeSource.replace(/^file:\/\//, "");
        if (url4.scheme == "file" && this._sources.has(fileUriAbsPath)) {
          return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)];
        }
        if ((!url4.path || url4.path == "/") && this._sources.has("/" + relativeSource)) {
          return this.sourcesContent[this._sources.indexOf("/" + relativeSource)];
        }
      }
      if (nullOnMissing) {
        return null;
      } else {
        throw new Error('"' + relativeSource + '" is not in the SourceMap.');
      }
    }, "SourceMapConsumer_sourceContentFor");
    BasicSourceMapConsumer.prototype.generatedPositionFor = /* @__PURE__ */ __name(function SourceMapConsumer_generatedPositionFor(aArgs) {
      var source = util5.getArg(aArgs, "source");
      source = this._findSourceIndex(source);
      if (source < 0) {
        return {
          line: null,
          column: null,
          lastColumn: null
        };
      }
      var needle = {
        source,
        originalLine: util5.getArg(aArgs, "line"),
        originalColumn: util5.getArg(aArgs, "column")
      };
      var index = this._findMapping(
        needle,
        this._originalMappings,
        "originalLine",
        "originalColumn",
        util5.compareByOriginalPositions,
        util5.getArg(aArgs, "bias", SourceMapConsumer.GREATEST_LOWER_BOUND)
      );
      if (index >= 0) {
        var mapping = this._originalMappings[index];
        if (mapping.source === needle.source) {
          return {
            line: util5.getArg(mapping, "generatedLine", null),
            column: util5.getArg(mapping, "generatedColumn", null),
            lastColumn: util5.getArg(mapping, "lastGeneratedColumn", null)
          };
        }
      }
      return {
        line: null,
        column: null,
        lastColumn: null
      };
    }, "SourceMapConsumer_generatedPositionFor");
    exports.BasicSourceMapConsumer = BasicSourceMapConsumer;
    function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) {
      var sourceMap = aSourceMap;
      if (typeof aSourceMap === "string") {
        sourceMap = util5.parseSourceMapInput(aSourceMap);
      }
      var version5 = util5.getArg(sourceMap, "version");
      var sections = util5.getArg(sourceMap, "sections");
      if (version5 != this._version) {
        throw new Error("Unsupported version: " + version5);
      }
      this._sources = new ArraySet();
      this._names = new ArraySet();
      var lastOffset = {
        line: -1,
        column: 0
      };
      this._sections = sections.map(function(s7) {
        if (s7.url) {
          throw new Error("Support for url field in sections not implemented.");
        }
        var offset = util5.getArg(s7, "offset");
        var offsetLine = util5.getArg(offset, "line");
        var offsetColumn = util5.getArg(offset, "column");
        if (offsetLine < lastOffset.line || offsetLine === lastOffset.line && offsetColumn < lastOffset.column) {
          throw new Error("Section offsets must be ordered and non-overlapping.");
        }
        lastOffset = offset;
        return {
          generatedOffset: {
            // The offset fields are 0-based, but we use 1-based indices when
            // encoding/decoding from VLQ.
            generatedLine: offsetLine + 1,
            generatedColumn: offsetColumn + 1
          },
          consumer: new SourceMapConsumer(util5.getArg(s7, "map"), aSourceMapURL)
        };
      });
    }
    __name(IndexedSourceMapConsumer, "IndexedSourceMapConsumer");
    IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
    IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer;
    IndexedSourceMapConsumer.prototype._version = 3;
    Object.defineProperty(IndexedSourceMapConsumer.prototype, "sources", {
      get: /* @__PURE__ */ __name(function() {
        var sources = [];
        for (var i7 = 0; i7 < this._sections.length; i7++) {
          for (var j7 = 0; j7 < this._sections[i7].consumer.sources.length; j7++) {
            sources.push(this._sections[i7].consumer.sources[j7]);
          }
        }
        return sources;
      }, "get")
    });
    IndexedSourceMapConsumer.prototype.originalPositionFor = /* @__PURE__ */ __name(function IndexedSourceMapConsumer_originalPositionFor(aArgs) {
      var needle = {
        generatedLine: util5.getArg(aArgs, "line"),
        generatedColumn: util5.getArg(aArgs, "column")
      };
      var sectionIndex = binarySearch.search(
        needle,
        this._sections,
        function(needle2, section2) {
          var cmp = needle2.generatedLine - section2.generatedOffset.generatedLine;
          if (cmp) {
            return cmp;
          }
          return needle2.generatedColumn - section2.generatedOffset.generatedColumn;
        }
      );
      var section = this._sections[sectionIndex];
      if (!section) {
        return {
          source: null,
          line: null,
          column: null,
          name: null
        };
      }
      return section.consumer.originalPositionFor({
        line: needle.generatedLine - (section.generatedOffset.generatedLine - 1),
        column: needle.generatedColumn - (section.generatedOffset.generatedLine === needle.generatedLine ? section.generatedOffset.generatedColumn - 1 : 0),
        bias: aArgs.bias
      });
    }, "IndexedSourceMapConsumer_originalPositionFor");
    IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = /* @__PURE__ */ __name(function IndexedSourceMapConsumer_hasContentsOfAllSources() {
      return this._sections.every(function(s7) {
        return s7.consumer.hasContentsOfAllSources();
      });
    }, "IndexedSourceMapConsumer_hasContentsOfAllSources");
    IndexedSourceMapConsumer.prototype.sourceContentFor = /* @__PURE__ */ __name(function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
      for (var i7 = 0; i7 < this._sections.length; i7++) {
        var section = this._sections[i7];
        var content = section.consumer.sourceContentFor(aSource, true);
        if (content) {
          return content;
        }
      }
      if (nullOnMissing) {
        return null;
      } else {
        throw new Error('"' + aSource + '" is not in the SourceMap.');
      }
    }, "IndexedSourceMapConsumer_sourceContentFor");
    IndexedSourceMapConsumer.prototype.generatedPositionFor = /* @__PURE__ */ __name(function IndexedSourceMapConsumer_generatedPositionFor(aArgs) {
      for (var i7 = 0; i7 < this._sections.length; i7++) {
        var section = this._sections[i7];
        if (section.consumer._findSourceIndex(util5.getArg(aArgs, "source")) === -1) {
          continue;
        }
        var generatedPosition = section.consumer.generatedPositionFor(aArgs);
        if (generatedPosition) {
          var ret = {
            line: generatedPosition.line + (section.generatedOffset.generatedLine - 1),
            column: generatedPosition.column + (section.generatedOffset.generatedLine === generatedPosition.line ? section.generatedOffset.generatedColumn - 1 : 0)
          };
          return ret;
        }
      }
      return {
        line: null,
        column: null
      };
    }, "IndexedSourceMapConsumer_generatedPositionFor");
    IndexedSourceMapConsumer.prototype._parseMappings = /* @__PURE__ */ __name(function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) {
      this.__generatedMappings = [];
      this.__originalMappings = [];
      for (var i7 = 0; i7 < this._sections.length; i7++) {
        var section = this._sections[i7];
        var sectionMappings = section.consumer._generatedMappings;
        for (var j7 = 0; j7 < sectionMappings.length; j7++) {
          var mapping = sectionMappings[j7];
          var source = section.consumer._sources.at(mapping.source);
          source = util5.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL);
          this._sources.add(source);
          source = this._sources.indexOf(source);
          var name2 = null;
          if (mapping.name) {
            name2 = section.consumer._names.at(mapping.name);
            this._names.add(name2);
            name2 = this._names.indexOf(name2);
          }
          var adjustedMapping = {
            source,
            generatedLine: mapping.generatedLine + (section.generatedOffset.generatedLine - 1),
            generatedColumn: mapping.generatedColumn + (section.generatedOffset.generatedLine === mapping.generatedLine ? section.generatedOffset.generatedColumn - 1 : 0),
            originalLine: mapping.originalLine,
            originalColumn: mapping.originalColumn,
            name: name2
          };
          this.__generatedMappings.push(adjustedMapping);
          if (typeof adjustedMapping.originalLine === "number") {
            this.__originalMappings.push(adjustedMapping);
          }
        }
      }
      quickSort(this.__generatedMappings, util5.compareByGeneratedPositionsDeflated);
      quickSort(this.__originalMappings, util5.compareByOriginalPositions);
    }, "IndexedSourceMapConsumer_parseMappings");
    exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer;
  }
});

// ../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/source-node.js
var require_source_node = __commonJS({
  "../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/source-node.js"(exports) {
    init_import_meta_url();
    var SourceMapGenerator = require_source_map_generator().SourceMapGenerator;
    var util5 = require_util9();
    var REGEX_NEWLINE = /(\r?\n)/;
    var NEWLINE_CODE = 10;
    var isSourceNode = "$$$isSourceNode$$$";
    function SourceNode(aLine, aColumn, aSource, aChunks, aName) {
      this.children = [];
      this.sourceContents = {};
      this.line = aLine == null ? null : aLine;
      this.column = aColumn == null ? null : aColumn;
      this.source = aSource == null ? null : aSource;
      this.name = aName == null ? null : aName;
      this[isSourceNode] = true;
      if (aChunks != null) this.add(aChunks);
    }
    __name(SourceNode, "SourceNode");
    SourceNode.fromStringWithSourceMap = /* @__PURE__ */ __name(function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {
      var node2 = new SourceNode();
      var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);
      var remainingLinesIndex = 0;
      var shiftNextLine = /* @__PURE__ */ __name(function() {
        var lineContents = getNextLine();
        var newLine = getNextLine() || "";
        return lineContents + newLine;
        function getNextLine() {
          return remainingLinesIndex < remainingLines.length ? remainingLines[remainingLinesIndex++] : void 0;
        }
      }, "shiftNextLine");
      var lastGeneratedLine = 1, lastGeneratedColumn = 0;
      var lastMapping = null;
      aSourceMapConsumer.eachMapping(function(mapping) {
        if (lastMapping !== null) {
          if (lastGeneratedLine < mapping.generatedLine) {
            addMappingWithCode(lastMapping, shiftNextLine());
            lastGeneratedLine++;
            lastGeneratedColumn = 0;
          } else {
            var nextLine = remainingLines[remainingLinesIndex] || "";
            var code = nextLine.substr(0, mapping.generatedColumn - lastGeneratedColumn);
            remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn - lastGeneratedColumn);
            lastGeneratedColumn = mapping.generatedColumn;
            addMappingWithCode(lastMapping, code);
            lastMapping = mapping;
            return;
          }
        }
        while (lastGeneratedLine < mapping.generatedLine) {
          node2.add(shiftNextLine());
          lastGeneratedLine++;
        }
        if (lastGeneratedColumn < mapping.generatedColumn) {
          var nextLine = remainingLines[remainingLinesIndex] || "";
          node2.add(nextLine.substr(0, mapping.generatedColumn));
          remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn);
          lastGeneratedColumn = mapping.generatedColumn;
        }
        lastMapping = mapping;
      }, this);
      if (remainingLinesIndex < remainingLines.length) {
        if (lastMapping) {
          addMappingWithCode(lastMapping, shiftNextLine());
        }
        node2.add(remainingLines.splice(remainingLinesIndex).join(""));
      }
      aSourceMapConsumer.sources.forEach(function(sourceFile) {
        var content = aSourceMapConsumer.sourceContentFor(sourceFile);
        if (content != null) {
          if (aRelativePath != null) {
            sourceFile = util5.join(aRelativePath, sourceFile);
          }
          node2.setSourceContent(sourceFile, content);
        }
      });
      return node2;
      function addMappingWithCode(mapping, code) {
        if (mapping === null || mapping.source === void 0) {
          node2.add(code);
        } else {
          var source = aRelativePath ? util5.join(aRelativePath, mapping.source) : mapping.source;
          node2.add(new SourceNode(
            mapping.originalLine,
            mapping.originalColumn,
            source,
            code,
            mapping.name
          ));
        }
      }
    }, "SourceNode_fromStringWithSourceMap");
    SourceNode.prototype.add = /* @__PURE__ */ __name(function SourceNode_add(aChunk) {
      if (Array.isArray(aChunk)) {
        aChunk.forEach(function(chunk) {
          this.add(chunk);
        }, this);
      } else if (aChunk[isSourceNode] || typeof aChunk === "string") {
        if (aChunk) {
          this.children.push(aChunk);
        }
      } else {
        throw new TypeError(
          "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
        );
      }
      return this;
    }, "SourceNode_add");
    SourceNode.prototype.prepend = /* @__PURE__ */ __name(function SourceNode_prepend(aChunk) {
      if (Array.isArray(aChunk)) {
        for (var i7 = aChunk.length - 1; i7 >= 0; i7--) {
          this.prepend(aChunk[i7]);
        }
      } else if (aChunk[isSourceNode] || typeof aChunk === "string") {
        this.children.unshift(aChunk);
      } else {
        throw new TypeError(
          "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
        );
      }
      return this;
    }, "SourceNode_prepend");
    SourceNode.prototype.walk = /* @__PURE__ */ __name(function SourceNode_walk(aFn) {
      var chunk;
      for (var i7 = 0, len = this.children.length; i7 < len; i7++) {
        chunk = this.children[i7];
        if (chunk[isSourceNode]) {
          chunk.walk(aFn);
        } else {
          if (chunk !== "") {
            aFn(chunk, {
              source: this.source,
              line: this.line,
              column: this.column,
              name: this.name
            });
          }
        }
      }
    }, "SourceNode_walk");
    SourceNode.prototype.join = /* @__PURE__ */ __name(function SourceNode_join(aSep) {
      var newChildren;
      var i7;
      var len = this.children.length;
      if (len > 0) {
        newChildren = [];
        for (i7 = 0; i7 < len - 1; i7++) {
          newChildren.push(this.children[i7]);
          newChildren.push(aSep);
        }
        newChildren.push(this.children[i7]);
        this.children = newChildren;
      }
      return this;
    }, "SourceNode_join");
    SourceNode.prototype.replaceRight = /* @__PURE__ */ __name(function SourceNode_replaceRight(aPattern, aReplacement) {
      var lastChild = this.children[this.children.length - 1];
      if (lastChild[isSourceNode]) {
        lastChild.replaceRight(aPattern, aReplacement);
      } else if (typeof lastChild === "string") {
        this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);
      } else {
        this.children.push("".replace(aPattern, aReplacement));
      }
      return this;
    }, "SourceNode_replaceRight");
    SourceNode.prototype.setSourceContent = /* @__PURE__ */ __name(function SourceNode_setSourceContent(aSourceFile, aSourceContent) {
      this.sourceContents[util5.toSetString(aSourceFile)] = aSourceContent;
    }, "SourceNode_setSourceContent");
    SourceNode.prototype.walkSourceContents = /* @__PURE__ */ __name(function SourceNode_walkSourceContents(aFn) {
      for (var i7 = 0, len = this.children.length; i7 < len; i7++) {
        if (this.children[i7][isSourceNode]) {
          this.children[i7].walkSourceContents(aFn);
        }
      }
      var sources = Object.keys(this.sourceContents);
      for (var i7 = 0, len = sources.length; i7 < len; i7++) {
        aFn(util5.fromSetString(sources[i7]), this.sourceContents[sources[i7]]);
      }
    }, "SourceNode_walkSourceContents");
    SourceNode.prototype.toString = /* @__PURE__ */ __name(function SourceNode_toString() {
      var str = "";
      this.walk(function(chunk) {
        str += chunk;
      });
      return str;
    }, "SourceNode_toString");
    SourceNode.prototype.toStringWithSourceMap = /* @__PURE__ */ __name(function SourceNode_toStringWithSourceMap(aArgs) {
      var generated = {
        code: "",
        line: 1,
        column: 0
      };
      var map2 = new SourceMapGenerator(aArgs);
      var sourceMappingActive = false;
      var lastOriginalSource = null;
      var lastOriginalLine = null;
      var lastOriginalColumn = null;
      var lastOriginalName = null;
      this.walk(function(chunk, original) {
        generated.code += chunk;
        if (original.source !== null && original.line !== null && original.column !== null) {
          if (lastOriginalSource !== original.source || lastOriginalLine !== original.line || lastOriginalColumn !== original.column || lastOriginalName !== original.name) {
            map2.addMapping({
              source: original.source,
              original: {
                line: original.line,
                column: original.column
              },
              generated: {
                line: generated.line,
                column: generated.column
              },
              name: original.name
            });
          }
          lastOriginalSource = original.source;
          lastOriginalLine = original.line;
          lastOriginalColumn = original.column;
          lastOriginalName = original.name;
          sourceMappingActive = true;
        } else if (sourceMappingActive) {
          map2.addMapping({
            generated: {
              line: generated.line,
              column: generated.column
            }
          });
          lastOriginalSource = null;
          sourceMappingActive = false;
        }
        for (var idx = 0, length = chunk.length; idx < length; idx++) {
          if (chunk.charCodeAt(idx) === NEWLINE_CODE) {
            generated.line++;
            generated.column = 0;
            if (idx + 1 === length) {
              lastOriginalSource = null;
              sourceMappingActive = false;
            } else if (sourceMappingActive) {
              map2.addMapping({
                source: original.source,
                original: {
                  line: original.line,
                  column: original.column
                },
                generated: {
                  line: generated.line,
                  column: generated.column
                },
                name: original.name
              });
            }
          } else {
            generated.column++;
          }
        }
      });
      this.walkSourceContents(function(sourceFile, sourceContent) {
        map2.setSourceContent(sourceFile, sourceContent);
      });
      return { code: generated.code, map: map2 };
    }, "SourceNode_toStringWithSourceMap");
    exports.SourceNode = SourceNode;
  }
});

// ../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/source-map.js
var require_source_map = __commonJS({
  "../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/source-map.js"(exports) {
    init_import_meta_url();
    exports.SourceMapGenerator = require_source_map_generator().SourceMapGenerator;
    exports.SourceMapConsumer = require_source_map_consumer().SourceMapConsumer;
    exports.SourceNode = require_source_node().SourceNode;
  }
});

// ../../node_modules/.pnpm/recast@0.23.11/node_modules/recast/lib/util.js
var require_util10 = __commonJS({
  "../../node_modules/.pnpm/recast@0.23.11/node_modules/recast/lib/util.js"(exports) {
    init_import_meta_url();
    Object.defineProperty(exports, "__esModule", { value: true });
    exports.isTrailingCommaEnabled = exports.getParentExportDeclaration = exports.isExportDeclaration = exports.fixFaultyLocations = exports.getTrueLoc = exports.composeSourceMaps = exports.copyPos = exports.comparePos = exports.getUnionOfKeys = exports.getOption = exports.isBrowser = exports.getLineTerminator = void 0;
    var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
    var tiny_invariant_1 = tslib_1.__importDefault(require_tiny_invariant_cjs());
    var types13 = tslib_1.__importStar(require_main3());
    var n9 = types13.namedTypes;
    var source_map_1 = tslib_1.__importDefault(require_source_map());
    var SourceMapConsumer = source_map_1.default.SourceMapConsumer;
    var SourceMapGenerator = source_map_1.default.SourceMapGenerator;
    var hasOwn2 = Object.prototype.hasOwnProperty;
    function getLineTerminator() {
      return isBrowser() ? "\n" : __require("os").EOL || "\n";
    }
    __name(getLineTerminator, "getLineTerminator");
    exports.getLineTerminator = getLineTerminator;
    function isBrowser() {
      return typeof window !== "undefined" && typeof window.document !== "undefined";
    }
    __name(isBrowser, "isBrowser");
    exports.isBrowser = isBrowser;
    function getOption(options, key, defaultValue) {
      if (options && hasOwn2.call(options, key)) {
        return options[key];
      }
      return defaultValue;
    }
    __name(getOption, "getOption");
    exports.getOption = getOption;
    function getUnionOfKeys() {
      var args = [];
      for (var _i2 = 0; _i2 < arguments.length; _i2++) {
        args[_i2] = arguments[_i2];
      }
      var result = {};
      var argc = args.length;
      for (var i7 = 0; i7 < argc; ++i7) {
        var keys = Object.keys(args[i7]);
        var keyCount = keys.length;
        for (var j7 = 0; j7 < keyCount; ++j7) {
          result[keys[j7]] = true;
        }
      }
      return result;
    }
    __name(getUnionOfKeys, "getUnionOfKeys");
    exports.getUnionOfKeys = getUnionOfKeys;
    function comparePos(pos1, pos2) {
      return pos1.line - pos2.line || pos1.column - pos2.column;
    }
    __name(comparePos, "comparePos");
    exports.comparePos = comparePos;
    function copyPos(pos) {
      return {
        line: pos.line,
        column: pos.column
      };
    }
    __name(copyPos, "copyPos");
    exports.copyPos = copyPos;
    function composeSourceMaps(formerMap, latterMap) {
      if (formerMap) {
        if (!latterMap) {
          return formerMap;
        }
      } else {
        return latterMap || null;
      }
      var smcFormer = new SourceMapConsumer(formerMap);
      var smcLatter = new SourceMapConsumer(latterMap);
      var smg = new SourceMapGenerator({
        file: latterMap.file,
        sourceRoot: latterMap.sourceRoot
      });
      var sourcesToContents = {};
      smcLatter.eachMapping(function(mapping) {
        var origPos = smcFormer.originalPositionFor({
          line: mapping.originalLine,
          column: mapping.originalColumn
        });
        var sourceName = origPos.source;
        if (sourceName === null) {
          return;
        }
        smg.addMapping({
          source: sourceName,
          original: copyPos(origPos),
          generated: {
            line: mapping.generatedLine,
            column: mapping.generatedColumn
          },
          name: mapping.name
        });
        var sourceContent = smcFormer.sourceContentFor(sourceName);
        if (sourceContent && !hasOwn2.call(sourcesToContents, sourceName)) {
          sourcesToContents[sourceName] = sourceContent;
          smg.setSourceContent(sourceName, sourceContent);
        }
      });
      return smg.toJSON();
    }
    __name(composeSourceMaps, "composeSourceMaps");
    exports.composeSourceMaps = composeSourceMaps;
    function getTrueLoc(node2, lines) {
      if (!node2.loc) {
        return null;
      }
      var result = {
        start: node2.loc.start,
        end: node2.loc.end
      };
      function include(node3) {
        expandLoc(result, node3.loc);
      }
      __name(include, "include");
      if (node2.declaration && node2.declaration.decorators && isExportDeclaration(node2)) {
        node2.declaration.decorators.forEach(include);
      }
      if (comparePos(result.start, result.end) < 0) {
        result.start = copyPos(result.start);
        lines.skipSpaces(result.start, false, true);
        if (comparePos(result.start, result.end) < 0) {
          result.end = copyPos(result.end);
          lines.skipSpaces(result.end, true, true);
        }
      }
      if (node2.comments) {
        node2.comments.forEach(include);
      }
      return result;
    }
    __name(getTrueLoc, "getTrueLoc");
    exports.getTrueLoc = getTrueLoc;
    function expandLoc(parentLoc, childLoc) {
      if (parentLoc && childLoc) {
        if (comparePos(childLoc.start, parentLoc.start) < 0) {
          parentLoc.start = childLoc.start;
        }
        if (comparePos(parentLoc.end, childLoc.end) < 0) {
          parentLoc.end = childLoc.end;
        }
      }
    }
    __name(expandLoc, "expandLoc");
    function fixFaultyLocations(node2, lines) {
      var loc = node2.loc;
      if (loc) {
        if (loc.start.line < 1) {
          loc.start.line = 1;
        }
        if (loc.end.line < 1) {
          loc.end.line = 1;
        }
      }
      if (node2.type === "File") {
        loc.start = lines.firstPos();
        loc.end = lines.lastPos();
      }
      fixForLoopHead(node2, lines);
      fixTemplateLiteral(node2, lines);
      if (loc && node2.decorators) {
        node2.decorators.forEach(function(decorator) {
          expandLoc(loc, decorator.loc);
        });
      } else if (node2.declaration && isExportDeclaration(node2)) {
        node2.declaration.loc = null;
        var decorators = node2.declaration.decorators;
        if (decorators) {
          decorators.forEach(function(decorator) {
            expandLoc(loc, decorator.loc);
          });
        }
      } else if (n9.MethodDefinition && n9.MethodDefinition.check(node2) || n9.Property.check(node2) && (node2.method || node2.shorthand)) {
        node2.value.loc = null;
        if (n9.FunctionExpression.check(node2.value)) {
          node2.value.id = null;
        }
      } else if (node2.type === "ObjectTypeProperty") {
        var loc_1 = node2.loc;
        var end = loc_1 && loc_1.end;
        if (end) {
          end = copyPos(end);
          if (lines.prevPos(end) && lines.charAt(end) === ",") {
            if (end = lines.skipSpaces(end, true, true)) {
              loc_1.end = end;
            }
          }
        }
      }
    }
    __name(fixFaultyLocations, "fixFaultyLocations");
    exports.fixFaultyLocations = fixFaultyLocations;
    function fixForLoopHead(node2, lines) {
      if (node2.type !== "ForStatement") {
        return;
      }
      function fix(child) {
        var loc = child && child.loc;
        var start = loc && loc.start;
        var end = loc && copyPos(loc.end);
        while (start && end && comparePos(start, end) < 0) {
          lines.prevPos(end);
          if (lines.charAt(end) === ";") {
            loc.end.line = end.line;
            loc.end.column = end.column;
          } else {
            break;
          }
        }
      }
      __name(fix, "fix");
      fix(node2.init);
      fix(node2.test);
      fix(node2.update);
    }
    __name(fixForLoopHead, "fixForLoopHead");
    function fixTemplateLiteral(node2, lines) {
      if (node2.type !== "TemplateLiteral") {
        return;
      }
      if (node2.quasis.length === 0) {
        return;
      }
      if (node2.loc) {
        var afterLeftBackTickPos = copyPos(node2.loc.start);
        (0, tiny_invariant_1.default)(lines.charAt(afterLeftBackTickPos) === "`");
        (0, tiny_invariant_1.default)(lines.nextPos(afterLeftBackTickPos));
        var firstQuasi = node2.quasis[0];
        if (comparePos(firstQuasi.loc.start, afterLeftBackTickPos) < 0) {
          firstQuasi.loc.start = afterLeftBackTickPos;
        }
        var rightBackTickPos = copyPos(node2.loc.end);
        (0, tiny_invariant_1.default)(lines.prevPos(rightBackTickPos));
        (0, tiny_invariant_1.default)(lines.charAt(rightBackTickPos) === "`");
        var lastQuasi = node2.quasis[node2.quasis.length - 1];
        if (comparePos(rightBackTickPos, lastQuasi.loc.end) < 0) {
          lastQuasi.loc.end = rightBackTickPos;
        }
      }
      node2.expressions.forEach(function(expr, i7) {
        var dollarCurlyPos = lines.skipSpaces(expr.loc.start, true, false);
        if (lines.prevPos(dollarCurlyPos) && lines.charAt(dollarCurlyPos) === "{" && lines.prevPos(dollarCurlyPos) && lines.charAt(dollarCurlyPos) === "$") {
          var quasiBefore = node2.quasis[i7];
          if (comparePos(dollarCurlyPos, quasiBefore.loc.end) < 0) {
            quasiBefore.loc.end = dollarCurlyPos;
          }
        }
        var rightCurlyPos = lines.skipSpaces(expr.loc.end, false, false);
        if (lines.charAt(rightCurlyPos) === "}") {
          (0, tiny_invariant_1.default)(lines.nextPos(rightCurlyPos));
          var quasiAfter = node2.quasis[i7 + 1];
          if (comparePos(quasiAfter.loc.start, rightCurlyPos) < 0) {
            quasiAfter.loc.start = rightCurlyPos;
          }
        }
      });
    }
    __name(fixTemplateLiteral, "fixTemplateLiteral");
    function isExportDeclaration(node2) {
      if (node2)
        switch (node2.type) {
          case "ExportDeclaration":
          case "ExportDefaultDeclaration":
          case "ExportDefaultSpecifier":
          case "DeclareExportDeclaration":
          case "ExportNamedDeclaration":
          case "ExportAllDeclaration":
            return true;
        }
      return false;
    }
    __name(isExportDeclaration, "isExportDeclaration");
    exports.isExportDeclaration = isExportDeclaration;
    function getParentExportDeclaration(path84) {
      var parentNode = path84.getParentNode();
      if (path84.getName() === "declaration" && isExportDeclaration(parentNode)) {
        return parentNode;
      }
      return null;
    }
    __name(getParentExportDeclaration, "getParentExportDeclaration");
    exports.getParentExportDeclaration = getParentExportDeclaration;
    function isTrailingCommaEnabled(options, context2) {
      var trailingComma = options.trailingComma;
      if (typeof trailingComma === "object") {
        return !!trailingComma[context2];
      }
      return !!trailingComma;
    }
    __name(isTrailingCommaEnabled, "isTrailingCommaEnabled");
    exports.isTrailingCommaEnabled = isTrailingCommaEnabled;
  }
});

// ../../node_modules/.pnpm/esprima@4.0.1/node_modules/esprima/dist/esprima.js
var require_esprima2 = __commonJS({
  "../../node_modules/.pnpm/esprima@4.0.1/node_modules/esprima/dist/esprima.js"(exports, module2) {
    init_import_meta_url();
    (/* @__PURE__ */ __name(function webpackUniversalModuleDefinition(root, factory) {
      if (typeof exports === "object" && typeof module2 === "object")
        module2.exports = factory();
      else if (typeof define === "function" && define.amd)
        define([], factory);
      else if (typeof exports === "object")
        exports["esprima"] = factory();
      else
        root["esprima"] = factory();
    }, "webpackUniversalModuleDefinition"))(exports, function() {
      return (
        /******/
        function(modules) {
          var installedModules = {};
          function __webpack_require__(moduleId) {
            if (installedModules[moduleId])
              return installedModules[moduleId].exports;
            var module3 = installedModules[moduleId] = {
              /******/
              exports: {},
              /******/
              id: moduleId,
              /******/
              loaded: false
              /******/
            };
            modules[moduleId].call(module3.exports, module3, module3.exports, __webpack_require__);
            module3.loaded = true;
            return module3.exports;
          }
          __name(__webpack_require__, "__webpack_require__");
          __webpack_require__.m = modules;
          __webpack_require__.c = installedModules;
          __webpack_require__.p = "";
          return __webpack_require__(0);
        }([
          /* 0 */
          /***/
          function(module3, exports2, __webpack_require__) {
            Object.defineProperty(exports2, "__esModule", { value: true });
            var comment_handler_1 = __webpack_require__(1);
            var jsx_parser_1 = __webpack_require__(3);
            var parser_1 = __webpack_require__(8);
            var tokenizer_1 = __webpack_require__(15);
            function parse17(code, options, delegate) {
              var commentHandler = null;
              var proxyDelegate = /* @__PURE__ */ __name(function(node2, metadata) {
                if (delegate) {
                  delegate(node2, metadata);
                }
                if (commentHandler) {
                  commentHandler.visit(node2, metadata);
                }
              }, "proxyDelegate");
              var parserDelegate = typeof delegate === "function" ? proxyDelegate : null;
              var collectComment = false;
              if (options) {
                collectComment = typeof options.comment === "boolean" && options.comment;
                var attachComment = typeof options.attachComment === "boolean" && options.attachComment;
                if (collectComment || attachComment) {
                  commentHandler = new comment_handler_1.CommentHandler();
                  commentHandler.attach = attachComment;
                  options.comment = true;
                  parserDelegate = proxyDelegate;
                }
              }
              var isModule = false;
              if (options && typeof options.sourceType === "string") {
                isModule = options.sourceType === "module";
              }
              var parser2;
              if (options && typeof options.jsx === "boolean" && options.jsx) {
                parser2 = new jsx_parser_1.JSXParser(code, options, parserDelegate);
              } else {
                parser2 = new parser_1.Parser(code, options, parserDelegate);
              }
              var program = isModule ? parser2.parseModule() : parser2.parseScript();
              var ast = program;
              if (collectComment && commentHandler) {
                ast.comments = commentHandler.comments;
              }
              if (parser2.config.tokens) {
                ast.tokens = parser2.tokens;
              }
              if (parser2.config.tolerant) {
                ast.errors = parser2.errorHandler.errors;
              }
              return ast;
            }
            __name(parse17, "parse");
            exports2.parse = parse17;
            function parseModule(code, options, delegate) {
              var parsingOptions = options || {};
              parsingOptions.sourceType = "module";
              return parse17(code, parsingOptions, delegate);
            }
            __name(parseModule, "parseModule");
            exports2.parseModule = parseModule;
            function parseScript(code, options, delegate) {
              var parsingOptions = options || {};
              parsingOptions.sourceType = "script";
              return parse17(code, parsingOptions, delegate);
            }
            __name(parseScript, "parseScript");
            exports2.parseScript = parseScript;
            function tokenize2(code, options, delegate) {
              var tokenizer = new tokenizer_1.Tokenizer(code, options);
              var tokens;
              tokens = [];
              try {
                while (true) {
                  var token = tokenizer.getNextToken();
                  if (!token) {
                    break;
                  }
                  if (delegate) {
                    token = delegate(token);
                  }
                  tokens.push(token);
                }
              } catch (e10) {
                tokenizer.errorHandler.tolerate(e10);
              }
              if (tokenizer.errorHandler.tolerant) {
                tokens.errors = tokenizer.errors();
              }
              return tokens;
            }
            __name(tokenize2, "tokenize");
            exports2.tokenize = tokenize2;
            var syntax_1 = __webpack_require__(2);
            exports2.Syntax = syntax_1.Syntax;
            exports2.version = "4.0.1";
          },
          /* 1 */
          /***/
          function(module3, exports2, __webpack_require__) {
            Object.defineProperty(exports2, "__esModule", { value: true });
            var syntax_1 = __webpack_require__(2);
            var CommentHandler = function() {
              function CommentHandler2() {
                this.attach = false;
                this.comments = [];
                this.stack = [];
                this.leading = [];
                this.trailing = [];
              }
              __name(CommentHandler2, "CommentHandler");
              CommentHandler2.prototype.insertInnerComments = function(node2, metadata) {
                if (node2.type === syntax_1.Syntax.BlockStatement && node2.body.length === 0) {
                  var innerComments = [];
                  for (var i7 = this.leading.length - 1; i7 >= 0; --i7) {
                    var entry = this.leading[i7];
                    if (metadata.end.offset >= entry.start) {
                      innerComments.unshift(entry.comment);
                      this.leading.splice(i7, 1);
                      this.trailing.splice(i7, 1);
                    }
                  }
                  if (innerComments.length) {
                    node2.innerComments = innerComments;
                  }
                }
              };
              CommentHandler2.prototype.findTrailingComments = function(metadata) {
                var trailingComments = [];
                if (this.trailing.length > 0) {
                  for (var i7 = this.trailing.length - 1; i7 >= 0; --i7) {
                    var entry_1 = this.trailing[i7];
                    if (entry_1.start >= metadata.end.offset) {
                      trailingComments.unshift(entry_1.comment);
                    }
                  }
                  this.trailing.length = 0;
                  return trailingComments;
                }
                var entry = this.stack[this.stack.length - 1];
                if (entry && entry.node.trailingComments) {
                  var firstComment = entry.node.trailingComments[0];
                  if (firstComment && firstComment.range[0] >= metadata.end.offset) {
                    trailingComments = entry.node.trailingComments;
                    delete entry.node.trailingComments;
                  }
                }
                return trailingComments;
              };
              CommentHandler2.prototype.findLeadingComments = function(metadata) {
                var leadingComments = [];
                var target;
                while (this.stack.length > 0) {
                  var entry = this.stack[this.stack.length - 1];
                  if (entry && entry.start >= metadata.start.offset) {
                    target = entry.node;
                    this.stack.pop();
                  } else {
                    break;
                  }
                }
                if (target) {
                  var count = target.leadingComments ? target.leadingComments.length : 0;
                  for (var i7 = count - 1; i7 >= 0; --i7) {
                    var comment = target.leadingComments[i7];
                    if (comment.range[1] <= metadata.start.offset) {
                      leadingComments.unshift(comment);
                      target.leadingComments.splice(i7, 1);
                    }
                  }
                  if (target.leadingComments && target.leadingComments.length === 0) {
                    delete target.leadingComments;
                  }
                  return leadingComments;
                }
                for (var i7 = this.leading.length - 1; i7 >= 0; --i7) {
                  var entry = this.leading[i7];
                  if (entry.start <= metadata.start.offset) {
                    leadingComments.unshift(entry.comment);
                    this.leading.splice(i7, 1);
                  }
                }
                return leadingComments;
              };
              CommentHandler2.prototype.visitNode = function(node2, metadata) {
                if (node2.type === syntax_1.Syntax.Program && node2.body.length > 0) {
                  return;
                }
                this.insertInnerComments(node2, metadata);
                var trailingComments = this.findTrailingComments(metadata);
                var leadingComments = this.findLeadingComments(metadata);
                if (leadingComments.length > 0) {
                  node2.leadingComments = leadingComments;
                }
                if (trailingComments.length > 0) {
                  node2.trailingComments = trailingComments;
                }
                this.stack.push({
                  node: node2,
                  start: metadata.start.offset
                });
              };
              CommentHandler2.prototype.visitComment = function(node2, metadata) {
                var type = node2.type[0] === "L" ? "Line" : "Block";
                var comment = {
                  type,
                  value: node2.value
                };
                if (node2.range) {
                  comment.range = node2.range;
                }
                if (node2.loc) {
                  comment.loc = node2.loc;
                }
                this.comments.push(comment);
                if (this.attach) {
                  var entry = {
                    comment: {
                      type,
                      value: node2.value,
                      range: [metadata.start.offset, metadata.end.offset]
                    },
                    start: metadata.start.offset
                  };
                  if (node2.loc) {
                    entry.comment.loc = node2.loc;
                  }
                  node2.type = type;
                  this.leading.push(entry);
                  this.trailing.push(entry);
                }
              };
              CommentHandler2.prototype.visit = function(node2, metadata) {
                if (node2.type === "LineComment") {
                  this.visitComment(node2, metadata);
                } else if (node2.type === "BlockComment") {
                  this.visitComment(node2, metadata);
                } else if (this.attach) {
                  this.visitNode(node2, metadata);
                }
              };
              return CommentHandler2;
            }();
            exports2.CommentHandler = CommentHandler;
          },
          /* 2 */
          /***/
          function(module3, exports2) {
            Object.defineProperty(exports2, "__esModule", { value: true });
            exports2.Syntax = {
              AssignmentExpression: "AssignmentExpression",
              AssignmentPattern: "AssignmentPattern",
              ArrayExpression: "ArrayExpression",
              ArrayPattern: "ArrayPattern",
              ArrowFunctionExpression: "ArrowFunctionExpression",
              AwaitExpression: "AwaitExpression",
              BlockStatement: "BlockStatement",
              BinaryExpression: "BinaryExpression",
              BreakStatement: "BreakStatement",
              CallExpression: "CallExpression",
              CatchClause: "CatchClause",
              ClassBody: "ClassBody",
              ClassDeclaration: "ClassDeclaration",
              ClassExpression: "ClassExpression",
              ConditionalExpression: "ConditionalExpression",
              ContinueStatement: "ContinueStatement",
              DoWhileStatement: "DoWhileStatement",
              DebuggerStatement: "DebuggerStatement",
              EmptyStatement: "EmptyStatement",
              ExportAllDeclaration: "ExportAllDeclaration",
              ExportDefaultDeclaration: "ExportDefaultDeclaration",
              ExportNamedDeclaration: "ExportNamedDeclaration",
              ExportSpecifier: "ExportSpecifier",
              ExpressionStatement: "ExpressionStatement",
              ForStatement: "ForStatement",
              ForOfStatement: "ForOfStatement",
              ForInStatement: "ForInStatement",
              FunctionDeclaration: "FunctionDeclaration",
              FunctionExpression: "FunctionExpression",
              Identifier: "Identifier",
              IfStatement: "IfStatement",
              ImportDeclaration: "ImportDeclaration",
              ImportDefaultSpecifier: "ImportDefaultSpecifier",
              ImportNamespaceSpecifier: "ImportNamespaceSpecifier",
              ImportSpecifier: "ImportSpecifier",
              Literal: "Literal",
              LabeledStatement: "LabeledStatement",
              LogicalExpression: "LogicalExpression",
              MemberExpression: "MemberExpression",
              MetaProperty: "MetaProperty",
              MethodDefinition: "MethodDefinition",
              NewExpression: "NewExpression",
              ObjectExpression: "ObjectExpression",
              ObjectPattern: "ObjectPattern",
              Program: "Program",
              Property: "Property",
              RestElement: "RestElement",
              ReturnStatement: "ReturnStatement",
              SequenceExpression: "SequenceExpression",
              SpreadElement: "SpreadElement",
              Super: "Super",
              SwitchCase: "SwitchCase",
              SwitchStatement: "SwitchStatement",
              TaggedTemplateExpression: "TaggedTemplateExpression",
              TemplateElement: "TemplateElement",
              TemplateLiteral: "TemplateLiteral",
              ThisExpression: "ThisExpression",
              ThrowStatement: "ThrowStatement",
              TryStatement: "TryStatement",
              UnaryExpression: "UnaryExpression",
              UpdateExpression: "UpdateExpression",
              VariableDeclaration: "VariableDeclaration",
              VariableDeclarator: "VariableDeclarator",
              WhileStatement: "WhileStatement",
              WithStatement: "WithStatement",
              YieldExpression: "YieldExpression"
            };
          },
          /* 3 */
          /***/
          function(module3, exports2, __webpack_require__) {
            var __extends2 = this && this.__extends || function() {
              var extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d8, b11) {
                d8.__proto__ = b11;
              } || function(d8, b11) {
                for (var p7 in b11) if (b11.hasOwnProperty(p7)) d8[p7] = b11[p7];
              };
              return function(d8, b11) {
                extendStatics2(d8, b11);
                function __() {
                  this.constructor = d8;
                }
                __name(__, "__");
                d8.prototype = b11 === null ? Object.create(b11) : (__.prototype = b11.prototype, new __());
              };
            }();
            Object.defineProperty(exports2, "__esModule", { value: true });
            var character_1 = __webpack_require__(4);
            var JSXNode = __webpack_require__(5);
            var jsx_syntax_1 = __webpack_require__(6);
            var Node3 = __webpack_require__(7);
            var parser_1 = __webpack_require__(8);
            var token_1 = __webpack_require__(13);
            var xhtml_entities_1 = __webpack_require__(14);
            token_1.TokenName[
              100
              /* Identifier */
            ] = "JSXIdentifier";
            token_1.TokenName[
              101
              /* Text */
            ] = "JSXText";
            function getQualifiedElementName(elementName) {
              var qualifiedName;
              switch (elementName.type) {
                case jsx_syntax_1.JSXSyntax.JSXIdentifier:
                  var id = elementName;
                  qualifiedName = id.name;
                  break;
                case jsx_syntax_1.JSXSyntax.JSXNamespacedName:
                  var ns = elementName;
                  qualifiedName = getQualifiedElementName(ns.namespace) + ":" + getQualifiedElementName(ns.name);
                  break;
                case jsx_syntax_1.JSXSyntax.JSXMemberExpression:
                  var expr = elementName;
                  qualifiedName = getQualifiedElementName(expr.object) + "." + getQualifiedElementName(expr.property);
                  break;
              }
              return qualifiedName;
            }
            __name(getQualifiedElementName, "getQualifiedElementName");
            var JSXParser = function(_super) {
              __extends2(JSXParser2, _super);
              function JSXParser2(code, options, delegate) {
                return _super.call(this, code, options, delegate) || this;
              }
              __name(JSXParser2, "JSXParser");
              JSXParser2.prototype.parsePrimaryExpression = function() {
                return this.match("<") ? this.parseJSXRoot() : _super.prototype.parsePrimaryExpression.call(this);
              };
              JSXParser2.prototype.startJSX = function() {
                this.scanner.index = this.startMarker.index;
                this.scanner.lineNumber = this.startMarker.line;
                this.scanner.lineStart = this.startMarker.index - this.startMarker.column;
              };
              JSXParser2.prototype.finishJSX = function() {
                this.nextToken();
              };
              JSXParser2.prototype.reenterJSX = function() {
                this.startJSX();
                this.expectJSX("}");
                if (this.config.tokens) {
                  this.tokens.pop();
                }
              };
              JSXParser2.prototype.createJSXNode = function() {
                this.collectComments();
                return {
                  index: this.scanner.index,
                  line: this.scanner.lineNumber,
                  column: this.scanner.index - this.scanner.lineStart
                };
              };
              JSXParser2.prototype.createJSXChildNode = function() {
                return {
                  index: this.scanner.index,
                  line: this.scanner.lineNumber,
                  column: this.scanner.index - this.scanner.lineStart
                };
              };
              JSXParser2.prototype.scanXHTMLEntity = function(quote2) {
                var result = "&";
                var valid = true;
                var terminated = false;
                var numeric = false;
                var hex = false;
                while (!this.scanner.eof() && valid && !terminated) {
                  var ch2 = this.scanner.source[this.scanner.index];
                  if (ch2 === quote2) {
                    break;
                  }
                  terminated = ch2 === ";";
                  result += ch2;
                  ++this.scanner.index;
                  if (!terminated) {
                    switch (result.length) {
                      case 2:
                        numeric = ch2 === "#";
                        break;
                      case 3:
                        if (numeric) {
                          hex = ch2 === "x";
                          valid = hex || character_1.Character.isDecimalDigit(ch2.charCodeAt(0));
                          numeric = numeric && !hex;
                        }
                        break;
                      default:
                        valid = valid && !(numeric && !character_1.Character.isDecimalDigit(ch2.charCodeAt(0)));
                        valid = valid && !(hex && !character_1.Character.isHexDigit(ch2.charCodeAt(0)));
                        break;
                    }
                  }
                }
                if (valid && terminated && result.length > 2) {
                  var str = result.substr(1, result.length - 2);
                  if (numeric && str.length > 1) {
                    result = String.fromCharCode(parseInt(str.substr(1), 10));
                  } else if (hex && str.length > 2) {
                    result = String.fromCharCode(parseInt("0" + str.substr(1), 16));
                  } else if (!numeric && !hex && xhtml_entities_1.XHTMLEntities[str]) {
                    result = xhtml_entities_1.XHTMLEntities[str];
                  }
                }
                return result;
              };
              JSXParser2.prototype.lexJSX = function() {
                var cp3 = this.scanner.source.charCodeAt(this.scanner.index);
                if (cp3 === 60 || cp3 === 62 || cp3 === 47 || cp3 === 58 || cp3 === 61 || cp3 === 123 || cp3 === 125) {
                  var value = this.scanner.source[this.scanner.index++];
                  return {
                    type: 7,
                    value,
                    lineNumber: this.scanner.lineNumber,
                    lineStart: this.scanner.lineStart,
                    start: this.scanner.index - 1,
                    end: this.scanner.index
                  };
                }
                if (cp3 === 34 || cp3 === 39) {
                  var start = this.scanner.index;
                  var quote2 = this.scanner.source[this.scanner.index++];
                  var str = "";
                  while (!this.scanner.eof()) {
                    var ch2 = this.scanner.source[this.scanner.index++];
                    if (ch2 === quote2) {
                      break;
                    } else if (ch2 === "&") {
                      str += this.scanXHTMLEntity(quote2);
                    } else {
                      str += ch2;
                    }
                  }
                  return {
                    type: 8,
                    value: str,
                    lineNumber: this.scanner.lineNumber,
                    lineStart: this.scanner.lineStart,
                    start,
                    end: this.scanner.index
                  };
                }
                if (cp3 === 46) {
                  var n1 = this.scanner.source.charCodeAt(this.scanner.index + 1);
                  var n22 = this.scanner.source.charCodeAt(this.scanner.index + 2);
                  var value = n1 === 46 && n22 === 46 ? "..." : ".";
                  var start = this.scanner.index;
                  this.scanner.index += value.length;
                  return {
                    type: 7,
                    value,
                    lineNumber: this.scanner.lineNumber,
                    lineStart: this.scanner.lineStart,
                    start,
                    end: this.scanner.index
                  };
                }
                if (cp3 === 96) {
                  return {
                    type: 10,
                    value: "",
                    lineNumber: this.scanner.lineNumber,
                    lineStart: this.scanner.lineStart,
                    start: this.scanner.index,
                    end: this.scanner.index
                  };
                }
                if (character_1.Character.isIdentifierStart(cp3) && cp3 !== 92) {
                  var start = this.scanner.index;
                  ++this.scanner.index;
                  while (!this.scanner.eof()) {
                    var ch2 = this.scanner.source.charCodeAt(this.scanner.index);
                    if (character_1.Character.isIdentifierPart(ch2) && ch2 !== 92) {
                      ++this.scanner.index;
                    } else if (ch2 === 45) {
                      ++this.scanner.index;
                    } else {
                      break;
                    }
                  }
                  var id = this.scanner.source.slice(start, this.scanner.index);
                  return {
                    type: 100,
                    value: id,
                    lineNumber: this.scanner.lineNumber,
                    lineStart: this.scanner.lineStart,
                    start,
                    end: this.scanner.index
                  };
                }
                return this.scanner.lex();
              };
              JSXParser2.prototype.nextJSXToken = function() {
                this.collectComments();
                this.startMarker.index = this.scanner.index;
                this.startMarker.line = this.scanner.lineNumber;
                this.startMarker.column = this.scanner.index - this.scanner.lineStart;
                var token = this.lexJSX();
                this.lastMarker.index = this.scanner.index;
                this.lastMarker.line = this.scanner.lineNumber;
                this.lastMarker.column = this.scanner.index - this.scanner.lineStart;
                if (this.config.tokens) {
                  this.tokens.push(this.convertToken(token));
                }
                return token;
              };
              JSXParser2.prototype.nextJSXText = function() {
                this.startMarker.index = this.scanner.index;
                this.startMarker.line = this.scanner.lineNumber;
                this.startMarker.column = this.scanner.index - this.scanner.lineStart;
                var start = this.scanner.index;
                var text = "";
                while (!this.scanner.eof()) {
                  var ch2 = this.scanner.source[this.scanner.index];
                  if (ch2 === "{" || ch2 === "<") {
                    break;
                  }
                  ++this.scanner.index;
                  text += ch2;
                  if (character_1.Character.isLineTerminator(ch2.charCodeAt(0))) {
                    ++this.scanner.lineNumber;
                    if (ch2 === "\r" && this.scanner.source[this.scanner.index] === "\n") {
                      ++this.scanner.index;
                    }
                    this.scanner.lineStart = this.scanner.index;
                  }
                }
                this.lastMarker.index = this.scanner.index;
                this.lastMarker.line = this.scanner.lineNumber;
                this.lastMarker.column = this.scanner.index - this.scanner.lineStart;
                var token = {
                  type: 101,
                  value: text,
                  lineNumber: this.scanner.lineNumber,
                  lineStart: this.scanner.lineStart,
                  start,
                  end: this.scanner.index
                };
                if (text.length > 0 && this.config.tokens) {
                  this.tokens.push(this.convertToken(token));
                }
                return token;
              };
              JSXParser2.prototype.peekJSXToken = function() {
                var state2 = this.scanner.saveState();
                this.scanner.scanComments();
                var next = this.lexJSX();
                this.scanner.restoreState(state2);
                return next;
              };
              JSXParser2.prototype.expectJSX = function(value) {
                var token = this.nextJSXToken();
                if (token.type !== 7 || token.value !== value) {
                  this.throwUnexpectedToken(token);
                }
              };
              JSXParser2.prototype.matchJSX = function(value) {
                var next = this.peekJSXToken();
                return next.type === 7 && next.value === value;
              };
              JSXParser2.prototype.parseJSXIdentifier = function() {
                var node2 = this.createJSXNode();
                var token = this.nextJSXToken();
                if (token.type !== 100) {
                  this.throwUnexpectedToken(token);
                }
                return this.finalize(node2, new JSXNode.JSXIdentifier(token.value));
              };
              JSXParser2.prototype.parseJSXElementName = function() {
                var node2 = this.createJSXNode();
                var elementName = this.parseJSXIdentifier();
                if (this.matchJSX(":")) {
                  var namespace = elementName;
                  this.expectJSX(":");
                  var name_1 = this.parseJSXIdentifier();
                  elementName = this.finalize(node2, new JSXNode.JSXNamespacedName(namespace, name_1));
                } else if (this.matchJSX(".")) {
                  while (this.matchJSX(".")) {
                    var object = elementName;
                    this.expectJSX(".");
                    var property = this.parseJSXIdentifier();
                    elementName = this.finalize(node2, new JSXNode.JSXMemberExpression(object, property));
                  }
                }
                return elementName;
              };
              JSXParser2.prototype.parseJSXAttributeName = function() {
                var node2 = this.createJSXNode();
                var attributeName;
                var identifier = this.parseJSXIdentifier();
                if (this.matchJSX(":")) {
                  var namespace = identifier;
                  this.expectJSX(":");
                  var name_2 = this.parseJSXIdentifier();
                  attributeName = this.finalize(node2, new JSXNode.JSXNamespacedName(namespace, name_2));
                } else {
                  attributeName = identifier;
                }
                return attributeName;
              };
              JSXParser2.prototype.parseJSXStringLiteralAttribute = function() {
                var node2 = this.createJSXNode();
                var token = this.nextJSXToken();
                if (token.type !== 8) {
                  this.throwUnexpectedToken(token);
                }
                var raw = this.getTokenRaw(token);
                return this.finalize(node2, new Node3.Literal(token.value, raw));
              };
              JSXParser2.prototype.parseJSXExpressionAttribute = function() {
                var node2 = this.createJSXNode();
                this.expectJSX("{");
                this.finishJSX();
                if (this.match("}")) {
                  this.tolerateError("JSX attributes must only be assigned a non-empty expression");
                }
                var expression = this.parseAssignmentExpression();
                this.reenterJSX();
                return this.finalize(node2, new JSXNode.JSXExpressionContainer(expression));
              };
              JSXParser2.prototype.parseJSXAttributeValue = function() {
                return this.matchJSX("{") ? this.parseJSXExpressionAttribute() : this.matchJSX("<") ? this.parseJSXElement() : this.parseJSXStringLiteralAttribute();
              };
              JSXParser2.prototype.parseJSXNameValueAttribute = function() {
                var node2 = this.createJSXNode();
                var name2 = this.parseJSXAttributeName();
                var value = null;
                if (this.matchJSX("=")) {
                  this.expectJSX("=");
                  value = this.parseJSXAttributeValue();
                }
                return this.finalize(node2, new JSXNode.JSXAttribute(name2, value));
              };
              JSXParser2.prototype.parseJSXSpreadAttribute = function() {
                var node2 = this.createJSXNode();
                this.expectJSX("{");
                this.expectJSX("...");
                this.finishJSX();
                var argument = this.parseAssignmentExpression();
                this.reenterJSX();
                return this.finalize(node2, new JSXNode.JSXSpreadAttribute(argument));
              };
              JSXParser2.prototype.parseJSXAttributes = function() {
                var attributes = [];
                while (!this.matchJSX("/") && !this.matchJSX(">")) {
                  var attribute = this.matchJSX("{") ? this.parseJSXSpreadAttribute() : this.parseJSXNameValueAttribute();
                  attributes.push(attribute);
                }
                return attributes;
              };
              JSXParser2.prototype.parseJSXOpeningElement = function() {
                var node2 = this.createJSXNode();
                this.expectJSX("<");
                var name2 = this.parseJSXElementName();
                var attributes = this.parseJSXAttributes();
                var selfClosing = this.matchJSX("/");
                if (selfClosing) {
                  this.expectJSX("/");
                }
                this.expectJSX(">");
                return this.finalize(node2, new JSXNode.JSXOpeningElement(name2, selfClosing, attributes));
              };
              JSXParser2.prototype.parseJSXBoundaryElement = function() {
                var node2 = this.createJSXNode();
                this.expectJSX("<");
                if (this.matchJSX("/")) {
                  this.expectJSX("/");
                  var name_3 = this.parseJSXElementName();
                  this.expectJSX(">");
                  return this.finalize(node2, new JSXNode.JSXClosingElement(name_3));
                }
                var name2 = this.parseJSXElementName();
                var attributes = this.parseJSXAttributes();
                var selfClosing = this.matchJSX("/");
                if (selfClosing) {
                  this.expectJSX("/");
                }
                this.expectJSX(">");
                return this.finalize(node2, new JSXNode.JSXOpeningElement(name2, selfClosing, attributes));
              };
              JSXParser2.prototype.parseJSXEmptyExpression = function() {
                var node2 = this.createJSXChildNode();
                this.collectComments();
                this.lastMarker.index = this.scanner.index;
                this.lastMarker.line = this.scanner.lineNumber;
                this.lastMarker.column = this.scanner.index - this.scanner.lineStart;
                return this.finalize(node2, new JSXNode.JSXEmptyExpression());
              };
              JSXParser2.prototype.parseJSXExpressionContainer = function() {
                var node2 = this.createJSXNode();
                this.expectJSX("{");
                var expression;
                if (this.matchJSX("}")) {
                  expression = this.parseJSXEmptyExpression();
                  this.expectJSX("}");
                } else {
                  this.finishJSX();
                  expression = this.parseAssignmentExpression();
                  this.reenterJSX();
                }
                return this.finalize(node2, new JSXNode.JSXExpressionContainer(expression));
              };
              JSXParser2.prototype.parseJSXChildren = function() {
                var children = [];
                while (!this.scanner.eof()) {
                  var node2 = this.createJSXChildNode();
                  var token = this.nextJSXText();
                  if (token.start < token.end) {
                    var raw = this.getTokenRaw(token);
                    var child = this.finalize(node2, new JSXNode.JSXText(token.value, raw));
                    children.push(child);
                  }
                  if (this.scanner.source[this.scanner.index] === "{") {
                    var container = this.parseJSXExpressionContainer();
                    children.push(container);
                  } else {
                    break;
                  }
                }
                return children;
              };
              JSXParser2.prototype.parseComplexJSXElement = function(el) {
                var stack = [];
                while (!this.scanner.eof()) {
                  el.children = el.children.concat(this.parseJSXChildren());
                  var node2 = this.createJSXChildNode();
                  var element = this.parseJSXBoundaryElement();
                  if (element.type === jsx_syntax_1.JSXSyntax.JSXOpeningElement) {
                    var opening = element;
                    if (opening.selfClosing) {
                      var child = this.finalize(node2, new JSXNode.JSXElement(opening, [], null));
                      el.children.push(child);
                    } else {
                      stack.push(el);
                      el = { node: node2, opening, closing: null, children: [] };
                    }
                  }
                  if (element.type === jsx_syntax_1.JSXSyntax.JSXClosingElement) {
                    el.closing = element;
                    var open_1 = getQualifiedElementName(el.opening.name);
                    var close_1 = getQualifiedElementName(el.closing.name);
                    if (open_1 !== close_1) {
                      this.tolerateError("Expected corresponding JSX closing tag for %0", open_1);
                    }
                    if (stack.length > 0) {
                      var child = this.finalize(el.node, new JSXNode.JSXElement(el.opening, el.children, el.closing));
                      el = stack[stack.length - 1];
                      el.children.push(child);
                      stack.pop();
                    } else {
                      break;
                    }
                  }
                }
                return el;
              };
              JSXParser2.prototype.parseJSXElement = function() {
                var node2 = this.createJSXNode();
                var opening = this.parseJSXOpeningElement();
                var children = [];
                var closing = null;
                if (!opening.selfClosing) {
                  var el = this.parseComplexJSXElement({ node: node2, opening, closing, children });
                  children = el.children;
                  closing = el.closing;
                }
                return this.finalize(node2, new JSXNode.JSXElement(opening, children, closing));
              };
              JSXParser2.prototype.parseJSXRoot = function() {
                if (this.config.tokens) {
                  this.tokens.pop();
                }
                this.startJSX();
                var element = this.parseJSXElement();
                this.finishJSX();
                return element;
              };
              JSXParser2.prototype.isStartOfExpression = function() {
                return _super.prototype.isStartOfExpression.call(this) || this.match("<");
              };
              return JSXParser2;
            }(parser_1.Parser);
            exports2.JSXParser = JSXParser;
          },
          /* 4 */
          /***/
          function(module3, exports2) {
            Object.defineProperty(exports2, "__esModule", { value: true });
            var Regex = {
              // Unicode v8.0.0 NonAsciiIdentifierStart:
              NonAsciiIdentifierStart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/,
              // Unicode v8.0.0 NonAsciiIdentifierPart:
              NonAsciiIdentifierPart: /[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/
            };
            exports2.Character = {
              /* tslint:disable:no-bitwise */
              fromCodePoint: /* @__PURE__ */ __name(function(cp3) {
                return cp3 < 65536 ? String.fromCharCode(cp3) : String.fromCharCode(55296 + (cp3 - 65536 >> 10)) + String.fromCharCode(56320 + (cp3 - 65536 & 1023));
              }, "fromCodePoint"),
              // https://tc39.github.io/ecma262/#sec-white-space
              isWhiteSpace: /* @__PURE__ */ __name(function(cp3) {
                return cp3 === 32 || cp3 === 9 || cp3 === 11 || cp3 === 12 || cp3 === 160 || cp3 >= 5760 && [5760, 8192, 8193, 8194, 8195, 8196, 8197, 8198, 8199, 8200, 8201, 8202, 8239, 8287, 12288, 65279].indexOf(cp3) >= 0;
              }, "isWhiteSpace"),
              // https://tc39.github.io/ecma262/#sec-line-terminators
              isLineTerminator: /* @__PURE__ */ __name(function(cp3) {
                return cp3 === 10 || cp3 === 13 || cp3 === 8232 || cp3 === 8233;
              }, "isLineTerminator"),
              // https://tc39.github.io/ecma262/#sec-names-and-keywords
              isIdentifierStart: /* @__PURE__ */ __name(function(cp3) {
                return cp3 === 36 || cp3 === 95 || cp3 >= 65 && cp3 <= 90 || cp3 >= 97 && cp3 <= 122 || cp3 === 92 || cp3 >= 128 && Regex.NonAsciiIdentifierStart.test(exports2.Character.fromCodePoint(cp3));
              }, "isIdentifierStart"),
              isIdentifierPart: /* @__PURE__ */ __name(function(cp3) {
                return cp3 === 36 || cp3 === 95 || cp3 >= 65 && cp3 <= 90 || cp3 >= 97 && cp3 <= 122 || cp3 >= 48 && cp3 <= 57 || cp3 === 92 || cp3 >= 128 && Regex.NonAsciiIdentifierPart.test(exports2.Character.fromCodePoint(cp3));
              }, "isIdentifierPart"),
              // https://tc39.github.io/ecma262/#sec-literals-numeric-literals
              isDecimalDigit: /* @__PURE__ */ __name(function(cp3) {
                return cp3 >= 48 && cp3 <= 57;
              }, "isDecimalDigit"),
              isHexDigit: /* @__PURE__ */ __name(function(cp3) {
                return cp3 >= 48 && cp3 <= 57 || cp3 >= 65 && cp3 <= 70 || cp3 >= 97 && cp3 <= 102;
              }, "isHexDigit"),
              isOctalDigit: /* @__PURE__ */ __name(function(cp3) {
                return cp3 >= 48 && cp3 <= 55;
              }, "isOctalDigit")
            };
          },
          /* 5 */
          /***/
          function(module3, exports2, __webpack_require__) {
            Object.defineProperty(exports2, "__esModule", { value: true });
            var jsx_syntax_1 = __webpack_require__(6);
            var JSXClosingElement = /* @__PURE__ */ function() {
              function JSXClosingElement2(name2) {
                this.type = jsx_syntax_1.JSXSyntax.JSXClosingElement;
                this.name = name2;
              }
              __name(JSXClosingElement2, "JSXClosingElement");
              return JSXClosingElement2;
            }();
            exports2.JSXClosingElement = JSXClosingElement;
            var JSXElement = /* @__PURE__ */ function() {
              function JSXElement2(openingElement, children, closingElement) {
                this.type = jsx_syntax_1.JSXSyntax.JSXElement;
                this.openingElement = openingElement;
                this.children = children;
                this.closingElement = closingElement;
              }
              __name(JSXElement2, "JSXElement");
              return JSXElement2;
            }();
            exports2.JSXElement = JSXElement;
            var JSXEmptyExpression = /* @__PURE__ */ function() {
              function JSXEmptyExpression2() {
                this.type = jsx_syntax_1.JSXSyntax.JSXEmptyExpression;
              }
              __name(JSXEmptyExpression2, "JSXEmptyExpression");
              return JSXEmptyExpression2;
            }();
            exports2.JSXEmptyExpression = JSXEmptyExpression;
            var JSXExpressionContainer = /* @__PURE__ */ function() {
              function JSXExpressionContainer2(expression) {
                this.type = jsx_syntax_1.JSXSyntax.JSXExpressionContainer;
                this.expression = expression;
              }
              __name(JSXExpressionContainer2, "JSXExpressionContainer");
              return JSXExpressionContainer2;
            }();
            exports2.JSXExpressionContainer = JSXExpressionContainer;
            var JSXIdentifier = /* @__PURE__ */ function() {
              function JSXIdentifier2(name2) {
                this.type = jsx_syntax_1.JSXSyntax.JSXIdentifier;
                this.name = name2;
              }
              __name(JSXIdentifier2, "JSXIdentifier");
              return JSXIdentifier2;
            }();
            exports2.JSXIdentifier = JSXIdentifier;
            var JSXMemberExpression = /* @__PURE__ */ function() {
              function JSXMemberExpression2(object, property) {
                this.type = jsx_syntax_1.JSXSyntax.JSXMemberExpression;
                this.object = object;
                this.property = property;
              }
              __name(JSXMemberExpression2, "JSXMemberExpression");
              return JSXMemberExpression2;
            }();
            exports2.JSXMemberExpression = JSXMemberExpression;
            var JSXAttribute = /* @__PURE__ */ function() {
              function JSXAttribute2(name2, value) {
                this.type = jsx_syntax_1.JSXSyntax.JSXAttribute;
                this.name = name2;
                this.value = value;
              }
              __name(JSXAttribute2, "JSXAttribute");
              return JSXAttribute2;
            }();
            exports2.JSXAttribute = JSXAttribute;
            var JSXNamespacedName = /* @__PURE__ */ function() {
              function JSXNamespacedName2(namespace, name2) {
                this.type = jsx_syntax_1.JSXSyntax.JSXNamespacedName;
                this.namespace = namespace;
                this.name = name2;
              }
              __name(JSXNamespacedName2, "JSXNamespacedName");
              return JSXNamespacedName2;
            }();
            exports2.JSXNamespacedName = JSXNamespacedName;
            var JSXOpeningElement = /* @__PURE__ */ function() {
              function JSXOpeningElement2(name2, selfClosing, attributes) {
                this.type = jsx_syntax_1.JSXSyntax.JSXOpeningElement;
                this.name = name2;
                this.selfClosing = selfClosing;
                this.attributes = attributes;
              }
              __name(JSXOpeningElement2, "JSXOpeningElement");
              return JSXOpeningElement2;
            }();
            exports2.JSXOpeningElement = JSXOpeningElement;
            var JSXSpreadAttribute = /* @__PURE__ */ function() {
              function JSXSpreadAttribute2(argument) {
                this.type = jsx_syntax_1.JSXSyntax.JSXSpreadAttribute;
                this.argument = argument;
              }
              __name(JSXSpreadAttribute2, "JSXSpreadAttribute");
              return JSXSpreadAttribute2;
            }();
            exports2.JSXSpreadAttribute = JSXSpreadAttribute;
            var JSXText = /* @__PURE__ */ function() {
              function JSXText2(value, raw) {
                this.type = jsx_syntax_1.JSXSyntax.JSXText;
                this.value = value;
                this.raw = raw;
              }
              __name(JSXText2, "JSXText");
              return JSXText2;
            }();
            exports2.JSXText = JSXText;
          },
          /* 6 */
          /***/
          function(module3, exports2) {
            Object.defineProperty(exports2, "__esModule", { value: true });
            exports2.JSXSyntax = {
              JSXAttribute: "JSXAttribute",
              JSXClosingElement: "JSXClosingElement",
              JSXElement: "JSXElement",
              JSXEmptyExpression: "JSXEmptyExpression",
              JSXExpressionContainer: "JSXExpressionContainer",
              JSXIdentifier: "JSXIdentifier",
              JSXMemberExpression: "JSXMemberExpression",
              JSXNamespacedName: "JSXNamespacedName",
              JSXOpeningElement: "JSXOpeningElement",
              JSXSpreadAttribute: "JSXSpreadAttribute",
              JSXText: "JSXText"
            };
          },
          /* 7 */
          /***/
          function(module3, exports2, __webpack_require__) {
            Object.defineProperty(exports2, "__esModule", { value: true });
            var syntax_1 = __webpack_require__(2);
            var ArrayExpression = /* @__PURE__ */ function() {
              function ArrayExpression2(elements) {
                this.type = syntax_1.Syntax.ArrayExpression;
                this.elements = elements;
              }
              __name(ArrayExpression2, "ArrayExpression");
              return ArrayExpression2;
            }();
            exports2.ArrayExpression = ArrayExpression;
            var ArrayPattern = /* @__PURE__ */ function() {
              function ArrayPattern2(elements) {
                this.type = syntax_1.Syntax.ArrayPattern;
                this.elements = elements;
              }
              __name(ArrayPattern2, "ArrayPattern");
              return ArrayPattern2;
            }();
            exports2.ArrayPattern = ArrayPattern;
            var ArrowFunctionExpression = /* @__PURE__ */ function() {
              function ArrowFunctionExpression2(params, body, expression) {
                this.type = syntax_1.Syntax.ArrowFunctionExpression;
                this.id = null;
                this.params = params;
                this.body = body;
                this.generator = false;
                this.expression = expression;
                this.async = false;
              }
              __name(ArrowFunctionExpression2, "ArrowFunctionExpression");
              return ArrowFunctionExpression2;
            }();
            exports2.ArrowFunctionExpression = ArrowFunctionExpression;
            var AssignmentExpression = /* @__PURE__ */ function() {
              function AssignmentExpression2(operator, left2, right2) {
                this.type = syntax_1.Syntax.AssignmentExpression;
                this.operator = operator;
                this.left = left2;
                this.right = right2;
              }
              __name(AssignmentExpression2, "AssignmentExpression");
              return AssignmentExpression2;
            }();
            exports2.AssignmentExpression = AssignmentExpression;
            var AssignmentPattern = /* @__PURE__ */ function() {
              function AssignmentPattern2(left2, right2) {
                this.type = syntax_1.Syntax.AssignmentPattern;
                this.left = left2;
                this.right = right2;
              }
              __name(AssignmentPattern2, "AssignmentPattern");
              return AssignmentPattern2;
            }();
            exports2.AssignmentPattern = AssignmentPattern;
            var AsyncArrowFunctionExpression = /* @__PURE__ */ function() {
              function AsyncArrowFunctionExpression2(params, body, expression) {
                this.type = syntax_1.Syntax.ArrowFunctionExpression;
                this.id = null;
                this.params = params;
                this.body = body;
                this.generator = false;
                this.expression = expression;
                this.async = true;
              }
              __name(AsyncArrowFunctionExpression2, "AsyncArrowFunctionExpression");
              return AsyncArrowFunctionExpression2;
            }();
            exports2.AsyncArrowFunctionExpression = AsyncArrowFunctionExpression;
            var AsyncFunctionDeclaration = /* @__PURE__ */ function() {
              function AsyncFunctionDeclaration2(id, params, body) {
                this.type = syntax_1.Syntax.FunctionDeclaration;
                this.id = id;
                this.params = params;
                this.body = body;
                this.generator = false;
                this.expression = false;
                this.async = true;
              }
              __name(AsyncFunctionDeclaration2, "AsyncFunctionDeclaration");
              return AsyncFunctionDeclaration2;
            }();
            exports2.AsyncFunctionDeclaration = AsyncFunctionDeclaration;
            var AsyncFunctionExpression = /* @__PURE__ */ function() {
              function AsyncFunctionExpression2(id, params, body) {
                this.type = syntax_1.Syntax.FunctionExpression;
                this.id = id;
                this.params = params;
                this.body = body;
                this.generator = false;
                this.expression = false;
                this.async = true;
              }
              __name(AsyncFunctionExpression2, "AsyncFunctionExpression");
              return AsyncFunctionExpression2;
            }();
            exports2.AsyncFunctionExpression = AsyncFunctionExpression;
            var AwaitExpression = /* @__PURE__ */ function() {
              function AwaitExpression2(argument) {
                this.type = syntax_1.Syntax.AwaitExpression;
                this.argument = argument;
              }
              __name(AwaitExpression2, "AwaitExpression");
              return AwaitExpression2;
            }();
            exports2.AwaitExpression = AwaitExpression;
            var BinaryExpression = /* @__PURE__ */ function() {
              function BinaryExpression2(operator, left2, right2) {
                var logical = operator === "||" || operator === "&&";
                this.type = logical ? syntax_1.Syntax.LogicalExpression : syntax_1.Syntax.BinaryExpression;
                this.operator = operator;
                this.left = left2;
                this.right = right2;
              }
              __name(BinaryExpression2, "BinaryExpression");
              return BinaryExpression2;
            }();
            exports2.BinaryExpression = BinaryExpression;
            var BlockStatement = /* @__PURE__ */ function() {
              function BlockStatement2(body) {
                this.type = syntax_1.Syntax.BlockStatement;
                this.body = body;
              }
              __name(BlockStatement2, "BlockStatement");
              return BlockStatement2;
            }();
            exports2.BlockStatement = BlockStatement;
            var BreakStatement = /* @__PURE__ */ function() {
              function BreakStatement2(label) {
                this.type = syntax_1.Syntax.BreakStatement;
                this.label = label;
              }
              __name(BreakStatement2, "BreakStatement");
              return BreakStatement2;
            }();
            exports2.BreakStatement = BreakStatement;
            var CallExpression = /* @__PURE__ */ function() {
              function CallExpression2(callee, args) {
                this.type = syntax_1.Syntax.CallExpression;
                this.callee = callee;
                this.arguments = args;
              }
              __name(CallExpression2, "CallExpression");
              return CallExpression2;
            }();
            exports2.CallExpression = CallExpression;
            var CatchClause = /* @__PURE__ */ function() {
              function CatchClause2(param, body) {
                this.type = syntax_1.Syntax.CatchClause;
                this.param = param;
                this.body = body;
              }
              __name(CatchClause2, "CatchClause");
              return CatchClause2;
            }();
            exports2.CatchClause = CatchClause;
            var ClassBody = /* @__PURE__ */ function() {
              function ClassBody2(body) {
                this.type = syntax_1.Syntax.ClassBody;
                this.body = body;
              }
              __name(ClassBody2, "ClassBody");
              return ClassBody2;
            }();
            exports2.ClassBody = ClassBody;
            var ClassDeclaration = /* @__PURE__ */ function() {
              function ClassDeclaration2(id, superClass, body) {
                this.type = syntax_1.Syntax.ClassDeclaration;
                this.id = id;
                this.superClass = superClass;
                this.body = body;
              }
              __name(ClassDeclaration2, "ClassDeclaration");
              return ClassDeclaration2;
            }();
            exports2.ClassDeclaration = ClassDeclaration;
            var ClassExpression = /* @__PURE__ */ function() {
              function ClassExpression2(id, superClass, body) {
                this.type = syntax_1.Syntax.ClassExpression;
                this.id = id;
                this.superClass = superClass;
                this.body = body;
              }
              __name(ClassExpression2, "ClassExpression");
              return ClassExpression2;
            }();
            exports2.ClassExpression = ClassExpression;
            var ComputedMemberExpression = /* @__PURE__ */ function() {
              function ComputedMemberExpression2(object, property) {
                this.type = syntax_1.Syntax.MemberExpression;
                this.computed = true;
                this.object = object;
                this.property = property;
              }
              __name(ComputedMemberExpression2, "ComputedMemberExpression");
              return ComputedMemberExpression2;
            }();
            exports2.ComputedMemberExpression = ComputedMemberExpression;
            var ConditionalExpression = /* @__PURE__ */ function() {
              function ConditionalExpression2(test, consequent, alternate) {
                this.type = syntax_1.Syntax.ConditionalExpression;
                this.test = test;
                this.consequent = consequent;
                this.alternate = alternate;
              }
              __name(ConditionalExpression2, "ConditionalExpression");
              return ConditionalExpression2;
            }();
            exports2.ConditionalExpression = ConditionalExpression;
            var ContinueStatement = /* @__PURE__ */ function() {
              function ContinueStatement2(label) {
                this.type = syntax_1.Syntax.ContinueStatement;
                this.label = label;
              }
              __name(ContinueStatement2, "ContinueStatement");
              return ContinueStatement2;
            }();
            exports2.ContinueStatement = ContinueStatement;
            var DebuggerStatement = /* @__PURE__ */ function() {
              function DebuggerStatement2() {
                this.type = syntax_1.Syntax.DebuggerStatement;
              }
              __name(DebuggerStatement2, "DebuggerStatement");
              return DebuggerStatement2;
            }();
            exports2.DebuggerStatement = DebuggerStatement;
            var Directive = /* @__PURE__ */ function() {
              function Directive2(expression, directive) {
                this.type = syntax_1.Syntax.ExpressionStatement;
                this.expression = expression;
                this.directive = directive;
              }
              __name(Directive2, "Directive");
              return Directive2;
            }();
            exports2.Directive = Directive;
            var DoWhileStatement = /* @__PURE__ */ function() {
              function DoWhileStatement2(body, test) {
                this.type = syntax_1.Syntax.DoWhileStatement;
                this.body = body;
                this.test = test;
              }
              __name(DoWhileStatement2, "DoWhileStatement");
              return DoWhileStatement2;
            }();
            exports2.DoWhileStatement = DoWhileStatement;
            var EmptyStatement = /* @__PURE__ */ function() {
              function EmptyStatement2() {
                this.type = syntax_1.Syntax.EmptyStatement;
              }
              __name(EmptyStatement2, "EmptyStatement");
              return EmptyStatement2;
            }();
            exports2.EmptyStatement = EmptyStatement;
            var ExportAllDeclaration = /* @__PURE__ */ function() {
              function ExportAllDeclaration2(source) {
                this.type = syntax_1.Syntax.ExportAllDeclaration;
                this.source = source;
              }
              __name(ExportAllDeclaration2, "ExportAllDeclaration");
              return ExportAllDeclaration2;
            }();
            exports2.ExportAllDeclaration = ExportAllDeclaration;
            var ExportDefaultDeclaration = /* @__PURE__ */ function() {
              function ExportDefaultDeclaration2(declaration) {
                this.type = syntax_1.Syntax.ExportDefaultDeclaration;
                this.declaration = declaration;
              }
              __name(ExportDefaultDeclaration2, "ExportDefaultDeclaration");
              return ExportDefaultDeclaration2;
            }();
            exports2.ExportDefaultDeclaration = ExportDefaultDeclaration;
            var ExportNamedDeclaration = /* @__PURE__ */ function() {
              function ExportNamedDeclaration2(declaration, specifiers, source) {
                this.type = syntax_1.Syntax.ExportNamedDeclaration;
                this.declaration = declaration;
                this.specifiers = specifiers;
                this.source = source;
              }
              __name(ExportNamedDeclaration2, "ExportNamedDeclaration");
              return ExportNamedDeclaration2;
            }();
            exports2.ExportNamedDeclaration = ExportNamedDeclaration;
            var ExportSpecifier = /* @__PURE__ */ function() {
              function ExportSpecifier2(local, exported) {
                this.type = syntax_1.Syntax.ExportSpecifier;
                this.exported = exported;
                this.local = local;
              }
              __name(ExportSpecifier2, "ExportSpecifier");
              return ExportSpecifier2;
            }();
            exports2.ExportSpecifier = ExportSpecifier;
            var ExpressionStatement = /* @__PURE__ */ function() {
              function ExpressionStatement2(expression) {
                this.type = syntax_1.Syntax.ExpressionStatement;
                this.expression = expression;
              }
              __name(ExpressionStatement2, "ExpressionStatement");
              return ExpressionStatement2;
            }();
            exports2.ExpressionStatement = ExpressionStatement;
            var ForInStatement = /* @__PURE__ */ function() {
              function ForInStatement2(left2, right2, body) {
                this.type = syntax_1.Syntax.ForInStatement;
                this.left = left2;
                this.right = right2;
                this.body = body;
                this.each = false;
              }
              __name(ForInStatement2, "ForInStatement");
              return ForInStatement2;
            }();
            exports2.ForInStatement = ForInStatement;
            var ForOfStatement = /* @__PURE__ */ function() {
              function ForOfStatement2(left2, right2, body) {
                this.type = syntax_1.Syntax.ForOfStatement;
                this.left = left2;
                this.right = right2;
                this.body = body;
              }
              __name(ForOfStatement2, "ForOfStatement");
              return ForOfStatement2;
            }();
            exports2.ForOfStatement = ForOfStatement;
            var ForStatement = /* @__PURE__ */ function() {
              function ForStatement2(init4, test, update, body) {
                this.type = syntax_1.Syntax.ForStatement;
                this.init = init4;
                this.test = test;
                this.update = update;
                this.body = body;
              }
              __name(ForStatement2, "ForStatement");
              return ForStatement2;
            }();
            exports2.ForStatement = ForStatement;
            var FunctionDeclaration = /* @__PURE__ */ function() {
              function FunctionDeclaration2(id, params, body, generator) {
                this.type = syntax_1.Syntax.FunctionDeclaration;
                this.id = id;
                this.params = params;
                this.body = body;
                this.generator = generator;
                this.expression = false;
                this.async = false;
              }
              __name(FunctionDeclaration2, "FunctionDeclaration");
              return FunctionDeclaration2;
            }();
            exports2.FunctionDeclaration = FunctionDeclaration;
            var FunctionExpression = /* @__PURE__ */ function() {
              function FunctionExpression2(id, params, body, generator) {
                this.type = syntax_1.Syntax.FunctionExpression;
                this.id = id;
                this.params = params;
                this.body = body;
                this.generator = generator;
                this.expression = false;
                this.async = false;
              }
              __name(FunctionExpression2, "FunctionExpression");
              return FunctionExpression2;
            }();
            exports2.FunctionExpression = FunctionExpression;
            var Identifier = /* @__PURE__ */ function() {
              function Identifier2(name2) {
                this.type = syntax_1.Syntax.Identifier;
                this.name = name2;
              }
              __name(Identifier2, "Identifier");
              return Identifier2;
            }();
            exports2.Identifier = Identifier;
            var IfStatement = /* @__PURE__ */ function() {
              function IfStatement2(test, consequent, alternate) {
                this.type = syntax_1.Syntax.IfStatement;
                this.test = test;
                this.consequent = consequent;
                this.alternate = alternate;
              }
              __name(IfStatement2, "IfStatement");
              return IfStatement2;
            }();
            exports2.IfStatement = IfStatement;
            var ImportDeclaration = /* @__PURE__ */ function() {
              function ImportDeclaration2(specifiers, source) {
                this.type = syntax_1.Syntax.ImportDeclaration;
                this.specifiers = specifiers;
                this.source = source;
              }
              __name(ImportDeclaration2, "ImportDeclaration");
              return ImportDeclaration2;
            }();
            exports2.ImportDeclaration = ImportDeclaration;
            var ImportDefaultSpecifier = /* @__PURE__ */ function() {
              function ImportDefaultSpecifier2(local) {
                this.type = syntax_1.Syntax.ImportDefaultSpecifier;
                this.local = local;
              }
              __name(ImportDefaultSpecifier2, "ImportDefaultSpecifier");
              return ImportDefaultSpecifier2;
            }();
            exports2.ImportDefaultSpecifier = ImportDefaultSpecifier;
            var ImportNamespaceSpecifier = /* @__PURE__ */ function() {
              function ImportNamespaceSpecifier2(local) {
                this.type = syntax_1.Syntax.ImportNamespaceSpecifier;
                this.local = local;
              }
              __name(ImportNamespaceSpecifier2, "ImportNamespaceSpecifier");
              return ImportNamespaceSpecifier2;
            }();
            exports2.ImportNamespaceSpecifier = ImportNamespaceSpecifier;
            var ImportSpecifier = /* @__PURE__ */ function() {
              function ImportSpecifier2(local, imported) {
                this.type = syntax_1.Syntax.ImportSpecifier;
                this.local = local;
                this.imported = imported;
              }
              __name(ImportSpecifier2, "ImportSpecifier");
              return ImportSpecifier2;
            }();
            exports2.ImportSpecifier = ImportSpecifier;
            var LabeledStatement = /* @__PURE__ */ function() {
              function LabeledStatement2(label, body) {
                this.type = syntax_1.Syntax.LabeledStatement;
                this.label = label;
                this.body = body;
              }
              __name(LabeledStatement2, "LabeledStatement");
              return LabeledStatement2;
            }();
            exports2.LabeledStatement = LabeledStatement;
            var Literal = /* @__PURE__ */ function() {
              function Literal2(value, raw) {
                this.type = syntax_1.Syntax.Literal;
                this.value = value;
                this.raw = raw;
              }
              __name(Literal2, "Literal");
              return Literal2;
            }();
            exports2.Literal = Literal;
            var MetaProperty = /* @__PURE__ */ function() {
              function MetaProperty2(meta, property) {
                this.type = syntax_1.Syntax.MetaProperty;
                this.meta = meta;
                this.property = property;
              }
              __name(MetaProperty2, "MetaProperty");
              return MetaProperty2;
            }();
            exports2.MetaProperty = MetaProperty;
            var MethodDefinition = /* @__PURE__ */ function() {
              function MethodDefinition2(key, computed, value, kind2, isStatic) {
                this.type = syntax_1.Syntax.MethodDefinition;
                this.key = key;
                this.computed = computed;
                this.value = value;
                this.kind = kind2;
                this.static = isStatic;
              }
              __name(MethodDefinition2, "MethodDefinition");
              return MethodDefinition2;
            }();
            exports2.MethodDefinition = MethodDefinition;
            var Module = /* @__PURE__ */ function() {
              function Module2(body) {
                this.type = syntax_1.Syntax.Program;
                this.body = body;
                this.sourceType = "module";
              }
              __name(Module2, "Module");
              return Module2;
            }();
            exports2.Module = Module;
            var NewExpression = /* @__PURE__ */ function() {
              function NewExpression2(callee, args) {
                this.type = syntax_1.Syntax.NewExpression;
                this.callee = callee;
                this.arguments = args;
              }
              __name(NewExpression2, "NewExpression");
              return NewExpression2;
            }();
            exports2.NewExpression = NewExpression;
            var ObjectExpression = /* @__PURE__ */ function() {
              function ObjectExpression2(properties) {
                this.type = syntax_1.Syntax.ObjectExpression;
                this.properties = properties;
              }
              __name(ObjectExpression2, "ObjectExpression");
              return ObjectExpression2;
            }();
            exports2.ObjectExpression = ObjectExpression;
            var ObjectPattern = /* @__PURE__ */ function() {
              function ObjectPattern2(properties) {
                this.type = syntax_1.Syntax.ObjectPattern;
                this.properties = properties;
              }
              __name(ObjectPattern2, "ObjectPattern");
              return ObjectPattern2;
            }();
            exports2.ObjectPattern = ObjectPattern;
            var Property = /* @__PURE__ */ function() {
              function Property2(kind2, key, computed, value, method, shorthand) {
                this.type = syntax_1.Syntax.Property;
                this.key = key;
                this.computed = computed;
                this.value = value;
                this.kind = kind2;
                this.method = method;
                this.shorthand = shorthand;
              }
              __name(Property2, "Property");
              return Property2;
            }();
            exports2.Property = Property;
            var RegexLiteral = /* @__PURE__ */ function() {
              function RegexLiteral2(value, raw, pattern, flags2) {
                this.type = syntax_1.Syntax.Literal;
                this.value = value;
                this.raw = raw;
                this.regex = { pattern, flags: flags2 };
              }
              __name(RegexLiteral2, "RegexLiteral");
              return RegexLiteral2;
            }();
            exports2.RegexLiteral = RegexLiteral;
            var RestElement = /* @__PURE__ */ function() {
              function RestElement2(argument) {
                this.type = syntax_1.Syntax.RestElement;
                this.argument = argument;
              }
              __name(RestElement2, "RestElement");
              return RestElement2;
            }();
            exports2.RestElement = RestElement;
            var ReturnStatement = /* @__PURE__ */ function() {
              function ReturnStatement2(argument) {
                this.type = syntax_1.Syntax.ReturnStatement;
                this.argument = argument;
              }
              __name(ReturnStatement2, "ReturnStatement");
              return ReturnStatement2;
            }();
            exports2.ReturnStatement = ReturnStatement;
            var Script = /* @__PURE__ */ function() {
              function Script2(body) {
                this.type = syntax_1.Syntax.Program;
                this.body = body;
                this.sourceType = "script";
              }
              __name(Script2, "Script");
              return Script2;
            }();
            exports2.Script = Script;
            var SequenceExpression = /* @__PURE__ */ function() {
              function SequenceExpression2(expressions) {
                this.type = syntax_1.Syntax.SequenceExpression;
                this.expressions = expressions;
              }
              __name(SequenceExpression2, "SequenceExpression");
              return SequenceExpression2;
            }();
            exports2.SequenceExpression = SequenceExpression;
            var SpreadElement = /* @__PURE__ */ function() {
              function SpreadElement2(argument) {
                this.type = syntax_1.Syntax.SpreadElement;
                this.argument = argument;
              }
              __name(SpreadElement2, "SpreadElement");
              return SpreadElement2;
            }();
            exports2.SpreadElement = SpreadElement;
            var StaticMemberExpression = /* @__PURE__ */ function() {
              function StaticMemberExpression2(object, property) {
                this.type = syntax_1.Syntax.MemberExpression;
                this.computed = false;
                this.object = object;
                this.property = property;
              }
              __name(StaticMemberExpression2, "StaticMemberExpression");
              return StaticMemberExpression2;
            }();
            exports2.StaticMemberExpression = StaticMemberExpression;
            var Super = /* @__PURE__ */ function() {
              function Super2() {
                this.type = syntax_1.Syntax.Super;
              }
              __name(Super2, "Super");
              return Super2;
            }();
            exports2.Super = Super;
            var SwitchCase = /* @__PURE__ */ function() {
              function SwitchCase2(test, consequent) {
                this.type = syntax_1.Syntax.SwitchCase;
                this.test = test;
                this.consequent = consequent;
              }
              __name(SwitchCase2, "SwitchCase");
              return SwitchCase2;
            }();
            exports2.SwitchCase = SwitchCase;
            var SwitchStatement = /* @__PURE__ */ function() {
              function SwitchStatement2(discriminant, cases) {
                this.type = syntax_1.Syntax.SwitchStatement;
                this.discriminant = discriminant;
                this.cases = cases;
              }
              __name(SwitchStatement2, "SwitchStatement");
              return SwitchStatement2;
            }();
            exports2.SwitchStatement = SwitchStatement;
            var TaggedTemplateExpression = /* @__PURE__ */ function() {
              function TaggedTemplateExpression2(tag, quasi) {
                this.type = syntax_1.Syntax.TaggedTemplateExpression;
                this.tag = tag;
                this.quasi = quasi;
              }
              __name(TaggedTemplateExpression2, "TaggedTemplateExpression");
              return TaggedTemplateExpression2;
            }();
            exports2.TaggedTemplateExpression = TaggedTemplateExpression;
            var TemplateElement = /* @__PURE__ */ function() {
              function TemplateElement2(value, tail) {
                this.type = syntax_1.Syntax.TemplateElement;
                this.value = value;
                this.tail = tail;
              }
              __name(TemplateElement2, "TemplateElement");
              return TemplateElement2;
            }();
            exports2.TemplateElement = TemplateElement;
            var TemplateLiteral = /* @__PURE__ */ function() {
              function TemplateLiteral2(quasis, expressions) {
                this.type = syntax_1.Syntax.TemplateLiteral;
                this.quasis = quasis;
                this.expressions = expressions;
              }
              __name(TemplateLiteral2, "TemplateLiteral");
              return TemplateLiteral2;
            }();
            exports2.TemplateLiteral = TemplateLiteral;
            var ThisExpression = /* @__PURE__ */ function() {
              function ThisExpression2() {
                this.type = syntax_1.Syntax.ThisExpression;
              }
              __name(ThisExpression2, "ThisExpression");
              return ThisExpression2;
            }();
            exports2.ThisExpression = ThisExpression;
            var ThrowStatement = /* @__PURE__ */ function() {
              function ThrowStatement2(argument) {
                this.type = syntax_1.Syntax.ThrowStatement;
                this.argument = argument;
              }
              __name(ThrowStatement2, "ThrowStatement");
              return ThrowStatement2;
            }();
            exports2.ThrowStatement = ThrowStatement;
            var TryStatement = /* @__PURE__ */ function() {
              function TryStatement2(block, handler, finalizer) {
                this.type = syntax_1.Syntax.TryStatement;
                this.block = block;
                this.handler = handler;
                this.finalizer = finalizer;
              }
              __name(TryStatement2, "TryStatement");
              return TryStatement2;
            }();
            exports2.TryStatement = TryStatement;
            var UnaryExpression = /* @__PURE__ */ function() {
              function UnaryExpression2(operator, argument) {
                this.type = syntax_1.Syntax.UnaryExpression;
                this.operator = operator;
                this.argument = argument;
                this.prefix = true;
              }
              __name(UnaryExpression2, "UnaryExpression");
              return UnaryExpression2;
            }();
            exports2.UnaryExpression = UnaryExpression;
            var UpdateExpression = /* @__PURE__ */ function() {
              function UpdateExpression2(operator, argument, prefix) {
                this.type = syntax_1.Syntax.UpdateExpression;
                this.operator = operator;
                this.argument = argument;
                this.prefix = prefix;
              }
              __name(UpdateExpression2, "UpdateExpression");
              return UpdateExpression2;
            }();
            exports2.UpdateExpression = UpdateExpression;
            var VariableDeclaration = /* @__PURE__ */ function() {
              function VariableDeclaration2(declarations, kind2) {
                this.type = syntax_1.Syntax.VariableDeclaration;
                this.declarations = declarations;
                this.kind = kind2;
              }
              __name(VariableDeclaration2, "VariableDeclaration");
              return VariableDeclaration2;
            }();
            exports2.VariableDeclaration = VariableDeclaration;
            var VariableDeclarator = /* @__PURE__ */ function() {
              function VariableDeclarator2(id, init4) {
                this.type = syntax_1.Syntax.VariableDeclarator;
                this.id = id;
                this.init = init4;
              }
              __name(VariableDeclarator2, "VariableDeclarator");
              return VariableDeclarator2;
            }();
            exports2.VariableDeclarator = VariableDeclarator;
            var WhileStatement = /* @__PURE__ */ function() {
              function WhileStatement2(test, body) {
                this.type = syntax_1.Syntax.WhileStatement;
                this.test = test;
                this.body = body;
              }
              __name(WhileStatement2, "WhileStatement");
              return WhileStatement2;
            }();
            exports2.WhileStatement = WhileStatement;
            var WithStatement = /* @__PURE__ */ function() {
              function WithStatement2(object, body) {
                this.type = syntax_1.Syntax.WithStatement;
                this.object = object;
                this.body = body;
              }
              __name(WithStatement2, "WithStatement");
              return WithStatement2;
            }();
            exports2.WithStatement = WithStatement;
            var YieldExpression = /* @__PURE__ */ function() {
              function YieldExpression2(argument, delegate) {
                this.type = syntax_1.Syntax.YieldExpression;
                this.argument = argument;
                this.delegate = delegate;
              }
              __name(YieldExpression2, "YieldExpression");
              return YieldExpression2;
            }();
            exports2.YieldExpression = YieldExpression;
          },
          /* 8 */
          /***/
          function(module3, exports2, __webpack_require__) {
            Object.defineProperty(exports2, "__esModule", { value: true });
            var assert_1 = __webpack_require__(9);
            var error_handler_1 = __webpack_require__(10);
            var messages_1 = __webpack_require__(11);
            var Node3 = __webpack_require__(7);
            var scanner_1 = __webpack_require__(12);
            var syntax_1 = __webpack_require__(2);
            var token_1 = __webpack_require__(13);
            var ArrowParameterPlaceHolder = "ArrowParameterPlaceHolder";
            var Parser2 = function() {
              function Parser3(code, options, delegate) {
                if (options === void 0) {
                  options = {};
                }
                this.config = {
                  range: typeof options.range === "boolean" && options.range,
                  loc: typeof options.loc === "boolean" && options.loc,
                  source: null,
                  tokens: typeof options.tokens === "boolean" && options.tokens,
                  comment: typeof options.comment === "boolean" && options.comment,
                  tolerant: typeof options.tolerant === "boolean" && options.tolerant
                };
                if (this.config.loc && options.source && options.source !== null) {
                  this.config.source = String(options.source);
                }
                this.delegate = delegate;
                this.errorHandler = new error_handler_1.ErrorHandler();
                this.errorHandler.tolerant = this.config.tolerant;
                this.scanner = new scanner_1.Scanner(code, this.errorHandler);
                this.scanner.trackComment = this.config.comment;
                this.operatorPrecedence = {
                  ")": 0,
                  ";": 0,
                  ",": 0,
                  "=": 0,
                  "]": 0,
                  "||": 1,
                  "&&": 2,
                  "|": 3,
                  "^": 4,
                  "&": 5,
                  "==": 6,
                  "!=": 6,
                  "===": 6,
                  "!==": 6,
                  "<": 7,
                  ">": 7,
                  "<=": 7,
                  ">=": 7,
                  "<<": 8,
                  ">>": 8,
                  ">>>": 8,
                  "+": 9,
                  "-": 9,
                  "*": 11,
                  "/": 11,
                  "%": 11
                };
                this.lookahead = {
                  type: 2,
                  value: "",
                  lineNumber: this.scanner.lineNumber,
                  lineStart: 0,
                  start: 0,
                  end: 0
                };
                this.hasLineTerminator = false;
                this.context = {
                  isModule: false,
                  await: false,
                  allowIn: true,
                  allowStrictDirective: true,
                  allowYield: true,
                  firstCoverInitializedNameError: null,
                  isAssignmentTarget: false,
                  isBindingElement: false,
                  inFunctionBody: false,
                  inIteration: false,
                  inSwitch: false,
                  labelSet: {},
                  strict: false
                };
                this.tokens = [];
                this.startMarker = {
                  index: 0,
                  line: this.scanner.lineNumber,
                  column: 0
                };
                this.lastMarker = {
                  index: 0,
                  line: this.scanner.lineNumber,
                  column: 0
                };
                this.nextToken();
                this.lastMarker = {
                  index: this.scanner.index,
                  line: this.scanner.lineNumber,
                  column: this.scanner.index - this.scanner.lineStart
                };
              }
              __name(Parser3, "Parser");
              Parser3.prototype.throwError = function(messageFormat) {
                var args = Array.prototype.slice.call(arguments, 1);
                var msg = messageFormat.replace(/%(\d)/g, function(whole, idx) {
                  assert_1.assert(idx < args.length, "Message reference must be in range");
                  return args[idx];
                });
                var index = this.lastMarker.index;
                var line = this.lastMarker.line;
                var column = this.lastMarker.column + 1;
                throw this.errorHandler.createError(index, line, column, msg);
              };
              Parser3.prototype.tolerateError = function(messageFormat) {
                var args = Array.prototype.slice.call(arguments, 1);
                var msg = messageFormat.replace(/%(\d)/g, function(whole, idx) {
                  assert_1.assert(idx < args.length, "Message reference must be in range");
                  return args[idx];
                });
                var index = this.lastMarker.index;
                var line = this.scanner.lineNumber;
                var column = this.lastMarker.column + 1;
                this.errorHandler.tolerateError(index, line, column, msg);
              };
              Parser3.prototype.unexpectedTokenError = function(token, message) {
                var msg = message || messages_1.Messages.UnexpectedToken;
                var value;
                if (token) {
                  if (!message) {
                    msg = token.type === 2 ? messages_1.Messages.UnexpectedEOS : token.type === 3 ? messages_1.Messages.UnexpectedIdentifier : token.type === 6 ? messages_1.Messages.UnexpectedNumber : token.type === 8 ? messages_1.Messages.UnexpectedString : token.type === 10 ? messages_1.Messages.UnexpectedTemplate : messages_1.Messages.UnexpectedToken;
                    if (token.type === 4) {
                      if (this.scanner.isFutureReservedWord(token.value)) {
                        msg = messages_1.Messages.UnexpectedReserved;
                      } else if (this.context.strict && this.scanner.isStrictModeReservedWord(token.value)) {
                        msg = messages_1.Messages.StrictReservedWord;
                      }
                    }
                  }
                  value = token.value;
                } else {
                  value = "ILLEGAL";
                }
                msg = msg.replace("%0", value);
                if (token && typeof token.lineNumber === "number") {
                  var index = token.start;
                  var line = token.lineNumber;
                  var lastMarkerLineStart = this.lastMarker.index - this.lastMarker.column;
                  var column = token.start - lastMarkerLineStart + 1;
                  return this.errorHandler.createError(index, line, column, msg);
                } else {
                  var index = this.lastMarker.index;
                  var line = this.lastMarker.line;
                  var column = this.lastMarker.column + 1;
                  return this.errorHandler.createError(index, line, column, msg);
                }
              };
              Parser3.prototype.throwUnexpectedToken = function(token, message) {
                throw this.unexpectedTokenError(token, message);
              };
              Parser3.prototype.tolerateUnexpectedToken = function(token, message) {
                this.errorHandler.tolerate(this.unexpectedTokenError(token, message));
              };
              Parser3.prototype.collectComments = function() {
                if (!this.config.comment) {
                  this.scanner.scanComments();
                } else {
                  var comments = this.scanner.scanComments();
                  if (comments.length > 0 && this.delegate) {
                    for (var i7 = 0; i7 < comments.length; ++i7) {
                      var e10 = comments[i7];
                      var node2 = void 0;
                      node2 = {
                        type: e10.multiLine ? "BlockComment" : "LineComment",
                        value: this.scanner.source.slice(e10.slice[0], e10.slice[1])
                      };
                      if (this.config.range) {
                        node2.range = e10.range;
                      }
                      if (this.config.loc) {
                        node2.loc = e10.loc;
                      }
                      var metadata = {
                        start: {
                          line: e10.loc.start.line,
                          column: e10.loc.start.column,
                          offset: e10.range[0]
                        },
                        end: {
                          line: e10.loc.end.line,
                          column: e10.loc.end.column,
                          offset: e10.range[1]
                        }
                      };
                      this.delegate(node2, metadata);
                    }
                  }
                }
              };
              Parser3.prototype.getTokenRaw = function(token) {
                return this.scanner.source.slice(token.start, token.end);
              };
              Parser3.prototype.convertToken = function(token) {
                var t13 = {
                  type: token_1.TokenName[token.type],
                  value: this.getTokenRaw(token)
                };
                if (this.config.range) {
                  t13.range = [token.start, token.end];
                }
                if (this.config.loc) {
                  t13.loc = {
                    start: {
                      line: this.startMarker.line,
                      column: this.startMarker.column
                    },
                    end: {
                      line: this.scanner.lineNumber,
                      column: this.scanner.index - this.scanner.lineStart
                    }
                  };
                }
                if (token.type === 9) {
                  var pattern = token.pattern;
                  var flags2 = token.flags;
                  t13.regex = { pattern, flags: flags2 };
                }
                return t13;
              };
              Parser3.prototype.nextToken = function() {
                var token = this.lookahead;
                this.lastMarker.index = this.scanner.index;
                this.lastMarker.line = this.scanner.lineNumber;
                this.lastMarker.column = this.scanner.index - this.scanner.lineStart;
                this.collectComments();
                if (this.scanner.index !== this.startMarker.index) {
                  this.startMarker.index = this.scanner.index;
                  this.startMarker.line = this.scanner.lineNumber;
                  this.startMarker.column = this.scanner.index - this.scanner.lineStart;
                }
                var next = this.scanner.lex();
                this.hasLineTerminator = token.lineNumber !== next.lineNumber;
                if (next && this.context.strict && next.type === 3) {
                  if (this.scanner.isStrictModeReservedWord(next.value)) {
                    next.type = 4;
                  }
                }
                this.lookahead = next;
                if (this.config.tokens && next.type !== 2) {
                  this.tokens.push(this.convertToken(next));
                }
                return token;
              };
              Parser3.prototype.nextRegexToken = function() {
                this.collectComments();
                var token = this.scanner.scanRegExp();
                if (this.config.tokens) {
                  this.tokens.pop();
                  this.tokens.push(this.convertToken(token));
                }
                this.lookahead = token;
                this.nextToken();
                return token;
              };
              Parser3.prototype.createNode = function() {
                return {
                  index: this.startMarker.index,
                  line: this.startMarker.line,
                  column: this.startMarker.column
                };
              };
              Parser3.prototype.startNode = function(token, lastLineStart) {
                if (lastLineStart === void 0) {
                  lastLineStart = 0;
                }
                var column = token.start - token.lineStart;
                var line = token.lineNumber;
                if (column < 0) {
                  column += lastLineStart;
                  line--;
                }
                return {
                  index: token.start,
                  line,
                  column
                };
              };
              Parser3.prototype.finalize = function(marker, node2) {
                if (this.config.range) {
                  node2.range = [marker.index, this.lastMarker.index];
                }
                if (this.config.loc) {
                  node2.loc = {
                    start: {
                      line: marker.line,
                      column: marker.column
                    },
                    end: {
                      line: this.lastMarker.line,
                      column: this.lastMarker.column
                    }
                  };
                  if (this.config.source) {
                    node2.loc.source = this.config.source;
                  }
                }
                if (this.delegate) {
                  var metadata = {
                    start: {
                      line: marker.line,
                      column: marker.column,
                      offset: marker.index
                    },
                    end: {
                      line: this.lastMarker.line,
                      column: this.lastMarker.column,
                      offset: this.lastMarker.index
                    }
                  };
                  this.delegate(node2, metadata);
                }
                return node2;
              };
              Parser3.prototype.expect = function(value) {
                var token = this.nextToken();
                if (token.type !== 7 || token.value !== value) {
                  this.throwUnexpectedToken(token);
                }
              };
              Parser3.prototype.expectCommaSeparator = function() {
                if (this.config.tolerant) {
                  var token = this.lookahead;
                  if (token.type === 7 && token.value === ",") {
                    this.nextToken();
                  } else if (token.type === 7 && token.value === ";") {
                    this.nextToken();
                    this.tolerateUnexpectedToken(token);
                  } else {
                    this.tolerateUnexpectedToken(token, messages_1.Messages.UnexpectedToken);
                  }
                } else {
                  this.expect(",");
                }
              };
              Parser3.prototype.expectKeyword = function(keyword) {
                var token = this.nextToken();
                if (token.type !== 4 || token.value !== keyword) {
                  this.throwUnexpectedToken(token);
                }
              };
              Parser3.prototype.match = function(value) {
                return this.lookahead.type === 7 && this.lookahead.value === value;
              };
              Parser3.prototype.matchKeyword = function(keyword) {
                return this.lookahead.type === 4 && this.lookahead.value === keyword;
              };
              Parser3.prototype.matchContextualKeyword = function(keyword) {
                return this.lookahead.type === 3 && this.lookahead.value === keyword;
              };
              Parser3.prototype.matchAssign = function() {
                if (this.lookahead.type !== 7) {
                  return false;
                }
                var op = this.lookahead.value;
                return op === "=" || op === "*=" || op === "**=" || op === "/=" || op === "%=" || op === "+=" || op === "-=" || op === "<<=" || op === ">>=" || op === ">>>=" || op === "&=" || op === "^=" || op === "|=";
              };
              Parser3.prototype.isolateCoverGrammar = function(parseFunction) {
                var previousIsBindingElement = this.context.isBindingElement;
                var previousIsAssignmentTarget = this.context.isAssignmentTarget;
                var previousFirstCoverInitializedNameError = this.context.firstCoverInitializedNameError;
                this.context.isBindingElement = true;
                this.context.isAssignmentTarget = true;
                this.context.firstCoverInitializedNameError = null;
                var result = parseFunction.call(this);
                if (this.context.firstCoverInitializedNameError !== null) {
                  this.throwUnexpectedToken(this.context.firstCoverInitializedNameError);
                }
                this.context.isBindingElement = previousIsBindingElement;
                this.context.isAssignmentTarget = previousIsAssignmentTarget;
                this.context.firstCoverInitializedNameError = previousFirstCoverInitializedNameError;
                return result;
              };
              Parser3.prototype.inheritCoverGrammar = function(parseFunction) {
                var previousIsBindingElement = this.context.isBindingElement;
                var previousIsAssignmentTarget = this.context.isAssignmentTarget;
                var previousFirstCoverInitializedNameError = this.context.firstCoverInitializedNameError;
                this.context.isBindingElement = true;
                this.context.isAssignmentTarget = true;
                this.context.firstCoverInitializedNameError = null;
                var result = parseFunction.call(this);
                this.context.isBindingElement = this.context.isBindingElement && previousIsBindingElement;
                this.context.isAssignmentTarget = this.context.isAssignmentTarget && previousIsAssignmentTarget;
                this.context.firstCoverInitializedNameError = previousFirstCoverInitializedNameError || this.context.firstCoverInitializedNameError;
                return result;
              };
              Parser3.prototype.consumeSemicolon = function() {
                if (this.match(";")) {
                  this.nextToken();
                } else if (!this.hasLineTerminator) {
                  if (this.lookahead.type !== 2 && !this.match("}")) {
                    this.throwUnexpectedToken(this.lookahead);
                  }
                  this.lastMarker.index = this.startMarker.index;
                  this.lastMarker.line = this.startMarker.line;
                  this.lastMarker.column = this.startMarker.column;
                }
              };
              Parser3.prototype.parsePrimaryExpression = function() {
                var node2 = this.createNode();
                var expr;
                var token, raw;
                switch (this.lookahead.type) {
                  case 3:
                    if ((this.context.isModule || this.context.await) && this.lookahead.value === "await") {
                      this.tolerateUnexpectedToken(this.lookahead);
                    }
                    expr = this.matchAsyncFunction() ? this.parseFunctionExpression() : this.finalize(node2, new Node3.Identifier(this.nextToken().value));
                    break;
                  case 6:
                  case 8:
                    if (this.context.strict && this.lookahead.octal) {
                      this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.StrictOctalLiteral);
                    }
                    this.context.isAssignmentTarget = false;
                    this.context.isBindingElement = false;
                    token = this.nextToken();
                    raw = this.getTokenRaw(token);
                    expr = this.finalize(node2, new Node3.Literal(token.value, raw));
                    break;
                  case 1:
                    this.context.isAssignmentTarget = false;
                    this.context.isBindingElement = false;
                    token = this.nextToken();
                    raw = this.getTokenRaw(token);
                    expr = this.finalize(node2, new Node3.Literal(token.value === "true", raw));
                    break;
                  case 5:
                    this.context.isAssignmentTarget = false;
                    this.context.isBindingElement = false;
                    token = this.nextToken();
                    raw = this.getTokenRaw(token);
                    expr = this.finalize(node2, new Node3.Literal(null, raw));
                    break;
                  case 10:
                    expr = this.parseTemplateLiteral();
                    break;
                  case 7:
                    switch (this.lookahead.value) {
                      case "(":
                        this.context.isBindingElement = false;
                        expr = this.inheritCoverGrammar(this.parseGroupExpression);
                        break;
                      case "[":
                        expr = this.inheritCoverGrammar(this.parseArrayInitializer);
                        break;
                      case "{":
                        expr = this.inheritCoverGrammar(this.parseObjectInitializer);
                        break;
                      case "/":
                      case "/=":
                        this.context.isAssignmentTarget = false;
                        this.context.isBindingElement = false;
                        this.scanner.index = this.startMarker.index;
                        token = this.nextRegexToken();
                        raw = this.getTokenRaw(token);
                        expr = this.finalize(node2, new Node3.RegexLiteral(token.regex, raw, token.pattern, token.flags));
                        break;
                      default:
                        expr = this.throwUnexpectedToken(this.nextToken());
                    }
                    break;
                  case 4:
                    if (!this.context.strict && this.context.allowYield && this.matchKeyword("yield")) {
                      expr = this.parseIdentifierName();
                    } else if (!this.context.strict && this.matchKeyword("let")) {
                      expr = this.finalize(node2, new Node3.Identifier(this.nextToken().value));
                    } else {
                      this.context.isAssignmentTarget = false;
                      this.context.isBindingElement = false;
                      if (this.matchKeyword("function")) {
                        expr = this.parseFunctionExpression();
                      } else if (this.matchKeyword("this")) {
                        this.nextToken();
                        expr = this.finalize(node2, new Node3.ThisExpression());
                      } else if (this.matchKeyword("class")) {
                        expr = this.parseClassExpression();
                      } else {
                        expr = this.throwUnexpectedToken(this.nextToken());
                      }
                    }
                    break;
                  default:
                    expr = this.throwUnexpectedToken(this.nextToken());
                }
                return expr;
              };
              Parser3.prototype.parseSpreadElement = function() {
                var node2 = this.createNode();
                this.expect("...");
                var arg = this.inheritCoverGrammar(this.parseAssignmentExpression);
                return this.finalize(node2, new Node3.SpreadElement(arg));
              };
              Parser3.prototype.parseArrayInitializer = function() {
                var node2 = this.createNode();
                var elements = [];
                this.expect("[");
                while (!this.match("]")) {
                  if (this.match(",")) {
                    this.nextToken();
                    elements.push(null);
                  } else if (this.match("...")) {
                    var element = this.parseSpreadElement();
                    if (!this.match("]")) {
                      this.context.isAssignmentTarget = false;
                      this.context.isBindingElement = false;
                      this.expect(",");
                    }
                    elements.push(element);
                  } else {
                    elements.push(this.inheritCoverGrammar(this.parseAssignmentExpression));
                    if (!this.match("]")) {
                      this.expect(",");
                    }
                  }
                }
                this.expect("]");
                return this.finalize(node2, new Node3.ArrayExpression(elements));
              };
              Parser3.prototype.parsePropertyMethod = function(params) {
                this.context.isAssignmentTarget = false;
                this.context.isBindingElement = false;
                var previousStrict = this.context.strict;
                var previousAllowStrictDirective = this.context.allowStrictDirective;
                this.context.allowStrictDirective = params.simple;
                var body = this.isolateCoverGrammar(this.parseFunctionSourceElements);
                if (this.context.strict && params.firstRestricted) {
                  this.tolerateUnexpectedToken(params.firstRestricted, params.message);
                }
                if (this.context.strict && params.stricted) {
                  this.tolerateUnexpectedToken(params.stricted, params.message);
                }
                this.context.strict = previousStrict;
                this.context.allowStrictDirective = previousAllowStrictDirective;
                return body;
              };
              Parser3.prototype.parsePropertyMethodFunction = function() {
                var isGenerator = false;
                var node2 = this.createNode();
                var previousAllowYield = this.context.allowYield;
                this.context.allowYield = true;
                var params = this.parseFormalParameters();
                var method = this.parsePropertyMethod(params);
                this.context.allowYield = previousAllowYield;
                return this.finalize(node2, new Node3.FunctionExpression(null, params.params, method, isGenerator));
              };
              Parser3.prototype.parsePropertyMethodAsyncFunction = function() {
                var node2 = this.createNode();
                var previousAllowYield = this.context.allowYield;
                var previousAwait = this.context.await;
                this.context.allowYield = false;
                this.context.await = true;
                var params = this.parseFormalParameters();
                var method = this.parsePropertyMethod(params);
                this.context.allowYield = previousAllowYield;
                this.context.await = previousAwait;
                return this.finalize(node2, new Node3.AsyncFunctionExpression(null, params.params, method));
              };
              Parser3.prototype.parseObjectPropertyKey = function() {
                var node2 = this.createNode();
                var token = this.nextToken();
                var key;
                switch (token.type) {
                  case 8:
                  case 6:
                    if (this.context.strict && token.octal) {
                      this.tolerateUnexpectedToken(token, messages_1.Messages.StrictOctalLiteral);
                    }
                    var raw = this.getTokenRaw(token);
                    key = this.finalize(node2, new Node3.Literal(token.value, raw));
                    break;
                  case 3:
                  case 1:
                  case 5:
                  case 4:
                    key = this.finalize(node2, new Node3.Identifier(token.value));
                    break;
                  case 7:
                    if (token.value === "[") {
                      key = this.isolateCoverGrammar(this.parseAssignmentExpression);
                      this.expect("]");
                    } else {
                      key = this.throwUnexpectedToken(token);
                    }
                    break;
                  default:
                    key = this.throwUnexpectedToken(token);
                }
                return key;
              };
              Parser3.prototype.isPropertyKey = function(key, value) {
                return key.type === syntax_1.Syntax.Identifier && key.name === value || key.type === syntax_1.Syntax.Literal && key.value === value;
              };
              Parser3.prototype.parseObjectProperty = function(hasProto) {
                var node2 = this.createNode();
                var token = this.lookahead;
                var kind2;
                var key = null;
                var value = null;
                var computed = false;
                var method = false;
                var shorthand = false;
                var isAsync4 = false;
                if (token.type === 3) {
                  var id = token.value;
                  this.nextToken();
                  computed = this.match("[");
                  isAsync4 = !this.hasLineTerminator && id === "async" && !this.match(":") && !this.match("(") && !this.match("*") && !this.match(",");
                  key = isAsync4 ? this.parseObjectPropertyKey() : this.finalize(node2, new Node3.Identifier(id));
                } else if (this.match("*")) {
                  this.nextToken();
                } else {
                  computed = this.match("[");
                  key = this.parseObjectPropertyKey();
                }
                var lookaheadPropertyKey = this.qualifiedPropertyName(this.lookahead);
                if (token.type === 3 && !isAsync4 && token.value === "get" && lookaheadPropertyKey) {
                  kind2 = "get";
                  computed = this.match("[");
                  key = this.parseObjectPropertyKey();
                  this.context.allowYield = false;
                  value = this.parseGetterMethod();
                } else if (token.type === 3 && !isAsync4 && token.value === "set" && lookaheadPropertyKey) {
                  kind2 = "set";
                  computed = this.match("[");
                  key = this.parseObjectPropertyKey();
                  value = this.parseSetterMethod();
                } else if (token.type === 7 && token.value === "*" && lookaheadPropertyKey) {
                  kind2 = "init";
                  computed = this.match("[");
                  key = this.parseObjectPropertyKey();
                  value = this.parseGeneratorMethod();
                  method = true;
                } else {
                  if (!key) {
                    this.throwUnexpectedToken(this.lookahead);
                  }
                  kind2 = "init";
                  if (this.match(":") && !isAsync4) {
                    if (!computed && this.isPropertyKey(key, "__proto__")) {
                      if (hasProto.value) {
                        this.tolerateError(messages_1.Messages.DuplicateProtoProperty);
                      }
                      hasProto.value = true;
                    }
                    this.nextToken();
                    value = this.inheritCoverGrammar(this.parseAssignmentExpression);
                  } else if (this.match("(")) {
                    value = isAsync4 ? this.parsePropertyMethodAsyncFunction() : this.parsePropertyMethodFunction();
                    method = true;
                  } else if (token.type === 3) {
                    var id = this.finalize(node2, new Node3.Identifier(token.value));
                    if (this.match("=")) {
                      this.context.firstCoverInitializedNameError = this.lookahead;
                      this.nextToken();
                      shorthand = true;
                      var init4 = this.isolateCoverGrammar(this.parseAssignmentExpression);
                      value = this.finalize(node2, new Node3.AssignmentPattern(id, init4));
                    } else {
                      shorthand = true;
                      value = id;
                    }
                  } else {
                    this.throwUnexpectedToken(this.nextToken());
                  }
                }
                return this.finalize(node2, new Node3.Property(kind2, key, computed, value, method, shorthand));
              };
              Parser3.prototype.parseObjectInitializer = function() {
                var node2 = this.createNode();
                this.expect("{");
                var properties = [];
                var hasProto = { value: false };
                while (!this.match("}")) {
                  properties.push(this.parseObjectProperty(hasProto));
                  if (!this.match("}")) {
                    this.expectCommaSeparator();
                  }
                }
                this.expect("}");
                return this.finalize(node2, new Node3.ObjectExpression(properties));
              };
              Parser3.prototype.parseTemplateHead = function() {
                assert_1.assert(this.lookahead.head, "Template literal must start with a template head");
                var node2 = this.createNode();
                var token = this.nextToken();
                var raw = token.value;
                var cooked = token.cooked;
                return this.finalize(node2, new Node3.TemplateElement({ raw, cooked }, token.tail));
              };
              Parser3.prototype.parseTemplateElement = function() {
                if (this.lookahead.type !== 10) {
                  this.throwUnexpectedToken();
                }
                var node2 = this.createNode();
                var token = this.nextToken();
                var raw = token.value;
                var cooked = token.cooked;
                return this.finalize(node2, new Node3.TemplateElement({ raw, cooked }, token.tail));
              };
              Parser3.prototype.parseTemplateLiteral = function() {
                var node2 = this.createNode();
                var expressions = [];
                var quasis = [];
                var quasi = this.parseTemplateHead();
                quasis.push(quasi);
                while (!quasi.tail) {
                  expressions.push(this.parseExpression());
                  quasi = this.parseTemplateElement();
                  quasis.push(quasi);
                }
                return this.finalize(node2, new Node3.TemplateLiteral(quasis, expressions));
              };
              Parser3.prototype.reinterpretExpressionAsPattern = function(expr) {
                switch (expr.type) {
                  case syntax_1.Syntax.Identifier:
                  case syntax_1.Syntax.MemberExpression:
                  case syntax_1.Syntax.RestElement:
                  case syntax_1.Syntax.AssignmentPattern:
                    break;
                  case syntax_1.Syntax.SpreadElement:
                    expr.type = syntax_1.Syntax.RestElement;
                    this.reinterpretExpressionAsPattern(expr.argument);
                    break;
                  case syntax_1.Syntax.ArrayExpression:
                    expr.type = syntax_1.Syntax.ArrayPattern;
                    for (var i7 = 0; i7 < expr.elements.length; i7++) {
                      if (expr.elements[i7] !== null) {
                        this.reinterpretExpressionAsPattern(expr.elements[i7]);
                      }
                    }
                    break;
                  case syntax_1.Syntax.ObjectExpression:
                    expr.type = syntax_1.Syntax.ObjectPattern;
                    for (var i7 = 0; i7 < expr.properties.length; i7++) {
                      this.reinterpretExpressionAsPattern(expr.properties[i7].value);
                    }
                    break;
                  case syntax_1.Syntax.AssignmentExpression:
                    expr.type = syntax_1.Syntax.AssignmentPattern;
                    delete expr.operator;
                    this.reinterpretExpressionAsPattern(expr.left);
                    break;
                }
              };
              Parser3.prototype.parseGroupExpression = function() {
                var expr;
                this.expect("(");
                if (this.match(")")) {
                  this.nextToken();
                  if (!this.match("=>")) {
                    this.expect("=>");
                  }
                  expr = {
                    type: ArrowParameterPlaceHolder,
                    params: [],
                    async: false
                  };
                } else {
                  var startToken = this.lookahead;
                  var params = [];
                  if (this.match("...")) {
                    expr = this.parseRestElement(params);
                    this.expect(")");
                    if (!this.match("=>")) {
                      this.expect("=>");
                    }
                    expr = {
                      type: ArrowParameterPlaceHolder,
                      params: [expr],
                      async: false
                    };
                  } else {
                    var arrow = false;
                    this.context.isBindingElement = true;
                    expr = this.inheritCoverGrammar(this.parseAssignmentExpression);
                    if (this.match(",")) {
                      var expressions = [];
                      this.context.isAssignmentTarget = false;
                      expressions.push(expr);
                      while (this.lookahead.type !== 2) {
                        if (!this.match(",")) {
                          break;
                        }
                        this.nextToken();
                        if (this.match(")")) {
                          this.nextToken();
                          for (var i7 = 0; i7 < expressions.length; i7++) {
                            this.reinterpretExpressionAsPattern(expressions[i7]);
                          }
                          arrow = true;
                          expr = {
                            type: ArrowParameterPlaceHolder,
                            params: expressions,
                            async: false
                          };
                        } else if (this.match("...")) {
                          if (!this.context.isBindingElement) {
                            this.throwUnexpectedToken(this.lookahead);
                          }
                          expressions.push(this.parseRestElement(params));
                          this.expect(")");
                          if (!this.match("=>")) {
                            this.expect("=>");
                          }
                          this.context.isBindingElement = false;
                          for (var i7 = 0; i7 < expressions.length; i7++) {
                            this.reinterpretExpressionAsPattern(expressions[i7]);
                          }
                          arrow = true;
                          expr = {
                            type: ArrowParameterPlaceHolder,
                            params: expressions,
                            async: false
                          };
                        } else {
                          expressions.push(this.inheritCoverGrammar(this.parseAssignmentExpression));
                        }
                        if (arrow) {
                          break;
                        }
                      }
                      if (!arrow) {
                        expr = this.finalize(this.startNode(startToken), new Node3.SequenceExpression(expressions));
                      }
                    }
                    if (!arrow) {
                      this.expect(")");
                      if (this.match("=>")) {
                        if (expr.type === syntax_1.Syntax.Identifier && expr.name === "yield") {
                          arrow = true;
                          expr = {
                            type: ArrowParameterPlaceHolder,
                            params: [expr],
                            async: false
                          };
                        }
                        if (!arrow) {
                          if (!this.context.isBindingElement) {
                            this.throwUnexpectedToken(this.lookahead);
                          }
                          if (expr.type === syntax_1.Syntax.SequenceExpression) {
                            for (var i7 = 0; i7 < expr.expressions.length; i7++) {
                              this.reinterpretExpressionAsPattern(expr.expressions[i7]);
                            }
                          } else {
                            this.reinterpretExpressionAsPattern(expr);
                          }
                          var parameters = expr.type === syntax_1.Syntax.SequenceExpression ? expr.expressions : [expr];
                          expr = {
                            type: ArrowParameterPlaceHolder,
                            params: parameters,
                            async: false
                          };
                        }
                      }
                      this.context.isBindingElement = false;
                    }
                  }
                }
                return expr;
              };
              Parser3.prototype.parseArguments = function() {
                this.expect("(");
                var args = [];
                if (!this.match(")")) {
                  while (true) {
                    var expr = this.match("...") ? this.parseSpreadElement() : this.isolateCoverGrammar(this.parseAssignmentExpression);
                    args.push(expr);
                    if (this.match(")")) {
                      break;
                    }
                    this.expectCommaSeparator();
                    if (this.match(")")) {
                      break;
                    }
                  }
                }
                this.expect(")");
                return args;
              };
              Parser3.prototype.isIdentifierName = function(token) {
                return token.type === 3 || token.type === 4 || token.type === 1 || token.type === 5;
              };
              Parser3.prototype.parseIdentifierName = function() {
                var node2 = this.createNode();
                var token = this.nextToken();
                if (!this.isIdentifierName(token)) {
                  this.throwUnexpectedToken(token);
                }
                return this.finalize(node2, new Node3.Identifier(token.value));
              };
              Parser3.prototype.parseNewExpression = function() {
                var node2 = this.createNode();
                var id = this.parseIdentifierName();
                assert_1.assert(id.name === "new", "New expression must start with `new`");
                var expr;
                if (this.match(".")) {
                  this.nextToken();
                  if (this.lookahead.type === 3 && this.context.inFunctionBody && this.lookahead.value === "target") {
                    var property = this.parseIdentifierName();
                    expr = new Node3.MetaProperty(id, property);
                  } else {
                    this.throwUnexpectedToken(this.lookahead);
                  }
                } else {
                  var callee = this.isolateCoverGrammar(this.parseLeftHandSideExpression);
                  var args = this.match("(") ? this.parseArguments() : [];
                  expr = new Node3.NewExpression(callee, args);
                  this.context.isAssignmentTarget = false;
                  this.context.isBindingElement = false;
                }
                return this.finalize(node2, expr);
              };
              Parser3.prototype.parseAsyncArgument = function() {
                var arg = this.parseAssignmentExpression();
                this.context.firstCoverInitializedNameError = null;
                return arg;
              };
              Parser3.prototype.parseAsyncArguments = function() {
                this.expect("(");
                var args = [];
                if (!this.match(")")) {
                  while (true) {
                    var expr = this.match("...") ? this.parseSpreadElement() : this.isolateCoverGrammar(this.parseAsyncArgument);
                    args.push(expr);
                    if (this.match(")")) {
                      break;
                    }
                    this.expectCommaSeparator();
                    if (this.match(")")) {
                      break;
                    }
                  }
                }
                this.expect(")");
                return args;
              };
              Parser3.prototype.parseLeftHandSideExpressionAllowCall = function() {
                var startToken = this.lookahead;
                var maybeAsync = this.matchContextualKeyword("async");
                var previousAllowIn = this.context.allowIn;
                this.context.allowIn = true;
                var expr;
                if (this.matchKeyword("super") && this.context.inFunctionBody) {
                  expr = this.createNode();
                  this.nextToken();
                  expr = this.finalize(expr, new Node3.Super());
                  if (!this.match("(") && !this.match(".") && !this.match("[")) {
                    this.throwUnexpectedToken(this.lookahead);
                  }
                } else {
                  expr = this.inheritCoverGrammar(this.matchKeyword("new") ? this.parseNewExpression : this.parsePrimaryExpression);
                }
                while (true) {
                  if (this.match(".")) {
                    this.context.isBindingElement = false;
                    this.context.isAssignmentTarget = true;
                    this.expect(".");
                    var property = this.parseIdentifierName();
                    expr = this.finalize(this.startNode(startToken), new Node3.StaticMemberExpression(expr, property));
                  } else if (this.match("(")) {
                    var asyncArrow = maybeAsync && startToken.lineNumber === this.lookahead.lineNumber;
                    this.context.isBindingElement = false;
                    this.context.isAssignmentTarget = false;
                    var args = asyncArrow ? this.parseAsyncArguments() : this.parseArguments();
                    expr = this.finalize(this.startNode(startToken), new Node3.CallExpression(expr, args));
                    if (asyncArrow && this.match("=>")) {
                      for (var i7 = 0; i7 < args.length; ++i7) {
                        this.reinterpretExpressionAsPattern(args[i7]);
                      }
                      expr = {
                        type: ArrowParameterPlaceHolder,
                        params: args,
                        async: true
                      };
                    }
                  } else if (this.match("[")) {
                    this.context.isBindingElement = false;
                    this.context.isAssignmentTarget = true;
                    this.expect("[");
                    var property = this.isolateCoverGrammar(this.parseExpression);
                    this.expect("]");
                    expr = this.finalize(this.startNode(startToken), new Node3.ComputedMemberExpression(expr, property));
                  } else if (this.lookahead.type === 10 && this.lookahead.head) {
                    var quasi = this.parseTemplateLiteral();
                    expr = this.finalize(this.startNode(startToken), new Node3.TaggedTemplateExpression(expr, quasi));
                  } else {
                    break;
                  }
                }
                this.context.allowIn = previousAllowIn;
                return expr;
              };
              Parser3.prototype.parseSuper = function() {
                var node2 = this.createNode();
                this.expectKeyword("super");
                if (!this.match("[") && !this.match(".")) {
                  this.throwUnexpectedToken(this.lookahead);
                }
                return this.finalize(node2, new Node3.Super());
              };
              Parser3.prototype.parseLeftHandSideExpression = function() {
                assert_1.assert(this.context.allowIn, "callee of new expression always allow in keyword.");
                var node2 = this.startNode(this.lookahead);
                var expr = this.matchKeyword("super") && this.context.inFunctionBody ? this.parseSuper() : this.inheritCoverGrammar(this.matchKeyword("new") ? this.parseNewExpression : this.parsePrimaryExpression);
                while (true) {
                  if (this.match("[")) {
                    this.context.isBindingElement = false;
                    this.context.isAssignmentTarget = true;
                    this.expect("[");
                    var property = this.isolateCoverGrammar(this.parseExpression);
                    this.expect("]");
                    expr = this.finalize(node2, new Node3.ComputedMemberExpression(expr, property));
                  } else if (this.match(".")) {
                    this.context.isBindingElement = false;
                    this.context.isAssignmentTarget = true;
                    this.expect(".");
                    var property = this.parseIdentifierName();
                    expr = this.finalize(node2, new Node3.StaticMemberExpression(expr, property));
                  } else if (this.lookahead.type === 10 && this.lookahead.head) {
                    var quasi = this.parseTemplateLiteral();
                    expr = this.finalize(node2, new Node3.TaggedTemplateExpression(expr, quasi));
                  } else {
                    break;
                  }
                }
                return expr;
              };
              Parser3.prototype.parseUpdateExpression = function() {
                var expr;
                var startToken = this.lookahead;
                if (this.match("++") || this.match("--")) {
                  var node2 = this.startNode(startToken);
                  var token = this.nextToken();
                  expr = this.inheritCoverGrammar(this.parseUnaryExpression);
                  if (this.context.strict && expr.type === syntax_1.Syntax.Identifier && this.scanner.isRestrictedWord(expr.name)) {
                    this.tolerateError(messages_1.Messages.StrictLHSPrefix);
                  }
                  if (!this.context.isAssignmentTarget) {
                    this.tolerateError(messages_1.Messages.InvalidLHSInAssignment);
                  }
                  var prefix = true;
                  expr = this.finalize(node2, new Node3.UpdateExpression(token.value, expr, prefix));
                  this.context.isAssignmentTarget = false;
                  this.context.isBindingElement = false;
                } else {
                  expr = this.inheritCoverGrammar(this.parseLeftHandSideExpressionAllowCall);
                  if (!this.hasLineTerminator && this.lookahead.type === 7) {
                    if (this.match("++") || this.match("--")) {
                      if (this.context.strict && expr.type === syntax_1.Syntax.Identifier && this.scanner.isRestrictedWord(expr.name)) {
                        this.tolerateError(messages_1.Messages.StrictLHSPostfix);
                      }
                      if (!this.context.isAssignmentTarget) {
                        this.tolerateError(messages_1.Messages.InvalidLHSInAssignment);
                      }
                      this.context.isAssignmentTarget = false;
                      this.context.isBindingElement = false;
                      var operator = this.nextToken().value;
                      var prefix = false;
                      expr = this.finalize(this.startNode(startToken), new Node3.UpdateExpression(operator, expr, prefix));
                    }
                  }
                }
                return expr;
              };
              Parser3.prototype.parseAwaitExpression = function() {
                var node2 = this.createNode();
                this.nextToken();
                var argument = this.parseUnaryExpression();
                return this.finalize(node2, new Node3.AwaitExpression(argument));
              };
              Parser3.prototype.parseUnaryExpression = function() {
                var expr;
                if (this.match("+") || this.match("-") || this.match("~") || this.match("!") || this.matchKeyword("delete") || this.matchKeyword("void") || this.matchKeyword("typeof")) {
                  var node2 = this.startNode(this.lookahead);
                  var token = this.nextToken();
                  expr = this.inheritCoverGrammar(this.parseUnaryExpression);
                  expr = this.finalize(node2, new Node3.UnaryExpression(token.value, expr));
                  if (this.context.strict && expr.operator === "delete" && expr.argument.type === syntax_1.Syntax.Identifier) {
                    this.tolerateError(messages_1.Messages.StrictDelete);
                  }
                  this.context.isAssignmentTarget = false;
                  this.context.isBindingElement = false;
                } else if (this.context.await && this.matchContextualKeyword("await")) {
                  expr = this.parseAwaitExpression();
                } else {
                  expr = this.parseUpdateExpression();
                }
                return expr;
              };
              Parser3.prototype.parseExponentiationExpression = function() {
                var startToken = this.lookahead;
                var expr = this.inheritCoverGrammar(this.parseUnaryExpression);
                if (expr.type !== syntax_1.Syntax.UnaryExpression && this.match("**")) {
                  this.nextToken();
                  this.context.isAssignmentTarget = false;
                  this.context.isBindingElement = false;
                  var left2 = expr;
                  var right2 = this.isolateCoverGrammar(this.parseExponentiationExpression);
                  expr = this.finalize(this.startNode(startToken), new Node3.BinaryExpression("**", left2, right2));
                }
                return expr;
              };
              Parser3.prototype.binaryPrecedence = function(token) {
                var op = token.value;
                var precedence;
                if (token.type === 7) {
                  precedence = this.operatorPrecedence[op] || 0;
                } else if (token.type === 4) {
                  precedence = op === "instanceof" || this.context.allowIn && op === "in" ? 7 : 0;
                } else {
                  precedence = 0;
                }
                return precedence;
              };
              Parser3.prototype.parseBinaryExpression = function() {
                var startToken = this.lookahead;
                var expr = this.inheritCoverGrammar(this.parseExponentiationExpression);
                var token = this.lookahead;
                var prec = this.binaryPrecedence(token);
                if (prec > 0) {
                  this.nextToken();
                  this.context.isAssignmentTarget = false;
                  this.context.isBindingElement = false;
                  var markers = [startToken, this.lookahead];
                  var left2 = expr;
                  var right2 = this.isolateCoverGrammar(this.parseExponentiationExpression);
                  var stack = [left2, token.value, right2];
                  var precedences = [prec];
                  while (true) {
                    prec = this.binaryPrecedence(this.lookahead);
                    if (prec <= 0) {
                      break;
                    }
                    while (stack.length > 2 && prec <= precedences[precedences.length - 1]) {
                      right2 = stack.pop();
                      var operator = stack.pop();
                      precedences.pop();
                      left2 = stack.pop();
                      markers.pop();
                      var node2 = this.startNode(markers[markers.length - 1]);
                      stack.push(this.finalize(node2, new Node3.BinaryExpression(operator, left2, right2)));
                    }
                    stack.push(this.nextToken().value);
                    precedences.push(prec);
                    markers.push(this.lookahead);
                    stack.push(this.isolateCoverGrammar(this.parseExponentiationExpression));
                  }
                  var i7 = stack.length - 1;
                  expr = stack[i7];
                  var lastMarker = markers.pop();
                  while (i7 > 1) {
                    var marker = markers.pop();
                    var lastLineStart = lastMarker && lastMarker.lineStart;
                    var node2 = this.startNode(marker, lastLineStart);
                    var operator = stack[i7 - 1];
                    expr = this.finalize(node2, new Node3.BinaryExpression(operator, stack[i7 - 2], expr));
                    i7 -= 2;
                    lastMarker = marker;
                  }
                }
                return expr;
              };
              Parser3.prototype.parseConditionalExpression = function() {
                var startToken = this.lookahead;
                var expr = this.inheritCoverGrammar(this.parseBinaryExpression);
                if (this.match("?")) {
                  this.nextToken();
                  var previousAllowIn = this.context.allowIn;
                  this.context.allowIn = true;
                  var consequent = this.isolateCoverGrammar(this.parseAssignmentExpression);
                  this.context.allowIn = previousAllowIn;
                  this.expect(":");
                  var alternate = this.isolateCoverGrammar(this.parseAssignmentExpression);
                  expr = this.finalize(this.startNode(startToken), new Node3.ConditionalExpression(expr, consequent, alternate));
                  this.context.isAssignmentTarget = false;
                  this.context.isBindingElement = false;
                }
                return expr;
              };
              Parser3.prototype.checkPatternParam = function(options, param) {
                switch (param.type) {
                  case syntax_1.Syntax.Identifier:
                    this.validateParam(options, param, param.name);
                    break;
                  case syntax_1.Syntax.RestElement:
                    this.checkPatternParam(options, param.argument);
                    break;
                  case syntax_1.Syntax.AssignmentPattern:
                    this.checkPatternParam(options, param.left);
                    break;
                  case syntax_1.Syntax.ArrayPattern:
                    for (var i7 = 0; i7 < param.elements.length; i7++) {
                      if (param.elements[i7] !== null) {
                        this.checkPatternParam(options, param.elements[i7]);
                      }
                    }
                    break;
                  case syntax_1.Syntax.ObjectPattern:
                    for (var i7 = 0; i7 < param.properties.length; i7++) {
                      this.checkPatternParam(options, param.properties[i7].value);
                    }
                    break;
                }
                options.simple = options.simple && param instanceof Node3.Identifier;
              };
              Parser3.prototype.reinterpretAsCoverFormalsList = function(expr) {
                var params = [expr];
                var options;
                var asyncArrow = false;
                switch (expr.type) {
                  case syntax_1.Syntax.Identifier:
                    break;
                  case ArrowParameterPlaceHolder:
                    params = expr.params;
                    asyncArrow = expr.async;
                    break;
                  default:
                    return null;
                }
                options = {
                  simple: true,
                  paramSet: {}
                };
                for (var i7 = 0; i7 < params.length; ++i7) {
                  var param = params[i7];
                  if (param.type === syntax_1.Syntax.AssignmentPattern) {
                    if (param.right.type === syntax_1.Syntax.YieldExpression) {
                      if (param.right.argument) {
                        this.throwUnexpectedToken(this.lookahead);
                      }
                      param.right.type = syntax_1.Syntax.Identifier;
                      param.right.name = "yield";
                      delete param.right.argument;
                      delete param.right.delegate;
                    }
                  } else if (asyncArrow && param.type === syntax_1.Syntax.Identifier && param.name === "await") {
                    this.throwUnexpectedToken(this.lookahead);
                  }
                  this.checkPatternParam(options, param);
                  params[i7] = param;
                }
                if (this.context.strict || !this.context.allowYield) {
                  for (var i7 = 0; i7 < params.length; ++i7) {
                    var param = params[i7];
                    if (param.type === syntax_1.Syntax.YieldExpression) {
                      this.throwUnexpectedToken(this.lookahead);
                    }
                  }
                }
                if (options.message === messages_1.Messages.StrictParamDupe) {
                  var token = this.context.strict ? options.stricted : options.firstRestricted;
                  this.throwUnexpectedToken(token, options.message);
                }
                return {
                  simple: options.simple,
                  params,
                  stricted: options.stricted,
                  firstRestricted: options.firstRestricted,
                  message: options.message
                };
              };
              Parser3.prototype.parseAssignmentExpression = function() {
                var expr;
                if (!this.context.allowYield && this.matchKeyword("yield")) {
                  expr = this.parseYieldExpression();
                } else {
                  var startToken = this.lookahead;
                  var token = startToken;
                  expr = this.parseConditionalExpression();
                  if (token.type === 3 && token.lineNumber === this.lookahead.lineNumber && token.value === "async") {
                    if (this.lookahead.type === 3 || this.matchKeyword("yield")) {
                      var arg = this.parsePrimaryExpression();
                      this.reinterpretExpressionAsPattern(arg);
                      expr = {
                        type: ArrowParameterPlaceHolder,
                        params: [arg],
                        async: true
                      };
                    }
                  }
                  if (expr.type === ArrowParameterPlaceHolder || this.match("=>")) {
                    this.context.isAssignmentTarget = false;
                    this.context.isBindingElement = false;
                    var isAsync4 = expr.async;
                    var list = this.reinterpretAsCoverFormalsList(expr);
                    if (list) {
                      if (this.hasLineTerminator) {
                        this.tolerateUnexpectedToken(this.lookahead);
                      }
                      this.context.firstCoverInitializedNameError = null;
                      var previousStrict = this.context.strict;
                      var previousAllowStrictDirective = this.context.allowStrictDirective;
                      this.context.allowStrictDirective = list.simple;
                      var previousAllowYield = this.context.allowYield;
                      var previousAwait = this.context.await;
                      this.context.allowYield = true;
                      this.context.await = isAsync4;
                      var node2 = this.startNode(startToken);
                      this.expect("=>");
                      var body = void 0;
                      if (this.match("{")) {
                        var previousAllowIn = this.context.allowIn;
                        this.context.allowIn = true;
                        body = this.parseFunctionSourceElements();
                        this.context.allowIn = previousAllowIn;
                      } else {
                        body = this.isolateCoverGrammar(this.parseAssignmentExpression);
                      }
                      var expression = body.type !== syntax_1.Syntax.BlockStatement;
                      if (this.context.strict && list.firstRestricted) {
                        this.throwUnexpectedToken(list.firstRestricted, list.message);
                      }
                      if (this.context.strict && list.stricted) {
                        this.tolerateUnexpectedToken(list.stricted, list.message);
                      }
                      expr = isAsync4 ? this.finalize(node2, new Node3.AsyncArrowFunctionExpression(list.params, body, expression)) : this.finalize(node2, new Node3.ArrowFunctionExpression(list.params, body, expression));
                      this.context.strict = previousStrict;
                      this.context.allowStrictDirective = previousAllowStrictDirective;
                      this.context.allowYield = previousAllowYield;
                      this.context.await = previousAwait;
                    }
                  } else {
                    if (this.matchAssign()) {
                      if (!this.context.isAssignmentTarget) {
                        this.tolerateError(messages_1.Messages.InvalidLHSInAssignment);
                      }
                      if (this.context.strict && expr.type === syntax_1.Syntax.Identifier) {
                        var id = expr;
                        if (this.scanner.isRestrictedWord(id.name)) {
                          this.tolerateUnexpectedToken(token, messages_1.Messages.StrictLHSAssignment);
                        }
                        if (this.scanner.isStrictModeReservedWord(id.name)) {
                          this.tolerateUnexpectedToken(token, messages_1.Messages.StrictReservedWord);
                        }
                      }
                      if (!this.match("=")) {
                        this.context.isAssignmentTarget = false;
                        this.context.isBindingElement = false;
                      } else {
                        this.reinterpretExpressionAsPattern(expr);
                      }
                      token = this.nextToken();
                      var operator = token.value;
                      var right2 = this.isolateCoverGrammar(this.parseAssignmentExpression);
                      expr = this.finalize(this.startNode(startToken), new Node3.AssignmentExpression(operator, expr, right2));
                      this.context.firstCoverInitializedNameError = null;
                    }
                  }
                }
                return expr;
              };
              Parser3.prototype.parseExpression = function() {
                var startToken = this.lookahead;
                var expr = this.isolateCoverGrammar(this.parseAssignmentExpression);
                if (this.match(",")) {
                  var expressions = [];
                  expressions.push(expr);
                  while (this.lookahead.type !== 2) {
                    if (!this.match(",")) {
                      break;
                    }
                    this.nextToken();
                    expressions.push(this.isolateCoverGrammar(this.parseAssignmentExpression));
                  }
                  expr = this.finalize(this.startNode(startToken), new Node3.SequenceExpression(expressions));
                }
                return expr;
              };
              Parser3.prototype.parseStatementListItem = function() {
                var statement;
                this.context.isAssignmentTarget = true;
                this.context.isBindingElement = true;
                if (this.lookahead.type === 4) {
                  switch (this.lookahead.value) {
                    case "export":
                      if (!this.context.isModule) {
                        this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.IllegalExportDeclaration);
                      }
                      statement = this.parseExportDeclaration();
                      break;
                    case "import":
                      if (!this.context.isModule) {
                        this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.IllegalImportDeclaration);
                      }
                      statement = this.parseImportDeclaration();
                      break;
                    case "const":
                      statement = this.parseLexicalDeclaration({ inFor: false });
                      break;
                    case "function":
                      statement = this.parseFunctionDeclaration();
                      break;
                    case "class":
                      statement = this.parseClassDeclaration();
                      break;
                    case "let":
                      statement = this.isLexicalDeclaration() ? this.parseLexicalDeclaration({ inFor: false }) : this.parseStatement();
                      break;
                    default:
                      statement = this.parseStatement();
                      break;
                  }
                } else {
                  statement = this.parseStatement();
                }
                return statement;
              };
              Parser3.prototype.parseBlock = function() {
                var node2 = this.createNode();
                this.expect("{");
                var block = [];
                while (true) {
                  if (this.match("}")) {
                    break;
                  }
                  block.push(this.parseStatementListItem());
                }
                this.expect("}");
                return this.finalize(node2, new Node3.BlockStatement(block));
              };
              Parser3.prototype.parseLexicalBinding = function(kind2, options) {
                var node2 = this.createNode();
                var params = [];
                var id = this.parsePattern(params, kind2);
                if (this.context.strict && id.type === syntax_1.Syntax.Identifier) {
                  if (this.scanner.isRestrictedWord(id.name)) {
                    this.tolerateError(messages_1.Messages.StrictVarName);
                  }
                }
                var init4 = null;
                if (kind2 === "const") {
                  if (!this.matchKeyword("in") && !this.matchContextualKeyword("of")) {
                    if (this.match("=")) {
                      this.nextToken();
                      init4 = this.isolateCoverGrammar(this.parseAssignmentExpression);
                    } else {
                      this.throwError(messages_1.Messages.DeclarationMissingInitializer, "const");
                    }
                  }
                } else if (!options.inFor && id.type !== syntax_1.Syntax.Identifier || this.match("=")) {
                  this.expect("=");
                  init4 = this.isolateCoverGrammar(this.parseAssignmentExpression);
                }
                return this.finalize(node2, new Node3.VariableDeclarator(id, init4));
              };
              Parser3.prototype.parseBindingList = function(kind2, options) {
                var list = [this.parseLexicalBinding(kind2, options)];
                while (this.match(",")) {
                  this.nextToken();
                  list.push(this.parseLexicalBinding(kind2, options));
                }
                return list;
              };
              Parser3.prototype.isLexicalDeclaration = function() {
                var state2 = this.scanner.saveState();
                this.scanner.scanComments();
                var next = this.scanner.lex();
                this.scanner.restoreState(state2);
                return next.type === 3 || next.type === 7 && next.value === "[" || next.type === 7 && next.value === "{" || next.type === 4 && next.value === "let" || next.type === 4 && next.value === "yield";
              };
              Parser3.prototype.parseLexicalDeclaration = function(options) {
                var node2 = this.createNode();
                var kind2 = this.nextToken().value;
                assert_1.assert(kind2 === "let" || kind2 === "const", "Lexical declaration must be either let or const");
                var declarations = this.parseBindingList(kind2, options);
                this.consumeSemicolon();
                return this.finalize(node2, new Node3.VariableDeclaration(declarations, kind2));
              };
              Parser3.prototype.parseBindingRestElement = function(params, kind2) {
                var node2 = this.createNode();
                this.expect("...");
                var arg = this.parsePattern(params, kind2);
                return this.finalize(node2, new Node3.RestElement(arg));
              };
              Parser3.prototype.parseArrayPattern = function(params, kind2) {
                var node2 = this.createNode();
                this.expect("[");
                var elements = [];
                while (!this.match("]")) {
                  if (this.match(",")) {
                    this.nextToken();
                    elements.push(null);
                  } else {
                    if (this.match("...")) {
                      elements.push(this.parseBindingRestElement(params, kind2));
                      break;
                    } else {
                      elements.push(this.parsePatternWithDefault(params, kind2));
                    }
                    if (!this.match("]")) {
                      this.expect(",");
                    }
                  }
                }
                this.expect("]");
                return this.finalize(node2, new Node3.ArrayPattern(elements));
              };
              Parser3.prototype.parsePropertyPattern = function(params, kind2) {
                var node2 = this.createNode();
                var computed = false;
                var shorthand = false;
                var method = false;
                var key;
                var value;
                if (this.lookahead.type === 3) {
                  var keyToken = this.lookahead;
                  key = this.parseVariableIdentifier();
                  var init4 = this.finalize(node2, new Node3.Identifier(keyToken.value));
                  if (this.match("=")) {
                    params.push(keyToken);
                    shorthand = true;
                    this.nextToken();
                    var expr = this.parseAssignmentExpression();
                    value = this.finalize(this.startNode(keyToken), new Node3.AssignmentPattern(init4, expr));
                  } else if (!this.match(":")) {
                    params.push(keyToken);
                    shorthand = true;
                    value = init4;
                  } else {
                    this.expect(":");
                    value = this.parsePatternWithDefault(params, kind2);
                  }
                } else {
                  computed = this.match("[");
                  key = this.parseObjectPropertyKey();
                  this.expect(":");
                  value = this.parsePatternWithDefault(params, kind2);
                }
                return this.finalize(node2, new Node3.Property("init", key, computed, value, method, shorthand));
              };
              Parser3.prototype.parseObjectPattern = function(params, kind2) {
                var node2 = this.createNode();
                var properties = [];
                this.expect("{");
                while (!this.match("}")) {
                  properties.push(this.parsePropertyPattern(params, kind2));
                  if (!this.match("}")) {
                    this.expect(",");
                  }
                }
                this.expect("}");
                return this.finalize(node2, new Node3.ObjectPattern(properties));
              };
              Parser3.prototype.parsePattern = function(params, kind2) {
                var pattern;
                if (this.match("[")) {
                  pattern = this.parseArrayPattern(params, kind2);
                } else if (this.match("{")) {
                  pattern = this.parseObjectPattern(params, kind2);
                } else {
                  if (this.matchKeyword("let") && (kind2 === "const" || kind2 === "let")) {
                    this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.LetInLexicalBinding);
                  }
                  params.push(this.lookahead);
                  pattern = this.parseVariableIdentifier(kind2);
                }
                return pattern;
              };
              Parser3.prototype.parsePatternWithDefault = function(params, kind2) {
                var startToken = this.lookahead;
                var pattern = this.parsePattern(params, kind2);
                if (this.match("=")) {
                  this.nextToken();
                  var previousAllowYield = this.context.allowYield;
                  this.context.allowYield = true;
                  var right2 = this.isolateCoverGrammar(this.parseAssignmentExpression);
                  this.context.allowYield = previousAllowYield;
                  pattern = this.finalize(this.startNode(startToken), new Node3.AssignmentPattern(pattern, right2));
                }
                return pattern;
              };
              Parser3.prototype.parseVariableIdentifier = function(kind2) {
                var node2 = this.createNode();
                var token = this.nextToken();
                if (token.type === 4 && token.value === "yield") {
                  if (this.context.strict) {
                    this.tolerateUnexpectedToken(token, messages_1.Messages.StrictReservedWord);
                  } else if (!this.context.allowYield) {
                    this.throwUnexpectedToken(token);
                  }
                } else if (token.type !== 3) {
                  if (this.context.strict && token.type === 4 && this.scanner.isStrictModeReservedWord(token.value)) {
                    this.tolerateUnexpectedToken(token, messages_1.Messages.StrictReservedWord);
                  } else {
                    if (this.context.strict || token.value !== "let" || kind2 !== "var") {
                      this.throwUnexpectedToken(token);
                    }
                  }
                } else if ((this.context.isModule || this.context.await) && token.type === 3 && token.value === "await") {
                  this.tolerateUnexpectedToken(token);
                }
                return this.finalize(node2, new Node3.Identifier(token.value));
              };
              Parser3.prototype.parseVariableDeclaration = function(options) {
                var node2 = this.createNode();
                var params = [];
                var id = this.parsePattern(params, "var");
                if (this.context.strict && id.type === syntax_1.Syntax.Identifier) {
                  if (this.scanner.isRestrictedWord(id.name)) {
                    this.tolerateError(messages_1.Messages.StrictVarName);
                  }
                }
                var init4 = null;
                if (this.match("=")) {
                  this.nextToken();
                  init4 = this.isolateCoverGrammar(this.parseAssignmentExpression);
                } else if (id.type !== syntax_1.Syntax.Identifier && !options.inFor) {
                  this.expect("=");
                }
                return this.finalize(node2, new Node3.VariableDeclarator(id, init4));
              };
              Parser3.prototype.parseVariableDeclarationList = function(options) {
                var opt = { inFor: options.inFor };
                var list = [];
                list.push(this.parseVariableDeclaration(opt));
                while (this.match(",")) {
                  this.nextToken();
                  list.push(this.parseVariableDeclaration(opt));
                }
                return list;
              };
              Parser3.prototype.parseVariableStatement = function() {
                var node2 = this.createNode();
                this.expectKeyword("var");
                var declarations = this.parseVariableDeclarationList({ inFor: false });
                this.consumeSemicolon();
                return this.finalize(node2, new Node3.VariableDeclaration(declarations, "var"));
              };
              Parser3.prototype.parseEmptyStatement = function() {
                var node2 = this.createNode();
                this.expect(";");
                return this.finalize(node2, new Node3.EmptyStatement());
              };
              Parser3.prototype.parseExpressionStatement = function() {
                var node2 = this.createNode();
                var expr = this.parseExpression();
                this.consumeSemicolon();
                return this.finalize(node2, new Node3.ExpressionStatement(expr));
              };
              Parser3.prototype.parseIfClause = function() {
                if (this.context.strict && this.matchKeyword("function")) {
                  this.tolerateError(messages_1.Messages.StrictFunction);
                }
                return this.parseStatement();
              };
              Parser3.prototype.parseIfStatement = function() {
                var node2 = this.createNode();
                var consequent;
                var alternate = null;
                this.expectKeyword("if");
                this.expect("(");
                var test = this.parseExpression();
                if (!this.match(")") && this.config.tolerant) {
                  this.tolerateUnexpectedToken(this.nextToken());
                  consequent = this.finalize(this.createNode(), new Node3.EmptyStatement());
                } else {
                  this.expect(")");
                  consequent = this.parseIfClause();
                  if (this.matchKeyword("else")) {
                    this.nextToken();
                    alternate = this.parseIfClause();
                  }
                }
                return this.finalize(node2, new Node3.IfStatement(test, consequent, alternate));
              };
              Parser3.prototype.parseDoWhileStatement = function() {
                var node2 = this.createNode();
                this.expectKeyword("do");
                var previousInIteration = this.context.inIteration;
                this.context.inIteration = true;
                var body = this.parseStatement();
                this.context.inIteration = previousInIteration;
                this.expectKeyword("while");
                this.expect("(");
                var test = this.parseExpression();
                if (!this.match(")") && this.config.tolerant) {
                  this.tolerateUnexpectedToken(this.nextToken());
                } else {
                  this.expect(")");
                  if (this.match(";")) {
                    this.nextToken();
                  }
                }
                return this.finalize(node2, new Node3.DoWhileStatement(body, test));
              };
              Parser3.prototype.parseWhileStatement = function() {
                var node2 = this.createNode();
                var body;
                this.expectKeyword("while");
                this.expect("(");
                var test = this.parseExpression();
                if (!this.match(")") && this.config.tolerant) {
                  this.tolerateUnexpectedToken(this.nextToken());
                  body = this.finalize(this.createNode(), new Node3.EmptyStatement());
                } else {
                  this.expect(")");
                  var previousInIteration = this.context.inIteration;
                  this.context.inIteration = true;
                  body = this.parseStatement();
                  this.context.inIteration = previousInIteration;
                }
                return this.finalize(node2, new Node3.WhileStatement(test, body));
              };
              Parser3.prototype.parseForStatement = function() {
                var init4 = null;
                var test = null;
                var update = null;
                var forIn = true;
                var left2, right2;
                var node2 = this.createNode();
                this.expectKeyword("for");
                this.expect("(");
                if (this.match(";")) {
                  this.nextToken();
                } else {
                  if (this.matchKeyword("var")) {
                    init4 = this.createNode();
                    this.nextToken();
                    var previousAllowIn = this.context.allowIn;
                    this.context.allowIn = false;
                    var declarations = this.parseVariableDeclarationList({ inFor: true });
                    this.context.allowIn = previousAllowIn;
                    if (declarations.length === 1 && this.matchKeyword("in")) {
                      var decl = declarations[0];
                      if (decl.init && (decl.id.type === syntax_1.Syntax.ArrayPattern || decl.id.type === syntax_1.Syntax.ObjectPattern || this.context.strict)) {
                        this.tolerateError(messages_1.Messages.ForInOfLoopInitializer, "for-in");
                      }
                      init4 = this.finalize(init4, new Node3.VariableDeclaration(declarations, "var"));
                      this.nextToken();
                      left2 = init4;
                      right2 = this.parseExpression();
                      init4 = null;
                    } else if (declarations.length === 1 && declarations[0].init === null && this.matchContextualKeyword("of")) {
                      init4 = this.finalize(init4, new Node3.VariableDeclaration(declarations, "var"));
                      this.nextToken();
                      left2 = init4;
                      right2 = this.parseAssignmentExpression();
                      init4 = null;
                      forIn = false;
                    } else {
                      init4 = this.finalize(init4, new Node3.VariableDeclaration(declarations, "var"));
                      this.expect(";");
                    }
                  } else if (this.matchKeyword("const") || this.matchKeyword("let")) {
                    init4 = this.createNode();
                    var kind2 = this.nextToken().value;
                    if (!this.context.strict && this.lookahead.value === "in") {
                      init4 = this.finalize(init4, new Node3.Identifier(kind2));
                      this.nextToken();
                      left2 = init4;
                      right2 = this.parseExpression();
                      init4 = null;
                    } else {
                      var previousAllowIn = this.context.allowIn;
                      this.context.allowIn = false;
                      var declarations = this.parseBindingList(kind2, { inFor: true });
                      this.context.allowIn = previousAllowIn;
                      if (declarations.length === 1 && declarations[0].init === null && this.matchKeyword("in")) {
                        init4 = this.finalize(init4, new Node3.VariableDeclaration(declarations, kind2));
                        this.nextToken();
                        left2 = init4;
                        right2 = this.parseExpression();
                        init4 = null;
                      } else if (declarations.length === 1 && declarations[0].init === null && this.matchContextualKeyword("of")) {
                        init4 = this.finalize(init4, new Node3.VariableDeclaration(declarations, kind2));
                        this.nextToken();
                        left2 = init4;
                        right2 = this.parseAssignmentExpression();
                        init4 = null;
                        forIn = false;
                      } else {
                        this.consumeSemicolon();
                        init4 = this.finalize(init4, new Node3.VariableDeclaration(declarations, kind2));
                      }
                    }
                  } else {
                    var initStartToken = this.lookahead;
                    var previousAllowIn = this.context.allowIn;
                    this.context.allowIn = false;
                    init4 = this.inheritCoverGrammar(this.parseAssignmentExpression);
                    this.context.allowIn = previousAllowIn;
                    if (this.matchKeyword("in")) {
                      if (!this.context.isAssignmentTarget || init4.type === syntax_1.Syntax.AssignmentExpression) {
                        this.tolerateError(messages_1.Messages.InvalidLHSInForIn);
                      }
                      this.nextToken();
                      this.reinterpretExpressionAsPattern(init4);
                      left2 = init4;
                      right2 = this.parseExpression();
                      init4 = null;
                    } else if (this.matchContextualKeyword("of")) {
                      if (!this.context.isAssignmentTarget || init4.type === syntax_1.Syntax.AssignmentExpression) {
                        this.tolerateError(messages_1.Messages.InvalidLHSInForLoop);
                      }
                      this.nextToken();
                      this.reinterpretExpressionAsPattern(init4);
                      left2 = init4;
                      right2 = this.parseAssignmentExpression();
                      init4 = null;
                      forIn = false;
                    } else {
                      if (this.match(",")) {
                        var initSeq = [init4];
                        while (this.match(",")) {
                          this.nextToken();
                          initSeq.push(this.isolateCoverGrammar(this.parseAssignmentExpression));
                        }
                        init4 = this.finalize(this.startNode(initStartToken), new Node3.SequenceExpression(initSeq));
                      }
                      this.expect(";");
                    }
                  }
                }
                if (typeof left2 === "undefined") {
                  if (!this.match(";")) {
                    test = this.parseExpression();
                  }
                  this.expect(";");
                  if (!this.match(")")) {
                    update = this.parseExpression();
                  }
                }
                var body;
                if (!this.match(")") && this.config.tolerant) {
                  this.tolerateUnexpectedToken(this.nextToken());
                  body = this.finalize(this.createNode(), new Node3.EmptyStatement());
                } else {
                  this.expect(")");
                  var previousInIteration = this.context.inIteration;
                  this.context.inIteration = true;
                  body = this.isolateCoverGrammar(this.parseStatement);
                  this.context.inIteration = previousInIteration;
                }
                return typeof left2 === "undefined" ? this.finalize(node2, new Node3.ForStatement(init4, test, update, body)) : forIn ? this.finalize(node2, new Node3.ForInStatement(left2, right2, body)) : this.finalize(node2, new Node3.ForOfStatement(left2, right2, body));
              };
              Parser3.prototype.parseContinueStatement = function() {
                var node2 = this.createNode();
                this.expectKeyword("continue");
                var label = null;
                if (this.lookahead.type === 3 && !this.hasLineTerminator) {
                  var id = this.parseVariableIdentifier();
                  label = id;
                  var key = "$" + id.name;
                  if (!Object.prototype.hasOwnProperty.call(this.context.labelSet, key)) {
                    this.throwError(messages_1.Messages.UnknownLabel, id.name);
                  }
                }
                this.consumeSemicolon();
                if (label === null && !this.context.inIteration) {
                  this.throwError(messages_1.Messages.IllegalContinue);
                }
                return this.finalize(node2, new Node3.ContinueStatement(label));
              };
              Parser3.prototype.parseBreakStatement = function() {
                var node2 = this.createNode();
                this.expectKeyword("break");
                var label = null;
                if (this.lookahead.type === 3 && !this.hasLineTerminator) {
                  var id = this.parseVariableIdentifier();
                  var key = "$" + id.name;
                  if (!Object.prototype.hasOwnProperty.call(this.context.labelSet, key)) {
                    this.throwError(messages_1.Messages.UnknownLabel, id.name);
                  }
                  label = id;
                }
                this.consumeSemicolon();
                if (label === null && !this.context.inIteration && !this.context.inSwitch) {
                  this.throwError(messages_1.Messages.IllegalBreak);
                }
                return this.finalize(node2, new Node3.BreakStatement(label));
              };
              Parser3.prototype.parseReturnStatement = function() {
                if (!this.context.inFunctionBody) {
                  this.tolerateError(messages_1.Messages.IllegalReturn);
                }
                var node2 = this.createNode();
                this.expectKeyword("return");
                var hasArgument = !this.match(";") && !this.match("}") && !this.hasLineTerminator && this.lookahead.type !== 2 || this.lookahead.type === 8 || this.lookahead.type === 10;
                var argument = hasArgument ? this.parseExpression() : null;
                this.consumeSemicolon();
                return this.finalize(node2, new Node3.ReturnStatement(argument));
              };
              Parser3.prototype.parseWithStatement = function() {
                if (this.context.strict) {
                  this.tolerateError(messages_1.Messages.StrictModeWith);
                }
                var node2 = this.createNode();
                var body;
                this.expectKeyword("with");
                this.expect("(");
                var object = this.parseExpression();
                if (!this.match(")") && this.config.tolerant) {
                  this.tolerateUnexpectedToken(this.nextToken());
                  body = this.finalize(this.createNode(), new Node3.EmptyStatement());
                } else {
                  this.expect(")");
                  body = this.parseStatement();
                }
                return this.finalize(node2, new Node3.WithStatement(object, body));
              };
              Parser3.prototype.parseSwitchCase = function() {
                var node2 = this.createNode();
                var test;
                if (this.matchKeyword("default")) {
                  this.nextToken();
                  test = null;
                } else {
                  this.expectKeyword("case");
                  test = this.parseExpression();
                }
                this.expect(":");
                var consequent = [];
                while (true) {
                  if (this.match("}") || this.matchKeyword("default") || this.matchKeyword("case")) {
                    break;
                  }
                  consequent.push(this.parseStatementListItem());
                }
                return this.finalize(node2, new Node3.SwitchCase(test, consequent));
              };
              Parser3.prototype.parseSwitchStatement = function() {
                var node2 = this.createNode();
                this.expectKeyword("switch");
                this.expect("(");
                var discriminant = this.parseExpression();
                this.expect(")");
                var previousInSwitch = this.context.inSwitch;
                this.context.inSwitch = true;
                var cases = [];
                var defaultFound = false;
                this.expect("{");
                while (true) {
                  if (this.match("}")) {
                    break;
                  }
                  var clause = this.parseSwitchCase();
                  if (clause.test === null) {
                    if (defaultFound) {
                      this.throwError(messages_1.Messages.MultipleDefaultsInSwitch);
                    }
                    defaultFound = true;
                  }
                  cases.push(clause);
                }
                this.expect("}");
                this.context.inSwitch = previousInSwitch;
                return this.finalize(node2, new Node3.SwitchStatement(discriminant, cases));
              };
              Parser3.prototype.parseLabelledStatement = function() {
                var node2 = this.createNode();
                var expr = this.parseExpression();
                var statement;
                if (expr.type === syntax_1.Syntax.Identifier && this.match(":")) {
                  this.nextToken();
                  var id = expr;
                  var key = "$" + id.name;
                  if (Object.prototype.hasOwnProperty.call(this.context.labelSet, key)) {
                    this.throwError(messages_1.Messages.Redeclaration, "Label", id.name);
                  }
                  this.context.labelSet[key] = true;
                  var body = void 0;
                  if (this.matchKeyword("class")) {
                    this.tolerateUnexpectedToken(this.lookahead);
                    body = this.parseClassDeclaration();
                  } else if (this.matchKeyword("function")) {
                    var token = this.lookahead;
                    var declaration = this.parseFunctionDeclaration();
                    if (this.context.strict) {
                      this.tolerateUnexpectedToken(token, messages_1.Messages.StrictFunction);
                    } else if (declaration.generator) {
                      this.tolerateUnexpectedToken(token, messages_1.Messages.GeneratorInLegacyContext);
                    }
                    body = declaration;
                  } else {
                    body = this.parseStatement();
                  }
                  delete this.context.labelSet[key];
                  statement = new Node3.LabeledStatement(id, body);
                } else {
                  this.consumeSemicolon();
                  statement = new Node3.ExpressionStatement(expr);
                }
                return this.finalize(node2, statement);
              };
              Parser3.prototype.parseThrowStatement = function() {
                var node2 = this.createNode();
                this.expectKeyword("throw");
                if (this.hasLineTerminator) {
                  this.throwError(messages_1.Messages.NewlineAfterThrow);
                }
                var argument = this.parseExpression();
                this.consumeSemicolon();
                return this.finalize(node2, new Node3.ThrowStatement(argument));
              };
              Parser3.prototype.parseCatchClause = function() {
                var node2 = this.createNode();
                this.expectKeyword("catch");
                this.expect("(");
                if (this.match(")")) {
                  this.throwUnexpectedToken(this.lookahead);
                }
                var params = [];
                var param = this.parsePattern(params);
                var paramMap = {};
                for (var i7 = 0; i7 < params.length; i7++) {
                  var key = "$" + params[i7].value;
                  if (Object.prototype.hasOwnProperty.call(paramMap, key)) {
                    this.tolerateError(messages_1.Messages.DuplicateBinding, params[i7].value);
                  }
                  paramMap[key] = true;
                }
                if (this.context.strict && param.type === syntax_1.Syntax.Identifier) {
                  if (this.scanner.isRestrictedWord(param.name)) {
                    this.tolerateError(messages_1.Messages.StrictCatchVariable);
                  }
                }
                this.expect(")");
                var body = this.parseBlock();
                return this.finalize(node2, new Node3.CatchClause(param, body));
              };
              Parser3.prototype.parseFinallyClause = function() {
                this.expectKeyword("finally");
                return this.parseBlock();
              };
              Parser3.prototype.parseTryStatement = function() {
                var node2 = this.createNode();
                this.expectKeyword("try");
                var block = this.parseBlock();
                var handler = this.matchKeyword("catch") ? this.parseCatchClause() : null;
                var finalizer = this.matchKeyword("finally") ? this.parseFinallyClause() : null;
                if (!handler && !finalizer) {
                  this.throwError(messages_1.Messages.NoCatchOrFinally);
                }
                return this.finalize(node2, new Node3.TryStatement(block, handler, finalizer));
              };
              Parser3.prototype.parseDebuggerStatement = function() {
                var node2 = this.createNode();
                this.expectKeyword("debugger");
                this.consumeSemicolon();
                return this.finalize(node2, new Node3.DebuggerStatement());
              };
              Parser3.prototype.parseStatement = function() {
                var statement;
                switch (this.lookahead.type) {
                  case 1:
                  case 5:
                  case 6:
                  case 8:
                  case 10:
                  case 9:
                    statement = this.parseExpressionStatement();
                    break;
                  case 7:
                    var value = this.lookahead.value;
                    if (value === "{") {
                      statement = this.parseBlock();
                    } else if (value === "(") {
                      statement = this.parseExpressionStatement();
                    } else if (value === ";") {
                      statement = this.parseEmptyStatement();
                    } else {
                      statement = this.parseExpressionStatement();
                    }
                    break;
                  case 3:
                    statement = this.matchAsyncFunction() ? this.parseFunctionDeclaration() : this.parseLabelledStatement();
                    break;
                  case 4:
                    switch (this.lookahead.value) {
                      case "break":
                        statement = this.parseBreakStatement();
                        break;
                      case "continue":
                        statement = this.parseContinueStatement();
                        break;
                      case "debugger":
                        statement = this.parseDebuggerStatement();
                        break;
                      case "do":
                        statement = this.parseDoWhileStatement();
                        break;
                      case "for":
                        statement = this.parseForStatement();
                        break;
                      case "function":
                        statement = this.parseFunctionDeclaration();
                        break;
                      case "if":
                        statement = this.parseIfStatement();
                        break;
                      case "return":
                        statement = this.parseReturnStatement();
                        break;
                      case "switch":
                        statement = this.parseSwitchStatement();
                        break;
                      case "throw":
                        statement = this.parseThrowStatement();
                        break;
                      case "try":
                        statement = this.parseTryStatement();
                        break;
                      case "var":
                        statement = this.parseVariableStatement();
                        break;
                      case "while":
                        statement = this.parseWhileStatement();
                        break;
                      case "with":
                        statement = this.parseWithStatement();
                        break;
                      default:
                        statement = this.parseExpressionStatement();
                        break;
                    }
                    break;
                  default:
                    statement = this.throwUnexpectedToken(this.lookahead);
                }
                return statement;
              };
              Parser3.prototype.parseFunctionSourceElements = function() {
                var node2 = this.createNode();
                this.expect("{");
                var body = this.parseDirectivePrologues();
                var previousLabelSet = this.context.labelSet;
                var previousInIteration = this.context.inIteration;
                var previousInSwitch = this.context.inSwitch;
                var previousInFunctionBody = this.context.inFunctionBody;
                this.context.labelSet = {};
                this.context.inIteration = false;
                this.context.inSwitch = false;
                this.context.inFunctionBody = true;
                while (this.lookahead.type !== 2) {
                  if (this.match("}")) {
                    break;
                  }
                  body.push(this.parseStatementListItem());
                }
                this.expect("}");
                this.context.labelSet = previousLabelSet;
                this.context.inIteration = previousInIteration;
                this.context.inSwitch = previousInSwitch;
                this.context.inFunctionBody = previousInFunctionBody;
                return this.finalize(node2, new Node3.BlockStatement(body));
              };
              Parser3.prototype.validateParam = function(options, param, name2) {
                var key = "$" + name2;
                if (this.context.strict) {
                  if (this.scanner.isRestrictedWord(name2)) {
                    options.stricted = param;
                    options.message = messages_1.Messages.StrictParamName;
                  }
                  if (Object.prototype.hasOwnProperty.call(options.paramSet, key)) {
                    options.stricted = param;
                    options.message = messages_1.Messages.StrictParamDupe;
                  }
                } else if (!options.firstRestricted) {
                  if (this.scanner.isRestrictedWord(name2)) {
                    options.firstRestricted = param;
                    options.message = messages_1.Messages.StrictParamName;
                  } else if (this.scanner.isStrictModeReservedWord(name2)) {
                    options.firstRestricted = param;
                    options.message = messages_1.Messages.StrictReservedWord;
                  } else if (Object.prototype.hasOwnProperty.call(options.paramSet, key)) {
                    options.stricted = param;
                    options.message = messages_1.Messages.StrictParamDupe;
                  }
                }
                if (typeof Object.defineProperty === "function") {
                  Object.defineProperty(options.paramSet, key, { value: true, enumerable: true, writable: true, configurable: true });
                } else {
                  options.paramSet[key] = true;
                }
              };
              Parser3.prototype.parseRestElement = function(params) {
                var node2 = this.createNode();
                this.expect("...");
                var arg = this.parsePattern(params);
                if (this.match("=")) {
                  this.throwError(messages_1.Messages.DefaultRestParameter);
                }
                if (!this.match(")")) {
                  this.throwError(messages_1.Messages.ParameterAfterRestParameter);
                }
                return this.finalize(node2, new Node3.RestElement(arg));
              };
              Parser3.prototype.parseFormalParameter = function(options) {
                var params = [];
                var param = this.match("...") ? this.parseRestElement(params) : this.parsePatternWithDefault(params);
                for (var i7 = 0; i7 < params.length; i7++) {
                  this.validateParam(options, params[i7], params[i7].value);
                }
                options.simple = options.simple && param instanceof Node3.Identifier;
                options.params.push(param);
              };
              Parser3.prototype.parseFormalParameters = function(firstRestricted) {
                var options;
                options = {
                  simple: true,
                  params: [],
                  firstRestricted
                };
                this.expect("(");
                if (!this.match(")")) {
                  options.paramSet = {};
                  while (this.lookahead.type !== 2) {
                    this.parseFormalParameter(options);
                    if (this.match(")")) {
                      break;
                    }
                    this.expect(",");
                    if (this.match(")")) {
                      break;
                    }
                  }
                }
                this.expect(")");
                return {
                  simple: options.simple,
                  params: options.params,
                  stricted: options.stricted,
                  firstRestricted: options.firstRestricted,
                  message: options.message
                };
              };
              Parser3.prototype.matchAsyncFunction = function() {
                var match3 = this.matchContextualKeyword("async");
                if (match3) {
                  var state2 = this.scanner.saveState();
                  this.scanner.scanComments();
                  var next = this.scanner.lex();
                  this.scanner.restoreState(state2);
                  match3 = state2.lineNumber === next.lineNumber && next.type === 4 && next.value === "function";
                }
                return match3;
              };
              Parser3.prototype.parseFunctionDeclaration = function(identifierIsOptional) {
                var node2 = this.createNode();
                var isAsync4 = this.matchContextualKeyword("async");
                if (isAsync4) {
                  this.nextToken();
                }
                this.expectKeyword("function");
                var isGenerator = isAsync4 ? false : this.match("*");
                if (isGenerator) {
                  this.nextToken();
                }
                var message;
                var id = null;
                var firstRestricted = null;
                if (!identifierIsOptional || !this.match("(")) {
                  var token = this.lookahead;
                  id = this.parseVariableIdentifier();
                  if (this.context.strict) {
                    if (this.scanner.isRestrictedWord(token.value)) {
                      this.tolerateUnexpectedToken(token, messages_1.Messages.StrictFunctionName);
                    }
                  } else {
                    if (this.scanner.isRestrictedWord(token.value)) {
                      firstRestricted = token;
                      message = messages_1.Messages.StrictFunctionName;
                    } else if (this.scanner.isStrictModeReservedWord(token.value)) {
                      firstRestricted = token;
                      message = messages_1.Messages.StrictReservedWord;
                    }
                  }
                }
                var previousAllowAwait = this.context.await;
                var previousAllowYield = this.context.allowYield;
                this.context.await = isAsync4;
                this.context.allowYield = !isGenerator;
                var formalParameters = this.parseFormalParameters(firstRestricted);
                var params = formalParameters.params;
                var stricted = formalParameters.stricted;
                firstRestricted = formalParameters.firstRestricted;
                if (formalParameters.message) {
                  message = formalParameters.message;
                }
                var previousStrict = this.context.strict;
                var previousAllowStrictDirective = this.context.allowStrictDirective;
                this.context.allowStrictDirective = formalParameters.simple;
                var body = this.parseFunctionSourceElements();
                if (this.context.strict && firstRestricted) {
                  this.throwUnexpectedToken(firstRestricted, message);
                }
                if (this.context.strict && stricted) {
                  this.tolerateUnexpectedToken(stricted, message);
                }
                this.context.strict = previousStrict;
                this.context.allowStrictDirective = previousAllowStrictDirective;
                this.context.await = previousAllowAwait;
                this.context.allowYield = previousAllowYield;
                return isAsync4 ? this.finalize(node2, new Node3.AsyncFunctionDeclaration(id, params, body)) : this.finalize(node2, new Node3.FunctionDeclaration(id, params, body, isGenerator));
              };
              Parser3.prototype.parseFunctionExpression = function() {
                var node2 = this.createNode();
                var isAsync4 = this.matchContextualKeyword("async");
                if (isAsync4) {
                  this.nextToken();
                }
                this.expectKeyword("function");
                var isGenerator = isAsync4 ? false : this.match("*");
                if (isGenerator) {
                  this.nextToken();
                }
                var message;
                var id = null;
                var firstRestricted;
                var previousAllowAwait = this.context.await;
                var previousAllowYield = this.context.allowYield;
                this.context.await = isAsync4;
                this.context.allowYield = !isGenerator;
                if (!this.match("(")) {
                  var token = this.lookahead;
                  id = !this.context.strict && !isGenerator && this.matchKeyword("yield") ? this.parseIdentifierName() : this.parseVariableIdentifier();
                  if (this.context.strict) {
                    if (this.scanner.isRestrictedWord(token.value)) {
                      this.tolerateUnexpectedToken(token, messages_1.Messages.StrictFunctionName);
                    }
                  } else {
                    if (this.scanner.isRestrictedWord(token.value)) {
                      firstRestricted = token;
                      message = messages_1.Messages.StrictFunctionName;
                    } else if (this.scanner.isStrictModeReservedWord(token.value)) {
                      firstRestricted = token;
                      message = messages_1.Messages.StrictReservedWord;
                    }
                  }
                }
                var formalParameters = this.parseFormalParameters(firstRestricted);
                var params = formalParameters.params;
                var stricted = formalParameters.stricted;
                firstRestricted = formalParameters.firstRestricted;
                if (formalParameters.message) {
                  message = formalParameters.message;
                }
                var previousStrict = this.context.strict;
                var previousAllowStrictDirective = this.context.allowStrictDirective;
                this.context.allowStrictDirective = formalParameters.simple;
                var body = this.parseFunctionSourceElements();
                if (this.context.strict && firstRestricted) {
                  this.throwUnexpectedToken(firstRestricted, message);
                }
                if (this.context.strict && stricted) {
                  this.tolerateUnexpectedToken(stricted, message);
                }
                this.context.strict = previousStrict;
                this.context.allowStrictDirective = previousAllowStrictDirective;
                this.context.await = previousAllowAwait;
                this.context.allowYield = previousAllowYield;
                return isAsync4 ? this.finalize(node2, new Node3.AsyncFunctionExpression(id, params, body)) : this.finalize(node2, new Node3.FunctionExpression(id, params, body, isGenerator));
              };
              Parser3.prototype.parseDirective = function() {
                var token = this.lookahead;
                var node2 = this.createNode();
                var expr = this.parseExpression();
                var directive = expr.type === syntax_1.Syntax.Literal ? this.getTokenRaw(token).slice(1, -1) : null;
                this.consumeSemicolon();
                return this.finalize(node2, directive ? new Node3.Directive(expr, directive) : new Node3.ExpressionStatement(expr));
              };
              Parser3.prototype.parseDirectivePrologues = function() {
                var firstRestricted = null;
                var body = [];
                while (true) {
                  var token = this.lookahead;
                  if (token.type !== 8) {
                    break;
                  }
                  var statement = this.parseDirective();
                  body.push(statement);
                  var directive = statement.directive;
                  if (typeof directive !== "string") {
                    break;
                  }
                  if (directive === "use strict") {
                    this.context.strict = true;
                    if (firstRestricted) {
                      this.tolerateUnexpectedToken(firstRestricted, messages_1.Messages.StrictOctalLiteral);
                    }
                    if (!this.context.allowStrictDirective) {
                      this.tolerateUnexpectedToken(token, messages_1.Messages.IllegalLanguageModeDirective);
                    }
                  } else {
                    if (!firstRestricted && token.octal) {
                      firstRestricted = token;
                    }
                  }
                }
                return body;
              };
              Parser3.prototype.qualifiedPropertyName = function(token) {
                switch (token.type) {
                  case 3:
                  case 8:
                  case 1:
                  case 5:
                  case 6:
                  case 4:
                    return true;
                  case 7:
                    return token.value === "[";
                }
                return false;
              };
              Parser3.prototype.parseGetterMethod = function() {
                var node2 = this.createNode();
                var isGenerator = false;
                var previousAllowYield = this.context.allowYield;
                this.context.allowYield = !isGenerator;
                var formalParameters = this.parseFormalParameters();
                if (formalParameters.params.length > 0) {
                  this.tolerateError(messages_1.Messages.BadGetterArity);
                }
                var method = this.parsePropertyMethod(formalParameters);
                this.context.allowYield = previousAllowYield;
                return this.finalize(node2, new Node3.FunctionExpression(null, formalParameters.params, method, isGenerator));
              };
              Parser3.prototype.parseSetterMethod = function() {
                var node2 = this.createNode();
                var isGenerator = false;
                var previousAllowYield = this.context.allowYield;
                this.context.allowYield = !isGenerator;
                var formalParameters = this.parseFormalParameters();
                if (formalParameters.params.length !== 1) {
                  this.tolerateError(messages_1.Messages.BadSetterArity);
                } else if (formalParameters.params[0] instanceof Node3.RestElement) {
                  this.tolerateError(messages_1.Messages.BadSetterRestParameter);
                }
                var method = this.parsePropertyMethod(formalParameters);
                this.context.allowYield = previousAllowYield;
                return this.finalize(node2, new Node3.FunctionExpression(null, formalParameters.params, method, isGenerator));
              };
              Parser3.prototype.parseGeneratorMethod = function() {
                var node2 = this.createNode();
                var isGenerator = true;
                var previousAllowYield = this.context.allowYield;
                this.context.allowYield = true;
                var params = this.parseFormalParameters();
                this.context.allowYield = false;
                var method = this.parsePropertyMethod(params);
                this.context.allowYield = previousAllowYield;
                return this.finalize(node2, new Node3.FunctionExpression(null, params.params, method, isGenerator));
              };
              Parser3.prototype.isStartOfExpression = function() {
                var start = true;
                var value = this.lookahead.value;
                switch (this.lookahead.type) {
                  case 7:
                    start = value === "[" || value === "(" || value === "{" || value === "+" || value === "-" || value === "!" || value === "~" || value === "++" || value === "--" || value === "/" || value === "/=";
                    break;
                  case 4:
                    start = value === "class" || value === "delete" || value === "function" || value === "let" || value === "new" || value === "super" || value === "this" || value === "typeof" || value === "void" || value === "yield";
                    break;
                }
                return start;
              };
              Parser3.prototype.parseYieldExpression = function() {
                var node2 = this.createNode();
                this.expectKeyword("yield");
                var argument = null;
                var delegate = false;
                if (!this.hasLineTerminator) {
                  var previousAllowYield = this.context.allowYield;
                  this.context.allowYield = false;
                  delegate = this.match("*");
                  if (delegate) {
                    this.nextToken();
                    argument = this.parseAssignmentExpression();
                  } else if (this.isStartOfExpression()) {
                    argument = this.parseAssignmentExpression();
                  }
                  this.context.allowYield = previousAllowYield;
                }
                return this.finalize(node2, new Node3.YieldExpression(argument, delegate));
              };
              Parser3.prototype.parseClassElement = function(hasConstructor) {
                var token = this.lookahead;
                var node2 = this.createNode();
                var kind2 = "";
                var key = null;
                var value = null;
                var computed = false;
                var method = false;
                var isStatic = false;
                var isAsync4 = false;
                if (this.match("*")) {
                  this.nextToken();
                } else {
                  computed = this.match("[");
                  key = this.parseObjectPropertyKey();
                  var id = key;
                  if (id.name === "static" && (this.qualifiedPropertyName(this.lookahead) || this.match("*"))) {
                    token = this.lookahead;
                    isStatic = true;
                    computed = this.match("[");
                    if (this.match("*")) {
                      this.nextToken();
                    } else {
                      key = this.parseObjectPropertyKey();
                    }
                  }
                  if (token.type === 3 && !this.hasLineTerminator && token.value === "async") {
                    var punctuator = this.lookahead.value;
                    if (punctuator !== ":" && punctuator !== "(" && punctuator !== "*") {
                      isAsync4 = true;
                      token = this.lookahead;
                      key = this.parseObjectPropertyKey();
                      if (token.type === 3 && token.value === "constructor") {
                        this.tolerateUnexpectedToken(token, messages_1.Messages.ConstructorIsAsync);
                      }
                    }
                  }
                }
                var lookaheadPropertyKey = this.qualifiedPropertyName(this.lookahead);
                if (token.type === 3) {
                  if (token.value === "get" && lookaheadPropertyKey) {
                    kind2 = "get";
                    computed = this.match("[");
                    key = this.parseObjectPropertyKey();
                    this.context.allowYield = false;
                    value = this.parseGetterMethod();
                  } else if (token.value === "set" && lookaheadPropertyKey) {
                    kind2 = "set";
                    computed = this.match("[");
                    key = this.parseObjectPropertyKey();
                    value = this.parseSetterMethod();
                  }
                } else if (token.type === 7 && token.value === "*" && lookaheadPropertyKey) {
                  kind2 = "init";
                  computed = this.match("[");
                  key = this.parseObjectPropertyKey();
                  value = this.parseGeneratorMethod();
                  method = true;
                }
                if (!kind2 && key && this.match("(")) {
                  kind2 = "init";
                  value = isAsync4 ? this.parsePropertyMethodAsyncFunction() : this.parsePropertyMethodFunction();
                  method = true;
                }
                if (!kind2) {
                  this.throwUnexpectedToken(this.lookahead);
                }
                if (kind2 === "init") {
                  kind2 = "method";
                }
                if (!computed) {
                  if (isStatic && this.isPropertyKey(key, "prototype")) {
                    this.throwUnexpectedToken(token, messages_1.Messages.StaticPrototype);
                  }
                  if (!isStatic && this.isPropertyKey(key, "constructor")) {
                    if (kind2 !== "method" || !method || value && value.generator) {
                      this.throwUnexpectedToken(token, messages_1.Messages.ConstructorSpecialMethod);
                    }
                    if (hasConstructor.value) {
                      this.throwUnexpectedToken(token, messages_1.Messages.DuplicateConstructor);
                    } else {
                      hasConstructor.value = true;
                    }
                    kind2 = "constructor";
                  }
                }
                return this.finalize(node2, new Node3.MethodDefinition(key, computed, value, kind2, isStatic));
              };
              Parser3.prototype.parseClassElementList = function() {
                var body = [];
                var hasConstructor = { value: false };
                this.expect("{");
                while (!this.match("}")) {
                  if (this.match(";")) {
                    this.nextToken();
                  } else {
                    body.push(this.parseClassElement(hasConstructor));
                  }
                }
                this.expect("}");
                return body;
              };
              Parser3.prototype.parseClassBody = function() {
                var node2 = this.createNode();
                var elementList = this.parseClassElementList();
                return this.finalize(node2, new Node3.ClassBody(elementList));
              };
              Parser3.prototype.parseClassDeclaration = function(identifierIsOptional) {
                var node2 = this.createNode();
                var previousStrict = this.context.strict;
                this.context.strict = true;
                this.expectKeyword("class");
                var id = identifierIsOptional && this.lookahead.type !== 3 ? null : this.parseVariableIdentifier();
                var superClass = null;
                if (this.matchKeyword("extends")) {
                  this.nextToken();
                  superClass = this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall);
                }
                var classBody = this.parseClassBody();
                this.context.strict = previousStrict;
                return this.finalize(node2, new Node3.ClassDeclaration(id, superClass, classBody));
              };
              Parser3.prototype.parseClassExpression = function() {
                var node2 = this.createNode();
                var previousStrict = this.context.strict;
                this.context.strict = true;
                this.expectKeyword("class");
                var id = this.lookahead.type === 3 ? this.parseVariableIdentifier() : null;
                var superClass = null;
                if (this.matchKeyword("extends")) {
                  this.nextToken();
                  superClass = this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall);
                }
                var classBody = this.parseClassBody();
                this.context.strict = previousStrict;
                return this.finalize(node2, new Node3.ClassExpression(id, superClass, classBody));
              };
              Parser3.prototype.parseModule = function() {
                this.context.strict = true;
                this.context.isModule = true;
                this.scanner.isModule = true;
                var node2 = this.createNode();
                var body = this.parseDirectivePrologues();
                while (this.lookahead.type !== 2) {
                  body.push(this.parseStatementListItem());
                }
                return this.finalize(node2, new Node3.Module(body));
              };
              Parser3.prototype.parseScript = function() {
                var node2 = this.createNode();
                var body = this.parseDirectivePrologues();
                while (this.lookahead.type !== 2) {
                  body.push(this.parseStatementListItem());
                }
                return this.finalize(node2, new Node3.Script(body));
              };
              Parser3.prototype.parseModuleSpecifier = function() {
                var node2 = this.createNode();
                if (this.lookahead.type !== 8) {
                  this.throwError(messages_1.Messages.InvalidModuleSpecifier);
                }
                var token = this.nextToken();
                var raw = this.getTokenRaw(token);
                return this.finalize(node2, new Node3.Literal(token.value, raw));
              };
              Parser3.prototype.parseImportSpecifier = function() {
                var node2 = this.createNode();
                var imported;
                var local;
                if (this.lookahead.type === 3) {
                  imported = this.parseVariableIdentifier();
                  local = imported;
                  if (this.matchContextualKeyword("as")) {
                    this.nextToken();
                    local = this.parseVariableIdentifier();
                  }
                } else {
                  imported = this.parseIdentifierName();
                  local = imported;
                  if (this.matchContextualKeyword("as")) {
                    this.nextToken();
                    local = this.parseVariableIdentifier();
                  } else {
                    this.throwUnexpectedToken(this.nextToken());
                  }
                }
                return this.finalize(node2, new Node3.ImportSpecifier(local, imported));
              };
              Parser3.prototype.parseNamedImports = function() {
                this.expect("{");
                var specifiers = [];
                while (!this.match("}")) {
                  specifiers.push(this.parseImportSpecifier());
                  if (!this.match("}")) {
                    this.expect(",");
                  }
                }
                this.expect("}");
                return specifiers;
              };
              Parser3.prototype.parseImportDefaultSpecifier = function() {
                var node2 = this.createNode();
                var local = this.parseIdentifierName();
                return this.finalize(node2, new Node3.ImportDefaultSpecifier(local));
              };
              Parser3.prototype.parseImportNamespaceSpecifier = function() {
                var node2 = this.createNode();
                this.expect("*");
                if (!this.matchContextualKeyword("as")) {
                  this.throwError(messages_1.Messages.NoAsAfterImportNamespace);
                }
                this.nextToken();
                var local = this.parseIdentifierName();
                return this.finalize(node2, new Node3.ImportNamespaceSpecifier(local));
              };
              Parser3.prototype.parseImportDeclaration = function() {
                if (this.context.inFunctionBody) {
                  this.throwError(messages_1.Messages.IllegalImportDeclaration);
                }
                var node2 = this.createNode();
                this.expectKeyword("import");
                var src;
                var specifiers = [];
                if (this.lookahead.type === 8) {
                  src = this.parseModuleSpecifier();
                } else {
                  if (this.match("{")) {
                    specifiers = specifiers.concat(this.parseNamedImports());
                  } else if (this.match("*")) {
                    specifiers.push(this.parseImportNamespaceSpecifier());
                  } else if (this.isIdentifierName(this.lookahead) && !this.matchKeyword("default")) {
                    specifiers.push(this.parseImportDefaultSpecifier());
                    if (this.match(",")) {
                      this.nextToken();
                      if (this.match("*")) {
                        specifiers.push(this.parseImportNamespaceSpecifier());
                      } else if (this.match("{")) {
                        specifiers = specifiers.concat(this.parseNamedImports());
                      } else {
                        this.throwUnexpectedToken(this.lookahead);
                      }
                    }
                  } else {
                    this.throwUnexpectedToken(this.nextToken());
                  }
                  if (!this.matchContextualKeyword("from")) {
                    var message = this.lookahead.value ? messages_1.Messages.UnexpectedToken : messages_1.Messages.MissingFromClause;
                    this.throwError(message, this.lookahead.value);
                  }
                  this.nextToken();
                  src = this.parseModuleSpecifier();
                }
                this.consumeSemicolon();
                return this.finalize(node2, new Node3.ImportDeclaration(specifiers, src));
              };
              Parser3.prototype.parseExportSpecifier = function() {
                var node2 = this.createNode();
                var local = this.parseIdentifierName();
                var exported = local;
                if (this.matchContextualKeyword("as")) {
                  this.nextToken();
                  exported = this.parseIdentifierName();
                }
                return this.finalize(node2, new Node3.ExportSpecifier(local, exported));
              };
              Parser3.prototype.parseExportDeclaration = function() {
                if (this.context.inFunctionBody) {
                  this.throwError(messages_1.Messages.IllegalExportDeclaration);
                }
                var node2 = this.createNode();
                this.expectKeyword("export");
                var exportDeclaration;
                if (this.matchKeyword("default")) {
                  this.nextToken();
                  if (this.matchKeyword("function")) {
                    var declaration = this.parseFunctionDeclaration(true);
                    exportDeclaration = this.finalize(node2, new Node3.ExportDefaultDeclaration(declaration));
                  } else if (this.matchKeyword("class")) {
                    var declaration = this.parseClassDeclaration(true);
                    exportDeclaration = this.finalize(node2, new Node3.ExportDefaultDeclaration(declaration));
                  } else if (this.matchContextualKeyword("async")) {
                    var declaration = this.matchAsyncFunction() ? this.parseFunctionDeclaration(true) : this.parseAssignmentExpression();
                    exportDeclaration = this.finalize(node2, new Node3.ExportDefaultDeclaration(declaration));
                  } else {
                    if (this.matchContextualKeyword("from")) {
                      this.throwError(messages_1.Messages.UnexpectedToken, this.lookahead.value);
                    }
                    var declaration = this.match("{") ? this.parseObjectInitializer() : this.match("[") ? this.parseArrayInitializer() : this.parseAssignmentExpression();
                    this.consumeSemicolon();
                    exportDeclaration = this.finalize(node2, new Node3.ExportDefaultDeclaration(declaration));
                  }
                } else if (this.match("*")) {
                  this.nextToken();
                  if (!this.matchContextualKeyword("from")) {
                    var message = this.lookahead.value ? messages_1.Messages.UnexpectedToken : messages_1.Messages.MissingFromClause;
                    this.throwError(message, this.lookahead.value);
                  }
                  this.nextToken();
                  var src = this.parseModuleSpecifier();
                  this.consumeSemicolon();
                  exportDeclaration = this.finalize(node2, new Node3.ExportAllDeclaration(src));
                } else if (this.lookahead.type === 4) {
                  var declaration = void 0;
                  switch (this.lookahead.value) {
                    case "let":
                    case "const":
                      declaration = this.parseLexicalDeclaration({ inFor: false });
                      break;
                    case "var":
                    case "class":
                    case "function":
                      declaration = this.parseStatementListItem();
                      break;
                    default:
                      this.throwUnexpectedToken(this.lookahead);
                  }
                  exportDeclaration = this.finalize(node2, new Node3.ExportNamedDeclaration(declaration, [], null));
                } else if (this.matchAsyncFunction()) {
                  var declaration = this.parseFunctionDeclaration();
                  exportDeclaration = this.finalize(node2, new Node3.ExportNamedDeclaration(declaration, [], null));
                } else {
                  var specifiers = [];
                  var source = null;
                  var isExportFromIdentifier = false;
                  this.expect("{");
                  while (!this.match("}")) {
                    isExportFromIdentifier = isExportFromIdentifier || this.matchKeyword("default");
                    specifiers.push(this.parseExportSpecifier());
                    if (!this.match("}")) {
                      this.expect(",");
                    }
                  }
                  this.expect("}");
                  if (this.matchContextualKeyword("from")) {
                    this.nextToken();
                    source = this.parseModuleSpecifier();
                    this.consumeSemicolon();
                  } else if (isExportFromIdentifier) {
                    var message = this.lookahead.value ? messages_1.Messages.UnexpectedToken : messages_1.Messages.MissingFromClause;
                    this.throwError(message, this.lookahead.value);
                  } else {
                    this.consumeSemicolon();
                  }
                  exportDeclaration = this.finalize(node2, new Node3.ExportNamedDeclaration(null, specifiers, source));
                }
                return exportDeclaration;
              };
              return Parser3;
            }();
            exports2.Parser = Parser2;
          },
          /* 9 */
          /***/
          function(module3, exports2) {
            Object.defineProperty(exports2, "__esModule", { value: true });
            function assert61(condition, message) {
              if (!condition) {
                throw new Error("ASSERT: " + message);
              }
            }
            __name(assert61, "assert");
            exports2.assert = assert61;
          },
          /* 10 */
          /***/
          function(module3, exports2) {
            Object.defineProperty(exports2, "__esModule", { value: true });
            var ErrorHandler = function() {
              function ErrorHandler2() {
                this.errors = [];
                this.tolerant = false;
              }
              __name(ErrorHandler2, "ErrorHandler");
              ErrorHandler2.prototype.recordError = function(error2) {
                this.errors.push(error2);
              };
              ErrorHandler2.prototype.tolerate = function(error2) {
                if (this.tolerant) {
                  this.recordError(error2);
                } else {
                  throw error2;
                }
              };
              ErrorHandler2.prototype.constructError = function(msg, column) {
                var error2 = new Error(msg);
                try {
                  throw error2;
                } catch (base) {
                  if (Object.create && Object.defineProperty) {
                    error2 = Object.create(base);
                    Object.defineProperty(error2, "column", { value: column });
                  }
                }
                return error2;
              };
              ErrorHandler2.prototype.createError = function(index, line, col, description) {
                var msg = "Line " + line + ": " + description;
                var error2 = this.constructError(msg, col);
                error2.index = index;
                error2.lineNumber = line;
                error2.description = description;
                return error2;
              };
              ErrorHandler2.prototype.throwError = function(index, line, col, description) {
                throw this.createError(index, line, col, description);
              };
              ErrorHandler2.prototype.tolerateError = function(index, line, col, description) {
                var error2 = this.createError(index, line, col, description);
                if (this.tolerant) {
                  this.recordError(error2);
                } else {
                  throw error2;
                }
              };
              return ErrorHandler2;
            }();
            exports2.ErrorHandler = ErrorHandler;
          },
          /* 11 */
          /***/
          function(module3, exports2) {
            Object.defineProperty(exports2, "__esModule", { value: true });
            exports2.Messages = {
              BadGetterArity: "Getter must not have any formal parameters",
              BadSetterArity: "Setter must have exactly one formal parameter",
              BadSetterRestParameter: "Setter function argument must not be a rest parameter",
              ConstructorIsAsync: "Class constructor may not be an async method",
              ConstructorSpecialMethod: "Class constructor may not be an accessor",
              DeclarationMissingInitializer: "Missing initializer in %0 declaration",
              DefaultRestParameter: "Unexpected token =",
              DuplicateBinding: "Duplicate binding %0",
              DuplicateConstructor: "A class may only have one constructor",
              DuplicateProtoProperty: "Duplicate __proto__ fields are not allowed in object literals",
              ForInOfLoopInitializer: "%0 loop variable declaration may not have an initializer",
              GeneratorInLegacyContext: "Generator declarations are not allowed in legacy contexts",
              IllegalBreak: "Illegal break statement",
              IllegalContinue: "Illegal continue statement",
              IllegalExportDeclaration: "Unexpected token",
              IllegalImportDeclaration: "Unexpected token",
              IllegalLanguageModeDirective: "Illegal 'use strict' directive in function with non-simple parameter list",
              IllegalReturn: "Illegal return statement",
              InvalidEscapedReservedWord: "Keyword must not contain escaped characters",
              InvalidHexEscapeSequence: "Invalid hexadecimal escape sequence",
              InvalidLHSInAssignment: "Invalid left-hand side in assignment",
              InvalidLHSInForIn: "Invalid left-hand side in for-in",
              InvalidLHSInForLoop: "Invalid left-hand side in for-loop",
              InvalidModuleSpecifier: "Unexpected token",
              InvalidRegExp: "Invalid regular expression",
              LetInLexicalBinding: "let is disallowed as a lexically bound name",
              MissingFromClause: "Unexpected token",
              MultipleDefaultsInSwitch: "More than one default clause in switch statement",
              NewlineAfterThrow: "Illegal newline after throw",
              NoAsAfterImportNamespace: "Unexpected token",
              NoCatchOrFinally: "Missing catch or finally after try",
              ParameterAfterRestParameter: "Rest parameter must be last formal parameter",
              Redeclaration: "%0 '%1' has already been declared",
              StaticPrototype: "Classes may not have static property named prototype",
              StrictCatchVariable: "Catch variable may not be eval or arguments in strict mode",
              StrictDelete: "Delete of an unqualified identifier in strict mode.",
              StrictFunction: "In strict mode code, functions can only be declared at top level or inside a block",
              StrictFunctionName: "Function name may not be eval or arguments in strict mode",
              StrictLHSAssignment: "Assignment to eval or arguments is not allowed in strict mode",
              StrictLHSPostfix: "Postfix increment/decrement may not have eval or arguments operand in strict mode",
              StrictLHSPrefix: "Prefix increment/decrement may not have eval or arguments operand in strict mode",
              StrictModeWith: "Strict mode code may not include a with statement",
              StrictOctalLiteral: "Octal literals are not allowed in strict mode.",
              StrictParamDupe: "Strict mode function may not have duplicate parameter names",
              StrictParamName: "Parameter name eval or arguments is not allowed in strict mode",
              StrictReservedWord: "Use of future reserved word in strict mode",
              StrictVarName: "Variable name may not be eval or arguments in strict mode",
              TemplateOctalLiteral: "Octal literals are not allowed in template strings.",
              UnexpectedEOS: "Unexpected end of input",
              UnexpectedIdentifier: "Unexpected identifier",
              UnexpectedNumber: "Unexpected number",
              UnexpectedReserved: "Unexpected reserved word",
              UnexpectedString: "Unexpected string",
              UnexpectedTemplate: "Unexpected quasi %0",
              UnexpectedToken: "Unexpected token %0",
              UnexpectedTokenIllegal: "Unexpected token ILLEGAL",
              UnknownLabel: "Undefined label '%0'",
              UnterminatedRegExp: "Invalid regular expression: missing /"
            };
          },
          /* 12 */
          /***/
          function(module3, exports2, __webpack_require__) {
            Object.defineProperty(exports2, "__esModule", { value: true });
            var assert_1 = __webpack_require__(9);
            var character_1 = __webpack_require__(4);
            var messages_1 = __webpack_require__(11);
            function hexValue(ch2) {
              return "0123456789abcdef".indexOf(ch2.toLowerCase());
            }
            __name(hexValue, "hexValue");
            function octalValue(ch2) {
              return "01234567".indexOf(ch2);
            }
            __name(octalValue, "octalValue");
            var Scanner = function() {
              function Scanner2(code, handler) {
                this.source = code;
                this.errorHandler = handler;
                this.trackComment = false;
                this.isModule = false;
                this.length = code.length;
                this.index = 0;
                this.lineNumber = code.length > 0 ? 1 : 0;
                this.lineStart = 0;
                this.curlyStack = [];
              }
              __name(Scanner2, "Scanner");
              Scanner2.prototype.saveState = function() {
                return {
                  index: this.index,
                  lineNumber: this.lineNumber,
                  lineStart: this.lineStart
                };
              };
              Scanner2.prototype.restoreState = function(state2) {
                this.index = state2.index;
                this.lineNumber = state2.lineNumber;
                this.lineStart = state2.lineStart;
              };
              Scanner2.prototype.eof = function() {
                return this.index >= this.length;
              };
              Scanner2.prototype.throwUnexpectedToken = function(message) {
                if (message === void 0) {
                  message = messages_1.Messages.UnexpectedTokenIllegal;
                }
                return this.errorHandler.throwError(this.index, this.lineNumber, this.index - this.lineStart + 1, message);
              };
              Scanner2.prototype.tolerateUnexpectedToken = function(message) {
                if (message === void 0) {
                  message = messages_1.Messages.UnexpectedTokenIllegal;
                }
                this.errorHandler.tolerateError(this.index, this.lineNumber, this.index - this.lineStart + 1, message);
              };
              Scanner2.prototype.skipSingleLineComment = function(offset) {
                var comments = [];
                var start, loc;
                if (this.trackComment) {
                  comments = [];
                  start = this.index - offset;
                  loc = {
                    start: {
                      line: this.lineNumber,
                      column: this.index - this.lineStart - offset
                    },
                    end: {}
                  };
                }
                while (!this.eof()) {
                  var ch2 = this.source.charCodeAt(this.index);
                  ++this.index;
                  if (character_1.Character.isLineTerminator(ch2)) {
                    if (this.trackComment) {
                      loc.end = {
                        line: this.lineNumber,
                        column: this.index - this.lineStart - 1
                      };
                      var entry = {
                        multiLine: false,
                        slice: [start + offset, this.index - 1],
                        range: [start, this.index - 1],
                        loc
                      };
                      comments.push(entry);
                    }
                    if (ch2 === 13 && this.source.charCodeAt(this.index) === 10) {
                      ++this.index;
                    }
                    ++this.lineNumber;
                    this.lineStart = this.index;
                    return comments;
                  }
                }
                if (this.trackComment) {
                  loc.end = {
                    line: this.lineNumber,
                    column: this.index - this.lineStart
                  };
                  var entry = {
                    multiLine: false,
                    slice: [start + offset, this.index],
                    range: [start, this.index],
                    loc
                  };
                  comments.push(entry);
                }
                return comments;
              };
              Scanner2.prototype.skipMultiLineComment = function() {
                var comments = [];
                var start, loc;
                if (this.trackComment) {
                  comments = [];
                  start = this.index - 2;
                  loc = {
                    start: {
                      line: this.lineNumber,
                      column: this.index - this.lineStart - 2
                    },
                    end: {}
                  };
                }
                while (!this.eof()) {
                  var ch2 = this.source.charCodeAt(this.index);
                  if (character_1.Character.isLineTerminator(ch2)) {
                    if (ch2 === 13 && this.source.charCodeAt(this.index + 1) === 10) {
                      ++this.index;
                    }
                    ++this.lineNumber;
                    ++this.index;
                    this.lineStart = this.index;
                  } else if (ch2 === 42) {
                    if (this.source.charCodeAt(this.index + 1) === 47) {
                      this.index += 2;
                      if (this.trackComment) {
                        loc.end = {
                          line: this.lineNumber,
                          column: this.index - this.lineStart
                        };
                        var entry = {
                          multiLine: true,
                          slice: [start + 2, this.index - 2],
                          range: [start, this.index],
                          loc
                        };
                        comments.push(entry);
                      }
                      return comments;
                    }
                    ++this.index;
                  } else {
                    ++this.index;
                  }
                }
                if (this.trackComment) {
                  loc.end = {
                    line: this.lineNumber,
                    column: this.index - this.lineStart
                  };
                  var entry = {
                    multiLine: true,
                    slice: [start + 2, this.index],
                    range: [start, this.index],
                    loc
                  };
                  comments.push(entry);
                }
                this.tolerateUnexpectedToken();
                return comments;
              };
              Scanner2.prototype.scanComments = function() {
                var comments;
                if (this.trackComment) {
                  comments = [];
                }
                var start = this.index === 0;
                while (!this.eof()) {
                  var ch2 = this.source.charCodeAt(this.index);
                  if (character_1.Character.isWhiteSpace(ch2)) {
                    ++this.index;
                  } else if (character_1.Character.isLineTerminator(ch2)) {
                    ++this.index;
                    if (ch2 === 13 && this.source.charCodeAt(this.index) === 10) {
                      ++this.index;
                    }
                    ++this.lineNumber;
                    this.lineStart = this.index;
                    start = true;
                  } else if (ch2 === 47) {
                    ch2 = this.source.charCodeAt(this.index + 1);
                    if (ch2 === 47) {
                      this.index += 2;
                      var comment = this.skipSingleLineComment(2);
                      if (this.trackComment) {
                        comments = comments.concat(comment);
                      }
                      start = true;
                    } else if (ch2 === 42) {
                      this.index += 2;
                      var comment = this.skipMultiLineComment();
                      if (this.trackComment) {
                        comments = comments.concat(comment);
                      }
                    } else {
                      break;
                    }
                  } else if (start && ch2 === 45) {
                    if (this.source.charCodeAt(this.index + 1) === 45 && this.source.charCodeAt(this.index + 2) === 62) {
                      this.index += 3;
                      var comment = this.skipSingleLineComment(3);
                      if (this.trackComment) {
                        comments = comments.concat(comment);
                      }
                    } else {
                      break;
                    }
                  } else if (ch2 === 60 && !this.isModule) {
                    if (this.source.slice(this.index + 1, this.index + 4) === "!--") {
                      this.index += 4;
                      var comment = this.skipSingleLineComment(4);
                      if (this.trackComment) {
                        comments = comments.concat(comment);
                      }
                    } else {
                      break;
                    }
                  } else {
                    break;
                  }
                }
                return comments;
              };
              Scanner2.prototype.isFutureReservedWord = function(id) {
                switch (id) {
                  case "enum":
                  case "export":
                  case "import":
                  case "super":
                    return true;
                  default:
                    return false;
                }
              };
              Scanner2.prototype.isStrictModeReservedWord = function(id) {
                switch (id) {
                  case "implements":
                  case "interface":
                  case "package":
                  case "private":
                  case "protected":
                  case "public":
                  case "static":
                  case "yield":
                  case "let":
                    return true;
                  default:
                    return false;
                }
              };
              Scanner2.prototype.isRestrictedWord = function(id) {
                return id === "eval" || id === "arguments";
              };
              Scanner2.prototype.isKeyword = function(id) {
                switch (id.length) {
                  case 2:
                    return id === "if" || id === "in" || id === "do";
                  case 3:
                    return id === "var" || id === "for" || id === "new" || id === "try" || id === "let";
                  case 4:
                    return id === "this" || id === "else" || id === "case" || id === "void" || id === "with" || id === "enum";
                  case 5:
                    return id === "while" || id === "break" || id === "catch" || id === "throw" || id === "const" || id === "yield" || id === "class" || id === "super";
                  case 6:
                    return id === "return" || id === "typeof" || id === "delete" || id === "switch" || id === "export" || id === "import";
                  case 7:
                    return id === "default" || id === "finally" || id === "extends";
                  case 8:
                    return id === "function" || id === "continue" || id === "debugger";
                  case 10:
                    return id === "instanceof";
                  default:
                    return false;
                }
              };
              Scanner2.prototype.codePointAt = function(i7) {
                var cp3 = this.source.charCodeAt(i7);
                if (cp3 >= 55296 && cp3 <= 56319) {
                  var second = this.source.charCodeAt(i7 + 1);
                  if (second >= 56320 && second <= 57343) {
                    var first = cp3;
                    cp3 = (first - 55296) * 1024 + second - 56320 + 65536;
                  }
                }
                return cp3;
              };
              Scanner2.prototype.scanHexEscape = function(prefix) {
                var len = prefix === "u" ? 4 : 2;
                var code = 0;
                for (var i7 = 0; i7 < len; ++i7) {
                  if (!this.eof() && character_1.Character.isHexDigit(this.source.charCodeAt(this.index))) {
                    code = code * 16 + hexValue(this.source[this.index++]);
                  } else {
                    return null;
                  }
                }
                return String.fromCharCode(code);
              };
              Scanner2.prototype.scanUnicodeCodePointEscape = function() {
                var ch2 = this.source[this.index];
                var code = 0;
                if (ch2 === "}") {
                  this.throwUnexpectedToken();
                }
                while (!this.eof()) {
                  ch2 = this.source[this.index++];
                  if (!character_1.Character.isHexDigit(ch2.charCodeAt(0))) {
                    break;
                  }
                  code = code * 16 + hexValue(ch2);
                }
                if (code > 1114111 || ch2 !== "}") {
                  this.throwUnexpectedToken();
                }
                return character_1.Character.fromCodePoint(code);
              };
              Scanner2.prototype.getIdentifier = function() {
                var start = this.index++;
                while (!this.eof()) {
                  var ch2 = this.source.charCodeAt(this.index);
                  if (ch2 === 92) {
                    this.index = start;
                    return this.getComplexIdentifier();
                  } else if (ch2 >= 55296 && ch2 < 57343) {
                    this.index = start;
                    return this.getComplexIdentifier();
                  }
                  if (character_1.Character.isIdentifierPart(ch2)) {
                    ++this.index;
                  } else {
                    break;
                  }
                }
                return this.source.slice(start, this.index);
              };
              Scanner2.prototype.getComplexIdentifier = function() {
                var cp3 = this.codePointAt(this.index);
                var id = character_1.Character.fromCodePoint(cp3);
                this.index += id.length;
                var ch2;
                if (cp3 === 92) {
                  if (this.source.charCodeAt(this.index) !== 117) {
                    this.throwUnexpectedToken();
                  }
                  ++this.index;
                  if (this.source[this.index] === "{") {
                    ++this.index;
                    ch2 = this.scanUnicodeCodePointEscape();
                  } else {
                    ch2 = this.scanHexEscape("u");
                    if (ch2 === null || ch2 === "\\" || !character_1.Character.isIdentifierStart(ch2.charCodeAt(0))) {
                      this.throwUnexpectedToken();
                    }
                  }
                  id = ch2;
                }
                while (!this.eof()) {
                  cp3 = this.codePointAt(this.index);
                  if (!character_1.Character.isIdentifierPart(cp3)) {
                    break;
                  }
                  ch2 = character_1.Character.fromCodePoint(cp3);
                  id += ch2;
                  this.index += ch2.length;
                  if (cp3 === 92) {
                    id = id.substr(0, id.length - 1);
                    if (this.source.charCodeAt(this.index) !== 117) {
                      this.throwUnexpectedToken();
                    }
                    ++this.index;
                    if (this.source[this.index] === "{") {
                      ++this.index;
                      ch2 = this.scanUnicodeCodePointEscape();
                    } else {
                      ch2 = this.scanHexEscape("u");
                      if (ch2 === null || ch2 === "\\" || !character_1.Character.isIdentifierPart(ch2.charCodeAt(0))) {
                        this.throwUnexpectedToken();
                      }
                    }
                    id += ch2;
                  }
                }
                return id;
              };
              Scanner2.prototype.octalToDecimal = function(ch2) {
                var octal = ch2 !== "0";
                var code = octalValue(ch2);
                if (!this.eof() && character_1.Character.isOctalDigit(this.source.charCodeAt(this.index))) {
                  octal = true;
                  code = code * 8 + octalValue(this.source[this.index++]);
                  if ("0123".indexOf(ch2) >= 0 && !this.eof() && character_1.Character.isOctalDigit(this.source.charCodeAt(this.index))) {
                    code = code * 8 + octalValue(this.source[this.index++]);
                  }
                }
                return {
                  code,
                  octal
                };
              };
              Scanner2.prototype.scanIdentifier = function() {
                var type;
                var start = this.index;
                var id = this.source.charCodeAt(start) === 92 ? this.getComplexIdentifier() : this.getIdentifier();
                if (id.length === 1) {
                  type = 3;
                } else if (this.isKeyword(id)) {
                  type = 4;
                } else if (id === "null") {
                  type = 5;
                } else if (id === "true" || id === "false") {
                  type = 1;
                } else {
                  type = 3;
                }
                if (type !== 3 && start + id.length !== this.index) {
                  var restore = this.index;
                  this.index = start;
                  this.tolerateUnexpectedToken(messages_1.Messages.InvalidEscapedReservedWord);
                  this.index = restore;
                }
                return {
                  type,
                  value: id,
                  lineNumber: this.lineNumber,
                  lineStart: this.lineStart,
                  start,
                  end: this.index
                };
              };
              Scanner2.prototype.scanPunctuator = function() {
                var start = this.index;
                var str = this.source[this.index];
                switch (str) {
                  case "(":
                  case "{":
                    if (str === "{") {
                      this.curlyStack.push("{");
                    }
                    ++this.index;
                    break;
                  case ".":
                    ++this.index;
                    if (this.source[this.index] === "." && this.source[this.index + 1] === ".") {
                      this.index += 2;
                      str = "...";
                    }
                    break;
                  case "}":
                    ++this.index;
                    this.curlyStack.pop();
                    break;
                  case ")":
                  case ";":
                  case ",":
                  case "[":
                  case "]":
                  case ":":
                  case "?":
                  case "~":
                    ++this.index;
                    break;
                  default:
                    str = this.source.substr(this.index, 4);
                    if (str === ">>>=") {
                      this.index += 4;
                    } else {
                      str = str.substr(0, 3);
                      if (str === "===" || str === "!==" || str === ">>>" || str === "<<=" || str === ">>=" || str === "**=") {
                        this.index += 3;
                      } else {
                        str = str.substr(0, 2);
                        if (str === "&&" || str === "||" || str === "==" || str === "!=" || str === "+=" || str === "-=" || str === "*=" || str === "/=" || str === "++" || str === "--" || str === "<<" || str === ">>" || str === "&=" || str === "|=" || str === "^=" || str === "%=" || str === "<=" || str === ">=" || str === "=>" || str === "**") {
                          this.index += 2;
                        } else {
                          str = this.source[this.index];
                          if ("<>=!+-*%&|^/".indexOf(str) >= 0) {
                            ++this.index;
                          }
                        }
                      }
                    }
                }
                if (this.index === start) {
                  this.throwUnexpectedToken();
                }
                return {
                  type: 7,
                  value: str,
                  lineNumber: this.lineNumber,
                  lineStart: this.lineStart,
                  start,
                  end: this.index
                };
              };
              Scanner2.prototype.scanHexLiteral = function(start) {
                var num = "";
                while (!this.eof()) {
                  if (!character_1.Character.isHexDigit(this.source.charCodeAt(this.index))) {
                    break;
                  }
                  num += this.source[this.index++];
                }
                if (num.length === 0) {
                  this.throwUnexpectedToken();
                }
                if (character_1.Character.isIdentifierStart(this.source.charCodeAt(this.index))) {
                  this.throwUnexpectedToken();
                }
                return {
                  type: 6,
                  value: parseInt("0x" + num, 16),
                  lineNumber: this.lineNumber,
                  lineStart: this.lineStart,
                  start,
                  end: this.index
                };
              };
              Scanner2.prototype.scanBinaryLiteral = function(start) {
                var num = "";
                var ch2;
                while (!this.eof()) {
                  ch2 = this.source[this.index];
                  if (ch2 !== "0" && ch2 !== "1") {
                    break;
                  }
                  num += this.source[this.index++];
                }
                if (num.length === 0) {
                  this.throwUnexpectedToken();
                }
                if (!this.eof()) {
                  ch2 = this.source.charCodeAt(this.index);
                  if (character_1.Character.isIdentifierStart(ch2) || character_1.Character.isDecimalDigit(ch2)) {
                    this.throwUnexpectedToken();
                  }
                }
                return {
                  type: 6,
                  value: parseInt(num, 2),
                  lineNumber: this.lineNumber,
                  lineStart: this.lineStart,
                  start,
                  end: this.index
                };
              };
              Scanner2.prototype.scanOctalLiteral = function(prefix, start) {
                var num = "";
                var octal = false;
                if (character_1.Character.isOctalDigit(prefix.charCodeAt(0))) {
                  octal = true;
                  num = "0" + this.source[this.index++];
                } else {
                  ++this.index;
                }
                while (!this.eof()) {
                  if (!character_1.Character.isOctalDigit(this.source.charCodeAt(this.index))) {
                    break;
                  }
                  num += this.source[this.index++];
                }
                if (!octal && num.length === 0) {
                  this.throwUnexpectedToken();
                }
                if (character_1.Character.isIdentifierStart(this.source.charCodeAt(this.index)) || character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index))) {
                  this.throwUnexpectedToken();
                }
                return {
                  type: 6,
                  value: parseInt(num, 8),
                  octal,
                  lineNumber: this.lineNumber,
                  lineStart: this.lineStart,
                  start,
                  end: this.index
                };
              };
              Scanner2.prototype.isImplicitOctalLiteral = function() {
                for (var i7 = this.index + 1; i7 < this.length; ++i7) {
                  var ch2 = this.source[i7];
                  if (ch2 === "8" || ch2 === "9") {
                    return false;
                  }
                  if (!character_1.Character.isOctalDigit(ch2.charCodeAt(0))) {
                    return true;
                  }
                }
                return true;
              };
              Scanner2.prototype.scanNumericLiteral = function() {
                var start = this.index;
                var ch2 = this.source[start];
                assert_1.assert(character_1.Character.isDecimalDigit(ch2.charCodeAt(0)) || ch2 === ".", "Numeric literal must start with a decimal digit or a decimal point");
                var num = "";
                if (ch2 !== ".") {
                  num = this.source[this.index++];
                  ch2 = this.source[this.index];
                  if (num === "0") {
                    if (ch2 === "x" || ch2 === "X") {
                      ++this.index;
                      return this.scanHexLiteral(start);
                    }
                    if (ch2 === "b" || ch2 === "B") {
                      ++this.index;
                      return this.scanBinaryLiteral(start);
                    }
                    if (ch2 === "o" || ch2 === "O") {
                      return this.scanOctalLiteral(ch2, start);
                    }
                    if (ch2 && character_1.Character.isOctalDigit(ch2.charCodeAt(0))) {
                      if (this.isImplicitOctalLiteral()) {
                        return this.scanOctalLiteral(ch2, start);
                      }
                    }
                  }
                  while (character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index))) {
                    num += this.source[this.index++];
                  }
                  ch2 = this.source[this.index];
                }
                if (ch2 === ".") {
                  num += this.source[this.index++];
                  while (character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index))) {
                    num += this.source[this.index++];
                  }
                  ch2 = this.source[this.index];
                }
                if (ch2 === "e" || ch2 === "E") {
                  num += this.source[this.index++];
                  ch2 = this.source[this.index];
                  if (ch2 === "+" || ch2 === "-") {
                    num += this.source[this.index++];
                  }
                  if (character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index))) {
                    while (character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index))) {
                      num += this.source[this.index++];
                    }
                  } else {
                    this.throwUnexpectedToken();
                  }
                }
                if (character_1.Character.isIdentifierStart(this.source.charCodeAt(this.index))) {
                  this.throwUnexpectedToken();
                }
                return {
                  type: 6,
                  value: parseFloat(num),
                  lineNumber: this.lineNumber,
                  lineStart: this.lineStart,
                  start,
                  end: this.index
                };
              };
              Scanner2.prototype.scanStringLiteral = function() {
                var start = this.index;
                var quote2 = this.source[start];
                assert_1.assert(quote2 === "'" || quote2 === '"', "String literal must starts with a quote");
                ++this.index;
                var octal = false;
                var str = "";
                while (!this.eof()) {
                  var ch2 = this.source[this.index++];
                  if (ch2 === quote2) {
                    quote2 = "";
                    break;
                  } else if (ch2 === "\\") {
                    ch2 = this.source[this.index++];
                    if (!ch2 || !character_1.Character.isLineTerminator(ch2.charCodeAt(0))) {
                      switch (ch2) {
                        case "u":
                          if (this.source[this.index] === "{") {
                            ++this.index;
                            str += this.scanUnicodeCodePointEscape();
                          } else {
                            var unescaped_1 = this.scanHexEscape(ch2);
                            if (unescaped_1 === null) {
                              this.throwUnexpectedToken();
                            }
                            str += unescaped_1;
                          }
                          break;
                        case "x":
                          var unescaped = this.scanHexEscape(ch2);
                          if (unescaped === null) {
                            this.throwUnexpectedToken(messages_1.Messages.InvalidHexEscapeSequence);
                          }
                          str += unescaped;
                          break;
                        case "n":
                          str += "\n";
                          break;
                        case "r":
                          str += "\r";
                          break;
                        case "t":
                          str += "	";
                          break;
                        case "b":
                          str += "\b";
                          break;
                        case "f":
                          str += "\f";
                          break;
                        case "v":
                          str += "\v";
                          break;
                        case "8":
                        case "9":
                          str += ch2;
                          this.tolerateUnexpectedToken();
                          break;
                        default:
                          if (ch2 && character_1.Character.isOctalDigit(ch2.charCodeAt(0))) {
                            var octToDec = this.octalToDecimal(ch2);
                            octal = octToDec.octal || octal;
                            str += String.fromCharCode(octToDec.code);
                          } else {
                            str += ch2;
                          }
                          break;
                      }
                    } else {
                      ++this.lineNumber;
                      if (ch2 === "\r" && this.source[this.index] === "\n") {
                        ++this.index;
                      }
                      this.lineStart = this.index;
                    }
                  } else if (character_1.Character.isLineTerminator(ch2.charCodeAt(0))) {
                    break;
                  } else {
                    str += ch2;
                  }
                }
                if (quote2 !== "") {
                  this.index = start;
                  this.throwUnexpectedToken();
                }
                return {
                  type: 8,
                  value: str,
                  octal,
                  lineNumber: this.lineNumber,
                  lineStart: this.lineStart,
                  start,
                  end: this.index
                };
              };
              Scanner2.prototype.scanTemplate = function() {
                var cooked = "";
                var terminated = false;
                var start = this.index;
                var head = this.source[start] === "`";
                var tail = false;
                var rawOffset = 2;
                ++this.index;
                while (!this.eof()) {
                  var ch2 = this.source[this.index++];
                  if (ch2 === "`") {
                    rawOffset = 1;
                    tail = true;
                    terminated = true;
                    break;
                  } else if (ch2 === "$") {
                    if (this.source[this.index] === "{") {
                      this.curlyStack.push("${");
                      ++this.index;
                      terminated = true;
                      break;
                    }
                    cooked += ch2;
                  } else if (ch2 === "\\") {
                    ch2 = this.source[this.index++];
                    if (!character_1.Character.isLineTerminator(ch2.charCodeAt(0))) {
                      switch (ch2) {
                        case "n":
                          cooked += "\n";
                          break;
                        case "r":
                          cooked += "\r";
                          break;
                        case "t":
                          cooked += "	";
                          break;
                        case "u":
                          if (this.source[this.index] === "{") {
                            ++this.index;
                            cooked += this.scanUnicodeCodePointEscape();
                          } else {
                            var restore = this.index;
                            var unescaped_2 = this.scanHexEscape(ch2);
                            if (unescaped_2 !== null) {
                              cooked += unescaped_2;
                            } else {
                              this.index = restore;
                              cooked += ch2;
                            }
                          }
                          break;
                        case "x":
                          var unescaped = this.scanHexEscape(ch2);
                          if (unescaped === null) {
                            this.throwUnexpectedToken(messages_1.Messages.InvalidHexEscapeSequence);
                          }
                          cooked += unescaped;
                          break;
                        case "b":
                          cooked += "\b";
                          break;
                        case "f":
                          cooked += "\f";
                          break;
                        case "v":
                          cooked += "\v";
                          break;
                        default:
                          if (ch2 === "0") {
                            if (character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index))) {
                              this.throwUnexpectedToken(messages_1.Messages.TemplateOctalLiteral);
                            }
                            cooked += "\0";
                          } else if (character_1.Character.isOctalDigit(ch2.charCodeAt(0))) {
                            this.throwUnexpectedToken(messages_1.Messages.TemplateOctalLiteral);
                          } else {
                            cooked += ch2;
                          }
                          break;
                      }
                    } else {
                      ++this.lineNumber;
                      if (ch2 === "\r" && this.source[this.index] === "\n") {
                        ++this.index;
                      }
                      this.lineStart = this.index;
                    }
                  } else if (character_1.Character.isLineTerminator(ch2.charCodeAt(0))) {
                    ++this.lineNumber;
                    if (ch2 === "\r" && this.source[this.index] === "\n") {
                      ++this.index;
                    }
                    this.lineStart = this.index;
                    cooked += "\n";
                  } else {
                    cooked += ch2;
                  }
                }
                if (!terminated) {
                  this.throwUnexpectedToken();
                }
                if (!head) {
                  this.curlyStack.pop();
                }
                return {
                  type: 10,
                  value: this.source.slice(start + 1, this.index - rawOffset),
                  cooked,
                  head,
                  tail,
                  lineNumber: this.lineNumber,
                  lineStart: this.lineStart,
                  start,
                  end: this.index
                };
              };
              Scanner2.prototype.testRegExp = function(pattern, flags2) {
                var astralSubstitute = "\uFFFF";
                var tmp = pattern;
                var self2 = this;
                if (flags2.indexOf("u") >= 0) {
                  tmp = tmp.replace(/\\u\{([0-9a-fA-F]+)\}|\\u([a-fA-F0-9]{4})/g, function($0, $1, $22) {
                    var codePoint = parseInt($1 || $22, 16);
                    if (codePoint > 1114111) {
                      self2.throwUnexpectedToken(messages_1.Messages.InvalidRegExp);
                    }
                    if (codePoint <= 65535) {
                      return String.fromCharCode(codePoint);
                    }
                    return astralSubstitute;
                  }).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g, astralSubstitute);
                }
                try {
                  RegExp(tmp);
                } catch (e10) {
                  this.throwUnexpectedToken(messages_1.Messages.InvalidRegExp);
                }
                try {
                  return new RegExp(pattern, flags2);
                } catch (exception) {
                  return null;
                }
              };
              Scanner2.prototype.scanRegExpBody = function() {
                var ch2 = this.source[this.index];
                assert_1.assert(ch2 === "/", "Regular expression literal must start with a slash");
                var str = this.source[this.index++];
                var classMarker = false;
                var terminated = false;
                while (!this.eof()) {
                  ch2 = this.source[this.index++];
                  str += ch2;
                  if (ch2 === "\\") {
                    ch2 = this.source[this.index++];
                    if (character_1.Character.isLineTerminator(ch2.charCodeAt(0))) {
                      this.throwUnexpectedToken(messages_1.Messages.UnterminatedRegExp);
                    }
                    str += ch2;
                  } else if (character_1.Character.isLineTerminator(ch2.charCodeAt(0))) {
                    this.throwUnexpectedToken(messages_1.Messages.UnterminatedRegExp);
                  } else if (classMarker) {
                    if (ch2 === "]") {
                      classMarker = false;
                    }
                  } else {
                    if (ch2 === "/") {
                      terminated = true;
                      break;
                    } else if (ch2 === "[") {
                      classMarker = true;
                    }
                  }
                }
                if (!terminated) {
                  this.throwUnexpectedToken(messages_1.Messages.UnterminatedRegExp);
                }
                return str.substr(1, str.length - 2);
              };
              Scanner2.prototype.scanRegExpFlags = function() {
                var str = "";
                var flags2 = "";
                while (!this.eof()) {
                  var ch2 = this.source[this.index];
                  if (!character_1.Character.isIdentifierPart(ch2.charCodeAt(0))) {
                    break;
                  }
                  ++this.index;
                  if (ch2 === "\\" && !this.eof()) {
                    ch2 = this.source[this.index];
                    if (ch2 === "u") {
                      ++this.index;
                      var restore = this.index;
                      var char = this.scanHexEscape("u");
                      if (char !== null) {
                        flags2 += char;
                        for (str += "\\u"; restore < this.index; ++restore) {
                          str += this.source[restore];
                        }
                      } else {
                        this.index = restore;
                        flags2 += "u";
                        str += "\\u";
                      }
                      this.tolerateUnexpectedToken();
                    } else {
                      str += "\\";
                      this.tolerateUnexpectedToken();
                    }
                  } else {
                    flags2 += ch2;
                    str += ch2;
                  }
                }
                return flags2;
              };
              Scanner2.prototype.scanRegExp = function() {
                var start = this.index;
                var pattern = this.scanRegExpBody();
                var flags2 = this.scanRegExpFlags();
                var value = this.testRegExp(pattern, flags2);
                return {
                  type: 9,
                  value: "",
                  pattern,
                  flags: flags2,
                  regex: value,
                  lineNumber: this.lineNumber,
                  lineStart: this.lineStart,
                  start,
                  end: this.index
                };
              };
              Scanner2.prototype.lex = function() {
                if (this.eof()) {
                  return {
                    type: 2,
                    value: "",
                    lineNumber: this.lineNumber,
                    lineStart: this.lineStart,
                    start: this.index,
                    end: this.index
                  };
                }
                var cp3 = this.source.charCodeAt(this.index);
                if (character_1.Character.isIdentifierStart(cp3)) {
                  return this.scanIdentifier();
                }
                if (cp3 === 40 || cp3 === 41 || cp3 === 59) {
                  return this.scanPunctuator();
                }
                if (cp3 === 39 || cp3 === 34) {
                  return this.scanStringLiteral();
                }
                if (cp3 === 46) {
                  if (character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index + 1))) {
                    return this.scanNumericLiteral();
                  }
                  return this.scanPunctuator();
                }
                if (character_1.Character.isDecimalDigit(cp3)) {
                  return this.scanNumericLiteral();
                }
                if (cp3 === 96 || cp3 === 125 && this.curlyStack[this.curlyStack.length - 1] === "${") {
                  return this.scanTemplate();
                }
                if (cp3 >= 55296 && cp3 < 57343) {
                  if (character_1.Character.isIdentifierStart(this.codePointAt(this.index))) {
                    return this.scanIdentifier();
                  }
                }
                return this.scanPunctuator();
              };
              return Scanner2;
            }();
            exports2.Scanner = Scanner;
          },
          /* 13 */
          /***/
          function(module3, exports2) {
            Object.defineProperty(exports2, "__esModule", { value: true });
            exports2.TokenName = {};
            exports2.TokenName[
              1
              /* BooleanLiteral */
            ] = "Boolean";
            exports2.TokenName[
              2
              /* EOF */
            ] = "<end>";
            exports2.TokenName[
              3
              /* Identifier */
            ] = "Identifier";
            exports2.TokenName[
              4
              /* Keyword */
            ] = "Keyword";
            exports2.TokenName[
              5
              /* NullLiteral */
            ] = "Null";
            exports2.TokenName[
              6
              /* NumericLiteral */
            ] = "Numeric";
            exports2.TokenName[
              7
              /* Punctuator */
            ] = "Punctuator";
            exports2.TokenName[
              8
              /* StringLiteral */
            ] = "String";
            exports2.TokenName[
              9
              /* RegularExpression */
            ] = "RegularExpression";
            exports2.TokenName[
              10
              /* Template */
            ] = "Template";
          },
          /* 14 */
          /***/
          function(module3, exports2) {
            Object.defineProperty(exports2, "__esModule", { value: true });
            exports2.XHTMLEntities = {
              quot: '"',
              amp: "&",
              apos: "'",
              gt: ">",
              nbsp: "\xA0",
              iexcl: "\xA1",
              cent: "\xA2",
              pound: "\xA3",
              curren: "\xA4",
              yen: "\xA5",
              brvbar: "\xA6",
              sect: "\xA7",
              uml: "\xA8",
              copy: "\xA9",
              ordf: "\xAA",
              laquo: "\xAB",
              not: "\xAC",
              shy: "\xAD",
              reg: "\xAE",
              macr: "\xAF",
              deg: "\xB0",
              plusmn: "\xB1",
              sup2: "\xB2",
              sup3: "\xB3",
              acute: "\xB4",
              micro: "\xB5",
              para: "\xB6",
              middot: "\xB7",
              cedil: "\xB8",
              sup1: "\xB9",
              ordm: "\xBA",
              raquo: "\xBB",
              frac14: "\xBC",
              frac12: "\xBD",
              frac34: "\xBE",
              iquest: "\xBF",
              Agrave: "\xC0",
              Aacute: "\xC1",
              Acirc: "\xC2",
              Atilde: "\xC3",
              Auml: "\xC4",
              Aring: "\xC5",
              AElig: "\xC6",
              Ccedil: "\xC7",
              Egrave: "\xC8",
              Eacute: "\xC9",
              Ecirc: "\xCA",
              Euml: "\xCB",
              Igrave: "\xCC",
              Iacute: "\xCD",
              Icirc: "\xCE",
              Iuml: "\xCF",
              ETH: "\xD0",
              Ntilde: "\xD1",
              Ograve: "\xD2",
              Oacute: "\xD3",
              Ocirc: "\xD4",
              Otilde: "\xD5",
              Ouml: "\xD6",
              times: "\xD7",
              Oslash: "\xD8",
              Ugrave: "\xD9",
              Uacute: "\xDA",
              Ucirc: "\xDB",
              Uuml: "\xDC",
              Yacute: "\xDD",
              THORN: "\xDE",
              szlig: "\xDF",
              agrave: "\xE0",
              aacute: "\xE1",
              acirc: "\xE2",
              atilde: "\xE3",
              auml: "\xE4",
              aring: "\xE5",
              aelig: "\xE6",
              ccedil: "\xE7",
              egrave: "\xE8",
              eacute: "\xE9",
              ecirc: "\xEA",
              euml: "\xEB",
              igrave: "\xEC",
              iacute: "\xED",
              icirc: "\xEE",
              iuml: "\xEF",
              eth: "\xF0",
              ntilde: "\xF1",
              ograve: "\xF2",
              oacute: "\xF3",
              ocirc: "\xF4",
              otilde: "\xF5",
              ouml: "\xF6",
              divide: "\xF7",
              oslash: "\xF8",
              ugrave: "\xF9",
              uacute: "\xFA",
              ucirc: "\xFB",
              uuml: "\xFC",
              yacute: "\xFD",
              thorn: "\xFE",
              yuml: "\xFF",
              OElig: "\u0152",
              oelig: "\u0153",
              Scaron: "\u0160",
              scaron: "\u0161",
              Yuml: "\u0178",
              fnof: "\u0192",
              circ: "\u02C6",
              tilde: "\u02DC",
              Alpha: "\u0391",
              Beta: "\u0392",
              Gamma: "\u0393",
              Delta: "\u0394",
              Epsilon: "\u0395",
              Zeta: "\u0396",
              Eta: "\u0397",
              Theta: "\u0398",
              Iota: "\u0399",
              Kappa: "\u039A",
              Lambda: "\u039B",
              Mu: "\u039C",
              Nu: "\u039D",
              Xi: "\u039E",
              Omicron: "\u039F",
              Pi: "\u03A0",
              Rho: "\u03A1",
              Sigma: "\u03A3",
              Tau: "\u03A4",
              Upsilon: "\u03A5",
              Phi: "\u03A6",
              Chi: "\u03A7",
              Psi: "\u03A8",
              Omega: "\u03A9",
              alpha: "\u03B1",
              beta: "\u03B2",
              gamma: "\u03B3",
              delta: "\u03B4",
              epsilon: "\u03B5",
              zeta: "\u03B6",
              eta: "\u03B7",
              theta: "\u03B8",
              iota: "\u03B9",
              kappa: "\u03BA",
              lambda: "\u03BB",
              mu: "\u03BC",
              nu: "\u03BD",
              xi: "\u03BE",
              omicron: "\u03BF",
              pi: "\u03C0",
              rho: "\u03C1",
              sigmaf: "\u03C2",
              sigma: "\u03C3",
              tau: "\u03C4",
              upsilon: "\u03C5",
              phi: "\u03C6",
              chi: "\u03C7",
              psi: "\u03C8",
              omega: "\u03C9",
              thetasym: "\u03D1",
              upsih: "\u03D2",
              piv: "\u03D6",
              ensp: "\u2002",
              emsp: "\u2003",
              thinsp: "\u2009",
              zwnj: "\u200C",
              zwj: "\u200D",
              lrm: "\u200E",
              rlm: "\u200F",
              ndash: "\u2013",
              mdash: "\u2014",
              lsquo: "\u2018",
              rsquo: "\u2019",
              sbquo: "\u201A",
              ldquo: "\u201C",
              rdquo: "\u201D",
              bdquo: "\u201E",
              dagger: "\u2020",
              Dagger: "\u2021",
              bull: "\u2022",
              hellip: "\u2026",
              permil: "\u2030",
              prime: "\u2032",
              Prime: "\u2033",
              lsaquo: "\u2039",
              rsaquo: "\u203A",
              oline: "\u203E",
              frasl: "\u2044",
              euro: "\u20AC",
              image: "\u2111",
              weierp: "\u2118",
              real: "\u211C",
              trade: "\u2122",
              alefsym: "\u2135",
              larr: "\u2190",
              uarr: "\u2191",
              rarr: "\u2192",
              darr: "\u2193",
              harr: "\u2194",
              crarr: "\u21B5",
              lArr: "\u21D0",
              uArr: "\u21D1",
              rArr: "\u21D2",
              dArr: "\u21D3",
              hArr: "\u21D4",
              forall: "\u2200",
              part: "\u2202",
              exist: "\u2203",
              empty: "\u2205",
              nabla: "\u2207",
              isin: "\u2208",
              notin: "\u2209",
              ni: "\u220B",
              prod: "\u220F",
              sum: "\u2211",
              minus: "\u2212",
              lowast: "\u2217",
              radic: "\u221A",
              prop: "\u221D",
              infin: "\u221E",
              ang: "\u2220",
              and: "\u2227",
              or: "\u2228",
              cap: "\u2229",
              cup: "\u222A",
              int: "\u222B",
              there4: "\u2234",
              sim: "\u223C",
              cong: "\u2245",
              asymp: "\u2248",
              ne: "\u2260",
              equiv: "\u2261",
              le: "\u2264",
              ge: "\u2265",
              sub: "\u2282",
              sup: "\u2283",
              nsub: "\u2284",
              sube: "\u2286",
              supe: "\u2287",
              oplus: "\u2295",
              otimes: "\u2297",
              perp: "\u22A5",
              sdot: "\u22C5",
              lceil: "\u2308",
              rceil: "\u2309",
              lfloor: "\u230A",
              rfloor: "\u230B",
              loz: "\u25CA",
              spades: "\u2660",
              clubs: "\u2663",
              hearts: "\u2665",
              diams: "\u2666",
              lang: "\u27E8",
              rang: "\u27E9"
            };
          },
          /* 15 */
          /***/
          function(module3, exports2, __webpack_require__) {
            Object.defineProperty(exports2, "__esModule", { value: true });
            var error_handler_1 = __webpack_require__(10);
            var scanner_1 = __webpack_require__(12);
            var token_1 = __webpack_require__(13);
            var Reader = function() {
              function Reader2() {
                this.values = [];
                this.curly = this.paren = -1;
              }
              __name(Reader2, "Reader");
              Reader2.prototype.beforeFunctionExpression = function(t13) {
                return [
                  "(",
                  "{",
                  "[",
                  "in",
                  "typeof",
                  "instanceof",
                  "new",
                  "return",
                  "case",
                  "delete",
                  "throw",
                  "void",
                  // assignment operators
                  "=",
                  "+=",
                  "-=",
                  "*=",
                  "**=",
                  "/=",
                  "%=",
                  "<<=",
                  ">>=",
                  ">>>=",
                  "&=",
                  "|=",
                  "^=",
                  ",",
                  // binary/unary operators
                  "+",
                  "-",
                  "*",
                  "**",
                  "/",
                  "%",
                  "++",
                  "--",
                  "<<",
                  ">>",
                  ">>>",
                  "&",
                  "|",
                  "^",
                  "!",
                  "~",
                  "&&",
                  "||",
                  "?",
                  ":",
                  "===",
                  "==",
                  ">=",
                  "<=",
                  "<",
                  ">",
                  "!=",
                  "!=="
                ].indexOf(t13) >= 0;
              };
              Reader2.prototype.isRegexStart = function() {
                var previous = this.values[this.values.length - 1];
                var regex2 = previous !== null;
                switch (previous) {
                  case "this":
                  case "]":
                    regex2 = false;
                    break;
                  case ")":
                    var keyword = this.values[this.paren - 1];
                    regex2 = keyword === "if" || keyword === "while" || keyword === "for" || keyword === "with";
                    break;
                  case "}":
                    regex2 = false;
                    if (this.values[this.curly - 3] === "function") {
                      var check = this.values[this.curly - 4];
                      regex2 = check ? !this.beforeFunctionExpression(check) : false;
                    } else if (this.values[this.curly - 4] === "function") {
                      var check = this.values[this.curly - 5];
                      regex2 = check ? !this.beforeFunctionExpression(check) : true;
                    }
                    break;
                }
                return regex2;
              };
              Reader2.prototype.push = function(token) {
                if (token.type === 7 || token.type === 4) {
                  if (token.value === "{") {
                    this.curly = this.values.length;
                  } else if (token.value === "(") {
                    this.paren = this.values.length;
                  }
                  this.values.push(token.value);
                } else {
                  this.values.push(null);
                }
              };
              return Reader2;
            }();
            var Tokenizer = function() {
              function Tokenizer2(code, config) {
                this.errorHandler = new error_handler_1.ErrorHandler();
                this.errorHandler.tolerant = config ? typeof config.tolerant === "boolean" && config.tolerant : false;
                this.scanner = new scanner_1.Scanner(code, this.errorHandler);
                this.scanner.trackComment = config ? typeof config.comment === "boolean" && config.comment : false;
                this.trackRange = config ? typeof config.range === "boolean" && config.range : false;
                this.trackLoc = config ? typeof config.loc === "boolean" && config.loc : false;
                this.buffer = [];
                this.reader = new Reader();
              }
              __name(Tokenizer2, "Tokenizer");
              Tokenizer2.prototype.errors = function() {
                return this.errorHandler.errors;
              };
              Tokenizer2.prototype.getNextToken = function() {
                if (this.buffer.length === 0) {
                  var comments = this.scanner.scanComments();
                  if (this.scanner.trackComment) {
                    for (var i7 = 0; i7 < comments.length; ++i7) {
                      var e10 = comments[i7];
                      var value = this.scanner.source.slice(e10.slice[0], e10.slice[1]);
                      var comment = {
                        type: e10.multiLine ? "BlockComment" : "LineComment",
                        value
                      };
                      if (this.trackRange) {
                        comment.range = e10.range;
                      }
                      if (this.trackLoc) {
                        comment.loc = e10.loc;
                      }
                      this.buffer.push(comment);
                    }
                  }
                  if (!this.scanner.eof()) {
                    var loc = void 0;
                    if (this.trackLoc) {
                      loc = {
                        start: {
                          line: this.scanner.lineNumber,
                          column: this.scanner.index - this.scanner.lineStart
                        },
                        end: {}
                      };
                    }
                    var startRegex = this.scanner.source[this.scanner.index] === "/" && this.reader.isRegexStart();
                    var token = startRegex ? this.scanner.scanRegExp() : this.scanner.lex();
                    this.reader.push(token);
                    var entry = {
                      type: token_1.TokenName[token.type],
                      value: this.scanner.source.slice(token.start, token.end)
                    };
                    if (this.trackRange) {
                      entry.range = [token.start, token.end];
                    }
                    if (this.trackLoc) {
                      loc.end = {
                        line: this.scanner.lineNumber,
                        column: this.scanner.index - this.scanner.lineStart
                      };
                      entry.loc = loc;
                    }
                    if (token.type === 9) {
                      var pattern = token.pattern;
                      var flags2 = token.flags;
                      entry.regex = { pattern, flags: flags2 };
                    }
                    this.buffer.push(entry);
                  }
                }
                return this.buffer.shift();
              };
              return Tokenizer2;
            }();
            exports2.Tokenizer = Tokenizer;
          }
          /******/
        ])
      );
    });
  }
});

// ../../node_modules/.pnpm/recast@0.23.11/node_modules/recast/parsers/esprima.js
var require_esprima3 = __commonJS({
  "../../node_modules/.pnpm/recast@0.23.11/node_modules/recast/parsers/esprima.js"(exports) {
    init_import_meta_url();
    Object.defineProperty(exports, "__esModule", { value: true });
    exports.parse = void 0;
    var util_1 = require_util10();
    function parse17(source, options) {
      var comments = [];
      var ast = require_esprima2().parse(source, {
        loc: true,
        locations: true,
        comment: true,
        onComment: comments,
        range: (0, util_1.getOption)(options, "range", false),
        tolerant: (0, util_1.getOption)(options, "tolerant", true),
        tokens: true,
        jsx: (0, util_1.getOption)(options, "jsx", false),
        sourceType: (0, util_1.getOption)(options, "sourceType", "module")
      });
      if (!Array.isArray(ast.comments)) {
        ast.comments = comments;
      }
      return ast;
    }
    __name(parse17, "parse");
    exports.parse = parse17;
  }
});

// ../../node_modules/.pnpm/recast@0.23.11/node_modules/recast/lib/options.js
var require_options = __commonJS({
  "../../node_modules/.pnpm/recast@0.23.11/node_modules/recast/lib/options.js"(exports) {
    init_import_meta_url();
    Object.defineProperty(exports, "__esModule", { value: true });
    exports.normalize = void 0;
    var util_1 = require_util10();
    var defaults3 = {
      parser: require_esprima3(),
      tabWidth: 4,
      useTabs: false,
      reuseWhitespace: true,
      lineTerminator: (0, util_1.getLineTerminator)(),
      wrapColumn: 74,
      sourceFileName: null,
      sourceMapName: null,
      sourceRoot: null,
      inputSourceMap: null,
      range: false,
      tolerant: true,
      quote: null,
      trailingComma: false,
      arrayBracketSpacing: false,
      objectCurlySpacing: true,
      arrowParensAlways: false,
      flowObjectCommas: true,
      tokens: true
    };
    var hasOwn2 = defaults3.hasOwnProperty;
    function normalize6(opts) {
      var options = opts || defaults3;
      function get2(key) {
        return hasOwn2.call(options, key) ? options[key] : defaults3[key];
      }
      __name(get2, "get");
      return {
        tabWidth: +get2("tabWidth"),
        useTabs: !!get2("useTabs"),
        reuseWhitespace: !!get2("reuseWhitespace"),
        lineTerminator: get2("lineTerminator"),
        wrapColumn: Math.max(get2("wrapColumn"), 0),
        sourceFileName: get2("sourceFileName"),
        sourceMapName: get2("sourceMapName"),
        sourceRoot: get2("sourceRoot"),
        inputSourceMap: get2("inputSourceMap"),
        parser: get2("esprima") || get2("parser"),
        range: get2("range"),
        tolerant: get2("tolerant"),
        quote: get2("quote"),
        trailingComma: get2("trailingComma"),
        arrayBracketSpacing: get2("arrayBracketSpacing"),
        objectCurlySpacing: get2("objectCurlySpacing"),
        arrowParensAlways: get2("arrowParensAlways"),
        flowObjectCommas: get2("flowObjectCommas"),
        tokens: !!get2("tokens")
      };
    }
    __name(normalize6, "normalize");
    exports.normalize = normalize6;
  }
});

// ../../node_modules/.pnpm/recast@0.23.11/node_modules/recast/lib/mapping.js
var require_mapping = __commonJS({
  "../../node_modules/.pnpm/recast@0.23.11/node_modules/recast/lib/mapping.js"(exports) {
    init_import_meta_url();
    Object.defineProperty(exports, "__esModule", { value: true });
    var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
    var tiny_invariant_1 = tslib_1.__importDefault(require_tiny_invariant_cjs());
    var util_1 = require_util10();
    var Mapping = (
      /** @class */
      function() {
        function Mapping2(sourceLines, sourceLoc, targetLoc) {
          if (targetLoc === void 0) {
            targetLoc = sourceLoc;
          }
          this.sourceLines = sourceLines;
          this.sourceLoc = sourceLoc;
          this.targetLoc = targetLoc;
        }
        __name(Mapping2, "Mapping");
        Mapping2.prototype.slice = function(lines, start, end) {
          if (end === void 0) {
            end = lines.lastPos();
          }
          var sourceLines = this.sourceLines;
          var sourceLoc = this.sourceLoc;
          var targetLoc = this.targetLoc;
          function skip(name2) {
            var sourceFromPos = sourceLoc[name2];
            var targetFromPos = targetLoc[name2];
            var targetToPos = start;
            if (name2 === "end") {
              targetToPos = end;
            } else {
              (0, tiny_invariant_1.default)(name2 === "start");
            }
            return skipChars(sourceLines, sourceFromPos, lines, targetFromPos, targetToPos);
          }
          __name(skip, "skip");
          if ((0, util_1.comparePos)(start, targetLoc.start) <= 0) {
            if ((0, util_1.comparePos)(targetLoc.end, end) <= 0) {
              targetLoc = {
                start: subtractPos(targetLoc.start, start.line, start.column),
                end: subtractPos(targetLoc.end, start.line, start.column)
              };
            } else if ((0, util_1.comparePos)(end, targetLoc.start) <= 0) {
              return null;
            } else {
              sourceLoc = {
                start: sourceLoc.start,
                end: skip("end")
              };
              targetLoc = {
                start: subtractPos(targetLoc.start, start.line, start.column),
                end: subtractPos(end, start.line, start.column)
              };
            }
          } else {
            if ((0, util_1.comparePos)(targetLoc.end, start) <= 0) {
              return null;
            }
            if ((0, util_1.comparePos)(targetLoc.end, end) <= 0) {
              sourceLoc = {
                start: skip("start"),
                end: sourceLoc.end
              };
              targetLoc = {
                // Same as subtractPos(start, start.line, start.column):
                start: { line: 1, column: 0 },
                end: subtractPos(targetLoc.end, start.line, start.column)
              };
            } else {
              sourceLoc = {
                start: skip("start"),
                end: skip("end")
              };
              targetLoc = {
                // Same as subtractPos(start, start.line, start.column):
                start: { line: 1, column: 0 },
                end: subtractPos(end, start.line, start.column)
              };
            }
          }
          return new Mapping2(this.sourceLines, sourceLoc, targetLoc);
        };
        Mapping2.prototype.add = function(line, column) {
          return new Mapping2(this.sourceLines, this.sourceLoc, {
            start: addPos(this.targetLoc.start, line, column),
            end: addPos(this.targetLoc.end, line, column)
          });
        };
        Mapping2.prototype.subtract = function(line, column) {
          return new Mapping2(this.sourceLines, this.sourceLoc, {
            start: subtractPos(this.targetLoc.start, line, column),
            end: subtractPos(this.targetLoc.end, line, column)
          });
        };
        Mapping2.prototype.indent = function(by2, skipFirstLine, noNegativeColumns) {
          if (skipFirstLine === void 0) {
            skipFirstLine = false;
          }
          if (noNegativeColumns === void 0) {
            noNegativeColumns = false;
          }
          if (by2 === 0) {
            return this;
          }
          var targetLoc = this.targetLoc;
          var startLine = targetLoc.start.line;
          var endLine = targetLoc.end.line;
          if (skipFirstLine && startLine === 1 && endLine === 1) {
            return this;
          }
          targetLoc = {
            start: targetLoc.start,
            end: targetLoc.end
          };
          if (!skipFirstLine || startLine > 1) {
            var startColumn = targetLoc.start.column + by2;
            targetLoc.start = {
              line: startLine,
              column: noNegativeColumns ? Math.max(0, startColumn) : startColumn
            };
          }
          if (!skipFirstLine || endLine > 1) {
            var endColumn = targetLoc.end.column + by2;
            targetLoc.end = {
              line: endLine,
              column: noNegativeColumns ? Math.max(0, endColumn) : endColumn
            };
          }
          return new Mapping2(this.sourceLines, this.sourceLoc, targetLoc);
        };
        return Mapping2;
      }()
    );
    exports.default = Mapping;
    function addPos(toPos, line, column) {
      return {
        line: toPos.line + line - 1,
        column: toPos.line === 1 ? toPos.column + column : toPos.column
      };
    }
    __name(addPos, "addPos");
    function subtractPos(fromPos, line, column) {
      return {
        line: fromPos.line - line + 1,
        column: fromPos.line === line ? fromPos.column - column : fromPos.column
      };
    }
    __name(subtractPos, "subtractPos");
    function skipChars(sourceLines, sourceFromPos, targetLines, targetFromPos, targetToPos) {
      var targetComparison = (0, util_1.comparePos)(targetFromPos, targetToPos);
      if (targetComparison === 0) {
        return sourceFromPos;
      }
      var sourceCursor, targetCursor;
      if (targetComparison < 0) {
        sourceCursor = sourceLines.skipSpaces(sourceFromPos) || sourceLines.lastPos();
        targetCursor = targetLines.skipSpaces(targetFromPos) || targetLines.lastPos();
        var lineDiff = targetToPos.line - targetCursor.line;
        sourceCursor.line += lineDiff;
        targetCursor.line += lineDiff;
        if (lineDiff > 0) {
          sourceCursor.column = 0;
          targetCursor.column = 0;
        } else {
          (0, tiny_invariant_1.default)(lineDiff === 0);
        }
        while ((0, util_1.comparePos)(targetCursor, targetToPos) < 0 && targetLines.nextPos(targetCursor, true)) {
          (0, tiny_invariant_1.default)(sourceLines.nextPos(sourceCursor, true));
          (0, tiny_invariant_1.default)(sourceLines.charAt(sourceCursor) === targetLines.charAt(targetCursor));
        }
      } else {
        sourceCursor = sourceLines.skipSpaces(sourceFromPos, true) || sourceLines.firstPos();
        targetCursor = targetLines.skipSpaces(targetFromPos, true) || targetLines.firstPos();
        var lineDiff = targetToPos.line - targetCursor.line;
        sourceCursor.line += lineDiff;
        targetCursor.line += lineDiff;
        if (lineDiff < 0) {
          sourceCursor.column = sourceLines.getLineLength(sourceCursor.line);
          targetCursor.column = targetLines.getLineLength(targetCursor.line);
        } else {
          (0, tiny_invariant_1.default)(lineDiff === 0);
        }
        while ((0, util_1.comparePos)(targetToPos, targetCursor) < 0 && targetLines.prevPos(targetCursor, true)) {
          (0, tiny_invariant_1.default)(sourceLines.prevPos(sourceCursor, true));
          (0, tiny_invariant_1.default)(sourceLines.charAt(sourceCursor) === targetLines.charAt(targetCursor));
        }
      }
      return sourceCursor;
    }
    __name(skipChars, "skipChars");
  }
});

// ../../node_modules/.pnpm/recast@0.23.11/node_modules/recast/lib/lines.js
var require_lines3 = __commonJS({
  "../../node_modules/.pnpm/recast@0.23.11/node_modules/recast/lib/lines.js"(exports) {
    init_import_meta_url();
    Object.defineProperty(exports, "__esModule", { value: true });
    exports.concat = exports.fromString = exports.countSpaces = exports.Lines = void 0;
    var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
    var tiny_invariant_1 = tslib_1.__importDefault(require_tiny_invariant_cjs());
    var source_map_1 = tslib_1.__importDefault(require_source_map());
    var options_1 = require_options();
    var util_1 = require_util10();
    var mapping_1 = tslib_1.__importDefault(require_mapping());
    var Lines = (
      /** @class */
      function() {
        function Lines2(infos, sourceFileName) {
          if (sourceFileName === void 0) {
            sourceFileName = null;
          }
          this.infos = infos;
          this.mappings = [];
          this.cachedSourceMap = null;
          this.cachedTabWidth = void 0;
          (0, tiny_invariant_1.default)(infos.length > 0);
          this.length = infos.length;
          this.name = sourceFileName || null;
          if (this.name) {
            this.mappings.push(new mapping_1.default(this, {
              start: this.firstPos(),
              end: this.lastPos()
            }));
          }
        }
        __name(Lines2, "Lines");
        Lines2.prototype.toString = function(options) {
          return this.sliceString(this.firstPos(), this.lastPos(), options);
        };
        Lines2.prototype.getSourceMap = function(sourceMapName, sourceRoot) {
          if (!sourceMapName) {
            return null;
          }
          var targetLines = this;
          function updateJSON(json) {
            json = json || {};
            json.file = sourceMapName;
            if (sourceRoot) {
              json.sourceRoot = sourceRoot;
            }
            return json;
          }
          __name(updateJSON, "updateJSON");
          if (targetLines.cachedSourceMap) {
            return updateJSON(targetLines.cachedSourceMap.toJSON());
          }
          var smg = new source_map_1.default.SourceMapGenerator(updateJSON());
          var sourcesToContents = {};
          targetLines.mappings.forEach(function(mapping) {
            var sourceCursor = mapping.sourceLines.skipSpaces(mapping.sourceLoc.start) || mapping.sourceLines.lastPos();
            var targetCursor = targetLines.skipSpaces(mapping.targetLoc.start) || targetLines.lastPos();
            while ((0, util_1.comparePos)(sourceCursor, mapping.sourceLoc.end) < 0 && (0, util_1.comparePos)(targetCursor, mapping.targetLoc.end) < 0) {
              var sourceChar = mapping.sourceLines.charAt(sourceCursor);
              var targetChar = targetLines.charAt(targetCursor);
              (0, tiny_invariant_1.default)(sourceChar === targetChar);
              var sourceName = mapping.sourceLines.name;
              smg.addMapping({
                source: sourceName,
                original: { line: sourceCursor.line, column: sourceCursor.column },
                generated: { line: targetCursor.line, column: targetCursor.column }
              });
              if (!hasOwn2.call(sourcesToContents, sourceName)) {
                var sourceContent = mapping.sourceLines.toString();
                smg.setSourceContent(sourceName, sourceContent);
                sourcesToContents[sourceName] = sourceContent;
              }
              targetLines.nextPos(targetCursor, true);
              mapping.sourceLines.nextPos(sourceCursor, true);
            }
          });
          targetLines.cachedSourceMap = smg;
          return smg.toJSON();
        };
        Lines2.prototype.bootstrapCharAt = function(pos) {
          (0, tiny_invariant_1.default)(typeof pos === "object");
          (0, tiny_invariant_1.default)(typeof pos.line === "number");
          (0, tiny_invariant_1.default)(typeof pos.column === "number");
          var line = pos.line, column = pos.column, strings = this.toString().split(lineTerminatorSeqExp), string = strings[line - 1];
          if (typeof string === "undefined")
            return "";
          if (column === string.length && line < strings.length)
            return "\n";
          if (column >= string.length)
            return "";
          return string.charAt(column);
        };
        Lines2.prototype.charAt = function(pos) {
          (0, tiny_invariant_1.default)(typeof pos === "object");
          (0, tiny_invariant_1.default)(typeof pos.line === "number");
          (0, tiny_invariant_1.default)(typeof pos.column === "number");
          var line = pos.line, column = pos.column, secret = this, infos = secret.infos, info = infos[line - 1], c8 = column;
          if (typeof info === "undefined" || c8 < 0)
            return "";
          var indent = this.getIndentAt(line);
          if (c8 < indent)
            return " ";
          c8 += info.sliceStart - indent;
          if (c8 === info.sliceEnd && line < this.length)
            return "\n";
          if (c8 >= info.sliceEnd)
            return "";
          return info.line.charAt(c8);
        };
        Lines2.prototype.stripMargin = function(width, skipFirstLine) {
          if (width === 0)
            return this;
          (0, tiny_invariant_1.default)(width > 0, "negative margin: " + width);
          if (skipFirstLine && this.length === 1)
            return this;
          var lines = new Lines2(this.infos.map(function(info, i7) {
            if (info.line && (i7 > 0 || !skipFirstLine)) {
              info = tslib_1.__assign(tslib_1.__assign({}, info), { indent: Math.max(0, info.indent - width) });
            }
            return info;
          }));
          if (this.mappings.length > 0) {
            var newMappings_1 = lines.mappings;
            (0, tiny_invariant_1.default)(newMappings_1.length === 0);
            this.mappings.forEach(function(mapping) {
              newMappings_1.push(mapping.indent(width, skipFirstLine, true));
            });
          }
          return lines;
        };
        Lines2.prototype.indent = function(by2) {
          if (by2 === 0) {
            return this;
          }
          var lines = new Lines2(this.infos.map(function(info) {
            if (info.line && !info.locked) {
              info = tslib_1.__assign(tslib_1.__assign({}, info), { indent: info.indent + by2 });
            }
            return info;
          }));
          if (this.mappings.length > 0) {
            var newMappings_2 = lines.mappings;
            (0, tiny_invariant_1.default)(newMappings_2.length === 0);
            this.mappings.forEach(function(mapping) {
              newMappings_2.push(mapping.indent(by2));
            });
          }
          return lines;
        };
        Lines2.prototype.indentTail = function(by2) {
          if (by2 === 0) {
            return this;
          }
          if (this.length < 2) {
            return this;
          }
          var lines = new Lines2(this.infos.map(function(info, i7) {
            if (i7 > 0 && info.line && !info.locked) {
              info = tslib_1.__assign(tslib_1.__assign({}, info), { indent: info.indent + by2 });
            }
            return info;
          }));
          if (this.mappings.length > 0) {
            var newMappings_3 = lines.mappings;
            (0, tiny_invariant_1.default)(newMappings_3.length === 0);
            this.mappings.forEach(function(mapping) {
              newMappings_3.push(mapping.indent(by2, true));
            });
          }
          return lines;
        };
        Lines2.prototype.lockIndentTail = function() {
          if (this.length < 2) {
            return this;
          }
          return new Lines2(this.infos.map(function(info, i7) {
            return tslib_1.__assign(tslib_1.__assign({}, info), { locked: i7 > 0 });
          }));
        };
        Lines2.prototype.getIndentAt = function(line) {
          (0, tiny_invariant_1.default)(line >= 1, "no line " + line + " (line numbers start from 1)");
          return Math.max(this.infos[line - 1].indent, 0);
        };
        Lines2.prototype.guessTabWidth = function() {
          if (typeof this.cachedTabWidth === "number") {
            return this.cachedTabWidth;
          }
          var counts = [];
          var lastIndent = 0;
          for (var line = 1, last = this.length; line <= last; ++line) {
            var info = this.infos[line - 1];
            var sliced = info.line.slice(info.sliceStart, info.sliceEnd);
            if (isOnlyWhitespace(sliced)) {
              continue;
            }
            var diff = Math.abs(info.indent - lastIndent);
            counts[diff] = ~~counts[diff] + 1;
            lastIndent = info.indent;
          }
          var maxCount = -1;
          var result = 2;
          for (var tabWidth = 1; tabWidth < counts.length; tabWidth += 1) {
            if (hasOwn2.call(counts, tabWidth) && counts[tabWidth] > maxCount) {
              maxCount = counts[tabWidth];
              result = tabWidth;
            }
          }
          return this.cachedTabWidth = result;
        };
        Lines2.prototype.startsWithComment = function() {
          if (this.infos.length === 0) {
            return false;
          }
          var firstLineInfo = this.infos[0], sliceStart = firstLineInfo.sliceStart, sliceEnd = firstLineInfo.sliceEnd, firstLine = firstLineInfo.line.slice(sliceStart, sliceEnd).trim();
          return firstLine.length === 0 || firstLine.slice(0, 2) === "//" || firstLine.slice(0, 2) === "/*";
        };
        Lines2.prototype.isOnlyWhitespace = function() {
          return isOnlyWhitespace(this.toString());
        };
        Lines2.prototype.isPrecededOnlyByWhitespace = function(pos) {
          var info = this.infos[pos.line - 1];
          var indent = Math.max(info.indent, 0);
          var diff = pos.column - indent;
          if (diff <= 0) {
            return true;
          }
          var start = info.sliceStart;
          var end = Math.min(start + diff, info.sliceEnd);
          var prefix = info.line.slice(start, end);
          return isOnlyWhitespace(prefix);
        };
        Lines2.prototype.getLineLength = function(line) {
          var info = this.infos[line - 1];
          return this.getIndentAt(line) + info.sliceEnd - info.sliceStart;
        };
        Lines2.prototype.nextPos = function(pos, skipSpaces) {
          if (skipSpaces === void 0) {
            skipSpaces = false;
          }
          var l8 = Math.max(pos.line, 0), c8 = Math.max(pos.column, 0);
          if (c8 < this.getLineLength(l8)) {
            pos.column += 1;
            return skipSpaces ? !!this.skipSpaces(pos, false, true) : true;
          }
          if (l8 < this.length) {
            pos.line += 1;
            pos.column = 0;
            return skipSpaces ? !!this.skipSpaces(pos, false, true) : true;
          }
          return false;
        };
        Lines2.prototype.prevPos = function(pos, skipSpaces) {
          if (skipSpaces === void 0) {
            skipSpaces = false;
          }
          var l8 = pos.line, c8 = pos.column;
          if (c8 < 1) {
            l8 -= 1;
            if (l8 < 1)
              return false;
            c8 = this.getLineLength(l8);
          } else {
            c8 = Math.min(c8 - 1, this.getLineLength(l8));
          }
          pos.line = l8;
          pos.column = c8;
          return skipSpaces ? !!this.skipSpaces(pos, true, true) : true;
        };
        Lines2.prototype.firstPos = function() {
          return { line: 1, column: 0 };
        };
        Lines2.prototype.lastPos = function() {
          return {
            line: this.length,
            column: this.getLineLength(this.length)
          };
        };
        Lines2.prototype.skipSpaces = function(pos, backward, modifyInPlace) {
          if (backward === void 0) {
            backward = false;
          }
          if (modifyInPlace === void 0) {
            modifyInPlace = false;
          }
          if (pos) {
            pos = modifyInPlace ? pos : {
              line: pos.line,
              column: pos.column
            };
          } else if (backward) {
            pos = this.lastPos();
          } else {
            pos = this.firstPos();
          }
          if (backward) {
            while (this.prevPos(pos)) {
              if (!isOnlyWhitespace(this.charAt(pos)) && this.nextPos(pos)) {
                return pos;
              }
            }
            return null;
          } else {
            while (isOnlyWhitespace(this.charAt(pos))) {
              if (!this.nextPos(pos)) {
                return null;
              }
            }
            return pos;
          }
        };
        Lines2.prototype.trimLeft = function() {
          var pos = this.skipSpaces(this.firstPos(), false, true);
          return pos ? this.slice(pos) : emptyLines;
        };
        Lines2.prototype.trimRight = function() {
          var pos = this.skipSpaces(this.lastPos(), true, true);
          return pos ? this.slice(this.firstPos(), pos) : emptyLines;
        };
        Lines2.prototype.trim = function() {
          var start = this.skipSpaces(this.firstPos(), false, true);
          if (start === null) {
            return emptyLines;
          }
          var end = this.skipSpaces(this.lastPos(), true, true);
          if (end === null) {
            return emptyLines;
          }
          return this.slice(start, end);
        };
        Lines2.prototype.eachPos = function(callback, startPos, skipSpaces) {
          if (startPos === void 0) {
            startPos = this.firstPos();
          }
          if (skipSpaces === void 0) {
            skipSpaces = false;
          }
          var pos = this.firstPos();
          if (startPos) {
            pos.line = startPos.line, pos.column = startPos.column;
          }
          if (skipSpaces && !this.skipSpaces(pos, false, true)) {
            return;
          }
          do
            callback.call(this, pos);
          while (this.nextPos(pos, skipSpaces));
        };
        Lines2.prototype.bootstrapSlice = function(start, end) {
          var strings = this.toString().split(lineTerminatorSeqExp).slice(start.line - 1, end.line);
          if (strings.length > 0) {
            strings.push(strings.pop().slice(0, end.column));
            strings[0] = strings[0].slice(start.column);
          }
          return fromString3(strings.join("\n"));
        };
        Lines2.prototype.slice = function(start, end) {
          if (!end) {
            if (!start) {
              return this;
            }
            end = this.lastPos();
          }
          if (!start) {
            throw new Error("cannot slice with end but not start");
          }
          var sliced = this.infos.slice(start.line - 1, end.line);
          if (start.line === end.line) {
            sliced[0] = sliceInfo(sliced[0], start.column, end.column);
          } else {
            (0, tiny_invariant_1.default)(start.line < end.line);
            sliced[0] = sliceInfo(sliced[0], start.column);
            sliced.push(sliceInfo(sliced.pop(), 0, end.column));
          }
          var lines = new Lines2(sliced);
          if (this.mappings.length > 0) {
            var newMappings_4 = lines.mappings;
            (0, tiny_invariant_1.default)(newMappings_4.length === 0);
            this.mappings.forEach(function(mapping) {
              var sliced2 = mapping.slice(this, start, end);
              if (sliced2) {
                newMappings_4.push(sliced2);
              }
            }, this);
          }
          return lines;
        };
        Lines2.prototype.bootstrapSliceString = function(start, end, options) {
          return this.slice(start, end).toString(options);
        };
        Lines2.prototype.sliceString = function(start, end, options) {
          if (start === void 0) {
            start = this.firstPos();
          }
          if (end === void 0) {
            end = this.lastPos();
          }
          var _a5 = (0, options_1.normalize)(options), tabWidth = _a5.tabWidth, useTabs = _a5.useTabs, reuseWhitespace = _a5.reuseWhitespace, lineTerminator = _a5.lineTerminator;
          var parts = [];
          for (var line = start.line; line <= end.line; ++line) {
            var info = this.infos[line - 1];
            if (line === start.line) {
              if (line === end.line) {
                info = sliceInfo(info, start.column, end.column);
              } else {
                info = sliceInfo(info, start.column);
              }
            } else if (line === end.line) {
              info = sliceInfo(info, 0, end.column);
            }
            var indent = Math.max(info.indent, 0);
            var before_1 = info.line.slice(0, info.sliceStart);
            if (reuseWhitespace && isOnlyWhitespace(before_1) && countSpaces(before_1, tabWidth) === indent) {
              parts.push(info.line.slice(0, info.sliceEnd));
              continue;
            }
            var tabs = 0;
            var spaces = indent;
            if (useTabs) {
              tabs = Math.floor(indent / tabWidth);
              spaces -= tabs * tabWidth;
            }
            var result = "";
            if (tabs > 0) {
              result += new Array(tabs + 1).join("	");
            }
            if (spaces > 0) {
              result += new Array(spaces + 1).join(" ");
            }
            result += info.line.slice(info.sliceStart, info.sliceEnd);
            parts.push(result);
          }
          return parts.join(lineTerminator);
        };
        Lines2.prototype.isEmpty = function() {
          return this.length < 2 && this.getLineLength(1) < 1;
        };
        Lines2.prototype.join = function(elements) {
          var separator = this;
          var infos = [];
          var mappings = [];
          var prevInfo;
          function appendLines(linesOrNull) {
            if (linesOrNull === null) {
              return;
            }
            if (prevInfo) {
              var info = linesOrNull.infos[0];
              var indent = new Array(info.indent + 1).join(" ");
              var prevLine_1 = infos.length;
              var prevColumn_1 = Math.max(prevInfo.indent, 0) + prevInfo.sliceEnd - prevInfo.sliceStart;
              prevInfo.line = prevInfo.line.slice(0, prevInfo.sliceEnd) + indent + info.line.slice(info.sliceStart, info.sliceEnd);
              prevInfo.locked = prevInfo.locked || info.locked;
              prevInfo.sliceEnd = prevInfo.line.length;
              if (linesOrNull.mappings.length > 0) {
                linesOrNull.mappings.forEach(function(mapping) {
                  mappings.push(mapping.add(prevLine_1, prevColumn_1));
                });
              }
            } else if (linesOrNull.mappings.length > 0) {
              mappings.push.apply(mappings, linesOrNull.mappings);
            }
            linesOrNull.infos.forEach(function(info2, i7) {
              if (!prevInfo || i7 > 0) {
                prevInfo = tslib_1.__assign({}, info2);
                infos.push(prevInfo);
              }
            });
          }
          __name(appendLines, "appendLines");
          function appendWithSeparator(linesOrNull, i7) {
            if (i7 > 0)
              appendLines(separator);
            appendLines(linesOrNull);
          }
          __name(appendWithSeparator, "appendWithSeparator");
          elements.map(function(elem) {
            var lines2 = fromString3(elem);
            if (lines2.isEmpty())
              return null;
            return lines2;
          }).forEach(function(linesOrNull, i7) {
            if (separator.isEmpty()) {
              appendLines(linesOrNull);
            } else {
              appendWithSeparator(linesOrNull, i7);
            }
          });
          if (infos.length < 1)
            return emptyLines;
          var lines = new Lines2(infos);
          lines.mappings = mappings;
          return lines;
        };
        Lines2.prototype.concat = function() {
          var args = [];
          for (var _i2 = 0; _i2 < arguments.length; _i2++) {
            args[_i2] = arguments[_i2];
          }
          var list = [this];
          list.push.apply(list, args);
          (0, tiny_invariant_1.default)(list.length === args.length + 1);
          return emptyLines.join(list);
        };
        return Lines2;
      }()
    );
    exports.Lines = Lines;
    var fromStringCache = {};
    var hasOwn2 = fromStringCache.hasOwnProperty;
    var maxCacheKeyLen = 10;
    function countSpaces(spaces, tabWidth) {
      var count = 0;
      var len = spaces.length;
      for (var i7 = 0; i7 < len; ++i7) {
        switch (spaces.charCodeAt(i7)) {
          case 9: {
            (0, tiny_invariant_1.default)(typeof tabWidth === "number");
            (0, tiny_invariant_1.default)(tabWidth > 0);
            var next = Math.ceil(count / tabWidth) * tabWidth;
            if (next === count) {
              count += tabWidth;
            } else {
              count = next;
            }
            break;
          }
          case 11:
          // '\v'
          case 12:
          // '\f'
          case 13:
          // '\r'
          case 65279:
            break;
          case 32:
          // ' '
          default:
            count += 1;
            break;
        }
      }
      return count;
    }
    __name(countSpaces, "countSpaces");
    exports.countSpaces = countSpaces;
    var leadingSpaceExp = /^\s*/;
    var lineTerminatorSeqExp = /\u000D\u000A|\u000D(?!\u000A)|\u000A|\u2028|\u2029/;
    function fromString3(string, options) {
      if (string instanceof Lines)
        return string;
      string += "";
      var tabWidth = options && options.tabWidth;
      var tabless = string.indexOf("	") < 0;
      var cacheable = !options && tabless && string.length <= maxCacheKeyLen;
      (0, tiny_invariant_1.default)(tabWidth || tabless, "No tab width specified but encountered tabs in string\n" + string);
      if (cacheable && hasOwn2.call(fromStringCache, string))
        return fromStringCache[string];
      var lines = new Lines(string.split(lineTerminatorSeqExp).map(function(line) {
        var spaces = leadingSpaceExp.exec(line)[0];
        return {
          line,
          indent: countSpaces(spaces, tabWidth),
          // Boolean indicating whether this line can be reindented.
          locked: false,
          sliceStart: spaces.length,
          sliceEnd: line.length
        };
      }), (0, options_1.normalize)(options).sourceFileName);
      if (cacheable)
        fromStringCache[string] = lines;
      return lines;
    }
    __name(fromString3, "fromString");
    exports.fromString = fromString3;
    function isOnlyWhitespace(string) {
      return !/\S/.test(string);
    }
    __name(isOnlyWhitespace, "isOnlyWhitespace");
    function sliceInfo(info, startCol, endCol) {
      var sliceStart = info.sliceStart;
      var sliceEnd = info.sliceEnd;
      var indent = Math.max(info.indent, 0);
      var lineLength = indent + sliceEnd - sliceStart;
      if (typeof endCol === "undefined") {
        endCol = lineLength;
      }
      startCol = Math.max(startCol, 0);
      endCol = Math.min(endCol, lineLength);
      endCol = Math.max(endCol, startCol);
      if (endCol < indent) {
        indent = endCol;
        sliceEnd = sliceStart;
      } else {
        sliceEnd -= lineLength - endCol;
      }
      lineLength = endCol;
      lineLength -= startCol;
      if (startCol < indent) {
        indent -= startCol;
      } else {
        startCol -= indent;
        indent = 0;
        sliceStart += startCol;
      }
      (0, tiny_invariant_1.default)(indent >= 0);
      (0, tiny_invariant_1.default)(sliceStart <= sliceEnd);
      (0, tiny_invariant_1.default)(lineLength === indent + sliceEnd - sliceStart);
      if (info.indent === indent && info.sliceStart === sliceStart && info.sliceEnd === sliceEnd) {
        return info;
      }
      return {
        line: info.line,
        indent,
        // A destructive slice always unlocks indentation.
        locked: false,
        sliceStart,
        sliceEnd
      };
    }
    __name(sliceInfo, "sliceInfo");
    function concat(elements) {
      return emptyLines.join(elements);
    }
    __name(concat, "concat");
    exports.concat = concat;
    var emptyLines = fromString3("");
  }
});

// ../../node_modules/.pnpm/recast@0.23.11/node_modules/recast/lib/comments.js
var require_comments = __commonJS({
  "../../node_modules/.pnpm/recast@0.23.11/node_modules/recast/lib/comments.js"(exports) {
    init_import_meta_url();
    Object.defineProperty(exports, "__esModule", { value: true });
    exports.printComments = exports.attach = void 0;
    var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
    var tiny_invariant_1 = tslib_1.__importDefault(require_tiny_invariant_cjs());
    var types13 = tslib_1.__importStar(require_main3());
    var n9 = types13.namedTypes;
    var isArray = types13.builtInTypes.array;
    var isObject5 = types13.builtInTypes.object;
    var lines_1 = require_lines3();
    var util_1 = require_util10();
    var childNodesCache = /* @__PURE__ */ new WeakMap();
    function getSortedChildNodes(node2, lines, resultArray) {
      if (!node2) {
        return resultArray;
      }
      (0, util_1.fixFaultyLocations)(node2, lines);
      if (resultArray) {
        if (n9.Node.check(node2) && n9.SourceLocation.check(node2.loc)) {
          var i7 = resultArray.length - 1;
          for (; i7 >= 0; --i7) {
            var child = resultArray[i7];
            if (child && child.loc && (0, util_1.comparePos)(child.loc.end, node2.loc.start) <= 0) {
              break;
            }
          }
          resultArray.splice(i7 + 1, 0, node2);
          return resultArray;
        }
      } else {
        var childNodes = childNodesCache.get(node2);
        if (childNodes) {
          return childNodes;
        }
      }
      var names;
      if (isArray.check(node2)) {
        names = Object.keys(node2);
      } else if (isObject5.check(node2)) {
        names = types13.getFieldNames(node2);
      } else {
        return resultArray;
      }
      if (!resultArray) {
        childNodesCache.set(node2, resultArray = []);
      }
      for (var i7 = 0, nameCount = names.length; i7 < nameCount; ++i7) {
        getSortedChildNodes(node2[names[i7]], lines, resultArray);
      }
      return resultArray;
    }
    __name(getSortedChildNodes, "getSortedChildNodes");
    function decorateComment(node2, comment, lines) {
      var childNodes = getSortedChildNodes(node2, lines);
      var left2 = 0;
      var right2 = childNodes && childNodes.length;
      var precedingNode;
      var followingNode;
      while (typeof right2 === "number" && left2 < right2) {
        var middle = left2 + right2 >> 1;
        var child = childNodes[middle];
        if ((0, util_1.comparePos)(child.loc.start, comment.loc.start) <= 0 && (0, util_1.comparePos)(comment.loc.end, child.loc.end) <= 0) {
          decorateComment(comment.enclosingNode = child, comment, lines);
          return;
        }
        if ((0, util_1.comparePos)(child.loc.end, comment.loc.start) <= 0) {
          precedingNode = child;
          left2 = middle + 1;
          continue;
        }
        if ((0, util_1.comparePos)(comment.loc.end, child.loc.start) <= 0) {
          followingNode = child;
          right2 = middle;
          continue;
        }
        throw new Error("Comment location overlaps with node location");
      }
      if (precedingNode) {
        comment.precedingNode = precedingNode;
      }
      if (followingNode) {
        comment.followingNode = followingNode;
      }
    }
    __name(decorateComment, "decorateComment");
    function attach(comments, ast, lines) {
      if (!isArray.check(comments)) {
        return;
      }
      var tiesToBreak = [];
      comments.forEach(function(comment) {
        comment.loc.lines = lines;
        decorateComment(ast, comment, lines);
        var pn = comment.precedingNode;
        var en = comment.enclosingNode;
        var fn2 = comment.followingNode;
        if (pn && fn2) {
          var tieCount = tiesToBreak.length;
          if (tieCount > 0) {
            var lastTie = tiesToBreak[tieCount - 1];
            (0, tiny_invariant_1.default)(lastTie.precedingNode === comment.precedingNode === (lastTie.followingNode === comment.followingNode));
            if (lastTie.followingNode !== comment.followingNode) {
              breakTies(tiesToBreak, lines);
            }
          }
          tiesToBreak.push(comment);
        } else if (pn) {
          breakTies(tiesToBreak, lines);
          addTrailingComment(pn, comment);
        } else if (fn2) {
          breakTies(tiesToBreak, lines);
          addLeadingComment(fn2, comment);
        } else if (en) {
          breakTies(tiesToBreak, lines);
          addDanglingComment(en, comment);
        } else {
          throw new Error("AST contains no nodes at all?");
        }
      });
      breakTies(tiesToBreak, lines);
      comments.forEach(function(comment) {
        delete comment.precedingNode;
        delete comment.enclosingNode;
        delete comment.followingNode;
      });
    }
    __name(attach, "attach");
    exports.attach = attach;
    function breakTies(tiesToBreak, lines) {
      var tieCount = tiesToBreak.length;
      if (tieCount === 0) {
        return;
      }
      var pn = tiesToBreak[0].precedingNode;
      var fn2 = tiesToBreak[0].followingNode;
      var gapEndPos = fn2.loc.start;
      var indexOfFirstLeadingComment = tieCount;
      var comment;
      for (; indexOfFirstLeadingComment > 0; --indexOfFirstLeadingComment) {
        comment = tiesToBreak[indexOfFirstLeadingComment - 1];
        (0, tiny_invariant_1.default)(comment.precedingNode === pn);
        (0, tiny_invariant_1.default)(comment.followingNode === fn2);
        var gap = lines.sliceString(comment.loc.end, gapEndPos);
        if (/\S/.test(gap)) {
          break;
        }
        gapEndPos = comment.loc.start;
      }
      while (indexOfFirstLeadingComment <= tieCount && (comment = tiesToBreak[indexOfFirstLeadingComment]) && // If the comment is a //-style comment and indented more
      // deeply than the node itself, reconsider it as trailing.
      (comment.type === "Line" || comment.type === "CommentLine") && comment.loc.start.column > fn2.loc.start.column) {
        ++indexOfFirstLeadingComment;
      }
      if (indexOfFirstLeadingComment) {
        var enclosingNode = tiesToBreak[indexOfFirstLeadingComment - 1].enclosingNode;
        if ((enclosingNode === null || enclosingNode === void 0 ? void 0 : enclosingNode.type) === "CallExpression") {
          --indexOfFirstLeadingComment;
        }
      }
      tiesToBreak.forEach(function(comment2, i7) {
        if (i7 < indexOfFirstLeadingComment) {
          addTrailingComment(pn, comment2);
        } else {
          addLeadingComment(fn2, comment2);
        }
      });
      tiesToBreak.length = 0;
    }
    __name(breakTies, "breakTies");
    function addCommentHelper(node2, comment) {
      var comments = node2.comments || (node2.comments = []);
      comments.push(comment);
    }
    __name(addCommentHelper, "addCommentHelper");
    function addLeadingComment(node2, comment) {
      comment.leading = true;
      comment.trailing = false;
      addCommentHelper(node2, comment);
    }
    __name(addLeadingComment, "addLeadingComment");
    function addDanglingComment(node2, comment) {
      comment.leading = false;
      comment.trailing = false;
      addCommentHelper(node2, comment);
    }
    __name(addDanglingComment, "addDanglingComment");
    function addTrailingComment(node2, comment) {
      comment.leading = false;
      comment.trailing = true;
      addCommentHelper(node2, comment);
    }
    __name(addTrailingComment, "addTrailingComment");
    function printLeadingComment(commentPath, print2) {
      var comment = commentPath.getValue();
      n9.Comment.assert(comment);
      var loc = comment.loc;
      var lines = loc && loc.lines;
      var parts = [print2(commentPath)];
      if (comment.trailing) {
        parts.push("\n");
      } else if (lines instanceof lines_1.Lines) {
        var trailingSpace = lines.slice(loc.end, lines.skipSpaces(loc.end) || lines.lastPos());
        if (trailingSpace.length === 1) {
          parts.push(trailingSpace);
        } else {
          parts.push(new Array(trailingSpace.length).join("\n"));
        }
      } else {
        parts.push("\n");
      }
      return (0, lines_1.concat)(parts);
    }
    __name(printLeadingComment, "printLeadingComment");
    function printTrailingComment(commentPath, print2) {
      var comment = commentPath.getValue(commentPath);
      n9.Comment.assert(comment);
      var loc = comment.loc;
      var lines = loc && loc.lines;
      var parts = [];
      if (lines instanceof lines_1.Lines) {
        var fromPos = lines.skipSpaces(loc.start, true) || lines.firstPos();
        var leadingSpace = lines.slice(fromPos, loc.start);
        if (leadingSpace.length === 1) {
          parts.push(leadingSpace);
        } else {
          parts.push(new Array(leadingSpace.length).join("\n"));
        }
      }
      parts.push(print2(commentPath));
      return (0, lines_1.concat)(parts);
    }
    __name(printTrailingComment, "printTrailingComment");
    function printComments(path84, print2) {
      var value = path84.getValue();
      var innerLines = print2(path84);
      var comments = n9.Node.check(value) && types13.getFieldValue(value, "comments");
      if (!comments || comments.length === 0) {
        return innerLines;
      }
      var leadingParts = [];
      var trailingParts = [innerLines];
      path84.each(function(commentPath) {
        var comment = commentPath.getValue();
        var leading = types13.getFieldValue(comment, "leading");
        var trailing = types13.getFieldValue(comment, "trailing");
        if (leading || trailing && !(n9.Statement.check(value) || comment.type === "Block" || comment.type === "CommentBlock")) {
          leadingParts.push(printLeadingComment(commentPath, print2));
        } else if (trailing) {
          trailingParts.push(printTrailingComment(commentPath, print2));
        }
      }, "comments");
      leadingParts.push.apply(leadingParts, trailingParts);
      return (0, lines_1.concat)(leadingParts);
    }
    __name(printComments, "printComments");
    exports.printComments = printComments;
  }
});

// ../../node_modules/.pnpm/recast@0.23.11/node_modules/recast/lib/parser.js
var require_parser2 = __commonJS({
  "../../node_modules/.pnpm/recast@0.23.11/node_modules/recast/lib/parser.js"(exports) {
    init_import_meta_url();
    Object.defineProperty(exports, "__esModule", { value: true });
    exports.parse = void 0;
    var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
    var tiny_invariant_1 = tslib_1.__importDefault(require_tiny_invariant_cjs());
    var types13 = tslib_1.__importStar(require_main3());
    var b11 = types13.builders;
    var isObject5 = types13.builtInTypes.object;
    var isArray = types13.builtInTypes.array;
    var options_1 = require_options();
    var lines_1 = require_lines3();
    var comments_1 = require_comments();
    var util5 = tslib_1.__importStar(require_util10());
    function parse17(source, options) {
      options = (0, options_1.normalize)(options);
      var lines = (0, lines_1.fromString)(source, options);
      var sourceWithoutTabs = lines.toString({
        tabWidth: options.tabWidth,
        reuseWhitespace: false,
        useTabs: false
      });
      var comments = [];
      var ast = options.parser.parse(sourceWithoutTabs, {
        jsx: true,
        loc: true,
        locations: true,
        range: options.range,
        comment: true,
        onComment: comments,
        tolerant: util5.getOption(options, "tolerant", true),
        ecmaVersion: 6,
        sourceType: util5.getOption(options, "sourceType", "module")
      });
      var tokens = Array.isArray(ast.tokens) ? ast.tokens : require_esprima2().tokenize(sourceWithoutTabs, {
        loc: true
      });
      delete ast.tokens;
      tokens.forEach(function(token) {
        if (typeof token.value !== "string") {
          token.value = lines.sliceString(token.loc.start, token.loc.end);
        }
      });
      if (Array.isArray(ast.comments)) {
        comments = ast.comments;
        delete ast.comments;
      }
      if (ast.loc) {
        util5.fixFaultyLocations(ast, lines);
      } else {
        ast.loc = {
          start: lines.firstPos(),
          end: lines.lastPos()
        };
      }
      ast.loc.lines = lines;
      ast.loc.indent = 0;
      var file3;
      var program;
      if (ast.type === "Program") {
        program = ast;
        file3 = b11.file(ast, options.sourceFileName || null);
        file3.loc = {
          start: lines.firstPos(),
          end: lines.lastPos(),
          lines,
          indent: 0
        };
      } else if (ast.type === "File") {
        file3 = ast;
        program = file3.program;
      }
      if (options.tokens) {
        file3.tokens = tokens;
      }
      var trueProgramLoc = util5.getTrueLoc({
        type: program.type,
        loc: program.loc,
        body: [],
        comments
      }, lines);
      program.loc.start = trueProgramLoc.start;
      program.loc.end = trueProgramLoc.end;
      (0, comments_1.attach)(comments, program.body.length ? file3.program : file3, lines);
      return new TreeCopier(lines, tokens).copy(file3);
    }
    __name(parse17, "parse");
    exports.parse = parse17;
    var TreeCopier = /* @__PURE__ */ __name(function TreeCopier2(lines, tokens) {
      (0, tiny_invariant_1.default)(this instanceof TreeCopier2);
      this.lines = lines;
      this.tokens = tokens;
      this.startTokenIndex = 0;
      this.endTokenIndex = tokens.length;
      this.indent = 0;
      this.seen = /* @__PURE__ */ new Map();
    }, "TreeCopier");
    var TCp = TreeCopier.prototype;
    TCp.copy = function(node2) {
      if (this.seen.has(node2)) {
        return this.seen.get(node2);
      }
      if (isArray.check(node2)) {
        var copy_1 = new Array(node2.length);
        this.seen.set(node2, copy_1);
        node2.forEach(function(item, i8) {
          copy_1[i8] = this.copy(item);
        }, this);
        return copy_1;
      }
      if (!isObject5.check(node2)) {
        return node2;
      }
      util5.fixFaultyLocations(node2, this.lines);
      var copy = Object.create(Object.getPrototypeOf(node2), {
        original: {
          // Provide a link from the copy to the original.
          value: node2,
          configurable: false,
          enumerable: false,
          writable: true
        }
      });
      this.seen.set(node2, copy);
      var loc = node2.loc;
      var oldIndent = this.indent;
      var newIndent = oldIndent;
      var oldStartTokenIndex = this.startTokenIndex;
      var oldEndTokenIndex = this.endTokenIndex;
      if (loc) {
        if (node2.type === "Block" || node2.type === "Line" || node2.type === "CommentBlock" || node2.type === "CommentLine" || this.lines.isPrecededOnlyByWhitespace(loc.start)) {
          newIndent = this.indent = loc.start.column;
        }
        loc.lines = this.lines;
        loc.tokens = this.tokens;
        loc.indent = newIndent;
        this.findTokenRange(loc);
      }
      var keys = Object.keys(node2);
      var keyCount = keys.length;
      for (var i7 = 0; i7 < keyCount; ++i7) {
        var key = keys[i7];
        if (key === "loc") {
          copy[key] = node2[key];
        } else if (key === "tokens" && node2.type === "File") {
          copy[key] = node2[key];
        } else {
          copy[key] = this.copy(node2[key]);
        }
      }
      this.indent = oldIndent;
      this.startTokenIndex = oldStartTokenIndex;
      this.endTokenIndex = oldEndTokenIndex;
      return copy;
    };
    TCp.findTokenRange = function(loc) {
      while (this.startTokenIndex > 0) {
        var token = loc.tokens[this.startTokenIndex];
        if (util5.comparePos(loc.start, token.loc.start) < 0) {
          --this.startTokenIndex;
        } else
          break;
      }
      while (this.endTokenIndex < loc.tokens.length) {
        var token = loc.tokens[this.endTokenIndex];
        if (util5.comparePos(token.loc.end, loc.end) < 0) {
          ++this.endTokenIndex;
        } else
          break;
      }
      while (this.startTokenIndex < this.endTokenIndex) {
        var token = loc.tokens[this.startTokenIndex];
        if (util5.comparePos(token.loc.start, loc.start) < 0) {
          ++this.startTokenIndex;
        } else
          break;
      }
      loc.start.token = this.startTokenIndex;
      while (this.endTokenIndex > this.startTokenIndex) {
        var token = loc.tokens[this.endTokenIndex - 1];
        if (util5.comparePos(loc.end, token.loc.end) < 0) {
          --this.endTokenIndex;
        } else
          break;
      }
      loc.end.token = this.endTokenIndex;
    };
  }
});

// ../../node_modules/.pnpm/recast@0.23.11/node_modules/recast/lib/fast-path.js
var require_fast_path = __commonJS({
  "../../node_modules/.pnpm/recast@0.23.11/node_modules/recast/lib/fast-path.js"(exports) {
    init_import_meta_url();
    Object.defineProperty(exports, "__esModule", { value: true });
    var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
    var tiny_invariant_1 = tslib_1.__importDefault(require_tiny_invariant_cjs());
    var types13 = tslib_1.__importStar(require_main3());
    var util5 = tslib_1.__importStar(require_util10());
    var n9 = types13.namedTypes;
    var isArray = types13.builtInTypes.array;
    var isNumber = types13.builtInTypes.number;
    var PRECEDENCE = {};
    [
      ["??"],
      ["||"],
      ["&&"],
      ["|"],
      ["^"],
      ["&"],
      ["==", "===", "!=", "!=="],
      ["<", ">", "<=", ">=", "in", "instanceof"],
      [">>", "<<", ">>>"],
      ["+", "-"],
      ["*", "/", "%"],
      ["**"]
    ].forEach(function(tier, i7) {
      tier.forEach(function(op) {
        PRECEDENCE[op] = i7;
      });
    });
    var FastPath = /* @__PURE__ */ __name(function FastPath2(value) {
      (0, tiny_invariant_1.default)(this instanceof FastPath2);
      this.stack = [value];
    }, "FastPath");
    var FPp = FastPath.prototype;
    FastPath.from = function(obj) {
      if (obj instanceof FastPath) {
        return obj.copy();
      }
      if (obj instanceof types13.NodePath) {
        var copy = Object.create(FastPath.prototype);
        var stack = [obj.value];
        for (var pp = void 0; pp = obj.parentPath; obj = pp)
          stack.push(obj.name, pp.value);
        copy.stack = stack.reverse();
        return copy;
      }
      return new FastPath(obj);
    };
    FPp.copy = /* @__PURE__ */ __name(function copy() {
      var copy2 = Object.create(FastPath.prototype);
      copy2.stack = this.stack.slice(0);
      return copy2;
    }, "copy");
    FPp.getName = /* @__PURE__ */ __name(function getName4() {
      var s7 = this.stack;
      var len = s7.length;
      if (len > 1) {
        return s7[len - 2];
      }
      return null;
    }, "getName");
    FPp.getValue = /* @__PURE__ */ __name(function getValue() {
      var s7 = this.stack;
      return s7[s7.length - 1];
    }, "getValue");
    FPp.valueIsDuplicate = function() {
      var s7 = this.stack;
      var valueIndex = s7.length - 1;
      return s7.lastIndexOf(s7[valueIndex], valueIndex - 1) >= 0;
    };
    function getNodeHelper(path84, count) {
      var s7 = path84.stack;
      for (var i7 = s7.length - 1; i7 >= 0; i7 -= 2) {
        var value = s7[i7];
        if (n9.Node.check(value) && --count < 0) {
          return value;
        }
      }
      return null;
    }
    __name(getNodeHelper, "getNodeHelper");
    FPp.getNode = /* @__PURE__ */ __name(function getNode(count) {
      if (count === void 0) {
        count = 0;
      }
      return getNodeHelper(this, ~~count);
    }, "getNode");
    FPp.getParentNode = /* @__PURE__ */ __name(function getParentNode(count) {
      if (count === void 0) {
        count = 0;
      }
      return getNodeHelper(this, ~~count + 1);
    }, "getParentNode");
    FPp.getRootValue = /* @__PURE__ */ __name(function getRootValue() {
      var s7 = this.stack;
      if (s7.length % 2 === 0) {
        return s7[1];
      }
      return s7[0];
    }, "getRootValue");
    FPp.call = /* @__PURE__ */ __name(function call(callback) {
      var s7 = this.stack;
      var origLen = s7.length;
      var value = s7[origLen - 1];
      var argc = arguments.length;
      for (var i7 = 1; i7 < argc; ++i7) {
        var name2 = arguments[i7];
        value = value[name2];
        s7.push(name2, value);
      }
      var result = callback(this);
      s7.length = origLen;
      return result;
    }, "call");
    FPp.each = /* @__PURE__ */ __name(function each(callback) {
      var s7 = this.stack;
      var origLen = s7.length;
      var value = s7[origLen - 1];
      var argc = arguments.length;
      for (var i7 = 1; i7 < argc; ++i7) {
        var name2 = arguments[i7];
        value = value[name2];
        s7.push(name2, value);
      }
      for (var i7 = 0; i7 < value.length; ++i7) {
        if (i7 in value) {
          s7.push(i7, value[i7]);
          callback(this);
          s7.length -= 2;
        }
      }
      s7.length = origLen;
    }, "each");
    FPp.map = /* @__PURE__ */ __name(function map2(callback) {
      var s7 = this.stack;
      var origLen = s7.length;
      var value = s7[origLen - 1];
      var argc = arguments.length;
      for (var i7 = 1; i7 < argc; ++i7) {
        var name2 = arguments[i7];
        value = value[name2];
        s7.push(name2, value);
      }
      var result = new Array(value.length);
      for (var i7 = 0; i7 < value.length; ++i7) {
        if (i7 in value) {
          s7.push(i7, value[i7]);
          result[i7] = callback(this, i7);
          s7.length -= 2;
        }
      }
      s7.length = origLen;
      return result;
    }, "map");
    FPp.hasParens = function() {
      var node2 = this.getNode();
      var prevToken = this.getPrevToken(node2);
      if (!prevToken) {
        return false;
      }
      var nextToken = this.getNextToken(node2);
      if (!nextToken) {
        return false;
      }
      if (prevToken.value === "(") {
        if (nextToken.value === ")") {
          return true;
        }
        var justNeedsOpeningParen = !this.canBeFirstInStatement() && this.firstInStatement() && !this.needsParens(true);
        if (justNeedsOpeningParen) {
          return true;
        }
      }
      return false;
    };
    FPp.getPrevToken = function(node2) {
      node2 = node2 || this.getNode();
      var loc = node2 && node2.loc;
      var tokens = loc && loc.tokens;
      if (tokens && loc.start.token > 0) {
        var token = tokens[loc.start.token - 1];
        if (token) {
          var rootLoc = this.getRootValue().loc;
          if (util5.comparePos(rootLoc.start, token.loc.start) <= 0) {
            return token;
          }
        }
      }
      return null;
    };
    FPp.getNextToken = function(node2) {
      node2 = node2 || this.getNode();
      var loc = node2 && node2.loc;
      var tokens = loc && loc.tokens;
      if (tokens && loc.end.token < tokens.length) {
        var token = tokens[loc.end.token];
        if (token) {
          var rootLoc = this.getRootValue().loc;
          if (util5.comparePos(token.loc.end, rootLoc.end) <= 0) {
            return token;
          }
        }
      }
      return null;
    };
    FPp.needsParens = function(assumeExpressionContext) {
      var node2 = this.getNode();
      if (node2.type === "AssignmentExpression" && node2.left.type === "ObjectPattern") {
        return true;
      }
      var parent = this.getParentNode();
      var name2 = this.getName();
      if (this.getValue() !== node2) {
        return false;
      }
      if (n9.Statement.check(node2)) {
        return false;
      }
      if (node2.type === "Identifier") {
        return false;
      }
      if (parent && parent.type === "ParenthesizedExpression") {
        return false;
      }
      if (node2.extra && node2.extra.parenthesized) {
        return true;
      }
      if (!parent)
        return false;
      if (node2.type === "UnaryExpression" && parent.type === "BinaryExpression" && name2 === "left" && parent.left === node2 && parent.operator === "**") {
        return true;
      }
      switch (node2.type) {
        case "UnaryExpression":
        case "SpreadElement":
        case "SpreadProperty":
          return parent.type === "MemberExpression" && name2 === "object" && parent.object === node2;
        case "BinaryExpression":
        case "LogicalExpression":
          switch (parent.type) {
            case "CallExpression":
              return name2 === "callee" && parent.callee === node2;
            case "UnaryExpression":
            case "SpreadElement":
            case "SpreadProperty":
              return true;
            case "MemberExpression":
              return name2 === "object" && parent.object === node2;
            case "BinaryExpression":
            case "LogicalExpression": {
              var po = parent.operator;
              var pp = PRECEDENCE[po];
              var no = node2.operator;
              var np = PRECEDENCE[no];
              if (pp > np) {
                return true;
              }
              if (pp === np && name2 === "right") {
                (0, tiny_invariant_1.default)(parent.right === node2);
                return true;
              }
              break;
            }
            default:
              return false;
          }
          break;
        case "SequenceExpression":
          switch (parent.type) {
            case "ReturnStatement":
              return false;
            case "ForStatement":
              return false;
            case "ExpressionStatement":
              return name2 !== "expression";
            default:
              return true;
          }
        case "OptionalIndexedAccessType":
          return node2.optional && parent.type === "IndexedAccessType";
        case "IntersectionTypeAnnotation":
        case "UnionTypeAnnotation":
          return parent.type === "NullableTypeAnnotation";
        case "Literal":
          return parent.type === "MemberExpression" && isNumber.check(node2.value) && name2 === "object" && parent.object === node2;
        // Babel 6 Literal split
        case "NumericLiteral":
          return parent.type === "MemberExpression" && name2 === "object" && parent.object === node2;
        case "YieldExpression":
        case "AwaitExpression":
        case "AssignmentExpression":
        case "ConditionalExpression":
          switch (parent.type) {
            case "UnaryExpression":
            case "SpreadElement":
            case "SpreadProperty":
            case "BinaryExpression":
            case "LogicalExpression":
              return true;
            case "CallExpression":
            case "NewExpression":
              return name2 === "callee" && parent.callee === node2;
            case "ConditionalExpression":
              return name2 === "test" && parent.test === node2;
            case "MemberExpression":
              return name2 === "object" && parent.object === node2;
            default:
              return false;
          }
        case "ArrowFunctionExpression":
          if (n9.CallExpression.check(parent) && name2 === "callee" && parent.callee === node2) {
            return true;
          }
          if (n9.MemberExpression.check(parent) && name2 === "object" && parent.object === node2) {
            return true;
          }
          if (n9.TSAsExpression && n9.TSAsExpression.check(parent) && name2 === "expression" && parent.expression === node2) {
            return true;
          }
          return isBinary(parent);
        case "ObjectExpression":
          if (parent.type === "ArrowFunctionExpression" && name2 === "body" && parent.body === node2) {
            return true;
          }
          break;
        case "TSAsExpression":
          if (parent.type === "ArrowFunctionExpression" && name2 === "body" && parent.body === node2 && node2.expression.type === "ObjectExpression") {
            return true;
          }
          break;
        case "CallExpression":
          if (name2 === "declaration" && n9.ExportDefaultDeclaration.check(parent) && n9.FunctionExpression.check(node2.callee)) {
            return true;
          }
      }
      if (parent.type === "NewExpression" && name2 === "callee" && parent.callee === node2) {
        return containsCallExpression(node2);
      }
      if (assumeExpressionContext !== true && !this.canBeFirstInStatement() && this.firstInStatement()) {
        return true;
      }
      return false;
    };
    function isBinary(node2) {
      return n9.BinaryExpression.check(node2) || n9.LogicalExpression.check(node2);
    }
    __name(isBinary, "isBinary");
    function containsCallExpression(node2) {
      if (n9.CallExpression.check(node2)) {
        return true;
      }
      if (isArray.check(node2)) {
        return node2.some(containsCallExpression);
      }
      if (n9.Node.check(node2)) {
        return types13.someField(node2, function(_name, child) {
          return containsCallExpression(child);
        });
      }
      return false;
    }
    __name(containsCallExpression, "containsCallExpression");
    FPp.canBeFirstInStatement = function() {
      var node2 = this.getNode();
      if (n9.FunctionExpression.check(node2)) {
        return false;
      }
      if (n9.ObjectExpression.check(node2)) {
        return false;
      }
      if (n9.ClassExpression.check(node2)) {
        return false;
      }
      return true;
    };
    FPp.firstInStatement = function() {
      var s7 = this.stack;
      var parentName, parent;
      var childName, child;
      for (var i7 = s7.length - 1; i7 >= 0; i7 -= 2) {
        if (n9.Node.check(s7[i7])) {
          childName = parentName;
          child = parent;
          parentName = s7[i7 - 1];
          parent = s7[i7];
        }
        if (!parent || !child) {
          continue;
        }
        if (n9.BlockStatement.check(parent) && parentName === "body" && childName === 0) {
          (0, tiny_invariant_1.default)(parent.body[0] === child);
          return true;
        }
        if (n9.ExpressionStatement.check(parent) && childName === "expression") {
          (0, tiny_invariant_1.default)(parent.expression === child);
          return true;
        }
        if (n9.AssignmentExpression.check(parent) && childName === "left") {
          (0, tiny_invariant_1.default)(parent.left === child);
          return true;
        }
        if (n9.ArrowFunctionExpression.check(parent) && childName === "body") {
          (0, tiny_invariant_1.default)(parent.body === child);
          return true;
        }
        if (n9.SequenceExpression.check(parent) && s7[i7 + 1] === "expressions" && childName === 0) {
          (0, tiny_invariant_1.default)(parent.expressions[0] === child);
          continue;
        }
        if (n9.CallExpression.check(parent) && childName === "callee") {
          (0, tiny_invariant_1.default)(parent.callee === child);
          continue;
        }
        if (n9.MemberExpression.check(parent) && childName === "object") {
          (0, tiny_invariant_1.default)(parent.object === child);
          continue;
        }
        if (n9.ConditionalExpression.check(parent) && childName === "test") {
          (0, tiny_invariant_1.default)(parent.test === child);
          continue;
        }
        if (isBinary(parent) && childName === "left") {
          (0, tiny_invariant_1.default)(parent.left === child);
          continue;
        }
        if (n9.UnaryExpression.check(parent) && !parent.prefix && childName === "argument") {
          (0, tiny_invariant_1.default)(parent.argument === child);
          continue;
        }
        return false;
      }
      return true;
    };
    exports.default = FastPath;
  }
});

// ../../node_modules/.pnpm/recast@0.23.11/node_modules/recast/lib/patcher.js
var require_patcher = __commonJS({
  "../../node_modules/.pnpm/recast@0.23.11/node_modules/recast/lib/patcher.js"(exports) {
    init_import_meta_url();
    Object.defineProperty(exports, "__esModule", { value: true });
    exports.getReprinter = exports.Patcher = void 0;
    var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
    var tiny_invariant_1 = tslib_1.__importDefault(require_tiny_invariant_cjs());
    var linesModule = tslib_1.__importStar(require_lines3());
    var types13 = tslib_1.__importStar(require_main3());
    var Printable = types13.namedTypes.Printable;
    var Expression = types13.namedTypes.Expression;
    var ReturnStatement = types13.namedTypes.ReturnStatement;
    var SourceLocation = types13.namedTypes.SourceLocation;
    var util_1 = require_util10();
    var fast_path_1 = tslib_1.__importDefault(require_fast_path());
    var isObject5 = types13.builtInTypes.object;
    var isArray = types13.builtInTypes.array;
    var isString5 = types13.builtInTypes.string;
    var riskyAdjoiningCharExp = /[0-9a-z_$]/i;
    var Patcher = /* @__PURE__ */ __name(function Patcher2(lines) {
      (0, tiny_invariant_1.default)(this instanceof Patcher2);
      (0, tiny_invariant_1.default)(lines instanceof linesModule.Lines);
      var self2 = this, replacements = [];
      self2.replace = function(loc, lines2) {
        if (isString5.check(lines2))
          lines2 = linesModule.fromString(lines2);
        replacements.push({
          lines: lines2,
          start: loc.start,
          end: loc.end
        });
      };
      self2.get = function(loc) {
        loc = loc || {
          start: { line: 1, column: 0 },
          end: { line: lines.length, column: lines.getLineLength(lines.length) }
        };
        var sliceFrom = loc.start, toConcat = [];
        function pushSlice(from, to) {
          (0, tiny_invariant_1.default)((0, util_1.comparePos)(from, to) <= 0);
          toConcat.push(lines.slice(from, to));
        }
        __name(pushSlice, "pushSlice");
        replacements.sort(function(a7, b11) {
          return (0, util_1.comparePos)(a7.start, b11.start);
        }).forEach(function(rep) {
          if ((0, util_1.comparePos)(sliceFrom, rep.start) > 0) ; else {
            pushSlice(sliceFrom, rep.start);
            toConcat.push(rep.lines);
            sliceFrom = rep.end;
          }
        });
        pushSlice(sliceFrom, loc.end);
        return linesModule.concat(toConcat);
      };
    }, "Patcher");
    exports.Patcher = Patcher;
    var Pp = Patcher.prototype;
    Pp.tryToReprintComments = function(newNode, oldNode, print2) {
      var patcher = this;
      if (!newNode.comments && !oldNode.comments) {
        return true;
      }
      var newPath = fast_path_1.default.from(newNode);
      var oldPath = fast_path_1.default.from(oldNode);
      newPath.stack.push("comments", getSurroundingComments(newNode));
      oldPath.stack.push("comments", getSurroundingComments(oldNode));
      var reprints = [];
      var ableToReprintComments = findArrayReprints(newPath, oldPath, reprints);
      if (ableToReprintComments && reprints.length > 0) {
        reprints.forEach(function(reprint) {
          var oldComment = reprint.oldPath.getValue();
          (0, tiny_invariant_1.default)(oldComment.leading || oldComment.trailing);
          patcher.replace(
            oldComment.loc,
            // Comments can't have .comments, so it doesn't matter whether we
            // print with comments or without.
            print2(reprint.newPath).indentTail(oldComment.loc.indent)
          );
        });
      }
      return ableToReprintComments;
    };
    function getSurroundingComments(node2) {
      var result = [];
      if (node2.comments && node2.comments.length > 0) {
        node2.comments.forEach(function(comment) {
          if (comment.leading || comment.trailing) {
            result.push(comment);
          }
        });
      }
      return result;
    }
    __name(getSurroundingComments, "getSurroundingComments");
    Pp.deleteComments = function(node2) {
      if (!node2.comments) {
        return;
      }
      var patcher = this;
      node2.comments.forEach(function(comment) {
        if (comment.leading) {
          patcher.replace({
            start: comment.loc.start,
            end: node2.loc.lines.skipSpaces(comment.loc.end, false, false)
          }, "");
        } else if (comment.trailing) {
          patcher.replace({
            start: node2.loc.lines.skipSpaces(comment.loc.start, true, false),
            end: comment.loc.end
          }, "");
        }
      });
    };
    function getReprinter(path84) {
      (0, tiny_invariant_1.default)(path84 instanceof fast_path_1.default);
      var node2 = path84.getValue();
      if (!Printable.check(node2))
        return;
      var orig = node2.original;
      var origLoc = orig && orig.loc;
      var lines = origLoc && origLoc.lines;
      var reprints = [];
      if (!lines || !findReprints(path84, reprints))
        return;
      return function(print2) {
        var patcher = new Patcher(lines);
        reprints.forEach(function(reprint) {
          var newNode = reprint.newPath.getValue();
          var oldNode = reprint.oldPath.getValue();
          SourceLocation.assert(oldNode.loc, true);
          var needToPrintNewPathWithComments = !patcher.tryToReprintComments(newNode, oldNode, print2);
          if (needToPrintNewPathWithComments) {
            patcher.deleteComments(oldNode);
          }
          var newLines = print2(reprint.newPath, {
            includeComments: needToPrintNewPathWithComments,
            // If the oldNode we're replacing already had parentheses, we may
            // not need to print the new node with any extra parentheses,
            // because the existing parentheses will suffice. However, if the
            // newNode has a different type than the oldNode, let the printer
            // decide if reprint.newPath needs parentheses, as usual.
            avoidRootParens: oldNode.type === newNode.type && reprint.oldPath.hasParens()
          }).indentTail(oldNode.loc.indent);
          var nls = needsLeadingSpace(lines, oldNode.loc, newLines);
          var nts = needsTrailingSpace(lines, oldNode.loc, newLines);
          if (nls || nts) {
            var newParts = [];
            nls && newParts.push(" ");
            newParts.push(newLines);
            nts && newParts.push(" ");
            newLines = linesModule.concat(newParts);
          }
          patcher.replace(oldNode.loc, newLines);
        });
        var patchedLines = patcher.get(origLoc).indentTail(-orig.loc.indent);
        if (path84.needsParens()) {
          return linesModule.concat(["(", patchedLines, ")"]);
        }
        return patchedLines;
      };
    }
    __name(getReprinter, "getReprinter");
    exports.getReprinter = getReprinter;
    function needsLeadingSpace(oldLines, oldLoc, newLines) {
      var posBeforeOldLoc = (0, util_1.copyPos)(oldLoc.start);
      var charBeforeOldLoc = oldLines.prevPos(posBeforeOldLoc) && oldLines.charAt(posBeforeOldLoc);
      var newFirstChar = newLines.charAt(newLines.firstPos());
      return charBeforeOldLoc && riskyAdjoiningCharExp.test(charBeforeOldLoc) && newFirstChar && riskyAdjoiningCharExp.test(newFirstChar);
    }
    __name(needsLeadingSpace, "needsLeadingSpace");
    function needsTrailingSpace(oldLines, oldLoc, newLines) {
      var charAfterOldLoc = oldLines.charAt(oldLoc.end);
      var newLastPos = newLines.lastPos();
      var newLastChar = newLines.prevPos(newLastPos) && newLines.charAt(newLastPos);
      return newLastChar && riskyAdjoiningCharExp.test(newLastChar) && charAfterOldLoc && riskyAdjoiningCharExp.test(charAfterOldLoc);
    }
    __name(needsTrailingSpace, "needsTrailingSpace");
    function findReprints(newPath, reprints) {
      var newNode = newPath.getValue();
      Printable.assert(newNode);
      var oldNode = newNode.original;
      Printable.assert(oldNode);
      (0, tiny_invariant_1.default)(reprints.length === 0);
      if (newNode.type !== oldNode.type) {
        return false;
      }
      var oldPath = new fast_path_1.default(oldNode);
      var canReprint = findChildReprints(newPath, oldPath, reprints);
      if (!canReprint) {
        reprints.length = 0;
      }
      return canReprint;
    }
    __name(findReprints, "findReprints");
    function findAnyReprints(newPath, oldPath, reprints) {
      var newNode = newPath.getValue();
      var oldNode = oldPath.getValue();
      if (newNode === oldNode)
        return true;
      if (isArray.check(newNode))
        return findArrayReprints(newPath, oldPath, reprints);
      if (isObject5.check(newNode))
        return findObjectReprints(newPath, oldPath, reprints);
      return false;
    }
    __name(findAnyReprints, "findAnyReprints");
    function findArrayReprints(newPath, oldPath, reprints) {
      var newNode = newPath.getValue();
      var oldNode = oldPath.getValue();
      if (newNode === oldNode || newPath.valueIsDuplicate() || oldPath.valueIsDuplicate()) {
        return true;
      }
      isArray.assert(newNode);
      var len = newNode.length;
      if (!(isArray.check(oldNode) && oldNode.length === len))
        return false;
      for (var i7 = 0; i7 < len; ++i7) {
        newPath.stack.push(i7, newNode[i7]);
        oldPath.stack.push(i7, oldNode[i7]);
        var canReprint = findAnyReprints(newPath, oldPath, reprints);
        newPath.stack.length -= 2;
        oldPath.stack.length -= 2;
        if (!canReprint) {
          return false;
        }
      }
      return true;
    }
    __name(findArrayReprints, "findArrayReprints");
    function findObjectReprints(newPath, oldPath, reprints) {
      var newNode = newPath.getValue();
      isObject5.assert(newNode);
      if (newNode.original === null) {
        return false;
      }
      var oldNode = oldPath.getValue();
      if (!isObject5.check(oldNode))
        return false;
      if (newNode === oldNode || newPath.valueIsDuplicate() || oldPath.valueIsDuplicate()) {
        return true;
      }
      if (Printable.check(newNode)) {
        if (!Printable.check(oldNode)) {
          return false;
        }
        var newParentNode = newPath.getParentNode();
        var oldParentNode = oldPath.getParentNode();
        if (oldParentNode !== null && oldParentNode.type === "FunctionTypeAnnotation" && newParentNode !== null && newParentNode.type === "FunctionTypeAnnotation") {
          var oldNeedsParens = oldParentNode.params.length !== 1 || !!oldParentNode.params[0].name;
          var newNeedParens = newParentNode.params.length !== 1 || !!newParentNode.params[0].name;
          if (!oldNeedsParens && newNeedParens) {
            return false;
          }
        }
        if (newNode.type === oldNode.type) {
          var childReprints = [];
          if (findChildReprints(newPath, oldPath, childReprints)) {
            reprints.push.apply(reprints, childReprints);
          } else if (oldNode.loc) {
            reprints.push({
              oldPath: oldPath.copy(),
              newPath: newPath.copy()
            });
          } else {
            return false;
          }
          return true;
        }
        if (Expression.check(newNode) && Expression.check(oldNode) && // If we have no .loc information for oldNode, then we won't be
        // able to reprint it.
        oldNode.loc) {
          reprints.push({
            oldPath: oldPath.copy(),
            newPath: newPath.copy()
          });
          return true;
        }
        return false;
      }
      return findChildReprints(newPath, oldPath, reprints);
    }
    __name(findObjectReprints, "findObjectReprints");
    function findChildReprints(newPath, oldPath, reprints) {
      var newNode = newPath.getValue();
      var oldNode = oldPath.getValue();
      isObject5.assert(newNode);
      isObject5.assert(oldNode);
      if (newNode.original === null) {
        return false;
      }
      if (newPath.needsParens() && !oldPath.hasParens()) {
        return false;
      }
      var keys = (0, util_1.getUnionOfKeys)(oldNode, newNode);
      if (oldNode.type === "File" || newNode.type === "File") {
        delete keys.tokens;
      }
      delete keys.loc;
      var originalReprintCount = reprints.length;
      for (var k7 in keys) {
        if (k7.charAt(0) === "_") {
          continue;
        }
        newPath.stack.push(k7, types13.getFieldValue(newNode, k7));
        oldPath.stack.push(k7, types13.getFieldValue(oldNode, k7));
        var canReprint = findAnyReprints(newPath, oldPath, reprints);
        newPath.stack.length -= 2;
        oldPath.stack.length -= 2;
        if (!canReprint) {
          return false;
        }
      }
      if (ReturnStatement.check(newPath.getNode()) && reprints.length > originalReprintCount) {
        return false;
      }
      return true;
    }
    __name(findChildReprints, "findChildReprints");
  }
});

// ../../node_modules/.pnpm/recast@0.23.11/node_modules/recast/lib/printer.js
var require_printer = __commonJS({
  "../../node_modules/.pnpm/recast@0.23.11/node_modules/recast/lib/printer.js"(exports) {
    init_import_meta_url();
    Object.defineProperty(exports, "__esModule", { value: true });
    exports.Printer = void 0;
    var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
    var tiny_invariant_1 = tslib_1.__importDefault(require_tiny_invariant_cjs());
    var types13 = tslib_1.__importStar(require_main3());
    var comments_1 = require_comments();
    var fast_path_1 = tslib_1.__importDefault(require_fast_path());
    var lines_1 = require_lines3();
    var options_1 = require_options();
    var patcher_1 = require_patcher();
    var util5 = tslib_1.__importStar(require_util10());
    var namedTypes = types13.namedTypes;
    var isString5 = types13.builtInTypes.string;
    var isObject5 = types13.builtInTypes.object;
    var PrintResult = /* @__PURE__ */ __name(function PrintResult2(code, sourceMap) {
      (0, tiny_invariant_1.default)(this instanceof PrintResult2);
      isString5.assert(code);
      this.code = code;
      if (sourceMap) {
        isObject5.assert(sourceMap);
        this.map = sourceMap;
      }
    }, "PrintResult");
    var PRp = PrintResult.prototype;
    var warnedAboutToString = false;
    PRp.toString = function() {
      if (!warnedAboutToString) {
        console.warn("Deprecation warning: recast.print now returns an object with a .code property. You appear to be treating the object as a string, which might still work but is strongly discouraged.");
        warnedAboutToString = true;
      }
      return this.code;
    };
    var emptyPrintResult = new PrintResult("");
    var Printer = /* @__PURE__ */ __name(function Printer2(config) {
      (0, tiny_invariant_1.default)(this instanceof Printer2);
      var explicitTabWidth = config && config.tabWidth;
      config = (0, options_1.normalize)(config);
      config.sourceFileName = null;
      function makePrintFunctionWith(options, overrides) {
        options = Object.assign({}, options, overrides);
        return function(path84) {
          return print2(path84, options);
        };
      }
      __name(makePrintFunctionWith, "makePrintFunctionWith");
      function print2(path84, options) {
        (0, tiny_invariant_1.default)(path84 instanceof fast_path_1.default);
        options = options || {};
        if (options.includeComments) {
          return (0, comments_1.printComments)(path84, makePrintFunctionWith(options, {
            includeComments: false
          }));
        }
        var oldTabWidth = config.tabWidth;
        if (!explicitTabWidth) {
          var loc = path84.getNode().loc;
          if (loc && loc.lines && loc.lines.guessTabWidth) {
            config.tabWidth = loc.lines.guessTabWidth();
          }
        }
        var reprinter = (0, patcher_1.getReprinter)(path84);
        var lines = reprinter ? (
          // Since the print function that we pass to the reprinter will
          // be used to print "new" nodes, it's tempting to think we
          // should pass printRootGenerically instead of print, to avoid
          // calling maybeReprint again, but that would be a mistake
          // because the new nodes might not be entirely new, but merely
          // moved from elsewhere in the AST. The print function is the
          // right choice because it gives us the opportunity to reprint
          // such nodes using their original source.
          reprinter(print2)
        ) : genericPrint(path84, config, options, makePrintFunctionWith(options, {
          includeComments: true,
          avoidRootParens: false
        }));
        config.tabWidth = oldTabWidth;
        return lines;
      }
      __name(print2, "print");
      this.print = function(ast) {
        if (!ast) {
          return emptyPrintResult;
        }
        var lines = print2(fast_path_1.default.from(ast), {
          includeComments: true,
          avoidRootParens: false
        });
        return new PrintResult(lines.toString(config), util5.composeSourceMaps(config.inputSourceMap, lines.getSourceMap(config.sourceMapName, config.sourceRoot)));
      };
      this.printGenerically = function(ast) {
        if (!ast) {
          return emptyPrintResult;
        }
        function printGenerically(path85) {
          return (0, comments_1.printComments)(path85, function(path86) {
            return genericPrint(path86, config, {
              avoidRootParens: false
            }, printGenerically);
          });
        }
        __name(printGenerically, "printGenerically");
        var path84 = fast_path_1.default.from(ast);
        var oldReuseWhitespace = config.reuseWhitespace;
        config.reuseWhitespace = false;
        var pr2 = new PrintResult(printGenerically(path84).toString(config));
        config.reuseWhitespace = oldReuseWhitespace;
        return pr2;
      };
    }, "Printer");
    exports.Printer = Printer;
    function genericPrint(path84, config, options, printPath) {
      (0, tiny_invariant_1.default)(path84 instanceof fast_path_1.default);
      var node2 = path84.getValue();
      var parts = [];
      var linesWithoutParens = genericPrintNoParens(path84, config, printPath);
      if (!node2 || linesWithoutParens.isEmpty()) {
        return linesWithoutParens;
      }
      var shouldAddParens = false;
      var decoratorsLines = printDecorators(path84, printPath);
      if (decoratorsLines.isEmpty()) {
        if (!options.avoidRootParens) {
          shouldAddParens = path84.needsParens();
        }
      } else {
        parts.push(decoratorsLines);
      }
      if (shouldAddParens) {
        parts.unshift("(");
      }
      parts.push(linesWithoutParens);
      if (shouldAddParens) {
        parts.push(")");
      }
      return (0, lines_1.concat)(parts);
    }
    __name(genericPrint, "genericPrint");
    function genericPrintNoParens(path84, options, print2) {
      var _a5, _b2, _c3;
      var n9 = path84.getValue();
      if (!n9) {
        return (0, lines_1.fromString)("");
      }
      if (typeof n9 === "string") {
        return (0, lines_1.fromString)(n9, options);
      }
      namedTypes.Printable.assert(n9);
      var parts = [];
      switch (n9.type) {
        case "File":
          return path84.call(print2, "program");
        case "Program":
          if (n9.directives) {
            path84.each(function(childPath) {
              parts.push(print2(childPath), ";\n");
            }, "directives");
          }
          if (n9.interpreter) {
            parts.push(path84.call(print2, "interpreter"));
          }
          parts.push(path84.call(function(bodyPath) {
            return printStatementSequence(bodyPath, options, print2);
          }, "body"));
          return (0, lines_1.concat)(parts);
        case "Noop":
        // Babel extension.
        case "EmptyStatement":
          return (0, lines_1.fromString)("");
        case "ExpressionStatement":
          return (0, lines_1.concat)([path84.call(print2, "expression"), ";"]);
        case "ParenthesizedExpression":
          return (0, lines_1.concat)(["(", path84.call(print2, "expression"), ")"]);
        case "BinaryExpression":
        case "LogicalExpression":
        case "AssignmentExpression":
          return (0, lines_1.fromString)(" ").join([
            path84.call(print2, "left"),
            n9.operator,
            path84.call(print2, "right")
          ]);
        case "AssignmentPattern":
          return (0, lines_1.concat)([
            path84.call(print2, "left"),
            " = ",
            path84.call(print2, "right")
          ]);
        case "MemberExpression":
        case "OptionalMemberExpression": {
          parts.push(path84.call(print2, "object"));
          var property = path84.call(print2, "property");
          var optional = types13.getFieldValue(n9, "optional");
          if (n9.computed) {
            parts.push(optional ? "?.[" : "[", property, "]");
          } else {
            parts.push(optional ? "?." : ".", property);
          }
          return (0, lines_1.concat)(parts);
        }
        case "ChainExpression":
          return path84.call(print2, "expression");
        case "MetaProperty":
          return (0, lines_1.concat)([
            path84.call(print2, "meta"),
            ".",
            path84.call(print2, "property")
          ]);
        case "BindExpression":
          if (n9.object) {
            parts.push(path84.call(print2, "object"));
          }
          parts.push("::", path84.call(print2, "callee"));
          return (0, lines_1.concat)(parts);
        case "Path":
          return (0, lines_1.fromString)(".").join(n9.body);
        case "Identifier":
          return (0, lines_1.concat)([
            (0, lines_1.fromString)(n9.name, options),
            n9.optional ? "?" : "",
            path84.call(print2, "typeAnnotation")
          ]);
        case "SpreadElement":
        case "SpreadElementPattern":
        case "RestProperty":
        // Babel 6 for ObjectPattern
        case "SpreadProperty":
        case "SpreadPropertyPattern":
        case "ObjectTypeSpreadProperty":
        case "RestElement":
          return (0, lines_1.concat)([
            "...",
            path84.call(print2, "argument"),
            path84.call(print2, "typeAnnotation")
          ]);
        case "FunctionDeclaration":
        case "FunctionExpression":
        case "TSDeclareFunction":
          if (n9.declare) {
            parts.push("declare ");
          }
          if (n9.async) {
            parts.push("async ");
          }
          parts.push("function");
          if (n9.generator)
            parts.push("*");
          if (n9.id) {
            parts.push(" ", path84.call(print2, "id"), path84.call(print2, "typeParameters"));
          } else {
            if (n9.typeParameters) {
              parts.push(path84.call(print2, "typeParameters"));
            }
          }
          parts.push("(", printFunctionParams(path84, options, print2), ")", path84.call(print2, "returnType"));
          if (n9.body) {
            parts.push(" ", path84.call(print2, "body"));
          }
          return (0, lines_1.concat)(parts);
        case "ArrowFunctionExpression":
          if (n9.async) {
            parts.push("async ");
          }
          if (n9.typeParameters) {
            parts.push(path84.call(print2, "typeParameters"));
          }
          if (!options.arrowParensAlways && n9.params.length === 1 && !n9.rest && n9.params[0].type === "Identifier" && !n9.params[0].typeAnnotation && !n9.returnType) {
            parts.push(path84.call(print2, "params", 0));
          } else {
            parts.push("(", printFunctionParams(path84, options, print2), ")", path84.call(print2, "returnType"));
          }
          parts.push(" => ", path84.call(print2, "body"));
          return (0, lines_1.concat)(parts);
        case "MethodDefinition":
          return printMethod(path84, options, print2);
        case "YieldExpression":
          parts.push("yield");
          if (n9.delegate)
            parts.push("*");
          if (n9.argument)
            parts.push(" ", path84.call(print2, "argument"));
          return (0, lines_1.concat)(parts);
        case "AwaitExpression":
          parts.push("await");
          if (n9.all)
            parts.push("*");
          if (n9.argument)
            parts.push(" ", path84.call(print2, "argument"));
          return (0, lines_1.concat)(parts);
        case "ModuleExpression":
          return (0, lines_1.concat)([
            "module {\n",
            path84.call(print2, "body").indent(options.tabWidth),
            "\n}"
          ]);
        case "ModuleDeclaration":
          parts.push("module", path84.call(print2, "id"));
          if (n9.source) {
            (0, tiny_invariant_1.default)(!n9.body);
            parts.push("from", path84.call(print2, "source"));
          } else {
            parts.push(path84.call(print2, "body"));
          }
          return (0, lines_1.fromString)(" ").join(parts);
        case "ImportSpecifier":
          if (n9.importKind && n9.importKind !== "value") {
            parts.push(n9.importKind + " ");
          }
          if (n9.imported) {
            parts.push(path84.call(print2, "imported"));
            if (n9.local && n9.local.name !== n9.imported.name) {
              parts.push(" as ", path84.call(print2, "local"));
            }
          } else if (n9.id) {
            parts.push(path84.call(print2, "id"));
            if (n9.name) {
              parts.push(" as ", path84.call(print2, "name"));
            }
          }
          return (0, lines_1.concat)(parts);
        case "ExportSpecifier":
          if (n9.exportKind && n9.exportKind !== "value") {
            parts.push(n9.exportKind + " ");
          }
          if (n9.local) {
            parts.push(path84.call(print2, "local"));
            if (n9.exported && n9.exported.name !== n9.local.name) {
              parts.push(" as ", path84.call(print2, "exported"));
            }
          } else if (n9.id) {
            parts.push(path84.call(print2, "id"));
            if (n9.name) {
              parts.push(" as ", path84.call(print2, "name"));
            }
          }
          return (0, lines_1.concat)(parts);
        case "ExportBatchSpecifier":
          return (0, lines_1.fromString)("*");
        case "ImportNamespaceSpecifier":
          parts.push("* as ");
          if (n9.local) {
            parts.push(path84.call(print2, "local"));
          } else if (n9.id) {
            parts.push(path84.call(print2, "id"));
          }
          return (0, lines_1.concat)(parts);
        case "ImportDefaultSpecifier":
          if (n9.local) {
            return path84.call(print2, "local");
          }
          return path84.call(print2, "id");
        case "TSExportAssignment":
          return (0, lines_1.concat)(["export = ", path84.call(print2, "expression")]);
        case "ExportDeclaration":
        case "ExportDefaultDeclaration":
        case "ExportNamedDeclaration":
          return printExportDeclaration(path84, options, print2);
        case "ExportAllDeclaration":
          parts.push("export *");
          if (n9.exported) {
            parts.push(" as ", path84.call(print2, "exported"));
          }
          parts.push(" from ", path84.call(print2, "source"), ";");
          return (0, lines_1.concat)(parts);
        case "TSNamespaceExportDeclaration":
          parts.push("export as namespace ", path84.call(print2, "id"));
          return maybeAddSemicolon((0, lines_1.concat)(parts));
        case "ExportNamespaceSpecifier":
          return (0, lines_1.concat)(["* as ", path84.call(print2, "exported")]);
        case "ExportDefaultSpecifier":
          return path84.call(print2, "exported");
        case "Import":
          return (0, lines_1.fromString)("import", options);
        // Recast and ast-types currently support dynamic import(...) using
        // either this dedicated ImportExpression type or a CallExpression
        // whose callee has type Import.
        // https://github.com/benjamn/ast-types/pull/365#issuecomment-605214486
        case "ImportExpression":
          return (0, lines_1.concat)(["import(", path84.call(print2, "source"), ")"]);
        case "ImportDeclaration": {
          parts.push("import ");
          if (n9.importKind && n9.importKind !== "value") {
            parts.push(n9.importKind + " ");
          }
          if (n9.specifiers && n9.specifiers.length > 0) {
            var unbracedSpecifiers_1 = [];
            var bracedSpecifiers_1 = [];
            path84.each(function(specifierPath) {
              var spec = specifierPath.getValue();
              if (spec.type === "ImportSpecifier") {
                bracedSpecifiers_1.push(print2(specifierPath));
              } else if (spec.type === "ImportDefaultSpecifier" || spec.type === "ImportNamespaceSpecifier") {
                unbracedSpecifiers_1.push(print2(specifierPath));
              }
            }, "specifiers");
            unbracedSpecifiers_1.forEach(function(lines2, i7) {
              if (i7 > 0) {
                parts.push(", ");
              }
              parts.push(lines2);
            });
            if (bracedSpecifiers_1.length > 0) {
              var lines = (0, lines_1.fromString)(", ").join(bracedSpecifiers_1);
              if (lines.getLineLength(1) > options.wrapColumn) {
                lines = (0, lines_1.concat)([
                  (0, lines_1.fromString)(",\n").join(bracedSpecifiers_1).indent(options.tabWidth),
                  ","
                ]);
              }
              if (unbracedSpecifiers_1.length > 0) {
                parts.push(", ");
              }
              if (lines.length > 1) {
                parts.push("{\n", lines, "\n}");
              } else if (options.objectCurlySpacing) {
                parts.push("{ ", lines, " }");
              } else {
                parts.push("{", lines, "}");
              }
            }
            parts.push(" from ");
          }
          parts.push(path84.call(print2, "source"), maybePrintImportAssertions(path84, options, print2), ";");
          return (0, lines_1.concat)(parts);
        }
        case "ImportAttribute":
          return (0, lines_1.concat)([path84.call(print2, "key"), ": ", path84.call(print2, "value")]);
        case "StaticBlock":
          parts.push("static ");
        // Intentionally fall through to BlockStatement below.
        case "BlockStatement": {
          var naked_1 = path84.call(function(bodyPath) {
            return printStatementSequence(bodyPath, options, print2);
          }, "body");
          if (naked_1.isEmpty()) {
            if (!n9.directives || n9.directives.length === 0) {
              parts.push("{}");
              return (0, lines_1.concat)(parts);
            }
          }
          parts.push("{\n");
          if (n9.directives) {
            path84.each(function(childPath) {
              parts.push(maybeAddSemicolon(print2(childPath).indent(options.tabWidth)), n9.directives.length > 1 || !naked_1.isEmpty() ? "\n" : "");
            }, "directives");
          }
          parts.push(naked_1.indent(options.tabWidth));
          parts.push("\n}");
          return (0, lines_1.concat)(parts);
        }
        case "ReturnStatement": {
          parts.push("return");
          if (n9.argument) {
            var argIsJsxElement = ((_a5 = namedTypes.JSXElement) === null || _a5 === void 0 ? void 0 : _a5.check(n9.argument)) || ((_b2 = namedTypes.JSXFragment) === null || _b2 === void 0 ? void 0 : _b2.check(n9.argument));
            var argLines = path84.call(print2, "argument");
            if (argLines.startsWithComment() || argLines.length > 1 && argIsJsxElement) {
              if (argIsJsxElement && ((_c3 = n9.argument.extra) === null || _c3 === void 0 ? void 0 : _c3.parenthesized)) {
                n9.argument.extra.parenthesized = false;
                argLines = path84.call(print2, "argument");
                n9.argument.extra.parenthesized = true;
              }
              parts.push(" ", (0, lines_1.concat)(["(\n", argLines]).indentTail(options.tabWidth), "\n)");
            } else {
              parts.push(" ", argLines);
            }
          }
          parts.push(";");
          return (0, lines_1.concat)(parts);
        }
        case "CallExpression":
        case "OptionalCallExpression":
          parts.push(path84.call(print2, "callee"));
          if (n9.typeParameters) {
            parts.push(path84.call(print2, "typeParameters"));
          }
          if (n9.typeArguments) {
            parts.push(path84.call(print2, "typeArguments"));
          }
          if (types13.getFieldValue(n9, "optional")) {
            parts.push("?.");
          }
          parts.push(printArgumentsList(path84, options, print2));
          return (0, lines_1.concat)(parts);
        case "RecordExpression":
          parts.push("#");
        // Intentionally fall through to printing the object literal...
        case "ObjectExpression":
        case "ObjectPattern":
        case "ObjectTypeAnnotation": {
          var isTypeAnnotation_1 = n9.type === "ObjectTypeAnnotation";
          var separator_1 = options.flowObjectCommas ? "," : isTypeAnnotation_1 ? ";" : ",";
          var fields = [];
          var allowBreak_1 = false;
          if (isTypeAnnotation_1) {
            fields.push("indexers", "callProperties");
            if (n9.internalSlots != null) {
              fields.push("internalSlots");
            }
          }
          fields.push("properties");
          var len_1 = 0;
          fields.forEach(function(field) {
            len_1 += n9[field].length;
          });
          var oneLine_1 = isTypeAnnotation_1 && len_1 === 1 || len_1 === 0;
          var leftBrace = n9.exact ? "{|" : "{";
          var rightBrace = n9.exact ? "|}" : "}";
          parts.push(oneLine_1 ? leftBrace : leftBrace + "\n");
          var leftBraceIndex = parts.length - 1;
          var i_1 = 0;
          fields.forEach(function(field) {
            path84.each(function(childPath) {
              var lines2 = print2(childPath);
              if (!oneLine_1) {
                lines2 = lines2.indent(options.tabWidth);
              }
              var multiLine = !isTypeAnnotation_1 && lines2.length > 1;
              if (multiLine && allowBreak_1) {
                parts.push("\n");
              }
              parts.push(lines2);
              if (i_1 < len_1 - 1) {
                parts.push(separator_1 + (multiLine ? "\n\n" : "\n"));
                allowBreak_1 = !multiLine;
              } else if (len_1 !== 1 && isTypeAnnotation_1) {
                parts.push(separator_1);
              } else if (!oneLine_1 && util5.isTrailingCommaEnabled(options, "objects") && childPath.getValue().type !== "RestElement") {
                parts.push(separator_1);
              }
              i_1++;
            }, field);
          });
          if (n9.inexact) {
            var line = (0, lines_1.fromString)("...", options);
            if (oneLine_1) {
              if (len_1 > 0) {
                parts.push(separator_1, " ");
              }
              parts.push(line);
            } else {
              parts.push("\n", line.indent(options.tabWidth));
            }
          }
          parts.push(oneLine_1 ? rightBrace : "\n" + rightBrace);
          if (i_1 !== 0 && oneLine_1 && options.objectCurlySpacing) {
            parts[leftBraceIndex] = leftBrace + " ";
            parts[parts.length - 1] = " " + rightBrace;
          }
          if (n9.typeAnnotation) {
            parts.push(path84.call(print2, "typeAnnotation"));
          }
          return (0, lines_1.concat)(parts);
        }
        case "PropertyPattern":
          return (0, lines_1.concat)([
            path84.call(print2, "key"),
            ": ",
            path84.call(print2, "pattern")
          ]);
        case "ObjectProperty":
        // Babel 6
        case "Property": {
          if (n9.method || n9.kind === "get" || n9.kind === "set") {
            return printMethod(path84, options, print2);
          }
          if (n9.shorthand && n9.value.type === "AssignmentPattern") {
            return path84.call(print2, "value");
          }
          var key = path84.call(print2, "key");
          if (n9.computed) {
            parts.push("[", key, "]");
          } else {
            parts.push(key);
          }
          if (!n9.shorthand || n9.key.name !== n9.value.name) {
            parts.push(": ", path84.call(print2, "value"));
          }
          return (0, lines_1.concat)(parts);
        }
        case "ClassMethod":
        // Babel 6
        case "ObjectMethod":
        // Babel 6
        case "ClassPrivateMethod":
        case "TSDeclareMethod":
          return printMethod(path84, options, print2);
        case "PrivateName":
          return (0, lines_1.concat)(["#", path84.call(print2, "id")]);
        case "Decorator":
          return (0, lines_1.concat)(["@", path84.call(print2, "expression")]);
        case "TupleExpression":
          parts.push("#");
        // Intentionally fall through to printing the tuple elements...
        case "ArrayExpression":
        case "ArrayPattern": {
          var elems = n9.elements;
          var len_2 = elems.length;
          var printed_1 = path84.map(print2, "elements");
          var joined = (0, lines_1.fromString)(", ").join(printed_1);
          var oneLine_2 = joined.getLineLength(1) <= options.wrapColumn;
          if (oneLine_2) {
            if (options.arrayBracketSpacing) {
              parts.push("[ ");
            } else {
              parts.push("[");
            }
          } else {
            parts.push("[\n");
          }
          path84.each(function(elemPath) {
            var i7 = elemPath.getName();
            var elem = elemPath.getValue();
            if (!elem) {
              parts.push(",");
            } else {
              var lines2 = printed_1[i7];
              if (oneLine_2) {
                if (i7 > 0)
                  parts.push(" ");
              } else {
                lines2 = lines2.indent(options.tabWidth);
              }
              parts.push(lines2);
              if (i7 < len_2 - 1 || !oneLine_2 && util5.isTrailingCommaEnabled(options, "arrays"))
                parts.push(",");
              if (!oneLine_2)
                parts.push("\n");
            }
          }, "elements");
          if (oneLine_2 && options.arrayBracketSpacing) {
            parts.push(" ]");
          } else {
            parts.push("]");
          }
          if (n9.typeAnnotation) {
            parts.push(path84.call(print2, "typeAnnotation"));
          }
          return (0, lines_1.concat)(parts);
        }
        case "SequenceExpression":
          return (0, lines_1.fromString)(", ").join(path84.map(print2, "expressions"));
        case "ThisExpression":
          return (0, lines_1.fromString)("this");
        case "Super":
          return (0, lines_1.fromString)("super");
        case "NullLiteral":
          return (0, lines_1.fromString)("null");
        case "RegExpLiteral":
          return (0, lines_1.fromString)(getPossibleRaw(n9) || "/".concat(n9.pattern, "/").concat(n9.flags || ""), options);
        case "BigIntLiteral":
          return (0, lines_1.fromString)(getPossibleRaw(n9) || n9.value + "n", options);
        case "NumericLiteral":
          return (0, lines_1.fromString)(getPossibleRaw(n9) || n9.value, options);
        case "DecimalLiteral":
          return (0, lines_1.fromString)(getPossibleRaw(n9) || n9.value + "m", options);
        case "StringLiteral":
          return (0, lines_1.fromString)(nodeStr(n9.value, options));
        case "BooleanLiteral":
        // Babel 6 Literal split
        case "Literal":
          return (0, lines_1.fromString)(getPossibleRaw(n9) || (typeof n9.value === "string" ? nodeStr(n9.value, options) : n9.value), options);
        case "Directive":
          return path84.call(print2, "value");
        case "DirectiveLiteral":
          return (0, lines_1.fromString)(getPossibleRaw(n9) || nodeStr(n9.value, options), options);
        case "InterpreterDirective":
          return (0, lines_1.fromString)("#!".concat(n9.value, "\n"), options);
        case "ModuleSpecifier":
          if (n9.local) {
            throw new Error("The ESTree ModuleSpecifier type should be abstract");
          }
          return (0, lines_1.fromString)(nodeStr(n9.value, options), options);
        case "UnaryExpression":
          parts.push(n9.operator);
          if (/[a-z]$/.test(n9.operator))
            parts.push(" ");
          parts.push(path84.call(print2, "argument"));
          return (0, lines_1.concat)(parts);
        case "UpdateExpression":
          parts.push(path84.call(print2, "argument"), n9.operator);
          if (n9.prefix)
            parts.reverse();
          return (0, lines_1.concat)(parts);
        case "ConditionalExpression":
          return (0, lines_1.concat)([
            path84.call(print2, "test"),
            " ? ",
            path84.call(print2, "consequent"),
            " : ",
            path84.call(print2, "alternate")
          ]);
        case "NewExpression": {
          parts.push("new ", path84.call(print2, "callee"));
          if (n9.typeParameters) {
            parts.push(path84.call(print2, "typeParameters"));
          }
          if (n9.typeArguments) {
            parts.push(path84.call(print2, "typeArguments"));
          }
          var args = n9.arguments;
          if (args) {
            parts.push(printArgumentsList(path84, options, print2));
          }
          return (0, lines_1.concat)(parts);
        }
        case "VariableDeclaration": {
          if (n9.declare) {
            parts.push("declare ");
          }
          parts.push(n9.kind, " ");
          var maxLen_1 = 0;
          var printed = path84.map(function(childPath) {
            var lines2 = print2(childPath);
            maxLen_1 = Math.max(lines2.length, maxLen_1);
            return lines2;
          }, "declarations");
          if (maxLen_1 === 1) {
            parts.push((0, lines_1.fromString)(", ").join(printed));
          } else if (printed.length > 1) {
            parts.push((0, lines_1.fromString)(",\n").join(printed).indentTail(n9.kind.length + 1));
          } else {
            parts.push(printed[0]);
          }
          var parentNode = path84.getParentNode();
          if (!namedTypes.ForStatement.check(parentNode) && !namedTypes.ForInStatement.check(parentNode) && !(namedTypes.ForOfStatement && namedTypes.ForOfStatement.check(parentNode)) && !(namedTypes.ForAwaitStatement && namedTypes.ForAwaitStatement.check(parentNode))) {
            parts.push(";");
          }
          return (0, lines_1.concat)(parts);
        }
        case "VariableDeclarator":
          return n9.init ? (0, lines_1.fromString)(" = ").join([
            path84.call(print2, "id"),
            path84.call(print2, "init")
          ]) : path84.call(print2, "id");
        case "WithStatement":
          return (0, lines_1.concat)([
            "with (",
            path84.call(print2, "object"),
            ") ",
            path84.call(print2, "body")
          ]);
        case "IfStatement": {
          var con = adjustClause(path84.call(print2, "consequent"), options);
          parts.push("if (", path84.call(print2, "test"), ")", con);
          if (n9.alternate)
            parts.push(endsWithBrace(con) ? " else" : "\nelse", adjustClause(path84.call(print2, "alternate"), options));
          return (0, lines_1.concat)(parts);
        }
        case "ForStatement": {
          var init4 = path84.call(print2, "init");
          var sep6 = init4.length > 1 ? ";\n" : "; ";
          var forParen = "for (";
          var indented = (0, lines_1.fromString)(sep6).join([init4, path84.call(print2, "test"), path84.call(print2, "update")]).indentTail(forParen.length);
          var head = (0, lines_1.concat)([forParen, indented, ")"]);
          var clause = adjustClause(path84.call(print2, "body"), options);
          parts.push(head);
          if (head.length > 1) {
            parts.push("\n");
            clause = clause.trimLeft();
          }
          parts.push(clause);
          return (0, lines_1.concat)(parts);
        }
        case "WhileStatement":
          return (0, lines_1.concat)([
            "while (",
            path84.call(print2, "test"),
            ")",
            adjustClause(path84.call(print2, "body"), options)
          ]);
        case "ForInStatement":
          return (0, lines_1.concat)([
            n9.each ? "for each (" : "for (",
            path84.call(print2, "left"),
            " in ",
            path84.call(print2, "right"),
            ")",
            adjustClause(path84.call(print2, "body"), options)
          ]);
        case "ForOfStatement":
        case "ForAwaitStatement":
          parts.push("for ");
          if (n9.await || n9.type === "ForAwaitStatement") {
            parts.push("await ");
          }
          parts.push("(", path84.call(print2, "left"), " of ", path84.call(print2, "right"), ")", adjustClause(path84.call(print2, "body"), options));
          return (0, lines_1.concat)(parts);
        case "DoWhileStatement": {
          var doBody = (0, lines_1.concat)([
            "do",
            adjustClause(path84.call(print2, "body"), options)
          ]);
          parts.push(doBody);
          if (endsWithBrace(doBody))
            parts.push(" while");
          else
            parts.push("\nwhile");
          parts.push(" (", path84.call(print2, "test"), ");");
          return (0, lines_1.concat)(parts);
        }
        case "DoExpression": {
          var statements = path84.call(function(bodyPath) {
            return printStatementSequence(bodyPath, options, print2);
          }, "body");
          return (0, lines_1.concat)(["do {\n", statements.indent(options.tabWidth), "\n}"]);
        }
        case "BreakStatement":
          parts.push("break");
          if (n9.label)
            parts.push(" ", path84.call(print2, "label"));
          parts.push(";");
          return (0, lines_1.concat)(parts);
        case "ContinueStatement":
          parts.push("continue");
          if (n9.label)
            parts.push(" ", path84.call(print2, "label"));
          parts.push(";");
          return (0, lines_1.concat)(parts);
        case "LabeledStatement":
          return (0, lines_1.concat)([
            path84.call(print2, "label"),
            ":\n",
            path84.call(print2, "body")
          ]);
        case "TryStatement":
          parts.push("try ", path84.call(print2, "block"));
          if (n9.handler) {
            parts.push(" ", path84.call(print2, "handler"));
          } else if (n9.handlers) {
            path84.each(function(handlerPath) {
              parts.push(" ", print2(handlerPath));
            }, "handlers");
          }
          if (n9.finalizer) {
            parts.push(" finally ", path84.call(print2, "finalizer"));
          }
          return (0, lines_1.concat)(parts);
        case "CatchClause":
          parts.push("catch ");
          if (n9.param) {
            parts.push("(", path84.call(print2, "param"));
          }
          if (n9.guard) {
            parts.push(" if ", path84.call(print2, "guard"));
          }
          if (n9.param) {
            parts.push(") ");
          }
          parts.push(path84.call(print2, "body"));
          return (0, lines_1.concat)(parts);
        case "ThrowStatement":
          return (0, lines_1.concat)(["throw ", path84.call(print2, "argument"), ";"]);
        case "SwitchStatement":
          return (0, lines_1.concat)([
            "switch (",
            path84.call(print2, "discriminant"),
            ") {\n",
            (0, lines_1.fromString)("\n").join(path84.map(print2, "cases")),
            "\n}"
          ]);
        // Note: ignoring n.lexical because it has no printing consequences.
        case "SwitchCase":
          if (n9.test)
            parts.push("case ", path84.call(print2, "test"), ":");
          else
            parts.push("default:");
          if (n9.consequent.length > 0) {
            parts.push("\n", path84.call(function(consequentPath) {
              return printStatementSequence(consequentPath, options, print2);
            }, "consequent").indent(options.tabWidth));
          }
          return (0, lines_1.concat)(parts);
        case "DebuggerStatement":
          return (0, lines_1.fromString)("debugger;");
        // JSX extensions below.
        case "JSXAttribute":
          parts.push(path84.call(print2, "name"));
          if (n9.value)
            parts.push("=", path84.call(print2, "value"));
          return (0, lines_1.concat)(parts);
        case "JSXIdentifier":
          return (0, lines_1.fromString)(n9.name, options);
        case "JSXNamespacedName":
          return (0, lines_1.fromString)(":").join([
            path84.call(print2, "namespace"),
            path84.call(print2, "name")
          ]);
        case "JSXMemberExpression":
          return (0, lines_1.fromString)(".").join([
            path84.call(print2, "object"),
            path84.call(print2, "property")
          ]);
        case "JSXSpreadAttribute":
          return (0, lines_1.concat)(["{...", path84.call(print2, "argument"), "}"]);
        case "JSXSpreadChild":
          return (0, lines_1.concat)(["{...", path84.call(print2, "expression"), "}"]);
        case "JSXExpressionContainer":
          return (0, lines_1.concat)(["{", path84.call(print2, "expression"), "}"]);
        case "JSXElement":
        case "JSXFragment": {
          var openingPropName = "opening" + (n9.type === "JSXElement" ? "Element" : "Fragment");
          var closingPropName = "closing" + (n9.type === "JSXElement" ? "Element" : "Fragment");
          var openingLines = path84.call(print2, openingPropName);
          if (n9[openingPropName].selfClosing) {
            (0, tiny_invariant_1.default)(!n9[closingPropName], "unexpected " + closingPropName + " element in self-closing " + n9.type);
            return openingLines;
          }
          var childLines = (0, lines_1.concat)(path84.map(function(childPath) {
            var child = childPath.getValue();
            if (namedTypes.Literal.check(child) && typeof child.value === "string") {
              if (/\S/.test(child.value)) {
                return child.value.replace(/^\s+/g, "");
              } else if (/\n/.test(child.value)) {
                return "\n";
              }
            }
            return print2(childPath);
          }, "children")).indentTail(options.tabWidth);
          var closingLines = path84.call(print2, closingPropName);
          return (0, lines_1.concat)([openingLines, childLines, closingLines]);
        }
        case "JSXOpeningElement": {
          parts.push("<", path84.call(print2, "name"));
          var typeDefPart = path84.call(print2, "typeParameters");
          if (typeDefPart.length)
            parts.push(typeDefPart);
          var attrParts_1 = [];
          path84.each(function(attrPath) {
            attrParts_1.push(" ", print2(attrPath));
          }, "attributes");
          var attrLines = (0, lines_1.concat)(attrParts_1);
          var needLineWrap = attrLines.length > 1 || attrLines.getLineLength(1) > options.wrapColumn;
          if (needLineWrap) {
            attrParts_1.forEach(function(part, i7) {
              if (part === " ") {
                (0, tiny_invariant_1.default)(i7 % 2 === 0);
                attrParts_1[i7] = "\n";
              }
            });
            attrLines = (0, lines_1.concat)(attrParts_1).indentTail(options.tabWidth);
          }
          parts.push(attrLines, n9.selfClosing ? " />" : ">");
          return (0, lines_1.concat)(parts);
        }
        case "JSXClosingElement":
          return (0, lines_1.concat)(["</", path84.call(print2, "name"), ">"]);
        case "JSXOpeningFragment":
          return (0, lines_1.fromString)("<>");
        case "JSXClosingFragment":
          return (0, lines_1.fromString)("</>");
        case "JSXText":
          return (0, lines_1.fromString)(n9.value, options);
        case "JSXEmptyExpression":
          return (0, lines_1.fromString)("");
        case "TypeAnnotatedIdentifier":
          return (0, lines_1.concat)([
            path84.call(print2, "annotation"),
            " ",
            path84.call(print2, "identifier")
          ]);
        case "ClassBody":
          if (n9.body.length === 0) {
            return (0, lines_1.fromString)("{}");
          }
          return (0, lines_1.concat)([
            "{\n",
            path84.call(function(bodyPath) {
              return printStatementSequence(bodyPath, options, print2);
            }, "body").indent(options.tabWidth),
            "\n}"
          ]);
        case "ClassPropertyDefinition":
          parts.push("static ", path84.call(print2, "definition"));
          if (!namedTypes.MethodDefinition.check(n9.definition))
            parts.push(";");
          return (0, lines_1.concat)(parts);
        case "ClassProperty": {
          if (n9.declare) {
            parts.push("declare ");
          }
          var access4 = n9.accessibility || n9.access;
          if (typeof access4 === "string") {
            parts.push(access4, " ");
          }
          if (n9.static) {
            parts.push("static ");
          }
          if (n9.abstract) {
            parts.push("abstract ");
          }
          if (n9.readonly) {
            parts.push("readonly ");
          }
          var key = path84.call(print2, "key");
          if (n9.computed) {
            key = (0, lines_1.concat)(["[", key, "]"]);
          }
          if (n9.variance) {
            key = (0, lines_1.concat)([printVariance(path84, print2), key]);
          }
          parts.push(key);
          if (n9.optional) {
            parts.push("?");
          }
          if (n9.definite) {
            parts.push("!");
          }
          if (n9.typeAnnotation) {
            parts.push(path84.call(print2, "typeAnnotation"));
          }
          if (n9.value) {
            parts.push(" = ", path84.call(print2, "value"));
          }
          parts.push(";");
          return (0, lines_1.concat)(parts);
        }
        case "ClassPrivateProperty":
          if (n9.static) {
            parts.push("static ");
          }
          parts.push(path84.call(print2, "key"));
          if (n9.typeAnnotation) {
            parts.push(path84.call(print2, "typeAnnotation"));
          }
          if (n9.value) {
            parts.push(" = ", path84.call(print2, "value"));
          }
          parts.push(";");
          return (0, lines_1.concat)(parts);
        case "ClassAccessorProperty": {
          parts.push.apply(parts, tslib_1.__spreadArray(tslib_1.__spreadArray([], printClassMemberModifiers(n9), false), ["accessor "], false));
          if (n9.computed) {
            parts.push("[", path84.call(print2, "key"), "]");
          } else {
            parts.push(path84.call(print2, "key"));
          }
          if (n9.optional) {
            parts.push("?");
          }
          if (n9.definite) {
            parts.push("!");
          }
          if (n9.typeAnnotation) {
            parts.push(path84.call(print2, "typeAnnotation"));
          }
          if (n9.value) {
            parts.push(" = ", path84.call(print2, "value"));
          }
          parts.push(";");
          return (0, lines_1.concat)(parts);
        }
        case "ClassDeclaration":
        case "ClassExpression":
        case "DeclareClass":
          if (n9.declare) {
            parts.push("declare ");
          }
          if (n9.abstract) {
            parts.push("abstract ");
          }
          parts.push("class");
          if (n9.id) {
            parts.push(" ", path84.call(print2, "id"));
          }
          if (n9.typeParameters) {
            parts.push(path84.call(print2, "typeParameters"));
          }
          if (n9.superClass) {
            parts.push(" extends ", path84.call(print2, "superClass"), path84.call(print2, "superTypeParameters"));
          }
          if (n9.extends && n9.extends.length > 0) {
            parts.push(" extends ", (0, lines_1.fromString)(", ").join(path84.map(print2, "extends")));
          }
          if (n9["implements"] && n9["implements"].length > 0) {
            parts.push(" implements ", (0, lines_1.fromString)(", ").join(path84.map(print2, "implements")));
          }
          parts.push(" ", path84.call(print2, "body"));
          if (n9.type === "DeclareClass") {
            return printFlowDeclaration(path84, parts);
          } else {
            return (0, lines_1.concat)(parts);
          }
        case "TemplateElement":
          return (0, lines_1.fromString)(n9.value.raw, options).lockIndentTail();
        case "TemplateLiteral": {
          var expressions_1 = path84.map(print2, "expressions");
          parts.push("`");
          path84.each(function(childPath) {
            var i7 = childPath.getName();
            parts.push(print2(childPath));
            if (i7 < expressions_1.length) {
              parts.push("${", expressions_1[i7], "}");
            }
          }, "quasis");
          parts.push("`");
          return (0, lines_1.concat)(parts).lockIndentTail();
        }
        case "TaggedTemplateExpression":
          parts.push(path84.call(print2, "tag"));
          if (n9.typeParameters) {
            parts.push(path84.call(print2, "typeParameters"));
          }
          parts.push(path84.call(print2, "quasi"));
          return (0, lines_1.concat)(parts);
        // These types are unprintable because they serve as abstract
        // supertypes for other (printable) types.
        case "Node":
        case "Printable":
        case "SourceLocation":
        case "Position":
        case "Statement":
        case "Function":
        case "Pattern":
        case "Expression":
        case "Declaration":
        case "Specifier":
        case "NamedSpecifier":
        case "Comment":
        // Supertype of Block and Line
        case "Flow":
        // Supertype of all Flow AST node types
        case "FlowType":
        // Supertype of all Flow types
        case "FlowPredicate":
        // Supertype of InferredPredicate and DeclaredPredicate
        case "MemberTypeAnnotation":
        // Flow
        case "Type":
        // Flow
        case "TSHasOptionalTypeParameterInstantiation":
        case "TSHasOptionalTypeParameters":
        case "TSHasOptionalTypeAnnotation":
        case "ChainElement":
          throw new Error("unprintable type: " + JSON.stringify(n9.type));
        case "CommentBlock":
        // Babel block comment.
        case "Block":
          return (0, lines_1.concat)(["/*", (0, lines_1.fromString)(n9.value, options), "*/"]);
        case "CommentLine":
        // Babel line comment.
        case "Line":
          return (0, lines_1.concat)(["//", (0, lines_1.fromString)(n9.value, options)]);
        // Type Annotations for Facebook Flow, typically stripped out or
        // transformed away before printing.
        case "TypeAnnotation":
          if (n9.typeAnnotation) {
            if (n9.typeAnnotation.type !== "FunctionTypeAnnotation") {
              parts.push(": ");
            }
            parts.push(path84.call(print2, "typeAnnotation"));
            return (0, lines_1.concat)(parts);
          }
          return (0, lines_1.fromString)("");
        case "ExistentialTypeParam":
        case "ExistsTypeAnnotation":
          return (0, lines_1.fromString)("*", options);
        case "EmptyTypeAnnotation":
          return (0, lines_1.fromString)("empty", options);
        case "AnyTypeAnnotation":
          return (0, lines_1.fromString)("any", options);
        case "MixedTypeAnnotation":
          return (0, lines_1.fromString)("mixed", options);
        case "ArrayTypeAnnotation":
          return (0, lines_1.concat)([path84.call(print2, "elementType"), "[]"]);
        case "TupleTypeAnnotation": {
          var printed_2 = path84.map(print2, "types");
          var joined = (0, lines_1.fromString)(", ").join(printed_2);
          var oneLine_3 = joined.getLineLength(1) <= options.wrapColumn;
          if (oneLine_3) {
            if (options.arrayBracketSpacing) {
              parts.push("[ ");
            } else {
              parts.push("[");
            }
          } else {
            parts.push("[\n");
          }
          path84.each(function(elemPath) {
            var i7 = elemPath.getName();
            var elem = elemPath.getValue();
            if (!elem) {
              parts.push(",");
            } else {
              var lines2 = printed_2[i7];
              if (oneLine_3) {
                if (i7 > 0)
                  parts.push(" ");
              } else {
                lines2 = lines2.indent(options.tabWidth);
              }
              parts.push(lines2);
              if (i7 < n9.types.length - 1 || !oneLine_3 && util5.isTrailingCommaEnabled(options, "arrays"))
                parts.push(",");
              if (!oneLine_3)
                parts.push("\n");
            }
          }, "types");
          if (oneLine_3 && options.arrayBracketSpacing) {
            parts.push(" ]");
          } else {
            parts.push("]");
          }
          return (0, lines_1.concat)(parts);
        }
        case "BooleanTypeAnnotation":
          return (0, lines_1.fromString)("boolean", options);
        case "BooleanLiteralTypeAnnotation":
          (0, tiny_invariant_1.default)(typeof n9.value === "boolean");
          return (0, lines_1.fromString)("" + n9.value, options);
        case "InterfaceTypeAnnotation":
          parts.push("interface");
          if (n9.extends && n9.extends.length > 0) {
            parts.push(" extends ", (0, lines_1.fromString)(", ").join(path84.map(print2, "extends")));
          }
          parts.push(" ", path84.call(print2, "body"));
          return (0, lines_1.concat)(parts);
        case "DeclareFunction":
          return printFlowDeclaration(path84, [
            "function ",
            path84.call(print2, "id"),
            ";"
          ]);
        case "DeclareModule":
          return printFlowDeclaration(path84, [
            "module ",
            path84.call(print2, "id"),
            " ",
            path84.call(print2, "body")
          ]);
        case "DeclareModuleExports":
          return printFlowDeclaration(path84, [
            "module.exports",
            path84.call(print2, "typeAnnotation")
          ]);
        case "DeclareVariable":
          return printFlowDeclaration(path84, ["var ", path84.call(print2, "id"), ";"]);
        case "DeclareExportDeclaration":
        case "DeclareExportAllDeclaration":
          return (0, lines_1.concat)(["declare ", printExportDeclaration(path84, options, print2)]);
        case "EnumDeclaration":
          return (0, lines_1.concat)([
            "enum ",
            path84.call(print2, "id"),
            path84.call(print2, "body")
          ]);
        case "EnumBooleanBody":
        case "EnumNumberBody":
        case "EnumStringBody":
        case "EnumSymbolBody": {
          if (n9.type === "EnumSymbolBody" || n9.explicitType) {
            parts.push(
              " of ",
              // EnumBooleanBody => boolean, etc.
              n9.type.slice(4, -4).toLowerCase()
            );
          }
          parts.push(" {\n", (0, lines_1.fromString)("\n").join(path84.map(print2, "members")).indent(options.tabWidth), "\n}");
          return (0, lines_1.concat)(parts);
        }
        case "EnumDefaultedMember":
          return (0, lines_1.concat)([path84.call(print2, "id"), ","]);
        case "EnumBooleanMember":
        case "EnumNumberMember":
        case "EnumStringMember":
          return (0, lines_1.concat)([
            path84.call(print2, "id"),
            " = ",
            path84.call(print2, "init"),
            ","
          ]);
        case "InferredPredicate":
          return (0, lines_1.fromString)("%checks", options);
        case "DeclaredPredicate":
          return (0, lines_1.concat)(["%checks(", path84.call(print2, "value"), ")"]);
        case "FunctionTypeAnnotation": {
          var parent = path84.getParentNode(0);
          var isArrowFunctionTypeAnnotation = !(namedTypes.ObjectTypeCallProperty.check(parent) || namedTypes.ObjectTypeInternalSlot.check(parent) && parent.method || namedTypes.DeclareFunction.check(path84.getParentNode(2)));
          var needsColon = isArrowFunctionTypeAnnotation && !namedTypes.FunctionTypeParam.check(parent) && !namedTypes.TypeAlias.check(parent);
          if (needsColon) {
            parts.push(": ");
          }
          var hasTypeParameters = !!n9.typeParameters;
          var needsParens = hasTypeParameters || n9.params.length !== 1 || n9.params[0].name;
          parts.push(hasTypeParameters ? path84.call(print2, "typeParameters") : "", needsParens ? "(" : "", printFunctionParams(path84, options, print2), needsParens ? ")" : "");
          if (n9.returnType) {
            parts.push(isArrowFunctionTypeAnnotation ? " => " : ": ", path84.call(print2, "returnType"));
          }
          return (0, lines_1.concat)(parts);
        }
        case "FunctionTypeParam": {
          var name2 = path84.call(print2, "name");
          parts.push(name2);
          if (n9.optional) {
            parts.push("?");
          }
          if (name2.infos[0].line) {
            parts.push(": ");
          }
          parts.push(path84.call(print2, "typeAnnotation"));
          return (0, lines_1.concat)(parts);
        }
        case "GenericTypeAnnotation":
          return (0, lines_1.concat)([
            path84.call(print2, "id"),
            path84.call(print2, "typeParameters")
          ]);
        case "DeclareInterface":
          parts.push("declare ");
        // Fall through to InterfaceDeclaration...
        case "InterfaceDeclaration":
        case "TSInterfaceDeclaration":
          if (n9.declare) {
            parts.push("declare ");
          }
          parts.push("interface ", path84.call(print2, "id"), path84.call(print2, "typeParameters"), " ");
          if (n9["extends"] && n9["extends"].length > 0) {
            parts.push("extends ", (0, lines_1.fromString)(", ").join(path84.map(print2, "extends")), " ");
          }
          if (n9.body) {
            parts.push(path84.call(print2, "body"));
          }
          return (0, lines_1.concat)(parts);
        case "ClassImplements":
        case "InterfaceExtends":
          return (0, lines_1.concat)([
            path84.call(print2, "id"),
            path84.call(print2, "typeParameters")
          ]);
        case "IntersectionTypeAnnotation":
          return (0, lines_1.fromString)(" & ").join(path84.map(print2, "types"));
        case "NullableTypeAnnotation":
          return (0, lines_1.concat)(["?", path84.call(print2, "typeAnnotation")]);
        case "NullLiteralTypeAnnotation":
          return (0, lines_1.fromString)("null", options);
        case "ThisTypeAnnotation":
          return (0, lines_1.fromString)("this", options);
        case "NumberTypeAnnotation":
          return (0, lines_1.fromString)("number", options);
        case "ObjectTypeCallProperty":
          return path84.call(print2, "value");
        case "ObjectTypeIndexer":
          if (n9.static) {
            parts.push("static ");
          }
          parts.push(printVariance(path84, print2), "[");
          if (n9.id) {
            parts.push(path84.call(print2, "id"), ": ");
          }
          parts.push(path84.call(print2, "key"), "]: ", path84.call(print2, "value"));
          return (0, lines_1.concat)(parts);
        case "ObjectTypeProperty":
          return (0, lines_1.concat)([
            printVariance(path84, print2),
            path84.call(print2, "key"),
            n9.optional ? "?" : "",
            ": ",
            path84.call(print2, "value")
          ]);
        case "ObjectTypeInternalSlot":
          return (0, lines_1.concat)([
            n9.static ? "static " : "",
            "[[",
            path84.call(print2, "id"),
            "]]",
            n9.optional ? "?" : "",
            n9.value.type !== "FunctionTypeAnnotation" ? ": " : "",
            path84.call(print2, "value")
          ]);
        case "QualifiedTypeIdentifier":
          return (0, lines_1.concat)([
            path84.call(print2, "qualification"),
            ".",
            path84.call(print2, "id")
          ]);
        case "StringLiteralTypeAnnotation":
          return (0, lines_1.fromString)(nodeStr(n9.value, options), options);
        case "NumberLiteralTypeAnnotation":
        case "NumericLiteralTypeAnnotation":
          (0, tiny_invariant_1.default)(typeof n9.value === "number");
          return (0, lines_1.fromString)(JSON.stringify(n9.value), options);
        case "BigIntLiteralTypeAnnotation":
          return (0, lines_1.fromString)(n9.raw, options);
        case "StringTypeAnnotation":
          return (0, lines_1.fromString)("string", options);
        case "DeclareTypeAlias":
          parts.push("declare ");
        // Fall through to TypeAlias...
        case "TypeAlias":
          return (0, lines_1.concat)([
            "type ",
            path84.call(print2, "id"),
            path84.call(print2, "typeParameters"),
            " = ",
            path84.call(print2, "right"),
            ";"
          ]);
        case "DeclareOpaqueType":
          parts.push("declare ");
        // Fall through to OpaqueType...
        case "OpaqueType":
          parts.push("opaque type ", path84.call(print2, "id"), path84.call(print2, "typeParameters"));
          if (n9["supertype"]) {
            parts.push(": ", path84.call(print2, "supertype"));
          }
          if (n9["impltype"]) {
            parts.push(" = ", path84.call(print2, "impltype"));
          }
          parts.push(";");
          return (0, lines_1.concat)(parts);
        case "TypeCastExpression":
          return (0, lines_1.concat)([
            "(",
            path84.call(print2, "expression"),
            path84.call(print2, "typeAnnotation"),
            ")"
          ]);
        case "TypeParameterDeclaration":
        case "TypeParameterInstantiation":
          return (0, lines_1.concat)([
            "<",
            (0, lines_1.fromString)(", ").join(path84.map(print2, "params")),
            ">"
          ]);
        case "Variance":
          if (n9.kind === "plus") {
            return (0, lines_1.fromString)("+");
          }
          if (n9.kind === "minus") {
            return (0, lines_1.fromString)("-");
          }
          return (0, lines_1.fromString)("");
        case "TypeParameter":
          if (n9.variance) {
            parts.push(printVariance(path84, print2));
          }
          parts.push(path84.call(print2, "name"));
          if (n9.bound) {
            parts.push(path84.call(print2, "bound"));
          }
          if (n9["default"]) {
            parts.push("=", path84.call(print2, "default"));
          }
          return (0, lines_1.concat)(parts);
        case "TypeofTypeAnnotation":
          return (0, lines_1.concat)([
            (0, lines_1.fromString)("typeof ", options),
            path84.call(print2, "argument")
          ]);
        case "IndexedAccessType":
        case "OptionalIndexedAccessType":
          return (0, lines_1.concat)([
            path84.call(print2, "objectType"),
            n9.optional ? "?." : "",
            "[",
            path84.call(print2, "indexType"),
            "]"
          ]);
        case "UnionTypeAnnotation":
          return (0, lines_1.fromString)(" | ").join(path84.map(print2, "types"));
        case "VoidTypeAnnotation":
          return (0, lines_1.fromString)("void", options);
        case "NullTypeAnnotation":
          return (0, lines_1.fromString)("null", options);
        case "SymbolTypeAnnotation":
          return (0, lines_1.fromString)("symbol", options);
        case "BigIntTypeAnnotation":
          return (0, lines_1.fromString)("bigint", options);
        // Type Annotations for TypeScript (when using Babylon as parser)
        case "TSType":
          throw new Error("unprintable type: " + JSON.stringify(n9.type));
        case "TSNumberKeyword":
          return (0, lines_1.fromString)("number", options);
        case "TSBigIntKeyword":
          return (0, lines_1.fromString)("bigint", options);
        case "TSObjectKeyword":
          return (0, lines_1.fromString)("object", options);
        case "TSBooleanKeyword":
          return (0, lines_1.fromString)("boolean", options);
        case "TSStringKeyword":
          return (0, lines_1.fromString)("string", options);
        case "TSSymbolKeyword":
          return (0, lines_1.fromString)("symbol", options);
        case "TSAnyKeyword":
          return (0, lines_1.fromString)("any", options);
        case "TSVoidKeyword":
          return (0, lines_1.fromString)("void", options);
        case "TSIntrinsicKeyword":
          return (0, lines_1.fromString)("intrinsic", options);
        case "TSThisType":
          return (0, lines_1.fromString)("this", options);
        case "TSNullKeyword":
          return (0, lines_1.fromString)("null", options);
        case "TSUndefinedKeyword":
          return (0, lines_1.fromString)("undefined", options);
        case "TSUnknownKeyword":
          return (0, lines_1.fromString)("unknown", options);
        case "TSNeverKeyword":
          return (0, lines_1.fromString)("never", options);
        case "TSArrayType":
          return (0, lines_1.concat)([path84.call(print2, "elementType"), "[]"]);
        case "TSLiteralType":
          return path84.call(print2, "literal");
        case "TSUnionType":
          return (0, lines_1.fromString)(" | ").join(path84.map(print2, "types"));
        case "TSIntersectionType":
          return (0, lines_1.fromString)(" & ").join(path84.map(print2, "types"));
        case "TSConditionalType":
          parts.push(path84.call(print2, "checkType"), " extends ", path84.call(print2, "extendsType"), " ? ", path84.call(print2, "trueType"), " : ", path84.call(print2, "falseType"));
          return (0, lines_1.concat)(parts);
        case "TSInferType":
          parts.push("infer ", path84.call(print2, "typeParameter"));
          return (0, lines_1.concat)(parts);
        case "TSParenthesizedType":
          return (0, lines_1.concat)(["(", path84.call(print2, "typeAnnotation"), ")"]);
        case "TSFunctionType":
          return (0, lines_1.concat)([
            path84.call(print2, "typeParameters"),
            "(",
            printFunctionParams(path84, options, print2),
            ") => ",
            path84.call(print2, "typeAnnotation", "typeAnnotation")
          ]);
        case "TSConstructorType":
          return (0, lines_1.concat)([
            "new ",
            path84.call(print2, "typeParameters"),
            "(",
            printFunctionParams(path84, options, print2),
            ") => ",
            path84.call(print2, "typeAnnotation", "typeAnnotation")
          ]);
        case "TSMappedType": {
          parts.push(n9.readonly ? "readonly " : "", "[", path84.call(print2, "typeParameter"), "]", n9.optional ? "?" : "");
          if (n9.typeAnnotation) {
            parts.push(": ", path84.call(print2, "typeAnnotation"), ";");
          }
          return (0, lines_1.concat)(["{\n", (0, lines_1.concat)(parts).indent(options.tabWidth), "\n}"]);
        }
        case "TSTupleType":
          return (0, lines_1.concat)([
            "[",
            (0, lines_1.fromString)(", ").join(path84.map(print2, "elementTypes")),
            "]"
          ]);
        case "TSNamedTupleMember":
          parts.push(path84.call(print2, "label"));
          if (n9.optional) {
            parts.push("?");
          }
          parts.push(": ", path84.call(print2, "elementType"));
          return (0, lines_1.concat)(parts);
        case "TSRestType":
          return (0, lines_1.concat)(["...", path84.call(print2, "typeAnnotation")]);
        case "TSOptionalType":
          return (0, lines_1.concat)([path84.call(print2, "typeAnnotation"), "?"]);
        case "TSIndexedAccessType":
          return (0, lines_1.concat)([
            path84.call(print2, "objectType"),
            "[",
            path84.call(print2, "indexType"),
            "]"
          ]);
        case "TSTypeOperator":
          return (0, lines_1.concat)([
            path84.call(print2, "operator"),
            " ",
            path84.call(print2, "typeAnnotation")
          ]);
        case "TSTypeLiteral": {
          var members = (0, lines_1.fromString)("\n").join(path84.map(print2, "members").map(function(member) {
            if (lastNonSpaceCharacter(member) !== ";") {
              return member.concat(";");
            }
            return member;
          }));
          if (members.isEmpty()) {
            return (0, lines_1.fromString)("{}", options);
          }
          parts.push("{\n", members.indent(options.tabWidth), "\n}");
          return (0, lines_1.concat)(parts);
        }
        case "TSEnumMember":
          parts.push(path84.call(print2, "id"));
          if (n9.initializer) {
            parts.push(" = ", path84.call(print2, "initializer"));
          }
          return (0, lines_1.concat)(parts);
        case "TSTypeQuery":
          return (0, lines_1.concat)(["typeof ", path84.call(print2, "exprName")]);
        case "TSParameterProperty":
          if (n9.accessibility) {
            parts.push(n9.accessibility, " ");
          }
          if (n9.export) {
            parts.push("export ");
          }
          if (n9.static) {
            parts.push("static ");
          }
          if (n9.readonly) {
            parts.push("readonly ");
          }
          parts.push(path84.call(print2, "parameter"));
          return (0, lines_1.concat)(parts);
        case "TSTypeReference":
          return (0, lines_1.concat)([
            path84.call(print2, "typeName"),
            path84.call(print2, "typeParameters")
          ]);
        case "TSQualifiedName":
          return (0, lines_1.concat)([path84.call(print2, "left"), ".", path84.call(print2, "right")]);
        case "TSAsExpression":
        case "TSSatisfiesExpression": {
          var expression = path84.call(print2, "expression");
          parts.push(expression, n9.type === "TSSatisfiesExpression" ? " satisfies " : " as ", path84.call(print2, "typeAnnotation"));
          return (0, lines_1.concat)(parts);
        }
        case "TSTypeCastExpression":
          return (0, lines_1.concat)([
            path84.call(print2, "expression"),
            path84.call(print2, "typeAnnotation")
          ]);
        case "TSNonNullExpression":
          return (0, lines_1.concat)([path84.call(print2, "expression"), "!"]);
        case "TSTypeAnnotation":
          return (0, lines_1.concat)([": ", path84.call(print2, "typeAnnotation")]);
        case "TSIndexSignature":
          return (0, lines_1.concat)([
            n9.readonly ? "readonly " : "",
            "[",
            path84.map(print2, "parameters"),
            "]",
            path84.call(print2, "typeAnnotation")
          ]);
        case "TSPropertySignature":
          parts.push(printVariance(path84, print2), n9.readonly ? "readonly " : "");
          if (n9.computed) {
            parts.push("[", path84.call(print2, "key"), "]");
          } else {
            parts.push(path84.call(print2, "key"));
          }
          parts.push(n9.optional ? "?" : "", path84.call(print2, "typeAnnotation"));
          return (0, lines_1.concat)(parts);
        case "TSMethodSignature":
          if (n9.kind === "get") {
            parts.push("get ");
          } else if (n9.kind === "set") {
            parts.push("set ");
          }
          if (n9.computed) {
            parts.push("[", path84.call(print2, "key"), "]");
          } else {
            parts.push(path84.call(print2, "key"));
          }
          if (n9.optional) {
            parts.push("?");
          }
          parts.push(path84.call(print2, "typeParameters"), "(", printFunctionParams(path84, options, print2), ")", path84.call(print2, "typeAnnotation"));
          return (0, lines_1.concat)(parts);
        case "TSTypePredicate":
          if (n9.asserts) {
            parts.push("asserts ");
          }
          parts.push(path84.call(print2, "parameterName"));
          if (n9.typeAnnotation) {
            parts.push(" is ", path84.call(print2, "typeAnnotation", "typeAnnotation"));
          }
          return (0, lines_1.concat)(parts);
        case "TSCallSignatureDeclaration":
          return (0, lines_1.concat)([
            path84.call(print2, "typeParameters"),
            "(",
            printFunctionParams(path84, options, print2),
            ")",
            path84.call(print2, "typeAnnotation")
          ]);
        case "TSConstructSignatureDeclaration":
          if (n9.typeParameters) {
            parts.push("new", path84.call(print2, "typeParameters"));
          } else {
            parts.push("new ");
          }
          parts.push("(", printFunctionParams(path84, options, print2), ")", path84.call(print2, "typeAnnotation"));
          return (0, lines_1.concat)(parts);
        case "TSTypeAliasDeclaration":
          return (0, lines_1.concat)([
            n9.declare ? "declare " : "",
            "type ",
            path84.call(print2, "id"),
            path84.call(print2, "typeParameters"),
            " = ",
            path84.call(print2, "typeAnnotation"),
            ";"
          ]);
        case "TSTypeParameter": {
          parts.push(path84.call(print2, "name"));
          var parent = path84.getParentNode(0);
          var isInMappedType = namedTypes.TSMappedType.check(parent);
          if (n9.constraint) {
            parts.push(isInMappedType ? " in " : " extends ", path84.call(print2, "constraint"));
          }
          if (n9["default"]) {
            parts.push(" = ", path84.call(print2, "default"));
          }
          return (0, lines_1.concat)(parts);
        }
        case "TSTypeAssertion": {
          parts.push("<", path84.call(print2, "typeAnnotation"), "> ", path84.call(print2, "expression"));
          return (0, lines_1.concat)(parts);
        }
        case "TSTypeParameterDeclaration":
        case "TSTypeParameterInstantiation":
          return (0, lines_1.concat)([
            "<",
            (0, lines_1.fromString)(", ").join(path84.map(print2, "params")),
            ">"
          ]);
        case "TSEnumDeclaration": {
          parts.push(n9.declare ? "declare " : "", n9.const ? "const " : "", "enum ", path84.call(print2, "id"));
          var memberLines = (0, lines_1.fromString)(",\n").join(path84.map(print2, "members"));
          if (memberLines.isEmpty()) {
            parts.push(" {}");
          } else {
            parts.push(" {\n", memberLines.indent(options.tabWidth), "\n}");
          }
          return (0, lines_1.concat)(parts);
        }
        case "TSExpressionWithTypeArguments":
          return (0, lines_1.concat)([
            path84.call(print2, "expression"),
            path84.call(print2, "typeParameters")
          ]);
        case "TSInterfaceBody": {
          var lines = (0, lines_1.fromString)("\n").join(path84.map(print2, "body").map(function(element) {
            if (lastNonSpaceCharacter(element) !== ";") {
              return element.concat(";");
            }
            return element;
          }));
          if (lines.isEmpty()) {
            return (0, lines_1.fromString)("{}", options);
          }
          return (0, lines_1.concat)(["{\n", lines.indent(options.tabWidth), "\n}"]);
        }
        case "TSImportType":
          parts.push("import(", path84.call(print2, "argument"), ")");
          if (n9.qualifier) {
            parts.push(".", path84.call(print2, "qualifier"));
          }
          if (n9.typeParameters) {
            parts.push(path84.call(print2, "typeParameters"));
          }
          return (0, lines_1.concat)(parts);
        case "TSImportEqualsDeclaration":
          if (n9.isExport) {
            parts.push("export ");
          }
          parts.push("import ", path84.call(print2, "id"), " = ", path84.call(print2, "moduleReference"));
          return maybeAddSemicolon((0, lines_1.concat)(parts));
        case "TSExternalModuleReference":
          return (0, lines_1.concat)(["require(", path84.call(print2, "expression"), ")"]);
        case "TSModuleDeclaration": {
          var parent = path84.getParentNode();
          if (parent.type === "TSModuleDeclaration") {
            parts.push(".");
          } else {
            if (n9.declare) {
              parts.push("declare ");
            }
            if (!n9.global) {
              var isExternal = n9.id.type === "StringLiteral" || n9.id.type === "Literal" && typeof n9.id.value === "string";
              if (isExternal) {
                parts.push("module ");
              } else if (n9.loc && n9.loc.lines && n9.id.loc) {
                var prefix = n9.loc.lines.sliceString(n9.loc.start, n9.id.loc.start);
                if (prefix.indexOf("module") >= 0) {
                  parts.push("module ");
                } else {
                  parts.push("namespace ");
                }
              } else {
                parts.push("namespace ");
              }
            }
          }
          parts.push(path84.call(print2, "id"));
          if (n9.body) {
            parts.push(" ");
            parts.push(path84.call(print2, "body"));
          }
          return (0, lines_1.concat)(parts);
        }
        case "TSModuleBlock": {
          var naked = path84.call(function(bodyPath) {
            return printStatementSequence(bodyPath, options, print2);
          }, "body");
          if (naked.isEmpty()) {
            parts.push("{}");
          } else {
            parts.push("{\n", naked.indent(options.tabWidth), "\n}");
          }
          return (0, lines_1.concat)(parts);
        }
        case "TSInstantiationExpression": {
          parts.push(path84.call(print2, "expression"), path84.call(print2, "typeParameters"));
          return (0, lines_1.concat)(parts);
        }
        // https://github.com/babel/babel/pull/10148
        case "V8IntrinsicIdentifier":
          return (0, lines_1.concat)(["%", path84.call(print2, "name")]);
        // https://github.com/babel/babel/pull/13191
        case "TopicReference":
          return (0, lines_1.fromString)("#");
        // Unhandled types below. If encountered, nodes of these types should
        // be either left alone or desugared into AST types that are fully
        // supported by the pretty-printer.
        case "ClassHeritage":
        // TODO
        case "ComprehensionBlock":
        // TODO
        case "ComprehensionExpression":
        // TODO
        case "Glob":
        // TODO
        case "GeneratorExpression":
        // TODO
        case "LetStatement":
        // TODO
        case "LetExpression":
        // TODO
        case "GraphExpression":
        // TODO
        case "GraphIndexExpression":
        // TODO
        case "XMLDefaultDeclaration":
        case "XMLAnyName":
        case "XMLQualifiedIdentifier":
        case "XMLFunctionQualifiedIdentifier":
        case "XMLAttributeSelector":
        case "XMLFilterExpression":
        case "XML":
        case "XMLElement":
        case "XMLList":
        case "XMLEscape":
        case "XMLText":
        case "XMLStartTag":
        case "XMLEndTag":
        case "XMLPointTag":
        case "XMLName":
        case "XMLAttribute":
        case "XMLCdata":
        case "XMLComment":
        case "XMLProcessingInstruction":
        default:
          debugger;
          throw new Error("unknown type: " + JSON.stringify(n9.type));
      }
    }
    __name(genericPrintNoParens, "genericPrintNoParens");
    function printDecorators(path84, printPath) {
      var parts = [];
      var node2 = path84.getValue();
      if (node2.decorators && node2.decorators.length > 0 && // If the parent node is an export declaration, it will be
      // responsible for printing node.decorators.
      !util5.getParentExportDeclaration(path84)) {
        path84.each(function(decoratorPath) {
          parts.push(printPath(decoratorPath), "\n");
        }, "decorators");
      } else if (util5.isExportDeclaration(node2) && node2.declaration && node2.declaration.decorators) {
        path84.each(function(decoratorPath) {
          parts.push(printPath(decoratorPath), "\n");
        }, "declaration", "decorators");
      }
      return (0, lines_1.concat)(parts);
    }
    __name(printDecorators, "printDecorators");
    function printStatementSequence(path84, options, print2) {
      var filtered = [];
      var sawComment = false;
      var sawStatement = false;
      path84.each(function(stmtPath) {
        var stmt = stmtPath.getValue();
        if (!stmt) {
          return;
        }
        if (stmt.type === "EmptyStatement" && !(stmt.comments && stmt.comments.length > 0)) {
          return;
        }
        if (namedTypes.Comment.check(stmt)) {
          sawComment = true;
        } else if (namedTypes.Statement.check(stmt)) {
          sawStatement = true;
        } else {
          isString5.assert(stmt);
        }
        filtered.push({
          node: stmt,
          printed: print2(stmtPath)
        });
      });
      if (sawComment) {
        (0, tiny_invariant_1.default)(sawStatement === false, "Comments may appear as statements in otherwise empty statement lists, but may not coexist with non-Comment nodes.");
      }
      var prevTrailingSpace = null;
      var len = filtered.length;
      var parts = [];
      filtered.forEach(function(info, i7) {
        var printed = info.printed;
        var stmt = info.node;
        var multiLine = printed.length > 1;
        var notFirst = i7 > 0;
        var notLast = i7 < len - 1;
        var leadingSpace;
        var trailingSpace;
        var lines = stmt && stmt.loc && stmt.loc.lines;
        var trueLoc = lines && options.reuseWhitespace && util5.getTrueLoc(stmt, lines);
        if (notFirst) {
          if (trueLoc) {
            var beforeStart = lines.skipSpaces(trueLoc.start, true);
            var beforeStartLine = beforeStart ? beforeStart.line : 1;
            var leadingGap = trueLoc.start.line - beforeStartLine;
            leadingSpace = Array(leadingGap + 1).join("\n");
          } else {
            leadingSpace = multiLine ? "\n\n" : "\n";
          }
        } else {
          leadingSpace = "";
        }
        if (notLast) {
          if (trueLoc) {
            var afterEnd = lines.skipSpaces(trueLoc.end);
            var afterEndLine = afterEnd ? afterEnd.line : lines.length;
            var trailingGap = afterEndLine - trueLoc.end.line;
            trailingSpace = Array(trailingGap + 1).join("\n");
          } else {
            trailingSpace = multiLine ? "\n\n" : "\n";
          }
        } else {
          trailingSpace = "";
        }
        parts.push(maxSpace(prevTrailingSpace, leadingSpace), printed);
        if (notLast) {
          prevTrailingSpace = trailingSpace;
        } else if (trailingSpace) {
          parts.push(trailingSpace);
        }
      });
      return (0, lines_1.concat)(parts);
    }
    __name(printStatementSequence, "printStatementSequence");
    function maxSpace(s1, s22) {
      if (!s1 && !s22) {
        return (0, lines_1.fromString)("");
      }
      if (!s1) {
        return (0, lines_1.fromString)(s22);
      }
      if (!s22) {
        return (0, lines_1.fromString)(s1);
      }
      var spaceLines1 = (0, lines_1.fromString)(s1);
      var spaceLines2 = (0, lines_1.fromString)(s22);
      if (spaceLines2.length > spaceLines1.length) {
        return spaceLines2;
      }
      return spaceLines1;
    }
    __name(maxSpace, "maxSpace");
    function printClassMemberModifiers(node2) {
      var parts = [];
      if (node2.declare) {
        parts.push("declare ");
      }
      var access4 = node2.accessibility || node2.access;
      if (typeof access4 === "string") {
        parts.push(access4, " ");
      }
      if (node2.static) {
        parts.push("static ");
      }
      if (node2.override) {
        parts.push("override ");
      }
      if (node2.abstract) {
        parts.push("abstract ");
      }
      if (node2.readonly) {
        parts.push("readonly ");
      }
      return parts;
    }
    __name(printClassMemberModifiers, "printClassMemberModifiers");
    function printMethod(path84, options, print2) {
      var node2 = path84.getNode();
      var kind2 = node2.kind;
      var parts = [];
      var nodeValue = node2.value;
      if (!namedTypes.FunctionExpression.check(nodeValue)) {
        nodeValue = node2;
      }
      parts.push.apply(parts, printClassMemberModifiers(node2));
      if (nodeValue.async) {
        parts.push("async ");
      }
      if (nodeValue.generator) {
        parts.push("*");
      }
      if (kind2 === "get" || kind2 === "set") {
        parts.push(kind2, " ");
      }
      var key = path84.call(print2, "key");
      if (node2.computed) {
        key = (0, lines_1.concat)(["[", key, "]"]);
      }
      parts.push(key);
      if (node2.optional) {
        parts.push("?");
      }
      if (node2 === nodeValue) {
        parts.push(path84.call(print2, "typeParameters"), "(", printFunctionParams(path84, options, print2), ")", path84.call(print2, "returnType"));
        if (node2.body) {
          parts.push(" ", path84.call(print2, "body"));
        } else {
          parts.push(";");
        }
      } else {
        parts.push(path84.call(print2, "value", "typeParameters"), "(", path84.call(function(valuePath) {
          return printFunctionParams(valuePath, options, print2);
        }, "value"), ")", path84.call(print2, "value", "returnType"));
        if (nodeValue.body) {
          parts.push(" ", path84.call(print2, "value", "body"));
        } else {
          parts.push(";");
        }
      }
      return (0, lines_1.concat)(parts);
    }
    __name(printMethod, "printMethod");
    function printArgumentsList(path84, options, print2) {
      var printed = path84.map(print2, "arguments");
      var trailingComma = util5.isTrailingCommaEnabled(options, "parameters");
      var joined = (0, lines_1.fromString)(", ").join(printed);
      if (joined.getLineLength(1) > options.wrapColumn) {
        joined = (0, lines_1.fromString)(",\n").join(printed);
        return (0, lines_1.concat)([
          "(\n",
          joined.indent(options.tabWidth),
          trailingComma ? ",\n)" : "\n)"
        ]);
      }
      return (0, lines_1.concat)(["(", joined, ")"]);
    }
    __name(printArgumentsList, "printArgumentsList");
    function printFunctionParams(path84, options, print2) {
      var fun = path84.getValue();
      var params;
      var printed = [];
      if (fun.params) {
        params = fun.params;
        printed = path84.map(print2, "params");
      } else if (fun.parameters) {
        params = fun.parameters;
        printed = path84.map(print2, "parameters");
      }
      if (fun.defaults) {
        path84.each(function(defExprPath) {
          var i7 = defExprPath.getName();
          var p7 = printed[i7];
          if (p7 && defExprPath.getValue()) {
            printed[i7] = (0, lines_1.concat)([p7, " = ", print2(defExprPath)]);
          }
        }, "defaults");
      }
      if (fun.rest) {
        printed.push((0, lines_1.concat)(["...", path84.call(print2, "rest")]));
      }
      var joined = (0, lines_1.fromString)(", ").join(printed);
      if (joined.length > 1 || joined.getLineLength(1) > options.wrapColumn) {
        joined = (0, lines_1.fromString)(",\n").join(printed);
        if (util5.isTrailingCommaEnabled(options, "parameters") && !fun.rest && params[params.length - 1].type !== "RestElement") {
          joined = (0, lines_1.concat)([joined, ",\n"]);
        } else {
          joined = (0, lines_1.concat)([joined, "\n"]);
        }
        return (0, lines_1.concat)(["\n", joined.indent(options.tabWidth)]);
      }
      return joined;
    }
    __name(printFunctionParams, "printFunctionParams");
    function maybePrintImportAssertions(path84, options, print2) {
      var n9 = path84.getValue();
      if (n9.assertions && n9.assertions.length > 0) {
        var parts = [" assert {"];
        var printed = path84.map(print2, "assertions");
        var flat = (0, lines_1.fromString)(", ").join(printed);
        if (flat.length > 1 || flat.getLineLength(1) > options.wrapColumn) {
          parts.push("\n", (0, lines_1.fromString)(",\n").join(printed).indent(options.tabWidth), "\n}");
        } else {
          parts.push(" ", flat, " }");
        }
        return (0, lines_1.concat)(parts);
      }
      return (0, lines_1.fromString)("");
    }
    __name(maybePrintImportAssertions, "maybePrintImportAssertions");
    function printExportDeclaration(path84, options, print2) {
      var decl = path84.getValue();
      var parts = ["export "];
      if (decl.exportKind && decl.exportKind === "type") {
        if (!decl.declaration) {
          parts.push("type ");
        }
      }
      var shouldPrintSpaces = options.objectCurlySpacing;
      namedTypes.Declaration.assert(decl);
      if (decl["default"] || decl.type === "ExportDefaultDeclaration") {
        parts.push("default ");
      }
      if (decl.declaration) {
        parts.push(path84.call(print2, "declaration"));
      } else if (decl.specifiers) {
        if (decl.specifiers.length === 1 && decl.specifiers[0].type === "ExportBatchSpecifier") {
          parts.push("*");
        } else if (decl.specifiers.length === 0) {
          parts.push("{}");
        } else if (decl.specifiers[0].type === "ExportDefaultSpecifier" || decl.specifiers[0].type === "ExportNamespaceSpecifier") {
          var unbracedSpecifiers_2 = [];
          var bracedSpecifiers_2 = [];
          path84.each(function(specifierPath) {
            var spec = specifierPath.getValue();
            if (spec.type === "ExportDefaultSpecifier" || spec.type === "ExportNamespaceSpecifier") {
              unbracedSpecifiers_2.push(print2(specifierPath));
            } else {
              bracedSpecifiers_2.push(print2(specifierPath));
            }
          }, "specifiers");
          unbracedSpecifiers_2.forEach(function(lines2, i7) {
            if (i7 > 0) {
              parts.push(", ");
            }
            parts.push(lines2);
          });
          if (bracedSpecifiers_2.length > 0) {
            var lines_2 = (0, lines_1.fromString)(", ").join(bracedSpecifiers_2);
            if (lines_2.getLineLength(1) > options.wrapColumn) {
              lines_2 = (0, lines_1.concat)([
                (0, lines_1.fromString)(",\n").join(bracedSpecifiers_2).indent(options.tabWidth),
                ","
              ]);
            }
            if (unbracedSpecifiers_2.length > 0) {
              parts.push(", ");
            }
            if (lines_2.length > 1) {
              parts.push("{\n", lines_2, "\n}");
            } else if (options.objectCurlySpacing) {
              parts.push("{ ", lines_2, " }");
            } else {
              parts.push("{", lines_2, "}");
            }
          }
        } else {
          parts.push(shouldPrintSpaces ? "{ " : "{", (0, lines_1.fromString)(", ").join(path84.map(print2, "specifiers")), shouldPrintSpaces ? " }" : "}");
        }
        if (decl.source) {
          parts.push(" from ", path84.call(print2, "source"), maybePrintImportAssertions(path84, options, print2));
        }
      }
      var lines = (0, lines_1.concat)(parts);
      if (lastNonSpaceCharacter(lines) !== ";" && !(decl.declaration && (decl.declaration.type === "FunctionDeclaration" || decl.declaration.type === "ClassDeclaration" || decl.declaration.type === "TSModuleDeclaration" || decl.declaration.type === "TSInterfaceDeclaration" || decl.declaration.type === "TSEnumDeclaration"))) {
        lines = (0, lines_1.concat)([lines, ";"]);
      }
      return lines;
    }
    __name(printExportDeclaration, "printExportDeclaration");
    function printFlowDeclaration(path84, parts) {
      var parentExportDecl = util5.getParentExportDeclaration(path84);
      if (parentExportDecl) {
        (0, tiny_invariant_1.default)(parentExportDecl.type === "DeclareExportDeclaration");
      } else {
        parts.unshift("declare ");
      }
      return (0, lines_1.concat)(parts);
    }
    __name(printFlowDeclaration, "printFlowDeclaration");
    function printVariance(path84, print2) {
      return path84.call(function(variancePath) {
        var value = variancePath.getValue();
        if (value) {
          if (value === "plus") {
            return (0, lines_1.fromString)("+");
          }
          if (value === "minus") {
            return (0, lines_1.fromString)("-");
          }
          return print2(variancePath);
        }
        return (0, lines_1.fromString)("");
      }, "variance");
    }
    __name(printVariance, "printVariance");
    function adjustClause(clause, options) {
      if (clause.length > 1)
        return (0, lines_1.concat)([" ", clause]);
      return (0, lines_1.concat)(["\n", maybeAddSemicolon(clause).indent(options.tabWidth)]);
    }
    __name(adjustClause, "adjustClause");
    function lastNonSpaceCharacter(lines) {
      var pos = lines.lastPos();
      do {
        var ch2 = lines.charAt(pos);
        if (/\S/.test(ch2))
          return ch2;
      } while (lines.prevPos(pos));
    }
    __name(lastNonSpaceCharacter, "lastNonSpaceCharacter");
    function endsWithBrace(lines) {
      return lastNonSpaceCharacter(lines) === "}";
    }
    __name(endsWithBrace, "endsWithBrace");
    function swapQuotes(str) {
      return str.replace(/['"]/g, function(m7) {
        return m7 === '"' ? "'" : '"';
      });
    }
    __name(swapQuotes, "swapQuotes");
    function getPossibleRaw(node2) {
      var value = types13.getFieldValue(node2, "value");
      var extra = types13.getFieldValue(node2, "extra");
      if (extra && typeof extra.raw === "string" && value == extra.rawValue) {
        return extra.raw;
      }
      if (node2.type === "Literal") {
        var raw = node2.raw;
        if (typeof raw === "string" && value == raw) {
          return raw;
        }
      }
    }
    __name(getPossibleRaw, "getPossibleRaw");
    function jsSafeStringify(str) {
      return JSON.stringify(str).replace(/[\u2028\u2029]/g, function(m7) {
        return "\\u" + m7.charCodeAt(0).toString(16);
      });
    }
    __name(jsSafeStringify, "jsSafeStringify");
    function nodeStr(str, options) {
      isString5.assert(str);
      switch (options.quote) {
        case "auto": {
          var double = jsSafeStringify(str);
          var single = swapQuotes(jsSafeStringify(swapQuotes(str)));
          return double.length > single.length ? single : double;
        }
        case "single":
          return swapQuotes(jsSafeStringify(swapQuotes(str)));
        case "double":
        default:
          return jsSafeStringify(str);
      }
    }
    __name(nodeStr, "nodeStr");
    function maybeAddSemicolon(lines) {
      var eoc = lastNonSpaceCharacter(lines);
      if (!eoc || "\n};".indexOf(eoc) < 0)
        return (0, lines_1.concat)([lines, ";"]);
      return lines;
    }
    __name(maybeAddSemicolon, "maybeAddSemicolon");
  }
});

// ../../node_modules/.pnpm/recast@0.23.11/node_modules/recast/main.js
var require_main4 = __commonJS({
  "../../node_modules/.pnpm/recast@0.23.11/node_modules/recast/main.js"(exports) {
    init_import_meta_url();
    Object.defineProperty(exports, "__esModule", { value: true });
    exports.run = exports.prettyPrint = exports.print = exports.visit = exports.types = exports.parse = void 0;
    var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
    var fs_1 = tslib_1.__importDefault(__require("fs"));
    var types13 = tslib_1.__importStar(require_main3());
    exports.types = types13;
    var parser_1 = require_parser2();
    Object.defineProperty(exports, "parse", { enumerable: true, get: /* @__PURE__ */ __name(function() {
      return parser_1.parse;
    }, "get") });
    var printer_1 = require_printer();
    var ast_types_1 = require_main3();
    Object.defineProperty(exports, "visit", { enumerable: true, get: /* @__PURE__ */ __name(function() {
      return ast_types_1.visit;
    }, "get") });
    function print2(node2, options) {
      return new printer_1.Printer(options).print(node2);
    }
    __name(print2, "print");
    exports.print = print2;
    function prettyPrint(node2, options) {
      return new printer_1.Printer(options).printGenerically(node2);
    }
    __name(prettyPrint, "prettyPrint");
    exports.prettyPrint = prettyPrint;
    function run2(transformer, options) {
      return runFile(process.argv[2], transformer, options);
    }
    __name(run2, "run");
    exports.run = run2;
    function runFile(path84, transformer, options) {
      fs_1.default.readFile(path84, "utf-8", function(err, code) {
        if (err) {
          console.error(err);
          return;
        }
        runString(code, transformer, options);
      });
    }
    __name(runFile, "runFile");
    function defaultWriteback(output) {
      process.stdout.write(output);
    }
    __name(defaultWriteback, "defaultWriteback");
    function runString(code, transformer, options) {
      var writeback = options && options.writeback || defaultWriteback;
      transformer((0, parser_1.parse)(code, options), function(node2) {
        writeback(print2(node2, options).code);
      });
    }
    __name(runString, "runString");
  }
});

// ../../node_modules/.pnpm/recast@0.23.11/node_modules/recast/parsers/_babel_options.js
var require_babel_options = __commonJS({
  "../../node_modules/.pnpm/recast@0.23.11/node_modules/recast/parsers/_babel_options.js"(exports) {
    init_import_meta_url();
    Object.defineProperty(exports, "__esModule", { value: true });
    var util_1 = require_util10();
    function getBabelOptions(options) {
      return {
        sourceType: (0, util_1.getOption)(options, "sourceType", "module"),
        strictMode: (0, util_1.getOption)(options, "strictMode", false),
        allowImportExportEverywhere: true,
        allowReturnOutsideFunction: true,
        startLine: 1,
        tokens: true,
        plugins: [
          "asyncGenerators",
          "bigInt",
          "classPrivateMethods",
          "classPrivateProperties",
          "classProperties",
          "classStaticBlock",
          "decimal",
          "decorators-legacy",
          "doExpressions",
          "dynamicImport",
          "exportDefaultFrom",
          "exportExtensions",
          "exportNamespaceFrom",
          "functionBind",
          "functionSent",
          "importAssertions",
          "importMeta",
          "nullishCoalescingOperator",
          "numericSeparator",
          "objectRestSpread",
          "optionalCatchBinding",
          "optionalChaining",
          [
            "pipelineOperator",
            {
              proposal: "minimal"
            }
          ],
          [
            "recordAndTuple",
            {
              syntaxType: "hash"
            }
          ],
          "throwExpressions",
          "topLevelAwait",
          "v8intrinsic"
        ]
      };
    }
    __name(getBabelOptions, "getBabelOptions");
    exports.default = getBabelOptions;
  }
});

// ../../node_modules/.pnpm/@babel+parser@7.26.3/node_modules/@babel/parser/lib/index.js
var require_lib4 = __commonJS({
  "../../node_modules/.pnpm/@babel+parser@7.26.3/node_modules/@babel/parser/lib/index.js"(exports) {
    init_import_meta_url();
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    function _objectWithoutPropertiesLoose(r10, e10) {
      if (null == r10) return {};
      var t13 = {};
      for (var n9 in r10) if ({}.hasOwnProperty.call(r10, n9)) {
        if (e10.includes(n9)) continue;
        t13[n9] = r10[n9];
      }
      return t13;
    }
    __name(_objectWithoutPropertiesLoose, "_objectWithoutPropertiesLoose");
    var Position = class {
      static {
        __name(this, "Position");
      }
      constructor(line, col, index) {
        this.line = void 0;
        this.column = void 0;
        this.index = void 0;
        this.line = line;
        this.column = col;
        this.index = index;
      }
    };
    var SourceLocation = class {
      static {
        __name(this, "SourceLocation");
      }
      constructor(start, end) {
        this.start = void 0;
        this.end = void 0;
        this.filename = void 0;
        this.identifierName = void 0;
        this.start = start;
        this.end = end;
      }
    };
    function createPositionWithColumnOffset(position, columnOffset) {
      const {
        line,
        column,
        index
      } = position;
      return new Position(line, column + columnOffset, index + columnOffset);
    }
    __name(createPositionWithColumnOffset, "createPositionWithColumnOffset");
    var code = "BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED";
    var ModuleErrors = {
      ImportMetaOutsideModule: {
        message: `import.meta may appear only with 'sourceType: "module"'`,
        code
      },
      ImportOutsideModule: {
        message: `'import' and 'export' may appear only with 'sourceType: "module"'`,
        code
      }
    };
    var NodeDescriptions = {
      ArrayPattern: "array destructuring pattern",
      AssignmentExpression: "assignment expression",
      AssignmentPattern: "assignment expression",
      ArrowFunctionExpression: "arrow function expression",
      ConditionalExpression: "conditional expression",
      CatchClause: "catch clause",
      ForOfStatement: "for-of statement",
      ForInStatement: "for-in statement",
      ForStatement: "for-loop",
      FormalParameters: "function parameter list",
      Identifier: "identifier",
      ImportSpecifier: "import specifier",
      ImportDefaultSpecifier: "import default specifier",
      ImportNamespaceSpecifier: "import namespace specifier",
      ObjectPattern: "object destructuring pattern",
      ParenthesizedExpression: "parenthesized expression",
      RestElement: "rest element",
      UpdateExpression: {
        true: "prefix operation",
        false: "postfix operation"
      },
      VariableDeclarator: "variable declaration",
      YieldExpression: "yield expression"
    };
    var toNodeDescription = /* @__PURE__ */ __name((node2) => node2.type === "UpdateExpression" ? NodeDescriptions.UpdateExpression[`${node2.prefix}`] : NodeDescriptions[node2.type], "toNodeDescription");
    var StandardErrors = {
      AccessorIsGenerator: /* @__PURE__ */ __name(({
        kind: kind2
      }) => `A ${kind2}ter cannot be a generator.`, "AccessorIsGenerator"),
      ArgumentsInClass: "'arguments' is only allowed in functions and class methods.",
      AsyncFunctionInSingleStatementContext: "Async functions can only be declared at the top level or inside a block.",
      AwaitBindingIdentifier: "Can not use 'await' as identifier inside an async function.",
      AwaitBindingIdentifierInStaticBlock: "Can not use 'await' as identifier inside a static block.",
      AwaitExpressionFormalParameter: "'await' is not allowed in async function parameters.",
      AwaitUsingNotInAsyncContext: "'await using' is only allowed within async functions and at the top levels of modules.",
      AwaitNotInAsyncContext: "'await' is only allowed within async functions and at the top levels of modules.",
      AwaitNotInAsyncFunction: "'await' is only allowed within async functions.",
      BadGetterArity: "A 'get' accessor must not have any formal parameters.",
      BadSetterArity: "A 'set' accessor must have exactly one formal parameter.",
      BadSetterRestParameter: "A 'set' accessor function argument must not be a rest parameter.",
      ConstructorClassField: "Classes may not have a field named 'constructor'.",
      ConstructorClassPrivateField: "Classes may not have a private field named '#constructor'.",
      ConstructorIsAccessor: "Class constructor may not be an accessor.",
      ConstructorIsAsync: "Constructor can't be an async function.",
      ConstructorIsGenerator: "Constructor can't be a generator.",
      DeclarationMissingInitializer: /* @__PURE__ */ __name(({
        kind: kind2
      }) => `Missing initializer in ${kind2} declaration.`, "DeclarationMissingInitializer"),
      DecoratorArgumentsOutsideParentheses: "Decorator arguments must be moved inside parentheses: use '@(decorator(args))' instead of '@(decorator)(args)'.",
      DecoratorBeforeExport: "Decorators must be placed *before* the 'export' keyword. Remove the 'decoratorsBeforeExport: true' option to use the 'export @decorator class {}' syntax.",
      DecoratorsBeforeAfterExport: "Decorators can be placed *either* before or after the 'export' keyword, but not in both locations at the same time.",
      DecoratorConstructor: "Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?",
      DecoratorExportClass: "Decorators must be placed *after* the 'export' keyword. Remove the 'decoratorsBeforeExport: false' option to use the '@decorator export class {}' syntax.",
      DecoratorSemicolon: "Decorators must not be followed by a semicolon.",
      DecoratorStaticBlock: "Decorators can't be used with a static block.",
      DeferImportRequiresNamespace: 'Only `import defer * as x from "./module"` is valid.',
      DeletePrivateField: "Deleting a private field is not allowed.",
      DestructureNamedImport: "ES2015 named imports do not destructure. Use another statement for destructuring after the import.",
      DuplicateConstructor: "Duplicate constructor in the same class.",
      DuplicateDefaultExport: "Only one default export allowed per module.",
      DuplicateExport: /* @__PURE__ */ __name(({
        exportName
      }) => `\`${exportName}\` has already been exported. Exported identifiers must be unique.`, "DuplicateExport"),
      DuplicateProto: "Redefinition of __proto__ property.",
      DuplicateRegExpFlags: "Duplicate regular expression flag.",
      DynamicImportPhaseRequiresImportExpressions: /* @__PURE__ */ __name(({
        phase
      }) => `'import.${phase}(...)' can only be parsed when using the 'createImportExpressions' option.`, "DynamicImportPhaseRequiresImportExpressions"),
      ElementAfterRest: "Rest element must be last element.",
      EscapedCharNotAnIdentifier: "Invalid Unicode escape.",
      ExportBindingIsString: /* @__PURE__ */ __name(({
        localName,
        exportName
      }) => `A string literal cannot be used as an exported binding without \`from\`.
- Did you mean \`export { '${localName}' as '${exportName}' } from 'some-module'\`?`, "ExportBindingIsString"),
      ExportDefaultFromAsIdentifier: "'from' is not allowed as an identifier after 'export default'.",
      ForInOfLoopInitializer: /* @__PURE__ */ __name(({
        type
      }) => `'${type === "ForInStatement" ? "for-in" : "for-of"}' loop variable declaration may not have an initializer.`, "ForInOfLoopInitializer"),
      ForInUsing: "For-in loop may not start with 'using' declaration.",
      ForOfAsync: "The left-hand side of a for-of loop may not be 'async'.",
      ForOfLet: "The left-hand side of a for-of loop may not start with 'let'.",
      GeneratorInSingleStatementContext: "Generators can only be declared at the top level or inside a block.",
      IllegalBreakContinue: /* @__PURE__ */ __name(({
        type
      }) => `Unsyntactic ${type === "BreakStatement" ? "break" : "continue"}.`, "IllegalBreakContinue"),
      IllegalLanguageModeDirective: "Illegal 'use strict' directive in function with non-simple parameter list.",
      IllegalReturn: "'return' outside of function.",
      ImportAttributesUseAssert: "The `assert` keyword in import attributes is deprecated and it has been replaced by the `with` keyword. You can enable the `deprecatedImportAssert` parser plugin to suppress this error.",
      ImportBindingIsString: /* @__PURE__ */ __name(({
        importName
      }) => `A string literal cannot be used as an imported binding.
- Did you mean \`import { "${importName}" as foo }\`?`, "ImportBindingIsString"),
      ImportCallArity: `\`import()\` requires exactly one or two arguments.`,
      ImportCallNotNewExpression: "Cannot use new with import(...).",
      ImportCallSpreadArgument: "`...` is not allowed in `import()`.",
      ImportJSONBindingNotDefault: "A JSON module can only be imported with `default`.",
      ImportReflectionHasAssertion: "`import module x` cannot have assertions.",
      ImportReflectionNotBinding: 'Only `import module x from "./module"` is valid.',
      IncompatibleRegExpUVFlags: "The 'u' and 'v' regular expression flags cannot be enabled at the same time.",
      InvalidBigIntLiteral: "Invalid BigIntLiteral.",
      InvalidCodePoint: "Code point out of bounds.",
      InvalidCoverInitializedName: "Invalid shorthand property initializer.",
      InvalidDecimal: "Invalid decimal.",
      InvalidDigit: /* @__PURE__ */ __name(({
        radix
      }) => `Expected number in radix ${radix}.`, "InvalidDigit"),
      InvalidEscapeSequence: "Bad character escape sequence.",
      InvalidEscapeSequenceTemplate: "Invalid escape sequence in template.",
      InvalidEscapedReservedWord: /* @__PURE__ */ __name(({
        reservedWord
      }) => `Escape sequence in keyword ${reservedWord}.`, "InvalidEscapedReservedWord"),
      InvalidIdentifier: /* @__PURE__ */ __name(({
        identifierName
      }) => `Invalid identifier ${identifierName}.`, "InvalidIdentifier"),
      InvalidLhs: /* @__PURE__ */ __name(({
        ancestor
      }) => `Invalid left-hand side in ${toNodeDescription(ancestor)}.`, "InvalidLhs"),
      InvalidLhsBinding: /* @__PURE__ */ __name(({
        ancestor
      }) => `Binding invalid left-hand side in ${toNodeDescription(ancestor)}.`, "InvalidLhsBinding"),
      InvalidLhsOptionalChaining: /* @__PURE__ */ __name(({
        ancestor
      }) => `Invalid optional chaining in the left-hand side of ${toNodeDescription(ancestor)}.`, "InvalidLhsOptionalChaining"),
      InvalidNumber: "Invalid number.",
      InvalidOrMissingExponent: "Floating-point numbers require a valid exponent after the 'e'.",
      InvalidOrUnexpectedToken: /* @__PURE__ */ __name(({
        unexpected
      }) => `Unexpected character '${unexpected}'.`, "InvalidOrUnexpectedToken"),
      InvalidParenthesizedAssignment: "Invalid parenthesized assignment pattern.",
      InvalidPrivateFieldResolution: /* @__PURE__ */ __name(({
        identifierName
      }) => `Private name #${identifierName} is not defined.`, "InvalidPrivateFieldResolution"),
      InvalidPropertyBindingPattern: "Binding member expression.",
      InvalidRecordProperty: "Only properties and spread elements are allowed in record definitions.",
      InvalidRestAssignmentPattern: "Invalid rest operator's argument.",
      LabelRedeclaration: /* @__PURE__ */ __name(({
        labelName
      }) => `Label '${labelName}' is already declared.`, "LabelRedeclaration"),
      LetInLexicalBinding: "'let' is disallowed as a lexically bound name.",
      LineTerminatorBeforeArrow: "No line break is allowed before '=>'.",
      MalformedRegExpFlags: "Invalid regular expression flag.",
      MissingClassName: "A class name is required.",
      MissingEqInAssignment: "Only '=' operator can be used for specifying default value.",
      MissingSemicolon: "Missing semicolon.",
      MissingPlugin: /* @__PURE__ */ __name(({
        missingPlugin
      }) => `This experimental syntax requires enabling the parser plugin: ${missingPlugin.map((name2) => JSON.stringify(name2)).join(", ")}.`, "MissingPlugin"),
      MissingOneOfPlugins: /* @__PURE__ */ __name(({
        missingPlugin
      }) => `This experimental syntax requires enabling one of the following parser plugin(s): ${missingPlugin.map((name2) => JSON.stringify(name2)).join(", ")}.`, "MissingOneOfPlugins"),
      MissingUnicodeEscape: "Expecting Unicode escape sequence \\uXXXX.",
      MixingCoalesceWithLogical: "Nullish coalescing operator(??) requires parens when mixing with logical operators.",
      ModuleAttributeDifferentFromType: "The only accepted module attribute is `type`.",
      ModuleAttributeInvalidValue: "Only string literals are allowed as module attribute values.",
      ModuleAttributesWithDuplicateKeys: /* @__PURE__ */ __name(({
        key
      }) => `Duplicate key "${key}" is not allowed in module attributes.`, "ModuleAttributesWithDuplicateKeys"),
      ModuleExportNameHasLoneSurrogate: /* @__PURE__ */ __name(({
        surrogateCharCode
      }) => `An export name cannot include a lone surrogate, found '\\u${surrogateCharCode.toString(16)}'.`, "ModuleExportNameHasLoneSurrogate"),
      ModuleExportUndefined: /* @__PURE__ */ __name(({
        localName
      }) => `Export '${localName}' is not defined.`, "ModuleExportUndefined"),
      MultipleDefaultsInSwitch: "Multiple default clauses.",
      NewlineAfterThrow: "Illegal newline after throw.",
      NoCatchOrFinally: "Missing catch or finally clause.",
      NumberIdentifier: "Identifier directly after number.",
      NumericSeparatorInEscapeSequence: "Numeric separators are not allowed inside unicode escape sequences or hex escape sequences.",
      ObsoleteAwaitStar: "'await*' has been removed from the async functions proposal. Use Promise.all() instead.",
      OptionalChainingNoNew: "Constructors in/after an Optional Chain are not allowed.",
      OptionalChainingNoTemplate: "Tagged Template Literals are not allowed in optionalChain.",
      OverrideOnConstructor: "'override' modifier cannot appear on a constructor declaration.",
      ParamDupe: "Argument name clash.",
      PatternHasAccessor: "Object pattern can't contain getter or setter.",
      PatternHasMethod: "Object pattern can't contain methods.",
      PrivateInExpectedIn: /* @__PURE__ */ __name(({
        identifierName
      }) => `Private names are only allowed in property accesses (\`obj.#${identifierName}\`) or in \`in\` expressions (\`#${identifierName} in obj\`).`, "PrivateInExpectedIn"),
      PrivateNameRedeclaration: /* @__PURE__ */ __name(({
        identifierName
      }) => `Duplicate private name #${identifierName}.`, "PrivateNameRedeclaration"),
      RecordExpressionBarIncorrectEndSyntaxType: "Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",
      RecordExpressionBarIncorrectStartSyntaxType: "Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",
      RecordExpressionHashIncorrectStartSyntaxType: "Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",
      RecordNoProto: "'__proto__' is not allowed in Record expressions.",
      RestTrailingComma: "Unexpected trailing comma after rest element.",
      SloppyFunction: "In non-strict mode code, functions can only be declared at top level or inside a block.",
      SloppyFunctionAnnexB: "In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement.",
      SourcePhaseImportRequiresDefault: 'Only `import source x from "./module"` is valid.',
      StaticPrototype: "Classes may not have static property named prototype.",
      SuperNotAllowed: "`super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?",
      SuperPrivateField: "Private fields can't be accessed on super.",
      TrailingDecorator: "Decorators must be attached to a class element.",
      TupleExpressionBarIncorrectEndSyntaxType: "Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",
      TupleExpressionBarIncorrectStartSyntaxType: "Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",
      TupleExpressionHashIncorrectStartSyntaxType: "Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",
      UnexpectedArgumentPlaceholder: "Unexpected argument placeholder.",
      UnexpectedAwaitAfterPipelineBody: 'Unexpected "await" after pipeline body; await must have parentheses in minimal proposal.',
      UnexpectedDigitAfterHash: "Unexpected digit after hash token.",
      UnexpectedImportExport: "'import' and 'export' may only appear at the top level.",
      UnexpectedKeyword: /* @__PURE__ */ __name(({
        keyword
      }) => `Unexpected keyword '${keyword}'.`, "UnexpectedKeyword"),
      UnexpectedLeadingDecorator: "Leading decorators must be attached to a class declaration.",
      UnexpectedLexicalDeclaration: "Lexical declaration cannot appear in a single-statement context.",
      UnexpectedNewTarget: "`new.target` can only be used in functions or class properties.",
      UnexpectedNumericSeparator: "A numeric separator is only allowed between two digits.",
      UnexpectedPrivateField: "Unexpected private name.",
      UnexpectedReservedWord: /* @__PURE__ */ __name(({
        reservedWord
      }) => `Unexpected reserved word '${reservedWord}'.`, "UnexpectedReservedWord"),
      UnexpectedSuper: "'super' is only allowed in object methods and classes.",
      UnexpectedToken: /* @__PURE__ */ __name(({
        expected,
        unexpected
      }) => `Unexpected token${unexpected ? ` '${unexpected}'.` : ""}${expected ? `, expected "${expected}"` : ""}`, "UnexpectedToken"),
      UnexpectedTokenUnaryExponentiation: "Illegal expression. Wrap left hand side or entire exponentiation in parentheses.",
      UnexpectedUsingDeclaration: "Using declaration cannot appear in the top level when source type is `script`.",
      UnsupportedBind: "Binding should be performed on object property.",
      UnsupportedDecoratorExport: "A decorated export must export a class declaration.",
      UnsupportedDefaultExport: "Only expressions, functions or classes are allowed as the `default` export.",
      UnsupportedImport: "`import` can only be used in `import()` or `import.meta`.",
      UnsupportedMetaProperty: /* @__PURE__ */ __name(({
        target,
        onlyValidPropertyName
      }) => `The only valid meta property for ${target} is ${target}.${onlyValidPropertyName}.`, "UnsupportedMetaProperty"),
      UnsupportedParameterDecorator: "Decorators cannot be used to decorate parameters.",
      UnsupportedPropertyDecorator: "Decorators cannot be used to decorate object literal properties.",
      UnsupportedSuper: "'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]).",
      UnterminatedComment: "Unterminated comment.",
      UnterminatedRegExp: "Unterminated regular expression.",
      UnterminatedString: "Unterminated string constant.",
      UnterminatedTemplate: "Unterminated template.",
      UsingDeclarationExport: "Using declaration cannot be exported.",
      UsingDeclarationHasBindingPattern: "Using declaration cannot have destructuring patterns.",
      VarRedeclaration: /* @__PURE__ */ __name(({
        identifierName
      }) => `Identifier '${identifierName}' has already been declared.`, "VarRedeclaration"),
      YieldBindingIdentifier: "Can not use 'yield' as identifier inside a generator.",
      YieldInParameter: "Yield expression is not allowed in formal parameters.",
      ZeroDigitNumericSeparator: "Numeric separator can not be used after leading 0."
    };
    var StrictModeErrors = {
      StrictDelete: "Deleting local variable in strict mode.",
      StrictEvalArguments: /* @__PURE__ */ __name(({
        referenceName
      }) => `Assigning to '${referenceName}' in strict mode.`, "StrictEvalArguments"),
      StrictEvalArgumentsBinding: /* @__PURE__ */ __name(({
        bindingName
      }) => `Binding '${bindingName}' in strict mode.`, "StrictEvalArgumentsBinding"),
      StrictFunction: "In strict mode code, functions can only be declared at top level or inside a block.",
      StrictNumericEscape: "The only valid numeric escape in strict mode is '\\0'.",
      StrictOctalLiteral: "Legacy octal literals are not allowed in strict mode.",
      StrictWith: "'with' in strict mode."
    };
    var UnparenthesizedPipeBodyDescriptions = /* @__PURE__ */ new Set(["ArrowFunctionExpression", "AssignmentExpression", "ConditionalExpression", "YieldExpression"]);
    var PipelineOperatorErrors = {
      PipeBodyIsTighter: "Unexpected yield after pipeline body; any yield expression acting as Hack-style pipe body must be parenthesized due to its loose operator precedence.",
      PipeTopicRequiresHackPipes: 'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.',
      PipeTopicUnbound: "Topic reference is unbound; it must be inside a pipe body.",
      PipeTopicUnconfiguredToken: /* @__PURE__ */ __name(({
        token
      }) => `Invalid topic token ${token}. In order to use ${token} as a topic reference, the pipelineOperator plugin must be configured with { "proposal": "hack", "topicToken": "${token}" }.`, "PipeTopicUnconfiguredToken"),
      PipeTopicUnused: "Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.",
      PipeUnparenthesizedBody: /* @__PURE__ */ __name(({
        type
      }) => `Hack-style pipe body cannot be an unparenthesized ${toNodeDescription({
        type
      })}; please wrap it in parentheses.`, "PipeUnparenthesizedBody"),
      PipelineBodyNoArrow: 'Unexpected arrow "=>" after pipeline body; arrow function in pipeline body must be parenthesized.',
      PipelineBodySequenceExpression: "Pipeline body may not be a comma-separated sequence expression.",
      PipelineHeadSequenceExpression: "Pipeline head should not be a comma-separated sequence expression.",
      PipelineTopicUnused: "Pipeline is in topic style but does not use topic reference.",
      PrimaryTopicNotAllowed: "Topic reference was used in a lexical context without topic binding.",
      PrimaryTopicRequiresSmartPipeline: 'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.'
    };
    var _excluded = ["message"];
    function defineHidden(obj, key, value) {
      Object.defineProperty(obj, key, {
        enumerable: false,
        configurable: true,
        value
      });
    }
    __name(defineHidden, "defineHidden");
    function toParseErrorConstructor({
      toMessage,
      code: code2,
      reasonCode,
      syntaxPlugin
    }) {
      const hasMissingPlugin = reasonCode === "MissingPlugin" || reasonCode === "MissingOneOfPlugins";
      {
        const oldReasonCodes = {
          AccessorCannotDeclareThisParameter: "AccesorCannotDeclareThisParameter",
          AccessorCannotHaveTypeParameters: "AccesorCannotHaveTypeParameters",
          ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference: "ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference",
          SetAccessorCannotHaveOptionalParameter: "SetAccesorCannotHaveOptionalParameter",
          SetAccessorCannotHaveRestParameter: "SetAccesorCannotHaveRestParameter",
          SetAccessorCannotHaveReturnType: "SetAccesorCannotHaveReturnType"
        };
        if (oldReasonCodes[reasonCode]) {
          reasonCode = oldReasonCodes[reasonCode];
        }
      }
      return /* @__PURE__ */ __name(function constructor(loc, details) {
        const error2 = new SyntaxError();
        error2.code = code2;
        error2.reasonCode = reasonCode;
        error2.loc = loc;
        error2.pos = loc.index;
        error2.syntaxPlugin = syntaxPlugin;
        if (hasMissingPlugin) {
          error2.missingPlugin = details.missingPlugin;
        }
        defineHidden(error2, "clone", /* @__PURE__ */ __name(function clone2(overrides = {}) {
          var _overrides$loc;
          const {
            line,
            column,
            index
          } = (_overrides$loc = overrides.loc) != null ? _overrides$loc : loc;
          return constructor(new Position(line, column, index), Object.assign({}, details, overrides.details));
        }, "clone"));
        defineHidden(error2, "details", details);
        Object.defineProperty(error2, "message", {
          configurable: true,
          get() {
            const message = `${toMessage(details)} (${loc.line}:${loc.column})`;
            this.message = message;
            return message;
          },
          set(value) {
            Object.defineProperty(this, "message", {
              value,
              writable: true
            });
          }
        });
        return error2;
      }, "constructor");
    }
    __name(toParseErrorConstructor, "toParseErrorConstructor");
    function ParseErrorEnum(argument, syntaxPlugin) {
      if (Array.isArray(argument)) {
        return (parseErrorTemplates) => ParseErrorEnum(parseErrorTemplates, argument[0]);
      }
      const ParseErrorConstructors = {};
      for (const reasonCode of Object.keys(argument)) {
        const template = argument[reasonCode];
        const _ref = typeof template === "string" ? {
          message: /* @__PURE__ */ __name(() => template, "message")
        } : typeof template === "function" ? {
          message: template
        } : template, {
          message
        } = _ref, rest = _objectWithoutPropertiesLoose(_ref, _excluded);
        const toMessage = typeof message === "string" ? () => message : message;
        ParseErrorConstructors[reasonCode] = toParseErrorConstructor(Object.assign({
          code: "BABEL_PARSER_SYNTAX_ERROR",
          reasonCode,
          toMessage
        }, syntaxPlugin ? {
          syntaxPlugin
        } : {}, rest));
      }
      return ParseErrorConstructors;
    }
    __name(ParseErrorEnum, "ParseErrorEnum");
    var Errors = Object.assign({}, ParseErrorEnum(ModuleErrors), ParseErrorEnum(StandardErrors), ParseErrorEnum(StrictModeErrors), ParseErrorEnum`pipelineOperator`(PipelineOperatorErrors));
    var {
      defineProperty
    } = Object;
    var toUnenumerable = /* @__PURE__ */ __name((object, key) => {
      if (object) {
        defineProperty(object, key, {
          enumerable: false,
          value: object[key]
        });
      }
    }, "toUnenumerable");
    function toESTreeLocation(node2) {
      toUnenumerable(node2.loc.start, "index");
      toUnenumerable(node2.loc.end, "index");
      return node2;
    }
    __name(toESTreeLocation, "toESTreeLocation");
    var estree = /* @__PURE__ */ __name((superClass) => class ESTreeParserMixin extends superClass {
      static {
        __name(this, "ESTreeParserMixin");
      }
      parse() {
        const file3 = toESTreeLocation(super.parse());
        if (this.options.tokens) {
          file3.tokens = file3.tokens.map(toESTreeLocation);
        }
        return file3;
      }
      parseRegExpLiteral({
        pattern,
        flags: flags2
      }) {
        let regex2 = null;
        try {
          regex2 = new RegExp(pattern, flags2);
        } catch (_5) {
        }
        const node2 = this.estreeParseLiteral(regex2);
        node2.regex = {
          pattern,
          flags: flags2
        };
        return node2;
      }
      parseBigIntLiteral(value) {
        let bigInt;
        try {
          bigInt = BigInt(value);
        } catch (_unused) {
          bigInt = null;
        }
        const node2 = this.estreeParseLiteral(bigInt);
        node2.bigint = String(node2.value || value);
        return node2;
      }
      parseDecimalLiteral(value) {
        const decimal = null;
        const node2 = this.estreeParseLiteral(decimal);
        node2.decimal = String(node2.value || value);
        return node2;
      }
      estreeParseLiteral(value) {
        return this.parseLiteral(value, "Literal");
      }
      parseStringLiteral(value) {
        return this.estreeParseLiteral(value);
      }
      parseNumericLiteral(value) {
        return this.estreeParseLiteral(value);
      }
      parseNullLiteral() {
        return this.estreeParseLiteral(null);
      }
      parseBooleanLiteral(value) {
        return this.estreeParseLiteral(value);
      }
      directiveToStmt(directive) {
        const expression = directive.value;
        delete directive.value;
        expression.type = "Literal";
        expression.raw = expression.extra.raw;
        expression.value = expression.extra.expressionValue;
        const stmt = directive;
        stmt.type = "ExpressionStatement";
        stmt.expression = expression;
        stmt.directive = expression.extra.rawValue;
        delete expression.extra;
        return stmt;
      }
      initFunction(node2, isAsync4) {
        super.initFunction(node2, isAsync4);
        node2.expression = false;
      }
      checkDeclaration(node2) {
        if (node2 != null && this.isObjectProperty(node2)) {
          this.checkDeclaration(node2.value);
        } else {
          super.checkDeclaration(node2);
        }
      }
      getObjectOrClassMethodParams(method) {
        return method.value.params;
      }
      isValidDirective(stmt) {
        var _stmt$expression$extr;
        return stmt.type === "ExpressionStatement" && stmt.expression.type === "Literal" && typeof stmt.expression.value === "string" && !((_stmt$expression$extr = stmt.expression.extra) != null && _stmt$expression$extr.parenthesized);
      }
      parseBlockBody(node2, allowDirectives, topLevel, end, afterBlockParse) {
        super.parseBlockBody(node2, allowDirectives, topLevel, end, afterBlockParse);
        const directiveStatements = node2.directives.map((d8) => this.directiveToStmt(d8));
        node2.body = directiveStatements.concat(node2.body);
        delete node2.directives;
      }
      pushClassMethod(classBody, method, isGenerator, isAsync4, isConstructor, allowsDirectSuper) {
        this.parseMethod(method, isGenerator, isAsync4, isConstructor, allowsDirectSuper, "ClassMethod", true);
        if (method.typeParameters) {
          method.value.typeParameters = method.typeParameters;
          delete method.typeParameters;
        }
        classBody.body.push(method);
      }
      parsePrivateName() {
        const node2 = super.parsePrivateName();
        {
          if (!this.getPluginOption("estree", "classFeatures")) {
            return node2;
          }
        }
        return this.convertPrivateNameToPrivateIdentifier(node2);
      }
      convertPrivateNameToPrivateIdentifier(node2) {
        const name2 = super.getPrivateNameSV(node2);
        node2 = node2;
        delete node2.id;
        node2.name = name2;
        node2.type = "PrivateIdentifier";
        return node2;
      }
      isPrivateName(node2) {
        {
          if (!this.getPluginOption("estree", "classFeatures")) {
            return super.isPrivateName(node2);
          }
        }
        return node2.type === "PrivateIdentifier";
      }
      getPrivateNameSV(node2) {
        {
          if (!this.getPluginOption("estree", "classFeatures")) {
            return super.getPrivateNameSV(node2);
          }
        }
        return node2.name;
      }
      parseLiteral(value, type) {
        const node2 = super.parseLiteral(value, type);
        node2.raw = node2.extra.raw;
        delete node2.extra;
        return node2;
      }
      parseFunctionBody(node2, allowExpression, isMethod = false) {
        super.parseFunctionBody(node2, allowExpression, isMethod);
        node2.expression = node2.body.type !== "BlockStatement";
      }
      parseMethod(node2, isGenerator, isAsync4, isConstructor, allowDirectSuper, type, inClassScope = false) {
        let funcNode = this.startNode();
        funcNode.kind = node2.kind;
        funcNode = super.parseMethod(funcNode, isGenerator, isAsync4, isConstructor, allowDirectSuper, type, inClassScope);
        funcNode.type = "FunctionExpression";
        delete funcNode.kind;
        node2.value = funcNode;
        if (type === "ClassPrivateMethod") {
          node2.computed = false;
        }
        return this.finishNode(node2, "MethodDefinition");
      }
      nameIsConstructor(key) {
        if (key.type === "Literal") return key.value === "constructor";
        return super.nameIsConstructor(key);
      }
      parseClassProperty(...args) {
        const propertyNode = super.parseClassProperty(...args);
        {
          if (!this.getPluginOption("estree", "classFeatures")) {
            return propertyNode;
          }
        }
        propertyNode.type = "PropertyDefinition";
        return propertyNode;
      }
      parseClassPrivateProperty(...args) {
        const propertyNode = super.parseClassPrivateProperty(...args);
        {
          if (!this.getPluginOption("estree", "classFeatures")) {
            return propertyNode;
          }
        }
        propertyNode.type = "PropertyDefinition";
        propertyNode.computed = false;
        return propertyNode;
      }
      parseObjectMethod(prop, isGenerator, isAsync4, isPattern, isAccessor) {
        const node2 = super.parseObjectMethod(prop, isGenerator, isAsync4, isPattern, isAccessor);
        if (node2) {
          node2.type = "Property";
          if (node2.kind === "method") {
            node2.kind = "init";
          }
          node2.shorthand = false;
        }
        return node2;
      }
      parseObjectProperty(prop, startLoc, isPattern, refExpressionErrors) {
        const node2 = super.parseObjectProperty(prop, startLoc, isPattern, refExpressionErrors);
        if (node2) {
          node2.kind = "init";
          node2.type = "Property";
        }
        return node2;
      }
      isValidLVal(type, isUnparenthesizedInAssign, binding) {
        return type === "Property" ? "value" : super.isValidLVal(type, isUnparenthesizedInAssign, binding);
      }
      isAssignable(node2, isBinding) {
        if (node2 != null && this.isObjectProperty(node2)) {
          return this.isAssignable(node2.value, isBinding);
        }
        return super.isAssignable(node2, isBinding);
      }
      toAssignable(node2, isLHS = false) {
        if (node2 != null && this.isObjectProperty(node2)) {
          const {
            key,
            value
          } = node2;
          if (this.isPrivateName(key)) {
            this.classScope.usePrivateName(this.getPrivateNameSV(key), key.loc.start);
          }
          this.toAssignable(value, isLHS);
        } else {
          super.toAssignable(node2, isLHS);
        }
      }
      toAssignableObjectExpressionProp(prop, isLast, isLHS) {
        if (prop.type === "Property" && (prop.kind === "get" || prop.kind === "set")) {
          this.raise(Errors.PatternHasAccessor, prop.key);
        } else if (prop.type === "Property" && prop.method) {
          this.raise(Errors.PatternHasMethod, prop.key);
        } else {
          super.toAssignableObjectExpressionProp(prop, isLast, isLHS);
        }
      }
      finishCallExpression(unfinished, optional) {
        const node2 = super.finishCallExpression(unfinished, optional);
        if (node2.callee.type === "Import") {
          var _ref, _ref2;
          node2.type = "ImportExpression";
          node2.source = node2.arguments[0];
          node2.options = (_ref = node2.arguments[1]) != null ? _ref : null;
          node2.attributes = (_ref2 = node2.arguments[1]) != null ? _ref2 : null;
          delete node2.arguments;
          delete node2.callee;
        }
        return node2;
      }
      toReferencedArguments(node2) {
        if (node2.type === "ImportExpression") {
          return;
        }
        super.toReferencedArguments(node2);
      }
      parseExport(unfinished, decorators) {
        const exportStartLoc = this.state.lastTokStartLoc;
        const node2 = super.parseExport(unfinished, decorators);
        switch (node2.type) {
          case "ExportAllDeclaration":
            node2.exported = null;
            break;
          case "ExportNamedDeclaration":
            if (node2.specifiers.length === 1 && node2.specifiers[0].type === "ExportNamespaceSpecifier") {
              node2.type = "ExportAllDeclaration";
              node2.exported = node2.specifiers[0].exported;
              delete node2.specifiers;
            }
          case "ExportDefaultDeclaration":
            {
              var _declaration$decorato;
              const {
                declaration
              } = node2;
              if ((declaration == null ? void 0 : declaration.type) === "ClassDeclaration" && ((_declaration$decorato = declaration.decorators) == null ? void 0 : _declaration$decorato.length) > 0 && declaration.start === node2.start) {
                this.resetStartLocation(node2, exportStartLoc);
              }
            }
            break;
        }
        return node2;
      }
      parseSubscript(base, startLoc, noCalls, state2) {
        const node2 = super.parseSubscript(base, startLoc, noCalls, state2);
        if (state2.optionalChainMember) {
          if (node2.type === "OptionalMemberExpression" || node2.type === "OptionalCallExpression") {
            node2.type = node2.type.substring(8);
          }
          if (state2.stop) {
            const chain2 = this.startNodeAtNode(node2);
            chain2.expression = node2;
            return this.finishNode(chain2, "ChainExpression");
          }
        } else if (node2.type === "MemberExpression" || node2.type === "CallExpression") {
          node2.optional = false;
        }
        return node2;
      }
      isOptionalMemberExpression(node2) {
        if (node2.type === "ChainExpression") {
          return node2.expression.type === "MemberExpression";
        }
        return super.isOptionalMemberExpression(node2);
      }
      hasPropertyAsPrivateName(node2) {
        if (node2.type === "ChainExpression") {
          node2 = node2.expression;
        }
        return super.hasPropertyAsPrivateName(node2);
      }
      isObjectProperty(node2) {
        return node2.type === "Property" && node2.kind === "init" && !node2.method;
      }
      isObjectMethod(node2) {
        return node2.type === "Property" && (node2.method || node2.kind === "get" || node2.kind === "set");
      }
      finishNodeAt(node2, type, endLoc) {
        return toESTreeLocation(super.finishNodeAt(node2, type, endLoc));
      }
      resetStartLocation(node2, startLoc) {
        super.resetStartLocation(node2, startLoc);
        toESTreeLocation(node2);
      }
      resetEndLocation(node2, endLoc = this.state.lastTokEndLoc) {
        super.resetEndLocation(node2, endLoc);
        toESTreeLocation(node2);
      }
    }, "estree");
    var TokContext = class {
      static {
        __name(this, "TokContext");
      }
      constructor(token, preserveSpace) {
        this.token = void 0;
        this.preserveSpace = void 0;
        this.token = token;
        this.preserveSpace = !!preserveSpace;
      }
    };
    var types13 = {
      brace: new TokContext("{"),
      j_oTag: new TokContext("<tag"),
      j_cTag: new TokContext("</tag"),
      j_expr: new TokContext("<tag>...</tag>", true)
    };
    {
      types13.template = new TokContext("`", true);
    }
    var beforeExpr = true;
    var startsExpr = true;
    var isLoop = true;
    var isAssign = true;
    var prefix = true;
    var postfix = true;
    var ExportedTokenType = class {
      static {
        __name(this, "ExportedTokenType");
      }
      constructor(label, conf = {}) {
        this.label = void 0;
        this.keyword = void 0;
        this.beforeExpr = void 0;
        this.startsExpr = void 0;
        this.rightAssociative = void 0;
        this.isLoop = void 0;
        this.isAssign = void 0;
        this.prefix = void 0;
        this.postfix = void 0;
        this.binop = void 0;
        this.label = label;
        this.keyword = conf.keyword;
        this.beforeExpr = !!conf.beforeExpr;
        this.startsExpr = !!conf.startsExpr;
        this.rightAssociative = !!conf.rightAssociative;
        this.isLoop = !!conf.isLoop;
        this.isAssign = !!conf.isAssign;
        this.prefix = !!conf.prefix;
        this.postfix = !!conf.postfix;
        this.binop = conf.binop != null ? conf.binop : null;
        {
          this.updateContext = null;
        }
      }
    };
    var keywords$1 = /* @__PURE__ */ new Map();
    function createKeyword(name2, options = {}) {
      options.keyword = name2;
      const token = createToken(name2, options);
      keywords$1.set(name2, token);
      return token;
    }
    __name(createKeyword, "createKeyword");
    function createBinop(name2, binop) {
      return createToken(name2, {
        beforeExpr,
        binop
      });
    }
    __name(createBinop, "createBinop");
    var tokenTypeCounter = -1;
    var tokenTypes = [];
    var tokenLabels = [];
    var tokenBinops = [];
    var tokenBeforeExprs = [];
    var tokenStartsExprs = [];
    var tokenPrefixes = [];
    function createToken(name2, options = {}) {
      var _options$binop, _options$beforeExpr, _options$startsExpr, _options$prefix;
      ++tokenTypeCounter;
      tokenLabels.push(name2);
      tokenBinops.push((_options$binop = options.binop) != null ? _options$binop : -1);
      tokenBeforeExprs.push((_options$beforeExpr = options.beforeExpr) != null ? _options$beforeExpr : false);
      tokenStartsExprs.push((_options$startsExpr = options.startsExpr) != null ? _options$startsExpr : false);
      tokenPrefixes.push((_options$prefix = options.prefix) != null ? _options$prefix : false);
      tokenTypes.push(new ExportedTokenType(name2, options));
      return tokenTypeCounter;
    }
    __name(createToken, "createToken");
    function createKeywordLike(name2, options = {}) {
      var _options$binop2, _options$beforeExpr2, _options$startsExpr2, _options$prefix2;
      ++tokenTypeCounter;
      keywords$1.set(name2, tokenTypeCounter);
      tokenLabels.push(name2);
      tokenBinops.push((_options$binop2 = options.binop) != null ? _options$binop2 : -1);
      tokenBeforeExprs.push((_options$beforeExpr2 = options.beforeExpr) != null ? _options$beforeExpr2 : false);
      tokenStartsExprs.push((_options$startsExpr2 = options.startsExpr) != null ? _options$startsExpr2 : false);
      tokenPrefixes.push((_options$prefix2 = options.prefix) != null ? _options$prefix2 : false);
      tokenTypes.push(new ExportedTokenType("name", options));
      return tokenTypeCounter;
    }
    __name(createKeywordLike, "createKeywordLike");
    var tt2 = {
      bracketL: createToken("[", {
        beforeExpr,
        startsExpr
      }),
      bracketHashL: createToken("#[", {
        beforeExpr,
        startsExpr
      }),
      bracketBarL: createToken("[|", {
        beforeExpr,
        startsExpr
      }),
      bracketR: createToken("]"),
      bracketBarR: createToken("|]"),
      braceL: createToken("{", {
        beforeExpr,
        startsExpr
      }),
      braceBarL: createToken("{|", {
        beforeExpr,
        startsExpr
      }),
      braceHashL: createToken("#{", {
        beforeExpr,
        startsExpr
      }),
      braceR: createToken("}"),
      braceBarR: createToken("|}"),
      parenL: createToken("(", {
        beforeExpr,
        startsExpr
      }),
      parenR: createToken(")"),
      comma: createToken(",", {
        beforeExpr
      }),
      semi: createToken(";", {
        beforeExpr
      }),
      colon: createToken(":", {
        beforeExpr
      }),
      doubleColon: createToken("::", {
        beforeExpr
      }),
      dot: createToken("."),
      question: createToken("?", {
        beforeExpr
      }),
      questionDot: createToken("?."),
      arrow: createToken("=>", {
        beforeExpr
      }),
      template: createToken("template"),
      ellipsis: createToken("...", {
        beforeExpr
      }),
      backQuote: createToken("`", {
        startsExpr
      }),
      dollarBraceL: createToken("${", {
        beforeExpr,
        startsExpr
      }),
      templateTail: createToken("...`", {
        startsExpr
      }),
      templateNonTail: createToken("...${", {
        beforeExpr,
        startsExpr
      }),
      at: createToken("@"),
      hash: createToken("#", {
        startsExpr
      }),
      interpreterDirective: createToken("#!..."),
      eq: createToken("=", {
        beforeExpr,
        isAssign
      }),
      assign: createToken("_=", {
        beforeExpr,
        isAssign
      }),
      slashAssign: createToken("_=", {
        beforeExpr,
        isAssign
      }),
      xorAssign: createToken("_=", {
        beforeExpr,
        isAssign
      }),
      moduloAssign: createToken("_=", {
        beforeExpr,
        isAssign
      }),
      incDec: createToken("++/--", {
        prefix,
        postfix,
        startsExpr
      }),
      bang: createToken("!", {
        beforeExpr,
        prefix,
        startsExpr
      }),
      tilde: createToken("~", {
        beforeExpr,
        prefix,
        startsExpr
      }),
      doubleCaret: createToken("^^", {
        startsExpr
      }),
      doubleAt: createToken("@@", {
        startsExpr
      }),
      pipeline: createBinop("|>", 0),
      nullishCoalescing: createBinop("??", 1),
      logicalOR: createBinop("||", 1),
      logicalAND: createBinop("&&", 2),
      bitwiseOR: createBinop("|", 3),
      bitwiseXOR: createBinop("^", 4),
      bitwiseAND: createBinop("&", 5),
      equality: createBinop("==/!=/===/!==", 6),
      lt: createBinop("</>/<=/>=", 7),
      gt: createBinop("</>/<=/>=", 7),
      relational: createBinop("</>/<=/>=", 7),
      bitShift: createBinop("<</>>/>>>", 8),
      bitShiftL: createBinop("<</>>/>>>", 8),
      bitShiftR: createBinop("<</>>/>>>", 8),
      plusMin: createToken("+/-", {
        beforeExpr,
        binop: 9,
        prefix,
        startsExpr
      }),
      modulo: createToken("%", {
        binop: 10,
        startsExpr
      }),
      star: createToken("*", {
        binop: 10
      }),
      slash: createBinop("/", 10),
      exponent: createToken("**", {
        beforeExpr,
        binop: 11,
        rightAssociative: true
      }),
      _in: createKeyword("in", {
        beforeExpr,
        binop: 7
      }),
      _instanceof: createKeyword("instanceof", {
        beforeExpr,
        binop: 7
      }),
      _break: createKeyword("break"),
      _case: createKeyword("case", {
        beforeExpr
      }),
      _catch: createKeyword("catch"),
      _continue: createKeyword("continue"),
      _debugger: createKeyword("debugger"),
      _default: createKeyword("default", {
        beforeExpr
      }),
      _else: createKeyword("else", {
        beforeExpr
      }),
      _finally: createKeyword("finally"),
      _function: createKeyword("function", {
        startsExpr
      }),
      _if: createKeyword("if"),
      _return: createKeyword("return", {
        beforeExpr
      }),
      _switch: createKeyword("switch"),
      _throw: createKeyword("throw", {
        beforeExpr,
        prefix,
        startsExpr
      }),
      _try: createKeyword("try"),
      _var: createKeyword("var"),
      _const: createKeyword("const"),
      _with: createKeyword("with"),
      _new: createKeyword("new", {
        beforeExpr,
        startsExpr
      }),
      _this: createKeyword("this", {
        startsExpr
      }),
      _super: createKeyword("super", {
        startsExpr
      }),
      _class: createKeyword("class", {
        startsExpr
      }),
      _extends: createKeyword("extends", {
        beforeExpr
      }),
      _export: createKeyword("export"),
      _import: createKeyword("import", {
        startsExpr
      }),
      _null: createKeyword("null", {
        startsExpr
      }),
      _true: createKeyword("true", {
        startsExpr
      }),
      _false: createKeyword("false", {
        startsExpr
      }),
      _typeof: createKeyword("typeof", {
        beforeExpr,
        prefix,
        startsExpr
      }),
      _void: createKeyword("void", {
        beforeExpr,
        prefix,
        startsExpr
      }),
      _delete: createKeyword("delete", {
        beforeExpr,
        prefix,
        startsExpr
      }),
      _do: createKeyword("do", {
        isLoop,
        beforeExpr
      }),
      _for: createKeyword("for", {
        isLoop
      }),
      _while: createKeyword("while", {
        isLoop
      }),
      _as: createKeywordLike("as", {
        startsExpr
      }),
      _assert: createKeywordLike("assert", {
        startsExpr
      }),
      _async: createKeywordLike("async", {
        startsExpr
      }),
      _await: createKeywordLike("await", {
        startsExpr
      }),
      _defer: createKeywordLike("defer", {
        startsExpr
      }),
      _from: createKeywordLike("from", {
        startsExpr
      }),
      _get: createKeywordLike("get", {
        startsExpr
      }),
      _let: createKeywordLike("let", {
        startsExpr
      }),
      _meta: createKeywordLike("meta", {
        startsExpr
      }),
      _of: createKeywordLike("of", {
        startsExpr
      }),
      _sent: createKeywordLike("sent", {
        startsExpr
      }),
      _set: createKeywordLike("set", {
        startsExpr
      }),
      _source: createKeywordLike("source", {
        startsExpr
      }),
      _static: createKeywordLike("static", {
        startsExpr
      }),
      _using: createKeywordLike("using", {
        startsExpr
      }),
      _yield: createKeywordLike("yield", {
        startsExpr
      }),
      _asserts: createKeywordLike("asserts", {
        startsExpr
      }),
      _checks: createKeywordLike("checks", {
        startsExpr
      }),
      _exports: createKeywordLike("exports", {
        startsExpr
      }),
      _global: createKeywordLike("global", {
        startsExpr
      }),
      _implements: createKeywordLike("implements", {
        startsExpr
      }),
      _intrinsic: createKeywordLike("intrinsic", {
        startsExpr
      }),
      _infer: createKeywordLike("infer", {
        startsExpr
      }),
      _is: createKeywordLike("is", {
        startsExpr
      }),
      _mixins: createKeywordLike("mixins", {
        startsExpr
      }),
      _proto: createKeywordLike("proto", {
        startsExpr
      }),
      _require: createKeywordLike("require", {
        startsExpr
      }),
      _satisfies: createKeywordLike("satisfies", {
        startsExpr
      }),
      _keyof: createKeywordLike("keyof", {
        startsExpr
      }),
      _readonly: createKeywordLike("readonly", {
        startsExpr
      }),
      _unique: createKeywordLike("unique", {
        startsExpr
      }),
      _abstract: createKeywordLike("abstract", {
        startsExpr
      }),
      _declare: createKeywordLike("declare", {
        startsExpr
      }),
      _enum: createKeywordLike("enum", {
        startsExpr
      }),
      _module: createKeywordLike("module", {
        startsExpr
      }),
      _namespace: createKeywordLike("namespace", {
        startsExpr
      }),
      _interface: createKeywordLike("interface", {
        startsExpr
      }),
      _type: createKeywordLike("type", {
        startsExpr
      }),
      _opaque: createKeywordLike("opaque", {
        startsExpr
      }),
      name: createToken("name", {
        startsExpr
      }),
      placeholder: createToken("%%", {
        startsExpr: true
      }),
      string: createToken("string", {
        startsExpr
      }),
      num: createToken("num", {
        startsExpr
      }),
      bigint: createToken("bigint", {
        startsExpr
      }),
      decimal: createToken("decimal", {
        startsExpr
      }),
      regexp: createToken("regexp", {
        startsExpr
      }),
      privateName: createToken("#name", {
        startsExpr
      }),
      eof: createToken("eof"),
      jsxName: createToken("jsxName"),
      jsxText: createToken("jsxText", {
        beforeExpr: true
      }),
      jsxTagStart: createToken("jsxTagStart", {
        startsExpr: true
      }),
      jsxTagEnd: createToken("jsxTagEnd")
    };
    function tokenIsIdentifier(token) {
      return token >= 93 && token <= 133;
    }
    __name(tokenIsIdentifier, "tokenIsIdentifier");
    function tokenKeywordOrIdentifierIsKeyword(token) {
      return token <= 92;
    }
    __name(tokenKeywordOrIdentifierIsKeyword, "tokenKeywordOrIdentifierIsKeyword");
    function tokenIsKeywordOrIdentifier(token) {
      return token >= 58 && token <= 133;
    }
    __name(tokenIsKeywordOrIdentifier, "tokenIsKeywordOrIdentifier");
    function tokenIsLiteralPropertyName(token) {
      return token >= 58 && token <= 137;
    }
    __name(tokenIsLiteralPropertyName, "tokenIsLiteralPropertyName");
    function tokenComesBeforeExpression(token) {
      return tokenBeforeExprs[token];
    }
    __name(tokenComesBeforeExpression, "tokenComesBeforeExpression");
    function tokenCanStartExpression(token) {
      return tokenStartsExprs[token];
    }
    __name(tokenCanStartExpression, "tokenCanStartExpression");
    function tokenIsAssignment(token) {
      return token >= 29 && token <= 33;
    }
    __name(tokenIsAssignment, "tokenIsAssignment");
    function tokenIsFlowInterfaceOrTypeOrOpaque(token) {
      return token >= 129 && token <= 131;
    }
    __name(tokenIsFlowInterfaceOrTypeOrOpaque, "tokenIsFlowInterfaceOrTypeOrOpaque");
    function tokenIsLoop(token) {
      return token >= 90 && token <= 92;
    }
    __name(tokenIsLoop, "tokenIsLoop");
    function tokenIsKeyword(token) {
      return token >= 58 && token <= 92;
    }
    __name(tokenIsKeyword, "tokenIsKeyword");
    function tokenIsOperator(token) {
      return token >= 39 && token <= 59;
    }
    __name(tokenIsOperator, "tokenIsOperator");
    function tokenIsPostfix(token) {
      return token === 34;
    }
    __name(tokenIsPostfix, "tokenIsPostfix");
    function tokenIsPrefix(token) {
      return tokenPrefixes[token];
    }
    __name(tokenIsPrefix, "tokenIsPrefix");
    function tokenIsTSTypeOperator(token) {
      return token >= 121 && token <= 123;
    }
    __name(tokenIsTSTypeOperator, "tokenIsTSTypeOperator");
    function tokenIsTSDeclarationStart(token) {
      return token >= 124 && token <= 130;
    }
    __name(tokenIsTSDeclarationStart, "tokenIsTSDeclarationStart");
    function tokenLabelName(token) {
      return tokenLabels[token];
    }
    __name(tokenLabelName, "tokenLabelName");
    function tokenOperatorPrecedence(token) {
      return tokenBinops[token];
    }
    __name(tokenOperatorPrecedence, "tokenOperatorPrecedence");
    function tokenIsRightAssociative(token) {
      return token === 57;
    }
    __name(tokenIsRightAssociative, "tokenIsRightAssociative");
    function tokenIsTemplate(token) {
      return token >= 24 && token <= 25;
    }
    __name(tokenIsTemplate, "tokenIsTemplate");
    function getExportedToken(token) {
      return tokenTypes[token];
    }
    __name(getExportedToken, "getExportedToken");
    {
      tokenTypes[8].updateContext = (context2) => {
        context2.pop();
      };
      tokenTypes[5].updateContext = tokenTypes[7].updateContext = tokenTypes[23].updateContext = (context2) => {
        context2.push(types13.brace);
      };
      tokenTypes[22].updateContext = (context2) => {
        if (context2[context2.length - 1] === types13.template) {
          context2.pop();
        } else {
          context2.push(types13.template);
        }
      };
      tokenTypes[143].updateContext = (context2) => {
        context2.push(types13.j_expr, types13.j_oTag);
      };
    }
    var nonASCIIidentifierStartChars = "\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC";
    var nonASCIIidentifierChars = "\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65";
    var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]");
    var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]");
    nonASCIIidentifierStartChars = nonASCIIidentifierChars = null;
    var astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 4, 51, 13, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 39, 27, 10, 22, 251, 41, 7, 1, 17, 2, 60, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 20, 1, 64, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 31, 9, 2, 0, 3, 0, 2, 37, 2, 0, 26, 0, 2, 0, 45, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 200, 32, 32, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 16, 0, 2, 12, 2, 33, 125, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 26, 3994, 6, 582, 6842, 29, 1763, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 433, 44, 212, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 42, 9, 8936, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322, 29, 19, 43, 485, 27, 229, 29, 3, 0, 496, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4153, 7, 221, 3, 5761, 15, 7472, 16, 621, 2467, 541, 1507, 4938, 6, 4191];
    var astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 7, 9, 32, 4, 318, 1, 80, 3, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 68, 8, 2, 0, 3, 0, 2, 3, 2, 4, 2, 0, 15, 1, 83, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 7, 19, 58, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 343, 9, 54, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 10, 5350, 0, 7, 14, 11465, 27, 2343, 9, 87, 9, 39, 4, 60, 6, 26, 9, 535, 9, 470, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4178, 9, 519, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 245, 1, 2, 9, 726, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];
    function isInAstralSet(code2, set) {
      let pos = 65536;
      for (let i7 = 0, length = set.length; i7 < length; i7 += 2) {
        pos += set[i7];
        if (pos > code2) return false;
        pos += set[i7 + 1];
        if (pos >= code2) return true;
      }
      return false;
    }
    __name(isInAstralSet, "isInAstralSet");
    function isIdentifierStart(code2) {
      if (code2 < 65) return code2 === 36;
      if (code2 <= 90) return true;
      if (code2 < 97) return code2 === 95;
      if (code2 <= 122) return true;
      if (code2 <= 65535) {
        return code2 >= 170 && nonASCIIidentifierStart.test(String.fromCharCode(code2));
      }
      return isInAstralSet(code2, astralIdentifierStartCodes);
    }
    __name(isIdentifierStart, "isIdentifierStart");
    function isIdentifierChar(code2) {
      if (code2 < 48) return code2 === 36;
      if (code2 < 58) return true;
      if (code2 < 65) return false;
      if (code2 <= 90) return true;
      if (code2 < 97) return code2 === 95;
      if (code2 <= 122) return true;
      if (code2 <= 65535) {
        return code2 >= 170 && nonASCIIidentifier.test(String.fromCharCode(code2));
      }
      return isInAstralSet(code2, astralIdentifierStartCodes) || isInAstralSet(code2, astralIdentifierCodes);
    }
    __name(isIdentifierChar, "isIdentifierChar");
    var reservedWords = {
      keyword: ["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete"],
      strict: ["implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"],
      strictBind: ["eval", "arguments"]
    };
    var keywords = new Set(reservedWords.keyword);
    var reservedWordsStrictSet = new Set(reservedWords.strict);
    var reservedWordsStrictBindSet = new Set(reservedWords.strictBind);
    function isReservedWord(word, inModule) {
      return inModule && word === "await" || word === "enum";
    }
    __name(isReservedWord, "isReservedWord");
    function isStrictReservedWord(word, inModule) {
      return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word);
    }
    __name(isStrictReservedWord, "isStrictReservedWord");
    function isStrictBindOnlyReservedWord(word) {
      return reservedWordsStrictBindSet.has(word);
    }
    __name(isStrictBindOnlyReservedWord, "isStrictBindOnlyReservedWord");
    function isStrictBindReservedWord(word, inModule) {
      return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word);
    }
    __name(isStrictBindReservedWord, "isStrictBindReservedWord");
    function isKeyword(word) {
      return keywords.has(word);
    }
    __name(isKeyword, "isKeyword");
    function isIteratorStart(current, next, next2) {
      return current === 64 && next === 64 && isIdentifierStart(next2);
    }
    __name(isIteratorStart, "isIteratorStart");
    var reservedWordLikeSet = /* @__PURE__ */ new Set(["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete", "implements", "interface", "let", "package", "private", "protected", "public", "static", "yield", "eval", "arguments", "enum", "await"]);
    function canBeReservedWord(word) {
      return reservedWordLikeSet.has(word);
    }
    __name(canBeReservedWord, "canBeReservedWord");
    var Scope2 = class {
      static {
        __name(this, "Scope");
      }
      constructor(flags2) {
        this.flags = 0;
        this.names = /* @__PURE__ */ new Map();
        this.firstLexicalName = "";
        this.flags = flags2;
      }
    };
    var ScopeHandler = class {
      static {
        __name(this, "ScopeHandler");
      }
      constructor(parser2, inModule) {
        this.parser = void 0;
        this.scopeStack = [];
        this.inModule = void 0;
        this.undefinedExports = /* @__PURE__ */ new Map();
        this.parser = parser2;
        this.inModule = inModule;
      }
      get inTopLevel() {
        return (this.currentScope().flags & 1) > 0;
      }
      get inFunction() {
        return (this.currentVarScopeFlags() & 2) > 0;
      }
      get allowSuper() {
        return (this.currentThisScopeFlags() & 16) > 0;
      }
      get allowDirectSuper() {
        return (this.currentThisScopeFlags() & 32) > 0;
      }
      get inClass() {
        return (this.currentThisScopeFlags() & 64) > 0;
      }
      get inClassAndNotInNonArrowFunction() {
        const flags2 = this.currentThisScopeFlags();
        return (flags2 & 64) > 0 && (flags2 & 2) === 0;
      }
      get inStaticBlock() {
        for (let i7 = this.scopeStack.length - 1; ; i7--) {
          const {
            flags: flags2
          } = this.scopeStack[i7];
          if (flags2 & 128) {
            return true;
          }
          if (flags2 & (387 | 64)) {
            return false;
          }
        }
      }
      get inNonArrowFunction() {
        return (this.currentThisScopeFlags() & 2) > 0;
      }
      get treatFunctionsAsVar() {
        return this.treatFunctionsAsVarInScope(this.currentScope());
      }
      createScope(flags2) {
        return new Scope2(flags2);
      }
      enter(flags2) {
        this.scopeStack.push(this.createScope(flags2));
      }
      exit() {
        const scope = this.scopeStack.pop();
        return scope.flags;
      }
      treatFunctionsAsVarInScope(scope) {
        return !!(scope.flags & (2 | 128) || !this.parser.inModule && scope.flags & 1);
      }
      declareName(name2, bindingType, loc) {
        let scope = this.currentScope();
        if (bindingType & 8 || bindingType & 16) {
          this.checkRedeclarationInScope(scope, name2, bindingType, loc);
          let type = scope.names.get(name2) || 0;
          if (bindingType & 16) {
            type = type | 4;
          } else {
            if (!scope.firstLexicalName) {
              scope.firstLexicalName = name2;
            }
            type = type | 2;
          }
          scope.names.set(name2, type);
          if (bindingType & 8) {
            this.maybeExportDefined(scope, name2);
          }
        } else if (bindingType & 4) {
          for (let i7 = this.scopeStack.length - 1; i7 >= 0; --i7) {
            scope = this.scopeStack[i7];
            this.checkRedeclarationInScope(scope, name2, bindingType, loc);
            scope.names.set(name2, (scope.names.get(name2) || 0) | 1);
            this.maybeExportDefined(scope, name2);
            if (scope.flags & 387) break;
          }
        }
        if (this.parser.inModule && scope.flags & 1) {
          this.undefinedExports.delete(name2);
        }
      }
      maybeExportDefined(scope, name2) {
        if (this.parser.inModule && scope.flags & 1) {
          this.undefinedExports.delete(name2);
        }
      }
      checkRedeclarationInScope(scope, name2, bindingType, loc) {
        if (this.isRedeclaredInScope(scope, name2, bindingType)) {
          this.parser.raise(Errors.VarRedeclaration, loc, {
            identifierName: name2
          });
        }
      }
      isRedeclaredInScope(scope, name2, bindingType) {
        if (!(bindingType & 1)) return false;
        if (bindingType & 8) {
          return scope.names.has(name2);
        }
        const type = scope.names.get(name2);
        if (bindingType & 16) {
          return (type & 2) > 0 || !this.treatFunctionsAsVarInScope(scope) && (type & 1) > 0;
        }
        return (type & 2) > 0 && !(scope.flags & 8 && scope.firstLexicalName === name2) || !this.treatFunctionsAsVarInScope(scope) && (type & 4) > 0;
      }
      checkLocalExport(id) {
        const {
          name: name2
        } = id;
        const topLevelScope = this.scopeStack[0];
        if (!topLevelScope.names.has(name2)) {
          this.undefinedExports.set(name2, id.loc.start);
        }
      }
      currentScope() {
        return this.scopeStack[this.scopeStack.length - 1];
      }
      currentVarScopeFlags() {
        for (let i7 = this.scopeStack.length - 1; ; i7--) {
          const {
            flags: flags2
          } = this.scopeStack[i7];
          if (flags2 & 387) {
            return flags2;
          }
        }
      }
      currentThisScopeFlags() {
        for (let i7 = this.scopeStack.length - 1; ; i7--) {
          const {
            flags: flags2
          } = this.scopeStack[i7];
          if (flags2 & (387 | 64) && !(flags2 & 4)) {
            return flags2;
          }
        }
      }
    };
    var FlowScope = class extends Scope2 {
      static {
        __name(this, "FlowScope");
      }
      constructor(...args) {
        super(...args);
        this.declareFunctions = /* @__PURE__ */ new Set();
      }
    };
    var FlowScopeHandler = class extends ScopeHandler {
      static {
        __name(this, "FlowScopeHandler");
      }
      createScope(flags2) {
        return new FlowScope(flags2);
      }
      declareName(name2, bindingType, loc) {
        const scope = this.currentScope();
        if (bindingType & 2048) {
          this.checkRedeclarationInScope(scope, name2, bindingType, loc);
          this.maybeExportDefined(scope, name2);
          scope.declareFunctions.add(name2);
          return;
        }
        super.declareName(name2, bindingType, loc);
      }
      isRedeclaredInScope(scope, name2, bindingType) {
        if (super.isRedeclaredInScope(scope, name2, bindingType)) return true;
        if (bindingType & 2048 && !scope.declareFunctions.has(name2)) {
          const type = scope.names.get(name2);
          return (type & 4) > 0 || (type & 2) > 0;
        }
        return false;
      }
      checkLocalExport(id) {
        if (!this.scopeStack[0].declareFunctions.has(id.name)) {
          super.checkLocalExport(id);
        }
      }
    };
    var BaseParser = class {
      static {
        __name(this, "BaseParser");
      }
      constructor() {
        this.sawUnambiguousESM = false;
        this.ambiguousScriptDifferentAst = false;
      }
      sourceToOffsetPos(sourcePos) {
        return sourcePos + this.startIndex;
      }
      offsetToSourcePos(offsetPos) {
        return offsetPos - this.startIndex;
      }
      hasPlugin(pluginConfig) {
        if (typeof pluginConfig === "string") {
          return this.plugins.has(pluginConfig);
        } else {
          const [pluginName, pluginOptions] = pluginConfig;
          if (!this.hasPlugin(pluginName)) {
            return false;
          }
          const actualOptions = this.plugins.get(pluginName);
          for (const key of Object.keys(pluginOptions)) {
            if ((actualOptions == null ? void 0 : actualOptions[key]) !== pluginOptions[key]) {
              return false;
            }
          }
          return true;
        }
      }
      getPluginOption(plugin, name2) {
        var _this$plugins$get;
        return (_this$plugins$get = this.plugins.get(plugin)) == null ? void 0 : _this$plugins$get[name2];
      }
    };
    function setTrailingComments(node2, comments) {
      if (node2.trailingComments === void 0) {
        node2.trailingComments = comments;
      } else {
        node2.trailingComments.unshift(...comments);
      }
    }
    __name(setTrailingComments, "setTrailingComments");
    function setLeadingComments(node2, comments) {
      if (node2.leadingComments === void 0) {
        node2.leadingComments = comments;
      } else {
        node2.leadingComments.unshift(...comments);
      }
    }
    __name(setLeadingComments, "setLeadingComments");
    function setInnerComments(node2, comments) {
      if (node2.innerComments === void 0) {
        node2.innerComments = comments;
      } else {
        node2.innerComments.unshift(...comments);
      }
    }
    __name(setInnerComments, "setInnerComments");
    function adjustInnerComments(node2, elements, commentWS) {
      let lastElement = null;
      let i7 = elements.length;
      while (lastElement === null && i7 > 0) {
        lastElement = elements[--i7];
      }
      if (lastElement === null || lastElement.start > commentWS.start) {
        setInnerComments(node2, commentWS.comments);
      } else {
        setTrailingComments(lastElement, commentWS.comments);
      }
    }
    __name(adjustInnerComments, "adjustInnerComments");
    var CommentsParser = class extends BaseParser {
      static {
        __name(this, "CommentsParser");
      }
      addComment(comment) {
        if (this.filename) comment.loc.filename = this.filename;
        const {
          commentsLen
        } = this.state;
        if (this.comments.length !== commentsLen) {
          this.comments.length = commentsLen;
        }
        this.comments.push(comment);
        this.state.commentsLen++;
      }
      processComment(node2) {
        const {
          commentStack
        } = this.state;
        const commentStackLength = commentStack.length;
        if (commentStackLength === 0) return;
        let i7 = commentStackLength - 1;
        const lastCommentWS = commentStack[i7];
        if (lastCommentWS.start === node2.end) {
          lastCommentWS.leadingNode = node2;
          i7--;
        }
        const {
          start: nodeStart
        } = node2;
        for (; i7 >= 0; i7--) {
          const commentWS = commentStack[i7];
          const commentEnd = commentWS.end;
          if (commentEnd > nodeStart) {
            commentWS.containingNode = node2;
            this.finalizeComment(commentWS);
            commentStack.splice(i7, 1);
          } else {
            if (commentEnd === nodeStart) {
              commentWS.trailingNode = node2;
            }
            break;
          }
        }
      }
      finalizeComment(commentWS) {
        const {
          comments
        } = commentWS;
        if (commentWS.leadingNode !== null || commentWS.trailingNode !== null) {
          if (commentWS.leadingNode !== null) {
            setTrailingComments(commentWS.leadingNode, comments);
          }
          if (commentWS.trailingNode !== null) {
            setLeadingComments(commentWS.trailingNode, comments);
          }
        } else {
          const {
            containingNode: node2,
            start: commentStart
          } = commentWS;
          if (this.input.charCodeAt(this.offsetToSourcePos(commentStart) - 1) === 44) {
            switch (node2.type) {
              case "ObjectExpression":
              case "ObjectPattern":
              case "RecordExpression":
                adjustInnerComments(node2, node2.properties, commentWS);
                break;
              case "CallExpression":
              case "OptionalCallExpression":
                adjustInnerComments(node2, node2.arguments, commentWS);
                break;
              case "FunctionDeclaration":
              case "FunctionExpression":
              case "ArrowFunctionExpression":
              case "ObjectMethod":
              case "ClassMethod":
              case "ClassPrivateMethod":
                adjustInnerComments(node2, node2.params, commentWS);
                break;
              case "ArrayExpression":
              case "ArrayPattern":
              case "TupleExpression":
                adjustInnerComments(node2, node2.elements, commentWS);
                break;
              case "ExportNamedDeclaration":
              case "ImportDeclaration":
                adjustInnerComments(node2, node2.specifiers, commentWS);
                break;
              default: {
                setInnerComments(node2, comments);
              }
            }
          } else {
            setInnerComments(node2, comments);
          }
        }
      }
      finalizeRemainingComments() {
        const {
          commentStack
        } = this.state;
        for (let i7 = commentStack.length - 1; i7 >= 0; i7--) {
          this.finalizeComment(commentStack[i7]);
        }
        this.state.commentStack = [];
      }
      resetPreviousNodeTrailingComments(node2) {
        const {
          commentStack
        } = this.state;
        const {
          length
        } = commentStack;
        if (length === 0) return;
        const commentWS = commentStack[length - 1];
        if (commentWS.leadingNode === node2) {
          commentWS.leadingNode = null;
        }
      }
      resetPreviousIdentifierLeadingComments(node2) {
        const {
          commentStack
        } = this.state;
        const {
          length
        } = commentStack;
        if (length === 0) return;
        if (commentStack[length - 1].trailingNode === node2) {
          commentStack[length - 1].trailingNode = null;
        } else if (length >= 2 && commentStack[length - 2].trailingNode === node2) {
          commentStack[length - 2].trailingNode = null;
        }
      }
      takeSurroundingComments(node2, start, end) {
        const {
          commentStack
        } = this.state;
        const commentStackLength = commentStack.length;
        if (commentStackLength === 0) return;
        let i7 = commentStackLength - 1;
        for (; i7 >= 0; i7--) {
          const commentWS = commentStack[i7];
          const commentEnd = commentWS.end;
          const commentStart = commentWS.start;
          if (commentStart === end) {
            commentWS.leadingNode = node2;
          } else if (commentEnd === start) {
            commentWS.trailingNode = node2;
          } else if (commentEnd < start) {
            break;
          }
        }
      }
    };
    var lineBreak = /\r\n|[\r\n\u2028\u2029]/;
    var lineBreakG = new RegExp(lineBreak.source, "g");
    function isNewLine(code2) {
      switch (code2) {
        case 10:
        case 13:
        case 8232:
        case 8233:
          return true;
        default:
          return false;
      }
    }
    __name(isNewLine, "isNewLine");
    function hasNewLine(input, start, end) {
      for (let i7 = start; i7 < end; i7++) {
        if (isNewLine(input.charCodeAt(i7))) {
          return true;
        }
      }
      return false;
    }
    __name(hasNewLine, "hasNewLine");
    var skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g;
    var skipWhiteSpaceInLine = /(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/g;
    function isWhitespace(code2) {
      switch (code2) {
        case 9:
        case 11:
        case 12:
        case 32:
        case 160:
        case 5760:
        case 8192:
        case 8193:
        case 8194:
        case 8195:
        case 8196:
        case 8197:
        case 8198:
        case 8199:
        case 8200:
        case 8201:
        case 8202:
        case 8239:
        case 8287:
        case 12288:
        case 65279:
          return true;
        default:
          return false;
      }
    }
    __name(isWhitespace, "isWhitespace");
    var State = class _State {
      static {
        __name(this, "State");
      }
      constructor() {
        this.flags = 1024;
        this.startIndex = void 0;
        this.curLine = void 0;
        this.lineStart = void 0;
        this.startLoc = void 0;
        this.endLoc = void 0;
        this.errors = [];
        this.potentialArrowAt = -1;
        this.noArrowAt = [];
        this.noArrowParamsConversionAt = [];
        this.topicContext = {
          maxNumOfResolvableTopics: 0,
          maxTopicIndex: null
        };
        this.labels = [];
        this.commentsLen = 0;
        this.commentStack = [];
        this.pos = 0;
        this.type = 140;
        this.value = null;
        this.start = 0;
        this.end = 0;
        this.lastTokEndLoc = null;
        this.lastTokStartLoc = null;
        this.context = [types13.brace];
        this.firstInvalidTemplateEscapePos = null;
        this.strictErrors = /* @__PURE__ */ new Map();
        this.tokensLength = 0;
      }
      get strict() {
        return (this.flags & 1) > 0;
      }
      set strict(v8) {
        if (v8) this.flags |= 1;
        else this.flags &= -2;
      }
      init({
        strictMode,
        sourceType,
        startIndex,
        startLine,
        startColumn
      }) {
        this.strict = strictMode === false ? false : strictMode === true ? true : sourceType === "module";
        this.startIndex = startIndex;
        this.curLine = startLine;
        this.lineStart = -startColumn;
        this.startLoc = this.endLoc = new Position(startLine, startColumn, startIndex);
      }
      get maybeInArrowParameters() {
        return (this.flags & 2) > 0;
      }
      set maybeInArrowParameters(v8) {
        if (v8) this.flags |= 2;
        else this.flags &= -3;
      }
      get inType() {
        return (this.flags & 4) > 0;
      }
      set inType(v8) {
        if (v8) this.flags |= 4;
        else this.flags &= -5;
      }
      get noAnonFunctionType() {
        return (this.flags & 8) > 0;
      }
      set noAnonFunctionType(v8) {
        if (v8) this.flags |= 8;
        else this.flags &= -9;
      }
      get hasFlowComment() {
        return (this.flags & 16) > 0;
      }
      set hasFlowComment(v8) {
        if (v8) this.flags |= 16;
        else this.flags &= -17;
      }
      get isAmbientContext() {
        return (this.flags & 32) > 0;
      }
      set isAmbientContext(v8) {
        if (v8) this.flags |= 32;
        else this.flags &= -33;
      }
      get inAbstractClass() {
        return (this.flags & 64) > 0;
      }
      set inAbstractClass(v8) {
        if (v8) this.flags |= 64;
        else this.flags &= -65;
      }
      get inDisallowConditionalTypesContext() {
        return (this.flags & 128) > 0;
      }
      set inDisallowConditionalTypesContext(v8) {
        if (v8) this.flags |= 128;
        else this.flags &= -129;
      }
      get soloAwait() {
        return (this.flags & 256) > 0;
      }
      set soloAwait(v8) {
        if (v8) this.flags |= 256;
        else this.flags &= -257;
      }
      get inFSharpPipelineDirectBody() {
        return (this.flags & 512) > 0;
      }
      set inFSharpPipelineDirectBody(v8) {
        if (v8) this.flags |= 512;
        else this.flags &= -513;
      }
      get canStartJSXElement() {
        return (this.flags & 1024) > 0;
      }
      set canStartJSXElement(v8) {
        if (v8) this.flags |= 1024;
        else this.flags &= -1025;
      }
      get containsEsc() {
        return (this.flags & 2048) > 0;
      }
      set containsEsc(v8) {
        if (v8) this.flags |= 2048;
        else this.flags &= -2049;
      }
      get hasTopLevelAwait() {
        return (this.flags & 4096) > 0;
      }
      set hasTopLevelAwait(v8) {
        if (v8) this.flags |= 4096;
        else this.flags &= -4097;
      }
      curPosition() {
        return new Position(this.curLine, this.pos - this.lineStart, this.pos + this.startIndex);
      }
      clone() {
        const state2 = new _State();
        state2.flags = this.flags;
        state2.startIndex = this.startIndex;
        state2.curLine = this.curLine;
        state2.lineStart = this.lineStart;
        state2.startLoc = this.startLoc;
        state2.endLoc = this.endLoc;
        state2.errors = this.errors.slice();
        state2.potentialArrowAt = this.potentialArrowAt;
        state2.noArrowAt = this.noArrowAt.slice();
        state2.noArrowParamsConversionAt = this.noArrowParamsConversionAt.slice();
        state2.topicContext = this.topicContext;
        state2.labels = this.labels.slice();
        state2.commentsLen = this.commentsLen;
        state2.commentStack = this.commentStack.slice();
        state2.pos = this.pos;
        state2.type = this.type;
        state2.value = this.value;
        state2.start = this.start;
        state2.end = this.end;
        state2.lastTokEndLoc = this.lastTokEndLoc;
        state2.lastTokStartLoc = this.lastTokStartLoc;
        state2.context = this.context.slice();
        state2.firstInvalidTemplateEscapePos = this.firstInvalidTemplateEscapePos;
        state2.strictErrors = this.strictErrors;
        state2.tokensLength = this.tokensLength;
        return state2;
      }
    };
    var _isDigit = /* @__PURE__ */ __name(function isDigit3(code2) {
      return code2 >= 48 && code2 <= 57;
    }, "isDigit");
    var forbiddenNumericSeparatorSiblings = {
      decBinOct: /* @__PURE__ */ new Set([46, 66, 69, 79, 95, 98, 101, 111]),
      hex: /* @__PURE__ */ new Set([46, 88, 95, 120])
    };
    var isAllowedNumericSeparatorSibling = {
      bin: /* @__PURE__ */ __name((ch2) => ch2 === 48 || ch2 === 49, "bin"),
      oct: /* @__PURE__ */ __name((ch2) => ch2 >= 48 && ch2 <= 55, "oct"),
      dec: /* @__PURE__ */ __name((ch2) => ch2 >= 48 && ch2 <= 57, "dec"),
      hex: /* @__PURE__ */ __name((ch2) => ch2 >= 48 && ch2 <= 57 || ch2 >= 65 && ch2 <= 70 || ch2 >= 97 && ch2 <= 102, "hex")
    };
    function readStringContents(type, input, pos, lineStart, curLine, errors) {
      const initialPos = pos;
      const initialLineStart = lineStart;
      const initialCurLine = curLine;
      let out = "";
      let firstInvalidLoc = null;
      let chunkStart = pos;
      const {
        length
      } = input;
      for (; ; ) {
        if (pos >= length) {
          errors.unterminated(initialPos, initialLineStart, initialCurLine);
          out += input.slice(chunkStart, pos);
          break;
        }
        const ch2 = input.charCodeAt(pos);
        if (isStringEnd(type, ch2, input, pos)) {
          out += input.slice(chunkStart, pos);
          break;
        }
        if (ch2 === 92) {
          out += input.slice(chunkStart, pos);
          const res = readEscapedChar(input, pos, lineStart, curLine, type === "template", errors);
          if (res.ch === null && !firstInvalidLoc) {
            firstInvalidLoc = {
              pos,
              lineStart,
              curLine
            };
          } else {
            out += res.ch;
          }
          ({
            pos,
            lineStart,
            curLine
          } = res);
          chunkStart = pos;
        } else if (ch2 === 8232 || ch2 === 8233) {
          ++pos;
          ++curLine;
          lineStart = pos;
        } else if (ch2 === 10 || ch2 === 13) {
          if (type === "template") {
            out += input.slice(chunkStart, pos) + "\n";
            ++pos;
            if (ch2 === 13 && input.charCodeAt(pos) === 10) {
              ++pos;
            }
            ++curLine;
            chunkStart = lineStart = pos;
          } else {
            errors.unterminated(initialPos, initialLineStart, initialCurLine);
          }
        } else {
          ++pos;
        }
      }
      return {
        pos,
        str: out,
        firstInvalidLoc,
        lineStart,
        curLine,
        containsInvalid: !!firstInvalidLoc
      };
    }
    __name(readStringContents, "readStringContents");
    function isStringEnd(type, ch2, input, pos) {
      if (type === "template") {
        return ch2 === 96 || ch2 === 36 && input.charCodeAt(pos + 1) === 123;
      }
      return ch2 === (type === "double" ? 34 : 39);
    }
    __name(isStringEnd, "isStringEnd");
    function readEscapedChar(input, pos, lineStart, curLine, inTemplate, errors) {
      const throwOnInvalid = !inTemplate;
      pos++;
      const res = /* @__PURE__ */ __name((ch3) => ({
        pos,
        ch: ch3,
        lineStart,
        curLine
      }), "res");
      const ch2 = input.charCodeAt(pos++);
      switch (ch2) {
        case 110:
          return res("\n");
        case 114:
          return res("\r");
        case 120: {
          let code2;
          ({
            code: code2,
            pos
          } = readHexChar(input, pos, lineStart, curLine, 2, false, throwOnInvalid, errors));
          return res(code2 === null ? null : String.fromCharCode(code2));
        }
        case 117: {
          let code2;
          ({
            code: code2,
            pos
          } = readCodePoint(input, pos, lineStart, curLine, throwOnInvalid, errors));
          return res(code2 === null ? null : String.fromCodePoint(code2));
        }
        case 116:
          return res("	");
        case 98:
          return res("\b");
        case 118:
          return res("\v");
        case 102:
          return res("\f");
        case 13:
          if (input.charCodeAt(pos) === 10) {
            ++pos;
          }
        case 10:
          lineStart = pos;
          ++curLine;
        case 8232:
        case 8233:
          return res("");
        case 56:
        case 57:
          if (inTemplate) {
            return res(null);
          } else {
            errors.strictNumericEscape(pos - 1, lineStart, curLine);
          }
        default:
          if (ch2 >= 48 && ch2 <= 55) {
            const startPos = pos - 1;
            const match3 = /^[0-7]+/.exec(input.slice(startPos, pos + 2));
            let octalStr = match3[0];
            let octal = parseInt(octalStr, 8);
            if (octal > 255) {
              octalStr = octalStr.slice(0, -1);
              octal = parseInt(octalStr, 8);
            }
            pos += octalStr.length - 1;
            const next = input.charCodeAt(pos);
            if (octalStr !== "0" || next === 56 || next === 57) {
              if (inTemplate) {
                return res(null);
              } else {
                errors.strictNumericEscape(startPos, lineStart, curLine);
              }
            }
            return res(String.fromCharCode(octal));
          }
          return res(String.fromCharCode(ch2));
      }
    }
    __name(readEscapedChar, "readEscapedChar");
    function readHexChar(input, pos, lineStart, curLine, len, forceLen, throwOnInvalid, errors) {
      const initialPos = pos;
      let n9;
      ({
        n: n9,
        pos
      } = readInt(input, pos, lineStart, curLine, 16, len, forceLen, false, errors, !throwOnInvalid));
      if (n9 === null) {
        if (throwOnInvalid) {
          errors.invalidEscapeSequence(initialPos, lineStart, curLine);
        } else {
          pos = initialPos - 1;
        }
      }
      return {
        code: n9,
        pos
      };
    }
    __name(readHexChar, "readHexChar");
    function readInt(input, pos, lineStart, curLine, radix, len, forceLen, allowNumSeparator, errors, bailOnError) {
      const start = pos;
      const forbiddenSiblings = radix === 16 ? forbiddenNumericSeparatorSiblings.hex : forbiddenNumericSeparatorSiblings.decBinOct;
      const isAllowedSibling = radix === 16 ? isAllowedNumericSeparatorSibling.hex : radix === 10 ? isAllowedNumericSeparatorSibling.dec : radix === 8 ? isAllowedNumericSeparatorSibling.oct : isAllowedNumericSeparatorSibling.bin;
      let invalid = false;
      let total = 0;
      for (let i7 = 0, e10 = len == null ? Infinity : len; i7 < e10; ++i7) {
        const code2 = input.charCodeAt(pos);
        let val2;
        if (code2 === 95 && allowNumSeparator !== "bail") {
          const prev = input.charCodeAt(pos - 1);
          const next = input.charCodeAt(pos + 1);
          if (!allowNumSeparator) {
            if (bailOnError) return {
              n: null,
              pos
            };
            errors.numericSeparatorInEscapeSequence(pos, lineStart, curLine);
          } else if (Number.isNaN(next) || !isAllowedSibling(next) || forbiddenSiblings.has(prev) || forbiddenSiblings.has(next)) {
            if (bailOnError) return {
              n: null,
              pos
            };
            errors.unexpectedNumericSeparator(pos, lineStart, curLine);
          }
          ++pos;
          continue;
        }
        if (code2 >= 97) {
          val2 = code2 - 97 + 10;
        } else if (code2 >= 65) {
          val2 = code2 - 65 + 10;
        } else if (_isDigit(code2)) {
          val2 = code2 - 48;
        } else {
          val2 = Infinity;
        }
        if (val2 >= radix) {
          if (val2 <= 9 && bailOnError) {
            return {
              n: null,
              pos
            };
          } else if (val2 <= 9 && errors.invalidDigit(pos, lineStart, curLine, radix)) {
            val2 = 0;
          } else if (forceLen) {
            val2 = 0;
            invalid = true;
          } else {
            break;
          }
        }
        ++pos;
        total = total * radix + val2;
      }
      if (pos === start || len != null && pos - start !== len || invalid) {
        return {
          n: null,
          pos
        };
      }
      return {
        n: total,
        pos
      };
    }
    __name(readInt, "readInt");
    function readCodePoint(input, pos, lineStart, curLine, throwOnInvalid, errors) {
      const ch2 = input.charCodeAt(pos);
      let code2;
      if (ch2 === 123) {
        ++pos;
        ({
          code: code2,
          pos
        } = readHexChar(input, pos, lineStart, curLine, input.indexOf("}", pos) - pos, true, throwOnInvalid, errors));
        ++pos;
        if (code2 !== null && code2 > 1114111) {
          if (throwOnInvalid) {
            errors.invalidCodePoint(pos, lineStart, curLine);
          } else {
            return {
              code: null,
              pos
            };
          }
        }
      } else {
        ({
          code: code2,
          pos
        } = readHexChar(input, pos, lineStart, curLine, 4, false, throwOnInvalid, errors));
      }
      return {
        code: code2,
        pos
      };
    }
    __name(readCodePoint, "readCodePoint");
    function buildPosition(pos, lineStart, curLine) {
      return new Position(curLine, pos - lineStart, pos);
    }
    __name(buildPosition, "buildPosition");
    var VALID_REGEX_FLAGS = /* @__PURE__ */ new Set([103, 109, 115, 105, 121, 117, 100, 118]);
    var Token4 = class {
      static {
        __name(this, "Token");
      }
      constructor(state2) {
        const startIndex = state2.startIndex || 0;
        this.type = state2.type;
        this.value = state2.value;
        this.start = startIndex + state2.start;
        this.end = startIndex + state2.end;
        this.loc = new SourceLocation(state2.startLoc, state2.endLoc);
      }
    };
    var Tokenizer = class extends CommentsParser {
      static {
        __name(this, "Tokenizer");
      }
      constructor(options, input) {
        super();
        this.isLookahead = void 0;
        this.tokens = [];
        this.errorHandlers_readInt = {
          invalidDigit: /* @__PURE__ */ __name((pos, lineStart, curLine, radix) => {
            if (!this.options.errorRecovery) return false;
            this.raise(Errors.InvalidDigit, buildPosition(pos, lineStart, curLine), {
              radix
            });
            return true;
          }, "invalidDigit"),
          numericSeparatorInEscapeSequence: this.errorBuilder(Errors.NumericSeparatorInEscapeSequence),
          unexpectedNumericSeparator: this.errorBuilder(Errors.UnexpectedNumericSeparator)
        };
        this.errorHandlers_readCodePoint = Object.assign({}, this.errorHandlers_readInt, {
          invalidEscapeSequence: this.errorBuilder(Errors.InvalidEscapeSequence),
          invalidCodePoint: this.errorBuilder(Errors.InvalidCodePoint)
        });
        this.errorHandlers_readStringContents_string = Object.assign({}, this.errorHandlers_readCodePoint, {
          strictNumericEscape: /* @__PURE__ */ __name((pos, lineStart, curLine) => {
            this.recordStrictModeErrors(Errors.StrictNumericEscape, buildPosition(pos, lineStart, curLine));
          }, "strictNumericEscape"),
          unterminated: /* @__PURE__ */ __name((pos, lineStart, curLine) => {
            throw this.raise(Errors.UnterminatedString, buildPosition(pos - 1, lineStart, curLine));
          }, "unterminated")
        });
        this.errorHandlers_readStringContents_template = Object.assign({}, this.errorHandlers_readCodePoint, {
          strictNumericEscape: this.errorBuilder(Errors.StrictNumericEscape),
          unterminated: /* @__PURE__ */ __name((pos, lineStart, curLine) => {
            throw this.raise(Errors.UnterminatedTemplate, buildPosition(pos, lineStart, curLine));
          }, "unterminated")
        });
        this.state = new State();
        this.state.init(options);
        this.input = input;
        this.length = input.length;
        this.comments = [];
        this.isLookahead = false;
      }
      pushToken(token) {
        this.tokens.length = this.state.tokensLength;
        this.tokens.push(token);
        ++this.state.tokensLength;
      }
      next() {
        this.checkKeywordEscapes();
        if (this.options.tokens) {
          this.pushToken(new Token4(this.state));
        }
        this.state.lastTokEndLoc = this.state.endLoc;
        this.state.lastTokStartLoc = this.state.startLoc;
        this.nextToken();
      }
      eat(type) {
        if (this.match(type)) {
          this.next();
          return true;
        } else {
          return false;
        }
      }
      match(type) {
        return this.state.type === type;
      }
      createLookaheadState(state2) {
        return {
          pos: state2.pos,
          value: null,
          type: state2.type,
          start: state2.start,
          end: state2.end,
          context: [this.curContext()],
          inType: state2.inType,
          startLoc: state2.startLoc,
          lastTokEndLoc: state2.lastTokEndLoc,
          curLine: state2.curLine,
          lineStart: state2.lineStart,
          curPosition: state2.curPosition
        };
      }
      lookahead() {
        const old = this.state;
        this.state = this.createLookaheadState(old);
        this.isLookahead = true;
        this.nextToken();
        this.isLookahead = false;
        const curr = this.state;
        this.state = old;
        return curr;
      }
      nextTokenStart() {
        return this.nextTokenStartSince(this.state.pos);
      }
      nextTokenStartSince(pos) {
        skipWhiteSpace.lastIndex = pos;
        return skipWhiteSpace.test(this.input) ? skipWhiteSpace.lastIndex : pos;
      }
      lookaheadCharCode() {
        return this.input.charCodeAt(this.nextTokenStart());
      }
      nextTokenInLineStart() {
        return this.nextTokenInLineStartSince(this.state.pos);
      }
      nextTokenInLineStartSince(pos) {
        skipWhiteSpaceInLine.lastIndex = pos;
        return skipWhiteSpaceInLine.test(this.input) ? skipWhiteSpaceInLine.lastIndex : pos;
      }
      lookaheadInLineCharCode() {
        return this.input.charCodeAt(this.nextTokenInLineStart());
      }
      codePointAtPos(pos) {
        let cp3 = this.input.charCodeAt(pos);
        if ((cp3 & 64512) === 55296 && ++pos < this.input.length) {
          const trail = this.input.charCodeAt(pos);
          if ((trail & 64512) === 56320) {
            cp3 = 65536 + ((cp3 & 1023) << 10) + (trail & 1023);
          }
        }
        return cp3;
      }
      setStrict(strict) {
        this.state.strict = strict;
        if (strict) {
          this.state.strictErrors.forEach(([toParseError, at3]) => this.raise(toParseError, at3));
          this.state.strictErrors.clear();
        }
      }
      curContext() {
        return this.state.context[this.state.context.length - 1];
      }
      nextToken() {
        this.skipSpace();
        this.state.start = this.state.pos;
        if (!this.isLookahead) this.state.startLoc = this.state.curPosition();
        if (this.state.pos >= this.length) {
          this.finishToken(140);
          return;
        }
        this.getTokenFromCode(this.codePointAtPos(this.state.pos));
      }
      skipBlockComment(commentEnd) {
        let startLoc;
        if (!this.isLookahead) startLoc = this.state.curPosition();
        const start = this.state.pos;
        const end = this.input.indexOf(commentEnd, start + 2);
        if (end === -1) {
          throw this.raise(Errors.UnterminatedComment, this.state.curPosition());
        }
        this.state.pos = end + commentEnd.length;
        lineBreakG.lastIndex = start + 2;
        while (lineBreakG.test(this.input) && lineBreakG.lastIndex <= end) {
          ++this.state.curLine;
          this.state.lineStart = lineBreakG.lastIndex;
        }
        if (this.isLookahead) return;
        const comment = {
          type: "CommentBlock",
          value: this.input.slice(start + 2, end),
          start: this.sourceToOffsetPos(start),
          end: this.sourceToOffsetPos(end + commentEnd.length),
          loc: new SourceLocation(startLoc, this.state.curPosition())
        };
        if (this.options.tokens) this.pushToken(comment);
        return comment;
      }
      skipLineComment(startSkip) {
        const start = this.state.pos;
        let startLoc;
        if (!this.isLookahead) startLoc = this.state.curPosition();
        let ch2 = this.input.charCodeAt(this.state.pos += startSkip);
        if (this.state.pos < this.length) {
          while (!isNewLine(ch2) && ++this.state.pos < this.length) {
            ch2 = this.input.charCodeAt(this.state.pos);
          }
        }
        if (this.isLookahead) return;
        const end = this.state.pos;
        const value = this.input.slice(start + startSkip, end);
        const comment = {
          type: "CommentLine",
          value,
          start: this.sourceToOffsetPos(start),
          end: this.sourceToOffsetPos(end),
          loc: new SourceLocation(startLoc, this.state.curPosition())
        };
        if (this.options.tokens) this.pushToken(comment);
        return comment;
      }
      skipSpace() {
        const spaceStart = this.state.pos;
        const comments = [];
        loop: while (this.state.pos < this.length) {
          const ch2 = this.input.charCodeAt(this.state.pos);
          switch (ch2) {
            case 32:
            case 160:
            case 9:
              ++this.state.pos;
              break;
            case 13:
              if (this.input.charCodeAt(this.state.pos + 1) === 10) {
                ++this.state.pos;
              }
            case 10:
            case 8232:
            case 8233:
              ++this.state.pos;
              ++this.state.curLine;
              this.state.lineStart = this.state.pos;
              break;
            case 47:
              switch (this.input.charCodeAt(this.state.pos + 1)) {
                case 42: {
                  const comment = this.skipBlockComment("*/");
                  if (comment !== void 0) {
                    this.addComment(comment);
                    if (this.options.attachComment) comments.push(comment);
                  }
                  break;
                }
                case 47: {
                  const comment = this.skipLineComment(2);
                  if (comment !== void 0) {
                    this.addComment(comment);
                    if (this.options.attachComment) comments.push(comment);
                  }
                  break;
                }
                default:
                  break loop;
              }
              break;
            default:
              if (isWhitespace(ch2)) {
                ++this.state.pos;
              } else if (ch2 === 45 && !this.inModule && this.options.annexB) {
                const pos = this.state.pos;
                if (this.input.charCodeAt(pos + 1) === 45 && this.input.charCodeAt(pos + 2) === 62 && (spaceStart === 0 || this.state.lineStart > spaceStart)) {
                  const comment = this.skipLineComment(3);
                  if (comment !== void 0) {
                    this.addComment(comment);
                    if (this.options.attachComment) comments.push(comment);
                  }
                } else {
                  break loop;
                }
              } else if (ch2 === 60 && !this.inModule && this.options.annexB) {
                const pos = this.state.pos;
                if (this.input.charCodeAt(pos + 1) === 33 && this.input.charCodeAt(pos + 2) === 45 && this.input.charCodeAt(pos + 3) === 45) {
                  const comment = this.skipLineComment(4);
                  if (comment !== void 0) {
                    this.addComment(comment);
                    if (this.options.attachComment) comments.push(comment);
                  }
                } else {
                  break loop;
                }
              } else {
                break loop;
              }
          }
        }
        if (comments.length > 0) {
          const end = this.state.pos;
          const commentWhitespace = {
            start: this.sourceToOffsetPos(spaceStart),
            end: this.sourceToOffsetPos(end),
            comments,
            leadingNode: null,
            trailingNode: null,
            containingNode: null
          };
          this.state.commentStack.push(commentWhitespace);
        }
      }
      finishToken(type, val2) {
        this.state.end = this.state.pos;
        this.state.endLoc = this.state.curPosition();
        const prevType = this.state.type;
        this.state.type = type;
        this.state.value = val2;
        if (!this.isLookahead) {
          this.updateContext(prevType);
        }
      }
      replaceToken(type) {
        this.state.type = type;
        this.updateContext();
      }
      readToken_numberSign() {
        if (this.state.pos === 0 && this.readToken_interpreter()) {
          return;
        }
        const nextPos = this.state.pos + 1;
        const next = this.codePointAtPos(nextPos);
        if (next >= 48 && next <= 57) {
          throw this.raise(Errors.UnexpectedDigitAfterHash, this.state.curPosition());
        }
        if (next === 123 || next === 91 && this.hasPlugin("recordAndTuple")) {
          this.expectPlugin("recordAndTuple");
          if (this.getPluginOption("recordAndTuple", "syntaxType") === "bar") {
            throw this.raise(next === 123 ? Errors.RecordExpressionHashIncorrectStartSyntaxType : Errors.TupleExpressionHashIncorrectStartSyntaxType, this.state.curPosition());
          }
          this.state.pos += 2;
          if (next === 123) {
            this.finishToken(7);
          } else {
            this.finishToken(1);
          }
        } else if (isIdentifierStart(next)) {
          ++this.state.pos;
          this.finishToken(139, this.readWord1(next));
        } else if (next === 92) {
          ++this.state.pos;
          this.finishToken(139, this.readWord1());
        } else {
          this.finishOp(27, 1);
        }
      }
      readToken_dot() {
        const next = this.input.charCodeAt(this.state.pos + 1);
        if (next >= 48 && next <= 57) {
          this.readNumber(true);
          return;
        }
        if (next === 46 && this.input.charCodeAt(this.state.pos + 2) === 46) {
          this.state.pos += 3;
          this.finishToken(21);
        } else {
          ++this.state.pos;
          this.finishToken(16);
        }
      }
      readToken_slash() {
        const next = this.input.charCodeAt(this.state.pos + 1);
        if (next === 61) {
          this.finishOp(31, 2);
        } else {
          this.finishOp(56, 1);
        }
      }
      readToken_interpreter() {
        if (this.state.pos !== 0 || this.length < 2) return false;
        let ch2 = this.input.charCodeAt(this.state.pos + 1);
        if (ch2 !== 33) return false;
        const start = this.state.pos;
        this.state.pos += 1;
        while (!isNewLine(ch2) && ++this.state.pos < this.length) {
          ch2 = this.input.charCodeAt(this.state.pos);
        }
        const value = this.input.slice(start + 2, this.state.pos);
        this.finishToken(28, value);
        return true;
      }
      readToken_mult_modulo(code2) {
        let type = code2 === 42 ? 55 : 54;
        let width = 1;
        let next = this.input.charCodeAt(this.state.pos + 1);
        if (code2 === 42 && next === 42) {
          width++;
          next = this.input.charCodeAt(this.state.pos + 2);
          type = 57;
        }
        if (next === 61 && !this.state.inType) {
          width++;
          type = code2 === 37 ? 33 : 30;
        }
        this.finishOp(type, width);
      }
      readToken_pipe_amp(code2) {
        const next = this.input.charCodeAt(this.state.pos + 1);
        if (next === code2) {
          if (this.input.charCodeAt(this.state.pos + 2) === 61) {
            this.finishOp(30, 3);
          } else {
            this.finishOp(code2 === 124 ? 41 : 42, 2);
          }
          return;
        }
        if (code2 === 124) {
          if (next === 62) {
            this.finishOp(39, 2);
            return;
          }
          if (this.hasPlugin("recordAndTuple") && next === 125) {
            if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") {
              throw this.raise(Errors.RecordExpressionBarIncorrectEndSyntaxType, this.state.curPosition());
            }
            this.state.pos += 2;
            this.finishToken(9);
            return;
          }
          if (this.hasPlugin("recordAndTuple") && next === 93) {
            if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") {
              throw this.raise(Errors.TupleExpressionBarIncorrectEndSyntaxType, this.state.curPosition());
            }
            this.state.pos += 2;
            this.finishToken(4);
            return;
          }
        }
        if (next === 61) {
          this.finishOp(30, 2);
          return;
        }
        this.finishOp(code2 === 124 ? 43 : 45, 1);
      }
      readToken_caret() {
        const next = this.input.charCodeAt(this.state.pos + 1);
        if (next === 61 && !this.state.inType) {
          this.finishOp(32, 2);
        } else if (next === 94 && this.hasPlugin(["pipelineOperator", {
          proposal: "hack",
          topicToken: "^^"
        }])) {
          this.finishOp(37, 2);
          const lookaheadCh = this.input.codePointAt(this.state.pos);
          if (lookaheadCh === 94) {
            this.unexpected();
          }
        } else {
          this.finishOp(44, 1);
        }
      }
      readToken_atSign() {
        const next = this.input.charCodeAt(this.state.pos + 1);
        if (next === 64 && this.hasPlugin(["pipelineOperator", {
          proposal: "hack",
          topicToken: "@@"
        }])) {
          this.finishOp(38, 2);
        } else {
          this.finishOp(26, 1);
        }
      }
      readToken_plus_min(code2) {
        const next = this.input.charCodeAt(this.state.pos + 1);
        if (next === code2) {
          this.finishOp(34, 2);
          return;
        }
        if (next === 61) {
          this.finishOp(30, 2);
        } else {
          this.finishOp(53, 1);
        }
      }
      readToken_lt() {
        const {
          pos
        } = this.state;
        const next = this.input.charCodeAt(pos + 1);
        if (next === 60) {
          if (this.input.charCodeAt(pos + 2) === 61) {
            this.finishOp(30, 3);
            return;
          }
          this.finishOp(51, 2);
          return;
        }
        if (next === 61) {
          this.finishOp(49, 2);
          return;
        }
        this.finishOp(47, 1);
      }
      readToken_gt() {
        const {
          pos
        } = this.state;
        const next = this.input.charCodeAt(pos + 1);
        if (next === 62) {
          const size = this.input.charCodeAt(pos + 2) === 62 ? 3 : 2;
          if (this.input.charCodeAt(pos + size) === 61) {
            this.finishOp(30, size + 1);
            return;
          }
          this.finishOp(52, size);
          return;
        }
        if (next === 61) {
          this.finishOp(49, 2);
          return;
        }
        this.finishOp(48, 1);
      }
      readToken_eq_excl(code2) {
        const next = this.input.charCodeAt(this.state.pos + 1);
        if (next === 61) {
          this.finishOp(46, this.input.charCodeAt(this.state.pos + 2) === 61 ? 3 : 2);
          return;
        }
        if (code2 === 61 && next === 62) {
          this.state.pos += 2;
          this.finishToken(19);
          return;
        }
        this.finishOp(code2 === 61 ? 29 : 35, 1);
      }
      readToken_question() {
        const next = this.input.charCodeAt(this.state.pos + 1);
        const next2 = this.input.charCodeAt(this.state.pos + 2);
        if (next === 63) {
          if (next2 === 61) {
            this.finishOp(30, 3);
          } else {
            this.finishOp(40, 2);
          }
        } else if (next === 46 && !(next2 >= 48 && next2 <= 57)) {
          this.state.pos += 2;
          this.finishToken(18);
        } else {
          ++this.state.pos;
          this.finishToken(17);
        }
      }
      getTokenFromCode(code2) {
        switch (code2) {
          case 46:
            this.readToken_dot();
            return;
          case 40:
            ++this.state.pos;
            this.finishToken(10);
            return;
          case 41:
            ++this.state.pos;
            this.finishToken(11);
            return;
          case 59:
            ++this.state.pos;
            this.finishToken(13);
            return;
          case 44:
            ++this.state.pos;
            this.finishToken(12);
            return;
          case 91:
            if (this.hasPlugin("recordAndTuple") && this.input.charCodeAt(this.state.pos + 1) === 124) {
              if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") {
                throw this.raise(Errors.TupleExpressionBarIncorrectStartSyntaxType, this.state.curPosition());
              }
              this.state.pos += 2;
              this.finishToken(2);
            } else {
              ++this.state.pos;
              this.finishToken(0);
            }
            return;
          case 93:
            ++this.state.pos;
            this.finishToken(3);
            return;
          case 123:
            if (this.hasPlugin("recordAndTuple") && this.input.charCodeAt(this.state.pos + 1) === 124) {
              if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") {
                throw this.raise(Errors.RecordExpressionBarIncorrectStartSyntaxType, this.state.curPosition());
              }
              this.state.pos += 2;
              this.finishToken(6);
            } else {
              ++this.state.pos;
              this.finishToken(5);
            }
            return;
          case 125:
            ++this.state.pos;
            this.finishToken(8);
            return;
          case 58:
            if (this.hasPlugin("functionBind") && this.input.charCodeAt(this.state.pos + 1) === 58) {
              this.finishOp(15, 2);
            } else {
              ++this.state.pos;
              this.finishToken(14);
            }
            return;
          case 63:
            this.readToken_question();
            return;
          case 96:
            this.readTemplateToken();
            return;
          case 48: {
            const next = this.input.charCodeAt(this.state.pos + 1);
            if (next === 120 || next === 88) {
              this.readRadixNumber(16);
              return;
            }
            if (next === 111 || next === 79) {
              this.readRadixNumber(8);
              return;
            }
            if (next === 98 || next === 66) {
              this.readRadixNumber(2);
              return;
            }
          }
          case 49:
          case 50:
          case 51:
          case 52:
          case 53:
          case 54:
          case 55:
          case 56:
          case 57:
            this.readNumber(false);
            return;
          case 34:
          case 39:
            this.readString(code2);
            return;
          case 47:
            this.readToken_slash();
            return;
          case 37:
          case 42:
            this.readToken_mult_modulo(code2);
            return;
          case 124:
          case 38:
            this.readToken_pipe_amp(code2);
            return;
          case 94:
            this.readToken_caret();
            return;
          case 43:
          case 45:
            this.readToken_plus_min(code2);
            return;
          case 60:
            this.readToken_lt();
            return;
          case 62:
            this.readToken_gt();
            return;
          case 61:
          case 33:
            this.readToken_eq_excl(code2);
            return;
          case 126:
            this.finishOp(36, 1);
            return;
          case 64:
            this.readToken_atSign();
            return;
          case 35:
            this.readToken_numberSign();
            return;
          case 92:
            this.readWord();
            return;
          default:
            if (isIdentifierStart(code2)) {
              this.readWord(code2);
              return;
            }
        }
        throw this.raise(Errors.InvalidOrUnexpectedToken, this.state.curPosition(), {
          unexpected: String.fromCodePoint(code2)
        });
      }
      finishOp(type, size) {
        const str = this.input.slice(this.state.pos, this.state.pos + size);
        this.state.pos += size;
        this.finishToken(type, str);
      }
      readRegexp() {
        const startLoc = this.state.startLoc;
        const start = this.state.start + 1;
        let escaped, inClass;
        let {
          pos
        } = this.state;
        for (; ; ++pos) {
          if (pos >= this.length) {
            throw this.raise(Errors.UnterminatedRegExp, createPositionWithColumnOffset(startLoc, 1));
          }
          const ch2 = this.input.charCodeAt(pos);
          if (isNewLine(ch2)) {
            throw this.raise(Errors.UnterminatedRegExp, createPositionWithColumnOffset(startLoc, 1));
          }
          if (escaped) {
            escaped = false;
          } else {
            if (ch2 === 91) {
              inClass = true;
            } else if (ch2 === 93 && inClass) {
              inClass = false;
            } else if (ch2 === 47 && !inClass) {
              break;
            }
            escaped = ch2 === 92;
          }
        }
        const content = this.input.slice(start, pos);
        ++pos;
        let mods = "";
        const nextPos = /* @__PURE__ */ __name(() => createPositionWithColumnOffset(startLoc, pos + 2 - start), "nextPos");
        while (pos < this.length) {
          const cp3 = this.codePointAtPos(pos);
          const char = String.fromCharCode(cp3);
          if (VALID_REGEX_FLAGS.has(cp3)) {
            if (cp3 === 118) {
              if (mods.includes("u")) {
                this.raise(Errors.IncompatibleRegExpUVFlags, nextPos());
              }
            } else if (cp3 === 117) {
              if (mods.includes("v")) {
                this.raise(Errors.IncompatibleRegExpUVFlags, nextPos());
              }
            }
            if (mods.includes(char)) {
              this.raise(Errors.DuplicateRegExpFlags, nextPos());
            }
          } else if (isIdentifierChar(cp3) || cp3 === 92) {
            this.raise(Errors.MalformedRegExpFlags, nextPos());
          } else {
            break;
          }
          ++pos;
          mods += char;
        }
        this.state.pos = pos;
        this.finishToken(138, {
          pattern: content,
          flags: mods
        });
      }
      readInt(radix, len, forceLen = false, allowNumSeparator = true) {
        const {
          n: n9,
          pos
        } = readInt(this.input, this.state.pos, this.state.lineStart, this.state.curLine, radix, len, forceLen, allowNumSeparator, this.errorHandlers_readInt, false);
        this.state.pos = pos;
        return n9;
      }
      readRadixNumber(radix) {
        const start = this.state.pos;
        const startLoc = this.state.curPosition();
        let isBigInt = false;
        this.state.pos += 2;
        const val2 = this.readInt(radix);
        if (val2 == null) {
          this.raise(Errors.InvalidDigit, createPositionWithColumnOffset(startLoc, 2), {
            radix
          });
        }
        const next = this.input.charCodeAt(this.state.pos);
        if (next === 110) {
          ++this.state.pos;
          isBigInt = true;
        } else if (next === 109) {
          throw this.raise(Errors.InvalidDecimal, startLoc);
        }
        if (isIdentifierStart(this.codePointAtPos(this.state.pos))) {
          throw this.raise(Errors.NumberIdentifier, this.state.curPosition());
        }
        if (isBigInt) {
          const str = this.input.slice(start, this.state.pos).replace(/[_n]/g, "");
          this.finishToken(136, str);
          return;
        }
        this.finishToken(135, val2);
      }
      readNumber(startsWithDot) {
        const start = this.state.pos;
        const startLoc = this.state.curPosition();
        let isFloat = false;
        let isBigInt = false;
        let hasExponent = false;
        let isOctal = false;
        if (!startsWithDot && this.readInt(10) === null) {
          this.raise(Errors.InvalidNumber, this.state.curPosition());
        }
        const hasLeadingZero = this.state.pos - start >= 2 && this.input.charCodeAt(start) === 48;
        if (hasLeadingZero) {
          const integer = this.input.slice(start, this.state.pos);
          this.recordStrictModeErrors(Errors.StrictOctalLiteral, startLoc);
          if (!this.state.strict) {
            const underscorePos = integer.indexOf("_");
            if (underscorePos > 0) {
              this.raise(Errors.ZeroDigitNumericSeparator, createPositionWithColumnOffset(startLoc, underscorePos));
            }
          }
          isOctal = hasLeadingZero && !/[89]/.test(integer);
        }
        let next = this.input.charCodeAt(this.state.pos);
        if (next === 46 && !isOctal) {
          ++this.state.pos;
          this.readInt(10);
          isFloat = true;
          next = this.input.charCodeAt(this.state.pos);
        }
        if ((next === 69 || next === 101) && !isOctal) {
          next = this.input.charCodeAt(++this.state.pos);
          if (next === 43 || next === 45) {
            ++this.state.pos;
          }
          if (this.readInt(10) === null) {
            this.raise(Errors.InvalidOrMissingExponent, startLoc);
          }
          isFloat = true;
          hasExponent = true;
          next = this.input.charCodeAt(this.state.pos);
        }
        if (next === 110) {
          if (isFloat || hasLeadingZero) {
            this.raise(Errors.InvalidBigIntLiteral, startLoc);
          }
          ++this.state.pos;
          isBigInt = true;
        }
        if (next === 109) {
          this.expectPlugin("decimal", this.state.curPosition());
          if (hasExponent || hasLeadingZero) {
            this.raise(Errors.InvalidDecimal, startLoc);
          }
          ++this.state.pos;
          var isDecimal = true;
        }
        if (isIdentifierStart(this.codePointAtPos(this.state.pos))) {
          throw this.raise(Errors.NumberIdentifier, this.state.curPosition());
        }
        const str = this.input.slice(start, this.state.pos).replace(/[_mn]/g, "");
        if (isBigInt) {
          this.finishToken(136, str);
          return;
        }
        if (isDecimal) {
          this.finishToken(137, str);
          return;
        }
        const val2 = isOctal ? parseInt(str, 8) : parseFloat(str);
        this.finishToken(135, val2);
      }
      readCodePoint(throwOnInvalid) {
        const {
          code: code2,
          pos
        } = readCodePoint(this.input, this.state.pos, this.state.lineStart, this.state.curLine, throwOnInvalid, this.errorHandlers_readCodePoint);
        this.state.pos = pos;
        return code2;
      }
      readString(quote2) {
        const {
          str,
          pos,
          curLine,
          lineStart
        } = readStringContents(quote2 === 34 ? "double" : "single", this.input, this.state.pos + 1, this.state.lineStart, this.state.curLine, this.errorHandlers_readStringContents_string);
        this.state.pos = pos + 1;
        this.state.lineStart = lineStart;
        this.state.curLine = curLine;
        this.finishToken(134, str);
      }
      readTemplateContinuation() {
        if (!this.match(8)) {
          this.unexpected(null, 8);
        }
        this.state.pos--;
        this.readTemplateToken();
      }
      readTemplateToken() {
        const opening = this.input[this.state.pos];
        const {
          str,
          firstInvalidLoc,
          pos,
          curLine,
          lineStart
        } = readStringContents("template", this.input, this.state.pos + 1, this.state.lineStart, this.state.curLine, this.errorHandlers_readStringContents_template);
        this.state.pos = pos + 1;
        this.state.lineStart = lineStart;
        this.state.curLine = curLine;
        if (firstInvalidLoc) {
          this.state.firstInvalidTemplateEscapePos = new Position(firstInvalidLoc.curLine, firstInvalidLoc.pos - firstInvalidLoc.lineStart, this.sourceToOffsetPos(firstInvalidLoc.pos));
        }
        if (this.input.codePointAt(pos) === 96) {
          this.finishToken(24, firstInvalidLoc ? null : opening + str + "`");
        } else {
          this.state.pos++;
          this.finishToken(25, firstInvalidLoc ? null : opening + str + "${");
        }
      }
      recordStrictModeErrors(toParseError, at3) {
        const index = at3.index;
        if (this.state.strict && !this.state.strictErrors.has(index)) {
          this.raise(toParseError, at3);
        } else {
          this.state.strictErrors.set(index, [toParseError, at3]);
        }
      }
      readWord1(firstCode) {
        this.state.containsEsc = false;
        let word = "";
        const start = this.state.pos;
        let chunkStart = this.state.pos;
        if (firstCode !== void 0) {
          this.state.pos += firstCode <= 65535 ? 1 : 2;
        }
        while (this.state.pos < this.length) {
          const ch2 = this.codePointAtPos(this.state.pos);
          if (isIdentifierChar(ch2)) {
            this.state.pos += ch2 <= 65535 ? 1 : 2;
          } else if (ch2 === 92) {
            this.state.containsEsc = true;
            word += this.input.slice(chunkStart, this.state.pos);
            const escStart = this.state.curPosition();
            const identifierCheck = this.state.pos === start ? isIdentifierStart : isIdentifierChar;
            if (this.input.charCodeAt(++this.state.pos) !== 117) {
              this.raise(Errors.MissingUnicodeEscape, this.state.curPosition());
              chunkStart = this.state.pos - 1;
              continue;
            }
            ++this.state.pos;
            const esc = this.readCodePoint(true);
            if (esc !== null) {
              if (!identifierCheck(esc)) {
                this.raise(Errors.EscapedCharNotAnIdentifier, escStart);
              }
              word += String.fromCodePoint(esc);
            }
            chunkStart = this.state.pos;
          } else {
            break;
          }
        }
        return word + this.input.slice(chunkStart, this.state.pos);
      }
      readWord(firstCode) {
        const word = this.readWord1(firstCode);
        const type = keywords$1.get(word);
        if (type !== void 0) {
          this.finishToken(type, tokenLabelName(type));
        } else {
          this.finishToken(132, word);
        }
      }
      checkKeywordEscapes() {
        const {
          type
        } = this.state;
        if (tokenIsKeyword(type) && this.state.containsEsc) {
          this.raise(Errors.InvalidEscapedReservedWord, this.state.startLoc, {
            reservedWord: tokenLabelName(type)
          });
        }
      }
      raise(toParseError, at3, details = {}) {
        const loc = at3 instanceof Position ? at3 : at3.loc.start;
        const error2 = toParseError(loc, details);
        if (!this.options.errorRecovery) throw error2;
        if (!this.isLookahead) this.state.errors.push(error2);
        return error2;
      }
      raiseOverwrite(toParseError, at3, details = {}) {
        const loc = at3 instanceof Position ? at3 : at3.loc.start;
        const pos = loc.index;
        const errors = this.state.errors;
        for (let i7 = errors.length - 1; i7 >= 0; i7--) {
          const error2 = errors[i7];
          if (error2.loc.index === pos) {
            return errors[i7] = toParseError(loc, details);
          }
          if (error2.loc.index < pos) break;
        }
        return this.raise(toParseError, at3, details);
      }
      updateContext(prevType) {
      }
      unexpected(loc, type) {
        throw this.raise(Errors.UnexpectedToken, loc != null ? loc : this.state.startLoc, {
          expected: type ? tokenLabelName(type) : null
        });
      }
      expectPlugin(pluginName, loc) {
        if (this.hasPlugin(pluginName)) {
          return true;
        }
        throw this.raise(Errors.MissingPlugin, loc != null ? loc : this.state.startLoc, {
          missingPlugin: [pluginName]
        });
      }
      expectOnePlugin(pluginNames) {
        if (!pluginNames.some((name2) => this.hasPlugin(name2))) {
          throw this.raise(Errors.MissingOneOfPlugins, this.state.startLoc, {
            missingPlugin: pluginNames
          });
        }
      }
      errorBuilder(error2) {
        return (pos, lineStart, curLine) => {
          this.raise(error2, buildPosition(pos, lineStart, curLine));
        };
      }
    };
    var ClassScope = class {
      static {
        __name(this, "ClassScope");
      }
      constructor() {
        this.privateNames = /* @__PURE__ */ new Set();
        this.loneAccessors = /* @__PURE__ */ new Map();
        this.undefinedPrivateNames = /* @__PURE__ */ new Map();
      }
    };
    var ClassScopeHandler = class {
      static {
        __name(this, "ClassScopeHandler");
      }
      constructor(parser2) {
        this.parser = void 0;
        this.stack = [];
        this.undefinedPrivateNames = /* @__PURE__ */ new Map();
        this.parser = parser2;
      }
      current() {
        return this.stack[this.stack.length - 1];
      }
      enter() {
        this.stack.push(new ClassScope());
      }
      exit() {
        const oldClassScope = this.stack.pop();
        const current = this.current();
        for (const [name2, loc] of Array.from(oldClassScope.undefinedPrivateNames)) {
          if (current) {
            if (!current.undefinedPrivateNames.has(name2)) {
              current.undefinedPrivateNames.set(name2, loc);
            }
          } else {
            this.parser.raise(Errors.InvalidPrivateFieldResolution, loc, {
              identifierName: name2
            });
          }
        }
      }
      declarePrivateName(name2, elementType, loc) {
        const {
          privateNames,
          loneAccessors,
          undefinedPrivateNames
        } = this.current();
        let redefined = privateNames.has(name2);
        if (elementType & 3) {
          const accessor = redefined && loneAccessors.get(name2);
          if (accessor) {
            const oldStatic = accessor & 4;
            const newStatic = elementType & 4;
            const oldKind = accessor & 3;
            const newKind = elementType & 3;
            redefined = oldKind === newKind || oldStatic !== newStatic;
            if (!redefined) loneAccessors.delete(name2);
          } else if (!redefined) {
            loneAccessors.set(name2, elementType);
          }
        }
        if (redefined) {
          this.parser.raise(Errors.PrivateNameRedeclaration, loc, {
            identifierName: name2
          });
        }
        privateNames.add(name2);
        undefinedPrivateNames.delete(name2);
      }
      usePrivateName(name2, loc) {
        let classScope;
        for (classScope of this.stack) {
          if (classScope.privateNames.has(name2)) return;
        }
        if (classScope) {
          classScope.undefinedPrivateNames.set(name2, loc);
        } else {
          this.parser.raise(Errors.InvalidPrivateFieldResolution, loc, {
            identifierName: name2
          });
        }
      }
    };
    var ExpressionScope = class {
      static {
        __name(this, "ExpressionScope");
      }
      constructor(type = 0) {
        this.type = type;
      }
      canBeArrowParameterDeclaration() {
        return this.type === 2 || this.type === 1;
      }
      isCertainlyParameterDeclaration() {
        return this.type === 3;
      }
    };
    var ArrowHeadParsingScope = class extends ExpressionScope {
      static {
        __name(this, "ArrowHeadParsingScope");
      }
      constructor(type) {
        super(type);
        this.declarationErrors = /* @__PURE__ */ new Map();
      }
      recordDeclarationError(ParsingErrorClass, at3) {
        const index = at3.index;
        this.declarationErrors.set(index, [ParsingErrorClass, at3]);
      }
      clearDeclarationError(index) {
        this.declarationErrors.delete(index);
      }
      iterateErrors(iterator) {
        this.declarationErrors.forEach(iterator);
      }
    };
    var ExpressionScopeHandler = class {
      static {
        __name(this, "ExpressionScopeHandler");
      }
      constructor(parser2) {
        this.parser = void 0;
        this.stack = [new ExpressionScope()];
        this.parser = parser2;
      }
      enter(scope) {
        this.stack.push(scope);
      }
      exit() {
        this.stack.pop();
      }
      recordParameterInitializerError(toParseError, node2) {
        const origin = node2.loc.start;
        const {
          stack
        } = this;
        let i7 = stack.length - 1;
        let scope = stack[i7];
        while (!scope.isCertainlyParameterDeclaration()) {
          if (scope.canBeArrowParameterDeclaration()) {
            scope.recordDeclarationError(toParseError, origin);
          } else {
            return;
          }
          scope = stack[--i7];
        }
        this.parser.raise(toParseError, origin);
      }
      recordArrowParameterBindingError(error2, node2) {
        const {
          stack
        } = this;
        const scope = stack[stack.length - 1];
        const origin = node2.loc.start;
        if (scope.isCertainlyParameterDeclaration()) {
          this.parser.raise(error2, origin);
        } else if (scope.canBeArrowParameterDeclaration()) {
          scope.recordDeclarationError(error2, origin);
        } else {
          return;
        }
      }
      recordAsyncArrowParametersError(at3) {
        const {
          stack
        } = this;
        let i7 = stack.length - 1;
        let scope = stack[i7];
        while (scope.canBeArrowParameterDeclaration()) {
          if (scope.type === 2) {
            scope.recordDeclarationError(Errors.AwaitBindingIdentifier, at3);
          }
          scope = stack[--i7];
        }
      }
      validateAsPattern() {
        const {
          stack
        } = this;
        const currentScope = stack[stack.length - 1];
        if (!currentScope.canBeArrowParameterDeclaration()) return;
        currentScope.iterateErrors(([toParseError, loc]) => {
          this.parser.raise(toParseError, loc);
          let i7 = stack.length - 2;
          let scope = stack[i7];
          while (scope.canBeArrowParameterDeclaration()) {
            scope.clearDeclarationError(loc.index);
            scope = stack[--i7];
          }
        });
      }
    };
    function newParameterDeclarationScope() {
      return new ExpressionScope(3);
    }
    __name(newParameterDeclarationScope, "newParameterDeclarationScope");
    function newArrowHeadScope() {
      return new ArrowHeadParsingScope(1);
    }
    __name(newArrowHeadScope, "newArrowHeadScope");
    function newAsyncArrowScope() {
      return new ArrowHeadParsingScope(2);
    }
    __name(newAsyncArrowScope, "newAsyncArrowScope");
    function newExpressionScope() {
      return new ExpressionScope();
    }
    __name(newExpressionScope, "newExpressionScope");
    var ProductionParameterHandler = class {
      static {
        __name(this, "ProductionParameterHandler");
      }
      constructor() {
        this.stacks = [];
      }
      enter(flags2) {
        this.stacks.push(flags2);
      }
      exit() {
        this.stacks.pop();
      }
      currentFlags() {
        return this.stacks[this.stacks.length - 1];
      }
      get hasAwait() {
        return (this.currentFlags() & 2) > 0;
      }
      get hasYield() {
        return (this.currentFlags() & 1) > 0;
      }
      get hasReturn() {
        return (this.currentFlags() & 4) > 0;
      }
      get hasIn() {
        return (this.currentFlags() & 8) > 0;
      }
    };
    function functionFlags(isAsync4, isGenerator) {
      return (isAsync4 ? 2 : 0) | (isGenerator ? 1 : 0);
    }
    __name(functionFlags, "functionFlags");
    var UtilParser = class extends Tokenizer {
      static {
        __name(this, "UtilParser");
      }
      addExtra(node2, key, value, enumerable = true) {
        if (!node2) return;
        let {
          extra
        } = node2;
        if (extra == null) {
          extra = {};
          node2.extra = extra;
        }
        if (enumerable) {
          extra[key] = value;
        } else {
          Object.defineProperty(extra, key, {
            enumerable,
            value
          });
        }
      }
      isContextual(token) {
        return this.state.type === token && !this.state.containsEsc;
      }
      isUnparsedContextual(nameStart, name2) {
        const nameEnd = nameStart + name2.length;
        if (this.input.slice(nameStart, nameEnd) === name2) {
          const nextCh = this.input.charCodeAt(nameEnd);
          return !(isIdentifierChar(nextCh) || (nextCh & 64512) === 55296);
        }
        return false;
      }
      isLookaheadContextual(name2) {
        const next = this.nextTokenStart();
        return this.isUnparsedContextual(next, name2);
      }
      eatContextual(token) {
        if (this.isContextual(token)) {
          this.next();
          return true;
        }
        return false;
      }
      expectContextual(token, toParseError) {
        if (!this.eatContextual(token)) {
          if (toParseError != null) {
            throw this.raise(toParseError, this.state.startLoc);
          }
          this.unexpected(null, token);
        }
      }
      canInsertSemicolon() {
        return this.match(140) || this.match(8) || this.hasPrecedingLineBreak();
      }
      hasPrecedingLineBreak() {
        return hasNewLine(this.input, this.offsetToSourcePos(this.state.lastTokEndLoc.index), this.state.start);
      }
      hasFollowingLineBreak() {
        return hasNewLine(this.input, this.state.end, this.nextTokenStart());
      }
      isLineTerminator() {
        return this.eat(13) || this.canInsertSemicolon();
      }
      semicolon(allowAsi = true) {
        if (allowAsi ? this.isLineTerminator() : this.eat(13)) return;
        this.raise(Errors.MissingSemicolon, this.state.lastTokEndLoc);
      }
      expect(type, loc) {
        if (!this.eat(type)) {
          this.unexpected(loc, type);
        }
      }
      tryParse(fn2, oldState = this.state.clone()) {
        const abortSignal = {
          node: null
        };
        try {
          const node2 = fn2((node3 = null) => {
            abortSignal.node = node3;
            throw abortSignal;
          });
          if (this.state.errors.length > oldState.errors.length) {
            const failState = this.state;
            this.state = oldState;
            this.state.tokensLength = failState.tokensLength;
            return {
              node: node2,
              error: failState.errors[oldState.errors.length],
              thrown: false,
              aborted: false,
              failState
            };
          }
          return {
            node: node2,
            error: null,
            thrown: false,
            aborted: false,
            failState: null
          };
        } catch (error2) {
          const failState = this.state;
          this.state = oldState;
          if (error2 instanceof SyntaxError) {
            return {
              node: null,
              error: error2,
              thrown: true,
              aborted: false,
              failState
            };
          }
          if (error2 === abortSignal) {
            return {
              node: abortSignal.node,
              error: null,
              thrown: false,
              aborted: true,
              failState
            };
          }
          throw error2;
        }
      }
      checkExpressionErrors(refExpressionErrors, andThrow) {
        if (!refExpressionErrors) return false;
        const {
          shorthandAssignLoc,
          doubleProtoLoc,
          privateKeyLoc,
          optionalParametersLoc
        } = refExpressionErrors;
        const hasErrors = !!shorthandAssignLoc || !!doubleProtoLoc || !!optionalParametersLoc || !!privateKeyLoc;
        if (!andThrow) {
          return hasErrors;
        }
        if (shorthandAssignLoc != null) {
          this.raise(Errors.InvalidCoverInitializedName, shorthandAssignLoc);
        }
        if (doubleProtoLoc != null) {
          this.raise(Errors.DuplicateProto, doubleProtoLoc);
        }
        if (privateKeyLoc != null) {
          this.raise(Errors.UnexpectedPrivateField, privateKeyLoc);
        }
        if (optionalParametersLoc != null) {
          this.unexpected(optionalParametersLoc);
        }
      }
      isLiteralPropertyName() {
        return tokenIsLiteralPropertyName(this.state.type);
      }
      isPrivateName(node2) {
        return node2.type === "PrivateName";
      }
      getPrivateNameSV(node2) {
        return node2.id.name;
      }
      hasPropertyAsPrivateName(node2) {
        return (node2.type === "MemberExpression" || node2.type === "OptionalMemberExpression") && this.isPrivateName(node2.property);
      }
      isObjectProperty(node2) {
        return node2.type === "ObjectProperty";
      }
      isObjectMethod(node2) {
        return node2.type === "ObjectMethod";
      }
      initializeScopes(inModule = this.options.sourceType === "module") {
        const oldLabels = this.state.labels;
        this.state.labels = [];
        const oldExportedIdentifiers = this.exportedIdentifiers;
        this.exportedIdentifiers = /* @__PURE__ */ new Set();
        const oldInModule = this.inModule;
        this.inModule = inModule;
        const oldScope = this.scope;
        const ScopeHandler2 = this.getScopeHandler();
        this.scope = new ScopeHandler2(this, inModule);
        const oldProdParam = this.prodParam;
        this.prodParam = new ProductionParameterHandler();
        const oldClassScope = this.classScope;
        this.classScope = new ClassScopeHandler(this);
        const oldExpressionScope = this.expressionScope;
        this.expressionScope = new ExpressionScopeHandler(this);
        return () => {
          this.state.labels = oldLabels;
          this.exportedIdentifiers = oldExportedIdentifiers;
          this.inModule = oldInModule;
          this.scope = oldScope;
          this.prodParam = oldProdParam;
          this.classScope = oldClassScope;
          this.expressionScope = oldExpressionScope;
        };
      }
      enterInitialScopes() {
        let paramFlags = 0;
        if (this.inModule) {
          paramFlags |= 2;
        }
        this.scope.enter(1);
        this.prodParam.enter(paramFlags);
      }
      checkDestructuringPrivate(refExpressionErrors) {
        const {
          privateKeyLoc
        } = refExpressionErrors;
        if (privateKeyLoc !== null) {
          this.expectPlugin("destructuringPrivate", privateKeyLoc);
        }
      }
    };
    var ExpressionErrors = class {
      static {
        __name(this, "ExpressionErrors");
      }
      constructor() {
        this.shorthandAssignLoc = null;
        this.doubleProtoLoc = null;
        this.privateKeyLoc = null;
        this.optionalParametersLoc = null;
      }
    };
    var Node3 = class {
      static {
        __name(this, "Node");
      }
      constructor(parser2, pos, loc) {
        this.type = "";
        this.start = pos;
        this.end = 0;
        this.loc = new SourceLocation(loc);
        if (parser2 != null && parser2.options.ranges) this.range = [pos, 0];
        if (parser2 != null && parser2.filename) this.loc.filename = parser2.filename;
      }
    };
    var NodePrototype = Node3.prototype;
    {
      NodePrototype.__clone = function() {
        const newNode = new Node3(void 0, this.start, this.loc.start);
        const keys = Object.keys(this);
        for (let i7 = 0, length = keys.length; i7 < length; i7++) {
          const key = keys[i7];
          if (key !== "leadingComments" && key !== "trailingComments" && key !== "innerComments") {
            newNode[key] = this[key];
          }
        }
        return newNode;
      };
    }
    function clonePlaceholder(node2) {
      return cloneIdentifier(node2);
    }
    __name(clonePlaceholder, "clonePlaceholder");
    function cloneIdentifier(node2) {
      const {
        type,
        start,
        end,
        loc,
        range,
        extra,
        name: name2
      } = node2;
      const cloned = Object.create(NodePrototype);
      cloned.type = type;
      cloned.start = start;
      cloned.end = end;
      cloned.loc = loc;
      cloned.range = range;
      cloned.extra = extra;
      cloned.name = name2;
      if (type === "Placeholder") {
        cloned.expectedNode = node2.expectedNode;
      }
      return cloned;
    }
    __name(cloneIdentifier, "cloneIdentifier");
    function cloneStringLiteral(node2) {
      const {
        type,
        start,
        end,
        loc,
        range,
        extra
      } = node2;
      if (type === "Placeholder") {
        return clonePlaceholder(node2);
      }
      const cloned = Object.create(NodePrototype);
      cloned.type = type;
      cloned.start = start;
      cloned.end = end;
      cloned.loc = loc;
      cloned.range = range;
      if (node2.raw !== void 0) {
        cloned.raw = node2.raw;
      } else {
        cloned.extra = extra;
      }
      cloned.value = node2.value;
      return cloned;
    }
    __name(cloneStringLiteral, "cloneStringLiteral");
    var NodeUtils = class extends UtilParser {
      static {
        __name(this, "NodeUtils");
      }
      startNode() {
        const loc = this.state.startLoc;
        return new Node3(this, loc.index, loc);
      }
      startNodeAt(loc) {
        return new Node3(this, loc.index, loc);
      }
      startNodeAtNode(type) {
        return this.startNodeAt(type.loc.start);
      }
      finishNode(node2, type) {
        return this.finishNodeAt(node2, type, this.state.lastTokEndLoc);
      }
      finishNodeAt(node2, type, endLoc) {
        node2.type = type;
        node2.end = endLoc.index;
        node2.loc.end = endLoc;
        if (this.options.ranges) node2.range[1] = endLoc.index;
        if (this.options.attachComment) this.processComment(node2);
        return node2;
      }
      resetStartLocation(node2, startLoc) {
        node2.start = startLoc.index;
        node2.loc.start = startLoc;
        if (this.options.ranges) node2.range[0] = startLoc.index;
      }
      resetEndLocation(node2, endLoc = this.state.lastTokEndLoc) {
        node2.end = endLoc.index;
        node2.loc.end = endLoc;
        if (this.options.ranges) node2.range[1] = endLoc.index;
      }
      resetStartLocationFromNode(node2, locationNode) {
        this.resetStartLocation(node2, locationNode.loc.start);
      }
    };
    var reservedTypes = /* @__PURE__ */ new Set(["_", "any", "bool", "boolean", "empty", "extends", "false", "interface", "mixed", "null", "number", "static", "string", "true", "typeof", "void"]);
    var FlowErrors = ParseErrorEnum`flow`({
      AmbiguousConditionalArrow: "Ambiguous expression: wrap the arrow functions in parentheses to disambiguate.",
      AmbiguousDeclareModuleKind: "Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module.",
      AssignReservedType: /* @__PURE__ */ __name(({
        reservedType
      }) => `Cannot overwrite reserved type ${reservedType}.`, "AssignReservedType"),
      DeclareClassElement: "The `declare` modifier can only appear on class fields.",
      DeclareClassFieldInitializer: "Initializers are not allowed in fields with the `declare` modifier.",
      DuplicateDeclareModuleExports: "Duplicate `declare module.exports` statement.",
      EnumBooleanMemberNotInitialized: /* @__PURE__ */ __name(({
        memberName,
        enumName
      }) => `Boolean enum members need to be initialized. Use either \`${memberName} = true,\` or \`${memberName} = false,\` in enum \`${enumName}\`.`, "EnumBooleanMemberNotInitialized"),
      EnumDuplicateMemberName: /* @__PURE__ */ __name(({
        memberName,
        enumName
      }) => `Enum member names need to be unique, but the name \`${memberName}\` has already been used before in enum \`${enumName}\`.`, "EnumDuplicateMemberName"),
      EnumInconsistentMemberValues: /* @__PURE__ */ __name(({
        enumName
      }) => `Enum \`${enumName}\` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.`, "EnumInconsistentMemberValues"),
      EnumInvalidExplicitType: /* @__PURE__ */ __name(({
        invalidEnumType,
        enumName
      }) => `Enum type \`${invalidEnumType}\` is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${enumName}\`.`, "EnumInvalidExplicitType"),
      EnumInvalidExplicitTypeUnknownSupplied: /* @__PURE__ */ __name(({
        enumName
      }) => `Supplied enum type is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${enumName}\`.`, "EnumInvalidExplicitTypeUnknownSupplied"),
      EnumInvalidMemberInitializerPrimaryType: /* @__PURE__ */ __name(({
        enumName,
        memberName,
        explicitType
      }) => `Enum \`${enumName}\` has type \`${explicitType}\`, so the initializer of \`${memberName}\` needs to be a ${explicitType} literal.`, "EnumInvalidMemberInitializerPrimaryType"),
      EnumInvalidMemberInitializerSymbolType: /* @__PURE__ */ __name(({
        enumName,
        memberName
      }) => `Symbol enum members cannot be initialized. Use \`${memberName},\` in enum \`${enumName}\`.`, "EnumInvalidMemberInitializerSymbolType"),
      EnumInvalidMemberInitializerUnknownType: /* @__PURE__ */ __name(({
        enumName,
        memberName
      }) => `The enum member initializer for \`${memberName}\` needs to be a literal (either a boolean, number, or string) in enum \`${enumName}\`.`, "EnumInvalidMemberInitializerUnknownType"),
      EnumInvalidMemberName: /* @__PURE__ */ __name(({
        enumName,
        memberName,
        suggestion
      }) => `Enum member names cannot start with lowercase 'a' through 'z'. Instead of using \`${memberName}\`, consider using \`${suggestion}\`, in enum \`${enumName}\`.`, "EnumInvalidMemberName"),
      EnumNumberMemberNotInitialized: /* @__PURE__ */ __name(({
        enumName,
        memberName
      }) => `Number enum members need to be initialized, e.g. \`${memberName} = 1\` in enum \`${enumName}\`.`, "EnumNumberMemberNotInitialized"),
      EnumStringMemberInconsistentlyInitialized: /* @__PURE__ */ __name(({
        enumName
      }) => `String enum members need to consistently either all use initializers, or use no initializers, in enum \`${enumName}\`.`, "EnumStringMemberInconsistentlyInitialized"),
      GetterMayNotHaveThisParam: "A getter cannot have a `this` parameter.",
      ImportReflectionHasImportType: "An `import module` declaration can not use `type` or `typeof` keyword.",
      ImportTypeShorthandOnlyInPureImport: "The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements.",
      InexactInsideExact: "Explicit inexact syntax cannot appear inside an explicit exact object type.",
      InexactInsideNonObject: "Explicit inexact syntax cannot appear in class or interface definitions.",
      InexactVariance: "Explicit inexact syntax cannot have variance.",
      InvalidNonTypeImportInDeclareModule: "Imports within a `declare module` body must always be `import type` or `import typeof`.",
      MissingTypeParamDefault: "Type parameter declaration needs a default, since a preceding type parameter declaration has a default.",
      NestedDeclareModule: "`declare module` cannot be used inside another `declare module`.",
      NestedFlowComment: "Cannot have a flow comment inside another flow comment.",
      PatternIsOptional: Object.assign({
        message: "A binding pattern parameter cannot be optional in an implementation signature."
      }, {
        reasonCode: "OptionalBindingPattern"
      }),
      SetterMayNotHaveThisParam: "A setter cannot have a `this` parameter.",
      SpreadVariance: "Spread properties cannot have variance.",
      ThisParamAnnotationRequired: "A type annotation is required for the `this` parameter.",
      ThisParamBannedInConstructor: "Constructors cannot have a `this` parameter; constructors don't bind `this` like other functions.",
      ThisParamMayNotBeOptional: "The `this` parameter cannot be optional.",
      ThisParamMustBeFirst: "The `this` parameter must be the first function parameter.",
      ThisParamNoDefault: "The `this` parameter may not have a default value.",
      TypeBeforeInitializer: "Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",
      TypeCastInPattern: "The type cast expression is expected to be wrapped with parenthesis.",
      UnexpectedExplicitInexactInObject: "Explicit inexact syntax must appear at the end of an inexact object.",
      UnexpectedReservedType: /* @__PURE__ */ __name(({
        reservedType
      }) => `Unexpected reserved type ${reservedType}.`, "UnexpectedReservedType"),
      UnexpectedReservedUnderscore: "`_` is only allowed as a type argument to call or new.",
      UnexpectedSpaceBetweenModuloChecks: "Spaces between `%` and `checks` are not allowed here.",
      UnexpectedSpreadType: "Spread operator cannot appear in class or interface definitions.",
      UnexpectedSubtractionOperand: 'Unexpected token, expected "number" or "bigint".',
      UnexpectedTokenAfterTypeParameter: "Expected an arrow function after this type parameter declaration.",
      UnexpectedTypeParameterBeforeAsyncArrowFunction: "Type parameters must come after the async keyword, e.g. instead of `<T> async () => {}`, use `async <T>() => {}`.",
      UnsupportedDeclareExportKind: /* @__PURE__ */ __name(({
        unsupportedExportKind,
        suggestion
      }) => `\`declare export ${unsupportedExportKind}\` is not supported. Use \`${suggestion}\` instead.`, "UnsupportedDeclareExportKind"),
      UnsupportedStatementInDeclareModule: "Only declares and type imports are allowed inside declare module.",
      UnterminatedFlowComment: "Unterminated flow-comment."
    });
    function isEsModuleType(bodyElement) {
      return bodyElement.type === "DeclareExportAllDeclaration" || bodyElement.type === "DeclareExportDeclaration" && (!bodyElement.declaration || bodyElement.declaration.type !== "TypeAlias" && bodyElement.declaration.type !== "InterfaceDeclaration");
    }
    __name(isEsModuleType, "isEsModuleType");
    function hasTypeImportKind(node2) {
      return node2.importKind === "type" || node2.importKind === "typeof";
    }
    __name(hasTypeImportKind, "hasTypeImportKind");
    var exportSuggestions = {
      const: "declare export var",
      let: "declare export var",
      type: "export type",
      interface: "export interface"
    };
    function partition2(list, test) {
      const list1 = [];
      const list2 = [];
      for (let i7 = 0; i7 < list.length; i7++) {
        (test(list[i7], i7, list) ? list1 : list2).push(list[i7]);
      }
      return [list1, list2];
    }
    __name(partition2, "partition");
    var FLOW_PRAGMA_REGEX = /\*?\s*@((?:no)?flow)\b/;
    var flow = /* @__PURE__ */ __name((superClass) => class FlowParserMixin extends superClass {
      static {
        __name(this, "FlowParserMixin");
      }
      constructor(...args) {
        super(...args);
        this.flowPragma = void 0;
      }
      getScopeHandler() {
        return FlowScopeHandler;
      }
      shouldParseTypes() {
        return this.getPluginOption("flow", "all") || this.flowPragma === "flow";
      }
      finishToken(type, val2) {
        if (type !== 134 && type !== 13 && type !== 28) {
          if (this.flowPragma === void 0) {
            this.flowPragma = null;
          }
        }
        super.finishToken(type, val2);
      }
      addComment(comment) {
        if (this.flowPragma === void 0) {
          const matches = FLOW_PRAGMA_REGEX.exec(comment.value);
          if (!matches) ;
          else if (matches[1] === "flow") {
            this.flowPragma = "flow";
          } else if (matches[1] === "noflow") {
            this.flowPragma = "noflow";
          } else {
            throw new Error("Unexpected flow pragma");
          }
        }
        super.addComment(comment);
      }
      flowParseTypeInitialiser(tok) {
        const oldInType = this.state.inType;
        this.state.inType = true;
        this.expect(tok || 14);
        const type = this.flowParseType();
        this.state.inType = oldInType;
        return type;
      }
      flowParsePredicate() {
        const node2 = this.startNode();
        const moduloLoc = this.state.startLoc;
        this.next();
        this.expectContextual(110);
        if (this.state.lastTokStartLoc.index > moduloLoc.index + 1) {
          this.raise(FlowErrors.UnexpectedSpaceBetweenModuloChecks, moduloLoc);
        }
        if (this.eat(10)) {
          node2.value = super.parseExpression();
          this.expect(11);
          return this.finishNode(node2, "DeclaredPredicate");
        } else {
          return this.finishNode(node2, "InferredPredicate");
        }
      }
      flowParseTypeAndPredicateInitialiser() {
        const oldInType = this.state.inType;
        this.state.inType = true;
        this.expect(14);
        let type = null;
        let predicate = null;
        if (this.match(54)) {
          this.state.inType = oldInType;
          predicate = this.flowParsePredicate();
        } else {
          type = this.flowParseType();
          this.state.inType = oldInType;
          if (this.match(54)) {
            predicate = this.flowParsePredicate();
          }
        }
        return [type, predicate];
      }
      flowParseDeclareClass(node2) {
        this.next();
        this.flowParseInterfaceish(node2, true);
        return this.finishNode(node2, "DeclareClass");
      }
      flowParseDeclareFunction(node2) {
        this.next();
        const id = node2.id = this.parseIdentifier();
        const typeNode = this.startNode();
        const typeContainer = this.startNode();
        if (this.match(47)) {
          typeNode.typeParameters = this.flowParseTypeParameterDeclaration();
        } else {
          typeNode.typeParameters = null;
        }
        this.expect(10);
        const tmp = this.flowParseFunctionTypeParams();
        typeNode.params = tmp.params;
        typeNode.rest = tmp.rest;
        typeNode.this = tmp._this;
        this.expect(11);
        [typeNode.returnType, node2.predicate] = this.flowParseTypeAndPredicateInitialiser();
        typeContainer.typeAnnotation = this.finishNode(typeNode, "FunctionTypeAnnotation");
        id.typeAnnotation = this.finishNode(typeContainer, "TypeAnnotation");
        this.resetEndLocation(id);
        this.semicolon();
        this.scope.declareName(node2.id.name, 2048, node2.id.loc.start);
        return this.finishNode(node2, "DeclareFunction");
      }
      flowParseDeclare(node2, insideModule) {
        if (this.match(80)) {
          return this.flowParseDeclareClass(node2);
        } else if (this.match(68)) {
          return this.flowParseDeclareFunction(node2);
        } else if (this.match(74)) {
          return this.flowParseDeclareVariable(node2);
        } else if (this.eatContextual(127)) {
          if (this.match(16)) {
            return this.flowParseDeclareModuleExports(node2);
          } else {
            if (insideModule) {
              this.raise(FlowErrors.NestedDeclareModule, this.state.lastTokStartLoc);
            }
            return this.flowParseDeclareModule(node2);
          }
        } else if (this.isContextual(130)) {
          return this.flowParseDeclareTypeAlias(node2);
        } else if (this.isContextual(131)) {
          return this.flowParseDeclareOpaqueType(node2);
        } else if (this.isContextual(129)) {
          return this.flowParseDeclareInterface(node2);
        } else if (this.match(82)) {
          return this.flowParseDeclareExportDeclaration(node2, insideModule);
        } else {
          this.unexpected();
        }
      }
      flowParseDeclareVariable(node2) {
        this.next();
        node2.id = this.flowParseTypeAnnotatableIdentifier(true);
        this.scope.declareName(node2.id.name, 5, node2.id.loc.start);
        this.semicolon();
        return this.finishNode(node2, "DeclareVariable");
      }
      flowParseDeclareModule(node2) {
        this.scope.enter(0);
        if (this.match(134)) {
          node2.id = super.parseExprAtom();
        } else {
          node2.id = this.parseIdentifier();
        }
        const bodyNode = node2.body = this.startNode();
        const body = bodyNode.body = [];
        this.expect(5);
        while (!this.match(8)) {
          let bodyNode2 = this.startNode();
          if (this.match(83)) {
            this.next();
            if (!this.isContextual(130) && !this.match(87)) {
              this.raise(FlowErrors.InvalidNonTypeImportInDeclareModule, this.state.lastTokStartLoc);
            }
            super.parseImport(bodyNode2);
          } else {
            this.expectContextual(125, FlowErrors.UnsupportedStatementInDeclareModule);
            bodyNode2 = this.flowParseDeclare(bodyNode2, true);
          }
          body.push(bodyNode2);
        }
        this.scope.exit();
        this.expect(8);
        this.finishNode(bodyNode, "BlockStatement");
        let kind2 = null;
        let hasModuleExport = false;
        body.forEach((bodyElement) => {
          if (isEsModuleType(bodyElement)) {
            if (kind2 === "CommonJS") {
              this.raise(FlowErrors.AmbiguousDeclareModuleKind, bodyElement);
            }
            kind2 = "ES";
          } else if (bodyElement.type === "DeclareModuleExports") {
            if (hasModuleExport) {
              this.raise(FlowErrors.DuplicateDeclareModuleExports, bodyElement);
            }
            if (kind2 === "ES") {
              this.raise(FlowErrors.AmbiguousDeclareModuleKind, bodyElement);
            }
            kind2 = "CommonJS";
            hasModuleExport = true;
          }
        });
        node2.kind = kind2 || "CommonJS";
        return this.finishNode(node2, "DeclareModule");
      }
      flowParseDeclareExportDeclaration(node2, insideModule) {
        this.expect(82);
        if (this.eat(65)) {
          if (this.match(68) || this.match(80)) {
            node2.declaration = this.flowParseDeclare(this.startNode());
          } else {
            node2.declaration = this.flowParseType();
            this.semicolon();
          }
          node2.default = true;
          return this.finishNode(node2, "DeclareExportDeclaration");
        } else {
          if (this.match(75) || this.isLet() || (this.isContextual(130) || this.isContextual(129)) && !insideModule) {
            const label = this.state.value;
            throw this.raise(FlowErrors.UnsupportedDeclareExportKind, this.state.startLoc, {
              unsupportedExportKind: label,
              suggestion: exportSuggestions[label]
            });
          }
          if (this.match(74) || this.match(68) || this.match(80) || this.isContextual(131)) {
            node2.declaration = this.flowParseDeclare(this.startNode());
            node2.default = false;
            return this.finishNode(node2, "DeclareExportDeclaration");
          } else if (this.match(55) || this.match(5) || this.isContextual(129) || this.isContextual(130) || this.isContextual(131)) {
            node2 = this.parseExport(node2, null);
            if (node2.type === "ExportNamedDeclaration") {
              node2.type = "ExportDeclaration";
              node2.default = false;
              delete node2.exportKind;
            }
            node2.type = "Declare" + node2.type;
            return node2;
          }
        }
        this.unexpected();
      }
      flowParseDeclareModuleExports(node2) {
        this.next();
        this.expectContextual(111);
        node2.typeAnnotation = this.flowParseTypeAnnotation();
        this.semicolon();
        return this.finishNode(node2, "DeclareModuleExports");
      }
      flowParseDeclareTypeAlias(node2) {
        this.next();
        const finished = this.flowParseTypeAlias(node2);
        finished.type = "DeclareTypeAlias";
        return finished;
      }
      flowParseDeclareOpaqueType(node2) {
        this.next();
        const finished = this.flowParseOpaqueType(node2, true);
        finished.type = "DeclareOpaqueType";
        return finished;
      }
      flowParseDeclareInterface(node2) {
        this.next();
        this.flowParseInterfaceish(node2, false);
        return this.finishNode(node2, "DeclareInterface");
      }
      flowParseInterfaceish(node2, isClass) {
        node2.id = this.flowParseRestrictedIdentifier(!isClass, true);
        this.scope.declareName(node2.id.name, isClass ? 17 : 8201, node2.id.loc.start);
        if (this.match(47)) {
          node2.typeParameters = this.flowParseTypeParameterDeclaration();
        } else {
          node2.typeParameters = null;
        }
        node2.extends = [];
        if (this.eat(81)) {
          do {
            node2.extends.push(this.flowParseInterfaceExtends());
          } while (!isClass && this.eat(12));
        }
        if (isClass) {
          node2.implements = [];
          node2.mixins = [];
          if (this.eatContextual(117)) {
            do {
              node2.mixins.push(this.flowParseInterfaceExtends());
            } while (this.eat(12));
          }
          if (this.eatContextual(113)) {
            do {
              node2.implements.push(this.flowParseInterfaceExtends());
            } while (this.eat(12));
          }
        }
        node2.body = this.flowParseObjectType({
          allowStatic: isClass,
          allowExact: false,
          allowSpread: false,
          allowProto: isClass,
          allowInexact: false
        });
      }
      flowParseInterfaceExtends() {
        const node2 = this.startNode();
        node2.id = this.flowParseQualifiedTypeIdentifier();
        if (this.match(47)) {
          node2.typeParameters = this.flowParseTypeParameterInstantiation();
        } else {
          node2.typeParameters = null;
        }
        return this.finishNode(node2, "InterfaceExtends");
      }
      flowParseInterface(node2) {
        this.flowParseInterfaceish(node2, false);
        return this.finishNode(node2, "InterfaceDeclaration");
      }
      checkNotUnderscore(word) {
        if (word === "_") {
          this.raise(FlowErrors.UnexpectedReservedUnderscore, this.state.startLoc);
        }
      }
      checkReservedType(word, startLoc, declaration) {
        if (!reservedTypes.has(word)) return;
        this.raise(declaration ? FlowErrors.AssignReservedType : FlowErrors.UnexpectedReservedType, startLoc, {
          reservedType: word
        });
      }
      flowParseRestrictedIdentifier(liberal, declaration) {
        this.checkReservedType(this.state.value, this.state.startLoc, declaration);
        return this.parseIdentifier(liberal);
      }
      flowParseTypeAlias(node2) {
        node2.id = this.flowParseRestrictedIdentifier(false, true);
        this.scope.declareName(node2.id.name, 8201, node2.id.loc.start);
        if (this.match(47)) {
          node2.typeParameters = this.flowParseTypeParameterDeclaration();
        } else {
          node2.typeParameters = null;
        }
        node2.right = this.flowParseTypeInitialiser(29);
        this.semicolon();
        return this.finishNode(node2, "TypeAlias");
      }
      flowParseOpaqueType(node2, declare) {
        this.expectContextual(130);
        node2.id = this.flowParseRestrictedIdentifier(true, true);
        this.scope.declareName(node2.id.name, 8201, node2.id.loc.start);
        if (this.match(47)) {
          node2.typeParameters = this.flowParseTypeParameterDeclaration();
        } else {
          node2.typeParameters = null;
        }
        node2.supertype = null;
        if (this.match(14)) {
          node2.supertype = this.flowParseTypeInitialiser(14);
        }
        node2.impltype = null;
        if (!declare) {
          node2.impltype = this.flowParseTypeInitialiser(29);
        }
        this.semicolon();
        return this.finishNode(node2, "OpaqueType");
      }
      flowParseTypeParameter(requireDefault = false) {
        const nodeStartLoc = this.state.startLoc;
        const node2 = this.startNode();
        const variance = this.flowParseVariance();
        const ident = this.flowParseTypeAnnotatableIdentifier();
        node2.name = ident.name;
        node2.variance = variance;
        node2.bound = ident.typeAnnotation;
        if (this.match(29)) {
          this.eat(29);
          node2.default = this.flowParseType();
        } else {
          if (requireDefault) {
            this.raise(FlowErrors.MissingTypeParamDefault, nodeStartLoc);
          }
        }
        return this.finishNode(node2, "TypeParameter");
      }
      flowParseTypeParameterDeclaration() {
        const oldInType = this.state.inType;
        const node2 = this.startNode();
        node2.params = [];
        this.state.inType = true;
        if (this.match(47) || this.match(143)) {
          this.next();
        } else {
          this.unexpected();
        }
        let defaultRequired = false;
        do {
          const typeParameter = this.flowParseTypeParameter(defaultRequired);
          node2.params.push(typeParameter);
          if (typeParameter.default) {
            defaultRequired = true;
          }
          if (!this.match(48)) {
            this.expect(12);
          }
        } while (!this.match(48));
        this.expect(48);
        this.state.inType = oldInType;
        return this.finishNode(node2, "TypeParameterDeclaration");
      }
      flowParseTypeParameterInstantiation() {
        const node2 = this.startNode();
        const oldInType = this.state.inType;
        node2.params = [];
        this.state.inType = true;
        this.expect(47);
        const oldNoAnonFunctionType = this.state.noAnonFunctionType;
        this.state.noAnonFunctionType = false;
        while (!this.match(48)) {
          node2.params.push(this.flowParseType());
          if (!this.match(48)) {
            this.expect(12);
          }
        }
        this.state.noAnonFunctionType = oldNoAnonFunctionType;
        this.expect(48);
        this.state.inType = oldInType;
        return this.finishNode(node2, "TypeParameterInstantiation");
      }
      flowParseTypeParameterInstantiationCallOrNew() {
        const node2 = this.startNode();
        const oldInType = this.state.inType;
        node2.params = [];
        this.state.inType = true;
        this.expect(47);
        while (!this.match(48)) {
          node2.params.push(this.flowParseTypeOrImplicitInstantiation());
          if (!this.match(48)) {
            this.expect(12);
          }
        }
        this.expect(48);
        this.state.inType = oldInType;
        return this.finishNode(node2, "TypeParameterInstantiation");
      }
      flowParseInterfaceType() {
        const node2 = this.startNode();
        this.expectContextual(129);
        node2.extends = [];
        if (this.eat(81)) {
          do {
            node2.extends.push(this.flowParseInterfaceExtends());
          } while (this.eat(12));
        }
        node2.body = this.flowParseObjectType({
          allowStatic: false,
          allowExact: false,
          allowSpread: false,
          allowProto: false,
          allowInexact: false
        });
        return this.finishNode(node2, "InterfaceTypeAnnotation");
      }
      flowParseObjectPropertyKey() {
        return this.match(135) || this.match(134) ? super.parseExprAtom() : this.parseIdentifier(true);
      }
      flowParseObjectTypeIndexer(node2, isStatic, variance) {
        node2.static = isStatic;
        if (this.lookahead().type === 14) {
          node2.id = this.flowParseObjectPropertyKey();
          node2.key = this.flowParseTypeInitialiser();
        } else {
          node2.id = null;
          node2.key = this.flowParseType();
        }
        this.expect(3);
        node2.value = this.flowParseTypeInitialiser();
        node2.variance = variance;
        return this.finishNode(node2, "ObjectTypeIndexer");
      }
      flowParseObjectTypeInternalSlot(node2, isStatic) {
        node2.static = isStatic;
        node2.id = this.flowParseObjectPropertyKey();
        this.expect(3);
        this.expect(3);
        if (this.match(47) || this.match(10)) {
          node2.method = true;
          node2.optional = false;
          node2.value = this.flowParseObjectTypeMethodish(this.startNodeAt(node2.loc.start));
        } else {
          node2.method = false;
          if (this.eat(17)) {
            node2.optional = true;
          }
          node2.value = this.flowParseTypeInitialiser();
        }
        return this.finishNode(node2, "ObjectTypeInternalSlot");
      }
      flowParseObjectTypeMethodish(node2) {
        node2.params = [];
        node2.rest = null;
        node2.typeParameters = null;
        node2.this = null;
        if (this.match(47)) {
          node2.typeParameters = this.flowParseTypeParameterDeclaration();
        }
        this.expect(10);
        if (this.match(78)) {
          node2.this = this.flowParseFunctionTypeParam(true);
          node2.this.name = null;
          if (!this.match(11)) {
            this.expect(12);
          }
        }
        while (!this.match(11) && !this.match(21)) {
          node2.params.push(this.flowParseFunctionTypeParam(false));
          if (!this.match(11)) {
            this.expect(12);
          }
        }
        if (this.eat(21)) {
          node2.rest = this.flowParseFunctionTypeParam(false);
        }
        this.expect(11);
        node2.returnType = this.flowParseTypeInitialiser();
        return this.finishNode(node2, "FunctionTypeAnnotation");
      }
      flowParseObjectTypeCallProperty(node2, isStatic) {
        const valueNode = this.startNode();
        node2.static = isStatic;
        node2.value = this.flowParseObjectTypeMethodish(valueNode);
        return this.finishNode(node2, "ObjectTypeCallProperty");
      }
      flowParseObjectType({
        allowStatic,
        allowExact,
        allowSpread,
        allowProto,
        allowInexact
      }) {
        const oldInType = this.state.inType;
        this.state.inType = true;
        const nodeStart = this.startNode();
        nodeStart.callProperties = [];
        nodeStart.properties = [];
        nodeStart.indexers = [];
        nodeStart.internalSlots = [];
        let endDelim;
        let exact;
        let inexact = false;
        if (allowExact && this.match(6)) {
          this.expect(6);
          endDelim = 9;
          exact = true;
        } else {
          this.expect(5);
          endDelim = 8;
          exact = false;
        }
        nodeStart.exact = exact;
        while (!this.match(endDelim)) {
          let isStatic = false;
          let protoStartLoc = null;
          let inexactStartLoc = null;
          const node2 = this.startNode();
          if (allowProto && this.isContextual(118)) {
            const lookahead = this.lookahead();
            if (lookahead.type !== 14 && lookahead.type !== 17) {
              this.next();
              protoStartLoc = this.state.startLoc;
              allowStatic = false;
            }
          }
          if (allowStatic && this.isContextual(106)) {
            const lookahead = this.lookahead();
            if (lookahead.type !== 14 && lookahead.type !== 17) {
              this.next();
              isStatic = true;
            }
          }
          const variance = this.flowParseVariance();
          if (this.eat(0)) {
            if (protoStartLoc != null) {
              this.unexpected(protoStartLoc);
            }
            if (this.eat(0)) {
              if (variance) {
                this.unexpected(variance.loc.start);
              }
              nodeStart.internalSlots.push(this.flowParseObjectTypeInternalSlot(node2, isStatic));
            } else {
              nodeStart.indexers.push(this.flowParseObjectTypeIndexer(node2, isStatic, variance));
            }
          } else if (this.match(10) || this.match(47)) {
            if (protoStartLoc != null) {
              this.unexpected(protoStartLoc);
            }
            if (variance) {
              this.unexpected(variance.loc.start);
            }
            nodeStart.callProperties.push(this.flowParseObjectTypeCallProperty(node2, isStatic));
          } else {
            let kind2 = "init";
            if (this.isContextual(99) || this.isContextual(104)) {
              const lookahead = this.lookahead();
              if (tokenIsLiteralPropertyName(lookahead.type)) {
                kind2 = this.state.value;
                this.next();
              }
            }
            const propOrInexact = this.flowParseObjectTypeProperty(node2, isStatic, protoStartLoc, variance, kind2, allowSpread, allowInexact != null ? allowInexact : !exact);
            if (propOrInexact === null) {
              inexact = true;
              inexactStartLoc = this.state.lastTokStartLoc;
            } else {
              nodeStart.properties.push(propOrInexact);
            }
          }
          this.flowObjectTypeSemicolon();
          if (inexactStartLoc && !this.match(8) && !this.match(9)) {
            this.raise(FlowErrors.UnexpectedExplicitInexactInObject, inexactStartLoc);
          }
        }
        this.expect(endDelim);
        if (allowSpread) {
          nodeStart.inexact = inexact;
        }
        const out = this.finishNode(nodeStart, "ObjectTypeAnnotation");
        this.state.inType = oldInType;
        return out;
      }
      flowParseObjectTypeProperty(node2, isStatic, protoStartLoc, variance, kind2, allowSpread, allowInexact) {
        if (this.eat(21)) {
          const isInexactToken = this.match(12) || this.match(13) || this.match(8) || this.match(9);
          if (isInexactToken) {
            if (!allowSpread) {
              this.raise(FlowErrors.InexactInsideNonObject, this.state.lastTokStartLoc);
            } else if (!allowInexact) {
              this.raise(FlowErrors.InexactInsideExact, this.state.lastTokStartLoc);
            }
            if (variance) {
              this.raise(FlowErrors.InexactVariance, variance);
            }
            return null;
          }
          if (!allowSpread) {
            this.raise(FlowErrors.UnexpectedSpreadType, this.state.lastTokStartLoc);
          }
          if (protoStartLoc != null) {
            this.unexpected(protoStartLoc);
          }
          if (variance) {
            this.raise(FlowErrors.SpreadVariance, variance);
          }
          node2.argument = this.flowParseType();
          return this.finishNode(node2, "ObjectTypeSpreadProperty");
        } else {
          node2.key = this.flowParseObjectPropertyKey();
          node2.static = isStatic;
          node2.proto = protoStartLoc != null;
          node2.kind = kind2;
          let optional = false;
          if (this.match(47) || this.match(10)) {
            node2.method = true;
            if (protoStartLoc != null) {
              this.unexpected(protoStartLoc);
            }
            if (variance) {
              this.unexpected(variance.loc.start);
            }
            node2.value = this.flowParseObjectTypeMethodish(this.startNodeAt(node2.loc.start));
            if (kind2 === "get" || kind2 === "set") {
              this.flowCheckGetterSetterParams(node2);
            }
            if (!allowSpread && node2.key.name === "constructor" && node2.value.this) {
              this.raise(FlowErrors.ThisParamBannedInConstructor, node2.value.this);
            }
          } else {
            if (kind2 !== "init") this.unexpected();
            node2.method = false;
            if (this.eat(17)) {
              optional = true;
            }
            node2.value = this.flowParseTypeInitialiser();
            node2.variance = variance;
          }
          node2.optional = optional;
          return this.finishNode(node2, "ObjectTypeProperty");
        }
      }
      flowCheckGetterSetterParams(property) {
        const paramCount = property.kind === "get" ? 0 : 1;
        const length = property.value.params.length + (property.value.rest ? 1 : 0);
        if (property.value.this) {
          this.raise(property.kind === "get" ? FlowErrors.GetterMayNotHaveThisParam : FlowErrors.SetterMayNotHaveThisParam, property.value.this);
        }
        if (length !== paramCount) {
          this.raise(property.kind === "get" ? Errors.BadGetterArity : Errors.BadSetterArity, property);
        }
        if (property.kind === "set" && property.value.rest) {
          this.raise(Errors.BadSetterRestParameter, property);
        }
      }
      flowObjectTypeSemicolon() {
        if (!this.eat(13) && !this.eat(12) && !this.match(8) && !this.match(9)) {
          this.unexpected();
        }
      }
      flowParseQualifiedTypeIdentifier(startLoc, id) {
        var _startLoc;
        (_startLoc = startLoc) != null ? _startLoc : startLoc = this.state.startLoc;
        let node2 = id || this.flowParseRestrictedIdentifier(true);
        while (this.eat(16)) {
          const node22 = this.startNodeAt(startLoc);
          node22.qualification = node2;
          node22.id = this.flowParseRestrictedIdentifier(true);
          node2 = this.finishNode(node22, "QualifiedTypeIdentifier");
        }
        return node2;
      }
      flowParseGenericType(startLoc, id) {
        const node2 = this.startNodeAt(startLoc);
        node2.typeParameters = null;
        node2.id = this.flowParseQualifiedTypeIdentifier(startLoc, id);
        if (this.match(47)) {
          node2.typeParameters = this.flowParseTypeParameterInstantiation();
        }
        return this.finishNode(node2, "GenericTypeAnnotation");
      }
      flowParseTypeofType() {
        const node2 = this.startNode();
        this.expect(87);
        node2.argument = this.flowParsePrimaryType();
        return this.finishNode(node2, "TypeofTypeAnnotation");
      }
      flowParseTupleType() {
        const node2 = this.startNode();
        node2.types = [];
        this.expect(0);
        while (this.state.pos < this.length && !this.match(3)) {
          node2.types.push(this.flowParseType());
          if (this.match(3)) break;
          this.expect(12);
        }
        this.expect(3);
        return this.finishNode(node2, "TupleTypeAnnotation");
      }
      flowParseFunctionTypeParam(first) {
        let name2 = null;
        let optional = false;
        let typeAnnotation = null;
        const node2 = this.startNode();
        const lh = this.lookahead();
        const isThis = this.state.type === 78;
        if (lh.type === 14 || lh.type === 17) {
          if (isThis && !first) {
            this.raise(FlowErrors.ThisParamMustBeFirst, node2);
          }
          name2 = this.parseIdentifier(isThis);
          if (this.eat(17)) {
            optional = true;
            if (isThis) {
              this.raise(FlowErrors.ThisParamMayNotBeOptional, node2);
            }
          }
          typeAnnotation = this.flowParseTypeInitialiser();
        } else {
          typeAnnotation = this.flowParseType();
        }
        node2.name = name2;
        node2.optional = optional;
        node2.typeAnnotation = typeAnnotation;
        return this.finishNode(node2, "FunctionTypeParam");
      }
      reinterpretTypeAsFunctionTypeParam(type) {
        const node2 = this.startNodeAt(type.loc.start);
        node2.name = null;
        node2.optional = false;
        node2.typeAnnotation = type;
        return this.finishNode(node2, "FunctionTypeParam");
      }
      flowParseFunctionTypeParams(params = []) {
        let rest = null;
        let _this = null;
        if (this.match(78)) {
          _this = this.flowParseFunctionTypeParam(true);
          _this.name = null;
          if (!this.match(11)) {
            this.expect(12);
          }
        }
        while (!this.match(11) && !this.match(21)) {
          params.push(this.flowParseFunctionTypeParam(false));
          if (!this.match(11)) {
            this.expect(12);
          }
        }
        if (this.eat(21)) {
          rest = this.flowParseFunctionTypeParam(false);
        }
        return {
          params,
          rest,
          _this
        };
      }
      flowIdentToTypeAnnotation(startLoc, node2, id) {
        switch (id.name) {
          case "any":
            return this.finishNode(node2, "AnyTypeAnnotation");
          case "bool":
          case "boolean":
            return this.finishNode(node2, "BooleanTypeAnnotation");
          case "mixed":
            return this.finishNode(node2, "MixedTypeAnnotation");
          case "empty":
            return this.finishNode(node2, "EmptyTypeAnnotation");
          case "number":
            return this.finishNode(node2, "NumberTypeAnnotation");
          case "string":
            return this.finishNode(node2, "StringTypeAnnotation");
          case "symbol":
            return this.finishNode(node2, "SymbolTypeAnnotation");
          default:
            this.checkNotUnderscore(id.name);
            return this.flowParseGenericType(startLoc, id);
        }
      }
      flowParsePrimaryType() {
        const startLoc = this.state.startLoc;
        const node2 = this.startNode();
        let tmp;
        let type;
        let isGroupedType = false;
        const oldNoAnonFunctionType = this.state.noAnonFunctionType;
        switch (this.state.type) {
          case 5:
            return this.flowParseObjectType({
              allowStatic: false,
              allowExact: false,
              allowSpread: true,
              allowProto: false,
              allowInexact: true
            });
          case 6:
            return this.flowParseObjectType({
              allowStatic: false,
              allowExact: true,
              allowSpread: true,
              allowProto: false,
              allowInexact: false
            });
          case 0:
            this.state.noAnonFunctionType = false;
            type = this.flowParseTupleType();
            this.state.noAnonFunctionType = oldNoAnonFunctionType;
            return type;
          case 47: {
            const node3 = this.startNode();
            node3.typeParameters = this.flowParseTypeParameterDeclaration();
            this.expect(10);
            tmp = this.flowParseFunctionTypeParams();
            node3.params = tmp.params;
            node3.rest = tmp.rest;
            node3.this = tmp._this;
            this.expect(11);
            this.expect(19);
            node3.returnType = this.flowParseType();
            return this.finishNode(node3, "FunctionTypeAnnotation");
          }
          case 10: {
            const node3 = this.startNode();
            this.next();
            if (!this.match(11) && !this.match(21)) {
              if (tokenIsIdentifier(this.state.type) || this.match(78)) {
                const token = this.lookahead().type;
                isGroupedType = token !== 17 && token !== 14;
              } else {
                isGroupedType = true;
              }
            }
            if (isGroupedType) {
              this.state.noAnonFunctionType = false;
              type = this.flowParseType();
              this.state.noAnonFunctionType = oldNoAnonFunctionType;
              if (this.state.noAnonFunctionType || !(this.match(12) || this.match(11) && this.lookahead().type === 19)) {
                this.expect(11);
                return type;
              } else {
                this.eat(12);
              }
            }
            if (type) {
              tmp = this.flowParseFunctionTypeParams([this.reinterpretTypeAsFunctionTypeParam(type)]);
            } else {
              tmp = this.flowParseFunctionTypeParams();
            }
            node3.params = tmp.params;
            node3.rest = tmp.rest;
            node3.this = tmp._this;
            this.expect(11);
            this.expect(19);
            node3.returnType = this.flowParseType();
            node3.typeParameters = null;
            return this.finishNode(node3, "FunctionTypeAnnotation");
          }
          case 134:
            return this.parseLiteral(this.state.value, "StringLiteralTypeAnnotation");
          case 85:
          case 86:
            node2.value = this.match(85);
            this.next();
            return this.finishNode(node2, "BooleanLiteralTypeAnnotation");
          case 53:
            if (this.state.value === "-") {
              this.next();
              if (this.match(135)) {
                return this.parseLiteralAtNode(-this.state.value, "NumberLiteralTypeAnnotation", node2);
              }
              if (this.match(136)) {
                return this.parseLiteralAtNode(-this.state.value, "BigIntLiteralTypeAnnotation", node2);
              }
              throw this.raise(FlowErrors.UnexpectedSubtractionOperand, this.state.startLoc);
            }
            this.unexpected();
            return;
          case 135:
            return this.parseLiteral(this.state.value, "NumberLiteralTypeAnnotation");
          case 136:
            return this.parseLiteral(this.state.value, "BigIntLiteralTypeAnnotation");
          case 88:
            this.next();
            return this.finishNode(node2, "VoidTypeAnnotation");
          case 84:
            this.next();
            return this.finishNode(node2, "NullLiteralTypeAnnotation");
          case 78:
            this.next();
            return this.finishNode(node2, "ThisTypeAnnotation");
          case 55:
            this.next();
            return this.finishNode(node2, "ExistsTypeAnnotation");
          case 87:
            return this.flowParseTypeofType();
          default:
            if (tokenIsKeyword(this.state.type)) {
              const label = tokenLabelName(this.state.type);
              this.next();
              return super.createIdentifier(node2, label);
            } else if (tokenIsIdentifier(this.state.type)) {
              if (this.isContextual(129)) {
                return this.flowParseInterfaceType();
              }
              return this.flowIdentToTypeAnnotation(startLoc, node2, this.parseIdentifier());
            }
        }
        this.unexpected();
      }
      flowParsePostfixType() {
        const startLoc = this.state.startLoc;
        let type = this.flowParsePrimaryType();
        let seenOptionalIndexedAccess = false;
        while ((this.match(0) || this.match(18)) && !this.canInsertSemicolon()) {
          const node2 = this.startNodeAt(startLoc);
          const optional = this.eat(18);
          seenOptionalIndexedAccess = seenOptionalIndexedAccess || optional;
          this.expect(0);
          if (!optional && this.match(3)) {
            node2.elementType = type;
            this.next();
            type = this.finishNode(node2, "ArrayTypeAnnotation");
          } else {
            node2.objectType = type;
            node2.indexType = this.flowParseType();
            this.expect(3);
            if (seenOptionalIndexedAccess) {
              node2.optional = optional;
              type = this.finishNode(node2, "OptionalIndexedAccessType");
            } else {
              type = this.finishNode(node2, "IndexedAccessType");
            }
          }
        }
        return type;
      }
      flowParsePrefixType() {
        const node2 = this.startNode();
        if (this.eat(17)) {
          node2.typeAnnotation = this.flowParsePrefixType();
          return this.finishNode(node2, "NullableTypeAnnotation");
        } else {
          return this.flowParsePostfixType();
        }
      }
      flowParseAnonFunctionWithoutParens() {
        const param = this.flowParsePrefixType();
        if (!this.state.noAnonFunctionType && this.eat(19)) {
          const node2 = this.startNodeAt(param.loc.start);
          node2.params = [this.reinterpretTypeAsFunctionTypeParam(param)];
          node2.rest = null;
          node2.this = null;
          node2.returnType = this.flowParseType();
          node2.typeParameters = null;
          return this.finishNode(node2, "FunctionTypeAnnotation");
        }
        return param;
      }
      flowParseIntersectionType() {
        const node2 = this.startNode();
        this.eat(45);
        const type = this.flowParseAnonFunctionWithoutParens();
        node2.types = [type];
        while (this.eat(45)) {
          node2.types.push(this.flowParseAnonFunctionWithoutParens());
        }
        return node2.types.length === 1 ? type : this.finishNode(node2, "IntersectionTypeAnnotation");
      }
      flowParseUnionType() {
        const node2 = this.startNode();
        this.eat(43);
        const type = this.flowParseIntersectionType();
        node2.types = [type];
        while (this.eat(43)) {
          node2.types.push(this.flowParseIntersectionType());
        }
        return node2.types.length === 1 ? type : this.finishNode(node2, "UnionTypeAnnotation");
      }
      flowParseType() {
        const oldInType = this.state.inType;
        this.state.inType = true;
        const type = this.flowParseUnionType();
        this.state.inType = oldInType;
        return type;
      }
      flowParseTypeOrImplicitInstantiation() {
        if (this.state.type === 132 && this.state.value === "_") {
          const startLoc = this.state.startLoc;
          const node2 = this.parseIdentifier();
          return this.flowParseGenericType(startLoc, node2);
        } else {
          return this.flowParseType();
        }
      }
      flowParseTypeAnnotation() {
        const node2 = this.startNode();
        node2.typeAnnotation = this.flowParseTypeInitialiser();
        return this.finishNode(node2, "TypeAnnotation");
      }
      flowParseTypeAnnotatableIdentifier(allowPrimitiveOverride) {
        const ident = allowPrimitiveOverride ? this.parseIdentifier() : this.flowParseRestrictedIdentifier();
        if (this.match(14)) {
          ident.typeAnnotation = this.flowParseTypeAnnotation();
          this.resetEndLocation(ident);
        }
        return ident;
      }
      typeCastToParameter(node2) {
        node2.expression.typeAnnotation = node2.typeAnnotation;
        this.resetEndLocation(node2.expression, node2.typeAnnotation.loc.end);
        return node2.expression;
      }
      flowParseVariance() {
        let variance = null;
        if (this.match(53)) {
          variance = this.startNode();
          if (this.state.value === "+") {
            variance.kind = "plus";
          } else {
            variance.kind = "minus";
          }
          this.next();
          return this.finishNode(variance, "Variance");
        }
        return variance;
      }
      parseFunctionBody(node2, allowExpressionBody, isMethod = false) {
        if (allowExpressionBody) {
          this.forwardNoArrowParamsConversionAt(node2, () => super.parseFunctionBody(node2, true, isMethod));
          return;
        }
        super.parseFunctionBody(node2, false, isMethod);
      }
      parseFunctionBodyAndFinish(node2, type, isMethod = false) {
        if (this.match(14)) {
          const typeNode = this.startNode();
          [typeNode.typeAnnotation, node2.predicate] = this.flowParseTypeAndPredicateInitialiser();
          node2.returnType = typeNode.typeAnnotation ? this.finishNode(typeNode, "TypeAnnotation") : null;
        }
        return super.parseFunctionBodyAndFinish(node2, type, isMethod);
      }
      parseStatementLike(flags2) {
        if (this.state.strict && this.isContextual(129)) {
          const lookahead = this.lookahead();
          if (tokenIsKeywordOrIdentifier(lookahead.type)) {
            const node2 = this.startNode();
            this.next();
            return this.flowParseInterface(node2);
          }
        } else if (this.isContextual(126)) {
          const node2 = this.startNode();
          this.next();
          return this.flowParseEnumDeclaration(node2);
        }
        const stmt = super.parseStatementLike(flags2);
        if (this.flowPragma === void 0 && !this.isValidDirective(stmt)) {
          this.flowPragma = null;
        }
        return stmt;
      }
      parseExpressionStatement(node2, expr, decorators) {
        if (expr.type === "Identifier") {
          if (expr.name === "declare") {
            if (this.match(80) || tokenIsIdentifier(this.state.type) || this.match(68) || this.match(74) || this.match(82)) {
              return this.flowParseDeclare(node2);
            }
          } else if (tokenIsIdentifier(this.state.type)) {
            if (expr.name === "interface") {
              return this.flowParseInterface(node2);
            } else if (expr.name === "type") {
              return this.flowParseTypeAlias(node2);
            } else if (expr.name === "opaque") {
              return this.flowParseOpaqueType(node2, false);
            }
          }
        }
        return super.parseExpressionStatement(node2, expr, decorators);
      }
      shouldParseExportDeclaration() {
        const {
          type
        } = this.state;
        if (type === 126 || tokenIsFlowInterfaceOrTypeOrOpaque(type)) {
          return !this.state.containsEsc;
        }
        return super.shouldParseExportDeclaration();
      }
      isExportDefaultSpecifier() {
        const {
          type
        } = this.state;
        if (type === 126 || tokenIsFlowInterfaceOrTypeOrOpaque(type)) {
          return this.state.containsEsc;
        }
        return super.isExportDefaultSpecifier();
      }
      parseExportDefaultExpression() {
        if (this.isContextual(126)) {
          const node2 = this.startNode();
          this.next();
          return this.flowParseEnumDeclaration(node2);
        }
        return super.parseExportDefaultExpression();
      }
      parseConditional(expr, startLoc, refExpressionErrors) {
        if (!this.match(17)) return expr;
        if (this.state.maybeInArrowParameters) {
          const nextCh = this.lookaheadCharCode();
          if (nextCh === 44 || nextCh === 61 || nextCh === 58 || nextCh === 41) {
            this.setOptionalParametersError(refExpressionErrors);
            return expr;
          }
        }
        this.expect(17);
        const state2 = this.state.clone();
        const originalNoArrowAt = this.state.noArrowAt;
        const node2 = this.startNodeAt(startLoc);
        let {
          consequent,
          failed
        } = this.tryParseConditionalConsequent();
        let [valid, invalid] = this.getArrowLikeExpressions(consequent);
        if (failed || invalid.length > 0) {
          const noArrowAt = [...originalNoArrowAt];
          if (invalid.length > 0) {
            this.state = state2;
            this.state.noArrowAt = noArrowAt;
            for (let i7 = 0; i7 < invalid.length; i7++) {
              noArrowAt.push(invalid[i7].start);
            }
            ({
              consequent,
              failed
            } = this.tryParseConditionalConsequent());
            [valid, invalid] = this.getArrowLikeExpressions(consequent);
          }
          if (failed && valid.length > 1) {
            this.raise(FlowErrors.AmbiguousConditionalArrow, state2.startLoc);
          }
          if (failed && valid.length === 1) {
            this.state = state2;
            noArrowAt.push(valid[0].start);
            this.state.noArrowAt = noArrowAt;
            ({
              consequent,
              failed
            } = this.tryParseConditionalConsequent());
          }
        }
        this.getArrowLikeExpressions(consequent, true);
        this.state.noArrowAt = originalNoArrowAt;
        this.expect(14);
        node2.test = expr;
        node2.consequent = consequent;
        node2.alternate = this.forwardNoArrowParamsConversionAt(node2, () => this.parseMaybeAssign(void 0, void 0));
        return this.finishNode(node2, "ConditionalExpression");
      }
      tryParseConditionalConsequent() {
        this.state.noArrowParamsConversionAt.push(this.state.start);
        const consequent = this.parseMaybeAssignAllowIn();
        const failed = !this.match(14);
        this.state.noArrowParamsConversionAt.pop();
        return {
          consequent,
          failed
        };
      }
      getArrowLikeExpressions(node2, disallowInvalid) {
        const stack = [node2];
        const arrows = [];
        while (stack.length !== 0) {
          const node3 = stack.pop();
          if (node3.type === "ArrowFunctionExpression" && node3.body.type !== "BlockStatement") {
            if (node3.typeParameters || !node3.returnType) {
              this.finishArrowValidation(node3);
            } else {
              arrows.push(node3);
            }
            stack.push(node3.body);
          } else if (node3.type === "ConditionalExpression") {
            stack.push(node3.consequent);
            stack.push(node3.alternate);
          }
        }
        if (disallowInvalid) {
          arrows.forEach((node3) => this.finishArrowValidation(node3));
          return [arrows, []];
        }
        return partition2(arrows, (node3) => node3.params.every((param) => this.isAssignable(param, true)));
      }
      finishArrowValidation(node2) {
        var _node$extra;
        this.toAssignableList(node2.params, (_node$extra = node2.extra) == null ? void 0 : _node$extra.trailingCommaLoc, false);
        this.scope.enter(2 | 4);
        super.checkParams(node2, false, true);
        this.scope.exit();
      }
      forwardNoArrowParamsConversionAt(node2, parse18) {
        let result;
        if (this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(node2.start))) {
          this.state.noArrowParamsConversionAt.push(this.state.start);
          result = parse18();
          this.state.noArrowParamsConversionAt.pop();
        } else {
          result = parse18();
        }
        return result;
      }
      parseParenItem(node2, startLoc) {
        const newNode = super.parseParenItem(node2, startLoc);
        if (this.eat(17)) {
          newNode.optional = true;
          this.resetEndLocation(node2);
        }
        if (this.match(14)) {
          const typeCastNode = this.startNodeAt(startLoc);
          typeCastNode.expression = newNode;
          typeCastNode.typeAnnotation = this.flowParseTypeAnnotation();
          return this.finishNode(typeCastNode, "TypeCastExpression");
        }
        return newNode;
      }
      assertModuleNodeAllowed(node2) {
        if (node2.type === "ImportDeclaration" && (node2.importKind === "type" || node2.importKind === "typeof") || node2.type === "ExportNamedDeclaration" && node2.exportKind === "type" || node2.type === "ExportAllDeclaration" && node2.exportKind === "type") {
          return;
        }
        super.assertModuleNodeAllowed(node2);
      }
      parseExportDeclaration(node2) {
        if (this.isContextual(130)) {
          node2.exportKind = "type";
          const declarationNode = this.startNode();
          this.next();
          if (this.match(5)) {
            node2.specifiers = this.parseExportSpecifiers(true);
            super.parseExportFrom(node2);
            return null;
          } else {
            return this.flowParseTypeAlias(declarationNode);
          }
        } else if (this.isContextual(131)) {
          node2.exportKind = "type";
          const declarationNode = this.startNode();
          this.next();
          return this.flowParseOpaqueType(declarationNode, false);
        } else if (this.isContextual(129)) {
          node2.exportKind = "type";
          const declarationNode = this.startNode();
          this.next();
          return this.flowParseInterface(declarationNode);
        } else if (this.isContextual(126)) {
          node2.exportKind = "value";
          const declarationNode = this.startNode();
          this.next();
          return this.flowParseEnumDeclaration(declarationNode);
        } else {
          return super.parseExportDeclaration(node2);
        }
      }
      eatExportStar(node2) {
        if (super.eatExportStar(node2)) return true;
        if (this.isContextual(130) && this.lookahead().type === 55) {
          node2.exportKind = "type";
          this.next();
          this.next();
          return true;
        }
        return false;
      }
      maybeParseExportNamespaceSpecifier(node2) {
        const {
          startLoc
        } = this.state;
        const hasNamespace = super.maybeParseExportNamespaceSpecifier(node2);
        if (hasNamespace && node2.exportKind === "type") {
          this.unexpected(startLoc);
        }
        return hasNamespace;
      }
      parseClassId(node2, isStatement, optionalId) {
        super.parseClassId(node2, isStatement, optionalId);
        if (this.match(47)) {
          node2.typeParameters = this.flowParseTypeParameterDeclaration();
        }
      }
      parseClassMember(classBody, member, state2) {
        const {
          startLoc
        } = this.state;
        if (this.isContextual(125)) {
          if (super.parseClassMemberFromModifier(classBody, member)) {
            return;
          }
          member.declare = true;
        }
        super.parseClassMember(classBody, member, state2);
        if (member.declare) {
          if (member.type !== "ClassProperty" && member.type !== "ClassPrivateProperty" && member.type !== "PropertyDefinition") {
            this.raise(FlowErrors.DeclareClassElement, startLoc);
          } else if (member.value) {
            this.raise(FlowErrors.DeclareClassFieldInitializer, member.value);
          }
        }
      }
      isIterator(word) {
        return word === "iterator" || word === "asyncIterator";
      }
      readIterator() {
        const word = super.readWord1();
        const fullWord = "@@" + word;
        if (!this.isIterator(word) || !this.state.inType) {
          this.raise(Errors.InvalidIdentifier, this.state.curPosition(), {
            identifierName: fullWord
          });
        }
        this.finishToken(132, fullWord);
      }
      getTokenFromCode(code2) {
        const next = this.input.charCodeAt(this.state.pos + 1);
        if (code2 === 123 && next === 124) {
          this.finishOp(6, 2);
        } else if (this.state.inType && (code2 === 62 || code2 === 60)) {
          this.finishOp(code2 === 62 ? 48 : 47, 1);
        } else if (this.state.inType && code2 === 63) {
          if (next === 46) {
            this.finishOp(18, 2);
          } else {
            this.finishOp(17, 1);
          }
        } else if (isIteratorStart(code2, next, this.input.charCodeAt(this.state.pos + 2))) {
          this.state.pos += 2;
          this.readIterator();
        } else {
          super.getTokenFromCode(code2);
        }
      }
      isAssignable(node2, isBinding) {
        if (node2.type === "TypeCastExpression") {
          return this.isAssignable(node2.expression, isBinding);
        } else {
          return super.isAssignable(node2, isBinding);
        }
      }
      toAssignable(node2, isLHS = false) {
        if (!isLHS && node2.type === "AssignmentExpression" && node2.left.type === "TypeCastExpression") {
          node2.left = this.typeCastToParameter(node2.left);
        }
        super.toAssignable(node2, isLHS);
      }
      toAssignableList(exprList, trailingCommaLoc, isLHS) {
        for (let i7 = 0; i7 < exprList.length; i7++) {
          const expr = exprList[i7];
          if ((expr == null ? void 0 : expr.type) === "TypeCastExpression") {
            exprList[i7] = this.typeCastToParameter(expr);
          }
        }
        super.toAssignableList(exprList, trailingCommaLoc, isLHS);
      }
      toReferencedList(exprList, isParenthesizedExpr) {
        for (let i7 = 0; i7 < exprList.length; i7++) {
          var _expr$extra;
          const expr = exprList[i7];
          if (expr && expr.type === "TypeCastExpression" && !((_expr$extra = expr.extra) != null && _expr$extra.parenthesized) && (exprList.length > 1 || !isParenthesizedExpr)) {
            this.raise(FlowErrors.TypeCastInPattern, expr.typeAnnotation);
          }
        }
        return exprList;
      }
      parseArrayLike(close2, canBePattern, isTuple, refExpressionErrors) {
        const node2 = super.parseArrayLike(close2, canBePattern, isTuple, refExpressionErrors);
        if (canBePattern && !this.state.maybeInArrowParameters) {
          this.toReferencedList(node2.elements);
        }
        return node2;
      }
      isValidLVal(type, isParenthesized, binding) {
        return type === "TypeCastExpression" || super.isValidLVal(type, isParenthesized, binding);
      }
      parseClassProperty(node2) {
        if (this.match(14)) {
          node2.typeAnnotation = this.flowParseTypeAnnotation();
        }
        return super.parseClassProperty(node2);
      }
      parseClassPrivateProperty(node2) {
        if (this.match(14)) {
          node2.typeAnnotation = this.flowParseTypeAnnotation();
        }
        return super.parseClassPrivateProperty(node2);
      }
      isClassMethod() {
        return this.match(47) || super.isClassMethod();
      }
      isClassProperty() {
        return this.match(14) || super.isClassProperty();
      }
      isNonstaticConstructor(method) {
        return !this.match(14) && super.isNonstaticConstructor(method);
      }
      pushClassMethod(classBody, method, isGenerator, isAsync4, isConstructor, allowsDirectSuper) {
        if (method.variance) {
          this.unexpected(method.variance.loc.start);
        }
        delete method.variance;
        if (this.match(47)) {
          method.typeParameters = this.flowParseTypeParameterDeclaration();
        }
        super.pushClassMethod(classBody, method, isGenerator, isAsync4, isConstructor, allowsDirectSuper);
        if (method.params && isConstructor) {
          const params = method.params;
          if (params.length > 0 && this.isThisParam(params[0])) {
            this.raise(FlowErrors.ThisParamBannedInConstructor, method);
          }
        } else if (method.type === "MethodDefinition" && isConstructor && method.value.params) {
          const params = method.value.params;
          if (params.length > 0 && this.isThisParam(params[0])) {
            this.raise(FlowErrors.ThisParamBannedInConstructor, method);
          }
        }
      }
      pushClassPrivateMethod(classBody, method, isGenerator, isAsync4) {
        if (method.variance) {
          this.unexpected(method.variance.loc.start);
        }
        delete method.variance;
        if (this.match(47)) {
          method.typeParameters = this.flowParseTypeParameterDeclaration();
        }
        super.pushClassPrivateMethod(classBody, method, isGenerator, isAsync4);
      }
      parseClassSuper(node2) {
        super.parseClassSuper(node2);
        if (node2.superClass && this.match(47)) {
          node2.superTypeParameters = this.flowParseTypeParameterInstantiation();
        }
        if (this.isContextual(113)) {
          this.next();
          const implemented = node2.implements = [];
          do {
            const node3 = this.startNode();
            node3.id = this.flowParseRestrictedIdentifier(true);
            if (this.match(47)) {
              node3.typeParameters = this.flowParseTypeParameterInstantiation();
            } else {
              node3.typeParameters = null;
            }
            implemented.push(this.finishNode(node3, "ClassImplements"));
          } while (this.eat(12));
        }
      }
      checkGetterSetterParams(method) {
        super.checkGetterSetterParams(method);
        const params = this.getObjectOrClassMethodParams(method);
        if (params.length > 0) {
          const param = params[0];
          if (this.isThisParam(param) && method.kind === "get") {
            this.raise(FlowErrors.GetterMayNotHaveThisParam, param);
          } else if (this.isThisParam(param)) {
            this.raise(FlowErrors.SetterMayNotHaveThisParam, param);
          }
        }
      }
      parsePropertyNamePrefixOperator(node2) {
        node2.variance = this.flowParseVariance();
      }
      parseObjPropValue(prop, startLoc, isGenerator, isAsync4, isPattern, isAccessor, refExpressionErrors) {
        if (prop.variance) {
          this.unexpected(prop.variance.loc.start);
        }
        delete prop.variance;
        let typeParameters;
        if (this.match(47) && !isAccessor) {
          typeParameters = this.flowParseTypeParameterDeclaration();
          if (!this.match(10)) this.unexpected();
        }
        const result = super.parseObjPropValue(prop, startLoc, isGenerator, isAsync4, isPattern, isAccessor, refExpressionErrors);
        if (typeParameters) {
          (result.value || result).typeParameters = typeParameters;
        }
        return result;
      }
      parseFunctionParamType(param) {
        if (this.eat(17)) {
          if (param.type !== "Identifier") {
            this.raise(FlowErrors.PatternIsOptional, param);
          }
          if (this.isThisParam(param)) {
            this.raise(FlowErrors.ThisParamMayNotBeOptional, param);
          }
          param.optional = true;
        }
        if (this.match(14)) {
          param.typeAnnotation = this.flowParseTypeAnnotation();
        } else if (this.isThisParam(param)) {
          this.raise(FlowErrors.ThisParamAnnotationRequired, param);
        }
        if (this.match(29) && this.isThisParam(param)) {
          this.raise(FlowErrors.ThisParamNoDefault, param);
        }
        this.resetEndLocation(param);
        return param;
      }
      parseMaybeDefault(startLoc, left2) {
        const node2 = super.parseMaybeDefault(startLoc, left2);
        if (node2.type === "AssignmentPattern" && node2.typeAnnotation && node2.right.start < node2.typeAnnotation.start) {
          this.raise(FlowErrors.TypeBeforeInitializer, node2.typeAnnotation);
        }
        return node2;
      }
      checkImportReflection(node2) {
        super.checkImportReflection(node2);
        if (node2.module && node2.importKind !== "value") {
          this.raise(FlowErrors.ImportReflectionHasImportType, node2.specifiers[0].loc.start);
        }
      }
      parseImportSpecifierLocal(node2, specifier, type) {
        specifier.local = hasTypeImportKind(node2) ? this.flowParseRestrictedIdentifier(true, true) : this.parseIdentifier();
        node2.specifiers.push(this.finishImportSpecifier(specifier, type));
      }
      isPotentialImportPhase(isExport) {
        if (super.isPotentialImportPhase(isExport)) return true;
        if (this.isContextual(130)) {
          if (!isExport) return true;
          const ch2 = this.lookaheadCharCode();
          return ch2 === 123 || ch2 === 42;
        }
        return !isExport && this.isContextual(87);
      }
      applyImportPhase(node2, isExport, phase, loc) {
        super.applyImportPhase(node2, isExport, phase, loc);
        if (isExport) {
          if (!phase && this.match(65)) {
            return;
          }
          node2.exportKind = phase === "type" ? phase : "value";
        } else {
          if (phase === "type" && this.match(55)) this.unexpected();
          node2.importKind = phase === "type" || phase === "typeof" ? phase : "value";
        }
      }
      parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly, bindingType) {
        const firstIdent = specifier.imported;
        let specifierTypeKind = null;
        if (firstIdent.type === "Identifier") {
          if (firstIdent.name === "type") {
            specifierTypeKind = "type";
          } else if (firstIdent.name === "typeof") {
            specifierTypeKind = "typeof";
          }
        }
        let isBinding = false;
        if (this.isContextual(93) && !this.isLookaheadContextual("as")) {
          const as_ident = this.parseIdentifier(true);
          if (specifierTypeKind !== null && !tokenIsKeywordOrIdentifier(this.state.type)) {
            specifier.imported = as_ident;
            specifier.importKind = specifierTypeKind;
            specifier.local = cloneIdentifier(as_ident);
          } else {
            specifier.imported = firstIdent;
            specifier.importKind = null;
            specifier.local = this.parseIdentifier();
          }
        } else {
          if (specifierTypeKind !== null && tokenIsKeywordOrIdentifier(this.state.type)) {
            specifier.imported = this.parseIdentifier(true);
            specifier.importKind = specifierTypeKind;
          } else {
            if (importedIsString) {
              throw this.raise(Errors.ImportBindingIsString, specifier, {
                importName: firstIdent.value
              });
            }
            specifier.imported = firstIdent;
            specifier.importKind = null;
          }
          if (this.eatContextual(93)) {
            specifier.local = this.parseIdentifier();
          } else {
            isBinding = true;
            specifier.local = cloneIdentifier(specifier.imported);
          }
        }
        const specifierIsTypeImport = hasTypeImportKind(specifier);
        if (isInTypeOnlyImport && specifierIsTypeImport) {
          this.raise(FlowErrors.ImportTypeShorthandOnlyInPureImport, specifier);
        }
        if (isInTypeOnlyImport || specifierIsTypeImport) {
          this.checkReservedType(specifier.local.name, specifier.local.loc.start, true);
        }
        if (isBinding && !isInTypeOnlyImport && !specifierIsTypeImport) {
          this.checkReservedWord(specifier.local.name, specifier.loc.start, true, true);
        }
        return this.finishImportSpecifier(specifier, "ImportSpecifier");
      }
      parseBindingAtom() {
        switch (this.state.type) {
          case 78:
            return this.parseIdentifier(true);
          default:
            return super.parseBindingAtom();
        }
      }
      parseFunctionParams(node2, isConstructor) {
        const kind2 = node2.kind;
        if (kind2 !== "get" && kind2 !== "set" && this.match(47)) {
          node2.typeParameters = this.flowParseTypeParameterDeclaration();
        }
        super.parseFunctionParams(node2, isConstructor);
      }
      parseVarId(decl, kind2) {
        super.parseVarId(decl, kind2);
        if (this.match(14)) {
          decl.id.typeAnnotation = this.flowParseTypeAnnotation();
          this.resetEndLocation(decl.id);
        }
      }
      parseAsyncArrowFromCallExpression(node2, call) {
        if (this.match(14)) {
          const oldNoAnonFunctionType = this.state.noAnonFunctionType;
          this.state.noAnonFunctionType = true;
          node2.returnType = this.flowParseTypeAnnotation();
          this.state.noAnonFunctionType = oldNoAnonFunctionType;
        }
        return super.parseAsyncArrowFromCallExpression(node2, call);
      }
      shouldParseAsyncArrow() {
        return this.match(14) || super.shouldParseAsyncArrow();
      }
      parseMaybeAssign(refExpressionErrors, afterLeftParse) {
        var _jsx;
        let state2 = null;
        let jsx2;
        if (this.hasPlugin("jsx") && (this.match(143) || this.match(47))) {
          state2 = this.state.clone();
          jsx2 = this.tryParse(() => super.parseMaybeAssign(refExpressionErrors, afterLeftParse), state2);
          if (!jsx2.error) return jsx2.node;
          const {
            context: context2
          } = this.state;
          const currentContext = context2[context2.length - 1];
          if (currentContext === types13.j_oTag || currentContext === types13.j_expr) {
            context2.pop();
          }
        }
        if ((_jsx = jsx2) != null && _jsx.error || this.match(47)) {
          var _jsx2, _jsx3;
          state2 = state2 || this.state.clone();
          let typeParameters;
          const arrow = this.tryParse((abort) => {
            var _arrowExpression$extr;
            typeParameters = this.flowParseTypeParameterDeclaration();
            const arrowExpression2 = this.forwardNoArrowParamsConversionAt(typeParameters, () => {
              const result = super.parseMaybeAssign(refExpressionErrors, afterLeftParse);
              this.resetStartLocationFromNode(result, typeParameters);
              return result;
            });
            if ((_arrowExpression$extr = arrowExpression2.extra) != null && _arrowExpression$extr.parenthesized) abort();
            const expr = this.maybeUnwrapTypeCastExpression(arrowExpression2);
            if (expr.type !== "ArrowFunctionExpression") abort();
            expr.typeParameters = typeParameters;
            this.resetStartLocationFromNode(expr, typeParameters);
            return arrowExpression2;
          }, state2);
          let arrowExpression = null;
          if (arrow.node && this.maybeUnwrapTypeCastExpression(arrow.node).type === "ArrowFunctionExpression") {
            if (!arrow.error && !arrow.aborted) {
              if (arrow.node.async) {
                this.raise(FlowErrors.UnexpectedTypeParameterBeforeAsyncArrowFunction, typeParameters);
              }
              return arrow.node;
            }
            arrowExpression = arrow.node;
          }
          if ((_jsx2 = jsx2) != null && _jsx2.node) {
            this.state = jsx2.failState;
            return jsx2.node;
          }
          if (arrowExpression) {
            this.state = arrow.failState;
            return arrowExpression;
          }
          if ((_jsx3 = jsx2) != null && _jsx3.thrown) throw jsx2.error;
          if (arrow.thrown) throw arrow.error;
          throw this.raise(FlowErrors.UnexpectedTokenAfterTypeParameter, typeParameters);
        }
        return super.parseMaybeAssign(refExpressionErrors, afterLeftParse);
      }
      parseArrow(node2) {
        if (this.match(14)) {
          const result = this.tryParse(() => {
            const oldNoAnonFunctionType = this.state.noAnonFunctionType;
            this.state.noAnonFunctionType = true;
            const typeNode = this.startNode();
            [typeNode.typeAnnotation, node2.predicate] = this.flowParseTypeAndPredicateInitialiser();
            this.state.noAnonFunctionType = oldNoAnonFunctionType;
            if (this.canInsertSemicolon()) this.unexpected();
            if (!this.match(19)) this.unexpected();
            return typeNode;
          });
          if (result.thrown) return null;
          if (result.error) this.state = result.failState;
          node2.returnType = result.node.typeAnnotation ? this.finishNode(result.node, "TypeAnnotation") : null;
        }
        return super.parseArrow(node2);
      }
      shouldParseArrow(params) {
        return this.match(14) || super.shouldParseArrow(params);
      }
      setArrowFunctionParameters(node2, params) {
        if (this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(node2.start))) {
          node2.params = params;
        } else {
          super.setArrowFunctionParameters(node2, params);
        }
      }
      checkParams(node2, allowDuplicates, isArrowFunction, strictModeChanged = true) {
        if (isArrowFunction && this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(node2.start))) {
          return;
        }
        for (let i7 = 0; i7 < node2.params.length; i7++) {
          if (this.isThisParam(node2.params[i7]) && i7 > 0) {
            this.raise(FlowErrors.ThisParamMustBeFirst, node2.params[i7]);
          }
        }
        super.checkParams(node2, allowDuplicates, isArrowFunction, strictModeChanged);
      }
      parseParenAndDistinguishExpression(canBeArrow) {
        return super.parseParenAndDistinguishExpression(canBeArrow && !this.state.noArrowAt.includes(this.sourceToOffsetPos(this.state.start)));
      }
      parseSubscripts(base, startLoc, noCalls) {
        if (base.type === "Identifier" && base.name === "async" && this.state.noArrowAt.includes(startLoc.index)) {
          this.next();
          const node2 = this.startNodeAt(startLoc);
          node2.callee = base;
          node2.arguments = super.parseCallExpressionArguments(11);
          base = this.finishNode(node2, "CallExpression");
        } else if (base.type === "Identifier" && base.name === "async" && this.match(47)) {
          const state2 = this.state.clone();
          const arrow = this.tryParse((abort) => this.parseAsyncArrowWithTypeParameters(startLoc) || abort(), state2);
          if (!arrow.error && !arrow.aborted) return arrow.node;
          const result = this.tryParse(() => super.parseSubscripts(base, startLoc, noCalls), state2);
          if (result.node && !result.error) return result.node;
          if (arrow.node) {
            this.state = arrow.failState;
            return arrow.node;
          }
          if (result.node) {
            this.state = result.failState;
            return result.node;
          }
          throw arrow.error || result.error;
        }
        return super.parseSubscripts(base, startLoc, noCalls);
      }
      parseSubscript(base, startLoc, noCalls, subscriptState) {
        if (this.match(18) && this.isLookaheadToken_lt()) {
          subscriptState.optionalChainMember = true;
          if (noCalls) {
            subscriptState.stop = true;
            return base;
          }
          this.next();
          const node2 = this.startNodeAt(startLoc);
          node2.callee = base;
          node2.typeArguments = this.flowParseTypeParameterInstantiation();
          this.expect(10);
          node2.arguments = this.parseCallExpressionArguments(11);
          node2.optional = true;
          return this.finishCallExpression(node2, true);
        } else if (!noCalls && this.shouldParseTypes() && this.match(47)) {
          const node2 = this.startNodeAt(startLoc);
          node2.callee = base;
          const result = this.tryParse(() => {
            node2.typeArguments = this.flowParseTypeParameterInstantiationCallOrNew();
            this.expect(10);
            node2.arguments = super.parseCallExpressionArguments(11);
            if (subscriptState.optionalChainMember) {
              node2.optional = false;
            }
            return this.finishCallExpression(node2, subscriptState.optionalChainMember);
          });
          if (result.node) {
            if (result.error) this.state = result.failState;
            return result.node;
          }
        }
        return super.parseSubscript(base, startLoc, noCalls, subscriptState);
      }
      parseNewCallee(node2) {
        super.parseNewCallee(node2);
        let targs = null;
        if (this.shouldParseTypes() && this.match(47)) {
          targs = this.tryParse(() => this.flowParseTypeParameterInstantiationCallOrNew()).node;
        }
        node2.typeArguments = targs;
      }
      parseAsyncArrowWithTypeParameters(startLoc) {
        const node2 = this.startNodeAt(startLoc);
        this.parseFunctionParams(node2, false);
        if (!this.parseArrow(node2)) return;
        return super.parseArrowExpression(node2, void 0, true);
      }
      readToken_mult_modulo(code2) {
        const next = this.input.charCodeAt(this.state.pos + 1);
        if (code2 === 42 && next === 47 && this.state.hasFlowComment) {
          this.state.hasFlowComment = false;
          this.state.pos += 2;
          this.nextToken();
          return;
        }
        super.readToken_mult_modulo(code2);
      }
      readToken_pipe_amp(code2) {
        const next = this.input.charCodeAt(this.state.pos + 1);
        if (code2 === 124 && next === 125) {
          this.finishOp(9, 2);
          return;
        }
        super.readToken_pipe_amp(code2);
      }
      parseTopLevel(file3, program) {
        const fileNode = super.parseTopLevel(file3, program);
        if (this.state.hasFlowComment) {
          this.raise(FlowErrors.UnterminatedFlowComment, this.state.curPosition());
        }
        return fileNode;
      }
      skipBlockComment() {
        if (this.hasPlugin("flowComments") && this.skipFlowComment()) {
          if (this.state.hasFlowComment) {
            throw this.raise(FlowErrors.NestedFlowComment, this.state.startLoc);
          }
          this.hasFlowCommentCompletion();
          const commentSkip = this.skipFlowComment();
          if (commentSkip) {
            this.state.pos += commentSkip;
            this.state.hasFlowComment = true;
          }
          return;
        }
        return super.skipBlockComment(this.state.hasFlowComment ? "*-/" : "*/");
      }
      skipFlowComment() {
        const {
          pos
        } = this.state;
        let shiftToFirstNonWhiteSpace = 2;
        while ([32, 9].includes(this.input.charCodeAt(pos + shiftToFirstNonWhiteSpace))) {
          shiftToFirstNonWhiteSpace++;
        }
        const ch2 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos);
        const ch3 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos + 1);
        if (ch2 === 58 && ch3 === 58) {
          return shiftToFirstNonWhiteSpace + 2;
        }
        if (this.input.slice(shiftToFirstNonWhiteSpace + pos, shiftToFirstNonWhiteSpace + pos + 12) === "flow-include") {
          return shiftToFirstNonWhiteSpace + 12;
        }
        if (ch2 === 58 && ch3 !== 58) {
          return shiftToFirstNonWhiteSpace;
        }
        return false;
      }
      hasFlowCommentCompletion() {
        const end = this.input.indexOf("*/", this.state.pos);
        if (end === -1) {
          throw this.raise(Errors.UnterminatedComment, this.state.curPosition());
        }
      }
      flowEnumErrorBooleanMemberNotInitialized(loc, {
        enumName,
        memberName
      }) {
        this.raise(FlowErrors.EnumBooleanMemberNotInitialized, loc, {
          memberName,
          enumName
        });
      }
      flowEnumErrorInvalidMemberInitializer(loc, enumContext) {
        return this.raise(!enumContext.explicitType ? FlowErrors.EnumInvalidMemberInitializerUnknownType : enumContext.explicitType === "symbol" ? FlowErrors.EnumInvalidMemberInitializerSymbolType : FlowErrors.EnumInvalidMemberInitializerPrimaryType, loc, enumContext);
      }
      flowEnumErrorNumberMemberNotInitialized(loc, details) {
        this.raise(FlowErrors.EnumNumberMemberNotInitialized, loc, details);
      }
      flowEnumErrorStringMemberInconsistentlyInitialized(node2, details) {
        this.raise(FlowErrors.EnumStringMemberInconsistentlyInitialized, node2, details);
      }
      flowEnumMemberInit() {
        const startLoc = this.state.startLoc;
        const endOfInit = /* @__PURE__ */ __name(() => this.match(12) || this.match(8), "endOfInit");
        switch (this.state.type) {
          case 135: {
            const literal = this.parseNumericLiteral(this.state.value);
            if (endOfInit()) {
              return {
                type: "number",
                loc: literal.loc.start,
                value: literal
              };
            }
            return {
              type: "invalid",
              loc: startLoc
            };
          }
          case 134: {
            const literal = this.parseStringLiteral(this.state.value);
            if (endOfInit()) {
              return {
                type: "string",
                loc: literal.loc.start,
                value: literal
              };
            }
            return {
              type: "invalid",
              loc: startLoc
            };
          }
          case 85:
          case 86: {
            const literal = this.parseBooleanLiteral(this.match(85));
            if (endOfInit()) {
              return {
                type: "boolean",
                loc: literal.loc.start,
                value: literal
              };
            }
            return {
              type: "invalid",
              loc: startLoc
            };
          }
          default:
            return {
              type: "invalid",
              loc: startLoc
            };
        }
      }
      flowEnumMemberRaw() {
        const loc = this.state.startLoc;
        const id = this.parseIdentifier(true);
        const init4 = this.eat(29) ? this.flowEnumMemberInit() : {
          type: "none",
          loc
        };
        return {
          id,
          init: init4
        };
      }
      flowEnumCheckExplicitTypeMismatch(loc, context2, expectedType) {
        const {
          explicitType
        } = context2;
        if (explicitType === null) {
          return;
        }
        if (explicitType !== expectedType) {
          this.flowEnumErrorInvalidMemberInitializer(loc, context2);
        }
      }
      flowEnumMembers({
        enumName,
        explicitType
      }) {
        const seenNames = /* @__PURE__ */ new Set();
        const members = {
          booleanMembers: [],
          numberMembers: [],
          stringMembers: [],
          defaultedMembers: []
        };
        let hasUnknownMembers = false;
        while (!this.match(8)) {
          if (this.eat(21)) {
            hasUnknownMembers = true;
            break;
          }
          const memberNode = this.startNode();
          const {
            id,
            init: init4
          } = this.flowEnumMemberRaw();
          const memberName = id.name;
          if (memberName === "") {
            continue;
          }
          if (/^[a-z]/.test(memberName)) {
            this.raise(FlowErrors.EnumInvalidMemberName, id, {
              memberName,
              suggestion: memberName[0].toUpperCase() + memberName.slice(1),
              enumName
            });
          }
          if (seenNames.has(memberName)) {
            this.raise(FlowErrors.EnumDuplicateMemberName, id, {
              memberName,
              enumName
            });
          }
          seenNames.add(memberName);
          const context2 = {
            enumName,
            explicitType,
            memberName
          };
          memberNode.id = id;
          switch (init4.type) {
            case "boolean": {
              this.flowEnumCheckExplicitTypeMismatch(init4.loc, context2, "boolean");
              memberNode.init = init4.value;
              members.booleanMembers.push(this.finishNode(memberNode, "EnumBooleanMember"));
              break;
            }
            case "number": {
              this.flowEnumCheckExplicitTypeMismatch(init4.loc, context2, "number");
              memberNode.init = init4.value;
              members.numberMembers.push(this.finishNode(memberNode, "EnumNumberMember"));
              break;
            }
            case "string": {
              this.flowEnumCheckExplicitTypeMismatch(init4.loc, context2, "string");
              memberNode.init = init4.value;
              members.stringMembers.push(this.finishNode(memberNode, "EnumStringMember"));
              break;
            }
            case "invalid": {
              throw this.flowEnumErrorInvalidMemberInitializer(init4.loc, context2);
            }
            case "none": {
              switch (explicitType) {
                case "boolean":
                  this.flowEnumErrorBooleanMemberNotInitialized(init4.loc, context2);
                  break;
                case "number":
                  this.flowEnumErrorNumberMemberNotInitialized(init4.loc, context2);
                  break;
                default:
                  members.defaultedMembers.push(this.finishNode(memberNode, "EnumDefaultedMember"));
              }
            }
          }
          if (!this.match(8)) {
            this.expect(12);
          }
        }
        return {
          members,
          hasUnknownMembers
        };
      }
      flowEnumStringMembers(initializedMembers, defaultedMembers, {
        enumName
      }) {
        if (initializedMembers.length === 0) {
          return defaultedMembers;
        } else if (defaultedMembers.length === 0) {
          return initializedMembers;
        } else if (defaultedMembers.length > initializedMembers.length) {
          for (const member of initializedMembers) {
            this.flowEnumErrorStringMemberInconsistentlyInitialized(member, {
              enumName
            });
          }
          return defaultedMembers;
        } else {
          for (const member of defaultedMembers) {
            this.flowEnumErrorStringMemberInconsistentlyInitialized(member, {
              enumName
            });
          }
          return initializedMembers;
        }
      }
      flowEnumParseExplicitType({
        enumName
      }) {
        if (!this.eatContextual(102)) return null;
        if (!tokenIsIdentifier(this.state.type)) {
          throw this.raise(FlowErrors.EnumInvalidExplicitTypeUnknownSupplied, this.state.startLoc, {
            enumName
          });
        }
        const {
          value
        } = this.state;
        this.next();
        if (value !== "boolean" && value !== "number" && value !== "string" && value !== "symbol") {
          this.raise(FlowErrors.EnumInvalidExplicitType, this.state.startLoc, {
            enumName,
            invalidEnumType: value
          });
        }
        return value;
      }
      flowEnumBody(node2, id) {
        const enumName = id.name;
        const nameLoc = id.loc.start;
        const explicitType = this.flowEnumParseExplicitType({
          enumName
        });
        this.expect(5);
        const {
          members,
          hasUnknownMembers
        } = this.flowEnumMembers({
          enumName,
          explicitType
        });
        node2.hasUnknownMembers = hasUnknownMembers;
        switch (explicitType) {
          case "boolean":
            node2.explicitType = true;
            node2.members = members.booleanMembers;
            this.expect(8);
            return this.finishNode(node2, "EnumBooleanBody");
          case "number":
            node2.explicitType = true;
            node2.members = members.numberMembers;
            this.expect(8);
            return this.finishNode(node2, "EnumNumberBody");
          case "string":
            node2.explicitType = true;
            node2.members = this.flowEnumStringMembers(members.stringMembers, members.defaultedMembers, {
              enumName
            });
            this.expect(8);
            return this.finishNode(node2, "EnumStringBody");
          case "symbol":
            node2.members = members.defaultedMembers;
            this.expect(8);
            return this.finishNode(node2, "EnumSymbolBody");
          default: {
            const empty = /* @__PURE__ */ __name(() => {
              node2.members = [];
              this.expect(8);
              return this.finishNode(node2, "EnumStringBody");
            }, "empty");
            node2.explicitType = false;
            const boolsLen = members.booleanMembers.length;
            const numsLen = members.numberMembers.length;
            const strsLen = members.stringMembers.length;
            const defaultedLen = members.defaultedMembers.length;
            if (!boolsLen && !numsLen && !strsLen && !defaultedLen) {
              return empty();
            } else if (!boolsLen && !numsLen) {
              node2.members = this.flowEnumStringMembers(members.stringMembers, members.defaultedMembers, {
                enumName
              });
              this.expect(8);
              return this.finishNode(node2, "EnumStringBody");
            } else if (!numsLen && !strsLen && boolsLen >= defaultedLen) {
              for (const member of members.defaultedMembers) {
                this.flowEnumErrorBooleanMemberNotInitialized(member.loc.start, {
                  enumName,
                  memberName: member.id.name
                });
              }
              node2.members = members.booleanMembers;
              this.expect(8);
              return this.finishNode(node2, "EnumBooleanBody");
            } else if (!boolsLen && !strsLen && numsLen >= defaultedLen) {
              for (const member of members.defaultedMembers) {
                this.flowEnumErrorNumberMemberNotInitialized(member.loc.start, {
                  enumName,
                  memberName: member.id.name
                });
              }
              node2.members = members.numberMembers;
              this.expect(8);
              return this.finishNode(node2, "EnumNumberBody");
            } else {
              this.raise(FlowErrors.EnumInconsistentMemberValues, nameLoc, {
                enumName
              });
              return empty();
            }
          }
        }
      }
      flowParseEnumDeclaration(node2) {
        const id = this.parseIdentifier();
        node2.id = id;
        node2.body = this.flowEnumBody(this.startNode(), id);
        return this.finishNode(node2, "EnumDeclaration");
      }
      isLookaheadToken_lt() {
        const next = this.nextTokenStart();
        if (this.input.charCodeAt(next) === 60) {
          const afterNext = this.input.charCodeAt(next + 1);
          return afterNext !== 60 && afterNext !== 61;
        }
        return false;
      }
      maybeUnwrapTypeCastExpression(node2) {
        return node2.type === "TypeCastExpression" ? node2.expression : node2;
      }
    }, "flow");
    var entities = {
      __proto__: null,
      quot: '"',
      amp: "&",
      apos: "'",
      lt: "<",
      gt: ">",
      nbsp: "\xA0",
      iexcl: "\xA1",
      cent: "\xA2",
      pound: "\xA3",
      curren: "\xA4",
      yen: "\xA5",
      brvbar: "\xA6",
      sect: "\xA7",
      uml: "\xA8",
      copy: "\xA9",
      ordf: "\xAA",
      laquo: "\xAB",
      not: "\xAC",
      shy: "\xAD",
      reg: "\xAE",
      macr: "\xAF",
      deg: "\xB0",
      plusmn: "\xB1",
      sup2: "\xB2",
      sup3: "\xB3",
      acute: "\xB4",
      micro: "\xB5",
      para: "\xB6",
      middot: "\xB7",
      cedil: "\xB8",
      sup1: "\xB9",
      ordm: "\xBA",
      raquo: "\xBB",
      frac14: "\xBC",
      frac12: "\xBD",
      frac34: "\xBE",
      iquest: "\xBF",
      Agrave: "\xC0",
      Aacute: "\xC1",
      Acirc: "\xC2",
      Atilde: "\xC3",
      Auml: "\xC4",
      Aring: "\xC5",
      AElig: "\xC6",
      Ccedil: "\xC7",
      Egrave: "\xC8",
      Eacute: "\xC9",
      Ecirc: "\xCA",
      Euml: "\xCB",
      Igrave: "\xCC",
      Iacute: "\xCD",
      Icirc: "\xCE",
      Iuml: "\xCF",
      ETH: "\xD0",
      Ntilde: "\xD1",
      Ograve: "\xD2",
      Oacute: "\xD3",
      Ocirc: "\xD4",
      Otilde: "\xD5",
      Ouml: "\xD6",
      times: "\xD7",
      Oslash: "\xD8",
      Ugrave: "\xD9",
      Uacute: "\xDA",
      Ucirc: "\xDB",
      Uuml: "\xDC",
      Yacute: "\xDD",
      THORN: "\xDE",
      szlig: "\xDF",
      agrave: "\xE0",
      aacute: "\xE1",
      acirc: "\xE2",
      atilde: "\xE3",
      auml: "\xE4",
      aring: "\xE5",
      aelig: "\xE6",
      ccedil: "\xE7",
      egrave: "\xE8",
      eacute: "\xE9",
      ecirc: "\xEA",
      euml: "\xEB",
      igrave: "\xEC",
      iacute: "\xED",
      icirc: "\xEE",
      iuml: "\xEF",
      eth: "\xF0",
      ntilde: "\xF1",
      ograve: "\xF2",
      oacute: "\xF3",
      ocirc: "\xF4",
      otilde: "\xF5",
      ouml: "\xF6",
      divide: "\xF7",
      oslash: "\xF8",
      ugrave: "\xF9",
      uacute: "\xFA",
      ucirc: "\xFB",
      uuml: "\xFC",
      yacute: "\xFD",
      thorn: "\xFE",
      yuml: "\xFF",
      OElig: "\u0152",
      oelig: "\u0153",
      Scaron: "\u0160",
      scaron: "\u0161",
      Yuml: "\u0178",
      fnof: "\u0192",
      circ: "\u02C6",
      tilde: "\u02DC",
      Alpha: "\u0391",
      Beta: "\u0392",
      Gamma: "\u0393",
      Delta: "\u0394",
      Epsilon: "\u0395",
      Zeta: "\u0396",
      Eta: "\u0397",
      Theta: "\u0398",
      Iota: "\u0399",
      Kappa: "\u039A",
      Lambda: "\u039B",
      Mu: "\u039C",
      Nu: "\u039D",
      Xi: "\u039E",
      Omicron: "\u039F",
      Pi: "\u03A0",
      Rho: "\u03A1",
      Sigma: "\u03A3",
      Tau: "\u03A4",
      Upsilon: "\u03A5",
      Phi: "\u03A6",
      Chi: "\u03A7",
      Psi: "\u03A8",
      Omega: "\u03A9",
      alpha: "\u03B1",
      beta: "\u03B2",
      gamma: "\u03B3",
      delta: "\u03B4",
      epsilon: "\u03B5",
      zeta: "\u03B6",
      eta: "\u03B7",
      theta: "\u03B8",
      iota: "\u03B9",
      kappa: "\u03BA",
      lambda: "\u03BB",
      mu: "\u03BC",
      nu: "\u03BD",
      xi: "\u03BE",
      omicron: "\u03BF",
      pi: "\u03C0",
      rho: "\u03C1",
      sigmaf: "\u03C2",
      sigma: "\u03C3",
      tau: "\u03C4",
      upsilon: "\u03C5",
      phi: "\u03C6",
      chi: "\u03C7",
      psi: "\u03C8",
      omega: "\u03C9",
      thetasym: "\u03D1",
      upsih: "\u03D2",
      piv: "\u03D6",
      ensp: "\u2002",
      emsp: "\u2003",
      thinsp: "\u2009",
      zwnj: "\u200C",
      zwj: "\u200D",
      lrm: "\u200E",
      rlm: "\u200F",
      ndash: "\u2013",
      mdash: "\u2014",
      lsquo: "\u2018",
      rsquo: "\u2019",
      sbquo: "\u201A",
      ldquo: "\u201C",
      rdquo: "\u201D",
      bdquo: "\u201E",
      dagger: "\u2020",
      Dagger: "\u2021",
      bull: "\u2022",
      hellip: "\u2026",
      permil: "\u2030",
      prime: "\u2032",
      Prime: "\u2033",
      lsaquo: "\u2039",
      rsaquo: "\u203A",
      oline: "\u203E",
      frasl: "\u2044",
      euro: "\u20AC",
      image: "\u2111",
      weierp: "\u2118",
      real: "\u211C",
      trade: "\u2122",
      alefsym: "\u2135",
      larr: "\u2190",
      uarr: "\u2191",
      rarr: "\u2192",
      darr: "\u2193",
      harr: "\u2194",
      crarr: "\u21B5",
      lArr: "\u21D0",
      uArr: "\u21D1",
      rArr: "\u21D2",
      dArr: "\u21D3",
      hArr: "\u21D4",
      forall: "\u2200",
      part: "\u2202",
      exist: "\u2203",
      empty: "\u2205",
      nabla: "\u2207",
      isin: "\u2208",
      notin: "\u2209",
      ni: "\u220B",
      prod: "\u220F",
      sum: "\u2211",
      minus: "\u2212",
      lowast: "\u2217",
      radic: "\u221A",
      prop: "\u221D",
      infin: "\u221E",
      ang: "\u2220",
      and: "\u2227",
      or: "\u2228",
      cap: "\u2229",
      cup: "\u222A",
      int: "\u222B",
      there4: "\u2234",
      sim: "\u223C",
      cong: "\u2245",
      asymp: "\u2248",
      ne: "\u2260",
      equiv: "\u2261",
      le: "\u2264",
      ge: "\u2265",
      sub: "\u2282",
      sup: "\u2283",
      nsub: "\u2284",
      sube: "\u2286",
      supe: "\u2287",
      oplus: "\u2295",
      otimes: "\u2297",
      perp: "\u22A5",
      sdot: "\u22C5",
      lceil: "\u2308",
      rceil: "\u2309",
      lfloor: "\u230A",
      rfloor: "\u230B",
      lang: "\u2329",
      rang: "\u232A",
      loz: "\u25CA",
      spades: "\u2660",
      clubs: "\u2663",
      hearts: "\u2665",
      diams: "\u2666"
    };
    var JsxErrors = ParseErrorEnum`jsx`({
      AttributeIsEmpty: "JSX attributes must only be assigned a non-empty expression.",
      MissingClosingTagElement: /* @__PURE__ */ __name(({
        openingTagName
      }) => `Expected corresponding JSX closing tag for <${openingTagName}>.`, "MissingClosingTagElement"),
      MissingClosingTagFragment: "Expected corresponding JSX closing tag for <>.",
      UnexpectedSequenceExpression: "Sequence expressions cannot be directly nested inside JSX. Did you mean to wrap it in parentheses (...)?",
      UnexpectedToken: /* @__PURE__ */ __name(({
        unexpected,
        HTMLEntity
      }) => `Unexpected token \`${unexpected}\`. Did you mean \`${HTMLEntity}\` or \`{'${unexpected}'}\`?`, "UnexpectedToken"),
      UnsupportedJsxValue: "JSX value should be either an expression or a quoted JSX text.",
      UnterminatedJsxContent: "Unterminated JSX contents.",
      UnwrappedAdjacentJSXElements: "Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...</>?"
    });
    function isFragment(object) {
      return object ? object.type === "JSXOpeningFragment" || object.type === "JSXClosingFragment" : false;
    }
    __name(isFragment, "isFragment");
    function getQualifiedJSXName(object) {
      if (object.type === "JSXIdentifier") {
        return object.name;
      }
      if (object.type === "JSXNamespacedName") {
        return object.namespace.name + ":" + object.name.name;
      }
      if (object.type === "JSXMemberExpression") {
        return getQualifiedJSXName(object.object) + "." + getQualifiedJSXName(object.property);
      }
      throw new Error("Node had unexpected type: " + object.type);
    }
    __name(getQualifiedJSXName, "getQualifiedJSXName");
    var jsx = /* @__PURE__ */ __name((superClass) => class JSXParserMixin extends superClass {
      static {
        __name(this, "JSXParserMixin");
      }
      jsxReadToken() {
        let out = "";
        let chunkStart = this.state.pos;
        for (; ; ) {
          if (this.state.pos >= this.length) {
            throw this.raise(JsxErrors.UnterminatedJsxContent, this.state.startLoc);
          }
          const ch2 = this.input.charCodeAt(this.state.pos);
          switch (ch2) {
            case 60:
            case 123:
              if (this.state.pos === this.state.start) {
                if (ch2 === 60 && this.state.canStartJSXElement) {
                  ++this.state.pos;
                  this.finishToken(143);
                } else {
                  super.getTokenFromCode(ch2);
                }
                return;
              }
              out += this.input.slice(chunkStart, this.state.pos);
              this.finishToken(142, out);
              return;
            case 38:
              out += this.input.slice(chunkStart, this.state.pos);
              out += this.jsxReadEntity();
              chunkStart = this.state.pos;
              break;
            case 62:
            case 125:
            default:
              if (isNewLine(ch2)) {
                out += this.input.slice(chunkStart, this.state.pos);
                out += this.jsxReadNewLine(true);
                chunkStart = this.state.pos;
              } else {
                ++this.state.pos;
              }
          }
        }
      }
      jsxReadNewLine(normalizeCRLF) {
        const ch2 = this.input.charCodeAt(this.state.pos);
        let out;
        ++this.state.pos;
        if (ch2 === 13 && this.input.charCodeAt(this.state.pos) === 10) {
          ++this.state.pos;
          out = normalizeCRLF ? "\n" : "\r\n";
        } else {
          out = String.fromCharCode(ch2);
        }
        ++this.state.curLine;
        this.state.lineStart = this.state.pos;
        return out;
      }
      jsxReadString(quote2) {
        let out = "";
        let chunkStart = ++this.state.pos;
        for (; ; ) {
          if (this.state.pos >= this.length) {
            throw this.raise(Errors.UnterminatedString, this.state.startLoc);
          }
          const ch2 = this.input.charCodeAt(this.state.pos);
          if (ch2 === quote2) break;
          if (ch2 === 38) {
            out += this.input.slice(chunkStart, this.state.pos);
            out += this.jsxReadEntity();
            chunkStart = this.state.pos;
          } else if (isNewLine(ch2)) {
            out += this.input.slice(chunkStart, this.state.pos);
            out += this.jsxReadNewLine(false);
            chunkStart = this.state.pos;
          } else {
            ++this.state.pos;
          }
        }
        out += this.input.slice(chunkStart, this.state.pos++);
        this.finishToken(134, out);
      }
      jsxReadEntity() {
        const startPos = ++this.state.pos;
        if (this.codePointAtPos(this.state.pos) === 35) {
          ++this.state.pos;
          let radix = 10;
          if (this.codePointAtPos(this.state.pos) === 120) {
            radix = 16;
            ++this.state.pos;
          }
          const codePoint = this.readInt(radix, void 0, false, "bail");
          if (codePoint !== null && this.codePointAtPos(this.state.pos) === 59) {
            ++this.state.pos;
            return String.fromCodePoint(codePoint);
          }
        } else {
          let count = 0;
          let semi = false;
          while (count++ < 10 && this.state.pos < this.length && !(semi = this.codePointAtPos(this.state.pos) === 59)) {
            ++this.state.pos;
          }
          if (semi) {
            const desc = this.input.slice(startPos, this.state.pos);
            const entity = entities[desc];
            ++this.state.pos;
            if (entity) {
              return entity;
            }
          }
        }
        this.state.pos = startPos;
        return "&";
      }
      jsxReadWord() {
        let ch2;
        const start = this.state.pos;
        do {
          ch2 = this.input.charCodeAt(++this.state.pos);
        } while (isIdentifierChar(ch2) || ch2 === 45);
        this.finishToken(141, this.input.slice(start, this.state.pos));
      }
      jsxParseIdentifier() {
        const node2 = this.startNode();
        if (this.match(141)) {
          node2.name = this.state.value;
        } else if (tokenIsKeyword(this.state.type)) {
          node2.name = tokenLabelName(this.state.type);
        } else {
          this.unexpected();
        }
        this.next();
        return this.finishNode(node2, "JSXIdentifier");
      }
      jsxParseNamespacedName() {
        const startLoc = this.state.startLoc;
        const name2 = this.jsxParseIdentifier();
        if (!this.eat(14)) return name2;
        const node2 = this.startNodeAt(startLoc);
        node2.namespace = name2;
        node2.name = this.jsxParseIdentifier();
        return this.finishNode(node2, "JSXNamespacedName");
      }
      jsxParseElementName() {
        const startLoc = this.state.startLoc;
        let node2 = this.jsxParseNamespacedName();
        if (node2.type === "JSXNamespacedName") {
          return node2;
        }
        while (this.eat(16)) {
          const newNode = this.startNodeAt(startLoc);
          newNode.object = node2;
          newNode.property = this.jsxParseIdentifier();
          node2 = this.finishNode(newNode, "JSXMemberExpression");
        }
        return node2;
      }
      jsxParseAttributeValue() {
        let node2;
        switch (this.state.type) {
          case 5:
            node2 = this.startNode();
            this.setContext(types13.brace);
            this.next();
            node2 = this.jsxParseExpressionContainer(node2, types13.j_oTag);
            if (node2.expression.type === "JSXEmptyExpression") {
              this.raise(JsxErrors.AttributeIsEmpty, node2);
            }
            return node2;
          case 143:
          case 134:
            return this.parseExprAtom();
          default:
            throw this.raise(JsxErrors.UnsupportedJsxValue, this.state.startLoc);
        }
      }
      jsxParseEmptyExpression() {
        const node2 = this.startNodeAt(this.state.lastTokEndLoc);
        return this.finishNodeAt(node2, "JSXEmptyExpression", this.state.startLoc);
      }
      jsxParseSpreadChild(node2) {
        this.next();
        node2.expression = this.parseExpression();
        this.setContext(types13.j_expr);
        this.state.canStartJSXElement = true;
        this.expect(8);
        return this.finishNode(node2, "JSXSpreadChild");
      }
      jsxParseExpressionContainer(node2, previousContext) {
        if (this.match(8)) {
          node2.expression = this.jsxParseEmptyExpression();
        } else {
          const expression = this.parseExpression();
          node2.expression = expression;
        }
        this.setContext(previousContext);
        this.state.canStartJSXElement = true;
        this.expect(8);
        return this.finishNode(node2, "JSXExpressionContainer");
      }
      jsxParseAttribute() {
        const node2 = this.startNode();
        if (this.match(5)) {
          this.setContext(types13.brace);
          this.next();
          this.expect(21);
          node2.argument = this.parseMaybeAssignAllowIn();
          this.setContext(types13.j_oTag);
          this.state.canStartJSXElement = true;
          this.expect(8);
          return this.finishNode(node2, "JSXSpreadAttribute");
        }
        node2.name = this.jsxParseNamespacedName();
        node2.value = this.eat(29) ? this.jsxParseAttributeValue() : null;
        return this.finishNode(node2, "JSXAttribute");
      }
      jsxParseOpeningElementAt(startLoc) {
        const node2 = this.startNodeAt(startLoc);
        if (this.eat(144)) {
          return this.finishNode(node2, "JSXOpeningFragment");
        }
        node2.name = this.jsxParseElementName();
        return this.jsxParseOpeningElementAfterName(node2);
      }
      jsxParseOpeningElementAfterName(node2) {
        const attributes = [];
        while (!this.match(56) && !this.match(144)) {
          attributes.push(this.jsxParseAttribute());
        }
        node2.attributes = attributes;
        node2.selfClosing = this.eat(56);
        this.expect(144);
        return this.finishNode(node2, "JSXOpeningElement");
      }
      jsxParseClosingElementAt(startLoc) {
        const node2 = this.startNodeAt(startLoc);
        if (this.eat(144)) {
          return this.finishNode(node2, "JSXClosingFragment");
        }
        node2.name = this.jsxParseElementName();
        this.expect(144);
        return this.finishNode(node2, "JSXClosingElement");
      }
      jsxParseElementAt(startLoc) {
        const node2 = this.startNodeAt(startLoc);
        const children = [];
        const openingElement = this.jsxParseOpeningElementAt(startLoc);
        let closingElement = null;
        if (!openingElement.selfClosing) {
          contents: for (; ; ) {
            switch (this.state.type) {
              case 143:
                startLoc = this.state.startLoc;
                this.next();
                if (this.eat(56)) {
                  closingElement = this.jsxParseClosingElementAt(startLoc);
                  break contents;
                }
                children.push(this.jsxParseElementAt(startLoc));
                break;
              case 142:
                children.push(this.parseLiteral(this.state.value, "JSXText"));
                break;
              case 5: {
                const node3 = this.startNode();
                this.setContext(types13.brace);
                this.next();
                if (this.match(21)) {
                  children.push(this.jsxParseSpreadChild(node3));
                } else {
                  children.push(this.jsxParseExpressionContainer(node3, types13.j_expr));
                }
                break;
              }
              default:
                this.unexpected();
            }
          }
          if (isFragment(openingElement) && !isFragment(closingElement) && closingElement !== null) {
            this.raise(JsxErrors.MissingClosingTagFragment, closingElement);
          } else if (!isFragment(openingElement) && isFragment(closingElement)) {
            this.raise(JsxErrors.MissingClosingTagElement, closingElement, {
              openingTagName: getQualifiedJSXName(openingElement.name)
            });
          } else if (!isFragment(openingElement) && !isFragment(closingElement)) {
            if (getQualifiedJSXName(closingElement.name) !== getQualifiedJSXName(openingElement.name)) {
              this.raise(JsxErrors.MissingClosingTagElement, closingElement, {
                openingTagName: getQualifiedJSXName(openingElement.name)
              });
            }
          }
        }
        if (isFragment(openingElement)) {
          node2.openingFragment = openingElement;
          node2.closingFragment = closingElement;
        } else {
          node2.openingElement = openingElement;
          node2.closingElement = closingElement;
        }
        node2.children = children;
        if (this.match(47)) {
          throw this.raise(JsxErrors.UnwrappedAdjacentJSXElements, this.state.startLoc);
        }
        return isFragment(openingElement) ? this.finishNode(node2, "JSXFragment") : this.finishNode(node2, "JSXElement");
      }
      jsxParseElement() {
        const startLoc = this.state.startLoc;
        this.next();
        return this.jsxParseElementAt(startLoc);
      }
      setContext(newContext) {
        const {
          context: context2
        } = this.state;
        context2[context2.length - 1] = newContext;
      }
      parseExprAtom(refExpressionErrors) {
        if (this.match(143)) {
          return this.jsxParseElement();
        } else if (this.match(47) && this.input.charCodeAt(this.state.pos) !== 33) {
          this.replaceToken(143);
          return this.jsxParseElement();
        } else {
          return super.parseExprAtom(refExpressionErrors);
        }
      }
      skipSpace() {
        const curContext = this.curContext();
        if (!curContext.preserveSpace) super.skipSpace();
      }
      getTokenFromCode(code2) {
        const context2 = this.curContext();
        if (context2 === types13.j_expr) {
          this.jsxReadToken();
          return;
        }
        if (context2 === types13.j_oTag || context2 === types13.j_cTag) {
          if (isIdentifierStart(code2)) {
            this.jsxReadWord();
            return;
          }
          if (code2 === 62) {
            ++this.state.pos;
            this.finishToken(144);
            return;
          }
          if ((code2 === 34 || code2 === 39) && context2 === types13.j_oTag) {
            this.jsxReadString(code2);
            return;
          }
        }
        if (code2 === 60 && this.state.canStartJSXElement && this.input.charCodeAt(this.state.pos + 1) !== 33) {
          ++this.state.pos;
          this.finishToken(143);
          return;
        }
        super.getTokenFromCode(code2);
      }
      updateContext(prevType) {
        const {
          context: context2,
          type
        } = this.state;
        if (type === 56 && prevType === 143) {
          context2.splice(-2, 2, types13.j_cTag);
          this.state.canStartJSXElement = false;
        } else if (type === 143) {
          context2.push(types13.j_oTag);
        } else if (type === 144) {
          const out = context2[context2.length - 1];
          if (out === types13.j_oTag && prevType === 56 || out === types13.j_cTag) {
            context2.pop();
            this.state.canStartJSXElement = context2[context2.length - 1] === types13.j_expr;
          } else {
            this.setContext(types13.j_expr);
            this.state.canStartJSXElement = true;
          }
        } else {
          this.state.canStartJSXElement = tokenComesBeforeExpression(type);
        }
      }
    }, "jsx");
    var TypeScriptScope = class extends Scope2 {
      static {
        __name(this, "TypeScriptScope");
      }
      constructor(...args) {
        super(...args);
        this.tsNames = /* @__PURE__ */ new Map();
      }
    };
    var TypeScriptScopeHandler = class extends ScopeHandler {
      static {
        __name(this, "TypeScriptScopeHandler");
      }
      constructor(...args) {
        super(...args);
        this.importsStack = [];
      }
      createScope(flags2) {
        this.importsStack.push(/* @__PURE__ */ new Set());
        return new TypeScriptScope(flags2);
      }
      enter(flags2) {
        if (flags2 === 256) {
          this.importsStack.push(/* @__PURE__ */ new Set());
        }
        super.enter(flags2);
      }
      exit() {
        const flags2 = super.exit();
        if (flags2 === 256) {
          this.importsStack.pop();
        }
        return flags2;
      }
      hasImport(name2, allowShadow) {
        const len = this.importsStack.length;
        if (this.importsStack[len - 1].has(name2)) {
          return true;
        }
        if (!allowShadow && len > 1) {
          for (let i7 = 0; i7 < len - 1; i7++) {
            if (this.importsStack[i7].has(name2)) return true;
          }
        }
        return false;
      }
      declareName(name2, bindingType, loc) {
        if (bindingType & 4096) {
          if (this.hasImport(name2, true)) {
            this.parser.raise(Errors.VarRedeclaration, loc, {
              identifierName: name2
            });
          }
          this.importsStack[this.importsStack.length - 1].add(name2);
          return;
        }
        const scope = this.currentScope();
        let type = scope.tsNames.get(name2) || 0;
        if (bindingType & 1024) {
          this.maybeExportDefined(scope, name2);
          scope.tsNames.set(name2, type | 16);
          return;
        }
        super.declareName(name2, bindingType, loc);
        if (bindingType & 2) {
          if (!(bindingType & 1)) {
            this.checkRedeclarationInScope(scope, name2, bindingType, loc);
            this.maybeExportDefined(scope, name2);
          }
          type = type | 1;
        }
        if (bindingType & 256) {
          type = type | 2;
        }
        if (bindingType & 512) {
          type = type | 4;
        }
        if (bindingType & 128) {
          type = type | 8;
        }
        if (type) scope.tsNames.set(name2, type);
      }
      isRedeclaredInScope(scope, name2, bindingType) {
        const type = scope.tsNames.get(name2);
        if ((type & 2) > 0) {
          if (bindingType & 256) {
            const isConst = !!(bindingType & 512);
            const wasConst = (type & 4) > 0;
            return isConst !== wasConst;
          }
          return true;
        }
        if (bindingType & 128 && (type & 8) > 0) {
          if (scope.names.get(name2) & 2) {
            return !!(bindingType & 1);
          } else {
            return false;
          }
        }
        if (bindingType & 2 && (type & 1) > 0) {
          return true;
        }
        return super.isRedeclaredInScope(scope, name2, bindingType);
      }
      checkLocalExport(id) {
        const {
          name: name2
        } = id;
        if (this.hasImport(name2)) return;
        const len = this.scopeStack.length;
        for (let i7 = len - 1; i7 >= 0; i7--) {
          const scope = this.scopeStack[i7];
          const type = scope.tsNames.get(name2);
          if ((type & 1) > 0 || (type & 16) > 0) {
            return;
          }
        }
        super.checkLocalExport(id);
      }
    };
    var unwrapParenthesizedExpression = /* @__PURE__ */ __name((node2) => {
      return node2.type === "ParenthesizedExpression" ? unwrapParenthesizedExpression(node2.expression) : node2;
    }, "unwrapParenthesizedExpression");
    var LValParser = class extends NodeUtils {
      static {
        __name(this, "LValParser");
      }
      toAssignable(node2, isLHS = false) {
        var _node$extra, _node$extra3;
        let parenthesized = void 0;
        if (node2.type === "ParenthesizedExpression" || (_node$extra = node2.extra) != null && _node$extra.parenthesized) {
          parenthesized = unwrapParenthesizedExpression(node2);
          if (isLHS) {
            if (parenthesized.type === "Identifier") {
              this.expressionScope.recordArrowParameterBindingError(Errors.InvalidParenthesizedAssignment, node2);
            } else if (parenthesized.type !== "MemberExpression" && !this.isOptionalMemberExpression(parenthesized)) {
              this.raise(Errors.InvalidParenthesizedAssignment, node2);
            }
          } else {
            this.raise(Errors.InvalidParenthesizedAssignment, node2);
          }
        }
        switch (node2.type) {
          case "Identifier":
          case "ObjectPattern":
          case "ArrayPattern":
          case "AssignmentPattern":
          case "RestElement":
            break;
          case "ObjectExpression":
            node2.type = "ObjectPattern";
            for (let i7 = 0, length = node2.properties.length, last = length - 1; i7 < length; i7++) {
              var _node$extra2;
              const prop = node2.properties[i7];
              const isLast = i7 === last;
              this.toAssignableObjectExpressionProp(prop, isLast, isLHS);
              if (isLast && prop.type === "RestElement" && (_node$extra2 = node2.extra) != null && _node$extra2.trailingCommaLoc) {
                this.raise(Errors.RestTrailingComma, node2.extra.trailingCommaLoc);
              }
            }
            break;
          case "ObjectProperty": {
            const {
              key,
              value
            } = node2;
            if (this.isPrivateName(key)) {
              this.classScope.usePrivateName(this.getPrivateNameSV(key), key.loc.start);
            }
            this.toAssignable(value, isLHS);
            break;
          }
          case "SpreadElement": {
            throw new Error("Internal @babel/parser error (this is a bug, please report it). SpreadElement should be converted by .toAssignable's caller.");
          }
          case "ArrayExpression":
            node2.type = "ArrayPattern";
            this.toAssignableList(node2.elements, (_node$extra3 = node2.extra) == null ? void 0 : _node$extra3.trailingCommaLoc, isLHS);
            break;
          case "AssignmentExpression":
            if (node2.operator !== "=") {
              this.raise(Errors.MissingEqInAssignment, node2.left.loc.end);
            }
            node2.type = "AssignmentPattern";
            delete node2.operator;
            this.toAssignable(node2.left, isLHS);
            break;
          case "ParenthesizedExpression":
            this.toAssignable(parenthesized, isLHS);
            break;
        }
      }
      toAssignableObjectExpressionProp(prop, isLast, isLHS) {
        if (prop.type === "ObjectMethod") {
          this.raise(prop.kind === "get" || prop.kind === "set" ? Errors.PatternHasAccessor : Errors.PatternHasMethod, prop.key);
        } else if (prop.type === "SpreadElement") {
          prop.type = "RestElement";
          const arg = prop.argument;
          this.checkToRestConversion(arg, false);
          this.toAssignable(arg, isLHS);
          if (!isLast) {
            this.raise(Errors.RestTrailingComma, prop);
          }
        } else {
          this.toAssignable(prop, isLHS);
        }
      }
      toAssignableList(exprList, trailingCommaLoc, isLHS) {
        const end = exprList.length - 1;
        for (let i7 = 0; i7 <= end; i7++) {
          const elt = exprList[i7];
          if (!elt) continue;
          if (elt.type === "SpreadElement") {
            elt.type = "RestElement";
            const arg = elt.argument;
            this.checkToRestConversion(arg, true);
            this.toAssignable(arg, isLHS);
          } else {
            this.toAssignable(elt, isLHS);
          }
          if (elt.type === "RestElement") {
            if (i7 < end) {
              this.raise(Errors.RestTrailingComma, elt);
            } else if (trailingCommaLoc) {
              this.raise(Errors.RestTrailingComma, trailingCommaLoc);
            }
          }
        }
      }
      isAssignable(node2, isBinding) {
        switch (node2.type) {
          case "Identifier":
          case "ObjectPattern":
          case "ArrayPattern":
          case "AssignmentPattern":
          case "RestElement":
            return true;
          case "ObjectExpression": {
            const last = node2.properties.length - 1;
            return node2.properties.every((prop, i7) => {
              return prop.type !== "ObjectMethod" && (i7 === last || prop.type !== "SpreadElement") && this.isAssignable(prop);
            });
          }
          case "ObjectProperty":
            return this.isAssignable(node2.value);
          case "SpreadElement":
            return this.isAssignable(node2.argument);
          case "ArrayExpression":
            return node2.elements.every((element) => element === null || this.isAssignable(element));
          case "AssignmentExpression":
            return node2.operator === "=";
          case "ParenthesizedExpression":
            return this.isAssignable(node2.expression);
          case "MemberExpression":
          case "OptionalMemberExpression":
            return !isBinding;
          default:
            return false;
        }
      }
      toReferencedList(exprList, isParenthesizedExpr) {
        return exprList;
      }
      toReferencedListDeep(exprList, isParenthesizedExpr) {
        this.toReferencedList(exprList, isParenthesizedExpr);
        for (const expr of exprList) {
          if ((expr == null ? void 0 : expr.type) === "ArrayExpression") {
            this.toReferencedListDeep(expr.elements);
          }
        }
      }
      parseSpread(refExpressionErrors) {
        const node2 = this.startNode();
        this.next();
        node2.argument = this.parseMaybeAssignAllowIn(refExpressionErrors, void 0);
        return this.finishNode(node2, "SpreadElement");
      }
      parseRestBinding() {
        const node2 = this.startNode();
        this.next();
        node2.argument = this.parseBindingAtom();
        return this.finishNode(node2, "RestElement");
      }
      parseBindingAtom() {
        switch (this.state.type) {
          case 0: {
            const node2 = this.startNode();
            this.next();
            node2.elements = this.parseBindingList(3, 93, 1);
            return this.finishNode(node2, "ArrayPattern");
          }
          case 5:
            return this.parseObjectLike(8, true);
        }
        return this.parseIdentifier();
      }
      parseBindingList(close2, closeCharCode, flags2) {
        const allowEmpty = flags2 & 1;
        const elts = [];
        let first = true;
        while (!this.eat(close2)) {
          if (first) {
            first = false;
          } else {
            this.expect(12);
          }
          if (allowEmpty && this.match(12)) {
            elts.push(null);
          } else if (this.eat(close2)) {
            break;
          } else if (this.match(21)) {
            let rest = this.parseRestBinding();
            if (this.hasPlugin("flow") || flags2 & 2) {
              rest = this.parseFunctionParamType(rest);
            }
            elts.push(rest);
            if (!this.checkCommaAfterRest(closeCharCode)) {
              this.expect(close2);
              break;
            }
          } else {
            const decorators = [];
            if (this.match(26) && this.hasPlugin("decorators")) {
              this.raise(Errors.UnsupportedParameterDecorator, this.state.startLoc);
            }
            while (this.match(26)) {
              decorators.push(this.parseDecorator());
            }
            elts.push(this.parseAssignableListItem(flags2, decorators));
          }
        }
        return elts;
      }
      parseBindingRestProperty(prop) {
        this.next();
        prop.argument = this.parseIdentifier();
        this.checkCommaAfterRest(125);
        return this.finishNode(prop, "RestElement");
      }
      parseBindingProperty() {
        const {
          type,
          startLoc
        } = this.state;
        if (type === 21) {
          return this.parseBindingRestProperty(this.startNode());
        }
        const prop = this.startNode();
        if (type === 139) {
          this.expectPlugin("destructuringPrivate", startLoc);
          this.classScope.usePrivateName(this.state.value, startLoc);
          prop.key = this.parsePrivateName();
        } else {
          this.parsePropertyName(prop);
        }
        prop.method = false;
        return this.parseObjPropValue(prop, startLoc, false, false, true, false);
      }
      parseAssignableListItem(flags2, decorators) {
        const left2 = this.parseMaybeDefault();
        if (this.hasPlugin("flow") || flags2 & 2) {
          this.parseFunctionParamType(left2);
        }
        const elt = this.parseMaybeDefault(left2.loc.start, left2);
        if (decorators.length) {
          left2.decorators = decorators;
        }
        return elt;
      }
      parseFunctionParamType(param) {
        return param;
      }
      parseMaybeDefault(startLoc, left2) {
        var _startLoc, _left;
        (_startLoc = startLoc) != null ? _startLoc : startLoc = this.state.startLoc;
        left2 = (_left = left2) != null ? _left : this.parseBindingAtom();
        if (!this.eat(29)) return left2;
        const node2 = this.startNodeAt(startLoc);
        node2.left = left2;
        node2.right = this.parseMaybeAssignAllowIn();
        return this.finishNode(node2, "AssignmentPattern");
      }
      isValidLVal(type, isUnparenthesizedInAssign, binding) {
        switch (type) {
          case "AssignmentPattern":
            return "left";
          case "RestElement":
            return "argument";
          case "ObjectProperty":
            return "value";
          case "ParenthesizedExpression":
            return "expression";
          case "ArrayPattern":
            return "elements";
          case "ObjectPattern":
            return "properties";
        }
        return false;
      }
      isOptionalMemberExpression(expression) {
        return expression.type === "OptionalMemberExpression";
      }
      checkLVal(expression, ancestor, binding = 64, checkClashes = false, strictModeChanged = false, hasParenthesizedAncestor = false) {
        var _expression$extra;
        const type = expression.type;
        if (this.isObjectMethod(expression)) return;
        const isOptionalMemberExpression = this.isOptionalMemberExpression(expression);
        if (isOptionalMemberExpression || type === "MemberExpression") {
          if (isOptionalMemberExpression) {
            this.expectPlugin("optionalChainingAssign", expression.loc.start);
            if (ancestor.type !== "AssignmentExpression") {
              this.raise(Errors.InvalidLhsOptionalChaining, expression, {
                ancestor
              });
            }
          }
          if (binding !== 64) {
            this.raise(Errors.InvalidPropertyBindingPattern, expression);
          }
          return;
        }
        if (type === "Identifier") {
          this.checkIdentifier(expression, binding, strictModeChanged);
          const {
            name: name2
          } = expression;
          if (checkClashes) {
            if (checkClashes.has(name2)) {
              this.raise(Errors.ParamDupe, expression);
            } else {
              checkClashes.add(name2);
            }
          }
          return;
        }
        const validity = this.isValidLVal(type, !(hasParenthesizedAncestor || (_expression$extra = expression.extra) != null && _expression$extra.parenthesized) && ancestor.type === "AssignmentExpression", binding);
        if (validity === true) return;
        if (validity === false) {
          const ParseErrorClass = binding === 64 ? Errors.InvalidLhs : Errors.InvalidLhsBinding;
          this.raise(ParseErrorClass, expression, {
            ancestor
          });
          return;
        }
        let key, isParenthesizedExpression;
        if (typeof validity === "string") {
          key = validity;
          isParenthesizedExpression = type === "ParenthesizedExpression";
        } else {
          [key, isParenthesizedExpression] = validity;
        }
        const nextAncestor = type === "ArrayPattern" || type === "ObjectPattern" ? {
          type
        } : ancestor;
        const val2 = expression[key];
        if (Array.isArray(val2)) {
          for (const child of val2) {
            if (child) {
              this.checkLVal(child, nextAncestor, binding, checkClashes, strictModeChanged, isParenthesizedExpression);
            }
          }
        } else if (val2) {
          this.checkLVal(val2, nextAncestor, binding, checkClashes, strictModeChanged, isParenthesizedExpression);
        }
      }
      checkIdentifier(at3, bindingType, strictModeChanged = false) {
        if (this.state.strict && (strictModeChanged ? isStrictBindReservedWord(at3.name, this.inModule) : isStrictBindOnlyReservedWord(at3.name))) {
          if (bindingType === 64) {
            this.raise(Errors.StrictEvalArguments, at3, {
              referenceName: at3.name
            });
          } else {
            this.raise(Errors.StrictEvalArgumentsBinding, at3, {
              bindingName: at3.name
            });
          }
        }
        if (bindingType & 8192 && at3.name === "let") {
          this.raise(Errors.LetInLexicalBinding, at3);
        }
        if (!(bindingType & 64)) {
          this.declareNameFromIdentifier(at3, bindingType);
        }
      }
      declareNameFromIdentifier(identifier, binding) {
        this.scope.declareName(identifier.name, binding, identifier.loc.start);
      }
      checkToRestConversion(node2, allowPattern) {
        switch (node2.type) {
          case "ParenthesizedExpression":
            this.checkToRestConversion(node2.expression, allowPattern);
            break;
          case "Identifier":
          case "MemberExpression":
            break;
          case "ArrayExpression":
          case "ObjectExpression":
            if (allowPattern) break;
          default:
            this.raise(Errors.InvalidRestAssignmentPattern, node2);
        }
      }
      checkCommaAfterRest(close2) {
        if (!this.match(12)) {
          return false;
        }
        this.raise(this.lookaheadCharCode() === close2 ? Errors.RestTrailingComma : Errors.ElementAfterRest, this.state.startLoc);
        return true;
      }
    };
    function nonNull(x7) {
      if (x7 == null) {
        throw new Error(`Unexpected ${x7} value.`);
      }
      return x7;
    }
    __name(nonNull, "nonNull");
    function assert61(x7) {
      if (!x7) {
        throw new Error("Assert fail");
      }
    }
    __name(assert61, "assert");
    var TSErrors = ParseErrorEnum`typescript`({
      AbstractMethodHasImplementation: /* @__PURE__ */ __name(({
        methodName
      }) => `Method '${methodName}' cannot have an implementation because it is marked abstract.`, "AbstractMethodHasImplementation"),
      AbstractPropertyHasInitializer: /* @__PURE__ */ __name(({
        propertyName
      }) => `Property '${propertyName}' cannot have an initializer because it is marked abstract.`, "AbstractPropertyHasInitializer"),
      AccessorCannotBeOptional: "An 'accessor' property cannot be declared optional.",
      AccessorCannotDeclareThisParameter: "'get' and 'set' accessors cannot declare 'this' parameters.",
      AccessorCannotHaveTypeParameters: "An accessor cannot have type parameters.",
      ClassMethodHasDeclare: "Class methods cannot have the 'declare' modifier.",
      ClassMethodHasReadonly: "Class methods cannot have the 'readonly' modifier.",
      ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference: "A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.",
      ConstructorHasTypeParameters: "Type parameters cannot appear on a constructor declaration.",
      DeclareAccessor: /* @__PURE__ */ __name(({
        kind: kind2
      }) => `'declare' is not allowed in ${kind2}ters.`, "DeclareAccessor"),
      DeclareClassFieldHasInitializer: "Initializers are not allowed in ambient contexts.",
      DeclareFunctionHasImplementation: "An implementation cannot be declared in ambient contexts.",
      DuplicateAccessibilityModifier: /* @__PURE__ */ __name(({
        modifier
      }) => `Accessibility modifier already seen.`, "DuplicateAccessibilityModifier"),
      DuplicateModifier: /* @__PURE__ */ __name(({
        modifier
      }) => `Duplicate modifier: '${modifier}'.`, "DuplicateModifier"),
      EmptyHeritageClauseType: /* @__PURE__ */ __name(({
        token
      }) => `'${token}' list cannot be empty.`, "EmptyHeritageClauseType"),
      EmptyTypeArguments: "Type argument list cannot be empty.",
      EmptyTypeParameters: "Type parameter list cannot be empty.",
      ExpectedAmbientAfterExportDeclare: "'export declare' must be followed by an ambient declaration.",
      ImportAliasHasImportType: "An import alias can not use 'import type'.",
      ImportReflectionHasImportType: "An `import module` declaration can not use `type` modifier",
      IncompatibleModifiers: /* @__PURE__ */ __name(({
        modifiers
      }) => `'${modifiers[0]}' modifier cannot be used with '${modifiers[1]}' modifier.`, "IncompatibleModifiers"),
      IndexSignatureHasAbstract: "Index signatures cannot have the 'abstract' modifier.",
      IndexSignatureHasAccessibility: /* @__PURE__ */ __name(({
        modifier
      }) => `Index signatures cannot have an accessibility modifier ('${modifier}').`, "IndexSignatureHasAccessibility"),
      IndexSignatureHasDeclare: "Index signatures cannot have the 'declare' modifier.",
      IndexSignatureHasOverride: "'override' modifier cannot appear on an index signature.",
      IndexSignatureHasStatic: "Index signatures cannot have the 'static' modifier.",
      InitializerNotAllowedInAmbientContext: "Initializers are not allowed in ambient contexts.",
      InvalidModifierOnTypeMember: /* @__PURE__ */ __name(({
        modifier
      }) => `'${modifier}' modifier cannot appear on a type member.`, "InvalidModifierOnTypeMember"),
      InvalidModifierOnTypeParameter: /* @__PURE__ */ __name(({
        modifier
      }) => `'${modifier}' modifier cannot appear on a type parameter.`, "InvalidModifierOnTypeParameter"),
      InvalidModifierOnTypeParameterPositions: /* @__PURE__ */ __name(({
        modifier
      }) => `'${modifier}' modifier can only appear on a type parameter of a class, interface or type alias.`, "InvalidModifierOnTypeParameterPositions"),
      InvalidModifiersOrder: /* @__PURE__ */ __name(({
        orderedModifiers
      }) => `'${orderedModifiers[0]}' modifier must precede '${orderedModifiers[1]}' modifier.`, "InvalidModifiersOrder"),
      InvalidPropertyAccessAfterInstantiationExpression: "Invalid property access after an instantiation expression. You can either wrap the instantiation expression in parentheses, or delete the type arguments.",
      InvalidTupleMemberLabel: "Tuple members must be labeled with a simple identifier.",
      MissingInterfaceName: "'interface' declarations must be followed by an identifier.",
      NonAbstractClassHasAbstractMethod: "Abstract methods can only appear within an abstract class.",
      NonClassMethodPropertyHasAbstractModifer: "'abstract' modifier can only appear on a class, method, or property declaration.",
      OptionalTypeBeforeRequired: "A required element cannot follow an optional element.",
      OverrideNotInSubClass: "This member cannot have an 'override' modifier because its containing class does not extend another class.",
      PatternIsOptional: "A binding pattern parameter cannot be optional in an implementation signature.",
      PrivateElementHasAbstract: "Private elements cannot have the 'abstract' modifier.",
      PrivateElementHasAccessibility: /* @__PURE__ */ __name(({
        modifier
      }) => `Private elements cannot have an accessibility modifier ('${modifier}').`, "PrivateElementHasAccessibility"),
      ReadonlyForMethodSignature: "'readonly' modifier can only appear on a property declaration or index signature.",
      ReservedArrowTypeParam: "This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma, as in `<T,>() => ...`.",
      ReservedTypeAssertion: "This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead.",
      SetAccessorCannotHaveOptionalParameter: "A 'set' accessor cannot have an optional parameter.",
      SetAccessorCannotHaveRestParameter: "A 'set' accessor cannot have rest parameter.",
      SetAccessorCannotHaveReturnType: "A 'set' accessor cannot have a return type annotation.",
      SingleTypeParameterWithoutTrailingComma: /* @__PURE__ */ __name(({
        typeParameterName
      }) => `Single type parameter ${typeParameterName} should have a trailing comma. Example usage: <${typeParameterName},>.`, "SingleTypeParameterWithoutTrailingComma"),
      StaticBlockCannotHaveModifier: "Static class blocks cannot have any modifier.",
      TupleOptionalAfterType: "A labeled tuple optional element must be declared using a question mark after the name and before the colon (`name?: type`), rather than after the type (`name: type?`).",
      TypeAnnotationAfterAssign: "Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",
      TypeImportCannotSpecifyDefaultAndNamed: "A type-only import can specify a default import or named bindings, but not both.",
      TypeModifierIsUsedInTypeExports: "The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement.",
      TypeModifierIsUsedInTypeImports: "The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement.",
      UnexpectedParameterModifier: "A parameter property is only allowed in a constructor implementation.",
      UnexpectedReadonly: "'readonly' type modifier is only permitted on array and tuple literal types.",
      UnexpectedTypeAnnotation: "Did not expect a type annotation here.",
      UnexpectedTypeCastInParameter: "Unexpected type cast in parameter position.",
      UnsupportedImportTypeArgument: "Argument in a type import must be a string literal.",
      UnsupportedParameterPropertyKind: "A parameter property may not be declared using a binding pattern.",
      UnsupportedSignatureParameterKind: /* @__PURE__ */ __name(({
        type
      }) => `Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${type}.`, "UnsupportedSignatureParameterKind")
    });
    function keywordTypeFromName(value) {
      switch (value) {
        case "any":
          return "TSAnyKeyword";
        case "boolean":
          return "TSBooleanKeyword";
        case "bigint":
          return "TSBigIntKeyword";
        case "never":
          return "TSNeverKeyword";
        case "number":
          return "TSNumberKeyword";
        case "object":
          return "TSObjectKeyword";
        case "string":
          return "TSStringKeyword";
        case "symbol":
          return "TSSymbolKeyword";
        case "undefined":
          return "TSUndefinedKeyword";
        case "unknown":
          return "TSUnknownKeyword";
        default:
          return void 0;
      }
    }
    __name(keywordTypeFromName, "keywordTypeFromName");
    function tsIsAccessModifier(modifier) {
      return modifier === "private" || modifier === "public" || modifier === "protected";
    }
    __name(tsIsAccessModifier, "tsIsAccessModifier");
    function tsIsVarianceAnnotations(modifier) {
      return modifier === "in" || modifier === "out";
    }
    __name(tsIsVarianceAnnotations, "tsIsVarianceAnnotations");
    var typescript = /* @__PURE__ */ __name((superClass) => class TypeScriptParserMixin extends superClass {
      static {
        __name(this, "TypeScriptParserMixin");
      }
      constructor(...args) {
        super(...args);
        this.tsParseInOutModifiers = this.tsParseModifiers.bind(this, {
          allowedModifiers: ["in", "out"],
          disallowedModifiers: ["const", "public", "private", "protected", "readonly", "declare", "abstract", "override"],
          errorTemplate: TSErrors.InvalidModifierOnTypeParameter
        });
        this.tsParseConstModifier = this.tsParseModifiers.bind(this, {
          allowedModifiers: ["const"],
          disallowedModifiers: ["in", "out"],
          errorTemplate: TSErrors.InvalidModifierOnTypeParameterPositions
        });
        this.tsParseInOutConstModifiers = this.tsParseModifiers.bind(this, {
          allowedModifiers: ["in", "out", "const"],
          disallowedModifiers: ["public", "private", "protected", "readonly", "declare", "abstract", "override"],
          errorTemplate: TSErrors.InvalidModifierOnTypeParameter
        });
      }
      getScopeHandler() {
        return TypeScriptScopeHandler;
      }
      tsIsIdentifier() {
        return tokenIsIdentifier(this.state.type);
      }
      tsTokenCanFollowModifier() {
        return this.match(0) || this.match(5) || this.match(55) || this.match(21) || this.match(139) || this.isLiteralPropertyName();
      }
      tsNextTokenOnSameLineAndCanFollowModifier() {
        this.next();
        if (this.hasPrecedingLineBreak()) {
          return false;
        }
        return this.tsTokenCanFollowModifier();
      }
      tsNextTokenCanFollowModifier() {
        if (this.match(106)) {
          this.next();
          return this.tsTokenCanFollowModifier();
        }
        return this.tsNextTokenOnSameLineAndCanFollowModifier();
      }
      tsParseModifier(allowedModifiers, stopOnStartOfClassStaticBlock) {
        if (!tokenIsIdentifier(this.state.type) && this.state.type !== 58 && this.state.type !== 75) {
          return void 0;
        }
        const modifier = this.state.value;
        if (allowedModifiers.includes(modifier)) {
          if (stopOnStartOfClassStaticBlock && this.tsIsStartOfStaticBlocks()) {
            return void 0;
          }
          if (this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this))) {
            return modifier;
          }
        }
        return void 0;
      }
      tsParseModifiers({
        allowedModifiers,
        disallowedModifiers,
        stopOnStartOfClassStaticBlock,
        errorTemplate = TSErrors.InvalidModifierOnTypeMember
      }, modified) {
        const enforceOrder = /* @__PURE__ */ __name((loc, modifier, before, after) => {
          if (modifier === before && modified[after]) {
            this.raise(TSErrors.InvalidModifiersOrder, loc, {
              orderedModifiers: [before, after]
            });
          }
        }, "enforceOrder");
        const incompatible = /* @__PURE__ */ __name((loc, modifier, mod1, mod2) => {
          if (modified[mod1] && modifier === mod2 || modified[mod2] && modifier === mod1) {
            this.raise(TSErrors.IncompatibleModifiers, loc, {
              modifiers: [mod1, mod2]
            });
          }
        }, "incompatible");
        for (; ; ) {
          const {
            startLoc
          } = this.state;
          const modifier = this.tsParseModifier(allowedModifiers.concat(disallowedModifiers != null ? disallowedModifiers : []), stopOnStartOfClassStaticBlock);
          if (!modifier) break;
          if (tsIsAccessModifier(modifier)) {
            if (modified.accessibility) {
              this.raise(TSErrors.DuplicateAccessibilityModifier, startLoc, {
                modifier
              });
            } else {
              enforceOrder(startLoc, modifier, modifier, "override");
              enforceOrder(startLoc, modifier, modifier, "static");
              enforceOrder(startLoc, modifier, modifier, "readonly");
              modified.accessibility = modifier;
            }
          } else if (tsIsVarianceAnnotations(modifier)) {
            if (modified[modifier]) {
              this.raise(TSErrors.DuplicateModifier, startLoc, {
                modifier
              });
            }
            modified[modifier] = true;
            enforceOrder(startLoc, modifier, "in", "out");
          } else {
            if (hasOwnProperty.call(modified, modifier)) {
              this.raise(TSErrors.DuplicateModifier, startLoc, {
                modifier
              });
            } else {
              enforceOrder(startLoc, modifier, "static", "readonly");
              enforceOrder(startLoc, modifier, "static", "override");
              enforceOrder(startLoc, modifier, "override", "readonly");
              enforceOrder(startLoc, modifier, "abstract", "override");
              incompatible(startLoc, modifier, "declare", "override");
              incompatible(startLoc, modifier, "static", "abstract");
            }
            modified[modifier] = true;
          }
          if (disallowedModifiers != null && disallowedModifiers.includes(modifier)) {
            this.raise(errorTemplate, startLoc, {
              modifier
            });
          }
        }
      }
      tsIsListTerminator(kind2) {
        switch (kind2) {
          case "EnumMembers":
          case "TypeMembers":
            return this.match(8);
          case "HeritageClauseElement":
            return this.match(5);
          case "TupleElementTypes":
            return this.match(3);
          case "TypeParametersOrArguments":
            return this.match(48);
        }
      }
      tsParseList(kind2, parseElement) {
        const result = [];
        while (!this.tsIsListTerminator(kind2)) {
          result.push(parseElement());
        }
        return result;
      }
      tsParseDelimitedList(kind2, parseElement, refTrailingCommaPos) {
        return nonNull(this.tsParseDelimitedListWorker(kind2, parseElement, true, refTrailingCommaPos));
      }
      tsParseDelimitedListWorker(kind2, parseElement, expectSuccess, refTrailingCommaPos) {
        const result = [];
        let trailingCommaPos = -1;
        for (; ; ) {
          if (this.tsIsListTerminator(kind2)) {
            break;
          }
          trailingCommaPos = -1;
          const element = parseElement();
          if (element == null) {
            return void 0;
          }
          result.push(element);
          if (this.eat(12)) {
            trailingCommaPos = this.state.lastTokStartLoc.index;
            continue;
          }
          if (this.tsIsListTerminator(kind2)) {
            break;
          }
          if (expectSuccess) {
            this.expect(12);
          }
          return void 0;
        }
        if (refTrailingCommaPos) {
          refTrailingCommaPos.value = trailingCommaPos;
        }
        return result;
      }
      tsParseBracketedList(kind2, parseElement, bracket, skipFirstToken, refTrailingCommaPos) {
        if (!skipFirstToken) {
          if (bracket) {
            this.expect(0);
          } else {
            this.expect(47);
          }
        }
        const result = this.tsParseDelimitedList(kind2, parseElement, refTrailingCommaPos);
        if (bracket) {
          this.expect(3);
        } else {
          this.expect(48);
        }
        return result;
      }
      tsParseImportType() {
        const node2 = this.startNode();
        this.expect(83);
        this.expect(10);
        if (!this.match(134)) {
          this.raise(TSErrors.UnsupportedImportTypeArgument, this.state.startLoc);
        }
        node2.argument = super.parseExprAtom();
        if (this.eat(12) && !this.match(11)) {
          node2.options = super.parseMaybeAssignAllowIn();
          this.eat(12);
        } else {
          node2.options = null;
        }
        this.expect(11);
        if (this.eat(16)) {
          node2.qualifier = this.tsParseEntityName();
        }
        if (this.match(47)) {
          node2.typeParameters = this.tsParseTypeArguments();
        }
        return this.finishNode(node2, "TSImportType");
      }
      tsParseEntityName(allowReservedWords = true) {
        let entity = this.parseIdentifier(allowReservedWords);
        while (this.eat(16)) {
          const node2 = this.startNodeAtNode(entity);
          node2.left = entity;
          node2.right = this.parseIdentifier(allowReservedWords);
          entity = this.finishNode(node2, "TSQualifiedName");
        }
        return entity;
      }
      tsParseTypeReference() {
        const node2 = this.startNode();
        node2.typeName = this.tsParseEntityName();
        if (!this.hasPrecedingLineBreak() && this.match(47)) {
          node2.typeParameters = this.tsParseTypeArguments();
        }
        return this.finishNode(node2, "TSTypeReference");
      }
      tsParseThisTypePredicate(lhs) {
        this.next();
        const node2 = this.startNodeAtNode(lhs);
        node2.parameterName = lhs;
        node2.typeAnnotation = this.tsParseTypeAnnotation(false);
        node2.asserts = false;
        return this.finishNode(node2, "TSTypePredicate");
      }
      tsParseThisTypeNode() {
        const node2 = this.startNode();
        this.next();
        return this.finishNode(node2, "TSThisType");
      }
      tsParseTypeQuery() {
        const node2 = this.startNode();
        this.expect(87);
        if (this.match(83)) {
          node2.exprName = this.tsParseImportType();
        } else {
          node2.exprName = this.tsParseEntityName();
        }
        if (!this.hasPrecedingLineBreak() && this.match(47)) {
          node2.typeParameters = this.tsParseTypeArguments();
        }
        return this.finishNode(node2, "TSTypeQuery");
      }
      tsParseTypeParameter(parseModifiers) {
        const node2 = this.startNode();
        parseModifiers(node2);
        node2.name = this.tsParseTypeParameterName();
        node2.constraint = this.tsEatThenParseType(81);
        node2.default = this.tsEatThenParseType(29);
        return this.finishNode(node2, "TSTypeParameter");
      }
      tsTryParseTypeParameters(parseModifiers) {
        if (this.match(47)) {
          return this.tsParseTypeParameters(parseModifiers);
        }
      }
      tsParseTypeParameters(parseModifiers) {
        const node2 = this.startNode();
        if (this.match(47) || this.match(143)) {
          this.next();
        } else {
          this.unexpected();
        }
        const refTrailingCommaPos = {
          value: -1
        };
        node2.params = this.tsParseBracketedList("TypeParametersOrArguments", this.tsParseTypeParameter.bind(this, parseModifiers), false, true, refTrailingCommaPos);
        if (node2.params.length === 0) {
          this.raise(TSErrors.EmptyTypeParameters, node2);
        }
        if (refTrailingCommaPos.value !== -1) {
          this.addExtra(node2, "trailingComma", refTrailingCommaPos.value);
        }
        return this.finishNode(node2, "TSTypeParameterDeclaration");
      }
      tsFillSignature(returnToken, signature) {
        const returnTokenRequired = returnToken === 19;
        const paramsKey = "parameters";
        const returnTypeKey = "typeAnnotation";
        signature.typeParameters = this.tsTryParseTypeParameters(this.tsParseConstModifier);
        this.expect(10);
        signature[paramsKey] = this.tsParseBindingListForSignature();
        if (returnTokenRequired) {
          signature[returnTypeKey] = this.tsParseTypeOrTypePredicateAnnotation(returnToken);
        } else if (this.match(returnToken)) {
          signature[returnTypeKey] = this.tsParseTypeOrTypePredicateAnnotation(returnToken);
        }
      }
      tsParseBindingListForSignature() {
        const list = super.parseBindingList(11, 41, 2);
        for (const pattern of list) {
          const {
            type
          } = pattern;
          if (type === "AssignmentPattern" || type === "TSParameterProperty") {
            this.raise(TSErrors.UnsupportedSignatureParameterKind, pattern, {
              type
            });
          }
        }
        return list;
      }
      tsParseTypeMemberSemicolon() {
        if (!this.eat(12) && !this.isLineTerminator()) {
          this.expect(13);
        }
      }
      tsParseSignatureMember(kind2, node2) {
        this.tsFillSignature(14, node2);
        this.tsParseTypeMemberSemicolon();
        return this.finishNode(node2, kind2);
      }
      tsIsUnambiguouslyIndexSignature() {
        this.next();
        if (tokenIsIdentifier(this.state.type)) {
          this.next();
          return this.match(14);
        }
        return false;
      }
      tsTryParseIndexSignature(node2) {
        if (!(this.match(0) && this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this)))) {
          return;
        }
        this.expect(0);
        const id = this.parseIdentifier();
        id.typeAnnotation = this.tsParseTypeAnnotation();
        this.resetEndLocation(id);
        this.expect(3);
        node2.parameters = [id];
        const type = this.tsTryParseTypeAnnotation();
        if (type) node2.typeAnnotation = type;
        this.tsParseTypeMemberSemicolon();
        return this.finishNode(node2, "TSIndexSignature");
      }
      tsParsePropertyOrMethodSignature(node2, readonly) {
        if (this.eat(17)) node2.optional = true;
        const nodeAny = node2;
        if (this.match(10) || this.match(47)) {
          if (readonly) {
            this.raise(TSErrors.ReadonlyForMethodSignature, node2);
          }
          const method = nodeAny;
          if (method.kind && this.match(47)) {
            this.raise(TSErrors.AccessorCannotHaveTypeParameters, this.state.curPosition());
          }
          this.tsFillSignature(14, method);
          this.tsParseTypeMemberSemicolon();
          const paramsKey = "parameters";
          const returnTypeKey = "typeAnnotation";
          if (method.kind === "get") {
            if (method[paramsKey].length > 0) {
              this.raise(Errors.BadGetterArity, this.state.curPosition());
              if (this.isThisParam(method[paramsKey][0])) {
                this.raise(TSErrors.AccessorCannotDeclareThisParameter, this.state.curPosition());
              }
            }
          } else if (method.kind === "set") {
            if (method[paramsKey].length !== 1) {
              this.raise(Errors.BadSetterArity, this.state.curPosition());
            } else {
              const firstParameter = method[paramsKey][0];
              if (this.isThisParam(firstParameter)) {
                this.raise(TSErrors.AccessorCannotDeclareThisParameter, this.state.curPosition());
              }
              if (firstParameter.type === "Identifier" && firstParameter.optional) {
                this.raise(TSErrors.SetAccessorCannotHaveOptionalParameter, this.state.curPosition());
              }
              if (firstParameter.type === "RestElement") {
                this.raise(TSErrors.SetAccessorCannotHaveRestParameter, this.state.curPosition());
              }
            }
            if (method[returnTypeKey]) {
              this.raise(TSErrors.SetAccessorCannotHaveReturnType, method[returnTypeKey]);
            }
          } else {
            method.kind = "method";
          }
          return this.finishNode(method, "TSMethodSignature");
        } else {
          const property = nodeAny;
          if (readonly) property.readonly = true;
          const type = this.tsTryParseTypeAnnotation();
          if (type) property.typeAnnotation = type;
          this.tsParseTypeMemberSemicolon();
          return this.finishNode(property, "TSPropertySignature");
        }
      }
      tsParseTypeMember() {
        const node2 = this.startNode();
        if (this.match(10) || this.match(47)) {
          return this.tsParseSignatureMember("TSCallSignatureDeclaration", node2);
        }
        if (this.match(77)) {
          const id = this.startNode();
          this.next();
          if (this.match(10) || this.match(47)) {
            return this.tsParseSignatureMember("TSConstructSignatureDeclaration", node2);
          } else {
            node2.key = this.createIdentifier(id, "new");
            return this.tsParsePropertyOrMethodSignature(node2, false);
          }
        }
        this.tsParseModifiers({
          allowedModifiers: ["readonly"],
          disallowedModifiers: ["declare", "abstract", "private", "protected", "public", "static", "override"]
        }, node2);
        const idx = this.tsTryParseIndexSignature(node2);
        if (idx) {
          return idx;
        }
        super.parsePropertyName(node2);
        if (!node2.computed && node2.key.type === "Identifier" && (node2.key.name === "get" || node2.key.name === "set") && this.tsTokenCanFollowModifier()) {
          node2.kind = node2.key.name;
          super.parsePropertyName(node2);
        }
        return this.tsParsePropertyOrMethodSignature(node2, !!node2.readonly);
      }
      tsParseTypeLiteral() {
        const node2 = this.startNode();
        node2.members = this.tsParseObjectTypeMembers();
        return this.finishNode(node2, "TSTypeLiteral");
      }
      tsParseObjectTypeMembers() {
        this.expect(5);
        const members = this.tsParseList("TypeMembers", this.tsParseTypeMember.bind(this));
        this.expect(8);
        return members;
      }
      tsIsStartOfMappedType() {
        this.next();
        if (this.eat(53)) {
          return this.isContextual(122);
        }
        if (this.isContextual(122)) {
          this.next();
        }
        if (!this.match(0)) {
          return false;
        }
        this.next();
        if (!this.tsIsIdentifier()) {
          return false;
        }
        this.next();
        return this.match(58);
      }
      tsParseMappedType() {
        const node2 = this.startNode();
        this.expect(5);
        if (this.match(53)) {
          node2.readonly = this.state.value;
          this.next();
          this.expectContextual(122);
        } else if (this.eatContextual(122)) {
          node2.readonly = true;
        }
        this.expect(0);
        {
          const typeParameter = this.startNode();
          typeParameter.name = this.tsParseTypeParameterName();
          typeParameter.constraint = this.tsExpectThenParseType(58);
          node2.typeParameter = this.finishNode(typeParameter, "TSTypeParameter");
        }
        node2.nameType = this.eatContextual(93) ? this.tsParseType() : null;
        this.expect(3);
        if (this.match(53)) {
          node2.optional = this.state.value;
          this.next();
          this.expect(17);
        } else if (this.eat(17)) {
          node2.optional = true;
        }
        node2.typeAnnotation = this.tsTryParseType();
        this.semicolon();
        this.expect(8);
        return this.finishNode(node2, "TSMappedType");
      }
      tsParseTupleType() {
        const node2 = this.startNode();
        node2.elementTypes = this.tsParseBracketedList("TupleElementTypes", this.tsParseTupleElementType.bind(this), true, false);
        let seenOptionalElement = false;
        node2.elementTypes.forEach((elementNode) => {
          const {
            type
          } = elementNode;
          if (seenOptionalElement && type !== "TSRestType" && type !== "TSOptionalType" && !(type === "TSNamedTupleMember" && elementNode.optional)) {
            this.raise(TSErrors.OptionalTypeBeforeRequired, elementNode);
          }
          seenOptionalElement || (seenOptionalElement = type === "TSNamedTupleMember" && elementNode.optional || type === "TSOptionalType");
        });
        return this.finishNode(node2, "TSTupleType");
      }
      tsParseTupleElementType() {
        const {
          startLoc
        } = this.state;
        const rest = this.eat(21);
        let labeled;
        let label;
        let optional;
        let type;
        const isWord = tokenIsKeywordOrIdentifier(this.state.type);
        const chAfterWord = isWord ? this.lookaheadCharCode() : null;
        if (chAfterWord === 58) {
          labeled = true;
          optional = false;
          label = this.parseIdentifier(true);
          this.expect(14);
          type = this.tsParseType();
        } else if (chAfterWord === 63) {
          optional = true;
          const startLoc2 = this.state.startLoc;
          const wordName = this.state.value;
          const typeOrLabel = this.tsParseNonArrayType();
          if (this.lookaheadCharCode() === 58) {
            labeled = true;
            label = this.createIdentifier(this.startNodeAt(startLoc2), wordName);
            this.expect(17);
            this.expect(14);
            type = this.tsParseType();
          } else {
            labeled = false;
            type = typeOrLabel;
            this.expect(17);
          }
        } else {
          type = this.tsParseType();
          optional = this.eat(17);
          labeled = this.eat(14);
        }
        if (labeled) {
          let labeledNode;
          if (label) {
            labeledNode = this.startNodeAtNode(label);
            labeledNode.optional = optional;
            labeledNode.label = label;
            labeledNode.elementType = type;
            if (this.eat(17)) {
              labeledNode.optional = true;
              this.raise(TSErrors.TupleOptionalAfterType, this.state.lastTokStartLoc);
            }
          } else {
            labeledNode = this.startNodeAtNode(type);
            labeledNode.optional = optional;
            this.raise(TSErrors.InvalidTupleMemberLabel, type);
            labeledNode.label = type;
            labeledNode.elementType = this.tsParseType();
          }
          type = this.finishNode(labeledNode, "TSNamedTupleMember");
        } else if (optional) {
          const optionalTypeNode = this.startNodeAtNode(type);
          optionalTypeNode.typeAnnotation = type;
          type = this.finishNode(optionalTypeNode, "TSOptionalType");
        }
        if (rest) {
          const restNode = this.startNodeAt(startLoc);
          restNode.typeAnnotation = type;
          type = this.finishNode(restNode, "TSRestType");
        }
        return type;
      }
      tsParseParenthesizedType() {
        const node2 = this.startNode();
        this.expect(10);
        node2.typeAnnotation = this.tsParseType();
        this.expect(11);
        return this.finishNode(node2, "TSParenthesizedType");
      }
      tsParseFunctionOrConstructorType(type, abstract) {
        const node2 = this.startNode();
        if (type === "TSConstructorType") {
          node2.abstract = !!abstract;
          if (abstract) this.next();
          this.next();
        }
        this.tsInAllowConditionalTypesContext(() => this.tsFillSignature(19, node2));
        return this.finishNode(node2, type);
      }
      tsParseLiteralTypeNode() {
        const node2 = this.startNode();
        switch (this.state.type) {
          case 135:
          case 136:
          case 134:
          case 85:
          case 86:
            node2.literal = super.parseExprAtom();
            break;
          default:
            this.unexpected();
        }
        return this.finishNode(node2, "TSLiteralType");
      }
      tsParseTemplateLiteralType() {
        const node2 = this.startNode();
        node2.literal = super.parseTemplate(false);
        return this.finishNode(node2, "TSLiteralType");
      }
      parseTemplateSubstitution() {
        if (this.state.inType) return this.tsParseType();
        return super.parseTemplateSubstitution();
      }
      tsParseThisTypeOrThisTypePredicate() {
        const thisKeyword = this.tsParseThisTypeNode();
        if (this.isContextual(116) && !this.hasPrecedingLineBreak()) {
          return this.tsParseThisTypePredicate(thisKeyword);
        } else {
          return thisKeyword;
        }
      }
      tsParseNonArrayType() {
        switch (this.state.type) {
          case 134:
          case 135:
          case 136:
          case 85:
          case 86:
            return this.tsParseLiteralTypeNode();
          case 53:
            if (this.state.value === "-") {
              const node2 = this.startNode();
              const nextToken = this.lookahead();
              if (nextToken.type !== 135 && nextToken.type !== 136) {
                this.unexpected();
              }
              node2.literal = this.parseMaybeUnary();
              return this.finishNode(node2, "TSLiteralType");
            }
            break;
          case 78:
            return this.tsParseThisTypeOrThisTypePredicate();
          case 87:
            return this.tsParseTypeQuery();
          case 83:
            return this.tsParseImportType();
          case 5:
            return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this)) ? this.tsParseMappedType() : this.tsParseTypeLiteral();
          case 0:
            return this.tsParseTupleType();
          case 10:
            return this.tsParseParenthesizedType();
          case 25:
          case 24:
            return this.tsParseTemplateLiteralType();
          default: {
            const {
              type
            } = this.state;
            if (tokenIsIdentifier(type) || type === 88 || type === 84) {
              const nodeType = type === 88 ? "TSVoidKeyword" : type === 84 ? "TSNullKeyword" : keywordTypeFromName(this.state.value);
              if (nodeType !== void 0 && this.lookaheadCharCode() !== 46) {
                const node2 = this.startNode();
                this.next();
                return this.finishNode(node2, nodeType);
              }
              return this.tsParseTypeReference();
            }
          }
        }
        this.unexpected();
      }
      tsParseArrayTypeOrHigher() {
        let type = this.tsParseNonArrayType();
        while (!this.hasPrecedingLineBreak() && this.eat(0)) {
          if (this.match(3)) {
            const node2 = this.startNodeAtNode(type);
            node2.elementType = type;
            this.expect(3);
            type = this.finishNode(node2, "TSArrayType");
          } else {
            const node2 = this.startNodeAtNode(type);
            node2.objectType = type;
            node2.indexType = this.tsParseType();
            this.expect(3);
            type = this.finishNode(node2, "TSIndexedAccessType");
          }
        }
        return type;
      }
      tsParseTypeOperator() {
        const node2 = this.startNode();
        const operator = this.state.value;
        this.next();
        node2.operator = operator;
        node2.typeAnnotation = this.tsParseTypeOperatorOrHigher();
        if (operator === "readonly") {
          this.tsCheckTypeAnnotationForReadOnly(node2);
        }
        return this.finishNode(node2, "TSTypeOperator");
      }
      tsCheckTypeAnnotationForReadOnly(node2) {
        switch (node2.typeAnnotation.type) {
          case "TSTupleType":
          case "TSArrayType":
            return;
          default:
            this.raise(TSErrors.UnexpectedReadonly, node2);
        }
      }
      tsParseInferType() {
        const node2 = this.startNode();
        this.expectContextual(115);
        const typeParameter = this.startNode();
        typeParameter.name = this.tsParseTypeParameterName();
        typeParameter.constraint = this.tsTryParse(() => this.tsParseConstraintForInferType());
        node2.typeParameter = this.finishNode(typeParameter, "TSTypeParameter");
        return this.finishNode(node2, "TSInferType");
      }
      tsParseConstraintForInferType() {
        if (this.eat(81)) {
          const constraint = this.tsInDisallowConditionalTypesContext(() => this.tsParseType());
          if (this.state.inDisallowConditionalTypesContext || !this.match(17)) {
            return constraint;
          }
        }
      }
      tsParseTypeOperatorOrHigher() {
        const isTypeOperator = tokenIsTSTypeOperator(this.state.type) && !this.state.containsEsc;
        return isTypeOperator ? this.tsParseTypeOperator() : this.isContextual(115) ? this.tsParseInferType() : this.tsInAllowConditionalTypesContext(() => this.tsParseArrayTypeOrHigher());
      }
      tsParseUnionOrIntersectionType(kind2, parseConstituentType, operator) {
        const node2 = this.startNode();
        const hasLeadingOperator = this.eat(operator);
        const types14 = [];
        do {
          types14.push(parseConstituentType());
        } while (this.eat(operator));
        if (types14.length === 1 && !hasLeadingOperator) {
          return types14[0];
        }
        node2.types = types14;
        return this.finishNode(node2, kind2);
      }
      tsParseIntersectionTypeOrHigher() {
        return this.tsParseUnionOrIntersectionType("TSIntersectionType", this.tsParseTypeOperatorOrHigher.bind(this), 45);
      }
      tsParseUnionTypeOrHigher() {
        return this.tsParseUnionOrIntersectionType("TSUnionType", this.tsParseIntersectionTypeOrHigher.bind(this), 43);
      }
      tsIsStartOfFunctionType() {
        if (this.match(47)) {
          return true;
        }
        return this.match(10) && this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this));
      }
      tsSkipParameterStart() {
        if (tokenIsIdentifier(this.state.type) || this.match(78)) {
          this.next();
          return true;
        }
        if (this.match(5)) {
          const {
            errors
          } = this.state;
          const previousErrorCount = errors.length;
          try {
            this.parseObjectLike(8, true);
            return errors.length === previousErrorCount;
          } catch (_unused) {
            return false;
          }
        }
        if (this.match(0)) {
          this.next();
          const {
            errors
          } = this.state;
          const previousErrorCount = errors.length;
          try {
            super.parseBindingList(3, 93, 1);
            return errors.length === previousErrorCount;
          } catch (_unused2) {
            return false;
          }
        }
        return false;
      }
      tsIsUnambiguouslyStartOfFunctionType() {
        this.next();
        if (this.match(11) || this.match(21)) {
          return true;
        }
        if (this.tsSkipParameterStart()) {
          if (this.match(14) || this.match(12) || this.match(17) || this.match(29)) {
            return true;
          }
          if (this.match(11)) {
            this.next();
            if (this.match(19)) {
              return true;
            }
          }
        }
        return false;
      }
      tsParseTypeOrTypePredicateAnnotation(returnToken) {
        return this.tsInType(() => {
          const t13 = this.startNode();
          this.expect(returnToken);
          const node2 = this.startNode();
          const asserts = !!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this));
          if (asserts && this.match(78)) {
            let thisTypePredicate = this.tsParseThisTypeOrThisTypePredicate();
            if (thisTypePredicate.type === "TSThisType") {
              node2.parameterName = thisTypePredicate;
              node2.asserts = true;
              node2.typeAnnotation = null;
              thisTypePredicate = this.finishNode(node2, "TSTypePredicate");
            } else {
              this.resetStartLocationFromNode(thisTypePredicate, node2);
              thisTypePredicate.asserts = true;
            }
            t13.typeAnnotation = thisTypePredicate;
            return this.finishNode(t13, "TSTypeAnnotation");
          }
          const typePredicateVariable = this.tsIsIdentifier() && this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));
          if (!typePredicateVariable) {
            if (!asserts) {
              return this.tsParseTypeAnnotation(false, t13);
            }
            node2.parameterName = this.parseIdentifier();
            node2.asserts = asserts;
            node2.typeAnnotation = null;
            t13.typeAnnotation = this.finishNode(node2, "TSTypePredicate");
            return this.finishNode(t13, "TSTypeAnnotation");
          }
          const type = this.tsParseTypeAnnotation(false);
          node2.parameterName = typePredicateVariable;
          node2.typeAnnotation = type;
          node2.asserts = asserts;
          t13.typeAnnotation = this.finishNode(node2, "TSTypePredicate");
          return this.finishNode(t13, "TSTypeAnnotation");
        });
      }
      tsTryParseTypeOrTypePredicateAnnotation() {
        if (this.match(14)) {
          return this.tsParseTypeOrTypePredicateAnnotation(14);
        }
      }
      tsTryParseTypeAnnotation() {
        if (this.match(14)) {
          return this.tsParseTypeAnnotation();
        }
      }
      tsTryParseType() {
        return this.tsEatThenParseType(14);
      }
      tsParseTypePredicatePrefix() {
        const id = this.parseIdentifier();
        if (this.isContextual(116) && !this.hasPrecedingLineBreak()) {
          this.next();
          return id;
        }
      }
      tsParseTypePredicateAsserts() {
        if (this.state.type !== 109) {
          return false;
        }
        const containsEsc = this.state.containsEsc;
        this.next();
        if (!tokenIsIdentifier(this.state.type) && !this.match(78)) {
          return false;
        }
        if (containsEsc) {
          this.raise(Errors.InvalidEscapedReservedWord, this.state.lastTokStartLoc, {
            reservedWord: "asserts"
          });
        }
        return true;
      }
      tsParseTypeAnnotation(eatColon = true, t13 = this.startNode()) {
        this.tsInType(() => {
          if (eatColon) this.expect(14);
          t13.typeAnnotation = this.tsParseType();
        });
        return this.finishNode(t13, "TSTypeAnnotation");
      }
      tsParseType() {
        assert61(this.state.inType);
        const type = this.tsParseNonConditionalType();
        if (this.state.inDisallowConditionalTypesContext || this.hasPrecedingLineBreak() || !this.eat(81)) {
          return type;
        }
        const node2 = this.startNodeAtNode(type);
        node2.checkType = type;
        node2.extendsType = this.tsInDisallowConditionalTypesContext(() => this.tsParseNonConditionalType());
        this.expect(17);
        node2.trueType = this.tsInAllowConditionalTypesContext(() => this.tsParseType());
        this.expect(14);
        node2.falseType = this.tsInAllowConditionalTypesContext(() => this.tsParseType());
        return this.finishNode(node2, "TSConditionalType");
      }
      isAbstractConstructorSignature() {
        return this.isContextual(124) && this.lookahead().type === 77;
      }
      tsParseNonConditionalType() {
        if (this.tsIsStartOfFunctionType()) {
          return this.tsParseFunctionOrConstructorType("TSFunctionType");
        }
        if (this.match(77)) {
          return this.tsParseFunctionOrConstructorType("TSConstructorType");
        } else if (this.isAbstractConstructorSignature()) {
          return this.tsParseFunctionOrConstructorType("TSConstructorType", true);
        }
        return this.tsParseUnionTypeOrHigher();
      }
      tsParseTypeAssertion() {
        if (this.getPluginOption("typescript", "disallowAmbiguousJSXLike")) {
          this.raise(TSErrors.ReservedTypeAssertion, this.state.startLoc);
        }
        const node2 = this.startNode();
        node2.typeAnnotation = this.tsInType(() => {
          this.next();
          return this.match(75) ? this.tsParseTypeReference() : this.tsParseType();
        });
        this.expect(48);
        node2.expression = this.parseMaybeUnary();
        return this.finishNode(node2, "TSTypeAssertion");
      }
      tsParseHeritageClause(token) {
        const originalStartLoc = this.state.startLoc;
        const delimitedList = this.tsParseDelimitedList("HeritageClauseElement", () => {
          const node2 = this.startNode();
          node2.expression = this.tsParseEntityName();
          if (this.match(47)) {
            node2.typeParameters = this.tsParseTypeArguments();
          }
          return this.finishNode(node2, "TSExpressionWithTypeArguments");
        });
        if (!delimitedList.length) {
          this.raise(TSErrors.EmptyHeritageClauseType, originalStartLoc, {
            token
          });
        }
        return delimitedList;
      }
      tsParseInterfaceDeclaration(node2, properties = {}) {
        if (this.hasFollowingLineBreak()) return null;
        this.expectContextual(129);
        if (properties.declare) node2.declare = true;
        if (tokenIsIdentifier(this.state.type)) {
          node2.id = this.parseIdentifier();
          this.checkIdentifier(node2.id, 130);
        } else {
          node2.id = null;
          this.raise(TSErrors.MissingInterfaceName, this.state.startLoc);
        }
        node2.typeParameters = this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers);
        if (this.eat(81)) {
          node2.extends = this.tsParseHeritageClause("extends");
        }
        const body = this.startNode();
        body.body = this.tsInType(this.tsParseObjectTypeMembers.bind(this));
        node2.body = this.finishNode(body, "TSInterfaceBody");
        return this.finishNode(node2, "TSInterfaceDeclaration");
      }
      tsParseTypeAliasDeclaration(node2) {
        node2.id = this.parseIdentifier();
        this.checkIdentifier(node2.id, 2);
        node2.typeAnnotation = this.tsInType(() => {
          node2.typeParameters = this.tsTryParseTypeParameters(this.tsParseInOutModifiers);
          this.expect(29);
          if (this.isContextual(114) && this.lookahead().type !== 16) {
            const node3 = this.startNode();
            this.next();
            return this.finishNode(node3, "TSIntrinsicKeyword");
          }
          return this.tsParseType();
        });
        this.semicolon();
        return this.finishNode(node2, "TSTypeAliasDeclaration");
      }
      tsInNoContext(cb2) {
        const oldContext = this.state.context;
        this.state.context = [oldContext[0]];
        try {
          return cb2();
        } finally {
          this.state.context = oldContext;
        }
      }
      tsInType(cb2) {
        const oldInType = this.state.inType;
        this.state.inType = true;
        try {
          return cb2();
        } finally {
          this.state.inType = oldInType;
        }
      }
      tsInDisallowConditionalTypesContext(cb2) {
        const oldInDisallowConditionalTypesContext = this.state.inDisallowConditionalTypesContext;
        this.state.inDisallowConditionalTypesContext = true;
        try {
          return cb2();
        } finally {
          this.state.inDisallowConditionalTypesContext = oldInDisallowConditionalTypesContext;
        }
      }
      tsInAllowConditionalTypesContext(cb2) {
        const oldInDisallowConditionalTypesContext = this.state.inDisallowConditionalTypesContext;
        this.state.inDisallowConditionalTypesContext = false;
        try {
          return cb2();
        } finally {
          this.state.inDisallowConditionalTypesContext = oldInDisallowConditionalTypesContext;
        }
      }
      tsEatThenParseType(token) {
        if (this.match(token)) {
          return this.tsNextThenParseType();
        }
      }
      tsExpectThenParseType(token) {
        return this.tsInType(() => {
          this.expect(token);
          return this.tsParseType();
        });
      }
      tsNextThenParseType() {
        return this.tsInType(() => {
          this.next();
          return this.tsParseType();
        });
      }
      tsParseEnumMember() {
        const node2 = this.startNode();
        node2.id = this.match(134) ? super.parseStringLiteral(this.state.value) : this.parseIdentifier(true);
        if (this.eat(29)) {
          node2.initializer = super.parseMaybeAssignAllowIn();
        }
        return this.finishNode(node2, "TSEnumMember");
      }
      tsParseEnumDeclaration(node2, properties = {}) {
        if (properties.const) node2.const = true;
        if (properties.declare) node2.declare = true;
        this.expectContextual(126);
        node2.id = this.parseIdentifier();
        this.checkIdentifier(node2.id, node2.const ? 8971 : 8459);
        this.expect(5);
        node2.members = this.tsParseDelimitedList("EnumMembers", this.tsParseEnumMember.bind(this));
        this.expect(8);
        return this.finishNode(node2, "TSEnumDeclaration");
      }
      tsParseModuleBlock() {
        const node2 = this.startNode();
        this.scope.enter(0);
        this.expect(5);
        super.parseBlockOrModuleBlockBody(node2.body = [], void 0, true, 8);
        this.scope.exit();
        return this.finishNode(node2, "TSModuleBlock");
      }
      tsParseModuleOrNamespaceDeclaration(node2, nested = false) {
        node2.id = this.parseIdentifier();
        if (!nested) {
          this.checkIdentifier(node2.id, 1024);
        }
        if (this.eat(16)) {
          const inner = this.startNode();
          this.tsParseModuleOrNamespaceDeclaration(inner, true);
          node2.body = inner;
        } else {
          this.scope.enter(256);
          this.prodParam.enter(0);
          node2.body = this.tsParseModuleBlock();
          this.prodParam.exit();
          this.scope.exit();
        }
        return this.finishNode(node2, "TSModuleDeclaration");
      }
      tsParseAmbientExternalModuleDeclaration(node2) {
        if (this.isContextual(112)) {
          node2.kind = "global";
          {
            node2.global = true;
          }
          node2.id = this.parseIdentifier();
        } else if (this.match(134)) {
          node2.kind = "module";
          node2.id = super.parseStringLiteral(this.state.value);
        } else {
          this.unexpected();
        }
        if (this.match(5)) {
          this.scope.enter(256);
          this.prodParam.enter(0);
          node2.body = this.tsParseModuleBlock();
          this.prodParam.exit();
          this.scope.exit();
        } else {
          this.semicolon();
        }
        return this.finishNode(node2, "TSModuleDeclaration");
      }
      tsParseImportEqualsDeclaration(node2, maybeDefaultIdentifier, isExport) {
        node2.isExport = isExport || false;
        node2.id = maybeDefaultIdentifier || this.parseIdentifier();
        this.checkIdentifier(node2.id, 4096);
        this.expect(29);
        const moduleReference = this.tsParseModuleReference();
        if (node2.importKind === "type" && moduleReference.type !== "TSExternalModuleReference") {
          this.raise(TSErrors.ImportAliasHasImportType, moduleReference);
        }
        node2.moduleReference = moduleReference;
        this.semicolon();
        return this.finishNode(node2, "TSImportEqualsDeclaration");
      }
      tsIsExternalModuleReference() {
        return this.isContextual(119) && this.lookaheadCharCode() === 40;
      }
      tsParseModuleReference() {
        return this.tsIsExternalModuleReference() ? this.tsParseExternalModuleReference() : this.tsParseEntityName(false);
      }
      tsParseExternalModuleReference() {
        const node2 = this.startNode();
        this.expectContextual(119);
        this.expect(10);
        if (!this.match(134)) {
          this.unexpected();
        }
        node2.expression = super.parseExprAtom();
        this.expect(11);
        this.sawUnambiguousESM = true;
        return this.finishNode(node2, "TSExternalModuleReference");
      }
      tsLookAhead(f8) {
        const state2 = this.state.clone();
        const res = f8();
        this.state = state2;
        return res;
      }
      tsTryParseAndCatch(f8) {
        const result = this.tryParse((abort) => f8() || abort());
        if (result.aborted || !result.node) return;
        if (result.error) this.state = result.failState;
        return result.node;
      }
      tsTryParse(f8) {
        const state2 = this.state.clone();
        const result = f8();
        if (result !== void 0 && result !== false) {
          return result;
        }
        this.state = state2;
      }
      tsTryParseDeclare(nany) {
        if (this.isLineTerminator()) {
          return;
        }
        let startType = this.state.type;
        let kind2;
        if (this.isContextual(100)) {
          startType = 74;
          kind2 = "let";
        }
        return this.tsInAmbientContext(() => {
          switch (startType) {
            case 68:
              nany.declare = true;
              return super.parseFunctionStatement(nany, false, false);
            case 80:
              nany.declare = true;
              return this.parseClass(nany, true, false);
            case 126:
              return this.tsParseEnumDeclaration(nany, {
                declare: true
              });
            case 112:
              return this.tsParseAmbientExternalModuleDeclaration(nany);
            case 75:
            case 74:
              if (!this.match(75) || !this.isLookaheadContextual("enum")) {
                nany.declare = true;
                return this.parseVarStatement(nany, kind2 || this.state.value, true);
              }
              this.expect(75);
              return this.tsParseEnumDeclaration(nany, {
                const: true,
                declare: true
              });
            case 129: {
              const result = this.tsParseInterfaceDeclaration(nany, {
                declare: true
              });
              if (result) return result;
            }
            default:
              if (tokenIsIdentifier(startType)) {
                return this.tsParseDeclaration(nany, this.state.value, true, null);
              }
          }
        });
      }
      tsTryParseExportDeclaration() {
        return this.tsParseDeclaration(this.startNode(), this.state.value, true, null);
      }
      tsParseExpressionStatement(node2, expr, decorators) {
        switch (expr.name) {
          case "declare": {
            const declaration = this.tsTryParseDeclare(node2);
            if (declaration) {
              declaration.declare = true;
            }
            return declaration;
          }
          case "global":
            if (this.match(5)) {
              this.scope.enter(256);
              this.prodParam.enter(0);
              const mod = node2;
              mod.kind = "global";
              {
                node2.global = true;
              }
              mod.id = expr;
              mod.body = this.tsParseModuleBlock();
              this.scope.exit();
              this.prodParam.exit();
              return this.finishNode(mod, "TSModuleDeclaration");
            }
            break;
          default:
            return this.tsParseDeclaration(node2, expr.name, false, decorators);
        }
      }
      tsParseDeclaration(node2, value, next, decorators) {
        switch (value) {
          case "abstract":
            if (this.tsCheckLineTerminator(next) && (this.match(80) || tokenIsIdentifier(this.state.type))) {
              return this.tsParseAbstractDeclaration(node2, decorators);
            }
            break;
          case "module":
            if (this.tsCheckLineTerminator(next)) {
              if (this.match(134)) {
                return this.tsParseAmbientExternalModuleDeclaration(node2);
              } else if (tokenIsIdentifier(this.state.type)) {
                node2.kind = "module";
                return this.tsParseModuleOrNamespaceDeclaration(node2);
              }
            }
            break;
          case "namespace":
            if (this.tsCheckLineTerminator(next) && tokenIsIdentifier(this.state.type)) {
              node2.kind = "namespace";
              return this.tsParseModuleOrNamespaceDeclaration(node2);
            }
            break;
          case "type":
            if (this.tsCheckLineTerminator(next) && tokenIsIdentifier(this.state.type)) {
              return this.tsParseTypeAliasDeclaration(node2);
            }
            break;
        }
      }
      tsCheckLineTerminator(next) {
        if (next) {
          if (this.hasFollowingLineBreak()) return false;
          this.next();
          return true;
        }
        return !this.isLineTerminator();
      }
      tsTryParseGenericAsyncArrowFunction(startLoc) {
        if (!this.match(47)) return;
        const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;
        this.state.maybeInArrowParameters = true;
        const res = this.tsTryParseAndCatch(() => {
          const node2 = this.startNodeAt(startLoc);
          node2.typeParameters = this.tsParseTypeParameters(this.tsParseConstModifier);
          super.parseFunctionParams(node2);
          node2.returnType = this.tsTryParseTypeOrTypePredicateAnnotation();
          this.expect(19);
          return node2;
        });
        this.state.maybeInArrowParameters = oldMaybeInArrowParameters;
        if (!res) return;
        return super.parseArrowExpression(res, null, true);
      }
      tsParseTypeArgumentsInExpression() {
        if (this.reScan_lt() !== 47) return;
        return this.tsParseTypeArguments();
      }
      tsParseTypeArguments() {
        const node2 = this.startNode();
        node2.params = this.tsInType(() => this.tsInNoContext(() => {
          this.expect(47);
          return this.tsParseDelimitedList("TypeParametersOrArguments", this.tsParseType.bind(this));
        }));
        if (node2.params.length === 0) {
          this.raise(TSErrors.EmptyTypeArguments, node2);
        } else if (!this.state.inType && this.curContext() === types13.brace) {
          this.reScan_lt_gt();
        }
        this.expect(48);
        return this.finishNode(node2, "TSTypeParameterInstantiation");
      }
      tsIsDeclarationStart() {
        return tokenIsTSDeclarationStart(this.state.type);
      }
      isExportDefaultSpecifier() {
        if (this.tsIsDeclarationStart()) return false;
        return super.isExportDefaultSpecifier();
      }
      parseAssignableListItem(flags2, decorators) {
        const startLoc = this.state.startLoc;
        const modified = {};
        this.tsParseModifiers({
          allowedModifiers: ["public", "private", "protected", "override", "readonly"]
        }, modified);
        const accessibility = modified.accessibility;
        const override = modified.override;
        const readonly = modified.readonly;
        if (!(flags2 & 4) && (accessibility || readonly || override)) {
          this.raise(TSErrors.UnexpectedParameterModifier, startLoc);
        }
        const left2 = this.parseMaybeDefault();
        if (flags2 & 2) {
          this.parseFunctionParamType(left2);
        }
        const elt = this.parseMaybeDefault(left2.loc.start, left2);
        if (accessibility || readonly || override) {
          const pp = this.startNodeAt(startLoc);
          if (decorators.length) {
            pp.decorators = decorators;
          }
          if (accessibility) pp.accessibility = accessibility;
          if (readonly) pp.readonly = readonly;
          if (override) pp.override = override;
          if (elt.type !== "Identifier" && elt.type !== "AssignmentPattern") {
            this.raise(TSErrors.UnsupportedParameterPropertyKind, pp);
          }
          pp.parameter = elt;
          return this.finishNode(pp, "TSParameterProperty");
        }
        if (decorators.length) {
          left2.decorators = decorators;
        }
        return elt;
      }
      isSimpleParameter(node2) {
        return node2.type === "TSParameterProperty" && super.isSimpleParameter(node2.parameter) || super.isSimpleParameter(node2);
      }
      tsDisallowOptionalPattern(node2) {
        for (const param of node2.params) {
          if (param.type !== "Identifier" && param.optional && !this.state.isAmbientContext) {
            this.raise(TSErrors.PatternIsOptional, param);
          }
        }
      }
      setArrowFunctionParameters(node2, params, trailingCommaLoc) {
        super.setArrowFunctionParameters(node2, params, trailingCommaLoc);
        this.tsDisallowOptionalPattern(node2);
      }
      parseFunctionBodyAndFinish(node2, type, isMethod = false) {
        if (this.match(14)) {
          node2.returnType = this.tsParseTypeOrTypePredicateAnnotation(14);
        }
        const bodilessType = type === "FunctionDeclaration" ? "TSDeclareFunction" : type === "ClassMethod" || type === "ClassPrivateMethod" ? "TSDeclareMethod" : void 0;
        if (bodilessType && !this.match(5) && this.isLineTerminator()) {
          return this.finishNode(node2, bodilessType);
        }
        if (bodilessType === "TSDeclareFunction" && this.state.isAmbientContext) {
          this.raise(TSErrors.DeclareFunctionHasImplementation, node2);
          if (node2.declare) {
            return super.parseFunctionBodyAndFinish(node2, bodilessType, isMethod);
          }
        }
        this.tsDisallowOptionalPattern(node2);
        return super.parseFunctionBodyAndFinish(node2, type, isMethod);
      }
      registerFunctionStatementId(node2) {
        if (!node2.body && node2.id) {
          this.checkIdentifier(node2.id, 1024);
        } else {
          super.registerFunctionStatementId(node2);
        }
      }
      tsCheckForInvalidTypeCasts(items) {
        items.forEach((node2) => {
          if ((node2 == null ? void 0 : node2.type) === "TSTypeCastExpression") {
            this.raise(TSErrors.UnexpectedTypeAnnotation, node2.typeAnnotation);
          }
        });
      }
      toReferencedList(exprList, isInParens) {
        this.tsCheckForInvalidTypeCasts(exprList);
        return exprList;
      }
      parseArrayLike(close2, canBePattern, isTuple, refExpressionErrors) {
        const node2 = super.parseArrayLike(close2, canBePattern, isTuple, refExpressionErrors);
        if (node2.type === "ArrayExpression") {
          this.tsCheckForInvalidTypeCasts(node2.elements);
        }
        return node2;
      }
      parseSubscript(base, startLoc, noCalls, state2) {
        if (!this.hasPrecedingLineBreak() && this.match(35)) {
          this.state.canStartJSXElement = false;
          this.next();
          const nonNullExpression = this.startNodeAt(startLoc);
          nonNullExpression.expression = base;
          return this.finishNode(nonNullExpression, "TSNonNullExpression");
        }
        let isOptionalCall = false;
        if (this.match(18) && this.lookaheadCharCode() === 60) {
          if (noCalls) {
            state2.stop = true;
            return base;
          }
          state2.optionalChainMember = isOptionalCall = true;
          this.next();
        }
        if (this.match(47) || this.match(51)) {
          let missingParenErrorLoc;
          const result = this.tsTryParseAndCatch(() => {
            if (!noCalls && this.atPossibleAsyncArrow(base)) {
              const asyncArrowFn = this.tsTryParseGenericAsyncArrowFunction(startLoc);
              if (asyncArrowFn) {
                return asyncArrowFn;
              }
            }
            const typeArguments = this.tsParseTypeArgumentsInExpression();
            if (!typeArguments) return;
            if (isOptionalCall && !this.match(10)) {
              missingParenErrorLoc = this.state.curPosition();
              return;
            }
            if (tokenIsTemplate(this.state.type)) {
              const result2 = super.parseTaggedTemplateExpression(base, startLoc, state2);
              result2.typeParameters = typeArguments;
              return result2;
            }
            if (!noCalls && this.eat(10)) {
              const node3 = this.startNodeAt(startLoc);
              node3.callee = base;
              node3.arguments = this.parseCallExpressionArguments(11);
              this.tsCheckForInvalidTypeCasts(node3.arguments);
              node3.typeParameters = typeArguments;
              if (state2.optionalChainMember) {
                node3.optional = isOptionalCall;
              }
              return this.finishCallExpression(node3, state2.optionalChainMember);
            }
            const tokenType = this.state.type;
            if (tokenType === 48 || tokenType === 52 || tokenType !== 10 && tokenCanStartExpression(tokenType) && !this.hasPrecedingLineBreak()) {
              return;
            }
            const node2 = this.startNodeAt(startLoc);
            node2.expression = base;
            node2.typeParameters = typeArguments;
            return this.finishNode(node2, "TSInstantiationExpression");
          });
          if (missingParenErrorLoc) {
            this.unexpected(missingParenErrorLoc, 10);
          }
          if (result) {
            if (result.type === "TSInstantiationExpression" && (this.match(16) || this.match(18) && this.lookaheadCharCode() !== 40)) {
              this.raise(TSErrors.InvalidPropertyAccessAfterInstantiationExpression, this.state.startLoc);
            }
            return result;
          }
        }
        return super.parseSubscript(base, startLoc, noCalls, state2);
      }
      parseNewCallee(node2) {
        var _callee$extra;
        super.parseNewCallee(node2);
        const {
          callee
        } = node2;
        if (callee.type === "TSInstantiationExpression" && !((_callee$extra = callee.extra) != null && _callee$extra.parenthesized)) {
          node2.typeParameters = callee.typeParameters;
          node2.callee = callee.expression;
        }
      }
      parseExprOp(left2, leftStartLoc, minPrec) {
        let isSatisfies;
        if (tokenOperatorPrecedence(58) > minPrec && !this.hasPrecedingLineBreak() && (this.isContextual(93) || (isSatisfies = this.isContextual(120)))) {
          const node2 = this.startNodeAt(leftStartLoc);
          node2.expression = left2;
          node2.typeAnnotation = this.tsInType(() => {
            this.next();
            if (this.match(75)) {
              if (isSatisfies) {
                this.raise(Errors.UnexpectedKeyword, this.state.startLoc, {
                  keyword: "const"
                });
              }
              return this.tsParseTypeReference();
            }
            return this.tsParseType();
          });
          this.finishNode(node2, isSatisfies ? "TSSatisfiesExpression" : "TSAsExpression");
          this.reScan_lt_gt();
          return this.parseExprOp(node2, leftStartLoc, minPrec);
        }
        return super.parseExprOp(left2, leftStartLoc, minPrec);
      }
      checkReservedWord(word, startLoc, checkKeywords, isBinding) {
        if (!this.state.isAmbientContext) {
          super.checkReservedWord(word, startLoc, checkKeywords, isBinding);
        }
      }
      checkImportReflection(node2) {
        super.checkImportReflection(node2);
        if (node2.module && node2.importKind !== "value") {
          this.raise(TSErrors.ImportReflectionHasImportType, node2.specifiers[0].loc.start);
        }
      }
      checkDuplicateExports() {
      }
      isPotentialImportPhase(isExport) {
        if (super.isPotentialImportPhase(isExport)) return true;
        if (this.isContextual(130)) {
          const ch2 = this.lookaheadCharCode();
          return isExport ? ch2 === 123 || ch2 === 42 : ch2 !== 61;
        }
        return !isExport && this.isContextual(87);
      }
      applyImportPhase(node2, isExport, phase, loc) {
        super.applyImportPhase(node2, isExport, phase, loc);
        if (isExport) {
          node2.exportKind = phase === "type" ? "type" : "value";
        } else {
          node2.importKind = phase === "type" || phase === "typeof" ? phase : "value";
        }
      }
      parseImport(node2) {
        if (this.match(134)) {
          node2.importKind = "value";
          return super.parseImport(node2);
        }
        let importNode;
        if (tokenIsIdentifier(this.state.type) && this.lookaheadCharCode() === 61) {
          node2.importKind = "value";
          return this.tsParseImportEqualsDeclaration(node2);
        } else if (this.isContextual(130)) {
          const maybeDefaultIdentifier = this.parseMaybeImportPhase(node2, false);
          if (this.lookaheadCharCode() === 61) {
            return this.tsParseImportEqualsDeclaration(node2, maybeDefaultIdentifier);
          } else {
            importNode = super.parseImportSpecifiersAndAfter(node2, maybeDefaultIdentifier);
          }
        } else {
          importNode = super.parseImport(node2);
        }
        if (importNode.importKind === "type" && importNode.specifiers.length > 1 && importNode.specifiers[0].type === "ImportDefaultSpecifier") {
          this.raise(TSErrors.TypeImportCannotSpecifyDefaultAndNamed, importNode);
        }
        return importNode;
      }
      parseExport(node2, decorators) {
        if (this.match(83)) {
          this.next();
          const nodeImportEquals = node2;
          let maybeDefaultIdentifier = null;
          if (this.isContextual(130) && this.isPotentialImportPhase(false)) {
            maybeDefaultIdentifier = this.parseMaybeImportPhase(nodeImportEquals, false);
          } else {
            nodeImportEquals.importKind = "value";
          }
          return this.tsParseImportEqualsDeclaration(nodeImportEquals, maybeDefaultIdentifier, true);
        } else if (this.eat(29)) {
          const assign = node2;
          assign.expression = super.parseExpression();
          this.semicolon();
          this.sawUnambiguousESM = true;
          return this.finishNode(assign, "TSExportAssignment");
        } else if (this.eatContextual(93)) {
          const decl = node2;
          this.expectContextual(128);
          decl.id = this.parseIdentifier();
          this.semicolon();
          return this.finishNode(decl, "TSNamespaceExportDeclaration");
        } else {
          return super.parseExport(node2, decorators);
        }
      }
      isAbstractClass() {
        return this.isContextual(124) && this.lookahead().type === 80;
      }
      parseExportDefaultExpression() {
        if (this.isAbstractClass()) {
          const cls = this.startNode();
          this.next();
          cls.abstract = true;
          return this.parseClass(cls, true, true);
        }
        if (this.match(129)) {
          const result = this.tsParseInterfaceDeclaration(this.startNode());
          if (result) return result;
        }
        return super.parseExportDefaultExpression();
      }
      parseVarStatement(node2, kind2, allowMissingInitializer = false) {
        const {
          isAmbientContext
        } = this.state;
        const declaration = super.parseVarStatement(node2, kind2, allowMissingInitializer || isAmbientContext);
        if (!isAmbientContext) return declaration;
        for (const {
          id,
          init: init4
        } of declaration.declarations) {
          if (!init4) continue;
          if (kind2 !== "const" || !!id.typeAnnotation) {
            this.raise(TSErrors.InitializerNotAllowedInAmbientContext, init4);
          } else if (!isValidAmbientConstInitializer(init4, this.hasPlugin("estree"))) {
            this.raise(TSErrors.ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference, init4);
          }
        }
        return declaration;
      }
      parseStatementContent(flags2, decorators) {
        if (this.match(75) && this.isLookaheadContextual("enum")) {
          const node2 = this.startNode();
          this.expect(75);
          return this.tsParseEnumDeclaration(node2, {
            const: true
          });
        }
        if (this.isContextual(126)) {
          return this.tsParseEnumDeclaration(this.startNode());
        }
        if (this.isContextual(129)) {
          const result = this.tsParseInterfaceDeclaration(this.startNode());
          if (result) return result;
        }
        return super.parseStatementContent(flags2, decorators);
      }
      parseAccessModifier() {
        return this.tsParseModifier(["public", "protected", "private"]);
      }
      tsHasSomeModifiers(member, modifiers) {
        return modifiers.some((modifier) => {
          if (tsIsAccessModifier(modifier)) {
            return member.accessibility === modifier;
          }
          return !!member[modifier];
        });
      }
      tsIsStartOfStaticBlocks() {
        return this.isContextual(106) && this.lookaheadCharCode() === 123;
      }
      parseClassMember(classBody, member, state2) {
        const modifiers = ["declare", "private", "public", "protected", "override", "abstract", "readonly", "static"];
        this.tsParseModifiers({
          allowedModifiers: modifiers,
          disallowedModifiers: ["in", "out"],
          stopOnStartOfClassStaticBlock: true,
          errorTemplate: TSErrors.InvalidModifierOnTypeParameterPositions
        }, member);
        const callParseClassMemberWithIsStatic = /* @__PURE__ */ __name(() => {
          if (this.tsIsStartOfStaticBlocks()) {
            this.next();
            this.next();
            if (this.tsHasSomeModifiers(member, modifiers)) {
              this.raise(TSErrors.StaticBlockCannotHaveModifier, this.state.curPosition());
            }
            super.parseClassStaticBlock(classBody, member);
          } else {
            this.parseClassMemberWithIsStatic(classBody, member, state2, !!member.static);
          }
        }, "callParseClassMemberWithIsStatic");
        if (member.declare) {
          this.tsInAmbientContext(callParseClassMemberWithIsStatic);
        } else {
          callParseClassMemberWithIsStatic();
        }
      }
      parseClassMemberWithIsStatic(classBody, member, state2, isStatic) {
        const idx = this.tsTryParseIndexSignature(member);
        if (idx) {
          classBody.body.push(idx);
          if (member.abstract) {
            this.raise(TSErrors.IndexSignatureHasAbstract, member);
          }
          if (member.accessibility) {
            this.raise(TSErrors.IndexSignatureHasAccessibility, member, {
              modifier: member.accessibility
            });
          }
          if (member.declare) {
            this.raise(TSErrors.IndexSignatureHasDeclare, member);
          }
          if (member.override) {
            this.raise(TSErrors.IndexSignatureHasOverride, member);
          }
          return;
        }
        if (!this.state.inAbstractClass && member.abstract) {
          this.raise(TSErrors.NonAbstractClassHasAbstractMethod, member);
        }
        if (member.override) {
          if (!state2.hadSuperClass) {
            this.raise(TSErrors.OverrideNotInSubClass, member);
          }
        }
        super.parseClassMemberWithIsStatic(classBody, member, state2, isStatic);
      }
      parsePostMemberNameModifiers(methodOrProp) {
        const optional = this.eat(17);
        if (optional) methodOrProp.optional = true;
        if (methodOrProp.readonly && this.match(10)) {
          this.raise(TSErrors.ClassMethodHasReadonly, methodOrProp);
        }
        if (methodOrProp.declare && this.match(10)) {
          this.raise(TSErrors.ClassMethodHasDeclare, methodOrProp);
        }
      }
      parseExpressionStatement(node2, expr, decorators) {
        const decl = expr.type === "Identifier" ? this.tsParseExpressionStatement(node2, expr, decorators) : void 0;
        return decl || super.parseExpressionStatement(node2, expr, decorators);
      }
      shouldParseExportDeclaration() {
        if (this.tsIsDeclarationStart()) return true;
        return super.shouldParseExportDeclaration();
      }
      parseConditional(expr, startLoc, refExpressionErrors) {
        if (!this.state.maybeInArrowParameters || !this.match(17)) {
          return super.parseConditional(expr, startLoc, refExpressionErrors);
        }
        const result = this.tryParse(() => super.parseConditional(expr, startLoc));
        if (!result.node) {
          if (result.error) {
            super.setOptionalParametersError(refExpressionErrors, result.error);
          }
          return expr;
        }
        if (result.error) this.state = result.failState;
        return result.node;
      }
      parseParenItem(node2, startLoc) {
        const newNode = super.parseParenItem(node2, startLoc);
        if (this.eat(17)) {
          newNode.optional = true;
          this.resetEndLocation(node2);
        }
        if (this.match(14)) {
          const typeCastNode = this.startNodeAt(startLoc);
          typeCastNode.expression = node2;
          typeCastNode.typeAnnotation = this.tsParseTypeAnnotation();
          return this.finishNode(typeCastNode, "TSTypeCastExpression");
        }
        return node2;
      }
      parseExportDeclaration(node2) {
        if (!this.state.isAmbientContext && this.isContextual(125)) {
          return this.tsInAmbientContext(() => this.parseExportDeclaration(node2));
        }
        const startLoc = this.state.startLoc;
        const isDeclare = this.eatContextual(125);
        if (isDeclare && (this.isContextual(125) || !this.shouldParseExportDeclaration())) {
          throw this.raise(TSErrors.ExpectedAmbientAfterExportDeclare, this.state.startLoc);
        }
        const isIdentifier = tokenIsIdentifier(this.state.type);
        const declaration = isIdentifier && this.tsTryParseExportDeclaration() || super.parseExportDeclaration(node2);
        if (!declaration) return null;
        if (declaration.type === "TSInterfaceDeclaration" || declaration.type === "TSTypeAliasDeclaration" || isDeclare) {
          node2.exportKind = "type";
        }
        if (isDeclare) {
          this.resetStartLocation(declaration, startLoc);
          declaration.declare = true;
        }
        return declaration;
      }
      parseClassId(node2, isStatement, optionalId, bindingType) {
        if ((!isStatement || optionalId) && this.isContextual(113)) {
          return;
        }
        super.parseClassId(node2, isStatement, optionalId, node2.declare ? 1024 : 8331);
        const typeParameters = this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers);
        if (typeParameters) node2.typeParameters = typeParameters;
      }
      parseClassPropertyAnnotation(node2) {
        if (!node2.optional) {
          if (this.eat(35)) {
            node2.definite = true;
          } else if (this.eat(17)) {
            node2.optional = true;
          }
        }
        const type = this.tsTryParseTypeAnnotation();
        if (type) node2.typeAnnotation = type;
      }
      parseClassProperty(node2) {
        this.parseClassPropertyAnnotation(node2);
        if (this.state.isAmbientContext && !(node2.readonly && !node2.typeAnnotation) && this.match(29)) {
          this.raise(TSErrors.DeclareClassFieldHasInitializer, this.state.startLoc);
        }
        if (node2.abstract && this.match(29)) {
          const {
            key
          } = node2;
          this.raise(TSErrors.AbstractPropertyHasInitializer, this.state.startLoc, {
            propertyName: key.type === "Identifier" && !node2.computed ? key.name : `[${this.input.slice(this.offsetToSourcePos(key.start), this.offsetToSourcePos(key.end))}]`
          });
        }
        return super.parseClassProperty(node2);
      }
      parseClassPrivateProperty(node2) {
        if (node2.abstract) {
          this.raise(TSErrors.PrivateElementHasAbstract, node2);
        }
        if (node2.accessibility) {
          this.raise(TSErrors.PrivateElementHasAccessibility, node2, {
            modifier: node2.accessibility
          });
        }
        this.parseClassPropertyAnnotation(node2);
        return super.parseClassPrivateProperty(node2);
      }
      parseClassAccessorProperty(node2) {
        this.parseClassPropertyAnnotation(node2);
        if (node2.optional) {
          this.raise(TSErrors.AccessorCannotBeOptional, node2);
        }
        return super.parseClassAccessorProperty(node2);
      }
      pushClassMethod(classBody, method, isGenerator, isAsync4, isConstructor, allowsDirectSuper) {
        const typeParameters = this.tsTryParseTypeParameters(this.tsParseConstModifier);
        if (typeParameters && isConstructor) {
          this.raise(TSErrors.ConstructorHasTypeParameters, typeParameters);
        }
        const {
          declare = false,
          kind: kind2
        } = method;
        if (declare && (kind2 === "get" || kind2 === "set")) {
          this.raise(TSErrors.DeclareAccessor, method, {
            kind: kind2
          });
        }
        if (typeParameters) method.typeParameters = typeParameters;
        super.pushClassMethod(classBody, method, isGenerator, isAsync4, isConstructor, allowsDirectSuper);
      }
      pushClassPrivateMethod(classBody, method, isGenerator, isAsync4) {
        const typeParameters = this.tsTryParseTypeParameters(this.tsParseConstModifier);
        if (typeParameters) method.typeParameters = typeParameters;
        super.pushClassPrivateMethod(classBody, method, isGenerator, isAsync4);
      }
      declareClassPrivateMethodInScope(node2, kind2) {
        if (node2.type === "TSDeclareMethod") return;
        if (node2.type === "MethodDefinition" && !hasOwnProperty.call(node2.value, "body")) {
          return;
        }
        super.declareClassPrivateMethodInScope(node2, kind2);
      }
      parseClassSuper(node2) {
        super.parseClassSuper(node2);
        if (node2.superClass && (this.match(47) || this.match(51))) {
          node2.superTypeParameters = this.tsParseTypeArgumentsInExpression();
        }
        if (this.eatContextual(113)) {
          node2.implements = this.tsParseHeritageClause("implements");
        }
      }
      parseObjPropValue(prop, startLoc, isGenerator, isAsync4, isPattern, isAccessor, refExpressionErrors) {
        const typeParameters = this.tsTryParseTypeParameters(this.tsParseConstModifier);
        if (typeParameters) prop.typeParameters = typeParameters;
        return super.parseObjPropValue(prop, startLoc, isGenerator, isAsync4, isPattern, isAccessor, refExpressionErrors);
      }
      parseFunctionParams(node2, isConstructor) {
        const typeParameters = this.tsTryParseTypeParameters(this.tsParseConstModifier);
        if (typeParameters) node2.typeParameters = typeParameters;
        super.parseFunctionParams(node2, isConstructor);
      }
      parseVarId(decl, kind2) {
        super.parseVarId(decl, kind2);
        if (decl.id.type === "Identifier" && !this.hasPrecedingLineBreak() && this.eat(35)) {
          decl.definite = true;
        }
        const type = this.tsTryParseTypeAnnotation();
        if (type) {
          decl.id.typeAnnotation = type;
          this.resetEndLocation(decl.id);
        }
      }
      parseAsyncArrowFromCallExpression(node2, call) {
        if (this.match(14)) {
          node2.returnType = this.tsParseTypeAnnotation();
        }
        return super.parseAsyncArrowFromCallExpression(node2, call);
      }
      parseMaybeAssign(refExpressionErrors, afterLeftParse) {
        var _jsx, _jsx2, _typeCast, _jsx3, _typeCast2;
        let state2;
        let jsx2;
        let typeCast;
        if (this.hasPlugin("jsx") && (this.match(143) || this.match(47))) {
          state2 = this.state.clone();
          jsx2 = this.tryParse(() => super.parseMaybeAssign(refExpressionErrors, afterLeftParse), state2);
          if (!jsx2.error) return jsx2.node;
          const {
            context: context2
          } = this.state;
          const currentContext = context2[context2.length - 1];
          if (currentContext === types13.j_oTag || currentContext === types13.j_expr) {
            context2.pop();
          }
        }
        if (!((_jsx = jsx2) != null && _jsx.error) && !this.match(47)) {
          return super.parseMaybeAssign(refExpressionErrors, afterLeftParse);
        }
        if (!state2 || state2 === this.state) state2 = this.state.clone();
        let typeParameters;
        const arrow = this.tryParse((abort) => {
          var _expr$extra, _typeParameters;
          typeParameters = this.tsParseTypeParameters(this.tsParseConstModifier);
          const expr = super.parseMaybeAssign(refExpressionErrors, afterLeftParse);
          if (expr.type !== "ArrowFunctionExpression" || (_expr$extra = expr.extra) != null && _expr$extra.parenthesized) {
            abort();
          }
          if (((_typeParameters = typeParameters) == null ? void 0 : _typeParameters.params.length) !== 0) {
            this.resetStartLocationFromNode(expr, typeParameters);
          }
          expr.typeParameters = typeParameters;
          return expr;
        }, state2);
        if (!arrow.error && !arrow.aborted) {
          if (typeParameters) this.reportReservedArrowTypeParam(typeParameters);
          return arrow.node;
        }
        if (!jsx2) {
          assert61(!this.hasPlugin("jsx"));
          typeCast = this.tryParse(() => super.parseMaybeAssign(refExpressionErrors, afterLeftParse), state2);
          if (!typeCast.error) return typeCast.node;
        }
        if ((_jsx2 = jsx2) != null && _jsx2.node) {
          this.state = jsx2.failState;
          return jsx2.node;
        }
        if (arrow.node) {
          this.state = arrow.failState;
          if (typeParameters) this.reportReservedArrowTypeParam(typeParameters);
          return arrow.node;
        }
        if ((_typeCast = typeCast) != null && _typeCast.node) {
          this.state = typeCast.failState;
          return typeCast.node;
        }
        throw ((_jsx3 = jsx2) == null ? void 0 : _jsx3.error) || arrow.error || ((_typeCast2 = typeCast) == null ? void 0 : _typeCast2.error);
      }
      reportReservedArrowTypeParam(node2) {
        var _node$extra;
        if (node2.params.length === 1 && !node2.params[0].constraint && !((_node$extra = node2.extra) != null && _node$extra.trailingComma) && this.getPluginOption("typescript", "disallowAmbiguousJSXLike")) {
          this.raise(TSErrors.ReservedArrowTypeParam, node2);
        }
      }
      parseMaybeUnary(refExpressionErrors, sawUnary) {
        if (!this.hasPlugin("jsx") && this.match(47)) {
          return this.tsParseTypeAssertion();
        }
        return super.parseMaybeUnary(refExpressionErrors, sawUnary);
      }
      parseArrow(node2) {
        if (this.match(14)) {
          const result = this.tryParse((abort) => {
            const returnType = this.tsParseTypeOrTypePredicateAnnotation(14);
            if (this.canInsertSemicolon() || !this.match(19)) abort();
            return returnType;
          });
          if (result.aborted) return;
          if (!result.thrown) {
            if (result.error) this.state = result.failState;
            node2.returnType = result.node;
          }
        }
        return super.parseArrow(node2);
      }
      parseFunctionParamType(param) {
        if (this.eat(17)) {
          param.optional = true;
        }
        const type = this.tsTryParseTypeAnnotation();
        if (type) param.typeAnnotation = type;
        this.resetEndLocation(param);
        return param;
      }
      isAssignable(node2, isBinding) {
        switch (node2.type) {
          case "TSTypeCastExpression":
            return this.isAssignable(node2.expression, isBinding);
          case "TSParameterProperty":
            return true;
          default:
            return super.isAssignable(node2, isBinding);
        }
      }
      toAssignable(node2, isLHS = false) {
        switch (node2.type) {
          case "ParenthesizedExpression":
            this.toAssignableParenthesizedExpression(node2, isLHS);
            break;
          case "TSAsExpression":
          case "TSSatisfiesExpression":
          case "TSNonNullExpression":
          case "TSTypeAssertion":
            if (isLHS) {
              this.expressionScope.recordArrowParameterBindingError(TSErrors.UnexpectedTypeCastInParameter, node2);
            } else {
              this.raise(TSErrors.UnexpectedTypeCastInParameter, node2);
            }
            this.toAssignable(node2.expression, isLHS);
            break;
          case "AssignmentExpression":
            if (!isLHS && node2.left.type === "TSTypeCastExpression") {
              node2.left = this.typeCastToParameter(node2.left);
            }
          default:
            super.toAssignable(node2, isLHS);
        }
      }
      toAssignableParenthesizedExpression(node2, isLHS) {
        switch (node2.expression.type) {
          case "TSAsExpression":
          case "TSSatisfiesExpression":
          case "TSNonNullExpression":
          case "TSTypeAssertion":
          case "ParenthesizedExpression":
            this.toAssignable(node2.expression, isLHS);
            break;
          default:
            super.toAssignable(node2, isLHS);
        }
      }
      checkToRestConversion(node2, allowPattern) {
        switch (node2.type) {
          case "TSAsExpression":
          case "TSSatisfiesExpression":
          case "TSTypeAssertion":
          case "TSNonNullExpression":
            this.checkToRestConversion(node2.expression, false);
            break;
          default:
            super.checkToRestConversion(node2, allowPattern);
        }
      }
      isValidLVal(type, isUnparenthesizedInAssign, binding) {
        switch (type) {
          case "TSTypeCastExpression":
            return true;
          case "TSParameterProperty":
            return "parameter";
          case "TSNonNullExpression":
          case "TSInstantiationExpression":
            return "expression";
          case "TSAsExpression":
          case "TSSatisfiesExpression":
          case "TSTypeAssertion":
            return (binding !== 64 || !isUnparenthesizedInAssign) && ["expression", true];
          default:
            return super.isValidLVal(type, isUnparenthesizedInAssign, binding);
        }
      }
      parseBindingAtom() {
        if (this.state.type === 78) {
          return this.parseIdentifier(true);
        }
        return super.parseBindingAtom();
      }
      parseMaybeDecoratorArguments(expr) {
        if (this.match(47) || this.match(51)) {
          const typeArguments = this.tsParseTypeArgumentsInExpression();
          if (this.match(10)) {
            const call = super.parseMaybeDecoratorArguments(expr);
            call.typeParameters = typeArguments;
            return call;
          }
          this.unexpected(null, 10);
        }
        return super.parseMaybeDecoratorArguments(expr);
      }
      checkCommaAfterRest(close2) {
        if (this.state.isAmbientContext && this.match(12) && this.lookaheadCharCode() === close2) {
          this.next();
          return false;
        }
        return super.checkCommaAfterRest(close2);
      }
      isClassMethod() {
        return this.match(47) || super.isClassMethod();
      }
      isClassProperty() {
        return this.match(35) || this.match(14) || super.isClassProperty();
      }
      parseMaybeDefault(startLoc, left2) {
        const node2 = super.parseMaybeDefault(startLoc, left2);
        if (node2.type === "AssignmentPattern" && node2.typeAnnotation && node2.right.start < node2.typeAnnotation.start) {
          this.raise(TSErrors.TypeAnnotationAfterAssign, node2.typeAnnotation);
        }
        return node2;
      }
      getTokenFromCode(code2) {
        if (this.state.inType) {
          if (code2 === 62) {
            this.finishOp(48, 1);
            return;
          }
          if (code2 === 60) {
            this.finishOp(47, 1);
            return;
          }
        }
        super.getTokenFromCode(code2);
      }
      reScan_lt_gt() {
        const {
          type
        } = this.state;
        if (type === 47) {
          this.state.pos -= 1;
          this.readToken_lt();
        } else if (type === 48) {
          this.state.pos -= 1;
          this.readToken_gt();
        }
      }
      reScan_lt() {
        const {
          type
        } = this.state;
        if (type === 51) {
          this.state.pos -= 2;
          this.finishOp(47, 1);
          return 47;
        }
        return type;
      }
      toAssignableList(exprList, trailingCommaLoc, isLHS) {
        for (let i7 = 0; i7 < exprList.length; i7++) {
          const expr = exprList[i7];
          if ((expr == null ? void 0 : expr.type) === "TSTypeCastExpression") {
            exprList[i7] = this.typeCastToParameter(expr);
          }
        }
        super.toAssignableList(exprList, trailingCommaLoc, isLHS);
      }
      typeCastToParameter(node2) {
        node2.expression.typeAnnotation = node2.typeAnnotation;
        this.resetEndLocation(node2.expression, node2.typeAnnotation.loc.end);
        return node2.expression;
      }
      shouldParseArrow(params) {
        if (this.match(14)) {
          return params.every((expr) => this.isAssignable(expr, true));
        }
        return super.shouldParseArrow(params);
      }
      shouldParseAsyncArrow() {
        return this.match(14) || super.shouldParseAsyncArrow();
      }
      canHaveLeadingDecorator() {
        return super.canHaveLeadingDecorator() || this.isAbstractClass();
      }
      jsxParseOpeningElementAfterName(node2) {
        if (this.match(47) || this.match(51)) {
          const typeArguments = this.tsTryParseAndCatch(() => this.tsParseTypeArgumentsInExpression());
          if (typeArguments) node2.typeParameters = typeArguments;
        }
        return super.jsxParseOpeningElementAfterName(node2);
      }
      getGetterSetterExpectedParamCount(method) {
        const baseCount = super.getGetterSetterExpectedParamCount(method);
        const params = this.getObjectOrClassMethodParams(method);
        const firstParam = params[0];
        const hasContextParam = firstParam && this.isThisParam(firstParam);
        return hasContextParam ? baseCount + 1 : baseCount;
      }
      parseCatchClauseParam() {
        const param = super.parseCatchClauseParam();
        const type = this.tsTryParseTypeAnnotation();
        if (type) {
          param.typeAnnotation = type;
          this.resetEndLocation(param);
        }
        return param;
      }
      tsInAmbientContext(cb2) {
        const {
          isAmbientContext: oldIsAmbientContext,
          strict: oldStrict
        } = this.state;
        this.state.isAmbientContext = true;
        this.state.strict = false;
        try {
          return cb2();
        } finally {
          this.state.isAmbientContext = oldIsAmbientContext;
          this.state.strict = oldStrict;
        }
      }
      parseClass(node2, isStatement, optionalId) {
        const oldInAbstractClass = this.state.inAbstractClass;
        this.state.inAbstractClass = !!node2.abstract;
        try {
          return super.parseClass(node2, isStatement, optionalId);
        } finally {
          this.state.inAbstractClass = oldInAbstractClass;
        }
      }
      tsParseAbstractDeclaration(node2, decorators) {
        if (this.match(80)) {
          node2.abstract = true;
          return this.maybeTakeDecorators(decorators, this.parseClass(node2, true, false));
        } else if (this.isContextual(129)) {
          if (!this.hasFollowingLineBreak()) {
            node2.abstract = true;
            this.raise(TSErrors.NonClassMethodPropertyHasAbstractModifer, node2);
            return this.tsParseInterfaceDeclaration(node2);
          }
        } else {
          this.unexpected(null, 80);
        }
      }
      parseMethod(node2, isGenerator, isAsync4, isConstructor, allowDirectSuper, type, inClassScope) {
        const method = super.parseMethod(node2, isGenerator, isAsync4, isConstructor, allowDirectSuper, type, inClassScope);
        if (method.abstract) {
          const hasBody = this.hasPlugin("estree") ? !!method.value.body : !!method.body;
          if (hasBody) {
            const {
              key
            } = method;
            this.raise(TSErrors.AbstractMethodHasImplementation, method, {
              methodName: key.type === "Identifier" && !method.computed ? key.name : `[${this.input.slice(this.offsetToSourcePos(key.start), this.offsetToSourcePos(key.end))}]`
            });
          }
        }
        return method;
      }
      tsParseTypeParameterName() {
        const typeName = this.parseIdentifier();
        return typeName.name;
      }
      shouldParseAsAmbientContext() {
        return !!this.getPluginOption("typescript", "dts");
      }
      parse() {
        if (this.shouldParseAsAmbientContext()) {
          this.state.isAmbientContext = true;
        }
        return super.parse();
      }
      getExpression() {
        if (this.shouldParseAsAmbientContext()) {
          this.state.isAmbientContext = true;
        }
        return super.getExpression();
      }
      parseExportSpecifier(node2, isString5, isInTypeExport, isMaybeTypeOnly) {
        if (!isString5 && isMaybeTypeOnly) {
          this.parseTypeOnlyImportExportSpecifier(node2, false, isInTypeExport);
          return this.finishNode(node2, "ExportSpecifier");
        }
        node2.exportKind = "value";
        return super.parseExportSpecifier(node2, isString5, isInTypeExport, isMaybeTypeOnly);
      }
      parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly, bindingType) {
        if (!importedIsString && isMaybeTypeOnly) {
          this.parseTypeOnlyImportExportSpecifier(specifier, true, isInTypeOnlyImport);
          return this.finishNode(specifier, "ImportSpecifier");
        }
        specifier.importKind = "value";
        return super.parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly, isInTypeOnlyImport ? 4098 : 4096);
      }
      parseTypeOnlyImportExportSpecifier(node2, isImport, isInTypeOnlyImportExport) {
        const leftOfAsKey = isImport ? "imported" : "local";
        const rightOfAsKey = isImport ? "local" : "exported";
        let leftOfAs = node2[leftOfAsKey];
        let rightOfAs;
        let hasTypeSpecifier = false;
        let canParseAsKeyword = true;
        const loc = leftOfAs.loc.start;
        if (this.isContextual(93)) {
          const firstAs = this.parseIdentifier();
          if (this.isContextual(93)) {
            const secondAs = this.parseIdentifier();
            if (tokenIsKeywordOrIdentifier(this.state.type)) {
              hasTypeSpecifier = true;
              leftOfAs = firstAs;
              rightOfAs = isImport ? this.parseIdentifier() : this.parseModuleExportName();
              canParseAsKeyword = false;
            } else {
              rightOfAs = secondAs;
              canParseAsKeyword = false;
            }
          } else if (tokenIsKeywordOrIdentifier(this.state.type)) {
            canParseAsKeyword = false;
            rightOfAs = isImport ? this.parseIdentifier() : this.parseModuleExportName();
          } else {
            hasTypeSpecifier = true;
            leftOfAs = firstAs;
          }
        } else if (tokenIsKeywordOrIdentifier(this.state.type)) {
          hasTypeSpecifier = true;
          if (isImport) {
            leftOfAs = this.parseIdentifier(true);
            if (!this.isContextual(93)) {
              this.checkReservedWord(leftOfAs.name, leftOfAs.loc.start, true, true);
            }
          } else {
            leftOfAs = this.parseModuleExportName();
          }
        }
        if (hasTypeSpecifier && isInTypeOnlyImportExport) {
          this.raise(isImport ? TSErrors.TypeModifierIsUsedInTypeImports : TSErrors.TypeModifierIsUsedInTypeExports, loc);
        }
        node2[leftOfAsKey] = leftOfAs;
        node2[rightOfAsKey] = rightOfAs;
        const kindKey = isImport ? "importKind" : "exportKind";
        node2[kindKey] = hasTypeSpecifier ? "type" : "value";
        if (canParseAsKeyword && this.eatContextual(93)) {
          node2[rightOfAsKey] = isImport ? this.parseIdentifier() : this.parseModuleExportName();
        }
        if (!node2[rightOfAsKey]) {
          node2[rightOfAsKey] = cloneIdentifier(node2[leftOfAsKey]);
        }
        if (isImport) {
          this.checkIdentifier(node2[rightOfAsKey], hasTypeSpecifier ? 4098 : 4096);
        }
      }
    }, "typescript");
    function isPossiblyLiteralEnum(expression) {
      if (expression.type !== "MemberExpression") return false;
      const {
        computed,
        property
      } = expression;
      if (computed && property.type !== "StringLiteral" && (property.type !== "TemplateLiteral" || property.expressions.length > 0)) {
        return false;
      }
      return isUncomputedMemberExpressionChain(expression.object);
    }
    __name(isPossiblyLiteralEnum, "isPossiblyLiteralEnum");
    function isValidAmbientConstInitializer(expression, estree2) {
      var _expression$extra;
      const {
        type
      } = expression;
      if ((_expression$extra = expression.extra) != null && _expression$extra.parenthesized) {
        return false;
      }
      if (estree2) {
        if (type === "Literal") {
          const {
            value
          } = expression;
          if (typeof value === "string" || typeof value === "boolean") {
            return true;
          }
        }
      } else {
        if (type === "StringLiteral" || type === "BooleanLiteral") {
          return true;
        }
      }
      if (isNumber(expression, estree2) || isNegativeNumber(expression, estree2)) {
        return true;
      }
      if (type === "TemplateLiteral" && expression.expressions.length === 0) {
        return true;
      }
      if (isPossiblyLiteralEnum(expression)) {
        return true;
      }
      return false;
    }
    __name(isValidAmbientConstInitializer, "isValidAmbientConstInitializer");
    function isNumber(expression, estree2) {
      if (estree2) {
        return expression.type === "Literal" && (typeof expression.value === "number" || "bigint" in expression);
      }
      return expression.type === "NumericLiteral" || expression.type === "BigIntLiteral";
    }
    __name(isNumber, "isNumber");
    function isNegativeNumber(expression, estree2) {
      if (expression.type === "UnaryExpression") {
        const {
          operator,
          argument
        } = expression;
        if (operator === "-" && isNumber(argument, estree2)) {
          return true;
        }
      }
      return false;
    }
    __name(isNegativeNumber, "isNegativeNumber");
    function isUncomputedMemberExpressionChain(expression) {
      if (expression.type === "Identifier") return true;
      if (expression.type !== "MemberExpression" || expression.computed) {
        return false;
      }
      return isUncomputedMemberExpressionChain(expression.object);
    }
    __name(isUncomputedMemberExpressionChain, "isUncomputedMemberExpressionChain");
    var PlaceholderErrors = ParseErrorEnum`placeholders`({
      ClassNameIsRequired: "A class name is required.",
      UnexpectedSpace: "Unexpected space in placeholder."
    });
    var placeholders = /* @__PURE__ */ __name((superClass) => class PlaceholdersParserMixin extends superClass {
      static {
        __name(this, "PlaceholdersParserMixin");
      }
      parsePlaceholder(expectedNode) {
        if (this.match(133)) {
          const node2 = this.startNode();
          this.next();
          this.assertNoSpace();
          node2.name = super.parseIdentifier(true);
          this.assertNoSpace();
          this.expect(133);
          return this.finishPlaceholder(node2, expectedNode);
        }
      }
      finishPlaceholder(node2, expectedNode) {
        let placeholder = node2;
        if (!placeholder.expectedNode || !placeholder.type) {
          placeholder = this.finishNode(placeholder, "Placeholder");
        }
        placeholder.expectedNode = expectedNode;
        return placeholder;
      }
      getTokenFromCode(code2) {
        if (code2 === 37 && this.input.charCodeAt(this.state.pos + 1) === 37) {
          this.finishOp(133, 2);
        } else {
          super.getTokenFromCode(code2);
        }
      }
      parseExprAtom(refExpressionErrors) {
        return this.parsePlaceholder("Expression") || super.parseExprAtom(refExpressionErrors);
      }
      parseIdentifier(liberal) {
        return this.parsePlaceholder("Identifier") || super.parseIdentifier(liberal);
      }
      checkReservedWord(word, startLoc, checkKeywords, isBinding) {
        if (word !== void 0) {
          super.checkReservedWord(word, startLoc, checkKeywords, isBinding);
        }
      }
      parseBindingAtom() {
        return this.parsePlaceholder("Pattern") || super.parseBindingAtom();
      }
      isValidLVal(type, isParenthesized, binding) {
        return type === "Placeholder" || super.isValidLVal(type, isParenthesized, binding);
      }
      toAssignable(node2, isLHS) {
        if (node2 && node2.type === "Placeholder" && node2.expectedNode === "Expression") {
          node2.expectedNode = "Pattern";
        } else {
          super.toAssignable(node2, isLHS);
        }
      }
      chStartsBindingIdentifier(ch2, pos) {
        if (super.chStartsBindingIdentifier(ch2, pos)) {
          return true;
        }
        const nextToken = this.lookahead();
        if (nextToken.type === 133) {
          return true;
        }
        return false;
      }
      verifyBreakContinue(node2, isBreak) {
        if (node2.label && node2.label.type === "Placeholder") return;
        super.verifyBreakContinue(node2, isBreak);
      }
      parseExpressionStatement(node2, expr) {
        var _expr$extra;
        if (expr.type !== "Placeholder" || (_expr$extra = expr.extra) != null && _expr$extra.parenthesized) {
          return super.parseExpressionStatement(node2, expr);
        }
        if (this.match(14)) {
          const stmt = node2;
          stmt.label = this.finishPlaceholder(expr, "Identifier");
          this.next();
          stmt.body = super.parseStatementOrSloppyAnnexBFunctionDeclaration();
          return this.finishNode(stmt, "LabeledStatement");
        }
        this.semicolon();
        const stmtPlaceholder = node2;
        stmtPlaceholder.name = expr.name;
        return this.finishPlaceholder(stmtPlaceholder, "Statement");
      }
      parseBlock(allowDirectives, createNewLexicalScope, afterBlockParse) {
        return this.parsePlaceholder("BlockStatement") || super.parseBlock(allowDirectives, createNewLexicalScope, afterBlockParse);
      }
      parseFunctionId(requireId) {
        return this.parsePlaceholder("Identifier") || super.parseFunctionId(requireId);
      }
      parseClass(node2, isStatement, optionalId) {
        const type = isStatement ? "ClassDeclaration" : "ClassExpression";
        this.next();
        const oldStrict = this.state.strict;
        const placeholder = this.parsePlaceholder("Identifier");
        if (placeholder) {
          if (this.match(81) || this.match(133) || this.match(5)) {
            node2.id = placeholder;
          } else if (optionalId || !isStatement) {
            node2.id = null;
            node2.body = this.finishPlaceholder(placeholder, "ClassBody");
            return this.finishNode(node2, type);
          } else {
            throw this.raise(PlaceholderErrors.ClassNameIsRequired, this.state.startLoc);
          }
        } else {
          this.parseClassId(node2, isStatement, optionalId);
        }
        super.parseClassSuper(node2);
        node2.body = this.parsePlaceholder("ClassBody") || super.parseClassBody(!!node2.superClass, oldStrict);
        return this.finishNode(node2, type);
      }
      parseExport(node2, decorators) {
        const placeholder = this.parsePlaceholder("Identifier");
        if (!placeholder) return super.parseExport(node2, decorators);
        const node22 = node2;
        if (!this.isContextual(98) && !this.match(12)) {
          node22.specifiers = [];
          node22.source = null;
          node22.declaration = this.finishPlaceholder(placeholder, "Declaration");
          return this.finishNode(node22, "ExportNamedDeclaration");
        }
        this.expectPlugin("exportDefaultFrom");
        const specifier = this.startNode();
        specifier.exported = placeholder;
        node22.specifiers = [this.finishNode(specifier, "ExportDefaultSpecifier")];
        return super.parseExport(node22, decorators);
      }
      isExportDefaultSpecifier() {
        if (this.match(65)) {
          const next = this.nextTokenStart();
          if (this.isUnparsedContextual(next, "from")) {
            if (this.input.startsWith(tokenLabelName(133), this.nextTokenStartSince(next + 4))) {
              return true;
            }
          }
        }
        return super.isExportDefaultSpecifier();
      }
      maybeParseExportDefaultSpecifier(node2, maybeDefaultIdentifier) {
        var _specifiers;
        if ((_specifiers = node2.specifiers) != null && _specifiers.length) {
          return true;
        }
        return super.maybeParseExportDefaultSpecifier(node2, maybeDefaultIdentifier);
      }
      checkExport(node2) {
        const {
          specifiers
        } = node2;
        if (specifiers != null && specifiers.length) {
          node2.specifiers = specifiers.filter((node3) => node3.exported.type === "Placeholder");
        }
        super.checkExport(node2);
        node2.specifiers = specifiers;
      }
      parseImport(node2) {
        const placeholder = this.parsePlaceholder("Identifier");
        if (!placeholder) return super.parseImport(node2);
        node2.specifiers = [];
        if (!this.isContextual(98) && !this.match(12)) {
          node2.source = this.finishPlaceholder(placeholder, "StringLiteral");
          this.semicolon();
          return this.finishNode(node2, "ImportDeclaration");
        }
        const specifier = this.startNodeAtNode(placeholder);
        specifier.local = placeholder;
        node2.specifiers.push(this.finishNode(specifier, "ImportDefaultSpecifier"));
        if (this.eat(12)) {
          const hasStarImport = this.maybeParseStarImportSpecifier(node2);
          if (!hasStarImport) this.parseNamedImportSpecifiers(node2);
        }
        this.expectContextual(98);
        node2.source = this.parseImportSource();
        this.semicolon();
        return this.finishNode(node2, "ImportDeclaration");
      }
      parseImportSource() {
        return this.parsePlaceholder("StringLiteral") || super.parseImportSource();
      }
      assertNoSpace() {
        if (this.state.start > this.offsetToSourcePos(this.state.lastTokEndLoc.index)) {
          this.raise(PlaceholderErrors.UnexpectedSpace, this.state.lastTokEndLoc);
        }
      }
    }, "placeholders");
    var v8intrinsic = /* @__PURE__ */ __name((superClass) => class V8IntrinsicMixin extends superClass {
      static {
        __name(this, "V8IntrinsicMixin");
      }
      parseV8Intrinsic() {
        if (this.match(54)) {
          const v8IntrinsicStartLoc = this.state.startLoc;
          const node2 = this.startNode();
          this.next();
          if (tokenIsIdentifier(this.state.type)) {
            const name2 = this.parseIdentifierName();
            const identifier = this.createIdentifier(node2, name2);
            identifier.type = "V8IntrinsicIdentifier";
            if (this.match(10)) {
              return identifier;
            }
          }
          this.unexpected(v8IntrinsicStartLoc);
        }
      }
      parseExprAtom(refExpressionErrors) {
        return this.parseV8Intrinsic() || super.parseExprAtom(refExpressionErrors);
      }
    }, "v8intrinsic");
    var PIPELINE_PROPOSALS = ["minimal", "fsharp", "hack", "smart"];
    var TOPIC_TOKENS = ["^^", "@@", "^", "%", "#"];
    function validatePlugins(pluginsMap) {
      if (pluginsMap.has("decorators")) {
        if (pluginsMap.has("decorators-legacy")) {
          throw new Error("Cannot use the decorators and decorators-legacy plugin together");
        }
        const decoratorsBeforeExport = pluginsMap.get("decorators").decoratorsBeforeExport;
        if (decoratorsBeforeExport != null && typeof decoratorsBeforeExport !== "boolean") {
          throw new Error("'decoratorsBeforeExport' must be a boolean, if specified.");
        }
        const allowCallParenthesized = pluginsMap.get("decorators").allowCallParenthesized;
        if (allowCallParenthesized != null && typeof allowCallParenthesized !== "boolean") {
          throw new Error("'allowCallParenthesized' must be a boolean.");
        }
      }
      if (pluginsMap.has("flow") && pluginsMap.has("typescript")) {
        throw new Error("Cannot combine flow and typescript plugins.");
      }
      if (pluginsMap.has("placeholders") && pluginsMap.has("v8intrinsic")) {
        throw new Error("Cannot combine placeholders and v8intrinsic plugins.");
      }
      if (pluginsMap.has("pipelineOperator")) {
        var _pluginsMap$get;
        const proposal = pluginsMap.get("pipelineOperator").proposal;
        if (!PIPELINE_PROPOSALS.includes(proposal)) {
          const proposalList = PIPELINE_PROPOSALS.map((p7) => `"${p7}"`).join(", ");
          throw new Error(`"pipelineOperator" requires "proposal" option whose value must be one of: ${proposalList}.`);
        }
        const tupleSyntaxIsHash = ((_pluginsMap$get = pluginsMap.get("recordAndTuple")) == null ? void 0 : _pluginsMap$get.syntaxType) === "hash";
        if (proposal === "hack") {
          if (pluginsMap.has("placeholders")) {
            throw new Error("Cannot combine placeholders plugin and Hack-style pipes.");
          }
          if (pluginsMap.has("v8intrinsic")) {
            throw new Error("Cannot combine v8intrinsic plugin and Hack-style pipes.");
          }
          const topicToken = pluginsMap.get("pipelineOperator").topicToken;
          if (!TOPIC_TOKENS.includes(topicToken)) {
            const tokenList = TOPIC_TOKENS.map((t13) => `"${t13}"`).join(", ");
            throw new Error(`"pipelineOperator" in "proposal": "hack" mode also requires a "topicToken" option whose value must be one of: ${tokenList}.`);
          }
          if (topicToken === "#" && tupleSyntaxIsHash) {
            throw new Error(`Plugin conflict between \`["pipelineOperator", { proposal: "hack", topicToken: "#" }]\` and \`${JSON.stringify(["recordAndTuple", pluginsMap.get("recordAndTuple")])}\`.`);
          }
        } else if (proposal === "smart" && tupleSyntaxIsHash) {
          throw new Error(`Plugin conflict between \`["pipelineOperator", { proposal: "smart" }]\` and \`${JSON.stringify(["recordAndTuple", pluginsMap.get("recordAndTuple")])}\`.`);
        }
      }
      if (pluginsMap.has("moduleAttributes")) {
        {
          if (pluginsMap.has("deprecatedImportAssert") || pluginsMap.has("importAssertions")) {
            throw new Error("Cannot combine importAssertions, deprecatedImportAssert and moduleAttributes plugins.");
          }
          const moduleAttributesVersionPluginOption = pluginsMap.get("moduleAttributes").version;
          if (moduleAttributesVersionPluginOption !== "may-2020") {
            throw new Error("The 'moduleAttributes' plugin requires a 'version' option, representing the last proposal update. Currently, the only supported value is 'may-2020'.");
          }
        }
      }
      if (pluginsMap.has("importAssertions")) {
        if (pluginsMap.has("deprecatedImportAssert")) {
          throw new Error("Cannot combine importAssertions and deprecatedImportAssert plugins.");
        }
      }
      if (!pluginsMap.has("deprecatedImportAssert") && pluginsMap.has("importAttributes") && pluginsMap.get("importAttributes").deprecatedAssertSyntax) {
        {
          pluginsMap.set("deprecatedImportAssert", {});
        }
      }
      if (pluginsMap.has("recordAndTuple")) {
        const syntaxType = pluginsMap.get("recordAndTuple").syntaxType;
        if (syntaxType != null) {
          {
            const RECORD_AND_TUPLE_SYNTAX_TYPES = ["hash", "bar"];
            if (!RECORD_AND_TUPLE_SYNTAX_TYPES.includes(syntaxType)) {
              throw new Error("The 'syntaxType' option of the 'recordAndTuple' plugin must be one of: " + RECORD_AND_TUPLE_SYNTAX_TYPES.map((p7) => `'${p7}'`).join(", "));
            }
          }
        }
      }
      if (pluginsMap.has("asyncDoExpressions") && !pluginsMap.has("doExpressions")) {
        const error2 = new Error("'asyncDoExpressions' requires 'doExpressions', please add 'doExpressions' to parser plugins.");
        error2.missingPlugins = "doExpressions";
        throw error2;
      }
      if (pluginsMap.has("optionalChainingAssign") && pluginsMap.get("optionalChainingAssign").version !== "2023-07") {
        throw new Error("The 'optionalChainingAssign' plugin requires a 'version' option, representing the last proposal update. Currently, the only supported value is '2023-07'.");
      }
    }
    __name(validatePlugins, "validatePlugins");
    var mixinPlugins = {
      estree,
      jsx,
      flow,
      typescript,
      v8intrinsic,
      placeholders
    };
    var mixinPluginNames = Object.keys(mixinPlugins);
    function createDefaultOptions() {
      return {
        sourceType: "script",
        sourceFilename: void 0,
        startIndex: 0,
        startColumn: 0,
        startLine: 1,
        allowAwaitOutsideFunction: false,
        allowReturnOutsideFunction: false,
        allowNewTargetOutsideFunction: false,
        allowImportExportEverywhere: false,
        allowSuperOutsideMethod: false,
        allowUndeclaredExports: false,
        plugins: [],
        strictMode: null,
        ranges: false,
        tokens: false,
        createImportExpressions: false,
        createParenthesizedExpressions: false,
        errorRecovery: false,
        attachComment: true,
        annexB: true
      };
    }
    __name(createDefaultOptions, "createDefaultOptions");
    function getOptions(opts) {
      const options = createDefaultOptions();
      if (opts == null) {
        return options;
      }
      if (opts.annexB != null && opts.annexB !== false) {
        throw new Error("The `annexB` option can only be set to `false`.");
      }
      for (const key of Object.keys(options)) {
        if (opts[key] != null) options[key] = opts[key];
      }
      if (options.startLine === 1) {
        if (opts.startIndex == null && options.startColumn > 0) {
          options.startIndex = options.startColumn;
        } else if (opts.startColumn == null && options.startIndex > 0) {
          options.startColumn = options.startIndex;
        }
      } else if (opts.startColumn == null || opts.startIndex == null) {
        if (opts.startIndex != null) {
          throw new Error("With a `startLine > 1` you must also specify `startIndex` and `startColumn`.");
        }
      }
      return options;
    }
    __name(getOptions, "getOptions");
    var ExpressionParser = class extends LValParser {
      static {
        __name(this, "ExpressionParser");
      }
      checkProto(prop, isRecord2, protoRef, refExpressionErrors) {
        if (prop.type === "SpreadElement" || this.isObjectMethod(prop) || prop.computed || prop.shorthand) {
          return;
        }
        const key = prop.key;
        const name2 = key.type === "Identifier" ? key.name : key.value;
        if (name2 === "__proto__") {
          if (isRecord2) {
            this.raise(Errors.RecordNoProto, key);
            return;
          }
          if (protoRef.used) {
            if (refExpressionErrors) {
              if (refExpressionErrors.doubleProtoLoc === null) {
                refExpressionErrors.doubleProtoLoc = key.loc.start;
              }
            } else {
              this.raise(Errors.DuplicateProto, key);
            }
          }
          protoRef.used = true;
        }
      }
      shouldExitDescending(expr, potentialArrowAt) {
        return expr.type === "ArrowFunctionExpression" && this.offsetToSourcePos(expr.start) === potentialArrowAt;
      }
      getExpression() {
        this.enterInitialScopes();
        this.nextToken();
        const expr = this.parseExpression();
        if (!this.match(140)) {
          this.unexpected();
        }
        this.finalizeRemainingComments();
        expr.comments = this.comments;
        expr.errors = this.state.errors;
        if (this.options.tokens) {
          expr.tokens = this.tokens;
        }
        return expr;
      }
      parseExpression(disallowIn, refExpressionErrors) {
        if (disallowIn) {
          return this.disallowInAnd(() => this.parseExpressionBase(refExpressionErrors));
        }
        return this.allowInAnd(() => this.parseExpressionBase(refExpressionErrors));
      }
      parseExpressionBase(refExpressionErrors) {
        const startLoc = this.state.startLoc;
        const expr = this.parseMaybeAssign(refExpressionErrors);
        if (this.match(12)) {
          const node2 = this.startNodeAt(startLoc);
          node2.expressions = [expr];
          while (this.eat(12)) {
            node2.expressions.push(this.parseMaybeAssign(refExpressionErrors));
          }
          this.toReferencedList(node2.expressions);
          return this.finishNode(node2, "SequenceExpression");
        }
        return expr;
      }
      parseMaybeAssignDisallowIn(refExpressionErrors, afterLeftParse) {
        return this.disallowInAnd(() => this.parseMaybeAssign(refExpressionErrors, afterLeftParse));
      }
      parseMaybeAssignAllowIn(refExpressionErrors, afterLeftParse) {
        return this.allowInAnd(() => this.parseMaybeAssign(refExpressionErrors, afterLeftParse));
      }
      setOptionalParametersError(refExpressionErrors, resultError) {
        var _resultError$loc;
        refExpressionErrors.optionalParametersLoc = (_resultError$loc = resultError == null ? void 0 : resultError.loc) != null ? _resultError$loc : this.state.startLoc;
      }
      parseMaybeAssign(refExpressionErrors, afterLeftParse) {
        const startLoc = this.state.startLoc;
        if (this.isContextual(108)) {
          if (this.prodParam.hasYield) {
            let left3 = this.parseYield();
            if (afterLeftParse) {
              left3 = afterLeftParse.call(this, left3, startLoc);
            }
            return left3;
          }
        }
        let ownExpressionErrors;
        if (refExpressionErrors) {
          ownExpressionErrors = false;
        } else {
          refExpressionErrors = new ExpressionErrors();
          ownExpressionErrors = true;
        }
        const {
          type
        } = this.state;
        if (type === 10 || tokenIsIdentifier(type)) {
          this.state.potentialArrowAt = this.state.start;
        }
        let left2 = this.parseMaybeConditional(refExpressionErrors);
        if (afterLeftParse) {
          left2 = afterLeftParse.call(this, left2, startLoc);
        }
        if (tokenIsAssignment(this.state.type)) {
          const node2 = this.startNodeAt(startLoc);
          const operator = this.state.value;
          node2.operator = operator;
          if (this.match(29)) {
            this.toAssignable(left2, true);
            node2.left = left2;
            const startIndex = startLoc.index;
            if (refExpressionErrors.doubleProtoLoc != null && refExpressionErrors.doubleProtoLoc.index >= startIndex) {
              refExpressionErrors.doubleProtoLoc = null;
            }
            if (refExpressionErrors.shorthandAssignLoc != null && refExpressionErrors.shorthandAssignLoc.index >= startIndex) {
              refExpressionErrors.shorthandAssignLoc = null;
            }
            if (refExpressionErrors.privateKeyLoc != null && refExpressionErrors.privateKeyLoc.index >= startIndex) {
              this.checkDestructuringPrivate(refExpressionErrors);
              refExpressionErrors.privateKeyLoc = null;
            }
          } else {
            node2.left = left2;
          }
          this.next();
          node2.right = this.parseMaybeAssign();
          this.checkLVal(left2, this.finishNode(node2, "AssignmentExpression"));
          return node2;
        } else if (ownExpressionErrors) {
          this.checkExpressionErrors(refExpressionErrors, true);
        }
        return left2;
      }
      parseMaybeConditional(refExpressionErrors) {
        const startLoc = this.state.startLoc;
        const potentialArrowAt = this.state.potentialArrowAt;
        const expr = this.parseExprOps(refExpressionErrors);
        if (this.shouldExitDescending(expr, potentialArrowAt)) {
          return expr;
        }
        return this.parseConditional(expr, startLoc, refExpressionErrors);
      }
      parseConditional(expr, startLoc, refExpressionErrors) {
        if (this.eat(17)) {
          const node2 = this.startNodeAt(startLoc);
          node2.test = expr;
          node2.consequent = this.parseMaybeAssignAllowIn();
          this.expect(14);
          node2.alternate = this.parseMaybeAssign();
          return this.finishNode(node2, "ConditionalExpression");
        }
        return expr;
      }
      parseMaybeUnaryOrPrivate(refExpressionErrors) {
        return this.match(139) ? this.parsePrivateName() : this.parseMaybeUnary(refExpressionErrors);
      }
      parseExprOps(refExpressionErrors) {
        const startLoc = this.state.startLoc;
        const potentialArrowAt = this.state.potentialArrowAt;
        const expr = this.parseMaybeUnaryOrPrivate(refExpressionErrors);
        if (this.shouldExitDescending(expr, potentialArrowAt)) {
          return expr;
        }
        return this.parseExprOp(expr, startLoc, -1);
      }
      parseExprOp(left2, leftStartLoc, minPrec) {
        if (this.isPrivateName(left2)) {
          const value = this.getPrivateNameSV(left2);
          if (minPrec >= tokenOperatorPrecedence(58) || !this.prodParam.hasIn || !this.match(58)) {
            this.raise(Errors.PrivateInExpectedIn, left2, {
              identifierName: value
            });
          }
          this.classScope.usePrivateName(value, left2.loc.start);
        }
        const op = this.state.type;
        if (tokenIsOperator(op) && (this.prodParam.hasIn || !this.match(58))) {
          let prec = tokenOperatorPrecedence(op);
          if (prec > minPrec) {
            if (op === 39) {
              this.expectPlugin("pipelineOperator");
              if (this.state.inFSharpPipelineDirectBody) {
                return left2;
              }
              this.checkPipelineAtInfixOperator(left2, leftStartLoc);
            }
            const node2 = this.startNodeAt(leftStartLoc);
            node2.left = left2;
            node2.operator = this.state.value;
            const logical = op === 41 || op === 42;
            const coalesce = op === 40;
            if (coalesce) {
              prec = tokenOperatorPrecedence(42);
            }
            this.next();
            if (op === 39 && this.hasPlugin(["pipelineOperator", {
              proposal: "minimal"
            }])) {
              if (this.state.type === 96 && this.prodParam.hasAwait) {
                throw this.raise(Errors.UnexpectedAwaitAfterPipelineBody, this.state.startLoc);
              }
            }
            node2.right = this.parseExprOpRightExpr(op, prec);
            const finishedNode = this.finishNode(node2, logical || coalesce ? "LogicalExpression" : "BinaryExpression");
            const nextOp = this.state.type;
            if (coalesce && (nextOp === 41 || nextOp === 42) || logical && nextOp === 40) {
              throw this.raise(Errors.MixingCoalesceWithLogical, this.state.startLoc);
            }
            return this.parseExprOp(finishedNode, leftStartLoc, minPrec);
          }
        }
        return left2;
      }
      parseExprOpRightExpr(op, prec) {
        const startLoc = this.state.startLoc;
        switch (op) {
          case 39:
            switch (this.getPluginOption("pipelineOperator", "proposal")) {
              case "hack":
                return this.withTopicBindingContext(() => {
                  return this.parseHackPipeBody();
                });
              case "smart":
                return this.withTopicBindingContext(() => {
                  if (this.prodParam.hasYield && this.isContextual(108)) {
                    throw this.raise(Errors.PipeBodyIsTighter, this.state.startLoc);
                  }
                  return this.parseSmartPipelineBodyInStyle(this.parseExprOpBaseRightExpr(op, prec), startLoc);
                });
              case "fsharp":
                return this.withSoloAwaitPermittingContext(() => {
                  return this.parseFSharpPipelineBody(prec);
                });
            }
          default:
            return this.parseExprOpBaseRightExpr(op, prec);
        }
      }
      parseExprOpBaseRightExpr(op, prec) {
        const startLoc = this.state.startLoc;
        return this.parseExprOp(this.parseMaybeUnaryOrPrivate(), startLoc, tokenIsRightAssociative(op) ? prec - 1 : prec);
      }
      parseHackPipeBody() {
        var _body$extra;
        const {
          startLoc
        } = this.state;
        const body = this.parseMaybeAssign();
        const requiredParentheses = UnparenthesizedPipeBodyDescriptions.has(body.type);
        if (requiredParentheses && !((_body$extra = body.extra) != null && _body$extra.parenthesized)) {
          this.raise(Errors.PipeUnparenthesizedBody, startLoc, {
            type: body.type
          });
        }
        if (!this.topicReferenceWasUsedInCurrentContext()) {
          this.raise(Errors.PipeTopicUnused, startLoc);
        }
        return body;
      }
      checkExponentialAfterUnary(node2) {
        if (this.match(57)) {
          this.raise(Errors.UnexpectedTokenUnaryExponentiation, node2.argument);
        }
      }
      parseMaybeUnary(refExpressionErrors, sawUnary) {
        const startLoc = this.state.startLoc;
        const isAwait = this.isContextual(96);
        if (isAwait && this.recordAwaitIfAllowed()) {
          this.next();
          const expr2 = this.parseAwait(startLoc);
          if (!sawUnary) this.checkExponentialAfterUnary(expr2);
          return expr2;
        }
        const update = this.match(34);
        const node2 = this.startNode();
        if (tokenIsPrefix(this.state.type)) {
          node2.operator = this.state.value;
          node2.prefix = true;
          if (this.match(72)) {
            this.expectPlugin("throwExpressions");
          }
          const isDelete = this.match(89);
          this.next();
          node2.argument = this.parseMaybeUnary(null, true);
          this.checkExpressionErrors(refExpressionErrors, true);
          if (this.state.strict && isDelete) {
            const arg = node2.argument;
            if (arg.type === "Identifier") {
              this.raise(Errors.StrictDelete, node2);
            } else if (this.hasPropertyAsPrivateName(arg)) {
              this.raise(Errors.DeletePrivateField, node2);
            }
          }
          if (!update) {
            if (!sawUnary) {
              this.checkExponentialAfterUnary(node2);
            }
            return this.finishNode(node2, "UnaryExpression");
          }
        }
        const expr = this.parseUpdate(node2, update, refExpressionErrors);
        if (isAwait) {
          const {
            type
          } = this.state;
          const startsExpr2 = this.hasPlugin("v8intrinsic") ? tokenCanStartExpression(type) : tokenCanStartExpression(type) && !this.match(54);
          if (startsExpr2 && !this.isAmbiguousAwait()) {
            this.raiseOverwrite(Errors.AwaitNotInAsyncContext, startLoc);
            return this.parseAwait(startLoc);
          }
        }
        return expr;
      }
      parseUpdate(node2, update, refExpressionErrors) {
        if (update) {
          const updateExpressionNode = node2;
          this.checkLVal(updateExpressionNode.argument, this.finishNode(updateExpressionNode, "UpdateExpression"));
          return node2;
        }
        const startLoc = this.state.startLoc;
        let expr = this.parseExprSubscripts(refExpressionErrors);
        if (this.checkExpressionErrors(refExpressionErrors, false)) return expr;
        while (tokenIsPostfix(this.state.type) && !this.canInsertSemicolon()) {
          const node3 = this.startNodeAt(startLoc);
          node3.operator = this.state.value;
          node3.prefix = false;
          node3.argument = expr;
          this.next();
          this.checkLVal(expr, expr = this.finishNode(node3, "UpdateExpression"));
        }
        return expr;
      }
      parseExprSubscripts(refExpressionErrors) {
        const startLoc = this.state.startLoc;
        const potentialArrowAt = this.state.potentialArrowAt;
        const expr = this.parseExprAtom(refExpressionErrors);
        if (this.shouldExitDescending(expr, potentialArrowAt)) {
          return expr;
        }
        return this.parseSubscripts(expr, startLoc);
      }
      parseSubscripts(base, startLoc, noCalls) {
        const state2 = {
          optionalChainMember: false,
          maybeAsyncArrow: this.atPossibleAsyncArrow(base),
          stop: false
        };
        do {
          base = this.parseSubscript(base, startLoc, noCalls, state2);
          state2.maybeAsyncArrow = false;
        } while (!state2.stop);
        return base;
      }
      parseSubscript(base, startLoc, noCalls, state2) {
        const {
          type
        } = this.state;
        if (!noCalls && type === 15) {
          return this.parseBind(base, startLoc, noCalls, state2);
        } else if (tokenIsTemplate(type)) {
          return this.parseTaggedTemplateExpression(base, startLoc, state2);
        }
        let optional = false;
        if (type === 18) {
          if (noCalls) {
            this.raise(Errors.OptionalChainingNoNew, this.state.startLoc);
            if (this.lookaheadCharCode() === 40) {
              state2.stop = true;
              return base;
            }
          }
          state2.optionalChainMember = optional = true;
          this.next();
        }
        if (!noCalls && this.match(10)) {
          return this.parseCoverCallAndAsyncArrowHead(base, startLoc, state2, optional);
        } else {
          const computed = this.eat(0);
          if (computed || optional || this.eat(16)) {
            return this.parseMember(base, startLoc, state2, computed, optional);
          } else {
            state2.stop = true;
            return base;
          }
        }
      }
      parseMember(base, startLoc, state2, computed, optional) {
        const node2 = this.startNodeAt(startLoc);
        node2.object = base;
        node2.computed = computed;
        if (computed) {
          node2.property = this.parseExpression();
          this.expect(3);
        } else if (this.match(139)) {
          if (base.type === "Super") {
            this.raise(Errors.SuperPrivateField, startLoc);
          }
          this.classScope.usePrivateName(this.state.value, this.state.startLoc);
          node2.property = this.parsePrivateName();
        } else {
          node2.property = this.parseIdentifier(true);
        }
        if (state2.optionalChainMember) {
          node2.optional = optional;
          return this.finishNode(node2, "OptionalMemberExpression");
        } else {
          return this.finishNode(node2, "MemberExpression");
        }
      }
      parseBind(base, startLoc, noCalls, state2) {
        const node2 = this.startNodeAt(startLoc);
        node2.object = base;
        this.next();
        node2.callee = this.parseNoCallExpr();
        state2.stop = true;
        return this.parseSubscripts(this.finishNode(node2, "BindExpression"), startLoc, noCalls);
      }
      parseCoverCallAndAsyncArrowHead(base, startLoc, state2, optional) {
        const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;
        let refExpressionErrors = null;
        this.state.maybeInArrowParameters = true;
        this.next();
        const node2 = this.startNodeAt(startLoc);
        node2.callee = base;
        const {
          maybeAsyncArrow,
          optionalChainMember
        } = state2;
        if (maybeAsyncArrow) {
          this.expressionScope.enter(newAsyncArrowScope());
          refExpressionErrors = new ExpressionErrors();
        }
        if (optionalChainMember) {
          node2.optional = optional;
        }
        if (optional) {
          node2.arguments = this.parseCallExpressionArguments(11);
        } else {
          node2.arguments = this.parseCallExpressionArguments(11, base.type !== "Super", node2, refExpressionErrors);
        }
        let finishedNode = this.finishCallExpression(node2, optionalChainMember);
        if (maybeAsyncArrow && this.shouldParseAsyncArrow() && !optional) {
          state2.stop = true;
          this.checkDestructuringPrivate(refExpressionErrors);
          this.expressionScope.validateAsPattern();
          this.expressionScope.exit();
          finishedNode = this.parseAsyncArrowFromCallExpression(this.startNodeAt(startLoc), finishedNode);
        } else {
          if (maybeAsyncArrow) {
            this.checkExpressionErrors(refExpressionErrors, true);
            this.expressionScope.exit();
          }
          this.toReferencedArguments(finishedNode);
        }
        this.state.maybeInArrowParameters = oldMaybeInArrowParameters;
        return finishedNode;
      }
      toReferencedArguments(node2, isParenthesizedExpr) {
        this.toReferencedListDeep(node2.arguments, isParenthesizedExpr);
      }
      parseTaggedTemplateExpression(base, startLoc, state2) {
        const node2 = this.startNodeAt(startLoc);
        node2.tag = base;
        node2.quasi = this.parseTemplate(true);
        if (state2.optionalChainMember) {
          this.raise(Errors.OptionalChainingNoTemplate, startLoc);
        }
        return this.finishNode(node2, "TaggedTemplateExpression");
      }
      atPossibleAsyncArrow(base) {
        return base.type === "Identifier" && base.name === "async" && this.state.lastTokEndLoc.index === base.end && !this.canInsertSemicolon() && base.end - base.start === 5 && this.offsetToSourcePos(base.start) === this.state.potentialArrowAt;
      }
      finishCallExpression(node2, optional) {
        if (node2.callee.type === "Import") {
          if (node2.arguments.length === 0 || node2.arguments.length > 2) {
            this.raise(Errors.ImportCallArity, node2);
          } else {
            for (const arg of node2.arguments) {
              if (arg.type === "SpreadElement") {
                this.raise(Errors.ImportCallSpreadArgument, arg);
              }
            }
          }
        }
        return this.finishNode(node2, optional ? "OptionalCallExpression" : "CallExpression");
      }
      parseCallExpressionArguments(close2, allowPlaceholder, nodeForExtra, refExpressionErrors) {
        const elts = [];
        let first = true;
        const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;
        this.state.inFSharpPipelineDirectBody = false;
        while (!this.eat(close2)) {
          if (first) {
            first = false;
          } else {
            this.expect(12);
            if (this.match(close2)) {
              if (nodeForExtra) {
                this.addTrailingCommaExtraToNode(nodeForExtra);
              }
              this.next();
              break;
            }
          }
          elts.push(this.parseExprListItem(false, refExpressionErrors, allowPlaceholder));
        }
        this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;
        return elts;
      }
      shouldParseAsyncArrow() {
        return this.match(19) && !this.canInsertSemicolon();
      }
      parseAsyncArrowFromCallExpression(node2, call) {
        var _call$extra;
        this.resetPreviousNodeTrailingComments(call);
        this.expect(19);
        this.parseArrowExpression(node2, call.arguments, true, (_call$extra = call.extra) == null ? void 0 : _call$extra.trailingCommaLoc);
        if (call.innerComments) {
          setInnerComments(node2, call.innerComments);
        }
        if (call.callee.trailingComments) {
          setInnerComments(node2, call.callee.trailingComments);
        }
        return node2;
      }
      parseNoCallExpr() {
        const startLoc = this.state.startLoc;
        return this.parseSubscripts(this.parseExprAtom(), startLoc, true);
      }
      parseExprAtom(refExpressionErrors) {
        let node2;
        let decorators = null;
        const {
          type
        } = this.state;
        switch (type) {
          case 79:
            return this.parseSuper();
          case 83:
            node2 = this.startNode();
            this.next();
            if (this.match(16)) {
              return this.parseImportMetaProperty(node2);
            }
            if (this.match(10)) {
              if (this.options.createImportExpressions) {
                return this.parseImportCall(node2);
              } else {
                return this.finishNode(node2, "Import");
              }
            } else {
              this.raise(Errors.UnsupportedImport, this.state.lastTokStartLoc);
              return this.finishNode(node2, "Import");
            }
          case 78:
            node2 = this.startNode();
            this.next();
            return this.finishNode(node2, "ThisExpression");
          case 90: {
            return this.parseDo(this.startNode(), false);
          }
          case 56:
          case 31: {
            this.readRegexp();
            return this.parseRegExpLiteral(this.state.value);
          }
          case 135:
            return this.parseNumericLiteral(this.state.value);
          case 136:
            return this.parseBigIntLiteral(this.state.value);
          case 134:
            return this.parseStringLiteral(this.state.value);
          case 84:
            return this.parseNullLiteral();
          case 85:
            return this.parseBooleanLiteral(true);
          case 86:
            return this.parseBooleanLiteral(false);
          case 10: {
            const canBeArrow = this.state.potentialArrowAt === this.state.start;
            return this.parseParenAndDistinguishExpression(canBeArrow);
          }
          case 2:
          case 1: {
            return this.parseArrayLike(this.state.type === 2 ? 4 : 3, false, true);
          }
          case 0: {
            return this.parseArrayLike(3, true, false, refExpressionErrors);
          }
          case 6:
          case 7: {
            return this.parseObjectLike(this.state.type === 6 ? 9 : 8, false, true);
          }
          case 5: {
            return this.parseObjectLike(8, false, false, refExpressionErrors);
          }
          case 68:
            return this.parseFunctionOrFunctionSent();
          case 26:
            decorators = this.parseDecorators();
          case 80:
            return this.parseClass(this.maybeTakeDecorators(decorators, this.startNode()), false);
          case 77:
            return this.parseNewOrNewTarget();
          case 25:
          case 24:
            return this.parseTemplate(false);
          case 15: {
            node2 = this.startNode();
            this.next();
            node2.object = null;
            const callee = node2.callee = this.parseNoCallExpr();
            if (callee.type === "MemberExpression") {
              return this.finishNode(node2, "BindExpression");
            } else {
              throw this.raise(Errors.UnsupportedBind, callee);
            }
          }
          case 139: {
            this.raise(Errors.PrivateInExpectedIn, this.state.startLoc, {
              identifierName: this.state.value
            });
            return this.parsePrivateName();
          }
          case 33: {
            return this.parseTopicReferenceThenEqualsSign(54, "%");
          }
          case 32: {
            return this.parseTopicReferenceThenEqualsSign(44, "^");
          }
          case 37:
          case 38: {
            return this.parseTopicReference("hack");
          }
          case 44:
          case 54:
          case 27: {
            const pipeProposal = this.getPluginOption("pipelineOperator", "proposal");
            if (pipeProposal) {
              return this.parseTopicReference(pipeProposal);
            }
            this.unexpected();
            break;
          }
          case 47: {
            const lookaheadCh = this.input.codePointAt(this.nextTokenStart());
            if (isIdentifierStart(lookaheadCh) || lookaheadCh === 62) {
              this.expectOnePlugin(["jsx", "flow", "typescript"]);
            } else {
              this.unexpected();
            }
            break;
          }
          default:
            if (type === 137) {
              return this.parseDecimalLiteral(this.state.value);
            }
            if (tokenIsIdentifier(type)) {
              if (this.isContextual(127) && this.lookaheadInLineCharCode() === 123) {
                return this.parseModuleExpression();
              }
              const canBeArrow = this.state.potentialArrowAt === this.state.start;
              const containsEsc = this.state.containsEsc;
              const id = this.parseIdentifier();
              if (!containsEsc && id.name === "async" && !this.canInsertSemicolon()) {
                const {
                  type: type2
                } = this.state;
                if (type2 === 68) {
                  this.resetPreviousNodeTrailingComments(id);
                  this.next();
                  return this.parseAsyncFunctionExpression(this.startNodeAtNode(id));
                } else if (tokenIsIdentifier(type2)) {
                  if (this.lookaheadCharCode() === 61) {
                    return this.parseAsyncArrowUnaryFunction(this.startNodeAtNode(id));
                  } else {
                    return id;
                  }
                } else if (type2 === 90) {
                  this.resetPreviousNodeTrailingComments(id);
                  return this.parseDo(this.startNodeAtNode(id), true);
                }
              }
              if (canBeArrow && this.match(19) && !this.canInsertSemicolon()) {
                this.next();
                return this.parseArrowExpression(this.startNodeAtNode(id), [id], false);
              }
              return id;
            } else {
              this.unexpected();
            }
        }
      }
      parseTopicReferenceThenEqualsSign(topicTokenType, topicTokenValue) {
        const pipeProposal = this.getPluginOption("pipelineOperator", "proposal");
        if (pipeProposal) {
          this.state.type = topicTokenType;
          this.state.value = topicTokenValue;
          this.state.pos--;
          this.state.end--;
          this.state.endLoc = createPositionWithColumnOffset(this.state.endLoc, -1);
          return this.parseTopicReference(pipeProposal);
        } else {
          this.unexpected();
        }
      }
      parseTopicReference(pipeProposal) {
        const node2 = this.startNode();
        const startLoc = this.state.startLoc;
        const tokenType = this.state.type;
        this.next();
        return this.finishTopicReference(node2, startLoc, pipeProposal, tokenType);
      }
      finishTopicReference(node2, startLoc, pipeProposal, tokenType) {
        if (this.testTopicReferenceConfiguration(pipeProposal, startLoc, tokenType)) {
          const nodeType = pipeProposal === "smart" ? "PipelinePrimaryTopicReference" : "TopicReference";
          if (!this.topicReferenceIsAllowedInCurrentContext()) {
            this.raise(pipeProposal === "smart" ? Errors.PrimaryTopicNotAllowed : Errors.PipeTopicUnbound, startLoc);
          }
          this.registerTopicReference();
          return this.finishNode(node2, nodeType);
        } else {
          throw this.raise(Errors.PipeTopicUnconfiguredToken, startLoc, {
            token: tokenLabelName(tokenType)
          });
        }
      }
      testTopicReferenceConfiguration(pipeProposal, startLoc, tokenType) {
        switch (pipeProposal) {
          case "hack": {
            return this.hasPlugin(["pipelineOperator", {
              topicToken: tokenLabelName(tokenType)
            }]);
          }
          case "smart":
            return tokenType === 27;
          default:
            throw this.raise(Errors.PipeTopicRequiresHackPipes, startLoc);
        }
      }
      parseAsyncArrowUnaryFunction(node2) {
        this.prodParam.enter(functionFlags(true, this.prodParam.hasYield));
        const params = [this.parseIdentifier()];
        this.prodParam.exit();
        if (this.hasPrecedingLineBreak()) {
          this.raise(Errors.LineTerminatorBeforeArrow, this.state.curPosition());
        }
        this.expect(19);
        return this.parseArrowExpression(node2, params, true);
      }
      parseDo(node2, isAsync4) {
        this.expectPlugin("doExpressions");
        if (isAsync4) {
          this.expectPlugin("asyncDoExpressions");
        }
        node2.async = isAsync4;
        this.next();
        const oldLabels = this.state.labels;
        this.state.labels = [];
        if (isAsync4) {
          this.prodParam.enter(2);
          node2.body = this.parseBlock();
          this.prodParam.exit();
        } else {
          node2.body = this.parseBlock();
        }
        this.state.labels = oldLabels;
        return this.finishNode(node2, "DoExpression");
      }
      parseSuper() {
        const node2 = this.startNode();
        this.next();
        if (this.match(10) && !this.scope.allowDirectSuper && !this.options.allowSuperOutsideMethod) {
          this.raise(Errors.SuperNotAllowed, node2);
        } else if (!this.scope.allowSuper && !this.options.allowSuperOutsideMethod) {
          this.raise(Errors.UnexpectedSuper, node2);
        }
        if (!this.match(10) && !this.match(0) && !this.match(16)) {
          this.raise(Errors.UnsupportedSuper, node2);
        }
        return this.finishNode(node2, "Super");
      }
      parsePrivateName() {
        const node2 = this.startNode();
        const id = this.startNodeAt(createPositionWithColumnOffset(this.state.startLoc, 1));
        const name2 = this.state.value;
        this.next();
        node2.id = this.createIdentifier(id, name2);
        return this.finishNode(node2, "PrivateName");
      }
      parseFunctionOrFunctionSent() {
        const node2 = this.startNode();
        this.next();
        if (this.prodParam.hasYield && this.match(16)) {
          const meta = this.createIdentifier(this.startNodeAtNode(node2), "function");
          this.next();
          if (this.match(103)) {
            this.expectPlugin("functionSent");
          } else if (!this.hasPlugin("functionSent")) {
            this.unexpected();
          }
          return this.parseMetaProperty(node2, meta, "sent");
        }
        return this.parseFunction(node2);
      }
      parseMetaProperty(node2, meta, propertyName) {
        node2.meta = meta;
        const containsEsc = this.state.containsEsc;
        node2.property = this.parseIdentifier(true);
        if (node2.property.name !== propertyName || containsEsc) {
          this.raise(Errors.UnsupportedMetaProperty, node2.property, {
            target: meta.name,
            onlyValidPropertyName: propertyName
          });
        }
        return this.finishNode(node2, "MetaProperty");
      }
      parseImportMetaProperty(node2) {
        const id = this.createIdentifier(this.startNodeAtNode(node2), "import");
        this.next();
        if (this.isContextual(101)) {
          if (!this.inModule) {
            this.raise(Errors.ImportMetaOutsideModule, id);
          }
          this.sawUnambiguousESM = true;
        } else if (this.isContextual(105) || this.isContextual(97)) {
          const isSource = this.isContextual(105);
          if (!isSource) this.unexpected();
          this.expectPlugin(isSource ? "sourcePhaseImports" : "deferredImportEvaluation");
          if (!this.options.createImportExpressions) {
            throw this.raise(Errors.DynamicImportPhaseRequiresImportExpressions, this.state.startLoc, {
              phase: this.state.value
            });
          }
          this.next();
          node2.phase = isSource ? "source" : "defer";
          return this.parseImportCall(node2);
        }
        return this.parseMetaProperty(node2, id, "meta");
      }
      parseLiteralAtNode(value, type, node2) {
        this.addExtra(node2, "rawValue", value);
        this.addExtra(node2, "raw", this.input.slice(this.offsetToSourcePos(node2.start), this.state.end));
        node2.value = value;
        this.next();
        return this.finishNode(node2, type);
      }
      parseLiteral(value, type) {
        const node2 = this.startNode();
        return this.parseLiteralAtNode(value, type, node2);
      }
      parseStringLiteral(value) {
        return this.parseLiteral(value, "StringLiteral");
      }
      parseNumericLiteral(value) {
        return this.parseLiteral(value, "NumericLiteral");
      }
      parseBigIntLiteral(value) {
        return this.parseLiteral(value, "BigIntLiteral");
      }
      parseDecimalLiteral(value) {
        return this.parseLiteral(value, "DecimalLiteral");
      }
      parseRegExpLiteral(value) {
        const node2 = this.startNode();
        this.addExtra(node2, "raw", this.input.slice(this.offsetToSourcePos(node2.start), this.state.end));
        node2.pattern = value.pattern;
        node2.flags = value.flags;
        this.next();
        return this.finishNode(node2, "RegExpLiteral");
      }
      parseBooleanLiteral(value) {
        const node2 = this.startNode();
        node2.value = value;
        this.next();
        return this.finishNode(node2, "BooleanLiteral");
      }
      parseNullLiteral() {
        const node2 = this.startNode();
        this.next();
        return this.finishNode(node2, "NullLiteral");
      }
      parseParenAndDistinguishExpression(canBeArrow) {
        const startLoc = this.state.startLoc;
        let val2;
        this.next();
        this.expressionScope.enter(newArrowHeadScope());
        const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;
        const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;
        this.state.maybeInArrowParameters = true;
        this.state.inFSharpPipelineDirectBody = false;
        const innerStartLoc = this.state.startLoc;
        const exprList = [];
        const refExpressionErrors = new ExpressionErrors();
        let first = true;
        let spreadStartLoc;
        let optionalCommaStartLoc;
        while (!this.match(11)) {
          if (first) {
            first = false;
          } else {
            this.expect(12, refExpressionErrors.optionalParametersLoc === null ? null : refExpressionErrors.optionalParametersLoc);
            if (this.match(11)) {
              optionalCommaStartLoc = this.state.startLoc;
              break;
            }
          }
          if (this.match(21)) {
            const spreadNodeStartLoc = this.state.startLoc;
            spreadStartLoc = this.state.startLoc;
            exprList.push(this.parseParenItem(this.parseRestBinding(), spreadNodeStartLoc));
            if (!this.checkCommaAfterRest(41)) {
              break;
            }
          } else {
            exprList.push(this.parseMaybeAssignAllowIn(refExpressionErrors, this.parseParenItem));
          }
        }
        const innerEndLoc = this.state.lastTokEndLoc;
        this.expect(11);
        this.state.maybeInArrowParameters = oldMaybeInArrowParameters;
        this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;
        let arrowNode = this.startNodeAt(startLoc);
        if (canBeArrow && this.shouldParseArrow(exprList) && (arrowNode = this.parseArrow(arrowNode))) {
          this.checkDestructuringPrivate(refExpressionErrors);
          this.expressionScope.validateAsPattern();
          this.expressionScope.exit();
          this.parseArrowExpression(arrowNode, exprList, false);
          return arrowNode;
        }
        this.expressionScope.exit();
        if (!exprList.length) {
          this.unexpected(this.state.lastTokStartLoc);
        }
        if (optionalCommaStartLoc) this.unexpected(optionalCommaStartLoc);
        if (spreadStartLoc) this.unexpected(spreadStartLoc);
        this.checkExpressionErrors(refExpressionErrors, true);
        this.toReferencedListDeep(exprList, true);
        if (exprList.length > 1) {
          val2 = this.startNodeAt(innerStartLoc);
          val2.expressions = exprList;
          this.finishNode(val2, "SequenceExpression");
          this.resetEndLocation(val2, innerEndLoc);
        } else {
          val2 = exprList[0];
        }
        return this.wrapParenthesis(startLoc, val2);
      }
      wrapParenthesis(startLoc, expression) {
        if (!this.options.createParenthesizedExpressions) {
          this.addExtra(expression, "parenthesized", true);
          this.addExtra(expression, "parenStart", startLoc.index);
          this.takeSurroundingComments(expression, startLoc.index, this.state.lastTokEndLoc.index);
          return expression;
        }
        const parenExpression = this.startNodeAt(startLoc);
        parenExpression.expression = expression;
        return this.finishNode(parenExpression, "ParenthesizedExpression");
      }
      shouldParseArrow(params) {
        return !this.canInsertSemicolon();
      }
      parseArrow(node2) {
        if (this.eat(19)) {
          return node2;
        }
      }
      parseParenItem(node2, startLoc) {
        return node2;
      }
      parseNewOrNewTarget() {
        const node2 = this.startNode();
        this.next();
        if (this.match(16)) {
          const meta = this.createIdentifier(this.startNodeAtNode(node2), "new");
          this.next();
          const metaProp = this.parseMetaProperty(node2, meta, "target");
          if (!this.scope.inNonArrowFunction && !this.scope.inClass && !this.options.allowNewTargetOutsideFunction) {
            this.raise(Errors.UnexpectedNewTarget, metaProp);
          }
          return metaProp;
        }
        return this.parseNew(node2);
      }
      parseNew(node2) {
        this.parseNewCallee(node2);
        if (this.eat(10)) {
          const args = this.parseExprList(11);
          this.toReferencedList(args);
          node2.arguments = args;
        } else {
          node2.arguments = [];
        }
        return this.finishNode(node2, "NewExpression");
      }
      parseNewCallee(node2) {
        const isImport = this.match(83);
        const callee = this.parseNoCallExpr();
        node2.callee = callee;
        if (isImport && (callee.type === "Import" || callee.type === "ImportExpression")) {
          this.raise(Errors.ImportCallNotNewExpression, callee);
        }
      }
      parseTemplateElement(isTagged) {
        const {
          start,
          startLoc,
          end,
          value
        } = this.state;
        const elemStart = start + 1;
        const elem = this.startNodeAt(createPositionWithColumnOffset(startLoc, 1));
        if (value === null) {
          if (!isTagged) {
            this.raise(Errors.InvalidEscapeSequenceTemplate, createPositionWithColumnOffset(this.state.firstInvalidTemplateEscapePos, 1));
          }
        }
        const isTail = this.match(24);
        const endOffset = isTail ? -1 : -2;
        const elemEnd = end + endOffset;
        elem.value = {
          raw: this.input.slice(elemStart, elemEnd).replace(/\r\n?/g, "\n"),
          cooked: value === null ? null : value.slice(1, endOffset)
        };
        elem.tail = isTail;
        this.next();
        const finishedNode = this.finishNode(elem, "TemplateElement");
        this.resetEndLocation(finishedNode, createPositionWithColumnOffset(this.state.lastTokEndLoc, endOffset));
        return finishedNode;
      }
      parseTemplate(isTagged) {
        const node2 = this.startNode();
        let curElt = this.parseTemplateElement(isTagged);
        const quasis = [curElt];
        const substitutions = [];
        while (!curElt.tail) {
          substitutions.push(this.parseTemplateSubstitution());
          this.readTemplateContinuation();
          quasis.push(curElt = this.parseTemplateElement(isTagged));
        }
        node2.expressions = substitutions;
        node2.quasis = quasis;
        return this.finishNode(node2, "TemplateLiteral");
      }
      parseTemplateSubstitution() {
        return this.parseExpression();
      }
      parseObjectLike(close2, isPattern, isRecord2, refExpressionErrors) {
        if (isRecord2) {
          this.expectPlugin("recordAndTuple");
        }
        const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;
        this.state.inFSharpPipelineDirectBody = false;
        const propHash = /* @__PURE__ */ Object.create(null);
        let first = true;
        const node2 = this.startNode();
        node2.properties = [];
        this.next();
        while (!this.match(close2)) {
          if (first) {
            first = false;
          } else {
            this.expect(12);
            if (this.match(close2)) {
              this.addTrailingCommaExtraToNode(node2);
              break;
            }
          }
          let prop;
          if (isPattern) {
            prop = this.parseBindingProperty();
          } else {
            prop = this.parsePropertyDefinition(refExpressionErrors);
            this.checkProto(prop, isRecord2, propHash, refExpressionErrors);
          }
          if (isRecord2 && !this.isObjectProperty(prop) && prop.type !== "SpreadElement") {
            this.raise(Errors.InvalidRecordProperty, prop);
          }
          {
            if (prop.shorthand) {
              this.addExtra(prop, "shorthand", true);
            }
          }
          node2.properties.push(prop);
        }
        this.next();
        this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;
        let type = "ObjectExpression";
        if (isPattern) {
          type = "ObjectPattern";
        } else if (isRecord2) {
          type = "RecordExpression";
        }
        return this.finishNode(node2, type);
      }
      addTrailingCommaExtraToNode(node2) {
        this.addExtra(node2, "trailingComma", this.state.lastTokStartLoc.index);
        this.addExtra(node2, "trailingCommaLoc", this.state.lastTokStartLoc, false);
      }
      maybeAsyncOrAccessorProp(prop) {
        return !prop.computed && prop.key.type === "Identifier" && (this.isLiteralPropertyName() || this.match(0) || this.match(55));
      }
      parsePropertyDefinition(refExpressionErrors) {
        let decorators = [];
        if (this.match(26)) {
          if (this.hasPlugin("decorators")) {
            this.raise(Errors.UnsupportedPropertyDecorator, this.state.startLoc);
          }
          while (this.match(26)) {
            decorators.push(this.parseDecorator());
          }
        }
        const prop = this.startNode();
        let isAsync4 = false;
        let isAccessor = false;
        let startLoc;
        if (this.match(21)) {
          if (decorators.length) this.unexpected();
          return this.parseSpread();
        }
        if (decorators.length) {
          prop.decorators = decorators;
          decorators = [];
        }
        prop.method = false;
        if (refExpressionErrors) {
          startLoc = this.state.startLoc;
        }
        let isGenerator = this.eat(55);
        this.parsePropertyNamePrefixOperator(prop);
        const containsEsc = this.state.containsEsc;
        this.parsePropertyName(prop, refExpressionErrors);
        if (!isGenerator && !containsEsc && this.maybeAsyncOrAccessorProp(prop)) {
          const {
            key
          } = prop;
          const keyName = key.name;
          if (keyName === "async" && !this.hasPrecedingLineBreak()) {
            isAsync4 = true;
            this.resetPreviousNodeTrailingComments(key);
            isGenerator = this.eat(55);
            this.parsePropertyName(prop);
          }
          if (keyName === "get" || keyName === "set") {
            isAccessor = true;
            this.resetPreviousNodeTrailingComments(key);
            prop.kind = keyName;
            if (this.match(55)) {
              isGenerator = true;
              this.raise(Errors.AccessorIsGenerator, this.state.curPosition(), {
                kind: keyName
              });
              this.next();
            }
            this.parsePropertyName(prop);
          }
        }
        return this.parseObjPropValue(prop, startLoc, isGenerator, isAsync4, false, isAccessor, refExpressionErrors);
      }
      getGetterSetterExpectedParamCount(method) {
        return method.kind === "get" ? 0 : 1;
      }
      getObjectOrClassMethodParams(method) {
        return method.params;
      }
      checkGetterSetterParams(method) {
        var _params;
        const paramCount = this.getGetterSetterExpectedParamCount(method);
        const params = this.getObjectOrClassMethodParams(method);
        if (params.length !== paramCount) {
          this.raise(method.kind === "get" ? Errors.BadGetterArity : Errors.BadSetterArity, method);
        }
        if (method.kind === "set" && ((_params = params[params.length - 1]) == null ? void 0 : _params.type) === "RestElement") {
          this.raise(Errors.BadSetterRestParameter, method);
        }
      }
      parseObjectMethod(prop, isGenerator, isAsync4, isPattern, isAccessor) {
        if (isAccessor) {
          const finishedProp = this.parseMethod(prop, isGenerator, false, false, false, "ObjectMethod");
          this.checkGetterSetterParams(finishedProp);
          return finishedProp;
        }
        if (isAsync4 || isGenerator || this.match(10)) {
          if (isPattern) this.unexpected();
          prop.kind = "method";
          prop.method = true;
          return this.parseMethod(prop, isGenerator, isAsync4, false, false, "ObjectMethod");
        }
      }
      parseObjectProperty(prop, startLoc, isPattern, refExpressionErrors) {
        prop.shorthand = false;
        if (this.eat(14)) {
          prop.value = isPattern ? this.parseMaybeDefault(this.state.startLoc) : this.parseMaybeAssignAllowIn(refExpressionErrors);
          return this.finishNode(prop, "ObjectProperty");
        }
        if (!prop.computed && prop.key.type === "Identifier") {
          this.checkReservedWord(prop.key.name, prop.key.loc.start, true, false);
          if (isPattern) {
            prop.value = this.parseMaybeDefault(startLoc, cloneIdentifier(prop.key));
          } else if (this.match(29)) {
            const shorthandAssignLoc = this.state.startLoc;
            if (refExpressionErrors != null) {
              if (refExpressionErrors.shorthandAssignLoc === null) {
                refExpressionErrors.shorthandAssignLoc = shorthandAssignLoc;
              }
            } else {
              this.raise(Errors.InvalidCoverInitializedName, shorthandAssignLoc);
            }
            prop.value = this.parseMaybeDefault(startLoc, cloneIdentifier(prop.key));
          } else {
            prop.value = cloneIdentifier(prop.key);
          }
          prop.shorthand = true;
          return this.finishNode(prop, "ObjectProperty");
        }
      }
      parseObjPropValue(prop, startLoc, isGenerator, isAsync4, isPattern, isAccessor, refExpressionErrors) {
        const node2 = this.parseObjectMethod(prop, isGenerator, isAsync4, isPattern, isAccessor) || this.parseObjectProperty(prop, startLoc, isPattern, refExpressionErrors);
        if (!node2) this.unexpected();
        return node2;
      }
      parsePropertyName(prop, refExpressionErrors) {
        if (this.eat(0)) {
          prop.computed = true;
          prop.key = this.parseMaybeAssignAllowIn();
          this.expect(3);
        } else {
          const {
            type,
            value
          } = this.state;
          let key;
          if (tokenIsKeywordOrIdentifier(type)) {
            key = this.parseIdentifier(true);
          } else {
            switch (type) {
              case 135:
                key = this.parseNumericLiteral(value);
                break;
              case 134:
                key = this.parseStringLiteral(value);
                break;
              case 136:
                key = this.parseBigIntLiteral(value);
                break;
              case 139: {
                const privateKeyLoc = this.state.startLoc;
                if (refExpressionErrors != null) {
                  if (refExpressionErrors.privateKeyLoc === null) {
                    refExpressionErrors.privateKeyLoc = privateKeyLoc;
                  }
                } else {
                  this.raise(Errors.UnexpectedPrivateField, privateKeyLoc);
                }
                key = this.parsePrivateName();
                break;
              }
              default:
                if (type === 137) {
                  key = this.parseDecimalLiteral(value);
                  break;
                }
                this.unexpected();
            }
          }
          prop.key = key;
          if (type !== 139) {
            prop.computed = false;
          }
        }
      }
      initFunction(node2, isAsync4) {
        node2.id = null;
        node2.generator = false;
        node2.async = isAsync4;
      }
      parseMethod(node2, isGenerator, isAsync4, isConstructor, allowDirectSuper, type, inClassScope = false) {
        this.initFunction(node2, isAsync4);
        node2.generator = isGenerator;
        this.scope.enter(2 | 16 | (inClassScope ? 64 : 0) | (allowDirectSuper ? 32 : 0));
        this.prodParam.enter(functionFlags(isAsync4, node2.generator));
        this.parseFunctionParams(node2, isConstructor);
        const finishedNode = this.parseFunctionBodyAndFinish(node2, type, true);
        this.prodParam.exit();
        this.scope.exit();
        return finishedNode;
      }
      parseArrayLike(close2, canBePattern, isTuple, refExpressionErrors) {
        if (isTuple) {
          this.expectPlugin("recordAndTuple");
        }
        const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;
        this.state.inFSharpPipelineDirectBody = false;
        const node2 = this.startNode();
        this.next();
        node2.elements = this.parseExprList(close2, !isTuple, refExpressionErrors, node2);
        this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;
        return this.finishNode(node2, isTuple ? "TupleExpression" : "ArrayExpression");
      }
      parseArrowExpression(node2, params, isAsync4, trailingCommaLoc) {
        this.scope.enter(2 | 4);
        let flags2 = functionFlags(isAsync4, false);
        if (!this.match(5) && this.prodParam.hasIn) {
          flags2 |= 8;
        }
        this.prodParam.enter(flags2);
        this.initFunction(node2, isAsync4);
        const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;
        if (params) {
          this.state.maybeInArrowParameters = true;
          this.setArrowFunctionParameters(node2, params, trailingCommaLoc);
        }
        this.state.maybeInArrowParameters = false;
        this.parseFunctionBody(node2, true);
        this.prodParam.exit();
        this.scope.exit();
        this.state.maybeInArrowParameters = oldMaybeInArrowParameters;
        return this.finishNode(node2, "ArrowFunctionExpression");
      }
      setArrowFunctionParameters(node2, params, trailingCommaLoc) {
        this.toAssignableList(params, trailingCommaLoc, false);
        node2.params = params;
      }
      parseFunctionBodyAndFinish(node2, type, isMethod = false) {
        this.parseFunctionBody(node2, false, isMethod);
        return this.finishNode(node2, type);
      }
      parseFunctionBody(node2, allowExpression, isMethod = false) {
        const isExpression = allowExpression && !this.match(5);
        this.expressionScope.enter(newExpressionScope());
        if (isExpression) {
          node2.body = this.parseMaybeAssign();
          this.checkParams(node2, false, allowExpression, false);
        } else {
          const oldStrict = this.state.strict;
          const oldLabels = this.state.labels;
          this.state.labels = [];
          this.prodParam.enter(this.prodParam.currentFlags() | 4);
          node2.body = this.parseBlock(true, false, (hasStrictModeDirective) => {
            const nonSimple = !this.isSimpleParamList(node2.params);
            if (hasStrictModeDirective && nonSimple) {
              this.raise(Errors.IllegalLanguageModeDirective, (node2.kind === "method" || node2.kind === "constructor") && !!node2.key ? node2.key.loc.end : node2);
            }
            const strictModeChanged = !oldStrict && this.state.strict;
            this.checkParams(node2, !this.state.strict && !allowExpression && !isMethod && !nonSimple, allowExpression, strictModeChanged);
            if (this.state.strict && node2.id) {
              this.checkIdentifier(node2.id, 65, strictModeChanged);
            }
          });
          this.prodParam.exit();
          this.state.labels = oldLabels;
        }
        this.expressionScope.exit();
      }
      isSimpleParameter(node2) {
        return node2.type === "Identifier";
      }
      isSimpleParamList(params) {
        for (let i7 = 0, len = params.length; i7 < len; i7++) {
          if (!this.isSimpleParameter(params[i7])) return false;
        }
        return true;
      }
      checkParams(node2, allowDuplicates, isArrowFunction, strictModeChanged = true) {
        const checkClashes = !allowDuplicates && /* @__PURE__ */ new Set();
        const formalParameters = {
          type: "FormalParameters"
        };
        for (const param of node2.params) {
          this.checkLVal(param, formalParameters, 5, checkClashes, strictModeChanged);
        }
      }
      parseExprList(close2, allowEmpty, refExpressionErrors, nodeForExtra) {
        const elts = [];
        let first = true;
        while (!this.eat(close2)) {
          if (first) {
            first = false;
          } else {
            this.expect(12);
            if (this.match(close2)) {
              if (nodeForExtra) {
                this.addTrailingCommaExtraToNode(nodeForExtra);
              }
              this.next();
              break;
            }
          }
          elts.push(this.parseExprListItem(allowEmpty, refExpressionErrors));
        }
        return elts;
      }
      parseExprListItem(allowEmpty, refExpressionErrors, allowPlaceholder) {
        let elt;
        if (this.match(12)) {
          if (!allowEmpty) {
            this.raise(Errors.UnexpectedToken, this.state.curPosition(), {
              unexpected: ","
            });
          }
          elt = null;
        } else if (this.match(21)) {
          const spreadNodeStartLoc = this.state.startLoc;
          elt = this.parseParenItem(this.parseSpread(refExpressionErrors), spreadNodeStartLoc);
        } else if (this.match(17)) {
          this.expectPlugin("partialApplication");
          if (!allowPlaceholder) {
            this.raise(Errors.UnexpectedArgumentPlaceholder, this.state.startLoc);
          }
          const node2 = this.startNode();
          this.next();
          elt = this.finishNode(node2, "ArgumentPlaceholder");
        } else {
          elt = this.parseMaybeAssignAllowIn(refExpressionErrors, this.parseParenItem);
        }
        return elt;
      }
      parseIdentifier(liberal) {
        const node2 = this.startNode();
        const name2 = this.parseIdentifierName(liberal);
        return this.createIdentifier(node2, name2);
      }
      createIdentifier(node2, name2) {
        node2.name = name2;
        node2.loc.identifierName = name2;
        return this.finishNode(node2, "Identifier");
      }
      parseIdentifierName(liberal) {
        let name2;
        const {
          startLoc,
          type
        } = this.state;
        if (tokenIsKeywordOrIdentifier(type)) {
          name2 = this.state.value;
        } else {
          this.unexpected();
        }
        const tokenIsKeyword2 = tokenKeywordOrIdentifierIsKeyword(type);
        if (liberal) {
          if (tokenIsKeyword2) {
            this.replaceToken(132);
          }
        } else {
          this.checkReservedWord(name2, startLoc, tokenIsKeyword2, false);
        }
        this.next();
        return name2;
      }
      checkReservedWord(word, startLoc, checkKeywords, isBinding) {
        if (word.length > 10) {
          return;
        }
        if (!canBeReservedWord(word)) {
          return;
        }
        if (checkKeywords && isKeyword(word)) {
          this.raise(Errors.UnexpectedKeyword, startLoc, {
            keyword: word
          });
          return;
        }
        const reservedTest = !this.state.strict ? isReservedWord : isBinding ? isStrictBindReservedWord : isStrictReservedWord;
        if (reservedTest(word, this.inModule)) {
          this.raise(Errors.UnexpectedReservedWord, startLoc, {
            reservedWord: word
          });
          return;
        } else if (word === "yield") {
          if (this.prodParam.hasYield) {
            this.raise(Errors.YieldBindingIdentifier, startLoc);
            return;
          }
        } else if (word === "await") {
          if (this.prodParam.hasAwait) {
            this.raise(Errors.AwaitBindingIdentifier, startLoc);
            return;
          }
          if (this.scope.inStaticBlock) {
            this.raise(Errors.AwaitBindingIdentifierInStaticBlock, startLoc);
            return;
          }
          this.expressionScope.recordAsyncArrowParametersError(startLoc);
        } else if (word === "arguments") {
          if (this.scope.inClassAndNotInNonArrowFunction) {
            this.raise(Errors.ArgumentsInClass, startLoc);
            return;
          }
        }
      }
      recordAwaitIfAllowed() {
        const isAwaitAllowed = this.prodParam.hasAwait || this.options.allowAwaitOutsideFunction && !this.scope.inFunction;
        if (isAwaitAllowed && !this.scope.inFunction) {
          this.state.hasTopLevelAwait = true;
        }
        return isAwaitAllowed;
      }
      parseAwait(startLoc) {
        const node2 = this.startNodeAt(startLoc);
        this.expressionScope.recordParameterInitializerError(Errors.AwaitExpressionFormalParameter, node2);
        if (this.eat(55)) {
          this.raise(Errors.ObsoleteAwaitStar, node2);
        }
        if (!this.scope.inFunction && !this.options.allowAwaitOutsideFunction) {
          if (this.isAmbiguousAwait()) {
            this.ambiguousScriptDifferentAst = true;
          } else {
            this.sawUnambiguousESM = true;
          }
        }
        if (!this.state.soloAwait) {
          node2.argument = this.parseMaybeUnary(null, true);
        }
        return this.finishNode(node2, "AwaitExpression");
      }
      isAmbiguousAwait() {
        if (this.hasPrecedingLineBreak()) return true;
        const {
          type
        } = this.state;
        return type === 53 || type === 10 || type === 0 || tokenIsTemplate(type) || type === 102 && !this.state.containsEsc || type === 138 || type === 56 || this.hasPlugin("v8intrinsic") && type === 54;
      }
      parseYield() {
        const node2 = this.startNode();
        this.expressionScope.recordParameterInitializerError(Errors.YieldInParameter, node2);
        this.next();
        let delegating = false;
        let argument = null;
        if (!this.hasPrecedingLineBreak()) {
          delegating = this.eat(55);
          switch (this.state.type) {
            case 13:
            case 140:
            case 8:
            case 11:
            case 3:
            case 9:
            case 14:
            case 12:
              if (!delegating) break;
            default:
              argument = this.parseMaybeAssign();
          }
        }
        node2.delegate = delegating;
        node2.argument = argument;
        return this.finishNode(node2, "YieldExpression");
      }
      parseImportCall(node2) {
        this.next();
        node2.source = this.parseMaybeAssignAllowIn();
        node2.options = null;
        if (this.eat(12)) {
          if (!this.match(11)) {
            node2.options = this.parseMaybeAssignAllowIn();
            if (this.eat(12) && !this.match(11)) {
              do {
                this.parseMaybeAssignAllowIn();
              } while (this.eat(12) && !this.match(11));
              this.raise(Errors.ImportCallArity, node2);
            }
          }
        }
        this.expect(11);
        return this.finishNode(node2, "ImportExpression");
      }
      checkPipelineAtInfixOperator(left2, leftStartLoc) {
        if (this.hasPlugin(["pipelineOperator", {
          proposal: "smart"
        }])) {
          if (left2.type === "SequenceExpression") {
            this.raise(Errors.PipelineHeadSequenceExpression, leftStartLoc);
          }
        }
      }
      parseSmartPipelineBodyInStyle(childExpr, startLoc) {
        if (this.isSimpleReference(childExpr)) {
          const bodyNode = this.startNodeAt(startLoc);
          bodyNode.callee = childExpr;
          return this.finishNode(bodyNode, "PipelineBareFunction");
        } else {
          const bodyNode = this.startNodeAt(startLoc);
          this.checkSmartPipeTopicBodyEarlyErrors(startLoc);
          bodyNode.expression = childExpr;
          return this.finishNode(bodyNode, "PipelineTopicExpression");
        }
      }
      isSimpleReference(expression) {
        switch (expression.type) {
          case "MemberExpression":
            return !expression.computed && this.isSimpleReference(expression.object);
          case "Identifier":
            return true;
          default:
            return false;
        }
      }
      checkSmartPipeTopicBodyEarlyErrors(startLoc) {
        if (this.match(19)) {
          throw this.raise(Errors.PipelineBodyNoArrow, this.state.startLoc);
        }
        if (!this.topicReferenceWasUsedInCurrentContext()) {
          this.raise(Errors.PipelineTopicUnused, startLoc);
        }
      }
      withTopicBindingContext(callback) {
        const outerContextTopicState = this.state.topicContext;
        this.state.topicContext = {
          maxNumOfResolvableTopics: 1,
          maxTopicIndex: null
        };
        try {
          return callback();
        } finally {
          this.state.topicContext = outerContextTopicState;
        }
      }
      withSmartMixTopicForbiddingContext(callback) {
        if (this.hasPlugin(["pipelineOperator", {
          proposal: "smart"
        }])) {
          const outerContextTopicState = this.state.topicContext;
          this.state.topicContext = {
            maxNumOfResolvableTopics: 0,
            maxTopicIndex: null
          };
          try {
            return callback();
          } finally {
            this.state.topicContext = outerContextTopicState;
          }
        } else {
          return callback();
        }
      }
      withSoloAwaitPermittingContext(callback) {
        const outerContextSoloAwaitState = this.state.soloAwait;
        this.state.soloAwait = true;
        try {
          return callback();
        } finally {
          this.state.soloAwait = outerContextSoloAwaitState;
        }
      }
      allowInAnd(callback) {
        const flags2 = this.prodParam.currentFlags();
        const prodParamToSet = 8 & ~flags2;
        if (prodParamToSet) {
          this.prodParam.enter(flags2 | 8);
          try {
            return callback();
          } finally {
            this.prodParam.exit();
          }
        }
        return callback();
      }
      disallowInAnd(callback) {
        const flags2 = this.prodParam.currentFlags();
        const prodParamToClear = 8 & flags2;
        if (prodParamToClear) {
          this.prodParam.enter(flags2 & -9);
          try {
            return callback();
          } finally {
            this.prodParam.exit();
          }
        }
        return callback();
      }
      registerTopicReference() {
        this.state.topicContext.maxTopicIndex = 0;
      }
      topicReferenceIsAllowedInCurrentContext() {
        return this.state.topicContext.maxNumOfResolvableTopics >= 1;
      }
      topicReferenceWasUsedInCurrentContext() {
        return this.state.topicContext.maxTopicIndex != null && this.state.topicContext.maxTopicIndex >= 0;
      }
      parseFSharpPipelineBody(prec) {
        const startLoc = this.state.startLoc;
        this.state.potentialArrowAt = this.state.start;
        const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;
        this.state.inFSharpPipelineDirectBody = true;
        const ret = this.parseExprOp(this.parseMaybeUnaryOrPrivate(), startLoc, prec);
        this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;
        return ret;
      }
      parseModuleExpression() {
        this.expectPlugin("moduleBlocks");
        const node2 = this.startNode();
        this.next();
        if (!this.match(5)) {
          this.unexpected(null, 5);
        }
        const program = this.startNodeAt(this.state.endLoc);
        this.next();
        const revertScopes = this.initializeScopes(true);
        this.enterInitialScopes();
        try {
          node2.body = this.parseProgram(program, 8, "module");
        } finally {
          revertScopes();
        }
        return this.finishNode(node2, "ModuleExpression");
      }
      parsePropertyNamePrefixOperator(prop) {
      }
    };
    var loopLabel = {
      kind: 1
    };
    var switchLabel = {
      kind: 2
    };
    var loneSurrogate = /[\uD800-\uDFFF]/u;
    var keywordRelationalOperator = /in(?:stanceof)?/y;
    function babel7CompatTokens(tokens, input, startIndex) {
      for (let i7 = 0; i7 < tokens.length; i7++) {
        const token = tokens[i7];
        const {
          type
        } = token;
        if (typeof type === "number") {
          {
            if (type === 139) {
              const {
                loc,
                start,
                value,
                end
              } = token;
              const hashEndPos = start + 1;
              const hashEndLoc = createPositionWithColumnOffset(loc.start, 1);
              tokens.splice(i7, 1, new Token4({
                type: getExportedToken(27),
                value: "#",
                start,
                end: hashEndPos,
                startLoc: loc.start,
                endLoc: hashEndLoc
              }), new Token4({
                type: getExportedToken(132),
                value,
                start: hashEndPos,
                end,
                startLoc: hashEndLoc,
                endLoc: loc.end
              }));
              i7++;
              continue;
            }
            if (tokenIsTemplate(type)) {
              const {
                loc,
                start,
                value,
                end
              } = token;
              const backquoteEnd = start + 1;
              const backquoteEndLoc = createPositionWithColumnOffset(loc.start, 1);
              let startToken;
              if (input.charCodeAt(start - startIndex) === 96) {
                startToken = new Token4({
                  type: getExportedToken(22),
                  value: "`",
                  start,
                  end: backquoteEnd,
                  startLoc: loc.start,
                  endLoc: backquoteEndLoc
                });
              } else {
                startToken = new Token4({
                  type: getExportedToken(8),
                  value: "}",
                  start,
                  end: backquoteEnd,
                  startLoc: loc.start,
                  endLoc: backquoteEndLoc
                });
              }
              let templateValue, templateElementEnd, templateElementEndLoc, endToken;
              if (type === 24) {
                templateElementEnd = end - 1;
                templateElementEndLoc = createPositionWithColumnOffset(loc.end, -1);
                templateValue = value === null ? null : value.slice(1, -1);
                endToken = new Token4({
                  type: getExportedToken(22),
                  value: "`",
                  start: templateElementEnd,
                  end,
                  startLoc: templateElementEndLoc,
                  endLoc: loc.end
                });
              } else {
                templateElementEnd = end - 2;
                templateElementEndLoc = createPositionWithColumnOffset(loc.end, -2);
                templateValue = value === null ? null : value.slice(1, -2);
                endToken = new Token4({
                  type: getExportedToken(23),
                  value: "${",
                  start: templateElementEnd,
                  end,
                  startLoc: templateElementEndLoc,
                  endLoc: loc.end
                });
              }
              tokens.splice(i7, 1, startToken, new Token4({
                type: getExportedToken(20),
                value: templateValue,
                start: backquoteEnd,
                end: templateElementEnd,
                startLoc: backquoteEndLoc,
                endLoc: templateElementEndLoc
              }), endToken);
              i7 += 2;
              continue;
            }
          }
          token.type = getExportedToken(type);
        }
      }
      return tokens;
    }
    __name(babel7CompatTokens, "babel7CompatTokens");
    var StatementParser = class extends ExpressionParser {
      static {
        __name(this, "StatementParser");
      }
      parseTopLevel(file3, program) {
        file3.program = this.parseProgram(program);
        file3.comments = this.comments;
        if (this.options.tokens) {
          file3.tokens = babel7CompatTokens(this.tokens, this.input, this.startIndex);
        }
        return this.finishNode(file3, "File");
      }
      parseProgram(program, end = 140, sourceType = this.options.sourceType) {
        program.sourceType = sourceType;
        program.interpreter = this.parseInterpreterDirective();
        this.parseBlockBody(program, true, true, end);
        if (this.inModule) {
          if (!this.options.allowUndeclaredExports && this.scope.undefinedExports.size > 0) {
            for (const [localName, at3] of Array.from(this.scope.undefinedExports)) {
              this.raise(Errors.ModuleExportUndefined, at3, {
                localName
              });
            }
          }
          this.addExtra(program, "topLevelAwait", this.state.hasTopLevelAwait);
        }
        let finishedProgram;
        if (end === 140) {
          finishedProgram = this.finishNode(program, "Program");
        } else {
          finishedProgram = this.finishNodeAt(program, "Program", createPositionWithColumnOffset(this.state.startLoc, -1));
        }
        return finishedProgram;
      }
      stmtToDirective(stmt) {
        const directive = stmt;
        directive.type = "Directive";
        directive.value = directive.expression;
        delete directive.expression;
        const directiveLiteral = directive.value;
        const expressionValue = directiveLiteral.value;
        const raw = this.input.slice(this.offsetToSourcePos(directiveLiteral.start), this.offsetToSourcePos(directiveLiteral.end));
        const val2 = directiveLiteral.value = raw.slice(1, -1);
        this.addExtra(directiveLiteral, "raw", raw);
        this.addExtra(directiveLiteral, "rawValue", val2);
        this.addExtra(directiveLiteral, "expressionValue", expressionValue);
        directiveLiteral.type = "DirectiveLiteral";
        return directive;
      }
      parseInterpreterDirective() {
        if (!this.match(28)) {
          return null;
        }
        const node2 = this.startNode();
        node2.value = this.state.value;
        this.next();
        return this.finishNode(node2, "InterpreterDirective");
      }
      isLet() {
        if (!this.isContextual(100)) {
          return false;
        }
        return this.hasFollowingBindingAtom();
      }
      chStartsBindingIdentifier(ch2, pos) {
        if (isIdentifierStart(ch2)) {
          keywordRelationalOperator.lastIndex = pos;
          if (keywordRelationalOperator.test(this.input)) {
            const endCh = this.codePointAtPos(keywordRelationalOperator.lastIndex);
            if (!isIdentifierChar(endCh) && endCh !== 92) {
              return false;
            }
          }
          return true;
        } else if (ch2 === 92) {
          return true;
        } else {
          return false;
        }
      }
      chStartsBindingPattern(ch2) {
        return ch2 === 91 || ch2 === 123;
      }
      hasFollowingBindingAtom() {
        const next = this.nextTokenStart();
        const nextCh = this.codePointAtPos(next);
        return this.chStartsBindingPattern(nextCh) || this.chStartsBindingIdentifier(nextCh, next);
      }
      hasInLineFollowingBindingIdentifierOrBrace() {
        const next = this.nextTokenInLineStart();
        const nextCh = this.codePointAtPos(next);
        return nextCh === 123 || this.chStartsBindingIdentifier(nextCh, next);
      }
      startsUsingForOf() {
        const {
          type,
          containsEsc
        } = this.lookahead();
        if (type === 102 && !containsEsc) {
          return false;
        } else if (tokenIsIdentifier(type) && !this.hasFollowingLineBreak()) {
          this.expectPlugin("explicitResourceManagement");
          return true;
        }
      }
      startsAwaitUsing() {
        let next = this.nextTokenInLineStart();
        if (this.isUnparsedContextual(next, "using")) {
          next = this.nextTokenInLineStartSince(next + 5);
          const nextCh = this.codePointAtPos(next);
          if (this.chStartsBindingIdentifier(nextCh, next)) {
            this.expectPlugin("explicitResourceManagement");
            return true;
          }
        }
        return false;
      }
      parseModuleItem() {
        return this.parseStatementLike(1 | 2 | 4 | 8);
      }
      parseStatementListItem() {
        return this.parseStatementLike(2 | 4 | (!this.options.annexB || this.state.strict ? 0 : 8));
      }
      parseStatementOrSloppyAnnexBFunctionDeclaration(allowLabeledFunction = false) {
        let flags2 = 0;
        if (this.options.annexB && !this.state.strict) {
          flags2 |= 4;
          if (allowLabeledFunction) {
            flags2 |= 8;
          }
        }
        return this.parseStatementLike(flags2);
      }
      parseStatement() {
        return this.parseStatementLike(0);
      }
      parseStatementLike(flags2) {
        let decorators = null;
        if (this.match(26)) {
          decorators = this.parseDecorators(true);
        }
        return this.parseStatementContent(flags2, decorators);
      }
      parseStatementContent(flags2, decorators) {
        const startType = this.state.type;
        const node2 = this.startNode();
        const allowDeclaration = !!(flags2 & 2);
        const allowFunctionDeclaration = !!(flags2 & 4);
        const topLevel = flags2 & 1;
        switch (startType) {
          case 60:
            return this.parseBreakContinueStatement(node2, true);
          case 63:
            return this.parseBreakContinueStatement(node2, false);
          case 64:
            return this.parseDebuggerStatement(node2);
          case 90:
            return this.parseDoWhileStatement(node2);
          case 91:
            return this.parseForStatement(node2);
          case 68:
            if (this.lookaheadCharCode() === 46) break;
            if (!allowFunctionDeclaration) {
              this.raise(this.state.strict ? Errors.StrictFunction : this.options.annexB ? Errors.SloppyFunctionAnnexB : Errors.SloppyFunction, this.state.startLoc);
            }
            return this.parseFunctionStatement(node2, false, !allowDeclaration && allowFunctionDeclaration);
          case 80:
            if (!allowDeclaration) this.unexpected();
            return this.parseClass(this.maybeTakeDecorators(decorators, node2), true);
          case 69:
            return this.parseIfStatement(node2);
          case 70:
            return this.parseReturnStatement(node2);
          case 71:
            return this.parseSwitchStatement(node2);
          case 72:
            return this.parseThrowStatement(node2);
          case 73:
            return this.parseTryStatement(node2);
          case 96:
            if (!this.state.containsEsc && this.startsAwaitUsing()) {
              if (!this.recordAwaitIfAllowed()) {
                this.raise(Errors.AwaitUsingNotInAsyncContext, node2);
              } else if (!allowDeclaration) {
                this.raise(Errors.UnexpectedLexicalDeclaration, node2);
              }
              this.next();
              return this.parseVarStatement(node2, "await using");
            }
            break;
          case 107:
            if (this.state.containsEsc || !this.hasInLineFollowingBindingIdentifierOrBrace()) {
              break;
            }
            this.expectPlugin("explicitResourceManagement");
            if (!this.scope.inModule && this.scope.inTopLevel) {
              this.raise(Errors.UnexpectedUsingDeclaration, this.state.startLoc);
            } else if (!allowDeclaration) {
              this.raise(Errors.UnexpectedLexicalDeclaration, this.state.startLoc);
            }
            return this.parseVarStatement(node2, "using");
          case 100: {
            if (this.state.containsEsc) {
              break;
            }
            const next = this.nextTokenStart();
            const nextCh = this.codePointAtPos(next);
            if (nextCh !== 91) {
              if (!allowDeclaration && this.hasFollowingLineBreak()) break;
              if (!this.chStartsBindingIdentifier(nextCh, next) && nextCh !== 123) {
                break;
              }
            }
          }
          case 75: {
            if (!allowDeclaration) {
              this.raise(Errors.UnexpectedLexicalDeclaration, this.state.startLoc);
            }
          }
          case 74: {
            const kind2 = this.state.value;
            return this.parseVarStatement(node2, kind2);
          }
          case 92:
            return this.parseWhileStatement(node2);
          case 76:
            return this.parseWithStatement(node2);
          case 5:
            return this.parseBlock();
          case 13:
            return this.parseEmptyStatement(node2);
          case 83: {
            const nextTokenCharCode = this.lookaheadCharCode();
            if (nextTokenCharCode === 40 || nextTokenCharCode === 46) {
              break;
            }
          }
          case 82: {
            if (!this.options.allowImportExportEverywhere && !topLevel) {
              this.raise(Errors.UnexpectedImportExport, this.state.startLoc);
            }
            this.next();
            let result;
            if (startType === 83) {
              result = this.parseImport(node2);
              if (result.type === "ImportDeclaration" && (!result.importKind || result.importKind === "value")) {
                this.sawUnambiguousESM = true;
              }
            } else {
              result = this.parseExport(node2, decorators);
              if (result.type === "ExportNamedDeclaration" && (!result.exportKind || result.exportKind === "value") || result.type === "ExportAllDeclaration" && (!result.exportKind || result.exportKind === "value") || result.type === "ExportDefaultDeclaration") {
                this.sawUnambiguousESM = true;
              }
            }
            this.assertModuleNodeAllowed(result);
            return result;
          }
          default: {
            if (this.isAsyncFunction()) {
              if (!allowDeclaration) {
                this.raise(Errors.AsyncFunctionInSingleStatementContext, this.state.startLoc);
              }
              this.next();
              return this.parseFunctionStatement(node2, true, !allowDeclaration && allowFunctionDeclaration);
            }
          }
        }
        const maybeName = this.state.value;
        const expr = this.parseExpression();
        if (tokenIsIdentifier(startType) && expr.type === "Identifier" && this.eat(14)) {
          return this.parseLabeledStatement(node2, maybeName, expr, flags2);
        } else {
          return this.parseExpressionStatement(node2, expr, decorators);
        }
      }
      assertModuleNodeAllowed(node2) {
        if (!this.options.allowImportExportEverywhere && !this.inModule) {
          this.raise(Errors.ImportOutsideModule, node2);
        }
      }
      decoratorsEnabledBeforeExport() {
        if (this.hasPlugin("decorators-legacy")) return true;
        return this.hasPlugin("decorators") && this.getPluginOption("decorators", "decoratorsBeforeExport") !== false;
      }
      maybeTakeDecorators(maybeDecorators, classNode, exportNode) {
        if (maybeDecorators) {
          if (classNode.decorators && classNode.decorators.length > 0) {
            if (typeof this.getPluginOption("decorators", "decoratorsBeforeExport") !== "boolean") {
              this.raise(Errors.DecoratorsBeforeAfterExport, classNode.decorators[0]);
            }
            classNode.decorators.unshift(...maybeDecorators);
          } else {
            classNode.decorators = maybeDecorators;
          }
          this.resetStartLocationFromNode(classNode, maybeDecorators[0]);
          if (exportNode) this.resetStartLocationFromNode(exportNode, classNode);
        }
        return classNode;
      }
      canHaveLeadingDecorator() {
        return this.match(80);
      }
      parseDecorators(allowExport) {
        const decorators = [];
        do {
          decorators.push(this.parseDecorator());
        } while (this.match(26));
        if (this.match(82)) {
          if (!allowExport) {
            this.unexpected();
          }
          if (!this.decoratorsEnabledBeforeExport()) {
            this.raise(Errors.DecoratorExportClass, this.state.startLoc);
          }
        } else if (!this.canHaveLeadingDecorator()) {
          throw this.raise(Errors.UnexpectedLeadingDecorator, this.state.startLoc);
        }
        return decorators;
      }
      parseDecorator() {
        this.expectOnePlugin(["decorators", "decorators-legacy"]);
        const node2 = this.startNode();
        this.next();
        if (this.hasPlugin("decorators")) {
          const startLoc = this.state.startLoc;
          let expr;
          if (this.match(10)) {
            const startLoc2 = this.state.startLoc;
            this.next();
            expr = this.parseExpression();
            this.expect(11);
            expr = this.wrapParenthesis(startLoc2, expr);
            const paramsStartLoc = this.state.startLoc;
            node2.expression = this.parseMaybeDecoratorArguments(expr);
            if (this.getPluginOption("decorators", "allowCallParenthesized") === false && node2.expression !== expr) {
              this.raise(Errors.DecoratorArgumentsOutsideParentheses, paramsStartLoc);
            }
          } else {
            expr = this.parseIdentifier(false);
            while (this.eat(16)) {
              const node3 = this.startNodeAt(startLoc);
              node3.object = expr;
              if (this.match(139)) {
                this.classScope.usePrivateName(this.state.value, this.state.startLoc);
                node3.property = this.parsePrivateName();
              } else {
                node3.property = this.parseIdentifier(true);
              }
              node3.computed = false;
              expr = this.finishNode(node3, "MemberExpression");
            }
            node2.expression = this.parseMaybeDecoratorArguments(expr);
          }
        } else {
          node2.expression = this.parseExprSubscripts();
        }
        return this.finishNode(node2, "Decorator");
      }
      parseMaybeDecoratorArguments(expr) {
        if (this.eat(10)) {
          const node2 = this.startNodeAtNode(expr);
          node2.callee = expr;
          node2.arguments = this.parseCallExpressionArguments(11);
          this.toReferencedList(node2.arguments);
          return this.finishNode(node2, "CallExpression");
        }
        return expr;
      }
      parseBreakContinueStatement(node2, isBreak) {
        this.next();
        if (this.isLineTerminator()) {
          node2.label = null;
        } else {
          node2.label = this.parseIdentifier();
          this.semicolon();
        }
        this.verifyBreakContinue(node2, isBreak);
        return this.finishNode(node2, isBreak ? "BreakStatement" : "ContinueStatement");
      }
      verifyBreakContinue(node2, isBreak) {
        let i7;
        for (i7 = 0; i7 < this.state.labels.length; ++i7) {
          const lab = this.state.labels[i7];
          if (node2.label == null || lab.name === node2.label.name) {
            if (lab.kind != null && (isBreak || lab.kind === 1)) {
              break;
            }
            if (node2.label && isBreak) break;
          }
        }
        if (i7 === this.state.labels.length) {
          const type = isBreak ? "BreakStatement" : "ContinueStatement";
          this.raise(Errors.IllegalBreakContinue, node2, {
            type
          });
        }
      }
      parseDebuggerStatement(node2) {
        this.next();
        this.semicolon();
        return this.finishNode(node2, "DebuggerStatement");
      }
      parseHeaderExpression() {
        this.expect(10);
        const val2 = this.parseExpression();
        this.expect(11);
        return val2;
      }
      parseDoWhileStatement(node2) {
        this.next();
        this.state.labels.push(loopLabel);
        node2.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement());
        this.state.labels.pop();
        this.expect(92);
        node2.test = this.parseHeaderExpression();
        this.eat(13);
        return this.finishNode(node2, "DoWhileStatement");
      }
      parseForStatement(node2) {
        this.next();
        this.state.labels.push(loopLabel);
        let awaitAt = null;
        if (this.isContextual(96) && this.recordAwaitIfAllowed()) {
          awaitAt = this.state.startLoc;
          this.next();
        }
        this.scope.enter(0);
        this.expect(10);
        if (this.match(13)) {
          if (awaitAt !== null) {
            this.unexpected(awaitAt);
          }
          return this.parseFor(node2, null);
        }
        const startsWithLet = this.isContextual(100);
        {
          const startsWithAwaitUsing = this.isContextual(96) && this.startsAwaitUsing();
          const starsWithUsingDeclaration = startsWithAwaitUsing || this.isContextual(107) && this.startsUsingForOf();
          const isLetOrUsing = startsWithLet && this.hasFollowingBindingAtom() || starsWithUsingDeclaration;
          if (this.match(74) || this.match(75) || isLetOrUsing) {
            const initNode = this.startNode();
            let kind2;
            if (startsWithAwaitUsing) {
              kind2 = "await using";
              if (!this.recordAwaitIfAllowed()) {
                this.raise(Errors.AwaitUsingNotInAsyncContext, this.state.startLoc);
              }
              this.next();
            } else {
              kind2 = this.state.value;
            }
            this.next();
            this.parseVar(initNode, true, kind2);
            const init5 = this.finishNode(initNode, "VariableDeclaration");
            const isForIn = this.match(58);
            if (isForIn && starsWithUsingDeclaration) {
              this.raise(Errors.ForInUsing, init5);
            }
            if ((isForIn || this.isContextual(102)) && init5.declarations.length === 1) {
              return this.parseForIn(node2, init5, awaitAt);
            }
            if (awaitAt !== null) {
              this.unexpected(awaitAt);
            }
            return this.parseFor(node2, init5);
          }
        }
        const startsWithAsync = this.isContextual(95);
        const refExpressionErrors = new ExpressionErrors();
        const init4 = this.parseExpression(true, refExpressionErrors);
        const isForOf = this.isContextual(102);
        if (isForOf) {
          if (startsWithLet) {
            this.raise(Errors.ForOfLet, init4);
          }
          if (awaitAt === null && startsWithAsync && init4.type === "Identifier") {
            this.raise(Errors.ForOfAsync, init4);
          }
        }
        if (isForOf || this.match(58)) {
          this.checkDestructuringPrivate(refExpressionErrors);
          this.toAssignable(init4, true);
          const type = isForOf ? "ForOfStatement" : "ForInStatement";
          this.checkLVal(init4, {
            type
          });
          return this.parseForIn(node2, init4, awaitAt);
        } else {
          this.checkExpressionErrors(refExpressionErrors, true);
        }
        if (awaitAt !== null) {
          this.unexpected(awaitAt);
        }
        return this.parseFor(node2, init4);
      }
      parseFunctionStatement(node2, isAsync4, isHangingDeclaration) {
        this.next();
        return this.parseFunction(node2, 1 | (isHangingDeclaration ? 2 : 0) | (isAsync4 ? 8 : 0));
      }
      parseIfStatement(node2) {
        this.next();
        node2.test = this.parseHeaderExpression();
        node2.consequent = this.parseStatementOrSloppyAnnexBFunctionDeclaration();
        node2.alternate = this.eat(66) ? this.parseStatementOrSloppyAnnexBFunctionDeclaration() : null;
        return this.finishNode(node2, "IfStatement");
      }
      parseReturnStatement(node2) {
        if (!this.prodParam.hasReturn && !this.options.allowReturnOutsideFunction) {
          this.raise(Errors.IllegalReturn, this.state.startLoc);
        }
        this.next();
        if (this.isLineTerminator()) {
          node2.argument = null;
        } else {
          node2.argument = this.parseExpression();
          this.semicolon();
        }
        return this.finishNode(node2, "ReturnStatement");
      }
      parseSwitchStatement(node2) {
        this.next();
        node2.discriminant = this.parseHeaderExpression();
        const cases = node2.cases = [];
        this.expect(5);
        this.state.labels.push(switchLabel);
        this.scope.enter(0);
        let cur;
        for (let sawDefault; !this.match(8); ) {
          if (this.match(61) || this.match(65)) {
            const isCase = this.match(61);
            if (cur) this.finishNode(cur, "SwitchCase");
            cases.push(cur = this.startNode());
            cur.consequent = [];
            this.next();
            if (isCase) {
              cur.test = this.parseExpression();
            } else {
              if (sawDefault) {
                this.raise(Errors.MultipleDefaultsInSwitch, this.state.lastTokStartLoc);
              }
              sawDefault = true;
              cur.test = null;
            }
            this.expect(14);
          } else {
            if (cur) {
              cur.consequent.push(this.parseStatementListItem());
            } else {
              this.unexpected();
            }
          }
        }
        this.scope.exit();
        if (cur) this.finishNode(cur, "SwitchCase");
        this.next();
        this.state.labels.pop();
        return this.finishNode(node2, "SwitchStatement");
      }
      parseThrowStatement(node2) {
        this.next();
        if (this.hasPrecedingLineBreak()) {
          this.raise(Errors.NewlineAfterThrow, this.state.lastTokEndLoc);
        }
        node2.argument = this.parseExpression();
        this.semicolon();
        return this.finishNode(node2, "ThrowStatement");
      }
      parseCatchClauseParam() {
        const param = this.parseBindingAtom();
        this.scope.enter(this.options.annexB && param.type === "Identifier" ? 8 : 0);
        this.checkLVal(param, {
          type: "CatchClause"
        }, 9);
        return param;
      }
      parseTryStatement(node2) {
        this.next();
        node2.block = this.parseBlock();
        node2.handler = null;
        if (this.match(62)) {
          const clause = this.startNode();
          this.next();
          if (this.match(10)) {
            this.expect(10);
            clause.param = this.parseCatchClauseParam();
            this.expect(11);
          } else {
            clause.param = null;
            this.scope.enter(0);
          }
          clause.body = this.withSmartMixTopicForbiddingContext(() => this.parseBlock(false, false));
          this.scope.exit();
          node2.handler = this.finishNode(clause, "CatchClause");
        }
        node2.finalizer = this.eat(67) ? this.parseBlock() : null;
        if (!node2.handler && !node2.finalizer) {
          this.raise(Errors.NoCatchOrFinally, node2);
        }
        return this.finishNode(node2, "TryStatement");
      }
      parseVarStatement(node2, kind2, allowMissingInitializer = false) {
        this.next();
        this.parseVar(node2, false, kind2, allowMissingInitializer);
        this.semicolon();
        return this.finishNode(node2, "VariableDeclaration");
      }
      parseWhileStatement(node2) {
        this.next();
        node2.test = this.parseHeaderExpression();
        this.state.labels.push(loopLabel);
        node2.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement());
        this.state.labels.pop();
        return this.finishNode(node2, "WhileStatement");
      }
      parseWithStatement(node2) {
        if (this.state.strict) {
          this.raise(Errors.StrictWith, this.state.startLoc);
        }
        this.next();
        node2.object = this.parseHeaderExpression();
        node2.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement());
        return this.finishNode(node2, "WithStatement");
      }
      parseEmptyStatement(node2) {
        this.next();
        return this.finishNode(node2, "EmptyStatement");
      }
      parseLabeledStatement(node2, maybeName, expr, flags2) {
        for (const label of this.state.labels) {
          if (label.name === maybeName) {
            this.raise(Errors.LabelRedeclaration, expr, {
              labelName: maybeName
            });
          }
        }
        const kind2 = tokenIsLoop(this.state.type) ? 1 : this.match(71) ? 2 : null;
        for (let i7 = this.state.labels.length - 1; i7 >= 0; i7--) {
          const label = this.state.labels[i7];
          if (label.statementStart === node2.start) {
            label.statementStart = this.sourceToOffsetPos(this.state.start);
            label.kind = kind2;
          } else {
            break;
          }
        }
        this.state.labels.push({
          name: maybeName,
          kind: kind2,
          statementStart: this.sourceToOffsetPos(this.state.start)
        });
        node2.body = flags2 & 8 ? this.parseStatementOrSloppyAnnexBFunctionDeclaration(true) : this.parseStatement();
        this.state.labels.pop();
        node2.label = expr;
        return this.finishNode(node2, "LabeledStatement");
      }
      parseExpressionStatement(node2, expr, decorators) {
        node2.expression = expr;
        this.semicolon();
        return this.finishNode(node2, "ExpressionStatement");
      }
      parseBlock(allowDirectives = false, createNewLexicalScope = true, afterBlockParse) {
        const node2 = this.startNode();
        if (allowDirectives) {
          this.state.strictErrors.clear();
        }
        this.expect(5);
        if (createNewLexicalScope) {
          this.scope.enter(0);
        }
        this.parseBlockBody(node2, allowDirectives, false, 8, afterBlockParse);
        if (createNewLexicalScope) {
          this.scope.exit();
        }
        return this.finishNode(node2, "BlockStatement");
      }
      isValidDirective(stmt) {
        return stmt.type === "ExpressionStatement" && stmt.expression.type === "StringLiteral" && !stmt.expression.extra.parenthesized;
      }
      parseBlockBody(node2, allowDirectives, topLevel, end, afterBlockParse) {
        const body = node2.body = [];
        const directives = node2.directives = [];
        this.parseBlockOrModuleBlockBody(body, allowDirectives ? directives : void 0, topLevel, end, afterBlockParse);
      }
      parseBlockOrModuleBlockBody(body, directives, topLevel, end, afterBlockParse) {
        const oldStrict = this.state.strict;
        let hasStrictModeDirective = false;
        let parsedNonDirective = false;
        while (!this.match(end)) {
          const stmt = topLevel ? this.parseModuleItem() : this.parseStatementListItem();
          if (directives && !parsedNonDirective) {
            if (this.isValidDirective(stmt)) {
              const directive = this.stmtToDirective(stmt);
              directives.push(directive);
              if (!hasStrictModeDirective && directive.value.value === "use strict") {
                hasStrictModeDirective = true;
                this.setStrict(true);
              }
              continue;
            }
            parsedNonDirective = true;
            this.state.strictErrors.clear();
          }
          body.push(stmt);
        }
        afterBlockParse == null || afterBlockParse.call(this, hasStrictModeDirective);
        if (!oldStrict) {
          this.setStrict(false);
        }
        this.next();
      }
      parseFor(node2, init4) {
        node2.init = init4;
        this.semicolon(false);
        node2.test = this.match(13) ? null : this.parseExpression();
        this.semicolon(false);
        node2.update = this.match(11) ? null : this.parseExpression();
        this.expect(11);
        node2.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement());
        this.scope.exit();
        this.state.labels.pop();
        return this.finishNode(node2, "ForStatement");
      }
      parseForIn(node2, init4, awaitAt) {
        const isForIn = this.match(58);
        this.next();
        if (isForIn) {
          if (awaitAt !== null) this.unexpected(awaitAt);
        } else {
          node2.await = awaitAt !== null;
        }
        if (init4.type === "VariableDeclaration" && init4.declarations[0].init != null && (!isForIn || !this.options.annexB || this.state.strict || init4.kind !== "var" || init4.declarations[0].id.type !== "Identifier")) {
          this.raise(Errors.ForInOfLoopInitializer, init4, {
            type: isForIn ? "ForInStatement" : "ForOfStatement"
          });
        }
        if (init4.type === "AssignmentPattern") {
          this.raise(Errors.InvalidLhs, init4, {
            ancestor: {
              type: "ForStatement"
            }
          });
        }
        node2.left = init4;
        node2.right = isForIn ? this.parseExpression() : this.parseMaybeAssignAllowIn();
        this.expect(11);
        node2.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement());
        this.scope.exit();
        this.state.labels.pop();
        return this.finishNode(node2, isForIn ? "ForInStatement" : "ForOfStatement");
      }
      parseVar(node2, isFor, kind2, allowMissingInitializer = false) {
        const declarations = node2.declarations = [];
        node2.kind = kind2;
        for (; ; ) {
          const decl = this.startNode();
          this.parseVarId(decl, kind2);
          decl.init = !this.eat(29) ? null : isFor ? this.parseMaybeAssignDisallowIn() : this.parseMaybeAssignAllowIn();
          if (decl.init === null && !allowMissingInitializer) {
            if (decl.id.type !== "Identifier" && !(isFor && (this.match(58) || this.isContextual(102)))) {
              this.raise(Errors.DeclarationMissingInitializer, this.state.lastTokEndLoc, {
                kind: "destructuring"
              });
            } else if ((kind2 === "const" || kind2 === "using" || kind2 === "await using") && !(this.match(58) || this.isContextual(102))) {
              this.raise(Errors.DeclarationMissingInitializer, this.state.lastTokEndLoc, {
                kind: kind2
              });
            }
          }
          declarations.push(this.finishNode(decl, "VariableDeclarator"));
          if (!this.eat(12)) break;
        }
        return node2;
      }
      parseVarId(decl, kind2) {
        const id = this.parseBindingAtom();
        if (kind2 === "using" || kind2 === "await using") {
          if (id.type === "ArrayPattern" || id.type === "ObjectPattern") {
            this.raise(Errors.UsingDeclarationHasBindingPattern, id.loc.start);
          }
        }
        this.checkLVal(id, {
          type: "VariableDeclarator"
        }, kind2 === "var" ? 5 : 8201);
        decl.id = id;
      }
      parseAsyncFunctionExpression(node2) {
        return this.parseFunction(node2, 8);
      }
      parseFunction(node2, flags2 = 0) {
        const hangingDeclaration = flags2 & 2;
        const isDeclaration = !!(flags2 & 1);
        const requireId = isDeclaration && !(flags2 & 4);
        const isAsync4 = !!(flags2 & 8);
        this.initFunction(node2, isAsync4);
        if (this.match(55)) {
          if (hangingDeclaration) {
            this.raise(Errors.GeneratorInSingleStatementContext, this.state.startLoc);
          }
          this.next();
          node2.generator = true;
        }
        if (isDeclaration) {
          node2.id = this.parseFunctionId(requireId);
        }
        const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;
        this.state.maybeInArrowParameters = false;
        this.scope.enter(2);
        this.prodParam.enter(functionFlags(isAsync4, node2.generator));
        if (!isDeclaration) {
          node2.id = this.parseFunctionId();
        }
        this.parseFunctionParams(node2, false);
        this.withSmartMixTopicForbiddingContext(() => {
          this.parseFunctionBodyAndFinish(node2, isDeclaration ? "FunctionDeclaration" : "FunctionExpression");
        });
        this.prodParam.exit();
        this.scope.exit();
        if (isDeclaration && !hangingDeclaration) {
          this.registerFunctionStatementId(node2);
        }
        this.state.maybeInArrowParameters = oldMaybeInArrowParameters;
        return node2;
      }
      parseFunctionId(requireId) {
        return requireId || tokenIsIdentifier(this.state.type) ? this.parseIdentifier() : null;
      }
      parseFunctionParams(node2, isConstructor) {
        this.expect(10);
        this.expressionScope.enter(newParameterDeclarationScope());
        node2.params = this.parseBindingList(11, 41, 2 | (isConstructor ? 4 : 0));
        this.expressionScope.exit();
      }
      registerFunctionStatementId(node2) {
        if (!node2.id) return;
        this.scope.declareName(node2.id.name, !this.options.annexB || this.state.strict || node2.generator || node2.async ? this.scope.treatFunctionsAsVar ? 5 : 8201 : 17, node2.id.loc.start);
      }
      parseClass(node2, isStatement, optionalId) {
        this.next();
        const oldStrict = this.state.strict;
        this.state.strict = true;
        this.parseClassId(node2, isStatement, optionalId);
        this.parseClassSuper(node2);
        node2.body = this.parseClassBody(!!node2.superClass, oldStrict);
        return this.finishNode(node2, isStatement ? "ClassDeclaration" : "ClassExpression");
      }
      isClassProperty() {
        return this.match(29) || this.match(13) || this.match(8);
      }
      isClassMethod() {
        return this.match(10);
      }
      nameIsConstructor(key) {
        return key.type === "Identifier" && key.name === "constructor" || key.type === "StringLiteral" && key.value === "constructor";
      }
      isNonstaticConstructor(method) {
        return !method.computed && !method.static && this.nameIsConstructor(method.key);
      }
      parseClassBody(hadSuperClass, oldStrict) {
        this.classScope.enter();
        const state2 = {
          hadConstructor: false,
          hadSuperClass
        };
        let decorators = [];
        const classBody = this.startNode();
        classBody.body = [];
        this.expect(5);
        this.withSmartMixTopicForbiddingContext(() => {
          while (!this.match(8)) {
            if (this.eat(13)) {
              if (decorators.length > 0) {
                throw this.raise(Errors.DecoratorSemicolon, this.state.lastTokEndLoc);
              }
              continue;
            }
            if (this.match(26)) {
              decorators.push(this.parseDecorator());
              continue;
            }
            const member = this.startNode();
            if (decorators.length) {
              member.decorators = decorators;
              this.resetStartLocationFromNode(member, decorators[0]);
              decorators = [];
            }
            this.parseClassMember(classBody, member, state2);
            if (member.kind === "constructor" && member.decorators && member.decorators.length > 0) {
              this.raise(Errors.DecoratorConstructor, member);
            }
          }
        });
        this.state.strict = oldStrict;
        this.next();
        if (decorators.length) {
          throw this.raise(Errors.TrailingDecorator, this.state.startLoc);
        }
        this.classScope.exit();
        return this.finishNode(classBody, "ClassBody");
      }
      parseClassMemberFromModifier(classBody, member) {
        const key = this.parseIdentifier(true);
        if (this.isClassMethod()) {
          const method = member;
          method.kind = "method";
          method.computed = false;
          method.key = key;
          method.static = false;
          this.pushClassMethod(classBody, method, false, false, false, false);
          return true;
        } else if (this.isClassProperty()) {
          const prop = member;
          prop.computed = false;
          prop.key = key;
          prop.static = false;
          classBody.body.push(this.parseClassProperty(prop));
          return true;
        }
        this.resetPreviousNodeTrailingComments(key);
        return false;
      }
      parseClassMember(classBody, member, state2) {
        const isStatic = this.isContextual(106);
        if (isStatic) {
          if (this.parseClassMemberFromModifier(classBody, member)) {
            return;
          }
          if (this.eat(5)) {
            this.parseClassStaticBlock(classBody, member);
            return;
          }
        }
        this.parseClassMemberWithIsStatic(classBody, member, state2, isStatic);
      }
      parseClassMemberWithIsStatic(classBody, member, state2, isStatic) {
        const publicMethod = member;
        const privateMethod = member;
        const publicProp = member;
        const privateProp = member;
        const accessorProp = member;
        const method = publicMethod;
        const publicMember = publicMethod;
        member.static = isStatic;
        this.parsePropertyNamePrefixOperator(member);
        if (this.eat(55)) {
          method.kind = "method";
          const isPrivateName = this.match(139);
          this.parseClassElementName(method);
          if (isPrivateName) {
            this.pushClassPrivateMethod(classBody, privateMethod, true, false);
            return;
          }
          if (this.isNonstaticConstructor(publicMethod)) {
            this.raise(Errors.ConstructorIsGenerator, publicMethod.key);
          }
          this.pushClassMethod(classBody, publicMethod, true, false, false, false);
          return;
        }
        const isContextual = !this.state.containsEsc && tokenIsIdentifier(this.state.type);
        const key = this.parseClassElementName(member);
        const maybeContextualKw = isContextual ? key.name : null;
        const isPrivate = this.isPrivateName(key);
        const maybeQuestionTokenStartLoc = this.state.startLoc;
        this.parsePostMemberNameModifiers(publicMember);
        if (this.isClassMethod()) {
          method.kind = "method";
          if (isPrivate) {
            this.pushClassPrivateMethod(classBody, privateMethod, false, false);
            return;
          }
          const isConstructor = this.isNonstaticConstructor(publicMethod);
          let allowsDirectSuper = false;
          if (isConstructor) {
            publicMethod.kind = "constructor";
            if (state2.hadConstructor && !this.hasPlugin("typescript")) {
              this.raise(Errors.DuplicateConstructor, key);
            }
            if (isConstructor && this.hasPlugin("typescript") && member.override) {
              this.raise(Errors.OverrideOnConstructor, key);
            }
            state2.hadConstructor = true;
            allowsDirectSuper = state2.hadSuperClass;
          }
          this.pushClassMethod(classBody, publicMethod, false, false, isConstructor, allowsDirectSuper);
        } else if (this.isClassProperty()) {
          if (isPrivate) {
            this.pushClassPrivateProperty(classBody, privateProp);
          } else {
            this.pushClassProperty(classBody, publicProp);
          }
        } else if (maybeContextualKw === "async" && !this.isLineTerminator()) {
          this.resetPreviousNodeTrailingComments(key);
          const isGenerator = this.eat(55);
          if (publicMember.optional) {
            this.unexpected(maybeQuestionTokenStartLoc);
          }
          method.kind = "method";
          const isPrivate2 = this.match(139);
          this.parseClassElementName(method);
          this.parsePostMemberNameModifiers(publicMember);
          if (isPrivate2) {
            this.pushClassPrivateMethod(classBody, privateMethod, isGenerator, true);
          } else {
            if (this.isNonstaticConstructor(publicMethod)) {
              this.raise(Errors.ConstructorIsAsync, publicMethod.key);
            }
            this.pushClassMethod(classBody, publicMethod, isGenerator, true, false, false);
          }
        } else if ((maybeContextualKw === "get" || maybeContextualKw === "set") && !(this.match(55) && this.isLineTerminator())) {
          this.resetPreviousNodeTrailingComments(key);
          method.kind = maybeContextualKw;
          const isPrivate2 = this.match(139);
          this.parseClassElementName(publicMethod);
          if (isPrivate2) {
            this.pushClassPrivateMethod(classBody, privateMethod, false, false);
          } else {
            if (this.isNonstaticConstructor(publicMethod)) {
              this.raise(Errors.ConstructorIsAccessor, publicMethod.key);
            }
            this.pushClassMethod(classBody, publicMethod, false, false, false, false);
          }
          this.checkGetterSetterParams(publicMethod);
        } else if (maybeContextualKw === "accessor" && !this.isLineTerminator()) {
          this.expectPlugin("decoratorAutoAccessors");
          this.resetPreviousNodeTrailingComments(key);
          const isPrivate2 = this.match(139);
          this.parseClassElementName(publicProp);
          this.pushClassAccessorProperty(classBody, accessorProp, isPrivate2);
        } else if (this.isLineTerminator()) {
          if (isPrivate) {
            this.pushClassPrivateProperty(classBody, privateProp);
          } else {
            this.pushClassProperty(classBody, publicProp);
          }
        } else {
          this.unexpected();
        }
      }
      parseClassElementName(member) {
        const {
          type,
          value
        } = this.state;
        if ((type === 132 || type === 134) && member.static && value === "prototype") {
          this.raise(Errors.StaticPrototype, this.state.startLoc);
        }
        if (type === 139) {
          if (value === "constructor") {
            this.raise(Errors.ConstructorClassPrivateField, this.state.startLoc);
          }
          const key = this.parsePrivateName();
          member.key = key;
          return key;
        }
        this.parsePropertyName(member);
        return member.key;
      }
      parseClassStaticBlock(classBody, member) {
        var _member$decorators;
        this.scope.enter(64 | 128 | 16);
        const oldLabels = this.state.labels;
        this.state.labels = [];
        this.prodParam.enter(0);
        const body = member.body = [];
        this.parseBlockOrModuleBlockBody(body, void 0, false, 8);
        this.prodParam.exit();
        this.scope.exit();
        this.state.labels = oldLabels;
        classBody.body.push(this.finishNode(member, "StaticBlock"));
        if ((_member$decorators = member.decorators) != null && _member$decorators.length) {
          this.raise(Errors.DecoratorStaticBlock, member);
        }
      }
      pushClassProperty(classBody, prop) {
        if (!prop.computed && this.nameIsConstructor(prop.key)) {
          this.raise(Errors.ConstructorClassField, prop.key);
        }
        classBody.body.push(this.parseClassProperty(prop));
      }
      pushClassPrivateProperty(classBody, prop) {
        const node2 = this.parseClassPrivateProperty(prop);
        classBody.body.push(node2);
        this.classScope.declarePrivateName(this.getPrivateNameSV(node2.key), 0, node2.key.loc.start);
      }
      pushClassAccessorProperty(classBody, prop, isPrivate) {
        if (!isPrivate && !prop.computed && this.nameIsConstructor(prop.key)) {
          this.raise(Errors.ConstructorClassField, prop.key);
        }
        const node2 = this.parseClassAccessorProperty(prop);
        classBody.body.push(node2);
        if (isPrivate) {
          this.classScope.declarePrivateName(this.getPrivateNameSV(node2.key), 0, node2.key.loc.start);
        }
      }
      pushClassMethod(classBody, method, isGenerator, isAsync4, isConstructor, allowsDirectSuper) {
        classBody.body.push(this.parseMethod(method, isGenerator, isAsync4, isConstructor, allowsDirectSuper, "ClassMethod", true));
      }
      pushClassPrivateMethod(classBody, method, isGenerator, isAsync4) {
        const node2 = this.parseMethod(method, isGenerator, isAsync4, false, false, "ClassPrivateMethod", true);
        classBody.body.push(node2);
        const kind2 = node2.kind === "get" ? node2.static ? 6 : 2 : node2.kind === "set" ? node2.static ? 5 : 1 : 0;
        this.declareClassPrivateMethodInScope(node2, kind2);
      }
      declareClassPrivateMethodInScope(node2, kind2) {
        this.classScope.declarePrivateName(this.getPrivateNameSV(node2.key), kind2, node2.key.loc.start);
      }
      parsePostMemberNameModifiers(methodOrProp) {
      }
      parseClassPrivateProperty(node2) {
        this.parseInitializer(node2);
        this.semicolon();
        return this.finishNode(node2, "ClassPrivateProperty");
      }
      parseClassProperty(node2) {
        this.parseInitializer(node2);
        this.semicolon();
        return this.finishNode(node2, "ClassProperty");
      }
      parseClassAccessorProperty(node2) {
        this.parseInitializer(node2);
        this.semicolon();
        return this.finishNode(node2, "ClassAccessorProperty");
      }
      parseInitializer(node2) {
        this.scope.enter(64 | 16);
        this.expressionScope.enter(newExpressionScope());
        this.prodParam.enter(0);
        node2.value = this.eat(29) ? this.parseMaybeAssignAllowIn() : null;
        this.expressionScope.exit();
        this.prodParam.exit();
        this.scope.exit();
      }
      parseClassId(node2, isStatement, optionalId, bindingType = 8331) {
        if (tokenIsIdentifier(this.state.type)) {
          node2.id = this.parseIdentifier();
          if (isStatement) {
            this.declareNameFromIdentifier(node2.id, bindingType);
          }
        } else {
          if (optionalId || !isStatement) {
            node2.id = null;
          } else {
            throw this.raise(Errors.MissingClassName, this.state.startLoc);
          }
        }
      }
      parseClassSuper(node2) {
        node2.superClass = this.eat(81) ? this.parseExprSubscripts() : null;
      }
      parseExport(node2, decorators) {
        const maybeDefaultIdentifier = this.parseMaybeImportPhase(node2, true);
        const hasDefault = this.maybeParseExportDefaultSpecifier(node2, maybeDefaultIdentifier);
        const parseAfterDefault = !hasDefault || this.eat(12);
        const hasStar = parseAfterDefault && this.eatExportStar(node2);
        const hasNamespace = hasStar && this.maybeParseExportNamespaceSpecifier(node2);
        const parseAfterNamespace = parseAfterDefault && (!hasNamespace || this.eat(12));
        const isFromRequired = hasDefault || hasStar;
        if (hasStar && !hasNamespace) {
          if (hasDefault) this.unexpected();
          if (decorators) {
            throw this.raise(Errors.UnsupportedDecoratorExport, node2);
          }
          this.parseExportFrom(node2, true);
          return this.finishNode(node2, "ExportAllDeclaration");
        }
        const hasSpecifiers = this.maybeParseExportNamedSpecifiers(node2);
        if (hasDefault && parseAfterDefault && !hasStar && !hasSpecifiers) {
          this.unexpected(null, 5);
        }
        if (hasNamespace && parseAfterNamespace) {
          this.unexpected(null, 98);
        }
        let hasDeclaration;
        if (isFromRequired || hasSpecifiers) {
          hasDeclaration = false;
          if (decorators) {
            throw this.raise(Errors.UnsupportedDecoratorExport, node2);
          }
          this.parseExportFrom(node2, isFromRequired);
        } else {
          hasDeclaration = this.maybeParseExportDeclaration(node2);
        }
        if (isFromRequired || hasSpecifiers || hasDeclaration) {
          var _node2$declaration;
          const node22 = node2;
          this.checkExport(node22, true, false, !!node22.source);
          if (((_node2$declaration = node22.declaration) == null ? void 0 : _node2$declaration.type) === "ClassDeclaration") {
            this.maybeTakeDecorators(decorators, node22.declaration, node22);
          } else if (decorators) {
            throw this.raise(Errors.UnsupportedDecoratorExport, node2);
          }
          return this.finishNode(node22, "ExportNamedDeclaration");
        }
        if (this.eat(65)) {
          const node22 = node2;
          const decl = this.parseExportDefaultExpression();
          node22.declaration = decl;
          if (decl.type === "ClassDeclaration") {
            this.maybeTakeDecorators(decorators, decl, node22);
          } else if (decorators) {
            throw this.raise(Errors.UnsupportedDecoratorExport, node2);
          }
          this.checkExport(node22, true, true);
          return this.finishNode(node22, "ExportDefaultDeclaration");
        }
        this.unexpected(null, 5);
      }
      eatExportStar(node2) {
        return this.eat(55);
      }
      maybeParseExportDefaultSpecifier(node2, maybeDefaultIdentifier) {
        if (maybeDefaultIdentifier || this.isExportDefaultSpecifier()) {
          this.expectPlugin("exportDefaultFrom", maybeDefaultIdentifier == null ? void 0 : maybeDefaultIdentifier.loc.start);
          const id = maybeDefaultIdentifier || this.parseIdentifier(true);
          const specifier = this.startNodeAtNode(id);
          specifier.exported = id;
          node2.specifiers = [this.finishNode(specifier, "ExportDefaultSpecifier")];
          return true;
        }
        return false;
      }
      maybeParseExportNamespaceSpecifier(node2) {
        if (this.isContextual(93)) {
          var _ref, _ref$specifiers;
          (_ref$specifiers = (_ref = node2).specifiers) != null ? _ref$specifiers : _ref.specifiers = [];
          const specifier = this.startNodeAt(this.state.lastTokStartLoc);
          this.next();
          specifier.exported = this.parseModuleExportName();
          node2.specifiers.push(this.finishNode(specifier, "ExportNamespaceSpecifier"));
          return true;
        }
        return false;
      }
      maybeParseExportNamedSpecifiers(node2) {
        if (this.match(5)) {
          const node22 = node2;
          if (!node22.specifiers) node22.specifiers = [];
          const isTypeExport = node22.exportKind === "type";
          node22.specifiers.push(...this.parseExportSpecifiers(isTypeExport));
          node22.source = null;
          node22.declaration = null;
          if (this.hasPlugin("importAssertions")) {
            node22.assertions = [];
          }
          return true;
        }
        return false;
      }
      maybeParseExportDeclaration(node2) {
        if (this.shouldParseExportDeclaration()) {
          node2.specifiers = [];
          node2.source = null;
          if (this.hasPlugin("importAssertions")) {
            node2.assertions = [];
          }
          node2.declaration = this.parseExportDeclaration(node2);
          return true;
        }
        return false;
      }
      isAsyncFunction() {
        if (!this.isContextual(95)) return false;
        const next = this.nextTokenInLineStart();
        return this.isUnparsedContextual(next, "function");
      }
      parseExportDefaultExpression() {
        const expr = this.startNode();
        if (this.match(68)) {
          this.next();
          return this.parseFunction(expr, 1 | 4);
        } else if (this.isAsyncFunction()) {
          this.next();
          this.next();
          return this.parseFunction(expr, 1 | 4 | 8);
        }
        if (this.match(80)) {
          return this.parseClass(expr, true, true);
        }
        if (this.match(26)) {
          if (this.hasPlugin("decorators") && this.getPluginOption("decorators", "decoratorsBeforeExport") === true) {
            this.raise(Errors.DecoratorBeforeExport, this.state.startLoc);
          }
          return this.parseClass(this.maybeTakeDecorators(this.parseDecorators(false), this.startNode()), true, true);
        }
        if (this.match(75) || this.match(74) || this.isLet()) {
          throw this.raise(Errors.UnsupportedDefaultExport, this.state.startLoc);
        }
        const res = this.parseMaybeAssignAllowIn();
        this.semicolon();
        return res;
      }
      parseExportDeclaration(node2) {
        if (this.match(80)) {
          const node3 = this.parseClass(this.startNode(), true, false);
          return node3;
        }
        return this.parseStatementListItem();
      }
      isExportDefaultSpecifier() {
        const {
          type
        } = this.state;
        if (tokenIsIdentifier(type)) {
          if (type === 95 && !this.state.containsEsc || type === 100) {
            return false;
          }
          if ((type === 130 || type === 129) && !this.state.containsEsc) {
            const {
              type: nextType
            } = this.lookahead();
            if (tokenIsIdentifier(nextType) && nextType !== 98 || nextType === 5) {
              this.expectOnePlugin(["flow", "typescript"]);
              return false;
            }
          }
        } else if (!this.match(65)) {
          return false;
        }
        const next = this.nextTokenStart();
        const hasFrom = this.isUnparsedContextual(next, "from");
        if (this.input.charCodeAt(next) === 44 || tokenIsIdentifier(this.state.type) && hasFrom) {
          return true;
        }
        if (this.match(65) && hasFrom) {
          const nextAfterFrom = this.input.charCodeAt(this.nextTokenStartSince(next + 4));
          return nextAfterFrom === 34 || nextAfterFrom === 39;
        }
        return false;
      }
      parseExportFrom(node2, expect) {
        if (this.eatContextual(98)) {
          node2.source = this.parseImportSource();
          this.checkExport(node2);
          this.maybeParseImportAttributes(node2);
          this.checkJSONModuleImport(node2);
        } else if (expect) {
          this.unexpected();
        }
        this.semicolon();
      }
      shouldParseExportDeclaration() {
        const {
          type
        } = this.state;
        if (type === 26) {
          this.expectOnePlugin(["decorators", "decorators-legacy"]);
          if (this.hasPlugin("decorators")) {
            if (this.getPluginOption("decorators", "decoratorsBeforeExport") === true) {
              this.raise(Errors.DecoratorBeforeExport, this.state.startLoc);
            }
            return true;
          }
        }
        if (this.isContextual(107)) {
          this.raise(Errors.UsingDeclarationExport, this.state.startLoc);
          return true;
        }
        if (this.isContextual(96) && this.startsAwaitUsing()) {
          this.raise(Errors.UsingDeclarationExport, this.state.startLoc);
          return true;
        }
        return type === 74 || type === 75 || type === 68 || type === 80 || this.isLet() || this.isAsyncFunction();
      }
      checkExport(node2, checkNames, isDefault, isFrom) {
        if (checkNames) {
          var _node$specifiers;
          if (isDefault) {
            this.checkDuplicateExports(node2, "default");
            if (this.hasPlugin("exportDefaultFrom")) {
              var _declaration$extra;
              const declaration = node2.declaration;
              if (declaration.type === "Identifier" && declaration.name === "from" && declaration.end - declaration.start === 4 && !((_declaration$extra = declaration.extra) != null && _declaration$extra.parenthesized)) {
                this.raise(Errors.ExportDefaultFromAsIdentifier, declaration);
              }
            }
          } else if ((_node$specifiers = node2.specifiers) != null && _node$specifiers.length) {
            for (const specifier of node2.specifiers) {
              const {
                exported
              } = specifier;
              const exportName = exported.type === "Identifier" ? exported.name : exported.value;
              this.checkDuplicateExports(specifier, exportName);
              if (!isFrom && specifier.local) {
                const {
                  local
                } = specifier;
                if (local.type !== "Identifier") {
                  this.raise(Errors.ExportBindingIsString, specifier, {
                    localName: local.value,
                    exportName
                  });
                } else {
                  this.checkReservedWord(local.name, local.loc.start, true, false);
                  this.scope.checkLocalExport(local);
                }
              }
            }
          } else if (node2.declaration) {
            const decl = node2.declaration;
            if (decl.type === "FunctionDeclaration" || decl.type === "ClassDeclaration") {
              const {
                id
              } = decl;
              if (!id) throw new Error("Assertion failure");
              this.checkDuplicateExports(node2, id.name);
            } else if (decl.type === "VariableDeclaration") {
              for (const declaration of decl.declarations) {
                this.checkDeclaration(declaration.id);
              }
            }
          }
        }
      }
      checkDeclaration(node2) {
        if (node2.type === "Identifier") {
          this.checkDuplicateExports(node2, node2.name);
        } else if (node2.type === "ObjectPattern") {
          for (const prop of node2.properties) {
            this.checkDeclaration(prop);
          }
        } else if (node2.type === "ArrayPattern") {
          for (const elem of node2.elements) {
            if (elem) {
              this.checkDeclaration(elem);
            }
          }
        } else if (node2.type === "ObjectProperty") {
          this.checkDeclaration(node2.value);
        } else if (node2.type === "RestElement") {
          this.checkDeclaration(node2.argument);
        } else if (node2.type === "AssignmentPattern") {
          this.checkDeclaration(node2.left);
        }
      }
      checkDuplicateExports(node2, exportName) {
        if (this.exportedIdentifiers.has(exportName)) {
          if (exportName === "default") {
            this.raise(Errors.DuplicateDefaultExport, node2);
          } else {
            this.raise(Errors.DuplicateExport, node2, {
              exportName
            });
          }
        }
        this.exportedIdentifiers.add(exportName);
      }
      parseExportSpecifiers(isInTypeExport) {
        const nodes = [];
        let first = true;
        this.expect(5);
        while (!this.eat(8)) {
          if (first) {
            first = false;
          } else {
            this.expect(12);
            if (this.eat(8)) break;
          }
          const isMaybeTypeOnly = this.isContextual(130);
          const isString5 = this.match(134);
          const node2 = this.startNode();
          node2.local = this.parseModuleExportName();
          nodes.push(this.parseExportSpecifier(node2, isString5, isInTypeExport, isMaybeTypeOnly));
        }
        return nodes;
      }
      parseExportSpecifier(node2, isString5, isInTypeExport, isMaybeTypeOnly) {
        if (this.eatContextual(93)) {
          node2.exported = this.parseModuleExportName();
        } else if (isString5) {
          node2.exported = cloneStringLiteral(node2.local);
        } else if (!node2.exported) {
          node2.exported = cloneIdentifier(node2.local);
        }
        return this.finishNode(node2, "ExportSpecifier");
      }
      parseModuleExportName() {
        if (this.match(134)) {
          const result = this.parseStringLiteral(this.state.value);
          const surrogate = loneSurrogate.exec(result.value);
          if (surrogate) {
            this.raise(Errors.ModuleExportNameHasLoneSurrogate, result, {
              surrogateCharCode: surrogate[0].charCodeAt(0)
            });
          }
          return result;
        }
        return this.parseIdentifier(true);
      }
      isJSONModuleImport(node2) {
        if (node2.assertions != null) {
          return node2.assertions.some(({
            key,
            value
          }) => {
            return value.value === "json" && (key.type === "Identifier" ? key.name === "type" : key.value === "type");
          });
        }
        return false;
      }
      checkImportReflection(node2) {
        const {
          specifiers
        } = node2;
        const singleBindingType = specifiers.length === 1 ? specifiers[0].type : null;
        if (node2.phase === "source") {
          if (singleBindingType !== "ImportDefaultSpecifier") {
            this.raise(Errors.SourcePhaseImportRequiresDefault, specifiers[0].loc.start);
          }
        } else if (node2.phase === "defer") {
          if (singleBindingType !== "ImportNamespaceSpecifier") {
            this.raise(Errors.DeferImportRequiresNamespace, specifiers[0].loc.start);
          }
        } else if (node2.module) {
          var _node$assertions;
          if (singleBindingType !== "ImportDefaultSpecifier") {
            this.raise(Errors.ImportReflectionNotBinding, specifiers[0].loc.start);
          }
          if (((_node$assertions = node2.assertions) == null ? void 0 : _node$assertions.length) > 0) {
            this.raise(Errors.ImportReflectionHasAssertion, specifiers[0].loc.start);
          }
        }
      }
      checkJSONModuleImport(node2) {
        if (this.isJSONModuleImport(node2) && node2.type !== "ExportAllDeclaration") {
          const {
            specifiers
          } = node2;
          if (specifiers != null) {
            const nonDefaultNamedSpecifier = specifiers.find((specifier) => {
              let imported;
              if (specifier.type === "ExportSpecifier") {
                imported = specifier.local;
              } else if (specifier.type === "ImportSpecifier") {
                imported = specifier.imported;
              }
              if (imported !== void 0) {
                return imported.type === "Identifier" ? imported.name !== "default" : imported.value !== "default";
              }
            });
            if (nonDefaultNamedSpecifier !== void 0) {
              this.raise(Errors.ImportJSONBindingNotDefault, nonDefaultNamedSpecifier.loc.start);
            }
          }
        }
      }
      isPotentialImportPhase(isExport) {
        if (isExport) return false;
        return this.isContextual(105) || this.isContextual(97) || this.isContextual(127);
      }
      applyImportPhase(node2, isExport, phase, loc) {
        if (isExport) {
          return;
        }
        if (phase === "module") {
          this.expectPlugin("importReflection", loc);
          node2.module = true;
        } else if (this.hasPlugin("importReflection")) {
          node2.module = false;
        }
        if (phase === "source") {
          this.expectPlugin("sourcePhaseImports", loc);
          node2.phase = "source";
        } else if (phase === "defer") {
          this.expectPlugin("deferredImportEvaluation", loc);
          node2.phase = "defer";
        } else if (this.hasPlugin("sourcePhaseImports")) {
          node2.phase = null;
        }
      }
      parseMaybeImportPhase(node2, isExport) {
        if (!this.isPotentialImportPhase(isExport)) {
          this.applyImportPhase(node2, isExport, null);
          return null;
        }
        const phaseIdentifier = this.parseIdentifier(true);
        const {
          type
        } = this.state;
        const isImportPhase = tokenIsKeywordOrIdentifier(type) ? type !== 98 || this.lookaheadCharCode() === 102 : type !== 12;
        if (isImportPhase) {
          this.resetPreviousIdentifierLeadingComments(phaseIdentifier);
          this.applyImportPhase(node2, isExport, phaseIdentifier.name, phaseIdentifier.loc.start);
          return null;
        } else {
          this.applyImportPhase(node2, isExport, null);
          return phaseIdentifier;
        }
      }
      isPrecedingIdImportPhase(phase) {
        const {
          type
        } = this.state;
        return tokenIsIdentifier(type) ? type !== 98 || this.lookaheadCharCode() === 102 : type !== 12;
      }
      parseImport(node2) {
        if (this.match(134)) {
          return this.parseImportSourceAndAttributes(node2);
        }
        return this.parseImportSpecifiersAndAfter(node2, this.parseMaybeImportPhase(node2, false));
      }
      parseImportSpecifiersAndAfter(node2, maybeDefaultIdentifier) {
        node2.specifiers = [];
        const hasDefault = this.maybeParseDefaultImportSpecifier(node2, maybeDefaultIdentifier);
        const parseNext = !hasDefault || this.eat(12);
        const hasStar = parseNext && this.maybeParseStarImportSpecifier(node2);
        if (parseNext && !hasStar) this.parseNamedImportSpecifiers(node2);
        this.expectContextual(98);
        return this.parseImportSourceAndAttributes(node2);
      }
      parseImportSourceAndAttributes(node2) {
        var _node$specifiers2;
        (_node$specifiers2 = node2.specifiers) != null ? _node$specifiers2 : node2.specifiers = [];
        node2.source = this.parseImportSource();
        this.maybeParseImportAttributes(node2);
        this.checkImportReflection(node2);
        this.checkJSONModuleImport(node2);
        this.semicolon();
        return this.finishNode(node2, "ImportDeclaration");
      }
      parseImportSource() {
        if (!this.match(134)) this.unexpected();
        return this.parseExprAtom();
      }
      parseImportSpecifierLocal(node2, specifier, type) {
        specifier.local = this.parseIdentifier();
        node2.specifiers.push(this.finishImportSpecifier(specifier, type));
      }
      finishImportSpecifier(specifier, type, bindingType = 8201) {
        this.checkLVal(specifier.local, {
          type
        }, bindingType);
        return this.finishNode(specifier, type);
      }
      parseImportAttributes() {
        this.expect(5);
        const attrs = [];
        const attrNames = /* @__PURE__ */ new Set();
        do {
          if (this.match(8)) {
            break;
          }
          const node2 = this.startNode();
          const keyName = this.state.value;
          if (attrNames.has(keyName)) {
            this.raise(Errors.ModuleAttributesWithDuplicateKeys, this.state.startLoc, {
              key: keyName
            });
          }
          attrNames.add(keyName);
          if (this.match(134)) {
            node2.key = this.parseStringLiteral(keyName);
          } else {
            node2.key = this.parseIdentifier(true);
          }
          this.expect(14);
          if (!this.match(134)) {
            throw this.raise(Errors.ModuleAttributeInvalidValue, this.state.startLoc);
          }
          node2.value = this.parseStringLiteral(this.state.value);
          attrs.push(this.finishNode(node2, "ImportAttribute"));
        } while (this.eat(12));
        this.expect(8);
        return attrs;
      }
      parseModuleAttributes() {
        const attrs = [];
        const attributes = /* @__PURE__ */ new Set();
        do {
          const node2 = this.startNode();
          node2.key = this.parseIdentifier(true);
          if (node2.key.name !== "type") {
            this.raise(Errors.ModuleAttributeDifferentFromType, node2.key);
          }
          if (attributes.has(node2.key.name)) {
            this.raise(Errors.ModuleAttributesWithDuplicateKeys, node2.key, {
              key: node2.key.name
            });
          }
          attributes.add(node2.key.name);
          this.expect(14);
          if (!this.match(134)) {
            throw this.raise(Errors.ModuleAttributeInvalidValue, this.state.startLoc);
          }
          node2.value = this.parseStringLiteral(this.state.value);
          attrs.push(this.finishNode(node2, "ImportAttribute"));
        } while (this.eat(12));
        return attrs;
      }
      maybeParseImportAttributes(node2) {
        let attributes;
        {
          var useWith = false;
        }
        if (this.match(76)) {
          if (this.hasPrecedingLineBreak() && this.lookaheadCharCode() === 40) {
            return;
          }
          this.next();
          if (this.hasPlugin("moduleAttributes")) {
            attributes = this.parseModuleAttributes();
          } else {
            attributes = this.parseImportAttributes();
          }
          {
            useWith = true;
          }
        } else if (this.isContextual(94) && !this.hasPrecedingLineBreak()) {
          if (!this.hasPlugin("deprecatedImportAssert") && !this.hasPlugin("importAssertions")) {
            this.raise(Errors.ImportAttributesUseAssert, this.state.startLoc);
          }
          if (!this.hasPlugin("importAssertions")) {
            this.addExtra(node2, "deprecatedAssertSyntax", true);
          }
          this.next();
          attributes = this.parseImportAttributes();
        } else {
          attributes = [];
        }
        if (!useWith && this.hasPlugin("importAssertions")) {
          node2.assertions = attributes;
        } else {
          node2.attributes = attributes;
        }
      }
      maybeParseDefaultImportSpecifier(node2, maybeDefaultIdentifier) {
        if (maybeDefaultIdentifier) {
          const specifier = this.startNodeAtNode(maybeDefaultIdentifier);
          specifier.local = maybeDefaultIdentifier;
          node2.specifiers.push(this.finishImportSpecifier(specifier, "ImportDefaultSpecifier"));
          return true;
        } else if (tokenIsKeywordOrIdentifier(this.state.type)) {
          this.parseImportSpecifierLocal(node2, this.startNode(), "ImportDefaultSpecifier");
          return true;
        }
        return false;
      }
      maybeParseStarImportSpecifier(node2) {
        if (this.match(55)) {
          const specifier = this.startNode();
          this.next();
          this.expectContextual(93);
          this.parseImportSpecifierLocal(node2, specifier, "ImportNamespaceSpecifier");
          return true;
        }
        return false;
      }
      parseNamedImportSpecifiers(node2) {
        let first = true;
        this.expect(5);
        while (!this.eat(8)) {
          if (first) {
            first = false;
          } else {
            if (this.eat(14)) {
              throw this.raise(Errors.DestructureNamedImport, this.state.startLoc);
            }
            this.expect(12);
            if (this.eat(8)) break;
          }
          const specifier = this.startNode();
          const importedIsString = this.match(134);
          const isMaybeTypeOnly = this.isContextual(130);
          specifier.imported = this.parseModuleExportName();
          const importSpecifier = this.parseImportSpecifier(specifier, importedIsString, node2.importKind === "type" || node2.importKind === "typeof", isMaybeTypeOnly, void 0);
          node2.specifiers.push(importSpecifier);
        }
      }
      parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly, bindingType) {
        if (this.eatContextual(93)) {
          specifier.local = this.parseIdentifier();
        } else {
          const {
            imported
          } = specifier;
          if (importedIsString) {
            throw this.raise(Errors.ImportBindingIsString, specifier, {
              importName: imported.value
            });
          }
          this.checkReservedWord(imported.name, specifier.loc.start, true, true);
          if (!specifier.local) {
            specifier.local = cloneIdentifier(imported);
          }
        }
        return this.finishImportSpecifier(specifier, "ImportSpecifier", bindingType);
      }
      isThisParam(param) {
        return param.type === "Identifier" && param.name === "this";
      }
    };
    var Parser2 = class extends StatementParser {
      static {
        __name(this, "Parser");
      }
      constructor(options, input, pluginsMap) {
        options = getOptions(options);
        super(options, input);
        this.options = options;
        this.initializeScopes();
        this.plugins = pluginsMap;
        this.filename = options.sourceFilename;
        this.startIndex = options.startIndex;
      }
      getScopeHandler() {
        return ScopeHandler;
      }
      parse() {
        this.enterInitialScopes();
        const file3 = this.startNode();
        const program = this.startNode();
        this.nextToken();
        file3.errors = null;
        this.parseTopLevel(file3, program);
        file3.errors = this.state.errors;
        file3.comments.length = this.state.commentsLen;
        return file3;
      }
    };
    function parse17(input, options) {
      var _options;
      if (((_options = options) == null ? void 0 : _options.sourceType) === "unambiguous") {
        options = Object.assign({}, options);
        try {
          options.sourceType = "module";
          const parser2 = getParser(options, input);
          const ast = parser2.parse();
          if (parser2.sawUnambiguousESM) {
            return ast;
          }
          if (parser2.ambiguousScriptDifferentAst) {
            try {
              options.sourceType = "script";
              return getParser(options, input).parse();
            } catch (_unused) {
            }
          } else {
            ast.program.sourceType = "script";
          }
          return ast;
        } catch (moduleError) {
          try {
            options.sourceType = "script";
            return getParser(options, input).parse();
          } catch (_unused2) {
          }
          throw moduleError;
        }
      } else {
        return getParser(options, input).parse();
      }
    }
    __name(parse17, "parse");
    function parseExpression(input, options) {
      const parser2 = getParser(options, input);
      if (parser2.options.strictMode) {
        parser2.state.strict = true;
      }
      return parser2.getExpression();
    }
    __name(parseExpression, "parseExpression");
    function generateExportedTokenTypes(internalTokenTypes) {
      const tokenTypes2 = {};
      for (const typeName of Object.keys(internalTokenTypes)) {
        tokenTypes2[typeName] = getExportedToken(internalTokenTypes[typeName]);
      }
      return tokenTypes2;
    }
    __name(generateExportedTokenTypes, "generateExportedTokenTypes");
    var tokTypes = generateExportedTokenTypes(tt2);
    function getParser(options, input) {
      let cls = Parser2;
      const pluginsMap = /* @__PURE__ */ new Map();
      if (options != null && options.plugins) {
        for (const plugin of options.plugins) {
          let name2, opts;
          if (typeof plugin === "string") {
            name2 = plugin;
          } else {
            [name2, opts] = plugin;
          }
          if (!pluginsMap.has(name2)) {
            pluginsMap.set(name2, opts || {});
          }
        }
        validatePlugins(pluginsMap);
        cls = getParserClass(pluginsMap);
      }
      return new cls(options, input, pluginsMap);
    }
    __name(getParser, "getParser");
    var parserClassCache = /* @__PURE__ */ new Map();
    function getParserClass(pluginsMap) {
      const pluginList = [];
      for (const name2 of mixinPluginNames) {
        if (pluginsMap.has(name2)) {
          pluginList.push(name2);
        }
      }
      const key = pluginList.join("|");
      let cls = parserClassCache.get(key);
      if (!cls) {
        cls = Parser2;
        for (const plugin of pluginList) {
          cls = mixinPlugins[plugin](cls);
        }
        parserClassCache.set(key, cls);
      }
      return cls;
    }
    __name(getParserClass, "getParserClass");
    exports.parse = parse17;
    exports.parseExpression = parseExpression;
    exports.tokTypes = tokTypes;
  }
});

// ../../node_modules/.pnpm/recast@0.23.11/node_modules/recast/parsers/babel.js
var require_babel2 = __commonJS({
  "../../node_modules/.pnpm/recast@0.23.11/node_modules/recast/parsers/babel.js"(exports) {
    init_import_meta_url();
    Object.defineProperty(exports, "__esModule", { value: true });
    exports.parse = exports.parser = void 0;
    var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
    var _babel_options_1 = tslib_1.__importDefault(require_babel_options());
    exports.parser = function() {
      try {
        return require_lib4();
      } catch (_a5) {
        try {
          return __require("babylon");
        } catch (_b2) {
          throw new Error("Install @babel/parser to use the `typescript`, `flow`, or `babel` parsers");
        }
      }
    }();
    function parse17(source, options) {
      var babelOptions = (0, _babel_options_1.default)(options);
      babelOptions.plugins.push("jsx", "flow", "decoratorAutoAccessors");
      return exports.parser.parse(source, babelOptions);
    }
    __name(parse17, "parse");
    exports.parse = parse17;
  }
});

// ../../node_modules/.pnpm/recast@0.23.11/node_modules/recast/parsers/typescript.js
var require_typescript2 = __commonJS({
  "../../node_modules/.pnpm/recast@0.23.11/node_modules/recast/parsers/typescript.js"(exports) {
    init_import_meta_url();
    Object.defineProperty(exports, "__esModule", { value: true });
    exports.parse = void 0;
    var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
    var babel_1 = require_babel2();
    var _babel_options_1 = tslib_1.__importDefault(require_babel_options());
    function parse17(source, options) {
      var babelOptions = (0, _babel_options_1.default)(options);
      babelOptions.plugins.push("typescript");
      return babel_1.parser.parse(source, babelOptions);
    }
    __name(parse17, "parse");
    exports.parse = parse17;
  }
});
function parseJs(src) {
  src = src.trim();
  try {
    return recast.parse(src, { parser: esprimaParser });
  } catch {
    throw new Error("Error parsing js template.");
  }
}
function parseTs(src) {
  src = src.trim();
  try {
    return recast.parse(src, { parser: typescriptParser });
  } catch {
    throw new Error("Error parsing ts template.");
  }
}
function parseFile(filePath) {
  const lang = path3__namespace.default.extname(filePath).slice(1);
  const parser2 = lang === "js" ? esprimaParser : typescriptParser;
  try {
    const fileContents = fs29.readFileSync(path3__namespace.default.resolve(filePath), "utf-8");
    if (fileContents) {
      return recast.parse(fileContents, { parser: parser2 }).program;
    }
  } catch {
    throw new Error(`Error parsing file: ${filePath}`);
  }
  return null;
}
function transformFile(filePath, methods) {
  const ast = parseFile(filePath);
  if (ast) {
    recast.visit(ast, methods);
    fs29.writeFileSync(filePath, recast.print(ast).code);
  }
}
function mergeObjectProperties(sourceObject, newProperties) {
  newProperties.forEach((newProp) => {
    const newPropName = getPropertyName(newProp);
    if (!newPropName) {
      return false;
    }
    const indexOfExisting = sourceObject.properties.findIndex(
      (p7) => p7.type === "ObjectProperty" && getPropertyName(p7) === newPropName
    );
    const existing = sourceObject.properties[indexOfExisting];
    if (!existing) {
      sourceObject.properties.push(newProp);
      return;
    }
    if (existing.type === "ObjectProperty" && existing.value.type === "ObjectExpression" && newProp.value.type === "ObjectExpression") {
      mergeObjectProperties(
        existing.value,
        newProp.value.properties
      );
      return;
    }
    sourceObject.properties[indexOfExisting] = newProp;
  });
}
function getPropertyName(newProp) {
  return newProp.key.type === "Identifier" ? newProp.key.name : newProp.key.type === "StringLiteral" ? newProp.key.value : null;
}
var recast, esprimaParser, typescriptParser, __defProp3, __name3;
var init_dist7 = __esm({
  "../codemod/dist/index.mjs"() {
    init_import_meta_url();
    recast = __toESM(require_main4(), 1);
    esprimaParser = __toESM(require_esprima3(), 1);
    typescriptParser = __toESM(require_typescript2(), 1);
    __defProp3 = Object.defineProperty;
    __name3 = /* @__PURE__ */ __name((target, value) => __defProp3(target, "name", { value, configurable: true }), "__name");
    __name(parseJs, "parseJs");
    __name3(parseJs, "parseJs");
    __name(parseTs, "parseTs");
    __name3(parseTs, "parseTs");
    __name(parseFile, "parseFile");
    __name3(parseFile, "parseFile");
    __name(transformFile, "transformFile");
    __name3(transformFile, "transformFile");
    __name(mergeObjectProperties, "mergeObjectProperties");
    __name3(mergeObjectProperties, "mergeObjectProperties");
    __name(getPropertyName, "getPropertyName");
    __name3(getPropertyName, "getPropertyName");
  }
});

// src/autoconfig/errors.ts
var AutoConfigFrameworkConfigurationError;
var init_errors6 = __esm({
  "src/autoconfig/errors.ts"() {
    init_import_meta_url();
    init_dist();
    AutoConfigFrameworkConfigurationError = class extends UserError {
      static {
        __name(this, "AutoConfigFrameworkConfigurationError");
      }
    };
  }
});
function isPackageInstalled(packageName, projectPath) {
  return !!getPackagePath(packageName, projectPath);
}
function getInstalledPackageVersion(packageName, projectPath, opts = {}) {
  try {
    const packagePath = getPackagePath(packageName, projectPath);
    if (!packagePath) {
      return void 0;
    }
    const packageJsonPath = file2("package.json", {
      cwd: packagePath,
      last: opts.stopAtProjectPath === true ? projectPath : void 0
    });
    if (!packageJsonPath) {
      return void 0;
    }
    const packageJson = parsePackageJSON(
      readFileSync(packageJsonPath),
      packageJsonPath
    );
    return packageJson.version;
  } catch {
  }
}
function getPackagePath(packageName, projectPath) {
  try {
    return path3__namespace.default.dirname(
      __require.resolve(`${packageName}/package.json`, {
        paths: [projectPath]
      })
    );
  } catch {
  }
  try {
    return __require.resolve(packageName, {
      paths: [projectPath]
    });
  } catch {
  }
  return void 0;
}
var init_packages2 = __esm({
  "src/autoconfig/frameworks/utils/packages.ts"() {
    init_import_meta_url();
    init_dist();
    init_find();
    __name(isPackageInstalled, "isPackageInstalled");
    __name(getInstalledPackageVersion, "getInstalledPackageVersion");
    __name(getPackagePath, "getPackagePath");
  }
});
exports.experimental_AutoConfigFramework = void 0;
var init_framework_class = __esm({
  "src/autoconfig/frameworks/framework-class.ts"() {
    init_import_meta_url();
    init_semiver();
    init_logger();
    init_errors6();
    init_packages2();
    exports.experimental_AutoConfigFramework = class {
      static {
        __name(this, "Framework");
      }
      id;
      name;
      #frameworkVersion;
      get frameworkVersion() {
        assert53__default.default(
          this.#frameworkVersion,
          `The version for ${JSON.stringify(this.name)} is unexpectedly missing`
        );
        return this.#frameworkVersion;
      }
      constructor(frameworkInfo) {
        this.id = frameworkInfo.id;
        this.name = frameworkInfo.name;
      }
      isConfigured(_projectPath) {
        return false;
      }
      configurationDescription;
      /**
       * Validates the installed framework version against the supported range and
       * stores it for later access via the `frameworkVersion` getter.
       * Warns via `logger` if the version exceeds `maximumKnownMajorVersion`.
       *
       * @param projectPath - Path to the project root used to resolve the installed version.
       * @param frameworkPackageInfo - Package metadata including name and version bounds.
       * @throws {AssertionError} If the installed version cannot be determined.
       * @throws {AutoConfigFrameworkConfigurationError} If the version is below `minimumVersion`.
       */
      validateFrameworkVersion(projectPath, frameworkPackageInfo) {
        const frameworkVersion = getInstalledPackageVersion(
          frameworkPackageInfo.name,
          projectPath
        );
        assert53__default.default(
          frameworkVersion,
          `Unable to detect the version of the \`${frameworkPackageInfo.name}\` package`
        );
        if (semiver_default(frameworkVersion, frameworkPackageInfo.minimumVersion) < 0) {
          throw new AutoConfigFrameworkConfigurationError(
            `The version of ${this.name} used in the project (${JSON.stringify(
              frameworkVersion
            )}) cannot be automatically configured. Please update the ${this.name} version to at least ${JSON.stringify(
              frameworkPackageInfo.minimumVersion
            )} and try again.`
          );
        }
        if (semiver_default(frameworkVersion, frameworkPackageInfo.maximumKnownMajorVersion) > 0) {
          logger.warn(
            `The version of ${this.name} used in the project (${JSON.stringify(
              frameworkVersion
            )}) is not officially supported, and may fail to correctly configure. Please report any issues to https://github.com/cloudflare/workers-sdk/issues`
          );
        }
        this.#frameworkVersion = frameworkVersion;
      }
    };
  }
});
async function updateViteConfig(projectPath) {
  const viteConfigTsPAth = path3.join(projectPath, "vite.config.ts");
  const viteConfigJsPath = path3.join(projectPath, "vite.config.js");
  let viteConfigPath;
  if (fs29.existsSync(viteConfigTsPAth)) {
    viteConfigPath = viteConfigTsPAth;
  } else if (fs29.existsSync(viteConfigJsPath)) {
    viteConfigPath = viteConfigJsPath;
  } else {
    throw new Error("Could not find Vite config file to modify");
  }
  const compatDate = getTodaysCompatDate();
  updateStatus(`Updating configuration in ${blue(viteConfigPath)}`);
  transformFile(viteConfigPath, {
    visitCallExpression: /* @__PURE__ */ __name(function(n9) {
      const callee = n9.node.callee;
      if (callee.name !== "analog") {
        return this.traverse(n9);
      }
      const b11 = recast2.types.builders;
      const presetDef = [
        b11.objectProperty(
          b11.identifier("nitro"),
          b11.objectExpression([
            // preset: "cloudflare_module"
            b11.objectProperty(
              b11.identifier("preset"),
              b11.stringLiteral("cloudflare_module")
            ),
            b11.objectProperty(
              b11.identifier("compatibilityDate"),
              b11.stringLiteral(compatDate)
            )
          ])
        )
      ];
      if (n9.node.arguments.length === 0) {
        n9.node.arguments.push(b11.objectExpression(presetDef));
      } else {
        mergeObjectProperties(
          n9.node.arguments[0],
          presetDef
        );
      }
      return false;
    }, "visitCallExpression")
  });
}
var recast2, Analog;
var init_analog = __esm({
  "src/autoconfig/frameworks/analog.ts"() {
    init_import_meta_url();
    init_cli();
    init_colors();
    init_dist7();
    init_dist();
    recast2 = __toESM(require_main4());
    init_framework_class();
    Analog = class extends exports.experimental_AutoConfigFramework {
      static {
        __name(this, "Analog");
      }
      async configure({
        dryRun,
        projectPath
      }) {
        if (!dryRun) {
          await updateViteConfig(projectPath);
        }
        return {
          wranglerConfig: {
            main: "./dist/analog/server/index.mjs",
            assets: {
              binding: "ASSETS",
              directory: "./dist/analog/public"
            }
          }
        };
      }
    };
    __name(updateViteConfig, "updateViteConfig");
  }
});

// ../cli/command.ts
function quoteShellArgs(args) {
  if (process.platform === "win32") {
    const specialCharsMatcher = /[&<>[\]|{}^=;!'+,`~\s]/;
    return args.map(
      (arg) => arg.match(specialCharsMatcher) ? `"${arg.replaceAll(`"`, `""`)}"` : arg
    ).join(" ");
  } else {
    return args.map((s7) => {
      if (/["\s]/.test(s7) && !/'/.test(s7)) {
        return "'" + s7.replace(/(['\\])/g, "\\$1") + "'";
      }
      if (/["'\s]/.test(s7)) {
        return '"' + s7.replace(/(["\\$`!])/g, "\\$1") + '"';
      }
      return s7;
    }).join(" ");
  }
}
var import_cross_spawn2, runCommand2, printAsyncStatus;
var init_command3 = __esm({
  "../cli/command.ts"() {
    init_import_meta_url();
    import_cross_spawn2 = __toESM(require_cross_spawn());
    init_error();
    init_interactive();
    init_cli();
    runCommand2 = /* @__PURE__ */ __name(async (command2, opts = {}) => {
      return printAsyncStatus({
        useSpinner: opts.useSpinner ?? opts.silent,
        startText: opts.startText || quoteShellArgs(command2),
        doneText: opts.doneText,
        promise() {
          const [executable, ...args] = command2;
          const abortController = new AbortController();
          const cmd = (0, import_cross_spawn2.spawn)(executable, [...args], {
            // TODO: ideally inherit stderr, but npm install uses this for warnings
            // stdio: [ioMode, ioMode, "inherit"],
            stdio: opts.silent ? "pipe" : "inherit",
            env: {
              ...process.env,
              ...opts.env
            },
            cwd: opts.cwd,
            signal: abortController.signal
          });
          let output = ``;
          if (opts.captureOutput ?? opts.silent) {
            cmd.stdout?.on("data", (data) => {
              output += data;
            });
            cmd.stderr?.on("data", (data) => {
              output += data;
            });
          }
          let cleanup = null;
          return new Promise((resolvePromise, reject) => {
            const cancel3 = /* @__PURE__ */ __name((signal) => {
              reject(new CancelError2(`Command cancelled`, signal));
              abortController.abort(signal ? `${signal} received` : null);
            }, "cancel");
            process.on("SIGTERM", cancel3).on("SIGINT", cancel3);
            cleanup = /* @__PURE__ */ __name(() => {
              process.off("SIGTERM", cancel3).off("SIGINT", cancel3);
            }, "cleanup");
            cmd.on("close", (code) => {
              try {
                if (code !== 0) {
                  throw new Error(output, { cause: code });
                }
                const transformOutput = opts.transformOutput ?? ((result) => result);
                const processedOutput = transformOutput(stripAnsi3(output));
                resolvePromise(processedOutput);
              } catch (e10) {
                reject(new Error(output, { cause: e10 }));
              }
            });
            cmd.on("error", (error2) => {
              reject(error2);
            });
          }).finally(() => {
            cleanup?.();
          });
        }
      });
    }, "runCommand");
    printAsyncStatus = /* @__PURE__ */ __name(async ({
      promise,
      ...opts
    }) => {
      let s7;
      if (opts.useSpinner && isInteractive2()) {
        s7 = spinner();
      }
      s7?.start(opts?.startText);
      if (typeof promise === "function") {
        promise = promise();
      }
      try {
        const output = await promise;
        const doneText = typeof opts.doneText === "function" ? opts.doneText(output) : opts.doneText;
        s7?.stop(doneText);
      } catch (err) {
        s7?.stop(err.message);
      } finally {
        s7?.stop();
      }
      return promise;
    }, "printAsyncStatus");
    __name(quoteShellArgs, "quoteShellArgs");
  }
});
function getWorkspaceInstallRootFlag(packageManager, isWorkspaceRoot) {
  if (!isWorkspaceRoot) {
    return [];
  }
  switch (packageManager) {
    case "pnpm":
      return ["--workspace-root"];
    case "yarn":
      return ["-W"];
    case "npm":
    case "bun":
      return [];
  }
}
async function installWrangler(packageManager, isWorkspaceRoot) {
  await installPackages(packageManager, [`wrangler@latest`], {
    dev: true,
    isWorkspaceRoot,
    startText: `Installing wrangler ${dim(
      "A command line tool for building Cloudflare Workers"
    )}`,
    doneText: `${brandColor("installed")} ${dim(
      `via \`${packageManager} install wrangler --save-dev\``
    )}`
  });
}
var installPackages;
var init_packages3 = __esm({
  "../cli/packages.ts"() {
    init_import_meta_url();
    init_dist();
    init_colors();
    init_command3();
    installPackages = /* @__PURE__ */ __name(async (packageManager, packages, config = {}) => {
      const { force, dev: dev2, startText, doneText } = config;
      const isWorkspaceRoot = config.isWorkspaceRoot ?? false;
      if (packages.length === 0) {
        let cmd2;
        switch (packageManager) {
          case "yarn":
            break;
          case "npm":
          case "pnpm":
          default:
            cmd2 = "install";
            break;
        }
        await runCommand2(
          [
            packageManager,
            ...cmd2 ? [cmd2] : [],
            ...packages,
            ...packageManager === "pnpm" ? ["--no-frozen-lockfile"] : [],
            ...force === true ? ["--force"] : [],
            ...getWorkspaceInstallRootFlag(packageManager, isWorkspaceRoot)
          ],
          {
            cwd: process.cwd(),
            startText,
            doneText,
            silent: true
          }
        );
        return;
      }
      let saveFlag;
      let cmd;
      switch (packageManager) {
        case "yarn":
          cmd = "add";
          saveFlag = dev2 ? "-D" : "";
          break;
        case "bun":
          cmd = "add";
          saveFlag = dev2 ? "-d" : "";
          break;
        case "npm":
        case "pnpm":
        default:
          cmd = "install";
          saveFlag = dev2 ? "--save-dev" : "";
          break;
      }
      await runCommand2(
        [
          packageManager,
          cmd,
          ...saveFlag ? [saveFlag] : [],
          ...packages,
          ...force === true ? ["--force"] : [],
          ...getWorkspaceInstallRootFlag(packageManager, isWorkspaceRoot)
        ],
        {
          startText,
          doneText,
          silent: true
        }
      );
      if (packageManager === "npm") {
        const pkgJsonPath = path3__namespace.default.join(process.cwd(), "package.json");
        const pkgJson = parsePackageJSON(readFileSync(pkgJsonPath), pkgJsonPath);
        const deps = config.dev ? pkgJson.devDependencies : pkgJson.dependencies;
        assert53__default.default(deps, "dependencies should be defined");
        for (const pkg of packages) {
          const versionMarker = pkg.lastIndexOf("@");
          if (versionMarker > 0) {
            const pkgName = pkg.slice(0, versionMarker);
            const pkgVersion = pkg.slice(versionMarker + 1);
            if (pkgVersion !== "latest") {
              deps[pkgName] = pkgVersion;
            }
          }
        }
        await fs9.writeFile(pkgJsonPath, JSON.stringify(pkgJson, null, 2));
      }
    }, "installPackages");
    __name(getWorkspaceInstallRootFlag, "getWorkspaceInstallRootFlag");
    __name(installWrangler, "installWrangler");
  }
});
function hasSsr(angularJson, projectName) {
  const ssr = angularJson.projects[projectName]?.architect?.build?.options?.ssr;
  return !!ssr;
}
async function updateAngularJson(projectName, angularJson) {
  const s7 = spinner();
  s7.start(`Updating angular.json config`);
  const architectSection = angularJson.projects[projectName].architect;
  architectSection.build.options.outputPath = "dist";
  architectSection.build.options.outputMode = "server";
  assert53__default.default(architectSection.build.options.ssr);
  if (typeof architectSection.build.options.ssr === "boolean") {
    architectSection.build.options.ssr = {};
  }
  architectSection.build.options.ssr["experimentalPlatform"] = "neutral";
  await fs9.writeFile(
    path3.resolve("angular.json"),
    JSON.stringify(angularJson, null, 2)
  );
  s7.stop(`${brandColor(`updated`)} ${dim(`\`angular.json\``)}`);
}
async function overrideServerFile() {
  await fs9.writeFile(
    path3.resolve("src/server.ts"),
    dedent3`
		import { AngularAppEngine, createRequestHandler } from '@angular/ssr';

		const angularApp = new AngularAppEngine({
			// It is safe to set allow \`localhost\`, so that SSR can run in local development,
			// as, in production, Cloudflare will ensure that \`localhost\` is not the host.
			allowedHosts: ['localhost'],
		});

		/**
		 * This is a request handler used by the Angular CLI (dev-server and during build).
		 */
		export const reqHandler = createRequestHandler(async (req) => {
			const res = await angularApp.handle(req);

			return res ?? new Response('Page not found.', { status: 404 });
		});

		export default { fetch: reqHandler };
		`
  );
}
async function installAdditionalDependencies(packageManager, isWorkspaceRoot) {
  await installPackages(packageManager.type, ["xhr2"], {
    dev: true,
    startText: "Installing additional dependencies",
    doneText: `${brandColor("installed")}`,
    isWorkspaceRoot
  });
}
var Angular;
var init_angular = __esm({
  "src/autoconfig/frameworks/angular.ts"() {
    init_import_meta_url();
    init_colors();
    init_interactive();
    init_packages3();
    init_dist();
    init_dedent();
    init_framework_class();
    Angular = class extends exports.experimental_AutoConfigFramework {
      static {
        __name(this, "Angular");
      }
      async configure({
        workerName,
        outputDir,
        dryRun,
        packageManager,
        isWorkspaceRoot
      }) {
        const angularJson = parseJSONC(
          await fs9.readFile(path3.resolve("angular.json"), "utf8")
        );
        if (hasSsr(angularJson, workerName)) {
          this.configurationDescription = "Configuring project for Angular";
          if (!dryRun) {
            await updateAngularJson(workerName, angularJson);
            await overrideServerFile();
            await installAdditionalDependencies(packageManager, isWorkspaceRoot);
          }
          return {
            wranglerConfig: {
              main: "./dist/server/server.mjs",
              assets: {
                binding: "ASSETS",
                directory: `${outputDir}browser`
              }
            }
          };
        } else {
          this.configurationDescription = "Configuring Angular SPA project (assets only)";
          return {
            wranglerConfig: {
              assets: {
                directory: outputDir
              }
            }
          };
        }
      }
    };
    __name(hasSsr, "hasSsr");
    __name(updateAngularJson, "updateAngularJson");
    __name(overrideServerFile, "overrideServerFile");
    __name(installAdditionalDependencies, "installAdditionalDependencies");
  }
});
function findAstroConfigFile(projectPath) {
  const extensions = ["mjs", "mts", "ts", "js"];
  for (const ext2 of extensions) {
    const configPath = path3.join(projectPath, `astro.config.${ext2}`);
    if (fs29.existsSync(configPath)) {
      return configPath;
    }
  }
  throw new Error(
    "Could not find Astro config file (astro.config.mjs, astro.config.mts, astro.config.ts, or astro.config.js)"
  );
}
function updateAstroConfig(projectPath, astroMajorVersion) {
  const configPath = findAstroConfigFile(projectPath);
  updateStatus(`Updating configuration in ${blue(configPath)}`);
  let adapterIdentifier = "cloudflare";
  transformFile(configPath, {
    // First pass: check for existing cloudflare import and add if missing
    visitProgram(path84) {
      const body = path84.node.body;
      const b11 = recast3.types.builders;
      let hasCloudflareImport = false;
      for (const node2 of body) {
        if (node2.type === "ImportDeclaration" && node2.source.value === "@astrojs/cloudflare") {
          hasCloudflareImport = true;
          for (const specifier of node2.specifiers ?? []) {
            if (specifier.type === "ImportDefaultSpecifier" && specifier.local) {
              const local = specifier.local;
              adapterIdentifier = local.name;
              break;
            }
          }
          break;
        }
      }
      if (!hasCloudflareImport) {
        const importDeclaration = b11.importDeclaration(
          [b11.importDefaultSpecifier(b11.identifier("cloudflare"))],
          b11.literal("@astrojs/cloudflare")
        );
        let lastImportIndex = -1;
        for (let i7 = 0; i7 < body.length; i7++) {
          if (body[i7].type === "ImportDeclaration") {
            lastImportIndex = i7;
          }
        }
        if (lastImportIndex >= 0) {
          body.splice(lastImportIndex + 1, 0, importDeclaration);
        } else {
          body.unshift(importDeclaration);
        }
      }
      this.traverse(path84);
    },
    // Second pass: add adapter (and output for Astro 4) to defineConfig
    visitCallExpression(path84) {
      const callee = path84.node.callee;
      if (callee.type !== "Identifier" || callee.name !== "defineConfig") {
        return this.traverse(path84);
      }
      const b11 = recast3.types.builders;
      const adapterProp = b11.objectProperty(
        b11.identifier("adapter"),
        b11.callExpression(b11.identifier(adapterIdentifier), [])
      );
      const propsToAdd = [];
      if (astroMajorVersion === 4) {
        const outputProp = b11.objectProperty(
          b11.identifier("output"),
          b11.literal("hybrid")
        );
        propsToAdd.push(outputProp);
      }
      propsToAdd.push(adapterProp);
      if (path84.node.arguments.length === 0) {
        path84.node.arguments.push(b11.objectExpression(propsToAdd));
      } else {
        const configArg = path84.node.arguments[0];
        if (configArg.type === "ObjectExpression") {
          mergeObjectProperties(configArg, propsToAdd);
        }
      }
      return false;
    }
  });
}
function updateTsConfig(projectPath) {
  const tsconfigPath = path3.join(projectPath, "tsconfig.json");
  if (!fs29.existsSync(tsconfigPath)) {
    return;
  }
  try {
    const content = fs29.readFileSync(tsconfigPath, "utf-8");
    const tsconfig = parseJSONC(content, tsconfigPath);
    const includeEntry = "./worker-configuration.d.ts";
    if (!tsconfig.include) {
      logger.warn(
        `Could not find an existing \`include\` field in tsconfig.json. You may need to manually add ${JSON.stringify(
          includeEntry
        )} to your tsconfig.json \`include\` array.`
      );
      return;
    }
    if (!tsconfig.include.includes(includeEntry)) {
      tsconfig.include.push(includeEntry);
      fs29.writeFileSync(tsconfigPath, JSON.stringify(tsconfig, null, "	"));
      updateStatus(
        `Updated ${blue("tsconfig.json")} to include ${blue(includeEntry)}`
      );
    }
  } catch {
    logger.warn(
      `Could not update tsconfig.json to include worker-configuration.d.ts. You may need to add it manually.`
    );
  }
}
async function configureAstroLegacy(projectPath, isWorkspaceRoot, packageManager, astroMajorVersion) {
  const astroCloudflarePackageVersion = astroMajorVersion === 5 ? 12 : 11;
  await installPackages(
    packageManager.type,
    [`@astrojs/cloudflare@${astroCloudflarePackageVersion}`],
    {
      startText: `Installing @astrojs/cloudflare adapter (version ${astroCloudflarePackageVersion})`,
      doneText: `${brandColor("installed")} ${dim("@astrojs/cloudflare")}`,
      isWorkspaceRoot
    }
  );
  updateAstroConfig(projectPath, astroMajorVersion);
  updateTsConfig(projectPath);
}
var recast3, Astro;
var init_astro = __esm({
  "src/autoconfig/frameworks/astro.ts"() {
    init_import_meta_url();
    init_cli();
    init_colors();
    init_command3();
    init_packages3();
    init_dist7();
    init_dist();
    recast3 = __toESM(require_main4());
    init_semiver();
    init_logger();
    init_framework_class();
    Astro = class extends exports.experimental_AutoConfigFramework {
      static {
        __name(this, "Astro");
      }
      async configure({
        outputDir,
        dryRun,
        packageManager,
        projectPath,
        isWorkspaceRoot
      }) {
        const astroVersion = this.frameworkVersion;
        const { npx } = packageManager;
        if (!dryRun) {
          if (semiver_default(astroVersion, "6.0.0") >= 0) {
            await runCommand2([npx, "astro", "add", "cloudflare", "-y"], {
              silent: true,
              startText: "Installing adapter",
              doneText: `${brandColor("installed")} ${dim(
                `via \`${npx} astro add cloudflare\``
              )}`
            });
          } else {
            const astroMajorVersion = semiver_default(astroVersion, "5.0.0") >= 0 ? 5 : 4;
            await configureAstroLegacy(
              projectPath,
              isWorkspaceRoot,
              packageManager,
              astroMajorVersion
            );
          }
          fs29.writeFileSync("public/.assetsignore", "_worker.js\n_routes.json");
        }
        if (semiver_default(astroVersion, "6.0.0") < 0) {
          return {
            wranglerConfig: {
              main: `${outputDir}/_worker.js/index.js`,
              compatibility_flags: ["global_fetch_strictly_public"],
              assets: {
                binding: "ASSETS",
                directory: outputDir
              }
            }
          };
        }
        return {
          wranglerConfig: null
        };
      }
      configurationDescription = 'Configuring project for Astro with "astro add cloudflare"';
    };
    __name(findAstroConfigFile, "findAstroConfigFile");
    __name(updateAstroConfig, "updateAstroConfig");
    __name(updateTsConfig, "updateTsConfig");
    __name(configureAstroLegacy, "configureAstroLegacy");
  }
});

// src/autoconfig/frameworks/hono.ts
var Hono;
var init_hono = __esm({
  "src/autoconfig/frameworks/hono.ts"() {
    init_import_meta_url();
    init_framework_class();
    Hono = class extends exports.experimental_AutoConfigFramework {
      static {
        __name(this, "Hono");
      }
      async configure() {
        return {
          wranglerConfig: {}
        };
      }
    };
  }
});

// src/autoconfig/frameworks/next.ts
var NextJs;
var init_next = __esm({
  "src/autoconfig/frameworks/next.ts"() {
    init_import_meta_url();
    init_command3();
    init_framework_class();
    NextJs = class extends exports.experimental_AutoConfigFramework {
      static {
        __name(this, "NextJs");
      }
      async configure({
        dryRun,
        projectPath,
        packageManager
      }) {
        const { npx, dlx } = packageManager;
        if (!dryRun) {
          await runCommand2(
            [
              ...dlx,
              "@opennextjs/cloudflare",
              "migrate",
              // Note: we force-install so that even if an incompatible version of
              //       Next.js is used this installation still succeeds, moving users
              //       (hopefully) in right direction (instead of failing at this step)
              "--force-install"
            ],
            {
              cwd: projectPath
            }
          );
        }
        return {
          // `@opennextjs/cloudflare migrate` creates the wrangler config file
          wranglerConfig: {},
          packageJsonScriptsOverrides: {
            preview: "opennextjs-cloudflare build && opennextjs-cloudflare preview",
            deploy: "opennextjs-cloudflare build && opennextjs-cloudflare deploy"
          },
          buildCommandOverride: `${npx} opennextjs-cloudflare build`,
          deployCommandOverride: `${npx} opennextjs-cloudflare deploy`,
          versionCommandOverride: `${npx} opennextjs-cloudflare upload`
        };
      }
      configurationDescription = "Configuring project for Next.js with OpenNext by running `@opennextjs/cloudflare migrate`";
    };
  }
});
var recast4, updateNuxtConfig, Nuxt;
var init_nuxt = __esm({
  "src/autoconfig/frameworks/nuxt.ts"() {
    init_import_meta_url();
    init_colors();
    init_packages3();
    init_dist7();
    recast4 = __toESM(require_main4());
    init_framework_class();
    updateNuxtConfig = /* @__PURE__ */ __name((projectPath) => {
      const configFile = path3__namespace.default.join(projectPath, "nuxt.config.ts");
      const b11 = recast4.types.builders;
      const presetDef = b11.objectProperty(
        b11.identifier("nitro"),
        b11.objectExpression([
          b11.objectProperty(
            b11.identifier("preset"),
            b11.stringLiteral("cloudflare_module")
          ),
          b11.objectProperty(
            b11.identifier("cloudflare"),
            b11.objectExpression([
              b11.objectProperty(
                b11.identifier("deployConfig"),
                b11.booleanLiteral(true)
              ),
              b11.objectProperty(b11.identifier("nodeCompat"), b11.booleanLiteral(true))
            ])
          )
        ])
      );
      const moduleDef = b11.objectProperty(
        b11.identifier("modules"),
        b11.arrayExpression([b11.stringLiteral("nitro-cloudflare-dev")])
      );
      transformFile(configFile, {
        visitCallExpression: /* @__PURE__ */ __name(function(n9) {
          const callee = n9.node.callee;
          if (callee.name === "defineNuxtConfig") {
            mergeObjectProperties(
              n9.node.arguments[0],
              [presetDef, moduleDef]
            );
          }
          return this.traverse(n9);
        }, "visitCallExpression")
      });
    }, "updateNuxtConfig");
    Nuxt = class extends exports.experimental_AutoConfigFramework {
      static {
        __name(this, "Nuxt");
      }
      async configure({
        dryRun,
        projectPath,
        packageManager,
        isWorkspaceRoot
      }) {
        if (!dryRun) {
          await installPackages(packageManager.type, ["nitro-cloudflare-dev"], {
            dev: true,
            startText: "Installing the Cloudflare dev module",
            doneText: `${brandColor(`installed`)} ${dim("nitro-cloudflare-dev")}`,
            isWorkspaceRoot
          });
          updateNuxtConfig(projectPath);
        }
        return {
          wranglerConfig: {
            main: "./.output/server/index.mjs",
            assets: {
              binding: "ASSETS",
              directory: "./.output/public/"
            },
            observability: {
              enabled: true
            }
          }
        };
      }
      configurationDescription = "Configuring project for Nuxt";
    };
  }
});

// src/autoconfig/frameworks/pages.ts
var CloudflarePages;
var init_pages3 = __esm({
  "src/autoconfig/frameworks/pages.ts"() {
    init_import_meta_url();
    init_framework_class();
    CloudflarePages = class extends exports.experimental_AutoConfigFramework {
      static {
        __name(this, "CloudflarePages");
      }
      async configure() {
        return {
          wranglerConfig: {}
        };
      }
    };
  }
});
function usesTypescript(projectPath) {
  return fs29.existsSync(path3.join(projectPath, `tsconfig.json`));
}
var init_uses_typescript = __esm({
  "src/autoconfig/uses-typescript.ts"() {
    init_import_meta_url();
    __name(usesTypescript, "usesTypescript");
  }
});

// src/autoconfig/frameworks/qwik.ts
function addBindingsProxy(projectPath) {
  if (!usesTypescript(projectPath)) {
    return;
  }
  const s7 = spinner();
  s7.start("Updating `vite.config.ts`");
  const b11 = recast5.types.builders;
  const getPlatformProxyTsAstNodes = recast5.parse(
    `
				let platform = {};

				if (process.env.NODE_ENV === 'development') {
					const { getPlatformProxy } = await import('wrangler');
					platform = await getPlatformProxy();
				}
			`,
    { parser: typescriptParser2 }
  ).program.body;
  transformFile("vite.config.ts", {
    // Insert the env declaration after the last import (but before the rest of the body)
    visitProgram: /* @__PURE__ */ __name(function(n9) {
      const lastImportIndex = n9.node.body.findLastIndex(
        (t13) => t13.type === "ImportDeclaration"
      );
      const lastImport = n9.get("body", lastImportIndex);
      lastImport.insertAfter(...getPlatformProxyTsAstNodes);
      return this.traverse(n9);
    }, "visitProgram"),
    // Pass the `platform` object from the declaration to the `qwikCity` plugin
    visitCallExpression: /* @__PURE__ */ __name(function(n9) {
      const callee = n9.node.callee;
      if (callee.name !== "qwikCity") {
        return this.traverse(n9);
      }
      const configArgument = n9.node.arguments[0];
      const platformPropery = b11.objectProperty.from({
        key: b11.identifier("platform"),
        value: b11.identifier("platform"),
        shorthand: true
      });
      if (!configArgument) {
        n9.node.arguments = [b11.objectExpression([platformPropery])];
        return false;
      }
      if (configArgument.type !== "ObjectExpression") {
        throw new Error("Failed to update `vite.config.ts`");
      }
      configArgument.properties.push(platformPropery);
      return false;
    }, "visitCallExpression")
  });
  s7.stop(`${brandColor("updated")} \`vite.config.ts\``);
}
var recast5, typescriptParser2, Qwik;
var init_qwik = __esm({
  "src/autoconfig/frameworks/qwik.ts"() {
    init_import_meta_url();
    init_cli();
    init_colors();
    init_command3();
    init_interactive();
    init_dist7();
    recast5 = __toESM(require_main4());
    typescriptParser2 = __toESM(require_typescript2());
    init_uses_typescript();
    init_framework_class();
    Qwik = class extends exports.experimental_AutoConfigFramework {
      static {
        __name(this, "Qwik");
      }
      async configure({
        projectPath,
        dryRun,
        packageManager
      }) {
        if (!dryRun) {
          const cmd = [
            // For some reason `pnpx qwik add` fails for qwik so we use `pnpm qwik add` instead.
            packageManager.type === "pnpm" ? packageManager.type : packageManager.npx,
            "qwik",
            "add",
            "cloudflare-workers",
            "--skipConfirmation=true"
          ];
          endSection(`Running ${quoteShellArgs(cmd)}`);
          await runCommand2(cmd);
          addBindingsProxy(projectPath);
        }
        return {
          wranglerConfig: {
            main: "./dist/_worker.js",
            compatibility_flags: ["global_fetch_strictly_public"],
            assets: {
              binding: "ASSET",
              directory: "./dist"
            }
          },
          packageJsonScriptsOverrides: {
            preview: `${packageManager.type} run build && wrangler dev`,
            deploy: `${packageManager.type} run build && wrangler deploy`
          }
        };
      }
      configurationDescription = 'Configuring project for Qwik with "qwik add cloudflare-workers"';
    };
    __name(addBindingsProxy, "addBindingsProxy");
  }
});
function extractConfigObject(node2) {
  if (t4.ObjectExpression.check(node2)) {
    return node2;
  }
  if (t4.ArrowFunctionExpression.check(node2)) {
    if (t4.ObjectExpression.check(node2.body)) {
      return node2.body;
    }
    if (t4.BlockStatement.check(node2.body)) {
      return extractFromBlockStatement(node2.body);
    }
  }
  if (t4.FunctionExpression.check(node2)) {
    return extractFromBlockStatement(node2.body);
  }
  return null;
}
function extractFromBlockStatement(block) {
  const returnStmt = block.body.find((s7) => t4.ReturnStatement.check(s7));
  if (returnStmt && t4.ReturnStatement.check(returnStmt) && returnStmt.argument && t4.ObjectExpression.check(returnStmt.argument)) {
    return returnStmt.argument;
  }
  return null;
}
function checkIfViteConfigUsesCloudflarePlugin(projectPath) {
  const filePath = getViteConfigPath(projectPath);
  let importsCloudflarePlugin = false;
  let usesCloudflarePlugin = false;
  transformFile(filePath, {
    visitProgram(n9) {
      if (n9.node.body.some(
        (s7) => s7.type === "ImportDeclaration" && s7.source.value === "@cloudflare/vite-plugin"
      )) {
        importsCloudflarePlugin = true;
        return this.traverse(n9);
      }
      this.traverse(n9);
    },
    visitCallExpression: /* @__PURE__ */ __name(function(n9) {
      const callee = n9.node.callee;
      if (callee.name !== "defineConfig") {
        return this.traverse(n9);
      }
      const configObject = extractConfigObject(n9.node.arguments[0]);
      if (!configObject) {
        logger.debug(
          `Vite config uses an unsupported expression type. Skipping Cloudflare plugin check.`
        );
        return this.traverse(n9);
      }
      const pluginsProp = configObject.properties.find(
        (prop) => isPluginsProp(prop)
      );
      if (!pluginsProp || !t4.ArrayExpression.check(pluginsProp.value)) {
        logger.debug(
          `Vite config does not have a valid plugins array. Skipping Cloudflare plugin check.`
        );
        return this.traverse(n9);
      }
      if (pluginsProp.value.elements.some(
        (el) => el?.type === "CallExpression" && el.callee.type === "Identifier" && el.callee.name === "cloudflare"
      )) {
        usesCloudflarePlugin = true;
        return this.traverse(n9);
      }
      this.traverse(n9);
    }, "visitCallExpression")
  });
  return importsCloudflarePlugin && usesCloudflarePlugin;
}
function getViteConfigPath(projectPath) {
  const filePathTS = path3__namespace.default.join(projectPath, `vite.config.ts`);
  const filePathJS = path3__namespace.default.join(projectPath, `vite.config.js`);
  let filePath;
  if (fs29.existsSync(filePathTS)) {
    filePath = filePathTS;
  } else if (fs29.existsSync(filePathJS)) {
    filePath = filePathJS;
  } else {
    throw new Error("Could not find Vite config file to modify");
  }
  return filePath;
}
function transformViteConfig(projectPath, options = {}) {
  const filePath = getViteConfigPath(projectPath);
  transformFile(filePath, {
    visitProgram(n9) {
      const lastImportIndex = n9.node.body.findLastIndex(
        (statement) => statement.type === "ImportDeclaration"
      );
      const lastImport = n9.get("body", lastImportIndex);
      const importAst = b3.importDeclaration(
        [b3.importSpecifier(b3.identifier("cloudflare"))],
        b3.stringLiteral("@cloudflare/vite-plugin")
      );
      if (!n9.node.body.some(
        (s7) => s7.type === "ImportDeclaration" && s7.source.value === "@cloudflare/vite-plugin"
      )) {
        lastImport.insertAfter(importAst);
      }
      return this.traverse(n9);
    },
    visitCallExpression: /* @__PURE__ */ __name(function(n9) {
      const callee = n9.node.callee;
      if (callee.name !== "defineConfig") {
        return this.traverse(n9);
      }
      const configObject = extractConfigObject(n9.node.arguments[0]);
      if (!configObject) {
        const argType = n9.node.arguments[0]?.type ?? "unknown";
        throw new UserError(esm_default3`
					Cannot modify Vite config: could not extract a config object (found ${argType}).

					The Cloudflare plugin can only be automatically added to Vite configs that use:
					  - A simple object: defineConfig({ plugins: [...] })
					  - An arrow function returning an object: defineConfig(() => ({ plugins: [...] }))

					If your config uses a more complex pattern, please manually add the plugin:

					  import { cloudflare } from "@cloudflare/vite-plugin";

					  export default defineConfig({
					    plugins: [cloudflare()]
					  });
				`);
      }
      const pluginsProp = configObject.properties.find(
        (prop) => isPluginsProp(prop)
      );
      if (!pluginsProp || !t4.ArrayExpression.check(pluginsProp.value)) {
        throw new UserError(esm_default3`
					Cannot modify Vite config: could not find a valid plugins array.

					Please ensure your Vite config has a plugins array:

					  export default defineConfig({
					    plugins: []
					  });
				`);
      }
      if (!pluginsProp.value.elements.some(
        (el) => el?.type === "CallExpression" && el.callee.type === "Identifier" && el.callee.name === "cloudflare"
      )) {
        pluginsProp.value.elements.push(
          b3.callExpression(b3.identifier("cloudflare"), [
            ...options.viteEnvironmentName ? [
              b3.objectExpression([
                b3.objectProperty(
                  b3.identifier("viteEnvironment"),
                  b3.objectExpression([
                    b3.objectProperty(
                      b3.identifier("name"),
                      b3.stringLiteral(options.viteEnvironmentName)
                    )
                  ])
                )
              ])
            ] : []
          ])
        );
      }
      const incompatibleVitePlugins = [
        ...knownIncompatiblePlugins,
        ...options.incompatibleVitePlugins ?? []
      ];
      pluginsProp.value.elements = pluginsProp.value.elements.filter((el) => {
        if (el?.type === "CallExpression" && el.callee.type === "Identifier" && incompatibleVitePlugins.includes(el.callee.name)) {
          return false;
        }
        return true;
      });
      return false;
    }, "visitCallExpression")
  });
}
function isPluginsProp(prop) {
  return (t4.Property.check(prop) || t4.ObjectProperty.check(prop)) && t4.Identifier.check(prop.key) && prop.key.name === "plugins";
}
var recast6, b3, t4, knownIncompatiblePlugins;
var init_vite_config = __esm({
  "src/autoconfig/frameworks/utils/vite-config.ts"() {
    init_import_meta_url();
    init_dist7();
    init_dist();
    recast6 = __toESM(require_main4());
    init_esm2();
    init_logger();
    b3 = recast6.types.builders;
    t4 = recast6.types.namedTypes;
    __name(extractConfigObject, "extractConfigObject");
    __name(extractFromBlockStatement, "extractFromBlockStatement");
    __name(checkIfViteConfigUsesCloudflarePlugin, "checkIfViteConfigUsesCloudflarePlugin");
    __name(getViteConfigPath, "getViteConfigPath");
    knownIncompatiblePlugins = ["nitro", "nitroV2Plugin", "netlify"];
    __name(transformViteConfig, "transformViteConfig");
    __name(isPluginsProp, "isPluginsProp");
  }
});

// src/autoconfig/frameworks/utils/vite-plugin.ts
async function installCloudflareVitePlugin({
  packageManager,
  projectPath,
  isWorkspaceRoot
}) {
  const viteVersion = getInstalledPackageVersion("vite", projectPath);
  if (viteVersion && semiver_default(viteVersion, "6.0.0") >= 0 && semiver_default(viteVersion, "6.1.0") < 0) {
    await installPackages(packageManager, ["vite@^6.1.0"], {
      dev: true,
      startText: "Updating the version of vite to be compatible with the Cloudflare Vite Plugin",
      doneText: `${brandColor(`updated`)} ${dim("Vite")}`,
      isWorkspaceRoot
    });
  }
  await installPackages(packageManager, ["@cloudflare/vite-plugin"], {
    dev: true,
    startText: "Installing the Cloudflare Vite plugin",
    doneText: `${brandColor(`installed`)} ${dim("@cloudflare/vite-plugin")}`,
    isWorkspaceRoot
  });
}
var init_vite_plugin = __esm({
  "src/autoconfig/frameworks/utils/vite-plugin.ts"() {
    init_import_meta_url();
    init_colors();
    init_packages3();
    init_semiver();
    init_packages2();
    __name(installCloudflareVitePlugin, "installCloudflareVitePlugin");
  }
});
function transformReactRouterConfig(projectPath, viteEnvironmentKey) {
  const filePathTS = path3__namespace.default.join(projectPath, `react-router.config.ts`);
  const filePathJS = path3__namespace.default.join(projectPath, `react-router.config.js`);
  let filePath;
  if (fs29.existsSync(filePathTS)) {
    filePath = filePathTS;
  } else if (fs29.existsSync(filePathJS)) {
    filePath = filePathJS;
  } else {
    throw new Error("Could not find React Router config file to modify");
  }
  transformFile(filePath, {
    /**
     * Visit an export default declaration of the form:
     *
     *   export default {
     *     ...
     *   }
     *
     * and add or modify the `future` property to look like:
     *
     *   future: {
     *     unstable_viteEnvironmentApi: true // v8_viteEnvironment depending on the React Router version
     *   }
     *
     * For some extra complexity, this also supports TS `as` and `satisfies` expressions
     */
    visitExportDefaultDeclaration(n9) {
      let node2;
      if ((n9.node.declaration.type === "TSAsExpression" || n9.node.declaration.type === "TSSatisfiesExpression") && n9.node.declaration.expression.type === "ObjectExpression") {
        node2 = n9.node.declaration.expression;
      } else if (n9.node.declaration.type === "ObjectExpression") {
        node2 = n9.node.declaration;
      } else {
        throw new Error(
          `Could not parse React Router config file. Please add the following snippet manually:
  future: {
    ${viteEnvironmentKey}: true,
  }`
        );
      }
      assert53__default.default(node2.type === "ObjectExpression");
      const futureKey = node2.properties.findIndex(
        (p7) => p7.type === "ObjectProperty" && p7.key.type === "Identifier" && p7.key.name === "future" && p7.value.type === "ObjectExpression"
      );
      if (futureKey !== -1) {
        const future = node2.properties[futureKey];
        assert53__default.default(
          future.type === "ObjectProperty" && future.value.type === "ObjectExpression"
        );
        const viteEnvironment = future.value.properties.findIndex(
          (p7) => p7.type === "ObjectProperty" && p7.key.type === "Identifier" && p7.key.name === viteEnvironmentKey && p7.value.type === "BooleanLiteral"
        );
        if (viteEnvironment !== -1) {
          const prop = future.value.properties[viteEnvironment];
          assert53__default.default(
            prop.type === "ObjectProperty" && prop.value.type === "BooleanLiteral"
          );
          prop.value.value = true;
        } else {
          const prop = b4.objectProperty(
            b4.identifier(viteEnvironmentKey),
            b4.booleanLiteral(true)
          );
          future.value.properties.push(prop);
        }
      } else {
        node2.properties.push(
          b4.objectProperty(
            b4.identifier("future"),
            b4.objectExpression([
              b4.objectProperty(
                b4.identifier(viteEnvironmentKey),
                b4.booleanLiteral(true)
              )
            ])
          )
        );
      }
      return false;
    }
  });
}
function configPropertyName(reactRouterVersion) {
  if (!reactRouterVersion) {
    return "v8_viteEnvironmentApi";
  }
  if (semiver_default(reactRouterVersion, "7.10.0") === -1) {
    return "unstable_viteEnvironmentApi";
  } else {
    return "v8_viteEnvironmentApi";
  }
}
var recast7, b4, ReactRouter;
var init_react_router = __esm({
  "src/autoconfig/frameworks/react-router.ts"() {
    init_import_meta_url();
    init_colors();
    init_packages3();
    init_dist7();
    recast7 = __toESM(require_main4());
    init_semiver();
    init_esm2();
    init_logger();
    init_framework_class();
    init_vite_config();
    init_vite_plugin();
    b4 = recast7.types.builders;
    __name(transformReactRouterConfig, "transformReactRouterConfig");
    __name(configPropertyName, "configPropertyName");
    ReactRouter = class extends exports.experimental_AutoConfigFramework {
      static {
        __name(this, "ReactRouter");
      }
      async configure({
        dryRun,
        projectPath,
        packageManager,
        isWorkspaceRoot
      }) {
        const viteEnvironmentKey = configPropertyName(this.frameworkVersion);
        if (!dryRun) {
          await installCloudflareVitePlugin({
            packageManager: packageManager.type,
            projectPath,
            isWorkspaceRoot
          });
          fs29.mkdirSync("workers");
          fs29.writeFileSync(
            "workers/app.ts",
            esm_default3`
					import { createRequestHandler } from "react-router";

					declare module "react-router" {
						export interface AppLoadContext {
							cloudflare: {
								env: Env;
								ctx: ExecutionContext;
							};
						}
					}

					const requestHandler = createRequestHandler(
						() => import("virtual:react-router/server-build"),
						import.meta.env.MODE
					);

					export default {
						async fetch(request, env, ctx) {
							return requestHandler(request, {
								cloudflare: { env, ctx },
							});
						},
					} satisfies ExportedHandler<Env>;
				`
          );
          await installPackages(packageManager.type, ["isbot"], {
            dev: true,
            startText: "Installing the isbot package",
            doneText: `${brandColor(`installed`)} ${dim("isbot")}`,
            isWorkspaceRoot
          });
          if (!fs29.existsSync("app/entry.server.tsx")) {
            fs29.writeFileSync(
              `app/entry.server.tsx`,
              esm_default3`
					import type { AppLoadContext, EntryContext } from "react-router";
					import { ServerRouter } from "react-router";
					import { isbot } from "isbot";
					import { renderToReadableStream } from "react-dom/server";

					export default async function handleRequest(
						request: Request,
						responseStatusCode: number,
						responseHeaders: Headers,
						routerContext: EntryContext,
						_loadContext: AppLoadContext
					) {
						let shellRendered = false;
						const userAgent = request.headers.get("user-agent");

						const body = await renderToReadableStream(
							<ServerRouter context={routerContext} url={request.url} />,
							{
								onError(error: unknown) {
									responseStatusCode = 500;
									// Log streaming rendering errors from inside the shell.  Don't log
									// errors encountered during initial shell rendering since they'll
									// reject and get logged in handleDocumentRequest.
									if (shellRendered) {
										console.error(error);
									}
								},
							}
						);
						shellRendered = true;

						// Ensure requests from bots and SPA Mode renders wait for all content to load before responding
						// https://react.dev/reference/react-dom/server/renderToPipeableStream#waiting-for-all-content-to-load-for-crawlers-and-static-generation
						if ((userAgent && isbot(userAgent)) || routerContext.isSpaMode) {
							await body.allReady;
						}

						responseHeaders.set("Content-Type", "text/html");
						return new Response(body, {
							headers: responseHeaders,
							status: responseStatusCode,
						});
					}
				`
            );
          } else {
            logger.warn(
              "The file `app/entry.server.tsx` already exists on disk, and so we're not modifying it. This may lead to deployment failures if `app/entry.server.tsx` is not set up correctly."
            );
          }
          transformViteConfig(projectPath, {
            viteEnvironmentName: "ssr",
            incompatibleVitePlugins: ["netlifyReactRouter"]
          });
          transformReactRouterConfig(projectPath, viteEnvironmentKey);
        }
        return {
          wranglerConfig: {
            main: "./workers/app.ts"
          }
        };
      }
      configurationDescription = "Configuring project for React Router";
    };
  }
});

// src/autoconfig/frameworks/solid-start.ts
function updateViteConfigFile(projectPath) {
  const filePath = `vite.config.${usesTypescript(projectPath) ? "ts" : "js"}`;
  transformFile(filePath, {
    visitCallExpression: /* @__PURE__ */ __name(function(n9) {
      const callee = n9.node.callee;
      if (callee.name !== "nitro") {
        return this.traverse(n9);
      }
      const b11 = recast8.types.builders;
      const presetProp = b11.objectProperty(
        b11.identifier("preset"),
        b11.stringLiteral("cloudflare-module")
      );
      if (n9.node.arguments.length === 0) {
        n9.node.arguments.push(b11.objectExpression([presetProp]));
      } else {
        mergeObjectProperties(
          n9.node.arguments[0],
          [presetProp]
        );
      }
      return false;
    }, "visitCallExpression")
  });
}
function updateAppConfigFile(projectPath) {
  const filePath = `app.config.${usesTypescript(projectPath) ? "ts" : "js"}`;
  const compatDate = getTodaysCompatDate();
  updateStatus(`Updating configuration in ${blue(filePath)}`);
  transformFile(filePath, {
    visitCallExpression: /* @__PURE__ */ __name(function(n9) {
      const callee = n9.node.callee;
      if (callee.name !== "defineConfig") {
        return this.traverse(n9);
      }
      const b11 = recast8.types.builders;
      mergeObjectProperties(
        n9.node.arguments[0],
        [
          b11.objectProperty(
            b11.identifier("server"),
            b11.objectExpression([
              // preset: "cloudflare_module"
              b11.objectProperty(
                b11.identifier("preset"),
                b11.stringLiteral("cloudflare_module")
              ),
              b11.objectProperty(
                b11.identifier("compatibilityDate"),
                b11.stringLiteral(compatDate)
              )
            ])
          )
        ]
      );
      return false;
    }, "visitCallExpression")
  });
}
var recast8, SolidStart;
var init_solid_start = __esm({
  "src/autoconfig/frameworks/solid-start.ts"() {
    init_import_meta_url();
    init_cli();
    init_colors();
    init_dist7();
    init_dist();
    recast8 = __toESM(require_main4());
    init_semiver();
    init_uses_typescript();
    init_framework_class();
    SolidStart = class extends exports.experimental_AutoConfigFramework {
      static {
        __name(this, "SolidStart");
      }
      async configure({
        projectPath,
        dryRun
      }) {
        if (!dryRun) {
          const solidStartVersion = this.frameworkVersion;
          if (semiver_default(solidStartVersion, "2.0.0-alpha") < 0) {
            updateAppConfigFile(projectPath);
          } else {
            updateViteConfigFile(projectPath);
          }
        }
        return {
          wranglerConfig: {
            main: "./.output/server/index.mjs",
            assets: {
              binding: "ASSETS",
              directory: "./.output/public"
            }
          }
        };
      }
    };
    __name(updateViteConfigFile, "updateViteConfigFile");
    __name(updateAppConfigFile, "updateAppConfigFile");
  }
});

// src/autoconfig/frameworks/static.ts
var Static;
var init_static = __esm({
  "src/autoconfig/frameworks/static.ts"() {
    init_import_meta_url();
    init_framework_class();
    Static = class extends exports.experimental_AutoConfigFramework {
      static {
        __name(this, "Static");
      }
      configure({ outputDir }) {
        return {
          wranglerConfig: {
            assets: {
              directory: outputDir
            }
          }
        };
      }
    };
  }
});
var SvelteKit;
var init_sveltekit = __esm({
  "src/autoconfig/frameworks/sveltekit.ts"() {
    init_import_meta_url();
    init_colors();
    init_command3();
    init_packages3();
    init_framework_class();
    SvelteKit = class extends exports.experimental_AutoConfigFramework {
      static {
        __name(this, "SvelteKit");
      }
      async configure({
        dryRun,
        packageManager,
        isWorkspaceRoot
      }) {
        const { dlx } = packageManager;
        if (!dryRun) {
          await runCommand2(
            [
              ...dlx,
              "sv",
              "add",
              "--no-install",
              "--no-git-check",
              "sveltekit-adapter=adapter:cloudflare+cfTarget:workers"
            ],
            {
              silent: true,
              startText: "Installing adapter",
              doneText: `${brandColor("installed")} ${dim(
                `via \`${dlx.join(
                  " "
                )} sv add sveltekit-adapter=adapter:cloudflare+cfTarget:workers\``
              )}`
            }
          );
          fs29.writeFileSync("static/.assetsignore", "_worker.js\n_routes.json");
          await installPackages(packageManager.type, [], {
            startText: "Installing packages",
            doneText: `${brandColor("installed")}`,
            isWorkspaceRoot
          });
        }
        return {
          wranglerConfig: {
            main: ".svelte-kit/cloudflare/_worker.js",
            assets: {
              binding: "ASSETS",
              directory: ".svelte-kit/cloudflare"
            }
          }
        };
      }
      configurationDescription = 'Configuring project for SvelteKit with "sv add"';
    };
  }
});

// src/autoconfig/frameworks/tanstack.ts
var TanstackStart;
var init_tanstack = __esm({
  "src/autoconfig/frameworks/tanstack.ts"() {
    init_import_meta_url();
    init_framework_class();
    init_vite_config();
    init_vite_plugin();
    TanstackStart = class extends exports.experimental_AutoConfigFramework {
      static {
        __name(this, "TanstackStart");
      }
      async configure({
        dryRun,
        projectPath,
        packageManager,
        isWorkspaceRoot
      }) {
        if (!dryRun) {
          await installCloudflareVitePlugin({
            packageManager: packageManager.type,
            isWorkspaceRoot,
            projectPath
          });
          transformViteConfig(projectPath, { viteEnvironmentName: "ssr" });
        }
        return {
          wranglerConfig: {
            main: "@tanstack/react-start/server-entry"
          }
        };
      }
      configurationDescription = "Configuring project for Tanstack Start";
    };
  }
});
function addVikePhotonToConfigFile(projectPath) {
  const filePath = getConfigPath(projectPath);
  let programNode;
  transformFile(filePath, {
    visitProgram(n9) {
      programNode = n9.node;
      addVikePhotonImportToConfigFile(n9);
      return this.traverse(n9);
    },
    visitExportDefaultDeclaration(n9) {
      addVikePhotonToVikeConfigExportObject(n9, programNode);
      return this.traverse(n9);
    }
  });
}
function addVikePhotonToVikeConfigExportObject(n9, programNode) {
  const configObject = getVikeConfigObjectExpression(n9, programNode);
  let configTargetProp = configObject.properties.find(
    (prop) => isExtendsProp(prop)
  );
  if (!configTargetProp) {
    configTargetProp = b5.objectProperty(
      b5.identifier(vikeConfigExtendsPropName),
      b5.arrayExpression([])
    );
    configObject.properties.push(configTargetProp);
  }
  assert53__default.default(configTargetProp && t5.ArrayExpression.check(configTargetProp.value));
  const vikePhotonLocalName = getVikePhotonImportLocalName(programNode) ?? "vikePhoton";
  if (!configTargetProp.value.elements.some(
    (el) => el?.type === "Identifier" && el.name === vikePhotonLocalName
  )) {
    configTargetProp.value.elements.push(b5.identifier(vikePhotonLocalName));
  }
}
function getVikePhotonImportLocalName(programNode) {
  if (!programNode) {
    return void 0;
  }
  for (const stmt of programNode.body) {
    if (t5.ImportDeclaration.check(stmt) && stmt.source.value === "vike-photon/config") {
      const defaultSpec = stmt.specifiers?.find(
        (s7) => t5.ImportDefaultSpecifier.check(s7)
      );
      if (defaultSpec && t5.Identifier.check(defaultSpec.local)) {
        return defaultSpec.local.name;
      }
    }
  }
  return void 0;
}
function getVikeConfigObjectExpression(n9, programNode) {
  if (n9.node.declaration.type === "ObjectExpression") {
    return n9.node.declaration;
  }
  if ((n9.node.declaration.type === "TSAsExpression" || n9.node.declaration.type === "TSSatisfiesExpression") && n9.node.declaration.expression.type === "ObjectExpression") {
    return n9.node.declaration.expression;
  }
  if (n9.node.declaration.type === "Identifier" && programNode) {
    const objectExpression = resolveIdentifierToObjectExpression(
      n9.node.declaration.name,
      programNode
    );
    if (objectExpression) {
      return objectExpression;
    }
  }
  throw new Error("Could not determine Vike default object export");
}
function resolveIdentifierToObjectExpression(varName, programNode) {
  for (const stmt of programNode.body) {
    if (t5.VariableDeclaration.check(stmt)) {
      for (const declarator of stmt.declarations) {
        if (t5.VariableDeclarator.check(declarator) && t5.Identifier.check(declarator.id) && declarator.id.name === varName && declarator.init) {
          if (t5.ObjectExpression.check(declarator.init)) {
            return declarator.init;
          }
          if ((t5.TSAsExpression.check(declarator.init) || t5.TSSatisfiesExpression.check(declarator.init)) && t5.ObjectExpression.check(declarator.init.expression)) {
            return declarator.init.expression;
          }
        }
      }
    }
  }
  return void 0;
}
function addVikePhotonImportToConfigFile(n9) {
  const lastImportIndex = n9.node.body.findLastIndex(
    (statement) => statement.type === "ImportDeclaration"
  );
  const lastImport = n9.get("body", lastImportIndex);
  const importAst = b5.importDeclaration(
    [b5.importDefaultSpecifier(b5.identifier("vikePhoton"))],
    b5.stringLiteral("vike-photon/config")
  );
  if (!n9.node.body.some(
    (s7) => s7.type === "ImportDeclaration" && s7.source.value === "vike-photon/config"
  )) {
    lastImport.insertAfter(importAst);
  }
}
function getConfigPath(projectPath) {
  const filePathTS = path3__namespace.default.join(projectPath, "pages", "+config.ts");
  const filePathJS = path3__namespace.default.join(projectPath, "pages", "+config.js");
  let filePath;
  if (fs29.existsSync(filePathTS)) {
    filePath = filePathTS;
  } else if (fs29.existsSync(filePathJS)) {
    filePath = filePathJS;
  } else {
    throw new Error("Could not find config file to modify");
  }
  return filePath;
}
function isExtendsProp(prop) {
  return (t5.Property.check(prop) || t5.ObjectProperty.check(prop)) && t5.Identifier.check(prop.key) && prop.key.name === vikeConfigExtendsPropName;
}
var recast9, b5, t5, Vike, vikeConfigExtendsPropName;
var init_vike = __esm({
  "src/autoconfig/frameworks/vike.ts"() {
    init_import_meta_url();
    init_colors();
    init_packages3();
    init_dist7();
    recast9 = __toESM(require_main4());
    init_framework_class();
    init_packages2();
    init_vite_plugin();
    b5 = recast9.types.builders;
    t5 = recast9.types.namedTypes;
    Vike = class extends exports.experimental_AutoConfigFramework {
      static {
        __name(this, "Vike");
      }
      async configure({
        projectPath,
        dryRun,
        packageManager,
        isWorkspaceRoot
      }) {
        const vikeServerIsInstalled = isPackageInstalled(
          "vike-server",
          projectPath
        );
        if (vikeServerIsInstalled) {
          throw new Error(
            'Aborting since the project is using the deprecated "vike-server" package, please remove the package from your project and try again.'
          );
        }
        if (!dryRun) {
          await installPackages(
            packageManager.type,
            ["vike-photon", "@photonjs/cloudflare"],
            {
              startText: "Installing vike-photon and @photonjs/cloudflare",
              doneText: `${brandColor(`installed`)} photon packages`,
              isWorkspaceRoot
            }
          );
          await installCloudflareVitePlugin({
            packageManager: packageManager.type,
            isWorkspaceRoot,
            projectPath
          });
          addVikePhotonToConfigFile(projectPath);
        }
        return {
          wranglerConfig: {
            main: "virtual:photon:cloudflare:server-entry"
          },
          packageJsonScriptsOverrides: {
            preview: "vike build && vike preview",
            deploy: "vike build && wrangler deploy"
          }
        };
      }
    };
    __name(addVikePhotonToConfigFile, "addVikePhotonToConfigFile");
    vikeConfigExtendsPropName = "extends";
    __name(addVikePhotonToVikeConfigExportObject, "addVikePhotonToVikeConfigExportObject");
    __name(getVikePhotonImportLocalName, "getVikePhotonImportLocalName");
    __name(getVikeConfigObjectExpression, "getVikeConfigObjectExpression");
    __name(resolveIdentifierToObjectExpression, "resolveIdentifierToObjectExpression");
    __name(addVikePhotonImportToConfigFile, "addVikePhotonImportToConfigFile");
    __name(getConfigPath, "getConfigPath");
    __name(isExtendsProp, "isExtendsProp");
  }
});

// src/autoconfig/frameworks/vite.ts
var Vite;
var init_vite = __esm({
  "src/autoconfig/frameworks/vite.ts"() {
    init_import_meta_url();
    init_framework_class();
    init_vite_config();
    init_vite_plugin();
    Vite = class extends exports.experimental_AutoConfigFramework {
      static {
        __name(this, "Vite");
      }
      isConfigured(projectPath) {
        return checkIfViteConfigUsesCloudflarePlugin(projectPath);
      }
      async configure({
        dryRun,
        projectPath,
        packageManager,
        isWorkspaceRoot
      }) {
        if (!dryRun) {
          await installCloudflareVitePlugin({
            packageManager: packageManager.type,
            isWorkspaceRoot,
            projectPath
          });
          transformViteConfig(projectPath);
        }
        return {
          wranglerConfig: {
            assets: {
              not_found_handling: "single-page-application"
            }
          }
        };
      }
    };
  }
});
async function createWakuServerFile(projectPath) {
  await fs9.writeFile(
    `${projectPath}/src/waku.server.tsx`,
    esm_default3`
			import { fsRouter } from 'waku';
			import adapter from 'waku/adapters/cloudflare';

			export default adapter(
				fsRouter(import.meta.glob('./**/*.{tsx,ts}', { base: './pages' })),
				{
					handlers: {
					// Define additional Cloudflare Workers handlers here
					// https://developers.cloudflare.com/workers/runtime-apis/handlers/
					// async queue(
					//   batch: MessageBatch,
					//   _env: Env,
					//   _ctx: ExecutionContext,
					// ): Promise<void> {
					//   for (const message of batch.messages) {
					//     console.log('Received', message);
					//   }
					// },
					},
				},
			);
			`
  );
}
async function updateWakuConfig(projectPath) {
  const wakuConfigPath = path3.join(projectPath, "waku.config.ts");
  if (!fs29.existsSync(wakuConfigPath)) {
    throw new Error("Could not find Waku config file to modify");
  }
  updateStatus(`Updating Waku configuration in ${blue(wakuConfigPath)}`);
  transformFile(wakuConfigPath, {
    visitProgram(n9) {
      const lastImportIndex = n9.node.body.findLastIndex(
        (statement) => statement.type === "ImportDeclaration"
      );
      const lastImport = n9.get("body", lastImportIndex);
      if (!n9.node.body.some(
        (s7) => s7.type === "ImportDeclaration" && s7.source.value === "@cloudflare/vite-plugin"
      )) {
        const importAst = b6.importDeclaration(
          [b6.importSpecifier(b6.identifier("cloudflare"))],
          b6.stringLiteral("@cloudflare/vite-plugin")
        );
        lastImport.insertAfter(importAst);
      }
      return this.traverse(n9);
    },
    visitCallExpression: /* @__PURE__ */ __name(function(n9) {
      const callee = n9.node.callee;
      if (callee.name !== "defineConfig") {
        return this.traverse(n9);
      }
      const config = n9.node.arguments[0];
      assert53__default.default(t6.ObjectExpression.check(config));
      const viteConfig = config.properties.find(
        (prop) => isViteProp(prop)
      )?.value;
      assert53__default.default(t6.ObjectExpression.check(viteConfig));
      const pluginsProp = viteConfig.properties.find(
        (prop) => isPluginsProp2(prop)
      );
      assert53__default.default(pluginsProp && t6.ArrayExpression.check(pluginsProp.value));
      if (!pluginsProp.value.elements.some(
        (el) => el?.type === "CallExpression" && el.callee.type === "Identifier" && el.callee.name === "cloudflare"
      )) {
        pluginsProp.value.elements.push(
          b6.callExpression(b6.identifier("cloudflare"), [
            b6.objectExpression([
              b6.objectProperty(
                b6.identifier("viteEnvironment"),
                b6.objectExpression([
                  b6.objectProperty(
                    b6.identifier("name"),
                    b6.stringLiteral("rsc")
                  ),
                  b6.objectProperty(
                    b6.identifier("childEnvironments"),
                    b6.arrayExpression([b6.stringLiteral("ssr")])
                  )
                ])
              ),
              b6.objectProperty(
                b6.identifier("inspectorPort"),
                b6.booleanLiteral(false)
              )
            ])
          ])
        );
      }
      this.traverse(n9);
    }, "visitCallExpression")
  });
}
function isViteProp(prop) {
  return (t6.Property.check(prop) || t6.ObjectProperty.check(prop)) && t6.Identifier.check(prop.key) && prop.key.name === "vite";
}
function isPluginsProp2(prop) {
  return (t6.Property.check(prop) || t6.ObjectProperty.check(prop)) && t6.Identifier.check(prop.key) && prop.key.name === "plugins";
}
var recast10, b6, t6, Waku;
var init_waku = __esm({
  "src/autoconfig/frameworks/waku.ts"() {
    init_import_meta_url();
    init_cli();
    init_colors();
    init_packages3();
    init_dist7();
    recast10 = __toESM(require_main4());
    init_esm2();
    init_framework_class();
    init_vite_plugin();
    b6 = recast10.types.builders;
    t6 = recast10.types.namedTypes;
    Waku = class extends exports.experimental_AutoConfigFramework {
      static {
        __name(this, "Waku");
      }
      async configure({
        dryRun,
        projectPath,
        packageManager,
        isWorkspaceRoot
      }) {
        if (!dryRun) {
          await installPackages(packageManager.type, ["hono"], {
            dev: true,
            startText: "Installing hono dependency",
            doneText: `${brandColor("installed")}`,
            isWorkspaceRoot
          });
          await installCloudflareVitePlugin({
            packageManager: packageManager.type,
            projectPath,
            isWorkspaceRoot
          });
          await createWakuServerFile(projectPath);
          await updateWakuConfig(projectPath);
        }
        return {
          wranglerConfig: {
            main: "./src/waku.server",
            assets: {
              binding: "ASSETS",
              directory: "./dist/public",
              html_handling: "drop-trailing-slash"
            }
          }
        };
      }
    };
    __name(createWakuServerFile, "createWakuServerFile");
    __name(updateWakuConfig, "updateWakuConfig");
    __name(isViteProp, "isViteProp");
    __name(isPluginsProp2, "isPluginsProp");
  }
});
function getFrameworkPackageInfo(frameworkId) {
  if (frameworkId === staticFramework.id) {
    return void 0;
  }
  const targetedFramework = allKnownFrameworks.find(
    (framework) => framework.id === frameworkId
  );
  assert53__default.default(
    targetedFramework,
    `Could not determine framework package info for ${JSON.stringify(
      frameworkId
    )}`
  );
  assert53__default.default(
    targetedFramework.supported,
    `Framework unexpectedly not supported ${JSON.stringify(frameworkId)}`
  );
  return targetedFramework.frameworkPackageInfo;
}
var allKnownFrameworks, staticFramework, allFrameworksInfos;
var init_all_frameworks = __esm({
  "src/autoconfig/frameworks/all-frameworks.ts"() {
    init_import_meta_url();
    init_analog();
    init_angular();
    init_astro();
    init_hono();
    init_next();
    init_nuxt();
    init_pages3();
    init_qwik();
    init_react_router();
    init_solid_start();
    init_static();
    init_sveltekit();
    init_tanstack();
    init_vike();
    init_vite();
    init_waku();
    allKnownFrameworks = [
      {
        id: "analog",
        name: "Analog",
        class: Analog,
        frameworkPackageInfo: {
          name: "@analogjs/platform",
          // Analog didn't work well before 2.0.0 with Cloudflare
          // See: https://github.com/cloudflare/workers-sdk/issues/11470
          minimumVersion: "2.0.0",
          maximumKnownMajorVersion: "2"
        },
        supported: true
      },
      {
        id: "angular",
        name: "Angular",
        class: Angular,
        frameworkPackageInfo: {
          name: "@angular/core",
          // Angular 19 introduced ssr.experimentalPlatform and AngularAppEngine
          // which are required for Cloudflare Workers support
          // See: https://github.com/angular/angular-cli/releases/tag/19.0.0
          minimumVersion: "19.0.0",
          maximumKnownMajorVersion: "21"
        },
        supported: true
      },
      {
        id: "astro",
        name: "Astro",
        class: Astro,
        frameworkPackageInfo: {
          name: "astro",
          // Version 4 was the earliest version that we manually tested
          // in https://github.com/cloudflare/workers-sdk/pull/12938
          // earlier versions might also be supported but we haven't checked them
          minimumVersion: "4.0.0",
          maximumKnownMajorVersion: "6"
        },
        supported: true
      },
      {
        id: "hono",
        name: "Hono",
        class: Hono,
        supported: false
      },
      {
        id: "next",
        name: "Next.js",
        class: NextJs,
        frameworkPackageInfo: {
          name: "next",
          // 14.2.35 is the earliest version of Next.js officially supported by open-next
          // see: https://github.com/cloudflare/workers-sdk/pull/11704#discussion_r2634519440
          minimumVersion: "14.2.35",
          maximumKnownMajorVersion: "16"
        },
        supported: true
      },
      {
        id: "nuxt",
        name: "Nuxt",
        class: Nuxt,
        frameworkPackageInfo: {
          name: "nuxt",
          // 3.21.0 is the first Nuxt version with Nitro 2.11+ which supports
          // cloudflare.deployConfig and cloudflare.nodeCompat options
          // See: https://github.com/nuxt/nuxt/releases/tag/v3.21.0
          // See: https://github.com/nitrojs/nitro/releases/tag/v2.11.0
          minimumVersion: "3.21.0",
          maximumKnownMajorVersion: "4"
        },
        supported: true
      },
      {
        id: "qwik",
        name: "Qwik",
        class: Qwik,
        frameworkPackageInfo: {
          name: "@builder.io/qwik",
          // 1.1.0 added the `platform` option in the qwikCity() Vite plugin
          // which is required for getPlatformProxy integration
          // See: https://github.com/QwikDev/qwik/pull/3604
          minimumVersion: "1.1.0",
          maximumKnownMajorVersion: "1"
        },
        supported: true
      },
      {
        id: "react-router",
        name: "React Router",
        class: ReactRouter,
        frameworkPackageInfo: {
          name: "react-router",
          // React Router v7 introduced framework mode with Vite integration and
          // react-router.config.ts which are required for Cloudflare Workers support
          // See: https://remix.run/blog/react-router-v7
          minimumVersion: "7.0.0",
          maximumKnownMajorVersion: "7"
        },
        supported: true
      },
      {
        id: "solid-start",
        name: "Solid Start",
        class: SolidStart,
        frameworkPackageInfo: {
          name: "@solidjs/start",
          // 1.0.0 is the first stable release with Nitro/Cloudflare Workers support
          // See: https://github.com/solidjs/solid-start/releases/tag/v1.0.0
          minimumVersion: "1.0.0",
          maximumKnownMajorVersion: "2"
        },
        supported: true
      },
      {
        id: "svelte-kit",
        name: "SvelteKit",
        class: SvelteKit,
        frameworkPackageInfo: {
          name: "@sveltejs/kit",
          // 2.20.3 is required by @sveltejs/adapter-cloudflare@7.0.0 which first
          // added Workers Static Assets support (cfTarget:workers option)
          // See: https://github.com/sveltejs/kit/releases/tag/%40sveltejs%2Fadapter-cloudflare%407.0.0
          minimumVersion: "2.20.3",
          maximumKnownMajorVersion: "2"
        },
        supported: true
      },
      {
        id: "tanstack-start",
        name: "TanStack Start",
        class: TanstackStart,
        frameworkPackageInfo: {
          name: "@tanstack/react-start",
          // 1.132.0 is the first Release Candidate for TanStack Start that supports Cloudflare
          // See: https://github.com/TanStack/router/releases/tag/v1.132.0
          minimumVersion: "1.132.0",
          maximumKnownMajorVersion: "1"
        },
        supported: true
      },
      {
        id: "vite",
        name: "Vite",
        class: Vite,
        frameworkPackageInfo: {
          name: "vite",
          // Vite 6 introduced the Environment API which @cloudflare/vite-plugin requires
          // See: https://vite.dev/blog/announcing-vite6#experimental-environment-api
          // (6.1.0 is the minimum version supported by the vite plugin:
          //  https://github.com/cloudflare/workers-sdk/blob/b9b7e9d9fe/packages/vite-plugin-cloudflare/package.json#L80
          //  we anyways allow for `6.0.x` versions since we bump them to `^6.1.0` in the autoconfig process)
          minimumVersion: "6.0.0",
          maximumKnownMajorVersion: "8"
        },
        supported: true
      },
      {
        id: "vike",
        name: "Vike",
        class: Vike,
        frameworkPackageInfo: {
          name: "vike",
          minimumVersion: "0.0.0",
          maximumKnownMajorVersion: "0"
        },
        supported: true
      },
      {
        id: "waku",
        name: "Waku",
        class: Waku,
        frameworkPackageInfo: {
          name: "waku",
          // Autoconfig could support Waku before 1.0.0-alpha.4, but different autoconfig logic
          // would need to be implemented for such versions, so we just decided to only support
          // version 1.0.0-alpha.4 and up
          // See: https://github.com/cloudflare/workers-sdk/pull/12657
          minimumVersion: "1.0.0-alpha.4",
          maximumKnownMajorVersion: "1"
        },
        supported: true
      },
      {
        id: "cloudflare-pages",
        name: "Cloudflare Pages",
        class: CloudflarePages,
        // Autoconfiguring a Pages project into a Workers one is not yet supported
        supported: false
      }
    ];
    staticFramework = {
      id: "static",
      name: "Static",
      class: Static,
      supported: true
    };
    allFrameworksInfos = [
      staticFramework,
      ...allKnownFrameworks
    ];
    __name(getFrameworkPackageInfo, "getFrameworkPackageInfo");
  }
});
function isKnownFramework(frameworkId) {
  return allKnownFrameworksIds.has(frameworkId);
}
function getFrameworkClass(frameworkId) {
  const targetedFramework = allFrameworksInfos.find(
    (framework2) => framework2.id === frameworkId
  );
  const framework = targetedFramework ?? staticFramework;
  return new framework.class({ id: framework.id, name: framework.name });
}
function isFrameworkSupported(frameworkId) {
  const targetedFramework = allFrameworksInfos.find(
    (framework) => framework.id === frameworkId
  );
  assert53__default.default(
    targetedFramework,
    `Unexpected unknown framework id: ${JSON.stringify(frameworkId)}`
  );
  return targetedFramework.supported;
}
var allKnownFrameworksIds;
var init_frameworks = __esm({
  "src/autoconfig/frameworks/index.ts"() {
    init_import_meta_url();
    init_all_frameworks();
    allKnownFrameworksIds = new Set(
      allFrameworksInfos.map(({ id }) => id)
    );
    __name(isKnownFramework, "isKnownFramework");
    __name(getFrameworkClass, "getFrameworkClass");
    __name(isFrameworkSupported, "isFrameworkSupported");
  }
});

// src/autoconfig/telemetry-utils.ts
function getAutoConfigTriggerCommand() {
  return autoConfigLocalState.triggerCommand;
}
function getAutoConfigId() {
  return autoConfigLocalState.autoConfigId;
}
function sendAutoConfigProcessStartedMetricsEvent({
  command: command2,
  dryRun
}) {
  autoConfigLocalState.triggerCommand = command2;
  autoConfigLocalState.autoConfigId = crypto.randomUUID();
  sendMetricsEvent(
    "autoconfig_process_started",
    {
      autoConfigId: getAutoConfigId(),
      command: command2,
      dryRun
    },
    {}
  );
}
function sendAutoConfigProcessEndedMetricsEvent({
  success: success2,
  error: error2,
  command: command2,
  dryRun
}) {
  sendMetricsEvent(
    "autoconfig_process_ended",
    {
      autoConfigId: getAutoConfigId(),
      command: command2,
      dryRun,
      success: success2,
      ...sanitizeError(error2)
    },
    {}
  );
}
var autoConfigLocalState;
var init_telemetry_utils = __esm({
  "src/autoconfig/telemetry-utils.ts"() {
    init_import_meta_url();
    init_metrics();
    init_sanitization();
    autoConfigLocalState = {};
    __name(getAutoConfigTriggerCommand, "getAutoConfigTriggerCommand");
    __name(getAutoConfigId, "getAutoConfigId");
    __name(sendAutoConfigProcessStartedMetricsEvent, "sendAutoConfigProcessStartedMetricsEvent");
    __name(sendAutoConfigProcessEndedMetricsEvent, "sendAutoConfigProcessEndedMetricsEvent");
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/logger.js
var LogLevel2, DefaultLogger;
var init_logger3 = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/logger.js"() {
    init_import_meta_url();
    (function(LogLevel4) {
      LogLevel4["DEBUG"] = "debug";
      LogLevel4["LOG"] = "log";
      LogLevel4["INFO"] = "info";
      LogLevel4["WARN"] = "warn";
      LogLevel4["ERROR"] = "error";
    })(LogLevel2 || (LogLevel2 = {}));
    DefaultLogger = class {
      static {
        __name(this, "DefaultLogger");
      }
      logLevel;
      constructor(logLevel = LogLevel2.ERROR) {
        this.logLevel = logLevel;
      }
      shouldLog(logLevel) {
        const logLevelOrder = ["debug", "log", "info", "warn", "error"];
        return logLevelOrder.indexOf(logLevel) >= logLevelOrder.indexOf(this.logLevel);
      }
      debug(...args) {
        if (this.shouldLog(LogLevel2.DEBUG)) {
          console.debug(...args);
        }
      }
      log(...args) {
        if (this.shouldLog(LogLevel2.LOG)) {
          console.log(...args);
        }
      }
      info(...args) {
        if (this.shouldLog(LogLevel2.INFO)) {
          console.info(...args);
        }
      }
      warn(...args) {
        if (this.shouldLog(LogLevel2.WARN)) {
          console.warn(...args);
        }
      }
      error(...args) {
        if (this.shouldLog(LogLevel2.ERROR)) {
          console.error(...args);
        }
      }
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/file-system.js
function normalizePathSegments(parts, allowAboveRoot) {
  const res = [];
  for (let i7 = 0; i7 < parts.length; i7++) {
    const p7 = parts[i7];
    if (!p7 || p7 === ".")
      continue;
    if (p7 === "..") {
      if (res.length && res[res.length - 1] !== "..") {
        res.pop();
      } else if (allowAboveRoot) {
        res.push("..");
      }
    } else {
      res.push(p7);
    }
  }
  return res;
}
function normalize4(path84) {
  const isAbsolute6 = path84.startsWith("/");
  const trailingSlash = path84 && path84[path84.length - 1] === "/";
  path84 = normalizePathSegments(path84.split("/"), !isAbsolute6).join("/");
  if (!path84 && !isAbsolute6) {
    path84 = ".";
  }
  if (path84 && trailingSlash) {
    path84 += "/";
  }
  return `${isAbsolute6 ? "/" : ""}${path84}`;
}
function join16(...segments) {
  let path84 = "";
  for (let i7 = 0, max = segments.length; i7 < max; i7++) {
    if (typeof segments[i7] !== "string") {
      throw new TypeError("Arguments to join must be strings");
    }
    const segment = segments[i7].replace(/\\/gm, "/");
    if (segment) {
      if (!path84.length) {
        path84 += segment;
      } else {
        path84 += "/" + segment;
      }
    }
  }
  return normalize4(path84);
}
var FileSystem;
var init_file_system = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/file-system.js"() {
    init_import_meta_url();
    init_logger3();
    __name(normalizePathSegments, "normalizePathSegments");
    __name(normalize4, "normalize");
    __name(join16, "join");
    FileSystem = class {
      static {
        __name(this, "FileSystem");
      }
      logger = new DefaultLogger("error");
      /** The current working directory will be set by the project */
      cwd = "/";
      /** returns the last portion of a path */
      basename(path84) {
        return this.join(path84).split("/").pop() || "";
      }
      /** returns the relative path from to based on the current working directory */
      relative(from, to) {
        const absoluteFrom = this.isAbsolute(from) ? from : this.join(this.cwd, from);
        const absoluteTo = this.isAbsolute(to) ? to : this.join(this.cwd, to);
        if (absoluteFrom === absoluteTo) {
          return "";
        }
        const matching = [];
        if (absoluteTo.startsWith(absoluteFrom)) {
          return absoluteTo.substring(absoluteFrom.length).replace(/^\//, "");
        }
        const fromParts = this.join(absoluteFrom).split("/");
        const toParts = this.join(absoluteTo).split("/");
        for (let i7 = 0, max = toParts.length; i7 < max; i7++) {
          if (toParts[i7] === fromParts?.[i7]) {
            matching.push(toParts[i7]);
          } else {
            break;
          }
        }
        const toUp = toParts.length - matching.length;
        const fromUp = fromParts.length - matching.length;
        const up3 = Math.max(toUp, fromUp);
        const result = fromUp > 0 ? Array(up3).fill("..") : [];
        if (toUp > 0) {
          result.push(...toParts.slice(-toUp));
        }
        return result.join("/");
      }
      /** returns the directory name of a path */
      dirname(path84) {
        const parts = this.join(path84).split("/");
        parts.pop();
        if (parts.length === 1 && parts[0] === "") {
          return "/";
        }
        return parts.join("/");
      }
      /** A platform independent version of path.join() */
      join(...segments) {
        return join16(...segments);
      }
      /** Gracefully reads the file and returns null if it does not exist */
      async gracefullyReadFile(path84) {
        try {
          return await this.readFile(path84);
        } catch {
          return null;
        }
      }
      /** Gracefully reads a file as JSON and parses it */
      async readJSON(path84, options = {}) {
        try {
          return JSON.parse(await this.readFile(path84));
        } catch (error2) {
          if (options.fail) {
            throw error2;
          }
          let message = `Could not parse JSON file ${path84}`;
          if (error2 instanceof Error) {
            message += `
${error2.name}: ${error2.message}
${error2.stack}`;
          }
          this.logger.error(message);
          return {};
        }
      }
      /** Find a file or directory by walking up parent directories. */
      async findUp(name2, options = {}) {
        let startDir = this.resolve(options.cwd || this.cwd);
        const readUp = /* @__PURE__ */ __name(async () => {
          const entries2 = await this.readDir(startDir, true);
          const found = Object.entries(entries2).find(([entry, dirType]) => {
            if (typeof name2 === "string" && entry === name2 || Array.isArray(name2) && name2.includes(entry)) {
              if (options.type) {
                if (options.type === dirType) {
                  return entry;
                }
              }
              return entry;
            }
          });
          if (found?.[0]) {
            return this.join(startDir, found[0]);
          }
          if (startDir === "/" || options.stopAt && this.resolve(options.stopAt) === startDir) {
            return;
          }
          startDir = this.join(startDir, "..");
          return readUp();
        }, "readUp");
        return readUp();
      }
      /** Find files or directories by walking up parent directories. */
      async findUpMultiple(name2, options = {}) {
        let startDir = this.resolve(options.cwd || this.cwd);
        const found = [];
        const readUp = /* @__PURE__ */ __name(async () => {
          const entries2 = await this.readDir(startDir, true);
          for (const [entry, dirType] of Object.entries(entries2)) {
            if (typeof name2 === "string" && entry === name2 || Array.isArray(name2) && name2.includes(entry)) {
              if (options.type && options.type === dirType || !options.type) {
                found.push(this.resolve(startDir, entry));
              }
            }
          }
          if (startDir === "/" || options.stopAt && this.resolve(options.stopAt) === startDir) {
            return found;
          }
          startDir = this.join(startDir, "..");
          return readUp();
        }, "readUp");
        return readUp();
      }
    };
  }
});

// ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/constants.js
var require_constants8 = __commonJS({
  "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/constants.js"(exports, module2) {
    init_import_meta_url();
    var SEMVER_SPEC_VERSION = "2.0.0";
    var MAX_LENGTH = 256;
    var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
    9007199254740991;
    var MAX_SAFE_COMPONENT_LENGTH = 16;
    var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6;
    var RELEASE_TYPES = [
      "major",
      "premajor",
      "minor",
      "preminor",
      "patch",
      "prepatch",
      "prerelease"
    ];
    module2.exports = {
      MAX_LENGTH,
      MAX_SAFE_COMPONENT_LENGTH,
      MAX_SAFE_BUILD_LENGTH,
      MAX_SAFE_INTEGER,
      RELEASE_TYPES,
      SEMVER_SPEC_VERSION,
      FLAG_INCLUDE_PRERELEASE: 1,
      FLAG_LOOSE: 2
    };
  }
});

// ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/debug.js
var require_debug2 = __commonJS({
  "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/debug.js"(exports, module2) {
    init_import_meta_url();
    var debug2 = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
    };
    module2.exports = debug2;
  }
});

// ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/re.js
var require_re = __commonJS({
  "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/re.js"(exports, module2) {
    init_import_meta_url();
    var {
      MAX_SAFE_COMPONENT_LENGTH,
      MAX_SAFE_BUILD_LENGTH,
      MAX_LENGTH
    } = require_constants8();
    var debug2 = require_debug2();
    exports = module2.exports = {};
    var re2 = exports.re = [];
    var safeRe = exports.safeRe = [];
    var src = exports.src = [];
    var safeSrc = exports.safeSrc = [];
    var t13 = exports.t = {};
    var R4 = 0;
    var LETTERDASHNUMBER = "[a-zA-Z0-9-]";
    var safeRegexReplacements = [
      ["\\s", 1],
      ["\\d", MAX_LENGTH],
      [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH]
    ];
    var makeSafeRegex = /* @__PURE__ */ __name((value) => {
      for (const [token, max] of safeRegexReplacements) {
        value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`);
      }
      return value;
    }, "makeSafeRegex");
    var createToken = /* @__PURE__ */ __name((name2, value, isGlobal) => {
      const safe = makeSafeRegex(value);
      const index = R4++;
      debug2(name2, index, value);
      t13[name2] = index;
      src[index] = value;
      safeSrc[index] = safe;
      re2[index] = new RegExp(value, isGlobal ? "g" : void 0);
      safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0);
    }, "createToken");
    createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
    createToken("NUMERICIDENTIFIERLOOSE", "\\d+");
    createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
    createToken("MAINVERSION", `(${src[t13.NUMERICIDENTIFIER]})\\.(${src[t13.NUMERICIDENTIFIER]})\\.(${src[t13.NUMERICIDENTIFIER]})`);
    createToken("MAINVERSIONLOOSE", `(${src[t13.NUMERICIDENTIFIERLOOSE]})\\.(${src[t13.NUMERICIDENTIFIERLOOSE]})\\.(${src[t13.NUMERICIDENTIFIERLOOSE]})`);
    createToken("PRERELEASEIDENTIFIER", `(?:${src[t13.NONNUMERICIDENTIFIER]}|${src[t13.NUMERICIDENTIFIER]})`);
    createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t13.NONNUMERICIDENTIFIER]}|${src[t13.NUMERICIDENTIFIERLOOSE]})`);
    createToken("PRERELEASE", `(?:-(${src[t13.PRERELEASEIDENTIFIER]}(?:\\.${src[t13.PRERELEASEIDENTIFIER]})*))`);
    createToken("PRERELEASELOOSE", `(?:-?(${src[t13.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t13.PRERELEASEIDENTIFIERLOOSE]})*))`);
    createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`);
    createToken("BUILD", `(?:\\+(${src[t13.BUILDIDENTIFIER]}(?:\\.${src[t13.BUILDIDENTIFIER]})*))`);
    createToken("FULLPLAIN", `v?${src[t13.MAINVERSION]}${src[t13.PRERELEASE]}?${src[t13.BUILD]}?`);
    createToken("FULL", `^${src[t13.FULLPLAIN]}$`);
    createToken("LOOSEPLAIN", `[v=\\s]*${src[t13.MAINVERSIONLOOSE]}${src[t13.PRERELEASELOOSE]}?${src[t13.BUILD]}?`);
    createToken("LOOSE", `^${src[t13.LOOSEPLAIN]}$`);
    createToken("GTLT", "((?:<|>)?=?)");
    createToken("XRANGEIDENTIFIERLOOSE", `${src[t13.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
    createToken("XRANGEIDENTIFIER", `${src[t13.NUMERICIDENTIFIER]}|x|X|\\*`);
    createToken("XRANGEPLAIN", `[v=\\s]*(${src[t13.XRANGEIDENTIFIER]})(?:\\.(${src[t13.XRANGEIDENTIFIER]})(?:\\.(${src[t13.XRANGEIDENTIFIER]})(?:${src[t13.PRERELEASE]})?${src[t13.BUILD]}?)?)?`);
    createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t13.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t13.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t13.XRANGEIDENTIFIERLOOSE]})(?:${src[t13.PRERELEASELOOSE]})?${src[t13.BUILD]}?)?)?`);
    createToken("XRANGE", `^${src[t13.GTLT]}\\s*${src[t13.XRANGEPLAIN]}$`);
    createToken("XRANGELOOSE", `^${src[t13.GTLT]}\\s*${src[t13.XRANGEPLAINLOOSE]}$`);
    createToken("COERCEPLAIN", `${"(^|[^\\d])(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
    createToken("COERCE", `${src[t13.COERCEPLAIN]}(?:$|[^\\d])`);
    createToken("COERCEFULL", src[t13.COERCEPLAIN] + `(?:${src[t13.PRERELEASE]})?(?:${src[t13.BUILD]})?(?:$|[^\\d])`);
    createToken("COERCERTL", src[t13.COERCE], true);
    createToken("COERCERTLFULL", src[t13.COERCEFULL], true);
    createToken("LONETILDE", "(?:~>?)");
    createToken("TILDETRIM", `(\\s*)${src[t13.LONETILDE]}\\s+`, true);
    exports.tildeTrimReplace = "$1~";
    createToken("TILDE", `^${src[t13.LONETILDE]}${src[t13.XRANGEPLAIN]}$`);
    createToken("TILDELOOSE", `^${src[t13.LONETILDE]}${src[t13.XRANGEPLAINLOOSE]}$`);
    createToken("LONECARET", "(?:\\^)");
    createToken("CARETTRIM", `(\\s*)${src[t13.LONECARET]}\\s+`, true);
    exports.caretTrimReplace = "$1^";
    createToken("CARET", `^${src[t13.LONECARET]}${src[t13.XRANGEPLAIN]}$`);
    createToken("CARETLOOSE", `^${src[t13.LONECARET]}${src[t13.XRANGEPLAINLOOSE]}$`);
    createToken("COMPARATORLOOSE", `^${src[t13.GTLT]}\\s*(${src[t13.LOOSEPLAIN]})$|^$`);
    createToken("COMPARATOR", `^${src[t13.GTLT]}\\s*(${src[t13.FULLPLAIN]})$|^$`);
    createToken("COMPARATORTRIM", `(\\s*)${src[t13.GTLT]}\\s*(${src[t13.LOOSEPLAIN]}|${src[t13.XRANGEPLAIN]})`, true);
    exports.comparatorTrimReplace = "$1$2$3";
    createToken("HYPHENRANGE", `^\\s*(${src[t13.XRANGEPLAIN]})\\s+-\\s+(${src[t13.XRANGEPLAIN]})\\s*$`);
    createToken("HYPHENRANGELOOSE", `^\\s*(${src[t13.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t13.XRANGEPLAINLOOSE]})\\s*$`);
    createToken("STAR", "(<|>)?=?\\s*\\*");
    createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$");
    createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
  }
});

// ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/parse-options.js
var require_parse_options = __commonJS({
  "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/parse-options.js"(exports, module2) {
    init_import_meta_url();
    var looseOption = Object.freeze({ loose: true });
    var emptyOpts = Object.freeze({});
    var parseOptions = /* @__PURE__ */ __name((options) => {
      if (!options) {
        return emptyOpts;
      }
      if (typeof options !== "object") {
        return looseOption;
      }
      return options;
    }, "parseOptions");
    module2.exports = parseOptions;
  }
});

// ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/identifiers.js
var require_identifiers = __commonJS({
  "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/identifiers.js"(exports, module2) {
    init_import_meta_url();
    var numeric = /^[0-9]+$/;
    var compareIdentifiers = /* @__PURE__ */ __name((a7, b11) => {
      if (typeof a7 === "number" && typeof b11 === "number") {
        return a7 === b11 ? 0 : a7 < b11 ? -1 : 1;
      }
      const anum = numeric.test(a7);
      const bnum = numeric.test(b11);
      if (anum && bnum) {
        a7 = +a7;
        b11 = +b11;
      }
      return a7 === b11 ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a7 < b11 ? -1 : 1;
    }, "compareIdentifiers");
    var rcompareIdentifiers = /* @__PURE__ */ __name((a7, b11) => compareIdentifiers(b11, a7), "rcompareIdentifiers");
    module2.exports = {
      compareIdentifiers,
      rcompareIdentifiers
    };
  }
});

// ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/classes/semver.js
var require_semver = __commonJS({
  "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/classes/semver.js"(exports, module2) {
    init_import_meta_url();
    var debug2 = require_debug2();
    var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants8();
    var { safeRe: re2, t: t13 } = require_re();
    var parseOptions = require_parse_options();
    var { compareIdentifiers } = require_identifiers();
    var SemVer = class _SemVer {
      static {
        __name(this, "SemVer");
      }
      constructor(version5, options) {
        options = parseOptions(options);
        if (version5 instanceof _SemVer) {
          if (version5.loose === !!options.loose && version5.includePrerelease === !!options.includePrerelease) {
            return version5;
          } else {
            version5 = version5.version;
          }
        } else if (typeof version5 !== "string") {
          throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version5}".`);
        }
        if (version5.length > MAX_LENGTH) {
          throw new TypeError(
            `version is longer than ${MAX_LENGTH} characters`
          );
        }
        debug2("SemVer", version5, options);
        this.options = options;
        this.loose = !!options.loose;
        this.includePrerelease = !!options.includePrerelease;
        const m7 = version5.trim().match(options.loose ? re2[t13.LOOSE] : re2[t13.FULL]);
        if (!m7) {
          throw new TypeError(`Invalid Version: ${version5}`);
        }
        this.raw = version5;
        this.major = +m7[1];
        this.minor = +m7[2];
        this.patch = +m7[3];
        if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
          throw new TypeError("Invalid major version");
        }
        if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
          throw new TypeError("Invalid minor version");
        }
        if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
          throw new TypeError("Invalid patch version");
        }
        if (!m7[4]) {
          this.prerelease = [];
        } else {
          this.prerelease = m7[4].split(".").map((id) => {
            if (/^[0-9]+$/.test(id)) {
              const num = +id;
              if (num >= 0 && num < MAX_SAFE_INTEGER) {
                return num;
              }
            }
            return id;
          });
        }
        this.build = m7[5] ? m7[5].split(".") : [];
        this.format();
      }
      format() {
        this.version = `${this.major}.${this.minor}.${this.patch}`;
        if (this.prerelease.length) {
          this.version += `-${this.prerelease.join(".")}`;
        }
        return this.version;
      }
      toString() {
        return this.version;
      }
      compare(other) {
        debug2("SemVer.compare", this.version, this.options, other);
        if (!(other instanceof _SemVer)) {
          if (typeof other === "string" && other === this.version) {
            return 0;
          }
          other = new _SemVer(other, this.options);
        }
        if (other.version === this.version) {
          return 0;
        }
        return this.compareMain(other) || this.comparePre(other);
      }
      compareMain(other) {
        if (!(other instanceof _SemVer)) {
          other = new _SemVer(other, this.options);
        }
        if (this.major < other.major) {
          return -1;
        }
        if (this.major > other.major) {
          return 1;
        }
        if (this.minor < other.minor) {
          return -1;
        }
        if (this.minor > other.minor) {
          return 1;
        }
        if (this.patch < other.patch) {
          return -1;
        }
        if (this.patch > other.patch) {
          return 1;
        }
        return 0;
      }
      comparePre(other) {
        if (!(other instanceof _SemVer)) {
          other = new _SemVer(other, this.options);
        }
        if (this.prerelease.length && !other.prerelease.length) {
          return -1;
        } else if (!this.prerelease.length && other.prerelease.length) {
          return 1;
        } else if (!this.prerelease.length && !other.prerelease.length) {
          return 0;
        }
        let i7 = 0;
        do {
          const a7 = this.prerelease[i7];
          const b11 = other.prerelease[i7];
          debug2("prerelease compare", i7, a7, b11);
          if (a7 === void 0 && b11 === void 0) {
            return 0;
          } else if (b11 === void 0) {
            return 1;
          } else if (a7 === void 0) {
            return -1;
          } else if (a7 === b11) {
            continue;
          } else {
            return compareIdentifiers(a7, b11);
          }
        } while (++i7);
      }
      compareBuild(other) {
        if (!(other instanceof _SemVer)) {
          other = new _SemVer(other, this.options);
        }
        let i7 = 0;
        do {
          const a7 = this.build[i7];
          const b11 = other.build[i7];
          debug2("build compare", i7, a7, b11);
          if (a7 === void 0 && b11 === void 0) {
            return 0;
          } else if (b11 === void 0) {
            return 1;
          } else if (a7 === void 0) {
            return -1;
          } else if (a7 === b11) {
            continue;
          } else {
            return compareIdentifiers(a7, b11);
          }
        } while (++i7);
      }
      // preminor will bump the version up to the next minor release, and immediately
      // down to pre-release. premajor and prepatch work the same way.
      inc(release3, identifier, identifierBase) {
        if (release3.startsWith("pre")) {
          if (!identifier && identifierBase === false) {
            throw new Error("invalid increment argument: identifier is empty");
          }
          if (identifier) {
            const match3 = `-${identifier}`.match(this.options.loose ? re2[t13.PRERELEASELOOSE] : re2[t13.PRERELEASE]);
            if (!match3 || match3[1] !== identifier) {
              throw new Error(`invalid identifier: ${identifier}`);
            }
          }
        }
        switch (release3) {
          case "premajor":
            this.prerelease.length = 0;
            this.patch = 0;
            this.minor = 0;
            this.major++;
            this.inc("pre", identifier, identifierBase);
            break;
          case "preminor":
            this.prerelease.length = 0;
            this.patch = 0;
            this.minor++;
            this.inc("pre", identifier, identifierBase);
            break;
          case "prepatch":
            this.prerelease.length = 0;
            this.inc("patch", identifier, identifierBase);
            this.inc("pre", identifier, identifierBase);
            break;
          // If the input is a non-prerelease version, this acts the same as
          // prepatch.
          case "prerelease":
            if (this.prerelease.length === 0) {
              this.inc("patch", identifier, identifierBase);
            }
            this.inc("pre", identifier, identifierBase);
            break;
          case "release":
            if (this.prerelease.length === 0) {
              throw new Error(`version ${this.raw} is not a prerelease`);
            }
            this.prerelease.length = 0;
            break;
          case "major":
            if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {
              this.major++;
            }
            this.minor = 0;
            this.patch = 0;
            this.prerelease = [];
            break;
          case "minor":
            if (this.patch !== 0 || this.prerelease.length === 0) {
              this.minor++;
            }
            this.patch = 0;
            this.prerelease = [];
            break;
          case "patch":
            if (this.prerelease.length === 0) {
              this.patch++;
            }
            this.prerelease = [];
            break;
          // This probably shouldn't be used publicly.
          // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
          case "pre": {
            const base = Number(identifierBase) ? 1 : 0;
            if (this.prerelease.length === 0) {
              this.prerelease = [base];
            } else {
              let i7 = this.prerelease.length;
              while (--i7 >= 0) {
                if (typeof this.prerelease[i7] === "number") {
                  this.prerelease[i7]++;
                  i7 = -2;
                }
              }
              if (i7 === -1) {
                if (identifier === this.prerelease.join(".") && identifierBase === false) {
                  throw new Error("invalid increment argument: identifier already exists");
                }
                this.prerelease.push(base);
              }
            }
            if (identifier) {
              let prerelease = [identifier, base];
              if (identifierBase === false) {
                prerelease = [identifier];
              }
              if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
                if (isNaN(this.prerelease[1])) {
                  this.prerelease = prerelease;
                }
              } else {
                this.prerelease = prerelease;
              }
            }
            break;
          }
          default:
            throw new Error(`invalid increment argument: ${release3}`);
        }
        this.raw = this.format();
        if (this.build.length) {
          this.raw += `+${this.build.join(".")}`;
        }
        return this;
      }
    };
    module2.exports = SemVer;
  }
});

// ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/parse.js
var require_parse3 = __commonJS({
  "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/parse.js"(exports, module2) {
    init_import_meta_url();
    var SemVer = require_semver();
    var parse17 = /* @__PURE__ */ __name((version5, options, throwErrors = false) => {
      if (version5 instanceof SemVer) {
        return version5;
      }
      try {
        return new SemVer(version5, options);
      } catch (er2) {
        if (!throwErrors) {
          return null;
        }
        throw er2;
      }
    }, "parse");
    module2.exports = parse17;
  }
});

// ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/valid.js
var require_valid = __commonJS({
  "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/valid.js"(exports, module2) {
    init_import_meta_url();
    var parse17 = require_parse3();
    var valid = /* @__PURE__ */ __name((version5, options) => {
      const v8 = parse17(version5, options);
      return v8 ? v8.version : null;
    }, "valid");
    module2.exports = valid;
  }
});

// ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/clean.js
var require_clean = __commonJS({
  "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/clean.js"(exports, module2) {
    init_import_meta_url();
    var parse17 = require_parse3();
    var clean = /* @__PURE__ */ __name((version5, options) => {
      const s7 = parse17(version5.trim().replace(/^[=v]+/, ""), options);
      return s7 ? s7.version : null;
    }, "clean");
    module2.exports = clean;
  }
});

// ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/inc.js
var require_inc = __commonJS({
  "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/inc.js"(exports, module2) {
    init_import_meta_url();
    var SemVer = require_semver();
    var inc = /* @__PURE__ */ __name((version5, release3, options, identifier, identifierBase) => {
      if (typeof options === "string") {
        identifierBase = identifier;
        identifier = options;
        options = void 0;
      }
      try {
        return new SemVer(
          version5 instanceof SemVer ? version5.version : version5,
          options
        ).inc(release3, identifier, identifierBase).version;
      } catch (er2) {
        return null;
      }
    }, "inc");
    module2.exports = inc;
  }
});

// ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/diff.js
var require_diff = __commonJS({
  "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/diff.js"(exports, module2) {
    init_import_meta_url();
    var parse17 = require_parse3();
    var diff = /* @__PURE__ */ __name((version1, version22) => {
      const v1 = parse17(version1, null, true);
      const v22 = parse17(version22, null, true);
      const comparison = v1.compare(v22);
      if (comparison === 0) {
        return null;
      }
      const v1Higher = comparison > 0;
      const highVersion = v1Higher ? v1 : v22;
      const lowVersion = v1Higher ? v22 : v1;
      const highHasPre = !!highVersion.prerelease.length;
      const lowHasPre = !!lowVersion.prerelease.length;
      if (lowHasPre && !highHasPre) {
        if (!lowVersion.patch && !lowVersion.minor) {
          return "major";
        }
        if (lowVersion.compareMain(highVersion) === 0) {
          if (lowVersion.minor && !lowVersion.patch) {
            return "minor";
          }
          return "patch";
        }
      }
      const prefix = highHasPre ? "pre" : "";
      if (v1.major !== v22.major) {
        return prefix + "major";
      }
      if (v1.minor !== v22.minor) {
        return prefix + "minor";
      }
      if (v1.patch !== v22.patch) {
        return prefix + "patch";
      }
      return "prerelease";
    }, "diff");
    module2.exports = diff;
  }
});

// ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/major.js
var require_major = __commonJS({
  "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/major.js"(exports, module2) {
    init_import_meta_url();
    var SemVer = require_semver();
    var major = /* @__PURE__ */ __name((a7, loose) => new SemVer(a7, loose).major, "major");
    module2.exports = major;
  }
});

// ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/minor.js
var require_minor = __commonJS({
  "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/minor.js"(exports, module2) {
    init_import_meta_url();
    var SemVer = require_semver();
    var minor = /* @__PURE__ */ __name((a7, loose) => new SemVer(a7, loose).minor, "minor");
    module2.exports = minor;
  }
});

// ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/patch.js
var require_patch = __commonJS({
  "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/patch.js"(exports, module2) {
    init_import_meta_url();
    var SemVer = require_semver();
    var patch = /* @__PURE__ */ __name((a7, loose) => new SemVer(a7, loose).patch, "patch");
    module2.exports = patch;
  }
});

// ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/prerelease.js
var require_prerelease = __commonJS({
  "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/prerelease.js"(exports, module2) {
    init_import_meta_url();
    var parse17 = require_parse3();
    var prerelease = /* @__PURE__ */ __name((version5, options) => {
      const parsed = parse17(version5, options);
      return parsed && parsed.prerelease.length ? parsed.prerelease : null;
    }, "prerelease");
    module2.exports = prerelease;
  }
});

// ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/compare.js
var require_compare = __commonJS({
  "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/compare.js"(exports, module2) {
    init_import_meta_url();
    var SemVer = require_semver();
    var compare = /* @__PURE__ */ __name((a7, b11, loose) => new SemVer(a7, loose).compare(new SemVer(b11, loose)), "compare");
    module2.exports = compare;
  }
});

// ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/rcompare.js
var require_rcompare = __commonJS({
  "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/rcompare.js"(exports, module2) {
    init_import_meta_url();
    var compare = require_compare();
    var rcompare = /* @__PURE__ */ __name((a7, b11, loose) => compare(b11, a7, loose), "rcompare");
    module2.exports = rcompare;
  }
});

// ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/compare-loose.js
var require_compare_loose = __commonJS({
  "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/compare-loose.js"(exports, module2) {
    init_import_meta_url();
    var compare = require_compare();
    var compareLoose = /* @__PURE__ */ __name((a7, b11) => compare(a7, b11, true), "compareLoose");
    module2.exports = compareLoose;
  }
});

// ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/compare-build.js
var require_compare_build = __commonJS({
  "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/compare-build.js"(exports, module2) {
    init_import_meta_url();
    var SemVer = require_semver();
    var compareBuild = /* @__PURE__ */ __name((a7, b11, loose) => {
      const versionA = new SemVer(a7, loose);
      const versionB = new SemVer(b11, loose);
      return versionA.compare(versionB) || versionA.compareBuild(versionB);
    }, "compareBuild");
    module2.exports = compareBuild;
  }
});

// ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/sort.js
var require_sort = __commonJS({
  "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/sort.js"(exports, module2) {
    init_import_meta_url();
    var compareBuild = require_compare_build();
    var sort = /* @__PURE__ */ __name((list, loose) => list.sort((a7, b11) => compareBuild(a7, b11, loose)), "sort");
    module2.exports = sort;
  }
});

// ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/rsort.js
var require_rsort = __commonJS({
  "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/rsort.js"(exports, module2) {
    init_import_meta_url();
    var compareBuild = require_compare_build();
    var rsort = /* @__PURE__ */ __name((list, loose) => list.sort((a7, b11) => compareBuild(b11, a7, loose)), "rsort");
    module2.exports = rsort;
  }
});

// ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/gt.js
var require_gt = __commonJS({
  "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/gt.js"(exports, module2) {
    init_import_meta_url();
    var compare = require_compare();
    var gt2 = /* @__PURE__ */ __name((a7, b11, loose) => compare(a7, b11, loose) > 0, "gt");
    module2.exports = gt2;
  }
});

// ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/lt.js
var require_lt = __commonJS({
  "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/lt.js"(exports, module2) {
    init_import_meta_url();
    var compare = require_compare();
    var lt5 = /* @__PURE__ */ __name((a7, b11, loose) => compare(a7, b11, loose) < 0, "lt");
    module2.exports = lt5;
  }
});

// ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/eq.js
var require_eq = __commonJS({
  "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/eq.js"(exports, module2) {
    init_import_meta_url();
    var compare = require_compare();
    var eq = /* @__PURE__ */ __name((a7, b11, loose) => compare(a7, b11, loose) === 0, "eq");
    module2.exports = eq;
  }
});

// ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/neq.js
var require_neq = __commonJS({
  "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/neq.js"(exports, module2) {
    init_import_meta_url();
    var compare = require_compare();
    var neq = /* @__PURE__ */ __name((a7, b11, loose) => compare(a7, b11, loose) !== 0, "neq");
    module2.exports = neq;
  }
});

// ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/gte.js
var require_gte = __commonJS({
  "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/gte.js"(exports, module2) {
    init_import_meta_url();
    var compare = require_compare();
    var gte4 = /* @__PURE__ */ __name((a7, b11, loose) => compare(a7, b11, loose) >= 0, "gte");
    module2.exports = gte4;
  }
});

// ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/lte.js
var require_lte = __commonJS({
  "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/lte.js"(exports, module2) {
    init_import_meta_url();
    var compare = require_compare();
    var lte = /* @__PURE__ */ __name((a7, b11, loose) => compare(a7, b11, loose) <= 0, "lte");
    module2.exports = lte;
  }
});

// ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/cmp.js
var require_cmp = __commonJS({
  "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/cmp.js"(exports, module2) {
    init_import_meta_url();
    var eq = require_eq();
    var neq = require_neq();
    var gt2 = require_gt();
    var gte4 = require_gte();
    var lt5 = require_lt();
    var lte = require_lte();
    var cmp = /* @__PURE__ */ __name((a7, op, b11, loose) => {
      switch (op) {
        case "===":
          if (typeof a7 === "object") {
            a7 = a7.version;
          }
          if (typeof b11 === "object") {
            b11 = b11.version;
          }
          return a7 === b11;
        case "!==":
          if (typeof a7 === "object") {
            a7 = a7.version;
          }
          if (typeof b11 === "object") {
            b11 = b11.version;
          }
          return a7 !== b11;
        case "":
        case "=":
        case "==":
          return eq(a7, b11, loose);
        case "!=":
          return neq(a7, b11, loose);
        case ">":
          return gt2(a7, b11, loose);
        case ">=":
          return gte4(a7, b11, loose);
        case "<":
          return lt5(a7, b11, loose);
        case "<=":
          return lte(a7, b11, loose);
        default:
          throw new TypeError(`Invalid operator: ${op}`);
      }
    }, "cmp");
    module2.exports = cmp;
  }
});

// ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/coerce.js
var require_coerce = __commonJS({
  "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/coerce.js"(exports, module2) {
    init_import_meta_url();
    var SemVer = require_semver();
    var parse17 = require_parse3();
    var { safeRe: re2, t: t13 } = require_re();
    var coerce6 = /* @__PURE__ */ __name((version5, options) => {
      if (version5 instanceof SemVer) {
        return version5;
      }
      if (typeof version5 === "number") {
        version5 = String(version5);
      }
      if (typeof version5 !== "string") {
        return null;
      }
      options = options || {};
      let match3 = null;
      if (!options.rtl) {
        match3 = version5.match(options.includePrerelease ? re2[t13.COERCEFULL] : re2[t13.COERCE]);
      } else {
        const coerceRtlRegex = options.includePrerelease ? re2[t13.COERCERTLFULL] : re2[t13.COERCERTL];
        let next;
        while ((next = coerceRtlRegex.exec(version5)) && (!match3 || match3.index + match3[0].length !== version5.length)) {
          if (!match3 || next.index + next[0].length !== match3.index + match3[0].length) {
            match3 = next;
          }
          coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length;
        }
        coerceRtlRegex.lastIndex = -1;
      }
      if (match3 === null) {
        return null;
      }
      const major = match3[2];
      const minor = match3[3] || "0";
      const patch = match3[4] || "0";
      const prerelease = options.includePrerelease && match3[5] ? `-${match3[5]}` : "";
      const build5 = options.includePrerelease && match3[6] ? `+${match3[6]}` : "";
      return parse17(`${major}.${minor}.${patch}${prerelease}${build5}`, options);
    }, "coerce");
    module2.exports = coerce6;
  }
});

// ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/lrucache.js
var require_lrucache = __commonJS({
  "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/lrucache.js"(exports, module2) {
    init_import_meta_url();
    var LRUCache = class {
      static {
        __name(this, "LRUCache");
      }
      constructor() {
        this.max = 1e3;
        this.map = /* @__PURE__ */ new Map();
      }
      get(key) {
        const value = this.map.get(key);
        if (value === void 0) {
          return void 0;
        } else {
          this.map.delete(key);
          this.map.set(key, value);
          return value;
        }
      }
      delete(key) {
        return this.map.delete(key);
      }
      set(key, value) {
        const deleted = this.delete(key);
        if (!deleted && value !== void 0) {
          if (this.map.size >= this.max) {
            const firstKey = this.map.keys().next().value;
            this.delete(firstKey);
          }
          this.map.set(key, value);
        }
        return this;
      }
    };
    module2.exports = LRUCache;
  }
});

// ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/classes/range.js
var require_range = __commonJS({
  "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/classes/range.js"(exports, module2) {
    init_import_meta_url();
    var SPACE_CHARACTERS = /\s+/g;
    var Range = class _Range {
      static {
        __name(this, "Range");
      }
      constructor(range, options) {
        options = parseOptions(options);
        if (range instanceof _Range) {
          if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) {
            return range;
          } else {
            return new _Range(range.raw, options);
          }
        }
        if (range instanceof Comparator) {
          this.raw = range.value;
          this.set = [[range]];
          this.formatted = void 0;
          return this;
        }
        this.options = options;
        this.loose = !!options.loose;
        this.includePrerelease = !!options.includePrerelease;
        this.raw = range.trim().replace(SPACE_CHARACTERS, " ");
        this.set = this.raw.split("||").map((r10) => this.parseRange(r10.trim())).filter((c8) => c8.length);
        if (!this.set.length) {
          throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
        }
        if (this.set.length > 1) {
          const first = this.set[0];
          this.set = this.set.filter((c8) => !isNullSet(c8[0]));
          if (this.set.length === 0) {
            this.set = [first];
          } else if (this.set.length > 1) {
            for (const c8 of this.set) {
              if (c8.length === 1 && isAny(c8[0])) {
                this.set = [c8];
                break;
              }
            }
          }
        }
        this.formatted = void 0;
      }
      get range() {
        if (this.formatted === void 0) {
          this.formatted = "";
          for (let i7 = 0; i7 < this.set.length; i7++) {
            if (i7 > 0) {
              this.formatted += "||";
            }
            const comps = this.set[i7];
            for (let k7 = 0; k7 < comps.length; k7++) {
              if (k7 > 0) {
                this.formatted += " ";
              }
              this.formatted += comps[k7].toString().trim();
            }
          }
        }
        return this.formatted;
      }
      format() {
        return this.range;
      }
      toString() {
        return this.range;
      }
      parseRange(range) {
        const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE);
        const memoKey = memoOpts + ":" + range;
        const cached = cache5.get(memoKey);
        if (cached) {
          return cached;
        }
        const loose = this.options.loose;
        const hr2 = loose ? re2[t13.HYPHENRANGELOOSE] : re2[t13.HYPHENRANGE];
        range = range.replace(hr2, hyphenReplace(this.options.includePrerelease));
        debug2("hyphen replace", range);
        range = range.replace(re2[t13.COMPARATORTRIM], comparatorTrimReplace);
        debug2("comparator trim", range);
        range = range.replace(re2[t13.TILDETRIM], tildeTrimReplace);
        debug2("tilde trim", range);
        range = range.replace(re2[t13.CARETTRIM], caretTrimReplace);
        debug2("caret trim", range);
        let rangeList = range.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options));
        if (loose) {
          rangeList = rangeList.filter((comp) => {
            debug2("loose invalid filter", comp, this.options);
            return !!comp.match(re2[t13.COMPARATORLOOSE]);
          });
        }
        debug2("range list", rangeList);
        const rangeMap = /* @__PURE__ */ new Map();
        const comparators = rangeList.map((comp) => new Comparator(comp, this.options));
        for (const comp of comparators) {
          if (isNullSet(comp)) {
            return [comp];
          }
          rangeMap.set(comp.value, comp);
        }
        if (rangeMap.size > 1 && rangeMap.has("")) {
          rangeMap.delete("");
        }
        const result = [...rangeMap.values()];
        cache5.set(memoKey, result);
        return result;
      }
      intersects(range, options) {
        if (!(range instanceof _Range)) {
          throw new TypeError("a Range is required");
        }
        return this.set.some((thisComparators) => {
          return isSatisfiable(thisComparators, options) && range.set.some((rangeComparators) => {
            return isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => {
              return rangeComparators.every((rangeComparator) => {
                return thisComparator.intersects(rangeComparator, options);
              });
            });
          });
        });
      }
      // if ANY of the sets match ALL of its comparators, then pass
      test(version5) {
        if (!version5) {
          return false;
        }
        if (typeof version5 === "string") {
          try {
            version5 = new SemVer(version5, this.options);
          } catch (er2) {
            return false;
          }
        }
        for (let i7 = 0; i7 < this.set.length; i7++) {
          if (testSet(this.set[i7], version5, this.options)) {
            return true;
          }
        }
        return false;
      }
    };
    module2.exports = Range;
    var LRU = require_lrucache();
    var cache5 = new LRU();
    var parseOptions = require_parse_options();
    var Comparator = require_comparator();
    var debug2 = require_debug2();
    var SemVer = require_semver();
    var {
      safeRe: re2,
      t: t13,
      comparatorTrimReplace,
      tildeTrimReplace,
      caretTrimReplace
    } = require_re();
    var { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants8();
    var isNullSet = /* @__PURE__ */ __name((c8) => c8.value === "<0.0.0-0", "isNullSet");
    var isAny = /* @__PURE__ */ __name((c8) => c8.value === "", "isAny");
    var isSatisfiable = /* @__PURE__ */ __name((comparators, options) => {
      let result = true;
      const remainingComparators = comparators.slice();
      let testComparator = remainingComparators.pop();
      while (result && remainingComparators.length) {
        result = remainingComparators.every((otherComparator) => {
          return testComparator.intersects(otherComparator, options);
        });
        testComparator = remainingComparators.pop();
      }
      return result;
    }, "isSatisfiable");
    var parseComparator = /* @__PURE__ */ __name((comp, options) => {
      comp = comp.replace(re2[t13.BUILD], "");
      debug2("comp", comp, options);
      comp = replaceCarets(comp, options);
      debug2("caret", comp);
      comp = replaceTildes(comp, options);
      debug2("tildes", comp);
      comp = replaceXRanges(comp, options);
      debug2("xrange", comp);
      comp = replaceStars(comp, options);
      debug2("stars", comp);
      return comp;
    }, "parseComparator");
    var isX = /* @__PURE__ */ __name((id) => !id || id.toLowerCase() === "x" || id === "*", "isX");
    var replaceTildes = /* @__PURE__ */ __name((comp, options) => {
      return comp.trim().split(/\s+/).map((c8) => replaceTilde(c8, options)).join(" ");
    }, "replaceTildes");
    var replaceTilde = /* @__PURE__ */ __name((comp, options) => {
      const r10 = options.loose ? re2[t13.TILDELOOSE] : re2[t13.TILDE];
      return comp.replace(r10, (_5, M4, m7, p7, pr2) => {
        debug2("tilde", comp, _5, M4, m7, p7, pr2);
        let ret;
        if (isX(M4)) {
          ret = "";
        } else if (isX(m7)) {
          ret = `>=${M4}.0.0 <${+M4 + 1}.0.0-0`;
        } else if (isX(p7)) {
          ret = `>=${M4}.${m7}.0 <${M4}.${+m7 + 1}.0-0`;
        } else if (pr2) {
          debug2("replaceTilde pr", pr2);
          ret = `>=${M4}.${m7}.${p7}-${pr2} <${M4}.${+m7 + 1}.0-0`;
        } else {
          ret = `>=${M4}.${m7}.${p7} <${M4}.${+m7 + 1}.0-0`;
        }
        debug2("tilde return", ret);
        return ret;
      });
    }, "replaceTilde");
    var replaceCarets = /* @__PURE__ */ __name((comp, options) => {
      return comp.trim().split(/\s+/).map((c8) => replaceCaret(c8, options)).join(" ");
    }, "replaceCarets");
    var replaceCaret = /* @__PURE__ */ __name((comp, options) => {
      debug2("caret", comp, options);
      const r10 = options.loose ? re2[t13.CARETLOOSE] : re2[t13.CARET];
      const z7 = options.includePrerelease ? "-0" : "";
      return comp.replace(r10, (_5, M4, m7, p7, pr2) => {
        debug2("caret", comp, _5, M4, m7, p7, pr2);
        let ret;
        if (isX(M4)) {
          ret = "";
        } else if (isX(m7)) {
          ret = `>=${M4}.0.0${z7} <${+M4 + 1}.0.0-0`;
        } else if (isX(p7)) {
          if (M4 === "0") {
            ret = `>=${M4}.${m7}.0${z7} <${M4}.${+m7 + 1}.0-0`;
          } else {
            ret = `>=${M4}.${m7}.0${z7} <${+M4 + 1}.0.0-0`;
          }
        } else if (pr2) {
          debug2("replaceCaret pr", pr2);
          if (M4 === "0") {
            if (m7 === "0") {
              ret = `>=${M4}.${m7}.${p7}-${pr2} <${M4}.${m7}.${+p7 + 1}-0`;
            } else {
              ret = `>=${M4}.${m7}.${p7}-${pr2} <${M4}.${+m7 + 1}.0-0`;
            }
          } else {
            ret = `>=${M4}.${m7}.${p7}-${pr2} <${+M4 + 1}.0.0-0`;
          }
        } else {
          debug2("no pr");
          if (M4 === "0") {
            if (m7 === "0") {
              ret = `>=${M4}.${m7}.${p7}${z7} <${M4}.${m7}.${+p7 + 1}-0`;
            } else {
              ret = `>=${M4}.${m7}.${p7}${z7} <${M4}.${+m7 + 1}.0-0`;
            }
          } else {
            ret = `>=${M4}.${m7}.${p7} <${+M4 + 1}.0.0-0`;
          }
        }
        debug2("caret return", ret);
        return ret;
      });
    }, "replaceCaret");
    var replaceXRanges = /* @__PURE__ */ __name((comp, options) => {
      debug2("replaceXRanges", comp, options);
      return comp.split(/\s+/).map((c8) => replaceXRange(c8, options)).join(" ");
    }, "replaceXRanges");
    var replaceXRange = /* @__PURE__ */ __name((comp, options) => {
      comp = comp.trim();
      const r10 = options.loose ? re2[t13.XRANGELOOSE] : re2[t13.XRANGE];
      return comp.replace(r10, (ret, gtlt, M4, m7, p7, pr2) => {
        debug2("xRange", comp, ret, gtlt, M4, m7, p7, pr2);
        const xM = isX(M4);
        const xm = xM || isX(m7);
        const xp = xm || isX(p7);
        const anyX = xp;
        if (gtlt === "=" && anyX) {
          gtlt = "";
        }
        pr2 = options.includePrerelease ? "-0" : "";
        if (xM) {
          if (gtlt === ">" || gtlt === "<") {
            ret = "<0.0.0-0";
          } else {
            ret = "*";
          }
        } else if (gtlt && anyX) {
          if (xm) {
            m7 = 0;
          }
          p7 = 0;
          if (gtlt === ">") {
            gtlt = ">=";
            if (xm) {
              M4 = +M4 + 1;
              m7 = 0;
              p7 = 0;
            } else {
              m7 = +m7 + 1;
              p7 = 0;
            }
          } else if (gtlt === "<=") {
            gtlt = "<";
            if (xm) {
              M4 = +M4 + 1;
            } else {
              m7 = +m7 + 1;
            }
          }
          if (gtlt === "<") {
            pr2 = "-0";
          }
          ret = `${gtlt + M4}.${m7}.${p7}${pr2}`;
        } else if (xm) {
          ret = `>=${M4}.0.0${pr2} <${+M4 + 1}.0.0-0`;
        } else if (xp) {
          ret = `>=${M4}.${m7}.0${pr2} <${M4}.${+m7 + 1}.0-0`;
        }
        debug2("xRange return", ret);
        return ret;
      });
    }, "replaceXRange");
    var replaceStars = /* @__PURE__ */ __name((comp, options) => {
      debug2("replaceStars", comp, options);
      return comp.trim().replace(re2[t13.STAR], "");
    }, "replaceStars");
    var replaceGTE0 = /* @__PURE__ */ __name((comp, options) => {
      debug2("replaceGTE0", comp, options);
      return comp.trim().replace(re2[options.includePrerelease ? t13.GTE0PRE : t13.GTE0], "");
    }, "replaceGTE0");
    var hyphenReplace = /* @__PURE__ */ __name((incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => {
      if (isX(fM)) {
        from = "";
      } else if (isX(fm)) {
        from = `>=${fM}.0.0${incPr ? "-0" : ""}`;
      } else if (isX(fp)) {
        from = `>=${fM}.${fm}.0${incPr ? "-0" : ""}`;
      } else if (fpr) {
        from = `>=${from}`;
      } else {
        from = `>=${from}${incPr ? "-0" : ""}`;
      }
      if (isX(tM)) {
        to = "";
      } else if (isX(tm)) {
        to = `<${+tM + 1}.0.0-0`;
      } else if (isX(tp)) {
        to = `<${tM}.${+tm + 1}.0-0`;
      } else if (tpr) {
        to = `<=${tM}.${tm}.${tp}-${tpr}`;
      } else if (incPr) {
        to = `<${tM}.${tm}.${+tp + 1}-0`;
      } else {
        to = `<=${to}`;
      }
      return `${from} ${to}`.trim();
    }, "hyphenReplace");
    var testSet = /* @__PURE__ */ __name((set, version5, options) => {
      for (let i7 = 0; i7 < set.length; i7++) {
        if (!set[i7].test(version5)) {
          return false;
        }
      }
      if (version5.prerelease.length && !options.includePrerelease) {
        for (let i7 = 0; i7 < set.length; i7++) {
          debug2(set[i7].semver);
          if (set[i7].semver === Comparator.ANY) {
            continue;
          }
          if (set[i7].semver.prerelease.length > 0) {
            const allowed = set[i7].semver;
            if (allowed.major === version5.major && allowed.minor === version5.minor && allowed.patch === version5.patch) {
              return true;
            }
          }
        }
        return false;
      }
      return true;
    }, "testSet");
  }
});

// ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/classes/comparator.js
var require_comparator = __commonJS({
  "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/classes/comparator.js"(exports, module2) {
    init_import_meta_url();
    var ANY = Symbol("SemVer ANY");
    var Comparator = class _Comparator {
      static {
        __name(this, "Comparator");
      }
      static get ANY() {
        return ANY;
      }
      constructor(comp, options) {
        options = parseOptions(options);
        if (comp instanceof _Comparator) {
          if (comp.loose === !!options.loose) {
            return comp;
          } else {
            comp = comp.value;
          }
        }
        comp = comp.trim().split(/\s+/).join(" ");
        debug2("comparator", comp, options);
        this.options = options;
        this.loose = !!options.loose;
        this.parse(comp);
        if (this.semver === ANY) {
          this.value = "";
        } else {
          this.value = this.operator + this.semver.version;
        }
        debug2("comp", this);
      }
      parse(comp) {
        const r10 = this.options.loose ? re2[t13.COMPARATORLOOSE] : re2[t13.COMPARATOR];
        const m7 = comp.match(r10);
        if (!m7) {
          throw new TypeError(`Invalid comparator: ${comp}`);
        }
        this.operator = m7[1] !== void 0 ? m7[1] : "";
        if (this.operator === "=") {
          this.operator = "";
        }
        if (!m7[2]) {
          this.semver = ANY;
        } else {
          this.semver = new SemVer(m7[2], this.options.loose);
        }
      }
      toString() {
        return this.value;
      }
      test(version5) {
        debug2("Comparator.test", version5, this.options.loose);
        if (this.semver === ANY || version5 === ANY) {
          return true;
        }
        if (typeof version5 === "string") {
          try {
            version5 = new SemVer(version5, this.options);
          } catch (er2) {
            return false;
          }
        }
        return cmp(version5, this.operator, this.semver, this.options);
      }
      intersects(comp, options) {
        if (!(comp instanceof _Comparator)) {
          throw new TypeError("a Comparator is required");
        }
        if (this.operator === "") {
          if (this.value === "") {
            return true;
          }
          return new Range(comp.value, options).test(this.value);
        } else if (comp.operator === "") {
          if (comp.value === "") {
            return true;
          }
          return new Range(this.value, options).test(comp.semver);
        }
        options = parseOptions(options);
        if (options.includePrerelease && (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0")) {
          return false;
        }
        if (!options.includePrerelease && (this.value.startsWith("<0.0.0") || comp.value.startsWith("<0.0.0"))) {
          return false;
        }
        if (this.operator.startsWith(">") && comp.operator.startsWith(">")) {
          return true;
        }
        if (this.operator.startsWith("<") && comp.operator.startsWith("<")) {
          return true;
        }
        if (this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=")) {
          return true;
        }
        if (cmp(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<")) {
          return true;
        }
        if (cmp(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")) {
          return true;
        }
        return false;
      }
    };
    module2.exports = Comparator;
    var parseOptions = require_parse_options();
    var { safeRe: re2, t: t13 } = require_re();
    var cmp = require_cmp();
    var debug2 = require_debug2();
    var SemVer = require_semver();
    var Range = require_range();
  }
});

// ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/satisfies.js
var require_satisfies = __commonJS({
  "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/satisfies.js"(exports, module2) {
    init_import_meta_url();
    var Range = require_range();
    var satisfies = /* @__PURE__ */ __name((version5, range, options) => {
      try {
        range = new Range(range, options);
      } catch (er2) {
        return false;
      }
      return range.test(version5);
    }, "satisfies");
    module2.exports = satisfies;
  }
});

// ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/to-comparators.js
var require_to_comparators = __commonJS({
  "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/to-comparators.js"(exports, module2) {
    init_import_meta_url();
    var Range = require_range();
    var toComparators = /* @__PURE__ */ __name((range, options) => new Range(range, options).set.map((comp) => comp.map((c8) => c8.value).join(" ").trim().split(" ")), "toComparators");
    module2.exports = toComparators;
  }
});

// ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/max-satisfying.js
var require_max_satisfying = __commonJS({
  "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/max-satisfying.js"(exports, module2) {
    init_import_meta_url();
    var SemVer = require_semver();
    var Range = require_range();
    var maxSatisfying = /* @__PURE__ */ __name((versions2, range, options) => {
      let max = null;
      let maxSV = null;
      let rangeObj = null;
      try {
        rangeObj = new Range(range, options);
      } catch (er2) {
        return null;
      }
      versions2.forEach((v8) => {
        if (rangeObj.test(v8)) {
          if (!max || maxSV.compare(v8) === -1) {
            max = v8;
            maxSV = new SemVer(max, options);
          }
        }
      });
      return max;
    }, "maxSatisfying");
    module2.exports = maxSatisfying;
  }
});

// ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/min-satisfying.js
var require_min_satisfying = __commonJS({
  "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/min-satisfying.js"(exports, module2) {
    init_import_meta_url();
    var SemVer = require_semver();
    var Range = require_range();
    var minSatisfying = /* @__PURE__ */ __name((versions2, range, options) => {
      let min = null;
      let minSV = null;
      let rangeObj = null;
      try {
        rangeObj = new Range(range, options);
      } catch (er2) {
        return null;
      }
      versions2.forEach((v8) => {
        if (rangeObj.test(v8)) {
          if (!min || minSV.compare(v8) === 1) {
            min = v8;
            minSV = new SemVer(min, options);
          }
        }
      });
      return min;
    }, "minSatisfying");
    module2.exports = minSatisfying;
  }
});

// ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/min-version.js
var require_min_version = __commonJS({
  "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/min-version.js"(exports, module2) {
    init_import_meta_url();
    var SemVer = require_semver();
    var Range = require_range();
    var gt2 = require_gt();
    var minVersion = /* @__PURE__ */ __name((range, loose) => {
      range = new Range(range, loose);
      let minver = new SemVer("0.0.0");
      if (range.test(minver)) {
        return minver;
      }
      minver = new SemVer("0.0.0-0");
      if (range.test(minver)) {
        return minver;
      }
      minver = null;
      for (let i7 = 0; i7 < range.set.length; ++i7) {
        const comparators = range.set[i7];
        let setMin = null;
        comparators.forEach((comparator) => {
          const compver = new SemVer(comparator.semver.version);
          switch (comparator.operator) {
            case ">":
              if (compver.prerelease.length === 0) {
                compver.patch++;
              } else {
                compver.prerelease.push(0);
              }
              compver.raw = compver.format();
            /* fallthrough */
            case "":
            case ">=":
              if (!setMin || gt2(compver, setMin)) {
                setMin = compver;
              }
              break;
            case "<":
            case "<=":
              break;
            /* istanbul ignore next */
            default:
              throw new Error(`Unexpected operation: ${comparator.operator}`);
          }
        });
        if (setMin && (!minver || gt2(minver, setMin))) {
          minver = setMin;
        }
      }
      if (minver && range.test(minver)) {
        return minver;
      }
      return null;
    }, "minVersion");
    module2.exports = minVersion;
  }
});

// ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/valid.js
var require_valid2 = __commonJS({
  "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/valid.js"(exports, module2) {
    init_import_meta_url();
    var Range = require_range();
    var validRange = /* @__PURE__ */ __name((range, options) => {
      try {
        return new Range(range, options).range || "*";
      } catch (er2) {
        return null;
      }
    }, "validRange");
    module2.exports = validRange;
  }
});

// ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/outside.js
var require_outside = __commonJS({
  "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/outside.js"(exports, module2) {
    init_import_meta_url();
    var SemVer = require_semver();
    var Comparator = require_comparator();
    var { ANY } = Comparator;
    var Range = require_range();
    var satisfies = require_satisfies();
    var gt2 = require_gt();
    var lt5 = require_lt();
    var lte = require_lte();
    var gte4 = require_gte();
    var outside = /* @__PURE__ */ __name((version5, range, hilo, options) => {
      version5 = new SemVer(version5, options);
      range = new Range(range, options);
      let gtfn, ltefn, ltfn, comp, ecomp;
      switch (hilo) {
        case ">":
          gtfn = gt2;
          ltefn = lte;
          ltfn = lt5;
          comp = ">";
          ecomp = ">=";
          break;
        case "<":
          gtfn = lt5;
          ltefn = gte4;
          ltfn = gt2;
          comp = "<";
          ecomp = "<=";
          break;
        default:
          throw new TypeError('Must provide a hilo val of "<" or ">"');
      }
      if (satisfies(version5, range, options)) {
        return false;
      }
      for (let i7 = 0; i7 < range.set.length; ++i7) {
        const comparators = range.set[i7];
        let high = null;
        let low = null;
        comparators.forEach((comparator) => {
          if (comparator.semver === ANY) {
            comparator = new Comparator(">=0.0.0");
          }
          high = high || comparator;
          low = low || comparator;
          if (gtfn(comparator.semver, high.semver, options)) {
            high = comparator;
          } else if (ltfn(comparator.semver, low.semver, options)) {
            low = comparator;
          }
        });
        if (high.operator === comp || high.operator === ecomp) {
          return false;
        }
        if ((!low.operator || low.operator === comp) && ltefn(version5, low.semver)) {
          return false;
        } else if (low.operator === ecomp && ltfn(version5, low.semver)) {
          return false;
        }
      }
      return true;
    }, "outside");
    module2.exports = outside;
  }
});

// ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/gtr.js
var require_gtr = __commonJS({
  "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/gtr.js"(exports, module2) {
    init_import_meta_url();
    var outside = require_outside();
    var gtr = /* @__PURE__ */ __name((version5, range, options) => outside(version5, range, ">", options), "gtr");
    module2.exports = gtr;
  }
});

// ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/ltr.js
var require_ltr = __commonJS({
  "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/ltr.js"(exports, module2) {
    init_import_meta_url();
    var outside = require_outside();
    var ltr = /* @__PURE__ */ __name((version5, range, options) => outside(version5, range, "<", options), "ltr");
    module2.exports = ltr;
  }
});

// ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/intersects.js
var require_intersects = __commonJS({
  "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/intersects.js"(exports, module2) {
    init_import_meta_url();
    var Range = require_range();
    var intersects = /* @__PURE__ */ __name((r1, r22, options) => {
      r1 = new Range(r1, options);
      r22 = new Range(r22, options);
      return r1.intersects(r22, options);
    }, "intersects");
    module2.exports = intersects;
  }
});

// ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/simplify.js
var require_simplify = __commonJS({
  "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/simplify.js"(exports, module2) {
    init_import_meta_url();
    var satisfies = require_satisfies();
    var compare = require_compare();
    module2.exports = (versions2, range, options) => {
      const set = [];
      let first = null;
      let prev = null;
      const v8 = versions2.sort((a7, b11) => compare(a7, b11, options));
      for (const version5 of v8) {
        const included = satisfies(version5, range, options);
        if (included) {
          prev = version5;
          if (!first) {
            first = version5;
          }
        } else {
          if (prev) {
            set.push([first, prev]);
          }
          prev = null;
          first = null;
        }
      }
      if (first) {
        set.push([first, null]);
      }
      const ranges = [];
      for (const [min, max] of set) {
        if (min === max) {
          ranges.push(min);
        } else if (!max && min === v8[0]) {
          ranges.push("*");
        } else if (!max) {
          ranges.push(`>=${min}`);
        } else if (min === v8[0]) {
          ranges.push(`<=${max}`);
        } else {
          ranges.push(`${min} - ${max}`);
        }
      }
      const simplified = ranges.join(" || ");
      const original = typeof range.raw === "string" ? range.raw : String(range);
      return simplified.length < original.length ? simplified : range;
    };
  }
});

// ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/subset.js
var require_subset = __commonJS({
  "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/subset.js"(exports, module2) {
    init_import_meta_url();
    var Range = require_range();
    var Comparator = require_comparator();
    var { ANY } = Comparator;
    var satisfies = require_satisfies();
    var compare = require_compare();
    var subset = /* @__PURE__ */ __name((sub, dom, options = {}) => {
      if (sub === dom) {
        return true;
      }
      sub = new Range(sub, options);
      dom = new Range(dom, options);
      let sawNonNull = false;
      OUTER: for (const simpleSub of sub.set) {
        for (const simpleDom of dom.set) {
          const isSub = simpleSubset(simpleSub, simpleDom, options);
          sawNonNull = sawNonNull || isSub !== null;
          if (isSub) {
            continue OUTER;
          }
        }
        if (sawNonNull) {
          return false;
        }
      }
      return true;
    }, "subset");
    var minimumVersionWithPreRelease = [new Comparator(">=0.0.0-0")];
    var minimumVersion = [new Comparator(">=0.0.0")];
    var simpleSubset = /* @__PURE__ */ __name((sub, dom, options) => {
      if (sub === dom) {
        return true;
      }
      if (sub.length === 1 && sub[0].semver === ANY) {
        if (dom.length === 1 && dom[0].semver === ANY) {
          return true;
        } else if (options.includePrerelease) {
          sub = minimumVersionWithPreRelease;
        } else {
          sub = minimumVersion;
        }
      }
      if (dom.length === 1 && dom[0].semver === ANY) {
        if (options.includePrerelease) {
          return true;
        } else {
          dom = minimumVersion;
        }
      }
      const eqSet = /* @__PURE__ */ new Set();
      let gt2, lt5;
      for (const c8 of sub) {
        if (c8.operator === ">" || c8.operator === ">=") {
          gt2 = higherGT(gt2, c8, options);
        } else if (c8.operator === "<" || c8.operator === "<=") {
          lt5 = lowerLT(lt5, c8, options);
        } else {
          eqSet.add(c8.semver);
        }
      }
      if (eqSet.size > 1) {
        return null;
      }
      let gtltComp;
      if (gt2 && lt5) {
        gtltComp = compare(gt2.semver, lt5.semver, options);
        if (gtltComp > 0) {
          return null;
        } else if (gtltComp === 0 && (gt2.operator !== ">=" || lt5.operator !== "<=")) {
          return null;
        }
      }
      for (const eq of eqSet) {
        if (gt2 && !satisfies(eq, String(gt2), options)) {
          return null;
        }
        if (lt5 && !satisfies(eq, String(lt5), options)) {
          return null;
        }
        for (const c8 of dom) {
          if (!satisfies(eq, String(c8), options)) {
            return false;
          }
        }
        return true;
      }
      let higher, lower;
      let hasDomLT, hasDomGT;
      let needDomLTPre = lt5 && !options.includePrerelease && lt5.semver.prerelease.length ? lt5.semver : false;
      let needDomGTPre = gt2 && !options.includePrerelease && gt2.semver.prerelease.length ? gt2.semver : false;
      if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt5.operator === "<" && needDomLTPre.prerelease[0] === 0) {
        needDomLTPre = false;
      }
      for (const c8 of dom) {
        hasDomGT = hasDomGT || c8.operator === ">" || c8.operator === ">=";
        hasDomLT = hasDomLT || c8.operator === "<" || c8.operator === "<=";
        if (gt2) {
          if (needDomGTPre) {
            if (c8.semver.prerelease && c8.semver.prerelease.length && c8.semver.major === needDomGTPre.major && c8.semver.minor === needDomGTPre.minor && c8.semver.patch === needDomGTPre.patch) {
              needDomGTPre = false;
            }
          }
          if (c8.operator === ">" || c8.operator === ">=") {
            higher = higherGT(gt2, c8, options);
            if (higher === c8 && higher !== gt2) {
              return false;
            }
          } else if (gt2.operator === ">=" && !satisfies(gt2.semver, String(c8), options)) {
            return false;
          }
        }
        if (lt5) {
          if (needDomLTPre) {
            if (c8.semver.prerelease && c8.semver.prerelease.length && c8.semver.major === needDomLTPre.major && c8.semver.minor === needDomLTPre.minor && c8.semver.patch === needDomLTPre.patch) {
              needDomLTPre = false;
            }
          }
          if (c8.operator === "<" || c8.operator === "<=") {
            lower = lowerLT(lt5, c8, options);
            if (lower === c8 && lower !== lt5) {
              return false;
            }
          } else if (lt5.operator === "<=" && !satisfies(lt5.semver, String(c8), options)) {
            return false;
          }
        }
        if (!c8.operator && (lt5 || gt2) && gtltComp !== 0) {
          return false;
        }
      }
      if (gt2 && hasDomLT && !lt5 && gtltComp !== 0) {
        return false;
      }
      if (lt5 && hasDomGT && !gt2 && gtltComp !== 0) {
        return false;
      }
      if (needDomGTPre || needDomLTPre) {
        return false;
      }
      return true;
    }, "simpleSubset");
    var higherGT = /* @__PURE__ */ __name((a7, b11, options) => {
      if (!a7) {
        return b11;
      }
      const comp = compare(a7.semver, b11.semver, options);
      return comp > 0 ? a7 : comp < 0 ? b11 : b11.operator === ">" && a7.operator === ">=" ? b11 : a7;
    }, "higherGT");
    var lowerLT = /* @__PURE__ */ __name((a7, b11, options) => {
      if (!a7) {
        return b11;
      }
      const comp = compare(a7.semver, b11.semver, options);
      return comp < 0 ? a7 : comp > 0 ? b11 : b11.operator === "<" && a7.operator === "<=" ? b11 : a7;
    }, "lowerLT");
    module2.exports = subset;
  }
});

// ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/index.js
var require_semver2 = __commonJS({
  "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/index.js"(exports, module2) {
    init_import_meta_url();
    var internalRe = require_re();
    var constants5 = require_constants8();
    var SemVer = require_semver();
    var identifiers = require_identifiers();
    var parse17 = require_parse3();
    var valid = require_valid();
    var clean = require_clean();
    var inc = require_inc();
    var diff = require_diff();
    var major = require_major();
    var minor = require_minor();
    var patch = require_patch();
    var prerelease = require_prerelease();
    var compare = require_compare();
    var rcompare = require_rcompare();
    var compareLoose = require_compare_loose();
    var compareBuild = require_compare_build();
    var sort = require_sort();
    var rsort = require_rsort();
    var gt2 = require_gt();
    var lt5 = require_lt();
    var eq = require_eq();
    var neq = require_neq();
    var gte4 = require_gte();
    var lte = require_lte();
    var cmp = require_cmp();
    var coerce6 = require_coerce();
    var Comparator = require_comparator();
    var Range = require_range();
    var satisfies = require_satisfies();
    var toComparators = require_to_comparators();
    var maxSatisfying = require_max_satisfying();
    var minSatisfying = require_min_satisfying();
    var minVersion = require_min_version();
    var validRange = require_valid2();
    var outside = require_outside();
    var gtr = require_gtr();
    var ltr = require_ltr();
    var intersects = require_intersects();
    var simplifyRange = require_simplify();
    var subset = require_subset();
    module2.exports = {
      parse: parse17,
      valid,
      clean,
      inc,
      diff,
      major,
      minor,
      patch,
      prerelease,
      compare,
      rcompare,
      compareLoose,
      compareBuild,
      sort,
      rsort,
      gt: gt2,
      lt: lt5,
      eq,
      neq,
      gte: gte4,
      lte,
      cmp,
      coerce: coerce6,
      Comparator,
      Range,
      satisfies,
      toComparators,
      maxSatisfying,
      minSatisfying,
      minVersion,
      validRange,
      outside,
      gtr,
      ltr,
      intersects,
      simplifyRange,
      subset,
      SemVer,
      re: internalRe.re,
      src: internalRe.src,
      tokens: internalRe.t,
      SEMVER_SPEC_VERSION: constants5.SEMVER_SPEC_VERSION,
      RELEASE_TYPES: constants5.RELEASE_TYPES,
      compareIdentifiers: identifiers.compareIdentifiers,
      rcompareIdentifiers: identifiers.rcompareIdentifiers
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/get-commands.js
function getDevCommands(frameworkDevCommand, scripts = {}) {
  const preferredScripts = Object.entries(scripts).filter(([, scriptValue]) => scriptValue.includes(frameworkDevCommand)).map(([key]) => key).sort(sortScriptsByRelevance(NPM_DEV_SCRIPTS));
  if (preferredScripts.length > 0) {
    return preferredScripts;
  }
  return Object.keys(scripts).filter((script) => isNpmDevScript(script, scripts[script])).sort(sortScriptsByRelevance(NPM_DEV_SCRIPTS));
}
function getBuildCommands(frameworkBuildCommand, scripts = {}) {
  const preferredScripts = Object.entries(scripts).filter(([, scriptValue]) => scriptValue.includes(frameworkBuildCommand)).map(([key]) => key).sort(sortScriptsByRelevance(NPM_BUILD_SCRIPTS));
  if (preferredScripts.length > 0) {
    return preferredScripts;
  }
  return Object.keys(scripts).filter((script) => isNpmBuildScript(script, scripts[script])).sort(sortScriptsByRelevance(NPM_BUILD_SCRIPTS));
}
var NPM_DEV_SCRIPTS, EXCLUDED_DEV_SCRIPTS, NPM_BUILD_SCRIPTS, EXCLUDED_BUILD_SCRIPTS, isExcludedDevScript, isExcludedBuildScript, isScript, getSortIndex, sortScriptsByRelevance, isNpmDevScript, isNpmBuildScript;
var init_get_commands = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/get-commands.js"() {
    init_import_meta_url();
    NPM_DEV_SCRIPTS = ["dev", "serve", "develop", "start", "run", "web"];
    EXCLUDED_DEV_SCRIPTS = ["netlify dev"];
    NPM_BUILD_SCRIPTS = ["build"];
    EXCLUDED_BUILD_SCRIPTS = ["netlify build"];
    isExcludedDevScript = /* @__PURE__ */ __name((scriptValue) => EXCLUDED_DEV_SCRIPTS.some((excluded) => scriptValue.includes(excluded)), "isExcludedDevScript");
    isExcludedBuildScript = /* @__PURE__ */ __name((scriptValue) => EXCLUDED_BUILD_SCRIPTS.some((excluded) => scriptValue.includes(excluded)), "isExcludedBuildScript");
    isScript = /* @__PURE__ */ __name((scriptName, devScriptName) => scriptName === devScriptName || scriptName.endsWith(`:${devScriptName}`), "isScript");
    getSortIndex = /* @__PURE__ */ __name((index) => index === -1 ? Number.MAX_SAFE_INTEGER : index, "getSortIndex");
    sortScriptsByRelevance = /* @__PURE__ */ __name((scripts) => (script1, script2) => {
      const index1 = scripts.findIndex((devScriptName) => isScript(script1, devScriptName));
      const index2 = scripts.findIndex((devScriptName) => isScript(script2, devScriptName));
      return getSortIndex(index1) - getSortIndex(index2);
    }, "sortScriptsByRelevance");
    isNpmDevScript = /* @__PURE__ */ __name((scriptName, scriptValue) => NPM_DEV_SCRIPTS.some((devScriptName) => isScript(scriptName, devScriptName) && !isExcludedDevScript(scriptValue)), "isNpmDevScript");
    isNpmBuildScript = /* @__PURE__ */ __name((scriptName, scriptValue) => NPM_BUILD_SCRIPTS.some((devScriptName) => isScript(scriptName, devScriptName) && !isExcludedBuildScript(scriptValue)), "isNpmBuildScript");
    __name(getDevCommands, "getDevCommands");
    __name(getBuildCommands, "getBuildCommands");
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/framework.js
function filterByRelevance(detected) {
  const filtered = [];
  for (const framework of detected.sort(sortFrameworksBasedOnAccuracy)) {
    if (filtered.length === 0 || filtered[0].detected.accuracy === framework.detected.accuracy) {
      filtered.push(framework);
    }
  }
  return filtered;
}
function sortFrameworksBasedOnAccuracy(a7, b11) {
  const sort = b11.detected.accuracy - a7.detected.accuracy;
  if (sort === 0) {
    const categoryRanking = [Category.BackendFramework, Category.FrontendFramework, Category.BuildTool, Category.SSG];
    return categoryRanking.indexOf(b11.category) - categoryRanking.indexOf(a7.category);
  }
  return sort;
}
function mergeDetections(detections) {
  const definedDetections = detections.filter(/* @__PURE__ */ __name(function isDetection(d8) {
    return Boolean(d8);
  }, "isDetection")).sort((a7, b11) => a7.accuracy > b11.accuracy ? -1 : a7.accuracy < b11.accuracy ? 1 : 0);
  if (definedDetections.length === 0) {
    return;
  }
  return definedDetections.slice(1).reduce((merged, detection) => {
    merged.config = merged.config ?? detection.config;
    merged.configName = merged.configName ?? detection.configName;
    merged.package = merged.package ?? detection.package;
    merged.packageJSON = merged.packageJSON ?? detection.packageJSON;
    return merged;
  }, definedDetections[0]);
}
var import_semver, Category, Accuracy, BaseFramework;
var init_framework = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/framework.js"() {
    init_import_meta_url();
    import_semver = __toESM(require_semver2(), 1);
    init_get_commands();
    (function(Category2) {
      Category2["BackendFramework"] = "backend_framework";
      Category2["FrontendFramework"] = "frontend_framework";
      Category2["SSG"] = "static_site_generator";
      Category2["BuildTool"] = "build_tool";
    })(Category || (Category = {}));
    (function(Accuracy2) {
      Accuracy2[Accuracy2["Forced"] = 5] = "Forced";
      Accuracy2[Accuracy2["NPM"] = 4] = "NPM";
      Accuracy2[Accuracy2["ConfigOnly"] = 3] = "ConfigOnly";
      Accuracy2[Accuracy2["Config"] = 2] = "Config";
      Accuracy2[Accuracy2["NPMHoisted"] = 1] = "NPMHoisted";
    })(Accuracy || (Accuracy = {}));
    __name(filterByRelevance, "filterByRelevance");
    __name(sortFrameworksBasedOnAccuracy, "sortFrameworksBasedOnAccuracy");
    __name(mergeDetections, "mergeDetections");
    BaseFramework = class {
      static {
        __name(this, "BaseFramework");
      }
      project;
      path;
      id;
      name;
      category;
      detected;
      version;
      configFiles = [];
      npmDependencies = [];
      excludedNpmDependencies = [];
      plugins = [];
      staticAssetsDirectory;
      env = {};
      dev;
      build = {
        command: "npm run build",
        directory: "dist"
      };
      logo;
      constructor(project, path84) {
        this.project = project;
        this.path = path84;
        if (project.packageManager?.runCommand) {
          this.build.command = `${project.packageManager.runCommand} build`;
        }
      }
      setDetected(accuracy, reason) {
        this.detected = {
          accuracy
        };
        if (typeof reason === "string") {
          this.detected.config = reason;
        } else {
          this.detected.package = reason;
        }
        return this;
      }
      /** Retrieves the version of a npm package from the node_modules */
      async getVersionFromNodeModules(packageName) {
        if (this.project.fs.getEnvironment() === "browser") {
          return;
        }
        try {
          const packageJson = await this.project.fs.findUp(this.project.fs.join("node_modules", packageName, "package.json"), {
            cwd: this.path || this.project.baseDirectory,
            stopAt: this.project.root
          });
          if (packageJson) {
            const { version: version5 } = await this.project.fs.readJSON(packageJson);
            if (typeof version5 === "string") {
              return (0, import_semver.parse)(version5) || void 0;
            }
          }
        } catch {
        }
      }
      /** check if the npmDependencies are used inside the provided package.json */
      async npmDependenciesUsed(pkgJSON) {
        const allDeps = [...Object.entries(pkgJSON.dependencies || {}), ...Object.entries(pkgJSON.devDependencies || {})];
        const found = allDeps.find(([depName]) => this.npmDependencies.includes(depName));
        const excluded = allDeps.some(([depName]) => this.excludedNpmDependencies.includes(depName));
        if (!excluded && found?.[0]) {
          const version5 = await this.getVersionFromNodeModules(found[0]);
          return {
            name: found[0],
            // coerce to parse syntax like ~0.1.2 or ^1.2.3
            version: version5 || (0, import_semver.parse)((0, import_semver.coerce)(found[1])) || void 0
          };
        }
      }
      /** detect if the framework occurs inside the package.json dependencies */
      async detectNpmDependency() {
        if (this.npmDependencies.length) {
          const startDir = this.path || this.project.baseDirectory;
          const pkg = await this.project.getPackageJSON(startDir);
          const dep = await this.npmDependenciesUsed(pkg);
          if (dep) {
            this.version = dep.version;
            return {
              // if the match of the npm package was in a directory up we don't have a high accuracy
              accuracy: this.project.fs.join(startDir, "package.json") === pkg.pkgPath ? Accuracy.NPM : Accuracy.NPMHoisted,
              package: dep,
              packageJSON: pkg
            };
          }
        }
      }
      /** detect if the framework config file is located somewhere up the tree */
      async detectConfigFile(configFiles) {
        if (configFiles.length) {
          const config = await this.project.fs.findUp(configFiles, {
            cwd: this.path || this.project.baseDirectory,
            stopAt: this.project.root
          });
          if (config) {
            return {
              // Have higher trust on a detection of a config file if there is no npm dependency specified for this framework
              // otherwise the npm dependency should have already triggered the detection
              accuracy: this.npmDependencies.length === 0 ? Accuracy.ConfigOnly : Accuracy.Config,
              config,
              configName: this.project.fs.basename(config)
            };
          }
        }
      }
      /**
       * Checks if the project is using a specific framework:
       * - if `npmDependencies` is set, one of them must be present in the `package.json` `dependencies|devDependencies`
       * - if `excludedNpmDependencies` is set, none of them must be present in the `package.json` `dependencies|devDependencies`
       * - if `configFiles` is set, one of the files must exist
       */
      async detect() {
        const npm = await this.detectNpmDependency();
        const config = await this.detectConfigFile(this.configFiles ?? []);
        this.detected = mergeDetections([
          // we can force frameworks as well
          this.detected?.accuracy === Accuracy.Forced ? this.detected : void 0,
          npm,
          config
        ]);
        if (this.detected) {
          return this;
        }
      }
      /**
       * Retrieve framework's dev commands.
       * We use, in priority order:
       *   - `package.json` `scripts` containing the frameworks dev command
       *   - `package.json` `scripts` whose names are among a list of common dev scripts like: `dev`, `serve`, `develop`, ...
       *   -  The frameworks dev command
       */
      getDevCommands() {
        if (this.dev?.command === void 0) {
          return [];
        }
        const devCommands = getDevCommands(this.dev.command, this.detected?.packageJSON?.scripts);
        if (devCommands.length > 0) {
          return devCommands.map((command2) => this.project.getNpmScriptCommand(command2));
        }
        return [this.dev.command];
      }
      getBuildCommands() {
        const buildCommands = getBuildCommands(this.build.command, this.detected?.packageJSON?.scripts);
        if (buildCommands.length > 0) {
          return buildCommands.map((command2) => this.project.getNpmScriptCommand(command2));
        }
        return [this.build.command];
      }
      /** This method will be called by the JSON.stringify */
      toJSON() {
        return {
          id: this.id,
          name: this.name,
          package: {
            name: this.detected?.package?.name || this.npmDependencies?.[0],
            version: this.detected?.package?.version?.raw || "unknown"
          },
          category: this.category,
          dev: {
            commands: this.getDevCommands(),
            port: this.dev?.port,
            pollingStrategies: this.dev?.pollingStrategies
          },
          build: {
            commands: [this.build.command],
            directory: this.build.directory
          },
          staticAssetsDirectory: this.staticAssetsDirectory,
          env: this.env,
          logo: this.logo ? Object.entries(this.logo).reduce((prev, [key, value]) => ({ ...prev, [key]: `https://framework-info.netlify.app${value}` }), {}) : void 0,
          plugins: this.plugins
        };
      }
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/analog.js
var Analog2;
var init_analog2 = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/analog.js"() {
    init_import_meta_url();
    init_framework();
    Analog2 = class extends BaseFramework {
      static {
        __name(this, "Analog");
      }
      id = "analog";
      name = "Analog";
      configFiles = [];
      npmDependencies = ["@analogjs/platform"];
      category = Category.SSG;
      dev = {
        port: 5173,
        command: "ng serve",
        pollingStrategies: [{ name: "TCP" }]
      };
      build = {
        command: "ng build --prod",
        directory: "dist/analog/public"
      };
      logo = {
        default: "/logos/analog/default.svg",
        light: "/logos/analog/default.svg",
        dark: "/logos/analog/default.svg"
      };
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/angular.js
var import_semver2, Angular2;
var init_angular2 = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/angular.js"() {
    init_import_meta_url();
    import_semver2 = __toESM(require_semver2(), 1);
    init_framework();
    Angular2 = class extends BaseFramework {
      static {
        __name(this, "Angular");
      }
      id = "angular";
      name = "Angular";
      configFiles = ["angular.json"];
      npmDependencies = ["@angular/cli"];
      excludedNpmDependencies = ["@analogjs/platform"];
      category = Category.FrontendFramework;
      dev = {
        port: 4200,
        command: "ng serve",
        pollingStrategies: [{ name: "TCP" }]
      };
      build = {
        command: "ng build --prod",
        directory: "dist/"
      };
      logo = {
        default: "/logos/angular/default.svg",
        light: "/logos/angular/default.svg",
        dark: "/logos/angular/default.svg"
      };
      async detect() {
        await super.detect();
        if (this.detected) {
          if (this.version && (0, import_semver2.gte)(this.version, "17.0.0-rc") && !process.env.NETLIFY_ANGULAR_PLUGIN_SKIP) {
            this.plugins.push("@netlify/angular-runtime");
            const angularJson = await this.project.fs.gracefullyReadFile("angular.json");
            if (angularJson) {
              const { projects, defaultProject } = JSON.parse(angularJson);
              const project = projects[defaultProject ?? Object.keys(projects)[0]];
              const outputPath = project?.architect?.build?.options?.outputPath;
              if (outputPath) {
                const usesApplicationBuilder = project?.architect?.build?.builder?.endsWith(":application");
                this.build.directory = usesApplicationBuilder ? this.project.fs.join(outputPath, "browser") : outputPath;
              }
            }
          }
          return this;
        }
      }
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/assemble.js
var Assemble;
var init_assemble = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/assemble.js"() {
    init_import_meta_url();
    init_framework();
    Assemble = class extends BaseFramework {
      static {
        __name(this, "Assemble");
      }
      id = "assemble";
      name = "Assemble";
      npmDependencies = ["assemble"];
      category = Category.SSG;
      build = {
        command: "grunt build",
        directory: "dist"
      };
      logo = {
        default: "/logos/assemble/default.png",
        light: "/logos/assemble/default.png",
        dark: "/logos/assemble/default.png"
      };
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/astro.js
var import_semver3, Astro2;
var init_astro2 = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/astro.js"() {
    init_import_meta_url();
    import_semver3 = __toESM(require_semver2(), 1);
    init_framework();
    Astro2 = class extends BaseFramework {
      static {
        __name(this, "Astro");
      }
      id = "astro";
      name = "Astro";
      configFiles = ["astro.config.mjs"];
      npmDependencies = ["astro"];
      category = Category.SSG;
      staticAssetsDirectory = "public";
      dev = {
        port: 4321,
        command: "astro dev",
        pollingStrategies: [{ name: "TCP" }]
      };
      build = {
        command: "astro build",
        directory: "dist"
      };
      logo = {
        default: "/logos/astro/light.svg",
        light: "/logos/astro/light.svg",
        dark: "/logos/astro/dark.svg"
      };
      async detect() {
        await super.detect();
        if (this.detected) {
          if (this.version && (0, import_semver3.lt)(this.version, "3.0.0")) {
            this.dev.port = 3e3;
          }
          return this;
        }
      }
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/blitz.js
var Blitz;
var init_blitz = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/blitz.js"() {
    init_import_meta_url();
    init_framework();
    Blitz = class extends BaseFramework {
      static {
        __name(this, "Blitz");
      }
      id = "blitz";
      name = "Blitz.js";
      npmDependencies = ["blitz"];
      category = Category.SSG;
      dev = {
        command: "blitz dev",
        port: 3e3,
        pollingStrategies: [{ name: "TCP" }]
      };
      build = {
        command: "blitz build",
        directory: "out"
      };
      logo = {
        default: "/logos/blitz/light.svg",
        light: "/logos/blitz/light.svg",
        dark: "/logos/blitz/dark.svg"
      };
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/brunch.js
var Brunch;
var init_brunch = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/brunch.js"() {
    init_import_meta_url();
    init_framework();
    Brunch = class extends BaseFramework {
      static {
        __name(this, "Brunch");
      }
      id = "brunch";
      name = "Brunch";
      npmDependencies = ["brunch"];
      configFiles = ["brunch-config.js"];
      category = Category.BuildTool;
      dev = {
        command: "brunch watch --server",
        port: 3333,
        pollingStrategies: [{ name: "TCP" }]
      };
      build = {
        command: "brunch build",
        directory: "public"
      };
      logo = {
        default: "/logos/brunch/default.svg",
        light: "/logos/brunch/default.svg",
        dark: "/logos/brunch/default.svg"
      };
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/cecil.js
var Cecil;
var init_cecil = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/cecil.js"() {
    init_import_meta_url();
    init_framework();
    Cecil = class extends BaseFramework {
      static {
        __name(this, "Cecil");
      }
      id = "cecil";
      name = "Cecil";
      configFiles = ["config.yml"];
      category = Category.SSG;
      dev = {
        command: "cecil serve",
        port: 8e3,
        pollingStrategies: [{ name: "TCP" }]
      };
      build = {
        command: "cecil build",
        directory: "_site"
      };
      logo = {
        default: "/logos/cecil/default.svg",
        light: "/logos/cecil/default.svg",
        dark: "/logos/cecil/default.svg"
      };
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/docpad.js
var DocPad;
var init_docpad = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/docpad.js"() {
    init_import_meta_url();
    init_framework();
    DocPad = class extends BaseFramework {
      static {
        __name(this, "DocPad");
      }
      id = "docpad";
      name = "DocPad";
      npmDependencies = ["docpad"];
      category = Category.SSG;
      dev = {
        command: "docpad run",
        port: 9778,
        pollingStrategies: [{ name: "TCP" }]
      };
      build = {
        command: "docpad generate",
        directory: "out"
      };
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/docusaurus.js
var Docusaurus;
var init_docusaurus = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/docusaurus.js"() {
    init_import_meta_url();
    init_framework();
    Docusaurus = class extends BaseFramework {
      static {
        __name(this, "Docusaurus");
      }
      id = "docusaurus";
      name = "Docusaurus";
      configFiles = [
        "docusaurus.config.js",
        // v2
        "siteConfig.js"
        // v1
      ];
      npmDependencies = [
        "@docusaurus/core",
        // v2
        "docusaurus"
        // v1
      ];
      category = Category.SSG;
      staticAssetsDirectory = "static";
      dev = {
        command: "docusaurus start",
        port: 3e3,
        pollingStrategies: [{ name: "TCP" }]
      };
      build = {
        command: "docusaurus build",
        directory: "build"
      };
      logo = {
        default: "/logos/docusaurus/default.svg",
        light: "/logos/docusaurus/default.svg",
        dark: "/logos/docusaurus/default.svg"
      };
      env = { BROWSER: "none" };
      async detect() {
        await super.detect();
        if (this.detected) {
          if (this.isV1(this.detected)) {
            this.build.command = "docusaurus-build";
            this.build.directory = "build/<project-name>";
            this.dev.command = "docusaurus-start";
          }
          return this;
        }
      }
      isV1(detected) {
        return detected.config?.endsWith("siteConfig.js") || detected.package?.name === "docusaurus";
      }
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/eleventy.js
var Eleventy;
var init_eleventy = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/eleventy.js"() {
    init_import_meta_url();
    init_framework();
    Eleventy = class extends BaseFramework {
      static {
        __name(this, "Eleventy");
      }
      id = "eleventy";
      name = "Eleventy";
      configFiles = [".eleventy.js", "eleventy.config.js", "eleventy.config.cjs"];
      npmDependencies = ["@11ty/eleventy"];
      category = Category.SSG;
      dev = {
        command: "eleventy --serve",
        port: 8080,
        pollingStrategies: [{ name: "TCP" }]
      };
      build = {
        command: "eleventy",
        directory: "_site"
      };
      logo = {
        default: "/logos/eleventy/default.svg",
        light: "/logos/eleventy/light.svg",
        dark: "/logos/eleventy/dark.svg"
      };
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/ember.js
var Ember;
var init_ember = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/ember.js"() {
    init_import_meta_url();
    init_framework();
    Ember = class extends BaseFramework {
      static {
        __name(this, "Ember");
      }
      id = "ember";
      name = "Ember.js";
      configFiles = ["ember-cli-build.js"];
      npmDependencies = ["ember-cli"];
      category = Category.FrontendFramework;
      dev = {
        command: "ember serve",
        port: 4200,
        pollingStrategies: [{ name: "TCP" }]
      };
      build = {
        command: "ember build",
        directory: "dist"
      };
      logo = {
        default: "/logos/ember/default.svg",
        light: "/logos/ember/light.svg",
        dark: "/logos/ember/dark.svg"
      };
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/expo.js
var Expo;
var init_expo = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/expo.js"() {
    init_import_meta_url();
    init_framework();
    Expo = class extends BaseFramework {
      static {
        __name(this, "Expo");
      }
      id = "expo";
      name = "Expo";
      configFiles = ["app.json"];
      npmDependencies = ["expo"];
      category = Category.FrontendFramework;
      dev = {
        command: "expo start --web",
        port: 19006,
        pollingStrategies: [{ name: "TCP" }]
      };
      build = {
        command: "expo export -p web",
        directory: "dist"
      };
      logo = {
        default: "/logos/expo/default.svg",
        light: "/logos/expo/light.svg",
        dark: "/logos/expo/dark.svg"
      };
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/gatsby.js
var import_semver4, Gatsby;
var init_gatsby = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/gatsby.js"() {
    init_import_meta_url();
    import_semver4 = __toESM(require_semver2(), 1);
    init_framework();
    Gatsby = class extends BaseFramework {
      static {
        __name(this, "Gatsby");
      }
      id = "gatsby";
      name = "Gatsby";
      configFiles = ["gatsby-config.js", "gatsby-config.ts"];
      npmDependencies = ["gatsby"];
      category = Category.SSG;
      staticAssetsDirectory = "static";
      dev = {
        command: "gatsby develop",
        port: 8e3,
        pollingStrategies: [{ name: "TCP" }]
      };
      build = {
        command: "gatsby build",
        directory: "public"
      };
      logo = {
        default: "/logos/gatsby/default.svg",
        light: "/logos/gatsby/light.svg",
        dark: "/logos/gatsby/dark.svg"
      };
      env = {
        GATSBY_LOGGER: "yurnalist",
        GATSBY_PRECOMPILE_DEVELOP_FUNCTIONS: "true",
        AWS_LAMBDA_JS_RUNTIME: "nodejs14.x",
        NODE_VERSION: "14"
      };
      async detect() {
        await super.detect();
        if (this.detected) {
          if (this.version && (0, import_semver4.gte)(this.version, "5.0.0")) {
            this.env.NODE_VERSION = "18";
            this.env.AWS_LAMBDA_JS_RUNTIME = "nodejs18.x";
          }
          const nodeVersion2 = await this.project.getCurrentNodeVersion();
          if (nodeVersion2 && (0, import_semver4.gte)(nodeVersion2, "12.13.0") && !process.env.NETLIFY_SKIP_GATSBY_BUILD_PLUGIN) {
            this.plugins.push("@netlify/plugin-gatsby");
          }
          return this;
        }
      }
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/gridsome.js
var Gridsome;
var init_gridsome = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/gridsome.js"() {
    init_import_meta_url();
    init_framework();
    Gridsome = class extends BaseFramework {
      static {
        __name(this, "Gridsome");
      }
      id = "gridsome";
      name = "Gridsome";
      configFiles = ["gridsome.config.js"];
      npmDependencies = ["gridsome"];
      category = Category.SSG;
      dev = {
        command: "gridsome develop",
        port: 8080,
        pollingStrategies: [{ name: "TCP" }]
      };
      build = {
        command: "gridsome build",
        directory: "dist"
      };
      logo = {
        default: "/logos/gridsome/default.svg",
        light: "/logos/gridsome/light.svg",
        dark: "/logos/gridsome/dark.svg"
      };
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/grunt.js
var Grunt;
var init_grunt = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/grunt.js"() {
    init_import_meta_url();
    init_framework();
    Grunt = class extends BaseFramework {
      static {
        __name(this, "Grunt");
      }
      id = "grunt";
      name = "Grunt";
      npmDependencies = ["grunt"];
      category = Category.BuildTool;
      build = {
        command: "grunt build",
        directory: "dist"
      };
      logo = {
        default: "/logos/grunt/default.svg",
        light: "/logos/grunt/default.svg",
        dark: "/logos/grunt/default.svg"
      };
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/gulp.js
var Gulp;
var init_gulp = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/gulp.js"() {
    init_import_meta_url();
    init_framework();
    Gulp = class extends BaseFramework {
      static {
        __name(this, "Gulp");
      }
      id = "gulp";
      name = "gulp.js";
      npmDependencies = ["gulp"];
      category = Category.BuildTool;
      build = {
        command: "gulp build",
        directory: "dist"
      };
      logo = {
        default: "/logos/gulp/default.svg",
        light: "/logos/gulp/default.svg",
        dark: "/logos/gulp/default.svg"
      };
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/harp.js
var Harp;
var init_harp = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/harp.js"() {
    init_import_meta_url();
    init_framework();
    Harp = class extends BaseFramework {
      static {
        __name(this, "Harp");
      }
      id = "harp";
      name = "Harp";
      npmDependencies = ["harp"];
      category = Category.SSG;
      dev = {
        command: "harp server",
        port: 9e3,
        pollingStrategies: [{ name: "TCP" }]
      };
      build = {
        command: "harp compile",
        directory: "www"
      };
      logo = {
        default: "/logos/harp/default.svg",
        light: "/logos/harp/light.svg",
        dark: "/logos/harp/default.svg"
      };
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/hexo.js
var Hexo;
var init_hexo = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/hexo.js"() {
    init_import_meta_url();
    init_framework();
    Hexo = class extends BaseFramework {
      static {
        __name(this, "Hexo");
      }
      id = "hexo";
      name = "Hexo";
      configFiles = ["_config.yml"];
      npmDependencies = ["hexo"];
      category = Category.SSG;
      dev = {
        command: "hexo server",
        port: 4e3,
        pollingStrategies: [{ name: "TCP" }]
      };
      build = {
        command: "hexo generate",
        directory: "public"
      };
      logo = {
        default: "/logos/hexo/default.svg",
        light: "/logos/hexo/light.svg",
        dark: "/logos/hexo/dark.svg"
      };
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/hono.js
var Hono2;
var init_hono2 = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/hono.js"() {
    init_import_meta_url();
    init_framework();
    Hono2 = class extends BaseFramework {
      static {
        __name(this, "Hono");
      }
      id = "hono";
      name = "Hono";
      npmDependencies = ["hono"];
      category = Category.BackendFramework;
      logo = {
        default: "/logos/hono/default.svg",
        light: "/logos/hono/default.svg",
        dark: "/logos/hono/default.svg"
      };
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/hugo.js
var Hugo;
var init_hugo = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/hugo.js"() {
    init_import_meta_url();
    init_framework();
    Hugo = class extends BaseFramework {
      static {
        __name(this, "Hugo");
      }
      id = "hugo";
      name = "Hugo";
      configFiles = ["config.json", "config.toml", "config.yaml", "hugo.toml"];
      category = Category.SSG;
      dev = {
        command: "hugo server -w",
        port: 1313,
        pollingStrategies: [{ name: "TCP" }]
      };
      build = {
        command: "hugo",
        directory: "public"
      };
      logo = {
        default: "/logos/hugo/default.svg",
        light: "/logos/hugo/default.svg",
        dark: "/logos/hugo/default.svg"
      };
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/hydrogen.js
var CLASSIC_COMPILER_CONFIG_FILES, CLASSIC_COMPILER_DEV, CLASSIC_COMPILER_BUILD, VITE_CONFIG_FILES, VITE_DEV, VITE_BUILD, Hydrogen;
var init_hydrogen = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/hydrogen.js"() {
    init_import_meta_url();
    init_framework();
    CLASSIC_COMPILER_CONFIG_FILES = ["remix.config.js"];
    CLASSIC_COMPILER_DEV = {
      command: 'remix dev --manual -c "netlify dev"'
    };
    CLASSIC_COMPILER_BUILD = {
      command: "remix build",
      directory: "public"
    };
    VITE_CONFIG_FILES = [
      "vite.config.js",
      "vite.config.mjs",
      "vite.config.cjs",
      "vite.config.ts",
      "vite.config.mts",
      "vite.config.cts"
    ];
    VITE_DEV = {
      command: "shopify hydrogen dev",
      port: 5173
    };
    VITE_BUILD = {
      // This should be `shopify hydrogen build` but we use this as a workaround for
      // https://github.com/Shopify/hydrogen/issues/2496 and https://github.com/Shopify/hydrogen/issues/2497.
      command: "remix vite:build",
      directory: "dist/client"
    };
    Hydrogen = class extends BaseFramework {
      static {
        __name(this, "Hydrogen");
      }
      id = "hydrogen";
      name = "Hydrogen";
      npmDependencies = ["@shopify/hydrogen"];
      configFiles = [...VITE_CONFIG_FILES, ...CLASSIC_COMPILER_CONFIG_FILES];
      category = Category.SSG;
      logo = {
        default: "/logos/hydrogen/default.svg",
        light: "/logos/hydrogen/default.svg",
        dark: "/logos/hydrogen/default.svg"
      };
      async detect() {
        await super.detect();
        if (this.detected) {
          if (this.detected.configName && VITE_CONFIG_FILES.includes(this.detected.configName)) {
            this.dev = VITE_DEV;
            this.build = VITE_BUILD;
            return this;
          } else {
            this.dev = CLASSIC_COMPILER_DEV;
            this.build = CLASSIC_COMPILER_BUILD;
            return this;
          }
        }
      }
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/jekyll.js
var Jekyll;
var init_jekyll = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/jekyll.js"() {
    init_import_meta_url();
    init_framework();
    Jekyll = class extends BaseFramework {
      static {
        __name(this, "Jekyll");
      }
      id = "jekyll";
      name = "Jekyll";
      configFiles = ["_config.yml", "_config.yaml", "_config.toml"];
      category = Category.SSG;
      dev = {
        command: "bundle exec jekyll serve -w",
        port: 4e3,
        pollingStrategies: [{ name: "TCP" }]
      };
      build = {
        command: "bundle exec jekyll build",
        directory: "_site"
      };
      logo = {
        default: "/logos/jekyll/dark.svg",
        light: "/logos/jekyll/light.svg",
        dark: "/logos/jekyll/dark.svg"
      };
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/metalsmith.js
var Metalsmith;
var init_metalsmith = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/metalsmith.js"() {
    init_import_meta_url();
    init_framework();
    Metalsmith = class extends BaseFramework {
      static {
        __name(this, "Metalsmith");
      }
      id = "metalsmith";
      name = "Metalsmith";
      npmDependencies = ["metalsmith"];
      category = Category.SSG;
      build = {
        command: "metalsmith",
        directory: "build"
      };
      logo = {
        default: "/logos/metalsmith/default.svg",
        light: "/logos/metalsmith/default.svg",
        dark: "/logos/metalsmith/default.svg"
      };
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/middleman.js
var Middleman;
var init_middleman = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/middleman.js"() {
    init_import_meta_url();
    init_framework();
    Middleman = class extends BaseFramework {
      static {
        __name(this, "Middleman");
      }
      id = "middleman";
      name = "Middleman";
      configFiles = ["config.rb"];
      category = Category.SSG;
      dev = {
        command: "bundle exec middleman server",
        port: 4567,
        pollingStrategies: [{ name: "TCP" }]
      };
      build = {
        command: "bundle exec middleman build",
        directory: "build"
      };
      logo = {
        default: "/logos/middleman/default.svg",
        light: "/logos/middleman/default.svg",
        dark: "/logos/middleman/default.svg"
      };
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/next.js
var import_semver5, Next;
var init_next2 = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/next.js"() {
    init_import_meta_url();
    import_semver5 = __toESM(require_semver2(), 1);
    init_framework();
    Next = class extends BaseFramework {
      static {
        __name(this, "Next");
      }
      id = "next";
      name = "Next.js";
      category = Category.SSG;
      npmDependencies = ["next"];
      excludedNpmDependencies = ["@nrwl/next"];
      configFiles = ["next.config.js", "next.config.mjs", "next.config.ts"];
      dev = {
        command: "next",
        port: 3e3,
        pollingStrategies: [{ name: "TCP" }]
      };
      build = {
        command: "next build",
        directory: ".next"
      };
      logo = {
        default: "/logos/nextjs/light.svg",
        light: "/logos/nextjs/light.svg",
        dark: "/logos/nextjs/dark.svg"
      };
      async detect() {
        await super.detect();
        if (this.detected) {
          const nodeVersion2 = await this.project.getCurrentNodeVersion();
          if (nodeVersion2 && (0, import_semver5.gte)(nodeVersion2, "10.13.0") && !process.env.NETLIFY_NEXT_PLUGIN_SKIP) {
            this.plugins.push("@netlify/plugin-nextjs");
          }
          return this;
        }
      }
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/nuxt.js
var Nuxt2;
var init_nuxt2 = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/nuxt.js"() {
    init_import_meta_url();
    init_framework();
    Nuxt2 = class extends BaseFramework {
      static {
        __name(this, "Nuxt");
      }
      id = "nuxt";
      name = "Nuxt";
      npmDependencies = ["nuxt", "nuxt-edge", "nuxt3"];
      category = Category.SSG;
      dev = {
        command: "nuxt dev",
        port: 3e3,
        pollingStrategies: [{ name: "TCP" }],
        clearPublishDirectory: true
      };
      build = {
        command: "nuxt build",
        directory: "dist"
      };
      logo = {
        default: "/logos/nuxt/default.svg",
        light: "/logos/nuxt/light.svg",
        dark: "/logos/nuxt/dark.svg"
      };
      async detect() {
        await super.detect();
        if (this.detected) {
          if (this.detected.package?.version?.major !== void 0 && this.detected.package.version.major < 3) {
            this.build.command = "nuxt generate";
            this.dev.command = "nuxt";
          }
          return this;
        }
      }
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/observable.js
var Observable;
var init_observable = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/observable.js"() {
    init_import_meta_url();
    init_framework();
    Observable = class extends BaseFramework {
      static {
        __name(this, "Observable");
      }
      id = "observable";
      name = "Observable Framework";
      npmDependencies = ["@observablehq/framework"];
      category = Category.SSG;
      dev = {
        command: "observable preview",
        port: 3e3,
        pollingStrategies: [{ name: "TCP" }]
      };
      build = {
        command: "observable build",
        directory: "dist"
      };
      logo = {
        default: "/logos/observable/default.svg",
        light: "/logos/observable/default.svg",
        dark: "/logos/observable/default.svg"
      };
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/parcel.js
var Parcel;
var init_parcel = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/parcel.js"() {
    init_import_meta_url();
    init_framework();
    Parcel = class extends BaseFramework {
      static {
        __name(this, "Parcel");
      }
      id = "parcel";
      name = "Parcel";
      npmDependencies = ["parcel-bundler", "parcel"];
      category = Category.BuildTool;
      dev = {
        command: "parcel",
        port: 1234,
        pollingStrategies: [{ name: "TCP" }]
      };
      build = {
        command: "parcel build",
        directory: "dist"
      };
      logo = {
        default: "/logos/parcel/default.svg",
        light: "/logos/parcel/default.svg",
        dark: "/logos/parcel/default.svg"
      };
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/phenomic.js
var Phenomic;
var init_phenomic = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/phenomic.js"() {
    init_import_meta_url();
    init_framework();
    Phenomic = class extends BaseFramework {
      static {
        __name(this, "Phenomic");
      }
      id = "phenomic";
      name = "Phenomic";
      npmDependencies = ["@phenomic/core"];
      category = Category.SSG;
      dev = {
        command: "phenomic start",
        port: 3333,
        pollingStrategies: [{ name: "TCP" }]
      };
      build = {
        command: "phenomic build",
        directory: "public"
      };
      logo = {
        default: "/logos/phenomic/default.svg",
        light: "/logos/phenomic/default.svg",
        dark: "/logos/phenomic/default.svg"
      };
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/quasar.js
var Quasar;
var init_quasar = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/quasar.js"() {
    init_import_meta_url();
    init_framework();
    Quasar = class extends BaseFramework {
      static {
        __name(this, "Quasar");
      }
      id = "quasar";
      name = "Quasar";
      npmDependencies = ["@quasar/app", "quasar-cli"];
      category = Category.FrontendFramework;
      dev = {
        command: "quasar dev -p 8081",
        port: 8081,
        pollingStrategies: [{ name: "TCP" }]
      };
      build = {
        command: "quasar build",
        directory: "dist/spa"
      };
      logo = {
        default: "/logos/quasar/default.svg",
        light: "/logos/quasar/default.svg",
        dark: "/logos/quasar/default.svg"
      };
      async detect() {
        await super.detect();
        if (this.detected) {
          if (this.isV017(this.detected)) {
            this.name = "Quasar v0.17";
            this.build.directory = ".quasar";
            this.dev.command = "quasar dev -p 8080";
            this.dev.port = 8080;
          }
          return this;
        }
      }
      isV017(detected) {
        return detected.package?.name === "quasar-cli";
      }
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/qwik.js
var Qwik2;
var init_qwik2 = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/qwik.js"() {
    init_import_meta_url();
    init_framework();
    Qwik2 = class extends BaseFramework {
      static {
        __name(this, "Qwik");
      }
      id = "qwik";
      name = "Qwik";
      npmDependencies = ["@builder.io/qwik"];
      category = Category.SSG;
      dev = {
        command: "vite",
        port: 5173,
        pollingStrategies: [{ name: "TCP" }]
      };
      logo = {
        default: "/logos/qwik/default.svg",
        light: "/logos/qwik/default.svg",
        dark: "/logos/qwik/default.svg"
      };
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/react-router.js
var import_semver6, ReactRouter2;
var init_react_router2 = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/react-router.js"() {
    init_import_meta_url();
    import_semver6 = __toESM(require_semver2(), 1);
    init_framework();
    ReactRouter2 = class extends BaseFramework {
      static {
        __name(this, "ReactRouter");
      }
      id = "react-router";
      name = "React Router";
      // React Router 7+ can be used either as a library or as a framework. We want to ignore lib mode (and possibly let
      // other frameworks/bundlers/runners be detected). There isn't a perfect way to identify a site's mode, but at the
      // time of writing both `@react-router/dev` and `react-router.config` should only be present in framework mode.
      npmDependencies = ["@react-router/dev"];
      configFiles = ["react-router.config.ts", "react-router.config.js"];
      category = Category.SSG;
      dev = {
        port: 5173,
        command: "react-router dev"
      };
      build = {
        command: "react-router build",
        directory: "build/client"
      };
      logo = {
        default: "/logos/react-router/light.svg",
        light: "/logos/react-router/light.svg",
        dark: "/logos/react-router/dark.svg"
      };
      async detect() {
        await super.detect();
        if (this.detected) {
          if (this.version && (0, import_semver6.lt)(this.version, "7.0.0")) {
            return;
          }
          return this;
        }
      }
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/react-static.js
var ReactStatic;
var init_react_static = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/react-static.js"() {
    init_import_meta_url();
    init_framework();
    ReactStatic = class extends BaseFramework {
      static {
        __name(this, "ReactStatic");
      }
      id = "react-static";
      name = "React Static";
      npmDependencies = ["react-static"];
      configFiles = ["static.config.js"];
      category = Category.SSG;
      dev = {
        command: "react-static start",
        port: 3e3,
        pollingStrategies: [{ name: "TCP" }]
      };
      build = {
        command: "react-static build",
        directory: "dist"
      };
      logo = {
        default: "/logos/react-static/default.png",
        light: "/logos/react-static/default.png",
        dark: "/logos/react-static/default.png"
      };
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/react.js
var CreateReactApp;
var init_react = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/react.js"() {
    init_import_meta_url();
    init_framework();
    CreateReactApp = class extends BaseFramework {
      static {
        __name(this, "CreateReactApp");
      }
      id = "create-react-app";
      name = "Create React App";
      npmDependencies = ["react-scripts"];
      category = Category.FrontendFramework;
      staticAssetsDirectory = "public";
      dev = {
        command: "react-scripts start",
        port: 3e3,
        pollingStrategies: [{ name: "TCP" }]
      };
      build = {
        command: "react-scripts build",
        directory: "build"
      };
      logo = {
        default: "/logos/create-react-app/default.svg",
        light: "/logos/create-react-app/default.svg",
        dark: "/logos/create-react-app/default.svg"
      };
      env = { BROWSER: "none", PORT: "3000" };
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/redwoodjs.js
var RedwoodJS;
var init_redwoodjs = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/redwoodjs.js"() {
    init_import_meta_url();
    init_framework();
    RedwoodJS = class extends BaseFramework {
      static {
        __name(this, "RedwoodJS");
      }
      id = "redwoodjs";
      name = "RedwoodJS";
      npmDependencies = ["@redwoodjs/core"];
      configFiles = ["redwood.toml"];
      category = Category.SSG;
      staticAssetsDirectory = "public";
      dev = {
        // redwood only works with yarn
        // https://redwoodjs.com/docs/tutorial/chapter1/prerequisites#nodejs-and-yarn-versions
        command: "yarn rw dev",
        port: 8910,
        pollingStrategies: [{ name: "TCP" }]
      };
      build = {
        // explicitly not invoked with yarn: https://github.com/netlify/framework-info/commit/b3cd21d1e60d91facd397068f35b850b80d1ef13
        command: "rw deploy netlify",
        directory: "web/dist"
      };
      env = {
        AWS_LAMBDA_JS_RUNTIME: "nodejs20.x",
        NODE_VERSION: "20"
      };
      logo = {
        default: "/logos/redwoodjs/default.svg",
        light: "/logos/redwoodjs/default.svg",
        dark: "/logos/redwoodjs/default.svg"
      };
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/remix.js
var CLASSIC_COMPILER_CONFIG_FILES2, CLASSIC_COMPILER_DEV2, CLASSIC_COMPILER_BUILD2, VITE_CONFIG_FILES2, VITE_DEV2, VITE_BUILD2, Remix;
var init_remix = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/remix.js"() {
    init_import_meta_url();
    init_framework();
    CLASSIC_COMPILER_CONFIG_FILES2 = ["remix.config.js"];
    CLASSIC_COMPILER_DEV2 = {
      command: "remix watch"
    };
    CLASSIC_COMPILER_BUILD2 = {
      command: "remix build",
      directory: "public"
    };
    VITE_CONFIG_FILES2 = [
      "vite.config.js",
      "vite.config.mjs",
      "vite.config.cjs",
      "vite.config.ts",
      "vite.config.mts",
      "vite.config.cts"
    ];
    VITE_DEV2 = {
      command: "remix vite:dev",
      port: 5173
    };
    VITE_BUILD2 = {
      command: "remix vite:build",
      directory: "build/client"
    };
    Remix = class extends BaseFramework {
      static {
        __name(this, "Remix");
      }
      id = "remix";
      name = "Remix";
      npmDependencies = [
        "@remix-run/react",
        "@remix-run/dev",
        "@remix-run/server-runtime",
        "@netlify/remix-adapter",
        "@netlify/remix-edge-adapter",
        "@netlify/remix-runtime",
        // Deprecated package name (deprecated in 1.6, removed in 2.0)
        "remix",
        // Deprecated Netlify packages
        "@remix-run/netlify",
        "@remix-run/netlify-edge"
      ];
      excludedNpmDependencies = ["@shopify/hydrogen"];
      configFiles = [...VITE_CONFIG_FILES2, ...CLASSIC_COMPILER_CONFIG_FILES2];
      category = Category.SSG;
      logo = {
        default: "/logos/remix/default.svg",
        light: "/logos/remix/light.svg",
        dark: "/logos/remix/dark.svg"
      };
      async detect() {
        await super.detect();
        if (this.detected) {
          if (this.detected.configName && VITE_CONFIG_FILES2.includes(this.detected.configName)) {
            this.dev = VITE_DEV2;
            this.build = VITE_BUILD2;
            return this;
          } else {
            this.dev = CLASSIC_COMPILER_DEV2;
            this.build = CLASSIC_COMPILER_BUILD2;
            return this;
          }
        }
      }
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/roots.js
var Roots;
var init_roots = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/roots.js"() {
    init_import_meta_url();
    init_framework();
    Roots = class extends BaseFramework {
      static {
        __name(this, "Roots");
      }
      id = "roots";
      name = "Roots";
      npmDependencies = ["roots"];
      category = Category.SSG;
      dev = {
        command: "roots watch",
        port: 1111,
        pollingStrategies: [{ name: "TCP" }]
      };
      build = {
        command: "roots compile",
        directory: "public"
      };
      logo = {
        default: "/logos/roots/default.svg",
        light: "/logos/roots/default.svg",
        dark: "/logos/roots/default.svg"
      };
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/sapper.js
var Sapper;
var init_sapper = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/sapper.js"() {
    init_import_meta_url();
    init_framework();
    Sapper = class extends BaseFramework {
      static {
        __name(this, "Sapper");
      }
      id = "sapper";
      name = "Sapper";
      npmDependencies = ["sapper"];
      category = Category.FrontendFramework;
      staticAssetsDirectory = "static";
      dev = {
        command: "sapper dev",
        port: 3e3,
        pollingStrategies: [{ name: "TCP" }]
      };
      build = {
        command: "sapper export",
        directory: "__sapper__/export"
      };
      logo = {
        default: "/logos/sapper/default.svg",
        light: "/logos/sapper/default.svg",
        dark: "/logos/sapper/default.svg"
      };
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/solid-js.js
var SolidJs;
var init_solid_js = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/solid-js.js"() {
    init_import_meta_url();
    init_framework();
    SolidJs = class extends BaseFramework {
      static {
        __name(this, "SolidJs");
      }
      id = "solid-js";
      name = "SolidJS";
      npmDependencies = ["solid-js"];
      excludedNpmDependencies = ["solid-start", "@solidjs/start", "@tanstack/solid-start"];
      category = Category.SSG;
      dev = {
        command: "vite dev",
        port: 3e3,
        pollingStrategies: [{ name: "TCP" }]
      };
      build = {
        command: "vite build",
        directory: "dist"
      };
      logo = {
        default: "/logos/solid-js/default.svg",
        light: "/logos/solid-js/default.svg",
        dark: "/logos/solid-js/dark.svg"
      };
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/solid-start.js
var LEGACY_PACKAGE_NAME, LEGACY_DEV, LEGACY_BUILD, SolidStart2;
var init_solid_start2 = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/solid-start.js"() {
    init_import_meta_url();
    init_framework();
    LEGACY_PACKAGE_NAME = "solid-start";
    LEGACY_DEV = {
      command: "solid-start dev",
      port: 3e3
    };
    LEGACY_BUILD = {
      command: "solid-start build",
      directory: "netlify"
    };
    SolidStart2 = class extends BaseFramework {
      static {
        __name(this, "SolidStart");
      }
      id = "solid-start";
      name = "Solid Start";
      npmDependencies = [
        // Used this name up to 0.3.11
        "solid-start",
        // Renamed starting at 0.4.0
        "@solidjs/start"
      ];
      category = Category.SSG;
      dev = {
        command: "vinxi dev",
        port: 3e3
      };
      build = {
        command: "vinxi build",
        directory: "dist"
      };
      logo = {
        default: "/logos/solid-start/default.svg",
        light: "/logos/solid-start/default.svg",
        dark: "/logos/solid-start/dark.svg"
      };
      async detect() {
        await super.detect();
        if (this.detected) {
          if (this.detected.package?.name === LEGACY_PACKAGE_NAME) {
            this.dev = LEGACY_DEV;
            this.build = LEGACY_BUILD;
            return this;
          }
          return this;
        }
      }
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/stencil.js
var Stencil;
var init_stencil = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/stencil.js"() {
    init_import_meta_url();
    init_framework();
    Stencil = class extends BaseFramework {
      static {
        __name(this, "Stencil");
      }
      id = "stencil";
      name = "Stencil";
      npmDependencies = ["@stencil/core"];
      configFiles = ["stencil.config.ts"];
      category = Category.SSG;
      dev = {
        command: "stencil build --dev --watch --serve",
        port: 3333,
        pollingStrategies: [{ name: "TCP" }]
      };
      build = {
        command: "stencil build",
        directory: "www"
      };
      logo = {
        default: "/logos/stencil/light.svg",
        light: "/logos/stencil/light.svg",
        dark: "/logos/stencil/dark.svg"
      };
      env = {
        BROWSER: "none",
        PORT: "3000"
      };
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/svelte-kit.js
var SvelteKit2;
var init_svelte_kit = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/svelte-kit.js"() {
    init_import_meta_url();
    init_framework();
    SvelteKit2 = class extends BaseFramework {
      static {
        __name(this, "SvelteKit");
      }
      id = "svelte-kit";
      name = "SvelteKit";
      npmDependencies = ["@sveltejs/kit"];
      category = Category.FrontendFramework;
      staticAssetsDirectory = "static";
      dev = {
        command: "vite dev",
        port: 5173,
        pollingStrategies: [{ name: "TCP" }]
      };
      build = {
        command: "vite build",
        directory: "build"
      };
      logo = {
        default: "/logos/svelte-kit/default.svg",
        light: "/logos/svelte-kit/default.svg",
        dark: "/logos/svelte-kit/default.svg"
      };
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/svelte.js
var Svelte;
var init_svelte = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/svelte.js"() {
    init_import_meta_url();
    init_framework();
    Svelte = class extends BaseFramework {
      static {
        __name(this, "Svelte");
      }
      id = "svelte";
      name = "Svelte";
      npmDependencies = ["svelte"];
      excludedNpmDependencies = ["sapper", "@sveltejs/kit"];
      category = Category.FrontendFramework;
      staticAssetsDirectory = "static";
      dev = {
        command: "npm run dev",
        port: 5e3,
        pollingStrategies: [{ name: "TCP" }]
      };
      build = {
        command: "npm run build",
        directory: "public"
      };
      logo = {
        default: "/logos/svelte-kit/default.svg",
        light: "/logos/svelte-kit/default.svg",
        dark: "/logos/svelte-kit/default.svg"
      };
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/tanstack-router.js
var TanStackRouter;
var init_tanstack_router = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/tanstack-router.js"() {
    init_import_meta_url();
    init_framework();
    TanStackRouter = class extends BaseFramework {
      static {
        __name(this, "TanStackRouter");
      }
      id = "tanstack-router";
      name = "TanStack Router";
      npmDependencies = ["@tanstack/react-router"];
      excludedNpmDependencies = ["@tanstack/start", "@tanstack/react-start", "@tanstack/solid-start"];
      category = Category.SSG;
      dev = {
        command: "vite dev",
        port: 3e3,
        pollingStrategies: [{ name: "TCP" }]
      };
      build = {
        command: "vite build",
        directory: "dist"
      };
      logo = {
        default: "/logos/tanstack-router/default.png",
        light: "/logos/tanstack-router/default.png",
        dark: "/logos/tanstack-router/default.png"
      };
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/tanstack-start.js
var import_semver7, TanStackStart;
var init_tanstack_start = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/tanstack-start.js"() {
    init_import_meta_url();
    import_semver7 = __toESM(require_semver2(), 1);
    init_framework();
    TanStackStart = class extends BaseFramework {
      static {
        __name(this, "TanStackStart");
      }
      id = "tanstack-start";
      name = "TanStack Start";
      npmDependencies = [
        // This was the package name until it became `@tanstack/react-start` in v1.111.0
        "@tanstack/start",
        "@tanstack/react-start",
        "@tanstack/solid-start"
      ];
      category = Category.SSG;
      dev = {
        command: "vite dev",
        port: 3e3,
        pollingStrategies: [{ name: "TCP" }]
      };
      build = {
        command: "vite build",
        directory: "dist/client"
      };
      logo = {
        default: "/logos/tanstack-start/default.png",
        light: "/logos/tanstack-start/default.png",
        dark: "/logos/tanstack-start/default.png"
      };
      async detect() {
        await super.detect();
        if (this.detected) {
          if (this.version && (0, import_semver7.lt)(this.version, "1.121.0")) {
            this.dev.command = "vinxi dev";
            this.build.command = "vinxi build";
          }
          if (this.version && (0, import_semver7.lt)(this.version, "1.132.0")) {
            this.build.directory = "dist";
          }
          return this;
        }
      }
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/vike.js
var Vike2;
var init_vike2 = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/vike.js"() {
    init_import_meta_url();
    init_framework();
    Vike2 = class extends BaseFramework {
      static {
        __name(this, "Vike");
      }
      id = "vike";
      name = "Vike";
      npmDependencies = ["vike"];
      category = Category.SSG;
      dev = {
        command: "vike dev",
        port: 3e3
      };
      build = {
        command: "vike build",
        directory: "dist/client"
      };
      logo = {
        default: "/logos/vike/light.svg",
        light: "/logos/vite/light.svg",
        dark: "/logos/vite/dark.svg"
      };
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/vite.js
var Vite2;
var init_vite2 = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/vite.js"() {
    init_import_meta_url();
    init_framework();
    Vite2 = class extends BaseFramework {
      static {
        __name(this, "Vite");
      }
      id = "vite";
      name = "Vite";
      npmDependencies = ["vite"];
      excludedNpmDependencies = [
        "@remix-run/react",
        "@remix-run/dev",
        "@remix-run/server-runtime",
        "@shopify/hydrogen",
        "@builder.io/qwik",
        // Used this name up to 0.3.11
        "solid-start",
        // Renamed starting at 0.4.0
        "@solidjs/start",
        "solid-js",
        "@tanstack/react-router",
        "@tanstack/start",
        "@sveltejs/kit",
        "@analogjs/platform",
        "@react-router/dev",
        "vike"
      ];
      category = Category.BuildTool;
      dev = {
        command: "vite",
        port: 5173,
        pollingStrategies: [{ name: "TCP" }]
      };
      build = {
        command: "vite build",
        directory: "dist"
      };
      logo = {
        default: "/logos/vite/default.svg",
        light: "/logos/vite/default.svg",
        dark: "/logos/vite/default.svg"
      };
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/vue.js
var Vue;
var init_vue = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/vue.js"() {
    init_import_meta_url();
    init_framework();
    Vue = class extends BaseFramework {
      static {
        __name(this, "Vue");
      }
      id = "vue";
      name = "Vue.js";
      npmDependencies = ["@vue/cli-service"];
      category = Category.FrontendFramework;
      dev = {
        command: "vue-cli-service serve",
        port: 8080,
        pollingStrategies: [{ name: "TCP" }]
      };
      build = {
        command: "vue-cli-service build",
        directory: "dist"
      };
      logo = {
        default: "/logos/vue/default.svg",
        light: "/logos/vue/default.svg",
        dark: "/logos/vue/default.svg"
      };
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/vuepress.js
var VuePress;
var init_vuepress = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/vuepress.js"() {
    init_import_meta_url();
    init_framework();
    VuePress = class extends BaseFramework {
      static {
        __name(this, "VuePress");
      }
      id = "vuepress";
      name = "VuePress";
      npmDependencies = ["vuepress"];
      category = Category.SSG;
      dev = {
        command: "vuepress dev",
        port: 8080,
        pollingStrategies: [{ name: "TCP" }]
      };
      build = {
        command: "vuepress build",
        directory: ".vuepress/dist"
      };
      logo = {
        default: "/logos/vuepress/default.svg",
        light: "/logos/vuepress/default.svg",
        dark: "/logos/vuepress/default.svg"
      };
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/waku.js
var Waku2;
var init_waku2 = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/waku.js"() {
    init_import_meta_url();
    init_framework();
    Waku2 = class extends BaseFramework {
      static {
        __name(this, "Waku");
      }
      id = "waku";
      name = "Waku";
      npmDependencies = ["waku"];
      configFiles = ["waku.config.ts", "waku.config.js"];
      category = Category.SSG;
      dev = {
        command: "waku dev",
        port: 3e3
      };
      build = {
        command: "waku build",
        directory: "dist/public"
      };
      logo = {
        default: "/logos/waku/light.svg",
        light: "/logos/waku/light.svg",
        dark: "/logos/waku/dark.svg"
      };
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/wintersmith.js
var Wintersmith;
var init_wintersmith = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/wintersmith.js"() {
    init_import_meta_url();
    init_framework();
    Wintersmith = class extends BaseFramework {
      static {
        __name(this, "Wintersmith");
      }
      id = "wintersmith";
      name = "Wintersmith";
      npmDependencies = ["wintersmith"];
      configFiles = ["config.json"];
      category = Category.SSG;
      dev = {
        command: "wintersmith preview",
        port: 8080,
        pollingStrategies: [{ name: "TCP" }]
      };
      build = {
        command: "wintersmith build",
        directory: "build"
      };
      logo = {
        default: "/logos/wintersmith/default.svg",
        light: "/logos/wintersmith/default.svg",
        dark: "/logos/wintersmith/default.svg"
      };
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/wmr.js
var WMR;
var init_wmr = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/wmr.js"() {
    init_import_meta_url();
    init_framework();
    WMR = class extends BaseFramework {
      static {
        __name(this, "WMR");
      }
      id = "wmr";
      name = "WMR";
      npmDependencies = ["wmr"];
      category = Category.BuildTool;
      dev = {
        command: "wmr",
        port: 8080,
        pollingStrategies: [{ name: "TCP" }]
      };
      build = {
        command: "wmr build",
        directory: "dist"
      };
      logo = {
        default: "/logos/wmr/default.svg",
        light: "/logos/wmr/default.svg",
        dark: "/logos/wmr/default.svg"
      };
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/zola.js
var Zola;
var init_zola = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/zola.js"() {
    init_import_meta_url();
    init_framework();
    Zola = class extends BaseFramework {
      static {
        __name(this, "Zola");
      }
      id = "zola";
      name = "Zola";
      configFiles = ["config.toml"];
      category = Category.SSG;
      dev = {
        command: "zola serve",
        port: 1111,
        pollingStrategies: [{ name: "TCP" }]
      };
      build = {
        command: "zola build",
        directory: "public"
      };
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/index.js
var frameworks;
var init_frameworks2 = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/frameworks/index.js"() {
    init_import_meta_url();
    init_analog2();
    init_angular2();
    init_assemble();
    init_astro2();
    init_blitz();
    init_brunch();
    init_cecil();
    init_docpad();
    init_docusaurus();
    init_eleventy();
    init_ember();
    init_expo();
    init_gatsby();
    init_gridsome();
    init_grunt();
    init_gulp();
    init_harp();
    init_hexo();
    init_hono2();
    init_hugo();
    init_hydrogen();
    init_jekyll();
    init_metalsmith();
    init_middleman();
    init_next2();
    init_nuxt2();
    init_observable();
    init_parcel();
    init_phenomic();
    init_quasar();
    init_qwik2();
    init_react_router2();
    init_react_static();
    init_react();
    init_redwoodjs();
    init_remix();
    init_roots();
    init_sapper();
    init_solid_js();
    init_solid_start2();
    init_stencil();
    init_svelte_kit();
    init_svelte();
    init_tanstack_router();
    init_tanstack_start();
    init_vike2();
    init_vite2();
    init_vue();
    init_vuepress();
    init_waku2();
    init_wintersmith();
    init_wmr();
    init_zola();
    frameworks = [
      // Static site generators / meta frameworks
      Astro2,
      Docusaurus,
      Eleventy,
      Gatsby,
      Gridsome,
      Hexo,
      Hugo,
      Hydrogen,
      Jekyll,
      Middleman,
      Next,
      Blitz,
      Nuxt2,
      Phenomic,
      Qwik2,
      ReactRouter2,
      ReactStatic,
      RedwoodJS,
      Remix,
      SolidJs,
      SolidStart2,
      Stencil,
      TanStackRouter,
      TanStackStart,
      VuePress,
      Assemble,
      DocPad,
      Harp,
      Metalsmith,
      Roots,
      Wintersmith,
      Cecil,
      Zola,
      Observable,
      Analog2,
      Vike2,
      Waku2,
      // Back-end frameworks
      Hono2,
      // Front-end frameworks
      Angular2,
      CreateReactApp,
      Ember,
      Expo,
      Quasar,
      Sapper,
      Svelte,
      SvelteKit2,
      Vue,
      // Build tools
      Brunch,
      Parcel,
      Gulp,
      Grunt,
      Vite2,
      WMR
    ];
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/get-framework.js
async function getFramework(frameworkId, project) {
  const frameworkList = frameworks.map((Framework2) => new Framework2(project));
  const framework = frameworkList.find(({ id }) => id === frameworkId);
  if (framework) {
    framework.detected = { accuracy: Accuracy.Forced };
    const detected = await framework.detect();
    if (detected) {
      return detected;
    }
    throw new Error(`Forced framework "${frameworkId}" was not detected.`);
  }
  const frameworkIds = frameworkList.map(({ id }) => id).sort().join(", ");
  throw new Error(`Invalid framework "${frameworkId}". It should be one of: ${frameworkIds}`);
}
var init_get_framework = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/get-framework.js"() {
    init_import_meta_url();
    init_framework();
    init_frameworks2();
    __name(getFramework, "getFramework");
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/build-systems/build-system.js
var BaseBuildTool;
var init_build_system = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/build-systems/build-system.js"() {
    init_import_meta_url();
    BaseBuildTool = class {
      static {
        __name(this, "BaseBuildTool");
      }
      project;
      id;
      name;
      version;
      configFiles = [];
      /** If the command should be executed from the repository root */
      runFromRoot;
      logo;
      constructor(project) {
        this.project = project;
      }
      async detect() {
        const config = await this.project.fs.findUp(this.configFiles, {
          cwd: this.project.baseDirectory,
          stopAt: this.project.root
        });
        if (config) {
          const pkgJson = await this.project.getPackageJSON(this.project.fs.dirname(config));
          this.version = pkgJson.devDependencies?.[this.id];
          return this;
        }
      }
      /** Gets a JSON from the class information */
      toJSON() {
        return {
          id: this.id,
          name: this.name,
          version: this.version,
          logo: this.logo ? Object.entries(this.logo).reduce((prev, [key, value]) => ({ ...prev, [key]: `https://framework-info.netlify.app${value}` }), {}) : void 0
        };
      }
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/build-systems/bazel.js
var Bazel;
var init_bazel = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/build-systems/bazel.js"() {
    init_import_meta_url();
    init_build_system();
    Bazel = class extends BaseBuildTool {
      static {
        __name(this, "Bazel");
      }
      id = "bazel";
      name = "Bazel";
      configFiles = [".bazelrc", "WORKSPACE", "WORKSPACE.bazel", "BUILD.bazel"];
      async detect() {
        const config = await this.project.fs.findUp(this.configFiles, {
          cwd: this.project.baseDirectory,
          stopAt: this.project.root
        });
        if (config) {
          return this;
        }
      }
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/build-systems/buck.js
var Buck;
var init_buck = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/build-systems/buck.js"() {
    init_import_meta_url();
    init_build_system();
    Buck = class extends BaseBuildTool {
      static {
        __name(this, "Buck");
      }
      id = "buck";
      name = "Buck";
      configFiles = [".buckconfig", "BUCK"];
      async detect() {
        const config = await this.project.fs.findUp(this.configFiles, {
          cwd: this.project.baseDirectory,
          stopAt: this.project.root
        });
        if (config) {
          return this;
        }
      }
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/build-systems/gradle.js
var Gradle;
var init_gradle = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/build-systems/gradle.js"() {
    init_import_meta_url();
    init_build_system();
    Gradle = class extends BaseBuildTool {
      static {
        __name(this, "Gradle");
      }
      id = "gradle";
      name = "Gradle";
      configFiles = ["build.gradle"];
      async detect() {
        const config = await this.project.fs.findUp(this.configFiles, {
          cwd: this.project.baseDirectory,
          stopAt: this.project.root
        });
        if (config) {
          return this;
        }
      }
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/build-systems/lage.js
var Lage;
var init_lage = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/build-systems/lage.js"() {
    init_import_meta_url();
    init_build_system();
    Lage = class extends BaseBuildTool {
      static {
        __name(this, "Lage");
      }
      id = "lage";
      name = "Lage";
      configFiles = ["lage.config.js"];
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/build-systems/lerna.js
var Lerna;
var init_lerna = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/build-systems/lerna.js"() {
    init_import_meta_url();
    init_build_system();
    Lerna = class extends BaseBuildTool {
      static {
        __name(this, "Lerna");
      }
      id = "lerna";
      name = "Lerna";
      configFiles = ["lerna.json"];
      logo = {
        default: "/logos/lerna/light.svg",
        light: "/logos/lerna/light.svg",
        dark: "/logos/lerna/dark.svg"
      };
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/build-systems/moon.js
var Moon;
var init_moon = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/build-systems/moon.js"() {
    init_import_meta_url();
    init_build_system();
    Moon = class extends BaseBuildTool {
      static {
        __name(this, "Moon");
      }
      id = "moon";
      name = "MoonRepo";
      configFiles = [".moon"];
      async detect() {
        const config = await this.project.fs.findUp(this.configFiles, {
          cwd: this.project.baseDirectory,
          type: "directory",
          stopAt: this.project.root
        });
        if (config) {
          const pkgJson = await this.project.getPackageJSON(config);
          this.version = pkgJson.devDependencies?.[this.id];
          return this;
        }
      }
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/build-systems/nix.js
var Nix;
var init_nix = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/build-systems/nix.js"() {
    init_import_meta_url();
    init_build_system();
    Nix = class extends BaseBuildTool {
      static {
        __name(this, "Nix");
      }
      id = "nix";
      name = "Nix";
      configFiles = ["default.nix", "shell.nix", "release.nix"];
      async detect() {
        const config = await this.project.fs.findUp(this.configFiles, {
          cwd: this.project.baseDirectory,
          stopAt: this.project.root
        });
        if (config) {
          return this;
        }
      }
    };
  }
});

// ../../node_modules/.pnpm/balanced-match@1.0.2/node_modules/balanced-match/index.js
var require_balanced_match = __commonJS({
  "../../node_modules/.pnpm/balanced-match@1.0.2/node_modules/balanced-match/index.js"(exports, module2) {
    init_import_meta_url();
    module2.exports = balanced;
    function balanced(a7, b11, str) {
      if (a7 instanceof RegExp) a7 = maybeMatch(a7, str);
      if (b11 instanceof RegExp) b11 = maybeMatch(b11, str);
      var r10 = range(a7, b11, str);
      return r10 && {
        start: r10[0],
        end: r10[1],
        pre: str.slice(0, r10[0]),
        body: str.slice(r10[0] + a7.length, r10[1]),
        post: str.slice(r10[1] + b11.length)
      };
    }
    __name(balanced, "balanced");
    function maybeMatch(reg, str) {
      var m7 = str.match(reg);
      return m7 ? m7[0] : null;
    }
    __name(maybeMatch, "maybeMatch");
    balanced.range = range;
    function range(a7, b11, str) {
      var begs, beg, left2, right2, result;
      var ai2 = str.indexOf(a7);
      var bi2 = str.indexOf(b11, ai2 + 1);
      var i7 = ai2;
      if (ai2 >= 0 && bi2 > 0) {
        if (a7 === b11) {
          return [ai2, bi2];
        }
        begs = [];
        left2 = str.length;
        while (i7 >= 0 && !result) {
          if (i7 == ai2) {
            begs.push(i7);
            ai2 = str.indexOf(a7, i7 + 1);
          } else if (begs.length == 1) {
            result = [begs.pop(), bi2];
          } else {
            beg = begs.pop();
            if (beg < left2) {
              left2 = beg;
              right2 = bi2;
            }
            bi2 = str.indexOf(b11, i7 + 1);
          }
          i7 = ai2 < bi2 && ai2 >= 0 ? ai2 : bi2;
        }
        if (begs.length) {
          result = [left2, right2];
        }
      }
      return result;
    }
    __name(range, "range");
  }
});

// ../../node_modules/.pnpm/brace-expansion@2.0.1/node_modules/brace-expansion/index.js
var require_brace_expansion = __commonJS({
  "../../node_modules/.pnpm/brace-expansion@2.0.1/node_modules/brace-expansion/index.js"(exports, module2) {
    init_import_meta_url();
    var balanced = require_balanced_match();
    module2.exports = expandTop;
    var escSlash = "\0SLASH" + Math.random() + "\0";
    var escOpen = "\0OPEN" + Math.random() + "\0";
    var escClose = "\0CLOSE" + Math.random() + "\0";
    var escComma = "\0COMMA" + Math.random() + "\0";
    var escPeriod = "\0PERIOD" + Math.random() + "\0";
    function numeric(str) {
      return parseInt(str, 10) == str ? parseInt(str, 10) : str.charCodeAt(0);
    }
    __name(numeric, "numeric");
    function escapeBraces(str) {
      return str.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod);
    }
    __name(escapeBraces, "escapeBraces");
    function unescapeBraces(str) {
      return str.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join(".");
    }
    __name(unescapeBraces, "unescapeBraces");
    function parseCommaParts(str) {
      if (!str)
        return [""];
      var parts = [];
      var m7 = balanced("{", "}", str);
      if (!m7)
        return str.split(",");
      var pre = m7.pre;
      var body = m7.body;
      var post = m7.post;
      var p7 = pre.split(",");
      p7[p7.length - 1] += "{" + body + "}";
      var postParts = parseCommaParts(post);
      if (post.length) {
        p7[p7.length - 1] += postParts.shift();
        p7.push.apply(p7, postParts);
      }
      parts.push.apply(parts, p7);
      return parts;
    }
    __name(parseCommaParts, "parseCommaParts");
    function expandTop(str) {
      if (!str)
        return [];
      if (str.substr(0, 2) === "{}") {
        str = "\\{\\}" + str.substr(2);
      }
      return expand2(escapeBraces(str), true).map(unescapeBraces);
    }
    __name(expandTop, "expandTop");
    function embrace(str) {
      return "{" + str + "}";
    }
    __name(embrace, "embrace");
    function isPadded(el) {
      return /^-?0\d/.test(el);
    }
    __name(isPadded, "isPadded");
    function lte(i7, y5) {
      return i7 <= y5;
    }
    __name(lte, "lte");
    function gte4(i7, y5) {
      return i7 >= y5;
    }
    __name(gte4, "gte");
    function expand2(str, isTop) {
      var expansions = [];
      var m7 = balanced("{", "}", str);
      if (!m7) return [str];
      var pre = m7.pre;
      var post = m7.post.length ? expand2(m7.post, false) : [""];
      if (/\$$/.test(m7.pre)) {
        for (var k7 = 0; k7 < post.length; k7++) {
          var expansion = pre + "{" + m7.body + "}" + post[k7];
          expansions.push(expansion);
        }
      } else {
        var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m7.body);
        var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m7.body);
        var isSequence = isNumericSequence || isAlphaSequence;
        var isOptions = m7.body.indexOf(",") >= 0;
        if (!isSequence && !isOptions) {
          if (m7.post.match(/,.*\}/)) {
            str = m7.pre + "{" + m7.body + escClose + m7.post;
            return expand2(str);
          }
          return [str];
        }
        var n9;
        if (isSequence) {
          n9 = m7.body.split(/\.\./);
        } else {
          n9 = parseCommaParts(m7.body);
          if (n9.length === 1) {
            n9 = expand2(n9[0], false).map(embrace);
            if (n9.length === 1) {
              return post.map(function(p7) {
                return m7.pre + n9[0] + p7;
              });
            }
          }
        }
        var N4;
        if (isSequence) {
          var x7 = numeric(n9[0]);
          var y5 = numeric(n9[1]);
          var width = Math.max(n9[0].length, n9[1].length);
          var incr = n9.length == 3 ? Math.abs(numeric(n9[2])) : 1;
          var test = lte;
          var reverse = y5 < x7;
          if (reverse) {
            incr *= -1;
            test = gte4;
          }
          var pad2 = n9.some(isPadded);
          N4 = [];
          for (var i7 = x7; test(i7, y5); i7 += incr) {
            var c8;
            if (isAlphaSequence) {
              c8 = String.fromCharCode(i7);
              if (c8 === "\\")
                c8 = "";
            } else {
              c8 = String(i7);
              if (pad2) {
                var need = width - c8.length;
                if (need > 0) {
                  var z7 = new Array(need + 1).join("0");
                  if (i7 < 0)
                    c8 = "-" + z7 + c8.slice(1);
                  else
                    c8 = z7 + c8;
                }
              }
            }
            N4.push(c8);
          }
        } else {
          N4 = [];
          for (var j7 = 0; j7 < n9.length; j7++) {
            N4.push.apply(N4, expand2(n9[j7], false));
          }
        }
        for (var j7 = 0; j7 < N4.length; j7++) {
          for (var k7 = 0; k7 < post.length; k7++) {
            var expansion = pre + N4[j7] + post[k7];
            if (!isTop || isSequence || expansion)
              expansions.push(expansion);
          }
        }
      }
      return expansions;
    }
    __name(expand2, "expand");
  }
});

// ../../node_modules/.pnpm/minimatch@9.0.5/node_modules/minimatch/dist/esm/assert-valid-pattern.js
var MAX_PATTERN_LENGTH, assertValidPattern;
var init_assert_valid_pattern = __esm({
  "../../node_modules/.pnpm/minimatch@9.0.5/node_modules/minimatch/dist/esm/assert-valid-pattern.js"() {
    init_import_meta_url();
    MAX_PATTERN_LENGTH = 1024 * 64;
    assertValidPattern = /* @__PURE__ */ __name((pattern) => {
      if (typeof pattern !== "string") {
        throw new TypeError("invalid pattern");
      }
      if (pattern.length > MAX_PATTERN_LENGTH) {
        throw new TypeError("pattern is too long");
      }
    }, "assertValidPattern");
  }
});

// ../../node_modules/.pnpm/minimatch@9.0.5/node_modules/minimatch/dist/esm/brace-expressions.js
var posixClasses, braceEscape, regexpEscape, rangesToString, parseClass;
var init_brace_expressions = __esm({
  "../../node_modules/.pnpm/minimatch@9.0.5/node_modules/minimatch/dist/esm/brace-expressions.js"() {
    init_import_meta_url();
    posixClasses = {
      "[:alnum:]": ["\\p{L}\\p{Nl}\\p{Nd}", true],
      "[:alpha:]": ["\\p{L}\\p{Nl}", true],
      "[:ascii:]": ["\\x00-\\x7f", false],
      "[:blank:]": ["\\p{Zs}\\t", true],
      "[:cntrl:]": ["\\p{Cc}", true],
      "[:digit:]": ["\\p{Nd}", true],
      "[:graph:]": ["\\p{Z}\\p{C}", true, true],
      "[:lower:]": ["\\p{Ll}", true],
      "[:print:]": ["\\p{C}", true],
      "[:punct:]": ["\\p{P}", true],
      "[:space:]": ["\\p{Z}\\t\\r\\n\\v\\f", true],
      "[:upper:]": ["\\p{Lu}", true],
      "[:word:]": ["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}", true],
      "[:xdigit:]": ["A-Fa-f0-9", false]
    };
    braceEscape = /* @__PURE__ */ __name((s7) => s7.replace(/[[\]\\-]/g, "\\$&"), "braceEscape");
    regexpEscape = /* @__PURE__ */ __name((s7) => s7.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), "regexpEscape");
    rangesToString = /* @__PURE__ */ __name((ranges) => ranges.join(""), "rangesToString");
    parseClass = /* @__PURE__ */ __name((glob, position) => {
      const pos = position;
      if (glob.charAt(pos) !== "[") {
        throw new Error("not in a brace expression");
      }
      const ranges = [];
      const negs = [];
      let i7 = pos + 1;
      let sawStart = false;
      let uflag = false;
      let escaping = false;
      let negate3 = false;
      let endPos = pos;
      let rangeStart = "";
      WHILE: while (i7 < glob.length) {
        const c8 = glob.charAt(i7);
        if ((c8 === "!" || c8 === "^") && i7 === pos + 1) {
          negate3 = true;
          i7++;
          continue;
        }
        if (c8 === "]" && sawStart && !escaping) {
          endPos = i7 + 1;
          break;
        }
        sawStart = true;
        if (c8 === "\\") {
          if (!escaping) {
            escaping = true;
            i7++;
            continue;
          }
        }
        if (c8 === "[" && !escaping) {
          for (const [cls, [unip, u7, neg]] of Object.entries(posixClasses)) {
            if (glob.startsWith(cls, i7)) {
              if (rangeStart) {
                return ["$.", false, glob.length - pos, true];
              }
              i7 += cls.length;
              if (neg)
                negs.push(unip);
              else
                ranges.push(unip);
              uflag = uflag || u7;
              continue WHILE;
            }
          }
        }
        escaping = false;
        if (rangeStart) {
          if (c8 > rangeStart) {
            ranges.push(braceEscape(rangeStart) + "-" + braceEscape(c8));
          } else if (c8 === rangeStart) {
            ranges.push(braceEscape(c8));
          }
          rangeStart = "";
          i7++;
          continue;
        }
        if (glob.startsWith("-]", i7 + 1)) {
          ranges.push(braceEscape(c8 + "-"));
          i7 += 2;
          continue;
        }
        if (glob.startsWith("-", i7 + 1)) {
          rangeStart = c8;
          i7 += 2;
          continue;
        }
        ranges.push(braceEscape(c8));
        i7++;
      }
      if (endPos < i7) {
        return ["", false, 0, false];
      }
      if (!ranges.length && !negs.length) {
        return ["$.", false, glob.length - pos, true];
      }
      if (negs.length === 0 && ranges.length === 1 && /^\\?.$/.test(ranges[0]) && !negate3) {
        const r10 = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0];
        return [regexpEscape(r10), false, endPos - pos, false];
      }
      const sranges = "[" + (negate3 ? "^" : "") + rangesToString(ranges) + "]";
      const snegs = "[" + (negate3 ? "" : "^") + rangesToString(negs) + "]";
      const comb = ranges.length && negs.length ? "(" + sranges + "|" + snegs + ")" : ranges.length ? sranges : snegs;
      return [comb, uflag, endPos - pos, true];
    }, "parseClass");
  }
});

// ../../node_modules/.pnpm/minimatch@9.0.5/node_modules/minimatch/dist/esm/unescape.js
var unescape2;
var init_unescape = __esm({
  "../../node_modules/.pnpm/minimatch@9.0.5/node_modules/minimatch/dist/esm/unescape.js"() {
    init_import_meta_url();
    unescape2 = /* @__PURE__ */ __name((s7, { windowsPathsNoEscape = false } = {}) => {
      return windowsPathsNoEscape ? s7.replace(/\[([^\/\\])\]/g, "$1") : s7.replace(/((?!\\).|^)\[([^\/\\])\]/g, "$1$2").replace(/\\([^\/])/g, "$1");
    }, "unescape");
  }
});

// ../../node_modules/.pnpm/minimatch@9.0.5/node_modules/minimatch/dist/esm/ast.js
var types12, isExtglobType, startNoTraversal, startNoDot, addPatternStart, justDots, reSpecials, regExpEscape, qmark, star, starNoEmpty, AST;
var init_ast = __esm({
  "../../node_modules/.pnpm/minimatch@9.0.5/node_modules/minimatch/dist/esm/ast.js"() {
    init_import_meta_url();
    init_brace_expressions();
    init_unescape();
    types12 = /* @__PURE__ */ new Set(["!", "?", "+", "*", "@"]);
    isExtglobType = /* @__PURE__ */ __name((c8) => types12.has(c8), "isExtglobType");
    startNoTraversal = "(?!(?:^|/)\\.\\.?(?:$|/))";
    startNoDot = "(?!\\.)";
    addPatternStart = /* @__PURE__ */ new Set(["[", "."]);
    justDots = /* @__PURE__ */ new Set(["..", "."]);
    reSpecials = new Set("().*{}+?[]^$\\!");
    regExpEscape = /* @__PURE__ */ __name((s7) => s7.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), "regExpEscape");
    qmark = "[^/]";
    star = qmark + "*?";
    starNoEmpty = qmark + "+?";
    AST = class _AST {
      static {
        __name(this, "AST");
      }
      type;
      #root;
      #hasMagic;
      #uflag = false;
      #parts = [];
      #parent;
      #parentIndex;
      #negs;
      #filledNegs = false;
      #options;
      #toString;
      // set to true if it's an extglob with no children
      // (which really means one child of '')
      #emptyExt = false;
      constructor(type, parent, options = {}) {
        this.type = type;
        if (type)
          this.#hasMagic = true;
        this.#parent = parent;
        this.#root = this.#parent ? this.#parent.#root : this;
        this.#options = this.#root === this ? options : this.#root.#options;
        this.#negs = this.#root === this ? [] : this.#root.#negs;
        if (type === "!" && !this.#root.#filledNegs)
          this.#negs.push(this);
        this.#parentIndex = this.#parent ? this.#parent.#parts.length : 0;
      }
      get hasMagic() {
        if (this.#hasMagic !== void 0)
          return this.#hasMagic;
        for (const p7 of this.#parts) {
          if (typeof p7 === "string")
            continue;
          if (p7.type || p7.hasMagic)
            return this.#hasMagic = true;
        }
        return this.#hasMagic;
      }
      // reconstructs the pattern
      toString() {
        if (this.#toString !== void 0)
          return this.#toString;
        if (!this.type) {
          return this.#toString = this.#parts.map((p7) => String(p7)).join("");
        } else {
          return this.#toString = this.type + "(" + this.#parts.map((p7) => String(p7)).join("|") + ")";
        }
      }
      #fillNegs() {
        if (this !== this.#root)
          throw new Error("should only call on root");
        if (this.#filledNegs)
          return this;
        this.toString();
        this.#filledNegs = true;
        let n9;
        while (n9 = this.#negs.pop()) {
          if (n9.type !== "!")
            continue;
          let p7 = n9;
          let pp = p7.#parent;
          while (pp) {
            for (let i7 = p7.#parentIndex + 1; !pp.type && i7 < pp.#parts.length; i7++) {
              for (const part of n9.#parts) {
                if (typeof part === "string") {
                  throw new Error("string part in extglob AST??");
                }
                part.copyIn(pp.#parts[i7]);
              }
            }
            p7 = pp;
            pp = p7.#parent;
          }
        }
        return this;
      }
      push(...parts) {
        for (const p7 of parts) {
          if (p7 === "")
            continue;
          if (typeof p7 !== "string" && !(p7 instanceof _AST && p7.#parent === this)) {
            throw new Error("invalid part: " + p7);
          }
          this.#parts.push(p7);
        }
      }
      toJSON() {
        const ret = this.type === null ? this.#parts.slice().map((p7) => typeof p7 === "string" ? p7 : p7.toJSON()) : [this.type, ...this.#parts.map((p7) => p7.toJSON())];
        if (this.isStart() && !this.type)
          ret.unshift([]);
        if (this.isEnd() && (this === this.#root || this.#root.#filledNegs && this.#parent?.type === "!")) {
          ret.push({});
        }
        return ret;
      }
      isStart() {
        if (this.#root === this)
          return true;
        if (!this.#parent?.isStart())
          return false;
        if (this.#parentIndex === 0)
          return true;
        const p7 = this.#parent;
        for (let i7 = 0; i7 < this.#parentIndex; i7++) {
          const pp = p7.#parts[i7];
          if (!(pp instanceof _AST && pp.type === "!")) {
            return false;
          }
        }
        return true;
      }
      isEnd() {
        if (this.#root === this)
          return true;
        if (this.#parent?.type === "!")
          return true;
        if (!this.#parent?.isEnd())
          return false;
        if (!this.type)
          return this.#parent?.isEnd();
        const pl2 = this.#parent ? this.#parent.#parts.length : 0;
        return this.#parentIndex === pl2 - 1;
      }
      copyIn(part) {
        if (typeof part === "string")
          this.push(part);
        else
          this.push(part.clone(this));
      }
      clone(parent) {
        const c8 = new _AST(this.type, parent);
        for (const p7 of this.#parts) {
          c8.copyIn(p7);
        }
        return c8;
      }
      static #parseAST(str, ast, pos, opt) {
        let escaping = false;
        let inBrace = false;
        let braceStart = -1;
        let braceNeg = false;
        if (ast.type === null) {
          let i8 = pos;
          let acc2 = "";
          while (i8 < str.length) {
            const c8 = str.charAt(i8++);
            if (escaping || c8 === "\\") {
              escaping = !escaping;
              acc2 += c8;
              continue;
            }
            if (inBrace) {
              if (i8 === braceStart + 1) {
                if (c8 === "^" || c8 === "!") {
                  braceNeg = true;
                }
              } else if (c8 === "]" && !(i8 === braceStart + 2 && braceNeg)) {
                inBrace = false;
              }
              acc2 += c8;
              continue;
            } else if (c8 === "[") {
              inBrace = true;
              braceStart = i8;
              braceNeg = false;
              acc2 += c8;
              continue;
            }
            if (!opt.noext && isExtglobType(c8) && str.charAt(i8) === "(") {
              ast.push(acc2);
              acc2 = "";
              const ext2 = new _AST(c8, ast);
              i8 = _AST.#parseAST(str, ext2, i8, opt);
              ast.push(ext2);
              continue;
            }
            acc2 += c8;
          }
          ast.push(acc2);
          return i8;
        }
        let i7 = pos + 1;
        let part = new _AST(null, ast);
        const parts = [];
        let acc = "";
        while (i7 < str.length) {
          const c8 = str.charAt(i7++);
          if (escaping || c8 === "\\") {
            escaping = !escaping;
            acc += c8;
            continue;
          }
          if (inBrace) {
            if (i7 === braceStart + 1) {
              if (c8 === "^" || c8 === "!") {
                braceNeg = true;
              }
            } else if (c8 === "]" && !(i7 === braceStart + 2 && braceNeg)) {
              inBrace = false;
            }
            acc += c8;
            continue;
          } else if (c8 === "[") {
            inBrace = true;
            braceStart = i7;
            braceNeg = false;
            acc += c8;
            continue;
          }
          if (isExtglobType(c8) && str.charAt(i7) === "(") {
            part.push(acc);
            acc = "";
            const ext2 = new _AST(c8, part);
            part.push(ext2);
            i7 = _AST.#parseAST(str, ext2, i7, opt);
            continue;
          }
          if (c8 === "|") {
            part.push(acc);
            acc = "";
            parts.push(part);
            part = new _AST(null, ast);
            continue;
          }
          if (c8 === ")") {
            if (acc === "" && ast.#parts.length === 0) {
              ast.#emptyExt = true;
            }
            part.push(acc);
            acc = "";
            ast.push(...parts, part);
            return i7;
          }
          acc += c8;
        }
        ast.type = null;
        ast.#hasMagic = void 0;
        ast.#parts = [str.substring(pos - 1)];
        return i7;
      }
      static fromGlob(pattern, options = {}) {
        const ast = new _AST(null, void 0, options);
        _AST.#parseAST(pattern, ast, 0, options);
        return ast;
      }
      // returns the regular expression if there's magic, or the unescaped
      // string if not.
      toMMPattern() {
        if (this !== this.#root)
          return this.#root.toMMPattern();
        const glob = this.toString();
        const [re2, body, hasMagic, uflag] = this.toRegExpSource();
        const anyMagic = hasMagic || this.#hasMagic || this.#options.nocase && !this.#options.nocaseMagicOnly && glob.toUpperCase() !== glob.toLowerCase();
        if (!anyMagic) {
          return body;
        }
        const flags2 = (this.#options.nocase ? "i" : "") + (uflag ? "u" : "");
        return Object.assign(new RegExp(`^${re2}$`, flags2), {
          _src: re2,
          _glob: glob
        });
      }
      get options() {
        return this.#options;
      }
      // returns the string match, the regexp source, whether there's magic
      // in the regexp (so a regular expression is required) and whether or
      // not the uflag is needed for the regular expression (for posix classes)
      // TODO: instead of injecting the start/end at this point, just return
      // the BODY of the regexp, along with the start/end portions suitable
      // for binding the start/end in either a joined full-path makeRe context
      // (where we bind to (^|/), or a standalone matchPart context (where
      // we bind to ^, and not /).  Otherwise slashes get duped!
      //
      // In part-matching mode, the start is:
      // - if not isStart: nothing
      // - if traversal possible, but not allowed: ^(?!\.\.?$)
      // - if dots allowed or not possible: ^
      // - if dots possible and not allowed: ^(?!\.)
      // end is:
      // - if not isEnd(): nothing
      // - else: $
      //
      // In full-path matching mode, we put the slash at the START of the
      // pattern, so start is:
      // - if first pattern: same as part-matching mode
      // - if not isStart(): nothing
      // - if traversal possible, but not allowed: /(?!\.\.?(?:$|/))
      // - if dots allowed or not possible: /
      // - if dots possible and not allowed: /(?!\.)
      // end is:
      // - if last pattern, same as part-matching mode
      // - else nothing
      //
      // Always put the (?:$|/) on negated tails, though, because that has to be
      // there to bind the end of the negated pattern portion, and it's easier to
      // just stick it in now rather than try to inject it later in the middle of
      // the pattern.
      //
      // We can just always return the same end, and leave it up to the caller
      // to know whether it's going to be used joined or in parts.
      // And, if the start is adjusted slightly, can do the same there:
      // - if not isStart: nothing
      // - if traversal possible, but not allowed: (?:/|^)(?!\.\.?$)
      // - if dots allowed or not possible: (?:/|^)
      // - if dots possible and not allowed: (?:/|^)(?!\.)
      //
      // But it's better to have a simpler binding without a conditional, for
      // performance, so probably better to return both start options.
      //
      // Then the caller just ignores the end if it's not the first pattern,
      // and the start always gets applied.
      //
      // But that's always going to be $ if it's the ending pattern, or nothing,
      // so the caller can just attach $ at the end of the pattern when building.
      //
      // So the todo is:
      // - better detect what kind of start is needed
      // - return both flavors of starting pattern
      // - attach $ at the end of the pattern when creating the actual RegExp
      //
      // Ah, but wait, no, that all only applies to the root when the first pattern
      // is not an extglob. If the first pattern IS an extglob, then we need all
      // that dot prevention biz to live in the extglob portions, because eg
      // +(*|.x*) can match .xy but not .yx.
      //
      // So, return the two flavors if it's #root and the first child is not an
      // AST, otherwise leave it to the child AST to handle it, and there,
      // use the (?:^|/) style of start binding.
      //
      // Even simplified further:
      // - Since the start for a join is eg /(?!\.) and the start for a part
      // is ^(?!\.), we can just prepend (?!\.) to the pattern (either root
      // or start or whatever) and prepend ^ or / at the Regexp construction.
      toRegExpSource(allowDot) {
        const dot = allowDot ?? !!this.#options.dot;
        if (this.#root === this)
          this.#fillNegs();
        if (!this.type) {
          const noEmpty = this.isStart() && this.isEnd();
          const src = this.#parts.map((p7) => {
            const [re2, _5, hasMagic, uflag] = typeof p7 === "string" ? _AST.#parseGlob(p7, this.#hasMagic, noEmpty) : p7.toRegExpSource(allowDot);
            this.#hasMagic = this.#hasMagic || hasMagic;
            this.#uflag = this.#uflag || uflag;
            return re2;
          }).join("");
          let start2 = "";
          if (this.isStart()) {
            if (typeof this.#parts[0] === "string") {
              const dotTravAllowed = this.#parts.length === 1 && justDots.has(this.#parts[0]);
              if (!dotTravAllowed) {
                const aps = addPatternStart;
                const needNoTrav = (
                  // dots are allowed, and the pattern starts with [ or .
                  dot && aps.has(src.charAt(0)) || // the pattern starts with \., and then [ or .
                  src.startsWith("\\.") && aps.has(src.charAt(2)) || // the pattern starts with \.\., and then [ or .
                  src.startsWith("\\.\\.") && aps.has(src.charAt(4))
                );
                const needNoDot = !dot && !allowDot && aps.has(src.charAt(0));
                start2 = needNoTrav ? startNoTraversal : needNoDot ? startNoDot : "";
              }
            }
          }
          let end = "";
          if (this.isEnd() && this.#root.#filledNegs && this.#parent?.type === "!") {
            end = "(?:$|\\/)";
          }
          const final2 = start2 + src + end;
          return [
            final2,
            unescape2(src),
            this.#hasMagic = !!this.#hasMagic,
            this.#uflag
          ];
        }
        const repeated = this.type === "*" || this.type === "+";
        const start = this.type === "!" ? "(?:(?!(?:" : "(?:";
        let body = this.#partsToRegExp(dot);
        if (this.isStart() && this.isEnd() && !body && this.type !== "!") {
          const s7 = this.toString();
          this.#parts = [s7];
          this.type = null;
          this.#hasMagic = void 0;
          return [s7, unescape2(this.toString()), false, false];
        }
        let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot ? "" : this.#partsToRegExp(true);
        if (bodyDotAllowed === body) {
          bodyDotAllowed = "";
        }
        if (bodyDotAllowed) {
          body = `(?:${body})(?:${bodyDotAllowed})*?`;
        }
        let final = "";
        if (this.type === "!" && this.#emptyExt) {
          final = (this.isStart() && !dot ? startNoDot : "") + starNoEmpty;
        } else {
          const close2 = this.type === "!" ? (
            // !() must match something,but !(x) can match ''
            "))" + (this.isStart() && !dot && !allowDot ? startNoDot : "") + star + ")"
          ) : this.type === "@" ? ")" : this.type === "?" ? ")?" : this.type === "+" && bodyDotAllowed ? ")" : this.type === "*" && bodyDotAllowed ? `)?` : `)${this.type}`;
          final = start + body + close2;
        }
        return [
          final,
          unescape2(body),
          this.#hasMagic = !!this.#hasMagic,
          this.#uflag
        ];
      }
      #partsToRegExp(dot) {
        return this.#parts.map((p7) => {
          if (typeof p7 === "string") {
            throw new Error("string type in extglob ast??");
          }
          const [re2, _5, _hasMagic, uflag] = p7.toRegExpSource(dot);
          this.#uflag = this.#uflag || uflag;
          return re2;
        }).filter((p7) => !(this.isStart() && this.isEnd()) || !!p7).join("|");
      }
      static #parseGlob(glob, hasMagic, noEmpty = false) {
        let escaping = false;
        let re2 = "";
        let uflag = false;
        for (let i7 = 0; i7 < glob.length; i7++) {
          const c8 = glob.charAt(i7);
          if (escaping) {
            escaping = false;
            re2 += (reSpecials.has(c8) ? "\\" : "") + c8;
            continue;
          }
          if (c8 === "\\") {
            if (i7 === glob.length - 1) {
              re2 += "\\\\";
            } else {
              escaping = true;
            }
            continue;
          }
          if (c8 === "[") {
            const [src, needUflag, consumed, magic] = parseClass(glob, i7);
            if (consumed) {
              re2 += src;
              uflag = uflag || needUflag;
              i7 += consumed - 1;
              hasMagic = hasMagic || magic;
              continue;
            }
          }
          if (c8 === "*") {
            if (noEmpty && glob === "*")
              re2 += starNoEmpty;
            else
              re2 += star;
            hasMagic = true;
            continue;
          }
          if (c8 === "?") {
            re2 += qmark;
            hasMagic = true;
            continue;
          }
          re2 += regExpEscape(c8);
        }
        return [re2, unescape2(glob), !!hasMagic, uflag];
      }
    };
  }
});

// ../../node_modules/.pnpm/minimatch@9.0.5/node_modules/minimatch/dist/esm/escape.js
var escape2;
var init_escape = __esm({
  "../../node_modules/.pnpm/minimatch@9.0.5/node_modules/minimatch/dist/esm/escape.js"() {
    init_import_meta_url();
    escape2 = /* @__PURE__ */ __name((s7, { windowsPathsNoEscape = false } = {}) => {
      return windowsPathsNoEscape ? s7.replace(/[?*()[\]]/g, "[$&]") : s7.replace(/[?*()[\]\\]/g, "\\$&");
    }, "escape");
  }
});

// ../../node_modules/.pnpm/minimatch@9.0.5/node_modules/minimatch/dist/esm/index.js
var import_brace_expansion, minimatch, starDotExtRE, starDotExtTest, starDotExtTestDot, starDotExtTestNocase, starDotExtTestNocaseDot, starDotStarRE, starDotStarTest, starDotStarTestDot, dotStarRE, dotStarTest, starRE, starTest, starTestDot, qmarksRE, qmarksTestNocase, qmarksTestNocaseDot, qmarksTestDot, qmarksTest, qmarksTestNoExt, qmarksTestNoExtDot, defaultPlatform, path43, sep3, GLOBSTAR, qmark2, star2, twoStarDot, twoStarNoDot, filter, ext, defaults2, braceExpand, makeRe, match, globMagic, regExpEscape2, Minimatch;
var init_esm11 = __esm({
  "../../node_modules/.pnpm/minimatch@9.0.5/node_modules/minimatch/dist/esm/index.js"() {
    init_import_meta_url();
    import_brace_expansion = __toESM(require_brace_expansion(), 1);
    init_assert_valid_pattern();
    init_ast();
    init_escape();
    init_unescape();
    init_ast();
    init_escape();
    init_unescape();
    minimatch = /* @__PURE__ */ __name((p7, pattern, options = {}) => {
      assertValidPattern(pattern);
      if (!options.nocomment && pattern.charAt(0) === "#") {
        return false;
      }
      return new Minimatch(pattern, options).match(p7);
    }, "minimatch");
    starDotExtRE = /^\*+([^+@!?\*\[\(]*)$/;
    starDotExtTest = /* @__PURE__ */ __name((ext2) => (f8) => !f8.startsWith(".") && f8.endsWith(ext2), "starDotExtTest");
    starDotExtTestDot = /* @__PURE__ */ __name((ext2) => (f8) => f8.endsWith(ext2), "starDotExtTestDot");
    starDotExtTestNocase = /* @__PURE__ */ __name((ext2) => {
      ext2 = ext2.toLowerCase();
      return (f8) => !f8.startsWith(".") && f8.toLowerCase().endsWith(ext2);
    }, "starDotExtTestNocase");
    starDotExtTestNocaseDot = /* @__PURE__ */ __name((ext2) => {
      ext2 = ext2.toLowerCase();
      return (f8) => f8.toLowerCase().endsWith(ext2);
    }, "starDotExtTestNocaseDot");
    starDotStarRE = /^\*+\.\*+$/;
    starDotStarTest = /* @__PURE__ */ __name((f8) => !f8.startsWith(".") && f8.includes("."), "starDotStarTest");
    starDotStarTestDot = /* @__PURE__ */ __name((f8) => f8 !== "." && f8 !== ".." && f8.includes("."), "starDotStarTestDot");
    dotStarRE = /^\.\*+$/;
    dotStarTest = /* @__PURE__ */ __name((f8) => f8 !== "." && f8 !== ".." && f8.startsWith("."), "dotStarTest");
    starRE = /^\*+$/;
    starTest = /* @__PURE__ */ __name((f8) => f8.length !== 0 && !f8.startsWith("."), "starTest");
    starTestDot = /* @__PURE__ */ __name((f8) => f8.length !== 0 && f8 !== "." && f8 !== "..", "starTestDot");
    qmarksRE = /^\?+([^+@!?\*\[\(]*)?$/;
    qmarksTestNocase = /* @__PURE__ */ __name(([$0, ext2 = ""]) => {
      const noext = qmarksTestNoExt([$0]);
      if (!ext2)
        return noext;
      ext2 = ext2.toLowerCase();
      return (f8) => noext(f8) && f8.toLowerCase().endsWith(ext2);
    }, "qmarksTestNocase");
    qmarksTestNocaseDot = /* @__PURE__ */ __name(([$0, ext2 = ""]) => {
      const noext = qmarksTestNoExtDot([$0]);
      if (!ext2)
        return noext;
      ext2 = ext2.toLowerCase();
      return (f8) => noext(f8) && f8.toLowerCase().endsWith(ext2);
    }, "qmarksTestNocaseDot");
    qmarksTestDot = /* @__PURE__ */ __name(([$0, ext2 = ""]) => {
      const noext = qmarksTestNoExtDot([$0]);
      return !ext2 ? noext : (f8) => noext(f8) && f8.endsWith(ext2);
    }, "qmarksTestDot");
    qmarksTest = /* @__PURE__ */ __name(([$0, ext2 = ""]) => {
      const noext = qmarksTestNoExt([$0]);
      return !ext2 ? noext : (f8) => noext(f8) && f8.endsWith(ext2);
    }, "qmarksTest");
    qmarksTestNoExt = /* @__PURE__ */ __name(([$0]) => {
      const len = $0.length;
      return (f8) => f8.length === len && !f8.startsWith(".");
    }, "qmarksTestNoExt");
    qmarksTestNoExtDot = /* @__PURE__ */ __name(([$0]) => {
      const len = $0.length;
      return (f8) => f8.length === len && f8 !== "." && f8 !== "..";
    }, "qmarksTestNoExtDot");
    defaultPlatform = typeof process === "object" && process ? typeof process.env === "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix";
    path43 = {
      win32: { sep: "\\" },
      posix: { sep: "/" }
    };
    sep3 = defaultPlatform === "win32" ? path43.win32.sep : path43.posix.sep;
    minimatch.sep = sep3;
    GLOBSTAR = Symbol("globstar **");
    minimatch.GLOBSTAR = GLOBSTAR;
    qmark2 = "[^/]";
    star2 = qmark2 + "*?";
    twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";
    twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?";
    filter = /* @__PURE__ */ __name((pattern, options = {}) => (p7) => minimatch(p7, pattern, options), "filter");
    minimatch.filter = filter;
    ext = /* @__PURE__ */ __name((a7, b11 = {}) => Object.assign({}, a7, b11), "ext");
    defaults2 = /* @__PURE__ */ __name((def) => {
      if (!def || typeof def !== "object" || !Object.keys(def).length) {
        return minimatch;
      }
      const orig = minimatch;
      const m7 = /* @__PURE__ */ __name((p7, pattern, options = {}) => orig(p7, pattern, ext(def, options)), "m");
      return Object.assign(m7, {
        Minimatch: class Minimatch extends orig.Minimatch {
          static {
            __name(this, "Minimatch");
          }
          constructor(pattern, options = {}) {
            super(pattern, ext(def, options));
          }
          static defaults(options) {
            return orig.defaults(ext(def, options)).Minimatch;
          }
        },
        AST: class AST extends orig.AST {
          static {
            __name(this, "AST");
          }
          /* c8 ignore start */
          constructor(type, parent, options = {}) {
            super(type, parent, ext(def, options));
          }
          /* c8 ignore stop */
          static fromGlob(pattern, options = {}) {
            return orig.AST.fromGlob(pattern, ext(def, options));
          }
        },
        unescape: /* @__PURE__ */ __name((s7, options = {}) => orig.unescape(s7, ext(def, options)), "unescape"),
        escape: /* @__PURE__ */ __name((s7, options = {}) => orig.escape(s7, ext(def, options)), "escape"),
        filter: /* @__PURE__ */ __name((pattern, options = {}) => orig.filter(pattern, ext(def, options)), "filter"),
        defaults: /* @__PURE__ */ __name((options) => orig.defaults(ext(def, options)), "defaults"),
        makeRe: /* @__PURE__ */ __name((pattern, options = {}) => orig.makeRe(pattern, ext(def, options)), "makeRe"),
        braceExpand: /* @__PURE__ */ __name((pattern, options = {}) => orig.braceExpand(pattern, ext(def, options)), "braceExpand"),
        match: /* @__PURE__ */ __name((list, pattern, options = {}) => orig.match(list, pattern, ext(def, options)), "match"),
        sep: orig.sep,
        GLOBSTAR
      });
    }, "defaults");
    minimatch.defaults = defaults2;
    braceExpand = /* @__PURE__ */ __name((pattern, options = {}) => {
      assertValidPattern(pattern);
      if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) {
        return [pattern];
      }
      return (0, import_brace_expansion.default)(pattern);
    }, "braceExpand");
    minimatch.braceExpand = braceExpand;
    makeRe = /* @__PURE__ */ __name((pattern, options = {}) => new Minimatch(pattern, options).makeRe(), "makeRe");
    minimatch.makeRe = makeRe;
    match = /* @__PURE__ */ __name((list, pattern, options = {}) => {
      const mm = new Minimatch(pattern, options);
      list = list.filter((f8) => mm.match(f8));
      if (mm.options.nonull && !list.length) {
        list.push(pattern);
      }
      return list;
    }, "match");
    minimatch.match = match;
    globMagic = /[?*]|[+@!]\(.*?\)|\[|\]/;
    regExpEscape2 = /* @__PURE__ */ __name((s7) => s7.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), "regExpEscape");
    Minimatch = class {
      static {
        __name(this, "Minimatch");
      }
      options;
      set;
      pattern;
      windowsPathsNoEscape;
      nonegate;
      negate;
      comment;
      empty;
      preserveMultipleSlashes;
      partial;
      globSet;
      globParts;
      nocase;
      isWindows;
      platform;
      windowsNoMagicRoot;
      regexp;
      constructor(pattern, options = {}) {
        assertValidPattern(pattern);
        options = options || {};
        this.options = options;
        this.pattern = pattern;
        this.platform = options.platform || defaultPlatform;
        this.isWindows = this.platform === "win32";
        this.windowsPathsNoEscape = !!options.windowsPathsNoEscape || options.allowWindowsEscape === false;
        if (this.windowsPathsNoEscape) {
          this.pattern = this.pattern.replace(/\\/g, "/");
        }
        this.preserveMultipleSlashes = !!options.preserveMultipleSlashes;
        this.regexp = null;
        this.negate = false;
        this.nonegate = !!options.nonegate;
        this.comment = false;
        this.empty = false;
        this.partial = !!options.partial;
        this.nocase = !!this.options.nocase;
        this.windowsNoMagicRoot = options.windowsNoMagicRoot !== void 0 ? options.windowsNoMagicRoot : !!(this.isWindows && this.nocase);
        this.globSet = [];
        this.globParts = [];
        this.set = [];
        this.make();
      }
      hasMagic() {
        if (this.options.magicalBraces && this.set.length > 1) {
          return true;
        }
        for (const pattern of this.set) {
          for (const part of pattern) {
            if (typeof part !== "string")
              return true;
          }
        }
        return false;
      }
      debug(..._5) {
      }
      make() {
        const pattern = this.pattern;
        const options = this.options;
        if (!options.nocomment && pattern.charAt(0) === "#") {
          this.comment = true;
          return;
        }
        if (!pattern) {
          this.empty = true;
          return;
        }
        this.parseNegate();
        this.globSet = [...new Set(this.braceExpand())];
        if (options.debug) {
          this.debug = (...args) => console.error(...args);
        }
        this.debug(this.pattern, this.globSet);
        const rawGlobParts = this.globSet.map((s7) => this.slashSplit(s7));
        this.globParts = this.preprocess(rawGlobParts);
        this.debug(this.pattern, this.globParts);
        let set = this.globParts.map((s7, _5, __) => {
          if (this.isWindows && this.windowsNoMagicRoot) {
            const isUNC = s7[0] === "" && s7[1] === "" && (s7[2] === "?" || !globMagic.test(s7[2])) && !globMagic.test(s7[3]);
            const isDrive = /^[a-z]:/i.test(s7[0]);
            if (isUNC) {
              return [...s7.slice(0, 4), ...s7.slice(4).map((ss) => this.parse(ss))];
            } else if (isDrive) {
              return [s7[0], ...s7.slice(1).map((ss) => this.parse(ss))];
            }
          }
          return s7.map((ss) => this.parse(ss));
        });
        this.debug(this.pattern, set);
        this.set = set.filter((s7) => s7.indexOf(false) === -1);
        if (this.isWindows) {
          for (let i7 = 0; i7 < this.set.length; i7++) {
            const p7 = this.set[i7];
            if (p7[0] === "" && p7[1] === "" && this.globParts[i7][2] === "?" && typeof p7[3] === "string" && /^[a-z]:$/i.test(p7[3])) {
              p7[2] = "?";
            }
          }
        }
        this.debug(this.pattern, this.set);
      }
      // various transforms to equivalent pattern sets that are
      // faster to process in a filesystem walk.  The goal is to
      // eliminate what we can, and push all ** patterns as far
      // to the right as possible, even if it increases the number
      // of patterns that we have to process.
      preprocess(globParts) {
        if (this.options.noglobstar) {
          for (let i7 = 0; i7 < globParts.length; i7++) {
            for (let j7 = 0; j7 < globParts[i7].length; j7++) {
              if (globParts[i7][j7] === "**") {
                globParts[i7][j7] = "*";
              }
            }
          }
        }
        const { optimizationLevel = 1 } = this.options;
        if (optimizationLevel >= 2) {
          globParts = this.firstPhasePreProcess(globParts);
          globParts = this.secondPhasePreProcess(globParts);
        } else if (optimizationLevel >= 1) {
          globParts = this.levelOneOptimize(globParts);
        } else {
          globParts = this.adjascentGlobstarOptimize(globParts);
        }
        return globParts;
      }
      // just get rid of adjascent ** portions
      adjascentGlobstarOptimize(globParts) {
        return globParts.map((parts) => {
          let gs = -1;
          while (-1 !== (gs = parts.indexOf("**", gs + 1))) {
            let i7 = gs;
            while (parts[i7 + 1] === "**") {
              i7++;
            }
            if (i7 !== gs) {
              parts.splice(gs, i7 - gs);
            }
          }
          return parts;
        });
      }
      // get rid of adjascent ** and resolve .. portions
      levelOneOptimize(globParts) {
        return globParts.map((parts) => {
          parts = parts.reduce((set, part) => {
            const prev = set[set.length - 1];
            if (part === "**" && prev === "**") {
              return set;
            }
            if (part === "..") {
              if (prev && prev !== ".." && prev !== "." && prev !== "**") {
                set.pop();
                return set;
              }
            }
            set.push(part);
            return set;
          }, []);
          return parts.length === 0 ? [""] : parts;
        });
      }
      levelTwoFileOptimize(parts) {
        if (!Array.isArray(parts)) {
          parts = this.slashSplit(parts);
        }
        let didSomething = false;
        do {
          didSomething = false;
          if (!this.preserveMultipleSlashes) {
            for (let i7 = 1; i7 < parts.length - 1; i7++) {
              const p7 = parts[i7];
              if (i7 === 1 && p7 === "" && parts[0] === "")
                continue;
              if (p7 === "." || p7 === "") {
                didSomething = true;
                parts.splice(i7, 1);
                i7--;
              }
            }
            if (parts[0] === "." && parts.length === 2 && (parts[1] === "." || parts[1] === "")) {
              didSomething = true;
              parts.pop();
            }
          }
          let dd = 0;
          while (-1 !== (dd = parts.indexOf("..", dd + 1))) {
            const p7 = parts[dd - 1];
            if (p7 && p7 !== "." && p7 !== ".." && p7 !== "**") {
              didSomething = true;
              parts.splice(dd - 1, 2);
              dd -= 2;
            }
          }
        } while (didSomething);
        return parts.length === 0 ? [""] : parts;
      }
      // First phase: single-pattern processing
      // <pre> is 1 or more portions
      // <rest> is 1 or more portions
      // <p> is any portion other than ., .., '', or **
      // <e> is . or ''
      //
      // **/.. is *brutal* for filesystem walking performance, because
      // it effectively resets the recursive walk each time it occurs,
      // and ** cannot be reduced out by a .. pattern part like a regexp
      // or most strings (other than .., ., and '') can be.
      //
      // <pre>/**/../<p>/<p>/<rest> -> {<pre>/../<p>/<p>/<rest>,<pre>/**/<p>/<p>/<rest>}
      // <pre>/<e>/<rest> -> <pre>/<rest>
      // <pre>/<p>/../<rest> -> <pre>/<rest>
      // **/**/<rest> -> **/<rest>
      //
      // **/*/<rest> -> */**/<rest> <== not valid because ** doesn't follow
      // this WOULD be allowed if ** did follow symlinks, or * didn't
      firstPhasePreProcess(globParts) {
        let didSomething = false;
        do {
          didSomething = false;
          for (let parts of globParts) {
            let gs = -1;
            while (-1 !== (gs = parts.indexOf("**", gs + 1))) {
              let gss = gs;
              while (parts[gss + 1] === "**") {
                gss++;
              }
              if (gss > gs) {
                parts.splice(gs + 1, gss - gs);
              }
              let next = parts[gs + 1];
              const p7 = parts[gs + 2];
              const p22 = parts[gs + 3];
              if (next !== "..")
                continue;
              if (!p7 || p7 === "." || p7 === ".." || !p22 || p22 === "." || p22 === "..") {
                continue;
              }
              didSomething = true;
              parts.splice(gs, 1);
              const other = parts.slice(0);
              other[gs] = "**";
              globParts.push(other);
              gs--;
            }
            if (!this.preserveMultipleSlashes) {
              for (let i7 = 1; i7 < parts.length - 1; i7++) {
                const p7 = parts[i7];
                if (i7 === 1 && p7 === "" && parts[0] === "")
                  continue;
                if (p7 === "." || p7 === "") {
                  didSomething = true;
                  parts.splice(i7, 1);
                  i7--;
                }
              }
              if (parts[0] === "." && parts.length === 2 && (parts[1] === "." || parts[1] === "")) {
                didSomething = true;
                parts.pop();
              }
            }
            let dd = 0;
            while (-1 !== (dd = parts.indexOf("..", dd + 1))) {
              const p7 = parts[dd - 1];
              if (p7 && p7 !== "." && p7 !== ".." && p7 !== "**") {
                didSomething = true;
                const needDot = dd === 1 && parts[dd + 1] === "**";
                const splin = needDot ? ["."] : [];
                parts.splice(dd - 1, 2, ...splin);
                if (parts.length === 0)
                  parts.push("");
                dd -= 2;
              }
            }
          }
        } while (didSomething);
        return globParts;
      }
      // second phase: multi-pattern dedupes
      // {<pre>/*/<rest>,<pre>/<p>/<rest>} -> <pre>/*/<rest>
      // {<pre>/<rest>,<pre>/<rest>} -> <pre>/<rest>
      // {<pre>/**/<rest>,<pre>/<rest>} -> <pre>/**/<rest>
      //
      // {<pre>/**/<rest>,<pre>/**/<p>/<rest>} -> <pre>/**/<rest>
      // ^-- not valid because ** doens't follow symlinks
      secondPhasePreProcess(globParts) {
        for (let i7 = 0; i7 < globParts.length - 1; i7++) {
          for (let j7 = i7 + 1; j7 < globParts.length; j7++) {
            const matched = this.partsMatch(globParts[i7], globParts[j7], !this.preserveMultipleSlashes);
            if (matched) {
              globParts[i7] = [];
              globParts[j7] = matched;
              break;
            }
          }
        }
        return globParts.filter((gs) => gs.length);
      }
      partsMatch(a7, b11, emptyGSMatch = false) {
        let ai2 = 0;
        let bi2 = 0;
        let result = [];
        let which = "";
        while (ai2 < a7.length && bi2 < b11.length) {
          if (a7[ai2] === b11[bi2]) {
            result.push(which === "b" ? b11[bi2] : a7[ai2]);
            ai2++;
            bi2++;
          } else if (emptyGSMatch && a7[ai2] === "**" && b11[bi2] === a7[ai2 + 1]) {
            result.push(a7[ai2]);
            ai2++;
          } else if (emptyGSMatch && b11[bi2] === "**" && a7[ai2] === b11[bi2 + 1]) {
            result.push(b11[bi2]);
            bi2++;
          } else if (a7[ai2] === "*" && b11[bi2] && (this.options.dot || !b11[bi2].startsWith(".")) && b11[bi2] !== "**") {
            if (which === "b")
              return false;
            which = "a";
            result.push(a7[ai2]);
            ai2++;
            bi2++;
          } else if (b11[bi2] === "*" && a7[ai2] && (this.options.dot || !a7[ai2].startsWith(".")) && a7[ai2] !== "**") {
            if (which === "a")
              return false;
            which = "b";
            result.push(b11[bi2]);
            ai2++;
            bi2++;
          } else {
            return false;
          }
        }
        return a7.length === b11.length && result;
      }
      parseNegate() {
        if (this.nonegate)
          return;
        const pattern = this.pattern;
        let negate3 = false;
        let negateOffset = 0;
        for (let i7 = 0; i7 < pattern.length && pattern.charAt(i7) === "!"; i7++) {
          negate3 = !negate3;
          negateOffset++;
        }
        if (negateOffset)
          this.pattern = pattern.slice(negateOffset);
        this.negate = negate3;
      }
      // set partial to true to test if, for example,
      // "/a/b" matches the start of "/*/b/*/d"
      // Partial means, if you run out of file before you run
      // out of pattern, then that's fine, as long as all
      // the parts match.
      matchOne(file3, pattern, partial = false) {
        const options = this.options;
        if (this.isWindows) {
          const fileDrive = typeof file3[0] === "string" && /^[a-z]:$/i.test(file3[0]);
          const fileUNC = !fileDrive && file3[0] === "" && file3[1] === "" && file3[2] === "?" && /^[a-z]:$/i.test(file3[3]);
          const patternDrive = typeof pattern[0] === "string" && /^[a-z]:$/i.test(pattern[0]);
          const patternUNC = !patternDrive && pattern[0] === "" && pattern[1] === "" && pattern[2] === "?" && typeof pattern[3] === "string" && /^[a-z]:$/i.test(pattern[3]);
          const fdi = fileUNC ? 3 : fileDrive ? 0 : void 0;
          const pdi = patternUNC ? 3 : patternDrive ? 0 : void 0;
          if (typeof fdi === "number" && typeof pdi === "number") {
            const [fd, pd] = [file3[fdi], pattern[pdi]];
            if (fd.toLowerCase() === pd.toLowerCase()) {
              pattern[pdi] = fd;
              if (pdi > fdi) {
                pattern = pattern.slice(pdi);
              } else if (fdi > pdi) {
                file3 = file3.slice(fdi);
              }
            }
          }
        }
        const { optimizationLevel = 1 } = this.options;
        if (optimizationLevel >= 2) {
          file3 = this.levelTwoFileOptimize(file3);
        }
        this.debug("matchOne", this, { file: file3, pattern });
        this.debug("matchOne", file3.length, pattern.length);
        for (var fi = 0, pi = 0, fl = file3.length, pl2 = pattern.length; fi < fl && pi < pl2; fi++, pi++) {
          this.debug("matchOne loop");
          var p7 = pattern[pi];
          var f8 = file3[fi];
          this.debug(pattern, p7, f8);
          if (p7 === false) {
            return false;
          }
          if (p7 === GLOBSTAR) {
            this.debug("GLOBSTAR", [pattern, p7, f8]);
            var fr2 = fi;
            var pr2 = pi + 1;
            if (pr2 === pl2) {
              this.debug("** at the end");
              for (; fi < fl; fi++) {
                if (file3[fi] === "." || file3[fi] === ".." || !options.dot && file3[fi].charAt(0) === ".")
                  return false;
              }
              return true;
            }
            while (fr2 < fl) {
              var swallowee = file3[fr2];
              this.debug("\nglobstar while", file3, fr2, pattern, pr2, swallowee);
              if (this.matchOne(file3.slice(fr2), pattern.slice(pr2), partial)) {
                this.debug("globstar found match!", fr2, fl, swallowee);
                return true;
              } else {
                if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") {
                  this.debug("dot detected!", file3, fr2, pattern, pr2);
                  break;
                }
                this.debug("globstar swallow a segment, and continue");
                fr2++;
              }
            }
            if (partial) {
              this.debug("\n>>> no match, partial?", file3, fr2, pattern, pr2);
              if (fr2 === fl) {
                return true;
              }
            }
            return false;
          }
          let hit;
          if (typeof p7 === "string") {
            hit = f8 === p7;
            this.debug("string match", p7, f8, hit);
          } else {
            hit = p7.test(f8);
            this.debug("pattern match", p7, f8, hit);
          }
          if (!hit)
            return false;
        }
        if (fi === fl && pi === pl2) {
          return true;
        } else if (fi === fl) {
          return partial;
        } else if (pi === pl2) {
          return fi === fl - 1 && file3[fi] === "";
        } else {
          throw new Error("wtf?");
        }
      }
      braceExpand() {
        return braceExpand(this.pattern, this.options);
      }
      parse(pattern) {
        assertValidPattern(pattern);
        const options = this.options;
        if (pattern === "**")
          return GLOBSTAR;
        if (pattern === "")
          return "";
        let m7;
        let fastTest = null;
        if (m7 = pattern.match(starRE)) {
          fastTest = options.dot ? starTestDot : starTest;
        } else if (m7 = pattern.match(starDotExtRE)) {
          fastTest = (options.nocase ? options.dot ? starDotExtTestNocaseDot : starDotExtTestNocase : options.dot ? starDotExtTestDot : starDotExtTest)(m7[1]);
        } else if (m7 = pattern.match(qmarksRE)) {
          fastTest = (options.nocase ? options.dot ? qmarksTestNocaseDot : qmarksTestNocase : options.dot ? qmarksTestDot : qmarksTest)(m7);
        } else if (m7 = pattern.match(starDotStarRE)) {
          fastTest = options.dot ? starDotStarTestDot : starDotStarTest;
        } else if (m7 = pattern.match(dotStarRE)) {
          fastTest = dotStarTest;
        }
        const re2 = AST.fromGlob(pattern, this.options).toMMPattern();
        if (fastTest && typeof re2 === "object") {
          Reflect.defineProperty(re2, "test", { value: fastTest });
        }
        return re2;
      }
      makeRe() {
        if (this.regexp || this.regexp === false)
          return this.regexp;
        const set = this.set;
        if (!set.length) {
          this.regexp = false;
          return this.regexp;
        }
        const options = this.options;
        const twoStar = options.noglobstar ? star2 : options.dot ? twoStarDot : twoStarNoDot;
        const flags2 = new Set(options.nocase ? ["i"] : []);
        let re2 = set.map((pattern) => {
          const pp = pattern.map((p7) => {
            if (p7 instanceof RegExp) {
              for (const f8 of p7.flags.split(""))
                flags2.add(f8);
            }
            return typeof p7 === "string" ? regExpEscape2(p7) : p7 === GLOBSTAR ? GLOBSTAR : p7._src;
          });
          pp.forEach((p7, i7) => {
            const next = pp[i7 + 1];
            const prev = pp[i7 - 1];
            if (p7 !== GLOBSTAR || prev === GLOBSTAR) {
              return;
            }
            if (prev === void 0) {
              if (next !== void 0 && next !== GLOBSTAR) {
                pp[i7 + 1] = "(?:\\/|" + twoStar + "\\/)?" + next;
              } else {
                pp[i7] = twoStar;
              }
            } else if (next === void 0) {
              pp[i7 - 1] = prev + "(?:\\/|" + twoStar + ")?";
            } else if (next !== GLOBSTAR) {
              pp[i7 - 1] = prev + "(?:\\/|\\/" + twoStar + "\\/)" + next;
              pp[i7 + 1] = GLOBSTAR;
            }
          });
          return pp.filter((p7) => p7 !== GLOBSTAR).join("/");
        }).join("|");
        const [open3, close2] = set.length > 1 ? ["(?:", ")"] : ["", ""];
        re2 = "^" + open3 + re2 + close2 + "$";
        if (this.negate)
          re2 = "^(?!" + re2 + ").+$";
        try {
          this.regexp = new RegExp(re2, [...flags2].join(""));
        } catch (ex) {
          this.regexp = false;
        }
        return this.regexp;
      }
      slashSplit(p7) {
        if (this.preserveMultipleSlashes) {
          return p7.split("/");
        } else if (this.isWindows && /^\/\/[^\/]+/.test(p7)) {
          return ["", ...p7.split(/\/+/)];
        } else {
          return p7.split(/\/+/);
        }
      }
      match(f8, partial = this.partial) {
        this.debug("match", f8, this.pattern);
        if (this.comment) {
          return false;
        }
        if (this.empty) {
          return f8 === "";
        }
        if (f8 === "/" && partial) {
          return true;
        }
        const options = this.options;
        if (this.isWindows) {
          f8 = f8.split("\\").join("/");
        }
        const ff = this.slashSplit(f8);
        this.debug(this.pattern, "split", ff);
        const set = this.set;
        this.debug(this.pattern, "set", set);
        let filename = ff[ff.length - 1];
        if (!filename) {
          for (let i7 = ff.length - 2; !filename && i7 >= 0; i7--) {
            filename = ff[i7];
          }
        }
        for (let i7 = 0; i7 < set.length; i7++) {
          const pattern = set[i7];
          let file3 = ff;
          if (options.matchBase && pattern.length === 1) {
            file3 = [filename];
          }
          const hit = this.matchOne(file3, pattern, partial);
          if (hit) {
            if (options.flipNegate) {
              return true;
            }
            return !this.negate;
          }
        }
        if (options.flipNegate) {
          return false;
        }
        return this.negate;
      }
      static defaults(def) {
        return minimatch.defaults(def).Minimatch;
      }
    };
    minimatch.AST = AST;
    minimatch.Minimatch = Minimatch;
    minimatch.escape = escape2;
    minimatch.unescape = unescape2;
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/workspaces/get-workspace-packages.js
function getDirFromPattern(pattern) {
  const dir2 = [];
  const parts = pattern.globParts[0];
  for (let i7 = 0, max = parts.length; i7 < max; i7++) {
    if (parts[i7].includes("*")) {
      return { dir: dir2.join("/"), depth: parts[i7] };
    }
    dir2.push(parts[i7]);
  }
  return { dir: dir2.join("/") };
}
async function findPackages(project, dir2, identifyPackage, depth) {
  let content = {};
  const startDir = project.jsWorkspaceRoot ? project.fs.resolve(project.jsWorkspaceRoot, dir2) : project.root ? project.fs.resolve(project.root, dir2) : project.fs.resolve(dir2);
  try {
    content = await project.fs.readDir(startDir, true);
  } catch {
  }
  const foundPromises = Object.entries(content).map(async ([part, type]) => {
    const identified = await identifyPackage({ entry: part, type, packagePath: dir2, directory: startDir, project });
    if (identified) {
      return [identified];
    }
    if (depth && type === "directory") {
      return findPackages(project, project.fs.join(dir2, part), identifyPackage, depth === "**" ? depth : void 0);
    }
    return [];
  });
  const found = await Promise.all(foundPromises);
  return found.flat();
}
async function getWorkspacePackages(project, patterns = []) {
  if (!patterns?.length) {
    return [];
  }
  const results = (await Promise.all(patterns.map((pattern) => {
    const cleanedPattern = pattern.replace(/^!?(\.\/)/, (match3, p1) => match3.replace(p1, ""));
    const matcher = new Minimatch(cleanedPattern);
    if (matcher.negate) {
      return;
    }
    const { dir: dir2, depth } = getDirFromPattern(matcher);
    return findPackages(project, dir2, defaultIdentifyPackage, depth);
  }))).flat().filter(Boolean);
  const filtered = /* @__PURE__ */ new Map();
  for (const result of results) {
    for (const pattern of patterns) {
      const cleanedPattern = pattern.replace(/^!?(\.\/)/, (match3, p1) => match3.replace(p1, ""));
      const matcher = new Minimatch(cleanedPattern);
      if (minimatch(result.path, matcher.pattern)) {
        filtered.set(project.fs.join(result.path), result);
        if (matcher.negate) {
          filtered.delete(project.fs.join(result.path));
        }
      }
    }
  }
  return [...filtered.values()];
}
var defaultIdentifyPackage;
var init_get_workspace_packages = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/workspaces/get-workspace-packages.js"() {
    init_import_meta_url();
    init_esm11();
    __name(getDirFromPattern, "getDirFromPattern");
    defaultIdentifyPackage = /* @__PURE__ */ __name(async ({ entry, project, directory, packagePath }) => {
      if (entry === "package.json") {
        const pkg = { path: packagePath };
        try {
          const { name: name2 } = await project.fs.readJSON(project.fs.join(directory, entry));
          pkg.name = name2;
        } catch {
        }
        return pkg;
      }
      return null;
    }, "defaultIdentifyPackage");
    __name(findPackages, "findPackages");
    __name(getWorkspacePackages, "getWorkspacePackages");
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/workspaces/detect-workspace.js
async function detectPnpmWorkspaceGlobs(project) {
  const workspaceFile = await project.fs.findUp("pnpm-workspace.yaml", {
    cwd: project.baseDirectory,
    stopAt: project.root
  });
  if (!workspaceFile) {
    return [];
  }
  try {
    const { packages = [] } = (0, import_yaml2.parse)(await project.fs.readFile(workspaceFile));
    return packages;
  } catch {
    return [];
  }
}
async function detectNpmOrYarnWorkspaceGlobs(pkgJSON) {
  if (Array.isArray(pkgJSON.workspaces)) {
    return pkgJSON.workspaces || [];
  }
  if (typeof pkgJSON.workspaces === "object") {
    return pkgJSON.workspaces.packages || [];
  }
  return [];
}
async function detectWorkspaces(project) {
  if (project.packageManager === void 0) {
    throw new Error("Please run the packageManager detection before calling the workspace detection!");
  }
  if (project.packageManager === null) {
    return null;
  }
  if (await project.isRedwoodProject()) {
    return null;
  }
  const pkgJSON = await project.getRootPackageJSON();
  const workspaceGlobs = project.packageManager.name === "pnpm" ? await detectPnpmWorkspaceGlobs(project) : await detectNpmOrYarnWorkspaceGlobs(pkgJSON);
  if (!workspaceGlobs || workspaceGlobs.length === 0) {
    return null;
  }
  project.events.emit("detectedWorkspaceGlobs", void 0);
  const info = new WorkspaceInfo();
  info.rootDir = project.jsWorkspaceRoot;
  info.packages = await getWorkspacePackages(project, workspaceGlobs);
  info.isRoot = project.baseDirectory === project.jsWorkspaceRoot;
  const relBaseDirectory = project.fs.relative(project.jsWorkspaceRoot, project.baseDirectory);
  if (!info.isRoot && !info.hasPackage(relBaseDirectory)) {
    return null;
  }
  return info;
}
var import_yaml2, WorkspaceInfo;
var init_detect_workspace = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/workspaces/detect-workspace.js"() {
    init_import_meta_url();
    import_yaml2 = __toESM(require_dist3(), 1);
    init_get_workspace_packages();
    WorkspaceInfo = class {
      static {
        __name(this, "WorkspaceInfo");
      }
      /** if we are in the current workspace root or not */
      isRoot;
      /** the workspace root directory */
      rootDir;
      /** list of relative package paths inside the workspace */
      packages = [];
      /** Detects if a workspace has a sub package */
      hasPackage(relativePackagePath) {
        return this.packages.findIndex(({ path: path84 }) => path84 === relativePackagePath) > -1;
      }
      getPackage(relativePackagePath) {
        return this.packages.find(({ path: path84 }) => path84 === relativePackagePath);
      }
    };
    __name(detectPnpmWorkspaceGlobs, "detectPnpmWorkspaceGlobs");
    __name(detectNpmOrYarnWorkspaceGlobs, "detectNpmOrYarnWorkspaceGlobs");
    __name(detectWorkspaces, "detectWorkspaces");
  }
});

// ../../node_modules/.pnpm/dot-prop@9.0.0/node_modules/dot-prop/index.js
var dot_prop_exports = {};
__export(dot_prop_exports, {
  deepKeys: () => deepKeys,
  deleteProperty: () => deleteProperty,
  escapePath: () => escapePath,
  getProperty: () => getProperty,
  hasProperty: () => hasProperty3,
  setProperty: () => setProperty3
});
function getPathSegments(path84) {
  const parts = [];
  let currentSegment = "";
  let currentPart = "start";
  let isIgnoring = false;
  for (const character of path84) {
    switch (character) {
      case "\\": {
        if (currentPart === "index") {
          throw new Error("Invalid character in an index");
        }
        if (currentPart === "indexEnd") {
          throw new Error("Invalid character after an index");
        }
        if (isIgnoring) {
          currentSegment += character;
        }
        currentPart = "property";
        isIgnoring = !isIgnoring;
        break;
      }
      case ".": {
        if (currentPart === "index") {
          throw new Error("Invalid character in an index");
        }
        if (currentPart === "indexEnd") {
          currentPart = "property";
          break;
        }
        if (isIgnoring) {
          isIgnoring = false;
          currentSegment += character;
          break;
        }
        if (disallowedKeys.has(currentSegment)) {
          return [];
        }
        parts.push(currentSegment);
        currentSegment = "";
        currentPart = "property";
        break;
      }
      case "[": {
        if (currentPart === "index") {
          throw new Error("Invalid character in an index");
        }
        if (currentPart === "indexEnd") {
          currentPart = "index";
          break;
        }
        if (isIgnoring) {
          isIgnoring = false;
          currentSegment += character;
          break;
        }
        if (currentPart === "property") {
          if (disallowedKeys.has(currentSegment)) {
            return [];
          }
          parts.push(currentSegment);
          currentSegment = "";
        }
        currentPart = "index";
        break;
      }
      case "]": {
        if (currentPart === "index") {
          parts.push(Number.parseInt(currentSegment, 10));
          currentSegment = "";
          currentPart = "indexEnd";
          break;
        }
        if (currentPart === "indexEnd") {
          throw new Error("Invalid character after an index");
        }
      }
      default: {
        if (currentPart === "index" && !digits.has(character)) {
          throw new Error("Invalid character in an index");
        }
        if (currentPart === "indexEnd") {
          throw new Error("Invalid character after an index");
        }
        if (currentPart === "start") {
          currentPart = "property";
        }
        if (isIgnoring) {
          isIgnoring = false;
          currentSegment += "\\";
        }
        currentSegment += character;
      }
    }
  }
  if (isIgnoring) {
    currentSegment += "\\";
  }
  switch (currentPart) {
    case "property": {
      if (disallowedKeys.has(currentSegment)) {
        return [];
      }
      parts.push(currentSegment);
      break;
    }
    case "index": {
      throw new Error("Index was not closed");
    }
    case "start": {
      parts.push("");
      break;
    }
  }
  return parts;
}
function isStringIndex(object, key) {
  if (typeof key !== "number" && Array.isArray(object)) {
    const index = Number.parseInt(key, 10);
    return Number.isInteger(index) && object[index] === object[key];
  }
  return false;
}
function assertNotStringIndex(object, key) {
  if (isStringIndex(object, key)) {
    throw new Error("Cannot use string index");
  }
}
function getProperty(object, path84, value) {
  if (!isObject3(object) || typeof path84 !== "string") {
    return value === void 0 ? object : value;
  }
  const pathArray = getPathSegments(path84);
  if (pathArray.length === 0) {
    return value;
  }
  for (let index = 0; index < pathArray.length; index++) {
    const key = pathArray[index];
    if (isStringIndex(object, key)) {
      object = index === pathArray.length - 1 ? void 0 : null;
    } else {
      object = object[key];
    }
    if (object === void 0 || object === null) {
      if (index !== pathArray.length - 1) {
        return value;
      }
      break;
    }
  }
  return object === void 0 ? value : object;
}
function setProperty3(object, path84, value) {
  if (!isObject3(object) || typeof path84 !== "string") {
    return object;
  }
  const root = object;
  const pathArray = getPathSegments(path84);
  for (let index = 0; index < pathArray.length; index++) {
    const key = pathArray[index];
    assertNotStringIndex(object, key);
    if (index === pathArray.length - 1) {
      object[key] = value;
    } else if (!isObject3(object[key])) {
      object[key] = typeof pathArray[index + 1] === "number" ? [] : {};
    }
    object = object[key];
  }
  return root;
}
function deleteProperty(object, path84) {
  if (!isObject3(object) || typeof path84 !== "string") {
    return false;
  }
  const pathArray = getPathSegments(path84);
  for (let index = 0; index < pathArray.length; index++) {
    const key = pathArray[index];
    assertNotStringIndex(object, key);
    if (index === pathArray.length - 1) {
      delete object[key];
      return true;
    }
    object = object[key];
    if (!isObject3(object)) {
      return false;
    }
  }
}
function hasProperty3(object, path84) {
  if (!isObject3(object) || typeof path84 !== "string") {
    return false;
  }
  const pathArray = getPathSegments(path84);
  if (pathArray.length === 0) {
    return false;
  }
  for (const key of pathArray) {
    if (!isObject3(object) || !(key in object) || isStringIndex(object, key)) {
      return false;
    }
    object = object[key];
  }
  return true;
}
function escapePath(path84) {
  if (typeof path84 !== "string") {
    throw new TypeError("Expected a string");
  }
  return path84.replaceAll(/[\\.[]/g, "\\$&");
}
function entries(value) {
  const result = Object.entries(value);
  if (Array.isArray(value)) {
    return result.map(([key, value2]) => [Number(key), value2]);
  }
  return result;
}
function stringifyPath(pathSegments) {
  let result = "";
  for (let [index, segment] of entries(pathSegments)) {
    if (typeof segment === "number") {
      result += `[${segment}]`;
    } else {
      segment = escapePath(segment);
      result += index === 0 ? segment : `.${segment}`;
    }
  }
  return result;
}
function* deepKeysIterator(object, currentPath = []) {
  if (!isObject3(object) || isEmptyObject(object)) {
    if (currentPath.length > 0) {
      yield stringifyPath(currentPath);
    }
    return;
  }
  for (const [key, value] of entries(object)) {
    yield* deepKeysIterator(value, [...currentPath, key]);
  }
}
function deepKeys(object) {
  return [...deepKeysIterator(object)];
}
var isObject3, isEmptyObject, disallowedKeys, digits;
var init_dot_prop = __esm({
  "../../node_modules/.pnpm/dot-prop@9.0.0/node_modules/dot-prop/index.js"() {
    init_import_meta_url();
    isObject3 = /* @__PURE__ */ __name((value) => {
      const type = typeof value;
      return value !== null && (type === "object" || type === "function");
    }, "isObject");
    isEmptyObject = /* @__PURE__ */ __name((value) => isObject3(value) && Object.keys(value).length === 0, "isEmptyObject");
    disallowedKeys = /* @__PURE__ */ new Set([
      "__proto__",
      "prototype",
      "constructor"
    ]);
    digits = new Set("0123456789");
    __name(getPathSegments, "getPathSegments");
    __name(isStringIndex, "isStringIndex");
    __name(assertNotStringIndex, "assertNotStringIndex");
    __name(getProperty, "getProperty");
    __name(setProperty3, "setProperty");
    __name(deleteProperty, "deleteProperty");
    __name(hasProperty3, "hasProperty");
    __name(escapePath, "escapePath");
    __name(entries, "entries");
    __name(stringifyPath, "stringifyPath");
    __name(deepKeysIterator, "deepKeysIterator");
    __name(deepKeys, "deepKeys");
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/build-systems/nx.js
var Nx;
var init_nx = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/build-systems/nx.js"() {
    init_import_meta_url();
    init_get_commands();
    init_detect_workspace();
    init_get_workspace_packages();
    init_build_system();
    Nx = class extends BaseBuildTool {
      static {
        __name(this, "Nx");
      }
      id = "nx";
      name = "Nx";
      configFiles = ["nx.json"];
      logo = {
        default: "/logos/nx/light.svg",
        light: "/logos/nx/light.svg",
        dark: "/logos/nx/dark.svg"
      };
      runFromRoot = true;
      /**
       * if it's an nx integrated setup
       * We need to differentiate as the 'dist' folder is located differently
       * @see https://nx.dev/concepts/integrated-vs-package-based
       */
      isIntegrated = false;
      /** List of target patterns */
      targets = /* @__PURE__ */ new Map();
      /** Retrieves a list of possible commands for a package */
      async getCommands(packagePath) {
        let name2 = this.project.workspace?.getPackage(packagePath)?.name || "";
        const targets = this.targets.get(packagePath) || [];
        const targetNames = targets.map((t13) => t13.name);
        try {
          const packageJSONPath = this.project.resolveFromPackage(packagePath, "package.json");
          const json = await this.project.fs.readJSON(packageJSONPath, { fail: true });
          targetNames.push(...Object.keys(json?.scripts || {}));
          name2 = json.name || "";
        } catch {
        }
        if (name2.length !== 0 && targetNames.length !== 0) {
          return targetNames.map((target) => {
            let type = "unknown";
            if (NPM_DEV_SCRIPTS.includes(target)) {
              type = "dev";
            }
            if (NPM_BUILD_SCRIPTS.includes(target)) {
              type = "build";
            }
            return {
              type,
              command: `nx run ${name2}:${target}`
            };
          });
        }
        return [];
      }
      /** Retrieve the dist directory of a package */
      async getDist(packagePath) {
        if (!this.isIntegrated) {
          return null;
        }
        return this.getOutputFromTarget(packagePath);
      }
      /** Retrieve the overridden port of the nx executor for integrated setups */
      async getPort(packagePath) {
        if (!this.isIntegrated) {
          return null;
        }
        const target = this.targets.get(packagePath)?.find((t13) => NPM_DEV_SCRIPTS.includes(t13.name));
        const executor = this.getExecutorFromTarget(target);
        if (!executor) {
          return null;
        }
        switch (executor) {
          case "@nxtensions/astro:dev":
            return 3e3;
          case "@nx/next:server":
          case "@nrwl/next:server":
          case "@nrwl/web:dev-server":
          case "@nx/webpack:dev-server":
          case "@angular-devkit/build-angular:dev-server":
            return 4200;
          case "@nx-plus/vue:dev-server":
            return 8e3;
          // some targets like run command don't have an executor
          case "nx:run-commands":
          case void 0:
            return null;
          default:
            this.project.report({
              name: "UndetectedExecutor",
              message: `Undetected executor for Nx integrated: ${executor}`
            }, {
              metadata: { executor }
            });
            return null;
        }
      }
      async getOutputFromTarget(packagePath) {
        const { getProperty: getProperty2 } = await Promise.resolve().then(() => (init_dot_prop(), dot_prop_exports));
        try {
          const target = this.targets.get(packagePath)?.find((t13) => t13.name === "build");
          if (target) {
            const pattern = "outputs" in target ? target.outputs?.[0] : target.options?.outputPath;
            if (pattern) {
              const framework = this.project.frameworks?.get(packagePath)?.[0];
              let frameworkDist = "";
              if (framework?.id === "next") {
                frameworkDist = framework.build.directory;
              }
              return this.project.fs.join(pattern.replace("{workspaceRoot}/", "").replace(/\{(.+)\}/g, (_match, group) => getProperty2({ ...target, projectRoot: packagePath }, group)), frameworkDist);
            }
          }
        } catch {
        }
        return this.project.fs.join("dist", packagePath);
      }
      getExecutorFromTarget(target) {
        return target && ("executor" in target ? target.executor : target.builder);
      }
      /** Detects a framework through the executor field in a target */
      async detectFramework(targets) {
        const target = targets.find((t13) => NPM_BUILD_SCRIPTS.includes(t13.name));
        const executor = this.getExecutorFromTarget(target);
        if (!target || !executor) {
          return;
        }
        switch (executor) {
          case "@nrwl/next:build":
          case "@nx/next:build":
            return "next";
          case "@nxtensions/astro:build":
            return "astro";
          case "@nx-plus/vue:browser":
            return "vue";
          case "@angular-devkit/build-angular:browser":
            return "angular";
          case "@nx/webpack:webpack":
          case "@nrwl/web:build":
            if (target.options?.webpackConfig?.includes?.("react")) {
              return "react-static";
            }
            this.project.report({
              name: "UndetectedNrwlWeb",
              message: `Undetected @nrwl/web:build framework: ${JSON.stringify({ target }, null, 2)}`
            });
            return;
          // Non Supported builders that are not deployable
          case "@nx/cypress:cypress":
          case "@nrwl/cypress:cypress":
          case "@nrwl/node:build":
            return;
          case "nx:run-commands":
          case void 0:
            return;
          default:
            this.project.report({
              name: "UndetectedExecutor",
              message: `Undetected executor for Nx integrated: ${executor}`
            }, {
              metadata: { executor }
            });
        }
      }
      /** detect workspace packages with the workspace.json file */
      async detectWorkspaceFile() {
        const fs33 = this.project.fs;
        try {
          const { projects } = await fs33.readJSON(fs33.join(this.project.jsWorkspaceRoot, "workspace.json"), {
            fail: true
          });
          const pkgs = [];
          for (const [key, { root, projectType, architect }] of Object.entries(projects || {})) {
            if (!root || key.endsWith("-e2e") || projectType !== "application") {
              continue;
            }
            const targets = Object.entries(architect || {}).map(([name2, target]) => ({ ...target, name: name2 }));
            const forcedFramework = await this.detectFramework(targets);
            this.targets.set(fs33.join(root), targets);
            pkgs.push({ name: key, path: fs33.join(root), forcedFramework });
          }
          return pkgs;
        } catch {
        }
        return [];
      }
      /** detect workspace packages with the project.json files */
      async detectProjectJson() {
        const fs33 = this.project.fs;
        try {
          const { workspaceLayout } = await fs33.readJSON(fs33.join(this.project.jsWorkspaceRoot, "nx.json"), {
            fail: true
          });
          const appDirs = workspaceLayout?.appsDir ? [workspaceLayout.appsDir] : ["apps", "packages"];
          const identifyPkg = /* @__PURE__ */ __name(async ({ entry, directory, packagePath }) => {
            if (entry === "project.json" && !packagePath.endsWith("-e2e")) {
              try {
                const { projectType, name: name2, targets } = await fs33.readJSON(fs33.join(directory, entry));
                if (projectType === "application") {
                  const targetsWithName = Object.entries(targets || {}).map(([name3, target]) => ({ ...target, name: name3 }));
                  const forcedFramework = await this.detectFramework(targetsWithName);
                  this.targets.set(fs33.join(packagePath), targetsWithName);
                  return { name: name2, path: fs33.join(packagePath), forcedFramework };
                }
              } catch {
              }
            }
            return null;
          }, "identifyPkg");
          const pkgs = await Promise.all(appDirs.map(async (appDir) => findPackages(this.project, appDir, identifyPkg, "*").catch(() => [])));
          return pkgs.flat();
        } catch {
        }
        return [];
      }
      async detect() {
        const detected = await super.detect();
        if (detected) {
          const pkgs = [...await this.detectWorkspaceFile(), ...await this.detectProjectJson()];
          if (pkgs.length) {
            this.isIntegrated = true;
            if (!this.project.workspace) {
              this.project.workspace = new WorkspaceInfo();
              this.project.workspace.isRoot = this.project.jsWorkspaceRoot === this.project.baseDirectory;
              this.project.workspace.rootDir = this.project.jsWorkspaceRoot;
              this.project.workspace.packages = pkgs;
            } else {
              this.project.workspace.packages.push(...pkgs);
            }
            this.project.events.emit("detectWorkspaces", this.project.workspace);
          }
          return this;
        }
      }
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/build-systems/package-managers.js
var PNPM, Yarn, NPM;
var init_package_managers = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/build-systems/package-managers.js"() {
    init_import_meta_url();
    init_get_commands();
    init_build_system();
    PNPM = class extends BaseBuildTool {
      static {
        __name(this, "PNPM");
      }
      id = "pnpm";
      name = "PNPM";
      runFromRoot = true;
      // will be called after the framework detection has run
      async getCommands(packagePath) {
        const { name: name2, scripts } = await this.project.fs.readJSON(this.project.resolveFromPackage(packagePath, "package.json"));
        if (scripts && Object.keys(scripts).length > 0) {
          return Object.entries(scripts).map(([scriptName, value]) => {
            const isBuild = isNpmBuildScript(scriptName, value);
            const isDev = isNpmDevScript(scriptName, value);
            return {
              type: isDev ? "dev" : isBuild ? "build" : "unknown",
              // the ... in the command is telling pnpm to run all dependents first.
              // but we should only do it for building
              command: `pnpm --filter ${name2}${isBuild ? "..." : ""} run ${scriptName}`
            };
          });
        }
        return [];
      }
      async detect() {
        if (this.project.workspace && this.project.packageManager?.name === "pnpm") {
          return this;
        }
      }
    };
    Yarn = class extends BaseBuildTool {
      static {
        __name(this, "Yarn");
      }
      id = "yarn";
      name = "Yarn";
      runFromRoot = true;
      // will be called after the framework detection has run
      async getCommands(packagePath) {
        const { name: name2, scripts } = await this.project.fs.readJSON(this.project.resolveFromPackage(packagePath, "package.json"));
        if (scripts && Object.keys(scripts).length > 0) {
          return Object.entries(scripts).map(([scriptName, value]) => ({
            type: isNpmDevScript(scriptName, value) ? "dev" : isNpmBuildScript(scriptName, value) ? "build" : "unknown",
            command: `yarn workspace ${name2} ${scriptName}`
          }));
        }
        return [];
      }
      async detect() {
        if (this.project.workspace && this.project.packageManager?.name === "yarn") {
          return this;
        }
      }
    };
    NPM = class extends BaseBuildTool {
      static {
        __name(this, "NPM");
      }
      id = "npm";
      name = "NPM";
      runFromRoot = true;
      // will be called after the framework detection has run
      async getCommands(packagePath) {
        const { name: name2, scripts } = await this.project.fs.readJSON(this.project.resolveFromPackage(packagePath, "package.json"));
        if (scripts && Object.keys(scripts).length > 0) {
          return Object.entries(scripts).map(([scriptName, value]) => ({
            type: isNpmDevScript(scriptName, value) ? "dev" : isNpmBuildScript(scriptName, value) ? "build" : "unknown",
            command: `npm --workspace ${name2} run ${scriptName}`
          }));
        }
        return [];
      }
      async detect() {
        if (this.project.workspace && this.project.packageManager?.name === "npm") {
          return this;
        }
      }
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/build-systems/pants.js
var Pants;
var init_pants = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/build-systems/pants.js"() {
    init_import_meta_url();
    init_build_system();
    Pants = class extends BaseBuildTool {
      static {
        __name(this, "Pants");
      }
      id = "pants";
      name = "Pants";
      configFiles = ["pants.toml"];
      async detect() {
        const config = await this.project.fs.findUp(this.configFiles, {
          cwd: this.project.baseDirectory,
          stopAt: this.project.root
        });
        if (config) {
          return this;
        }
      }
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/build-systems/rush.js
var Rush;
var init_rush = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/build-systems/rush.js"() {
    init_import_meta_url();
    init_build_system();
    Rush = class extends BaseBuildTool {
      static {
        __name(this, "Rush");
      }
      id = "rush";
      name = "Rush";
      configFiles = ["rush.json"];
      logo = {
        default: "/logos/rush/light.svg",
        light: "/logos/rush/light.svg",
        dark: "/logos/rush/dark.svg"
      };
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/build-systems/turbo.js
var Turbo;
var init_turbo = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/build-systems/turbo.js"() {
    init_import_meta_url();
    init_get_commands();
    init_build_system();
    Turbo = class extends BaseBuildTool {
      static {
        __name(this, "Turbo");
      }
      id = "turbo";
      name = "TurboRepo";
      configFiles = ["turbo.json"];
      runFromRoot = true;
      logo = {
        default: "/logos/turbo/light.svg",
        light: "/logos/turbo/light.svg",
        dark: "/logos/turbo/dark.svg"
      };
      /** Retrieves a list of possible commands for a package */
      async getCommands(packagePath) {
        const { scripts, name: name2 } = await this.project.fs.readJSON(this.project.resolveFromPackage(packagePath, "package.json"));
        if (name2 && scripts && Object.values(scripts).length) {
          return Object.keys(scripts).map((target) => {
            let type = "unknown";
            if (NPM_DEV_SCRIPTS.includes(target)) {
              type = "dev";
            }
            if (NPM_BUILD_SCRIPTS.includes(target)) {
              type = "build";
            }
            return {
              type,
              command: `turbo run ${target} --filter ${name2}`
            };
          });
        }
        return [];
      }
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/build-systems/index.js
var buildSystems;
var init_build_systems = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/build-systems/index.js"() {
    init_import_meta_url();
    init_bazel();
    init_buck();
    init_gradle();
    init_lage();
    init_lerna();
    init_moon();
    init_nix();
    init_nx();
    init_package_managers();
    init_pants();
    init_rush();
    init_turbo();
    buildSystems = [
      Bazel,
      Buck,
      Gradle,
      Lage,
      Lerna,
      Moon,
      Nix,
      Nx,
      Pants,
      Rush,
      Turbo,
      // JavaScript Package managers that offer building from a workspace
      PNPM,
      NPM,
      Yarn
    ];
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/events.js
var EventEmitter3;
var init_events8 = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/events.js"() {
    init_import_meta_url();
    EventEmitter3 = class {
      static {
        __name(this, "EventEmitter");
      }
      callbacks = /* @__PURE__ */ new Map();
      on(event, callback) {
        if (typeof callback !== "function") {
          throw TypeError("Callback parameter has to be a function.");
        }
        if (!this.callbacks.has(event)) {
          this.callbacks.set(event, []);
        }
        const e10 = this.callbacks.get(event);
        e10?.push(callback);
      }
      async emit(event, data) {
        for (const cb2 of this.callbacks.get(event) || []) {
          await cb2(data);
        }
      }
    };
  }
});

// ../../node_modules/.pnpm/stackframe@1.3.4/node_modules/stackframe/stackframe.js
var require_stackframe = __commonJS({
  "../../node_modules/.pnpm/stackframe@1.3.4/node_modules/stackframe/stackframe.js"(exports, module2) {
    init_import_meta_url();
    (function(root, factory) {
      if (typeof define === "function" && define.amd) {
        define("stackframe", [], factory);
      } else if (typeof exports === "object") {
        module2.exports = factory();
      } else {
        root.StackFrame = factory();
      }
    })(exports, function() {
      function _isNumber(n9) {
        return !isNaN(parseFloat(n9)) && isFinite(n9);
      }
      __name(_isNumber, "_isNumber");
      function _capitalize(str) {
        return str.charAt(0).toUpperCase() + str.substring(1);
      }
      __name(_capitalize, "_capitalize");
      function _getter(p7) {
        return function() {
          return this[p7];
        };
      }
      __name(_getter, "_getter");
      var booleanProps = ["isConstructor", "isEval", "isNative", "isToplevel"];
      var numericProps = ["columnNumber", "lineNumber"];
      var stringProps = ["fileName", "functionName", "source"];
      var arrayProps = ["args"];
      var objectProps = ["evalOrigin"];
      var props = booleanProps.concat(numericProps, stringProps, arrayProps, objectProps);
      function StackFrame(obj) {
        if (!obj) return;
        for (var i8 = 0; i8 < props.length; i8++) {
          if (obj[props[i8]] !== void 0) {
            this["set" + _capitalize(props[i8])](obj[props[i8]]);
          }
        }
      }
      __name(StackFrame, "StackFrame");
      StackFrame.prototype = {
        getArgs: /* @__PURE__ */ __name(function() {
          return this.args;
        }, "getArgs"),
        setArgs: /* @__PURE__ */ __name(function(v8) {
          if (Object.prototype.toString.call(v8) !== "[object Array]") {
            throw new TypeError("Args must be an Array");
          }
          this.args = v8;
        }, "setArgs"),
        getEvalOrigin: /* @__PURE__ */ __name(function() {
          return this.evalOrigin;
        }, "getEvalOrigin"),
        setEvalOrigin: /* @__PURE__ */ __name(function(v8) {
          if (v8 instanceof StackFrame) {
            this.evalOrigin = v8;
          } else if (v8 instanceof Object) {
            this.evalOrigin = new StackFrame(v8);
          } else {
            throw new TypeError("Eval Origin must be an Object or StackFrame");
          }
        }, "setEvalOrigin"),
        toString: /* @__PURE__ */ __name(function() {
          var fileName = this.getFileName() || "";
          var lineNumber = this.getLineNumber() || "";
          var columnNumber = this.getColumnNumber() || "";
          var functionName = this.getFunctionName() || "";
          if (this.getIsEval()) {
            if (fileName) {
              return "[eval] (" + fileName + ":" + lineNumber + ":" + columnNumber + ")";
            }
            return "[eval]:" + lineNumber + ":" + columnNumber;
          }
          if (functionName) {
            return functionName + " (" + fileName + ":" + lineNumber + ":" + columnNumber + ")";
          }
          return fileName + ":" + lineNumber + ":" + columnNumber;
        }, "toString")
      };
      StackFrame.fromString = /* @__PURE__ */ __name(function StackFrame$$fromString(str) {
        var argsStartIndex = str.indexOf("(");
        var argsEndIndex = str.lastIndexOf(")");
        var functionName = str.substring(0, argsStartIndex);
        var args = str.substring(argsStartIndex + 1, argsEndIndex).split(",");
        var locationString = str.substring(argsEndIndex + 1);
        if (locationString.indexOf("@") === 0) {
          var parts = /@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(locationString, "");
          var fileName = parts[1];
          var lineNumber = parts[2];
          var columnNumber = parts[3];
        }
        return new StackFrame({
          functionName,
          args: args || void 0,
          fileName,
          lineNumber: lineNumber || void 0,
          columnNumber: columnNumber || void 0
        });
      }, "StackFrame$$fromString");
      for (var i7 = 0; i7 < booleanProps.length; i7++) {
        StackFrame.prototype["get" + _capitalize(booleanProps[i7])] = _getter(booleanProps[i7]);
        StackFrame.prototype["set" + _capitalize(booleanProps[i7])] = /* @__PURE__ */ function(p7) {
          return function(v8) {
            this[p7] = Boolean(v8);
          };
        }(booleanProps[i7]);
      }
      for (var j7 = 0; j7 < numericProps.length; j7++) {
        StackFrame.prototype["get" + _capitalize(numericProps[j7])] = _getter(numericProps[j7]);
        StackFrame.prototype["set" + _capitalize(numericProps[j7])] = /* @__PURE__ */ function(p7) {
          return function(v8) {
            if (!_isNumber(v8)) {
              throw new TypeError(p7 + " must be a Number");
            }
            this[p7] = Number(v8);
          };
        }(numericProps[j7]);
      }
      for (var k7 = 0; k7 < stringProps.length; k7++) {
        StackFrame.prototype["get" + _capitalize(stringProps[k7])] = _getter(stringProps[k7]);
        StackFrame.prototype["set" + _capitalize(stringProps[k7])] = /* @__PURE__ */ function(p7) {
          return function(v8) {
            this[p7] = String(v8);
          };
        }(stringProps[k7]);
      }
      return StackFrame;
    });
  }
});

// ../../node_modules/.pnpm/error-stack-parser@2.1.4/node_modules/error-stack-parser/error-stack-parser.js
var require_error_stack_parser = __commonJS({
  "../../node_modules/.pnpm/error-stack-parser@2.1.4/node_modules/error-stack-parser/error-stack-parser.js"(exports, module2) {
    init_import_meta_url();
    (function(root, factory) {
      if (typeof define === "function" && define.amd) {
        define("error-stack-parser", ["stackframe"], factory);
      } else if (typeof exports === "object") {
        module2.exports = factory(require_stackframe());
      } else {
        root.ErrorStackParser = factory(root.StackFrame);
      }
    })(exports, /* @__PURE__ */ __name(function ErrorStackParser(StackFrame) {
      var FIREFOX_SAFARI_STACK_REGEXP = /(^|@)\S+:\d+/;
      var CHROME_IE_STACK_REGEXP = /^\s*at .*(\S+:\d+|\(native\))/m;
      var SAFARI_NATIVE_CODE_REGEXP = /^(eval@)?(\[native code])?$/;
      return {
        /**
         * Given an Error object, extract the most information from it.
         *
         * @param {Error} error object
         * @return {Array} of StackFrames
         */
        parse: /* @__PURE__ */ __name(function ErrorStackParser$$parse(error2) {
          if (typeof error2.stacktrace !== "undefined" || typeof error2["opera#sourceloc"] !== "undefined") {
            return this.parseOpera(error2);
          } else if (error2.stack && error2.stack.match(CHROME_IE_STACK_REGEXP)) {
            return this.parseV8OrIE(error2);
          } else if (error2.stack) {
            return this.parseFFOrSafari(error2);
          } else {
            throw new Error("Cannot parse given Error object");
          }
        }, "ErrorStackParser$$parse"),
        // Separate line and column numbers from a string of the form: (URI:Line:Column)
        extractLocation: /* @__PURE__ */ __name(function ErrorStackParser$$extractLocation(urlLike) {
          if (urlLike.indexOf(":") === -1) {
            return [urlLike];
          }
          var regExp = /(.+?)(?::(\d+))?(?::(\d+))?$/;
          var parts = regExp.exec(urlLike.replace(/[()]/g, ""));
          return [parts[1], parts[2] || void 0, parts[3] || void 0];
        }, "ErrorStackParser$$extractLocation"),
        parseV8OrIE: /* @__PURE__ */ __name(function ErrorStackParser$$parseV8OrIE(error2) {
          var filtered = error2.stack.split("\n").filter(function(line) {
            return !!line.match(CHROME_IE_STACK_REGEXP);
          }, this);
          return filtered.map(function(line) {
            if (line.indexOf("(eval ") > -1) {
              line = line.replace(/eval code/g, "eval").replace(/(\(eval at [^()]*)|(,.*$)/g, "");
            }
            var sanitizedLine = line.replace(/^\s+/, "").replace(/\(eval code/g, "(").replace(/^.*?\s+/, "");
            var location = sanitizedLine.match(/ (\(.+\)$)/);
            sanitizedLine = location ? sanitizedLine.replace(location[0], "") : sanitizedLine;
            var locationParts = this.extractLocation(location ? location[1] : sanitizedLine);
            var functionName = location && sanitizedLine || void 0;
            var fileName = ["eval", "<anonymous>"].indexOf(locationParts[0]) > -1 ? void 0 : locationParts[0];
            return new StackFrame({
              functionName,
              fileName,
              lineNumber: locationParts[1],
              columnNumber: locationParts[2],
              source: line
            });
          }, this);
        }, "ErrorStackParser$$parseV8OrIE"),
        parseFFOrSafari: /* @__PURE__ */ __name(function ErrorStackParser$$parseFFOrSafari(error2) {
          var filtered = error2.stack.split("\n").filter(function(line) {
            return !line.match(SAFARI_NATIVE_CODE_REGEXP);
          }, this);
          return filtered.map(function(line) {
            if (line.indexOf(" > eval") > -1) {
              line = line.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g, ":$1");
            }
            if (line.indexOf("@") === -1 && line.indexOf(":") === -1) {
              return new StackFrame({
                functionName: line
              });
            } else {
              var functionNameRegex = /((.*".+"[^@]*)?[^@]*)(?:@)/;
              var matches = line.match(functionNameRegex);
              var functionName = matches && matches[1] ? matches[1] : void 0;
              var locationParts = this.extractLocation(line.replace(functionNameRegex, ""));
              return new StackFrame({
                functionName,
                fileName: locationParts[0],
                lineNumber: locationParts[1],
                columnNumber: locationParts[2],
                source: line
              });
            }
          }, this);
        }, "ErrorStackParser$$parseFFOrSafari"),
        parseOpera: /* @__PURE__ */ __name(function ErrorStackParser$$parseOpera(e10) {
          if (!e10.stacktrace || e10.message.indexOf("\n") > -1 && e10.message.split("\n").length > e10.stacktrace.split("\n").length) {
            return this.parseOpera9(e10);
          } else if (!e10.stack) {
            return this.parseOpera10(e10);
          } else {
            return this.parseOpera11(e10);
          }
        }, "ErrorStackParser$$parseOpera"),
        parseOpera9: /* @__PURE__ */ __name(function ErrorStackParser$$parseOpera9(e10) {
          var lineRE = /Line (\d+).*script (?:in )?(\S+)/i;
          var lines = e10.message.split("\n");
          var result = [];
          for (var i7 = 2, len = lines.length; i7 < len; i7 += 2) {
            var match3 = lineRE.exec(lines[i7]);
            if (match3) {
              result.push(new StackFrame({
                fileName: match3[2],
                lineNumber: match3[1],
                source: lines[i7]
              }));
            }
          }
          return result;
        }, "ErrorStackParser$$parseOpera9"),
        parseOpera10: /* @__PURE__ */ __name(function ErrorStackParser$$parseOpera10(e10) {
          var lineRE = /Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i;
          var lines = e10.stacktrace.split("\n");
          var result = [];
          for (var i7 = 0, len = lines.length; i7 < len; i7 += 2) {
            var match3 = lineRE.exec(lines[i7]);
            if (match3) {
              result.push(
                new StackFrame({
                  functionName: match3[3] || void 0,
                  fileName: match3[2],
                  lineNumber: match3[1],
                  source: lines[i7]
                })
              );
            }
          }
          return result;
        }, "ErrorStackParser$$parseOpera10"),
        // Opera 10.65+ Error.stack very similar to FF/Safari
        parseOpera11: /* @__PURE__ */ __name(function ErrorStackParser$$parseOpera11(error2) {
          var filtered = error2.stack.split("\n").filter(function(line) {
            return !!line.match(FIREFOX_SAFARI_STACK_REGEXP) && !line.match(/^Error created at/);
          }, this);
          return filtered.map(function(line) {
            var tokens = line.split("@");
            var locationParts = this.extractLocation(tokens.pop());
            var functionCall = tokens.shift() || "";
            var functionName = functionCall.replace(/<anonymous function(: (\w+))?>/, "$2").replace(/\([^)]*\)/g, "") || void 0;
            var argsRaw;
            if (functionCall.match(/\(([^)]*)\)/)) {
              argsRaw = functionCall.replace(/^[^(]+\(([^)]*)\)$/, "$1");
            }
            var args = argsRaw === void 0 || argsRaw === "[arguments not available]" ? void 0 : argsRaw.split(",");
            return new StackFrame({
              functionName,
              args,
              fileName: locationParts[0],
              lineNumber: locationParts[1],
              columnNumber: locationParts[2],
              source: line
            });
          }, this);
        }, "ErrorStackParser$$parseOpera11")
      };
    }, "ErrorStackParser"));
  }
});

// ../../node_modules/.pnpm/iserror@0.0.2/node_modules/iserror/index.js
var require_iserror = __commonJS({
  "../../node_modules/.pnpm/iserror@0.0.2/node_modules/iserror/index.js"(exports, module2) {
    init_import_meta_url();
    module2.exports = isError2;
    function isError2(value) {
      switch (Object.prototype.toString.call(value)) {
        case "[object Error]":
          return true;
        case "[object Exception]":
          return true;
        case "[object DOMException]":
          return true;
        default:
          return value instanceof Error;
      }
    }
    __name(isError2, "isError");
  }
});

// ../../node_modules/.pnpm/stack-generator@2.0.10/node_modules/stack-generator/stack-generator.js
var require_stack_generator = __commonJS({
  "../../node_modules/.pnpm/stack-generator@2.0.10/node_modules/stack-generator/stack-generator.js"(exports, module2) {
    init_import_meta_url();
    (function(root, factory) {
      if (typeof define === "function" && define.amd) {
        define("stack-generator", ["stackframe"], factory);
      } else if (typeof exports === "object") {
        module2.exports = factory(require_stackframe());
      } else {
        root.StackGenerator = factory(root.StackFrame);
      }
    })(exports, function(StackFrame) {
      return {
        backtrace: /* @__PURE__ */ __name(function StackGenerator$$backtrace(opts) {
          var stack = [];
          var maxStackSize = 10;
          if (typeof opts === "object" && typeof opts.maxStackSize === "number") {
            maxStackSize = opts.maxStackSize;
          }
          var curr = arguments.callee;
          while (curr && stack.length < maxStackSize && curr["arguments"]) {
            var args = new Array(curr["arguments"].length);
            for (var i7 = 0; i7 < args.length; ++i7) {
              args[i7] = curr["arguments"][i7];
            }
            if (/function(?:\s+([\w$]+))+\s*\(/.test(curr.toString())) {
              stack.push(new StackFrame({ functionName: RegExp.$1 || void 0, args }));
            } else {
              stack.push(new StackFrame({ args }));
            }
            try {
              curr = curr.caller;
            } catch (e10) {
              break;
            }
          }
          return stack;
        }, "StackGenerator$$backtrace")
      };
    });
  }
});

// ../../node_modules/.pnpm/wrappy@1.0.2/node_modules/wrappy/wrappy.js
var require_wrappy = __commonJS({
  "../../node_modules/.pnpm/wrappy@1.0.2/node_modules/wrappy/wrappy.js"(exports, module2) {
    init_import_meta_url();
    module2.exports = wrappy;
    function wrappy(fn2, cb2) {
      if (fn2 && cb2) return wrappy(fn2)(cb2);
      if (typeof fn2 !== "function")
        throw new TypeError("need wrapper function");
      Object.keys(fn2).forEach(function(k7) {
        wrapper[k7] = fn2[k7];
      });
      return wrapper;
      function wrapper() {
        var args = new Array(arguments.length);
        for (var i7 = 0; i7 < args.length; i7++) {
          args[i7] = arguments[i7];
        }
        var ret = fn2.apply(this, args);
        var cb3 = args[args.length - 1];
        if (typeof ret === "function" && ret !== cb3) {
          Object.keys(cb3).forEach(function(k7) {
            ret[k7] = cb3[k7];
          });
        }
        return ret;
      }
    }
    __name(wrappy, "wrappy");
  }
});

// ../../node_modules/.pnpm/once@1.4.0/node_modules/once/once.js
var require_once = __commonJS({
  "../../node_modules/.pnpm/once@1.4.0/node_modules/once/once.js"(exports, module2) {
    init_import_meta_url();
    var wrappy = require_wrappy();
    module2.exports = wrappy(once);
    module2.exports.strict = wrappy(onceStrict);
    once.proto = once(function() {
      Object.defineProperty(Function.prototype, "once", {
        value: /* @__PURE__ */ __name(function() {
          return once(this);
        }, "value"),
        configurable: true
      });
      Object.defineProperty(Function.prototype, "onceStrict", {
        value: /* @__PURE__ */ __name(function() {
          return onceStrict(this);
        }, "value"),
        configurable: true
      });
    });
    function once(fn2) {
      var f8 = /* @__PURE__ */ __name(function() {
        if (f8.called) return f8.value;
        f8.called = true;
        return f8.value = fn2.apply(this, arguments);
      }, "f");
      f8.called = false;
      return f8;
    }
    __name(once, "once");
    function onceStrict(fn2) {
      var f8 = /* @__PURE__ */ __name(function() {
        if (f8.called)
          throw new Error(f8.onceError);
        f8.called = true;
        return f8.value = fn2.apply(this, arguments);
      }, "f");
      var name2 = fn2.name || "Function wrapped with `once`";
      f8.onceError = name2 + " shouldn't be called more than once";
      f8.called = false;
      return f8;
    }
    __name(onceStrict, "onceStrict");
  }
});

// ../../node_modules/.pnpm/end-of-stream@1.4.4/node_modules/end-of-stream/index.js
var require_end_of_stream = __commonJS({
  "../../node_modules/.pnpm/end-of-stream@1.4.4/node_modules/end-of-stream/index.js"(exports, module2) {
    init_import_meta_url();
    var once = require_once();
    var noop = /* @__PURE__ */ __name(function() {
    }, "noop");
    var isRequest2 = /* @__PURE__ */ __name(function(stream2) {
      return stream2.setHeader && typeof stream2.abort === "function";
    }, "isRequest");
    var isChildProcess = /* @__PURE__ */ __name(function(stream2) {
      return stream2.stdio && Array.isArray(stream2.stdio) && stream2.stdio.length === 3;
    }, "isChildProcess");
    var eos = /* @__PURE__ */ __name(function(stream2, opts, callback) {
      if (typeof opts === "function") return eos(stream2, null, opts);
      if (!opts) opts = {};
      callback = once(callback || noop);
      var ws = stream2._writableState;
      var rs = stream2._readableState;
      var readable = opts.readable || opts.readable !== false && stream2.readable;
      var writable = opts.writable || opts.writable !== false && stream2.writable;
      var cancelled = false;
      var onlegacyfinish = /* @__PURE__ */ __name(function() {
        if (!stream2.writable) onfinish();
      }, "onlegacyfinish");
      var onfinish = /* @__PURE__ */ __name(function() {
        writable = false;
        if (!readable) callback.call(stream2);
      }, "onfinish");
      var onend = /* @__PURE__ */ __name(function() {
        readable = false;
        if (!writable) callback.call(stream2);
      }, "onend");
      var onexit = /* @__PURE__ */ __name(function(exitCode) {
        callback.call(stream2, exitCode ? new Error("exited with error code: " + exitCode) : null);
      }, "onexit");
      var onerror = /* @__PURE__ */ __name(function(err) {
        callback.call(stream2, err);
      }, "onerror");
      var onclose = /* @__PURE__ */ __name(function() {
        process.nextTick(onclosenexttick);
      }, "onclose");
      var onclosenexttick = /* @__PURE__ */ __name(function() {
        if (cancelled) return;
        if (readable && !(rs && (rs.ended && !rs.destroyed))) return callback.call(stream2, new Error("premature close"));
        if (writable && !(ws && (ws.ended && !ws.destroyed))) return callback.call(stream2, new Error("premature close"));
      }, "onclosenexttick");
      var onrequest = /* @__PURE__ */ __name(function() {
        stream2.req.on("finish", onfinish);
      }, "onrequest");
      if (isRequest2(stream2)) {
        stream2.on("complete", onfinish);
        stream2.on("abort", onclose);
        if (stream2.req) onrequest();
        else stream2.on("request", onrequest);
      } else if (writable && !ws) {
        stream2.on("end", onlegacyfinish);
        stream2.on("close", onlegacyfinish);
      }
      if (isChildProcess(stream2)) stream2.on("exit", onexit);
      stream2.on("end", onend);
      stream2.on("finish", onfinish);
      if (opts.error !== false) stream2.on("error", onerror);
      stream2.on("close", onclose);
      return function() {
        cancelled = true;
        stream2.removeListener("complete", onfinish);
        stream2.removeListener("abort", onclose);
        stream2.removeListener("request", onrequest);
        if (stream2.req) stream2.req.removeListener("finish", onfinish);
        stream2.removeListener("end", onlegacyfinish);
        stream2.removeListener("close", onlegacyfinish);
        stream2.removeListener("finish", onfinish);
        stream2.removeListener("exit", onexit);
        stream2.removeListener("end", onend);
        stream2.removeListener("error", onerror);
        stream2.removeListener("close", onclose);
      };
    }, "eos");
    module2.exports = eos;
  }
});

// ../../node_modules/.pnpm/pump@3.0.0/node_modules/pump/index.js
var require_pump = __commonJS({
  "../../node_modules/.pnpm/pump@3.0.0/node_modules/pump/index.js"(exports, module2) {
    init_import_meta_url();
    var once = require_once();
    var eos = require_end_of_stream();
    var fs33 = __require("fs");
    var noop = /* @__PURE__ */ __name(function() {
    }, "noop");
    var ancient = /^v?\.0/.test(process.version);
    var isFn = /* @__PURE__ */ __name(function(fn2) {
      return typeof fn2 === "function";
    }, "isFn");
    var isFS = /* @__PURE__ */ __name(function(stream2) {
      if (!ancient) return false;
      if (!fs33) return false;
      return (stream2 instanceof (fs33.ReadStream || noop) || stream2 instanceof (fs33.WriteStream || noop)) && isFn(stream2.close);
    }, "isFS");
    var isRequest2 = /* @__PURE__ */ __name(function(stream2) {
      return stream2.setHeader && isFn(stream2.abort);
    }, "isRequest");
    var destroyer = /* @__PURE__ */ __name(function(stream2, reading, writing, callback) {
      callback = once(callback);
      var closed = false;
      stream2.on("close", function() {
        closed = true;
      });
      eos(stream2, { 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 (isFS(stream2)) return stream2.close(noop);
        if (isRequest2(stream2)) return stream2.abort();
        if (isFn(stream2.destroy)) return stream2.destroy();
        callback(err || new Error("stream was destroyed"));
      };
    }, "destroyer");
    var call = /* @__PURE__ */ __name(function(fn2) {
      fn2();
    }, "call");
    var pipe = /* @__PURE__ */ __name(function(from, to) {
      return from.pipe(to);
    }, "pipe");
    var pump = /* @__PURE__ */ __name(function() {
      var streams = Array.prototype.slice.call(arguments);
      var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop;
      if (Array.isArray(streams[0])) streams = streams[0];
      if (streams.length < 2) throw new Error("pump requires two streams per minimum");
      var error2;
      var destroys = streams.map(function(stream2, i7) {
        var reading = i7 < streams.length - 1;
        var writing = i7 > 0;
        return destroyer(stream2, reading, writing, function(err) {
          if (!error2) error2 = err;
          if (err) destroys.forEach(call);
          if (reading) return;
          destroys.forEach(call);
          callback(error2);
        });
      });
      return streams.reduce(pipe);
    }, "pump");
    module2.exports = pump;
  }
});

// ../../node_modules/.pnpm/byline@5.0.0/node_modules/byline/lib/byline.js
var require_byline = __commonJS({
  "../../node_modules/.pnpm/byline@5.0.0/node_modules/byline/lib/byline.js"(exports, module2) {
    init_import_meta_url();
    var stream2 = __require("stream");
    var util5 = __require("util");
    var timers = __require("timers");
    module2.exports = function(readStream, options) {
      return module2.exports.createStream(readStream, options);
    };
    module2.exports.createStream = function(readStream, options) {
      if (readStream) {
        return createLineStream(readStream, options);
      } else {
        return new LineStream(options);
      }
    };
    module2.exports.createLineStream = function(readStream) {
      console.log("WARNING: byline#createLineStream is deprecated and will be removed soon");
      return createLineStream(readStream);
    };
    function createLineStream(readStream, options) {
      if (!readStream) {
        throw new Error("expected readStream");
      }
      if (!readStream.readable) {
        throw new Error("readStream must be readable");
      }
      var ls = new LineStream(options);
      readStream.pipe(ls);
      return ls;
    }
    __name(createLineStream, "createLineStream");
    module2.exports.LineStream = LineStream;
    function LineStream(options) {
      stream2.Transform.call(this, options);
      options = options || {};
      this._readableState.objectMode = true;
      this._lineBuffer = [];
      this._keepEmptyLines = options.keepEmptyLines || false;
      this._lastChunkEndedWithCR = false;
      var self2 = this;
      this.on("pipe", function(src) {
        if (!self2.encoding) {
          if (src instanceof stream2.Readable) {
            self2.encoding = src._readableState.encoding;
          }
        }
      });
    }
    __name(LineStream, "LineStream");
    util5.inherits(LineStream, stream2.Transform);
    LineStream.prototype._transform = function(chunk, encoding, done) {
      encoding = encoding || "utf8";
      if (Buffer.isBuffer(chunk)) {
        if (encoding == "buffer") {
          chunk = chunk.toString();
          encoding = "utf8";
        } else {
          chunk = chunk.toString(encoding);
        }
      }
      this._chunkEncoding = encoding;
      var lines = chunk.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/g);
      if (this._lastChunkEndedWithCR && chunk[0] == "\n") {
        lines.shift();
      }
      if (this._lineBuffer.length > 0) {
        this._lineBuffer[this._lineBuffer.length - 1] += lines[0];
        lines.shift();
      }
      this._lastChunkEndedWithCR = chunk[chunk.length - 1] == "\r";
      this._lineBuffer = this._lineBuffer.concat(lines);
      this._pushBuffer(encoding, 1, done);
    };
    LineStream.prototype._pushBuffer = function(encoding, keep, done) {
      while (this._lineBuffer.length > keep) {
        var line = this._lineBuffer.shift();
        if (this._keepEmptyLines || line.length > 0) {
          if (!this.push(this._reencode(line, encoding))) {
            var self2 = this;
            timers.setImmediate(function() {
              self2._pushBuffer(encoding, keep, done);
            });
            return;
          }
        }
      }
      done();
    };
    LineStream.prototype._flush = function(done) {
      this._pushBuffer(this._chunkEncoding, 0, done);
    };
    LineStream.prototype._reencode = function(line, chunkEncoding) {
      if (this.encoding && this.encoding != chunkEncoding) {
        return new Buffer(line, chunkEncoding).toString(this.encoding);
      } else if (this.encoding) {
        return line;
      } else {
        return new Buffer(line, chunkEncoding);
      }
    };
  }
});

// ../../node_modules/.pnpm/@bugsnag+node@8.6.0/node_modules/@bugsnag/node/dist/bugsnag.js
var require_bugsnag = __commonJS({
  "../../node_modules/.pnpm/@bugsnag+node@8.6.0/node_modules/@bugsnag/node/dist/bugsnag.js"(exports, module2) {
    init_import_meta_url();
    (function(f8) {
      if (typeof exports === "object" && typeof module2 !== "undefined") {
        module2.exports = f8();
      } else if (typeof define === "function" && define.amd) {
        define([], f8);
      } else {
        var g7;
        if (typeof window !== "undefined") {
          g7 = window;
        } else if (typeof global !== "undefined") {
          g7 = global;
        } else if (typeof self !== "undefined") {
          g7 = self;
        } else {
          g7 = this;
        }
        g7.bugsnag = f8();
      }
    })(function() {
      var Breadcrumb = /* @__PURE__ */ function() {
        function Breadcrumb2(message, metadata, type, timestamp) {
          if (timestamp === void 0) {
            timestamp = /* @__PURE__ */ new Date();
          }
          this.type = type;
          this.message = message;
          this.metadata = metadata;
          this.timestamp = timestamp;
        }
        __name(Breadcrumb2, "Breadcrumb");
        var _proto = Breadcrumb2.prototype;
        _proto.toJSON = /* @__PURE__ */ __name(function toJSON() {
          return {
            type: this.type,
            name: this.message,
            timestamp: this.timestamp,
            metaData: this.metadata
          };
        }, "toJSON");
        return Breadcrumb2;
      }();
      var _$Breadcrumb_7 = Breadcrumb;
      var _$breadcrumbTypes_12 = ["navigation", "request", "process", "log", "user", "state", "error", "manual"];
      var _$reduce_22 = /* @__PURE__ */ __name(function(arr, fn2, accum) {
        var val2 = accum;
        for (var i7 = 0, len = arr.length; i7 < len; i7++) val2 = fn2(val2, arr[i7], i7, arr);
        return val2;
      }, "_$reduce_22");
      var _$filter_17 = /* @__PURE__ */ __name(function(arr, fn2) {
        return _$reduce_22(arr, function(accum, item, i7, arr2) {
          return !fn2(item, i7, arr2) ? accum : accum.concat(item);
        }, []);
      }, "_$filter_17");
      var _$includes_18 = /* @__PURE__ */ __name(function(arr, x7) {
        return _$reduce_22(arr, function(accum, item, i7, arr2) {
          return accum === true || item === x7;
        }, false);
      }, "_$includes_18");
      var _$isArray_19 = /* @__PURE__ */ __name(function(obj) {
        return Object.prototype.toString.call(obj) === "[object Array]";
      }, "_$isArray_19");
      var _hasDontEnumBug = !{
        toString: null
      }.propertyIsEnumerable("toString");
      var _dontEnums = ["toString", "toLocaleString", "valueOf", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "constructor"];
      var _$keys_20 = /* @__PURE__ */ __name(function(obj) {
        var result = [];
        var prop;
        for (prop in obj) {
          if (Object.prototype.hasOwnProperty.call(obj, prop)) result.push(prop);
        }
        if (!_hasDontEnumBug) return result;
        for (var i7 = 0, len = _dontEnums.length; i7 < len; i7++) {
          if (Object.prototype.hasOwnProperty.call(obj, _dontEnums[i7])) result.push(_dontEnums[i7]);
        }
        return result;
      }, "_$keys_20");
      var _$intRange_31 = /* @__PURE__ */ __name(function(min, max) {
        if (min === void 0) {
          min = 1;
        }
        if (max === void 0) {
          max = Infinity;
        }
        return function(value) {
          return typeof value === "number" && parseInt("" + value, 10) === value && value >= min && value <= max;
        };
      }, "_$intRange_31");
      var _$listOfFunctions_32 = /* @__PURE__ */ __name(function(value) {
        return typeof value === "function" || _$isArray_19(value) && _$filter_17(value, function(f8) {
          return typeof f8 === "function";
        }).length === value.length;
      }, "_$listOfFunctions_32");
      var _$stringWithLength_33 = /* @__PURE__ */ __name(function(value) {
        return typeof value === "string" && !!value.length;
      }, "_$stringWithLength_33");
      var _$config_9 = {};
      var defaultErrorTypes = /* @__PURE__ */ __name(function() {
        return {
          unhandledExceptions: true,
          unhandledRejections: true
        };
      }, "defaultErrorTypes");
      _$config_9.schema = {
        apiKey: {
          defaultValue: /* @__PURE__ */ __name(function() {
            return null;
          }, "defaultValue"),
          message: "is required",
          validate: _$stringWithLength_33
        },
        appVersion: {
          defaultValue: /* @__PURE__ */ __name(function() {
            return void 0;
          }, "defaultValue"),
          message: "should be a string",
          validate: /* @__PURE__ */ __name(function(value) {
            return value === void 0 || _$stringWithLength_33(value);
          }, "validate")
        },
        appType: {
          defaultValue: /* @__PURE__ */ __name(function() {
            return void 0;
          }, "defaultValue"),
          message: "should be a string",
          validate: /* @__PURE__ */ __name(function(value) {
            return value === void 0 || _$stringWithLength_33(value);
          }, "validate")
        },
        autoDetectErrors: {
          defaultValue: /* @__PURE__ */ __name(function() {
            return true;
          }, "defaultValue"),
          message: "should be true|false",
          validate: /* @__PURE__ */ __name(function(value) {
            return value === true || value === false;
          }, "validate")
        },
        enabledErrorTypes: {
          defaultValue: /* @__PURE__ */ __name(function() {
            return defaultErrorTypes();
          }, "defaultValue"),
          message: "should be an object containing the flags { unhandledExceptions:true|false, unhandledRejections:true|false }",
          allowPartialObject: true,
          validate: /* @__PURE__ */ __name(function(value) {
            if (typeof value !== "object" || !value) return false;
            var providedKeys = _$keys_20(value);
            var defaultKeys = _$keys_20(defaultErrorTypes());
            if (_$filter_17(providedKeys, function(k7) {
              return _$includes_18(defaultKeys, k7);
            }).length < providedKeys.length) return false;
            if (_$filter_17(_$keys_20(value), function(k7) {
              return typeof value[k7] !== "boolean";
            }).length > 0) return false;
            return true;
          }, "validate")
        },
        onError: {
          defaultValue: /* @__PURE__ */ __name(function() {
            return [];
          }, "defaultValue"),
          message: "should be a function or array of functions",
          validate: _$listOfFunctions_32
        },
        onSession: {
          defaultValue: /* @__PURE__ */ __name(function() {
            return [];
          }, "defaultValue"),
          message: "should be a function or array of functions",
          validate: _$listOfFunctions_32
        },
        onBreadcrumb: {
          defaultValue: /* @__PURE__ */ __name(function() {
            return [];
          }, "defaultValue"),
          message: "should be a function or array of functions",
          validate: _$listOfFunctions_32
        },
        endpoints: {
          defaultValue: /* @__PURE__ */ __name(function(endpoints) {
            if (typeof endpoints === "undefined") {
              return {
                notify: "https://notify.bugsnag.com",
                sessions: "https://sessions.bugsnag.com"
              };
            } else {
              return {
                notify: null,
                sessions: null
              };
            }
          }, "defaultValue"),
          message: "should be an object containing endpoint URLs { notify, sessions }",
          validate: /* @__PURE__ */ __name(function(val2) {
            return (
              // first, ensure it's an object
              val2 && typeof val2 === "object" && // notify and sessions must always be set
              _$stringWithLength_33(val2.notify) && _$stringWithLength_33(val2.sessions) && // ensure no keys other than notify/session are set on endpoints object
              _$filter_17(_$keys_20(val2), function(k7) {
                return !_$includes_18(["notify", "sessions"], k7);
              }).length === 0
            );
          }, "validate")
        },
        autoTrackSessions: {
          defaultValue: /* @__PURE__ */ __name(function(val2) {
            return true;
          }, "defaultValue"),
          message: "should be true|false",
          validate: /* @__PURE__ */ __name(function(val2) {
            return val2 === true || val2 === false;
          }, "validate")
        },
        enabledReleaseStages: {
          defaultValue: /* @__PURE__ */ __name(function() {
            return null;
          }, "defaultValue"),
          message: "should be an array of strings",
          validate: /* @__PURE__ */ __name(function(value) {
            return value === null || _$isArray_19(value) && _$filter_17(value, function(f8) {
              return typeof f8 === "string";
            }).length === value.length;
          }, "validate")
        },
        releaseStage: {
          defaultValue: /* @__PURE__ */ __name(function() {
            return "production";
          }, "defaultValue"),
          message: "should be a string",
          validate: /* @__PURE__ */ __name(function(value) {
            return typeof value === "string" && value.length;
          }, "validate")
        },
        maxBreadcrumbs: {
          defaultValue: /* @__PURE__ */ __name(function() {
            return 25;
          }, "defaultValue"),
          message: "should be a number \u2264100",
          validate: /* @__PURE__ */ __name(function(value) {
            return _$intRange_31(0, 100)(value);
          }, "validate")
        },
        enabledBreadcrumbTypes: {
          defaultValue: /* @__PURE__ */ __name(function() {
            return _$breadcrumbTypes_12;
          }, "defaultValue"),
          message: "should be null or a list of available breadcrumb types (" + _$breadcrumbTypes_12.join(",") + ")",
          validate: /* @__PURE__ */ __name(function(value) {
            return value === null || _$isArray_19(value) && _$reduce_22(value, function(accum, maybeType) {
              if (accum === false) return accum;
              return _$includes_18(_$breadcrumbTypes_12, maybeType);
            }, true);
          }, "validate")
        },
        context: {
          defaultValue: /* @__PURE__ */ __name(function() {
            return void 0;
          }, "defaultValue"),
          message: "should be a string",
          validate: /* @__PURE__ */ __name(function(value) {
            return value === void 0 || typeof value === "string";
          }, "validate")
        },
        user: {
          defaultValue: /* @__PURE__ */ __name(function() {
            return {};
          }, "defaultValue"),
          message: "should be an object with { id, email, name } properties",
          validate: /* @__PURE__ */ __name(function(value) {
            return value === null || value && _$reduce_22(_$keys_20(value), function(accum, key) {
              return accum && _$includes_18(["id", "email", "name"], key);
            }, true);
          }, "validate")
        },
        metadata: {
          defaultValue: /* @__PURE__ */ __name(function() {
            return {};
          }, "defaultValue"),
          message: "should be an object",
          validate: /* @__PURE__ */ __name(function(value) {
            return typeof value === "object" && value !== null;
          }, "validate")
        },
        logger: {
          defaultValue: /* @__PURE__ */ __name(function() {
            return void 0;
          }, "defaultValue"),
          message: "should be null or an object with methods { debug, info, warn, error }",
          validate: /* @__PURE__ */ __name(function(value) {
            return !value || value && _$reduce_22(["debug", "info", "warn", "error"], function(accum, method) {
              return accum && typeof value[method] === "function";
            }, true);
          }, "validate")
        },
        redactedKeys: {
          defaultValue: /* @__PURE__ */ __name(function() {
            return ["password"];
          }, "defaultValue"),
          message: "should be an array of strings|regexes",
          validate: /* @__PURE__ */ __name(function(value) {
            return _$isArray_19(value) && value.length === _$filter_17(value, function(s7) {
              return typeof s7 === "string" || s7 && typeof s7.test === "function";
            }).length;
          }, "validate")
        },
        plugins: {
          defaultValue: /* @__PURE__ */ __name(function() {
            return [];
          }, "defaultValue"),
          message: "should be an array of plugin objects",
          validate: /* @__PURE__ */ __name(function(value) {
            return _$isArray_19(value) && value.length === _$filter_17(value, function(p7) {
              return p7 && typeof p7 === "object" && typeof p7.load === "function";
            }).length;
          }, "validate")
        },
        featureFlags: {
          defaultValue: /* @__PURE__ */ __name(function() {
            return [];
          }, "defaultValue"),
          message: 'should be an array of objects that have a "name" property',
          validate: /* @__PURE__ */ __name(function(value) {
            return _$isArray_19(value) && value.length === _$filter_17(value, function(feature) {
              return feature && typeof feature === "object" && typeof feature.name === "string";
            }).length;
          }, "validate")
        },
        reportUnhandledPromiseRejectionsAsHandled: {
          defaultValue: /* @__PURE__ */ __name(function() {
            return false;
          }, "defaultValue"),
          message: "should be true|false",
          validate: /* @__PURE__ */ __name(function(value) {
            return value === true || value === false;
          }, "validate")
        },
        sendPayloadChecksums: {
          defaultValue: /* @__PURE__ */ __name(function() {
            return false;
          }, "defaultValue"),
          message: "should be true|false",
          validate: /* @__PURE__ */ __name(function(value) {
            return value === true || value === false;
          }, "validate")
        }
      };
      var _$errorStackParser_15 = require_error_stack_parser();
      var _$assign_16 = /* @__PURE__ */ __name(function(target) {
        for (var i7 = 1; i7 < arguments.length; i7++) {
          var source = arguments[i7];
          for (var key in source) {
            if (Object.prototype.hasOwnProperty.call(source, key)) {
              target[key] = source[key];
            }
          }
        }
        return target;
      }, "_$assign_16");
      var _$map_21 = /* @__PURE__ */ __name(function(arr, fn2) {
        return _$reduce_22(arr, function(accum, item, i7, arr2) {
          return accum.concat(fn2(item, i7, arr2));
        }, []);
      }, "_$map_21");
      var _$safeJsonStringify_5 = /* @__PURE__ */ __name(function(data, replacer2, space2, opts) {
        var redactedKeys = opts && opts.redactedKeys ? opts.redactedKeys : [];
        var redactedPaths = opts && opts.redactedPaths ? opts.redactedPaths : [];
        return JSON.stringify(prepareObjForSerialization(data, redactedKeys, redactedPaths), replacer2, space2);
      }, "_$safeJsonStringify_5");
      var MAX_DEPTH = 20;
      var MAX_EDGES = 25e3;
      var MIN_PRESERVED_DEPTH = 8;
      var REPLACEMENT_NODE = "...";
      function isError2(o7) {
        return o7 instanceof Error || /^\[object (Error|(Dom)?Exception)\]$/.test(Object.prototype.toString.call(o7));
      }
      __name(isError2, "isError");
      function throwsMessage(err) {
        return "[Throws: " + (err ? err.message : "?") + "]";
      }
      __name(throwsMessage, "throwsMessage");
      function find2(haystack, needle) {
        for (var i7 = 0, len = haystack.length; i7 < len; i7++) {
          if (haystack[i7] === needle) return true;
        }
        return false;
      }
      __name(find2, "find");
      function isDescendent(paths, path85) {
        for (var i7 = 0, len = paths.length; i7 < len; i7++) {
          if (path85.indexOf(paths[i7]) === 0) return true;
        }
        return false;
      }
      __name(isDescendent, "isDescendent");
      function shouldRedact(patterns, key) {
        for (var i7 = 0, len = patterns.length; i7 < len; i7++) {
          if (typeof patterns[i7] === "string" && patterns[i7].toLowerCase() === key.toLowerCase()) return true;
          if (patterns[i7] && typeof patterns[i7].test === "function" && patterns[i7].test(key)) return true;
        }
        return false;
      }
      __name(shouldRedact, "shouldRedact");
      function __isArray_5(obj) {
        return Object.prototype.toString.call(obj) === "[object Array]";
      }
      __name(__isArray_5, "__isArray_5");
      function safelyGetProp(obj, prop) {
        try {
          return obj[prop];
        } catch (err) {
          return throwsMessage(err);
        }
      }
      __name(safelyGetProp, "safelyGetProp");
      function prepareObjForSerialization(obj, redactedKeys, redactedPaths) {
        var seen = [];
        var edges = 0;
        function visit5(obj2, path85) {
          function edgesExceeded() {
            return path85.length > MIN_PRESERVED_DEPTH && edges > MAX_EDGES;
          }
          __name(edgesExceeded, "edgesExceeded");
          edges++;
          if (path85.length > MAX_DEPTH) return REPLACEMENT_NODE;
          if (edgesExceeded()) return REPLACEMENT_NODE;
          if (obj2 === null || typeof obj2 !== "object") return obj2;
          if (find2(seen, obj2)) return "[Circular]";
          seen.push(obj2);
          if (typeof obj2.toJSON === "function") {
            try {
              edges--;
              var fResult = visit5(obj2.toJSON(), path85);
              seen.pop();
              return fResult;
            } catch (err) {
              return throwsMessage(err);
            }
          }
          var er2 = isError2(obj2);
          if (er2) {
            edges--;
            var eResult = visit5({
              name: obj2.name,
              message: obj2.message
            }, path85);
            seen.pop();
            return eResult;
          }
          if (__isArray_5(obj2)) {
            var aResult = [];
            for (var i7 = 0, len = obj2.length; i7 < len; i7++) {
              if (edgesExceeded()) {
                aResult.push(REPLACEMENT_NODE);
                break;
              }
              aResult.push(visit5(obj2[i7], path85.concat("[]")));
            }
            seen.pop();
            return aResult;
          }
          var result = {};
          try {
            for (var prop in obj2) {
              if (!Object.prototype.hasOwnProperty.call(obj2, prop)) continue;
              if (isDescendent(redactedPaths, path85.join(".")) && shouldRedact(redactedKeys, prop)) {
                result[prop] = "[REDACTED]";
                continue;
              }
              if (edgesExceeded()) {
                result[prop] = REPLACEMENT_NODE;
                break;
              }
              result[prop] = visit5(safelyGetProp(obj2, prop), path85.concat(prop));
            }
          } catch (e10) {
          }
          seen.pop();
          return result;
        }
        __name(visit5, "visit");
        return visit5(obj, []);
      }
      __name(prepareObjForSerialization, "prepareObjForSerialization");
      function add(existingFeatures, existingFeatureKeys, name3, variant) {
        if (typeof name3 !== "string") {
          return;
        }
        if (variant === void 0) {
          variant = null;
        } else if (variant !== null && typeof variant !== "string") {
          variant = _$safeJsonStringify_5(variant);
        }
        var existingIndex = existingFeatureKeys[name3];
        if (typeof existingIndex === "number") {
          existingFeatures[existingIndex] = {
            name: name3,
            variant
          };
          return;
        }
        existingFeatures.push({
          name: name3,
          variant
        });
        existingFeatureKeys[name3] = existingFeatures.length - 1;
      }
      __name(add, "add");
      function merge(existingFeatures, newFeatures, existingFeatureKeys) {
        if (!_$isArray_19(newFeatures)) {
          return;
        }
        for (var i7 = 0; i7 < newFeatures.length; ++i7) {
          var feature = newFeatures[i7];
          if (feature === null || typeof feature !== "object") {
            continue;
          }
          add(existingFeatures, existingFeatureKeys, feature.name, feature.variant);
        }
        return existingFeatures;
      }
      __name(merge, "merge");
      function toEventApi(featureFlags) {
        return _$map_21(_$filter_17(featureFlags, Boolean), function(_ref) {
          var name3 = _ref.name, variant = _ref.variant;
          var flag = {
            featureFlag: name3
          };
          if (typeof variant === "string") {
            flag.variant = variant;
          }
          return flag;
        });
      }
      __name(toEventApi, "toEventApi");
      function clear(features, featuresIndex, name3) {
        var existingIndex = featuresIndex[name3];
        if (typeof existingIndex === "number") {
          features[existingIndex] = null;
          delete featuresIndex[name3];
        }
      }
      __name(clear, "clear");
      var _$featureFlagDelegate_23 = {
        add,
        clear,
        merge,
        toEventApi
      };
      var _$hasStack_24 = /* @__PURE__ */ __name(function(err) {
        return !!err && (!!err.stack || !!err.stacktrace || !!err["opera#sourceloc"]) && typeof (err.stack || err.stacktrace || err["opera#sourceloc"]) === "string" && err.stack !== err.name + ": " + err.message;
      }, "_$hasStack_24");
      var _$iserror_25 = require_iserror();
      var __add_27 = /* @__PURE__ */ __name(function(state2, section, keyOrObj, maybeVal) {
        var _updates;
        if (!section) return;
        var updates;
        if (keyOrObj === null) return __clear_27(state2, section);
        if (typeof keyOrObj === "object") updates = keyOrObj;
        if (typeof keyOrObj === "string") updates = (_updates = {}, _updates[keyOrObj] = maybeVal, _updates);
        if (!updates) return;
        if (section === "__proto__" || section === "constructor" || section === "prototype") {
          return;
        }
        if (!state2[section]) state2[section] = {};
        state2[section] = _$assign_16({}, state2[section], updates);
      }, "__add_27");
      var get2 = /* @__PURE__ */ __name(function(state2, section, key) {
        if (typeof section !== "string") return void 0;
        if (!key) {
          return state2[section];
        }
        if (state2[section]) {
          return state2[section][key];
        }
        return void 0;
      }, "get");
      var __clear_27 = /* @__PURE__ */ __name(function(state2, section, key) {
        if (typeof section !== "string") return;
        if (!key) {
          delete state2[section];
          return;
        }
        if (section === "__proto__" || section === "constructor" || section === "prototype") {
          return;
        }
        if (state2[section]) {
          delete state2[section][key];
        }
      }, "__clear_27");
      var _$metadataDelegate_27 = {
        add: __add_27,
        get: get2,
        clear: __clear_27
      };
      function _extends() {
        return _extends = Object.assign ? Object.assign.bind() : function(n9) {
          for (var e10 = 1; e10 < arguments.length; e10++) {
            var t13 = arguments[e10];
            for (var r10 in t13) ({}).hasOwnProperty.call(t13, r10) && (n9[r10] = t13[r10]);
          }
          return n9;
        }, _extends.apply(null, arguments);
      }
      __name(_extends, "_extends");
      var StackGenerator = require_stack_generator();
      var Event2 = /* @__PURE__ */ function() {
        function Event3(errorClass, errorMessage, stacktrace, handledState, originalError) {
          if (stacktrace === void 0) {
            stacktrace = [];
          }
          if (handledState === void 0) {
            handledState = defaultHandledState();
          }
          this.apiKey = void 0;
          this.context = void 0;
          this.groupingHash = void 0;
          this.originalError = originalError;
          this._handledState = handledState;
          this.severity = this._handledState.severity;
          this.unhandled = this._handledState.unhandled;
          this.app = {};
          this.device = {};
          this.request = {};
          this.breadcrumbs = [];
          this.threads = [];
          this._metadata = {};
          this._features = [];
          this._featuresIndex = {};
          this._user = {};
          this._session = void 0;
          this._correlation = void 0;
          this._groupingDiscriminator = void 0;
          this.errors = [createBugsnagError(errorClass, errorMessage, Event3.__type, stacktrace)];
        }
        __name(Event3, "Event");
        var _proto = Event3.prototype;
        _proto.addMetadata = /* @__PURE__ */ __name(function addMetadata(section, keyOrObj, maybeVal) {
          return _$metadataDelegate_27.add(this._metadata, section, keyOrObj, maybeVal);
        }, "addMetadata");
        _proto.setTraceCorrelation = /* @__PURE__ */ __name(function setTraceCorrelation(traceId, spanId) {
          if (typeof traceId === "string") {
            this._correlation = _extends({
              traceId
            }, typeof spanId === "string" ? {
              spanId
            } : {});
          }
        }, "setTraceCorrelation");
        _proto.getGroupingDiscriminator = /* @__PURE__ */ __name(function getGroupingDiscriminator() {
          return this._groupingDiscriminator;
        }, "getGroupingDiscriminator");
        _proto.setGroupingDiscriminator = /* @__PURE__ */ __name(function setGroupingDiscriminator(value) {
          var previousValue = this._groupingDiscriminator;
          if (typeof value === "string" || value === null || value === void 0) this._groupingDiscriminator = value;
          return previousValue;
        }, "setGroupingDiscriminator");
        _proto.getMetadata = /* @__PURE__ */ __name(function getMetadata(section, key) {
          return _$metadataDelegate_27.get(this._metadata, section, key);
        }, "getMetadata");
        _proto.clearMetadata = /* @__PURE__ */ __name(function clearMetadata(section, key) {
          return _$metadataDelegate_27.clear(this._metadata, section, key);
        }, "clearMetadata");
        _proto.addFeatureFlag = /* @__PURE__ */ __name(function addFeatureFlag(name3, variant) {
          if (variant === void 0) {
            variant = null;
          }
          _$featureFlagDelegate_23.add(this._features, this._featuresIndex, name3, variant);
        }, "addFeatureFlag");
        _proto.addFeatureFlags = /* @__PURE__ */ __name(function addFeatureFlags(featureFlags) {
          _$featureFlagDelegate_23.merge(this._features, featureFlags, this._featuresIndex);
        }, "addFeatureFlags");
        _proto.getFeatureFlags = /* @__PURE__ */ __name(function getFeatureFlags() {
          return _$featureFlagDelegate_23.toEventApi(this._features);
        }, "getFeatureFlags");
        _proto.clearFeatureFlag = /* @__PURE__ */ __name(function clearFeatureFlag(name3) {
          _$featureFlagDelegate_23.clear(this._features, this._featuresIndex, name3);
        }, "clearFeatureFlag");
        _proto.clearFeatureFlags = /* @__PURE__ */ __name(function clearFeatureFlags() {
          this._features = [];
          this._featuresIndex = {};
        }, "clearFeatureFlags");
        _proto.getUser = /* @__PURE__ */ __name(function getUser() {
          return this._user;
        }, "getUser");
        _proto.setUser = /* @__PURE__ */ __name(function setUser2(id, email, name3) {
          this._user = {
            id,
            email,
            name: name3
          };
        }, "setUser");
        _proto.toJSON = /* @__PURE__ */ __name(function toJSON() {
          return {
            payloadVersion: "4",
            exceptions: _$map_21(this.errors, function(er2) {
              return _$assign_16({}, er2, {
                message: er2.errorMessage
              });
            }),
            severity: this.severity,
            unhandled: this._handledState.unhandled,
            severityReason: this._handledState.severityReason,
            app: this.app,
            device: this.device,
            request: this.request,
            breadcrumbs: this.breadcrumbs,
            context: this.context,
            groupingHash: this.groupingHash,
            groupingDiscriminator: this._groupingDiscriminator,
            metaData: this._metadata,
            user: this._user,
            session: this._session,
            featureFlags: this.getFeatureFlags(),
            correlation: this._correlation
          };
        }, "toJSON");
        return Event3;
      }();
      var formatStackframe = /* @__PURE__ */ __name(function(frame) {
        var f8 = {
          file: frame.fileName,
          method: normaliseFunctionName(frame.functionName),
          lineNumber: frame.lineNumber,
          columnNumber: frame.columnNumber,
          code: void 0,
          inProject: void 0
        };
        if (f8.lineNumber > -1 && !f8.file && !f8.method) {
          f8.file = "global code";
        }
        return f8;
      }, "formatStackframe");
      var normaliseFunctionName = /* @__PURE__ */ __name(function(name3) {
        return /^global code$/i.test(name3) ? "global code" : name3;
      }, "normaliseFunctionName");
      var defaultHandledState = /* @__PURE__ */ __name(function() {
        return {
          unhandled: false,
          severity: "warning",
          severityReason: {
            type: "handledException"
          }
        };
      }, "defaultHandledState");
      var ensureString = /* @__PURE__ */ __name(function(str) {
        return typeof str === "string" ? str : "";
      }, "ensureString");
      function createBugsnagError(errorClass, errorMessage, type, stacktrace) {
        return {
          errorClass: ensureString(errorClass),
          errorMessage: ensureString(errorMessage),
          type,
          stacktrace: _$reduce_22(stacktrace, function(accum, frame) {
            var f8 = formatStackframe(frame);
            try {
              if (JSON.stringify(f8) === "{}") return accum;
              return accum.concat(f8);
            } catch (e10) {
              return accum;
            }
          }, [])
        };
      }
      __name(createBugsnagError, "createBugsnagError");
      function getCauseStack(error2) {
        if (error2.cause) {
          return [error2].concat(getCauseStack(error2.cause));
        } else {
          return [error2];
        }
      }
      __name(getCauseStack, "getCauseStack");
      Event2.getStacktrace = function(error2, errorFramesToSkip, backtraceFramesToSkip) {
        if (_$hasStack_24(error2)) return _$errorStackParser_15.parse(error2).slice(errorFramesToSkip);
        try {
          return _$filter_17(StackGenerator.backtrace(), function(frame) {
            return (frame.functionName || "").indexOf("StackGenerator$$") === -1;
          }).slice(1 + backtraceFramesToSkip);
        } catch (e10) {
          return [];
        }
      };
      Event2.create = function(maybeError, tolerateNonErrors, handledState, component, errorFramesToSkip, logger4) {
        if (errorFramesToSkip === void 0) {
          errorFramesToSkip = 0;
        }
        var _normaliseError = normaliseError(maybeError, tolerateNonErrors, component, logger4), error2 = _normaliseError[0], internalFrames = _normaliseError[1];
        var event;
        try {
          var stacktrace = Event2.getStacktrace(
            error2,
            // if an error was created/throw in the normaliseError() function, we need to
            // tell the getStacktrace() function to skip the number of frames we know will
            // be from our own functions. This is added to the number of frames deep we
            // were told about
            internalFrames > 0 ? 1 + internalFrames + errorFramesToSkip : 0,
            // if there's no stacktrace, the callstack may be walked to generated one.
            // this is how many frames should be removed because they come from our library
            1 + errorFramesToSkip
          );
          event = new Event2(error2.name, error2.message, stacktrace, handledState, maybeError);
        } catch (e10) {
          event = new Event2(error2.name, error2.message, [], handledState, maybeError);
        }
        if (error2.name === "InvalidError") {
          event.addMetadata("" + component, "non-error parameter", makeSerialisable(maybeError));
        }
        if (error2.cause) {
          var _event$errors;
          var causes = getCauseStack(error2).slice(1);
          var normalisedCauses = _$map_21(causes, function(cause) {
            var stacktrace2 = _$iserror_25(cause) && _$hasStack_24(cause) ? _$errorStackParser_15.parse(cause) : [];
            var _normaliseError2 = normaliseError(cause, true, "error cause"), error3 = _normaliseError2[0];
            if (error3.name === "InvalidError") event.addMetadata("error cause", makeSerialisable(cause));
            return createBugsnagError(error3.name, error3.message, Event2.__type, stacktrace2);
          });
          (_event$errors = event.errors).push.apply(_event$errors, normalisedCauses);
        }
        return event;
      };
      var makeSerialisable = /* @__PURE__ */ __name(function(err) {
        if (err === null) return "null";
        if (err === void 0) return "undefined";
        return err;
      }, "makeSerialisable");
      var normaliseError = /* @__PURE__ */ __name(function(maybeError, tolerateNonErrors, component, logger4) {
        var error2;
        var internalFrames = 0;
        var createAndLogInputError = /* @__PURE__ */ __name(function(reason) {
          var verb = component === "error cause" ? "was" : "received";
          if (logger4) logger4.warn(component + " " + verb + ' a non-error: "' + reason + '"');
          var err = new Error(component + " " + verb + ' a non-error. See "' + component + '" tab for more detail.');
          err.name = "InvalidError";
          return err;
        }, "createAndLogInputError");
        if (!tolerateNonErrors) {
          if (_$iserror_25(maybeError)) {
            error2 = maybeError;
          } else {
            error2 = createAndLogInputError(typeof maybeError);
            internalFrames += 2;
          }
        } else {
          switch (typeof maybeError) {
            case "string":
            case "number":
            case "boolean":
              error2 = new Error(String(maybeError));
              internalFrames += 1;
              break;
            case "function":
              error2 = createAndLogInputError("function");
              internalFrames += 2;
              break;
            case "object":
              if (maybeError !== null && _$iserror_25(maybeError)) {
                error2 = maybeError;
              } else if (maybeError !== null && hasNecessaryFields(maybeError)) {
                error2 = new Error(maybeError.message || maybeError.errorMessage);
                error2.name = maybeError.name || maybeError.errorClass;
                internalFrames += 1;
              } else {
                error2 = createAndLogInputError(maybeError === null ? "null" : "unsupported object");
                internalFrames += 2;
              }
              break;
            default:
              error2 = createAndLogInputError("nothing");
              internalFrames += 2;
          }
        }
        if (!_$hasStack_24(error2)) {
          try {
            throw error2;
          } catch (e10) {
            if (_$hasStack_24(e10)) {
              error2 = e10;
              internalFrames = 1;
            }
          }
        }
        return [error2, internalFrames];
      }, "normaliseError");
      Event2.__type = "browserjs";
      var hasNecessaryFields = /* @__PURE__ */ __name(function(error2) {
        return (typeof error2.name === "string" || typeof error2.errorClass === "string") && (typeof error2.message === "string" || typeof error2.errorMessage === "string");
      }, "hasNecessaryFields");
      var _$Event_10 = Event2;
      var _$asyncEvery_11 = /* @__PURE__ */ __name(function(arr, fn2, cb2) {
        var index = 0;
        var next = /* @__PURE__ */ __name(function() {
          if (index >= arr.length) return cb2(null, true);
          fn2(arr[index], function(err, result) {
            if (err) return cb2(err);
            if (result === false) return cb2(null, false);
            index++;
            next();
          });
        }, "next");
        next();
      }, "_$asyncEvery_11");
      var _$callbackRunner_13 = /* @__PURE__ */ __name(function(callbacks, event, onCallbackError, cb2) {
        var runMaybeAsyncCallback = /* @__PURE__ */ __name(function(fn2, cb3) {
          if (typeof fn2 !== "function") return cb3(null);
          try {
            if (fn2.length !== 2) {
              var ret = fn2(event);
              if (ret && typeof ret.then === "function") {
                return ret.then(
                  // resolve
                  function(val2) {
                    return setTimeout(function() {
                      return cb3(null, val2);
                    });
                  },
                  // reject
                  function(err) {
                    setTimeout(function() {
                      onCallbackError(err);
                      return cb3(null, true);
                    });
                  }
                );
              }
              return cb3(null, ret);
            }
            fn2(event, function(err, result) {
              if (err) {
                onCallbackError(err);
                return cb3(null);
              }
              cb3(null, result);
            });
          } catch (e10) {
            onCallbackError(e10);
            cb3(null);
          }
        }, "runMaybeAsyncCallback");
        _$asyncEvery_11(callbacks, runMaybeAsyncCallback, cb2);
      }, "_$callbackRunner_13");
      var _$syncCallbackRunner_30 = /* @__PURE__ */ __name(function(callbacks, callbackArg, callbackType, logger4) {
        var ignore2 = false;
        var cbs = callbacks.slice();
        while (!ignore2) {
          if (!cbs.length) break;
          try {
            ignore2 = cbs.pop()(callbackArg) === false;
          } catch (e10) {
            logger4.error("Error occurred in " + callbackType + " callback, continuing anyway\u2026");
            logger4.error(e10);
          }
        }
        return ignore2;
      }, "_$syncCallbackRunner_30");
      var _$pad_4 = /* @__PURE__ */ __name(function pad2(num, size) {
        var s7 = "000000000" + num;
        return s7.substr(s7.length - size);
      }, "pad");
      var os13 = __require("os");
      function getHostname() {
        try {
          return os13.hostname();
        } catch (e10) {
          return process.env._CLUSTER_NETWORK_NAME_ || process.env.COMPUTERNAME || "hostname";
        }
      }
      __name(getHostname, "getHostname");
      var padding = 2, pid = _$pad_4(process.pid.toString(36), padding), hostname2 = getHostname(), length = hostname2.length, hostId = _$pad_4(hostname2.split("").reduce(function(prev, char) {
        return +prev + char.charCodeAt(0);
      }, +length + 36).toString(36), padding);
      var _$fingerprint_2 = /* @__PURE__ */ __name(function fingerprint() {
        return pid + hostId;
      }, "fingerprint");
      var _$isCuid_3 = /* @__PURE__ */ __name(function isCuid(value) {
        return typeof value === "string" && /^c[a-z0-9]{20,32}$/.test(value);
      }, "isCuid");
      var c8 = 0, blockSize = 4, base = 36, discreteValues = Math.pow(base, blockSize);
      function randomBlock() {
        return _$pad_4((Math.random() * discreteValues << 0).toString(base), blockSize);
      }
      __name(randomBlock, "randomBlock");
      function safeCounter() {
        c8 = c8 < discreteValues ? c8 : 0;
        c8++;
        return c8 - 1;
      }
      __name(safeCounter, "safeCounter");
      function cuid() {
        var letter = "c", timestamp = (/* @__PURE__ */ new Date()).getTime().toString(base), counter = _$pad_4(safeCounter().toString(base), blockSize), print2 = _$fingerprint_2(), random = randomBlock() + randomBlock();
        return letter + timestamp + counter + print2 + random;
      }
      __name(cuid, "cuid");
      cuid.fingerprint = _$fingerprint_2;
      cuid.isCuid = _$isCuid_3;
      var _$cuid_1 = cuid;
      var Session = /* @__PURE__ */ function() {
        function Session2() {
          this.id = _$cuid_1();
          this.startedAt = /* @__PURE__ */ new Date();
          this._handled = 0;
          this._unhandled = 0;
          this._user = {};
          this.app = {};
          this.device = {};
        }
        __name(Session2, "Session");
        var _proto = Session2.prototype;
        _proto.getUser = /* @__PURE__ */ __name(function getUser() {
          return this._user;
        }, "getUser");
        _proto.setUser = /* @__PURE__ */ __name(function setUser2(id, email, name3) {
          this._user = {
            id,
            email,
            name: name3
          };
        }, "setUser");
        _proto.toJSON = /* @__PURE__ */ __name(function toJSON() {
          return {
            id: this.id,
            startedAt: this.startedAt,
            events: {
              handled: this._handled,
              unhandled: this._unhandled
            }
          };
        }, "toJSON");
        _proto._track = /* @__PURE__ */ __name(function _track(event) {
          this[event._handledState.unhandled ? "_unhandled" : "_handled"] += 1;
        }, "_track");
        return Session2;
      }();
      var _$Session_34 = Session;
      var __add_8 = _$featureFlagDelegate_23.add, __clear_8 = _$featureFlagDelegate_23.clear, __merge_8 = _$featureFlagDelegate_23.merge;
      var HUB_PREFIX = "00000";
      var HUB_NOTIFY = "https://notify.insighthub.smartbear.com";
      var HUB_SESSION = "https://sessions.insighthub.smartbear.com";
      var noop = /* @__PURE__ */ __name(function() {
      }, "noop");
      var Client2 = /* @__PURE__ */ function() {
        function Client3(configuration, schema2, internalPlugins2, notifier) {
          var _this = this;
          if (schema2 === void 0) {
            schema2 = _$config_9.schema;
          }
          if (internalPlugins2 === void 0) {
            internalPlugins2 = [];
          }
          this._notifier = notifier;
          this._config = {};
          this._schema = schema2;
          this._delivery = {
            sendSession: noop,
            sendEvent: noop
          };
          this._logger = {
            debug: noop,
            info: noop,
            warn: noop,
            error: noop
          };
          this._plugins = {};
          this._breadcrumbs = [];
          this._session = null;
          this._metadata = {};
          this._featuresIndex = {};
          this._features = [];
          this._context = void 0;
          this._user = {};
          this._groupingDiscriminator = void 0;
          this._cbs = {
            e: [],
            s: [],
            sp: [],
            b: []
          };
          this.Client = Client3;
          this.Event = _$Event_10;
          this.Breadcrumb = _$Breadcrumb_7;
          this.Session = _$Session_34;
          this._config = this._configure(configuration, internalPlugins2);
          _$map_21(internalPlugins2.concat(this._config.plugins), function(pl2) {
            if (pl2) _this._loadPlugin(pl2);
          });
          this._depth = 1;
          var self2 = this;
          var notify = this.notify;
          this.notify = function() {
            return notify.apply(self2, arguments);
          };
        }
        __name(Client3, "Client");
        var _proto = Client3.prototype;
        _proto.addMetadata = /* @__PURE__ */ __name(function addMetadata(section, keyOrObj, maybeVal) {
          return _$metadataDelegate_27.add(this._metadata, section, keyOrObj, maybeVal);
        }, "addMetadata");
        _proto.getMetadata = /* @__PURE__ */ __name(function getMetadata(section, key) {
          return _$metadataDelegate_27.get(this._metadata, section, key);
        }, "getMetadata");
        _proto.clearMetadata = /* @__PURE__ */ __name(function clearMetadata(section, key) {
          return _$metadataDelegate_27.clear(this._metadata, section, key);
        }, "clearMetadata");
        _proto.addFeatureFlag = /* @__PURE__ */ __name(function addFeatureFlag(name3, variant) {
          if (variant === void 0) {
            variant = null;
          }
          __add_8(this._features, this._featuresIndex, name3, variant);
        }, "addFeatureFlag");
        _proto.addFeatureFlags = /* @__PURE__ */ __name(function addFeatureFlags(featureFlags) {
          __merge_8(this._features, featureFlags, this._featuresIndex);
        }, "addFeatureFlags");
        _proto.clearFeatureFlag = /* @__PURE__ */ __name(function clearFeatureFlag(name3) {
          __clear_8(this._features, this._featuresIndex, name3);
        }, "clearFeatureFlag");
        _proto.clearFeatureFlags = /* @__PURE__ */ __name(function clearFeatureFlags() {
          this._features = [];
          this._featuresIndex = {};
        }, "clearFeatureFlags");
        _proto.getContext = /* @__PURE__ */ __name(function getContext2() {
          return this._context;
        }, "getContext");
        _proto.setContext = /* @__PURE__ */ __name(function setContext2(c9) {
          this._context = c9;
        }, "setContext");
        _proto.getGroupingDiscriminator = /* @__PURE__ */ __name(function getGroupingDiscriminator() {
          return this._groupingDiscriminator;
        }, "getGroupingDiscriminator");
        _proto.setGroupingDiscriminator = /* @__PURE__ */ __name(function setGroupingDiscriminator(value) {
          var previousValue = this._groupingDiscriminator;
          if (typeof value === "string" || value === null || value === void 0) this._groupingDiscriminator = value;
          return previousValue;
        }, "setGroupingDiscriminator");
        _proto._configure = /* @__PURE__ */ __name(function _configure(opts, internalPlugins2) {
          var schema2 = _$reduce_22(internalPlugins2, function(schema3, plugin) {
            if (plugin && plugin.configSchema) return _$assign_16({}, schema3, plugin.configSchema);
            return schema3;
          }, this._schema);
          if (!opts.endpoints) {
            opts.sendPayloadChecksums = "sendPayloadChecksums" in opts ? opts.sendPayloadChecksums : true;
          }
          var _reduce = _$reduce_22(_$keys_20(schema2), function(accum, key) {
            var defaultValue = schema2[key].defaultValue(opts[key]);
            if (opts[key] !== void 0) {
              var valid = schema2[key].validate(opts[key]);
              if (!valid) {
                accum.errors[key] = schema2[key].message;
                accum.config[key] = defaultValue;
              } else {
                if (schema2[key].allowPartialObject) {
                  accum.config[key] = _$assign_16(defaultValue, opts[key]);
                } else {
                  accum.config[key] = opts[key];
                }
              }
            } else {
              accum.config[key] = defaultValue;
            }
            return accum;
          }, {
            errors: {},
            config: {}
          }), errors = _reduce.errors, config = _reduce.config;
          if (schema2.apiKey) {
            if (!config.apiKey) throw new Error("No Bugsnag API Key set");
            if (!/^[0-9a-f]{32}$/i.test(config.apiKey)) errors.apiKey = "should be a string of 32 hexadecimal characters";
            if (opts.endpoints === void 0 && config.apiKey.startsWith(HUB_PREFIX)) {
              config.endpoints = {
                notify: HUB_NOTIFY,
                sessions: HUB_SESSION
              };
            }
          }
          this._metadata = _$assign_16({}, config.metadata);
          __merge_8(this._features, config.featureFlags, this._featuresIndex);
          this._user = _$assign_16({}, config.user);
          this._context = config.context;
          if (config.logger) this._logger = config.logger;
          if (config.onError) this._cbs.e = this._cbs.e.concat(config.onError);
          if (config.onBreadcrumb) this._cbs.b = this._cbs.b.concat(config.onBreadcrumb);
          if (config.onSession) this._cbs.s = this._cbs.s.concat(config.onSession);
          if (_$keys_20(errors).length) {
            this._logger.warn(generateConfigErrorMessage(errors, opts));
          }
          return config;
        }, "_configure");
        _proto.getUser = /* @__PURE__ */ __name(function getUser() {
          return this._user;
        }, "getUser");
        _proto.setUser = /* @__PURE__ */ __name(function setUser2(id, email, name3) {
          this._user = {
            id,
            email,
            name: name3
          };
        }, "setUser");
        _proto._loadPlugin = /* @__PURE__ */ __name(function _loadPlugin(plugin) {
          var result = plugin.load(this);
          if (plugin.name) this._plugins["~" + plugin.name + "~"] = result;
        }, "_loadPlugin");
        _proto.getPlugin = /* @__PURE__ */ __name(function getPlugin(name3) {
          return this._plugins["~" + name3 + "~"];
        }, "getPlugin");
        _proto._setDelivery = /* @__PURE__ */ __name(function _setDelivery(d8) {
          this._delivery = d8(this);
        }, "_setDelivery");
        _proto.startSession = /* @__PURE__ */ __name(function startSession() {
          var session = new _$Session_34();
          session.app.releaseStage = this._config.releaseStage;
          session.app.version = this._config.appVersion;
          session.app.type = this._config.appType;
          session._user = _$assign_16({}, this._user);
          var ignore2 = _$syncCallbackRunner_30(this._cbs.s, session, "onSession", this._logger);
          if (ignore2) {
            this._logger.debug("Session not started due to onSession callback");
            return this;
          }
          return this._sessionDelegate.startSession(this, session);
        }, "startSession");
        _proto.addOnError = /* @__PURE__ */ __name(function addOnError(fn2, front) {
          if (front === void 0) {
            front = false;
          }
          this._cbs.e[front ? "unshift" : "push"](fn2);
        }, "addOnError");
        _proto.removeOnError = /* @__PURE__ */ __name(function removeOnError(fn2) {
          this._cbs.e = _$filter_17(this._cbs.e, function(f8) {
            return f8 !== fn2;
          });
        }, "removeOnError");
        _proto._addOnSessionPayload = /* @__PURE__ */ __name(function _addOnSessionPayload(fn2) {
          this._cbs.sp.push(fn2);
        }, "_addOnSessionPayload");
        _proto.addOnSession = /* @__PURE__ */ __name(function addOnSession(fn2) {
          this._cbs.s.push(fn2);
        }, "addOnSession");
        _proto.removeOnSession = /* @__PURE__ */ __name(function removeOnSession(fn2) {
          this._cbs.s = _$filter_17(this._cbs.s, function(f8) {
            return f8 !== fn2;
          });
        }, "removeOnSession");
        _proto.addOnBreadcrumb = /* @__PURE__ */ __name(function addOnBreadcrumb(fn2, front) {
          if (front === void 0) {
            front = false;
          }
          this._cbs.b[front ? "unshift" : "push"](fn2);
        }, "addOnBreadcrumb");
        _proto.removeOnBreadcrumb = /* @__PURE__ */ __name(function removeOnBreadcrumb(fn2) {
          this._cbs.b = _$filter_17(this._cbs.b, function(f8) {
            return f8 !== fn2;
          });
        }, "removeOnBreadcrumb");
        _proto.pauseSession = /* @__PURE__ */ __name(function pauseSession() {
          return this._sessionDelegate.pauseSession(this);
        }, "pauseSession");
        _proto.resumeSession = /* @__PURE__ */ __name(function resumeSession() {
          return this._sessionDelegate.resumeSession(this);
        }, "resumeSession");
        _proto.leaveBreadcrumb = /* @__PURE__ */ __name(function leaveBreadcrumb(message, metadata, type) {
          message = typeof message === "string" ? message : "";
          type = typeof type === "string" && _$includes_18(_$breadcrumbTypes_12, type) ? type : "manual";
          metadata = typeof metadata === "object" && metadata !== null ? metadata : {};
          if (!message) return;
          var crumb = new _$Breadcrumb_7(message, metadata, type);
          var ignore2 = _$syncCallbackRunner_30(this._cbs.b, crumb, "onBreadcrumb", this._logger);
          if (ignore2) {
            this._logger.debug("Breadcrumb not attached due to onBreadcrumb callback");
            return;
          }
          this._breadcrumbs.push(crumb);
          if (this._breadcrumbs.length > this._config.maxBreadcrumbs) {
            this._breadcrumbs = this._breadcrumbs.slice(this._breadcrumbs.length - this._config.maxBreadcrumbs);
          }
        }, "leaveBreadcrumb");
        _proto._isBreadcrumbTypeEnabled = /* @__PURE__ */ __name(function _isBreadcrumbTypeEnabled(type) {
          var types13 = this._config.enabledBreadcrumbTypes;
          return types13 === null || _$includes_18(types13, type);
        }, "_isBreadcrumbTypeEnabled");
        _proto.notify = /* @__PURE__ */ __name(function notify(maybeError, onError, postReportCallback) {
          if (postReportCallback === void 0) {
            postReportCallback = noop;
          }
          var event = _$Event_10.create(maybeError, true, void 0, "notify()", this._depth + 1, this._logger);
          this._notify(event, onError, postReportCallback);
        }, "notify");
        _proto._notify = /* @__PURE__ */ __name(function _notify(event, onError, postReportCallback) {
          var _this2 = this;
          if (postReportCallback === void 0) {
            postReportCallback = noop;
          }
          event.app = _$assign_16({}, event.app, {
            releaseStage: this._config.releaseStage,
            version: this._config.appVersion,
            type: this._config.appType
          });
          event.context = event.context || this._context;
          event._metadata = _$assign_16({}, event._metadata, this._metadata);
          event._user = _$assign_16({}, event._user, this._user);
          event.breadcrumbs = this._breadcrumbs.slice();
          event.setGroupingDiscriminator(this._groupingDiscriminator);
          __merge_8(event._features, this._features, event._featuresIndex);
          if (this._config.enabledReleaseStages !== null && !_$includes_18(this._config.enabledReleaseStages, this._config.releaseStage)) {
            this._logger.warn("Event not sent due to releaseStage/enabledReleaseStages configuration");
            return postReportCallback(null, event);
          }
          var originalSeverity = event.severity;
          var onCallbackError = /* @__PURE__ */ __name(function(err) {
            _this2._logger.error("Error occurred in onError callback, continuing anyway\u2026");
            _this2._logger.error(err);
          }, "onCallbackError");
          var callbacks = [].concat(this._cbs.e).concat(onError);
          _$callbackRunner_13(callbacks, event, onCallbackError, function(err, shouldSend) {
            if (err) onCallbackError(err);
            if (!shouldSend) {
              _this2._logger.debug("Event not sent due to onError callback");
              return postReportCallback(null, event);
            }
            if (_this2._isBreadcrumbTypeEnabled("error")) {
              Client3.prototype.leaveBreadcrumb.call(_this2, event.errors[0].errorClass, {
                errorClass: event.errors[0].errorClass,
                errorMessage: event.errors[0].errorMessage,
                severity: event.severity
              }, "error");
            }
            if (originalSeverity !== event.severity) {
              event._handledState.severityReason = {
                type: "userCallbackSetSeverity"
              };
            }
            if (event.unhandled !== event._handledState.unhandled) {
              event._handledState.severityReason.unhandledOverridden = true;
              event._handledState.unhandled = event.unhandled;
            }
            if (_this2._session) {
              _this2._session._track(event);
              event._session = _this2._session;
            }
            _this2._delivery.sendEvent({
              apiKey: event.apiKey || _this2._config.apiKey,
              notifier: _this2._notifier,
              events: [event]
            }, function(err2) {
              return postReportCallback(err2, event);
            });
          });
        }, "_notify");
        return Client3;
      }();
      var generateConfigErrorMessage = /* @__PURE__ */ __name(function(errors, rawInput) {
        var er2 = new Error("Invalid configuration\n" + _$map_21(_$keys_20(errors), function(key) {
          return "  - " + key + " " + errors[key] + ", got " + stringify4(rawInput[key]);
        }).join("\n\n"));
        return er2;
      }, "generateConfigErrorMessage");
      var stringify4 = /* @__PURE__ */ __name(function(val2) {
        switch (typeof val2) {
          case "string":
          case "number":
          case "object":
            return JSON.stringify(val2);
          default:
            return String(val2);
        }
      }, "stringify");
      var _$Client_8 = Client2;
      var _$jsonPayload_26 = {};
      var EVENT_REDACTION_PATHS = ["events.[].metaData", "events.[].breadcrumbs.[].metaData", "events.[].request"];
      _$jsonPayload_26.event = function(event, redactedKeys) {
        var payload = _$safeJsonStringify_5(event, null, null, {
          redactedPaths: EVENT_REDACTION_PATHS,
          redactedKeys
        });
        if (payload.length > 1e6) {
          event.events[0]._metadata = {
            notifier: "WARNING!\nSerialized payload was " + payload.length / 1e6 + "MB (limit = 1MB)\nmetadata was removed"
          };
          payload = _$safeJsonStringify_5(event, null, null, {
            redactedPaths: EVENT_REDACTION_PATHS,
            redactedKeys
          });
        }
        return payload;
      };
      _$jsonPayload_26.session = function(session, redactedKeys) {
        var payload = _$safeJsonStringify_5(session, null, null);
        return payload;
      };
      var http6 = __require("http");
      var https3 = __require("https");
      var ___require_36 = __require("url"), parse17 = ___require_36.parse;
      var _$request_36 = /* @__PURE__ */ __name(function(_ref, cb2) {
        var url5 = _ref.url, headers = _ref.headers, body = _ref.body, agent = _ref.agent;
        var didError = false;
        var onError = /* @__PURE__ */ __name(function(err) {
          if (didError) return;
          didError = true;
          cb2(err);
        }, "onError");
        var parsedUrl = parse17(url5);
        var secure = parsedUrl.protocol === "https:";
        var transport = secure ? https3 : http6;
        var req = transport.request({
          method: "POST",
          hostname: parsedUrl.hostname,
          port: parsedUrl.port,
          path: parsedUrl.path,
          headers,
          agent
        });
        req.on("error", onError);
        req.on("response", function(res) {
          bufferResponse(res, function(err, body2) {
            if (err) return onError(err);
            if (res.statusCode < 200 || res.statusCode >= 300) {
              return onError(new Error("Bad statusCode from API: " + res.statusCode + "\n" + body2));
            }
            cb2(null, body2);
          });
        });
        req.write(body);
        req.end();
      }, "_$request_36");
      var bufferResponse = /* @__PURE__ */ __name(function(stream2, cb2) {
        var data = "";
        stream2.on("error", cb2);
        stream2.setEncoding("utf8");
        stream2.on("data", function(d8) {
          data += d8;
        });
        stream2.on("end", function() {
          return cb2(null, data);
        });
      }, "bufferResponse");
      var _$delivery_35 = /* @__PURE__ */ __name(function(client) {
        return {
          sendEvent: /* @__PURE__ */ __name(function(event, cb2) {
            if (cb2 === void 0) {
              cb2 = /* @__PURE__ */ __name(function() {
              }, "cb");
            }
            var body = _$jsonPayload_26.event(event, client._config.redactedKeys);
            var _cb = /* @__PURE__ */ __name(function(err2) {
              if (err2) client._logger.error("Event failed to send\u2026\n" + (err2 && err2.stack ? err2.stack : err2), err2);
              if (body.length > 1e6) {
                client._logger.warn("Event oversized (" + (body.length / 1e6).toFixed(2) + " MB)");
              }
              cb2(err2);
            }, "_cb");
            if (client._config.endpoints.notify === null) {
              var err = new Error("Event not sent due to incomplete endpoint configuration");
              return _cb(err);
            }
            try {
              _$request_36({
                url: client._config.endpoints.notify,
                headers: {
                  "Content-Type": "application/json",
                  "Bugsnag-Api-Key": event.apiKey || client._config.apiKey,
                  "Bugsnag-Payload-Version": "4",
                  "Bugsnag-Sent-At": (/* @__PURE__ */ new Date()).toISOString()
                },
                body,
                agent: client._config.agent
              }, function(err2, body2) {
                return _cb(err2);
              });
            } catch (e10) {
              _cb(e10);
            }
          }, "sendEvent"),
          sendSession: /* @__PURE__ */ __name(function(session, cb2) {
            if (cb2 === void 0) {
              cb2 = /* @__PURE__ */ __name(function() {
              }, "cb");
            }
            var _cb = /* @__PURE__ */ __name(function(err2) {
              if (err2) client._logger.error("Session failed to send\u2026\n" + (err2 && err2.stack ? err2.stack : err2), err2);
              cb2(err2);
            }, "_cb");
            if (client._config.endpoints.session === null) {
              var err = new Error("Session not sent due to incomplete endpoint configuration");
              return _cb(err);
            }
            try {
              _$request_36({
                url: client._config.endpoints.sessions,
                headers: {
                  "Content-Type": "application/json",
                  "Bugsnag-Api-Key": client._config.apiKey,
                  "Bugsnag-Payload-Version": "1",
                  "Bugsnag-Sent-At": (/* @__PURE__ */ new Date()).toISOString()
                },
                body: _$jsonPayload_26.session(session, client._config.redactedKeys),
                agent: client._config.agent
              }, function(err2) {
                return _cb(err2);
              });
            } catch (e10) {
              _cb(e10);
            }
          }, "sendSession")
        };
      }, "_$delivery_35");
      function ___extends_37() {
        return ___extends_37 = Object.assign ? Object.assign.bind() : function(n9) {
          for (var e10 = 1; e10 < arguments.length; e10++) {
            var t13 = arguments[e10];
            for (var r10 in t13) ({}).hasOwnProperty.call(t13, r10) && (n9[r10] = t13[r10]);
          }
          return n9;
        }, ___extends_37.apply(null, arguments);
      }
      __name(___extends_37, "___extends_37");
      var schema = _$config_9.schema;
      var __os_37 = __require("os");
      var _require2 = __require("util"), inspect3 = _require2.inspect;
      var _$config_37 = {
        appType: ___extends_37({}, schema.appType, {
          defaultValue: /* @__PURE__ */ __name(function() {
            return "node";
          }, "defaultValue")
        }),
        projectRoot: {
          defaultValue: /* @__PURE__ */ __name(function() {
            return process.cwd();
          }, "defaultValue"),
          validate: /* @__PURE__ */ __name(function(value) {
            return value === null || _$stringWithLength_33(value);
          }, "validate"),
          message: "should be string"
        },
        hostname: {
          defaultValue: /* @__PURE__ */ __name(function() {
            return __os_37.hostname();
          }, "defaultValue"),
          message: "should be a string",
          validate: /* @__PURE__ */ __name(function(value) {
            return value === null || _$stringWithLength_33(value);
          }, "validate")
        },
        logger: ___extends_37({}, schema.logger, {
          defaultValue: /* @__PURE__ */ __name(function() {
            return getPrefixedConsole();
          }, "defaultValue")
        }),
        releaseStage: ___extends_37({}, schema.releaseStage, {
          defaultValue: /* @__PURE__ */ __name(function() {
            return "production";
          }, "defaultValue")
        }),
        agent: {
          defaultValue: /* @__PURE__ */ __name(function() {
            return void 0;
          }, "defaultValue"),
          message: "should be an HTTP(s) agent",
          validate: /* @__PURE__ */ __name(function(value) {
            return value === void 0 || isAgent2(value);
          }, "validate")
        },
        onUncaughtException: {
          defaultValue: /* @__PURE__ */ __name(function() {
            return function(err, event, logger4) {
              logger4.error("Uncaught exception" + getContext(event) + ", the process will now terminate\u2026\n" + printError(err));
              process.exit(1);
            };
          }, "defaultValue"),
          message: "should be a function",
          validate: /* @__PURE__ */ __name(function(value) {
            return typeof value === "function";
          }, "validate")
        },
        onUnhandledRejection: {
          defaultValue: /* @__PURE__ */ __name(function() {
            return function(err, event, logger4) {
              logger4.error("Unhandled rejection" + getContext(event) + "\u2026\n" + printError(err));
            };
          }, "defaultValue"),
          message: "should be a function",
          validate: /* @__PURE__ */ __name(function(value) {
            return typeof value === "function";
          }, "validate")
        }
      };
      var printError = /* @__PURE__ */ __name(function(err) {
        return err && err.stack ? err.stack : inspect3(err);
      }, "printError");
      var getPrefixedConsole = /* @__PURE__ */ __name(function() {
        return ["debug", "info", "warn", "error"].reduce(function(accum, method) {
          var consoleMethod = console[method] || console.log;
          accum[method] = consoleMethod.bind(console, "[bugsnag]");
          return accum;
        }, {});
      }, "getPrefixedConsole");
      var getContext = /* @__PURE__ */ __name(function(event) {
        return event.request && Object.keys(event.request).length ? " at " + event.request.httpMethod + " " + (event.request.path || event.request.url) : "";
      }, "getContext");
      var isAgent2 = /* @__PURE__ */ __name(function(value) {
        return typeof value === "object" && value !== null || typeof value === "boolean";
      }, "isAgent");
      var appStart = /* @__PURE__ */ new Date();
      var reset = /* @__PURE__ */ __name(function() {
        appStart = /* @__PURE__ */ new Date();
      }, "reset");
      var _$app_39 = {
        name: "appDuration",
        load: /* @__PURE__ */ __name(function(client) {
          client.addOnError(function(event) {
            var now = /* @__PURE__ */ new Date();
            event.app.duration = now - appStart;
          }, true);
          return {
            reset
          };
        }, "load")
      };
      var _$consoleBreadcrumbs_40 = {};
      _$consoleBreadcrumbs_40.load = function(client) {
        var isDev = /^(local-)?dev(elopment)?$/.test(client._config.releaseStage);
        if (isDev || !client._isBreadcrumbTypeEnabled("log")) return;
        _$map_21(CONSOLE_LOG_METHODS, function(method) {
          var original = console[method];
          console[method] = function() {
            for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
              args[_key] = arguments[_key];
            }
            client.leaveBreadcrumb("Console output", _$reduce_22(args, function(accum, arg, i7) {
              var stringified = "[Unknown value]";
              try {
                stringified = String(arg);
              } catch (e10) {
              }
              if (stringified === "[object Object]") {
                try {
                  stringified = JSON.stringify(arg);
                } catch (e10) {
                }
              }
              accum["[" + i7 + "]"] = stringified;
              return accum;
            }, {
              severity: method.indexOf("group") === 0 ? "log" : method
            }), "log");
            original.apply(console, args);
          };
          console[method]._restore = function() {
            console[method] = original;
          };
        });
      };
      var CONSOLE_LOG_METHODS = _$filter_17(["log", "debug", "info", "warn", "error"], function(method) {
        return typeof console !== "undefined" && typeof console[method] === "function";
      });
      var _$cloneClient_14 = {};
      var onCloneCallbacks = [];
      _$cloneClient_14 = /* @__PURE__ */ __name(function(client) {
        var clone2 = new client.Client({}, {}, [], client._notifier);
        clone2._config = client._config;
        clone2._breadcrumbs = client._breadcrumbs.slice();
        clone2._metadata = _$assign_16({}, client._metadata);
        clone2._features = [].concat(client._features);
        clone2._featuresIndex = _$assign_16({}, client._featuresIndex);
        clone2._user = _$assign_16({}, client._user);
        clone2._context = client._context;
        clone2._cbs = {
          e: client._cbs.e.slice(),
          s: client._cbs.s.slice(),
          sp: client._cbs.sp.slice(),
          b: client._cbs.b.slice()
        };
        clone2._logger = client._logger;
        clone2._delivery = client._delivery;
        clone2._sessionDelegate = client._sessionDelegate;
        onCloneCallbacks.forEach(function(callback) {
          callback(clone2);
        });
        return clone2;
      }, "_$cloneClient_14");
      _$cloneClient_14.registerCallback = function(callback) {
        onCloneCallbacks.push(callback);
      };
      var _$nodeFallbackStack_28 = {};
      _$nodeFallbackStack_28.getStack = function() {
        return new Error().stack.split("\n").slice(3).join("\n");
      };
      _$nodeFallbackStack_28.maybeUseFallbackStack = function(err, fallbackStack) {
        var lines = err.stack.split("\n");
        if (lines.length === 1 || lines.length === 2 && /at Error \(native\)/.test(lines[1])) {
          err.stack = lines[0] + "\n" + fallbackStack;
        }
        return err;
      };
      var _$contextualize_41 = {};
      var getStack = _$nodeFallbackStack_28.getStack;
      _$contextualize_41 = {
        name: "contextualize",
        load: /* @__PURE__ */ __name(function(client) {
          var contextualize = /* @__PURE__ */ __name(function(fn2, onError) {
            var fallbackStack = getStack();
            var clonedClient = _$cloneClient_14(client);
            clonedClient.fallbackStack = fallbackStack;
            clonedClient.addOnError(onError);
            client._clientContext.run(clonedClient, fn2);
          }, "contextualize");
          return contextualize;
        }, "load")
      };
      _$contextualize_41["default"] = _$contextualize_41;
      var _$intercept_42 = {};
      var __getStack_42 = _$nodeFallbackStack_28.getStack, maybeUseFallbackStack = _$nodeFallbackStack_28.maybeUseFallbackStack;
      _$intercept_42 = {
        name: "intercept",
        load: /* @__PURE__ */ __name(function(client) {
          var intercept = /* @__PURE__ */ __name(function(onError, cb2) {
            if (onError === void 0) {
              onError = /* @__PURE__ */ __name(function() {
              }, "onError");
            }
            if (typeof cb2 !== "function") {
              cb2 = onError;
              onError = /* @__PURE__ */ __name(function() {
              }, "onError");
            }
            var fallbackStack = __getStack_42();
            return function(err) {
              if (err) {
                if (err.stack) maybeUseFallbackStack(err, fallbackStack);
                var event = client.Event.create(err, true, {
                  severity: "warning",
                  unhandled: false,
                  severityReason: {
                    type: "callbackErrorIntercept"
                  }
                }, "intercept()", 1);
                client._notify(event, onError);
                return;
              }
              for (var _len = arguments.length, data = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
                data[_key - 1] = arguments[_key];
              }
              cb2.apply(void 0, data);
            };
          }, "intercept");
          return intercept;
        }, "load")
      };
      _$intercept_42["default"] = _$intercept_42;
      function ___extends_43() {
        return ___extends_43 = Object.assign ? Object.assign.bind() : function(n9) {
          for (var e10 = 1; e10 < arguments.length; e10++) {
            var t13 = arguments[e10];
            for (var r10 in t13) ({}).hasOwnProperty.call(t13, r10) && (n9[r10] = t13[r10]);
          }
          return n9;
        }, ___extends_43.apply(null, arguments);
      }
      __name(___extends_43, "___extends_43");
      var __os_43 = __require("os");
      var _$device_43 = {
        load: /* @__PURE__ */ __name(function(client) {
          var device = {
            osName: __os_43.platform() + " (" + __os_43.arch() + ")",
            osVersion: __os_43.release(),
            totalMemory: __os_43.totalmem(),
            hostname: client._config.hostname,
            runtimeVersions: {
              node: process.versions.node
            }
          };
          client._addOnSessionPayload(function(sp) {
            sp.device = ___extends_43({}, sp.device, device);
          });
          client.addOnError(function(event) {
            event.device = ___extends_43({}, event.device, device, {
              freeMemory: __os_43.freemem(),
              time: /* @__PURE__ */ new Date()
            });
          }, true);
        }, "load")
      };
      var ___require_29 = __require("path"), join36 = ___require_29.join, resolve32 = ___require_29.resolve;
      var _$pathNormalizer_29 = /* @__PURE__ */ __name(function(p7) {
        return join36(resolve32(p7), "/");
      }, "_$pathNormalizer_29");
      var _$inProject_44 = {
        load: /* @__PURE__ */ __name(function(client) {
          return client.addOnError(function(event) {
            if (!client._config.projectRoot) return;
            var projectRoot = _$pathNormalizer_29(client._config.projectRoot);
            var allFrames = event.errors.reduce(function(accum, er2) {
              return accum.concat(er2.stacktrace);
            }, []);
            allFrames.map(function(stackframe) {
              stackframe.inProject = typeof stackframe.file === "string" && stackframe.file.indexOf(projectRoot) === 0 && !/\/node_modules\//.test(stackframe.file);
            });
          });
        }, "load")
      };
      function ___extends_45() {
        return ___extends_45 = Object.assign ? Object.assign.bind() : function(n9) {
          for (var e10 = 1; e10 < arguments.length; e10++) {
            var t13 = arguments[e10];
            for (var r10 in t13) ({}).hasOwnProperty.call(t13, r10) && (n9[r10] = t13[r10]);
          }
          return n9;
        }, ___extends_45.apply(null, arguments);
      }
      __name(___extends_45, "___extends_45");
      function _inheritsLoose(t13, o7) {
        t13.prototype = Object.create(o7.prototype), t13.prototype.constructor = t13, _setPrototypeOf(t13, o7);
      }
      __name(_inheritsLoose, "_inheritsLoose");
      function _setPrototypeOf(t13, e10) {
        return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t14, e11) {
          return t14.__proto__ = e11, t14;
        }, _setPrototypeOf(t13, e10);
      }
      __name(_setPrototypeOf, "_setPrototypeOf");
      var SURROUNDING_LINES = 3;
      var MAX_LINE_LENGTH2 = 200;
      var ___require_45 = __require("fs"), createReadStream6 = ___require_45.createReadStream;
      var ___require2_45 = __require("stream"), Writable5 = ___require2_45.Writable;
      var pump = require_pump();
      var byline = require_byline();
      var path84 = __require("path");
      var _$surroundingCode_45 = {
        load: /* @__PURE__ */ __name(function(client) {
          if (!client._config.sendCode) return;
          var loadSurroundingCode = /* @__PURE__ */ __name(function(stackframe, cache5) {
            return new Promise(function(resolve33, reject) {
              try {
                if (!stackframe.lineNumber || !stackframe.file) return resolve33(stackframe);
                var file3 = path84.resolve(client._config.projectRoot, stackframe.file);
                var cacheKey = file3 + "@" + stackframe.lineNumber;
                if (cacheKey in cache5) {
                  stackframe.code = cache5[cacheKey];
                  return resolve33(stackframe);
                }
                getSurroundingCode(file3, stackframe.lineNumber, function(err, code) {
                  if (err) return resolve33(stackframe);
                  stackframe.code = cache5[cacheKey] = code;
                  return resolve33(stackframe);
                });
              } catch (e10) {
                return resolve33(stackframe);
              }
            });
          }, "loadSurroundingCode");
          client.addOnError(function(event) {
            return new Promise(function(resolve33, reject) {
              var cache5 = /* @__PURE__ */ Object.create(null);
              var allFrames = event.errors.reduce(function(accum, er2) {
                return accum.concat(er2.stacktrace);
              }, []);
              pMapSeries(allFrames.map(function(stackframe) {
                return function() {
                  return loadSurroundingCode(stackframe, cache5);
                };
              })).then(resolve33)["catch"](reject);
            });
          });
        }, "load"),
        configSchema: {
          sendCode: {
            defaultValue: /* @__PURE__ */ __name(function() {
              return true;
            }, "defaultValue"),
            validate: /* @__PURE__ */ __name(function(value) {
              return value === true || value === false;
            }, "validate"),
            message: "should be true or false"
          }
        }
      };
      var getSurroundingCode = /* @__PURE__ */ __name(function(file3, lineNumber, cb2) {
        var start = lineNumber - SURROUNDING_LINES;
        var end = lineNumber + SURROUNDING_LINES;
        var reader = createReadStream6(file3, {
          encoding: "utf8"
        });
        var splitter = new byline.LineStream({
          keepEmptyLines: true
        });
        var slicer = new CodeRange({
          start,
          end
        });
        slicer.on("done", function() {
          return reader.destroy();
        });
        pump(reader, splitter, slicer, function(err) {
          if (err && err.message !== "premature close") return cb2(err);
          cb2(null, slicer.getCode());
        });
      }, "getSurroundingCode");
      var CodeRange = /* @__PURE__ */ function(_Writable) {
        function CodeRange2(opts) {
          var _this;
          _this = _Writable.call(this, ___extends_45({}, opts, {
            decodeStrings: false
          })) || this;
          _this._start = opts.start;
          _this._end = opts.end;
          _this._n = 0;
          _this._code = {};
          return _this;
        }
        __name(CodeRange2, "CodeRange");
        _inheritsLoose(CodeRange2, _Writable);
        var _proto = CodeRange2.prototype;
        _proto._write = /* @__PURE__ */ __name(function _write(chunk, enc, cb2) {
          this._n++;
          if (this._n < this._start) return cb2(null);
          if (this._n <= this._end) {
            this._code[String(this._n)] = chunk.length <= MAX_LINE_LENGTH2 ? chunk : chunk.substr(0, MAX_LINE_LENGTH2);
            return cb2(null);
          }
          this.emit("done");
          return cb2(null);
        }, "_write");
        _proto.getCode = /* @__PURE__ */ __name(function getCode() {
          return this._code;
        }, "getCode");
        return CodeRange2;
      }(Writable5);
      var pMapSeries = /* @__PURE__ */ __name(function(ps) {
        return new Promise(function(resolve33, reject) {
          var res = [];
          ps.reduce(function(accum, p7) {
            return accum.then(function(r10) {
              res.push(r10);
              return p7();
            });
          }, Promise.resolve()).then(function(r10) {
            res.push(r10);
          }).then(function() {
            resolve33(res.slice(1));
          });
        });
      }, "pMapSeries");
      var __maybeUseFallbackStack_46 = _$nodeFallbackStack_28.maybeUseFallbackStack;
      var _handler;
      var _$uncaughtException_46 = {
        load: /* @__PURE__ */ __name(function(client) {
          if (!client._config.autoDetectErrors) return;
          if (!client._config.enabledErrorTypes.unhandledExceptions) return;
          _handler = /* @__PURE__ */ __name(function(err) {
            var ctx = client._clientContext && client._clientContext.getStore();
            var c9 = ctx || client;
            if (err.stack && c9.fallbackStack) __maybeUseFallbackStack_46(err, c9.fallbackStack);
            var event = c9.Event.create(err, false, {
              severity: "error",
              unhandled: true,
              severityReason: {
                type: "unhandledException"
              }
            }, "uncaughtException handler", 1);
            return new Promise(function(resolve33) {
              c9._notify(event, function() {
              }, function(e10, event2) {
                if (e10) c9._logger.error("Failed to send event to Bugsnag");
                c9._config.onUncaughtException(err, event2, c9._logger);
                resolve33();
              });
            });
          }, "_handler");
          process.prependListener("uncaughtException", _handler);
        }, "load"),
        destroy: /* @__PURE__ */ __name(function() {
          process.removeListener("uncaughtException", _handler);
        }, "destroy")
      };
      var ___handler_47;
      var _$unhandledRejection_47 = {
        load: /* @__PURE__ */ __name(function(client) {
          if (!client._config.autoDetectErrors || !client._config.enabledErrorTypes.unhandledRejections) return;
          ___handler_47 = /* @__PURE__ */ __name(function(err) {
            var ctx = client._clientContext && client._clientContext.getStore();
            var c9 = ctx || client;
            var unhandled = !client._config.reportUnhandledPromiseRejectionsAsHandled;
            var event = c9.Event.create(err, false, {
              severity: "error",
              unhandled,
              severityReason: {
                type: "unhandledPromiseRejection"
              }
            }, "unhandledRejection handler", 1);
            return new Promise(function(resolve33) {
              c9._notify(event, function() {
              }, function(e10, event2) {
                if (e10) c9._logger.error("Failed to send event to Bugsnag");
                c9._config.onUnhandledRejection(err, event2, c9._logger);
                resolve33();
              });
            });
          }, "___handler_47");
          if (process.prependListener) {
            process.prependListener("unhandledRejection", ___handler_47);
          } else {
            process.on("unhandledRejection", ___handler_47);
          }
        }, "load"),
        destroy: /* @__PURE__ */ __name(function() {
          process.removeListener("unhandledRejection", ___handler_47);
        }, "destroy")
      };
      var _$Backoff_6 = Backoff;
      function Backoff(opts) {
        opts = opts || {};
        this.ms = opts.min || 100;
        this.max = opts.max || 1e4;
        this.factor = opts.factor || 2;
        this.jitter = opts.jitter > 0 && opts.jitter <= 1 ? opts.jitter : 0;
        this.attempts = 0;
      }
      __name(Backoff, "Backoff");
      Backoff.prototype.duration = function() {
        var ms = this.ms * Math.pow(this.factor, this.attempts++);
        if (this.jitter) {
          var rand = Math.random();
          var deviation = Math.floor(rand * this.jitter * ms);
          ms = (Math.floor(rand * 10) & 1) == 0 ? ms - deviation : ms + deviation;
        }
        return Math.min(ms, this.max) | 0;
      };
      Backoff.prototype.reset = function() {
        this.attempts = 0;
      };
      function ___inheritsLoose_49(t13, o7) {
        t13.prototype = Object.create(o7.prototype), t13.prototype.constructor = t13, ___setPrototypeOf_49(t13, o7);
      }
      __name(___inheritsLoose_49, "___inheritsLoose_49");
      function ___setPrototypeOf_49(t13, e10) {
        return ___setPrototypeOf_49 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t14, e11) {
          return t14.__proto__ = e11, t14;
        }, ___setPrototypeOf_49(t13, e10);
      }
      __name(___setPrototypeOf_49, "___setPrototypeOf_49");
      var DEFAULT_SUMMARY_INTERVAL = 10 * 1e3;
      var Emitter = __require("events").EventEmitter;
      var _$tracker_49 = /* @__PURE__ */ function(_Emitter) {
        function SessionTracker(intervalLength) {
          var _this;
          _this = _Emitter.call(this) || this;
          _this._sessions = /* @__PURE__ */ new Map();
          _this._interval = null;
          _this._intervalLength = intervalLength || DEFAULT_SUMMARY_INTERVAL;
          _this._summarize = _this._summarize.bind(_this);
          return _this;
        }
        __name(SessionTracker, "SessionTracker");
        ___inheritsLoose_49(SessionTracker, _Emitter);
        var _proto = SessionTracker.prototype;
        _proto.start = /* @__PURE__ */ __name(function start() {
          if (!this._interval) {
            this._interval = setInterval(this._summarize, this._intervalLength).unref();
          }
        }, "start");
        _proto.stop = /* @__PURE__ */ __name(function stop() {
          clearInterval(this._interval);
          this._interval = null;
        }, "stop");
        _proto.track = /* @__PURE__ */ __name(function track(session) {
          var key = dateToMsKey(session.startedAt);
          var cur = this._sessions.get(key);
          this._sessions.set(key, typeof cur === "undefined" ? 1 : cur + 1);
          return session;
        }, "track");
        _proto._summarize = /* @__PURE__ */ __name(function _summarize() {
          var _this2 = this;
          var summary = [];
          this._sessions.forEach(function(val2, key) {
            summary.push({
              startedAt: key,
              sessionsStarted: val2
            });
            _this2._sessions["delete"](key);
          });
          if (!summary.length) return;
          this.emit("summary", summary);
        }, "_summarize");
        return SessionTracker;
      }(Emitter);
      var dateToMsKey = /* @__PURE__ */ __name(function(d8) {
        var dk = new Date(d8);
        dk.setSeconds(0);
        dk.setMilliseconds(0);
        return dk.toISOString();
      }, "dateToMsKey");
      var _$session_48 = {
        load: /* @__PURE__ */ __name(function(client) {
          var sessionTracker = new _$tracker_49(client._config.sessionSummaryInterval);
          sessionTracker.on("summary", sendSessionSummary(client));
          sessionTracker.start();
          client._sessionDelegate = {
            startSession: /* @__PURE__ */ __name(function(client2, session) {
              client2._session = session;
              client2._pausedSession = null;
              sessionTracker.track(client2._session);
              return client2;
            }, "startSession"),
            pauseSession: /* @__PURE__ */ __name(function(client2) {
              client2._pausedSession = client2._session;
              client2._session = null;
            }, "pauseSession"),
            resumeSession: /* @__PURE__ */ __name(function(client2) {
              if (client2._session) {
                return client2;
              }
              if (client2._pausedSession) {
                client2._session = client2._pausedSession;
                client2._pausedSession = null;
                return client2;
              }
              return client2.startSession();
            }, "resumeSession")
          };
        }, "load"),
        configSchema: {
          sessionSummaryInterval: {
            defaultValue: /* @__PURE__ */ __name(function() {
              return void 0;
            }, "defaultValue"),
            validate: /* @__PURE__ */ __name(function(value) {
              return value === void 0 || _$intRange_31()(value);
            }, "validate"),
            message: "should be a positive integer"
          }
        }
      };
      var sendSessionSummary = /* @__PURE__ */ __name(function(client) {
        return function(sessionCounts) {
          if (client._config.enabledReleaseStages !== null && !client._config.enabledReleaseStages.includes(client._config.releaseStage)) {
            client._logger.warn("Session not sent due to releaseStage/enabledReleaseStages configuration");
            return;
          }
          if (!sessionCounts.length) return;
          var backoff = new _$Backoff_6({
            min: 1e3,
            max: 1e4
          });
          var maxAttempts = 10;
          req(handleRes);
          function handleRes(err) {
            if (!err) {
              var sessionCount = sessionCounts.reduce(function(accum, s7) {
                return accum + s7.sessionsStarted;
              }, 0);
              return client._logger.debug(sessionCount + " session(s) reported");
            }
            if (backoff.attempts === 10) {
              client._logger.error("Session delivery failed, max retries exceeded", err);
              return;
            }
            client._logger.debug("Session delivery failed, retry #" + (backoff.attempts + 1) + "/" + maxAttempts, err);
            setTimeout(function() {
              return req(handleRes);
            }, backoff.duration());
          }
          __name(handleRes, "handleRes");
          function req(cb2) {
            var payload = {
              notifier: client._notifier,
              device: {},
              app: {
                releaseStage: client._config.releaseStage,
                version: client._config.appVersion,
                type: client._config.appType
              },
              sessionCounts
            };
            var ignore2 = _$syncCallbackRunner_30(client._cbs.sp, payload, "onSessionPayload", client._logger);
            if (ignore2) {
              client._logger.debug("Session not sent due to onSessionPayload callback");
              return cb2(null);
            }
            client._delivery.sendSession(payload, cb2);
          }
          __name(req, "req");
        };
      }, "sendSessionSummary");
      var _$pathNormaliser_50 = {
        load: /* @__PURE__ */ __name(function(client) {
          client.addOnError(function(event) {
            var allFrames = event.errors.reduce(function(accum, er2) {
              return accum.concat(er2.stacktrace);
            }, []);
            allFrames.forEach(function(stackframe) {
              if (typeof stackframe.file !== "string") {
                return;
              }
              stackframe.file = stackframe.file.replace(/\\/g, "/");
            });
          });
        }, "load")
      };
      var _$stripProjectRoot_51 = {
        load: /* @__PURE__ */ __name(function(client) {
          return client.addOnError(function(event) {
            if (!client._config.projectRoot) return;
            var projectRoot = _$pathNormalizer_29(client._config.projectRoot);
            var allFrames = event.errors.reduce(function(accum, er2) {
              return accum.concat(er2.stacktrace);
            }, []);
            allFrames.map(function(stackframe) {
              if (typeof stackframe.file === "string" && stackframe.file.indexOf(projectRoot) === 0) {
                stackframe.file = stackframe.file.replace(projectRoot, "");
              }
            });
          });
        }, "load")
      };
      var _$notifier_38 = {};
      function ___extends_38() {
        return ___extends_38 = Object.assign ? Object.assign.bind() : function(n9) {
          for (var e10 = 1; e10 < arguments.length; e10++) {
            var t13 = arguments[e10];
            for (var r10 in t13) ({}).hasOwnProperty.call(t13, r10) && (n9[r10] = t13[r10]);
          }
          return n9;
        }, ___extends_38.apply(null, arguments);
      }
      __name(___extends_38, "___extends_38");
      var name2 = "Bugsnag Node";
      var version5 = "8.6.0";
      var url4 = "https://github.com/bugsnag/bugsnag-js";
      var ___require_38 = __require("async_hooks"), AsyncLocalStorage4 = ___require_38.AsyncLocalStorage;
      _$Event_10.__type = "nodejs";
      var __schema_38 = ___extends_38({}, _$config_9.schema, _$config_37);
      var internalPlugins = [_$app_39, _$surroundingCode_45, _$inProject_44, _$stripProjectRoot_51, _$session_48, _$device_43, _$uncaughtException_46, _$unhandledRejection_47, _$intercept_42, _$contextualize_41, _$pathNormaliser_50, _$consoleBreadcrumbs_40];
      var Bugsnag2 = {
        _client: null,
        createClient: /* @__PURE__ */ __name(function(opts) {
          if (typeof opts === "string") opts = {
            apiKey: opts
          };
          if (!opts) opts = {};
          var bugsnag2 = new _$Client_8(opts, __schema_38, internalPlugins, {
            name: name2,
            version: version5,
            url: url4
          });
          Object.keys(_$Client_8.prototype).forEach(function(m7) {
            var original = bugsnag2[m7];
            bugsnag2[m7] = function() {
              var contextClient = bugsnag2._clientContext && typeof bugsnag2._clientContext.getStore === "function" ? bugsnag2._clientContext.getStore() : null;
              var client = contextClient || bugsnag2;
              var originalMethod = contextClient ? contextClient[m7] : original;
              client._depth += 1;
              var ret = originalMethod.apply(client, arguments);
              client._depth -= 1;
              return ret;
            };
          });
          bugsnag2._clientContext = new AsyncLocalStorage4();
          bugsnag2._setDelivery(_$delivery_35);
          bugsnag2._logger.debug("Loaded!");
          return bugsnag2;
        }, "createClient"),
        start: /* @__PURE__ */ __name(function(opts) {
          if (Bugsnag2._client) {
            Bugsnag2._client._logger.warn("Bugsnag.start() was called more than once. Ignoring.");
            return Bugsnag2._client;
          }
          Bugsnag2._client = Bugsnag2.createClient(opts);
          return Bugsnag2._client;
        }, "start"),
        isStarted: /* @__PURE__ */ __name(function() {
          return Bugsnag2._client != null;
        }, "isStarted")
      };
      Object.keys(_$Client_8.prototype).forEach(function(m7) {
        if (/^_/.test(m7)) return;
        Bugsnag2[m7] = function() {
          var client = Bugsnag2._client;
          var ctx = client && client._clientContext && client._clientContext.getStore();
          if (ctx) {
            client = ctx;
          }
          if (!client) return console.error("Bugsnag." + m7 + "() was called before Bugsnag.start()");
          client._depth += 1;
          var ret = client[m7].apply(client, arguments);
          client._depth -= 1;
          return ret;
        };
      });
      _$notifier_38 = Bugsnag2;
      _$notifier_38.Client = _$Client_8;
      _$notifier_38.Event = _$Event_10;
      _$notifier_38.Session = _$Session_34;
      _$notifier_38.Breadcrumb = _$Breadcrumb_7;
      _$notifier_38["default"] = Bugsnag2;
      return _$notifier_38;
    });
  }
});

// ../../node_modules/.pnpm/@bugsnag+js@8.6.0/node_modules/@bugsnag/js/node/notifier.js
var require_notifier = __commonJS({
  "../../node_modules/.pnpm/@bugsnag+js@8.6.0/node_modules/@bugsnag/js/node/notifier.js"(exports, module2) {
    init_import_meta_url();
    module2.exports = require_bugsnag();
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/metrics.js
function report(error2, options = {}) {
  const normalizedError = normalizeError(error2);
  const client = options.client || Bugsnag;
  client.notify(normalizedError, (event) => {
    for (const [section, values] of Object.entries(options.metadata || {})) {
      event.addMetadata(section, values);
    }
    if (typeof error2 === "object" && "documentation_url" in error2) {
      event.addMetadata("Documentation URL", error2.documentation_url);
    }
    event.context = options.context;
    event.severity = options.severity || "error";
    event.context = options.context;
  });
}
var import_js, Bugsnag, normalizeError;
var init_metrics3 = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/metrics.js"() {
    init_import_meta_url();
    import_js = __toESM(require_notifier(), 1);
    ({ default: Bugsnag } = import_js.default);
    normalizeError = /* @__PURE__ */ __name((error2) => {
      if (error2 instanceof Error) {
        return error2;
      }
      if (typeof error2 === "object" && (error2.errorClass || error2.name)) {
        return error2;
      }
      if (typeof error2 === "string") {
        return new Error(error2);
      }
      if (typeof error2 === "object" && error2.message) {
        return new Error(error2.message);
      }
      return new Error(`Unexpected error format: ${JSON.stringify(error2)}`);
    }, "normalizeError");
    __name(report, "report");
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/package-managers/detect-package-manager.js
function sniffUserAgent2(project) {
  const userAgent = project.getEnv("npm_config_user_agent");
  if (userAgent === void 0) {
    return void 0;
  }
  if (userAgent.includes("yarn")) {
    return "yarn";
  }
  if (userAgent.includes("pnpm")) {
    return "pnpm";
  }
  if (userAgent.includes("bun")) {
    return "bun";
  }
  if (userAgent.includes("npm")) {
    return "npm";
  }
}
var import_semver8, AVAILABLE_PACKAGE_MANAGERS, lockFileMap, detectPackageManager;
var init_detect_package_manager = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/package-managers/detect-package-manager.js"() {
    init_import_meta_url();
    import_semver8 = __toESM(require_semver2(), 1);
    AVAILABLE_PACKAGE_MANAGERS = {
      [
        "yarn"
        /* PkgManager.YARN */
      ]: {
        name: "yarn",
        installCommand: "yarn install",
        runCommand: "yarn run",
        localPackageCommand: "yarn",
        remotePackageCommand: ["yarn", "dlx"],
        lockFiles: ["yarn.lock"],
        forceEnvironment: "NETLIFY_USE_YARN"
      },
      [
        "pnpm"
        /* PkgManager.PNPM */
      ]: {
        name: "pnpm",
        installCommand: "pnpm install",
        runCommand: "pnpm run",
        localPackageCommand: "pnpm",
        remotePackageCommand: ["pnpm", "dlx"],
        lockFiles: ["pnpm-lock.yaml"],
        forceEnvironment: "NETLIFY_USE_PNPM"
      },
      [
        "npm"
        /* PkgManager.NPM */
      ]: {
        name: "npm",
        installCommand: "npm install",
        runCommand: "npm run",
        localPackageCommand: "npx",
        remotePackageCommand: ["npx"],
        lockFiles: ["package-lock.json"]
      },
      [
        "bun"
        /* PkgManager.BUN */
      ]: {
        name: "bun",
        installCommand: "bun install",
        runCommand: "bun run",
        localPackageCommand: "bunx",
        remotePackageCommand: ["bunx"],
        lockFiles: ["bun.lockb", "bun.lock"]
      }
    };
    __name(sniffUserAgent2, "sniffUserAgent");
    lockFileMap = Object.values(AVAILABLE_PACKAGE_MANAGERS).reduce((cur, pkgManager) => pkgManager.lockFiles.reduce((cur2, lockFile) => ({ ...cur2, [lockFile]: pkgManager }), cur), {});
    detectPackageManager = /* @__PURE__ */ __name(async (project, options) => {
      const sniffedPkgManager = options?.enableUserAgentSniffing ? sniffUserAgent2(project) : void 0;
      try {
        const pkgPaths = await project.fs.findUpMultiple("package.json", {
          cwd: project.baseDirectory,
          stopAt: project.root
        });
        if (!pkgPaths.length) {
          return sniffedPkgManager ? AVAILABLE_PACKAGE_MANAGERS[sniffedPkgManager] : null;
        }
        for (const pkgPath of pkgPaths) {
          const { packageManager } = await project.fs.readJSON(pkgPath);
          if (packageManager) {
            const [parsed, version5] = packageManager.split("@");
            if (AVAILABLE_PACKAGE_MANAGERS[parsed]) {
              const pkgManager = AVAILABLE_PACKAGE_MANAGERS[parsed];
              pkgManager.version = (0, import_semver8.parse)(version5) || void 0;
              return pkgManager;
            }
          }
        }
        for (const pkgManager of Object.values(AVAILABLE_PACKAGE_MANAGERS)) {
          if (pkgManager.forceEnvironment && project.getEnv(pkgManager.forceEnvironment) === "true") {
            return pkgManager;
          }
        }
        const lockFilePath = await project.fs.findUp(Object.keys(lockFileMap), {
          cwd: project.baseDirectory,
          stopAt: project.root
        });
        if (lockFilePath) {
          const lockFile = project.fs.basename(lockFilePath);
          const pkgManager = lockFileMap[lockFile];
          if (!(pkgManager.forceEnvironment && project.getEnv(pkgManager.forceEnvironment) === "false")) {
            return pkgManager;
          }
        }
      } catch (error2) {
        project.report(error2);
      }
      if (sniffedPkgManager) {
        return AVAILABLE_PACKAGE_MANAGERS[sniffedPkgManager];
      }
      return AVAILABLE_PACKAGE_MANAGERS[
        "npm"
        /* PkgManager.NPM */
      ];
    }, "detectPackageManager");
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/runtime/runtime.js
var LangRuntime;
var init_runtime = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/runtime/runtime.js"() {
    init_import_meta_url();
    LangRuntime = class {
      static {
        __name(this, "LangRuntime");
      }
      project;
      id;
      name;
      configFiles = [];
      constructor(project) {
        this.project = project;
      }
      async detect() {
        const config = await this.project.fs.findUp(this.configFiles, {
          cwd: this.project.baseDirectory,
          stopAt: this.project.root
        });
        if (config) {
          return this;
        }
      }
      toJSON() {
        return {
          id: this.id,
          name: this.name
        };
      }
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/runtime/brew.js
var Brew;
var init_brew = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/runtime/brew.js"() {
    init_import_meta_url();
    init_runtime();
    Brew = class extends LangRuntime {
      static {
        __name(this, "Brew");
      }
      id = "brew";
      name = "Brew";
      configFiles = ["Brewfile.netlify"];
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/runtime/bun.js
var Bun;
var init_bun = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/runtime/bun.js"() {
    init_import_meta_url();
    init_runtime();
    Bun = class extends LangRuntime {
      static {
        __name(this, "Bun");
      }
      id = "bun";
      name = "Bun";
      configFiles = ["bun.lock", "bun.lockb", "bunfig.toml"];
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/runtime/cask.js
var Emacs;
var init_cask = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/runtime/cask.js"() {
    init_import_meta_url();
    init_runtime();
    Emacs = class extends LangRuntime {
      static {
        __name(this, "Emacs");
      }
      id = "emacs";
      name = "Emacs";
      configFiles = ["Cask"];
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/runtime/dotnet.js
var Dotnet;
var init_dotnet = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/runtime/dotnet.js"() {
    init_import_meta_url();
    init_runtime();
    Dotnet = class extends LangRuntime {
      static {
        __name(this, "Dotnet");
      }
      id = "dotnet";
      name = "Dotnet";
      configFiles = ["Program.cs", "appsettings.json"];
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/runtime/erlang.js
var Erlang;
var init_erlang = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/runtime/erlang.js"() {
    init_import_meta_url();
    init_runtime();
    Erlang = class extends LangRuntime {
      static {
        __name(this, "Erlang");
      }
      id = "erlang";
      name = "Erlang";
      configFiles = ["rebar.config", "rebar.lock"];
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/runtime/go.js
var Go;
var init_go = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/runtime/go.js"() {
    init_import_meta_url();
    init_runtime();
    Go = class extends LangRuntime {
      static {
        __name(this, "Go");
      }
      id = "go";
      name = "Go";
      configFiles = ["go.mod", ".go-version", "go.work"];
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/runtime/java.js
var Java;
var init_java = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/runtime/java.js"() {
    init_import_meta_url();
    init_runtime();
    Java = class extends LangRuntime {
      static {
        __name(this, "Java");
      }
      id = "java";
      name = "Java";
      configFiles = ["project.clj", "build.boot"];
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/runtime/node.js
var Node;
var init_node3 = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/runtime/node.js"() {
    init_import_meta_url();
    init_runtime();
    Node = class extends LangRuntime {
      static {
        __name(this, "Node");
      }
      id = "node";
      name = "NodeJS";
      configFiles = [".node-version", ".nvmrc", "package.json"];
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/runtime/php.js
var Php;
var init_php = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/runtime/php.js"() {
    init_import_meta_url();
    init_runtime();
    Php = class extends LangRuntime {
      static {
        __name(this, "Php");
      }
      id = "php";
      name = "Php";
      configFiles = ["composer.json"];
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/runtime/python.js
var Python;
var init_python = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/runtime/python.js"() {
    init_import_meta_url();
    init_runtime();
    Python = class extends LangRuntime {
      static {
        __name(this, "Python");
      }
      id = "python";
      name = "Python";
      configFiles = ["requirements.txt", "Pipfile"];
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/runtime/ruby.js
var Ruby;
var init_ruby = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/runtime/ruby.js"() {
    init_import_meta_url();
    init_runtime();
    Ruby = class extends LangRuntime {
      static {
        __name(this, "Ruby");
      }
      id = "ruby";
      name = "Ruby";
      configFiles = [".ruby-version", "Gemfile.lock", "Gemfile"];
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/runtime/rust.js
var Rust;
var init_rust = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/runtime/rust.js"() {
    init_import_meta_url();
    init_runtime();
    Rust = class extends LangRuntime {
      static {
        __name(this, "Rust");
      }
      id = "rust";
      name = "Rust";
      configFiles = ["Cargo.toml", "Cargo.lock"];
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/runtime/swift.js
var Swift;
var init_swift = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/runtime/swift.js"() {
    init_import_meta_url();
    init_runtime();
    Swift = class extends LangRuntime {
      static {
        __name(this, "Swift");
      }
      id = "swift";
      name = "Swift";
      configFiles = [".swift-version", "Package.swift"];
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/runtime/index.js
var runtimes;
var init_runtime2 = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/runtime/index.js"() {
    init_import_meta_url();
    init_brew();
    init_bun();
    init_cask();
    init_dotnet();
    init_erlang();
    init_go();
    init_java();
    init_node3();
    init_php();
    init_python();
    init_ruby();
    init_rust();
    init_swift();
    runtimes = [Node, Ruby, Brew, Bun, Dotnet, Emacs, Erlang, Go, Java, Php, Rust, Swift, Python];
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/settings/get-build-settings.js
async function applyBuildSystemOverrides(settings, project, baseDirectory) {
  const buildSystem = project.buildSystems[0];
  const updatedSettings = { ...settings };
  if (baseDirectory && buildSystem) {
    const cmds = await buildSystem.getCommands?.(baseDirectory) || [];
    const build5 = cmds.find((cmd) => cmd.type === "build");
    const dev2 = cmds.find((cmd) => cmd.type === "dev");
    const dist = await buildSystem.getDist?.(baseDirectory);
    const port = await buildSystem.getPort?.(baseDirectory);
    updatedSettings.name = `${buildSystem.name} + ${settings.name} ${baseDirectory}`;
    if (build5) {
      updatedSettings.buildCommand = build5.command;
    }
    if (dev2) {
      updatedSettings.devCommand = dev2.command;
    }
    if (dist) {
      updatedSettings.dist = dist;
    }
    if (port !== void 0 && port !== null) {
      updatedSettings.frameworkPort = port;
    }
    if (buildSystem.runFromRoot && build5 && dev2) {
      updatedSettings.baseDirectory = "";
    }
  }
  return updatedSettings;
}
async function getSettings2(framework, project, baseDirectory) {
  const devCommands = framework.getDevCommands();
  const buildCommands = framework.getBuildCommands();
  const settings = {
    name: framework.name,
    buildCommand: buildCommands[0],
    devCommand: devCommands[0],
    frameworkPort: framework.dev?.port,
    dist: project.fs.join(baseDirectory, framework.build.directory),
    env: framework.env || {},
    plugins_from_config_file: [],
    plugins_recommended: framework.plugins || [],
    framework: {
      id: framework.id,
      name: framework.name
    },
    baseDirectory,
    packagePath: baseDirectory,
    pollingStrategies: framework.dev?.pollingStrategies?.map(({ name: name2 }) => name2) || []
  };
  if (typeof framework.dev?.clearPublishDirectory !== "undefined") {
    settings.clearPublishDirectory = framework.dev.clearPublishDirectory;
  }
  if (baseDirectory?.length && project.workspace?.isRoot) {
    settings.dist = project.fs.join(baseDirectory, framework.build.directory);
  }
  return applyBuildSystemOverrides(
    settings,
    // await applyPackageManagerOverrides(settings, project, baseDirectory),
    project,
    baseDirectory
  );
}
async function getBuildSettings(project, packagePath) {
  if (project.frameworks === void 0) {
    throw new Error("Please run the framework detection before calling the build settings!");
  }
  const baseDirectory = packagePath ?? project.relativeBaseDirectory ?? "";
  const settingsPromises = [];
  project.logger.debug(`[get-build-settings.ts] getBuildSettings for baseDirectory: ${baseDirectory}`);
  if (project.workspace && project.workspace.packages.length > 0 && baseDirectory.length === 0) {
    for (const [relPkg, frameworks2] of [...project.frameworks.entries()]) {
      for (const framework of frameworks2) {
        settingsPromises.push(getSettings2(framework, project, relPkg));
      }
    }
  } else {
    for (const framework of project.frameworks.get(baseDirectory) || []) {
      settingsPromises.push(getSettings2(framework, project, baseDirectory));
    }
  }
  const settings = await Promise.all(settingsPromises);
  return settings.filter(Boolean);
}
var init_get_build_settings = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/settings/get-build-settings.js"() {
    init_import_meta_url();
    __name(applyBuildSystemOverrides, "applyBuildSystemOverrides");
    __name(getSettings2, "getSettings");
    __name(getBuildSettings, "getBuildSettings");
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/project.js
var import_semver9, Project;
var init_project = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/project.js"() {
    init_import_meta_url();
    import_semver9 = __toESM(require_semver2(), 1);
    init_build_systems();
    init_events8();
    init_framework();
    init_frameworks2();
    init_get_framework();
    init_metrics3();
    init_detect_package_manager();
    init_runtime2();
    init_get_build_settings();
    init_detect_workspace();
    Project = class {
      static {
        __name(this, "Project");
      }
      fs;
      /** An optional repository root that tells us where to stop looking up */
      root;
      /** An absolute path  */
      baseDirectory;
      /** a relative base directory (like the path to workspace packages)  */
      relativeBaseDirectory;
      /** the detected package manager (if null it's not a javascript project, undefined indicates that id did not run yet) */
      packageManager;
      /** an absolute path of the root directory for js workspaces where the most top package.json is located */
      jsWorkspaceRoot;
      /* the detected javascript workspace information (if null it's not a workspace, undefined indicates that id did not run yet) */
      workspace;
      /** The detected build-systems */
      buildSystems;
      /** The combined build settings for a project, in a workspace there can be multiple settings per package */
      settings;
      /** The detected frameworks for each path in a project */
      frameworks;
      /** The detected language runtimes */
      runtimes;
      /** a representation of the current environment */
      #environment = {};
      /** A bugsnag session */
      bugsnag;
      /** A logging instance  */
      logger;
      /** A function that is used to report errors */
      reportFn = report;
      events = new EventEmitter3();
      /** The current nodeVersion (can be set by node.js environments) */
      _nodeVersion = null;
      setNodeVersion(version5) {
        this._nodeVersion = (0, import_semver9.parse)((0, import_semver9.coerce)(version5), { loose: true });
        return this;
      }
      async getCurrentNodeVersion() {
        if (this._nodeVersion) {
          return this._nodeVersion;
        }
        const nodeEnv = (0, import_semver9.parse)((0, import_semver9.coerce)(this.getEnv("NODE_VERSION")), { loose: true });
        if (nodeEnv) {
          return nodeEnv;
        }
        const nvmrc = await this.fs.gracefullyReadFile(".nvmrc");
        if (nvmrc) {
          return (0, import_semver9.parse)((0, import_semver9.coerce)(nvmrc, { loose: true }));
        }
        const nodeVersion2 = await this.fs.gracefullyReadFile(".node_version");
        if (nodeVersion2) {
          return (0, import_semver9.parse)((0, import_semver9.coerce)(nodeVersion2, { loose: true }));
        }
        return null;
      }
      async isRedwoodProject() {
        return await this.fs.fileExists(this.fs.resolve(this.fs.cwd, "redwood.toml"));
      }
      constructor(fs33, baseDirectory, root) {
        this.fs = fs33;
        this.baseDirectory = fs33.resolve(root || "", baseDirectory !== void 0 ? baseDirectory : fs33.cwd);
        this.root = root ? fs33.resolve(fs33.cwd, root) : void 0;
        this.relativeBaseDirectory = baseDirectory !== void 0 && !fs33.isAbsolute(baseDirectory) ? baseDirectory : fs33.relative(this.root || fs33.cwd, this.baseDirectory);
        this.fs.cwd = this.baseDirectory;
        this.logger = fs33.logger;
      }
      /** Set's the environment for the project */
      setEnvironment(env6) {
        this.#environment = env6;
        return this;
      }
      /** Sets the function that is used to report errors. Overrides the default bugsnag reporting for the project */
      setReportFn(fn2) {
        this.reportFn = fn2;
        return this;
      }
      /** Sets a bugsnag client for the current session */
      setBugsnag(client) {
        if (client) {
          this.bugsnag = client;
        }
        return this;
      }
      /** retrieves an environment variable */
      getEnv(key) {
        return this.#environment[key];
      }
      /** Reports an error with additional metadata */
      report(error2, config = {}) {
        this.fs.logger.error(error2);
        this.reportFn(error2, {
          metadata: {
            build: {
              baseDirectory: this.baseDirectory,
              root: this.root
            },
            ...config.metadata || {}
          },
          context: config.context,
          severity: config.severity,
          client: this.bugsnag
        });
      }
      /** Retrieve the run command for an npm script  */
      getNpmScriptCommand(npmScript) {
        const runCmd = this.packageManager?.runCommand || AVAILABLE_PACKAGE_MANAGERS.npm.runCommand;
        return `${runCmd} ${npmScript}`;
      }
      /** retrieves the root package.json file */
      async getRootPackageJSON() {
        const rootJSONPath = (await this.fs.findUpMultiple("package.json", { cwd: this.baseDirectory, stopAt: this.root })).pop();
        if (rootJSONPath) {
          this.jsWorkspaceRoot = this.fs.dirname(rootJSONPath);
          return this.fs.readJSON(rootJSONPath);
        }
        return {};
      }
      /** Retrieves the package.json and if one found with it's pkgPath */
      async getPackageJSON(startDirectory) {
        const pkgPath = await this.fs.findUp("package.json", {
          cwd: startDirectory || this.baseDirectory,
          stopAt: this.root
        });
        if (pkgPath) {
          const json = await this.fs.readJSON(pkgPath);
          return Object.assign(json, { pkgPath });
        }
        return { pkgPath: null };
      }
      /** Resolves a path correctly with a package path, independent of run from the workspace root or from a package */
      resolveFromPackage(packagePath, ...parts) {
        if (this.jsWorkspaceRoot) {
          return this.fs.join(this.jsWorkspaceRoot, packagePath, ...parts);
        }
        return this.baseDirectory.endsWith(packagePath) && !this.workspace?.isRoot ? this.fs.join(this.baseDirectory, ...parts) : this.fs.resolve(packagePath, ...parts);
      }
      /** Detects the used package Manager */
      async detectPackageManager(options) {
        this.logger.debug("[project.ts]: detectPackageManager");
        if (this.packageManager !== void 0) {
          return this.packageManager;
        }
        try {
          this.packageManager = await detectPackageManager(this, options);
          await this.events.emit("detectPackageManager", this.packageManager);
          return this.packageManager;
        } catch {
          return null;
        }
      }
      /** Detects the javascript workspace settings */
      async detectWorkspaces() {
        this.logger.debug("[project.ts]: detectWorkspaces");
        if (this.workspace !== void 0) {
          return this.workspace;
        }
        await this.detectPackageManager();
        try {
          this.workspace = await detectWorkspaces(this);
          await this.events.emit("detectWorkspaces", this.workspace);
          return this.workspace;
        } catch (error2) {
          this.report(error2);
          return null;
        }
      }
      /** Detects all used build systems */
      async detectBuildSystem() {
        this.logger.debug("[project.ts]: detectBuildSystem");
        if (this.buildSystems !== void 0) {
          return this.buildSystems;
        }
        await this.detectWorkspaces();
        try {
          this.buildSystems = (await Promise.all(buildSystems.map((BuildSystem) => new BuildSystem(this).detect()))).filter(Boolean);
          await this.events.emit("detectBuildsystems", this.buildSystems);
          return this.buildSystems;
        } catch (error2) {
          this.report(error2);
          return [];
        }
      }
      /** Detects all used runtimes */
      async detectRuntime() {
        this.logger.debug("[project.ts]: detectRuntime");
        try {
          this.runtimes = (await Promise.all(runtimes.map((Runtime) => new Runtime(this).detect()))).filter(Boolean);
          this.events.emit("detectRuntimes", this.runtimes);
          return this.runtimes;
        } catch (error2) {
          this.report(error2);
          return [];
        }
      }
      /** Detects all used frameworks */
      async detectFrameworks() {
        this.logger.debug("[project.ts]: detectFrameworks");
        if (this.frameworks !== void 0) {
          return [...this.frameworks.values()].flat();
        }
        try {
          await this.detectBuildSystem();
          this.frameworks = /* @__PURE__ */ new Map();
          if (this.workspace) {
            await Promise.all(this.workspace.packages.map(async ({ path: pkg, forcedFramework }) => {
              if (forcedFramework) {
                try {
                  const framework = await getFramework(forcedFramework, this);
                  this.frameworks.set(pkg, [framework]);
                } catch {
                }
              } else if (this.workspace) {
                const result = await this.detectFrameworksInPath(this.fs.join(this.workspace.rootDir, pkg));
                this.frameworks.set(pkg, result);
              }
            }));
          } else {
            this.frameworks.set("", await this.detectFrameworksInPath());
          }
          await this.events.emit("detectFrameworks", this.frameworks);
          return [...this.frameworks.values()].flat();
        } catch (error2) {
          this.report(error2);
          return null;
        }
      }
      async detectFrameworksInPath(path84) {
        this.logger.debug(`[project.ts]: detectFrameworksInPath - ${path84}`);
        try {
          const detected = (await Promise.all(frameworks.map((Framework2) => new Framework2(this, path84).detect()))).filter(Boolean);
          return filterByRelevance(detected);
        } catch {
          return [];
        }
      }
      async getBuildSettings(packagePath) {
        this.logger.debug("[project.ts]: getBuildSettings");
        if (this.settings !== void 0) {
          return this.settings;
        }
        this.settings = [];
        try {
          await this.detectFrameworks();
          this.settings = await getBuildSettings(this, packagePath);
          await this.events.emit("detectSettings", this.settings);
        } catch (error2) {
          this.report(error2);
        }
        return this.settings;
      }
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/index.js
var init_lib6 = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/index.js"() {
    init_import_meta_url();
    init_file_system();
    init_logger3();
    init_get_framework();
    init_project();
    init_get_build_settings();
    init_detect_workspace();
  }
});

// ../../node_modules/.pnpm/yocto-queue@1.0.0/node_modules/yocto-queue/index.js
var Node2, Queue;
var init_yocto_queue = __esm({
  "../../node_modules/.pnpm/yocto-queue@1.0.0/node_modules/yocto-queue/index.js"() {
    init_import_meta_url();
    Node2 = class {
      static {
        __name(this, "Node");
      }
      value;
      next;
      constructor(value) {
        this.value = value;
      }
    };
    Queue = class {
      static {
        __name(this, "Queue");
      }
      #head;
      #tail;
      #size;
      constructor() {
        this.clear();
      }
      enqueue(value) {
        const node2 = new Node2(value);
        if (this.#head) {
          this.#tail.next = node2;
          this.#tail = node2;
        } else {
          this.#head = node2;
          this.#tail = node2;
        }
        this.#size++;
      }
      dequeue() {
        const current = this.#head;
        if (!current) {
          return;
        }
        this.#head = this.#head.next;
        this.#size--;
        return current.value;
      }
      clear() {
        this.#head = void 0;
        this.#tail = void 0;
        this.#size = 0;
      }
      get size() {
        return this.#size;
      }
      *[Symbol.iterator]() {
        let current = this.#head;
        while (current) {
          yield current.value;
          current = current.next;
        }
      }
    };
  }
});

// ../../node_modules/.pnpm/p-limit@4.0.0/node_modules/p-limit/index.js
function pLimit(concurrency) {
  if (!((Number.isInteger(concurrency) || concurrency === Number.POSITIVE_INFINITY) && concurrency > 0)) {
    throw new TypeError("Expected `concurrency` to be a number from 1 and up");
  }
  const queue = new Queue();
  let activeCount = 0;
  const next = /* @__PURE__ */ __name(() => {
    activeCount--;
    if (queue.size > 0) {
      queue.dequeue()();
    }
  }, "next");
  const run2 = /* @__PURE__ */ __name(async (fn2, resolve32, args) => {
    activeCount++;
    const result = (async () => fn2(...args))();
    resolve32(result);
    try {
      await result;
    } catch {
    }
    next();
  }, "run");
  const enqueue = /* @__PURE__ */ __name((fn2, resolve32, args) => {
    queue.enqueue(run2.bind(void 0, fn2, resolve32, args));
    (async () => {
      await Promise.resolve();
      if (activeCount < concurrency && queue.size > 0) {
        queue.dequeue()();
      }
    })();
  }, "enqueue");
  const generator = /* @__PURE__ */ __name((fn2, ...args) => new Promise((resolve32) => {
    enqueue(fn2, resolve32, args);
  }), "generator");
  Object.defineProperties(generator, {
    activeCount: {
      get: /* @__PURE__ */ __name(() => activeCount, "get")
    },
    pendingCount: {
      get: /* @__PURE__ */ __name(() => queue.size, "get")
    },
    clearQueue: {
      value: /* @__PURE__ */ __name(() => {
        queue.clear();
      }, "value")
    }
  });
  return generator;
}
var init_p_limit = __esm({
  "../../node_modules/.pnpm/p-limit@4.0.0/node_modules/p-limit/index.js"() {
    init_import_meta_url();
    init_yocto_queue();
    __name(pLimit, "pLimit");
  }
});

// ../../node_modules/.pnpm/p-locate@6.0.0/node_modules/p-locate/index.js
async function pLocate(iterable, tester, {
  concurrency = Number.POSITIVE_INFINITY,
  preserveOrder = true
} = {}) {
  const limit2 = pLimit(concurrency);
  const items = [...iterable].map((element) => [element, limit2(testElement, element, tester)]);
  const checkLimit = pLimit(preserveOrder ? 1 : Number.POSITIVE_INFINITY);
  try {
    await Promise.all(items.map((element) => checkLimit(finder, element)));
  } catch (error2) {
    if (error2 instanceof EndError) {
      return error2.value;
    }
    throw error2;
  }
}
var EndError, testElement, finder;
var init_p_locate = __esm({
  "../../node_modules/.pnpm/p-locate@6.0.0/node_modules/p-locate/index.js"() {
    init_import_meta_url();
    init_p_limit();
    EndError = class extends Error {
      static {
        __name(this, "EndError");
      }
      constructor(value) {
        super();
        this.value = value;
      }
    };
    testElement = /* @__PURE__ */ __name(async (element, tester) => tester(await element), "testElement");
    finder = /* @__PURE__ */ __name(async (element) => {
      const values = await Promise.all(element);
      if (values[1] === true) {
        throw new EndError(values[0]);
      }
      return false;
    }, "finder");
    __name(pLocate, "pLocate");
  }
});
function checkType(type) {
  if (Object.hasOwnProperty.call(typeMappings, type)) {
    return;
  }
  throw new Error(`Invalid type specified: ${type}`);
}
async function locatePath(paths, {
  cwd: cwd2 = process7__default.default.cwd(),
  type = "file",
  allowSymlinks = true,
  concurrency,
  preserveOrder
} = {}) {
  checkType(type);
  cwd2 = toPath(cwd2);
  const statFunction = allowSymlinks ? fs29.promises.stat : fs29.promises.lstat;
  return pLocate(paths, async (path_) => {
    try {
      const stat9 = await statFunction(path3__namespace.default.resolve(cwd2, path_));
      return matchType(type, stat9);
    } catch {
      return false;
    }
  }, { concurrency, preserveOrder });
}
var typeMappings, matchType, toPath;
var init_locate_path = __esm({
  "../../node_modules/.pnpm/locate-path@7.2.0/node_modules/locate-path/index.js"() {
    init_import_meta_url();
    init_p_locate();
    typeMappings = {
      directory: "isDirectory",
      file: "isFile"
    };
    __name(checkType, "checkType");
    matchType = /* @__PURE__ */ __name((type, stat9) => stat9[typeMappings[type]](), "matchType");
    toPath = /* @__PURE__ */ __name((urlOrPath) => urlOrPath instanceof URL ? Url.fileURLToPath(urlOrPath) : urlOrPath, "toPath");
    __name(locatePath, "locatePath");
  }
});

// ../../node_modules/.pnpm/unicorn-magic@0.1.0/node_modules/unicorn-magic/default.js
var init_default3 = __esm({
  "../../node_modules/.pnpm/unicorn-magic@0.1.0/node_modules/unicorn-magic/default.js"() {
    init_import_meta_url();
  }
});
function toPath2(urlOrPath) {
  return urlOrPath instanceof URL ? Url.fileURLToPath(urlOrPath) : urlOrPath;
}
var init_node4 = __esm({
  "../../node_modules/.pnpm/unicorn-magic@0.1.0/node_modules/unicorn-magic/node.js"() {
    init_import_meta_url();
    init_default3();
    __name(toPath2, "toPath");
  }
});
var init_path_exists = __esm({
  "../../node_modules/.pnpm/path-exists@5.0.0/node_modules/path-exists/index.js"() {
    init_import_meta_url();
  }
});
async function findUpMultiple(name2, options = {}) {
  let directory = path3__namespace.default.resolve(toPath2(options.cwd) ?? "");
  const { root } = path3__namespace.default.parse(directory);
  const stopAt = path3__namespace.default.resolve(directory, toPath2(options.stopAt ?? root));
  const limit2 = options.limit ?? Number.POSITIVE_INFINITY;
  const paths = [name2].flat();
  const runMatcher = /* @__PURE__ */ __name(async (locateOptions) => {
    if (typeof name2 !== "function") {
      return locatePath(paths, locateOptions);
    }
    const foundPath = await name2(locateOptions.cwd);
    if (typeof foundPath === "string") {
      return locatePath([foundPath], locateOptions);
    }
    return foundPath;
  }, "runMatcher");
  const matches = [];
  while (true) {
    const foundPath = await runMatcher({ ...options, cwd: directory });
    if (foundPath === findUpStop) {
      break;
    }
    if (foundPath) {
      matches.push(path3__namespace.default.resolve(directory, foundPath));
    }
    if (directory === stopAt || matches.length >= limit2) {
      break;
    }
    directory = path3__namespace.default.dirname(directory);
  }
  return matches;
}
async function findUp(name2, options = {}) {
  const matches = await findUpMultiple(name2, { ...options, limit: 1 });
  return matches[0];
}
var findUpStop;
var init_find_up = __esm({
  "../../node_modules/.pnpm/find-up@7.0.0/node_modules/find-up/index.js"() {
    init_import_meta_url();
    init_locate_path();
    init_node4();
    init_path_exists();
    findUpStop = Symbol("findUpStop");
    __name(findUpMultiple, "findUpMultiple");
    __name(findUp, "findUp");
  }
});
var NodeFS;
var init_file_system2 = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/node/file-system.js"() {
    init_import_meta_url();
    init_find_up();
    init_file_system();
    NodeFS = class extends FileSystem {
      static {
        __name(this, "NodeFS");
      }
      constructor() {
        super();
        this.cwd = process.cwd();
      }
      getEnvironment() {
        return "node";
      }
      isAbsolute(path84) {
        return path3.isAbsolute(path84);
      }
      dirname(path84) {
        return path3.dirname(path84);
      }
      resolve(...paths) {
        return path3.resolve(...paths);
      }
      relative(from, to) {
        return path3.relative(from, to);
      }
      basename(path84) {
        return path3.basename(path84);
      }
      join(...segments) {
        return path3.join(...segments);
      }
      async fileExists(path84) {
        try {
          await fs29.promises.stat(path3.resolve(path84));
          return true;
        } catch {
          return false;
        }
      }
      async readDir(path84, withFileTypes) {
        try {
          if (!withFileTypes) {
            return fs29.promises.readdir(path3.resolve(path84));
          }
          const result = await fs29.promises.readdir(path3.resolve(path84), { withFileTypes: true });
          return result.reduce((prev, cur) => ({ ...prev, [cur.name]: cur.isDirectory() ? "directory" : "file" }), {});
        } catch {
          return [];
        }
      }
      async readFile(path84) {
        return (await fs29.promises.readFile(path3.resolve(path84), "utf-8")).toString();
      }
      /** Node implementation of finding a file or directory by walking up parent directories. */
      findUp(name2, options = {}) {
        return findUp(name2, options);
      }
      /** Node implementation of finding files or directories by walking up parent directories. */
      findUpMultiple(name2, options = {}) {
        return findUpMultiple(name2, options);
      }
    };
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/node/get-build-info.js
var init_get_build_info = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/node/get-build-info.js"() {
    init_import_meta_url();
    init_project();
    init_file_system2();
  }
});

// ../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/node/index.js
var init_node5 = __esm({
  "../../node_modules/.pnpm/@netlify+build-info@10.2.0_patch_hash=33ea78efb143b613c74982678a25159c8700b1677e6a009776a6c8b690c87045/node_modules/@netlify/build-info/lib/node/index.js"() {
    init_import_meta_url();
    init_file_system2();
    init_get_build_info();
  }
});
async function detectFramework(projectPath, wranglerConfig) {
  const fs33 = new NodeFS();
  fs33.logger = logger;
  const project = new Project(fs33, projectPath, projectPath).setEnvironment(process.env).setNodeVersion(process.version).setReportFn((err) => {
    captureException(err);
  });
  const buildSettings = await project.getBuildSettings();
  const isWorkspaceRoot = !!project.workspace?.isRoot;
  if (isWorkspaceRoot) {
    const resolvedProjectPath = path3.resolve(projectPath);
    const workspaceRootIncludesProject = project.workspace?.packages.some(
      (pkg) => path3.resolve(pkg.path) === resolvedProjectPath
    );
    if (!workspaceRootIncludesProject) {
      throw new UserError(
        "The Wrangler application detection logic has been run in the root of a workspace instead of targeting a specific project. Change your working directory to one of the applications in the workspace and try again."
      );
    }
  }
  const packageManager = convertDetectedPackageManager(project.packageManager);
  const lockFileExists = packageManager.lockFiles.some(
    (lockFile) => fs29.existsSync(path3.join(projectPath, lockFile))
  );
  const maybeDetectedFramework = maybeFindDetectedFramework(buildSettings);
  if (await isPagesProject(projectPath, wranglerConfig, maybeDetectedFramework)) {
    return {
      detectedFramework: {
        framework: {
          name: "Cloudflare Pages",
          id: "cloudflare-pages"
        },
        dist: wranglerConfig?.pages_build_output_dir
      },
      packageManager
    };
  }
  const detectedFramework = maybeDetectedFramework ?? {
    framework: {
      id: staticFramework.id,
      name: staticFramework.name
    }
  };
  if (!lockFileExists && detectedFramework.framework.id !== staticFramework.id) {
    logger.warn(
      `No lock file has been detected in the current working directory. This might indicate that the project is part of a workspace. Auto-configuration of projects inside workspaces is limited. See ${source_default.hex("#3B818D")(
        "https://developers.cloudflare.com/workers/framework-guides/automatic-configuration/#workspaces"
      )}`
    );
  }
  return {
    detectedFramework,
    packageManager,
    isWorkspaceRoot
  };
}
function convertDetectedPackageManager(pkgManager) {
  if (!pkgManager) {
    return NpmPackageManager;
  }
  switch (pkgManager?.name) {
    case "pnpm":
      return PnpmPackageManager;
    case "yarn":
      return YarnPackageManager;
    case "bun":
      return BunPackageManager;
    case "npm":
    default:
      return NpmPackageManager;
  }
}
function throwMultipleFrameworksNonInteractiveError(settings) {
  throw new MultipleFrameworksCIError(settings.map((b11) => b11.name));
}
async function isPagesProject(projectPath, wranglerConfig, detectedFramework) {
  if (wranglerConfig?.pages_build_output_dir) {
    return true;
  }
  const cacheFolder = getCacheFolder();
  if (cacheFolder) {
    const pagesConfigCache = path3.join(cacheFolder, PAGES_CONFIG_CACHE_FILENAME);
    if (fs29.existsSync(pagesConfigCache)) {
      return true;
    }
  }
  if (detectedFramework === void 0) {
    const functionsPath = path3.join(projectPath, "functions");
    if (fs29.existsSync(functionsPath)) {
      const functionsStat = fs29.statSync(functionsPath);
      if (functionsStat.isDirectory()) {
        const pagesConfirmed = await confirm(
          "We have identified a `functions` directory in this project, which might indicate you have an active Cloudflare Pages deployment. Is this correct?",
          {
            defaultValue: true,
            // In CI we do want to fallback to `false` so that we can proceed with the autoconfig flow
            fallbackValue: false
          }
        );
        return pagesConfirmed;
      }
    }
  }
  return false;
}
function maybeFindDetectedFramework(settings) {
  if (settings.length === 0) {
    return void 0;
  }
  if (settings.length === 1) {
    return settings[0];
  }
  const settingsForOnlyKnownFrameworks = settings.filter(
    ({ framework }) => isKnownFramework(framework.id)
  );
  if (settingsForOnlyKnownFrameworks.length === 0) {
    if (isNonInteractiveOrCI()) {
      throwMultipleFrameworksNonInteractiveError(settings);
    }
    return settings[0];
  }
  if (settingsForOnlyKnownFrameworks.length === 1) {
    return settingsForOnlyKnownFrameworks[0];
  }
  if (settingsForOnlyKnownFrameworks.length === 2) {
    const settingsForOnlyKnownFrameworksIds = new Set(
      settingsForOnlyKnownFrameworks.map(({ framework }) => framework.id)
    );
    const idsOfAuxiliaryFrameworks = ["vite", "hono"];
    for (const auxiliaryFrameworkId of idsOfAuxiliaryFrameworks) {
      if (settingsForOnlyKnownFrameworksIds.has(auxiliaryFrameworkId)) {
        const nonAuxiliaryFrameworkSettings = settingsForOnlyKnownFrameworks.find(
          ({ framework }) => framework.id !== auxiliaryFrameworkId
        );
        if (nonAuxiliaryFrameworkSettings) {
          return nonAuxiliaryFrameworkSettings;
        }
      }
    }
  }
  if (isNonInteractiveOrCI()) {
    throw new MultipleFrameworksCIError(
      settingsForOnlyKnownFrameworks.map((b11) => b11.name)
    );
  }
  return settingsForOnlyKnownFrameworks[0];
}
var MultipleFrameworksCIError;
var init_framework_detection = __esm({
  "src/autoconfig/details/framework-detection.ts"() {
    init_import_meta_url();
    init_dist();
    init_lib6();
    init_node5();
    init_esm10();
    init_source();
    init_esm2();
    init_config_cache();
    init_dialogs();
    init_is_interactive();
    init_logger();
    init_package_manager();
    init_constants3();
    init_frameworks();
    init_all_frameworks();
    __name(detectFramework, "detectFramework");
    __name(convertDetectedPackageManager, "convertDetectedPackageManager");
    MultipleFrameworksCIError = class extends FatalError {
      static {
        __name(this, "MultipleFrameworksCIError");
      }
      constructor(frameworks2) {
        super(
          esm_default3`Wrangler was unable to automatically configure your project to work with Cloudflare, since multiple frameworks were found: ${frameworks2.join(
            ", "
          )}.

				To fix this issue either:
				  - check your project's configuration to make sure that the target framework
				    is the only configured one and try again
				  - run \`wrangler setup\` locally to get an interactive user experience where
				    you can specify what framework you want to target

			`,
          1,
          { telemetryMessage: true }
        );
      }
    };
    __name(throwMultipleFrameworksNonInteractiveError, "throwMultipleFrameworksNonInteractiveError");
    __name(isPagesProject, "isPagesProject");
    __name(maybeFindDetectedFramework, "maybeFindDetectedFramework");
  }
});
function assertNonConfigured(details) {
  assert53__default.default(
    details.configured === false,
    "Error: expected the current project not to be already configured"
  );
}
async function hasIndexHtml(dir2) {
  const children = await fs9.readdir(dir2);
  for (const child of children) {
    const stats = await fs9.stat(path3.join(dir2, child));
    if (stats.isFile() && child === "index.html") {
      return true;
    }
  }
  return false;
}
async function findAssetsDir(from) {
  if (await hasIndexHtml(from)) {
    return ".";
  }
  const children = await fs9.readdir(from);
  for (const child of children) {
    const path84 = path3.join(from, child);
    const stats = await fs9.stat(path84);
    if (stats.isDirectory() && await hasIndexHtml(path84)) {
      return path3.relative(from, path84);
    }
  }
  return void 0;
}
function getWorkerName(projectOrWorkerName = "", projectPath) {
  const rawName = getCIOverrideName() ?? (projectOrWorkerName || path3.basename(projectPath));
  return toValidWorkerName(rawName);
}
function getWorkerNameFromProject(projectPath) {
  const packageJsonPath = path3.resolve(projectPath, "package.json");
  let packageJsonName;
  try {
    const packageJson = parsePackageJSON(
      readFileSync(packageJsonPath),
      packageJsonPath
    );
    packageJsonName = packageJson.name;
  } catch {
  }
  return getWorkerName(packageJsonName, projectPath);
}
async function getDetailsForAutoConfig({
  projectPath = process.cwd(),
  wranglerConfig
} = {}) {
  logger.debug(`Running autoconfig detection in ${projectPath}...`);
  const autoConfigId = getAutoConfigId();
  sendMetricsEvent(
    "autoconfig_detection_started",
    {
      autoConfigId,
      command: getAutoConfigTriggerCommand()
    },
    {}
  );
  if (
    // If a real Wrangler config has been found the project is already configured for Workers
    wranglerConfig?.configPath && // Unless `pages_build_output_dir` is set, since that indicates that the project is a Pages one instead
    !wranglerConfig.pages_build_output_dir
  ) {
    return {
      configured: true,
      projectPath,
      workerName: getWorkerName(wranglerConfig.name, projectPath),
      // Fall back to npm when already configured since we don't need to run package manager commands
      packageManager: NpmPackageManager
    };
  }
  const { detectedFramework, packageManager, isWorkspaceRoot } = await detectFramework(projectPath, wranglerConfig);
  const framework = getFrameworkClass(detectedFramework.framework.id);
  const packageJsonPath = path3.resolve(projectPath, "package.json");
  let packageJson;
  try {
    packageJson = parsePackageJSON(
      readFileSync(packageJsonPath),
      packageJsonPath
    );
  } catch {
    logger.debug("No package.json found when running autoconfig");
  }
  const configured = framework.isConfigured(projectPath) ?? false;
  const outputDir = detectedFramework?.dist ?? await findAssetsDir(projectPath);
  const baseDetails = {
    projectPath,
    framework,
    packageJson,
    packageManager,
    ...detectedFramework ? {
      buildCommand: getProjectBuildCommand(
        detectedFramework,
        packageManager
      )
    } : {},
    workerName: getWorkerName(packageJson?.name, projectPath)
  };
  if (configured) {
    sendMetricsEvent(
      "autoconfig_detection_completed",
      {
        autoConfigId,
        framework: framework.id,
        configured,
        success: true
      },
      {}
    );
    return {
      ...baseDetails,
      configured: true,
      isWorkspaceRoot
    };
  }
  if (!outputDir) {
    const errorMessage = framework.id === "static" || framework.id === "cloudflare-pages" ? "Could not detect a directory containing static files (e.g. html, css and js) for the project" : "Failed to detect an output directory for the project";
    const error2 = new FatalError(errorMessage);
    sendMetricsEvent(
      "autoconfig_detection_completed",
      {
        autoConfigId,
        framework: framework.id,
        configured,
        success: false,
        errorType: getErrorType(error2),
        errorMessage
      },
      {}
    );
    throw error2;
  }
  sendMetricsEvent(
    "autoconfig_detection_completed",
    {
      autoConfigId,
      framework: framework.id,
      configured,
      success: true
    },
    {}
  );
  return {
    ...baseDetails,
    outputDir,
    configured: false,
    isWorkspaceRoot
  };
}
function getProjectBuildCommand(detectedFramework, packageManager) {
  if (!detectedFramework.buildCommand) {
    return void 0;
  }
  const { type, dlx, npx } = packageManager;
  for (const packageManagerCommandPrefix of [type, dlx.join(" "), npx]) {
    if (detectedFramework.buildCommand.startsWith(packageManagerCommandPrefix)) {
      return detectedFramework.buildCommand;
    }
  }
  return `${npx} ${detectedFramework.buildCommand}`;
}
function checkWorkerNameValidity(input) {
  if (!input) {
    return {
      valid: false,
      cause: "Worker names cannot be empty."
    };
  }
  if (input.match(invalidWorkerNameStartEndRegex)) {
    return {
      valid: false,
      cause: "Worker names cannot start or end with a dash."
    };
  }
  if (input.match(invalidWorkerNameCharsRegex)) {
    return {
      valid: false,
      cause: "Project names must only contain lowercase characters, numbers, and dashes."
    };
  }
  if (input.length > workerNameLengthLimit) {
    return {
      valid: false,
      cause: "Project names must be less than 63 characters."
    };
  }
  return { valid: true };
}
function toValidWorkerName(input) {
  if (checkWorkerNameValidity(input).valid) {
    return input;
  }
  input = input.replaceAll("_", "-").replace(invalidWorkerNameCharsRegex, "-").replace(invalidWorkerNameStartEndRegex, "").slice(0, workerNameLengthLimit);
  if (!input.length) {
    return "my-worker";
  }
  return input;
}
function displayAutoConfigDetails(autoConfigDetails, displayOptions) {
  logger.log("");
  logger.log(displayOptions?.heading ?? "Detected Project Settings:");
  logger.log(brandColor(" - Worker Name:"), autoConfigDetails.workerName);
  if (autoConfigDetails.framework) {
    logger.log(brandColor(" - Framework:"), autoConfigDetails.framework.name);
  }
  if (autoConfigDetails.buildCommand) {
    logger.log(brandColor(" - Build Command:"), autoConfigDetails.buildCommand);
  }
  if (autoConfigDetails.outputDir) {
    logger.log(brandColor(" - Output Directory:"), autoConfigDetails.outputDir);
  }
  logger.log("");
}
async function confirmAutoConfigDetails(autoConfigDetails) {
  const modifySettings = await confirm(
    "Do you want to modify these settings?",
    { defaultValue: false, fallbackValue: false }
  );
  if (!modifySettings) {
    return autoConfigDetails;
  }
  const { ...updatedAutoConfigDetails } = autoConfigDetails;
  const workerName = await prompt("What do you want to name your Worker?", {
    defaultValue: autoConfigDetails.workerName ?? "",
    validate: /* @__PURE__ */ __name((value) => {
      const validity = checkWorkerNameValidity(value);
      if (validity.valid) {
        return true;
      }
      return validity.cause;
    }, "validate")
  });
  updatedAutoConfigDetails.workerName = workerName;
  const frameworkId = await select(
    "What framework is your application using?",
    {
      choices: allFrameworksInfos.map((f8) => ({
        title: f8.name,
        value: f8.id,
        description: f8.id === staticFramework.id ? "No framework at all, or a static framework such as Vite, React or Gatsby." : `The ${f8.name} JavaScript framework`
      })),
      defaultOption: allFrameworksInfos.findIndex((framework) => {
        if (!autoConfigDetails?.framework) {
          return framework.id === staticFramework.id;
        }
        return autoConfigDetails.framework.id === framework.id;
      })
    }
  );
  updatedAutoConfigDetails.framework = getFrameworkClass(frameworkId);
  const outputDir = await prompt(
    "What directory contains your applications' output/asset files?",
    {
      defaultValue: autoConfigDetails.outputDir ?? "",
      validate: /* @__PURE__ */ __name(async (value) => {
        if (!value) {
          return "Please provide a valid directory path";
        }
        const valueStats = fs29.statSync(path3.resolve(value), { throwIfNoEntry: false });
        if (!valueStats) {
          return true;
        }
        if (valueStats?.isFile()) {
          return "Please select a directory";
        }
        return true;
      }, "validate")
    }
  );
  updatedAutoConfigDetails.outputDir = outputDir;
  if (autoConfigDetails.buildCommand || autoConfigDetails.packageJson) {
    const buildCommand3 = await prompt(
      "What is your application's build command?",
      {
        defaultValue: autoConfigDetails.buildCommand ?? ""
      }
    );
    updatedAutoConfigDetails.buildCommand = buildCommand3;
  }
  return updatedAutoConfigDetails;
}
var invalidWorkerNameCharsRegex, invalidWorkerNameStartEndRegex, workerNameLengthLimit;
var init_details2 = __esm({
  "src/autoconfig/details/index.ts"() {
    init_import_meta_url();
    init_colors();
    init_dist();
    init_handle_errors();
    init_dialogs();
    init_logger();
    init_metrics();
    init_package_manager();
    init_frameworks();
    init_all_frameworks();
    init_telemetry_utils();
    init_framework_detection();
    __name(assertNonConfigured, "assertNonConfigured");
    __name(hasIndexHtml, "hasIndexHtml");
    __name(findAssetsDir, "findAssetsDir");
    __name(getWorkerName, "getWorkerName");
    __name(getWorkerNameFromProject, "getWorkerNameFromProject");
    __name(getDetailsForAutoConfig, "getDetailsForAutoConfig");
    __name(getProjectBuildCommand, "getProjectBuildCommand");
    invalidWorkerNameCharsRegex = /[^a-z0-9- ]/g;
    invalidWorkerNameStartEndRegex = /^(-+)|(-+)$/g;
    workerNameLengthLimit = 63;
    __name(checkWorkerNameValidity, "checkWorkerNameValidity");
    __name(toValidWorkerName, "toValidWorkerName");
    __name(displayAutoConfigDetails, "displayAutoConfigDetails");
    __name(confirmAutoConfigDetails, "confirmAutoConfigDetails");
  }
});
function maybeAppendWranglerToGitIgnoreLikeFile(filePath) {
  const filePreExisted = fs29.existsSync(filePath);
  if (!filePreExisted) {
    fs29.writeFileSync(filePath, "");
  }
  const existingGitIgnoreContent = readFileSync(filePath);
  const wranglerGitIgnoreFilesToAdd = [];
  const hasDotWrangler = existingGitIgnoreContent.match(
    /^\/?\.wrangler(\/|\s|$)/m
  );
  if (!hasDotWrangler) {
    wranglerGitIgnoreFilesToAdd.push(".wrangler");
  }
  const hasDotDevDotVars = existingGitIgnoreContent.match(
    /^\/?\.dev\.vars\*(\s|$)/m
  );
  if (!hasDotDevDotVars) {
    wranglerGitIgnoreFilesToAdd.push(".dev.vars*");
  }
  const hasDotDevVarsExample = existingGitIgnoreContent.match(
    /^!\/?\.dev\.vars\.example(\s|$)/m
  );
  if (!hasDotDevVarsExample) {
    wranglerGitIgnoreFilesToAdd.push("!.dev.vars.example");
  }
  const hasDotEnv = existingGitIgnoreContent.match(
    /^\/?\.env\*?(\..*?)?(\s|$)/m
  );
  if (!hasDotEnv) {
    wranglerGitIgnoreFilesToAdd.push(".env*");
  }
  const hasDotEnvExample = existingGitIgnoreContent.match(
    /^!\/?\.env\.example(\s|$)/m
  );
  if (!hasDotEnvExample) {
    wranglerGitIgnoreFilesToAdd.push("!.env.example");
  }
  if (wranglerGitIgnoreFilesToAdd.length === 0) {
    return;
  }
  const s7 = spinner();
  s7.start(`Adding Wrangler files to the ${path3.basename(filePath)} file`);
  const linesToAppend = [
    ...filePreExisted ? ["", ...!existingGitIgnoreContent.match(/\n\s*$/) ? [""] : []] : []
  ];
  if (!hasDotWrangler && wranglerGitIgnoreFilesToAdd.length > 1) {
    linesToAppend.push("# wrangler files");
  }
  wranglerGitIgnoreFilesToAdd.forEach((line) => linesToAppend.push(line));
  linesToAppend.push("");
  fs29.appendFileSync(filePath, linesToAppend.join("\n"));
  const fileName = path3.basename(filePath);
  s7.stop(
    `${brandColor(filePreExisted ? "updated" : "created")} ${dim(
      `${fileName} file`
    )}`
  );
}
function maybeAppendWranglerToGitIgnore(projectPath) {
  const gitIgnorePath = `${projectPath}/.gitignore`;
  const gitIgnorePreExisted = fs29.existsSync(gitIgnorePath);
  const gitDirExists = directoryExists(`${projectPath}/.git`);
  if (!gitIgnorePreExisted && !gitDirExists) {
    return;
  }
  maybeAppendWranglerToGitIgnoreLikeFile(gitIgnorePath);
}
function directoryExists(path84) {
  try {
    const stat9 = fs29.statSync(path84);
    return stat9.isDirectory();
  } catch (error2) {
    if (error2.code === "ENOENT") {
      return false;
    }
    throw new Error(error2);
  }
}
var init_gitignore = __esm({
  "../cli/gitignore.ts"() {
    init_import_meta_url();
    init_dist();
    init_colors();
    init_interactive();
    __name(maybeAppendWranglerToGitIgnoreLikeFile, "maybeAppendWranglerToGitIgnoreLikeFile");
    __name(maybeAppendWranglerToGitIgnore, "maybeAppendWranglerToGitIgnore");
    __name(directoryExists, "directoryExists");
  }
});
async function runAutoConfig(autoConfigDetails, autoConfigOptions = {}) {
  const dryRun = autoConfigOptions.dryRun === true;
  const runBuild2 = !dryRun && (autoConfigOptions.runBuild ?? true);
  const skipConfirmations = dryRun || autoConfigOptions.skipConfirmations === true;
  const enableWranglerInstallation = autoConfigOptions.enableWranglerInstallation ?? true;
  const autoConfigId = getAutoConfigId();
  sendMetricsEvent(
    "autoconfig_configuration_started",
    {
      autoConfigId,
      framework: autoConfigDetails.framework?.id,
      dryRun
    },
    {}
  );
  assertNonConfigured(autoConfigDetails);
  let autoConfigSummary;
  try {
    displayAutoConfigDetails(autoConfigDetails);
    const updatedAutoConfigDetails = skipConfirmations ? autoConfigDetails : await confirmAutoConfigDetails(autoConfigDetails);
    if (autoConfigDetails !== updatedAutoConfigDetails) {
      displayAutoConfigDetails(updatedAutoConfigDetails, {
        heading: "Updated Project Settings:"
      });
    }
    autoConfigDetails = updatedAutoConfigDetails;
    assertNonConfigured(autoConfigDetails);
    if (isKnownFramework(autoConfigDetails.framework.id)) {
      const frameworkIsSupported = isFrameworkSupported(
        autoConfigDetails.framework.id
      );
      if (!frameworkIsSupported) {
        throw new FatalError(
          autoConfigDetails.framework.id === "cloudflare-pages" ? `The target project seems to be using Cloudflare Pages. Automatically migrating from a Pages project to Workers is not yet supported.` : `The detected framework ("${autoConfigDetails.framework.name}") cannot be automatically configured.`
        );
      }
    }
    assert53__default.default(
      autoConfigDetails.outputDir,
      "The Output Directory is unexpectedly missing"
    );
    const compatibilityDate = getTodaysCompatDate();
    const wranglerConfig = {
      $schema: "node_modules/wrangler/config-schema.json",
      name: autoConfigDetails.workerName,
      compatibility_date: compatibilityDate,
      observability: {
        enabled: true
      }
    };
    const { packageManager } = autoConfigDetails;
    const isWorkspaceRoot = autoConfigDetails.isWorkspaceRoot ?? false;
    const frameworkPackageInfo = getFrameworkPackageInfo(
      autoConfigDetails.framework.id
    );
    if (frameworkPackageInfo) {
      autoConfigDetails.framework.validateFrameworkVersion(
        autoConfigDetails.projectPath,
        frameworkPackageInfo
      );
    }
    const dryRunConfigurationResults = await autoConfigDetails.framework.configure({
      outputDir: autoConfigDetails.outputDir,
      projectPath: autoConfigDetails.projectPath,
      workerName: autoConfigDetails.workerName,
      isWorkspaceRoot,
      dryRun: true,
      packageManager
    });
    const { npx } = packageManager;
    autoConfigSummary = await buildOperationsSummary(
      { ...autoConfigDetails, outputDir: autoConfigDetails.outputDir },
      dryRunConfigurationResults.wranglerConfig === null ? null : ensureNodejsCompatIsInConfig({
        ...wranglerConfig,
        ...dryRunConfigurationResults.wranglerConfig
      }),
      {
        build: dryRunConfigurationResults.buildCommandOverride ?? autoConfigDetails.buildCommand,
        deploy: dryRunConfigurationResults.deployCommandOverride ?? `${npx} wrangler deploy`,
        version: dryRunConfigurationResults?.versionCommandOverride ?? `${npx} wrangler versions upload`
      },
      dryRunConfigurationResults.packageJsonScriptsOverrides
    );
    if (!(skipConfirmations || await confirm("Proceed with setup?"))) {
      throw new FatalError("Setup cancelled");
    }
    if (dryRun) {
      logger.log(
        `\u270B  ${"Autoconfig process run in dry-run mode, existing now."}`
      );
      logger.log("");
      sendMetricsEvent(
        "autoconfig_configuration_completed",
        {
          autoConfigId,
          framework: autoConfigDetails.framework?.id,
          success: true,
          dryRun
        },
        {}
      );
      return autoConfigSummary;
    }
    logger.debug(
      `Running autoconfig with:
${JSON.stringify(
        autoConfigDetails,
        null,
        2
      )}...`
    );
    if (autoConfigSummary.wranglerInstall && enableWranglerInstallation) {
      await installWrangler(packageManager.type, isWorkspaceRoot);
    }
    const configurationResults = await autoConfigDetails.framework.configure({
      outputDir: autoConfigDetails.outputDir,
      projectPath: autoConfigDetails.projectPath,
      workerName: autoConfigDetails.workerName,
      isWorkspaceRoot,
      dryRun: false,
      packageManager
    });
    if (autoConfigDetails.packageJson) {
      const packageJsonPath = path3.resolve(
        autoConfigDetails.projectPath,
        "package.json"
      );
      const existingPackageJson = JSON.parse(
        await fs9.readFile(packageJsonPath, "utf8")
      );
      await fs9.writeFile(
        packageJsonPath,
        JSON.stringify(
          {
            ...existingPackageJson,
            scripts: {
              ...existingPackageJson.scripts,
              ...autoConfigSummary.scripts
            }
          },
          null,
          2
        ) + "\n"
      );
    }
    if (configurationResults.wranglerConfig !== null) {
      await saveWranglerJsonc(
        autoConfigDetails.projectPath,
        ensureNodejsCompatIsInConfig({
          ...wranglerConfig,
          ...configurationResults.wranglerConfig
        })
      );
    }
    maybeAppendWranglerToGitIgnore(autoConfigDetails.projectPath);
    if (autoConfigDetails.outputDir === autoConfigDetails.projectPath) {
      maybeAppendWranglerToGitIgnoreLikeFile(
        `${autoConfigDetails.projectPath}/.assetsignore`
      );
    }
    const buildCommand3 = configurationResults.buildCommandOverride ?? autoConfigDetails.buildCommand;
    if (buildCommand3 && runBuild2) {
      await runCommand(buildCommand3, autoConfigDetails.projectPath, "[build]");
    }
  } catch (error2) {
    sendMetricsEvent(
      "autoconfig_configuration_completed",
      {
        autoConfigId,
        framework: autoConfigDetails.framework?.id,
        dryRun,
        success: false,
        ...sanitizeError(error2)
      },
      {}
    );
    throw error2;
  }
  sendMetricsEvent(
    "autoconfig_configuration_completed",
    {
      autoConfigId,
      framework: autoConfigDetails.framework?.id,
      success: true,
      dryRun
    },
    {}
  );
  return autoConfigSummary;
}
function ensureNodejsCompatIsInConfig(wranglerConfig) {
  if (wranglerConfig.compatibility_flags?.includes("nodejs_compat")) {
    return wranglerConfig;
  }
  return {
    ...wranglerConfig,
    compatibility_flags: [
      ...wranglerConfig.compatibility_flags?.filter(
        (flag) => !flag.startsWith("nodejs_")
      ) ?? [],
      "nodejs_compat"
    ]
  };
}
async function saveWranglerJsonc(projectPath, wranglerConfig) {
  let existingWranglerConfig = {};
  const wranglerConfigPath = getDirWranglerJsonConfigPath(projectPath);
  if (wranglerConfigPath) {
    const existingContent = await fs9.readFile(wranglerConfigPath, "utf8");
    existingWranglerConfig = parseJSONC(
      existingContent,
      wranglerConfigPath
    );
  }
  await fs9.writeFile(
    path3.resolve(projectPath, "wrangler.jsonc"),
    JSON.stringify(
      {
        ...existingWranglerConfig,
        ...wranglerConfig
      },
      null,
      2
    ) + "\n"
  );
}
async function buildOperationsSummary(autoConfigDetails, wranglerConfigToWrite, projectCommands, packageJsonScriptsOverrides) {
  logger.log("");
  const summary = {
    wranglerInstall: false,
    scripts: {},
    ...wranglerConfigToWrite !== null ? {
      wranglerConfig: wranglerConfigToWrite
    } : {},
    outputDir: autoConfigDetails.outputDir,
    frameworkId: autoConfigDetails.framework.id,
    buildCommand: projectCommands.build,
    deployCommand: projectCommands.deploy,
    versionCommand: projectCommands.version
  };
  if (autoConfigDetails.packageJson) {
    summary.wranglerInstall = true;
    logger.log("\u{1F4E6} Install packages:");
    logger.log(` - wrangler (devDependency)`);
    logger.log("");
    summary.scripts = {
      deploy: packageJsonScriptsOverrides?.deploy ?? (autoConfigDetails.buildCommand ? `${autoConfigDetails.buildCommand} && wrangler deploy` : `wrangler deploy`),
      preview: packageJsonScriptsOverrides?.preview ?? (autoConfigDetails.buildCommand ? `${autoConfigDetails.buildCommand} && wrangler dev` : `wrangler dev`)
    };
    const containsServerSideCode = (
      // If there is an entrypoint then we know that there is server side code
      !!wranglerConfigToWrite?.main
    );
    if (
      // If there is no server side code, then there is no need to add the cf-typegen script
      containsServerSideCode && usesTypescript(autoConfigDetails.projectPath) && !("cf-typegen" in (autoConfigDetails.packageJson.scripts ?? {}))
    ) {
      summary.scripts["cf-typegen"] = packageJsonScriptsOverrides?.typegen ?? "wrangler types";
    }
    logger.log("\u{1F4DD} Update package.json scripts:");
    for (const [name2, script] of Object.entries(summary.scripts)) {
      logger.log(` - "${name2}": "${script}"`);
    }
    logger.log("");
  }
  if (wranglerConfigToWrite) {
    const wranglerConfigPath = path3.resolve(
      autoConfigDetails.projectPath,
      "wrangler.jsonc"
    );
    const configExists = fs29.existsSync(wranglerConfigPath);
    logger.log(
      configExists ? "\u{1F4C4} Update wrangler.jsonc:" : "\u{1F4C4} Create wrangler.jsonc:"
    );
    logger.log(
      "  " + JSON.stringify(wranglerConfigToWrite, null, 2).replace(/\n/g, "\n  ")
    );
    logger.log("");
  }
  if (autoConfigDetails.framework && !(autoConfigDetails.framework instanceof Static) && !autoConfigDetails.framework.isConfigured(autoConfigDetails.projectPath)) {
    summary.frameworkConfiguration = autoConfigDetails.framework.configurationDescription ?? `Configuring project for ${autoConfigDetails.framework.name}`;
    logger.log(`\u{1F6E0}\uFE0F  ${summary.frameworkConfiguration}`);
    logger.log("");
  }
  return summary;
}
function getDirWranglerJsonConfigPath(dir2) {
  const filePathJsonC = path3.resolve(dir2, "wrangler.jsonc");
  if (fs29.existsSync(filePathJsonC)) {
    return filePathJsonC;
  }
  const filePathJson = path3.resolve(dir2, "wrangler.json");
  if (fs29.existsSync(filePathJson)) {
    return filePathJson;
  }
  return void 0;
}
var init_run = __esm({
  "src/autoconfig/run.ts"() {
    init_import_meta_url();
    init_gitignore();
    init_packages3();
    init_dist();
    init_run_custom_build();
    init_dialogs();
    init_logger();
    init_metrics();
    init_sanitization();
    init_details2();
    init_frameworks();
    init_all_frameworks();
    init_static();
    init_telemetry_utils();
    init_uses_typescript();
    __name(runAutoConfig, "runAutoConfig");
    __name(ensureNodejsCompatIsInConfig, "ensureNodejsCompatIsInConfig");
    __name(saveWranglerJsonc, "saveWranglerJsonc");
    __name(buildOperationsSummary, "buildOperationsSummary");
    __name(getDirWranglerJsonConfigPath, "getDirWranglerJsonConfigPath");
  }
});
async function guessWorkerFormat(entryFile, entryWorkingDirectory, tsconfig) {
  const parsedEntryPath = path3__namespace.default.parse(entryFile);
  if (parsedEntryPath.ext == ".py") {
    return { format: "modules", exports: [] };
  }
  const result = await esbuild__namespace.build({
    ...COMMON_ESBUILD_OPTIONS,
    entryPoints: [entryFile],
    absWorkingDir: entryWorkingDirectory,
    metafile: true,
    bundle: false,
    write: false,
    ...tsconfig && { tsconfig },
    logLevel: "silent"
  });
  const metafile = result.metafile;
  const { exports } = getEntryPointFromMetafile(entryFile, metafile);
  let guessedWorkerFormat;
  if (exports.length > 0) {
    if (exports.includes("default")) {
      guessedWorkerFormat = "modules";
    } else {
      logger.warn(
        `The entrypoint ${path3__namespace.default.relative(
          process.cwd(),
          entryFile
        )} has exports like an ES Module, but hasn't defined a default export like a module worker normally would. Building the worker using "service-worker" format...`
      );
      guessedWorkerFormat = "service-worker";
    }
  } else {
    guessedWorkerFormat = "service-worker";
  }
  return { format: guessedWorkerFormat, exports };
}
var init_guess_worker_format = __esm({
  "src/deployment-bundle/guess-worker-format.ts"() {
    init_import_meta_url();
    init_logger();
    init_bundle();
    init_entry_point_from_metafile();
    __name(guessWorkerFormat, "guessWorkerFormat");
  }
});
function resolveEntryWithScript(script) {
  const file3 = path3__namespace.default.resolve(script);
  const relativePath = path3__namespace.default.relative(process.cwd(), file3) || ".";
  return { absolutePath: file3, relativePath };
}
function resolveEntryWithMain(main2, config) {
  const projectRoot = path3__namespace.default.resolve(path3__namespace.default.dirname(config.userConfigPath ?? "."));
  const entryRoot = path3__namespace.default.resolve(path3__namespace.default.dirname(config.configPath ?? "."));
  const absolutePath = path3__namespace.default.resolve(entryRoot, main2);
  const relativePath = path3__namespace.default.relative(entryRoot, absolutePath) || ".";
  return { absolutePath, relativePath, projectRoot };
}
function resolveEntryWithEntryPoint(entryPoint, config) {
  const projectRoot = path3__namespace.default.resolve(path3__namespace.default.dirname(config.userConfigPath ?? "."));
  const entryRoot = path3__namespace.default.resolve(path3__namespace.default.dirname(config.configPath ?? "."));
  const file3 = path3__namespace.default.extname(entryPoint) ? path3__namespace.default.resolve(entryPoint) : path3__namespace.default.resolve(entryPoint, "index.js");
  const relativePath = path3__namespace.default.relative(entryRoot, file3) || ".";
  return { absolutePath: file3, relativePath, projectRoot };
}
function resolveEntryWithAssets() {
  const file3 = path3__namespace.default.resolve(getBasePath(), "templates/no-op-worker.js");
  const relativePath = path3__namespace.default.relative(process.cwd(), file3) || ".";
  return { absolutePath: file3, relativePath };
}
var init_resolve_entry = __esm({
  "src/deployment-bundle/resolve-entry.ts"() {
    init_import_meta_url();
    init_paths();
    __name(resolveEntryWithScript, "resolveEntryWithScript");
    __name(resolveEntryWithMain, "resolveEntryWithMain");
    __name(resolveEntryWithEntryPoint, "resolveEntryWithEntryPoint");
    __name(resolveEntryWithAssets, "resolveEntryWithAssets");
  }
});
async function getEntry(args, config, command2) {
  const entryPoint = config.site?.["entry-point"];
  let paths;
  if (args.script) {
    paths = resolveEntryWithScript(args.script);
  } else if (config.main !== void 0) {
    paths = resolveEntryWithMain(config.main, config);
  } else if (entryPoint) {
    paths = resolveEntryWithEntryPoint(entryPoint, config);
  } else if (args.assets || config.assets) {
    paths = resolveEntryWithAssets();
  } else {
    if (config.pages_build_output_dir && command2 === "dev") {
      throw new UserError(
        "It looks like you've run a Workers-specific command in a Pages project.\nFor Pages, please run `wrangler pages dev` instead.",
        { telemetryMessage: true }
      );
    }
    const compatibilityDateStr = getTodaysCompatDate();
    const updateConfigMessage = /* @__PURE__ */ __name((snippet) => esm_default3`
			${config.configPath ? `add the following to your "${configFileName(config.configPath)}" file:` : `create a "wrangler.jsonc" file containing:`}

			\`\`\`
			${formatConfigSnippet(
      {
        ...config.name ? {} : { name: "worker-name" },
        ...config.compatibility_date ? {} : { compatibility_date: compatibilityDateStr },
        ...snippet
      },
      config.configPath
    )}
			\`\`\`

			`, "updateConfigMessage");
    const fullCommand = `${getNpxEquivalent()} wrangler ${command2}`;
    throw new UserError(
      esm_default3`
			Missing entry-point to Worker script or to assets directory

			If there is code to deploy, you can either:
			- Specify an entry-point to your Worker script via the command line (ex: \`${fullCommand} src/index.ts\`)
			- Or ${updateConfigMessage({ main: "src/index.ts" })}

			If are uploading a directory of assets, you can either:
			- Specify the path to the directory of assets via the command line: (ex: \`${fullCommand} --assets=./dist\`)
			- Or ${updateConfigMessage({ assets: { directory: "./dist" } })}`,
      { telemetryMessage: "missing worker entrypoint or assets directory" }
    );
  }
  await runCustomBuild(
    paths.absolutePath,
    paths.relativePath,
    config.build,
    config.configPath,
    command2
  );
  const projectRoot = paths.projectRoot ?? process.cwd();
  const { format: format11, exports } = await guessWorkerFormat(
    paths.absolutePath,
    projectRoot,
    config.tsconfig
  );
  const { localBindings } = partitionDurableObjectBindings(config);
  if (format11 === "service-worker" && localBindings.length > 0) {
    const errorMessage = "You seem to be trying to use Durable Objects in a Worker written as a service-worker.";
    const addScriptName = `You can use Durable Objects defined in other Workers by specifying a \`script_name\` in your ${configFileName(config.configPath)} file, where \`script_name\` is the name of the Worker that implements that Durable Object. For example:`;
    const addScriptNameExamples = generateAddScriptNameExamples(localBindings);
    const migrateText = "Alternatively, migrate your worker to ES Module syntax to implement a Durable Object in this Worker:";
    const migrateUrl = "https://developers.cloudflare.com/workers/learning/migrating-to-module-workers/";
    throw new UserError(
      `${errorMessage}
${addScriptName}
${addScriptNameExamples}
${migrateText}
${migrateUrl}`,
      { telemetryMessage: "tried to use DO with service worker" }
    );
  }
  return {
    file: paths.absolutePath,
    projectRoot,
    configPath: config.configPath,
    format: format11,
    moduleRoot: args.moduleRoot ?? config.base_dir ?? path3__namespace.default.dirname(paths.absolutePath),
    name: config.name ?? "worker",
    exports
  };
}
function partitionDurableObjectBindings(config) {
  const localBindings = [];
  const remoteBindings = [];
  for (const binding of config.durable_objects.bindings) {
    if (binding.script_name === void 0 || binding.script_name === config.name) {
      localBindings.push(binding);
    } else {
      remoteBindings.push(binding);
    }
  }
  return { localBindings, remoteBindings };
}
function generateAddScriptNameExamples(localBindings) {
  function exampleScriptName(binding_name) {
    return `${binding_name.toLowerCase().replaceAll("_", "-")}-worker`;
  }
  __name(exampleScriptName, "exampleScriptName");
  return localBindings.map(({ name: name2, class_name }) => {
    const script_name = exampleScriptName(name2);
    const currentBinding = `{ name = ${name2}, class_name = ${class_name} }`;
    const fixedBinding = `{ name = ${name2}, class_name = ${class_name}, script_name = ${script_name} }`;
    return `${currentBinding} ==> ${fixedBinding}`;
  }).join("\n");
}
function getNpxEquivalent() {
  switch (sniffUserAgent()) {
    case "pnpm":
      return "pnpm";
    case "yarn":
      return "yarn";
    case "npm":
    default:
      return "npx";
  }
}
var init_entry = __esm({
  "src/deployment-bundle/entry.ts"() {
    init_import_meta_url();
    init_dist();
    init_esm2();
    init_package_manager();
    init_guess_worker_format();
    init_resolve_entry();
    init_run_custom_build();
    __name(getEntry, "getEntry");
    __name(partitionDurableObjectBindings, "partitionDurableObjectBindings");
    __name(generateAddScriptNameExamples, "generateAddScriptNameExamples");
    __name(getNpxEquivalent, "getNpxEquivalent");
  }
});

// src/utils/worker-not-found-error.ts
function isWorkerNotFoundError(error2) {
  return typeof error2 === "object" && error2 !== null && "code" in error2 && (error2.code === WORKER_NOT_FOUND_ERR_CODE || error2.code === WORKER_LEGACY_ENVIRONMENT_NOT_FOUND_ERR_CODE);
}
var WORKER_NOT_FOUND_ERR_CODE, WORKER_LEGACY_ENVIRONMENT_NOT_FOUND_ERR_CODE;
var init_worker_not_found_error = __esm({
  "src/utils/worker-not-found-error.ts"() {
    init_import_meta_url();
    WORKER_NOT_FOUND_ERR_CODE = 10007;
    WORKER_LEGACY_ENVIRONMENT_NOT_FOUND_ERR_CODE = 10090;
    __name(isWorkerNotFoundError, "isWorkerNotFoundError");
  }
});

// src/match-tag.ts
async function verifyWorkerMatchesCITag(complianceConfig, accountId, workerName, configPath) {
  const matchTag = getCIMatchTag();
  logger.debug(
    `Starting verifyWorkerMatchesCITag() with tag: ${matchTag}, name: ${workerName}`
  );
  if (!matchTag) {
    logger.debug(
      "No WRANGLER_CI_MATCH_TAG variable provided, aborting verifyWorkerMatchesCITag()"
    );
    return;
  }
  const envAccountID = getCloudflareAccountIdFromEnv();
  if (accountId !== envAccountID) {
    throw new FatalError(
      `The \`account_id\` in your ${configFileName(configPath)} file must match the \`account_id\` for this account. Please update your ${configFileName(configPath)} file with \`${formatConfigSnippet({ account_id: envAccountID }, configPath, false)}\``
    );
  }
  let tag;
  try {
    const worker = await fetchResult(
      complianceConfig,
      `/accounts/${accountId}/workers/services/${workerName}`
    );
    tag = worker.default_environment.script.tag;
    logger.debug(`API returned with tag: ${tag} for worker: ${workerName}`);
  } catch (e10) {
    logger.debug(e10);
    if (isWorkerNotFoundError(e10)) {
      throw new FatalError(
        `The name in your ${configFileName(configPath)} file (${workerName}) must match the name of your Worker. Please update the name field in your ${configFileName(configPath)} file.`
      );
    } else if (e10 instanceof APIError) {
      throw new FatalError(
        "An error occurred while trying to validate that the Worker name matches what is expected by the build system.\n" + e10.message + "\n" + e10.notes.map((note) => note.text).join("\n")
      );
    } else {
      throw new FatalError(
        "Wrangler cannot validate that your Worker name matches what is expected by the build system. Please retry the build. If the problem persists, please contact support."
      );
    }
  }
  if (tag !== matchTag) {
    logger.debug(
      `Failed to match Worker tag. The API returned "${tag}", but the CI system expected "${matchTag}"`
    );
    throw new FatalError(
      `The name in your ${configFileName(configPath)} file (${workerName}) must match the name of your Worker. Please update the name field in your ${configFileName(configPath)} file.`
    );
  }
}
var init_match_tag = __esm({
  "src/match-tag.ts"() {
    init_import_meta_url();
    init_dist();
    init_cfetch();
    init_logger();
    init_auth_variables();
    init_worker_not_found_error();
    __name(verifyWorkerMatchesCITag, "verifyWorkerMatchesCITag");
  }
});

// ../../node_modules/.pnpm/xxhash-wasm@1.0.1/node_modules/xxhash-wasm/esm/xxhash-wasm.js
async function e4() {
  const { instance: { exports: { mem: e10, xxh32: n9, xxh64: r10, init32: i7, update32: o7, digest32: h7, init64: s7, update64: u7, digest64: g7 } } } = await WebAssembly.instantiate(t7);
  let a7 = new Uint8Array(e10.buffer);
  function c8(t13, n10) {
    if (e10.buffer.byteLength < t13 + n10) {
      const r11 = Math.ceil((t13 + n10 - e10.buffer.byteLength) / 65536);
      e10.grow(r11), a7 = new Uint8Array(e10.buffer);
    }
  }
  __name(c8, "c");
  function l8(t13, e11, n10, r11, i8, o8) {
    c8(t13);
    const h8 = new Uint8Array(t13);
    return a7.set(h8), n10(0, e11), h8.set(a7.slice(0, t13)), { update(e12) {
      let n11;
      return a7.set(h8), "string" == typeof e12 ? (c8(3 * e12.length, t13), n11 = b11.encodeInto(e12, a7.subarray(t13)).written) : (c8(e12.byteLength, t13), a7.set(e12, t13), n11 = e12.byteLength), r11(0, t13, n11), h8.set(a7.slice(0, t13)), this;
    }, digest: /* @__PURE__ */ __name(() => (a7.set(h8), o8(i8(0))), "digest") };
  }
  __name(l8, "l");
  function d8(t13) {
    return t13 >>> 0;
  }
  __name(d8, "d");
  const f8 = 2n ** 64n - 1n;
  function y5(t13) {
    return t13 & f8;
  }
  __name(y5, "y");
  const b11 = new TextEncoder(), w7 = 0n;
  function p7(t13) {
    let e11 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0;
    return c8(3 * t13.length, 0), d8(n9(0, b11.encodeInto(t13, a7).written, e11));
  }
  __name(p7, "p");
  function v8(t13) {
    let e11 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : w7;
    return c8(3 * t13.length, 0), y5(r10(0, b11.encodeInto(t13, a7).written, e11));
  }
  __name(v8, "v");
  return { h32: p7, h32ToString(t13) {
    return p7(t13, arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0).toString(16).padStart(8, "0");
  }, h32Raw(t13) {
    let e11 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0;
    return c8(t13.byteLength, 0), a7.set(t13), d8(n9(0, t13.byteLength, e11));
  }, create32() {
    return l8(48, arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0, i7, o7, h7, d8);
  }, h64: v8, h64ToString(t13) {
    return v8(t13, arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : w7).toString(16).padStart(16, "0");
  }, h64Raw(t13) {
    let e11 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : w7;
    return c8(t13.byteLength, 0), a7.set(t13), y5(r10(0, t13.byteLength, e11));
  }, create64() {
    return l8(88, arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : w7, s7, u7, g7, y5);
  } };
}
var t7;
var init_xxhash_wasm = __esm({
  "../../node_modules/.pnpm/xxhash-wasm@1.0.1/node_modules/xxhash-wasm/esm/xxhash-wasm.js"() {
    init_import_meta_url();
    t7 = new Uint8Array([0, 97, 115, 109, 1, 0, 0, 0, 1, 48, 8, 96, 3, 127, 127, 127, 0, 96, 3, 127, 127, 127, 1, 127, 96, 2, 127, 127, 0, 96, 2, 127, 126, 0, 96, 1, 127, 1, 127, 96, 1, 127, 1, 126, 96, 3, 127, 127, 126, 1, 126, 96, 3, 126, 127, 127, 1, 126, 3, 11, 10, 1, 1, 2, 0, 4, 6, 7, 3, 0, 5, 5, 3, 1, 0, 1, 7, 85, 9, 3, 109, 101, 109, 2, 0, 5, 120, 120, 104, 51, 50, 0, 0, 6, 105, 110, 105, 116, 51, 50, 0, 2, 8, 117, 112, 100, 97, 116, 101, 51, 50, 0, 3, 8, 100, 105, 103, 101, 115, 116, 51, 50, 0, 4, 5, 120, 120, 104, 54, 52, 0, 5, 6, 105, 110, 105, 116, 54, 52, 0, 7, 8, 117, 112, 100, 97, 116, 101, 54, 52, 0, 8, 8, 100, 105, 103, 101, 115, 116, 54, 52, 0, 9, 10, 211, 23, 10, 242, 1, 1, 4, 127, 32, 0, 32, 1, 106, 33, 3, 32, 1, 65, 16, 79, 4, 127, 32, 3, 65, 16, 107, 33, 6, 32, 2, 65, 168, 136, 141, 161, 2, 106, 33, 3, 32, 2, 65, 247, 148, 175, 175, 120, 106, 33, 4, 32, 2, 65, 177, 243, 221, 241, 121, 107, 33, 5, 3, 64, 32, 0, 40, 2, 0, 65, 247, 148, 175, 175, 120, 108, 32, 3, 106, 65, 13, 119, 65, 177, 243, 221, 241, 121, 108, 33, 3, 32, 0, 65, 4, 106, 34, 0, 40, 2, 0, 65, 247, 148, 175, 175, 120, 108, 32, 4, 106, 65, 13, 119, 65, 177, 243, 221, 241, 121, 108, 33, 4, 32, 0, 65, 4, 106, 34, 0, 40, 2, 0, 65, 247, 148, 175, 175, 120, 108, 32, 2, 106, 65, 13, 119, 65, 177, 243, 221, 241, 121, 108, 33, 2, 32, 0, 65, 4, 106, 34, 0, 40, 2, 0, 65, 247, 148, 175, 175, 120, 108, 32, 5, 106, 65, 13, 119, 65, 177, 243, 221, 241, 121, 108, 33, 5, 32, 0, 65, 4, 106, 34, 0, 32, 6, 77, 13, 0, 11, 32, 2, 65, 12, 119, 32, 5, 65, 18, 119, 106, 32, 4, 65, 7, 119, 106, 32, 3, 65, 1, 119, 106, 5, 32, 2, 65, 177, 207, 217, 178, 1, 106, 11, 32, 1, 106, 32, 0, 32, 1, 65, 15, 113, 16, 1, 11, 146, 1, 0, 32, 1, 32, 2, 106, 33, 2, 3, 64, 32, 1, 65, 4, 106, 32, 2, 75, 69, 4, 64, 32, 1, 40, 2, 0, 65, 189, 220, 202, 149, 124, 108, 32, 0, 106, 65, 17, 119, 65, 175, 214, 211, 190, 2, 108, 33, 0, 32, 1, 65, 4, 106, 33, 1, 12, 1, 11, 11, 3, 64, 32, 1, 32, 2, 79, 69, 4, 64, 32, 1, 45, 0, 0, 65, 177, 207, 217, 178, 1, 108, 32, 0, 106, 65, 11, 119, 65, 177, 243, 221, 241, 121, 108, 33, 0, 32, 1, 65, 1, 106, 33, 1, 12, 1, 11, 11, 32, 0, 65, 15, 118, 32, 0, 115, 65, 247, 148, 175, 175, 120, 108, 34, 0, 32, 0, 65, 13, 118, 115, 65, 189, 220, 202, 149, 124, 108, 34, 0, 32, 0, 65, 16, 118, 115, 11, 63, 0, 32, 0, 65, 8, 106, 32, 1, 65, 168, 136, 141, 161, 2, 106, 54, 2, 0, 32, 0, 65, 12, 106, 32, 1, 65, 247, 148, 175, 175, 120, 106, 54, 2, 0, 32, 0, 65, 16, 106, 32, 1, 54, 2, 0, 32, 0, 65, 20, 106, 32, 1, 65, 177, 243, 221, 241, 121, 107, 54, 2, 0, 11, 211, 4, 1, 6, 127, 32, 1, 32, 2, 106, 33, 6, 32, 0, 65, 24, 106, 33, 5, 32, 0, 65, 40, 106, 40, 2, 0, 33, 3, 32, 0, 32, 0, 40, 2, 0, 32, 2, 106, 54, 2, 0, 32, 0, 65, 4, 106, 34, 4, 32, 4, 40, 2, 0, 32, 2, 65, 16, 79, 32, 0, 40, 2, 0, 65, 16, 79, 114, 114, 54, 2, 0, 32, 2, 32, 3, 106, 65, 16, 73, 4, 64, 32, 3, 32, 5, 106, 32, 1, 32, 2, 252, 10, 0, 0, 32, 0, 65, 40, 106, 32, 2, 32, 3, 106, 54, 2, 0, 15, 11, 32, 3, 4, 64, 32, 3, 32, 5, 106, 32, 1, 65, 16, 32, 3, 107, 34, 2, 252, 10, 0, 0, 32, 0, 65, 8, 106, 34, 3, 40, 2, 0, 32, 5, 40, 2, 0, 65, 247, 148, 175, 175, 120, 108, 106, 65, 13, 119, 65, 177, 243, 221, 241, 121, 108, 33, 4, 32, 3, 32, 4, 54, 2, 0, 32, 0, 65, 12, 106, 34, 3, 40, 2, 0, 32, 5, 65, 4, 106, 40, 2, 0, 65, 247, 148, 175, 175, 120, 108, 106, 65, 13, 119, 65, 177, 243, 221, 241, 121, 108, 33, 4, 32, 3, 32, 4, 54, 2, 0, 32, 0, 65, 16, 106, 34, 3, 40, 2, 0, 32, 5, 65, 8, 106, 40, 2, 0, 65, 247, 148, 175, 175, 120, 108, 106, 65, 13, 119, 65, 177, 243, 221, 241, 121, 108, 33, 4, 32, 3, 32, 4, 54, 2, 0, 32, 0, 65, 20, 106, 34, 3, 40, 2, 0, 32, 5, 65, 12, 106, 40, 2, 0, 65, 247, 148, 175, 175, 120, 108, 106, 65, 13, 119, 65, 177, 243, 221, 241, 121, 108, 33, 4, 32, 3, 32, 4, 54, 2, 0, 32, 0, 65, 40, 106, 65, 0, 54, 2, 0, 32, 1, 32, 2, 106, 33, 1, 11, 32, 1, 32, 6, 65, 16, 107, 77, 4, 64, 32, 6, 65, 16, 107, 33, 8, 32, 0, 65, 8, 106, 40, 2, 0, 33, 2, 32, 0, 65, 12, 106, 40, 2, 0, 33, 3, 32, 0, 65, 16, 106, 40, 2, 0, 33, 4, 32, 0, 65, 20, 106, 40, 2, 0, 33, 7, 3, 64, 32, 1, 40, 2, 0, 65, 247, 148, 175, 175, 120, 108, 32, 2, 106, 65, 13, 119, 65, 177, 243, 221, 241, 121, 108, 33, 2, 32, 1, 65, 4, 106, 34, 1, 40, 2, 0, 65, 247, 148, 175, 175, 120, 108, 32, 3, 106, 65, 13, 119, 65, 177, 243, 221, 241, 121, 108, 33, 3, 32, 1, 65, 4, 106, 34, 1, 40, 2, 0, 65, 247, 148, 175, 175, 120, 108, 32, 4, 106, 65, 13, 119, 65, 177, 243, 221, 241, 121, 108, 33, 4, 32, 1, 65, 4, 106, 34, 1, 40, 2, 0, 65, 247, 148, 175, 175, 120, 108, 32, 7, 106, 65, 13, 119, 65, 177, 243, 221, 241, 121, 108, 33, 7, 32, 1, 65, 4, 106, 34, 1, 32, 8, 77, 13, 0, 11, 32, 0, 65, 8, 106, 32, 2, 54, 2, 0, 32, 0, 65, 12, 106, 32, 3, 54, 2, 0, 32, 0, 65, 16, 106, 32, 4, 54, 2, 0, 32, 0, 65, 20, 106, 32, 7, 54, 2, 0, 11, 32, 1, 32, 6, 73, 4, 64, 32, 5, 32, 1, 32, 6, 32, 1, 107, 34, 1, 252, 10, 0, 0, 32, 0, 65, 40, 106, 32, 1, 54, 2, 0, 11, 11, 97, 1, 1, 127, 32, 0, 65, 16, 106, 40, 2, 0, 33, 1, 32, 0, 65, 4, 106, 40, 2, 0, 4, 127, 32, 1, 65, 12, 119, 32, 0, 65, 20, 106, 40, 2, 0, 65, 18, 119, 106, 32, 0, 65, 12, 106, 40, 2, 0, 65, 7, 119, 106, 32, 0, 65, 8, 106, 40, 2, 0, 65, 1, 119, 106, 5, 32, 1, 65, 177, 207, 217, 178, 1, 106, 11, 32, 0, 40, 2, 0, 106, 32, 0, 65, 24, 106, 32, 0, 65, 40, 106, 40, 2, 0, 16, 1, 11, 157, 4, 2, 1, 127, 3, 126, 32, 0, 32, 1, 106, 33, 3, 32, 1, 65, 32, 79, 4, 126, 32, 3, 65, 32, 107, 33, 3, 32, 2, 66, 135, 149, 175, 175, 152, 182, 222, 155, 158, 127, 124, 66, 207, 214, 211, 190, 210, 199, 171, 217, 66, 124, 33, 4, 32, 2, 66, 207, 214, 211, 190, 210, 199, 171, 217, 66, 124, 33, 5, 32, 2, 66, 0, 124, 33, 6, 32, 2, 66, 135, 149, 175, 175, 152, 182, 222, 155, 158, 127, 125, 33, 2, 3, 64, 32, 0, 41, 3, 0, 66, 207, 214, 211, 190, 210, 199, 171, 217, 66, 126, 32, 4, 124, 66, 31, 137, 66, 135, 149, 175, 175, 152, 182, 222, 155, 158, 127, 126, 33, 4, 32, 0, 65, 8, 106, 34, 0, 41, 3, 0, 66, 207, 214, 211, 190, 210, 199, 171, 217, 66, 126, 32, 5, 124, 66, 31, 137, 66, 135, 149, 175, 175, 152, 182, 222, 155, 158, 127, 126, 33, 5, 32, 0, 65, 8, 106, 34, 0, 41, 3, 0, 66, 207, 214, 211, 190, 210, 199, 171, 217, 66, 126, 32, 6, 124, 66, 31, 137, 66, 135, 149, 175, 175, 152, 182, 222, 155, 158, 127, 126, 33, 6, 32, 0, 65, 8, 106, 34, 0, 41, 3, 0, 66, 207, 214, 211, 190, 210, 199, 171, 217, 66, 126, 32, 2, 124, 66, 31, 137, 66, 135, 149, 175, 175, 152, 182, 222, 155, 158, 127, 126, 33, 2, 32, 0, 65, 8, 106, 34, 0, 32, 3, 77, 13, 0, 11, 32, 6, 66, 12, 137, 32, 2, 66, 18, 137, 124, 32, 5, 66, 7, 137, 124, 32, 4, 66, 1, 137, 124, 32, 4, 66, 207, 214, 211, 190, 210, 199, 171, 217, 66, 126, 66, 0, 124, 66, 31, 137, 66, 135, 149, 175, 175, 152, 182, 222, 155, 158, 127, 126, 133, 66, 135, 149, 175, 175, 152, 182, 222, 155, 158, 127, 126, 66, 227, 220, 202, 149, 252, 206, 242, 245, 133, 127, 124, 32, 5, 66, 207, 214, 211, 190, 210, 199, 171, 217, 66, 126, 66, 0, 124, 66, 31, 137, 66, 135, 149, 175, 175, 152, 182, 222, 155, 158, 127, 126, 133, 66, 135, 149, 175, 175, 152, 182, 222, 155, 158, 127, 126, 66, 227, 220, 202, 149, 252, 206, 242, 245, 133, 127, 124, 32, 6, 66, 207, 214, 211, 190, 210, 199, 171, 217, 66, 126, 66, 0, 124, 66, 31, 137, 66, 135, 149, 175, 175, 152, 182, 222, 155, 158, 127, 126, 133, 66, 135, 149, 175, 175, 152, 182, 222, 155, 158, 127, 126, 66, 227, 220, 202, 149, 252, 206, 242, 245, 133, 127, 124, 32, 2, 66, 207, 214, 211, 190, 210, 199, 171, 217, 66, 126, 66, 0, 124, 66, 31, 137, 66, 135, 149, 175, 175, 152, 182, 222, 155, 158, 127, 126, 133, 66, 135, 149, 175, 175, 152, 182, 222, 155, 158, 127, 126, 66, 227, 220, 202, 149, 252, 206, 242, 245, 133, 127, 124, 5, 32, 2, 66, 197, 207, 217, 178, 241, 229, 186, 234, 39, 124, 11, 32, 1, 173, 124, 32, 0, 32, 1, 65, 31, 113, 16, 6, 11, 137, 2, 0, 32, 1, 32, 2, 106, 33, 2, 3, 64, 32, 1, 65, 8, 106, 32, 2, 77, 4, 64, 32, 1, 41, 3, 0, 66, 207, 214, 211, 190, 210, 199, 171, 217, 66, 126, 66, 0, 124, 66, 31, 137, 66, 135, 149, 175, 175, 152, 182, 222, 155, 158, 127, 126, 32, 0, 133, 66, 27, 137, 66, 135, 149, 175, 175, 152, 182, 222, 155, 158, 127, 126, 66, 227, 220, 202, 149, 252, 206, 242, 245, 133, 127, 124, 33, 0, 32, 1, 65, 8, 106, 33, 1, 12, 1, 11, 11, 32, 1, 65, 4, 106, 32, 2, 77, 4, 64, 32, 1, 53, 2, 0, 66, 135, 149, 175, 175, 152, 182, 222, 155, 158, 127, 126, 32, 0, 133, 66, 23, 137, 66, 207, 214, 211, 190, 210, 199, 171, 217, 66, 126, 66, 249, 243, 221, 241, 153, 246, 153, 171, 22, 124, 33, 0, 32, 1, 65, 4, 106, 33, 1, 11, 3, 64, 32, 1, 32, 2, 73, 4, 64, 32, 1, 49, 0, 0, 66, 197, 207, 217, 178, 241, 229, 186, 234, 39, 126, 32, 0, 133, 66, 11, 137, 66, 135, 149, 175, 175, 152, 182, 222, 155, 158, 127, 126, 33, 0, 32, 1, 65, 1, 106, 33, 1, 12, 1, 11, 11, 32, 0, 66, 33, 136, 32, 0, 133, 66, 207, 214, 211, 190, 210, 199, 171, 217, 66, 126, 34, 0, 32, 0, 66, 29, 136, 133, 66, 249, 243, 221, 241, 153, 246, 153, 171, 22, 126, 34, 0, 32, 0, 66, 32, 136, 133, 11, 88, 0, 32, 0, 65, 8, 106, 32, 1, 66, 135, 149, 175, 175, 152, 182, 222, 155, 158, 127, 124, 66, 207, 214, 211, 190, 210, 199, 171, 217, 66, 124, 55, 3, 0, 32, 0, 65, 16, 106, 32, 1, 66, 207, 214, 211, 190, 210, 199, 171, 217, 66, 124, 55, 3, 0, 32, 0, 65, 24, 106, 32, 1, 55, 3, 0, 32, 0, 65, 32, 106, 32, 1, 66, 135, 149, 175, 175, 152, 182, 222, 155, 158, 127, 125, 55, 3, 0, 11, 132, 5, 2, 3, 127, 4, 126, 32, 1, 32, 2, 106, 33, 5, 32, 0, 65, 40, 106, 33, 4, 32, 0, 65, 200, 0, 106, 40, 2, 0, 33, 3, 32, 0, 32, 0, 41, 3, 0, 32, 2, 173, 124, 55, 3, 0, 32, 2, 32, 3, 106, 65, 32, 73, 4, 64, 32, 3, 32, 4, 106, 32, 1, 32, 2, 252, 10, 0, 0, 32, 0, 65, 200, 0, 106, 32, 2, 32, 3, 106, 54, 2, 0, 15, 11, 32, 3, 4, 64, 32, 3, 32, 4, 106, 32, 1, 65, 32, 32, 3, 107, 34, 2, 252, 10, 0, 0, 32, 0, 65, 8, 106, 34, 3, 41, 3, 0, 32, 4, 41, 3, 0, 66, 207, 214, 211, 190, 210, 199, 171, 217, 66, 126, 124, 66, 31, 137, 66, 135, 149, 175, 175, 152, 182, 222, 155, 158, 127, 126, 33, 6, 32, 3, 32, 6, 55, 3, 0, 32, 0, 65, 16, 106, 34, 3, 41, 3, 0, 32, 4, 65, 8, 106, 41, 3, 0, 66, 207, 214, 211, 190, 210, 199, 171, 217, 66, 126, 124, 66, 31, 137, 66, 135, 149, 175, 175, 152, 182, 222, 155, 158, 127, 126, 33, 6, 32, 3, 32, 6, 55, 3, 0, 32, 0, 65, 24, 106, 34, 3, 41, 3, 0, 32, 4, 65, 16, 106, 41, 3, 0, 66, 207, 214, 211, 190, 210, 199, 171, 217, 66, 126, 124, 66, 31, 137, 66, 135, 149, 175, 175, 152, 182, 222, 155, 158, 127, 126, 33, 6, 32, 3, 32, 6, 55, 3, 0, 32, 0, 65, 32, 106, 34, 3, 41, 3, 0, 32, 4, 65, 24, 106, 41, 3, 0, 66, 207, 214, 211, 190, 210, 199, 171, 217, 66, 126, 124, 66, 31, 137, 66, 135, 149, 175, 175, 152, 182, 222, 155, 158, 127, 126, 33, 6, 32, 3, 32, 6, 55, 3, 0, 32, 0, 65, 200, 0, 106, 65, 0, 54, 2, 0, 32, 1, 32, 2, 106, 33, 1, 11, 32, 1, 65, 32, 106, 32, 5, 77, 4, 64, 32, 5, 65, 32, 107, 33, 2, 32, 0, 65, 8, 106, 41, 3, 0, 33, 6, 32, 0, 65, 16, 106, 41, 3, 0, 33, 7, 32, 0, 65, 24, 106, 41, 3, 0, 33, 8, 32, 0, 65, 32, 106, 41, 3, 0, 33, 9, 3, 64, 32, 1, 41, 3, 0, 66, 207, 214, 211, 190, 210, 199, 171, 217, 66, 126, 32, 6, 124, 66, 31, 137, 66, 135, 149, 175, 175, 152, 182, 222, 155, 158, 127, 126, 33, 6, 32, 1, 65, 8, 106, 34, 1, 41, 3, 0, 66, 207, 214, 211, 190, 210, 199, 171, 217, 66, 126, 32, 7, 124, 66, 31, 137, 66, 135, 149, 175, 175, 152, 182, 222, 155, 158, 127, 126, 33, 7, 32, 1, 65, 8, 106, 34, 1, 41, 3, 0, 66, 207, 214, 211, 190, 210, 199, 171, 217, 66, 126, 32, 8, 124, 66, 31, 137, 66, 135, 149, 175, 175, 152, 182, 222, 155, 158, 127, 126, 33, 8, 32, 1, 65, 8, 106, 34, 1, 41, 3, 0, 66, 207, 214, 211, 190, 210, 199, 171, 217, 66, 126, 32, 9, 124, 66, 31, 137, 66, 135, 149, 175, 175, 152, 182, 222, 155, 158, 127, 126, 33, 9, 32, 1, 65, 8, 106, 34, 1, 32, 2, 77, 13, 0, 11, 32, 0, 65, 8, 106, 32, 6, 55, 3, 0, 32, 0, 65, 16, 106, 32, 7, 55, 3, 0, 32, 0, 65, 24, 106, 32, 8, 55, 3, 0, 32, 0, 65, 32, 106, 32, 9, 55, 3, 0, 11, 32, 1, 32, 5, 73, 4, 64, 32, 4, 32, 1, 32, 5, 32, 1, 107, 34, 1, 252, 10, 0, 0, 32, 0, 65, 200, 0, 106, 32, 1, 54, 2, 0, 11, 11, 200, 2, 1, 5, 126, 32, 0, 65, 24, 106, 41, 3, 0, 33, 1, 32, 0, 41, 3, 0, 34, 2, 66, 32, 90, 4, 126, 32, 0, 65, 8, 106, 41, 3, 0, 34, 3, 66, 1, 137, 32, 0, 65, 16, 106, 41, 3, 0, 34, 4, 66, 7, 137, 124, 32, 1, 66, 12, 137, 32, 0, 65, 32, 106, 41, 3, 0, 34, 5, 66, 18, 137, 124, 124, 32, 3, 66, 207, 214, 211, 190, 210, 199, 171, 217, 66, 126, 66, 0, 124, 66, 31, 137, 66, 135, 149, 175, 175, 152, 182, 222, 155, 158, 127, 126, 133, 66, 135, 149, 175, 175, 152, 182, 222, 155, 158, 127, 126, 66, 227, 220, 202, 149, 252, 206, 242, 245, 133, 127, 124, 32, 4, 66, 207, 214, 211, 190, 210, 199, 171, 217, 66, 126, 66, 0, 124, 66, 31, 137, 66, 135, 149, 175, 175, 152, 182, 222, 155, 158, 127, 126, 133, 66, 135, 149, 175, 175, 152, 182, 222, 155, 158, 127, 126, 66, 227, 220, 202, 149, 252, 206, 242, 245, 133, 127, 124, 32, 1, 66, 207, 214, 211, 190, 210, 199, 171, 217, 66, 126, 66, 0, 124, 66, 31, 137, 66, 135, 149, 175, 175, 152, 182, 222, 155, 158, 127, 126, 133, 66, 135, 149, 175, 175, 152, 182, 222, 155, 158, 127, 126, 66, 227, 220, 202, 149, 252, 206, 242, 245, 133, 127, 124, 32, 5, 66, 207, 214, 211, 190, 210, 199, 171, 217, 66, 126, 66, 0, 124, 66, 31, 137, 66, 135, 149, 175, 175, 152, 182, 222, 155, 158, 127, 126, 133, 66, 135, 149, 175, 175, 152, 182, 222, 155, 158, 127, 126, 66, 227, 220, 202, 149, 252, 206, 242, 245, 133, 127, 124, 5, 32, 1, 66, 197, 207, 217, 178, 241, 229, 186, 234, 39, 124, 11, 32, 2, 124, 32, 0, 65, 40, 106, 32, 2, 66, 31, 131, 167, 16, 6, 11]);
    __name(e4, "e");
  }
});
async function* getFilesInFolder(dirPath) {
  const files = await fs9.readdir(dirPath, { withFileTypes: true });
  for (const file3 of files) {
    if (ALWAYS_IGNORE.has(file3.name)) {
      continue;
    }
    if (file3.name.startsWith(".") && !HIDDEN_FILES_TO_INCLUDE.has(file3.name)) {
      continue;
    }
    if (file3.isDirectory()) {
      yield* await getFilesInFolder(path3__namespace.join(dirPath, file3.name));
    } else {
      yield path3__namespace.join(dirPath, file3.name);
    }
  }
}
function hashFileContent(hasher, content) {
  return hasher.h64ToString(content).substring(0, 10);
}
function hashAsset(hasher, filePath, content) {
  const extName = path3__namespace.extname(filePath) || "";
  const baseName = path3__namespace.basename(filePath, extName);
  const directory = path3__namespace.dirname(filePath);
  const hash = hashFileContent(hasher, content);
  return urlSafe(path3__namespace.join(directory, `${baseName}.${hash}${extName}`));
}
async function createKVNamespaceIfNotAlreadyExisting(complianceConfig, title, accountId) {
  const namespaces = await listKVNamespaces(complianceConfig, accountId);
  const found = namespaces.find((ns) => ns.title === title);
  if (found) {
    return { created: false, id: found.id };
  }
  const id = await createKVNamespace(complianceConfig, accountId, title);
  logger.log(`\u{1F300} Created namespace for Workers Site "${title}"`);
  return {
    created: true,
    id
  };
}
function pluralise(count) {
  return count === 1 ? "" : "s";
}
async function syncWorkersSite(complianceConfig, accountId, scriptName, siteAssets, preview, dryRun, oldAssetTTL) {
  if (siteAssets === void 0) {
    return { manifest: void 0, namespace: void 0 };
  }
  if (dryRun) {
    logger.log("(Note: doing a dry run, not uploading or deleting anything.)");
    return { manifest: void 0, namespace: void 0 };
  }
  assert53__default.default(accountId, "Missing accountId");
  const title = `__${scriptName}-workers_sites_assets${preview ? "_preview" : ""}`;
  const { id: namespace } = await createKVNamespaceIfNotAlreadyExisting(
    complianceConfig,
    title,
    accountId
  );
  logger.info("Fetching list of already uploaded assets...");
  const namespaceKeysResponse = await listKVNamespaceKeys(
    complianceConfig,
    accountId,
    namespace
  );
  const namespaceKeyInfoMap = new Map(namespaceKeysResponse.map((x7) => [x7.name, x7]));
  const namespaceKeys = new Set(namespaceKeysResponse.map((x7) => x7.name));
  const assetDirectory = path3__namespace.join(
    siteAssets.baseDirectory,
    siteAssets.assetDirectory
  );
  const include = createPatternMatcher(siteAssets.includePatterns, false);
  const exclude = createPatternMatcher(siteAssets.excludePatterns, true);
  const hasher = await e4();
  const manifest = {};
  const uploadBuckets = [];
  let uploadBucket = [];
  let uploadBucketSize = 0;
  let uploadCount = 0;
  let skipCount = 0;
  let diffCount = 0;
  function logDiff(line) {
    const level = logger.loggerLevel;
    if (LOGGER_LEVELS[level] >= LOGGER_LEVELS.debug) {
      logger.debug(line);
    } else if (diffCount < MAX_DIFF_LINES) {
      logger.info(line);
    } else if (diffCount === MAX_DIFF_LINES) {
      const msg = "   (truncating changed assets log, set `WRANGLER_LOG=debug` environment variable to see full diff)";
      logger.info(source_default.dim(msg));
    }
    diffCount++;
  }
  __name(logDiff, "logDiff");
  logger.info("Building list of assets to upload...");
  for await (const absAssetFile of getFilesInFolder(assetDirectory)) {
    const assetFile = path3__namespace.relative(assetDirectory, absAssetFile);
    if (!include(assetFile) || exclude(assetFile)) {
      continue;
    }
    const content = await fs9.readFile(absAssetFile, "base64");
    const assetSize = Buffer.byteLength(content);
    await validateAssetSize(absAssetFile, assetFile);
    const assetKey = hashAsset(hasher, assetFile, content);
    validateAssetKey(assetKey);
    if (!namespaceKeys.has(assetKey)) {
      logDiff(
        source_default.green(` + ${assetKey} (uploading new version of ${assetFile})`)
      );
      if (uploadBucketSize + assetSize > MAX_BUCKET_SIZE2 || uploadBucket.length + 1 > MAX_BUCKET_KEYS) {
        uploadBuckets.push(uploadBucket);
        uploadBucketSize = 0;
        uploadBucket = [];
      }
      uploadBucketSize += assetSize;
      uploadBucket.push([absAssetFile, assetKey]);
      uploadCount++;
    } else {
      logDiff(source_default.dim(` = ${assetKey} (already uploaded ${assetFile})`));
      skipCount++;
    }
    namespaceKeys.delete(assetKey);
    const manifestKey = urlSafe(path3__namespace.relative(assetDirectory, absAssetFile));
    manifest[manifestKey] = assetKey;
  }
  if (uploadBucket.length > 0) {
    uploadBuckets.push(uploadBucket);
  }
  for (const key of namespaceKeys) {
    logDiff(
      source_default.red(` - ${key} (${oldAssetTTL ? "expiring" : "removing"} as stale)`)
    );
  }
  if (uploadCount > 0) {
    const s7 = pluralise(uploadCount);
    logger.info(`Uploading ${formatNumber(uploadCount)} new asset${s7}...`);
  }
  if (skipCount > 0) {
    const s7 = pluralise(skipCount);
    logger.info(
      `Skipped uploading ${formatNumber(skipCount)} existing asset${s7}.`
    );
  }
  let uploadedCount = 0;
  const controller = new AbortController();
  const uploaders = Array.from(Array(MAX_BATCH_OPERATIONS)).map(async () => {
    while (!controller.signal.aborted) {
      const nextBucket = uploadBuckets.shift();
      if (nextBucket === void 0) {
        break;
      }
      const bucket = [];
      for (const [absAssetFile, assetKey] of nextBucket) {
        bucket.push({
          key: assetKey,
          value: await fs9.readFile(absAssetFile, "base64"),
          base64: true
        });
        if (controller.signal.aborted) {
          break;
        }
      }
      try {
        await putKVBulkKeyValue(
          complianceConfig,
          accountId,
          namespace,
          bucket,
          /* quiet */
          true,
          controller.signal
        );
      } catch (e10) {
        if (typeof e10 === "object" && e10 !== null && "name" in e10 && e10.name === "AbortError") {
          break;
        }
        throw e10;
      }
      if (controller.signal.aborted) {
        break;
      }
      uploadedCount += nextBucket.length;
      const percent = Math.floor(100 * uploadedCount / uploadCount);
      logger.info(
        `Uploaded ${percent}% [${formatNumber(
          uploadedCount
        )} out of ${formatNumber(uploadCount)}]`
      );
    }
  });
  try {
    await Promise.all(uploaders);
  } catch (e10) {
    logger.info(`Upload failed, aborting...`);
    controller.abort();
    throw e10;
  }
  const deleteCount = namespaceKeys.size;
  if (deleteCount > 0) {
    const s7 = pluralise(deleteCount);
    logger.info(
      `${oldAssetTTL ? "Expiring" : "Removing"} ${formatNumber(
        deleteCount
      )} stale asset${s7}...`
    );
    if (!oldAssetTTL) {
      await deleteKVBulkKeyValue(
        complianceConfig,
        accountId,
        namespace,
        Array.from(namespaceKeys)
      );
    } else {
      for (const namespaceKey of namespaceKeys) {
        const expiration = namespaceKeyInfoMap.get(namespaceKey)?.expiration;
        logger.info(
          ` - ${namespaceKey} ${expiration ? `(already expiring at ${expiration})` : ""}`
        );
        if (expiration) {
          continue;
        }
        const currentValue = await getKVKeyValue(
          complianceConfig,
          accountId,
          namespace,
          namespaceKey
        );
        await putKVKeyValue(complianceConfig, accountId, namespace, {
          key: namespaceKey,
          value: Buffer.from(currentValue),
          expiration_ttl: oldAssetTTL
        });
      }
    }
  }
  logger.log("\u2197\uFE0F  Done syncing assets");
  return { manifest, namespace };
}
async function validateAssetSize(absFilePath, relativeFilePath) {
  const { size } = await fs9.stat(absFilePath);
  if (size > 25 * 1024 * 1024) {
    throw new UserError(
      `File ${relativeFilePath} is too big, it should be under 25 MiB. See https://developers.cloudflare.com/workers/platform/limits#kv-limits`
    );
  }
}
function validateAssetKey(assetKey) {
  if (assetKey.length > 512) {
    throw new UserError(
      `The asset path key "${assetKey}" exceeds the maximum key size limit of 512. See https://developers.cloudflare.com/workers/platform/limits#kv-limits",`
    );
  }
}
function urlSafe(filePath) {
  return filePath.replace(/\\/g, "/");
}
function getSiteAssetPaths(config, assetDirectory, includePatterns = config.site?.include ?? [], excludePatterns = config.site?.exclude ?? []) {
  const baseDirectory = assetDirectory ? process.cwd() : path3__namespace.resolve(path3__namespace.dirname(config.configPath ?? "wrangler.toml"));
  assetDirectory ??= config.site?.bucket;
  if (assetDirectory) {
    return {
      baseDirectory,
      assetDirectory,
      includePatterns,
      excludePatterns
    };
  } else {
    return void 0;
  }
}
var ALWAYS_IGNORE, HIDDEN_FILES_TO_INCLUDE, MAX_DIFF_LINES, MAX_BUCKET_SIZE2, MAX_BUCKET_KEYS, MAX_BATCH_OPERATIONS;
var init_sites2 = __esm({
  "src/sites.ts"() {
    init_import_meta_url();
    init_workers_shared();
    init_dist();
    init_source();
    init_xxhash_wasm();
    init_helpers5();
    init_logger();
    ALWAYS_IGNORE = /* @__PURE__ */ new Set(["node_modules"]);
    HIDDEN_FILES_TO_INCLUDE = /* @__PURE__ */ new Set([
      ".well-known"
      // See https://datatracker.ietf.org/doc/html/rfc8615
    ]);
    __name(getFilesInFolder, "getFilesInFolder");
    __name(hashFileContent, "hashFileContent");
    __name(hashAsset, "hashAsset");
    __name(createKVNamespaceIfNotAlreadyExisting, "createKVNamespaceIfNotAlreadyExisting");
    MAX_DIFF_LINES = 100;
    MAX_BUCKET_SIZE2 = 98 * 1e3 * 1e3;
    MAX_BUCKET_KEYS = BATCH_KEY_MAX;
    MAX_BATCH_OPERATIONS = 5;
    __name(pluralise, "pluralise");
    __name(syncWorkersSite, "syncWorkersSite");
    __name(validateAssetSize, "validateAssetSize");
    __name(validateAssetKey, "validateAssetKey");
    __name(urlSafe, "urlSafe");
    __name(getSiteAssetPaths, "getSiteAssetPaths");
  }
});

// src/utils/collectKeyValues.ts
function collectKeyValues(array) {
  return array?.reduce((recordsToCollect, v8) => {
    const [key, ...value] = v8.split(":");
    recordsToCollect[key] = value.join(":");
    return recordsToCollect;
  }, {}) || {};
}
function collectPlainTextVars(array) {
  return array?.reduce(
    (recordsToCollect, v8) => {
      const [key, ...value] = v8.split(":");
      recordsToCollect[key] = {
        type: "plain_text",
        value: value.join(":"),
        hidden: true
      };
      return recordsToCollect;
    },
    {}
  ) || {};
}
var init_collectKeyValues = __esm({
  "src/utils/collectKeyValues.ts"() {
    init_import_meta_url();
    __name(collectKeyValues, "collectKeyValues");
    __name(collectPlainTextVars, "collectPlainTextVars");
  }
});

// src/utils/getRules.ts
function getRules(config) {
  return config.rules ?? [];
}
var init_getRules = __esm({
  "src/utils/getRules.ts"() {
    init_import_meta_url();
    __name(getRules, "getRules");
  }
});
async function maybeDelegateToOpenNextDeployCommand(projectRoot) {
  if (await isOpenNextProject(projectRoot)) {
    const openNextDeploy = getOpenNextDeployFromEnv();
    if (!openNextDeploy) {
      logger.log(
        "OpenNext project detected, calling `opennextjs-cloudflare deploy`"
      );
      const deployArgIdx = process.argv.findIndex((arg) => arg === "deploy");
      assert53__default.default(deployArgIdx !== -1, "Could not find `deploy` argument");
      const deployArguments = process.argv.slice(deployArgIdx + 1);
      const { npx } = await getPackageManager();
      await runCommand2(
        [npx, "opennextjs-cloudflare", "deploy", ...deployArguments],
        {
          env: {
            // We set `OPEN_NEXT_DEPLOY` here so that it's passed through to the `wrangler deploy` command that OpenNext delegates to in order to prevent an infinite loop
            OPEN_NEXT_DEPLOY: "true"
          }
        }
      );
      return true;
    }
  }
  return false;
}
async function isOpenNextProject(projectRoot) {
  try {
    const dirFiles = await fs9.readdir(projectRoot);
    const nextConfigFile = dirFiles.find(
      (file3) => /^next\.config\.(m|c)?(ts|js)$/.test(file3)
    );
    if (!nextConfigFile) {
      return false;
    }
    const opeNextConfigFile = dirFiles.find(
      (file3) => /^open-next\.config\.(ts|js)$/.test(file3)
    );
    if (!opeNextConfigFile) {
      return false;
    }
    const openNextVersion = getInstalledPackageVersion(
      "@opennextjs/cloudflare",
      projectRoot,
      {
        // We stop at the projectPath/root just to make extra sure we don't hit false positives
        stopAtProjectPath: true
      }
    );
    return openNextVersion !== void 0;
  } catch {
    return false;
  }
}
var init_open_next = __esm({
  "src/deploy/open-next.ts"() {
    init_import_meta_url();
    init_command3();
    init_dist();
    init_packages2();
    init_logger();
    init_package_manager();
    __name(maybeDelegateToOpenNextDeployCommand, "maybeDelegateToOpenNextDeployCommand");
    __name(isOpenNextProject, "isOpenNextProject");
  }
});
async function handleMaybeAssetsDeployment(assetDirectory, args) {
  if (isNonInteractiveOrCI()) {
    return args;
  }
  logger.log("");
  if (!args.assets) {
    const deployAssets = await confirm(
      "It looks like you are trying to deploy a directory of static assets only. Is this correct?",
      { defaultValue: true }
    );
    logger.log("");
    if (deployAssets) {
      args.assets = assetDirectory;
      args.script = void 0;
    } else {
      return args;
    }
  }
  if (!args.name) {
    const defaultName = process.cwd().split(path3__namespace.default.sep).pop()?.replace("_", "-");
    const isValidName3 = defaultName && /^[a-zA-Z0-9-]+$/.test(defaultName);
    const projectName = await prompt("What do you want to name your project?", {
      defaultValue: isValidName3 ? defaultName : "my-project"
    });
    args.name = projectName;
    logger.log("");
  }
  if (!args.compatibilityDate) {
    const compatibilityDate = getTodaysCompatDate();
    args.compatibilityDate = compatibilityDate;
    logger.log(
      `${source_default.bold("No compatibility date found")} Defaulting to today:`,
      compatibilityDate
    );
    logger.log("");
  }
  const writeConfig = await confirm(
    `Do you want Wrangler to write a wrangler.json config file to store this configuration?
${source_default.dim(
      "This will allow you to simply run `wrangler deploy` on future deployments."
    )}`
  );
  if (writeConfig) {
    const configPath = path3__namespace.default.join(process.cwd(), "wrangler.jsonc");
    const jsonString = JSON.stringify(
      {
        name: args.name,
        compatibility_date: args.compatibilityDate,
        assets: { directory: args.assets }
      },
      null,
      2
    );
    fs29.writeFileSync(configPath, jsonString);
    logger.log(`Wrote 
${jsonString}
 to ${source_default.bold(configPath)}.`);
    logger.log(
      `Please run ${source_default.bold("`wrangler deploy`")} instead of ${source_default.bold(
        `\`wrangler deploy ${args.assets}\``
      )} next time. Wrangler will automatically use the configuration saved to wrangler.jsonc.`
    );
  } else {
    logger.log(
      `You should run ${source_default.bold(
        `wrangler deploy --name ${args.name} --compatibility-date ${args.compatibilityDate} --assets ${args.assets}`
      )} next time to deploy this Worker without going through this flow again.`
    );
  }
  logger.log("\nProceeding with deployment...\n");
  return args;
}
var deployCommand;
var init_deploy2 = __esm({
  "src/deploy/index.ts"() {
    init_import_meta_url();
    init_dist();
    init_source();
    init_assets5();
    init_details2();
    init_run();
    init_telemetry_utils();
    init_config();
    init_create_command();
    init_entry();
    init_dialogs();
    init_is_interactive();
    init_logger();
    init_match_tag();
    init_metrics();
    init_output();
    init_sites2();
    init_user3();
    init_collectKeyValues();
    init_getRules();
    init_getScriptName();
    init_useServiceEnvironments();
    init_deploy7();
    init_open_next();
    deployCommand = createCommand({
      metadata: {
        description: "\u{1F199} Deploy a Worker to Cloudflare",
        owner: "Workers: Deploy and Config",
        status: "stable",
        category: "Compute & AI"
      },
      positionalArgs: ["script"],
      args: {
        script: {
          describe: "The path to an entry point for your Worker",
          type: "string",
          requiresArg: true
        },
        name: {
          describe: "Name of the Worker",
          type: "string",
          requiresArg: true
        },
        // We want to have a --no-bundle flag, but yargs requires that
        // we also have a --bundle flag (that it adds the --no to by itself)
        // So we make a --bundle flag, but hide it, and then add a --no-bundle flag
        // that's visible to the user but doesn't "do" anything.
        bundle: {
          describe: "Run Wrangler's compilation step before publishing",
          type: "boolean",
          hidden: true
        },
        "no-bundle": {
          describe: "Skip internal build steps and directly deploy Worker",
          type: "boolean",
          default: false
        },
        outdir: {
          describe: "Output directory for the bundled Worker",
          type: "string",
          requiresArg: true
        },
        outfile: {
          describe: "Output file for the bundled worker",
          type: "string",
          requiresArg: true
        },
        "compatibility-date": {
          describe: "Date to use for compatibility checks",
          type: "string",
          requiresArg: true
        },
        "compatibility-flags": {
          describe: "Flags to use for compatibility checks",
          alias: "compatibility-flag",
          type: "string",
          requiresArg: true,
          array: true
        },
        latest: {
          describe: "Use the latest version of the Workers runtime",
          type: "boolean",
          default: false
        },
        assets: {
          describe: "Static assets to be served. Replaces Workers Sites.",
          type: "string",
          requiresArg: true
        },
        site: {
          describe: "Root folder of static assets for Workers Sites",
          type: "string",
          requiresArg: true,
          hidden: true,
          deprecated: true
        },
        "site-include": {
          describe: "Array of .gitignore-style patterns that match file or directory names from the sites directory. Only matched items will be uploaded.",
          type: "string",
          requiresArg: true,
          array: true,
          hidden: true,
          deprecated: true
        },
        "site-exclude": {
          describe: "Array of .gitignore-style patterns that match file or directory names from the sites directory. Matched items will not be uploaded.",
          type: "string",
          requiresArg: true,
          array: true,
          hidden: true,
          deprecated: true
        },
        var: {
          describe: "A key-value pair to be injected into the script as a variable",
          type: "string",
          requiresArg: true,
          array: true
        },
        define: {
          describe: "A key-value pair to be substituted in the script",
          type: "string",
          requiresArg: true,
          array: true
        },
        alias: {
          describe: "A module pair to be substituted in the script",
          type: "string",
          requiresArg: true,
          array: true
        },
        triggers: {
          describe: "cron schedules to attach",
          alias: ["schedule", "schedules"],
          type: "string",
          requiresArg: true,
          array: true
        },
        routes: {
          describe: "Routes to upload",
          alias: "route",
          type: "string",
          requiresArg: true,
          array: true
        },
        domains: {
          describe: "Custom domains to deploy to",
          alias: "domain",
          type: "string",
          requiresArg: true,
          array: true
        },
        "jsx-factory": {
          describe: "The function that is called for each JSX element",
          type: "string",
          requiresArg: true
        },
        "jsx-fragment": {
          describe: "The function that is called for each JSX fragment",
          type: "string",
          requiresArg: true
        },
        tsconfig: {
          describe: "Path to a custom tsconfig.json file",
          type: "string",
          requiresArg: true
        },
        minify: {
          describe: "Minify the Worker",
          type: "boolean"
        },
        "node-compat": {
          describe: "Enable Node.js compatibility",
          type: "boolean",
          hidden: true,
          deprecated: true
        },
        "dry-run": {
          describe: "Don't actually deploy",
          type: "boolean"
        },
        metafile: {
          describe: "Path to output build metadata from esbuild. If flag is used without a path, defaults to 'bundle-meta.json' inside the directory specified by --outdir.",
          type: "string",
          coerce: /* @__PURE__ */ __name((v8) => !v8 ? true : v8, "coerce")
        },
        "keep-vars": {
          describe: "When not used (or set to false), Wrangler will delete all vars before setting those found in the Wrangler configuration.\nWhen used (and set to true), the environment variables are not deleted before the deployment.\nIf you set variables via the dashboard you probably want to use this flag.\nNote that secrets are never deleted by deployments.",
          default: false,
          type: "boolean"
        },
        "legacy-env": {
          type: "boolean",
          describe: "Use legacy environments",
          hidden: true
        },
        logpush: {
          type: "boolean",
          describe: "Send Trace Events from this Worker to Workers Logpush.\nThis will not configure a corresponding Logpush job automatically."
        },
        "upload-source-maps": {
          type: "boolean",
          describe: "Include source maps when uploading this Worker."
        },
        "old-asset-ttl": {
          describe: "Expire old assets in given seconds rather than immediate deletion.",
          type: "number"
        },
        "dispatch-namespace": {
          describe: "Name of a dispatch namespace to deploy the Worker to (Workers for Platforms)",
          type: "string"
        },
        "containers-rollout": {
          describe: "Rollout strategy for Containers changes. If set to immediate, it will override `rollout_percentage_steps` if configured and roll out to 100% of instances in one step. ",
          choices: ["immediate", "gradual"]
        },
        tag: {
          describe: "A tag for this Worker Version",
          type: "string",
          requiresArg: true
        },
        message: {
          describe: "A descriptive message for this Worker Version and Deployment",
          type: "string",
          requiresArg: true
        },
        strict: {
          describe: "Enables strict mode for the deploy command, this prevents deployments to occur when there are even small potential risks.",
          type: "boolean",
          default: false
        },
        "experimental-autoconfig": {
          alias: ["x-autoconfig"],
          describe: "Experimental: Enables framework detection and automatic configuration when deploying",
          type: "boolean",
          default: true
        },
        "secrets-file": {
          describe: "Path to a file containing secrets to upload with the deployment (JSON or .env format). Secrets from previous deployments will not be deleted - see `--keep-secrets`",
          type: "string",
          requiresArg: true
        }
      },
      behaviour: {
        useConfigRedirectIfAvailable: true,
        overrideExperimentalFlags: /* @__PURE__ */ __name((args) => ({
          MULTIWORKER: false,
          RESOURCES_PROVISION: args.experimentalProvision ?? false,
          AUTOCREATE_RESOURCES: args.experimentalAutoCreate
        }), "overrideExperimentalFlags"),
        warnIfMultipleEnvsConfiguredButNoneSpecified: true,
        printMetricsBanner: true
      },
      validateArgs(args) {
        if (args.nodeCompat) {
          throw new UserError(
            "The --node-compat flag is no longer supported as of Wrangler v4. Instead, use the `nodejs_compat` compatibility flag. This includes the functionality from legacy `node_compat` polyfills and natively implemented Node.js APIs. See https://developers.cloudflare.com/workers/runtime-apis/nodejs for more information.",
            { telemetryMessage: true }
          );
        }
      },
      async handler(args, { config }) {
        const shouldRunAutoConfig = args.experimentalAutoconfig && // If there is a positional parameter or an assets directory specified via --assets then
        // we don't want to run autoconfig since we assume that the user knows what they are doing
        // and that they are specifying what needs to be deployed
        !args.script && !args.assets;
        if (config.pages_build_output_dir && // Note: autoconfig handle Pages projects on its own, so we don't want to hard fail here if autoconfig run
        !shouldRunAutoConfig) {
          throw new UserError(
            "It looks like you've run a Workers-specific command in a Pages project.\nFor Pages, please run `wrangler pages deploy` instead.",
            { telemetryMessage: true }
          );
        }
        if (shouldRunAutoConfig) {
          sendAutoConfigProcessStartedMetricsEvent({
            command: "wrangler deploy",
            dryRun: !!args.dryRun
          });
          try {
            const details = await getDetailsForAutoConfig({
              wranglerConfig: config
            });
            if (details.framework?.id === "cloudflare-pages") {
              logger.warn(
                "It seems that you have run `wrangler deploy` on a Pages project, `wrangler pages deploy` should be used instead. Proceeding will likely produce unwanted results."
              );
              const proceedWithPagesProject = await confirm(
                "Are you sure that you want to proceed?",
                {
                  defaultValue: false,
                  fallbackValue: true
                }
              );
              if (!proceedWithPagesProject) {
                sendAutoConfigProcessEndedMetricsEvent({
                  success: false,
                  command: "wrangler deploy",
                  dryRun: !!args.dryRun
                });
                return;
              }
            } else if (!details.configured) {
              const autoConfigSummary = await runAutoConfig(details);
              writeOutput({
                type: "autoconfig",
                version: 1,
                command: "deploy",
                summary: autoConfigSummary
              });
              config = readConfig(args, {
                hideWarnings: false,
                useRedirectIfAvailable: true
              });
            }
          } catch (error2) {
            sendAutoConfigProcessEndedMetricsEvent({
              command: "wrangler deploy",
              dryRun: !!args.dryRun,
              success: false,
              error: error2
            });
            throw error2;
          }
          sendAutoConfigProcessEndedMetricsEvent({
            success: true,
            command: "wrangler deploy",
            dryRun: !!args.dryRun
          });
        }
        const deploymentDelegatedToOpenNext = (
          // Currently the delegation to open-next is gated behind the autoconfig experimental flag, this is because
          // this behavior is currently only necessary in the autoconfig flow and having it un-gated/stable in wrangler
          // releases caused different issues. All the issues should have been fixed (by
          // https://github.com/cloudflare/workers-sdk/pull/11694 and https://github.com/cloudflare/workers-sdk/pull/11710)
          // but as a precaution we're gating the feature under the autoconfig flag for the time being
          args.experimentalAutoconfig && !args.dryRun && await maybeDelegateToOpenNextDeployCommand(process.cwd())
        );
        if (deploymentDelegatedToOpenNext) {
          return;
        }
        if (!config.configPath) {
          if (args.script) {
            try {
              const stats = fs29.statSync(args.script);
              if (stats.isDirectory()) {
                args = await handleMaybeAssetsDeployment(args.script, args);
              }
            } catch (error2) {
              if (error2 instanceof UserError) {
                throw error2;
              }
            }
          } else if (args.assets && (!args.compatibilityDate || !args.name)) {
            args = await handleMaybeAssetsDeployment(args.assets, args);
          }
        }
        const entry = await getEntry(args, config, "deploy");
        validateAssetsArgsAndConfig(args, config);
        const assetsOptions = getAssetsOptions(args, config);
        if (args.latest) {
          logger.warn(
            `Using the latest version of the Workers runtime. To silence this warning, please choose a specific version of the runtime with --compatibility-date, or add a compatibility_date to your ${configFileName(
              config.configPath
            )} file.`
          );
        }
        const cliVars = collectKeyValues(args.var);
        const cliDefines = collectKeyValues(args.define);
        const cliAlias = collectKeyValues(args.alias);
        const accountId = args.dryRun ? void 0 : await requireAuth(config);
        const siteAssetPaths = getSiteAssetPaths(
          config,
          args.site,
          args.siteInclude,
          args.siteExclude
        );
        const beforeUpload = Date.now();
        let name2 = getScriptName(args, config);
        const ciOverrideName = getCIOverrideName();
        let workerNameOverridden = false;
        if (ciOverrideName !== void 0 && ciOverrideName !== name2) {
          logger.warn(
            `Failed to match Worker name. Your config file is using the Worker name "${name2}", but the CI system expected "${ciOverrideName}". Overriding using the CI provided Worker name. Workers Builds connected builds will attempt to open a pull request to resolve this config name mismatch.`
          );
          name2 = ciOverrideName;
          workerNameOverridden = true;
        }
        if (!name2) {
          throw new UserError(
            'You need to provide a name when publishing a worker. Either pass it as a cli arg with `--name <name>` or in your config file as `name = "<name>"`',
            { telemetryMessage: true }
          );
        }
        if (!args.dryRun) {
          assert53__default.default(accountId, "Missing account ID");
          await verifyWorkerMatchesCITag(
            config,
            accountId,
            name2,
            config.configPath
          );
        }
        const projectRoot = config.userConfigPath && path3__namespace.default.dirname(config.userConfigPath);
        const { sourceMapSize, versionId, workerTag, targets } = await deploy({
          config,
          accountId,
          name: name2,
          rules: getRules(config),
          entry,
          env: args.env,
          compatibilityDate: args.latest ? getTodaysCompatDate() : args.compatibilityDate,
          compatibilityFlags: args.compatibilityFlags,
          vars: cliVars,
          defines: cliDefines,
          alias: cliAlias,
          triggers: args.triggers,
          jsxFactory: args.jsxFactory,
          jsxFragment: args.jsxFragment,
          tsconfig: args.tsconfig,
          routes: args.routes,
          domains: args.domains,
          assetsOptions,
          legacyAssetPaths: siteAssetPaths,
          useServiceEnvironments: useServiceEnvironments(config),
          minify: args.minify,
          isWorkersSite: Boolean(args.site || config.site),
          outDir: args.outdir,
          outFile: args.outfile,
          dryRun: args.dryRun,
          metafile: args.metafile,
          noBundle: !(args.bundle ?? !config.no_bundle),
          keepVars: args.keepVars,
          logpush: args.logpush,
          uploadSourceMaps: args.uploadSourceMaps,
          oldAssetTtl: args.oldAssetTtl,
          projectRoot,
          dispatchNamespace: args.dispatchNamespace,
          experimentalAutoCreate: args.experimentalAutoCreate,
          containersRollout: args.containersRollout,
          strict: args.strict,
          tag: args.tag,
          message: args.message,
          secretsFile: args.secretsFile
        });
        writeOutput({
          type: "deploy",
          version: 1,
          worker_name: name2 ?? null,
          worker_tag: workerTag,
          version_id: versionId,
          targets,
          wrangler_environment: args.env,
          worker_name_overridden: workerNameOverridden
        });
        sendMetricsEvent(
          "deploy worker script",
          {
            usesTypeScript: /\.tsx?$/.test(entry.file),
            durationMs: Date.now() - beforeUpload,
            sourceMapSize
          },
          {
            sendMetrics: config.send_metrics
          }
        );
      }
    });
    __name(handleMaybeAssetsDeployment, "handleMaybeAssetsDeployment");
  }
});

// src/dispatch-namespace.ts
async function createWorkerNamespace(complianceConfig, accountId, name2) {
  const namespace = await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/workers/dispatch/namespaces`,
    {
      method: "POST",
      headers: {
        "Content-Type": "application/json"
      },
      body: JSON.stringify({ name: name2 })
    }
  );
  logger.log(
    `Created dispatch namespace "${name2}" with ID "${namespace.namespace_id}"`
  );
}
async function deleteWorkerNamespace(complianceConfig, accountId, name2) {
  await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/workers/dispatch/namespaces/${name2}`,
    { method: "DELETE" }
  );
  logger.log(`Deleted dispatch namespace "${name2}"`);
}
async function listWorkerNamespaces(complianceConfig, accountId) {
  logger.log(
    await fetchResult(
      complianceConfig,
      `/accounts/${accountId}/workers/dispatch/namespaces`,
      {
        headers: {
          "Content-Type": "application/json"
        }
      }
    )
  );
}
async function getWorkerNamespaceInfo(complianceConfig, accountId, name2) {
  logger.log(
    await fetchResult(
      complianceConfig,
      `/accounts/${accountId}/workers/dispatch/namespaces/${name2}`,
      {
        headers: {
          "Content-Type": "application/json"
        }
      }
    )
  );
}
async function renameWorkerNamespace(complianceConfig, accountId, oldName, newName) {
  await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/workers/dispatch/namespaces/${oldName}`,
    {
      method: "PUT",
      headers: {
        "Content-Type": "application/json"
      },
      body: JSON.stringify({ name: newName })
    }
  );
  logger.log(`Renamed dispatch namespace "${oldName}" to "${newName}"`);
}
var dispatchNamespaceNamespace, dispatchNamespaceListCommand, dispatchNamespaceGetCommand, dispatchNamespaceCreateCommand, dispatchNamespaceDeleteCommand, dispatchNamespaceRenameCommand;
var init_dispatch_namespace = __esm({
  "src/dispatch-namespace.ts"() {
    init_import_meta_url();
    init_cfetch();
    init_create_command();
    init_logger();
    init_metrics();
    init_user3();
    __name(createWorkerNamespace, "createWorkerNamespace");
    __name(deleteWorkerNamespace, "deleteWorkerNamespace");
    __name(listWorkerNamespaces, "listWorkerNamespaces");
    __name(getWorkerNamespaceInfo, "getWorkerNamespaceInfo");
    __name(renameWorkerNamespace, "renameWorkerNamespace");
    dispatchNamespaceNamespace = createNamespace({
      metadata: {
        description: "\u{1F3D7}\uFE0F Manage dispatch namespaces",
        owner: "Workers: Deploy and Config",
        status: "stable",
        category: "Compute & AI"
      }
    });
    dispatchNamespaceListCommand = createCommand({
      metadata: {
        description: "List all dispatch namespaces",
        owner: "Workers: Deploy and Config",
        status: "stable"
      },
      async handler(_5, { config }) {
        const accountId = await requireAuth(config);
        await listWorkerNamespaces(config, accountId);
        sendMetricsEvent("list dispatch namespaces", {
          sendMetrics: config.send_metrics
        });
      }
    });
    dispatchNamespaceGetCommand = createCommand({
      metadata: {
        description: "Get information about a dispatch namespace",
        owner: "Workers: Deploy and Config",
        status: "stable"
      },
      args: {
        name: {
          describe: "Name of the dispatch namespace",
          type: "string",
          demandOption: true
        }
      },
      positionalArgs: ["name"],
      async handler(args, { config }) {
        const accountId = await requireAuth(config);
        await getWorkerNamespaceInfo(config, accountId, args.name);
        sendMetricsEvent("view dispatch namespace", {
          sendMetrics: config.send_metrics
        });
      }
    });
    dispatchNamespaceCreateCommand = createCommand({
      metadata: {
        description: "Create a dispatch namespace",
        owner: "Workers: Deploy and Config",
        status: "stable"
      },
      args: {
        name: {
          describe: "Name of the dispatch namespace",
          type: "string",
          demandOption: true
        }
      },
      positionalArgs: ["name"],
      async handler(args, { config }) {
        const accountId = await requireAuth(config);
        await createWorkerNamespace(config, accountId, args.name);
        sendMetricsEvent("create dispatch namespace", {
          sendMetrics: config.send_metrics
        });
      }
    });
    dispatchNamespaceDeleteCommand = createCommand({
      metadata: {
        description: "Delete a dispatch namespace",
        owner: "Workers: Deploy and Config",
        status: "stable"
      },
      args: {
        name: {
          describe: "Name of the dispatch namespace",
          type: "string",
          demandOption: true
        }
      },
      positionalArgs: ["name"],
      async handler(args, { config }) {
        const accountId = await requireAuth(config);
        await deleteWorkerNamespace(config, accountId, args.name);
        sendMetricsEvent("delete dispatch namespace", {
          sendMetrics: config.send_metrics
        });
      }
    });
    dispatchNamespaceRenameCommand = createCommand({
      metadata: {
        description: "Rename a dispatch namespace",
        owner: "Workers: Deploy and Config",
        status: "stable"
      },
      args: {
        oldName: {
          describe: "Name of the dispatch namespace",
          type: "string",
          demandOption: true
        },
        newName: {
          describe: "New name of the dispatch namespace",
          type: "string",
          demandOption: true
        }
      },
      positionalArgs: ["oldName", "newName"],
      async handler(args, { config }) {
        const accountId = await requireAuth(config);
        await renameWorkerNamespace(config, accountId, args.oldName, args.newName);
        sendMetricsEvent("rename dispatch namespace", {
          sendMetrics: config.send_metrics
        });
      }
    });
  }
});
async function runSearch(searchTerm) {
  const id = ALGOLIA_APP_ID;
  const index = "developers-cloudflare2";
  const key = ALGOLIA_PUBLIC_KEY;
  const params = new URLSearchParams({
    query: searchTerm,
    hitsPerPage: "1",
    getRankingInfo: "0"
  });
  assert53__default.default(id, "Missing Algolia App ID");
  assert53__default.default(key, "Missing Algolia Key");
  const searchResp = await (0, import_undici15.fetch)(
    `https://${id}-dsn.algolia.net/1/indexes/${index}/query`,
    {
      method: "POST",
      body: JSON.stringify({
        params: params.toString()
      }),
      headers: {
        "X-Algolia-API-Key": key,
        "X-Algolia-Application-Id": id
      }
    }
  );
  if (!searchResp.ok) {
    logger.error(`Could not search the docs. Please try again later.`);
    return;
  }
  const searchData = await searchResp.json();
  logger.debug("searchData: ", searchData);
  if (searchData.hits[0]) {
    return searchData.hits[0].url;
  } else {
    logger.error(
      `Could not find docs for: ${searchTerm}. Please try again with another search term.`
    );
    return;
  }
}
var import_undici15;
var init_helpers6 = __esm({
  "src/docs/helpers.ts"() {
    init_import_meta_url();
    import_undici15 = __toESM(require_undici());
    init_logger();
    __name(runSearch, "runSearch");
  }
});

// src/docs/index.ts
var docs;
var init_docs = __esm({
  "src/docs/index.ts"() {
    init_import_meta_url();
    init_create_command();
    init_logger();
    init_metrics();
    init_open_in_browser();
    init_helpers6();
    docs = createCommand({
      metadata: {
        description: "\u{1F4DA} Open Wrangler's command documentation in your browser",
        owner: "Workers: Authoring and Testing",
        status: "stable"
      },
      args: {
        search: {
          describe: "Enter search terms (e.g. the wrangler command) you want to know more about",
          type: "string",
          array: true
        },
        yes: {
          alias: "y",
          type: "boolean",
          describe: "Takes you to the docs, even if search fails"
        }
      },
      behaviour: {
        printMetricsBanner: true
      },
      positionalArgs: ["search"],
      async handler(args, { config }) {
        let urlToOpen = args.yes || !args.search || args.search.length === 0 ? "https://developers.cloudflare.com/workers/wrangler/commands/" : "";
        if (args.search && args.search.length > 0) {
          const searchTerm = args.search.join(" ");
          const searchResult = await runSearch(searchTerm);
          urlToOpen = searchResult ?? urlToOpen;
        }
        if (!urlToOpen) {
          return;
        }
        logger.log(`Opening a link in your default browser: ${urlToOpen}`);
        await openInBrowser(urlToOpen);
        sendMetricsEvent("view docs", {
          sendMetrics: config.send_metrics
        });
      }
    });
  }
});

// src/email-routing/client.ts
async function listEmailRoutingZones(config) {
  const accountId = await requireAuth(config);
  return await fetchPagedListResult(
    config,
    `/accounts/${accountId}/email/routing/zones`
  );
}
async function listEmailSendingZones(config) {
  const accountId = await requireAuth(config);
  return await fetchPagedListResult(
    config,
    `/accounts/${accountId}/email/sending/zones`
  );
}
async function getEmailRoutingSettings(config, zoneId) {
  await requireAuth(config);
  return await fetchResult(
    config,
    `/zones/${zoneId}/email/routing`
  );
}
async function enableEmailRouting(config, zoneId) {
  await requireAuth(config);
  return await fetchResult(
    config,
    `/zones/${zoneId}/email/routing/enable`,
    {
      method: "POST",
      headers: { "Content-Type": "application/json" },
      body: JSON.stringify({})
    }
  );
}
async function disableEmailRouting(config, zoneId) {
  await requireAuth(config);
  return await fetchResult(
    config,
    `/zones/${zoneId}/email/routing/disable`,
    {
      method: "POST",
      headers: { "Content-Type": "application/json" },
      body: JSON.stringify({})
    }
  );
}
async function getEmailRoutingDns(config, zoneId) {
  await requireAuth(config);
  return await fetchResult(
    config,
    `/zones/${zoneId}/email/routing/dns`
  );
}
async function unlockEmailRoutingDns(config, zoneId) {
  await requireAuth(config);
  return await fetchResult(
    config,
    `/zones/${zoneId}/email/routing/unlock`,
    {
      method: "POST",
      headers: { "Content-Type": "application/json" },
      body: JSON.stringify({})
    }
  );
}
async function listEmailRoutingRules(config, zoneId) {
  await requireAuth(config);
  return await fetchPagedListResult(
    config,
    `/zones/${zoneId}/email/routing/rules`,
    {},
    new URLSearchParams({ order: "created", direction: "asc" })
  );
}
async function getEmailRoutingRule(config, zoneId, ruleId) {
  await requireAuth(config);
  return await fetchResult(
    config,
    `/zones/${zoneId}/email/routing/rules/${ruleId}`
  );
}
async function createEmailRoutingRule(config, zoneId, body) {
  await requireAuth(config);
  return await fetchResult(
    config,
    `/zones/${zoneId}/email/routing/rules`,
    {
      method: "POST",
      headers: { "Content-Type": "application/json" },
      body: JSON.stringify(body)
    }
  );
}
async function updateEmailRoutingRule(config, zoneId, ruleId, body) {
  await requireAuth(config);
  return await fetchResult(
    config,
    `/zones/${zoneId}/email/routing/rules/${ruleId}`,
    {
      method: "PUT",
      headers: { "Content-Type": "application/json" },
      body: JSON.stringify(body)
    }
  );
}
async function deleteEmailRoutingRule(config, zoneId, ruleId) {
  await requireAuth(config);
  return await fetchResult(
    config,
    `/zones/${zoneId}/email/routing/rules/${ruleId}`,
    {
      method: "DELETE"
    }
  );
}
async function getEmailRoutingCatchAll(config, zoneId) {
  await requireAuth(config);
  return await fetchResult(
    config,
    `/zones/${zoneId}/email/routing/rules/catch_all`
  );
}
async function updateEmailRoutingCatchAll(config, zoneId, body) {
  await requireAuth(config);
  return await fetchResult(
    config,
    `/zones/${zoneId}/email/routing/rules/catch_all`,
    {
      method: "PUT",
      headers: { "Content-Type": "application/json" },
      body: JSON.stringify(body)
    }
  );
}
async function listEmailRoutingAddresses(config) {
  const accountId = await requireAuth(config);
  return await fetchPagedListResult(
    config,
    `/accounts/${accountId}/email/routing/addresses`,
    {},
    new URLSearchParams({ order: "created", direction: "asc" })
  );
}
async function getEmailRoutingAddress(config, addressId) {
  const accountId = await requireAuth(config);
  return await fetchResult(
    config,
    `/accounts/${accountId}/email/routing/addresses/${addressId}`
  );
}
async function createEmailRoutingAddress(config, email) {
  const accountId = await requireAuth(config);
  return await fetchResult(
    config,
    `/accounts/${accountId}/email/routing/addresses`,
    {
      method: "POST",
      headers: { "Content-Type": "application/json" },
      body: JSON.stringify({ email })
    }
  );
}
async function deleteEmailRoutingAddress(config, addressId) {
  const accountId = await requireAuth(config);
  return await fetchResult(
    config,
    `/accounts/${accountId}/email/routing/addresses/${addressId}`,
    {
      method: "DELETE"
    }
  );
}
async function getEmailSendingSettings(config, zoneId) {
  await requireAuth(config);
  return await fetchResult(
    config,
    `/zones/${zoneId}/email/sending`
  );
}
async function enableEmailSending(config, zoneId, name2) {
  await requireAuth(config);
  return await fetchResult(
    config,
    `/zones/${zoneId}/email/sending/enable`,
    {
      method: "POST",
      headers: { "Content-Type": "application/json" },
      body: JSON.stringify(name2 ? { name: name2 } : {})
    }
  );
}
async function disableEmailSending(config, zoneId, name2) {
  await requireAuth(config);
  return await fetchResult(
    config,
    `/zones/${zoneId}/email/sending/disable`,
    {
      method: "POST",
      headers: { "Content-Type": "application/json" },
      body: JSON.stringify(name2 ? { name: name2 } : {})
    }
  );
}
async function getEmailSendingDns(config, zoneId) {
  await requireAuth(config);
  return await fetchResult(
    config,
    `/zones/${zoneId}/email/sending/dns`
  );
}
async function getEmailSendingSubdomainDns(config, zoneId, subdomainId) {
  await requireAuth(config);
  return await fetchResult(
    config,
    `/zones/${zoneId}/email/sending/subdomains/${subdomainId}/dns`
  );
}
async function sendEmail(config, body) {
  const accountId = await requireAuth(config);
  return await fetchResult(
    config,
    `/accounts/${accountId}/email/sending/send`,
    {
      method: "POST",
      headers: { "Content-Type": "application/json" },
      body: JSON.stringify(body)
    }
  );
}
async function sendRawEmail(config, body) {
  const accountId = await requireAuth(config);
  return await fetchResult(
    config,
    `/accounts/${accountId}/email/sending/send_raw`,
    {
      method: "POST",
      headers: { "Content-Type": "application/json" },
      body: JSON.stringify(body)
    }
  );
}
var init_client5 = __esm({
  "src/email-routing/client.ts"() {
    init_import_meta_url();
    init_cfetch();
    init_user3();
    __name(listEmailRoutingZones, "listEmailRoutingZones");
    __name(listEmailSendingZones, "listEmailSendingZones");
    __name(getEmailRoutingSettings, "getEmailRoutingSettings");
    __name(enableEmailRouting, "enableEmailRouting");
    __name(disableEmailRouting, "disableEmailRouting");
    __name(getEmailRoutingDns, "getEmailRoutingDns");
    __name(unlockEmailRoutingDns, "unlockEmailRoutingDns");
    __name(listEmailRoutingRules, "listEmailRoutingRules");
    __name(getEmailRoutingRule, "getEmailRoutingRule");
    __name(createEmailRoutingRule, "createEmailRoutingRule");
    __name(updateEmailRoutingRule, "updateEmailRoutingRule");
    __name(deleteEmailRoutingRule, "deleteEmailRoutingRule");
    __name(getEmailRoutingCatchAll, "getEmailRoutingCatchAll");
    __name(updateEmailRoutingCatchAll, "updateEmailRoutingCatchAll");
    __name(listEmailRoutingAddresses, "listEmailRoutingAddresses");
    __name(getEmailRoutingAddress, "getEmailRoutingAddress");
    __name(createEmailRoutingAddress, "createEmailRoutingAddress");
    __name(deleteEmailRoutingAddress, "deleteEmailRoutingAddress");
    __name(getEmailSendingSettings, "getEmailSendingSettings");
    __name(enableEmailSending, "enableEmailSending");
    __name(disableEmailSending, "disableEmailSending");
    __name(getEmailSendingDns, "getEmailSendingDns");
    __name(getEmailSendingSubdomainDns, "getEmailSendingSubdomainDns");
    __name(sendEmail, "sendEmail");
    __name(sendRawEmail, "sendRawEmail");
  }
});

// src/email-routing/addresses/create.ts
var emailRoutingAddressesCreateCommand;
var init_create6 = __esm({
  "src/email-routing/addresses/create.ts"() {
    init_import_meta_url();
    init_create_command();
    init_logger();
    init_client5();
    emailRoutingAddressesCreateCommand = createCommand({
      metadata: {
        description: "Create an Email Routing destination address",
        status: "open beta",
        owner: "Product: Email Service"
      },
      args: {
        email: {
          type: "string",
          demandOption: true,
          description: "Destination email address"
        }
      },
      positionalArgs: ["email"],
      async handler(args, { config }) {
        const address = await createEmailRoutingAddress(config, args.email);
        logger.log(`Created destination address: ${address.email}`);
        logger.log(`  ID: ${address.id}`);
        logger.log(
          `  A verification email has been sent. The address must be verified before it can be used.`
        );
      }
    });
  }
});

// src/email-routing/addresses/delete.ts
var emailRoutingAddressesDeleteCommand;
var init_delete5 = __esm({
  "src/email-routing/addresses/delete.ts"() {
    init_import_meta_url();
    init_create_command();
    init_dialogs();
    init_logger();
    init_client5();
    emailRoutingAddressesDeleteCommand = createCommand({
      metadata: {
        description: "Delete an Email Routing destination address",
        status: "open beta",
        owner: "Product: Email Service"
      },
      args: {
        "address-id": {
          type: "string",
          demandOption: true,
          description: "The ID of the destination address to delete"
        },
        force: {
          type: "boolean",
          alias: "y",
          description: "Skip confirmation",
          default: false
        }
      },
      positionalArgs: ["address-id"],
      async handler(args, { config }) {
        if (!args.force) {
          const confirmed = await confirm(
            `Are you sure you want to delete destination address '${args.addressId}'?`,
            { fallbackValue: false }
          );
          if (!confirmed) {
            logger.log("Not deleting.");
            return;
          }
        }
        await deleteEmailRoutingAddress(config, args.addressId);
        logger.log(`Deleted destination address: ${args.addressId}`);
      }
    });
  }
});

// src/email-routing/addresses/get.ts
var emailRoutingAddressesGetCommand;
var init_get2 = __esm({
  "src/email-routing/addresses/get.ts"() {
    init_import_meta_url();
    init_create_command();
    init_logger();
    init_client5();
    emailRoutingAddressesGetCommand = createCommand({
      metadata: {
        description: "Get a specific Email Routing destination address",
        status: "open beta",
        owner: "Product: Email Service"
      },
      args: {
        "address-id": {
          type: "string",
          demandOption: true,
          description: "The ID of the destination address"
        }
      },
      positionalArgs: ["address-id"],
      async handler(args, { config }) {
        const address = await getEmailRoutingAddress(config, args.addressId);
        logger.log(`Destination address: ${address.email}`);
        logger.log(`  ID:       ${address.id}`);
        logger.log(`  Verified: ${address.verified || "pending"}`);
        logger.log(`  Created:  ${address.created}`);
        logger.log(`  Modified: ${address.modified}`);
      }
    });
  }
});

// src/email-routing/addresses/list.ts
var emailRoutingAddressesListCommand;
var init_list7 = __esm({
  "src/email-routing/addresses/list.ts"() {
    init_import_meta_url();
    init_create_command();
    init_logger();
    init_client5();
    emailRoutingAddressesListCommand = createCommand({
      metadata: {
        description: "List Email Routing destination addresses",
        status: "open beta",
        owner: "Product: Email Service"
      },
      args: {},
      async handler(_args, { config }) {
        const addresses = await listEmailRoutingAddresses(config);
        if (addresses.length === 0) {
          logger.log("No destination addresses found.");
          return;
        }
        logger.table(
          addresses.map((a7) => ({
            id: a7.id,
            email: a7.email,
            verified: a7.verified || "pending",
            created: a7.created
          }))
        );
      }
    });
  }
});
async function retryOnAPIFailure(action, backoff = 0, attempts = MAX_ATTEMPTS, abortSignal) {
  try {
    return await action();
  } catch (err) {
    if (err instanceof APIError) {
      if (!err.isRetryable()) {
        throw err;
      }
    } else if (err instanceof DOMException && err.name === "TimeoutError") ; else if (!(err instanceof TypeError)) {
      throw err;
    }
    logger.debug(source_default.dim(`Retrying API call after error...`));
    logger.debug(err);
    if (attempts <= 1) {
      throw err;
    }
    await promises.setTimeout(backoff, void 0, { signal: abortSignal });
    return retryOnAPIFailure(action, backoff + 1e3, attempts - 1, abortSignal);
  }
}
var MAX_ATTEMPTS;
var init_retry = __esm({
  "src/utils/retry.ts"() {
    init_import_meta_url();
    init_dist();
    init_source();
    init_logger();
    MAX_ATTEMPTS = 3;
    __name(retryOnAPIFailure, "retryOnAPIFailure");
  }
});

// src/email-routing/utils.ts
async function resolveZoneId(config, args) {
  if (args.zoneId) {
    return args.zoneId;
  }
  if (args.domain) {
    const accountId = await requireAuth(config);
    return await getZoneIdByDomain(config, args.domain, accountId);
  }
  throw new UserError("You must provide a domain or --zone-id.");
}
async function getZoneIdByDomain(complianceConfig, domain2, accountId) {
  const zones = await retryOnAPIFailure(
    () => fetchListResult(
      complianceConfig,
      `/zones`,
      {},
      new URLSearchParams({
        name: domain2,
        "account.id": accountId
      })
    )
  );
  const zoneId = zones[0]?.id;
  if (!zoneId) {
    throw new UserError(
      `Could not find zone for \`${domain2}\`. Make sure the domain exists in your account.`
    );
  }
  return zoneId;
}
async function resolveDomain(config, domain2, zoneId) {
  if (zoneId) {
    await requireAuth(config);
    const zone = await retryOnAPIFailure(
      () => fetchResult(config, `/zones/${zoneId}`)
    );
    return {
      zoneId,
      zoneName: zone.name,
      isSubdomain: domain2 !== zone.name,
      domain: domain2
    };
  }
  const accountId = await requireAuth(config);
  const labels = domain2.split(".");
  for (let i7 = 0; i7 <= labels.length - 2; i7++) {
    const candidate = labels.slice(i7).join(".");
    const zones = await retryOnAPIFailure(
      () => fetchListResult(
        config,
        `/zones`,
        {},
        new URLSearchParams({
          name: candidate,
          "account.id": accountId
        })
      )
    );
    if (zones[0]) {
      return {
        zoneId: zones[0].id,
        zoneName: zones[0].name,
        isSubdomain: domain2 !== zones[0].name,
        domain: domain2
      };
    }
  }
  throw new UserError(
    `Could not find a zone for \`${domain2}\`. Make sure the domain or its parent zone exists in your account.`
  );
}
var init_utils10 = __esm({
  "src/email-routing/utils.ts"() {
    init_import_meta_url();
    init_dist();
    init_cfetch();
    init_user3();
    init_retry();
    __name(resolveZoneId, "resolveZoneId");
    __name(getZoneIdByDomain, "getZoneIdByDomain");
    __name(resolveDomain, "resolveDomain");
  }
});

// src/email-routing/index.ts
var emailNamespace, emailRoutingNamespace, emailRoutingDnsNamespace, emailRoutingRulesNamespace, emailRoutingAddressesNamespace, emailSendingNamespace, emailSendingDnsNamespace, domainArgs;
var init_email_routing2 = __esm({
  "src/email-routing/index.ts"() {
    init_import_meta_url();
    init_create_command();
    emailNamespace = createNamespace({
      metadata: {
        description: "Manage Cloudflare Email services",
        status: "open beta",
        owner: "Product: Email Service"
      }
    });
    emailRoutingNamespace = createNamespace({
      metadata: {
        description: "Manage Email Routing",
        status: "open beta",
        owner: "Product: Email Service"
      }
    });
    emailRoutingDnsNamespace = createNamespace({
      metadata: {
        description: "Manage Email Routing DNS settings",
        status: "open beta",
        owner: "Product: Email Service"
      }
    });
    emailRoutingRulesNamespace = createNamespace({
      metadata: {
        description: "Manage Email Routing rules",
        status: "open beta",
        owner: "Product: Email Service"
      }
    });
    emailRoutingAddressesNamespace = createNamespace({
      metadata: {
        description: "Manage Email Routing destination addresses",
        status: "open beta",
        owner: "Product: Email Service"
      }
    });
    emailSendingNamespace = createNamespace({
      metadata: {
        description: "Manage Email Sending",
        status: "open beta",
        owner: "Product: Email Service"
      }
    });
    emailSendingDnsNamespace = createNamespace({
      metadata: {
        description: "Manage Email Sending DNS records",
        status: "open beta",
        owner: "Product: Email Service"
      }
    });
    domainArgs = {
      domain: {
        type: "string",
        demandOption: true,
        description: "Domain name (e.g. example.com)"
      },
      "zone-id": {
        type: "string",
        description: "Zone ID (optional, skips zone lookup if provided)"
      }
    };
  }
});

// src/email-routing/disable.ts
var emailRoutingDisableCommand;
var init_disable = __esm({
  "src/email-routing/disable.ts"() {
    init_import_meta_url();
    init_create_command();
    init_dialogs();
    init_logger();
    init_client5();
    init_utils10();
    init_email_routing2();
    emailRoutingDisableCommand = createCommand({
      metadata: {
        description: "Disable Email Routing for a zone",
        status: "open beta",
        owner: "Product: Email Service"
      },
      args: {
        ...domainArgs,
        force: {
          type: "boolean",
          alias: "y",
          description: "Skip confirmation",
          default: false
        }
      },
      positionalArgs: ["domain"],
      async handler(args, { config }) {
        const zoneId = await resolveZoneId(config, args);
        if (!args.force) {
          const confirmed = await confirm(
            "Are you sure you want to disable Email Routing for this zone?",
            { fallbackValue: false }
          );
          if (!confirmed) {
            logger.log("Not disabling.");
            return;
          }
        }
        const settings = await disableEmailRouting(config, zoneId);
        logger.log(
          `Email Routing disabled for ${settings.name} (status: ${settings.status})`
        );
      }
    });
  }
});

// src/email-routing/dns-get.ts
var emailRoutingDnsGetCommand;
var init_dns_get = __esm({
  "src/email-routing/dns-get.ts"() {
    init_import_meta_url();
    init_create_command();
    init_logger();
    init_client5();
    init_utils10();
    init_email_routing2();
    emailRoutingDnsGetCommand = createCommand({
      metadata: {
        description: "Show DNS records required for Email Routing",
        status: "open beta",
        owner: "Product: Email Service"
      },
      args: {
        ...domainArgs
      },
      positionalArgs: ["domain"],
      async handler(args, { config }) {
        const zoneId = await resolveZoneId(config, args);
        const records = await getEmailRoutingDns(config, zoneId);
        if (records.length === 0) {
          logger.log("No DNS records found.");
          return;
        }
        for (const r10 of records) {
          logger.log(`${r10.type} record:`);
          logger.log(`  Name:     ${r10.name}`);
          logger.log(`  Content:  ${r10.content}`);
          if (r10.priority !== void 0) {
            logger.log(`  Priority: ${r10.priority}`);
          }
          logger.log(`  TTL:      ${r10.ttl}`);
          logger.log("");
        }
      }
    });
  }
});

// src/email-routing/dns-unlock.ts
var emailRoutingDnsUnlockCommand;
var init_dns_unlock = __esm({
  "src/email-routing/dns-unlock.ts"() {
    init_import_meta_url();
    init_create_command();
    init_dialogs();
    init_logger();
    init_client5();
    init_utils10();
    init_email_routing2();
    emailRoutingDnsUnlockCommand = createCommand({
      metadata: {
        description: "Unlock MX records for Email Routing",
        status: "open beta",
        owner: "Product: Email Service"
      },
      args: {
        ...domainArgs,
        force: {
          type: "boolean",
          alias: "y",
          description: "Skip confirmation",
          default: false
        }
      },
      positionalArgs: ["domain"],
      async handler(args, { config }) {
        const zoneId = await resolveZoneId(config, args);
        if (!args.force) {
          const confirmed = await confirm(
            `Are you sure you want to unlock DNS records for '${args.domain ?? zoneId}'? This can allow external records to override Email Routing, which may cause deliverability issues or stop emails from being delivered through Cloudflare.`,
            { fallbackValue: false }
          );
          if (!confirmed) {
            logger.log("Not unlocking.");
            return;
          }
        }
        const settings = await unlockEmailRoutingDns(config, zoneId);
        logger.log(
          `MX records unlocked for ${settings.name} (enabled: ${settings.enabled})`
        );
      }
    });
  }
});

// src/email-routing/enable.ts
var emailRoutingEnableCommand;
var init_enable = __esm({
  "src/email-routing/enable.ts"() {
    init_import_meta_url();
    init_create_command();
    init_logger();
    init_client5();
    init_utils10();
    init_email_routing2();
    emailRoutingEnableCommand = createCommand({
      metadata: {
        description: "Enable Email Routing for a zone",
        status: "open beta",
        owner: "Product: Email Service"
      },
      args: {
        ...domainArgs
      },
      positionalArgs: ["domain"],
      async handler(args, { config }) {
        const zoneId = await resolveZoneId(config, args);
        const settings = await enableEmailRouting(config, zoneId);
        logger.log(
          `Email Routing enabled for ${settings.name} (status: ${settings.status})`
        );
      }
    });
  }
});

// src/email-routing/list.ts
var emailRoutingListCommand;
var init_list8 = __esm({
  "src/email-routing/list.ts"() {
    init_import_meta_url();
    init_create_command();
    init_logger();
    init_client5();
    emailRoutingListCommand = createCommand({
      metadata: {
        description: "List zones with Email Routing",
        status: "open beta",
        owner: "Product: Email Service"
      },
      args: {},
      async handler(_args, { config }) {
        const zones = await listEmailRoutingZones(config);
        if (zones.length === 0) {
          logger.log("No zones found with Email Routing in this account.");
          return;
        }
        const results = zones.map((zone) => ({
          zone: zone.name,
          "zone id": zone.id,
          enabled: zone.enabled ? "yes" : "no"
        }));
        logger.table(results);
      }
    });
  }
});

// src/email-routing/rules/create.ts
var emailRoutingRulesCreateCommand;
var init_create7 = __esm({
  "src/email-routing/rules/create.ts"() {
    init_import_meta_url();
    init_dist();
    init_create_command();
    init_logger();
    init_client5();
    init_email_routing2();
    init_utils10();
    emailRoutingRulesCreateCommand = createCommand({
      metadata: {
        description: "Create an Email Routing rule",
        status: "open beta",
        owner: "Product: Email Service"
      },
      args: {
        ...domainArgs,
        name: {
          type: "string",
          description: "Rule name"
        },
        enabled: {
          type: "boolean",
          description: "Whether the rule is enabled",
          default: true
        },
        "match-type": {
          type: "string",
          demandOption: true,
          description: "Matcher type (e.g. literal)"
        },
        "match-field": {
          type: "string",
          demandOption: true,
          description: "Matcher field (e.g. to)"
        },
        "match-value": {
          type: "string",
          demandOption: true,
          description: "Matcher value (e.g. user@example.com)"
        },
        "action-type": {
          type: "string",
          demandOption: true,
          description: "Action type (forward, drop, or worker)",
          choices: ["forward", "drop", "worker"]
        },
        "action-value": {
          type: "string",
          array: true,
          description: "Action value(s) (e.g. destination email address). Required for forward/worker actions."
        },
        priority: {
          type: "number",
          description: "Rule priority"
        }
      },
      positionalArgs: ["domain"],
      validateArgs: /* @__PURE__ */ __name((args) => {
        if (args.actionType !== "drop" && (!args.actionValue || args.actionValue.length === 0)) {
          throw new UserError(
            "--action-value is required when --action-type is not 'drop'"
          );
        }
      }, "validateArgs"),
      async handler(args, { config }) {
        const zoneId = await resolveZoneId(config, args);
        const rule = await createEmailRoutingRule(config, zoneId, {
          actions: [{ type: args.actionType, value: args.actionValue }],
          matchers: [
            {
              type: args.matchType,
              field: args.matchField,
              value: args.matchValue
            }
          ],
          name: args.name,
          enabled: args.enabled,
          priority: args.priority
        });
        logger.log(`Created routing rule: ${rule.id}`);
        logger.log(`  Name:    ${rule.name || "(none)"}`);
        logger.log(`  Enabled: ${rule.enabled}`);
      }
    });
  }
});

// src/email-routing/rules/delete.ts
var emailRoutingRulesDeleteCommand;
var init_delete6 = __esm({
  "src/email-routing/rules/delete.ts"() {
    init_import_meta_url();
    init_create_command();
    init_dialogs();
    init_logger();
    init_client5();
    init_email_routing2();
    init_utils10();
    emailRoutingRulesDeleteCommand = createCommand({
      metadata: {
        description: "Delete an Email Routing rule",
        status: "open beta",
        owner: "Product: Email Service"
      },
      args: {
        ...domainArgs,
        "rule-id": {
          type: "string",
          demandOption: true,
          description: "The ID of the routing rule to delete"
        },
        force: {
          type: "boolean",
          alias: "y",
          description: "Skip confirmation",
          default: false
        }
      },
      positionalArgs: ["domain", "rule-id"],
      async handler(args, { config }) {
        const zoneId = await resolveZoneId(config, args);
        if (!args.force) {
          const confirmed = await confirm(
            `Are you sure you want to delete routing rule '${args.ruleId}'?`,
            { fallbackValue: false }
          );
          if (!confirmed) {
            logger.log("Not deleting.");
            return;
          }
        }
        await deleteEmailRoutingRule(config, zoneId, args.ruleId);
        logger.log(`Deleted routing rule: ${args.ruleId}`);
      }
    });
  }
});

// src/email-routing/rules/get.ts
var emailRoutingRulesGetCommand;
var init_get3 = __esm({
  "src/email-routing/rules/get.ts"() {
    init_import_meta_url();
    init_dist();
    init_create_command();
    init_logger();
    init_client5();
    init_email_routing2();
    init_utils10();
    emailRoutingRulesGetCommand = createCommand({
      metadata: {
        description: "Get a specific Email Routing rule (use 'catch-all' as the rule ID to get the catch-all rule)",
        status: "open beta",
        owner: "Product: Email Service"
      },
      args: {
        ...domainArgs,
        "rule-id": {
          type: "string",
          demandOption: true,
          description: "The ID of the routing rule, or 'catch-all' for the catch-all rule"
        }
      },
      positionalArgs: ["domain", "rule-id"],
      async handler(args, { config }) {
        const zoneId = await resolveZoneId(config, args);
        if (args.ruleId === "catch-all") {
          const rule2 = await getEmailRoutingCatchAll(config, zoneId);
          logger.log(`Catch-all rule:`);
          logger.log(`  Enabled: ${rule2.enabled}`);
          logger.log(`  Actions:`);
          for (const a7 of rule2.actions) {
            if (a7.value && a7.value.length > 0) {
              logger.log(`    - ${a7.type}: ${a7.value.join(", ")}`);
            } else {
              logger.log(`    - ${a7.type}`);
            }
          }
          return;
        }
        let rule;
        try {
          rule = await getEmailRoutingRule(config, zoneId, args.ruleId);
        } catch (e10) {
          if (!(e10 instanceof APIError && e10.code === 2020)) {
            throw e10;
          }
          const catchAllRule = await getEmailRoutingCatchAll(config, zoneId);
          if (catchAllRule.tag === args.ruleId || catchAllRule.id === args.ruleId) {
            logger.log(`Catch-all rule:`);
            logger.log(`  Enabled: ${catchAllRule.enabled}`);
            logger.log(`  Actions:`);
            for (const a7 of catchAllRule.actions) {
              if (a7.value && a7.value.length > 0) {
                logger.log(`    - ${a7.type}: ${a7.value.join(", ")}`);
              } else {
                logger.log(`    - ${a7.type}`);
              }
            }
            return;
          }
          throw e10;
        }
        logger.log(`Rule: ${rule.id}`);
        logger.log(`  Name:     ${rule.name || "(none)"}`);
        logger.log(`  Enabled:  ${rule.enabled}`);
        logger.log(`  Priority: ${rule.priority}`);
        logger.log(`  Matchers:`);
        for (const m7 of rule.matchers) {
          if (m7.field && m7.value) {
            logger.log(`    - ${m7.type} ${m7.field} = ${m7.value}`);
          } else {
            logger.log(`    - ${m7.type}`);
          }
        }
        logger.log(`  Actions:`);
        for (const a7 of rule.actions) {
          if (a7.value && a7.value.length > 0) {
            logger.log(`    - ${a7.type}: ${a7.value.join(", ")}`);
          } else {
            logger.log(`    - ${a7.type}`);
          }
        }
      }
    });
  }
});

// src/email-routing/rules/list.ts
var emailRoutingRulesListCommand;
var init_list9 = __esm({
  "src/email-routing/rules/list.ts"() {
    init_import_meta_url();
    init_create_command();
    init_logger();
    init_client5();
    init_email_routing2();
    init_utils10();
    emailRoutingRulesListCommand = createCommand({
      metadata: {
        description: "List Email Routing rules",
        status: "open beta",
        owner: "Product: Email Service"
      },
      args: {
        ...domainArgs
      },
      positionalArgs: ["domain"],
      async handler(args, { config }) {
        const zoneId = await resolveZoneId(config, args);
        const rules = await listEmailRoutingRules(config, zoneId);
        const catchAll = rules.find(
          (r10) => r10.matchers.some((m7) => m7.type === "all")
        );
        const regularRules = rules.filter(
          (r10) => !r10.matchers.some((m7) => m7.type === "all")
        );
        if (regularRules.length === 0 && !catchAll) {
          logger.log("No routing rules found.");
        } else if (regularRules.length === 0) {
          logger.log("No custom routing rules found.");
        } else {
          for (const r10 of regularRules) {
            const matchers = r10.matchers.map((m7) => m7.field && m7.value ? `${m7.field}:${m7.value}` : m7.type).join(", ");
            const actions = r10.actions.map((a7) => a7.value ? `${a7.type}:${a7.value.join(",")}` : a7.type).join(", ");
            logger.log(`Rule: ${r10.id}`);
            logger.log(`  Name:     ${r10.name || "(none)"}`);
            logger.log(`  Enabled:  ${r10.enabled}`);
            logger.log(`  Matchers: ${matchers}`);
            logger.log(`  Actions:  ${actions}`);
            logger.log(`  Priority: ${r10.priority}`);
            logger.log("");
          }
        }
        if (catchAll) {
          const actions = catchAll.actions.map((a7) => a7.value ? `${a7.type}:${a7.value.join(",")}` : a7.type).join(", ");
          logger.log("");
          logger.log(
            `Catch-all rule: ${catchAll.enabled ? "enabled" : "disabled"}, action: ${actions}`
          );
          logger.log(
            `  (use \`wrangler email routing rules get catch-all\` to view details)`
          );
        }
      }
    });
  }
});

// src/email-routing/rules/update.ts
var emailRoutingRulesUpdateCommand;
var init_update2 = __esm({
  "src/email-routing/rules/update.ts"() {
    init_import_meta_url();
    init_dist();
    init_create_command();
    init_logger();
    init_client5();
    init_email_routing2();
    init_utils10();
    emailRoutingRulesUpdateCommand = createCommand({
      metadata: {
        description: "Update an Email Routing rule (use 'catch-all' as the rule ID to update the catch-all rule)",
        status: "open beta",
        owner: "Product: Email Service"
      },
      args: {
        ...domainArgs,
        "rule-id": {
          type: "string",
          demandOption: true,
          description: "The ID of the routing rule to update, or 'catch-all' for the catch-all rule"
        },
        name: {
          type: "string",
          description: "Rule name"
        },
        enabled: {
          type: "boolean",
          description: "Whether the rule is enabled"
        },
        "match-type": {
          type: "string",
          description: "Matcher type (e.g. literal). Required for regular rules, ignored for catch-all."
        },
        "match-field": {
          type: "string",
          description: "Matcher field (e.g. to). Required for regular rules, ignored for catch-all."
        },
        "match-value": {
          type: "string",
          description: "Matcher value (e.g. user@example.com). Required for regular rules, ignored for catch-all."
        },
        "action-type": {
          type: "string",
          demandOption: true,
          description: "Action type (forward, drop, or worker)",
          choices: ["forward", "drop", "worker"]
        },
        "action-value": {
          type: "string",
          array: true,
          description: "Action value(s) (e.g. destination email address). Required for forward/worker actions."
        },
        priority: {
          type: "number",
          description: "Rule priority (ignored for catch-all)"
        }
      },
      positionalArgs: ["domain", "rule-id"],
      validateArgs: /* @__PURE__ */ __name((args) => {
        if (args.ruleId === "catch-all") {
          if (args.actionType !== "forward" && args.actionType !== "drop") {
            throw new UserError(
              "Catch-all rule only supports 'forward' or 'drop' action types"
            );
          }
          if (args.actionType === "forward" && (!args.actionValue || args.actionValue.length === 0)) {
            throw new UserError(
              "--action-value is required when --action-type is 'forward'"
            );
          }
        } else {
          if (!args.matchType) {
            throw new UserError(
              "--match-type is required when updating a regular rule"
            );
          }
          if (!args.matchField) {
            throw new UserError(
              "--match-field is required when updating a regular rule"
            );
          }
          if (!args.matchValue) {
            throw new UserError(
              "--match-value is required when updating a regular rule"
            );
          }
          if (args.actionType !== "drop" && (!args.actionValue || args.actionValue.length === 0)) {
            throw new UserError(
              "--action-value is required when --action-type is not 'drop'"
            );
          }
        }
      }, "validateArgs"),
      async handler(args, { config }) {
        const zoneId = await resolveZoneId(config, args);
        if (args.ruleId === "catch-all") {
          const rule2 = await updateEmailRoutingCatchAll(config, zoneId, {
            actions: [
              {
                type: args.actionType,
                value: args.actionValue
              }
            ],
            matchers: [{ type: "all" }],
            enabled: args.enabled,
            name: args.name
          });
          logger.log(`Updated catch-all rule:`);
          logger.log(`  Enabled: ${rule2.enabled}`);
          logger.log(`  Actions:`);
          for (const a7 of rule2.actions) {
            if (a7.value && a7.value.length > 0) {
              logger.log(`    - ${a7.type}: ${a7.value.join(", ")}`);
            } else {
              logger.log(`    - ${a7.type}`);
            }
          }
          return;
        }
        if (!args.matchType || !args.matchField || !args.matchValue) {
          throw new UserError(
            "--match-type, --match-field, and --match-value are required when updating a regular rule"
          );
        }
        const rule = await updateEmailRoutingRule(config, zoneId, args.ruleId, {
          actions: [{ type: args.actionType, value: args.actionValue }],
          matchers: [
            {
              type: args.matchType,
              field: args.matchField,
              value: args.matchValue
            }
          ],
          name: args.name,
          enabled: args.enabled,
          priority: args.priority
        });
        logger.log(`Updated routing rule: ${rule.id}`);
        logger.log(`  Name:    ${rule.name || "(none)"}`);
        logger.log(`  Enabled: ${rule.enabled}`);
      }
    });
  }
});

// src/email-routing/sending/disable.ts
var emailSendingDisableCommand;
var init_disable2 = __esm({
  "src/email-routing/sending/disable.ts"() {
    init_import_meta_url();
    init_create_command();
    init_dialogs();
    init_logger();
    init_client5();
    init_utils10();
    emailSendingDisableCommand = createCommand({
      metadata: {
        description: "Disable Email Sending for a zone or subdomain",
        status: "open beta",
        owner: "Product: Email Service"
      },
      args: {
        domain: {
          type: "string",
          demandOption: true,
          description: "Domain to disable sending for (e.g. example.com or notifications.example.com)"
        },
        "zone-id": {
          type: "string",
          description: "Zone ID (optional, skips zone lookup if provided)"
        },
        force: {
          type: "boolean",
          alias: "y",
          description: "Skip confirmation",
          default: false
        }
      },
      positionalArgs: ["domain"],
      async handler(args, { config }) {
        const { zoneId, isSubdomain, domain: domain2 } = await resolveDomain(
          config,
          args.domain,
          args.zoneId
        );
        if (!args.force) {
          const confirmed = await confirm(
            `Are you sure you want to disable Email Sending for ${domain2}?`,
            { fallbackValue: false }
          );
          if (!confirmed) {
            logger.log("Not disabling.");
            return;
          }
        }
        const name2 = isSubdomain ? domain2 : void 0;
        const settings = await disableEmailSending(config, zoneId, name2);
        logger.log(
          `Email Sending disabled for ${settings.name} (status: ${settings.status})`
        );
      }
    });
  }
});

// src/email-routing/sending/dns-get.ts
var emailSendingDnsGetCommand;
var init_dns_get2 = __esm({
  "src/email-routing/sending/dns-get.ts"() {
    init_import_meta_url();
    init_dist();
    init_create_command();
    init_logger();
    init_client5();
    init_utils10();
    emailSendingDnsGetCommand = createCommand({
      metadata: {
        description: "Get DNS records for an Email Sending domain",
        status: "open beta",
        owner: "Product: Email Service"
      },
      args: {
        domain: {
          type: "string",
          demandOption: true,
          description: "Domain to get DNS records for (e.g. example.com or notifications.example.com)"
        },
        "zone-id": {
          type: "string",
          description: "Zone ID (optional, skips zone lookup if provided)"
        }
      },
      positionalArgs: ["domain"],
      async handler(args, { config }) {
        const { zoneId, isSubdomain } = await resolveDomain(
          config,
          args.domain,
          args.zoneId
        );
        let records;
        if (!isSubdomain) {
          records = await getEmailSendingDns(config, zoneId);
        } else {
          const settings = await getEmailSendingSettings(config, zoneId);
          const match3 = settings.subdomains?.find((s7) => s7.name === args.domain);
          if (!match3) {
            throw new UserError(
              `No sending subdomain found for \`${args.domain}\`. Run \`wrangler email sending settings ${args.domain}\` to see configured domains.`
            );
          }
          records = await getEmailSendingSubdomainDns(config, zoneId, match3.tag);
        }
        if (records.length === 0) {
          logger.log("No DNS records found for this sending domain.");
          return;
        }
        for (const r10 of records) {
          logger.log(`${r10.type || "DNS"} record:`);
          logger.log(`  Name:     ${r10.name || ""}`);
          logger.log(`  Content:  ${r10.content || ""}`);
          if (r10.priority !== void 0) {
            logger.log(`  Priority: ${r10.priority}`);
          }
          if (r10.ttl !== void 0) {
            logger.log(`  TTL:      ${r10.ttl}`);
          }
          logger.log("");
        }
      }
    });
  }
});

// src/email-routing/sending/enable.ts
var emailSendingEnableCommand;
var init_enable2 = __esm({
  "src/email-routing/sending/enable.ts"() {
    init_import_meta_url();
    init_create_command();
    init_logger();
    init_client5();
    init_utils10();
    emailSendingEnableCommand = createCommand({
      metadata: {
        description: "Enable Email Sending for a zone or subdomain",
        status: "open beta",
        owner: "Product: Email Service"
      },
      args: {
        domain: {
          type: "string",
          demandOption: true,
          description: "Domain to enable sending for (e.g. example.com or notifications.example.com)"
        },
        "zone-id": {
          type: "string",
          description: "Zone ID (optional, skips zone lookup if provided)"
        }
      },
      positionalArgs: ["domain"],
      async handler(args, { config }) {
        const { zoneId, isSubdomain, domain: domain2 } = await resolveDomain(
          config,
          args.domain,
          args.zoneId
        );
        const name2 = isSubdomain ? domain2 : void 0;
        const settings = await enableEmailSending(config, zoneId, name2);
        logger.log(
          `Email Sending enabled for ${settings.name} (status: ${settings.status})`
        );
      }
    });
  }
});

// src/email-routing/sending/list.ts
var emailSendingListCommand;
var init_list10 = __esm({
  "src/email-routing/sending/list.ts"() {
    init_import_meta_url();
    init_create_command();
    init_logger();
    init_client5();
    emailSendingListCommand = createCommand({
      metadata: {
        description: "List zones with Email Sending",
        status: "open beta",
        owner: "Product: Email Service"
      },
      args: {},
      async handler(_args, { config }) {
        const zones = await listEmailSendingZones(config);
        if (zones.length === 0) {
          logger.log("No zones found with Email Sending in this account.");
          return;
        }
        const results = zones.map((zone) => ({
          zone: zone.name,
          "zone id": zone.id,
          enabled: zone.enabled ? "yes" : "no"
        }));
        logger.table(results);
      }
    });
  }
});

// src/email-routing/sending/utils.ts
function logSendResult(result) {
  if (result.delivered.length > 0) {
    logger.log(`Delivered to: ${result.delivered.join(", ")}`);
  }
  if (result.queued.length > 0) {
    logger.log(`Queued for: ${result.queued.join(", ")}`);
  }
  if (result.permanent_bounces.length > 0) {
    logger.warn(`Permanently bounced: ${result.permanent_bounces.join(", ")}`);
  }
  if (result.delivered.length === 0 && result.queued.length === 0 && result.permanent_bounces.length === 0) {
    logger.log("Email sent successfully.");
  }
}
var init_utils11 = __esm({
  "src/email-routing/sending/utils.ts"() {
    init_import_meta_url();
    init_logger();
    __name(logSendResult, "logSendResult");
  }
});
function parseHeaders2(headerArgs) {
  const headers = /* @__PURE__ */ new Map();
  if (!headerArgs) {
    return headers;
  }
  for (const h7 of headerArgs) {
    const colonIndex = h7.indexOf(":");
    if (colonIndex === -1) {
      throw new UserError(
        `Invalid header format: '${h7}'. Expected 'Key:Value'.`
      );
    }
    const key = h7.slice(0, colonIndex).trim();
    const value = h7.slice(colonIndex + 1).trim();
    if (!key) {
      throw new UserError(
        `Invalid header format: '${h7}'. Header name cannot be empty.`
      );
    }
    headers.set(key, value);
  }
  return headers;
}
function parseAttachments(attachmentPaths) {
  if (!attachmentPaths) {
    return [];
  }
  return attachmentPaths.map((filePath) => {
    let content;
    try {
      content = fs29.readFileSync(filePath);
    } catch (e10) {
      throw new UserError(
        `Failed to read attachment file '${filePath}': ${e10 instanceof Error ? e10.message : e10}`
      );
    }
    const filename = path3__namespace.default.basename(filePath);
    return {
      content: content.toString("base64"),
      filename,
      type: guessMimeType(filename),
      disposition: "attachment"
    };
  });
}
function guessMimeType(filename) {
  const ext2 = filename.split(".").pop()?.toLowerCase();
  const mimeTypes = {
    txt: "text/plain",
    html: "text/html",
    htm: "text/html",
    css: "text/css",
    csv: "text/csv",
    json: "application/json",
    xml: "application/xml",
    pdf: "application/pdf",
    zip: "application/zip",
    gz: "application/gzip",
    tar: "application/x-tar",
    png: "image/png",
    jpg: "image/jpeg",
    jpeg: "image/jpeg",
    gif: "image/gif",
    svg: "image/svg+xml",
    webp: "image/webp",
    ico: "image/x-icon",
    mp3: "audio/mpeg",
    mp4: "video/mp4",
    doc: "application/msword",
    docx: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
    xls: "application/vnd.ms-excel",
    xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
  };
  return mimeTypes[ext2 || ""] || "application/octet-stream";
}
var emailSendingSendCommand;
var init_send = __esm({
  "src/email-routing/sending/send.ts"() {
    init_import_meta_url();
    init_dist();
    init_create_command();
    init_client5();
    init_utils11();
    emailSendingSendCommand = createCommand({
      metadata: {
        description: "Send an email using the Email Sending builder",
        status: "open beta",
        owner: "Product: Email Service"
      },
      args: {
        from: {
          type: "string",
          demandOption: true,
          description: "Sender email address"
        },
        to: {
          type: "string",
          array: true,
          demandOption: true,
          description: "Recipient email address(es)"
        },
        subject: {
          type: "string",
          demandOption: true,
          description: "Email subject line"
        },
        text: {
          type: "string",
          description: "Plain text body of the email"
        },
        html: {
          type: "string",
          description: "HTML body of the email"
        },
        cc: {
          type: "string",
          array: true,
          description: "CC recipient email address(es)"
        },
        bcc: {
          type: "string",
          array: true,
          description: "BCC recipient email address(es)"
        },
        "reply-to": {
          type: "string",
          description: "Reply-to email address"
        },
        "from-name": {
          type: "string",
          description: "Display name for the sender (used with --from)"
        },
        "reply-to-name": {
          type: "string",
          description: "Display name for the reply-to address"
        },
        header: {
          type: "string",
          array: true,
          description: "Custom header in 'Key:Value' format. Can be specified multiple times."
        },
        attachment: {
          type: "string",
          array: true,
          description: "File path to attach. Can be specified multiple times."
        }
      },
      validateArgs: /* @__PURE__ */ __name((args) => {
        if (!args.text && !args.html) {
          throw new UserError("At least one of --text or --html must be provided");
        }
      }, "validateArgs"),
      async handler(args, { config }) {
        const from = args.fromName ? { address: args.from, name: args.fromName } : args.from;
        const replyTo = args.replyTo ? args.replyToName ? { address: args.replyTo, name: args.replyToName } : args.replyTo : void 0;
        const headers = parseHeaders2(args.header);
        const attachments = parseAttachments(args.attachment);
        const result = await sendEmail(config, {
          from,
          to: args.to.length === 1 ? args.to[0] : args.to,
          subject: args.subject,
          text: args.text,
          html: args.html,
          cc: args.cc,
          bcc: args.bcc,
          reply_to: replyTo,
          headers: headers.size > 0 ? Object.fromEntries(headers) : void 0,
          attachments: attachments.length > 0 ? attachments : void 0
        });
        logSendResult(result);
      }
    });
    __name(parseHeaders2, "parseHeaders");
    __name(parseAttachments, "parseAttachments");
    __name(guessMimeType, "guessMimeType");
  }
});
var emailSendingSendRawCommand;
var init_send_raw = __esm({
  "src/email-routing/sending/send-raw.ts"() {
    init_import_meta_url();
    init_dist();
    init_create_command();
    init_client5();
    init_utils11();
    emailSendingSendRawCommand = createCommand({
      metadata: {
        description: "Send a raw MIME email message",
        status: "open beta",
        owner: "Product: Email Service"
      },
      args: {
        from: {
          type: "string",
          demandOption: true,
          description: "Sender email address (SMTP envelope)"
        },
        to: {
          type: "string",
          array: true,
          demandOption: true,
          description: "Recipient email address(es) (SMTP envelope)"
        },
        mime: {
          type: "string",
          description: "Raw MIME message string. Provide either --mime or --mime-file, not both.",
          conflicts: ["mime-file"]
        },
        "mime-file": {
          type: "string",
          description: "Path to a file containing the raw MIME message. Provide either --mime or --mime-file, not both.",
          conflicts: ["mime"]
        }
      },
      validateArgs: /* @__PURE__ */ __name((args) => {
        if (!args.mime && !args.mimeFile) {
          throw new UserError(
            "You must provide either --mime (inline MIME message) or --mime-file (path to MIME file)"
          );
        }
      }, "validateArgs"),
      async handler(args, { config }) {
        let mimeMessage;
        if (args.mimeFile) {
          try {
            mimeMessage = fs29.readFileSync(args.mimeFile, "utf-8");
          } catch (e10) {
            throw new UserError(
              `Failed to read MIME file '${args.mimeFile}': ${e10 instanceof Error ? e10.message : e10}`
            );
          }
        } else {
          mimeMessage = args.mime ?? "";
        }
        const result = await sendRawEmail(config, {
          from: args.from,
          recipients: args.to,
          mime_message: mimeMessage
        });
        logSendResult(result);
      }
    });
  }
});

// src/email-routing/sending/settings.ts
var emailSendingSettingsCommand;
var init_settings17 = __esm({
  "src/email-routing/sending/settings.ts"() {
    init_import_meta_url();
    init_create_command();
    init_logger();
    init_client5();
    init_utils10();
    emailSendingSettingsCommand = createCommand({
      metadata: {
        description: "Get Email Sending settings for a zone",
        status: "open beta",
        owner: "Product: Email Service"
      },
      args: {
        domain: {
          type: "string",
          demandOption: true,
          description: "Domain to get sending settings for (e.g. example.com)"
        },
        "zone-id": {
          type: "string",
          description: "Zone ID (optional, skips zone lookup if provided)"
        }
      },
      positionalArgs: ["domain"],
      async handler(args, { config }) {
        const { zoneId } = await resolveDomain(config, args.domain, args.zoneId);
        const settings = await getEmailSendingSettings(config, zoneId);
        logger.log(`Email Sending for ${settings.name}:`);
        logger.log(`  Enabled:  ${settings.enabled}`);
        logger.log(`  Status:   ${settings.status}`);
        logger.log(`  Created:  ${settings.created}`);
        logger.log(`  Modified: ${settings.modified}`);
        const subdomains = settings.subdomains;
        if (Array.isArray(subdomains) && subdomains.length > 0) {
          logger.log(`  Subdomains:`);
          for (const s7 of subdomains) {
            logger.log(
              `    - ${s7.name} (enabled: ${s7.enabled}, status: ${s7.status ?? "unknown"})`
            );
          }
        }
      }
    });
  }
});

// src/email-routing/settings.ts
var emailRoutingSettingsCommand;
var init_settings18 = __esm({
  "src/email-routing/settings.ts"() {
    init_import_meta_url();
    init_create_command();
    init_logger();
    init_client5();
    init_utils10();
    init_email_routing2();
    emailRoutingSettingsCommand = createCommand({
      metadata: {
        description: "Get Email Routing settings for a zone",
        status: "open beta",
        owner: "Product: Email Service"
      },
      args: {
        ...domainArgs
      },
      positionalArgs: ["domain"],
      async handler(args, { config }) {
        const zoneId = await resolveZoneId(config, args);
        const settings = await getEmailRoutingSettings(config, zoneId);
        logger.log(`Email Routing for ${settings.name}:`);
        logger.log(`  Enabled:  ${settings.enabled}`);
        logger.log(`  Status:   ${settings.status}`);
        logger.log(`  Created:  ${settings.created}`);
        logger.log(`  Modified: ${settings.modified}`);
        logger.log(`  Tag:      ${settings.tag}`);
      }
    });
  }
});
async function usingLocalHelloWorldBinding(persistTo, config, closure) {
  const persist = getLocalPersistencePath(persistTo, config);
  const defaultPersistRoot = getDefaultPersistRoot(persist);
  const mf = new miniflare.Miniflare({
    script: 'addEventListener("fetch", (e) => e.respondWith(new Response(null, { status: 404 })))',
    defaultPersistRoot,
    helloWorld: {
      BINDING: {
        enable_timer: false
      }
    }
  });
  const binding = await mf.getHelloWorldBinding("BINDING");
  try {
    return await closure(binding);
  } finally {
    await mf.dispose();
  }
}
var helloWorldNamespace, helloWorldGetCommand, helloWorldSetCommand;
var init_hello_world = __esm({
  "src/hello-world/index.ts"() {
    init_import_meta_url();
    init_dist();
    init_create_command();
    init_get_local_persistence_path();
    init_miniflare();
    init_logger();
    helloWorldNamespace = createNamespace({
      metadata: {
        description: `\u{1F44B} Example local commands. DO NOT USE`,
        status: "experimental",
        owner: "Workers: Authoring and Testing",
        hidden: true
      }
    });
    __name(usingLocalHelloWorldBinding, "usingLocalHelloWorldBinding");
    helloWorldGetCommand = createCommand({
      metadata: {
        description: "Example local command - Get a value from the account",
        status: "experimental",
        owner: "Workers: Authoring and Testing",
        hidden: true
      },
      positionalArgs: [],
      args: {
        remote: {
          type: "boolean",
          description: "Execute command against remote service",
          default: false
        },
        "persist-to": {
          type: "string",
          describe: "Directory for local persistence"
        }
      },
      async handler(args, { config }) {
        logger.log(`\u{1F44B} Getting value...`);
        if (args.remote) {
          throw new UserError("Not implemented", {
            telemetryMessage: true
          });
        }
        const value = await usingLocalHelloWorldBinding(
          args.persistTo,
          config,
          async (helloWorld) => {
            const result = await helloWorld.get();
            return result.value;
          }
        );
        if (!value) {
          logger.log("Value not found");
        } else {
          logger.log(value);
        }
      }
    });
    helloWorldSetCommand = createCommand({
      metadata: {
        description: "Example local command - Set a value to the account",
        status: "experimental",
        owner: "Workers: Authoring and Testing",
        hidden: true
      },
      positionalArgs: ["value"],
      args: {
        value: {
          describe: "Value to set in the account",
          type: "string",
          demandOption: true,
          requiresArg: true
        },
        remote: {
          type: "boolean",
          description: "Execute command against remote service",
          default: false
        },
        "persist-to": {
          type: "string",
          describe: "Directory for local persistence"
        }
      },
      async handler(args, { config }) {
        logger.log(`\u{1F44B} Updating value...`);
        if (args.remote) {
          throw new UserError("Not implemented", {
            telemetryMessage: true
          });
        }
        await usingLocalHelloWorldBinding(
          args.persistTo,
          config,
          async (helloWorld) => {
            await helloWorld.set(args.value);
          }
        );
        logger.log("Updated");
      }
    });
  }
});

// src/hyperdrive/client.ts
async function createConfig(config, body) {
  const accountId = await requireAuth(config);
  return await fetchResult(
    config,
    `/accounts/${accountId}/hyperdrive/configs`,
    {
      method: "POST",
      body: JSON.stringify(body)
    }
  );
}
async function deleteConfig(config, id) {
  const accountId = await requireAuth(config);
  return await fetchResult(
    config,
    `/accounts/${accountId}/hyperdrive/configs/${id}`,
    {
      method: "DELETE"
    }
  );
}
async function getConfig(config, id) {
  const accountId = await requireAuth(config);
  return await fetchResult(
    config,
    `/accounts/${accountId}/hyperdrive/configs/${id}`,
    {
      method: "GET"
    }
  );
}
async function listConfigs(config) {
  const accountId = await requireAuth(config);
  return await fetchPagedListResult(
    config,
    `/accounts/${accountId}/hyperdrive/configs`,
    {
      method: "GET"
    }
  );
}
async function patchConfig(config, id, body) {
  const accountId = await requireAuth(config);
  return await fetchResult(
    config,
    `/accounts/${accountId}/hyperdrive/configs/${id}`,
    {
      method: "PATCH",
      body: JSON.stringify(body)
    }
  );
}
var PostgresSslmode, MySqlSslmode;
var init_client6 = __esm({
  "src/hyperdrive/client.ts"() {
    init_import_meta_url();
    init_cfetch();
    init_user3();
    PostgresSslmode = ["require", "verify-ca", "verify-full"];
    MySqlSslmode = ["REQUIRED", "VERIFY_CA", "VERIFY_IDENTITY"];
    __name(createConfig, "createConfig");
    __name(deleteConfig, "deleteConfig");
    __name(getConfig, "getConfig");
    __name(listConfigs, "listConfigs");
    __name(patchConfig, "patchConfig");
  }
});

// src/hyperdrive/shared.ts
function capitalizeScheme(scheme) {
  switch (scheme) {
    case "mysql":
      return "MySQL";
    case "postgres":
    case "postgresql":
      return "PostgreSQL";
    default:
      return "";
  }
}
function formatCachingOptions(cachingOptions) {
  switch (cachingOptions?.disabled) {
    case false: {
      if (cachingOptions.stale_while_revalidate === 0) {
        return `max_age: ${cachingOptions.max_age}, stale_while_revalidate: disabled`;
      } else {
        return `max_age: ${cachingOptions.max_age}, stale_while_revalidate: ${cachingOptions.stale_while_revalidate}`;
      }
    }
    case void 0: {
      return "enabled";
    }
    case true: {
      return "disabled";
    }
    default:
      return JSON.stringify(cachingOptions);
  }
}
var init_shared2 = __esm({
  "src/hyperdrive/shared.ts"() {
    init_import_meta_url();
    __name(capitalizeScheme, "capitalizeScheme");
    __name(formatCachingOptions, "formatCachingOptions");
  }
});

// src/hyperdrive/index.ts
function normalizeMysqlSslmode(sslmode) {
  const mysqlSslmode = MySqlSslmode.find(
    (mode) => mode.toLowerCase() === sslmode.toLowerCase()
  );
  return mysqlSslmode ?? sslmode;
}
function getOriginFromArgs(allowPartialOrigin, args) {
  if (args.connectionString) {
    const url4 = new URL(args.connectionString);
    url4.protocol = url4.protocol.toLowerCase();
    if (url4.port === "" && (url4.protocol == "postgresql:" || url4.protocol === "postgres:")) {
      url4.port = "5432";
    } else if (url4.port === "" && url4.protocol === "mysql:") {
      url4.port = "3306";
    }
    if (url4.protocol === "") {
      throw new UserError(
        "You must specify the database protocol - e.g. 'postgresql'/'mysql'."
      );
    } else if (!url4.protocol.startsWith("postgresql") && !url4.protocol.startsWith("postgres") && !url4.protocol.startsWith("mysql")) {
      throw new UserError(
        "Only PostgreSQL-compatible or MySQL-compatible databases are currently supported."
      );
    } else if (url4.host === "") {
      throw new UserError(
        "You must provide a hostname or IP address in your connection string - e.g. 'user:password@database-hostname.example.com:5432/databasename"
      );
    } else if (url4.port === "") {
      throw new UserError(
        "You must provide a port number - e.g. 'user:password@database.example.com:port/databasename"
      );
    } else if (!url4.pathname) {
      throw new UserError(
        "You must provide a database name as the path component - e.g. example.com:port/databasename"
      );
    } else if (url4.username === "") {
      throw new UserError(
        "You must provide a username - e.g. 'user:password@database.example.com:port/databasename'"
      );
    } else if (url4.password === "") {
      throw new UserError(
        "You must provide a password - e.g. 'user:password@database.example.com:port/databasename' "
      );
    }
    return {
      host: url4.hostname,
      port: parseInt(url4.port),
      scheme: url4.protocol.replace(":", ""),
      database: decodeURIComponent(url4.pathname.replace("/", "")),
      user: decodeURIComponent(url4.username),
      password: decodeURIComponent(url4.password)
    };
  }
  if (!allowPartialOrigin) {
    if (!args.originScheme) {
      throw new UserError(
        "You must specify the database protocol as --origin-scheme - e.g. 'postgresql'"
      );
    } else if (!args.database) {
      throw new UserError("You must provide a database name");
    } else if (!args.originUser) {
      throw new UserError(
        "You must provide a username for the origin database"
      );
    } else if (!args.originPassword) {
      throw new UserError(
        "You must provide a password for the origin database"
      );
    }
  }
  const databaseConfig = {
    scheme: args.originScheme,
    database: args.database,
    user: args.originUser,
    password: args.originPassword
  };
  let networkOrigin;
  if (args.serviceId) {
    networkOrigin = {
      service_id: args.serviceId
    };
  } else if (args.accessClientId || args.accessClientSecret) {
    if (!args.accessClientId || !args.accessClientSecret) {
      throw new UserError(
        "You must provide both an Access Client ID and Access Client Secret when configuring Hyperdrive-over-Access"
      );
    }
    if (!args.originHost || args.originHost === "") {
      throw new UserError(
        "You must provide an origin hostname for the database"
      );
    }
    networkOrigin = {
      access_client_id: args.accessClientId,
      access_client_secret: args.accessClientSecret,
      host: args.originHost
    };
  } else if (args.originHost || args.originPort) {
    if (!args.originHost) {
      throw new UserError(
        "You must provide an origin hostname for the database"
      );
    }
    if (!args.originPort) {
      throw new UserError(
        "You must provide a nonzero origin port for the database"
      );
    }
    networkOrigin = {
      host: args.originHost,
      port: args.originPort
    };
  }
  const origin = {
    ...databaseConfig,
    ...networkOrigin
  };
  if (JSON.stringify(origin) === "{}") {
    return void 0;
  } else {
    return origin;
  }
}
function getCacheOptionsFromArgs(args) {
  const caching = {
    disabled: args.cachingDisabled,
    max_age: args.maxAge,
    stale_while_revalidate: args.swr
  };
  if (JSON.stringify(caching) === "{}") {
    return void 0;
  } else {
    return caching;
  }
}
function getMtlsFromArgs(args) {
  const mtls = {
    ca_certificate_id: args.caCertificateId,
    mtls_certificate_id: args.mtlsCertificateId,
    sslmode: args.sslmode ? normalizeMysqlSslmode(args.sslmode) : void 0
  };
  if (JSON.stringify(mtls) === "{}") {
    return void 0;
  } else {
    if (mtls.sslmode && !PostgresSslmode.includes(mtls.sslmode) && !MySqlSslmode.includes(mtls.sslmode)) {
      throw new UserError(
        `Invalid sslmode '${mtls.sslmode}'. Valid options are:
- PostgreSQL: ${PostgresSslmode.join(", ")}
- MySQL: ${MySqlSslmode.join(", ")}`
      );
    }
    return mtls;
  }
}
function getOriginConnectionLimitFromArgs(args) {
  return args.originConnectionLimit;
}
var hyperdriveNamespace, upsertOptions;
var init_hyperdrive2 = __esm({
  "src/hyperdrive/index.ts"() {
    init_import_meta_url();
    init_dist();
    init_create_command();
    init_client6();
    hyperdriveNamespace = createNamespace({
      metadata: {
        description: "\u{1F680} Manage Hyperdrive databases",
        status: "stable",
        owner: "Product: Hyperdrive",
        category: "Storage & databases"
      }
    });
    __name(normalizeMysqlSslmode, "normalizeMysqlSslmode");
    upsertOptions = /* @__PURE__ */ __name((defaultOriginScheme = void 0) => ({
      "connection-string": {
        type: "string",
        description: "The connection string for the database you want Hyperdrive to connect to - ex: protocol://user:password@host:port/database",
        group: "Configure using a connection string"
      },
      "service-id": {
        type: "string",
        description: "The Workers VPC Service ID of the origin database",
        conflicts: [
          "origin-host",
          "origin-port",
          "connection-string",
          "access-client-id",
          "access-client-secret"
        ]
      },
      "origin-host": {
        alias: "host",
        type: "string",
        description: "The host of the origin database",
        conflicts: ["connection-string", "service-id"],
        group: "Configure using individual parameters [conflicts with --connection-string, --service-id]"
      },
      "origin-port": {
        alias: "port",
        type: "number",
        description: "The port number of the origin database",
        conflicts: [
          "connection-string",
          "service-id",
          "access-client-id",
          "access-client-secret"
        ],
        group: "Configure using individual parameters [conflicts with --connection-string, --service-id]"
      },
      "origin-scheme": {
        alias: "scheme",
        type: "string",
        choices: ["postgres", "postgresql", "mysql"],
        description: "The scheme used to connect to the origin database",
        group: "Configure using individual parameters [conflicts with --connection-string]",
        default: defaultOriginScheme
      },
      database: {
        type: "string",
        description: "The name of the database within the origin database",
        conflicts: "connection-string",
        group: "Configure using individual parameters [conflicts with --connection-string]"
      },
      "origin-user": {
        alias: "user",
        type: "string",
        description: "The username used to connect to the origin database",
        conflicts: "connection-string",
        group: "Configure using individual parameters [conflicts with --connection-string]"
      },
      "origin-password": {
        alias: "password",
        type: "string",
        description: "The password used to connect to the origin database",
        conflicts: "connection-string",
        group: "Configure using individual parameters [conflicts with --connection-string]"
      },
      "access-client-id": {
        type: "string",
        description: "The Client ID of the Access token to use when connecting to the origin database",
        conflicts: ["connection-string", "origin-port", "service-id"],
        implies: ["access-client-secret"],
        group: "Hyperdrive over Access [conflicts with --connection-string, --origin-port, --service-id]"
      },
      "access-client-secret": {
        type: "string",
        description: "The Client Secret of the Access token to use when connecting to the origin database",
        conflicts: ["connection-string", "origin-port", "service-id"],
        group: "Hyperdrive over Access [conflicts with --connection-string, --origin-port, --service-id]"
      },
      "caching-disabled": {
        type: "boolean",
        description: "Disables the caching of SQL responses",
        group: "Caching Options"
      },
      "max-age": {
        type: "number",
        description: "Specifies max duration for which items should persist in the cache, cannot be set when caching is disabled",
        group: "Caching Options"
      },
      swr: {
        type: "number",
        description: "Indicates the number of seconds cache may serve the response after it becomes stale, cannot be set when caching is disabled",
        group: "Caching Options"
      },
      "ca-certificate-id": {
        alias: "ca-certificate-uuid",
        type: "string",
        description: "Sets custom CA certificate when connecting to origin database. Must be valid UUID of already uploaded CA certificate."
      },
      "mtls-certificate-id": {
        alias: "mtls-certificate-uuid",
        type: "string",
        description: "Sets custom mTLS client certificates when connecting to origin database. Must be valid UUID of already uploaded public/private key certificates."
      },
      sslmode: {
        type: "string",
        coerce: normalizeMysqlSslmode,
        choices: [...PostgresSslmode, ...MySqlSslmode],
        description: `Sets sslmode for connecting to database. For PostgreSQL: '${PostgresSslmode.join(", ")}'. For MySQL: '${MySqlSslmode.join(", ")}'.`
      },
      "origin-connection-limit": {
        type: "number",
        description: "The (soft) maximum number of connections that Hyperdrive may establish to the origin database"
      }
    }), "upsertOptions");
    __name(getOriginFromArgs, "getOriginFromArgs");
    __name(getCacheOptionsFromArgs, "getCacheOptionsFromArgs");
    __name(getMtlsFromArgs, "getMtlsFromArgs");
    __name(getOriginConnectionLimitFromArgs, "getOriginConnectionLimitFromArgs");
  }
});

// src/hyperdrive/create.ts
var hyperdriveCreateCommand;
var init_create8 = __esm({
  "src/hyperdrive/create.ts"() {
    init_import_meta_url();
    init_create_command();
    init_logger();
    init_add_created_resource_config();
    init_getValidBindingName();
    init_client6();
    init_shared2();
    init_hyperdrive2();
    hyperdriveCreateCommand = createCommand({
      metadata: {
        description: "Create a Hyperdrive config",
        status: "stable",
        owner: "Product: Hyperdrive"
      },
      args: {
        name: {
          type: "string",
          demandOption: true,
          description: "The name of the Hyperdrive config"
        },
        ...upsertOptions("postgresql"),
        binding: {
          type: "string",
          description: "The binding name of this resource in your Worker"
        },
        "update-config": {
          type: "boolean",
          description: "Automatically update your config file with the newly added resource"
        }
      },
      positionalArgs: ["name"],
      async handler(args, { config }) {
        const origin = getOriginFromArgs(false, args);
        logger.log(`\u{1F6A7} Creating '${args.name}'`);
        const database = await createConfig(config, {
          name: args.name,
          origin,
          caching: getCacheOptionsFromArgs(args),
          mtls: getMtlsFromArgs(args),
          origin_connection_limit: getOriginConnectionLimitFromArgs(args)
        });
        logger.log(
          `\u2705 Created new Hyperdrive ${capitalizeScheme(database.origin.scheme)} config: ${database.id}`
        );
        await createdResourceConfig(
          "hyperdrive",
          (name2) => ({
            binding: getValidBindingName(name2 ?? "HYPERDRIVE", "HYPERDRIVE"),
            id: database.id
          }),
          config.configPath,
          args.env,
          {
            ...args,
            useRemote: false
            // Hyperdrive does not support remote bindings in local dev
          }
        );
      }
    });
  }
});

// src/hyperdrive/delete.ts
var hyperdriveDeleteCommand;
var init_delete7 = __esm({
  "src/hyperdrive/delete.ts"() {
    init_import_meta_url();
    init_create_command();
    init_logger();
    init_client6();
    hyperdriveDeleteCommand = createCommand({
      metadata: {
        description: "Delete a Hyperdrive config",
        status: "stable",
        owner: "Product: Hyperdrive"
      },
      args: {
        id: {
          type: "string",
          demandOption: true,
          description: "The ID of the Hyperdrive config"
        }
      },
      positionalArgs: ["id"],
      async handler({ id }, { config }) {
        logger.log(`\u{1F5D1}\uFE0F Deleting Hyperdrive database config ${id}`);
        await deleteConfig(config, id);
        logger.log(`\u2705 Deleted`);
      }
    });
  }
});

// src/hyperdrive/get.ts
var hyperdriveGetCommand;
var init_get4 = __esm({
  "src/hyperdrive/get.ts"() {
    init_import_meta_url();
    init_create_command();
    init_logger();
    init_client6();
    hyperdriveGetCommand = createCommand({
      metadata: {
        description: "Get a Hyperdrive config",
        status: "stable",
        owner: "Product: Hyperdrive"
      },
      args: {
        id: {
          type: "string",
          demandOption: true,
          description: "The ID of the Hyperdrive config"
        }
      },
      positionalArgs: ["id"],
      async handler({ id }, { config }) {
        const database = await getConfig(config, id);
        logger.log(JSON.stringify(database, null, 2));
      }
    });
  }
});

// src/hyperdrive/list.ts
var hyperdriveListCommand;
var init_list11 = __esm({
  "src/hyperdrive/list.ts"() {
    init_import_meta_url();
    init_create_command();
    init_logger();
    init_client6();
    init_shared2();
    hyperdriveListCommand = createCommand({
      metadata: {
        description: "List Hyperdrive configs",
        status: "stable",
        owner: "Product: Hyperdrive"
      },
      args: {},
      async handler(_5, { config }) {
        logger.log(`\u{1F4CB} Listing Hyperdrive configs`);
        const databases = await listConfigs(config);
        logger.table(
          databases.map((database) => ({
            id: database.id,
            name: database.name,
            user: database.origin.user ?? "",
            host: database.origin.host ?? "",
            port: database.origin.port?.toString() ?? "",
            scheme: capitalizeScheme(database.origin.scheme),
            database: database.origin.database ?? "",
            caching: formatCachingOptions(database.caching),
            mtls: JSON.stringify(database.mtls),
            origin_connection_limit: database.origin_connection_limit?.toString() ?? ""
          }))
        );
      }
    });
  }
});

// src/hyperdrive/update.ts
var hyperdriveUpdateCommand;
var init_update3 = __esm({
  "src/hyperdrive/update.ts"() {
    init_import_meta_url();
    init_create_command();
    init_logger();
    init_client6();
    init_hyperdrive2();
    hyperdriveUpdateCommand = createCommand({
      metadata: {
        description: "Update a Hyperdrive config",
        status: "stable",
        owner: "Product: Hyperdrive"
      },
      args: {
        id: {
          type: "string",
          demandOption: true,
          description: "The ID of the Hyperdrive config"
        },
        name: {
          type: "string",
          description: "Give your config a new name"
        },
        ...upsertOptions()
      },
      positionalArgs: ["id"],
      async handler(args, { config }) {
        const origin = getOriginFromArgs(true, args);
        logger.log(`\u{1F6A7} Updating '${args.id}'`);
        const updated = await patchConfig(config, args.id, {
          name: args.name,
          origin,
          caching: getCacheOptionsFromArgs(args),
          mtls: getMtlsFromArgs(args),
          origin_connection_limit: getOriginConnectionLimitFromArgs(args)
        });
        logger.log(
          `\u2705 Updated ${updated.id} Hyperdrive config
`,
          JSON.stringify(updated, null, 2)
        );
      }
    });
  }
});

// src/utils/create-batches.ts
function* createBatches(array, size) {
  for (let i7 = 0; i7 < array.length; i7 += size) {
    yield array.slice(i7, i7 + size);
  }
}
var init_create_batches = __esm({
  "src/utils/create-batches.ts"() {
    init_import_meta_url();
    __name(createBatches, "createBatches");
  }
});

// src/utils/download-worker-config.ts
async function fetchWorkerConfig(accountId, workerName, environment) {
  const [
    bindings,
    routes,
    customDomains,
    subdomainStatus,
    serviceEnvMetadata,
    cronTriggers
  ] = await Promise.all([
    fetchResult(
      COMPLIANCE_REGION_CONFIG_UNKNOWN,
      `/accounts/${accountId}/workers/services/${workerName}/environments/${environment}/bindings`
    ),
    fetchResult(
      COMPLIANCE_REGION_CONFIG_UNKNOWN,
      `/accounts/${accountId}/workers/services/${workerName}/environments/${environment}/routes?show_zonename=true`
    ),
    fetchResult(
      COMPLIANCE_REGION_CONFIG_UNKNOWN,
      `/accounts/${accountId}/workers/domains/records?page=0&per_page=5&service=${workerName}&environment=${environment}`
    ),
    fetchResult(
      COMPLIANCE_REGION_CONFIG_UNKNOWN,
      `/accounts/${accountId}/workers/services/${workerName}/environments/${environment}/subdomain`
    ),
    fetchResult(
      COMPLIANCE_REGION_CONFIG_UNKNOWN,
      `/accounts/${accountId}/workers/services/${workerName}/environments/${environment}`
    ),
    fetchResult(
      COMPLIANCE_REGION_CONFIG_UNKNOWN,
      `/accounts/${accountId}/workers/scripts/${workerName}/schedules`
    )
  ]).catch((e10) => {
    throw new Error(
      `Error Occurred: Unable to fetch bindings, routes, or services metadata from the dashboard. Please try again later.`,
      { cause: e10 }
    );
  });
  return {
    bindings,
    routes,
    customDomains,
    subdomainStatus,
    serviceEnvMetadata,
    cronTriggers
  };
}
async function downloadWorkerConfig(workerName, environment, entrypoint, accountId) {
  const {
    bindings,
    routes,
    customDomains,
    subdomainStatus,
    serviceEnvMetadata,
    cronTriggers
  } = await fetchWorkerConfig(accountId, workerName, environment);
  return constructWranglerConfig({
    name: workerName,
    entrypoint,
    compatibility_date: serviceEnvMetadata.script.compatibility_date,
    compatibility_flags: serviceEnvMetadata.script.compatibility_flags,
    tags: serviceEnvMetadata.script.tags,
    migration_tag: serviceEnvMetadata.script.migration_tag,
    tail_consumers: serviceEnvMetadata.script.tail_consumers,
    observability: serviceEnvMetadata.script.observability,
    limits: serviceEnvMetadata.script.limits,
    bindings,
    routes,
    domains: customDomains,
    subdomain: subdomainStatus,
    schedules: cronTriggers.schedules.map((s7) => ({
      cron: s7.cron
    })),
    placement: serviceEnvMetadata.script.placement_mode ? { mode: serviceEnvMetadata.script.placement_mode } : void 0,
    logpush: void 0
  });
}
var init_download_worker_config = __esm({
  "src/utils/download-worker-config.ts"() {
    init_import_meta_url();
    init_dist();
    init_cfetch();
    __name(fetchWorkerConfig, "fetchWorkerConfig");
    __name(downloadWorkerConfig, "downloadWorkerConfig");
  }
});

// ../../node_modules/.pnpm/shell-quote@1.8.1/node_modules/shell-quote/quote.js
var require_quote = __commonJS({
  "../../node_modules/.pnpm/shell-quote@1.8.1/node_modules/shell-quote/quote.js"(exports, module2) {
    init_import_meta_url();
    module2.exports = /* @__PURE__ */ __name(function quote2(xs) {
      return xs.map(function(s7) {
        if (s7 && typeof s7 === "object") {
          return s7.op.replace(/(.)/g, "\\$1");
        }
        if (/["\s]/.test(s7) && !/'/.test(s7)) {
          return "'" + s7.replace(/(['\\])/g, "\\$1") + "'";
        }
        if (/["'\s]/.test(s7)) {
          return '"' + s7.replace(/(["\\$`!])/g, "\\$1") + '"';
        }
        return String(s7).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}])/g, "$1\\$2");
      }).join(" ");
    }, "quote");
  }
});

// ../../node_modules/.pnpm/shell-quote@1.8.1/node_modules/shell-quote/parse.js
var require_parse4 = __commonJS({
  "../../node_modules/.pnpm/shell-quote@1.8.1/node_modules/shell-quote/parse.js"(exports, module2) {
    init_import_meta_url();
    var CONTROL = "(?:" + [
      "\\|\\|",
      "\\&\\&",
      ";;",
      "\\|\\&",
      "\\<\\(",
      "\\<\\<\\<",
      ">>",
      ">\\&",
      "<\\&",
      "[&;()|<>]"
    ].join("|") + ")";
    var controlRE = new RegExp("^" + CONTROL + "$");
    var META = "|&;()<> \\t";
    var SINGLE_QUOTE = '"((\\\\"|[^"])*?)"';
    var DOUBLE_QUOTE = "'((\\\\'|[^'])*?)'";
    var hash = /^#$/;
    var SQ = "'";
    var DQ = '"';
    var DS = "$";
    var TOKEN = "";
    var mult = 4294967296;
    for (i7 = 0; i7 < 4; i7++) {
      TOKEN += (mult * Math.random()).toString(16);
    }
    var i7;
    var startsWithToken = new RegExp("^" + TOKEN);
    function matchAll(s7, r10) {
      var origIndex = r10.lastIndex;
      var matches = [];
      var matchObj;
      while (matchObj = r10.exec(s7)) {
        matches.push(matchObj);
        if (r10.lastIndex === matchObj.index) {
          r10.lastIndex += 1;
        }
      }
      r10.lastIndex = origIndex;
      return matches;
    }
    __name(matchAll, "matchAll");
    function getVar(env6, pre, key) {
      var r10 = typeof env6 === "function" ? env6(key) : env6[key];
      if (typeof r10 === "undefined" && key != "") {
        r10 = "";
      } else if (typeof r10 === "undefined") {
        r10 = "$";
      }
      if (typeof r10 === "object") {
        return pre + TOKEN + JSON.stringify(r10) + TOKEN;
      }
      return pre + r10;
    }
    __name(getVar, "getVar");
    function parseInternal(string, env6, opts) {
      if (!opts) {
        opts = {};
      }
      var BS = opts.escape || "\\";
      var BAREWORD = "(\\" + BS + `['"` + META + `]|[^\\s'"` + META + "])+";
      var chunker = new RegExp([
        "(" + CONTROL + ")",
        // control chars
        "(" + BAREWORD + "|" + SINGLE_QUOTE + "|" + DOUBLE_QUOTE + ")+"
      ].join("|"), "g");
      var matches = matchAll(string, chunker);
      if (matches.length === 0) {
        return [];
      }
      if (!env6) {
        env6 = {};
      }
      var commented = false;
      return matches.map(function(match3) {
        var s7 = match3[0];
        if (!s7 || commented) {
          return void 0;
        }
        if (controlRE.test(s7)) {
          return { op: s7 };
        }
        var quote2 = false;
        var esc = false;
        var out = "";
        var isGlob = false;
        var i8;
        function parseEnvVar() {
          i8 += 1;
          var varend;
          var varname;
          var char = s7.charAt(i8);
          if (char === "{") {
            i8 += 1;
            if (s7.charAt(i8) === "}") {
              throw new Error("Bad substitution: " + s7.slice(i8 - 2, i8 + 1));
            }
            varend = s7.indexOf("}", i8);
            if (varend < 0) {
              throw new Error("Bad substitution: " + s7.slice(i8));
            }
            varname = s7.slice(i8, varend);
            i8 = varend;
          } else if (/[*@#?$!_-]/.test(char)) {
            varname = char;
            i8 += 1;
          } else {
            var slicedFromI = s7.slice(i8);
            varend = slicedFromI.match(/[^\w\d_]/);
            if (!varend) {
              varname = slicedFromI;
              i8 = s7.length;
            } else {
              varname = slicedFromI.slice(0, varend.index);
              i8 += varend.index - 1;
            }
          }
          return getVar(env6, "", varname);
        }
        __name(parseEnvVar, "parseEnvVar");
        for (i8 = 0; i8 < s7.length; i8++) {
          var c8 = s7.charAt(i8);
          isGlob = isGlob || !quote2 && (c8 === "*" || c8 === "?");
          if (esc) {
            out += c8;
            esc = false;
          } else if (quote2) {
            if (c8 === quote2) {
              quote2 = false;
            } else if (quote2 == SQ) {
              out += c8;
            } else {
              if (c8 === BS) {
                i8 += 1;
                c8 = s7.charAt(i8);
                if (c8 === DQ || c8 === BS || c8 === DS) {
                  out += c8;
                } else {
                  out += BS + c8;
                }
              } else if (c8 === DS) {
                out += parseEnvVar();
              } else {
                out += c8;
              }
            }
          } else if (c8 === DQ || c8 === SQ) {
            quote2 = c8;
          } else if (controlRE.test(c8)) {
            return { op: s7 };
          } else if (hash.test(c8)) {
            commented = true;
            var commentObj = { comment: string.slice(match3.index + i8 + 1) };
            if (out.length) {
              return [out, commentObj];
            }
            return [commentObj];
          } else if (c8 === BS) {
            esc = true;
          } else if (c8 === DS) {
            out += parseEnvVar();
          } else {
            out += c8;
          }
        }
        if (isGlob) {
          return { op: "glob", pattern: out };
        }
        return out;
      }).reduce(function(prev, arg) {
        return typeof arg === "undefined" ? prev : prev.concat(arg);
      }, []);
    }
    __name(parseInternal, "parseInternal");
    module2.exports = /* @__PURE__ */ __name(function parse17(s7, env6, opts) {
      var mapped = parseInternal(s7, env6, opts);
      if (typeof env6 !== "function") {
        return mapped;
      }
      return mapped.reduce(function(acc, s8) {
        if (typeof s8 === "object") {
          return acc.concat(s8);
        }
        var xs = s8.split(RegExp("(" + TOKEN + ".*?" + TOKEN + ")", "g"));
        if (xs.length === 1) {
          return acc.concat(xs[0]);
        }
        return acc.concat(xs.filter(Boolean).map(function(x7) {
          if (startsWithToken.test(x7)) {
            return JSON.parse(x7.split(TOKEN)[1]);
          }
          return x7;
        }));
      }, []);
    }, "parse");
  }
});

// ../../node_modules/.pnpm/shell-quote@1.8.1/node_modules/shell-quote/index.js
var require_shell_quote = __commonJS({
  "../../node_modules/.pnpm/shell-quote@1.8.1/node_modules/shell-quote/index.js"(exports) {
    init_import_meta_url();
    exports.quote = require_quote();
    exports.parse = require_parse4();
  }
});

// src/utils/shell-quote.ts
function parse14(cmd, env6) {
  if (process.platform === "win32") {
    cmd = cmd.replaceAll("\\", "\\\\");
  }
  const entries2 = import_shell_quote.default.parse(cmd, env6);
  const argv = [];
  for (const entry of entries2) {
    if (typeof entry === "string") {
      argv.push(entry);
      continue;
    }
    if ("comment" in entry) {
      continue;
    }
    if (entry.op === "glob") {
      argv.push(entry.pattern);
      continue;
    }
    throw new Error(
      `Only simple commands are supported, please don't use the "${entry.op}" operator in "${cmd}".`
    );
  }
  return argv;
}
var import_shell_quote, quote;
var init_shell_quote = __esm({
  "src/utils/shell-quote.ts"() {
    init_import_meta_url();
    import_shell_quote = __toESM(require_shell_quote());
    quote = /* @__PURE__ */ __name(function(args) {
      const stringArgs = args.map((arg) => String(arg));
      return import_shell_quote.default.quote(stringArgs);
    }, "quote");
    __name(parse14, "parse");
  }
});
function isNpm(packageManager) {
  return packageManager.type === "npm";
}
async function downloadWorker(accountId, workerName) {
  const serviceMetadata = await fetchResult(
    COMPLIANCE_REGION_CONFIG_UNKNOWN,
    `/accounts/${accountId}/workers/services/${workerName}`
  );
  const defaultEnvironment = serviceMetadata.default_environment.environment;
  const { entrypoint, modules } = await fetchWorkerDefinitionFromDash(
    COMPLIANCE_REGION_CONFIG_UNKNOWN,
    `/accounts/${accountId}/workers/services/${workerName}/environments/${defaultEnvironment}/content/v2`
  );
  const config = await downloadWorkerConfig(
    workerName,
    defaultEnvironment,
    entrypoint,
    accountId
  );
  if (config.assets) {
    throw new FatalError(
      "`wrangler init --from-dash` is not yet supported for Workers with Assets"
    );
  }
  return {
    modules,
    config
  };
}
var init3;
var init_init = __esm({
  "src/init.ts"() {
    init_import_meta_url();
    init_dist();
    init_execa();
    init_cfetch();
    init_internal();
    init_create_command();
    init_logger();
    init_metrics_config();
    init_package_manager();
    init_user3();
    init_create_batches();
    init_download_worker_config();
    init_shell_quote();
    init_worker_not_found_error();
    init3 = createCommand({
      metadata: {
        description: "\u{1F4E5} Initialize a basic Worker",
        owner: "Workers: Authoring and Testing",
        status: "stable",
        category: "Compute & AI"
      },
      args: {
        name: {
          describe: "The name of your worker",
          type: "string"
        },
        yes: {
          describe: 'Answer "yes" to any prompts for new projects',
          type: "boolean",
          alias: "y"
        },
        "from-dash": {
          describe: "The name of the Worker you wish to download from the Cloudflare dashboard for local development.",
          type: "string",
          requiresArg: true
        },
        "delegate-c3": {
          describe: "Delegate to Create Cloudflare CLI (C3)",
          type: "boolean",
          hidden: true,
          default: true,
          alias: "c3"
        }
      },
      behaviour: {
        provideConfig: false
      },
      positionalArgs: ["name"],
      async handler(args) {
        const yesFlag = args.yes ?? false;
        const packageManager = await getPackageManager();
        const name2 = args.fromDash ?? args.name;
        const c3CommandParts = parse14(getC3CommandFromEnv());
        const c3Arguments = [
          ...c3CommandParts,
          ...name2 ? [name2] : [],
          ...yesFlag && isNpm(packageManager) ? ["-y"] : [],
          // --yes arg for npx
          ...isNpm(packageManager) ? ["--"] : [],
          ...args.fromDash ? ["--existing-script", args.fromDash] : [],
          ...yesFlag ? ["--wrangler-defaults"] : []
        ];
        const replacementC3Command = `\`${packageManager.type} ${c3Arguments.join(
          " "
        )}\``;
        if (args.fromDash && !args.delegateC3) {
          const accountId = await requireAuth({});
          try {
            await fetchResult(
              // `wrangler init` is not run from within a Workers project, so there will be no config file to define the compliance region.
              COMPLIANCE_REGION_CONFIG_UNKNOWN,
              `/accounts/${accountId}/workers/services/${args.fromDash}`
            );
          } catch (err) {
            if (isWorkerNotFoundError(err)) {
              throw new UserError(
                "wrangler couldn't find a Worker with that name in your account.\nRun `wrangler whoami` to confirm you're logged into the correct account.",
                {
                  telemetryMessage: true
                }
              );
            }
            throw err;
          }
          const creationDir = path3__namespace.default.join(process.cwd(), args.fromDash);
          await fs9.mkdir(creationDir, { recursive: true });
          const { modules, config } = await downloadWorker(
            accountId,
            args.fromDash
          );
          await fs9.mkdir(path3__namespace.default.join(creationDir, "./src"), {
            recursive: true
          });
          config.main = `src/${config.main}`;
          config.name = args.fromDash;
          for (const files of createBatches(modules, 10)) {
            await Promise.all(
              files.map(async (file3) => {
                const filepath = path3__namespace.default.join(creationDir, `./src/${file3.name}`);
                const directory = path3.dirname(filepath);
                await fs9.mkdir(directory, { recursive: true });
                await fs9.writeFile(filepath, file3.stream());
              })
            );
          }
          await fs9.writeFile(
            path3__namespace.default.join(creationDir, "wrangler.jsonc"),
            JSON.stringify(config, null, 2)
          );
        } else {
          logger.log(`\u{1F300} Running ${replacementC3Command}...`);
          const metricsConfig = readMetricsConfig();
          try {
            const childProcess5 = execa(packageManager.type, c3Arguments, {
              // Note: we need to pipe stdout and stderr otherwise execa won't include
              //       those in the command's result/error, but we want it to so that we
              //       can include those in the error Sentry receives
              stdio: ["inherit", "pipe", "pipe"],
              ...metricsConfig.permission?.enabled === false && {
                env: { CREATE_CLOUDFLARE_TELEMETRY_DISABLED: "1" }
              }
            });
            childProcess5.stdout?.pipe(process.stdout);
            childProcess5.stderr?.pipe(process.stderr);
            await childProcess5;
          } catch (e10) {
            const execaError = e10;
            throw new Error(execaError.shortMessage, {
              // We include the execaError as the cause, in this way this
              // will be reflected in Sentry allowing us to better monitor
              // C3 errors
              cause: execaError
            });
          }
        }
      }
    });
    __name(isNpm, "isNpm");
    __name(downloadWorker, "downloadWorker");
  }
});
var kvNamespace, kvNamespaceNamespace, kvKeyNamespace, kvBulkNamespace, kvNamespaceCreateCommand, kvNamespaceListCommand, kvNamespaceDeleteCommand, kvNamespaceRenameCommand, putCommonArgs, kvKeyPutCommand, kvKeyListCommand, getCommonArgs, kvKeyGetCommand, deleteCommonArgs, kvKeyDeleteCommand, kvBulkGetCommand, kvBulkPutCommand, kvBulkDeleteCommand;
var init_kv2 = __esm({
  "src/kv/index.ts"() {
    init_import_meta_url();
    init_dist();
    init_source();
    init_cloudflare();
    init_esm2();
    init_config();
    init_core3();
    init_create_command();
    init_dialogs();
    init_logger();
    init_metrics();
    init_user3();
    init_add_created_resource_config();
    init_getValidBindingName();
    init_is_local();
    init_helpers5();
    kvNamespace = createNamespace({
      metadata: {
        description: "\u{1F5C2}\uFE0F Manage Workers KV Namespaces",
        status: "stable",
        owner: "Product: KV",
        category: "Storage & databases"
      }
    });
    kvNamespaceNamespace = createNamespace({
      metadata: {
        description: `Interact with your Workers KV Namespaces`,
        status: "stable",
        owner: "Product: KV"
      }
    });
    kvKeyNamespace = createNamespace({
      metadata: {
        description: `Individually manage Workers KV key-value pairs`,
        status: "stable",
        owner: "Product: KV"
      }
    });
    kvBulkNamespace = createNamespace({
      metadata: {
        description: `Interact with multiple Workers KV key-value pairs at once`,
        status: "stable",
        owner: "Product: KV"
      }
    });
    kvNamespaceCreateCommand = createCommand({
      metadata: {
        description: "Create a new namespace",
        status: "stable",
        owner: "Product: KV"
      },
      args: {
        namespace: {
          describe: "The name of the new namespace",
          type: "string",
          demandOption: true
        },
        preview: {
          type: "boolean",
          describe: "Interact with a preview namespace"
        },
        ...sharedResourceCreationArgs
      },
      positionalArgs: ["namespace"],
      async handler(args, { sdk }) {
        const config = readConfig(args);
        const environment = args.env ? `${args.env}-` : "";
        const preview = args.preview ? "_preview" : "";
        const title = `${environment}${args.namespace}${preview}`;
        const accountId = await requireAuth(config);
        printResourceLocation("remote");
        logger.log(`\u{1F300} Creating namespace with title "${title}"`);
        let namespaceId;
        try {
          const result = await sdk.kv.namespaces.create({
            account_id: accountId,
            title
          });
          namespaceId = result.id;
        } catch (e10) {
          if (e10 instanceof Cloudflare.APIError && e10.errors.some((err) => err.code === 10014)) {
            throw new UserError(esm_default3`
					A KV namespace with the title "${title}" already exists.

					You can list existing namespaces with their IDs by running:
					  wrangler kv namespace list

					Or choose a different namespace name.
				`);
          }
          throw e10;
        }
        sendMetricsEvent("create kv namespace", {
          sendMetrics: config.send_metrics
        });
        logger.log("\u2728 Success!");
        const previewString = args.preview ? "preview_" : "";
        await createdResourceConfig(
          "kv_namespaces",
          (name2) => ({
            binding: getValidBindingName(name2 ?? args.namespace, "KV"),
            [`${previewString}id`]: namespaceId
          }),
          config.configPath,
          args.env,
          { ...args, updateConfig: preview ? false : args.updateConfig }
        );
      }
    });
    kvNamespaceListCommand = createCommand({
      metadata: {
        description: "Output a list of all KV namespaces associated with your account id",
        status: "stable",
        owner: "Product: KV"
      },
      args: {},
      behaviour: { printBanner: false, printResourceLocation: false },
      async handler(_5, { config, sdk }) {
        const accountId = await requireAuth(config);
        const allNamespaces = [];
        for await (const namespace of sdk.kv.namespaces.list({
          account_id: accountId,
          per_page: 1e3,
          order: "title",
          direction: "asc"
        })) {
          allNamespaces.push(namespace);
        }
        logger.log(JSON.stringify(allNamespaces, null, "  "));
        sendMetricsEvent("list kv namespaces", {
          sendMetrics: config.send_metrics
        });
      }
    });
    kvNamespaceDeleteCommand = createCommand({
      metadata: {
        description: "Delete a given namespace.",
        status: "stable",
        owner: "Product: KV"
      },
      positionalArgs: ["namespace"],
      args: {
        namespace: {
          type: "string",
          describe: "The name of the namespace to delete"
        },
        binding: {
          type: "string",
          requiresArg: true,
          describe: "The binding name to the namespace to delete from"
        },
        "namespace-id": {
          type: "string",
          requiresArg: true,
          describe: "The id of the namespace to delete"
        },
        preview: {
          type: "boolean",
          describe: "Interact with a preview namespace"
        },
        "skip-confirmation": {
          type: "boolean",
          description: "Skip confirmation",
          alias: "y",
          default: false
        }
      },
      validateArgs(args) {
        const providedOptions = [
          args.namespace,
          args.binding,
          args.namespaceId
        ].filter(Boolean);
        if (providedOptions.length === 0) {
          throw new CommandLineArgsError(
            "Must specify one of: namespace name (as positional argument), --binding, or --namespace-id"
          );
        }
        if (providedOptions.length > 1) {
          throw new CommandLineArgsError(
            "Cannot specify multiple of: namespace name (as positional argument), --binding, or --namespace-id. Use only one."
          );
        }
      },
      async handler(args) {
        const config = readConfig(args);
        printResourceLocation("remote");
        const accountId = await requireAuth(config);
        let namespaceId;
        let displayName;
        try {
          ({ namespaceId, displayName } = await getKVNamespaceId(
            args,
            config,
            false
          ));
        } catch (e10) {
          throw new CommandLineArgsError(
            "Not able to delete namespace.\n" + (e10.message ?? e10)
          );
        }
        logger.log(
          `About to delete ${source_default.bold("remote")} KV namespace ${displayName}.
This action is irreversible and will permanently delete all data in the KV namespace.
`
        );
        if (!args.skipConfirmation) {
          const response = await confirm(`Ok to proceed?`);
          if (!response) {
            logger.log(`Not deleting.`);
            return;
          }
        }
        logger.log(`Deleting KV namespace ${displayName}.`);
        await deleteKVNamespace(config, accountId, namespaceId);
        logger.log(`Deleted KV namespace ${displayName}.`);
        sendMetricsEvent("delete kv namespace", {
          sendMetrics: config.send_metrics
        });
      }
    });
    kvNamespaceRenameCommand = createCommand({
      metadata: {
        description: "Rename a KV namespace",
        status: "stable",
        owner: "Product: KV"
      },
      positionalArgs: ["old-name"],
      args: {
        "old-name": {
          type: "string",
          describe: "The current name of the namespace to rename"
        },
        "namespace-id": {
          type: "string",
          describe: "The id of the namespace to rename"
        },
        "new-name": {
          type: "string",
          describe: "The new name for the namespace",
          demandOption: true
        }
      },
      validateArgs(args) {
        if (args.oldName && args.namespaceId) {
          throw new CommandLineArgsError(
            "Cannot specify both old-name and --namespace-id. Use either old-name (as first argument) or --namespace-id flag, not both."
          );
        }
        if (!args.namespaceId && !args.oldName) {
          throw new CommandLineArgsError(
            "Either old-name (as first argument) or --namespace-id must be specified"
          );
        }
        if (args.newName && args.newName.length > 512) {
          throw new CommandLineArgsError(
            `new-name must be 512 characters or less (current: ${args.newName.length})`
          );
        }
      },
      async handler(args) {
        const config = readConfig(args);
        printResourceLocation("remote");
        const accountId = await requireAuth(config);
        let namespaceId = args.namespaceId;
        if (!namespaceId && args.oldName) {
          const namespaces = await listKVNamespaces(config, accountId);
          const namespace = namespaces.find((ns) => ns.title === args.oldName);
          if (!namespace) {
            throw new UserError(
              `No namespace found with the name "${args.oldName}". Use --namespace-id instead or check available namespaces with "wrangler kv namespace list".`
            );
          }
          namespaceId = namespace.id;
        }
        assert53.strict(namespaceId, "namespaceId should be defined");
        logger.log(`Renaming KV namespace ${namespaceId} to "${args.newName}".`);
        const updatedNamespace = await updateKVNamespace(
          config,
          accountId,
          namespaceId,
          args.newName
        );
        logger.log(
          `\u2728 Successfully renamed namespace to "${updatedNamespace.title}"`
        );
      }
    });
    putCommonArgs = {
      binding: {
        type: "string",
        requiresArg: true,
        describe: "The binding name to the namespace to write to"
      },
      "namespace-id": {
        type: "string",
        requiresArg: true,
        describe: "The id of the namespace to write to"
      },
      preview: {
        type: "boolean",
        describe: "Interact with a preview namespace"
      },
      ttl: {
        type: "number",
        describe: "Time for which the entries should be visible"
      },
      expiration: {
        type: "number",
        describe: "Time since the UNIX epoch after which the entry expires"
      },
      metadata: {
        type: "string",
        describe: "Arbitrary JSON that is associated with a key",
        coerce: /* @__PURE__ */ __name((jsonStr) => {
          try {
            return JSON.parse(jsonStr);
          } catch {
          }
        }, "coerce")
      },
      local: {
        type: "boolean",
        describe: "Interact with local storage"
      },
      remote: {
        type: "boolean",
        describe: "Interact with remote storage",
        conflicts: "local"
      },
      "persist-to": {
        type: "string",
        describe: "Directory for local persistence"
      }
    };
    kvKeyPutCommand = createCommand({
      metadata: {
        description: "Write a single key/value pair to the given namespace",
        status: "stable",
        owner: "Product: KV"
      },
      behaviour: {
        printResourceLocation: true
      },
      positionalArgs: ["key", "value"],
      args: {
        key: {
          type: "string",
          describe: "The key to write to",
          demandOption: true
        },
        value: {
          type: "string",
          describe: "The value to write"
        },
        path: {
          type: "string",
          requiresArg: true,
          describe: "Read value from the file at a given path"
        },
        ...putCommonArgs
      },
      validateArgs(args) {
        demandOneOfOption("binding", "namespace-id")(args);
        demandOneOfOption("value", "path")(args);
      },
      async handler({ key, ttl, expiration, metadata, ...args }) {
        const localMode = isLocal(args);
        const config = readConfig(args);
        const { namespaceId, displayName } = await getKVNamespaceId(
          args,
          config,
          localMode
        );
        const value = args.path ? readFileSyncToBuffer(args.path) : (
          // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
          args.value
        );
        const metadataLog = metadata ? ` with metadata "${JSON.stringify(metadata)}"` : "";
        if (args.path) {
          logger.log(
            `Writing the contents of ${args.path} to the key "${key}" on namespace ${displayName}${metadataLog}.`
          );
        } else {
          logger.log(
            `Writing the value "${value}" to key "${key}" on namespace ${displayName}${metadataLog}.`
          );
        }
        let metricEvent;
        if (localMode) {
          await usingLocalNamespace(
            args.persistTo,
            config,
            namespaceId,
            (namespace) => namespace.put(key, new buffer.Blob([value]).stream(), {
              expiration,
              expirationTtl: ttl,
              metadata
            })
          );
          metricEvent = "write kv key-value (local)";
        } else {
          const accountId = await requireAuth(config);
          await putKVKeyValue(config, accountId, namespaceId, {
            key,
            value,
            expiration,
            expiration_ttl: ttl,
            metadata
          });
          metricEvent = "write kv key-value";
        }
        sendMetricsEvent(metricEvent, {
          sendMetrics: config.send_metrics
        });
      }
    });
    kvKeyListCommand = createCommand({
      metadata: {
        description: "Output a list of all keys in a given namespace",
        status: "stable",
        owner: "Product: KV"
      },
      behaviour: {
        // implicitly expects to output JSON only
        printResourceLocation: false,
        printBanner: false
      },
      args: {
        binding: {
          type: "string",
          requiresArg: true,
          describe: "The binding name to the namespace to list"
        },
        "namespace-id": {
          type: "string",
          requiresArg: true,
          describe: "The id of the namespace to list"
        },
        preview: {
          type: "boolean",
          // In the case of listing keys we will default to non-preview mode
          default: false,
          describe: "Interact with a preview namespace"
        },
        prefix: {
          type: "string",
          requiresArg: true,
          describe: "A prefix to filter listed keys"
        },
        local: {
          type: "boolean",
          describe: "Interact with local storage"
        },
        remote: {
          type: "boolean",
          describe: "Interact with remote storage",
          conflicts: "local"
        },
        "persist-to": {
          type: "string",
          describe: "Directory for local persistence"
        }
      },
      validateArgs(args) {
        demandOneOfOption("binding", "namespace-id")(args);
      },
      async handler({ prefix, ...args }) {
        const localMode = isLocal(args);
        const config = readConfig(args);
        const { namespaceId } = await getKVNamespaceId(args, config, localMode);
        let result;
        let metricEvent;
        if (localMode) {
          const listResult = await usingLocalNamespace(
            args.persistTo,
            config,
            namespaceId,
            (namespace) => namespace.list({ prefix })
          );
          result = listResult.keys;
          metricEvent = "list kv keys (local)";
        } else {
          const accountId = await requireAuth(config);
          result = await listKVNamespaceKeys(
            config,
            accountId,
            namespaceId,
            prefix
          );
          metricEvent = "list kv keys";
        }
        logger.log(JSON.stringify(result, void 0, 2));
        sendMetricsEvent(metricEvent, {
          sendMetrics: config.send_metrics
        });
      }
    });
    getCommonArgs = {
      binding: {
        type: "string",
        requiresArg: true,
        describe: "The binding name to the namespace to get from"
      },
      "namespace-id": {
        type: "string",
        requiresArg: true,
        describe: "The id of the namespace to get from"
      },
      preview: {
        type: "boolean",
        // In the case of getting key values we will default to non-preview mode
        default: false,
        describe: "Interact with a preview namespace"
      },
      local: {
        type: "boolean",
        describe: "Interact with local storage"
      },
      remote: {
        type: "boolean",
        describe: "Interact with remote storage",
        conflicts: "local"
      },
      "persist-to": {
        type: "string",
        describe: "Directory for local persistence"
      }
    };
    kvKeyGetCommand = createCommand({
      metadata: {
        description: "Read a single value by key from the given namespace",
        status: "stable",
        owner: "Product: KV"
      },
      behaviour: {
        printBanner: false,
        printResourceLocation: false
      },
      positionalArgs: ["key"],
      args: {
        key: {
          describe: "The key value to get.",
          type: "string",
          demandOption: true
        },
        text: {
          type: "boolean",
          default: false,
          describe: "Decode the returned value as a utf8 string"
        },
        ...getCommonArgs
      },
      validateArgs(args) {
        demandOneOfOption("binding", "namespace-id")(args);
      },
      async handler({ key, ...args }) {
        const localMode = isLocal(args);
        const config = readConfig(args);
        const { namespaceId } = await getKVNamespaceId(args, config, localMode);
        let bufferKVValue;
        let metricEvent;
        if (localMode) {
          const val2 = await usingLocalNamespace(
            args.persistTo,
            config,
            namespaceId,
            async (namespace) => {
              const stream2 = await namespace.get(key, "stream");
              return stream2 === null ? null : await consumers.arrayBuffer(stream2);
            }
          );
          if (val2 === null) {
            logger.log("Value not found");
            return;
          }
          bufferKVValue = Buffer.from(val2);
          metricEvent = "read kv value (local)";
        } else {
          const accountId = await requireAuth(config);
          bufferKVValue = Buffer.from(
            await getKVKeyValue(config, accountId, namespaceId, key)
          );
          metricEvent = "read kv value";
        }
        if (args.text) {
          const decoder = new string_decoder.StringDecoder("utf8");
          logger.log(decoder.write(bufferKVValue));
        } else {
          process.stdout.write(bufferKVValue);
        }
        sendMetricsEvent(metricEvent, {
          sendMetrics: config.send_metrics
        });
      }
    });
    deleteCommonArgs = {
      binding: {
        type: "string",
        requiresArg: true,
        describe: "The binding name to the namespace to delete from"
      },
      "namespace-id": {
        type: "string",
        requiresArg: true,
        describe: "The id of the namespace to delete from"
      },
      preview: {
        type: "boolean",
        describe: "Interact with a preview namespace"
      },
      local: {
        type: "boolean",
        describe: "Interact with local storage"
      },
      remote: {
        type: "boolean",
        describe: "Interact with remote storage",
        conflicts: "local"
      },
      "persist-to": {
        type: "string",
        describe: "Directory for local persistence"
      }
    };
    kvKeyDeleteCommand = createCommand({
      metadata: {
        description: "Remove a single key value pair from the given namespace",
        status: "stable",
        owner: "Product: KV"
      },
      behaviour: {
        printResourceLocation: true
      },
      positionalArgs: ["key"],
      args: {
        key: {
          describe: "The key value to delete.",
          type: "string",
          demandOption: true
        },
        ...deleteCommonArgs
      },
      async handler({ key, ...args }) {
        const localMode = isLocal(args);
        const config = readConfig(args);
        const { namespaceId, displayName } = await getKVNamespaceId(
          args,
          config,
          localMode
        );
        logger.log(`Deleting the key "${key}" on namespace ${displayName}.`);
        let metricEvent;
        if (localMode) {
          await usingLocalNamespace(
            args.persistTo,
            config,
            namespaceId,
            (namespace) => namespace.delete(key)
          );
          metricEvent = "delete kv key-value (local)";
        } else {
          const accountId = await requireAuth(config);
          await deleteKVKeyValue(config, accountId, namespaceId, key);
          metricEvent = "delete kv key-value";
        }
        sendMetricsEvent(metricEvent, {
          sendMetrics: config.send_metrics
        });
      }
    });
    kvBulkGetCommand = createCommand({
      metadata: {
        description: "Gets multiple key-value pairs from a namespace",
        status: "open beta",
        owner: "Product: KV"
      },
      behaviour: {
        printBanner: false,
        printResourceLocation: false
      },
      positionalArgs: ["filename"],
      args: {
        filename: {
          describe: "The file containing the keys to get",
          type: "string",
          demandOption: true
        },
        ...getCommonArgs
      },
      async handler({ filename, ...args }) {
        const localMode = isLocal(args);
        const config = readConfig(args);
        const { namespaceId } = await getKVNamespaceId(args, config, localMode);
        const content = parseJSON(readFileSync(filename), filename);
        if (!Array.isArray(content)) {
          throw new UserError(
            `Unexpected JSON input from "${filename}".
Expected an array of strings but got:
${content}`
          );
        }
        const errors = [];
        const keysToGet = [];
        for (const [index, item] of content.entries()) {
          const key = typeof item !== "string" ? item?.name : item;
          if (typeof key !== "string") {
            errors.push(
              `The item at index ${index} is type: "${typeof item}" - ${JSON.stringify(
                item
              )}`
            );
            continue;
          }
          keysToGet.push(key);
        }
        if (errors.length > 0) {
          throw new UserError(
            `Unexpected JSON input from "${filename}".
Expected an array of strings or objects with a "name" key.
` + errors.join("\n")
          );
        }
        if (localMode) {
          const result = await usingLocalNamespace(
            args.persistTo,
            config,
            namespaceId,
            async (namespace) => {
              const out = {};
              for (const key of keysToGet) {
                const value = await namespace.get(key, "text");
                out[key] = {
                  value
                };
              }
              return out;
            }
          );
          logger.log(JSON.stringify(result, null, 2));
        } else {
          const accountId = await requireAuth(config);
          logger.log(
            JSON.stringify(
              await getKVBulkKeyValue(config, accountId, namespaceId, keysToGet),
              null,
              2
            )
          );
        }
        logger.log("\nSuccess!");
      }
    });
    kvBulkPutCommand = createCommand({
      metadata: {
        description: "Upload multiple key-value pairs to a namespace",
        status: "stable",
        owner: "Product: KV"
      },
      behaviour: {
        printResourceLocation: true
      },
      positionalArgs: ["filename"],
      args: {
        filename: {
          describe: "The file containing the key/value pairs to write",
          type: "string",
          demandOption: true
        },
        ...putCommonArgs
      },
      async handler({ filename, ...args }) {
        const localMode = isLocal(args);
        const config = readConfig(args);
        const { namespaceId } = await getKVNamespaceId(args, config, localMode);
        const content = parseJSON(readFileSync(filename), filename);
        if (!Array.isArray(content)) {
          throw new UserError(
            `Unexpected JSON input from "${filename}".
Expected an array of key-value objects but got type "${typeof content}".`
          );
        }
        let maxNumberOfErrorsReached = false;
        const errors = [];
        let maxNumberOfWarningsReached = false;
        const warnings = [];
        for (let i7 = 0; i7 < content.length; i7++) {
          const keyValue = content[i7];
          if (!isKVKeyValue(keyValue) && !maxNumberOfErrorsReached) {
            if (errors.length === BATCH_MAX_ERRORS_WARNINGS) {
              maxNumberOfErrorsReached = true;
              errors.push("...");
            } else {
              errors.push(`The item at index ${i7} is ${JSON.stringify(keyValue)}`);
            }
          } else {
            const props = unexpectedKVKeyValueProps(keyValue);
            if (props.length > 0 && !maxNumberOfWarningsReached) {
              if (warnings.length === BATCH_MAX_ERRORS_WARNINGS) {
                maxNumberOfWarningsReached = true;
                warnings.push("...");
              } else {
                warnings.push(
                  `The item at index ${i7} contains unexpected properties: ${JSON.stringify(
                    props
                  )}.`
                );
              }
            }
          }
        }
        if (warnings.length > 0) {
          logger.warn(
            `Unexpected key-value properties in "${filename}".
` + warnings.join("\n")
          );
        }
        if (errors.length > 0) {
          throw new UserError(
            `Unexpected JSON input from "${filename}".
Each item in the array should be an object that matches:

interface KeyValue {
  key: string;
  value: string;
  expiration?: number;
  expiration_ttl?: number;
  metadata?: object;
  base64?: boolean;
}

` + errors.join("\n")
          );
        }
        let metricEvent;
        if (localMode) {
          await usingLocalNamespace(
            args.persistTo,
            config,
            namespaceId,
            async (namespace) => {
              for (const value of content) {
                let data = value.value;
                if (value.base64) {
                  data = Buffer.from(data, "base64").toString();
                }
                await namespace.put(value.key, data, {
                  expiration: value.expiration,
                  expirationTtl: value.expiration_ttl,
                  metadata: value.metadata
                });
              }
            }
          );
          metricEvent = "write kv key-values (bulk) (local)";
        } else {
          const accountId = await requireAuth(config);
          await putKVBulkKeyValue(config, accountId, namespaceId, content);
          metricEvent = "write kv key-values (bulk)";
        }
        sendMetricsEvent(metricEvent, {
          sendMetrics: config.send_metrics
        });
        logger.log("Success!");
      }
    });
    kvBulkDeleteCommand = createCommand({
      metadata: {
        description: "Delete multiple key-value pairs from a namespace",
        status: "stable",
        owner: "Product: KV"
      },
      behaviour: {
        printResourceLocation: true
      },
      positionalArgs: ["filename"],
      args: {
        filename: {
          describe: "The file containing the keys to delete",
          type: "string",
          demandOption: true
        },
        force: {
          type: "boolean",
          alias: "f",
          describe: "Do not ask for confirmation before deleting"
        },
        ...deleteCommonArgs
      },
      async handler({ filename, ...args }) {
        const localMode = isLocal(args);
        const config = readConfig(args);
        const { namespaceId, displayName } = await getKVNamespaceId(
          args,
          config,
          localMode
        );
        if (!args.force) {
          const result = await confirm(
            `Are you sure you want to delete all the keys read from "${filename}" from kv-namespace ${displayName}?`
          );
          if (!result) {
            logger.log(`Not deleting keys read from "${filename}".`);
            return;
          }
        }
        const content = parseJSON(readFileSync(filename), filename);
        if (!Array.isArray(content)) {
          throw new UserError(
            `Unexpected JSON input from "${filename}".
Expected an array of strings but got:
${content}`
          );
        }
        const errors = [];
        const keysToDelete = [];
        for (const [index, item] of content.entries()) {
          const key = typeof item !== "string" ? item?.name : item;
          if (typeof key !== "string") {
            errors.push(
              `The item at index ${index} is type: "${typeof item}" - ${JSON.stringify(
                item
              )}`
            );
          }
          keysToDelete.push(key);
        }
        if (errors.length > 0) {
          throw new UserError(
            `Unexpected JSON input from "${filename}".
Expected an array of strings or objects with a "name" key.
` + errors.join("\n")
          );
        }
        let metricEvent;
        if (localMode) {
          await usingLocalNamespace(
            args.persistTo,
            config,
            namespaceId,
            async (namespace) => {
              for (const key of keysToDelete) {
                await namespace.delete(key);
              }
            }
          );
          metricEvent = "delete kv key-values (bulk) (local)";
        } else {
          const accountId = await requireAuth(config);
          await deleteKVBulkKeyValue(config, accountId, namespaceId, keysToDelete);
          metricEvent = "delete kv key-values (bulk)";
        }
        sendMetricsEvent(metricEvent, {
          sendMetrics: config.send_metrics
        });
        logger.log("Success!");
      }
    });
  }
});

// src/metrics/commands.ts
var telemetryNamespace, metricsAlias, telemetryDisableCommand, telemetryEnableCommand, telemetryStatusCommand, logTelemetryStatus;
var init_commands4 = __esm({
  "src/metrics/commands.ts"() {
    init_import_meta_url();
    init_dist();
    init_source();
    init_create_command();
    init_logger();
    init_metrics_config();
    telemetryNamespace = createNamespace({
      metadata: {
        description: "\u{1F4C8} Configure whether Wrangler collects telemetry",
        owner: "Workers: Authoring and Testing",
        status: "stable",
        hidden: true
      }
    });
    metricsAlias = createAlias({
      aliasOf: "wrangler telemetry"
    });
    telemetryDisableCommand = createCommand({
      metadata: {
        description: "Disable Wrangler telemetry collection",
        owner: "Workers: Authoring and Testing",
        status: "stable"
      },
      behaviour: {
        sendMetrics: false
      },
      async handler() {
        updateMetricsPermission(false);
        logTelemetryStatus(false);
        logger.log(
          "Wrangler is no longer collecting telemetry about your usage.\n"
        );
      }
    });
    telemetryEnableCommand = createCommand({
      metadata: {
        description: "Enable Wrangler telemetry collection",
        owner: "Workers: Authoring and Testing",
        status: "stable"
      },
      async handler() {
        updateMetricsPermission(true);
        logTelemetryStatus(true);
        logger.log(
          "Wrangler is now collecting telemetry about your usage. Thank you for helping make Wrangler better \u{1F9E1}\n"
        );
      }
    });
    telemetryStatusCommand = createCommand({
      metadata: {
        description: "Check whether Wrangler telemetry collection is enabled",
        owner: "Workers: Authoring and Testing",
        status: "stable"
      },
      async handler(_5, { config }) {
        const savedConfig = readMetricsConfig();
        const sendMetricsEnv = getWranglerSendMetricsFromEnv();
        if (config.send_metrics !== void 0 || sendMetricsEnv !== void 0) {
          const resolvedPermission = sendMetricsEnv ?? config.send_metrics;
          logger.log(
            `Status: ${resolvedPermission ? source_default.green("Enabled") : source_default.red("Disabled")} (set by ${sendMetricsEnv !== void 0 ? "environment variable" : "wrangler.toml"})
`
          );
        } else {
          logTelemetryStatus(savedConfig.permission?.enabled ?? true);
        }
        logger.log(
          "To configure telemetry globally on this machine, you can run `wrangler telemetry disable / enable`.\nYou can override this for individual projects with the environment variable `WRANGLER_SEND_METRICS=true/false`.\nLearn more at https://github.com/cloudflare/workers-sdk/tree/main/packages/wrangler/telemetry.md\n"
        );
      }
    });
    logTelemetryStatus = /* @__PURE__ */ __name((enabled) => {
      logger.log(
        `Status: ${enabled ? source_default.green("Enabled") : source_default.red("Disabled")}
`
      );
    }, "logTelemetryStatus");
  }
});

// src/mtls-certificate/cli.ts
var mTlsCertificateUploadCommand, mTlsCertificateListCommand, mTlsCertificateDeleteCommand, mTlsCertificateNamespace;
var init_cli3 = __esm({
  "src/mtls-certificate/cli.ts"() {
    init_import_meta_url();
    init_mtls_certificate();
    init_create_command();
    init_dialogs();
    init_logger();
    init_user3();
    mTlsCertificateUploadCommand = createCommand({
      metadata: {
        description: "Upload an mTLS certificate",
        owner: "Product: SSL",
        status: "stable"
      },
      args: {
        cert: {
          describe: "The path to a certificate file (.pem) containing a chain of certificates to upload",
          type: "string",
          demandOption: true
        },
        key: {
          describe: "The path to a file containing the private key for your leaf certificate",
          type: "string",
          demandOption: true
        },
        name: {
          describe: "The name for the certificate",
          type: "string"
        }
      },
      async handler({ cert, key, name: name2 }, { config }) {
        const accountId = await requireAuth(config);
        logger.log(
          name2 ? `Uploading mTLS Certificate ${name2}...` : `Uploading mTLS Certificate...`
        );
        const certResponse = await uploadMTlsCertificateFromFs(config, accountId, {
          certificateChainFilename: cert,
          privateKeyFilename: key,
          name: name2
        });
        const expiresOn = new Date(certResponse.expires_on).toLocaleDateString();
        logger.log(
          name2 ? `Success! Uploaded mTLS Certificate ${name2}` : `Success! Uploaded mTLS Certificate`
        );
        logger.log(`ID: ${certResponse.id}`);
        logger.log(`Issuer: ${certResponse.issuer}`);
        logger.log(`Expires on ${expiresOn}`);
      }
    });
    mTlsCertificateListCommand = createCommand({
      metadata: {
        description: "List uploaded mTLS certificates",
        owner: "Product: SSL",
        status: "stable"
      },
      async handler(_5, { config }) {
        const accountId = await requireAuth(config);
        const certificates = await listMTlsCertificates(config, accountId, {});
        for (const certificate of certificates) {
          logger.log(`ID: ${certificate.id}`);
          if (certificate.name) {
            logger.log(`Name: ${certificate.name}`);
          }
          logger.log(`Issuer: ${certificate.issuer}`);
          logger.log(
            `Created on: ${new Date(certificate.uploaded_on).toLocaleDateString()}`
          );
          logger.log(
            `Expires on: ${new Date(certificate.expires_on).toLocaleDateString()}`
          );
          logger.log("\n");
        }
      }
    });
    mTlsCertificateDeleteCommand = createCommand({
      metadata: {
        description: "Delete an mTLS certificate",
        owner: "Product: SSL",
        status: "stable"
      },
      args: {
        id: {
          describe: "The id of the mTLS certificate to delete",
          type: "string"
        },
        name: {
          describe: "The name of the mTLS certificate record to delete",
          type: "string"
        }
      },
      async handler({ id, name: name2 }, { config }) {
        const accountId = await requireAuth(config);
        if (id && name2) {
          return logger.error(`Error: can't provide both --id and --name.`);
        } else if (!id && !name2) {
          return logger.error(`Error: must provide --id or --name.`);
        }
        let certificate;
        if (id) {
          certificate = await getMTlsCertificate(config, accountId, id);
        } else {
          certificate = await getMTlsCertificateByName(
            config,
            accountId,
            name2
          );
        }
        const response = await confirm(
          certificate.name ? `Are you sure you want to delete certificate ${certificate.id} (${certificate.name})?` : `Are you sure you want to delete certificate ${certificate.id}?`
        );
        if (!response) {
          logger.log("Not deleting");
          return;
        }
        await deleteMTlsCertificate(config, accountId, certificate.id);
        logger.log(
          certificate.name ? `Deleted certificate ${certificate.id} (${certificate.name}) successfully` : `Deleted certificate ${certificate.id} successfully`
        );
      }
    });
    mTlsCertificateNamespace = createNamespace({
      metadata: {
        description: "\u{1FAAA} Manage certificates used for mTLS connections",
        owner: "Product: SSL",
        status: "stable",
        category: "Networking & security"
      }
    });
  }
});
function isUrl(maybeUrl) {
  if (!maybeUrl) {
    return false;
  }
  try {
    new URL(maybeUrl);
    return true;
  } catch {
    return false;
  }
}
function getPagesProjectRoot() {
  const cwd2 = process.cwd();
  if (projectRootCache !== void 0 && projectRootCacheCwd === cwd2) {
    return projectRootCache;
  }
  const packagePath = file2("package.json");
  projectRootCache = packagePath ? path3__namespace.default.dirname(packagePath) : process.cwd();
  projectRootCacheCwd = cwd2;
  return projectRootCache;
}
function getPagesTmpDir() {
  const projectRoot = getPagesProjectRoot();
  if (tmpDirCache !== void 0 && tmpDirCacheProjectRoot === projectRoot) {
    return tmpDirCache;
  }
  const tmpDir = getWranglerTmpDir(getPagesProjectRoot(), "pages");
  tmpDirCache = tmpDir.path;
  tmpDirCacheProjectRoot = projectRoot;
  return tmpDirCache;
}
function truncateUtf8Bytes(str, maxBytes) {
  const bytes = Buffer.byteLength(str, "utf8");
  if (bytes <= maxBytes) {
    return str;
  }
  const chars = [];
  let byteCount = 0;
  for (const char of str) {
    const charBytes = Buffer.byteLength(char, "utf8");
    if (byteCount + charBytes > maxBytes) {
      break;
    }
    chars.push(char);
    byteCount += charBytes;
  }
  return chars.join("");
}
var RUNNING_BUILDERS, CLEANUP_CALLBACKS, CLEANUP, projectRootCacheCwd, projectRootCache, tmpDirCacheProjectRoot, tmpDirCache;
var init_utils12 = __esm({
  "src/pages/utils.ts"() {
    init_import_meta_url();
    init_find();
    init_paths();
    RUNNING_BUILDERS = [];
    CLEANUP_CALLBACKS = [];
    CLEANUP = /* @__PURE__ */ __name(() => {
      CLEANUP_CALLBACKS.forEach((callback) => callback());
      RUNNING_BUILDERS.forEach((builder) => builder.stop?.());
    }, "CLEANUP");
    __name(isUrl, "isUrl");
    __name(getPagesProjectRoot, "getPagesProjectRoot");
    __name(getPagesTmpDir, "getPagesTmpDir");
    __name(truncateUtf8Bytes, "truncateUtf8Bytes");
  }
});

// src/pages/index.ts
var pagesNamespace, pagesFunctionsNamespace, pagesProjectNamespace, pagesDeploymentNamespace, pagesDownloadNamespace;
var init_pages4 = __esm({
  "src/pages/index.ts"() {
    init_import_meta_url();
    init_create_command();
    init_utils12();
    pagesNamespace = createNamespace({
      metadata: {
        description: "\u26A1\uFE0F Configure Cloudflare Pages",
        status: "stable",
        owner: "Workers: Authoring and Testing",
        hideGlobalFlags: ["config", "env"],
        category: "Compute & AI"
      }
    });
    pagesFunctionsNamespace = createNamespace({
      metadata: {
        description: "Helpers related to Pages Functions",
        status: "stable",
        owner: "Workers: Authoring and Testing",
        hideGlobalFlags: ["config", "env"]
      }
    });
    pagesProjectNamespace = createNamespace({
      metadata: {
        description: "Interact with your Pages projects",
        status: "stable",
        owner: "Workers: Authoring and Testing",
        hideGlobalFlags: ["config", "env"]
      }
    });
    pagesDeploymentNamespace = createNamespace({
      metadata: {
        description: "Interact with the deployments of a project",
        status: "stable",
        owner: "Workers: Authoring and Testing",
        hideGlobalFlags: ["config", "env"]
      }
    });
    pagesDownloadNamespace = createNamespace({
      metadata: {
        description: "Download settings from your project",
        status: "stable",
        owner: "Workers: Authoring and Testing",
        hideGlobalFlags: ["config", "env"]
      }
    });
    process.on("SIGINT", () => {
      CLEANUP();
      process.exit();
    });
    process.on("SIGTERM", () => {
      CLEANUP();
      process.exit();
    });
  }
});

// src/utils/placement.ts
function parseConfigPlacement(config) {
  if (config.placement) {
    const configPlacement = config.placement;
    const hint = "hint" in configPlacement ? configPlacement.hint : void 0;
    if (!hint && configPlacement.mode === "off") {
      return void 0;
    } else if (hint || configPlacement.mode === "smart") {
      return { mode: "smart", hint };
    } else {
      if ("region" in configPlacement && configPlacement.region) {
        return { mode: "targeted", region: configPlacement.region };
      } else if ("host" in configPlacement && configPlacement.host) {
        return { mode: "targeted", host: configPlacement.host };
      } else if ("hostname" in configPlacement && configPlacement.hostname) {
        return { mode: "targeted", hostname: configPlacement.hostname };
      } else {
        return void 0;
      }
    }
  } else {
    return void 0;
  }
}
var init_placement = __esm({
  "src/utils/placement.ts"() {
    init_import_meta_url();
    __name(parseConfigPlacement, "parseConfigPlacement");
  }
});
async function createUploadWorkerBundleContents(workerBundle, config) {
  const workerBundleFormData = createWorkerBundleFormData(workerBundle, config);
  const metadata = JSON.parse(workerBundleFormData.get("metadata"));
  if (config === void 0) {
    delete metadata.bindings;
  }
  workerBundleFormData.set("metadata", JSON.stringify(metadata));
  return await new import_undici16.Response(workerBundleFormData).blob();
}
function createWorkerBundleFormData(workerBundle, config) {
  const mainModule = {
    name: path3__namespace.default.basename(workerBundle.resolvedEntryPointPath),
    filePath: workerBundle.resolvedEntryPointPath,
    content: fs29.readFileSync(workerBundle.resolvedEntryPointPath, {
      encoding: "utf-8"
    }),
    type: workerBundle.bundleType || "esm"
  };
  let placement;
  if (config !== void 0) {
    placement = parseConfigPlacement(config);
  } else {
    placement = void 0;
  }
  return createWorkerUploadForm(
    {
      name: mainModule.name,
      main: mainModule,
      modules: workerBundle.modules,
      migrations: void 0,
      compatibility_date: config?.compatibility_date,
      compatibility_flags: config?.compatibility_flags,
      keepVars: void 0,
      keepSecrets: void 0,
      keepBindings: void 0,
      logpush: void 0,
      sourceMaps: config?.upload_source_maps ? loadSourceMaps(mainModule, workerBundle.modules, workerBundle) : void 0,
      placement,
      tail_consumers: void 0,
      limits: config?.limits,
      assets: void 0,
      containers: void 0,
      // containers are not supported in Pages
      observability: void 0,
      cache: void 0
      // cache is not supported in Pages
    },
    getBindings(config, { pages: true })
  );
}
var import_undici16;
var init_create_worker_bundle_contents = __esm({
  "src/api/pages/create-worker-bundle-contents.ts"() {
    init_import_meta_url();
    import_undici16 = __toESM(require_undici());
    init_bindings2();
    init_create_worker_upload_form();
    init_source_maps();
    init_placement();
    __name(createUploadWorkerBundleContents, "createUploadWorkerBundleContents");
    __name(createWorkerBundleFormData, "createWorkerBundleFormData");
  }
});
function validateNodeCompatMode(compatibilityDateStr = "2000-01-01", compatibilityFlags, {
  noBundle = void 0
}) {
  const {
    mode,
    hasNodejsCompatFlag,
    hasNodejsCompatV2Flag,
    hasExperimentalNodejsCompatV2Flag
  } = miniflare.getNodeCompat(compatibilityDateStr, compatibilityFlags);
  if (hasExperimentalNodejsCompatV2Flag) {
    throw new UserError(
      "The `experimental:` prefix on `nodejs_compat_v2` is no longer valid. Please remove it and try again."
    );
  }
  if (hasNodejsCompatFlag && hasNodejsCompatV2Flag) {
    throw new UserError(
      "The `nodejs_compat` and `nodejs_compat_v2` compatibility flags cannot be used in together. Please select just one."
    );
  }
  if (noBundle && hasNodejsCompatV2Flag) {
    logger.warn(
      "`nodejs_compat_v2` compatibility flag and `--no-bundle` can't be used together. If you want to polyfill Node.js built-ins and disable Wrangler's bundling, please polyfill as part of your own bundling process."
    );
  }
  return mode;
}
var init_node_compat = __esm({
  "src/deployment-bundle/node-compat.ts"() {
    init_import_meta_url();
    init_dist();
    init_logger();
    __name(validateNodeCompatMode, "validateNodeCompatMode");
  }
});

// src/navigator-user-agent.ts
function isNavigatorDefined(compatibility_date, compatibility_flags = []) {
  if (compatibility_flags.includes("global_navigator") && compatibility_flags.includes("no_global_navigator")) {
    throw new UserError("Can't both enable and disable a flag");
  }
  if (compatibility_flags.includes("global_navigator")) {
    return true;
  }
  if (compatibility_flags.includes("no_global_navigator")) {
    return false;
  }
  return !!compatibility_date && compatibility_date >= "2022-03-21";
}
var init_navigator_user_agent = __esm({
  "src/navigator-user-agent.ts"() {
    init_import_meta_url();
    init_dist();
    __name(isNavigatorDefined, "isNavigatorDefined");
  }
});
function buildWorkerFromFunctions({
  routesModule,
  outfile = path3.join(getPagesTmpDir(), `./functionsWorker-${Math.random()}.js`),
  outdir,
  minify = false,
  keepNames = true,
  sourcemap = false,
  fallbackService = "ASSETS",
  watch: watch2 = false,
  onEnd = /* @__PURE__ */ __name(() => {
  }, "onEnd"),
  buildOutputDirectory,
  nodejsCompatMode,
  functionsDirectory,
  local,
  defineNavigatorUserAgent,
  checkFetch,
  external,
  metafile
}) {
  const entry = {
    file: path3.resolve(getBasePath(), "templates/pages-template-worker.ts"),
    projectRoot: functionsDirectory,
    configPath: void 0,
    format: "modules",
    moduleRoot: functionsDirectory,
    exports: []
  };
  const moduleCollector = createModuleCollector({
    entry,
    findAdditionalModules: false
  });
  return bundleWorker(entry, outdir ? path3.resolve(outdir) : path3.resolve(outfile), {
    bundle: true,
    additionalModules: [],
    moduleCollector,
    inject: [routesModule],
    ...outdir ? { entryName: "index" } : { entryName: void 0 },
    minify,
    keepNames,
    sourcemap,
    watch: watch2,
    nodejsCompatMode,
    compatibilityDate: void 0,
    compatibilityFlags: void 0,
    define: {
      __FALLBACK_SERVICE__: JSON.stringify(fallbackService)
    },
    alias: {},
    doBindings: [],
    // Pages functions don't support internal Durable Objects
    workflowBindings: [],
    // Pages functions don't support internal Workflows
    external,
    plugins: [buildNotifierPlugin(onEnd), assetsPlugin(buildOutputDirectory)],
    isOutfile: !outdir,
    checkFetch: local && checkFetch,
    targetConsumer: local ? "dev" : "deploy",
    local,
    projectRoot: getPagesProjectRoot(),
    defineNavigatorUserAgent,
    jsxFactory: void 0,
    jsxFragment: void 0,
    tsconfig: void 0,
    testScheduled: void 0,
    metafile
  });
}
function buildRawWorker({
  workerScriptPath,
  outfile = path3.join(getPagesTmpDir(), `./functionsWorker-${Math.random()}.js`),
  outdir,
  directory,
  bundle = true,
  externalModules,
  minify = false,
  keepNames = true,
  sourcemap = false,
  watch: watch2 = false,
  plugins = [],
  onEnd = /* @__PURE__ */ __name(() => {
  }, "onEnd"),
  nodejsCompatMode,
  local,
  additionalModules = [],
  defineNavigatorUserAgent,
  checkFetch,
  external,
  metafile
}) {
  const entry = {
    file: workerScriptPath,
    projectRoot: path3.resolve(directory),
    configPath: void 0,
    format: "modules",
    moduleRoot: path3.resolve(directory),
    exports: []
  };
  const moduleCollector = externalModules ? noopModuleCollector : createModuleCollector({ entry, findAdditionalModules: false });
  return bundleWorker(entry, outdir ? path3.resolve(outdir) : path3.resolve(outfile), {
    bundle,
    moduleCollector,
    additionalModules,
    minify,
    keepNames,
    sourcemap,
    watch: watch2,
    nodejsCompatMode,
    compatibilityDate: void 0,
    compatibilityFlags: void 0,
    define: {},
    alias: {},
    doBindings: [],
    // Pages functions don't support internal Durable Objects
    workflowBindings: [],
    // Pages functions don't support internal Workflows
    external,
    plugins: [
      ...plugins,
      buildNotifierPlugin(onEnd),
      ...externalModules ? [
        // In some cases, we want to enable bundling in esbuild so that we can flatten a shim around the entrypoint, but we still don't want to actually bundle in all the chunks that a Worker references.
        // This plugin allows us to mark those chunks as external so they are not inlined.
        {
          name: "external-fixer",
          setup(pluginBuild) {
            pluginBuild.onResolve({ filter: /.*/ }, async (args) => {
              if (externalModules.includes(
                path3.resolve(args.resolveDir, args.path)
              )) {
                return { path: args.path, external: true };
              }
            });
          }
        }
      ] : []
    ],
    isOutfile: !outdir,
    checkFetch: local && checkFetch,
    targetConsumer: local ? "dev" : "deploy",
    local,
    projectRoot: getPagesProjectRoot(),
    defineNavigatorUserAgent,
    metafile,
    jsxFactory: void 0,
    jsxFragment: void 0,
    tsconfig: void 0,
    testScheduled: void 0,
    entryName: void 0,
    inject: void 0
  });
}
async function produceWorkerBundleForWorkerJSDirectory({
  workerJSDirectory,
  bundle,
  buildOutputDirectory,
  nodejsCompatMode,
  defineNavigatorUserAgent,
  checkFetch,
  sourceMaps
}) {
  const entrypoint = path3.resolve(path3.join(workerJSDirectory, "index.js"));
  const additionalModules = await findAdditionalModules(
    {
      file: entrypoint,
      projectRoot: path3.resolve(workerJSDirectory),
      configPath: void 0,
      format: "modules",
      moduleRoot: path3.resolve(workerJSDirectory)},
    [
      {
        type: "ESModule",
        globs: ["**/*.js", "**/*.mjs"]
      }
    ],
    sourceMaps
  );
  if (!bundle) {
    return {
      modules: additionalModules,
      dependencies: {},
      resolvedEntryPointPath: entrypoint,
      bundleType: "esm",
      stop: /* @__PURE__ */ __name(async () => {
      }, "stop"),
      sourceMapPath: void 0
    };
  }
  const outfile = path3.join(
    getPagesTmpDir(),
    `./bundledWorker-${Math.random()}.mjs`
  );
  const bundleResult = await buildRawWorker({
    workerScriptPath: entrypoint,
    bundle: true,
    externalModules: additionalModules.map(
      (m7) => path3.join(workerJSDirectory, m7.name)
    ),
    outfile,
    directory: buildOutputDirectory,
    local: false,
    sourcemap: true,
    watch: false,
    onEnd: /* @__PURE__ */ __name(() => {
    }, "onEnd"),
    nodejsCompatMode,
    additionalModules,
    defineNavigatorUserAgent,
    checkFetch
  });
  return {
    modules: bundleResult.modules,
    dependencies: bundleResult.dependencies,
    resolvedEntryPointPath: bundleResult.resolvedEntryPointPath,
    bundleType: bundleResult.bundleType,
    stop: bundleResult.stop,
    sourceMapPath: bundleResult.sourceMapPath
  };
}
function buildNotifierPlugin(onEnd) {
  return {
    name: "wrangler notifier and monitor",
    setup(pluginBuild) {
      pluginBuild.onEnd((result) => {
        if (result.errors.length > 0 || result.warnings.length > 0) {
          logBuildFailure(result.errors, result.warnings);
        } else {
          logger.log("\u2728 Compiled Worker successfully");
        }
        onEnd();
      });
    }
  };
}
async function checkRawWorker(scriptPath4, nodejsCompatMode, onEnd) {
  await esbuild.build({
    entryPoints: [scriptPath4],
    write: false,
    // we need it to be bundled so that any imports that are used are affected by the blocker plugin
    bundle: true,
    plugins: [
      blockWorkerJsImports(nodejsCompatMode),
      buildNotifierPlugin(onEnd)
    ],
    logLevel: "silent"
  });
}
function blockWorkerJsImports(nodejsCompatMode) {
  return {
    name: "block-worker-js-imports",
    setup(build5) {
      build5.onResolve({ filter: /.*/ }, (args) => {
        if (args.kind === "entry-point") {
          return {
            path: args.path
          };
        }
        if ((nodejsCompatMode === "v1" || nodejsCompatMode === "v2") && args.path.startsWith("node:") || args.path.startsWith("cloudflare:")) {
          return {
            path: args.path,
            external: true
          };
        }
        throw new FatalError(
          "_worker.js is not being bundled by Wrangler but it is importing from another file.\nThis will throw an error if deployed.\nYou should bundle the Worker in a pre-build step, remove the import if it is unused, or ask Wrangler to bundle it by setting `--bundle`.",
          1
        );
      });
    }
  };
}
function assetsPlugin(buildOutputDirectory) {
  return {
    name: "Assets",
    setup(pluginBuild) {
      const identifiers = /* @__PURE__ */ new Map();
      pluginBuild.onResolve({ filter: /^assets:/ }, async (args) => {
        const directory = path3.resolve(
          args.resolveDir,
          args.path.slice("assets:".length)
        );
        const exists = await fs9.access(directory).then(() => true).catch(() => false);
        const isDirectory3 = exists && (await fs9.lstat(directory)).isDirectory();
        if (!isDirectory3) {
          return {
            errors: [
              {
                text: `'${directory}' does not exist or is not a directory.`
              }
            ]
          };
        }
        identifiers.set(directory, crypto2__default.default.randomUUID());
        if (!buildOutputDirectory) {
          logger.warn(
            "You're attempting to import static assets as part of your Pages Functions, but have not specified a directory in which to put them. You must use 'wrangler pages dev <directory>' rather than 'wrangler pages dev -- <command>' to import static assets in Functions."
          );
        }
        return { path: directory, namespace: "assets" };
      });
      pluginBuild.onLoad(
        { filter: /.*/, namespace: "assets" },
        async (args) => {
          const identifier = identifiers.get(args.path);
          if (buildOutputDirectory) {
            const staticAssetsOutputDirectory = path3.join(
              buildOutputDirectory,
              "cdn-cgi",
              "pages-plugins",
              identifier
            );
            await removeDir(staticAssetsOutputDirectory);
            await fs9.cp(args.path, staticAssetsOutputDirectory, {
              force: true,
              recursive: true
            });
            return {
              // TODO: Watch args.path for changes and re-copy when updated
              contents: `export const onRequest = ({ request, env, functionPath }) => {
								const url = new URL(request.url);
								const relativePathname = \`/\${url.pathname.replace(functionPath, "") || ""}\`.replace(/^\\/\\//, '/');
								url.pathname = '/cdn-cgi/pages-plugins/${identifier}' + relativePathname;
								request = new Request(url.toString(), request);
								return env.ASSETS.fetch(request);
							}`
            };
          }
        }
      );
    }
  };
}
var init_buildWorker = __esm({
  "src/pages/functions/buildWorker.ts"() {
    init_import_meta_url();
    init_dist();
    init_bundle();
    init_find_additional_modules();
    init_module_collection();
    init_logger();
    init_paths();
    init_utils12();
    __name(buildWorkerFromFunctions, "buildWorkerFromFunctions");
    __name(buildRawWorker, "buildRawWorker");
    __name(produceWorkerBundleForWorkerJSDirectory, "produceWorkerBundleForWorkerJSDirectory");
    __name(buildNotifierPlugin, "buildNotifierPlugin");
    __name(checkRawWorker, "checkRawWorker");
    __name(blockWorkerJsImports, "blockWorkerJsImports");
    __name(assetsPlugin, "assetsPlugin");
  }
});
function buildPluginFromFunctions({
  routesModule,
  outdir,
  minify = false,
  keepNames = true,
  sourcemap = false,
  watch: watch2 = false,
  onEnd = /* @__PURE__ */ __name(() => {
  }, "onEnd"),
  nodejsCompatMode,
  functionsDirectory,
  local,
  defineNavigatorUserAgent,
  checkFetch,
  external
}) {
  const entry = {
    file: path3.resolve(getBasePath(), "templates/pages-template-plugin.ts"),
    projectRoot: functionsDirectory,
    configPath: void 0,
    format: "modules",
    moduleRoot: functionsDirectory,
    exports: []
  };
  const moduleCollector = createModuleCollector({
    entry,
    findAdditionalModules: false
  });
  return bundleWorker(entry, path3.resolve(outdir), {
    bundle: true,
    additionalModules: [],
    moduleCollector,
    inject: [routesModule],
    entryName: "index",
    minify,
    keepNames,
    sourcemap,
    watch: watch2,
    // We don't currently have a mechanism for Plugins 'requiring' a specific compat date/flag,
    // but if someone wants to publish a Plugin which does require this new `nodejs_compat` flag
    // and they document that on their README.md, we should let them.
    nodejsCompatMode: nodejsCompatMode ?? "v1",
    compatibilityDate: void 0,
    compatibilityFlags: void 0,
    define: {},
    alias: {},
    doBindings: [],
    // Pages functions don't support internal Durable Objects
    workflowBindings: [],
    // Pages functions don't support internal Workflows
    external,
    plugins: [
      buildNotifierPlugin(onEnd),
      {
        name: "Assets",
        setup(pluginBuild) {
          pluginBuild.onResolve({ filter: /^assets:/ }, async (args) => {
            const directory = path3.resolve(
              args.resolveDir,
              args.path.slice("assets:".length)
            );
            const exists = await fs9.access(directory).then(() => true).catch(() => false);
            const isDirectory3 = exists && (await fs9.lstat(directory)).isDirectory();
            if (!isDirectory3) {
              return {
                errors: [
                  {
                    text: `'${directory}' does not exist or is not a directory.`
                  }
                ]
              };
            }
            const path84 = `assets:./${path3.relative(outdir, directory)}`;
            return { path: path84, external: true, namespace: "assets" };
          });
        }
      },
      // TODO: Replace this with a proper outdir solution for Plugins
      // But for now, let's just mark all wasm/bin files as external
      {
        name: "Mark externals",
        setup(pluginBuild) {
          pluginBuild.onResolve({ filter: /.*\.(wasm|bin)$/ }, async (args) => {
            return {
              external: true,
              path: `./${path3.relative(
                outdir,
                path3.resolve(args.resolveDir, args.path)
              )}`
            };
          });
        }
      }
    ],
    checkFetch: local && checkFetch,
    targetConsumer: local ? "dev" : "deploy",
    local,
    projectRoot: getPagesProjectRoot(),
    defineNavigatorUserAgent,
    jsxFactory: void 0,
    jsxFragment: void 0,
    tsconfig: void 0,
    testScheduled: void 0,
    isOutfile: void 0,
    metafile: void 0
  });
}
var init_buildPlugin = __esm({
  "src/pages/functions/buildPlugin.ts"() {
    init_import_meta_url();
    init_bundle();
    init_module_collection();
    init_paths();
    init_utils12();
    init_buildWorker();
    __name(buildPluginFromFunctions, "buildPluginFromFunctions");
  }
});
async function generateConfigFromFileTree({
  baseDir,
  baseURL
}) {
  let routeEntries = [];
  if (!baseURL.startsWith("/")) {
    baseURL = `/${baseURL}`;
  }
  if (baseURL.endsWith("/")) {
    baseURL = baseURL.slice(0, -1);
  }
  await forEachFile(baseDir, async (filepath) => {
    const ext2 = path3__namespace.default.extname(filepath);
    if (/^\.(mjs|js|ts|tsx|jsx)$/.test(ext2)) {
      const { metafile } = await esbuild.build({
        metafile: true,
        write: false,
        bundle: false,
        entryPoints: [path3__namespace.default.resolve(filepath)]
      }).catch((e10) => {
        throw new FunctionsBuildError(e10.message);
      });
      const exportNames = [];
      if (metafile) {
        for (const output in metafile?.outputs) {
          exportNames.push(...metafile.outputs[output].exports);
        }
      }
      for (const exportName of exportNames) {
        const [match3, method = ""] = exportName.match(
          /^onRequest(Get|Post|Put|Patch|Delete|Options|Head)?$/
        ) ?? [];
        if (match3) {
          const basename11 = path3__namespace.default.basename(filepath).slice(0, -ext2.length);
          const isIndexFile = basename11 === "index";
          const isMiddlewareFile = basename11 === "_middleware" || basename11 === "_middleware_";
          let routePath = path3__namespace.default.relative(baseDir, filepath).slice(0, -ext2.length);
          let mountPath = path3__namespace.default.dirname(routePath);
          if (isIndexFile || isMiddlewareFile) {
            routePath = path3__namespace.default.dirname(routePath);
          }
          if (routePath === ".") {
            routePath = "";
          }
          if (mountPath === ".") {
            mountPath = "";
          }
          routePath = `${baseURL}/${routePath}`;
          mountPath = `${baseURL}/${mountPath}`;
          routePath = convertCatchallParams(routePath);
          routePath = convertSimpleParams(routePath);
          mountPath = convertCatchallParams(mountPath);
          mountPath = convertSimpleParams(mountPath);
          const modulePath = toUrlPath(path3__namespace.default.relative(baseDir, filepath));
          const routeEntry = {
            routePath: toUrlPath(routePath),
            mountPath: toUrlPath(mountPath),
            method: method.toUpperCase(),
            [isMiddlewareFile ? "middleware" : "module"]: [
              `${modulePath}:${exportName}`
            ]
          };
          routeEntries.push(routeEntry);
        }
      }
    }
  });
  routeEntries = routeEntries.reduce(
    (acc, { routePath, ...rest }) => {
      const existingRouteEntry = acc.find(
        (routeEntry) => routeEntry.routePath === routePath && routeEntry.method === rest.method
      );
      if (existingRouteEntry !== void 0) {
        Object.assign(existingRouteEntry, rest);
      } else {
        acc.push({ routePath, ...rest });
      }
      return acc;
    },
    []
  );
  routeEntries.sort((a7, b11) => compareRoutes(a7, b11));
  return {
    routes: routeEntries
  };
}
function compareRoutes({ routePath: routePathA, method: methodA }, { routePath: routePathB, method: methodB }) {
  function parseRoutePath(routePath) {
    return routePath.slice(1).split("/").filter(Boolean);
  }
  __name(parseRoutePath, "parseRoutePath");
  const segmentsA = parseRoutePath(routePathA);
  const segmentsB = parseRoutePath(routePathB);
  if (segmentsA.length !== segmentsB.length) {
    return segmentsB.length - segmentsA.length;
  }
  for (let i7 = 0; i7 < segmentsA.length; i7++) {
    const isWildcardA = segmentsA[i7].includes("*");
    const isWildcardB = segmentsB[i7].includes("*");
    const isParamA = segmentsA[i7].includes(":");
    const isParamB = segmentsB[i7].includes(":");
    if (isWildcardA && !isWildcardB) {
      return 1;
    }
    if (!isWildcardA && isWildcardB) {
      return -1;
    }
    if (isParamA && !isParamB) {
      return 1;
    }
    if (!isParamA && isParamB) {
      return -1;
    }
  }
  if (methodA && !methodB) {
    return -1;
  }
  if (!methodA && methodB) {
    return 1;
  }
  return routePathA.localeCompare(routePathB);
}
async function forEachFile(baseDir, fn2) {
  const searchPaths = [baseDir];
  const returnValues = [];
  while (isNotEmpty(searchPaths)) {
    const cwd2 = searchPaths.shift();
    const dir2 = await fs9__default.default.readdir(cwd2, { withFileTypes: true });
    for (const entry of dir2) {
      const pathname = path3__namespace.default.join(cwd2, entry.name);
      if (entry.isDirectory()) {
        searchPaths.push(pathname);
      } else if (entry.isFile()) {
        returnValues.push(await fn2(pathname));
      }
    }
  }
  return returnValues;
}
function isNotEmpty(array) {
  return array.length > 0;
}
function convertCatchallParams(routePath) {
  return routePath.replace(/\[\[([^\]]+)\]\]/g, (_5, param) => {
    if (validParamNameRegExp.test(param)) {
      return `:${param}*`;
    } else {
      throw new FatalError(
        `Invalid Pages function route parameter - "[[${param}]]". Parameters names must only contain alphanumeric and underscore characters.`
      );
    }
  });
}
function convertSimpleParams(routePath) {
  return routePath.replace(/\[([^\]]+)\]/g, (_5, param) => {
    if (validParamNameRegExp.test(param)) {
      return `:${param}`;
    } else {
      throw new FatalError(
        `Invalid Pages function route parameter - "[${param}]". Parameter names must only contain alphanumeric and underscore characters.`
      );
    }
  });
}
var validParamNameRegExp;
var init_filepath_routing = __esm({
  "src/pages/functions/filepath-routing.ts"() {
    init_import_meta_url();
    init_dist();
    init_paths();
    init_errors2();
    __name(generateConfigFromFileTree, "generateConfigFromFileTree");
    __name(compareRoutes, "compareRoutes");
    __name(forEachFile, "forEachFile");
    __name(isNotEmpty, "isNotEmpty");
    validParamNameRegExp = /^[A-Za-z0-9_]+$/;
    __name(convertCatchallParams, "convertCatchallParams");
    __name(convertSimpleParams, "convertSimpleParams");
  }
});

// src/pages/functions/identifiers.ts
var RESERVED_KEYWORDS, reservedKeywordRegex, identifierNameRegex, validIdentifierRegex, isValidIdentifier, normalizeIdentifier;
var init_identifiers = __esm({
  "src/pages/functions/identifiers.ts"() {
    init_import_meta_url();
    RESERVED_KEYWORDS = [
      "do",
      "if",
      "in",
      "for",
      "let",
      "new",
      "try",
      "var",
      "case",
      "else",
      "enum",
      "eval",
      "null",
      "this",
      "true",
      "void",
      "with",
      "await",
      "break",
      "catch",
      "class",
      "const",
      "false",
      "super",
      "throw",
      "while",
      "yield",
      "delete",
      "export",
      "import",
      "public",
      "return",
      "static",
      "switch",
      "typeof",
      "default",
      "extends",
      "finally",
      "package",
      "private",
      "continue",
      "debugger",
      "function",
      "arguments",
      "interface",
      "protected",
      "implements",
      "instanceof",
      "NaN",
      "Infinity",
      "undefined"
    ];
    reservedKeywordRegex = new RegExp(`^${RESERVED_KEYWORDS.join("|")}$`);
    identifierNameRegex = /^(?:[$_\p{ID_Start}])(?:[$_\u200C\u200D\p{ID_Continue}])*$/u;
    validIdentifierRegex = new RegExp(
      `(?!(${reservedKeywordRegex.source})$)${identifierNameRegex.source}`,
      "u"
    );
    isValidIdentifier = /* @__PURE__ */ __name((identifier) => validIdentifierRegex.test(identifier), "isValidIdentifier");
    normalizeIdentifier = /* @__PURE__ */ __name((identifier) => identifier.replace(
      /(?:^[^$_\p{ID_Start}])|[^$_\u200C\u200D\p{ID_Continue}]/gu,
      "_"
    ), "normalizeIdentifier");
  }
});
async function writeRoutesModule({
  config,
  srcDir,
  outfile = "_routes.js"
}) {
  const { importMap, routes } = parseConfig(config, srcDir);
  const routesModule = generateRoutesModule(importMap, routes);
  await fs9__default.default.writeFile(outfile, routesModule);
  return outfile;
}
function parseConfig(config, baseDir) {
  baseDir = path3__namespace.default.resolve(baseDir);
  const routes = [];
  const importMap = /* @__PURE__ */ new Map();
  const identifierCount = /* @__PURE__ */ new Map();
  function parseModuleIdentifiers(paths) {
    if (typeof paths === "undefined") {
      paths = [];
    }
    if (typeof paths === "string") {
      paths = [paths];
    }
    return paths.map((modulePath) => {
      const resolvedPath2 = path3__namespace.default.resolve(baseDir, modulePath);
      const moduleRoot = path3__namespace.default.parse(resolvedPath2).root;
      const strippedPath = resolvedPath2.slice(moduleRoot.length - 1);
      const [filepath, name2 = "default"] = strippedPath.split(":");
      const fullFilepath = path3__namespace.default.resolve(moduleRoot, filepath);
      const relativePath = path3__namespace.default.relative(baseDir, fullFilepath);
      if (moduleRoot !== path3__namespace.default.parse(baseDir).root || relativePath.startsWith("..")) {
        throw new UserError(`Invalid module path "${fullFilepath}"`);
      }
      if (name2 !== "default" && !isValidIdentifier(name2)) {
        throw new UserError(`Invalid module identifier "${name2}"`);
      }
      let { identifier } = importMap.get(resolvedPath2) ?? {};
      if (!identifier) {
        identifier = normalizeIdentifier(`__${relativePath}_${name2}`);
        let count = identifierCount.get(identifier) ?? 0;
        identifierCount.set(identifier, ++count);
        if (count > 1) {
          identifier += `_${count}`;
        }
        importMap.set(resolvedPath2, {
          filepath: fullFilepath,
          name: name2,
          identifier
        });
      }
      return identifier;
    });
  }
  __name(parseModuleIdentifiers, "parseModuleIdentifiers");
  for (const { routePath, mountPath, method, ...props } of config.routes ?? []) {
    routes.push({
      routePath,
      mountPath,
      method,
      middlewares: parseModuleIdentifiers(props.middleware),
      modules: parseModuleIdentifiers(props.module)
    });
  }
  return { routes, importMap };
}
function generateRoutesModule(importMap, routes) {
  return `${[...importMap.values()].map(
    ({ filepath, name: name2, identifier }) => `import { ${name2} as ${identifier} } from ${JSON.stringify(filepath)}`
  ).join("\n")}

export const routes = [
  ${routes.map(
    (route) => `  {
      routePath: "${route.routePath}",
      mountPath: "${route.mountPath}",
      method: "${route.method}",
      middlewares: [${route.middlewares.join(", ")}],
      modules: [${route.modules.join(", ")}],
    },`
  ).join("\n")}
  ]`;
}
var init_routes5 = __esm({
  "src/pages/functions/routes.ts"() {
    init_import_meta_url();
    init_dist();
    init_identifiers();
    __name(writeRoutesModule, "writeRoutesModule");
    __name(parseConfig, "parseConfig");
    __name(generateRoutesModule, "generateRoutesModule");
  }
});

// src/pages/functions/routes-consolidation.ts
function consolidateRoutes(routes) {
  const routesShortened = Array.from(
    new Set(routes.map((route) => shortenRoute(route)))
  );
  const routesMap = /* @__PURE__ */ new Map();
  for (const route of routesShortened) {
    routesMap.set(route, true);
  }
  for (const route of routesShortened.filter((r10) => r10.endsWith("/*"))) {
    if (routesMap.has(route)) {
      const routeTrimmed = route.substring(0, route.length - 1);
      for (const nextRoute of routesMap.keys()) {
        if (nextRoute !== route && nextRoute.startsWith(routeTrimmed)) {
          routesMap.delete(nextRoute);
        }
      }
    }
  }
  return Array.from(routesMap.keys());
}
function shortenRoute(routeToShorten, maxLength = MAX_FUNCTIONS_ROUTES_RULE_LENGTH) {
  if (routeToShorten.length <= maxLength) {
    return routeToShorten;
  }
  let route = routeToShorten;
  for (let i7 = 0; i7 < routeToShorten.length; i7++) {
    for (let j7 = maxLength - 1 - i7; j7 > 0; j7--) {
      if (route[j7] === "/") {
        route = route.slice(0, j7) + "/*";
        break;
      }
    }
    if (route.length <= maxLength) {
      break;
    }
  }
  if (route.length > maxLength) {
    route = "/*";
  }
  return route;
}
var init_routes_consolidation = __esm({
  "src/pages/functions/routes-consolidation.ts"() {
    init_import_meta_url();
    init_constants3();
    __name(consolidateRoutes, "consolidateRoutes");
    __name(shortenRoute, "shortenRoute");
  }
});
function convertRoutesToGlobPatterns(routes) {
  const convertedRoutes = routes.map(({ routePath, middleware }) => {
    const globbedRoutePath = routePath.replace(/:\w+\*?.*/, "*");
    if (typeof middleware === "string" || Array.isArray(middleware) && middleware.length > 0) {
      if (!globbedRoutePath.endsWith("*")) {
        return toUrlPath(path3.join(globbedRoutePath, "*"));
      }
    }
    return toUrlPath(globbedRoutePath);
  });
  return Array.from(new Set(convertedRoutes));
}
function convertRoutesToRoutesJSONSpec(routes) {
  const reversedRoutes = [...routes].reverse();
  const include = convertRoutesToGlobPatterns(reversedRoutes);
  return optimizeRoutesJSONSpec({
    version: ROUTES_SPEC_VERSION,
    description: ROUTES_SPEC_DESCRIPTION,
    include,
    exclude: []
  });
}
function optimizeRoutesJSONSpec(spec) {
  const optimizedSpec = { ...spec };
  let consolidatedRoutes = consolidateRoutes(optimizedSpec.include);
  if (consolidatedRoutes.length > MAX_FUNCTIONS_ROUTES_RULES) {
    consolidatedRoutes = ["/*"];
  }
  consolidatedRoutes.sort((a7, b11) => compareRoutes2(b11, a7));
  optimizedSpec.include = consolidatedRoutes;
  return optimizedSpec;
}
function compareRoutes2(routeA, routeB) {
  function parseRoutePath(routePath) {
    return routePath.slice(1).split("/").filter(Boolean);
  }
  __name(parseRoutePath, "parseRoutePath");
  const segmentsA = parseRoutePath(routeA);
  const segmentsB = parseRoutePath(routeB);
  if (segmentsA.length !== segmentsB.length) {
    return segmentsB.length - segmentsA.length;
  }
  for (let i7 = 0; i7 < segmentsA.length; i7++) {
    const isWildcardA = segmentsA[i7].includes("*");
    const isWildcardB = segmentsB[i7].includes("*");
    if (isWildcardA && !isWildcardB) {
      return 1;
    }
    if (!isWildcardA && isWildcardB) {
      return -1;
    }
  }
  return routeA.localeCompare(routeB);
}
var init_routes_transformation = __esm({
  "src/pages/functions/routes-transformation.ts"() {
    init_import_meta_url();
    init_paths();
    init_constants3();
    init_routes_consolidation();
    __name(convertRoutesToGlobPatterns, "convertRoutesToGlobPatterns");
    __name(convertRoutesToRoutesJSONSpec, "convertRoutesToRoutesJSONSpec");
    __name(optimizeRoutesJSONSpec, "optimizeRoutesJSONSpec");
    __name(compareRoutes2, "compareRoutes");
  }
});
async function buildFunctions({
  outfile,
  outdir,
  outputConfigPath,
  functionsDirectory,
  minify = false,
  sourcemap = false,
  fallbackService = "ASSETS",
  watch: watch2 = false,
  onEnd,
  plugin = false,
  buildOutputDirectory,
  routesOutputPath,
  nodejsCompatMode,
  local,
  routesModule = path3.join(
    getPagesTmpDir(),
    `./functionsRoutes-${Math.random()}.mjs`
  ),
  defineNavigatorUserAgent,
  checkFetch,
  external,
  metafile
}) {
  RUNNING_BUILDERS.forEach(
    (runningBuilder) => runningBuilder.stop && runningBuilder.stop()
  );
  const baseURL = toUrlPath("/");
  const config = await generateConfigFromFileTree({
    baseDir: functionsDirectory,
    baseURL
  });
  if (!config.routes || config.routes.length === 0) {
    throw new FunctionsNoRoutesError(
      `Failed to find any routes while compiling Functions in: ${functionsDirectory}`
    );
  }
  if (routesOutputPath) {
    const routesJSON = convertRoutesToRoutesJSONSpec(config.routes);
    fs29.writeFileSync(routesOutputPath, JSON.stringify(routesJSON, null, 2));
  }
  if (outputConfigPath) {
    fs29.writeFileSync(
      outputConfigPath,
      JSON.stringify({ ...config, baseURL }, null, 2)
    );
  }
  await writeRoutesModule({
    config,
    srcDir: functionsDirectory,
    outfile: routesModule
  });
  const absoluteFunctionsDirectory = path3.resolve(functionsDirectory);
  let bundle;
  if (plugin) {
    if (outdir === void 0) {
      throw new FatalError(
        "Must specify an output directory when building a Plugin.",
        1
      );
    }
    bundle = await buildPluginFromFunctions({
      routesModule,
      outdir,
      minify,
      sourcemap,
      watch: watch2,
      nodejsCompatMode,
      functionsDirectory: absoluteFunctionsDirectory,
      local,
      defineNavigatorUserAgent,
      checkFetch,
      external
    });
  } else {
    bundle = await buildWorkerFromFunctions({
      routesModule,
      outfile,
      outdir,
      minify,
      sourcemap,
      fallbackService,
      watch: watch2,
      functionsDirectory: absoluteFunctionsDirectory,
      local,
      onEnd,
      buildOutputDirectory,
      nodejsCompatMode,
      defineNavigatorUserAgent,
      checkFetch,
      external,
      metafile
    });
  }
  RUNNING_BUILDERS.push(bundle);
  return bundle;
}
var init_buildFunctions = __esm({
  "src/pages/buildFunctions.ts"() {
    init_import_meta_url();
    init_dist();
    init_paths();
    init_errors2();
    init_buildPlugin();
    init_buildWorker();
    init_filepath_routing();
    init_routes5();
    init_routes_transformation();
    init_utils12();
    __name(buildFunctions, "buildFunctions");
  }
});
async function maybeReadPagesConfig(args) {
  if (!args.projectDirectory || !args.buildMetadataPath) {
    return;
  }
  const { configPath } = findWranglerConfig(args.projectDirectory, {
    useRedirectIfAvailable: true
  });
  if (!configPath || !fs29.existsSync(configPath)) {
    return void 0;
  }
  try {
    const config = readPagesConfig({
      ...args,
      config: configPath,
      // eslint-disable-next-line turbo/no-undeclared-env-vars
      env: process.env.PAGES_ENVIRONMENT
    });
    return {
      ...config,
      hash: crypto2.createHash("sha256").update(await fs9.readFile(configPath)).digest("hex")
    };
  } catch (e10) {
    if (e10 instanceof FatalError && e10.code === EXIT_CODE_INVALID_PAGES_CONFIG) {
      return void 0;
    }
    throw e10;
  }
}
var pagesFunctionsBuildCommand, validateArgs;
var init_build5 = __esm({
  "src/pages/build.ts"() {
    init_import_meta_url();
    init_dist();
    init_create_worker_bundle_contents();
    init_config();
    init_create_command();
    init_bundle();
    init_find_additional_modules();
    init_node_compat();
    init_logger();
    init_metrics();
    init_navigator_user_agent();
    init_buildFunctions();
    init_errors2();
    init_buildWorker();
    pagesFunctionsBuildCommand = createCommand({
      metadata: {
        description: "Compile a folder of Pages Functions into a single Worker",
        status: "stable",
        owner: "Workers: Authoring and Testing",
        hideGlobalFlags: ["config", "env"]
      },
      behaviour: {
        provideConfig: false
      },
      args: {
        directory: {
          type: "string",
          default: "functions",
          description: "The directory of Pages Functions"
        },
        outfile: {
          type: "string",
          description: "The location of the output Worker script",
          deprecated: true
        },
        outdir: {
          type: "string",
          description: "Output directory for the bundled Worker"
        },
        "output-config-path": {
          type: "string",
          description: "The location for the output config file"
        },
        "build-metadata-path": {
          type: "string",
          description: "The location for the build metadata file"
        },
        "project-directory": {
          type: "string",
          description: "The location of the Pages project"
        },
        "output-routes-path": {
          type: "string",
          description: "The location for the output _routes.json file"
        },
        minify: {
          type: "boolean",
          default: false,
          description: "Minify the output Worker script"
        },
        sourcemap: {
          type: "boolean",
          default: false,
          description: "Generate a sourcemap for the output Worker script"
        },
        "fallback-service": {
          type: "string",
          default: "ASSETS",
          description: "The service to fallback to at the end of the `next` chain. Setting to '' will fallback to the global `fetch`."
        },
        watch: {
          type: "boolean",
          default: false,
          description: "Watch for changes to the functions and automatically rebuild the Worker script"
        },
        plugin: {
          type: "boolean",
          default: false,
          description: "Build a plugin rather than a Worker script"
        },
        "build-output-directory": {
          type: "string",
          description: "The directory to output static assets to"
        },
        "node-compat": {
          type: "boolean",
          default: false,
          description: "Enable Node.js compatibility",
          hidden: true,
          deprecated: true
        },
        "compatibility-date": {
          type: "string",
          description: "Date to use for compatibility checks"
        },
        "compatibility-flags": {
          description: "Flags to use for compatibility checks",
          alias: "compatibility-flag",
          type: "string",
          requiresArg: true,
          array: true
        },
        bindings: {
          type: "string",
          description: "Bindings used in Functions (used to register beta product shims)",
          deprecated: true,
          hidden: true
        },
        external: {
          description: "A list of module imports to exclude from bundling",
          type: "string",
          array: true
        },
        metafile: {
          describe: "Path to output build metadata from esbuild. If flag is used without a path, defaults to 'bundle-meta.json' inside the directory specified by --outdir.",
          type: "string",
          coerce: /* @__PURE__ */ __name((v8) => !v8 ? true : v8, "coerce")
        }
      },
      positionalArgs: ["directory"],
      async handler(args) {
        const validatedArgs = await validateArgs(args);
        let bundle = void 0;
        if (validatedArgs.plugin) {
          const {
            directory,
            outfile,
            outdir,
            outputConfigPath,
            outputRoutesPath: routesOutputPath,
            minify,
            sourcemap,
            fallbackService,
            watch: watch2,
            plugin,
            nodejsCompatMode,
            defineNavigatorUserAgent,
            checkFetch,
            external,
            metafile
          } = validatedArgs;
          try {
            bundle = await buildFunctions({
              outfile,
              outdir,
              outputConfigPath,
              functionsDirectory: directory,
              minify,
              sourcemap,
              fallbackService,
              // This only watches already existing files using the esbuild watching mechanism
              // it will not watch new files that are added to the functions directory!
              watch: watch2,
              plugin,
              nodejsCompatMode,
              routesOutputPath,
              local: false,
              defineNavigatorUserAgent,
              checkFetch,
              external,
              metafile
            });
          } catch (e10) {
            if (e10 instanceof FunctionsNoRoutesError) {
              throw new FatalError(
                getFunctionsNoRoutesWarning(directory),
                EXIT_CODE_FUNCTIONS_NO_ROUTES_ERROR
              );
            } else {
              throw e10;
            }
          }
          if (outfile && outfile !== bundle.resolvedEntryPointPath) {
            fs29.writeFileSync(
              outfile,
              `export { default } from './${path3.relative(
                path3.dirname(outfile),
                bundle.resolvedEntryPointPath
              )}'`
            );
          }
        } else {
          const {
            config,
            buildMetadataPath,
            buildMetadata,
            directory,
            outfile,
            outdir,
            outputConfigPath,
            outputRoutesPath: routesOutputPath,
            minify,
            sourcemap,
            fallbackService,
            watch: watch2,
            plugin,
            buildOutputDirectory,
            nodejsCompatMode,
            workerScriptPath,
            defineNavigatorUserAgent,
            checkFetch,
            external,
            metafile
          } = validatedArgs;
          if (workerScriptPath) {
            if (fs29.lstatSync(workerScriptPath).isDirectory()) {
              bundle = await produceWorkerBundleForWorkerJSDirectory({
                workerJSDirectory: workerScriptPath,
                bundle: true,
                buildOutputDirectory,
                nodejsCompatMode,
                defineNavigatorUserAgent,
                checkFetch,
                sourceMaps: config?.upload_source_maps ?? sourcemap
              });
            } else {
              bundle = await buildRawWorker({
                workerScriptPath,
                outdir,
                directory: buildOutputDirectory,
                local: false,
                sourcemap: config?.upload_source_maps ?? sourcemap,
                watch: watch2,
                nodejsCompatMode,
                defineNavigatorUserAgent,
                checkFetch,
                externalModules: external
              });
            }
          } else {
            try {
              bundle = await buildFunctions({
                outdir,
                outputConfigPath,
                functionsDirectory: directory,
                minify,
                sourcemap: config?.upload_source_maps ?? sourcemap,
                fallbackService,
                watch: watch2,
                plugin,
                buildOutputDirectory,
                nodejsCompatMode,
                routesOutputPath,
                local: false,
                defineNavigatorUserAgent,
                checkFetch,
                external,
                metafile
              });
            } catch (e10) {
              if (e10 instanceof FunctionsNoRoutesError) {
                throw new FatalError(
                  getFunctionsNoRoutesWarning(directory),
                  EXIT_CODE_FUNCTIONS_NO_ROUTES_ERROR
                );
              } else {
                throw e10;
              }
            }
          }
          if (outdir) {
            await writeAdditionalModules(bundle.modules, outdir);
          }
          if (outfile) {
            const workerBundleContents = await createUploadWorkerBundleContents(
              bundle,
              config
            );
            fs29.mkdirSync(path3.dirname(outfile), { recursive: true });
            fs29.writeFileSync(
              outfile,
              Buffer.from(await workerBundleContents.arrayBuffer())
            );
          }
          if (buildMetadataPath && buildMetadata) {
            fs29.writeFileSync(buildMetadataPath, JSON.stringify(buildMetadata));
          }
        }
        sendMetricsEvent("build pages functions");
      }
    });
    __name(maybeReadPagesConfig, "maybeReadPagesConfig");
    validateArgs = /* @__PURE__ */ __name(async (args) => {
      const config = await maybeReadPagesConfig(args);
      if (args.nodeCompat) {
        throw new UserError(
          `The --node-compat flag is no longer supported as of Wrangler v4. Instead, use the \`nodejs_compat\` compatibility flag. This includes the functionality from legacy \`node_compat\` polyfills and natively implemented Node.js APIs. See https://developers.cloudflare.com/workers/runtime-apis/nodejs for more information.`
        );
      }
      if (args.outdir && args.outfile) {
        throw new FatalError(
          "Cannot specify both an `--outdir` and an `--outfile`.",
          1
        );
      }
      if (args.plugin) {
        if (args.outfile) {
          logger.warn(
            "Creating a Pages Plugin with `--outfile` is now deprecated. Please use `--outdir` instead."
          );
          args.outdir = path3.dirname(path3.resolve(args.outfile));
        } else if (!args.outfile && !args.outdir) {
          args.outfile ??= "_worker.js";
          args.outdir = ".";
          logger.warn(
            "Creating a Pages Plugin without `--outdir` is now deprecated. Please add an `--outdir` argument."
          );
        }
        if (args.bindings) {
          throw new FatalError(
            "The `--bindings` flag cannot be used when creating a Pages Plugin with `--plugin`.",
            1
          );
        }
        if (args.buildOutputDirectory) {
          throw new FatalError(
            "The `--build-output-directory` flag cannot be used when creating a Pages Plugin with `--plugin`.",
            1
          );
        }
      } else {
        if (!args.outdir) {
          args.outfile ??= "_worker.bundle";
        }
        args.buildOutputDirectory ??= args.outfile ? path3.dirname(args.outfile) : ".";
      }
      args.buildOutputDirectory = config?.pages_build_output_dir ?? (args.buildOutputDirectory ? path3.resolve(args.buildOutputDirectory) : void 0);
      if (args.outdir) {
        args.outdir = path3.resolve(args.outdir);
      }
      if (args.outfile) {
        args.outfile = path3.resolve(args.outfile);
      }
      const nodejsCompatMode = validateNodeCompatMode(
        args.compatibilityDate ?? config?.compatibility_date,
        args.compatibilityFlags ?? config?.compatibility_flags ?? [],
        {
          noBundle: config?.no_bundle
        }
      );
      const defineNavigatorUserAgent = isNavigatorDefined(
        args.compatibilityDate,
        args.compatibilityFlags
      );
      const checkFetch = shouldCheckFetch(
        args.compatibilityDate,
        args.compatibilityFlags
      );
      let workerScriptPath;
      if (args.buildOutputDirectory) {
        const prospectiveWorkerScriptPath = path3.resolve(
          args.buildOutputDirectory,
          "_worker.js"
        );
        const foundWorkerScript = fs29.existsSync(prospectiveWorkerScriptPath);
        if (foundWorkerScript) {
          workerScriptPath = prospectiveWorkerScriptPath;
        } else if (!foundWorkerScript && !fs29.existsSync(args.directory)) {
          throw new FatalError(
            `Could not find anything to build.
We first looked inside the build output directory (${path3.basename(
              path3.resolve(args.buildOutputDirectory)
            )}), then looked for the Functions directory (${path3.basename(
              args.directory
            )}) but couldn't find anything to build.
	\u27A4 If you are trying to build _worker.js, please make sure you provide the [--build-output-directory] containing your static files.
	\u27A4 If you are trying to build Pages Functions, please make sure [directory] points to the location of your Functions files.`,
            EXIT_CODE_FUNCTIONS_NOTHING_TO_BUILD_ERROR
          );
        }
      } else if (!fs29.existsSync(args.directory)) {
        throw new FatalError(
          `Could not find anything to build.
We looked for the Functions directory (${path3.basename(
            args.directory
          )}) but couldn't find anything to build.
	\u27A4 Please make sure [directory] points to the location of your Functions files.`,
          EXIT_CODE_FUNCTIONS_NOTHING_TO_BUILD_ERROR
        );
      }
      return {
        ...args,
        workerScriptPath,
        nodejsCompatMode,
        defineNavigatorUserAgent,
        checkFetch,
        config,
        buildMetadata: config && args.projectDirectory && config.pages_build_output_dir ? {
          wrangler_config_hash: config.hash,
          build_output_directory: path3__namespace.default.relative(
            args.projectDirectory,
            config.pages_build_output_dir
          )
        } : void 0
      };
    }, "validateArgs");
  }
});
var pagesFunctionsBuildEnvCommand;
var init_build_env = __esm({
  "src/pages/build-env.ts"() {
    init_import_meta_url();
    init_dist();
    init_config();
    init_create_command();
    init_logger();
    init_errors2();
    pagesFunctionsBuildEnvCommand = createCommand({
      metadata: {
        description: "Render a list of environment variables from the config file",
        status: "stable",
        owner: "Workers: Authoring and Testing",
        hidden: true
      },
      behaviour: {
        provideConfig: false
      },
      args: {
        projectDir: {
          type: "string",
          description: "The location of the Pages project"
        },
        outfile: {
          type: "string",
          description: "The location to write the build environment file"
        }
      },
      positionalArgs: ["projectDir"],
      async handler(args) {
        if (!args.projectDir) {
          throw new FatalError("No Pages project location specified");
        }
        if (!args.outfile) {
          throw new FatalError("No outfile specified");
        }
        logger.log(
          "Checking for configuration in a Wrangler configuration file (BETA)\n"
        );
        const { configPath } = findWranglerConfig(args.projectDir, {
          useRedirectIfAvailable: true
        });
        if (!configPath || !fs29.existsSync(configPath)) {
          logger.debug("No Wrangler configuration file found. Exiting.");
          process.exitCode = EXIT_CODE_NO_CONFIG_FOUND;
          return;
        }
        logger.log(
          `Found ${configFileName(configPath)} file. Reading build configuration...`
        );
        let config;
        try {
          config = readPagesConfig({
            ...args,
            config: configPath,
            // eslint-disable-next-line turbo/no-undeclared-env-vars
            env: process.env.PAGES_ENVIRONMENT
          });
        } catch (err) {
          if (err instanceof FatalError && err.code === EXIT_CODE_INVALID_PAGES_CONFIG) {
            logger.debug(
              `Your ${configFileName(configPath)} file is invalid. Exiting.`
            );
            process.exitCode = EXIT_CODE_INVALID_PAGES_CONFIG;
            return;
          }
          throw err;
        }
        const textVars = Object.fromEntries(
          Object.entries(config.vars).filter(([_5, v8]) => typeof v8 === "string")
        );
        const buildConfiguration = {
          vars: textVars,
          pages_build_output_dir: path3__namespace.default.relative(
            args.projectDir,
            config.pages_build_output_dir
          )
        };
        fs29.writeFileSync(args.outfile, JSON.stringify(buildConfiguration));
        logger.debug(`Build configuration written to ${args.outfile}`);
        logger.debug(JSON.stringify(buildConfiguration), null, 2);
        const vars = Object.entries(buildConfiguration.vars);
        const message = [
          `Build environment variables: ${vars.length === 0 ? "(none found)" : ""}`,
          ...vars.map(([key, value]) => `  - ${key}: ${value}`)
        ].join("\n");
        logger.log(
          `pages_build_output_dir: ${buildConfiguration.pages_build_output_dir}`
        );
        logger.log(message);
      }
    });
  }
});

// ../../node_modules/.pnpm/mime@3.0.0/node_modules/mime/Mime.js
var require_Mime = __commonJS({
  "../../node_modules/.pnpm/mime@3.0.0/node_modules/mime/Mime.js"(exports, module2) {
    init_import_meta_url();
    function Mime2() {
      this._types = /* @__PURE__ */ Object.create(null);
      this._extensions = /* @__PURE__ */ Object.create(null);
      for (let i7 = 0; i7 < arguments.length; i7++) {
        this.define(arguments[i7]);
      }
      this.define = this.define.bind(this);
      this.getType = this.getType.bind(this);
      this.getExtension = this.getExtension.bind(this);
    }
    __name(Mime2, "Mime");
    Mime2.prototype.define = function(typeMap, force) {
      for (let type in typeMap) {
        let extensions = typeMap[type].map(function(t13) {
          return t13.toLowerCase();
        });
        type = type.toLowerCase();
        for (let i7 = 0; i7 < extensions.length; i7++) {
          const ext2 = extensions[i7];
          if (ext2[0] === "*") {
            continue;
          }
          if (!force && ext2 in this._types) {
            throw new Error(
              'Attempt to change mapping for "' + ext2 + '" extension from "' + this._types[ext2] + '" to "' + type + '". Pass `force=true` to allow this, otherwise remove "' + ext2 + '" from the list of extensions for "' + type + '".'
            );
          }
          this._types[ext2] = type;
        }
        if (force || !this._extensions[type]) {
          const ext2 = extensions[0];
          this._extensions[type] = ext2[0] !== "*" ? ext2 : ext2.substr(1);
        }
      }
    };
    Mime2.prototype.getType = function(path84) {
      path84 = String(path84);
      let last = path84.replace(/^.*[/\\]/, "").toLowerCase();
      let ext2 = last.replace(/^.*\./, "").toLowerCase();
      let hasPath = last.length < path84.length;
      let hasDot = ext2.length < last.length - 1;
      return (hasDot || !hasPath) && this._types[ext2] || null;
    };
    Mime2.prototype.getExtension = function(type) {
      type = /^\s*([^;\s]*)/.test(type) && RegExp.$1;
      return type && this._extensions[type.toLowerCase()] || null;
    };
    module2.exports = Mime2;
  }
});

// ../../node_modules/.pnpm/mime@3.0.0/node_modules/mime/types/standard.js
var require_standard = __commonJS({
  "../../node_modules/.pnpm/mime@3.0.0/node_modules/mime/types/standard.js"(exports, module2) {
    init_import_meta_url();
    module2.exports = { "application/andrew-inset": ["ez"], "application/applixware": ["aw"], "application/atom+xml": ["atom"], "application/atomcat+xml": ["atomcat"], "application/atomdeleted+xml": ["atomdeleted"], "application/atomsvc+xml": ["atomsvc"], "application/atsc-dwd+xml": ["dwd"], "application/atsc-held+xml": ["held"], "application/atsc-rsat+xml": ["rsat"], "application/bdoc": ["bdoc"], "application/calendar+xml": ["xcs"], "application/ccxml+xml": ["ccxml"], "application/cdfx+xml": ["cdfx"], "application/cdmi-capability": ["cdmia"], "application/cdmi-container": ["cdmic"], "application/cdmi-domain": ["cdmid"], "application/cdmi-object": ["cdmio"], "application/cdmi-queue": ["cdmiq"], "application/cu-seeme": ["cu"], "application/dash+xml": ["mpd"], "application/davmount+xml": ["davmount"], "application/docbook+xml": ["dbk"], "application/dssc+der": ["dssc"], "application/dssc+xml": ["xdssc"], "application/ecmascript": ["es", "ecma"], "application/emma+xml": ["emma"], "application/emotionml+xml": ["emotionml"], "application/epub+zip": ["epub"], "application/exi": ["exi"], "application/express": ["exp"], "application/fdt+xml": ["fdt"], "application/font-tdpfr": ["pfr"], "application/geo+json": ["geojson"], "application/gml+xml": ["gml"], "application/gpx+xml": ["gpx"], "application/gxf": ["gxf"], "application/gzip": ["gz"], "application/hjson": ["hjson"], "application/hyperstudio": ["stk"], "application/inkml+xml": ["ink", "inkml"], "application/ipfix": ["ipfix"], "application/its+xml": ["its"], "application/java-archive": ["jar", "war", "ear"], "application/java-serialized-object": ["ser"], "application/java-vm": ["class"], "application/javascript": ["js", "mjs"], "application/json": ["json", "map"], "application/json5": ["json5"], "application/jsonml+json": ["jsonml"], "application/ld+json": ["jsonld"], "application/lgr+xml": ["lgr"], "application/lost+xml": ["lostxml"], "application/mac-binhex40": ["hqx"], "application/mac-compactpro": ["cpt"], "application/mads+xml": ["mads"], "application/manifest+json": ["webmanifest"], "application/marc": ["mrc"], "application/marcxml+xml": ["mrcx"], "application/mathematica": ["ma", "nb", "mb"], "application/mathml+xml": ["mathml"], "application/mbox": ["mbox"], "application/mediaservercontrol+xml": ["mscml"], "application/metalink+xml": ["metalink"], "application/metalink4+xml": ["meta4"], "application/mets+xml": ["mets"], "application/mmt-aei+xml": ["maei"], "application/mmt-usd+xml": ["musd"], "application/mods+xml": ["mods"], "application/mp21": ["m21", "mp21"], "application/mp4": ["mp4s", "m4p"], "application/msword": ["doc", "dot"], "application/mxf": ["mxf"], "application/n-quads": ["nq"], "application/n-triples": ["nt"], "application/node": ["cjs"], "application/octet-stream": ["bin", "dms", "lrf", "mar", "so", "dist", "distz", "pkg", "bpk", "dump", "elc", "deploy", "exe", "dll", "deb", "dmg", "iso", "img", "msi", "msp", "msm", "buffer"], "application/oda": ["oda"], "application/oebps-package+xml": ["opf"], "application/ogg": ["ogx"], "application/omdoc+xml": ["omdoc"], "application/onenote": ["onetoc", "onetoc2", "onetmp", "onepkg"], "application/oxps": ["oxps"], "application/p2p-overlay+xml": ["relo"], "application/patch-ops-error+xml": ["xer"], "application/pdf": ["pdf"], "application/pgp-encrypted": ["pgp"], "application/pgp-signature": ["asc", "sig"], "application/pics-rules": ["prf"], "application/pkcs10": ["p10"], "application/pkcs7-mime": ["p7m", "p7c"], "application/pkcs7-signature": ["p7s"], "application/pkcs8": ["p8"], "application/pkix-attr-cert": ["ac"], "application/pkix-cert": ["cer"], "application/pkix-crl": ["crl"], "application/pkix-pkipath": ["pkipath"], "application/pkixcmp": ["pki"], "application/pls+xml": ["pls"], "application/postscript": ["ai", "eps", "ps"], "application/provenance+xml": ["provx"], "application/pskc+xml": ["pskcxml"], "application/raml+yaml": ["raml"], "application/rdf+xml": ["rdf", "owl"], "application/reginfo+xml": ["rif"], "application/relax-ng-compact-syntax": ["rnc"], "application/resource-lists+xml": ["rl"], "application/resource-lists-diff+xml": ["rld"], "application/rls-services+xml": ["rs"], "application/route-apd+xml": ["rapd"], "application/route-s-tsid+xml": ["sls"], "application/route-usd+xml": ["rusd"], "application/rpki-ghostbusters": ["gbr"], "application/rpki-manifest": ["mft"], "application/rpki-roa": ["roa"], "application/rsd+xml": ["rsd"], "application/rss+xml": ["rss"], "application/rtf": ["rtf"], "application/sbml+xml": ["sbml"], "application/scvp-cv-request": ["scq"], "application/scvp-cv-response": ["scs"], "application/scvp-vp-request": ["spq"], "application/scvp-vp-response": ["spp"], "application/sdp": ["sdp"], "application/senml+xml": ["senmlx"], "application/sensml+xml": ["sensmlx"], "application/set-payment-initiation": ["setpay"], "application/set-registration-initiation": ["setreg"], "application/shf+xml": ["shf"], "application/sieve": ["siv", "sieve"], "application/smil+xml": ["smi", "smil"], "application/sparql-query": ["rq"], "application/sparql-results+xml": ["srx"], "application/srgs": ["gram"], "application/srgs+xml": ["grxml"], "application/sru+xml": ["sru"], "application/ssdl+xml": ["ssdl"], "application/ssml+xml": ["ssml"], "application/swid+xml": ["swidtag"], "application/tei+xml": ["tei", "teicorpus"], "application/thraud+xml": ["tfi"], "application/timestamped-data": ["tsd"], "application/toml": ["toml"], "application/trig": ["trig"], "application/ttml+xml": ["ttml"], "application/ubjson": ["ubj"], "application/urc-ressheet+xml": ["rsheet"], "application/urc-targetdesc+xml": ["td"], "application/voicexml+xml": ["vxml"], "application/wasm": ["wasm"], "application/widget": ["wgt"], "application/winhlp": ["hlp"], "application/wsdl+xml": ["wsdl"], "application/wspolicy+xml": ["wspolicy"], "application/xaml+xml": ["xaml"], "application/xcap-att+xml": ["xav"], "application/xcap-caps+xml": ["xca"], "application/xcap-diff+xml": ["xdf"], "application/xcap-el+xml": ["xel"], "application/xcap-ns+xml": ["xns"], "application/xenc+xml": ["xenc"], "application/xhtml+xml": ["xhtml", "xht"], "application/xliff+xml": ["xlf"], "application/xml": ["xml", "xsl", "xsd", "rng"], "application/xml-dtd": ["dtd"], "application/xop+xml": ["xop"], "application/xproc+xml": ["xpl"], "application/xslt+xml": ["*xsl", "xslt"], "application/xspf+xml": ["xspf"], "application/xv+xml": ["mxml", "xhvml", "xvml", "xvm"], "application/yang": ["yang"], "application/yin+xml": ["yin"], "application/zip": ["zip"], "audio/3gpp": ["*3gpp"], "audio/adpcm": ["adp"], "audio/amr": ["amr"], "audio/basic": ["au", "snd"], "audio/midi": ["mid", "midi", "kar", "rmi"], "audio/mobile-xmf": ["mxmf"], "audio/mp3": ["*mp3"], "audio/mp4": ["m4a", "mp4a"], "audio/mpeg": ["mpga", "mp2", "mp2a", "mp3", "m2a", "m3a"], "audio/ogg": ["oga", "ogg", "spx", "opus"], "audio/s3m": ["s3m"], "audio/silk": ["sil"], "audio/wav": ["wav"], "audio/wave": ["*wav"], "audio/webm": ["weba"], "audio/xm": ["xm"], "font/collection": ["ttc"], "font/otf": ["otf"], "font/ttf": ["ttf"], "font/woff": ["woff"], "font/woff2": ["woff2"], "image/aces": ["exr"], "image/apng": ["apng"], "image/avif": ["avif"], "image/bmp": ["bmp"], "image/cgm": ["cgm"], "image/dicom-rle": ["drle"], "image/emf": ["emf"], "image/fits": ["fits"], "image/g3fax": ["g3"], "image/gif": ["gif"], "image/heic": ["heic"], "image/heic-sequence": ["heics"], "image/heif": ["heif"], "image/heif-sequence": ["heifs"], "image/hej2k": ["hej2"], "image/hsj2": ["hsj2"], "image/ief": ["ief"], "image/jls": ["jls"], "image/jp2": ["jp2", "jpg2"], "image/jpeg": ["jpeg", "jpg", "jpe"], "image/jph": ["jph"], "image/jphc": ["jhc"], "image/jpm": ["jpm"], "image/jpx": ["jpx", "jpf"], "image/jxr": ["jxr"], "image/jxra": ["jxra"], "image/jxrs": ["jxrs"], "image/jxs": ["jxs"], "image/jxsc": ["jxsc"], "image/jxsi": ["jxsi"], "image/jxss": ["jxss"], "image/ktx": ["ktx"], "image/ktx2": ["ktx2"], "image/png": ["png"], "image/sgi": ["sgi"], "image/svg+xml": ["svg", "svgz"], "image/t38": ["t38"], "image/tiff": ["tif", "tiff"], "image/tiff-fx": ["tfx"], "image/webp": ["webp"], "image/wmf": ["wmf"], "message/disposition-notification": ["disposition-notification"], "message/global": ["u8msg"], "message/global-delivery-status": ["u8dsn"], "message/global-disposition-notification": ["u8mdn"], "message/global-headers": ["u8hdr"], "message/rfc822": ["eml", "mime"], "model/3mf": ["3mf"], "model/gltf+json": ["gltf"], "model/gltf-binary": ["glb"], "model/iges": ["igs", "iges"], "model/mesh": ["msh", "mesh", "silo"], "model/mtl": ["mtl"], "model/obj": ["obj"], "model/step+xml": ["stpx"], "model/step+zip": ["stpz"], "model/step-xml+zip": ["stpxz"], "model/stl": ["stl"], "model/vrml": ["wrl", "vrml"], "model/x3d+binary": ["*x3db", "x3dbz"], "model/x3d+fastinfoset": ["x3db"], "model/x3d+vrml": ["*x3dv", "x3dvz"], "model/x3d+xml": ["x3d", "x3dz"], "model/x3d-vrml": ["x3dv"], "text/cache-manifest": ["appcache", "manifest"], "text/calendar": ["ics", "ifb"], "text/coffeescript": ["coffee", "litcoffee"], "text/css": ["css"], "text/csv": ["csv"], "text/html": ["html", "htm", "shtml"], "text/jade": ["jade"], "text/jsx": ["jsx"], "text/less": ["less"], "text/markdown": ["markdown", "md"], "text/mathml": ["mml"], "text/mdx": ["mdx"], "text/n3": ["n3"], "text/plain": ["txt", "text", "conf", "def", "list", "log", "in", "ini"], "text/richtext": ["rtx"], "text/rtf": ["*rtf"], "text/sgml": ["sgml", "sgm"], "text/shex": ["shex"], "text/slim": ["slim", "slm"], "text/spdx": ["spdx"], "text/stylus": ["stylus", "styl"], "text/tab-separated-values": ["tsv"], "text/troff": ["t", "tr", "roff", "man", "me", "ms"], "text/turtle": ["ttl"], "text/uri-list": ["uri", "uris", "urls"], "text/vcard": ["vcard"], "text/vtt": ["vtt"], "text/xml": ["*xml"], "text/yaml": ["yaml", "yml"], "video/3gpp": ["3gp", "3gpp"], "video/3gpp2": ["3g2"], "video/h261": ["h261"], "video/h263": ["h263"], "video/h264": ["h264"], "video/iso.segment": ["m4s"], "video/jpeg": ["jpgv"], "video/jpm": ["*jpm", "jpgm"], "video/mj2": ["mj2", "mjp2"], "video/mp2t": ["ts"], "video/mp4": ["mp4", "mp4v", "mpg4"], "video/mpeg": ["mpeg", "mpg", "mpe", "m1v", "m2v"], "video/ogg": ["ogv"], "video/quicktime": ["qt", "mov"], "video/webm": ["webm"] };
  }
});

// ../../node_modules/.pnpm/mime@3.0.0/node_modules/mime/types/other.js
var require_other = __commonJS({
  "../../node_modules/.pnpm/mime@3.0.0/node_modules/mime/types/other.js"(exports, module2) {
    init_import_meta_url();
    module2.exports = { "application/prs.cww": ["cww"], "application/vnd.1000minds.decision-model+xml": ["1km"], "application/vnd.3gpp.pic-bw-large": ["plb"], "application/vnd.3gpp.pic-bw-small": ["psb"], "application/vnd.3gpp.pic-bw-var": ["pvb"], "application/vnd.3gpp2.tcap": ["tcap"], "application/vnd.3m.post-it-notes": ["pwn"], "application/vnd.accpac.simply.aso": ["aso"], "application/vnd.accpac.simply.imp": ["imp"], "application/vnd.acucobol": ["acu"], "application/vnd.acucorp": ["atc", "acutc"], "application/vnd.adobe.air-application-installer-package+zip": ["air"], "application/vnd.adobe.formscentral.fcdt": ["fcdt"], "application/vnd.adobe.fxp": ["fxp", "fxpl"], "application/vnd.adobe.xdp+xml": ["xdp"], "application/vnd.adobe.xfdf": ["xfdf"], "application/vnd.ahead.space": ["ahead"], "application/vnd.airzip.filesecure.azf": ["azf"], "application/vnd.airzip.filesecure.azs": ["azs"], "application/vnd.amazon.ebook": ["azw"], "application/vnd.americandynamics.acc": ["acc"], "application/vnd.amiga.ami": ["ami"], "application/vnd.android.package-archive": ["apk"], "application/vnd.anser-web-certificate-issue-initiation": ["cii"], "application/vnd.anser-web-funds-transfer-initiation": ["fti"], "application/vnd.antix.game-component": ["atx"], "application/vnd.apple.installer+xml": ["mpkg"], "application/vnd.apple.keynote": ["key"], "application/vnd.apple.mpegurl": ["m3u8"], "application/vnd.apple.numbers": ["numbers"], "application/vnd.apple.pages": ["pages"], "application/vnd.apple.pkpass": ["pkpass"], "application/vnd.aristanetworks.swi": ["swi"], "application/vnd.astraea-software.iota": ["iota"], "application/vnd.audiograph": ["aep"], "application/vnd.balsamiq.bmml+xml": ["bmml"], "application/vnd.blueice.multipass": ["mpm"], "application/vnd.bmi": ["bmi"], "application/vnd.businessobjects": ["rep"], "application/vnd.chemdraw+xml": ["cdxml"], "application/vnd.chipnuts.karaoke-mmd": ["mmd"], "application/vnd.cinderella": ["cdy"], "application/vnd.citationstyles.style+xml": ["csl"], "application/vnd.claymore": ["cla"], "application/vnd.cloanto.rp9": ["rp9"], "application/vnd.clonk.c4group": ["c4g", "c4d", "c4f", "c4p", "c4u"], "application/vnd.cluetrust.cartomobile-config": ["c11amc"], "application/vnd.cluetrust.cartomobile-config-pkg": ["c11amz"], "application/vnd.commonspace": ["csp"], "application/vnd.contact.cmsg": ["cdbcmsg"], "application/vnd.cosmocaller": ["cmc"], "application/vnd.crick.clicker": ["clkx"], "application/vnd.crick.clicker.keyboard": ["clkk"], "application/vnd.crick.clicker.palette": ["clkp"], "application/vnd.crick.clicker.template": ["clkt"], "application/vnd.crick.clicker.wordbank": ["clkw"], "application/vnd.criticaltools.wbs+xml": ["wbs"], "application/vnd.ctc-posml": ["pml"], "application/vnd.cups-ppd": ["ppd"], "application/vnd.curl.car": ["car"], "application/vnd.curl.pcurl": ["pcurl"], "application/vnd.dart": ["dart"], "application/vnd.data-vision.rdz": ["rdz"], "application/vnd.dbf": ["dbf"], "application/vnd.dece.data": ["uvf", "uvvf", "uvd", "uvvd"], "application/vnd.dece.ttml+xml": ["uvt", "uvvt"], "application/vnd.dece.unspecified": ["uvx", "uvvx"], "application/vnd.dece.zip": ["uvz", "uvvz"], "application/vnd.denovo.fcselayout-link": ["fe_launch"], "application/vnd.dna": ["dna"], "application/vnd.dolby.mlp": ["mlp"], "application/vnd.dpgraph": ["dpg"], "application/vnd.dreamfactory": ["dfac"], "application/vnd.ds-keypoint": ["kpxx"], "application/vnd.dvb.ait": ["ait"], "application/vnd.dvb.service": ["svc"], "application/vnd.dynageo": ["geo"], "application/vnd.ecowin.chart": ["mag"], "application/vnd.enliven": ["nml"], "application/vnd.epson.esf": ["esf"], "application/vnd.epson.msf": ["msf"], "application/vnd.epson.quickanime": ["qam"], "application/vnd.epson.salt": ["slt"], "application/vnd.epson.ssf": ["ssf"], "application/vnd.eszigno3+xml": ["es3", "et3"], "application/vnd.ezpix-album": ["ez2"], "application/vnd.ezpix-package": ["ez3"], "application/vnd.fdf": ["fdf"], "application/vnd.fdsn.mseed": ["mseed"], "application/vnd.fdsn.seed": ["seed", "dataless"], "application/vnd.flographit": ["gph"], "application/vnd.fluxtime.clip": ["ftc"], "application/vnd.framemaker": ["fm", "frame", "maker", "book"], "application/vnd.frogans.fnc": ["fnc"], "application/vnd.frogans.ltf": ["ltf"], "application/vnd.fsc.weblaunch": ["fsc"], "application/vnd.fujitsu.oasys": ["oas"], "application/vnd.fujitsu.oasys2": ["oa2"], "application/vnd.fujitsu.oasys3": ["oa3"], "application/vnd.fujitsu.oasysgp": ["fg5"], "application/vnd.fujitsu.oasysprs": ["bh2"], "application/vnd.fujixerox.ddd": ["ddd"], "application/vnd.fujixerox.docuworks": ["xdw"], "application/vnd.fujixerox.docuworks.binder": ["xbd"], "application/vnd.fuzzysheet": ["fzs"], "application/vnd.genomatix.tuxedo": ["txd"], "application/vnd.geogebra.file": ["ggb"], "application/vnd.geogebra.tool": ["ggt"], "application/vnd.geometry-explorer": ["gex", "gre"], "application/vnd.geonext": ["gxt"], "application/vnd.geoplan": ["g2w"], "application/vnd.geospace": ["g3w"], "application/vnd.gmx": ["gmx"], "application/vnd.google-apps.document": ["gdoc"], "application/vnd.google-apps.presentation": ["gslides"], "application/vnd.google-apps.spreadsheet": ["gsheet"], "application/vnd.google-earth.kml+xml": ["kml"], "application/vnd.google-earth.kmz": ["kmz"], "application/vnd.grafeq": ["gqf", "gqs"], "application/vnd.groove-account": ["gac"], "application/vnd.groove-help": ["ghf"], "application/vnd.groove-identity-message": ["gim"], "application/vnd.groove-injector": ["grv"], "application/vnd.groove-tool-message": ["gtm"], "application/vnd.groove-tool-template": ["tpl"], "application/vnd.groove-vcard": ["vcg"], "application/vnd.hal+xml": ["hal"], "application/vnd.handheld-entertainment+xml": ["zmm"], "application/vnd.hbci": ["hbci"], "application/vnd.hhe.lesson-player": ["les"], "application/vnd.hp-hpgl": ["hpgl"], "application/vnd.hp-hpid": ["hpid"], "application/vnd.hp-hps": ["hps"], "application/vnd.hp-jlyt": ["jlt"], "application/vnd.hp-pcl": ["pcl"], "application/vnd.hp-pclxl": ["pclxl"], "application/vnd.hydrostatix.sof-data": ["sfd-hdstx"], "application/vnd.ibm.minipay": ["mpy"], "application/vnd.ibm.modcap": ["afp", "listafp", "list3820"], "application/vnd.ibm.rights-management": ["irm"], "application/vnd.ibm.secure-container": ["sc"], "application/vnd.iccprofile": ["icc", "icm"], "application/vnd.igloader": ["igl"], "application/vnd.immervision-ivp": ["ivp"], "application/vnd.immervision-ivu": ["ivu"], "application/vnd.insors.igm": ["igm"], "application/vnd.intercon.formnet": ["xpw", "xpx"], "application/vnd.intergeo": ["i2g"], "application/vnd.intu.qbo": ["qbo"], "application/vnd.intu.qfx": ["qfx"], "application/vnd.ipunplugged.rcprofile": ["rcprofile"], "application/vnd.irepository.package+xml": ["irp"], "application/vnd.is-xpr": ["xpr"], "application/vnd.isac.fcs": ["fcs"], "application/vnd.jam": ["jam"], "application/vnd.jcp.javame.midlet-rms": ["rms"], "application/vnd.jisp": ["jisp"], "application/vnd.joost.joda-archive": ["joda"], "application/vnd.kahootz": ["ktz", "ktr"], "application/vnd.kde.karbon": ["karbon"], "application/vnd.kde.kchart": ["chrt"], "application/vnd.kde.kformula": ["kfo"], "application/vnd.kde.kivio": ["flw"], "application/vnd.kde.kontour": ["kon"], "application/vnd.kde.kpresenter": ["kpr", "kpt"], "application/vnd.kde.kspread": ["ksp"], "application/vnd.kde.kword": ["kwd", "kwt"], "application/vnd.kenameaapp": ["htke"], "application/vnd.kidspiration": ["kia"], "application/vnd.kinar": ["kne", "knp"], "application/vnd.koan": ["skp", "skd", "skt", "skm"], "application/vnd.kodak-descriptor": ["sse"], "application/vnd.las.las+xml": ["lasxml"], "application/vnd.llamagraphics.life-balance.desktop": ["lbd"], "application/vnd.llamagraphics.life-balance.exchange+xml": ["lbe"], "application/vnd.lotus-1-2-3": ["123"], "application/vnd.lotus-approach": ["apr"], "application/vnd.lotus-freelance": ["pre"], "application/vnd.lotus-notes": ["nsf"], "application/vnd.lotus-organizer": ["org"], "application/vnd.lotus-screencam": ["scm"], "application/vnd.lotus-wordpro": ["lwp"], "application/vnd.macports.portpkg": ["portpkg"], "application/vnd.mapbox-vector-tile": ["mvt"], "application/vnd.mcd": ["mcd"], "application/vnd.medcalcdata": ["mc1"], "application/vnd.mediastation.cdkey": ["cdkey"], "application/vnd.mfer": ["mwf"], "application/vnd.mfmp": ["mfm"], "application/vnd.micrografx.flo": ["flo"], "application/vnd.micrografx.igx": ["igx"], "application/vnd.mif": ["mif"], "application/vnd.mobius.daf": ["daf"], "application/vnd.mobius.dis": ["dis"], "application/vnd.mobius.mbk": ["mbk"], "application/vnd.mobius.mqy": ["mqy"], "application/vnd.mobius.msl": ["msl"], "application/vnd.mobius.plc": ["plc"], "application/vnd.mobius.txf": ["txf"], "application/vnd.mophun.application": ["mpn"], "application/vnd.mophun.certificate": ["mpc"], "application/vnd.mozilla.xul+xml": ["xul"], "application/vnd.ms-artgalry": ["cil"], "application/vnd.ms-cab-compressed": ["cab"], "application/vnd.ms-excel": ["xls", "xlm", "xla", "xlc", "xlt", "xlw"], "application/vnd.ms-excel.addin.macroenabled.12": ["xlam"], "application/vnd.ms-excel.sheet.binary.macroenabled.12": ["xlsb"], "application/vnd.ms-excel.sheet.macroenabled.12": ["xlsm"], "application/vnd.ms-excel.template.macroenabled.12": ["xltm"], "application/vnd.ms-fontobject": ["eot"], "application/vnd.ms-htmlhelp": ["chm"], "application/vnd.ms-ims": ["ims"], "application/vnd.ms-lrm": ["lrm"], "application/vnd.ms-officetheme": ["thmx"], "application/vnd.ms-outlook": ["msg"], "application/vnd.ms-pki.seccat": ["cat"], "application/vnd.ms-pki.stl": ["*stl"], "application/vnd.ms-powerpoint": ["ppt", "pps", "pot"], "application/vnd.ms-powerpoint.addin.macroenabled.12": ["ppam"], "application/vnd.ms-powerpoint.presentation.macroenabled.12": ["pptm"], "application/vnd.ms-powerpoint.slide.macroenabled.12": ["sldm"], "application/vnd.ms-powerpoint.slideshow.macroenabled.12": ["ppsm"], "application/vnd.ms-powerpoint.template.macroenabled.12": ["potm"], "application/vnd.ms-project": ["mpp", "mpt"], "application/vnd.ms-word.document.macroenabled.12": ["docm"], "application/vnd.ms-word.template.macroenabled.12": ["dotm"], "application/vnd.ms-works": ["wps", "wks", "wcm", "wdb"], "application/vnd.ms-wpl": ["wpl"], "application/vnd.ms-xpsdocument": ["xps"], "application/vnd.mseq": ["mseq"], "application/vnd.musician": ["mus"], "application/vnd.muvee.style": ["msty"], "application/vnd.mynfc": ["taglet"], "application/vnd.neurolanguage.nlu": ["nlu"], "application/vnd.nitf": ["ntf", "nitf"], "application/vnd.noblenet-directory": ["nnd"], "application/vnd.noblenet-sealer": ["nns"], "application/vnd.noblenet-web": ["nnw"], "application/vnd.nokia.n-gage.ac+xml": ["*ac"], "application/vnd.nokia.n-gage.data": ["ngdat"], "application/vnd.nokia.n-gage.symbian.install": ["n-gage"], "application/vnd.nokia.radio-preset": ["rpst"], "application/vnd.nokia.radio-presets": ["rpss"], "application/vnd.novadigm.edm": ["edm"], "application/vnd.novadigm.edx": ["edx"], "application/vnd.novadigm.ext": ["ext"], "application/vnd.oasis.opendocument.chart": ["odc"], "application/vnd.oasis.opendocument.chart-template": ["otc"], "application/vnd.oasis.opendocument.database": ["odb"], "application/vnd.oasis.opendocument.formula": ["odf"], "application/vnd.oasis.opendocument.formula-template": ["odft"], "application/vnd.oasis.opendocument.graphics": ["odg"], "application/vnd.oasis.opendocument.graphics-template": ["otg"], "application/vnd.oasis.opendocument.image": ["odi"], "application/vnd.oasis.opendocument.image-template": ["oti"], "application/vnd.oasis.opendocument.presentation": ["odp"], "application/vnd.oasis.opendocument.presentation-template": ["otp"], "application/vnd.oasis.opendocument.spreadsheet": ["ods"], "application/vnd.oasis.opendocument.spreadsheet-template": ["ots"], "application/vnd.oasis.opendocument.text": ["odt"], "application/vnd.oasis.opendocument.text-master": ["odm"], "application/vnd.oasis.opendocument.text-template": ["ott"], "application/vnd.oasis.opendocument.text-web": ["oth"], "application/vnd.olpc-sugar": ["xo"], "application/vnd.oma.dd2+xml": ["dd2"], "application/vnd.openblox.game+xml": ["obgx"], "application/vnd.openofficeorg.extension": ["oxt"], "application/vnd.openstreetmap.data+xml": ["osm"], "application/vnd.openxmlformats-officedocument.presentationml.presentation": ["pptx"], "application/vnd.openxmlformats-officedocument.presentationml.slide": ["sldx"], "application/vnd.openxmlformats-officedocument.presentationml.slideshow": ["ppsx"], "application/vnd.openxmlformats-officedocument.presentationml.template": ["potx"], "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": ["xlsx"], "application/vnd.openxmlformats-officedocument.spreadsheetml.template": ["xltx"], "application/vnd.openxmlformats-officedocument.wordprocessingml.document": ["docx"], "application/vnd.openxmlformats-officedocument.wordprocessingml.template": ["dotx"], "application/vnd.osgeo.mapguide.package": ["mgp"], "application/vnd.osgi.dp": ["dp"], "application/vnd.osgi.subsystem": ["esa"], "application/vnd.palm": ["pdb", "pqa", "oprc"], "application/vnd.pawaafile": ["paw"], "application/vnd.pg.format": ["str"], "application/vnd.pg.osasli": ["ei6"], "application/vnd.picsel": ["efif"], "application/vnd.pmi.widget": ["wg"], "application/vnd.pocketlearn": ["plf"], "application/vnd.powerbuilder6": ["pbd"], "application/vnd.previewsystems.box": ["box"], "application/vnd.proteus.magazine": ["mgz"], "application/vnd.publishare-delta-tree": ["qps"], "application/vnd.pvi.ptid1": ["ptid"], "application/vnd.quark.quarkxpress": ["qxd", "qxt", "qwd", "qwt", "qxl", "qxb"], "application/vnd.rar": ["rar"], "application/vnd.realvnc.bed": ["bed"], "application/vnd.recordare.musicxml": ["mxl"], "application/vnd.recordare.musicxml+xml": ["musicxml"], "application/vnd.rig.cryptonote": ["cryptonote"], "application/vnd.rim.cod": ["cod"], "application/vnd.rn-realmedia": ["rm"], "application/vnd.rn-realmedia-vbr": ["rmvb"], "application/vnd.route66.link66+xml": ["link66"], "application/vnd.sailingtracker.track": ["st"], "application/vnd.seemail": ["see"], "application/vnd.sema": ["sema"], "application/vnd.semd": ["semd"], "application/vnd.semf": ["semf"], "application/vnd.shana.informed.formdata": ["ifm"], "application/vnd.shana.informed.formtemplate": ["itp"], "application/vnd.shana.informed.interchange": ["iif"], "application/vnd.shana.informed.package": ["ipk"], "application/vnd.simtech-mindmapper": ["twd", "twds"], "application/vnd.smaf": ["mmf"], "application/vnd.smart.teacher": ["teacher"], "application/vnd.software602.filler.form+xml": ["fo"], "application/vnd.solent.sdkm+xml": ["sdkm", "sdkd"], "application/vnd.spotfire.dxp": ["dxp"], "application/vnd.spotfire.sfs": ["sfs"], "application/vnd.stardivision.calc": ["sdc"], "application/vnd.stardivision.draw": ["sda"], "application/vnd.stardivision.impress": ["sdd"], "application/vnd.stardivision.math": ["smf"], "application/vnd.stardivision.writer": ["sdw", "vor"], "application/vnd.stardivision.writer-global": ["sgl"], "application/vnd.stepmania.package": ["smzip"], "application/vnd.stepmania.stepchart": ["sm"], "application/vnd.sun.wadl+xml": ["wadl"], "application/vnd.sun.xml.calc": ["sxc"], "application/vnd.sun.xml.calc.template": ["stc"], "application/vnd.sun.xml.draw": ["sxd"], "application/vnd.sun.xml.draw.template": ["std"], "application/vnd.sun.xml.impress": ["sxi"], "application/vnd.sun.xml.impress.template": ["sti"], "application/vnd.sun.xml.math": ["sxm"], "application/vnd.sun.xml.writer": ["sxw"], "application/vnd.sun.xml.writer.global": ["sxg"], "application/vnd.sun.xml.writer.template": ["stw"], "application/vnd.sus-calendar": ["sus", "susp"], "application/vnd.svd": ["svd"], "application/vnd.symbian.install": ["sis", "sisx"], "application/vnd.syncml+xml": ["xsm"], "application/vnd.syncml.dm+wbxml": ["bdm"], "application/vnd.syncml.dm+xml": ["xdm"], "application/vnd.syncml.dmddf+xml": ["ddf"], "application/vnd.tao.intent-module-archive": ["tao"], "application/vnd.tcpdump.pcap": ["pcap", "cap", "dmp"], "application/vnd.tmobile-livetv": ["tmo"], "application/vnd.trid.tpt": ["tpt"], "application/vnd.triscape.mxs": ["mxs"], "application/vnd.trueapp": ["tra"], "application/vnd.ufdl": ["ufd", "ufdl"], "application/vnd.uiq.theme": ["utz"], "application/vnd.umajin": ["umj"], "application/vnd.unity": ["unityweb"], "application/vnd.uoml+xml": ["uoml"], "application/vnd.vcx": ["vcx"], "application/vnd.visio": ["vsd", "vst", "vss", "vsw"], "application/vnd.visionary": ["vis"], "application/vnd.vsf": ["vsf"], "application/vnd.wap.wbxml": ["wbxml"], "application/vnd.wap.wmlc": ["wmlc"], "application/vnd.wap.wmlscriptc": ["wmlsc"], "application/vnd.webturbo": ["wtb"], "application/vnd.wolfram.player": ["nbp"], "application/vnd.wordperfect": ["wpd"], "application/vnd.wqd": ["wqd"], "application/vnd.wt.stf": ["stf"], "application/vnd.xara": ["xar"], "application/vnd.xfdl": ["xfdl"], "application/vnd.yamaha.hv-dic": ["hvd"], "application/vnd.yamaha.hv-script": ["hvs"], "application/vnd.yamaha.hv-voice": ["hvp"], "application/vnd.yamaha.openscoreformat": ["osf"], "application/vnd.yamaha.openscoreformat.osfpvg+xml": ["osfpvg"], "application/vnd.yamaha.smaf-audio": ["saf"], "application/vnd.yamaha.smaf-phrase": ["spf"], "application/vnd.yellowriver-custom-menu": ["cmp"], "application/vnd.zul": ["zir", "zirz"], "application/vnd.zzazz.deck+xml": ["zaz"], "application/x-7z-compressed": ["7z"], "application/x-abiword": ["abw"], "application/x-ace-compressed": ["ace"], "application/x-apple-diskimage": ["*dmg"], "application/x-arj": ["arj"], "application/x-authorware-bin": ["aab", "x32", "u32", "vox"], "application/x-authorware-map": ["aam"], "application/x-authorware-seg": ["aas"], "application/x-bcpio": ["bcpio"], "application/x-bdoc": ["*bdoc"], "application/x-bittorrent": ["torrent"], "application/x-blorb": ["blb", "blorb"], "application/x-bzip": ["bz"], "application/x-bzip2": ["bz2", "boz"], "application/x-cbr": ["cbr", "cba", "cbt", "cbz", "cb7"], "application/x-cdlink": ["vcd"], "application/x-cfs-compressed": ["cfs"], "application/x-chat": ["chat"], "application/x-chess-pgn": ["pgn"], "application/x-chrome-extension": ["crx"], "application/x-cocoa": ["cco"], "application/x-conference": ["nsc"], "application/x-cpio": ["cpio"], "application/x-csh": ["csh"], "application/x-debian-package": ["*deb", "udeb"], "application/x-dgc-compressed": ["dgc"], "application/x-director": ["dir", "dcr", "dxr", "cst", "cct", "cxt", "w3d", "fgd", "swa"], "application/x-doom": ["wad"], "application/x-dtbncx+xml": ["ncx"], "application/x-dtbook+xml": ["dtb"], "application/x-dtbresource+xml": ["res"], "application/x-dvi": ["dvi"], "application/x-envoy": ["evy"], "application/x-eva": ["eva"], "application/x-font-bdf": ["bdf"], "application/x-font-ghostscript": ["gsf"], "application/x-font-linux-psf": ["psf"], "application/x-font-pcf": ["pcf"], "application/x-font-snf": ["snf"], "application/x-font-type1": ["pfa", "pfb", "pfm", "afm"], "application/x-freearc": ["arc"], "application/x-futuresplash": ["spl"], "application/x-gca-compressed": ["gca"], "application/x-glulx": ["ulx"], "application/x-gnumeric": ["gnumeric"], "application/x-gramps-xml": ["gramps"], "application/x-gtar": ["gtar"], "application/x-hdf": ["hdf"], "application/x-httpd-php": ["php"], "application/x-install-instructions": ["install"], "application/x-iso9660-image": ["*iso"], "application/x-iwork-keynote-sffkey": ["*key"], "application/x-iwork-numbers-sffnumbers": ["*numbers"], "application/x-iwork-pages-sffpages": ["*pages"], "application/x-java-archive-diff": ["jardiff"], "application/x-java-jnlp-file": ["jnlp"], "application/x-keepass2": ["kdbx"], "application/x-latex": ["latex"], "application/x-lua-bytecode": ["luac"], "application/x-lzh-compressed": ["lzh", "lha"], "application/x-makeself": ["run"], "application/x-mie": ["mie"], "application/x-mobipocket-ebook": ["prc", "mobi"], "application/x-ms-application": ["application"], "application/x-ms-shortcut": ["lnk"], "application/x-ms-wmd": ["wmd"], "application/x-ms-wmz": ["wmz"], "application/x-ms-xbap": ["xbap"], "application/x-msaccess": ["mdb"], "application/x-msbinder": ["obd"], "application/x-mscardfile": ["crd"], "application/x-msclip": ["clp"], "application/x-msdos-program": ["*exe"], "application/x-msdownload": ["*exe", "*dll", "com", "bat", "*msi"], "application/x-msmediaview": ["mvb", "m13", "m14"], "application/x-msmetafile": ["*wmf", "*wmz", "*emf", "emz"], "application/x-msmoney": ["mny"], "application/x-mspublisher": ["pub"], "application/x-msschedule": ["scd"], "application/x-msterminal": ["trm"], "application/x-mswrite": ["wri"], "application/x-netcdf": ["nc", "cdf"], "application/x-ns-proxy-autoconfig": ["pac"], "application/x-nzb": ["nzb"], "application/x-perl": ["pl", "pm"], "application/x-pilot": ["*prc", "*pdb"], "application/x-pkcs12": ["p12", "pfx"], "application/x-pkcs7-certificates": ["p7b", "spc"], "application/x-pkcs7-certreqresp": ["p7r"], "application/x-rar-compressed": ["*rar"], "application/x-redhat-package-manager": ["rpm"], "application/x-research-info-systems": ["ris"], "application/x-sea": ["sea"], "application/x-sh": ["sh"], "application/x-shar": ["shar"], "application/x-shockwave-flash": ["swf"], "application/x-silverlight-app": ["xap"], "application/x-sql": ["sql"], "application/x-stuffit": ["sit"], "application/x-stuffitx": ["sitx"], "application/x-subrip": ["srt"], "application/x-sv4cpio": ["sv4cpio"], "application/x-sv4crc": ["sv4crc"], "application/x-t3vm-image": ["t3"], "application/x-tads": ["gam"], "application/x-tar": ["tar"], "application/x-tcl": ["tcl", "tk"], "application/x-tex": ["tex"], "application/x-tex-tfm": ["tfm"], "application/x-texinfo": ["texinfo", "texi"], "application/x-tgif": ["*obj"], "application/x-ustar": ["ustar"], "application/x-virtualbox-hdd": ["hdd"], "application/x-virtualbox-ova": ["ova"], "application/x-virtualbox-ovf": ["ovf"], "application/x-virtualbox-vbox": ["vbox"], "application/x-virtualbox-vbox-extpack": ["vbox-extpack"], "application/x-virtualbox-vdi": ["vdi"], "application/x-virtualbox-vhd": ["vhd"], "application/x-virtualbox-vmdk": ["vmdk"], "application/x-wais-source": ["src"], "application/x-web-app-manifest+json": ["webapp"], "application/x-x509-ca-cert": ["der", "crt", "pem"], "application/x-xfig": ["fig"], "application/x-xliff+xml": ["*xlf"], "application/x-xpinstall": ["xpi"], "application/x-xz": ["xz"], "application/x-zmachine": ["z1", "z2", "z3", "z4", "z5", "z6", "z7", "z8"], "audio/vnd.dece.audio": ["uva", "uvva"], "audio/vnd.digital-winds": ["eol"], "audio/vnd.dra": ["dra"], "audio/vnd.dts": ["dts"], "audio/vnd.dts.hd": ["dtshd"], "audio/vnd.lucent.voice": ["lvp"], "audio/vnd.ms-playready.media.pya": ["pya"], "audio/vnd.nuera.ecelp4800": ["ecelp4800"], "audio/vnd.nuera.ecelp7470": ["ecelp7470"], "audio/vnd.nuera.ecelp9600": ["ecelp9600"], "audio/vnd.rip": ["rip"], "audio/x-aac": ["aac"], "audio/x-aiff": ["aif", "aiff", "aifc"], "audio/x-caf": ["caf"], "audio/x-flac": ["flac"], "audio/x-m4a": ["*m4a"], "audio/x-matroska": ["mka"], "audio/x-mpegurl": ["m3u"], "audio/x-ms-wax": ["wax"], "audio/x-ms-wma": ["wma"], "audio/x-pn-realaudio": ["ram", "ra"], "audio/x-pn-realaudio-plugin": ["rmp"], "audio/x-realaudio": ["*ra"], "audio/x-wav": ["*wav"], "chemical/x-cdx": ["cdx"], "chemical/x-cif": ["cif"], "chemical/x-cmdf": ["cmdf"], "chemical/x-cml": ["cml"], "chemical/x-csml": ["csml"], "chemical/x-xyz": ["xyz"], "image/prs.btif": ["btif"], "image/prs.pti": ["pti"], "image/vnd.adobe.photoshop": ["psd"], "image/vnd.airzip.accelerator.azv": ["azv"], "image/vnd.dece.graphic": ["uvi", "uvvi", "uvg", "uvvg"], "image/vnd.djvu": ["djvu", "djv"], "image/vnd.dvb.subtitle": ["*sub"], "image/vnd.dwg": ["dwg"], "image/vnd.dxf": ["dxf"], "image/vnd.fastbidsheet": ["fbs"], "image/vnd.fpx": ["fpx"], "image/vnd.fst": ["fst"], "image/vnd.fujixerox.edmics-mmr": ["mmr"], "image/vnd.fujixerox.edmics-rlc": ["rlc"], "image/vnd.microsoft.icon": ["ico"], "image/vnd.ms-dds": ["dds"], "image/vnd.ms-modi": ["mdi"], "image/vnd.ms-photo": ["wdp"], "image/vnd.net-fpx": ["npx"], "image/vnd.pco.b16": ["b16"], "image/vnd.tencent.tap": ["tap"], "image/vnd.valve.source.texture": ["vtf"], "image/vnd.wap.wbmp": ["wbmp"], "image/vnd.xiff": ["xif"], "image/vnd.zbrush.pcx": ["pcx"], "image/x-3ds": ["3ds"], "image/x-cmu-raster": ["ras"], "image/x-cmx": ["cmx"], "image/x-freehand": ["fh", "fhc", "fh4", "fh5", "fh7"], "image/x-icon": ["*ico"], "image/x-jng": ["jng"], "image/x-mrsid-image": ["sid"], "image/x-ms-bmp": ["*bmp"], "image/x-pcx": ["*pcx"], "image/x-pict": ["pic", "pct"], "image/x-portable-anymap": ["pnm"], "image/x-portable-bitmap": ["pbm"], "image/x-portable-graymap": ["pgm"], "image/x-portable-pixmap": ["ppm"], "image/x-rgb": ["rgb"], "image/x-tga": ["tga"], "image/x-xbitmap": ["xbm"], "image/x-xpixmap": ["xpm"], "image/x-xwindowdump": ["xwd"], "message/vnd.wfa.wsc": ["wsc"], "model/vnd.collada+xml": ["dae"], "model/vnd.dwf": ["dwf"], "model/vnd.gdl": ["gdl"], "model/vnd.gtw": ["gtw"], "model/vnd.mts": ["mts"], "model/vnd.opengex": ["ogex"], "model/vnd.parasolid.transmit.binary": ["x_b"], "model/vnd.parasolid.transmit.text": ["x_t"], "model/vnd.sap.vds": ["vds"], "model/vnd.usdz+zip": ["usdz"], "model/vnd.valve.source.compiled-map": ["bsp"], "model/vnd.vtu": ["vtu"], "text/prs.lines.tag": ["dsc"], "text/vnd.curl": ["curl"], "text/vnd.curl.dcurl": ["dcurl"], "text/vnd.curl.mcurl": ["mcurl"], "text/vnd.curl.scurl": ["scurl"], "text/vnd.dvb.subtitle": ["sub"], "text/vnd.fly": ["fly"], "text/vnd.fmi.flexstor": ["flx"], "text/vnd.graphviz": ["gv"], "text/vnd.in3d.3dml": ["3dml"], "text/vnd.in3d.spot": ["spot"], "text/vnd.sun.j2me.app-descriptor": ["jad"], "text/vnd.wap.wml": ["wml"], "text/vnd.wap.wmlscript": ["wmls"], "text/x-asm": ["s", "asm"], "text/x-c": ["c", "cc", "cxx", "cpp", "h", "hh", "dic"], "text/x-component": ["htc"], "text/x-fortran": ["f", "for", "f77", "f90"], "text/x-handlebars-template": ["hbs"], "text/x-java-source": ["java"], "text/x-lua": ["lua"], "text/x-markdown": ["mkd"], "text/x-nfo": ["nfo"], "text/x-opml": ["opml"], "text/x-org": ["*org"], "text/x-pascal": ["p", "pas"], "text/x-processing": ["pde"], "text/x-sass": ["sass"], "text/x-scss": ["scss"], "text/x-setext": ["etx"], "text/x-sfv": ["sfv"], "text/x-suse-ymp": ["ymp"], "text/x-uuencode": ["uu"], "text/x-vcalendar": ["vcs"], "text/x-vcard": ["vcf"], "video/vnd.dece.hd": ["uvh", "uvvh"], "video/vnd.dece.mobile": ["uvm", "uvvm"], "video/vnd.dece.pd": ["uvp", "uvvp"], "video/vnd.dece.sd": ["uvs", "uvvs"], "video/vnd.dece.video": ["uvv", "uvvv"], "video/vnd.dvb.file": ["dvb"], "video/vnd.fvt": ["fvt"], "video/vnd.mpegurl": ["mxu", "m4u"], "video/vnd.ms-playready.media.pyv": ["pyv"], "video/vnd.uvvu.mp4": ["uvu", "uvvu"], "video/vnd.vivo": ["viv"], "video/x-f4v": ["f4v"], "video/x-fli": ["fli"], "video/x-flv": ["flv"], "video/x-m4v": ["m4v"], "video/x-matroska": ["mkv", "mk3d", "mks"], "video/x-mng": ["mng"], "video/x-ms-asf": ["asf", "asx"], "video/x-ms-vob": ["vob"], "video/x-ms-wm": ["wm"], "video/x-ms-wmv": ["wmv"], "video/x-ms-wmx": ["wmx"], "video/x-ms-wvx": ["wvx"], "video/x-msvideo": ["avi"], "video/x-sgi-movie": ["movie"], "video/x-smv": ["smv"], "x-conference/x-cooltalk": ["ice"] };
  }
});

// ../../node_modules/.pnpm/mime@3.0.0/node_modules/mime/index.js
var require_mime = __commonJS({
  "../../node_modules/.pnpm/mime@3.0.0/node_modules/mime/index.js"(exports, module2) {
    init_import_meta_url();
    var Mime2 = require_Mime();
    module2.exports = new Mime2(require_standard(), require_other());
  }
});

// ../../node_modules/.pnpm/minimatch@5.1.6/node_modules/minimatch/lib/path.js
var require_path2 = __commonJS({
  "../../node_modules/.pnpm/minimatch@5.1.6/node_modules/minimatch/lib/path.js"(exports, module2) {
    init_import_meta_url();
    var isWindows5 = typeof process === "object" && process && process.platform === "win32";
    module2.exports = isWindows5 ? { sep: "\\" } : { sep: "/" };
  }
});

// ../../node_modules/.pnpm/minimatch@5.1.6/node_modules/minimatch/minimatch.js
var require_minimatch = __commonJS({
  "../../node_modules/.pnpm/minimatch@5.1.6/node_modules/minimatch/minimatch.js"(exports, module2) {
    init_import_meta_url();
    var minimatch2 = module2.exports = (p7, pattern, options = {}) => {
      assertValidPattern2(pattern);
      if (!options.nocomment && pattern.charAt(0) === "#") {
        return false;
      }
      return new Minimatch3(pattern, options).match(p7);
    };
    module2.exports = minimatch2;
    var path84 = require_path2();
    minimatch2.sep = path84.sep;
    var GLOBSTAR2 = Symbol("globstar **");
    minimatch2.GLOBSTAR = GLOBSTAR2;
    var expand2 = require_brace_expansion();
    var plTypes = {
      "!": { open: "(?:(?!(?:", close: "))[^/]*?)" },
      "?": { open: "(?:", close: ")?" },
      "+": { open: "(?:", close: ")+" },
      "*": { open: "(?:", close: ")*" },
      "@": { open: "(?:", close: ")" }
    };
    var qmark3 = "[^/]";
    var star3 = qmark3 + "*?";
    var twoStarDot2 = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";
    var twoStarNoDot2 = "(?:(?!(?:\\/|^)\\.).)*?";
    var charSet = /* @__PURE__ */ __name((s7) => s7.split("").reduce((set, c8) => {
      set[c8] = true;
      return set;
    }, {}), "charSet");
    var reSpecials2 = charSet("().*{}+?[]^$\\!");
    var addPatternStartSet = charSet("[.(");
    var slashSplit = /\/+/;
    minimatch2.filter = (pattern, options = {}) => (p7, i7, list) => minimatch2(p7, pattern, options);
    var ext2 = /* @__PURE__ */ __name((a7, b11 = {}) => {
      const t13 = {};
      Object.keys(a7).forEach((k7) => t13[k7] = a7[k7]);
      Object.keys(b11).forEach((k7) => t13[k7] = b11[k7]);
      return t13;
    }, "ext");
    minimatch2.defaults = (def) => {
      if (!def || typeof def !== "object" || !Object.keys(def).length) {
        return minimatch2;
      }
      const orig = minimatch2;
      const m7 = /* @__PURE__ */ __name((p7, pattern, options) => orig(p7, pattern, ext2(def, options)), "m");
      m7.Minimatch = class Minimatch extends orig.Minimatch {
        static {
          __name(this, "Minimatch");
        }
        constructor(pattern, options) {
          super(pattern, ext2(def, options));
        }
      };
      m7.Minimatch.defaults = (options) => orig.defaults(ext2(def, options)).Minimatch;
      m7.filter = (pattern, options) => orig.filter(pattern, ext2(def, options));
      m7.defaults = (options) => orig.defaults(ext2(def, options));
      m7.makeRe = (pattern, options) => orig.makeRe(pattern, ext2(def, options));
      m7.braceExpand = (pattern, options) => orig.braceExpand(pattern, ext2(def, options));
      m7.match = (list, pattern, options) => orig.match(list, pattern, ext2(def, options));
      return m7;
    };
    minimatch2.braceExpand = (pattern, options) => braceExpand2(pattern, options);
    var braceExpand2 = /* @__PURE__ */ __name((pattern, options = {}) => {
      assertValidPattern2(pattern);
      if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) {
        return [pattern];
      }
      return expand2(pattern);
    }, "braceExpand");
    var MAX_PATTERN_LENGTH2 = 1024 * 64;
    var assertValidPattern2 = /* @__PURE__ */ __name((pattern) => {
      if (typeof pattern !== "string") {
        throw new TypeError("invalid pattern");
      }
      if (pattern.length > MAX_PATTERN_LENGTH2) {
        throw new TypeError("pattern is too long");
      }
    }, "assertValidPattern");
    var SUBPARSE = Symbol("subparse");
    minimatch2.makeRe = (pattern, options) => new Minimatch3(pattern, options || {}).makeRe();
    minimatch2.match = (list, pattern, options = {}) => {
      const mm = new Minimatch3(pattern, options);
      list = list.filter((f8) => mm.match(f8));
      if (mm.options.nonull && !list.length) {
        list.push(pattern);
      }
      return list;
    };
    var globUnescape = /* @__PURE__ */ __name((s7) => s7.replace(/\\(.)/g, "$1"), "globUnescape");
    var charUnescape = /* @__PURE__ */ __name((s7) => s7.replace(/\\([^-\]])/g, "$1"), "charUnescape");
    var regExpEscape3 = /* @__PURE__ */ __name((s7) => s7.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), "regExpEscape");
    var braExpEscape = /* @__PURE__ */ __name((s7) => s7.replace(/[[\]\\]/g, "\\$&"), "braExpEscape");
    var Minimatch3 = class {
      static {
        __name(this, "Minimatch");
      }
      constructor(pattern, options) {
        assertValidPattern2(pattern);
        if (!options) options = {};
        this.options = options;
        this.set = [];
        this.pattern = pattern;
        this.windowsPathsNoEscape = !!options.windowsPathsNoEscape || options.allowWindowsEscape === false;
        if (this.windowsPathsNoEscape) {
          this.pattern = this.pattern.replace(/\\/g, "/");
        }
        this.regexp = null;
        this.negate = false;
        this.comment = false;
        this.empty = false;
        this.partial = !!options.partial;
        this.make();
      }
      debug() {
      }
      make() {
        const pattern = this.pattern;
        const options = this.options;
        if (!options.nocomment && pattern.charAt(0) === "#") {
          this.comment = true;
          return;
        }
        if (!pattern) {
          this.empty = true;
          return;
        }
        this.parseNegate();
        let set = this.globSet = this.braceExpand();
        if (options.debug) this.debug = (...args) => console.error(...args);
        this.debug(this.pattern, set);
        set = this.globParts = set.map((s7) => s7.split(slashSplit));
        this.debug(this.pattern, set);
        set = set.map((s7, si, set2) => s7.map(this.parse, this));
        this.debug(this.pattern, set);
        set = set.filter((s7) => s7.indexOf(false) === -1);
        this.debug(this.pattern, set);
        this.set = set;
      }
      parseNegate() {
        if (this.options.nonegate) return;
        const pattern = this.pattern;
        let negate3 = false;
        let negateOffset = 0;
        for (let i7 = 0; i7 < pattern.length && pattern.charAt(i7) === "!"; i7++) {
          negate3 = !negate3;
          negateOffset++;
        }
        if (negateOffset) this.pattern = pattern.slice(negateOffset);
        this.negate = negate3;
      }
      // set partial to true to test if, for example,
      // "/a/b" matches the start of "/*/b/*/d"
      // Partial means, if you run out of file before you run
      // out of pattern, then that's fine, as long as all
      // the parts match.
      matchOne(file3, pattern, partial) {
        var options = this.options;
        this.debug(
          "matchOne",
          { "this": this, file: file3, pattern }
        );
        this.debug("matchOne", file3.length, pattern.length);
        for (var fi = 0, pi = 0, fl = file3.length, pl2 = pattern.length; fi < fl && pi < pl2; fi++, pi++) {
          this.debug("matchOne loop");
          var p7 = pattern[pi];
          var f8 = file3[fi];
          this.debug(pattern, p7, f8);
          if (p7 === false) return false;
          if (p7 === GLOBSTAR2) {
            this.debug("GLOBSTAR", [pattern, p7, f8]);
            var fr2 = fi;
            var pr2 = pi + 1;
            if (pr2 === pl2) {
              this.debug("** at the end");
              for (; fi < fl; fi++) {
                if (file3[fi] === "." || file3[fi] === ".." || !options.dot && file3[fi].charAt(0) === ".") return false;
              }
              return true;
            }
            while (fr2 < fl) {
              var swallowee = file3[fr2];
              this.debug("\nglobstar while", file3, fr2, pattern, pr2, swallowee);
              if (this.matchOne(file3.slice(fr2), pattern.slice(pr2), partial)) {
                this.debug("globstar found match!", fr2, fl, swallowee);
                return true;
              } else {
                if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") {
                  this.debug("dot detected!", file3, fr2, pattern, pr2);
                  break;
                }
                this.debug("globstar swallow a segment, and continue");
                fr2++;
              }
            }
            if (partial) {
              this.debug("\n>>> no match, partial?", file3, fr2, pattern, pr2);
              if (fr2 === fl) return true;
            }
            return false;
          }
          var hit;
          if (typeof p7 === "string") {
            hit = f8 === p7;
            this.debug("string match", p7, f8, hit);
          } else {
            hit = f8.match(p7);
            this.debug("pattern match", p7, f8, hit);
          }
          if (!hit) return false;
        }
        if (fi === fl && pi === pl2) {
          return true;
        } else if (fi === fl) {
          return partial;
        } else if (pi === pl2) {
          return fi === fl - 1 && file3[fi] === "";
        }
        throw new Error("wtf?");
      }
      braceExpand() {
        return braceExpand2(this.pattern, this.options);
      }
      parse(pattern, isSub) {
        assertValidPattern2(pattern);
        const options = this.options;
        if (pattern === "**") {
          if (!options.noglobstar)
            return GLOBSTAR2;
          else
            pattern = "*";
        }
        if (pattern === "") return "";
        let re2 = "";
        let hasMagic = false;
        let escaping = false;
        const patternListStack = [];
        const negativeLists = [];
        let stateChar;
        let inClass = false;
        let reClassStart = -1;
        let classStart = -1;
        let cs2;
        let pl2;
        let sp;
        let dotTravAllowed = pattern.charAt(0) === ".";
        let dotFileAllowed = options.dot || dotTravAllowed;
        const patternStart = /* @__PURE__ */ __name(() => dotTravAllowed ? "" : dotFileAllowed ? "(?!(?:^|\\/)\\.{1,2}(?:$|\\/))" : "(?!\\.)", "patternStart");
        const subPatternStart = /* @__PURE__ */ __name((p7) => p7.charAt(0) === "." ? "" : options.dot ? "(?!(?:^|\\/)\\.{1,2}(?:$|\\/))" : "(?!\\.)", "subPatternStart");
        const clearStateChar = /* @__PURE__ */ __name(() => {
          if (stateChar) {
            switch (stateChar) {
              case "*":
                re2 += star3;
                hasMagic = true;
                break;
              case "?":
                re2 += qmark3;
                hasMagic = true;
                break;
              default:
                re2 += "\\" + stateChar;
                break;
            }
            this.debug("clearStateChar %j %j", stateChar, re2);
            stateChar = false;
          }
        }, "clearStateChar");
        for (let i7 = 0, c8; i7 < pattern.length && (c8 = pattern.charAt(i7)); i7++) {
          this.debug("%s	%s %s %j", pattern, i7, re2, c8);
          if (escaping) {
            if (c8 === "/") {
              return false;
            }
            if (reSpecials2[c8]) {
              re2 += "\\";
            }
            re2 += c8;
            escaping = false;
            continue;
          }
          switch (c8) {
            /* istanbul ignore next */
            case "/": {
              return false;
            }
            case "\\":
              if (inClass && pattern.charAt(i7 + 1) === "-") {
                re2 += c8;
                continue;
              }
              clearStateChar();
              escaping = true;
              continue;
            // the various stateChar values
            // for the "extglob" stuff.
            case "?":
            case "*":
            case "+":
            case "@":
            case "!":
              this.debug("%s	%s %s %j <-- stateChar", pattern, i7, re2, c8);
              if (inClass) {
                this.debug("  in class");
                if (c8 === "!" && i7 === classStart + 1) c8 = "^";
                re2 += c8;
                continue;
              }
              this.debug("call clearStateChar %j", stateChar);
              clearStateChar();
              stateChar = c8;
              if (options.noext) clearStateChar();
              continue;
            case "(": {
              if (inClass) {
                re2 += "(";
                continue;
              }
              if (!stateChar) {
                re2 += "\\(";
                continue;
              }
              const plEntry = {
                type: stateChar,
                start: i7 - 1,
                reStart: re2.length,
                open: plTypes[stateChar].open,
                close: plTypes[stateChar].close
              };
              this.debug(this.pattern, "	", plEntry);
              patternListStack.push(plEntry);
              re2 += plEntry.open;
              if (plEntry.start === 0 && plEntry.type !== "!") {
                dotTravAllowed = true;
                re2 += subPatternStart(pattern.slice(i7 + 1));
              }
              this.debug("plType %j %j", stateChar, re2);
              stateChar = false;
              continue;
            }
            case ")": {
              const plEntry = patternListStack[patternListStack.length - 1];
              if (inClass || !plEntry) {
                re2 += "\\)";
                continue;
              }
              patternListStack.pop();
              clearStateChar();
              hasMagic = true;
              pl2 = plEntry;
              re2 += pl2.close;
              if (pl2.type === "!") {
                negativeLists.push(Object.assign(pl2, { reEnd: re2.length }));
              }
              continue;
            }
            case "|": {
              const plEntry = patternListStack[patternListStack.length - 1];
              if (inClass || !plEntry) {
                re2 += "\\|";
                continue;
              }
              clearStateChar();
              re2 += "|";
              if (plEntry.start === 0 && plEntry.type !== "!") {
                dotTravAllowed = true;
                re2 += subPatternStart(pattern.slice(i7 + 1));
              }
              continue;
            }
            // these are mostly the same in regexp and glob
            case "[":
              clearStateChar();
              if (inClass) {
                re2 += "\\" + c8;
                continue;
              }
              inClass = true;
              classStart = i7;
              reClassStart = re2.length;
              re2 += c8;
              continue;
            case "]":
              if (i7 === classStart + 1 || !inClass) {
                re2 += "\\" + c8;
                continue;
              }
              cs2 = pattern.substring(classStart + 1, i7);
              try {
                RegExp("[" + braExpEscape(charUnescape(cs2)) + "]");
                re2 += c8;
              } catch (er2) {
                re2 = re2.substring(0, reClassStart) + "(?:$.)";
              }
              hasMagic = true;
              inClass = false;
              continue;
            default:
              clearStateChar();
              if (reSpecials2[c8] && !(c8 === "^" && inClass)) {
                re2 += "\\";
              }
              re2 += c8;
              break;
          }
        }
        if (inClass) {
          cs2 = pattern.slice(classStart + 1);
          sp = this.parse(cs2, SUBPARSE);
          re2 = re2.substring(0, reClassStart) + "\\[" + sp[0];
          hasMagic = hasMagic || sp[1];
        }
        for (pl2 = patternListStack.pop(); pl2; pl2 = patternListStack.pop()) {
          let tail;
          tail = re2.slice(pl2.reStart + pl2.open.length);
          this.debug("setting tail", re2, pl2);
          tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, (_5, $1, $22) => {
            if (!$22) {
              $22 = "\\";
            }
            return $1 + $1 + $22 + "|";
          });
          this.debug("tail=%j\n   %s", tail, tail, pl2, re2);
          const t13 = pl2.type === "*" ? star3 : pl2.type === "?" ? qmark3 : "\\" + pl2.type;
          hasMagic = true;
          re2 = re2.slice(0, pl2.reStart) + t13 + "\\(" + tail;
        }
        clearStateChar();
        if (escaping) {
          re2 += "\\\\";
        }
        const addPatternStart2 = addPatternStartSet[re2.charAt(0)];
        for (let n9 = negativeLists.length - 1; n9 > -1; n9--) {
          const nl = negativeLists[n9];
          const nlBefore = re2.slice(0, nl.reStart);
          const nlFirst = re2.slice(nl.reStart, nl.reEnd - 8);
          let nlAfter = re2.slice(nl.reEnd);
          const nlLast = re2.slice(nl.reEnd - 8, nl.reEnd) + nlAfter;
          const closeParensBefore = nlBefore.split(")").length;
          const openParensBefore = nlBefore.split("(").length - closeParensBefore;
          let cleanAfter = nlAfter;
          for (let i7 = 0; i7 < openParensBefore; i7++) {
            cleanAfter = cleanAfter.replace(/\)[+*?]?/, "");
          }
          nlAfter = cleanAfter;
          const dollar = nlAfter === "" && isSub !== SUBPARSE ? "(?:$|\\/)" : "";
          re2 = nlBefore + nlFirst + nlAfter + dollar + nlLast;
        }
        if (re2 !== "" && hasMagic) {
          re2 = "(?=.)" + re2;
        }
        if (addPatternStart2) {
          re2 = patternStart() + re2;
        }
        if (isSub === SUBPARSE) {
          return [re2, hasMagic];
        }
        if (options.nocase && !hasMagic) {
          hasMagic = pattern.toUpperCase() !== pattern.toLowerCase();
        }
        if (!hasMagic) {
          return globUnescape(pattern);
        }
        const flags2 = options.nocase ? "i" : "";
        try {
          return Object.assign(new RegExp("^" + re2 + "$", flags2), {
            _glob: pattern,
            _src: re2
          });
        } catch (er2) {
          return new RegExp("$.");
        }
      }
      makeRe() {
        if (this.regexp || this.regexp === false) return this.regexp;
        const set = this.set;
        if (!set.length) {
          this.regexp = false;
          return this.regexp;
        }
        const options = this.options;
        const twoStar = options.noglobstar ? star3 : options.dot ? twoStarDot2 : twoStarNoDot2;
        const flags2 = options.nocase ? "i" : "";
        let re2 = set.map((pattern) => {
          pattern = pattern.map(
            (p7) => typeof p7 === "string" ? regExpEscape3(p7) : p7 === GLOBSTAR2 ? GLOBSTAR2 : p7._src
          ).reduce((set2, p7) => {
            if (!(set2[set2.length - 1] === GLOBSTAR2 && p7 === GLOBSTAR2)) {
              set2.push(p7);
            }
            return set2;
          }, []);
          pattern.forEach((p7, i7) => {
            if (p7 !== GLOBSTAR2 || pattern[i7 - 1] === GLOBSTAR2) {
              return;
            }
            if (i7 === 0) {
              if (pattern.length > 1) {
                pattern[i7 + 1] = "(?:\\/|" + twoStar + "\\/)?" + pattern[i7 + 1];
              } else {
                pattern[i7] = twoStar;
              }
            } else if (i7 === pattern.length - 1) {
              pattern[i7 - 1] += "(?:\\/|" + twoStar + ")?";
            } else {
              pattern[i7 - 1] += "(?:\\/|\\/" + twoStar + "\\/)" + pattern[i7 + 1];
              pattern[i7 + 1] = GLOBSTAR2;
            }
          });
          return pattern.filter((p7) => p7 !== GLOBSTAR2).join("/");
        }).join("|");
        re2 = "^(?:" + re2 + ")$";
        if (this.negate) re2 = "^(?!" + re2 + ").*$";
        try {
          this.regexp = new RegExp(re2, flags2);
        } catch (ex) {
          this.regexp = false;
        }
        return this.regexp;
      }
      match(f8, partial = this.partial) {
        this.debug("match", f8, this.pattern);
        if (this.comment) return false;
        if (this.empty) return f8 === "";
        if (f8 === "/" && partial) return true;
        const options = this.options;
        if (path84.sep !== "/") {
          f8 = f8.split(path84.sep).join("/");
        }
        f8 = f8.split(slashSplit);
        this.debug(this.pattern, "split", f8);
        const set = this.set;
        this.debug(this.pattern, "set", set);
        let filename;
        for (let i7 = f8.length - 1; i7 >= 0; i7--) {
          filename = f8[i7];
          if (filename) break;
        }
        for (let i7 = 0; i7 < set.length; i7++) {
          const pattern = set[i7];
          let file3 = f8;
          if (options.matchBase && pattern.length === 1) {
            file3 = [filename];
          }
          const hit = this.matchOne(file3, pattern, partial);
          if (hit) {
            if (options.flipNegate) return true;
            return !this.negate;
          }
        }
        if (options.flipNegate) return false;
        return this.negate;
      }
      static defaults(def) {
        return minimatch2.defaults(def).Minimatch;
      }
    };
    minimatch2.Minimatch = Minimatch3;
  }
});
var hashFile;
var init_hash = __esm({
  "src/pages/hash.ts"() {
    init_import_meta_url();
    hashFile = /* @__PURE__ */ __name((filepath) => {
      const contents = fs29.readFileSync(filepath);
      const base64Contents = contents.toString("base64");
      const extension = path3.extname(filepath).substring(1);
      return blake3Wasm.hash(base64Contents + extension).toString("hex").slice(0, 32);
    }, "hashFile");
  }
});
var import_mime2, import_minimatch2, pagesProjectValidateCommand, validate;
var init_validate3 = __esm({
  "src/pages/validate.ts"() {
    init_import_meta_url();
    init_dist();
    import_mime2 = __toESM(require_mime());
    import_minimatch2 = __toESM(require_minimatch());
    init_pretty_bytes();
    init_create_command();
    init_constants3();
    init_hash();
    init_upload4();
    pagesProjectValidateCommand = createCommand({
      metadata: {
        description: "Validate a Pages project",
        status: "stable",
        owner: "Workers: Authoring and Testing",
        hidden: true
      },
      behaviour: {
        provideConfig: false
      },
      args: {
        directory: {
          type: "string",
          demandOption: true,
          description: "The directory of static files to validate"
        }
      },
      positionalArgs: ["directory"],
      async handler({ directory }) {
        if (!directory) {
          throw new FatalError("Must specify a directory.", 1);
        }
        const fileCountLimit = process.env.CF_PAGES_UPLOAD_JWT ? maxFileCountAllowedFromClaims(process.env.CF_PAGES_UPLOAD_JWT) : void 0;
        await validate({
          directory,
          fileCountLimit
        });
      }
    });
    validate = /* @__PURE__ */ __name(async (args) => {
      const IGNORE_LIST = [
        "_worker.js",
        "_redirects",
        "_headers",
        "_routes.json",
        "functions",
        "**/.DS_Store",
        "**/node_modules",
        "**/.git",
        ".wrangler"
      ].map((pattern) => new import_minimatch2.Minimatch(pattern));
      const directory = path3.resolve(args.directory);
      const fileCountLimit = args.fileCountLimit ?? MAX_ASSET_COUNT_DEFAULT;
      const walk = /* @__PURE__ */ __name(async (dir2, fileMap2 = /* @__PURE__ */ new Map(), startingDir = dir2) => {
        let files;
        try {
          files = await fs9.readdir(dir2);
        } catch (e10) {
          if (e10.code === "ENOENT") {
            throw new FatalError(e10.message);
          }
          throw e10;
        }
        await Promise.all(
          files.map(async (file3) => {
            const filepath = path3.join(dir2, file3);
            const relativeFilepath = path3.relative(startingDir, filepath);
            const filestat = await fs9.stat(filepath);
            for (const minimatch2 of IGNORE_LIST) {
              if (minimatch2.match(relativeFilepath)) {
                return;
              }
            }
            if (filestat.isSymbolicLink()) {
              return;
            }
            if (filestat.isDirectory()) {
              fileMap2 = await walk(filepath, fileMap2, startingDir);
            } else {
              const name2 = relativeFilepath.split(path3.sep).join("/");
              if (filestat.size > MAX_ASSET_SIZE2) {
                throw new FatalError(
                  `Error: Pages only supports files up to ${prettyBytes(
                    MAX_ASSET_SIZE2,
                    { binary: true }
                  )} in size
${name2} is ${prettyBytes(filestat.size, {
                    binary: true
                  })} in size`,
                  1
                );
              }
              fileMap2.set(name2, {
                path: filepath,
                contentType: (0, import_mime2.getType)(name2) || "application/octet-stream",
                sizeInBytes: filestat.size,
                hash: hashFile(filepath)
              });
            }
          })
        );
        return fileMap2;
      }, "walk");
      const fileMap = await walk(directory);
      if (fileMap.size > fileCountLimit) {
        throw new FatalError(
          `Error: Pages only supports up to ${fileCountLimit.toLocaleString()} files in a deployment for your current plan. Ensure you have specified your build output directory correctly.`,
          1
        );
      }
      return fileMap;
    }, "validate");
  }
});
function formatTime(duration) {
  return `(${(duration / 1e3).toFixed(2)} sec)`;
}
function renderProgress(done, total) {
  const s7 = spinner();
  if (isInteractive3()) {
    s7.start(`Uploading... (${done}/${total})
`);
    return {
      update: /* @__PURE__ */ __name((d8, t13) => s7.update(`Uploading... (${d8}/${t13})
`), "update"),
      stop: s7.stop
    };
  } else {
    logger.log(`Uploading... (${done}/${total})`);
    return {
      update: /* @__PURE__ */ __name((d8, t13) => logger.log(`Uploading... (${d8}/${t13})`), "update"),
      stop: /* @__PURE__ */ __name(() => {
      }, "stop")
    };
  }
}
var pagesProjectUploadCommand, upload, isJwtExpired, maxFileCountAllowedFromClaims;
var init_upload4 = __esm({
  "src/pages/upload.ts"() {
    init_import_meta_url();
    init_interactive();
    init_dist();
    init_dist6();
    init_cfetch();
    init_create_command();
    init_is_interactive();
    init_logger();
    init_constants3();
    init_errors2();
    init_validate3();
    pagesProjectUploadCommand = createCommand({
      metadata: {
        description: "Upload files to a project",
        status: "stable",
        owner: "Workers: Authoring and Testing",
        hidden: true
      },
      behaviour: {
        provideConfig: false
      },
      args: {
        directory: {
          type: "string",
          demandOption: true,
          description: "The directory of static files to upload"
        },
        "output-manifest-path": {
          type: "string",
          description: "The name of the project you want to deploy to"
        },
        "skip-caching": {
          type: "boolean",
          description: "Skip asset caching which speeds up builds"
        }
      },
      positionalArgs: ["directory"],
      async handler({ directory, outputManifestPath, skipCaching }) {
        if (!directory) {
          throw new FatalError("Must specify a directory.", 1);
        }
        if (!process.env.CF_PAGES_UPLOAD_JWT) {
          throw new FatalError("No JWT given.", 1);
        }
        const fileMap = await validate({
          directory,
          fileCountLimit: maxFileCountAllowedFromClaims(
            process.env.CF_PAGES_UPLOAD_JWT
          )
        });
        const manifest = await upload({
          fileMap,
          jwt: process.env.CF_PAGES_UPLOAD_JWT,
          skipCaching: skipCaching ?? false
        });
        if (outputManifestPath) {
          await fs9.mkdir(path3.dirname(outputManifestPath), { recursive: true });
          await fs9.writeFile(outputManifestPath, JSON.stringify(manifest));
        }
        logger.log(`\u2728 Upload complete!`);
      }
    });
    upload = /* @__PURE__ */ __name(async (args) => {
      async function fetchJwt() {
        if ("jwt" in args) {
          return args.jwt;
        } else {
          return (await fetchResult(
            COMPLIANCE_REGION_CONFIG_PUBLIC,
            `/accounts/${args.accountId}/pages/projects/${args.projectName}/upload-token`
          )).jwt;
        }
      }
      __name(fetchJwt, "fetchJwt");
      const files = [...args.fileMap.values()];
      let jwt = await fetchJwt();
      const start = Date.now();
      let attempts = 0;
      const getMissingHashes = /* @__PURE__ */ __name(async (skipCaching) => {
        if (skipCaching) {
          logger.debug("Force skipping cache");
          return files.map(({ hash }) => hash);
        }
        try {
          return await fetchResult(
            COMPLIANCE_REGION_CONFIG_PUBLIC,
            `/pages/assets/check-missing`,
            {
              method: "POST",
              headers: {
                "Content-Type": "application/json",
                Authorization: `Bearer ${jwt}`
              },
              body: JSON.stringify({
                hashes: files.map(({ hash }) => hash)
              })
            }
          );
        } catch (e10) {
          if (attempts < MAX_CHECK_MISSING_ATTEMPTS) {
            await new Promise(
              (resolvePromise) => setTimeout(resolvePromise, Math.pow(2, attempts++) * 1e3)
            );
            if (e10.code === 8000013 /* UNAUTHORIZED */ || isJwtExpired(jwt)) {
              jwt = await fetchJwt();
            }
            return getMissingHashes(skipCaching);
          } else {
            throw e10;
          }
        }
      }, "getMissingHashes");
      const missingHashes = await getMissingHashes(args.skipCaching);
      const sortedFiles = files.filter((file3) => missingHashes.includes(file3.hash)).sort((a7, b11) => b11.sizeInBytes - a7.sizeInBytes);
      const buckets = new Array(BULK_UPLOAD_CONCURRENCY).fill(null).map(() => ({
        files: [],
        remainingSize: MAX_BUCKET_SIZE
      }));
      let bucketOffset = 0;
      for (const file3 of sortedFiles) {
        let inserted = false;
        for (let i7 = 0; i7 < buckets.length; i7++) {
          const bucket = buckets[(i7 + bucketOffset) % buckets.length];
          if (bucket.remainingSize >= file3.sizeInBytes && bucket.files.length < MAX_BUCKET_FILE_COUNT) {
            bucket.files.push(file3);
            bucket.remainingSize -= file3.sizeInBytes;
            inserted = true;
            break;
          }
        }
        if (!inserted) {
          buckets.push({
            files: [file3],
            remainingSize: MAX_BUCKET_SIZE - file3.sizeInBytes
          });
        }
        bucketOffset++;
      }
      let counter = args.fileMap.size - sortedFiles.length;
      const { update, stop } = renderProgress(counter, args.fileMap.size);
      const queue = new PQueue({ concurrency: BULK_UPLOAD_CONCURRENCY });
      const queuePromises = [];
      for (const bucket of buckets) {
        if (bucket.files.length === 0) {
          continue;
        }
        attempts = 0;
        let gatewayErrors = 0;
        const doUpload = /* @__PURE__ */ __name(async () => {
          const payload = await Promise.all(
            bucket.files.map(async (file3) => ({
              key: file3.hash,
              value: (await fs9.readFile(file3.path)).toString("base64"),
              metadata: {
                contentType: file3.contentType
              },
              base64: true
            }))
          );
          try {
            logger.debug("POST /pages/assets/upload");
            const res = await fetchResult(
              COMPLIANCE_REGION_CONFIG_PUBLIC,
              `/pages/assets/upload`,
              {
                method: "POST",
                headers: {
                  "Content-Type": "application/json",
                  Authorization: `Bearer ${jwt}`
                },
                body: JSON.stringify(payload)
              }
            );
            logger.debug("result:", res);
          } catch (e10) {
            if (attempts < MAX_UPLOAD_ATTEMPTS) {
              logger.debug("failed:", e10, "retrying...");
              await new Promise(
                (resolvePromise) => setTimeout(resolvePromise, Math.pow(2, attempts) * 1e3)
              );
              if (e10 instanceof APIError && e10.isGatewayError()) {
                queue.concurrency = 1;
                await new Promise(
                  (resolvePromise) => setTimeout(resolvePromise, Math.pow(2, gatewayErrors) * 5e3)
                );
                gatewayErrors++;
                if (gatewayErrors >= MAX_UPLOAD_GATEWAY_ERRORS) {
                  attempts++;
                }
              } else if (e10.code === 8000013 /* UNAUTHORIZED */ || isJwtExpired(jwt)) {
                jwt = await fetchJwt();
              } else {
                attempts++;
              }
              return doUpload();
            } else {
              logger.debug("failed:", e10);
              throw e10;
            }
          }
        }, "doUpload");
        queuePromises.push(
          queue.add(
            () => doUpload().then(
              () => {
                counter += bucket.files.length;
                update(counter, args.fileMap.size);
              },
              (error2) => {
                return Promise.reject(
                  new FatalError(
                    `Failed to upload files. Please try again. Error: ${JSON.stringify(
                      error2
                    )})`,
                    error2.code || 1
                  )
                );
              }
            )
          )
        );
      }
      await Promise.all(queuePromises);
      stop();
      const uploadMs = Date.now() - start;
      const skipped = args.fileMap.size - missingHashes.length;
      const skippedMessage = skipped > 0 ? `(${skipped} already uploaded) ` : "";
      logger.log(
        `\u2728 Success! Uploaded ${sortedFiles.length} files ${skippedMessage}${formatTime(uploadMs)}
`
      );
      const doUpsertHashes = /* @__PURE__ */ __name(async () => {
        try {
          return await fetchResult(
            COMPLIANCE_REGION_CONFIG_PUBLIC,
            `/pages/assets/upsert-hashes`,
            {
              method: "POST",
              headers: {
                "Content-Type": "application/json",
                Authorization: `Bearer ${jwt}`
              },
              body: JSON.stringify({
                hashes: files.map(({ hash }) => hash)
              })
            }
          );
        } catch (e10) {
          await new Promise((resolvePromise) => setTimeout(resolvePromise, 1e3));
          if (e10.code === 8000013 /* UNAUTHORIZED */ || isJwtExpired(jwt)) {
            jwt = await fetchJwt();
          }
          return await fetchResult(
            COMPLIANCE_REGION_CONFIG_PUBLIC,
            `/pages/assets/upsert-hashes`,
            {
              method: "POST",
              headers: {
                "Content-Type": "application/json",
                Authorization: `Bearer ${jwt}`
              },
              body: JSON.stringify({
                hashes: files.map(({ hash }) => hash)
              })
            }
          );
        }
      }, "doUpsertHashes");
      try {
        await doUpsertHashes();
      } catch {
        logger.warn(
          "Failed to update file hashes. Every upload appeared to succeed for this deployment, but you might need to re-upload for future deployments. This shouldn't have any impact other than slowing the upload speed of your next deployment."
        );
      }
      return Object.fromEntries(
        [...args.fileMap.entries()].map(([fileName, file3]) => [
          `/${fileName}`,
          file3.hash
        ])
      );
    }, "upload");
    isJwtExpired = /* @__PURE__ */ __name((token) => {
      if (typeof vitest !== "undefined" && (token === "<<funfetti-auth-jwt>>" || token === "<<funfetti-auth-jwt2>>" || token === "<<aus-completion-token>>")) {
        return false;
      }
      try {
        const decodedJwt = JSON.parse(
          Buffer.from(token.split(".")[1], "base64").toString()
        );
        const dateNow = (/* @__PURE__ */ new Date()).getTime() / 1e3;
        return decodedJwt.exp <= dateNow;
      } catch (e10) {
        if (e10 instanceof Error) {
          throw new Error(`Invalid token: ${e10.message}`);
        }
      }
    }, "isJwtExpired");
    maxFileCountAllowedFromClaims = /* @__PURE__ */ __name((token) => {
      if (typeof vitest !== "undefined" && (token === "<<funfetti-auth-jwt>>" || token === "<<funfetti-auth-jwt2>>" || token === "<<aus-completion-token>>")) {
        return MAX_ASSET_COUNT_DEFAULT;
      }
      try {
        const decodedJwt = JSON.parse(
          Buffer.from(token.split(".")[1], "base64").toString()
        );
        const maxFileCountAllowed = decodedJwt["max_file_count_allowed"];
        if (typeof maxFileCountAllowed == "number") {
          return maxFileCountAllowed;
        }
        return MAX_ASSET_COUNT_DEFAULT;
      } catch (e10) {
        if (e10 instanceof Error) {
          throw new Error(`Invalid token: ${e10.message}`);
        }
        return MAX_ASSET_COUNT_DEFAULT;
      }
    }, "maxFileCountAllowedFromClaims");
    __name(formatTime, "formatTime");
    __name(renderProgress, "renderProgress");
  }
});
async function deploy2({
  directory,
  accountId,
  projectName,
  branch,
  skipCaching,
  commitMessage,
  commitHash,
  commitDirty,
  functionsDirectory: customFunctionsDirectory,
  bundle,
  sourceMaps,
  args
}) {
  let _headers, _redirects, _routesGenerated, _routesCustom, _workerJSIsDirectory = false, _workerJS;
  bundle = bundle ?? true;
  const _workerPath = path3.resolve(directory, "_worker.js");
  try {
    _headers = fs29.readFileSync(path3.join(directory, "_headers"), "utf-8");
  } catch {
  }
  try {
    _redirects = fs29.readFileSync(path3.join(directory, "_redirects"), "utf-8");
  } catch {
  }
  try {
    _routesCustom = fs29.readFileSync(path3.join(directory, "_routes.json"), "utf-8");
  } catch {
  }
  const workerJSStats = fs29.lstatSync(_workerPath, { throwIfNoEntry: false });
  _workerJSIsDirectory = workerJSStats?.isDirectory() ?? false;
  if (workerJSStats !== void 0 && !_workerJSIsDirectory) {
    _workerJS = fs29.readFileSync(_workerPath, "utf-8");
  }
  const project = await fetchResult(
    COMPLIANCE_REGION_CONFIG_PUBLIC,
    `/accounts/${accountId}/pages/projects/${projectName}`
  );
  let isProduction = true;
  if (branch) {
    isProduction = project.production_branch === branch;
  }
  const env6 = isProduction ? "production" : "preview";
  const deploymentConfig = project.deployment_configs[env6];
  let config;
  try {
    config = readPagesConfig(
      { ...args, env: env6 },
      { useRedirectIfAvailable: true }
    );
  } catch (err) {
    if (!(err instanceof FatalError && err.code === EXIT_CODE_INVALID_PAGES_CONFIG)) {
      throw err;
    }
  }
  const nodejsCompatMode = validateNodeCompatMode(
    config?.compatibility_date ?? deploymentConfig.compatibility_date,
    config?.compatibility_flags ?? deploymentConfig.compatibility_flags ?? [],
    {
      noBundle: config?.no_bundle
    }
  );
  const defineNavigatorUserAgent = isNavigatorDefined(
    config?.compatibility_date ?? deploymentConfig.compatibility_date,
    config?.compatibility_flags ?? deploymentConfig.compatibility_flags
  );
  const checkFetch = shouldCheckFetch(
    config?.compatibility_date ?? deploymentConfig.compatibility_date,
    config?.compatibility_flags ?? deploymentConfig.compatibility_flags
  );
  let builtFunctions = void 0;
  let workerBundle = void 0;
  const functionsDirectory = customFunctionsDirectory || path3.join(process7.cwd(), "functions");
  const routesOutputPath = !fs29.existsSync(path3.join(directory, "_routes.json")) ? path3.join(getPagesTmpDir(), `_routes-${Math.random()}.json`) : void 0;
  let filepathRoutingConfig;
  if (!_workerJS && fs29.existsSync(functionsDirectory)) {
    const outputConfigPath = path3.join(
      getPagesTmpDir(),
      `functions-filepath-routing-config-${Math.random()}.json`
    );
    try {
      workerBundle = await buildFunctions({
        outputConfigPath,
        functionsDirectory,
        sourcemap: sourceMaps,
        onEnd: /* @__PURE__ */ __name(() => {
        }, "onEnd"),
        buildOutputDirectory: directory,
        routesOutputPath,
        local: false,
        nodejsCompatMode,
        defineNavigatorUserAgent,
        checkFetch
      });
      builtFunctions = fs29.readFileSync(
        workerBundle.resolvedEntryPointPath,
        "utf-8"
      );
      filepathRoutingConfig = fs29.readFileSync(outputConfigPath, "utf-8");
    } catch (e10) {
      if (e10 instanceof FunctionsNoRoutesError) {
        logger.warn(
          getFunctionsNoRoutesWarning(functionsDirectory, "skipping")
        );
      } else {
        throw e10;
      }
    }
  }
  const { jwt } = await fetchResult(
    COMPLIANCE_REGION_CONFIG_PUBLIC,
    `/accounts/${accountId}/pages/projects/${projectName}/upload-token`
  );
  const fileCountLimit = maxFileCountAllowedFromClaims(jwt);
  const fileMap = await validate({ directory, fileCountLimit });
  const manifest = await upload({
    fileMap,
    accountId,
    projectName,
    skipCaching: skipCaching ?? false
  });
  const formData = new import_undici17.FormData();
  formData.append("manifest", JSON.stringify(manifest));
  if (branch) {
    formData.append("branch", branch);
  }
  if (commitMessage) {
    formData.append(
      "commit_message",
      truncateUtf8Bytes(commitMessage, MAX_COMMIT_MESSAGE_BYTES)
    );
  }
  if (commitHash) {
    formData.append("commit_hash", commitHash);
  }
  if (commitDirty !== void 0) {
    formData.append("commit_dirty", commitDirty);
  }
  if (_headers) {
    formData.append("_headers", new File([_headers], "_headers"));
    logger.log(`\u2728 Uploading _headers`);
  }
  if (_redirects) {
    formData.append("_redirects", new File([_redirects], "_redirects"));
    logger.log(`\u2728 Uploading _redirects`);
  }
  if (filepathRoutingConfig) {
    formData.append(
      "functions-filepath-routing-config.json",
      new File(
        [filepathRoutingConfig],
        "functions-filepath-routing-config.json"
      )
    );
  }
  if (config !== void 0 && config.configPath !== void 0 && config.pages_build_output_dir) {
    const configHash = crypto2.createHash("sha256").update(await fs9.readFile(config.configPath)).digest("hex");
    const outputDir = path3__namespace.default.relative(
      process.cwd(),
      config.pages_build_output_dir
    );
    formData.append("wrangler_config_hash", configHash);
    formData.append("pages_build_output_dir", outputDir);
  }
  if (_workerJSIsDirectory) {
    workerBundle = await produceWorkerBundleForWorkerJSDirectory({
      workerJSDirectory: _workerPath,
      bundle,
      buildOutputDirectory: directory,
      nodejsCompatMode,
      defineNavigatorUserAgent,
      checkFetch,
      sourceMaps
    });
  } else if (_workerJS) {
    if (bundle) {
      const outfile = path3.join(
        getPagesTmpDir(),
        `./bundledWorker-${Math.random()}.mjs`
      );
      workerBundle = await buildRawWorker({
        workerScriptPath: _workerPath,
        outfile,
        directory,
        local: false,
        sourcemap: true,
        watch: false,
        onEnd: /* @__PURE__ */ __name(() => {
        }, "onEnd"),
        nodejsCompatMode,
        defineNavigatorUserAgent,
        checkFetch
      });
    } else {
      await checkRawWorker(_workerPath, nodejsCompatMode, () => {
      });
      workerBundle = {
        modules: [],
        dependencies: {},
        stop: void 0,
        resolvedEntryPointPath: _workerPath,
        bundleType: "esm"
      };
    }
  }
  if (_workerJS || _workerJSIsDirectory) {
    const workerBundleContents = await createUploadWorkerBundleContents(
      workerBundle,
      config
    );
    formData.append(
      "_worker.bundle",
      new File([workerBundleContents], "_worker.bundle")
    );
    logger.log(`\u2728 Uploading Worker bundle`);
    if (_routesCustom) {
      try {
        const routesCustomJSON = JSON.parse(_routesCustom);
        validateRoutes2(routesCustomJSON, path3.join(directory, "_routes.json"));
        formData.append(
          "_routes.json",
          new File([_routesCustom], "_routes.json")
        );
        logger.log(`\u2728 Uploading _routes.json`);
      } catch (err) {
        if (err instanceof FatalError) {
          throw err;
        }
      }
    }
  }
  if (builtFunctions && !_workerJS && !_workerJSIsDirectory) {
    const workerBundleContents = await createUploadWorkerBundleContents(
      workerBundle,
      config
    );
    formData.append(
      "_worker.bundle",
      new File([workerBundleContents], "_worker.bundle")
    );
    logger.log(`\u2728 Uploading Functions bundle`);
    if (_routesCustom) {
      try {
        const routesCustomJSON = JSON.parse(_routesCustom);
        validateRoutes2(routesCustomJSON, path3.join(directory, "_routes.json"));
        formData.append(
          "_routes.json",
          new File([_routesCustom], "_routes.json")
        );
        logger.log(`\u2728 Uploading _routes.json`);
      } catch (err) {
        if (err instanceof FatalError) {
          throw err;
        }
      }
    } else if (routesOutputPath) {
      try {
        _routesGenerated = fs29.readFileSync(routesOutputPath, "utf-8");
        if (_routesGenerated) {
          formData.append(
            "_routes.json",
            new File([_routesGenerated], "_routes.json")
          );
        }
      } catch {
      }
    }
  }
  let attempts = 0;
  let lastErr;
  while (attempts < MAX_DEPLOYMENT_ATTEMPTS) {
    try {
      const deploymentResponse = await fetchResult(
        COMPLIANCE_REGION_CONFIG_PUBLIC,
        `/accounts/${accountId}/pages/projects/${projectName}/deployments`,
        {
          method: "POST",
          body: formData
        }
      );
      return { deploymentResponse, formData };
    } catch (e10) {
      lastErr = e10;
      if (e10.code === 8e6 /* UNKNOWN_ERROR */ && attempts < MAX_DEPLOYMENT_ATTEMPTS) {
        logger.debug("failed:", e10, "retrying...");
        await new Promise(
          (resolvePromise) => setTimeout(resolvePromise, Math.pow(2, attempts++) * 1e3)
        );
      } else {
        logger.debug("failed:", e10);
        throw e10;
      }
    }
  }
  throw lastErr;
}
var import_undici17, MAX_COMMIT_MESSAGE_BYTES;
var init_deploy3 = __esm({
  "src/api/pages/deploy.ts"() {
    init_import_meta_url();
    init_dist();
    import_undici17 = __toESM(require_undici());
    init_cfetch();
    init_config();
    init_bundle();
    init_node_compat();
    init_logger();
    init_navigator_user_agent();
    init_buildFunctions();
    init_constants3();
    init_errors2();
    init_buildWorker();
    init_routes_validation();
    init_upload4();
    init_utils12();
    init_validate3();
    init_create_worker_bundle_contents();
    MAX_COMMIT_MESSAGE_BYTES = 384;
    __name(deploy2, "deploy");
  }
});
async function helpIfErrorIsSizeOrScriptStartup(err, dependencies, workerBundle, projectRoot) {
  if (errIsScriptSize(err)) {
    return await diagnoseScriptSizeError(err, dependencies);
  }
  if (errIsStartupErr(err)) {
    return await diagnoseStartupError(err, workerBundle, projectRoot);
  }
  return null;
}
function diagnoseScriptSizeError(err, dependencies) {
  let message = esm_default3`
		Your Worker failed validation because it exceeded size limits.

		${err.text}
		${err.notes.map((note) => ` - ${note.text}`).join("\n")}
		`;
  const dependenciesMessage = getOffendingDependenciesMessage(dependencies);
  if (dependenciesMessage) {
    message += dependenciesMessage;
  }
  return message;
}
async function diagnoseStartupError(err, workerBundle, projectRoot) {
  let errorMessage = esm_default3`
		Your Worker failed validation because it exceeded startup limits.

		${err.text}
		${err.notes.map((note) => ` - ${note.text}`).join("\n")}

		To ensure fast responses, there are constraints on Worker startup, such as how much CPU it can use, or how long it can take. Your Worker has hit one of these startup limits. Try reducing the amount of work done during startup (outside the event handler), either by removing code or relocating it inside the event handler.

		Refer to https://developers.cloudflare.com/workers/platform/limits/#worker-startup-time for more details`;
  try {
    const cpuProfile = await analyseBundle(workerBundle);
    const tmpDir = await getWranglerTmpDir(
      projectRoot,
      "startup-profile",
      false
    );
    const profile = path3__namespace.default.relative(
      projectRoot ?? process.cwd(),
      path3__namespace.default.join(tmpDir.path, `worker.cpuprofile`)
    );
    await fs9.writeFile(profile, JSON.stringify(cpuProfile));
    errorMessage += esm_default3`

			A CPU Profile of your Worker's startup phase has been written to ${profile} - load it into the Chrome DevTools profiler (or directly in VSCode) to view a flamegraph.`;
  } catch (profilingError) {
    logger.debug(
      `An error occurred while trying to locally profile the Worker: ${profilingError}`
    );
  }
  return errorMessage;
}
function getOffendingDependenciesMessage(dependencies) {
  const dependenciesSorted = Object.entries(dependencies);
  if (dependenciesSorted.length === 0) {
    return null;
  }
  dependenciesSorted.sort(
    ([, aData], [, bData]) => bData.bytesInOutput - aData.bytesInOutput
  );
  const topLargest = dependenciesSorted.slice(0, 5);
  const ONE_KIB_BYTES2 = 1024;
  return [
    "",
    `Here are the ${topLargest.length} largest dependencies included in your script:`,
    "",
    ...topLargest.map(
      ([dep, data]) => `- ${dep} - ${(data.bytesInOutput / ONE_KIB_BYTES2).toFixed(2)} KiB`
    ),
    "",
    "If these are unnecessary, consider removing them",
    ""
  ].join("\n");
}
function errIsScriptSize(err) {
  if (!(err instanceof ParseError)) {
    return false;
  }
  if ("code" in err && err.code === 10027) {
    return true;
  }
  return false;
}
function errIsStartupErr(err) {
  if (!(err instanceof ParseError)) {
    return false;
  }
  if ("code" in err && err.code === 10021 && /startup/i.test(err.notes[0]?.text)) {
    return true;
  }
  return false;
}
var init_friendly_validator_errors = __esm({
  "src/utils/friendly-validator-errors.ts"() {
    init_import_meta_url();
    init_dist();
    init_esm2();
    init_commands3();
    init_logger();
    init_paths();
    __name(helpIfErrorIsSizeOrScriptStartup, "helpIfErrorIsSizeOrScriptStartup");
    __name(diagnoseScriptSizeError, "diagnoseScriptSizeError");
    __name(diagnoseStartupError, "diagnoseStartupError");
    __name(getOffendingDependenciesMessage, "getOffendingDependenciesMessage");
    __name(errIsScriptSize, "errIsScriptSize");
    __name(errIsStartupErr, "errIsStartupErr");
  }
});

// ../../node_modules/.pnpm/timeago.js@4.0.2/node_modules/timeago.js/esm/lang/en_US.js
function en_US_default(diff, idx) {
  if (idx === 0)
    return ["just now", "right now"];
  var unit = EN_US[Math.floor(idx / 2)];
  if (diff > 1)
    unit += "s";
  return [diff + " " + unit + " ago", "in " + diff + " " + unit];
}
var EN_US;
var init_en_US = __esm({
  "../../node_modules/.pnpm/timeago.js@4.0.2/node_modules/timeago.js/esm/lang/en_US.js"() {
    init_import_meta_url();
    EN_US = ["second", "minute", "hour", "day", "week", "month", "year"];
    __name(en_US_default, "default");
  }
});

// ../../node_modules/.pnpm/timeago.js@4.0.2/node_modules/timeago.js/esm/lang/zh_CN.js
function zh_CN_default(diff, idx) {
  if (idx === 0)
    return ["\u521A\u521A", "\u7247\u523B\u540E"];
  var unit = ZH_CN[~~(idx / 2)];
  return [diff + " " + unit + "\u524D", diff + " " + unit + "\u540E"];
}
var ZH_CN;
var init_zh_CN = __esm({
  "../../node_modules/.pnpm/timeago.js@4.0.2/node_modules/timeago.js/esm/lang/zh_CN.js"() {
    init_import_meta_url();
    ZH_CN = ["\u79D2", "\u5206\u949F", "\u5C0F\u65F6", "\u5929", "\u5468", "\u4E2A\u6708", "\u5E74"];
    __name(zh_CN_default, "default");
  }
});

// ../../node_modules/.pnpm/timeago.js@4.0.2/node_modules/timeago.js/esm/register.js
var Locales, register, getLocale;
var init_register = __esm({
  "../../node_modules/.pnpm/timeago.js@4.0.2/node_modules/timeago.js/esm/register.js"() {
    init_import_meta_url();
    Locales = {};
    register = /* @__PURE__ */ __name(function(locale, func) {
      Locales[locale] = func;
    }, "register");
    getLocale = /* @__PURE__ */ __name(function(locale) {
      return Locales[locale] || Locales["en_US"];
    }, "getLocale");
  }
});

// ../../node_modules/.pnpm/timeago.js@4.0.2/node_modules/timeago.js/esm/utils/date.js
function toDate(input) {
  if (input instanceof Date)
    return input;
  if (!isNaN(input) || /^\d+$/.test(input))
    return new Date(parseInt(input));
  input = (input || "").trim().replace(/\.\d+/, "").replace(/-/, "/").replace(/-/, "/").replace(/(\d)T(\d)/, "$1 $2").replace(/Z/, " UTC").replace(/([+-]\d\d):?(\d\d)/, " $1$2");
  return new Date(input);
}
function formatDiff(diff, localeFunc) {
  var agoIn = diff < 0 ? 1 : 0;
  diff = Math.abs(diff);
  var totalSec = diff;
  var idx = 0;
  for (; diff >= SEC_ARRAY[idx] && idx < SEC_ARRAY.length; idx++) {
    diff /= SEC_ARRAY[idx];
  }
  diff = Math.floor(diff);
  idx *= 2;
  if (diff > (idx === 0 ? 9 : 1))
    idx += 1;
  return localeFunc(diff, idx, totalSec)[agoIn].replace("%s", diff.toString());
}
function diffSec(date, relativeDate) {
  var relDate = relativeDate ? toDate(relativeDate) : /* @__PURE__ */ new Date();
  return (+relDate - +toDate(date)) / 1e3;
}
var SEC_ARRAY;
var init_date2 = __esm({
  "../../node_modules/.pnpm/timeago.js@4.0.2/node_modules/timeago.js/esm/utils/date.js"() {
    init_import_meta_url();
    SEC_ARRAY = [
      60,
      60,
      24,
      7,
      365 / 7 / 12,
      12
    ];
    __name(toDate, "toDate");
    __name(formatDiff, "formatDiff");
    __name(diffSec, "diffSec");
  }
});

// ../../node_modules/.pnpm/timeago.js@4.0.2/node_modules/timeago.js/esm/format.js
var format10;
var init_format2 = __esm({
  "../../node_modules/.pnpm/timeago.js@4.0.2/node_modules/timeago.js/esm/format.js"() {
    init_import_meta_url();
    init_date2();
    init_register();
    format10 = /* @__PURE__ */ __name(function(date, locale, opts) {
      var sec = diffSec(date, opts && opts.relativeDate);
      return formatDiff(sec, getLocale(locale));
    }, "format");
  }
});

// ../../node_modules/.pnpm/timeago.js@4.0.2/node_modules/timeago.js/esm/utils/dom.js
var init_dom = __esm({
  "../../node_modules/.pnpm/timeago.js@4.0.2/node_modules/timeago.js/esm/utils/dom.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/timeago.js@4.0.2/node_modules/timeago.js/esm/realtime.js
var init_realtime2 = __esm({
  "../../node_modules/.pnpm/timeago.js@4.0.2/node_modules/timeago.js/esm/realtime.js"() {
    init_import_meta_url();
    init_dom();
    init_date2();
    init_register();
  }
});

// ../../node_modules/.pnpm/timeago.js@4.0.2/node_modules/timeago.js/esm/index.js
var init_esm12 = __esm({
  "../../node_modules/.pnpm/timeago.js@4.0.2/node_modules/timeago.js/esm/index.js"() {
    init_import_meta_url();
    init_en_US();
    init_zh_CN();
    init_register();
    init_format2();
    init_realtime2();
    register("en_US", en_US_default);
    register("zh_CN", zh_CN_default);
  }
});
var pagesProjectListCommand, listProjects, pagesProjectCreateCommand, pagesProjectDeleteCommand;
var init_projects2 = __esm({
  "src/pages/projects.ts"() {
    init_import_meta_url();
    init_dist();
    init_esm12();
    init_cfetch();
    init_config_cache();
    init_create_command();
    init_dialogs();
    init_logger();
    init_metrics();
    init_user3();
    init_auth_variables();
    init_constants3();
    pagesProjectListCommand = createCommand({
      metadata: {
        description: "List your Cloudflare Pages projects",
        status: "stable",
        owner: "Workers: Authoring and Testing",
        hideGlobalFlags: ["config", "env"]
      },
      behaviour: {
        provideConfig: false,
        printBanner: /* @__PURE__ */ __name((args) => !args.json, "printBanner")
      },
      args: {
        json: {
          type: "boolean",
          description: "Return output as JSON",
          default: false
        }
      },
      async handler({ json }) {
        const config = getConfigCache(
          PAGES_CONFIG_CACHE_FILENAME
        );
        const accountId = getCloudflareAccountIdFromEnv() ?? await requireAuth(config);
        const projects = await listProjects({ accountId });
        const data = projects.map((project) => {
          return {
            "Project Name": project.name,
            "Project Domains": `${project.domains.join(", ")}`,
            "Git Provider": project.source ? "Yes" : "No",
            "Last Modified": project.latest_deployment ? format10(project.latest_deployment.modified_on) : format10(project.created_on)
          };
        });
        saveToConfigCache(PAGES_CONFIG_CACHE_FILENAME, {
          account_id: accountId
        });
        if (json) {
          logger.log(JSON.stringify(data, null, 2));
        } else {
          logger.table(data);
        }
        sendMetricsEvent("list pages projects");
      }
    });
    listProjects = /* @__PURE__ */ __name(async ({
      accountId
    }) => {
      const pageSize = 10;
      let page = 1;
      const results = [];
      while (results.length % pageSize === 0) {
        const json = await fetchResult(
          COMPLIANCE_REGION_CONFIG_PUBLIC,
          `/accounts/${accountId}/pages/projects`,
          {},
          new URLSearchParams({
            per_page: pageSize.toString(),
            page: page.toString()
          })
        );
        page++;
        results.push(...json);
        if (json.length < pageSize) {
          break;
        }
      }
      return results;
    }, "listProjects");
    pagesProjectCreateCommand = createCommand({
      metadata: {
        description: "Create a new Cloudflare Pages project",
        status: "stable",
        owner: "Workers: Authoring and Testing",
        hideGlobalFlags: ["config", "env"]
      },
      behaviour: {
        provideConfig: false
      },
      args: {
        "project-name": {
          type: "string",
          demandOption: true,
          description: "The name of your Pages project"
        },
        "production-branch": {
          type: "string",
          description: "The name of the production branch of your project"
        },
        "compatibility-flags": {
          description: "Flags to use for compatibility checks",
          alias: "compatibility-flag",
          type: "string",
          requiresArg: true,
          array: true
        },
        "compatibility-date": {
          description: "Date to use for compatibility checks",
          type: "string",
          requiresArg: true
        }
      },
      positionalArgs: ["project-name"],
      async handler({
        productionBranch,
        compatibilityFlags,
        compatibilityDate,
        projectName
      }) {
        const config = getConfigCache(
          PAGES_CONFIG_CACHE_FILENAME
        );
        const accountId = getCloudflareAccountIdFromEnv() ?? await requireAuth(config);
        const isInteractive4 = process.stdin.isTTY;
        if (!projectName && isInteractive4) {
          projectName = await prompt("Enter the name of your new project:");
        }
        if (!projectName) {
          throw new FatalError("Must specify a project name.", 1);
        }
        if (!productionBranch && isInteractive4) {
          logger.debug(
            "pages project create: Detecting git repository for production branch suggestion..."
          );
          let isGitDir = true;
          try {
            childProcess.execSync(`git rev-parse --is-inside-work-tree`, {
              stdio: "ignore"
            });
            logger.debug("pages project create: Git repository detected");
          } catch (err) {
            isGitDir = false;
            logger.debug(
              `pages project create: Not a git repository: ${err instanceof Error ? err.message : String(err)}`
            );
          }
          if (isGitDir) {
            try {
              productionBranch = childProcess.execSync(`git rev-parse --abbrev-ref HEAD`).toString().trim();
              logger.debug(
                `pages project create: Detected branch for suggestion: "${productionBranch}"`
              );
            } catch (err) {
              logger.debug(
                `pages project create: Failed to detect branch: ${err instanceof Error ? err.message : String(err)}`
              );
            }
          }
          productionBranch = await prompt("Enter the production branch name:", {
            defaultValue: productionBranch ?? "production"
          });
        }
        if (!productionBranch) {
          throw new FatalError("Must specify a production branch.", 1);
        }
        const deploymentConfig = {
          ...compatibilityFlags && {
            compatibility_flags: [...compatibilityFlags]
          },
          ...compatibilityDate && {
            compatibility_date: compatibilityDate
          }
        };
        const body = {
          name: projectName,
          production_branch: productionBranch,
          deployment_configs: {
            production: { ...deploymentConfig },
            preview: { ...deploymentConfig }
          }
        };
        const { subdomain } = await fetchResult(
          COMPLIANCE_REGION_CONFIG_PUBLIC,
          `/accounts/${accountId}/pages/projects`,
          {
            method: "POST",
            body: JSON.stringify(body)
          }
        );
        saveToConfigCache(PAGES_CONFIG_CACHE_FILENAME, {
          account_id: accountId,
          project_name: projectName
        });
        logger.log(
          `\u2728 Successfully created the '${projectName}' project. It will be available at https://${subdomain}/ once you create your first deployment.`
        );
        logger.log(
          `To deploy a folder of assets, run 'wrangler pages deploy [directory]'.`
        );
        sendMetricsEvent("create pages project");
      }
    });
    pagesProjectDeleteCommand = createCommand({
      metadata: {
        description: "Delete a Cloudflare Pages project",
        status: "stable",
        owner: "Workers: Authoring and Testing",
        hideGlobalFlags: ["config", "env"]
      },
      behaviour: {
        provideConfig: false
      },
      args: {
        "project-name": {
          type: "string",
          description: "The name of your Pages project",
          demandOption: true
        },
        yes: {
          alias: "y",
          type: "boolean",
          description: 'Answer "yes" to confirm project deletion'
        }
      },
      positionalArgs: ["project-name"],
      async handler(args) {
        const config = getConfigCache(
          PAGES_CONFIG_CACHE_FILENAME
        );
        const accountId = getCloudflareAccountIdFromEnv() ?? await requireAuth(config);
        const confirmed = args.yes || await confirm(
          `Are you sure you want to delete "${args.projectName}"? This action cannot be undone.`
        );
        if (confirmed) {
          logger.log("Deleting", args.projectName);
          await fetchResult(
            COMPLIANCE_REGION_CONFIG_PUBLIC,
            `/accounts/${accountId}/pages/projects/${args.projectName}`,
            { method: "DELETE" }
          );
          logger.log("Successfully deleted", args.projectName);
        }
      }
    });
  }
});

// src/pages/prompt-select-project.ts
async function promptSelectProject({
  accountId
}) {
  const projects = await listProjects({ accountId });
  return select("Select a project:", {
    choices: projects.map((project) => ({
      title: project.name,
      value: project.name
    }))
  });
}
var init_prompt_select_project = __esm({
  "src/pages/prompt-select-project.ts"() {
    init_import_meta_url();
    init_dialogs();
    init_projects2();
    __name(promptSelectProject, "promptSelectProject");
  }
});
function promptSelectExistingOrNewProject(message, items) {
  return select(message, {
    choices: items.map((i7) => ({ title: i7.label, value: i7.value }))
  });
}
var pagesDeploymentCreateCommand, pagesPublishCommand, pagesDeployCommand;
var init_deploy4 = __esm({
  "src/pages/deploy.ts"() {
    init_import_meta_url();
    init_dist();
    init_deploy3();
    init_cfetch();
    init_config();
    init_config_cache();
    init_create_command();
    init_dialogs();
    init_logger();
    init_metrics();
    init_output();
    init_user3();
    init_friendly_validator_errors();
    init_constants3();
    init_errors2();
    init_projects2();
    init_prompt_select_project();
    init_utils12();
    pagesDeploymentCreateCommand = createAlias({
      aliasOf: "wrangler pages deploy"
    });
    pagesPublishCommand = createAlias({
      aliasOf: "wrangler pages deploy",
      metadata: {
        deprecated: true,
        hidden: true
      }
    });
    pagesDeployCommand = createCommand({
      metadata: {
        description: "Deploy a directory of static assets as a Pages deployment",
        status: "stable",
        owner: "Workers: Authoring and Testing",
        hideGlobalFlags: ["config", "env"]
      },
      behaviour: {
        provideConfig: false
      },
      args: {
        directory: {
          type: "string",
          description: "The directory of static files to upload"
        },
        "project-name": {
          type: "string",
          description: "The name of the project you want to deploy to"
        },
        branch: {
          type: "string",
          description: "The name of the branch you want to deploy to"
        },
        "commit-hash": {
          type: "string",
          description: "The SHA to attach to this deployment"
        },
        "commit-message": {
          type: "string",
          description: "The commit message to attach to this deployment"
        },
        "commit-dirty": {
          type: "boolean",
          description: "Whether or not the workspace should be considered dirty for this deployment"
        },
        "skip-caching": {
          type: "boolean",
          description: "Skip asset caching which speeds up builds"
        },
        bundle: {
          type: "boolean",
          default: void 0,
          hidden: true
        },
        "no-bundle": {
          type: "boolean",
          default: void 0,
          description: "Whether to run bundling on `_worker.js` before deploying"
        },
        config: {
          description: "Pages does not support custom Wrangler configuration file locations",
          type: "string",
          hidden: true
        },
        "upload-source-maps": {
          type: "boolean",
          default: false,
          description: "Whether to upload any server-side sourcemaps with this deployment"
        }
      },
      positionalArgs: ["directory"],
      async handler(args) {
        let { branch, commitHash, commitMessage, commitDirty } = args;
        if (args._[1] === "publish") {
          logger.warn(
            "`wrangler pages publish` is deprecated and will be removed in the next major version.\nPlease use `wrangler pages deploy` instead, which accepts exactly the same arguments."
          );
        }
        if (args.config) {
          throw new FatalError(
            "Pages does not support custom paths for the Wrangler configuration file",
            1
          );
        }
        if (args.env) {
          throw new FatalError(
            "Pages does not support targeting an environment with the --env flag. Use the --branch flag to target your production or preview branch",
            1
          );
        }
        let config;
        const { configPath } = findWranglerConfig(process.cwd(), {
          useRedirectIfAvailable: true
        });
        try {
          config = readPagesConfig({ ...args, config: configPath, env: void 0 });
        } catch (err) {
          if (!(err instanceof FatalError && err.code === EXIT_CODE_INVALID_PAGES_CONFIG)) {
            throw err;
          }
        }
        if (configPath && config === void 0) {
          logger.warn(
            `Pages now has ${configFileName(configPath)} support.
We detected a configuration file at ${configPath} but it is missing the "pages_build_output_dir" field, required by Pages.
If you would like to use this configuration file to deploy your project, please use "pages_build_output_dir" to specify the directory of static files to upload.
Ignoring configuration file for now, and proceeding with project deploy.`
          );
        }
        const directory = args.directory ?? config?.pages_build_output_dir;
        if (!directory) {
          throw new FatalError(
            `Must specify a directory of assets to deploy. Please specify the [<directory>] argument in the \`pages deploy\` command, or configure \`pages_build_output_dir\` in your ${configFileName(configPath)} file.`,
            1
          );
        }
        const configCache = getConfigCache(
          PAGES_CONFIG_CACHE_FILENAME
        );
        const accountId = await requireAuth(configCache);
        let projectName = args.projectName ?? config?.name ?? configCache.project_name;
        let isExistingProject = true;
        if (projectName) {
          try {
            await fetchResult(
              COMPLIANCE_REGION_CONFIG_PUBLIC,
              `/accounts/${accountId}/pages/projects/${projectName}`
            );
          } catch (err) {
            if (err.code !== 8000007) {
              throw err;
            } else {
              isExistingProject = false;
            }
          }
        }
        const isInteractive4 = process.stdin.isTTY;
        if ((!projectName || !isExistingProject) && isInteractive4) {
          let existingOrNew = "new";
          if (!projectName) {
            const duProjects = (await listProjects({ accountId })).filter(
              (project) => !project.source
            );
            if (duProjects.length > 0) {
              const message = "No project specified. Would you like to create one or use an existing project?";
              const items = [
                {
                  key: "new",
                  label: "Create a new project",
                  value: "new"
                },
                {
                  key: "existing",
                  label: "Use an existing project",
                  value: "existing"
                }
              ];
              existingOrNew = await promptSelectExistingOrNewProject(
                message,
                items
              );
            }
          }
          if (projectName !== void 0 && !isExistingProject) {
            const message = `The project you specified does not exist: "${projectName}". Would you like to create it?`;
            const items = [
              {
                key: "new",
                label: "Create a new project",
                value: "new"
              }
            ];
            existingOrNew = await promptSelectExistingOrNewProject(message, items);
          }
          switch (existingOrNew) {
            case "existing": {
              projectName = await promptSelectProject({ accountId });
              break;
            }
            case "new": {
              if (!projectName) {
                projectName = await prompt("Enter the name of your new project:");
                if (!projectName) {
                  throw new FatalError("Must specify a project name.", 1);
                }
              }
              logger.debug(
                "pages deploy: Detecting git repository for production branch suggestion..."
              );
              let isGitDir2 = true;
              try {
                childProcess.execSync(`git rev-parse --is-inside-work-tree`, {
                  stdio: "ignore"
                });
                logger.debug(
                  "pages deploy: Git repository detected for branch suggestion"
                );
              } catch (err) {
                isGitDir2 = false;
                logger.debug(
                  `pages deploy: Not a git repository: ${err instanceof Error ? err.message : String(err)}`
                );
              }
              let productionBranch;
              if (isGitDir2) {
                try {
                  productionBranch = childProcess.execSync(`git rev-parse --abbrev-ref HEAD`).toString().trim();
                  logger.debug(
                    `pages deploy: Suggested production branch: "${productionBranch}"`
                  );
                } catch (err) {
                  logger.debug(
                    `pages deploy: Failed to detect current branch: ${err instanceof Error ? err.message : String(err)}`
                  );
                }
              }
              productionBranch = await prompt("Enter the production branch name:", {
                defaultValue: productionBranch ?? "production"
              });
              if (!productionBranch) {
                throw new FatalError("Must specify a production branch.", 1);
              }
              await fetchResult(
                COMPLIANCE_REGION_CONFIG_PUBLIC,
                `/accounts/${accountId}/pages/projects`,
                {
                  method: "POST",
                  body: JSON.stringify({
                    name: projectName,
                    production_branch: productionBranch
                  })
                }
              );
              saveToConfigCache(PAGES_CONFIG_CACHE_FILENAME, {
                account_id: accountId,
                project_name: projectName
              });
              logger.log(`\u2728 Successfully created the '${projectName}' project.`);
              sendMetricsEvent("create pages project");
              break;
            }
          }
        }
        if (!projectName) {
          throw new FatalError("Must specify a project name.", 1);
        }
        logger.debug("pages deploy: Detecting git repository information...");
        let isGitDir = true;
        try {
          childProcess.execSync(`git rev-parse --is-inside-work-tree`, {
            stdio: "ignore"
          });
          logger.debug("pages deploy: Git repository detected");
        } catch (err) {
          isGitDir = false;
          logger.debug(
            `pages deploy: Not a git repository or git not available: ${err instanceof Error ? err.message : String(err)}`
          );
        }
        let isGitDirty = false;
        if (isGitDir) {
          try {
            const statusOutput = childProcess.execSync(`git status --porcelain`).toString();
            isGitDirty = Boolean(statusOutput.length);
            logger.debug(
              `pages deploy: Working directory dirty status: ${isGitDirty}`
            );
            if (!branch) {
              branch = childProcess.execSync(`git rev-parse --abbrev-ref HEAD`).toString().trim();
              logger.debug(`pages deploy: Detected branch: "${branch}"`);
            } else {
              logger.debug(`pages deploy: Using provided branch: "${branch}"`);
            }
            if (!commitHash) {
              commitHash = childProcess.execSync(`git rev-parse HEAD`).toString().trim();
              logger.debug(`pages deploy: Detected commit hash: "${commitHash}"`);
            } else {
              logger.debug(
                `pages deploy: Using provided commit hash: "${commitHash}"`
              );
            }
            if (!commitMessage) {
              commitMessage = childProcess.execFileSync("git", [
                "show",
                "-s",
                "--format=%B",
                commitHash
              ]).toString().trim();
              logger.debug(
                `pages deploy: Detected commit message: "${commitMessage.substring(0, 50)}${commitMessage.length > 50 ? "..." : ""}"`
              );
            } else {
              logger.debug(`pages deploy: Using provided commit message`);
            }
          } catch (err) {
            logger.debug(
              `pages deploy: Failed to detect git information: ${err instanceof Error ? err.message : String(err)}`
            );
          }
          if (isGitDirty && !commitDirty) {
            logger.warn(
              `Warning: Your working directory is a git repo and has uncommitted changes
To silence this warning, pass in --commit-dirty=true`
            );
          }
          if (commitDirty === void 0) {
            commitDirty = isGitDirty;
          }
        }
        logger.debug(
          `pages deploy: Git information summary - branch: ${branch ?? "not set"}, commitHash: ${commitHash ?? "not set"}, commitDirty: ${commitDirty ?? "not set"}`
        );
        const enableBundling = args.bundle ?? !(args.noBundle ?? config?.no_bundle);
        const { deploymentResponse, formData } = await deploy2({
          directory,
          accountId,
          projectName,
          branch,
          commitMessage,
          commitHash,
          commitDirty,
          skipCaching: args.skipCaching,
          bundle: enableBundling,
          // Sourcemaps from deploy arguments will take precedence so people can try it for one-off deployments without updating their wrangler.toml
          sourceMaps: config?.upload_source_maps || args.uploadSourceMaps,
          args
        });
        saveToConfigCache(PAGES_CONFIG_CACHE_FILENAME, {
          account_id: accountId,
          project_name: projectName
        });
        let latestDeploymentStage;
        let alias;
        let attempts = 0;
        logger.log("\u{1F30E} Deploying...");
        while (attempts < MAX_DEPLOYMENT_STATUS_ATTEMPTS && latestDeploymentStage?.name !== "deploy" && latestDeploymentStage?.status !== "success" && latestDeploymentStage?.status !== "failure") {
          try {
            await new Promise(
              (resolvePromise) => setTimeout(resolvePromise, Math.pow(2, attempts++) * 1e3)
            );
            logger.debug(
              `attempt #${attempts}: Attempting to fetch status for deployment with id "${deploymentResponse.id}" ...`
            );
            const deployment = await fetchResult(
              COMPLIANCE_REGION_CONFIG_PUBLIC,
              `/accounts/${accountId}/pages/projects/${projectName}/deployments/${deploymentResponse.id}`
            );
            latestDeploymentStage = deployment.latest_stage;
            alias = (deployment.aliases?.filter((a7) => a7.endsWith(".pages.dev")) ?? [])[0];
          } catch (err) {
            logger.debug(
              `Attempt to get deployment status for deployment with id "${deploymentResponse.id}" failed: ${err}`
            );
          }
        }
        if (latestDeploymentStage?.name === "deploy" && latestDeploymentStage?.status === "success") {
          logger.log(
            `\u2728 Deployment complete! Take a peek over at ${deploymentResponse.url}` + (alias ? `
\u2728 Deployment alias URL: ${alias}` : "")
          );
        } else if (latestDeploymentStage?.name === "deploy" && latestDeploymentStage?.status === "failure") {
          const logs = await fetchResult(
            COMPLIANCE_REGION_CONFIG_PUBLIC,
            `/accounts/${accountId}/pages/projects/${projectName}/deployments/${deploymentResponse.id}/history/logs?size=10000000`
          );
          const failureMessage = logs.data[logs.total - 1].line.replace("Error:", "").trim();
          if (failureMessage.includes("Script startup exceeded CPU time limit")) {
            const startupError = new ParseError({ text: failureMessage });
            Object.assign(startupError, { code: 10021 });
            const workerBundle = formData.get("_worker.bundle");
            const filePath = path3__namespace.default.join(getPagesTmpDir(), "_worker.bundle");
            await fs9.writeFile(filePath, workerBundle.stream());
            throw new UserError(
              await diagnoseStartupError(
                startupError,
                filePath,
                getPagesProjectRoot()
              )
            );
          }
          throw new FatalError(
            `Deployment failed!
	${failureMessage}`,
            1
          );
        } else {
          logger.log(
            `\u2728 Deployment complete! However, we couldn't ascertain the final status of your deployment.

\u26A1\uFE0F Visit your deployment at ${deploymentResponse.url}
\u26A1\uFE0F Check the deployment details on the Cloudflare dashboard: https://dash.cloudflare.com/${accountId}/pages/view/${projectName}/${deploymentResponse.id}`
          );
        }
        writeOutput({
          type: "pages-deploy",
          version: 1,
          pages_project: deploymentResponse.project_name,
          deployment_id: deploymentResponse.id,
          url: deploymentResponse.url
        });
        writeOutput({
          type: "pages-deploy-detailed",
          version: 1,
          pages_project: deploymentResponse.project_name,
          deployment_id: deploymentResponse.id,
          url: deploymentResponse.url,
          alias,
          environment: deploymentResponse.environment,
          production_branch: deploymentResponse.production_branch,
          deployment_trigger: {
            metadata: {
              commit_hash: deploymentResponse.deployment_trigger?.metadata?.commit_hash ?? ""
            }
          }
        });
        sendMetricsEvent("create pages deployment");
      }
    });
    __name(promptSelectExistingOrNewProject, "promptSelectExistingOrNewProject");
  }
});

// ../../node_modules/.pnpm/agent-base@7.1.3/node_modules/agent-base/dist/helpers.js
var require_helpers = __commonJS({
  "../../node_modules/.pnpm/agent-base@7.1.3/node_modules/agent-base/dist/helpers.js"(exports) {
    init_import_meta_url();
    var __createBinding2 = exports && exports.__createBinding || (Object.create ? function(o7, m7, k7, k22) {
      if (k22 === void 0) k22 = k7;
      var desc = Object.getOwnPropertyDescriptor(m7, k7);
      if (!desc || ("get" in desc ? !m7.__esModule : desc.writable || desc.configurable)) {
        desc = { enumerable: true, get: /* @__PURE__ */ __name(function() {
          return m7[k7];
        }, "get") };
      }
      Object.defineProperty(o7, k22, desc);
    } : function(o7, m7, k7, k22) {
      if (k22 === void 0) k22 = k7;
      o7[k22] = m7[k7];
    });
    var __setModuleDefault2 = exports && exports.__setModuleDefault || (Object.create ? function(o7, v8) {
      Object.defineProperty(o7, "default", { enumerable: true, value: v8 });
    } : function(o7, v8) {
      o7["default"] = v8;
    });
    var __importStar2 = exports && exports.__importStar || function(mod) {
      if (mod && mod.__esModule) return mod;
      var result = {};
      if (mod != null) {
        for (var k7 in mod) if (k7 !== "default" && Object.prototype.hasOwnProperty.call(mod, k7)) __createBinding2(result, mod, k7);
      }
      __setModuleDefault2(result, mod);
      return result;
    };
    Object.defineProperty(exports, "__esModule", { value: true });
    exports.req = exports.json = exports.toBuffer = void 0;
    var http6 = __importStar2(__require("http"));
    var https3 = __importStar2(__require("https"));
    async function toBuffer(stream2) {
      let length = 0;
      const chunks = [];
      for await (const chunk of stream2) {
        length += chunk.length;
        chunks.push(chunk);
      }
      return Buffer.concat(chunks, length);
    }
    __name(toBuffer, "toBuffer");
    exports.toBuffer = toBuffer;
    async function json(stream2) {
      const buf = await toBuffer(stream2);
      const str = buf.toString("utf8");
      try {
        return JSON.parse(str);
      } catch (_err) {
        const err = _err;
        err.message += ` (input: ${str})`;
        throw err;
      }
    }
    __name(json, "json");
    exports.json = json;
    function req(url4, opts = {}) {
      const href = typeof url4 === "string" ? url4 : url4.href;
      const req2 = (href.startsWith("https:") ? https3 : http6).request(url4, opts);
      const promise = new Promise((resolve32, reject) => {
        req2.once("response", resolve32).once("error", reject).end();
      });
      req2.then = promise.then.bind(promise);
      return req2;
    }
    __name(req, "req");
    exports.req = req;
  }
});

// ../../node_modules/.pnpm/agent-base@7.1.3/node_modules/agent-base/dist/index.js
var require_dist5 = __commonJS({
  "../../node_modules/.pnpm/agent-base@7.1.3/node_modules/agent-base/dist/index.js"(exports) {
    init_import_meta_url();
    var __createBinding2 = exports && exports.__createBinding || (Object.create ? function(o7, m7, k7, k22) {
      if (k22 === void 0) k22 = k7;
      var desc = Object.getOwnPropertyDescriptor(m7, k7);
      if (!desc || ("get" in desc ? !m7.__esModule : desc.writable || desc.configurable)) {
        desc = { enumerable: true, get: /* @__PURE__ */ __name(function() {
          return m7[k7];
        }, "get") };
      }
      Object.defineProperty(o7, k22, desc);
    } : function(o7, m7, k7, k22) {
      if (k22 === void 0) k22 = k7;
      o7[k22] = m7[k7];
    });
    var __setModuleDefault2 = exports && exports.__setModuleDefault || (Object.create ? function(o7, v8) {
      Object.defineProperty(o7, "default", { enumerable: true, value: v8 });
    } : function(o7, v8) {
      o7["default"] = v8;
    });
    var __importStar2 = exports && exports.__importStar || function(mod) {
      if (mod && mod.__esModule) return mod;
      var result = {};
      if (mod != null) {
        for (var k7 in mod) if (k7 !== "default" && Object.prototype.hasOwnProperty.call(mod, k7)) __createBinding2(result, mod, k7);
      }
      __setModuleDefault2(result, mod);
      return result;
    };
    var __exportStar2 = exports && exports.__exportStar || function(m7, exports2) {
      for (var p7 in m7) if (p7 !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p7)) __createBinding2(exports2, m7, p7);
    };
    Object.defineProperty(exports, "__esModule", { value: true });
    exports.Agent = void 0;
    var net3 = __importStar2(__require("net"));
    var http6 = __importStar2(__require("http"));
    var https_1 = __require("https");
    __exportStar2(require_helpers(), exports);
    var INTERNAL2 = Symbol("AgentBaseInternalState");
    var Agent = class extends http6.Agent {
      static {
        __name(this, "Agent");
      }
      constructor(opts) {
        super(opts);
        this[INTERNAL2] = {};
      }
      /**
       * Determine whether this is an `http` or `https` request.
       */
      isSecureEndpoint(options) {
        if (options) {
          if (typeof options.secureEndpoint === "boolean") {
            return options.secureEndpoint;
          }
          if (typeof options.protocol === "string") {
            return options.protocol === "https:";
          }
        }
        const { stack } = new Error();
        if (typeof stack !== "string")
          return false;
        return stack.split("\n").some((l8) => l8.indexOf("(https.js:") !== -1 || l8.indexOf("node:https:") !== -1);
      }
      // In order to support async signatures in `connect()` and Node's native
      // connection pooling in `http.Agent`, the array of sockets for each origin
      // has to be updated synchronously. This is so the length of the array is
      // accurate when `addRequest()` is next called. We achieve this by creating a
      // fake socket and adding it to `sockets[origin]` and incrementing
      // `totalSocketCount`.
      incrementSockets(name2) {
        if (this.maxSockets === Infinity && this.maxTotalSockets === Infinity) {
          return null;
        }
        if (!this.sockets[name2]) {
          this.sockets[name2] = [];
        }
        const fakeSocket = new net3.Socket({ writable: false });
        this.sockets[name2].push(fakeSocket);
        this.totalSocketCount++;
        return fakeSocket;
      }
      decrementSockets(name2, socket) {
        if (!this.sockets[name2] || socket === null) {
          return;
        }
        const sockets = this.sockets[name2];
        const index = sockets.indexOf(socket);
        if (index !== -1) {
          sockets.splice(index, 1);
          this.totalSocketCount--;
          if (sockets.length === 0) {
            delete this.sockets[name2];
          }
        }
      }
      // In order to properly update the socket pool, we need to call `getName()` on
      // the core `https.Agent` if it is a secureEndpoint.
      getName(options) {
        const secureEndpoint = typeof options.secureEndpoint === "boolean" ? options.secureEndpoint : this.isSecureEndpoint(options);
        if (secureEndpoint) {
          return https_1.Agent.prototype.getName.call(this, options);
        }
        return super.getName(options);
      }
      createSocket(req, options, cb2) {
        const connectOpts = {
          ...options,
          secureEndpoint: this.isSecureEndpoint(options)
        };
        const name2 = this.getName(connectOpts);
        const fakeSocket = this.incrementSockets(name2);
        Promise.resolve().then(() => this.connect(req, connectOpts)).then((socket) => {
          this.decrementSockets(name2, fakeSocket);
          if (socket instanceof http6.Agent) {
            try {
              return socket.addRequest(req, connectOpts);
            } catch (err) {
              return cb2(err);
            }
          }
          this[INTERNAL2].currentSocket = socket;
          super.createSocket(req, options, cb2);
        }, (err) => {
          this.decrementSockets(name2, fakeSocket);
          cb2(err);
        });
      }
      createConnection() {
        const socket = this[INTERNAL2].currentSocket;
        this[INTERNAL2].currentSocket = void 0;
        if (!socket) {
          throw new Error("No socket was returned in the `connect()` function");
        }
        return socket;
      }
      get defaultPort() {
        return this[INTERNAL2].defaultPort ?? (this.protocol === "https:" ? 443 : 80);
      }
      set defaultPort(v8) {
        if (this[INTERNAL2]) {
          this[INTERNAL2].defaultPort = v8;
        }
      }
      get protocol() {
        return this[INTERNAL2].protocol ?? (this.isSecureEndpoint() ? "https:" : "http:");
      }
      set protocol(v8) {
        if (this[INTERNAL2]) {
          this[INTERNAL2].protocol = v8;
        }
      }
    };
    exports.Agent = Agent;
  }
});

// ../../node_modules/.pnpm/https-proxy-agent@7.0.2_supports-color@9.2.2/node_modules/https-proxy-agent/dist/parse-proxy-response.js
var require_parse_proxy_response2 = __commonJS({
  "../../node_modules/.pnpm/https-proxy-agent@7.0.2_supports-color@9.2.2/node_modules/https-proxy-agent/dist/parse-proxy-response.js"(exports) {
    init_import_meta_url();
    var __importDefault2 = exports && exports.__importDefault || function(mod) {
      return mod && mod.__esModule ? mod : { "default": mod };
    };
    Object.defineProperty(exports, "__esModule", { value: true });
    exports.parseProxyResponse = void 0;
    var debug_1 = __importDefault2(require_src3());
    var debug2 = (0, debug_1.default)("https-proxy-agent:parse-proxy-response");
    function parseProxyResponse(socket) {
      return new Promise((resolve32, reject) => {
        let buffersLength = 0;
        const buffers = [];
        function read2() {
          const b11 = socket.read();
          if (b11)
            ondata(b11);
          else
            socket.once("readable", read2);
        }
        __name(read2, "read");
        function cleanup() {
          socket.removeListener("end", onend);
          socket.removeListener("error", onerror);
          socket.removeListener("readable", read2);
        }
        __name(cleanup, "cleanup");
        function onend() {
          cleanup();
          debug2("onend");
          reject(new Error("Proxy connection ended before receiving CONNECT response"));
        }
        __name(onend, "onend");
        function onerror(err) {
          cleanup();
          debug2("onerror %o", err);
          reject(err);
        }
        __name(onerror, "onerror");
        function ondata(b11) {
          buffers.push(b11);
          buffersLength += b11.length;
          const buffered = Buffer.concat(buffers, buffersLength);
          const endOfHeaders = buffered.indexOf("\r\n\r\n");
          if (endOfHeaders === -1) {
            debug2("have not received end of HTTP headers yet...");
            read2();
            return;
          }
          const headerParts = buffered.slice(0, endOfHeaders).toString("ascii").split("\r\n");
          const firstLine = headerParts.shift();
          if (!firstLine) {
            socket.destroy();
            return reject(new Error("No header received from proxy CONNECT response"));
          }
          const firstLineParts = firstLine.split(" ");
          const statusCode = +firstLineParts[1];
          const statusText = firstLineParts.slice(2).join(" ");
          const headers = {};
          for (const header of headerParts) {
            if (!header)
              continue;
            const firstColon = header.indexOf(":");
            if (firstColon === -1) {
              socket.destroy();
              return reject(new Error(`Invalid header from proxy CONNECT response: "${header}"`));
            }
            const key = header.slice(0, firstColon).toLowerCase();
            const value = header.slice(firstColon + 1).trimStart();
            const current = headers[key];
            if (typeof current === "string") {
              headers[key] = [current, value];
            } else if (Array.isArray(current)) {
              current.push(value);
            } else {
              headers[key] = value;
            }
          }
          debug2("got proxy server response: %o %o", firstLine, headers);
          cleanup();
          resolve32({
            connect: {
              statusCode,
              statusText,
              headers
            },
            buffered
          });
        }
        __name(ondata, "ondata");
        socket.on("error", onerror);
        socket.on("end", onend);
        read2();
      });
    }
    __name(parseProxyResponse, "parseProxyResponse");
    exports.parseProxyResponse = parseProxyResponse;
  }
});

// ../../node_modules/.pnpm/https-proxy-agent@7.0.2_supports-color@9.2.2/node_modules/https-proxy-agent/dist/index.js
var require_dist6 = __commonJS({
  "../../node_modules/.pnpm/https-proxy-agent@7.0.2_supports-color@9.2.2/node_modules/https-proxy-agent/dist/index.js"(exports) {
    init_import_meta_url();
    var __createBinding2 = exports && exports.__createBinding || (Object.create ? function(o7, m7, k7, k22) {
      if (k22 === void 0) k22 = k7;
      var desc = Object.getOwnPropertyDescriptor(m7, k7);
      if (!desc || ("get" in desc ? !m7.__esModule : desc.writable || desc.configurable)) {
        desc = { enumerable: true, get: /* @__PURE__ */ __name(function() {
          return m7[k7];
        }, "get") };
      }
      Object.defineProperty(o7, k22, desc);
    } : function(o7, m7, k7, k22) {
      if (k22 === void 0) k22 = k7;
      o7[k22] = m7[k7];
    });
    var __setModuleDefault2 = exports && exports.__setModuleDefault || (Object.create ? function(o7, v8) {
      Object.defineProperty(o7, "default", { enumerable: true, value: v8 });
    } : function(o7, v8) {
      o7["default"] = v8;
    });
    var __importStar2 = exports && exports.__importStar || function(mod) {
      if (mod && mod.__esModule) return mod;
      var result = {};
      if (mod != null) {
        for (var k7 in mod) if (k7 !== "default" && Object.prototype.hasOwnProperty.call(mod, k7)) __createBinding2(result, mod, k7);
      }
      __setModuleDefault2(result, mod);
      return result;
    };
    var __importDefault2 = exports && exports.__importDefault || function(mod) {
      return mod && mod.__esModule ? mod : { "default": mod };
    };
    Object.defineProperty(exports, "__esModule", { value: true });
    exports.HttpsProxyAgent = void 0;
    var net3 = __importStar2(__require("net"));
    var tls = __importStar2(__require("tls"));
    var assert_1 = __importDefault2(__require("assert"));
    var debug_1 = __importDefault2(require_src3());
    var agent_base_1 = require_dist5();
    var parse_proxy_response_1 = require_parse_proxy_response2();
    var debug2 = (0, debug_1.default)("https-proxy-agent");
    var HttpsProxyAgent3 = class extends agent_base_1.Agent {
      static {
        __name(this, "HttpsProxyAgent");
      }
      constructor(proxy2, opts) {
        super(opts);
        this.options = { path: void 0 };
        this.proxy = typeof proxy2 === "string" ? new URL(proxy2) : proxy2;
        this.proxyHeaders = opts?.headers ?? {};
        debug2("Creating new HttpsProxyAgent instance: %o", this.proxy.href);
        const host = (this.proxy.hostname || this.proxy.host).replace(/^\[|\]$/g, "");
        const port = this.proxy.port ? parseInt(this.proxy.port, 10) : this.proxy.protocol === "https:" ? 443 : 80;
        this.connectOpts = {
          // Attempt to negotiate http/1.1 for proxy servers that support http/2
          ALPNProtocols: ["http/1.1"],
          ...opts ? omit(opts, "headers") : null,
          host,
          port
        };
      }
      /**
       * Called when the node-core HTTP client library is creating a
       * new HTTP request.
       */
      async connect(req, opts) {
        const { proxy: proxy2 } = this;
        if (!opts.host) {
          throw new TypeError('No "host" provided');
        }
        let socket;
        if (proxy2.protocol === "https:") {
          debug2("Creating `tls.Socket`: %o", this.connectOpts);
          const servername = this.connectOpts.servername || this.connectOpts.host;
          socket = tls.connect({
            ...this.connectOpts,
            servername: servername && net3.isIP(servername) ? void 0 : servername
          });
        } else {
          debug2("Creating `net.Socket`: %o", this.connectOpts);
          socket = net3.connect(this.connectOpts);
        }
        const headers = typeof this.proxyHeaders === "function" ? this.proxyHeaders() : { ...this.proxyHeaders };
        const host = net3.isIPv6(opts.host) ? `[${opts.host}]` : opts.host;
        let payload = `CONNECT ${host}:${opts.port} HTTP/1.1\r
`;
        if (proxy2.username || proxy2.password) {
          const auth = `${decodeURIComponent(proxy2.username)}:${decodeURIComponent(proxy2.password)}`;
          headers["Proxy-Authorization"] = `Basic ${Buffer.from(auth).toString("base64")}`;
        }
        headers.Host = `${host}:${opts.port}`;
        if (!headers["Proxy-Connection"]) {
          headers["Proxy-Connection"] = this.keepAlive ? "Keep-Alive" : "close";
        }
        for (const name2 of Object.keys(headers)) {
          payload += `${name2}: ${headers[name2]}\r
`;
        }
        const proxyResponsePromise = (0, parse_proxy_response_1.parseProxyResponse)(socket);
        socket.write(`${payload}\r
`);
        const { connect, buffered } = await proxyResponsePromise;
        req.emit("proxyConnect", connect);
        this.emit("proxyConnect", connect, req);
        if (connect.statusCode === 200) {
          req.once("socket", resume);
          if (opts.secureEndpoint) {
            debug2("Upgrading socket connection to TLS");
            const servername = opts.servername || opts.host;
            return tls.connect({
              ...omit(opts, "host", "path", "port"),
              socket,
              servername: net3.isIP(servername) ? void 0 : servername
            });
          }
          return socket;
        }
        socket.destroy();
        const fakeSocket = new net3.Socket({ writable: false });
        fakeSocket.readable = true;
        req.once("socket", (s7) => {
          debug2("Replaying proxy buffer for failed request");
          (0, assert_1.default)(s7.listenerCount("data") > 0);
          s7.push(buffered);
          s7.push(null);
        });
        return fakeSocket;
      }
    };
    HttpsProxyAgent3.protocols = ["http", "https"];
    exports.HttpsProxyAgent = HttpsProxyAgent3;
    function resume(socket) {
      socket.resume();
    }
    __name(resume, "resume");
    function omit(obj, ...keys) {
      const ret = {};
      let key;
      for (key in obj) {
        if (!keys.includes(key)) {
          ret[key] = obj[key];
        }
      }
      return ret;
    }
    __name(omit, "omit");
  }
});

// src/utils/constants.ts
var resetColor, fgGreenColor, DEFAULT_LOCAL_PORT, DEFAULT_INSPECTOR_PORT, proxy, noProxy;
var init_constants7 = __esm({
  "src/utils/constants.ts"() {
    init_import_meta_url();
    resetColor = "\x1B[0m";
    fgGreenColor = "\x1B[32m";
    DEFAULT_LOCAL_PORT = 8787;
    DEFAULT_INSPECTOR_PORT = 9229;
    proxy = process.env.https_proxy || process.env.HTTPS_PROXY || process.env.http_proxy || process.env.HTTP_PROXY || void 0;
    noProxy = process.env.no_proxy || process.env.NO_PROXY || void 0;
  }
});

// src/tail/filters.ts
function translateCLICommandToFilterMessage(cliFilters) {
  const apiFilters = [];
  if (cliFilters.samplingRate) {
    apiFilters.push(parseSamplingRate(cliFilters.samplingRate));
  }
  if (cliFilters.status) {
    apiFilters.push(parseOutcome(cliFilters.status));
  }
  if (cliFilters.method) {
    apiFilters.push(parseMethod(cliFilters.method));
  }
  if (cliFilters.header) {
    apiFilters.push(parseHeader(cliFilters.header));
  }
  if (cliFilters.clientIp) {
    apiFilters.push(parseIP(cliFilters.clientIp));
  }
  if (cliFilters.search) {
    apiFilters.push(parseQuery(cliFilters.search));
  }
  if (cliFilters.versionId) {
    apiFilters.push(parseScriptVersion(cliFilters.versionId));
  }
  return {
    filters: apiFilters
  };
}
function parseSamplingRate(sampling_rate) {
  if (sampling_rate <= 0 || sampling_rate >= 1) {
    throw new UserError(
      "A sampling rate must be between 0 and 1 in order to have any effect.\nFor example, a sampling rate of 0.25 means 25% of events will be logged."
    );
  }
  return { sampling_rate };
}
function parseOutcome(statuses) {
  const outcomes = /* @__PURE__ */ new Set();
  for (const status2 of statuses) {
    switch (status2) {
      case "ok":
        outcomes.add("ok");
        break;
      case "canceled":
        outcomes.add("canceled");
        break;
      case "error":
        outcomes.add("exception");
        outcomes.add("exceededCpu");
        outcomes.add("exceededMemory");
        outcomes.add("unknown");
        break;
    }
  }
  return {
    outcome: Array.from(outcomes)
  };
}
function parseMethod(method) {
  return { method };
}
function parseHeader(header) {
  const [headerKey, headerQuery] = header.split(":", 2);
  return {
    header: {
      key: headerKey.trim(),
      query: headerQuery?.trim()
    }
  };
}
function parseIP(client_ip) {
  return { client_ip };
}
function parseQuery(query) {
  return { query };
}
function parseScriptVersion(scriptVersion) {
  return { scriptVersion };
}
var init_filters2 = __esm({
  "src/tail/filters.ts"() {
    init_import_meta_url();
    init_dist();
    __name(translateCLICommandToFilterMessage, "translateCLICommandToFilterMessage");
    __name(parseSamplingRate, "parseSamplingRate");
    __name(parseOutcome, "parseOutcome");
    __name(parseMethod, "parseMethod");
    __name(parseHeader, "parseHeader");
    __name(parseIP, "parseIP");
    __name(parseQuery, "parseQuery");
    __name(parseScriptVersion, "parseScriptVersion");
  }
});

// src/tail/printing.ts
function realishPrintLogs(data) {
  const eventMessage2 = JSON.parse(data.toString());
  if (eventMessage2.logs.length > 0) {
    eventMessage2.logs.forEach(({ level, message }) => {
      logger.console(level, ...message);
    });
  }
  if (eventMessage2.exceptions.length > 0) {
    eventMessage2.exceptions.forEach(({ message }) => {
      logger.error(message);
    });
  }
}
function prettyPrintLogs(data) {
  const eventMessage2 = JSON.parse(data.toString());
  if (isScheduledEvent(eventMessage2.event)) {
    const cronPattern = eventMessage2.event.cron;
    const datetime = new Date(
      eventMessage2.event.scheduledTime
    ).toLocaleString();
    const outcome = prettifyOutcome(eventMessage2.outcome);
    logger.log(`"${cronPattern}" @ ${datetime} - ${outcome}`);
  } else if (isRequestEvent(eventMessage2.event)) {
    const requestMethod = eventMessage2.event?.request.method.toUpperCase();
    const url4 = eventMessage2.event?.request.url;
    const outcome = prettifyOutcome(eventMessage2.outcome);
    const datetime = new Date(eventMessage2.eventTimestamp).toLocaleString();
    logger.log(
      url4 ? `${requestMethod} ${url4} - ${outcome} @ ${datetime}` : `[missing request] - ${outcome} @ ${datetime}`
    );
  } else if (isEmailEvent(eventMessage2.event)) {
    const outcome = prettifyOutcome(eventMessage2.outcome);
    const datetime = new Date(eventMessage2.eventTimestamp).toLocaleString();
    const mailFrom = eventMessage2.event.mailFrom;
    const rcptTo = eventMessage2.event.rcptTo;
    const rawSize = eventMessage2.event.rawSize;
    logger.log(
      `Email from:${mailFrom} to:${rcptTo} size:${rawSize} @ ${datetime} - ${outcome}`
    );
  } else if (isAlarmEvent(eventMessage2.event)) {
    const outcome = prettifyOutcome(eventMessage2.outcome);
    const datetime = new Date(
      eventMessage2.event.scheduledTime
    ).toLocaleString();
    logger.log(`Alarm @ ${datetime} - ${outcome}`);
  } else if (isTailEvent(eventMessage2.event)) {
    const outcome = prettifyOutcome(eventMessage2.outcome);
    const datetime = new Date(eventMessage2.eventTimestamp).toLocaleString();
    const tailedScripts = new Set(
      eventMessage2.event.consumedEvents.map((consumedEvent) => consumedEvent.scriptName).filter((scriptName) => !!scriptName)
    );
    logger.log(
      `Tailing ${Array.from(tailedScripts).join(
        ","
      )} - ${outcome} @ ${datetime}`
    );
  } else if (isTailInfo(eventMessage2.event)) {
    if (eventMessage2.event.type === "overload") {
      logger.log(`${source_default.red.bold(eventMessage2.event.message)}`);
    } else if (eventMessage2.event.type === "overload-stop") {
      logger.log(`${source_default.yellow.bold(eventMessage2.event.message)}`);
    }
  } else if (isQueueEvent(eventMessage2.event)) {
    const outcome = prettifyOutcome(eventMessage2.outcome);
    const datetime = new Date(eventMessage2.eventTimestamp).toLocaleString();
    const queueName = eventMessage2.event.queue;
    const batchSize = eventMessage2.event.batchSize;
    const batchSizeMsg = `${batchSize} message${batchSize !== 1 ? "s" : ""}`;
    logger.log(
      `Queue ${queueName} (${batchSizeMsg}) - ${outcome} @ ${datetime}`
    );
  } else if (isRpcEvent(eventMessage2.event)) {
    const outcome = prettifyOutcome(eventMessage2.outcome);
    const datetime = new Date(eventMessage2.eventTimestamp).toLocaleString();
    logger.log(
      `${eventMessage2.entrypoint}.${eventMessage2.event.rpcMethod} - ${outcome} @ ${datetime}`
    );
  } else {
    const outcome = prettifyOutcome(eventMessage2.outcome);
    const datetime = new Date(eventMessage2.eventTimestamp).toLocaleString();
    logger.log(`Unknown Event - ${outcome} @ ${datetime}`);
  }
  if (eventMessage2.logs.length > 0) {
    eventMessage2.logs.forEach(({ level, message }) => {
      logger.log(`  (${level})`, ...message);
    });
  }
  if (eventMessage2.exceptions.length > 0) {
    eventMessage2.exceptions.forEach(({ name: name2, message }) => {
      logger.error(`  ${name2}:`, message);
    });
  }
}
function jsonPrintLogs(data) {
  logger.json(JSON.parse(data.toString()));
}
function isRequestEvent(event) {
  return Boolean(event && "request" in event);
}
function isScheduledEvent(event) {
  return Boolean(event && "cron" in event);
}
function isEmailEvent(event) {
  return Boolean(event && "mailFrom" in event);
}
function isQueueEvent(event) {
  return Boolean(event && "queue" in event);
}
function isRpcEvent(event) {
  return Boolean(event && "rpcMethod" in event);
}
function isAlarmEvent(event) {
  return Boolean(event && "scheduledTime" in event && !("cron" in event));
}
function isTailEvent(event) {
  return Boolean(event && "consumedEvents" in event);
}
function isTailInfo(event) {
  return Boolean(event && "message" in event && "type" in event);
}
function prettifyOutcome(outcome) {
  switch (outcome) {
    case "ok":
      return "Ok";
    case "canceled":
      return "Canceled";
    case "exceededCpu":
      return "Exceeded CPU Limit";
    case "exceededMemory":
      return "Exceeded Memory Limit";
    case "exception":
      return "Exception Thrown";
    case "unknown":
    default:
      return "Unknown";
  }
}
var init_printing = __esm({
  "src/tail/printing.ts"() {
    init_import_meta_url();
    init_source();
    init_logger();
    __name(realishPrintLogs, "realishPrintLogs");
    __name(prettyPrintLogs, "prettyPrintLogs");
    __name(jsonPrintLogs, "jsonPrintLogs");
    __name(isRequestEvent, "isRequestEvent");
    __name(isScheduledEvent, "isScheduledEvent");
    __name(isEmailEvent, "isEmailEvent");
    __name(isQueueEvent, "isQueueEvent");
    __name(isRpcEvent, "isRpcEvent");
    __name(isAlarmEvent, "isAlarmEvent");
    __name(isTailEvent, "isTailEvent");
    __name(isTailInfo, "isTailInfo");
    __name(prettifyOutcome, "prettifyOutcome");
  }
});

// src/tail/createTail.ts
function makeCreateTailUrl(accountId, workerName, env6) {
  return env6 ? `/accounts/${accountId}/workers/services/${workerName}/environments/${env6}/tails` : `/accounts/${accountId}/workers/scripts/${workerName}/tails`;
}
function makeDeleteTailUrl(accountId, workerName, tailId, env6) {
  return env6 ? `/accounts/${accountId}/workers/services/${workerName}/environments/${env6}/tails/${tailId}` : `/accounts/${accountId}/workers/scripts/${workerName}/tails/${tailId}`;
}
async function createPagesTail({
  accountId,
  projectName,
  deploymentId,
  filters,
  debug: debug2 = false
}) {
  const tailRecord = await fetchResult(
    COMPLIANCE_REGION_CONFIG_PUBLIC,
    `/accounts/${accountId}/pages/projects/${projectName}/deployments/${deploymentId}/tails`,
    {
      method: "POST",
      body: JSON.stringify(filters)
    }
  );
  const deleteTail = /* @__PURE__ */ __name(async () => fetchResult(
    COMPLIANCE_REGION_CONFIG_PUBLIC,
    `/accounts/${accountId}/pages/projects/${projectName}/deployments/${deploymentId}/tails/${tailRecord.id}`,
    { method: "DELETE" }
  ), "deleteTail");
  const p7 = proxy ? { agent: new import_https_proxy_agent2.HttpsProxyAgent(proxy) } : {};
  const tail = new wrapper_default(tailRecord.url, TRACE_VERSION, {
    headers: {
      "Sec-WebSocket-Protocol": TRACE_VERSION,
      // needs to be `trace-v1` to be accepted
      "User-Agent": `wrangler-js/${version}`
    },
    ...p7
  });
  tail.on("open", () => {
    tail.send(
      JSON.stringify({ debug: debug2 }),
      { binary: false, compress: false, mask: false, fin: true },
      (err) => {
        if (err) {
          throw err;
        }
      }
    );
  });
  return { tail, deleteTail, expiration: tailRecord.expires_at };
}
async function createTail(complianceConfig, accountId, workerName, filters, debug2, env6) {
  const createTailUrl = makeCreateTailUrl(accountId, workerName, env6);
  const {
    id: tailId,
    url: websocketUrl,
    expires_at: expiration
  } = await fetchResult(
    complianceConfig,
    createTailUrl,
    {
      method: "POST",
      body: JSON.stringify(filters)
    }
  );
  const deleteUrl = makeDeleteTailUrl(accountId, workerName, tailId, env6);
  async function deleteTail() {
    await fetchResult(complianceConfig, deleteUrl, { method: "DELETE" });
  }
  __name(deleteTail, "deleteTail");
  const p7 = proxy ? { agent: new import_https_proxy_agent2.HttpsProxyAgent(proxy) } : {};
  const tail = new wrapper_default(websocketUrl, TRACE_VERSION, {
    headers: {
      "Sec-WebSocket-Protocol": TRACE_VERSION,
      // needs to be `trace-v1` to be accepted
      "User-Agent": `wrangler/${version}`
    },
    ...p7
  });
  tail.on("open", function() {
    tail.send(
      JSON.stringify({ debug: debug2 }),
      { binary: false, compress: false, mask: false, fin: true },
      (err) => {
        if (err) {
          throw err;
        }
      }
    );
  });
  return { tail, expiration, deleteTail };
}
var import_https_proxy_agent2, TRACE_VERSION;
var init_createTail = __esm({
  "src/tail/createTail.ts"() {
    init_import_meta_url();
    init_dist();
    import_https_proxy_agent2 = __toESM(require_dist6());
    init_wrapper();
    init_package();
    init_cfetch();
    init_constants7();
    init_filters2();
    init_printing();
    TRACE_VERSION = "trace-v1";
    __name(makeCreateTailUrl, "makeCreateTailUrl");
    __name(makeDeleteTailUrl, "makeDeleteTailUrl");
    __name(createPagesTail, "createPagesTail");
    __name(createTail, "createTail");
  }
});
var import_signal_exit5, statusChoices, isStatusChoiceList, pagesDeploymentTailCommand;
var init_deployment_tails = __esm({
  "src/pages/deployment-tails.ts"() {
    init_import_meta_url();
    init_dist();
    import_signal_exit5 = __toESM(require_signal_exit());
    init_cfetch();
    init_config();
    init_config_cache();
    init_create_command();
    init_is_interactive();
    init_logger();
    init_metrics();
    init_createTail();
    init_filters2();
    init_user3();
    init_constants3();
    init_prompt_select_project();
    init_utils12();
    statusChoices = ["ok", "error", "canceled"];
    isStatusChoiceList = /* @__PURE__ */ __name((data) => data?.every((d8) => statusChoices.includes(d8)) ?? false, "isStatusChoiceList");
    pagesDeploymentTailCommand = createCommand({
      metadata: {
        description: "Start a tailing session for a project's deployment and livestream logs from your Functions",
        status: "stable",
        owner: "Workers: Authoring and Testing",
        hideGlobalFlags: ["config", "env"]
      },
      behaviour: {
        provideConfig: false,
        printBanner: /* @__PURE__ */ __name((args) => args.format === "pretty" || args.format === void 0 && !isNonInteractiveOrCI(), "printBanner")
      },
      args: {
        deployment: {
          type: "string",
          description: "(Optional) ID or URL of the deployment to tail. Specify by environment if deployment ID is unknown."
        },
        "project-name": {
          type: "string",
          description: "The name of the project you would like to tail"
        },
        environment: {
          type: "string",
          choices: ["production", "preview"],
          default: "production",
          description: "When not providing a specific deployment ID, specifying environment will grab the latest production or preview deployment"
        },
        format: {
          type: "string",
          choices: ["json", "pretty"],
          description: "The format of log entries"
        },
        debug: {
          type: "boolean",
          hidden: true,
          default: false,
          description: "If a log would have been filtered out, send it through anyway alongside the filter which would have blocked it."
        },
        status: {
          choices: statusChoices,
          description: "Filter by invocation status",
          array: true
        },
        header: {
          type: "string",
          requiresArg: true,
          description: "Filter by HTTP header"
        },
        method: {
          type: "string",
          requiresArg: true,
          description: "Filter by HTTP method",
          array: true
        },
        search: {
          type: "string",
          requiresArg: true,
          description: "Filter by a text match in console.log messages"
        },
        "sampling-rate": {
          type: "number",
          description: "Adds a percentage of requests to log sampling rate"
        },
        ip: {
          type: "string",
          requiresArg: true,
          description: 'Filter by the IP address the request originates from. Use "self" to filter for your own IP',
          array: true
        }
      },
      positionalArgs: ["deployment"],
      async handler({
        deployment,
        projectName,
        environment,
        header,
        ip: clientIp,
        method,
        samplingRate,
        search,
        status: status2,
        format: format11,
        debug: debug2,
        ...args
      }) {
        if (format11 === void 0) {
          format11 = isNonInteractiveOrCI() ? "json" : "pretty";
        }
        if (status2 && !isStatusChoiceList(status2)) {
          throw new FatalError(
            "Invalid value for `--status`. Valid options: " + statusChoices.join(", ")
          );
        }
        const config = readConfig(args);
        const pagesConfig = getConfigCache(
          PAGES_CONFIG_CACHE_FILENAME
        );
        const accountId = await requireAuth(pagesConfig);
        let deploymentId = deployment;
        if (!isInteractive3()) {
          if (!deploymentId) {
            throw new FatalError(
              "Must specify a deployment in non-interactive mode.",
              1
            );
          }
          if (!projectName) {
            throw new FatalError(
              "Must specify a project name in non-interactive mode.",
              1
            );
          }
        }
        if (!projectName && isInteractive3()) {
          projectName = await promptSelectProject({ accountId });
        }
        if (!deployment && !projectName) {
          throw new FatalError("Must specify a project name or deployment.", 1);
        }
        const deployments = await fetchResult(
          COMPLIANCE_REGION_CONFIG_PUBLIC,
          `/accounts/${accountId}/pages/projects/${projectName}/deployments`,
          {},
          new URLSearchParams({ env: environment })
        );
        const envDeployments = deployments.filter(
          (d8) => d8.environment === environment && d8.latest_stage.name === "deploy" && d8.latest_stage.status === "success"
        );
        if (isUrl(deployment)) {
          const { hostname: deploymentHostname } = new URL(deployment);
          const targetDeployment = envDeployments.find(
            (d8) => new URL(d8.url).hostname === deploymentHostname
          );
          if (!targetDeployment) {
            throw new FatalError(
              "Could not find deployment match url: " + deployment,
              1
            );
          }
          deploymentId = targetDeployment.id;
        } else if (!deployment) {
          if (envDeployments.length === 0) {
            throw new FatalError(
              "No deployments for environment: " + environment,
              1
            );
          }
          if (format11 === "pretty") {
            logger.log(
              "No deployment specified. Using latest deployment for",
              environment,
              "environment."
            );
          }
          const latestDeployment = envDeployments.map((d8) => ({ id: d8.id, created_on: new Date(d8.created_on) })).sort((a7, b11) => +b11.created_on - +a7.created_on)[0];
          deploymentId = latestDeployment.id;
        }
        if (!deploymentId || !projectName) {
          throw new Error("An unknown error occurred.");
        }
        const filters = translateCLICommandToFilterMessage({
          header,
          clientIp,
          method,
          samplingRate,
          search,
          status: status2
        });
        sendMetricsEvent("begin pages log stream", {
          sendMetrics: config.send_metrics
        });
        const { tail, deleteTail } = await createPagesTail({
          accountId,
          projectName,
          deploymentId,
          filters,
          debug: debug2
        });
        const onCloseTail = /* @__PURE__ */ (() => {
          let didTerminate = false;
          return async () => {
            if (didTerminate) {
              return;
            }
            tail.terminate();
            await deleteTail();
            sendMetricsEvent("end pages log stream", {
              sendMetrics: config.send_metrics
            });
            didTerminate = true;
          };
        })();
        (0, import_signal_exit5.default)(onCloseTail);
        tail.on("message", (data) => {
          if (format11 === "pretty") {
            prettyPrintLogs(data);
          } else {
            jsonPrintLogs(data);
          }
        });
        tail.on("close", onCloseTail);
        while (tail.readyState !== tail.OPEN) {
          switch (tail.readyState) {
            case tail.CONNECTING:
              await promises.setTimeout(100);
              break;
            case tail.CLOSING:
              await promises.setTimeout(100);
              break;
            case tail.CLOSED:
              sendMetricsEvent("end log stream", {
                sendMetrics: config.send_metrics
              });
              throw new Error(
                `Connection to deployment ${deploymentId} closed unexpectedly.`
              );
          }
        }
        if (format11 === "pretty") {
          logger.log(
            `Connected to deployment ${deploymentId}, waiting for logs...`
          );
        }
      }
    });
  }
});

// src/pages/deployments.ts
var pagesDeploymentListCommand, pagesDeploymentDeleteCommand;
var init_deployments4 = __esm({
  "src/pages/deployments.ts"() {
    init_import_meta_url();
    init_dist();
    init_esm12();
    init_cfetch();
    init_config_cache();
    init_create_command();
    init_dialogs();
    init_is_interactive();
    init_logger();
    init_metrics();
    init_user3();
    init_constants3();
    init_prompt_select_project();
    pagesDeploymentListCommand = createCommand({
      metadata: {
        description: "List deployments in your Cloudflare Pages project",
        status: "stable",
        owner: "Workers: Authoring and Testing",
        hideGlobalFlags: ["config", "env"]
      },
      behaviour: {
        provideConfig: false,
        printBanner: /* @__PURE__ */ __name((args) => !args.json, "printBanner")
      },
      args: {
        "project-name": {
          type: "string",
          description: "The name of the project you would like to list deployments for"
        },
        environment: {
          type: "string",
          choices: ["production", "preview"],
          description: "Environment type to list deployments for"
        },
        json: {
          type: "boolean",
          description: "Return output as JSON",
          default: false
        }
      },
      async handler({ projectName, environment, json }) {
        const config = getConfigCache(
          PAGES_CONFIG_CACHE_FILENAME
        );
        const accountId = await requireAuth(config);
        projectName ??= config.project_name;
        const isInteractive4 = process.stdin.isTTY;
        if (!projectName && isInteractive4) {
          projectName = await promptSelectProject({ accountId });
        }
        if (!projectName) {
          throw new FatalError("Must specify a project name.", 1);
        }
        const deployments = await fetchResult(
          COMPLIANCE_REGION_CONFIG_PUBLIC,
          `/accounts/${accountId}/pages/projects/${projectName}/deployments`,
          {},
          environment ? new URLSearchParams({ env: environment }) : new URLSearchParams({})
        );
        const titleCase = /* @__PURE__ */ __name((word) => word.charAt(0).toUpperCase() + word.slice(1), "titleCase");
        const shortSha = /* @__PURE__ */ __name((sha) => sha.slice(0, 7), "shortSha");
        const getStatus = /* @__PURE__ */ __name((deployment) => {
          if (deployment.latest_stage.status === "success" && deployment.latest_stage.ended_on) {
            return format10(deployment.latest_stage.ended_on);
          }
          return titleCase(deployment.latest_stage.status);
        }, "getStatus");
        const data = deployments.map((deployment) => {
          return {
            Id: deployment.id,
            Environment: titleCase(deployment.environment),
            Branch: deployment.deployment_trigger.metadata.branch,
            Source: shortSha(deployment.deployment_trigger.metadata.commit_hash),
            Deployment: deployment.url,
            Status: getStatus(deployment),
            // TODO: Use a url shortener
            Build: `https://dash.cloudflare.com/${accountId}/pages/view/${deployment.project_name}/${deployment.id}`
          };
        });
        saveToConfigCache(PAGES_CONFIG_CACHE_FILENAME, {
          account_id: accountId
        });
        if (json) {
          logger.log(JSON.stringify(data, null, 2));
        } else {
          logger.table(data);
        }
        sendMetricsEvent("list pages deployments");
      }
    });
    pagesDeploymentDeleteCommand = createCommand({
      metadata: {
        description: "Delete a deployment in your Cloudflare Pages project",
        status: "stable",
        owner: "Workers: Authoring and Testing",
        hideGlobalFlags: ["config", "env"]
      },
      behaviour: {
        provideConfig: false
      },
      args: {
        "deployment-id": {
          type: "string",
          description: "The ID of the deployment to delete",
          demandOption: true
        },
        "project-name": {
          type: "string",
          description: "The name of the project the deployment belongs to"
        },
        force: {
          type: "boolean",
          alias: "f",
          description: "Skip confirmation",
          default: false
        }
      },
      positionalArgs: ["deployment-id"],
      async handler({ deploymentId, projectName, force }) {
        const config = getConfigCache(
          PAGES_CONFIG_CACHE_FILENAME
        );
        const accountId = await requireAuth(config);
        projectName ??= config.project_name;
        const isInteractive4 = !isNonInteractiveOrCI();
        if (!projectName && isInteractive4) {
          projectName = await promptSelectProject({ accountId });
        }
        if (!projectName) {
          throw new FatalError("Must specify a project name.", 1);
        }
        const confirmed = force || await confirm(
          `Are you sure you want to delete deployment "${deploymentId}" in project "${projectName}"? This action cannot be undone.`,
          { fallbackValue: false }
        );
        if (!confirmed) {
          return;
        }
        logger.log(`Deleting deployment ${deploymentId}...`);
        await fetchResult(
          COMPLIANCE_REGION_CONFIG_PUBLIC,
          `/accounts/${accountId}/pages/projects/${projectName}/deployments/${deploymentId}`,
          { method: "DELETE" }
        );
        saveToConfigCache(PAGES_CONFIG_CACHE_FILENAME, {
          account_id: accountId,
          project_name: projectName
        });
        logger.log(`Successfully deleted deployment ${deploymentId}`);
        sendMetricsEvent("delete pages deployment");
      }
    });
  }
});

// src/deployment-bundle/esbuild-plugins/alias-external.ts
function esbuildAliasExternalPlugin(aliases2) {
  return {
    name: "external-alias-imports",
    setup(build5) {
      build5.onResolve({ filter: /.*/ }, (args) => {
        if (args.kind === "entry-point") {
          return {
            path: args.path
          };
        }
        if (!Object.keys(aliases2).includes(args.path)) {
          throw new Error("unrecognized module: " + args.path);
        }
        return {
          path: aliases2[args.path],
          external: true
        };
      });
    }
  };
}
var init_alias_external = __esm({
  "src/deployment-bundle/esbuild-plugins/alias-external.ts"() {
    init_import_meta_url();
    __name(esbuildAliasExternalPlugin, "esbuildAliasExternalPlugin");
  }
});

// src/utils/debounce.ts
function debounce(fn2, delayMs = 100) {
  let crrTimeoutId;
  return () => {
    if (crrTimeoutId) {
      clearTimeout(crrTimeoutId);
    }
    crrTimeoutId = setTimeout(() => {
      fn2();
    }, delayMs);
  };
}
var init_debounce = __esm({
  "src/utils/debounce.ts"() {
    init_import_meta_url();
    __name(debounce, "debounce");
  }
});
function getPagesEnvironmentVariables(projectName) {
  let branch = "local";
  try {
    branch = childProcess.execSync("git rev-parse --abbrev-ref HEAD", {
      encoding: "utf-8",
      stdio: "pipe"
    }).trim();
  } catch {
  }
  let commitSha = "0000000000000000000000000000000000000000";
  try {
    commitSha = childProcess.execSync("git rev-parse HEAD", {
      encoding: "utf-8",
      stdio: "pipe"
    }).trim();
  } catch {
  }
  let shortSha = commitSha.substring(0, 8);
  try {
    shortSha = childProcess.execSync("git rev-parse --short HEAD", {
      encoding: "utf-8",
      stdio: "pipe"
    }).trim();
  } catch {
  }
  return {
    CF_PAGES: { type: "plain_text", value: "1" },
    CF_PAGES_BRANCH: { type: "plain_text", value: branch },
    CF_PAGES_COMMIT_SHA: { type: "plain_text", value: commitSha },
    CF_PAGES_URL: {
      type: "plain_text",
      value: `https://${shortSha}.${projectName}.pages.dev`
    }
  };
}
function isWindows4() {
  return process.platform === "win32";
}
function getPids(pid) {
  const pids = [pid];
  let command2, regExp;
  if (isWindows4()) {
    command2 = `wmic process where (ParentProcessId=${pid}) get ProcessId`;
    regExp = new RegExp(/(\d+)/);
  } else {
    command2 = `pgrep -P ${pid}`;
    regExp = new RegExp(/(\d+)/);
  }
  try {
    const newPids = childProcess.execSync(command2).toString().split("\n").map((line) => line.match(regExp)).filter((line) => line !== null).map((match3) => parseInt(match3[1]));
    pids.push(...newPids.map(getPids).flat());
  } catch {
  }
  return pids;
}
function getPort(pid) {
  let command2, regExp;
  if (isWindows4()) {
    command2 = process.env.SYSTEMROOT + "\\system32\\netstat.exe -nao";
    regExp = new RegExp(`TCP\\s+.*:(\\d+)\\s+.*:\\d+\\s+LISTENING\\s+${pid}`);
  } else {
    command2 = "lsof -nPi";
    regExp = new RegExp(`${pid}\\s+.*TCP\\s+.*:(\\d+)\\s+\\(LISTEN\\)`);
  }
  try {
    const matches = childProcess.execSync(command2).toString().split("\n").map((line) => line.match(regExp)).filter((line) => line !== null);
    const match3 = matches[0];
    if (match3) {
      return parseInt(match3[1]);
    }
  } catch (thrown) {
    logger.error(
      `Error scanning for ports of process with PID ${pid}: ${thrown}`
    );
  }
}
async function spawnProxyProcess({
  port,
  command: command2
}) {
  if (command2.length > 0 || port !== void 0) {
    logger.warn(
      `Specifying a \`-- <command>\` or \`--proxy\` is deprecated and will be removed in a future version of Wrangler.
Build your application to a directory and run the \`wrangler pages dev <directory>\` instead.
This results in a more faithful emulation of production behavior.`
    );
  }
  if (port !== void 0) {
    logger.warn(
      "On Node.js 17+, wrangler will default to fetching only the IPv6 address. Please ensure that the process listening on the port specified via `--proxy` is configured for IPv6."
    );
  }
  if (command2.length === 0) {
    if (port !== void 0) {
      return port;
    }
    CLEANUP();
    throw new FatalError(
      `Must specify a directory of static assets to serve, or a command to run, or a proxy port, or configure \`pages_build_output_dir\` in your Wrangler configuration file.`,
      1
    );
  }
  logger.log(`Running ${quote(command2)}...`);
  const proxy2 = childProcess.spawn(
    command2[0].toString(),
    command2.slice(1).map((value) => value.toString()),
    {
      shell: isWindows4(),
      env: {
        BROWSER: "none",
        ...process.env
      }
    }
  );
  CLEANUP_CALLBACKS.push(() => {
    proxy2.kill();
  });
  proxy2.stdout.on("data", (data) => {
    logger.log(`[proxy]: ${data}`);
  });
  proxy2.stderr.on("data", (data) => {
    logger.error(`[proxy]: ${data}`);
  });
  proxy2.on("close", (code) => {
    logger.error(`Proxy exited with status ${code}.`);
    CLEANUP();
    process.exitCode = code ?? 0;
  });
  while (!proxy2.pid) {
  }
  if (port === void 0) {
    logger.log(
      `Sleeping ${SECONDS_TO_WAIT_FOR_PROXY} seconds to allow proxy process to start before attempting to automatically determine port...`
    );
    logger.log("To skip, specify the proxy port with --proxy.");
    await promises.setTimeout(SECONDS_TO_WAIT_FOR_PROXY * 1e3);
    port = getPids(proxy2.pid).map(getPort).filter((nr2) => nr2 !== void 0)[0];
    if (port === void 0) {
      CLEANUP();
      throw new FatalError(
        "Could not automatically determine proxy port. Please specify the proxy port with --proxy.",
        1
      );
    } else {
      logger.log(`Automatically determined the proxy port to be ${port}.`);
    }
  }
  return port;
}
function resolvePagesDevServerSettings(config, args) {
  let compatibilityDate = args.compatibilityDate || config.compatibility_date;
  if (!compatibilityDate) {
    const currentDate = getTodaysCompatDate();
    logger.warn(
      `No compatibility_date was specified. Using today's date: ${currentDate}.
\u276F\u276F Add one to your ${configFileName(config.configPath)} file: compatibility_date = "${currentDate}", or
\u276F\u276F Pass it in your terminal: wrangler pages dev [<DIRECTORY>] --compatibility-date=${currentDate}

See https://developers.cloudflare.com/workers/platform/compatibility-dates/ for more information.`
    );
    compatibilityDate = currentDate;
  }
  return {
    compatibilityDate,
    compatibilityFlags: args.compatibilityFlags ?? config.compatibility_flags,
    ip: args.ip ?? config.dev.ip ?? DEFAULT_IP,
    // because otherwise `unstable_dev` will default the port number to `0`
    port: args.port ?? config.dev?.port ?? DEFAULT_PAGES_LOCAL_PORT,
    inspectorPort: args.inspectorPort ?? config.dev?.inspector_port,
    localProtocol: args.localProtocol ?? config.dev?.local_protocol
  };
}
function getBindingsFromArgs(args) {
  let cliVars;
  if (args.binding?.length) {
    cliVars = args.binding.map((binding) => binding.toString().split("=")).map(([key, ...values]) => `${key}:${values.join("=")}`);
  }
  let kvNamespaces;
  if (args.kv?.length) {
    kvNamespaces = args.kv.map((kv) => {
      const { binding, ref } = BINDING_REGEXP.exec(kv.toString())?.groups || {};
      if (!binding) {
        logger.warn("Could not parse KV binding:", kv.toString());
        return;
      }
      return {
        binding,
        id: ref || kv.toString()
      };
    }).filter(Boolean);
  }
  let durableObjectsBindings;
  if (args.do?.length) {
    durableObjectsBindings = args.do.map((durableObject) => {
      const { binding, className, scriptName } = DURABLE_OBJECTS_BINDING_REGEXP.exec(durableObject.toString())?.groups || {};
      if (!binding || !className) {
        logger.warn(
          "Could not parse Durable Object binding:",
          durableObject.toString()
        );
        return;
      }
      return {
        name: binding,
        class_name: className,
        script_name: scriptName
      };
    }).filter(Boolean);
  }
  let d1Databases;
  if (args.d1?.length) {
    d1Databases = args.d1.map((d1) => {
      const { binding, ref } = BINDING_REGEXP.exec(d1.toString())?.groups || {};
      if (!binding) {
        logger.warn("Could not parse D1 binding:", d1.toString());
        return;
      }
      return {
        binding,
        database_id: ref || d1.toString(),
        database_name: `local-${d1}`
      };
    }).filter(Boolean);
  }
  let r2Buckets;
  if (args.r2?.length) {
    r2Buckets = args.r2.map((r22) => {
      const { binding, ref } = BINDING_REGEXP.exec(r22.toString())?.groups || {};
      if (!binding) {
        logger.warn("Could not parse R2 binding:", r22.toString());
        return;
      }
      return { binding, bucket_name: ref || binding.toString() };
    }).filter(Boolean);
  }
  let services;
  if (args.service?.length) {
    services = args.service.map((serviceBinding) => {
      const { binding, service, environment, entrypoint } = SERVICE_BINDING_REGEXP.exec(serviceBinding.toString())?.groups || {};
      if (!binding || !service) {
        logger.warn(
          "Could not parse Service binding:",
          serviceBinding.toString()
        );
        return;
      }
      let serviceName = service;
      if (environment) {
        serviceName = `${service}-${environment}`;
      }
      return {
        binding,
        service: serviceName,
        environment,
        entrypoint
      };
    }).filter(Boolean);
    if (services.find(({ environment }) => !!environment)) {
      logger.warn("Support for service binding environments is experimental.");
    }
  }
  let ai2;
  if (args.ai) {
    ai2 = { binding: args.ai.toString() };
  }
  let version_metadata;
  if (args.versionMetadata) {
    version_metadata = { binding: args.versionMetadata.toString() };
  }
  return {
    cliVars,
    kv_namespaces: kvNamespaces,
    d1_databases: d1Databases,
    r2_buckets: r2Buckets,
    services,
    ai: ai2,
    version_metadata,
    // don't construct the full `EnvironmentNonInheritable["durable_objects"]` shape here.
    // `startDev()` will do that for us in its `getBindings()` function
    do_bindings: durableObjectsBindings
  };
}
var DURABLE_OBJECTS_BINDING_REGEXP, BINDING_REGEXP, SERVICE_BINDING_REGEXP, DEFAULT_IP, DEFAULT_PAGES_LOCAL_PORT, DEFAULT_SCRIPT_PATH, pagesDevCommand;
var init_dev = __esm({
  "src/pages/dev.ts"() {
    init_import_meta_url();
    init_dist();
    init_esm6();
    init_config();
    init_config_cache();
    init_create_command();
    init_build_failures();
    init_bundle();
    init_alias_external();
    init_node_compat();
    init_start_dev();
    init_experimental_flags();
    init_logger();
    init_metrics();
    init_navigator_user_agent();
    init_paths();
    init_debounce();
    init_shell_quote();
    init_buildFunctions();
    init_constants3();
    init_errors2();
    init_buildWorker();
    init_routes_validation();
    init_utils12();
    DURABLE_OBJECTS_BINDING_REGEXP = new RegExp(
      /^(?<binding>[^=]+)=(?<className>[^@\s]+)(@(?<scriptName>.*)$)?$/
    );
    BINDING_REGEXP = new RegExp(/^(?<binding>[^=]+)(?:=(?<ref>[^\s]+))?$/);
    SERVICE_BINDING_REGEXP = new RegExp(
      /^(?<binding>[^=]+)=(?<service>[^@#\s]+)(@(?<environment>.*)$)?(#(?<entrypoint>.*))?$/
    );
    DEFAULT_IP = process.platform === "win32" ? "127.0.0.1" : "localhost";
    DEFAULT_PAGES_LOCAL_PORT = 8788;
    DEFAULT_SCRIPT_PATH = "_worker.js";
    __name(getPagesEnvironmentVariables, "getPagesEnvironmentVariables");
    pagesDevCommand = createCommand({
      metadata: {
        description: "Develop your full-stack Pages application locally",
        status: "stable",
        owner: "Workers: Authoring and Testing",
        hideGlobalFlags: ["config", "env"]
      },
      behaviour: {
        provideConfig: false
      },
      args: {
        directory: {
          type: "string",
          description: "The directory of static assets to serve"
        },
        command: {
          type: "string",
          description: "The proxy command to run  [deprecated]"
        },
        local: {
          type: "boolean",
          default: true,
          description: "Run on my machine",
          deprecated: true,
          hidden: true
        },
        "compatibility-date": {
          description: "Date to use for compatibility checks",
          type: "string"
        },
        "compatibility-flags": {
          description: "Flags to use for compatibility checks",
          alias: "compatibility-flag",
          type: "string",
          array: true
        },
        ip: {
          type: "string",
          // On Windows, when specifying `localhost` as the socket hostname,
          // `workerd` will only listen on the IPv4 loopback `127.0.0.1`, not the
          // IPv6 `::1`: https://github.com/cloudflare/workerd/issues/1408
          // On Node 17+, `fetch()` will only try to fetch the IPv6 address.
          // For now, on Windows, we default to listening on IPv4 only and using
          // `127.0.0.1` when sending control requests to `workerd` (e.g. with the
          // `ProxyController`).
          description: "The IP address to listen on"
        },
        port: {
          type: "number",
          description: "The port to listen on (serve from)"
        },
        "inspector-port": {
          type: "number",
          description: "Port for devtools to connect to"
        },
        proxy: {
          type: "number",
          description: "The port to proxy (where the static assets are served)",
          deprecated: true
        },
        "script-path": {
          type: "string",
          description: "The location of the single Worker script if not using functions  [default: _worker.js]",
          // hacking in a fake default message here so we can detect when user is setting this and show a deprecation message
          deprecated: true
        },
        bundle: {
          type: "boolean",
          default: void 0,
          hidden: true
        },
        "no-bundle": {
          type: "boolean",
          default: void 0,
          conflicts: "bundle",
          description: "Whether to run bundling on `_worker.js`"
        },
        binding: {
          type: "array",
          description: "Bind variable/secret (KEY=VALUE)",
          alias: "b"
        },
        kv: {
          type: "array",
          description: "KV namespace to bind (--kv KV_BINDING)",
          alias: "k"
        },
        d1: {
          type: "array",
          description: "D1 database to bind (--d1 D1_BINDING)"
        },
        do: {
          type: "array",
          description: "Durable Object to bind (--do DO_BINDING=CLASS_NAME@SCRIPT_NAME)",
          alias: "o"
        },
        r2: {
          type: "array",
          description: "R2 bucket to bind (--r2 R2_BINDING)"
        },
        ai: {
          type: "string",
          description: "AI to bind (--ai AI_BINDING)"
        },
        "version-metadata": {
          type: "string",
          description: "Worker Version metadata (--version-metadata VERSION_METADATA_BINDING)"
        },
        service: {
          type: "array",
          description: "Service to bind (--service SERVICE=SCRIPT_NAME)",
          alia: "s"
        },
        "live-reload": {
          type: "boolean",
          default: false,
          description: "Auto reload HTML pages when change is detected"
        },
        "local-protocol": {
          description: "Protocol to listen to requests on, defaults to http.",
          choices: ["http", "https"]
        },
        "https-key-path": {
          description: "Path to a custom certificate key",
          type: "string",
          requiresArg: true
        },
        "https-cert-path": {
          description: "Path to a custom certificate",
          type: "string",
          requiresArg: true
        },
        "persist-to": {
          description: "Specify directory to use for local persistence (defaults to .wrangler/state)",
          type: "string",
          requiresArg: true
        },
        "node-compat": {
          description: "Enable Node.js compatibility",
          default: false,
          type: "boolean",
          hidden: true,
          deprecated: true
        },
        "experimental-local": {
          description: "Run on my machine using the Cloudflare Workers runtime",
          type: "boolean",
          deprecated: true,
          hidden: true
        },
        "log-level": {
          choices: ["debug", "info", "log", "warn", "error", "none"],
          description: "Specify logging level"
        },
        "show-interactive-dev-session": {
          description: "Show interactive dev session (defaults to true if the terminal supports interactivity)",
          type: "boolean"
        }
      },
      positionalArgs: ["directory", "command"],
      async handler(args) {
        if (args.logLevel) {
          logger.loggerLevel = args.logLevel;
        }
        if (args.nodeCompat) {
          throw new UserError(
            `The --node-compat flag is no longer supported as of Wrangler v4. Instead, use the \`nodejs_compat\` compatibility flag. This includes the functionality from legacy \`node_compat\` polyfills and natively implemented Node.js APIs. See https://developers.cloudflare.com/workers/runtime-apis/nodejs for more information.`
          );
        }
        if (args.experimentalLocal) {
          logger.warn(
            "--experimental-local is no longer required and will be removed in a future version.\n`wrangler pages dev` now uses the local Cloudflare Workers runtime by default."
          );
        }
        if (args.config && !Array.isArray(args.config)) {
          throw new FatalError(
            "Pages does not support custom paths for the Wrangler configuration file",
            1
          );
        }
        if (args.env) {
          throw new FatalError(
            "Pages does not support targeting an environment with the --env flag during local development.",
            1
          );
        }
        if (args.scriptPath !== void 0) {
          logger.warn(
            `\`--script-path\` is deprecated and will be removed in a future version of Wrangler.
The Worker script should be named \`_worker.js\` and located in the build output directory of your project (specified with \`wrangler pages dev <directory>\`).`
          );
        }
        const config = readConfig(
          { ...args, env: void 0, config: void 0 },
          { useRedirectIfAvailable: true }
        );
        if (args.config && Array.isArray(args.config) && config.configPath && path3__namespace.default.resolve(process.cwd(), args.config[0]) !== config.configPath) {
          throw new FatalError(
            "The first `--config` argument must point to your Pages configuration file: " + path3__namespace.default.relative(process.cwd(), config.configPath)
          );
        }
        const resolvedDirectory = args.directory ?? config.pages_build_output_dir;
        const [_pages, _dev, ...remaining] = args._;
        const command2 = remaining;
        let proxyPort;
        let directory = resolvedDirectory;
        if (directory !== void 0 && command2.length > 0) {
          throw new FatalError(
            "Specify either a directory OR a proxy command, not both.",
            1
          );
        } else if (directory === void 0) {
          proxyPort = await spawnProxyProcess({
            port: args.proxy,
            command: command2
          });
          if (proxyPort === void 0) {
            return void 0;
          }
        } else {
          directory = path3.resolve(directory);
        }
        const {
          compatibilityDate,
          compatibilityFlags,
          ip,
          port,
          inspectorPort,
          localProtocol
        } = resolvePagesDevServerSettings(config, args);
        const {
          cliVars,
          kv_namespaces,
          do_bindings,
          d1_databases,
          r2_buckets,
          services,
          ai: ai2
        } = getBindingsFromArgs(args);
        let scriptReadyResolve;
        const scriptReadyPromise = new Promise(
          (promiseResolve) => scriptReadyResolve = promiseResolve
        );
        const singleWorkerScriptPath = args.scriptPath ?? DEFAULT_SCRIPT_PATH;
        const workerScriptPath = directory !== void 0 ? path3.join(directory, singleWorkerScriptPath) : path3.resolve(singleWorkerScriptPath);
        const usingWorkerDirectory = fs29.lstatSync(workerScriptPath, { throwIfNoEntry: false })?.isDirectory() ?? false;
        const usingWorkerScript = fs29.existsSync(workerScriptPath);
        const enableBundling = args.bundle ?? !(args.noBundle ?? config.no_bundle);
        const functionsDirectory = "./functions";
        let usingFunctions = !usingWorkerScript && fs29.existsSync(functionsDirectory);
        let scriptPath4 = "";
        const nodejsCompatMode = validateNodeCompatMode(
          args.compatibilityDate ?? config.compatibility_date,
          args.compatibilityFlags ?? config.compatibility_flags ?? [],
          {
            noBundle: !enableBundling
          }
        );
        const defineNavigatorUserAgent = isNavigatorDefined(
          compatibilityDate,
          compatibilityFlags
        );
        const checkFetch = shouldCheckFetch(compatibilityDate, compatibilityFlags);
        let modules = [];
        if (usingWorkerDirectory) {
          const runBuild2 = /* @__PURE__ */ __name(async () => {
            const bundleResult = await produceWorkerBundleForWorkerJSDirectory({
              workerJSDirectory: workerScriptPath,
              bundle: enableBundling,
              buildOutputDirectory: directory ?? ".",
              nodejsCompatMode,
              defineNavigatorUserAgent,
              checkFetch,
              sourceMaps: config?.upload_source_maps ?? false
            });
            modules = bundleResult.modules;
            scriptPath4 = bundleResult.resolvedEntryPointPath;
          }, "runBuild");
          await runBuild2().then(() => scriptReadyResolve());
          watch([workerScriptPath], {
            persistent: true,
            ignoreInitial: true
          }).on("all", async () => {
            try {
              await runBuild2();
            } catch (e10) {
              if (isBuildFailure(e10)) {
                logger.warn("Error building worker script:", e10.message);
                return;
              }
              throw e10;
            }
          });
        } else if (usingWorkerScript) {
          const watcher = watch([workerScriptPath], {
            persistent: true,
            ignoreInitial: true
          });
          let watchedBundleDependencies = [];
          scriptPath4 = workerScriptPath;
          let runBuild2 = /* @__PURE__ */ __name(async () => {
            await checkRawWorker(
              workerScriptPath,
              nodejsCompatMode,
              () => scriptReadyResolve()
            );
          }, "runBuild");
          if (enableBundling) {
            scriptPath4 = path3.join(
              getPagesTmpDir(),
              `./bundledWorker-${Math.random()}.mjs`
            );
            runBuild2 = /* @__PURE__ */ __name(async () => {
              const workerScriptDirectory = path3.dirname(workerScriptPath);
              let currentBundleDependencies = [];
              const bundle = await buildRawWorker({
                workerScriptPath: usingWorkerDirectory ? path3.join(workerScriptPath, "index.js") : workerScriptPath,
                outfile: scriptPath4,
                directory: directory ?? ".",
                nodejsCompatMode,
                local: true,
                sourcemap: true,
                watch: false,
                onEnd: /* @__PURE__ */ __name(() => scriptReadyResolve(), "onEnd"),
                defineNavigatorUserAgent,
                checkFetch
              });
              const bundleDependencies = Object.keys(bundle.dependencies).map((dep) => path3.resolve(workerScriptDirectory, dep)).filter(
                (resolvedDep) => !resolvedDep.includes(path3.normalize(singleWorkerScriptPath)) && !resolvedDep.includes(path3.normalize("/.wrangler/")) && resolvedDep.includes(path3.resolve(process.cwd()))
              );
              const bundleModules = bundle.modules.filter((module2) => !!module2.filePath).map(
                (module2) => path3.resolve(workerScriptDirectory, module2.filePath)
              );
              currentBundleDependencies = [...bundleDependencies, ...bundleModules];
              if (watchedBundleDependencies.length) {
                watcher.unwatch(watchedBundleDependencies);
              }
              watcher.add(currentBundleDependencies);
              watchedBundleDependencies = [...currentBundleDependencies];
            }, "runBuild");
          }
          const debouncedRunBuild = debounce(async () => {
            try {
              await runBuild2();
            } catch {
              logger.warn(
                `Failed to build ${singleWorkerScriptPath}. Continuing to serve the last successfully built version of the Worker.`
              );
            }
          }, 50);
          try {
            await runBuild2();
            watcher.on("all", async (eventName, p7) => {
              logger.debug(`\u{1F300} "${eventName}" event detected at ${p7}.`);
              if (eventName === "unlink") {
                return;
              }
              debouncedRunBuild();
            });
          } catch {
            throw new FatalError(`Failed to build ${singleWorkerScriptPath}.`);
          }
        } else if (usingFunctions) {
          scriptPath4 = path3.join(
            getPagesTmpDir(),
            `./functionsWorker-${Math.random()}.mjs`
          );
          const routesModule = path3.join(
            getPagesTmpDir(),
            `./functionsRoutes-${Math.random()}.mjs`
          );
          logger.debug(`Compiling worker to "${scriptPath4}"...`);
          const onEnd = /* @__PURE__ */ __name(() => scriptReadyResolve(), "onEnd");
          const watcher = watch([functionsDirectory], {
            persistent: true,
            ignoreInitial: true
          });
          let watchedBundleDependencies = [];
          const buildFn = /* @__PURE__ */ __name(async () => {
            let currentBundleDependencies = [];
            const bundle = await buildFunctions({
              outfile: scriptPath4,
              functionsDirectory,
              sourcemap: true,
              watch: false,
              onEnd,
              buildOutputDirectory: directory,
              nodejsCompatMode,
              local: true,
              routesModule,
              defineNavigatorUserAgent,
              checkFetch
            });
            const bundleDependencies = Object.keys(bundle.dependencies).map((dep) => path3.resolve(functionsDirectory, dep)).filter(
              (resolvedDep) => !resolvedDep.includes(path3.normalize("/functions/")) && !resolvedDep.includes(path3.normalize("/.wrangler/")) && resolvedDep.includes(path3.resolve(process.cwd()))
            );
            const bundleModules = bundle.modules.filter((module2) => !!module2.filePath).map(
              (module2) => path3.resolve(functionsDirectory, module2.filePath)
            );
            currentBundleDependencies = [...bundleDependencies, ...bundleModules];
            if (watchedBundleDependencies.length) {
              watcher.unwatch(watchedBundleDependencies);
            }
            watcher.add(currentBundleDependencies);
            watchedBundleDependencies = [...currentBundleDependencies];
            sendMetricsEvent("build pages functions");
          }, "buildFn");
          const debouncedBuildFn = debounce(async () => {
            try {
              await buildFn();
            } catch (e10) {
              if (e10 instanceof FunctionsNoRoutesError) {
                logger.warn(
                  `${getFunctionsNoRoutesWarning(functionsDirectory)}. Continuing to serve the last successfully built version of Functions.`
                );
              } else {
                logger.warn(
                  `Failed to build Functions at ${functionsDirectory}. Continuing to serve the last successfully built version of Functions.`
                );
              }
            }
          }, 50);
          try {
            await buildFn();
            watcher.on("all", async (eventName, p7) => {
              logger.debug(`\u{1F300} "${eventName}" event detected at ${p7}.`);
              debouncedBuildFn();
            });
          } catch (e10) {
            if (e10 instanceof FunctionsNoRoutesError) {
              logger.error(
                getFunctionsNoRoutesWarning(functionsDirectory, "skipping")
              );
              onEnd();
              usingFunctions = false;
            } else {
              throw new FatalError(
                `Failed to build Functions at ${functionsDirectory}.`
              );
            }
          }
        }
        if (!usingFunctions && !usingWorkerScript) {
          scriptReadyResolve();
          logger.log("No Functions. Shimming...");
          scriptPath4 = path3.resolve(getBasePath(), "templates/pages-shim.ts");
        }
        await scriptReadyPromise;
        if (scriptPath4 === "") {
          throw new Error(
            "Failed to start wrangler pages dev due to an unknown error"
          );
        }
        let scriptEntrypoint = scriptPath4;
        if (directory && (usingFunctions || usingWorkerScript || usingWorkerDirectory)) {
          const routesJSONPath = path3.join(directory, "_routes.json");
          if (fs29.existsSync(routesJSONPath)) {
            let routesJSONContents;
            const runBuild2 = /* @__PURE__ */ __name(async (entrypointFile, outfile, routes) => {
              await esbuild__namespace.build({
                entryPoints: [
                  path3.resolve(getBasePath(), "templates/pages-dev-pipeline.ts")
                ],
                bundle: true,
                sourcemap: true,
                format: "esm",
                plugins: [
                  esbuildAliasExternalPlugin({
                    __ENTRY_POINT__: entrypointFile,
                    "./pages-dev-util": path3.resolve(
                      getBasePath(),
                      "templates/pages-dev-util.ts"
                    )
                  })
                ],
                outfile,
                define: {
                  __ROUTES__: routes
                }
              });
            }, "runBuild");
            try {
              routesJSONContents = fs29.readFileSync(routesJSONPath, "utf-8");
              validateRoutes2(JSON.parse(routesJSONContents), directory);
              scriptEntrypoint = path3.join(
                getPagesTmpDir(),
                `${Math.random().toString(36).slice(2)}.js`
              );
              await runBuild2(scriptPath4, scriptEntrypoint, routesJSONContents);
            } catch (err) {
              if (err instanceof FatalError) {
                throw err;
              } else {
                throw new FatalError(
                  `Could not validate _routes.json at ${directory}: ${err}`,
                  1
                );
              }
            }
            watch([routesJSONPath], {
              persistent: true,
              ignoreInitial: true
            }).on("all", async (event) => {
              try {
                if (event === "unlink") {
                  return;
                }
                routesJSONContents = fs29.readFileSync(routesJSONPath, "utf-8");
                validateRoutes2(JSON.parse(routesJSONContents), directory);
                await runBuild2(scriptPath4, scriptEntrypoint, routesJSONContents);
              } catch (err) {
                const error2 = err instanceof FatalError ? err : `Could not validate _routes.json at ${directory}: ${err}`;
                const defaultRoutesJSONSpec = {
                  version: ROUTES_SPEC_VERSION,
                  include: ["/*"],
                  exclude: []
                };
                logger.error(error2);
                logger.warn(
                  `Ignoring provided _routes.json file, and falling back to the following default routes configuration:
${JSON.stringify(defaultRoutesJSONSpec, null, 2)}`
                );
                routesJSONContents = JSON.stringify(defaultRoutesJSONSpec);
                await runBuild2(scriptPath4, scriptEntrypoint, routesJSONContents);
              }
            });
          }
        }
        const configCache = getConfigCache(
          PAGES_CONFIG_CACHE_FILENAME
        );
        const projectName = config.name ?? configCache.project_name ?? path3__namespace.default.basename(process.cwd());
        const pagesEnvVars = getPagesEnvironmentVariables(projectName);
        const devServer = await run(
          {
            MULTIWORKER: Array.isArray(args.config),
            RESOURCES_PROVISION: false,
            AUTOCREATE_RESOURCES: false
          },
          () => startDev({
            script: scriptEntrypoint,
            _: [],
            $0: "",
            remote: false,
            local: true,
            d1Databases: d1_databases,
            testScheduled: false,
            enablePagesAssetsServiceBinding: {
              proxyPort,
              directory
            },
            forceLocal: true,
            liveReload: args.liveReload,
            showInteractiveDevSession: args.showInteractiveDevSession,
            processEntrypoint: true,
            additionalModules: modules,
            v: void 0,
            cwd: void 0,
            assets: void 0,
            name: void 0,
            noBundle: false,
            latest: false,
            routes: void 0,
            host: void 0,
            localUpstream: void 0,
            upstreamProtocol: void 0,
            var: cliVars,
            define: void 0,
            alias: void 0,
            jsxFactory: void 0,
            jsxFragment: void 0,
            tsconfig: void 0,
            minify: void 0,
            legacyEnv: void 0,
            env: void 0,
            envFile: void 0,
            ip,
            port,
            inspectorPort,
            inspectorIp: void 0,
            localProtocol,
            httpsKeyPath: args.httpsKeyPath,
            httpsCertPath: args.httpsCertPath,
            compatibilityDate,
            compatibilityFlags,
            nodeCompat: void 0,
            // CF_PAGES vars as defaults (can be overridden by config vars)
            defaultBindings: pagesEnvVars,
            vars: void 0,
            kv: kv_namespaces,
            durableObjects: do_bindings,
            r2: r2_buckets,
            services,
            ai: ai2,
            rules: usingWorkerDirectory ? [
              {
                type: "ESModule",
                globs: ["**/*.js", "**/*.mjs"]
              }
            ] : void 0,
            bundle: enableBundling,
            persistTo: args.persistTo,
            logLevel: args.logLevel ?? "log",
            experimentalProvision: void 0,
            experimentalAutoCreate: false,
            enableIpc: true,
            config: Array.isArray(args.config) ? args.config : void 0,
            site: void 0,
            siteInclude: void 0,
            siteExclude: void 0,
            enableContainers: false,
            types: false
          })
        );
        sendMetricsEvent("run pages dev");
        process.on("exit", CLEANUP);
        process.on("SIGINT", CLEANUP);
        process.on("SIGTERM", CLEANUP);
        await events__default.default.once(devServer.devEnv, "teardown");
        devServer.unregisterHotKeys?.();
        CLEANUP();
        process.exit(0);
      }
    });
    __name(isWindows4, "isWindows");
    __name(getPids, "getPids");
    __name(getPort, "getPort");
    __name(spawnProxyProcess, "spawnProxyProcess");
    __name(resolvePagesDevServerSettings, "resolvePagesDevServerSettings");
    __name(getBindingsFromArgs, "getBindingsFromArgs");
  }
});
async function toEnvironment(deploymentConfig, accountId) {
  const configObj = {};
  configObj.compatibility_date = deploymentConfig.compatibility_date ?? getTodaysCompatDate();
  if (deploymentConfig.always_use_latest_compatibility_date) {
    configObj.compatibility_date = getTodaysCompatDate();
  }
  if (deploymentConfig.compatibility_flags?.length) {
    configObj.compatibility_flags = deploymentConfig.compatibility_flags;
  }
  if (deploymentConfig.placement) {
    configObj.placement = deploymentConfig.placement;
  } else {
    configObj.placement = { mode: "off" };
  }
  if (deploymentConfig.limits) {
    configObj.limits = deploymentConfig.limits;
  }
  for (const [name2, envVar] of Object.entries(
    deploymentConfig.env_vars ?? {}
  )) {
    if (envVar?.value && envVar?.type == "plain_text") {
      configObj.vars ??= {};
      configObj.vars[name2] = envVar?.value;
    }
  }
  for (const [name2, namespace] of Object.entries(
    deploymentConfig.kv_namespaces ?? {}
  )) {
    configObj.kv_namespaces ??= [];
    configObj.kv_namespaces.push({ id: namespace.namespace_id, binding: name2 });
  }
  for (const [name2, ns] of Object.entries(
    deploymentConfig.durable_object_namespaces ?? {}
  )) {
    configObj.durable_objects ??= { bindings: [] };
    if (ns.class_name && ns.class_name !== "") {
      configObj.durable_objects.bindings.push({
        name: name2,
        class_name: ns.class_name,
        script_name: ns.service,
        environment: ns.environment
      });
    } else {
      const namespace = await fetchResult(
        COMPLIANCE_REGION_CONFIG_PUBLIC,
        `/accounts/${accountId}/workers/durable_objects/namespaces/${ns.namespace_id}`
      );
      configObj.durable_objects.bindings.push({
        name: name2,
        class_name: namespace.class,
        script_name: namespace.script,
        environment: namespace.environment
      });
    }
  }
  for (const [name2, namespace] of Object.entries(
    deploymentConfig.d1_databases ?? {}
  )) {
    configObj.d1_databases ??= [];
    configObj.d1_databases.push({
      database_id: namespace.id,
      binding: name2,
      database_name: name2
    });
  }
  for (const [name2, bucket] of Object.entries(
    deploymentConfig.r2_buckets ?? {}
  )) {
    configObj.r2_buckets ??= [];
    configObj.r2_buckets.push({
      bucket_name: bucket.name,
      binding: name2
    });
  }
  for (const [name2, { service, environment }] of Object.entries(
    deploymentConfig.services ?? {}
  )) {
    configObj.services ??= [];
    configObj.services.push({
      binding: name2,
      service,
      environment
    });
  }
  for (const [name2, queue] of Object.entries(
    deploymentConfig.queue_producers ?? {}
  )) {
    configObj.queues ??= { producers: [] };
    configObj.queues?.producers?.push({
      binding: name2,
      queue: queue.name
    });
  }
  for (const [name2, { dataset }] of Object.entries(
    deploymentConfig.analytics_engine_datasets ?? {}
  )) {
    configObj.analytics_engine_datasets ??= [];
    configObj.analytics_engine_datasets.push({
      binding: name2,
      dataset
    });
  }
  for (const [name2] of Object.entries(deploymentConfig.ai_bindings ?? {})) {
    configObj.ai = { binding: name2 };
  }
  return configObj;
}
async function writeWranglerToml(toml) {
  let tomlString = dist_default2.stringify(toml);
  tomlString = tomlString.split("\n").map((line) => line.trimStart()).join("\n");
  await fs9.writeFile(
    "wrangler.toml",
    `# Generated by Wrangler on ${/* @__PURE__ */ new Date()}
${tomlString}`
  );
}
function simplifyEnvironments(preview, production) {
  const topLevel = { ...preview };
  if (preview.compatibility_date === production.compatibility_date) {
    delete production.compatibility_date;
    delete preview.compatibility_date;
  }
  if (JSON.stringify(preview.compatibility_flags) === JSON.stringify(production.compatibility_flags)) {
    delete production.compatibility_flags;
    delete preview.compatibility_date;
  }
  if (JSON.stringify(preview.placement) === JSON.stringify(production.placement)) {
    delete production.placement;
    delete preview.placement;
    if (topLevel.placement?.mode === "off") {
      delete topLevel.placement;
    }
  }
  if (JSON.stringify(preview.limits) === JSON.stringify(production.limits)) {
    delete production.limits;
    delete preview.limits;
    return { topLevel, production };
  } else if (preview.limits && !production.limits) {
    delete topLevel.limits;
    return { topLevel, production, preview };
  }
  return { topLevel, production };
}
async function downloadProject(accountId, projectName) {
  const project = await fetchResult(
    COMPLIANCE_REGION_CONFIG_PUBLIC,
    `/accounts/${accountId}/pages/projects/${projectName}`
  );
  logger.debug(JSON.stringify(project, null, 2));
  const { topLevel, preview, production } = simplifyEnvironments(
    await toEnvironment(project.deployment_configs.preview, accountId),
    await toEnvironment(project.deployment_configs.production, accountId)
  );
  return {
    name: project.name,
    pages_build_output_dir: project.build_config.destination_dir,
    ...topLevel,
    ...{
      env: preview ? {
        preview,
        production
      } : {
        production
      }
    }
  };
}
var pagesDownloadConfigCommand;
var init_download_config = __esm({
  "src/pages/download-config.ts"() {
    init_import_meta_url();
    init_dist();
    init_source();
    init_dist5();
    init_cfetch();
    init_config_cache();
    init_create_command();
    init_dialogs();
    init_logger();
    init_metrics();
    init_user3();
    init_constants3();
    __name(toEnvironment, "toEnvironment");
    __name(writeWranglerToml, "writeWranglerToml");
    __name(simplifyEnvironments, "simplifyEnvironments");
    __name(downloadProject, "downloadProject");
    pagesDownloadConfigCommand = createCommand({
      metadata: {
        description: "Download your Pages project config as a Wrangler configuration file",
        status: "experimental",
        owner: "Workers: Authoring and Testing",
        hideGlobalFlags: ["config", "env"]
      },
      behaviour: {
        provideConfig: false
      },
      args: {
        projectName: {
          type: "string",
          description: "The Pages project to download"
        },
        force: {
          description: "Overwrite an existing Wrangler configuration file without prompting",
          type: "boolean"
        }
      },
      positionalArgs: ["projectName"],
      async handler({ projectName, force }) {
        void sendMetricsEvent("download pages config");
        const projectConfig = getConfigCache(
          PAGES_CONFIG_CACHE_FILENAME
        );
        const accountId = await requireAuth(projectConfig);
        projectName ??= projectConfig.project_name;
        if (!projectName) {
          throw new FatalError("Must specify a project name.", 1);
        }
        const config = await downloadProject(accountId, projectName);
        if (!force && fs29.existsSync("wrangler.toml")) {
          const overwrite = await confirm(
            "Your existing Wrangler configuration file will be overwritten. Continue?",
            { fallbackValue: false }
          );
          if (!overwrite) {
            throw new FatalError(
              "Not overwriting existing Wrangler configuration file"
            );
          }
        }
        await writeWranglerToml(config);
        logger.info(
          source_default.green(
            "Success! Your project settings have been downloaded to wrangler.toml"
          )
        );
      }
    });
  }
});
var pagesFunctionsOptimizeRoutesCommand;
var init_functions = __esm({
  "src/pages/functions.ts"() {
    init_import_meta_url();
    init_dist();
    init_create_command();
    init_routes_transformation();
    init_routes_validation();
    pagesFunctionsOptimizeRoutesCommand = createCommand({
      metadata: {
        description: "Consolidate and optimize route paths declared in _routes.json",
        status: "stable",
        owner: "Workers: Authoring and Testing",
        hidden: true
      },
      behaviour: {
        provideConfig: false
      },
      args: {
        routesPath: {
          type: "string",
          demandOption: true,
          description: "The location of the _routes.json file"
        },
        outputRoutesPath: {
          type: "string",
          demandOption: true,
          description: "The location of the optimized output routes file"
        }
      },
      async handler({ routesPath, outputRoutesPath }) {
        let routesFileContents;
        const routesOutputDirectory = path3__namespace.default.dirname(outputRoutesPath);
        if (!fs29.existsSync(routesPath)) {
          throw new FatalError(
            `Oops! File ${routesPath} does not exist. Please make sure --routes-path is a valid file path (for example "/public/_routes.json").`,
            1
          );
        }
        if (!fs29.lstatSync(routesOutputDirectory, {
          throwIfNoEntry: false
        })?.isDirectory()) {
          throw new FatalError(
            `Oops! Folder ${routesOutputDirectory} does not exist. Please make sure --output-routes-path is a valid file path (for example "/public/_routes.json").`,
            1
          );
        }
        try {
          routesFileContents = fs29.readFileSync(routesPath, "utf-8");
        } catch (err) {
          throw new FatalError(`Error while reading ${routesPath} file: ${err}`);
        }
        const routes = JSON.parse(routesFileContents);
        validateRoutes2(routes, routesPath);
        const optimizedRoutes = optimizeRoutesJSONSpec(routes);
        const optimizedRoutesContents = JSON.stringify(optimizedRoutes);
        try {
          fs29.writeFileSync(outputRoutesPath, optimizedRoutesContents);
        } catch (err) {
          throw new FatalError(
            `Error writing to ${outputRoutesPath} file: ${err}`,
            1
          );
        }
      }
    });
  }
});

// src/utils/fetch-secrets.ts
async function fetchSecrets(config, environment) {
  const accountId = await requireAuth(config);
  const isServiceEnv = environment && useServiceEnvironments(config);
  const scriptName = config.name;
  const url4 = isServiceEnv ? `/accounts/${accountId}/workers/services/${scriptName}/environments/${environment}/secrets` : `/accounts/${accountId}/workers/scripts/${scriptName}/secrets`;
  return fetchResult(config, url4);
}
var init_fetch_secrets = __esm({
  "src/utils/fetch-secrets.ts"() {
    init_import_meta_url();
    init_cfetch();
    init_user3();
    init_useServiceEnvironments();
    __name(fetchSecrets, "fetchSecrets");
  }
});

// src/utils/getLegacyScriptName.ts
function getLegacyScriptName(args, config) {
  return args.name && args.env && !useServiceEnvironments(config) ? `${args.name}-${args.env}` : args.name ?? config.name;
}
var init_getLegacyScriptName = __esm({
  "src/utils/getLegacyScriptName.ts"() {
    init_import_meta_url();
    init_useServiceEnvironments();
    __name(getLegacyScriptName, "getLegacyScriptName");
  }
});
async function createDraftWorker({
  config,
  args,
  accountId,
  scriptName
}) {
  const confirmation = await confirm(
    `There doesn't seem to be a Worker called "${scriptName}". Do you want to create a new Worker with that name and add secrets to it?`,
    // we want to default to true in non-interactive/CI contexts to preserve existing behaviour
    { defaultValue: true, fallbackValue: true }
  );
  if (!confirmation) {
    logger.log("Aborting. No secrets added.");
    return null;
  } else {
    logger.log(`\u{1F300} Creating new Worker "${scriptName}"...`);
  }
  await fetchResult(
    config,
    useServiceEnvironments(config) && args.env ? `/accounts/${accountId}/workers/services/${scriptName}/environments/${args.env}` : `/accounts/${accountId}/workers/scripts/${scriptName}`,
    {
      method: "PUT",
      body: createWorkerUploadForm(
        {
          main: {
            name: scriptName,
            filePath: void 0,
            content: `export default { fetch() {} }`,
            type: "esm"
          },
          modules: [],
          migrations: void 0,
          compatibility_date: void 0,
          compatibility_flags: void 0,
          keepVars: false,
          // this doesn't matter since it's a new script anyway
          keepSecrets: false,
          // this doesn't matter since it's a new script anyway
          logpush: false,
          sourceMaps: void 0,
          placement: void 0,
          tail_consumers: void 0,
          limits: void 0,
          assets: void 0,
          containers: void 0,
          observability: void 0,
          cache: void 0
        },
        {}
      )
    }
  );
}
function validateFileSecrets(content, jsonFilePath) {
  if (content === null || typeof content !== "object") {
    throw new FatalError(
      `The contents of "${jsonFilePath}" is not valid. It should be a JSON object of string values.`
    );
  }
  const entries2 = Object.entries(content);
  for (const [key, value] of entries2) {
    if (typeof value !== "string") {
      throw new FatalError(
        `The value for "${key}" in "${jsonFilePath}" is not a "string" instead it is of type "${typeof value}"`
      );
    }
  }
}
async function parseBulkInputToObject(input) {
  let content;
  let secretSource;
  let secretFormat;
  if (input) {
    secretSource = "file";
    const jsonFilePath = path3__namespace.default.resolve(input);
    const fileContent = readFileSync(jsonFilePath);
    try {
      content = parseJSON(fileContent);
      secretFormat = "json";
    } catch {
      content = (0, import_dotenv2.parse)(fileContent);
      secretFormat = "dotenv";
      if (Object.keys(content).length === 0) {
        throw new UserError(`The contents of "${input}" is not valid.`);
      }
    }
    validateFileSecrets(content, input);
  } else {
    secretSource = "stdin";
    try {
      const rl = S__default.default.createInterface({ input: process.stdin });
      let pipedInput = "";
      for await (const line of rl) {
        pipedInput += line;
      }
      try {
        content = parseJSON(pipedInput);
        secretFormat = "json";
      } catch (e10) {
        content = (0, import_dotenv2.parse)(pipedInput);
        secretFormat = "dotenv";
        if (Object.keys(content).length === 0) {
          throw e10;
        }
      }
    } catch {
      return;
    }
  }
  return { content, secretSource, secretFormat };
}
var import_dotenv2, import_undici18, VERSION_NOT_DEPLOYED_ERR_CODE, secretNamespace, secretPutCommand, secretDeleteCommand, secretListCommand, secretBulkCommand;
var init_secret = __esm({
  "src/secret/index.ts"() {
    init_import_meta_url();
    init_dist();
    import_dotenv2 = __toESM(require_main());
    import_undici18 = __toESM(require_undici());
    init_cfetch();
    init_create_command();
    init_create_worker_upload_form();
    init_dialogs();
    init_logger();
    init_metrics();
    init_user3();
    init_fetch_secrets();
    init_getLegacyScriptName();
    init_std();
    init_useServiceEnvironments();
    init_worker_not_found_error();
    VERSION_NOT_DEPLOYED_ERR_CODE = 10215;
    __name(createDraftWorker, "createDraftWorker");
    secretNamespace = createNamespace({
      metadata: {
        description: "\u{1F92B} Generate a secret that can be referenced in a Worker",
        status: "stable",
        owner: "Workers: Deploy and Config",
        category: "Compute & AI"
      }
    });
    secretPutCommand = createCommand({
      metadata: {
        description: "Create or update a secret for a Worker",
        status: "stable",
        owner: "Workers: Deploy and Config"
      },
      positionalArgs: ["key"],
      behaviour: {
        warnIfMultipleEnvsConfiguredButNoneSpecified: true
      },
      args: {
        key: {
          describe: "The variable name to be accessible in the Worker",
          type: "string",
          demandOption: true
        },
        name: {
          describe: "Name of the Worker. If this is not specified, it will default to the name specified in your Wrangler config file.",
          type: "string",
          requiresArg: true
        },
        "legacy-env": {
          type: "boolean",
          describe: "Use legacy environments",
          hidden: true
        }
      },
      async handler(args, { config }) {
        if (config.pages_build_output_dir) {
          throw new UserError(
            "It looks like you've run a Workers-specific command in a Pages project.\nFor Pages, please run `wrangler pages secret put` instead."
          );
        }
        const isServiceEnv = Boolean(useServiceEnvironments(config) && args.env);
        const scriptName = getLegacyScriptName(args, config);
        if (!scriptName) {
          throw new UserError(
            `Required Worker name missing. Please specify the Worker name in your ${configFileName(config.configPath)} file, or pass it as an argument with \`--name <worker-name>\``
          );
        }
        const accountId = await requireAuth(config);
        const isInteractive4 = process.stdin.isTTY;
        const secretValue = trimTrailingWhitespace(
          isInteractive4 ? await prompt("Enter a secret value:", { isSecret: true }) : await readFromStdin()
        );
        logger.log(
          `\u{1F300} Creating the secret for the Worker "${scriptName}" ${isServiceEnv ? `(${args.env})` : ""}`
        );
        async function submitSecret() {
          const url4 = isServiceEnv ? `/accounts/${accountId}/workers/services/${scriptName}/environments/${args.env}/secrets` : `/accounts/${accountId}/workers/scripts/${scriptName}/secrets`;
          try {
            return await fetchResult(config, url4, {
              method: "PUT",
              headers: { "Content-Type": "application/json" },
              body: JSON.stringify({
                name: args.key,
                text: secretValue,
                type: "secret_text"
              })
            });
          } catch (e10) {
            if (e10 instanceof APIError && e10.code === VERSION_NOT_DEPLOYED_ERR_CODE) {
              throw new UserError(
                "Secret edit failed. You attempted to modify a secret, but the latest version of your Worker isn't currently deployed.\nThis limitation exists to prevent accidental deployment when using Worker versions and secrets together.\nTo resolve this, you have two options:\n(1) use the `wrangler versions secret put` instead, which allows you to update secrets without deploying; or\n(2) deploy the latest version first, then modify secrets.\nAlternatively, you can use the Cloudflare dashboard to modify secrets and deploy the version."
              );
            } else {
              throw e10;
            }
          }
        }
        __name(submitSecret, "submitSecret");
        try {
          await submitSecret();
          sendMetricsEvent(
            "create encrypted variable",
            {
              secretOperation: "single",
              secretSource: isInteractive4 ? "interactive" : "stdin",
              hasEnvironment: Boolean(args.env)
            },
            {
              sendMetrics: config.send_metrics
            }
          );
        } catch (e10) {
          if (isWorkerNotFoundError(e10)) {
            const result = await createDraftWorker({
              config,
              args,
              accountId,
              scriptName
            });
            if (result === null) {
              return;
            }
            await submitSecret();
          } else {
            throw e10;
          }
        }
        logger.log(`\u2728 Success! Uploaded secret ${args.key}`);
      }
    });
    secretDeleteCommand = createCommand({
      metadata: {
        description: "Delete a secret from a Worker",
        status: "stable",
        owner: "Workers: Deploy and Config"
      },
      positionalArgs: ["key"],
      behaviour: {
        warnIfMultipleEnvsConfiguredButNoneSpecified: true
      },
      args: {
        key: {
          describe: "The variable name to be accessible in the Worker",
          type: "string",
          demandOption: true
        },
        name: {
          describe: "Name of the Worker. If this is not specified, it will default to the name specified in your Wrangler config file.",
          type: "string",
          requiresArg: true
        },
        "legacy-env": {
          type: "boolean",
          describe: "Use legacy environments",
          hidden: true
        }
      },
      async handler(args, { config }) {
        const isServiceEnv = useServiceEnvironments(config) && args.env;
        if (config.pages_build_output_dir) {
          throw new UserError(
            "It looks like you've run a Workers-specific command in a Pages project.\nFor Pages, please run `wrangler pages secret delete` instead."
          );
        }
        const scriptName = getLegacyScriptName(args, config);
        if (!scriptName) {
          throw new UserError(
            `Required Worker name missing. Please specify the Worker name in your ${configFileName(config.configPath)} file, or pass it as an argument with \`--name <worker-name>\``
          );
        }
        const accountId = await requireAuth(config);
        if (await confirm(
          `Are you sure you want to permanently delete the secret ${args.key} on the Worker ${scriptName}${isServiceEnv ? ` (${args.env})` : ""}?`
        )) {
          logger.log(
            `\u{1F300} Deleting the secret ${args.key} on the Worker ${scriptName}${isServiceEnv ? ` (${args.env})` : ""}`
          );
          const url4 = isServiceEnv ? `/accounts/${accountId}/workers/services/${scriptName}/environments/${args.env}/secrets` : `/accounts/${accountId}/workers/scripts/${scriptName}/secrets`;
          await fetchResult(
            config,
            `${url4}/${encodeURIComponent(args.key)}`,
            { method: "DELETE" },
            new URLSearchParams({
              url_encoded: "true"
            })
          );
          sendMetricsEvent("delete encrypted variable", {
            sendMetrics: config.send_metrics
          });
          logger.log(`\u2728 Success! Deleted secret ${args.key}`);
        }
      }
    });
    secretListCommand = createCommand({
      metadata: {
        description: "List all secrets for a Worker",
        status: "stable",
        owner: "Workers: Deploy and Config"
      },
      args: {
        name: {
          describe: "Name of the Worker. If this is not specified, it will default to the name specified in your Wrangler config file.",
          type: "string",
          requiresArg: true
        },
        format: {
          default: "json",
          choices: ["json", "pretty"],
          describe: "The format to print the secrets in"
        },
        "legacy-env": {
          type: "boolean",
          describe: "Use legacy environments",
          hidden: true
        }
      },
      behaviour: {
        printBanner: /* @__PURE__ */ __name((args) => args.format === "pretty", "printBanner")
      },
      async handler(args, { config }) {
        if (config.pages_build_output_dir) {
          throw new UserError(
            "It looks like you've run a Workers-specific command in a Pages project.\nFor Pages, please run `wrangler pages secret list` instead."
          );
        }
        const scriptName = getLegacyScriptName(args, config);
        if (!scriptName) {
          throw new UserError(
            `Required Worker name missing. Please specify the Worker name in your ${configFileName(config.configPath)} file, or pass it as an argument with \`--name <worker-name>\``
          );
        }
        let secrets;
        try {
          secrets = await fetchSecrets({ ...config, name: scriptName }, args.env);
        } catch (e10) {
          if (isWorkerNotFoundError(e10)) {
            throw new UserError(
              `Worker "${scriptName}"${args.env ? ` (env: ${args.env})` : ""} not found.

If this is a new Worker, run \`wrangler deploy\` first to create it.
Otherwise, check that the Worker name is correct and you're logged into the right account.`
            );
          }
          throw e10;
        }
        if (args.format === "pretty") {
          for (const workerSecret of secrets) {
            logger.log(`Secret Name: ${workerSecret.name}
`);
          }
        } else {
          logger.log(JSON.stringify(secrets, null, "  "));
        }
        sendMetricsEvent("list encrypted variables", {
          sendMetrics: config.send_metrics
        });
      }
    });
    secretBulkCommand = createCommand({
      metadata: {
        description: "Upload multiple secrets for a Worker at once",
        status: "stable",
        owner: "Workers: Deploy and Config"
      },
      positionalArgs: ["file"],
      behaviour: {
        warnIfMultipleEnvsConfiguredButNoneSpecified: true
      },
      args: {
        file: {
          describe: `The file of key-value pairs to upload, as JSON in form {"key": value, ...} or .env file in the form KEY=VALUE. If omitted, Wrangler expects to receive input from stdin rather than a file.`,
          type: "string"
        },
        name: {
          describe: "Name of the Worker. If this is not specified, it will default to the name specified in your Wrangler config file.",
          type: "string",
          requiresArg: true
        },
        "legacy-env": {
          type: "boolean",
          describe: "Use legacy environments",
          hidden: true
        }
      },
      async handler(args, { config }) {
        if (config.pages_build_output_dir) {
          throw new UserError(
            "It looks like you've run a Workers-specific command in a Pages project.\nFor Pages, please run `wrangler pages secret bulk` instead."
          );
        }
        const isServiceEnv = useServiceEnvironments(config) && args.env;
        const scriptName = getLegacyScriptName(args, config);
        if (!scriptName) {
          const error2 = new UserError(
            `Required Worker name missing. Please specify the Worker name in your ${configFileName(config.configPath)} file, or pass it as an argument with \`--name <worker-name>\``
          );
          logger.error(error2.message);
          throw error2;
        }
        const accountId = await requireAuth(config);
        logger.log(
          `\u{1F300} Creating the secrets for the Worker "${scriptName}" ${isServiceEnv ? `(${args.env})` : ""}`
        );
        const result = await parseBulkInputToObject(args.file);
        if (!result) {
          return logger.error(`\u{1F6A8} No content found in file, or piped input.`);
        }
        const { content, secretSource, secretFormat } = result;
        function getSettings3() {
          const url4 = isServiceEnv ? `/accounts/${accountId}/workers/services/${scriptName}/environments/${args.env}/settings` : `/accounts/${accountId}/workers/scripts/${scriptName}/settings`;
          return fetchResult(config, url4);
        }
        __name(getSettings3, "getSettings");
        function putBindingsSettings(bindings) {
          const url4 = isServiceEnv ? `/accounts/${accountId}/workers/services/${scriptName}/environments/${args.env}/settings` : `/accounts/${accountId}/workers/scripts/${scriptName}/settings`;
          const data = new import_undici18.FormData();
          data.set("settings", JSON.stringify({ bindings }));
          return fetchResult(config, url4, {
            method: "PATCH",
            body: data
          });
        }
        __name(putBindingsSettings, "putBindingsSettings");
        let existingBindings;
        try {
          const settings = await getSettings3();
          existingBindings = settings.bindings;
        } catch (e10) {
          if (isWorkerNotFoundError(e10)) {
            const draftWorkerResult = await createDraftWorker({
              config,
              args,
              accountId,
              scriptName
            });
            if (draftWorkerResult === null) {
              return;
            }
            existingBindings = [];
          } else {
            throw e10;
          }
        }
        const inheritBindings = existingBindings.filter((binding) => {
          return binding.type !== "secret_text" || content[binding.name] === void 0;
        }).map((binding) => ({ type: binding.type, name: binding.name }));
        const upsertBindings = Object.entries(
          content
        ).map(([key, value]) => {
          return {
            type: "secret_text",
            name: key,
            text: value
          };
        });
        try {
          await putBindingsSettings(inheritBindings.concat(upsertBindings));
          for (const upsertedBinding of upsertBindings) {
            logger.log(
              `\u2728 Successfully created secret for key: ${upsertedBinding.name}`
            );
          }
          logger.log("");
          logger.log("Finished processing secrets file:");
          logger.log(`\u2728 ${upsertBindings.length} secrets successfully uploaded`);
          sendMetricsEvent(
            "create encrypted variable",
            {
              secretOperation: "bulk",
              secretSource,
              secretFormat,
              hasEnvironment: Boolean(args.env)
            },
            {
              sendMetrics: config.send_metrics
            }
          );
        } catch (err) {
          logger.log("");
          logger.log(`\u{1F6A8} Secrets failed to upload`);
          throw err;
        }
      }
    });
    __name(validateFileSecrets, "validateFileSecrets");
    __name(parseBulkInputToObject, "parseBulkInputToObject");
  }
});

// src/pages/secret/index.ts
function isPagesEnv(env6) {
  return ["production", "preview"].includes(env6);
}
async function pagesProject(env6, cliProjectName) {
  env6 ??= "production";
  if (!isPagesEnv(env6)) {
    throw new FatalError(
      `Pages does not support the "${env6}" named environment. Please specify "production" (default) or "preview"`,
      1
    );
  }
  let config;
  const { configPath } = findWranglerConfig(process.cwd());
  try {
    config = readPagesConfig({ config: configPath, env: void 0 });
  } catch (err) {
    if (!(err instanceof FatalError && err.code === EXIT_CODE_INVALID_PAGES_CONFIG)) {
      throw err;
    }
  }
  if (configPath && config === void 0) {
    logger.warn(
      `Pages now has ${configFileName(configPath)} support.
We detected a configuration file at ${configPath} but it is missing the "pages_build_output_dir" field, required by Pages.
If you would like to use this configuration file for your project, please use "pages_build_output_dir" to specify the directory of static files to upload.
Ignoring configuration file for now.`
    );
  }
  const configCache = getConfigCache(
    PAGES_CONFIG_CACHE_FILENAME
  );
  const accountId = await requireAuth(configCache);
  const projectName = cliProjectName ?? config?.name ?? configCache.project_name;
  let project;
  if (projectName) {
    try {
      project = await fetchResult(
        COMPLIANCE_REGION_CONFIG_PUBLIC,
        `/accounts/${accountId}/pages/projects/${projectName}`
      );
    } catch (err) {
      if (err.code === 8000007) {
        throw new FatalError(`Project "${projectName}" does not exist.`, 1);
      }
      throw err;
    }
  } else {
    throw new FatalError("Must specify a project name.", 1);
  }
  return { env: env6, project, accountId, config };
}
var pagesSecretNamespace, pagesSecretPutCommand, pagesSecretBulkCommand, pagesSecretDeleteCommand, pagesSecretListCommand;
var init_secret2 = __esm({
  "src/pages/secret/index.ts"() {
    init_import_meta_url();
    init_dist();
    init_source();
    init_cfetch();
    init_config();
    init_config_cache();
    init_create_command();
    init_dialogs();
    init_is_interactive();
    init_logger();
    init_metrics();
    init_secret();
    init_user3();
    init_std();
    init_constants3();
    init_errors2();
    __name(isPagesEnv, "isPagesEnv");
    __name(pagesProject, "pagesProject");
    pagesSecretNamespace = createNamespace({
      metadata: {
        description: "Generate a secret that can be referenced in a Pages project",
        status: "stable",
        owner: "Workers: Authoring and Testing",
        hideGlobalFlags: ["config", "env"]
      }
    });
    pagesSecretPutCommand = createCommand({
      metadata: {
        description: "Create or update a secret variable for a Pages project",
        status: "stable",
        owner: "Workers: Authoring and Testing",
        hideGlobalFlags: ["config", "env"]
      },
      behaviour: {
        provideConfig: false
      },
      args: {
        key: {
          type: "string",
          description: "The variable name to be accessible in the Pages project",
          demandOption: true
        },
        "project-name": {
          type: "string",
          alias: ["project"],
          description: "The name of your Pages project"
        }
      },
      positionalArgs: ["key"],
      async handler(args) {
        const { env: env6, project, accountId, config } = await pagesProject(
          args.env,
          args.projectName
        );
        const secretValue = trimTrailingWhitespace(
          isInteractive3() ? await prompt("Enter a secret value:", { isSecret: true }) : await readFromStdin()
        );
        logger.log(
          `\u{1F300} Creating the secret for the Pages project "${project.name}" (${env6})`
        );
        await fetchResult(
          COMPLIANCE_REGION_CONFIG_PUBLIC,
          `/accounts/${accountId}/pages/projects/${project.name}`,
          {
            method: "PATCH",
            body: JSON.stringify({
              deployment_configs: {
                [env6]: {
                  env_vars: {
                    [args.key]: {
                      value: secretValue,
                      type: "secret_text"
                    }
                  },
                  wrangler_config_hash: project.deployment_configs[env6].wrangler_config_hash
                }
              }
            })
          }
        );
        sendMetricsEvent(
          "create pages encrypted variable",
          {
            secretOperation: "single",
            secretSource: isInteractive3() ? "interactive" : "stdin",
            hasEnvironment: Boolean(args.env)
          },
          {
            sendMetrics: config?.send_metrics
          }
        );
        logger.log(`\u2728 Success! Uploaded secret ${args.key}`);
      }
    });
    pagesSecretBulkCommand = createCommand({
      metadata: {
        description: "Bulk upload secrets for a Pages project",
        status: "stable",
        owner: "Workers: Authoring and Testing",
        hideGlobalFlags: ["config", "env"]
      },
      behaviour: {
        provideConfig: false
      },
      args: {
        file: {
          type: "string",
          description: `The file of key-value pairs to upload, as JSON in form {"key": value, ...} or .dev.vars file in the form KEY=VALUE`
        },
        "project-name": {
          type: "string",
          alias: ["project"],
          description: "The name of your Pages project"
        }
      },
      positionalArgs: ["file"],
      async handler(args) {
        const { env: env6, project, accountId, config } = await pagesProject(
          args.env,
          args.projectName
        );
        logger.log(
          `\u{1F300} Creating the secrets for the Pages project "${project.name}" (${env6})`
        );
        const result = await parseBulkInputToObject(args.file);
        if (!result) {
          throw new FatalError(`\u{1F6A8} No content found in file or piped input.`);
        }
        const { content, secretSource, secretFormat } = result;
        const upsertBindings = Object.fromEntries(
          Object.entries(content).map(([key, value]) => {
            return [
              key,
              {
                type: "secret_text",
                value
              }
            ];
          })
        );
        try {
          await fetchResult(
            COMPLIANCE_REGION_CONFIG_PUBLIC,
            `/accounts/${accountId}/pages/projects/${project.name}`,
            {
              method: "PATCH",
              body: JSON.stringify({
                deployment_configs: {
                  [env6]: {
                    env_vars: {
                      ...upsertBindings
                    },
                    wrangler_config_hash: project.deployment_configs[env6].wrangler_config_hash
                  }
                }
              })
            }
          );
          logger.log("Finished processing secrets file:");
          logger.log(
            `\u2728 ${Object.keys(upsertBindings).length} secrets successfully uploaded`
          );
          sendMetricsEvent(
            "create pages encrypted variable",
            {
              secretOperation: "bulk",
              secretSource,
              secretFormat,
              hasEnvironment: Boolean(args.env)
            },
            {
              sendMetrics: config?.send_metrics
            }
          );
        } catch (err) {
          logger.log(`\u{1F6A8} Secrets failed to upload`);
          throw err;
        }
      }
    });
    pagesSecretDeleteCommand = createCommand({
      metadata: {
        description: "Delete a secret variable from a Pages project",
        status: "stable",
        owner: "Workers: Authoring and Testing",
        hideGlobalFlags: ["config", "env"]
      },
      behaviour: {
        provideConfig: false
      },
      args: {
        key: {
          type: "string",
          description: "The variable name to be accessible in the Pages project",
          demandOption: true
        },
        "project-name": {
          type: "string",
          alias: ["project"],
          description: "The name of your Pages project"
        }
      },
      positionalArgs: ["key"],
      async handler(args) {
        const { env: env6, project, accountId, config } = await pagesProject(
          args.env,
          args.projectName
        );
        if (await confirm(
          `Are you sure you want to permanently delete the secret ${args.key} on the Pages project ${project.name} (${env6})?`
        )) {
          logger.log(
            `\u{1F300} Deleting the secret ${args.key} on the Pages project ${project.name} (${env6})`
          );
          await fetchResult(
            COMPLIANCE_REGION_CONFIG_PUBLIC,
            `/accounts/${accountId}/pages/projects/${project.name}`,
            {
              method: "PATCH",
              body: JSON.stringify({
                deployment_configs: {
                  [env6]: {
                    env_vars: {
                      [args.key]: null
                    },
                    wrangler_config_hash: project.deployment_configs[env6].wrangler_config_hash
                  }
                }
              })
            }
          );
          sendMetricsEvent("delete pages encrypted variable", {
            sendMetrics: config?.send_metrics
          });
          logger.log(`\u2728 Success! Deleted secret ${args.key}`);
        }
      }
    });
    pagesSecretListCommand = createCommand({
      metadata: {
        description: "List all secrets for a Pages project",
        status: "stable",
        owner: "Workers: Authoring and Testing",
        hideGlobalFlags: ["config", "env"]
      },
      behaviour: {
        provideConfig: false
      },
      args: {
        "project-name": {
          type: "string",
          alias: ["project"],
          description: "The name of your Pages project"
        }
      },
      async handler(args) {
        const { env: env6, project, config } = await pagesProject(
          args.env,
          args.projectName
        );
        const secrets = Object.entries(
          project.deployment_configs[env6].env_vars ?? {}
        ).filter(([_5, val2]) => val2?.type === "secret_text");
        const message = [
          `The "${source_default.blue(env6)}" environment of your Pages project "${source_default.blue(
            project.name
          )}" has access to the following secrets:`,
          ...secrets.map(
            ([name2]) => `  - ${name2}: ${source_default.italic("Value Encrypted")}`
          )
        ].join("\n");
        logger.log(message);
        sendMetricsEvent("list pages encrypted variables", {
          sendMetrics: config?.send_metrics
        });
      }
    });
  }
});

// ../../node_modules/.pnpm/@smithy+protocol-http@4.1.8/node_modules/@smithy/protocol-http/dist-es/extensions/httpExtensionConfiguration.js
var getHttpHandlerExtensionConfiguration, resolveHttpHandlerRuntimeConfig;
var init_httpExtensionConfiguration = __esm({
  "../../node_modules/.pnpm/@smithy+protocol-http@4.1.8/node_modules/@smithy/protocol-http/dist-es/extensions/httpExtensionConfiguration.js"() {
    init_import_meta_url();
    getHttpHandlerExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => {
      let httpHandler = runtimeConfig.httpHandler;
      return {
        setHttpHandler(handler) {
          httpHandler = handler;
        },
        httpHandler() {
          return httpHandler;
        },
        updateHttpClientConfig(key, value) {
          httpHandler.updateHttpClientConfig(key, value);
        },
        httpHandlerConfigs() {
          return httpHandler.httpHandlerConfigs();
        }
      };
    }, "getHttpHandlerExtensionConfiguration");
    resolveHttpHandlerRuntimeConfig = /* @__PURE__ */ __name((httpHandlerExtensionConfiguration) => {
      return {
        httpHandler: httpHandlerExtensionConfiguration.httpHandler()
      };
    }, "resolveHttpHandlerRuntimeConfig");
  }
});

// ../../node_modules/.pnpm/@smithy+protocol-http@4.1.8/node_modules/@smithy/protocol-http/dist-es/extensions/index.js
var init_extensions = __esm({
  "../../node_modules/.pnpm/@smithy+protocol-http@4.1.8/node_modules/@smithy/protocol-http/dist-es/extensions/index.js"() {
    init_import_meta_url();
    init_httpExtensionConfiguration();
  }
});

// ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/abort.js
var init_abort = __esm({
  "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/abort.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/auth/auth.js
var HttpAuthLocation;
var init_auth = __esm({
  "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/auth/auth.js"() {
    init_import_meta_url();
    (function(HttpAuthLocation2) {
      HttpAuthLocation2["HEADER"] = "header";
      HttpAuthLocation2["QUERY"] = "query";
    })(HttpAuthLocation || (HttpAuthLocation = {}));
  }
});

// ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/auth/HttpApiKeyAuth.js
var HttpApiKeyAuthLocation;
var init_HttpApiKeyAuth = __esm({
  "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/auth/HttpApiKeyAuth.js"() {
    init_import_meta_url();
    (function(HttpApiKeyAuthLocation2) {
      HttpApiKeyAuthLocation2["HEADER"] = "header";
      HttpApiKeyAuthLocation2["QUERY"] = "query";
    })(HttpApiKeyAuthLocation || (HttpApiKeyAuthLocation = {}));
  }
});

// ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/auth/HttpAuthScheme.js
var init_HttpAuthScheme = __esm({
  "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/auth/HttpAuthScheme.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/auth/HttpAuthSchemeProvider.js
var init_HttpAuthSchemeProvider = __esm({
  "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/auth/HttpAuthSchemeProvider.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/auth/HttpSigner.js
var init_HttpSigner = __esm({
  "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/auth/HttpSigner.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/auth/IdentityProviderConfig.js
var init_IdentityProviderConfig = __esm({
  "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/auth/IdentityProviderConfig.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/auth/index.js
var init_auth2 = __esm({
  "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/auth/index.js"() {
    init_import_meta_url();
    init_auth();
    init_HttpApiKeyAuth();
    init_HttpAuthScheme();
    init_HttpAuthSchemeProvider();
    init_HttpSigner();
    init_IdentityProviderConfig();
  }
});

// ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/blob/blob-payload-input-types.js
var init_blob_payload_input_types = __esm({
  "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/blob/blob-payload-input-types.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/checksum.js
var init_checksum = __esm({
  "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/checksum.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/client.js
var init_client7 = __esm({
  "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/client.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/command.js
var init_command4 = __esm({
  "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/command.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/connection/config.js
var init_config8 = __esm({
  "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/connection/config.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/connection/manager.js
var init_manager = __esm({
  "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/connection/manager.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/connection/pool.js
var init_pool = __esm({
  "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/connection/pool.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/connection/index.js
var init_connection = __esm({
  "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/connection/index.js"() {
    init_import_meta_url();
    init_config8();
    init_manager();
    init_pool();
  }
});

// ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/crypto.js
var init_crypto = __esm({
  "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/crypto.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/encode.js
var init_encode = __esm({
  "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/encode.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/endpoint.js
var EndpointURLScheme;
var init_endpoint = __esm({
  "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/endpoint.js"() {
    init_import_meta_url();
    (function(EndpointURLScheme2) {
      EndpointURLScheme2["HTTP"] = "http";
      EndpointURLScheme2["HTTPS"] = "https";
    })(EndpointURLScheme || (EndpointURLScheme = {}));
  }
});

// ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/endpoints/EndpointRuleObject.js
var init_EndpointRuleObject = __esm({
  "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/endpoints/EndpointRuleObject.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/endpoints/ErrorRuleObject.js
var init_ErrorRuleObject = __esm({
  "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/endpoints/ErrorRuleObject.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/endpoints/RuleSetObject.js
var init_RuleSetObject = __esm({
  "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/endpoints/RuleSetObject.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/endpoints/shared.js
var init_shared3 = __esm({
  "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/endpoints/shared.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/endpoints/TreeRuleObject.js
var init_TreeRuleObject = __esm({
  "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/endpoints/TreeRuleObject.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/endpoints/index.js
var init_endpoints = __esm({
  "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/endpoints/index.js"() {
    init_import_meta_url();
    init_EndpointRuleObject();
    init_ErrorRuleObject();
    init_RuleSetObject();
    init_shared3();
    init_TreeRuleObject();
  }
});

// ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/eventStream.js
var init_eventStream = __esm({
  "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/eventStream.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/extensions/checksum.js
var AlgorithmId;
var init_checksum2 = __esm({
  "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/extensions/checksum.js"() {
    init_import_meta_url();
    (function(AlgorithmId2) {
      AlgorithmId2["MD5"] = "md5";
      AlgorithmId2["CRC32"] = "crc32";
      AlgorithmId2["CRC32C"] = "crc32c";
      AlgorithmId2["SHA1"] = "sha1";
      AlgorithmId2["SHA256"] = "sha256";
    })(AlgorithmId || (AlgorithmId = {}));
  }
});

// ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/extensions/defaultClientConfiguration.js
var init_defaultClientConfiguration = __esm({
  "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/extensions/defaultClientConfiguration.js"() {
    init_import_meta_url();
    init_checksum2();
  }
});

// ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/extensions/defaultExtensionConfiguration.js
var init_defaultExtensionConfiguration = __esm({
  "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/extensions/defaultExtensionConfiguration.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/extensions/index.js
var init_extensions2 = __esm({
  "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/extensions/index.js"() {
    init_import_meta_url();
    init_defaultClientConfiguration();
    init_defaultExtensionConfiguration();
    init_checksum2();
  }
});

// ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/feature-ids.js
var init_feature_ids = __esm({
  "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/feature-ids.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/http.js
var FieldPosition;
var init_http5 = __esm({
  "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/http.js"() {
    init_import_meta_url();
    (function(FieldPosition2) {
      FieldPosition2[FieldPosition2["HEADER"] = 0] = "HEADER";
      FieldPosition2[FieldPosition2["TRAILER"] = 1] = "TRAILER";
    })(FieldPosition || (FieldPosition = {}));
  }
});

// ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/http/httpHandlerInitialization.js
var init_httpHandlerInitialization = __esm({
  "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/http/httpHandlerInitialization.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/identity/apiKeyIdentity.js
var init_apiKeyIdentity = __esm({
  "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/identity/apiKeyIdentity.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/identity/awsCredentialIdentity.js
var init_awsCredentialIdentity = __esm({
  "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/identity/awsCredentialIdentity.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/identity/identity.js
var init_identity = __esm({
  "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/identity/identity.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/identity/tokenIdentity.js
var init_tokenIdentity = __esm({
  "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/identity/tokenIdentity.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/identity/index.js
var init_identity2 = __esm({
  "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/identity/index.js"() {
    init_import_meta_url();
    init_apiKeyIdentity();
    init_awsCredentialIdentity();
    init_identity();
    init_tokenIdentity();
  }
});

// ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/logger.js
var init_logger4 = __esm({
  "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/logger.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/middleware.js
var SMITHY_CONTEXT_KEY;
var init_middleware2 = __esm({
  "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/middleware.js"() {
    init_import_meta_url();
    SMITHY_CONTEXT_KEY = "__smithy_context";
  }
});

// ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/pagination.js
var init_pagination2 = __esm({
  "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/pagination.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/profile.js
var IniSectionType;
var init_profile2 = __esm({
  "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/profile.js"() {
    init_import_meta_url();
    (function(IniSectionType2) {
      IniSectionType2["PROFILE"] = "profile";
      IniSectionType2["SSO_SESSION"] = "sso-session";
      IniSectionType2["SERVICES"] = "services";
    })(IniSectionType || (IniSectionType = {}));
  }
});

// ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/response.js
var init_response = __esm({
  "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/response.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/retry.js
var init_retry2 = __esm({
  "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/retry.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/serde.js
var init_serde = __esm({
  "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/serde.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/shapes.js
var init_shapes = __esm({
  "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/shapes.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/signature.js
var init_signature = __esm({
  "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/signature.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/stream.js
var init_stream3 = __esm({
  "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/stream.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/streaming-payload/streaming-blob-common-types.js
var init_streaming_blob_common_types = __esm({
  "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/streaming-payload/streaming-blob-common-types.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/streaming-payload/streaming-blob-payload-input-types.js
var init_streaming_blob_payload_input_types = __esm({
  "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/streaming-payload/streaming-blob-payload-input-types.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/streaming-payload/streaming-blob-payload-output-types.js
var init_streaming_blob_payload_output_types = __esm({
  "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/streaming-payload/streaming-blob-payload-output-types.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/transfer.js
var RequestHandlerProtocol;
var init_transfer = __esm({
  "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/transfer.js"() {
    init_import_meta_url();
    (function(RequestHandlerProtocol2) {
      RequestHandlerProtocol2["HTTP_0_9"] = "http/0.9";
      RequestHandlerProtocol2["HTTP_1_0"] = "http/1.0";
      RequestHandlerProtocol2["TDS_8_0"] = "tds/8.0";
    })(RequestHandlerProtocol || (RequestHandlerProtocol = {}));
  }
});

// ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/transform/client-payload-blob-type-narrow.js
var init_client_payload_blob_type_narrow = __esm({
  "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/transform/client-payload-blob-type-narrow.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/transform/no-undefined.js
var init_no_undefined = __esm({
  "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/transform/no-undefined.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/transform/type-transform.js
var init_type_transform = __esm({
  "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/transform/type-transform.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/uri.js
var init_uri = __esm({
  "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/uri.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/util.js
var init_util4 = __esm({
  "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/util.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/waiter.js
var init_waiter = __esm({
  "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/waiter.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/index.js
var init_dist_es = __esm({
  "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/index.js"() {
    init_import_meta_url();
    init_abort();
    init_auth2();
    init_blob_payload_input_types();
    init_checksum();
    init_client7();
    init_command4();
    init_connection();
    init_crypto();
    init_encode();
    init_endpoint();
    init_endpoints();
    init_eventStream();
    init_extensions2();
    init_feature_ids();
    init_http5();
    init_httpHandlerInitialization();
    init_identity2();
    init_logger4();
    init_middleware2();
    init_pagination2();
    init_profile2();
    init_response();
    init_retry2();
    init_serde();
    init_shapes();
    init_signature();
    init_stream3();
    init_streaming_blob_common_types();
    init_streaming_blob_payload_input_types();
    init_streaming_blob_payload_output_types();
    init_transfer();
    init_client_payload_blob_type_narrow();
    init_no_undefined();
    init_type_transform();
    init_uri();
    init_util4();
    init_waiter();
  }
});

// ../../node_modules/.pnpm/@smithy+protocol-http@4.1.8/node_modules/@smithy/protocol-http/dist-es/Field.js
var init_Field = __esm({
  "../../node_modules/.pnpm/@smithy+protocol-http@4.1.8/node_modules/@smithy/protocol-http/dist-es/Field.js"() {
    init_import_meta_url();
    init_dist_es();
  }
});

// ../../node_modules/.pnpm/@smithy+protocol-http@4.1.8/node_modules/@smithy/protocol-http/dist-es/Fields.js
var init_Fields = __esm({
  "../../node_modules/.pnpm/@smithy+protocol-http@4.1.8/node_modules/@smithy/protocol-http/dist-es/Fields.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+protocol-http@4.1.8/node_modules/@smithy/protocol-http/dist-es/httpHandler.js
var init_httpHandler = __esm({
  "../../node_modules/.pnpm/@smithy+protocol-http@4.1.8/node_modules/@smithy/protocol-http/dist-es/httpHandler.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+protocol-http@4.1.8/node_modules/@smithy/protocol-http/dist-es/httpRequest.js
function cloneQuery(query) {
  return Object.keys(query).reduce((carry, paramName) => {
    const param = query[paramName];
    return {
      ...carry,
      [paramName]: Array.isArray(param) ? [...param] : param
    };
  }, {});
}
var HttpRequest;
var init_httpRequest = __esm({
  "../../node_modules/.pnpm/@smithy+protocol-http@4.1.8/node_modules/@smithy/protocol-http/dist-es/httpRequest.js"() {
    init_import_meta_url();
    HttpRequest = class _HttpRequest {
      static {
        __name(this, "HttpRequest");
      }
      constructor(options) {
        this.method = options.method || "GET";
        this.hostname = options.hostname || "localhost";
        this.port = options.port;
        this.query = options.query || {};
        this.headers = options.headers || {};
        this.body = options.body;
        this.protocol = options.protocol ? options.protocol.slice(-1) !== ":" ? `${options.protocol}:` : options.protocol : "https:";
        this.path = options.path ? options.path.charAt(0) !== "/" ? `/${options.path}` : options.path : "/";
        this.username = options.username;
        this.password = options.password;
        this.fragment = options.fragment;
      }
      static clone(request4) {
        const cloned = new _HttpRequest({
          ...request4,
          headers: { ...request4.headers }
        });
        if (cloned.query) {
          cloned.query = cloneQuery(cloned.query);
        }
        return cloned;
      }
      static isInstance(request4) {
        if (!request4) {
          return false;
        }
        const req = request4;
        return "method" in req && "protocol" in req && "hostname" in req && "path" in req && typeof req["query"] === "object" && typeof req["headers"] === "object";
      }
      clone() {
        return _HttpRequest.clone(this);
      }
    };
    __name(cloneQuery, "cloneQuery");
  }
});

// ../../node_modules/.pnpm/@smithy+protocol-http@4.1.8/node_modules/@smithy/protocol-http/dist-es/httpResponse.js
var HttpResponse;
var init_httpResponse = __esm({
  "../../node_modules/.pnpm/@smithy+protocol-http@4.1.8/node_modules/@smithy/protocol-http/dist-es/httpResponse.js"() {
    init_import_meta_url();
    HttpResponse = class {
      static {
        __name(this, "HttpResponse");
      }
      constructor(options) {
        this.statusCode = options.statusCode;
        this.reason = options.reason;
        this.headers = options.headers || {};
        this.body = options.body;
      }
      static isInstance(response) {
        if (!response)
          return false;
        const resp = response;
        return typeof resp.statusCode === "number" && typeof resp.headers === "object";
      }
    };
  }
});

// ../../node_modules/.pnpm/@smithy+protocol-http@4.1.8/node_modules/@smithy/protocol-http/dist-es/isValidHostname.js
function isValidHostname(hostname2) {
  const hostPattern = /^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/;
  return hostPattern.test(hostname2);
}
var init_isValidHostname = __esm({
  "../../node_modules/.pnpm/@smithy+protocol-http@4.1.8/node_modules/@smithy/protocol-http/dist-es/isValidHostname.js"() {
    init_import_meta_url();
    __name(isValidHostname, "isValidHostname");
  }
});

// ../../node_modules/.pnpm/@smithy+protocol-http@4.1.8/node_modules/@smithy/protocol-http/dist-es/types.js
var init_types6 = __esm({
  "../../node_modules/.pnpm/@smithy+protocol-http@4.1.8/node_modules/@smithy/protocol-http/dist-es/types.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+protocol-http@4.1.8/node_modules/@smithy/protocol-http/dist-es/index.js
var init_dist_es2 = __esm({
  "../../node_modules/.pnpm/@smithy+protocol-http@4.1.8/node_modules/@smithy/protocol-http/dist-es/index.js"() {
    init_import_meta_url();
    init_extensions();
    init_Field();
    init_Fields();
    init_httpHandler();
    init_httpRequest();
    init_httpResponse();
    init_isValidHostname();
    init_types6();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+middleware-expect-continue@3.714.0/node_modules/@aws-sdk/middleware-expect-continue/dist-es/index.js
function addExpectContinueMiddleware(options) {
  return (next) => async (args) => {
    const { request: request4 } = args;
    if (HttpRequest.isInstance(request4) && request4.body && options.runtime === "node") {
      if (options.requestHandler?.constructor?.name !== "FetchHttpHandler") {
        request4.headers = {
          ...request4.headers,
          Expect: "100-continue"
        };
      }
    }
    return next({
      ...args,
      request: request4
    });
  };
}
var addExpectContinueMiddlewareOptions, getAddExpectContinuePlugin;
var init_dist_es3 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+middleware-expect-continue@3.714.0/node_modules/@aws-sdk/middleware-expect-continue/dist-es/index.js"() {
    init_import_meta_url();
    init_dist_es2();
    __name(addExpectContinueMiddleware, "addExpectContinueMiddleware");
    addExpectContinueMiddlewareOptions = {
      step: "build",
      tags: ["SET_EXPECT_HEADER", "EXPECT_HEADER"],
      name: "addExpectContinueMiddleware",
      override: true
    };
    getAddExpectContinuePlugin = /* @__PURE__ */ __name((options) => ({
      applyToStack: /* @__PURE__ */ __name((clientStack) => {
        clientStack.add(addExpectContinueMiddleware(options), addExpectContinueMiddlewareOptions);
      }, "applyToStack")
    }), "getAddExpectContinuePlugin");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+middleware-flexible-checksums@3.717.0/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/constants.js
var RequestChecksumCalculation, DEFAULT_REQUEST_CHECKSUM_CALCULATION, ResponseChecksumValidation, DEFAULT_RESPONSE_CHECKSUM_VALIDATION, ChecksumAlgorithm, ChecksumLocation, DEFAULT_CHECKSUM_ALGORITHM, S3_EXPRESS_DEFAULT_CHECKSUM_ALGORITHM;
var init_constants8 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+middleware-flexible-checksums@3.717.0/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/constants.js"() {
    init_import_meta_url();
    RequestChecksumCalculation = {
      WHEN_SUPPORTED: "WHEN_SUPPORTED",
      WHEN_REQUIRED: "WHEN_REQUIRED"
    };
    DEFAULT_REQUEST_CHECKSUM_CALCULATION = RequestChecksumCalculation.WHEN_SUPPORTED;
    ResponseChecksumValidation = {
      WHEN_SUPPORTED: "WHEN_SUPPORTED",
      WHEN_REQUIRED: "WHEN_REQUIRED"
    };
    DEFAULT_RESPONSE_CHECKSUM_VALIDATION = RequestChecksumCalculation.WHEN_SUPPORTED;
    (function(ChecksumAlgorithm2) {
      ChecksumAlgorithm2["MD5"] = "MD5";
      ChecksumAlgorithm2["CRC32"] = "CRC32";
      ChecksumAlgorithm2["CRC32C"] = "CRC32C";
      ChecksumAlgorithm2["SHA1"] = "SHA1";
      ChecksumAlgorithm2["SHA256"] = "SHA256";
    })(ChecksumAlgorithm || (ChecksumAlgorithm = {}));
    (function(ChecksumLocation2) {
      ChecksumLocation2["HEADER"] = "header";
      ChecksumLocation2["TRAILER"] = "trailer";
    })(ChecksumLocation || (ChecksumLocation = {}));
    DEFAULT_CHECKSUM_ALGORITHM = ChecksumAlgorithm.MD5;
    S3_EXPRESS_DEFAULT_CHECKSUM_ALGORITHM = ChecksumAlgorithm.CRC32;
  }
});

// ../../node_modules/.pnpm/@aws-sdk+middleware-flexible-checksums@3.717.0/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/stringUnionSelector.js
var SelectorType, stringUnionSelector;
var init_stringUnionSelector = __esm({
  "../../node_modules/.pnpm/@aws-sdk+middleware-flexible-checksums@3.717.0/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/stringUnionSelector.js"() {
    init_import_meta_url();
    (function(SelectorType3) {
      SelectorType3["ENV"] = "env";
      SelectorType3["CONFIG"] = "shared config entry";
    })(SelectorType || (SelectorType = {}));
    stringUnionSelector = /* @__PURE__ */ __name((obj, key, union, type) => {
      if (!(key in obj))
        return void 0;
      const value = obj[key].toUpperCase();
      if (!Object.values(union).includes(value)) {
        throw new TypeError(`Cannot load ${type} '${key}'. Expected one of ${Object.values(union)}, got '${obj[key]}'.`);
      }
      return value;
    }, "stringUnionSelector");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+middleware-flexible-checksums@3.717.0/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/NODE_REQUEST_CHECKSUM_CALCULATION_CONFIG_OPTIONS.js
var ENV_REQUEST_CHECKSUM_CALCULATION, CONFIG_REQUEST_CHECKSUM_CALCULATION, NODE_REQUEST_CHECKSUM_CALCULATION_CONFIG_OPTIONS;
var init_NODE_REQUEST_CHECKSUM_CALCULATION_CONFIG_OPTIONS = __esm({
  "../../node_modules/.pnpm/@aws-sdk+middleware-flexible-checksums@3.717.0/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/NODE_REQUEST_CHECKSUM_CALCULATION_CONFIG_OPTIONS.js"() {
    init_import_meta_url();
    init_constants8();
    init_stringUnionSelector();
    ENV_REQUEST_CHECKSUM_CALCULATION = "AWS_REQUEST_CHECKSUM_CALCULATION";
    CONFIG_REQUEST_CHECKSUM_CALCULATION = "request_checksum_calculation";
    NODE_REQUEST_CHECKSUM_CALCULATION_CONFIG_OPTIONS = {
      environmentVariableSelector: /* @__PURE__ */ __name((env6) => stringUnionSelector(env6, ENV_REQUEST_CHECKSUM_CALCULATION, RequestChecksumCalculation, SelectorType.ENV), "environmentVariableSelector"),
      configFileSelector: /* @__PURE__ */ __name((profile) => stringUnionSelector(profile, CONFIG_REQUEST_CHECKSUM_CALCULATION, RequestChecksumCalculation, SelectorType.CONFIG), "configFileSelector"),
      default: DEFAULT_REQUEST_CHECKSUM_CALCULATION
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+middleware-flexible-checksums@3.717.0/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/NODE_RESPONSE_CHECKSUM_VALIDATION_CONFIG_OPTIONS.js
var ENV_RESPONSE_CHECKSUM_VALIDATION, CONFIG_RESPONSE_CHECKSUM_VALIDATION, NODE_RESPONSE_CHECKSUM_VALIDATION_CONFIG_OPTIONS;
var init_NODE_RESPONSE_CHECKSUM_VALIDATION_CONFIG_OPTIONS = __esm({
  "../../node_modules/.pnpm/@aws-sdk+middleware-flexible-checksums@3.717.0/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/NODE_RESPONSE_CHECKSUM_VALIDATION_CONFIG_OPTIONS.js"() {
    init_import_meta_url();
    init_constants8();
    init_stringUnionSelector();
    ENV_RESPONSE_CHECKSUM_VALIDATION = "AWS_RESPONSE_CHECKSUM_VALIDATION";
    CONFIG_RESPONSE_CHECKSUM_VALIDATION = "response_checksum_validation";
    NODE_RESPONSE_CHECKSUM_VALIDATION_CONFIG_OPTIONS = {
      environmentVariableSelector: /* @__PURE__ */ __name((env6) => stringUnionSelector(env6, ENV_RESPONSE_CHECKSUM_VALIDATION, ResponseChecksumValidation, SelectorType.ENV), "environmentVariableSelector"),
      configFileSelector: /* @__PURE__ */ __name((profile) => stringUnionSelector(profile, CONFIG_RESPONSE_CHECKSUM_VALIDATION, ResponseChecksumValidation, SelectorType.CONFIG), "configFileSelector"),
      default: DEFAULT_RESPONSE_CHECKSUM_VALIDATION
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/client/emitWarningIfUnsupportedVersion.js
var state, emitWarningIfUnsupportedVersion;
var init_emitWarningIfUnsupportedVersion = __esm({
  "../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/client/emitWarningIfUnsupportedVersion.js"() {
    init_import_meta_url();
    state = {
      warningEmitted: false
    };
    emitWarningIfUnsupportedVersion = /* @__PURE__ */ __name((version5) => {
      if (version5 && !state.warningEmitted && parseInt(version5.substring(1, version5.indexOf("."))) < 18) {
        state.warningEmitted = true;
        process.emitWarning(`NodeDeprecationWarning: The AWS SDK for JavaScript (v3) will
no longer support Node.js 16.x on January 6, 2025.

To continue receiving updates to AWS services, bug fixes, and security
updates please upgrade to a supported Node.js LTS version.

More information can be found at: https://a.co/74kJMmI`);
      }
    }, "emitWarningIfUnsupportedVersion");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/client/setCredentialFeature.js
function setCredentialFeature(credentials, feature, value) {
  if (!credentials.$source) {
    credentials.$source = {};
  }
  credentials.$source[feature] = value;
  return credentials;
}
var init_setCredentialFeature = __esm({
  "../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/client/setCredentialFeature.js"() {
    init_import_meta_url();
    __name(setCredentialFeature, "setCredentialFeature");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/client/setFeature.js
function setFeature(context2, feature, value) {
  if (!context2.__aws_sdk_context) {
    context2.__aws_sdk_context = {
      features: {}
    };
  } else if (!context2.__aws_sdk_context.features) {
    context2.__aws_sdk_context.features = {};
  }
  context2.__aws_sdk_context.features[feature] = value;
}
var init_setFeature = __esm({
  "../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/client/setFeature.js"() {
    init_import_meta_url();
    __name(setFeature, "setFeature");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/client/index.js
var init_client8 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/client/index.js"() {
    init_import_meta_url();
    init_emitWarningIfUnsupportedVersion();
    init_setCredentialFeature();
    init_setFeature();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getDateHeader.js
var getDateHeader;
var init_getDateHeader = __esm({
  "../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getDateHeader.js"() {
    init_import_meta_url();
    init_dist_es2();
    getDateHeader = /* @__PURE__ */ __name((response) => HttpResponse.isInstance(response) ? response.headers?.date ?? response.headers?.Date : void 0, "getDateHeader");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getSkewCorrectedDate.js
var getSkewCorrectedDate;
var init_getSkewCorrectedDate = __esm({
  "../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getSkewCorrectedDate.js"() {
    init_import_meta_url();
    getSkewCorrectedDate = /* @__PURE__ */ __name((systemClockOffset) => new Date(Date.now() + systemClockOffset), "getSkewCorrectedDate");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/isClockSkewed.js
var isClockSkewed;
var init_isClockSkewed = __esm({
  "../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/isClockSkewed.js"() {
    init_import_meta_url();
    init_getSkewCorrectedDate();
    isClockSkewed = /* @__PURE__ */ __name((clockTime, systemClockOffset) => Math.abs(getSkewCorrectedDate(systemClockOffset).getTime() - clockTime) >= 3e5, "isClockSkewed");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getUpdatedSystemClockOffset.js
var getUpdatedSystemClockOffset;
var init_getUpdatedSystemClockOffset = __esm({
  "../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getUpdatedSystemClockOffset.js"() {
    init_import_meta_url();
    init_isClockSkewed();
    getUpdatedSystemClockOffset = /* @__PURE__ */ __name((clockTime, currentSystemClockOffset) => {
      const clockTimeInMs = Date.parse(clockTime);
      if (isClockSkewed(clockTimeInMs, currentSystemClockOffset)) {
        return clockTimeInMs - Date.now();
      }
      return currentSystemClockOffset;
    }, "getUpdatedSystemClockOffset");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/index.js
var init_utils13 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/index.js"() {
    init_import_meta_url();
    init_getDateHeader();
    init_getSkewCorrectedDate();
    init_getUpdatedSystemClockOffset();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.js
var throwSigningPropertyError, validateSigningProperties, AwsSdkSigV4Signer;
var init_AwsSdkSigV4Signer = __esm({
  "../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.js"() {
    init_import_meta_url();
    init_dist_es2();
    init_utils13();
    throwSigningPropertyError = /* @__PURE__ */ __name((name2, property) => {
      if (!property) {
        throw new Error(`Property \`${name2}\` is not resolved for AWS SDK SigV4Auth`);
      }
      return property;
    }, "throwSigningPropertyError");
    validateSigningProperties = /* @__PURE__ */ __name(async (signingProperties) => {
      const context2 = throwSigningPropertyError("context", signingProperties.context);
      const config = throwSigningPropertyError("config", signingProperties.config);
      const authScheme = context2.endpointV2?.properties?.authSchemes?.[0];
      const signerFunction = throwSigningPropertyError("signer", config.signer);
      const signer = await signerFunction(authScheme);
      const signingRegion = signingProperties?.signingRegion;
      const signingRegionSet = signingProperties?.signingRegionSet;
      const signingName = signingProperties?.signingName;
      return {
        config,
        signer,
        signingRegion,
        signingRegionSet,
        signingName
      };
    }, "validateSigningProperties");
    AwsSdkSigV4Signer = class {
      static {
        __name(this, "AwsSdkSigV4Signer");
      }
      async sign(httpRequest2, identity, signingProperties) {
        if (!HttpRequest.isInstance(httpRequest2)) {
          throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");
        }
        const validatedProps = await validateSigningProperties(signingProperties);
        const { config, signer } = validatedProps;
        let { signingRegion, signingName } = validatedProps;
        const handlerExecutionContext = signingProperties.context;
        if (handlerExecutionContext?.authSchemes?.length ?? 0 > 1) {
          const [first, second] = handlerExecutionContext.authSchemes;
          if (first?.name === "sigv4a" && second?.name === "sigv4") {
            signingRegion = second?.signingRegion ?? signingRegion;
            signingName = second?.signingName ?? signingName;
          }
        }
        const signedRequest = await signer.sign(httpRequest2, {
          signingDate: getSkewCorrectedDate(config.systemClockOffset),
          signingRegion,
          signingService: signingName
        });
        return signedRequest;
      }
      errorHandler(signingProperties) {
        return (error2) => {
          const serverTime = error2.ServerTime ?? getDateHeader(error2.$response);
          if (serverTime) {
            const config = throwSigningPropertyError("config", signingProperties.config);
            const initialSystemClockOffset = config.systemClockOffset;
            config.systemClockOffset = getUpdatedSystemClockOffset(serverTime, config.systemClockOffset);
            const clockSkewCorrected = config.systemClockOffset !== initialSystemClockOffset;
            if (clockSkewCorrected && error2.$metadata) {
              error2.$metadata.clockSkewCorrected = true;
            }
          }
          throw error2;
        };
      }
      successHandler(httpResponse, signingProperties) {
        const dateHeader = getDateHeader(httpResponse);
        if (dateHeader) {
          const config = throwSigningPropertyError("config", signingProperties.config);
          config.systemClockOffset = getUpdatedSystemClockOffset(dateHeader, config.systemClockOffset);
        }
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4ASigner.js
var AwsSdkSigV4ASigner;
var init_AwsSdkSigV4ASigner = __esm({
  "../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4ASigner.js"() {
    init_import_meta_url();
    init_dist_es2();
    init_utils13();
    init_AwsSdkSigV4Signer();
    AwsSdkSigV4ASigner = class extends AwsSdkSigV4Signer {
      static {
        __name(this, "AwsSdkSigV4ASigner");
      }
      async sign(httpRequest2, identity, signingProperties) {
        if (!HttpRequest.isInstance(httpRequest2)) {
          throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");
        }
        const { config, signer, signingRegion, signingRegionSet, signingName } = await validateSigningProperties(signingProperties);
        const configResolvedSigningRegionSet = await config.sigv4aSigningRegionSet?.();
        const multiRegionOverride = (configResolvedSigningRegionSet ?? signingRegionSet ?? [signingRegion]).join(",");
        const signedRequest = await signer.sign(httpRequest2, {
          signingDate: getSkewCorrectedDate(config.systemClockOffset),
          signingRegion: multiRegionOverride,
          signingService: signingName
        });
        return signedRequest;
      }
    };
  }
});

// ../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/getSmithyContext.js
var init_getSmithyContext = __esm({
  "../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/getSmithyContext.js"() {
    init_import_meta_url();
    init_dist_es();
  }
});

// ../../node_modules/.pnpm/@smithy+util-middleware@3.0.11/node_modules/@smithy/util-middleware/dist-es/getSmithyContext.js
var getSmithyContext;
var init_getSmithyContext2 = __esm({
  "../../node_modules/.pnpm/@smithy+util-middleware@3.0.11/node_modules/@smithy/util-middleware/dist-es/getSmithyContext.js"() {
    init_import_meta_url();
    init_dist_es();
    getSmithyContext = /* @__PURE__ */ __name((context2) => context2[SMITHY_CONTEXT_KEY] || (context2[SMITHY_CONTEXT_KEY] = {}), "getSmithyContext");
  }
});

// ../../node_modules/.pnpm/@smithy+util-middleware@3.0.11/node_modules/@smithy/util-middleware/dist-es/normalizeProvider.js
var normalizeProvider;
var init_normalizeProvider = __esm({
  "../../node_modules/.pnpm/@smithy+util-middleware@3.0.11/node_modules/@smithy/util-middleware/dist-es/normalizeProvider.js"() {
    init_import_meta_url();
    normalizeProvider = /* @__PURE__ */ __name((input) => {
      if (typeof input === "function")
        return input;
      const promisified = Promise.resolve(input);
      return () => promisified;
    }, "normalizeProvider");
  }
});

// ../../node_modules/.pnpm/@smithy+util-middleware@3.0.11/node_modules/@smithy/util-middleware/dist-es/index.js
var init_dist_es4 = __esm({
  "../../node_modules/.pnpm/@smithy+util-middleware@3.0.11/node_modules/@smithy/util-middleware/dist-es/index.js"() {
    init_import_meta_url();
    init_getSmithyContext2();
    init_normalizeProvider();
  }
});

// ../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/httpAuthSchemeMiddleware.js
function convertHttpAuthSchemesToMap(httpAuthSchemes) {
  const map2 = /* @__PURE__ */ new Map();
  for (const scheme of httpAuthSchemes) {
    map2.set(scheme.schemeId, scheme);
  }
  return map2;
}
var httpAuthSchemeMiddleware;
var init_httpAuthSchemeMiddleware = __esm({
  "../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/httpAuthSchemeMiddleware.js"() {
    init_import_meta_url();
    init_dist_es();
    init_dist_es4();
    __name(convertHttpAuthSchemesToMap, "convertHttpAuthSchemesToMap");
    httpAuthSchemeMiddleware = /* @__PURE__ */ __name((config, mwOptions) => (next, context2) => async (args) => {
      const options = config.httpAuthSchemeProvider(await mwOptions.httpAuthSchemeParametersProvider(config, context2, args.input));
      const authSchemes = convertHttpAuthSchemesToMap(config.httpAuthSchemes);
      const smithyContext = getSmithyContext(context2);
      const failureReasons = [];
      for (const option of options) {
        const scheme = authSchemes.get(option.schemeId);
        if (!scheme) {
          failureReasons.push(`HttpAuthScheme \`${option.schemeId}\` was not enabled for this service.`);
          continue;
        }
        const identityProvider = scheme.identityProvider(await mwOptions.identityProviderConfigProvider(config));
        if (!identityProvider) {
          failureReasons.push(`HttpAuthScheme \`${option.schemeId}\` did not have an IdentityProvider configured.`);
          continue;
        }
        const { identityProperties = {}, signingProperties = {} } = option.propertiesExtractor?.(config, context2) || {};
        option.identityProperties = Object.assign(option.identityProperties || {}, identityProperties);
        option.signingProperties = Object.assign(option.signingProperties || {}, signingProperties);
        smithyContext.selectedHttpAuthScheme = {
          httpAuthOption: option,
          identity: await identityProvider(option.identityProperties),
          signer: scheme.signer
        };
        break;
      }
      if (!smithyContext.selectedHttpAuthScheme) {
        throw new Error(failureReasons.join("\n"));
      }
      return next(args);
    }, "httpAuthSchemeMiddleware");
  }
});

// ../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/getHttpAuthSchemeEndpointRuleSetPlugin.js
var httpAuthSchemeEndpointRuleSetMiddlewareOptions, getHttpAuthSchemeEndpointRuleSetPlugin;
var init_getHttpAuthSchemeEndpointRuleSetPlugin = __esm({
  "../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/getHttpAuthSchemeEndpointRuleSetPlugin.js"() {
    init_import_meta_url();
    init_httpAuthSchemeMiddleware();
    httpAuthSchemeEndpointRuleSetMiddlewareOptions = {
      step: "serialize",
      tags: ["HTTP_AUTH_SCHEME"],
      name: "httpAuthSchemeMiddleware",
      override: true,
      relation: "before",
      toMiddleware: "endpointV2Middleware"
    };
    getHttpAuthSchemeEndpointRuleSetPlugin = /* @__PURE__ */ __name((config, { httpAuthSchemeParametersProvider, identityProviderConfigProvider }) => ({
      applyToStack: /* @__PURE__ */ __name((clientStack) => {
        clientStack.addRelativeTo(httpAuthSchemeMiddleware(config, {
          httpAuthSchemeParametersProvider,
          identityProviderConfigProvider
        }), httpAuthSchemeEndpointRuleSetMiddlewareOptions);
      }, "applyToStack")
    }), "getHttpAuthSchemeEndpointRuleSetPlugin");
  }
});

// ../../node_modules/.pnpm/@smithy+middleware-serde@3.0.11/node_modules/@smithy/middleware-serde/dist-es/deserializerMiddleware.js
var deserializerMiddleware;
var init_deserializerMiddleware = __esm({
  "../../node_modules/.pnpm/@smithy+middleware-serde@3.0.11/node_modules/@smithy/middleware-serde/dist-es/deserializerMiddleware.js"() {
    init_import_meta_url();
    deserializerMiddleware = /* @__PURE__ */ __name((options, deserializer) => (next) => async (args) => {
      const { response } = await next(args);
      try {
        const parsed = await deserializer(response, options);
        return {
          response,
          output: parsed
        };
      } catch (error2) {
        Object.defineProperty(error2, "$response", {
          value: response
        });
        if (!("$metadata" in error2)) {
          const hint = `Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.`;
          error2.message += "\n  " + hint;
          if (typeof error2.$responseBodyText !== "undefined") {
            if (error2.$response) {
              error2.$response.body = error2.$responseBodyText;
            }
          }
        }
        throw error2;
      }
    }, "deserializerMiddleware");
  }
});

// ../../node_modules/.pnpm/@smithy+middleware-serde@3.0.11/node_modules/@smithy/middleware-serde/dist-es/serializerMiddleware.js
var serializerMiddleware;
var init_serializerMiddleware = __esm({
  "../../node_modules/.pnpm/@smithy+middleware-serde@3.0.11/node_modules/@smithy/middleware-serde/dist-es/serializerMiddleware.js"() {
    init_import_meta_url();
    serializerMiddleware = /* @__PURE__ */ __name((options, serializer) => (next, context2) => async (args) => {
      const endpoint = context2.endpointV2?.url && options.urlParser ? async () => options.urlParser(context2.endpointV2.url) : options.endpoint;
      if (!endpoint) {
        throw new Error("No valid endpoint provider available.");
      }
      const request4 = await serializer(args.input, { ...options, endpoint });
      return next({
        ...args,
        request: request4
      });
    }, "serializerMiddleware");
  }
});

// ../../node_modules/.pnpm/@smithy+middleware-serde@3.0.11/node_modules/@smithy/middleware-serde/dist-es/serdePlugin.js
function getSerdePlugin(config, serializer, deserializer) {
  return {
    applyToStack: /* @__PURE__ */ __name((commandStack) => {
      commandStack.add(deserializerMiddleware(config, deserializer), deserializerMiddlewareOption);
      commandStack.add(serializerMiddleware(config, serializer), serializerMiddlewareOption);
    }, "applyToStack")
  };
}
var deserializerMiddlewareOption, serializerMiddlewareOption;
var init_serdePlugin = __esm({
  "../../node_modules/.pnpm/@smithy+middleware-serde@3.0.11/node_modules/@smithy/middleware-serde/dist-es/serdePlugin.js"() {
    init_import_meta_url();
    init_deserializerMiddleware();
    init_serializerMiddleware();
    deserializerMiddlewareOption = {
      name: "deserializerMiddleware",
      step: "deserialize",
      tags: ["DESERIALIZER"],
      override: true
    };
    serializerMiddlewareOption = {
      name: "serializerMiddleware",
      step: "serialize",
      tags: ["SERIALIZER"],
      override: true
    };
    __name(getSerdePlugin, "getSerdePlugin");
  }
});

// ../../node_modules/.pnpm/@smithy+middleware-serde@3.0.11/node_modules/@smithy/middleware-serde/dist-es/index.js
var init_dist_es5 = __esm({
  "../../node_modules/.pnpm/@smithy+middleware-serde@3.0.11/node_modules/@smithy/middleware-serde/dist-es/index.js"() {
    init_import_meta_url();
    init_deserializerMiddleware();
    init_serdePlugin();
    init_serializerMiddleware();
  }
});
var init_getHttpAuthSchemePlugin = __esm({
  "../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/getHttpAuthSchemePlugin.js"() {
    init_import_meta_url();
    init_dist_es5();
    init_httpAuthSchemeMiddleware();
    ({
      step: "serialize",
      tags: ["HTTP_AUTH_SCHEME"],
      name: "httpAuthSchemeMiddleware",
      override: true,
      relation: "before",
      toMiddleware: serializerMiddlewareOption.name
    });
  }
});

// ../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/index.js
var init_middleware_http_auth_scheme = __esm({
  "../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/index.js"() {
    init_import_meta_url();
    init_httpAuthSchemeMiddleware();
    init_getHttpAuthSchemeEndpointRuleSetPlugin();
    init_getHttpAuthSchemePlugin();
  }
});

// ../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/middleware-http-signing/httpSigningMiddleware.js
var defaultErrorHandler, defaultSuccessHandler, httpSigningMiddleware;
var init_httpSigningMiddleware = __esm({
  "../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/middleware-http-signing/httpSigningMiddleware.js"() {
    init_import_meta_url();
    init_dist_es2();
    init_dist_es();
    init_dist_es4();
    defaultErrorHandler = /* @__PURE__ */ __name((signingProperties) => (error2) => {
      throw error2;
    }, "defaultErrorHandler");
    defaultSuccessHandler = /* @__PURE__ */ __name((httpResponse, signingProperties) => {
    }, "defaultSuccessHandler");
    httpSigningMiddleware = /* @__PURE__ */ __name((config) => (next, context2) => async (args) => {
      if (!HttpRequest.isInstance(args.request)) {
        return next(args);
      }
      const smithyContext = getSmithyContext(context2);
      const scheme = smithyContext.selectedHttpAuthScheme;
      if (!scheme) {
        throw new Error(`No HttpAuthScheme was selected: unable to sign request`);
      }
      const { httpAuthOption: { signingProperties = {} }, identity, signer } = scheme;
      const output = await next({
        ...args,
        request: await signer.sign(args.request, identity, signingProperties)
      }).catch((signer.errorHandler || defaultErrorHandler)(signingProperties));
      (signer.successHandler || defaultSuccessHandler)(output.response, signingProperties);
      return output;
    }, "httpSigningMiddleware");
  }
});

// ../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/middleware-http-signing/getHttpSigningMiddleware.js
var httpSigningMiddlewareOptions, getHttpSigningPlugin;
var init_getHttpSigningMiddleware = __esm({
  "../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/middleware-http-signing/getHttpSigningMiddleware.js"() {
    init_import_meta_url();
    init_httpSigningMiddleware();
    httpSigningMiddlewareOptions = {
      step: "finalizeRequest",
      tags: ["HTTP_SIGNING"],
      name: "httpSigningMiddleware",
      aliases: ["apiKeyMiddleware", "tokenMiddleware", "awsAuthMiddleware"],
      override: true,
      relation: "after",
      toMiddleware: "retryMiddleware"
    };
    getHttpSigningPlugin = /* @__PURE__ */ __name((config) => ({
      applyToStack: /* @__PURE__ */ __name((clientStack) => {
        clientStack.addRelativeTo(httpSigningMiddleware(config), httpSigningMiddlewareOptions);
      }, "applyToStack")
    }), "getHttpSigningPlugin");
  }
});

// ../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/middleware-http-signing/index.js
var init_middleware_http_signing = __esm({
  "../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/middleware-http-signing/index.js"() {
    init_import_meta_url();
    init_httpSigningMiddleware();
    init_getHttpSigningMiddleware();
  }
});

// ../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/normalizeProvider.js
var normalizeProvider2;
var init_normalizeProvider2 = __esm({
  "../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/normalizeProvider.js"() {
    init_import_meta_url();
    normalizeProvider2 = /* @__PURE__ */ __name((input) => {
      if (typeof input === "function")
        return input;
      const promisified = Promise.resolve(input);
      return () => promisified;
    }, "normalizeProvider");
  }
});

// ../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/pagination/createPaginator.js
function createPaginator(ClientCtor, CommandCtor, inputTokenName, outputTokenName, pageSizeTokenName) {
  return /* @__PURE__ */ __name(async function* paginateOperation(config, input, ...additionalArguments) {
    let token = config.startingToken || void 0;
    let hasNext = true;
    let page;
    while (hasNext) {
      input[inputTokenName] = token;
      if (pageSizeTokenName) {
        input[pageSizeTokenName] = input[pageSizeTokenName] ?? config.pageSize;
      }
      if (config.client instanceof ClientCtor) {
        page = await makePagedClientRequest(CommandCtor, config.client, input, ...additionalArguments);
      } else {
        throw new Error(`Invalid client, expected instance of ${ClientCtor.name}`);
      }
      yield page;
      const prevToken = token;
      token = get(page, outputTokenName);
      hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
    }
    return void 0;
  }, "paginateOperation");
}
var makePagedClientRequest, get;
var init_createPaginator = __esm({
  "../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/pagination/createPaginator.js"() {
    init_import_meta_url();
    makePagedClientRequest = /* @__PURE__ */ __name(async (CommandCtor, client, input, ...args) => {
      return await client.send(new CommandCtor(input), ...args);
    }, "makePagedClientRequest");
    __name(createPaginator, "createPaginator");
    get = /* @__PURE__ */ __name((fromObject, path84) => {
      let cursor = fromObject;
      const pathComponents = path84.split(".");
      for (const step of pathComponents) {
        if (!cursor || typeof cursor !== "object") {
          return void 0;
        }
        cursor = cursor[step];
      }
      return cursor;
    }, "get");
  }
});

// ../../node_modules/.pnpm/@smithy+is-array-buffer@3.0.0/node_modules/@smithy/is-array-buffer/dist-es/index.js
var isArrayBuffer;
var init_dist_es6 = __esm({
  "../../node_modules/.pnpm/@smithy+is-array-buffer@3.0.0/node_modules/@smithy/is-array-buffer/dist-es/index.js"() {
    init_import_meta_url();
    isArrayBuffer = /* @__PURE__ */ __name((arg) => typeof ArrayBuffer === "function" && arg instanceof ArrayBuffer || Object.prototype.toString.call(arg) === "[object ArrayBuffer]", "isArrayBuffer");
  }
});
var fromArrayBuffer, fromString;
var init_dist_es7 = __esm({
  "../../node_modules/.pnpm/@smithy+util-buffer-from@3.0.0/node_modules/@smithy/util-buffer-from/dist-es/index.js"() {
    init_import_meta_url();
    init_dist_es6();
    fromArrayBuffer = /* @__PURE__ */ __name((input, offset = 0, length = input.byteLength - offset) => {
      if (!isArrayBuffer(input)) {
        throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof input} (${input})`);
      }
      return buffer.Buffer.from(input, offset, length);
    }, "fromArrayBuffer");
    fromString = /* @__PURE__ */ __name((input, encoding) => {
      if (typeof input !== "string") {
        throw new TypeError(`The "input" argument must be of type string. Received type ${typeof input} (${input})`);
      }
      return encoding ? buffer.Buffer.from(input, encoding) : buffer.Buffer.from(input);
    }, "fromString");
  }
});

// ../../node_modules/.pnpm/@smithy+util-base64@3.0.0/node_modules/@smithy/util-base64/dist-es/fromBase64.js
var BASE64_REGEX, fromBase64;
var init_fromBase64 = __esm({
  "../../node_modules/.pnpm/@smithy+util-base64@3.0.0/node_modules/@smithy/util-base64/dist-es/fromBase64.js"() {
    init_import_meta_url();
    init_dist_es7();
    BASE64_REGEX = /^[A-Za-z0-9+/]*={0,2}$/;
    fromBase64 = /* @__PURE__ */ __name((input) => {
      if (input.length * 3 % 4 !== 0) {
        throw new TypeError(`Incorrect padding on base64 string.`);
      }
      if (!BASE64_REGEX.exec(input)) {
        throw new TypeError(`Invalid base64 string.`);
      }
      const buffer = fromString(input, "base64");
      return new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength);
    }, "fromBase64");
  }
});

// ../../node_modules/.pnpm/@smithy+util-utf8@3.0.0/node_modules/@smithy/util-utf8/dist-es/fromUtf8.js
var fromUtf8;
var init_fromUtf8 = __esm({
  "../../node_modules/.pnpm/@smithy+util-utf8@3.0.0/node_modules/@smithy/util-utf8/dist-es/fromUtf8.js"() {
    init_import_meta_url();
    init_dist_es7();
    fromUtf8 = /* @__PURE__ */ __name((input) => {
      const buf = fromString(input, "utf8");
      return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength / Uint8Array.BYTES_PER_ELEMENT);
    }, "fromUtf8");
  }
});

// ../../node_modules/.pnpm/@smithy+util-utf8@3.0.0/node_modules/@smithy/util-utf8/dist-es/toUint8Array.js
var toUint8Array;
var init_toUint8Array = __esm({
  "../../node_modules/.pnpm/@smithy+util-utf8@3.0.0/node_modules/@smithy/util-utf8/dist-es/toUint8Array.js"() {
    init_import_meta_url();
    init_fromUtf8();
    toUint8Array = /* @__PURE__ */ __name((data) => {
      if (typeof data === "string") {
        return fromUtf8(data);
      }
      if (ArrayBuffer.isView(data)) {
        return new Uint8Array(data.buffer, data.byteOffset, data.byteLength / Uint8Array.BYTES_PER_ELEMENT);
      }
      return new Uint8Array(data);
    }, "toUint8Array");
  }
});

// ../../node_modules/.pnpm/@smithy+util-utf8@3.0.0/node_modules/@smithy/util-utf8/dist-es/toUtf8.js
var toUtf8;
var init_toUtf8 = __esm({
  "../../node_modules/.pnpm/@smithy+util-utf8@3.0.0/node_modules/@smithy/util-utf8/dist-es/toUtf8.js"() {
    init_import_meta_url();
    init_dist_es7();
    toUtf8 = /* @__PURE__ */ __name((input) => {
      if (typeof input === "string") {
        return input;
      }
      if (typeof input !== "object" || typeof input.byteOffset !== "number" || typeof input.byteLength !== "number") {
        throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");
      }
      return fromArrayBuffer(input.buffer, input.byteOffset, input.byteLength).toString("utf8");
    }, "toUtf8");
  }
});

// ../../node_modules/.pnpm/@smithy+util-utf8@3.0.0/node_modules/@smithy/util-utf8/dist-es/index.js
var init_dist_es8 = __esm({
  "../../node_modules/.pnpm/@smithy+util-utf8@3.0.0/node_modules/@smithy/util-utf8/dist-es/index.js"() {
    init_import_meta_url();
    init_fromUtf8();
    init_toUint8Array();
    init_toUtf8();
  }
});

// ../../node_modules/.pnpm/@smithy+util-base64@3.0.0/node_modules/@smithy/util-base64/dist-es/toBase64.js
var toBase64;
var init_toBase64 = __esm({
  "../../node_modules/.pnpm/@smithy+util-base64@3.0.0/node_modules/@smithy/util-base64/dist-es/toBase64.js"() {
    init_import_meta_url();
    init_dist_es7();
    init_dist_es8();
    toBase64 = /* @__PURE__ */ __name((_input) => {
      let input;
      if (typeof _input === "string") {
        input = fromUtf8(_input);
      } else {
        input = _input;
      }
      if (typeof input !== "object" || typeof input.byteOffset !== "number" || typeof input.byteLength !== "number") {
        throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");
      }
      return fromArrayBuffer(input.buffer, input.byteOffset, input.byteLength).toString("base64");
    }, "toBase64");
  }
});

// ../../node_modules/.pnpm/@smithy+util-base64@3.0.0/node_modules/@smithy/util-base64/dist-es/index.js
var init_dist_es9 = __esm({
  "../../node_modules/.pnpm/@smithy+util-base64@3.0.0/node_modules/@smithy/util-base64/dist-es/index.js"() {
    init_import_meta_url();
    init_fromBase64();
    init_toBase64();
  }
});

// ../../node_modules/.pnpm/@smithy+util-stream@3.3.4/node_modules/@smithy/util-stream/dist-es/blob/transforms.js
function transformToString(payload, encoding = "utf-8") {
  if (encoding === "base64") {
    return toBase64(payload);
  }
  return toUtf8(payload);
}
function transformFromString(str, encoding) {
  if (encoding === "base64") {
    return Uint8ArrayBlobAdapter.mutate(fromBase64(str));
  }
  return Uint8ArrayBlobAdapter.mutate(fromUtf8(str));
}
var init_transforms = __esm({
  "../../node_modules/.pnpm/@smithy+util-stream@3.3.4/node_modules/@smithy/util-stream/dist-es/blob/transforms.js"() {
    init_import_meta_url();
    init_dist_es9();
    init_dist_es8();
    init_Uint8ArrayBlobAdapter();
    __name(transformToString, "transformToString");
    __name(transformFromString, "transformFromString");
  }
});

// ../../node_modules/.pnpm/@smithy+util-stream@3.3.4/node_modules/@smithy/util-stream/dist-es/blob/Uint8ArrayBlobAdapter.js
var Uint8ArrayBlobAdapter;
var init_Uint8ArrayBlobAdapter = __esm({
  "../../node_modules/.pnpm/@smithy+util-stream@3.3.4/node_modules/@smithy/util-stream/dist-es/blob/Uint8ArrayBlobAdapter.js"() {
    init_import_meta_url();
    init_transforms();
    Uint8ArrayBlobAdapter = class _Uint8ArrayBlobAdapter extends Uint8Array {
      static {
        __name(this, "Uint8ArrayBlobAdapter");
      }
      static fromString(source, encoding = "utf-8") {
        switch (typeof source) {
          case "string":
            return transformFromString(source, encoding);
          default:
            throw new Error(`Unsupported conversion from ${typeof source} to Uint8ArrayBlobAdapter.`);
        }
      }
      static mutate(source) {
        Object.setPrototypeOf(source, _Uint8ArrayBlobAdapter.prototype);
        return source;
      }
      transformToString(encoding = "utf-8") {
        return transformToString(this, encoding);
      }
    };
  }
});
var getAwsChunkedEncodingStream;
var init_getAwsChunkedEncodingStream = __esm({
  "../../node_modules/.pnpm/@smithy+util-stream@3.3.4/node_modules/@smithy/util-stream/dist-es/getAwsChunkedEncodingStream.js"() {
    init_import_meta_url();
    getAwsChunkedEncodingStream = /* @__PURE__ */ __name((readableStream, options) => {
      const { base64Encoder, bodyLengthChecker, checksumAlgorithmFn, checksumLocationName, streamHasher } = options;
      const checksumRequired = base64Encoder !== void 0 && checksumAlgorithmFn !== void 0 && checksumLocationName !== void 0 && streamHasher !== void 0;
      const digest = checksumRequired ? streamHasher(checksumAlgorithmFn, readableStream) : void 0;
      const awsChunkedEncodingStream = new Stream.Readable({ read: /* @__PURE__ */ __name(() => {
      }, "read") });
      readableStream.on("data", (data) => {
        const length = bodyLengthChecker(data) || 0;
        awsChunkedEncodingStream.push(`${length.toString(16)}\r
`);
        awsChunkedEncodingStream.push(data);
        awsChunkedEncodingStream.push("\r\n");
      });
      readableStream.on("end", async () => {
        awsChunkedEncodingStream.push(`0\r
`);
        if (checksumRequired) {
          const checksum = base64Encoder(await digest);
          awsChunkedEncodingStream.push(`${checksumLocationName}:${checksum}\r
`);
          awsChunkedEncodingStream.push(`\r
`);
        }
        awsChunkedEncodingStream.push(null);
      });
      return awsChunkedEncodingStream;
    }, "getAwsChunkedEncodingStream");
  }
});

// ../../node_modules/.pnpm/@smithy+util-uri-escape@3.0.0/node_modules/@smithy/util-uri-escape/dist-es/escape-uri.js
var escapeUri, hexEncode;
var init_escape_uri = __esm({
  "../../node_modules/.pnpm/@smithy+util-uri-escape@3.0.0/node_modules/@smithy/util-uri-escape/dist-es/escape-uri.js"() {
    init_import_meta_url();
    escapeUri = /* @__PURE__ */ __name((uri) => encodeURIComponent(uri).replace(/[!'()*]/g, hexEncode), "escapeUri");
    hexEncode = /* @__PURE__ */ __name((c8) => `%${c8.charCodeAt(0).toString(16).toUpperCase()}`, "hexEncode");
  }
});

// ../../node_modules/.pnpm/@smithy+util-uri-escape@3.0.0/node_modules/@smithy/util-uri-escape/dist-es/escape-uri-path.js
var init_escape_uri_path = __esm({
  "../../node_modules/.pnpm/@smithy+util-uri-escape@3.0.0/node_modules/@smithy/util-uri-escape/dist-es/escape-uri-path.js"() {
    init_import_meta_url();
    init_escape_uri();
  }
});

// ../../node_modules/.pnpm/@smithy+util-uri-escape@3.0.0/node_modules/@smithy/util-uri-escape/dist-es/index.js
var init_dist_es10 = __esm({
  "../../node_modules/.pnpm/@smithy+util-uri-escape@3.0.0/node_modules/@smithy/util-uri-escape/dist-es/index.js"() {
    init_import_meta_url();
    init_escape_uri();
    init_escape_uri_path();
  }
});

// ../../node_modules/.pnpm/@smithy+querystring-builder@3.0.11/node_modules/@smithy/querystring-builder/dist-es/index.js
function buildQueryString(query) {
  const parts = [];
  for (let key of Object.keys(query).sort()) {
    const value = query[key];
    key = escapeUri(key);
    if (Array.isArray(value)) {
      for (let i7 = 0, iLen = value.length; i7 < iLen; i7++) {
        parts.push(`${key}=${escapeUri(value[i7])}`);
      }
    } else {
      let qsEntry = key;
      if (value || typeof value === "string") {
        qsEntry += `=${escapeUri(value)}`;
      }
      parts.push(qsEntry);
    }
  }
  return parts.join("&");
}
var init_dist_es11 = __esm({
  "../../node_modules/.pnpm/@smithy+querystring-builder@3.0.11/node_modules/@smithy/querystring-builder/dist-es/index.js"() {
    init_import_meta_url();
    init_dist_es10();
    __name(buildQueryString, "buildQueryString");
  }
});

// ../../node_modules/.pnpm/@smithy+node-http-handler@3.3.3/node_modules/@smithy/node-http-handler/dist-es/constants.js
var NODEJS_TIMEOUT_ERROR_CODES;
var init_constants9 = __esm({
  "../../node_modules/.pnpm/@smithy+node-http-handler@3.3.3/node_modules/@smithy/node-http-handler/dist-es/constants.js"() {
    init_import_meta_url();
    NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "EPIPE", "ETIMEDOUT"];
  }
});

// ../../node_modules/.pnpm/@smithy+node-http-handler@3.3.3/node_modules/@smithy/node-http-handler/dist-es/get-transformed-headers.js
var getTransformedHeaders;
var init_get_transformed_headers = __esm({
  "../../node_modules/.pnpm/@smithy+node-http-handler@3.3.3/node_modules/@smithy/node-http-handler/dist-es/get-transformed-headers.js"() {
    init_import_meta_url();
    getTransformedHeaders = /* @__PURE__ */ __name((headers) => {
      const transformedHeaders = {};
      for (const name2 of Object.keys(headers)) {
        const headerValues = headers[name2];
        transformedHeaders[name2] = Array.isArray(headerValues) ? headerValues.join(",") : headerValues;
      }
      return transformedHeaders;
    }, "getTransformedHeaders");
  }
});

// ../../node_modules/.pnpm/@smithy+node-http-handler@3.3.3/node_modules/@smithy/node-http-handler/dist-es/timing.js
var timing;
var init_timing = __esm({
  "../../node_modules/.pnpm/@smithy+node-http-handler@3.3.3/node_modules/@smithy/node-http-handler/dist-es/timing.js"() {
    init_import_meta_url();
    timing = {
      setTimeout: /* @__PURE__ */ __name((cb2, ms) => setTimeout(cb2, ms), "setTimeout"),
      clearTimeout: /* @__PURE__ */ __name((timeoutId) => clearTimeout(timeoutId), "clearTimeout")
    };
  }
});

// ../../node_modules/.pnpm/@smithy+node-http-handler@3.3.3/node_modules/@smithy/node-http-handler/dist-es/set-connection-timeout.js
var DEFER_EVENT_LISTENER_TIME, setConnectionTimeout;
var init_set_connection_timeout = __esm({
  "../../node_modules/.pnpm/@smithy+node-http-handler@3.3.3/node_modules/@smithy/node-http-handler/dist-es/set-connection-timeout.js"() {
    init_import_meta_url();
    init_timing();
    DEFER_EVENT_LISTENER_TIME = 1e3;
    setConnectionTimeout = /* @__PURE__ */ __name((request4, reject, timeoutInMs = 0) => {
      if (!timeoutInMs) {
        return -1;
      }
      const registerTimeout = /* @__PURE__ */ __name((offset) => {
        const timeoutId = timing.setTimeout(() => {
          request4.destroy();
          reject(Object.assign(new Error(`Socket timed out without establishing a connection within ${timeoutInMs} ms`), {
            name: "TimeoutError"
          }));
        }, timeoutInMs - offset);
        const doWithSocket = /* @__PURE__ */ __name((socket) => {
          if (socket?.connecting) {
            socket.on("connect", () => {
              timing.clearTimeout(timeoutId);
            });
          } else {
            timing.clearTimeout(timeoutId);
          }
        }, "doWithSocket");
        if (request4.socket) {
          doWithSocket(request4.socket);
        } else {
          request4.on("socket", doWithSocket);
        }
      }, "registerTimeout");
      if (timeoutInMs < 2e3) {
        registerTimeout(0);
        return 0;
      }
      return timing.setTimeout(registerTimeout.bind(null, DEFER_EVENT_LISTENER_TIME), DEFER_EVENT_LISTENER_TIME);
    }, "setConnectionTimeout");
  }
});

// ../../node_modules/.pnpm/@smithy+node-http-handler@3.3.3/node_modules/@smithy/node-http-handler/dist-es/set-socket-keep-alive.js
var DEFER_EVENT_LISTENER_TIME2, setSocketKeepAlive;
var init_set_socket_keep_alive = __esm({
  "../../node_modules/.pnpm/@smithy+node-http-handler@3.3.3/node_modules/@smithy/node-http-handler/dist-es/set-socket-keep-alive.js"() {
    init_import_meta_url();
    init_timing();
    DEFER_EVENT_LISTENER_TIME2 = 3e3;
    setSocketKeepAlive = /* @__PURE__ */ __name((request4, { keepAlive, keepAliveMsecs }, deferTimeMs = DEFER_EVENT_LISTENER_TIME2) => {
      if (keepAlive !== true) {
        return -1;
      }
      const registerListener = /* @__PURE__ */ __name(() => {
        if (request4.socket) {
          request4.socket.setKeepAlive(keepAlive, keepAliveMsecs || 0);
        } else {
          request4.on("socket", (socket) => {
            socket.setKeepAlive(keepAlive, keepAliveMsecs || 0);
          });
        }
      }, "registerListener");
      if (deferTimeMs === 0) {
        registerListener();
        return 0;
      }
      return timing.setTimeout(registerListener, deferTimeMs);
    }, "setSocketKeepAlive");
  }
});

// ../../node_modules/.pnpm/@smithy+node-http-handler@3.3.3/node_modules/@smithy/node-http-handler/dist-es/set-socket-timeout.js
var DEFER_EVENT_LISTENER_TIME3, setSocketTimeout;
var init_set_socket_timeout = __esm({
  "../../node_modules/.pnpm/@smithy+node-http-handler@3.3.3/node_modules/@smithy/node-http-handler/dist-es/set-socket-timeout.js"() {
    init_import_meta_url();
    init_timing();
    DEFER_EVENT_LISTENER_TIME3 = 3e3;
    setSocketTimeout = /* @__PURE__ */ __name((request4, reject, timeoutInMs = 0) => {
      const registerTimeout = /* @__PURE__ */ __name((offset) => {
        const timeout2 = timeoutInMs - offset;
        const onTimeout = /* @__PURE__ */ __name(() => {
          request4.destroy();
          reject(Object.assign(new Error(`Connection timed out after ${timeoutInMs} ms`), { name: "TimeoutError" }));
        }, "onTimeout");
        if (request4.socket) {
          request4.socket.setTimeout(timeout2, onTimeout);
        } else {
          request4.setTimeout(timeout2, onTimeout);
        }
      }, "registerTimeout");
      if (0 < timeoutInMs && timeoutInMs < 6e3) {
        registerTimeout(0);
        return 0;
      }
      return timing.setTimeout(registerTimeout.bind(null, timeoutInMs === 0 ? 0 : DEFER_EVENT_LISTENER_TIME3), DEFER_EVENT_LISTENER_TIME3);
    }, "setSocketTimeout");
  }
});
async function writeRequestBody(httpRequest2, request4, maxContinueTimeoutMs = MIN_WAIT_TIME) {
  const headers = request4.headers ?? {};
  const expect = headers["Expect"] || headers["expect"];
  let timeoutId = -1;
  let sendBody = true;
  if (expect === "100-continue") {
    sendBody = await Promise.race([
      new Promise((resolve32) => {
        timeoutId = Number(timing.setTimeout(resolve32, Math.max(MIN_WAIT_TIME, maxContinueTimeoutMs)));
      }),
      new Promise((resolve32) => {
        httpRequest2.on("continue", () => {
          timing.clearTimeout(timeoutId);
          resolve32(true);
        });
        httpRequest2.on("response", () => {
          timing.clearTimeout(timeoutId);
          resolve32(false);
        });
        httpRequest2.on("error", () => {
          timing.clearTimeout(timeoutId);
          resolve32(false);
        });
      })
    ]);
  }
  if (sendBody) {
    writeBody(httpRequest2, request4.body);
  }
}
function writeBody(httpRequest2, body) {
  if (body instanceof Stream.Readable) {
    body.pipe(httpRequest2);
    return;
  }
  if (body) {
    if (Buffer.isBuffer(body) || typeof body === "string") {
      httpRequest2.end(body);
      return;
    }
    const uint8 = body;
    if (typeof uint8 === "object" && uint8.buffer && typeof uint8.byteOffset === "number" && typeof uint8.byteLength === "number") {
      httpRequest2.end(Buffer.from(uint8.buffer, uint8.byteOffset, uint8.byteLength));
      return;
    }
    httpRequest2.end(Buffer.from(body));
    return;
  }
  httpRequest2.end();
}
var MIN_WAIT_TIME;
var init_write_request_body = __esm({
  "../../node_modules/.pnpm/@smithy+node-http-handler@3.3.3/node_modules/@smithy/node-http-handler/dist-es/write-request-body.js"() {
    init_import_meta_url();
    init_timing();
    MIN_WAIT_TIME = 1e3;
    __name(writeRequestBody, "writeRequestBody");
    __name(writeBody, "writeBody");
  }
});
var NodeHttpHandler;
var init_node_http_handler = __esm({
  "../../node_modules/.pnpm/@smithy+node-http-handler@3.3.3/node_modules/@smithy/node-http-handler/dist-es/node-http-handler.js"() {
    init_import_meta_url();
    init_dist_es2();
    init_dist_es11();
    init_constants9();
    init_get_transformed_headers();
    init_set_connection_timeout();
    init_set_socket_keep_alive();
    init_set_socket_timeout();
    init_timing();
    init_write_request_body();
    NodeHttpHandler = class _NodeHttpHandler {
      static {
        __name(this, "NodeHttpHandler");
      }
      static create(instanceOrOptions) {
        if (typeof instanceOrOptions?.handle === "function") {
          return instanceOrOptions;
        }
        return new _NodeHttpHandler(instanceOrOptions);
      }
      static checkSocketUsage(agent, socketWarningTimestamp, logger4 = console) {
        const { sockets, requests, maxSockets } = agent;
        if (typeof maxSockets !== "number" || maxSockets === Infinity) {
          return socketWarningTimestamp;
        }
        const interval = 15e3;
        if (Date.now() - interval < socketWarningTimestamp) {
          return socketWarningTimestamp;
        }
        if (sockets && requests) {
          for (const origin in sockets) {
            const socketsInUse = sockets[origin]?.length ?? 0;
            const requestsEnqueued = requests[origin]?.length ?? 0;
            if (socketsInUse >= maxSockets && requestsEnqueued >= 2 * maxSockets) {
              logger4?.warn?.(`@smithy/node-http-handler:WARN - socket usage at capacity=${socketsInUse} and ${requestsEnqueued} additional requests are enqueued.
See https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-configuring-maxsockets.html
or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler config.`);
              return Date.now();
            }
          }
        }
        return socketWarningTimestamp;
      }
      constructor(options) {
        this.socketWarningTimestamp = 0;
        this.metadata = { handlerProtocol: "http/1.1" };
        this.configProvider = new Promise((resolve32, reject) => {
          if (typeof options === "function") {
            options().then((_options) => {
              resolve32(this.resolveDefaultConfig(_options));
            }).catch(reject);
          } else {
            resolve32(this.resolveDefaultConfig(options));
          }
        });
      }
      resolveDefaultConfig(options) {
        const { requestTimeout: requestTimeout2, connectionTimeout, socketTimeout, httpAgent, httpsAgent } = options || {};
        const keepAlive = true;
        const maxSockets = 50;
        return {
          connectionTimeout,
          requestTimeout: requestTimeout2 ?? socketTimeout,
          httpAgent: (() => {
            if (httpAgent instanceof http.Agent || typeof httpAgent?.destroy === "function") {
              return httpAgent;
            }
            return new http.Agent({ keepAlive, maxSockets, ...httpAgent });
          })(),
          httpsAgent: (() => {
            if (httpsAgent instanceof https.Agent || typeof httpsAgent?.destroy === "function") {
              return httpsAgent;
            }
            return new https.Agent({ keepAlive, maxSockets, ...httpsAgent });
          })(),
          logger: console
        };
      }
      destroy() {
        this.config?.httpAgent?.destroy();
        this.config?.httpsAgent?.destroy();
      }
      async handle(request4, { abortSignal } = {}) {
        if (!this.config) {
          this.config = await this.configProvider;
        }
        return new Promise((_resolve, _reject) => {
          let writeRequestBodyPromise = void 0;
          const timeouts = [];
          const resolve32 = /* @__PURE__ */ __name(async (arg) => {
            await writeRequestBodyPromise;
            timeouts.forEach(timing.clearTimeout);
            _resolve(arg);
          }, "resolve");
          const reject = /* @__PURE__ */ __name(async (arg) => {
            await writeRequestBodyPromise;
            timeouts.forEach(timing.clearTimeout);
            _reject(arg);
          }, "reject");
          if (!this.config) {
            throw new Error("Node HTTP request handler config is not resolved");
          }
          if (abortSignal?.aborted) {
            const abortError = new Error("Request aborted");
            abortError.name = "AbortError";
            reject(abortError);
            return;
          }
          const isSSL = request4.protocol === "https:";
          const agent = isSSL ? this.config.httpsAgent : this.config.httpAgent;
          timeouts.push(timing.setTimeout(() => {
            this.socketWarningTimestamp = _NodeHttpHandler.checkSocketUsage(agent, this.socketWarningTimestamp, this.config.logger);
          }, this.config.socketAcquisitionWarningTimeout ?? (this.config.requestTimeout ?? 2e3) + (this.config.connectionTimeout ?? 1e3)));
          const queryString = buildQueryString(request4.query || {});
          let auth = void 0;
          if (request4.username != null || request4.password != null) {
            const username = request4.username ?? "";
            const password = request4.password ?? "";
            auth = `${username}:${password}`;
          }
          let path84 = request4.path;
          if (queryString) {
            path84 += `?${queryString}`;
          }
          if (request4.fragment) {
            path84 += `#${request4.fragment}`;
          }
          let hostname2 = request4.hostname ?? "";
          if (hostname2[0] === "[" && hostname2.endsWith("]")) {
            hostname2 = request4.hostname.slice(1, -1);
          } else {
            hostname2 = request4.hostname;
          }
          const nodeHttpsOptions = {
            headers: request4.headers,
            host: hostname2,
            method: request4.method,
            path: path84,
            port: request4.port,
            agent,
            auth
          };
          const requestFunc = isSSL ? https.request : http.request;
          const req = requestFunc(nodeHttpsOptions, (res) => {
            const httpResponse = new HttpResponse({
              statusCode: res.statusCode || -1,
              reason: res.statusMessage,
              headers: getTransformedHeaders(res.headers),
              body: res
            });
            resolve32({ response: httpResponse });
          });
          req.on("error", (err) => {
            if (NODEJS_TIMEOUT_ERROR_CODES.includes(err.code)) {
              reject(Object.assign(err, { name: "TimeoutError" }));
            } else {
              reject(err);
            }
          });
          if (abortSignal) {
            const onAbort = /* @__PURE__ */ __name(() => {
              req.destroy();
              const abortError = new Error("Request aborted");
              abortError.name = "AbortError";
              reject(abortError);
            }, "onAbort");
            if (typeof abortSignal.addEventListener === "function") {
              const signal = abortSignal;
              signal.addEventListener("abort", onAbort, { once: true });
              req.once("close", () => signal.removeEventListener("abort", onAbort));
            } else {
              abortSignal.onabort = onAbort;
            }
          }
          timeouts.push(setConnectionTimeout(req, reject, this.config.connectionTimeout));
          timeouts.push(setSocketTimeout(req, reject, this.config.requestTimeout));
          const httpAgent = nodeHttpsOptions.agent;
          if (typeof httpAgent === "object" && "keepAlive" in httpAgent) {
            timeouts.push(setSocketKeepAlive(req, {
              keepAlive: httpAgent.keepAlive,
              keepAliveMsecs: httpAgent.keepAliveMsecs
            }));
          }
          writeRequestBodyPromise = writeRequestBody(req, request4, this.config.requestTimeout).catch((e10) => {
            timeouts.forEach(timing.clearTimeout);
            return _reject(e10);
          });
        });
      }
      updateHttpClientConfig(key, value) {
        this.config = void 0;
        this.configProvider = this.configProvider.then((config) => {
          return {
            ...config,
            [key]: value
          };
        });
      }
      httpHandlerConfigs() {
        return this.config ?? {};
      }
    };
  }
});

// ../../node_modules/.pnpm/@smithy+node-http-handler@3.3.3/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-pool.js
var init_node_http2_connection_pool = __esm({
  "../../node_modules/.pnpm/@smithy+node-http-handler@3.3.3/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-pool.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+node-http-handler@3.3.3/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-manager.js
var init_node_http2_connection_manager = __esm({
  "../../node_modules/.pnpm/@smithy+node-http-handler@3.3.3/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-manager.js"() {
    init_import_meta_url();
    init_node_http2_connection_pool();
  }
});

// ../../node_modules/.pnpm/@smithy+node-http-handler@3.3.3/node_modules/@smithy/node-http-handler/dist-es/node-http2-handler.js
var init_node_http2_handler = __esm({
  "../../node_modules/.pnpm/@smithy+node-http-handler@3.3.3/node_modules/@smithy/node-http-handler/dist-es/node-http2-handler.js"() {
    init_import_meta_url();
    init_dist_es2();
    init_dist_es11();
    init_get_transformed_headers();
    init_node_http2_connection_manager();
    init_write_request_body();
  }
});
var Collector;
var init_collector = __esm({
  "../../node_modules/.pnpm/@smithy+node-http-handler@3.3.3/node_modules/@smithy/node-http-handler/dist-es/stream-collector/collector.js"() {
    init_import_meta_url();
    Collector = class extends Stream.Writable {
      static {
        __name(this, "Collector");
      }
      constructor() {
        super(...arguments);
        this.bufferedBytes = [];
      }
      _write(chunk, encoding, callback) {
        this.bufferedBytes.push(chunk);
        callback();
      }
    };
  }
});

// ../../node_modules/.pnpm/@smithy+node-http-handler@3.3.3/node_modules/@smithy/node-http-handler/dist-es/stream-collector/index.js
async function collectReadableStream(stream2) {
  const chunks = [];
  const reader = stream2.getReader();
  let isDone = false;
  let length = 0;
  while (!isDone) {
    const { done, value } = await reader.read();
    if (value) {
      chunks.push(value);
      length += value.length;
    }
    isDone = done;
  }
  const collected = new Uint8Array(length);
  let offset = 0;
  for (const chunk of chunks) {
    collected.set(chunk, offset);
    offset += chunk.length;
  }
  return collected;
}
var streamCollector, isReadableStreamInstance;
var init_stream_collector = __esm({
  "../../node_modules/.pnpm/@smithy+node-http-handler@3.3.3/node_modules/@smithy/node-http-handler/dist-es/stream-collector/index.js"() {
    init_import_meta_url();
    init_collector();
    streamCollector = /* @__PURE__ */ __name((stream2) => {
      if (isReadableStreamInstance(stream2)) {
        return collectReadableStream(stream2);
      }
      return new Promise((resolve32, reject) => {
        const collector = new Collector();
        stream2.pipe(collector);
        stream2.on("error", (err) => {
          collector.end();
          reject(err);
        });
        collector.on("error", reject);
        collector.on("finish", function() {
          const bytes = new Uint8Array(Buffer.concat(this.bufferedBytes));
          resolve32(bytes);
        });
      });
    }, "streamCollector");
    isReadableStreamInstance = /* @__PURE__ */ __name((stream2) => typeof ReadableStream === "function" && stream2 instanceof ReadableStream, "isReadableStreamInstance");
    __name(collectReadableStream, "collectReadableStream");
  }
});

// ../../node_modules/.pnpm/@smithy+node-http-handler@3.3.3/node_modules/@smithy/node-http-handler/dist-es/index.js
var init_dist_es12 = __esm({
  "../../node_modules/.pnpm/@smithy+node-http-handler@3.3.3/node_modules/@smithy/node-http-handler/dist-es/index.js"() {
    init_import_meta_url();
    init_node_http_handler();
    init_node_http2_handler();
    init_stream_collector();
  }
});

// ../../node_modules/.pnpm/@smithy+fetch-http-handler@4.1.3/node_modules/@smithy/fetch-http-handler/dist-es/create-request.js
var init_create_request = __esm({
  "../../node_modules/.pnpm/@smithy+fetch-http-handler@4.1.3/node_modules/@smithy/fetch-http-handler/dist-es/create-request.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+fetch-http-handler@4.1.3/node_modules/@smithy/fetch-http-handler/dist-es/request-timeout.js
var init_request_timeout = __esm({
  "../../node_modules/.pnpm/@smithy+fetch-http-handler@4.1.3/node_modules/@smithy/fetch-http-handler/dist-es/request-timeout.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+fetch-http-handler@4.1.3/node_modules/@smithy/fetch-http-handler/dist-es/fetch-http-handler.js
var init_fetch_http_handler = __esm({
  "../../node_modules/.pnpm/@smithy+fetch-http-handler@4.1.3/node_modules/@smithy/fetch-http-handler/dist-es/fetch-http-handler.js"() {
    init_import_meta_url();
    init_dist_es2();
    init_dist_es11();
    init_create_request();
    init_request_timeout();
  }
});

// ../../node_modules/.pnpm/@smithy+fetch-http-handler@4.1.3/node_modules/@smithy/fetch-http-handler/dist-es/stream-collector.js
async function collectBlob(blob) {
  const base642 = await readToBase64(blob);
  const arrayBuffer2 = fromBase64(base642);
  return new Uint8Array(arrayBuffer2);
}
async function collectStream(stream2) {
  const chunks = [];
  const reader = stream2.getReader();
  let isDone = false;
  let length = 0;
  while (!isDone) {
    const { done, value } = await reader.read();
    if (value) {
      chunks.push(value);
      length += value.length;
    }
    isDone = done;
  }
  const collected = new Uint8Array(length);
  let offset = 0;
  for (const chunk of chunks) {
    collected.set(chunk, offset);
    offset += chunk.length;
  }
  return collected;
}
function readToBase64(blob) {
  return new Promise((resolve32, reject) => {
    const reader = new FileReader();
    reader.onloadend = () => {
      if (reader.readyState !== 2) {
        return reject(new Error("Reader aborted too early"));
      }
      const result = reader.result ?? "";
      const commaIndex = result.indexOf(",");
      const dataOffset = commaIndex > -1 ? commaIndex + 1 : result.length;
      resolve32(result.substring(dataOffset));
    };
    reader.onabort = () => reject(new Error("Read aborted"));
    reader.onerror = () => reject(reader.error);
    reader.readAsDataURL(blob);
  });
}
var streamCollector2;
var init_stream_collector2 = __esm({
  "../../node_modules/.pnpm/@smithy+fetch-http-handler@4.1.3/node_modules/@smithy/fetch-http-handler/dist-es/stream-collector.js"() {
    init_import_meta_url();
    init_dist_es9();
    streamCollector2 = /* @__PURE__ */ __name(async (stream2) => {
      if (typeof Blob === "function" && stream2 instanceof Blob || stream2.constructor?.name === "Blob") {
        if (Blob.prototype.arrayBuffer !== void 0) {
          return new Uint8Array(await stream2.arrayBuffer());
        }
        return collectBlob(stream2);
      }
      return collectStream(stream2);
    }, "streamCollector");
    __name(collectBlob, "collectBlob");
    __name(collectStream, "collectStream");
    __name(readToBase64, "readToBase64");
  }
});

// ../../node_modules/.pnpm/@smithy+fetch-http-handler@4.1.3/node_modules/@smithy/fetch-http-handler/dist-es/index.js
var init_dist_es13 = __esm({
  "../../node_modules/.pnpm/@smithy+fetch-http-handler@4.1.3/node_modules/@smithy/fetch-http-handler/dist-es/index.js"() {
    init_import_meta_url();
    init_fetch_http_handler();
    init_stream_collector2();
  }
});

// ../../node_modules/.pnpm/@smithy+util-hex-encoding@3.0.0/node_modules/@smithy/util-hex-encoding/dist-es/index.js
function fromHex(encoded) {
  if (encoded.length % 2 !== 0) {
    throw new Error("Hex encoded strings must have an even number length");
  }
  const out = new Uint8Array(encoded.length / 2);
  for (let i7 = 0; i7 < encoded.length; i7 += 2) {
    const encodedByte = encoded.slice(i7, i7 + 2).toLowerCase();
    if (encodedByte in HEX_TO_SHORT) {
      out[i7 / 2] = HEX_TO_SHORT[encodedByte];
    } else {
      throw new Error(`Cannot decode unrecognized sequence ${encodedByte} as hexadecimal`);
    }
  }
  return out;
}
function toHex(bytes) {
  let out = "";
  for (let i7 = 0; i7 < bytes.byteLength; i7++) {
    out += SHORT_TO_HEX[bytes[i7]];
  }
  return out;
}
var SHORT_TO_HEX, HEX_TO_SHORT;
var init_dist_es14 = __esm({
  "../../node_modules/.pnpm/@smithy+util-hex-encoding@3.0.0/node_modules/@smithy/util-hex-encoding/dist-es/index.js"() {
    init_import_meta_url();
    SHORT_TO_HEX = {};
    HEX_TO_SHORT = {};
    for (let i7 = 0; i7 < 256; i7++) {
      let encodedByte = i7.toString(16).toLowerCase();
      if (encodedByte.length === 1) {
        encodedByte = `0${encodedByte}`;
      }
      SHORT_TO_HEX[i7] = encodedByte;
      HEX_TO_SHORT[encodedByte] = i7;
    }
    __name(fromHex, "fromHex");
    __name(toHex, "toHex");
  }
});

// ../../node_modules/.pnpm/@smithy+util-stream@3.3.4/node_modules/@smithy/util-stream/dist-es/stream-type-check.js
var isReadableStream, isBlob4;
var init_stream_type_check = __esm({
  "../../node_modules/.pnpm/@smithy+util-stream@3.3.4/node_modules/@smithy/util-stream/dist-es/stream-type-check.js"() {
    init_import_meta_url();
    isReadableStream = /* @__PURE__ */ __name((stream2) => typeof ReadableStream === "function" && (stream2?.constructor?.name === ReadableStream.name || stream2 instanceof ReadableStream), "isReadableStream");
    isBlob4 = /* @__PURE__ */ __name((blob) => {
      return typeof Blob === "function" && (blob?.constructor?.name === Blob.name || blob instanceof Blob);
    }, "isBlob");
  }
});

// ../../node_modules/.pnpm/@smithy+util-stream@3.3.4/node_modules/@smithy/util-stream/dist-es/sdk-stream-mixin.browser.js
var ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED, sdkStreamMixin, isBlobInstance;
var init_sdk_stream_mixin_browser = __esm({
  "../../node_modules/.pnpm/@smithy+util-stream@3.3.4/node_modules/@smithy/util-stream/dist-es/sdk-stream-mixin.browser.js"() {
    init_import_meta_url();
    init_dist_es13();
    init_dist_es9();
    init_dist_es14();
    init_dist_es8();
    init_stream_type_check();
    ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED = "The stream has already been transformed.";
    sdkStreamMixin = /* @__PURE__ */ __name((stream2) => {
      if (!isBlobInstance(stream2) && !isReadableStream(stream2)) {
        const name2 = stream2?.__proto__?.constructor?.name || stream2;
        throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${name2}`);
      }
      let transformed = false;
      const transformToByteArray = /* @__PURE__ */ __name(async () => {
        if (transformed) {
          throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED);
        }
        transformed = true;
        return await streamCollector2(stream2);
      }, "transformToByteArray");
      const blobToWebStream = /* @__PURE__ */ __name((blob) => {
        if (typeof blob.stream !== "function") {
          throw new Error("Cannot transform payload Blob to web stream. Please make sure the Blob.stream() is polyfilled.\nIf you are using React Native, this API is not yet supported, see: https://react-native.canny.io/feature-requests/p/fetch-streaming-body");
        }
        return blob.stream();
      }, "blobToWebStream");
      return Object.assign(stream2, {
        transformToByteArray,
        transformToString: /* @__PURE__ */ __name(async (encoding) => {
          const buf = await transformToByteArray();
          if (encoding === "base64") {
            return toBase64(buf);
          } else if (encoding === "hex") {
            return toHex(buf);
          } else if (encoding === void 0 || encoding === "utf8" || encoding === "utf-8") {
            return toUtf8(buf);
          } else if (typeof TextDecoder === "function") {
            return new TextDecoder(encoding).decode(buf);
          } else {
            throw new Error("TextDecoder is not available, please make sure polyfill is provided.");
          }
        }, "transformToString"),
        transformToWebStream: /* @__PURE__ */ __name(() => {
          if (transformed) {
            throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED);
          }
          transformed = true;
          if (isBlobInstance(stream2)) {
            return blobToWebStream(stream2);
          } else if (isReadableStream(stream2)) {
            return stream2;
          } else {
            throw new Error(`Cannot transform payload to web stream, got ${stream2}`);
          }
        }, "transformToWebStream")
      });
    }, "sdkStreamMixin");
    isBlobInstance = /* @__PURE__ */ __name((stream2) => typeof Blob === "function" && stream2 instanceof Blob, "isBlobInstance");
  }
});
var ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED2, sdkStreamMixin2;
var init_sdk_stream_mixin = __esm({
  "../../node_modules/.pnpm/@smithy+util-stream@3.3.4/node_modules/@smithy/util-stream/dist-es/sdk-stream-mixin.js"() {
    init_import_meta_url();
    init_dist_es12();
    init_dist_es7();
    init_sdk_stream_mixin_browser();
    ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED2 = "The stream has already been transformed.";
    sdkStreamMixin2 = /* @__PURE__ */ __name((stream2) => {
      if (!(stream2 instanceof Stream.Readable)) {
        try {
          return sdkStreamMixin(stream2);
        } catch (e10) {
          const name2 = stream2?.__proto__?.constructor?.name || stream2;
          throw new Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${name2}`);
        }
      }
      let transformed = false;
      const transformToByteArray = /* @__PURE__ */ __name(async () => {
        if (transformed) {
          throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED2);
        }
        transformed = true;
        return await streamCollector(stream2);
      }, "transformToByteArray");
      return Object.assign(stream2, {
        transformToByteArray,
        transformToString: /* @__PURE__ */ __name(async (encoding) => {
          const buf = await transformToByteArray();
          if (encoding === void 0 || Buffer.isEncoding(encoding)) {
            return fromArrayBuffer(buf.buffer, buf.byteOffset, buf.byteLength).toString(encoding);
          } else {
            const decoder = new TextDecoder(encoding);
            return decoder.decode(buf);
          }
        }, "transformToString"),
        transformToWebStream: /* @__PURE__ */ __name(() => {
          if (transformed) {
            throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED2);
          }
          if (stream2.readableFlowing !== null) {
            throw new Error("The stream has been consumed by other callbacks.");
          }
          if (typeof Stream.Readable.toWeb !== "function") {
            throw new Error("Readable.toWeb() is not supported. Please make sure you are using Node.js >= 17.0.0, or polyfill is available.");
          }
          transformed = true;
          return Stream.Readable.toWeb(stream2);
        }, "transformToWebStream")
      });
    }, "sdkStreamMixin");
  }
});

// ../../node_modules/.pnpm/@smithy+util-stream@3.3.4/node_modules/@smithy/util-stream/dist-es/splitStream.browser.js
async function splitStream(stream2) {
  if (typeof stream2.stream === "function") {
    stream2 = stream2.stream();
  }
  const readableStream = stream2;
  return readableStream.tee();
}
var init_splitStream_browser = __esm({
  "../../node_modules/.pnpm/@smithy+util-stream@3.3.4/node_modules/@smithy/util-stream/dist-es/splitStream.browser.js"() {
    init_import_meta_url();
    __name(splitStream, "splitStream");
  }
});
async function splitStream2(stream2) {
  if (isReadableStream(stream2) || isBlob4(stream2)) {
    return splitStream(stream2);
  }
  const stream1 = new Stream.PassThrough();
  const stream22 = new Stream.PassThrough();
  stream2.pipe(stream1);
  stream2.pipe(stream22);
  return [stream1, stream22];
}
var init_splitStream = __esm({
  "../../node_modules/.pnpm/@smithy+util-stream@3.3.4/node_modules/@smithy/util-stream/dist-es/splitStream.js"() {
    init_import_meta_url();
    init_splitStream_browser();
    init_stream_type_check();
    __name(splitStream2, "splitStream");
  }
});

// ../../node_modules/.pnpm/@smithy+util-stream@3.3.4/node_modules/@smithy/util-stream/dist-es/headStream.browser.js
async function headStream(stream2, bytes) {
  let byteLengthCounter = 0;
  const chunks = [];
  const reader = stream2.getReader();
  let isDone = false;
  while (!isDone) {
    const { done, value } = await reader.read();
    if (value) {
      chunks.push(value);
      byteLengthCounter += value?.byteLength ?? 0;
    }
    if (byteLengthCounter >= bytes) {
      break;
    }
    isDone = done;
  }
  reader.releaseLock();
  const collected = new Uint8Array(Math.min(bytes, byteLengthCounter));
  let offset = 0;
  for (const chunk of chunks) {
    if (chunk.byteLength > collected.byteLength - offset) {
      collected.set(chunk.subarray(0, collected.byteLength - offset), offset);
      break;
    } else {
      collected.set(chunk, offset);
    }
    offset += chunk.length;
  }
  return collected;
}
var init_headStream_browser = __esm({
  "../../node_modules/.pnpm/@smithy+util-stream@3.3.4/node_modules/@smithy/util-stream/dist-es/headStream.browser.js"() {
    init_import_meta_url();
    __name(headStream, "headStream");
  }
});
var headStream2, Collector2;
var init_headStream = __esm({
  "../../node_modules/.pnpm/@smithy+util-stream@3.3.4/node_modules/@smithy/util-stream/dist-es/headStream.js"() {
    init_import_meta_url();
    init_headStream_browser();
    init_stream_type_check();
    headStream2 = /* @__PURE__ */ __name((stream2, bytes) => {
      if (isReadableStream(stream2)) {
        return headStream(stream2, bytes);
      }
      return new Promise((resolve32, reject) => {
        const collector = new Collector2();
        collector.limit = bytes;
        stream2.pipe(collector);
        stream2.on("error", (err) => {
          collector.end();
          reject(err);
        });
        collector.on("error", reject);
        collector.on("finish", function() {
          const bytes2 = new Uint8Array(Buffer.concat(this.buffers));
          resolve32(bytes2);
        });
      });
    }, "headStream");
    Collector2 = class extends Stream.Writable {
      static {
        __name(this, "Collector");
      }
      constructor() {
        super(...arguments);
        this.buffers = [];
        this.limit = Infinity;
        this.bytesBuffered = 0;
      }
      _write(chunk, encoding, callback) {
        this.buffers.push(chunk);
        this.bytesBuffered += chunk.byteLength ?? 0;
        if (this.bytesBuffered >= this.limit) {
          const excess = this.bytesBuffered - this.limit;
          const tailBuffer = this.buffers[this.buffers.length - 1];
          this.buffers[this.buffers.length - 1] = tailBuffer.subarray(0, tailBuffer.byteLength - excess);
          this.emit("finish");
        }
        callback();
      }
    };
  }
});
var ChecksumStream;
var init_ChecksumStream = __esm({
  "../../node_modules/.pnpm/@smithy+util-stream@3.3.4/node_modules/@smithy/util-stream/dist-es/checksum/ChecksumStream.js"() {
    init_import_meta_url();
    init_dist_es9();
    ChecksumStream = class extends Stream.Duplex {
      static {
        __name(this, "ChecksumStream");
      }
      constructor({ expectedChecksum, checksum, source, checksumSourceLocation, base64Encoder }) {
        super();
        if (typeof source.pipe === "function") {
          this.source = source;
        } else {
          throw new Error(`@smithy/util-stream: unsupported source type ${source?.constructor?.name ?? source} in ChecksumStream.`);
        }
        this.base64Encoder = base64Encoder ?? toBase64;
        this.expectedChecksum = expectedChecksum;
        this.checksum = checksum;
        this.checksumSourceLocation = checksumSourceLocation;
        this.source.pipe(this);
      }
      _read(size) {
      }
      _write(chunk, encoding, callback) {
        try {
          this.checksum.update(chunk);
          this.push(chunk);
        } catch (e10) {
          return callback(e10);
        }
        return callback();
      }
      async _final(callback) {
        try {
          const digest = await this.checksum.digest();
          const received = this.base64Encoder(digest);
          if (this.expectedChecksum !== received) {
            return callback(new Error(`Checksum mismatch: expected "${this.expectedChecksum}" but received "${received}" in response header "${this.checksumSourceLocation}".`));
          }
        } catch (e10) {
          return callback(e10);
        }
        this.push(null);
        return callback();
      }
    };
  }
});

// ../../node_modules/.pnpm/@smithy+util-stream@3.3.4/node_modules/@smithy/util-stream/dist-es/checksum/ChecksumStream.browser.js
var ReadableStreamRef, ChecksumStream2;
var init_ChecksumStream_browser = __esm({
  "../../node_modules/.pnpm/@smithy+util-stream@3.3.4/node_modules/@smithy/util-stream/dist-es/checksum/ChecksumStream.browser.js"() {
    init_import_meta_url();
    ReadableStreamRef = typeof ReadableStream === "function" ? ReadableStream : function() {
    };
    ChecksumStream2 = class extends ReadableStreamRef {
      static {
        __name(this, "ChecksumStream");
      }
    };
  }
});

// ../../node_modules/.pnpm/@smithy+util-stream@3.3.4/node_modules/@smithy/util-stream/dist-es/checksum/createChecksumStream.browser.js
var createChecksumStream;
var init_createChecksumStream_browser = __esm({
  "../../node_modules/.pnpm/@smithy+util-stream@3.3.4/node_modules/@smithy/util-stream/dist-es/checksum/createChecksumStream.browser.js"() {
    init_import_meta_url();
    init_dist_es9();
    init_stream_type_check();
    init_ChecksumStream_browser();
    createChecksumStream = /* @__PURE__ */ __name(({ expectedChecksum, checksum, source, checksumSourceLocation, base64Encoder }) => {
      if (!isReadableStream(source)) {
        throw new Error(`@smithy/util-stream: unsupported source type ${source?.constructor?.name ?? source} in ChecksumStream.`);
      }
      const encoder = base64Encoder ?? toBase64;
      if (typeof TransformStream !== "function") {
        throw new Error("@smithy/util-stream: unable to instantiate ChecksumStream because API unavailable: ReadableStream/TransformStream.");
      }
      const transform = new TransformStream({
        start() {
        },
        async transform(chunk, controller) {
          checksum.update(chunk);
          controller.enqueue(chunk);
        },
        async flush(controller) {
          const digest = await checksum.digest();
          const received = encoder(digest);
          if (expectedChecksum !== received) {
            const error2 = new Error(`Checksum mismatch: expected "${expectedChecksum}" but received "${received}" in response header "${checksumSourceLocation}".`);
            controller.error(error2);
          } else {
            controller.terminate();
          }
        }
      });
      source.pipeThrough(transform);
      const readable = transform.readable;
      Object.setPrototypeOf(readable, ChecksumStream2.prototype);
      return readable;
    }, "createChecksumStream");
  }
});

// ../../node_modules/.pnpm/@smithy+util-stream@3.3.4/node_modules/@smithy/util-stream/dist-es/checksum/createChecksumStream.js
function createChecksumStream2(init4) {
  if (typeof ReadableStream === "function" && isReadableStream(init4.source)) {
    return createChecksumStream(init4);
  }
  return new ChecksumStream(init4);
}
var init_createChecksumStream = __esm({
  "../../node_modules/.pnpm/@smithy+util-stream@3.3.4/node_modules/@smithy/util-stream/dist-es/checksum/createChecksumStream.js"() {
    init_import_meta_url();
    init_stream_type_check();
    init_ChecksumStream();
    init_createChecksumStream_browser();
    __name(createChecksumStream2, "createChecksumStream");
  }
});

// ../../node_modules/.pnpm/@smithy+util-stream@3.3.4/node_modules/@smithy/util-stream/dist-es/index.js
var init_dist_es15 = __esm({
  "../../node_modules/.pnpm/@smithy+util-stream@3.3.4/node_modules/@smithy/util-stream/dist-es/index.js"() {
    init_import_meta_url();
    init_Uint8ArrayBlobAdapter();
    init_getAwsChunkedEncodingStream();
    init_sdk_stream_mixin();
    init_splitStream();
    init_headStream();
    init_stream_type_check();
    init_createChecksumStream();
    init_ChecksumStream();
  }
});

// ../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/submodules/protocols/collect-stream-body.js
var collectBody;
var init_collect_stream_body = __esm({
  "../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/submodules/protocols/collect-stream-body.js"() {
    init_import_meta_url();
    init_dist_es15();
    collectBody = /* @__PURE__ */ __name(async (streamBody = new Uint8Array(), context2) => {
      if (streamBody instanceof Uint8Array) {
        return Uint8ArrayBlobAdapter.mutate(streamBody);
      }
      if (!streamBody) {
        return Uint8ArrayBlobAdapter.mutate(new Uint8Array());
      }
      const fromContext = context2.streamCollector(streamBody);
      return Uint8ArrayBlobAdapter.mutate(await fromContext);
    }, "collectBody");
  }
});

// ../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/submodules/protocols/extended-encode-uri-component.js
function extendedEncodeURIComponent(str) {
  return encodeURIComponent(str).replace(/[!'()*]/g, function(c8) {
    return "%" + c8.charCodeAt(0).toString(16).toUpperCase();
  });
}
var init_extended_encode_uri_component = __esm({
  "../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/submodules/protocols/extended-encode-uri-component.js"() {
    init_import_meta_url();
    __name(extendedEncodeURIComponent, "extendedEncodeURIComponent");
  }
});

// ../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/submodules/protocols/resolve-path.js
var resolvedPath;
var init_resolve_path = __esm({
  "../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/submodules/protocols/resolve-path.js"() {
    init_import_meta_url();
    init_extended_encode_uri_component();
    resolvedPath = /* @__PURE__ */ __name((resolvedPath2, input, memberName, labelValueProvider, uriLabel, isGreedyLabel) => {
      if (input != null && input[memberName] !== void 0) {
        const labelValue = labelValueProvider();
        if (labelValue.length <= 0) {
          throw new Error("Empty value provided for input HTTP label: " + memberName + ".");
        }
        resolvedPath2 = resolvedPath2.replace(uriLabel, isGreedyLabel ? labelValue.split("/").map((segment) => extendedEncodeURIComponent(segment)).join("/") : extendedEncodeURIComponent(labelValue));
      } else {
        throw new Error("No value provided for input HTTP label: " + memberName + ".");
      }
      return resolvedPath2;
    }, "resolvedPath");
  }
});

// ../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/submodules/protocols/requestBuilder.js
function requestBuilder(input, context2) {
  return new RequestBuilder(input, context2);
}
var RequestBuilder;
var init_requestBuilder = __esm({
  "../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/submodules/protocols/requestBuilder.js"() {
    init_import_meta_url();
    init_dist_es2();
    init_resolve_path();
    __name(requestBuilder, "requestBuilder");
    RequestBuilder = class {
      static {
        __name(this, "RequestBuilder");
      }
      constructor(input, context2) {
        this.input = input;
        this.context = context2;
        this.query = {};
        this.method = "";
        this.headers = {};
        this.path = "";
        this.body = null;
        this.hostname = "";
        this.resolvePathStack = [];
      }
      async build() {
        const { hostname: hostname2, protocol = "https", port, path: basePath } = await this.context.endpoint();
        this.path = basePath;
        for (const resolvePath3 of this.resolvePathStack) {
          resolvePath3(this.path);
        }
        return new HttpRequest({
          protocol,
          hostname: this.hostname || hostname2,
          port,
          method: this.method,
          path: this.path,
          query: this.query,
          body: this.body,
          headers: this.headers
        });
      }
      hn(hostname2) {
        this.hostname = hostname2;
        return this;
      }
      bp(uriLabel) {
        this.resolvePathStack.push((basePath) => {
          this.path = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + uriLabel;
        });
        return this;
      }
      p(memberName, labelValueProvider, uriLabel, isGreedyLabel) {
        this.resolvePathStack.push((path84) => {
          this.path = resolvedPath(path84, this.input, memberName, labelValueProvider, uriLabel, isGreedyLabel);
        });
        return this;
      }
      h(headers) {
        this.headers = headers;
        return this;
      }
      q(query) {
        this.query = query;
        return this;
      }
      b(body) {
        this.body = body;
        return this;
      }
      m(method) {
        this.method = method;
        return this;
      }
    };
  }
});

// ../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/submodules/protocols/index.js
var init_protocols = __esm({
  "../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/submodules/protocols/index.js"() {
    init_import_meta_url();
    init_collect_stream_body();
    init_extended_encode_uri_component();
    init_requestBuilder();
    init_resolve_path();
  }
});

// ../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/protocols/requestBuilder.js
var init_requestBuilder2 = __esm({
  "../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/protocols/requestBuilder.js"() {
    init_import_meta_url();
    init_protocols();
  }
});

// ../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/setFeature.js
function setFeature2(context2, feature, value) {
  if (!context2.__smithy_context) {
    context2.__smithy_context = {
      features: {}
    };
  } else if (!context2.__smithy_context.features) {
    context2.__smithy_context.features = {};
  }
  context2.__smithy_context.features[feature] = value;
}
var init_setFeature2 = __esm({
  "../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/setFeature.js"() {
    init_import_meta_url();
    __name(setFeature2, "setFeature");
  }
});

// ../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/util-identity-and-auth/DefaultIdentityProviderConfig.js
var DefaultIdentityProviderConfig;
var init_DefaultIdentityProviderConfig = __esm({
  "../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/util-identity-and-auth/DefaultIdentityProviderConfig.js"() {
    init_import_meta_url();
    DefaultIdentityProviderConfig = class {
      static {
        __name(this, "DefaultIdentityProviderConfig");
      }
      constructor(config) {
        this.authSchemes = /* @__PURE__ */ new Map();
        for (const [key, value] of Object.entries(config)) {
          if (value !== void 0) {
            this.authSchemes.set(key, value);
          }
        }
      }
      getIdentityProvider(schemeId) {
        return this.authSchemes.get(schemeId);
      }
    };
  }
});

// ../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/util-identity-and-auth/httpAuthSchemes/httpApiKeyAuth.js
var init_httpApiKeyAuth = __esm({
  "../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/util-identity-and-auth/httpAuthSchemes/httpApiKeyAuth.js"() {
    init_import_meta_url();
    init_dist_es2();
    init_dist_es();
  }
});

// ../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/util-identity-and-auth/httpAuthSchemes/httpBearerAuth.js
var init_httpBearerAuth = __esm({
  "../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/util-identity-and-auth/httpAuthSchemes/httpBearerAuth.js"() {
    init_import_meta_url();
    init_dist_es2();
  }
});

// ../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/util-identity-and-auth/httpAuthSchemes/noAuth.js
var NoAuthSigner;
var init_noAuth = __esm({
  "../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/util-identity-and-auth/httpAuthSchemes/noAuth.js"() {
    init_import_meta_url();
    NoAuthSigner = class {
      static {
        __name(this, "NoAuthSigner");
      }
      async sign(httpRequest2, identity, signingProperties) {
        return httpRequest2;
      }
    };
  }
});

// ../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/util-identity-and-auth/httpAuthSchemes/index.js
var init_httpAuthSchemes = __esm({
  "../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/util-identity-and-auth/httpAuthSchemes/index.js"() {
    init_import_meta_url();
    init_httpApiKeyAuth();
    init_httpBearerAuth();
    init_noAuth();
  }
});

// ../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/util-identity-and-auth/memoizeIdentityProvider.js
var createIsIdentityExpiredFunction, EXPIRATION_MS, isIdentityExpired, doesIdentityRequireRefresh, memoizeIdentityProvider;
var init_memoizeIdentityProvider = __esm({
  "../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/util-identity-and-auth/memoizeIdentityProvider.js"() {
    init_import_meta_url();
    createIsIdentityExpiredFunction = /* @__PURE__ */ __name((expirationMs) => (identity) => doesIdentityRequireRefresh(identity) && identity.expiration.getTime() - Date.now() < expirationMs, "createIsIdentityExpiredFunction");
    EXPIRATION_MS = 3e5;
    isIdentityExpired = createIsIdentityExpiredFunction(EXPIRATION_MS);
    doesIdentityRequireRefresh = /* @__PURE__ */ __name((identity) => identity.expiration !== void 0, "doesIdentityRequireRefresh");
    memoizeIdentityProvider = /* @__PURE__ */ __name((provider, isExpired, requiresRefresh) => {
      if (provider === void 0) {
        return void 0;
      }
      const normalizedProvider = typeof provider !== "function" ? async () => Promise.resolve(provider) : provider;
      let resolved;
      let pending;
      let hasResult;
      let isConstant = false;
      const coalesceProvider = /* @__PURE__ */ __name(async (options) => {
        if (!pending) {
          pending = normalizedProvider(options);
        }
        try {
          resolved = await pending;
          hasResult = true;
          isConstant = false;
        } finally {
          pending = void 0;
        }
        return resolved;
      }, "coalesceProvider");
      if (isExpired === void 0) {
        return async (options) => {
          if (!hasResult || options?.forceRefresh) {
            resolved = await coalesceProvider(options);
          }
          return resolved;
        };
      }
      return async (options) => {
        if (!hasResult || options?.forceRefresh) {
          resolved = await coalesceProvider(options);
        }
        if (isConstant) {
          return resolved;
        }
        if (!requiresRefresh(resolved)) {
          isConstant = true;
          return resolved;
        }
        if (isExpired(resolved)) {
          await coalesceProvider(options);
          return resolved;
        }
        return resolved;
      };
    }, "memoizeIdentityProvider");
  }
});

// ../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/util-identity-and-auth/index.js
var init_util_identity_and_auth = __esm({
  "../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/util-identity-and-auth/index.js"() {
    init_import_meta_url();
    init_DefaultIdentityProviderConfig();
    init_httpAuthSchemes();
    init_memoizeIdentityProvider();
  }
});

// ../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/index.js
var init_dist_es16 = __esm({
  "../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/index.js"() {
    init_import_meta_url();
    init_getSmithyContext();
    init_middleware_http_auth_scheme();
    init_middleware_http_signing();
    init_normalizeProvider2();
    init_createPaginator();
    init_requestBuilder2();
    init_setFeature2();
    init_util_identity_and_auth();
  }
});

// ../../node_modules/.pnpm/@smithy+property-provider@3.1.11/node_modules/@smithy/property-provider/dist-es/ProviderError.js
var ProviderError;
var init_ProviderError = __esm({
  "../../node_modules/.pnpm/@smithy+property-provider@3.1.11/node_modules/@smithy/property-provider/dist-es/ProviderError.js"() {
    init_import_meta_url();
    ProviderError = class _ProviderError extends Error {
      static {
        __name(this, "ProviderError");
      }
      constructor(message, options = true) {
        let logger4;
        let tryNextLink = true;
        if (typeof options === "boolean") {
          logger4 = void 0;
          tryNextLink = options;
        } else if (options != null && typeof options === "object") {
          logger4 = options.logger;
          tryNextLink = options.tryNextLink ?? true;
        }
        super(message);
        this.name = "ProviderError";
        this.tryNextLink = tryNextLink;
        Object.setPrototypeOf(this, _ProviderError.prototype);
        logger4?.debug?.(`@smithy/property-provider ${tryNextLink ? "->" : "(!)"} ${message}`);
      }
      static from(error2, options = true) {
        return Object.assign(new this(error2.message, options), error2);
      }
    };
  }
});

// ../../node_modules/.pnpm/@smithy+property-provider@3.1.11/node_modules/@smithy/property-provider/dist-es/CredentialsProviderError.js
var CredentialsProviderError;
var init_CredentialsProviderError = __esm({
  "../../node_modules/.pnpm/@smithy+property-provider@3.1.11/node_modules/@smithy/property-provider/dist-es/CredentialsProviderError.js"() {
    init_import_meta_url();
    init_ProviderError();
    CredentialsProviderError = class _CredentialsProviderError extends ProviderError {
      static {
        __name(this, "CredentialsProviderError");
      }
      constructor(message, options = true) {
        super(message, options);
        this.name = "CredentialsProviderError";
        Object.setPrototypeOf(this, _CredentialsProviderError.prototype);
      }
    };
  }
});

// ../../node_modules/.pnpm/@smithy+property-provider@3.1.11/node_modules/@smithy/property-provider/dist-es/TokenProviderError.js
var TokenProviderError;
var init_TokenProviderError = __esm({
  "../../node_modules/.pnpm/@smithy+property-provider@3.1.11/node_modules/@smithy/property-provider/dist-es/TokenProviderError.js"() {
    init_import_meta_url();
    init_ProviderError();
    TokenProviderError = class _TokenProviderError extends ProviderError {
      static {
        __name(this, "TokenProviderError");
      }
      constructor(message, options = true) {
        super(message, options);
        this.name = "TokenProviderError";
        Object.setPrototypeOf(this, _TokenProviderError.prototype);
      }
    };
  }
});

// ../../node_modules/.pnpm/@smithy+property-provider@3.1.11/node_modules/@smithy/property-provider/dist-es/chain.js
var chain;
var init_chain = __esm({
  "../../node_modules/.pnpm/@smithy+property-provider@3.1.11/node_modules/@smithy/property-provider/dist-es/chain.js"() {
    init_import_meta_url();
    init_ProviderError();
    chain = /* @__PURE__ */ __name((...providers2) => async () => {
      if (providers2.length === 0) {
        throw new ProviderError("No providers in chain");
      }
      let lastProviderError;
      for (const provider of providers2) {
        try {
          const credentials = await provider();
          return credentials;
        } catch (err) {
          lastProviderError = err;
          if (err?.tryNextLink) {
            continue;
          }
          throw err;
        }
      }
      throw lastProviderError;
    }, "chain");
  }
});

// ../../node_modules/.pnpm/@smithy+property-provider@3.1.11/node_modules/@smithy/property-provider/dist-es/fromStatic.js
var fromStatic;
var init_fromStatic = __esm({
  "../../node_modules/.pnpm/@smithy+property-provider@3.1.11/node_modules/@smithy/property-provider/dist-es/fromStatic.js"() {
    init_import_meta_url();
    fromStatic = /* @__PURE__ */ __name((staticValue) => () => Promise.resolve(staticValue), "fromStatic");
  }
});

// ../../node_modules/.pnpm/@smithy+property-provider@3.1.11/node_modules/@smithy/property-provider/dist-es/memoize.js
var memoize;
var init_memoize = __esm({
  "../../node_modules/.pnpm/@smithy+property-provider@3.1.11/node_modules/@smithy/property-provider/dist-es/memoize.js"() {
    init_import_meta_url();
    memoize = /* @__PURE__ */ __name((provider, isExpired, requiresRefresh) => {
      let resolved;
      let pending;
      let hasResult;
      let isConstant = false;
      const coalesceProvider = /* @__PURE__ */ __name(async () => {
        if (!pending) {
          pending = provider();
        }
        try {
          resolved = await pending;
          hasResult = true;
          isConstant = false;
        } finally {
          pending = void 0;
        }
        return resolved;
      }, "coalesceProvider");
      if (isExpired === void 0) {
        return async (options) => {
          if (!hasResult || options?.forceRefresh) {
            resolved = await coalesceProvider();
          }
          return resolved;
        };
      }
      return async (options) => {
        if (!hasResult || options?.forceRefresh) {
          resolved = await coalesceProvider();
        }
        if (isConstant) {
          return resolved;
        }
        if (requiresRefresh && !requiresRefresh(resolved)) {
          isConstant = true;
          return resolved;
        }
        if (isExpired(resolved)) {
          await coalesceProvider();
          return resolved;
        }
        return resolved;
      };
    }, "memoize");
  }
});

// ../../node_modules/.pnpm/@smithy+property-provider@3.1.11/node_modules/@smithy/property-provider/dist-es/index.js
var init_dist_es17 = __esm({
  "../../node_modules/.pnpm/@smithy+property-provider@3.1.11/node_modules/@smithy/property-provider/dist-es/index.js"() {
    init_import_meta_url();
    init_CredentialsProviderError();
    init_ProviderError();
    init_TokenProviderError();
    init_chain();
    init_fromStatic();
    init_memoize();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4AConfig.js
var resolveAwsSdkSigV4AConfig, NODE_SIGV4A_CONFIG_OPTIONS;
var init_resolveAwsSdkSigV4AConfig = __esm({
  "../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4AConfig.js"() {
    init_import_meta_url();
    init_dist_es16();
    init_dist_es17();
    resolveAwsSdkSigV4AConfig = /* @__PURE__ */ __name((config) => {
      config.sigv4aSigningRegionSet = normalizeProvider2(config.sigv4aSigningRegionSet);
      return config;
    }, "resolveAwsSdkSigV4AConfig");
    NODE_SIGV4A_CONFIG_OPTIONS = {
      environmentVariableSelector(env6) {
        if (env6.AWS_SIGV4A_SIGNING_REGION_SET) {
          return env6.AWS_SIGV4A_SIGNING_REGION_SET.split(",").map((_5) => _5.trim());
        }
        throw new ProviderError("AWS_SIGV4A_SIGNING_REGION_SET not set in env.", {
          tryNextLink: true
        });
      },
      configFileSelector(profile) {
        if (profile.sigv4a_signing_region_set) {
          return (profile.sigv4a_signing_region_set ?? "").split(",").map((_5) => _5.trim());
        }
        throw new ProviderError("sigv4a_signing_region_set not set in profile.", {
          tryNextLink: true
        });
      },
      default: void 0
    };
  }
});

// ../../node_modules/.pnpm/@smithy+signature-v4@4.2.4/node_modules/@smithy/signature-v4/dist-es/constants.js
var ALGORITHM_QUERY_PARAM, CREDENTIAL_QUERY_PARAM, AMZ_DATE_QUERY_PARAM, SIGNED_HEADERS_QUERY_PARAM, EXPIRES_QUERY_PARAM, SIGNATURE_QUERY_PARAM, TOKEN_QUERY_PARAM, AUTH_HEADER, AMZ_DATE_HEADER, DATE_HEADER, GENERATED_HEADERS, SIGNATURE_HEADER, SHA256_HEADER, TOKEN_HEADER, ALWAYS_UNSIGNABLE_HEADERS, PROXY_HEADER_PATTERN, SEC_HEADER_PATTERN, ALGORITHM_IDENTIFIER, EVENT_ALGORITHM_IDENTIFIER, UNSIGNED_PAYLOAD, MAX_CACHE_SIZE, KEY_TYPE_IDENTIFIER, MAX_PRESIGNED_TTL;
var init_constants10 = __esm({
  "../../node_modules/.pnpm/@smithy+signature-v4@4.2.4/node_modules/@smithy/signature-v4/dist-es/constants.js"() {
    init_import_meta_url();
    ALGORITHM_QUERY_PARAM = "X-Amz-Algorithm";
    CREDENTIAL_QUERY_PARAM = "X-Amz-Credential";
    AMZ_DATE_QUERY_PARAM = "X-Amz-Date";
    SIGNED_HEADERS_QUERY_PARAM = "X-Amz-SignedHeaders";
    EXPIRES_QUERY_PARAM = "X-Amz-Expires";
    SIGNATURE_QUERY_PARAM = "X-Amz-Signature";
    TOKEN_QUERY_PARAM = "X-Amz-Security-Token";
    AUTH_HEADER = "authorization";
    AMZ_DATE_HEADER = AMZ_DATE_QUERY_PARAM.toLowerCase();
    DATE_HEADER = "date";
    GENERATED_HEADERS = [AUTH_HEADER, AMZ_DATE_HEADER, DATE_HEADER];
    SIGNATURE_HEADER = SIGNATURE_QUERY_PARAM.toLowerCase();
    SHA256_HEADER = "x-amz-content-sha256";
    TOKEN_HEADER = TOKEN_QUERY_PARAM.toLowerCase();
    ALWAYS_UNSIGNABLE_HEADERS = {
      authorization: true,
      "cache-control": true,
      connection: true,
      expect: true,
      from: true,
      "keep-alive": true,
      "max-forwards": true,
      pragma: true,
      referer: true,
      te: true,
      trailer: true,
      "transfer-encoding": true,
      upgrade: true,
      "user-agent": true,
      "x-amzn-trace-id": true
    };
    PROXY_HEADER_PATTERN = /^proxy-/;
    SEC_HEADER_PATTERN = /^sec-/;
    ALGORITHM_IDENTIFIER = "AWS4-HMAC-SHA256";
    EVENT_ALGORITHM_IDENTIFIER = "AWS4-HMAC-SHA256-PAYLOAD";
    UNSIGNED_PAYLOAD = "UNSIGNED-PAYLOAD";
    MAX_CACHE_SIZE = 50;
    KEY_TYPE_IDENTIFIER = "aws4_request";
    MAX_PRESIGNED_TTL = 60 * 60 * 24 * 7;
  }
});

// ../../node_modules/.pnpm/@smithy+signature-v4@4.2.4/node_modules/@smithy/signature-v4/dist-es/credentialDerivation.js
var signingKeyCache, cacheQueue, createScope, getSigningKey, hmac;
var init_credentialDerivation = __esm({
  "../../node_modules/.pnpm/@smithy+signature-v4@4.2.4/node_modules/@smithy/signature-v4/dist-es/credentialDerivation.js"() {
    init_import_meta_url();
    init_dist_es14();
    init_dist_es8();
    init_constants10();
    signingKeyCache = {};
    cacheQueue = [];
    createScope = /* @__PURE__ */ __name((shortDate, region, service) => `${shortDate}/${region}/${service}/${KEY_TYPE_IDENTIFIER}`, "createScope");
    getSigningKey = /* @__PURE__ */ __name(async (sha256Constructor, credentials, shortDate, region, service) => {
      const credsHash = await hmac(sha256Constructor, credentials.secretAccessKey, credentials.accessKeyId);
      const cacheKey = `${shortDate}:${region}:${service}:${toHex(credsHash)}:${credentials.sessionToken}`;
      if (cacheKey in signingKeyCache) {
        return signingKeyCache[cacheKey];
      }
      cacheQueue.push(cacheKey);
      while (cacheQueue.length > MAX_CACHE_SIZE) {
        delete signingKeyCache[cacheQueue.shift()];
      }
      let key = `AWS4${credentials.secretAccessKey}`;
      for (const signable of [shortDate, region, service, KEY_TYPE_IDENTIFIER]) {
        key = await hmac(sha256Constructor, key, signable);
      }
      return signingKeyCache[cacheKey] = key;
    }, "getSigningKey");
    hmac = /* @__PURE__ */ __name((ctor, secret, data) => {
      const hash = new ctor(secret);
      hash.update(toUint8Array(data));
      return hash.digest();
    }, "hmac");
  }
});

// ../../node_modules/.pnpm/@smithy+signature-v4@4.2.4/node_modules/@smithy/signature-v4/dist-es/getCanonicalHeaders.js
var getCanonicalHeaders;
var init_getCanonicalHeaders = __esm({
  "../../node_modules/.pnpm/@smithy+signature-v4@4.2.4/node_modules/@smithy/signature-v4/dist-es/getCanonicalHeaders.js"() {
    init_import_meta_url();
    init_constants10();
    getCanonicalHeaders = /* @__PURE__ */ __name(({ headers }, unsignableHeaders, signableHeaders) => {
      const canonical = {};
      for (const headerName of Object.keys(headers).sort()) {
        if (headers[headerName] == void 0) {
          continue;
        }
        const canonicalHeaderName = headerName.toLowerCase();
        if (canonicalHeaderName in ALWAYS_UNSIGNABLE_HEADERS || unsignableHeaders?.has(canonicalHeaderName) || PROXY_HEADER_PATTERN.test(canonicalHeaderName) || SEC_HEADER_PATTERN.test(canonicalHeaderName)) {
          if (!signableHeaders || signableHeaders && !signableHeaders.has(canonicalHeaderName)) {
            continue;
          }
        }
        canonical[canonicalHeaderName] = headers[headerName].trim().replace(/\s+/g, " ");
      }
      return canonical;
    }, "getCanonicalHeaders");
  }
});

// ../../node_modules/.pnpm/@smithy+signature-v4@4.2.4/node_modules/@smithy/signature-v4/dist-es/getCanonicalQuery.js
var getCanonicalQuery;
var init_getCanonicalQuery = __esm({
  "../../node_modules/.pnpm/@smithy+signature-v4@4.2.4/node_modules/@smithy/signature-v4/dist-es/getCanonicalQuery.js"() {
    init_import_meta_url();
    init_dist_es10();
    init_constants10();
    getCanonicalQuery = /* @__PURE__ */ __name(({ query = {} }) => {
      const keys = [];
      const serialized = {};
      for (const key of Object.keys(query)) {
        if (key.toLowerCase() === SIGNATURE_HEADER) {
          continue;
        }
        const encodedKey = escapeUri(key);
        keys.push(encodedKey);
        const value = query[key];
        if (typeof value === "string") {
          serialized[encodedKey] = `${encodedKey}=${escapeUri(value)}`;
        } else if (Array.isArray(value)) {
          serialized[encodedKey] = value.slice(0).reduce((encoded, value2) => encoded.concat([`${encodedKey}=${escapeUri(value2)}`]), []).sort().join("&");
        }
      }
      return keys.sort().map((key) => serialized[key]).filter((serialized2) => serialized2).join("&");
    }, "getCanonicalQuery");
  }
});

// ../../node_modules/.pnpm/@smithy+signature-v4@4.2.4/node_modules/@smithy/signature-v4/dist-es/getPayloadHash.js
var getPayloadHash;
var init_getPayloadHash = __esm({
  "../../node_modules/.pnpm/@smithy+signature-v4@4.2.4/node_modules/@smithy/signature-v4/dist-es/getPayloadHash.js"() {
    init_import_meta_url();
    init_dist_es6();
    init_dist_es14();
    init_dist_es8();
    init_constants10();
    getPayloadHash = /* @__PURE__ */ __name(async ({ headers, body }, hashConstructor) => {
      for (const headerName of Object.keys(headers)) {
        if (headerName.toLowerCase() === SHA256_HEADER) {
          return headers[headerName];
        }
      }
      if (body == void 0) {
        return "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";
      } else if (typeof body === "string" || ArrayBuffer.isView(body) || isArrayBuffer(body)) {
        const hashCtor = new hashConstructor();
        hashCtor.update(toUint8Array(body));
        return toHex(await hashCtor.digest());
      }
      return UNSIGNED_PAYLOAD;
    }, "getPayloadHash");
  }
});

// ../../node_modules/.pnpm/@smithy+signature-v4@4.2.4/node_modules/@smithy/signature-v4/dist-es/HeaderFormatter.js
function negate(bytes) {
  for (let i7 = 0; i7 < 8; i7++) {
    bytes[i7] ^= 255;
  }
  for (let i7 = 7; i7 > -1; i7--) {
    bytes[i7]++;
    if (bytes[i7] !== 0)
      break;
  }
}
var HeaderFormatter, HEADER_VALUE_TYPE, UUID_PATTERN, Int64;
var init_HeaderFormatter = __esm({
  "../../node_modules/.pnpm/@smithy+signature-v4@4.2.4/node_modules/@smithy/signature-v4/dist-es/HeaderFormatter.js"() {
    init_import_meta_url();
    init_dist_es14();
    init_dist_es8();
    HeaderFormatter = class {
      static {
        __name(this, "HeaderFormatter");
      }
      format(headers) {
        const chunks = [];
        for (const headerName of Object.keys(headers)) {
          const bytes = fromUtf8(headerName);
          chunks.push(Uint8Array.from([bytes.byteLength]), bytes, this.formatHeaderValue(headers[headerName]));
        }
        const out = new Uint8Array(chunks.reduce((carry, bytes) => carry + bytes.byteLength, 0));
        let position = 0;
        for (const chunk of chunks) {
          out.set(chunk, position);
          position += chunk.byteLength;
        }
        return out;
      }
      formatHeaderValue(header) {
        switch (header.type) {
          case "boolean":
            return Uint8Array.from([header.value ? 0 : 1]);
          case "byte":
            return Uint8Array.from([2, header.value]);
          case "short":
            const shortView = new DataView(new ArrayBuffer(3));
            shortView.setUint8(0, 3);
            shortView.setInt16(1, header.value, false);
            return new Uint8Array(shortView.buffer);
          case "integer":
            const intView = new DataView(new ArrayBuffer(5));
            intView.setUint8(0, 4);
            intView.setInt32(1, header.value, false);
            return new Uint8Array(intView.buffer);
          case "long":
            const longBytes = new Uint8Array(9);
            longBytes[0] = 5;
            longBytes.set(header.value.bytes, 1);
            return longBytes;
          case "binary":
            const binView = new DataView(new ArrayBuffer(3 + header.value.byteLength));
            binView.setUint8(0, 6);
            binView.setUint16(1, header.value.byteLength, false);
            const binBytes = new Uint8Array(binView.buffer);
            binBytes.set(header.value, 3);
            return binBytes;
          case "string":
            const utf8Bytes = fromUtf8(header.value);
            const strView = new DataView(new ArrayBuffer(3 + utf8Bytes.byteLength));
            strView.setUint8(0, 7);
            strView.setUint16(1, utf8Bytes.byteLength, false);
            const strBytes = new Uint8Array(strView.buffer);
            strBytes.set(utf8Bytes, 3);
            return strBytes;
          case "timestamp":
            const tsBytes = new Uint8Array(9);
            tsBytes[0] = 8;
            tsBytes.set(Int64.fromNumber(header.value.valueOf()).bytes, 1);
            return tsBytes;
          case "uuid":
            if (!UUID_PATTERN.test(header.value)) {
              throw new Error(`Invalid UUID received: ${header.value}`);
            }
            const uuidBytes = new Uint8Array(17);
            uuidBytes[0] = 9;
            uuidBytes.set(fromHex(header.value.replace(/\-/g, "")), 1);
            return uuidBytes;
        }
      }
    };
    (function(HEADER_VALUE_TYPE3) {
      HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["boolTrue"] = 0] = "boolTrue";
      HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["boolFalse"] = 1] = "boolFalse";
      HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["byte"] = 2] = "byte";
      HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["short"] = 3] = "short";
      HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["integer"] = 4] = "integer";
      HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["long"] = 5] = "long";
      HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["byteArray"] = 6] = "byteArray";
      HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["string"] = 7] = "string";
      HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["timestamp"] = 8] = "timestamp";
      HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["uuid"] = 9] = "uuid";
    })(HEADER_VALUE_TYPE || (HEADER_VALUE_TYPE = {}));
    UUID_PATTERN = /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;
    Int64 = class _Int64 {
      static {
        __name(this, "Int64");
      }
      constructor(bytes) {
        this.bytes = bytes;
        if (bytes.byteLength !== 8) {
          throw new Error("Int64 buffers must be exactly 8 bytes");
        }
      }
      static fromNumber(number) {
        if (number > 9223372036854776e3 || number < -9223372036854776e3) {
          throw new Error(`${number} is too large (or, if negative, too small) to represent as an Int64`);
        }
        const bytes = new Uint8Array(8);
        for (let i7 = 7, remaining = Math.abs(Math.round(number)); i7 > -1 && remaining > 0; i7--, remaining /= 256) {
          bytes[i7] = remaining;
        }
        if (number < 0) {
          negate(bytes);
        }
        return new _Int64(bytes);
      }
      valueOf() {
        const bytes = this.bytes.slice(0);
        const negative = bytes[0] & 128;
        if (negative) {
          negate(bytes);
        }
        return parseInt(toHex(bytes), 16) * (negative ? -1 : 1);
      }
      toString() {
        return String(this.valueOf());
      }
    };
    __name(negate, "negate");
  }
});

// ../../node_modules/.pnpm/@smithy+signature-v4@4.2.4/node_modules/@smithy/signature-v4/dist-es/headerUtil.js
var hasHeader;
var init_headerUtil = __esm({
  "../../node_modules/.pnpm/@smithy+signature-v4@4.2.4/node_modules/@smithy/signature-v4/dist-es/headerUtil.js"() {
    init_import_meta_url();
    hasHeader = /* @__PURE__ */ __name((soughtHeader, headers) => {
      soughtHeader = soughtHeader.toLowerCase();
      for (const headerName of Object.keys(headers)) {
        if (soughtHeader === headerName.toLowerCase()) {
          return true;
        }
      }
      return false;
    }, "hasHeader");
  }
});

// ../../node_modules/.pnpm/@smithy+signature-v4@4.2.4/node_modules/@smithy/signature-v4/dist-es/moveHeadersToQuery.js
var moveHeadersToQuery;
var init_moveHeadersToQuery = __esm({
  "../../node_modules/.pnpm/@smithy+signature-v4@4.2.4/node_modules/@smithy/signature-v4/dist-es/moveHeadersToQuery.js"() {
    init_import_meta_url();
    init_dist_es2();
    moveHeadersToQuery = /* @__PURE__ */ __name((request4, options = {}) => {
      const { headers, query = {} } = HttpRequest.clone(request4);
      for (const name2 of Object.keys(headers)) {
        const lname = name2.toLowerCase();
        if (lname.slice(0, 6) === "x-amz-" && !options.unhoistableHeaders?.has(lname) || options.hoistableHeaders?.has(lname)) {
          query[name2] = headers[name2];
          delete headers[name2];
        }
      }
      return {
        ...request4,
        headers,
        query
      };
    }, "moveHeadersToQuery");
  }
});

// ../../node_modules/.pnpm/@smithy+signature-v4@4.2.4/node_modules/@smithy/signature-v4/dist-es/prepareRequest.js
var prepareRequest;
var init_prepareRequest = __esm({
  "../../node_modules/.pnpm/@smithy+signature-v4@4.2.4/node_modules/@smithy/signature-v4/dist-es/prepareRequest.js"() {
    init_import_meta_url();
    init_dist_es2();
    init_constants10();
    prepareRequest = /* @__PURE__ */ __name((request4) => {
      request4 = HttpRequest.clone(request4);
      for (const headerName of Object.keys(request4.headers)) {
        if (GENERATED_HEADERS.indexOf(headerName.toLowerCase()) > -1) {
          delete request4.headers[headerName];
        }
      }
      return request4;
    }, "prepareRequest");
  }
});

// ../../node_modules/.pnpm/@smithy+signature-v4@4.2.4/node_modules/@smithy/signature-v4/dist-es/utilDate.js
var iso8601, toDate2;
var init_utilDate = __esm({
  "../../node_modules/.pnpm/@smithy+signature-v4@4.2.4/node_modules/@smithy/signature-v4/dist-es/utilDate.js"() {
    init_import_meta_url();
    iso8601 = /* @__PURE__ */ __name((time) => toDate2(time).toISOString().replace(/\.\d{3}Z$/, "Z"), "iso8601");
    toDate2 = /* @__PURE__ */ __name((time) => {
      if (typeof time === "number") {
        return new Date(time * 1e3);
      }
      if (typeof time === "string") {
        if (Number(time)) {
          return new Date(Number(time) * 1e3);
        }
        return new Date(time);
      }
      return time;
    }, "toDate");
  }
});

// ../../node_modules/.pnpm/@smithy+signature-v4@4.2.4/node_modules/@smithy/signature-v4/dist-es/SignatureV4.js
var SignatureV4, formatDate, getCanonicalHeaderList;
var init_SignatureV4 = __esm({
  "../../node_modules/.pnpm/@smithy+signature-v4@4.2.4/node_modules/@smithy/signature-v4/dist-es/SignatureV4.js"() {
    init_import_meta_url();
    init_dist_es14();
    init_dist_es4();
    init_dist_es10();
    init_dist_es8();
    init_constants10();
    init_credentialDerivation();
    init_getCanonicalHeaders();
    init_getCanonicalQuery();
    init_getPayloadHash();
    init_HeaderFormatter();
    init_headerUtil();
    init_moveHeadersToQuery();
    init_prepareRequest();
    init_utilDate();
    SignatureV4 = class {
      static {
        __name(this, "SignatureV4");
      }
      constructor({ applyChecksum, credentials, region, service, sha256, uriEscapePath = true }) {
        this.headerFormatter = new HeaderFormatter();
        this.service = service;
        this.sha256 = sha256;
        this.uriEscapePath = uriEscapePath;
        this.applyChecksum = typeof applyChecksum === "boolean" ? applyChecksum : true;
        this.regionProvider = normalizeProvider(region);
        this.credentialProvider = normalizeProvider(credentials);
      }
      async presign(originalRequest, options = {}) {
        const { signingDate = /* @__PURE__ */ new Date(), expiresIn = 3600, unsignableHeaders, unhoistableHeaders, signableHeaders, hoistableHeaders, signingRegion, signingService } = options;
        const credentials = await this.credentialProvider();
        this.validateResolvedCredentials(credentials);
        const region = signingRegion ?? await this.regionProvider();
        const { longDate, shortDate } = formatDate(signingDate);
        if (expiresIn > MAX_PRESIGNED_TTL) {
          return Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future");
        }
        const scope = createScope(shortDate, region, signingService ?? this.service);
        const request4 = moveHeadersToQuery(prepareRequest(originalRequest), { unhoistableHeaders, hoistableHeaders });
        if (credentials.sessionToken) {
          request4.query[TOKEN_QUERY_PARAM] = credentials.sessionToken;
        }
        request4.query[ALGORITHM_QUERY_PARAM] = ALGORITHM_IDENTIFIER;
        request4.query[CREDENTIAL_QUERY_PARAM] = `${credentials.accessKeyId}/${scope}`;
        request4.query[AMZ_DATE_QUERY_PARAM] = longDate;
        request4.query[EXPIRES_QUERY_PARAM] = expiresIn.toString(10);
        const canonicalHeaders = getCanonicalHeaders(request4, unsignableHeaders, signableHeaders);
        request4.query[SIGNED_HEADERS_QUERY_PARAM] = getCanonicalHeaderList(canonicalHeaders);
        request4.query[SIGNATURE_QUERY_PARAM] = await this.getSignature(longDate, scope, this.getSigningKey(credentials, region, shortDate, signingService), this.createCanonicalRequest(request4, canonicalHeaders, await getPayloadHash(originalRequest, this.sha256)));
        return request4;
      }
      async sign(toSign, options) {
        if (typeof toSign === "string") {
          return this.signString(toSign, options);
        } else if (toSign.headers && toSign.payload) {
          return this.signEvent(toSign, options);
        } else if (toSign.message) {
          return this.signMessage(toSign, options);
        } else {
          return this.signRequest(toSign, options);
        }
      }
      async signEvent({ headers, payload }, { signingDate = /* @__PURE__ */ new Date(), priorSignature, signingRegion, signingService }) {
        const region = signingRegion ?? await this.regionProvider();
        const { shortDate, longDate } = formatDate(signingDate);
        const scope = createScope(shortDate, region, signingService ?? this.service);
        const hashedPayload = await getPayloadHash({ headers: {}, body: payload }, this.sha256);
        const hash = new this.sha256();
        hash.update(headers);
        const hashedHeaders = toHex(await hash.digest());
        const stringToSign = [
          EVENT_ALGORITHM_IDENTIFIER,
          longDate,
          scope,
          priorSignature,
          hashedHeaders,
          hashedPayload
        ].join("\n");
        return this.signString(stringToSign, { signingDate, signingRegion: region, signingService });
      }
      async signMessage(signableMessage, { signingDate = /* @__PURE__ */ new Date(), signingRegion, signingService }) {
        const promise = this.signEvent({
          headers: this.headerFormatter.format(signableMessage.message.headers),
          payload: signableMessage.message.body
        }, {
          signingDate,
          signingRegion,
          signingService,
          priorSignature: signableMessage.priorSignature
        });
        return promise.then((signature) => {
          return { message: signableMessage.message, signature };
        });
      }
      async signString(stringToSign, { signingDate = /* @__PURE__ */ new Date(), signingRegion, signingService } = {}) {
        const credentials = await this.credentialProvider();
        this.validateResolvedCredentials(credentials);
        const region = signingRegion ?? await this.regionProvider();
        const { shortDate } = formatDate(signingDate);
        const hash = new this.sha256(await this.getSigningKey(credentials, region, shortDate, signingService));
        hash.update(toUint8Array(stringToSign));
        return toHex(await hash.digest());
      }
      async signRequest(requestToSign, { signingDate = /* @__PURE__ */ new Date(), signableHeaders, unsignableHeaders, signingRegion, signingService } = {}) {
        const credentials = await this.credentialProvider();
        this.validateResolvedCredentials(credentials);
        const region = signingRegion ?? await this.regionProvider();
        const request4 = prepareRequest(requestToSign);
        const { longDate, shortDate } = formatDate(signingDate);
        const scope = createScope(shortDate, region, signingService ?? this.service);
        request4.headers[AMZ_DATE_HEADER] = longDate;
        if (credentials.sessionToken) {
          request4.headers[TOKEN_HEADER] = credentials.sessionToken;
        }
        const payloadHash = await getPayloadHash(request4, this.sha256);
        if (!hasHeader(SHA256_HEADER, request4.headers) && this.applyChecksum) {
          request4.headers[SHA256_HEADER] = payloadHash;
        }
        const canonicalHeaders = getCanonicalHeaders(request4, unsignableHeaders, signableHeaders);
        const signature = await this.getSignature(longDate, scope, this.getSigningKey(credentials, region, shortDate, signingService), this.createCanonicalRequest(request4, canonicalHeaders, payloadHash));
        request4.headers[AUTH_HEADER] = `${ALGORITHM_IDENTIFIER} Credential=${credentials.accessKeyId}/${scope}, SignedHeaders=${getCanonicalHeaderList(canonicalHeaders)}, Signature=${signature}`;
        return request4;
      }
      createCanonicalRequest(request4, canonicalHeaders, payloadHash) {
        const sortedHeaders = Object.keys(canonicalHeaders).sort();
        return `${request4.method}
${this.getCanonicalPath(request4)}
${getCanonicalQuery(request4)}
${sortedHeaders.map((name2) => `${name2}:${canonicalHeaders[name2]}`).join("\n")}

${sortedHeaders.join(";")}
${payloadHash}`;
      }
      async createStringToSign(longDate, credentialScope, canonicalRequest) {
        const hash = new this.sha256();
        hash.update(toUint8Array(canonicalRequest));
        const hashedRequest = await hash.digest();
        return `${ALGORITHM_IDENTIFIER}
${longDate}
${credentialScope}
${toHex(hashedRequest)}`;
      }
      getCanonicalPath({ path: path84 }) {
        if (this.uriEscapePath) {
          const normalizedPathSegments = [];
          for (const pathSegment of path84.split("/")) {
            if (pathSegment?.length === 0)
              continue;
            if (pathSegment === ".")
              continue;
            if (pathSegment === "..") {
              normalizedPathSegments.pop();
            } else {
              normalizedPathSegments.push(pathSegment);
            }
          }
          const normalizedPath = `${path84?.startsWith("/") ? "/" : ""}${normalizedPathSegments.join("/")}${normalizedPathSegments.length > 0 && path84?.endsWith("/") ? "/" : ""}`;
          const doubleEncoded = escapeUri(normalizedPath);
          return doubleEncoded.replace(/%2F/g, "/");
        }
        return path84;
      }
      async getSignature(longDate, credentialScope, keyPromise, canonicalRequest) {
        const stringToSign = await this.createStringToSign(longDate, credentialScope, canonicalRequest);
        const hash = new this.sha256(await keyPromise);
        hash.update(toUint8Array(stringToSign));
        return toHex(await hash.digest());
      }
      getSigningKey(credentials, region, shortDate, service) {
        return getSigningKey(this.sha256, credentials, shortDate, region, service || this.service);
      }
      validateResolvedCredentials(credentials) {
        if (typeof credentials !== "object" || typeof credentials.accessKeyId !== "string" || typeof credentials.secretAccessKey !== "string") {
          throw new Error("Resolved credential object is not valid");
        }
      }
    };
    formatDate = /* @__PURE__ */ __name((now) => {
      const longDate = iso8601(now).replace(/[\-:]/g, "");
      return {
        longDate,
        shortDate: longDate.slice(0, 8)
      };
    }, "formatDate");
    getCanonicalHeaderList = /* @__PURE__ */ __name((headers) => Object.keys(headers).sort().join(";"), "getCanonicalHeaderList");
  }
});

// ../../node_modules/.pnpm/@smithy+signature-v4@4.2.4/node_modules/@smithy/signature-v4/dist-es/index.js
var init_dist_es18 = __esm({
  "../../node_modules/.pnpm/@smithy+signature-v4@4.2.4/node_modules/@smithy/signature-v4/dist-es/index.js"() {
    init_import_meta_url();
    init_SignatureV4();
    init_getCanonicalHeaders();
    init_getCanonicalQuery();
    init_getPayloadHash();
    init_moveHeadersToQuery();
    init_prepareRequest();
    init_credentialDerivation();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.js
var resolveAwsSdkSigV4Config;
var init_resolveAwsSdkSigV4Config = __esm({
  "../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.js"() {
    init_import_meta_url();
    init_client8();
    init_dist_es16();
    init_dist_es18();
    resolveAwsSdkSigV4Config = /* @__PURE__ */ __name((config) => {
      let isUserSupplied = false;
      let credentialsProvider;
      if (config.credentials) {
        isUserSupplied = true;
        credentialsProvider = memoizeIdentityProvider(config.credentials, isIdentityExpired, doesIdentityRequireRefresh);
      }
      if (!credentialsProvider) {
        if (config.credentialDefaultProvider) {
          credentialsProvider = normalizeProvider2(config.credentialDefaultProvider(Object.assign({}, config, {
            parentClientConfig: config
          })));
        } else {
          credentialsProvider = /* @__PURE__ */ __name(async () => {
            throw new Error("`credentials` is missing");
          }, "credentialsProvider");
        }
      }
      const boundCredentialsProvider = /* @__PURE__ */ __name(async () => credentialsProvider({ callerClientConfig: config }), "boundCredentialsProvider");
      const { signingEscapePath = true, systemClockOffset = config.systemClockOffset || 0, sha256 } = config;
      let signer;
      if (config.signer) {
        signer = normalizeProvider2(config.signer);
      } else if (config.regionInfoProvider) {
        signer = /* @__PURE__ */ __name(() => normalizeProvider2(config.region)().then(async (region) => [
          await config.regionInfoProvider(region, {
            useFipsEndpoint: await config.useFipsEndpoint(),
            useDualstackEndpoint: await config.useDualstackEndpoint()
          }) || {},
          region
        ]).then(([regionInfo, region]) => {
          const { signingRegion, signingService } = regionInfo;
          config.signingRegion = config.signingRegion || signingRegion || region;
          config.signingName = config.signingName || signingService || config.serviceId;
          const params = {
            ...config,
            credentials: boundCredentialsProvider,
            region: config.signingRegion,
            service: config.signingName,
            sha256,
            uriEscapePath: signingEscapePath
          };
          const SignerCtor = config.signerConstructor || SignatureV4;
          return new SignerCtor(params);
        }), "signer");
      } else {
        signer = /* @__PURE__ */ __name(async (authScheme) => {
          authScheme = Object.assign({}, {
            name: "sigv4",
            signingName: config.signingName || config.defaultSigningName,
            signingRegion: await normalizeProvider2(config.region)(),
            properties: {}
          }, authScheme);
          const signingRegion = authScheme.signingRegion;
          const signingService = authScheme.signingName;
          config.signingRegion = config.signingRegion || signingRegion;
          config.signingName = config.signingName || signingService || config.serviceId;
          const params = {
            ...config,
            credentials: boundCredentialsProvider,
            region: config.signingRegion,
            service: config.signingName,
            sha256,
            uriEscapePath: signingEscapePath
          };
          const SignerCtor = config.signerConstructor || SignatureV4;
          return new SignerCtor(params);
        }, "signer");
      }
      return {
        ...config,
        systemClockOffset,
        signingEscapePath,
        credentials: isUserSupplied ? async () => boundCredentialsProvider().then((creds) => setCredentialFeature(creds, "CREDENTIALS_CODE", "e")) : boundCredentialsProvider,
        signer
      };
    }, "resolveAwsSdkSigV4Config");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/index.js
var init_aws_sdk = __esm({
  "../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/index.js"() {
    init_import_meta_url();
    init_AwsSdkSigV4Signer();
    init_AwsSdkSigV4ASigner();
    init_resolveAwsSdkSigV4AConfig();
    init_resolveAwsSdkSigV4Config();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/index.js
var init_httpAuthSchemes2 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/index.js"() {
    init_import_meta_url();
    init_aws_sdk();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/protocols/coercing-serializers.js
var init_coercing_serializers = __esm({
  "../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/protocols/coercing-serializers.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+middleware-stack@3.0.11/node_modules/@smithy/middleware-stack/dist-es/MiddlewareStack.js
var getAllAliases, getMiddlewareNameWithAliases, constructStack, stepWeights, priorityWeights;
var init_MiddlewareStack = __esm({
  "../../node_modules/.pnpm/@smithy+middleware-stack@3.0.11/node_modules/@smithy/middleware-stack/dist-es/MiddlewareStack.js"() {
    init_import_meta_url();
    getAllAliases = /* @__PURE__ */ __name((name2, aliases2) => {
      const _aliases = [];
      if (name2) {
        _aliases.push(name2);
      }
      if (aliases2) {
        for (const alias of aliases2) {
          _aliases.push(alias);
        }
      }
      return _aliases;
    }, "getAllAliases");
    getMiddlewareNameWithAliases = /* @__PURE__ */ __name((name2, aliases2) => {
      return `${name2 || "anonymous"}${aliases2 && aliases2.length > 0 ? ` (a.k.a. ${aliases2.join(",")})` : ""}`;
    }, "getMiddlewareNameWithAliases");
    constructStack = /* @__PURE__ */ __name(() => {
      let absoluteEntries = [];
      let relativeEntries = [];
      let identifyOnResolve = false;
      const entriesNameSet = /* @__PURE__ */ new Set();
      const sort = /* @__PURE__ */ __name((entries2) => entries2.sort((a7, b11) => stepWeights[b11.step] - stepWeights[a7.step] || priorityWeights[b11.priority || "normal"] - priorityWeights[a7.priority || "normal"]), "sort");
      const removeByName = /* @__PURE__ */ __name((toRemove) => {
        let isRemoved = false;
        const filterCb = /* @__PURE__ */ __name((entry) => {
          const aliases2 = getAllAliases(entry.name, entry.aliases);
          if (aliases2.includes(toRemove)) {
            isRemoved = true;
            for (const alias of aliases2) {
              entriesNameSet.delete(alias);
            }
            return false;
          }
          return true;
        }, "filterCb");
        absoluteEntries = absoluteEntries.filter(filterCb);
        relativeEntries = relativeEntries.filter(filterCb);
        return isRemoved;
      }, "removeByName");
      const removeByReference = /* @__PURE__ */ __name((toRemove) => {
        let isRemoved = false;
        const filterCb = /* @__PURE__ */ __name((entry) => {
          if (entry.middleware === toRemove) {
            isRemoved = true;
            for (const alias of getAllAliases(entry.name, entry.aliases)) {
              entriesNameSet.delete(alias);
            }
            return false;
          }
          return true;
        }, "filterCb");
        absoluteEntries = absoluteEntries.filter(filterCb);
        relativeEntries = relativeEntries.filter(filterCb);
        return isRemoved;
      }, "removeByReference");
      const cloneTo = /* @__PURE__ */ __name((toStack) => {
        absoluteEntries.forEach((entry) => {
          toStack.add(entry.middleware, { ...entry });
        });
        relativeEntries.forEach((entry) => {
          toStack.addRelativeTo(entry.middleware, { ...entry });
        });
        toStack.identifyOnResolve?.(stack.identifyOnResolve());
        return toStack;
      }, "cloneTo");
      const expandRelativeMiddlewareList = /* @__PURE__ */ __name((from) => {
        const expandedMiddlewareList = [];
        from.before.forEach((entry) => {
          if (entry.before.length === 0 && entry.after.length === 0) {
            expandedMiddlewareList.push(entry);
          } else {
            expandedMiddlewareList.push(...expandRelativeMiddlewareList(entry));
          }
        });
        expandedMiddlewareList.push(from);
        from.after.reverse().forEach((entry) => {
          if (entry.before.length === 0 && entry.after.length === 0) {
            expandedMiddlewareList.push(entry);
          } else {
            expandedMiddlewareList.push(...expandRelativeMiddlewareList(entry));
          }
        });
        return expandedMiddlewareList;
      }, "expandRelativeMiddlewareList");
      const getMiddlewareList = /* @__PURE__ */ __name((debug2 = false) => {
        const normalizedAbsoluteEntries = [];
        const normalizedRelativeEntries = [];
        const normalizedEntriesNameMap = {};
        absoluteEntries.forEach((entry) => {
          const normalizedEntry = {
            ...entry,
            before: [],
            after: []
          };
          for (const alias of getAllAliases(normalizedEntry.name, normalizedEntry.aliases)) {
            normalizedEntriesNameMap[alias] = normalizedEntry;
          }
          normalizedAbsoluteEntries.push(normalizedEntry);
        });
        relativeEntries.forEach((entry) => {
          const normalizedEntry = {
            ...entry,
            before: [],
            after: []
          };
          for (const alias of getAllAliases(normalizedEntry.name, normalizedEntry.aliases)) {
            normalizedEntriesNameMap[alias] = normalizedEntry;
          }
          normalizedRelativeEntries.push(normalizedEntry);
        });
        normalizedRelativeEntries.forEach((entry) => {
          if (entry.toMiddleware) {
            const toMiddleware = normalizedEntriesNameMap[entry.toMiddleware];
            if (toMiddleware === void 0) {
              if (debug2) {
                return;
              }
              throw new Error(`${entry.toMiddleware} is not found when adding ${getMiddlewareNameWithAliases(entry.name, entry.aliases)} middleware ${entry.relation} ${entry.toMiddleware}`);
            }
            if (entry.relation === "after") {
              toMiddleware.after.push(entry);
            }
            if (entry.relation === "before") {
              toMiddleware.before.push(entry);
            }
          }
        });
        const mainChain = sort(normalizedAbsoluteEntries).map(expandRelativeMiddlewareList).reduce((wholeList, expandedMiddlewareList) => {
          wholeList.push(...expandedMiddlewareList);
          return wholeList;
        }, []);
        return mainChain;
      }, "getMiddlewareList");
      const stack = {
        add: /* @__PURE__ */ __name((middleware, options = {}) => {
          const { name: name2, override, aliases: _aliases } = options;
          const entry = {
            step: "initialize",
            priority: "normal",
            middleware,
            ...options
          };
          const aliases2 = getAllAliases(name2, _aliases);
          if (aliases2.length > 0) {
            if (aliases2.some((alias) => entriesNameSet.has(alias))) {
              if (!override)
                throw new Error(`Duplicate middleware name '${getMiddlewareNameWithAliases(name2, _aliases)}'`);
              for (const alias of aliases2) {
                const toOverrideIndex = absoluteEntries.findIndex((entry2) => entry2.name === alias || entry2.aliases?.some((a7) => a7 === alias));
                if (toOverrideIndex === -1) {
                  continue;
                }
                const toOverride = absoluteEntries[toOverrideIndex];
                if (toOverride.step !== entry.step || entry.priority !== toOverride.priority) {
                  throw new Error(`"${getMiddlewareNameWithAliases(toOverride.name, toOverride.aliases)}" middleware with ${toOverride.priority} priority in ${toOverride.step} step cannot be overridden by "${getMiddlewareNameWithAliases(name2, _aliases)}" middleware with ${entry.priority} priority in ${entry.step} step.`);
                }
                absoluteEntries.splice(toOverrideIndex, 1);
              }
            }
            for (const alias of aliases2) {
              entriesNameSet.add(alias);
            }
          }
          absoluteEntries.push(entry);
        }, "add"),
        addRelativeTo: /* @__PURE__ */ __name((middleware, options) => {
          const { name: name2, override, aliases: _aliases } = options;
          const entry = {
            middleware,
            ...options
          };
          const aliases2 = getAllAliases(name2, _aliases);
          if (aliases2.length > 0) {
            if (aliases2.some((alias) => entriesNameSet.has(alias))) {
              if (!override)
                throw new Error(`Duplicate middleware name '${getMiddlewareNameWithAliases(name2, _aliases)}'`);
              for (const alias of aliases2) {
                const toOverrideIndex = relativeEntries.findIndex((entry2) => entry2.name === alias || entry2.aliases?.some((a7) => a7 === alias));
                if (toOverrideIndex === -1) {
                  continue;
                }
                const toOverride = relativeEntries[toOverrideIndex];
                if (toOverride.toMiddleware !== entry.toMiddleware || toOverride.relation !== entry.relation) {
                  throw new Error(`"${getMiddlewareNameWithAliases(toOverride.name, toOverride.aliases)}" middleware ${toOverride.relation} "${toOverride.toMiddleware}" middleware cannot be overridden by "${getMiddlewareNameWithAliases(name2, _aliases)}" middleware ${entry.relation} "${entry.toMiddleware}" middleware.`);
                }
                relativeEntries.splice(toOverrideIndex, 1);
              }
            }
            for (const alias of aliases2) {
              entriesNameSet.add(alias);
            }
          }
          relativeEntries.push(entry);
        }, "addRelativeTo"),
        clone: /* @__PURE__ */ __name(() => cloneTo(constructStack()), "clone"),
        use: /* @__PURE__ */ __name((plugin) => {
          plugin.applyToStack(stack);
        }, "use"),
        remove: /* @__PURE__ */ __name((toRemove) => {
          if (typeof toRemove === "string")
            return removeByName(toRemove);
          else
            return removeByReference(toRemove);
        }, "remove"),
        removeByTag: /* @__PURE__ */ __name((toRemove) => {
          let isRemoved = false;
          const filterCb = /* @__PURE__ */ __name((entry) => {
            const { tags, name: name2, aliases: _aliases } = entry;
            if (tags && tags.includes(toRemove)) {
              const aliases2 = getAllAliases(name2, _aliases);
              for (const alias of aliases2) {
                entriesNameSet.delete(alias);
              }
              isRemoved = true;
              return false;
            }
            return true;
          }, "filterCb");
          absoluteEntries = absoluteEntries.filter(filterCb);
          relativeEntries = relativeEntries.filter(filterCb);
          return isRemoved;
        }, "removeByTag"),
        concat: /* @__PURE__ */ __name((from) => {
          const cloned = cloneTo(constructStack());
          cloned.use(from);
          cloned.identifyOnResolve(identifyOnResolve || cloned.identifyOnResolve() || (from.identifyOnResolve?.() ?? false));
          return cloned;
        }, "concat"),
        applyToStack: cloneTo,
        identify: /* @__PURE__ */ __name(() => {
          return getMiddlewareList(true).map((mw) => {
            const step = mw.step ?? mw.relation + " " + mw.toMiddleware;
            return getMiddlewareNameWithAliases(mw.name, mw.aliases) + " - " + step;
          });
        }, "identify"),
        identifyOnResolve(toggle) {
          if (typeof toggle === "boolean")
            identifyOnResolve = toggle;
          return identifyOnResolve;
        },
        resolve: /* @__PURE__ */ __name((handler, context2) => {
          for (const middleware of getMiddlewareList().map((entry) => entry.middleware).reverse()) {
            handler = middleware(handler, context2);
          }
          if (identifyOnResolve) {
            console.log(stack.identify());
          }
          return handler;
        }, "resolve")
      };
      return stack;
    }, "constructStack");
    stepWeights = {
      initialize: 5,
      serialize: 4,
      build: 3,
      finalizeRequest: 2,
      deserialize: 1
    };
    priorityWeights = {
      high: 3,
      normal: 2,
      low: 1
    };
  }
});

// ../../node_modules/.pnpm/@smithy+middleware-stack@3.0.11/node_modules/@smithy/middleware-stack/dist-es/index.js
var init_dist_es19 = __esm({
  "../../node_modules/.pnpm/@smithy+middleware-stack@3.0.11/node_modules/@smithy/middleware-stack/dist-es/index.js"() {
    init_import_meta_url();
    init_MiddlewareStack();
  }
});

// ../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/client.js
var Client;
var init_client9 = __esm({
  "../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/client.js"() {
    init_import_meta_url();
    init_dist_es19();
    Client = class {
      static {
        __name(this, "Client");
      }
      constructor(config) {
        this.config = config;
        this.middlewareStack = constructStack();
      }
      send(command2, optionsOrCb, cb2) {
        const options = typeof optionsOrCb !== "function" ? optionsOrCb : void 0;
        const callback = typeof optionsOrCb === "function" ? optionsOrCb : cb2;
        const useHandlerCache = options === void 0 && this.config.cacheMiddleware === true;
        let handler;
        if (useHandlerCache) {
          if (!this.handlers) {
            this.handlers = /* @__PURE__ */ new WeakMap();
          }
          const handlers2 = this.handlers;
          if (handlers2.has(command2.constructor)) {
            handler = handlers2.get(command2.constructor);
          } else {
            handler = command2.resolveMiddleware(this.middlewareStack, this.config, options);
            handlers2.set(command2.constructor, handler);
          }
        } else {
          delete this.handlers;
          handler = command2.resolveMiddleware(this.middlewareStack, this.config, options);
        }
        if (callback) {
          handler(command2).then((result) => callback(null, result.output), (err) => callback(err)).catch(() => {
          });
        } else {
          return handler(command2).then((result) => result.output);
        }
      }
      destroy() {
        this.config?.requestHandler?.destroy?.();
        delete this.handlers;
      }
    };
  }
});

// ../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/collect-stream-body.js
var init_collect_stream_body2 = __esm({
  "../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/collect-stream-body.js"() {
    init_import_meta_url();
    init_protocols();
  }
});

// ../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/command.js
var Command, ClassBuilder;
var init_command5 = __esm({
  "../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/command.js"() {
    init_import_meta_url();
    init_dist_es19();
    init_dist_es();
    Command = class {
      static {
        __name(this, "Command");
      }
      constructor() {
        this.middlewareStack = constructStack();
      }
      static classBuilder() {
        return new ClassBuilder();
      }
      resolveMiddlewareWithContext(clientStack, configuration, options, { middlewareFn, clientName, commandName, inputFilterSensitiveLog, outputFilterSensitiveLog, smithyContext, additionalContext, CommandCtor }) {
        for (const mw of middlewareFn.bind(this)(CommandCtor, clientStack, configuration, options)) {
          this.middlewareStack.use(mw);
        }
        const stack = clientStack.concat(this.middlewareStack);
        const { logger: logger4 } = configuration;
        const handlerExecutionContext = {
          logger: logger4,
          clientName,
          commandName,
          inputFilterSensitiveLog,
          outputFilterSensitiveLog,
          [SMITHY_CONTEXT_KEY]: {
            commandInstance: this,
            ...smithyContext
          },
          ...additionalContext
        };
        const { requestHandler } = configuration;
        return stack.resolve((request4) => requestHandler.handle(request4.request, options || {}), handlerExecutionContext);
      }
    };
    ClassBuilder = class {
      static {
        __name(this, "ClassBuilder");
      }
      constructor() {
        this._init = () => {
        };
        this._ep = {};
        this._middlewareFn = () => [];
        this._commandName = "";
        this._clientName = "";
        this._additionalContext = {};
        this._smithyContext = {};
        this._inputFilterSensitiveLog = (_5) => _5;
        this._outputFilterSensitiveLog = (_5) => _5;
        this._serializer = null;
        this._deserializer = null;
      }
      init(cb2) {
        this._init = cb2;
      }
      ep(endpointParameterInstructions) {
        this._ep = endpointParameterInstructions;
        return this;
      }
      m(middlewareSupplier) {
        this._middlewareFn = middlewareSupplier;
        return this;
      }
      s(service, operation, smithyContext = {}) {
        this._smithyContext = {
          service,
          operation,
          ...smithyContext
        };
        return this;
      }
      c(additionalContext = {}) {
        this._additionalContext = additionalContext;
        return this;
      }
      n(clientName, commandName) {
        this._clientName = clientName;
        this._commandName = commandName;
        return this;
      }
      f(inputFilter = (_5) => _5, outputFilter = (_5) => _5) {
        this._inputFilterSensitiveLog = inputFilter;
        this._outputFilterSensitiveLog = outputFilter;
        return this;
      }
      ser(serializer) {
        this._serializer = serializer;
        return this;
      }
      de(deserializer) {
        this._deserializer = deserializer;
        return this;
      }
      build() {
        const closure = this;
        let CommandRef;
        return CommandRef = class extends Command {
          static {
            __name(this, "CommandRef");
          }
          static getEndpointParameterInstructions() {
            return closure._ep;
          }
          constructor(...[input]) {
            super();
            this.serialize = closure._serializer;
            this.deserialize = closure._deserializer;
            this.input = input ?? {};
            closure._init(this);
          }
          resolveMiddleware(stack, configuration, options) {
            return this.resolveMiddlewareWithContext(stack, configuration, options, {
              CommandCtor: CommandRef,
              middlewareFn: closure._middlewareFn,
              clientName: closure._clientName,
              commandName: closure._commandName,
              inputFilterSensitiveLog: closure._inputFilterSensitiveLog,
              outputFilterSensitiveLog: closure._outputFilterSensitiveLog,
              smithyContext: closure._smithyContext,
              additionalContext: closure._additionalContext
            });
          }
        };
      }
    };
  }
});

// ../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/constants.js
var SENSITIVE_STRING;
var init_constants11 = __esm({
  "../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/constants.js"() {
    init_import_meta_url();
    SENSITIVE_STRING = "***SensitiveInformation***";
  }
});

// ../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/create-aggregated-client.js
var createAggregatedClient;
var init_create_aggregated_client = __esm({
  "../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/create-aggregated-client.js"() {
    init_import_meta_url();
    createAggregatedClient = /* @__PURE__ */ __name((commands5, Client2) => {
      for (const command2 of Object.keys(commands5)) {
        const CommandCtor = commands5[command2];
        const methodImpl = /* @__PURE__ */ __name(async function(args, optionsOrCb, cb2) {
          const command3 = new CommandCtor(args);
          if (typeof optionsOrCb === "function") {
            this.send(command3, optionsOrCb);
          } else if (typeof cb2 === "function") {
            if (typeof optionsOrCb !== "object")
              throw new Error(`Expected http options but got ${typeof optionsOrCb}`);
            this.send(command3, optionsOrCb || {}, cb2);
          } else {
            return this.send(command3, optionsOrCb);
          }
        }, "methodImpl");
        const methodName = (command2[0].toLowerCase() + command2.slice(1)).replace(/Command$/, "");
        Client2.prototype[methodName] = methodImpl;
      }
    }, "createAggregatedClient");
  }
});

// ../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/parse-utils.js
var parseBoolean, expectNumber, MAX_FLOAT, expectFloat32, expectLong, expectInt32, expectShort, expectByte, expectSizedInt, castInt, expectNonNull, expectObject, expectString, expectUnion, strictParseFloat32, NUMBER_REGEX, parseNumber, strictParseLong, strictParseInt32, strictParseShort, strictParseByte, stackTraceWarning, logger3;
var init_parse_utils = __esm({
  "../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/parse-utils.js"() {
    init_import_meta_url();
    parseBoolean = /* @__PURE__ */ __name((value) => {
      switch (value) {
        case "true":
          return true;
        case "false":
          return false;
        default:
          throw new Error(`Unable to parse boolean value "${value}"`);
      }
    }, "parseBoolean");
    expectNumber = /* @__PURE__ */ __name((value) => {
      if (value === null || value === void 0) {
        return void 0;
      }
      if (typeof value === "string") {
        const parsed = parseFloat(value);
        if (!Number.isNaN(parsed)) {
          if (String(parsed) !== String(value)) {
            logger3.warn(stackTraceWarning(`Expected number but observed string: ${value}`));
          }
          return parsed;
        }
      }
      if (typeof value === "number") {
        return value;
      }
      throw new TypeError(`Expected number, got ${typeof value}: ${value}`);
    }, "expectNumber");
    MAX_FLOAT = Math.ceil(2 ** 127 * (2 - 2 ** -23));
    expectFloat32 = /* @__PURE__ */ __name((value) => {
      const expected = expectNumber(value);
      if (expected !== void 0 && !Number.isNaN(expected) && expected !== Infinity && expected !== -Infinity) {
        if (Math.abs(expected) > MAX_FLOAT) {
          throw new TypeError(`Expected 32-bit float, got ${value}`);
        }
      }
      return expected;
    }, "expectFloat32");
    expectLong = /* @__PURE__ */ __name((value) => {
      if (value === null || value === void 0) {
        return void 0;
      }
      if (Number.isInteger(value) && !Number.isNaN(value)) {
        return value;
      }
      throw new TypeError(`Expected integer, got ${typeof value}: ${value}`);
    }, "expectLong");
    expectInt32 = /* @__PURE__ */ __name((value) => expectSizedInt(value, 32), "expectInt32");
    expectShort = /* @__PURE__ */ __name((value) => expectSizedInt(value, 16), "expectShort");
    expectByte = /* @__PURE__ */ __name((value) => expectSizedInt(value, 8), "expectByte");
    expectSizedInt = /* @__PURE__ */ __name((value, size) => {
      const expected = expectLong(value);
      if (expected !== void 0 && castInt(expected, size) !== expected) {
        throw new TypeError(`Expected ${size}-bit integer, got ${value}`);
      }
      return expected;
    }, "expectSizedInt");
    castInt = /* @__PURE__ */ __name((value, size) => {
      switch (size) {
        case 32:
          return Int32Array.of(value)[0];
        case 16:
          return Int16Array.of(value)[0];
        case 8:
          return Int8Array.of(value)[0];
      }
    }, "castInt");
    expectNonNull = /* @__PURE__ */ __name((value, location) => {
      if (value === null || value === void 0) {
        if (location) {
          throw new TypeError(`Expected a non-null value for ${location}`);
        }
        throw new TypeError("Expected a non-null value");
      }
      return value;
    }, "expectNonNull");
    expectObject = /* @__PURE__ */ __name((value) => {
      if (value === null || value === void 0) {
        return void 0;
      }
      if (typeof value === "object" && !Array.isArray(value)) {
        return value;
      }
      const receivedType = Array.isArray(value) ? "array" : typeof value;
      throw new TypeError(`Expected object, got ${receivedType}: ${value}`);
    }, "expectObject");
    expectString = /* @__PURE__ */ __name((value) => {
      if (value === null || value === void 0) {
        return void 0;
      }
      if (typeof value === "string") {
        return value;
      }
      if (["boolean", "number", "bigint"].includes(typeof value)) {
        logger3.warn(stackTraceWarning(`Expected string, got ${typeof value}: ${value}`));
        return String(value);
      }
      throw new TypeError(`Expected string, got ${typeof value}: ${value}`);
    }, "expectString");
    expectUnion = /* @__PURE__ */ __name((value) => {
      if (value === null || value === void 0) {
        return void 0;
      }
      const asObject = expectObject(value);
      const setKeys = Object.entries(asObject).filter(([, v8]) => v8 != null).map(([k7]) => k7);
      if (setKeys.length === 0) {
        throw new TypeError(`Unions must have exactly one non-null member. None were found.`);
      }
      if (setKeys.length > 1) {
        throw new TypeError(`Unions must have exactly one non-null member. Keys ${setKeys} were not null.`);
      }
      return asObject;
    }, "expectUnion");
    strictParseFloat32 = /* @__PURE__ */ __name((value) => {
      if (typeof value == "string") {
        return expectFloat32(parseNumber(value));
      }
      return expectFloat32(value);
    }, "strictParseFloat32");
    NUMBER_REGEX = /(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g;
    parseNumber = /* @__PURE__ */ __name((value) => {
      const matches = value.match(NUMBER_REGEX);
      if (matches === null || matches[0].length !== value.length) {
        throw new TypeError(`Expected real number, got implicit NaN`);
      }
      return parseFloat(value);
    }, "parseNumber");
    strictParseLong = /* @__PURE__ */ __name((value) => {
      if (typeof value === "string") {
        return expectLong(parseNumber(value));
      }
      return expectLong(value);
    }, "strictParseLong");
    strictParseInt32 = /* @__PURE__ */ __name((value) => {
      if (typeof value === "string") {
        return expectInt32(parseNumber(value));
      }
      return expectInt32(value);
    }, "strictParseInt32");
    strictParseShort = /* @__PURE__ */ __name((value) => {
      if (typeof value === "string") {
        return expectShort(parseNumber(value));
      }
      return expectShort(value);
    }, "strictParseShort");
    strictParseByte = /* @__PURE__ */ __name((value) => {
      if (typeof value === "string") {
        return expectByte(parseNumber(value));
      }
      return expectByte(value);
    }, "strictParseByte");
    stackTraceWarning = /* @__PURE__ */ __name((message) => {
      return String(new TypeError(message).stack || message).split("\n").slice(0, 5).filter((s7) => !s7.includes("stackTraceWarning")).join("\n");
    }, "stackTraceWarning");
    logger3 = {
      warn: console.warn
    };
  }
});

// ../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/date-utils.js
function dateToUtcString(date) {
  const year = date.getUTCFullYear();
  const month = date.getUTCMonth();
  const dayOfWeek = date.getUTCDay();
  const dayOfMonthInt = date.getUTCDate();
  const hoursInt = date.getUTCHours();
  const minutesInt = date.getUTCMinutes();
  const secondsInt = date.getUTCSeconds();
  const dayOfMonthString = dayOfMonthInt < 10 ? `0${dayOfMonthInt}` : `${dayOfMonthInt}`;
  const hoursString = hoursInt < 10 ? `0${hoursInt}` : `${hoursInt}`;
  const minutesString = minutesInt < 10 ? `0${minutesInt}` : `${minutesInt}`;
  const secondsString = secondsInt < 10 ? `0${secondsInt}` : `${secondsInt}`;
  return `${DAYS[dayOfWeek]}, ${dayOfMonthString} ${MONTHS[month]} ${year} ${hoursString}:${minutesString}:${secondsString} GMT`;
}
var DAYS, MONTHS, RFC3339, parseRfc3339DateTime, RFC3339_WITH_OFFSET, parseRfc3339DateTimeWithOffset, IMF_FIXDATE, RFC_850_DATE, ASC_TIME, parseRfc7231DateTime, buildDate, parseTwoDigitYear, FIFTY_YEARS_IN_MILLIS, adjustRfc850Year, parseMonthByShortName, DAYS_IN_MONTH, validateDayOfMonth, isLeapYear, parseDateValue, parseMilliseconds, parseOffsetToMilliseconds, stripLeadingZeroes;
var init_date_utils = __esm({
  "../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/date-utils.js"() {
    init_import_meta_url();
    init_parse_utils();
    DAYS = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
    MONTHS = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
    __name(dateToUtcString, "dateToUtcString");
    RFC3339 = new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/);
    parseRfc3339DateTime = /* @__PURE__ */ __name((value) => {
      if (value === null || value === void 0) {
        return void 0;
      }
      if (typeof value !== "string") {
        throw new TypeError("RFC-3339 date-times must be expressed as strings");
      }
      const match3 = RFC3339.exec(value);
      if (!match3) {
        throw new TypeError("Invalid RFC-3339 date-time value");
      }
      const [_5, yearStr, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds] = match3;
      const year = strictParseShort(stripLeadingZeroes(yearStr));
      const month = parseDateValue(monthStr, "month", 1, 12);
      const day = parseDateValue(dayStr, "day", 1, 31);
      return buildDate(year, month, day, { hours, minutes, seconds, fractionalMilliseconds });
    }, "parseRfc3339DateTime");
    RFC3339_WITH_OFFSET = new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/);
    parseRfc3339DateTimeWithOffset = /* @__PURE__ */ __name((value) => {
      if (value === null || value === void 0) {
        return void 0;
      }
      if (typeof value !== "string") {
        throw new TypeError("RFC-3339 date-times must be expressed as strings");
      }
      const match3 = RFC3339_WITH_OFFSET.exec(value);
      if (!match3) {
        throw new TypeError("Invalid RFC-3339 date-time value");
      }
      const [_5, yearStr, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds, offsetStr] = match3;
      const year = strictParseShort(stripLeadingZeroes(yearStr));
      const month = parseDateValue(monthStr, "month", 1, 12);
      const day = parseDateValue(dayStr, "day", 1, 31);
      const date = buildDate(year, month, day, { hours, minutes, seconds, fractionalMilliseconds });
      if (offsetStr.toUpperCase() != "Z") {
        date.setTime(date.getTime() - parseOffsetToMilliseconds(offsetStr));
      }
      return date;
    }, "parseRfc3339DateTimeWithOffset");
    IMF_FIXDATE = new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/);
    RFC_850_DATE = new RegExp(/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/);
    ASC_TIME = new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/);
    parseRfc7231DateTime = /* @__PURE__ */ __name((value) => {
      if (value === null || value === void 0) {
        return void 0;
      }
      if (typeof value !== "string") {
        throw new TypeError("RFC-7231 date-times must be expressed as strings");
      }
      let match3 = IMF_FIXDATE.exec(value);
      if (match3) {
        const [_5, dayStr, monthStr, yearStr, hours, minutes, seconds, fractionalMilliseconds] = match3;
        return buildDate(strictParseShort(stripLeadingZeroes(yearStr)), parseMonthByShortName(monthStr), parseDateValue(dayStr, "day", 1, 31), { hours, minutes, seconds, fractionalMilliseconds });
      }
      match3 = RFC_850_DATE.exec(value);
      if (match3) {
        const [_5, dayStr, monthStr, yearStr, hours, minutes, seconds, fractionalMilliseconds] = match3;
        return adjustRfc850Year(buildDate(parseTwoDigitYear(yearStr), parseMonthByShortName(monthStr), parseDateValue(dayStr, "day", 1, 31), {
          hours,
          minutes,
          seconds,
          fractionalMilliseconds
        }));
      }
      match3 = ASC_TIME.exec(value);
      if (match3) {
        const [_5, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds, yearStr] = match3;
        return buildDate(strictParseShort(stripLeadingZeroes(yearStr)), parseMonthByShortName(monthStr), parseDateValue(dayStr.trimLeft(), "day", 1, 31), { hours, minutes, seconds, fractionalMilliseconds });
      }
      throw new TypeError("Invalid RFC-7231 date-time value");
    }, "parseRfc7231DateTime");
    buildDate = /* @__PURE__ */ __name((year, month, day, time) => {
      const adjustedMonth = month - 1;
      validateDayOfMonth(year, adjustedMonth, day);
      return new Date(Date.UTC(year, adjustedMonth, day, parseDateValue(time.hours, "hour", 0, 23), parseDateValue(time.minutes, "minute", 0, 59), parseDateValue(time.seconds, "seconds", 0, 60), parseMilliseconds(time.fractionalMilliseconds)));
    }, "buildDate");
    parseTwoDigitYear = /* @__PURE__ */ __name((value) => {
      const thisYear = (/* @__PURE__ */ new Date()).getUTCFullYear();
      const valueInThisCentury = Math.floor(thisYear / 100) * 100 + strictParseShort(stripLeadingZeroes(value));
      if (valueInThisCentury < thisYear) {
        return valueInThisCentury + 100;
      }
      return valueInThisCentury;
    }, "parseTwoDigitYear");
    FIFTY_YEARS_IN_MILLIS = 50 * 365 * 24 * 60 * 60 * 1e3;
    adjustRfc850Year = /* @__PURE__ */ __name((input) => {
      if (input.getTime() - (/* @__PURE__ */ new Date()).getTime() > FIFTY_YEARS_IN_MILLIS) {
        return new Date(Date.UTC(input.getUTCFullYear() - 100, input.getUTCMonth(), input.getUTCDate(), input.getUTCHours(), input.getUTCMinutes(), input.getUTCSeconds(), input.getUTCMilliseconds()));
      }
      return input;
    }, "adjustRfc850Year");
    parseMonthByShortName = /* @__PURE__ */ __name((value) => {
      const monthIdx = MONTHS.indexOf(value);
      if (monthIdx < 0) {
        throw new TypeError(`Invalid month: ${value}`);
      }
      return monthIdx + 1;
    }, "parseMonthByShortName");
    DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
    validateDayOfMonth = /* @__PURE__ */ __name((year, month, day) => {
      let maxDays = DAYS_IN_MONTH[month];
      if (month === 1 && isLeapYear(year)) {
        maxDays = 29;
      }
      if (day > maxDays) {
        throw new TypeError(`Invalid day for ${MONTHS[month]} in ${year}: ${day}`);
      }
    }, "validateDayOfMonth");
    isLeapYear = /* @__PURE__ */ __name((year) => {
      return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
    }, "isLeapYear");
    parseDateValue = /* @__PURE__ */ __name((value, type, lower, upper) => {
      const dateVal = strictParseByte(stripLeadingZeroes(value));
      if (dateVal < lower || dateVal > upper) {
        throw new TypeError(`${type} must be between ${lower} and ${upper}, inclusive`);
      }
      return dateVal;
    }, "parseDateValue");
    parseMilliseconds = /* @__PURE__ */ __name((value) => {
      if (value === null || value === void 0) {
        return 0;
      }
      return strictParseFloat32("0." + value) * 1e3;
    }, "parseMilliseconds");
    parseOffsetToMilliseconds = /* @__PURE__ */ __name((value) => {
      const directionStr = value[0];
      let direction = 1;
      if (directionStr == "+") {
        direction = 1;
      } else if (directionStr == "-") {
        direction = -1;
      } else {
        throw new TypeError(`Offset direction, ${directionStr}, must be "+" or "-"`);
      }
      const hour = Number(value.substring(1, 3));
      const minute = Number(value.substring(4, 6));
      return direction * (hour * 60 + minute) * 60 * 1e3;
    }, "parseOffsetToMilliseconds");
    stripLeadingZeroes = /* @__PURE__ */ __name((value) => {
      let idx = 0;
      while (idx < value.length - 1 && value.charAt(idx) === "0") {
        idx++;
      }
      if (idx === 0) {
        return value;
      }
      return value.slice(idx);
    }, "stripLeadingZeroes");
  }
});

// ../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/exceptions.js
var ServiceException, decorateServiceException;
var init_exceptions = __esm({
  "../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/exceptions.js"() {
    init_import_meta_url();
    ServiceException = class _ServiceException extends Error {
      static {
        __name(this, "ServiceException");
      }
      constructor(options) {
        super(options.message);
        Object.setPrototypeOf(this, _ServiceException.prototype);
        this.name = options.name;
        this.$fault = options.$fault;
        this.$metadata = options.$metadata;
      }
      static isInstance(value) {
        if (!value)
          return false;
        const candidate = value;
        return Boolean(candidate.$fault) && Boolean(candidate.$metadata) && (candidate.$fault === "client" || candidate.$fault === "server");
      }
    };
    decorateServiceException = /* @__PURE__ */ __name((exception, additions = {}) => {
      Object.entries(additions).filter(([, v8]) => v8 !== void 0).forEach(([k7, v8]) => {
        if (exception[k7] == void 0 || exception[k7] === "") {
          exception[k7] = v8;
        }
      });
      const message = exception.message || exception.Message || "UnknownError";
      exception.message = message;
      delete exception.Message;
      return exception;
    }, "decorateServiceException");
  }
});

// ../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/default-error-handler.js
var throwDefaultError, withBaseException, deserializeMetadata;
var init_default_error_handler = __esm({
  "../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/default-error-handler.js"() {
    init_import_meta_url();
    init_exceptions();
    throwDefaultError = /* @__PURE__ */ __name(({ output, parsedBody, exceptionCtor, errorCode }) => {
      const $metadata = deserializeMetadata(output);
      const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : void 0;
      const response = new exceptionCtor({
        name: parsedBody?.code || parsedBody?.Code || errorCode || statusCode || "UnknownError",
        $fault: "client",
        $metadata
      });
      throw decorateServiceException(response, parsedBody);
    }, "throwDefaultError");
    withBaseException = /* @__PURE__ */ __name((ExceptionCtor) => {
      return ({ output, parsedBody, errorCode }) => {
        throwDefaultError({ output, parsedBody, exceptionCtor: ExceptionCtor, errorCode });
      };
    }, "withBaseException");
    deserializeMetadata = /* @__PURE__ */ __name((output) => ({
      httpStatusCode: output.statusCode,
      requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
      extendedRequestId: output.headers["x-amz-id-2"],
      cfId: output.headers["x-amz-cf-id"]
    }), "deserializeMetadata");
  }
});

// ../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/defaults-mode.js
var loadConfigsForDefaultMode;
var init_defaults_mode = __esm({
  "../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/defaults-mode.js"() {
    init_import_meta_url();
    loadConfigsForDefaultMode = /* @__PURE__ */ __name((mode) => {
      switch (mode) {
        case "standard":
          return {
            retryMode: "standard",
            connectionTimeout: 3100
          };
        case "in-region":
          return {
            retryMode: "standard",
            connectionTimeout: 1100
          };
        case "cross-region":
          return {
            retryMode: "standard",
            connectionTimeout: 3100
          };
        case "mobile":
          return {
            retryMode: "standard",
            connectionTimeout: 3e4
          };
        default:
          return {};
      }
    }, "loadConfigsForDefaultMode");
  }
});

// ../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/emitWarningIfUnsupportedVersion.js
var warningEmitted, emitWarningIfUnsupportedVersion2;
var init_emitWarningIfUnsupportedVersion2 = __esm({
  "../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/emitWarningIfUnsupportedVersion.js"() {
    init_import_meta_url();
    warningEmitted = false;
    emitWarningIfUnsupportedVersion2 = /* @__PURE__ */ __name((version5) => {
      if (version5 && !warningEmitted && parseInt(version5.substring(1, version5.indexOf("."))) < 16) {
        warningEmitted = true;
      }
    }, "emitWarningIfUnsupportedVersion");
  }
});

// ../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/extended-encode-uri-component.js
var init_extended_encode_uri_component2 = __esm({
  "../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/extended-encode-uri-component.js"() {
    init_import_meta_url();
    init_protocols();
  }
});

// ../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/extensions/checksum.js
var getChecksumConfiguration2, resolveChecksumRuntimeConfig2;
var init_checksum3 = __esm({
  "../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/extensions/checksum.js"() {
    init_import_meta_url();
    init_dist_es();
    getChecksumConfiguration2 = /* @__PURE__ */ __name((runtimeConfig) => {
      const checksumAlgorithms = [];
      for (const id in AlgorithmId) {
        const algorithmId = AlgorithmId[id];
        if (runtimeConfig[algorithmId] === void 0) {
          continue;
        }
        checksumAlgorithms.push({
          algorithmId: /* @__PURE__ */ __name(() => algorithmId, "algorithmId"),
          checksumConstructor: /* @__PURE__ */ __name(() => runtimeConfig[algorithmId], "checksumConstructor")
        });
      }
      return {
        _checksumAlgorithms: checksumAlgorithms,
        addChecksumAlgorithm(algo) {
          this._checksumAlgorithms.push(algo);
        },
        checksumAlgorithms() {
          return this._checksumAlgorithms;
        }
      };
    }, "getChecksumConfiguration");
    resolveChecksumRuntimeConfig2 = /* @__PURE__ */ __name((clientConfig) => {
      const runtimeConfig = {};
      clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => {
        runtimeConfig[checksumAlgorithm.algorithmId()] = checksumAlgorithm.checksumConstructor();
      });
      return runtimeConfig;
    }, "resolveChecksumRuntimeConfig");
  }
});

// ../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/extensions/retry.js
var getRetryConfiguration, resolveRetryRuntimeConfig;
var init_retry3 = __esm({
  "../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/extensions/retry.js"() {
    init_import_meta_url();
    getRetryConfiguration = /* @__PURE__ */ __name((runtimeConfig) => {
      let _retryStrategy = runtimeConfig.retryStrategy;
      return {
        setRetryStrategy(retryStrategy) {
          _retryStrategy = retryStrategy;
        },
        retryStrategy() {
          return _retryStrategy;
        }
      };
    }, "getRetryConfiguration");
    resolveRetryRuntimeConfig = /* @__PURE__ */ __name((retryStrategyConfiguration) => {
      const runtimeConfig = {};
      runtimeConfig.retryStrategy = retryStrategyConfiguration.retryStrategy();
      return runtimeConfig;
    }, "resolveRetryRuntimeConfig");
  }
});

// ../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/extensions/defaultExtensionConfiguration.js
var getDefaultExtensionConfiguration, resolveDefaultRuntimeConfig;
var init_defaultExtensionConfiguration2 = __esm({
  "../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/extensions/defaultExtensionConfiguration.js"() {
    init_import_meta_url();
    init_checksum3();
    init_retry3();
    getDefaultExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => {
      return {
        ...getChecksumConfiguration2(runtimeConfig),
        ...getRetryConfiguration(runtimeConfig)
      };
    }, "getDefaultExtensionConfiguration");
    resolveDefaultRuntimeConfig = /* @__PURE__ */ __name((config) => {
      return {
        ...resolveChecksumRuntimeConfig2(config),
        ...resolveRetryRuntimeConfig(config)
      };
    }, "resolveDefaultRuntimeConfig");
  }
});

// ../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/extensions/index.js
var init_extensions3 = __esm({
  "../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/extensions/index.js"() {
    init_import_meta_url();
    init_defaultExtensionConfiguration2();
  }
});

// ../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/get-array-if-single-item.js
var getArrayIfSingleItem;
var init_get_array_if_single_item = __esm({
  "../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/get-array-if-single-item.js"() {
    init_import_meta_url();
    getArrayIfSingleItem = /* @__PURE__ */ __name((mayBeArray) => Array.isArray(mayBeArray) ? mayBeArray : [mayBeArray], "getArrayIfSingleItem");
  }
});

// ../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/get-value-from-text-node.js
var getValueFromTextNode;
var init_get_value_from_text_node = __esm({
  "../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/get-value-from-text-node.js"() {
    init_import_meta_url();
    getValueFromTextNode = /* @__PURE__ */ __name((obj) => {
      const textNodeName = "#text";
      for (const key in obj) {
        if (obj.hasOwnProperty(key) && obj[key][textNodeName] !== void 0) {
          obj[key] = obj[key][textNodeName];
        } else if (typeof obj[key] === "object" && obj[key] !== null) {
          obj[key] = getValueFromTextNode(obj[key]);
        }
      }
      return obj;
    }, "getValueFromTextNode");
  }
});

// ../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/is-serializable-header-value.js
var isSerializableHeaderValue;
var init_is_serializable_header_value = __esm({
  "../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/is-serializable-header-value.js"() {
    init_import_meta_url();
    isSerializableHeaderValue = /* @__PURE__ */ __name((value) => {
      return value != null;
    }, "isSerializableHeaderValue");
  }
});

// ../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/lazy-json.js
var LazyJsonString;
var init_lazy_json = __esm({
  "../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/lazy-json.js"() {
    init_import_meta_url();
    LazyJsonString = /* @__PURE__ */ __name(function LazyJsonString2(val2) {
      const str = Object.assign(new String(val2), {
        deserializeJSON() {
          return JSON.parse(String(val2));
        },
        toString() {
          return String(val2);
        },
        toJSON() {
          return String(val2);
        }
      });
      return str;
    }, "LazyJsonString");
    LazyJsonString.from = (object) => {
      if (object && typeof object === "object" && (object instanceof LazyJsonString || "deserializeJSON" in object)) {
        return object;
      } else if (typeof object === "string" || Object.getPrototypeOf(object) === String.prototype) {
        return LazyJsonString(String(object));
      }
      return LazyJsonString(JSON.stringify(object));
    };
    LazyJsonString.fromObject = LazyJsonString.from;
  }
});

// ../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/NoOpLogger.js
var NoOpLogger;
var init_NoOpLogger = __esm({
  "../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/NoOpLogger.js"() {
    init_import_meta_url();
    NoOpLogger = class {
      static {
        __name(this, "NoOpLogger");
      }
      trace() {
      }
      debug() {
      }
      info() {
      }
      warn() {
      }
      error() {
      }
    };
  }
});

// ../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/object-mapping.js
function map(arg0, arg1, arg2) {
  let target;
  let filter2;
  let instructions;
  if (typeof arg1 === "undefined" && typeof arg2 === "undefined") {
    target = {};
    instructions = arg0;
  } else {
    target = arg0;
    if (typeof arg1 === "function") {
      filter2 = arg1;
      instructions = arg2;
      return mapWithFilter(target, filter2, instructions);
    } else {
      instructions = arg1;
    }
  }
  for (const key of Object.keys(instructions)) {
    if (!Array.isArray(instructions[key])) {
      target[key] = instructions[key];
      continue;
    }
    applyInstruction(target, null, instructions, key);
  }
  return target;
}
var take, mapWithFilter, applyInstruction, nonNullish, pass;
var init_object_mapping = __esm({
  "../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/object-mapping.js"() {
    init_import_meta_url();
    __name(map, "map");
    take = /* @__PURE__ */ __name((source, instructions) => {
      const out = {};
      for (const key in instructions) {
        applyInstruction(out, source, instructions, key);
      }
      return out;
    }, "take");
    mapWithFilter = /* @__PURE__ */ __name((target, filter2, instructions) => {
      return map(target, Object.entries(instructions).reduce((_instructions, [key, value]) => {
        if (Array.isArray(value)) {
          _instructions[key] = value;
        } else {
          if (typeof value === "function") {
            _instructions[key] = [filter2, value()];
          } else {
            _instructions[key] = [filter2, value];
          }
        }
        return _instructions;
      }, {}));
    }, "mapWithFilter");
    applyInstruction = /* @__PURE__ */ __name((target, source, instructions, targetKey) => {
      if (source !== null) {
        let instruction = instructions[targetKey];
        if (typeof instruction === "function") {
          instruction = [, instruction];
        }
        const [filter3 = nonNullish, valueFn = pass, sourceKey = targetKey] = instruction;
        if (typeof filter3 === "function" && filter3(source[sourceKey]) || typeof filter3 !== "function" && !!filter3) {
          target[targetKey] = valueFn(source[sourceKey]);
        }
        return;
      }
      let [filter2, value] = instructions[targetKey];
      if (typeof value === "function") {
        let _value;
        const defaultFilterPassed = filter2 === void 0 && (_value = value()) != null;
        const customFilterPassed = typeof filter2 === "function" && !!filter2(void 0) || typeof filter2 !== "function" && !!filter2;
        if (defaultFilterPassed) {
          target[targetKey] = _value;
        } else if (customFilterPassed) {
          target[targetKey] = value();
        }
      } else {
        const defaultFilterPassed = filter2 === void 0 && value != null;
        const customFilterPassed = typeof filter2 === "function" && !!filter2(value) || typeof filter2 !== "function" && !!filter2;
        if (defaultFilterPassed || customFilterPassed) {
          target[targetKey] = value;
        }
      }
    }, "applyInstruction");
    nonNullish = /* @__PURE__ */ __name((_5) => _5 != null, "nonNullish");
    pass = /* @__PURE__ */ __name((_5) => _5, "pass");
  }
});

// ../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/quote-header.js
function quoteHeader(part) {
  if (part.includes(",") || part.includes('"')) {
    part = `"${part.replace(/"/g, '\\"')}"`;
  }
  return part;
}
var init_quote_header = __esm({
  "../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/quote-header.js"() {
    init_import_meta_url();
    __name(quoteHeader, "quoteHeader");
  }
});

// ../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/resolve-path.js
var init_resolve_path2 = __esm({
  "../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/resolve-path.js"() {
    init_import_meta_url();
    init_protocols();
  }
});

// ../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/ser-utils.js
var serializeDateTime;
var init_ser_utils = __esm({
  "../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/ser-utils.js"() {
    init_import_meta_url();
    serializeDateTime = /* @__PURE__ */ __name((date) => date.toISOString().replace(".000Z", "Z"), "serializeDateTime");
  }
});

// ../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/serde-json.js
var _json;
var init_serde_json = __esm({
  "../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/serde-json.js"() {
    init_import_meta_url();
    _json = /* @__PURE__ */ __name((obj) => {
      if (obj == null) {
        return {};
      }
      if (Array.isArray(obj)) {
        return obj.filter((_5) => _5 != null).map(_json);
      }
      if (typeof obj === "object") {
        const target = {};
        for (const key of Object.keys(obj)) {
          if (obj[key] == null) {
            continue;
          }
          target[key] = _json(obj[key]);
        }
        return target;
      }
      return obj;
    }, "_json");
  }
});

// ../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/split-every.js
var init_split_every = __esm({
  "../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/split-every.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/split-header.js
var init_split_header = __esm({
  "../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/split-header.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/index.js
var init_dist_es20 = __esm({
  "../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/index.js"() {
    init_import_meta_url();
    init_client9();
    init_collect_stream_body2();
    init_command5();
    init_constants11();
    init_create_aggregated_client();
    init_date_utils();
    init_default_error_handler();
    init_defaults_mode();
    init_emitWarningIfUnsupportedVersion2();
    init_exceptions();
    init_extended_encode_uri_component2();
    init_extensions3();
    init_get_array_if_single_item();
    init_get_value_from_text_node();
    init_is_serializable_header_value();
    init_lazy_json();
    init_NoOpLogger();
    init_object_mapping();
    init_parse_utils();
    init_quote_header();
    init_resolve_path2();
    init_ser_utils();
    init_serde_json();
    init_split_every();
    init_split_header();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/awsExpectUnion.js
var init_awsExpectUnion = __esm({
  "../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/awsExpectUnion.js"() {
    init_import_meta_url();
    init_dist_es20();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/protocols/common.js
var collectBodyString;
var init_common2 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/protocols/common.js"() {
    init_import_meta_url();
    init_dist_es20();
    collectBodyString = /* @__PURE__ */ __name((streamBody, context2) => collectBody(streamBody, context2).then((body) => context2.utf8Encoder(body)), "collectBodyString");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/parseJsonBody.js
var parseJsonBody, parseJsonErrorBody, loadRestJsonErrorCode;
var init_parseJsonBody = __esm({
  "../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/parseJsonBody.js"() {
    init_import_meta_url();
    init_common2();
    parseJsonBody = /* @__PURE__ */ __name((streamBody, context2) => collectBodyString(streamBody, context2).then((encoded) => {
      if (encoded.length) {
        try {
          return JSON.parse(encoded);
        } catch (e10) {
          if (e10?.name === "SyntaxError") {
            Object.defineProperty(e10, "$responseBodyText", {
              value: encoded
            });
          }
          throw e10;
        }
      }
      return {};
    }), "parseJsonBody");
    parseJsonErrorBody = /* @__PURE__ */ __name(async (errorBody, context2) => {
      const value = await parseJsonBody(errorBody, context2);
      value.message = value.message ?? value.Message;
      return value;
    }, "parseJsonErrorBody");
    loadRestJsonErrorCode = /* @__PURE__ */ __name((output, data) => {
      const findKey2 = /* @__PURE__ */ __name((object, key) => Object.keys(object).find((k7) => k7.toLowerCase() === key.toLowerCase()), "findKey");
      const sanitizeErrorCode = /* @__PURE__ */ __name((rawValue) => {
        let cleanValue = rawValue;
        if (typeof cleanValue === "number") {
          cleanValue = cleanValue.toString();
        }
        if (cleanValue.indexOf(",") >= 0) {
          cleanValue = cleanValue.split(",")[0];
        }
        if (cleanValue.indexOf(":") >= 0) {
          cleanValue = cleanValue.split(":")[0];
        }
        if (cleanValue.indexOf("#") >= 0) {
          cleanValue = cleanValue.split("#")[1];
        }
        return cleanValue;
      }, "sanitizeErrorCode");
      const headerKey = findKey2(output.headers, "x-amzn-errortype");
      if (headerKey !== void 0) {
        return sanitizeErrorCode(output.headers[headerKey]);
      }
      if (data.code !== void 0) {
        return sanitizeErrorCode(data.code);
      }
      if (data["__type"] !== void 0) {
        return sanitizeErrorCode(data["__type"]);
      }
    }, "loadRestJsonErrorCode");
  }
});

// ../../node_modules/.pnpm/fast-xml-parser@4.4.1/node_modules/fast-xml-parser/src/util.js
var require_util11 = __commonJS({
  "../../node_modules/.pnpm/fast-xml-parser@4.4.1/node_modules/fast-xml-parser/src/util.js"(exports) {
    init_import_meta_url();
    var nameStartChar = ":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD";
    var nameChar = nameStartChar + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040";
    var nameRegexp = "[" + nameStartChar + "][" + nameChar + "]*";
    var regexName = new RegExp("^" + nameRegexp + "$");
    var getAllMatches = /* @__PURE__ */ __name(function(string, regex2) {
      const matches = [];
      let match3 = regex2.exec(string);
      while (match3) {
        const allmatches = [];
        allmatches.startIndex = regex2.lastIndex - match3[0].length;
        const len = match3.length;
        for (let index = 0; index < len; index++) {
          allmatches.push(match3[index]);
        }
        matches.push(allmatches);
        match3 = regex2.exec(string);
      }
      return matches;
    }, "getAllMatches");
    var isName = /* @__PURE__ */ __name(function(string) {
      const match3 = regexName.exec(string);
      return !(match3 === null || typeof match3 === "undefined");
    }, "isName");
    exports.isExist = function(v8) {
      return typeof v8 !== "undefined";
    };
    exports.isEmptyObject = function(obj) {
      return Object.keys(obj).length === 0;
    };
    exports.merge = function(target, a7, arrayMode) {
      if (a7) {
        const keys = Object.keys(a7);
        const len = keys.length;
        for (let i7 = 0; i7 < len; i7++) {
          if (arrayMode === "strict") {
            target[keys[i7]] = [a7[keys[i7]]];
          } else {
            target[keys[i7]] = a7[keys[i7]];
          }
        }
      }
    };
    exports.getValue = function(v8) {
      if (exports.isExist(v8)) {
        return v8;
      } else {
        return "";
      }
    };
    exports.isName = isName;
    exports.getAllMatches = getAllMatches;
    exports.nameRegexp = nameRegexp;
  }
});

// ../../node_modules/.pnpm/fast-xml-parser@4.4.1/node_modules/fast-xml-parser/src/validator.js
var require_validator = __commonJS({
  "../../node_modules/.pnpm/fast-xml-parser@4.4.1/node_modules/fast-xml-parser/src/validator.js"(exports) {
    init_import_meta_url();
    var util5 = require_util11();
    var defaultOptions4 = {
      allowBooleanAttributes: false,
      //A tag can have attributes without any value
      unpairedTags: []
    };
    exports.validate = function(xmlData, options) {
      options = Object.assign({}, defaultOptions4, options);
      const tags = [];
      let tagFound = false;
      let reachedRoot = false;
      if (xmlData[0] === "\uFEFF") {
        xmlData = xmlData.substr(1);
      }
      for (let i7 = 0; i7 < xmlData.length; i7++) {
        if (xmlData[i7] === "<" && xmlData[i7 + 1] === "?") {
          i7 += 2;
          i7 = readPI(xmlData, i7);
          if (i7.err) return i7;
        } else if (xmlData[i7] === "<") {
          let tagStartPos = i7;
          i7++;
          if (xmlData[i7] === "!") {
            i7 = readCommentAndCDATA(xmlData, i7);
            continue;
          } else {
            let closingTag = false;
            if (xmlData[i7] === "/") {
              closingTag = true;
              i7++;
            }
            let tagName = "";
            for (; i7 < xmlData.length && xmlData[i7] !== ">" && xmlData[i7] !== " " && xmlData[i7] !== "	" && xmlData[i7] !== "\n" && xmlData[i7] !== "\r"; i7++) {
              tagName += xmlData[i7];
            }
            tagName = tagName.trim();
            if (tagName[tagName.length - 1] === "/") {
              tagName = tagName.substring(0, tagName.length - 1);
              i7--;
            }
            if (!validateTagName(tagName)) {
              let msg;
              if (tagName.trim().length === 0) {
                msg = "Invalid space after '<'.";
              } else {
                msg = "Tag '" + tagName + "' is an invalid name.";
              }
              return getErrorObject("InvalidTag", msg, getLineNumberForPosition(xmlData, i7));
            }
            const result = readAttributeStr(xmlData, i7);
            if (result === false) {
              return getErrorObject("InvalidAttr", "Attributes for '" + tagName + "' have open quote.", getLineNumberForPosition(xmlData, i7));
            }
            let attrStr = result.value;
            i7 = result.index;
            if (attrStr[attrStr.length - 1] === "/") {
              const attrStrStart = i7 - attrStr.length;
              attrStr = attrStr.substring(0, attrStr.length - 1);
              const isValid4 = validateAttributeString(attrStr, options);
              if (isValid4 === true) {
                tagFound = true;
              } else {
                return getErrorObject(isValid4.err.code, isValid4.err.msg, getLineNumberForPosition(xmlData, attrStrStart + isValid4.err.line));
              }
            } else if (closingTag) {
              if (!result.tagClosed) {
                return getErrorObject("InvalidTag", "Closing tag '" + tagName + "' doesn't have proper closing.", getLineNumberForPosition(xmlData, i7));
              } else if (attrStr.trim().length > 0) {
                return getErrorObject("InvalidTag", "Closing tag '" + tagName + "' can't have attributes or invalid starting.", getLineNumberForPosition(xmlData, tagStartPos));
              } else if (tags.length === 0) {
                return getErrorObject("InvalidTag", "Closing tag '" + tagName + "' has not been opened.", getLineNumberForPosition(xmlData, tagStartPos));
              } else {
                const otg = tags.pop();
                if (tagName !== otg.tagName) {
                  let openPos = getLineNumberForPosition(xmlData, otg.tagStartPos);
                  return getErrorObject(
                    "InvalidTag",
                    "Expected closing tag '" + otg.tagName + "' (opened in line " + openPos.line + ", col " + openPos.col + ") instead of closing tag '" + tagName + "'.",
                    getLineNumberForPosition(xmlData, tagStartPos)
                  );
                }
                if (tags.length == 0) {
                  reachedRoot = true;
                }
              }
            } else {
              const isValid4 = validateAttributeString(attrStr, options);
              if (isValid4 !== true) {
                return getErrorObject(isValid4.err.code, isValid4.err.msg, getLineNumberForPosition(xmlData, i7 - attrStr.length + isValid4.err.line));
              }
              if (reachedRoot === true) {
                return getErrorObject("InvalidXml", "Multiple possible root nodes found.", getLineNumberForPosition(xmlData, i7));
              } else if (options.unpairedTags.indexOf(tagName) !== -1) ; else {
                tags.push({ tagName, tagStartPos });
              }
              tagFound = true;
            }
            for (i7++; i7 < xmlData.length; i7++) {
              if (xmlData[i7] === "<") {
                if (xmlData[i7 + 1] === "!") {
                  i7++;
                  i7 = readCommentAndCDATA(xmlData, i7);
                  continue;
                } else if (xmlData[i7 + 1] === "?") {
                  i7 = readPI(xmlData, ++i7);
                  if (i7.err) return i7;
                } else {
                  break;
                }
              } else if (xmlData[i7] === "&") {
                const afterAmp = validateAmpersand(xmlData, i7);
                if (afterAmp == -1)
                  return getErrorObject("InvalidChar", "char '&' is not expected.", getLineNumberForPosition(xmlData, i7));
                i7 = afterAmp;
              } else {
                if (reachedRoot === true && !isWhiteSpace3(xmlData[i7])) {
                  return getErrorObject("InvalidXml", "Extra text at the end", getLineNumberForPosition(xmlData, i7));
                }
              }
            }
            if (xmlData[i7] === "<") {
              i7--;
            }
          }
        } else {
          if (isWhiteSpace3(xmlData[i7])) {
            continue;
          }
          return getErrorObject("InvalidChar", "char '" + xmlData[i7] + "' is not expected.", getLineNumberForPosition(xmlData, i7));
        }
      }
      if (!tagFound) {
        return getErrorObject("InvalidXml", "Start tag expected.", 1);
      } else if (tags.length == 1) {
        return getErrorObject("InvalidTag", "Unclosed tag '" + tags[0].tagName + "'.", getLineNumberForPosition(xmlData, tags[0].tagStartPos));
      } else if (tags.length > 0) {
        return getErrorObject("InvalidXml", "Invalid '" + JSON.stringify(tags.map((t13) => t13.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 });
      }
      return true;
    };
    function isWhiteSpace3(char) {
      return char === " " || char === "	" || char === "\n" || char === "\r";
    }
    __name(isWhiteSpace3, "isWhiteSpace");
    function readPI(xmlData, i7) {
      const start = i7;
      for (; i7 < xmlData.length; i7++) {
        if (xmlData[i7] == "?" || xmlData[i7] == " ") {
          const tagname = xmlData.substr(start, i7 - start);
          if (i7 > 5 && tagname === "xml") {
            return getErrorObject("InvalidXml", "XML declaration allowed only at the start of the document.", getLineNumberForPosition(xmlData, i7));
          } else if (xmlData[i7] == "?" && xmlData[i7 + 1] == ">") {
            i7++;
            break;
          } else {
            continue;
          }
        }
      }
      return i7;
    }
    __name(readPI, "readPI");
    function readCommentAndCDATA(xmlData, i7) {
      if (xmlData.length > i7 + 5 && xmlData[i7 + 1] === "-" && xmlData[i7 + 2] === "-") {
        for (i7 += 3; i7 < xmlData.length; i7++) {
          if (xmlData[i7] === "-" && xmlData[i7 + 1] === "-" && xmlData[i7 + 2] === ">") {
            i7 += 2;
            break;
          }
        }
      } else if (xmlData.length > i7 + 8 && xmlData[i7 + 1] === "D" && xmlData[i7 + 2] === "O" && xmlData[i7 + 3] === "C" && xmlData[i7 + 4] === "T" && xmlData[i7 + 5] === "Y" && xmlData[i7 + 6] === "P" && xmlData[i7 + 7] === "E") {
        let angleBracketsCount = 1;
        for (i7 += 8; i7 < xmlData.length; i7++) {
          if (xmlData[i7] === "<") {
            angleBracketsCount++;
          } else if (xmlData[i7] === ">") {
            angleBracketsCount--;
            if (angleBracketsCount === 0) {
              break;
            }
          }
        }
      } else if (xmlData.length > i7 + 9 && xmlData[i7 + 1] === "[" && xmlData[i7 + 2] === "C" && xmlData[i7 + 3] === "D" && xmlData[i7 + 4] === "A" && xmlData[i7 + 5] === "T" && xmlData[i7 + 6] === "A" && xmlData[i7 + 7] === "[") {
        for (i7 += 8; i7 < xmlData.length; i7++) {
          if (xmlData[i7] === "]" && xmlData[i7 + 1] === "]" && xmlData[i7 + 2] === ">") {
            i7 += 2;
            break;
          }
        }
      }
      return i7;
    }
    __name(readCommentAndCDATA, "readCommentAndCDATA");
    var doubleQuote = '"';
    var singleQuote = "'";
    function readAttributeStr(xmlData, i7) {
      let attrStr = "";
      let startChar = "";
      let tagClosed = false;
      for (; i7 < xmlData.length; i7++) {
        if (xmlData[i7] === doubleQuote || xmlData[i7] === singleQuote) {
          if (startChar === "") {
            startChar = xmlData[i7];
          } else if (startChar !== xmlData[i7]) ; else {
            startChar = "";
          }
        } else if (xmlData[i7] === ">") {
          if (startChar === "") {
            tagClosed = true;
            break;
          }
        }
        attrStr += xmlData[i7];
      }
      if (startChar !== "") {
        return false;
      }
      return {
        value: attrStr,
        index: i7,
        tagClosed
      };
    }
    __name(readAttributeStr, "readAttributeStr");
    var validAttrStrRegxp = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g");
    function validateAttributeString(attrStr, options) {
      const matches = util5.getAllMatches(attrStr, validAttrStrRegxp);
      const attrNames = {};
      for (let i7 = 0; i7 < matches.length; i7++) {
        if (matches[i7][1].length === 0) {
          return getErrorObject("InvalidAttr", "Attribute '" + matches[i7][2] + "' has no space in starting.", getPositionFromMatch(matches[i7]));
        } else if (matches[i7][3] !== void 0 && matches[i7][4] === void 0) {
          return getErrorObject("InvalidAttr", "Attribute '" + matches[i7][2] + "' is without value.", getPositionFromMatch(matches[i7]));
        } else if (matches[i7][3] === void 0 && !options.allowBooleanAttributes) {
          return getErrorObject("InvalidAttr", "boolean attribute '" + matches[i7][2] + "' is not allowed.", getPositionFromMatch(matches[i7]));
        }
        const attrName = matches[i7][2];
        if (!validateAttrName(attrName)) {
          return getErrorObject("InvalidAttr", "Attribute '" + attrName + "' is an invalid name.", getPositionFromMatch(matches[i7]));
        }
        if (!attrNames.hasOwnProperty(attrName)) {
          attrNames[attrName] = 1;
        } else {
          return getErrorObject("InvalidAttr", "Attribute '" + attrName + "' is repeated.", getPositionFromMatch(matches[i7]));
        }
      }
      return true;
    }
    __name(validateAttributeString, "validateAttributeString");
    function validateNumberAmpersand(xmlData, i7) {
      let re2 = /\d/;
      if (xmlData[i7] === "x") {
        i7++;
        re2 = /[\da-fA-F]/;
      }
      for (; i7 < xmlData.length; i7++) {
        if (xmlData[i7] === ";")
          return i7;
        if (!xmlData[i7].match(re2))
          break;
      }
      return -1;
    }
    __name(validateNumberAmpersand, "validateNumberAmpersand");
    function validateAmpersand(xmlData, i7) {
      i7++;
      if (xmlData[i7] === ";")
        return -1;
      if (xmlData[i7] === "#") {
        i7++;
        return validateNumberAmpersand(xmlData, i7);
      }
      let count = 0;
      for (; i7 < xmlData.length; i7++, count++) {
        if (xmlData[i7].match(/\w/) && count < 20)
          continue;
        if (xmlData[i7] === ";")
          break;
        return -1;
      }
      return i7;
    }
    __name(validateAmpersand, "validateAmpersand");
    function getErrorObject(code, message, lineNumber) {
      return {
        err: {
          code,
          msg: message,
          line: lineNumber.line || lineNumber,
          col: lineNumber.col
        }
      };
    }
    __name(getErrorObject, "getErrorObject");
    function validateAttrName(attrName) {
      return util5.isName(attrName);
    }
    __name(validateAttrName, "validateAttrName");
    function validateTagName(tagname) {
      return util5.isName(tagname);
    }
    __name(validateTagName, "validateTagName");
    function getLineNumberForPosition(xmlData, index) {
      const lines = xmlData.substring(0, index).split(/\r?\n/);
      return {
        line: lines.length,
        // column number is last line's length + 1, because column numbering starts at 1:
        col: lines[lines.length - 1].length + 1
      };
    }
    __name(getLineNumberForPosition, "getLineNumberForPosition");
    function getPositionFromMatch(match3) {
      return match3.startIndex + match3[1].length;
    }
    __name(getPositionFromMatch, "getPositionFromMatch");
  }
});

// ../../node_modules/.pnpm/fast-xml-parser@4.4.1/node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js
var require_OptionsBuilder = __commonJS({
  "../../node_modules/.pnpm/fast-xml-parser@4.4.1/node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js"(exports) {
    init_import_meta_url();
    var defaultOptions4 = {
      preserveOrder: false,
      attributeNamePrefix: "@_",
      attributesGroupName: false,
      textNodeName: "#text",
      ignoreAttributes: true,
      removeNSPrefix: false,
      // remove NS from tag name or attribute name if true
      allowBooleanAttributes: false,
      //a tag can have attributes without any value
      //ignoreRootElement : false,
      parseTagValue: true,
      parseAttributeValue: false,
      trimValues: true,
      //Trim string values of tag and attributes
      cdataPropName: false,
      numberParseOptions: {
        hex: true,
        leadingZeros: true,
        eNotation: true
      },
      tagValueProcessor: /* @__PURE__ */ __name(function(tagName, val2) {
        return val2;
      }, "tagValueProcessor"),
      attributeValueProcessor: /* @__PURE__ */ __name(function(attrName, val2) {
        return val2;
      }, "attributeValueProcessor"),
      stopNodes: [],
      //nested tags will not be parsed even for errors
      alwaysCreateTextNode: false,
      isArray: /* @__PURE__ */ __name(() => false, "isArray"),
      commentPropName: false,
      unpairedTags: [],
      processEntities: true,
      htmlEntities: false,
      ignoreDeclaration: false,
      ignorePiTags: false,
      transformTagName: false,
      transformAttributeName: false,
      updateTag: /* @__PURE__ */ __name(function(tagName, jPath, attrs) {
        return tagName;
      }, "updateTag")
      // skipEmptyListItem: false
    };
    var buildOptions = /* @__PURE__ */ __name(function(options) {
      return Object.assign({}, defaultOptions4, options);
    }, "buildOptions");
    exports.buildOptions = buildOptions;
    exports.defaultOptions = defaultOptions4;
  }
});

// ../../node_modules/.pnpm/fast-xml-parser@4.4.1/node_modules/fast-xml-parser/src/xmlparser/xmlNode.js
var require_xmlNode = __commonJS({
  "../../node_modules/.pnpm/fast-xml-parser@4.4.1/node_modules/fast-xml-parser/src/xmlparser/xmlNode.js"(exports, module2) {
    init_import_meta_url();
    var XmlNode2 = class {
      static {
        __name(this, "XmlNode");
      }
      constructor(tagname) {
        this.tagname = tagname;
        this.child = [];
        this[":@"] = {};
      }
      add(key, val2) {
        if (key === "__proto__") key = "#__proto__";
        this.child.push({ [key]: val2 });
      }
      addChild(node2) {
        if (node2.tagname === "__proto__") node2.tagname = "#__proto__";
        if (node2[":@"] && Object.keys(node2[":@"]).length > 0) {
          this.child.push({ [node2.tagname]: node2.child, [":@"]: node2[":@"] });
        } else {
          this.child.push({ [node2.tagname]: node2.child });
        }
      }
    };
    module2.exports = XmlNode2;
  }
});

// ../../node_modules/.pnpm/fast-xml-parser@4.4.1/node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js
var require_DocTypeReader = __commonJS({
  "../../node_modules/.pnpm/fast-xml-parser@4.4.1/node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js"(exports, module2) {
    init_import_meta_url();
    var util5 = require_util11();
    function readDocType(xmlData, i7) {
      const entities = {};
      if (xmlData[i7 + 3] === "O" && xmlData[i7 + 4] === "C" && xmlData[i7 + 5] === "T" && xmlData[i7 + 6] === "Y" && xmlData[i7 + 7] === "P" && xmlData[i7 + 8] === "E") {
        i7 = i7 + 9;
        let angleBracketsCount = 1;
        let hasBody = false, comment = false;
        let exp = "";
        for (; i7 < xmlData.length; i7++) {
          if (xmlData[i7] === "<" && !comment) {
            if (hasBody && isEntity(xmlData, i7)) {
              i7 += 7;
              [entityName, val, i7] = readEntityExp(xmlData, i7 + 1);
              if (val.indexOf("&") === -1)
                entities[validateEntityName2(entityName)] = {
                  regx: RegExp(`&${entityName};`, "g"),
                  val
                };
            } else if (hasBody && isElement2(xmlData, i7)) i7 += 8;
            else if (hasBody && isAttlist(xmlData, i7)) i7 += 8;
            else if (hasBody && isNotation(xmlData, i7)) i7 += 9;
            else if (isComment) comment = true;
            else throw new Error("Invalid DOCTYPE");
            angleBracketsCount++;
            exp = "";
          } else if (xmlData[i7] === ">") {
            if (comment) {
              if (xmlData[i7 - 1] === "-" && xmlData[i7 - 2] === "-") {
                comment = false;
                angleBracketsCount--;
              }
            } else {
              angleBracketsCount--;
            }
            if (angleBracketsCount === 0) {
              break;
            }
          } else if (xmlData[i7] === "[") {
            hasBody = true;
          } else {
            exp += xmlData[i7];
          }
        }
        if (angleBracketsCount !== 0) {
          throw new Error(`Unclosed DOCTYPE`);
        }
      } else {
        throw new Error(`Invalid Tag instead of DOCTYPE`);
      }
      return { entities, i: i7 };
    }
    __name(readDocType, "readDocType");
    function readEntityExp(xmlData, i7) {
      let entityName2 = "";
      for (; i7 < xmlData.length && (xmlData[i7] !== "'" && xmlData[i7] !== '"'); i7++) {
        entityName2 += xmlData[i7];
      }
      entityName2 = entityName2.trim();
      if (entityName2.indexOf(" ") !== -1) throw new Error("External entites are not supported");
      const startChar = xmlData[i7++];
      let val2 = "";
      for (; i7 < xmlData.length && xmlData[i7] !== startChar; i7++) {
        val2 += xmlData[i7];
      }
      return [entityName2, val2, i7];
    }
    __name(readEntityExp, "readEntityExp");
    function isComment(xmlData, i7) {
      if (xmlData[i7 + 1] === "!" && xmlData[i7 + 2] === "-" && xmlData[i7 + 3] === "-") return true;
      return false;
    }
    __name(isComment, "isComment");
    function isEntity(xmlData, i7) {
      if (xmlData[i7 + 1] === "!" && xmlData[i7 + 2] === "E" && xmlData[i7 + 3] === "N" && xmlData[i7 + 4] === "T" && xmlData[i7 + 5] === "I" && xmlData[i7 + 6] === "T" && xmlData[i7 + 7] === "Y") return true;
      return false;
    }
    __name(isEntity, "isEntity");
    function isElement2(xmlData, i7) {
      if (xmlData[i7 + 1] === "!" && xmlData[i7 + 2] === "E" && xmlData[i7 + 3] === "L" && xmlData[i7 + 4] === "E" && xmlData[i7 + 5] === "M" && xmlData[i7 + 6] === "E" && xmlData[i7 + 7] === "N" && xmlData[i7 + 8] === "T") return true;
      return false;
    }
    __name(isElement2, "isElement");
    function isAttlist(xmlData, i7) {
      if (xmlData[i7 + 1] === "!" && xmlData[i7 + 2] === "A" && xmlData[i7 + 3] === "T" && xmlData[i7 + 4] === "T" && xmlData[i7 + 5] === "L" && xmlData[i7 + 6] === "I" && xmlData[i7 + 7] === "S" && xmlData[i7 + 8] === "T") return true;
      return false;
    }
    __name(isAttlist, "isAttlist");
    function isNotation(xmlData, i7) {
      if (xmlData[i7 + 1] === "!" && xmlData[i7 + 2] === "N" && xmlData[i7 + 3] === "O" && xmlData[i7 + 4] === "T" && xmlData[i7 + 5] === "A" && xmlData[i7 + 6] === "T" && xmlData[i7 + 7] === "I" && xmlData[i7 + 8] === "O" && xmlData[i7 + 9] === "N") return true;
      return false;
    }
    __name(isNotation, "isNotation");
    function validateEntityName2(name2) {
      if (util5.isName(name2))
        return name2;
      else
        throw new Error(`Invalid entity name ${name2}`);
    }
    __name(validateEntityName2, "validateEntityName");
    module2.exports = readDocType;
  }
});

// ../../node_modules/.pnpm/strnum@1.0.5/node_modules/strnum/strnum.js
var require_strnum = __commonJS({
  "../../node_modules/.pnpm/strnum@1.0.5/node_modules/strnum/strnum.js"(exports, module2) {
    init_import_meta_url();
    var hexRegex = /^[-+]?0x[a-fA-F0-9]+$/;
    var numRegex = /^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;
    if (!Number.parseInt && window.parseInt) {
      Number.parseInt = window.parseInt;
    }
    if (!Number.parseFloat && window.parseFloat) {
      Number.parseFloat = window.parseFloat;
    }
    var consider = {
      hex: true,
      leadingZeros: true,
      decimalPoint: ".",
      eNotation: true
      //skipLike: /regex/
    };
    function toNumber(str, options = {}) {
      options = Object.assign({}, consider, options);
      if (!str || typeof str !== "string") return str;
      let trimmedStr = str.trim();
      if (options.skipLike !== void 0 && options.skipLike.test(trimmedStr)) return str;
      else if (options.hex && hexRegex.test(trimmedStr)) {
        return Number.parseInt(trimmedStr, 16);
      } else {
        const match3 = numRegex.exec(trimmedStr);
        if (match3) {
          const sign = match3[1];
          const leadingZeros = match3[2];
          let numTrimmedByZeros = trimZeros(match3[3]);
          const eNotation = match3[4] || match3[6];
          if (!options.leadingZeros && leadingZeros.length > 0 && sign && trimmedStr[2] !== ".") return str;
          else if (!options.leadingZeros && leadingZeros.length > 0 && !sign && trimmedStr[1] !== ".") return str;
          else {
            const num = Number(trimmedStr);
            const numStr = "" + num;
            if (numStr.search(/[eE]/) !== -1) {
              if (options.eNotation) return num;
              else return str;
            } else if (eNotation) {
              if (options.eNotation) return num;
              else return str;
            } else if (trimmedStr.indexOf(".") !== -1) {
              if (numStr === "0" && numTrimmedByZeros === "") return num;
              else if (numStr === numTrimmedByZeros) return num;
              else if (sign && numStr === "-" + numTrimmedByZeros) return num;
              else return str;
            }
            if (leadingZeros) {
              if (numTrimmedByZeros === numStr) return num;
              else if (sign + numTrimmedByZeros === numStr) return num;
              else return str;
            }
            if (trimmedStr === numStr) return num;
            else if (trimmedStr === sign + numStr) return num;
            return str;
          }
        } else {
          return str;
        }
      }
    }
    __name(toNumber, "toNumber");
    function trimZeros(numStr) {
      if (numStr && numStr.indexOf(".") !== -1) {
        numStr = numStr.replace(/0+$/, "");
        if (numStr === ".") numStr = "0";
        else if (numStr[0] === ".") numStr = "0" + numStr;
        else if (numStr[numStr.length - 1] === ".") numStr = numStr.substr(0, numStr.length - 1);
        return numStr;
      }
      return numStr;
    }
    __name(trimZeros, "trimZeros");
    module2.exports = toNumber;
  }
});

// ../../node_modules/.pnpm/fast-xml-parser@4.4.1/node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js
var require_OrderedObjParser = __commonJS({
  "../../node_modules/.pnpm/fast-xml-parser@4.4.1/node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js"(exports, module2) {
    init_import_meta_url();
    var util5 = require_util11();
    var xmlNode = require_xmlNode();
    var readDocType = require_DocTypeReader();
    var toNumber = require_strnum();
    var OrderedObjParser = class {
      static {
        __name(this, "OrderedObjParser");
      }
      constructor(options) {
        this.options = options;
        this.currentNode = null;
        this.tagsNodeStack = [];
        this.docTypeEntities = {};
        this.lastEntities = {
          "apos": { regex: /&(apos|#39|#x27);/g, val: "'" },
          "gt": { regex: /&(gt|#62|#x3E);/g, val: ">" },
          "lt": { regex: /&(lt|#60|#x3C);/g, val: "<" },
          "quot": { regex: /&(quot|#34|#x22);/g, val: '"' }
        };
        this.ampEntity = { regex: /&(amp|#38|#x26);/g, val: "&" };
        this.htmlEntities = {
          "space": { regex: /&(nbsp|#160);/g, val: " " },
          // "lt" : { regex: /&(lt|#60);/g, val: "<" },
          // "gt" : { regex: /&(gt|#62);/g, val: ">" },
          // "amp" : { regex: /&(amp|#38);/g, val: "&" },
          // "quot" : { regex: /&(quot|#34);/g, val: "\"" },
          // "apos" : { regex: /&(apos|#39);/g, val: "'" },
          "cent": { regex: /&(cent|#162);/g, val: "\xA2" },
          "pound": { regex: /&(pound|#163);/g, val: "\xA3" },
          "yen": { regex: /&(yen|#165);/g, val: "\xA5" },
          "euro": { regex: /&(euro|#8364);/g, val: "\u20AC" },
          "copyright": { regex: /&(copy|#169);/g, val: "\xA9" },
          "reg": { regex: /&(reg|#174);/g, val: "\xAE" },
          "inr": { regex: /&(inr|#8377);/g, val: "\u20B9" },
          "num_dec": { regex: /&#([0-9]{1,7});/g, val: /* @__PURE__ */ __name((_5, str) => String.fromCharCode(Number.parseInt(str, 10)), "val") },
          "num_hex": { regex: /&#x([0-9a-fA-F]{1,6});/g, val: /* @__PURE__ */ __name((_5, str) => String.fromCharCode(Number.parseInt(str, 16)), "val") }
        };
        this.addExternalEntities = addExternalEntities;
        this.parseXml = parseXml;
        this.parseTextData = parseTextData;
        this.resolveNameSpace = resolveNameSpace;
        this.buildAttributesMap = buildAttributesMap;
        this.isItStopNode = isItStopNode;
        this.replaceEntitiesValue = replaceEntitiesValue;
        this.readStopNodeData = readStopNodeData;
        this.saveTextToParentTag = saveTextToParentTag;
        this.addChild = addChild;
      }
    };
    function addExternalEntities(externalEntities) {
      const entKeys = Object.keys(externalEntities);
      for (let i7 = 0; i7 < entKeys.length; i7++) {
        const ent = entKeys[i7];
        this.lastEntities[ent] = {
          regex: new RegExp("&" + ent + ";", "g"),
          val: externalEntities[ent]
        };
      }
    }
    __name(addExternalEntities, "addExternalEntities");
    function parseTextData(val2, tagName, jPath, dontTrim, hasAttributes, isLeafNode, escapeEntities) {
      if (val2 !== void 0) {
        if (this.options.trimValues && !dontTrim) {
          val2 = val2.trim();
        }
        if (val2.length > 0) {
          if (!escapeEntities) val2 = this.replaceEntitiesValue(val2);
          const newval = this.options.tagValueProcessor(tagName, val2, jPath, hasAttributes, isLeafNode);
          if (newval === null || newval === void 0) {
            return val2;
          } else if (typeof newval !== typeof val2 || newval !== val2) {
            return newval;
          } else if (this.options.trimValues) {
            return parseValue3(val2, this.options.parseTagValue, this.options.numberParseOptions);
          } else {
            const trimmedVal = val2.trim();
            if (trimmedVal === val2) {
              return parseValue3(val2, this.options.parseTagValue, this.options.numberParseOptions);
            } else {
              return val2;
            }
          }
        }
      }
    }
    __name(parseTextData, "parseTextData");
    function resolveNameSpace(tagname) {
      if (this.options.removeNSPrefix) {
        const tags = tagname.split(":");
        const prefix = tagname.charAt(0) === "/" ? "/" : "";
        if (tags[0] === "xmlns") {
          return "";
        }
        if (tags.length === 2) {
          tagname = prefix + tags[1];
        }
      }
      return tagname;
    }
    __name(resolveNameSpace, "resolveNameSpace");
    var attrsRegx = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm");
    function buildAttributesMap(attrStr, jPath, tagName) {
      if (!this.options.ignoreAttributes && typeof attrStr === "string") {
        const matches = util5.getAllMatches(attrStr, attrsRegx);
        const len = matches.length;
        const attrs = {};
        for (let i7 = 0; i7 < len; i7++) {
          const attrName = this.resolveNameSpace(matches[i7][1]);
          let oldVal = matches[i7][4];
          let aName = this.options.attributeNamePrefix + attrName;
          if (attrName.length) {
            if (this.options.transformAttributeName) {
              aName = this.options.transformAttributeName(aName);
            }
            if (aName === "__proto__") aName = "#__proto__";
            if (oldVal !== void 0) {
              if (this.options.trimValues) {
                oldVal = oldVal.trim();
              }
              oldVal = this.replaceEntitiesValue(oldVal);
              const newVal = this.options.attributeValueProcessor(attrName, oldVal, jPath);
              if (newVal === null || newVal === void 0) {
                attrs[aName] = oldVal;
              } else if (typeof newVal !== typeof oldVal || newVal !== oldVal) {
                attrs[aName] = newVal;
              } else {
                attrs[aName] = parseValue3(
                  oldVal,
                  this.options.parseAttributeValue,
                  this.options.numberParseOptions
                );
              }
            } else if (this.options.allowBooleanAttributes) {
              attrs[aName] = true;
            }
          }
        }
        if (!Object.keys(attrs).length) {
          return;
        }
        if (this.options.attributesGroupName) {
          const attrCollection = {};
          attrCollection[this.options.attributesGroupName] = attrs;
          return attrCollection;
        }
        return attrs;
      }
    }
    __name(buildAttributesMap, "buildAttributesMap");
    var parseXml = /* @__PURE__ */ __name(function(xmlData) {
      xmlData = xmlData.replace(/\r\n?/g, "\n");
      const xmlObj = new xmlNode("!xml");
      let currentNode = xmlObj;
      let textData = "";
      let jPath = "";
      for (let i7 = 0; i7 < xmlData.length; i7++) {
        const ch2 = xmlData[i7];
        if (ch2 === "<") {
          if (xmlData[i7 + 1] === "/") {
            const closeIndex = findClosingIndex(xmlData, ">", i7, "Closing Tag is not closed.");
            let tagName = xmlData.substring(i7 + 2, closeIndex).trim();
            if (this.options.removeNSPrefix) {
              const colonIndex = tagName.indexOf(":");
              if (colonIndex !== -1) {
                tagName = tagName.substr(colonIndex + 1);
              }
            }
            if (this.options.transformTagName) {
              tagName = this.options.transformTagName(tagName);
            }
            if (currentNode) {
              textData = this.saveTextToParentTag(textData, currentNode, jPath);
            }
            const lastTagName = jPath.substring(jPath.lastIndexOf(".") + 1);
            if (tagName && this.options.unpairedTags.indexOf(tagName) !== -1) {
              throw new Error(`Unpaired tag can not be used as closing tag: </${tagName}>`);
            }
            let propIndex = 0;
            if (lastTagName && this.options.unpairedTags.indexOf(lastTagName) !== -1) {
              propIndex = jPath.lastIndexOf(".", jPath.lastIndexOf(".") - 1);
              this.tagsNodeStack.pop();
            } else {
              propIndex = jPath.lastIndexOf(".");
            }
            jPath = jPath.substring(0, propIndex);
            currentNode = this.tagsNodeStack.pop();
            textData = "";
            i7 = closeIndex;
          } else if (xmlData[i7 + 1] === "?") {
            let tagData = readTagExp(xmlData, i7, false, "?>");
            if (!tagData) throw new Error("Pi Tag is not closed.");
            textData = this.saveTextToParentTag(textData, currentNode, jPath);
            if (this.options.ignoreDeclaration && tagData.tagName === "?xml" || this.options.ignorePiTags) ; else {
              const childNode = new xmlNode(tagData.tagName);
              childNode.add(this.options.textNodeName, "");
              if (tagData.tagName !== tagData.tagExp && tagData.attrExpPresent) {
                childNode[":@"] = this.buildAttributesMap(tagData.tagExp, jPath, tagData.tagName);
              }
              this.addChild(currentNode, childNode, jPath);
            }
            i7 = tagData.closeIndex + 1;
          } else if (xmlData.substr(i7 + 1, 3) === "!--") {
            const endIndex = findClosingIndex(xmlData, "-->", i7 + 4, "Comment is not closed.");
            if (this.options.commentPropName) {
              const comment = xmlData.substring(i7 + 4, endIndex - 2);
              textData = this.saveTextToParentTag(textData, currentNode, jPath);
              currentNode.add(this.options.commentPropName, [{ [this.options.textNodeName]: comment }]);
            }
            i7 = endIndex;
          } else if (xmlData.substr(i7 + 1, 2) === "!D") {
            const result = readDocType(xmlData, i7);
            this.docTypeEntities = result.entities;
            i7 = result.i;
          } else if (xmlData.substr(i7 + 1, 2) === "![") {
            const closeIndex = findClosingIndex(xmlData, "]]>", i7, "CDATA is not closed.") - 2;
            const tagExp = xmlData.substring(i7 + 9, closeIndex);
            textData = this.saveTextToParentTag(textData, currentNode, jPath);
            let val2 = this.parseTextData(tagExp, currentNode.tagname, jPath, true, false, true, true);
            if (val2 == void 0) val2 = "";
            if (this.options.cdataPropName) {
              currentNode.add(this.options.cdataPropName, [{ [this.options.textNodeName]: tagExp }]);
            } else {
              currentNode.add(this.options.textNodeName, val2);
            }
            i7 = closeIndex + 2;
          } else {
            let result = readTagExp(xmlData, i7, this.options.removeNSPrefix);
            let tagName = result.tagName;
            const rawTagName = result.rawTagName;
            let tagExp = result.tagExp;
            let attrExpPresent = result.attrExpPresent;
            let closeIndex = result.closeIndex;
            if (this.options.transformTagName) {
              tagName = this.options.transformTagName(tagName);
            }
            if (currentNode && textData) {
              if (currentNode.tagname !== "!xml") {
                textData = this.saveTextToParentTag(textData, currentNode, jPath, false);
              }
            }
            const lastTag = currentNode;
            if (lastTag && this.options.unpairedTags.indexOf(lastTag.tagname) !== -1) {
              currentNode = this.tagsNodeStack.pop();
              jPath = jPath.substring(0, jPath.lastIndexOf("."));
            }
            if (tagName !== xmlObj.tagname) {
              jPath += jPath ? "." + tagName : tagName;
            }
            if (this.isItStopNode(this.options.stopNodes, jPath, tagName)) {
              let tagContent = "";
              if (tagExp.length > 0 && tagExp.lastIndexOf("/") === tagExp.length - 1) {
                if (tagName[tagName.length - 1] === "/") {
                  tagName = tagName.substr(0, tagName.length - 1);
                  jPath = jPath.substr(0, jPath.length - 1);
                  tagExp = tagName;
                } else {
                  tagExp = tagExp.substr(0, tagExp.length - 1);
                }
                i7 = result.closeIndex;
              } else if (this.options.unpairedTags.indexOf(tagName) !== -1) {
                i7 = result.closeIndex;
              } else {
                const result2 = this.readStopNodeData(xmlData, rawTagName, closeIndex + 1);
                if (!result2) throw new Error(`Unexpected end of ${rawTagName}`);
                i7 = result2.i;
                tagContent = result2.tagContent;
              }
              const childNode = new xmlNode(tagName);
              if (tagName !== tagExp && attrExpPresent) {
                childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName);
              }
              if (tagContent) {
                tagContent = this.parseTextData(tagContent, tagName, jPath, true, attrExpPresent, true, true);
              }
              jPath = jPath.substr(0, jPath.lastIndexOf("."));
              childNode.add(this.options.textNodeName, tagContent);
              this.addChild(currentNode, childNode, jPath);
            } else {
              if (tagExp.length > 0 && tagExp.lastIndexOf("/") === tagExp.length - 1) {
                if (tagName[tagName.length - 1] === "/") {
                  tagName = tagName.substr(0, tagName.length - 1);
                  jPath = jPath.substr(0, jPath.length - 1);
                  tagExp = tagName;
                } else {
                  tagExp = tagExp.substr(0, tagExp.length - 1);
                }
                if (this.options.transformTagName) {
                  tagName = this.options.transformTagName(tagName);
                }
                const childNode = new xmlNode(tagName);
                if (tagName !== tagExp && attrExpPresent) {
                  childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName);
                }
                this.addChild(currentNode, childNode, jPath);
                jPath = jPath.substr(0, jPath.lastIndexOf("."));
              } else {
                const childNode = new xmlNode(tagName);
                this.tagsNodeStack.push(currentNode);
                if (tagName !== tagExp && attrExpPresent) {
                  childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName);
                }
                this.addChild(currentNode, childNode, jPath);
                currentNode = childNode;
              }
              textData = "";
              i7 = closeIndex;
            }
          }
        } else {
          textData += xmlData[i7];
        }
      }
      return xmlObj.child;
    }, "parseXml");
    function addChild(currentNode, childNode, jPath) {
      const result = this.options.updateTag(childNode.tagname, jPath, childNode[":@"]);
      if (result === false) ; else if (typeof result === "string") {
        childNode.tagname = result;
        currentNode.addChild(childNode);
      } else {
        currentNode.addChild(childNode);
      }
    }
    __name(addChild, "addChild");
    var replaceEntitiesValue = /* @__PURE__ */ __name(function(val2) {
      if (this.options.processEntities) {
        for (let entityName2 in this.docTypeEntities) {
          const entity = this.docTypeEntities[entityName2];
          val2 = val2.replace(entity.regx, entity.val);
        }
        for (let entityName2 in this.lastEntities) {
          const entity = this.lastEntities[entityName2];
          val2 = val2.replace(entity.regex, entity.val);
        }
        if (this.options.htmlEntities) {
          for (let entityName2 in this.htmlEntities) {
            const entity = this.htmlEntities[entityName2];
            val2 = val2.replace(entity.regex, entity.val);
          }
        }
        val2 = val2.replace(this.ampEntity.regex, this.ampEntity.val);
      }
      return val2;
    }, "replaceEntitiesValue");
    function saveTextToParentTag(textData, currentNode, jPath, isLeafNode) {
      if (textData) {
        if (isLeafNode === void 0) isLeafNode = Object.keys(currentNode.child).length === 0;
        textData = this.parseTextData(
          textData,
          currentNode.tagname,
          jPath,
          false,
          currentNode[":@"] ? Object.keys(currentNode[":@"]).length !== 0 : false,
          isLeafNode
        );
        if (textData !== void 0 && textData !== "")
          currentNode.add(this.options.textNodeName, textData);
        textData = "";
      }
      return textData;
    }
    __name(saveTextToParentTag, "saveTextToParentTag");
    function isItStopNode(stopNodes, jPath, currentTagName) {
      const allNodesExp = "*." + currentTagName;
      for (const stopNodePath in stopNodes) {
        const stopNodeExp = stopNodes[stopNodePath];
        if (allNodesExp === stopNodeExp || jPath === stopNodeExp) return true;
      }
      return false;
    }
    __name(isItStopNode, "isItStopNode");
    function tagExpWithClosingIndex(xmlData, i7, closingChar = ">") {
      let attrBoundary;
      let tagExp = "";
      for (let index = i7; index < xmlData.length; index++) {
        let ch2 = xmlData[index];
        if (attrBoundary) {
          if (ch2 === attrBoundary) attrBoundary = "";
        } else if (ch2 === '"' || ch2 === "'") {
          attrBoundary = ch2;
        } else if (ch2 === closingChar[0]) {
          if (closingChar[1]) {
            if (xmlData[index + 1] === closingChar[1]) {
              return {
                data: tagExp,
                index
              };
            }
          } else {
            return {
              data: tagExp,
              index
            };
          }
        } else if (ch2 === "	") {
          ch2 = " ";
        }
        tagExp += ch2;
      }
    }
    __name(tagExpWithClosingIndex, "tagExpWithClosingIndex");
    function findClosingIndex(xmlData, str, i7, errMsg) {
      const closingIndex = xmlData.indexOf(str, i7);
      if (closingIndex === -1) {
        throw new Error(errMsg);
      } else {
        return closingIndex + str.length - 1;
      }
    }
    __name(findClosingIndex, "findClosingIndex");
    function readTagExp(xmlData, i7, removeNSPrefix, closingChar = ">") {
      const result = tagExpWithClosingIndex(xmlData, i7 + 1, closingChar);
      if (!result) return;
      let tagExp = result.data;
      const closeIndex = result.index;
      const separatorIndex = tagExp.search(/\s/);
      let tagName = tagExp;
      let attrExpPresent = true;
      if (separatorIndex !== -1) {
        tagName = tagExp.substring(0, separatorIndex);
        tagExp = tagExp.substring(separatorIndex + 1).trimStart();
      }
      const rawTagName = tagName;
      if (removeNSPrefix) {
        const colonIndex = tagName.indexOf(":");
        if (colonIndex !== -1) {
          tagName = tagName.substr(colonIndex + 1);
          attrExpPresent = tagName !== result.data.substr(colonIndex + 1);
        }
      }
      return {
        tagName,
        tagExp,
        closeIndex,
        attrExpPresent,
        rawTagName
      };
    }
    __name(readTagExp, "readTagExp");
    function readStopNodeData(xmlData, tagName, i7) {
      const startIndex = i7;
      let openTagCount = 1;
      for (; i7 < xmlData.length; i7++) {
        if (xmlData[i7] === "<") {
          if (xmlData[i7 + 1] === "/") {
            const closeIndex = findClosingIndex(xmlData, ">", i7, `${tagName} is not closed`);
            let closeTagName = xmlData.substring(i7 + 2, closeIndex).trim();
            if (closeTagName === tagName) {
              openTagCount--;
              if (openTagCount === 0) {
                return {
                  tagContent: xmlData.substring(startIndex, i7),
                  i: closeIndex
                };
              }
            }
            i7 = closeIndex;
          } else if (xmlData[i7 + 1] === "?") {
            const closeIndex = findClosingIndex(xmlData, "?>", i7 + 1, "StopNode is not closed.");
            i7 = closeIndex;
          } else if (xmlData.substr(i7 + 1, 3) === "!--") {
            const closeIndex = findClosingIndex(xmlData, "-->", i7 + 3, "StopNode is not closed.");
            i7 = closeIndex;
          } else if (xmlData.substr(i7 + 1, 2) === "![") {
            const closeIndex = findClosingIndex(xmlData, "]]>", i7, "StopNode is not closed.") - 2;
            i7 = closeIndex;
          } else {
            const tagData = readTagExp(xmlData, i7, ">");
            if (tagData) {
              const openTagName = tagData && tagData.tagName;
              if (openTagName === tagName && tagData.tagExp[tagData.tagExp.length - 1] !== "/") {
                openTagCount++;
              }
              i7 = tagData.closeIndex;
            }
          }
        }
      }
    }
    __name(readStopNodeData, "readStopNodeData");
    function parseValue3(val2, shouldParse, options) {
      if (shouldParse && typeof val2 === "string") {
        const newval = val2.trim();
        if (newval === "true") return true;
        else if (newval === "false") return false;
        else return toNumber(val2, options);
      } else {
        if (util5.isExist(val2)) {
          return val2;
        } else {
          return "";
        }
      }
    }
    __name(parseValue3, "parseValue");
    module2.exports = OrderedObjParser;
  }
});

// ../../node_modules/.pnpm/fast-xml-parser@4.4.1/node_modules/fast-xml-parser/src/xmlparser/node2json.js
var require_node2json = __commonJS({
  "../../node_modules/.pnpm/fast-xml-parser@4.4.1/node_modules/fast-xml-parser/src/xmlparser/node2json.js"(exports) {
    init_import_meta_url();
    function prettify(node2, options) {
      return compress(node2, options);
    }
    __name(prettify, "prettify");
    function compress(arr, options, jPath) {
      let text;
      const compressedObj = {};
      for (let i7 = 0; i7 < arr.length; i7++) {
        const tagObj = arr[i7];
        const property = propName(tagObj);
        let newJpath = "";
        if (jPath === void 0) newJpath = property;
        else newJpath = jPath + "." + property;
        if (property === options.textNodeName) {
          if (text === void 0) text = tagObj[property];
          else text += "" + tagObj[property];
        } else if (property === void 0) {
          continue;
        } else if (tagObj[property]) {
          let val2 = compress(tagObj[property], options, newJpath);
          const isLeaf = isLeafTag(val2, options);
          if (tagObj[":@"]) {
            assignAttributes(val2, tagObj[":@"], newJpath, options);
          } else if (Object.keys(val2).length === 1 && val2[options.textNodeName] !== void 0 && !options.alwaysCreateTextNode) {
            val2 = val2[options.textNodeName];
          } else if (Object.keys(val2).length === 0) {
            if (options.alwaysCreateTextNode) val2[options.textNodeName] = "";
            else val2 = "";
          }
          if (compressedObj[property] !== void 0 && compressedObj.hasOwnProperty(property)) {
            if (!Array.isArray(compressedObj[property])) {
              compressedObj[property] = [compressedObj[property]];
            }
            compressedObj[property].push(val2);
          } else {
            if (options.isArray(property, newJpath, isLeaf)) {
              compressedObj[property] = [val2];
            } else {
              compressedObj[property] = val2;
            }
          }
        }
      }
      if (typeof text === "string") {
        if (text.length > 0) compressedObj[options.textNodeName] = text;
      } else if (text !== void 0) compressedObj[options.textNodeName] = text;
      return compressedObj;
    }
    __name(compress, "compress");
    function propName(obj) {
      const keys = Object.keys(obj);
      for (let i7 = 0; i7 < keys.length; i7++) {
        const key = keys[i7];
        if (key !== ":@") return key;
      }
    }
    __name(propName, "propName");
    function assignAttributes(obj, attrMap, jpath, options) {
      if (attrMap) {
        const keys = Object.keys(attrMap);
        const len = keys.length;
        for (let i7 = 0; i7 < len; i7++) {
          const atrrName = keys[i7];
          if (options.isArray(atrrName, jpath + "." + atrrName, true, true)) {
            obj[atrrName] = [attrMap[atrrName]];
          } else {
            obj[atrrName] = attrMap[atrrName];
          }
        }
      }
    }
    __name(assignAttributes, "assignAttributes");
    function isLeafTag(obj, options) {
      const { textNodeName } = options;
      const propCount = Object.keys(obj).length;
      if (propCount === 0) {
        return true;
      }
      if (propCount === 1 && (obj[textNodeName] || typeof obj[textNodeName] === "boolean" || obj[textNodeName] === 0)) {
        return true;
      }
      return false;
    }
    __name(isLeafTag, "isLeafTag");
    exports.prettify = prettify;
  }
});

// ../../node_modules/.pnpm/fast-xml-parser@4.4.1/node_modules/fast-xml-parser/src/xmlparser/XMLParser.js
var require_XMLParser = __commonJS({
  "../../node_modules/.pnpm/fast-xml-parser@4.4.1/node_modules/fast-xml-parser/src/xmlparser/XMLParser.js"(exports, module2) {
    init_import_meta_url();
    var { buildOptions } = require_OptionsBuilder();
    var OrderedObjParser = require_OrderedObjParser();
    var { prettify } = require_node2json();
    var validator = require_validator();
    var XMLParser2 = class {
      static {
        __name(this, "XMLParser");
      }
      constructor(options) {
        this.externalEntities = {};
        this.options = buildOptions(options);
      }
      /**
       * Parse XML dats to JS object 
       * @param {string|Buffer} xmlData 
       * @param {boolean|Object} validationOption 
       */
      parse(xmlData, validationOption) {
        if (typeof xmlData === "string") ; else if (xmlData.toString) {
          xmlData = xmlData.toString();
        } else {
          throw new Error("XML data is accepted in String or Bytes[] form.");
        }
        if (validationOption) {
          if (validationOption === true) validationOption = {};
          const result = validator.validate(xmlData, validationOption);
          if (result !== true) {
            throw Error(`${result.err.msg}:${result.err.line}:${result.err.col}`);
          }
        }
        const orderedObjParser = new OrderedObjParser(this.options);
        orderedObjParser.addExternalEntities(this.externalEntities);
        const orderedResult = orderedObjParser.parseXml(xmlData);
        if (this.options.preserveOrder || orderedResult === void 0) return orderedResult;
        else return prettify(orderedResult, this.options);
      }
      /**
       * Add Entity which is not by default supported by this library
       * @param {string} key 
       * @param {string} value 
       */
      addEntity(key, value) {
        if (value.indexOf("&") !== -1) {
          throw new Error("Entity value can't have '&'");
        } else if (key.indexOf("&") !== -1 || key.indexOf(";") !== -1) {
          throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");
        } else if (value === "&") {
          throw new Error("An entity with value '&' is not permitted");
        } else {
          this.externalEntities[key] = value;
        }
      }
    };
    module2.exports = XMLParser2;
  }
});

// ../../node_modules/.pnpm/fast-xml-parser@4.4.1/node_modules/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js
var require_orderedJs2Xml = __commonJS({
  "../../node_modules/.pnpm/fast-xml-parser@4.4.1/node_modules/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js"(exports, module2) {
    init_import_meta_url();
    var EOL = "\n";
    function toXml(jArray, options) {
      let indentation = "";
      if (options.format && options.indentBy.length > 0) {
        indentation = EOL;
      }
      return arrToStr(jArray, options, "", indentation);
    }
    __name(toXml, "toXml");
    function arrToStr(arr, options, jPath, indentation) {
      let xmlStr = "";
      let isPreviousElementTag = false;
      for (let i7 = 0; i7 < arr.length; i7++) {
        const tagObj = arr[i7];
        const tagName = propName(tagObj);
        if (tagName === void 0) continue;
        let newJPath = "";
        if (jPath.length === 0) newJPath = tagName;
        else newJPath = `${jPath}.${tagName}`;
        if (tagName === options.textNodeName) {
          let tagText = tagObj[tagName];
          if (!isStopNode(newJPath, options)) {
            tagText = options.tagValueProcessor(tagName, tagText);
            tagText = replaceEntitiesValue(tagText, options);
          }
          if (isPreviousElementTag) {
            xmlStr += indentation;
          }
          xmlStr += tagText;
          isPreviousElementTag = false;
          continue;
        } else if (tagName === options.cdataPropName) {
          if (isPreviousElementTag) {
            xmlStr += indentation;
          }
          xmlStr += `<![CDATA[${tagObj[tagName][0][options.textNodeName]}]]>`;
          isPreviousElementTag = false;
          continue;
        } else if (tagName === options.commentPropName) {
          xmlStr += indentation + `<!--${tagObj[tagName][0][options.textNodeName]}-->`;
          isPreviousElementTag = true;
          continue;
        } else if (tagName[0] === "?") {
          const attStr2 = attr_to_str(tagObj[":@"], options);
          const tempInd = tagName === "?xml" ? "" : indentation;
          let piTextNodeName = tagObj[tagName][0][options.textNodeName];
          piTextNodeName = piTextNodeName.length !== 0 ? " " + piTextNodeName : "";
          xmlStr += tempInd + `<${tagName}${piTextNodeName}${attStr2}?>`;
          isPreviousElementTag = true;
          continue;
        }
        let newIdentation = indentation;
        if (newIdentation !== "") {
          newIdentation += options.indentBy;
        }
        const attStr = attr_to_str(tagObj[":@"], options);
        const tagStart = indentation + `<${tagName}${attStr}`;
        const tagValue = arrToStr(tagObj[tagName], options, newJPath, newIdentation);
        if (options.unpairedTags.indexOf(tagName) !== -1) {
          if (options.suppressUnpairedNode) xmlStr += tagStart + ">";
          else xmlStr += tagStart + "/>";
        } else if ((!tagValue || tagValue.length === 0) && options.suppressEmptyNode) {
          xmlStr += tagStart + "/>";
        } else if (tagValue && tagValue.endsWith(">")) {
          xmlStr += tagStart + `>${tagValue}${indentation}</${tagName}>`;
        } else {
          xmlStr += tagStart + ">";
          if (tagValue && indentation !== "" && (tagValue.includes("/>") || tagValue.includes("</"))) {
            xmlStr += indentation + options.indentBy + tagValue + indentation;
          } else {
            xmlStr += tagValue;
          }
          xmlStr += `</${tagName}>`;
        }
        isPreviousElementTag = true;
      }
      return xmlStr;
    }
    __name(arrToStr, "arrToStr");
    function propName(obj) {
      const keys = Object.keys(obj);
      for (let i7 = 0; i7 < keys.length; i7++) {
        const key = keys[i7];
        if (!obj.hasOwnProperty(key)) continue;
        if (key !== ":@") return key;
      }
    }
    __name(propName, "propName");
    function attr_to_str(attrMap, options) {
      let attrStr = "";
      if (attrMap && !options.ignoreAttributes) {
        for (let attr in attrMap) {
          if (!attrMap.hasOwnProperty(attr)) continue;
          let attrVal = options.attributeValueProcessor(attr, attrMap[attr]);
          attrVal = replaceEntitiesValue(attrVal, options);
          if (attrVal === true && options.suppressBooleanAttributes) {
            attrStr += ` ${attr.substr(options.attributeNamePrefix.length)}`;
          } else {
            attrStr += ` ${attr.substr(options.attributeNamePrefix.length)}="${attrVal}"`;
          }
        }
      }
      return attrStr;
    }
    __name(attr_to_str, "attr_to_str");
    function isStopNode(jPath, options) {
      jPath = jPath.substr(0, jPath.length - options.textNodeName.length - 1);
      let tagName = jPath.substr(jPath.lastIndexOf(".") + 1);
      for (let index in options.stopNodes) {
        if (options.stopNodes[index] === jPath || options.stopNodes[index] === "*." + tagName) return true;
      }
      return false;
    }
    __name(isStopNode, "isStopNode");
    function replaceEntitiesValue(textValue, options) {
      if (textValue && textValue.length > 0 && options.processEntities) {
        for (let i7 = 0; i7 < options.entities.length; i7++) {
          const entity = options.entities[i7];
          textValue = textValue.replace(entity.regex, entity.val);
        }
      }
      return textValue;
    }
    __name(replaceEntitiesValue, "replaceEntitiesValue");
    module2.exports = toXml;
  }
});

// ../../node_modules/.pnpm/fast-xml-parser@4.4.1/node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js
var require_json2xml = __commonJS({
  "../../node_modules/.pnpm/fast-xml-parser@4.4.1/node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js"(exports, module2) {
    init_import_meta_url();
    var buildFromOrderedJs = require_orderedJs2Xml();
    var defaultOptions4 = {
      attributeNamePrefix: "@_",
      attributesGroupName: false,
      textNodeName: "#text",
      ignoreAttributes: true,
      cdataPropName: false,
      format: false,
      indentBy: "  ",
      suppressEmptyNode: false,
      suppressUnpairedNode: true,
      suppressBooleanAttributes: true,
      tagValueProcessor: /* @__PURE__ */ __name(function(key, a7) {
        return a7;
      }, "tagValueProcessor"),
      attributeValueProcessor: /* @__PURE__ */ __name(function(attrName, a7) {
        return a7;
      }, "attributeValueProcessor"),
      preserveOrder: false,
      commentPropName: false,
      unpairedTags: [],
      entities: [
        { regex: new RegExp("&", "g"), val: "&amp;" },
        //it must be on top
        { regex: new RegExp(">", "g"), val: "&gt;" },
        { regex: new RegExp("<", "g"), val: "&lt;" },
        { regex: new RegExp("'", "g"), val: "&apos;" },
        { regex: new RegExp('"', "g"), val: "&quot;" }
      ],
      processEntities: true,
      stopNodes: [],
      // transformTagName: false,
      // transformAttributeName: false,
      oneListGroup: false
    };
    function Builder(options) {
      this.options = Object.assign({}, defaultOptions4, options);
      if (this.options.ignoreAttributes || this.options.attributesGroupName) {
        this.isAttribute = function() {
          return false;
        };
      } else {
        this.attrPrefixLen = this.options.attributeNamePrefix.length;
        this.isAttribute = isAttribute;
      }
      this.processTextOrObjNode = processTextOrObjNode;
      if (this.options.format) {
        this.indentate = indentate;
        this.tagEndChar = ">\n";
        this.newLine = "\n";
      } else {
        this.indentate = function() {
          return "";
        };
        this.tagEndChar = ">";
        this.newLine = "";
      }
    }
    __name(Builder, "Builder");
    Builder.prototype.build = function(jObj) {
      if (this.options.preserveOrder) {
        return buildFromOrderedJs(jObj, this.options);
      } else {
        if (Array.isArray(jObj) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1) {
          jObj = {
            [this.options.arrayNodeName]: jObj
          };
        }
        return this.j2x(jObj, 0).val;
      }
    };
    Builder.prototype.j2x = function(jObj, level) {
      let attrStr = "";
      let val2 = "";
      for (let key in jObj) {
        if (!Object.prototype.hasOwnProperty.call(jObj, key)) continue;
        if (typeof jObj[key] === "undefined") {
          if (this.isAttribute(key)) {
            val2 += "";
          }
        } else if (jObj[key] === null) {
          if (this.isAttribute(key)) {
            val2 += "";
          } else if (key[0] === "?") {
            val2 += this.indentate(level) + "<" + key + "?" + this.tagEndChar;
          } else {
            val2 += this.indentate(level) + "<" + key + "/" + this.tagEndChar;
          }
        } else if (jObj[key] instanceof Date) {
          val2 += this.buildTextValNode(jObj[key], key, "", level);
        } else if (typeof jObj[key] !== "object") {
          const attr = this.isAttribute(key);
          if (attr) {
            attrStr += this.buildAttrPairStr(attr, "" + jObj[key]);
          } else {
            if (key === this.options.textNodeName) {
              let newval = this.options.tagValueProcessor(key, "" + jObj[key]);
              val2 += this.replaceEntitiesValue(newval);
            } else {
              val2 += this.buildTextValNode(jObj[key], key, "", level);
            }
          }
        } else if (Array.isArray(jObj[key])) {
          const arrLen = jObj[key].length;
          let listTagVal = "";
          let listTagAttr = "";
          for (let j7 = 0; j7 < arrLen; j7++) {
            const item = jObj[key][j7];
            if (typeof item === "undefined") ; else if (item === null) {
              if (key[0] === "?") val2 += this.indentate(level) + "<" + key + "?" + this.tagEndChar;
              else val2 += this.indentate(level) + "<" + key + "/" + this.tagEndChar;
            } else if (typeof item === "object") {
              if (this.options.oneListGroup) {
                const result = this.j2x(item, level + 1);
                listTagVal += result.val;
                if (this.options.attributesGroupName && item.hasOwnProperty(this.options.attributesGroupName)) {
                  listTagAttr += result.attrStr;
                }
              } else {
                listTagVal += this.processTextOrObjNode(item, key, level);
              }
            } else {
              if (this.options.oneListGroup) {
                let textValue = this.options.tagValueProcessor(key, item);
                textValue = this.replaceEntitiesValue(textValue);
                listTagVal += textValue;
              } else {
                listTagVal += this.buildTextValNode(item, key, "", level);
              }
            }
          }
          if (this.options.oneListGroup) {
            listTagVal = this.buildObjectNode(listTagVal, key, listTagAttr, level);
          }
          val2 += listTagVal;
        } else {
          if (this.options.attributesGroupName && key === this.options.attributesGroupName) {
            const Ks = Object.keys(jObj[key]);
            const L4 = Ks.length;
            for (let j7 = 0; j7 < L4; j7++) {
              attrStr += this.buildAttrPairStr(Ks[j7], "" + jObj[key][Ks[j7]]);
            }
          } else {
            val2 += this.processTextOrObjNode(jObj[key], key, level);
          }
        }
      }
      return { attrStr, val: val2 };
    };
    Builder.prototype.buildAttrPairStr = function(attrName, val2) {
      val2 = this.options.attributeValueProcessor(attrName, "" + val2);
      val2 = this.replaceEntitiesValue(val2);
      if (this.options.suppressBooleanAttributes && val2 === "true") {
        return " " + attrName;
      } else return " " + attrName + '="' + val2 + '"';
    };
    function processTextOrObjNode(object, key, level) {
      const result = this.j2x(object, level + 1);
      if (object[this.options.textNodeName] !== void 0 && Object.keys(object).length === 1) {
        return this.buildTextValNode(object[this.options.textNodeName], key, result.attrStr, level);
      } else {
        return this.buildObjectNode(result.val, key, result.attrStr, level);
      }
    }
    __name(processTextOrObjNode, "processTextOrObjNode");
    Builder.prototype.buildObjectNode = function(val2, key, attrStr, level) {
      if (val2 === "") {
        if (key[0] === "?") return this.indentate(level) + "<" + key + attrStr + "?" + this.tagEndChar;
        else {
          return this.indentate(level) + "<" + key + attrStr + this.closeTag(key) + this.tagEndChar;
        }
      } else {
        let tagEndExp = "</" + key + this.tagEndChar;
        let piClosingChar = "";
        if (key[0] === "?") {
          piClosingChar = "?";
          tagEndExp = "";
        }
        if ((attrStr || attrStr === "") && val2.indexOf("<") === -1) {
          return this.indentate(level) + "<" + key + attrStr + piClosingChar + ">" + val2 + tagEndExp;
        } else if (this.options.commentPropName !== false && key === this.options.commentPropName && piClosingChar.length === 0) {
          return this.indentate(level) + `<!--${val2}-->` + this.newLine;
        } else {
          return this.indentate(level) + "<" + key + attrStr + piClosingChar + this.tagEndChar + val2 + this.indentate(level) + tagEndExp;
        }
      }
    };
    Builder.prototype.closeTag = function(key) {
      let closeTag = "";
      if (this.options.unpairedTags.indexOf(key) !== -1) {
        if (!this.options.suppressUnpairedNode) closeTag = "/";
      } else if (this.options.suppressEmptyNode) {
        closeTag = "/";
      } else {
        closeTag = `></${key}`;
      }
      return closeTag;
    };
    Builder.prototype.buildTextValNode = function(val2, key, attrStr, level) {
      if (this.options.cdataPropName !== false && key === this.options.cdataPropName) {
        return this.indentate(level) + `<![CDATA[${val2}]]>` + this.newLine;
      } else if (this.options.commentPropName !== false && key === this.options.commentPropName) {
        return this.indentate(level) + `<!--${val2}-->` + this.newLine;
      } else if (key[0] === "?") {
        return this.indentate(level) + "<" + key + attrStr + "?" + this.tagEndChar;
      } else {
        let textValue = this.options.tagValueProcessor(key, val2);
        textValue = this.replaceEntitiesValue(textValue);
        if (textValue === "") {
          return this.indentate(level) + "<" + key + attrStr + this.closeTag(key) + this.tagEndChar;
        } else {
          return this.indentate(level) + "<" + key + attrStr + ">" + textValue + "</" + key + this.tagEndChar;
        }
      }
    };
    Builder.prototype.replaceEntitiesValue = function(textValue) {
      if (textValue && textValue.length > 0 && this.options.processEntities) {
        for (let i7 = 0; i7 < this.options.entities.length; i7++) {
          const entity = this.options.entities[i7];
          textValue = textValue.replace(entity.regex, entity.val);
        }
      }
      return textValue;
    };
    function indentate(level) {
      return this.options.indentBy.repeat(level);
    }
    __name(indentate, "indentate");
    function isAttribute(name2) {
      if (name2.startsWith(this.options.attributeNamePrefix) && name2 !== this.options.textNodeName) {
        return name2.substr(this.attrPrefixLen);
      } else {
        return false;
      }
    }
    __name(isAttribute, "isAttribute");
    module2.exports = Builder;
  }
});

// ../../node_modules/.pnpm/fast-xml-parser@4.4.1/node_modules/fast-xml-parser/src/fxp.js
var require_fxp = __commonJS({
  "../../node_modules/.pnpm/fast-xml-parser@4.4.1/node_modules/fast-xml-parser/src/fxp.js"(exports, module2) {
    init_import_meta_url();
    var validator = require_validator();
    var XMLParser2 = require_XMLParser();
    var XMLBuilder = require_json2xml();
    module2.exports = {
      XMLParser: XMLParser2,
      XMLValidator: validator,
      XMLBuilder
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/parseXmlBody.js
var import_fast_xml_parser, parseXmlBody, parseXmlErrorBody, loadRestXmlErrorCode;
var init_parseXmlBody = __esm({
  "../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/parseXmlBody.js"() {
    init_import_meta_url();
    init_dist_es20();
    import_fast_xml_parser = __toESM(require_fxp());
    init_common2();
    parseXmlBody = /* @__PURE__ */ __name((streamBody, context2) => collectBodyString(streamBody, context2).then((encoded) => {
      if (encoded.length) {
        const parser2 = new import_fast_xml_parser.XMLParser({
          attributeNamePrefix: "",
          htmlEntities: true,
          ignoreAttributes: false,
          ignoreDeclaration: true,
          parseTagValue: false,
          trimValues: false,
          tagValueProcessor: /* @__PURE__ */ __name((_5, val2) => val2.trim() === "" && val2.includes("\n") ? "" : void 0, "tagValueProcessor")
        });
        parser2.addEntity("#xD", "\r");
        parser2.addEntity("#10", "\n");
        let parsedObj;
        try {
          parsedObj = parser2.parse(encoded, true);
        } catch (e10) {
          if (e10 && typeof e10 === "object") {
            Object.defineProperty(e10, "$responseBodyText", {
              value: encoded
            });
          }
          throw e10;
        }
        const textNodeName = "#text";
        const key = Object.keys(parsedObj)[0];
        const parsedObjToReturn = parsedObj[key];
        if (parsedObjToReturn[textNodeName]) {
          parsedObjToReturn[key] = parsedObjToReturn[textNodeName];
          delete parsedObjToReturn[textNodeName];
        }
        return getValueFromTextNode(parsedObjToReturn);
      }
      return {};
    }), "parseXmlBody");
    parseXmlErrorBody = /* @__PURE__ */ __name(async (errorBody, context2) => {
      const value = await parseXmlBody(errorBody, context2);
      if (value.Error) {
        value.Error.message = value.Error.message ?? value.Error.Message;
      }
      return value;
    }, "parseXmlErrorBody");
    loadRestXmlErrorCode = /* @__PURE__ */ __name((output, data) => {
      if (data?.Error?.Code !== void 0) {
        return data.Error.Code;
      }
      if (data?.Code !== void 0) {
        return data.Code;
      }
      if (output.statusCode == 404) {
        return "NotFound";
      }
    }, "loadRestXmlErrorCode");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/protocols/index.js
var init_protocols2 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/protocols/index.js"() {
    init_import_meta_url();
    init_coercing_serializers();
    init_awsExpectUnion();
    init_parseJsonBody();
    init_parseXmlBody();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/index.js
var init_dist_es21 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/index.js"() {
    init_import_meta_url();
    init_client8();
    init_httpAuthSchemes2();
    init_protocols2();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+middleware-flexible-checksums@3.717.0/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/types.js
var CLIENT_SUPPORTED_ALGORITHMS, PRIORITY_ORDER_ALGORITHMS;
var init_types7 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+middleware-flexible-checksums@3.717.0/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/types.js"() {
    init_import_meta_url();
    init_constants8();
    CLIENT_SUPPORTED_ALGORITHMS = [
      ChecksumAlgorithm.CRC32,
      ChecksumAlgorithm.CRC32C,
      ChecksumAlgorithm.SHA1,
      ChecksumAlgorithm.SHA256
    ];
    PRIORITY_ORDER_ALGORITHMS = [
      ChecksumAlgorithm.SHA256,
      ChecksumAlgorithm.SHA1,
      ChecksumAlgorithm.CRC32,
      ChecksumAlgorithm.CRC32C
    ];
  }
});

// ../../node_modules/.pnpm/@aws-sdk+middleware-flexible-checksums@3.717.0/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/getChecksumAlgorithmForRequest.js
var getChecksumAlgorithmForRequest;
var init_getChecksumAlgorithmForRequest = __esm({
  "../../node_modules/.pnpm/@aws-sdk+middleware-flexible-checksums@3.717.0/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/getChecksumAlgorithmForRequest.js"() {
    init_import_meta_url();
    init_constants8();
    init_types7();
    getChecksumAlgorithmForRequest = /* @__PURE__ */ __name((input, { requestChecksumRequired, requestAlgorithmMember }, isS3Express) => {
      const defaultAlgorithm = isS3Express ? S3_EXPRESS_DEFAULT_CHECKSUM_ALGORITHM : DEFAULT_CHECKSUM_ALGORITHM;
      if (!requestAlgorithmMember || !input[requestAlgorithmMember]) {
        return requestChecksumRequired ? defaultAlgorithm : void 0;
      }
      const checksumAlgorithm = input[requestAlgorithmMember];
      if (!CLIENT_SUPPORTED_ALGORITHMS.includes(checksumAlgorithm)) {
        throw new Error(`The checksum algorithm "${checksumAlgorithm}" is not supported by the client. Select one of ${CLIENT_SUPPORTED_ALGORITHMS}.`);
      }
      return checksumAlgorithm;
    }, "getChecksumAlgorithmForRequest");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+middleware-flexible-checksums@3.717.0/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/getChecksumLocationName.js
var getChecksumLocationName;
var init_getChecksumLocationName = __esm({
  "../../node_modules/.pnpm/@aws-sdk+middleware-flexible-checksums@3.717.0/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/getChecksumLocationName.js"() {
    init_import_meta_url();
    init_constants8();
    getChecksumLocationName = /* @__PURE__ */ __name((algorithm) => algorithm === ChecksumAlgorithm.MD5 ? "content-md5" : `x-amz-checksum-${algorithm.toLowerCase()}`, "getChecksumLocationName");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+middleware-flexible-checksums@3.717.0/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/hasHeader.js
var hasHeader2;
var init_hasHeader = __esm({
  "../../node_modules/.pnpm/@aws-sdk+middleware-flexible-checksums@3.717.0/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/hasHeader.js"() {
    init_import_meta_url();
    hasHeader2 = /* @__PURE__ */ __name((header, headers) => {
      const soughtHeader = header.toLowerCase();
      for (const headerName of Object.keys(headers)) {
        if (soughtHeader === headerName.toLowerCase()) {
          return true;
        }
      }
      return false;
    }, "hasHeader");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+middleware-flexible-checksums@3.717.0/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/hasHeaderWithPrefix.js
var hasHeaderWithPrefix;
var init_hasHeaderWithPrefix = __esm({
  "../../node_modules/.pnpm/@aws-sdk+middleware-flexible-checksums@3.717.0/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/hasHeaderWithPrefix.js"() {
    init_import_meta_url();
    hasHeaderWithPrefix = /* @__PURE__ */ __name((headerPrefix, headers) => {
      const soughtHeaderPrefix = headerPrefix.toLowerCase();
      for (const headerName of Object.keys(headers)) {
        if (headerName.toLowerCase().startsWith(soughtHeaderPrefix)) {
          return true;
        }
      }
      return false;
    }, "hasHeaderWithPrefix");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+middleware-flexible-checksums@3.717.0/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/isStreaming.js
var isStreaming;
var init_isStreaming = __esm({
  "../../node_modules/.pnpm/@aws-sdk+middleware-flexible-checksums@3.717.0/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/isStreaming.js"() {
    init_import_meta_url();
    init_dist_es6();
    isStreaming = /* @__PURE__ */ __name((body) => body !== void 0 && typeof body !== "string" && !ArrayBuffer.isView(body) && !isArrayBuffer(body), "isStreaming");
  }
});

// ../../node_modules/.pnpm/@smithy+is-array-buffer@2.2.0/node_modules/@smithy/is-array-buffer/dist-es/index.js
var init_dist_es22 = __esm({
  "../../node_modules/.pnpm/@smithy+is-array-buffer@2.2.0/node_modules/@smithy/is-array-buffer/dist-es/index.js"() {
    init_import_meta_url();
  }
});
var fromString2;
var init_dist_es23 = __esm({
  "../../node_modules/.pnpm/@smithy+util-buffer-from@2.2.0/node_modules/@smithy/util-buffer-from/dist-es/index.js"() {
    init_import_meta_url();
    init_dist_es22();
    fromString2 = /* @__PURE__ */ __name((input, encoding) => {
      if (typeof input !== "string") {
        throw new TypeError(`The "input" argument must be of type string. Received type ${typeof input} (${input})`);
      }
      return encoding ? buffer.Buffer.from(input, encoding) : buffer.Buffer.from(input);
    }, "fromString");
  }
});

// ../../node_modules/.pnpm/@smithy+util-utf8@2.3.0/node_modules/@smithy/util-utf8/dist-es/fromUtf8.js
var fromUtf82;
var init_fromUtf82 = __esm({
  "../../node_modules/.pnpm/@smithy+util-utf8@2.3.0/node_modules/@smithy/util-utf8/dist-es/fromUtf8.js"() {
    init_import_meta_url();
    init_dist_es23();
    fromUtf82 = /* @__PURE__ */ __name((input) => {
      const buf = fromString2(input, "utf8");
      return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength / Uint8Array.BYTES_PER_ELEMENT);
    }, "fromUtf8");
  }
});

// ../../node_modules/.pnpm/@smithy+util-utf8@2.3.0/node_modules/@smithy/util-utf8/dist-es/toUint8Array.js
var init_toUint8Array2 = __esm({
  "../../node_modules/.pnpm/@smithy+util-utf8@2.3.0/node_modules/@smithy/util-utf8/dist-es/toUint8Array.js"() {
    init_import_meta_url();
    init_fromUtf82();
  }
});

// ../../node_modules/.pnpm/@smithy+util-utf8@2.3.0/node_modules/@smithy/util-utf8/dist-es/toUtf8.js
var init_toUtf82 = __esm({
  "../../node_modules/.pnpm/@smithy+util-utf8@2.3.0/node_modules/@smithy/util-utf8/dist-es/toUtf8.js"() {
    init_import_meta_url();
    init_dist_es23();
  }
});

// ../../node_modules/.pnpm/@smithy+util-utf8@2.3.0/node_modules/@smithy/util-utf8/dist-es/index.js
var init_dist_es24 = __esm({
  "../../node_modules/.pnpm/@smithy+util-utf8@2.3.0/node_modules/@smithy/util-utf8/dist-es/index.js"() {
    init_import_meta_url();
    init_fromUtf82();
    init_toUint8Array2();
    init_toUtf82();
  }
});

// ../../node_modules/.pnpm/@aws-crypto+util@5.2.0/node_modules/@aws-crypto/util/build/module/convertToBuffer.js
function convertToBuffer(data) {
  if (data instanceof Uint8Array)
    return data;
  if (typeof data === "string") {
    return fromUtf83(data);
  }
  if (ArrayBuffer.isView(data)) {
    return new Uint8Array(data.buffer, data.byteOffset, data.byteLength / Uint8Array.BYTES_PER_ELEMENT);
  }
  return new Uint8Array(data);
}
var fromUtf83;
var init_convertToBuffer = __esm({
  "../../node_modules/.pnpm/@aws-crypto+util@5.2.0/node_modules/@aws-crypto/util/build/module/convertToBuffer.js"() {
    init_import_meta_url();
    init_dist_es24();
    fromUtf83 = typeof Buffer !== "undefined" && Buffer.from ? function(input) {
      return Buffer.from(input, "utf8");
    } : fromUtf82;
    __name(convertToBuffer, "convertToBuffer");
  }
});

// ../../node_modules/.pnpm/@aws-crypto+util@5.2.0/node_modules/@aws-crypto/util/build/module/isEmptyData.js
function isEmptyData(data) {
  if (typeof data === "string") {
    return data.length === 0;
  }
  return data.byteLength === 0;
}
var init_isEmptyData = __esm({
  "../../node_modules/.pnpm/@aws-crypto+util@5.2.0/node_modules/@aws-crypto/util/build/module/isEmptyData.js"() {
    init_import_meta_url();
    __name(isEmptyData, "isEmptyData");
  }
});

// ../../node_modules/.pnpm/@aws-crypto+util@5.2.0/node_modules/@aws-crypto/util/build/module/numToUint8.js
function numToUint8(num) {
  return new Uint8Array([
    (num & 4278190080) >> 24,
    (num & 16711680) >> 16,
    (num & 65280) >> 8,
    num & 255
  ]);
}
var init_numToUint8 = __esm({
  "../../node_modules/.pnpm/@aws-crypto+util@5.2.0/node_modules/@aws-crypto/util/build/module/numToUint8.js"() {
    init_import_meta_url();
    __name(numToUint8, "numToUint8");
  }
});

// ../../node_modules/.pnpm/@aws-crypto+util@5.2.0/node_modules/@aws-crypto/util/build/module/uint32ArrayFrom.js
function uint32ArrayFrom(a_lookUpTable2) {
  if (!Uint32Array.from) {
    var return_array = new Uint32Array(a_lookUpTable2.length);
    var a_index = 0;
    while (a_index < a_lookUpTable2.length) {
      return_array[a_index] = a_lookUpTable2[a_index];
      a_index += 1;
    }
    return return_array;
  }
  return Uint32Array.from(a_lookUpTable2);
}
var init_uint32ArrayFrom = __esm({
  "../../node_modules/.pnpm/@aws-crypto+util@5.2.0/node_modules/@aws-crypto/util/build/module/uint32ArrayFrom.js"() {
    init_import_meta_url();
    __name(uint32ArrayFrom, "uint32ArrayFrom");
  }
});

// ../../node_modules/.pnpm/@aws-crypto+util@5.2.0/node_modules/@aws-crypto/util/build/module/index.js
var init_module2 = __esm({
  "../../node_modules/.pnpm/@aws-crypto+util@5.2.0/node_modules/@aws-crypto/util/build/module/index.js"() {
    init_import_meta_url();
    init_convertToBuffer();
    init_isEmptyData();
    init_numToUint8();
    init_uint32ArrayFrom();
  }
});

// ../../node_modules/.pnpm/@aws-crypto+crc32c@5.2.0/node_modules/@aws-crypto/crc32c/build/module/aws_crc32c.js
var AwsCrc32c;
var init_aws_crc32c = __esm({
  "../../node_modules/.pnpm/@aws-crypto+crc32c@5.2.0/node_modules/@aws-crypto/crc32c/build/module/aws_crc32c.js"() {
    init_import_meta_url();
    init_tslib_es6();
    init_module2();
    init_module3();
    AwsCrc32c = /** @class */
    function() {
      function AwsCrc32c2() {
        this.crc32c = new Crc32c();
      }
      __name(AwsCrc32c2, "AwsCrc32c");
      AwsCrc32c2.prototype.update = function(toHash) {
        if (isEmptyData(toHash))
          return;
        this.crc32c.update(convertToBuffer(toHash));
      };
      AwsCrc32c2.prototype.digest = function() {
        return __awaiter(this, void 0, void 0, function() {
          return __generator(this, function(_a5) {
            return [2, numToUint8(this.crc32c.digest())];
          });
        });
      };
      AwsCrc32c2.prototype.reset = function() {
        this.crc32c = new Crc32c();
      };
      return AwsCrc32c2;
    }();
  }
});

// ../../node_modules/.pnpm/@aws-crypto+crc32c@5.2.0/node_modules/@aws-crypto/crc32c/build/module/index.js
var Crc32c, a_lookupTable, lookupTable;
var init_module3 = __esm({
  "../../node_modules/.pnpm/@aws-crypto+crc32c@5.2.0/node_modules/@aws-crypto/crc32c/build/module/index.js"() {
    init_import_meta_url();
    init_tslib_es6();
    init_module2();
    init_aws_crc32c();
    Crc32c = /** @class */
    function() {
      function Crc32c2() {
        this.checksum = 4294967295;
      }
      __name(Crc32c2, "Crc32c");
      Crc32c2.prototype.update = function(data) {
        var e_1, _a5;
        try {
          for (var data_1 = __values(data), data_1_1 = data_1.next(); !data_1_1.done; data_1_1 = data_1.next()) {
            var byte = data_1_1.value;
            this.checksum = this.checksum >>> 8 ^ lookupTable[(this.checksum ^ byte) & 255];
          }
        } catch (e_1_1) {
          e_1 = { error: e_1_1 };
        } finally {
          try {
            if (data_1_1 && !data_1_1.done && (_a5 = data_1.return)) _a5.call(data_1);
          } finally {
            if (e_1) throw e_1.error;
          }
        }
        return this;
      };
      Crc32c2.prototype.digest = function() {
        return (this.checksum ^ 4294967295) >>> 0;
      };
      return Crc32c2;
    }();
    a_lookupTable = [
      0,
      4067132163,
      3778769143,
      324072436,
      3348797215,
      904991772,
      648144872,
      3570033899,
      2329499855,
      2024987596,
      1809983544,
      2575936315,
      1296289744,
      3207089363,
      2893594407,
      1578318884,
      274646895,
      3795141740,
      4049975192,
      51262619,
      3619967088,
      632279923,
      922689671,
      3298075524,
      2592579488,
      1760304291,
      2075979607,
      2312596564,
      1562183871,
      2943781820,
      3156637768,
      1313733451,
      549293790,
      3537243613,
      3246849577,
      871202090,
      3878099393,
      357341890,
      102525238,
      4101499445,
      2858735121,
      1477399826,
      1264559846,
      3107202533,
      1845379342,
      2677391885,
      2361733625,
      2125378298,
      820201905,
      3263744690,
      3520608582,
      598981189,
      4151959214,
      85089709,
      373468761,
      3827903834,
      3124367742,
      1213305469,
      1526817161,
      2842354314,
      2107672161,
      2412447074,
      2627466902,
      1861252501,
      1098587580,
      3004210879,
      2688576843,
      1378610760,
      2262928035,
      1955203488,
      1742404180,
      2511436119,
      3416409459,
      969524848,
      714683780,
      3639785095,
      205050476,
      4266873199,
      3976438427,
      526918040,
      1361435347,
      2739821008,
      2954799652,
      1114974503,
      2529119692,
      1691668175,
      2005155131,
      2247081528,
      3690758684,
      697762079,
      986182379,
      3366744552,
      476452099,
      3993867776,
      4250756596,
      255256311,
      1640403810,
      2477592673,
      2164122517,
      1922457750,
      2791048317,
      1412925310,
      1197962378,
      3037525897,
      3944729517,
      427051182,
      170179418,
      4165941337,
      746937522,
      3740196785,
      3451792453,
      1070968646,
      1905808397,
      2213795598,
      2426610938,
      1657317369,
      3053634322,
      1147748369,
      1463399397,
      2773627110,
      4215344322,
      153784257,
      444234805,
      3893493558,
      1021025245,
      3467647198,
      3722505002,
      797665321,
      2197175160,
      1889384571,
      1674398607,
      2443626636,
      1164749927,
      3070701412,
      2757221520,
      1446797203,
      137323447,
      4198817972,
      3910406976,
      461344835,
      3484808360,
      1037989803,
      781091935,
      3705997148,
      2460548119,
      1623424788,
      1939049696,
      2180517859,
      1429367560,
      2807687179,
      3020495871,
      1180866812,
      410100952,
      3927582683,
      4182430767,
      186734380,
      3756733383,
      763408580,
      1053836080,
      3434856499,
      2722870694,
      1344288421,
      1131464017,
      2971354706,
      1708204729,
      2545590714,
      2229949006,
      1988219213,
      680717673,
      3673779818,
      3383336350,
      1002577565,
      4010310262,
      493091189,
      238226049,
      4233660802,
      2987750089,
      1082061258,
      1395524158,
      2705686845,
      1972364758,
      2279892693,
      2494862625,
      1725896226,
      952904198,
      3399985413,
      3656866545,
      731699698,
      4283874585,
      222117402,
      510512622,
      3959836397,
      3280807620,
      837199303,
      582374963,
      3504198960,
      68661723,
      4135334616,
      3844915500,
      390545967,
      1230274059,
      3141532936,
      2825850620,
      1510247935,
      2395924756,
      2091215383,
      1878366691,
      2644384480,
      3553878443,
      565732008,
      854102364,
      3229815391,
      340358836,
      3861050807,
      4117890627,
      119113024,
      1493875044,
      2875275879,
      3090270611,
      1247431312,
      2660249211,
      1828433272,
      2141937292,
      2378227087,
      3811616794,
      291187481,
      34330861,
      4032846830,
      615137029,
      3603020806,
      3314634738,
      939183345,
      1776939221,
      2609017814,
      2295496738,
      2058945313,
      2926798794,
      1545135305,
      1330124605,
      3173225534,
      4084100981,
      17165430,
      307568514,
      3762199681,
      888469610,
      3332340585,
      3587147933,
      665062302,
      2042050490,
      2346497209,
      2559330125,
      1793573966,
      3190661285,
      1279665062,
      1595330642,
      2910671697
    ];
    lookupTable = uint32ArrayFrom(a_lookupTable);
  }
});

// ../../node_modules/.pnpm/@aws-crypto+crc32@5.2.0/node_modules/@aws-crypto/crc32/build/module/aws_crc32.js
var AwsCrc32;
var init_aws_crc32 = __esm({
  "../../node_modules/.pnpm/@aws-crypto+crc32@5.2.0/node_modules/@aws-crypto/crc32/build/module/aws_crc32.js"() {
    init_import_meta_url();
    init_tslib_es6();
    init_module2();
    init_module4();
    AwsCrc32 = /** @class */
    function() {
      function AwsCrc322() {
        this.crc32 = new Crc32();
      }
      __name(AwsCrc322, "AwsCrc32");
      AwsCrc322.prototype.update = function(toHash) {
        if (isEmptyData(toHash))
          return;
        this.crc32.update(convertToBuffer(toHash));
      };
      AwsCrc322.prototype.digest = function() {
        return __awaiter(this, void 0, void 0, function() {
          return __generator(this, function(_a5) {
            return [2, numToUint8(this.crc32.digest())];
          });
        });
      };
      AwsCrc322.prototype.reset = function() {
        this.crc32 = new Crc32();
      };
      return AwsCrc322;
    }();
  }
});

// ../../node_modules/.pnpm/@aws-crypto+crc32@5.2.0/node_modules/@aws-crypto/crc32/build/module/index.js
var Crc32, a_lookUpTable, lookupTable2;
var init_module4 = __esm({
  "../../node_modules/.pnpm/@aws-crypto+crc32@5.2.0/node_modules/@aws-crypto/crc32/build/module/index.js"() {
    init_import_meta_url();
    init_tslib_es6();
    init_module2();
    init_aws_crc32();
    Crc32 = /** @class */
    function() {
      function Crc322() {
        this.checksum = 4294967295;
      }
      __name(Crc322, "Crc32");
      Crc322.prototype.update = function(data) {
        var e_1, _a5;
        try {
          for (var data_1 = __values(data), data_1_1 = data_1.next(); !data_1_1.done; data_1_1 = data_1.next()) {
            var byte = data_1_1.value;
            this.checksum = this.checksum >>> 8 ^ lookupTable2[(this.checksum ^ byte) & 255];
          }
        } catch (e_1_1) {
          e_1 = { error: e_1_1 };
        } finally {
          try {
            if (data_1_1 && !data_1_1.done && (_a5 = data_1.return)) _a5.call(data_1);
          } finally {
            if (e_1) throw e_1.error;
          }
        }
        return this;
      };
      Crc322.prototype.digest = function() {
        return (this.checksum ^ 4294967295) >>> 0;
      };
      return Crc322;
    }();
    a_lookUpTable = [
      0,
      1996959894,
      3993919788,
      2567524794,
      124634137,
      1886057615,
      3915621685,
      2657392035,
      249268274,
      2044508324,
      3772115230,
      2547177864,
      162941995,
      2125561021,
      3887607047,
      2428444049,
      498536548,
      1789927666,
      4089016648,
      2227061214,
      450548861,
      1843258603,
      4107580753,
      2211677639,
      325883990,
      1684777152,
      4251122042,
      2321926636,
      335633487,
      1661365465,
      4195302755,
      2366115317,
      997073096,
      1281953886,
      3579855332,
      2724688242,
      1006888145,
      1258607687,
      3524101629,
      2768942443,
      901097722,
      1119000684,
      3686517206,
      2898065728,
      853044451,
      1172266101,
      3705015759,
      2882616665,
      651767980,
      1373503546,
      3369554304,
      3218104598,
      565507253,
      1454621731,
      3485111705,
      3099436303,
      671266974,
      1594198024,
      3322730930,
      2970347812,
      795835527,
      1483230225,
      3244367275,
      3060149565,
      1994146192,
      31158534,
      2563907772,
      4023717930,
      1907459465,
      112637215,
      2680153253,
      3904427059,
      2013776290,
      251722036,
      2517215374,
      3775830040,
      2137656763,
      141376813,
      2439277719,
      3865271297,
      1802195444,
      476864866,
      2238001368,
      4066508878,
      1812370925,
      453092731,
      2181625025,
      4111451223,
      1706088902,
      314042704,
      2344532202,
      4240017532,
      1658658271,
      366619977,
      2362670323,
      4224994405,
      1303535960,
      984961486,
      2747007092,
      3569037538,
      1256170817,
      1037604311,
      2765210733,
      3554079995,
      1131014506,
      879679996,
      2909243462,
      3663771856,
      1141124467,
      855842277,
      2852801631,
      3708648649,
      1342533948,
      654459306,
      3188396048,
      3373015174,
      1466479909,
      544179635,
      3110523913,
      3462522015,
      1591671054,
      702138776,
      2966460450,
      3352799412,
      1504918807,
      783551873,
      3082640443,
      3233442989,
      3988292384,
      2596254646,
      62317068,
      1957810842,
      3939845945,
      2647816111,
      81470997,
      1943803523,
      3814918930,
      2489596804,
      225274430,
      2053790376,
      3826175755,
      2466906013,
      167816743,
      2097651377,
      4027552580,
      2265490386,
      503444072,
      1762050814,
      4150417245,
      2154129355,
      426522225,
      1852507879,
      4275313526,
      2312317920,
      282753626,
      1742555852,
      4189708143,
      2394877945,
      397917763,
      1622183637,
      3604390888,
      2714866558,
      953729732,
      1340076626,
      3518719985,
      2797360999,
      1068828381,
      1219638859,
      3624741850,
      2936675148,
      906185462,
      1090812512,
      3747672003,
      2825379669,
      829329135,
      1181335161,
      3412177804,
      3160834842,
      628085408,
      1382605366,
      3423369109,
      3138078467,
      570562233,
      1426400815,
      3317316542,
      2998733608,
      733239954,
      1555261956,
      3268935591,
      3050360625,
      752459403,
      1541320221,
      2607071920,
      3965973030,
      1969922972,
      40735498,
      2617837225,
      3943577151,
      1913087877,
      83908371,
      2512341634,
      3803740692,
      2075208622,
      213261112,
      2463272603,
      3855990285,
      2094854071,
      198958881,
      2262029012,
      4057260610,
      1759359992,
      534414190,
      2176718541,
      4139329115,
      1873836001,
      414664567,
      2282248934,
      4279200368,
      1711684554,
      285281116,
      2405801727,
      4167216745,
      1634467795,
      376229701,
      2685067896,
      3608007406,
      1308918612,
      956543938,
      2808555105,
      3495958263,
      1231636301,
      1047427035,
      2932959818,
      3654703836,
      1088359270,
      936918e3,
      2847714899,
      3736837829,
      1202900863,
      817233897,
      3183342108,
      3401237130,
      1404277552,
      615818150,
      3134207493,
      3453421203,
      1423857449,
      601450431,
      3009837614,
      3294710456,
      1567103746,
      711928724,
      3020668471,
      3272380065,
      1510334235,
      755167117
    ];
    lookupTable2 = uint32ArrayFrom(a_lookUpTable);
  }
});
var NodeCrc32, getCrc32ChecksumAlgorithmFunction;
var init_getCrc32ChecksumAlgorithmFunction = __esm({
  "../../node_modules/.pnpm/@aws-sdk+middleware-flexible-checksums@3.717.0/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/getCrc32ChecksumAlgorithmFunction.js"() {
    init_import_meta_url();
    init_module4();
    init_module2();
    NodeCrc32 = class {
      static {
        __name(this, "NodeCrc32");
      }
      constructor() {
        this.checksum = 0;
      }
      update(data) {
        this.checksum = zlib__namespace.crc32(data, this.checksum);
      }
      async digest() {
        return numToUint8(this.checksum);
      }
      reset() {
        this.checksum = 0;
      }
    };
    getCrc32ChecksumAlgorithmFunction = /* @__PURE__ */ __name(() => {
      if (typeof zlib__namespace.crc32 === "undefined") {
        return AwsCrc32;
      }
      return NodeCrc32;
    }, "getCrc32ChecksumAlgorithmFunction");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+middleware-flexible-checksums@3.717.0/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/selectChecksumAlgorithmFunction.js
var selectChecksumAlgorithmFunction;
var init_selectChecksumAlgorithmFunction = __esm({
  "../../node_modules/.pnpm/@aws-sdk+middleware-flexible-checksums@3.717.0/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/selectChecksumAlgorithmFunction.js"() {
    init_import_meta_url();
    init_module3();
    init_constants8();
    init_getCrc32ChecksumAlgorithmFunction();
    selectChecksumAlgorithmFunction = /* @__PURE__ */ __name((checksumAlgorithm, config) => {
      switch (checksumAlgorithm) {
        case ChecksumAlgorithm.MD5:
          return config.md5;
        case ChecksumAlgorithm.CRC32:
          return getCrc32ChecksumAlgorithmFunction();
        case ChecksumAlgorithm.CRC32C:
          return AwsCrc32c;
        case ChecksumAlgorithm.SHA1:
          return config.sha1;
        case ChecksumAlgorithm.SHA256:
          return config.sha256;
        default:
          throw new Error(`Unsupported checksum algorithm: ${checksumAlgorithm}`);
      }
    }, "selectChecksumAlgorithmFunction");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+middleware-flexible-checksums@3.717.0/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/stringHasher.js
var stringHasher;
var init_stringHasher = __esm({
  "../../node_modules/.pnpm/@aws-sdk+middleware-flexible-checksums@3.717.0/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/stringHasher.js"() {
    init_import_meta_url();
    init_dist_es8();
    stringHasher = /* @__PURE__ */ __name((checksumAlgorithmFn, body) => {
      const hash = new checksumAlgorithmFn();
      hash.update(toUint8Array(body || ""));
      return hash.digest();
    }, "stringHasher");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+middleware-flexible-checksums@3.717.0/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/flexibleChecksumsMiddleware.js
var flexibleChecksumsMiddlewareOptions, flexibleChecksumsMiddleware;
var init_flexibleChecksumsMiddleware = __esm({
  "../../node_modules/.pnpm/@aws-sdk+middleware-flexible-checksums@3.717.0/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/flexibleChecksumsMiddleware.js"() {
    init_import_meta_url();
    init_dist_es21();
    init_dist_es2();
    init_constants8();
    init_getChecksumAlgorithmForRequest();
    init_getChecksumLocationName();
    init_hasHeader();
    init_hasHeaderWithPrefix();
    init_isStreaming();
    init_selectChecksumAlgorithmFunction();
    init_stringHasher();
    flexibleChecksumsMiddlewareOptions = {
      name: "flexibleChecksumsMiddleware",
      step: "build",
      tags: ["BODY_CHECKSUM"],
      override: true
    };
    flexibleChecksumsMiddleware = /* @__PURE__ */ __name((config, middlewareConfig) => (next, context2) => async (args) => {
      if (!HttpRequest.isInstance(args.request)) {
        return next(args);
      }
      if (hasHeaderWithPrefix("x-amz-checksum-", args.request.headers)) {
        return next(args);
      }
      const { request: request4, input } = args;
      const { body: requestBody, headers } = request4;
      const { base64Encoder, streamHasher } = config;
      const { requestChecksumRequired, requestAlgorithmMember } = middlewareConfig;
      const checksumAlgorithm = getChecksumAlgorithmForRequest(input, {
        requestChecksumRequired,
        requestAlgorithmMember: requestAlgorithmMember?.name
      }, !!context2.isS3ExpressBucket);
      let updatedBody = requestBody;
      let updatedHeaders = headers;
      if (checksumAlgorithm) {
        switch (checksumAlgorithm) {
          case ChecksumAlgorithm.CRC32:
            setFeature(context2, "FLEXIBLE_CHECKSUMS_REQ_CRC32", "U");
            break;
          case ChecksumAlgorithm.CRC32C:
            setFeature(context2, "FLEXIBLE_CHECKSUMS_REQ_CRC32C", "V");
            break;
          case ChecksumAlgorithm.SHA1:
            setFeature(context2, "FLEXIBLE_CHECKSUMS_REQ_SHA1", "X");
            break;
          case ChecksumAlgorithm.SHA256:
            setFeature(context2, "FLEXIBLE_CHECKSUMS_REQ_SHA256", "Y");
            break;
        }
        const checksumLocationName = getChecksumLocationName(checksumAlgorithm);
        const checksumAlgorithmFn = selectChecksumAlgorithmFunction(checksumAlgorithm, config);
        if (isStreaming(requestBody)) {
          const { getAwsChunkedEncodingStream: getAwsChunkedEncodingStream2, bodyLengthChecker } = config;
          updatedBody = getAwsChunkedEncodingStream2(requestBody, {
            base64Encoder,
            bodyLengthChecker,
            checksumLocationName,
            checksumAlgorithmFn,
            streamHasher
          });
          updatedHeaders = {
            ...headers,
            "content-encoding": headers["content-encoding"] ? `${headers["content-encoding"]},aws-chunked` : "aws-chunked",
            "transfer-encoding": "chunked",
            "x-amz-decoded-content-length": headers["content-length"],
            "x-amz-content-sha256": "STREAMING-UNSIGNED-PAYLOAD-TRAILER",
            "x-amz-trailer": checksumLocationName
          };
          delete updatedHeaders["content-length"];
        } else if (!hasHeader2(checksumLocationName, headers)) {
          const rawChecksum = await stringHasher(checksumAlgorithmFn, requestBody);
          updatedHeaders = {
            ...headers,
            [checksumLocationName]: base64Encoder(rawChecksum)
          };
        }
      }
      const result = await next({
        ...args,
        request: {
          ...request4,
          headers: updatedHeaders,
          body: updatedBody
        }
      });
      return result;
    }, "flexibleChecksumsMiddleware");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+middleware-flexible-checksums@3.717.0/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/getChecksumAlgorithmListForResponse.js
var getChecksumAlgorithmListForResponse;
var init_getChecksumAlgorithmListForResponse = __esm({
  "../../node_modules/.pnpm/@aws-sdk+middleware-flexible-checksums@3.717.0/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/getChecksumAlgorithmListForResponse.js"() {
    init_import_meta_url();
    init_types7();
    getChecksumAlgorithmListForResponse = /* @__PURE__ */ __name((responseAlgorithms = []) => {
      const validChecksumAlgorithms = [];
      for (const algorithm of PRIORITY_ORDER_ALGORITHMS) {
        if (!responseAlgorithms.includes(algorithm) || !CLIENT_SUPPORTED_ALGORITHMS.includes(algorithm)) {
          continue;
        }
        validChecksumAlgorithms.push(algorithm);
      }
      return validChecksumAlgorithms;
    }, "getChecksumAlgorithmListForResponse");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+middleware-flexible-checksums@3.717.0/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/isChecksumWithPartNumber.js
var isChecksumWithPartNumber;
var init_isChecksumWithPartNumber = __esm({
  "../../node_modules/.pnpm/@aws-sdk+middleware-flexible-checksums@3.717.0/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/isChecksumWithPartNumber.js"() {
    init_import_meta_url();
    isChecksumWithPartNumber = /* @__PURE__ */ __name((checksum) => {
      const lastHyphenIndex = checksum.lastIndexOf("-");
      if (lastHyphenIndex !== -1) {
        const numberPart = checksum.slice(lastHyphenIndex + 1);
        if (!numberPart.startsWith("0")) {
          const number = parseInt(numberPart, 10);
          if (!isNaN(number) && number >= 1 && number <= 1e4) {
            return true;
          }
        }
      }
      return false;
    }, "isChecksumWithPartNumber");
  }
});
function createReadStreamOnBuffer(buffer) {
  const stream2 = new Stream.Transform();
  stream2.push(buffer);
  stream2.push(null);
  return stream2;
}
var init_create_read_stream_on_buffer = __esm({
  "../../node_modules/.pnpm/@aws-sdk+middleware-flexible-checksums@3.717.0/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/streams/create-read-stream-on-buffer.js"() {
    init_import_meta_url();
    __name(createReadStreamOnBuffer, "createReadStreamOnBuffer");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+middleware-flexible-checksums@3.717.0/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/getChecksum.js
var getChecksum;
var init_getChecksum = __esm({
  "../../node_modules/.pnpm/@aws-sdk+middleware-flexible-checksums@3.717.0/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/getChecksum.js"() {
    init_import_meta_url();
    init_stringHasher();
    getChecksum = /* @__PURE__ */ __name(async (body, { checksumAlgorithmFn, base64Encoder }) => base64Encoder(await stringHasher(checksumAlgorithmFn, body)), "getChecksum");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+middleware-flexible-checksums@3.717.0/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/validateChecksumFromResponse.js
var validateChecksumFromResponse;
var init_validateChecksumFromResponse = __esm({
  "../../node_modules/.pnpm/@aws-sdk+middleware-flexible-checksums@3.717.0/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/validateChecksumFromResponse.js"() {
    init_import_meta_url();
    init_dist_es15();
    init_getChecksum();
    init_getChecksumAlgorithmListForResponse();
    init_getChecksumLocationName();
    init_isStreaming();
    init_selectChecksumAlgorithmFunction();
    validateChecksumFromResponse = /* @__PURE__ */ __name(async (response, { config, responseAlgorithms }) => {
      const checksumAlgorithms = getChecksumAlgorithmListForResponse(responseAlgorithms);
      const { body: responseBody, headers: responseHeaders } = response;
      for (const algorithm of checksumAlgorithms) {
        const responseHeader = getChecksumLocationName(algorithm);
        const checksumFromResponse = responseHeaders[responseHeader];
        if (checksumFromResponse) {
          const checksumAlgorithmFn = selectChecksumAlgorithmFunction(algorithm, config);
          const { base64Encoder } = config;
          if (isStreaming(responseBody)) {
            response.body = createChecksumStream2({
              expectedChecksum: checksumFromResponse,
              checksumSourceLocation: responseHeader,
              checksum: new checksumAlgorithmFn(),
              source: responseBody,
              base64Encoder
            });
            return;
          }
          const checksum = await getChecksum(responseBody, { checksumAlgorithmFn, base64Encoder });
          if (checksum === checksumFromResponse) {
            break;
          }
          throw new Error(`Checksum mismatch: expected "${checksum}" but received "${checksumFromResponse}" in response header "${responseHeader}".`);
        }
      }
    }, "validateChecksumFromResponse");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+middleware-flexible-checksums@3.717.0/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/flexibleChecksumsResponseMiddleware.js
var flexibleChecksumsResponseMiddlewareOptions, flexibleChecksumsResponseMiddleware;
var init_flexibleChecksumsResponseMiddleware = __esm({
  "../../node_modules/.pnpm/@aws-sdk+middleware-flexible-checksums@3.717.0/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/flexibleChecksumsResponseMiddleware.js"() {
    init_import_meta_url();
    init_dist_es2();
    init_getChecksumAlgorithmListForResponse();
    init_getChecksumLocationName();
    init_isChecksumWithPartNumber();
    init_isStreaming();
    init_create_read_stream_on_buffer();
    init_validateChecksumFromResponse();
    flexibleChecksumsResponseMiddlewareOptions = {
      name: "flexibleChecksumsResponseMiddleware",
      toMiddleware: "deserializerMiddleware",
      relation: "after",
      tags: ["BODY_CHECKSUM"],
      override: true
    };
    flexibleChecksumsResponseMiddleware = /* @__PURE__ */ __name((config, middlewareConfig) => (next, context2) => async (args) => {
      if (!HttpRequest.isInstance(args.request)) {
        return next(args);
      }
      const input = args.input;
      const result = await next(args);
      const response = result.response;
      let collectedStream = void 0;
      const { requestValidationModeMember, responseAlgorithms } = middlewareConfig;
      if (requestValidationModeMember && input[requestValidationModeMember] === "ENABLED") {
        const { clientName, commandName } = context2;
        const isS3WholeObjectMultipartGetResponseChecksum = clientName === "S3Client" && commandName === "GetObjectCommand" && getChecksumAlgorithmListForResponse(responseAlgorithms).every((algorithm) => {
          const responseHeader = getChecksumLocationName(algorithm);
          const checksumFromResponse = response.headers[responseHeader];
          return !checksumFromResponse || isChecksumWithPartNumber(checksumFromResponse);
        });
        if (isS3WholeObjectMultipartGetResponseChecksum) {
          return result;
        }
        const isStreamingBody = isStreaming(response.body);
        if (isStreamingBody) {
          collectedStream = await config.streamCollector(response.body);
          response.body = createReadStreamOnBuffer(collectedStream);
        }
        await validateChecksumFromResponse(result.response, {
          config,
          responseAlgorithms
        });
        if (isStreamingBody && collectedStream) {
          response.body = createReadStreamOnBuffer(collectedStream);
        }
      }
      return result;
    }, "flexibleChecksumsResponseMiddleware");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+middleware-flexible-checksums@3.717.0/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/getFlexibleChecksumsPlugin.js
var getFlexibleChecksumsPlugin;
var init_getFlexibleChecksumsPlugin = __esm({
  "../../node_modules/.pnpm/@aws-sdk+middleware-flexible-checksums@3.717.0/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/getFlexibleChecksumsPlugin.js"() {
    init_import_meta_url();
    init_flexibleChecksumsMiddleware();
    init_flexibleChecksumsResponseMiddleware();
    getFlexibleChecksumsPlugin = /* @__PURE__ */ __name((config, middlewareConfig) => ({
      applyToStack: /* @__PURE__ */ __name((clientStack) => {
        clientStack.add(flexibleChecksumsMiddleware(config, middlewareConfig), flexibleChecksumsMiddlewareOptions);
        clientStack.addRelativeTo(flexibleChecksumsResponseMiddleware(config, middlewareConfig), flexibleChecksumsResponseMiddlewareOptions);
      }, "applyToStack")
    }), "getFlexibleChecksumsPlugin");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+middleware-flexible-checksums@3.717.0/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/resolveFlexibleChecksumsConfig.js
var resolveFlexibleChecksumsConfig;
var init_resolveFlexibleChecksumsConfig = __esm({
  "../../node_modules/.pnpm/@aws-sdk+middleware-flexible-checksums@3.717.0/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/resolveFlexibleChecksumsConfig.js"() {
    init_import_meta_url();
    init_dist_es4();
    init_constants8();
    resolveFlexibleChecksumsConfig = /* @__PURE__ */ __name((input) => ({
      ...input,
      requestChecksumCalculation: normalizeProvider(input.requestChecksumCalculation ?? DEFAULT_REQUEST_CHECKSUM_CALCULATION),
      responseChecksumValidation: normalizeProvider(input.responseChecksumValidation ?? DEFAULT_RESPONSE_CHECKSUM_VALIDATION)
    }), "resolveFlexibleChecksumsConfig");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+middleware-flexible-checksums@3.717.0/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/index.js
var init_dist_es25 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+middleware-flexible-checksums@3.717.0/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/index.js"() {
    init_import_meta_url();
    init_NODE_REQUEST_CHECKSUM_CALCULATION_CONFIG_OPTIONS();
    init_NODE_RESPONSE_CHECKSUM_VALIDATION_CONFIG_OPTIONS();
    init_constants8();
    init_flexibleChecksumsMiddleware();
    init_getFlexibleChecksumsPlugin();
    init_resolveFlexibleChecksumsConfig();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+middleware-host-header@3.714.0/node_modules/@aws-sdk/middleware-host-header/dist-es/index.js
function resolveHostHeaderConfig(input) {
  return input;
}
var hostHeaderMiddleware, hostHeaderMiddlewareOptions, getHostHeaderPlugin;
var init_dist_es26 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+middleware-host-header@3.714.0/node_modules/@aws-sdk/middleware-host-header/dist-es/index.js"() {
    init_import_meta_url();
    init_dist_es2();
    __name(resolveHostHeaderConfig, "resolveHostHeaderConfig");
    hostHeaderMiddleware = /* @__PURE__ */ __name((options) => (next) => async (args) => {
      if (!HttpRequest.isInstance(args.request))
        return next(args);
      const { request: request4 } = args;
      const { handlerProtocol = "" } = options.requestHandler.metadata || {};
      if (handlerProtocol.indexOf("h2") >= 0 && !request4.headers[":authority"]) {
        delete request4.headers["host"];
        request4.headers[":authority"] = request4.hostname + (request4.port ? ":" + request4.port : "");
      } else if (!request4.headers["host"]) {
        let host = request4.hostname;
        if (request4.port != null)
          host += `:${request4.port}`;
        request4.headers["host"] = host;
      }
      return next(args);
    }, "hostHeaderMiddleware");
    hostHeaderMiddlewareOptions = {
      name: "hostHeaderMiddleware",
      step: "build",
      priority: "low",
      tags: ["HOST"],
      override: true
    };
    getHostHeaderPlugin = /* @__PURE__ */ __name((options) => ({
      applyToStack: /* @__PURE__ */ __name((clientStack) => {
        clientStack.add(hostHeaderMiddleware(options), hostHeaderMiddlewareOptions);
      }, "applyToStack")
    }), "getHostHeaderPlugin");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+middleware-logger@3.714.0/node_modules/@aws-sdk/middleware-logger/dist-es/loggerMiddleware.js
var loggerMiddleware, loggerMiddlewareOptions, getLoggerPlugin;
var init_loggerMiddleware = __esm({
  "../../node_modules/.pnpm/@aws-sdk+middleware-logger@3.714.0/node_modules/@aws-sdk/middleware-logger/dist-es/loggerMiddleware.js"() {
    init_import_meta_url();
    loggerMiddleware = /* @__PURE__ */ __name(() => (next, context2) => async (args) => {
      try {
        const response = await next(args);
        const { clientName, commandName, logger: logger4, dynamoDbDocumentClientOptions = {} } = context2;
        const { overrideInputFilterSensitiveLog, overrideOutputFilterSensitiveLog } = dynamoDbDocumentClientOptions;
        const inputFilterSensitiveLog = overrideInputFilterSensitiveLog ?? context2.inputFilterSensitiveLog;
        const outputFilterSensitiveLog = overrideOutputFilterSensitiveLog ?? context2.outputFilterSensitiveLog;
        const { $metadata, ...outputWithoutMetadata } = response.output;
        logger4?.info?.({
          clientName,
          commandName,
          input: inputFilterSensitiveLog(args.input),
          output: outputFilterSensitiveLog(outputWithoutMetadata),
          metadata: $metadata
        });
        return response;
      } catch (error2) {
        const { clientName, commandName, logger: logger4, dynamoDbDocumentClientOptions = {} } = context2;
        const { overrideInputFilterSensitiveLog } = dynamoDbDocumentClientOptions;
        const inputFilterSensitiveLog = overrideInputFilterSensitiveLog ?? context2.inputFilterSensitiveLog;
        logger4?.error?.({
          clientName,
          commandName,
          input: inputFilterSensitiveLog(args.input),
          error: error2,
          metadata: error2.$metadata
        });
        throw error2;
      }
    }, "loggerMiddleware");
    loggerMiddlewareOptions = {
      name: "loggerMiddleware",
      tags: ["LOGGER"],
      step: "initialize",
      override: true
    };
    getLoggerPlugin = /* @__PURE__ */ __name((options) => ({
      applyToStack: /* @__PURE__ */ __name((clientStack) => {
        clientStack.add(loggerMiddleware(), loggerMiddlewareOptions);
      }, "applyToStack")
    }), "getLoggerPlugin");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+middleware-logger@3.714.0/node_modules/@aws-sdk/middleware-logger/dist-es/index.js
var init_dist_es27 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+middleware-logger@3.714.0/node_modules/@aws-sdk/middleware-logger/dist-es/index.js"() {
    init_import_meta_url();
    init_loggerMiddleware();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+middleware-recursion-detection@3.714.0/node_modules/@aws-sdk/middleware-recursion-detection/dist-es/index.js
var TRACE_ID_HEADER_NAME, ENV_LAMBDA_FUNCTION_NAME, ENV_TRACE_ID, recursionDetectionMiddleware, addRecursionDetectionMiddlewareOptions, getRecursionDetectionPlugin;
var init_dist_es28 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+middleware-recursion-detection@3.714.0/node_modules/@aws-sdk/middleware-recursion-detection/dist-es/index.js"() {
    init_import_meta_url();
    init_dist_es2();
    TRACE_ID_HEADER_NAME = "X-Amzn-Trace-Id";
    ENV_LAMBDA_FUNCTION_NAME = "AWS_LAMBDA_FUNCTION_NAME";
    ENV_TRACE_ID = "_X_AMZN_TRACE_ID";
    recursionDetectionMiddleware = /* @__PURE__ */ __name((options) => (next) => async (args) => {
      const { request: request4 } = args;
      if (!HttpRequest.isInstance(request4) || options.runtime !== "node" || request4.headers.hasOwnProperty(TRACE_ID_HEADER_NAME)) {
        return next(args);
      }
      const functionName = process.env[ENV_LAMBDA_FUNCTION_NAME];
      const traceId = process.env[ENV_TRACE_ID];
      const nonEmptyString = /* @__PURE__ */ __name((str) => typeof str === "string" && str.length > 0, "nonEmptyString");
      if (nonEmptyString(functionName) && nonEmptyString(traceId)) {
        request4.headers[TRACE_ID_HEADER_NAME] = traceId;
      }
      return next({
        ...args,
        request: request4
      });
    }, "recursionDetectionMiddleware");
    addRecursionDetectionMiddlewareOptions = {
      step: "build",
      tags: ["RECURSION_DETECTION"],
      name: "recursionDetectionMiddleware",
      override: true,
      priority: "low"
    };
    getRecursionDetectionPlugin = /* @__PURE__ */ __name((options) => ({
      applyToStack: /* @__PURE__ */ __name((clientStack) => {
        clientStack.add(recursionDetectionMiddleware(options), addRecursionDetectionMiddlewareOptions);
      }, "applyToStack")
    }), "getRecursionDetectionPlugin");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+middleware-sdk-s3@3.716.0/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/check-content-length-header.js
function checkContentLengthHeader() {
  return (next, context2) => async (args) => {
    const { request: request4 } = args;
    if (HttpRequest.isInstance(request4)) {
      if (!(CONTENT_LENGTH_HEADER in request4.headers)) {
        const message = `Are you using a Stream of unknown length as the Body of a PutObject request? Consider using Upload instead from @aws-sdk/lib-storage.`;
        if (typeof context2?.logger?.warn === "function" && !(context2.logger instanceof NoOpLogger)) {
          context2.logger.warn(message);
        } else {
          console.warn(message);
        }
      }
    }
    return next({ ...args });
  };
}
var CONTENT_LENGTH_HEADER, checkContentLengthHeaderMiddlewareOptions, getCheckContentLengthHeaderPlugin;
var init_check_content_length_header = __esm({
  "../../node_modules/.pnpm/@aws-sdk+middleware-sdk-s3@3.716.0/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/check-content-length-header.js"() {
    init_import_meta_url();
    init_dist_es2();
    init_dist_es20();
    CONTENT_LENGTH_HEADER = "content-length";
    __name(checkContentLengthHeader, "checkContentLengthHeader");
    checkContentLengthHeaderMiddlewareOptions = {
      step: "finalizeRequest",
      tags: ["CHECK_CONTENT_LENGTH_HEADER"],
      name: "getCheckContentLengthHeaderPlugin",
      override: true
    };
    getCheckContentLengthHeaderPlugin = /* @__PURE__ */ __name((unused) => ({
      applyToStack: /* @__PURE__ */ __name((clientStack) => {
        clientStack.add(checkContentLengthHeader(), checkContentLengthHeaderMiddlewareOptions);
      }, "applyToStack")
    }), "getCheckContentLengthHeaderPlugin");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+middleware-sdk-s3@3.716.0/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/region-redirect-endpoint-middleware.js
var regionRedirectEndpointMiddleware, regionRedirectEndpointMiddlewareOptions;
var init_region_redirect_endpoint_middleware = __esm({
  "../../node_modules/.pnpm/@aws-sdk+middleware-sdk-s3@3.716.0/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/region-redirect-endpoint-middleware.js"() {
    init_import_meta_url();
    regionRedirectEndpointMiddleware = /* @__PURE__ */ __name((config) => {
      return (next, context2) => async (args) => {
        const originalRegion = await config.region();
        const regionProviderRef = config.region;
        let unlock = /* @__PURE__ */ __name(() => {
        }, "unlock");
        if (context2.__s3RegionRedirect) {
          Object.defineProperty(config, "region", {
            writable: false,
            value: /* @__PURE__ */ __name(async () => {
              return context2.__s3RegionRedirect;
            }, "value")
          });
          unlock = /* @__PURE__ */ __name(() => Object.defineProperty(config, "region", {
            writable: true,
            value: regionProviderRef
          }), "unlock");
        }
        try {
          const result = await next(args);
          if (context2.__s3RegionRedirect) {
            unlock();
            const region = await config.region();
            if (originalRegion !== region) {
              throw new Error("Region was not restored following S3 region redirect.");
            }
          }
          return result;
        } catch (e10) {
          unlock();
          throw e10;
        }
      };
    }, "regionRedirectEndpointMiddleware");
    regionRedirectEndpointMiddlewareOptions = {
      tags: ["REGION_REDIRECT", "S3"],
      name: "regionRedirectEndpointMiddleware",
      override: true,
      relation: "before",
      toMiddleware: "endpointV2Middleware"
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+middleware-sdk-s3@3.716.0/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/region-redirect-middleware.js
function regionRedirectMiddleware(clientConfig) {
  return (next, context2) => async (args) => {
    try {
      return await next(args);
    } catch (err) {
      if (clientConfig.followRegionRedirects) {
        if (err?.$metadata?.httpStatusCode === 301 || err?.$metadata?.httpStatusCode === 400 && err?.name === "IllegalLocationConstraintException") {
          try {
            const actualRegion = err.$response.headers["x-amz-bucket-region"];
            context2.logger?.debug(`Redirecting from ${await clientConfig.region()} to ${actualRegion}`);
            context2.__s3RegionRedirect = actualRegion;
          } catch (e10) {
            throw new Error("Region redirect failed: " + e10);
          }
          return next(args);
        }
      }
      throw err;
    }
  };
}
var regionRedirectMiddlewareOptions, getRegionRedirectMiddlewarePlugin;
var init_region_redirect_middleware = __esm({
  "../../node_modules/.pnpm/@aws-sdk+middleware-sdk-s3@3.716.0/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/region-redirect-middleware.js"() {
    init_import_meta_url();
    init_region_redirect_endpoint_middleware();
    __name(regionRedirectMiddleware, "regionRedirectMiddleware");
    regionRedirectMiddlewareOptions = {
      step: "initialize",
      tags: ["REGION_REDIRECT", "S3"],
      name: "regionRedirectMiddleware",
      override: true
    };
    getRegionRedirectMiddlewarePlugin = /* @__PURE__ */ __name((clientConfig) => ({
      applyToStack: /* @__PURE__ */ __name((clientStack) => {
        clientStack.add(regionRedirectMiddleware(clientConfig), regionRedirectMiddlewareOptions);
        clientStack.addRelativeTo(regionRedirectEndpointMiddleware(clientConfig), regionRedirectEndpointMiddlewareOptions);
      }, "applyToStack")
    }), "getRegionRedirectMiddlewarePlugin");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+middleware-sdk-s3@3.716.0/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-expires-middleware.js
var s3ExpiresMiddleware, s3ExpiresMiddlewareOptions, getS3ExpiresMiddlewarePlugin;
var init_s3_expires_middleware = __esm({
  "../../node_modules/.pnpm/@aws-sdk+middleware-sdk-s3@3.716.0/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-expires-middleware.js"() {
    init_import_meta_url();
    init_dist_es2();
    init_dist_es20();
    s3ExpiresMiddleware = /* @__PURE__ */ __name((config) => {
      return (next, context2) => async (args) => {
        const result = await next(args);
        const { response } = result;
        if (HttpResponse.isInstance(response)) {
          if (response.headers.expires) {
            response.headers.expiresstring = response.headers.expires;
            try {
              parseRfc7231DateTime(response.headers.expires);
            } catch (e10) {
              context2.logger?.warn(`AWS SDK Warning for ${context2.clientName}::${context2.commandName} response parsing (${response.headers.expires}): ${e10}`);
              delete response.headers.expires;
            }
          }
        }
        return result;
      };
    }, "s3ExpiresMiddleware");
    s3ExpiresMiddlewareOptions = {
      tags: ["S3"],
      name: "s3ExpiresMiddleware",
      override: true,
      relation: "after",
      toMiddleware: "deserializerMiddleware"
    };
    getS3ExpiresMiddlewarePlugin = /* @__PURE__ */ __name((clientConfig) => ({
      applyToStack: /* @__PURE__ */ __name((clientStack) => {
        clientStack.addRelativeTo(s3ExpiresMiddleware(clientConfig), s3ExpiresMiddlewareOptions);
      }, "applyToStack")
    }), "getS3ExpiresMiddlewarePlugin");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+middleware-sdk-s3@3.716.0/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/classes/S3ExpressIdentityCache.js
var S3ExpressIdentityCache;
var init_S3ExpressIdentityCache = __esm({
  "../../node_modules/.pnpm/@aws-sdk+middleware-sdk-s3@3.716.0/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/classes/S3ExpressIdentityCache.js"() {
    init_import_meta_url();
    S3ExpressIdentityCache = class _S3ExpressIdentityCache {
      static {
        __name(this, "S3ExpressIdentityCache");
      }
      constructor(data = {}) {
        this.data = data;
        this.lastPurgeTime = Date.now();
      }
      get(key) {
        const entry = this.data[key];
        if (!entry) {
          return;
        }
        return entry;
      }
      set(key, entry) {
        this.data[key] = entry;
        return entry;
      }
      delete(key) {
        delete this.data[key];
      }
      async purgeExpired() {
        const now = Date.now();
        if (this.lastPurgeTime + _S3ExpressIdentityCache.EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS > now) {
          return;
        }
        for (const key in this.data) {
          const entry = this.data[key];
          if (!entry.isRefreshing) {
            const credential = await entry.identity;
            if (credential.expiration) {
              if (credential.expiration.getTime() < now) {
                delete this.data[key];
              }
            }
          }
        }
      }
    };
    S3ExpressIdentityCache.EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS = 3e4;
  }
});

// ../../node_modules/.pnpm/@aws-sdk+middleware-sdk-s3@3.716.0/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/classes/S3ExpressIdentityCacheEntry.js
var S3ExpressIdentityCacheEntry;
var init_S3ExpressIdentityCacheEntry = __esm({
  "../../node_modules/.pnpm/@aws-sdk+middleware-sdk-s3@3.716.0/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/classes/S3ExpressIdentityCacheEntry.js"() {
    init_import_meta_url();
    S3ExpressIdentityCacheEntry = class {
      static {
        __name(this, "S3ExpressIdentityCacheEntry");
      }
      constructor(_identity, isRefreshing = false, accessed = Date.now()) {
        this._identity = _identity;
        this.isRefreshing = isRefreshing;
        this.accessed = accessed;
      }
      get identity() {
        this.accessed = Date.now();
        return this._identity;
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+middleware-sdk-s3@3.716.0/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/classes/S3ExpressIdentityProviderImpl.js
var S3ExpressIdentityProviderImpl;
var init_S3ExpressIdentityProviderImpl = __esm({
  "../../node_modules/.pnpm/@aws-sdk+middleware-sdk-s3@3.716.0/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/classes/S3ExpressIdentityProviderImpl.js"() {
    init_import_meta_url();
    init_S3ExpressIdentityCache();
    init_S3ExpressIdentityCacheEntry();
    S3ExpressIdentityProviderImpl = class _S3ExpressIdentityProviderImpl {
      static {
        __name(this, "S3ExpressIdentityProviderImpl");
      }
      constructor(createSessionFn, cache5 = new S3ExpressIdentityCache()) {
        this.createSessionFn = createSessionFn;
        this.cache = cache5;
      }
      async getS3ExpressIdentity(awsIdentity, identityProperties) {
        const key = identityProperties.Bucket;
        const { cache: cache5 } = this;
        const entry = cache5.get(key);
        if (entry) {
          return entry.identity.then((identity) => {
            const isExpired = (identity.expiration?.getTime() ?? 0) < Date.now();
            if (isExpired) {
              return cache5.set(key, new S3ExpressIdentityCacheEntry(this.getIdentity(key))).identity;
            }
            const isExpiringSoon = (identity.expiration?.getTime() ?? 0) < Date.now() + _S3ExpressIdentityProviderImpl.REFRESH_WINDOW_MS;
            if (isExpiringSoon && !entry.isRefreshing) {
              entry.isRefreshing = true;
              this.getIdentity(key).then((id) => {
                cache5.set(key, new S3ExpressIdentityCacheEntry(Promise.resolve(id)));
              });
            }
            return identity;
          });
        }
        return cache5.set(key, new S3ExpressIdentityCacheEntry(this.getIdentity(key))).identity;
      }
      async getIdentity(key) {
        await this.cache.purgeExpired().catch((error2) => {
          console.warn("Error while clearing expired entries in S3ExpressIdentityCache: \n" + error2);
        });
        const session = await this.createSessionFn(key);
        if (!session.Credentials?.AccessKeyId || !session.Credentials?.SecretAccessKey) {
          throw new Error("s3#createSession response credential missing AccessKeyId or SecretAccessKey.");
        }
        const identity = {
          accessKeyId: session.Credentials.AccessKeyId,
          secretAccessKey: session.Credentials.SecretAccessKey,
          sessionToken: session.Credentials.SessionToken,
          expiration: session.Credentials.Expiration ? new Date(session.Credentials.Expiration) : void 0
        };
        return identity;
      }
    };
    S3ExpressIdentityProviderImpl.REFRESH_WINDOW_MS = 6e4;
  }
});

// ../../node_modules/.pnpm/@smithy+util-config-provider@3.0.0/node_modules/@smithy/util-config-provider/dist-es/booleanSelector.js
var booleanSelector;
var init_booleanSelector = __esm({
  "../../node_modules/.pnpm/@smithy+util-config-provider@3.0.0/node_modules/@smithy/util-config-provider/dist-es/booleanSelector.js"() {
    init_import_meta_url();
    booleanSelector = /* @__PURE__ */ __name((obj, key, type) => {
      if (!(key in obj))
        return void 0;
      if (obj[key] === "true")
        return true;
      if (obj[key] === "false")
        return false;
      throw new Error(`Cannot load ${type} "${key}". Expected "true" or "false", got ${obj[key]}.`);
    }, "booleanSelector");
  }
});

// ../../node_modules/.pnpm/@smithy+util-config-provider@3.0.0/node_modules/@smithy/util-config-provider/dist-es/numberSelector.js
var init_numberSelector = __esm({
  "../../node_modules/.pnpm/@smithy+util-config-provider@3.0.0/node_modules/@smithy/util-config-provider/dist-es/numberSelector.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+util-config-provider@3.0.0/node_modules/@smithy/util-config-provider/dist-es/types.js
var SelectorType2;
var init_types8 = __esm({
  "../../node_modules/.pnpm/@smithy+util-config-provider@3.0.0/node_modules/@smithy/util-config-provider/dist-es/types.js"() {
    init_import_meta_url();
    (function(SelectorType3) {
      SelectorType3["ENV"] = "env";
      SelectorType3["CONFIG"] = "shared config entry";
    })(SelectorType2 || (SelectorType2 = {}));
  }
});

// ../../node_modules/.pnpm/@smithy+util-config-provider@3.0.0/node_modules/@smithy/util-config-provider/dist-es/index.js
var init_dist_es29 = __esm({
  "../../node_modules/.pnpm/@smithy+util-config-provider@3.0.0/node_modules/@smithy/util-config-provider/dist-es/index.js"() {
    init_import_meta_url();
    init_booleanSelector();
    init_numberSelector();
    init_types8();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+middleware-sdk-s3@3.716.0/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/constants.js
var S3_EXPRESS_BUCKET_TYPE, S3_EXPRESS_BACKEND, S3_EXPRESS_AUTH_SCHEME, SESSION_TOKEN_QUERY_PARAM, SESSION_TOKEN_HEADER, NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_ENV_NAME, NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_INI_NAME, NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_OPTIONS;
var init_constants12 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+middleware-sdk-s3@3.716.0/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/constants.js"() {
    init_import_meta_url();
    init_dist_es29();
    S3_EXPRESS_BUCKET_TYPE = "Directory";
    S3_EXPRESS_BACKEND = "S3Express";
    S3_EXPRESS_AUTH_SCHEME = "sigv4-s3express";
    SESSION_TOKEN_QUERY_PARAM = "X-Amz-S3session-Token";
    SESSION_TOKEN_HEADER = SESSION_TOKEN_QUERY_PARAM.toLowerCase();
    NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_ENV_NAME = "AWS_S3_DISABLE_EXPRESS_SESSION_AUTH";
    NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_INI_NAME = "s3_disable_express_session_auth";
    NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_OPTIONS = {
      environmentVariableSelector: /* @__PURE__ */ __name((env6) => booleanSelector(env6, NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_ENV_NAME, SelectorType2.ENV), "environmentVariableSelector"),
      configFileSelector: /* @__PURE__ */ __name((profile) => booleanSelector(profile, NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_INI_NAME, SelectorType2.CONFIG), "configFileSelector"),
      default: false
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+middleware-sdk-s3@3.716.0/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/classes/SignatureV4S3Express.js
function getCredentialsWithoutSessionToken(credentials) {
  const credentialsWithoutSessionToken = {
    accessKeyId: credentials.accessKeyId,
    secretAccessKey: credentials.secretAccessKey,
    expiration: credentials.expiration
  };
  return credentialsWithoutSessionToken;
}
function setSingleOverride(privateAccess, credentialsWithoutSessionToken) {
  const id = setTimeout(() => {
    throw new Error("SignatureV4S3Express credential override was created but not called.");
  }, 10);
  const currentCredentialProvider = privateAccess.credentialProvider;
  const overrideCredentialsProviderOnce = /* @__PURE__ */ __name(() => {
    clearTimeout(id);
    privateAccess.credentialProvider = currentCredentialProvider;
    return Promise.resolve(credentialsWithoutSessionToken);
  }, "overrideCredentialsProviderOnce");
  privateAccess.credentialProvider = overrideCredentialsProviderOnce;
}
var SignatureV4S3Express;
var init_SignatureV4S3Express = __esm({
  "../../node_modules/.pnpm/@aws-sdk+middleware-sdk-s3@3.716.0/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/classes/SignatureV4S3Express.js"() {
    init_import_meta_url();
    init_dist_es18();
    init_constants12();
    SignatureV4S3Express = class extends SignatureV4 {
      static {
        __name(this, "SignatureV4S3Express");
      }
      async signWithCredentials(requestToSign, credentials, options) {
        const credentialsWithoutSessionToken = getCredentialsWithoutSessionToken(credentials);
        requestToSign.headers[SESSION_TOKEN_HEADER] = credentials.sessionToken;
        const privateAccess = this;
        setSingleOverride(privateAccess, credentialsWithoutSessionToken);
        return privateAccess.signRequest(requestToSign, options ?? {});
      }
      async presignWithCredentials(requestToSign, credentials, options) {
        const credentialsWithoutSessionToken = getCredentialsWithoutSessionToken(credentials);
        delete requestToSign.headers[SESSION_TOKEN_HEADER];
        requestToSign.headers[SESSION_TOKEN_QUERY_PARAM] = credentials.sessionToken;
        requestToSign.query = requestToSign.query ?? {};
        requestToSign.query[SESSION_TOKEN_QUERY_PARAM] = credentials.sessionToken;
        const privateAccess = this;
        setSingleOverride(privateAccess, credentialsWithoutSessionToken);
        return this.presign(requestToSign, options);
      }
    };
    __name(getCredentialsWithoutSessionToken, "getCredentialsWithoutSessionToken");
    __name(setSingleOverride, "setSingleOverride");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+middleware-sdk-s3@3.716.0/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/functions/s3ExpressMiddleware.js
var s3ExpressMiddleware, s3ExpressMiddlewareOptions, getS3ExpressPlugin;
var init_s3ExpressMiddleware = __esm({
  "../../node_modules/.pnpm/@aws-sdk+middleware-sdk-s3@3.716.0/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/functions/s3ExpressMiddleware.js"() {
    init_import_meta_url();
    init_dist_es21();
    init_dist_es2();
    init_constants12();
    s3ExpressMiddleware = /* @__PURE__ */ __name((options) => {
      return (next, context2) => async (args) => {
        if (context2.endpointV2) {
          const endpoint = context2.endpointV2;
          const isS3ExpressAuth = endpoint.properties?.authSchemes?.[0]?.name === S3_EXPRESS_AUTH_SCHEME;
          const isS3ExpressBucket = endpoint.properties?.backend === S3_EXPRESS_BACKEND || endpoint.properties?.bucketType === S3_EXPRESS_BUCKET_TYPE;
          if (isS3ExpressBucket) {
            setFeature(context2, "S3_EXPRESS_BUCKET", "J");
            context2.isS3ExpressBucket = true;
          }
          if (isS3ExpressAuth) {
            const requestBucket = args.input.Bucket;
            if (requestBucket) {
              const s3ExpressIdentity = await options.s3ExpressIdentityProvider.getS3ExpressIdentity(await options.credentials(), {
                Bucket: requestBucket
              });
              context2.s3ExpressIdentity = s3ExpressIdentity;
              if (HttpRequest.isInstance(args.request) && s3ExpressIdentity.sessionToken) {
                args.request.headers[SESSION_TOKEN_HEADER] = s3ExpressIdentity.sessionToken;
              }
            }
          }
        }
        return next(args);
      };
    }, "s3ExpressMiddleware");
    s3ExpressMiddlewareOptions = {
      name: "s3ExpressMiddleware",
      step: "build",
      tags: ["S3", "S3_EXPRESS"],
      override: true
    };
    getS3ExpressPlugin = /* @__PURE__ */ __name((options) => ({
      applyToStack: /* @__PURE__ */ __name((clientStack) => {
        clientStack.add(s3ExpressMiddleware(options), s3ExpressMiddlewareOptions);
      }, "applyToStack")
    }), "getS3ExpressPlugin");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+middleware-sdk-s3@3.716.0/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/functions/signS3Express.js
var signS3Express;
var init_signS3Express = __esm({
  "../../node_modules/.pnpm/@aws-sdk+middleware-sdk-s3@3.716.0/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/functions/signS3Express.js"() {
    init_import_meta_url();
    signS3Express = /* @__PURE__ */ __name(async (s3ExpressIdentity, signingOptions, request4, sigV4MultiRegionSigner) => {
      const signedRequest = await sigV4MultiRegionSigner.signWithCredentials(request4, s3ExpressIdentity, {});
      if (signedRequest.headers["X-Amz-Security-Token"] || signedRequest.headers["x-amz-security-token"]) {
        throw new Error("X-Amz-Security-Token must not be set for s3-express requests.");
      }
      return signedRequest;
    }, "signS3Express");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+middleware-sdk-s3@3.716.0/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/functions/s3ExpressHttpSigningMiddleware.js
var defaultErrorHandler2, defaultSuccessHandler2, s3ExpressHttpSigningMiddleware, getS3ExpressHttpSigningPlugin;
var init_s3ExpressHttpSigningMiddleware = __esm({
  "../../node_modules/.pnpm/@aws-sdk+middleware-sdk-s3@3.716.0/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/functions/s3ExpressHttpSigningMiddleware.js"() {
    init_import_meta_url();
    init_dist_es16();
    init_dist_es2();
    init_dist_es();
    init_dist_es4();
    init_signS3Express();
    defaultErrorHandler2 = /* @__PURE__ */ __name((signingProperties) => (error2) => {
      throw error2;
    }, "defaultErrorHandler");
    defaultSuccessHandler2 = /* @__PURE__ */ __name((httpResponse, signingProperties) => {
    }, "defaultSuccessHandler");
    s3ExpressHttpSigningMiddleware = /* @__PURE__ */ __name((config) => (next, context2) => async (args) => {
      if (!HttpRequest.isInstance(args.request)) {
        return next(args);
      }
      const smithyContext = getSmithyContext(context2);
      const scheme = smithyContext.selectedHttpAuthScheme;
      if (!scheme) {
        throw new Error(`No HttpAuthScheme was selected: unable to sign request`);
      }
      const { httpAuthOption: { signingProperties = {} }, identity, signer } = scheme;
      let request4;
      if (context2.s3ExpressIdentity) {
        request4 = await signS3Express(context2.s3ExpressIdentity, signingProperties, args.request, await config.signer());
      } else {
        request4 = await signer.sign(args.request, identity, signingProperties);
      }
      const output = await next({
        ...args,
        request: request4
      }).catch((signer.errorHandler || defaultErrorHandler2)(signingProperties));
      (signer.successHandler || defaultSuccessHandler2)(output.response, signingProperties);
      return output;
    }, "s3ExpressHttpSigningMiddleware");
    getS3ExpressHttpSigningPlugin = /* @__PURE__ */ __name((config) => ({
      applyToStack: /* @__PURE__ */ __name((clientStack) => {
        clientStack.addRelativeTo(s3ExpressHttpSigningMiddleware(config), httpSigningMiddlewareOptions);
      }, "applyToStack")
    }), "getS3ExpressHttpSigningPlugin");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+middleware-sdk-s3@3.716.0/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/index.js
var init_s3_express = __esm({
  "../../node_modules/.pnpm/@aws-sdk+middleware-sdk-s3@3.716.0/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/index.js"() {
    init_import_meta_url();
    init_S3ExpressIdentityCache();
    init_S3ExpressIdentityCacheEntry();
    init_S3ExpressIdentityProviderImpl();
    init_SignatureV4S3Express();
    init_constants12();
    init_s3ExpressMiddleware();
    init_s3ExpressHttpSigningMiddleware();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+middleware-sdk-s3@3.716.0/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3Configuration.js
var resolveS3Config;
var init_s3Configuration = __esm({
  "../../node_modules/.pnpm/@aws-sdk+middleware-sdk-s3@3.716.0/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3Configuration.js"() {
    init_import_meta_url();
    init_s3_express();
    resolveS3Config = /* @__PURE__ */ __name((input, { session }) => {
      const [s3ClientProvider, CreateSessionCommandCtor] = session;
      return {
        ...input,
        forcePathStyle: input.forcePathStyle ?? false,
        useAccelerateEndpoint: input.useAccelerateEndpoint ?? false,
        disableMultiregionAccessPoints: input.disableMultiregionAccessPoints ?? false,
        followRegionRedirects: input.followRegionRedirects ?? false,
        s3ExpressIdentityProvider: input.s3ExpressIdentityProvider ?? new S3ExpressIdentityProviderImpl(async (key) => s3ClientProvider().send(new CreateSessionCommandCtor({
          Bucket: key,
          SessionMode: "ReadWrite"
        }))),
        bucketEndpoint: input.bucketEndpoint ?? false
      };
    }, "resolveS3Config");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+middleware-sdk-s3@3.716.0/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/throw-200-exceptions.js
var THROW_IF_EMPTY_BODY, MAX_BYTES_TO_INSPECT, throw200ExceptionsMiddleware, collectBody2, throw200ExceptionsMiddlewareOptions, getThrow200ExceptionsPlugin;
var init_throw_200_exceptions = __esm({
  "../../node_modules/.pnpm/@aws-sdk+middleware-sdk-s3@3.716.0/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/throw-200-exceptions.js"() {
    init_import_meta_url();
    init_dist_es2();
    init_dist_es15();
    THROW_IF_EMPTY_BODY = {
      CopyObjectCommand: true,
      UploadPartCopyCommand: true,
      CompleteMultipartUploadCommand: true
    };
    MAX_BYTES_TO_INSPECT = 3e3;
    throw200ExceptionsMiddleware = /* @__PURE__ */ __name((config) => (next, context2) => async (args) => {
      const result = await next(args);
      const { response } = result;
      if (!HttpResponse.isInstance(response)) {
        return result;
      }
      const { statusCode, body: sourceBody } = response;
      if (statusCode < 200 || statusCode >= 300) {
        return result;
      }
      const isSplittableStream = typeof sourceBody?.stream === "function" || typeof sourceBody?.pipe === "function" || typeof sourceBody?.tee === "function";
      if (!isSplittableStream) {
        return result;
      }
      let bodyCopy = sourceBody;
      let body = sourceBody;
      if (sourceBody && typeof sourceBody === "object" && !(sourceBody instanceof Uint8Array)) {
        [bodyCopy, body] = await splitStream2(sourceBody);
      }
      response.body = body;
      const bodyBytes = await collectBody2(bodyCopy, {
        streamCollector: /* @__PURE__ */ __name(async (stream2) => {
          return headStream2(stream2, MAX_BYTES_TO_INSPECT);
        }, "streamCollector")
      });
      if (typeof bodyCopy?.destroy === "function") {
        bodyCopy.destroy();
      }
      const bodyStringTail = config.utf8Encoder(bodyBytes.subarray(bodyBytes.length - 16));
      if (bodyBytes.length === 0 && THROW_IF_EMPTY_BODY[context2.commandName]) {
        const err = new Error("S3 aborted request");
        err.name = "InternalError";
        throw err;
      }
      if (bodyStringTail && bodyStringTail.endsWith("</Error>")) {
        response.statusCode = 400;
      }
      return result;
    }, "throw200ExceptionsMiddleware");
    collectBody2 = /* @__PURE__ */ __name((streamBody = new Uint8Array(), context2) => {
      if (streamBody instanceof Uint8Array) {
        return Promise.resolve(streamBody);
      }
      return context2.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
    }, "collectBody");
    throw200ExceptionsMiddlewareOptions = {
      relation: "after",
      toMiddleware: "deserializerMiddleware",
      tags: ["THROW_200_EXCEPTIONS", "S3"],
      name: "throw200ExceptionsMiddleware",
      override: true
    };
    getThrow200ExceptionsPlugin = /* @__PURE__ */ __name((config) => ({
      applyToStack: /* @__PURE__ */ __name((clientStack) => {
        clientStack.addRelativeTo(throw200ExceptionsMiddleware(config), throw200ExceptionsMiddlewareOptions);
      }, "applyToStack")
    }), "getThrow200ExceptionsPlugin");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+util-arn-parser@3.693.0/node_modules/@aws-sdk/util-arn-parser/dist-es/index.js
var validate2;
var init_dist_es30 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+util-arn-parser@3.693.0/node_modules/@aws-sdk/util-arn-parser/dist-es/index.js"() {
    init_import_meta_url();
    validate2 = /* @__PURE__ */ __name((str) => typeof str === "string" && str.indexOf("arn:") === 0 && str.split(":").length >= 6, "validate");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+middleware-sdk-s3@3.716.0/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/bucket-endpoint-middleware.js
function bucketEndpointMiddleware(options) {
  return (next, context2) => async (args) => {
    if (options.bucketEndpoint) {
      const endpoint = context2.endpointV2;
      if (endpoint) {
        const bucket = args.input.Bucket;
        if (typeof bucket === "string") {
          try {
            const bucketEndpointUrl = new URL(bucket);
            context2.endpointV2 = {
              ...endpoint,
              url: bucketEndpointUrl
            };
          } catch (e10) {
            const warning = `@aws-sdk/middleware-sdk-s3: bucketEndpoint=true was set but Bucket=${bucket} could not be parsed as URL.`;
            if (context2.logger?.constructor?.name === "NoOpLogger") {
              console.warn(warning);
            } else {
              context2.logger?.warn?.(warning);
            }
            throw e10;
          }
        }
      }
    }
    return next(args);
  };
}
var bucketEndpointMiddlewareOptions;
var init_bucket_endpoint_middleware = __esm({
  "../../node_modules/.pnpm/@aws-sdk+middleware-sdk-s3@3.716.0/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/bucket-endpoint-middleware.js"() {
    init_import_meta_url();
    __name(bucketEndpointMiddleware, "bucketEndpointMiddleware");
    bucketEndpointMiddlewareOptions = {
      name: "bucketEndpointMiddleware",
      override: true,
      relation: "after",
      toMiddleware: "endpointV2Middleware"
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+middleware-sdk-s3@3.716.0/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/validate-bucket-name.js
function validateBucketNameMiddleware({ bucketEndpoint }) {
  return (next) => async (args) => {
    const { input: { Bucket } } = args;
    if (!bucketEndpoint && typeof Bucket === "string" && !validate2(Bucket) && Bucket.indexOf("/") >= 0) {
      const err = new Error(`Bucket name shouldn't contain '/', received '${Bucket}'`);
      err.name = "InvalidBucketName";
      throw err;
    }
    return next({ ...args });
  };
}
var validateBucketNameMiddlewareOptions, getValidateBucketNamePlugin;
var init_validate_bucket_name = __esm({
  "../../node_modules/.pnpm/@aws-sdk+middleware-sdk-s3@3.716.0/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/validate-bucket-name.js"() {
    init_import_meta_url();
    init_dist_es30();
    init_bucket_endpoint_middleware();
    __name(validateBucketNameMiddleware, "validateBucketNameMiddleware");
    validateBucketNameMiddlewareOptions = {
      step: "initialize",
      tags: ["VALIDATE_BUCKET_NAME"],
      name: "validateBucketNameMiddleware",
      override: true
    };
    getValidateBucketNamePlugin = /* @__PURE__ */ __name((options) => ({
      applyToStack: /* @__PURE__ */ __name((clientStack) => {
        clientStack.add(validateBucketNameMiddleware(options), validateBucketNameMiddlewareOptions);
        clientStack.addRelativeTo(bucketEndpointMiddleware(options), bucketEndpointMiddlewareOptions);
      }, "applyToStack")
    }), "getValidateBucketNamePlugin");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+middleware-sdk-s3@3.716.0/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/index.js
var init_dist_es31 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+middleware-sdk-s3@3.716.0/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/index.js"() {
    init_import_meta_url();
    init_check_content_length_header();
    init_region_redirect_endpoint_middleware();
    init_region_redirect_middleware();
    init_s3_expires_middleware();
    init_s3_express();
    init_s3Configuration();
    init_throw_200_exceptions();
    init_validate_bucket_name();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+middleware-user-agent@3.721.0/node_modules/@aws-sdk/middleware-user-agent/dist-es/configurations.js
function isValidUserAgentAppId(appId) {
  if (appId === void 0) {
    return true;
  }
  return typeof appId === "string" && appId.length <= 50;
}
function resolveUserAgentConfig(input) {
  const normalizedAppIdProvider = normalizeProvider2(input.userAgentAppId ?? DEFAULT_UA_APP_ID);
  return {
    ...input,
    customUserAgent: typeof input.customUserAgent === "string" ? [[input.customUserAgent]] : input.customUserAgent,
    userAgentAppId: /* @__PURE__ */ __name(async () => {
      const appId = await normalizedAppIdProvider();
      if (!isValidUserAgentAppId(appId)) {
        const logger4 = input.logger?.constructor?.name === "NoOpLogger" || !input.logger ? console : input.logger;
        if (typeof appId !== "string") {
          logger4?.warn("userAgentAppId must be a string or undefined.");
        } else if (appId.length > 50) {
          logger4?.warn("The provided userAgentAppId exceeds the maximum length of 50 characters.");
        }
      }
      return appId;
    }, "userAgentAppId")
  };
}
var DEFAULT_UA_APP_ID;
var init_configurations4 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+middleware-user-agent@3.721.0/node_modules/@aws-sdk/middleware-user-agent/dist-es/configurations.js"() {
    init_import_meta_url();
    init_dist_es16();
    DEFAULT_UA_APP_ID = void 0;
    __name(isValidUserAgentAppId, "isValidUserAgentAppId");
    __name(resolveUserAgentConfig, "resolveUserAgentConfig");
  }
});

// ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/cache/EndpointCache.js
var EndpointCache;
var init_EndpointCache = __esm({
  "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/cache/EndpointCache.js"() {
    init_import_meta_url();
    EndpointCache = class {
      static {
        __name(this, "EndpointCache");
      }
      constructor({ size, params }) {
        this.data = /* @__PURE__ */ new Map();
        this.parameters = [];
        this.capacity = size ?? 50;
        if (params) {
          this.parameters = params;
        }
      }
      get(endpointParams, resolver) {
        const key = this.hash(endpointParams);
        if (key === false) {
          return resolver();
        }
        if (!this.data.has(key)) {
          if (this.data.size > this.capacity + 10) {
            const keys = this.data.keys();
            let i7 = 0;
            while (true) {
              const { value, done } = keys.next();
              this.data.delete(value);
              if (done || ++i7 > 10) {
                break;
              }
            }
          }
          this.data.set(key, resolver());
        }
        return this.data.get(key);
      }
      size() {
        return this.data.size;
      }
      hash(endpointParams) {
        let buffer = "";
        const { parameters } = this;
        if (parameters.length === 0) {
          return false;
        }
        for (const param of parameters) {
          const val2 = String(endpointParams[param] ?? "");
          if (val2.includes("|;")) {
            return false;
          }
          buffer += val2 + "|;";
        }
        return buffer;
      }
    };
  }
});

// ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/lib/isIpAddress.js
var IP_V4_REGEX, isIpAddress;
var init_isIpAddress = __esm({
  "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/lib/isIpAddress.js"() {
    init_import_meta_url();
    IP_V4_REGEX = new RegExp(`^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$`);
    isIpAddress = /* @__PURE__ */ __name((value) => IP_V4_REGEX.test(value) || value.startsWith("[") && value.endsWith("]"), "isIpAddress");
  }
});

// ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/lib/isValidHostLabel.js
var VALID_HOST_LABEL_REGEX, isValidHostLabel;
var init_isValidHostLabel = __esm({
  "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/lib/isValidHostLabel.js"() {
    init_import_meta_url();
    VALID_HOST_LABEL_REGEX = new RegExp(`^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$`);
    isValidHostLabel = /* @__PURE__ */ __name((value, allowSubDomains = false) => {
      if (!allowSubDomains) {
        return VALID_HOST_LABEL_REGEX.test(value);
      }
      const labels = value.split(".");
      for (const label of labels) {
        if (!isValidHostLabel(label)) {
          return false;
        }
      }
      return true;
    }, "isValidHostLabel");
  }
});

// ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/utils/customEndpointFunctions.js
var customEndpointFunctions;
var init_customEndpointFunctions = __esm({
  "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/utils/customEndpointFunctions.js"() {
    init_import_meta_url();
    customEndpointFunctions = {};
  }
});

// ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/debug/debugId.js
var debugId;
var init_debugId = __esm({
  "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/debug/debugId.js"() {
    init_import_meta_url();
    debugId = "endpoints";
  }
});

// ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/debug/toDebugString.js
function toDebugString(input) {
  if (typeof input !== "object" || input == null) {
    return input;
  }
  if ("ref" in input) {
    return `$${toDebugString(input.ref)}`;
  }
  if ("fn" in input) {
    return `${input.fn}(${(input.argv || []).map(toDebugString).join(", ")})`;
  }
  return JSON.stringify(input, null, 2);
}
var init_toDebugString = __esm({
  "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/debug/toDebugString.js"() {
    init_import_meta_url();
    __name(toDebugString, "toDebugString");
  }
});

// ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/debug/index.js
var init_debug = __esm({
  "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/debug/index.js"() {
    init_import_meta_url();
    init_debugId();
    init_toDebugString();
  }
});

// ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/types/EndpointError.js
var EndpointError;
var init_EndpointError = __esm({
  "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/types/EndpointError.js"() {
    init_import_meta_url();
    EndpointError = class extends Error {
      static {
        __name(this, "EndpointError");
      }
      constructor(message) {
        super(message);
        this.name = "EndpointError";
      }
    };
  }
});

// ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/types/EndpointFunctions.js
var init_EndpointFunctions = __esm({
  "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/types/EndpointFunctions.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/types/EndpointRuleObject.js
var init_EndpointRuleObject2 = __esm({
  "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/types/EndpointRuleObject.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/types/ErrorRuleObject.js
var init_ErrorRuleObject2 = __esm({
  "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/types/ErrorRuleObject.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/types/RuleSetObject.js
var init_RuleSetObject2 = __esm({
  "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/types/RuleSetObject.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/types/TreeRuleObject.js
var init_TreeRuleObject2 = __esm({
  "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/types/TreeRuleObject.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/types/shared.js
var init_shared4 = __esm({
  "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/types/shared.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/types/index.js
var init_types9 = __esm({
  "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/types/index.js"() {
    init_import_meta_url();
    init_EndpointError();
    init_EndpointFunctions();
    init_EndpointRuleObject2();
    init_ErrorRuleObject2();
    init_RuleSetObject2();
    init_TreeRuleObject2();
    init_shared4();
  }
});

// ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/lib/booleanEquals.js
var booleanEquals;
var init_booleanEquals = __esm({
  "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/lib/booleanEquals.js"() {
    init_import_meta_url();
    booleanEquals = /* @__PURE__ */ __name((value1, value2) => value1 === value2, "booleanEquals");
  }
});

// ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/lib/getAttrPathList.js
var getAttrPathList;
var init_getAttrPathList = __esm({
  "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/lib/getAttrPathList.js"() {
    init_import_meta_url();
    init_types9();
    getAttrPathList = /* @__PURE__ */ __name((path84) => {
      const parts = path84.split(".");
      const pathList = [];
      for (const part of parts) {
        const squareBracketIndex = part.indexOf("[");
        if (squareBracketIndex !== -1) {
          if (part.indexOf("]") !== part.length - 1) {
            throw new EndpointError(`Path: '${path84}' does not end with ']'`);
          }
          const arrayIndex = part.slice(squareBracketIndex + 1, -1);
          if (Number.isNaN(parseInt(arrayIndex))) {
            throw new EndpointError(`Invalid array index: '${arrayIndex}' in path: '${path84}'`);
          }
          if (squareBracketIndex !== 0) {
            pathList.push(part.slice(0, squareBracketIndex));
          }
          pathList.push(arrayIndex);
        } else {
          pathList.push(part);
        }
      }
      return pathList;
    }, "getAttrPathList");
  }
});

// ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/lib/getAttr.js
var getAttr;
var init_getAttr = __esm({
  "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/lib/getAttr.js"() {
    init_import_meta_url();
    init_types9();
    init_getAttrPathList();
    getAttr = /* @__PURE__ */ __name((value, path84) => getAttrPathList(path84).reduce((acc, index) => {
      if (typeof acc !== "object") {
        throw new EndpointError(`Index '${index}' in '${path84}' not found in '${JSON.stringify(value)}'`);
      } else if (Array.isArray(acc)) {
        return acc[parseInt(index)];
      }
      return acc[index];
    }, value), "getAttr");
  }
});

// ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/lib/isSet.js
var isSet;
var init_isSet = __esm({
  "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/lib/isSet.js"() {
    init_import_meta_url();
    isSet = /* @__PURE__ */ __name((value) => value != null, "isSet");
  }
});

// ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/lib/not.js
var not;
var init_not = __esm({
  "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/lib/not.js"() {
    init_import_meta_url();
    not = /* @__PURE__ */ __name((value) => !value, "not");
  }
});

// ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/lib/parseURL.js
var DEFAULT_PORTS, parseURL2;
var init_parseURL = __esm({
  "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/lib/parseURL.js"() {
    init_import_meta_url();
    init_dist_es();
    init_isIpAddress();
    DEFAULT_PORTS = {
      [EndpointURLScheme.HTTP]: 80,
      [EndpointURLScheme.HTTPS]: 443
    };
    parseURL2 = /* @__PURE__ */ __name((value) => {
      const whatwgURL = (() => {
        try {
          if (value instanceof URL) {
            return value;
          }
          if (typeof value === "object" && "hostname" in value) {
            const { hostname: hostname3, port, protocol: protocol2 = "", path: path84 = "", query = {} } = value;
            const url4 = new URL(`${protocol2}//${hostname3}${port ? `:${port}` : ""}${path84}`);
            url4.search = Object.entries(query).map(([k7, v8]) => `${k7}=${v8}`).join("&");
            return url4;
          }
          return new URL(value);
        } catch (error2) {
          return null;
        }
      })();
      if (!whatwgURL) {
        console.error(`Unable to parse ${JSON.stringify(value)} as a whatwg URL.`);
        return null;
      }
      const urlString = whatwgURL.href;
      const { host, hostname: hostname2, pathname, protocol, search } = whatwgURL;
      if (search) {
        return null;
      }
      const scheme = protocol.slice(0, -1);
      if (!Object.values(EndpointURLScheme).includes(scheme)) {
        return null;
      }
      const isIp = isIpAddress(hostname2);
      const inputContainsDefaultPort = urlString.includes(`${host}:${DEFAULT_PORTS[scheme]}`) || typeof value === "string" && value.includes(`${host}:${DEFAULT_PORTS[scheme]}`);
      const authority = `${host}${inputContainsDefaultPort ? `:${DEFAULT_PORTS[scheme]}` : ``}`;
      return {
        scheme,
        authority,
        path: pathname,
        normalizedPath: pathname.endsWith("/") ? pathname : `${pathname}/`,
        isIp
      };
    }, "parseURL");
  }
});

// ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/lib/stringEquals.js
var stringEquals;
var init_stringEquals = __esm({
  "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/lib/stringEquals.js"() {
    init_import_meta_url();
    stringEquals = /* @__PURE__ */ __name((value1, value2) => value1 === value2, "stringEquals");
  }
});

// ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/lib/substring.js
var substring;
var init_substring = __esm({
  "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/lib/substring.js"() {
    init_import_meta_url();
    substring = /* @__PURE__ */ __name((input, start, stop, reverse) => {
      if (start >= stop || input.length < stop) {
        return null;
      }
      if (!reverse) {
        return input.substring(start, stop);
      }
      return input.substring(input.length - stop, input.length - start);
    }, "substring");
  }
});

// ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/lib/uriEncode.js
var uriEncode;
var init_uriEncode = __esm({
  "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/lib/uriEncode.js"() {
    init_import_meta_url();
    uriEncode = /* @__PURE__ */ __name((value) => encodeURIComponent(value).replace(/[!*'()]/g, (c8) => `%${c8.charCodeAt(0).toString(16).toUpperCase()}`), "uriEncode");
  }
});

// ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/lib/index.js
var init_lib7 = __esm({
  "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/lib/index.js"() {
    init_import_meta_url();
    init_booleanEquals();
    init_getAttr();
    init_isSet();
    init_isValidHostLabel();
    init_not();
    init_parseURL();
    init_stringEquals();
    init_substring();
    init_uriEncode();
  }
});

// ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/utils/endpointFunctions.js
var endpointFunctions;
var init_endpointFunctions = __esm({
  "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/utils/endpointFunctions.js"() {
    init_import_meta_url();
    init_lib7();
    endpointFunctions = {
      booleanEquals,
      getAttr,
      isSet,
      isValidHostLabel,
      not,
      parseURL: parseURL2,
      stringEquals,
      substring,
      uriEncode
    };
  }
});

// ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateTemplate.js
var evaluateTemplate;
var init_evaluateTemplate = __esm({
  "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateTemplate.js"() {
    init_import_meta_url();
    init_lib7();
    evaluateTemplate = /* @__PURE__ */ __name((template, options) => {
      const evaluatedTemplateArr = [];
      const templateContext = {
        ...options.endpointParams,
        ...options.referenceRecord
      };
      let currentIndex = 0;
      while (currentIndex < template.length) {
        const openingBraceIndex = template.indexOf("{", currentIndex);
        if (openingBraceIndex === -1) {
          evaluatedTemplateArr.push(template.slice(currentIndex));
          break;
        }
        evaluatedTemplateArr.push(template.slice(currentIndex, openingBraceIndex));
        const closingBraceIndex = template.indexOf("}", openingBraceIndex);
        if (closingBraceIndex === -1) {
          evaluatedTemplateArr.push(template.slice(openingBraceIndex));
          break;
        }
        if (template[openingBraceIndex + 1] === "{" && template[closingBraceIndex + 1] === "}") {
          evaluatedTemplateArr.push(template.slice(openingBraceIndex + 1, closingBraceIndex));
          currentIndex = closingBraceIndex + 2;
        }
        const parameterName = template.substring(openingBraceIndex + 1, closingBraceIndex);
        if (parameterName.includes("#")) {
          const [refName, attrName] = parameterName.split("#");
          evaluatedTemplateArr.push(getAttr(templateContext[refName], attrName));
        } else {
          evaluatedTemplateArr.push(templateContext[parameterName]);
        }
        currentIndex = closingBraceIndex + 1;
      }
      return evaluatedTemplateArr.join("");
    }, "evaluateTemplate");
  }
});

// ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/utils/getReferenceValue.js
var getReferenceValue;
var init_getReferenceValue = __esm({
  "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/utils/getReferenceValue.js"() {
    init_import_meta_url();
    getReferenceValue = /* @__PURE__ */ __name(({ ref }, options) => {
      const referenceRecord = {
        ...options.endpointParams,
        ...options.referenceRecord
      };
      return referenceRecord[ref];
    }, "getReferenceValue");
  }
});

// ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateExpression.js
var evaluateExpression;
var init_evaluateExpression = __esm({
  "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateExpression.js"() {
    init_import_meta_url();
    init_types9();
    init_callFunction();
    init_evaluateTemplate();
    init_getReferenceValue();
    evaluateExpression = /* @__PURE__ */ __name((obj, keyName, options) => {
      if (typeof obj === "string") {
        return evaluateTemplate(obj, options);
      } else if (obj["fn"]) {
        return callFunction(obj, options);
      } else if (obj["ref"]) {
        return getReferenceValue(obj, options);
      }
      throw new EndpointError(`'${keyName}': ${String(obj)} is not a string, function or reference.`);
    }, "evaluateExpression");
  }
});

// ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/utils/callFunction.js
var callFunction;
var init_callFunction = __esm({
  "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/utils/callFunction.js"() {
    init_import_meta_url();
    init_customEndpointFunctions();
    init_endpointFunctions();
    init_evaluateExpression();
    callFunction = /* @__PURE__ */ __name(({ fn: fn2, argv }, options) => {
      const evaluatedArgs = argv.map((arg) => ["boolean", "number"].includes(typeof arg) ? arg : evaluateExpression(arg, "arg", options));
      const fnSegments = fn2.split(".");
      if (fnSegments[0] in customEndpointFunctions && fnSegments[1] != null) {
        return customEndpointFunctions[fnSegments[0]][fnSegments[1]](...evaluatedArgs);
      }
      return endpointFunctions[fn2](...evaluatedArgs);
    }, "callFunction");
  }
});

// ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateCondition.js
var evaluateCondition;
var init_evaluateCondition = __esm({
  "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateCondition.js"() {
    init_import_meta_url();
    init_debug();
    init_types9();
    init_callFunction();
    evaluateCondition = /* @__PURE__ */ __name(({ assign, ...fnArgs }, options) => {
      if (assign && assign in options.referenceRecord) {
        throw new EndpointError(`'${assign}' is already defined in Reference Record.`);
      }
      const value = callFunction(fnArgs, options);
      options.logger?.debug?.(`${debugId} evaluateCondition: ${toDebugString(fnArgs)} = ${toDebugString(value)}`);
      return {
        result: value === "" ? true : !!value,
        ...assign != null && { toAssign: { name: assign, value } }
      };
    }, "evaluateCondition");
  }
});

// ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateConditions.js
var evaluateConditions;
var init_evaluateConditions = __esm({
  "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateConditions.js"() {
    init_import_meta_url();
    init_debug();
    init_evaluateCondition();
    evaluateConditions = /* @__PURE__ */ __name((conditions = [], options) => {
      const conditionsReferenceRecord = {};
      for (const condition of conditions) {
        const { result, toAssign } = evaluateCondition(condition, {
          ...options,
          referenceRecord: {
            ...options.referenceRecord,
            ...conditionsReferenceRecord
          }
        });
        if (!result) {
          return { result };
        }
        if (toAssign) {
          conditionsReferenceRecord[toAssign.name] = toAssign.value;
          options.logger?.debug?.(`${debugId} assign: ${toAssign.name} := ${toDebugString(toAssign.value)}`);
        }
      }
      return { result: true, referenceRecord: conditionsReferenceRecord };
    }, "evaluateConditions");
  }
});

// ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/utils/getEndpointHeaders.js
var getEndpointHeaders;
var init_getEndpointHeaders = __esm({
  "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/utils/getEndpointHeaders.js"() {
    init_import_meta_url();
    init_types9();
    init_evaluateExpression();
    getEndpointHeaders = /* @__PURE__ */ __name((headers, options) => Object.entries(headers).reduce((acc, [headerKey, headerVal]) => ({
      ...acc,
      [headerKey]: headerVal.map((headerValEntry) => {
        const processedExpr = evaluateExpression(headerValEntry, "Header value entry", options);
        if (typeof processedExpr !== "string") {
          throw new EndpointError(`Header '${headerKey}' value '${processedExpr}' is not a string`);
        }
        return processedExpr;
      })
    }), {}), "getEndpointHeaders");
  }
});

// ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/utils/getEndpointProperty.js
var getEndpointProperty;
var init_getEndpointProperty = __esm({
  "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/utils/getEndpointProperty.js"() {
    init_import_meta_url();
    init_types9();
    init_evaluateTemplate();
    init_getEndpointProperties();
    getEndpointProperty = /* @__PURE__ */ __name((property, options) => {
      if (Array.isArray(property)) {
        return property.map((propertyEntry) => getEndpointProperty(propertyEntry, options));
      }
      switch (typeof property) {
        case "string":
          return evaluateTemplate(property, options);
        case "object":
          if (property === null) {
            throw new EndpointError(`Unexpected endpoint property: ${property}`);
          }
          return getEndpointProperties(property, options);
        case "boolean":
          return property;
        default:
          throw new EndpointError(`Unexpected endpoint property type: ${typeof property}`);
      }
    }, "getEndpointProperty");
  }
});

// ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/utils/getEndpointProperties.js
var getEndpointProperties;
var init_getEndpointProperties = __esm({
  "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/utils/getEndpointProperties.js"() {
    init_import_meta_url();
    init_getEndpointProperty();
    getEndpointProperties = /* @__PURE__ */ __name((properties, options) => Object.entries(properties).reduce((acc, [propertyKey, propertyVal]) => ({
      ...acc,
      [propertyKey]: getEndpointProperty(propertyVal, options)
    }), {}), "getEndpointProperties");
  }
});

// ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/utils/getEndpointUrl.js
var getEndpointUrl;
var init_getEndpointUrl = __esm({
  "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/utils/getEndpointUrl.js"() {
    init_import_meta_url();
    init_types9();
    init_evaluateExpression();
    getEndpointUrl = /* @__PURE__ */ __name((endpointUrl, options) => {
      const expression = evaluateExpression(endpointUrl, "Endpoint URL", options);
      if (typeof expression === "string") {
        try {
          return new URL(expression);
        } catch (error2) {
          console.error(`Failed to construct URL with ${expression}`, error2);
          throw error2;
        }
      }
      throw new EndpointError(`Endpoint URL must be a string, got ${typeof expression}`);
    }, "getEndpointUrl");
  }
});

// ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateEndpointRule.js
var evaluateEndpointRule;
var init_evaluateEndpointRule = __esm({
  "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateEndpointRule.js"() {
    init_import_meta_url();
    init_debug();
    init_evaluateConditions();
    init_getEndpointHeaders();
    init_getEndpointProperties();
    init_getEndpointUrl();
    evaluateEndpointRule = /* @__PURE__ */ __name((endpointRule, options) => {
      const { conditions, endpoint } = endpointRule;
      const { result, referenceRecord } = evaluateConditions(conditions, options);
      if (!result) {
        return;
      }
      const endpointRuleOptions = {
        ...options,
        referenceRecord: { ...options.referenceRecord, ...referenceRecord }
      };
      const { url: url4, properties, headers } = endpoint;
      options.logger?.debug?.(`${debugId} Resolving endpoint from template: ${toDebugString(endpoint)}`);
      return {
        ...headers != void 0 && {
          headers: getEndpointHeaders(headers, endpointRuleOptions)
        },
        ...properties != void 0 && {
          properties: getEndpointProperties(properties, endpointRuleOptions)
        },
        url: getEndpointUrl(url4, endpointRuleOptions)
      };
    }, "evaluateEndpointRule");
  }
});

// ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateErrorRule.js
var evaluateErrorRule;
var init_evaluateErrorRule = __esm({
  "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateErrorRule.js"() {
    init_import_meta_url();
    init_types9();
    init_evaluateConditions();
    init_evaluateExpression();
    evaluateErrorRule = /* @__PURE__ */ __name((errorRule, options) => {
      const { conditions, error: error2 } = errorRule;
      const { result, referenceRecord } = evaluateConditions(conditions, options);
      if (!result) {
        return;
      }
      throw new EndpointError(evaluateExpression(error2, "Error", {
        ...options,
        referenceRecord: { ...options.referenceRecord, ...referenceRecord }
      }));
    }, "evaluateErrorRule");
  }
});

// ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateTreeRule.js
var evaluateTreeRule;
var init_evaluateTreeRule = __esm({
  "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateTreeRule.js"() {
    init_import_meta_url();
    init_evaluateConditions();
    init_evaluateRules();
    evaluateTreeRule = /* @__PURE__ */ __name((treeRule, options) => {
      const { conditions, rules } = treeRule;
      const { result, referenceRecord } = evaluateConditions(conditions, options);
      if (!result) {
        return;
      }
      return evaluateRules(rules, {
        ...options,
        referenceRecord: { ...options.referenceRecord, ...referenceRecord }
      });
    }, "evaluateTreeRule");
  }
});

// ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateRules.js
var evaluateRules;
var init_evaluateRules = __esm({
  "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateRules.js"() {
    init_import_meta_url();
    init_types9();
    init_evaluateEndpointRule();
    init_evaluateErrorRule();
    init_evaluateTreeRule();
    evaluateRules = /* @__PURE__ */ __name((rules, options) => {
      for (const rule of rules) {
        if (rule.type === "endpoint") {
          const endpointOrUndefined = evaluateEndpointRule(rule, options);
          if (endpointOrUndefined) {
            return endpointOrUndefined;
          }
        } else if (rule.type === "error") {
          evaluateErrorRule(rule, options);
        } else if (rule.type === "tree") {
          const endpointOrUndefined = evaluateTreeRule(rule, options);
          if (endpointOrUndefined) {
            return endpointOrUndefined;
          }
        } else {
          throw new EndpointError(`Unknown endpoint rule: ${rule}`);
        }
      }
      throw new EndpointError(`Rules evaluation failed`);
    }, "evaluateRules");
  }
});

// ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/utils/index.js
var init_utils14 = __esm({
  "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/utils/index.js"() {
    init_import_meta_url();
    init_customEndpointFunctions();
    init_evaluateRules();
  }
});

// ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/resolveEndpoint.js
var resolveEndpoint;
var init_resolveEndpoint = __esm({
  "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/resolveEndpoint.js"() {
    init_import_meta_url();
    init_debug();
    init_types9();
    init_utils14();
    resolveEndpoint = /* @__PURE__ */ __name((ruleSetObject, options) => {
      const { endpointParams, logger: logger4 } = options;
      const { parameters, rules } = ruleSetObject;
      options.logger?.debug?.(`${debugId} Initial EndpointParams: ${toDebugString(endpointParams)}`);
      const paramsWithDefault = Object.entries(parameters).filter(([, v8]) => v8.default != null).map(([k7, v8]) => [k7, v8.default]);
      if (paramsWithDefault.length > 0) {
        for (const [paramKey, paramDefaultValue] of paramsWithDefault) {
          endpointParams[paramKey] = endpointParams[paramKey] ?? paramDefaultValue;
        }
      }
      const requiredParams = Object.entries(parameters).filter(([, v8]) => v8.required).map(([k7]) => k7);
      for (const requiredParam of requiredParams) {
        if (endpointParams[requiredParam] == null) {
          throw new EndpointError(`Missing required parameter: '${requiredParam}'`);
        }
      }
      const endpoint = evaluateRules(rules, { endpointParams, logger: logger4, referenceRecord: {} });
      options.logger?.debug?.(`${debugId} Resolved endpoint: ${toDebugString(endpoint)}`);
      return endpoint;
    }, "resolveEndpoint");
  }
});

// ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/index.js
var init_dist_es32 = __esm({
  "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/index.js"() {
    init_import_meta_url();
    init_EndpointCache();
    init_isIpAddress();
    init_isValidHostLabel();
    init_customEndpointFunctions();
    init_resolveEndpoint();
    init_types9();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.714.0/node_modules/@aws-sdk/util-endpoints/dist-es/lib/isIpAddress.js
var init_isIpAddress2 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.714.0/node_modules/@aws-sdk/util-endpoints/dist-es/lib/isIpAddress.js"() {
    init_import_meta_url();
    init_dist_es32();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.714.0/node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/isVirtualHostableS3Bucket.js
var isVirtualHostableS3Bucket;
var init_isVirtualHostableS3Bucket = __esm({
  "../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.714.0/node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/isVirtualHostableS3Bucket.js"() {
    init_import_meta_url();
    init_dist_es32();
    init_isIpAddress2();
    isVirtualHostableS3Bucket = /* @__PURE__ */ __name((value, allowSubDomains = false) => {
      if (allowSubDomains) {
        for (const label of value.split(".")) {
          if (!isVirtualHostableS3Bucket(label)) {
            return false;
          }
        }
        return true;
      }
      if (!isValidHostLabel(value)) {
        return false;
      }
      if (value.length < 3 || value.length > 63) {
        return false;
      }
      if (value !== value.toLowerCase()) {
        return false;
      }
      if (isIpAddress(value)) {
        return false;
      }
      return true;
    }, "isVirtualHostableS3Bucket");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.714.0/node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/parseArn.js
var ARN_DELIMITER, RESOURCE_DELIMITER, parseArn;
var init_parseArn = __esm({
  "../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.714.0/node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/parseArn.js"() {
    init_import_meta_url();
    ARN_DELIMITER = ":";
    RESOURCE_DELIMITER = "/";
    parseArn = /* @__PURE__ */ __name((value) => {
      const segments = value.split(ARN_DELIMITER);
      if (segments.length < 6)
        return null;
      const [arn, partition2, service, region, accountId, ...resourcePath] = segments;
      if (arn !== "arn" || partition2 === "" || service === "" || resourcePath.join(ARN_DELIMITER) === "")
        return null;
      const resourceId = resourcePath.map((resource) => resource.split(RESOURCE_DELIMITER)).flat();
      return {
        partition: partition2,
        service,
        region,
        accountId,
        resourceId
      };
    }, "parseArn");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.714.0/node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/partitions.json
var partitions_default;
var init_partitions = __esm({
  "../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.714.0/node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/partitions.json"() {
    partitions_default = {
      partitions: [{
        id: "aws",
        outputs: {
          dnsSuffix: "amazonaws.com",
          dualStackDnsSuffix: "api.aws",
          implicitGlobalRegion: "us-east-1",
          name: "aws",
          supportsDualStack: true,
          supportsFIPS: true
        },
        regionRegex: "^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$",
        regions: {
          "af-south-1": {
            description: "Africa (Cape Town)"
          },
          "ap-east-1": {
            description: "Asia Pacific (Hong Kong)"
          },
          "ap-northeast-1": {
            description: "Asia Pacific (Tokyo)"
          },
          "ap-northeast-2": {
            description: "Asia Pacific (Seoul)"
          },
          "ap-northeast-3": {
            description: "Asia Pacific (Osaka)"
          },
          "ap-south-1": {
            description: "Asia Pacific (Mumbai)"
          },
          "ap-south-2": {
            description: "Asia Pacific (Hyderabad)"
          },
          "ap-southeast-1": {
            description: "Asia Pacific (Singapore)"
          },
          "ap-southeast-2": {
            description: "Asia Pacific (Sydney)"
          },
          "ap-southeast-3": {
            description: "Asia Pacific (Jakarta)"
          },
          "ap-southeast-4": {
            description: "Asia Pacific (Melbourne)"
          },
          "ap-southeast-5": {
            description: "Asia Pacific (Malaysia)"
          },
          "aws-global": {
            description: "AWS Standard global region"
          },
          "ca-central-1": {
            description: "Canada (Central)"
          },
          "ca-west-1": {
            description: "Canada West (Calgary)"
          },
          "eu-central-1": {
            description: "Europe (Frankfurt)"
          },
          "eu-central-2": {
            description: "Europe (Zurich)"
          },
          "eu-north-1": {
            description: "Europe (Stockholm)"
          },
          "eu-south-1": {
            description: "Europe (Milan)"
          },
          "eu-south-2": {
            description: "Europe (Spain)"
          },
          "eu-west-1": {
            description: "Europe (Ireland)"
          },
          "eu-west-2": {
            description: "Europe (London)"
          },
          "eu-west-3": {
            description: "Europe (Paris)"
          },
          "il-central-1": {
            description: "Israel (Tel Aviv)"
          },
          "me-central-1": {
            description: "Middle East (UAE)"
          },
          "me-south-1": {
            description: "Middle East (Bahrain)"
          },
          "sa-east-1": {
            description: "South America (Sao Paulo)"
          },
          "us-east-1": {
            description: "US East (N. Virginia)"
          },
          "us-east-2": {
            description: "US East (Ohio)"
          },
          "us-west-1": {
            description: "US West (N. California)"
          },
          "us-west-2": {
            description: "US West (Oregon)"
          }
        }
      }, {
        id: "aws-cn",
        outputs: {
          dnsSuffix: "amazonaws.com.cn",
          dualStackDnsSuffix: "api.amazonwebservices.com.cn",
          implicitGlobalRegion: "cn-northwest-1",
          name: "aws-cn",
          supportsDualStack: true,
          supportsFIPS: true
        },
        regionRegex: "^cn\\-\\w+\\-\\d+$",
        regions: {
          "aws-cn-global": {
            description: "AWS China global region"
          },
          "cn-north-1": {
            description: "China (Beijing)"
          },
          "cn-northwest-1": {
            description: "China (Ningxia)"
          }
        }
      }, {
        id: "aws-us-gov",
        outputs: {
          dnsSuffix: "amazonaws.com",
          dualStackDnsSuffix: "api.aws",
          implicitGlobalRegion: "us-gov-west-1",
          name: "aws-us-gov",
          supportsDualStack: true,
          supportsFIPS: true
        },
        regionRegex: "^us\\-gov\\-\\w+\\-\\d+$",
        regions: {
          "aws-us-gov-global": {
            description: "AWS GovCloud (US) global region"
          },
          "us-gov-east-1": {
            description: "AWS GovCloud (US-East)"
          },
          "us-gov-west-1": {
            description: "AWS GovCloud (US-West)"
          }
        }
      }, {
        id: "aws-iso",
        outputs: {
          dnsSuffix: "c2s.ic.gov",
          dualStackDnsSuffix: "c2s.ic.gov",
          implicitGlobalRegion: "us-iso-east-1",
          name: "aws-iso",
          supportsDualStack: false,
          supportsFIPS: true
        },
        regionRegex: "^us\\-iso\\-\\w+\\-\\d+$",
        regions: {
          "aws-iso-global": {
            description: "AWS ISO (US) global region"
          },
          "us-iso-east-1": {
            description: "US ISO East"
          },
          "us-iso-west-1": {
            description: "US ISO WEST"
          }
        }
      }, {
        id: "aws-iso-b",
        outputs: {
          dnsSuffix: "sc2s.sgov.gov",
          dualStackDnsSuffix: "sc2s.sgov.gov",
          implicitGlobalRegion: "us-isob-east-1",
          name: "aws-iso-b",
          supportsDualStack: false,
          supportsFIPS: true
        },
        regionRegex: "^us\\-isob\\-\\w+\\-\\d+$",
        regions: {
          "aws-iso-b-global": {
            description: "AWS ISOB (US) global region"
          },
          "us-isob-east-1": {
            description: "US ISOB East (Ohio)"
          }
        }
      }, {
        id: "aws-iso-e",
        outputs: {
          dnsSuffix: "cloud.adc-e.uk",
          dualStackDnsSuffix: "cloud.adc-e.uk",
          implicitGlobalRegion: "eu-isoe-west-1",
          name: "aws-iso-e",
          supportsDualStack: false,
          supportsFIPS: true
        },
        regionRegex: "^eu\\-isoe\\-\\w+\\-\\d+$",
        regions: {
          "eu-isoe-west-1": {
            description: "EU ISOE West"
          }
        }
      }, {
        id: "aws-iso-f",
        outputs: {
          dnsSuffix: "csp.hci.ic.gov",
          dualStackDnsSuffix: "csp.hci.ic.gov",
          implicitGlobalRegion: "us-isof-south-1",
          name: "aws-iso-f",
          supportsDualStack: false,
          supportsFIPS: true
        },
        regionRegex: "^us\\-isof\\-\\w+\\-\\d+$",
        regions: {}
      }],
      version: "1.1"
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.714.0/node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/partition.js
var selectedPartitionsInfo, selectedUserAgentPrefix, partition, getUserAgentPrefix;
var init_partition = __esm({
  "../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.714.0/node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/partition.js"() {
    init_import_meta_url();
    init_partitions();
    selectedPartitionsInfo = partitions_default;
    selectedUserAgentPrefix = "";
    partition = /* @__PURE__ */ __name((value) => {
      const { partitions } = selectedPartitionsInfo;
      for (const partition2 of partitions) {
        const { regions, outputs } = partition2;
        for (const [region, regionData] of Object.entries(regions)) {
          if (region === value) {
            return {
              ...outputs,
              ...regionData
            };
          }
        }
      }
      for (const partition2 of partitions) {
        const { regionRegex, outputs } = partition2;
        if (new RegExp(regionRegex).test(value)) {
          return {
            ...outputs
          };
        }
      }
      const DEFAULT_PARTITION = partitions.find((partition2) => partition2.id === "aws");
      if (!DEFAULT_PARTITION) {
        throw new Error("Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist.");
      }
      return {
        ...DEFAULT_PARTITION.outputs
      };
    }, "partition");
    getUserAgentPrefix = /* @__PURE__ */ __name(() => selectedUserAgentPrefix, "getUserAgentPrefix");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.714.0/node_modules/@aws-sdk/util-endpoints/dist-es/aws.js
var awsEndpointFunctions;
var init_aws = __esm({
  "../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.714.0/node_modules/@aws-sdk/util-endpoints/dist-es/aws.js"() {
    init_import_meta_url();
    init_dist_es32();
    init_isVirtualHostableS3Bucket();
    init_parseArn();
    init_partition();
    awsEndpointFunctions = {
      isVirtualHostableS3Bucket,
      parseArn,
      partition
    };
    customEndpointFunctions.aws = awsEndpointFunctions;
  }
});

// ../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.714.0/node_modules/@aws-sdk/util-endpoints/dist-es/resolveEndpoint.js
var init_resolveEndpoint2 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.714.0/node_modules/@aws-sdk/util-endpoints/dist-es/resolveEndpoint.js"() {
    init_import_meta_url();
    init_dist_es32();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.714.0/node_modules/@aws-sdk/util-endpoints/dist-es/types/EndpointError.js
var init_EndpointError2 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.714.0/node_modules/@aws-sdk/util-endpoints/dist-es/types/EndpointError.js"() {
    init_import_meta_url();
    init_dist_es32();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.714.0/node_modules/@aws-sdk/util-endpoints/dist-es/types/EndpointRuleObject.js
var init_EndpointRuleObject3 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.714.0/node_modules/@aws-sdk/util-endpoints/dist-es/types/EndpointRuleObject.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.714.0/node_modules/@aws-sdk/util-endpoints/dist-es/types/ErrorRuleObject.js
var init_ErrorRuleObject3 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.714.0/node_modules/@aws-sdk/util-endpoints/dist-es/types/ErrorRuleObject.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.714.0/node_modules/@aws-sdk/util-endpoints/dist-es/types/RuleSetObject.js
var init_RuleSetObject3 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.714.0/node_modules/@aws-sdk/util-endpoints/dist-es/types/RuleSetObject.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.714.0/node_modules/@aws-sdk/util-endpoints/dist-es/types/TreeRuleObject.js
var init_TreeRuleObject3 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.714.0/node_modules/@aws-sdk/util-endpoints/dist-es/types/TreeRuleObject.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.714.0/node_modules/@aws-sdk/util-endpoints/dist-es/types/shared.js
var init_shared5 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.714.0/node_modules/@aws-sdk/util-endpoints/dist-es/types/shared.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.714.0/node_modules/@aws-sdk/util-endpoints/dist-es/types/index.js
var init_types10 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.714.0/node_modules/@aws-sdk/util-endpoints/dist-es/types/index.js"() {
    init_import_meta_url();
    init_EndpointError2();
    init_EndpointRuleObject3();
    init_ErrorRuleObject3();
    init_RuleSetObject3();
    init_TreeRuleObject3();
    init_shared5();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.714.0/node_modules/@aws-sdk/util-endpoints/dist-es/index.js
var init_dist_es33 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.714.0/node_modules/@aws-sdk/util-endpoints/dist-es/index.js"() {
    init_import_meta_url();
    init_aws();
    init_partition();
    init_isIpAddress2();
    init_resolveEndpoint2();
    init_types10();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+middleware-user-agent@3.721.0/node_modules/@aws-sdk/middleware-user-agent/dist-es/check-features.js
async function checkFeatures(context2, config, args) {
  const request4 = args.request;
  if (request4?.headers?.["smithy-protocol"] === "rpc-v2-cbor") {
    setFeature(context2, "PROTOCOL_RPC_V2_CBOR", "M");
  }
  if (typeof config.retryStrategy === "function") {
    const retryStrategy = await config.retryStrategy();
    if (typeof retryStrategy.acquireInitialRetryToken === "function") {
      if (retryStrategy.constructor?.name?.includes("Adaptive")) {
        setFeature(context2, "RETRY_MODE_ADAPTIVE", "F");
      } else {
        setFeature(context2, "RETRY_MODE_STANDARD", "E");
      }
    } else {
      setFeature(context2, "RETRY_MODE_LEGACY", "D");
    }
  }
  if (typeof config.accountIdEndpointMode === "function") {
    const endpointV2 = context2.endpointV2;
    if (String(endpointV2?.url?.hostname).match(ACCOUNT_ID_ENDPOINT_REGEX)) {
      setFeature(context2, "ACCOUNT_ID_ENDPOINT", "O");
    }
    switch (await config.accountIdEndpointMode?.()) {
      case "disabled":
        setFeature(context2, "ACCOUNT_ID_MODE_DISABLED", "Q");
        break;
      case "preferred":
        setFeature(context2, "ACCOUNT_ID_MODE_PREFERRED", "P");
        break;
      case "required":
        setFeature(context2, "ACCOUNT_ID_MODE_REQUIRED", "R");
        break;
    }
  }
  const identity = context2.__smithy_context?.selectedHttpAuthScheme?.identity;
  if (identity?.$source) {
    const credentials = identity;
    if (credentials.accountId) {
      setFeature(context2, "RESOLVED_ACCOUNT_ID", "T");
    }
    for (const [key, value] of Object.entries(credentials.$source ?? {})) {
      setFeature(context2, key, value);
    }
  }
}
var ACCOUNT_ID_ENDPOINT_REGEX;
var init_check_features = __esm({
  "../../node_modules/.pnpm/@aws-sdk+middleware-user-agent@3.721.0/node_modules/@aws-sdk/middleware-user-agent/dist-es/check-features.js"() {
    init_import_meta_url();
    init_dist_es21();
    ACCOUNT_ID_ENDPOINT_REGEX = /\d{12}\.ddb/;
    __name(checkFeatures, "checkFeatures");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+middleware-user-agent@3.721.0/node_modules/@aws-sdk/middleware-user-agent/dist-es/constants.js
var USER_AGENT, X_AMZ_USER_AGENT, SPACE, UA_NAME_SEPARATOR, UA_NAME_ESCAPE_REGEX, UA_VALUE_ESCAPE_REGEX, UA_ESCAPE_CHAR;
var init_constants13 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+middleware-user-agent@3.721.0/node_modules/@aws-sdk/middleware-user-agent/dist-es/constants.js"() {
    init_import_meta_url();
    USER_AGENT = "user-agent";
    X_AMZ_USER_AGENT = "x-amz-user-agent";
    SPACE = " ";
    UA_NAME_SEPARATOR = "/";
    UA_NAME_ESCAPE_REGEX = /[^\!\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w]/g;
    UA_VALUE_ESCAPE_REGEX = /[^\!\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w\#]/g;
    UA_ESCAPE_CHAR = "-";
  }
});

// ../../node_modules/.pnpm/@aws-sdk+middleware-user-agent@3.721.0/node_modules/@aws-sdk/middleware-user-agent/dist-es/encode-features.js
function encodeFeatures(features) {
  let buffer = "";
  for (const key in features) {
    const val2 = features[key];
    if (buffer.length + val2.length + 1 <= BYTE_LIMIT) {
      if (buffer.length) {
        buffer += "," + val2;
      } else {
        buffer += val2;
      }
      continue;
    }
    break;
  }
  return buffer;
}
var BYTE_LIMIT;
var init_encode_features = __esm({
  "../../node_modules/.pnpm/@aws-sdk+middleware-user-agent@3.721.0/node_modules/@aws-sdk/middleware-user-agent/dist-es/encode-features.js"() {
    init_import_meta_url();
    BYTE_LIMIT = 1024;
    __name(encodeFeatures, "encodeFeatures");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+middleware-user-agent@3.721.0/node_modules/@aws-sdk/middleware-user-agent/dist-es/user-agent-middleware.js
var userAgentMiddleware, escapeUserAgent, getUserAgentMiddlewareOptions, getUserAgentPlugin;
var init_user_agent_middleware = __esm({
  "../../node_modules/.pnpm/@aws-sdk+middleware-user-agent@3.721.0/node_modules/@aws-sdk/middleware-user-agent/dist-es/user-agent-middleware.js"() {
    init_import_meta_url();
    init_dist_es33();
    init_dist_es2();
    init_check_features();
    init_constants13();
    init_encode_features();
    userAgentMiddleware = /* @__PURE__ */ __name((options) => (next, context2) => async (args) => {
      const { request: request4 } = args;
      if (!HttpRequest.isInstance(request4)) {
        return next(args);
      }
      const { headers } = request4;
      const userAgent = context2?.userAgent?.map(escapeUserAgent) || [];
      const defaultUserAgent = (await options.defaultUserAgentProvider()).map(escapeUserAgent);
      await checkFeatures(context2, options, args);
      const awsContext = context2;
      defaultUserAgent.push(`m/${encodeFeatures(Object.assign({}, context2.__smithy_context?.features, awsContext.__aws_sdk_context?.features))}`);
      const customUserAgent = options?.customUserAgent?.map(escapeUserAgent) || [];
      const appId = await options.userAgentAppId();
      if (appId) {
        defaultUserAgent.push(escapeUserAgent([`app/${appId}`]));
      }
      const prefix = getUserAgentPrefix();
      const sdkUserAgentValue = (prefix ? [prefix] : []).concat([...defaultUserAgent, ...userAgent, ...customUserAgent]).join(SPACE);
      const normalUAValue = [
        ...defaultUserAgent.filter((section) => section.startsWith("aws-sdk-")),
        ...customUserAgent
      ].join(SPACE);
      if (options.runtime !== "browser") {
        if (normalUAValue) {
          headers[X_AMZ_USER_AGENT] = headers[X_AMZ_USER_AGENT] ? `${headers[USER_AGENT]} ${normalUAValue}` : normalUAValue;
        }
        headers[USER_AGENT] = sdkUserAgentValue;
      } else {
        headers[X_AMZ_USER_AGENT] = sdkUserAgentValue;
      }
      return next({
        ...args,
        request: request4
      });
    }, "userAgentMiddleware");
    escapeUserAgent = /* @__PURE__ */ __name((userAgentPair) => {
      const name2 = userAgentPair[0].split(UA_NAME_SEPARATOR).map((part) => part.replace(UA_NAME_ESCAPE_REGEX, UA_ESCAPE_CHAR)).join(UA_NAME_SEPARATOR);
      const version5 = userAgentPair[1]?.replace(UA_VALUE_ESCAPE_REGEX, UA_ESCAPE_CHAR);
      const prefixSeparatorIndex = name2.indexOf(UA_NAME_SEPARATOR);
      const prefix = name2.substring(0, prefixSeparatorIndex);
      let uaName = name2.substring(prefixSeparatorIndex + 1);
      if (prefix === "api") {
        uaName = uaName.toLowerCase();
      }
      return [prefix, uaName, version5].filter((item) => item && item.length > 0).reduce((acc, item, index) => {
        switch (index) {
          case 0:
            return item;
          case 1:
            return `${acc}/${item}`;
          default:
            return `${acc}#${item}`;
        }
      }, "");
    }, "escapeUserAgent");
    getUserAgentMiddlewareOptions = {
      name: "getUserAgentMiddleware",
      step: "build",
      priority: "low",
      tags: ["SET_USER_AGENT", "USER_AGENT"],
      override: true
    };
    getUserAgentPlugin = /* @__PURE__ */ __name((config) => ({
      applyToStack: /* @__PURE__ */ __name((clientStack) => {
        clientStack.add(userAgentMiddleware(config), getUserAgentMiddlewareOptions);
      }, "applyToStack")
    }), "getUserAgentPlugin");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+middleware-user-agent@3.721.0/node_modules/@aws-sdk/middleware-user-agent/dist-es/index.js
var init_dist_es34 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+middleware-user-agent@3.721.0/node_modules/@aws-sdk/middleware-user-agent/dist-es/index.js"() {
    init_import_meta_url();
    init_configurations4();
    init_user_agent_middleware();
  }
});

// ../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/endpointsConfig/NodeUseDualstackEndpointConfigOptions.js
var ENV_USE_DUALSTACK_ENDPOINT, CONFIG_USE_DUALSTACK_ENDPOINT, NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS;
var init_NodeUseDualstackEndpointConfigOptions = __esm({
  "../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/endpointsConfig/NodeUseDualstackEndpointConfigOptions.js"() {
    init_import_meta_url();
    init_dist_es29();
    ENV_USE_DUALSTACK_ENDPOINT = "AWS_USE_DUALSTACK_ENDPOINT";
    CONFIG_USE_DUALSTACK_ENDPOINT = "use_dualstack_endpoint";
    NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS = {
      environmentVariableSelector: /* @__PURE__ */ __name((env6) => booleanSelector(env6, ENV_USE_DUALSTACK_ENDPOINT, SelectorType2.ENV), "environmentVariableSelector"),
      configFileSelector: /* @__PURE__ */ __name((profile) => booleanSelector(profile, CONFIG_USE_DUALSTACK_ENDPOINT, SelectorType2.CONFIG), "configFileSelector"),
      default: false
    };
  }
});

// ../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/endpointsConfig/NodeUseFipsEndpointConfigOptions.js
var ENV_USE_FIPS_ENDPOINT, CONFIG_USE_FIPS_ENDPOINT, NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS;
var init_NodeUseFipsEndpointConfigOptions = __esm({
  "../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/endpointsConfig/NodeUseFipsEndpointConfigOptions.js"() {
    init_import_meta_url();
    init_dist_es29();
    ENV_USE_FIPS_ENDPOINT = "AWS_USE_FIPS_ENDPOINT";
    CONFIG_USE_FIPS_ENDPOINT = "use_fips_endpoint";
    NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS = {
      environmentVariableSelector: /* @__PURE__ */ __name((env6) => booleanSelector(env6, ENV_USE_FIPS_ENDPOINT, SelectorType2.ENV), "environmentVariableSelector"),
      configFileSelector: /* @__PURE__ */ __name((profile) => booleanSelector(profile, CONFIG_USE_FIPS_ENDPOINT, SelectorType2.CONFIG), "configFileSelector"),
      default: false
    };
  }
});

// ../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/endpointsConfig/resolveCustomEndpointsConfig.js
var init_resolveCustomEndpointsConfig = __esm({
  "../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/endpointsConfig/resolveCustomEndpointsConfig.js"() {
    init_import_meta_url();
    init_dist_es4();
  }
});

// ../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/endpointsConfig/utils/getEndpointFromRegion.js
var init_getEndpointFromRegion = __esm({
  "../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/endpointsConfig/utils/getEndpointFromRegion.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/endpointsConfig/resolveEndpointsConfig.js
var init_resolveEndpointsConfig = __esm({
  "../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/endpointsConfig/resolveEndpointsConfig.js"() {
    init_import_meta_url();
    init_dist_es4();
    init_getEndpointFromRegion();
  }
});

// ../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/endpointsConfig/index.js
var init_endpointsConfig = __esm({
  "../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/endpointsConfig/index.js"() {
    init_import_meta_url();
    init_NodeUseDualstackEndpointConfigOptions();
    init_NodeUseFipsEndpointConfigOptions();
    init_resolveCustomEndpointsConfig();
    init_resolveEndpointsConfig();
  }
});

// ../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/regionConfig/config.js
var REGION_ENV_NAME, REGION_INI_NAME, NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS;
var init_config9 = __esm({
  "../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/regionConfig/config.js"() {
    init_import_meta_url();
    REGION_ENV_NAME = "AWS_REGION";
    REGION_INI_NAME = "region";
    NODE_REGION_CONFIG_OPTIONS = {
      environmentVariableSelector: /* @__PURE__ */ __name((env6) => env6[REGION_ENV_NAME], "environmentVariableSelector"),
      configFileSelector: /* @__PURE__ */ __name((profile) => profile[REGION_INI_NAME], "configFileSelector"),
      default: /* @__PURE__ */ __name(() => {
        throw new Error("Region is missing");
      }, "default")
    };
    NODE_REGION_CONFIG_FILE_OPTIONS = {
      preferredFile: "credentials"
    };
  }
});

// ../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/regionConfig/isFipsRegion.js
var isFipsRegion;
var init_isFipsRegion = __esm({
  "../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/regionConfig/isFipsRegion.js"() {
    init_import_meta_url();
    isFipsRegion = /* @__PURE__ */ __name((region) => typeof region === "string" && (region.startsWith("fips-") || region.endsWith("-fips")), "isFipsRegion");
  }
});

// ../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/regionConfig/getRealRegion.js
var getRealRegion;
var init_getRealRegion = __esm({
  "../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/regionConfig/getRealRegion.js"() {
    init_import_meta_url();
    init_isFipsRegion();
    getRealRegion = /* @__PURE__ */ __name((region) => isFipsRegion(region) ? ["fips-aws-global", "aws-fips"].includes(region) ? "us-east-1" : region.replace(/fips-(dkr-|prod-)?|-fips/, "") : region, "getRealRegion");
  }
});

// ../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/regionConfig/resolveRegionConfig.js
var resolveRegionConfig;
var init_resolveRegionConfig = __esm({
  "../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/regionConfig/resolveRegionConfig.js"() {
    init_import_meta_url();
    init_getRealRegion();
    init_isFipsRegion();
    resolveRegionConfig = /* @__PURE__ */ __name((input) => {
      const { region, useFipsEndpoint } = input;
      if (!region) {
        throw new Error("Region is missing");
      }
      return {
        ...input,
        region: /* @__PURE__ */ __name(async () => {
          if (typeof region === "string") {
            return getRealRegion(region);
          }
          const providedRegion = await region();
          return getRealRegion(providedRegion);
        }, "region"),
        useFipsEndpoint: /* @__PURE__ */ __name(async () => {
          const providedRegion = typeof region === "string" ? region : await region();
          if (isFipsRegion(providedRegion)) {
            return true;
          }
          return typeof useFipsEndpoint !== "function" ? Promise.resolve(!!useFipsEndpoint) : useFipsEndpoint();
        }, "useFipsEndpoint")
      };
    }, "resolveRegionConfig");
  }
});

// ../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/regionConfig/index.js
var init_regionConfig = __esm({
  "../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/regionConfig/index.js"() {
    init_import_meta_url();
    init_config9();
    init_resolveRegionConfig();
  }
});

// ../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/regionInfo/PartitionHash.js
var init_PartitionHash = __esm({
  "../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/regionInfo/PartitionHash.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/regionInfo/RegionHash.js
var init_RegionHash = __esm({
  "../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/regionInfo/RegionHash.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/regionInfo/getHostnameFromVariants.js
var init_getHostnameFromVariants = __esm({
  "../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/regionInfo/getHostnameFromVariants.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/regionInfo/getResolvedHostname.js
var init_getResolvedHostname = __esm({
  "../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/regionInfo/getResolvedHostname.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/regionInfo/getResolvedPartition.js
var init_getResolvedPartition = __esm({
  "../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/regionInfo/getResolvedPartition.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/regionInfo/getResolvedSigningRegion.js
var init_getResolvedSigningRegion = __esm({
  "../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/regionInfo/getResolvedSigningRegion.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/regionInfo/getRegionInfo.js
var init_getRegionInfo = __esm({
  "../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/regionInfo/getRegionInfo.js"() {
    init_import_meta_url();
    init_getHostnameFromVariants();
    init_getResolvedHostname();
    init_getResolvedPartition();
    init_getResolvedSigningRegion();
  }
});

// ../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/regionInfo/index.js
var init_regionInfo = __esm({
  "../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/regionInfo/index.js"() {
    init_import_meta_url();
    init_PartitionHash();
    init_RegionHash();
    init_getRegionInfo();
  }
});

// ../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/index.js
var init_dist_es35 = __esm({
  "../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/index.js"() {
    init_import_meta_url();
    init_endpointsConfig();
    init_regionConfig();
    init_regionInfo();
  }
});

// ../../node_modules/.pnpm/@smithy+eventstream-serde-config-resolver@3.0.11/node_modules/@smithy/eventstream-serde-config-resolver/dist-es/EventStreamSerdeConfig.js
var resolveEventStreamSerdeConfig;
var init_EventStreamSerdeConfig = __esm({
  "../../node_modules/.pnpm/@smithy+eventstream-serde-config-resolver@3.0.11/node_modules/@smithy/eventstream-serde-config-resolver/dist-es/EventStreamSerdeConfig.js"() {
    init_import_meta_url();
    resolveEventStreamSerdeConfig = /* @__PURE__ */ __name((input) => ({
      ...input,
      eventStreamMarshaller: input.eventStreamSerdeProvider(input)
    }), "resolveEventStreamSerdeConfig");
  }
});

// ../../node_modules/.pnpm/@smithy+eventstream-serde-config-resolver@3.0.11/node_modules/@smithy/eventstream-serde-config-resolver/dist-es/index.js
var init_dist_es36 = __esm({
  "../../node_modules/.pnpm/@smithy+eventstream-serde-config-resolver@3.0.11/node_modules/@smithy/eventstream-serde-config-resolver/dist-es/index.js"() {
    init_import_meta_url();
    init_EventStreamSerdeConfig();
  }
});

// ../../node_modules/.pnpm/@smithy+middleware-content-length@3.0.13/node_modules/@smithy/middleware-content-length/dist-es/index.js
function contentLengthMiddleware(bodyLengthChecker) {
  return (next) => async (args) => {
    const request4 = args.request;
    if (HttpRequest.isInstance(request4)) {
      const { body, headers } = request4;
      if (body && Object.keys(headers).map((str) => str.toLowerCase()).indexOf(CONTENT_LENGTH_HEADER2) === -1) {
        try {
          const length = bodyLengthChecker(body);
          request4.headers = {
            ...request4.headers,
            [CONTENT_LENGTH_HEADER2]: String(length)
          };
        } catch (error2) {
        }
      }
    }
    return next({
      ...args,
      request: request4
    });
  };
}
var CONTENT_LENGTH_HEADER2, contentLengthMiddlewareOptions, getContentLengthPlugin;
var init_dist_es37 = __esm({
  "../../node_modules/.pnpm/@smithy+middleware-content-length@3.0.13/node_modules/@smithy/middleware-content-length/dist-es/index.js"() {
    init_import_meta_url();
    init_dist_es2();
    CONTENT_LENGTH_HEADER2 = "content-length";
    __name(contentLengthMiddleware, "contentLengthMiddleware");
    contentLengthMiddlewareOptions = {
      step: "build",
      tags: ["SET_CONTENT_LENGTH", "CONTENT_LENGTH"],
      name: "contentLengthMiddleware",
      override: true
    };
    getContentLengthPlugin = /* @__PURE__ */ __name((options) => ({
      applyToStack: /* @__PURE__ */ __name((clientStack) => {
        clientStack.add(contentLengthMiddleware(options.bodyLengthChecker), contentLengthMiddlewareOptions);
      }, "applyToStack")
    }), "getContentLengthPlugin");
  }
});

// ../../node_modules/.pnpm/@smithy+middleware-endpoint@3.2.8/node_modules/@smithy/middleware-endpoint/dist-es/service-customizations/s3.js
var resolveParamsForS3, DOMAIN_PATTERN, IP_ADDRESS_PATTERN, DOTS_PATTERN, isDnsCompatibleBucketName, isArnBucketName;
var init_s3 = __esm({
  "../../node_modules/.pnpm/@smithy+middleware-endpoint@3.2.8/node_modules/@smithy/middleware-endpoint/dist-es/service-customizations/s3.js"() {
    init_import_meta_url();
    resolveParamsForS3 = /* @__PURE__ */ __name(async (endpointParams) => {
      const bucket = endpointParams?.Bucket || "";
      if (typeof endpointParams.Bucket === "string") {
        endpointParams.Bucket = bucket.replace(/#/g, encodeURIComponent("#")).replace(/\?/g, encodeURIComponent("?"));
      }
      if (isArnBucketName(bucket)) {
        if (endpointParams.ForcePathStyle === true) {
          throw new Error("Path-style addressing cannot be used with ARN buckets");
        }
      } else if (!isDnsCompatibleBucketName(bucket) || bucket.indexOf(".") !== -1 && !String(endpointParams.Endpoint).startsWith("http:") || bucket.toLowerCase() !== bucket || bucket.length < 3) {
        endpointParams.ForcePathStyle = true;
      }
      if (endpointParams.DisableMultiRegionAccessPoints) {
        endpointParams.disableMultiRegionAccessPoints = true;
        endpointParams.DisableMRAP = true;
      }
      return endpointParams;
    }, "resolveParamsForS3");
    DOMAIN_PATTERN = /^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/;
    IP_ADDRESS_PATTERN = /(\d+\.){3}\d+/;
    DOTS_PATTERN = /\.\./;
    isDnsCompatibleBucketName = /* @__PURE__ */ __name((bucketName) => DOMAIN_PATTERN.test(bucketName) && !IP_ADDRESS_PATTERN.test(bucketName) && !DOTS_PATTERN.test(bucketName), "isDnsCompatibleBucketName");
    isArnBucketName = /* @__PURE__ */ __name((bucketName) => {
      const [arn, partition2, service, , , bucket] = bucketName.split(":");
      const isArn = arn === "arn" && bucketName.split(":").length >= 6;
      const isValidArn = Boolean(isArn && partition2 && service && bucket);
      if (isArn && !isValidArn) {
        throw new Error(`Invalid ARN: ${bucketName} was an invalid ARN.`);
      }
      return isValidArn;
    }, "isArnBucketName");
  }
});

// ../../node_modules/.pnpm/@smithy+middleware-endpoint@3.2.8/node_modules/@smithy/middleware-endpoint/dist-es/service-customizations/index.js
var init_service_customizations = __esm({
  "../../node_modules/.pnpm/@smithy+middleware-endpoint@3.2.8/node_modules/@smithy/middleware-endpoint/dist-es/service-customizations/index.js"() {
    init_import_meta_url();
    init_s3();
  }
});

// ../../node_modules/.pnpm/@smithy+middleware-endpoint@3.2.8/node_modules/@smithy/middleware-endpoint/dist-es/adaptors/createConfigValueProvider.js
var createConfigValueProvider;
var init_createConfigValueProvider = __esm({
  "../../node_modules/.pnpm/@smithy+middleware-endpoint@3.2.8/node_modules/@smithy/middleware-endpoint/dist-es/adaptors/createConfigValueProvider.js"() {
    init_import_meta_url();
    createConfigValueProvider = /* @__PURE__ */ __name((configKey, canonicalEndpointParamKey, config) => {
      const configProvider = /* @__PURE__ */ __name(async () => {
        const configValue = config[configKey] ?? config[canonicalEndpointParamKey];
        if (typeof configValue === "function") {
          return configValue();
        }
        return configValue;
      }, "configProvider");
      if (configKey === "credentialScope" || canonicalEndpointParamKey === "CredentialScope") {
        return async () => {
          const credentials = typeof config.credentials === "function" ? await config.credentials() : config.credentials;
          const configValue = credentials?.credentialScope ?? credentials?.CredentialScope;
          return configValue;
        };
      }
      if (configKey === "accountId" || canonicalEndpointParamKey === "AccountId") {
        return async () => {
          const credentials = typeof config.credentials === "function" ? await config.credentials() : config.credentials;
          const configValue = credentials?.accountId ?? credentials?.AccountId;
          return configValue;
        };
      }
      if (configKey === "endpoint" || canonicalEndpointParamKey === "endpoint") {
        return async () => {
          const endpoint = await configProvider();
          if (endpoint && typeof endpoint === "object") {
            if ("url" in endpoint) {
              return endpoint.url.href;
            }
            if ("hostname" in endpoint) {
              const { protocol, hostname: hostname2, port, path: path84 } = endpoint;
              return `${protocol}//${hostname2}${port ? ":" + port : ""}${path84}`;
            }
          }
          return endpoint;
        };
      }
      return configProvider;
    }, "createConfigValueProvider");
  }
});

// ../../node_modules/.pnpm/@smithy+node-config-provider@3.1.12/node_modules/@smithy/node-config-provider/dist-es/getSelectorName.js
function getSelectorName(functionString) {
  try {
    const constants5 = new Set(Array.from(functionString.match(/([A-Z_]){3,}/g) ?? []));
    constants5.delete("CONFIG");
    constants5.delete("CONFIG_PREFIX_SEPARATOR");
    constants5.delete("ENV");
    return [...constants5].join(", ");
  } catch (e10) {
    return functionString;
  }
}
var init_getSelectorName = __esm({
  "../../node_modules/.pnpm/@smithy+node-config-provider@3.1.12/node_modules/@smithy/node-config-provider/dist-es/getSelectorName.js"() {
    init_import_meta_url();
    __name(getSelectorName, "getSelectorName");
  }
});

// ../../node_modules/.pnpm/@smithy+node-config-provider@3.1.12/node_modules/@smithy/node-config-provider/dist-es/fromEnv.js
var fromEnv;
var init_fromEnv = __esm({
  "../../node_modules/.pnpm/@smithy+node-config-provider@3.1.12/node_modules/@smithy/node-config-provider/dist-es/fromEnv.js"() {
    init_import_meta_url();
    init_dist_es17();
    init_getSelectorName();
    fromEnv = /* @__PURE__ */ __name((envVarSelector, logger4) => async () => {
      try {
        const config = envVarSelector(process.env);
        if (config === void 0) {
          throw new Error();
        }
        return config;
      } catch (e10) {
        throw new CredentialsProviderError(e10.message || `Not found in ENV: ${getSelectorName(envVarSelector.toString())}`, { logger: logger4 });
      }
    }, "fromEnv");
  }
});
var homeDirCache, getHomeDirCacheKey, getHomeDir;
var init_getHomeDir = __esm({
  "../../node_modules/.pnpm/@smithy+shared-ini-file-loader@3.1.12/node_modules/@smithy/shared-ini-file-loader/dist-es/getHomeDir.js"() {
    init_import_meta_url();
    homeDirCache = {};
    getHomeDirCacheKey = /* @__PURE__ */ __name(() => {
      if (process && process.geteuid) {
        return `${process.geteuid()}`;
      }
      return "DEFAULT";
    }, "getHomeDirCacheKey");
    getHomeDir = /* @__PURE__ */ __name(() => {
      const { HOME, USERPROFILE, HOMEPATH, HOMEDRIVE = `C:${path3.sep}` } = process.env;
      if (HOME)
        return HOME;
      if (USERPROFILE)
        return USERPROFILE;
      if (HOMEPATH)
        return `${HOMEDRIVE}${HOMEPATH}`;
      const homeDirCacheKey = getHomeDirCacheKey();
      if (!homeDirCache[homeDirCacheKey])
        homeDirCache[homeDirCacheKey] = os11.homedir();
      return homeDirCache[homeDirCacheKey];
    }, "getHomeDir");
  }
});

// ../../node_modules/.pnpm/@smithy+shared-ini-file-loader@3.1.12/node_modules/@smithy/shared-ini-file-loader/dist-es/getProfileName.js
var ENV_PROFILE, DEFAULT_PROFILE, getProfileName;
var init_getProfileName = __esm({
  "../../node_modules/.pnpm/@smithy+shared-ini-file-loader@3.1.12/node_modules/@smithy/shared-ini-file-loader/dist-es/getProfileName.js"() {
    init_import_meta_url();
    ENV_PROFILE = "AWS_PROFILE";
    DEFAULT_PROFILE = "default";
    getProfileName = /* @__PURE__ */ __name((init4) => init4.profile || process.env[ENV_PROFILE] || DEFAULT_PROFILE, "getProfileName");
  }
});
var getSSOTokenFilepath;
var init_getSSOTokenFilepath = __esm({
  "../../node_modules/.pnpm/@smithy+shared-ini-file-loader@3.1.12/node_modules/@smithy/shared-ini-file-loader/dist-es/getSSOTokenFilepath.js"() {
    init_import_meta_url();
    init_getHomeDir();
    getSSOTokenFilepath = /* @__PURE__ */ __name((id) => {
      const hasher = crypto2.createHash("sha1");
      const cacheName = hasher.update(id).digest("hex");
      return path3.join(getHomeDir(), ".aws", "sso", "cache", `${cacheName}.json`);
    }, "getSSOTokenFilepath");
  }
});
var readFile14, getSSOTokenFromFile;
var init_getSSOTokenFromFile = __esm({
  "../../node_modules/.pnpm/@smithy+shared-ini-file-loader@3.1.12/node_modules/@smithy/shared-ini-file-loader/dist-es/getSSOTokenFromFile.js"() {
    init_import_meta_url();
    init_getSSOTokenFilepath();
    ({ readFile: readFile14 } = fs29.promises);
    getSSOTokenFromFile = /* @__PURE__ */ __name(async (id) => {
      const ssoTokenFilepath = getSSOTokenFilepath(id);
      const ssoTokenText = await readFile14(ssoTokenFilepath, "utf8");
      return JSON.parse(ssoTokenText);
    }, "getSSOTokenFromFile");
  }
});

// ../../node_modules/.pnpm/@smithy+shared-ini-file-loader@3.1.12/node_modules/@smithy/shared-ini-file-loader/dist-es/getConfigData.js
var getConfigData;
var init_getConfigData = __esm({
  "../../node_modules/.pnpm/@smithy+shared-ini-file-loader@3.1.12/node_modules/@smithy/shared-ini-file-loader/dist-es/getConfigData.js"() {
    init_import_meta_url();
    init_dist_es();
    init_loadSharedConfigFiles();
    getConfigData = /* @__PURE__ */ __name((data) => Object.entries(data).filter(([key]) => {
      const indexOfSeparator = key.indexOf(CONFIG_PREFIX_SEPARATOR);
      if (indexOfSeparator === -1) {
        return false;
      }
      return Object.values(IniSectionType).includes(key.substring(0, indexOfSeparator));
    }).reduce((acc, [key, value]) => {
      const indexOfSeparator = key.indexOf(CONFIG_PREFIX_SEPARATOR);
      const updatedKey = key.substring(0, indexOfSeparator) === IniSectionType.PROFILE ? key.substring(indexOfSeparator + 1) : key;
      acc[updatedKey] = value;
      return acc;
    }, {
      ...data.default && { default: data.default }
    }), "getConfigData");
  }
});
var ENV_CONFIG_PATH, getConfigFilepath;
var init_getConfigFilepath = __esm({
  "../../node_modules/.pnpm/@smithy+shared-ini-file-loader@3.1.12/node_modules/@smithy/shared-ini-file-loader/dist-es/getConfigFilepath.js"() {
    init_import_meta_url();
    init_getHomeDir();
    ENV_CONFIG_PATH = "AWS_CONFIG_FILE";
    getConfigFilepath = /* @__PURE__ */ __name(() => process.env[ENV_CONFIG_PATH] || path3.join(getHomeDir(), ".aws", "config"), "getConfigFilepath");
  }
});
var ENV_CREDENTIALS_PATH, getCredentialsFilepath;
var init_getCredentialsFilepath = __esm({
  "../../node_modules/.pnpm/@smithy+shared-ini-file-loader@3.1.12/node_modules/@smithy/shared-ini-file-loader/dist-es/getCredentialsFilepath.js"() {
    init_import_meta_url();
    init_getHomeDir();
    ENV_CREDENTIALS_PATH = "AWS_SHARED_CREDENTIALS_FILE";
    getCredentialsFilepath = /* @__PURE__ */ __name(() => process.env[ENV_CREDENTIALS_PATH] || path3.join(getHomeDir(), ".aws", "credentials"), "getCredentialsFilepath");
  }
});

// ../../node_modules/.pnpm/@smithy+shared-ini-file-loader@3.1.12/node_modules/@smithy/shared-ini-file-loader/dist-es/parseIni.js
var prefixKeyRegex, profileNameBlockList, parseIni;
var init_parseIni = __esm({
  "../../node_modules/.pnpm/@smithy+shared-ini-file-loader@3.1.12/node_modules/@smithy/shared-ini-file-loader/dist-es/parseIni.js"() {
    init_import_meta_url();
    init_dist_es();
    init_loadSharedConfigFiles();
    prefixKeyRegex = /^([\w-]+)\s(["'])?([\w-@\+\.%:/]+)\2$/;
    profileNameBlockList = ["__proto__", "profile __proto__"];
    parseIni = /* @__PURE__ */ __name((iniData) => {
      const map2 = {};
      let currentSection;
      let currentSubSection;
      for (const iniLine of iniData.split(/\r?\n/)) {
        const trimmedLine = iniLine.split(/(^|\s)[;#]/)[0].trim();
        const isSection = trimmedLine[0] === "[" && trimmedLine[trimmedLine.length - 1] === "]";
        if (isSection) {
          currentSection = void 0;
          currentSubSection = void 0;
          const sectionName = trimmedLine.substring(1, trimmedLine.length - 1);
          const matches = prefixKeyRegex.exec(sectionName);
          if (matches) {
            const [, prefix, , name2] = matches;
            if (Object.values(IniSectionType).includes(prefix)) {
              currentSection = [prefix, name2].join(CONFIG_PREFIX_SEPARATOR);
            }
          } else {
            currentSection = sectionName;
          }
          if (profileNameBlockList.includes(sectionName)) {
            throw new Error(`Found invalid profile name "${sectionName}"`);
          }
        } else if (currentSection) {
          const indexOfEqualsSign = trimmedLine.indexOf("=");
          if (![0, -1].includes(indexOfEqualsSign)) {
            const [name2, value] = [
              trimmedLine.substring(0, indexOfEqualsSign).trim(),
              trimmedLine.substring(indexOfEqualsSign + 1).trim()
            ];
            if (value === "") {
              currentSubSection = name2;
            } else {
              if (currentSubSection && iniLine.trimStart() === iniLine) {
                currentSubSection = void 0;
              }
              map2[currentSection] = map2[currentSection] || {};
              const key = currentSubSection ? [currentSubSection, name2].join(CONFIG_PREFIX_SEPARATOR) : name2;
              map2[currentSection][key] = value;
            }
          }
        }
      }
      return map2;
    }, "parseIni");
  }
});
var readFile15, filePromisesHash, slurpFile;
var init_slurpFile = __esm({
  "../../node_modules/.pnpm/@smithy+shared-ini-file-loader@3.1.12/node_modules/@smithy/shared-ini-file-loader/dist-es/slurpFile.js"() {
    init_import_meta_url();
    ({ readFile: readFile15 } = fs29.promises);
    filePromisesHash = {};
    slurpFile = /* @__PURE__ */ __name((path84, options) => {
      if (!filePromisesHash[path84] || options?.ignoreCache) {
        filePromisesHash[path84] = readFile15(path84, "utf8");
      }
      return filePromisesHash[path84];
    }, "slurpFile");
  }
});
var swallowError, CONFIG_PREFIX_SEPARATOR, loadSharedConfigFiles;
var init_loadSharedConfigFiles = __esm({
  "../../node_modules/.pnpm/@smithy+shared-ini-file-loader@3.1.12/node_modules/@smithy/shared-ini-file-loader/dist-es/loadSharedConfigFiles.js"() {
    init_import_meta_url();
    init_getConfigData();
    init_getConfigFilepath();
    init_getCredentialsFilepath();
    init_getHomeDir();
    init_parseIni();
    init_slurpFile();
    swallowError = /* @__PURE__ */ __name(() => ({}), "swallowError");
    CONFIG_PREFIX_SEPARATOR = ".";
    loadSharedConfigFiles = /* @__PURE__ */ __name(async (init4 = {}) => {
      const { filepath = getCredentialsFilepath(), configFilepath = getConfigFilepath() } = init4;
      const homeDir = getHomeDir();
      const relativeHomeDirPrefix = "~/";
      let resolvedFilepath = filepath;
      if (filepath.startsWith(relativeHomeDirPrefix)) {
        resolvedFilepath = path3.join(homeDir, filepath.slice(2));
      }
      let resolvedConfigFilepath = configFilepath;
      if (configFilepath.startsWith(relativeHomeDirPrefix)) {
        resolvedConfigFilepath = path3.join(homeDir, configFilepath.slice(2));
      }
      const parsedFiles = await Promise.all([
        slurpFile(resolvedConfigFilepath, {
          ignoreCache: init4.ignoreCache
        }).then(parseIni).then(getConfigData).catch(swallowError),
        slurpFile(resolvedFilepath, {
          ignoreCache: init4.ignoreCache
        }).then(parseIni).catch(swallowError)
      ]);
      return {
        configFile: parsedFiles[0],
        credentialsFile: parsedFiles[1]
      };
    }, "loadSharedConfigFiles");
  }
});

// ../../node_modules/.pnpm/@smithy+shared-ini-file-loader@3.1.12/node_modules/@smithy/shared-ini-file-loader/dist-es/getSsoSessionData.js
var getSsoSessionData;
var init_getSsoSessionData = __esm({
  "../../node_modules/.pnpm/@smithy+shared-ini-file-loader@3.1.12/node_modules/@smithy/shared-ini-file-loader/dist-es/getSsoSessionData.js"() {
    init_import_meta_url();
    init_dist_es();
    init_loadSharedConfigFiles();
    getSsoSessionData = /* @__PURE__ */ __name((data) => Object.entries(data).filter(([key]) => key.startsWith(IniSectionType.SSO_SESSION + CONFIG_PREFIX_SEPARATOR)).reduce((acc, [key, value]) => ({ ...acc, [key.substring(key.indexOf(CONFIG_PREFIX_SEPARATOR) + 1)]: value }), {}), "getSsoSessionData");
  }
});

// ../../node_modules/.pnpm/@smithy+shared-ini-file-loader@3.1.12/node_modules/@smithy/shared-ini-file-loader/dist-es/loadSsoSessionData.js
var swallowError2, loadSsoSessionData;
var init_loadSsoSessionData = __esm({
  "../../node_modules/.pnpm/@smithy+shared-ini-file-loader@3.1.12/node_modules/@smithy/shared-ini-file-loader/dist-es/loadSsoSessionData.js"() {
    init_import_meta_url();
    init_getConfigFilepath();
    init_getSsoSessionData();
    init_parseIni();
    init_slurpFile();
    swallowError2 = /* @__PURE__ */ __name(() => ({}), "swallowError");
    loadSsoSessionData = /* @__PURE__ */ __name(async (init4 = {}) => slurpFile(init4.configFilepath ?? getConfigFilepath()).then(parseIni).then(getSsoSessionData).catch(swallowError2), "loadSsoSessionData");
  }
});

// ../../node_modules/.pnpm/@smithy+shared-ini-file-loader@3.1.12/node_modules/@smithy/shared-ini-file-loader/dist-es/mergeConfigFiles.js
var mergeConfigFiles;
var init_mergeConfigFiles = __esm({
  "../../node_modules/.pnpm/@smithy+shared-ini-file-loader@3.1.12/node_modules/@smithy/shared-ini-file-loader/dist-es/mergeConfigFiles.js"() {
    init_import_meta_url();
    mergeConfigFiles = /* @__PURE__ */ __name((...files) => {
      const merged = {};
      for (const file3 of files) {
        for (const [key, values] of Object.entries(file3)) {
          if (merged[key] !== void 0) {
            Object.assign(merged[key], values);
          } else {
            merged[key] = values;
          }
        }
      }
      return merged;
    }, "mergeConfigFiles");
  }
});

// ../../node_modules/.pnpm/@smithy+shared-ini-file-loader@3.1.12/node_modules/@smithy/shared-ini-file-loader/dist-es/parseKnownFiles.js
var parseKnownFiles;
var init_parseKnownFiles = __esm({
  "../../node_modules/.pnpm/@smithy+shared-ini-file-loader@3.1.12/node_modules/@smithy/shared-ini-file-loader/dist-es/parseKnownFiles.js"() {
    init_import_meta_url();
    init_loadSharedConfigFiles();
    init_mergeConfigFiles();
    parseKnownFiles = /* @__PURE__ */ __name(async (init4) => {
      const parsedFiles = await loadSharedConfigFiles(init4);
      return mergeConfigFiles(parsedFiles.configFile, parsedFiles.credentialsFile);
    }, "parseKnownFiles");
  }
});

// ../../node_modules/.pnpm/@smithy+shared-ini-file-loader@3.1.12/node_modules/@smithy/shared-ini-file-loader/dist-es/types.js
var init_types11 = __esm({
  "../../node_modules/.pnpm/@smithy+shared-ini-file-loader@3.1.12/node_modules/@smithy/shared-ini-file-loader/dist-es/types.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+shared-ini-file-loader@3.1.12/node_modules/@smithy/shared-ini-file-loader/dist-es/index.js
var init_dist_es38 = __esm({
  "../../node_modules/.pnpm/@smithy+shared-ini-file-loader@3.1.12/node_modules/@smithy/shared-ini-file-loader/dist-es/index.js"() {
    init_import_meta_url();
    init_getHomeDir();
    init_getProfileName();
    init_getSSOTokenFilepath();
    init_getSSOTokenFromFile();
    init_loadSharedConfigFiles();
    init_loadSsoSessionData();
    init_parseKnownFiles();
    init_types11();
  }
});

// ../../node_modules/.pnpm/@smithy+node-config-provider@3.1.12/node_modules/@smithy/node-config-provider/dist-es/fromSharedConfigFiles.js
var fromSharedConfigFiles;
var init_fromSharedConfigFiles = __esm({
  "../../node_modules/.pnpm/@smithy+node-config-provider@3.1.12/node_modules/@smithy/node-config-provider/dist-es/fromSharedConfigFiles.js"() {
    init_import_meta_url();
    init_dist_es17();
    init_dist_es38();
    init_getSelectorName();
    fromSharedConfigFiles = /* @__PURE__ */ __name((configSelector, { preferredFile = "config", ...init4 } = {}) => async () => {
      const profile = getProfileName(init4);
      const { configFile, credentialsFile } = await loadSharedConfigFiles(init4);
      const profileFromCredentials = credentialsFile[profile] || {};
      const profileFromConfig = configFile[profile] || {};
      const mergedProfile = preferredFile === "config" ? { ...profileFromCredentials, ...profileFromConfig } : { ...profileFromConfig, ...profileFromCredentials };
      try {
        const cfgFile = preferredFile === "config" ? configFile : credentialsFile;
        const configValue = configSelector(mergedProfile, cfgFile);
        if (configValue === void 0) {
          throw new Error();
        }
        return configValue;
      } catch (e10) {
        throw new CredentialsProviderError(e10.message || `Not found in config files w/ profile [${profile}]: ${getSelectorName(configSelector.toString())}`, { logger: init4.logger });
      }
    }, "fromSharedConfigFiles");
  }
});

// ../../node_modules/.pnpm/@smithy+node-config-provider@3.1.12/node_modules/@smithy/node-config-provider/dist-es/fromStatic.js
var isFunction4, fromStatic2;
var init_fromStatic2 = __esm({
  "../../node_modules/.pnpm/@smithy+node-config-provider@3.1.12/node_modules/@smithy/node-config-provider/dist-es/fromStatic.js"() {
    init_import_meta_url();
    init_dist_es17();
    isFunction4 = /* @__PURE__ */ __name((func) => typeof func === "function", "isFunction");
    fromStatic2 = /* @__PURE__ */ __name((defaultValue) => isFunction4(defaultValue) ? async () => await defaultValue() : fromStatic(defaultValue), "fromStatic");
  }
});

// ../../node_modules/.pnpm/@smithy+node-config-provider@3.1.12/node_modules/@smithy/node-config-provider/dist-es/configLoader.js
var loadConfig;
var init_configLoader = __esm({
  "../../node_modules/.pnpm/@smithy+node-config-provider@3.1.12/node_modules/@smithy/node-config-provider/dist-es/configLoader.js"() {
    init_import_meta_url();
    init_dist_es17();
    init_fromEnv();
    init_fromSharedConfigFiles();
    init_fromStatic2();
    loadConfig = /* @__PURE__ */ __name(({ environmentVariableSelector, configFileSelector, default: defaultValue }, configuration = {}) => memoize(chain(fromEnv(environmentVariableSelector), fromSharedConfigFiles(configFileSelector, configuration), fromStatic2(defaultValue))), "loadConfig");
  }
});

// ../../node_modules/.pnpm/@smithy+node-config-provider@3.1.12/node_modules/@smithy/node-config-provider/dist-es/index.js
var init_dist_es39 = __esm({
  "../../node_modules/.pnpm/@smithy+node-config-provider@3.1.12/node_modules/@smithy/node-config-provider/dist-es/index.js"() {
    init_import_meta_url();
    init_configLoader();
  }
});

// ../../node_modules/.pnpm/@smithy+middleware-endpoint@3.2.8/node_modules/@smithy/middleware-endpoint/dist-es/adaptors/getEndpointUrlConfig.js
var ENV_ENDPOINT_URL, CONFIG_ENDPOINT_URL, getEndpointUrlConfig;
var init_getEndpointUrlConfig = __esm({
  "../../node_modules/.pnpm/@smithy+middleware-endpoint@3.2.8/node_modules/@smithy/middleware-endpoint/dist-es/adaptors/getEndpointUrlConfig.js"() {
    init_import_meta_url();
    init_dist_es38();
    ENV_ENDPOINT_URL = "AWS_ENDPOINT_URL";
    CONFIG_ENDPOINT_URL = "endpoint_url";
    getEndpointUrlConfig = /* @__PURE__ */ __name((serviceId) => ({
      environmentVariableSelector: /* @__PURE__ */ __name((env6) => {
        const serviceSuffixParts = serviceId.split(" ").map((w7) => w7.toUpperCase());
        const serviceEndpointUrl = env6[[ENV_ENDPOINT_URL, ...serviceSuffixParts].join("_")];
        if (serviceEndpointUrl)
          return serviceEndpointUrl;
        const endpointUrl = env6[ENV_ENDPOINT_URL];
        if (endpointUrl)
          return endpointUrl;
        return void 0;
      }, "environmentVariableSelector"),
      configFileSelector: /* @__PURE__ */ __name((profile, config) => {
        if (config && profile.services) {
          const servicesSection = config[["services", profile.services].join(CONFIG_PREFIX_SEPARATOR)];
          if (servicesSection) {
            const servicePrefixParts = serviceId.split(" ").map((w7) => w7.toLowerCase());
            const endpointUrl2 = servicesSection[[servicePrefixParts.join("_"), CONFIG_ENDPOINT_URL].join(CONFIG_PREFIX_SEPARATOR)];
            if (endpointUrl2)
              return endpointUrl2;
          }
        }
        const endpointUrl = profile[CONFIG_ENDPOINT_URL];
        if (endpointUrl)
          return endpointUrl;
        return void 0;
      }, "configFileSelector"),
      default: void 0
    }), "getEndpointUrlConfig");
  }
});

// ../../node_modules/.pnpm/@smithy+middleware-endpoint@3.2.8/node_modules/@smithy/middleware-endpoint/dist-es/adaptors/getEndpointFromConfig.js
var getEndpointFromConfig;
var init_getEndpointFromConfig = __esm({
  "../../node_modules/.pnpm/@smithy+middleware-endpoint@3.2.8/node_modules/@smithy/middleware-endpoint/dist-es/adaptors/getEndpointFromConfig.js"() {
    init_import_meta_url();
    init_dist_es39();
    init_getEndpointUrlConfig();
    getEndpointFromConfig = /* @__PURE__ */ __name(async (serviceId) => loadConfig(getEndpointUrlConfig(serviceId ?? ""))(), "getEndpointFromConfig");
  }
});

// ../../node_modules/.pnpm/@smithy+querystring-parser@3.0.11/node_modules/@smithy/querystring-parser/dist-es/index.js
function parseQueryString(querystring) {
  const query = {};
  querystring = querystring.replace(/^\?/, "");
  if (querystring) {
    for (const pair of querystring.split("&")) {
      let [key, value = null] = pair.split("=");
      key = decodeURIComponent(key);
      if (value) {
        value = decodeURIComponent(value);
      }
      if (!(key in query)) {
        query[key] = value;
      } else if (Array.isArray(query[key])) {
        query[key].push(value);
      } else {
        query[key] = [query[key], value];
      }
    }
  }
  return query;
}
var init_dist_es40 = __esm({
  "../../node_modules/.pnpm/@smithy+querystring-parser@3.0.11/node_modules/@smithy/querystring-parser/dist-es/index.js"() {
    init_import_meta_url();
    __name(parseQueryString, "parseQueryString");
  }
});

// ../../node_modules/.pnpm/@smithy+url-parser@3.0.11/node_modules/@smithy/url-parser/dist-es/index.js
var parseUrl2;
var init_dist_es41 = __esm({
  "../../node_modules/.pnpm/@smithy+url-parser@3.0.11/node_modules/@smithy/url-parser/dist-es/index.js"() {
    init_import_meta_url();
    init_dist_es40();
    parseUrl2 = /* @__PURE__ */ __name((url4) => {
      if (typeof url4 === "string") {
        return parseUrl2(new URL(url4));
      }
      const { hostname: hostname2, pathname, port, protocol, search } = url4;
      let query;
      if (search) {
        query = parseQueryString(search);
      }
      return {
        hostname: hostname2,
        port: port ? parseInt(port) : void 0,
        protocol,
        path: pathname,
        query
      };
    }, "parseUrl");
  }
});

// ../../node_modules/.pnpm/@smithy+middleware-endpoint@3.2.8/node_modules/@smithy/middleware-endpoint/dist-es/adaptors/toEndpointV1.js
var toEndpointV1;
var init_toEndpointV1 = __esm({
  "../../node_modules/.pnpm/@smithy+middleware-endpoint@3.2.8/node_modules/@smithy/middleware-endpoint/dist-es/adaptors/toEndpointV1.js"() {
    init_import_meta_url();
    init_dist_es41();
    toEndpointV1 = /* @__PURE__ */ __name((endpoint) => {
      if (typeof endpoint === "object") {
        if ("url" in endpoint) {
          return parseUrl2(endpoint.url);
        }
        return endpoint;
      }
      return parseUrl2(endpoint);
    }, "toEndpointV1");
  }
});

// ../../node_modules/.pnpm/@smithy+middleware-endpoint@3.2.8/node_modules/@smithy/middleware-endpoint/dist-es/adaptors/getEndpointFromInstructions.js
var getEndpointFromInstructions, resolveParams;
var init_getEndpointFromInstructions = __esm({
  "../../node_modules/.pnpm/@smithy+middleware-endpoint@3.2.8/node_modules/@smithy/middleware-endpoint/dist-es/adaptors/getEndpointFromInstructions.js"() {
    init_import_meta_url();
    init_service_customizations();
    init_createConfigValueProvider();
    init_getEndpointFromConfig();
    init_toEndpointV1();
    getEndpointFromInstructions = /* @__PURE__ */ __name(async (commandInput, instructionsSupplier, clientConfig, context2) => {
      if (!clientConfig.endpoint) {
        let endpointFromConfig;
        if (clientConfig.serviceConfiguredEndpoint) {
          endpointFromConfig = await clientConfig.serviceConfiguredEndpoint();
        } else {
          endpointFromConfig = await getEndpointFromConfig(clientConfig.serviceId);
        }
        if (endpointFromConfig) {
          clientConfig.endpoint = () => Promise.resolve(toEndpointV1(endpointFromConfig));
        }
      }
      const endpointParams = await resolveParams(commandInput, instructionsSupplier, clientConfig);
      if (typeof clientConfig.endpointProvider !== "function") {
        throw new Error("config.endpointProvider is not set.");
      }
      const endpoint = clientConfig.endpointProvider(endpointParams, context2);
      return endpoint;
    }, "getEndpointFromInstructions");
    resolveParams = /* @__PURE__ */ __name(async (commandInput, instructionsSupplier, clientConfig) => {
      const endpointParams = {};
      const instructions = instructionsSupplier?.getEndpointParameterInstructions?.() || {};
      for (const [name2, instruction] of Object.entries(instructions)) {
        switch (instruction.type) {
          case "staticContextParams":
            endpointParams[name2] = instruction.value;
            break;
          case "contextParams":
            endpointParams[name2] = commandInput[instruction.name];
            break;
          case "clientContextParams":
          case "builtInParams":
            endpointParams[name2] = await createConfigValueProvider(instruction.name, name2, clientConfig)();
            break;
          case "operationContextParams":
            endpointParams[name2] = instruction.get(commandInput);
            break;
          default:
            throw new Error("Unrecognized endpoint parameter instruction: " + JSON.stringify(instruction));
        }
      }
      if (Object.keys(instructions).length === 0) {
        Object.assign(endpointParams, clientConfig);
      }
      if (String(clientConfig.serviceId).toLowerCase() === "s3") {
        await resolveParamsForS3(endpointParams);
      }
      return endpointParams;
    }, "resolveParams");
  }
});

// ../../node_modules/.pnpm/@smithy+middleware-endpoint@3.2.8/node_modules/@smithy/middleware-endpoint/dist-es/adaptors/index.js
var init_adaptors = __esm({
  "../../node_modules/.pnpm/@smithy+middleware-endpoint@3.2.8/node_modules/@smithy/middleware-endpoint/dist-es/adaptors/index.js"() {
    init_import_meta_url();
    init_getEndpointFromInstructions();
    init_toEndpointV1();
  }
});

// ../../node_modules/.pnpm/@smithy+middleware-endpoint@3.2.8/node_modules/@smithy/middleware-endpoint/dist-es/endpointMiddleware.js
var endpointMiddleware;
var init_endpointMiddleware = __esm({
  "../../node_modules/.pnpm/@smithy+middleware-endpoint@3.2.8/node_modules/@smithy/middleware-endpoint/dist-es/endpointMiddleware.js"() {
    init_import_meta_url();
    init_dist_es16();
    init_dist_es4();
    init_getEndpointFromInstructions();
    endpointMiddleware = /* @__PURE__ */ __name(({ config, instructions }) => {
      return (next, context2) => async (args) => {
        if (config.endpoint) {
          setFeature2(context2, "ENDPOINT_OVERRIDE", "N");
        }
        const endpoint = await getEndpointFromInstructions(args.input, {
          getEndpointParameterInstructions() {
            return instructions;
          }
        }, { ...config }, context2);
        context2.endpointV2 = endpoint;
        context2.authSchemes = endpoint.properties?.authSchemes;
        const authScheme = context2.authSchemes?.[0];
        if (authScheme) {
          context2["signing_region"] = authScheme.signingRegion;
          context2["signing_service"] = authScheme.signingName;
          const smithyContext = getSmithyContext(context2);
          const httpAuthOption = smithyContext?.selectedHttpAuthScheme?.httpAuthOption;
          if (httpAuthOption) {
            httpAuthOption.signingProperties = Object.assign(httpAuthOption.signingProperties || {}, {
              signing_region: authScheme.signingRegion,
              signingRegion: authScheme.signingRegion,
              signing_service: authScheme.signingName,
              signingName: authScheme.signingName,
              signingRegionSet: authScheme.signingRegionSet
            }, authScheme.properties);
          }
        }
        return next({
          ...args
        });
      };
    }, "endpointMiddleware");
  }
});

// ../../node_modules/.pnpm/@smithy+middleware-endpoint@3.2.8/node_modules/@smithy/middleware-endpoint/dist-es/getEndpointPlugin.js
var endpointMiddlewareOptions, getEndpointPlugin;
var init_getEndpointPlugin = __esm({
  "../../node_modules/.pnpm/@smithy+middleware-endpoint@3.2.8/node_modules/@smithy/middleware-endpoint/dist-es/getEndpointPlugin.js"() {
    init_import_meta_url();
    init_dist_es5();
    init_endpointMiddleware();
    endpointMiddlewareOptions = {
      step: "serialize",
      tags: ["ENDPOINT_PARAMETERS", "ENDPOINT_V2", "ENDPOINT"],
      name: "endpointV2Middleware",
      override: true,
      relation: "before",
      toMiddleware: serializerMiddlewareOption.name
    };
    getEndpointPlugin = /* @__PURE__ */ __name((config, instructions) => ({
      applyToStack: /* @__PURE__ */ __name((clientStack) => {
        clientStack.addRelativeTo(endpointMiddleware({
          config,
          instructions
        }), endpointMiddlewareOptions);
      }, "applyToStack")
    }), "getEndpointPlugin");
  }
});

// ../../node_modules/.pnpm/@smithy+middleware-endpoint@3.2.8/node_modules/@smithy/middleware-endpoint/dist-es/resolveEndpointConfig.js
var resolveEndpointConfig;
var init_resolveEndpointConfig = __esm({
  "../../node_modules/.pnpm/@smithy+middleware-endpoint@3.2.8/node_modules/@smithy/middleware-endpoint/dist-es/resolveEndpointConfig.js"() {
    init_import_meta_url();
    init_dist_es4();
    init_getEndpointFromConfig();
    init_toEndpointV1();
    resolveEndpointConfig = /* @__PURE__ */ __name((input) => {
      const tls = input.tls ?? true;
      const { endpoint } = input;
      const customEndpointProvider = endpoint != null ? async () => toEndpointV1(await normalizeProvider(endpoint)()) : void 0;
      const isCustomEndpoint = !!endpoint;
      const resolvedConfig = {
        ...input,
        endpoint: customEndpointProvider,
        tls,
        isCustomEndpoint,
        useDualstackEndpoint: normalizeProvider(input.useDualstackEndpoint ?? false),
        useFipsEndpoint: normalizeProvider(input.useFipsEndpoint ?? false)
      };
      let configuredEndpointPromise = void 0;
      resolvedConfig.serviceConfiguredEndpoint = async () => {
        if (input.serviceId && !configuredEndpointPromise) {
          configuredEndpointPromise = getEndpointFromConfig(input.serviceId);
        }
        return configuredEndpointPromise;
      };
      return resolvedConfig;
    }, "resolveEndpointConfig");
  }
});

// ../../node_modules/.pnpm/@smithy+middleware-endpoint@3.2.8/node_modules/@smithy/middleware-endpoint/dist-es/types.js
var init_types12 = __esm({
  "../../node_modules/.pnpm/@smithy+middleware-endpoint@3.2.8/node_modules/@smithy/middleware-endpoint/dist-es/types.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+middleware-endpoint@3.2.8/node_modules/@smithy/middleware-endpoint/dist-es/index.js
var init_dist_es42 = __esm({
  "../../node_modules/.pnpm/@smithy+middleware-endpoint@3.2.8/node_modules/@smithy/middleware-endpoint/dist-es/index.js"() {
    init_import_meta_url();
    init_adaptors();
    init_endpointMiddleware();
    init_getEndpointPlugin();
    init_resolveEndpointConfig();
    init_types12();
  }
});

// ../../node_modules/.pnpm/@smithy+util-retry@3.0.11/node_modules/@smithy/util-retry/dist-es/config.js
var RETRY_MODES, DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE;
var init_config10 = __esm({
  "../../node_modules/.pnpm/@smithy+util-retry@3.0.11/node_modules/@smithy/util-retry/dist-es/config.js"() {
    init_import_meta_url();
    (function(RETRY_MODES2) {
      RETRY_MODES2["STANDARD"] = "standard";
      RETRY_MODES2["ADAPTIVE"] = "adaptive";
    })(RETRY_MODES || (RETRY_MODES = {}));
    DEFAULT_MAX_ATTEMPTS = 3;
    DEFAULT_RETRY_MODE = RETRY_MODES.STANDARD;
  }
});

// ../../node_modules/.pnpm/@smithy+service-error-classification@3.0.11/node_modules/@smithy/service-error-classification/dist-es/constants.js
var THROTTLING_ERROR_CODES, TRANSIENT_ERROR_CODES, TRANSIENT_ERROR_STATUS_CODES, NODEJS_TIMEOUT_ERROR_CODES2;
var init_constants14 = __esm({
  "../../node_modules/.pnpm/@smithy+service-error-classification@3.0.11/node_modules/@smithy/service-error-classification/dist-es/constants.js"() {
    init_import_meta_url();
    THROTTLING_ERROR_CODES = [
      "BandwidthLimitExceeded",
      "EC2ThrottledException",
      "LimitExceededException",
      "PriorRequestNotComplete",
      "ProvisionedThroughputExceededException",
      "RequestLimitExceeded",
      "RequestThrottled",
      "RequestThrottledException",
      "SlowDown",
      "ThrottledException",
      "Throttling",
      "ThrottlingException",
      "TooManyRequestsException",
      "TransactionInProgressException"
    ];
    TRANSIENT_ERROR_CODES = ["TimeoutError", "RequestTimeout", "RequestTimeoutException"];
    TRANSIENT_ERROR_STATUS_CODES = [500, 502, 503, 504];
    NODEJS_TIMEOUT_ERROR_CODES2 = ["ECONNRESET", "ECONNREFUSED", "EPIPE", "ETIMEDOUT"];
  }
});

// ../../node_modules/.pnpm/@smithy+service-error-classification@3.0.11/node_modules/@smithy/service-error-classification/dist-es/index.js
var isClockSkewCorrectedError, isThrottlingError, isTransientError, isServerError;
var init_dist_es43 = __esm({
  "../../node_modules/.pnpm/@smithy+service-error-classification@3.0.11/node_modules/@smithy/service-error-classification/dist-es/index.js"() {
    init_import_meta_url();
    init_constants14();
    isClockSkewCorrectedError = /* @__PURE__ */ __name((error2) => error2.$metadata?.clockSkewCorrected, "isClockSkewCorrectedError");
    isThrottlingError = /* @__PURE__ */ __name((error2) => error2.$metadata?.httpStatusCode === 429 || THROTTLING_ERROR_CODES.includes(error2.name) || error2.$retryable?.throttling == true, "isThrottlingError");
    isTransientError = /* @__PURE__ */ __name((error2, depth = 0) => isClockSkewCorrectedError(error2) || TRANSIENT_ERROR_CODES.includes(error2.name) || NODEJS_TIMEOUT_ERROR_CODES2.includes(error2?.code || "") || TRANSIENT_ERROR_STATUS_CODES.includes(error2.$metadata?.httpStatusCode || 0) || error2.cause !== void 0 && depth <= 10 && isTransientError(error2.cause, depth + 1), "isTransientError");
    isServerError = /* @__PURE__ */ __name((error2) => {
      if (error2.$metadata?.httpStatusCode !== void 0) {
        const statusCode = error2.$metadata.httpStatusCode;
        if (500 <= statusCode && statusCode <= 599 && !isTransientError(error2)) {
          return true;
        }
        return false;
      }
      return false;
    }, "isServerError");
  }
});

// ../../node_modules/.pnpm/@smithy+util-retry@3.0.11/node_modules/@smithy/util-retry/dist-es/DefaultRateLimiter.js
var DefaultRateLimiter;
var init_DefaultRateLimiter = __esm({
  "../../node_modules/.pnpm/@smithy+util-retry@3.0.11/node_modules/@smithy/util-retry/dist-es/DefaultRateLimiter.js"() {
    init_import_meta_url();
    init_dist_es43();
    DefaultRateLimiter = class _DefaultRateLimiter {
      static {
        __name(this, "DefaultRateLimiter");
      }
      constructor(options) {
        this.currentCapacity = 0;
        this.enabled = false;
        this.lastMaxRate = 0;
        this.measuredTxRate = 0;
        this.requestCount = 0;
        this.lastTimestamp = 0;
        this.timeWindow = 0;
        this.beta = options?.beta ?? 0.7;
        this.minCapacity = options?.minCapacity ?? 1;
        this.minFillRate = options?.minFillRate ?? 0.5;
        this.scaleConstant = options?.scaleConstant ?? 0.4;
        this.smooth = options?.smooth ?? 0.8;
        const currentTimeInSeconds = this.getCurrentTimeInSeconds();
        this.lastThrottleTime = currentTimeInSeconds;
        this.lastTxRateBucket = Math.floor(this.getCurrentTimeInSeconds());
        this.fillRate = this.minFillRate;
        this.maxCapacity = this.minCapacity;
      }
      getCurrentTimeInSeconds() {
        return Date.now() / 1e3;
      }
      async getSendToken() {
        return this.acquireTokenBucket(1);
      }
      async acquireTokenBucket(amount) {
        if (!this.enabled) {
          return;
        }
        this.refillTokenBucket();
        if (amount > this.currentCapacity) {
          const delay = (amount - this.currentCapacity) / this.fillRate * 1e3;
          await new Promise((resolve32) => _DefaultRateLimiter.setTimeoutFn(resolve32, delay));
        }
        this.currentCapacity = this.currentCapacity - amount;
      }
      refillTokenBucket() {
        const timestamp = this.getCurrentTimeInSeconds();
        if (!this.lastTimestamp) {
          this.lastTimestamp = timestamp;
          return;
        }
        const fillAmount = (timestamp - this.lastTimestamp) * this.fillRate;
        this.currentCapacity = Math.min(this.maxCapacity, this.currentCapacity + fillAmount);
        this.lastTimestamp = timestamp;
      }
      updateClientSendingRate(response) {
        let calculatedRate;
        this.updateMeasuredRate();
        if (isThrottlingError(response)) {
          const rateToUse = !this.enabled ? this.measuredTxRate : Math.min(this.measuredTxRate, this.fillRate);
          this.lastMaxRate = rateToUse;
          this.calculateTimeWindow();
          this.lastThrottleTime = this.getCurrentTimeInSeconds();
          calculatedRate = this.cubicThrottle(rateToUse);
          this.enableTokenBucket();
        } else {
          this.calculateTimeWindow();
          calculatedRate = this.cubicSuccess(this.getCurrentTimeInSeconds());
        }
        const newRate = Math.min(calculatedRate, 2 * this.measuredTxRate);
        this.updateTokenBucketRate(newRate);
      }
      calculateTimeWindow() {
        this.timeWindow = this.getPrecise(Math.pow(this.lastMaxRate * (1 - this.beta) / this.scaleConstant, 1 / 3));
      }
      cubicThrottle(rateToUse) {
        return this.getPrecise(rateToUse * this.beta);
      }
      cubicSuccess(timestamp) {
        return this.getPrecise(this.scaleConstant * Math.pow(timestamp - this.lastThrottleTime - this.timeWindow, 3) + this.lastMaxRate);
      }
      enableTokenBucket() {
        this.enabled = true;
      }
      updateTokenBucketRate(newRate) {
        this.refillTokenBucket();
        this.fillRate = Math.max(newRate, this.minFillRate);
        this.maxCapacity = Math.max(newRate, this.minCapacity);
        this.currentCapacity = Math.min(this.currentCapacity, this.maxCapacity);
      }
      updateMeasuredRate() {
        const t13 = this.getCurrentTimeInSeconds();
        const timeBucket = Math.floor(t13 * 2) / 2;
        this.requestCount++;
        if (timeBucket > this.lastTxRateBucket) {
          const currentRate = this.requestCount / (timeBucket - this.lastTxRateBucket);
          this.measuredTxRate = this.getPrecise(currentRate * this.smooth + this.measuredTxRate * (1 - this.smooth));
          this.requestCount = 0;
          this.lastTxRateBucket = timeBucket;
        }
      }
      getPrecise(num) {
        return parseFloat(num.toFixed(8));
      }
    };
    DefaultRateLimiter.setTimeoutFn = setTimeout;
  }
});

// ../../node_modules/.pnpm/@smithy+util-retry@3.0.11/node_modules/@smithy/util-retry/dist-es/constants.js
var DEFAULT_RETRY_DELAY_BASE, MAXIMUM_RETRY_DELAY, THROTTLING_RETRY_DELAY_BASE, INITIAL_RETRY_TOKENS, RETRY_COST, TIMEOUT_RETRY_COST, NO_RETRY_INCREMENT, INVOCATION_ID_HEADER, REQUEST_HEADER;
var init_constants15 = __esm({
  "../../node_modules/.pnpm/@smithy+util-retry@3.0.11/node_modules/@smithy/util-retry/dist-es/constants.js"() {
    init_import_meta_url();
    DEFAULT_RETRY_DELAY_BASE = 100;
    MAXIMUM_RETRY_DELAY = 20 * 1e3;
    THROTTLING_RETRY_DELAY_BASE = 500;
    INITIAL_RETRY_TOKENS = 500;
    RETRY_COST = 5;
    TIMEOUT_RETRY_COST = 10;
    NO_RETRY_INCREMENT = 1;
    INVOCATION_ID_HEADER = "amz-sdk-invocation-id";
    REQUEST_HEADER = "amz-sdk-request";
  }
});

// ../../node_modules/.pnpm/@smithy+util-retry@3.0.11/node_modules/@smithy/util-retry/dist-es/defaultRetryBackoffStrategy.js
var getDefaultRetryBackoffStrategy;
var init_defaultRetryBackoffStrategy = __esm({
  "../../node_modules/.pnpm/@smithy+util-retry@3.0.11/node_modules/@smithy/util-retry/dist-es/defaultRetryBackoffStrategy.js"() {
    init_import_meta_url();
    init_constants15();
    getDefaultRetryBackoffStrategy = /* @__PURE__ */ __name(() => {
      let delayBase = DEFAULT_RETRY_DELAY_BASE;
      const computeNextBackoffDelay = /* @__PURE__ */ __name((attempts) => {
        return Math.floor(Math.min(MAXIMUM_RETRY_DELAY, Math.random() * 2 ** attempts * delayBase));
      }, "computeNextBackoffDelay");
      const setDelayBase = /* @__PURE__ */ __name((delay) => {
        delayBase = delay;
      }, "setDelayBase");
      return {
        computeNextBackoffDelay,
        setDelayBase
      };
    }, "getDefaultRetryBackoffStrategy");
  }
});

// ../../node_modules/.pnpm/@smithy+util-retry@3.0.11/node_modules/@smithy/util-retry/dist-es/defaultRetryToken.js
var createDefaultRetryToken;
var init_defaultRetryToken = __esm({
  "../../node_modules/.pnpm/@smithy+util-retry@3.0.11/node_modules/@smithy/util-retry/dist-es/defaultRetryToken.js"() {
    init_import_meta_url();
    init_constants15();
    createDefaultRetryToken = /* @__PURE__ */ __name(({ retryDelay, retryCount, retryCost }) => {
      const getRetryCount = /* @__PURE__ */ __name(() => retryCount, "getRetryCount");
      const getRetryDelay = /* @__PURE__ */ __name(() => Math.min(MAXIMUM_RETRY_DELAY, retryDelay), "getRetryDelay");
      const getRetryCost = /* @__PURE__ */ __name(() => retryCost, "getRetryCost");
      return {
        getRetryCount,
        getRetryDelay,
        getRetryCost
      };
    }, "createDefaultRetryToken");
  }
});

// ../../node_modules/.pnpm/@smithy+util-retry@3.0.11/node_modules/@smithy/util-retry/dist-es/StandardRetryStrategy.js
var StandardRetryStrategy;
var init_StandardRetryStrategy = __esm({
  "../../node_modules/.pnpm/@smithy+util-retry@3.0.11/node_modules/@smithy/util-retry/dist-es/StandardRetryStrategy.js"() {
    init_import_meta_url();
    init_config10();
    init_constants15();
    init_defaultRetryBackoffStrategy();
    init_defaultRetryToken();
    StandardRetryStrategy = class {
      static {
        __name(this, "StandardRetryStrategy");
      }
      constructor(maxAttempts) {
        this.maxAttempts = maxAttempts;
        this.mode = RETRY_MODES.STANDARD;
        this.capacity = INITIAL_RETRY_TOKENS;
        this.retryBackoffStrategy = getDefaultRetryBackoffStrategy();
        this.maxAttemptsProvider = typeof maxAttempts === "function" ? maxAttempts : async () => maxAttempts;
      }
      async acquireInitialRetryToken(retryTokenScope) {
        return createDefaultRetryToken({
          retryDelay: DEFAULT_RETRY_DELAY_BASE,
          retryCount: 0
        });
      }
      async refreshRetryTokenForRetry(token, errorInfo) {
        const maxAttempts = await this.getMaxAttempts();
        if (this.shouldRetry(token, errorInfo, maxAttempts)) {
          const errorType = errorInfo.errorType;
          this.retryBackoffStrategy.setDelayBase(errorType === "THROTTLING" ? THROTTLING_RETRY_DELAY_BASE : DEFAULT_RETRY_DELAY_BASE);
          const delayFromErrorType = this.retryBackoffStrategy.computeNextBackoffDelay(token.getRetryCount());
          const retryDelay = errorInfo.retryAfterHint ? Math.max(errorInfo.retryAfterHint.getTime() - Date.now() || 0, delayFromErrorType) : delayFromErrorType;
          const capacityCost = this.getCapacityCost(errorType);
          this.capacity -= capacityCost;
          return createDefaultRetryToken({
            retryDelay,
            retryCount: token.getRetryCount() + 1,
            retryCost: capacityCost
          });
        }
        throw new Error("No retry token available");
      }
      recordSuccess(token) {
        this.capacity = Math.max(INITIAL_RETRY_TOKENS, this.capacity + (token.getRetryCost() ?? NO_RETRY_INCREMENT));
      }
      getCapacity() {
        return this.capacity;
      }
      async getMaxAttempts() {
        try {
          return await this.maxAttemptsProvider();
        } catch (error2) {
          console.warn(`Max attempts provider could not resolve. Using default of ${DEFAULT_MAX_ATTEMPTS}`);
          return DEFAULT_MAX_ATTEMPTS;
        }
      }
      shouldRetry(tokenToRenew, errorInfo, maxAttempts) {
        const attempts = tokenToRenew.getRetryCount() + 1;
        return attempts < maxAttempts && this.capacity >= this.getCapacityCost(errorInfo.errorType) && this.isRetryableError(errorInfo.errorType);
      }
      getCapacityCost(errorType) {
        return errorType === "TRANSIENT" ? TIMEOUT_RETRY_COST : RETRY_COST;
      }
      isRetryableError(errorType) {
        return errorType === "THROTTLING" || errorType === "TRANSIENT";
      }
    };
  }
});

// ../../node_modules/.pnpm/@smithy+util-retry@3.0.11/node_modules/@smithy/util-retry/dist-es/AdaptiveRetryStrategy.js
var AdaptiveRetryStrategy;
var init_AdaptiveRetryStrategy = __esm({
  "../../node_modules/.pnpm/@smithy+util-retry@3.0.11/node_modules/@smithy/util-retry/dist-es/AdaptiveRetryStrategy.js"() {
    init_import_meta_url();
    init_config10();
    init_DefaultRateLimiter();
    init_StandardRetryStrategy();
    AdaptiveRetryStrategy = class {
      static {
        __name(this, "AdaptiveRetryStrategy");
      }
      constructor(maxAttemptsProvider, options) {
        this.maxAttemptsProvider = maxAttemptsProvider;
        this.mode = RETRY_MODES.ADAPTIVE;
        const { rateLimiter } = options ?? {};
        this.rateLimiter = rateLimiter ?? new DefaultRateLimiter();
        this.standardRetryStrategy = new StandardRetryStrategy(maxAttemptsProvider);
      }
      async acquireInitialRetryToken(retryTokenScope) {
        await this.rateLimiter.getSendToken();
        return this.standardRetryStrategy.acquireInitialRetryToken(retryTokenScope);
      }
      async refreshRetryTokenForRetry(tokenToRenew, errorInfo) {
        this.rateLimiter.updateClientSendingRate(errorInfo);
        return this.standardRetryStrategy.refreshRetryTokenForRetry(tokenToRenew, errorInfo);
      }
      recordSuccess(token) {
        this.rateLimiter.updateClientSendingRate({});
        this.standardRetryStrategy.recordSuccess(token);
      }
    };
  }
});

// ../../node_modules/.pnpm/@smithy+util-retry@3.0.11/node_modules/@smithy/util-retry/dist-es/ConfiguredRetryStrategy.js
var init_ConfiguredRetryStrategy = __esm({
  "../../node_modules/.pnpm/@smithy+util-retry@3.0.11/node_modules/@smithy/util-retry/dist-es/ConfiguredRetryStrategy.js"() {
    init_import_meta_url();
    init_constants15();
    init_StandardRetryStrategy();
  }
});

// ../../node_modules/.pnpm/@smithy+util-retry@3.0.11/node_modules/@smithy/util-retry/dist-es/types.js
var init_types13 = __esm({
  "../../node_modules/.pnpm/@smithy+util-retry@3.0.11/node_modules/@smithy/util-retry/dist-es/types.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+util-retry@3.0.11/node_modules/@smithy/util-retry/dist-es/index.js
var init_dist_es44 = __esm({
  "../../node_modules/.pnpm/@smithy+util-retry@3.0.11/node_modules/@smithy/util-retry/dist-es/index.js"() {
    init_import_meta_url();
    init_AdaptiveRetryStrategy();
    init_ConfiguredRetryStrategy();
    init_DefaultRateLimiter();
    init_StandardRetryStrategy();
    init_config10();
    init_constants15();
    init_types13();
  }
});
function rng() {
  if (poolPtr > rnds8Pool.length - 16) {
    crypto2__default.default.randomFillSync(rnds8Pool);
    poolPtr = 0;
  }
  return rnds8Pool.slice(poolPtr, poolPtr += 16);
}
var rnds8Pool, poolPtr;
var init_rng = __esm({
  "../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-node/rng.js"() {
    init_import_meta_url();
    rnds8Pool = new Uint8Array(256);
    poolPtr = rnds8Pool.length;
    __name(rng, "rng");
  }
});

// ../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-node/stringify.js
function unsafeStringify(arr, offset = 0) {
  return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];
}
var byteToHex;
var init_stringify3 = __esm({
  "../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-node/stringify.js"() {
    init_import_meta_url();
    byteToHex = [];
    for (let i7 = 0; i7 < 256; ++i7) {
      byteToHex.push((i7 + 256).toString(16).slice(1));
    }
    __name(unsafeStringify, "unsafeStringify");
  }
});
var native_default;
var init_native = __esm({
  "../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-node/native.js"() {
    init_import_meta_url();
    native_default = {
      randomUUID: crypto2__default.default.randomUUID
    };
  }
});

// ../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-node/v4.js
function v4(options, buf, offset) {
  if (native_default.randomUUID && !buf && !options) {
    return native_default.randomUUID();
  }
  options = options || {};
  const rnds = options.random || (options.rng || rng)();
  rnds[6] = rnds[6] & 15 | 64;
  rnds[8] = rnds[8] & 63 | 128;
  if (buf) {
    offset = offset || 0;
    for (let i7 = 0; i7 < 16; ++i7) {
      buf[offset + i7] = rnds[i7];
    }
    return buf;
  }
  return unsafeStringify(rnds);
}
var v4_default;
var init_v4 = __esm({
  "../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-node/v4.js"() {
    init_import_meta_url();
    init_native();
    init_rng();
    init_stringify3();
    __name(v4, "v4");
    v4_default = v4;
  }
});

// ../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-node/index.js
var init_esm_node = __esm({
  "../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-node/index.js"() {
    init_import_meta_url();
    init_v4();
  }
});

// ../../node_modules/.pnpm/@smithy+middleware-retry@3.0.34/node_modules/@smithy/middleware-retry/dist-es/defaultRetryQuota.js
var init_defaultRetryQuota = __esm({
  "../../node_modules/.pnpm/@smithy+middleware-retry@3.0.34/node_modules/@smithy/middleware-retry/dist-es/defaultRetryQuota.js"() {
    init_import_meta_url();
    init_dist_es44();
  }
});

// ../../node_modules/.pnpm/@smithy+middleware-retry@3.0.34/node_modules/@smithy/middleware-retry/dist-es/delayDecider.js
var init_delayDecider = __esm({
  "../../node_modules/.pnpm/@smithy+middleware-retry@3.0.34/node_modules/@smithy/middleware-retry/dist-es/delayDecider.js"() {
    init_import_meta_url();
    init_dist_es44();
  }
});

// ../../node_modules/.pnpm/@smithy+middleware-retry@3.0.34/node_modules/@smithy/middleware-retry/dist-es/retryDecider.js
var init_retryDecider = __esm({
  "../../node_modules/.pnpm/@smithy+middleware-retry@3.0.34/node_modules/@smithy/middleware-retry/dist-es/retryDecider.js"() {
    init_import_meta_url();
    init_dist_es43();
  }
});

// ../../node_modules/.pnpm/@smithy+middleware-retry@3.0.34/node_modules/@smithy/middleware-retry/dist-es/util.js
var asSdkError;
var init_util5 = __esm({
  "../../node_modules/.pnpm/@smithy+middleware-retry@3.0.34/node_modules/@smithy/middleware-retry/dist-es/util.js"() {
    init_import_meta_url();
    asSdkError = /* @__PURE__ */ __name((error2) => {
      if (error2 instanceof Error)
        return error2;
      if (error2 instanceof Object)
        return Object.assign(new Error(), error2);
      if (typeof error2 === "string")
        return new Error(error2);
      return new Error(`AWS SDK error wrapper for ${error2}`);
    }, "asSdkError");
  }
});

// ../../node_modules/.pnpm/@smithy+middleware-retry@3.0.34/node_modules/@smithy/middleware-retry/dist-es/StandardRetryStrategy.js
var init_StandardRetryStrategy2 = __esm({
  "../../node_modules/.pnpm/@smithy+middleware-retry@3.0.34/node_modules/@smithy/middleware-retry/dist-es/StandardRetryStrategy.js"() {
    init_import_meta_url();
    init_dist_es2();
    init_dist_es43();
    init_dist_es44();
    init_defaultRetryQuota();
    init_delayDecider();
    init_retryDecider();
    init_util5();
  }
});

// ../../node_modules/.pnpm/@smithy+middleware-retry@3.0.34/node_modules/@smithy/middleware-retry/dist-es/AdaptiveRetryStrategy.js
var init_AdaptiveRetryStrategy2 = __esm({
  "../../node_modules/.pnpm/@smithy+middleware-retry@3.0.34/node_modules/@smithy/middleware-retry/dist-es/AdaptiveRetryStrategy.js"() {
    init_import_meta_url();
    init_dist_es44();
    init_StandardRetryStrategy2();
  }
});

// ../../node_modules/.pnpm/@smithy+middleware-retry@3.0.34/node_modules/@smithy/middleware-retry/dist-es/configurations.js
var ENV_MAX_ATTEMPTS, CONFIG_MAX_ATTEMPTS, NODE_MAX_ATTEMPT_CONFIG_OPTIONS, resolveRetryConfig, ENV_RETRY_MODE, CONFIG_RETRY_MODE, NODE_RETRY_MODE_CONFIG_OPTIONS;
var init_configurations5 = __esm({
  "../../node_modules/.pnpm/@smithy+middleware-retry@3.0.34/node_modules/@smithy/middleware-retry/dist-es/configurations.js"() {
    init_import_meta_url();
    init_dist_es4();
    init_dist_es44();
    ENV_MAX_ATTEMPTS = "AWS_MAX_ATTEMPTS";
    CONFIG_MAX_ATTEMPTS = "max_attempts";
    NODE_MAX_ATTEMPT_CONFIG_OPTIONS = {
      environmentVariableSelector: /* @__PURE__ */ __name((env6) => {
        const value = env6[ENV_MAX_ATTEMPTS];
        if (!value)
          return void 0;
        const maxAttempt = parseInt(value);
        if (Number.isNaN(maxAttempt)) {
          throw new Error(`Environment variable ${ENV_MAX_ATTEMPTS} mast be a number, got "${value}"`);
        }
        return maxAttempt;
      }, "environmentVariableSelector"),
      configFileSelector: /* @__PURE__ */ __name((profile) => {
        const value = profile[CONFIG_MAX_ATTEMPTS];
        if (!value)
          return void 0;
        const maxAttempt = parseInt(value);
        if (Number.isNaN(maxAttempt)) {
          throw new Error(`Shared config file entry ${CONFIG_MAX_ATTEMPTS} mast be a number, got "${value}"`);
        }
        return maxAttempt;
      }, "configFileSelector"),
      default: DEFAULT_MAX_ATTEMPTS
    };
    resolveRetryConfig = /* @__PURE__ */ __name((input) => {
      const { retryStrategy } = input;
      const maxAttempts = normalizeProvider(input.maxAttempts ?? DEFAULT_MAX_ATTEMPTS);
      return {
        ...input,
        maxAttempts,
        retryStrategy: /* @__PURE__ */ __name(async () => {
          if (retryStrategy) {
            return retryStrategy;
          }
          const retryMode = await normalizeProvider(input.retryMode)();
          if (retryMode === RETRY_MODES.ADAPTIVE) {
            return new AdaptiveRetryStrategy(maxAttempts);
          }
          return new StandardRetryStrategy(maxAttempts);
        }, "retryStrategy")
      };
    }, "resolveRetryConfig");
    ENV_RETRY_MODE = "AWS_RETRY_MODE";
    CONFIG_RETRY_MODE = "retry_mode";
    NODE_RETRY_MODE_CONFIG_OPTIONS = {
      environmentVariableSelector: /* @__PURE__ */ __name((env6) => env6[ENV_RETRY_MODE], "environmentVariableSelector"),
      configFileSelector: /* @__PURE__ */ __name((profile) => profile[CONFIG_RETRY_MODE], "configFileSelector"),
      default: DEFAULT_RETRY_MODE
    };
  }
});

// ../../node_modules/.pnpm/@smithy+middleware-retry@3.0.34/node_modules/@smithy/middleware-retry/dist-es/omitRetryHeadersMiddleware.js
var init_omitRetryHeadersMiddleware = __esm({
  "../../node_modules/.pnpm/@smithy+middleware-retry@3.0.34/node_modules/@smithy/middleware-retry/dist-es/omitRetryHeadersMiddleware.js"() {
    init_import_meta_url();
    init_dist_es2();
    init_dist_es44();
  }
});
var isStreamingPayload;
var init_isStreamingPayload = __esm({
  "../../node_modules/.pnpm/@smithy+middleware-retry@3.0.34/node_modules/@smithy/middleware-retry/dist-es/isStreamingPayload/isStreamingPayload.js"() {
    init_import_meta_url();
    isStreamingPayload = /* @__PURE__ */ __name((request4) => request4?.body instanceof Stream.Readable || typeof ReadableStream !== "undefined" && request4?.body instanceof ReadableStream, "isStreamingPayload");
  }
});

// ../../node_modules/.pnpm/@smithy+middleware-retry@3.0.34/node_modules/@smithy/middleware-retry/dist-es/retryMiddleware.js
var retryMiddleware, isRetryStrategyV2, getRetryErrorInfo, getRetryErrorType, retryMiddlewareOptions, getRetryPlugin, getRetryAfterHint;
var init_retryMiddleware = __esm({
  "../../node_modules/.pnpm/@smithy+middleware-retry@3.0.34/node_modules/@smithy/middleware-retry/dist-es/retryMiddleware.js"() {
    init_import_meta_url();
    init_dist_es2();
    init_dist_es43();
    init_dist_es20();
    init_dist_es44();
    init_esm_node();
    init_isStreamingPayload();
    init_util5();
    retryMiddleware = /* @__PURE__ */ __name((options) => (next, context2) => async (args) => {
      let retryStrategy = await options.retryStrategy();
      const maxAttempts = await options.maxAttempts();
      if (isRetryStrategyV2(retryStrategy)) {
        retryStrategy = retryStrategy;
        let retryToken = await retryStrategy.acquireInitialRetryToken(context2["partition_id"]);
        let lastError = new Error();
        let attempts = 0;
        let totalRetryDelay = 0;
        const { request: request4 } = args;
        const isRequest2 = HttpRequest.isInstance(request4);
        if (isRequest2) {
          request4.headers[INVOCATION_ID_HEADER] = v4_default();
        }
        while (true) {
          try {
            if (isRequest2) {
              request4.headers[REQUEST_HEADER] = `attempt=${attempts + 1}; max=${maxAttempts}`;
            }
            const { response, output } = await next(args);
            retryStrategy.recordSuccess(retryToken);
            output.$metadata.attempts = attempts + 1;
            output.$metadata.totalRetryDelay = totalRetryDelay;
            return { response, output };
          } catch (e10) {
            const retryErrorInfo = getRetryErrorInfo(e10);
            lastError = asSdkError(e10);
            if (isRequest2 && isStreamingPayload(request4)) {
              (context2.logger instanceof NoOpLogger ? console : context2.logger)?.warn("An error was encountered in a non-retryable streaming request.");
              throw lastError;
            }
            try {
              retryToken = await retryStrategy.refreshRetryTokenForRetry(retryToken, retryErrorInfo);
            } catch (refreshError) {
              if (!lastError.$metadata) {
                lastError.$metadata = {};
              }
              lastError.$metadata.attempts = attempts + 1;
              lastError.$metadata.totalRetryDelay = totalRetryDelay;
              throw lastError;
            }
            attempts = retryToken.getRetryCount();
            const delay = retryToken.getRetryDelay();
            totalRetryDelay += delay;
            await new Promise((resolve32) => setTimeout(resolve32, delay));
          }
        }
      } else {
        retryStrategy = retryStrategy;
        if (retryStrategy?.mode)
          context2.userAgent = [...context2.userAgent || [], ["cfg/retry-mode", retryStrategy.mode]];
        return retryStrategy.retry(next, args);
      }
    }, "retryMiddleware");
    isRetryStrategyV2 = /* @__PURE__ */ __name((retryStrategy) => typeof retryStrategy.acquireInitialRetryToken !== "undefined" && typeof retryStrategy.refreshRetryTokenForRetry !== "undefined" && typeof retryStrategy.recordSuccess !== "undefined", "isRetryStrategyV2");
    getRetryErrorInfo = /* @__PURE__ */ __name((error2) => {
      const errorInfo = {
        error: error2,
        errorType: getRetryErrorType(error2)
      };
      const retryAfterHint = getRetryAfterHint(error2.$response);
      if (retryAfterHint) {
        errorInfo.retryAfterHint = retryAfterHint;
      }
      return errorInfo;
    }, "getRetryErrorInfo");
    getRetryErrorType = /* @__PURE__ */ __name((error2) => {
      if (isThrottlingError(error2))
        return "THROTTLING";
      if (isTransientError(error2))
        return "TRANSIENT";
      if (isServerError(error2))
        return "SERVER_ERROR";
      return "CLIENT_ERROR";
    }, "getRetryErrorType");
    retryMiddlewareOptions = {
      name: "retryMiddleware",
      tags: ["RETRY"],
      step: "finalizeRequest",
      priority: "high",
      override: true
    };
    getRetryPlugin = /* @__PURE__ */ __name((options) => ({
      applyToStack: /* @__PURE__ */ __name((clientStack) => {
        clientStack.add(retryMiddleware(options), retryMiddlewareOptions);
      }, "applyToStack")
    }), "getRetryPlugin");
    getRetryAfterHint = /* @__PURE__ */ __name((response) => {
      if (!HttpResponse.isInstance(response))
        return;
      const retryAfterHeaderName = Object.keys(response.headers).find((key) => key.toLowerCase() === "retry-after");
      if (!retryAfterHeaderName)
        return;
      const retryAfter = response.headers[retryAfterHeaderName];
      const retryAfterSeconds = Number(retryAfter);
      if (!Number.isNaN(retryAfterSeconds))
        return new Date(retryAfterSeconds * 1e3);
      const retryAfterDate = new Date(retryAfter);
      return retryAfterDate;
    }, "getRetryAfterHint");
  }
});

// ../../node_modules/.pnpm/@smithy+middleware-retry@3.0.34/node_modules/@smithy/middleware-retry/dist-es/index.js
var init_dist_es45 = __esm({
  "../../node_modules/.pnpm/@smithy+middleware-retry@3.0.34/node_modules/@smithy/middleware-retry/dist-es/index.js"() {
    init_import_meta_url();
    init_AdaptiveRetryStrategy2();
    init_StandardRetryStrategy2();
    init_configurations5();
    init_delayDecider();
    init_omitRetryHeadersMiddleware();
    init_retryDecider();
    init_retryMiddleware();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+signature-v4-multi-region@3.716.0/node_modules/@aws-sdk/signature-v4-multi-region/dist-es/signature-v4-crt-container.js
var signatureV4CrtContainer;
var init_signature_v4_crt_container = __esm({
  "../../node_modules/.pnpm/@aws-sdk+signature-v4-multi-region@3.716.0/node_modules/@aws-sdk/signature-v4-multi-region/dist-es/signature-v4-crt-container.js"() {
    init_import_meta_url();
    signatureV4CrtContainer = {
      CrtSignerV4: null
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+signature-v4-multi-region@3.716.0/node_modules/@aws-sdk/signature-v4-multi-region/dist-es/SignatureV4MultiRegion.js
var SignatureV4MultiRegion;
var init_SignatureV4MultiRegion = __esm({
  "../../node_modules/.pnpm/@aws-sdk+signature-v4-multi-region@3.716.0/node_modules/@aws-sdk/signature-v4-multi-region/dist-es/SignatureV4MultiRegion.js"() {
    init_import_meta_url();
    init_dist_es31();
    init_signature_v4_crt_container();
    SignatureV4MultiRegion = class {
      static {
        __name(this, "SignatureV4MultiRegion");
      }
      constructor(options) {
        this.sigv4Signer = new SignatureV4S3Express(options);
        this.signerOptions = options;
      }
      async sign(requestToSign, options = {}) {
        if (options.signingRegion === "*") {
          if (this.signerOptions.runtime !== "node")
            throw new Error("This request requires signing with SigV4Asymmetric algorithm. It's only available in Node.js");
          return this.getSigv4aSigner().sign(requestToSign, options);
        }
        return this.sigv4Signer.sign(requestToSign, options);
      }
      async signWithCredentials(requestToSign, credentials, options = {}) {
        if (options.signingRegion === "*") {
          if (this.signerOptions.runtime !== "node")
            throw new Error("This request requires signing with SigV4Asymmetric algorithm. It's only available in Node.js");
          return this.getSigv4aSigner().signWithCredentials(requestToSign, credentials, options);
        }
        return this.sigv4Signer.signWithCredentials(requestToSign, credentials, options);
      }
      async presign(originalRequest, options = {}) {
        if (options.signingRegion === "*") {
          if (this.signerOptions.runtime !== "node")
            throw new Error("This request requires signing with SigV4Asymmetric algorithm. It's only available in Node.js");
          return this.getSigv4aSigner().presign(originalRequest, options);
        }
        return this.sigv4Signer.presign(originalRequest, options);
      }
      async presignWithCredentials(originalRequest, credentials, options = {}) {
        if (options.signingRegion === "*") {
          throw new Error("Method presignWithCredentials is not supported for [signingRegion=*].");
        }
        return this.sigv4Signer.presignWithCredentials(originalRequest, credentials, options);
      }
      getSigv4aSigner() {
        if (!this.sigv4aSigner) {
          let CrtSignerV4 = null;
          try {
            CrtSignerV4 = signatureV4CrtContainer.CrtSignerV4;
            if (typeof CrtSignerV4 !== "function")
              throw new Error();
          } catch (e10) {
            e10.message = `${e10.message}
Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. 
You must also register the package by calling [require("@aws-sdk/signature-v4-crt");] or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";]. 
For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt`;
            throw e10;
          }
          this.sigv4aSigner = new CrtSignerV4({
            ...this.signerOptions,
            signingAlgorithm: 1
          });
        }
        return this.sigv4aSigner;
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+signature-v4-multi-region@3.716.0/node_modules/@aws-sdk/signature-v4-multi-region/dist-es/index.js
var init_dist_es46 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+signature-v4-multi-region@3.716.0/node_modules/@aws-sdk/signature-v4-multi-region/dist-es/index.js"() {
    init_import_meta_url();
    init_SignatureV4MultiRegion();
    init_signature_v4_crt_container();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/endpoint/ruleset.js
var ci5, cj, ck, cl, cm, cn, co, cp2, cq, cr2, cs, ct2, cu, cv, cw, cx, a3, b7, c4, d4, e5, f4, g3, h3, i3, j3, k3, l4, m3, n4, o3, p3, q3, r5, s3, t8, u3, v3, w3, x3, y3, z5, A2, B2, C2, D2, E2, F2, G3, H3, I3, J3, K3, L3, M3, N3, O3, P3, Q3, R3, S3, T3, U3, V3, W3, X3, Y3, Z3, aa, ab, ac, ad, ae2, af, ag, ah, ai, aj, ak, al, am, an, ao, ap, aq, ar2, as, at2, au, av, aw, ax, ay, az, aA, aB, aC, aD, aE, aF, aG, aH, aI, aJ, aK, aL, aM, aN, aO, aP, aQ, aR, aS, aT, aU, aV, aW, aX, aY, aZ, ba, bb, bc, bd, be2, bf, bg, bh, bi, bj, bk, bl, bm, bn, bo, bp, bq, br2, bs, bt2, bu, bv, bw, bx, by, bz, bA, bB, bC, bD, bE, bF, bG, bH, bI, bJ, bK, bL, bM, bN, bO, bP, bQ, bR, bS, bT, bU, bV, bW, bX, bY, bZ, ca, cb, cc, cd, ce2, cf, cg, ch, _data, ruleSet;
var init_ruleset = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/endpoint/ruleset.js"() {
    init_import_meta_url();
    ci5 = "required";
    cj = "type";
    ck = "conditions";
    cl = "fn";
    cm = "argv";
    cn = "ref";
    co = "assign";
    cp2 = "url";
    cq = "properties";
    cr2 = "backend";
    cs = "authSchemes";
    ct2 = "disableDoubleEncoding";
    cu = "signingName";
    cv = "signingRegion";
    cw = "headers";
    cx = "signingRegionSet";
    a3 = 6;
    b7 = false;
    c4 = true;
    d4 = "isSet";
    e5 = "booleanEquals";
    f4 = "error";
    g3 = "aws.partition";
    h3 = "stringEquals";
    i3 = "getAttr";
    j3 = "name";
    k3 = "substring";
    l4 = "bucketSuffix";
    m3 = "parseURL";
    n4 = "{url#scheme}://{url#authority}/{uri_encoded_bucket}{url#path}";
    o3 = "endpoint";
    p3 = "tree";
    q3 = "aws.isVirtualHostableS3Bucket";
    r5 = "{url#scheme}://{Bucket}.{url#authority}{url#path}";
    s3 = "not";
    t8 = "{url#scheme}://{url#authority}{url#path}";
    u3 = "hardwareType";
    v3 = "regionPrefix";
    w3 = "bucketAliasSuffix";
    x3 = "outpostId";
    y3 = "isValidHostLabel";
    z5 = "sigv4a";
    A2 = "s3-outposts";
    B2 = "s3";
    C2 = "{url#scheme}://{url#authority}{url#normalizedPath}{Bucket}";
    D2 = "https://{Bucket}.s3-accelerate.{partitionResult#dnsSuffix}";
    E2 = "https://{Bucket}.s3.{partitionResult#dnsSuffix}";
    F2 = "aws.parseArn";
    G3 = "bucketArn";
    H3 = "arnType";
    I3 = "";
    J3 = "s3-object-lambda";
    K3 = "accesspoint";
    L3 = "accessPointName";
    M3 = "{url#scheme}://{accessPointName}-{bucketArn#accountId}.{url#authority}{url#path}";
    N3 = "mrapPartition";
    O3 = "outpostType";
    P3 = "arnPrefix";
    Q3 = "{url#scheme}://{url#authority}{url#normalizedPath}{uri_encoded_bucket}";
    R3 = "https://s3.{partitionResult#dnsSuffix}/{uri_encoded_bucket}";
    S3 = "https://s3.{partitionResult#dnsSuffix}";
    T3 = { [ci5]: false, [cj]: "String" };
    U3 = { [ci5]: true, "default": false, [cj]: "Boolean" };
    V3 = { [ci5]: false, [cj]: "Boolean" };
    W3 = { [cl]: e5, [cm]: [{ [cn]: "Accelerate" }, true] };
    X3 = { [cl]: e5, [cm]: [{ [cn]: "UseFIPS" }, true] };
    Y3 = { [cl]: e5, [cm]: [{ [cn]: "UseDualStack" }, true] };
    Z3 = { [cl]: d4, [cm]: [{ [cn]: "Endpoint" }] };
    aa = { [cl]: g3, [cm]: [{ [cn]: "Region" }], [co]: "partitionResult" };
    ab = { [cl]: h3, [cm]: [{ [cl]: i3, [cm]: [{ [cn]: "partitionResult" }, j3] }, "aws-cn"] };
    ac = { [cl]: d4, [cm]: [{ [cn]: "Bucket" }] };
    ad = { [cn]: "Bucket" };
    ae2 = { [cl]: m3, [cm]: [{ [cn]: "Endpoint" }], [co]: "url" };
    af = { [cl]: e5, [cm]: [{ [cl]: i3, [cm]: [{ [cn]: "url" }, "isIp"] }, true] };
    ag = { [cn]: "url" };
    ah = { [cl]: "uriEncode", [cm]: [ad], [co]: "uri_encoded_bucket" };
    ai = { [cr2]: "S3Express", [cs]: [{ [ct2]: true, [j3]: "sigv4", [cu]: "s3express", [cv]: "{Region}" }] };
    aj = {};
    ak = { [cl]: q3, [cm]: [ad, false] };
    al = { [f4]: "S3Express bucket name is not a valid virtual hostable name.", [cj]: f4 };
    am = { [cr2]: "S3Express", [cs]: [{ [ct2]: true, [j3]: "sigv4-s3express", [cu]: "s3express", [cv]: "{Region}" }] };
    an = { [cl]: d4, [cm]: [{ [cn]: "UseS3ExpressControlEndpoint" }] };
    ao = { [cl]: e5, [cm]: [{ [cn]: "UseS3ExpressControlEndpoint" }, true] };
    ap = { [cl]: s3, [cm]: [Z3] };
    aq = { [f4]: "Unrecognized S3Express bucket name format.", [cj]: f4 };
    ar2 = { [cl]: s3, [cm]: [ac] };
    as = { [cn]: u3 };
    at2 = { [ck]: [ap], [f4]: "Expected a endpoint to be specified but no endpoint was found", [cj]: f4 };
    au = { [cs]: [{ [ct2]: true, [j3]: z5, [cu]: A2, [cx]: ["*"] }, { [ct2]: true, [j3]: "sigv4", [cu]: A2, [cv]: "{Region}" }] };
    av = { [cl]: e5, [cm]: [{ [cn]: "ForcePathStyle" }, false] };
    aw = { [cn]: "ForcePathStyle" };
    ax = { [cl]: e5, [cm]: [{ [cn]: "Accelerate" }, false] };
    ay = { [cl]: h3, [cm]: [{ [cn]: "Region" }, "aws-global"] };
    az = { [cs]: [{ [ct2]: true, [j3]: "sigv4", [cu]: B2, [cv]: "us-east-1" }] };
    aA = { [cl]: s3, [cm]: [ay] };
    aB = { [cl]: e5, [cm]: [{ [cn]: "UseGlobalEndpoint" }, true] };
    aC = { [cp2]: "https://{Bucket}.s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}", [cq]: { [cs]: [{ [ct2]: true, [j3]: "sigv4", [cu]: B2, [cv]: "{Region}" }] }, [cw]: {} };
    aD = { [cs]: [{ [ct2]: true, [j3]: "sigv4", [cu]: B2, [cv]: "{Region}" }] };
    aE = { [cl]: e5, [cm]: [{ [cn]: "UseGlobalEndpoint" }, false] };
    aF = { [cl]: e5, [cm]: [{ [cn]: "UseDualStack" }, false] };
    aG = { [cp2]: "https://{Bucket}.s3-fips.{Region}.{partitionResult#dnsSuffix}", [cq]: aD, [cw]: {} };
    aH = { [cl]: e5, [cm]: [{ [cn]: "UseFIPS" }, false] };
    aI = { [cp2]: "https://{Bucket}.s3-accelerate.dualstack.{partitionResult#dnsSuffix}", [cq]: aD, [cw]: {} };
    aJ = { [cp2]: "https://{Bucket}.s3.dualstack.{Region}.{partitionResult#dnsSuffix}", [cq]: aD, [cw]: {} };
    aK = { [cl]: e5, [cm]: [{ [cl]: i3, [cm]: [ag, "isIp"] }, false] };
    aL = { [cp2]: C2, [cq]: aD, [cw]: {} };
    aM = { [cp2]: r5, [cq]: aD, [cw]: {} };
    aN = { [o3]: aM, [cj]: o3 };
    aO = { [cp2]: D2, [cq]: aD, [cw]: {} };
    aP = { [cp2]: "https://{Bucket}.s3.{Region}.{partitionResult#dnsSuffix}", [cq]: aD, [cw]: {} };
    aQ = { [f4]: "Invalid region: region was not a valid DNS name.", [cj]: f4 };
    aR = { [cn]: G3 };
    aS = { [cn]: H3 };
    aT = { [cl]: i3, [cm]: [aR, "service"] };
    aU = { [cn]: L3 };
    aV = { [ck]: [Y3], [f4]: "S3 Object Lambda does not support Dual-stack", [cj]: f4 };
    aW = { [ck]: [W3], [f4]: "S3 Object Lambda does not support S3 Accelerate", [cj]: f4 };
    aX = { [ck]: [{ [cl]: d4, [cm]: [{ [cn]: "DisableAccessPoints" }] }, { [cl]: e5, [cm]: [{ [cn]: "DisableAccessPoints" }, true] }], [f4]: "Access points are not supported for this operation", [cj]: f4 };
    aY = { [ck]: [{ [cl]: d4, [cm]: [{ [cn]: "UseArnRegion" }] }, { [cl]: e5, [cm]: [{ [cn]: "UseArnRegion" }, false] }, { [cl]: s3, [cm]: [{ [cl]: h3, [cm]: [{ [cl]: i3, [cm]: [aR, "region"] }, "{Region}"] }] }], [f4]: "Invalid configuration: region from ARN `{bucketArn#region}` does not match client region `{Region}` and UseArnRegion is `false`", [cj]: f4 };
    aZ = { [cl]: i3, [cm]: [{ [cn]: "bucketPartition" }, j3] };
    ba = { [cl]: i3, [cm]: [aR, "accountId"] };
    bb = { [cs]: [{ [ct2]: true, [j3]: "sigv4", [cu]: J3, [cv]: "{bucketArn#region}" }] };
    bc = { [f4]: "Invalid ARN: The access point name may only contain a-z, A-Z, 0-9 and `-`. Found: `{accessPointName}`", [cj]: f4 };
    bd = { [f4]: "Invalid ARN: The account id may only contain a-z, A-Z, 0-9 and `-`. Found: `{bucketArn#accountId}`", [cj]: f4 };
    be2 = { [f4]: "Invalid region in ARN: `{bucketArn#region}` (invalid DNS name)", [cj]: f4 };
    bf = { [f4]: "Client was configured for partition `{partitionResult#name}` but ARN (`{Bucket}`) has `{bucketPartition#name}`", [cj]: f4 };
    bg = { [f4]: "Invalid ARN: The ARN may only contain a single resource component after `accesspoint`.", [cj]: f4 };
    bh = { [f4]: "Invalid ARN: Expected a resource of the format `accesspoint:<accesspoint name>` but no name was provided", [cj]: f4 };
    bi = { [cs]: [{ [ct2]: true, [j3]: "sigv4", [cu]: B2, [cv]: "{bucketArn#region}" }] };
    bj = { [cs]: [{ [ct2]: true, [j3]: z5, [cu]: A2, [cx]: ["*"] }, { [ct2]: true, [j3]: "sigv4", [cu]: A2, [cv]: "{bucketArn#region}" }] };
    bk = { [cl]: F2, [cm]: [ad] };
    bl = { [cp2]: "https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}", [cq]: aD, [cw]: {} };
    bm = { [cp2]: "https://s3-fips.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}", [cq]: aD, [cw]: {} };
    bn = { [cp2]: "https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}", [cq]: aD, [cw]: {} };
    bo = { [cp2]: Q3, [cq]: aD, [cw]: {} };
    bp = { [cp2]: "https://s3.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}", [cq]: aD, [cw]: {} };
    bq = { [cn]: "UseObjectLambdaEndpoint" };
    br2 = { [cs]: [{ [ct2]: true, [j3]: "sigv4", [cu]: J3, [cv]: "{Region}" }] };
    bs = { [cp2]: "https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}", [cq]: aD, [cw]: {} };
    bt2 = { [cp2]: "https://s3-fips.{Region}.{partitionResult#dnsSuffix}", [cq]: aD, [cw]: {} };
    bu = { [cp2]: "https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}", [cq]: aD, [cw]: {} };
    bv = { [cp2]: t8, [cq]: aD, [cw]: {} };
    bw = { [cp2]: "https://s3.{Region}.{partitionResult#dnsSuffix}", [cq]: aD, [cw]: {} };
    bx = [{ [cn]: "Region" }];
    by = [{ [cn]: "Endpoint" }];
    bz = [ad];
    bA = [Y3];
    bB = [W3];
    bC = [Z3, ae2];
    bD = [{ [cl]: d4, [cm]: [{ [cn]: "DisableS3ExpressSessionAuth" }] }, { [cl]: e5, [cm]: [{ [cn]: "DisableS3ExpressSessionAuth" }, true] }];
    bE = [af];
    bF = [ah];
    bG = [ak];
    bH = [X3];
    bI = [{ [cl]: k3, [cm]: [ad, 6, 14, true], [co]: "s3expressAvailabilityZoneId" }, { [cl]: k3, [cm]: [ad, 14, 16, true], [co]: "s3expressAvailabilityZoneDelim" }, { [cl]: h3, [cm]: [{ [cn]: "s3expressAvailabilityZoneDelim" }, "--"] }];
    bJ = [{ [ck]: [X3], [o3]: { [cp2]: "https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com", [cq]: ai, [cw]: {} }, [cj]: o3 }, { [o3]: { [cp2]: "https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com", [cq]: ai, [cw]: {} }, [cj]: o3 }];
    bK = [{ [cl]: k3, [cm]: [ad, 6, 15, true], [co]: "s3expressAvailabilityZoneId" }, { [cl]: k3, [cm]: [ad, 15, 17, true], [co]: "s3expressAvailabilityZoneDelim" }, { [cl]: h3, [cm]: [{ [cn]: "s3expressAvailabilityZoneDelim" }, "--"] }];
    bL = [{ [cl]: k3, [cm]: [ad, 6, 19, true], [co]: "s3expressAvailabilityZoneId" }, { [cl]: k3, [cm]: [ad, 19, 21, true], [co]: "s3expressAvailabilityZoneDelim" }, { [cl]: h3, [cm]: [{ [cn]: "s3expressAvailabilityZoneDelim" }, "--"] }];
    bM = [{ [cl]: k3, [cm]: [ad, 6, 20, true], [co]: "s3expressAvailabilityZoneId" }, { [cl]: k3, [cm]: [ad, 20, 22, true], [co]: "s3expressAvailabilityZoneDelim" }, { [cl]: h3, [cm]: [{ [cn]: "s3expressAvailabilityZoneDelim" }, "--"] }];
    bN = [{ [cl]: k3, [cm]: [ad, 6, 26, true], [co]: "s3expressAvailabilityZoneId" }, { [cl]: k3, [cm]: [ad, 26, 28, true], [co]: "s3expressAvailabilityZoneDelim" }, { [cl]: h3, [cm]: [{ [cn]: "s3expressAvailabilityZoneDelim" }, "--"] }];
    bO = [{ [ck]: [X3], [o3]: { [cp2]: "https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com", [cq]: am, [cw]: {} }, [cj]: o3 }, { [o3]: { [cp2]: "https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com", [cq]: am, [cw]: {} }, [cj]: o3 }];
    bP = [ac];
    bQ = [{ [cl]: y3, [cm]: [{ [cn]: x3 }, false] }];
    bR = [{ [cl]: h3, [cm]: [{ [cn]: v3 }, "beta"] }];
    bS = ["*"];
    bT = [aa];
    bU = [{ [cl]: y3, [cm]: [{ [cn]: "Region" }, false] }];
    bV = [{ [cl]: h3, [cm]: [{ [cn]: "Region" }, "us-east-1"] }];
    bW = [{ [cl]: h3, [cm]: [aS, K3] }];
    bX = [{ [cl]: i3, [cm]: [aR, "resourceId[1]"], [co]: L3 }, { [cl]: s3, [cm]: [{ [cl]: h3, [cm]: [aU, I3] }] }];
    bY = [aR, "resourceId[1]"];
    bZ = [{ [cl]: s3, [cm]: [{ [cl]: h3, [cm]: [{ [cl]: i3, [cm]: [aR, "region"] }, I3] }] }];
    ca = [{ [cl]: s3, [cm]: [{ [cl]: d4, [cm]: [{ [cl]: i3, [cm]: [aR, "resourceId[2]"] }] }] }];
    cb = [aR, "resourceId[2]"];
    cc = [{ [cl]: g3, [cm]: [{ [cl]: i3, [cm]: [aR, "region"] }], [co]: "bucketPartition" }];
    cd = [{ [cl]: h3, [cm]: [aZ, { [cl]: i3, [cm]: [{ [cn]: "partitionResult" }, j3] }] }];
    ce2 = [{ [cl]: y3, [cm]: [{ [cl]: i3, [cm]: [aR, "region"] }, true] }];
    cf = [{ [cl]: y3, [cm]: [ba, false] }];
    cg = [{ [cl]: y3, [cm]: [aU, false] }];
    ch = [{ [cl]: y3, [cm]: [{ [cn]: "Region" }, true] }];
    _data = { version: "1.0", parameters: { Bucket: T3, Region: T3, UseFIPS: U3, UseDualStack: U3, Endpoint: T3, ForcePathStyle: U3, Accelerate: U3, UseGlobalEndpoint: U3, UseObjectLambdaEndpoint: V3, Key: T3, Prefix: T3, CopySource: T3, DisableAccessPoints: V3, DisableMultiRegionAccessPoints: U3, UseArnRegion: V3, UseS3ExpressControlEndpoint: V3, DisableS3ExpressSessionAuth: V3 }, rules: [{ [ck]: [{ [cl]: d4, [cm]: bx }], rules: [{ [ck]: [W3, X3], error: "Accelerate cannot be used with FIPS", [cj]: f4 }, { [ck]: [Y3, Z3], error: "Cannot set dual-stack in combination with a custom endpoint.", [cj]: f4 }, { [ck]: [Z3, X3], error: "A custom endpoint cannot be combined with FIPS", [cj]: f4 }, { [ck]: [Z3, W3], error: "A custom endpoint cannot be combined with S3 Accelerate", [cj]: f4 }, { [ck]: [X3, aa, ab], error: "Partition does not support FIPS", [cj]: f4 }, { [ck]: [ac, { [cl]: k3, [cm]: [ad, 0, a3, c4], [co]: l4 }, { [cl]: h3, [cm]: [{ [cn]: l4 }, "--x-s3"] }], rules: [{ [ck]: bA, error: "S3Express does not support Dual-stack.", [cj]: f4 }, { [ck]: bB, error: "S3Express does not support S3 Accelerate.", [cj]: f4 }, { [ck]: bC, rules: [{ [ck]: bD, rules: [{ [ck]: bE, rules: [{ [ck]: bF, rules: [{ endpoint: { [cp2]: n4, [cq]: ai, [cw]: aj }, [cj]: o3 }], [cj]: p3 }], [cj]: p3 }, { [ck]: bG, rules: [{ endpoint: { [cp2]: r5, [cq]: ai, [cw]: aj }, [cj]: o3 }], [cj]: p3 }, al], [cj]: p3 }, { [ck]: bE, rules: [{ [ck]: bF, rules: [{ endpoint: { [cp2]: n4, [cq]: am, [cw]: aj }, [cj]: o3 }], [cj]: p3 }], [cj]: p3 }, { [ck]: bG, rules: [{ endpoint: { [cp2]: r5, [cq]: am, [cw]: aj }, [cj]: o3 }], [cj]: p3 }, al], [cj]: p3 }, { [ck]: [an, ao], rules: [{ [ck]: [ah, ap], rules: [{ [ck]: bH, endpoint: { [cp2]: "https://s3express-control-fips.{Region}.amazonaws.com/{uri_encoded_bucket}", [cq]: ai, [cw]: aj }, [cj]: o3 }, { endpoint: { [cp2]: "https://s3express-control.{Region}.amazonaws.com/{uri_encoded_bucket}", [cq]: ai, [cw]: aj }, [cj]: o3 }], [cj]: p3 }], [cj]: p3 }, { [ck]: bG, rules: [{ [ck]: bD, rules: [{ [ck]: bI, rules: bJ, [cj]: p3 }, { [ck]: bK, rules: bJ, [cj]: p3 }, { [ck]: bL, rules: bJ, [cj]: p3 }, { [ck]: bM, rules: bJ, [cj]: p3 }, { [ck]: bN, rules: bJ, [cj]: p3 }, aq], [cj]: p3 }, { [ck]: bI, rules: bO, [cj]: p3 }, { [ck]: bK, rules: bO, [cj]: p3 }, { [ck]: bL, rules: bO, [cj]: p3 }, { [ck]: bM, rules: bO, [cj]: p3 }, { [ck]: bN, rules: bO, [cj]: p3 }, aq], [cj]: p3 }, al], [cj]: p3 }, { [ck]: [ar2, an, ao], rules: [{ [ck]: bC, endpoint: { [cp2]: t8, [cq]: ai, [cw]: aj }, [cj]: o3 }, { [ck]: bH, endpoint: { [cp2]: "https://s3express-control-fips.{Region}.amazonaws.com", [cq]: ai, [cw]: aj }, [cj]: o3 }, { endpoint: { [cp2]: "https://s3express-control.{Region}.amazonaws.com", [cq]: ai, [cw]: aj }, [cj]: o3 }], [cj]: p3 }, { [ck]: [ac, { [cl]: k3, [cm]: [ad, 49, 50, c4], [co]: u3 }, { [cl]: k3, [cm]: [ad, 8, 12, c4], [co]: v3 }, { [cl]: k3, [cm]: [ad, 0, 7, c4], [co]: w3 }, { [cl]: k3, [cm]: [ad, 32, 49, c4], [co]: x3 }, { [cl]: g3, [cm]: bx, [co]: "regionPartition" }, { [cl]: h3, [cm]: [{ [cn]: w3 }, "--op-s3"] }], rules: [{ [ck]: bQ, rules: [{ [ck]: [{ [cl]: h3, [cm]: [as, "e"] }], rules: [{ [ck]: bR, rules: [at2, { [ck]: bC, endpoint: { [cp2]: "https://{Bucket}.ec2.{url#authority}", [cq]: au, [cw]: aj }, [cj]: o3 }], [cj]: p3 }, { endpoint: { [cp2]: "https://{Bucket}.ec2.s3-outposts.{Region}.{regionPartition#dnsSuffix}", [cq]: au, [cw]: aj }, [cj]: o3 }], [cj]: p3 }, { [ck]: [{ [cl]: h3, [cm]: [as, "o"] }], rules: [{ [ck]: bR, rules: [at2, { [ck]: bC, endpoint: { [cp2]: "https://{Bucket}.op-{outpostId}.{url#authority}", [cq]: au, [cw]: aj }, [cj]: o3 }], [cj]: p3 }, { endpoint: { [cp2]: "https://{Bucket}.op-{outpostId}.s3-outposts.{Region}.{regionPartition#dnsSuffix}", [cq]: au, [cw]: aj }, [cj]: o3 }], [cj]: p3 }, { error: 'Unrecognized hardware type: "Expected hardware type o or e but got {hardwareType}"', [cj]: f4 }], [cj]: p3 }, { error: "Invalid ARN: The outpost Id must only contain a-z, A-Z, 0-9 and `-`.", [cj]: f4 }], [cj]: p3 }, { [ck]: bP, rules: [{ [ck]: [Z3, { [cl]: s3, [cm]: [{ [cl]: d4, [cm]: [{ [cl]: m3, [cm]: by }] }] }], error: "Custom endpoint `{Endpoint}` was not a valid URI", [cj]: f4 }, { [ck]: [av, ak], rules: [{ [ck]: bT, rules: [{ [ck]: bU, rules: [{ [ck]: [W3, ab], error: "S3 Accelerate cannot be used in this region", [cj]: f4 }, { [ck]: [Y3, X3, ax, ap, ay], endpoint: { [cp2]: "https://{Bucket}.s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}", [cq]: az, [cw]: aj }, [cj]: o3 }, { [ck]: [Y3, X3, ax, ap, aA, aB], rules: [{ endpoint: aC, [cj]: o3 }], [cj]: p3 }, { [ck]: [Y3, X3, ax, ap, aA, aE], endpoint: aC, [cj]: o3 }, { [ck]: [aF, X3, ax, ap, ay], endpoint: { [cp2]: "https://{Bucket}.s3-fips.us-east-1.{partitionResult#dnsSuffix}", [cq]: az, [cw]: aj }, [cj]: o3 }, { [ck]: [aF, X3, ax, ap, aA, aB], rules: [{ endpoint: aG, [cj]: o3 }], [cj]: p3 }, { [ck]: [aF, X3, ax, ap, aA, aE], endpoint: aG, [cj]: o3 }, { [ck]: [Y3, aH, W3, ap, ay], endpoint: { [cp2]: "https://{Bucket}.s3-accelerate.dualstack.us-east-1.{partitionResult#dnsSuffix}", [cq]: az, [cw]: aj }, [cj]: o3 }, { [ck]: [Y3, aH, W3, ap, aA, aB], rules: [{ endpoint: aI, [cj]: o3 }], [cj]: p3 }, { [ck]: [Y3, aH, W3, ap, aA, aE], endpoint: aI, [cj]: o3 }, { [ck]: [Y3, aH, ax, ap, ay], endpoint: { [cp2]: "https://{Bucket}.s3.dualstack.us-east-1.{partitionResult#dnsSuffix}", [cq]: az, [cw]: aj }, [cj]: o3 }, { [ck]: [Y3, aH, ax, ap, aA, aB], rules: [{ endpoint: aJ, [cj]: o3 }], [cj]: p3 }, { [ck]: [Y3, aH, ax, ap, aA, aE], endpoint: aJ, [cj]: o3 }, { [ck]: [aF, aH, ax, Z3, ae2, af, ay], endpoint: { [cp2]: C2, [cq]: az, [cw]: aj }, [cj]: o3 }, { [ck]: [aF, aH, ax, Z3, ae2, aK, ay], endpoint: { [cp2]: r5, [cq]: az, [cw]: aj }, [cj]: o3 }, { [ck]: [aF, aH, ax, Z3, ae2, af, aA, aB], rules: [{ [ck]: bV, endpoint: aL, [cj]: o3 }, { endpoint: aL, [cj]: o3 }], [cj]: p3 }, { [ck]: [aF, aH, ax, Z3, ae2, aK, aA, aB], rules: [{ [ck]: bV, endpoint: aM, [cj]: o3 }, aN], [cj]: p3 }, { [ck]: [aF, aH, ax, Z3, ae2, af, aA, aE], endpoint: aL, [cj]: o3 }, { [ck]: [aF, aH, ax, Z3, ae2, aK, aA, aE], endpoint: aM, [cj]: o3 }, { [ck]: [aF, aH, W3, ap, ay], endpoint: { [cp2]: D2, [cq]: az, [cw]: aj }, [cj]: o3 }, { [ck]: [aF, aH, W3, ap, aA, aB], rules: [{ [ck]: bV, endpoint: aO, [cj]: o3 }, { endpoint: aO, [cj]: o3 }], [cj]: p3 }, { [ck]: [aF, aH, W3, ap, aA, aE], endpoint: aO, [cj]: o3 }, { [ck]: [aF, aH, ax, ap, ay], endpoint: { [cp2]: E2, [cq]: az, [cw]: aj }, [cj]: o3 }, { [ck]: [aF, aH, ax, ap, aA, aB], rules: [{ [ck]: bV, endpoint: { [cp2]: E2, [cq]: aD, [cw]: aj }, [cj]: o3 }, { endpoint: aP, [cj]: o3 }], [cj]: p3 }, { [ck]: [aF, aH, ax, ap, aA, aE], endpoint: aP, [cj]: o3 }], [cj]: p3 }, aQ], [cj]: p3 }], [cj]: p3 }, { [ck]: [Z3, ae2, { [cl]: h3, [cm]: [{ [cl]: i3, [cm]: [ag, "scheme"] }, "http"] }, { [cl]: q3, [cm]: [ad, c4] }, av, aH, aF, ax], rules: [{ [ck]: bT, rules: [{ [ck]: bU, rules: [aN], [cj]: p3 }, aQ], [cj]: p3 }], [cj]: p3 }, { [ck]: [av, { [cl]: F2, [cm]: bz, [co]: G3 }], rules: [{ [ck]: [{ [cl]: i3, [cm]: [aR, "resourceId[0]"], [co]: H3 }, { [cl]: s3, [cm]: [{ [cl]: h3, [cm]: [aS, I3] }] }], rules: [{ [ck]: [{ [cl]: h3, [cm]: [aT, J3] }], rules: [{ [ck]: bW, rules: [{ [ck]: bX, rules: [aV, aW, { [ck]: bZ, rules: [aX, { [ck]: ca, rules: [aY, { [ck]: cc, rules: [{ [ck]: bT, rules: [{ [ck]: cd, rules: [{ [ck]: ce2, rules: [{ [ck]: [{ [cl]: h3, [cm]: [ba, I3] }], error: "Invalid ARN: Missing account id", [cj]: f4 }, { [ck]: cf, rules: [{ [ck]: cg, rules: [{ [ck]: bC, endpoint: { [cp2]: M3, [cq]: bb, [cw]: aj }, [cj]: o3 }, { [ck]: bH, endpoint: { [cp2]: "https://{accessPointName}-{bucketArn#accountId}.s3-object-lambda-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}", [cq]: bb, [cw]: aj }, [cj]: o3 }, { endpoint: { [cp2]: "https://{accessPointName}-{bucketArn#accountId}.s3-object-lambda.{bucketArn#region}.{bucketPartition#dnsSuffix}", [cq]: bb, [cw]: aj }, [cj]: o3 }], [cj]: p3 }, bc], [cj]: p3 }, bd], [cj]: p3 }, be2], [cj]: p3 }, bf], [cj]: p3 }], [cj]: p3 }], [cj]: p3 }, bg], [cj]: p3 }, { error: "Invalid ARN: bucket ARN is missing a region", [cj]: f4 }], [cj]: p3 }, bh], [cj]: p3 }, { error: "Invalid ARN: Object Lambda ARNs only support `accesspoint` arn types, but found: `{arnType}`", [cj]: f4 }], [cj]: p3 }, { [ck]: bW, rules: [{ [ck]: bX, rules: [{ [ck]: bZ, rules: [{ [ck]: bW, rules: [{ [ck]: bZ, rules: [aX, { [ck]: ca, rules: [aY, { [ck]: cc, rules: [{ [ck]: bT, rules: [{ [ck]: [{ [cl]: h3, [cm]: [aZ, "{partitionResult#name}"] }], rules: [{ [ck]: ce2, rules: [{ [ck]: [{ [cl]: h3, [cm]: [aT, B2] }], rules: [{ [ck]: cf, rules: [{ [ck]: cg, rules: [{ [ck]: bB, error: "Access Points do not support S3 Accelerate", [cj]: f4 }, { [ck]: [X3, Y3], endpoint: { [cp2]: "https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint-fips.dualstack.{bucketArn#region}.{bucketPartition#dnsSuffix}", [cq]: bi, [cw]: aj }, [cj]: o3 }, { [ck]: [X3, aF], endpoint: { [cp2]: "https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}", [cq]: bi, [cw]: aj }, [cj]: o3 }, { [ck]: [aH, Y3], endpoint: { [cp2]: "https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint.dualstack.{bucketArn#region}.{bucketPartition#dnsSuffix}", [cq]: bi, [cw]: aj }, [cj]: o3 }, { [ck]: [aH, aF, Z3, ae2], endpoint: { [cp2]: M3, [cq]: bi, [cw]: aj }, [cj]: o3 }, { [ck]: [aH, aF], endpoint: { [cp2]: "https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint.{bucketArn#region}.{bucketPartition#dnsSuffix}", [cq]: bi, [cw]: aj }, [cj]: o3 }], [cj]: p3 }, bc], [cj]: p3 }, bd], [cj]: p3 }, { error: "Invalid ARN: The ARN was not for the S3 service, found: {bucketArn#service}", [cj]: f4 }], [cj]: p3 }, be2], [cj]: p3 }, bf], [cj]: p3 }], [cj]: p3 }], [cj]: p3 }, bg], [cj]: p3 }], [cj]: p3 }], [cj]: p3 }, { [ck]: [{ [cl]: y3, [cm]: [aU, c4] }], rules: [{ [ck]: bA, error: "S3 MRAP does not support dual-stack", [cj]: f4 }, { [ck]: bH, error: "S3 MRAP does not support FIPS", [cj]: f4 }, { [ck]: bB, error: "S3 MRAP does not support S3 Accelerate", [cj]: f4 }, { [ck]: [{ [cl]: e5, [cm]: [{ [cn]: "DisableMultiRegionAccessPoints" }, c4] }], error: "Invalid configuration: Multi-Region Access Point ARNs are disabled.", [cj]: f4 }, { [ck]: [{ [cl]: g3, [cm]: bx, [co]: N3 }], rules: [{ [ck]: [{ [cl]: h3, [cm]: [{ [cl]: i3, [cm]: [{ [cn]: N3 }, j3] }, { [cl]: i3, [cm]: [aR, "partition"] }] }], rules: [{ endpoint: { [cp2]: "https://{accessPointName}.accesspoint.s3-global.{mrapPartition#dnsSuffix}", [cq]: { [cs]: [{ [ct2]: c4, name: z5, [cu]: B2, [cx]: bS }] }, [cw]: aj }, [cj]: o3 }], [cj]: p3 }, { error: "Client was configured for partition `{mrapPartition#name}` but bucket referred to partition `{bucketArn#partition}`", [cj]: f4 }], [cj]: p3 }], [cj]: p3 }, { error: "Invalid Access Point Name", [cj]: f4 }], [cj]: p3 }, bh], [cj]: p3 }, { [ck]: [{ [cl]: h3, [cm]: [aT, A2] }], rules: [{ [ck]: bA, error: "S3 Outposts does not support Dual-stack", [cj]: f4 }, { [ck]: bH, error: "S3 Outposts does not support FIPS", [cj]: f4 }, { [ck]: bB, error: "S3 Outposts does not support S3 Accelerate", [cj]: f4 }, { [ck]: [{ [cl]: d4, [cm]: [{ [cl]: i3, [cm]: [aR, "resourceId[4]"] }] }], error: "Invalid Arn: Outpost Access Point ARN contains sub resources", [cj]: f4 }, { [ck]: [{ [cl]: i3, [cm]: bY, [co]: x3 }], rules: [{ [ck]: bQ, rules: [aY, { [ck]: cc, rules: [{ [ck]: bT, rules: [{ [ck]: cd, rules: [{ [ck]: ce2, rules: [{ [ck]: cf, rules: [{ [ck]: [{ [cl]: i3, [cm]: cb, [co]: O3 }], rules: [{ [ck]: [{ [cl]: i3, [cm]: [aR, "resourceId[3]"], [co]: L3 }], rules: [{ [ck]: [{ [cl]: h3, [cm]: [{ [cn]: O3 }, K3] }], rules: [{ [ck]: bC, endpoint: { [cp2]: "https://{accessPointName}-{bucketArn#accountId}.{outpostId}.{url#authority}", [cq]: bj, [cw]: aj }, [cj]: o3 }, { endpoint: { [cp2]: "https://{accessPointName}-{bucketArn#accountId}.{outpostId}.s3-outposts.{bucketArn#region}.{bucketPartition#dnsSuffix}", [cq]: bj, [cw]: aj }, [cj]: o3 }], [cj]: p3 }, { error: "Expected an outpost type `accesspoint`, found {outpostType}", [cj]: f4 }], [cj]: p3 }, { error: "Invalid ARN: expected an access point name", [cj]: f4 }], [cj]: p3 }, { error: "Invalid ARN: Expected a 4-component resource", [cj]: f4 }], [cj]: p3 }, bd], [cj]: p3 }, be2], [cj]: p3 }, bf], [cj]: p3 }], [cj]: p3 }], [cj]: p3 }, { error: "Invalid ARN: The outpost Id may only contain a-z, A-Z, 0-9 and `-`. Found: `{outpostId}`", [cj]: f4 }], [cj]: p3 }, { error: "Invalid ARN: The Outpost Id was not set", [cj]: f4 }], [cj]: p3 }, { error: "Invalid ARN: Unrecognized format: {Bucket} (type: {arnType})", [cj]: f4 }], [cj]: p3 }, { error: "Invalid ARN: No ARN type specified", [cj]: f4 }], [cj]: p3 }, { [ck]: [{ [cl]: k3, [cm]: [ad, 0, 4, b7], [co]: P3 }, { [cl]: h3, [cm]: [{ [cn]: P3 }, "arn:"] }, { [cl]: s3, [cm]: [{ [cl]: d4, [cm]: [bk] }] }], error: "Invalid ARN: `{Bucket}` was not a valid ARN", [cj]: f4 }, { [ck]: [{ [cl]: e5, [cm]: [aw, c4] }, bk], error: "Path-style addressing cannot be used with ARN buckets", [cj]: f4 }, { [ck]: bF, rules: [{ [ck]: bT, rules: [{ [ck]: [ax], rules: [{ [ck]: [Y3, ap, X3, ay], endpoint: { [cp2]: "https://s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}", [cq]: az, [cw]: aj }, [cj]: o3 }, { [ck]: [Y3, ap, X3, aA, aB], rules: [{ endpoint: bl, [cj]: o3 }], [cj]: p3 }, { [ck]: [Y3, ap, X3, aA, aE], endpoint: bl, [cj]: o3 }, { [ck]: [aF, ap, X3, ay], endpoint: { [cp2]: "https://s3-fips.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}", [cq]: az, [cw]: aj }, [cj]: o3 }, { [ck]: [aF, ap, X3, aA, aB], rules: [{ endpoint: bm, [cj]: o3 }], [cj]: p3 }, { [ck]: [aF, ap, X3, aA, aE], endpoint: bm, [cj]: o3 }, { [ck]: [Y3, ap, aH, ay], endpoint: { [cp2]: "https://s3.dualstack.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}", [cq]: az, [cw]: aj }, [cj]: o3 }, { [ck]: [Y3, ap, aH, aA, aB], rules: [{ endpoint: bn, [cj]: o3 }], [cj]: p3 }, { [ck]: [Y3, ap, aH, aA, aE], endpoint: bn, [cj]: o3 }, { [ck]: [aF, Z3, ae2, aH, ay], endpoint: { [cp2]: Q3, [cq]: az, [cw]: aj }, [cj]: o3 }, { [ck]: [aF, Z3, ae2, aH, aA, aB], rules: [{ [ck]: bV, endpoint: bo, [cj]: o3 }, { endpoint: bo, [cj]: o3 }], [cj]: p3 }, { [ck]: [aF, Z3, ae2, aH, aA, aE], endpoint: bo, [cj]: o3 }, { [ck]: [aF, ap, aH, ay], endpoint: { [cp2]: R3, [cq]: az, [cw]: aj }, [cj]: o3 }, { [ck]: [aF, ap, aH, aA, aB], rules: [{ [ck]: bV, endpoint: { [cp2]: R3, [cq]: aD, [cw]: aj }, [cj]: o3 }, { endpoint: bp, [cj]: o3 }], [cj]: p3 }, { [ck]: [aF, ap, aH, aA, aE], endpoint: bp, [cj]: o3 }], [cj]: p3 }, { error: "Path-style addressing cannot be used with S3 Accelerate", [cj]: f4 }], [cj]: p3 }], [cj]: p3 }], [cj]: p3 }, { [ck]: [{ [cl]: d4, [cm]: [bq] }, { [cl]: e5, [cm]: [bq, c4] }], rules: [{ [ck]: bT, rules: [{ [ck]: ch, rules: [aV, aW, { [ck]: bC, endpoint: { [cp2]: t8, [cq]: br2, [cw]: aj }, [cj]: o3 }, { [ck]: bH, endpoint: { [cp2]: "https://s3-object-lambda-fips.{Region}.{partitionResult#dnsSuffix}", [cq]: br2, [cw]: aj }, [cj]: o3 }, { endpoint: { [cp2]: "https://s3-object-lambda.{Region}.{partitionResult#dnsSuffix}", [cq]: br2, [cw]: aj }, [cj]: o3 }], [cj]: p3 }, aQ], [cj]: p3 }], [cj]: p3 }, { [ck]: [ar2], rules: [{ [ck]: bT, rules: [{ [ck]: ch, rules: [{ [ck]: [X3, Y3, ap, ay], endpoint: { [cp2]: "https://s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}", [cq]: az, [cw]: aj }, [cj]: o3 }, { [ck]: [X3, Y3, ap, aA, aB], rules: [{ endpoint: bs, [cj]: o3 }], [cj]: p3 }, { [ck]: [X3, Y3, ap, aA, aE], endpoint: bs, [cj]: o3 }, { [ck]: [X3, aF, ap, ay], endpoint: { [cp2]: "https://s3-fips.us-east-1.{partitionResult#dnsSuffix}", [cq]: az, [cw]: aj }, [cj]: o3 }, { [ck]: [X3, aF, ap, aA, aB], rules: [{ endpoint: bt2, [cj]: o3 }], [cj]: p3 }, { [ck]: [X3, aF, ap, aA, aE], endpoint: bt2, [cj]: o3 }, { [ck]: [aH, Y3, ap, ay], endpoint: { [cp2]: "https://s3.dualstack.us-east-1.{partitionResult#dnsSuffix}", [cq]: az, [cw]: aj }, [cj]: o3 }, { [ck]: [aH, Y3, ap, aA, aB], rules: [{ endpoint: bu, [cj]: o3 }], [cj]: p3 }, { [ck]: [aH, Y3, ap, aA, aE], endpoint: bu, [cj]: o3 }, { [ck]: [aH, aF, Z3, ae2, ay], endpoint: { [cp2]: t8, [cq]: az, [cw]: aj }, [cj]: o3 }, { [ck]: [aH, aF, Z3, ae2, aA, aB], rules: [{ [ck]: bV, endpoint: bv, [cj]: o3 }, { endpoint: bv, [cj]: o3 }], [cj]: p3 }, { [ck]: [aH, aF, Z3, ae2, aA, aE], endpoint: bv, [cj]: o3 }, { [ck]: [aH, aF, ap, ay], endpoint: { [cp2]: S3, [cq]: az, [cw]: aj }, [cj]: o3 }, { [ck]: [aH, aF, ap, aA, aB], rules: [{ [ck]: bV, endpoint: { [cp2]: S3, [cq]: aD, [cw]: aj }, [cj]: o3 }, { endpoint: bw, [cj]: o3 }], [cj]: p3 }, { [ck]: [aH, aF, ap, aA, aE], endpoint: bw, [cj]: o3 }], [cj]: p3 }, aQ], [cj]: p3 }], [cj]: p3 }], [cj]: p3 }, { error: "A region must be set when sending requests to S3.", [cj]: f4 }] };
    ruleSet = _data;
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/endpoint/endpointResolver.js
var cache, defaultEndpointResolver;
var init_endpointResolver = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/endpoint/endpointResolver.js"() {
    init_import_meta_url();
    init_dist_es33();
    init_dist_es32();
    init_ruleset();
    cache = new EndpointCache({
      size: 50,
      params: [
        "Accelerate",
        "Bucket",
        "DisableAccessPoints",
        "DisableMultiRegionAccessPoints",
        "DisableS3ExpressSessionAuth",
        "Endpoint",
        "ForcePathStyle",
        "Region",
        "UseArnRegion",
        "UseDualStack",
        "UseFIPS",
        "UseGlobalEndpoint",
        "UseObjectLambdaEndpoint",
        "UseS3ExpressControlEndpoint"
      ]
    });
    defaultEndpointResolver = /* @__PURE__ */ __name((endpointParams, context2 = {}) => {
      return cache.get(endpointParams, () => resolveEndpoint(ruleSet, {
        endpointParams,
        logger: context2.logger
      }));
    }, "defaultEndpointResolver");
    customEndpointFunctions.aws = awsEndpointFunctions;
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/auth/httpAuthSchemeProvider.js
function createAwsAuthSigv4HttpAuthOption(authParameters) {
  return {
    schemeId: "aws.auth#sigv4",
    signingProperties: {
      name: "s3",
      region: authParameters.region
    },
    propertiesExtractor: /* @__PURE__ */ __name((config, context2) => ({
      signingProperties: {
        config,
        context: context2
      }
    }), "propertiesExtractor")
  };
}
function createAwsAuthSigv4aHttpAuthOption(authParameters) {
  return {
    schemeId: "aws.auth#sigv4a",
    signingProperties: {
      name: "s3",
      region: authParameters.region
    },
    propertiesExtractor: /* @__PURE__ */ __name((config, context2) => ({
      signingProperties: {
        config,
        context: context2
      }
    }), "propertiesExtractor")
  };
}
var createEndpointRuleSetHttpAuthSchemeParametersProvider, _defaultS3HttpAuthSchemeParametersProvider, defaultS3HttpAuthSchemeParametersProvider, createEndpointRuleSetHttpAuthSchemeProvider, _defaultS3HttpAuthSchemeProvider, defaultS3HttpAuthSchemeProvider, resolveHttpAuthSchemeConfig;
var init_httpAuthSchemeProvider = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/auth/httpAuthSchemeProvider.js"() {
    init_import_meta_url();
    init_dist_es21();
    init_dist_es46();
    init_dist_es42();
    init_dist_es4();
    init_endpointResolver();
    createEndpointRuleSetHttpAuthSchemeParametersProvider = /* @__PURE__ */ __name((defaultHttpAuthSchemeParametersProvider) => async (config, context2, input) => {
      if (!input) {
        throw new Error(`Could not find \`input\` for \`defaultEndpointRuleSetHttpAuthSchemeParametersProvider\``);
      }
      const defaultParameters = await defaultHttpAuthSchemeParametersProvider(config, context2, input);
      const instructionsFn = getSmithyContext(context2)?.commandInstance?.constructor?.getEndpointParameterInstructions;
      if (!instructionsFn) {
        throw new Error(`getEndpointParameterInstructions() is not defined on \`${context2.commandName}\``);
      }
      const endpointParameters = await resolveParams(input, { getEndpointParameterInstructions: instructionsFn }, config);
      return Object.assign(defaultParameters, endpointParameters);
    }, "createEndpointRuleSetHttpAuthSchemeParametersProvider");
    _defaultS3HttpAuthSchemeParametersProvider = /* @__PURE__ */ __name(async (config, context2, input) => {
      return {
        operation: getSmithyContext(context2).operation,
        region: await normalizeProvider(config.region)() || (() => {
          throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
        })()
      };
    }, "_defaultS3HttpAuthSchemeParametersProvider");
    defaultS3HttpAuthSchemeParametersProvider = createEndpointRuleSetHttpAuthSchemeParametersProvider(_defaultS3HttpAuthSchemeParametersProvider);
    __name(createAwsAuthSigv4HttpAuthOption, "createAwsAuthSigv4HttpAuthOption");
    __name(createAwsAuthSigv4aHttpAuthOption, "createAwsAuthSigv4aHttpAuthOption");
    createEndpointRuleSetHttpAuthSchemeProvider = /* @__PURE__ */ __name((defaultEndpointResolver5, defaultHttpAuthSchemeResolver, createHttpAuthOptionFunctions) => {
      const endpointRuleSetHttpAuthSchemeProvider = /* @__PURE__ */ __name((authParameters) => {
        const endpoint = defaultEndpointResolver5(authParameters);
        const authSchemes = endpoint.properties?.authSchemes;
        if (!authSchemes) {
          return defaultHttpAuthSchemeResolver(authParameters);
        }
        const options = [];
        for (const scheme of authSchemes) {
          const { name: resolvedName, properties = {}, ...rest } = scheme;
          const name2 = resolvedName.toLowerCase();
          if (resolvedName !== name2) {
            console.warn(`HttpAuthScheme has been normalized with lowercasing: \`${resolvedName}\` to \`${name2}\``);
          }
          let schemeId;
          if (name2 === "sigv4a") {
            schemeId = "aws.auth#sigv4a";
            const sigv4Present = authSchemes.find((s7) => {
              const name3 = s7.name.toLowerCase();
              return name3 !== "sigv4a" && name3.startsWith("sigv4");
            });
            if (!signatureV4CrtContainer.CrtSignerV4 && sigv4Present) {
              continue;
            }
          } else if (name2.startsWith("sigv4")) {
            schemeId = "aws.auth#sigv4";
          } else {
            throw new Error(`Unknown HttpAuthScheme found in \`@smithy.rules#endpointRuleSet\`: \`${name2}\``);
          }
          const createOption = createHttpAuthOptionFunctions[schemeId];
          if (!createOption) {
            throw new Error(`Could not find HttpAuthOption create function for \`${schemeId}\``);
          }
          const option = createOption(authParameters);
          option.schemeId = schemeId;
          option.signingProperties = { ...option.signingProperties || {}, ...rest, ...properties };
          options.push(option);
        }
        return options;
      }, "endpointRuleSetHttpAuthSchemeProvider");
      return endpointRuleSetHttpAuthSchemeProvider;
    }, "createEndpointRuleSetHttpAuthSchemeProvider");
    _defaultS3HttpAuthSchemeProvider = /* @__PURE__ */ __name((authParameters) => {
      const options = [];
      switch (authParameters.operation) {
        default: {
          options.push(createAwsAuthSigv4HttpAuthOption(authParameters));
          options.push(createAwsAuthSigv4aHttpAuthOption(authParameters));
        }
      }
      return options;
    }, "_defaultS3HttpAuthSchemeProvider");
    defaultS3HttpAuthSchemeProvider = createEndpointRuleSetHttpAuthSchemeProvider(defaultEndpointResolver, _defaultS3HttpAuthSchemeProvider, {
      "aws.auth#sigv4": createAwsAuthSigv4HttpAuthOption,
      "aws.auth#sigv4a": createAwsAuthSigv4aHttpAuthOption
    });
    resolveHttpAuthSchemeConfig = /* @__PURE__ */ __name((config) => {
      const config_0 = resolveAwsSdkSigV4Config(config);
      const config_1 = resolveAwsSdkSigV4AConfig(config_0);
      return {
        ...config_1
      };
    }, "resolveHttpAuthSchemeConfig");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/endpoint/EndpointParameters.js
var resolveClientEndpointParameters, commonParams;
var init_EndpointParameters = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/endpoint/EndpointParameters.js"() {
    init_import_meta_url();
    resolveClientEndpointParameters = /* @__PURE__ */ __name((options) => {
      return {
        ...options,
        useFipsEndpoint: options.useFipsEndpoint ?? false,
        useDualstackEndpoint: options.useDualstackEndpoint ?? false,
        forcePathStyle: options.forcePathStyle ?? false,
        useAccelerateEndpoint: options.useAccelerateEndpoint ?? false,
        useGlobalEndpoint: options.useGlobalEndpoint ?? false,
        disableMultiregionAccessPoints: options.disableMultiregionAccessPoints ?? false,
        defaultSigningName: "s3"
      };
    }, "resolveClientEndpointParameters");
    commonParams = {
      ForcePathStyle: { type: "clientContextParams", name: "forcePathStyle" },
      UseArnRegion: { type: "clientContextParams", name: "useArnRegion" },
      DisableMultiRegionAccessPoints: { type: "clientContextParams", name: "disableMultiregionAccessPoints" },
      Accelerate: { type: "clientContextParams", name: "useAccelerateEndpoint" },
      DisableS3ExpressSessionAuth: { type: "clientContextParams", name: "disableS3ExpressSessionAuth" },
      UseGlobalEndpoint: { type: "builtInParams", name: "useGlobalEndpoint" },
      UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
      Endpoint: { type: "builtInParams", name: "endpoint" },
      Region: { type: "builtInParams", name: "region" },
      UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/models/S3ServiceException.js
var S3ServiceException;
var init_S3ServiceException = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/models/S3ServiceException.js"() {
    init_import_meta_url();
    init_dist_es20();
    S3ServiceException = class _S3ServiceException extends ServiceException {
      static {
        __name(this, "S3ServiceException");
      }
      constructor(options) {
        super(options);
        Object.setPrototypeOf(this, _S3ServiceException.prototype);
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/models/models_0.js
var NoSuchUpload, ObjectNotInActiveTierError, BucketAlreadyExists, BucketAlreadyOwnedByYou, NoSuchBucket, AnalyticsFilter, MetricsFilter, InvalidObjectState, NoSuchKey, NotFound, CompleteMultipartUploadOutputFilterSensitiveLog, CompleteMultipartUploadRequestFilterSensitiveLog, CopyObjectOutputFilterSensitiveLog, CopyObjectRequestFilterSensitiveLog, CreateMultipartUploadOutputFilterSensitiveLog, CreateMultipartUploadRequestFilterSensitiveLog, SessionCredentialsFilterSensitiveLog, CreateSessionOutputFilterSensitiveLog, CreateSessionRequestFilterSensitiveLog, ServerSideEncryptionByDefaultFilterSensitiveLog, ServerSideEncryptionRuleFilterSensitiveLog, ServerSideEncryptionConfigurationFilterSensitiveLog, GetBucketEncryptionOutputFilterSensitiveLog, SSEKMSFilterSensitiveLog, InventoryEncryptionFilterSensitiveLog, InventoryS3BucketDestinationFilterSensitiveLog, InventoryDestinationFilterSensitiveLog, InventoryConfigurationFilterSensitiveLog, GetBucketInventoryConfigurationOutputFilterSensitiveLog, GetObjectOutputFilterSensitiveLog, GetObjectRequestFilterSensitiveLog, GetObjectAttributesRequestFilterSensitiveLog, GetObjectTorrentOutputFilterSensitiveLog, HeadObjectOutputFilterSensitiveLog, HeadObjectRequestFilterSensitiveLog, ListBucketInventoryConfigurationsOutputFilterSensitiveLog, ListPartsRequestFilterSensitiveLog;
var init_models_0 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/models/models_0.js"() {
    init_import_meta_url();
    init_dist_es20();
    init_S3ServiceException();
    NoSuchUpload = class _NoSuchUpload extends S3ServiceException {
      static {
        __name(this, "NoSuchUpload");
      }
      constructor(opts) {
        super({
          name: "NoSuchUpload",
          $fault: "client",
          ...opts
        });
        this.name = "NoSuchUpload";
        this.$fault = "client";
        Object.setPrototypeOf(this, _NoSuchUpload.prototype);
      }
    };
    ObjectNotInActiveTierError = class _ObjectNotInActiveTierError extends S3ServiceException {
      static {
        __name(this, "ObjectNotInActiveTierError");
      }
      constructor(opts) {
        super({
          name: "ObjectNotInActiveTierError",
          $fault: "client",
          ...opts
        });
        this.name = "ObjectNotInActiveTierError";
        this.$fault = "client";
        Object.setPrototypeOf(this, _ObjectNotInActiveTierError.prototype);
      }
    };
    BucketAlreadyExists = class _BucketAlreadyExists extends S3ServiceException {
      static {
        __name(this, "BucketAlreadyExists");
      }
      constructor(opts) {
        super({
          name: "BucketAlreadyExists",
          $fault: "client",
          ...opts
        });
        this.name = "BucketAlreadyExists";
        this.$fault = "client";
        Object.setPrototypeOf(this, _BucketAlreadyExists.prototype);
      }
    };
    BucketAlreadyOwnedByYou = class _BucketAlreadyOwnedByYou extends S3ServiceException {
      static {
        __name(this, "BucketAlreadyOwnedByYou");
      }
      constructor(opts) {
        super({
          name: "BucketAlreadyOwnedByYou",
          $fault: "client",
          ...opts
        });
        this.name = "BucketAlreadyOwnedByYou";
        this.$fault = "client";
        Object.setPrototypeOf(this, _BucketAlreadyOwnedByYou.prototype);
      }
    };
    NoSuchBucket = class _NoSuchBucket extends S3ServiceException {
      static {
        __name(this, "NoSuchBucket");
      }
      constructor(opts) {
        super({
          name: "NoSuchBucket",
          $fault: "client",
          ...opts
        });
        this.name = "NoSuchBucket";
        this.$fault = "client";
        Object.setPrototypeOf(this, _NoSuchBucket.prototype);
      }
    };
    (function(AnalyticsFilter2) {
      AnalyticsFilter2.visit = (value, visitor) => {
        if (value.Prefix !== void 0)
          return visitor.Prefix(value.Prefix);
        if (value.Tag !== void 0)
          return visitor.Tag(value.Tag);
        if (value.And !== void 0)
          return visitor.And(value.And);
        return visitor._(value.$unknown[0], value.$unknown[1]);
      };
    })(AnalyticsFilter || (AnalyticsFilter = {}));
    (function(MetricsFilter2) {
      MetricsFilter2.visit = (value, visitor) => {
        if (value.Prefix !== void 0)
          return visitor.Prefix(value.Prefix);
        if (value.Tag !== void 0)
          return visitor.Tag(value.Tag);
        if (value.AccessPointArn !== void 0)
          return visitor.AccessPointArn(value.AccessPointArn);
        if (value.And !== void 0)
          return visitor.And(value.And);
        return visitor._(value.$unknown[0], value.$unknown[1]);
      };
    })(MetricsFilter || (MetricsFilter = {}));
    InvalidObjectState = class _InvalidObjectState extends S3ServiceException {
      static {
        __name(this, "InvalidObjectState");
      }
      constructor(opts) {
        super({
          name: "InvalidObjectState",
          $fault: "client",
          ...opts
        });
        this.name = "InvalidObjectState";
        this.$fault = "client";
        Object.setPrototypeOf(this, _InvalidObjectState.prototype);
        this.StorageClass = opts.StorageClass;
        this.AccessTier = opts.AccessTier;
      }
    };
    NoSuchKey = class _NoSuchKey extends S3ServiceException {
      static {
        __name(this, "NoSuchKey");
      }
      constructor(opts) {
        super({
          name: "NoSuchKey",
          $fault: "client",
          ...opts
        });
        this.name = "NoSuchKey";
        this.$fault = "client";
        Object.setPrototypeOf(this, _NoSuchKey.prototype);
      }
    };
    NotFound = class _NotFound extends S3ServiceException {
      static {
        __name(this, "NotFound");
      }
      constructor(opts) {
        super({
          name: "NotFound",
          $fault: "client",
          ...opts
        });
        this.name = "NotFound";
        this.$fault = "client";
        Object.setPrototypeOf(this, _NotFound.prototype);
      }
    };
    CompleteMultipartUploadOutputFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
      ...obj,
      ...obj.SSEKMSKeyId && { SSEKMSKeyId: SENSITIVE_STRING }
    }), "CompleteMultipartUploadOutputFilterSensitiveLog");
    CompleteMultipartUploadRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
      ...obj,
      ...obj.SSECustomerKey && { SSECustomerKey: SENSITIVE_STRING }
    }), "CompleteMultipartUploadRequestFilterSensitiveLog");
    CopyObjectOutputFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
      ...obj,
      ...obj.SSEKMSKeyId && { SSEKMSKeyId: SENSITIVE_STRING },
      ...obj.SSEKMSEncryptionContext && { SSEKMSEncryptionContext: SENSITIVE_STRING }
    }), "CopyObjectOutputFilterSensitiveLog");
    CopyObjectRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
      ...obj,
      ...obj.SSECustomerKey && { SSECustomerKey: SENSITIVE_STRING },
      ...obj.SSEKMSKeyId && { SSEKMSKeyId: SENSITIVE_STRING },
      ...obj.SSEKMSEncryptionContext && { SSEKMSEncryptionContext: SENSITIVE_STRING },
      ...obj.CopySourceSSECustomerKey && { CopySourceSSECustomerKey: SENSITIVE_STRING }
    }), "CopyObjectRequestFilterSensitiveLog");
    CreateMultipartUploadOutputFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
      ...obj,
      ...obj.SSEKMSKeyId && { SSEKMSKeyId: SENSITIVE_STRING },
      ...obj.SSEKMSEncryptionContext && { SSEKMSEncryptionContext: SENSITIVE_STRING }
    }), "CreateMultipartUploadOutputFilterSensitiveLog");
    CreateMultipartUploadRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
      ...obj,
      ...obj.SSECustomerKey && { SSECustomerKey: SENSITIVE_STRING },
      ...obj.SSEKMSKeyId && { SSEKMSKeyId: SENSITIVE_STRING },
      ...obj.SSEKMSEncryptionContext && { SSEKMSEncryptionContext: SENSITIVE_STRING }
    }), "CreateMultipartUploadRequestFilterSensitiveLog");
    SessionCredentialsFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
      ...obj,
      ...obj.SecretAccessKey && { SecretAccessKey: SENSITIVE_STRING },
      ...obj.SessionToken && { SessionToken: SENSITIVE_STRING }
    }), "SessionCredentialsFilterSensitiveLog");
    CreateSessionOutputFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
      ...obj,
      ...obj.SSEKMSKeyId && { SSEKMSKeyId: SENSITIVE_STRING },
      ...obj.SSEKMSEncryptionContext && { SSEKMSEncryptionContext: SENSITIVE_STRING },
      ...obj.Credentials && { Credentials: SessionCredentialsFilterSensitiveLog(obj.Credentials) }
    }), "CreateSessionOutputFilterSensitiveLog");
    CreateSessionRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
      ...obj,
      ...obj.SSEKMSKeyId && { SSEKMSKeyId: SENSITIVE_STRING },
      ...obj.SSEKMSEncryptionContext && { SSEKMSEncryptionContext: SENSITIVE_STRING }
    }), "CreateSessionRequestFilterSensitiveLog");
    ServerSideEncryptionByDefaultFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
      ...obj,
      ...obj.KMSMasterKeyID && { KMSMasterKeyID: SENSITIVE_STRING }
    }), "ServerSideEncryptionByDefaultFilterSensitiveLog");
    ServerSideEncryptionRuleFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
      ...obj,
      ...obj.ApplyServerSideEncryptionByDefault && {
        ApplyServerSideEncryptionByDefault: ServerSideEncryptionByDefaultFilterSensitiveLog(obj.ApplyServerSideEncryptionByDefault)
      }
    }), "ServerSideEncryptionRuleFilterSensitiveLog");
    ServerSideEncryptionConfigurationFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
      ...obj,
      ...obj.Rules && { Rules: obj.Rules.map((item) => ServerSideEncryptionRuleFilterSensitiveLog(item)) }
    }), "ServerSideEncryptionConfigurationFilterSensitiveLog");
    GetBucketEncryptionOutputFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
      ...obj,
      ...obj.ServerSideEncryptionConfiguration && {
        ServerSideEncryptionConfiguration: ServerSideEncryptionConfigurationFilterSensitiveLog(obj.ServerSideEncryptionConfiguration)
      }
    }), "GetBucketEncryptionOutputFilterSensitiveLog");
    SSEKMSFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
      ...obj,
      ...obj.KeyId && { KeyId: SENSITIVE_STRING }
    }), "SSEKMSFilterSensitiveLog");
    InventoryEncryptionFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
      ...obj,
      ...obj.SSEKMS && { SSEKMS: SSEKMSFilterSensitiveLog(obj.SSEKMS) }
    }), "InventoryEncryptionFilterSensitiveLog");
    InventoryS3BucketDestinationFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
      ...obj,
      ...obj.Encryption && { Encryption: InventoryEncryptionFilterSensitiveLog(obj.Encryption) }
    }), "InventoryS3BucketDestinationFilterSensitiveLog");
    InventoryDestinationFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
      ...obj,
      ...obj.S3BucketDestination && {
        S3BucketDestination: InventoryS3BucketDestinationFilterSensitiveLog(obj.S3BucketDestination)
      }
    }), "InventoryDestinationFilterSensitiveLog");
    InventoryConfigurationFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
      ...obj,
      ...obj.Destination && { Destination: InventoryDestinationFilterSensitiveLog(obj.Destination) }
    }), "InventoryConfigurationFilterSensitiveLog");
    GetBucketInventoryConfigurationOutputFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
      ...obj,
      ...obj.InventoryConfiguration && {
        InventoryConfiguration: InventoryConfigurationFilterSensitiveLog(obj.InventoryConfiguration)
      }
    }), "GetBucketInventoryConfigurationOutputFilterSensitiveLog");
    GetObjectOutputFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
      ...obj,
      ...obj.SSEKMSKeyId && { SSEKMSKeyId: SENSITIVE_STRING }
    }), "GetObjectOutputFilterSensitiveLog");
    GetObjectRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
      ...obj,
      ...obj.SSECustomerKey && { SSECustomerKey: SENSITIVE_STRING }
    }), "GetObjectRequestFilterSensitiveLog");
    GetObjectAttributesRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
      ...obj,
      ...obj.SSECustomerKey && { SSECustomerKey: SENSITIVE_STRING }
    }), "GetObjectAttributesRequestFilterSensitiveLog");
    GetObjectTorrentOutputFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
      ...obj
    }), "GetObjectTorrentOutputFilterSensitiveLog");
    HeadObjectOutputFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
      ...obj,
      ...obj.SSEKMSKeyId && { SSEKMSKeyId: SENSITIVE_STRING }
    }), "HeadObjectOutputFilterSensitiveLog");
    HeadObjectRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
      ...obj,
      ...obj.SSECustomerKey && { SSECustomerKey: SENSITIVE_STRING }
    }), "HeadObjectRequestFilterSensitiveLog");
    ListBucketInventoryConfigurationsOutputFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
      ...obj,
      ...obj.InventoryConfigurationList && {
        InventoryConfigurationList: obj.InventoryConfigurationList.map((item) => InventoryConfigurationFilterSensitiveLog(item))
      }
    }), "ListBucketInventoryConfigurationsOutputFilterSensitiveLog");
    ListPartsRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
      ...obj,
      ...obj.SSECustomerKey && { SSECustomerKey: SENSITIVE_STRING }
    }), "ListPartsRequestFilterSensitiveLog");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+xml-builder@3.709.0/node_modules/@aws-sdk/xml-builder/dist-es/escape-attribute.js
function escapeAttribute(value) {
  return value.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
}
var init_escape_attribute = __esm({
  "../../node_modules/.pnpm/@aws-sdk+xml-builder@3.709.0/node_modules/@aws-sdk/xml-builder/dist-es/escape-attribute.js"() {
    init_import_meta_url();
    __name(escapeAttribute, "escapeAttribute");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+xml-builder@3.709.0/node_modules/@aws-sdk/xml-builder/dist-es/escape-element.js
function escapeElement(value) {
  return value.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/'/g, "&apos;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/\r/g, "&#x0D;").replace(/\n/g, "&#x0A;").replace(/\u0085/g, "&#x85;").replace(/\u2028/, "&#x2028;");
}
var init_escape_element = __esm({
  "../../node_modules/.pnpm/@aws-sdk+xml-builder@3.709.0/node_modules/@aws-sdk/xml-builder/dist-es/escape-element.js"() {
    init_import_meta_url();
    __name(escapeElement, "escapeElement");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+xml-builder@3.709.0/node_modules/@aws-sdk/xml-builder/dist-es/XmlText.js
var XmlText;
var init_XmlText = __esm({
  "../../node_modules/.pnpm/@aws-sdk+xml-builder@3.709.0/node_modules/@aws-sdk/xml-builder/dist-es/XmlText.js"() {
    init_import_meta_url();
    init_escape_element();
    XmlText = class {
      static {
        __name(this, "XmlText");
      }
      constructor(value) {
        this.value = value;
      }
      toString() {
        return escapeElement("" + this.value);
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+xml-builder@3.709.0/node_modules/@aws-sdk/xml-builder/dist-es/XmlNode.js
var XmlNode;
var init_XmlNode = __esm({
  "../../node_modules/.pnpm/@aws-sdk+xml-builder@3.709.0/node_modules/@aws-sdk/xml-builder/dist-es/XmlNode.js"() {
    init_import_meta_url();
    init_escape_attribute();
    init_XmlText();
    XmlNode = class _XmlNode {
      static {
        __name(this, "XmlNode");
      }
      static of(name2, childText, withName) {
        const node2 = new _XmlNode(name2);
        if (childText !== void 0) {
          node2.addChildNode(new XmlText(childText));
        }
        if (withName !== void 0) {
          node2.withName(withName);
        }
        return node2;
      }
      constructor(name2, children = []) {
        this.name = name2;
        this.children = children;
        this.attributes = {};
      }
      withName(name2) {
        this.name = name2;
        return this;
      }
      addAttribute(name2, value) {
        this.attributes[name2] = value;
        return this;
      }
      addChildNode(child) {
        this.children.push(child);
        return this;
      }
      removeAttribute(name2) {
        delete this.attributes[name2];
        return this;
      }
      n(name2) {
        this.name = name2;
        return this;
      }
      c(child) {
        this.children.push(child);
        return this;
      }
      a(name2, value) {
        if (value != null) {
          this.attributes[name2] = value;
        }
        return this;
      }
      cc(input, field, withName = field) {
        if (input[field] != null) {
          const node2 = _XmlNode.of(field, input[field]).withName(withName);
          this.c(node2);
        }
      }
      l(input, listName, memberName, valueProvider) {
        if (input[listName] != null) {
          const nodes = valueProvider();
          nodes.map((node2) => {
            node2.withName(memberName);
            this.c(node2);
          });
        }
      }
      lc(input, listName, memberName, valueProvider) {
        if (input[listName] != null) {
          const nodes = valueProvider();
          const containerNode = new _XmlNode(memberName);
          nodes.map((node2) => {
            containerNode.c(node2);
          });
          this.c(containerNode);
        }
      }
      toString() {
        const hasChildren = Boolean(this.children.length);
        let xmlText = `<${this.name}`;
        const attributes = this.attributes;
        for (const attributeName of Object.keys(attributes)) {
          const attribute = attributes[attributeName];
          if (attribute != null) {
            xmlText += ` ${attributeName}="${escapeAttribute("" + attribute)}"`;
          }
        }
        return xmlText += !hasChildren ? "/>" : `>${this.children.map((c8) => c8.toString()).join("")}</${this.name}>`;
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+xml-builder@3.709.0/node_modules/@aws-sdk/xml-builder/dist-es/index.js
var init_dist_es47 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+xml-builder@3.709.0/node_modules/@aws-sdk/xml-builder/dist-es/index.js"() {
    init_import_meta_url();
    init_XmlNode();
    init_XmlText();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/models/models_1.js
var EncryptionTypeMismatch, InvalidRequest, InvalidWriteOffset, TooManyParts, ObjectAlreadyInActiveTierError, SelectObjectContentEventStream, PutBucketEncryptionRequestFilterSensitiveLog, PutBucketInventoryConfigurationRequestFilterSensitiveLog, PutObjectOutputFilterSensitiveLog, PutObjectRequestFilterSensitiveLog, EncryptionFilterSensitiveLog, S3LocationFilterSensitiveLog, OutputLocationFilterSensitiveLog, RestoreRequestFilterSensitiveLog, RestoreObjectRequestFilterSensitiveLog, SelectObjectContentOutputFilterSensitiveLog, SelectObjectContentRequestFilterSensitiveLog, UploadPartOutputFilterSensitiveLog, UploadPartRequestFilterSensitiveLog, UploadPartCopyOutputFilterSensitiveLog, UploadPartCopyRequestFilterSensitiveLog, WriteGetObjectResponseRequestFilterSensitiveLog;
var init_models_1 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/models/models_1.js"() {
    init_import_meta_url();
    init_dist_es20();
    init_models_0();
    init_S3ServiceException();
    EncryptionTypeMismatch = class _EncryptionTypeMismatch extends S3ServiceException {
      static {
        __name(this, "EncryptionTypeMismatch");
      }
      constructor(opts) {
        super({
          name: "EncryptionTypeMismatch",
          $fault: "client",
          ...opts
        });
        this.name = "EncryptionTypeMismatch";
        this.$fault = "client";
        Object.setPrototypeOf(this, _EncryptionTypeMismatch.prototype);
      }
    };
    InvalidRequest = class _InvalidRequest extends S3ServiceException {
      static {
        __name(this, "InvalidRequest");
      }
      constructor(opts) {
        super({
          name: "InvalidRequest",
          $fault: "client",
          ...opts
        });
        this.name = "InvalidRequest";
        this.$fault = "client";
        Object.setPrototypeOf(this, _InvalidRequest.prototype);
      }
    };
    InvalidWriteOffset = class _InvalidWriteOffset extends S3ServiceException {
      static {
        __name(this, "InvalidWriteOffset");
      }
      constructor(opts) {
        super({
          name: "InvalidWriteOffset",
          $fault: "client",
          ...opts
        });
        this.name = "InvalidWriteOffset";
        this.$fault = "client";
        Object.setPrototypeOf(this, _InvalidWriteOffset.prototype);
      }
    };
    TooManyParts = class _TooManyParts extends S3ServiceException {
      static {
        __name(this, "TooManyParts");
      }
      constructor(opts) {
        super({
          name: "TooManyParts",
          $fault: "client",
          ...opts
        });
        this.name = "TooManyParts";
        this.$fault = "client";
        Object.setPrototypeOf(this, _TooManyParts.prototype);
      }
    };
    ObjectAlreadyInActiveTierError = class _ObjectAlreadyInActiveTierError extends S3ServiceException {
      static {
        __name(this, "ObjectAlreadyInActiveTierError");
      }
      constructor(opts) {
        super({
          name: "ObjectAlreadyInActiveTierError",
          $fault: "client",
          ...opts
        });
        this.name = "ObjectAlreadyInActiveTierError";
        this.$fault = "client";
        Object.setPrototypeOf(this, _ObjectAlreadyInActiveTierError.prototype);
      }
    };
    (function(SelectObjectContentEventStream2) {
      SelectObjectContentEventStream2.visit = (value, visitor) => {
        if (value.Records !== void 0)
          return visitor.Records(value.Records);
        if (value.Stats !== void 0)
          return visitor.Stats(value.Stats);
        if (value.Progress !== void 0)
          return visitor.Progress(value.Progress);
        if (value.Cont !== void 0)
          return visitor.Cont(value.Cont);
        if (value.End !== void 0)
          return visitor.End(value.End);
        return visitor._(value.$unknown[0], value.$unknown[1]);
      };
    })(SelectObjectContentEventStream || (SelectObjectContentEventStream = {}));
    PutBucketEncryptionRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
      ...obj,
      ...obj.ServerSideEncryptionConfiguration && {
        ServerSideEncryptionConfiguration: ServerSideEncryptionConfigurationFilterSensitiveLog(obj.ServerSideEncryptionConfiguration)
      }
    }), "PutBucketEncryptionRequestFilterSensitiveLog");
    PutBucketInventoryConfigurationRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
      ...obj,
      ...obj.InventoryConfiguration && {
        InventoryConfiguration: InventoryConfigurationFilterSensitiveLog(obj.InventoryConfiguration)
      }
    }), "PutBucketInventoryConfigurationRequestFilterSensitiveLog");
    PutObjectOutputFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
      ...obj,
      ...obj.SSEKMSKeyId && { SSEKMSKeyId: SENSITIVE_STRING },
      ...obj.SSEKMSEncryptionContext && { SSEKMSEncryptionContext: SENSITIVE_STRING }
    }), "PutObjectOutputFilterSensitiveLog");
    PutObjectRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
      ...obj,
      ...obj.SSECustomerKey && { SSECustomerKey: SENSITIVE_STRING },
      ...obj.SSEKMSKeyId && { SSEKMSKeyId: SENSITIVE_STRING },
      ...obj.SSEKMSEncryptionContext && { SSEKMSEncryptionContext: SENSITIVE_STRING }
    }), "PutObjectRequestFilterSensitiveLog");
    EncryptionFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
      ...obj,
      ...obj.KMSKeyId && { KMSKeyId: SENSITIVE_STRING }
    }), "EncryptionFilterSensitiveLog");
    S3LocationFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
      ...obj,
      ...obj.Encryption && { Encryption: EncryptionFilterSensitiveLog(obj.Encryption) }
    }), "S3LocationFilterSensitiveLog");
    OutputLocationFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
      ...obj,
      ...obj.S3 && { S3: S3LocationFilterSensitiveLog(obj.S3) }
    }), "OutputLocationFilterSensitiveLog");
    RestoreRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
      ...obj,
      ...obj.OutputLocation && { OutputLocation: OutputLocationFilterSensitiveLog(obj.OutputLocation) }
    }), "RestoreRequestFilterSensitiveLog");
    RestoreObjectRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
      ...obj,
      ...obj.RestoreRequest && { RestoreRequest: RestoreRequestFilterSensitiveLog(obj.RestoreRequest) }
    }), "RestoreObjectRequestFilterSensitiveLog");
    SelectObjectContentOutputFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
      ...obj,
      ...obj.Payload && { Payload: "STREAMING_CONTENT" }
    }), "SelectObjectContentOutputFilterSensitiveLog");
    SelectObjectContentRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
      ...obj,
      ...obj.SSECustomerKey && { SSECustomerKey: SENSITIVE_STRING }
    }), "SelectObjectContentRequestFilterSensitiveLog");
    UploadPartOutputFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
      ...obj,
      ...obj.SSEKMSKeyId && { SSEKMSKeyId: SENSITIVE_STRING }
    }), "UploadPartOutputFilterSensitiveLog");
    UploadPartRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
      ...obj,
      ...obj.SSECustomerKey && { SSECustomerKey: SENSITIVE_STRING }
    }), "UploadPartRequestFilterSensitiveLog");
    UploadPartCopyOutputFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
      ...obj,
      ...obj.SSEKMSKeyId && { SSEKMSKeyId: SENSITIVE_STRING }
    }), "UploadPartCopyOutputFilterSensitiveLog");
    UploadPartCopyRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
      ...obj,
      ...obj.SSECustomerKey && { SSECustomerKey: SENSITIVE_STRING },
      ...obj.CopySourceSSECustomerKey && { CopySourceSSECustomerKey: SENSITIVE_STRING }
    }), "UploadPartCopyRequestFilterSensitiveLog");
    WriteGetObjectResponseRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
      ...obj,
      ...obj.SSEKMSKeyId && { SSEKMSKeyId: SENSITIVE_STRING }
    }), "WriteGetObjectResponseRequestFilterSensitiveLog");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/protocols/Aws_restXml.js
var se_AbortMultipartUploadCommand, se_CompleteMultipartUploadCommand, se_CopyObjectCommand, se_CreateBucketCommand, se_CreateBucketMetadataTableConfigurationCommand, se_CreateMultipartUploadCommand, se_CreateSessionCommand, se_DeleteBucketCommand, se_DeleteBucketAnalyticsConfigurationCommand, se_DeleteBucketCorsCommand, se_DeleteBucketEncryptionCommand, se_DeleteBucketIntelligentTieringConfigurationCommand, se_DeleteBucketInventoryConfigurationCommand, se_DeleteBucketLifecycleCommand, se_DeleteBucketMetadataTableConfigurationCommand, se_DeleteBucketMetricsConfigurationCommand, se_DeleteBucketOwnershipControlsCommand, se_DeleteBucketPolicyCommand, se_DeleteBucketReplicationCommand, se_DeleteBucketTaggingCommand, se_DeleteBucketWebsiteCommand, se_DeleteObjectCommand, se_DeleteObjectsCommand, se_DeleteObjectTaggingCommand, se_DeletePublicAccessBlockCommand, se_GetBucketAccelerateConfigurationCommand, se_GetBucketAclCommand, se_GetBucketAnalyticsConfigurationCommand, se_GetBucketCorsCommand, se_GetBucketEncryptionCommand, se_GetBucketIntelligentTieringConfigurationCommand, se_GetBucketInventoryConfigurationCommand, se_GetBucketLifecycleConfigurationCommand, se_GetBucketLocationCommand, se_GetBucketLoggingCommand, se_GetBucketMetadataTableConfigurationCommand, se_GetBucketMetricsConfigurationCommand, se_GetBucketNotificationConfigurationCommand, se_GetBucketOwnershipControlsCommand, se_GetBucketPolicyCommand, se_GetBucketPolicyStatusCommand, se_GetBucketReplicationCommand, se_GetBucketRequestPaymentCommand, se_GetBucketTaggingCommand, se_GetBucketVersioningCommand, se_GetBucketWebsiteCommand, se_GetObjectCommand, se_GetObjectAclCommand, se_GetObjectAttributesCommand, se_GetObjectLegalHoldCommand, se_GetObjectLockConfigurationCommand, se_GetObjectRetentionCommand, se_GetObjectTaggingCommand, se_GetObjectTorrentCommand, se_GetPublicAccessBlockCommand, se_HeadBucketCommand, se_HeadObjectCommand, se_ListBucketAnalyticsConfigurationsCommand, se_ListBucketIntelligentTieringConfigurationsCommand, se_ListBucketInventoryConfigurationsCommand, se_ListBucketMetricsConfigurationsCommand, se_ListBucketsCommand, se_ListDirectoryBucketsCommand, se_ListMultipartUploadsCommand, se_ListObjectsCommand, se_ListObjectsV2Command, se_ListObjectVersionsCommand, se_ListPartsCommand, se_PutBucketAccelerateConfigurationCommand, se_PutBucketAclCommand, se_PutBucketAnalyticsConfigurationCommand, se_PutBucketCorsCommand, se_PutBucketEncryptionCommand, se_PutBucketIntelligentTieringConfigurationCommand, se_PutBucketInventoryConfigurationCommand, se_PutBucketLifecycleConfigurationCommand, se_PutBucketLoggingCommand, se_PutBucketMetricsConfigurationCommand, se_PutBucketNotificationConfigurationCommand, se_PutBucketOwnershipControlsCommand, se_PutBucketPolicyCommand, se_PutBucketReplicationCommand, se_PutBucketRequestPaymentCommand, se_PutBucketTaggingCommand, se_PutBucketVersioningCommand, se_PutBucketWebsiteCommand, se_PutObjectCommand, se_PutObjectAclCommand, se_PutObjectLegalHoldCommand, se_PutObjectLockConfigurationCommand, se_PutObjectRetentionCommand, se_PutObjectTaggingCommand, se_PutPublicAccessBlockCommand, se_RestoreObjectCommand, se_SelectObjectContentCommand, se_UploadPartCommand, se_UploadPartCopyCommand, se_WriteGetObjectResponseCommand, de_AbortMultipartUploadCommand, de_CompleteMultipartUploadCommand, de_CopyObjectCommand, de_CreateBucketCommand, de_CreateBucketMetadataTableConfigurationCommand, de_CreateMultipartUploadCommand, de_CreateSessionCommand, de_DeleteBucketCommand, de_DeleteBucketAnalyticsConfigurationCommand, de_DeleteBucketCorsCommand, de_DeleteBucketEncryptionCommand, de_DeleteBucketIntelligentTieringConfigurationCommand, de_DeleteBucketInventoryConfigurationCommand, de_DeleteBucketLifecycleCommand, de_DeleteBucketMetadataTableConfigurationCommand, de_DeleteBucketMetricsConfigurationCommand, de_DeleteBucketOwnershipControlsCommand, de_DeleteBucketPolicyCommand, de_DeleteBucketReplicationCommand, de_DeleteBucketTaggingCommand, de_DeleteBucketWebsiteCommand, de_DeleteObjectCommand, de_DeleteObjectsCommand, de_DeleteObjectTaggingCommand, de_DeletePublicAccessBlockCommand, de_GetBucketAccelerateConfigurationCommand, de_GetBucketAclCommand, de_GetBucketAnalyticsConfigurationCommand, de_GetBucketCorsCommand, de_GetBucketEncryptionCommand, de_GetBucketIntelligentTieringConfigurationCommand, de_GetBucketInventoryConfigurationCommand, de_GetBucketLifecycleConfigurationCommand, de_GetBucketLocationCommand, de_GetBucketLoggingCommand, de_GetBucketMetadataTableConfigurationCommand, de_GetBucketMetricsConfigurationCommand, de_GetBucketNotificationConfigurationCommand, de_GetBucketOwnershipControlsCommand, de_GetBucketPolicyCommand, de_GetBucketPolicyStatusCommand, de_GetBucketReplicationCommand, de_GetBucketRequestPaymentCommand, de_GetBucketTaggingCommand, de_GetBucketVersioningCommand, de_GetBucketWebsiteCommand, de_GetObjectCommand, de_GetObjectAclCommand, de_GetObjectAttributesCommand, de_GetObjectLegalHoldCommand, de_GetObjectLockConfigurationCommand, de_GetObjectRetentionCommand, de_GetObjectTaggingCommand, de_GetObjectTorrentCommand, de_GetPublicAccessBlockCommand, de_HeadBucketCommand, de_HeadObjectCommand, de_ListBucketAnalyticsConfigurationsCommand, de_ListBucketIntelligentTieringConfigurationsCommand, de_ListBucketInventoryConfigurationsCommand, de_ListBucketMetricsConfigurationsCommand, de_ListBucketsCommand, de_ListDirectoryBucketsCommand, de_ListMultipartUploadsCommand, de_ListObjectsCommand, de_ListObjectsV2Command, de_ListObjectVersionsCommand, de_ListPartsCommand, de_PutBucketAccelerateConfigurationCommand, de_PutBucketAclCommand, de_PutBucketAnalyticsConfigurationCommand, de_PutBucketCorsCommand, de_PutBucketEncryptionCommand, de_PutBucketIntelligentTieringConfigurationCommand, de_PutBucketInventoryConfigurationCommand, de_PutBucketLifecycleConfigurationCommand, de_PutBucketLoggingCommand, de_PutBucketMetricsConfigurationCommand, de_PutBucketNotificationConfigurationCommand, de_PutBucketOwnershipControlsCommand, de_PutBucketPolicyCommand, de_PutBucketReplicationCommand, de_PutBucketRequestPaymentCommand, de_PutBucketTaggingCommand, de_PutBucketVersioningCommand, de_PutBucketWebsiteCommand, de_PutObjectCommand, de_PutObjectAclCommand, de_PutObjectLegalHoldCommand, de_PutObjectLockConfigurationCommand, de_PutObjectRetentionCommand, de_PutObjectTaggingCommand, de_PutPublicAccessBlockCommand, de_RestoreObjectCommand, de_SelectObjectContentCommand, de_UploadPartCommand, de_UploadPartCopyCommand, de_WriteGetObjectResponseCommand, de_CommandError, throwDefaultError2, de_BucketAlreadyExistsRes, de_BucketAlreadyOwnedByYouRes, de_EncryptionTypeMismatchRes, de_InvalidObjectStateRes, de_InvalidRequestRes, de_InvalidWriteOffsetRes, de_NoSuchBucketRes, de_NoSuchKeyRes, de_NoSuchUploadRes, de_NotFoundRes, de_ObjectAlreadyInActiveTierErrorRes, de_ObjectNotInActiveTierErrorRes, de_TooManyPartsRes, de_SelectObjectContentEventStream, de_ContinuationEvent_event, de_EndEvent_event, de_ProgressEvent_event, de_RecordsEvent_event, de_StatsEvent_event, se_AbortIncompleteMultipartUpload, se_AccelerateConfiguration, se_AccessControlPolicy, se_AccessControlTranslation, se_AllowedHeaders, se_AllowedMethods, se_AllowedOrigins, se_AnalyticsAndOperator, se_AnalyticsConfiguration, se_AnalyticsExportDestination, se_AnalyticsFilter, se_AnalyticsS3BucketDestination, se_BucketInfo, se_BucketLifecycleConfiguration, se_BucketLoggingStatus, se_CompletedMultipartUpload, se_CompletedPart, se_CompletedPartList, se_Condition, se_CORSConfiguration, se_CORSRule, se_CORSRules, se_CreateBucketConfiguration, se_CSVInput, se_CSVOutput, se_DefaultRetention, se_Delete, se_DeleteMarkerReplication, se_Destination, se_Encryption, se_EncryptionConfiguration, se_ErrorDocument, se_EventBridgeConfiguration, se_EventList, se_ExistingObjectReplication, se_ExposeHeaders, se_FilterRule, se_FilterRuleList, se_GlacierJobParameters, se_Grant, se_Grantee, se_Grants, se_IndexDocument, se_InputSerialization, se_IntelligentTieringAndOperator, se_IntelligentTieringConfiguration, se_IntelligentTieringFilter, se_InventoryConfiguration, se_InventoryDestination, se_InventoryEncryption, se_InventoryFilter, se_InventoryOptionalFields, se_InventoryS3BucketDestination, se_InventorySchedule, se_JSONInput, se_JSONOutput, se_LambdaFunctionConfiguration, se_LambdaFunctionConfigurationList, se_LifecycleExpiration, se_LifecycleRule, se_LifecycleRuleAndOperator, se_LifecycleRuleFilter, se_LifecycleRules, se_LocationInfo, se_LoggingEnabled, se_MetadataEntry, se_MetadataTableConfiguration, se_Metrics, se_MetricsAndOperator, se_MetricsConfiguration, se_MetricsFilter, se_NoncurrentVersionExpiration, se_NoncurrentVersionTransition, se_NoncurrentVersionTransitionList, se_NotificationConfiguration, se_NotificationConfigurationFilter, se_ObjectIdentifier, se_ObjectIdentifierList, se_ObjectLockConfiguration, se_ObjectLockLegalHold, se_ObjectLockRetention, se_ObjectLockRule, se_OutputLocation, se_OutputSerialization, se_Owner, se_OwnershipControls, se_OwnershipControlsRule, se_OwnershipControlsRules, se_ParquetInput, se_PartitionedPrefix, se_PublicAccessBlockConfiguration, se_QueueConfiguration, se_QueueConfigurationList, se_Redirect, se_RedirectAllRequestsTo, se_ReplicaModifications, se_ReplicationConfiguration, se_ReplicationRule, se_ReplicationRuleAndOperator, se_ReplicationRuleFilter, se_ReplicationRules, se_ReplicationTime, se_ReplicationTimeValue, se_RequestPaymentConfiguration, se_RequestProgress, se_RestoreRequest, se_RoutingRule, se_RoutingRules, se_S3KeyFilter, se_S3Location, se_S3TablesDestination, se_ScanRange, se_SelectParameters, se_ServerSideEncryptionByDefault, se_ServerSideEncryptionConfiguration, se_ServerSideEncryptionRule, se_ServerSideEncryptionRules, se_SimplePrefix, se_SourceSelectionCriteria, se_SSEKMS, se_SseKmsEncryptedObjects, se_SSES3, se_StorageClassAnalysis, se_StorageClassAnalysisDataExport, se_Tag, se_Tagging, se_TagSet, se_TargetGrant, se_TargetGrants, se_TargetObjectKeyFormat, se_Tiering, se_TieringList, se_TopicConfiguration, se_TopicConfigurationList, se_Transition, se_TransitionList, se_UserMetadata, se_VersioningConfiguration, se_WebsiteConfiguration, de_AbortIncompleteMultipartUpload, de_AccessControlTranslation, de_AllowedHeaders, de_AllowedMethods, de_AllowedOrigins, de_AnalyticsAndOperator, de_AnalyticsConfiguration, de_AnalyticsConfigurationList, de_AnalyticsExportDestination, de_AnalyticsFilter, de_AnalyticsS3BucketDestination, de_Bucket, de_Buckets, de_Checksum, de_ChecksumAlgorithmList, de_CommonPrefix, de_CommonPrefixList, de_Condition, de_ContinuationEvent, de_CopyObjectResult, de_CopyPartResult, de_CORSRule, de_CORSRules, de_DefaultRetention, de_DeletedObject, de_DeletedObjects, de_DeleteMarkerEntry, de_DeleteMarkerReplication, de_DeleteMarkers, de_Destination, de_EncryptionConfiguration, de_EndEvent, de__Error, de_ErrorDetails, de_ErrorDocument, de_Errors, de_EventBridgeConfiguration, de_EventList, de_ExistingObjectReplication, de_ExposeHeaders, de_FilterRule, de_FilterRuleList, de_GetBucketMetadataTableConfigurationResult, de_GetObjectAttributesParts, de_Grant, de_Grantee, de_Grants, de_IndexDocument, de_Initiator, de_IntelligentTieringAndOperator, de_IntelligentTieringConfiguration, de_IntelligentTieringConfigurationList, de_IntelligentTieringFilter, de_InventoryConfiguration, de_InventoryConfigurationList, de_InventoryDestination, de_InventoryEncryption, de_InventoryFilter, de_InventoryOptionalFields, de_InventoryS3BucketDestination, de_InventorySchedule, de_LambdaFunctionConfiguration, de_LambdaFunctionConfigurationList, de_LifecycleExpiration, de_LifecycleRule, de_LifecycleRuleAndOperator, de_LifecycleRuleFilter, de_LifecycleRules, de_LoggingEnabled, de_MetadataTableConfigurationResult, de_Metrics, de_MetricsAndOperator, de_MetricsConfiguration, de_MetricsConfigurationList, de_MetricsFilter, de_MultipartUpload, de_MultipartUploadList, de_NoncurrentVersionExpiration, de_NoncurrentVersionTransition, de_NoncurrentVersionTransitionList, de_NotificationConfigurationFilter, de__Object, de_ObjectList, de_ObjectLockConfiguration, de_ObjectLockLegalHold, de_ObjectLockRetention, de_ObjectLockRule, de_ObjectPart, de_ObjectVersion, de_ObjectVersionList, de_Owner, de_OwnershipControls, de_OwnershipControlsRule, de_OwnershipControlsRules, de_Part, de_PartitionedPrefix, de_Parts, de_PartsList, de_PolicyStatus, de_Progress, de_PublicAccessBlockConfiguration, de_QueueConfiguration, de_QueueConfigurationList, de_Redirect, de_RedirectAllRequestsTo, de_ReplicaModifications, de_ReplicationConfiguration, de_ReplicationRule, de_ReplicationRuleAndOperator, de_ReplicationRuleFilter, de_ReplicationRules, de_ReplicationTime, de_ReplicationTimeValue, de_RestoreStatus, de_RoutingRule, de_RoutingRules, de_S3KeyFilter, de_S3TablesDestinationResult, de_ServerSideEncryptionByDefault, de_ServerSideEncryptionConfiguration, de_ServerSideEncryptionRule, de_ServerSideEncryptionRules, de_SessionCredentials, de_SimplePrefix, de_SourceSelectionCriteria, de_SSEKMS, de_SseKmsEncryptedObjects, de_SSES3, de_Stats, de_StorageClassAnalysis, de_StorageClassAnalysisDataExport, de_Tag, de_TagSet, de_TargetGrant, de_TargetGrants, de_TargetObjectKeyFormat, de_Tiering, de_TieringList, de_TopicConfiguration, de_TopicConfigurationList, de_Transition, de_TransitionList, deserializeMetadata2, collectBodyString2, _A, _AAO, _AC, _ACL, _ACLc, _ACLn, _ACP, _ACT, _ACc, _AD, _AED, _AF, _AH, _AHl, _AI, _AIMU, _AIc, _AKI, _AM, _AMl, _AO, _AOl, _APA, _APAc, _AQRD, _AR, _ARI, _AS, _ASBD, _ASEFF, _ASSEBD, _AT, _Ac, _B, _BAI, _BAS, _BGR, _BI, _BKE, _BLC, _BLCu, _BLN, _BLP, _BLS, _BLT, _BN, _BP, _BPA, _BPP, _BR, _BRy, _BS, _BT, _BVS, _Bu, _C, _CA, _CACL, _CBC, _CC, _CCRC, _CCRCC, _CD, _CDr, _CE, _CF, _CFC, _CL, _CLo, _CM, _CMD, _CMU, _CORSC, _CORSR, _CORSRu, _CP, _CPo, _CR, _CRSBA, _CS, _CSHA, _CSHAh, _CSIM, _CSIMS, _CSINM, _CSIUS, _CSR, _CSSSECA, _CSSSECK, _CSSSECKMD, _CSV, _CSVI, _CSVIn, _CSVO, _CT, _CTo, _CTom, _Ch, _Co, _Cod, _Com, _Con, _D, _DAI, _DE, _DM, _DMR, _DMRS, _DMVI, _DMe, _DN, _DR, _DRe, _Da, _Dat, _De, _Del, _Des, _Desc, _E, _EA, _EBC, _EBO, _EC, _ECn, _ED, _EH, _EHx, _EM, _EODM, _EOR, _EORS, _ERP, _ES, _ESBO, _ESx, _ET, _ETa, _ETn, _ETv, _ETx, _En, _Ena, _End, _Er, _Err, _Ev, _Eve, _Ex, _Exp, _F, _FD, _FHI, _FO, _FR, _FRN, _FRV, _FRi, _Fi, _Fo, _Fr, _G, _GFC, _GJP, _GR, _GRACP, _GW, _GWACP, _Gr, _Gra, _HECRE, _HN, _HRC, _I, _IC, _ICL, _ID, _ID_, _IDn, _IE, _IEn, _IF, _IFn, _IFnv, _II, _IIOV, _IL, _IM, _IMIT, _IMLMT, _IMS, _IMSf, _INM, _IOF, _IOV, _IP, _IPA, _IRIP, _IS, _ISBD, _ISn, _IT, _ITAO, _ITAT, _ITC, _ITCL, _ITD, _ITF, _ITI, _ITS, _IUS, _In, _Ini, _JSON, _JSONI, _JSONO, _JSONT, _K, _KC, _KI, _KM, _KMSC, _KMSKI, _KMSMKID, _KPE, _L, _LC, _LE, _LEi, _LFA, _LFC, _LFCa, _LI, _LM, _LMT, _LNAS, _LP, _LR, _LRAO, _LRF, _LT, _M, _MAO, _MAS, _MB, _MC, _MCL, _MD, _MDB, _MDf, _ME, _MF, _MFA, _MFAD, _MI, _MK, _MKe, _MM, _MP, _MS, _MTC, _MTCR, _MU, _MV, _Me, _Mes, _Mi, _Mo, _N, _NC, _NCF, _NCT, _ND, _NI, _NKM, _NM, _NNV, _NPNM, _NUIM, _NVE, _NVIM, _NVT, _NVTo, _O, _OA, _OC, _OCACL, _OCR, _OF, _OI, _OK, _OL, _OLC, _OLE, _OLEFB, _OLLH, _OLLHS, _OLM, _OLR, _OLRM, _OLRUD, _OLRb, _OO, _OOA, _OOw, _OP, _OS, _OSGT, _OSGTB, _OSLT, _OSLTB, _OSV, _OSb, _OVI, _Ob, _P, _PABC, _PC, _PDS, _PI, _PN, _PNM, _PP, _Pa, _Par, _Parq, _Part, _Pe, _Pr, _Pri, _Q, _QA, _QC, _QCu, _QCuo, _QEC, _QF, _Qu, _R, _RART, _RC, _RCC, _RCD, _RCE, _RCL, _RCT, _RCe, _RD, _RE, _RED, _RKKID, _RKPW, _RKW, _RM, _RMS, _ROP, _RP, _RPB, _RPC, _RPe, _RR, _RRAO, _RRF, _RRS, _RRT, _RRe, _RRes, _RRo, _RRou, _RS, _RSe, _RT, _RTS, _RTV, _RTe, _RUD, _Re, _Red, _Ro, _Ru, _Rul, _S, _SA, _SAK, _SBD, _SC, _SCA, _SCADE, _SCASV, _SCt, _SDV, _SK, _SKEO, _SKEOS, _SKF, _SKe, _SL, _SM, _SOCR, _SP, _SPi, _SR, _SS, _SSC, _SSE, _SSEA, _SSEBD, _SSEC, _SSECA, _SSECK, _SSECKMD, _SSEKMS, _SSEKMSEC, _SSEKMSKI, _SSER, _SSES, _ST, _STBA, _STD, _STDR, _STN, _S_, _Sc, _Se, _Si, _St, _Su, _T, _TA, _TAa, _TB, _TBA, _TC, _TCo, _TCop, _TD, _TDMOS, _TG, _TGa, _TN, _TNa, _TOKF, _TP, _TPC, _TS, _TSC, _Ta, _Tag, _Ti, _Tie, _Tier, _Tim, _To, _Top, _Tr, _Tra, _Ty, _U, _UI, _UIM, _UM, _URI, _Up, _V, _VC, _VCe, _VI, _VIM, _Va, _Ve, _WC, _WOB, _WRL, _Y, _a3, _ac, _acl, _ar, _at, _br, _c2, _cc, _cd, _ce, _cl, _cl_, _cm, _cr, _ct, _ct_, _d, _de, _e2, _en, _et, _eta, _ex, _fo, _i, _im, _ims, _in, _inm, _it, _ius, _km, _l, _lh, _lm, _lo, _log, _lt, _m, _mT, _ma, _mb, _mdb, _me, _mk, _mp, _mu, _n, _oC, _ol, _p, _pAB, _pN, _pS, _pnm, _pr, _r2, _rP, _ra, _rcc, _rcd, _rce, _rcl, _rct, _re, _res, _ret, _s, _sa, _se, _st, _t2, _to, _u, _uI, _uim, _v, _vI, _ve, _ver, _vim, _w, _x, _xaa, _xaad, _xaapa, _xaari, _xaas, _xabgr, _xabln, _xablt, _xabole, _xabolt, _xabr, _xaca, _xacc, _xacc_, _xacm, _xacrsba, _xacs, _xacs_, _xacs__, _xacsim, _xacsims, _xacsinm, _xacsius, _xacsm, _xacsr, _xacssseca, _xacssseck, _xacssseckm, _xacsvi, _xadm, _xae, _xaebo, _xafec, _xafem, _xafhar, _xafhcc, _xafhcd, _xafhce, _xafhcl, _xafhcr, _xafhct, _xafhe, _xafhe_, _xafhlm, _xafhxacc, _xafhxacc_, _xafhxacs, _xafhxacs_, _xafhxadm, _xafhxae, _xafhxamm, _xafhxampc, _xafhxaollh, _xafhxaolm, _xafhxaolrud, _xafhxar, _xafhxarc, _xafhxars, _xafhxasc, _xafhxasse, _xafhxasseakki, _xafhxassebke, _xafhxasseca, _xafhxasseckm, _xafhxatc, _xafhxavi, _xafs, _xagfc, _xagr, _xagra, _xagw, _xagwa, _xaimit, _xaimlmt, _xaims, _xam, _xamd, _xamm, _xamp, _xampc, _xaoa, _xaollh, _xaolm, _xaolrud, _xaoo, _xaooa, _xaos, _xapnm, _xar, _xarc, _xarop, _xarp, _xarr, _xars, _xart, _xasc, _xasca, _xasdv, _xasebo, _xasse, _xasseakki, _xassebke, _xassec, _xasseca, _xasseck, _xasseckm, _xat, _xatc, _xatd, _xatdmos, _xavi, _xawob, _xawrl, _xi;
var init_Aws_restXml = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/protocols/Aws_restXml.js"() {
    init_import_meta_url();
    init_dist_es21();
    init_dist_es47();
    init_dist_es16();
    init_dist_es2();
    init_dist_es20();
    init_models_0();
    init_models_1();
    init_S3ServiceException();
    se_AbortMultipartUploadCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        [_xarp]: input[_RP],
        [_xaebo]: input[_EBO],
        [_xaimit]: [() => isSerializableHeaderValue(input[_IMIT]), () => dateToUtcString(input[_IMIT]).toString()]
      });
      b11.bp("/{Key+}");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      b11.p("Key", () => input.Key, "{Key+}", true);
      const query = map({
        [_xi]: [, "AbortMultipartUpload"],
        [_uI]: [, expectNonNull(input[_UI], `UploadId`)]
      });
      let body;
      b11.m("DELETE").h(headers).q(query).b(body);
      return b11.build();
    }, "se_AbortMultipartUploadCommand");
    se_CompleteMultipartUploadCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        "content-type": "application/xml",
        [_xacc]: input[_CCRC],
        [_xacc_]: input[_CCRCC],
        [_xacs]: input[_CSHA],
        [_xacs_]: input[_CSHAh],
        [_xarp]: input[_RP],
        [_xaebo]: input[_EBO],
        [_im]: input[_IM],
        [_inm]: input[_INM],
        [_xasseca]: input[_SSECA],
        [_xasseck]: input[_SSECK],
        [_xasseckm]: input[_SSECKMD]
      });
      b11.bp("/{Key+}");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      b11.p("Key", () => input.Key, "{Key+}", true);
      const query = map({
        [_uI]: [, expectNonNull(input[_UI], `UploadId`)]
      });
      let body;
      let contents;
      if (input.MultipartUpload !== void 0) {
        contents = se_CompletedMultipartUpload(input.MultipartUpload, context2);
        contents = contents.n("CompleteMultipartUpload");
        body = _ve;
        contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/");
        body += contents.toString();
      }
      b11.m("POST").h(headers).q(query).b(body);
      return b11.build();
    }, "se_CompleteMultipartUploadCommand");
    se_CopyObjectCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        [_xaa]: input[_ACL],
        [_cc]: input[_CC],
        [_xaca]: input[_CA],
        [_cd]: input[_CD],
        [_ce]: input[_CE],
        [_cl]: input[_CL],
        [_ct]: input[_CT],
        [_xacs__]: input[_CS],
        [_xacsim]: input[_CSIM],
        [_xacsims]: [() => isSerializableHeaderValue(input[_CSIMS]), () => dateToUtcString(input[_CSIMS]).toString()],
        [_xacsinm]: input[_CSINM],
        [_xacsius]: [() => isSerializableHeaderValue(input[_CSIUS]), () => dateToUtcString(input[_CSIUS]).toString()],
        [_e2]: [() => isSerializableHeaderValue(input[_E]), () => dateToUtcString(input[_E]).toString()],
        [_xagfc]: input[_GFC],
        [_xagr]: input[_GR],
        [_xagra]: input[_GRACP],
        [_xagwa]: input[_GWACP],
        [_xamd]: input[_MD],
        [_xatd]: input[_TD],
        [_xasse]: input[_SSE],
        [_xasc]: input[_SC],
        [_xawrl]: input[_WRL],
        [_xasseca]: input[_SSECA],
        [_xasseck]: input[_SSECK],
        [_xasseckm]: input[_SSECKMD],
        [_xasseakki]: input[_SSEKMSKI],
        [_xassec]: input[_SSEKMSEC],
        [_xassebke]: [() => isSerializableHeaderValue(input[_BKE]), () => input[_BKE].toString()],
        [_xacssseca]: input[_CSSSECA],
        [_xacssseck]: input[_CSSSECK],
        [_xacssseckm]: input[_CSSSECKMD],
        [_xarp]: input[_RP],
        [_xat]: input[_T],
        [_xaolm]: input[_OLM],
        [_xaolrud]: [() => isSerializableHeaderValue(input[_OLRUD]), () => serializeDateTime(input[_OLRUD]).toString()],
        [_xaollh]: input[_OLLHS],
        [_xaebo]: input[_EBO],
        [_xasebo]: input[_ESBO],
        ...input.Metadata !== void 0 && Object.keys(input.Metadata).reduce((acc, suffix) => {
          acc[`x-amz-meta-${suffix.toLowerCase()}`] = input.Metadata[suffix];
          return acc;
        }, {})
      });
      b11.bp("/{Key+}");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      b11.p("Key", () => input.Key, "{Key+}", true);
      const query = map({
        [_xi]: [, "CopyObject"]
      });
      let body;
      b11.m("PUT").h(headers).q(query).b(body);
      return b11.build();
    }, "se_CopyObjectCommand");
    se_CreateBucketCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        "content-type": "application/xml",
        [_xaa]: input[_ACL],
        [_xagfc]: input[_GFC],
        [_xagr]: input[_GR],
        [_xagra]: input[_GRACP],
        [_xagw]: input[_GW],
        [_xagwa]: input[_GWACP],
        [_xabole]: [() => isSerializableHeaderValue(input[_OLEFB]), () => input[_OLEFB].toString()],
        [_xaoo]: input[_OO]
      });
      b11.bp("/");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      let body;
      let contents;
      if (input.CreateBucketConfiguration !== void 0) {
        contents = se_CreateBucketConfiguration(input.CreateBucketConfiguration, context2);
        body = _ve;
        contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/");
        body += contents.toString();
      }
      b11.m("PUT").h(headers).b(body);
      return b11.build();
    }, "se_CreateBucketCommand");
    se_CreateBucketMetadataTableConfigurationCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        "content-type": "application/xml",
        [_cm]: input[_CMD],
        [_xasca]: input[_CA],
        [_xaebo]: input[_EBO]
      });
      b11.bp("/");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      const query = map({
        [_mT]: [, ""]
      });
      let body;
      let contents;
      if (input.MetadataTableConfiguration !== void 0) {
        contents = se_MetadataTableConfiguration(input.MetadataTableConfiguration, context2);
        body = _ve;
        contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/");
        body += contents.toString();
      }
      b11.m("POST").h(headers).q(query).b(body);
      return b11.build();
    }, "se_CreateBucketMetadataTableConfigurationCommand");
    se_CreateMultipartUploadCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        [_xaa]: input[_ACL],
        [_cc]: input[_CC],
        [_cd]: input[_CD],
        [_ce]: input[_CE],
        [_cl]: input[_CL],
        [_ct]: input[_CT],
        [_e2]: [() => isSerializableHeaderValue(input[_E]), () => dateToUtcString(input[_E]).toString()],
        [_xagfc]: input[_GFC],
        [_xagr]: input[_GR],
        [_xagra]: input[_GRACP],
        [_xagwa]: input[_GWACP],
        [_xasse]: input[_SSE],
        [_xasc]: input[_SC],
        [_xawrl]: input[_WRL],
        [_xasseca]: input[_SSECA],
        [_xasseck]: input[_SSECK],
        [_xasseckm]: input[_SSECKMD],
        [_xasseakki]: input[_SSEKMSKI],
        [_xassec]: input[_SSEKMSEC],
        [_xassebke]: [() => isSerializableHeaderValue(input[_BKE]), () => input[_BKE].toString()],
        [_xarp]: input[_RP],
        [_xat]: input[_T],
        [_xaolm]: input[_OLM],
        [_xaolrud]: [() => isSerializableHeaderValue(input[_OLRUD]), () => serializeDateTime(input[_OLRUD]).toString()],
        [_xaollh]: input[_OLLHS],
        [_xaebo]: input[_EBO],
        [_xaca]: input[_CA],
        ...input.Metadata !== void 0 && Object.keys(input.Metadata).reduce((acc, suffix) => {
          acc[`x-amz-meta-${suffix.toLowerCase()}`] = input.Metadata[suffix];
          return acc;
        }, {})
      });
      b11.bp("/{Key+}");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      b11.p("Key", () => input.Key, "{Key+}", true);
      const query = map({
        [_u]: [, ""]
      });
      let body;
      b11.m("POST").h(headers).q(query).b(body);
      return b11.build();
    }, "se_CreateMultipartUploadCommand");
    se_CreateSessionCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        [_xacsm]: input[_SM],
        [_xasse]: input[_SSE],
        [_xasseakki]: input[_SSEKMSKI],
        [_xassec]: input[_SSEKMSEC],
        [_xassebke]: [() => isSerializableHeaderValue(input[_BKE]), () => input[_BKE].toString()]
      });
      b11.bp("/");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      const query = map({
        [_s]: [, ""]
      });
      let body;
      b11.m("GET").h(headers).q(query).b(body);
      return b11.build();
    }, "se_CreateSessionCommand");
    se_DeleteBucketCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO]
      });
      b11.bp("/");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      let body;
      b11.m("DELETE").h(headers).b(body);
      return b11.build();
    }, "se_DeleteBucketCommand");
    se_DeleteBucketAnalyticsConfigurationCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO]
      });
      b11.bp("/");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      const query = map({
        [_a3]: [, ""],
        [_i]: [, expectNonNull(input[_I], `Id`)]
      });
      let body;
      b11.m("DELETE").h(headers).q(query).b(body);
      return b11.build();
    }, "se_DeleteBucketAnalyticsConfigurationCommand");
    se_DeleteBucketCorsCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO]
      });
      b11.bp("/");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      const query = map({
        [_c2]: [, ""]
      });
      let body;
      b11.m("DELETE").h(headers).q(query).b(body);
      return b11.build();
    }, "se_DeleteBucketCorsCommand");
    se_DeleteBucketEncryptionCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO]
      });
      b11.bp("/");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      const query = map({
        [_en]: [, ""]
      });
      let body;
      b11.m("DELETE").h(headers).q(query).b(body);
      return b11.build();
    }, "se_DeleteBucketEncryptionCommand");
    se_DeleteBucketIntelligentTieringConfigurationCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = {};
      b11.bp("/");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      const query = map({
        [_it]: [, ""],
        [_i]: [, expectNonNull(input[_I], `Id`)]
      });
      let body;
      b11.m("DELETE").h(headers).q(query).b(body);
      return b11.build();
    }, "se_DeleteBucketIntelligentTieringConfigurationCommand");
    se_DeleteBucketInventoryConfigurationCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO]
      });
      b11.bp("/");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      const query = map({
        [_in]: [, ""],
        [_i]: [, expectNonNull(input[_I], `Id`)]
      });
      let body;
      b11.m("DELETE").h(headers).q(query).b(body);
      return b11.build();
    }, "se_DeleteBucketInventoryConfigurationCommand");
    se_DeleteBucketLifecycleCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO]
      });
      b11.bp("/");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      const query = map({
        [_l]: [, ""]
      });
      let body;
      b11.m("DELETE").h(headers).q(query).b(body);
      return b11.build();
    }, "se_DeleteBucketLifecycleCommand");
    se_DeleteBucketMetadataTableConfigurationCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO]
      });
      b11.bp("/");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      const query = map({
        [_mT]: [, ""]
      });
      let body;
      b11.m("DELETE").h(headers).q(query).b(body);
      return b11.build();
    }, "se_DeleteBucketMetadataTableConfigurationCommand");
    se_DeleteBucketMetricsConfigurationCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO]
      });
      b11.bp("/");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      const query = map({
        [_m]: [, ""],
        [_i]: [, expectNonNull(input[_I], `Id`)]
      });
      let body;
      b11.m("DELETE").h(headers).q(query).b(body);
      return b11.build();
    }, "se_DeleteBucketMetricsConfigurationCommand");
    se_DeleteBucketOwnershipControlsCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO]
      });
      b11.bp("/");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      const query = map({
        [_oC]: [, ""]
      });
      let body;
      b11.m("DELETE").h(headers).q(query).b(body);
      return b11.build();
    }, "se_DeleteBucketOwnershipControlsCommand");
    se_DeleteBucketPolicyCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO]
      });
      b11.bp("/");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      const query = map({
        [_p]: [, ""]
      });
      let body;
      b11.m("DELETE").h(headers).q(query).b(body);
      return b11.build();
    }, "se_DeleteBucketPolicyCommand");
    se_DeleteBucketReplicationCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO]
      });
      b11.bp("/");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      const query = map({
        [_r2]: [, ""]
      });
      let body;
      b11.m("DELETE").h(headers).q(query).b(body);
      return b11.build();
    }, "se_DeleteBucketReplicationCommand");
    se_DeleteBucketTaggingCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO]
      });
      b11.bp("/");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      const query = map({
        [_t2]: [, ""]
      });
      let body;
      b11.m("DELETE").h(headers).q(query).b(body);
      return b11.build();
    }, "se_DeleteBucketTaggingCommand");
    se_DeleteBucketWebsiteCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO]
      });
      b11.bp("/");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      const query = map({
        [_w]: [, ""]
      });
      let body;
      b11.m("DELETE").h(headers).q(query).b(body);
      return b11.build();
    }, "se_DeleteBucketWebsiteCommand");
    se_DeleteObjectCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        [_xam]: input[_MFA],
        [_xarp]: input[_RP],
        [_xabgr]: [() => isSerializableHeaderValue(input[_BGR]), () => input[_BGR].toString()],
        [_xaebo]: input[_EBO],
        [_im]: input[_IM],
        [_xaimlmt]: [() => isSerializableHeaderValue(input[_IMLMT]), () => dateToUtcString(input[_IMLMT]).toString()],
        [_xaims]: [() => isSerializableHeaderValue(input[_IMS]), () => input[_IMS].toString()]
      });
      b11.bp("/{Key+}");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      b11.p("Key", () => input.Key, "{Key+}", true);
      const query = map({
        [_xi]: [, "DeleteObject"],
        [_vI]: [, input[_VI]]
      });
      let body;
      b11.m("DELETE").h(headers).q(query).b(body);
      return b11.build();
    }, "se_DeleteObjectCommand");
    se_DeleteObjectsCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        "content-type": "application/xml",
        [_xam]: input[_MFA],
        [_xarp]: input[_RP],
        [_xabgr]: [() => isSerializableHeaderValue(input[_BGR]), () => input[_BGR].toString()],
        [_xaebo]: input[_EBO],
        [_xasca]: input[_CA]
      });
      b11.bp("/");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      const query = map({
        [_d]: [, ""]
      });
      let body;
      let contents;
      if (input.Delete !== void 0) {
        contents = se_Delete(input.Delete, context2);
        body = _ve;
        contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/");
        body += contents.toString();
      }
      b11.m("POST").h(headers).q(query).b(body);
      return b11.build();
    }, "se_DeleteObjectsCommand");
    se_DeleteObjectTaggingCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO]
      });
      b11.bp("/{Key+}");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      b11.p("Key", () => input.Key, "{Key+}", true);
      const query = map({
        [_t2]: [, ""],
        [_vI]: [, input[_VI]]
      });
      let body;
      b11.m("DELETE").h(headers).q(query).b(body);
      return b11.build();
    }, "se_DeleteObjectTaggingCommand");
    se_DeletePublicAccessBlockCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO]
      });
      b11.bp("/");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      const query = map({
        [_pAB]: [, ""]
      });
      let body;
      b11.m("DELETE").h(headers).q(query).b(body);
      return b11.build();
    }, "se_DeletePublicAccessBlockCommand");
    se_GetBucketAccelerateConfigurationCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO],
        [_xarp]: input[_RP]
      });
      b11.bp("/");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      const query = map({
        [_ac]: [, ""]
      });
      let body;
      b11.m("GET").h(headers).q(query).b(body);
      return b11.build();
    }, "se_GetBucketAccelerateConfigurationCommand");
    se_GetBucketAclCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO]
      });
      b11.bp("/");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      const query = map({
        [_acl]: [, ""]
      });
      let body;
      b11.m("GET").h(headers).q(query).b(body);
      return b11.build();
    }, "se_GetBucketAclCommand");
    se_GetBucketAnalyticsConfigurationCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO]
      });
      b11.bp("/");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      const query = map({
        [_a3]: [, ""],
        [_xi]: [, "GetBucketAnalyticsConfiguration"],
        [_i]: [, expectNonNull(input[_I], `Id`)]
      });
      let body;
      b11.m("GET").h(headers).q(query).b(body);
      return b11.build();
    }, "se_GetBucketAnalyticsConfigurationCommand");
    se_GetBucketCorsCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO]
      });
      b11.bp("/");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      const query = map({
        [_c2]: [, ""]
      });
      let body;
      b11.m("GET").h(headers).q(query).b(body);
      return b11.build();
    }, "se_GetBucketCorsCommand");
    se_GetBucketEncryptionCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO]
      });
      b11.bp("/");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      const query = map({
        [_en]: [, ""]
      });
      let body;
      b11.m("GET").h(headers).q(query).b(body);
      return b11.build();
    }, "se_GetBucketEncryptionCommand");
    se_GetBucketIntelligentTieringConfigurationCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = {};
      b11.bp("/");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      const query = map({
        [_it]: [, ""],
        [_xi]: [, "GetBucketIntelligentTieringConfiguration"],
        [_i]: [, expectNonNull(input[_I], `Id`)]
      });
      let body;
      b11.m("GET").h(headers).q(query).b(body);
      return b11.build();
    }, "se_GetBucketIntelligentTieringConfigurationCommand");
    se_GetBucketInventoryConfigurationCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO]
      });
      b11.bp("/");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      const query = map({
        [_in]: [, ""],
        [_xi]: [, "GetBucketInventoryConfiguration"],
        [_i]: [, expectNonNull(input[_I], `Id`)]
      });
      let body;
      b11.m("GET").h(headers).q(query).b(body);
      return b11.build();
    }, "se_GetBucketInventoryConfigurationCommand");
    se_GetBucketLifecycleConfigurationCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO]
      });
      b11.bp("/");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      const query = map({
        [_l]: [, ""]
      });
      let body;
      b11.m("GET").h(headers).q(query).b(body);
      return b11.build();
    }, "se_GetBucketLifecycleConfigurationCommand");
    se_GetBucketLocationCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO]
      });
      b11.bp("/");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      const query = map({
        [_lo]: [, ""]
      });
      let body;
      b11.m("GET").h(headers).q(query).b(body);
      return b11.build();
    }, "se_GetBucketLocationCommand");
    se_GetBucketLoggingCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO]
      });
      b11.bp("/");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      const query = map({
        [_log]: [, ""]
      });
      let body;
      b11.m("GET").h(headers).q(query).b(body);
      return b11.build();
    }, "se_GetBucketLoggingCommand");
    se_GetBucketMetadataTableConfigurationCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO]
      });
      b11.bp("/");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      const query = map({
        [_mT]: [, ""]
      });
      let body;
      b11.m("GET").h(headers).q(query).b(body);
      return b11.build();
    }, "se_GetBucketMetadataTableConfigurationCommand");
    se_GetBucketMetricsConfigurationCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO]
      });
      b11.bp("/");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      const query = map({
        [_m]: [, ""],
        [_xi]: [, "GetBucketMetricsConfiguration"],
        [_i]: [, expectNonNull(input[_I], `Id`)]
      });
      let body;
      b11.m("GET").h(headers).q(query).b(body);
      return b11.build();
    }, "se_GetBucketMetricsConfigurationCommand");
    se_GetBucketNotificationConfigurationCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO]
      });
      b11.bp("/");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      const query = map({
        [_n]: [, ""]
      });
      let body;
      b11.m("GET").h(headers).q(query).b(body);
      return b11.build();
    }, "se_GetBucketNotificationConfigurationCommand");
    se_GetBucketOwnershipControlsCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO]
      });
      b11.bp("/");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      const query = map({
        [_oC]: [, ""]
      });
      let body;
      b11.m("GET").h(headers).q(query).b(body);
      return b11.build();
    }, "se_GetBucketOwnershipControlsCommand");
    se_GetBucketPolicyCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO]
      });
      b11.bp("/");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      const query = map({
        [_p]: [, ""]
      });
      let body;
      b11.m("GET").h(headers).q(query).b(body);
      return b11.build();
    }, "se_GetBucketPolicyCommand");
    se_GetBucketPolicyStatusCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO]
      });
      b11.bp("/");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      const query = map({
        [_pS]: [, ""]
      });
      let body;
      b11.m("GET").h(headers).q(query).b(body);
      return b11.build();
    }, "se_GetBucketPolicyStatusCommand");
    se_GetBucketReplicationCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO]
      });
      b11.bp("/");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      const query = map({
        [_r2]: [, ""]
      });
      let body;
      b11.m("GET").h(headers).q(query).b(body);
      return b11.build();
    }, "se_GetBucketReplicationCommand");
    se_GetBucketRequestPaymentCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO]
      });
      b11.bp("/");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      const query = map({
        [_rP]: [, ""]
      });
      let body;
      b11.m("GET").h(headers).q(query).b(body);
      return b11.build();
    }, "se_GetBucketRequestPaymentCommand");
    se_GetBucketTaggingCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO]
      });
      b11.bp("/");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      const query = map({
        [_t2]: [, ""]
      });
      let body;
      b11.m("GET").h(headers).q(query).b(body);
      return b11.build();
    }, "se_GetBucketTaggingCommand");
    se_GetBucketVersioningCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO]
      });
      b11.bp("/");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      const query = map({
        [_v]: [, ""]
      });
      let body;
      b11.m("GET").h(headers).q(query).b(body);
      return b11.build();
    }, "se_GetBucketVersioningCommand");
    se_GetBucketWebsiteCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO]
      });
      b11.bp("/");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      const query = map({
        [_w]: [, ""]
      });
      let body;
      b11.m("GET").h(headers).q(query).b(body);
      return b11.build();
    }, "se_GetBucketWebsiteCommand");
    se_GetObjectCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        [_im]: input[_IM],
        [_ims]: [() => isSerializableHeaderValue(input[_IMSf]), () => dateToUtcString(input[_IMSf]).toString()],
        [_inm]: input[_INM],
        [_ius]: [() => isSerializableHeaderValue(input[_IUS]), () => dateToUtcString(input[_IUS]).toString()],
        [_ra]: input[_R],
        [_xasseca]: input[_SSECA],
        [_xasseck]: input[_SSECK],
        [_xasseckm]: input[_SSECKMD],
        [_xarp]: input[_RP],
        [_xaebo]: input[_EBO],
        [_xacm]: input[_CM]
      });
      b11.bp("/{Key+}");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      b11.p("Key", () => input.Key, "{Key+}", true);
      const query = map({
        [_xi]: [, "GetObject"],
        [_rcc]: [, input[_RCC]],
        [_rcd]: [, input[_RCD]],
        [_rce]: [, input[_RCE]],
        [_rcl]: [, input[_RCL]],
        [_rct]: [, input[_RCT]],
        [_re]: [() => input.ResponseExpires !== void 0, () => dateToUtcString(input[_RE]).toString()],
        [_vI]: [, input[_VI]],
        [_pN]: [() => input.PartNumber !== void 0, () => input[_PN].toString()]
      });
      let body;
      b11.m("GET").h(headers).q(query).b(body);
      return b11.build();
    }, "se_GetObjectCommand");
    se_GetObjectAclCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        [_xarp]: input[_RP],
        [_xaebo]: input[_EBO]
      });
      b11.bp("/{Key+}");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      b11.p("Key", () => input.Key, "{Key+}", true);
      const query = map({
        [_acl]: [, ""],
        [_vI]: [, input[_VI]]
      });
      let body;
      b11.m("GET").h(headers).q(query).b(body);
      return b11.build();
    }, "se_GetObjectAclCommand");
    se_GetObjectAttributesCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        [_xamp]: [() => isSerializableHeaderValue(input[_MP]), () => input[_MP].toString()],
        [_xapnm]: input[_PNM],
        [_xasseca]: input[_SSECA],
        [_xasseck]: input[_SSECK],
        [_xasseckm]: input[_SSECKMD],
        [_xarp]: input[_RP],
        [_xaebo]: input[_EBO],
        [_xaoa]: [() => isSerializableHeaderValue(input[_OA]), () => (input[_OA] || []).map(quoteHeader).join(", ")]
      });
      b11.bp("/{Key+}");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      b11.p("Key", () => input.Key, "{Key+}", true);
      const query = map({
        [_at]: [, ""],
        [_vI]: [, input[_VI]]
      });
      let body;
      b11.m("GET").h(headers).q(query).b(body);
      return b11.build();
    }, "se_GetObjectAttributesCommand");
    se_GetObjectLegalHoldCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        [_xarp]: input[_RP],
        [_xaebo]: input[_EBO]
      });
      b11.bp("/{Key+}");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      b11.p("Key", () => input.Key, "{Key+}", true);
      const query = map({
        [_lh]: [, ""],
        [_vI]: [, input[_VI]]
      });
      let body;
      b11.m("GET").h(headers).q(query).b(body);
      return b11.build();
    }, "se_GetObjectLegalHoldCommand");
    se_GetObjectLockConfigurationCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO]
      });
      b11.bp("/");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      const query = map({
        [_ol]: [, ""]
      });
      let body;
      b11.m("GET").h(headers).q(query).b(body);
      return b11.build();
    }, "se_GetObjectLockConfigurationCommand");
    se_GetObjectRetentionCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        [_xarp]: input[_RP],
        [_xaebo]: input[_EBO]
      });
      b11.bp("/{Key+}");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      b11.p("Key", () => input.Key, "{Key+}", true);
      const query = map({
        [_ret]: [, ""],
        [_vI]: [, input[_VI]]
      });
      let body;
      b11.m("GET").h(headers).q(query).b(body);
      return b11.build();
    }, "se_GetObjectRetentionCommand");
    se_GetObjectTaggingCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO],
        [_xarp]: input[_RP]
      });
      b11.bp("/{Key+}");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      b11.p("Key", () => input.Key, "{Key+}", true);
      const query = map({
        [_t2]: [, ""],
        [_vI]: [, input[_VI]]
      });
      let body;
      b11.m("GET").h(headers).q(query).b(body);
      return b11.build();
    }, "se_GetObjectTaggingCommand");
    se_GetObjectTorrentCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        [_xarp]: input[_RP],
        [_xaebo]: input[_EBO]
      });
      b11.bp("/{Key+}");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      b11.p("Key", () => input.Key, "{Key+}", true);
      const query = map({
        [_to]: [, ""]
      });
      let body;
      b11.m("GET").h(headers).q(query).b(body);
      return b11.build();
    }, "se_GetObjectTorrentCommand");
    se_GetPublicAccessBlockCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO]
      });
      b11.bp("/");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      const query = map({
        [_pAB]: [, ""]
      });
      let body;
      b11.m("GET").h(headers).q(query).b(body);
      return b11.build();
    }, "se_GetPublicAccessBlockCommand");
    se_HeadBucketCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO]
      });
      b11.bp("/");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      let body;
      b11.m("HEAD").h(headers).b(body);
      return b11.build();
    }, "se_HeadBucketCommand");
    se_HeadObjectCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        [_im]: input[_IM],
        [_ims]: [() => isSerializableHeaderValue(input[_IMSf]), () => dateToUtcString(input[_IMSf]).toString()],
        [_inm]: input[_INM],
        [_ius]: [() => isSerializableHeaderValue(input[_IUS]), () => dateToUtcString(input[_IUS]).toString()],
        [_ra]: input[_R],
        [_xasseca]: input[_SSECA],
        [_xasseck]: input[_SSECK],
        [_xasseckm]: input[_SSECKMD],
        [_xarp]: input[_RP],
        [_xaebo]: input[_EBO],
        [_xacm]: input[_CM]
      });
      b11.bp("/{Key+}");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      b11.p("Key", () => input.Key, "{Key+}", true);
      const query = map({
        [_rcc]: [, input[_RCC]],
        [_rcd]: [, input[_RCD]],
        [_rce]: [, input[_RCE]],
        [_rcl]: [, input[_RCL]],
        [_rct]: [, input[_RCT]],
        [_re]: [() => input.ResponseExpires !== void 0, () => dateToUtcString(input[_RE]).toString()],
        [_vI]: [, input[_VI]],
        [_pN]: [() => input.PartNumber !== void 0, () => input[_PN].toString()]
      });
      let body;
      b11.m("HEAD").h(headers).q(query).b(body);
      return b11.build();
    }, "se_HeadObjectCommand");
    se_ListBucketAnalyticsConfigurationsCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO]
      });
      b11.bp("/");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      const query = map({
        [_a3]: [, ""],
        [_xi]: [, "ListBucketAnalyticsConfigurations"],
        [_ct_]: [, input[_CTo]]
      });
      let body;
      b11.m("GET").h(headers).q(query).b(body);
      return b11.build();
    }, "se_ListBucketAnalyticsConfigurationsCommand");
    se_ListBucketIntelligentTieringConfigurationsCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = {};
      b11.bp("/");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      const query = map({
        [_it]: [, ""],
        [_xi]: [, "ListBucketIntelligentTieringConfigurations"],
        [_ct_]: [, input[_CTo]]
      });
      let body;
      b11.m("GET").h(headers).q(query).b(body);
      return b11.build();
    }, "se_ListBucketIntelligentTieringConfigurationsCommand");
    se_ListBucketInventoryConfigurationsCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO]
      });
      b11.bp("/");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      const query = map({
        [_in]: [, ""],
        [_xi]: [, "ListBucketInventoryConfigurations"],
        [_ct_]: [, input[_CTo]]
      });
      let body;
      b11.m("GET").h(headers).q(query).b(body);
      return b11.build();
    }, "se_ListBucketInventoryConfigurationsCommand");
    se_ListBucketMetricsConfigurationsCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO]
      });
      b11.bp("/");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      const query = map({
        [_m]: [, ""],
        [_xi]: [, "ListBucketMetricsConfigurations"],
        [_ct_]: [, input[_CTo]]
      });
      let body;
      b11.m("GET").h(headers).q(query).b(body);
      return b11.build();
    }, "se_ListBucketMetricsConfigurationsCommand");
    se_ListBucketsCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = {};
      b11.bp("/");
      const query = map({
        [_xi]: [, "ListBuckets"],
        [_mb]: [() => input.MaxBuckets !== void 0, () => input[_MB].toString()],
        [_ct_]: [, input[_CTo]],
        [_pr]: [, input[_P]],
        [_br]: [, input[_BR]]
      });
      let body;
      b11.m("GET").h(headers).q(query).b(body);
      return b11.build();
    }, "se_ListBucketsCommand");
    se_ListDirectoryBucketsCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = {};
      b11.bp("/");
      const query = map({
        [_xi]: [, "ListDirectoryBuckets"],
        [_ct_]: [, input[_CTo]],
        [_mdb]: [() => input.MaxDirectoryBuckets !== void 0, () => input[_MDB].toString()]
      });
      let body;
      b11.m("GET").h(headers).q(query).b(body);
      return b11.build();
    }, "se_ListDirectoryBucketsCommand");
    se_ListMultipartUploadsCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO],
        [_xarp]: input[_RP]
      });
      b11.bp("/");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      const query = map({
        [_u]: [, ""],
        [_de]: [, input[_D]],
        [_et]: [, input[_ET]],
        [_km]: [, input[_KM]],
        [_mu]: [() => input.MaxUploads !== void 0, () => input[_MU].toString()],
        [_pr]: [, input[_P]],
        [_uim]: [, input[_UIM]]
      });
      let body;
      b11.m("GET").h(headers).q(query).b(body);
      return b11.build();
    }, "se_ListMultipartUploadsCommand");
    se_ListObjectsCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        [_xarp]: input[_RP],
        [_xaebo]: input[_EBO],
        [_xaooa]: [() => isSerializableHeaderValue(input[_OOA]), () => (input[_OOA] || []).map(quoteHeader).join(", ")]
      });
      b11.bp("/");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      const query = map({
        [_de]: [, input[_D]],
        [_et]: [, input[_ET]],
        [_ma]: [, input[_M]],
        [_mk]: [() => input.MaxKeys !== void 0, () => input[_MK].toString()],
        [_pr]: [, input[_P]]
      });
      let body;
      b11.m("GET").h(headers).q(query).b(body);
      return b11.build();
    }, "se_ListObjectsCommand");
    se_ListObjectsV2Command = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        [_xarp]: input[_RP],
        [_xaebo]: input[_EBO],
        [_xaooa]: [() => isSerializableHeaderValue(input[_OOA]), () => (input[_OOA] || []).map(quoteHeader).join(", ")]
      });
      b11.bp("/");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      const query = map({
        [_lt]: [, "2"],
        [_de]: [, input[_D]],
        [_et]: [, input[_ET]],
        [_mk]: [() => input.MaxKeys !== void 0, () => input[_MK].toString()],
        [_pr]: [, input[_P]],
        [_ct_]: [, input[_CTo]],
        [_fo]: [() => input.FetchOwner !== void 0, () => input[_FO].toString()],
        [_sa]: [, input[_SA]]
      });
      let body;
      b11.m("GET").h(headers).q(query).b(body);
      return b11.build();
    }, "se_ListObjectsV2Command");
    se_ListObjectVersionsCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO],
        [_xarp]: input[_RP],
        [_xaooa]: [() => isSerializableHeaderValue(input[_OOA]), () => (input[_OOA] || []).map(quoteHeader).join(", ")]
      });
      b11.bp("/");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      const query = map({
        [_ver]: [, ""],
        [_de]: [, input[_D]],
        [_et]: [, input[_ET]],
        [_km]: [, input[_KM]],
        [_mk]: [() => input.MaxKeys !== void 0, () => input[_MK].toString()],
        [_pr]: [, input[_P]],
        [_vim]: [, input[_VIM]]
      });
      let body;
      b11.m("GET").h(headers).q(query).b(body);
      return b11.build();
    }, "se_ListObjectVersionsCommand");
    se_ListPartsCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        [_xarp]: input[_RP],
        [_xaebo]: input[_EBO],
        [_xasseca]: input[_SSECA],
        [_xasseck]: input[_SSECK],
        [_xasseckm]: input[_SSECKMD]
      });
      b11.bp("/{Key+}");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      b11.p("Key", () => input.Key, "{Key+}", true);
      const query = map({
        [_xi]: [, "ListParts"],
        [_mp]: [() => input.MaxParts !== void 0, () => input[_MP].toString()],
        [_pnm]: [, input[_PNM]],
        [_uI]: [, expectNonNull(input[_UI], `UploadId`)]
      });
      let body;
      b11.m("GET").h(headers).q(query).b(body);
      return b11.build();
    }, "se_ListPartsCommand");
    se_PutBucketAccelerateConfigurationCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        "content-type": "application/xml",
        [_xaebo]: input[_EBO],
        [_xasca]: input[_CA]
      });
      b11.bp("/");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      const query = map({
        [_ac]: [, ""]
      });
      let body;
      let contents;
      if (input.AccelerateConfiguration !== void 0) {
        contents = se_AccelerateConfiguration(input.AccelerateConfiguration, context2);
        body = _ve;
        contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/");
        body += contents.toString();
      }
      b11.m("PUT").h(headers).q(query).b(body);
      return b11.build();
    }, "se_PutBucketAccelerateConfigurationCommand");
    se_PutBucketAclCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        "content-type": "application/xml",
        [_xaa]: input[_ACL],
        [_cm]: input[_CMD],
        [_xasca]: input[_CA],
        [_xagfc]: input[_GFC],
        [_xagr]: input[_GR],
        [_xagra]: input[_GRACP],
        [_xagw]: input[_GW],
        [_xagwa]: input[_GWACP],
        [_xaebo]: input[_EBO]
      });
      b11.bp("/");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      const query = map({
        [_acl]: [, ""]
      });
      let body;
      let contents;
      if (input.AccessControlPolicy !== void 0) {
        contents = se_AccessControlPolicy(input.AccessControlPolicy, context2);
        body = _ve;
        contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/");
        body += contents.toString();
      }
      b11.m("PUT").h(headers).q(query).b(body);
      return b11.build();
    }, "se_PutBucketAclCommand");
    se_PutBucketAnalyticsConfigurationCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        "content-type": "application/xml",
        [_xaebo]: input[_EBO]
      });
      b11.bp("/");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      const query = map({
        [_a3]: [, ""],
        [_i]: [, expectNonNull(input[_I], `Id`)]
      });
      let body;
      let contents;
      if (input.AnalyticsConfiguration !== void 0) {
        contents = se_AnalyticsConfiguration(input.AnalyticsConfiguration, context2);
        body = _ve;
        contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/");
        body += contents.toString();
      }
      b11.m("PUT").h(headers).q(query).b(body);
      return b11.build();
    }, "se_PutBucketAnalyticsConfigurationCommand");
    se_PutBucketCorsCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        "content-type": "application/xml",
        [_cm]: input[_CMD],
        [_xasca]: input[_CA],
        [_xaebo]: input[_EBO]
      });
      b11.bp("/");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      const query = map({
        [_c2]: [, ""]
      });
      let body;
      let contents;
      if (input.CORSConfiguration !== void 0) {
        contents = se_CORSConfiguration(input.CORSConfiguration, context2);
        body = _ve;
        contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/");
        body += contents.toString();
      }
      b11.m("PUT").h(headers).q(query).b(body);
      return b11.build();
    }, "se_PutBucketCorsCommand");
    se_PutBucketEncryptionCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        "content-type": "application/xml",
        [_cm]: input[_CMD],
        [_xasca]: input[_CA],
        [_xaebo]: input[_EBO]
      });
      b11.bp("/");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      const query = map({
        [_en]: [, ""]
      });
      let body;
      let contents;
      if (input.ServerSideEncryptionConfiguration !== void 0) {
        contents = se_ServerSideEncryptionConfiguration(input.ServerSideEncryptionConfiguration, context2);
        body = _ve;
        contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/");
        body += contents.toString();
      }
      b11.m("PUT").h(headers).q(query).b(body);
      return b11.build();
    }, "se_PutBucketEncryptionCommand");
    se_PutBucketIntelligentTieringConfigurationCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = {
        "content-type": "application/xml"
      };
      b11.bp("/");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      const query = map({
        [_it]: [, ""],
        [_i]: [, expectNonNull(input[_I], `Id`)]
      });
      let body;
      let contents;
      if (input.IntelligentTieringConfiguration !== void 0) {
        contents = se_IntelligentTieringConfiguration(input.IntelligentTieringConfiguration, context2);
        body = _ve;
        contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/");
        body += contents.toString();
      }
      b11.m("PUT").h(headers).q(query).b(body);
      return b11.build();
    }, "se_PutBucketIntelligentTieringConfigurationCommand");
    se_PutBucketInventoryConfigurationCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        "content-type": "application/xml",
        [_xaebo]: input[_EBO]
      });
      b11.bp("/");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      const query = map({
        [_in]: [, ""],
        [_i]: [, expectNonNull(input[_I], `Id`)]
      });
      let body;
      let contents;
      if (input.InventoryConfiguration !== void 0) {
        contents = se_InventoryConfiguration(input.InventoryConfiguration, context2);
        body = _ve;
        contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/");
        body += contents.toString();
      }
      b11.m("PUT").h(headers).q(query).b(body);
      return b11.build();
    }, "se_PutBucketInventoryConfigurationCommand");
    se_PutBucketLifecycleConfigurationCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        "content-type": "application/xml",
        [_xasca]: input[_CA],
        [_xaebo]: input[_EBO],
        [_xatdmos]: input[_TDMOS]
      });
      b11.bp("/");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      const query = map({
        [_l]: [, ""]
      });
      let body;
      let contents;
      if (input.LifecycleConfiguration !== void 0) {
        contents = se_BucketLifecycleConfiguration(input.LifecycleConfiguration, context2);
        contents = contents.n("LifecycleConfiguration");
        body = _ve;
        contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/");
        body += contents.toString();
      }
      b11.m("PUT").h(headers).q(query).b(body);
      return b11.build();
    }, "se_PutBucketLifecycleConfigurationCommand");
    se_PutBucketLoggingCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        "content-type": "application/xml",
        [_cm]: input[_CMD],
        [_xasca]: input[_CA],
        [_xaebo]: input[_EBO]
      });
      b11.bp("/");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      const query = map({
        [_log]: [, ""]
      });
      let body;
      let contents;
      if (input.BucketLoggingStatus !== void 0) {
        contents = se_BucketLoggingStatus(input.BucketLoggingStatus, context2);
        body = _ve;
        contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/");
        body += contents.toString();
      }
      b11.m("PUT").h(headers).q(query).b(body);
      return b11.build();
    }, "se_PutBucketLoggingCommand");
    se_PutBucketMetricsConfigurationCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        "content-type": "application/xml",
        [_xaebo]: input[_EBO]
      });
      b11.bp("/");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      const query = map({
        [_m]: [, ""],
        [_i]: [, expectNonNull(input[_I], `Id`)]
      });
      let body;
      let contents;
      if (input.MetricsConfiguration !== void 0) {
        contents = se_MetricsConfiguration(input.MetricsConfiguration, context2);
        body = _ve;
        contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/");
        body += contents.toString();
      }
      b11.m("PUT").h(headers).q(query).b(body);
      return b11.build();
    }, "se_PutBucketMetricsConfigurationCommand");
    se_PutBucketNotificationConfigurationCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        "content-type": "application/xml",
        [_xaebo]: input[_EBO],
        [_xasdv]: [() => isSerializableHeaderValue(input[_SDV]), () => input[_SDV].toString()]
      });
      b11.bp("/");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      const query = map({
        [_n]: [, ""]
      });
      let body;
      let contents;
      if (input.NotificationConfiguration !== void 0) {
        contents = se_NotificationConfiguration(input.NotificationConfiguration, context2);
        body = _ve;
        contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/");
        body += contents.toString();
      }
      b11.m("PUT").h(headers).q(query).b(body);
      return b11.build();
    }, "se_PutBucketNotificationConfigurationCommand");
    se_PutBucketOwnershipControlsCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        "content-type": "application/xml",
        [_cm]: input[_CMD],
        [_xaebo]: input[_EBO]
      });
      b11.bp("/");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      const query = map({
        [_oC]: [, ""]
      });
      let body;
      let contents;
      if (input.OwnershipControls !== void 0) {
        contents = se_OwnershipControls(input.OwnershipControls, context2);
        body = _ve;
        contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/");
        body += contents.toString();
      }
      b11.m("PUT").h(headers).q(query).b(body);
      return b11.build();
    }, "se_PutBucketOwnershipControlsCommand");
    se_PutBucketPolicyCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        "content-type": "text/plain",
        [_cm]: input[_CMD],
        [_xasca]: input[_CA],
        [_xacrsba]: [() => isSerializableHeaderValue(input[_CRSBA]), () => input[_CRSBA].toString()],
        [_xaebo]: input[_EBO]
      });
      b11.bp("/");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      const query = map({
        [_p]: [, ""]
      });
      let body;
      let contents;
      if (input.Policy !== void 0) {
        contents = input.Policy;
        body = contents;
      }
      b11.m("PUT").h(headers).q(query).b(body);
      return b11.build();
    }, "se_PutBucketPolicyCommand");
    se_PutBucketReplicationCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        "content-type": "application/xml",
        [_cm]: input[_CMD],
        [_xasca]: input[_CA],
        [_xabolt]: input[_To],
        [_xaebo]: input[_EBO]
      });
      b11.bp("/");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      const query = map({
        [_r2]: [, ""]
      });
      let body;
      let contents;
      if (input.ReplicationConfiguration !== void 0) {
        contents = se_ReplicationConfiguration(input.ReplicationConfiguration, context2);
        body = _ve;
        contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/");
        body += contents.toString();
      }
      b11.m("PUT").h(headers).q(query).b(body);
      return b11.build();
    }, "se_PutBucketReplicationCommand");
    se_PutBucketRequestPaymentCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        "content-type": "application/xml",
        [_cm]: input[_CMD],
        [_xasca]: input[_CA],
        [_xaebo]: input[_EBO]
      });
      b11.bp("/");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      const query = map({
        [_rP]: [, ""]
      });
      let body;
      let contents;
      if (input.RequestPaymentConfiguration !== void 0) {
        contents = se_RequestPaymentConfiguration(input.RequestPaymentConfiguration, context2);
        body = _ve;
        contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/");
        body += contents.toString();
      }
      b11.m("PUT").h(headers).q(query).b(body);
      return b11.build();
    }, "se_PutBucketRequestPaymentCommand");
    se_PutBucketTaggingCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        "content-type": "application/xml",
        [_cm]: input[_CMD],
        [_xasca]: input[_CA],
        [_xaebo]: input[_EBO]
      });
      b11.bp("/");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      const query = map({
        [_t2]: [, ""]
      });
      let body;
      let contents;
      if (input.Tagging !== void 0) {
        contents = se_Tagging(input.Tagging, context2);
        body = _ve;
        contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/");
        body += contents.toString();
      }
      b11.m("PUT").h(headers).q(query).b(body);
      return b11.build();
    }, "se_PutBucketTaggingCommand");
    se_PutBucketVersioningCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        "content-type": "application/xml",
        [_cm]: input[_CMD],
        [_xasca]: input[_CA],
        [_xam]: input[_MFA],
        [_xaebo]: input[_EBO]
      });
      b11.bp("/");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      const query = map({
        [_v]: [, ""]
      });
      let body;
      let contents;
      if (input.VersioningConfiguration !== void 0) {
        contents = se_VersioningConfiguration(input.VersioningConfiguration, context2);
        body = _ve;
        contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/");
        body += contents.toString();
      }
      b11.m("PUT").h(headers).q(query).b(body);
      return b11.build();
    }, "se_PutBucketVersioningCommand");
    se_PutBucketWebsiteCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        "content-type": "application/xml",
        [_cm]: input[_CMD],
        [_xasca]: input[_CA],
        [_xaebo]: input[_EBO]
      });
      b11.bp("/");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      const query = map({
        [_w]: [, ""]
      });
      let body;
      let contents;
      if (input.WebsiteConfiguration !== void 0) {
        contents = se_WebsiteConfiguration(input.WebsiteConfiguration, context2);
        body = _ve;
        contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/");
        body += contents.toString();
      }
      b11.m("PUT").h(headers).q(query).b(body);
      return b11.build();
    }, "se_PutBucketWebsiteCommand");
    se_PutObjectCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        [_ct]: input[_CT] || "application/octet-stream",
        [_xaa]: input[_ACL],
        [_cc]: input[_CC],
        [_cd]: input[_CD],
        [_ce]: input[_CE],
        [_cl]: input[_CL],
        [_cl_]: [() => isSerializableHeaderValue(input[_CLo]), () => input[_CLo].toString()],
        [_cm]: input[_CMD],
        [_xasca]: input[_CA],
        [_xacc]: input[_CCRC],
        [_xacc_]: input[_CCRCC],
        [_xacs]: input[_CSHA],
        [_xacs_]: input[_CSHAh],
        [_e2]: [() => isSerializableHeaderValue(input[_E]), () => dateToUtcString(input[_E]).toString()],
        [_im]: input[_IM],
        [_inm]: input[_INM],
        [_xagfc]: input[_GFC],
        [_xagr]: input[_GR],
        [_xagra]: input[_GRACP],
        [_xagwa]: input[_GWACP],
        [_xawob]: [() => isSerializableHeaderValue(input[_WOB]), () => input[_WOB].toString()],
        [_xasse]: input[_SSE],
        [_xasc]: input[_SC],
        [_xawrl]: input[_WRL],
        [_xasseca]: input[_SSECA],
        [_xasseck]: input[_SSECK],
        [_xasseckm]: input[_SSECKMD],
        [_xasseakki]: input[_SSEKMSKI],
        [_xassec]: input[_SSEKMSEC],
        [_xassebke]: [() => isSerializableHeaderValue(input[_BKE]), () => input[_BKE].toString()],
        [_xarp]: input[_RP],
        [_xat]: input[_T],
        [_xaolm]: input[_OLM],
        [_xaolrud]: [() => isSerializableHeaderValue(input[_OLRUD]), () => serializeDateTime(input[_OLRUD]).toString()],
        [_xaollh]: input[_OLLHS],
        [_xaebo]: input[_EBO],
        ...input.Metadata !== void 0 && Object.keys(input.Metadata).reduce((acc, suffix) => {
          acc[`x-amz-meta-${suffix.toLowerCase()}`] = input.Metadata[suffix];
          return acc;
        }, {})
      });
      b11.bp("/{Key+}");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      b11.p("Key", () => input.Key, "{Key+}", true);
      const query = map({
        [_xi]: [, "PutObject"]
      });
      let body;
      let contents;
      if (input.Body !== void 0) {
        contents = input.Body;
        body = contents;
      }
      b11.m("PUT").h(headers).q(query).b(body);
      return b11.build();
    }, "se_PutObjectCommand");
    se_PutObjectAclCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        "content-type": "application/xml",
        [_xaa]: input[_ACL],
        [_cm]: input[_CMD],
        [_xasca]: input[_CA],
        [_xagfc]: input[_GFC],
        [_xagr]: input[_GR],
        [_xagra]: input[_GRACP],
        [_xagw]: input[_GW],
        [_xagwa]: input[_GWACP],
        [_xarp]: input[_RP],
        [_xaebo]: input[_EBO]
      });
      b11.bp("/{Key+}");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      b11.p("Key", () => input.Key, "{Key+}", true);
      const query = map({
        [_acl]: [, ""],
        [_vI]: [, input[_VI]]
      });
      let body;
      let contents;
      if (input.AccessControlPolicy !== void 0) {
        contents = se_AccessControlPolicy(input.AccessControlPolicy, context2);
        body = _ve;
        contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/");
        body += contents.toString();
      }
      b11.m("PUT").h(headers).q(query).b(body);
      return b11.build();
    }, "se_PutObjectAclCommand");
    se_PutObjectLegalHoldCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        "content-type": "application/xml",
        [_xarp]: input[_RP],
        [_cm]: input[_CMD],
        [_xasca]: input[_CA],
        [_xaebo]: input[_EBO]
      });
      b11.bp("/{Key+}");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      b11.p("Key", () => input.Key, "{Key+}", true);
      const query = map({
        [_lh]: [, ""],
        [_vI]: [, input[_VI]]
      });
      let body;
      let contents;
      if (input.LegalHold !== void 0) {
        contents = se_ObjectLockLegalHold(input.LegalHold, context2);
        contents = contents.n("LegalHold");
        body = _ve;
        contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/");
        body += contents.toString();
      }
      b11.m("PUT").h(headers).q(query).b(body);
      return b11.build();
    }, "se_PutObjectLegalHoldCommand");
    se_PutObjectLockConfigurationCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        "content-type": "application/xml",
        [_xarp]: input[_RP],
        [_xabolt]: input[_To],
        [_cm]: input[_CMD],
        [_xasca]: input[_CA],
        [_xaebo]: input[_EBO]
      });
      b11.bp("/");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      const query = map({
        [_ol]: [, ""]
      });
      let body;
      let contents;
      if (input.ObjectLockConfiguration !== void 0) {
        contents = se_ObjectLockConfiguration(input.ObjectLockConfiguration, context2);
        body = _ve;
        contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/");
        body += contents.toString();
      }
      b11.m("PUT").h(headers).q(query).b(body);
      return b11.build();
    }, "se_PutObjectLockConfigurationCommand");
    se_PutObjectRetentionCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        "content-type": "application/xml",
        [_xarp]: input[_RP],
        [_xabgr]: [() => isSerializableHeaderValue(input[_BGR]), () => input[_BGR].toString()],
        [_cm]: input[_CMD],
        [_xasca]: input[_CA],
        [_xaebo]: input[_EBO]
      });
      b11.bp("/{Key+}");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      b11.p("Key", () => input.Key, "{Key+}", true);
      const query = map({
        [_ret]: [, ""],
        [_vI]: [, input[_VI]]
      });
      let body;
      let contents;
      if (input.Retention !== void 0) {
        contents = se_ObjectLockRetention(input.Retention, context2);
        contents = contents.n("Retention");
        body = _ve;
        contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/");
        body += contents.toString();
      }
      b11.m("PUT").h(headers).q(query).b(body);
      return b11.build();
    }, "se_PutObjectRetentionCommand");
    se_PutObjectTaggingCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        "content-type": "application/xml",
        [_cm]: input[_CMD],
        [_xasca]: input[_CA],
        [_xaebo]: input[_EBO],
        [_xarp]: input[_RP]
      });
      b11.bp("/{Key+}");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      b11.p("Key", () => input.Key, "{Key+}", true);
      const query = map({
        [_t2]: [, ""],
        [_vI]: [, input[_VI]]
      });
      let body;
      let contents;
      if (input.Tagging !== void 0) {
        contents = se_Tagging(input.Tagging, context2);
        body = _ve;
        contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/");
        body += contents.toString();
      }
      b11.m("PUT").h(headers).q(query).b(body);
      return b11.build();
    }, "se_PutObjectTaggingCommand");
    se_PutPublicAccessBlockCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        "content-type": "application/xml",
        [_cm]: input[_CMD],
        [_xasca]: input[_CA],
        [_xaebo]: input[_EBO]
      });
      b11.bp("/");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      const query = map({
        [_pAB]: [, ""]
      });
      let body;
      let contents;
      if (input.PublicAccessBlockConfiguration !== void 0) {
        contents = se_PublicAccessBlockConfiguration(input.PublicAccessBlockConfiguration, context2);
        body = _ve;
        contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/");
        body += contents.toString();
      }
      b11.m("PUT").h(headers).q(query).b(body);
      return b11.build();
    }, "se_PutPublicAccessBlockCommand");
    se_RestoreObjectCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        "content-type": "application/xml",
        [_xarp]: input[_RP],
        [_xasca]: input[_CA],
        [_xaebo]: input[_EBO]
      });
      b11.bp("/{Key+}");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      b11.p("Key", () => input.Key, "{Key+}", true);
      const query = map({
        [_res]: [, ""],
        [_vI]: [, input[_VI]]
      });
      let body;
      let contents;
      if (input.RestoreRequest !== void 0) {
        contents = se_RestoreRequest(input.RestoreRequest, context2);
        body = _ve;
        contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/");
        body += contents.toString();
      }
      b11.m("POST").h(headers).q(query).b(body);
      return b11.build();
    }, "se_RestoreObjectCommand");
    se_SelectObjectContentCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        "content-type": "application/xml",
        [_xasseca]: input[_SSECA],
        [_xasseck]: input[_SSECK],
        [_xasseckm]: input[_SSECKMD],
        [_xaebo]: input[_EBO]
      });
      b11.bp("/{Key+}");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      b11.p("Key", () => input.Key, "{Key+}", true);
      const query = map({
        [_se]: [, ""],
        [_st]: [, "2"]
      });
      let body;
      body = _ve;
      const bn2 = new XmlNode(_SOCR);
      bn2.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/");
      bn2.cc(input, _Ex);
      bn2.cc(input, _ETx);
      if (input[_IS] != null) {
        bn2.c(se_InputSerialization(input[_IS], context2).n(_IS));
      }
      if (input[_OS] != null) {
        bn2.c(se_OutputSerialization(input[_OS], context2).n(_OS));
      }
      if (input[_RPe] != null) {
        bn2.c(se_RequestProgress(input[_RPe], context2).n(_RPe));
      }
      if (input[_SR] != null) {
        bn2.c(se_ScanRange(input[_SR], context2).n(_SR));
      }
      body += bn2.toString();
      b11.m("POST").h(headers).q(query).b(body);
      return b11.build();
    }, "se_SelectObjectContentCommand");
    se_UploadPartCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        "content-type": "application/octet-stream",
        [_cl_]: [() => isSerializableHeaderValue(input[_CLo]), () => input[_CLo].toString()],
        [_cm]: input[_CMD],
        [_xasca]: input[_CA],
        [_xacc]: input[_CCRC],
        [_xacc_]: input[_CCRCC],
        [_xacs]: input[_CSHA],
        [_xacs_]: input[_CSHAh],
        [_xasseca]: input[_SSECA],
        [_xasseck]: input[_SSECK],
        [_xasseckm]: input[_SSECKMD],
        [_xarp]: input[_RP],
        [_xaebo]: input[_EBO]
      });
      b11.bp("/{Key+}");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      b11.p("Key", () => input.Key, "{Key+}", true);
      const query = map({
        [_xi]: [, "UploadPart"],
        [_pN]: [expectNonNull(input.PartNumber, `PartNumber`) != null, () => input[_PN].toString()],
        [_uI]: [, expectNonNull(input[_UI], `UploadId`)]
      });
      let body;
      let contents;
      if (input.Body !== void 0) {
        contents = input.Body;
        body = contents;
      }
      b11.m("PUT").h(headers).q(query).b(body);
      return b11.build();
    }, "se_UploadPartCommand");
    se_UploadPartCopyCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        [_xacs__]: input[_CS],
        [_xacsim]: input[_CSIM],
        [_xacsims]: [() => isSerializableHeaderValue(input[_CSIMS]), () => dateToUtcString(input[_CSIMS]).toString()],
        [_xacsinm]: input[_CSINM],
        [_xacsius]: [() => isSerializableHeaderValue(input[_CSIUS]), () => dateToUtcString(input[_CSIUS]).toString()],
        [_xacsr]: input[_CSR],
        [_xasseca]: input[_SSECA],
        [_xasseck]: input[_SSECK],
        [_xasseckm]: input[_SSECKMD],
        [_xacssseca]: input[_CSSSECA],
        [_xacssseck]: input[_CSSSECK],
        [_xacssseckm]: input[_CSSSECKMD],
        [_xarp]: input[_RP],
        [_xaebo]: input[_EBO],
        [_xasebo]: input[_ESBO]
      });
      b11.bp("/{Key+}");
      b11.p("Bucket", () => input.Bucket, "{Bucket}", false);
      b11.p("Key", () => input.Key, "{Key+}", true);
      const query = map({
        [_xi]: [, "UploadPartCopy"],
        [_pN]: [expectNonNull(input.PartNumber, `PartNumber`) != null, () => input[_PN].toString()],
        [_uI]: [, expectNonNull(input[_UI], `UploadId`)]
      });
      let body;
      b11.m("PUT").h(headers).q(query).b(body);
      return b11.build();
    }, "se_UploadPartCopyCommand");
    se_WriteGetObjectResponseCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        "x-amz-content-sha256": "UNSIGNED-PAYLOAD",
        "content-type": "application/octet-stream",
        [_xarr]: input[_RR],
        [_xart]: input[_RT],
        [_xafs]: [() => isSerializableHeaderValue(input[_SCt]), () => input[_SCt].toString()],
        [_xafec]: input[_EC],
        [_xafem]: input[_EM],
        [_xafhar]: input[_AR],
        [_xafhcc]: input[_CC],
        [_xafhcd]: input[_CD],
        [_xafhce]: input[_CE],
        [_xafhcl]: input[_CL],
        [_cl_]: [() => isSerializableHeaderValue(input[_CLo]), () => input[_CLo].toString()],
        [_xafhcr]: input[_CR],
        [_xafhct]: input[_CT],
        [_xafhxacc]: input[_CCRC],
        [_xafhxacc_]: input[_CCRCC],
        [_xafhxacs]: input[_CSHA],
        [_xafhxacs_]: input[_CSHAh],
        [_xafhxadm]: [() => isSerializableHeaderValue(input[_DM]), () => input[_DM].toString()],
        [_xafhe]: input[_ETa],
        [_xafhe_]: [() => isSerializableHeaderValue(input[_E]), () => dateToUtcString(input[_E]).toString()],
        [_xafhxae]: input[_Exp],
        [_xafhlm]: [() => isSerializableHeaderValue(input[_LM]), () => dateToUtcString(input[_LM]).toString()],
        [_xafhxamm]: [() => isSerializableHeaderValue(input[_MM]), () => input[_MM].toString()],
        [_xafhxaolm]: input[_OLM],
        [_xafhxaollh]: input[_OLLHS],
        [_xafhxaolrud]: [
          () => isSerializableHeaderValue(input[_OLRUD]),
          () => serializeDateTime(input[_OLRUD]).toString()
        ],
        [_xafhxampc]: [() => isSerializableHeaderValue(input[_PC]), () => input[_PC].toString()],
        [_xafhxars]: input[_RS],
        [_xafhxarc]: input[_RC],
        [_xafhxar]: input[_Re],
        [_xafhxasse]: input[_SSE],
        [_xafhxasseca]: input[_SSECA],
        [_xafhxasseakki]: input[_SSEKMSKI],
        [_xafhxasseckm]: input[_SSECKMD],
        [_xafhxasc]: input[_SC],
        [_xafhxatc]: [() => isSerializableHeaderValue(input[_TC]), () => input[_TC].toString()],
        [_xafhxavi]: input[_VI],
        [_xafhxassebke]: [() => isSerializableHeaderValue(input[_BKE]), () => input[_BKE].toString()],
        ...input.Metadata !== void 0 && Object.keys(input.Metadata).reduce((acc, suffix) => {
          acc[`x-amz-meta-${suffix.toLowerCase()}`] = input.Metadata[suffix];
          return acc;
        }, {})
      });
      b11.bp("/WriteGetObjectResponse");
      let body;
      let contents;
      if (input.Body !== void 0) {
        contents = input.Body;
        body = contents;
      }
      let { hostname: resolvedHostname } = await context2.endpoint();
      if (context2.disableHostPrefix !== true) {
        resolvedHostname = "{RequestRoute}." + resolvedHostname;
        if (input.RequestRoute === void 0) {
          throw new Error("Empty value provided for input host prefix: RequestRoute.");
        }
        resolvedHostname = resolvedHostname.replace("{RequestRoute}", input.RequestRoute);
        if (!isValidHostname(resolvedHostname)) {
          throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
        }
      }
      b11.hn(resolvedHostname);
      b11.m("POST").h(headers).b(body);
      return b11.build();
    }, "se_WriteGetObjectResponseCommand");
    de_AbortMultipartUploadCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 204 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output),
        [_RC]: [, output.headers[_xarc]]
      });
      await collectBody(output.body, context2);
      return contents;
    }, "de_AbortMultipartUploadCommand");
    de_CompleteMultipartUploadCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output),
        [_Exp]: [, output.headers[_xae]],
        [_SSE]: [, output.headers[_xasse]],
        [_VI]: [, output.headers[_xavi]],
        [_SSEKMSKI]: [, output.headers[_xasseakki]],
        [_BKE]: [() => void 0 !== output.headers[_xassebke], () => parseBoolean(output.headers[_xassebke])],
        [_RC]: [, output.headers[_xarc]]
      });
      const data = expectNonNull(expectObject(await parseXmlBody(output.body, context2)), "body");
      if (data[_B] != null) {
        contents[_B] = expectString(data[_B]);
      }
      if (data[_CCRC] != null) {
        contents[_CCRC] = expectString(data[_CCRC]);
      }
      if (data[_CCRCC] != null) {
        contents[_CCRCC] = expectString(data[_CCRCC]);
      }
      if (data[_CSHA] != null) {
        contents[_CSHA] = expectString(data[_CSHA]);
      }
      if (data[_CSHAh] != null) {
        contents[_CSHAh] = expectString(data[_CSHAh]);
      }
      if (data[_ETa] != null) {
        contents[_ETa] = expectString(data[_ETa]);
      }
      if (data[_K] != null) {
        contents[_K] = expectString(data[_K]);
      }
      if (data[_L] != null) {
        contents[_L] = expectString(data[_L]);
      }
      return contents;
    }, "de_CompleteMultipartUploadCommand");
    de_CopyObjectCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output),
        [_Exp]: [, output.headers[_xae]],
        [_CSVI]: [, output.headers[_xacsvi]],
        [_VI]: [, output.headers[_xavi]],
        [_SSE]: [, output.headers[_xasse]],
        [_SSECA]: [, output.headers[_xasseca]],
        [_SSECKMD]: [, output.headers[_xasseckm]],
        [_SSEKMSKI]: [, output.headers[_xasseakki]],
        [_SSEKMSEC]: [, output.headers[_xassec]],
        [_BKE]: [() => void 0 !== output.headers[_xassebke], () => parseBoolean(output.headers[_xassebke])],
        [_RC]: [, output.headers[_xarc]]
      });
      const data = expectObject(await parseXmlBody(output.body, context2));
      contents.CopyObjectResult = de_CopyObjectResult(data, context2);
      return contents;
    }, "de_CopyObjectCommand");
    de_CreateBucketCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output),
        [_L]: [, output.headers[_lo]]
      });
      await collectBody(output.body, context2);
      return contents;
    }, "de_CreateBucketCommand");
    de_CreateBucketMetadataTableConfigurationCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output)
      });
      await collectBody(output.body, context2);
      return contents;
    }, "de_CreateBucketMetadataTableConfigurationCommand");
    de_CreateMultipartUploadCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output),
        [_AD]: [
          () => void 0 !== output.headers[_xaad],
          () => expectNonNull(parseRfc7231DateTime(output.headers[_xaad]))
        ],
        [_ARI]: [, output.headers[_xaari]],
        [_SSE]: [, output.headers[_xasse]],
        [_SSECA]: [, output.headers[_xasseca]],
        [_SSECKMD]: [, output.headers[_xasseckm]],
        [_SSEKMSKI]: [, output.headers[_xasseakki]],
        [_SSEKMSEC]: [, output.headers[_xassec]],
        [_BKE]: [() => void 0 !== output.headers[_xassebke], () => parseBoolean(output.headers[_xassebke])],
        [_RC]: [, output.headers[_xarc]],
        [_CA]: [, output.headers[_xaca]]
      });
      const data = expectNonNull(expectObject(await parseXmlBody(output.body, context2)), "body");
      if (data[_B] != null) {
        contents[_B] = expectString(data[_B]);
      }
      if (data[_K] != null) {
        contents[_K] = expectString(data[_K]);
      }
      if (data[_UI] != null) {
        contents[_UI] = expectString(data[_UI]);
      }
      return contents;
    }, "de_CreateMultipartUploadCommand");
    de_CreateSessionCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output),
        [_SSE]: [, output.headers[_xasse]],
        [_SSEKMSKI]: [, output.headers[_xasseakki]],
        [_SSEKMSEC]: [, output.headers[_xassec]],
        [_BKE]: [() => void 0 !== output.headers[_xassebke], () => parseBoolean(output.headers[_xassebke])]
      });
      const data = expectNonNull(expectObject(await parseXmlBody(output.body, context2)), "body");
      if (data[_C] != null) {
        contents[_C] = de_SessionCredentials(data[_C], context2);
      }
      return contents;
    }, "de_CreateSessionCommand");
    de_DeleteBucketCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 204 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output)
      });
      await collectBody(output.body, context2);
      return contents;
    }, "de_DeleteBucketCommand");
    de_DeleteBucketAnalyticsConfigurationCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 204 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output)
      });
      await collectBody(output.body, context2);
      return contents;
    }, "de_DeleteBucketAnalyticsConfigurationCommand");
    de_DeleteBucketCorsCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 204 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output)
      });
      await collectBody(output.body, context2);
      return contents;
    }, "de_DeleteBucketCorsCommand");
    de_DeleteBucketEncryptionCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 204 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output)
      });
      await collectBody(output.body, context2);
      return contents;
    }, "de_DeleteBucketEncryptionCommand");
    de_DeleteBucketIntelligentTieringConfigurationCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 204 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output)
      });
      await collectBody(output.body, context2);
      return contents;
    }, "de_DeleteBucketIntelligentTieringConfigurationCommand");
    de_DeleteBucketInventoryConfigurationCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 204 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output)
      });
      await collectBody(output.body, context2);
      return contents;
    }, "de_DeleteBucketInventoryConfigurationCommand");
    de_DeleteBucketLifecycleCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 204 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output)
      });
      await collectBody(output.body, context2);
      return contents;
    }, "de_DeleteBucketLifecycleCommand");
    de_DeleteBucketMetadataTableConfigurationCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 204 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output)
      });
      await collectBody(output.body, context2);
      return contents;
    }, "de_DeleteBucketMetadataTableConfigurationCommand");
    de_DeleteBucketMetricsConfigurationCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 204 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output)
      });
      await collectBody(output.body, context2);
      return contents;
    }, "de_DeleteBucketMetricsConfigurationCommand");
    de_DeleteBucketOwnershipControlsCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 204 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output)
      });
      await collectBody(output.body, context2);
      return contents;
    }, "de_DeleteBucketOwnershipControlsCommand");
    de_DeleteBucketPolicyCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 204 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output)
      });
      await collectBody(output.body, context2);
      return contents;
    }, "de_DeleteBucketPolicyCommand");
    de_DeleteBucketReplicationCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 204 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output)
      });
      await collectBody(output.body, context2);
      return contents;
    }, "de_DeleteBucketReplicationCommand");
    de_DeleteBucketTaggingCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 204 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output)
      });
      await collectBody(output.body, context2);
      return contents;
    }, "de_DeleteBucketTaggingCommand");
    de_DeleteBucketWebsiteCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 204 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output)
      });
      await collectBody(output.body, context2);
      return contents;
    }, "de_DeleteBucketWebsiteCommand");
    de_DeleteObjectCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 204 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output),
        [_DM]: [() => void 0 !== output.headers[_xadm], () => parseBoolean(output.headers[_xadm])],
        [_VI]: [, output.headers[_xavi]],
        [_RC]: [, output.headers[_xarc]]
      });
      await collectBody(output.body, context2);
      return contents;
    }, "de_DeleteObjectCommand");
    de_DeleteObjectsCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output),
        [_RC]: [, output.headers[_xarc]]
      });
      const data = expectNonNull(expectObject(await parseXmlBody(output.body, context2)), "body");
      if (data.Deleted === "") {
        contents[_De] = [];
      } else if (data[_De] != null) {
        contents[_De] = de_DeletedObjects(getArrayIfSingleItem(data[_De]), context2);
      }
      if (data.Error === "") {
        contents[_Err] = [];
      } else if (data[_Er] != null) {
        contents[_Err] = de_Errors(getArrayIfSingleItem(data[_Er]), context2);
      }
      return contents;
    }, "de_DeleteObjectsCommand");
    de_DeleteObjectTaggingCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 204 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output),
        [_VI]: [, output.headers[_xavi]]
      });
      await collectBody(output.body, context2);
      return contents;
    }, "de_DeleteObjectTaggingCommand");
    de_DeletePublicAccessBlockCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 204 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output)
      });
      await collectBody(output.body, context2);
      return contents;
    }, "de_DeletePublicAccessBlockCommand");
    de_GetBucketAccelerateConfigurationCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output),
        [_RC]: [, output.headers[_xarc]]
      });
      const data = expectNonNull(expectObject(await parseXmlBody(output.body, context2)), "body");
      if (data[_S] != null) {
        contents[_S] = expectString(data[_S]);
      }
      return contents;
    }, "de_GetBucketAccelerateConfigurationCommand");
    de_GetBucketAclCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output)
      });
      const data = expectNonNull(expectObject(await parseXmlBody(output.body, context2)), "body");
      if (data.AccessControlList === "") {
        contents[_Gr] = [];
      } else if (data[_ACLc] != null && data[_ACLc][_G] != null) {
        contents[_Gr] = de_Grants(getArrayIfSingleItem(data[_ACLc][_G]), context2);
      }
      if (data[_O] != null) {
        contents[_O] = de_Owner(data[_O], context2);
      }
      return contents;
    }, "de_GetBucketAclCommand");
    de_GetBucketAnalyticsConfigurationCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output)
      });
      const data = expectObject(await parseXmlBody(output.body, context2));
      contents.AnalyticsConfiguration = de_AnalyticsConfiguration(data, context2);
      return contents;
    }, "de_GetBucketAnalyticsConfigurationCommand");
    de_GetBucketCorsCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output)
      });
      const data = expectNonNull(expectObject(await parseXmlBody(output.body, context2)), "body");
      if (data.CORSRule === "") {
        contents[_CORSRu] = [];
      } else if (data[_CORSR] != null) {
        contents[_CORSRu] = de_CORSRules(getArrayIfSingleItem(data[_CORSR]), context2);
      }
      return contents;
    }, "de_GetBucketCorsCommand");
    de_GetBucketEncryptionCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output)
      });
      const data = expectObject(await parseXmlBody(output.body, context2));
      contents.ServerSideEncryptionConfiguration = de_ServerSideEncryptionConfiguration(data, context2);
      return contents;
    }, "de_GetBucketEncryptionCommand");
    de_GetBucketIntelligentTieringConfigurationCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output)
      });
      const data = expectObject(await parseXmlBody(output.body, context2));
      contents.IntelligentTieringConfiguration = de_IntelligentTieringConfiguration(data, context2);
      return contents;
    }, "de_GetBucketIntelligentTieringConfigurationCommand");
    de_GetBucketInventoryConfigurationCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output)
      });
      const data = expectObject(await parseXmlBody(output.body, context2));
      contents.InventoryConfiguration = de_InventoryConfiguration(data, context2);
      return contents;
    }, "de_GetBucketInventoryConfigurationCommand");
    de_GetBucketLifecycleConfigurationCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output),
        [_TDMOS]: [, output.headers[_xatdmos]]
      });
      const data = expectNonNull(expectObject(await parseXmlBody(output.body, context2)), "body");
      if (data.Rule === "") {
        contents[_Rul] = [];
      } else if (data[_Ru] != null) {
        contents[_Rul] = de_LifecycleRules(getArrayIfSingleItem(data[_Ru]), context2);
      }
      return contents;
    }, "de_GetBucketLifecycleConfigurationCommand");
    de_GetBucketLocationCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output)
      });
      const data = expectNonNull(expectObject(await parseXmlBody(output.body, context2)), "body");
      if (data[_LC] != null) {
        contents[_LC] = expectString(data[_LC]);
      }
      return contents;
    }, "de_GetBucketLocationCommand");
    de_GetBucketLoggingCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output)
      });
      const data = expectNonNull(expectObject(await parseXmlBody(output.body, context2)), "body");
      if (data[_LE] != null) {
        contents[_LE] = de_LoggingEnabled(data[_LE], context2);
      }
      return contents;
    }, "de_GetBucketLoggingCommand");
    de_GetBucketMetadataTableConfigurationCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output)
      });
      const data = expectObject(await parseXmlBody(output.body, context2));
      contents.GetBucketMetadataTableConfigurationResult = de_GetBucketMetadataTableConfigurationResult(data, context2);
      return contents;
    }, "de_GetBucketMetadataTableConfigurationCommand");
    de_GetBucketMetricsConfigurationCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output)
      });
      const data = expectObject(await parseXmlBody(output.body, context2));
      contents.MetricsConfiguration = de_MetricsConfiguration(data, context2);
      return contents;
    }, "de_GetBucketMetricsConfigurationCommand");
    de_GetBucketNotificationConfigurationCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output)
      });
      const data = expectNonNull(expectObject(await parseXmlBody(output.body, context2)), "body");
      if (data[_EBC] != null) {
        contents[_EBC] = de_EventBridgeConfiguration(data[_EBC], context2);
      }
      if (data.CloudFunctionConfiguration === "") {
        contents[_LFC] = [];
      } else if (data[_CFC] != null) {
        contents[_LFC] = de_LambdaFunctionConfigurationList(getArrayIfSingleItem(data[_CFC]), context2);
      }
      if (data.QueueConfiguration === "") {
        contents[_QCu] = [];
      } else if (data[_QC] != null) {
        contents[_QCu] = de_QueueConfigurationList(getArrayIfSingleItem(data[_QC]), context2);
      }
      if (data.TopicConfiguration === "") {
        contents[_TCop] = [];
      } else if (data[_TCo] != null) {
        contents[_TCop] = de_TopicConfigurationList(getArrayIfSingleItem(data[_TCo]), context2);
      }
      return contents;
    }, "de_GetBucketNotificationConfigurationCommand");
    de_GetBucketOwnershipControlsCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output)
      });
      const data = expectObject(await parseXmlBody(output.body, context2));
      contents.OwnershipControls = de_OwnershipControls(data, context2);
      return contents;
    }, "de_GetBucketOwnershipControlsCommand");
    de_GetBucketPolicyCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output)
      });
      const data = await collectBodyString2(output.body, context2);
      contents.Policy = expectString(data);
      return contents;
    }, "de_GetBucketPolicyCommand");
    de_GetBucketPolicyStatusCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output)
      });
      const data = expectObject(await parseXmlBody(output.body, context2));
      contents.PolicyStatus = de_PolicyStatus(data, context2);
      return contents;
    }, "de_GetBucketPolicyStatusCommand");
    de_GetBucketReplicationCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output)
      });
      const data = expectObject(await parseXmlBody(output.body, context2));
      contents.ReplicationConfiguration = de_ReplicationConfiguration(data, context2);
      return contents;
    }, "de_GetBucketReplicationCommand");
    de_GetBucketRequestPaymentCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output)
      });
      const data = expectNonNull(expectObject(await parseXmlBody(output.body, context2)), "body");
      if (data[_Pa] != null) {
        contents[_Pa] = expectString(data[_Pa]);
      }
      return contents;
    }, "de_GetBucketRequestPaymentCommand");
    de_GetBucketTaggingCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output)
      });
      const data = expectNonNull(expectObject(await parseXmlBody(output.body, context2)), "body");
      if (data.TagSet === "") {
        contents[_TS] = [];
      } else if (data[_TS] != null && data[_TS][_Ta] != null) {
        contents[_TS] = de_TagSet(getArrayIfSingleItem(data[_TS][_Ta]), context2);
      }
      return contents;
    }, "de_GetBucketTaggingCommand");
    de_GetBucketVersioningCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output)
      });
      const data = expectNonNull(expectObject(await parseXmlBody(output.body, context2)), "body");
      if (data[_MDf] != null) {
        contents[_MFAD] = expectString(data[_MDf]);
      }
      if (data[_S] != null) {
        contents[_S] = expectString(data[_S]);
      }
      return contents;
    }, "de_GetBucketVersioningCommand");
    de_GetBucketWebsiteCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output)
      });
      const data = expectNonNull(expectObject(await parseXmlBody(output.body, context2)), "body");
      if (data[_ED] != null) {
        contents[_ED] = de_ErrorDocument(data[_ED], context2);
      }
      if (data[_ID] != null) {
        contents[_ID] = de_IndexDocument(data[_ID], context2);
      }
      if (data[_RART] != null) {
        contents[_RART] = de_RedirectAllRequestsTo(data[_RART], context2);
      }
      if (data.RoutingRules === "") {
        contents[_RRo] = [];
      } else if (data[_RRo] != null && data[_RRo][_RRou] != null) {
        contents[_RRo] = de_RoutingRules(getArrayIfSingleItem(data[_RRo][_RRou]), context2);
      }
      return contents;
    }, "de_GetBucketWebsiteCommand");
    de_GetObjectCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output),
        [_DM]: [() => void 0 !== output.headers[_xadm], () => parseBoolean(output.headers[_xadm])],
        [_AR]: [, output.headers[_ar]],
        [_Exp]: [, output.headers[_xae]],
        [_Re]: [, output.headers[_xar]],
        [_LM]: [() => void 0 !== output.headers[_lm], () => expectNonNull(parseRfc7231DateTime(output.headers[_lm]))],
        [_CLo]: [() => void 0 !== output.headers[_cl_], () => strictParseLong(output.headers[_cl_])],
        [_ETa]: [, output.headers[_eta]],
        [_CCRC]: [, output.headers[_xacc]],
        [_CCRCC]: [, output.headers[_xacc_]],
        [_CSHA]: [, output.headers[_xacs]],
        [_CSHAh]: [, output.headers[_xacs_]],
        [_MM]: [() => void 0 !== output.headers[_xamm], () => strictParseInt32(output.headers[_xamm])],
        [_VI]: [, output.headers[_xavi]],
        [_CC]: [, output.headers[_cc]],
        [_CD]: [, output.headers[_cd]],
        [_CE]: [, output.headers[_ce]],
        [_CL]: [, output.headers[_cl]],
        [_CR]: [, output.headers[_cr]],
        [_CT]: [, output.headers[_ct]],
        [_E]: [() => void 0 !== output.headers[_e2], () => expectNonNull(parseRfc7231DateTime(output.headers[_e2]))],
        [_ES]: [, output.headers[_ex]],
        [_WRL]: [, output.headers[_xawrl]],
        [_SSE]: [, output.headers[_xasse]],
        [_SSECA]: [, output.headers[_xasseca]],
        [_SSECKMD]: [, output.headers[_xasseckm]],
        [_SSEKMSKI]: [, output.headers[_xasseakki]],
        [_BKE]: [() => void 0 !== output.headers[_xassebke], () => parseBoolean(output.headers[_xassebke])],
        [_SC]: [, output.headers[_xasc]],
        [_RC]: [, output.headers[_xarc]],
        [_RS]: [, output.headers[_xars]],
        [_PC]: [() => void 0 !== output.headers[_xampc], () => strictParseInt32(output.headers[_xampc])],
        [_TC]: [() => void 0 !== output.headers[_xatc], () => strictParseInt32(output.headers[_xatc])],
        [_OLM]: [, output.headers[_xaolm]],
        [_OLRUD]: [
          () => void 0 !== output.headers[_xaolrud],
          () => expectNonNull(parseRfc3339DateTimeWithOffset(output.headers[_xaolrud]))
        ],
        [_OLLHS]: [, output.headers[_xaollh]],
        Metadata: [
          ,
          Object.keys(output.headers).filter((header) => header.startsWith("x-amz-meta-")).reduce((acc, header) => {
            acc[header.substring(11)] = output.headers[header];
            return acc;
          }, {})
        ]
      });
      const data = output.body;
      context2.sdkStreamMixin(data);
      contents.Body = data;
      return contents;
    }, "de_GetObjectCommand");
    de_GetObjectAclCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output),
        [_RC]: [, output.headers[_xarc]]
      });
      const data = expectNonNull(expectObject(await parseXmlBody(output.body, context2)), "body");
      if (data.AccessControlList === "") {
        contents[_Gr] = [];
      } else if (data[_ACLc] != null && data[_ACLc][_G] != null) {
        contents[_Gr] = de_Grants(getArrayIfSingleItem(data[_ACLc][_G]), context2);
      }
      if (data[_O] != null) {
        contents[_O] = de_Owner(data[_O], context2);
      }
      return contents;
    }, "de_GetObjectAclCommand");
    de_GetObjectAttributesCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output),
        [_DM]: [() => void 0 !== output.headers[_xadm], () => parseBoolean(output.headers[_xadm])],
        [_LM]: [() => void 0 !== output.headers[_lm], () => expectNonNull(parseRfc7231DateTime(output.headers[_lm]))],
        [_VI]: [, output.headers[_xavi]],
        [_RC]: [, output.headers[_xarc]]
      });
      const data = expectNonNull(expectObject(await parseXmlBody(output.body, context2)), "body");
      if (data[_Ch] != null) {
        contents[_Ch] = de_Checksum(data[_Ch], context2);
      }
      if (data[_ETa] != null) {
        contents[_ETa] = expectString(data[_ETa]);
      }
      if (data[_OP] != null) {
        contents[_OP] = de_GetObjectAttributesParts(data[_OP], context2);
      }
      if (data[_OSb] != null) {
        contents[_OSb] = strictParseLong(data[_OSb]);
      }
      if (data[_SC] != null) {
        contents[_SC] = expectString(data[_SC]);
      }
      return contents;
    }, "de_GetObjectAttributesCommand");
    de_GetObjectLegalHoldCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output)
      });
      const data = expectObject(await parseXmlBody(output.body, context2));
      contents.LegalHold = de_ObjectLockLegalHold(data, context2);
      return contents;
    }, "de_GetObjectLegalHoldCommand");
    de_GetObjectLockConfigurationCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output)
      });
      const data = expectObject(await parseXmlBody(output.body, context2));
      contents.ObjectLockConfiguration = de_ObjectLockConfiguration(data, context2);
      return contents;
    }, "de_GetObjectLockConfigurationCommand");
    de_GetObjectRetentionCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output)
      });
      const data = expectObject(await parseXmlBody(output.body, context2));
      contents.Retention = de_ObjectLockRetention(data, context2);
      return contents;
    }, "de_GetObjectRetentionCommand");
    de_GetObjectTaggingCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output),
        [_VI]: [, output.headers[_xavi]]
      });
      const data = expectNonNull(expectObject(await parseXmlBody(output.body, context2)), "body");
      if (data.TagSet === "") {
        contents[_TS] = [];
      } else if (data[_TS] != null && data[_TS][_Ta] != null) {
        contents[_TS] = de_TagSet(getArrayIfSingleItem(data[_TS][_Ta]), context2);
      }
      return contents;
    }, "de_GetObjectTaggingCommand");
    de_GetObjectTorrentCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output),
        [_RC]: [, output.headers[_xarc]]
      });
      const data = output.body;
      context2.sdkStreamMixin(data);
      contents.Body = data;
      return contents;
    }, "de_GetObjectTorrentCommand");
    de_GetPublicAccessBlockCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output)
      });
      const data = expectObject(await parseXmlBody(output.body, context2));
      contents.PublicAccessBlockConfiguration = de_PublicAccessBlockConfiguration(data, context2);
      return contents;
    }, "de_GetPublicAccessBlockCommand");
    de_HeadBucketCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output),
        [_BLT]: [, output.headers[_xablt]],
        [_BLN]: [, output.headers[_xabln]],
        [_BR]: [, output.headers[_xabr]],
        [_APA]: [() => void 0 !== output.headers[_xaapa], () => parseBoolean(output.headers[_xaapa])]
      });
      await collectBody(output.body, context2);
      return contents;
    }, "de_HeadBucketCommand");
    de_HeadObjectCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output),
        [_DM]: [() => void 0 !== output.headers[_xadm], () => parseBoolean(output.headers[_xadm])],
        [_AR]: [, output.headers[_ar]],
        [_Exp]: [, output.headers[_xae]],
        [_Re]: [, output.headers[_xar]],
        [_AS]: [, output.headers[_xaas]],
        [_LM]: [() => void 0 !== output.headers[_lm], () => expectNonNull(parseRfc7231DateTime(output.headers[_lm]))],
        [_CLo]: [() => void 0 !== output.headers[_cl_], () => strictParseLong(output.headers[_cl_])],
        [_CCRC]: [, output.headers[_xacc]],
        [_CCRCC]: [, output.headers[_xacc_]],
        [_CSHA]: [, output.headers[_xacs]],
        [_CSHAh]: [, output.headers[_xacs_]],
        [_ETa]: [, output.headers[_eta]],
        [_MM]: [() => void 0 !== output.headers[_xamm], () => strictParseInt32(output.headers[_xamm])],
        [_VI]: [, output.headers[_xavi]],
        [_CC]: [, output.headers[_cc]],
        [_CD]: [, output.headers[_cd]],
        [_CE]: [, output.headers[_ce]],
        [_CL]: [, output.headers[_cl]],
        [_CT]: [, output.headers[_ct]],
        [_E]: [() => void 0 !== output.headers[_e2], () => expectNonNull(parseRfc7231DateTime(output.headers[_e2]))],
        [_ES]: [, output.headers[_ex]],
        [_WRL]: [, output.headers[_xawrl]],
        [_SSE]: [, output.headers[_xasse]],
        [_SSECA]: [, output.headers[_xasseca]],
        [_SSECKMD]: [, output.headers[_xasseckm]],
        [_SSEKMSKI]: [, output.headers[_xasseakki]],
        [_BKE]: [() => void 0 !== output.headers[_xassebke], () => parseBoolean(output.headers[_xassebke])],
        [_SC]: [, output.headers[_xasc]],
        [_RC]: [, output.headers[_xarc]],
        [_RS]: [, output.headers[_xars]],
        [_PC]: [() => void 0 !== output.headers[_xampc], () => strictParseInt32(output.headers[_xampc])],
        [_OLM]: [, output.headers[_xaolm]],
        [_OLRUD]: [
          () => void 0 !== output.headers[_xaolrud],
          () => expectNonNull(parseRfc3339DateTimeWithOffset(output.headers[_xaolrud]))
        ],
        [_OLLHS]: [, output.headers[_xaollh]],
        Metadata: [
          ,
          Object.keys(output.headers).filter((header) => header.startsWith("x-amz-meta-")).reduce((acc, header) => {
            acc[header.substring(11)] = output.headers[header];
            return acc;
          }, {})
        ]
      });
      await collectBody(output.body, context2);
      return contents;
    }, "de_HeadObjectCommand");
    de_ListBucketAnalyticsConfigurationsCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output)
      });
      const data = expectNonNull(expectObject(await parseXmlBody(output.body, context2)), "body");
      if (data.AnalyticsConfiguration === "") {
        contents[_ACLn] = [];
      } else if (data[_AC] != null) {
        contents[_ACLn] = de_AnalyticsConfigurationList(getArrayIfSingleItem(data[_AC]), context2);
      }
      if (data[_CTo] != null) {
        contents[_CTo] = expectString(data[_CTo]);
      }
      if (data[_IT] != null) {
        contents[_IT] = parseBoolean(data[_IT]);
      }
      if (data[_NCT] != null) {
        contents[_NCT] = expectString(data[_NCT]);
      }
      return contents;
    }, "de_ListBucketAnalyticsConfigurationsCommand");
    de_ListBucketIntelligentTieringConfigurationsCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output)
      });
      const data = expectNonNull(expectObject(await parseXmlBody(output.body, context2)), "body");
      if (data[_CTo] != null) {
        contents[_CTo] = expectString(data[_CTo]);
      }
      if (data.IntelligentTieringConfiguration === "") {
        contents[_ITCL] = [];
      } else if (data[_ITC] != null) {
        contents[_ITCL] = de_IntelligentTieringConfigurationList(getArrayIfSingleItem(data[_ITC]), context2);
      }
      if (data[_IT] != null) {
        contents[_IT] = parseBoolean(data[_IT]);
      }
      if (data[_NCT] != null) {
        contents[_NCT] = expectString(data[_NCT]);
      }
      return contents;
    }, "de_ListBucketIntelligentTieringConfigurationsCommand");
    de_ListBucketInventoryConfigurationsCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output)
      });
      const data = expectNonNull(expectObject(await parseXmlBody(output.body, context2)), "body");
      if (data[_CTo] != null) {
        contents[_CTo] = expectString(data[_CTo]);
      }
      if (data.InventoryConfiguration === "") {
        contents[_ICL] = [];
      } else if (data[_IC] != null) {
        contents[_ICL] = de_InventoryConfigurationList(getArrayIfSingleItem(data[_IC]), context2);
      }
      if (data[_IT] != null) {
        contents[_IT] = parseBoolean(data[_IT]);
      }
      if (data[_NCT] != null) {
        contents[_NCT] = expectString(data[_NCT]);
      }
      return contents;
    }, "de_ListBucketInventoryConfigurationsCommand");
    de_ListBucketMetricsConfigurationsCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output)
      });
      const data = expectNonNull(expectObject(await parseXmlBody(output.body, context2)), "body");
      if (data[_CTo] != null) {
        contents[_CTo] = expectString(data[_CTo]);
      }
      if (data[_IT] != null) {
        contents[_IT] = parseBoolean(data[_IT]);
      }
      if (data.MetricsConfiguration === "") {
        contents[_MCL] = [];
      } else if (data[_MC] != null) {
        contents[_MCL] = de_MetricsConfigurationList(getArrayIfSingleItem(data[_MC]), context2);
      }
      if (data[_NCT] != null) {
        contents[_NCT] = expectString(data[_NCT]);
      }
      return contents;
    }, "de_ListBucketMetricsConfigurationsCommand");
    de_ListBucketsCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output)
      });
      const data = expectNonNull(expectObject(await parseXmlBody(output.body, context2)), "body");
      if (data.Buckets === "") {
        contents[_Bu] = [];
      } else if (data[_Bu] != null && data[_Bu][_B] != null) {
        contents[_Bu] = de_Buckets(getArrayIfSingleItem(data[_Bu][_B]), context2);
      }
      if (data[_CTo] != null) {
        contents[_CTo] = expectString(data[_CTo]);
      }
      if (data[_O] != null) {
        contents[_O] = de_Owner(data[_O], context2);
      }
      if (data[_P] != null) {
        contents[_P] = expectString(data[_P]);
      }
      return contents;
    }, "de_ListBucketsCommand");
    de_ListDirectoryBucketsCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output)
      });
      const data = expectNonNull(expectObject(await parseXmlBody(output.body, context2)), "body");
      if (data.Buckets === "") {
        contents[_Bu] = [];
      } else if (data[_Bu] != null && data[_Bu][_B] != null) {
        contents[_Bu] = de_Buckets(getArrayIfSingleItem(data[_Bu][_B]), context2);
      }
      if (data[_CTo] != null) {
        contents[_CTo] = expectString(data[_CTo]);
      }
      return contents;
    }, "de_ListDirectoryBucketsCommand");
    de_ListMultipartUploadsCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output),
        [_RC]: [, output.headers[_xarc]]
      });
      const data = expectNonNull(expectObject(await parseXmlBody(output.body, context2)), "body");
      if (data[_B] != null) {
        contents[_B] = expectString(data[_B]);
      }
      if (data.CommonPrefixes === "") {
        contents[_CP] = [];
      } else if (data[_CP] != null) {
        contents[_CP] = de_CommonPrefixList(getArrayIfSingleItem(data[_CP]), context2);
      }
      if (data[_D] != null) {
        contents[_D] = expectString(data[_D]);
      }
      if (data[_ET] != null) {
        contents[_ET] = expectString(data[_ET]);
      }
      if (data[_IT] != null) {
        contents[_IT] = parseBoolean(data[_IT]);
      }
      if (data[_KM] != null) {
        contents[_KM] = expectString(data[_KM]);
      }
      if (data[_MU] != null) {
        contents[_MU] = strictParseInt32(data[_MU]);
      }
      if (data[_NKM] != null) {
        contents[_NKM] = expectString(data[_NKM]);
      }
      if (data[_NUIM] != null) {
        contents[_NUIM] = expectString(data[_NUIM]);
      }
      if (data[_P] != null) {
        contents[_P] = expectString(data[_P]);
      }
      if (data[_UIM] != null) {
        contents[_UIM] = expectString(data[_UIM]);
      }
      if (data.Upload === "") {
        contents[_Up] = [];
      } else if (data[_U] != null) {
        contents[_Up] = de_MultipartUploadList(getArrayIfSingleItem(data[_U]), context2);
      }
      return contents;
    }, "de_ListMultipartUploadsCommand");
    de_ListObjectsCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output),
        [_RC]: [, output.headers[_xarc]]
      });
      const data = expectNonNull(expectObject(await parseXmlBody(output.body, context2)), "body");
      if (data.CommonPrefixes === "") {
        contents[_CP] = [];
      } else if (data[_CP] != null) {
        contents[_CP] = de_CommonPrefixList(getArrayIfSingleItem(data[_CP]), context2);
      }
      if (data.Contents === "") {
        contents[_Co] = [];
      } else if (data[_Co] != null) {
        contents[_Co] = de_ObjectList(getArrayIfSingleItem(data[_Co]), context2);
      }
      if (data[_D] != null) {
        contents[_D] = expectString(data[_D]);
      }
      if (data[_ET] != null) {
        contents[_ET] = expectString(data[_ET]);
      }
      if (data[_IT] != null) {
        contents[_IT] = parseBoolean(data[_IT]);
      }
      if (data[_M] != null) {
        contents[_M] = expectString(data[_M]);
      }
      if (data[_MK] != null) {
        contents[_MK] = strictParseInt32(data[_MK]);
      }
      if (data[_N] != null) {
        contents[_N] = expectString(data[_N]);
      }
      if (data[_NM] != null) {
        contents[_NM] = expectString(data[_NM]);
      }
      if (data[_P] != null) {
        contents[_P] = expectString(data[_P]);
      }
      return contents;
    }, "de_ListObjectsCommand");
    de_ListObjectsV2Command = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output),
        [_RC]: [, output.headers[_xarc]]
      });
      const data = expectNonNull(expectObject(await parseXmlBody(output.body, context2)), "body");
      if (data.CommonPrefixes === "") {
        contents[_CP] = [];
      } else if (data[_CP] != null) {
        contents[_CP] = de_CommonPrefixList(getArrayIfSingleItem(data[_CP]), context2);
      }
      if (data.Contents === "") {
        contents[_Co] = [];
      } else if (data[_Co] != null) {
        contents[_Co] = de_ObjectList(getArrayIfSingleItem(data[_Co]), context2);
      }
      if (data[_CTo] != null) {
        contents[_CTo] = expectString(data[_CTo]);
      }
      if (data[_D] != null) {
        contents[_D] = expectString(data[_D]);
      }
      if (data[_ET] != null) {
        contents[_ET] = expectString(data[_ET]);
      }
      if (data[_IT] != null) {
        contents[_IT] = parseBoolean(data[_IT]);
      }
      if (data[_KC] != null) {
        contents[_KC] = strictParseInt32(data[_KC]);
      }
      if (data[_MK] != null) {
        contents[_MK] = strictParseInt32(data[_MK]);
      }
      if (data[_N] != null) {
        contents[_N] = expectString(data[_N]);
      }
      if (data[_NCT] != null) {
        contents[_NCT] = expectString(data[_NCT]);
      }
      if (data[_P] != null) {
        contents[_P] = expectString(data[_P]);
      }
      if (data[_SA] != null) {
        contents[_SA] = expectString(data[_SA]);
      }
      return contents;
    }, "de_ListObjectsV2Command");
    de_ListObjectVersionsCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output),
        [_RC]: [, output.headers[_xarc]]
      });
      const data = expectNonNull(expectObject(await parseXmlBody(output.body, context2)), "body");
      if (data.CommonPrefixes === "") {
        contents[_CP] = [];
      } else if (data[_CP] != null) {
        contents[_CP] = de_CommonPrefixList(getArrayIfSingleItem(data[_CP]), context2);
      }
      if (data.DeleteMarker === "") {
        contents[_DMe] = [];
      } else if (data[_DM] != null) {
        contents[_DMe] = de_DeleteMarkers(getArrayIfSingleItem(data[_DM]), context2);
      }
      if (data[_D] != null) {
        contents[_D] = expectString(data[_D]);
      }
      if (data[_ET] != null) {
        contents[_ET] = expectString(data[_ET]);
      }
      if (data[_IT] != null) {
        contents[_IT] = parseBoolean(data[_IT]);
      }
      if (data[_KM] != null) {
        contents[_KM] = expectString(data[_KM]);
      }
      if (data[_MK] != null) {
        contents[_MK] = strictParseInt32(data[_MK]);
      }
      if (data[_N] != null) {
        contents[_N] = expectString(data[_N]);
      }
      if (data[_NKM] != null) {
        contents[_NKM] = expectString(data[_NKM]);
      }
      if (data[_NVIM] != null) {
        contents[_NVIM] = expectString(data[_NVIM]);
      }
      if (data[_P] != null) {
        contents[_P] = expectString(data[_P]);
      }
      if (data[_VIM] != null) {
        contents[_VIM] = expectString(data[_VIM]);
      }
      if (data.Version === "") {
        contents[_Ve] = [];
      } else if (data[_V] != null) {
        contents[_Ve] = de_ObjectVersionList(getArrayIfSingleItem(data[_V]), context2);
      }
      return contents;
    }, "de_ListObjectVersionsCommand");
    de_ListPartsCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output),
        [_AD]: [
          () => void 0 !== output.headers[_xaad],
          () => expectNonNull(parseRfc7231DateTime(output.headers[_xaad]))
        ],
        [_ARI]: [, output.headers[_xaari]],
        [_RC]: [, output.headers[_xarc]]
      });
      const data = expectNonNull(expectObject(await parseXmlBody(output.body, context2)), "body");
      if (data[_B] != null) {
        contents[_B] = expectString(data[_B]);
      }
      if (data[_CA] != null) {
        contents[_CA] = expectString(data[_CA]);
      }
      if (data[_In] != null) {
        contents[_In] = de_Initiator(data[_In], context2);
      }
      if (data[_IT] != null) {
        contents[_IT] = parseBoolean(data[_IT]);
      }
      if (data[_K] != null) {
        contents[_K] = expectString(data[_K]);
      }
      if (data[_MP] != null) {
        contents[_MP] = strictParseInt32(data[_MP]);
      }
      if (data[_NPNM] != null) {
        contents[_NPNM] = expectString(data[_NPNM]);
      }
      if (data[_O] != null) {
        contents[_O] = de_Owner(data[_O], context2);
      }
      if (data[_PNM] != null) {
        contents[_PNM] = expectString(data[_PNM]);
      }
      if (data.Part === "") {
        contents[_Part] = [];
      } else if (data[_Par] != null) {
        contents[_Part] = de_Parts(getArrayIfSingleItem(data[_Par]), context2);
      }
      if (data[_SC] != null) {
        contents[_SC] = expectString(data[_SC]);
      }
      if (data[_UI] != null) {
        contents[_UI] = expectString(data[_UI]);
      }
      return contents;
    }, "de_ListPartsCommand");
    de_PutBucketAccelerateConfigurationCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output)
      });
      await collectBody(output.body, context2);
      return contents;
    }, "de_PutBucketAccelerateConfigurationCommand");
    de_PutBucketAclCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output)
      });
      await collectBody(output.body, context2);
      return contents;
    }, "de_PutBucketAclCommand");
    de_PutBucketAnalyticsConfigurationCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output)
      });
      await collectBody(output.body, context2);
      return contents;
    }, "de_PutBucketAnalyticsConfigurationCommand");
    de_PutBucketCorsCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output)
      });
      await collectBody(output.body, context2);
      return contents;
    }, "de_PutBucketCorsCommand");
    de_PutBucketEncryptionCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output)
      });
      await collectBody(output.body, context2);
      return contents;
    }, "de_PutBucketEncryptionCommand");
    de_PutBucketIntelligentTieringConfigurationCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output)
      });
      await collectBody(output.body, context2);
      return contents;
    }, "de_PutBucketIntelligentTieringConfigurationCommand");
    de_PutBucketInventoryConfigurationCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output)
      });
      await collectBody(output.body, context2);
      return contents;
    }, "de_PutBucketInventoryConfigurationCommand");
    de_PutBucketLifecycleConfigurationCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output),
        [_TDMOS]: [, output.headers[_xatdmos]]
      });
      await collectBody(output.body, context2);
      return contents;
    }, "de_PutBucketLifecycleConfigurationCommand");
    de_PutBucketLoggingCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output)
      });
      await collectBody(output.body, context2);
      return contents;
    }, "de_PutBucketLoggingCommand");
    de_PutBucketMetricsConfigurationCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output)
      });
      await collectBody(output.body, context2);
      return contents;
    }, "de_PutBucketMetricsConfigurationCommand");
    de_PutBucketNotificationConfigurationCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output)
      });
      await collectBody(output.body, context2);
      return contents;
    }, "de_PutBucketNotificationConfigurationCommand");
    de_PutBucketOwnershipControlsCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output)
      });
      await collectBody(output.body, context2);
      return contents;
    }, "de_PutBucketOwnershipControlsCommand");
    de_PutBucketPolicyCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output)
      });
      await collectBody(output.body, context2);
      return contents;
    }, "de_PutBucketPolicyCommand");
    de_PutBucketReplicationCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output)
      });
      await collectBody(output.body, context2);
      return contents;
    }, "de_PutBucketReplicationCommand");
    de_PutBucketRequestPaymentCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output)
      });
      await collectBody(output.body, context2);
      return contents;
    }, "de_PutBucketRequestPaymentCommand");
    de_PutBucketTaggingCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output)
      });
      await collectBody(output.body, context2);
      return contents;
    }, "de_PutBucketTaggingCommand");
    de_PutBucketVersioningCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output)
      });
      await collectBody(output.body, context2);
      return contents;
    }, "de_PutBucketVersioningCommand");
    de_PutBucketWebsiteCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output)
      });
      await collectBody(output.body, context2);
      return contents;
    }, "de_PutBucketWebsiteCommand");
    de_PutObjectCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output),
        [_Exp]: [, output.headers[_xae]],
        [_ETa]: [, output.headers[_eta]],
        [_CCRC]: [, output.headers[_xacc]],
        [_CCRCC]: [, output.headers[_xacc_]],
        [_CSHA]: [, output.headers[_xacs]],
        [_CSHAh]: [, output.headers[_xacs_]],
        [_SSE]: [, output.headers[_xasse]],
        [_VI]: [, output.headers[_xavi]],
        [_SSECA]: [, output.headers[_xasseca]],
        [_SSECKMD]: [, output.headers[_xasseckm]],
        [_SSEKMSKI]: [, output.headers[_xasseakki]],
        [_SSEKMSEC]: [, output.headers[_xassec]],
        [_BKE]: [() => void 0 !== output.headers[_xassebke], () => parseBoolean(output.headers[_xassebke])],
        [_Si]: [() => void 0 !== output.headers[_xaos], () => strictParseLong(output.headers[_xaos])],
        [_RC]: [, output.headers[_xarc]]
      });
      await collectBody(output.body, context2);
      return contents;
    }, "de_PutObjectCommand");
    de_PutObjectAclCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output),
        [_RC]: [, output.headers[_xarc]]
      });
      await collectBody(output.body, context2);
      return contents;
    }, "de_PutObjectAclCommand");
    de_PutObjectLegalHoldCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output),
        [_RC]: [, output.headers[_xarc]]
      });
      await collectBody(output.body, context2);
      return contents;
    }, "de_PutObjectLegalHoldCommand");
    de_PutObjectLockConfigurationCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output),
        [_RC]: [, output.headers[_xarc]]
      });
      await collectBody(output.body, context2);
      return contents;
    }, "de_PutObjectLockConfigurationCommand");
    de_PutObjectRetentionCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output),
        [_RC]: [, output.headers[_xarc]]
      });
      await collectBody(output.body, context2);
      return contents;
    }, "de_PutObjectRetentionCommand");
    de_PutObjectTaggingCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output),
        [_VI]: [, output.headers[_xavi]]
      });
      await collectBody(output.body, context2);
      return contents;
    }, "de_PutObjectTaggingCommand");
    de_PutPublicAccessBlockCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output)
      });
      await collectBody(output.body, context2);
      return contents;
    }, "de_PutPublicAccessBlockCommand");
    de_RestoreObjectCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output),
        [_RC]: [, output.headers[_xarc]],
        [_ROP]: [, output.headers[_xarop]]
      });
      await collectBody(output.body, context2);
      return contents;
    }, "de_RestoreObjectCommand");
    de_SelectObjectContentCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output)
      });
      const data = output.body;
      contents.Payload = de_SelectObjectContentEventStream(data, context2);
      return contents;
    }, "de_SelectObjectContentCommand");
    de_UploadPartCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output),
        [_SSE]: [, output.headers[_xasse]],
        [_ETa]: [, output.headers[_eta]],
        [_CCRC]: [, output.headers[_xacc]],
        [_CCRCC]: [, output.headers[_xacc_]],
        [_CSHA]: [, output.headers[_xacs]],
        [_CSHAh]: [, output.headers[_xacs_]],
        [_SSECA]: [, output.headers[_xasseca]],
        [_SSECKMD]: [, output.headers[_xasseckm]],
        [_SSEKMSKI]: [, output.headers[_xasseakki]],
        [_BKE]: [() => void 0 !== output.headers[_xassebke], () => parseBoolean(output.headers[_xassebke])],
        [_RC]: [, output.headers[_xarc]]
      });
      await collectBody(output.body, context2);
      return contents;
    }, "de_UploadPartCommand");
    de_UploadPartCopyCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output),
        [_CSVI]: [, output.headers[_xacsvi]],
        [_SSE]: [, output.headers[_xasse]],
        [_SSECA]: [, output.headers[_xasseca]],
        [_SSECKMD]: [, output.headers[_xasseckm]],
        [_SSEKMSKI]: [, output.headers[_xasseakki]],
        [_BKE]: [() => void 0 !== output.headers[_xassebke], () => parseBoolean(output.headers[_xassebke])],
        [_RC]: [, output.headers[_xarc]]
      });
      const data = expectObject(await parseXmlBody(output.body, context2));
      contents.CopyPartResult = de_CopyPartResult(data, context2);
      return contents;
    }, "de_UploadPartCopyCommand");
    de_WriteGetObjectResponseCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata2(output)
      });
      await collectBody(output.body, context2);
      return contents;
    }, "de_WriteGetObjectResponseCommand");
    de_CommandError = /* @__PURE__ */ __name(async (output, context2) => {
      const parsedOutput = {
        ...output,
        body: await parseXmlErrorBody(output.body, context2)
      };
      const errorCode = loadRestXmlErrorCode(output, parsedOutput.body);
      switch (errorCode) {
        case "NoSuchUpload":
        case "com.amazonaws.s3#NoSuchUpload":
          throw await de_NoSuchUploadRes(parsedOutput, context2);
        case "ObjectNotInActiveTierError":
        case "com.amazonaws.s3#ObjectNotInActiveTierError":
          throw await de_ObjectNotInActiveTierErrorRes(parsedOutput, context2);
        case "BucketAlreadyExists":
        case "com.amazonaws.s3#BucketAlreadyExists":
          throw await de_BucketAlreadyExistsRes(parsedOutput, context2);
        case "BucketAlreadyOwnedByYou":
        case "com.amazonaws.s3#BucketAlreadyOwnedByYou":
          throw await de_BucketAlreadyOwnedByYouRes(parsedOutput, context2);
        case "NoSuchBucket":
        case "com.amazonaws.s3#NoSuchBucket":
          throw await de_NoSuchBucketRes(parsedOutput, context2);
        case "InvalidObjectState":
        case "com.amazonaws.s3#InvalidObjectState":
          throw await de_InvalidObjectStateRes(parsedOutput, context2);
        case "NoSuchKey":
        case "com.amazonaws.s3#NoSuchKey":
          throw await de_NoSuchKeyRes(parsedOutput, context2);
        case "NotFound":
        case "com.amazonaws.s3#NotFound":
          throw await de_NotFoundRes(parsedOutput, context2);
        case "EncryptionTypeMismatch":
        case "com.amazonaws.s3#EncryptionTypeMismatch":
          throw await de_EncryptionTypeMismatchRes(parsedOutput, context2);
        case "InvalidRequest":
        case "com.amazonaws.s3#InvalidRequest":
          throw await de_InvalidRequestRes(parsedOutput, context2);
        case "InvalidWriteOffset":
        case "com.amazonaws.s3#InvalidWriteOffset":
          throw await de_InvalidWriteOffsetRes(parsedOutput, context2);
        case "TooManyParts":
        case "com.amazonaws.s3#TooManyParts":
          throw await de_TooManyPartsRes(parsedOutput, context2);
        case "ObjectAlreadyInActiveTierError":
        case "com.amazonaws.s3#ObjectAlreadyInActiveTierError":
          throw await de_ObjectAlreadyInActiveTierErrorRes(parsedOutput, context2);
        default:
          const parsedBody = parsedOutput.body;
          return throwDefaultError2({
            output,
            parsedBody,
            errorCode
          });
      }
    }, "de_CommandError");
    throwDefaultError2 = withBaseException(S3ServiceException);
    de_BucketAlreadyExistsRes = /* @__PURE__ */ __name(async (parsedOutput, context2) => {
      const contents = map({});
      parsedOutput.body;
      const exception = new BucketAlreadyExists({
        $metadata: deserializeMetadata2(parsedOutput),
        ...contents
      });
      return decorateServiceException(exception, parsedOutput.body);
    }, "de_BucketAlreadyExistsRes");
    de_BucketAlreadyOwnedByYouRes = /* @__PURE__ */ __name(async (parsedOutput, context2) => {
      const contents = map({});
      parsedOutput.body;
      const exception = new BucketAlreadyOwnedByYou({
        $metadata: deserializeMetadata2(parsedOutput),
        ...contents
      });
      return decorateServiceException(exception, parsedOutput.body);
    }, "de_BucketAlreadyOwnedByYouRes");
    de_EncryptionTypeMismatchRes = /* @__PURE__ */ __name(async (parsedOutput, context2) => {
      const contents = map({});
      parsedOutput.body;
      const exception = new EncryptionTypeMismatch({
        $metadata: deserializeMetadata2(parsedOutput),
        ...contents
      });
      return decorateServiceException(exception, parsedOutput.body);
    }, "de_EncryptionTypeMismatchRes");
    de_InvalidObjectStateRes = /* @__PURE__ */ __name(async (parsedOutput, context2) => {
      const contents = map({});
      const data = parsedOutput.body;
      if (data[_AT] != null) {
        contents[_AT] = expectString(data[_AT]);
      }
      if (data[_SC] != null) {
        contents[_SC] = expectString(data[_SC]);
      }
      const exception = new InvalidObjectState({
        $metadata: deserializeMetadata2(parsedOutput),
        ...contents
      });
      return decorateServiceException(exception, parsedOutput.body);
    }, "de_InvalidObjectStateRes");
    de_InvalidRequestRes = /* @__PURE__ */ __name(async (parsedOutput, context2) => {
      const contents = map({});
      parsedOutput.body;
      const exception = new InvalidRequest({
        $metadata: deserializeMetadata2(parsedOutput),
        ...contents
      });
      return decorateServiceException(exception, parsedOutput.body);
    }, "de_InvalidRequestRes");
    de_InvalidWriteOffsetRes = /* @__PURE__ */ __name(async (parsedOutput, context2) => {
      const contents = map({});
      parsedOutput.body;
      const exception = new InvalidWriteOffset({
        $metadata: deserializeMetadata2(parsedOutput),
        ...contents
      });
      return decorateServiceException(exception, parsedOutput.body);
    }, "de_InvalidWriteOffsetRes");
    de_NoSuchBucketRes = /* @__PURE__ */ __name(async (parsedOutput, context2) => {
      const contents = map({});
      parsedOutput.body;
      const exception = new NoSuchBucket({
        $metadata: deserializeMetadata2(parsedOutput),
        ...contents
      });
      return decorateServiceException(exception, parsedOutput.body);
    }, "de_NoSuchBucketRes");
    de_NoSuchKeyRes = /* @__PURE__ */ __name(async (parsedOutput, context2) => {
      const contents = map({});
      parsedOutput.body;
      const exception = new NoSuchKey({
        $metadata: deserializeMetadata2(parsedOutput),
        ...contents
      });
      return decorateServiceException(exception, parsedOutput.body);
    }, "de_NoSuchKeyRes");
    de_NoSuchUploadRes = /* @__PURE__ */ __name(async (parsedOutput, context2) => {
      const contents = map({});
      parsedOutput.body;
      const exception = new NoSuchUpload({
        $metadata: deserializeMetadata2(parsedOutput),
        ...contents
      });
      return decorateServiceException(exception, parsedOutput.body);
    }, "de_NoSuchUploadRes");
    de_NotFoundRes = /* @__PURE__ */ __name(async (parsedOutput, context2) => {
      const contents = map({});
      parsedOutput.body;
      const exception = new NotFound({
        $metadata: deserializeMetadata2(parsedOutput),
        ...contents
      });
      return decorateServiceException(exception, parsedOutput.body);
    }, "de_NotFoundRes");
    de_ObjectAlreadyInActiveTierErrorRes = /* @__PURE__ */ __name(async (parsedOutput, context2) => {
      const contents = map({});
      parsedOutput.body;
      const exception = new ObjectAlreadyInActiveTierError({
        $metadata: deserializeMetadata2(parsedOutput),
        ...contents
      });
      return decorateServiceException(exception, parsedOutput.body);
    }, "de_ObjectAlreadyInActiveTierErrorRes");
    de_ObjectNotInActiveTierErrorRes = /* @__PURE__ */ __name(async (parsedOutput, context2) => {
      const contents = map({});
      parsedOutput.body;
      const exception = new ObjectNotInActiveTierError({
        $metadata: deserializeMetadata2(parsedOutput),
        ...contents
      });
      return decorateServiceException(exception, parsedOutput.body);
    }, "de_ObjectNotInActiveTierErrorRes");
    de_TooManyPartsRes = /* @__PURE__ */ __name(async (parsedOutput, context2) => {
      const contents = map({});
      parsedOutput.body;
      const exception = new TooManyParts({
        $metadata: deserializeMetadata2(parsedOutput),
        ...contents
      });
      return decorateServiceException(exception, parsedOutput.body);
    }, "de_TooManyPartsRes");
    de_SelectObjectContentEventStream = /* @__PURE__ */ __name((output, context2) => {
      return context2.eventStreamMarshaller.deserialize(output, async (event) => {
        if (event["Records"] != null) {
          return {
            Records: await de_RecordsEvent_event(event["Records"], context2)
          };
        }
        if (event["Stats"] != null) {
          return {
            Stats: await de_StatsEvent_event(event["Stats"], context2)
          };
        }
        if (event["Progress"] != null) {
          return {
            Progress: await de_ProgressEvent_event(event["Progress"], context2)
          };
        }
        if (event["Cont"] != null) {
          return {
            Cont: await de_ContinuationEvent_event(event["Cont"], context2)
          };
        }
        if (event["End"] != null) {
          return {
            End: await de_EndEvent_event(event["End"], context2)
          };
        }
        return { $unknown: output };
      });
    }, "de_SelectObjectContentEventStream");
    de_ContinuationEvent_event = /* @__PURE__ */ __name(async (output, context2) => {
      const contents = {};
      const data = await parseXmlBody(output.body, context2);
      Object.assign(contents, de_ContinuationEvent(data, context2));
      return contents;
    }, "de_ContinuationEvent_event");
    de_EndEvent_event = /* @__PURE__ */ __name(async (output, context2) => {
      const contents = {};
      const data = await parseXmlBody(output.body, context2);
      Object.assign(contents, de_EndEvent(data, context2));
      return contents;
    }, "de_EndEvent_event");
    de_ProgressEvent_event = /* @__PURE__ */ __name(async (output, context2) => {
      const contents = {};
      const data = await parseXmlBody(output.body, context2);
      contents.Details = de_Progress(data, context2);
      return contents;
    }, "de_ProgressEvent_event");
    de_RecordsEvent_event = /* @__PURE__ */ __name(async (output, context2) => {
      const contents = {};
      contents.Payload = output.body;
      return contents;
    }, "de_RecordsEvent_event");
    de_StatsEvent_event = /* @__PURE__ */ __name(async (output, context2) => {
      const contents = {};
      const data = await parseXmlBody(output.body, context2);
      contents.Details = de_Stats(data, context2);
      return contents;
    }, "de_StatsEvent_event");
    se_AbortIncompleteMultipartUpload = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_AIMU);
      if (input[_DAI] != null) {
        bn2.c(XmlNode.of(_DAI, String(input[_DAI])).n(_DAI));
      }
      return bn2;
    }, "se_AbortIncompleteMultipartUpload");
    se_AccelerateConfiguration = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_ACc);
      if (input[_S] != null) {
        bn2.c(XmlNode.of(_BAS, input[_S]).n(_S));
      }
      return bn2;
    }, "se_AccelerateConfiguration");
    se_AccessControlPolicy = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_ACP);
      bn2.lc(input, "Grants", "AccessControlList", () => se_Grants(input[_Gr], context2));
      if (input[_O] != null) {
        bn2.c(se_Owner(input[_O], context2).n(_O));
      }
      return bn2;
    }, "se_AccessControlPolicy");
    se_AccessControlTranslation = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_ACT);
      if (input[_O] != null) {
        bn2.c(XmlNode.of(_OOw, input[_O]).n(_O));
      }
      return bn2;
    }, "se_AccessControlTranslation");
    se_AllowedHeaders = /* @__PURE__ */ __name((input, context2) => {
      return input.filter((e10) => e10 != null).map((entry) => {
        const n9 = XmlNode.of(_AH, entry);
        return n9.n(_me);
      });
    }, "se_AllowedHeaders");
    se_AllowedMethods = /* @__PURE__ */ __name((input, context2) => {
      return input.filter((e10) => e10 != null).map((entry) => {
        const n9 = XmlNode.of(_AM, entry);
        return n9.n(_me);
      });
    }, "se_AllowedMethods");
    se_AllowedOrigins = /* @__PURE__ */ __name((input, context2) => {
      return input.filter((e10) => e10 != null).map((entry) => {
        const n9 = XmlNode.of(_AO, entry);
        return n9.n(_me);
      });
    }, "se_AllowedOrigins");
    se_AnalyticsAndOperator = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_AAO);
      bn2.cc(input, _P);
      bn2.l(input, "Tags", "Tag", () => se_TagSet(input[_Tag], context2));
      return bn2;
    }, "se_AnalyticsAndOperator");
    se_AnalyticsConfiguration = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_AC);
      if (input[_I] != null) {
        bn2.c(XmlNode.of(_AI, input[_I]).n(_I));
      }
      if (input[_F] != null) {
        bn2.c(se_AnalyticsFilter(input[_F], context2).n(_F));
      }
      if (input[_SCA] != null) {
        bn2.c(se_StorageClassAnalysis(input[_SCA], context2).n(_SCA));
      }
      return bn2;
    }, "se_AnalyticsConfiguration");
    se_AnalyticsExportDestination = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_AED);
      if (input[_SBD] != null) {
        bn2.c(se_AnalyticsS3BucketDestination(input[_SBD], context2).n(_SBD));
      }
      return bn2;
    }, "se_AnalyticsExportDestination");
    se_AnalyticsFilter = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_AF);
      AnalyticsFilter.visit(input, {
        Prefix: /* @__PURE__ */ __name((value) => {
          if (input[_P] != null) {
            bn2.c(XmlNode.of(_P, value).n(_P));
          }
        }, "Prefix"),
        Tag: /* @__PURE__ */ __name((value) => {
          if (input[_Ta] != null) {
            bn2.c(se_Tag(value, context2).n(_Ta));
          }
        }, "Tag"),
        And: /* @__PURE__ */ __name((value) => {
          if (input[_A] != null) {
            bn2.c(se_AnalyticsAndOperator(value, context2).n(_A));
          }
        }, "And"),
        _: /* @__PURE__ */ __name((name2, value) => {
          if (!(value instanceof XmlNode || value instanceof XmlText)) {
            throw new Error("Unable to serialize unknown union members in XML.");
          }
          bn2.c(new XmlNode(name2).c(value));
        }, "_")
      });
      return bn2;
    }, "se_AnalyticsFilter");
    se_AnalyticsS3BucketDestination = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_ASBD);
      if (input[_Fo] != null) {
        bn2.c(XmlNode.of(_ASEFF, input[_Fo]).n(_Fo));
      }
      if (input[_BAI] != null) {
        bn2.c(XmlNode.of(_AIc, input[_BAI]).n(_BAI));
      }
      if (input[_B] != null) {
        bn2.c(XmlNode.of(_BN, input[_B]).n(_B));
      }
      bn2.cc(input, _P);
      return bn2;
    }, "se_AnalyticsS3BucketDestination");
    se_BucketInfo = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_BI);
      bn2.cc(input, _DR);
      if (input[_Ty] != null) {
        bn2.c(XmlNode.of(_BT, input[_Ty]).n(_Ty));
      }
      return bn2;
    }, "se_BucketInfo");
    se_BucketLifecycleConfiguration = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_BLC);
      bn2.l(input, "Rules", "Rule", () => se_LifecycleRules(input[_Rul], context2));
      return bn2;
    }, "se_BucketLifecycleConfiguration");
    se_BucketLoggingStatus = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_BLS);
      if (input[_LE] != null) {
        bn2.c(se_LoggingEnabled(input[_LE], context2).n(_LE));
      }
      return bn2;
    }, "se_BucketLoggingStatus");
    se_CompletedMultipartUpload = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_CMU);
      bn2.l(input, "Parts", "Part", () => se_CompletedPartList(input[_Part], context2));
      return bn2;
    }, "se_CompletedMultipartUpload");
    se_CompletedPart = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_CPo);
      bn2.cc(input, _ETa);
      bn2.cc(input, _CCRC);
      bn2.cc(input, _CCRCC);
      bn2.cc(input, _CSHA);
      bn2.cc(input, _CSHAh);
      if (input[_PN] != null) {
        bn2.c(XmlNode.of(_PN, String(input[_PN])).n(_PN));
      }
      return bn2;
    }, "se_CompletedPart");
    se_CompletedPartList = /* @__PURE__ */ __name((input, context2) => {
      return input.filter((e10) => e10 != null).map((entry) => {
        const n9 = se_CompletedPart(entry, context2);
        return n9.n(_me);
      });
    }, "se_CompletedPartList");
    se_Condition = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_Con);
      bn2.cc(input, _HECRE);
      bn2.cc(input, _KPE);
      return bn2;
    }, "se_Condition");
    se_CORSConfiguration = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_CORSC);
      bn2.l(input, "CORSRules", "CORSRule", () => se_CORSRules(input[_CORSRu], context2));
      return bn2;
    }, "se_CORSConfiguration");
    se_CORSRule = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_CORSR);
      bn2.cc(input, _ID_);
      bn2.l(input, "AllowedHeaders", "AllowedHeader", () => se_AllowedHeaders(input[_AHl], context2));
      bn2.l(input, "AllowedMethods", "AllowedMethod", () => se_AllowedMethods(input[_AMl], context2));
      bn2.l(input, "AllowedOrigins", "AllowedOrigin", () => se_AllowedOrigins(input[_AOl], context2));
      bn2.l(input, "ExposeHeaders", "ExposeHeader", () => se_ExposeHeaders(input[_EH], context2));
      if (input[_MAS] != null) {
        bn2.c(XmlNode.of(_MAS, String(input[_MAS])).n(_MAS));
      }
      return bn2;
    }, "se_CORSRule");
    se_CORSRules = /* @__PURE__ */ __name((input, context2) => {
      return input.filter((e10) => e10 != null).map((entry) => {
        const n9 = se_CORSRule(entry, context2);
        return n9.n(_me);
      });
    }, "se_CORSRules");
    se_CreateBucketConfiguration = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_CBC);
      if (input[_LC] != null) {
        bn2.c(XmlNode.of(_BLCu, input[_LC]).n(_LC));
      }
      if (input[_L] != null) {
        bn2.c(se_LocationInfo(input[_L], context2).n(_L));
      }
      if (input[_B] != null) {
        bn2.c(se_BucketInfo(input[_B], context2).n(_B));
      }
      return bn2;
    }, "se_CreateBucketConfiguration");
    se_CSVInput = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_CSVIn);
      bn2.cc(input, _FHI);
      bn2.cc(input, _Com);
      bn2.cc(input, _QEC);
      bn2.cc(input, _RD);
      bn2.cc(input, _FD);
      bn2.cc(input, _QCuo);
      if (input[_AQRD] != null) {
        bn2.c(XmlNode.of(_AQRD, String(input[_AQRD])).n(_AQRD));
      }
      return bn2;
    }, "se_CSVInput");
    se_CSVOutput = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_CSVO);
      bn2.cc(input, _QF);
      bn2.cc(input, _QEC);
      bn2.cc(input, _RD);
      bn2.cc(input, _FD);
      bn2.cc(input, _QCuo);
      return bn2;
    }, "se_CSVOutput");
    se_DefaultRetention = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_DRe);
      if (input[_Mo] != null) {
        bn2.c(XmlNode.of(_OLRM, input[_Mo]).n(_Mo));
      }
      if (input[_Da] != null) {
        bn2.c(XmlNode.of(_Da, String(input[_Da])).n(_Da));
      }
      if (input[_Y] != null) {
        bn2.c(XmlNode.of(_Y, String(input[_Y])).n(_Y));
      }
      return bn2;
    }, "se_DefaultRetention");
    se_Delete = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_Del);
      bn2.l(input, "Objects", "Object", () => se_ObjectIdentifierList(input[_Ob], context2));
      if (input[_Q] != null) {
        bn2.c(XmlNode.of(_Q, String(input[_Q])).n(_Q));
      }
      return bn2;
    }, "se_Delete");
    se_DeleteMarkerReplication = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_DMR);
      if (input[_S] != null) {
        bn2.c(XmlNode.of(_DMRS, input[_S]).n(_S));
      }
      return bn2;
    }, "se_DeleteMarkerReplication");
    se_Destination = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_Des);
      if (input[_B] != null) {
        bn2.c(XmlNode.of(_BN, input[_B]).n(_B));
      }
      if (input[_Ac] != null) {
        bn2.c(XmlNode.of(_AIc, input[_Ac]).n(_Ac));
      }
      bn2.cc(input, _SC);
      if (input[_ACT] != null) {
        bn2.c(se_AccessControlTranslation(input[_ACT], context2).n(_ACT));
      }
      if (input[_ECn] != null) {
        bn2.c(se_EncryptionConfiguration(input[_ECn], context2).n(_ECn));
      }
      if (input[_RTe] != null) {
        bn2.c(se_ReplicationTime(input[_RTe], context2).n(_RTe));
      }
      if (input[_Me] != null) {
        bn2.c(se_Metrics(input[_Me], context2).n(_Me));
      }
      return bn2;
    }, "se_Destination");
    se_Encryption = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_En);
      if (input[_ETn] != null) {
        bn2.c(XmlNode.of(_SSE, input[_ETn]).n(_ETn));
      }
      if (input[_KMSKI] != null) {
        bn2.c(XmlNode.of(_SSEKMSKI, input[_KMSKI]).n(_KMSKI));
      }
      bn2.cc(input, _KMSC);
      return bn2;
    }, "se_Encryption");
    se_EncryptionConfiguration = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_ECn);
      bn2.cc(input, _RKKID);
      return bn2;
    }, "se_EncryptionConfiguration");
    se_ErrorDocument = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_ED);
      if (input[_K] != null) {
        bn2.c(XmlNode.of(_OK, input[_K]).n(_K));
      }
      return bn2;
    }, "se_ErrorDocument");
    se_EventBridgeConfiguration = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_EBC);
      return bn2;
    }, "se_EventBridgeConfiguration");
    se_EventList = /* @__PURE__ */ __name((input, context2) => {
      return input.filter((e10) => e10 != null).map((entry) => {
        const n9 = XmlNode.of(_Ev, entry);
        return n9.n(_me);
      });
    }, "se_EventList");
    se_ExistingObjectReplication = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_EOR);
      if (input[_S] != null) {
        bn2.c(XmlNode.of(_EORS, input[_S]).n(_S));
      }
      return bn2;
    }, "se_ExistingObjectReplication");
    se_ExposeHeaders = /* @__PURE__ */ __name((input, context2) => {
      return input.filter((e10) => e10 != null).map((entry) => {
        const n9 = XmlNode.of(_EHx, entry);
        return n9.n(_me);
      });
    }, "se_ExposeHeaders");
    se_FilterRule = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_FR);
      if (input[_N] != null) {
        bn2.c(XmlNode.of(_FRN, input[_N]).n(_N));
      }
      if (input[_Va] != null) {
        bn2.c(XmlNode.of(_FRV, input[_Va]).n(_Va));
      }
      return bn2;
    }, "se_FilterRule");
    se_FilterRuleList = /* @__PURE__ */ __name((input, context2) => {
      return input.filter((e10) => e10 != null).map((entry) => {
        const n9 = se_FilterRule(entry, context2);
        return n9.n(_me);
      });
    }, "se_FilterRuleList");
    se_GlacierJobParameters = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_GJP);
      bn2.cc(input, _Ti);
      return bn2;
    }, "se_GlacierJobParameters");
    se_Grant = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_G);
      if (input[_Gra] != null) {
        const n9 = se_Grantee(input[_Gra], context2).n(_Gra);
        n9.a("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance");
        bn2.c(n9);
      }
      bn2.cc(input, _Pe);
      return bn2;
    }, "se_Grant");
    se_Grantee = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_Gra);
      bn2.cc(input, _DN);
      bn2.cc(input, _EA);
      bn2.cc(input, _ID_);
      bn2.cc(input, _URI);
      bn2.a("xsi:type", input[_Ty]);
      return bn2;
    }, "se_Grantee");
    se_Grants = /* @__PURE__ */ __name((input, context2) => {
      return input.filter((e10) => e10 != null).map((entry) => {
        const n9 = se_Grant(entry, context2);
        return n9.n(_G);
      });
    }, "se_Grants");
    se_IndexDocument = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_ID);
      bn2.cc(input, _Su);
      return bn2;
    }, "se_IndexDocument");
    se_InputSerialization = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_IS);
      if (input[_CSV] != null) {
        bn2.c(se_CSVInput(input[_CSV], context2).n(_CSV));
      }
      bn2.cc(input, _CTom);
      if (input[_JSON] != null) {
        bn2.c(se_JSONInput(input[_JSON], context2).n(_JSON));
      }
      if (input[_Parq] != null) {
        bn2.c(se_ParquetInput(input[_Parq], context2).n(_Parq));
      }
      return bn2;
    }, "se_InputSerialization");
    se_IntelligentTieringAndOperator = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_ITAO);
      bn2.cc(input, _P);
      bn2.l(input, "Tags", "Tag", () => se_TagSet(input[_Tag], context2));
      return bn2;
    }, "se_IntelligentTieringAndOperator");
    se_IntelligentTieringConfiguration = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_ITC);
      if (input[_I] != null) {
        bn2.c(XmlNode.of(_ITI, input[_I]).n(_I));
      }
      if (input[_F] != null) {
        bn2.c(se_IntelligentTieringFilter(input[_F], context2).n(_F));
      }
      if (input[_S] != null) {
        bn2.c(XmlNode.of(_ITS, input[_S]).n(_S));
      }
      bn2.l(input, "Tierings", "Tiering", () => se_TieringList(input[_Tie], context2));
      return bn2;
    }, "se_IntelligentTieringConfiguration");
    se_IntelligentTieringFilter = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_ITF);
      bn2.cc(input, _P);
      if (input[_Ta] != null) {
        bn2.c(se_Tag(input[_Ta], context2).n(_Ta));
      }
      if (input[_A] != null) {
        bn2.c(se_IntelligentTieringAndOperator(input[_A], context2).n(_A));
      }
      return bn2;
    }, "se_IntelligentTieringFilter");
    se_InventoryConfiguration = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_IC);
      if (input[_Des] != null) {
        bn2.c(se_InventoryDestination(input[_Des], context2).n(_Des));
      }
      if (input[_IE] != null) {
        bn2.c(XmlNode.of(_IE, String(input[_IE])).n(_IE));
      }
      if (input[_F] != null) {
        bn2.c(se_InventoryFilter(input[_F], context2).n(_F));
      }
      if (input[_I] != null) {
        bn2.c(XmlNode.of(_II, input[_I]).n(_I));
      }
      if (input[_IOV] != null) {
        bn2.c(XmlNode.of(_IIOV, input[_IOV]).n(_IOV));
      }
      bn2.lc(input, "OptionalFields", "OptionalFields", () => se_InventoryOptionalFields(input[_OF], context2));
      if (input[_Sc] != null) {
        bn2.c(se_InventorySchedule(input[_Sc], context2).n(_Sc));
      }
      return bn2;
    }, "se_InventoryConfiguration");
    se_InventoryDestination = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_IDn);
      if (input[_SBD] != null) {
        bn2.c(se_InventoryS3BucketDestination(input[_SBD], context2).n(_SBD));
      }
      return bn2;
    }, "se_InventoryDestination");
    se_InventoryEncryption = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_IEn);
      if (input[_SSES] != null) {
        bn2.c(se_SSES3(input[_SSES], context2).n(_SS));
      }
      if (input[_SSEKMS] != null) {
        bn2.c(se_SSEKMS(input[_SSEKMS], context2).n(_SK));
      }
      return bn2;
    }, "se_InventoryEncryption");
    se_InventoryFilter = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_IF);
      bn2.cc(input, _P);
      return bn2;
    }, "se_InventoryFilter");
    se_InventoryOptionalFields = /* @__PURE__ */ __name((input, context2) => {
      return input.filter((e10) => e10 != null).map((entry) => {
        const n9 = XmlNode.of(_IOF, entry);
        return n9.n(_Fi);
      });
    }, "se_InventoryOptionalFields");
    se_InventoryS3BucketDestination = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_ISBD);
      bn2.cc(input, _AIc);
      if (input[_B] != null) {
        bn2.c(XmlNode.of(_BN, input[_B]).n(_B));
      }
      if (input[_Fo] != null) {
        bn2.c(XmlNode.of(_IFn, input[_Fo]).n(_Fo));
      }
      bn2.cc(input, _P);
      if (input[_En] != null) {
        bn2.c(se_InventoryEncryption(input[_En], context2).n(_En));
      }
      return bn2;
    }, "se_InventoryS3BucketDestination");
    se_InventorySchedule = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_ISn);
      if (input[_Fr] != null) {
        bn2.c(XmlNode.of(_IFnv, input[_Fr]).n(_Fr));
      }
      return bn2;
    }, "se_InventorySchedule");
    se_JSONInput = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_JSONI);
      if (input[_Ty] != null) {
        bn2.c(XmlNode.of(_JSONT, input[_Ty]).n(_Ty));
      }
      return bn2;
    }, "se_JSONInput");
    se_JSONOutput = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_JSONO);
      bn2.cc(input, _RD);
      return bn2;
    }, "se_JSONOutput");
    se_LambdaFunctionConfiguration = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_LFCa);
      if (input[_I] != null) {
        bn2.c(XmlNode.of(_NI, input[_I]).n(_I));
      }
      if (input[_LFA] != null) {
        bn2.c(XmlNode.of(_LFA, input[_LFA]).n(_CF));
      }
      bn2.l(input, "Events", "Event", () => se_EventList(input[_Eve], context2));
      if (input[_F] != null) {
        bn2.c(se_NotificationConfigurationFilter(input[_F], context2).n(_F));
      }
      return bn2;
    }, "se_LambdaFunctionConfiguration");
    se_LambdaFunctionConfigurationList = /* @__PURE__ */ __name((input, context2) => {
      return input.filter((e10) => e10 != null).map((entry) => {
        const n9 = se_LambdaFunctionConfiguration(entry, context2);
        return n9.n(_me);
      });
    }, "se_LambdaFunctionConfigurationList");
    se_LifecycleExpiration = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_LEi);
      if (input[_Dat] != null) {
        bn2.c(XmlNode.of(_Dat, serializeDateTime(input[_Dat]).toString()).n(_Dat));
      }
      if (input[_Da] != null) {
        bn2.c(XmlNode.of(_Da, String(input[_Da])).n(_Da));
      }
      if (input[_EODM] != null) {
        bn2.c(XmlNode.of(_EODM, String(input[_EODM])).n(_EODM));
      }
      return bn2;
    }, "se_LifecycleExpiration");
    se_LifecycleRule = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_LR);
      if (input[_Exp] != null) {
        bn2.c(se_LifecycleExpiration(input[_Exp], context2).n(_Exp));
      }
      bn2.cc(input, _ID_);
      bn2.cc(input, _P);
      if (input[_F] != null) {
        bn2.c(se_LifecycleRuleFilter(input[_F], context2).n(_F));
      }
      if (input[_S] != null) {
        bn2.c(XmlNode.of(_ESx, input[_S]).n(_S));
      }
      bn2.l(input, "Transitions", "Transition", () => se_TransitionList(input[_Tr], context2));
      bn2.l(input, "NoncurrentVersionTransitions", "NoncurrentVersionTransition", () => se_NoncurrentVersionTransitionList(input[_NVT], context2));
      if (input[_NVE] != null) {
        bn2.c(se_NoncurrentVersionExpiration(input[_NVE], context2).n(_NVE));
      }
      if (input[_AIMU] != null) {
        bn2.c(se_AbortIncompleteMultipartUpload(input[_AIMU], context2).n(_AIMU));
      }
      return bn2;
    }, "se_LifecycleRule");
    se_LifecycleRuleAndOperator = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_LRAO);
      bn2.cc(input, _P);
      bn2.l(input, "Tags", "Tag", () => se_TagSet(input[_Tag], context2));
      if (input[_OSGT] != null) {
        bn2.c(XmlNode.of(_OSGTB, String(input[_OSGT])).n(_OSGT));
      }
      if (input[_OSLT] != null) {
        bn2.c(XmlNode.of(_OSLTB, String(input[_OSLT])).n(_OSLT));
      }
      return bn2;
    }, "se_LifecycleRuleAndOperator");
    se_LifecycleRuleFilter = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_LRF);
      bn2.cc(input, _P);
      if (input[_Ta] != null) {
        bn2.c(se_Tag(input[_Ta], context2).n(_Ta));
      }
      if (input[_OSGT] != null) {
        bn2.c(XmlNode.of(_OSGTB, String(input[_OSGT])).n(_OSGT));
      }
      if (input[_OSLT] != null) {
        bn2.c(XmlNode.of(_OSLTB, String(input[_OSLT])).n(_OSLT));
      }
      if (input[_A] != null) {
        bn2.c(se_LifecycleRuleAndOperator(input[_A], context2).n(_A));
      }
      return bn2;
    }, "se_LifecycleRuleFilter");
    se_LifecycleRules = /* @__PURE__ */ __name((input, context2) => {
      return input.filter((e10) => e10 != null).map((entry) => {
        const n9 = se_LifecycleRule(entry, context2);
        return n9.n(_me);
      });
    }, "se_LifecycleRules");
    se_LocationInfo = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_LI);
      if (input[_Ty] != null) {
        bn2.c(XmlNode.of(_LT, input[_Ty]).n(_Ty));
      }
      if (input[_N] != null) {
        bn2.c(XmlNode.of(_LNAS, input[_N]).n(_N));
      }
      return bn2;
    }, "se_LocationInfo");
    se_LoggingEnabled = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_LE);
      bn2.cc(input, _TB);
      bn2.lc(input, "TargetGrants", "TargetGrants", () => se_TargetGrants(input[_TG], context2));
      bn2.cc(input, _TP);
      if (input[_TOKF] != null) {
        bn2.c(se_TargetObjectKeyFormat(input[_TOKF], context2).n(_TOKF));
      }
      return bn2;
    }, "se_LoggingEnabled");
    se_MetadataEntry = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_ME);
      if (input[_N] != null) {
        bn2.c(XmlNode.of(_MKe, input[_N]).n(_N));
      }
      if (input[_Va] != null) {
        bn2.c(XmlNode.of(_MV, input[_Va]).n(_Va));
      }
      return bn2;
    }, "se_MetadataEntry");
    se_MetadataTableConfiguration = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_MTC);
      if (input[_STD] != null) {
        bn2.c(se_S3TablesDestination(input[_STD], context2).n(_STD));
      }
      return bn2;
    }, "se_MetadataTableConfiguration");
    se_Metrics = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_Me);
      if (input[_S] != null) {
        bn2.c(XmlNode.of(_MS, input[_S]).n(_S));
      }
      if (input[_ETv] != null) {
        bn2.c(se_ReplicationTimeValue(input[_ETv], context2).n(_ETv));
      }
      return bn2;
    }, "se_Metrics");
    se_MetricsAndOperator = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_MAO);
      bn2.cc(input, _P);
      bn2.l(input, "Tags", "Tag", () => se_TagSet(input[_Tag], context2));
      bn2.cc(input, _APAc);
      return bn2;
    }, "se_MetricsAndOperator");
    se_MetricsConfiguration = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_MC);
      if (input[_I] != null) {
        bn2.c(XmlNode.of(_MI, input[_I]).n(_I));
      }
      if (input[_F] != null) {
        bn2.c(se_MetricsFilter(input[_F], context2).n(_F));
      }
      return bn2;
    }, "se_MetricsConfiguration");
    se_MetricsFilter = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_MF);
      MetricsFilter.visit(input, {
        Prefix: /* @__PURE__ */ __name((value) => {
          if (input[_P] != null) {
            bn2.c(XmlNode.of(_P, value).n(_P));
          }
        }, "Prefix"),
        Tag: /* @__PURE__ */ __name((value) => {
          if (input[_Ta] != null) {
            bn2.c(se_Tag(value, context2).n(_Ta));
          }
        }, "Tag"),
        AccessPointArn: /* @__PURE__ */ __name((value) => {
          if (input[_APAc] != null) {
            bn2.c(XmlNode.of(_APAc, value).n(_APAc));
          }
        }, "AccessPointArn"),
        And: /* @__PURE__ */ __name((value) => {
          if (input[_A] != null) {
            bn2.c(se_MetricsAndOperator(value, context2).n(_A));
          }
        }, "And"),
        _: /* @__PURE__ */ __name((name2, value) => {
          if (!(value instanceof XmlNode || value instanceof XmlText)) {
            throw new Error("Unable to serialize unknown union members in XML.");
          }
          bn2.c(new XmlNode(name2).c(value));
        }, "_")
      });
      return bn2;
    }, "se_MetricsFilter");
    se_NoncurrentVersionExpiration = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_NVE);
      if (input[_ND] != null) {
        bn2.c(XmlNode.of(_Da, String(input[_ND])).n(_ND));
      }
      if (input[_NNV] != null) {
        bn2.c(XmlNode.of(_VC, String(input[_NNV])).n(_NNV));
      }
      return bn2;
    }, "se_NoncurrentVersionExpiration");
    se_NoncurrentVersionTransition = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_NVTo);
      if (input[_ND] != null) {
        bn2.c(XmlNode.of(_Da, String(input[_ND])).n(_ND));
      }
      if (input[_SC] != null) {
        bn2.c(XmlNode.of(_TSC, input[_SC]).n(_SC));
      }
      if (input[_NNV] != null) {
        bn2.c(XmlNode.of(_VC, String(input[_NNV])).n(_NNV));
      }
      return bn2;
    }, "se_NoncurrentVersionTransition");
    se_NoncurrentVersionTransitionList = /* @__PURE__ */ __name((input, context2) => {
      return input.filter((e10) => e10 != null).map((entry) => {
        const n9 = se_NoncurrentVersionTransition(entry, context2);
        return n9.n(_me);
      });
    }, "se_NoncurrentVersionTransitionList");
    se_NotificationConfiguration = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_NC);
      bn2.l(input, "TopicConfigurations", "TopicConfiguration", () => se_TopicConfigurationList(input[_TCop], context2));
      bn2.l(input, "QueueConfigurations", "QueueConfiguration", () => se_QueueConfigurationList(input[_QCu], context2));
      bn2.l(input, "LambdaFunctionConfigurations", "CloudFunctionConfiguration", () => se_LambdaFunctionConfigurationList(input[_LFC], context2));
      if (input[_EBC] != null) {
        bn2.c(se_EventBridgeConfiguration(input[_EBC], context2).n(_EBC));
      }
      return bn2;
    }, "se_NotificationConfiguration");
    se_NotificationConfigurationFilter = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_NCF);
      if (input[_K] != null) {
        bn2.c(se_S3KeyFilter(input[_K], context2).n(_SKe));
      }
      return bn2;
    }, "se_NotificationConfigurationFilter");
    se_ObjectIdentifier = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_OI);
      if (input[_K] != null) {
        bn2.c(XmlNode.of(_OK, input[_K]).n(_K));
      }
      if (input[_VI] != null) {
        bn2.c(XmlNode.of(_OVI, input[_VI]).n(_VI));
      }
      bn2.cc(input, _ETa);
      if (input[_LMT] != null) {
        bn2.c(XmlNode.of(_LMT, dateToUtcString(input[_LMT]).toString()).n(_LMT));
      }
      if (input[_Si] != null) {
        bn2.c(XmlNode.of(_Si, String(input[_Si])).n(_Si));
      }
      return bn2;
    }, "se_ObjectIdentifier");
    se_ObjectIdentifierList = /* @__PURE__ */ __name((input, context2) => {
      return input.filter((e10) => e10 != null).map((entry) => {
        const n9 = se_ObjectIdentifier(entry, context2);
        return n9.n(_me);
      });
    }, "se_ObjectIdentifierList");
    se_ObjectLockConfiguration = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_OLC);
      bn2.cc(input, _OLE);
      if (input[_Ru] != null) {
        bn2.c(se_ObjectLockRule(input[_Ru], context2).n(_Ru));
      }
      return bn2;
    }, "se_ObjectLockConfiguration");
    se_ObjectLockLegalHold = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_OLLH);
      if (input[_S] != null) {
        bn2.c(XmlNode.of(_OLLHS, input[_S]).n(_S));
      }
      return bn2;
    }, "se_ObjectLockLegalHold");
    se_ObjectLockRetention = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_OLR);
      if (input[_Mo] != null) {
        bn2.c(XmlNode.of(_OLRM, input[_Mo]).n(_Mo));
      }
      if (input[_RUD] != null) {
        bn2.c(XmlNode.of(_Dat, serializeDateTime(input[_RUD]).toString()).n(_RUD));
      }
      return bn2;
    }, "se_ObjectLockRetention");
    se_ObjectLockRule = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_OLRb);
      if (input[_DRe] != null) {
        bn2.c(se_DefaultRetention(input[_DRe], context2).n(_DRe));
      }
      return bn2;
    }, "se_ObjectLockRule");
    se_OutputLocation = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_OL);
      if (input[_S_] != null) {
        bn2.c(se_S3Location(input[_S_], context2).n(_S_));
      }
      return bn2;
    }, "se_OutputLocation");
    se_OutputSerialization = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_OS);
      if (input[_CSV] != null) {
        bn2.c(se_CSVOutput(input[_CSV], context2).n(_CSV));
      }
      if (input[_JSON] != null) {
        bn2.c(se_JSONOutput(input[_JSON], context2).n(_JSON));
      }
      return bn2;
    }, "se_OutputSerialization");
    se_Owner = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_O);
      bn2.cc(input, _DN);
      bn2.cc(input, _ID_);
      return bn2;
    }, "se_Owner");
    se_OwnershipControls = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_OC);
      bn2.l(input, "Rules", "Rule", () => se_OwnershipControlsRules(input[_Rul], context2));
      return bn2;
    }, "se_OwnershipControls");
    se_OwnershipControlsRule = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_OCR);
      bn2.cc(input, _OO);
      return bn2;
    }, "se_OwnershipControlsRule");
    se_OwnershipControlsRules = /* @__PURE__ */ __name((input, context2) => {
      return input.filter((e10) => e10 != null).map((entry) => {
        const n9 = se_OwnershipControlsRule(entry, context2);
        return n9.n(_me);
      });
    }, "se_OwnershipControlsRules");
    se_ParquetInput = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_PI);
      return bn2;
    }, "se_ParquetInput");
    se_PartitionedPrefix = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_PP);
      bn2.cc(input, _PDS);
      return bn2;
    }, "se_PartitionedPrefix");
    se_PublicAccessBlockConfiguration = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_PABC);
      if (input[_BPA] != null) {
        bn2.c(XmlNode.of(_Se, String(input[_BPA])).n(_BPA));
      }
      if (input[_IPA] != null) {
        bn2.c(XmlNode.of(_Se, String(input[_IPA])).n(_IPA));
      }
      if (input[_BPP] != null) {
        bn2.c(XmlNode.of(_Se, String(input[_BPP])).n(_BPP));
      }
      if (input[_RPB] != null) {
        bn2.c(XmlNode.of(_Se, String(input[_RPB])).n(_RPB));
      }
      return bn2;
    }, "se_PublicAccessBlockConfiguration");
    se_QueueConfiguration = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_QC);
      if (input[_I] != null) {
        bn2.c(XmlNode.of(_NI, input[_I]).n(_I));
      }
      if (input[_QA] != null) {
        bn2.c(XmlNode.of(_QA, input[_QA]).n(_Qu));
      }
      bn2.l(input, "Events", "Event", () => se_EventList(input[_Eve], context2));
      if (input[_F] != null) {
        bn2.c(se_NotificationConfigurationFilter(input[_F], context2).n(_F));
      }
      return bn2;
    }, "se_QueueConfiguration");
    se_QueueConfigurationList = /* @__PURE__ */ __name((input, context2) => {
      return input.filter((e10) => e10 != null).map((entry) => {
        const n9 = se_QueueConfiguration(entry, context2);
        return n9.n(_me);
      });
    }, "se_QueueConfigurationList");
    se_Redirect = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_Red);
      bn2.cc(input, _HN);
      bn2.cc(input, _HRC);
      bn2.cc(input, _Pr);
      bn2.cc(input, _RKPW);
      bn2.cc(input, _RKW);
      return bn2;
    }, "se_Redirect");
    se_RedirectAllRequestsTo = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_RART);
      bn2.cc(input, _HN);
      bn2.cc(input, _Pr);
      return bn2;
    }, "se_RedirectAllRequestsTo");
    se_ReplicaModifications = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_RM);
      if (input[_S] != null) {
        bn2.c(XmlNode.of(_RMS, input[_S]).n(_S));
      }
      return bn2;
    }, "se_ReplicaModifications");
    se_ReplicationConfiguration = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_RCe);
      bn2.cc(input, _Ro);
      bn2.l(input, "Rules", "Rule", () => se_ReplicationRules(input[_Rul], context2));
      return bn2;
    }, "se_ReplicationConfiguration");
    se_ReplicationRule = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_RRe);
      bn2.cc(input, _ID_);
      if (input[_Pri] != null) {
        bn2.c(XmlNode.of(_Pri, String(input[_Pri])).n(_Pri));
      }
      bn2.cc(input, _P);
      if (input[_F] != null) {
        bn2.c(se_ReplicationRuleFilter(input[_F], context2).n(_F));
      }
      if (input[_S] != null) {
        bn2.c(XmlNode.of(_RRS, input[_S]).n(_S));
      }
      if (input[_SSC] != null) {
        bn2.c(se_SourceSelectionCriteria(input[_SSC], context2).n(_SSC));
      }
      if (input[_EOR] != null) {
        bn2.c(se_ExistingObjectReplication(input[_EOR], context2).n(_EOR));
      }
      if (input[_Des] != null) {
        bn2.c(se_Destination(input[_Des], context2).n(_Des));
      }
      if (input[_DMR] != null) {
        bn2.c(se_DeleteMarkerReplication(input[_DMR], context2).n(_DMR));
      }
      return bn2;
    }, "se_ReplicationRule");
    se_ReplicationRuleAndOperator = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_RRAO);
      bn2.cc(input, _P);
      bn2.l(input, "Tags", "Tag", () => se_TagSet(input[_Tag], context2));
      return bn2;
    }, "se_ReplicationRuleAndOperator");
    se_ReplicationRuleFilter = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_RRF);
      bn2.cc(input, _P);
      if (input[_Ta] != null) {
        bn2.c(se_Tag(input[_Ta], context2).n(_Ta));
      }
      if (input[_A] != null) {
        bn2.c(se_ReplicationRuleAndOperator(input[_A], context2).n(_A));
      }
      return bn2;
    }, "se_ReplicationRuleFilter");
    se_ReplicationRules = /* @__PURE__ */ __name((input, context2) => {
      return input.filter((e10) => e10 != null).map((entry) => {
        const n9 = se_ReplicationRule(entry, context2);
        return n9.n(_me);
      });
    }, "se_ReplicationRules");
    se_ReplicationTime = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_RTe);
      if (input[_S] != null) {
        bn2.c(XmlNode.of(_RTS, input[_S]).n(_S));
      }
      if (input[_Tim] != null) {
        bn2.c(se_ReplicationTimeValue(input[_Tim], context2).n(_Tim));
      }
      return bn2;
    }, "se_ReplicationTime");
    se_ReplicationTimeValue = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_RTV);
      if (input[_Mi] != null) {
        bn2.c(XmlNode.of(_Mi, String(input[_Mi])).n(_Mi));
      }
      return bn2;
    }, "se_ReplicationTimeValue");
    se_RequestPaymentConfiguration = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_RPC);
      bn2.cc(input, _Pa);
      return bn2;
    }, "se_RequestPaymentConfiguration");
    se_RequestProgress = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_RPe);
      if (input[_Ena] != null) {
        bn2.c(XmlNode.of(_ERP, String(input[_Ena])).n(_Ena));
      }
      return bn2;
    }, "se_RequestProgress");
    se_RestoreRequest = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_RRes);
      if (input[_Da] != null) {
        bn2.c(XmlNode.of(_Da, String(input[_Da])).n(_Da));
      }
      if (input[_GJP] != null) {
        bn2.c(se_GlacierJobParameters(input[_GJP], context2).n(_GJP));
      }
      if (input[_Ty] != null) {
        bn2.c(XmlNode.of(_RRT, input[_Ty]).n(_Ty));
      }
      bn2.cc(input, _Ti);
      bn2.cc(input, _Desc);
      if (input[_SP] != null) {
        bn2.c(se_SelectParameters(input[_SP], context2).n(_SP));
      }
      if (input[_OL] != null) {
        bn2.c(se_OutputLocation(input[_OL], context2).n(_OL));
      }
      return bn2;
    }, "se_RestoreRequest");
    se_RoutingRule = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_RRou);
      if (input[_Con] != null) {
        bn2.c(se_Condition(input[_Con], context2).n(_Con));
      }
      if (input[_Red] != null) {
        bn2.c(se_Redirect(input[_Red], context2).n(_Red));
      }
      return bn2;
    }, "se_RoutingRule");
    se_RoutingRules = /* @__PURE__ */ __name((input, context2) => {
      return input.filter((e10) => e10 != null).map((entry) => {
        const n9 = se_RoutingRule(entry, context2);
        return n9.n(_RRou);
      });
    }, "se_RoutingRules");
    se_S3KeyFilter = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_SKF);
      bn2.l(input, "FilterRules", "FilterRule", () => se_FilterRuleList(input[_FRi], context2));
      return bn2;
    }, "se_S3KeyFilter");
    se_S3Location = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_SL);
      bn2.cc(input, _BN);
      if (input[_P] != null) {
        bn2.c(XmlNode.of(_LP, input[_P]).n(_P));
      }
      if (input[_En] != null) {
        bn2.c(se_Encryption(input[_En], context2).n(_En));
      }
      if (input[_CACL] != null) {
        bn2.c(XmlNode.of(_OCACL, input[_CACL]).n(_CACL));
      }
      bn2.lc(input, "AccessControlList", "AccessControlList", () => se_Grants(input[_ACLc], context2));
      if (input[_T] != null) {
        bn2.c(se_Tagging(input[_T], context2).n(_T));
      }
      bn2.lc(input, "UserMetadata", "UserMetadata", () => se_UserMetadata(input[_UM], context2));
      bn2.cc(input, _SC);
      return bn2;
    }, "se_S3Location");
    se_S3TablesDestination = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_STD);
      if (input[_TBA] != null) {
        bn2.c(XmlNode.of(_STBA, input[_TBA]).n(_TBA));
      }
      if (input[_TN] != null) {
        bn2.c(XmlNode.of(_STN, input[_TN]).n(_TN));
      }
      return bn2;
    }, "se_S3TablesDestination");
    se_ScanRange = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_SR);
      if (input[_St] != null) {
        bn2.c(XmlNode.of(_St, String(input[_St])).n(_St));
      }
      if (input[_End] != null) {
        bn2.c(XmlNode.of(_End, String(input[_End])).n(_End));
      }
      return bn2;
    }, "se_ScanRange");
    se_SelectParameters = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_SP);
      if (input[_IS] != null) {
        bn2.c(se_InputSerialization(input[_IS], context2).n(_IS));
      }
      bn2.cc(input, _ETx);
      bn2.cc(input, _Ex);
      if (input[_OS] != null) {
        bn2.c(se_OutputSerialization(input[_OS], context2).n(_OS));
      }
      return bn2;
    }, "se_SelectParameters");
    se_ServerSideEncryptionByDefault = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_SSEBD);
      if (input[_SSEA] != null) {
        bn2.c(XmlNode.of(_SSE, input[_SSEA]).n(_SSEA));
      }
      if (input[_KMSMKID] != null) {
        bn2.c(XmlNode.of(_SSEKMSKI, input[_KMSMKID]).n(_KMSMKID));
      }
      return bn2;
    }, "se_ServerSideEncryptionByDefault");
    se_ServerSideEncryptionConfiguration = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_SSEC);
      bn2.l(input, "Rules", "Rule", () => se_ServerSideEncryptionRules(input[_Rul], context2));
      return bn2;
    }, "se_ServerSideEncryptionConfiguration");
    se_ServerSideEncryptionRule = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_SSER);
      if (input[_ASSEBD] != null) {
        bn2.c(se_ServerSideEncryptionByDefault(input[_ASSEBD], context2).n(_ASSEBD));
      }
      if (input[_BKE] != null) {
        bn2.c(XmlNode.of(_BKE, String(input[_BKE])).n(_BKE));
      }
      return bn2;
    }, "se_ServerSideEncryptionRule");
    se_ServerSideEncryptionRules = /* @__PURE__ */ __name((input, context2) => {
      return input.filter((e10) => e10 != null).map((entry) => {
        const n9 = se_ServerSideEncryptionRule(entry, context2);
        return n9.n(_me);
      });
    }, "se_ServerSideEncryptionRules");
    se_SimplePrefix = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_SPi);
      return bn2;
    }, "se_SimplePrefix");
    se_SourceSelectionCriteria = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_SSC);
      if (input[_SKEO] != null) {
        bn2.c(se_SseKmsEncryptedObjects(input[_SKEO], context2).n(_SKEO));
      }
      if (input[_RM] != null) {
        bn2.c(se_ReplicaModifications(input[_RM], context2).n(_RM));
      }
      return bn2;
    }, "se_SourceSelectionCriteria");
    se_SSEKMS = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_SK);
      if (input[_KI] != null) {
        bn2.c(XmlNode.of(_SSEKMSKI, input[_KI]).n(_KI));
      }
      return bn2;
    }, "se_SSEKMS");
    se_SseKmsEncryptedObjects = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_SKEO);
      if (input[_S] != null) {
        bn2.c(XmlNode.of(_SKEOS, input[_S]).n(_S));
      }
      return bn2;
    }, "se_SseKmsEncryptedObjects");
    se_SSES3 = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_SS);
      return bn2;
    }, "se_SSES3");
    se_StorageClassAnalysis = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_SCA);
      if (input[_DE] != null) {
        bn2.c(se_StorageClassAnalysisDataExport(input[_DE], context2).n(_DE));
      }
      return bn2;
    }, "se_StorageClassAnalysis");
    se_StorageClassAnalysisDataExport = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_SCADE);
      if (input[_OSV] != null) {
        bn2.c(XmlNode.of(_SCASV, input[_OSV]).n(_OSV));
      }
      if (input[_Des] != null) {
        bn2.c(se_AnalyticsExportDestination(input[_Des], context2).n(_Des));
      }
      return bn2;
    }, "se_StorageClassAnalysisDataExport");
    se_Tag = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_Ta);
      if (input[_K] != null) {
        bn2.c(XmlNode.of(_OK, input[_K]).n(_K));
      }
      bn2.cc(input, _Va);
      return bn2;
    }, "se_Tag");
    se_Tagging = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_T);
      bn2.lc(input, "TagSet", "TagSet", () => se_TagSet(input[_TS], context2));
      return bn2;
    }, "se_Tagging");
    se_TagSet = /* @__PURE__ */ __name((input, context2) => {
      return input.filter((e10) => e10 != null).map((entry) => {
        const n9 = se_Tag(entry, context2);
        return n9.n(_Ta);
      });
    }, "se_TagSet");
    se_TargetGrant = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_TGa);
      if (input[_Gra] != null) {
        const n9 = se_Grantee(input[_Gra], context2).n(_Gra);
        n9.a("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance");
        bn2.c(n9);
      }
      if (input[_Pe] != null) {
        bn2.c(XmlNode.of(_BLP, input[_Pe]).n(_Pe));
      }
      return bn2;
    }, "se_TargetGrant");
    se_TargetGrants = /* @__PURE__ */ __name((input, context2) => {
      return input.filter((e10) => e10 != null).map((entry) => {
        const n9 = se_TargetGrant(entry, context2);
        return n9.n(_G);
      });
    }, "se_TargetGrants");
    se_TargetObjectKeyFormat = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_TOKF);
      if (input[_SPi] != null) {
        bn2.c(se_SimplePrefix(input[_SPi], context2).n(_SPi));
      }
      if (input[_PP] != null) {
        bn2.c(se_PartitionedPrefix(input[_PP], context2).n(_PP));
      }
      return bn2;
    }, "se_TargetObjectKeyFormat");
    se_Tiering = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_Tier);
      if (input[_Da] != null) {
        bn2.c(XmlNode.of(_ITD, String(input[_Da])).n(_Da));
      }
      if (input[_AT] != null) {
        bn2.c(XmlNode.of(_ITAT, input[_AT]).n(_AT));
      }
      return bn2;
    }, "se_Tiering");
    se_TieringList = /* @__PURE__ */ __name((input, context2) => {
      return input.filter((e10) => e10 != null).map((entry) => {
        const n9 = se_Tiering(entry, context2);
        return n9.n(_me);
      });
    }, "se_TieringList");
    se_TopicConfiguration = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_TCo);
      if (input[_I] != null) {
        bn2.c(XmlNode.of(_NI, input[_I]).n(_I));
      }
      if (input[_TA] != null) {
        bn2.c(XmlNode.of(_TA, input[_TA]).n(_Top));
      }
      bn2.l(input, "Events", "Event", () => se_EventList(input[_Eve], context2));
      if (input[_F] != null) {
        bn2.c(se_NotificationConfigurationFilter(input[_F], context2).n(_F));
      }
      return bn2;
    }, "se_TopicConfiguration");
    se_TopicConfigurationList = /* @__PURE__ */ __name((input, context2) => {
      return input.filter((e10) => e10 != null).map((entry) => {
        const n9 = se_TopicConfiguration(entry, context2);
        return n9.n(_me);
      });
    }, "se_TopicConfigurationList");
    se_Transition = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_Tra);
      if (input[_Dat] != null) {
        bn2.c(XmlNode.of(_Dat, serializeDateTime(input[_Dat]).toString()).n(_Dat));
      }
      if (input[_Da] != null) {
        bn2.c(XmlNode.of(_Da, String(input[_Da])).n(_Da));
      }
      if (input[_SC] != null) {
        bn2.c(XmlNode.of(_TSC, input[_SC]).n(_SC));
      }
      return bn2;
    }, "se_Transition");
    se_TransitionList = /* @__PURE__ */ __name((input, context2) => {
      return input.filter((e10) => e10 != null).map((entry) => {
        const n9 = se_Transition(entry, context2);
        return n9.n(_me);
      });
    }, "se_TransitionList");
    se_UserMetadata = /* @__PURE__ */ __name((input, context2) => {
      return input.filter((e10) => e10 != null).map((entry) => {
        const n9 = se_MetadataEntry(entry, context2);
        return n9.n(_ME);
      });
    }, "se_UserMetadata");
    se_VersioningConfiguration = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_VCe);
      if (input[_MFAD] != null) {
        bn2.c(XmlNode.of(_MFAD, input[_MFAD]).n(_MDf));
      }
      if (input[_S] != null) {
        bn2.c(XmlNode.of(_BVS, input[_S]).n(_S));
      }
      return bn2;
    }, "se_VersioningConfiguration");
    se_WebsiteConfiguration = /* @__PURE__ */ __name((input, context2) => {
      const bn2 = new XmlNode(_WC);
      if (input[_ED] != null) {
        bn2.c(se_ErrorDocument(input[_ED], context2).n(_ED));
      }
      if (input[_ID] != null) {
        bn2.c(se_IndexDocument(input[_ID], context2).n(_ID));
      }
      if (input[_RART] != null) {
        bn2.c(se_RedirectAllRequestsTo(input[_RART], context2).n(_RART));
      }
      bn2.lc(input, "RoutingRules", "RoutingRules", () => se_RoutingRules(input[_RRo], context2));
      return bn2;
    }, "se_WebsiteConfiguration");
    de_AbortIncompleteMultipartUpload = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_DAI] != null) {
        contents[_DAI] = strictParseInt32(output[_DAI]);
      }
      return contents;
    }, "de_AbortIncompleteMultipartUpload");
    de_AccessControlTranslation = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_O] != null) {
        contents[_O] = expectString(output[_O]);
      }
      return contents;
    }, "de_AccessControlTranslation");
    de_AllowedHeaders = /* @__PURE__ */ __name((output, context2) => {
      return (output || []).filter((e10) => e10 != null).map((entry) => {
        return expectString(entry);
      });
    }, "de_AllowedHeaders");
    de_AllowedMethods = /* @__PURE__ */ __name((output, context2) => {
      return (output || []).filter((e10) => e10 != null).map((entry) => {
        return expectString(entry);
      });
    }, "de_AllowedMethods");
    de_AllowedOrigins = /* @__PURE__ */ __name((output, context2) => {
      return (output || []).filter((e10) => e10 != null).map((entry) => {
        return expectString(entry);
      });
    }, "de_AllowedOrigins");
    de_AnalyticsAndOperator = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_P] != null) {
        contents[_P] = expectString(output[_P]);
      }
      if (output.Tag === "") {
        contents[_Tag] = [];
      } else if (output[_Ta] != null) {
        contents[_Tag] = de_TagSet(getArrayIfSingleItem(output[_Ta]), context2);
      }
      return contents;
    }, "de_AnalyticsAndOperator");
    de_AnalyticsConfiguration = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_I] != null) {
        contents[_I] = expectString(output[_I]);
      }
      if (output.Filter === "") ; else if (output[_F] != null) {
        contents[_F] = de_AnalyticsFilter(expectUnion(output[_F]), context2);
      }
      if (output[_SCA] != null) {
        contents[_SCA] = de_StorageClassAnalysis(output[_SCA], context2);
      }
      return contents;
    }, "de_AnalyticsConfiguration");
    de_AnalyticsConfigurationList = /* @__PURE__ */ __name((output, context2) => {
      return (output || []).filter((e10) => e10 != null).map((entry) => {
        return de_AnalyticsConfiguration(entry, context2);
      });
    }, "de_AnalyticsConfigurationList");
    de_AnalyticsExportDestination = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_SBD] != null) {
        contents[_SBD] = de_AnalyticsS3BucketDestination(output[_SBD], context2);
      }
      return contents;
    }, "de_AnalyticsExportDestination");
    de_AnalyticsFilter = /* @__PURE__ */ __name((output, context2) => {
      if (output[_P] != null) {
        return {
          Prefix: expectString(output[_P])
        };
      }
      if (output[_Ta] != null) {
        return {
          Tag: de_Tag(output[_Ta], context2)
        };
      }
      if (output[_A] != null) {
        return {
          And: de_AnalyticsAndOperator(output[_A], context2)
        };
      }
      return { $unknown: Object.entries(output)[0] };
    }, "de_AnalyticsFilter");
    de_AnalyticsS3BucketDestination = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_Fo] != null) {
        contents[_Fo] = expectString(output[_Fo]);
      }
      if (output[_BAI] != null) {
        contents[_BAI] = expectString(output[_BAI]);
      }
      if (output[_B] != null) {
        contents[_B] = expectString(output[_B]);
      }
      if (output[_P] != null) {
        contents[_P] = expectString(output[_P]);
      }
      return contents;
    }, "de_AnalyticsS3BucketDestination");
    de_Bucket = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_N] != null) {
        contents[_N] = expectString(output[_N]);
      }
      if (output[_CDr] != null) {
        contents[_CDr] = expectNonNull(parseRfc3339DateTimeWithOffset(output[_CDr]));
      }
      if (output[_BR] != null) {
        contents[_BR] = expectString(output[_BR]);
      }
      return contents;
    }, "de_Bucket");
    de_Buckets = /* @__PURE__ */ __name((output, context2) => {
      return (output || []).filter((e10) => e10 != null).map((entry) => {
        return de_Bucket(entry, context2);
      });
    }, "de_Buckets");
    de_Checksum = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_CCRC] != null) {
        contents[_CCRC] = expectString(output[_CCRC]);
      }
      if (output[_CCRCC] != null) {
        contents[_CCRCC] = expectString(output[_CCRCC]);
      }
      if (output[_CSHA] != null) {
        contents[_CSHA] = expectString(output[_CSHA]);
      }
      if (output[_CSHAh] != null) {
        contents[_CSHAh] = expectString(output[_CSHAh]);
      }
      return contents;
    }, "de_Checksum");
    de_ChecksumAlgorithmList = /* @__PURE__ */ __name((output, context2) => {
      return (output || []).filter((e10) => e10 != null).map((entry) => {
        return expectString(entry);
      });
    }, "de_ChecksumAlgorithmList");
    de_CommonPrefix = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_P] != null) {
        contents[_P] = expectString(output[_P]);
      }
      return contents;
    }, "de_CommonPrefix");
    de_CommonPrefixList = /* @__PURE__ */ __name((output, context2) => {
      return (output || []).filter((e10) => e10 != null).map((entry) => {
        return de_CommonPrefix(entry, context2);
      });
    }, "de_CommonPrefixList");
    de_Condition = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_HECRE] != null) {
        contents[_HECRE] = expectString(output[_HECRE]);
      }
      if (output[_KPE] != null) {
        contents[_KPE] = expectString(output[_KPE]);
      }
      return contents;
    }, "de_Condition");
    de_ContinuationEvent = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      return contents;
    }, "de_ContinuationEvent");
    de_CopyObjectResult = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_ETa] != null) {
        contents[_ETa] = expectString(output[_ETa]);
      }
      if (output[_LM] != null) {
        contents[_LM] = expectNonNull(parseRfc3339DateTimeWithOffset(output[_LM]));
      }
      if (output[_CCRC] != null) {
        contents[_CCRC] = expectString(output[_CCRC]);
      }
      if (output[_CCRCC] != null) {
        contents[_CCRCC] = expectString(output[_CCRCC]);
      }
      if (output[_CSHA] != null) {
        contents[_CSHA] = expectString(output[_CSHA]);
      }
      if (output[_CSHAh] != null) {
        contents[_CSHAh] = expectString(output[_CSHAh]);
      }
      return contents;
    }, "de_CopyObjectResult");
    de_CopyPartResult = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_ETa] != null) {
        contents[_ETa] = expectString(output[_ETa]);
      }
      if (output[_LM] != null) {
        contents[_LM] = expectNonNull(parseRfc3339DateTimeWithOffset(output[_LM]));
      }
      if (output[_CCRC] != null) {
        contents[_CCRC] = expectString(output[_CCRC]);
      }
      if (output[_CCRCC] != null) {
        contents[_CCRCC] = expectString(output[_CCRCC]);
      }
      if (output[_CSHA] != null) {
        contents[_CSHA] = expectString(output[_CSHA]);
      }
      if (output[_CSHAh] != null) {
        contents[_CSHAh] = expectString(output[_CSHAh]);
      }
      return contents;
    }, "de_CopyPartResult");
    de_CORSRule = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_ID_] != null) {
        contents[_ID_] = expectString(output[_ID_]);
      }
      if (output.AllowedHeader === "") {
        contents[_AHl] = [];
      } else if (output[_AH] != null) {
        contents[_AHl] = de_AllowedHeaders(getArrayIfSingleItem(output[_AH]), context2);
      }
      if (output.AllowedMethod === "") {
        contents[_AMl] = [];
      } else if (output[_AM] != null) {
        contents[_AMl] = de_AllowedMethods(getArrayIfSingleItem(output[_AM]), context2);
      }
      if (output.AllowedOrigin === "") {
        contents[_AOl] = [];
      } else if (output[_AO] != null) {
        contents[_AOl] = de_AllowedOrigins(getArrayIfSingleItem(output[_AO]), context2);
      }
      if (output.ExposeHeader === "") {
        contents[_EH] = [];
      } else if (output[_EHx] != null) {
        contents[_EH] = de_ExposeHeaders(getArrayIfSingleItem(output[_EHx]), context2);
      }
      if (output[_MAS] != null) {
        contents[_MAS] = strictParseInt32(output[_MAS]);
      }
      return contents;
    }, "de_CORSRule");
    de_CORSRules = /* @__PURE__ */ __name((output, context2) => {
      return (output || []).filter((e10) => e10 != null).map((entry) => {
        return de_CORSRule(entry, context2);
      });
    }, "de_CORSRules");
    de_DefaultRetention = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_Mo] != null) {
        contents[_Mo] = expectString(output[_Mo]);
      }
      if (output[_Da] != null) {
        contents[_Da] = strictParseInt32(output[_Da]);
      }
      if (output[_Y] != null) {
        contents[_Y] = strictParseInt32(output[_Y]);
      }
      return contents;
    }, "de_DefaultRetention");
    de_DeletedObject = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_K] != null) {
        contents[_K] = expectString(output[_K]);
      }
      if (output[_VI] != null) {
        contents[_VI] = expectString(output[_VI]);
      }
      if (output[_DM] != null) {
        contents[_DM] = parseBoolean(output[_DM]);
      }
      if (output[_DMVI] != null) {
        contents[_DMVI] = expectString(output[_DMVI]);
      }
      return contents;
    }, "de_DeletedObject");
    de_DeletedObjects = /* @__PURE__ */ __name((output, context2) => {
      return (output || []).filter((e10) => e10 != null).map((entry) => {
        return de_DeletedObject(entry, context2);
      });
    }, "de_DeletedObjects");
    de_DeleteMarkerEntry = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_O] != null) {
        contents[_O] = de_Owner(output[_O], context2);
      }
      if (output[_K] != null) {
        contents[_K] = expectString(output[_K]);
      }
      if (output[_VI] != null) {
        contents[_VI] = expectString(output[_VI]);
      }
      if (output[_IL] != null) {
        contents[_IL] = parseBoolean(output[_IL]);
      }
      if (output[_LM] != null) {
        contents[_LM] = expectNonNull(parseRfc3339DateTimeWithOffset(output[_LM]));
      }
      return contents;
    }, "de_DeleteMarkerEntry");
    de_DeleteMarkerReplication = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_S] != null) {
        contents[_S] = expectString(output[_S]);
      }
      return contents;
    }, "de_DeleteMarkerReplication");
    de_DeleteMarkers = /* @__PURE__ */ __name((output, context2) => {
      return (output || []).filter((e10) => e10 != null).map((entry) => {
        return de_DeleteMarkerEntry(entry, context2);
      });
    }, "de_DeleteMarkers");
    de_Destination = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_B] != null) {
        contents[_B] = expectString(output[_B]);
      }
      if (output[_Ac] != null) {
        contents[_Ac] = expectString(output[_Ac]);
      }
      if (output[_SC] != null) {
        contents[_SC] = expectString(output[_SC]);
      }
      if (output[_ACT] != null) {
        contents[_ACT] = de_AccessControlTranslation(output[_ACT], context2);
      }
      if (output[_ECn] != null) {
        contents[_ECn] = de_EncryptionConfiguration(output[_ECn], context2);
      }
      if (output[_RTe] != null) {
        contents[_RTe] = de_ReplicationTime(output[_RTe], context2);
      }
      if (output[_Me] != null) {
        contents[_Me] = de_Metrics(output[_Me], context2);
      }
      return contents;
    }, "de_Destination");
    de_EncryptionConfiguration = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_RKKID] != null) {
        contents[_RKKID] = expectString(output[_RKKID]);
      }
      return contents;
    }, "de_EncryptionConfiguration");
    de_EndEvent = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      return contents;
    }, "de_EndEvent");
    de__Error = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_K] != null) {
        contents[_K] = expectString(output[_K]);
      }
      if (output[_VI] != null) {
        contents[_VI] = expectString(output[_VI]);
      }
      if (output[_Cod] != null) {
        contents[_Cod] = expectString(output[_Cod]);
      }
      if (output[_Mes] != null) {
        contents[_Mes] = expectString(output[_Mes]);
      }
      return contents;
    }, "de__Error");
    de_ErrorDetails = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_EC] != null) {
        contents[_EC] = expectString(output[_EC]);
      }
      if (output[_EM] != null) {
        contents[_EM] = expectString(output[_EM]);
      }
      return contents;
    }, "de_ErrorDetails");
    de_ErrorDocument = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_K] != null) {
        contents[_K] = expectString(output[_K]);
      }
      return contents;
    }, "de_ErrorDocument");
    de_Errors = /* @__PURE__ */ __name((output, context2) => {
      return (output || []).filter((e10) => e10 != null).map((entry) => {
        return de__Error(entry, context2);
      });
    }, "de_Errors");
    de_EventBridgeConfiguration = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      return contents;
    }, "de_EventBridgeConfiguration");
    de_EventList = /* @__PURE__ */ __name((output, context2) => {
      return (output || []).filter((e10) => e10 != null).map((entry) => {
        return expectString(entry);
      });
    }, "de_EventList");
    de_ExistingObjectReplication = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_S] != null) {
        contents[_S] = expectString(output[_S]);
      }
      return contents;
    }, "de_ExistingObjectReplication");
    de_ExposeHeaders = /* @__PURE__ */ __name((output, context2) => {
      return (output || []).filter((e10) => e10 != null).map((entry) => {
        return expectString(entry);
      });
    }, "de_ExposeHeaders");
    de_FilterRule = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_N] != null) {
        contents[_N] = expectString(output[_N]);
      }
      if (output[_Va] != null) {
        contents[_Va] = expectString(output[_Va]);
      }
      return contents;
    }, "de_FilterRule");
    de_FilterRuleList = /* @__PURE__ */ __name((output, context2) => {
      return (output || []).filter((e10) => e10 != null).map((entry) => {
        return de_FilterRule(entry, context2);
      });
    }, "de_FilterRuleList");
    de_GetBucketMetadataTableConfigurationResult = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_MTCR] != null) {
        contents[_MTCR] = de_MetadataTableConfigurationResult(output[_MTCR], context2);
      }
      if (output[_S] != null) {
        contents[_S] = expectString(output[_S]);
      }
      if (output[_Er] != null) {
        contents[_Er] = de_ErrorDetails(output[_Er], context2);
      }
      return contents;
    }, "de_GetBucketMetadataTableConfigurationResult");
    de_GetObjectAttributesParts = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_PC] != null) {
        contents[_TPC] = strictParseInt32(output[_PC]);
      }
      if (output[_PNM] != null) {
        contents[_PNM] = expectString(output[_PNM]);
      }
      if (output[_NPNM] != null) {
        contents[_NPNM] = expectString(output[_NPNM]);
      }
      if (output[_MP] != null) {
        contents[_MP] = strictParseInt32(output[_MP]);
      }
      if (output[_IT] != null) {
        contents[_IT] = parseBoolean(output[_IT]);
      }
      if (output.Part === "") {
        contents[_Part] = [];
      } else if (output[_Par] != null) {
        contents[_Part] = de_PartsList(getArrayIfSingleItem(output[_Par]), context2);
      }
      return contents;
    }, "de_GetObjectAttributesParts");
    de_Grant = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_Gra] != null) {
        contents[_Gra] = de_Grantee(output[_Gra], context2);
      }
      if (output[_Pe] != null) {
        contents[_Pe] = expectString(output[_Pe]);
      }
      return contents;
    }, "de_Grant");
    de_Grantee = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_DN] != null) {
        contents[_DN] = expectString(output[_DN]);
      }
      if (output[_EA] != null) {
        contents[_EA] = expectString(output[_EA]);
      }
      if (output[_ID_] != null) {
        contents[_ID_] = expectString(output[_ID_]);
      }
      if (output[_URI] != null) {
        contents[_URI] = expectString(output[_URI]);
      }
      if (output[_x] != null) {
        contents[_Ty] = expectString(output[_x]);
      }
      return contents;
    }, "de_Grantee");
    de_Grants = /* @__PURE__ */ __name((output, context2) => {
      return (output || []).filter((e10) => e10 != null).map((entry) => {
        return de_Grant(entry, context2);
      });
    }, "de_Grants");
    de_IndexDocument = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_Su] != null) {
        contents[_Su] = expectString(output[_Su]);
      }
      return contents;
    }, "de_IndexDocument");
    de_Initiator = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_ID_] != null) {
        contents[_ID_] = expectString(output[_ID_]);
      }
      if (output[_DN] != null) {
        contents[_DN] = expectString(output[_DN]);
      }
      return contents;
    }, "de_Initiator");
    de_IntelligentTieringAndOperator = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_P] != null) {
        contents[_P] = expectString(output[_P]);
      }
      if (output.Tag === "") {
        contents[_Tag] = [];
      } else if (output[_Ta] != null) {
        contents[_Tag] = de_TagSet(getArrayIfSingleItem(output[_Ta]), context2);
      }
      return contents;
    }, "de_IntelligentTieringAndOperator");
    de_IntelligentTieringConfiguration = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_I] != null) {
        contents[_I] = expectString(output[_I]);
      }
      if (output[_F] != null) {
        contents[_F] = de_IntelligentTieringFilter(output[_F], context2);
      }
      if (output[_S] != null) {
        contents[_S] = expectString(output[_S]);
      }
      if (output.Tiering === "") {
        contents[_Tie] = [];
      } else if (output[_Tier] != null) {
        contents[_Tie] = de_TieringList(getArrayIfSingleItem(output[_Tier]), context2);
      }
      return contents;
    }, "de_IntelligentTieringConfiguration");
    de_IntelligentTieringConfigurationList = /* @__PURE__ */ __name((output, context2) => {
      return (output || []).filter((e10) => e10 != null).map((entry) => {
        return de_IntelligentTieringConfiguration(entry, context2);
      });
    }, "de_IntelligentTieringConfigurationList");
    de_IntelligentTieringFilter = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_P] != null) {
        contents[_P] = expectString(output[_P]);
      }
      if (output[_Ta] != null) {
        contents[_Ta] = de_Tag(output[_Ta], context2);
      }
      if (output[_A] != null) {
        contents[_A] = de_IntelligentTieringAndOperator(output[_A], context2);
      }
      return contents;
    }, "de_IntelligentTieringFilter");
    de_InventoryConfiguration = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_Des] != null) {
        contents[_Des] = de_InventoryDestination(output[_Des], context2);
      }
      if (output[_IE] != null) {
        contents[_IE] = parseBoolean(output[_IE]);
      }
      if (output[_F] != null) {
        contents[_F] = de_InventoryFilter(output[_F], context2);
      }
      if (output[_I] != null) {
        contents[_I] = expectString(output[_I]);
      }
      if (output[_IOV] != null) {
        contents[_IOV] = expectString(output[_IOV]);
      }
      if (output.OptionalFields === "") {
        contents[_OF] = [];
      } else if (output[_OF] != null && output[_OF][_Fi] != null) {
        contents[_OF] = de_InventoryOptionalFields(getArrayIfSingleItem(output[_OF][_Fi]), context2);
      }
      if (output[_Sc] != null) {
        contents[_Sc] = de_InventorySchedule(output[_Sc], context2);
      }
      return contents;
    }, "de_InventoryConfiguration");
    de_InventoryConfigurationList = /* @__PURE__ */ __name((output, context2) => {
      return (output || []).filter((e10) => e10 != null).map((entry) => {
        return de_InventoryConfiguration(entry, context2);
      });
    }, "de_InventoryConfigurationList");
    de_InventoryDestination = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_SBD] != null) {
        contents[_SBD] = de_InventoryS3BucketDestination(output[_SBD], context2);
      }
      return contents;
    }, "de_InventoryDestination");
    de_InventoryEncryption = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_SS] != null) {
        contents[_SSES] = de_SSES3(output[_SS], context2);
      }
      if (output[_SK] != null) {
        contents[_SSEKMS] = de_SSEKMS(output[_SK], context2);
      }
      return contents;
    }, "de_InventoryEncryption");
    de_InventoryFilter = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_P] != null) {
        contents[_P] = expectString(output[_P]);
      }
      return contents;
    }, "de_InventoryFilter");
    de_InventoryOptionalFields = /* @__PURE__ */ __name((output, context2) => {
      return (output || []).filter((e10) => e10 != null).map((entry) => {
        return expectString(entry);
      });
    }, "de_InventoryOptionalFields");
    de_InventoryS3BucketDestination = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_AIc] != null) {
        contents[_AIc] = expectString(output[_AIc]);
      }
      if (output[_B] != null) {
        contents[_B] = expectString(output[_B]);
      }
      if (output[_Fo] != null) {
        contents[_Fo] = expectString(output[_Fo]);
      }
      if (output[_P] != null) {
        contents[_P] = expectString(output[_P]);
      }
      if (output[_En] != null) {
        contents[_En] = de_InventoryEncryption(output[_En], context2);
      }
      return contents;
    }, "de_InventoryS3BucketDestination");
    de_InventorySchedule = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_Fr] != null) {
        contents[_Fr] = expectString(output[_Fr]);
      }
      return contents;
    }, "de_InventorySchedule");
    de_LambdaFunctionConfiguration = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_I] != null) {
        contents[_I] = expectString(output[_I]);
      }
      if (output[_CF] != null) {
        contents[_LFA] = expectString(output[_CF]);
      }
      if (output.Event === "") {
        contents[_Eve] = [];
      } else if (output[_Ev] != null) {
        contents[_Eve] = de_EventList(getArrayIfSingleItem(output[_Ev]), context2);
      }
      if (output[_F] != null) {
        contents[_F] = de_NotificationConfigurationFilter(output[_F], context2);
      }
      return contents;
    }, "de_LambdaFunctionConfiguration");
    de_LambdaFunctionConfigurationList = /* @__PURE__ */ __name((output, context2) => {
      return (output || []).filter((e10) => e10 != null).map((entry) => {
        return de_LambdaFunctionConfiguration(entry, context2);
      });
    }, "de_LambdaFunctionConfigurationList");
    de_LifecycleExpiration = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_Dat] != null) {
        contents[_Dat] = expectNonNull(parseRfc3339DateTimeWithOffset(output[_Dat]));
      }
      if (output[_Da] != null) {
        contents[_Da] = strictParseInt32(output[_Da]);
      }
      if (output[_EODM] != null) {
        contents[_EODM] = parseBoolean(output[_EODM]);
      }
      return contents;
    }, "de_LifecycleExpiration");
    de_LifecycleRule = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_Exp] != null) {
        contents[_Exp] = de_LifecycleExpiration(output[_Exp], context2);
      }
      if (output[_ID_] != null) {
        contents[_ID_] = expectString(output[_ID_]);
      }
      if (output[_P] != null) {
        contents[_P] = expectString(output[_P]);
      }
      if (output[_F] != null) {
        contents[_F] = de_LifecycleRuleFilter(output[_F], context2);
      }
      if (output[_S] != null) {
        contents[_S] = expectString(output[_S]);
      }
      if (output.Transition === "") {
        contents[_Tr] = [];
      } else if (output[_Tra] != null) {
        contents[_Tr] = de_TransitionList(getArrayIfSingleItem(output[_Tra]), context2);
      }
      if (output.NoncurrentVersionTransition === "") {
        contents[_NVT] = [];
      } else if (output[_NVTo] != null) {
        contents[_NVT] = de_NoncurrentVersionTransitionList(getArrayIfSingleItem(output[_NVTo]), context2);
      }
      if (output[_NVE] != null) {
        contents[_NVE] = de_NoncurrentVersionExpiration(output[_NVE], context2);
      }
      if (output[_AIMU] != null) {
        contents[_AIMU] = de_AbortIncompleteMultipartUpload(output[_AIMU], context2);
      }
      return contents;
    }, "de_LifecycleRule");
    de_LifecycleRuleAndOperator = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_P] != null) {
        contents[_P] = expectString(output[_P]);
      }
      if (output.Tag === "") {
        contents[_Tag] = [];
      } else if (output[_Ta] != null) {
        contents[_Tag] = de_TagSet(getArrayIfSingleItem(output[_Ta]), context2);
      }
      if (output[_OSGT] != null) {
        contents[_OSGT] = strictParseLong(output[_OSGT]);
      }
      if (output[_OSLT] != null) {
        contents[_OSLT] = strictParseLong(output[_OSLT]);
      }
      return contents;
    }, "de_LifecycleRuleAndOperator");
    de_LifecycleRuleFilter = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_P] != null) {
        contents[_P] = expectString(output[_P]);
      }
      if (output[_Ta] != null) {
        contents[_Ta] = de_Tag(output[_Ta], context2);
      }
      if (output[_OSGT] != null) {
        contents[_OSGT] = strictParseLong(output[_OSGT]);
      }
      if (output[_OSLT] != null) {
        contents[_OSLT] = strictParseLong(output[_OSLT]);
      }
      if (output[_A] != null) {
        contents[_A] = de_LifecycleRuleAndOperator(output[_A], context2);
      }
      return contents;
    }, "de_LifecycleRuleFilter");
    de_LifecycleRules = /* @__PURE__ */ __name((output, context2) => {
      return (output || []).filter((e10) => e10 != null).map((entry) => {
        return de_LifecycleRule(entry, context2);
      });
    }, "de_LifecycleRules");
    de_LoggingEnabled = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_TB] != null) {
        contents[_TB] = expectString(output[_TB]);
      }
      if (output.TargetGrants === "") {
        contents[_TG] = [];
      } else if (output[_TG] != null && output[_TG][_G] != null) {
        contents[_TG] = de_TargetGrants(getArrayIfSingleItem(output[_TG][_G]), context2);
      }
      if (output[_TP] != null) {
        contents[_TP] = expectString(output[_TP]);
      }
      if (output[_TOKF] != null) {
        contents[_TOKF] = de_TargetObjectKeyFormat(output[_TOKF], context2);
      }
      return contents;
    }, "de_LoggingEnabled");
    de_MetadataTableConfigurationResult = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_STDR] != null) {
        contents[_STDR] = de_S3TablesDestinationResult(output[_STDR], context2);
      }
      return contents;
    }, "de_MetadataTableConfigurationResult");
    de_Metrics = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_S] != null) {
        contents[_S] = expectString(output[_S]);
      }
      if (output[_ETv] != null) {
        contents[_ETv] = de_ReplicationTimeValue(output[_ETv], context2);
      }
      return contents;
    }, "de_Metrics");
    de_MetricsAndOperator = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_P] != null) {
        contents[_P] = expectString(output[_P]);
      }
      if (output.Tag === "") {
        contents[_Tag] = [];
      } else if (output[_Ta] != null) {
        contents[_Tag] = de_TagSet(getArrayIfSingleItem(output[_Ta]), context2);
      }
      if (output[_APAc] != null) {
        contents[_APAc] = expectString(output[_APAc]);
      }
      return contents;
    }, "de_MetricsAndOperator");
    de_MetricsConfiguration = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_I] != null) {
        contents[_I] = expectString(output[_I]);
      }
      if (output.Filter === "") ; else if (output[_F] != null) {
        contents[_F] = de_MetricsFilter(expectUnion(output[_F]), context2);
      }
      return contents;
    }, "de_MetricsConfiguration");
    de_MetricsConfigurationList = /* @__PURE__ */ __name((output, context2) => {
      return (output || []).filter((e10) => e10 != null).map((entry) => {
        return de_MetricsConfiguration(entry, context2);
      });
    }, "de_MetricsConfigurationList");
    de_MetricsFilter = /* @__PURE__ */ __name((output, context2) => {
      if (output[_P] != null) {
        return {
          Prefix: expectString(output[_P])
        };
      }
      if (output[_Ta] != null) {
        return {
          Tag: de_Tag(output[_Ta], context2)
        };
      }
      if (output[_APAc] != null) {
        return {
          AccessPointArn: expectString(output[_APAc])
        };
      }
      if (output[_A] != null) {
        return {
          And: de_MetricsAndOperator(output[_A], context2)
        };
      }
      return { $unknown: Object.entries(output)[0] };
    }, "de_MetricsFilter");
    de_MultipartUpload = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_UI] != null) {
        contents[_UI] = expectString(output[_UI]);
      }
      if (output[_K] != null) {
        contents[_K] = expectString(output[_K]);
      }
      if (output[_Ini] != null) {
        contents[_Ini] = expectNonNull(parseRfc3339DateTimeWithOffset(output[_Ini]));
      }
      if (output[_SC] != null) {
        contents[_SC] = expectString(output[_SC]);
      }
      if (output[_O] != null) {
        contents[_O] = de_Owner(output[_O], context2);
      }
      if (output[_In] != null) {
        contents[_In] = de_Initiator(output[_In], context2);
      }
      if (output[_CA] != null) {
        contents[_CA] = expectString(output[_CA]);
      }
      return contents;
    }, "de_MultipartUpload");
    de_MultipartUploadList = /* @__PURE__ */ __name((output, context2) => {
      return (output || []).filter((e10) => e10 != null).map((entry) => {
        return de_MultipartUpload(entry, context2);
      });
    }, "de_MultipartUploadList");
    de_NoncurrentVersionExpiration = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_ND] != null) {
        contents[_ND] = strictParseInt32(output[_ND]);
      }
      if (output[_NNV] != null) {
        contents[_NNV] = strictParseInt32(output[_NNV]);
      }
      return contents;
    }, "de_NoncurrentVersionExpiration");
    de_NoncurrentVersionTransition = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_ND] != null) {
        contents[_ND] = strictParseInt32(output[_ND]);
      }
      if (output[_SC] != null) {
        contents[_SC] = expectString(output[_SC]);
      }
      if (output[_NNV] != null) {
        contents[_NNV] = strictParseInt32(output[_NNV]);
      }
      return contents;
    }, "de_NoncurrentVersionTransition");
    de_NoncurrentVersionTransitionList = /* @__PURE__ */ __name((output, context2) => {
      return (output || []).filter((e10) => e10 != null).map((entry) => {
        return de_NoncurrentVersionTransition(entry, context2);
      });
    }, "de_NoncurrentVersionTransitionList");
    de_NotificationConfigurationFilter = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_SKe] != null) {
        contents[_K] = de_S3KeyFilter(output[_SKe], context2);
      }
      return contents;
    }, "de_NotificationConfigurationFilter");
    de__Object = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_K] != null) {
        contents[_K] = expectString(output[_K]);
      }
      if (output[_LM] != null) {
        contents[_LM] = expectNonNull(parseRfc3339DateTimeWithOffset(output[_LM]));
      }
      if (output[_ETa] != null) {
        contents[_ETa] = expectString(output[_ETa]);
      }
      if (output.ChecksumAlgorithm === "") {
        contents[_CA] = [];
      } else if (output[_CA] != null) {
        contents[_CA] = de_ChecksumAlgorithmList(getArrayIfSingleItem(output[_CA]), context2);
      }
      if (output[_Si] != null) {
        contents[_Si] = strictParseLong(output[_Si]);
      }
      if (output[_SC] != null) {
        contents[_SC] = expectString(output[_SC]);
      }
      if (output[_O] != null) {
        contents[_O] = de_Owner(output[_O], context2);
      }
      if (output[_RSe] != null) {
        contents[_RSe] = de_RestoreStatus(output[_RSe], context2);
      }
      return contents;
    }, "de__Object");
    de_ObjectList = /* @__PURE__ */ __name((output, context2) => {
      return (output || []).filter((e10) => e10 != null).map((entry) => {
        return de__Object(entry, context2);
      });
    }, "de_ObjectList");
    de_ObjectLockConfiguration = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_OLE] != null) {
        contents[_OLE] = expectString(output[_OLE]);
      }
      if (output[_Ru] != null) {
        contents[_Ru] = de_ObjectLockRule(output[_Ru], context2);
      }
      return contents;
    }, "de_ObjectLockConfiguration");
    de_ObjectLockLegalHold = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_S] != null) {
        contents[_S] = expectString(output[_S]);
      }
      return contents;
    }, "de_ObjectLockLegalHold");
    de_ObjectLockRetention = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_Mo] != null) {
        contents[_Mo] = expectString(output[_Mo]);
      }
      if (output[_RUD] != null) {
        contents[_RUD] = expectNonNull(parseRfc3339DateTimeWithOffset(output[_RUD]));
      }
      return contents;
    }, "de_ObjectLockRetention");
    de_ObjectLockRule = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_DRe] != null) {
        contents[_DRe] = de_DefaultRetention(output[_DRe], context2);
      }
      return contents;
    }, "de_ObjectLockRule");
    de_ObjectPart = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_PN] != null) {
        contents[_PN] = strictParseInt32(output[_PN]);
      }
      if (output[_Si] != null) {
        contents[_Si] = strictParseLong(output[_Si]);
      }
      if (output[_CCRC] != null) {
        contents[_CCRC] = expectString(output[_CCRC]);
      }
      if (output[_CCRCC] != null) {
        contents[_CCRCC] = expectString(output[_CCRCC]);
      }
      if (output[_CSHA] != null) {
        contents[_CSHA] = expectString(output[_CSHA]);
      }
      if (output[_CSHAh] != null) {
        contents[_CSHAh] = expectString(output[_CSHAh]);
      }
      return contents;
    }, "de_ObjectPart");
    de_ObjectVersion = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_ETa] != null) {
        contents[_ETa] = expectString(output[_ETa]);
      }
      if (output.ChecksumAlgorithm === "") {
        contents[_CA] = [];
      } else if (output[_CA] != null) {
        contents[_CA] = de_ChecksumAlgorithmList(getArrayIfSingleItem(output[_CA]), context2);
      }
      if (output[_Si] != null) {
        contents[_Si] = strictParseLong(output[_Si]);
      }
      if (output[_SC] != null) {
        contents[_SC] = expectString(output[_SC]);
      }
      if (output[_K] != null) {
        contents[_K] = expectString(output[_K]);
      }
      if (output[_VI] != null) {
        contents[_VI] = expectString(output[_VI]);
      }
      if (output[_IL] != null) {
        contents[_IL] = parseBoolean(output[_IL]);
      }
      if (output[_LM] != null) {
        contents[_LM] = expectNonNull(parseRfc3339DateTimeWithOffset(output[_LM]));
      }
      if (output[_O] != null) {
        contents[_O] = de_Owner(output[_O], context2);
      }
      if (output[_RSe] != null) {
        contents[_RSe] = de_RestoreStatus(output[_RSe], context2);
      }
      return contents;
    }, "de_ObjectVersion");
    de_ObjectVersionList = /* @__PURE__ */ __name((output, context2) => {
      return (output || []).filter((e10) => e10 != null).map((entry) => {
        return de_ObjectVersion(entry, context2);
      });
    }, "de_ObjectVersionList");
    de_Owner = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_DN] != null) {
        contents[_DN] = expectString(output[_DN]);
      }
      if (output[_ID_] != null) {
        contents[_ID_] = expectString(output[_ID_]);
      }
      return contents;
    }, "de_Owner");
    de_OwnershipControls = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output.Rule === "") {
        contents[_Rul] = [];
      } else if (output[_Ru] != null) {
        contents[_Rul] = de_OwnershipControlsRules(getArrayIfSingleItem(output[_Ru]), context2);
      }
      return contents;
    }, "de_OwnershipControls");
    de_OwnershipControlsRule = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_OO] != null) {
        contents[_OO] = expectString(output[_OO]);
      }
      return contents;
    }, "de_OwnershipControlsRule");
    de_OwnershipControlsRules = /* @__PURE__ */ __name((output, context2) => {
      return (output || []).filter((e10) => e10 != null).map((entry) => {
        return de_OwnershipControlsRule(entry, context2);
      });
    }, "de_OwnershipControlsRules");
    de_Part = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_PN] != null) {
        contents[_PN] = strictParseInt32(output[_PN]);
      }
      if (output[_LM] != null) {
        contents[_LM] = expectNonNull(parseRfc3339DateTimeWithOffset(output[_LM]));
      }
      if (output[_ETa] != null) {
        contents[_ETa] = expectString(output[_ETa]);
      }
      if (output[_Si] != null) {
        contents[_Si] = strictParseLong(output[_Si]);
      }
      if (output[_CCRC] != null) {
        contents[_CCRC] = expectString(output[_CCRC]);
      }
      if (output[_CCRCC] != null) {
        contents[_CCRCC] = expectString(output[_CCRCC]);
      }
      if (output[_CSHA] != null) {
        contents[_CSHA] = expectString(output[_CSHA]);
      }
      if (output[_CSHAh] != null) {
        contents[_CSHAh] = expectString(output[_CSHAh]);
      }
      return contents;
    }, "de_Part");
    de_PartitionedPrefix = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_PDS] != null) {
        contents[_PDS] = expectString(output[_PDS]);
      }
      return contents;
    }, "de_PartitionedPrefix");
    de_Parts = /* @__PURE__ */ __name((output, context2) => {
      return (output || []).filter((e10) => e10 != null).map((entry) => {
        return de_Part(entry, context2);
      });
    }, "de_Parts");
    de_PartsList = /* @__PURE__ */ __name((output, context2) => {
      return (output || []).filter((e10) => e10 != null).map((entry) => {
        return de_ObjectPart(entry, context2);
      });
    }, "de_PartsList");
    de_PolicyStatus = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_IP] != null) {
        contents[_IP] = parseBoolean(output[_IP]);
      }
      return contents;
    }, "de_PolicyStatus");
    de_Progress = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_BS] != null) {
        contents[_BS] = strictParseLong(output[_BS]);
      }
      if (output[_BP] != null) {
        contents[_BP] = strictParseLong(output[_BP]);
      }
      if (output[_BRy] != null) {
        contents[_BRy] = strictParseLong(output[_BRy]);
      }
      return contents;
    }, "de_Progress");
    de_PublicAccessBlockConfiguration = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_BPA] != null) {
        contents[_BPA] = parseBoolean(output[_BPA]);
      }
      if (output[_IPA] != null) {
        contents[_IPA] = parseBoolean(output[_IPA]);
      }
      if (output[_BPP] != null) {
        contents[_BPP] = parseBoolean(output[_BPP]);
      }
      if (output[_RPB] != null) {
        contents[_RPB] = parseBoolean(output[_RPB]);
      }
      return contents;
    }, "de_PublicAccessBlockConfiguration");
    de_QueueConfiguration = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_I] != null) {
        contents[_I] = expectString(output[_I]);
      }
      if (output[_Qu] != null) {
        contents[_QA] = expectString(output[_Qu]);
      }
      if (output.Event === "") {
        contents[_Eve] = [];
      } else if (output[_Ev] != null) {
        contents[_Eve] = de_EventList(getArrayIfSingleItem(output[_Ev]), context2);
      }
      if (output[_F] != null) {
        contents[_F] = de_NotificationConfigurationFilter(output[_F], context2);
      }
      return contents;
    }, "de_QueueConfiguration");
    de_QueueConfigurationList = /* @__PURE__ */ __name((output, context2) => {
      return (output || []).filter((e10) => e10 != null).map((entry) => {
        return de_QueueConfiguration(entry, context2);
      });
    }, "de_QueueConfigurationList");
    de_Redirect = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_HN] != null) {
        contents[_HN] = expectString(output[_HN]);
      }
      if (output[_HRC] != null) {
        contents[_HRC] = expectString(output[_HRC]);
      }
      if (output[_Pr] != null) {
        contents[_Pr] = expectString(output[_Pr]);
      }
      if (output[_RKPW] != null) {
        contents[_RKPW] = expectString(output[_RKPW]);
      }
      if (output[_RKW] != null) {
        contents[_RKW] = expectString(output[_RKW]);
      }
      return contents;
    }, "de_Redirect");
    de_RedirectAllRequestsTo = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_HN] != null) {
        contents[_HN] = expectString(output[_HN]);
      }
      if (output[_Pr] != null) {
        contents[_Pr] = expectString(output[_Pr]);
      }
      return contents;
    }, "de_RedirectAllRequestsTo");
    de_ReplicaModifications = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_S] != null) {
        contents[_S] = expectString(output[_S]);
      }
      return contents;
    }, "de_ReplicaModifications");
    de_ReplicationConfiguration = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_Ro] != null) {
        contents[_Ro] = expectString(output[_Ro]);
      }
      if (output.Rule === "") {
        contents[_Rul] = [];
      } else if (output[_Ru] != null) {
        contents[_Rul] = de_ReplicationRules(getArrayIfSingleItem(output[_Ru]), context2);
      }
      return contents;
    }, "de_ReplicationConfiguration");
    de_ReplicationRule = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_ID_] != null) {
        contents[_ID_] = expectString(output[_ID_]);
      }
      if (output[_Pri] != null) {
        contents[_Pri] = strictParseInt32(output[_Pri]);
      }
      if (output[_P] != null) {
        contents[_P] = expectString(output[_P]);
      }
      if (output[_F] != null) {
        contents[_F] = de_ReplicationRuleFilter(output[_F], context2);
      }
      if (output[_S] != null) {
        contents[_S] = expectString(output[_S]);
      }
      if (output[_SSC] != null) {
        contents[_SSC] = de_SourceSelectionCriteria(output[_SSC], context2);
      }
      if (output[_EOR] != null) {
        contents[_EOR] = de_ExistingObjectReplication(output[_EOR], context2);
      }
      if (output[_Des] != null) {
        contents[_Des] = de_Destination(output[_Des], context2);
      }
      if (output[_DMR] != null) {
        contents[_DMR] = de_DeleteMarkerReplication(output[_DMR], context2);
      }
      return contents;
    }, "de_ReplicationRule");
    de_ReplicationRuleAndOperator = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_P] != null) {
        contents[_P] = expectString(output[_P]);
      }
      if (output.Tag === "") {
        contents[_Tag] = [];
      } else if (output[_Ta] != null) {
        contents[_Tag] = de_TagSet(getArrayIfSingleItem(output[_Ta]), context2);
      }
      return contents;
    }, "de_ReplicationRuleAndOperator");
    de_ReplicationRuleFilter = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_P] != null) {
        contents[_P] = expectString(output[_P]);
      }
      if (output[_Ta] != null) {
        contents[_Ta] = de_Tag(output[_Ta], context2);
      }
      if (output[_A] != null) {
        contents[_A] = de_ReplicationRuleAndOperator(output[_A], context2);
      }
      return contents;
    }, "de_ReplicationRuleFilter");
    de_ReplicationRules = /* @__PURE__ */ __name((output, context2) => {
      return (output || []).filter((e10) => e10 != null).map((entry) => {
        return de_ReplicationRule(entry, context2);
      });
    }, "de_ReplicationRules");
    de_ReplicationTime = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_S] != null) {
        contents[_S] = expectString(output[_S]);
      }
      if (output[_Tim] != null) {
        contents[_Tim] = de_ReplicationTimeValue(output[_Tim], context2);
      }
      return contents;
    }, "de_ReplicationTime");
    de_ReplicationTimeValue = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_Mi] != null) {
        contents[_Mi] = strictParseInt32(output[_Mi]);
      }
      return contents;
    }, "de_ReplicationTimeValue");
    de_RestoreStatus = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_IRIP] != null) {
        contents[_IRIP] = parseBoolean(output[_IRIP]);
      }
      if (output[_RED] != null) {
        contents[_RED] = expectNonNull(parseRfc3339DateTimeWithOffset(output[_RED]));
      }
      return contents;
    }, "de_RestoreStatus");
    de_RoutingRule = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_Con] != null) {
        contents[_Con] = de_Condition(output[_Con], context2);
      }
      if (output[_Red] != null) {
        contents[_Red] = de_Redirect(output[_Red], context2);
      }
      return contents;
    }, "de_RoutingRule");
    de_RoutingRules = /* @__PURE__ */ __name((output, context2) => {
      return (output || []).filter((e10) => e10 != null).map((entry) => {
        return de_RoutingRule(entry, context2);
      });
    }, "de_RoutingRules");
    de_S3KeyFilter = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output.FilterRule === "") {
        contents[_FRi] = [];
      } else if (output[_FR] != null) {
        contents[_FRi] = de_FilterRuleList(getArrayIfSingleItem(output[_FR]), context2);
      }
      return contents;
    }, "de_S3KeyFilter");
    de_S3TablesDestinationResult = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_TBA] != null) {
        contents[_TBA] = expectString(output[_TBA]);
      }
      if (output[_TN] != null) {
        contents[_TN] = expectString(output[_TN]);
      }
      if (output[_TAa] != null) {
        contents[_TAa] = expectString(output[_TAa]);
      }
      if (output[_TNa] != null) {
        contents[_TNa] = expectString(output[_TNa]);
      }
      return contents;
    }, "de_S3TablesDestinationResult");
    de_ServerSideEncryptionByDefault = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_SSEA] != null) {
        contents[_SSEA] = expectString(output[_SSEA]);
      }
      if (output[_KMSMKID] != null) {
        contents[_KMSMKID] = expectString(output[_KMSMKID]);
      }
      return contents;
    }, "de_ServerSideEncryptionByDefault");
    de_ServerSideEncryptionConfiguration = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output.Rule === "") {
        contents[_Rul] = [];
      } else if (output[_Ru] != null) {
        contents[_Rul] = de_ServerSideEncryptionRules(getArrayIfSingleItem(output[_Ru]), context2);
      }
      return contents;
    }, "de_ServerSideEncryptionConfiguration");
    de_ServerSideEncryptionRule = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_ASSEBD] != null) {
        contents[_ASSEBD] = de_ServerSideEncryptionByDefault(output[_ASSEBD], context2);
      }
      if (output[_BKE] != null) {
        contents[_BKE] = parseBoolean(output[_BKE]);
      }
      return contents;
    }, "de_ServerSideEncryptionRule");
    de_ServerSideEncryptionRules = /* @__PURE__ */ __name((output, context2) => {
      return (output || []).filter((e10) => e10 != null).map((entry) => {
        return de_ServerSideEncryptionRule(entry, context2);
      });
    }, "de_ServerSideEncryptionRules");
    de_SessionCredentials = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_AKI] != null) {
        contents[_AKI] = expectString(output[_AKI]);
      }
      if (output[_SAK] != null) {
        contents[_SAK] = expectString(output[_SAK]);
      }
      if (output[_ST] != null) {
        contents[_ST] = expectString(output[_ST]);
      }
      if (output[_Exp] != null) {
        contents[_Exp] = expectNonNull(parseRfc3339DateTimeWithOffset(output[_Exp]));
      }
      return contents;
    }, "de_SessionCredentials");
    de_SimplePrefix = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      return contents;
    }, "de_SimplePrefix");
    de_SourceSelectionCriteria = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_SKEO] != null) {
        contents[_SKEO] = de_SseKmsEncryptedObjects(output[_SKEO], context2);
      }
      if (output[_RM] != null) {
        contents[_RM] = de_ReplicaModifications(output[_RM], context2);
      }
      return contents;
    }, "de_SourceSelectionCriteria");
    de_SSEKMS = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_KI] != null) {
        contents[_KI] = expectString(output[_KI]);
      }
      return contents;
    }, "de_SSEKMS");
    de_SseKmsEncryptedObjects = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_S] != null) {
        contents[_S] = expectString(output[_S]);
      }
      return contents;
    }, "de_SseKmsEncryptedObjects");
    de_SSES3 = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      return contents;
    }, "de_SSES3");
    de_Stats = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_BS] != null) {
        contents[_BS] = strictParseLong(output[_BS]);
      }
      if (output[_BP] != null) {
        contents[_BP] = strictParseLong(output[_BP]);
      }
      if (output[_BRy] != null) {
        contents[_BRy] = strictParseLong(output[_BRy]);
      }
      return contents;
    }, "de_Stats");
    de_StorageClassAnalysis = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_DE] != null) {
        contents[_DE] = de_StorageClassAnalysisDataExport(output[_DE], context2);
      }
      return contents;
    }, "de_StorageClassAnalysis");
    de_StorageClassAnalysisDataExport = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_OSV] != null) {
        contents[_OSV] = expectString(output[_OSV]);
      }
      if (output[_Des] != null) {
        contents[_Des] = de_AnalyticsExportDestination(output[_Des], context2);
      }
      return contents;
    }, "de_StorageClassAnalysisDataExport");
    de_Tag = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_K] != null) {
        contents[_K] = expectString(output[_K]);
      }
      if (output[_Va] != null) {
        contents[_Va] = expectString(output[_Va]);
      }
      return contents;
    }, "de_Tag");
    de_TagSet = /* @__PURE__ */ __name((output, context2) => {
      return (output || []).filter((e10) => e10 != null).map((entry) => {
        return de_Tag(entry, context2);
      });
    }, "de_TagSet");
    de_TargetGrant = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_Gra] != null) {
        contents[_Gra] = de_Grantee(output[_Gra], context2);
      }
      if (output[_Pe] != null) {
        contents[_Pe] = expectString(output[_Pe]);
      }
      return contents;
    }, "de_TargetGrant");
    de_TargetGrants = /* @__PURE__ */ __name((output, context2) => {
      return (output || []).filter((e10) => e10 != null).map((entry) => {
        return de_TargetGrant(entry, context2);
      });
    }, "de_TargetGrants");
    de_TargetObjectKeyFormat = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_SPi] != null) {
        contents[_SPi] = de_SimplePrefix(output[_SPi], context2);
      }
      if (output[_PP] != null) {
        contents[_PP] = de_PartitionedPrefix(output[_PP], context2);
      }
      return contents;
    }, "de_TargetObjectKeyFormat");
    de_Tiering = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_Da] != null) {
        contents[_Da] = strictParseInt32(output[_Da]);
      }
      if (output[_AT] != null) {
        contents[_AT] = expectString(output[_AT]);
      }
      return contents;
    }, "de_Tiering");
    de_TieringList = /* @__PURE__ */ __name((output, context2) => {
      return (output || []).filter((e10) => e10 != null).map((entry) => {
        return de_Tiering(entry, context2);
      });
    }, "de_TieringList");
    de_TopicConfiguration = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_I] != null) {
        contents[_I] = expectString(output[_I]);
      }
      if (output[_Top] != null) {
        contents[_TA] = expectString(output[_Top]);
      }
      if (output.Event === "") {
        contents[_Eve] = [];
      } else if (output[_Ev] != null) {
        contents[_Eve] = de_EventList(getArrayIfSingleItem(output[_Ev]), context2);
      }
      if (output[_F] != null) {
        contents[_F] = de_NotificationConfigurationFilter(output[_F], context2);
      }
      return contents;
    }, "de_TopicConfiguration");
    de_TopicConfigurationList = /* @__PURE__ */ __name((output, context2) => {
      return (output || []).filter((e10) => e10 != null).map((entry) => {
        return de_TopicConfiguration(entry, context2);
      });
    }, "de_TopicConfigurationList");
    de_Transition = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_Dat] != null) {
        contents[_Dat] = expectNonNull(parseRfc3339DateTimeWithOffset(output[_Dat]));
      }
      if (output[_Da] != null) {
        contents[_Da] = strictParseInt32(output[_Da]);
      }
      if (output[_SC] != null) {
        contents[_SC] = expectString(output[_SC]);
      }
      return contents;
    }, "de_Transition");
    de_TransitionList = /* @__PURE__ */ __name((output, context2) => {
      return (output || []).filter((e10) => e10 != null).map((entry) => {
        return de_Transition(entry, context2);
      });
    }, "de_TransitionList");
    deserializeMetadata2 = /* @__PURE__ */ __name((output) => ({
      httpStatusCode: output.statusCode,
      requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
      extendedRequestId: output.headers["x-amz-id-2"],
      cfId: output.headers["x-amz-cf-id"]
    }), "deserializeMetadata");
    collectBodyString2 = /* @__PURE__ */ __name((streamBody, context2) => collectBody(streamBody, context2).then((body) => context2.utf8Encoder(body)), "collectBodyString");
    _A = "And";
    _AAO = "AnalyticsAndOperator";
    _AC = "AnalyticsConfiguration";
    _ACL = "ACL";
    _ACLc = "AccessControlList";
    _ACLn = "AnalyticsConfigurationList";
    _ACP = "AccessControlPolicy";
    _ACT = "AccessControlTranslation";
    _ACc = "AccelerateConfiguration";
    _AD = "AbortDate";
    _AED = "AnalyticsExportDestination";
    _AF = "AnalyticsFilter";
    _AH = "AllowedHeader";
    _AHl = "AllowedHeaders";
    _AI = "AnalyticsId";
    _AIMU = "AbortIncompleteMultipartUpload";
    _AIc = "AccountId";
    _AKI = "AccessKeyId";
    _AM = "AllowedMethod";
    _AMl = "AllowedMethods";
    _AO = "AllowedOrigin";
    _AOl = "AllowedOrigins";
    _APA = "AccessPointAlias";
    _APAc = "AccessPointArn";
    _AQRD = "AllowQuotedRecordDelimiter";
    _AR = "AcceptRanges";
    _ARI = "AbortRuleId";
    _AS = "ArchiveStatus";
    _ASBD = "AnalyticsS3BucketDestination";
    _ASEFF = "AnalyticsS3ExportFileFormat";
    _ASSEBD = "ApplyServerSideEncryptionByDefault";
    _AT = "AccessTier";
    _Ac = "Account";
    _B = "Bucket";
    _BAI = "BucketAccountId";
    _BAS = "BucketAccelerateStatus";
    _BGR = "BypassGovernanceRetention";
    _BI = "BucketInfo";
    _BKE = "BucketKeyEnabled";
    _BLC = "BucketLifecycleConfiguration";
    _BLCu = "BucketLocationConstraint";
    _BLN = "BucketLocationName";
    _BLP = "BucketLogsPermission";
    _BLS = "BucketLoggingStatus";
    _BLT = "BucketLocationType";
    _BN = "BucketName";
    _BP = "BytesProcessed";
    _BPA = "BlockPublicAcls";
    _BPP = "BlockPublicPolicy";
    _BR = "BucketRegion";
    _BRy = "BytesReturned";
    _BS = "BytesScanned";
    _BT = "BucketType";
    _BVS = "BucketVersioningStatus";
    _Bu = "Buckets";
    _C = "Credentials";
    _CA = "ChecksumAlgorithm";
    _CACL = "CannedACL";
    _CBC = "CreateBucketConfiguration";
    _CC = "CacheControl";
    _CCRC = "ChecksumCRC32";
    _CCRCC = "ChecksumCRC32C";
    _CD = "ContentDisposition";
    _CDr = "CreationDate";
    _CE = "ContentEncoding";
    _CF = "CloudFunction";
    _CFC = "CloudFunctionConfiguration";
    _CL = "ContentLanguage";
    _CLo = "ContentLength";
    _CM = "ChecksumMode";
    _CMD = "ContentMD5";
    _CMU = "CompletedMultipartUpload";
    _CORSC = "CORSConfiguration";
    _CORSR = "CORSRule";
    _CORSRu = "CORSRules";
    _CP = "CommonPrefixes";
    _CPo = "CompletedPart";
    _CR = "ContentRange";
    _CRSBA = "ConfirmRemoveSelfBucketAccess";
    _CS = "CopySource";
    _CSHA = "ChecksumSHA1";
    _CSHAh = "ChecksumSHA256";
    _CSIM = "CopySourceIfMatch";
    _CSIMS = "CopySourceIfModifiedSince";
    _CSINM = "CopySourceIfNoneMatch";
    _CSIUS = "CopySourceIfUnmodifiedSince";
    _CSR = "CopySourceRange";
    _CSSSECA = "CopySourceSSECustomerAlgorithm";
    _CSSSECK = "CopySourceSSECustomerKey";
    _CSSSECKMD = "CopySourceSSECustomerKeyMD5";
    _CSV = "CSV";
    _CSVI = "CopySourceVersionId";
    _CSVIn = "CSVInput";
    _CSVO = "CSVOutput";
    _CT = "ContentType";
    _CTo = "ContinuationToken";
    _CTom = "CompressionType";
    _Ch = "Checksum";
    _Co = "Contents";
    _Cod = "Code";
    _Com = "Comments";
    _Con = "Condition";
    _D = "Delimiter";
    _DAI = "DaysAfterInitiation";
    _DE = "DataExport";
    _DM = "DeleteMarker";
    _DMR = "DeleteMarkerReplication";
    _DMRS = "DeleteMarkerReplicationStatus";
    _DMVI = "DeleteMarkerVersionId";
    _DMe = "DeleteMarkers";
    _DN = "DisplayName";
    _DR = "DataRedundancy";
    _DRe = "DefaultRetention";
    _Da = "Days";
    _Dat = "Date";
    _De = "Deleted";
    _Del = "Delete";
    _Des = "Destination";
    _Desc = "Description";
    _E = "Expires";
    _EA = "EmailAddress";
    _EBC = "EventBridgeConfiguration";
    _EBO = "ExpectedBucketOwner";
    _EC = "ErrorCode";
    _ECn = "EncryptionConfiguration";
    _ED = "ErrorDocument";
    _EH = "ExposeHeaders";
    _EHx = "ExposeHeader";
    _EM = "ErrorMessage";
    _EODM = "ExpiredObjectDeleteMarker";
    _EOR = "ExistingObjectReplication";
    _EORS = "ExistingObjectReplicationStatus";
    _ERP = "EnableRequestProgress";
    _ES = "ExpiresString";
    _ESBO = "ExpectedSourceBucketOwner";
    _ESx = "ExpirationStatus";
    _ET = "EncodingType";
    _ETa = "ETag";
    _ETn = "EncryptionType";
    _ETv = "EventThreshold";
    _ETx = "ExpressionType";
    _En = "Encryption";
    _Ena = "Enabled";
    _End = "End";
    _Er = "Error";
    _Err = "Errors";
    _Ev = "Event";
    _Eve = "Events";
    _Ex = "Expression";
    _Exp = "Expiration";
    _F = "Filter";
    _FD = "FieldDelimiter";
    _FHI = "FileHeaderInfo";
    _FO = "FetchOwner";
    _FR = "FilterRule";
    _FRN = "FilterRuleName";
    _FRV = "FilterRuleValue";
    _FRi = "FilterRules";
    _Fi = "Field";
    _Fo = "Format";
    _Fr = "Frequency";
    _G = "Grant";
    _GFC = "GrantFullControl";
    _GJP = "GlacierJobParameters";
    _GR = "GrantRead";
    _GRACP = "GrantReadACP";
    _GW = "GrantWrite";
    _GWACP = "GrantWriteACP";
    _Gr = "Grants";
    _Gra = "Grantee";
    _HECRE = "HttpErrorCodeReturnedEquals";
    _HN = "HostName";
    _HRC = "HttpRedirectCode";
    _I = "Id";
    _IC = "InventoryConfiguration";
    _ICL = "InventoryConfigurationList";
    _ID = "IndexDocument";
    _ID_ = "ID";
    _IDn = "InventoryDestination";
    _IE = "IsEnabled";
    _IEn = "InventoryEncryption";
    _IF = "InventoryFilter";
    _IFn = "InventoryFormat";
    _IFnv = "InventoryFrequency";
    _II = "InventoryId";
    _IIOV = "InventoryIncludedObjectVersions";
    _IL = "IsLatest";
    _IM = "IfMatch";
    _IMIT = "IfMatchInitiatedTime";
    _IMLMT = "IfMatchLastModifiedTime";
    _IMS = "IfMatchSize";
    _IMSf = "IfModifiedSince";
    _INM = "IfNoneMatch";
    _IOF = "InventoryOptionalField";
    _IOV = "IncludedObjectVersions";
    _IP = "IsPublic";
    _IPA = "IgnorePublicAcls";
    _IRIP = "IsRestoreInProgress";
    _IS = "InputSerialization";
    _ISBD = "InventoryS3BucketDestination";
    _ISn = "InventorySchedule";
    _IT = "IsTruncated";
    _ITAO = "IntelligentTieringAndOperator";
    _ITAT = "IntelligentTieringAccessTier";
    _ITC = "IntelligentTieringConfiguration";
    _ITCL = "IntelligentTieringConfigurationList";
    _ITD = "IntelligentTieringDays";
    _ITF = "IntelligentTieringFilter";
    _ITI = "IntelligentTieringId";
    _ITS = "IntelligentTieringStatus";
    _IUS = "IfUnmodifiedSince";
    _In = "Initiator";
    _Ini = "Initiated";
    _JSON = "JSON";
    _JSONI = "JSONInput";
    _JSONO = "JSONOutput";
    _JSONT = "JSONType";
    _K = "Key";
    _KC = "KeyCount";
    _KI = "KeyId";
    _KM = "KeyMarker";
    _KMSC = "KMSContext";
    _KMSKI = "KMSKeyId";
    _KMSMKID = "KMSMasterKeyID";
    _KPE = "KeyPrefixEquals";
    _L = "Location";
    _LC = "LocationConstraint";
    _LE = "LoggingEnabled";
    _LEi = "LifecycleExpiration";
    _LFA = "LambdaFunctionArn";
    _LFC = "LambdaFunctionConfigurations";
    _LFCa = "LambdaFunctionConfiguration";
    _LI = "LocationInfo";
    _LM = "LastModified";
    _LMT = "LastModifiedTime";
    _LNAS = "LocationNameAsString";
    _LP = "LocationPrefix";
    _LR = "LifecycleRule";
    _LRAO = "LifecycleRuleAndOperator";
    _LRF = "LifecycleRuleFilter";
    _LT = "LocationType";
    _M = "Marker";
    _MAO = "MetricsAndOperator";
    _MAS = "MaxAgeSeconds";
    _MB = "MaxBuckets";
    _MC = "MetricsConfiguration";
    _MCL = "MetricsConfigurationList";
    _MD = "MetadataDirective";
    _MDB = "MaxDirectoryBuckets";
    _MDf = "MfaDelete";
    _ME = "MetadataEntry";
    _MF = "MetricsFilter";
    _MFA = "MFA";
    _MFAD = "MFADelete";
    _MI = "MetricsId";
    _MK = "MaxKeys";
    _MKe = "MetadataKey";
    _MM = "MissingMeta";
    _MP = "MaxParts";
    _MS = "MetricsStatus";
    _MTC = "MetadataTableConfiguration";
    _MTCR = "MetadataTableConfigurationResult";
    _MU = "MaxUploads";
    _MV = "MetadataValue";
    _Me = "Metrics";
    _Mes = "Message";
    _Mi = "Minutes";
    _Mo = "Mode";
    _N = "Name";
    _NC = "NotificationConfiguration";
    _NCF = "NotificationConfigurationFilter";
    _NCT = "NextContinuationToken";
    _ND = "NoncurrentDays";
    _NI = "NotificationId";
    _NKM = "NextKeyMarker";
    _NM = "NextMarker";
    _NNV = "NewerNoncurrentVersions";
    _NPNM = "NextPartNumberMarker";
    _NUIM = "NextUploadIdMarker";
    _NVE = "NoncurrentVersionExpiration";
    _NVIM = "NextVersionIdMarker";
    _NVT = "NoncurrentVersionTransitions";
    _NVTo = "NoncurrentVersionTransition";
    _O = "Owner";
    _OA = "ObjectAttributes";
    _OC = "OwnershipControls";
    _OCACL = "ObjectCannedACL";
    _OCR = "OwnershipControlsRule";
    _OF = "OptionalFields";
    _OI = "ObjectIdentifier";
    _OK = "ObjectKey";
    _OL = "OutputLocation";
    _OLC = "ObjectLockConfiguration";
    _OLE = "ObjectLockEnabled";
    _OLEFB = "ObjectLockEnabledForBucket";
    _OLLH = "ObjectLockLegalHold";
    _OLLHS = "ObjectLockLegalHoldStatus";
    _OLM = "ObjectLockMode";
    _OLR = "ObjectLockRetention";
    _OLRM = "ObjectLockRetentionMode";
    _OLRUD = "ObjectLockRetainUntilDate";
    _OLRb = "ObjectLockRule";
    _OO = "ObjectOwnership";
    _OOA = "OptionalObjectAttributes";
    _OOw = "OwnerOverride";
    _OP = "ObjectParts";
    _OS = "OutputSerialization";
    _OSGT = "ObjectSizeGreaterThan";
    _OSGTB = "ObjectSizeGreaterThanBytes";
    _OSLT = "ObjectSizeLessThan";
    _OSLTB = "ObjectSizeLessThanBytes";
    _OSV = "OutputSchemaVersion";
    _OSb = "ObjectSize";
    _OVI = "ObjectVersionId";
    _Ob = "Objects";
    _P = "Prefix";
    _PABC = "PublicAccessBlockConfiguration";
    _PC = "PartsCount";
    _PDS = "PartitionDateSource";
    _PI = "ParquetInput";
    _PN = "PartNumber";
    _PNM = "PartNumberMarker";
    _PP = "PartitionedPrefix";
    _Pa = "Payer";
    _Par = "Part";
    _Parq = "Parquet";
    _Part = "Parts";
    _Pe = "Permission";
    _Pr = "Protocol";
    _Pri = "Priority";
    _Q = "Quiet";
    _QA = "QueueArn";
    _QC = "QueueConfiguration";
    _QCu = "QueueConfigurations";
    _QCuo = "QuoteCharacter";
    _QEC = "QuoteEscapeCharacter";
    _QF = "QuoteFields";
    _Qu = "Queue";
    _R = "Range";
    _RART = "RedirectAllRequestsTo";
    _RC = "RequestCharged";
    _RCC = "ResponseCacheControl";
    _RCD = "ResponseContentDisposition";
    _RCE = "ResponseContentEncoding";
    _RCL = "ResponseContentLanguage";
    _RCT = "ResponseContentType";
    _RCe = "ReplicationConfiguration";
    _RD = "RecordDelimiter";
    _RE = "ResponseExpires";
    _RED = "RestoreExpiryDate";
    _RKKID = "ReplicaKmsKeyID";
    _RKPW = "ReplaceKeyPrefixWith";
    _RKW = "ReplaceKeyWith";
    _RM = "ReplicaModifications";
    _RMS = "ReplicaModificationsStatus";
    _ROP = "RestoreOutputPath";
    _RP = "RequestPayer";
    _RPB = "RestrictPublicBuckets";
    _RPC = "RequestPaymentConfiguration";
    _RPe = "RequestProgress";
    _RR = "RequestRoute";
    _RRAO = "ReplicationRuleAndOperator";
    _RRF = "ReplicationRuleFilter";
    _RRS = "ReplicationRuleStatus";
    _RRT = "RestoreRequestType";
    _RRe = "ReplicationRule";
    _RRes = "RestoreRequest";
    _RRo = "RoutingRules";
    _RRou = "RoutingRule";
    _RS = "ReplicationStatus";
    _RSe = "RestoreStatus";
    _RT = "RequestToken";
    _RTS = "ReplicationTimeStatus";
    _RTV = "ReplicationTimeValue";
    _RTe = "ReplicationTime";
    _RUD = "RetainUntilDate";
    _Re = "Restore";
    _Red = "Redirect";
    _Ro = "Role";
    _Ru = "Rule";
    _Rul = "Rules";
    _S = "Status";
    _SA = "StartAfter";
    _SAK = "SecretAccessKey";
    _SBD = "S3BucketDestination";
    _SC = "StorageClass";
    _SCA = "StorageClassAnalysis";
    _SCADE = "StorageClassAnalysisDataExport";
    _SCASV = "StorageClassAnalysisSchemaVersion";
    _SCt = "StatusCode";
    _SDV = "SkipDestinationValidation";
    _SK = "SSE-KMS";
    _SKEO = "SseKmsEncryptedObjects";
    _SKEOS = "SseKmsEncryptedObjectsStatus";
    _SKF = "S3KeyFilter";
    _SKe = "S3Key";
    _SL = "S3Location";
    _SM = "SessionMode";
    _SOCR = "SelectObjectContentRequest";
    _SP = "SelectParameters";
    _SPi = "SimplePrefix";
    _SR = "ScanRange";
    _SS = "SSE-S3";
    _SSC = "SourceSelectionCriteria";
    _SSE = "ServerSideEncryption";
    _SSEA = "SSEAlgorithm";
    _SSEBD = "ServerSideEncryptionByDefault";
    _SSEC = "ServerSideEncryptionConfiguration";
    _SSECA = "SSECustomerAlgorithm";
    _SSECK = "SSECustomerKey";
    _SSECKMD = "SSECustomerKeyMD5";
    _SSEKMS = "SSEKMS";
    _SSEKMSEC = "SSEKMSEncryptionContext";
    _SSEKMSKI = "SSEKMSKeyId";
    _SSER = "ServerSideEncryptionRule";
    _SSES = "SSES3";
    _ST = "SessionToken";
    _STBA = "S3TablesBucketArn";
    _STD = "S3TablesDestination";
    _STDR = "S3TablesDestinationResult";
    _STN = "S3TablesName";
    _S_ = "S3";
    _Sc = "Schedule";
    _Se = "Setting";
    _Si = "Size";
    _St = "Start";
    _Su = "Suffix";
    _T = "Tagging";
    _TA = "TopicArn";
    _TAa = "TableArn";
    _TB = "TargetBucket";
    _TBA = "TableBucketArn";
    _TC = "TagCount";
    _TCo = "TopicConfiguration";
    _TCop = "TopicConfigurations";
    _TD = "TaggingDirective";
    _TDMOS = "TransitionDefaultMinimumObjectSize";
    _TG = "TargetGrants";
    _TGa = "TargetGrant";
    _TN = "TableName";
    _TNa = "TableNamespace";
    _TOKF = "TargetObjectKeyFormat";
    _TP = "TargetPrefix";
    _TPC = "TotalPartsCount";
    _TS = "TagSet";
    _TSC = "TransitionStorageClass";
    _Ta = "Tag";
    _Tag = "Tags";
    _Ti = "Tier";
    _Tie = "Tierings";
    _Tier = "Tiering";
    _Tim = "Time";
    _To = "Token";
    _Top = "Topic";
    _Tr = "Transitions";
    _Tra = "Transition";
    _Ty = "Type";
    _U = "Upload";
    _UI = "UploadId";
    _UIM = "UploadIdMarker";
    _UM = "UserMetadata";
    _URI = "URI";
    _Up = "Uploads";
    _V = "Version";
    _VC = "VersionCount";
    _VCe = "VersioningConfiguration";
    _VI = "VersionId";
    _VIM = "VersionIdMarker";
    _Va = "Value";
    _Ve = "Versions";
    _WC = "WebsiteConfiguration";
    _WOB = "WriteOffsetBytes";
    _WRL = "WebsiteRedirectLocation";
    _Y = "Years";
    _a3 = "analytics";
    _ac = "accelerate";
    _acl = "acl";
    _ar = "accept-ranges";
    _at = "attributes";
    _br = "bucket-region";
    _c2 = "cors";
    _cc = "cache-control";
    _cd = "content-disposition";
    _ce = "content-encoding";
    _cl = "content-language";
    _cl_ = "content-length";
    _cm = "content-md5";
    _cr = "content-range";
    _ct = "content-type";
    _ct_ = "continuation-token";
    _d = "delete";
    _de = "delimiter";
    _e2 = "expires";
    _en = "encryption";
    _et = "encoding-type";
    _eta = "etag";
    _ex = "expiresstring";
    _fo = "fetch-owner";
    _i = "id";
    _im = "if-match";
    _ims = "if-modified-since";
    _in = "inventory";
    _inm = "if-none-match";
    _it = "intelligent-tiering";
    _ius = "if-unmodified-since";
    _km = "key-marker";
    _l = "lifecycle";
    _lh = "legal-hold";
    _lm = "last-modified";
    _lo = "location";
    _log = "logging";
    _lt = "list-type";
    _m = "metrics";
    _mT = "metadataTable";
    _ma = "marker";
    _mb = "max-buckets";
    _mdb = "max-directory-buckets";
    _me = "member";
    _mk = "max-keys";
    _mp = "max-parts";
    _mu = "max-uploads";
    _n = "notification";
    _oC = "ownershipControls";
    _ol = "object-lock";
    _p = "policy";
    _pAB = "publicAccessBlock";
    _pN = "partNumber";
    _pS = "policyStatus";
    _pnm = "part-number-marker";
    _pr = "prefix";
    _r2 = "replication";
    _rP = "requestPayment";
    _ra = "range";
    _rcc = "response-cache-control";
    _rcd = "response-content-disposition";
    _rce = "response-content-encoding";
    _rcl = "response-content-language";
    _rct = "response-content-type";
    _re = "response-expires";
    _res = "restore";
    _ret = "retention";
    _s = "session";
    _sa = "start-after";
    _se = "select";
    _st = "select-type";
    _t2 = "tagging";
    _to = "torrent";
    _u = "uploads";
    _uI = "uploadId";
    _uim = "upload-id-marker";
    _v = "versioning";
    _vI = "versionId";
    _ve = '<?xml version="1.0" encoding="UTF-8"?>';
    _ver = "versions";
    _vim = "version-id-marker";
    _w = "website";
    _x = "xsi:type";
    _xaa = "x-amz-acl";
    _xaad = "x-amz-abort-date";
    _xaapa = "x-amz-access-point-alias";
    _xaari = "x-amz-abort-rule-id";
    _xaas = "x-amz-archive-status";
    _xabgr = "x-amz-bypass-governance-retention";
    _xabln = "x-amz-bucket-location-name";
    _xablt = "x-amz-bucket-location-type";
    _xabole = "x-amz-bucket-object-lock-enabled";
    _xabolt = "x-amz-bucket-object-lock-token";
    _xabr = "x-amz-bucket-region";
    _xaca = "x-amz-checksum-algorithm";
    _xacc = "x-amz-checksum-crc32";
    _xacc_ = "x-amz-checksum-crc32c";
    _xacm = "x-amz-checksum-mode";
    _xacrsba = "x-amz-confirm-remove-self-bucket-access";
    _xacs = "x-amz-checksum-sha1";
    _xacs_ = "x-amz-checksum-sha256";
    _xacs__ = "x-amz-copy-source";
    _xacsim = "x-amz-copy-source-if-match";
    _xacsims = "x-amz-copy-source-if-modified-since";
    _xacsinm = "x-amz-copy-source-if-none-match";
    _xacsius = "x-amz-copy-source-if-unmodified-since";
    _xacsm = "x-amz-create-session-mode";
    _xacsr = "x-amz-copy-source-range";
    _xacssseca = "x-amz-copy-source-server-side-encryption-customer-algorithm";
    _xacssseck = "x-amz-copy-source-server-side-encryption-customer-key";
    _xacssseckm = "x-amz-copy-source-server-side-encryption-customer-key-md5";
    _xacsvi = "x-amz-copy-source-version-id";
    _xadm = "x-amz-delete-marker";
    _xae = "x-amz-expiration";
    _xaebo = "x-amz-expected-bucket-owner";
    _xafec = "x-amz-fwd-error-code";
    _xafem = "x-amz-fwd-error-message";
    _xafhar = "x-amz-fwd-header-accept-ranges";
    _xafhcc = "x-amz-fwd-header-cache-control";
    _xafhcd = "x-amz-fwd-header-content-disposition";
    _xafhce = "x-amz-fwd-header-content-encoding";
    _xafhcl = "x-amz-fwd-header-content-language";
    _xafhcr = "x-amz-fwd-header-content-range";
    _xafhct = "x-amz-fwd-header-content-type";
    _xafhe = "x-amz-fwd-header-etag";
    _xafhe_ = "x-amz-fwd-header-expires";
    _xafhlm = "x-amz-fwd-header-last-modified";
    _xafhxacc = "x-amz-fwd-header-x-amz-checksum-crc32";
    _xafhxacc_ = "x-amz-fwd-header-x-amz-checksum-crc32c";
    _xafhxacs = "x-amz-fwd-header-x-amz-checksum-sha1";
    _xafhxacs_ = "x-amz-fwd-header-x-amz-checksum-sha256";
    _xafhxadm = "x-amz-fwd-header-x-amz-delete-marker";
    _xafhxae = "x-amz-fwd-header-x-amz-expiration";
    _xafhxamm = "x-amz-fwd-header-x-amz-missing-meta";
    _xafhxampc = "x-amz-fwd-header-x-amz-mp-parts-count";
    _xafhxaollh = "x-amz-fwd-header-x-amz-object-lock-legal-hold";
    _xafhxaolm = "x-amz-fwd-header-x-amz-object-lock-mode";
    _xafhxaolrud = "x-amz-fwd-header-x-amz-object-lock-retain-until-date";
    _xafhxar = "x-amz-fwd-header-x-amz-restore";
    _xafhxarc = "x-amz-fwd-header-x-amz-request-charged";
    _xafhxars = "x-amz-fwd-header-x-amz-replication-status";
    _xafhxasc = "x-amz-fwd-header-x-amz-storage-class";
    _xafhxasse = "x-amz-fwd-header-x-amz-server-side-encryption";
    _xafhxasseakki = "x-amz-fwd-header-x-amz-server-side-encryption-aws-kms-key-id";
    _xafhxassebke = "x-amz-fwd-header-x-amz-server-side-encryption-bucket-key-enabled";
    _xafhxasseca = "x-amz-fwd-header-x-amz-server-side-encryption-customer-algorithm";
    _xafhxasseckm = "x-amz-fwd-header-x-amz-server-side-encryption-customer-key-md5";
    _xafhxatc = "x-amz-fwd-header-x-amz-tagging-count";
    _xafhxavi = "x-amz-fwd-header-x-amz-version-id";
    _xafs = "x-amz-fwd-status";
    _xagfc = "x-amz-grant-full-control";
    _xagr = "x-amz-grant-read";
    _xagra = "x-amz-grant-read-acp";
    _xagw = "x-amz-grant-write";
    _xagwa = "x-amz-grant-write-acp";
    _xaimit = "x-amz-if-match-initiated-time";
    _xaimlmt = "x-amz-if-match-last-modified-time";
    _xaims = "x-amz-if-match-size";
    _xam = "x-amz-mfa";
    _xamd = "x-amz-metadata-directive";
    _xamm = "x-amz-missing-meta";
    _xamp = "x-amz-max-parts";
    _xampc = "x-amz-mp-parts-count";
    _xaoa = "x-amz-object-attributes";
    _xaollh = "x-amz-object-lock-legal-hold";
    _xaolm = "x-amz-object-lock-mode";
    _xaolrud = "x-amz-object-lock-retain-until-date";
    _xaoo = "x-amz-object-ownership";
    _xaooa = "x-amz-optional-object-attributes";
    _xaos = "x-amz-object-size";
    _xapnm = "x-amz-part-number-marker";
    _xar = "x-amz-restore";
    _xarc = "x-amz-request-charged";
    _xarop = "x-amz-restore-output-path";
    _xarp = "x-amz-request-payer";
    _xarr = "x-amz-request-route";
    _xars = "x-amz-replication-status";
    _xart = "x-amz-request-token";
    _xasc = "x-amz-storage-class";
    _xasca = "x-amz-sdk-checksum-algorithm";
    _xasdv = "x-amz-skip-destination-validation";
    _xasebo = "x-amz-source-expected-bucket-owner";
    _xasse = "x-amz-server-side-encryption";
    _xasseakki = "x-amz-server-side-encryption-aws-kms-key-id";
    _xassebke = "x-amz-server-side-encryption-bucket-key-enabled";
    _xassec = "x-amz-server-side-encryption-context";
    _xasseca = "x-amz-server-side-encryption-customer-algorithm";
    _xasseck = "x-amz-server-side-encryption-customer-key";
    _xasseckm = "x-amz-server-side-encryption-customer-key-md5";
    _xat = "x-amz-tagging";
    _xatc = "x-amz-tagging-count";
    _xatd = "x-amz-tagging-directive";
    _xatdmos = "x-amz-transition-default-minimum-object-size";
    _xavi = "x-amz-version-id";
    _xawob = "x-amz-write-offset-bytes";
    _xawrl = "x-amz-website-redirect-location";
    _xi = "x-id";
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/CreateSessionCommand.js
var CreateSessionCommand;
var init_CreateSessionCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/CreateSessionCommand.js"() {
    init_import_meta_url();
    init_dist_es31();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_models_0();
    init_Aws_restXml();
    CreateSessionCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      DisableS3ExpressSessionAuth: { type: "staticContextParams", value: true },
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getThrow200ExceptionsPlugin(config)
      ];
    }).s("AmazonS3", "CreateSession", {}).n("S3Client", "CreateSessionCommand").f(CreateSessionRequestFilterSensitiveLog, CreateSessionOutputFilterSensitiveLog).ser(se_CreateSessionCommand).de(de_CreateSessionCommand).build() {
      static {
        __name(this, "CreateSessionCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/package.json
var package_default;
var init_package2 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/package.json"() {
    package_default = {
      name: "@aws-sdk/client-s3",
      description: "AWS SDK for JavaScript S3 Client for Node.js, Browser and React Native",
      version: "3.721.0",
      scripts: {
        build: "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
        "build:cjs": "node ../../scripts/compilation/inline client-s3",
        "build:es": "tsc -p tsconfig.es.json",
        "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build",
        "build:types": "tsc -p tsconfig.types.json",
        "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
        clean: "rimraf ./dist-* && rimraf *.tsbuildinfo",
        "extract:docs": "api-extractor run --local",
        "generate:client": "node ../../scripts/generate-clients/single-service --solo s3",
        test: "yarn g:vitest run",
        "test:browser": "node ./test/browser-build/esbuild && vitest run -c vitest.config.browser.ts --mode development",
        "test:browser:watch": "node ./test/browser-build/esbuild && yarn g:vitest watch -c vitest.config.browser.ts",
        "test:e2e": "yarn g:vitest run -c vitest.config.e2e.ts --mode development && yarn test:browser",
        "test:e2e:watch": "yarn g:vitest watch -c vitest.config.e2e.ts",
        "test:watch": "yarn g:vitest watch"
      },
      main: "./dist-cjs/index.js",
      types: "./dist-types/index.d.ts",
      module: "./dist-es/index.js",
      sideEffects: false,
      dependencies: {
        "@aws-crypto/sha1-browser": "5.2.0",
        "@aws-crypto/sha256-browser": "5.2.0",
        "@aws-crypto/sha256-js": "5.2.0",
        "@aws-sdk/client-sso-oidc": "3.721.0",
        "@aws-sdk/client-sts": "3.721.0",
        "@aws-sdk/core": "3.716.0",
        "@aws-sdk/credential-provider-node": "3.721.0",
        "@aws-sdk/middleware-bucket-endpoint": "3.721.0",
        "@aws-sdk/middleware-expect-continue": "3.714.0",
        "@aws-sdk/middleware-flexible-checksums": "3.717.0",
        "@aws-sdk/middleware-host-header": "3.714.0",
        "@aws-sdk/middleware-location-constraint": "3.714.0",
        "@aws-sdk/middleware-logger": "3.714.0",
        "@aws-sdk/middleware-recursion-detection": "3.714.0",
        "@aws-sdk/middleware-sdk-s3": "3.716.0",
        "@aws-sdk/middleware-ssec": "3.714.0",
        "@aws-sdk/middleware-user-agent": "3.721.0",
        "@aws-sdk/region-config-resolver": "3.714.0",
        "@aws-sdk/signature-v4-multi-region": "3.716.0",
        "@aws-sdk/types": "3.714.0",
        "@aws-sdk/util-endpoints": "3.714.0",
        "@aws-sdk/util-user-agent-browser": "3.714.0",
        "@aws-sdk/util-user-agent-node": "3.721.0",
        "@aws-sdk/xml-builder": "3.709.0",
        "@smithy/config-resolver": "^3.0.13",
        "@smithy/core": "^2.5.5",
        "@smithy/eventstream-serde-browser": "^3.0.14",
        "@smithy/eventstream-serde-config-resolver": "^3.0.11",
        "@smithy/eventstream-serde-node": "^3.0.13",
        "@smithy/fetch-http-handler": "^4.1.2",
        "@smithy/hash-blob-browser": "^3.1.10",
        "@smithy/hash-node": "^3.0.11",
        "@smithy/hash-stream-node": "^3.1.10",
        "@smithy/invalid-dependency": "^3.0.11",
        "@smithy/md5-js": "^3.0.11",
        "@smithy/middleware-content-length": "^3.0.13",
        "@smithy/middleware-endpoint": "^3.2.6",
        "@smithy/middleware-retry": "^3.0.31",
        "@smithy/middleware-serde": "^3.0.11",
        "@smithy/middleware-stack": "^3.0.11",
        "@smithy/node-config-provider": "^3.1.12",
        "@smithy/node-http-handler": "^3.3.2",
        "@smithy/protocol-http": "^4.1.8",
        "@smithy/smithy-client": "^3.5.1",
        "@smithy/types": "^3.7.2",
        "@smithy/url-parser": "^3.0.11",
        "@smithy/util-base64": "^3.0.0",
        "@smithy/util-body-length-browser": "^3.0.0",
        "@smithy/util-body-length-node": "^3.0.0",
        "@smithy/util-defaults-mode-browser": "^3.0.31",
        "@smithy/util-defaults-mode-node": "^3.0.31",
        "@smithy/util-endpoints": "^2.1.7",
        "@smithy/util-middleware": "^3.0.11",
        "@smithy/util-retry": "^3.0.11",
        "@smithy/util-stream": "^3.3.2",
        "@smithy/util-utf8": "^3.0.0",
        "@smithy/util-waiter": "^3.2.0",
        tslib: "^2.6.2"
      },
      devDependencies: {
        "@aws-sdk/signature-v4-crt": "3.721.0",
        "@tsconfig/node16": "16.1.3",
        "@types/node": "^16.18.96",
        concurrently: "7.0.0",
        "downlevel-dts": "0.10.1",
        rimraf: "3.0.2",
        typescript: "~4.9.5"
      },
      engines: {
        node: ">=16.0.0"
      },
      typesVersions: {
        "<4.0": {
          "dist-types/*": [
            "dist-types/ts3.4/*"
          ]
        }
      },
      files: [
        "dist-*/**"
      ],
      author: {
        name: "AWS SDK for JavaScript Team",
        url: "https://aws.amazon.com/javascript/"
      },
      license: "Apache-2.0",
      browser: {
        "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser"
      },
      "react-native": {
        "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native"
      },
      homepage: "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-s3",
      repository: {
        type: "git",
        url: "https://github.com/aws/aws-sdk-js-v3.git",
        directory: "clients/client-s3"
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+credential-provider-env@3.716.0/node_modules/@aws-sdk/credential-provider-env/dist-es/fromEnv.js
var ENV_KEY, ENV_SECRET, ENV_SESSION, ENV_EXPIRATION, ENV_CREDENTIAL_SCOPE, ENV_ACCOUNT_ID, fromEnv2;
var init_fromEnv2 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+credential-provider-env@3.716.0/node_modules/@aws-sdk/credential-provider-env/dist-es/fromEnv.js"() {
    init_import_meta_url();
    init_client8();
    init_dist_es17();
    ENV_KEY = "AWS_ACCESS_KEY_ID";
    ENV_SECRET = "AWS_SECRET_ACCESS_KEY";
    ENV_SESSION = "AWS_SESSION_TOKEN";
    ENV_EXPIRATION = "AWS_CREDENTIAL_EXPIRATION";
    ENV_CREDENTIAL_SCOPE = "AWS_CREDENTIAL_SCOPE";
    ENV_ACCOUNT_ID = "AWS_ACCOUNT_ID";
    fromEnv2 = /* @__PURE__ */ __name((init4) => async () => {
      init4?.logger?.debug("@aws-sdk/credential-provider-env - fromEnv");
      const accessKeyId = process.env[ENV_KEY];
      const secretAccessKey = process.env[ENV_SECRET];
      const sessionToken = process.env[ENV_SESSION];
      const expiry = process.env[ENV_EXPIRATION];
      const credentialScope = process.env[ENV_CREDENTIAL_SCOPE];
      const accountId = process.env[ENV_ACCOUNT_ID];
      if (accessKeyId && secretAccessKey) {
        const credentials = {
          accessKeyId,
          secretAccessKey,
          ...sessionToken && { sessionToken },
          ...expiry && { expiration: new Date(expiry) },
          ...credentialScope && { credentialScope },
          ...accountId && { accountId }
        };
        setCredentialFeature(credentials, "CREDENTIALS_ENV_VARS", "g");
        return credentials;
      }
      throw new CredentialsProviderError("Unable to find environment variable credentials.", { logger: init4?.logger });
    }, "fromEnv");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+credential-provider-env@3.716.0/node_modules/@aws-sdk/credential-provider-env/dist-es/index.js
var dist_es_exports = {};
__export(dist_es_exports, {
  ENV_ACCOUNT_ID: () => ENV_ACCOUNT_ID,
  ENV_CREDENTIAL_SCOPE: () => ENV_CREDENTIAL_SCOPE,
  ENV_EXPIRATION: () => ENV_EXPIRATION,
  ENV_KEY: () => ENV_KEY,
  ENV_SECRET: () => ENV_SECRET,
  ENV_SESSION: () => ENV_SESSION,
  fromEnv: () => fromEnv2
});
var init_dist_es48 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+credential-provider-env@3.716.0/node_modules/@aws-sdk/credential-provider-env/dist-es/index.js"() {
    init_import_meta_url();
    init_fromEnv2();
  }
});
function httpRequest(options) {
  return new Promise((resolve32, reject) => {
    const req = http.request({
      method: "GET",
      ...options,
      hostname: options.hostname?.replace(/^\[(.+)\]$/, "$1")
    });
    req.on("error", (err) => {
      reject(Object.assign(new ProviderError("Unable to connect to instance metadata service"), err));
      req.destroy();
    });
    req.on("timeout", () => {
      reject(new ProviderError("TimeoutError from instance metadata service"));
      req.destroy();
    });
    req.on("response", (res) => {
      const { statusCode = 400 } = res;
      if (statusCode < 200 || 300 <= statusCode) {
        reject(Object.assign(new ProviderError("Error response received from instance metadata service"), { statusCode }));
        req.destroy();
      }
      const chunks = [];
      res.on("data", (chunk) => {
        chunks.push(chunk);
      });
      res.on("end", () => {
        resolve32(buffer.Buffer.concat(chunks));
        req.destroy();
      });
    });
    req.end();
  });
}
var init_httpRequest2 = __esm({
  "../../node_modules/.pnpm/@smithy+credential-provider-imds@3.2.8/node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/httpRequest.js"() {
    init_import_meta_url();
    init_dist_es17();
    __name(httpRequest, "httpRequest");
  }
});

// ../../node_modules/.pnpm/@smithy+credential-provider-imds@3.2.8/node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/ImdsCredentials.js
var isImdsCredentials, fromImdsCredentials;
var init_ImdsCredentials = __esm({
  "../../node_modules/.pnpm/@smithy+credential-provider-imds@3.2.8/node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/ImdsCredentials.js"() {
    init_import_meta_url();
    isImdsCredentials = /* @__PURE__ */ __name((arg) => Boolean(arg) && typeof arg === "object" && typeof arg.AccessKeyId === "string" && typeof arg.SecretAccessKey === "string" && typeof arg.Token === "string" && typeof arg.Expiration === "string", "isImdsCredentials");
    fromImdsCredentials = /* @__PURE__ */ __name((creds) => ({
      accessKeyId: creds.AccessKeyId,
      secretAccessKey: creds.SecretAccessKey,
      sessionToken: creds.Token,
      expiration: new Date(creds.Expiration),
      ...creds.AccountId && { accountId: creds.AccountId }
    }), "fromImdsCredentials");
  }
});

// ../../node_modules/.pnpm/@smithy+credential-provider-imds@3.2.8/node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/RemoteProviderInit.js
var DEFAULT_TIMEOUT, DEFAULT_MAX_RETRIES, providerConfigFromInit;
var init_RemoteProviderInit = __esm({
  "../../node_modules/.pnpm/@smithy+credential-provider-imds@3.2.8/node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/RemoteProviderInit.js"() {
    init_import_meta_url();
    DEFAULT_TIMEOUT = 1e3;
    DEFAULT_MAX_RETRIES = 0;
    providerConfigFromInit = /* @__PURE__ */ __name(({ maxRetries = DEFAULT_MAX_RETRIES, timeout: timeout2 = DEFAULT_TIMEOUT }) => ({ maxRetries, timeout: timeout2 }), "providerConfigFromInit");
  }
});

// ../../node_modules/.pnpm/@smithy+credential-provider-imds@3.2.8/node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/retry.js
var retry;
var init_retry4 = __esm({
  "../../node_modules/.pnpm/@smithy+credential-provider-imds@3.2.8/node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/retry.js"() {
    init_import_meta_url();
    retry = /* @__PURE__ */ __name((toRetry, maxRetries) => {
      let promise = toRetry();
      for (let i7 = 0; i7 < maxRetries; i7++) {
        promise = promise.catch(toRetry);
      }
      return promise;
    }, "retry");
  }
});
var ENV_CMDS_FULL_URI, ENV_CMDS_RELATIVE_URI, ENV_CMDS_AUTH_TOKEN, fromContainerMetadata, requestFromEcsImds, CMDS_IP, GREENGRASS_HOSTS, GREENGRASS_PROTOCOLS, getCmdsUri;
var init_fromContainerMetadata = __esm({
  "../../node_modules/.pnpm/@smithy+credential-provider-imds@3.2.8/node_modules/@smithy/credential-provider-imds/dist-es/fromContainerMetadata.js"() {
    init_import_meta_url();
    init_dist_es17();
    init_httpRequest2();
    init_ImdsCredentials();
    init_RemoteProviderInit();
    init_retry4();
    ENV_CMDS_FULL_URI = "AWS_CONTAINER_CREDENTIALS_FULL_URI";
    ENV_CMDS_RELATIVE_URI = "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI";
    ENV_CMDS_AUTH_TOKEN = "AWS_CONTAINER_AUTHORIZATION_TOKEN";
    fromContainerMetadata = /* @__PURE__ */ __name((init4 = {}) => {
      const { timeout: timeout2, maxRetries } = providerConfigFromInit(init4);
      return () => retry(async () => {
        const requestOptions = await getCmdsUri({ logger: init4.logger });
        const credsResponse = JSON.parse(await requestFromEcsImds(timeout2, requestOptions));
        if (!isImdsCredentials(credsResponse)) {
          throw new CredentialsProviderError("Invalid response received from instance metadata service.", {
            logger: init4.logger
          });
        }
        return fromImdsCredentials(credsResponse);
      }, maxRetries);
    }, "fromContainerMetadata");
    requestFromEcsImds = /* @__PURE__ */ __name(async (timeout2, options) => {
      if (process.env[ENV_CMDS_AUTH_TOKEN]) {
        options.headers = {
          ...options.headers,
          Authorization: process.env[ENV_CMDS_AUTH_TOKEN]
        };
      }
      const buffer = await httpRequest({
        ...options,
        timeout: timeout2
      });
      return buffer.toString();
    }, "requestFromEcsImds");
    CMDS_IP = "169.254.170.2";
    GREENGRASS_HOSTS = {
      localhost: true,
      "127.0.0.1": true
    };
    GREENGRASS_PROTOCOLS = {
      "http:": true,
      "https:": true
    };
    getCmdsUri = /* @__PURE__ */ __name(async ({ logger: logger4 }) => {
      if (process.env[ENV_CMDS_RELATIVE_URI]) {
        return {
          hostname: CMDS_IP,
          path: process.env[ENV_CMDS_RELATIVE_URI]
        };
      }
      if (process.env[ENV_CMDS_FULL_URI]) {
        const parsed = Url.parse(process.env[ENV_CMDS_FULL_URI]);
        if (!parsed.hostname || !(parsed.hostname in GREENGRASS_HOSTS)) {
          throw new CredentialsProviderError(`${parsed.hostname} is not a valid container metadata service hostname`, {
            tryNextLink: false,
            logger: logger4
          });
        }
        if (!parsed.protocol || !(parsed.protocol in GREENGRASS_PROTOCOLS)) {
          throw new CredentialsProviderError(`${parsed.protocol} is not a valid container metadata service protocol`, {
            tryNextLink: false,
            logger: logger4
          });
        }
        return {
          ...parsed,
          port: parsed.port ? parseInt(parsed.port, 10) : void 0
        };
      }
      throw new CredentialsProviderError(`The container metadata credential provider cannot be used unless the ${ENV_CMDS_RELATIVE_URI} or ${ENV_CMDS_FULL_URI} environment variable is set`, {
        tryNextLink: false,
        logger: logger4
      });
    }, "getCmdsUri");
  }
});

// ../../node_modules/.pnpm/@smithy+credential-provider-imds@3.2.8/node_modules/@smithy/credential-provider-imds/dist-es/error/InstanceMetadataV1FallbackError.js
var InstanceMetadataV1FallbackError;
var init_InstanceMetadataV1FallbackError = __esm({
  "../../node_modules/.pnpm/@smithy+credential-provider-imds@3.2.8/node_modules/@smithy/credential-provider-imds/dist-es/error/InstanceMetadataV1FallbackError.js"() {
    init_import_meta_url();
    init_dist_es17();
    InstanceMetadataV1FallbackError = class _InstanceMetadataV1FallbackError extends CredentialsProviderError {
      static {
        __name(this, "InstanceMetadataV1FallbackError");
      }
      constructor(message, tryNextLink = true) {
        super(message, tryNextLink);
        this.tryNextLink = tryNextLink;
        this.name = "InstanceMetadataV1FallbackError";
        Object.setPrototypeOf(this, _InstanceMetadataV1FallbackError.prototype);
      }
    };
  }
});

// ../../node_modules/.pnpm/@smithy+credential-provider-imds@3.2.8/node_modules/@smithy/credential-provider-imds/dist-es/config/Endpoint.js
var Endpoint;
var init_Endpoint = __esm({
  "../../node_modules/.pnpm/@smithy+credential-provider-imds@3.2.8/node_modules/@smithy/credential-provider-imds/dist-es/config/Endpoint.js"() {
    init_import_meta_url();
    (function(Endpoint2) {
      Endpoint2["IPv4"] = "http://169.254.169.254";
      Endpoint2["IPv6"] = "http://[fd00:ec2::254]";
    })(Endpoint || (Endpoint = {}));
  }
});

// ../../node_modules/.pnpm/@smithy+credential-provider-imds@3.2.8/node_modules/@smithy/credential-provider-imds/dist-es/config/EndpointConfigOptions.js
var ENV_ENDPOINT_NAME, CONFIG_ENDPOINT_NAME, ENDPOINT_CONFIG_OPTIONS;
var init_EndpointConfigOptions = __esm({
  "../../node_modules/.pnpm/@smithy+credential-provider-imds@3.2.8/node_modules/@smithy/credential-provider-imds/dist-es/config/EndpointConfigOptions.js"() {
    init_import_meta_url();
    ENV_ENDPOINT_NAME = "AWS_EC2_METADATA_SERVICE_ENDPOINT";
    CONFIG_ENDPOINT_NAME = "ec2_metadata_service_endpoint";
    ENDPOINT_CONFIG_OPTIONS = {
      environmentVariableSelector: /* @__PURE__ */ __name((env6) => env6[ENV_ENDPOINT_NAME], "environmentVariableSelector"),
      configFileSelector: /* @__PURE__ */ __name((profile) => profile[CONFIG_ENDPOINT_NAME], "configFileSelector"),
      default: void 0
    };
  }
});

// ../../node_modules/.pnpm/@smithy+credential-provider-imds@3.2.8/node_modules/@smithy/credential-provider-imds/dist-es/config/EndpointMode.js
var EndpointMode;
var init_EndpointMode = __esm({
  "../../node_modules/.pnpm/@smithy+credential-provider-imds@3.2.8/node_modules/@smithy/credential-provider-imds/dist-es/config/EndpointMode.js"() {
    init_import_meta_url();
    (function(EndpointMode2) {
      EndpointMode2["IPv4"] = "IPv4";
      EndpointMode2["IPv6"] = "IPv6";
    })(EndpointMode || (EndpointMode = {}));
  }
});

// ../../node_modules/.pnpm/@smithy+credential-provider-imds@3.2.8/node_modules/@smithy/credential-provider-imds/dist-es/config/EndpointModeConfigOptions.js
var ENV_ENDPOINT_MODE_NAME, CONFIG_ENDPOINT_MODE_NAME, ENDPOINT_MODE_CONFIG_OPTIONS;
var init_EndpointModeConfigOptions = __esm({
  "../../node_modules/.pnpm/@smithy+credential-provider-imds@3.2.8/node_modules/@smithy/credential-provider-imds/dist-es/config/EndpointModeConfigOptions.js"() {
    init_import_meta_url();
    init_EndpointMode();
    ENV_ENDPOINT_MODE_NAME = "AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE";
    CONFIG_ENDPOINT_MODE_NAME = "ec2_metadata_service_endpoint_mode";
    ENDPOINT_MODE_CONFIG_OPTIONS = {
      environmentVariableSelector: /* @__PURE__ */ __name((env6) => env6[ENV_ENDPOINT_MODE_NAME], "environmentVariableSelector"),
      configFileSelector: /* @__PURE__ */ __name((profile) => profile[CONFIG_ENDPOINT_MODE_NAME], "configFileSelector"),
      default: EndpointMode.IPv4
    };
  }
});

// ../../node_modules/.pnpm/@smithy+credential-provider-imds@3.2.8/node_modules/@smithy/credential-provider-imds/dist-es/utils/getInstanceMetadataEndpoint.js
var getInstanceMetadataEndpoint, getFromEndpointConfig, getFromEndpointModeConfig;
var init_getInstanceMetadataEndpoint = __esm({
  "../../node_modules/.pnpm/@smithy+credential-provider-imds@3.2.8/node_modules/@smithy/credential-provider-imds/dist-es/utils/getInstanceMetadataEndpoint.js"() {
    init_import_meta_url();
    init_dist_es39();
    init_dist_es41();
    init_Endpoint();
    init_EndpointConfigOptions();
    init_EndpointMode();
    init_EndpointModeConfigOptions();
    getInstanceMetadataEndpoint = /* @__PURE__ */ __name(async () => parseUrl2(await getFromEndpointConfig() || await getFromEndpointModeConfig()), "getInstanceMetadataEndpoint");
    getFromEndpointConfig = /* @__PURE__ */ __name(async () => loadConfig(ENDPOINT_CONFIG_OPTIONS)(), "getFromEndpointConfig");
    getFromEndpointModeConfig = /* @__PURE__ */ __name(async () => {
      const endpointMode = await loadConfig(ENDPOINT_MODE_CONFIG_OPTIONS)();
      switch (endpointMode) {
        case EndpointMode.IPv4:
          return Endpoint.IPv4;
        case EndpointMode.IPv6:
          return Endpoint.IPv6;
        default:
          throw new Error(`Unsupported endpoint mode: ${endpointMode}. Select from ${Object.values(EndpointMode)}`);
      }
    }, "getFromEndpointModeConfig");
  }
});

// ../../node_modules/.pnpm/@smithy+credential-provider-imds@3.2.8/node_modules/@smithy/credential-provider-imds/dist-es/utils/getExtendedInstanceMetadataCredentials.js
var STATIC_STABILITY_REFRESH_INTERVAL_SECONDS, STATIC_STABILITY_REFRESH_INTERVAL_JITTER_WINDOW_SECONDS, STATIC_STABILITY_DOC_URL, getExtendedInstanceMetadataCredentials;
var init_getExtendedInstanceMetadataCredentials = __esm({
  "../../node_modules/.pnpm/@smithy+credential-provider-imds@3.2.8/node_modules/@smithy/credential-provider-imds/dist-es/utils/getExtendedInstanceMetadataCredentials.js"() {
    init_import_meta_url();
    STATIC_STABILITY_REFRESH_INTERVAL_SECONDS = 5 * 60;
    STATIC_STABILITY_REFRESH_INTERVAL_JITTER_WINDOW_SECONDS = 5 * 60;
    STATIC_STABILITY_DOC_URL = "https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html";
    getExtendedInstanceMetadataCredentials = /* @__PURE__ */ __name((credentials, logger4) => {
      const refreshInterval = STATIC_STABILITY_REFRESH_INTERVAL_SECONDS + Math.floor(Math.random() * STATIC_STABILITY_REFRESH_INTERVAL_JITTER_WINDOW_SECONDS);
      const newExpiration = new Date(Date.now() + refreshInterval * 1e3);
      logger4.warn(`Attempting credential expiration extension due to a credential service availability issue. A refresh of these credentials will be attempted after ${new Date(newExpiration)}.
For more information, please visit: ` + STATIC_STABILITY_DOC_URL);
      const originalExpiration = credentials.originalExpiration ?? credentials.expiration;
      return {
        ...credentials,
        ...originalExpiration ? { originalExpiration } : {},
        expiration: newExpiration
      };
    }, "getExtendedInstanceMetadataCredentials");
  }
});

// ../../node_modules/.pnpm/@smithy+credential-provider-imds@3.2.8/node_modules/@smithy/credential-provider-imds/dist-es/utils/staticStabilityProvider.js
var staticStabilityProvider;
var init_staticStabilityProvider = __esm({
  "../../node_modules/.pnpm/@smithy+credential-provider-imds@3.2.8/node_modules/@smithy/credential-provider-imds/dist-es/utils/staticStabilityProvider.js"() {
    init_import_meta_url();
    init_getExtendedInstanceMetadataCredentials();
    staticStabilityProvider = /* @__PURE__ */ __name((provider, options = {}) => {
      const logger4 = options?.logger || console;
      let pastCredentials;
      return async () => {
        let credentials;
        try {
          credentials = await provider();
          if (credentials.expiration && credentials.expiration.getTime() < Date.now()) {
            credentials = getExtendedInstanceMetadataCredentials(credentials, logger4);
          }
        } catch (e10) {
          if (pastCredentials) {
            logger4.warn("Credential renew failed: ", e10);
            credentials = getExtendedInstanceMetadataCredentials(pastCredentials, logger4);
          } else {
            throw e10;
          }
        }
        pastCredentials = credentials;
        return credentials;
      };
    }, "staticStabilityProvider");
  }
});

// ../../node_modules/.pnpm/@smithy+credential-provider-imds@3.2.8/node_modules/@smithy/credential-provider-imds/dist-es/fromInstanceMetadata.js
var IMDS_PATH, IMDS_TOKEN_PATH, AWS_EC2_METADATA_V1_DISABLED, PROFILE_AWS_EC2_METADATA_V1_DISABLED, X_AWS_EC2_METADATA_TOKEN, fromInstanceMetadata, getInstanceMetadataProvider, getMetadataToken, getProfile, getCredentialsFromProfile;
var init_fromInstanceMetadata = __esm({
  "../../node_modules/.pnpm/@smithy+credential-provider-imds@3.2.8/node_modules/@smithy/credential-provider-imds/dist-es/fromInstanceMetadata.js"() {
    init_import_meta_url();
    init_dist_es39();
    init_dist_es17();
    init_InstanceMetadataV1FallbackError();
    init_httpRequest2();
    init_ImdsCredentials();
    init_RemoteProviderInit();
    init_retry4();
    init_getInstanceMetadataEndpoint();
    init_staticStabilityProvider();
    IMDS_PATH = "/latest/meta-data/iam/security-credentials/";
    IMDS_TOKEN_PATH = "/latest/api/token";
    AWS_EC2_METADATA_V1_DISABLED = "AWS_EC2_METADATA_V1_DISABLED";
    PROFILE_AWS_EC2_METADATA_V1_DISABLED = "ec2_metadata_v1_disabled";
    X_AWS_EC2_METADATA_TOKEN = "x-aws-ec2-metadata-token";
    fromInstanceMetadata = /* @__PURE__ */ __name((init4 = {}) => staticStabilityProvider(getInstanceMetadataProvider(init4), { logger: init4.logger }), "fromInstanceMetadata");
    getInstanceMetadataProvider = /* @__PURE__ */ __name((init4 = {}) => {
      let disableFetchToken = false;
      const { logger: logger4, profile } = init4;
      const { timeout: timeout2, maxRetries } = providerConfigFromInit(init4);
      const getCredentials2 = /* @__PURE__ */ __name(async (maxRetries2, options) => {
        const isImdsV1Fallback = disableFetchToken || options.headers?.[X_AWS_EC2_METADATA_TOKEN] == null;
        if (isImdsV1Fallback) {
          let fallbackBlockedFromProfile = false;
          let fallbackBlockedFromProcessEnv = false;
          const configValue = await loadConfig({
            environmentVariableSelector: /* @__PURE__ */ __name((env6) => {
              const envValue = env6[AWS_EC2_METADATA_V1_DISABLED];
              fallbackBlockedFromProcessEnv = !!envValue && envValue !== "false";
              if (envValue === void 0) {
                throw new CredentialsProviderError(`${AWS_EC2_METADATA_V1_DISABLED} not set in env, checking config file next.`, { logger: init4.logger });
              }
              return fallbackBlockedFromProcessEnv;
            }, "environmentVariableSelector"),
            configFileSelector: /* @__PURE__ */ __name((profile2) => {
              const profileValue = profile2[PROFILE_AWS_EC2_METADATA_V1_DISABLED];
              fallbackBlockedFromProfile = !!profileValue && profileValue !== "false";
              return fallbackBlockedFromProfile;
            }, "configFileSelector"),
            default: false
          }, {
            profile
          })();
          if (init4.ec2MetadataV1Disabled || configValue) {
            const causes = [];
            if (init4.ec2MetadataV1Disabled)
              causes.push("credential provider initialization (runtime option ec2MetadataV1Disabled)");
            if (fallbackBlockedFromProfile)
              causes.push(`config file profile (${PROFILE_AWS_EC2_METADATA_V1_DISABLED})`);
            if (fallbackBlockedFromProcessEnv)
              causes.push(`process environment variable (${AWS_EC2_METADATA_V1_DISABLED})`);
            throw new InstanceMetadataV1FallbackError(`AWS EC2 Metadata v1 fallback has been blocked by AWS SDK configuration in the following: [${causes.join(", ")}].`);
          }
        }
        const imdsProfile = (await retry(async () => {
          let profile2;
          try {
            profile2 = await getProfile(options);
          } catch (err) {
            if (err.statusCode === 401) {
              disableFetchToken = false;
            }
            throw err;
          }
          return profile2;
        }, maxRetries2)).trim();
        return retry(async () => {
          let creds;
          try {
            creds = await getCredentialsFromProfile(imdsProfile, options, init4);
          } catch (err) {
            if (err.statusCode === 401) {
              disableFetchToken = false;
            }
            throw err;
          }
          return creds;
        }, maxRetries2);
      }, "getCredentials");
      return async () => {
        const endpoint = await getInstanceMetadataEndpoint();
        if (disableFetchToken) {
          logger4?.debug("AWS SDK Instance Metadata", "using v1 fallback (no token fetch)");
          return getCredentials2(maxRetries, { ...endpoint, timeout: timeout2 });
        } else {
          let token;
          try {
            token = (await getMetadataToken({ ...endpoint, timeout: timeout2 })).toString();
          } catch (error2) {
            if (error2?.statusCode === 400) {
              throw Object.assign(error2, {
                message: "EC2 Metadata token request returned error"
              });
            } else if (error2.message === "TimeoutError" || [403, 404, 405].includes(error2.statusCode)) {
              disableFetchToken = true;
            }
            logger4?.debug("AWS SDK Instance Metadata", "using v1 fallback (initial)");
            return getCredentials2(maxRetries, { ...endpoint, timeout: timeout2 });
          }
          return getCredentials2(maxRetries, {
            ...endpoint,
            headers: {
              [X_AWS_EC2_METADATA_TOKEN]: token
            },
            timeout: timeout2
          });
        }
      };
    }, "getInstanceMetadataProvider");
    getMetadataToken = /* @__PURE__ */ __name(async (options) => httpRequest({
      ...options,
      path: IMDS_TOKEN_PATH,
      method: "PUT",
      headers: {
        "x-aws-ec2-metadata-token-ttl-seconds": "21600"
      }
    }), "getMetadataToken");
    getProfile = /* @__PURE__ */ __name(async (options) => (await httpRequest({ ...options, path: IMDS_PATH })).toString(), "getProfile");
    getCredentialsFromProfile = /* @__PURE__ */ __name(async (profile, options, init4) => {
      const credentialsResponse = JSON.parse((await httpRequest({
        ...options,
        path: IMDS_PATH + profile
      })).toString());
      if (!isImdsCredentials(credentialsResponse)) {
        throw new CredentialsProviderError("Invalid response received from instance metadata service.", {
          logger: init4.logger
        });
      }
      return fromImdsCredentials(credentialsResponse);
    }, "getCredentialsFromProfile");
  }
});

// ../../node_modules/.pnpm/@smithy+credential-provider-imds@3.2.8/node_modules/@smithy/credential-provider-imds/dist-es/types.js
var init_types14 = __esm({
  "../../node_modules/.pnpm/@smithy+credential-provider-imds@3.2.8/node_modules/@smithy/credential-provider-imds/dist-es/types.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+credential-provider-imds@3.2.8/node_modules/@smithy/credential-provider-imds/dist-es/index.js
var dist_es_exports2 = {};
__export(dist_es_exports2, {
  DEFAULT_MAX_RETRIES: () => DEFAULT_MAX_RETRIES,
  DEFAULT_TIMEOUT: () => DEFAULT_TIMEOUT,
  ENV_CMDS_AUTH_TOKEN: () => ENV_CMDS_AUTH_TOKEN,
  ENV_CMDS_FULL_URI: () => ENV_CMDS_FULL_URI,
  ENV_CMDS_RELATIVE_URI: () => ENV_CMDS_RELATIVE_URI,
  Endpoint: () => Endpoint,
  fromContainerMetadata: () => fromContainerMetadata,
  fromInstanceMetadata: () => fromInstanceMetadata,
  getInstanceMetadataEndpoint: () => getInstanceMetadataEndpoint,
  httpRequest: () => httpRequest,
  providerConfigFromInit: () => providerConfigFromInit
});
var init_dist_es49 = __esm({
  "../../node_modules/.pnpm/@smithy+credential-provider-imds@3.2.8/node_modules/@smithy/credential-provider-imds/dist-es/index.js"() {
    init_import_meta_url();
    init_fromContainerMetadata();
    init_fromInstanceMetadata();
    init_RemoteProviderInit();
    init_types14();
    init_httpRequest2();
    init_getInstanceMetadataEndpoint();
    init_Endpoint();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+credential-provider-http@3.716.0/node_modules/@aws-sdk/credential-provider-http/dist-es/fromHttp/checkUrl.js
var ECS_CONTAINER_HOST, EKS_CONTAINER_HOST_IPv4, EKS_CONTAINER_HOST_IPv6, checkUrl;
var init_checkUrl = __esm({
  "../../node_modules/.pnpm/@aws-sdk+credential-provider-http@3.716.0/node_modules/@aws-sdk/credential-provider-http/dist-es/fromHttp/checkUrl.js"() {
    init_import_meta_url();
    init_dist_es17();
    ECS_CONTAINER_HOST = "169.254.170.2";
    EKS_CONTAINER_HOST_IPv4 = "169.254.170.23";
    EKS_CONTAINER_HOST_IPv6 = "[fd00:ec2::23]";
    checkUrl = /* @__PURE__ */ __name((url4, logger4) => {
      if (url4.protocol === "https:") {
        return;
      }
      if (url4.hostname === ECS_CONTAINER_HOST || url4.hostname === EKS_CONTAINER_HOST_IPv4 || url4.hostname === EKS_CONTAINER_HOST_IPv6) {
        return;
      }
      if (url4.hostname.includes("[")) {
        if (url4.hostname === "[::1]" || url4.hostname === "[0000:0000:0000:0000:0000:0000:0000:0001]") {
          return;
        }
      } else {
        if (url4.hostname === "localhost") {
          return;
        }
        const ipComponents = url4.hostname.split(".");
        const inRange = /* @__PURE__ */ __name((component) => {
          const num = parseInt(component, 10);
          return 0 <= num && num <= 255;
        }, "inRange");
        if (ipComponents[0] === "127" && inRange(ipComponents[1]) && inRange(ipComponents[2]) && inRange(ipComponents[3]) && ipComponents.length === 4) {
          return;
        }
      }
      throw new CredentialsProviderError(`URL not accepted. It must either be HTTPS or match one of the following:
  - loopback CIDR 127.0.0.0/8 or [::1/128]
  - ECS container host 169.254.170.2
  - EKS container host 169.254.170.23 or [fd00:ec2::23]`, { logger: logger4 });
    }, "checkUrl");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+credential-provider-http@3.716.0/node_modules/@aws-sdk/credential-provider-http/dist-es/fromHttp/requestHelpers.js
function createGetRequest(url4) {
  return new HttpRequest({
    protocol: url4.protocol,
    hostname: url4.hostname,
    port: Number(url4.port),
    path: url4.pathname,
    query: Array.from(url4.searchParams.entries()).reduce((acc, [k7, v8]) => {
      acc[k7] = v8;
      return acc;
    }, {}),
    fragment: url4.hash
  });
}
async function getCredentials(response, logger4) {
  const stream2 = sdkStreamMixin2(response.body);
  const str = await stream2.transformToString();
  if (response.statusCode === 200) {
    const parsed = JSON.parse(str);
    if (typeof parsed.AccessKeyId !== "string" || typeof parsed.SecretAccessKey !== "string" || typeof parsed.Token !== "string" || typeof parsed.Expiration !== "string") {
      throw new CredentialsProviderError("HTTP credential provider response not of the required format, an object matching: { AccessKeyId: string, SecretAccessKey: string, Token: string, Expiration: string(rfc3339) }", { logger: logger4 });
    }
    return {
      accessKeyId: parsed.AccessKeyId,
      secretAccessKey: parsed.SecretAccessKey,
      sessionToken: parsed.Token,
      expiration: parseRfc3339DateTime(parsed.Expiration)
    };
  }
  if (response.statusCode >= 400 && response.statusCode < 500) {
    let parsedBody = {};
    try {
      parsedBody = JSON.parse(str);
    } catch (e10) {
    }
    throw Object.assign(new CredentialsProviderError(`Server responded with status: ${response.statusCode}`, { logger: logger4 }), {
      Code: parsedBody.Code,
      Message: parsedBody.Message
    });
  }
  throw new CredentialsProviderError(`Server responded with status: ${response.statusCode}`, { logger: logger4 });
}
var init_requestHelpers = __esm({
  "../../node_modules/.pnpm/@aws-sdk+credential-provider-http@3.716.0/node_modules/@aws-sdk/credential-provider-http/dist-es/fromHttp/requestHelpers.js"() {
    init_import_meta_url();
    init_dist_es17();
    init_dist_es2();
    init_dist_es20();
    init_dist_es15();
    __name(createGetRequest, "createGetRequest");
    __name(getCredentials, "getCredentials");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+credential-provider-http@3.716.0/node_modules/@aws-sdk/credential-provider-http/dist-es/fromHttp/retry-wrapper.js
var retryWrapper;
var init_retry_wrapper = __esm({
  "../../node_modules/.pnpm/@aws-sdk+credential-provider-http@3.716.0/node_modules/@aws-sdk/credential-provider-http/dist-es/fromHttp/retry-wrapper.js"() {
    init_import_meta_url();
    retryWrapper = /* @__PURE__ */ __name((toRetry, maxRetries, delayMs) => {
      return async () => {
        for (let i7 = 0; i7 < maxRetries; ++i7) {
          try {
            return await toRetry();
          } catch (e10) {
            await new Promise((resolve32) => setTimeout(resolve32, delayMs));
          }
        }
        return await toRetry();
      };
    }, "retryWrapper");
  }
});
var AWS_CONTAINER_CREDENTIALS_RELATIVE_URI, DEFAULT_LINK_LOCAL_HOST, AWS_CONTAINER_CREDENTIALS_FULL_URI, AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE, AWS_CONTAINER_AUTHORIZATION_TOKEN, fromHttp;
var init_fromHttp = __esm({
  "../../node_modules/.pnpm/@aws-sdk+credential-provider-http@3.716.0/node_modules/@aws-sdk/credential-provider-http/dist-es/fromHttp/fromHttp.js"() {
    init_import_meta_url();
    init_client8();
    init_dist_es12();
    init_dist_es17();
    init_checkUrl();
    init_requestHelpers();
    init_retry_wrapper();
    AWS_CONTAINER_CREDENTIALS_RELATIVE_URI = "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI";
    DEFAULT_LINK_LOCAL_HOST = "http://169.254.170.2";
    AWS_CONTAINER_CREDENTIALS_FULL_URI = "AWS_CONTAINER_CREDENTIALS_FULL_URI";
    AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE = "AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE";
    AWS_CONTAINER_AUTHORIZATION_TOKEN = "AWS_CONTAINER_AUTHORIZATION_TOKEN";
    fromHttp = /* @__PURE__ */ __name((options = {}) => {
      options.logger?.debug("@aws-sdk/credential-provider-http - fromHttp");
      let host;
      const relative16 = options.awsContainerCredentialsRelativeUri ?? process.env[AWS_CONTAINER_CREDENTIALS_RELATIVE_URI];
      const full = options.awsContainerCredentialsFullUri ?? process.env[AWS_CONTAINER_CREDENTIALS_FULL_URI];
      const token = options.awsContainerAuthorizationToken ?? process.env[AWS_CONTAINER_AUTHORIZATION_TOKEN];
      const tokenFile = options.awsContainerAuthorizationTokenFile ?? process.env[AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE];
      const warn2 = options.logger?.constructor?.name === "NoOpLogger" || !options.logger ? console.warn : options.logger.warn;
      if (relative16 && full) {
        warn2("@aws-sdk/credential-provider-http: you have set both awsContainerCredentialsRelativeUri and awsContainerCredentialsFullUri.");
        warn2("awsContainerCredentialsFullUri will take precedence.");
      }
      if (token && tokenFile) {
        warn2("@aws-sdk/credential-provider-http: you have set both awsContainerAuthorizationToken and awsContainerAuthorizationTokenFile.");
        warn2("awsContainerAuthorizationToken will take precedence.");
      }
      if (full) {
        host = full;
      } else if (relative16) {
        host = `${DEFAULT_LINK_LOCAL_HOST}${relative16}`;
      } else {
        throw new CredentialsProviderError(`No HTTP credential provider host provided.
Set AWS_CONTAINER_CREDENTIALS_FULL_URI or AWS_CONTAINER_CREDENTIALS_RELATIVE_URI.`, { logger: options.logger });
      }
      const url4 = new URL(host);
      checkUrl(url4, options.logger);
      const requestHandler = new NodeHttpHandler({
        requestTimeout: options.timeout ?? 1e3,
        connectionTimeout: options.timeout ?? 1e3
      });
      return retryWrapper(async () => {
        const request4 = createGetRequest(url4);
        if (token) {
          request4.headers.Authorization = token;
        } else if (tokenFile) {
          request4.headers.Authorization = (await fs9__default.default.readFile(tokenFile)).toString();
        }
        try {
          const result = await requestHandler.handle(request4);
          return getCredentials(result.response).then((creds) => setCredentialFeature(creds, "CREDENTIALS_HTTP", "z"));
        } catch (e10) {
          throw new CredentialsProviderError(String(e10), { logger: options.logger });
        }
      }, options.maxRetries ?? 3, options.timeout ?? 1e3);
    }, "fromHttp");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+credential-provider-http@3.716.0/node_modules/@aws-sdk/credential-provider-http/dist-es/index.js
var dist_es_exports3 = {};
__export(dist_es_exports3, {
  fromHttp: () => fromHttp
});
var init_dist_es50 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+credential-provider-http@3.716.0/node_modules/@aws-sdk/credential-provider-http/dist-es/index.js"() {
    init_import_meta_url();
    init_fromHttp();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+credential-provider-node@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+cli_8982e3418a41ce727552ac724fdea1d8/node_modules/@aws-sdk/credential-provider-node/dist-es/remoteProvider.js
var ENV_IMDS_DISABLED, remoteProvider;
var init_remoteProvider = __esm({
  "../../node_modules/.pnpm/@aws-sdk+credential-provider-node@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+cli_8982e3418a41ce727552ac724fdea1d8/node_modules/@aws-sdk/credential-provider-node/dist-es/remoteProvider.js"() {
    init_import_meta_url();
    init_dist_es17();
    ENV_IMDS_DISABLED = "AWS_EC2_METADATA_DISABLED";
    remoteProvider = /* @__PURE__ */ __name(async (init4) => {
      const { ENV_CMDS_FULL_URI: ENV_CMDS_FULL_URI2, ENV_CMDS_RELATIVE_URI: ENV_CMDS_RELATIVE_URI2, fromContainerMetadata: fromContainerMetadata2, fromInstanceMetadata: fromInstanceMetadata2 } = await Promise.resolve().then(() => (init_dist_es49(), dist_es_exports2));
      if (process.env[ENV_CMDS_RELATIVE_URI2] || process.env[ENV_CMDS_FULL_URI2]) {
        init4.logger?.debug("@aws-sdk/credential-provider-node - remoteProvider::fromHttp/fromContainerMetadata");
        const { fromHttp: fromHttp2 } = await Promise.resolve().then(() => (init_dist_es50(), dist_es_exports3));
        return chain(fromHttp2(init4), fromContainerMetadata2(init4));
      }
      if (process.env[ENV_IMDS_DISABLED]) {
        return async () => {
          throw new CredentialsProviderError("EC2 Instance Metadata Service access disabled", { logger: init4.logger });
        };
      }
      init4.logger?.debug("@aws-sdk/credential-provider-node - remoteProvider::fromInstanceMetadata");
      return fromInstanceMetadata2(init4);
    }, "remoteProvider");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+credential-provider-sso@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0_/node_modules/@aws-sdk/credential-provider-sso/dist-es/isSsoProfile.js
var isSsoProfile;
var init_isSsoProfile = __esm({
  "../../node_modules/.pnpm/@aws-sdk+credential-provider-sso@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0_/node_modules/@aws-sdk/credential-provider-sso/dist-es/isSsoProfile.js"() {
    init_import_meta_url();
    isSsoProfile = /* @__PURE__ */ __name((arg) => arg && (typeof arg.sso_start_url === "string" || typeof arg.sso_account_id === "string" || typeof arg.sso_session === "string" || typeof arg.sso_region === "string" || typeof arg.sso_role_name === "string"), "isSsoProfile");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+token-providers@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0_/node_modules/@aws-sdk/token-providers/dist-es/constants.js
var EXPIRE_WINDOW_MS, REFRESH_MESSAGE;
var init_constants16 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+token-providers@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0_/node_modules/@aws-sdk/token-providers/dist-es/constants.js"() {
    init_import_meta_url();
    EXPIRE_WINDOW_MS = 5 * 60 * 1e3;
    REFRESH_MESSAGE = `To refresh this SSO session run 'aws sso login' with the corresponding profile.`;
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/auth/httpAuthSchemeProvider.js
function createAwsAuthSigv4HttpAuthOption2(authParameters) {
  return {
    schemeId: "aws.auth#sigv4",
    signingProperties: {
      name: "sso-oauth",
      region: authParameters.region
    },
    propertiesExtractor: /* @__PURE__ */ __name((config, context2) => ({
      signingProperties: {
        config,
        context: context2
      }
    }), "propertiesExtractor")
  };
}
function createSmithyApiNoAuthHttpAuthOption(authParameters) {
  return {
    schemeId: "smithy.api#noAuth"
  };
}
var defaultSSOOIDCHttpAuthSchemeParametersProvider, defaultSSOOIDCHttpAuthSchemeProvider, resolveHttpAuthSchemeConfig2;
var init_httpAuthSchemeProvider2 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/auth/httpAuthSchemeProvider.js"() {
    init_import_meta_url();
    init_dist_es21();
    init_dist_es4();
    defaultSSOOIDCHttpAuthSchemeParametersProvider = /* @__PURE__ */ __name(async (config, context2, input) => {
      return {
        operation: getSmithyContext(context2).operation,
        region: await normalizeProvider(config.region)() || (() => {
          throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
        })()
      };
    }, "defaultSSOOIDCHttpAuthSchemeParametersProvider");
    __name(createAwsAuthSigv4HttpAuthOption2, "createAwsAuthSigv4HttpAuthOption");
    __name(createSmithyApiNoAuthHttpAuthOption, "createSmithyApiNoAuthHttpAuthOption");
    defaultSSOOIDCHttpAuthSchemeProvider = /* @__PURE__ */ __name((authParameters) => {
      const options = [];
      switch (authParameters.operation) {
        case "CreateToken": {
          options.push(createSmithyApiNoAuthHttpAuthOption());
          break;
        }
        case "RegisterClient": {
          options.push(createSmithyApiNoAuthHttpAuthOption());
          break;
        }
        case "StartDeviceAuthorization": {
          options.push(createSmithyApiNoAuthHttpAuthOption());
          break;
        }
        default: {
          options.push(createAwsAuthSigv4HttpAuthOption2(authParameters));
        }
      }
      return options;
    }, "defaultSSOOIDCHttpAuthSchemeProvider");
    resolveHttpAuthSchemeConfig2 = /* @__PURE__ */ __name((config) => {
      const config_0 = resolveAwsSdkSigV4Config(config);
      return {
        ...config_0
      };
    }, "resolveHttpAuthSchemeConfig");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/endpoint/EndpointParameters.js
var resolveClientEndpointParameters2, commonParams2;
var init_EndpointParameters2 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/endpoint/EndpointParameters.js"() {
    init_import_meta_url();
    resolveClientEndpointParameters2 = /* @__PURE__ */ __name((options) => {
      return {
        ...options,
        useDualstackEndpoint: options.useDualstackEndpoint ?? false,
        useFipsEndpoint: options.useFipsEndpoint ?? false,
        defaultSigningName: "sso-oauth"
      };
    }, "resolveClientEndpointParameters");
    commonParams2 = {
      UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
      Endpoint: { type: "builtInParams", name: "endpoint" },
      Region: { type: "builtInParams", name: "region" },
      UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/package.json
var package_default2;
var init_package3 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/package.json"() {
    package_default2 = {
      name: "@aws-sdk/client-sso-oidc",
      description: "AWS SDK for JavaScript Sso Oidc Client for Node.js, Browser and React Native",
      version: "3.721.0",
      scripts: {
        build: "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
        "build:cjs": "node ../../scripts/compilation/inline client-sso-oidc",
        "build:es": "tsc -p tsconfig.es.json",
        "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build",
        "build:types": "tsc -p tsconfig.types.json",
        "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
        clean: "rimraf ./dist-* && rimraf *.tsbuildinfo",
        "extract:docs": "api-extractor run --local",
        "generate:client": "node ../../scripts/generate-clients/single-service --solo sso-oidc"
      },
      main: "./dist-cjs/index.js",
      types: "./dist-types/index.d.ts",
      module: "./dist-es/index.js",
      sideEffects: false,
      dependencies: {
        "@aws-crypto/sha256-browser": "5.2.0",
        "@aws-crypto/sha256-js": "5.2.0",
        "@aws-sdk/core": "3.716.0",
        "@aws-sdk/credential-provider-node": "3.721.0",
        "@aws-sdk/middleware-host-header": "3.714.0",
        "@aws-sdk/middleware-logger": "3.714.0",
        "@aws-sdk/middleware-recursion-detection": "3.714.0",
        "@aws-sdk/middleware-user-agent": "3.721.0",
        "@aws-sdk/region-config-resolver": "3.714.0",
        "@aws-sdk/types": "3.714.0",
        "@aws-sdk/util-endpoints": "3.714.0",
        "@aws-sdk/util-user-agent-browser": "3.714.0",
        "@aws-sdk/util-user-agent-node": "3.721.0",
        "@smithy/config-resolver": "^3.0.13",
        "@smithy/core": "^2.5.5",
        "@smithy/fetch-http-handler": "^4.1.2",
        "@smithy/hash-node": "^3.0.11",
        "@smithy/invalid-dependency": "^3.0.11",
        "@smithy/middleware-content-length": "^3.0.13",
        "@smithy/middleware-endpoint": "^3.2.6",
        "@smithy/middleware-retry": "^3.0.31",
        "@smithy/middleware-serde": "^3.0.11",
        "@smithy/middleware-stack": "^3.0.11",
        "@smithy/node-config-provider": "^3.1.12",
        "@smithy/node-http-handler": "^3.3.2",
        "@smithy/protocol-http": "^4.1.8",
        "@smithy/smithy-client": "^3.5.1",
        "@smithy/types": "^3.7.2",
        "@smithy/url-parser": "^3.0.11",
        "@smithy/util-base64": "^3.0.0",
        "@smithy/util-body-length-browser": "^3.0.0",
        "@smithy/util-body-length-node": "^3.0.0",
        "@smithy/util-defaults-mode-browser": "^3.0.31",
        "@smithy/util-defaults-mode-node": "^3.0.31",
        "@smithy/util-endpoints": "^2.1.7",
        "@smithy/util-middleware": "^3.0.11",
        "@smithy/util-retry": "^3.0.11",
        "@smithy/util-utf8": "^3.0.0",
        tslib: "^2.6.2"
      },
      devDependencies: {
        "@tsconfig/node16": "16.1.3",
        "@types/node": "^16.18.96",
        concurrently: "7.0.0",
        "downlevel-dts": "0.10.1",
        rimraf: "3.0.2",
        typescript: "~4.9.5"
      },
      engines: {
        node: ">=16.0.0"
      },
      typesVersions: {
        "<4.0": {
          "dist-types/*": [
            "dist-types/ts3.4/*"
          ]
        }
      },
      files: [
        "dist-*/**"
      ],
      author: {
        name: "AWS SDK for JavaScript Team",
        url: "https://aws.amazon.com/javascript/"
      },
      license: "Apache-2.0",
      peerDependencies: {
        "@aws-sdk/client-sts": "^3.721.0"
      },
      browser: {
        "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser"
      },
      "react-native": {
        "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native"
      },
      homepage: "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-sso-oidc",
      repository: {
        type: "git",
        url: "https://github.com/aws/aws-sdk-js-v3.git",
        directory: "clients/client-sso-oidc"
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+util-user-agent-node@3.721.0/node_modules/@aws-sdk/util-user-agent-node/dist-es/crt-availability.js
var crtAvailability;
var init_crt_availability = __esm({
  "../../node_modules/.pnpm/@aws-sdk+util-user-agent-node@3.721.0/node_modules/@aws-sdk/util-user-agent-node/dist-es/crt-availability.js"() {
    init_import_meta_url();
    crtAvailability = {
      isCrtAvailable: false
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+util-user-agent-node@3.721.0/node_modules/@aws-sdk/util-user-agent-node/dist-es/is-crt-available.js
var isCrtAvailable;
var init_is_crt_available = __esm({
  "../../node_modules/.pnpm/@aws-sdk+util-user-agent-node@3.721.0/node_modules/@aws-sdk/util-user-agent-node/dist-es/is-crt-available.js"() {
    init_import_meta_url();
    init_crt_availability();
    isCrtAvailable = /* @__PURE__ */ __name(() => {
      if (crtAvailability.isCrtAvailable) {
        return ["md/crt-avail"];
      }
      return null;
    }, "isCrtAvailable");
  }
});
var createDefaultUserAgentProvider;
var init_defaultUserAgent = __esm({
  "../../node_modules/.pnpm/@aws-sdk+util-user-agent-node@3.721.0/node_modules/@aws-sdk/util-user-agent-node/dist-es/defaultUserAgent.js"() {
    init_import_meta_url();
    init_is_crt_available();
    init_crt_availability();
    createDefaultUserAgentProvider = /* @__PURE__ */ __name(({ serviceId, clientVersion }) => {
      return async (config) => {
        const sections = [
          ["aws-sdk-js", clientVersion],
          ["ua", "2.1"],
          [`os/${os11.platform()}`, os11.release()],
          ["lang/js"],
          ["md/nodejs", `${process7.versions.node}`]
        ];
        const crtAvailable = isCrtAvailable();
        if (crtAvailable) {
          sections.push(crtAvailable);
        }
        if (serviceId) {
          sections.push([`api/${serviceId}`, clientVersion]);
        }
        if (process7.env.AWS_EXECUTION_ENV) {
          sections.push([`exec-env/${process7.env.AWS_EXECUTION_ENV}`]);
        }
        const appId = await config?.userAgentAppId?.();
        const resolvedUserAgent = appId ? [...sections, [`app/${appId}`]] : [...sections];
        return resolvedUserAgent;
      };
    }, "createDefaultUserAgentProvider");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+util-user-agent-node@3.721.0/node_modules/@aws-sdk/util-user-agent-node/dist-es/nodeAppIdConfigOptions.js
var UA_APP_ID_ENV_NAME, UA_APP_ID_INI_NAME, UA_APP_ID_INI_NAME_DEPRECATED, NODE_APP_ID_CONFIG_OPTIONS;
var init_nodeAppIdConfigOptions = __esm({
  "../../node_modules/.pnpm/@aws-sdk+util-user-agent-node@3.721.0/node_modules/@aws-sdk/util-user-agent-node/dist-es/nodeAppIdConfigOptions.js"() {
    init_import_meta_url();
    init_dist_es34();
    UA_APP_ID_ENV_NAME = "AWS_SDK_UA_APP_ID";
    UA_APP_ID_INI_NAME = "sdk_ua_app_id";
    UA_APP_ID_INI_NAME_DEPRECATED = "sdk-ua-app-id";
    NODE_APP_ID_CONFIG_OPTIONS = {
      environmentVariableSelector: /* @__PURE__ */ __name((env6) => env6[UA_APP_ID_ENV_NAME], "environmentVariableSelector"),
      configFileSelector: /* @__PURE__ */ __name((profile) => profile[UA_APP_ID_INI_NAME] ?? profile[UA_APP_ID_INI_NAME_DEPRECATED], "configFileSelector"),
      default: DEFAULT_UA_APP_ID
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+util-user-agent-node@3.721.0/node_modules/@aws-sdk/util-user-agent-node/dist-es/index.js
var init_dist_es51 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+util-user-agent-node@3.721.0/node_modules/@aws-sdk/util-user-agent-node/dist-es/index.js"() {
    init_import_meta_url();
    init_defaultUserAgent();
    init_nodeAppIdConfigOptions();
  }
});
function castSourceData(toCast, encoding) {
  if (buffer.Buffer.isBuffer(toCast)) {
    return toCast;
  }
  if (typeof toCast === "string") {
    return fromString(toCast, encoding);
  }
  if (ArrayBuffer.isView(toCast)) {
    return fromArrayBuffer(toCast.buffer, toCast.byteOffset, toCast.byteLength);
  }
  return fromArrayBuffer(toCast);
}
var Hash;
var init_dist_es52 = __esm({
  "../../node_modules/.pnpm/@smithy+hash-node@3.0.11/node_modules/@smithy/hash-node/dist-es/index.js"() {
    init_import_meta_url();
    init_dist_es7();
    init_dist_es8();
    Hash = class {
      static {
        __name(this, "Hash");
      }
      constructor(algorithmIdentifier, secret) {
        this.algorithmIdentifier = algorithmIdentifier;
        this.secret = secret;
        this.reset();
      }
      update(toHash, encoding) {
        this.hash.update(toUint8Array(castSourceData(toHash, encoding)));
      }
      digest() {
        return Promise.resolve(this.hash.digest());
      }
      reset() {
        this.hash = this.secret ? crypto2.createHmac(this.algorithmIdentifier, castSourceData(this.secret)) : crypto2.createHash(this.algorithmIdentifier);
      }
    };
    __name(castSourceData, "castSourceData");
  }
});
var calculateBodyLength;
var init_calculateBodyLength = __esm({
  "../../node_modules/.pnpm/@smithy+util-body-length-node@3.0.0/node_modules/@smithy/util-body-length-node/dist-es/calculateBodyLength.js"() {
    init_import_meta_url();
    calculateBodyLength = /* @__PURE__ */ __name((body) => {
      if (!body) {
        return 0;
      }
      if (typeof body === "string") {
        return Buffer.byteLength(body);
      } else if (typeof body.byteLength === "number") {
        return body.byteLength;
      } else if (typeof body.size === "number") {
        return body.size;
      } else if (typeof body.start === "number" && typeof body.end === "number") {
        return body.end + 1 - body.start;
      } else if (typeof body.path === "string" || Buffer.isBuffer(body.path)) {
        return fs29.lstatSync(body.path).size;
      } else if (typeof body.fd === "number") {
        return fs29.fstatSync(body.fd).size;
      }
      throw new Error(`Body Length computation failed for ${body}`);
    }, "calculateBodyLength");
  }
});

// ../../node_modules/.pnpm/@smithy+util-body-length-node@3.0.0/node_modules/@smithy/util-body-length-node/dist-es/index.js
var init_dist_es53 = __esm({
  "../../node_modules/.pnpm/@smithy+util-body-length-node@3.0.0/node_modules/@smithy/util-body-length-node/dist-es/index.js"() {
    init_import_meta_url();
    init_calculateBodyLength();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/endpoint/ruleset.js
var u4, v5, w4, x4, a4, b8, c5, d5, e6, f5, g4, h4, i4, j4, k4, l5, m4, n5, o4, p4, q4, r6, s4, t9, _data2, ruleSet2;
var init_ruleset2 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/endpoint/ruleset.js"() {
    init_import_meta_url();
    u4 = "required";
    v5 = "fn";
    w4 = "argv";
    x4 = "ref";
    a4 = true;
    b8 = "isSet";
    c5 = "booleanEquals";
    d5 = "error";
    e6 = "endpoint";
    f5 = "tree";
    g4 = "PartitionResult";
    h4 = "getAttr";
    i4 = { [u4]: false, "type": "String" };
    j4 = { [u4]: true, "default": false, "type": "Boolean" };
    k4 = { [x4]: "Endpoint" };
    l5 = { [v5]: c5, [w4]: [{ [x4]: "UseFIPS" }, true] };
    m4 = { [v5]: c5, [w4]: [{ [x4]: "UseDualStack" }, true] };
    n5 = {};
    o4 = { [v5]: h4, [w4]: [{ [x4]: g4 }, "supportsFIPS"] };
    p4 = { [x4]: g4 };
    q4 = { [v5]: c5, [w4]: [true, { [v5]: h4, [w4]: [p4, "supportsDualStack"] }] };
    r6 = [l5];
    s4 = [m4];
    t9 = [{ [x4]: "Region" }];
    _data2 = { version: "1.0", parameters: { Region: i4, UseDualStack: j4, UseFIPS: j4, Endpoint: i4 }, rules: [{ conditions: [{ [v5]: b8, [w4]: [k4] }], rules: [{ conditions: r6, error: "Invalid Configuration: FIPS and custom endpoint are not supported", type: d5 }, { conditions: s4, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", type: d5 }, { endpoint: { url: k4, properties: n5, headers: n5 }, type: e6 }], type: f5 }, { conditions: [{ [v5]: b8, [w4]: t9 }], rules: [{ conditions: [{ [v5]: "aws.partition", [w4]: t9, assign: g4 }], rules: [{ conditions: [l5, m4], rules: [{ conditions: [{ [v5]: c5, [w4]: [a4, o4] }, q4], rules: [{ endpoint: { url: "https://oidc-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: n5, headers: n5 }, type: e6 }], type: f5 }, { error: "FIPS and DualStack are enabled, but this partition does not support one or both", type: d5 }], type: f5 }, { conditions: r6, rules: [{ conditions: [{ [v5]: c5, [w4]: [o4, a4] }], rules: [{ conditions: [{ [v5]: "stringEquals", [w4]: [{ [v5]: h4, [w4]: [p4, "name"] }, "aws-us-gov"] }], endpoint: { url: "https://oidc.{Region}.amazonaws.com", properties: n5, headers: n5 }, type: e6 }, { endpoint: { url: "https://oidc-fips.{Region}.{PartitionResult#dnsSuffix}", properties: n5, headers: n5 }, type: e6 }], type: f5 }, { error: "FIPS is enabled but this partition does not support FIPS", type: d5 }], type: f5 }, { conditions: s4, rules: [{ conditions: [q4], rules: [{ endpoint: { url: "https://oidc.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: n5, headers: n5 }, type: e6 }], type: f5 }, { error: "DualStack is enabled but this partition does not support DualStack", type: d5 }], type: f5 }, { endpoint: { url: "https://oidc.{Region}.{PartitionResult#dnsSuffix}", properties: n5, headers: n5 }, type: e6 }], type: f5 }], type: f5 }, { error: "Invalid Configuration: Missing Region", type: d5 }] };
    ruleSet2 = _data2;
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/endpoint/endpointResolver.js
var cache2, defaultEndpointResolver2;
var init_endpointResolver2 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/endpoint/endpointResolver.js"() {
    init_import_meta_url();
    init_dist_es33();
    init_dist_es32();
    init_ruleset2();
    cache2 = new EndpointCache({
      size: 50,
      params: ["Endpoint", "Region", "UseDualStack", "UseFIPS"]
    });
    defaultEndpointResolver2 = /* @__PURE__ */ __name((endpointParams, context2 = {}) => {
      return cache2.get(endpointParams, () => resolveEndpoint(ruleSet2, {
        endpointParams,
        logger: context2.logger
      }));
    }, "defaultEndpointResolver");
    customEndpointFunctions.aws = awsEndpointFunctions;
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/runtimeConfig.shared.js
var getRuntimeConfig;
var init_runtimeConfig_shared = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/runtimeConfig.shared.js"() {
    init_import_meta_url();
    init_dist_es21();
    init_dist_es16();
    init_dist_es20();
    init_dist_es41();
    init_dist_es9();
    init_dist_es8();
    init_httpAuthSchemeProvider2();
    init_endpointResolver2();
    getRuntimeConfig = /* @__PURE__ */ __name((config) => {
      return {
        apiVersion: "2019-06-10",
        base64Decoder: config?.base64Decoder ?? fromBase64,
        base64Encoder: config?.base64Encoder ?? toBase64,
        disableHostPrefix: config?.disableHostPrefix ?? false,
        endpointProvider: config?.endpointProvider ?? defaultEndpointResolver2,
        extensions: config?.extensions ?? [],
        httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? defaultSSOOIDCHttpAuthSchemeProvider,
        httpAuthSchemes: config?.httpAuthSchemes ?? [
          {
            schemeId: "aws.auth#sigv4",
            identityProvider: /* @__PURE__ */ __name((ipc) => ipc.getIdentityProvider("aws.auth#sigv4"), "identityProvider"),
            signer: new AwsSdkSigV4Signer()
          },
          {
            schemeId: "smithy.api#noAuth",
            identityProvider: /* @__PURE__ */ __name((ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})), "identityProvider"),
            signer: new NoAuthSigner()
          }
        ],
        logger: config?.logger ?? new NoOpLogger(),
        serviceId: config?.serviceId ?? "SSO OIDC",
        urlParser: config?.urlParser ?? parseUrl2,
        utf8Decoder: config?.utf8Decoder ?? fromUtf8,
        utf8Encoder: config?.utf8Encoder ?? toUtf8
      };
    }, "getRuntimeConfig");
  }
});

// ../../node_modules/.pnpm/@smithy+util-defaults-mode-node@3.0.34/node_modules/@smithy/util-defaults-mode-node/dist-es/constants.js
var AWS_EXECUTION_ENV, AWS_REGION_ENV, AWS_DEFAULT_REGION_ENV, ENV_IMDS_DISABLED2, DEFAULTS_MODE_OPTIONS, IMDS_REGION_PATH;
var init_constants17 = __esm({
  "../../node_modules/.pnpm/@smithy+util-defaults-mode-node@3.0.34/node_modules/@smithy/util-defaults-mode-node/dist-es/constants.js"() {
    init_import_meta_url();
    AWS_EXECUTION_ENV = "AWS_EXECUTION_ENV";
    AWS_REGION_ENV = "AWS_REGION";
    AWS_DEFAULT_REGION_ENV = "AWS_DEFAULT_REGION";
    ENV_IMDS_DISABLED2 = "AWS_EC2_METADATA_DISABLED";
    DEFAULTS_MODE_OPTIONS = ["in-region", "cross-region", "mobile", "standard", "legacy"];
    IMDS_REGION_PATH = "/latest/meta-data/placement/region";
  }
});

// ../../node_modules/.pnpm/@smithy+util-defaults-mode-node@3.0.34/node_modules/@smithy/util-defaults-mode-node/dist-es/defaultsModeConfig.js
var AWS_DEFAULTS_MODE_ENV, AWS_DEFAULTS_MODE_CONFIG, NODE_DEFAULTS_MODE_CONFIG_OPTIONS;
var init_defaultsModeConfig = __esm({
  "../../node_modules/.pnpm/@smithy+util-defaults-mode-node@3.0.34/node_modules/@smithy/util-defaults-mode-node/dist-es/defaultsModeConfig.js"() {
    init_import_meta_url();
    AWS_DEFAULTS_MODE_ENV = "AWS_DEFAULTS_MODE";
    AWS_DEFAULTS_MODE_CONFIG = "defaults_mode";
    NODE_DEFAULTS_MODE_CONFIG_OPTIONS = {
      environmentVariableSelector: /* @__PURE__ */ __name((env6) => {
        return env6[AWS_DEFAULTS_MODE_ENV];
      }, "environmentVariableSelector"),
      configFileSelector: /* @__PURE__ */ __name((profile) => {
        return profile[AWS_DEFAULTS_MODE_CONFIG];
      }, "configFileSelector"),
      default: "legacy"
    };
  }
});

// ../../node_modules/.pnpm/@smithy+util-defaults-mode-node@3.0.34/node_modules/@smithy/util-defaults-mode-node/dist-es/resolveDefaultsModeConfig.js
var resolveDefaultsModeConfig, resolveNodeDefaultsModeAuto, inferPhysicalRegion;
var init_resolveDefaultsModeConfig = __esm({
  "../../node_modules/.pnpm/@smithy+util-defaults-mode-node@3.0.34/node_modules/@smithy/util-defaults-mode-node/dist-es/resolveDefaultsModeConfig.js"() {
    init_import_meta_url();
    init_dist_es35();
    init_dist_es39();
    init_dist_es17();
    init_constants17();
    init_defaultsModeConfig();
    resolveDefaultsModeConfig = /* @__PURE__ */ __name(({ region = loadConfig(NODE_REGION_CONFIG_OPTIONS), defaultsMode = loadConfig(NODE_DEFAULTS_MODE_CONFIG_OPTIONS) } = {}) => memoize(async () => {
      const mode = typeof defaultsMode === "function" ? await defaultsMode() : defaultsMode;
      switch (mode?.toLowerCase()) {
        case "auto":
          return resolveNodeDefaultsModeAuto(region);
        case "in-region":
        case "cross-region":
        case "mobile":
        case "standard":
        case "legacy":
          return Promise.resolve(mode?.toLocaleLowerCase());
        case void 0:
          return Promise.resolve("legacy");
        default:
          throw new Error(`Invalid parameter for "defaultsMode", expect ${DEFAULTS_MODE_OPTIONS.join(", ")}, got ${mode}`);
      }
    }), "resolveDefaultsModeConfig");
    resolveNodeDefaultsModeAuto = /* @__PURE__ */ __name(async (clientRegion) => {
      if (clientRegion) {
        const resolvedRegion = typeof clientRegion === "function" ? await clientRegion() : clientRegion;
        const inferredRegion = await inferPhysicalRegion();
        if (!inferredRegion) {
          return "standard";
        }
        if (resolvedRegion === inferredRegion) {
          return "in-region";
        } else {
          return "cross-region";
        }
      }
      return "standard";
    }, "resolveNodeDefaultsModeAuto");
    inferPhysicalRegion = /* @__PURE__ */ __name(async () => {
      if (process.env[AWS_EXECUTION_ENV] && (process.env[AWS_REGION_ENV] || process.env[AWS_DEFAULT_REGION_ENV])) {
        return process.env[AWS_REGION_ENV] ?? process.env[AWS_DEFAULT_REGION_ENV];
      }
      if (!process.env[ENV_IMDS_DISABLED2]) {
        try {
          const { getInstanceMetadataEndpoint: getInstanceMetadataEndpoint2, httpRequest: httpRequest2 } = await Promise.resolve().then(() => (init_dist_es49(), dist_es_exports2));
          const endpoint = await getInstanceMetadataEndpoint2();
          return (await httpRequest2({ ...endpoint, path: IMDS_REGION_PATH })).toString();
        } catch (e10) {
        }
      }
    }, "inferPhysicalRegion");
  }
});

// ../../node_modules/.pnpm/@smithy+util-defaults-mode-node@3.0.34/node_modules/@smithy/util-defaults-mode-node/dist-es/index.js
var init_dist_es54 = __esm({
  "../../node_modules/.pnpm/@smithy+util-defaults-mode-node@3.0.34/node_modules/@smithy/util-defaults-mode-node/dist-es/index.js"() {
    init_import_meta_url();
    init_resolveDefaultsModeConfig();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/runtimeConfig.js
var getRuntimeConfig2;
var init_runtimeConfig = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/runtimeConfig.js"() {
    init_import_meta_url();
    init_package3();
    init_dist_es21();
    init_dist_es64();
    init_dist_es51();
    init_dist_es35();
    init_dist_es52();
    init_dist_es45();
    init_dist_es39();
    init_dist_es12();
    init_dist_es53();
    init_dist_es44();
    init_runtimeConfig_shared();
    init_dist_es20();
    init_dist_es54();
    init_dist_es20();
    getRuntimeConfig2 = /* @__PURE__ */ __name((config) => {
      emitWarningIfUnsupportedVersion2(process.version);
      const defaultsMode = resolveDefaultsModeConfig(config);
      const defaultConfigProvider = /* @__PURE__ */ __name(() => defaultsMode().then(loadConfigsForDefaultMode), "defaultConfigProvider");
      const clientSharedValues = getRuntimeConfig(config);
      emitWarningIfUnsupportedVersion(process.version);
      const profileConfig = { profile: config?.profile };
      return {
        ...clientSharedValues,
        ...config,
        runtime: "node",
        defaultsMode,
        bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
        credentialDefaultProvider: config?.credentialDefaultProvider ?? defaultProvider,
        defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: package_default2.version }),
        maxAttempts: config?.maxAttempts ?? loadConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),
        region: config?.region ?? loadConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }),
        requestHandler: NodeHttpHandler.create(config?.requestHandler ?? defaultConfigProvider),
        retryMode: config?.retryMode ?? loadConfig({
          ...NODE_RETRY_MODE_CONFIG_OPTIONS,
          default: /* @__PURE__ */ __name(async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, "default")
        }, config),
        sha256: config?.sha256 ?? Hash.bind(null, "sha256"),
        streamCollector: config?.streamCollector ?? streamCollector,
        useDualstackEndpoint: config?.useDualstackEndpoint ?? loadConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig),
        useFipsEndpoint: config?.useFipsEndpoint ?? loadConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig),
        userAgentAppId: config?.userAgentAppId ?? loadConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig)
      };
    }, "getRuntimeConfig");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+region-config-resolver@3.714.0/node_modules/@aws-sdk/region-config-resolver/dist-es/extensions/index.js
var getAwsRegionExtensionConfiguration, resolveAwsRegionExtensionConfiguration;
var init_extensions4 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+region-config-resolver@3.714.0/node_modules/@aws-sdk/region-config-resolver/dist-es/extensions/index.js"() {
    init_import_meta_url();
    getAwsRegionExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => {
      let runtimeConfigRegion = /* @__PURE__ */ __name(async () => {
        if (runtimeConfig.region === void 0) {
          throw new Error("Region is missing from runtimeConfig");
        }
        const region = runtimeConfig.region;
        if (typeof region === "string") {
          return region;
        }
        return region();
      }, "runtimeConfigRegion");
      return {
        setRegion(region) {
          runtimeConfigRegion = region;
        },
        region() {
          return runtimeConfigRegion;
        }
      };
    }, "getAwsRegionExtensionConfiguration");
    resolveAwsRegionExtensionConfiguration = /* @__PURE__ */ __name((awsRegionExtensionConfiguration) => {
      return {
        region: awsRegionExtensionConfiguration.region()
      };
    }, "resolveAwsRegionExtensionConfiguration");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+region-config-resolver@3.714.0/node_modules/@aws-sdk/region-config-resolver/dist-es/regionConfig/config.js
var init_config11 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+region-config-resolver@3.714.0/node_modules/@aws-sdk/region-config-resolver/dist-es/regionConfig/config.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+region-config-resolver@3.714.0/node_modules/@aws-sdk/region-config-resolver/dist-es/regionConfig/isFipsRegion.js
var init_isFipsRegion2 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+region-config-resolver@3.714.0/node_modules/@aws-sdk/region-config-resolver/dist-es/regionConfig/isFipsRegion.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+region-config-resolver@3.714.0/node_modules/@aws-sdk/region-config-resolver/dist-es/regionConfig/getRealRegion.js
var init_getRealRegion2 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+region-config-resolver@3.714.0/node_modules/@aws-sdk/region-config-resolver/dist-es/regionConfig/getRealRegion.js"() {
    init_import_meta_url();
    init_isFipsRegion2();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+region-config-resolver@3.714.0/node_modules/@aws-sdk/region-config-resolver/dist-es/regionConfig/resolveRegionConfig.js
var init_resolveRegionConfig2 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+region-config-resolver@3.714.0/node_modules/@aws-sdk/region-config-resolver/dist-es/regionConfig/resolveRegionConfig.js"() {
    init_import_meta_url();
    init_getRealRegion2();
    init_isFipsRegion2();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+region-config-resolver@3.714.0/node_modules/@aws-sdk/region-config-resolver/dist-es/regionConfig/index.js
var init_regionConfig2 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+region-config-resolver@3.714.0/node_modules/@aws-sdk/region-config-resolver/dist-es/regionConfig/index.js"() {
    init_import_meta_url();
    init_config11();
    init_resolveRegionConfig2();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+region-config-resolver@3.714.0/node_modules/@aws-sdk/region-config-resolver/dist-es/index.js
var init_dist_es55 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+region-config-resolver@3.714.0/node_modules/@aws-sdk/region-config-resolver/dist-es/index.js"() {
    init_import_meta_url();
    init_extensions4();
    init_regionConfig2();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/auth/httpAuthExtensionConfiguration.js
var getHttpAuthExtensionConfiguration, resolveHttpAuthRuntimeConfig;
var init_httpAuthExtensionConfiguration = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/auth/httpAuthExtensionConfiguration.js"() {
    init_import_meta_url();
    getHttpAuthExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => {
      const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
      let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
      let _credentials = runtimeConfig.credentials;
      return {
        setHttpAuthScheme(httpAuthScheme) {
          const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
          if (index === -1) {
            _httpAuthSchemes.push(httpAuthScheme);
          } else {
            _httpAuthSchemes.splice(index, 1, httpAuthScheme);
          }
        },
        httpAuthSchemes() {
          return _httpAuthSchemes;
        },
        setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
          _httpAuthSchemeProvider = httpAuthSchemeProvider;
        },
        httpAuthSchemeProvider() {
          return _httpAuthSchemeProvider;
        },
        setCredentials(credentials) {
          _credentials = credentials;
        },
        credentials() {
          return _credentials;
        }
      };
    }, "getHttpAuthExtensionConfiguration");
    resolveHttpAuthRuntimeConfig = /* @__PURE__ */ __name((config) => {
      return {
        httpAuthSchemes: config.httpAuthSchemes(),
        httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
        credentials: config.credentials()
      };
    }, "resolveHttpAuthRuntimeConfig");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/runtimeExtensions.js
var asPartial, resolveRuntimeExtensions;
var init_runtimeExtensions = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/runtimeExtensions.js"() {
    init_import_meta_url();
    init_dist_es55();
    init_dist_es2();
    init_dist_es20();
    init_httpAuthExtensionConfiguration();
    asPartial = /* @__PURE__ */ __name((t13) => t13, "asPartial");
    resolveRuntimeExtensions = /* @__PURE__ */ __name((runtimeConfig, extensions) => {
      const extensionConfiguration = {
        ...asPartial(getAwsRegionExtensionConfiguration(runtimeConfig)),
        ...asPartial(getDefaultExtensionConfiguration(runtimeConfig)),
        ...asPartial(getHttpHandlerExtensionConfiguration(runtimeConfig)),
        ...asPartial(getHttpAuthExtensionConfiguration(runtimeConfig))
      };
      extensions.forEach((extension) => extension.configure(extensionConfiguration));
      return {
        ...runtimeConfig,
        ...resolveAwsRegionExtensionConfiguration(extensionConfiguration),
        ...resolveDefaultRuntimeConfig(extensionConfiguration),
        ...resolveHttpHandlerRuntimeConfig(extensionConfiguration),
        ...resolveHttpAuthRuntimeConfig(extensionConfiguration)
      };
    }, "resolveRuntimeExtensions");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/SSOOIDCClient.js
var SSOOIDCClient;
var init_SSOOIDCClient = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/SSOOIDCClient.js"() {
    init_import_meta_url();
    init_dist_es26();
    init_dist_es27();
    init_dist_es28();
    init_dist_es34();
    init_dist_es35();
    init_dist_es16();
    init_dist_es37();
    init_dist_es42();
    init_dist_es45();
    init_dist_es20();
    init_httpAuthSchemeProvider2();
    init_EndpointParameters2();
    init_runtimeConfig();
    init_runtimeExtensions();
    SSOOIDCClient = class extends Client {
      static {
        __name(this, "SSOOIDCClient");
      }
      constructor(...[configuration]) {
        const _config_0 = getRuntimeConfig2(configuration || {});
        const _config_1 = resolveClientEndpointParameters2(_config_0);
        const _config_2 = resolveUserAgentConfig(_config_1);
        const _config_3 = resolveRetryConfig(_config_2);
        const _config_4 = resolveRegionConfig(_config_3);
        const _config_5 = resolveHostHeaderConfig(_config_4);
        const _config_6 = resolveEndpointConfig(_config_5);
        const _config_7 = resolveHttpAuthSchemeConfig2(_config_6);
        const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);
        super(_config_8);
        this.config = _config_8;
        this.middlewareStack.use(getUserAgentPlugin(this.config));
        this.middlewareStack.use(getRetryPlugin(this.config));
        this.middlewareStack.use(getContentLengthPlugin(this.config));
        this.middlewareStack.use(getHostHeaderPlugin(this.config));
        this.middlewareStack.use(getLoggerPlugin(this.config));
        this.middlewareStack.use(getRecursionDetectionPlugin(this.config));
        this.middlewareStack.use(getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {
          httpAuthSchemeParametersProvider: defaultSSOOIDCHttpAuthSchemeParametersProvider,
          identityProviderConfigProvider: /* @__PURE__ */ __name(async (config) => new DefaultIdentityProviderConfig({
            "aws.auth#sigv4": config.credentials
          }), "identityProviderConfigProvider")
        }));
        this.middlewareStack.use(getHttpSigningPlugin(this.config));
      }
      destroy() {
        super.destroy();
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/models/SSOOIDCServiceException.js
var SSOOIDCServiceException;
var init_SSOOIDCServiceException = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/models/SSOOIDCServiceException.js"() {
    init_import_meta_url();
    init_dist_es20();
    SSOOIDCServiceException = class _SSOOIDCServiceException extends ServiceException {
      static {
        __name(this, "SSOOIDCServiceException");
      }
      constructor(options) {
        super(options);
        Object.setPrototypeOf(this, _SSOOIDCServiceException.prototype);
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/models/models_0.js
var AccessDeniedException, AuthorizationPendingException, ExpiredTokenException, InternalServerException, InvalidClientException, InvalidGrantException, InvalidRequestException, InvalidScopeException, SlowDownException, UnauthorizedClientException, UnsupportedGrantTypeException, InvalidRequestRegionException, InvalidClientMetadataException, InvalidRedirectUriException, CreateTokenRequestFilterSensitiveLog, CreateTokenResponseFilterSensitiveLog, CreateTokenWithIAMRequestFilterSensitiveLog, CreateTokenWithIAMResponseFilterSensitiveLog, RegisterClientResponseFilterSensitiveLog, StartDeviceAuthorizationRequestFilterSensitiveLog;
var init_models_02 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/models/models_0.js"() {
    init_import_meta_url();
    init_dist_es20();
    init_SSOOIDCServiceException();
    AccessDeniedException = class _AccessDeniedException extends SSOOIDCServiceException {
      static {
        __name(this, "AccessDeniedException");
      }
      constructor(opts) {
        super({
          name: "AccessDeniedException",
          $fault: "client",
          ...opts
        });
        this.name = "AccessDeniedException";
        this.$fault = "client";
        Object.setPrototypeOf(this, _AccessDeniedException.prototype);
        this.error = opts.error;
        this.error_description = opts.error_description;
      }
    };
    AuthorizationPendingException = class _AuthorizationPendingException extends SSOOIDCServiceException {
      static {
        __name(this, "AuthorizationPendingException");
      }
      constructor(opts) {
        super({
          name: "AuthorizationPendingException",
          $fault: "client",
          ...opts
        });
        this.name = "AuthorizationPendingException";
        this.$fault = "client";
        Object.setPrototypeOf(this, _AuthorizationPendingException.prototype);
        this.error = opts.error;
        this.error_description = opts.error_description;
      }
    };
    ExpiredTokenException = class _ExpiredTokenException extends SSOOIDCServiceException {
      static {
        __name(this, "ExpiredTokenException");
      }
      constructor(opts) {
        super({
          name: "ExpiredTokenException",
          $fault: "client",
          ...opts
        });
        this.name = "ExpiredTokenException";
        this.$fault = "client";
        Object.setPrototypeOf(this, _ExpiredTokenException.prototype);
        this.error = opts.error;
        this.error_description = opts.error_description;
      }
    };
    InternalServerException = class _InternalServerException extends SSOOIDCServiceException {
      static {
        __name(this, "InternalServerException");
      }
      constructor(opts) {
        super({
          name: "InternalServerException",
          $fault: "server",
          ...opts
        });
        this.name = "InternalServerException";
        this.$fault = "server";
        Object.setPrototypeOf(this, _InternalServerException.prototype);
        this.error = opts.error;
        this.error_description = opts.error_description;
      }
    };
    InvalidClientException = class _InvalidClientException extends SSOOIDCServiceException {
      static {
        __name(this, "InvalidClientException");
      }
      constructor(opts) {
        super({
          name: "InvalidClientException",
          $fault: "client",
          ...opts
        });
        this.name = "InvalidClientException";
        this.$fault = "client";
        Object.setPrototypeOf(this, _InvalidClientException.prototype);
        this.error = opts.error;
        this.error_description = opts.error_description;
      }
    };
    InvalidGrantException = class _InvalidGrantException extends SSOOIDCServiceException {
      static {
        __name(this, "InvalidGrantException");
      }
      constructor(opts) {
        super({
          name: "InvalidGrantException",
          $fault: "client",
          ...opts
        });
        this.name = "InvalidGrantException";
        this.$fault = "client";
        Object.setPrototypeOf(this, _InvalidGrantException.prototype);
        this.error = opts.error;
        this.error_description = opts.error_description;
      }
    };
    InvalidRequestException = class _InvalidRequestException extends SSOOIDCServiceException {
      static {
        __name(this, "InvalidRequestException");
      }
      constructor(opts) {
        super({
          name: "InvalidRequestException",
          $fault: "client",
          ...opts
        });
        this.name = "InvalidRequestException";
        this.$fault = "client";
        Object.setPrototypeOf(this, _InvalidRequestException.prototype);
        this.error = opts.error;
        this.error_description = opts.error_description;
      }
    };
    InvalidScopeException = class _InvalidScopeException extends SSOOIDCServiceException {
      static {
        __name(this, "InvalidScopeException");
      }
      constructor(opts) {
        super({
          name: "InvalidScopeException",
          $fault: "client",
          ...opts
        });
        this.name = "InvalidScopeException";
        this.$fault = "client";
        Object.setPrototypeOf(this, _InvalidScopeException.prototype);
        this.error = opts.error;
        this.error_description = opts.error_description;
      }
    };
    SlowDownException = class _SlowDownException extends SSOOIDCServiceException {
      static {
        __name(this, "SlowDownException");
      }
      constructor(opts) {
        super({
          name: "SlowDownException",
          $fault: "client",
          ...opts
        });
        this.name = "SlowDownException";
        this.$fault = "client";
        Object.setPrototypeOf(this, _SlowDownException.prototype);
        this.error = opts.error;
        this.error_description = opts.error_description;
      }
    };
    UnauthorizedClientException = class _UnauthorizedClientException extends SSOOIDCServiceException {
      static {
        __name(this, "UnauthorizedClientException");
      }
      constructor(opts) {
        super({
          name: "UnauthorizedClientException",
          $fault: "client",
          ...opts
        });
        this.name = "UnauthorizedClientException";
        this.$fault = "client";
        Object.setPrototypeOf(this, _UnauthorizedClientException.prototype);
        this.error = opts.error;
        this.error_description = opts.error_description;
      }
    };
    UnsupportedGrantTypeException = class _UnsupportedGrantTypeException extends SSOOIDCServiceException {
      static {
        __name(this, "UnsupportedGrantTypeException");
      }
      constructor(opts) {
        super({
          name: "UnsupportedGrantTypeException",
          $fault: "client",
          ...opts
        });
        this.name = "UnsupportedGrantTypeException";
        this.$fault = "client";
        Object.setPrototypeOf(this, _UnsupportedGrantTypeException.prototype);
        this.error = opts.error;
        this.error_description = opts.error_description;
      }
    };
    InvalidRequestRegionException = class _InvalidRequestRegionException extends SSOOIDCServiceException {
      static {
        __name(this, "InvalidRequestRegionException");
      }
      constructor(opts) {
        super({
          name: "InvalidRequestRegionException",
          $fault: "client",
          ...opts
        });
        this.name = "InvalidRequestRegionException";
        this.$fault = "client";
        Object.setPrototypeOf(this, _InvalidRequestRegionException.prototype);
        this.error = opts.error;
        this.error_description = opts.error_description;
        this.endpoint = opts.endpoint;
        this.region = opts.region;
      }
    };
    InvalidClientMetadataException = class _InvalidClientMetadataException extends SSOOIDCServiceException {
      static {
        __name(this, "InvalidClientMetadataException");
      }
      constructor(opts) {
        super({
          name: "InvalidClientMetadataException",
          $fault: "client",
          ...opts
        });
        this.name = "InvalidClientMetadataException";
        this.$fault = "client";
        Object.setPrototypeOf(this, _InvalidClientMetadataException.prototype);
        this.error = opts.error;
        this.error_description = opts.error_description;
      }
    };
    InvalidRedirectUriException = class _InvalidRedirectUriException extends SSOOIDCServiceException {
      static {
        __name(this, "InvalidRedirectUriException");
      }
      constructor(opts) {
        super({
          name: "InvalidRedirectUriException",
          $fault: "client",
          ...opts
        });
        this.name = "InvalidRedirectUriException";
        this.$fault = "client";
        Object.setPrototypeOf(this, _InvalidRedirectUriException.prototype);
        this.error = opts.error;
        this.error_description = opts.error_description;
      }
    };
    CreateTokenRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
      ...obj,
      ...obj.clientSecret && { clientSecret: SENSITIVE_STRING },
      ...obj.refreshToken && { refreshToken: SENSITIVE_STRING },
      ...obj.codeVerifier && { codeVerifier: SENSITIVE_STRING }
    }), "CreateTokenRequestFilterSensitiveLog");
    CreateTokenResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
      ...obj,
      ...obj.accessToken && { accessToken: SENSITIVE_STRING },
      ...obj.refreshToken && { refreshToken: SENSITIVE_STRING },
      ...obj.idToken && { idToken: SENSITIVE_STRING }
    }), "CreateTokenResponseFilterSensitiveLog");
    CreateTokenWithIAMRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
      ...obj,
      ...obj.refreshToken && { refreshToken: SENSITIVE_STRING },
      ...obj.assertion && { assertion: SENSITIVE_STRING },
      ...obj.subjectToken && { subjectToken: SENSITIVE_STRING },
      ...obj.codeVerifier && { codeVerifier: SENSITIVE_STRING }
    }), "CreateTokenWithIAMRequestFilterSensitiveLog");
    CreateTokenWithIAMResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
      ...obj,
      ...obj.accessToken && { accessToken: SENSITIVE_STRING },
      ...obj.refreshToken && { refreshToken: SENSITIVE_STRING },
      ...obj.idToken && { idToken: SENSITIVE_STRING }
    }), "CreateTokenWithIAMResponseFilterSensitiveLog");
    RegisterClientResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
      ...obj,
      ...obj.clientSecret && { clientSecret: SENSITIVE_STRING }
    }), "RegisterClientResponseFilterSensitiveLog");
    StartDeviceAuthorizationRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
      ...obj,
      ...obj.clientSecret && { clientSecret: SENSITIVE_STRING }
    }), "StartDeviceAuthorizationRequestFilterSensitiveLog");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/protocols/Aws_restJson1.js
var se_CreateTokenCommand, se_CreateTokenWithIAMCommand, se_RegisterClientCommand, se_StartDeviceAuthorizationCommand, de_CreateTokenCommand, de_CreateTokenWithIAMCommand, de_RegisterClientCommand, de_StartDeviceAuthorizationCommand, de_CommandError2, throwDefaultError3, de_AccessDeniedExceptionRes, de_AuthorizationPendingExceptionRes, de_ExpiredTokenExceptionRes, de_InternalServerExceptionRes, de_InvalidClientExceptionRes, de_InvalidClientMetadataExceptionRes, de_InvalidGrantExceptionRes, de_InvalidRedirectUriExceptionRes, de_InvalidRequestExceptionRes, de_InvalidRequestRegionExceptionRes, de_InvalidScopeExceptionRes, de_SlowDownExceptionRes, de_UnauthorizedClientExceptionRes, de_UnsupportedGrantTypeExceptionRes, deserializeMetadata3, _ai;
var init_Aws_restJson1 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/protocols/Aws_restJson1.js"() {
    init_import_meta_url();
    init_dist_es21();
    init_dist_es16();
    init_dist_es20();
    init_models_02();
    init_SSOOIDCServiceException();
    se_CreateTokenCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = {
        "content-type": "application/json"
      };
      b11.bp("/token");
      let body;
      body = JSON.stringify(take(input, {
        clientId: [],
        clientSecret: [],
        code: [],
        codeVerifier: [],
        deviceCode: [],
        grantType: [],
        redirectUri: [],
        refreshToken: [],
        scope: /* @__PURE__ */ __name((_5) => _json(_5), "scope")
      }));
      b11.m("POST").h(headers).b(body);
      return b11.build();
    }, "se_CreateTokenCommand");
    se_CreateTokenWithIAMCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = {
        "content-type": "application/json"
      };
      b11.bp("/token");
      const query = map({
        [_ai]: [, "t"]
      });
      let body;
      body = JSON.stringify(take(input, {
        assertion: [],
        clientId: [],
        code: [],
        codeVerifier: [],
        grantType: [],
        redirectUri: [],
        refreshToken: [],
        requestedTokenType: [],
        scope: /* @__PURE__ */ __name((_5) => _json(_5), "scope"),
        subjectToken: [],
        subjectTokenType: []
      }));
      b11.m("POST").h(headers).q(query).b(body);
      return b11.build();
    }, "se_CreateTokenWithIAMCommand");
    se_RegisterClientCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = {
        "content-type": "application/json"
      };
      b11.bp("/client/register");
      let body;
      body = JSON.stringify(take(input, {
        clientName: [],
        clientType: [],
        entitledApplicationArn: [],
        grantTypes: /* @__PURE__ */ __name((_5) => _json(_5), "grantTypes"),
        issuerUrl: [],
        redirectUris: /* @__PURE__ */ __name((_5) => _json(_5), "redirectUris"),
        scopes: /* @__PURE__ */ __name((_5) => _json(_5), "scopes")
      }));
      b11.m("POST").h(headers).b(body);
      return b11.build();
    }, "se_RegisterClientCommand");
    se_StartDeviceAuthorizationCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = {
        "content-type": "application/json"
      };
      b11.bp("/device_authorization");
      let body;
      body = JSON.stringify(take(input, {
        clientId: [],
        clientSecret: [],
        startUrl: []
      }));
      b11.m("POST").h(headers).b(body);
      return b11.build();
    }, "se_StartDeviceAuthorizationCommand");
    de_CreateTokenCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError2(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata3(output)
      });
      const data = expectNonNull(expectObject(await parseJsonBody(output.body, context2)), "body");
      const doc = take(data, {
        accessToken: expectString,
        expiresIn: expectInt32,
        idToken: expectString,
        refreshToken: expectString,
        tokenType: expectString
      });
      Object.assign(contents, doc);
      return contents;
    }, "de_CreateTokenCommand");
    de_CreateTokenWithIAMCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError2(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata3(output)
      });
      const data = expectNonNull(expectObject(await parseJsonBody(output.body, context2)), "body");
      const doc = take(data, {
        accessToken: expectString,
        expiresIn: expectInt32,
        idToken: expectString,
        issuedTokenType: expectString,
        refreshToken: expectString,
        scope: _json,
        tokenType: expectString
      });
      Object.assign(contents, doc);
      return contents;
    }, "de_CreateTokenWithIAMCommand");
    de_RegisterClientCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError2(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata3(output)
      });
      const data = expectNonNull(expectObject(await parseJsonBody(output.body, context2)), "body");
      const doc = take(data, {
        authorizationEndpoint: expectString,
        clientId: expectString,
        clientIdIssuedAt: expectLong,
        clientSecret: expectString,
        clientSecretExpiresAt: expectLong,
        tokenEndpoint: expectString
      });
      Object.assign(contents, doc);
      return contents;
    }, "de_RegisterClientCommand");
    de_StartDeviceAuthorizationCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError2(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata3(output)
      });
      const data = expectNonNull(expectObject(await parseJsonBody(output.body, context2)), "body");
      const doc = take(data, {
        deviceCode: expectString,
        expiresIn: expectInt32,
        interval: expectInt32,
        userCode: expectString,
        verificationUri: expectString,
        verificationUriComplete: expectString
      });
      Object.assign(contents, doc);
      return contents;
    }, "de_StartDeviceAuthorizationCommand");
    de_CommandError2 = /* @__PURE__ */ __name(async (output, context2) => {
      const parsedOutput = {
        ...output,
        body: await parseJsonErrorBody(output.body, context2)
      };
      const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
      switch (errorCode) {
        case "AccessDeniedException":
        case "com.amazonaws.ssooidc#AccessDeniedException":
          throw await de_AccessDeniedExceptionRes(parsedOutput, context2);
        case "AuthorizationPendingException":
        case "com.amazonaws.ssooidc#AuthorizationPendingException":
          throw await de_AuthorizationPendingExceptionRes(parsedOutput, context2);
        case "ExpiredTokenException":
        case "com.amazonaws.ssooidc#ExpiredTokenException":
          throw await de_ExpiredTokenExceptionRes(parsedOutput, context2);
        case "InternalServerException":
        case "com.amazonaws.ssooidc#InternalServerException":
          throw await de_InternalServerExceptionRes(parsedOutput, context2);
        case "InvalidClientException":
        case "com.amazonaws.ssooidc#InvalidClientException":
          throw await de_InvalidClientExceptionRes(parsedOutput, context2);
        case "InvalidGrantException":
        case "com.amazonaws.ssooidc#InvalidGrantException":
          throw await de_InvalidGrantExceptionRes(parsedOutput, context2);
        case "InvalidRequestException":
        case "com.amazonaws.ssooidc#InvalidRequestException":
          throw await de_InvalidRequestExceptionRes(parsedOutput, context2);
        case "InvalidScopeException":
        case "com.amazonaws.ssooidc#InvalidScopeException":
          throw await de_InvalidScopeExceptionRes(parsedOutput, context2);
        case "SlowDownException":
        case "com.amazonaws.ssooidc#SlowDownException":
          throw await de_SlowDownExceptionRes(parsedOutput, context2);
        case "UnauthorizedClientException":
        case "com.amazonaws.ssooidc#UnauthorizedClientException":
          throw await de_UnauthorizedClientExceptionRes(parsedOutput, context2);
        case "UnsupportedGrantTypeException":
        case "com.amazonaws.ssooidc#UnsupportedGrantTypeException":
          throw await de_UnsupportedGrantTypeExceptionRes(parsedOutput, context2);
        case "InvalidRequestRegionException":
        case "com.amazonaws.ssooidc#InvalidRequestRegionException":
          throw await de_InvalidRequestRegionExceptionRes(parsedOutput, context2);
        case "InvalidClientMetadataException":
        case "com.amazonaws.ssooidc#InvalidClientMetadataException":
          throw await de_InvalidClientMetadataExceptionRes(parsedOutput, context2);
        case "InvalidRedirectUriException":
        case "com.amazonaws.ssooidc#InvalidRedirectUriException":
          throw await de_InvalidRedirectUriExceptionRes(parsedOutput, context2);
        default:
          const parsedBody = parsedOutput.body;
          return throwDefaultError3({
            output,
            parsedBody,
            errorCode
          });
      }
    }, "de_CommandError");
    throwDefaultError3 = withBaseException(SSOOIDCServiceException);
    de_AccessDeniedExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context2) => {
      const contents = map({});
      const data = parsedOutput.body;
      const doc = take(data, {
        error: expectString,
        error_description: expectString
      });
      Object.assign(contents, doc);
      const exception = new AccessDeniedException({
        $metadata: deserializeMetadata3(parsedOutput),
        ...contents
      });
      return decorateServiceException(exception, parsedOutput.body);
    }, "de_AccessDeniedExceptionRes");
    de_AuthorizationPendingExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context2) => {
      const contents = map({});
      const data = parsedOutput.body;
      const doc = take(data, {
        error: expectString,
        error_description: expectString
      });
      Object.assign(contents, doc);
      const exception = new AuthorizationPendingException({
        $metadata: deserializeMetadata3(parsedOutput),
        ...contents
      });
      return decorateServiceException(exception, parsedOutput.body);
    }, "de_AuthorizationPendingExceptionRes");
    de_ExpiredTokenExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context2) => {
      const contents = map({});
      const data = parsedOutput.body;
      const doc = take(data, {
        error: expectString,
        error_description: expectString
      });
      Object.assign(contents, doc);
      const exception = new ExpiredTokenException({
        $metadata: deserializeMetadata3(parsedOutput),
        ...contents
      });
      return decorateServiceException(exception, parsedOutput.body);
    }, "de_ExpiredTokenExceptionRes");
    de_InternalServerExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context2) => {
      const contents = map({});
      const data = parsedOutput.body;
      const doc = take(data, {
        error: expectString,
        error_description: expectString
      });
      Object.assign(contents, doc);
      const exception = new InternalServerException({
        $metadata: deserializeMetadata3(parsedOutput),
        ...contents
      });
      return decorateServiceException(exception, parsedOutput.body);
    }, "de_InternalServerExceptionRes");
    de_InvalidClientExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context2) => {
      const contents = map({});
      const data = parsedOutput.body;
      const doc = take(data, {
        error: expectString,
        error_description: expectString
      });
      Object.assign(contents, doc);
      const exception = new InvalidClientException({
        $metadata: deserializeMetadata3(parsedOutput),
        ...contents
      });
      return decorateServiceException(exception, parsedOutput.body);
    }, "de_InvalidClientExceptionRes");
    de_InvalidClientMetadataExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context2) => {
      const contents = map({});
      const data = parsedOutput.body;
      const doc = take(data, {
        error: expectString,
        error_description: expectString
      });
      Object.assign(contents, doc);
      const exception = new InvalidClientMetadataException({
        $metadata: deserializeMetadata3(parsedOutput),
        ...contents
      });
      return decorateServiceException(exception, parsedOutput.body);
    }, "de_InvalidClientMetadataExceptionRes");
    de_InvalidGrantExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context2) => {
      const contents = map({});
      const data = parsedOutput.body;
      const doc = take(data, {
        error: expectString,
        error_description: expectString
      });
      Object.assign(contents, doc);
      const exception = new InvalidGrantException({
        $metadata: deserializeMetadata3(parsedOutput),
        ...contents
      });
      return decorateServiceException(exception, parsedOutput.body);
    }, "de_InvalidGrantExceptionRes");
    de_InvalidRedirectUriExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context2) => {
      const contents = map({});
      const data = parsedOutput.body;
      const doc = take(data, {
        error: expectString,
        error_description: expectString
      });
      Object.assign(contents, doc);
      const exception = new InvalidRedirectUriException({
        $metadata: deserializeMetadata3(parsedOutput),
        ...contents
      });
      return decorateServiceException(exception, parsedOutput.body);
    }, "de_InvalidRedirectUriExceptionRes");
    de_InvalidRequestExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context2) => {
      const contents = map({});
      const data = parsedOutput.body;
      const doc = take(data, {
        error: expectString,
        error_description: expectString
      });
      Object.assign(contents, doc);
      const exception = new InvalidRequestException({
        $metadata: deserializeMetadata3(parsedOutput),
        ...contents
      });
      return decorateServiceException(exception, parsedOutput.body);
    }, "de_InvalidRequestExceptionRes");
    de_InvalidRequestRegionExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context2) => {
      const contents = map({});
      const data = parsedOutput.body;
      const doc = take(data, {
        endpoint: expectString,
        error: expectString,
        error_description: expectString,
        region: expectString
      });
      Object.assign(contents, doc);
      const exception = new InvalidRequestRegionException({
        $metadata: deserializeMetadata3(parsedOutput),
        ...contents
      });
      return decorateServiceException(exception, parsedOutput.body);
    }, "de_InvalidRequestRegionExceptionRes");
    de_InvalidScopeExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context2) => {
      const contents = map({});
      const data = parsedOutput.body;
      const doc = take(data, {
        error: expectString,
        error_description: expectString
      });
      Object.assign(contents, doc);
      const exception = new InvalidScopeException({
        $metadata: deserializeMetadata3(parsedOutput),
        ...contents
      });
      return decorateServiceException(exception, parsedOutput.body);
    }, "de_InvalidScopeExceptionRes");
    de_SlowDownExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context2) => {
      const contents = map({});
      const data = parsedOutput.body;
      const doc = take(data, {
        error: expectString,
        error_description: expectString
      });
      Object.assign(contents, doc);
      const exception = new SlowDownException({
        $metadata: deserializeMetadata3(parsedOutput),
        ...contents
      });
      return decorateServiceException(exception, parsedOutput.body);
    }, "de_SlowDownExceptionRes");
    de_UnauthorizedClientExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context2) => {
      const contents = map({});
      const data = parsedOutput.body;
      const doc = take(data, {
        error: expectString,
        error_description: expectString
      });
      Object.assign(contents, doc);
      const exception = new UnauthorizedClientException({
        $metadata: deserializeMetadata3(parsedOutput),
        ...contents
      });
      return decorateServiceException(exception, parsedOutput.body);
    }, "de_UnauthorizedClientExceptionRes");
    de_UnsupportedGrantTypeExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context2) => {
      const contents = map({});
      const data = parsedOutput.body;
      const doc = take(data, {
        error: expectString,
        error_description: expectString
      });
      Object.assign(contents, doc);
      const exception = new UnsupportedGrantTypeException({
        $metadata: deserializeMetadata3(parsedOutput),
        ...contents
      });
      return decorateServiceException(exception, parsedOutput.body);
    }, "de_UnsupportedGrantTypeExceptionRes");
    deserializeMetadata3 = /* @__PURE__ */ __name((output) => ({
      httpStatusCode: output.statusCode,
      requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
      extendedRequestId: output.headers["x-amz-id-2"],
      cfId: output.headers["x-amz-cf-id"]
    }), "deserializeMetadata");
    _ai = "aws_iam";
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/commands/CreateTokenCommand.js
var CreateTokenCommand;
var init_CreateTokenCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/commands/CreateTokenCommand.js"() {
    init_import_meta_url();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters2();
    init_models_02();
    init_Aws_restJson1();
    CreateTokenCommand = class extends Command.classBuilder().ep(commonParams2).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions())
      ];
    }).s("AWSSSOOIDCService", "CreateToken", {}).n("SSOOIDCClient", "CreateTokenCommand").f(CreateTokenRequestFilterSensitiveLog, CreateTokenResponseFilterSensitiveLog).ser(se_CreateTokenCommand).de(de_CreateTokenCommand).build() {
      static {
        __name(this, "CreateTokenCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/commands/CreateTokenWithIAMCommand.js
var CreateTokenWithIAMCommand;
var init_CreateTokenWithIAMCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/commands/CreateTokenWithIAMCommand.js"() {
    init_import_meta_url();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters2();
    init_models_02();
    init_Aws_restJson1();
    CreateTokenWithIAMCommand = class extends Command.classBuilder().ep(commonParams2).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions())
      ];
    }).s("AWSSSOOIDCService", "CreateTokenWithIAM", {}).n("SSOOIDCClient", "CreateTokenWithIAMCommand").f(CreateTokenWithIAMRequestFilterSensitiveLog, CreateTokenWithIAMResponseFilterSensitiveLog).ser(se_CreateTokenWithIAMCommand).de(de_CreateTokenWithIAMCommand).build() {
      static {
        __name(this, "CreateTokenWithIAMCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/commands/RegisterClientCommand.js
var RegisterClientCommand;
var init_RegisterClientCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/commands/RegisterClientCommand.js"() {
    init_import_meta_url();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters2();
    init_models_02();
    init_Aws_restJson1();
    RegisterClientCommand = class extends Command.classBuilder().ep(commonParams2).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions())
      ];
    }).s("AWSSSOOIDCService", "RegisterClient", {}).n("SSOOIDCClient", "RegisterClientCommand").f(void 0, RegisterClientResponseFilterSensitiveLog).ser(se_RegisterClientCommand).de(de_RegisterClientCommand).build() {
      static {
        __name(this, "RegisterClientCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/commands/StartDeviceAuthorizationCommand.js
var StartDeviceAuthorizationCommand;
var init_StartDeviceAuthorizationCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/commands/StartDeviceAuthorizationCommand.js"() {
    init_import_meta_url();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters2();
    init_models_02();
    init_Aws_restJson1();
    StartDeviceAuthorizationCommand = class extends Command.classBuilder().ep(commonParams2).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions())
      ];
    }).s("AWSSSOOIDCService", "StartDeviceAuthorization", {}).n("SSOOIDCClient", "StartDeviceAuthorizationCommand").f(StartDeviceAuthorizationRequestFilterSensitiveLog, void 0).ser(se_StartDeviceAuthorizationCommand).de(de_StartDeviceAuthorizationCommand).build() {
      static {
        __name(this, "StartDeviceAuthorizationCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/SSOOIDC.js
var commands, SSOOIDC;
var init_SSOOIDC = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/SSOOIDC.js"() {
    init_import_meta_url();
    init_dist_es20();
    init_CreateTokenCommand();
    init_CreateTokenWithIAMCommand();
    init_RegisterClientCommand();
    init_StartDeviceAuthorizationCommand();
    init_SSOOIDCClient();
    commands = {
      CreateTokenCommand,
      CreateTokenWithIAMCommand,
      RegisterClientCommand,
      StartDeviceAuthorizationCommand
    };
    SSOOIDC = class extends SSOOIDCClient {
      static {
        __name(this, "SSOOIDC");
      }
    };
    createAggregatedClient(commands, SSOOIDC);
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/commands/index.js
var init_commands5 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/commands/index.js"() {
    init_import_meta_url();
    init_CreateTokenCommand();
    init_CreateTokenWithIAMCommand();
    init_RegisterClientCommand();
    init_StartDeviceAuthorizationCommand();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/models/index.js
var init_models2 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/models/index.js"() {
    init_import_meta_url();
    init_models_02();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/index.js
var dist_es_exports4 = {};
__export(dist_es_exports4, {
  $Command: () => Command,
  AccessDeniedException: () => AccessDeniedException,
  AuthorizationPendingException: () => AuthorizationPendingException,
  CreateTokenCommand: () => CreateTokenCommand,
  CreateTokenRequestFilterSensitiveLog: () => CreateTokenRequestFilterSensitiveLog,
  CreateTokenResponseFilterSensitiveLog: () => CreateTokenResponseFilterSensitiveLog,
  CreateTokenWithIAMCommand: () => CreateTokenWithIAMCommand,
  CreateTokenWithIAMRequestFilterSensitiveLog: () => CreateTokenWithIAMRequestFilterSensitiveLog,
  CreateTokenWithIAMResponseFilterSensitiveLog: () => CreateTokenWithIAMResponseFilterSensitiveLog,
  ExpiredTokenException: () => ExpiredTokenException,
  InternalServerException: () => InternalServerException,
  InvalidClientException: () => InvalidClientException,
  InvalidClientMetadataException: () => InvalidClientMetadataException,
  InvalidGrantException: () => InvalidGrantException,
  InvalidRedirectUriException: () => InvalidRedirectUriException,
  InvalidRequestException: () => InvalidRequestException,
  InvalidRequestRegionException: () => InvalidRequestRegionException,
  InvalidScopeException: () => InvalidScopeException,
  RegisterClientCommand: () => RegisterClientCommand,
  RegisterClientResponseFilterSensitiveLog: () => RegisterClientResponseFilterSensitiveLog,
  SSOOIDC: () => SSOOIDC,
  SSOOIDCClient: () => SSOOIDCClient,
  SSOOIDCServiceException: () => SSOOIDCServiceException,
  SlowDownException: () => SlowDownException,
  StartDeviceAuthorizationCommand: () => StartDeviceAuthorizationCommand,
  StartDeviceAuthorizationRequestFilterSensitiveLog: () => StartDeviceAuthorizationRequestFilterSensitiveLog,
  UnauthorizedClientException: () => UnauthorizedClientException,
  UnsupportedGrantTypeException: () => UnsupportedGrantTypeException,
  __Client: () => Client
});
var init_dist_es56 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/index.js"() {
    init_import_meta_url();
    init_SSOOIDCClient();
    init_SSOOIDC();
    init_commands5();
    init_models2();
    init_SSOOIDCServiceException();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+token-providers@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0_/node_modules/@aws-sdk/token-providers/dist-es/getSsoOidcClient.js
var getSsoOidcClient;
var init_getSsoOidcClient = __esm({
  "../../node_modules/.pnpm/@aws-sdk+token-providers@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0_/node_modules/@aws-sdk/token-providers/dist-es/getSsoOidcClient.js"() {
    init_import_meta_url();
    getSsoOidcClient = /* @__PURE__ */ __name(async (ssoRegion, init4 = {}) => {
      const { SSOOIDCClient: SSOOIDCClient2 } = await Promise.resolve().then(() => (init_dist_es56(), dist_es_exports4));
      const ssoOidcClient = new SSOOIDCClient2(Object.assign({}, init4.clientConfig ?? {}, {
        region: ssoRegion ?? init4.clientConfig?.region,
        logger: init4.clientConfig?.logger ?? init4.parentClientConfig?.logger
      }));
      return ssoOidcClient;
    }, "getSsoOidcClient");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+token-providers@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0_/node_modules/@aws-sdk/token-providers/dist-es/getNewSsoOidcToken.js
var getNewSsoOidcToken;
var init_getNewSsoOidcToken = __esm({
  "../../node_modules/.pnpm/@aws-sdk+token-providers@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0_/node_modules/@aws-sdk/token-providers/dist-es/getNewSsoOidcToken.js"() {
    init_import_meta_url();
    init_getSsoOidcClient();
    getNewSsoOidcToken = /* @__PURE__ */ __name(async (ssoToken, ssoRegion, init4 = {}) => {
      const { CreateTokenCommand: CreateTokenCommand2 } = await Promise.resolve().then(() => (init_dist_es56(), dist_es_exports4));
      const ssoOidcClient = await getSsoOidcClient(ssoRegion, init4);
      return ssoOidcClient.send(new CreateTokenCommand2({
        clientId: ssoToken.clientId,
        clientSecret: ssoToken.clientSecret,
        refreshToken: ssoToken.refreshToken,
        grantType: "refresh_token"
      }));
    }, "getNewSsoOidcToken");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+token-providers@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0_/node_modules/@aws-sdk/token-providers/dist-es/validateTokenExpiry.js
var validateTokenExpiry;
var init_validateTokenExpiry = __esm({
  "../../node_modules/.pnpm/@aws-sdk+token-providers@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0_/node_modules/@aws-sdk/token-providers/dist-es/validateTokenExpiry.js"() {
    init_import_meta_url();
    init_dist_es17();
    init_constants16();
    validateTokenExpiry = /* @__PURE__ */ __name((token) => {
      if (token.expiration && token.expiration.getTime() < Date.now()) {
        throw new TokenProviderError(`Token is expired. ${REFRESH_MESSAGE}`, false);
      }
    }, "validateTokenExpiry");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+token-providers@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0_/node_modules/@aws-sdk/token-providers/dist-es/validateTokenKey.js
var validateTokenKey;
var init_validateTokenKey = __esm({
  "../../node_modules/.pnpm/@aws-sdk+token-providers@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0_/node_modules/@aws-sdk/token-providers/dist-es/validateTokenKey.js"() {
    init_import_meta_url();
    init_dist_es17();
    init_constants16();
    validateTokenKey = /* @__PURE__ */ __name((key, value, forRefresh = false) => {
      if (typeof value === "undefined") {
        throw new TokenProviderError(`Value not present for '${key}' in SSO Token${forRefresh ? ". Cannot refresh" : ""}. ${REFRESH_MESSAGE}`, false);
      }
    }, "validateTokenKey");
  }
});
var writeFile13, writeSSOTokenToFile;
var init_writeSSOTokenToFile = __esm({
  "../../node_modules/.pnpm/@aws-sdk+token-providers@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0_/node_modules/@aws-sdk/token-providers/dist-es/writeSSOTokenToFile.js"() {
    init_import_meta_url();
    init_dist_es38();
    ({ writeFile: writeFile13 } = fs29.promises);
    writeSSOTokenToFile = /* @__PURE__ */ __name((id, ssoToken) => {
      const tokenFilepath = getSSOTokenFilepath(id);
      const tokenString = JSON.stringify(ssoToken, null, 2);
      return writeFile13(tokenFilepath, tokenString);
    }, "writeSSOTokenToFile");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+token-providers@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0_/node_modules/@aws-sdk/token-providers/dist-es/fromSso.js
var lastRefreshAttemptTime, fromSso;
var init_fromSso = __esm({
  "../../node_modules/.pnpm/@aws-sdk+token-providers@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0_/node_modules/@aws-sdk/token-providers/dist-es/fromSso.js"() {
    init_import_meta_url();
    init_dist_es17();
    init_dist_es38();
    init_constants16();
    init_getNewSsoOidcToken();
    init_validateTokenExpiry();
    init_validateTokenKey();
    init_writeSSOTokenToFile();
    lastRefreshAttemptTime = /* @__PURE__ */ new Date(0);
    fromSso = /* @__PURE__ */ __name((_init = {}) => async ({ callerClientConfig } = {}) => {
      const init4 = {
        ..._init,
        parentClientConfig: {
          ...callerClientConfig,
          ..._init.parentClientConfig
        }
      };
      init4.logger?.debug("@aws-sdk/token-providers - fromSso");
      const profiles = await parseKnownFiles(init4);
      const profileName = getProfileName({
        profile: init4.profile ?? callerClientConfig?.profile
      });
      const profile = profiles[profileName];
      if (!profile) {
        throw new TokenProviderError(`Profile '${profileName}' could not be found in shared credentials file.`, false);
      } else if (!profile["sso_session"]) {
        throw new TokenProviderError(`Profile '${profileName}' is missing required property 'sso_session'.`);
      }
      const ssoSessionName = profile["sso_session"];
      const ssoSessions = await loadSsoSessionData(init4);
      const ssoSession = ssoSessions[ssoSessionName];
      if (!ssoSession) {
        throw new TokenProviderError(`Sso session '${ssoSessionName}' could not be found in shared credentials file.`, false);
      }
      for (const ssoSessionRequiredKey of ["sso_start_url", "sso_region"]) {
        if (!ssoSession[ssoSessionRequiredKey]) {
          throw new TokenProviderError(`Sso session '${ssoSessionName}' is missing required property '${ssoSessionRequiredKey}'.`, false);
        }
      }
      ssoSession["sso_start_url"];
      const ssoRegion = ssoSession["sso_region"];
      let ssoToken;
      try {
        ssoToken = await getSSOTokenFromFile(ssoSessionName);
      } catch (e10) {
        throw new TokenProviderError(`The SSO session token associated with profile=${profileName} was not found or is invalid. ${REFRESH_MESSAGE}`, false);
      }
      validateTokenKey("accessToken", ssoToken.accessToken);
      validateTokenKey("expiresAt", ssoToken.expiresAt);
      const { accessToken, expiresAt } = ssoToken;
      const existingToken = { token: accessToken, expiration: new Date(expiresAt) };
      if (existingToken.expiration.getTime() - Date.now() > EXPIRE_WINDOW_MS) {
        return existingToken;
      }
      if (Date.now() - lastRefreshAttemptTime.getTime() < 30 * 1e3) {
        validateTokenExpiry(existingToken);
        return existingToken;
      }
      validateTokenKey("clientId", ssoToken.clientId, true);
      validateTokenKey("clientSecret", ssoToken.clientSecret, true);
      validateTokenKey("refreshToken", ssoToken.refreshToken, true);
      try {
        lastRefreshAttemptTime.setTime(Date.now());
        const newSsoOidcToken = await getNewSsoOidcToken(ssoToken, ssoRegion, init4);
        validateTokenKey("accessToken", newSsoOidcToken.accessToken);
        validateTokenKey("expiresIn", newSsoOidcToken.expiresIn);
        const newTokenExpiration = new Date(Date.now() + newSsoOidcToken.expiresIn * 1e3);
        try {
          await writeSSOTokenToFile(ssoSessionName, {
            ...ssoToken,
            accessToken: newSsoOidcToken.accessToken,
            expiresAt: newTokenExpiration.toISOString(),
            refreshToken: newSsoOidcToken.refreshToken
          });
        } catch (error2) {
        }
        return {
          token: newSsoOidcToken.accessToken,
          expiration: newTokenExpiration
        };
      } catch (error2) {
        validateTokenExpiry(existingToken);
        return existingToken;
      }
    }, "fromSso");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+token-providers@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0_/node_modules/@aws-sdk/token-providers/dist-es/fromStatic.js
var init_fromStatic3 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+token-providers@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0_/node_modules/@aws-sdk/token-providers/dist-es/fromStatic.js"() {
    init_import_meta_url();
    init_dist_es17();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+token-providers@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0_/node_modules/@aws-sdk/token-providers/dist-es/nodeProvider.js
var init_nodeProvider = __esm({
  "../../node_modules/.pnpm/@aws-sdk+token-providers@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0_/node_modules/@aws-sdk/token-providers/dist-es/nodeProvider.js"() {
    init_import_meta_url();
    init_dist_es17();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+token-providers@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0_/node_modules/@aws-sdk/token-providers/dist-es/index.js
var init_dist_es57 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+token-providers@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0_/node_modules/@aws-sdk/token-providers/dist-es/index.js"() {
    init_import_meta_url();
    init_fromSso();
    init_fromStatic3();
    init_nodeProvider();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/auth/httpAuthSchemeProvider.js
function createAwsAuthSigv4HttpAuthOption3(authParameters) {
  return {
    schemeId: "aws.auth#sigv4",
    signingProperties: {
      name: "awsssoportal",
      region: authParameters.region
    },
    propertiesExtractor: /* @__PURE__ */ __name((config, context2) => ({
      signingProperties: {
        config,
        context: context2
      }
    }), "propertiesExtractor")
  };
}
function createSmithyApiNoAuthHttpAuthOption2(authParameters) {
  return {
    schemeId: "smithy.api#noAuth"
  };
}
var defaultSSOHttpAuthSchemeParametersProvider, defaultSSOHttpAuthSchemeProvider, resolveHttpAuthSchemeConfig3;
var init_httpAuthSchemeProvider3 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/auth/httpAuthSchemeProvider.js"() {
    init_import_meta_url();
    init_dist_es21();
    init_dist_es4();
    defaultSSOHttpAuthSchemeParametersProvider = /* @__PURE__ */ __name(async (config, context2, input) => {
      return {
        operation: getSmithyContext(context2).operation,
        region: await normalizeProvider(config.region)() || (() => {
          throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
        })()
      };
    }, "defaultSSOHttpAuthSchemeParametersProvider");
    __name(createAwsAuthSigv4HttpAuthOption3, "createAwsAuthSigv4HttpAuthOption");
    __name(createSmithyApiNoAuthHttpAuthOption2, "createSmithyApiNoAuthHttpAuthOption");
    defaultSSOHttpAuthSchemeProvider = /* @__PURE__ */ __name((authParameters) => {
      const options = [];
      switch (authParameters.operation) {
        case "GetRoleCredentials": {
          options.push(createSmithyApiNoAuthHttpAuthOption2());
          break;
        }
        case "ListAccountRoles": {
          options.push(createSmithyApiNoAuthHttpAuthOption2());
          break;
        }
        case "ListAccounts": {
          options.push(createSmithyApiNoAuthHttpAuthOption2());
          break;
        }
        case "Logout": {
          options.push(createSmithyApiNoAuthHttpAuthOption2());
          break;
        }
        default: {
          options.push(createAwsAuthSigv4HttpAuthOption3(authParameters));
        }
      }
      return options;
    }, "defaultSSOHttpAuthSchemeProvider");
    resolveHttpAuthSchemeConfig3 = /* @__PURE__ */ __name((config) => {
      const config_0 = resolveAwsSdkSigV4Config(config);
      return {
        ...config_0
      };
    }, "resolveHttpAuthSchemeConfig");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/endpoint/EndpointParameters.js
var resolveClientEndpointParameters3, commonParams3;
var init_EndpointParameters3 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/endpoint/EndpointParameters.js"() {
    init_import_meta_url();
    resolveClientEndpointParameters3 = /* @__PURE__ */ __name((options) => {
      return {
        ...options,
        useDualstackEndpoint: options.useDualstackEndpoint ?? false,
        useFipsEndpoint: options.useFipsEndpoint ?? false,
        defaultSigningName: "awsssoportal"
      };
    }, "resolveClientEndpointParameters");
    commonParams3 = {
      UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
      Endpoint: { type: "builtInParams", name: "endpoint" },
      Region: { type: "builtInParams", name: "region" },
      UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/package.json
var package_default3;
var init_package4 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/package.json"() {
    package_default3 = {
      name: "@aws-sdk/client-sso",
      description: "AWS SDK for JavaScript Sso Client for Node.js, Browser and React Native",
      version: "3.721.0",
      scripts: {
        build: "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
        "build:cjs": "node ../../scripts/compilation/inline client-sso",
        "build:es": "tsc -p tsconfig.es.json",
        "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build",
        "build:types": "tsc -p tsconfig.types.json",
        "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
        clean: "rimraf ./dist-* && rimraf *.tsbuildinfo",
        "extract:docs": "api-extractor run --local",
        "generate:client": "node ../../scripts/generate-clients/single-service --solo sso"
      },
      main: "./dist-cjs/index.js",
      types: "./dist-types/index.d.ts",
      module: "./dist-es/index.js",
      sideEffects: false,
      dependencies: {
        "@aws-crypto/sha256-browser": "5.2.0",
        "@aws-crypto/sha256-js": "5.2.0",
        "@aws-sdk/core": "3.716.0",
        "@aws-sdk/middleware-host-header": "3.714.0",
        "@aws-sdk/middleware-logger": "3.714.0",
        "@aws-sdk/middleware-recursion-detection": "3.714.0",
        "@aws-sdk/middleware-user-agent": "3.721.0",
        "@aws-sdk/region-config-resolver": "3.714.0",
        "@aws-sdk/types": "3.714.0",
        "@aws-sdk/util-endpoints": "3.714.0",
        "@aws-sdk/util-user-agent-browser": "3.714.0",
        "@aws-sdk/util-user-agent-node": "3.721.0",
        "@smithy/config-resolver": "^3.0.13",
        "@smithy/core": "^2.5.5",
        "@smithy/fetch-http-handler": "^4.1.2",
        "@smithy/hash-node": "^3.0.11",
        "@smithy/invalid-dependency": "^3.0.11",
        "@smithy/middleware-content-length": "^3.0.13",
        "@smithy/middleware-endpoint": "^3.2.6",
        "@smithy/middleware-retry": "^3.0.31",
        "@smithy/middleware-serde": "^3.0.11",
        "@smithy/middleware-stack": "^3.0.11",
        "@smithy/node-config-provider": "^3.1.12",
        "@smithy/node-http-handler": "^3.3.2",
        "@smithy/protocol-http": "^4.1.8",
        "@smithy/smithy-client": "^3.5.1",
        "@smithy/types": "^3.7.2",
        "@smithy/url-parser": "^3.0.11",
        "@smithy/util-base64": "^3.0.0",
        "@smithy/util-body-length-browser": "^3.0.0",
        "@smithy/util-body-length-node": "^3.0.0",
        "@smithy/util-defaults-mode-browser": "^3.0.31",
        "@smithy/util-defaults-mode-node": "^3.0.31",
        "@smithy/util-endpoints": "^2.1.7",
        "@smithy/util-middleware": "^3.0.11",
        "@smithy/util-retry": "^3.0.11",
        "@smithy/util-utf8": "^3.0.0",
        tslib: "^2.6.2"
      },
      devDependencies: {
        "@tsconfig/node16": "16.1.3",
        "@types/node": "^16.18.96",
        concurrently: "7.0.0",
        "downlevel-dts": "0.10.1",
        rimraf: "3.0.2",
        typescript: "~4.9.5"
      },
      engines: {
        node: ">=16.0.0"
      },
      typesVersions: {
        "<4.0": {
          "dist-types/*": [
            "dist-types/ts3.4/*"
          ]
        }
      },
      files: [
        "dist-*/**"
      ],
      author: {
        name: "AWS SDK for JavaScript Team",
        url: "https://aws.amazon.com/javascript/"
      },
      license: "Apache-2.0",
      browser: {
        "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser"
      },
      "react-native": {
        "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native"
      },
      homepage: "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-sso",
      repository: {
        type: "git",
        url: "https://github.com/aws/aws-sdk-js-v3.git",
        directory: "clients/client-sso"
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/endpoint/ruleset.js
var u5, v6, w5, x5, a5, b9, c6, d6, e7, f6, g5, h5, i5, j5, k5, l6, m5, n6, o5, p5, q5, r7, s5, t10, _data3, ruleSet3;
var init_ruleset3 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/endpoint/ruleset.js"() {
    init_import_meta_url();
    u5 = "required";
    v6 = "fn";
    w5 = "argv";
    x5 = "ref";
    a5 = true;
    b9 = "isSet";
    c6 = "booleanEquals";
    d6 = "error";
    e7 = "endpoint";
    f6 = "tree";
    g5 = "PartitionResult";
    h5 = "getAttr";
    i5 = { [u5]: false, "type": "String" };
    j5 = { [u5]: true, "default": false, "type": "Boolean" };
    k5 = { [x5]: "Endpoint" };
    l6 = { [v6]: c6, [w5]: [{ [x5]: "UseFIPS" }, true] };
    m5 = { [v6]: c6, [w5]: [{ [x5]: "UseDualStack" }, true] };
    n6 = {};
    o5 = { [v6]: h5, [w5]: [{ [x5]: g5 }, "supportsFIPS"] };
    p5 = { [x5]: g5 };
    q5 = { [v6]: c6, [w5]: [true, { [v6]: h5, [w5]: [p5, "supportsDualStack"] }] };
    r7 = [l6];
    s5 = [m5];
    t10 = [{ [x5]: "Region" }];
    _data3 = { version: "1.0", parameters: { Region: i5, UseDualStack: j5, UseFIPS: j5, Endpoint: i5 }, rules: [{ conditions: [{ [v6]: b9, [w5]: [k5] }], rules: [{ conditions: r7, error: "Invalid Configuration: FIPS and custom endpoint are not supported", type: d6 }, { conditions: s5, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", type: d6 }, { endpoint: { url: k5, properties: n6, headers: n6 }, type: e7 }], type: f6 }, { conditions: [{ [v6]: b9, [w5]: t10 }], rules: [{ conditions: [{ [v6]: "aws.partition", [w5]: t10, assign: g5 }], rules: [{ conditions: [l6, m5], rules: [{ conditions: [{ [v6]: c6, [w5]: [a5, o5] }, q5], rules: [{ endpoint: { url: "https://portal.sso-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: n6, headers: n6 }, type: e7 }], type: f6 }, { error: "FIPS and DualStack are enabled, but this partition does not support one or both", type: d6 }], type: f6 }, { conditions: r7, rules: [{ conditions: [{ [v6]: c6, [w5]: [o5, a5] }], rules: [{ conditions: [{ [v6]: "stringEquals", [w5]: [{ [v6]: h5, [w5]: [p5, "name"] }, "aws-us-gov"] }], endpoint: { url: "https://portal.sso.{Region}.amazonaws.com", properties: n6, headers: n6 }, type: e7 }, { endpoint: { url: "https://portal.sso-fips.{Region}.{PartitionResult#dnsSuffix}", properties: n6, headers: n6 }, type: e7 }], type: f6 }, { error: "FIPS is enabled but this partition does not support FIPS", type: d6 }], type: f6 }, { conditions: s5, rules: [{ conditions: [q5], rules: [{ endpoint: { url: "https://portal.sso.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: n6, headers: n6 }, type: e7 }], type: f6 }, { error: "DualStack is enabled but this partition does not support DualStack", type: d6 }], type: f6 }, { endpoint: { url: "https://portal.sso.{Region}.{PartitionResult#dnsSuffix}", properties: n6, headers: n6 }, type: e7 }], type: f6 }], type: f6 }, { error: "Invalid Configuration: Missing Region", type: d6 }] };
    ruleSet3 = _data3;
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/endpoint/endpointResolver.js
var cache3, defaultEndpointResolver3;
var init_endpointResolver3 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/endpoint/endpointResolver.js"() {
    init_import_meta_url();
    init_dist_es33();
    init_dist_es32();
    init_ruleset3();
    cache3 = new EndpointCache({
      size: 50,
      params: ["Endpoint", "Region", "UseDualStack", "UseFIPS"]
    });
    defaultEndpointResolver3 = /* @__PURE__ */ __name((endpointParams, context2 = {}) => {
      return cache3.get(endpointParams, () => resolveEndpoint(ruleSet3, {
        endpointParams,
        logger: context2.logger
      }));
    }, "defaultEndpointResolver");
    customEndpointFunctions.aws = awsEndpointFunctions;
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/runtimeConfig.shared.js
var getRuntimeConfig3;
var init_runtimeConfig_shared2 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/runtimeConfig.shared.js"() {
    init_import_meta_url();
    init_dist_es21();
    init_dist_es16();
    init_dist_es20();
    init_dist_es41();
    init_dist_es9();
    init_dist_es8();
    init_httpAuthSchemeProvider3();
    init_endpointResolver3();
    getRuntimeConfig3 = /* @__PURE__ */ __name((config) => {
      return {
        apiVersion: "2019-06-10",
        base64Decoder: config?.base64Decoder ?? fromBase64,
        base64Encoder: config?.base64Encoder ?? toBase64,
        disableHostPrefix: config?.disableHostPrefix ?? false,
        endpointProvider: config?.endpointProvider ?? defaultEndpointResolver3,
        extensions: config?.extensions ?? [],
        httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? defaultSSOHttpAuthSchemeProvider,
        httpAuthSchemes: config?.httpAuthSchemes ?? [
          {
            schemeId: "aws.auth#sigv4",
            identityProvider: /* @__PURE__ */ __name((ipc) => ipc.getIdentityProvider("aws.auth#sigv4"), "identityProvider"),
            signer: new AwsSdkSigV4Signer()
          },
          {
            schemeId: "smithy.api#noAuth",
            identityProvider: /* @__PURE__ */ __name((ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})), "identityProvider"),
            signer: new NoAuthSigner()
          }
        ],
        logger: config?.logger ?? new NoOpLogger(),
        serviceId: config?.serviceId ?? "SSO",
        urlParser: config?.urlParser ?? parseUrl2,
        utf8Decoder: config?.utf8Decoder ?? fromUtf8,
        utf8Encoder: config?.utf8Encoder ?? toUtf8
      };
    }, "getRuntimeConfig");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/runtimeConfig.js
var getRuntimeConfig4;
var init_runtimeConfig2 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/runtimeConfig.js"() {
    init_import_meta_url();
    init_package4();
    init_dist_es21();
    init_dist_es51();
    init_dist_es35();
    init_dist_es52();
    init_dist_es45();
    init_dist_es39();
    init_dist_es12();
    init_dist_es53();
    init_dist_es44();
    init_runtimeConfig_shared2();
    init_dist_es20();
    init_dist_es54();
    init_dist_es20();
    getRuntimeConfig4 = /* @__PURE__ */ __name((config) => {
      emitWarningIfUnsupportedVersion2(process.version);
      const defaultsMode = resolveDefaultsModeConfig(config);
      const defaultConfigProvider = /* @__PURE__ */ __name(() => defaultsMode().then(loadConfigsForDefaultMode), "defaultConfigProvider");
      const clientSharedValues = getRuntimeConfig3(config);
      emitWarningIfUnsupportedVersion(process.version);
      const profileConfig = { profile: config?.profile };
      return {
        ...clientSharedValues,
        ...config,
        runtime: "node",
        defaultsMode,
        bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
        defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: package_default3.version }),
        maxAttempts: config?.maxAttempts ?? loadConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),
        region: config?.region ?? loadConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }),
        requestHandler: NodeHttpHandler.create(config?.requestHandler ?? defaultConfigProvider),
        retryMode: config?.retryMode ?? loadConfig({
          ...NODE_RETRY_MODE_CONFIG_OPTIONS,
          default: /* @__PURE__ */ __name(async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, "default")
        }, config),
        sha256: config?.sha256 ?? Hash.bind(null, "sha256"),
        streamCollector: config?.streamCollector ?? streamCollector,
        useDualstackEndpoint: config?.useDualstackEndpoint ?? loadConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig),
        useFipsEndpoint: config?.useFipsEndpoint ?? loadConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig),
        userAgentAppId: config?.userAgentAppId ?? loadConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig)
      };
    }, "getRuntimeConfig");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/auth/httpAuthExtensionConfiguration.js
var getHttpAuthExtensionConfiguration2, resolveHttpAuthRuntimeConfig2;
var init_httpAuthExtensionConfiguration2 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/auth/httpAuthExtensionConfiguration.js"() {
    init_import_meta_url();
    getHttpAuthExtensionConfiguration2 = /* @__PURE__ */ __name((runtimeConfig) => {
      const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
      let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
      let _credentials = runtimeConfig.credentials;
      return {
        setHttpAuthScheme(httpAuthScheme) {
          const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
          if (index === -1) {
            _httpAuthSchemes.push(httpAuthScheme);
          } else {
            _httpAuthSchemes.splice(index, 1, httpAuthScheme);
          }
        },
        httpAuthSchemes() {
          return _httpAuthSchemes;
        },
        setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
          _httpAuthSchemeProvider = httpAuthSchemeProvider;
        },
        httpAuthSchemeProvider() {
          return _httpAuthSchemeProvider;
        },
        setCredentials(credentials) {
          _credentials = credentials;
        },
        credentials() {
          return _credentials;
        }
      };
    }, "getHttpAuthExtensionConfiguration");
    resolveHttpAuthRuntimeConfig2 = /* @__PURE__ */ __name((config) => {
      return {
        httpAuthSchemes: config.httpAuthSchemes(),
        httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
        credentials: config.credentials()
      };
    }, "resolveHttpAuthRuntimeConfig");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/runtimeExtensions.js
var asPartial2, resolveRuntimeExtensions2;
var init_runtimeExtensions2 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/runtimeExtensions.js"() {
    init_import_meta_url();
    init_dist_es55();
    init_dist_es2();
    init_dist_es20();
    init_httpAuthExtensionConfiguration2();
    asPartial2 = /* @__PURE__ */ __name((t13) => t13, "asPartial");
    resolveRuntimeExtensions2 = /* @__PURE__ */ __name((runtimeConfig, extensions) => {
      const extensionConfiguration = {
        ...asPartial2(getAwsRegionExtensionConfiguration(runtimeConfig)),
        ...asPartial2(getDefaultExtensionConfiguration(runtimeConfig)),
        ...asPartial2(getHttpHandlerExtensionConfiguration(runtimeConfig)),
        ...asPartial2(getHttpAuthExtensionConfiguration2(runtimeConfig))
      };
      extensions.forEach((extension) => extension.configure(extensionConfiguration));
      return {
        ...runtimeConfig,
        ...resolveAwsRegionExtensionConfiguration(extensionConfiguration),
        ...resolveDefaultRuntimeConfig(extensionConfiguration),
        ...resolveHttpHandlerRuntimeConfig(extensionConfiguration),
        ...resolveHttpAuthRuntimeConfig2(extensionConfiguration)
      };
    }, "resolveRuntimeExtensions");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/SSOClient.js
var SSOClient;
var init_SSOClient = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/SSOClient.js"() {
    init_import_meta_url();
    init_dist_es26();
    init_dist_es27();
    init_dist_es28();
    init_dist_es34();
    init_dist_es35();
    init_dist_es16();
    init_dist_es37();
    init_dist_es42();
    init_dist_es45();
    init_dist_es20();
    init_httpAuthSchemeProvider3();
    init_EndpointParameters3();
    init_runtimeConfig2();
    init_runtimeExtensions2();
    SSOClient = class extends Client {
      static {
        __name(this, "SSOClient");
      }
      constructor(...[configuration]) {
        const _config_0 = getRuntimeConfig4(configuration || {});
        const _config_1 = resolveClientEndpointParameters3(_config_0);
        const _config_2 = resolveUserAgentConfig(_config_1);
        const _config_3 = resolveRetryConfig(_config_2);
        const _config_4 = resolveRegionConfig(_config_3);
        const _config_5 = resolveHostHeaderConfig(_config_4);
        const _config_6 = resolveEndpointConfig(_config_5);
        const _config_7 = resolveHttpAuthSchemeConfig3(_config_6);
        const _config_8 = resolveRuntimeExtensions2(_config_7, configuration?.extensions || []);
        super(_config_8);
        this.config = _config_8;
        this.middlewareStack.use(getUserAgentPlugin(this.config));
        this.middlewareStack.use(getRetryPlugin(this.config));
        this.middlewareStack.use(getContentLengthPlugin(this.config));
        this.middlewareStack.use(getHostHeaderPlugin(this.config));
        this.middlewareStack.use(getLoggerPlugin(this.config));
        this.middlewareStack.use(getRecursionDetectionPlugin(this.config));
        this.middlewareStack.use(getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {
          httpAuthSchemeParametersProvider: defaultSSOHttpAuthSchemeParametersProvider,
          identityProviderConfigProvider: /* @__PURE__ */ __name(async (config) => new DefaultIdentityProviderConfig({
            "aws.auth#sigv4": config.credentials
          }), "identityProviderConfigProvider")
        }));
        this.middlewareStack.use(getHttpSigningPlugin(this.config));
      }
      destroy() {
        super.destroy();
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/models/SSOServiceException.js
var SSOServiceException;
var init_SSOServiceException = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/models/SSOServiceException.js"() {
    init_import_meta_url();
    init_dist_es20();
    SSOServiceException = class _SSOServiceException extends ServiceException {
      static {
        __name(this, "SSOServiceException");
      }
      constructor(options) {
        super(options);
        Object.setPrototypeOf(this, _SSOServiceException.prototype);
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/models/models_0.js
var InvalidRequestException2, ResourceNotFoundException, TooManyRequestsException, UnauthorizedException, GetRoleCredentialsRequestFilterSensitiveLog, RoleCredentialsFilterSensitiveLog, GetRoleCredentialsResponseFilterSensitiveLog, ListAccountRolesRequestFilterSensitiveLog, ListAccountsRequestFilterSensitiveLog, LogoutRequestFilterSensitiveLog;
var init_models_03 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/models/models_0.js"() {
    init_import_meta_url();
    init_dist_es20();
    init_SSOServiceException();
    InvalidRequestException2 = class _InvalidRequestException extends SSOServiceException {
      static {
        __name(this, "InvalidRequestException");
      }
      constructor(opts) {
        super({
          name: "InvalidRequestException",
          $fault: "client",
          ...opts
        });
        this.name = "InvalidRequestException";
        this.$fault = "client";
        Object.setPrototypeOf(this, _InvalidRequestException.prototype);
      }
    };
    ResourceNotFoundException = class _ResourceNotFoundException extends SSOServiceException {
      static {
        __name(this, "ResourceNotFoundException");
      }
      constructor(opts) {
        super({
          name: "ResourceNotFoundException",
          $fault: "client",
          ...opts
        });
        this.name = "ResourceNotFoundException";
        this.$fault = "client";
        Object.setPrototypeOf(this, _ResourceNotFoundException.prototype);
      }
    };
    TooManyRequestsException = class _TooManyRequestsException extends SSOServiceException {
      static {
        __name(this, "TooManyRequestsException");
      }
      constructor(opts) {
        super({
          name: "TooManyRequestsException",
          $fault: "client",
          ...opts
        });
        this.name = "TooManyRequestsException";
        this.$fault = "client";
        Object.setPrototypeOf(this, _TooManyRequestsException.prototype);
      }
    };
    UnauthorizedException = class _UnauthorizedException extends SSOServiceException {
      static {
        __name(this, "UnauthorizedException");
      }
      constructor(opts) {
        super({
          name: "UnauthorizedException",
          $fault: "client",
          ...opts
        });
        this.name = "UnauthorizedException";
        this.$fault = "client";
        Object.setPrototypeOf(this, _UnauthorizedException.prototype);
      }
    };
    GetRoleCredentialsRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
      ...obj,
      ...obj.accessToken && { accessToken: SENSITIVE_STRING }
    }), "GetRoleCredentialsRequestFilterSensitiveLog");
    RoleCredentialsFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
      ...obj,
      ...obj.secretAccessKey && { secretAccessKey: SENSITIVE_STRING },
      ...obj.sessionToken && { sessionToken: SENSITIVE_STRING }
    }), "RoleCredentialsFilterSensitiveLog");
    GetRoleCredentialsResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
      ...obj,
      ...obj.roleCredentials && { roleCredentials: RoleCredentialsFilterSensitiveLog(obj.roleCredentials) }
    }), "GetRoleCredentialsResponseFilterSensitiveLog");
    ListAccountRolesRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
      ...obj,
      ...obj.accessToken && { accessToken: SENSITIVE_STRING }
    }), "ListAccountRolesRequestFilterSensitiveLog");
    ListAccountsRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
      ...obj,
      ...obj.accessToken && { accessToken: SENSITIVE_STRING }
    }), "ListAccountsRequestFilterSensitiveLog");
    LogoutRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
      ...obj,
      ...obj.accessToken && { accessToken: SENSITIVE_STRING }
    }), "LogoutRequestFilterSensitiveLog");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/protocols/Aws_restJson1.js
var se_GetRoleCredentialsCommand, se_ListAccountRolesCommand, se_ListAccountsCommand, se_LogoutCommand, de_GetRoleCredentialsCommand, de_ListAccountRolesCommand, de_ListAccountsCommand, de_LogoutCommand, de_CommandError3, throwDefaultError4, de_InvalidRequestExceptionRes2, de_ResourceNotFoundExceptionRes, de_TooManyRequestsExceptionRes, de_UnauthorizedExceptionRes, deserializeMetadata4, _aI, _aT, _ai2, _mR, _mr, _nT, _nt, _rN, _rn, _xasbt;
var init_Aws_restJson12 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/protocols/Aws_restJson1.js"() {
    init_import_meta_url();
    init_dist_es21();
    init_dist_es16();
    init_dist_es20();
    init_models_03();
    init_SSOServiceException();
    se_GetRoleCredentialsCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        [_xasbt]: input[_aT]
      });
      b11.bp("/federation/credentials");
      const query = map({
        [_rn]: [, expectNonNull(input[_rN], `roleName`)],
        [_ai2]: [, expectNonNull(input[_aI], `accountId`)]
      });
      let body;
      b11.m("GET").h(headers).q(query).b(body);
      return b11.build();
    }, "se_GetRoleCredentialsCommand");
    se_ListAccountRolesCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        [_xasbt]: input[_aT]
      });
      b11.bp("/assignment/roles");
      const query = map({
        [_nt]: [, input[_nT]],
        [_mr]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
        [_ai2]: [, expectNonNull(input[_aI], `accountId`)]
      });
      let body;
      b11.m("GET").h(headers).q(query).b(body);
      return b11.build();
    }, "se_ListAccountRolesCommand");
    se_ListAccountsCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        [_xasbt]: input[_aT]
      });
      b11.bp("/assignment/accounts");
      const query = map({
        [_nt]: [, input[_nT]],
        [_mr]: [() => input.maxResults !== void 0, () => input[_mR].toString()]
      });
      let body;
      b11.m("GET").h(headers).q(query).b(body);
      return b11.build();
    }, "se_ListAccountsCommand");
    se_LogoutCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const b11 = requestBuilder(input, context2);
      const headers = map({}, isSerializableHeaderValue, {
        [_xasbt]: input[_aT]
      });
      b11.bp("/logout");
      let body;
      b11.m("POST").h(headers).b(body);
      return b11.build();
    }, "se_LogoutCommand");
    de_GetRoleCredentialsCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError3(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata4(output)
      });
      const data = expectNonNull(expectObject(await parseJsonBody(output.body, context2)), "body");
      const doc = take(data, {
        roleCredentials: _json
      });
      Object.assign(contents, doc);
      return contents;
    }, "de_GetRoleCredentialsCommand");
    de_ListAccountRolesCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError3(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata4(output)
      });
      const data = expectNonNull(expectObject(await parseJsonBody(output.body, context2)), "body");
      const doc = take(data, {
        nextToken: expectString,
        roleList: _json
      });
      Object.assign(contents, doc);
      return contents;
    }, "de_ListAccountRolesCommand");
    de_ListAccountsCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError3(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata4(output)
      });
      const data = expectNonNull(expectObject(await parseJsonBody(output.body, context2)), "body");
      const doc = take(data, {
        accountList: _json,
        nextToken: expectString
      });
      Object.assign(contents, doc);
      return contents;
    }, "de_ListAccountsCommand");
    de_LogoutCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError3(output, context2);
      }
      const contents = map({
        $metadata: deserializeMetadata4(output)
      });
      await collectBody(output.body, context2);
      return contents;
    }, "de_LogoutCommand");
    de_CommandError3 = /* @__PURE__ */ __name(async (output, context2) => {
      const parsedOutput = {
        ...output,
        body: await parseJsonErrorBody(output.body, context2)
      };
      const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
      switch (errorCode) {
        case "InvalidRequestException":
        case "com.amazonaws.sso#InvalidRequestException":
          throw await de_InvalidRequestExceptionRes2(parsedOutput, context2);
        case "ResourceNotFoundException":
        case "com.amazonaws.sso#ResourceNotFoundException":
          throw await de_ResourceNotFoundExceptionRes(parsedOutput, context2);
        case "TooManyRequestsException":
        case "com.amazonaws.sso#TooManyRequestsException":
          throw await de_TooManyRequestsExceptionRes(parsedOutput, context2);
        case "UnauthorizedException":
        case "com.amazonaws.sso#UnauthorizedException":
          throw await de_UnauthorizedExceptionRes(parsedOutput, context2);
        default:
          const parsedBody = parsedOutput.body;
          return throwDefaultError4({
            output,
            parsedBody,
            errorCode
          });
      }
    }, "de_CommandError");
    throwDefaultError4 = withBaseException(SSOServiceException);
    de_InvalidRequestExceptionRes2 = /* @__PURE__ */ __name(async (parsedOutput, context2) => {
      const contents = map({});
      const data = parsedOutput.body;
      const doc = take(data, {
        message: expectString
      });
      Object.assign(contents, doc);
      const exception = new InvalidRequestException2({
        $metadata: deserializeMetadata4(parsedOutput),
        ...contents
      });
      return decorateServiceException(exception, parsedOutput.body);
    }, "de_InvalidRequestExceptionRes");
    de_ResourceNotFoundExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context2) => {
      const contents = map({});
      const data = parsedOutput.body;
      const doc = take(data, {
        message: expectString
      });
      Object.assign(contents, doc);
      const exception = new ResourceNotFoundException({
        $metadata: deserializeMetadata4(parsedOutput),
        ...contents
      });
      return decorateServiceException(exception, parsedOutput.body);
    }, "de_ResourceNotFoundExceptionRes");
    de_TooManyRequestsExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context2) => {
      const contents = map({});
      const data = parsedOutput.body;
      const doc = take(data, {
        message: expectString
      });
      Object.assign(contents, doc);
      const exception = new TooManyRequestsException({
        $metadata: deserializeMetadata4(parsedOutput),
        ...contents
      });
      return decorateServiceException(exception, parsedOutput.body);
    }, "de_TooManyRequestsExceptionRes");
    de_UnauthorizedExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context2) => {
      const contents = map({});
      const data = parsedOutput.body;
      const doc = take(data, {
        message: expectString
      });
      Object.assign(contents, doc);
      const exception = new UnauthorizedException({
        $metadata: deserializeMetadata4(parsedOutput),
        ...contents
      });
      return decorateServiceException(exception, parsedOutput.body);
    }, "de_UnauthorizedExceptionRes");
    deserializeMetadata4 = /* @__PURE__ */ __name((output) => ({
      httpStatusCode: output.statusCode,
      requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
      extendedRequestId: output.headers["x-amz-id-2"],
      cfId: output.headers["x-amz-cf-id"]
    }), "deserializeMetadata");
    _aI = "accountId";
    _aT = "accessToken";
    _ai2 = "account_id";
    _mR = "maxResults";
    _mr = "max_result";
    _nT = "nextToken";
    _nt = "next_token";
    _rN = "roleName";
    _rn = "role_name";
    _xasbt = "x-amz-sso_bearer_token";
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/commands/GetRoleCredentialsCommand.js
var GetRoleCredentialsCommand;
var init_GetRoleCredentialsCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/commands/GetRoleCredentialsCommand.js"() {
    init_import_meta_url();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters3();
    init_models_03();
    init_Aws_restJson12();
    GetRoleCredentialsCommand = class extends Command.classBuilder().ep(commonParams3).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions())
      ];
    }).s("SWBPortalService", "GetRoleCredentials", {}).n("SSOClient", "GetRoleCredentialsCommand").f(GetRoleCredentialsRequestFilterSensitiveLog, GetRoleCredentialsResponseFilterSensitiveLog).ser(se_GetRoleCredentialsCommand).de(de_GetRoleCredentialsCommand).build() {
      static {
        __name(this, "GetRoleCredentialsCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/commands/ListAccountRolesCommand.js
var ListAccountRolesCommand;
var init_ListAccountRolesCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/commands/ListAccountRolesCommand.js"() {
    init_import_meta_url();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters3();
    init_models_03();
    init_Aws_restJson12();
    ListAccountRolesCommand = class extends Command.classBuilder().ep(commonParams3).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions())
      ];
    }).s("SWBPortalService", "ListAccountRoles", {}).n("SSOClient", "ListAccountRolesCommand").f(ListAccountRolesRequestFilterSensitiveLog, void 0).ser(se_ListAccountRolesCommand).de(de_ListAccountRolesCommand).build() {
      static {
        __name(this, "ListAccountRolesCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/commands/ListAccountsCommand.js
var ListAccountsCommand;
var init_ListAccountsCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/commands/ListAccountsCommand.js"() {
    init_import_meta_url();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters3();
    init_models_03();
    init_Aws_restJson12();
    ListAccountsCommand = class extends Command.classBuilder().ep(commonParams3).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions())
      ];
    }).s("SWBPortalService", "ListAccounts", {}).n("SSOClient", "ListAccountsCommand").f(ListAccountsRequestFilterSensitiveLog, void 0).ser(se_ListAccountsCommand).de(de_ListAccountsCommand).build() {
      static {
        __name(this, "ListAccountsCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/commands/LogoutCommand.js
var LogoutCommand;
var init_LogoutCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/commands/LogoutCommand.js"() {
    init_import_meta_url();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters3();
    init_models_03();
    init_Aws_restJson12();
    LogoutCommand = class extends Command.classBuilder().ep(commonParams3).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions())
      ];
    }).s("SWBPortalService", "Logout", {}).n("SSOClient", "LogoutCommand").f(LogoutRequestFilterSensitiveLog, void 0).ser(se_LogoutCommand).de(de_LogoutCommand).build() {
      static {
        __name(this, "LogoutCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/SSO.js
var commands2, SSO;
var init_SSO = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/SSO.js"() {
    init_import_meta_url();
    init_dist_es20();
    init_GetRoleCredentialsCommand();
    init_ListAccountRolesCommand();
    init_ListAccountsCommand();
    init_LogoutCommand();
    init_SSOClient();
    commands2 = {
      GetRoleCredentialsCommand,
      ListAccountRolesCommand,
      ListAccountsCommand,
      LogoutCommand
    };
    SSO = class extends SSOClient {
      static {
        __name(this, "SSO");
      }
    };
    createAggregatedClient(commands2, SSO);
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/commands/index.js
var init_commands6 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/commands/index.js"() {
    init_import_meta_url();
    init_GetRoleCredentialsCommand();
    init_ListAccountRolesCommand();
    init_ListAccountsCommand();
    init_LogoutCommand();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/pagination/Interfaces.js
var init_Interfaces = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/pagination/Interfaces.js"() {
    init_import_meta_url();
  }
});
var init_ListAccountRolesPaginator = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/pagination/ListAccountRolesPaginator.js"() {
    init_import_meta_url();
    init_dist_es16();
    init_ListAccountRolesCommand();
    init_SSOClient();
  }
});
var init_ListAccountsPaginator = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/pagination/ListAccountsPaginator.js"() {
    init_import_meta_url();
    init_dist_es16();
    init_ListAccountsCommand();
    init_SSOClient();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/pagination/index.js
var init_pagination3 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/pagination/index.js"() {
    init_import_meta_url();
    init_Interfaces();
    init_ListAccountRolesPaginator();
    init_ListAccountsPaginator();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/models/index.js
var init_models3 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/models/index.js"() {
    init_import_meta_url();
    init_models_03();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/index.js
var init_dist_es58 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/index.js"() {
    init_import_meta_url();
    init_SSOClient();
    init_SSO();
    init_commands6();
    init_pagination3();
    init_models3();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+credential-provider-sso@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0_/node_modules/@aws-sdk/credential-provider-sso/dist-es/loadSso.js
var loadSso_exports = {};
__export(loadSso_exports, {
  GetRoleCredentialsCommand: () => GetRoleCredentialsCommand,
  SSOClient: () => SSOClient
});
var init_loadSso = __esm({
  "../../node_modules/.pnpm/@aws-sdk+credential-provider-sso@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0_/node_modules/@aws-sdk/credential-provider-sso/dist-es/loadSso.js"() {
    init_import_meta_url();
    init_dist_es58();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+credential-provider-sso@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0_/node_modules/@aws-sdk/credential-provider-sso/dist-es/resolveSSOCredentials.js
var SHOULD_FAIL_CREDENTIAL_CHAIN, resolveSSOCredentials;
var init_resolveSSOCredentials = __esm({
  "../../node_modules/.pnpm/@aws-sdk+credential-provider-sso@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0_/node_modules/@aws-sdk/credential-provider-sso/dist-es/resolveSSOCredentials.js"() {
    init_import_meta_url();
    init_client8();
    init_dist_es57();
    init_dist_es17();
    init_dist_es38();
    SHOULD_FAIL_CREDENTIAL_CHAIN = false;
    resolveSSOCredentials = /* @__PURE__ */ __name(async ({ ssoStartUrl, ssoSession, ssoAccountId, ssoRegion, ssoRoleName, ssoClient, clientConfig, parentClientConfig, profile, logger: logger4 }) => {
      let token;
      const refreshMessage = `To refresh this SSO session run aws sso login with the corresponding profile.`;
      if (ssoSession) {
        try {
          const _token = await fromSso({ profile })();
          token = {
            accessToken: _token.token,
            expiresAt: new Date(_token.expiration).toISOString()
          };
        } catch (e10) {
          throw new CredentialsProviderError(e10.message, {
            tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
            logger: logger4
          });
        }
      } else {
        try {
          token = await getSSOTokenFromFile(ssoStartUrl);
        } catch (e10) {
          throw new CredentialsProviderError(`The SSO session associated with this profile is invalid. ${refreshMessage}`, {
            tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
            logger: logger4
          });
        }
      }
      if (new Date(token.expiresAt).getTime() - Date.now() <= 0) {
        throw new CredentialsProviderError(`The SSO session associated with this profile has expired. ${refreshMessage}`, {
          tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
          logger: logger4
        });
      }
      const { accessToken } = token;
      const { SSOClient: SSOClient2, GetRoleCredentialsCommand: GetRoleCredentialsCommand2 } = await Promise.resolve().then(() => (init_loadSso(), loadSso_exports));
      const sso = ssoClient || new SSOClient2(Object.assign({}, clientConfig ?? {}, {
        logger: clientConfig?.logger ?? parentClientConfig?.logger,
        region: clientConfig?.region ?? ssoRegion
      }));
      let ssoResp;
      try {
        ssoResp = await sso.send(new GetRoleCredentialsCommand2({
          accountId: ssoAccountId,
          roleName: ssoRoleName,
          accessToken
        }));
      } catch (e10) {
        throw new CredentialsProviderError(e10, {
          tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
          logger: logger4
        });
      }
      const { roleCredentials: { accessKeyId, secretAccessKey, sessionToken, expiration, credentialScope, accountId } = {} } = ssoResp;
      if (!accessKeyId || !secretAccessKey || !sessionToken || !expiration) {
        throw new CredentialsProviderError("SSO returns an invalid temporary credential.", {
          tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
          logger: logger4
        });
      }
      const credentials = {
        accessKeyId,
        secretAccessKey,
        sessionToken,
        expiration: new Date(expiration),
        ...credentialScope && { credentialScope },
        ...accountId && { accountId }
      };
      if (ssoSession) {
        setCredentialFeature(credentials, "CREDENTIALS_SSO", "s");
      } else {
        setCredentialFeature(credentials, "CREDENTIALS_SSO_LEGACY", "u");
      }
      return credentials;
    }, "resolveSSOCredentials");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+credential-provider-sso@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0_/node_modules/@aws-sdk/credential-provider-sso/dist-es/validateSsoProfile.js
var validateSsoProfile;
var init_validateSsoProfile = __esm({
  "../../node_modules/.pnpm/@aws-sdk+credential-provider-sso@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0_/node_modules/@aws-sdk/credential-provider-sso/dist-es/validateSsoProfile.js"() {
    init_import_meta_url();
    init_dist_es17();
    validateSsoProfile = /* @__PURE__ */ __name((profile, logger4) => {
      const { sso_start_url, sso_account_id, sso_region, sso_role_name } = profile;
      if (!sso_start_url || !sso_account_id || !sso_region || !sso_role_name) {
        throw new CredentialsProviderError(`Profile is configured with invalid SSO credentials. Required parameters "sso_account_id", "sso_region", "sso_role_name", "sso_start_url". Got ${Object.keys(profile).join(", ")}
Reference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html`, { tryNextLink: false, logger: logger4 });
      }
      return profile;
    }, "validateSsoProfile");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+credential-provider-sso@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0_/node_modules/@aws-sdk/credential-provider-sso/dist-es/fromSSO.js
var fromSSO;
var init_fromSSO = __esm({
  "../../node_modules/.pnpm/@aws-sdk+credential-provider-sso@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0_/node_modules/@aws-sdk/credential-provider-sso/dist-es/fromSSO.js"() {
    init_import_meta_url();
    init_dist_es17();
    init_dist_es38();
    init_isSsoProfile();
    init_resolveSSOCredentials();
    init_validateSsoProfile();
    fromSSO = /* @__PURE__ */ __name((init4 = {}) => async ({ callerClientConfig } = {}) => {
      init4.logger?.debug("@aws-sdk/credential-provider-sso - fromSSO");
      const { ssoStartUrl, ssoAccountId, ssoRegion, ssoRoleName, ssoSession } = init4;
      const { ssoClient } = init4;
      const profileName = getProfileName({
        profile: init4.profile ?? callerClientConfig?.profile
      });
      if (!ssoStartUrl && !ssoAccountId && !ssoRegion && !ssoRoleName && !ssoSession) {
        const profiles = await parseKnownFiles(init4);
        const profile = profiles[profileName];
        if (!profile) {
          throw new CredentialsProviderError(`Profile ${profileName} was not found.`, { logger: init4.logger });
        }
        if (!isSsoProfile(profile)) {
          throw new CredentialsProviderError(`Profile ${profileName} is not configured with SSO credentials.`, {
            logger: init4.logger
          });
        }
        if (profile?.sso_session) {
          const ssoSessions = await loadSsoSessionData(init4);
          const session = ssoSessions[profile.sso_session];
          const conflictMsg = ` configurations in profile ${profileName} and sso-session ${profile.sso_session}`;
          if (ssoRegion && ssoRegion !== session.sso_region) {
            throw new CredentialsProviderError(`Conflicting SSO region` + conflictMsg, {
              tryNextLink: false,
              logger: init4.logger
            });
          }
          if (ssoStartUrl && ssoStartUrl !== session.sso_start_url) {
            throw new CredentialsProviderError(`Conflicting SSO start_url` + conflictMsg, {
              tryNextLink: false,
              logger: init4.logger
            });
          }
          profile.sso_region = session.sso_region;
          profile.sso_start_url = session.sso_start_url;
        }
        const { sso_start_url, sso_account_id, sso_region, sso_role_name, sso_session } = validateSsoProfile(profile, init4.logger);
        return resolveSSOCredentials({
          ssoStartUrl: sso_start_url,
          ssoSession: sso_session,
          ssoAccountId: sso_account_id,
          ssoRegion: sso_region,
          ssoRoleName: sso_role_name,
          ssoClient,
          clientConfig: init4.clientConfig,
          parentClientConfig: init4.parentClientConfig,
          profile: profileName
        });
      } else if (!ssoStartUrl || !ssoAccountId || !ssoRegion || !ssoRoleName) {
        throw new CredentialsProviderError('Incomplete configuration. The fromSSO() argument hash must include "ssoStartUrl", "ssoAccountId", "ssoRegion", "ssoRoleName"', { tryNextLink: false, logger: init4.logger });
      } else {
        return resolveSSOCredentials({
          ssoStartUrl,
          ssoSession,
          ssoAccountId,
          ssoRegion,
          ssoRoleName,
          ssoClient,
          clientConfig: init4.clientConfig,
          parentClientConfig: init4.parentClientConfig,
          profile: profileName
        });
      }
    }, "fromSSO");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+credential-provider-sso@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0_/node_modules/@aws-sdk/credential-provider-sso/dist-es/types.js
var init_types15 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+credential-provider-sso@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0_/node_modules/@aws-sdk/credential-provider-sso/dist-es/types.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+credential-provider-sso@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0_/node_modules/@aws-sdk/credential-provider-sso/dist-es/index.js
var dist_es_exports5 = {};
__export(dist_es_exports5, {
  fromSSO: () => fromSSO,
  isSsoProfile: () => isSsoProfile,
  validateSsoProfile: () => validateSsoProfile
});
var init_dist_es59 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+credential-provider-sso@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0_/node_modules/@aws-sdk/credential-provider-sso/dist-es/index.js"() {
    init_import_meta_url();
    init_fromSSO();
    init_isSsoProfile();
    init_types15();
    init_validateSsoProfile();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+credential-provider-ini@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+clie_bc8234dce1a0330881874845b2d85f32/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveCredentialSource.js
var resolveCredentialSource, setNamedProvider;
var init_resolveCredentialSource = __esm({
  "../../node_modules/.pnpm/@aws-sdk+credential-provider-ini@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+clie_bc8234dce1a0330881874845b2d85f32/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveCredentialSource.js"() {
    init_import_meta_url();
    init_client8();
    init_dist_es17();
    resolveCredentialSource = /* @__PURE__ */ __name((credentialSource, profileName, logger4) => {
      const sourceProvidersMap = {
        EcsContainer: /* @__PURE__ */ __name(async (options) => {
          const { fromHttp: fromHttp2 } = await Promise.resolve().then(() => (init_dist_es50(), dist_es_exports3));
          const { fromContainerMetadata: fromContainerMetadata2 } = await Promise.resolve().then(() => (init_dist_es49(), dist_es_exports2));
          logger4?.debug("@aws-sdk/credential-provider-ini - credential_source is EcsContainer");
          return async () => chain(fromHttp2(options ?? {}), fromContainerMetadata2(options))().then(setNamedProvider);
        }, "EcsContainer"),
        Ec2InstanceMetadata: /* @__PURE__ */ __name(async (options) => {
          logger4?.debug("@aws-sdk/credential-provider-ini - credential_source is Ec2InstanceMetadata");
          const { fromInstanceMetadata: fromInstanceMetadata2 } = await Promise.resolve().then(() => (init_dist_es49(), dist_es_exports2));
          return async () => fromInstanceMetadata2(options)().then(setNamedProvider);
        }, "Ec2InstanceMetadata"),
        Environment: /* @__PURE__ */ __name(async (options) => {
          logger4?.debug("@aws-sdk/credential-provider-ini - credential_source is Environment");
          const { fromEnv: fromEnv3 } = await Promise.resolve().then(() => (init_dist_es48(), dist_es_exports));
          return async () => fromEnv3(options)().then(setNamedProvider);
        }, "Environment")
      };
      if (credentialSource in sourceProvidersMap) {
        return sourceProvidersMap[credentialSource];
      } else {
        throw new CredentialsProviderError(`Unsupported credential source in profile ${profileName}. Got ${credentialSource}, expected EcsContainer or Ec2InstanceMetadata or Environment.`, { logger: logger4 });
      }
    }, "resolveCredentialSource");
    setNamedProvider = /* @__PURE__ */ __name((creds) => setCredentialFeature(creds, "CREDENTIALS_PROFILE_NAMED_PROVIDER", "p"), "setNamedProvider");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/auth/httpAuthSchemeProvider.js
function createAwsAuthSigv4HttpAuthOption4(authParameters) {
  return {
    schemeId: "aws.auth#sigv4",
    signingProperties: {
      name: "sts",
      region: authParameters.region
    },
    propertiesExtractor: /* @__PURE__ */ __name((config, context2) => ({
      signingProperties: {
        config,
        context: context2
      }
    }), "propertiesExtractor")
  };
}
function createSmithyApiNoAuthHttpAuthOption3(authParameters) {
  return {
    schemeId: "smithy.api#noAuth"
  };
}
var defaultSTSHttpAuthSchemeParametersProvider, defaultSTSHttpAuthSchemeProvider, resolveStsAuthConfig, resolveHttpAuthSchemeConfig4;
var init_httpAuthSchemeProvider4 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/auth/httpAuthSchemeProvider.js"() {
    init_import_meta_url();
    init_dist_es21();
    init_dist_es4();
    init_STSClient();
    defaultSTSHttpAuthSchemeParametersProvider = /* @__PURE__ */ __name(async (config, context2, input) => {
      return {
        operation: getSmithyContext(context2).operation,
        region: await normalizeProvider(config.region)() || (() => {
          throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
        })()
      };
    }, "defaultSTSHttpAuthSchemeParametersProvider");
    __name(createAwsAuthSigv4HttpAuthOption4, "createAwsAuthSigv4HttpAuthOption");
    __name(createSmithyApiNoAuthHttpAuthOption3, "createSmithyApiNoAuthHttpAuthOption");
    defaultSTSHttpAuthSchemeProvider = /* @__PURE__ */ __name((authParameters) => {
      const options = [];
      switch (authParameters.operation) {
        case "AssumeRoleWithSAML": {
          options.push(createSmithyApiNoAuthHttpAuthOption3());
          break;
        }
        case "AssumeRoleWithWebIdentity": {
          options.push(createSmithyApiNoAuthHttpAuthOption3());
          break;
        }
        default: {
          options.push(createAwsAuthSigv4HttpAuthOption4(authParameters));
        }
      }
      return options;
    }, "defaultSTSHttpAuthSchemeProvider");
    resolveStsAuthConfig = /* @__PURE__ */ __name((input) => ({
      ...input,
      stsClientCtor: STSClient
    }), "resolveStsAuthConfig");
    resolveHttpAuthSchemeConfig4 = /* @__PURE__ */ __name((config) => {
      const config_0 = resolveStsAuthConfig(config);
      const config_1 = resolveAwsSdkSigV4Config(config_0);
      return {
        ...config_1
      };
    }, "resolveHttpAuthSchemeConfig");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/endpoint/EndpointParameters.js
var resolveClientEndpointParameters4, commonParams4;
var init_EndpointParameters4 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/endpoint/EndpointParameters.js"() {
    init_import_meta_url();
    resolveClientEndpointParameters4 = /* @__PURE__ */ __name((options) => {
      return {
        ...options,
        useDualstackEndpoint: options.useDualstackEndpoint ?? false,
        useFipsEndpoint: options.useFipsEndpoint ?? false,
        useGlobalEndpoint: options.useGlobalEndpoint ?? false,
        defaultSigningName: "sts"
      };
    }, "resolveClientEndpointParameters");
    commonParams4 = {
      UseGlobalEndpoint: { type: "builtInParams", name: "useGlobalEndpoint" },
      UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
      Endpoint: { type: "builtInParams", name: "endpoint" },
      Region: { type: "builtInParams", name: "region" },
      UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/package.json
var package_default4;
var init_package5 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/package.json"() {
    package_default4 = {
      name: "@aws-sdk/client-sts",
      description: "AWS SDK for JavaScript Sts Client for Node.js, Browser and React Native",
      version: "3.721.0",
      scripts: {
        build: "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
        "build:cjs": "node ../../scripts/compilation/inline client-sts",
        "build:es": "tsc -p tsconfig.es.json",
        "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build",
        "build:types": "rimraf ./dist-types tsconfig.types.tsbuildinfo && tsc -p tsconfig.types.json",
        "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
        clean: "rimraf ./dist-* && rimraf *.tsbuildinfo",
        "extract:docs": "api-extractor run --local",
        "generate:client": "node ../../scripts/generate-clients/single-service --solo sts",
        test: "yarn g:vitest run",
        "test:watch": "yarn g:vitest watch"
      },
      main: "./dist-cjs/index.js",
      types: "./dist-types/index.d.ts",
      module: "./dist-es/index.js",
      sideEffects: false,
      dependencies: {
        "@aws-crypto/sha256-browser": "5.2.0",
        "@aws-crypto/sha256-js": "5.2.0",
        "@aws-sdk/client-sso-oidc": "3.721.0",
        "@aws-sdk/core": "3.716.0",
        "@aws-sdk/credential-provider-node": "3.721.0",
        "@aws-sdk/middleware-host-header": "3.714.0",
        "@aws-sdk/middleware-logger": "3.714.0",
        "@aws-sdk/middleware-recursion-detection": "3.714.0",
        "@aws-sdk/middleware-user-agent": "3.721.0",
        "@aws-sdk/region-config-resolver": "3.714.0",
        "@aws-sdk/types": "3.714.0",
        "@aws-sdk/util-endpoints": "3.714.0",
        "@aws-sdk/util-user-agent-browser": "3.714.0",
        "@aws-sdk/util-user-agent-node": "3.721.0",
        "@smithy/config-resolver": "^3.0.13",
        "@smithy/core": "^2.5.5",
        "@smithy/fetch-http-handler": "^4.1.2",
        "@smithy/hash-node": "^3.0.11",
        "@smithy/invalid-dependency": "^3.0.11",
        "@smithy/middleware-content-length": "^3.0.13",
        "@smithy/middleware-endpoint": "^3.2.6",
        "@smithy/middleware-retry": "^3.0.31",
        "@smithy/middleware-serde": "^3.0.11",
        "@smithy/middleware-stack": "^3.0.11",
        "@smithy/node-config-provider": "^3.1.12",
        "@smithy/node-http-handler": "^3.3.2",
        "@smithy/protocol-http": "^4.1.8",
        "@smithy/smithy-client": "^3.5.1",
        "@smithy/types": "^3.7.2",
        "@smithy/url-parser": "^3.0.11",
        "@smithy/util-base64": "^3.0.0",
        "@smithy/util-body-length-browser": "^3.0.0",
        "@smithy/util-body-length-node": "^3.0.0",
        "@smithy/util-defaults-mode-browser": "^3.0.31",
        "@smithy/util-defaults-mode-node": "^3.0.31",
        "@smithy/util-endpoints": "^2.1.7",
        "@smithy/util-middleware": "^3.0.11",
        "@smithy/util-retry": "^3.0.11",
        "@smithy/util-utf8": "^3.0.0",
        tslib: "^2.6.2"
      },
      devDependencies: {
        "@tsconfig/node16": "16.1.3",
        "@types/node": "^16.18.96",
        concurrently: "7.0.0",
        "downlevel-dts": "0.10.1",
        rimraf: "3.0.2",
        typescript: "~4.9.5"
      },
      engines: {
        node: ">=16.0.0"
      },
      typesVersions: {
        "<4.0": {
          "dist-types/*": [
            "dist-types/ts3.4/*"
          ]
        }
      },
      files: [
        "dist-*/**"
      ],
      author: {
        name: "AWS SDK for JavaScript Team",
        url: "https://aws.amazon.com/javascript/"
      },
      license: "Apache-2.0",
      browser: {
        "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser"
      },
      "react-native": {
        "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native"
      },
      homepage: "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-sts",
      repository: {
        type: "git",
        url: "https://github.com/aws/aws-sdk-js-v3.git",
        directory: "clients/client-sts"
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/endpoint/ruleset.js
var F3, G4, H4, I4, J4, a6, b10, c7, d7, e8, f7, g6, h6, i6, j6, k6, l7, m6, n7, o6, p6, q6, r8, s6, t11, u6, v7, w6, x6, y4, z6, A3, B3, C3, D3, E3, _data4, ruleSet4;
var init_ruleset4 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/endpoint/ruleset.js"() {
    init_import_meta_url();
    F3 = "required";
    G4 = "type";
    H4 = "fn";
    I4 = "argv";
    J4 = "ref";
    a6 = false;
    b10 = true;
    c7 = "booleanEquals";
    d7 = "stringEquals";
    e8 = "sigv4";
    f7 = "sts";
    g6 = "us-east-1";
    h6 = "endpoint";
    i6 = "https://sts.{Region}.{PartitionResult#dnsSuffix}";
    j6 = "tree";
    k6 = "error";
    l7 = "getAttr";
    m6 = { [F3]: false, [G4]: "String" };
    n7 = { [F3]: true, "default": false, [G4]: "Boolean" };
    o6 = { [J4]: "Endpoint" };
    p6 = { [H4]: "isSet", [I4]: [{ [J4]: "Region" }] };
    q6 = { [J4]: "Region" };
    r8 = { [H4]: "aws.partition", [I4]: [q6], "assign": "PartitionResult" };
    s6 = { [J4]: "UseFIPS" };
    t11 = { [J4]: "UseDualStack" };
    u6 = { "url": "https://sts.amazonaws.com", "properties": { "authSchemes": [{ "name": e8, "signingName": f7, "signingRegion": g6 }] }, "headers": {} };
    v7 = {};
    w6 = { "conditions": [{ [H4]: d7, [I4]: [q6, "aws-global"] }], [h6]: u6, [G4]: h6 };
    x6 = { [H4]: c7, [I4]: [s6, true] };
    y4 = { [H4]: c7, [I4]: [t11, true] };
    z6 = { [H4]: l7, [I4]: [{ [J4]: "PartitionResult" }, "supportsFIPS"] };
    A3 = { [J4]: "PartitionResult" };
    B3 = { [H4]: c7, [I4]: [true, { [H4]: l7, [I4]: [A3, "supportsDualStack"] }] };
    C3 = [{ [H4]: "isSet", [I4]: [o6] }];
    D3 = [x6];
    E3 = [y4];
    _data4 = { version: "1.0", parameters: { Region: m6, UseDualStack: n7, UseFIPS: n7, Endpoint: m6, UseGlobalEndpoint: n7 }, rules: [{ conditions: [{ [H4]: c7, [I4]: [{ [J4]: "UseGlobalEndpoint" }, b10] }, { [H4]: "not", [I4]: C3 }, p6, r8, { [H4]: c7, [I4]: [s6, a6] }, { [H4]: c7, [I4]: [t11, a6] }], rules: [{ conditions: [{ [H4]: d7, [I4]: [q6, "ap-northeast-1"] }], endpoint: u6, [G4]: h6 }, { conditions: [{ [H4]: d7, [I4]: [q6, "ap-south-1"] }], endpoint: u6, [G4]: h6 }, { conditions: [{ [H4]: d7, [I4]: [q6, "ap-southeast-1"] }], endpoint: u6, [G4]: h6 }, { conditions: [{ [H4]: d7, [I4]: [q6, "ap-southeast-2"] }], endpoint: u6, [G4]: h6 }, w6, { conditions: [{ [H4]: d7, [I4]: [q6, "ca-central-1"] }], endpoint: u6, [G4]: h6 }, { conditions: [{ [H4]: d7, [I4]: [q6, "eu-central-1"] }], endpoint: u6, [G4]: h6 }, { conditions: [{ [H4]: d7, [I4]: [q6, "eu-north-1"] }], endpoint: u6, [G4]: h6 }, { conditions: [{ [H4]: d7, [I4]: [q6, "eu-west-1"] }], endpoint: u6, [G4]: h6 }, { conditions: [{ [H4]: d7, [I4]: [q6, "eu-west-2"] }], endpoint: u6, [G4]: h6 }, { conditions: [{ [H4]: d7, [I4]: [q6, "eu-west-3"] }], endpoint: u6, [G4]: h6 }, { conditions: [{ [H4]: d7, [I4]: [q6, "sa-east-1"] }], endpoint: u6, [G4]: h6 }, { conditions: [{ [H4]: d7, [I4]: [q6, g6] }], endpoint: u6, [G4]: h6 }, { conditions: [{ [H4]: d7, [I4]: [q6, "us-east-2"] }], endpoint: u6, [G4]: h6 }, { conditions: [{ [H4]: d7, [I4]: [q6, "us-west-1"] }], endpoint: u6, [G4]: h6 }, { conditions: [{ [H4]: d7, [I4]: [q6, "us-west-2"] }], endpoint: u6, [G4]: h6 }, { endpoint: { url: i6, properties: { authSchemes: [{ name: e8, signingName: f7, signingRegion: "{Region}" }] }, headers: v7 }, [G4]: h6 }], [G4]: j6 }, { conditions: C3, rules: [{ conditions: D3, error: "Invalid Configuration: FIPS and custom endpoint are not supported", [G4]: k6 }, { conditions: E3, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", [G4]: k6 }, { endpoint: { url: o6, properties: v7, headers: v7 }, [G4]: h6 }], [G4]: j6 }, { conditions: [p6], rules: [{ conditions: [r8], rules: [{ conditions: [x6, y4], rules: [{ conditions: [{ [H4]: c7, [I4]: [b10, z6] }, B3], rules: [{ endpoint: { url: "https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: v7, headers: v7 }, [G4]: h6 }], [G4]: j6 }, { error: "FIPS and DualStack are enabled, but this partition does not support one or both", [G4]: k6 }], [G4]: j6 }, { conditions: D3, rules: [{ conditions: [{ [H4]: c7, [I4]: [z6, b10] }], rules: [{ conditions: [{ [H4]: d7, [I4]: [{ [H4]: l7, [I4]: [A3, "name"] }, "aws-us-gov"] }], endpoint: { url: "https://sts.{Region}.amazonaws.com", properties: v7, headers: v7 }, [G4]: h6 }, { endpoint: { url: "https://sts-fips.{Region}.{PartitionResult#dnsSuffix}", properties: v7, headers: v7 }, [G4]: h6 }], [G4]: j6 }, { error: "FIPS is enabled but this partition does not support FIPS", [G4]: k6 }], [G4]: j6 }, { conditions: E3, rules: [{ conditions: [B3], rules: [{ endpoint: { url: "https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: v7, headers: v7 }, [G4]: h6 }], [G4]: j6 }, { error: "DualStack is enabled but this partition does not support DualStack", [G4]: k6 }], [G4]: j6 }, w6, { endpoint: { url: i6, properties: v7, headers: v7 }, [G4]: h6 }], [G4]: j6 }], [G4]: j6 }, { error: "Invalid Configuration: Missing Region", [G4]: k6 }] };
    ruleSet4 = _data4;
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/endpoint/endpointResolver.js
var cache4, defaultEndpointResolver4;
var init_endpointResolver4 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/endpoint/endpointResolver.js"() {
    init_import_meta_url();
    init_dist_es33();
    init_dist_es32();
    init_ruleset4();
    cache4 = new EndpointCache({
      size: 50,
      params: ["Endpoint", "Region", "UseDualStack", "UseFIPS", "UseGlobalEndpoint"]
    });
    defaultEndpointResolver4 = /* @__PURE__ */ __name((endpointParams, context2 = {}) => {
      return cache4.get(endpointParams, () => resolveEndpoint(ruleSet4, {
        endpointParams,
        logger: context2.logger
      }));
    }, "defaultEndpointResolver");
    customEndpointFunctions.aws = awsEndpointFunctions;
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/runtimeConfig.shared.js
var getRuntimeConfig5;
var init_runtimeConfig_shared3 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/runtimeConfig.shared.js"() {
    init_import_meta_url();
    init_dist_es21();
    init_dist_es16();
    init_dist_es20();
    init_dist_es41();
    init_dist_es9();
    init_dist_es8();
    init_httpAuthSchemeProvider4();
    init_endpointResolver4();
    getRuntimeConfig5 = /* @__PURE__ */ __name((config) => {
      return {
        apiVersion: "2011-06-15",
        base64Decoder: config?.base64Decoder ?? fromBase64,
        base64Encoder: config?.base64Encoder ?? toBase64,
        disableHostPrefix: config?.disableHostPrefix ?? false,
        endpointProvider: config?.endpointProvider ?? defaultEndpointResolver4,
        extensions: config?.extensions ?? [],
        httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? defaultSTSHttpAuthSchemeProvider,
        httpAuthSchemes: config?.httpAuthSchemes ?? [
          {
            schemeId: "aws.auth#sigv4",
            identityProvider: /* @__PURE__ */ __name((ipc) => ipc.getIdentityProvider("aws.auth#sigv4"), "identityProvider"),
            signer: new AwsSdkSigV4Signer()
          },
          {
            schemeId: "smithy.api#noAuth",
            identityProvider: /* @__PURE__ */ __name((ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})), "identityProvider"),
            signer: new NoAuthSigner()
          }
        ],
        logger: config?.logger ?? new NoOpLogger(),
        serviceId: config?.serviceId ?? "STS",
        urlParser: config?.urlParser ?? parseUrl2,
        utf8Decoder: config?.utf8Decoder ?? fromUtf8,
        utf8Encoder: config?.utf8Encoder ?? toUtf8
      };
    }, "getRuntimeConfig");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/runtimeConfig.js
var getRuntimeConfig6;
var init_runtimeConfig3 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/runtimeConfig.js"() {
    init_import_meta_url();
    init_package5();
    init_dist_es21();
    init_dist_es64();
    init_dist_es51();
    init_dist_es35();
    init_dist_es16();
    init_dist_es52();
    init_dist_es45();
    init_dist_es39();
    init_dist_es12();
    init_dist_es53();
    init_dist_es44();
    init_runtimeConfig_shared3();
    init_dist_es20();
    init_dist_es54();
    init_dist_es20();
    getRuntimeConfig6 = /* @__PURE__ */ __name((config) => {
      emitWarningIfUnsupportedVersion2(process.version);
      const defaultsMode = resolveDefaultsModeConfig(config);
      const defaultConfigProvider = /* @__PURE__ */ __name(() => defaultsMode().then(loadConfigsForDefaultMode), "defaultConfigProvider");
      const clientSharedValues = getRuntimeConfig5(config);
      emitWarningIfUnsupportedVersion(process.version);
      const profileConfig = { profile: config?.profile };
      return {
        ...clientSharedValues,
        ...config,
        runtime: "node",
        defaultsMode,
        bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
        credentialDefaultProvider: config?.credentialDefaultProvider ?? defaultProvider,
        defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: package_default4.version }),
        httpAuthSchemes: config?.httpAuthSchemes ?? [
          {
            schemeId: "aws.auth#sigv4",
            identityProvider: /* @__PURE__ */ __name((ipc) => ipc.getIdentityProvider("aws.auth#sigv4") || (async (idProps) => await defaultProvider(idProps?.__config || {})()), "identityProvider"),
            signer: new AwsSdkSigV4Signer()
          },
          {
            schemeId: "smithy.api#noAuth",
            identityProvider: /* @__PURE__ */ __name((ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})), "identityProvider"),
            signer: new NoAuthSigner()
          }
        ],
        maxAttempts: config?.maxAttempts ?? loadConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),
        region: config?.region ?? loadConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }),
        requestHandler: NodeHttpHandler.create(config?.requestHandler ?? defaultConfigProvider),
        retryMode: config?.retryMode ?? loadConfig({
          ...NODE_RETRY_MODE_CONFIG_OPTIONS,
          default: /* @__PURE__ */ __name(async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, "default")
        }, config),
        sha256: config?.sha256 ?? Hash.bind(null, "sha256"),
        streamCollector: config?.streamCollector ?? streamCollector,
        useDualstackEndpoint: config?.useDualstackEndpoint ?? loadConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig),
        useFipsEndpoint: config?.useFipsEndpoint ?? loadConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig),
        userAgentAppId: config?.userAgentAppId ?? loadConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig)
      };
    }, "getRuntimeConfig");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/auth/httpAuthExtensionConfiguration.js
var getHttpAuthExtensionConfiguration3, resolveHttpAuthRuntimeConfig3;
var init_httpAuthExtensionConfiguration3 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/auth/httpAuthExtensionConfiguration.js"() {
    init_import_meta_url();
    getHttpAuthExtensionConfiguration3 = /* @__PURE__ */ __name((runtimeConfig) => {
      const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
      let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
      let _credentials = runtimeConfig.credentials;
      return {
        setHttpAuthScheme(httpAuthScheme) {
          const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
          if (index === -1) {
            _httpAuthSchemes.push(httpAuthScheme);
          } else {
            _httpAuthSchemes.splice(index, 1, httpAuthScheme);
          }
        },
        httpAuthSchemes() {
          return _httpAuthSchemes;
        },
        setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
          _httpAuthSchemeProvider = httpAuthSchemeProvider;
        },
        httpAuthSchemeProvider() {
          return _httpAuthSchemeProvider;
        },
        setCredentials(credentials) {
          _credentials = credentials;
        },
        credentials() {
          return _credentials;
        }
      };
    }, "getHttpAuthExtensionConfiguration");
    resolveHttpAuthRuntimeConfig3 = /* @__PURE__ */ __name((config) => {
      return {
        httpAuthSchemes: config.httpAuthSchemes(),
        httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
        credentials: config.credentials()
      };
    }, "resolveHttpAuthRuntimeConfig");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/runtimeExtensions.js
var asPartial3, resolveRuntimeExtensions3;
var init_runtimeExtensions3 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/runtimeExtensions.js"() {
    init_import_meta_url();
    init_dist_es55();
    init_dist_es2();
    init_dist_es20();
    init_httpAuthExtensionConfiguration3();
    asPartial3 = /* @__PURE__ */ __name((t13) => t13, "asPartial");
    resolveRuntimeExtensions3 = /* @__PURE__ */ __name((runtimeConfig, extensions) => {
      const extensionConfiguration = {
        ...asPartial3(getAwsRegionExtensionConfiguration(runtimeConfig)),
        ...asPartial3(getDefaultExtensionConfiguration(runtimeConfig)),
        ...asPartial3(getHttpHandlerExtensionConfiguration(runtimeConfig)),
        ...asPartial3(getHttpAuthExtensionConfiguration3(runtimeConfig))
      };
      extensions.forEach((extension) => extension.configure(extensionConfiguration));
      return {
        ...runtimeConfig,
        ...resolveAwsRegionExtensionConfiguration(extensionConfiguration),
        ...resolveDefaultRuntimeConfig(extensionConfiguration),
        ...resolveHttpHandlerRuntimeConfig(extensionConfiguration),
        ...resolveHttpAuthRuntimeConfig3(extensionConfiguration)
      };
    }, "resolveRuntimeExtensions");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/STSClient.js
var STSClient;
var init_STSClient = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/STSClient.js"() {
    init_import_meta_url();
    init_dist_es26();
    init_dist_es27();
    init_dist_es28();
    init_dist_es34();
    init_dist_es35();
    init_dist_es16();
    init_dist_es37();
    init_dist_es42();
    init_dist_es45();
    init_dist_es20();
    init_httpAuthSchemeProvider4();
    init_EndpointParameters4();
    init_runtimeConfig3();
    init_runtimeExtensions3();
    STSClient = class extends Client {
      static {
        __name(this, "STSClient");
      }
      constructor(...[configuration]) {
        const _config_0 = getRuntimeConfig6(configuration || {});
        const _config_1 = resolveClientEndpointParameters4(_config_0);
        const _config_2 = resolveUserAgentConfig(_config_1);
        const _config_3 = resolveRetryConfig(_config_2);
        const _config_4 = resolveRegionConfig(_config_3);
        const _config_5 = resolveHostHeaderConfig(_config_4);
        const _config_6 = resolveEndpointConfig(_config_5);
        const _config_7 = resolveHttpAuthSchemeConfig4(_config_6);
        const _config_8 = resolveRuntimeExtensions3(_config_7, configuration?.extensions || []);
        super(_config_8);
        this.config = _config_8;
        this.middlewareStack.use(getUserAgentPlugin(this.config));
        this.middlewareStack.use(getRetryPlugin(this.config));
        this.middlewareStack.use(getContentLengthPlugin(this.config));
        this.middlewareStack.use(getHostHeaderPlugin(this.config));
        this.middlewareStack.use(getLoggerPlugin(this.config));
        this.middlewareStack.use(getRecursionDetectionPlugin(this.config));
        this.middlewareStack.use(getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {
          httpAuthSchemeParametersProvider: defaultSTSHttpAuthSchemeParametersProvider,
          identityProviderConfigProvider: /* @__PURE__ */ __name(async (config) => new DefaultIdentityProviderConfig({
            "aws.auth#sigv4": config.credentials
          }), "identityProviderConfigProvider")
        }));
        this.middlewareStack.use(getHttpSigningPlugin(this.config));
      }
      destroy() {
        super.destroy();
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/models/STSServiceException.js
var STSServiceException;
var init_STSServiceException = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/models/STSServiceException.js"() {
    init_import_meta_url();
    init_dist_es20();
    STSServiceException = class _STSServiceException extends ServiceException {
      static {
        __name(this, "STSServiceException");
      }
      constructor(options) {
        super(options);
        Object.setPrototypeOf(this, _STSServiceException.prototype);
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/models/models_0.js
var ExpiredTokenException2, MalformedPolicyDocumentException, PackedPolicyTooLargeException, RegionDisabledException, IDPRejectedClaimException, InvalidIdentityTokenException, IDPCommunicationErrorException, InvalidAuthorizationMessageException, CredentialsFilterSensitiveLog, AssumeRoleResponseFilterSensitiveLog, AssumeRoleWithSAMLRequestFilterSensitiveLog, AssumeRoleWithSAMLResponseFilterSensitiveLog, AssumeRoleWithWebIdentityRequestFilterSensitiveLog, AssumeRoleWithWebIdentityResponseFilterSensitiveLog, AssumeRootResponseFilterSensitiveLog, GetFederationTokenResponseFilterSensitiveLog, GetSessionTokenResponseFilterSensitiveLog;
var init_models_04 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/models/models_0.js"() {
    init_import_meta_url();
    init_dist_es20();
    init_STSServiceException();
    ExpiredTokenException2 = class _ExpiredTokenException extends STSServiceException {
      static {
        __name(this, "ExpiredTokenException");
      }
      constructor(opts) {
        super({
          name: "ExpiredTokenException",
          $fault: "client",
          ...opts
        });
        this.name = "ExpiredTokenException";
        this.$fault = "client";
        Object.setPrototypeOf(this, _ExpiredTokenException.prototype);
      }
    };
    MalformedPolicyDocumentException = class _MalformedPolicyDocumentException extends STSServiceException {
      static {
        __name(this, "MalformedPolicyDocumentException");
      }
      constructor(opts) {
        super({
          name: "MalformedPolicyDocumentException",
          $fault: "client",
          ...opts
        });
        this.name = "MalformedPolicyDocumentException";
        this.$fault = "client";
        Object.setPrototypeOf(this, _MalformedPolicyDocumentException.prototype);
      }
    };
    PackedPolicyTooLargeException = class _PackedPolicyTooLargeException extends STSServiceException {
      static {
        __name(this, "PackedPolicyTooLargeException");
      }
      constructor(opts) {
        super({
          name: "PackedPolicyTooLargeException",
          $fault: "client",
          ...opts
        });
        this.name = "PackedPolicyTooLargeException";
        this.$fault = "client";
        Object.setPrototypeOf(this, _PackedPolicyTooLargeException.prototype);
      }
    };
    RegionDisabledException = class _RegionDisabledException extends STSServiceException {
      static {
        __name(this, "RegionDisabledException");
      }
      constructor(opts) {
        super({
          name: "RegionDisabledException",
          $fault: "client",
          ...opts
        });
        this.name = "RegionDisabledException";
        this.$fault = "client";
        Object.setPrototypeOf(this, _RegionDisabledException.prototype);
      }
    };
    IDPRejectedClaimException = class _IDPRejectedClaimException extends STSServiceException {
      static {
        __name(this, "IDPRejectedClaimException");
      }
      constructor(opts) {
        super({
          name: "IDPRejectedClaimException",
          $fault: "client",
          ...opts
        });
        this.name = "IDPRejectedClaimException";
        this.$fault = "client";
        Object.setPrototypeOf(this, _IDPRejectedClaimException.prototype);
      }
    };
    InvalidIdentityTokenException = class _InvalidIdentityTokenException extends STSServiceException {
      static {
        __name(this, "InvalidIdentityTokenException");
      }
      constructor(opts) {
        super({
          name: "InvalidIdentityTokenException",
          $fault: "client",
          ...opts
        });
        this.name = "InvalidIdentityTokenException";
        this.$fault = "client";
        Object.setPrototypeOf(this, _InvalidIdentityTokenException.prototype);
      }
    };
    IDPCommunicationErrorException = class _IDPCommunicationErrorException extends STSServiceException {
      static {
        __name(this, "IDPCommunicationErrorException");
      }
      constructor(opts) {
        super({
          name: "IDPCommunicationErrorException",
          $fault: "client",
          ...opts
        });
        this.name = "IDPCommunicationErrorException";
        this.$fault = "client";
        Object.setPrototypeOf(this, _IDPCommunicationErrorException.prototype);
      }
    };
    InvalidAuthorizationMessageException = class _InvalidAuthorizationMessageException extends STSServiceException {
      static {
        __name(this, "InvalidAuthorizationMessageException");
      }
      constructor(opts) {
        super({
          name: "InvalidAuthorizationMessageException",
          $fault: "client",
          ...opts
        });
        this.name = "InvalidAuthorizationMessageException";
        this.$fault = "client";
        Object.setPrototypeOf(this, _InvalidAuthorizationMessageException.prototype);
      }
    };
    CredentialsFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
      ...obj,
      ...obj.SecretAccessKey && { SecretAccessKey: SENSITIVE_STRING }
    }), "CredentialsFilterSensitiveLog");
    AssumeRoleResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
      ...obj,
      ...obj.Credentials && { Credentials: CredentialsFilterSensitiveLog(obj.Credentials) }
    }), "AssumeRoleResponseFilterSensitiveLog");
    AssumeRoleWithSAMLRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
      ...obj,
      ...obj.SAMLAssertion && { SAMLAssertion: SENSITIVE_STRING }
    }), "AssumeRoleWithSAMLRequestFilterSensitiveLog");
    AssumeRoleWithSAMLResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
      ...obj,
      ...obj.Credentials && { Credentials: CredentialsFilterSensitiveLog(obj.Credentials) }
    }), "AssumeRoleWithSAMLResponseFilterSensitiveLog");
    AssumeRoleWithWebIdentityRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
      ...obj,
      ...obj.WebIdentityToken && { WebIdentityToken: SENSITIVE_STRING }
    }), "AssumeRoleWithWebIdentityRequestFilterSensitiveLog");
    AssumeRoleWithWebIdentityResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
      ...obj,
      ...obj.Credentials && { Credentials: CredentialsFilterSensitiveLog(obj.Credentials) }
    }), "AssumeRoleWithWebIdentityResponseFilterSensitiveLog");
    AssumeRootResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
      ...obj,
      ...obj.Credentials && { Credentials: CredentialsFilterSensitiveLog(obj.Credentials) }
    }), "AssumeRootResponseFilterSensitiveLog");
    GetFederationTokenResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
      ...obj,
      ...obj.Credentials && { Credentials: CredentialsFilterSensitiveLog(obj.Credentials) }
    }), "GetFederationTokenResponseFilterSensitiveLog");
    GetSessionTokenResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
      ...obj,
      ...obj.Credentials && { Credentials: CredentialsFilterSensitiveLog(obj.Credentials) }
    }), "GetSessionTokenResponseFilterSensitiveLog");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/protocols/Aws_query.js
var se_AssumeRoleCommand, se_AssumeRoleWithSAMLCommand, se_AssumeRoleWithWebIdentityCommand, se_AssumeRootCommand, se_DecodeAuthorizationMessageCommand, se_GetAccessKeyInfoCommand, se_GetCallerIdentityCommand, se_GetFederationTokenCommand, se_GetSessionTokenCommand, de_AssumeRoleCommand, de_AssumeRoleWithSAMLCommand, de_AssumeRoleWithWebIdentityCommand, de_AssumeRootCommand, de_DecodeAuthorizationMessageCommand, de_GetAccessKeyInfoCommand, de_GetCallerIdentityCommand, de_GetFederationTokenCommand, de_GetSessionTokenCommand, de_CommandError4, de_ExpiredTokenExceptionRes2, de_IDPCommunicationErrorExceptionRes, de_IDPRejectedClaimExceptionRes, de_InvalidAuthorizationMessageExceptionRes, de_InvalidIdentityTokenExceptionRes, de_MalformedPolicyDocumentExceptionRes, de_PackedPolicyTooLargeExceptionRes, de_RegionDisabledExceptionRes, se_AssumeRoleRequest, se_AssumeRoleWithSAMLRequest, se_AssumeRoleWithWebIdentityRequest, se_AssumeRootRequest, se_DecodeAuthorizationMessageRequest, se_GetAccessKeyInfoRequest, se_GetCallerIdentityRequest, se_GetFederationTokenRequest, se_GetSessionTokenRequest, se_policyDescriptorListType, se_PolicyDescriptorType, se_ProvidedContext, se_ProvidedContextsListType, se_Tag2, se_tagKeyListType, se_tagListType, de_AssumedRoleUser, de_AssumeRoleResponse, de_AssumeRoleWithSAMLResponse, de_AssumeRoleWithWebIdentityResponse, de_AssumeRootResponse, de_Credentials, de_DecodeAuthorizationMessageResponse, de_ExpiredTokenException, de_FederatedUser, de_GetAccessKeyInfoResponse, de_GetCallerIdentityResponse, de_GetFederationTokenResponse, de_GetSessionTokenResponse, de_IDPCommunicationErrorException, de_IDPRejectedClaimException, de_InvalidAuthorizationMessageException, de_InvalidIdentityTokenException, de_MalformedPolicyDocumentException, de_PackedPolicyTooLargeException, de_RegionDisabledException, deserializeMetadata5, throwDefaultError5, buildHttpRpcRequest, SHARED_HEADERS, _4, _A2, _AKI2, _AR2, _ARI2, _ARU, _ARWSAML, _ARWWI, _ARs, _Ac2, _Ar, _Au, _C2, _CA2, _DAM, _DM2, _DS, _E2, _EI, _EM2, _FU, _FUI, _GAKI, _GCI, _GFT, _GST, _I2, _K2, _N2, _NQ, _P2, _PA, _PAr, _PAro, _PC2, _PI2, _PPS, _Pr2, _RA, _RSN, _S2, _SAK2, _SAMLA, _SFWIT, _SI, _SN, _ST2, _STe, _T2, _TC2, _TP2, _TPA, _TTK, _UI2, _V2, _Va2, _WIT, _a4, _m2, buildFormUrlencodedString, loadQueryErrorCode;
var init_Aws_query = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/protocols/Aws_query.js"() {
    init_import_meta_url();
    init_dist_es21();
    init_dist_es2();
    init_dist_es20();
    init_models_04();
    init_STSServiceException();
    se_AssumeRoleCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const headers = SHARED_HEADERS;
      let body;
      body = buildFormUrlencodedString({
        ...se_AssumeRoleRequest(input, context2),
        [_A2]: _AR2,
        [_V2]: _4
      });
      return buildHttpRpcRequest(context2, headers, "/", void 0, body);
    }, "se_AssumeRoleCommand");
    se_AssumeRoleWithSAMLCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const headers = SHARED_HEADERS;
      let body;
      body = buildFormUrlencodedString({
        ...se_AssumeRoleWithSAMLRequest(input, context2),
        [_A2]: _ARWSAML,
        [_V2]: _4
      });
      return buildHttpRpcRequest(context2, headers, "/", void 0, body);
    }, "se_AssumeRoleWithSAMLCommand");
    se_AssumeRoleWithWebIdentityCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const headers = SHARED_HEADERS;
      let body;
      body = buildFormUrlencodedString({
        ...se_AssumeRoleWithWebIdentityRequest(input, context2),
        [_A2]: _ARWWI,
        [_V2]: _4
      });
      return buildHttpRpcRequest(context2, headers, "/", void 0, body);
    }, "se_AssumeRoleWithWebIdentityCommand");
    se_AssumeRootCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const headers = SHARED_HEADERS;
      let body;
      body = buildFormUrlencodedString({
        ...se_AssumeRootRequest(input, context2),
        [_A2]: _ARs,
        [_V2]: _4
      });
      return buildHttpRpcRequest(context2, headers, "/", void 0, body);
    }, "se_AssumeRootCommand");
    se_DecodeAuthorizationMessageCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const headers = SHARED_HEADERS;
      let body;
      body = buildFormUrlencodedString({
        ...se_DecodeAuthorizationMessageRequest(input, context2),
        [_A2]: _DAM,
        [_V2]: _4
      });
      return buildHttpRpcRequest(context2, headers, "/", void 0, body);
    }, "se_DecodeAuthorizationMessageCommand");
    se_GetAccessKeyInfoCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const headers = SHARED_HEADERS;
      let body;
      body = buildFormUrlencodedString({
        ...se_GetAccessKeyInfoRequest(input, context2),
        [_A2]: _GAKI,
        [_V2]: _4
      });
      return buildHttpRpcRequest(context2, headers, "/", void 0, body);
    }, "se_GetAccessKeyInfoCommand");
    se_GetCallerIdentityCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const headers = SHARED_HEADERS;
      let body;
      body = buildFormUrlencodedString({
        ...se_GetCallerIdentityRequest(input, context2),
        [_A2]: _GCI,
        [_V2]: _4
      });
      return buildHttpRpcRequest(context2, headers, "/", void 0, body);
    }, "se_GetCallerIdentityCommand");
    se_GetFederationTokenCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const headers = SHARED_HEADERS;
      let body;
      body = buildFormUrlencodedString({
        ...se_GetFederationTokenRequest(input, context2),
        [_A2]: _GFT,
        [_V2]: _4
      });
      return buildHttpRpcRequest(context2, headers, "/", void 0, body);
    }, "se_GetFederationTokenCommand");
    se_GetSessionTokenCommand = /* @__PURE__ */ __name(async (input, context2) => {
      const headers = SHARED_HEADERS;
      let body;
      body = buildFormUrlencodedString({
        ...se_GetSessionTokenRequest(input, context2),
        [_A2]: _GST,
        [_V2]: _4
      });
      return buildHttpRpcRequest(context2, headers, "/", void 0, body);
    }, "se_GetSessionTokenCommand");
    de_AssumeRoleCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode >= 300) {
        return de_CommandError4(output, context2);
      }
      const data = await parseXmlBody(output.body, context2);
      let contents = {};
      contents = de_AssumeRoleResponse(data.AssumeRoleResult, context2);
      const response = {
        $metadata: deserializeMetadata5(output),
        ...contents
      };
      return response;
    }, "de_AssumeRoleCommand");
    de_AssumeRoleWithSAMLCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode >= 300) {
        return de_CommandError4(output, context2);
      }
      const data = await parseXmlBody(output.body, context2);
      let contents = {};
      contents = de_AssumeRoleWithSAMLResponse(data.AssumeRoleWithSAMLResult, context2);
      const response = {
        $metadata: deserializeMetadata5(output),
        ...contents
      };
      return response;
    }, "de_AssumeRoleWithSAMLCommand");
    de_AssumeRoleWithWebIdentityCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode >= 300) {
        return de_CommandError4(output, context2);
      }
      const data = await parseXmlBody(output.body, context2);
      let contents = {};
      contents = de_AssumeRoleWithWebIdentityResponse(data.AssumeRoleWithWebIdentityResult, context2);
      const response = {
        $metadata: deserializeMetadata5(output),
        ...contents
      };
      return response;
    }, "de_AssumeRoleWithWebIdentityCommand");
    de_AssumeRootCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode >= 300) {
        return de_CommandError4(output, context2);
      }
      const data = await parseXmlBody(output.body, context2);
      let contents = {};
      contents = de_AssumeRootResponse(data.AssumeRootResult, context2);
      const response = {
        $metadata: deserializeMetadata5(output),
        ...contents
      };
      return response;
    }, "de_AssumeRootCommand");
    de_DecodeAuthorizationMessageCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode >= 300) {
        return de_CommandError4(output, context2);
      }
      const data = await parseXmlBody(output.body, context2);
      let contents = {};
      contents = de_DecodeAuthorizationMessageResponse(data.DecodeAuthorizationMessageResult, context2);
      const response = {
        $metadata: deserializeMetadata5(output),
        ...contents
      };
      return response;
    }, "de_DecodeAuthorizationMessageCommand");
    de_GetAccessKeyInfoCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode >= 300) {
        return de_CommandError4(output, context2);
      }
      const data = await parseXmlBody(output.body, context2);
      let contents = {};
      contents = de_GetAccessKeyInfoResponse(data.GetAccessKeyInfoResult, context2);
      const response = {
        $metadata: deserializeMetadata5(output),
        ...contents
      };
      return response;
    }, "de_GetAccessKeyInfoCommand");
    de_GetCallerIdentityCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode >= 300) {
        return de_CommandError4(output, context2);
      }
      const data = await parseXmlBody(output.body, context2);
      let contents = {};
      contents = de_GetCallerIdentityResponse(data.GetCallerIdentityResult, context2);
      const response = {
        $metadata: deserializeMetadata5(output),
        ...contents
      };
      return response;
    }, "de_GetCallerIdentityCommand");
    de_GetFederationTokenCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode >= 300) {
        return de_CommandError4(output, context2);
      }
      const data = await parseXmlBody(output.body, context2);
      let contents = {};
      contents = de_GetFederationTokenResponse(data.GetFederationTokenResult, context2);
      const response = {
        $metadata: deserializeMetadata5(output),
        ...contents
      };
      return response;
    }, "de_GetFederationTokenCommand");
    de_GetSessionTokenCommand = /* @__PURE__ */ __name(async (output, context2) => {
      if (output.statusCode >= 300) {
        return de_CommandError4(output, context2);
      }
      const data = await parseXmlBody(output.body, context2);
      let contents = {};
      contents = de_GetSessionTokenResponse(data.GetSessionTokenResult, context2);
      const response = {
        $metadata: deserializeMetadata5(output),
        ...contents
      };
      return response;
    }, "de_GetSessionTokenCommand");
    de_CommandError4 = /* @__PURE__ */ __name(async (output, context2) => {
      const parsedOutput = {
        ...output,
        body: await parseXmlErrorBody(output.body, context2)
      };
      const errorCode = loadQueryErrorCode(output, parsedOutput.body);
      switch (errorCode) {
        case "ExpiredTokenException":
        case "com.amazonaws.sts#ExpiredTokenException":
          throw await de_ExpiredTokenExceptionRes2(parsedOutput, context2);
        case "MalformedPolicyDocument":
        case "com.amazonaws.sts#MalformedPolicyDocumentException":
          throw await de_MalformedPolicyDocumentExceptionRes(parsedOutput, context2);
        case "PackedPolicyTooLarge":
        case "com.amazonaws.sts#PackedPolicyTooLargeException":
          throw await de_PackedPolicyTooLargeExceptionRes(parsedOutput, context2);
        case "RegionDisabledException":
        case "com.amazonaws.sts#RegionDisabledException":
          throw await de_RegionDisabledExceptionRes(parsedOutput, context2);
        case "IDPRejectedClaim":
        case "com.amazonaws.sts#IDPRejectedClaimException":
          throw await de_IDPRejectedClaimExceptionRes(parsedOutput, context2);
        case "InvalidIdentityToken":
        case "com.amazonaws.sts#InvalidIdentityTokenException":
          throw await de_InvalidIdentityTokenExceptionRes(parsedOutput, context2);
        case "IDPCommunicationError":
        case "com.amazonaws.sts#IDPCommunicationErrorException":
          throw await de_IDPCommunicationErrorExceptionRes(parsedOutput, context2);
        case "InvalidAuthorizationMessageException":
        case "com.amazonaws.sts#InvalidAuthorizationMessageException":
          throw await de_InvalidAuthorizationMessageExceptionRes(parsedOutput, context2);
        default:
          const parsedBody = parsedOutput.body;
          return throwDefaultError5({
            output,
            parsedBody: parsedBody.Error,
            errorCode
          });
      }
    }, "de_CommandError");
    de_ExpiredTokenExceptionRes2 = /* @__PURE__ */ __name(async (parsedOutput, context2) => {
      const body = parsedOutput.body;
      const deserialized = de_ExpiredTokenException(body.Error, context2);
      const exception = new ExpiredTokenException2({
        $metadata: deserializeMetadata5(parsedOutput),
        ...deserialized
      });
      return decorateServiceException(exception, body);
    }, "de_ExpiredTokenExceptionRes");
    de_IDPCommunicationErrorExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context2) => {
      const body = parsedOutput.body;
      const deserialized = de_IDPCommunicationErrorException(body.Error, context2);
      const exception = new IDPCommunicationErrorException({
        $metadata: deserializeMetadata5(parsedOutput),
        ...deserialized
      });
      return decorateServiceException(exception, body);
    }, "de_IDPCommunicationErrorExceptionRes");
    de_IDPRejectedClaimExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context2) => {
      const body = parsedOutput.body;
      const deserialized = de_IDPRejectedClaimException(body.Error, context2);
      const exception = new IDPRejectedClaimException({
        $metadata: deserializeMetadata5(parsedOutput),
        ...deserialized
      });
      return decorateServiceException(exception, body);
    }, "de_IDPRejectedClaimExceptionRes");
    de_InvalidAuthorizationMessageExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context2) => {
      const body = parsedOutput.body;
      const deserialized = de_InvalidAuthorizationMessageException(body.Error, context2);
      const exception = new InvalidAuthorizationMessageException({
        $metadata: deserializeMetadata5(parsedOutput),
        ...deserialized
      });
      return decorateServiceException(exception, body);
    }, "de_InvalidAuthorizationMessageExceptionRes");
    de_InvalidIdentityTokenExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context2) => {
      const body = parsedOutput.body;
      const deserialized = de_InvalidIdentityTokenException(body.Error, context2);
      const exception = new InvalidIdentityTokenException({
        $metadata: deserializeMetadata5(parsedOutput),
        ...deserialized
      });
      return decorateServiceException(exception, body);
    }, "de_InvalidIdentityTokenExceptionRes");
    de_MalformedPolicyDocumentExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context2) => {
      const body = parsedOutput.body;
      const deserialized = de_MalformedPolicyDocumentException(body.Error, context2);
      const exception = new MalformedPolicyDocumentException({
        $metadata: deserializeMetadata5(parsedOutput),
        ...deserialized
      });
      return decorateServiceException(exception, body);
    }, "de_MalformedPolicyDocumentExceptionRes");
    de_PackedPolicyTooLargeExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context2) => {
      const body = parsedOutput.body;
      const deserialized = de_PackedPolicyTooLargeException(body.Error, context2);
      const exception = new PackedPolicyTooLargeException({
        $metadata: deserializeMetadata5(parsedOutput),
        ...deserialized
      });
      return decorateServiceException(exception, body);
    }, "de_PackedPolicyTooLargeExceptionRes");
    de_RegionDisabledExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context2) => {
      const body = parsedOutput.body;
      const deserialized = de_RegionDisabledException(body.Error, context2);
      const exception = new RegionDisabledException({
        $metadata: deserializeMetadata5(parsedOutput),
        ...deserialized
      });
      return decorateServiceException(exception, body);
    }, "de_RegionDisabledExceptionRes");
    se_AssumeRoleRequest = /* @__PURE__ */ __name((input, context2) => {
      const entries2 = {};
      if (input[_RA] != null) {
        entries2[_RA] = input[_RA];
      }
      if (input[_RSN] != null) {
        entries2[_RSN] = input[_RSN];
      }
      if (input[_PA] != null) {
        const memberEntries = se_policyDescriptorListType(input[_PA], context2);
        if (input[_PA]?.length === 0) {
          entries2.PolicyArns = [];
        }
        Object.entries(memberEntries).forEach(([key, value]) => {
          const loc = `PolicyArns.${key}`;
          entries2[loc] = value;
        });
      }
      if (input[_P2] != null) {
        entries2[_P2] = input[_P2];
      }
      if (input[_DS] != null) {
        entries2[_DS] = input[_DS];
      }
      if (input[_T2] != null) {
        const memberEntries = se_tagListType(input[_T2], context2);
        if (input[_T2]?.length === 0) {
          entries2.Tags = [];
        }
        Object.entries(memberEntries).forEach(([key, value]) => {
          const loc = `Tags.${key}`;
          entries2[loc] = value;
        });
      }
      if (input[_TTK] != null) {
        const memberEntries = se_tagKeyListType(input[_TTK], context2);
        if (input[_TTK]?.length === 0) {
          entries2.TransitiveTagKeys = [];
        }
        Object.entries(memberEntries).forEach(([key, value]) => {
          const loc = `TransitiveTagKeys.${key}`;
          entries2[loc] = value;
        });
      }
      if (input[_EI] != null) {
        entries2[_EI] = input[_EI];
      }
      if (input[_SN] != null) {
        entries2[_SN] = input[_SN];
      }
      if (input[_TC2] != null) {
        entries2[_TC2] = input[_TC2];
      }
      if (input[_SI] != null) {
        entries2[_SI] = input[_SI];
      }
      if (input[_PC2] != null) {
        const memberEntries = se_ProvidedContextsListType(input[_PC2], context2);
        if (input[_PC2]?.length === 0) {
          entries2.ProvidedContexts = [];
        }
        Object.entries(memberEntries).forEach(([key, value]) => {
          const loc = `ProvidedContexts.${key}`;
          entries2[loc] = value;
        });
      }
      return entries2;
    }, "se_AssumeRoleRequest");
    se_AssumeRoleWithSAMLRequest = /* @__PURE__ */ __name((input, context2) => {
      const entries2 = {};
      if (input[_RA] != null) {
        entries2[_RA] = input[_RA];
      }
      if (input[_PAr] != null) {
        entries2[_PAr] = input[_PAr];
      }
      if (input[_SAMLA] != null) {
        entries2[_SAMLA] = input[_SAMLA];
      }
      if (input[_PA] != null) {
        const memberEntries = se_policyDescriptorListType(input[_PA], context2);
        if (input[_PA]?.length === 0) {
          entries2.PolicyArns = [];
        }
        Object.entries(memberEntries).forEach(([key, value]) => {
          const loc = `PolicyArns.${key}`;
          entries2[loc] = value;
        });
      }
      if (input[_P2] != null) {
        entries2[_P2] = input[_P2];
      }
      if (input[_DS] != null) {
        entries2[_DS] = input[_DS];
      }
      return entries2;
    }, "se_AssumeRoleWithSAMLRequest");
    se_AssumeRoleWithWebIdentityRequest = /* @__PURE__ */ __name((input, context2) => {
      const entries2 = {};
      if (input[_RA] != null) {
        entries2[_RA] = input[_RA];
      }
      if (input[_RSN] != null) {
        entries2[_RSN] = input[_RSN];
      }
      if (input[_WIT] != null) {
        entries2[_WIT] = input[_WIT];
      }
      if (input[_PI2] != null) {
        entries2[_PI2] = input[_PI2];
      }
      if (input[_PA] != null) {
        const memberEntries = se_policyDescriptorListType(input[_PA], context2);
        if (input[_PA]?.length === 0) {
          entries2.PolicyArns = [];
        }
        Object.entries(memberEntries).forEach(([key, value]) => {
          const loc = `PolicyArns.${key}`;
          entries2[loc] = value;
        });
      }
      if (input[_P2] != null) {
        entries2[_P2] = input[_P2];
      }
      if (input[_DS] != null) {
        entries2[_DS] = input[_DS];
      }
      return entries2;
    }, "se_AssumeRoleWithWebIdentityRequest");
    se_AssumeRootRequest = /* @__PURE__ */ __name((input, context2) => {
      const entries2 = {};
      if (input[_TP2] != null) {
        entries2[_TP2] = input[_TP2];
      }
      if (input[_TPA] != null) {
        const memberEntries = se_PolicyDescriptorType(input[_TPA], context2);
        Object.entries(memberEntries).forEach(([key, value]) => {
          const loc = `TaskPolicyArn.${key}`;
          entries2[loc] = value;
        });
      }
      if (input[_DS] != null) {
        entries2[_DS] = input[_DS];
      }
      return entries2;
    }, "se_AssumeRootRequest");
    se_DecodeAuthorizationMessageRequest = /* @__PURE__ */ __name((input, context2) => {
      const entries2 = {};
      if (input[_EM2] != null) {
        entries2[_EM2] = input[_EM2];
      }
      return entries2;
    }, "se_DecodeAuthorizationMessageRequest");
    se_GetAccessKeyInfoRequest = /* @__PURE__ */ __name((input, context2) => {
      const entries2 = {};
      if (input[_AKI2] != null) {
        entries2[_AKI2] = input[_AKI2];
      }
      return entries2;
    }, "se_GetAccessKeyInfoRequest");
    se_GetCallerIdentityRequest = /* @__PURE__ */ __name((input, context2) => {
      const entries2 = {};
      return entries2;
    }, "se_GetCallerIdentityRequest");
    se_GetFederationTokenRequest = /* @__PURE__ */ __name((input, context2) => {
      const entries2 = {};
      if (input[_N2] != null) {
        entries2[_N2] = input[_N2];
      }
      if (input[_P2] != null) {
        entries2[_P2] = input[_P2];
      }
      if (input[_PA] != null) {
        const memberEntries = se_policyDescriptorListType(input[_PA], context2);
        if (input[_PA]?.length === 0) {
          entries2.PolicyArns = [];
        }
        Object.entries(memberEntries).forEach(([key, value]) => {
          const loc = `PolicyArns.${key}`;
          entries2[loc] = value;
        });
      }
      if (input[_DS] != null) {
        entries2[_DS] = input[_DS];
      }
      if (input[_T2] != null) {
        const memberEntries = se_tagListType(input[_T2], context2);
        if (input[_T2]?.length === 0) {
          entries2.Tags = [];
        }
        Object.entries(memberEntries).forEach(([key, value]) => {
          const loc = `Tags.${key}`;
          entries2[loc] = value;
        });
      }
      return entries2;
    }, "se_GetFederationTokenRequest");
    se_GetSessionTokenRequest = /* @__PURE__ */ __name((input, context2) => {
      const entries2 = {};
      if (input[_DS] != null) {
        entries2[_DS] = input[_DS];
      }
      if (input[_SN] != null) {
        entries2[_SN] = input[_SN];
      }
      if (input[_TC2] != null) {
        entries2[_TC2] = input[_TC2];
      }
      return entries2;
    }, "se_GetSessionTokenRequest");
    se_policyDescriptorListType = /* @__PURE__ */ __name((input, context2) => {
      const entries2 = {};
      let counter = 1;
      for (const entry of input) {
        if (entry === null) {
          continue;
        }
        const memberEntries = se_PolicyDescriptorType(entry, context2);
        Object.entries(memberEntries).forEach(([key, value]) => {
          entries2[`member.${counter}.${key}`] = value;
        });
        counter++;
      }
      return entries2;
    }, "se_policyDescriptorListType");
    se_PolicyDescriptorType = /* @__PURE__ */ __name((input, context2) => {
      const entries2 = {};
      if (input[_a4] != null) {
        entries2[_a4] = input[_a4];
      }
      return entries2;
    }, "se_PolicyDescriptorType");
    se_ProvidedContext = /* @__PURE__ */ __name((input, context2) => {
      const entries2 = {};
      if (input[_PAro] != null) {
        entries2[_PAro] = input[_PAro];
      }
      if (input[_CA2] != null) {
        entries2[_CA2] = input[_CA2];
      }
      return entries2;
    }, "se_ProvidedContext");
    se_ProvidedContextsListType = /* @__PURE__ */ __name((input, context2) => {
      const entries2 = {};
      let counter = 1;
      for (const entry of input) {
        if (entry === null) {
          continue;
        }
        const memberEntries = se_ProvidedContext(entry, context2);
        Object.entries(memberEntries).forEach(([key, value]) => {
          entries2[`member.${counter}.${key}`] = value;
        });
        counter++;
      }
      return entries2;
    }, "se_ProvidedContextsListType");
    se_Tag2 = /* @__PURE__ */ __name((input, context2) => {
      const entries2 = {};
      if (input[_K2] != null) {
        entries2[_K2] = input[_K2];
      }
      if (input[_Va2] != null) {
        entries2[_Va2] = input[_Va2];
      }
      return entries2;
    }, "se_Tag");
    se_tagKeyListType = /* @__PURE__ */ __name((input, context2) => {
      const entries2 = {};
      let counter = 1;
      for (const entry of input) {
        if (entry === null) {
          continue;
        }
        entries2[`member.${counter}`] = entry;
        counter++;
      }
      return entries2;
    }, "se_tagKeyListType");
    se_tagListType = /* @__PURE__ */ __name((input, context2) => {
      const entries2 = {};
      let counter = 1;
      for (const entry of input) {
        if (entry === null) {
          continue;
        }
        const memberEntries = se_Tag2(entry, context2);
        Object.entries(memberEntries).forEach(([key, value]) => {
          entries2[`member.${counter}.${key}`] = value;
        });
        counter++;
      }
      return entries2;
    }, "se_tagListType");
    de_AssumedRoleUser = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_ARI2] != null) {
        contents[_ARI2] = expectString(output[_ARI2]);
      }
      if (output[_Ar] != null) {
        contents[_Ar] = expectString(output[_Ar]);
      }
      return contents;
    }, "de_AssumedRoleUser");
    de_AssumeRoleResponse = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_C2] != null) {
        contents[_C2] = de_Credentials(output[_C2], context2);
      }
      if (output[_ARU] != null) {
        contents[_ARU] = de_AssumedRoleUser(output[_ARU], context2);
      }
      if (output[_PPS] != null) {
        contents[_PPS] = strictParseInt32(output[_PPS]);
      }
      if (output[_SI] != null) {
        contents[_SI] = expectString(output[_SI]);
      }
      return contents;
    }, "de_AssumeRoleResponse");
    de_AssumeRoleWithSAMLResponse = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_C2] != null) {
        contents[_C2] = de_Credentials(output[_C2], context2);
      }
      if (output[_ARU] != null) {
        contents[_ARU] = de_AssumedRoleUser(output[_ARU], context2);
      }
      if (output[_PPS] != null) {
        contents[_PPS] = strictParseInt32(output[_PPS]);
      }
      if (output[_S2] != null) {
        contents[_S2] = expectString(output[_S2]);
      }
      if (output[_ST2] != null) {
        contents[_ST2] = expectString(output[_ST2]);
      }
      if (output[_I2] != null) {
        contents[_I2] = expectString(output[_I2]);
      }
      if (output[_Au] != null) {
        contents[_Au] = expectString(output[_Au]);
      }
      if (output[_NQ] != null) {
        contents[_NQ] = expectString(output[_NQ]);
      }
      if (output[_SI] != null) {
        contents[_SI] = expectString(output[_SI]);
      }
      return contents;
    }, "de_AssumeRoleWithSAMLResponse");
    de_AssumeRoleWithWebIdentityResponse = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_C2] != null) {
        contents[_C2] = de_Credentials(output[_C2], context2);
      }
      if (output[_SFWIT] != null) {
        contents[_SFWIT] = expectString(output[_SFWIT]);
      }
      if (output[_ARU] != null) {
        contents[_ARU] = de_AssumedRoleUser(output[_ARU], context2);
      }
      if (output[_PPS] != null) {
        contents[_PPS] = strictParseInt32(output[_PPS]);
      }
      if (output[_Pr2] != null) {
        contents[_Pr2] = expectString(output[_Pr2]);
      }
      if (output[_Au] != null) {
        contents[_Au] = expectString(output[_Au]);
      }
      if (output[_SI] != null) {
        contents[_SI] = expectString(output[_SI]);
      }
      return contents;
    }, "de_AssumeRoleWithWebIdentityResponse");
    de_AssumeRootResponse = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_C2] != null) {
        contents[_C2] = de_Credentials(output[_C2], context2);
      }
      if (output[_SI] != null) {
        contents[_SI] = expectString(output[_SI]);
      }
      return contents;
    }, "de_AssumeRootResponse");
    de_Credentials = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_AKI2] != null) {
        contents[_AKI2] = expectString(output[_AKI2]);
      }
      if (output[_SAK2] != null) {
        contents[_SAK2] = expectString(output[_SAK2]);
      }
      if (output[_STe] != null) {
        contents[_STe] = expectString(output[_STe]);
      }
      if (output[_E2] != null) {
        contents[_E2] = expectNonNull(parseRfc3339DateTimeWithOffset(output[_E2]));
      }
      return contents;
    }, "de_Credentials");
    de_DecodeAuthorizationMessageResponse = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_DM2] != null) {
        contents[_DM2] = expectString(output[_DM2]);
      }
      return contents;
    }, "de_DecodeAuthorizationMessageResponse");
    de_ExpiredTokenException = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_m2] != null) {
        contents[_m2] = expectString(output[_m2]);
      }
      return contents;
    }, "de_ExpiredTokenException");
    de_FederatedUser = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_FUI] != null) {
        contents[_FUI] = expectString(output[_FUI]);
      }
      if (output[_Ar] != null) {
        contents[_Ar] = expectString(output[_Ar]);
      }
      return contents;
    }, "de_FederatedUser");
    de_GetAccessKeyInfoResponse = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_Ac2] != null) {
        contents[_Ac2] = expectString(output[_Ac2]);
      }
      return contents;
    }, "de_GetAccessKeyInfoResponse");
    de_GetCallerIdentityResponse = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_UI2] != null) {
        contents[_UI2] = expectString(output[_UI2]);
      }
      if (output[_Ac2] != null) {
        contents[_Ac2] = expectString(output[_Ac2]);
      }
      if (output[_Ar] != null) {
        contents[_Ar] = expectString(output[_Ar]);
      }
      return contents;
    }, "de_GetCallerIdentityResponse");
    de_GetFederationTokenResponse = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_C2] != null) {
        contents[_C2] = de_Credentials(output[_C2], context2);
      }
      if (output[_FU] != null) {
        contents[_FU] = de_FederatedUser(output[_FU], context2);
      }
      if (output[_PPS] != null) {
        contents[_PPS] = strictParseInt32(output[_PPS]);
      }
      return contents;
    }, "de_GetFederationTokenResponse");
    de_GetSessionTokenResponse = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_C2] != null) {
        contents[_C2] = de_Credentials(output[_C2], context2);
      }
      return contents;
    }, "de_GetSessionTokenResponse");
    de_IDPCommunicationErrorException = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_m2] != null) {
        contents[_m2] = expectString(output[_m2]);
      }
      return contents;
    }, "de_IDPCommunicationErrorException");
    de_IDPRejectedClaimException = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_m2] != null) {
        contents[_m2] = expectString(output[_m2]);
      }
      return contents;
    }, "de_IDPRejectedClaimException");
    de_InvalidAuthorizationMessageException = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_m2] != null) {
        contents[_m2] = expectString(output[_m2]);
      }
      return contents;
    }, "de_InvalidAuthorizationMessageException");
    de_InvalidIdentityTokenException = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_m2] != null) {
        contents[_m2] = expectString(output[_m2]);
      }
      return contents;
    }, "de_InvalidIdentityTokenException");
    de_MalformedPolicyDocumentException = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_m2] != null) {
        contents[_m2] = expectString(output[_m2]);
      }
      return contents;
    }, "de_MalformedPolicyDocumentException");
    de_PackedPolicyTooLargeException = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_m2] != null) {
        contents[_m2] = expectString(output[_m2]);
      }
      return contents;
    }, "de_PackedPolicyTooLargeException");
    de_RegionDisabledException = /* @__PURE__ */ __name((output, context2) => {
      const contents = {};
      if (output[_m2] != null) {
        contents[_m2] = expectString(output[_m2]);
      }
      return contents;
    }, "de_RegionDisabledException");
    deserializeMetadata5 = /* @__PURE__ */ __name((output) => ({
      httpStatusCode: output.statusCode,
      requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
      extendedRequestId: output.headers["x-amz-id-2"],
      cfId: output.headers["x-amz-cf-id"]
    }), "deserializeMetadata");
    throwDefaultError5 = withBaseException(STSServiceException);
    buildHttpRpcRequest = /* @__PURE__ */ __name(async (context2, headers, path84, resolvedHostname, body) => {
      const { hostname: hostname2, protocol = "https", port, path: basePath } = await context2.endpoint();
      const contents = {
        protocol,
        hostname: hostname2,
        port,
        method: "POST",
        path: basePath.endsWith("/") ? basePath.slice(0, -1) + path84 : basePath + path84,
        headers
      };
      if (resolvedHostname !== void 0) {
        contents.hostname = resolvedHostname;
      }
      if (body !== void 0) {
        contents.body = body;
      }
      return new HttpRequest(contents);
    }, "buildHttpRpcRequest");
    SHARED_HEADERS = {
      "content-type": "application/x-www-form-urlencoded"
    };
    _4 = "2011-06-15";
    _A2 = "Action";
    _AKI2 = "AccessKeyId";
    _AR2 = "AssumeRole";
    _ARI2 = "AssumedRoleId";
    _ARU = "AssumedRoleUser";
    _ARWSAML = "AssumeRoleWithSAML";
    _ARWWI = "AssumeRoleWithWebIdentity";
    _ARs = "AssumeRoot";
    _Ac2 = "Account";
    _Ar = "Arn";
    _Au = "Audience";
    _C2 = "Credentials";
    _CA2 = "ContextAssertion";
    _DAM = "DecodeAuthorizationMessage";
    _DM2 = "DecodedMessage";
    _DS = "DurationSeconds";
    _E2 = "Expiration";
    _EI = "ExternalId";
    _EM2 = "EncodedMessage";
    _FU = "FederatedUser";
    _FUI = "FederatedUserId";
    _GAKI = "GetAccessKeyInfo";
    _GCI = "GetCallerIdentity";
    _GFT = "GetFederationToken";
    _GST = "GetSessionToken";
    _I2 = "Issuer";
    _K2 = "Key";
    _N2 = "Name";
    _NQ = "NameQualifier";
    _P2 = "Policy";
    _PA = "PolicyArns";
    _PAr = "PrincipalArn";
    _PAro = "ProviderArn";
    _PC2 = "ProvidedContexts";
    _PI2 = "ProviderId";
    _PPS = "PackedPolicySize";
    _Pr2 = "Provider";
    _RA = "RoleArn";
    _RSN = "RoleSessionName";
    _S2 = "Subject";
    _SAK2 = "SecretAccessKey";
    _SAMLA = "SAMLAssertion";
    _SFWIT = "SubjectFromWebIdentityToken";
    _SI = "SourceIdentity";
    _SN = "SerialNumber";
    _ST2 = "SubjectType";
    _STe = "SessionToken";
    _T2 = "Tags";
    _TC2 = "TokenCode";
    _TP2 = "TargetPrincipal";
    _TPA = "TaskPolicyArn";
    _TTK = "TransitiveTagKeys";
    _UI2 = "UserId";
    _V2 = "Version";
    _Va2 = "Value";
    _WIT = "WebIdentityToken";
    _a4 = "arn";
    _m2 = "message";
    buildFormUrlencodedString = /* @__PURE__ */ __name((formEntries) => Object.entries(formEntries).map(([key, value]) => extendedEncodeURIComponent(key) + "=" + extendedEncodeURIComponent(value)).join("&"), "buildFormUrlencodedString");
    loadQueryErrorCode = /* @__PURE__ */ __name((output, data) => {
      if (data.Error?.Code !== void 0) {
        return data.Error.Code;
      }
      if (output.statusCode == 404) {
        return "NotFound";
      }
    }, "loadQueryErrorCode");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/commands/AssumeRoleCommand.js
var AssumeRoleCommand;
var init_AssumeRoleCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/commands/AssumeRoleCommand.js"() {
    init_import_meta_url();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters4();
    init_models_04();
    init_Aws_query();
    AssumeRoleCommand = class extends Command.classBuilder().ep(commonParams4).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions())
      ];
    }).s("AWSSecurityTokenServiceV20110615", "AssumeRole", {}).n("STSClient", "AssumeRoleCommand").f(void 0, AssumeRoleResponseFilterSensitiveLog).ser(se_AssumeRoleCommand).de(de_AssumeRoleCommand).build() {
      static {
        __name(this, "AssumeRoleCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/commands/AssumeRoleWithSAMLCommand.js
var AssumeRoleWithSAMLCommand;
var init_AssumeRoleWithSAMLCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/commands/AssumeRoleWithSAMLCommand.js"() {
    init_import_meta_url();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters4();
    init_models_04();
    init_Aws_query();
    AssumeRoleWithSAMLCommand = class extends Command.classBuilder().ep(commonParams4).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions())
      ];
    }).s("AWSSecurityTokenServiceV20110615", "AssumeRoleWithSAML", {}).n("STSClient", "AssumeRoleWithSAMLCommand").f(AssumeRoleWithSAMLRequestFilterSensitiveLog, AssumeRoleWithSAMLResponseFilterSensitiveLog).ser(se_AssumeRoleWithSAMLCommand).de(de_AssumeRoleWithSAMLCommand).build() {
      static {
        __name(this, "AssumeRoleWithSAMLCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/commands/AssumeRoleWithWebIdentityCommand.js
var AssumeRoleWithWebIdentityCommand;
var init_AssumeRoleWithWebIdentityCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/commands/AssumeRoleWithWebIdentityCommand.js"() {
    init_import_meta_url();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters4();
    init_models_04();
    init_Aws_query();
    AssumeRoleWithWebIdentityCommand = class extends Command.classBuilder().ep(commonParams4).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions())
      ];
    }).s("AWSSecurityTokenServiceV20110615", "AssumeRoleWithWebIdentity", {}).n("STSClient", "AssumeRoleWithWebIdentityCommand").f(AssumeRoleWithWebIdentityRequestFilterSensitiveLog, AssumeRoleWithWebIdentityResponseFilterSensitiveLog).ser(se_AssumeRoleWithWebIdentityCommand).de(de_AssumeRoleWithWebIdentityCommand).build() {
      static {
        __name(this, "AssumeRoleWithWebIdentityCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/commands/AssumeRootCommand.js
var AssumeRootCommand;
var init_AssumeRootCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/commands/AssumeRootCommand.js"() {
    init_import_meta_url();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters4();
    init_models_04();
    init_Aws_query();
    AssumeRootCommand = class extends Command.classBuilder().ep(commonParams4).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions())
      ];
    }).s("AWSSecurityTokenServiceV20110615", "AssumeRoot", {}).n("STSClient", "AssumeRootCommand").f(void 0, AssumeRootResponseFilterSensitiveLog).ser(se_AssumeRootCommand).de(de_AssumeRootCommand).build() {
      static {
        __name(this, "AssumeRootCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/commands/DecodeAuthorizationMessageCommand.js
var DecodeAuthorizationMessageCommand;
var init_DecodeAuthorizationMessageCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/commands/DecodeAuthorizationMessageCommand.js"() {
    init_import_meta_url();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters4();
    init_Aws_query();
    DecodeAuthorizationMessageCommand = class extends Command.classBuilder().ep(commonParams4).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions())
      ];
    }).s("AWSSecurityTokenServiceV20110615", "DecodeAuthorizationMessage", {}).n("STSClient", "DecodeAuthorizationMessageCommand").f(void 0, void 0).ser(se_DecodeAuthorizationMessageCommand).de(de_DecodeAuthorizationMessageCommand).build() {
      static {
        __name(this, "DecodeAuthorizationMessageCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/commands/GetAccessKeyInfoCommand.js
var GetAccessKeyInfoCommand;
var init_GetAccessKeyInfoCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/commands/GetAccessKeyInfoCommand.js"() {
    init_import_meta_url();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters4();
    init_Aws_query();
    GetAccessKeyInfoCommand = class extends Command.classBuilder().ep(commonParams4).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions())
      ];
    }).s("AWSSecurityTokenServiceV20110615", "GetAccessKeyInfo", {}).n("STSClient", "GetAccessKeyInfoCommand").f(void 0, void 0).ser(se_GetAccessKeyInfoCommand).de(de_GetAccessKeyInfoCommand).build() {
      static {
        __name(this, "GetAccessKeyInfoCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/commands/GetCallerIdentityCommand.js
var GetCallerIdentityCommand;
var init_GetCallerIdentityCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/commands/GetCallerIdentityCommand.js"() {
    init_import_meta_url();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters4();
    init_Aws_query();
    GetCallerIdentityCommand = class extends Command.classBuilder().ep(commonParams4).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions())
      ];
    }).s("AWSSecurityTokenServiceV20110615", "GetCallerIdentity", {}).n("STSClient", "GetCallerIdentityCommand").f(void 0, void 0).ser(se_GetCallerIdentityCommand).de(de_GetCallerIdentityCommand).build() {
      static {
        __name(this, "GetCallerIdentityCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/commands/GetFederationTokenCommand.js
var GetFederationTokenCommand;
var init_GetFederationTokenCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/commands/GetFederationTokenCommand.js"() {
    init_import_meta_url();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters4();
    init_models_04();
    init_Aws_query();
    GetFederationTokenCommand = class extends Command.classBuilder().ep(commonParams4).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions())
      ];
    }).s("AWSSecurityTokenServiceV20110615", "GetFederationToken", {}).n("STSClient", "GetFederationTokenCommand").f(void 0, GetFederationTokenResponseFilterSensitiveLog).ser(se_GetFederationTokenCommand).de(de_GetFederationTokenCommand).build() {
      static {
        __name(this, "GetFederationTokenCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/commands/GetSessionTokenCommand.js
var GetSessionTokenCommand;
var init_GetSessionTokenCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/commands/GetSessionTokenCommand.js"() {
    init_import_meta_url();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters4();
    init_models_04();
    init_Aws_query();
    GetSessionTokenCommand = class extends Command.classBuilder().ep(commonParams4).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions())
      ];
    }).s("AWSSecurityTokenServiceV20110615", "GetSessionToken", {}).n("STSClient", "GetSessionTokenCommand").f(void 0, GetSessionTokenResponseFilterSensitiveLog).ser(se_GetSessionTokenCommand).de(de_GetSessionTokenCommand).build() {
      static {
        __name(this, "GetSessionTokenCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/STS.js
var commands3, STS;
var init_STS = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/STS.js"() {
    init_import_meta_url();
    init_dist_es20();
    init_AssumeRoleCommand();
    init_AssumeRoleWithSAMLCommand();
    init_AssumeRoleWithWebIdentityCommand();
    init_AssumeRootCommand();
    init_DecodeAuthorizationMessageCommand();
    init_GetAccessKeyInfoCommand();
    init_GetCallerIdentityCommand();
    init_GetFederationTokenCommand();
    init_GetSessionTokenCommand();
    init_STSClient();
    commands3 = {
      AssumeRoleCommand,
      AssumeRoleWithSAMLCommand,
      AssumeRoleWithWebIdentityCommand,
      AssumeRootCommand,
      DecodeAuthorizationMessageCommand,
      GetAccessKeyInfoCommand,
      GetCallerIdentityCommand,
      GetFederationTokenCommand,
      GetSessionTokenCommand
    };
    STS = class extends STSClient {
      static {
        __name(this, "STS");
      }
    };
    createAggregatedClient(commands3, STS);
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/commands/index.js
var init_commands7 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/commands/index.js"() {
    init_import_meta_url();
    init_AssumeRoleCommand();
    init_AssumeRoleWithSAMLCommand();
    init_AssumeRoleWithWebIdentityCommand();
    init_AssumeRootCommand();
    init_DecodeAuthorizationMessageCommand();
    init_GetAccessKeyInfoCommand();
    init_GetCallerIdentityCommand();
    init_GetFederationTokenCommand();
    init_GetSessionTokenCommand();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/models/index.js
var init_models4 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/models/index.js"() {
    init_import_meta_url();
    init_models_04();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/defaultStsRoleAssumers.js
var ASSUME_ROLE_DEFAULT_REGION, getAccountIdFromAssumedRoleUser, resolveRegion, getDefaultRoleAssumer, getDefaultRoleAssumerWithWebIdentity, isH2;
var init_defaultStsRoleAssumers = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/defaultStsRoleAssumers.js"() {
    init_import_meta_url();
    init_client8();
    init_AssumeRoleCommand();
    init_AssumeRoleWithWebIdentityCommand();
    ASSUME_ROLE_DEFAULT_REGION = "us-east-1";
    getAccountIdFromAssumedRoleUser = /* @__PURE__ */ __name((assumedRoleUser) => {
      if (typeof assumedRoleUser?.Arn === "string") {
        const arnComponents = assumedRoleUser.Arn.split(":");
        if (arnComponents.length > 4 && arnComponents[4] !== "") {
          return arnComponents[4];
        }
      }
      return void 0;
    }, "getAccountIdFromAssumedRoleUser");
    resolveRegion = /* @__PURE__ */ __name(async (_region, _parentRegion, credentialProviderLogger) => {
      const region = typeof _region === "function" ? await _region() : _region;
      const parentRegion = typeof _parentRegion === "function" ? await _parentRegion() : _parentRegion;
      credentialProviderLogger?.debug?.("@aws-sdk/client-sts::resolveRegion", "accepting first of:", `${region} (provider)`, `${parentRegion} (parent client)`, `${ASSUME_ROLE_DEFAULT_REGION} (STS default)`);
      return region ?? parentRegion ?? ASSUME_ROLE_DEFAULT_REGION;
    }, "resolveRegion");
    getDefaultRoleAssumer = /* @__PURE__ */ __name((stsOptions, stsClientCtor) => {
      let stsClient;
      let closureSourceCreds;
      return async (sourceCreds, params) => {
        closureSourceCreds = sourceCreds;
        if (!stsClient) {
          const { logger: logger4 = stsOptions?.parentClientConfig?.logger, region, requestHandler = stsOptions?.parentClientConfig?.requestHandler, credentialProviderLogger } = stsOptions;
          const resolvedRegion = await resolveRegion(region, stsOptions?.parentClientConfig?.region, credentialProviderLogger);
          const isCompatibleRequestHandler = !isH2(requestHandler);
          stsClient = new stsClientCtor({
            credentialDefaultProvider: /* @__PURE__ */ __name(() => async () => closureSourceCreds, "credentialDefaultProvider"),
            region: resolvedRegion,
            requestHandler: isCompatibleRequestHandler ? requestHandler : void 0,
            logger: logger4
          });
        }
        const { Credentials, AssumedRoleUser } = await stsClient.send(new AssumeRoleCommand(params));
        if (!Credentials || !Credentials.AccessKeyId || !Credentials.SecretAccessKey) {
          throw new Error(`Invalid response from STS.assumeRole call with role ${params.RoleArn}`);
        }
        const accountId = getAccountIdFromAssumedRoleUser(AssumedRoleUser);
        const credentials = {
          accessKeyId: Credentials.AccessKeyId,
          secretAccessKey: Credentials.SecretAccessKey,
          sessionToken: Credentials.SessionToken,
          expiration: Credentials.Expiration,
          ...Credentials.CredentialScope && { credentialScope: Credentials.CredentialScope },
          ...accountId && { accountId }
        };
        setCredentialFeature(credentials, "CREDENTIALS_STS_ASSUME_ROLE", "i");
        return credentials;
      };
    }, "getDefaultRoleAssumer");
    getDefaultRoleAssumerWithWebIdentity = /* @__PURE__ */ __name((stsOptions, stsClientCtor) => {
      let stsClient;
      return async (params) => {
        if (!stsClient) {
          const { logger: logger4 = stsOptions?.parentClientConfig?.logger, region, requestHandler = stsOptions?.parentClientConfig?.requestHandler, credentialProviderLogger } = stsOptions;
          const resolvedRegion = await resolveRegion(region, stsOptions?.parentClientConfig?.region, credentialProviderLogger);
          const isCompatibleRequestHandler = !isH2(requestHandler);
          stsClient = new stsClientCtor({
            region: resolvedRegion,
            requestHandler: isCompatibleRequestHandler ? requestHandler : void 0,
            logger: logger4
          });
        }
        const { Credentials, AssumedRoleUser } = await stsClient.send(new AssumeRoleWithWebIdentityCommand(params));
        if (!Credentials || !Credentials.AccessKeyId || !Credentials.SecretAccessKey) {
          throw new Error(`Invalid response from STS.assumeRoleWithWebIdentity call with role ${params.RoleArn}`);
        }
        const accountId = getAccountIdFromAssumedRoleUser(AssumedRoleUser);
        const credentials = {
          accessKeyId: Credentials.AccessKeyId,
          secretAccessKey: Credentials.SecretAccessKey,
          sessionToken: Credentials.SessionToken,
          expiration: Credentials.Expiration,
          ...Credentials.CredentialScope && { credentialScope: Credentials.CredentialScope },
          ...accountId && { accountId }
        };
        if (accountId) {
          setCredentialFeature(credentials, "RESOLVED_ACCOUNT_ID", "T");
        }
        setCredentialFeature(credentials, "CREDENTIALS_STS_ASSUME_ROLE_WEB_ID", "k");
        return credentials;
      };
    }, "getDefaultRoleAssumerWithWebIdentity");
    isH2 = /* @__PURE__ */ __name((requestHandler) => {
      return requestHandler?.metadata?.handlerProtocol === "h2";
    }, "isH2");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/defaultRoleAssumers.js
var getCustomizableStsClientCtor, getDefaultRoleAssumer2, getDefaultRoleAssumerWithWebIdentity2, decorateDefaultCredentialProvider;
var init_defaultRoleAssumers = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/defaultRoleAssumers.js"() {
    init_import_meta_url();
    init_defaultStsRoleAssumers();
    init_STSClient();
    getCustomizableStsClientCtor = /* @__PURE__ */ __name((baseCtor, customizations) => {
      if (!customizations)
        return baseCtor;
      else
        return class CustomizableSTSClient extends baseCtor {
          static {
            __name(this, "CustomizableSTSClient");
          }
          constructor(config) {
            super(config);
            for (const customization of customizations) {
              this.middlewareStack.use(customization);
            }
          }
        };
    }, "getCustomizableStsClientCtor");
    getDefaultRoleAssumer2 = /* @__PURE__ */ __name((stsOptions = {}, stsPlugins) => getDefaultRoleAssumer(stsOptions, getCustomizableStsClientCtor(STSClient, stsPlugins)), "getDefaultRoleAssumer");
    getDefaultRoleAssumerWithWebIdentity2 = /* @__PURE__ */ __name((stsOptions = {}, stsPlugins) => getDefaultRoleAssumerWithWebIdentity(stsOptions, getCustomizableStsClientCtor(STSClient, stsPlugins)), "getDefaultRoleAssumerWithWebIdentity");
    decorateDefaultCredentialProvider = /* @__PURE__ */ __name((provider) => (input) => provider({
      roleAssumer: getDefaultRoleAssumer2(input),
      roleAssumerWithWebIdentity: getDefaultRoleAssumerWithWebIdentity2(input),
      ...input
    }), "decorateDefaultCredentialProvider");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/index.js
var dist_es_exports6 = {};
__export(dist_es_exports6, {
  $Command: () => Command,
  AssumeRoleCommand: () => AssumeRoleCommand,
  AssumeRoleResponseFilterSensitiveLog: () => AssumeRoleResponseFilterSensitiveLog,
  AssumeRoleWithSAMLCommand: () => AssumeRoleWithSAMLCommand,
  AssumeRoleWithSAMLRequestFilterSensitiveLog: () => AssumeRoleWithSAMLRequestFilterSensitiveLog,
  AssumeRoleWithSAMLResponseFilterSensitiveLog: () => AssumeRoleWithSAMLResponseFilterSensitiveLog,
  AssumeRoleWithWebIdentityCommand: () => AssumeRoleWithWebIdentityCommand,
  AssumeRoleWithWebIdentityRequestFilterSensitiveLog: () => AssumeRoleWithWebIdentityRequestFilterSensitiveLog,
  AssumeRoleWithWebIdentityResponseFilterSensitiveLog: () => AssumeRoleWithWebIdentityResponseFilterSensitiveLog,
  AssumeRootCommand: () => AssumeRootCommand,
  AssumeRootResponseFilterSensitiveLog: () => AssumeRootResponseFilterSensitiveLog,
  CredentialsFilterSensitiveLog: () => CredentialsFilterSensitiveLog,
  DecodeAuthorizationMessageCommand: () => DecodeAuthorizationMessageCommand,
  ExpiredTokenException: () => ExpiredTokenException2,
  GetAccessKeyInfoCommand: () => GetAccessKeyInfoCommand,
  GetCallerIdentityCommand: () => GetCallerIdentityCommand,
  GetFederationTokenCommand: () => GetFederationTokenCommand,
  GetFederationTokenResponseFilterSensitiveLog: () => GetFederationTokenResponseFilterSensitiveLog,
  GetSessionTokenCommand: () => GetSessionTokenCommand,
  GetSessionTokenResponseFilterSensitiveLog: () => GetSessionTokenResponseFilterSensitiveLog,
  IDPCommunicationErrorException: () => IDPCommunicationErrorException,
  IDPRejectedClaimException: () => IDPRejectedClaimException,
  InvalidAuthorizationMessageException: () => InvalidAuthorizationMessageException,
  InvalidIdentityTokenException: () => InvalidIdentityTokenException,
  MalformedPolicyDocumentException: () => MalformedPolicyDocumentException,
  PackedPolicyTooLargeException: () => PackedPolicyTooLargeException,
  RegionDisabledException: () => RegionDisabledException,
  STS: () => STS,
  STSClient: () => STSClient,
  STSServiceException: () => STSServiceException,
  __Client: () => Client,
  decorateDefaultCredentialProvider: () => decorateDefaultCredentialProvider,
  getDefaultRoleAssumer: () => getDefaultRoleAssumer2,
  getDefaultRoleAssumerWithWebIdentity: () => getDefaultRoleAssumerWithWebIdentity2
});
var init_dist_es60 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/index.js"() {
    init_import_meta_url();
    init_STSClient();
    init_STS();
    init_commands7();
    init_models4();
    init_defaultRoleAssumers();
    init_STSServiceException();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+credential-provider-ini@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+clie_bc8234dce1a0330881874845b2d85f32/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveAssumeRoleCredentials.js
var isAssumeRoleProfile, isAssumeRoleWithSourceProfile, isCredentialSourceProfile, resolveAssumeRoleCredentials, isCredentialSourceWithoutRoleArn;
var init_resolveAssumeRoleCredentials = __esm({
  "../../node_modules/.pnpm/@aws-sdk+credential-provider-ini@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+clie_bc8234dce1a0330881874845b2d85f32/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveAssumeRoleCredentials.js"() {
    init_import_meta_url();
    init_client8();
    init_dist_es17();
    init_dist_es38();
    init_resolveCredentialSource();
    init_resolveProfileData();
    isAssumeRoleProfile = /* @__PURE__ */ __name((arg, { profile = "default", logger: logger4 } = {}) => {
      return Boolean(arg) && typeof arg === "object" && typeof arg.role_arn === "string" && ["undefined", "string"].indexOf(typeof arg.role_session_name) > -1 && ["undefined", "string"].indexOf(typeof arg.external_id) > -1 && ["undefined", "string"].indexOf(typeof arg.mfa_serial) > -1 && (isAssumeRoleWithSourceProfile(arg, { profile, logger: logger4 }) || isCredentialSourceProfile(arg, { profile, logger: logger4 }));
    }, "isAssumeRoleProfile");
    isAssumeRoleWithSourceProfile = /* @__PURE__ */ __name((arg, { profile, logger: logger4 }) => {
      const withSourceProfile = typeof arg.source_profile === "string" && typeof arg.credential_source === "undefined";
      if (withSourceProfile) {
        logger4?.debug?.(`    ${profile} isAssumeRoleWithSourceProfile source_profile=${arg.source_profile}`);
      }
      return withSourceProfile;
    }, "isAssumeRoleWithSourceProfile");
    isCredentialSourceProfile = /* @__PURE__ */ __name((arg, { profile, logger: logger4 }) => {
      const withProviderProfile = typeof arg.credential_source === "string" && typeof arg.source_profile === "undefined";
      if (withProviderProfile) {
        logger4?.debug?.(`    ${profile} isCredentialSourceProfile credential_source=${arg.credential_source}`);
      }
      return withProviderProfile;
    }, "isCredentialSourceProfile");
    resolveAssumeRoleCredentials = /* @__PURE__ */ __name(async (profileName, profiles, options, visitedProfiles = {}) => {
      options.logger?.debug("@aws-sdk/credential-provider-ini - resolveAssumeRoleCredentials (STS)");
      const profileData = profiles[profileName];
      const { source_profile, region } = profileData;
      if (!options.roleAssumer) {
        const { getDefaultRoleAssumer: getDefaultRoleAssumer3 } = await Promise.resolve().then(() => (init_dist_es60(), dist_es_exports6));
        options.roleAssumer = getDefaultRoleAssumer3({
          ...options.clientConfig,
          credentialProviderLogger: options.logger,
          parentClientConfig: {
            ...options?.parentClientConfig,
            region: region ?? options?.parentClientConfig?.region
          }
        }, options.clientPlugins);
      }
      if (source_profile && source_profile in visitedProfiles) {
        throw new CredentialsProviderError(`Detected a cycle attempting to resolve credentials for profile ${getProfileName(options)}. Profiles visited: ` + Object.keys(visitedProfiles).join(", "), { logger: options.logger });
      }
      options.logger?.debug(`@aws-sdk/credential-provider-ini - finding credential resolver using ${source_profile ? `source_profile=[${source_profile}]` : `profile=[${profileName}]`}`);
      const sourceCredsProvider = source_profile ? resolveProfileData(source_profile, profiles, options, {
        ...visitedProfiles,
        [source_profile]: true
      }, isCredentialSourceWithoutRoleArn(profiles[source_profile] ?? {})) : (await resolveCredentialSource(profileData.credential_source, profileName, options.logger)(options))();
      if (isCredentialSourceWithoutRoleArn(profileData)) {
        return sourceCredsProvider.then((creds) => setCredentialFeature(creds, "CREDENTIALS_PROFILE_SOURCE_PROFILE", "o"));
      } else {
        const params = {
          RoleArn: profileData.role_arn,
          RoleSessionName: profileData.role_session_name || `aws-sdk-js-${Date.now()}`,
          ExternalId: profileData.external_id,
          DurationSeconds: parseInt(profileData.duration_seconds || "3600", 10)
        };
        const { mfa_serial } = profileData;
        if (mfa_serial) {
          if (!options.mfaCodeProvider) {
            throw new CredentialsProviderError(`Profile ${profileName} requires multi-factor authentication, but no MFA code callback was provided.`, { logger: options.logger, tryNextLink: false });
          }
          params.SerialNumber = mfa_serial;
          params.TokenCode = await options.mfaCodeProvider(mfa_serial);
        }
        const sourceCreds = await sourceCredsProvider;
        return options.roleAssumer(sourceCreds, params).then((creds) => setCredentialFeature(creds, "CREDENTIALS_PROFILE_SOURCE_PROFILE", "o"));
      }
    }, "resolveAssumeRoleCredentials");
    isCredentialSourceWithoutRoleArn = /* @__PURE__ */ __name((section) => {
      return !section.role_arn && !!section.credential_source;
    }, "isCredentialSourceWithoutRoleArn");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+credential-provider-process@3.716.0/node_modules/@aws-sdk/credential-provider-process/dist-es/getValidatedProcessCredentials.js
var getValidatedProcessCredentials;
var init_getValidatedProcessCredentials = __esm({
  "../../node_modules/.pnpm/@aws-sdk+credential-provider-process@3.716.0/node_modules/@aws-sdk/credential-provider-process/dist-es/getValidatedProcessCredentials.js"() {
    init_import_meta_url();
    init_client8();
    getValidatedProcessCredentials = /* @__PURE__ */ __name((profileName, data, profiles) => {
      if (data.Version !== 1) {
        throw Error(`Profile ${profileName} credential_process did not return Version 1.`);
      }
      if (data.AccessKeyId === void 0 || data.SecretAccessKey === void 0) {
        throw Error(`Profile ${profileName} credential_process returned invalid credentials.`);
      }
      if (data.Expiration) {
        const currentTime = /* @__PURE__ */ new Date();
        const expireTime = new Date(data.Expiration);
        if (expireTime < currentTime) {
          throw Error(`Profile ${profileName} credential_process returned expired credentials.`);
        }
      }
      let accountId = data.AccountId;
      if (!accountId && profiles?.[profileName]?.aws_account_id) {
        accountId = profiles[profileName].aws_account_id;
      }
      const credentials = {
        accessKeyId: data.AccessKeyId,
        secretAccessKey: data.SecretAccessKey,
        ...data.SessionToken && { sessionToken: data.SessionToken },
        ...data.Expiration && { expiration: new Date(data.Expiration) },
        ...data.CredentialScope && { credentialScope: data.CredentialScope },
        ...accountId && { accountId }
      };
      setCredentialFeature(credentials, "CREDENTIALS_PROCESS", "w");
      return credentials;
    }, "getValidatedProcessCredentials");
  }
});
var resolveProcessCredentials;
var init_resolveProcessCredentials = __esm({
  "../../node_modules/.pnpm/@aws-sdk+credential-provider-process@3.716.0/node_modules/@aws-sdk/credential-provider-process/dist-es/resolveProcessCredentials.js"() {
    init_import_meta_url();
    init_dist_es17();
    init_getValidatedProcessCredentials();
    resolveProcessCredentials = /* @__PURE__ */ __name(async (profileName, profiles, logger4) => {
      const profile = profiles[profileName];
      if (profiles[profileName]) {
        const credentialProcess = profile["credential_process"];
        if (credentialProcess !== void 0) {
          const execPromise = util4.promisify(childProcess.exec);
          try {
            const { stdout: stdout2 } = await execPromise(credentialProcess);
            let data;
            try {
              data = JSON.parse(stdout2.trim());
            } catch {
              throw Error(`Profile ${profileName} credential_process returned invalid JSON.`);
            }
            return getValidatedProcessCredentials(profileName, data, profiles);
          } catch (error2) {
            throw new CredentialsProviderError(error2.message, { logger: logger4 });
          }
        } else {
          throw new CredentialsProviderError(`Profile ${profileName} did not contain credential_process.`, { logger: logger4 });
        }
      } else {
        throw new CredentialsProviderError(`Profile ${profileName} could not be found in shared credentials file.`, {
          logger: logger4
        });
      }
    }, "resolveProcessCredentials");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+credential-provider-process@3.716.0/node_modules/@aws-sdk/credential-provider-process/dist-es/fromProcess.js
var fromProcess;
var init_fromProcess = __esm({
  "../../node_modules/.pnpm/@aws-sdk+credential-provider-process@3.716.0/node_modules/@aws-sdk/credential-provider-process/dist-es/fromProcess.js"() {
    init_import_meta_url();
    init_dist_es38();
    init_resolveProcessCredentials();
    fromProcess = /* @__PURE__ */ __name((init4 = {}) => async ({ callerClientConfig } = {}) => {
      init4.logger?.debug("@aws-sdk/credential-provider-process - fromProcess");
      const profiles = await parseKnownFiles(init4);
      return resolveProcessCredentials(getProfileName({
        profile: init4.profile ?? callerClientConfig?.profile
      }), profiles, init4.logger);
    }, "fromProcess");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+credential-provider-process@3.716.0/node_modules/@aws-sdk/credential-provider-process/dist-es/index.js
var dist_es_exports7 = {};
__export(dist_es_exports7, {
  fromProcess: () => fromProcess
});
var init_dist_es61 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+credential-provider-process@3.716.0/node_modules/@aws-sdk/credential-provider-process/dist-es/index.js"() {
    init_import_meta_url();
    init_fromProcess();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+credential-provider-ini@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+clie_bc8234dce1a0330881874845b2d85f32/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveProcessCredentials.js
var isProcessProfile, resolveProcessCredentials2;
var init_resolveProcessCredentials2 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+credential-provider-ini@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+clie_bc8234dce1a0330881874845b2d85f32/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveProcessCredentials.js"() {
    init_import_meta_url();
    init_client8();
    isProcessProfile = /* @__PURE__ */ __name((arg) => Boolean(arg) && typeof arg === "object" && typeof arg.credential_process === "string", "isProcessProfile");
    resolveProcessCredentials2 = /* @__PURE__ */ __name(async (options, profile) => Promise.resolve().then(() => (init_dist_es61(), dist_es_exports7)).then(({ fromProcess: fromProcess2 }) => fromProcess2({
      ...options,
      profile
    })().then((creds) => setCredentialFeature(creds, "CREDENTIALS_PROFILE_PROCESS", "v"))), "resolveProcessCredentials");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+credential-provider-ini@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+clie_bc8234dce1a0330881874845b2d85f32/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveSsoCredentials.js
var resolveSsoCredentials, isSsoProfile2;
var init_resolveSsoCredentials = __esm({
  "../../node_modules/.pnpm/@aws-sdk+credential-provider-ini@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+clie_bc8234dce1a0330881874845b2d85f32/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveSsoCredentials.js"() {
    init_import_meta_url();
    init_client8();
    resolveSsoCredentials = /* @__PURE__ */ __name(async (profile, profileData, options = {}) => {
      const { fromSSO: fromSSO2 } = await Promise.resolve().then(() => (init_dist_es59(), dist_es_exports5));
      return fromSSO2({
        profile,
        logger: options.logger,
        parentClientConfig: options.parentClientConfig,
        clientConfig: options.clientConfig
      })().then((creds) => {
        if (profileData.sso_session) {
          return setCredentialFeature(creds, "CREDENTIALS_PROFILE_SSO", "r");
        } else {
          return setCredentialFeature(creds, "CREDENTIALS_PROFILE_SSO_LEGACY", "t");
        }
      });
    }, "resolveSsoCredentials");
    isSsoProfile2 = /* @__PURE__ */ __name((arg) => arg && (typeof arg.sso_start_url === "string" || typeof arg.sso_account_id === "string" || typeof arg.sso_session === "string" || typeof arg.sso_region === "string" || typeof arg.sso_role_name === "string"), "isSsoProfile");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+credential-provider-ini@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+clie_bc8234dce1a0330881874845b2d85f32/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveStaticCredentials.js
var isStaticCredsProfile, resolveStaticCredentials;
var init_resolveStaticCredentials = __esm({
  "../../node_modules/.pnpm/@aws-sdk+credential-provider-ini@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+clie_bc8234dce1a0330881874845b2d85f32/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveStaticCredentials.js"() {
    init_import_meta_url();
    init_client8();
    isStaticCredsProfile = /* @__PURE__ */ __name((arg) => Boolean(arg) && typeof arg === "object" && typeof arg.aws_access_key_id === "string" && typeof arg.aws_secret_access_key === "string" && ["undefined", "string"].indexOf(typeof arg.aws_session_token) > -1 && ["undefined", "string"].indexOf(typeof arg.aws_account_id) > -1, "isStaticCredsProfile");
    resolveStaticCredentials = /* @__PURE__ */ __name(async (profile, options) => {
      options?.logger?.debug("@aws-sdk/credential-provider-ini - resolveStaticCredentials");
      const credentials = {
        accessKeyId: profile.aws_access_key_id,
        secretAccessKey: profile.aws_secret_access_key,
        sessionToken: profile.aws_session_token,
        ...profile.aws_credential_scope && { credentialScope: profile.aws_credential_scope },
        ...profile.aws_account_id && { accountId: profile.aws_account_id }
      };
      return setCredentialFeature(credentials, "CREDENTIALS_PROFILE", "n");
    }, "resolveStaticCredentials");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+credential-provider-web-identity@3.716.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/credential-provider-web-identity/dist-es/fromWebToken.js
var fromWebToken;
var init_fromWebToken = __esm({
  "../../node_modules/.pnpm/@aws-sdk+credential-provider-web-identity@3.716.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/credential-provider-web-identity/dist-es/fromWebToken.js"() {
    init_import_meta_url();
    fromWebToken = /* @__PURE__ */ __name((init4) => async (awsIdentityProperties) => {
      init4.logger?.debug("@aws-sdk/credential-provider-web-identity - fromWebToken");
      const { roleArn, roleSessionName, webIdentityToken, providerId, policyArns, policy, durationSeconds } = init4;
      let { roleAssumerWithWebIdentity } = init4;
      if (!roleAssumerWithWebIdentity) {
        const { getDefaultRoleAssumerWithWebIdentity: getDefaultRoleAssumerWithWebIdentity3 } = await Promise.resolve().then(() => (init_dist_es60(), dist_es_exports6));
        roleAssumerWithWebIdentity = getDefaultRoleAssumerWithWebIdentity3({
          ...init4.clientConfig,
          credentialProviderLogger: init4.logger,
          parentClientConfig: {
            ...awsIdentityProperties?.callerClientConfig,
            ...init4.parentClientConfig
          }
        }, init4.clientPlugins);
      }
      return roleAssumerWithWebIdentity({
        RoleArn: roleArn,
        RoleSessionName: roleSessionName ?? `aws-sdk-js-session-${Date.now()}`,
        WebIdentityToken: webIdentityToken,
        ProviderId: providerId,
        PolicyArns: policyArns,
        Policy: policy,
        DurationSeconds: durationSeconds
      });
    }, "fromWebToken");
  }
});
var ENV_TOKEN_FILE, ENV_ROLE_ARN, ENV_ROLE_SESSION_NAME, fromTokenFile;
var init_fromTokenFile = __esm({
  "../../node_modules/.pnpm/@aws-sdk+credential-provider-web-identity@3.716.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/credential-provider-web-identity/dist-es/fromTokenFile.js"() {
    init_import_meta_url();
    init_client8();
    init_dist_es17();
    init_fromWebToken();
    ENV_TOKEN_FILE = "AWS_WEB_IDENTITY_TOKEN_FILE";
    ENV_ROLE_ARN = "AWS_ROLE_ARN";
    ENV_ROLE_SESSION_NAME = "AWS_ROLE_SESSION_NAME";
    fromTokenFile = /* @__PURE__ */ __name((init4 = {}) => async () => {
      init4.logger?.debug("@aws-sdk/credential-provider-web-identity - fromTokenFile");
      const webIdentityTokenFile = init4?.webIdentityTokenFile ?? process.env[ENV_TOKEN_FILE];
      const roleArn = init4?.roleArn ?? process.env[ENV_ROLE_ARN];
      const roleSessionName = init4?.roleSessionName ?? process.env[ENV_ROLE_SESSION_NAME];
      if (!webIdentityTokenFile || !roleArn) {
        throw new CredentialsProviderError("Web identity configuration not specified", {
          logger: init4.logger
        });
      }
      const credentials = await fromWebToken({
        ...init4,
        webIdentityToken: fs29.readFileSync(webIdentityTokenFile, { encoding: "ascii" }),
        roleArn,
        roleSessionName
      })();
      if (webIdentityTokenFile === process.env[ENV_TOKEN_FILE]) {
        setCredentialFeature(credentials, "CREDENTIALS_ENV_VARS_STS_WEB_ID_TOKEN", "h");
      }
      return credentials;
    }, "fromTokenFile");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+credential-provider-web-identity@3.716.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/credential-provider-web-identity/dist-es/index.js
var dist_es_exports8 = {};
__export(dist_es_exports8, {
  fromTokenFile: () => fromTokenFile,
  fromWebToken: () => fromWebToken
});
var init_dist_es62 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+credential-provider-web-identity@3.716.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/credential-provider-web-identity/dist-es/index.js"() {
    init_import_meta_url();
    init_fromTokenFile();
    init_fromWebToken();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+credential-provider-ini@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+clie_bc8234dce1a0330881874845b2d85f32/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveWebIdentityCredentials.js
var isWebIdentityProfile, resolveWebIdentityCredentials;
var init_resolveWebIdentityCredentials = __esm({
  "../../node_modules/.pnpm/@aws-sdk+credential-provider-ini@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+clie_bc8234dce1a0330881874845b2d85f32/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveWebIdentityCredentials.js"() {
    init_import_meta_url();
    init_client8();
    isWebIdentityProfile = /* @__PURE__ */ __name((arg) => Boolean(arg) && typeof arg === "object" && typeof arg.web_identity_token_file === "string" && typeof arg.role_arn === "string" && ["undefined", "string"].indexOf(typeof arg.role_session_name) > -1, "isWebIdentityProfile");
    resolveWebIdentityCredentials = /* @__PURE__ */ __name(async (profile, options) => Promise.resolve().then(() => (init_dist_es62(), dist_es_exports8)).then(({ fromTokenFile: fromTokenFile2 }) => fromTokenFile2({
      webIdentityTokenFile: profile.web_identity_token_file,
      roleArn: profile.role_arn,
      roleSessionName: profile.role_session_name,
      roleAssumerWithWebIdentity: options.roleAssumerWithWebIdentity,
      logger: options.logger,
      parentClientConfig: options.parentClientConfig
    })().then((creds) => setCredentialFeature(creds, "CREDENTIALS_PROFILE_STS_WEB_ID_TOKEN", "q"))), "resolveWebIdentityCredentials");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+credential-provider-ini@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+clie_bc8234dce1a0330881874845b2d85f32/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveProfileData.js
var resolveProfileData;
var init_resolveProfileData = __esm({
  "../../node_modules/.pnpm/@aws-sdk+credential-provider-ini@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+clie_bc8234dce1a0330881874845b2d85f32/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveProfileData.js"() {
    init_import_meta_url();
    init_dist_es17();
    init_resolveAssumeRoleCredentials();
    init_resolveProcessCredentials2();
    init_resolveSsoCredentials();
    init_resolveStaticCredentials();
    init_resolveWebIdentityCredentials();
    resolveProfileData = /* @__PURE__ */ __name(async (profileName, profiles, options, visitedProfiles = {}, isAssumeRoleRecursiveCall = false) => {
      const data = profiles[profileName];
      if (Object.keys(visitedProfiles).length > 0 && isStaticCredsProfile(data)) {
        return resolveStaticCredentials(data, options);
      }
      if (isAssumeRoleRecursiveCall || isAssumeRoleProfile(data, { profile: profileName, logger: options.logger })) {
        return resolveAssumeRoleCredentials(profileName, profiles, options, visitedProfiles);
      }
      if (isStaticCredsProfile(data)) {
        return resolveStaticCredentials(data, options);
      }
      if (isWebIdentityProfile(data)) {
        return resolveWebIdentityCredentials(data, options);
      }
      if (isProcessProfile(data)) {
        return resolveProcessCredentials2(options, profileName);
      }
      if (isSsoProfile2(data)) {
        return await resolveSsoCredentials(profileName, data, options);
      }
      throw new CredentialsProviderError(`Could not resolve credentials using profile: [${profileName}] in configuration/credentials file(s).`, { logger: options.logger });
    }, "resolveProfileData");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+credential-provider-ini@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+clie_bc8234dce1a0330881874845b2d85f32/node_modules/@aws-sdk/credential-provider-ini/dist-es/fromIni.js
var fromIni;
var init_fromIni = __esm({
  "../../node_modules/.pnpm/@aws-sdk+credential-provider-ini@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+clie_bc8234dce1a0330881874845b2d85f32/node_modules/@aws-sdk/credential-provider-ini/dist-es/fromIni.js"() {
    init_import_meta_url();
    init_dist_es38();
    init_resolveProfileData();
    fromIni = /* @__PURE__ */ __name((_init = {}) => async ({ callerClientConfig } = {}) => {
      const init4 = {
        ..._init,
        parentClientConfig: {
          ...callerClientConfig,
          ..._init.parentClientConfig
        }
      };
      init4.logger?.debug("@aws-sdk/credential-provider-ini - fromIni");
      const profiles = await parseKnownFiles(init4);
      return resolveProfileData(getProfileName({
        profile: _init.profile ?? callerClientConfig?.profile
      }), profiles, init4);
    }, "fromIni");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+credential-provider-ini@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+clie_bc8234dce1a0330881874845b2d85f32/node_modules/@aws-sdk/credential-provider-ini/dist-es/index.js
var dist_es_exports9 = {};
__export(dist_es_exports9, {
  fromIni: () => fromIni
});
var init_dist_es63 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+credential-provider-ini@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+clie_bc8234dce1a0330881874845b2d85f32/node_modules/@aws-sdk/credential-provider-ini/dist-es/index.js"() {
    init_import_meta_url();
    init_fromIni();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+credential-provider-node@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+cli_8982e3418a41ce727552ac724fdea1d8/node_modules/@aws-sdk/credential-provider-node/dist-es/defaultProvider.js
var multipleCredentialSourceWarningEmitted, defaultProvider, credentialsWillNeedRefresh, credentialsTreatedAsExpired;
var init_defaultProvider = __esm({
  "../../node_modules/.pnpm/@aws-sdk+credential-provider-node@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+cli_8982e3418a41ce727552ac724fdea1d8/node_modules/@aws-sdk/credential-provider-node/dist-es/defaultProvider.js"() {
    init_import_meta_url();
    init_dist_es48();
    init_dist_es17();
    init_dist_es38();
    init_remoteProvider();
    multipleCredentialSourceWarningEmitted = false;
    defaultProvider = /* @__PURE__ */ __name((init4 = {}) => memoize(chain(async () => {
      const profile = init4.profile ?? process.env[ENV_PROFILE];
      if (profile) {
        const envStaticCredentialsAreSet = process.env[ENV_KEY] && process.env[ENV_SECRET];
        if (envStaticCredentialsAreSet) {
          if (!multipleCredentialSourceWarningEmitted) {
            const warnFn = init4.logger?.warn && init4.logger?.constructor?.name !== "NoOpLogger" ? init4.logger.warn : console.warn;
            warnFn(`@aws-sdk/credential-provider-node - defaultProvider::fromEnv WARNING:
    Multiple credential sources detected: 
    Both AWS_PROFILE and the pair AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY static credentials are set.
    This SDK will proceed with the AWS_PROFILE value.
    
    However, a future version may change this behavior to prefer the ENV static credentials.
    Please ensure that your environment only sets either the AWS_PROFILE or the
    AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY pair.
`);
            multipleCredentialSourceWarningEmitted = true;
          }
        }
        throw new CredentialsProviderError("AWS_PROFILE is set, skipping fromEnv provider.", {
          logger: init4.logger,
          tryNextLink: true
        });
      }
      init4.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromEnv");
      return fromEnv2(init4)();
    }, async () => {
      init4.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromSSO");
      const { ssoStartUrl, ssoAccountId, ssoRegion, ssoRoleName, ssoSession } = init4;
      if (!ssoStartUrl && !ssoAccountId && !ssoRegion && !ssoRoleName && !ssoSession) {
        throw new CredentialsProviderError("Skipping SSO provider in default chain (inputs do not include SSO fields).", { logger: init4.logger });
      }
      const { fromSSO: fromSSO2 } = await Promise.resolve().then(() => (init_dist_es59(), dist_es_exports5));
      return fromSSO2(init4)();
    }, async () => {
      init4.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromIni");
      const { fromIni: fromIni2 } = await Promise.resolve().then(() => (init_dist_es63(), dist_es_exports9));
      return fromIni2(init4)();
    }, async () => {
      init4.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromProcess");
      const { fromProcess: fromProcess2 } = await Promise.resolve().then(() => (init_dist_es61(), dist_es_exports7));
      return fromProcess2(init4)();
    }, async () => {
      init4.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromTokenFile");
      const { fromTokenFile: fromTokenFile2 } = await Promise.resolve().then(() => (init_dist_es62(), dist_es_exports8));
      return fromTokenFile2(init4)();
    }, async () => {
      init4.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::remoteProvider");
      return (await remoteProvider(init4))();
    }, async () => {
      throw new CredentialsProviderError("Could not load credentials from any providers", {
        tryNextLink: false,
        logger: init4.logger
      });
    }), credentialsTreatedAsExpired, credentialsWillNeedRefresh), "defaultProvider");
    credentialsWillNeedRefresh = /* @__PURE__ */ __name((credentials) => credentials?.expiration !== void 0, "credentialsWillNeedRefresh");
    credentialsTreatedAsExpired = /* @__PURE__ */ __name((credentials) => credentials?.expiration !== void 0 && credentials.expiration.getTime() - Date.now() < 3e5, "credentialsTreatedAsExpired");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+credential-provider-node@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+cli_8982e3418a41ce727552ac724fdea1d8/node_modules/@aws-sdk/credential-provider-node/dist-es/index.js
var init_dist_es64 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+credential-provider-node@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+cli_8982e3418a41ce727552ac724fdea1d8/node_modules/@aws-sdk/credential-provider-node/dist-es/index.js"() {
    init_import_meta_url();
    init_defaultProvider();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+middleware-bucket-endpoint@3.721.0/node_modules/@aws-sdk/middleware-bucket-endpoint/dist-es/NodeDisableMultiregionAccessPointConfigOptions.js
var init_NodeDisableMultiregionAccessPointConfigOptions = __esm({
  "../../node_modules/.pnpm/@aws-sdk+middleware-bucket-endpoint@3.721.0/node_modules/@aws-sdk/middleware-bucket-endpoint/dist-es/NodeDisableMultiregionAccessPointConfigOptions.js"() {
    init_import_meta_url();
    init_dist_es29();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+middleware-bucket-endpoint@3.721.0/node_modules/@aws-sdk/middleware-bucket-endpoint/dist-es/NodeUseArnRegionConfigOptions.js
var NODE_USE_ARN_REGION_ENV_NAME, NODE_USE_ARN_REGION_INI_NAME, NODE_USE_ARN_REGION_CONFIG_OPTIONS;
var init_NodeUseArnRegionConfigOptions = __esm({
  "../../node_modules/.pnpm/@aws-sdk+middleware-bucket-endpoint@3.721.0/node_modules/@aws-sdk/middleware-bucket-endpoint/dist-es/NodeUseArnRegionConfigOptions.js"() {
    init_import_meta_url();
    init_dist_es29();
    NODE_USE_ARN_REGION_ENV_NAME = "AWS_S3_USE_ARN_REGION";
    NODE_USE_ARN_REGION_INI_NAME = "s3_use_arn_region";
    NODE_USE_ARN_REGION_CONFIG_OPTIONS = {
      environmentVariableSelector: /* @__PURE__ */ __name((env6) => booleanSelector(env6, NODE_USE_ARN_REGION_ENV_NAME, SelectorType2.ENV), "environmentVariableSelector"),
      configFileSelector: /* @__PURE__ */ __name((profile) => booleanSelector(profile, NODE_USE_ARN_REGION_INI_NAME, SelectorType2.CONFIG), "configFileSelector"),
      default: false
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+middleware-bucket-endpoint@3.721.0/node_modules/@aws-sdk/middleware-bucket-endpoint/dist-es/bucketHostnameUtils.js
var init_bucketHostnameUtils = __esm({
  "../../node_modules/.pnpm/@aws-sdk+middleware-bucket-endpoint@3.721.0/node_modules/@aws-sdk/middleware-bucket-endpoint/dist-es/bucketHostnameUtils.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+middleware-bucket-endpoint@3.721.0/node_modules/@aws-sdk/middleware-bucket-endpoint/dist-es/bucketHostname.js
var init_bucketHostname = __esm({
  "../../node_modules/.pnpm/@aws-sdk+middleware-bucket-endpoint@3.721.0/node_modules/@aws-sdk/middleware-bucket-endpoint/dist-es/bucketHostname.js"() {
    init_import_meta_url();
    init_bucketHostnameUtils();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+middleware-bucket-endpoint@3.721.0/node_modules/@aws-sdk/middleware-bucket-endpoint/dist-es/bucketEndpointMiddleware.js
var init_bucketEndpointMiddleware = __esm({
  "../../node_modules/.pnpm/@aws-sdk+middleware-bucket-endpoint@3.721.0/node_modules/@aws-sdk/middleware-bucket-endpoint/dist-es/bucketEndpointMiddleware.js"() {
    init_import_meta_url();
    init_dist_es30();
    init_dist_es2();
    init_bucketHostname();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+middleware-bucket-endpoint@3.721.0/node_modules/@aws-sdk/middleware-bucket-endpoint/dist-es/configurations.js
var init_configurations6 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+middleware-bucket-endpoint@3.721.0/node_modules/@aws-sdk/middleware-bucket-endpoint/dist-es/configurations.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+middleware-bucket-endpoint@3.721.0/node_modules/@aws-sdk/middleware-bucket-endpoint/dist-es/index.js
var init_dist_es65 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+middleware-bucket-endpoint@3.721.0/node_modules/@aws-sdk/middleware-bucket-endpoint/dist-es/index.js"() {
    init_import_meta_url();
    init_NodeDisableMultiregionAccessPointConfigOptions();
    init_NodeUseArnRegionConfigOptions();
    init_bucketEndpointMiddleware();
    init_bucketHostname();
    init_configurations6();
    init_bucketHostnameUtils();
  }
});

// ../../node_modules/.pnpm/@smithy+eventstream-codec@3.1.10/node_modules/@smithy/eventstream-codec/dist-es/Int64.js
function negate2(bytes) {
  for (let i7 = 0; i7 < 8; i7++) {
    bytes[i7] ^= 255;
  }
  for (let i7 = 7; i7 > -1; i7--) {
    bytes[i7]++;
    if (bytes[i7] !== 0)
      break;
  }
}
var Int642;
var init_Int64 = __esm({
  "../../node_modules/.pnpm/@smithy+eventstream-codec@3.1.10/node_modules/@smithy/eventstream-codec/dist-es/Int64.js"() {
    init_import_meta_url();
    init_dist_es14();
    Int642 = class _Int64 {
      static {
        __name(this, "Int64");
      }
      constructor(bytes) {
        this.bytes = bytes;
        if (bytes.byteLength !== 8) {
          throw new Error("Int64 buffers must be exactly 8 bytes");
        }
      }
      static fromNumber(number) {
        if (number > 9223372036854776e3 || number < -9223372036854776e3) {
          throw new Error(`${number} is too large (or, if negative, too small) to represent as an Int64`);
        }
        const bytes = new Uint8Array(8);
        for (let i7 = 7, remaining = Math.abs(Math.round(number)); i7 > -1 && remaining > 0; i7--, remaining /= 256) {
          bytes[i7] = remaining;
        }
        if (number < 0) {
          negate2(bytes);
        }
        return new _Int64(bytes);
      }
      valueOf() {
        const bytes = this.bytes.slice(0);
        const negative = bytes[0] & 128;
        if (negative) {
          negate2(bytes);
        }
        return parseInt(toHex(bytes), 16) * (negative ? -1 : 1);
      }
      toString() {
        return String(this.valueOf());
      }
    };
    __name(negate2, "negate");
  }
});

// ../../node_modules/.pnpm/@smithy+eventstream-codec@3.1.10/node_modules/@smithy/eventstream-codec/dist-es/HeaderMarshaller.js
var HeaderMarshaller, HEADER_VALUE_TYPE2, BOOLEAN_TAG, BYTE_TAG, SHORT_TAG, INT_TAG, LONG_TAG, BINARY_TAG, STRING_TAG, TIMESTAMP_TAG, UUID_TAG, UUID_PATTERN2;
var init_HeaderMarshaller = __esm({
  "../../node_modules/.pnpm/@smithy+eventstream-codec@3.1.10/node_modules/@smithy/eventstream-codec/dist-es/HeaderMarshaller.js"() {
    init_import_meta_url();
    init_dist_es14();
    init_Int64();
    HeaderMarshaller = class {
      static {
        __name(this, "HeaderMarshaller");
      }
      constructor(toUtf82, fromUtf84) {
        this.toUtf8 = toUtf82;
        this.fromUtf8 = fromUtf84;
      }
      format(headers) {
        const chunks = [];
        for (const headerName of Object.keys(headers)) {
          const bytes = this.fromUtf8(headerName);
          chunks.push(Uint8Array.from([bytes.byteLength]), bytes, this.formatHeaderValue(headers[headerName]));
        }
        const out = new Uint8Array(chunks.reduce((carry, bytes) => carry + bytes.byteLength, 0));
        let position = 0;
        for (const chunk of chunks) {
          out.set(chunk, position);
          position += chunk.byteLength;
        }
        return out;
      }
      formatHeaderValue(header) {
        switch (header.type) {
          case "boolean":
            return Uint8Array.from([header.value ? 0 : 1]);
          case "byte":
            return Uint8Array.from([2, header.value]);
          case "short":
            const shortView = new DataView(new ArrayBuffer(3));
            shortView.setUint8(0, 3);
            shortView.setInt16(1, header.value, false);
            return new Uint8Array(shortView.buffer);
          case "integer":
            const intView = new DataView(new ArrayBuffer(5));
            intView.setUint8(0, 4);
            intView.setInt32(1, header.value, false);
            return new Uint8Array(intView.buffer);
          case "long":
            const longBytes = new Uint8Array(9);
            longBytes[0] = 5;
            longBytes.set(header.value.bytes, 1);
            return longBytes;
          case "binary":
            const binView = new DataView(new ArrayBuffer(3 + header.value.byteLength));
            binView.setUint8(0, 6);
            binView.setUint16(1, header.value.byteLength, false);
            const binBytes = new Uint8Array(binView.buffer);
            binBytes.set(header.value, 3);
            return binBytes;
          case "string":
            const utf8Bytes = this.fromUtf8(header.value);
            const strView = new DataView(new ArrayBuffer(3 + utf8Bytes.byteLength));
            strView.setUint8(0, 7);
            strView.setUint16(1, utf8Bytes.byteLength, false);
            const strBytes = new Uint8Array(strView.buffer);
            strBytes.set(utf8Bytes, 3);
            return strBytes;
          case "timestamp":
            const tsBytes = new Uint8Array(9);
            tsBytes[0] = 8;
            tsBytes.set(Int642.fromNumber(header.value.valueOf()).bytes, 1);
            return tsBytes;
          case "uuid":
            if (!UUID_PATTERN2.test(header.value)) {
              throw new Error(`Invalid UUID received: ${header.value}`);
            }
            const uuidBytes = new Uint8Array(17);
            uuidBytes[0] = 9;
            uuidBytes.set(fromHex(header.value.replace(/\-/g, "")), 1);
            return uuidBytes;
        }
      }
      parse(headers) {
        const out = {};
        let position = 0;
        while (position < headers.byteLength) {
          const nameLength = headers.getUint8(position++);
          const name2 = this.toUtf8(new Uint8Array(headers.buffer, headers.byteOffset + position, nameLength));
          position += nameLength;
          switch (headers.getUint8(position++)) {
            case 0:
              out[name2] = {
                type: BOOLEAN_TAG,
                value: true
              };
              break;
            case 1:
              out[name2] = {
                type: BOOLEAN_TAG,
                value: false
              };
              break;
            case 2:
              out[name2] = {
                type: BYTE_TAG,
                value: headers.getInt8(position++)
              };
              break;
            case 3:
              out[name2] = {
                type: SHORT_TAG,
                value: headers.getInt16(position, false)
              };
              position += 2;
              break;
            case 4:
              out[name2] = {
                type: INT_TAG,
                value: headers.getInt32(position, false)
              };
              position += 4;
              break;
            case 5:
              out[name2] = {
                type: LONG_TAG,
                value: new Int642(new Uint8Array(headers.buffer, headers.byteOffset + position, 8))
              };
              position += 8;
              break;
            case 6:
              const binaryLength = headers.getUint16(position, false);
              position += 2;
              out[name2] = {
                type: BINARY_TAG,
                value: new Uint8Array(headers.buffer, headers.byteOffset + position, binaryLength)
              };
              position += binaryLength;
              break;
            case 7:
              const stringLength = headers.getUint16(position, false);
              position += 2;
              out[name2] = {
                type: STRING_TAG,
                value: this.toUtf8(new Uint8Array(headers.buffer, headers.byteOffset + position, stringLength))
              };
              position += stringLength;
              break;
            case 8:
              out[name2] = {
                type: TIMESTAMP_TAG,
                value: new Date(new Int642(new Uint8Array(headers.buffer, headers.byteOffset + position, 8)).valueOf())
              };
              position += 8;
              break;
            case 9:
              const uuidBytes = new Uint8Array(headers.buffer, headers.byteOffset + position, 16);
              position += 16;
              out[name2] = {
                type: UUID_TAG,
                value: `${toHex(uuidBytes.subarray(0, 4))}-${toHex(uuidBytes.subarray(4, 6))}-${toHex(uuidBytes.subarray(6, 8))}-${toHex(uuidBytes.subarray(8, 10))}-${toHex(uuidBytes.subarray(10))}`
              };
              break;
            default:
              throw new Error(`Unrecognized header type tag`);
          }
        }
        return out;
      }
    };
    (function(HEADER_VALUE_TYPE3) {
      HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["boolTrue"] = 0] = "boolTrue";
      HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["boolFalse"] = 1] = "boolFalse";
      HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["byte"] = 2] = "byte";
      HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["short"] = 3] = "short";
      HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["integer"] = 4] = "integer";
      HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["long"] = 5] = "long";
      HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["byteArray"] = 6] = "byteArray";
      HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["string"] = 7] = "string";
      HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["timestamp"] = 8] = "timestamp";
      HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["uuid"] = 9] = "uuid";
    })(HEADER_VALUE_TYPE2 || (HEADER_VALUE_TYPE2 = {}));
    BOOLEAN_TAG = "boolean";
    BYTE_TAG = "byte";
    SHORT_TAG = "short";
    INT_TAG = "integer";
    LONG_TAG = "long";
    BINARY_TAG = "binary";
    STRING_TAG = "string";
    TIMESTAMP_TAG = "timestamp";
    UUID_TAG = "uuid";
    UUID_PATTERN2 = /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;
  }
});

// ../../node_modules/.pnpm/@smithy+eventstream-codec@3.1.10/node_modules/@smithy/eventstream-codec/dist-es/splitMessage.js
function splitMessage({ byteLength, byteOffset, buffer }) {
  if (byteLength < MINIMUM_MESSAGE_LENGTH) {
    throw new Error("Provided message too short to accommodate event stream message overhead");
  }
  const view = new DataView(buffer, byteOffset, byteLength);
  const messageLength = view.getUint32(0, false);
  if (byteLength !== messageLength) {
    throw new Error("Reported message length does not match received message length");
  }
  const headerLength = view.getUint32(PRELUDE_MEMBER_LENGTH, false);
  const expectedPreludeChecksum = view.getUint32(PRELUDE_LENGTH, false);
  const expectedMessageChecksum = view.getUint32(byteLength - CHECKSUM_LENGTH, false);
  const checksummer = new Crc32().update(new Uint8Array(buffer, byteOffset, PRELUDE_LENGTH));
  if (expectedPreludeChecksum !== checksummer.digest()) {
    throw new Error(`The prelude checksum specified in the message (${expectedPreludeChecksum}) does not match the calculated CRC32 checksum (${checksummer.digest()})`);
  }
  checksummer.update(new Uint8Array(buffer, byteOffset + PRELUDE_LENGTH, byteLength - (PRELUDE_LENGTH + CHECKSUM_LENGTH)));
  if (expectedMessageChecksum !== checksummer.digest()) {
    throw new Error(`The message checksum (${checksummer.digest()}) did not match the expected value of ${expectedMessageChecksum}`);
  }
  return {
    headers: new DataView(buffer, byteOffset + PRELUDE_LENGTH + CHECKSUM_LENGTH, headerLength),
    body: new Uint8Array(buffer, byteOffset + PRELUDE_LENGTH + CHECKSUM_LENGTH + headerLength, messageLength - headerLength - (PRELUDE_LENGTH + CHECKSUM_LENGTH + CHECKSUM_LENGTH))
  };
}
var PRELUDE_MEMBER_LENGTH, PRELUDE_LENGTH, CHECKSUM_LENGTH, MINIMUM_MESSAGE_LENGTH;
var init_splitMessage = __esm({
  "../../node_modules/.pnpm/@smithy+eventstream-codec@3.1.10/node_modules/@smithy/eventstream-codec/dist-es/splitMessage.js"() {
    init_import_meta_url();
    init_module4();
    PRELUDE_MEMBER_LENGTH = 4;
    PRELUDE_LENGTH = PRELUDE_MEMBER_LENGTH * 2;
    CHECKSUM_LENGTH = 4;
    MINIMUM_MESSAGE_LENGTH = PRELUDE_LENGTH + CHECKSUM_LENGTH * 2;
    __name(splitMessage, "splitMessage");
  }
});

// ../../node_modules/.pnpm/@smithy+eventstream-codec@3.1.10/node_modules/@smithy/eventstream-codec/dist-es/EventStreamCodec.js
var EventStreamCodec;
var init_EventStreamCodec = __esm({
  "../../node_modules/.pnpm/@smithy+eventstream-codec@3.1.10/node_modules/@smithy/eventstream-codec/dist-es/EventStreamCodec.js"() {
    init_import_meta_url();
    init_module4();
    init_HeaderMarshaller();
    init_splitMessage();
    EventStreamCodec = class {
      static {
        __name(this, "EventStreamCodec");
      }
      constructor(toUtf82, fromUtf84) {
        this.headerMarshaller = new HeaderMarshaller(toUtf82, fromUtf84);
        this.messageBuffer = [];
        this.isEndOfStream = false;
      }
      feed(message) {
        this.messageBuffer.push(this.decode(message));
      }
      endOfStream() {
        this.isEndOfStream = true;
      }
      getMessage() {
        const message = this.messageBuffer.pop();
        const isEndOfStream = this.isEndOfStream;
        return {
          getMessage() {
            return message;
          },
          isEndOfStream() {
            return isEndOfStream;
          }
        };
      }
      getAvailableMessages() {
        const messages = this.messageBuffer;
        this.messageBuffer = [];
        const isEndOfStream = this.isEndOfStream;
        return {
          getMessages() {
            return messages;
          },
          isEndOfStream() {
            return isEndOfStream;
          }
        };
      }
      encode({ headers: rawHeaders, body }) {
        const headers = this.headerMarshaller.format(rawHeaders);
        const length = headers.byteLength + body.byteLength + 16;
        const out = new Uint8Array(length);
        const view = new DataView(out.buffer, out.byteOffset, out.byteLength);
        const checksum = new Crc32();
        view.setUint32(0, length, false);
        view.setUint32(4, headers.byteLength, false);
        view.setUint32(8, checksum.update(out.subarray(0, 8)).digest(), false);
        out.set(headers, 12);
        out.set(body, headers.byteLength + 12);
        view.setUint32(length - 4, checksum.update(out.subarray(8, length - 4)).digest(), false);
        return out;
      }
      decode(message) {
        const { headers, body } = splitMessage(message);
        return { headers: this.headerMarshaller.parse(headers), body };
      }
      formatHeaders(rawHeaders) {
        return this.headerMarshaller.format(rawHeaders);
      }
    };
  }
});

// ../../node_modules/.pnpm/@smithy+eventstream-codec@3.1.10/node_modules/@smithy/eventstream-codec/dist-es/Message.js
var init_Message = __esm({
  "../../node_modules/.pnpm/@smithy+eventstream-codec@3.1.10/node_modules/@smithy/eventstream-codec/dist-es/Message.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+eventstream-codec@3.1.10/node_modules/@smithy/eventstream-codec/dist-es/MessageDecoderStream.js
var MessageDecoderStream;
var init_MessageDecoderStream = __esm({
  "../../node_modules/.pnpm/@smithy+eventstream-codec@3.1.10/node_modules/@smithy/eventstream-codec/dist-es/MessageDecoderStream.js"() {
    init_import_meta_url();
    MessageDecoderStream = class {
      static {
        __name(this, "MessageDecoderStream");
      }
      constructor(options) {
        this.options = options;
      }
      [Symbol.asyncIterator]() {
        return this.asyncIterator();
      }
      async *asyncIterator() {
        for await (const bytes of this.options.inputStream) {
          const decoded = this.options.decoder.decode(bytes);
          yield decoded;
        }
      }
    };
  }
});

// ../../node_modules/.pnpm/@smithy+eventstream-codec@3.1.10/node_modules/@smithy/eventstream-codec/dist-es/MessageEncoderStream.js
var MessageEncoderStream;
var init_MessageEncoderStream = __esm({
  "../../node_modules/.pnpm/@smithy+eventstream-codec@3.1.10/node_modules/@smithy/eventstream-codec/dist-es/MessageEncoderStream.js"() {
    init_import_meta_url();
    MessageEncoderStream = class {
      static {
        __name(this, "MessageEncoderStream");
      }
      constructor(options) {
        this.options = options;
      }
      [Symbol.asyncIterator]() {
        return this.asyncIterator();
      }
      async *asyncIterator() {
        for await (const msg of this.options.messageStream) {
          const encoded = this.options.encoder.encode(msg);
          yield encoded;
        }
        if (this.options.includeEndFrame) {
          yield new Uint8Array(0);
        }
      }
    };
  }
});

// ../../node_modules/.pnpm/@smithy+eventstream-codec@3.1.10/node_modules/@smithy/eventstream-codec/dist-es/SmithyMessageDecoderStream.js
var SmithyMessageDecoderStream;
var init_SmithyMessageDecoderStream = __esm({
  "../../node_modules/.pnpm/@smithy+eventstream-codec@3.1.10/node_modules/@smithy/eventstream-codec/dist-es/SmithyMessageDecoderStream.js"() {
    init_import_meta_url();
    SmithyMessageDecoderStream = class {
      static {
        __name(this, "SmithyMessageDecoderStream");
      }
      constructor(options) {
        this.options = options;
      }
      [Symbol.asyncIterator]() {
        return this.asyncIterator();
      }
      async *asyncIterator() {
        for await (const message of this.options.messageStream) {
          const deserialized = await this.options.deserializer(message);
          if (deserialized === void 0)
            continue;
          yield deserialized;
        }
      }
    };
  }
});

// ../../node_modules/.pnpm/@smithy+eventstream-codec@3.1.10/node_modules/@smithy/eventstream-codec/dist-es/SmithyMessageEncoderStream.js
var SmithyMessageEncoderStream;
var init_SmithyMessageEncoderStream = __esm({
  "../../node_modules/.pnpm/@smithy+eventstream-codec@3.1.10/node_modules/@smithy/eventstream-codec/dist-es/SmithyMessageEncoderStream.js"() {
    init_import_meta_url();
    SmithyMessageEncoderStream = class {
      static {
        __name(this, "SmithyMessageEncoderStream");
      }
      constructor(options) {
        this.options = options;
      }
      [Symbol.asyncIterator]() {
        return this.asyncIterator();
      }
      async *asyncIterator() {
        for await (const chunk of this.options.inputStream) {
          const payloadBuf = this.options.serializer(chunk);
          yield payloadBuf;
        }
      }
    };
  }
});

// ../../node_modules/.pnpm/@smithy+eventstream-codec@3.1.10/node_modules/@smithy/eventstream-codec/dist-es/index.js
var init_dist_es66 = __esm({
  "../../node_modules/.pnpm/@smithy+eventstream-codec@3.1.10/node_modules/@smithy/eventstream-codec/dist-es/index.js"() {
    init_import_meta_url();
    init_EventStreamCodec();
    init_HeaderMarshaller();
    init_Int64();
    init_Message();
    init_MessageDecoderStream();
    init_MessageEncoderStream();
    init_SmithyMessageDecoderStream();
    init_SmithyMessageEncoderStream();
  }
});

// ../../node_modules/.pnpm/@smithy+eventstream-serde-universal@3.0.13/node_modules/@smithy/eventstream-serde-universal/dist-es/getChunkedStream.js
function getChunkedStream(source) {
  let currentMessageTotalLength = 0;
  let currentMessagePendingLength = 0;
  let currentMessage = null;
  let messageLengthBuffer = null;
  const allocateMessage = /* @__PURE__ */ __name((size) => {
    if (typeof size !== "number") {
      throw new Error("Attempted to allocate an event message where size was not a number: " + size);
    }
    currentMessageTotalLength = size;
    currentMessagePendingLength = 4;
    currentMessage = new Uint8Array(size);
    const currentMessageView = new DataView(currentMessage.buffer);
    currentMessageView.setUint32(0, size, false);
  }, "allocateMessage");
  const iterator = /* @__PURE__ */ __name(async function* () {
    const sourceIterator = source[Symbol.asyncIterator]();
    while (true) {
      const { value, done } = await sourceIterator.next();
      if (done) {
        if (!currentMessageTotalLength) {
          return;
        } else if (currentMessageTotalLength === currentMessagePendingLength) {
          yield currentMessage;
        } else {
          throw new Error("Truncated event message received.");
        }
        return;
      }
      const chunkLength = value.length;
      let currentOffset = 0;
      while (currentOffset < chunkLength) {
        if (!currentMessage) {
          const bytesRemaining = chunkLength - currentOffset;
          if (!messageLengthBuffer) {
            messageLengthBuffer = new Uint8Array(4);
          }
          const numBytesForTotal = Math.min(4 - currentMessagePendingLength, bytesRemaining);
          messageLengthBuffer.set(value.slice(currentOffset, currentOffset + numBytesForTotal), currentMessagePendingLength);
          currentMessagePendingLength += numBytesForTotal;
          currentOffset += numBytesForTotal;
          if (currentMessagePendingLength < 4) {
            break;
          }
          allocateMessage(new DataView(messageLengthBuffer.buffer).getUint32(0, false));
          messageLengthBuffer = null;
        }
        const numBytesToWrite = Math.min(currentMessageTotalLength - currentMessagePendingLength, chunkLength - currentOffset);
        currentMessage.set(value.slice(currentOffset, currentOffset + numBytesToWrite), currentMessagePendingLength);
        currentMessagePendingLength += numBytesToWrite;
        currentOffset += numBytesToWrite;
        if (currentMessageTotalLength && currentMessageTotalLength === currentMessagePendingLength) {
          yield currentMessage;
          currentMessage = null;
          currentMessageTotalLength = 0;
          currentMessagePendingLength = 0;
        }
      }
    }
  }, "iterator");
  return {
    [Symbol.asyncIterator]: iterator
  };
}
var init_getChunkedStream = __esm({
  "../../node_modules/.pnpm/@smithy+eventstream-serde-universal@3.0.13/node_modules/@smithy/eventstream-serde-universal/dist-es/getChunkedStream.js"() {
    init_import_meta_url();
    __name(getChunkedStream, "getChunkedStream");
  }
});

// ../../node_modules/.pnpm/@smithy+eventstream-serde-universal@3.0.13/node_modules/@smithy/eventstream-serde-universal/dist-es/getUnmarshalledStream.js
function getMessageUnmarshaller(deserializer, toUtf82) {
  return async function(message) {
    const { value: messageType } = message.headers[":message-type"];
    if (messageType === "error") {
      const unmodeledError = new Error(message.headers[":error-message"].value || "UnknownError");
      unmodeledError.name = message.headers[":error-code"].value;
      throw unmodeledError;
    } else if (messageType === "exception") {
      const code = message.headers[":exception-type"].value;
      const exception = { [code]: message };
      const deserializedException = await deserializer(exception);
      if (deserializedException.$unknown) {
        const error2 = new Error(toUtf82(message.body));
        error2.name = code;
        throw error2;
      }
      throw deserializedException[code];
    } else if (messageType === "event") {
      const event = {
        [message.headers[":event-type"].value]: message
      };
      const deserialized = await deserializer(event);
      if (deserialized.$unknown)
        return;
      return deserialized;
    } else {
      throw Error(`Unrecognizable event type: ${message.headers[":event-type"].value}`);
    }
  };
}
var init_getUnmarshalledStream = __esm({
  "../../node_modules/.pnpm/@smithy+eventstream-serde-universal@3.0.13/node_modules/@smithy/eventstream-serde-universal/dist-es/getUnmarshalledStream.js"() {
    init_import_meta_url();
    __name(getMessageUnmarshaller, "getMessageUnmarshaller");
  }
});

// ../../node_modules/.pnpm/@smithy+eventstream-serde-universal@3.0.13/node_modules/@smithy/eventstream-serde-universal/dist-es/EventStreamMarshaller.js
var EventStreamMarshaller;
var init_EventStreamMarshaller = __esm({
  "../../node_modules/.pnpm/@smithy+eventstream-serde-universal@3.0.13/node_modules/@smithy/eventstream-serde-universal/dist-es/EventStreamMarshaller.js"() {
    init_import_meta_url();
    init_dist_es66();
    init_getChunkedStream();
    init_getUnmarshalledStream();
    EventStreamMarshaller = class {
      static {
        __name(this, "EventStreamMarshaller");
      }
      constructor({ utf8Encoder, utf8Decoder }) {
        this.eventStreamCodec = new EventStreamCodec(utf8Encoder, utf8Decoder);
        this.utfEncoder = utf8Encoder;
      }
      deserialize(body, deserializer) {
        const inputStream = getChunkedStream(body);
        return new SmithyMessageDecoderStream({
          messageStream: new MessageDecoderStream({ inputStream, decoder: this.eventStreamCodec }),
          deserializer: getMessageUnmarshaller(deserializer, this.utfEncoder)
        });
      }
      serialize(inputStream, serializer) {
        return new MessageEncoderStream({
          messageStream: new SmithyMessageEncoderStream({ inputStream, serializer }),
          encoder: this.eventStreamCodec,
          includeEndFrame: true
        });
      }
    };
  }
});

// ../../node_modules/.pnpm/@smithy+eventstream-serde-universal@3.0.13/node_modules/@smithy/eventstream-serde-universal/dist-es/provider.js
var init_provider = __esm({
  "../../node_modules/.pnpm/@smithy+eventstream-serde-universal@3.0.13/node_modules/@smithy/eventstream-serde-universal/dist-es/provider.js"() {
    init_import_meta_url();
    init_EventStreamMarshaller();
  }
});

// ../../node_modules/.pnpm/@smithy+eventstream-serde-universal@3.0.13/node_modules/@smithy/eventstream-serde-universal/dist-es/index.js
var init_dist_es67 = __esm({
  "../../node_modules/.pnpm/@smithy+eventstream-serde-universal@3.0.13/node_modules/@smithy/eventstream-serde-universal/dist-es/index.js"() {
    init_import_meta_url();
    init_EventStreamMarshaller();
    init_provider();
  }
});

// ../../node_modules/.pnpm/@smithy+eventstream-serde-node@3.0.13/node_modules/@smithy/eventstream-serde-node/dist-es/utils.js
async function* readabletoIterable(readStream) {
  let streamEnded = false;
  let generationEnded = false;
  const records = new Array();
  readStream.on("error", (err) => {
    if (!streamEnded) {
      streamEnded = true;
    }
    if (err) {
      throw err;
    }
  });
  readStream.on("data", (data) => {
    records.push(data);
  });
  readStream.on("end", () => {
    streamEnded = true;
  });
  while (!generationEnded) {
    const value = await new Promise((resolve32) => setTimeout(() => resolve32(records.shift()), 0));
    if (value) {
      yield value;
    }
    generationEnded = streamEnded && records.length === 0;
  }
}
var init_utils15 = __esm({
  "../../node_modules/.pnpm/@smithy+eventstream-serde-node@3.0.13/node_modules/@smithy/eventstream-serde-node/dist-es/utils.js"() {
    init_import_meta_url();
    __name(readabletoIterable, "readabletoIterable");
  }
});
var EventStreamMarshaller2;
var init_EventStreamMarshaller2 = __esm({
  "../../node_modules/.pnpm/@smithy+eventstream-serde-node@3.0.13/node_modules/@smithy/eventstream-serde-node/dist-es/EventStreamMarshaller.js"() {
    init_import_meta_url();
    init_dist_es67();
    init_utils15();
    EventStreamMarshaller2 = class {
      static {
        __name(this, "EventStreamMarshaller");
      }
      constructor({ utf8Encoder, utf8Decoder }) {
        this.universalMarshaller = new EventStreamMarshaller({
          utf8Decoder,
          utf8Encoder
        });
      }
      deserialize(body, deserializer) {
        const bodyIterable = typeof body[Symbol.asyncIterator] === "function" ? body : readabletoIterable(body);
        return this.universalMarshaller.deserialize(bodyIterable, deserializer);
      }
      serialize(input, serializer) {
        return Stream.Readable.from(this.universalMarshaller.serialize(input, serializer));
      }
    };
  }
});

// ../../node_modules/.pnpm/@smithy+eventstream-serde-node@3.0.13/node_modules/@smithy/eventstream-serde-node/dist-es/provider.js
var eventStreamSerdeProvider;
var init_provider2 = __esm({
  "../../node_modules/.pnpm/@smithy+eventstream-serde-node@3.0.13/node_modules/@smithy/eventstream-serde-node/dist-es/provider.js"() {
    init_import_meta_url();
    init_EventStreamMarshaller2();
    eventStreamSerdeProvider = /* @__PURE__ */ __name((options) => new EventStreamMarshaller2(options), "eventStreamSerdeProvider");
  }
});

// ../../node_modules/.pnpm/@smithy+eventstream-serde-node@3.0.13/node_modules/@smithy/eventstream-serde-node/dist-es/index.js
var init_dist_es68 = __esm({
  "../../node_modules/.pnpm/@smithy+eventstream-serde-node@3.0.13/node_modules/@smithy/eventstream-serde-node/dist-es/index.js"() {
    init_import_meta_url();
    init_EventStreamMarshaller2();
    init_provider2();
  }
});
var HashCalculator;
var init_HashCalculator = __esm({
  "../../node_modules/.pnpm/@smithy+hash-stream-node@3.1.10/node_modules/@smithy/hash-stream-node/dist-es/HashCalculator.js"() {
    init_import_meta_url();
    init_dist_es8();
    HashCalculator = class extends Stream.Writable {
      static {
        __name(this, "HashCalculator");
      }
      constructor(hash, options) {
        super(options);
        this.hash = hash;
      }
      _write(chunk, encoding, callback) {
        try {
          this.hash.update(toUint8Array(chunk));
        } catch (err) {
          return callback(err);
        }
        callback();
      }
    };
  }
});

// ../../node_modules/.pnpm/@smithy+hash-stream-node@3.1.10/node_modules/@smithy/hash-stream-node/dist-es/fileStreamHasher.js
var init_fileStreamHasher = __esm({
  "../../node_modules/.pnpm/@smithy+hash-stream-node@3.1.10/node_modules/@smithy/hash-stream-node/dist-es/fileStreamHasher.js"() {
    init_import_meta_url();
    init_HashCalculator();
  }
});

// ../../node_modules/.pnpm/@smithy+hash-stream-node@3.1.10/node_modules/@smithy/hash-stream-node/dist-es/readableStreamHasher.js
var readableStreamHasher;
var init_readableStreamHasher = __esm({
  "../../node_modules/.pnpm/@smithy+hash-stream-node@3.1.10/node_modules/@smithy/hash-stream-node/dist-es/readableStreamHasher.js"() {
    init_import_meta_url();
    init_HashCalculator();
    readableStreamHasher = /* @__PURE__ */ __name((hashCtor, readableStream) => {
      if (readableStream.readableFlowing !== null) {
        throw new Error("Unable to calculate hash for flowing readable stream");
      }
      const hash = new hashCtor();
      const hashCalculator = new HashCalculator(hash);
      readableStream.pipe(hashCalculator);
      return new Promise((resolve32, reject) => {
        readableStream.on("error", (err) => {
          hashCalculator.end();
          reject(err);
        });
        hashCalculator.on("error", reject);
        hashCalculator.on("finish", () => {
          hash.digest().then(resolve32).catch(reject);
        });
      });
    }, "readableStreamHasher");
  }
});

// ../../node_modules/.pnpm/@smithy+hash-stream-node@3.1.10/node_modules/@smithy/hash-stream-node/dist-es/index.js
var init_dist_es69 = __esm({
  "../../node_modules/.pnpm/@smithy+hash-stream-node@3.1.10/node_modules/@smithy/hash-stream-node/dist-es/index.js"() {
    init_import_meta_url();
    init_fileStreamHasher();
    init_readableStreamHasher();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/runtimeConfig.shared.js
var getRuntimeConfig7;
var init_runtimeConfig_shared4 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/runtimeConfig.shared.js"() {
    init_import_meta_url();
    init_dist_es21();
    init_dist_es46();
    init_dist_es20();
    init_dist_es41();
    init_dist_es9();
    init_dist_es15();
    init_dist_es8();
    init_httpAuthSchemeProvider();
    init_endpointResolver();
    getRuntimeConfig7 = /* @__PURE__ */ __name((config) => {
      return {
        apiVersion: "2006-03-01",
        base64Decoder: config?.base64Decoder ?? fromBase64,
        base64Encoder: config?.base64Encoder ?? toBase64,
        disableHostPrefix: config?.disableHostPrefix ?? false,
        endpointProvider: config?.endpointProvider ?? defaultEndpointResolver,
        extensions: config?.extensions ?? [],
        getAwsChunkedEncodingStream: config?.getAwsChunkedEncodingStream ?? getAwsChunkedEncodingStream,
        httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? defaultS3HttpAuthSchemeProvider,
        httpAuthSchemes: config?.httpAuthSchemes ?? [
          {
            schemeId: "aws.auth#sigv4",
            identityProvider: /* @__PURE__ */ __name((ipc) => ipc.getIdentityProvider("aws.auth#sigv4"), "identityProvider"),
            signer: new AwsSdkSigV4Signer()
          },
          {
            schemeId: "aws.auth#sigv4a",
            identityProvider: /* @__PURE__ */ __name((ipc) => ipc.getIdentityProvider("aws.auth#sigv4a"), "identityProvider"),
            signer: new AwsSdkSigV4ASigner()
          }
        ],
        logger: config?.logger ?? new NoOpLogger(),
        sdkStreamMixin: config?.sdkStreamMixin ?? sdkStreamMixin2,
        serviceId: config?.serviceId ?? "S3",
        signerConstructor: config?.signerConstructor ?? SignatureV4MultiRegion,
        signingEscapePath: config?.signingEscapePath ?? false,
        urlParser: config?.urlParser ?? parseUrl2,
        useArnRegion: config?.useArnRegion ?? false,
        utf8Decoder: config?.utf8Decoder ?? fromUtf8,
        utf8Encoder: config?.utf8Encoder ?? toUtf8
      };
    }, "getRuntimeConfig");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/runtimeConfig.js
var getRuntimeConfig8;
var init_runtimeConfig4 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/runtimeConfig.js"() {
    init_import_meta_url();
    init_package2();
    init_dist_es21();
    init_dist_es64();
    init_dist_es65();
    init_dist_es25();
    init_dist_es31();
    init_dist_es51();
    init_dist_es35();
    init_dist_es68();
    init_dist_es52();
    init_dist_es69();
    init_dist_es45();
    init_dist_es39();
    init_dist_es12();
    init_dist_es53();
    init_dist_es44();
    init_runtimeConfig_shared4();
    init_dist_es20();
    init_dist_es54();
    init_dist_es20();
    getRuntimeConfig8 = /* @__PURE__ */ __name((config) => {
      emitWarningIfUnsupportedVersion2(process.version);
      const defaultsMode = resolveDefaultsModeConfig(config);
      const defaultConfigProvider = /* @__PURE__ */ __name(() => defaultsMode().then(loadConfigsForDefaultMode), "defaultConfigProvider");
      const clientSharedValues = getRuntimeConfig7(config);
      emitWarningIfUnsupportedVersion(process.version);
      const profileConfig = { profile: config?.profile };
      return {
        ...clientSharedValues,
        ...config,
        runtime: "node",
        defaultsMode,
        bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
        credentialDefaultProvider: config?.credentialDefaultProvider ?? defaultProvider,
        defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: package_default.version }),
        disableS3ExpressSessionAuth: config?.disableS3ExpressSessionAuth ?? loadConfig(NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_OPTIONS, profileConfig),
        eventStreamSerdeProvider: config?.eventStreamSerdeProvider ?? eventStreamSerdeProvider,
        maxAttempts: config?.maxAttempts ?? loadConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),
        md5: config?.md5 ?? Hash.bind(null, "md5"),
        region: config?.region ?? loadConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }),
        requestChecksumCalculation: config?.requestChecksumCalculation ?? loadConfig(NODE_REQUEST_CHECKSUM_CALCULATION_CONFIG_OPTIONS, profileConfig),
        requestHandler: NodeHttpHandler.create(config?.requestHandler ?? defaultConfigProvider),
        responseChecksumValidation: config?.responseChecksumValidation ?? loadConfig(NODE_RESPONSE_CHECKSUM_VALIDATION_CONFIG_OPTIONS, profileConfig),
        retryMode: config?.retryMode ?? loadConfig({
          ...NODE_RETRY_MODE_CONFIG_OPTIONS,
          default: /* @__PURE__ */ __name(async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, "default")
        }, config),
        sha1: config?.sha1 ?? Hash.bind(null, "sha1"),
        sha256: config?.sha256 ?? Hash.bind(null, "sha256"),
        sigv4aSigningRegionSet: config?.sigv4aSigningRegionSet ?? loadConfig(NODE_SIGV4A_CONFIG_OPTIONS, profileConfig),
        streamCollector: config?.streamCollector ?? streamCollector,
        streamHasher: config?.streamHasher ?? readableStreamHasher,
        useArnRegion: config?.useArnRegion ?? loadConfig(NODE_USE_ARN_REGION_CONFIG_OPTIONS, profileConfig),
        useDualstackEndpoint: config?.useDualstackEndpoint ?? loadConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig),
        useFipsEndpoint: config?.useFipsEndpoint ?? loadConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig),
        userAgentAppId: config?.userAgentAppId ?? loadConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig)
      };
    }, "getRuntimeConfig");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/auth/httpAuthExtensionConfiguration.js
var getHttpAuthExtensionConfiguration4, resolveHttpAuthRuntimeConfig4;
var init_httpAuthExtensionConfiguration4 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/auth/httpAuthExtensionConfiguration.js"() {
    init_import_meta_url();
    getHttpAuthExtensionConfiguration4 = /* @__PURE__ */ __name((runtimeConfig) => {
      const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
      let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
      let _credentials = runtimeConfig.credentials;
      return {
        setHttpAuthScheme(httpAuthScheme) {
          const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
          if (index === -1) {
            _httpAuthSchemes.push(httpAuthScheme);
          } else {
            _httpAuthSchemes.splice(index, 1, httpAuthScheme);
          }
        },
        httpAuthSchemes() {
          return _httpAuthSchemes;
        },
        setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
          _httpAuthSchemeProvider = httpAuthSchemeProvider;
        },
        httpAuthSchemeProvider() {
          return _httpAuthSchemeProvider;
        },
        setCredentials(credentials) {
          _credentials = credentials;
        },
        credentials() {
          return _credentials;
        }
      };
    }, "getHttpAuthExtensionConfiguration");
    resolveHttpAuthRuntimeConfig4 = /* @__PURE__ */ __name((config) => {
      return {
        httpAuthSchemes: config.httpAuthSchemes(),
        httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
        credentials: config.credentials()
      };
    }, "resolveHttpAuthRuntimeConfig");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/runtimeExtensions.js
var asPartial4, resolveRuntimeExtensions4;
var init_runtimeExtensions4 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/runtimeExtensions.js"() {
    init_import_meta_url();
    init_dist_es55();
    init_dist_es2();
    init_dist_es20();
    init_httpAuthExtensionConfiguration4();
    asPartial4 = /* @__PURE__ */ __name((t13) => t13, "asPartial");
    resolveRuntimeExtensions4 = /* @__PURE__ */ __name((runtimeConfig, extensions) => {
      const extensionConfiguration = {
        ...asPartial4(getAwsRegionExtensionConfiguration(runtimeConfig)),
        ...asPartial4(getDefaultExtensionConfiguration(runtimeConfig)),
        ...asPartial4(getHttpHandlerExtensionConfiguration(runtimeConfig)),
        ...asPartial4(getHttpAuthExtensionConfiguration4(runtimeConfig))
      };
      extensions.forEach((extension) => extension.configure(extensionConfiguration));
      return {
        ...runtimeConfig,
        ...resolveAwsRegionExtensionConfiguration(extensionConfiguration),
        ...resolveDefaultRuntimeConfig(extensionConfiguration),
        ...resolveHttpHandlerRuntimeConfig(extensionConfiguration),
        ...resolveHttpAuthRuntimeConfig4(extensionConfiguration)
      };
    }, "resolveRuntimeExtensions");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/S3Client.js
var S3Client;
var init_S3Client = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/S3Client.js"() {
    init_import_meta_url();
    init_dist_es3();
    init_dist_es25();
    init_dist_es26();
    init_dist_es27();
    init_dist_es28();
    init_dist_es31();
    init_dist_es34();
    init_dist_es35();
    init_dist_es16();
    init_dist_es36();
    init_dist_es37();
    init_dist_es42();
    init_dist_es45();
    init_dist_es20();
    init_httpAuthSchemeProvider();
    init_CreateSessionCommand();
    init_EndpointParameters();
    init_runtimeConfig4();
    init_runtimeExtensions4();
    S3Client = class extends Client {
      static {
        __name(this, "S3Client");
      }
      constructor(...[configuration]) {
        const _config_0 = getRuntimeConfig8(configuration || {});
        const _config_1 = resolveClientEndpointParameters(_config_0);
        const _config_2 = resolveUserAgentConfig(_config_1);
        const _config_3 = resolveFlexibleChecksumsConfig(_config_2);
        const _config_4 = resolveRetryConfig(_config_3);
        const _config_5 = resolveRegionConfig(_config_4);
        const _config_6 = resolveHostHeaderConfig(_config_5);
        const _config_7 = resolveEndpointConfig(_config_6);
        const _config_8 = resolveEventStreamSerdeConfig(_config_7);
        const _config_9 = resolveHttpAuthSchemeConfig(_config_8);
        const _config_10 = resolveS3Config(_config_9, { session: [() => this, CreateSessionCommand] });
        const _config_11 = resolveRuntimeExtensions4(_config_10, configuration?.extensions || []);
        super(_config_11);
        this.config = _config_11;
        this.middlewareStack.use(getUserAgentPlugin(this.config));
        this.middlewareStack.use(getRetryPlugin(this.config));
        this.middlewareStack.use(getContentLengthPlugin(this.config));
        this.middlewareStack.use(getHostHeaderPlugin(this.config));
        this.middlewareStack.use(getLoggerPlugin(this.config));
        this.middlewareStack.use(getRecursionDetectionPlugin(this.config));
        this.middlewareStack.use(getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {
          httpAuthSchemeParametersProvider: defaultS3HttpAuthSchemeParametersProvider,
          identityProviderConfigProvider: /* @__PURE__ */ __name(async (config) => new DefaultIdentityProviderConfig({
            "aws.auth#sigv4": config.credentials,
            "aws.auth#sigv4a": config.credentials
          }), "identityProviderConfigProvider")
        }));
        this.middlewareStack.use(getHttpSigningPlugin(this.config));
        this.middlewareStack.use(getValidateBucketNamePlugin(this.config));
        this.middlewareStack.use(getAddExpectContinuePlugin(this.config));
        this.middlewareStack.use(getRegionRedirectMiddlewarePlugin(this.config));
        this.middlewareStack.use(getS3ExpressPlugin(this.config));
        this.middlewareStack.use(getS3ExpressHttpSigningPlugin(this.config));
      }
      destroy() {
        super.destroy();
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/AbortMultipartUploadCommand.js
var AbortMultipartUploadCommand;
var init_AbortMultipartUploadCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/AbortMultipartUploadCommand.js"() {
    init_import_meta_url();
    init_dist_es31();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    AbortMultipartUploadCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      Bucket: { type: "contextParams", name: "Bucket" },
      Key: { type: "contextParams", name: "Key" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getThrow200ExceptionsPlugin(config)
      ];
    }).s("AmazonS3", "AbortMultipartUpload", {}).n("S3Client", "AbortMultipartUploadCommand").f(void 0, void 0).ser(se_AbortMultipartUploadCommand).de(de_AbortMultipartUploadCommand).build() {
      static {
        __name(this, "AbortMultipartUploadCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+middleware-ssec@3.714.0/node_modules/@aws-sdk/middleware-ssec/dist-es/index.js
function ssecMiddleware(options) {
  return (next) => async (args) => {
    const input = { ...args.input };
    const properties = [
      {
        target: "SSECustomerKey",
        hash: "SSECustomerKeyMD5"
      },
      {
        target: "CopySourceSSECustomerKey",
        hash: "CopySourceSSECustomerKeyMD5"
      }
    ];
    for (const prop of properties) {
      const value = input[prop.target];
      if (value) {
        let valueForHash;
        if (typeof value === "string") {
          if (isValidBase64EncodedSSECustomerKey(value, options)) {
            valueForHash = options.base64Decoder(value);
          } else {
            valueForHash = options.utf8Decoder(value);
            input[prop.target] = options.base64Encoder(valueForHash);
          }
        } else {
          valueForHash = ArrayBuffer.isView(value) ? new Uint8Array(value.buffer, value.byteOffset, value.byteLength) : new Uint8Array(value);
          input[prop.target] = options.base64Encoder(valueForHash);
        }
        const hash = new options.md5();
        hash.update(valueForHash);
        input[prop.hash] = options.base64Encoder(await hash.digest());
      }
    }
    return next({
      ...args,
      input
    });
  };
}
function isValidBase64EncodedSSECustomerKey(str, options) {
  const base64Regex2 = /^(?:[A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/;
  if (!base64Regex2.test(str))
    return false;
  try {
    const decodedBytes = options.base64Decoder(str);
    return decodedBytes.length === 32;
  } catch {
    return false;
  }
}
var ssecMiddlewareOptions, getSsecPlugin;
var init_dist_es70 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+middleware-ssec@3.714.0/node_modules/@aws-sdk/middleware-ssec/dist-es/index.js"() {
    init_import_meta_url();
    __name(ssecMiddleware, "ssecMiddleware");
    ssecMiddlewareOptions = {
      name: "ssecMiddleware",
      step: "initialize",
      tags: ["SSE"],
      override: true
    };
    getSsecPlugin = /* @__PURE__ */ __name((config) => ({
      applyToStack: /* @__PURE__ */ __name((clientStack) => {
        clientStack.add(ssecMiddleware(config), ssecMiddlewareOptions);
      }, "applyToStack")
    }), "getSsecPlugin");
    __name(isValidBase64EncodedSSECustomerKey, "isValidBase64EncodedSSECustomerKey");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/CompleteMultipartUploadCommand.js
var CompleteMultipartUploadCommand;
var init_CompleteMultipartUploadCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/CompleteMultipartUploadCommand.js"() {
    init_import_meta_url();
    init_dist_es31();
    init_dist_es70();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_models_0();
    init_Aws_restXml();
    CompleteMultipartUploadCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      Bucket: { type: "contextParams", name: "Bucket" },
      Key: { type: "contextParams", name: "Key" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getThrow200ExceptionsPlugin(config),
        getSsecPlugin(config)
      ];
    }).s("AmazonS3", "CompleteMultipartUpload", {}).n("S3Client", "CompleteMultipartUploadCommand").f(CompleteMultipartUploadRequestFilterSensitiveLog, CompleteMultipartUploadOutputFilterSensitiveLog).ser(se_CompleteMultipartUploadCommand).de(de_CompleteMultipartUploadCommand).build() {
      static {
        __name(this, "CompleteMultipartUploadCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/CopyObjectCommand.js
var CopyObjectCommand;
var init_CopyObjectCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/CopyObjectCommand.js"() {
    init_import_meta_url();
    init_dist_es31();
    init_dist_es70();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_models_0();
    init_Aws_restXml();
    CopyObjectCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      DisableS3ExpressSessionAuth: { type: "staticContextParams", value: true },
      Bucket: { type: "contextParams", name: "Bucket" },
      Key: { type: "contextParams", name: "Key" },
      CopySource: { type: "contextParams", name: "CopySource" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getThrow200ExceptionsPlugin(config),
        getSsecPlugin(config)
      ];
    }).s("AmazonS3", "CopyObject", {}).n("S3Client", "CopyObjectCommand").f(CopyObjectRequestFilterSensitiveLog, CopyObjectOutputFilterSensitiveLog).ser(se_CopyObjectCommand).de(de_CopyObjectCommand).build() {
      static {
        __name(this, "CopyObjectCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+middleware-location-constraint@3.714.0/node_modules/@aws-sdk/middleware-location-constraint/dist-es/index.js
function locationConstraintMiddleware(options) {
  return (next) => async (args) => {
    const { CreateBucketConfiguration } = args.input;
    const region = await options.region();
    if (!CreateBucketConfiguration?.LocationConstraint && !CreateBucketConfiguration?.Location) {
      args = {
        ...args,
        input: {
          ...args.input,
          CreateBucketConfiguration: region === "us-east-1" ? void 0 : { LocationConstraint: region }
        }
      };
    }
    return next(args);
  };
}
var locationConstraintMiddlewareOptions, getLocationConstraintPlugin;
var init_dist_es71 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+middleware-location-constraint@3.714.0/node_modules/@aws-sdk/middleware-location-constraint/dist-es/index.js"() {
    init_import_meta_url();
    __name(locationConstraintMiddleware, "locationConstraintMiddleware");
    locationConstraintMiddlewareOptions = {
      step: "initialize",
      tags: ["LOCATION_CONSTRAINT", "CREATE_BUCKET_CONFIGURATION"],
      name: "locationConstraintMiddleware",
      override: true
    };
    getLocationConstraintPlugin = /* @__PURE__ */ __name((config) => ({
      applyToStack: /* @__PURE__ */ __name((clientStack) => {
        clientStack.add(locationConstraintMiddleware(config), locationConstraintMiddlewareOptions);
      }, "applyToStack")
    }), "getLocationConstraintPlugin");
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/CreateBucketCommand.js
var CreateBucketCommand;
var init_CreateBucketCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/CreateBucketCommand.js"() {
    init_import_meta_url();
    init_dist_es71();
    init_dist_es31();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    CreateBucketCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true },
      DisableAccessPoints: { type: "staticContextParams", value: true },
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getThrow200ExceptionsPlugin(config),
        getLocationConstraintPlugin(config)
      ];
    }).s("AmazonS3", "CreateBucket", {}).n("S3Client", "CreateBucketCommand").f(void 0, void 0).ser(se_CreateBucketCommand).de(de_CreateBucketCommand).build() {
      static {
        __name(this, "CreateBucketCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/CreateBucketMetadataTableConfigurationCommand.js
var CreateBucketMetadataTableConfigurationCommand;
var init_CreateBucketMetadataTableConfigurationCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/CreateBucketMetadataTableConfigurationCommand.js"() {
    init_import_meta_url();
    init_dist_es25();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    CreateBucketMetadataTableConfigurationCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true },
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getFlexibleChecksumsPlugin(config, {
          requestAlgorithmMember: { httpHeader: "x-amz-sdk-checksum-algorithm", name: "ChecksumAlgorithm" },
          requestChecksumRequired: true
        })
      ];
    }).s("AmazonS3", "CreateBucketMetadataTableConfiguration", {}).n("S3Client", "CreateBucketMetadataTableConfigurationCommand").f(void 0, void 0).ser(se_CreateBucketMetadataTableConfigurationCommand).de(de_CreateBucketMetadataTableConfigurationCommand).build() {
      static {
        __name(this, "CreateBucketMetadataTableConfigurationCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/CreateMultipartUploadCommand.js
var CreateMultipartUploadCommand;
var init_CreateMultipartUploadCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/CreateMultipartUploadCommand.js"() {
    init_import_meta_url();
    init_dist_es31();
    init_dist_es70();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_models_0();
    init_Aws_restXml();
    CreateMultipartUploadCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      Bucket: { type: "contextParams", name: "Bucket" },
      Key: { type: "contextParams", name: "Key" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getThrow200ExceptionsPlugin(config),
        getSsecPlugin(config)
      ];
    }).s("AmazonS3", "CreateMultipartUpload", {}).n("S3Client", "CreateMultipartUploadCommand").f(CreateMultipartUploadRequestFilterSensitiveLog, CreateMultipartUploadOutputFilterSensitiveLog).ser(se_CreateMultipartUploadCommand).de(de_CreateMultipartUploadCommand).build() {
      static {
        __name(this, "CreateMultipartUploadCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteBucketAnalyticsConfigurationCommand.js
var DeleteBucketAnalyticsConfigurationCommand;
var init_DeleteBucketAnalyticsConfigurationCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteBucketAnalyticsConfigurationCommand.js"() {
    init_import_meta_url();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    DeleteBucketAnalyticsConfigurationCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true },
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions())
      ];
    }).s("AmazonS3", "DeleteBucketAnalyticsConfiguration", {}).n("S3Client", "DeleteBucketAnalyticsConfigurationCommand").f(void 0, void 0).ser(se_DeleteBucketAnalyticsConfigurationCommand).de(de_DeleteBucketAnalyticsConfigurationCommand).build() {
      static {
        __name(this, "DeleteBucketAnalyticsConfigurationCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteBucketCommand.js
var DeleteBucketCommand;
var init_DeleteBucketCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteBucketCommand.js"() {
    init_import_meta_url();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    DeleteBucketCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true },
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions())
      ];
    }).s("AmazonS3", "DeleteBucket", {}).n("S3Client", "DeleteBucketCommand").f(void 0, void 0).ser(se_DeleteBucketCommand).de(de_DeleteBucketCommand).build() {
      static {
        __name(this, "DeleteBucketCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteBucketCorsCommand.js
var DeleteBucketCorsCommand;
var init_DeleteBucketCorsCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteBucketCorsCommand.js"() {
    init_import_meta_url();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    DeleteBucketCorsCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true },
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions())
      ];
    }).s("AmazonS3", "DeleteBucketCors", {}).n("S3Client", "DeleteBucketCorsCommand").f(void 0, void 0).ser(se_DeleteBucketCorsCommand).de(de_DeleteBucketCorsCommand).build() {
      static {
        __name(this, "DeleteBucketCorsCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteBucketEncryptionCommand.js
var DeleteBucketEncryptionCommand;
var init_DeleteBucketEncryptionCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteBucketEncryptionCommand.js"() {
    init_import_meta_url();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    DeleteBucketEncryptionCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true },
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions())
      ];
    }).s("AmazonS3", "DeleteBucketEncryption", {}).n("S3Client", "DeleteBucketEncryptionCommand").f(void 0, void 0).ser(se_DeleteBucketEncryptionCommand).de(de_DeleteBucketEncryptionCommand).build() {
      static {
        __name(this, "DeleteBucketEncryptionCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteBucketIntelligentTieringConfigurationCommand.js
var DeleteBucketIntelligentTieringConfigurationCommand;
var init_DeleteBucketIntelligentTieringConfigurationCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteBucketIntelligentTieringConfigurationCommand.js"() {
    init_import_meta_url();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    DeleteBucketIntelligentTieringConfigurationCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true },
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions())
      ];
    }).s("AmazonS3", "DeleteBucketIntelligentTieringConfiguration", {}).n("S3Client", "DeleteBucketIntelligentTieringConfigurationCommand").f(void 0, void 0).ser(se_DeleteBucketIntelligentTieringConfigurationCommand).de(de_DeleteBucketIntelligentTieringConfigurationCommand).build() {
      static {
        __name(this, "DeleteBucketIntelligentTieringConfigurationCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteBucketInventoryConfigurationCommand.js
var DeleteBucketInventoryConfigurationCommand;
var init_DeleteBucketInventoryConfigurationCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteBucketInventoryConfigurationCommand.js"() {
    init_import_meta_url();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    DeleteBucketInventoryConfigurationCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true },
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions())
      ];
    }).s("AmazonS3", "DeleteBucketInventoryConfiguration", {}).n("S3Client", "DeleteBucketInventoryConfigurationCommand").f(void 0, void 0).ser(se_DeleteBucketInventoryConfigurationCommand).de(de_DeleteBucketInventoryConfigurationCommand).build() {
      static {
        __name(this, "DeleteBucketInventoryConfigurationCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteBucketLifecycleCommand.js
var DeleteBucketLifecycleCommand;
var init_DeleteBucketLifecycleCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteBucketLifecycleCommand.js"() {
    init_import_meta_url();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    DeleteBucketLifecycleCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true },
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions())
      ];
    }).s("AmazonS3", "DeleteBucketLifecycle", {}).n("S3Client", "DeleteBucketLifecycleCommand").f(void 0, void 0).ser(se_DeleteBucketLifecycleCommand).de(de_DeleteBucketLifecycleCommand).build() {
      static {
        __name(this, "DeleteBucketLifecycleCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteBucketMetadataTableConfigurationCommand.js
var DeleteBucketMetadataTableConfigurationCommand;
var init_DeleteBucketMetadataTableConfigurationCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteBucketMetadataTableConfigurationCommand.js"() {
    init_import_meta_url();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    DeleteBucketMetadataTableConfigurationCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true },
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions())
      ];
    }).s("AmazonS3", "DeleteBucketMetadataTableConfiguration", {}).n("S3Client", "DeleteBucketMetadataTableConfigurationCommand").f(void 0, void 0).ser(se_DeleteBucketMetadataTableConfigurationCommand).de(de_DeleteBucketMetadataTableConfigurationCommand).build() {
      static {
        __name(this, "DeleteBucketMetadataTableConfigurationCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteBucketMetricsConfigurationCommand.js
var DeleteBucketMetricsConfigurationCommand;
var init_DeleteBucketMetricsConfigurationCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteBucketMetricsConfigurationCommand.js"() {
    init_import_meta_url();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    DeleteBucketMetricsConfigurationCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true },
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions())
      ];
    }).s("AmazonS3", "DeleteBucketMetricsConfiguration", {}).n("S3Client", "DeleteBucketMetricsConfigurationCommand").f(void 0, void 0).ser(se_DeleteBucketMetricsConfigurationCommand).de(de_DeleteBucketMetricsConfigurationCommand).build() {
      static {
        __name(this, "DeleteBucketMetricsConfigurationCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteBucketOwnershipControlsCommand.js
var DeleteBucketOwnershipControlsCommand;
var init_DeleteBucketOwnershipControlsCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteBucketOwnershipControlsCommand.js"() {
    init_import_meta_url();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    DeleteBucketOwnershipControlsCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true },
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions())
      ];
    }).s("AmazonS3", "DeleteBucketOwnershipControls", {}).n("S3Client", "DeleteBucketOwnershipControlsCommand").f(void 0, void 0).ser(se_DeleteBucketOwnershipControlsCommand).de(de_DeleteBucketOwnershipControlsCommand).build() {
      static {
        __name(this, "DeleteBucketOwnershipControlsCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteBucketPolicyCommand.js
var DeleteBucketPolicyCommand;
var init_DeleteBucketPolicyCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteBucketPolicyCommand.js"() {
    init_import_meta_url();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    DeleteBucketPolicyCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true },
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions())
      ];
    }).s("AmazonS3", "DeleteBucketPolicy", {}).n("S3Client", "DeleteBucketPolicyCommand").f(void 0, void 0).ser(se_DeleteBucketPolicyCommand).de(de_DeleteBucketPolicyCommand).build() {
      static {
        __name(this, "DeleteBucketPolicyCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteBucketReplicationCommand.js
var DeleteBucketReplicationCommand;
var init_DeleteBucketReplicationCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteBucketReplicationCommand.js"() {
    init_import_meta_url();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    DeleteBucketReplicationCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true },
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions())
      ];
    }).s("AmazonS3", "DeleteBucketReplication", {}).n("S3Client", "DeleteBucketReplicationCommand").f(void 0, void 0).ser(se_DeleteBucketReplicationCommand).de(de_DeleteBucketReplicationCommand).build() {
      static {
        __name(this, "DeleteBucketReplicationCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteBucketTaggingCommand.js
var DeleteBucketTaggingCommand;
var init_DeleteBucketTaggingCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteBucketTaggingCommand.js"() {
    init_import_meta_url();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    DeleteBucketTaggingCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true },
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions())
      ];
    }).s("AmazonS3", "DeleteBucketTagging", {}).n("S3Client", "DeleteBucketTaggingCommand").f(void 0, void 0).ser(se_DeleteBucketTaggingCommand).de(de_DeleteBucketTaggingCommand).build() {
      static {
        __name(this, "DeleteBucketTaggingCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteBucketWebsiteCommand.js
var DeleteBucketWebsiteCommand;
var init_DeleteBucketWebsiteCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteBucketWebsiteCommand.js"() {
    init_import_meta_url();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    DeleteBucketWebsiteCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true },
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions())
      ];
    }).s("AmazonS3", "DeleteBucketWebsite", {}).n("S3Client", "DeleteBucketWebsiteCommand").f(void 0, void 0).ser(se_DeleteBucketWebsiteCommand).de(de_DeleteBucketWebsiteCommand).build() {
      static {
        __name(this, "DeleteBucketWebsiteCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteObjectCommand.js
var DeleteObjectCommand;
var init_DeleteObjectCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteObjectCommand.js"() {
    init_import_meta_url();
    init_dist_es31();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    DeleteObjectCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      Bucket: { type: "contextParams", name: "Bucket" },
      Key: { type: "contextParams", name: "Key" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getThrow200ExceptionsPlugin(config)
      ];
    }).s("AmazonS3", "DeleteObject", {}).n("S3Client", "DeleteObjectCommand").f(void 0, void 0).ser(se_DeleteObjectCommand).de(de_DeleteObjectCommand).build() {
      static {
        __name(this, "DeleteObjectCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteObjectsCommand.js
var DeleteObjectsCommand;
var init_DeleteObjectsCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteObjectsCommand.js"() {
    init_import_meta_url();
    init_dist_es25();
    init_dist_es31();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    DeleteObjectsCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getFlexibleChecksumsPlugin(config, {
          requestAlgorithmMember: { httpHeader: "x-amz-sdk-checksum-algorithm", name: "ChecksumAlgorithm" },
          requestChecksumRequired: true
        }),
        getThrow200ExceptionsPlugin(config)
      ];
    }).s("AmazonS3", "DeleteObjects", {}).n("S3Client", "DeleteObjectsCommand").f(void 0, void 0).ser(se_DeleteObjectsCommand).de(de_DeleteObjectsCommand).build() {
      static {
        __name(this, "DeleteObjectsCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteObjectTaggingCommand.js
var DeleteObjectTaggingCommand;
var init_DeleteObjectTaggingCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteObjectTaggingCommand.js"() {
    init_import_meta_url();
    init_dist_es31();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    DeleteObjectTaggingCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getThrow200ExceptionsPlugin(config)
      ];
    }).s("AmazonS3", "DeleteObjectTagging", {}).n("S3Client", "DeleteObjectTaggingCommand").f(void 0, void 0).ser(se_DeleteObjectTaggingCommand).de(de_DeleteObjectTaggingCommand).build() {
      static {
        __name(this, "DeleteObjectTaggingCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/DeletePublicAccessBlockCommand.js
var DeletePublicAccessBlockCommand;
var init_DeletePublicAccessBlockCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/DeletePublicAccessBlockCommand.js"() {
    init_import_meta_url();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    DeletePublicAccessBlockCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true },
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions())
      ];
    }).s("AmazonS3", "DeletePublicAccessBlock", {}).n("S3Client", "DeletePublicAccessBlockCommand").f(void 0, void 0).ser(se_DeletePublicAccessBlockCommand).de(de_DeletePublicAccessBlockCommand).build() {
      static {
        __name(this, "DeletePublicAccessBlockCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketAccelerateConfigurationCommand.js
var GetBucketAccelerateConfigurationCommand;
var init_GetBucketAccelerateConfigurationCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketAccelerateConfigurationCommand.js"() {
    init_import_meta_url();
    init_dist_es31();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    GetBucketAccelerateConfigurationCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true },
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getThrow200ExceptionsPlugin(config)
      ];
    }).s("AmazonS3", "GetBucketAccelerateConfiguration", {}).n("S3Client", "GetBucketAccelerateConfigurationCommand").f(void 0, void 0).ser(se_GetBucketAccelerateConfigurationCommand).de(de_GetBucketAccelerateConfigurationCommand).build() {
      static {
        __name(this, "GetBucketAccelerateConfigurationCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketAclCommand.js
var GetBucketAclCommand;
var init_GetBucketAclCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketAclCommand.js"() {
    init_import_meta_url();
    init_dist_es31();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    GetBucketAclCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true },
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getThrow200ExceptionsPlugin(config)
      ];
    }).s("AmazonS3", "GetBucketAcl", {}).n("S3Client", "GetBucketAclCommand").f(void 0, void 0).ser(se_GetBucketAclCommand).de(de_GetBucketAclCommand).build() {
      static {
        __name(this, "GetBucketAclCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketAnalyticsConfigurationCommand.js
var GetBucketAnalyticsConfigurationCommand;
var init_GetBucketAnalyticsConfigurationCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketAnalyticsConfigurationCommand.js"() {
    init_import_meta_url();
    init_dist_es31();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    GetBucketAnalyticsConfigurationCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true },
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getThrow200ExceptionsPlugin(config)
      ];
    }).s("AmazonS3", "GetBucketAnalyticsConfiguration", {}).n("S3Client", "GetBucketAnalyticsConfigurationCommand").f(void 0, void 0).ser(se_GetBucketAnalyticsConfigurationCommand).de(de_GetBucketAnalyticsConfigurationCommand).build() {
      static {
        __name(this, "GetBucketAnalyticsConfigurationCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketCorsCommand.js
var GetBucketCorsCommand;
var init_GetBucketCorsCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketCorsCommand.js"() {
    init_import_meta_url();
    init_dist_es31();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    GetBucketCorsCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true },
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getThrow200ExceptionsPlugin(config)
      ];
    }).s("AmazonS3", "GetBucketCors", {}).n("S3Client", "GetBucketCorsCommand").f(void 0, void 0).ser(se_GetBucketCorsCommand).de(de_GetBucketCorsCommand).build() {
      static {
        __name(this, "GetBucketCorsCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketEncryptionCommand.js
var GetBucketEncryptionCommand;
var init_GetBucketEncryptionCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketEncryptionCommand.js"() {
    init_import_meta_url();
    init_dist_es31();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_models_0();
    init_Aws_restXml();
    GetBucketEncryptionCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true },
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getThrow200ExceptionsPlugin(config)
      ];
    }).s("AmazonS3", "GetBucketEncryption", {}).n("S3Client", "GetBucketEncryptionCommand").f(void 0, GetBucketEncryptionOutputFilterSensitiveLog).ser(se_GetBucketEncryptionCommand).de(de_GetBucketEncryptionCommand).build() {
      static {
        __name(this, "GetBucketEncryptionCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketIntelligentTieringConfigurationCommand.js
var GetBucketIntelligentTieringConfigurationCommand;
var init_GetBucketIntelligentTieringConfigurationCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketIntelligentTieringConfigurationCommand.js"() {
    init_import_meta_url();
    init_dist_es31();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    GetBucketIntelligentTieringConfigurationCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true },
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getThrow200ExceptionsPlugin(config)
      ];
    }).s("AmazonS3", "GetBucketIntelligentTieringConfiguration", {}).n("S3Client", "GetBucketIntelligentTieringConfigurationCommand").f(void 0, void 0).ser(se_GetBucketIntelligentTieringConfigurationCommand).de(de_GetBucketIntelligentTieringConfigurationCommand).build() {
      static {
        __name(this, "GetBucketIntelligentTieringConfigurationCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketInventoryConfigurationCommand.js
var GetBucketInventoryConfigurationCommand;
var init_GetBucketInventoryConfigurationCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketInventoryConfigurationCommand.js"() {
    init_import_meta_url();
    init_dist_es31();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_models_0();
    init_Aws_restXml();
    GetBucketInventoryConfigurationCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true },
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getThrow200ExceptionsPlugin(config)
      ];
    }).s("AmazonS3", "GetBucketInventoryConfiguration", {}).n("S3Client", "GetBucketInventoryConfigurationCommand").f(void 0, GetBucketInventoryConfigurationOutputFilterSensitiveLog).ser(se_GetBucketInventoryConfigurationCommand).de(de_GetBucketInventoryConfigurationCommand).build() {
      static {
        __name(this, "GetBucketInventoryConfigurationCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketLifecycleConfigurationCommand.js
var GetBucketLifecycleConfigurationCommand;
var init_GetBucketLifecycleConfigurationCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketLifecycleConfigurationCommand.js"() {
    init_import_meta_url();
    init_dist_es31();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    GetBucketLifecycleConfigurationCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true },
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getThrow200ExceptionsPlugin(config)
      ];
    }).s("AmazonS3", "GetBucketLifecycleConfiguration", {}).n("S3Client", "GetBucketLifecycleConfigurationCommand").f(void 0, void 0).ser(se_GetBucketLifecycleConfigurationCommand).de(de_GetBucketLifecycleConfigurationCommand).build() {
      static {
        __name(this, "GetBucketLifecycleConfigurationCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketLocationCommand.js
var GetBucketLocationCommand;
var init_GetBucketLocationCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketLocationCommand.js"() {
    init_import_meta_url();
    init_dist_es31();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    GetBucketLocationCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true },
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getThrow200ExceptionsPlugin(config)
      ];
    }).s("AmazonS3", "GetBucketLocation", {}).n("S3Client", "GetBucketLocationCommand").f(void 0, void 0).ser(se_GetBucketLocationCommand).de(de_GetBucketLocationCommand).build() {
      static {
        __name(this, "GetBucketLocationCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketLoggingCommand.js
var GetBucketLoggingCommand;
var init_GetBucketLoggingCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketLoggingCommand.js"() {
    init_import_meta_url();
    init_dist_es31();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    GetBucketLoggingCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true },
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getThrow200ExceptionsPlugin(config)
      ];
    }).s("AmazonS3", "GetBucketLogging", {}).n("S3Client", "GetBucketLoggingCommand").f(void 0, void 0).ser(se_GetBucketLoggingCommand).de(de_GetBucketLoggingCommand).build() {
      static {
        __name(this, "GetBucketLoggingCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketMetadataTableConfigurationCommand.js
var GetBucketMetadataTableConfigurationCommand;
var init_GetBucketMetadataTableConfigurationCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketMetadataTableConfigurationCommand.js"() {
    init_import_meta_url();
    init_dist_es31();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    GetBucketMetadataTableConfigurationCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true },
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getThrow200ExceptionsPlugin(config)
      ];
    }).s("AmazonS3", "GetBucketMetadataTableConfiguration", {}).n("S3Client", "GetBucketMetadataTableConfigurationCommand").f(void 0, void 0).ser(se_GetBucketMetadataTableConfigurationCommand).de(de_GetBucketMetadataTableConfigurationCommand).build() {
      static {
        __name(this, "GetBucketMetadataTableConfigurationCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketMetricsConfigurationCommand.js
var GetBucketMetricsConfigurationCommand;
var init_GetBucketMetricsConfigurationCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketMetricsConfigurationCommand.js"() {
    init_import_meta_url();
    init_dist_es31();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    GetBucketMetricsConfigurationCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true },
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getThrow200ExceptionsPlugin(config)
      ];
    }).s("AmazonS3", "GetBucketMetricsConfiguration", {}).n("S3Client", "GetBucketMetricsConfigurationCommand").f(void 0, void 0).ser(se_GetBucketMetricsConfigurationCommand).de(de_GetBucketMetricsConfigurationCommand).build() {
      static {
        __name(this, "GetBucketMetricsConfigurationCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketNotificationConfigurationCommand.js
var GetBucketNotificationConfigurationCommand;
var init_GetBucketNotificationConfigurationCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketNotificationConfigurationCommand.js"() {
    init_import_meta_url();
    init_dist_es31();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    GetBucketNotificationConfigurationCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true },
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getThrow200ExceptionsPlugin(config)
      ];
    }).s("AmazonS3", "GetBucketNotificationConfiguration", {}).n("S3Client", "GetBucketNotificationConfigurationCommand").f(void 0, void 0).ser(se_GetBucketNotificationConfigurationCommand).de(de_GetBucketNotificationConfigurationCommand).build() {
      static {
        __name(this, "GetBucketNotificationConfigurationCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketOwnershipControlsCommand.js
var GetBucketOwnershipControlsCommand;
var init_GetBucketOwnershipControlsCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketOwnershipControlsCommand.js"() {
    init_import_meta_url();
    init_dist_es31();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    GetBucketOwnershipControlsCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true },
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getThrow200ExceptionsPlugin(config)
      ];
    }).s("AmazonS3", "GetBucketOwnershipControls", {}).n("S3Client", "GetBucketOwnershipControlsCommand").f(void 0, void 0).ser(se_GetBucketOwnershipControlsCommand).de(de_GetBucketOwnershipControlsCommand).build() {
      static {
        __name(this, "GetBucketOwnershipControlsCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketPolicyCommand.js
var GetBucketPolicyCommand;
var init_GetBucketPolicyCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketPolicyCommand.js"() {
    init_import_meta_url();
    init_dist_es31();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    GetBucketPolicyCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true },
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getThrow200ExceptionsPlugin(config)
      ];
    }).s("AmazonS3", "GetBucketPolicy", {}).n("S3Client", "GetBucketPolicyCommand").f(void 0, void 0).ser(se_GetBucketPolicyCommand).de(de_GetBucketPolicyCommand).build() {
      static {
        __name(this, "GetBucketPolicyCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketPolicyStatusCommand.js
var GetBucketPolicyStatusCommand;
var init_GetBucketPolicyStatusCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketPolicyStatusCommand.js"() {
    init_import_meta_url();
    init_dist_es31();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    GetBucketPolicyStatusCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true },
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getThrow200ExceptionsPlugin(config)
      ];
    }).s("AmazonS3", "GetBucketPolicyStatus", {}).n("S3Client", "GetBucketPolicyStatusCommand").f(void 0, void 0).ser(se_GetBucketPolicyStatusCommand).de(de_GetBucketPolicyStatusCommand).build() {
      static {
        __name(this, "GetBucketPolicyStatusCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketReplicationCommand.js
var GetBucketReplicationCommand;
var init_GetBucketReplicationCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketReplicationCommand.js"() {
    init_import_meta_url();
    init_dist_es31();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    GetBucketReplicationCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true },
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getThrow200ExceptionsPlugin(config)
      ];
    }).s("AmazonS3", "GetBucketReplication", {}).n("S3Client", "GetBucketReplicationCommand").f(void 0, void 0).ser(se_GetBucketReplicationCommand).de(de_GetBucketReplicationCommand).build() {
      static {
        __name(this, "GetBucketReplicationCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketRequestPaymentCommand.js
var GetBucketRequestPaymentCommand;
var init_GetBucketRequestPaymentCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketRequestPaymentCommand.js"() {
    init_import_meta_url();
    init_dist_es31();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    GetBucketRequestPaymentCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true },
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getThrow200ExceptionsPlugin(config)
      ];
    }).s("AmazonS3", "GetBucketRequestPayment", {}).n("S3Client", "GetBucketRequestPaymentCommand").f(void 0, void 0).ser(se_GetBucketRequestPaymentCommand).de(de_GetBucketRequestPaymentCommand).build() {
      static {
        __name(this, "GetBucketRequestPaymentCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketTaggingCommand.js
var GetBucketTaggingCommand;
var init_GetBucketTaggingCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketTaggingCommand.js"() {
    init_import_meta_url();
    init_dist_es31();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    GetBucketTaggingCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true },
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getThrow200ExceptionsPlugin(config)
      ];
    }).s("AmazonS3", "GetBucketTagging", {}).n("S3Client", "GetBucketTaggingCommand").f(void 0, void 0).ser(se_GetBucketTaggingCommand).de(de_GetBucketTaggingCommand).build() {
      static {
        __name(this, "GetBucketTaggingCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketVersioningCommand.js
var GetBucketVersioningCommand;
var init_GetBucketVersioningCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketVersioningCommand.js"() {
    init_import_meta_url();
    init_dist_es31();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    GetBucketVersioningCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true },
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getThrow200ExceptionsPlugin(config)
      ];
    }).s("AmazonS3", "GetBucketVersioning", {}).n("S3Client", "GetBucketVersioningCommand").f(void 0, void 0).ser(se_GetBucketVersioningCommand).de(de_GetBucketVersioningCommand).build() {
      static {
        __name(this, "GetBucketVersioningCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketWebsiteCommand.js
var GetBucketWebsiteCommand;
var init_GetBucketWebsiteCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketWebsiteCommand.js"() {
    init_import_meta_url();
    init_dist_es31();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    GetBucketWebsiteCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true },
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getThrow200ExceptionsPlugin(config)
      ];
    }).s("AmazonS3", "GetBucketWebsite", {}).n("S3Client", "GetBucketWebsiteCommand").f(void 0, void 0).ser(se_GetBucketWebsiteCommand).de(de_GetBucketWebsiteCommand).build() {
      static {
        __name(this, "GetBucketWebsiteCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/GetObjectAclCommand.js
var GetObjectAclCommand;
var init_GetObjectAclCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/GetObjectAclCommand.js"() {
    init_import_meta_url();
    init_dist_es31();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    GetObjectAclCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      Bucket: { type: "contextParams", name: "Bucket" },
      Key: { type: "contextParams", name: "Key" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getThrow200ExceptionsPlugin(config)
      ];
    }).s("AmazonS3", "GetObjectAcl", {}).n("S3Client", "GetObjectAclCommand").f(void 0, void 0).ser(se_GetObjectAclCommand).de(de_GetObjectAclCommand).build() {
      static {
        __name(this, "GetObjectAclCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/GetObjectAttributesCommand.js
var GetObjectAttributesCommand;
var init_GetObjectAttributesCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/GetObjectAttributesCommand.js"() {
    init_import_meta_url();
    init_dist_es31();
    init_dist_es70();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_models_0();
    init_Aws_restXml();
    GetObjectAttributesCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getThrow200ExceptionsPlugin(config),
        getSsecPlugin(config)
      ];
    }).s("AmazonS3", "GetObjectAttributes", {}).n("S3Client", "GetObjectAttributesCommand").f(GetObjectAttributesRequestFilterSensitiveLog, void 0).ser(se_GetObjectAttributesCommand).de(de_GetObjectAttributesCommand).build() {
      static {
        __name(this, "GetObjectAttributesCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/GetObjectCommand.js
var GetObjectCommand;
var init_GetObjectCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/GetObjectCommand.js"() {
    init_import_meta_url();
    init_dist_es25();
    init_dist_es31();
    init_dist_es70();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_models_0();
    init_Aws_restXml();
    GetObjectCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      Bucket: { type: "contextParams", name: "Bucket" },
      Key: { type: "contextParams", name: "Key" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getFlexibleChecksumsPlugin(config, {
          requestChecksumRequired: false,
          requestValidationModeMember: "ChecksumMode",
          responseAlgorithms: ["CRC32", "CRC32C", "SHA256", "SHA1"]
        }),
        getSsecPlugin(config),
        getS3ExpiresMiddlewarePlugin(config)
      ];
    }).s("AmazonS3", "GetObject", {}).n("S3Client", "GetObjectCommand").f(GetObjectRequestFilterSensitiveLog, GetObjectOutputFilterSensitiveLog).ser(se_GetObjectCommand).de(de_GetObjectCommand).build() {
      static {
        __name(this, "GetObjectCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/GetObjectLegalHoldCommand.js
var GetObjectLegalHoldCommand;
var init_GetObjectLegalHoldCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/GetObjectLegalHoldCommand.js"() {
    init_import_meta_url();
    init_dist_es31();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    GetObjectLegalHoldCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getThrow200ExceptionsPlugin(config)
      ];
    }).s("AmazonS3", "GetObjectLegalHold", {}).n("S3Client", "GetObjectLegalHoldCommand").f(void 0, void 0).ser(se_GetObjectLegalHoldCommand).de(de_GetObjectLegalHoldCommand).build() {
      static {
        __name(this, "GetObjectLegalHoldCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/GetObjectLockConfigurationCommand.js
var GetObjectLockConfigurationCommand;
var init_GetObjectLockConfigurationCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/GetObjectLockConfigurationCommand.js"() {
    init_import_meta_url();
    init_dist_es31();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    GetObjectLockConfigurationCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getThrow200ExceptionsPlugin(config)
      ];
    }).s("AmazonS3", "GetObjectLockConfiguration", {}).n("S3Client", "GetObjectLockConfigurationCommand").f(void 0, void 0).ser(se_GetObjectLockConfigurationCommand).de(de_GetObjectLockConfigurationCommand).build() {
      static {
        __name(this, "GetObjectLockConfigurationCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/GetObjectRetentionCommand.js
var GetObjectRetentionCommand;
var init_GetObjectRetentionCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/GetObjectRetentionCommand.js"() {
    init_import_meta_url();
    init_dist_es31();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    GetObjectRetentionCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getThrow200ExceptionsPlugin(config)
      ];
    }).s("AmazonS3", "GetObjectRetention", {}).n("S3Client", "GetObjectRetentionCommand").f(void 0, void 0).ser(se_GetObjectRetentionCommand).de(de_GetObjectRetentionCommand).build() {
      static {
        __name(this, "GetObjectRetentionCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/GetObjectTaggingCommand.js
var GetObjectTaggingCommand;
var init_GetObjectTaggingCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/GetObjectTaggingCommand.js"() {
    init_import_meta_url();
    init_dist_es31();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    GetObjectTaggingCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getThrow200ExceptionsPlugin(config)
      ];
    }).s("AmazonS3", "GetObjectTagging", {}).n("S3Client", "GetObjectTaggingCommand").f(void 0, void 0).ser(se_GetObjectTaggingCommand).de(de_GetObjectTaggingCommand).build() {
      static {
        __name(this, "GetObjectTaggingCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/GetObjectTorrentCommand.js
var GetObjectTorrentCommand;
var init_GetObjectTorrentCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/GetObjectTorrentCommand.js"() {
    init_import_meta_url();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_models_0();
    init_Aws_restXml();
    GetObjectTorrentCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions())
      ];
    }).s("AmazonS3", "GetObjectTorrent", {}).n("S3Client", "GetObjectTorrentCommand").f(void 0, GetObjectTorrentOutputFilterSensitiveLog).ser(se_GetObjectTorrentCommand).de(de_GetObjectTorrentCommand).build() {
      static {
        __name(this, "GetObjectTorrentCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/GetPublicAccessBlockCommand.js
var GetPublicAccessBlockCommand;
var init_GetPublicAccessBlockCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/GetPublicAccessBlockCommand.js"() {
    init_import_meta_url();
    init_dist_es31();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    GetPublicAccessBlockCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true },
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getThrow200ExceptionsPlugin(config)
      ];
    }).s("AmazonS3", "GetPublicAccessBlock", {}).n("S3Client", "GetPublicAccessBlockCommand").f(void 0, void 0).ser(se_GetPublicAccessBlockCommand).de(de_GetPublicAccessBlockCommand).build() {
      static {
        __name(this, "GetPublicAccessBlockCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/HeadBucketCommand.js
var HeadBucketCommand;
var init_HeadBucketCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/HeadBucketCommand.js"() {
    init_import_meta_url();
    init_dist_es31();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    HeadBucketCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getThrow200ExceptionsPlugin(config)
      ];
    }).s("AmazonS3", "HeadBucket", {}).n("S3Client", "HeadBucketCommand").f(void 0, void 0).ser(se_HeadBucketCommand).de(de_HeadBucketCommand).build() {
      static {
        __name(this, "HeadBucketCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/HeadObjectCommand.js
var HeadObjectCommand;
var init_HeadObjectCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/HeadObjectCommand.js"() {
    init_import_meta_url();
    init_dist_es31();
    init_dist_es70();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_models_0();
    init_Aws_restXml();
    HeadObjectCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      Bucket: { type: "contextParams", name: "Bucket" },
      Key: { type: "contextParams", name: "Key" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getThrow200ExceptionsPlugin(config),
        getSsecPlugin(config),
        getS3ExpiresMiddlewarePlugin(config)
      ];
    }).s("AmazonS3", "HeadObject", {}).n("S3Client", "HeadObjectCommand").f(HeadObjectRequestFilterSensitiveLog, HeadObjectOutputFilterSensitiveLog).ser(se_HeadObjectCommand).de(de_HeadObjectCommand).build() {
      static {
        __name(this, "HeadObjectCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/ListBucketAnalyticsConfigurationsCommand.js
var ListBucketAnalyticsConfigurationsCommand;
var init_ListBucketAnalyticsConfigurationsCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/ListBucketAnalyticsConfigurationsCommand.js"() {
    init_import_meta_url();
    init_dist_es31();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    ListBucketAnalyticsConfigurationsCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true },
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getThrow200ExceptionsPlugin(config)
      ];
    }).s("AmazonS3", "ListBucketAnalyticsConfigurations", {}).n("S3Client", "ListBucketAnalyticsConfigurationsCommand").f(void 0, void 0).ser(se_ListBucketAnalyticsConfigurationsCommand).de(de_ListBucketAnalyticsConfigurationsCommand).build() {
      static {
        __name(this, "ListBucketAnalyticsConfigurationsCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/ListBucketIntelligentTieringConfigurationsCommand.js
var ListBucketIntelligentTieringConfigurationsCommand;
var init_ListBucketIntelligentTieringConfigurationsCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/ListBucketIntelligentTieringConfigurationsCommand.js"() {
    init_import_meta_url();
    init_dist_es31();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    ListBucketIntelligentTieringConfigurationsCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true },
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getThrow200ExceptionsPlugin(config)
      ];
    }).s("AmazonS3", "ListBucketIntelligentTieringConfigurations", {}).n("S3Client", "ListBucketIntelligentTieringConfigurationsCommand").f(void 0, void 0).ser(se_ListBucketIntelligentTieringConfigurationsCommand).de(de_ListBucketIntelligentTieringConfigurationsCommand).build() {
      static {
        __name(this, "ListBucketIntelligentTieringConfigurationsCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/ListBucketInventoryConfigurationsCommand.js
var ListBucketInventoryConfigurationsCommand;
var init_ListBucketInventoryConfigurationsCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/ListBucketInventoryConfigurationsCommand.js"() {
    init_import_meta_url();
    init_dist_es31();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_models_0();
    init_Aws_restXml();
    ListBucketInventoryConfigurationsCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true },
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getThrow200ExceptionsPlugin(config)
      ];
    }).s("AmazonS3", "ListBucketInventoryConfigurations", {}).n("S3Client", "ListBucketInventoryConfigurationsCommand").f(void 0, ListBucketInventoryConfigurationsOutputFilterSensitiveLog).ser(se_ListBucketInventoryConfigurationsCommand).de(de_ListBucketInventoryConfigurationsCommand).build() {
      static {
        __name(this, "ListBucketInventoryConfigurationsCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/ListBucketMetricsConfigurationsCommand.js
var ListBucketMetricsConfigurationsCommand;
var init_ListBucketMetricsConfigurationsCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/ListBucketMetricsConfigurationsCommand.js"() {
    init_import_meta_url();
    init_dist_es31();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    ListBucketMetricsConfigurationsCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getThrow200ExceptionsPlugin(config)
      ];
    }).s("AmazonS3", "ListBucketMetricsConfigurations", {}).n("S3Client", "ListBucketMetricsConfigurationsCommand").f(void 0, void 0).ser(se_ListBucketMetricsConfigurationsCommand).de(de_ListBucketMetricsConfigurationsCommand).build() {
      static {
        __name(this, "ListBucketMetricsConfigurationsCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/ListBucketsCommand.js
var ListBucketsCommand;
var init_ListBucketsCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/ListBucketsCommand.js"() {
    init_import_meta_url();
    init_dist_es31();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    ListBucketsCommand = class extends Command.classBuilder().ep(commonParams).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getThrow200ExceptionsPlugin(config)
      ];
    }).s("AmazonS3", "ListBuckets", {}).n("S3Client", "ListBucketsCommand").f(void 0, void 0).ser(se_ListBucketsCommand).de(de_ListBucketsCommand).build() {
      static {
        __name(this, "ListBucketsCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/ListDirectoryBucketsCommand.js
var ListDirectoryBucketsCommand;
var init_ListDirectoryBucketsCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/ListDirectoryBucketsCommand.js"() {
    init_import_meta_url();
    init_dist_es31();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    ListDirectoryBucketsCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getThrow200ExceptionsPlugin(config)
      ];
    }).s("AmazonS3", "ListDirectoryBuckets", {}).n("S3Client", "ListDirectoryBucketsCommand").f(void 0, void 0).ser(se_ListDirectoryBucketsCommand).de(de_ListDirectoryBucketsCommand).build() {
      static {
        __name(this, "ListDirectoryBucketsCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/ListMultipartUploadsCommand.js
var ListMultipartUploadsCommand;
var init_ListMultipartUploadsCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/ListMultipartUploadsCommand.js"() {
    init_import_meta_url();
    init_dist_es31();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    ListMultipartUploadsCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      Bucket: { type: "contextParams", name: "Bucket" },
      Prefix: { type: "contextParams", name: "Prefix" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getThrow200ExceptionsPlugin(config)
      ];
    }).s("AmazonS3", "ListMultipartUploads", {}).n("S3Client", "ListMultipartUploadsCommand").f(void 0, void 0).ser(se_ListMultipartUploadsCommand).de(de_ListMultipartUploadsCommand).build() {
      static {
        __name(this, "ListMultipartUploadsCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/ListObjectsCommand.js
var ListObjectsCommand;
var init_ListObjectsCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/ListObjectsCommand.js"() {
    init_import_meta_url();
    init_dist_es31();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    ListObjectsCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      Bucket: { type: "contextParams", name: "Bucket" },
      Prefix: { type: "contextParams", name: "Prefix" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getThrow200ExceptionsPlugin(config)
      ];
    }).s("AmazonS3", "ListObjects", {}).n("S3Client", "ListObjectsCommand").f(void 0, void 0).ser(se_ListObjectsCommand).de(de_ListObjectsCommand).build() {
      static {
        __name(this, "ListObjectsCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/ListObjectsV2Command.js
var ListObjectsV2Command;
var init_ListObjectsV2Command = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/ListObjectsV2Command.js"() {
    init_import_meta_url();
    init_dist_es31();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    ListObjectsV2Command = class extends Command.classBuilder().ep({
      ...commonParams,
      Bucket: { type: "contextParams", name: "Bucket" },
      Prefix: { type: "contextParams", name: "Prefix" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getThrow200ExceptionsPlugin(config)
      ];
    }).s("AmazonS3", "ListObjectsV2", {}).n("S3Client", "ListObjectsV2Command").f(void 0, void 0).ser(se_ListObjectsV2Command).de(de_ListObjectsV2Command).build() {
      static {
        __name(this, "ListObjectsV2Command");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/ListObjectVersionsCommand.js
var ListObjectVersionsCommand;
var init_ListObjectVersionsCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/ListObjectVersionsCommand.js"() {
    init_import_meta_url();
    init_dist_es31();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    ListObjectVersionsCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      Bucket: { type: "contextParams", name: "Bucket" },
      Prefix: { type: "contextParams", name: "Prefix" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getThrow200ExceptionsPlugin(config)
      ];
    }).s("AmazonS3", "ListObjectVersions", {}).n("S3Client", "ListObjectVersionsCommand").f(void 0, void 0).ser(se_ListObjectVersionsCommand).de(de_ListObjectVersionsCommand).build() {
      static {
        __name(this, "ListObjectVersionsCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/ListPartsCommand.js
var ListPartsCommand;
var init_ListPartsCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/ListPartsCommand.js"() {
    init_import_meta_url();
    init_dist_es31();
    init_dist_es70();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_models_0();
    init_Aws_restXml();
    ListPartsCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      Bucket: { type: "contextParams", name: "Bucket" },
      Key: { type: "contextParams", name: "Key" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getThrow200ExceptionsPlugin(config),
        getSsecPlugin(config)
      ];
    }).s("AmazonS3", "ListParts", {}).n("S3Client", "ListPartsCommand").f(ListPartsRequestFilterSensitiveLog, void 0).ser(se_ListPartsCommand).de(de_ListPartsCommand).build() {
      static {
        __name(this, "ListPartsCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketAccelerateConfigurationCommand.js
var PutBucketAccelerateConfigurationCommand;
var init_PutBucketAccelerateConfigurationCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketAccelerateConfigurationCommand.js"() {
    init_import_meta_url();
    init_dist_es25();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    PutBucketAccelerateConfigurationCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true },
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getFlexibleChecksumsPlugin(config, {
          requestAlgorithmMember: { httpHeader: "x-amz-sdk-checksum-algorithm", name: "ChecksumAlgorithm" },
          requestChecksumRequired: false
        })
      ];
    }).s("AmazonS3", "PutBucketAccelerateConfiguration", {}).n("S3Client", "PutBucketAccelerateConfigurationCommand").f(void 0, void 0).ser(se_PutBucketAccelerateConfigurationCommand).de(de_PutBucketAccelerateConfigurationCommand).build() {
      static {
        __name(this, "PutBucketAccelerateConfigurationCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketAclCommand.js
var PutBucketAclCommand;
var init_PutBucketAclCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketAclCommand.js"() {
    init_import_meta_url();
    init_dist_es25();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    PutBucketAclCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true },
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getFlexibleChecksumsPlugin(config, {
          requestAlgorithmMember: { httpHeader: "x-amz-sdk-checksum-algorithm", name: "ChecksumAlgorithm" },
          requestChecksumRequired: true
        })
      ];
    }).s("AmazonS3", "PutBucketAcl", {}).n("S3Client", "PutBucketAclCommand").f(void 0, void 0).ser(se_PutBucketAclCommand).de(de_PutBucketAclCommand).build() {
      static {
        __name(this, "PutBucketAclCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketAnalyticsConfigurationCommand.js
var PutBucketAnalyticsConfigurationCommand;
var init_PutBucketAnalyticsConfigurationCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketAnalyticsConfigurationCommand.js"() {
    init_import_meta_url();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    PutBucketAnalyticsConfigurationCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true },
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions())
      ];
    }).s("AmazonS3", "PutBucketAnalyticsConfiguration", {}).n("S3Client", "PutBucketAnalyticsConfigurationCommand").f(void 0, void 0).ser(se_PutBucketAnalyticsConfigurationCommand).de(de_PutBucketAnalyticsConfigurationCommand).build() {
      static {
        __name(this, "PutBucketAnalyticsConfigurationCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketCorsCommand.js
var PutBucketCorsCommand;
var init_PutBucketCorsCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketCorsCommand.js"() {
    init_import_meta_url();
    init_dist_es25();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    PutBucketCorsCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true },
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getFlexibleChecksumsPlugin(config, {
          requestAlgorithmMember: { httpHeader: "x-amz-sdk-checksum-algorithm", name: "ChecksumAlgorithm" },
          requestChecksumRequired: true
        })
      ];
    }).s("AmazonS3", "PutBucketCors", {}).n("S3Client", "PutBucketCorsCommand").f(void 0, void 0).ser(se_PutBucketCorsCommand).de(de_PutBucketCorsCommand).build() {
      static {
        __name(this, "PutBucketCorsCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketEncryptionCommand.js
var PutBucketEncryptionCommand;
var init_PutBucketEncryptionCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketEncryptionCommand.js"() {
    init_import_meta_url();
    init_dist_es25();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_models_1();
    init_Aws_restXml();
    PutBucketEncryptionCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true },
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getFlexibleChecksumsPlugin(config, {
          requestAlgorithmMember: { httpHeader: "x-amz-sdk-checksum-algorithm", name: "ChecksumAlgorithm" },
          requestChecksumRequired: true
        })
      ];
    }).s("AmazonS3", "PutBucketEncryption", {}).n("S3Client", "PutBucketEncryptionCommand").f(PutBucketEncryptionRequestFilterSensitiveLog, void 0).ser(se_PutBucketEncryptionCommand).de(de_PutBucketEncryptionCommand).build() {
      static {
        __name(this, "PutBucketEncryptionCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketIntelligentTieringConfigurationCommand.js
var PutBucketIntelligentTieringConfigurationCommand;
var init_PutBucketIntelligentTieringConfigurationCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketIntelligentTieringConfigurationCommand.js"() {
    init_import_meta_url();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    PutBucketIntelligentTieringConfigurationCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true },
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions())
      ];
    }).s("AmazonS3", "PutBucketIntelligentTieringConfiguration", {}).n("S3Client", "PutBucketIntelligentTieringConfigurationCommand").f(void 0, void 0).ser(se_PutBucketIntelligentTieringConfigurationCommand).de(de_PutBucketIntelligentTieringConfigurationCommand).build() {
      static {
        __name(this, "PutBucketIntelligentTieringConfigurationCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketInventoryConfigurationCommand.js
var PutBucketInventoryConfigurationCommand;
var init_PutBucketInventoryConfigurationCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketInventoryConfigurationCommand.js"() {
    init_import_meta_url();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_models_1();
    init_Aws_restXml();
    PutBucketInventoryConfigurationCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true },
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions())
      ];
    }).s("AmazonS3", "PutBucketInventoryConfiguration", {}).n("S3Client", "PutBucketInventoryConfigurationCommand").f(PutBucketInventoryConfigurationRequestFilterSensitiveLog, void 0).ser(se_PutBucketInventoryConfigurationCommand).de(de_PutBucketInventoryConfigurationCommand).build() {
      static {
        __name(this, "PutBucketInventoryConfigurationCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketLifecycleConfigurationCommand.js
var PutBucketLifecycleConfigurationCommand;
var init_PutBucketLifecycleConfigurationCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketLifecycleConfigurationCommand.js"() {
    init_import_meta_url();
    init_dist_es25();
    init_dist_es31();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    PutBucketLifecycleConfigurationCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true },
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getFlexibleChecksumsPlugin(config, {
          requestAlgorithmMember: { httpHeader: "x-amz-sdk-checksum-algorithm", name: "ChecksumAlgorithm" },
          requestChecksumRequired: true
        }),
        getThrow200ExceptionsPlugin(config)
      ];
    }).s("AmazonS3", "PutBucketLifecycleConfiguration", {}).n("S3Client", "PutBucketLifecycleConfigurationCommand").f(void 0, void 0).ser(se_PutBucketLifecycleConfigurationCommand).de(de_PutBucketLifecycleConfigurationCommand).build() {
      static {
        __name(this, "PutBucketLifecycleConfigurationCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketLoggingCommand.js
var PutBucketLoggingCommand;
var init_PutBucketLoggingCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketLoggingCommand.js"() {
    init_import_meta_url();
    init_dist_es25();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    PutBucketLoggingCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true },
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getFlexibleChecksumsPlugin(config, {
          requestAlgorithmMember: { httpHeader: "x-amz-sdk-checksum-algorithm", name: "ChecksumAlgorithm" },
          requestChecksumRequired: true
        })
      ];
    }).s("AmazonS3", "PutBucketLogging", {}).n("S3Client", "PutBucketLoggingCommand").f(void 0, void 0).ser(se_PutBucketLoggingCommand).de(de_PutBucketLoggingCommand).build() {
      static {
        __name(this, "PutBucketLoggingCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketMetricsConfigurationCommand.js
var PutBucketMetricsConfigurationCommand;
var init_PutBucketMetricsConfigurationCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketMetricsConfigurationCommand.js"() {
    init_import_meta_url();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    PutBucketMetricsConfigurationCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true },
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions())
      ];
    }).s("AmazonS3", "PutBucketMetricsConfiguration", {}).n("S3Client", "PutBucketMetricsConfigurationCommand").f(void 0, void 0).ser(se_PutBucketMetricsConfigurationCommand).de(de_PutBucketMetricsConfigurationCommand).build() {
      static {
        __name(this, "PutBucketMetricsConfigurationCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketNotificationConfigurationCommand.js
var PutBucketNotificationConfigurationCommand;
var init_PutBucketNotificationConfigurationCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketNotificationConfigurationCommand.js"() {
    init_import_meta_url();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    PutBucketNotificationConfigurationCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true },
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions())
      ];
    }).s("AmazonS3", "PutBucketNotificationConfiguration", {}).n("S3Client", "PutBucketNotificationConfigurationCommand").f(void 0, void 0).ser(se_PutBucketNotificationConfigurationCommand).de(de_PutBucketNotificationConfigurationCommand).build() {
      static {
        __name(this, "PutBucketNotificationConfigurationCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketOwnershipControlsCommand.js
var PutBucketOwnershipControlsCommand;
var init_PutBucketOwnershipControlsCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketOwnershipControlsCommand.js"() {
    init_import_meta_url();
    init_dist_es25();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    PutBucketOwnershipControlsCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true },
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getFlexibleChecksumsPlugin(config, {
          requestChecksumRequired: true
        })
      ];
    }).s("AmazonS3", "PutBucketOwnershipControls", {}).n("S3Client", "PutBucketOwnershipControlsCommand").f(void 0, void 0).ser(se_PutBucketOwnershipControlsCommand).de(de_PutBucketOwnershipControlsCommand).build() {
      static {
        __name(this, "PutBucketOwnershipControlsCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketPolicyCommand.js
var PutBucketPolicyCommand;
var init_PutBucketPolicyCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketPolicyCommand.js"() {
    init_import_meta_url();
    init_dist_es25();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    PutBucketPolicyCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true },
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getFlexibleChecksumsPlugin(config, {
          requestAlgorithmMember: { httpHeader: "x-amz-sdk-checksum-algorithm", name: "ChecksumAlgorithm" },
          requestChecksumRequired: true
        })
      ];
    }).s("AmazonS3", "PutBucketPolicy", {}).n("S3Client", "PutBucketPolicyCommand").f(void 0, void 0).ser(se_PutBucketPolicyCommand).de(de_PutBucketPolicyCommand).build() {
      static {
        __name(this, "PutBucketPolicyCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketReplicationCommand.js
var PutBucketReplicationCommand;
var init_PutBucketReplicationCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketReplicationCommand.js"() {
    init_import_meta_url();
    init_dist_es25();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    PutBucketReplicationCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true },
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getFlexibleChecksumsPlugin(config, {
          requestAlgorithmMember: { httpHeader: "x-amz-sdk-checksum-algorithm", name: "ChecksumAlgorithm" },
          requestChecksumRequired: true
        })
      ];
    }).s("AmazonS3", "PutBucketReplication", {}).n("S3Client", "PutBucketReplicationCommand").f(void 0, void 0).ser(se_PutBucketReplicationCommand).de(de_PutBucketReplicationCommand).build() {
      static {
        __name(this, "PutBucketReplicationCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketRequestPaymentCommand.js
var PutBucketRequestPaymentCommand;
var init_PutBucketRequestPaymentCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketRequestPaymentCommand.js"() {
    init_import_meta_url();
    init_dist_es25();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    PutBucketRequestPaymentCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true },
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getFlexibleChecksumsPlugin(config, {
          requestAlgorithmMember: { httpHeader: "x-amz-sdk-checksum-algorithm", name: "ChecksumAlgorithm" },
          requestChecksumRequired: true
        })
      ];
    }).s("AmazonS3", "PutBucketRequestPayment", {}).n("S3Client", "PutBucketRequestPaymentCommand").f(void 0, void 0).ser(se_PutBucketRequestPaymentCommand).de(de_PutBucketRequestPaymentCommand).build() {
      static {
        __name(this, "PutBucketRequestPaymentCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketTaggingCommand.js
var PutBucketTaggingCommand;
var init_PutBucketTaggingCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketTaggingCommand.js"() {
    init_import_meta_url();
    init_dist_es25();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    PutBucketTaggingCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true },
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getFlexibleChecksumsPlugin(config, {
          requestAlgorithmMember: { httpHeader: "x-amz-sdk-checksum-algorithm", name: "ChecksumAlgorithm" },
          requestChecksumRequired: true
        })
      ];
    }).s("AmazonS3", "PutBucketTagging", {}).n("S3Client", "PutBucketTaggingCommand").f(void 0, void 0).ser(se_PutBucketTaggingCommand).de(de_PutBucketTaggingCommand).build() {
      static {
        __name(this, "PutBucketTaggingCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketVersioningCommand.js
var PutBucketVersioningCommand;
var init_PutBucketVersioningCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketVersioningCommand.js"() {
    init_import_meta_url();
    init_dist_es25();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    PutBucketVersioningCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true },
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getFlexibleChecksumsPlugin(config, {
          requestAlgorithmMember: { httpHeader: "x-amz-sdk-checksum-algorithm", name: "ChecksumAlgorithm" },
          requestChecksumRequired: true
        })
      ];
    }).s("AmazonS3", "PutBucketVersioning", {}).n("S3Client", "PutBucketVersioningCommand").f(void 0, void 0).ser(se_PutBucketVersioningCommand).de(de_PutBucketVersioningCommand).build() {
      static {
        __name(this, "PutBucketVersioningCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketWebsiteCommand.js
var PutBucketWebsiteCommand;
var init_PutBucketWebsiteCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketWebsiteCommand.js"() {
    init_import_meta_url();
    init_dist_es25();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    PutBucketWebsiteCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true },
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getFlexibleChecksumsPlugin(config, {
          requestAlgorithmMember: { httpHeader: "x-amz-sdk-checksum-algorithm", name: "ChecksumAlgorithm" },
          requestChecksumRequired: true
        })
      ];
    }).s("AmazonS3", "PutBucketWebsite", {}).n("S3Client", "PutBucketWebsiteCommand").f(void 0, void 0).ser(se_PutBucketWebsiteCommand).de(de_PutBucketWebsiteCommand).build() {
      static {
        __name(this, "PutBucketWebsiteCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/PutObjectAclCommand.js
var PutObjectAclCommand;
var init_PutObjectAclCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/PutObjectAclCommand.js"() {
    init_import_meta_url();
    init_dist_es25();
    init_dist_es31();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    PutObjectAclCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      Bucket: { type: "contextParams", name: "Bucket" },
      Key: { type: "contextParams", name: "Key" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getFlexibleChecksumsPlugin(config, {
          requestAlgorithmMember: { httpHeader: "x-amz-sdk-checksum-algorithm", name: "ChecksumAlgorithm" },
          requestChecksumRequired: true
        }),
        getThrow200ExceptionsPlugin(config)
      ];
    }).s("AmazonS3", "PutObjectAcl", {}).n("S3Client", "PutObjectAclCommand").f(void 0, void 0).ser(se_PutObjectAclCommand).de(de_PutObjectAclCommand).build() {
      static {
        __name(this, "PutObjectAclCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/PutObjectCommand.js
var PutObjectCommand;
var init_PutObjectCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/PutObjectCommand.js"() {
    init_import_meta_url();
    init_dist_es25();
    init_dist_es31();
    init_dist_es70();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_models_1();
    init_Aws_restXml();
    PutObjectCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      Bucket: { type: "contextParams", name: "Bucket" },
      Key: { type: "contextParams", name: "Key" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getFlexibleChecksumsPlugin(config, {
          requestAlgorithmMember: { httpHeader: "x-amz-sdk-checksum-algorithm", name: "ChecksumAlgorithm" },
          requestChecksumRequired: false
        }),
        getCheckContentLengthHeaderPlugin(config),
        getThrow200ExceptionsPlugin(config),
        getSsecPlugin(config)
      ];
    }).s("AmazonS3", "PutObject", {}).n("S3Client", "PutObjectCommand").f(PutObjectRequestFilterSensitiveLog, PutObjectOutputFilterSensitiveLog).ser(se_PutObjectCommand).de(de_PutObjectCommand).build() {
      static {
        __name(this, "PutObjectCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/PutObjectLegalHoldCommand.js
var PutObjectLegalHoldCommand;
var init_PutObjectLegalHoldCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/PutObjectLegalHoldCommand.js"() {
    init_import_meta_url();
    init_dist_es25();
    init_dist_es31();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    PutObjectLegalHoldCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getFlexibleChecksumsPlugin(config, {
          requestAlgorithmMember: { httpHeader: "x-amz-sdk-checksum-algorithm", name: "ChecksumAlgorithm" },
          requestChecksumRequired: true
        }),
        getThrow200ExceptionsPlugin(config)
      ];
    }).s("AmazonS3", "PutObjectLegalHold", {}).n("S3Client", "PutObjectLegalHoldCommand").f(void 0, void 0).ser(se_PutObjectLegalHoldCommand).de(de_PutObjectLegalHoldCommand).build() {
      static {
        __name(this, "PutObjectLegalHoldCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/PutObjectLockConfigurationCommand.js
var PutObjectLockConfigurationCommand;
var init_PutObjectLockConfigurationCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/PutObjectLockConfigurationCommand.js"() {
    init_import_meta_url();
    init_dist_es25();
    init_dist_es31();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    PutObjectLockConfigurationCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getFlexibleChecksumsPlugin(config, {
          requestAlgorithmMember: { httpHeader: "x-amz-sdk-checksum-algorithm", name: "ChecksumAlgorithm" },
          requestChecksumRequired: true
        }),
        getThrow200ExceptionsPlugin(config)
      ];
    }).s("AmazonS3", "PutObjectLockConfiguration", {}).n("S3Client", "PutObjectLockConfigurationCommand").f(void 0, void 0).ser(se_PutObjectLockConfigurationCommand).de(de_PutObjectLockConfigurationCommand).build() {
      static {
        __name(this, "PutObjectLockConfigurationCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/PutObjectRetentionCommand.js
var PutObjectRetentionCommand;
var init_PutObjectRetentionCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/PutObjectRetentionCommand.js"() {
    init_import_meta_url();
    init_dist_es25();
    init_dist_es31();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    PutObjectRetentionCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getFlexibleChecksumsPlugin(config, {
          requestAlgorithmMember: { httpHeader: "x-amz-sdk-checksum-algorithm", name: "ChecksumAlgorithm" },
          requestChecksumRequired: true
        }),
        getThrow200ExceptionsPlugin(config)
      ];
    }).s("AmazonS3", "PutObjectRetention", {}).n("S3Client", "PutObjectRetentionCommand").f(void 0, void 0).ser(se_PutObjectRetentionCommand).de(de_PutObjectRetentionCommand).build() {
      static {
        __name(this, "PutObjectRetentionCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/PutObjectTaggingCommand.js
var PutObjectTaggingCommand;
var init_PutObjectTaggingCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/PutObjectTaggingCommand.js"() {
    init_import_meta_url();
    init_dist_es25();
    init_dist_es31();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    PutObjectTaggingCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getFlexibleChecksumsPlugin(config, {
          requestAlgorithmMember: { httpHeader: "x-amz-sdk-checksum-algorithm", name: "ChecksumAlgorithm" },
          requestChecksumRequired: true
        }),
        getThrow200ExceptionsPlugin(config)
      ];
    }).s("AmazonS3", "PutObjectTagging", {}).n("S3Client", "PutObjectTaggingCommand").f(void 0, void 0).ser(se_PutObjectTaggingCommand).de(de_PutObjectTaggingCommand).build() {
      static {
        __name(this, "PutObjectTaggingCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/PutPublicAccessBlockCommand.js
var PutPublicAccessBlockCommand;
var init_PutPublicAccessBlockCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/PutPublicAccessBlockCommand.js"() {
    init_import_meta_url();
    init_dist_es25();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_Aws_restXml();
    PutPublicAccessBlockCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true },
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getFlexibleChecksumsPlugin(config, {
          requestAlgorithmMember: { httpHeader: "x-amz-sdk-checksum-algorithm", name: "ChecksumAlgorithm" },
          requestChecksumRequired: true
        })
      ];
    }).s("AmazonS3", "PutPublicAccessBlock", {}).n("S3Client", "PutPublicAccessBlockCommand").f(void 0, void 0).ser(se_PutPublicAccessBlockCommand).de(de_PutPublicAccessBlockCommand).build() {
      static {
        __name(this, "PutPublicAccessBlockCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/RestoreObjectCommand.js
var RestoreObjectCommand;
var init_RestoreObjectCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/RestoreObjectCommand.js"() {
    init_import_meta_url();
    init_dist_es25();
    init_dist_es31();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_models_1();
    init_Aws_restXml();
    RestoreObjectCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getFlexibleChecksumsPlugin(config, {
          requestAlgorithmMember: { httpHeader: "x-amz-sdk-checksum-algorithm", name: "ChecksumAlgorithm" },
          requestChecksumRequired: false
        }),
        getThrow200ExceptionsPlugin(config)
      ];
    }).s("AmazonS3", "RestoreObject", {}).n("S3Client", "RestoreObjectCommand").f(RestoreObjectRequestFilterSensitiveLog, void 0).ser(se_RestoreObjectCommand).de(de_RestoreObjectCommand).build() {
      static {
        __name(this, "RestoreObjectCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/SelectObjectContentCommand.js
var SelectObjectContentCommand;
var init_SelectObjectContentCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/SelectObjectContentCommand.js"() {
    init_import_meta_url();
    init_dist_es31();
    init_dist_es70();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_models_1();
    init_Aws_restXml();
    SelectObjectContentCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getThrow200ExceptionsPlugin(config),
        getSsecPlugin(config)
      ];
    }).s("AmazonS3", "SelectObjectContent", {
      eventStream: {
        output: true
      }
    }).n("S3Client", "SelectObjectContentCommand").f(SelectObjectContentRequestFilterSensitiveLog, SelectObjectContentOutputFilterSensitiveLog).ser(se_SelectObjectContentCommand).de(de_SelectObjectContentCommand).build() {
      static {
        __name(this, "SelectObjectContentCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/UploadPartCommand.js
var UploadPartCommand;
var init_UploadPartCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/UploadPartCommand.js"() {
    init_import_meta_url();
    init_dist_es25();
    init_dist_es31();
    init_dist_es70();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_models_1();
    init_Aws_restXml();
    UploadPartCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      Bucket: { type: "contextParams", name: "Bucket" },
      Key: { type: "contextParams", name: "Key" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getFlexibleChecksumsPlugin(config, {
          requestAlgorithmMember: { httpHeader: "x-amz-sdk-checksum-algorithm", name: "ChecksumAlgorithm" },
          requestChecksumRequired: false
        }),
        getThrow200ExceptionsPlugin(config),
        getSsecPlugin(config)
      ];
    }).s("AmazonS3", "UploadPart", {}).n("S3Client", "UploadPartCommand").f(UploadPartRequestFilterSensitiveLog, UploadPartOutputFilterSensitiveLog).ser(se_UploadPartCommand).de(de_UploadPartCommand).build() {
      static {
        __name(this, "UploadPartCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/UploadPartCopyCommand.js
var UploadPartCopyCommand;
var init_UploadPartCopyCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/UploadPartCopyCommand.js"() {
    init_import_meta_url();
    init_dist_es31();
    init_dist_es70();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_models_1();
    init_Aws_restXml();
    UploadPartCopyCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      DisableS3ExpressSessionAuth: { type: "staticContextParams", value: true },
      Bucket: { type: "contextParams", name: "Bucket" }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions()),
        getThrow200ExceptionsPlugin(config),
        getSsecPlugin(config)
      ];
    }).s("AmazonS3", "UploadPartCopy", {}).n("S3Client", "UploadPartCopyCommand").f(UploadPartCopyRequestFilterSensitiveLog, UploadPartCopyOutputFilterSensitiveLog).ser(se_UploadPartCopyCommand).de(de_UploadPartCopyCommand).build() {
      static {
        __name(this, "UploadPartCopyCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/WriteGetObjectResponseCommand.js
var WriteGetObjectResponseCommand;
var init_WriteGetObjectResponseCommand = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/WriteGetObjectResponseCommand.js"() {
    init_import_meta_url();
    init_dist_es42();
    init_dist_es5();
    init_dist_es20();
    init_EndpointParameters();
    init_models_1();
    init_Aws_restXml();
    WriteGetObjectResponseCommand = class extends Command.classBuilder().ep({
      ...commonParams,
      UseObjectLambdaEndpoint: { type: "staticContextParams", value: true }
    }).m(function(Command2, cs2, config, o7) {
      return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command2.getEndpointParameterInstructions())
      ];
    }).s("AmazonS3", "WriteGetObjectResponse", {}).n("S3Client", "WriteGetObjectResponseCommand").f(WriteGetObjectResponseRequestFilterSensitiveLog, void 0).ser(se_WriteGetObjectResponseCommand).de(de_WriteGetObjectResponseCommand).build() {
      static {
        __name(this, "WriteGetObjectResponseCommand");
      }
    };
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/S3.js
var commands4, S32;
var init_S3 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/S3.js"() {
    init_import_meta_url();
    init_dist_es20();
    init_AbortMultipartUploadCommand();
    init_CompleteMultipartUploadCommand();
    init_CopyObjectCommand();
    init_CreateBucketCommand();
    init_CreateBucketMetadataTableConfigurationCommand();
    init_CreateMultipartUploadCommand();
    init_CreateSessionCommand();
    init_DeleteBucketAnalyticsConfigurationCommand();
    init_DeleteBucketCommand();
    init_DeleteBucketCorsCommand();
    init_DeleteBucketEncryptionCommand();
    init_DeleteBucketIntelligentTieringConfigurationCommand();
    init_DeleteBucketInventoryConfigurationCommand();
    init_DeleteBucketLifecycleCommand();
    init_DeleteBucketMetadataTableConfigurationCommand();
    init_DeleteBucketMetricsConfigurationCommand();
    init_DeleteBucketOwnershipControlsCommand();
    init_DeleteBucketPolicyCommand();
    init_DeleteBucketReplicationCommand();
    init_DeleteBucketTaggingCommand();
    init_DeleteBucketWebsiteCommand();
    init_DeleteObjectCommand();
    init_DeleteObjectsCommand();
    init_DeleteObjectTaggingCommand();
    init_DeletePublicAccessBlockCommand();
    init_GetBucketAccelerateConfigurationCommand();
    init_GetBucketAclCommand();
    init_GetBucketAnalyticsConfigurationCommand();
    init_GetBucketCorsCommand();
    init_GetBucketEncryptionCommand();
    init_GetBucketIntelligentTieringConfigurationCommand();
    init_GetBucketInventoryConfigurationCommand();
    init_GetBucketLifecycleConfigurationCommand();
    init_GetBucketLocationCommand();
    init_GetBucketLoggingCommand();
    init_GetBucketMetadataTableConfigurationCommand();
    init_GetBucketMetricsConfigurationCommand();
    init_GetBucketNotificationConfigurationCommand();
    init_GetBucketOwnershipControlsCommand();
    init_GetBucketPolicyCommand();
    init_GetBucketPolicyStatusCommand();
    init_GetBucketReplicationCommand();
    init_GetBucketRequestPaymentCommand();
    init_GetBucketTaggingCommand();
    init_GetBucketVersioningCommand();
    init_GetBucketWebsiteCommand();
    init_GetObjectAclCommand();
    init_GetObjectAttributesCommand();
    init_GetObjectCommand();
    init_GetObjectLegalHoldCommand();
    init_GetObjectLockConfigurationCommand();
    init_GetObjectRetentionCommand();
    init_GetObjectTaggingCommand();
    init_GetObjectTorrentCommand();
    init_GetPublicAccessBlockCommand();
    init_HeadBucketCommand();
    init_HeadObjectCommand();
    init_ListBucketAnalyticsConfigurationsCommand();
    init_ListBucketIntelligentTieringConfigurationsCommand();
    init_ListBucketInventoryConfigurationsCommand();
    init_ListBucketMetricsConfigurationsCommand();
    init_ListBucketsCommand();
    init_ListDirectoryBucketsCommand();
    init_ListMultipartUploadsCommand();
    init_ListObjectsCommand();
    init_ListObjectsV2Command();
    init_ListObjectVersionsCommand();
    init_ListPartsCommand();
    init_PutBucketAccelerateConfigurationCommand();
    init_PutBucketAclCommand();
    init_PutBucketAnalyticsConfigurationCommand();
    init_PutBucketCorsCommand();
    init_PutBucketEncryptionCommand();
    init_PutBucketIntelligentTieringConfigurationCommand();
    init_PutBucketInventoryConfigurationCommand();
    init_PutBucketLifecycleConfigurationCommand();
    init_PutBucketLoggingCommand();
    init_PutBucketMetricsConfigurationCommand();
    init_PutBucketNotificationConfigurationCommand();
    init_PutBucketOwnershipControlsCommand();
    init_PutBucketPolicyCommand();
    init_PutBucketReplicationCommand();
    init_PutBucketRequestPaymentCommand();
    init_PutBucketTaggingCommand();
    init_PutBucketVersioningCommand();
    init_PutBucketWebsiteCommand();
    init_PutObjectAclCommand();
    init_PutObjectCommand();
    init_PutObjectLegalHoldCommand();
    init_PutObjectLockConfigurationCommand();
    init_PutObjectRetentionCommand();
    init_PutObjectTaggingCommand();
    init_PutPublicAccessBlockCommand();
    init_RestoreObjectCommand();
    init_SelectObjectContentCommand();
    init_UploadPartCommand();
    init_UploadPartCopyCommand();
    init_WriteGetObjectResponseCommand();
    init_S3Client();
    commands4 = {
      AbortMultipartUploadCommand,
      CompleteMultipartUploadCommand,
      CopyObjectCommand,
      CreateBucketCommand,
      CreateBucketMetadataTableConfigurationCommand,
      CreateMultipartUploadCommand,
      CreateSessionCommand,
      DeleteBucketCommand,
      DeleteBucketAnalyticsConfigurationCommand,
      DeleteBucketCorsCommand,
      DeleteBucketEncryptionCommand,
      DeleteBucketIntelligentTieringConfigurationCommand,
      DeleteBucketInventoryConfigurationCommand,
      DeleteBucketLifecycleCommand,
      DeleteBucketMetadataTableConfigurationCommand,
      DeleteBucketMetricsConfigurationCommand,
      DeleteBucketOwnershipControlsCommand,
      DeleteBucketPolicyCommand,
      DeleteBucketReplicationCommand,
      DeleteBucketTaggingCommand,
      DeleteBucketWebsiteCommand,
      DeleteObjectCommand,
      DeleteObjectsCommand,
      DeleteObjectTaggingCommand,
      DeletePublicAccessBlockCommand,
      GetBucketAccelerateConfigurationCommand,
      GetBucketAclCommand,
      GetBucketAnalyticsConfigurationCommand,
      GetBucketCorsCommand,
      GetBucketEncryptionCommand,
      GetBucketIntelligentTieringConfigurationCommand,
      GetBucketInventoryConfigurationCommand,
      GetBucketLifecycleConfigurationCommand,
      GetBucketLocationCommand,
      GetBucketLoggingCommand,
      GetBucketMetadataTableConfigurationCommand,
      GetBucketMetricsConfigurationCommand,
      GetBucketNotificationConfigurationCommand,
      GetBucketOwnershipControlsCommand,
      GetBucketPolicyCommand,
      GetBucketPolicyStatusCommand,
      GetBucketReplicationCommand,
      GetBucketRequestPaymentCommand,
      GetBucketTaggingCommand,
      GetBucketVersioningCommand,
      GetBucketWebsiteCommand,
      GetObjectCommand,
      GetObjectAclCommand,
      GetObjectAttributesCommand,
      GetObjectLegalHoldCommand,
      GetObjectLockConfigurationCommand,
      GetObjectRetentionCommand,
      GetObjectTaggingCommand,
      GetObjectTorrentCommand,
      GetPublicAccessBlockCommand,
      HeadBucketCommand,
      HeadObjectCommand,
      ListBucketAnalyticsConfigurationsCommand,
      ListBucketIntelligentTieringConfigurationsCommand,
      ListBucketInventoryConfigurationsCommand,
      ListBucketMetricsConfigurationsCommand,
      ListBucketsCommand,
      ListDirectoryBucketsCommand,
      ListMultipartUploadsCommand,
      ListObjectsCommand,
      ListObjectsV2Command,
      ListObjectVersionsCommand,
      ListPartsCommand,
      PutBucketAccelerateConfigurationCommand,
      PutBucketAclCommand,
      PutBucketAnalyticsConfigurationCommand,
      PutBucketCorsCommand,
      PutBucketEncryptionCommand,
      PutBucketIntelligentTieringConfigurationCommand,
      PutBucketInventoryConfigurationCommand,
      PutBucketLifecycleConfigurationCommand,
      PutBucketLoggingCommand,
      PutBucketMetricsConfigurationCommand,
      PutBucketNotificationConfigurationCommand,
      PutBucketOwnershipControlsCommand,
      PutBucketPolicyCommand,
      PutBucketReplicationCommand,
      PutBucketRequestPaymentCommand,
      PutBucketTaggingCommand,
      PutBucketVersioningCommand,
      PutBucketWebsiteCommand,
      PutObjectCommand,
      PutObjectAclCommand,
      PutObjectLegalHoldCommand,
      PutObjectLockConfigurationCommand,
      PutObjectRetentionCommand,
      PutObjectTaggingCommand,
      PutPublicAccessBlockCommand,
      RestoreObjectCommand,
      SelectObjectContentCommand,
      UploadPartCommand,
      UploadPartCopyCommand,
      WriteGetObjectResponseCommand
    };
    S32 = class extends S3Client {
      static {
        __name(this, "S3");
      }
    };
    createAggregatedClient(commands4, S32);
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/index.js
var init_commands8 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/commands/index.js"() {
    init_import_meta_url();
    init_AbortMultipartUploadCommand();
    init_CompleteMultipartUploadCommand();
    init_CopyObjectCommand();
    init_CreateBucketCommand();
    init_CreateBucketMetadataTableConfigurationCommand();
    init_CreateMultipartUploadCommand();
    init_CreateSessionCommand();
    init_DeleteBucketAnalyticsConfigurationCommand();
    init_DeleteBucketCommand();
    init_DeleteBucketCorsCommand();
    init_DeleteBucketEncryptionCommand();
    init_DeleteBucketIntelligentTieringConfigurationCommand();
    init_DeleteBucketInventoryConfigurationCommand();
    init_DeleteBucketLifecycleCommand();
    init_DeleteBucketMetadataTableConfigurationCommand();
    init_DeleteBucketMetricsConfigurationCommand();
    init_DeleteBucketOwnershipControlsCommand();
    init_DeleteBucketPolicyCommand();
    init_DeleteBucketReplicationCommand();
    init_DeleteBucketTaggingCommand();
    init_DeleteBucketWebsiteCommand();
    init_DeleteObjectCommand();
    init_DeleteObjectTaggingCommand();
    init_DeleteObjectsCommand();
    init_DeletePublicAccessBlockCommand();
    init_GetBucketAccelerateConfigurationCommand();
    init_GetBucketAclCommand();
    init_GetBucketAnalyticsConfigurationCommand();
    init_GetBucketCorsCommand();
    init_GetBucketEncryptionCommand();
    init_GetBucketIntelligentTieringConfigurationCommand();
    init_GetBucketInventoryConfigurationCommand();
    init_GetBucketLifecycleConfigurationCommand();
    init_GetBucketLocationCommand();
    init_GetBucketLoggingCommand();
    init_GetBucketMetadataTableConfigurationCommand();
    init_GetBucketMetricsConfigurationCommand();
    init_GetBucketNotificationConfigurationCommand();
    init_GetBucketOwnershipControlsCommand();
    init_GetBucketPolicyCommand();
    init_GetBucketPolicyStatusCommand();
    init_GetBucketReplicationCommand();
    init_GetBucketRequestPaymentCommand();
    init_GetBucketTaggingCommand();
    init_GetBucketVersioningCommand();
    init_GetBucketWebsiteCommand();
    init_GetObjectAclCommand();
    init_GetObjectAttributesCommand();
    init_GetObjectCommand();
    init_GetObjectLegalHoldCommand();
    init_GetObjectLockConfigurationCommand();
    init_GetObjectRetentionCommand();
    init_GetObjectTaggingCommand();
    init_GetObjectTorrentCommand();
    init_GetPublicAccessBlockCommand();
    init_HeadBucketCommand();
    init_HeadObjectCommand();
    init_ListBucketAnalyticsConfigurationsCommand();
    init_ListBucketIntelligentTieringConfigurationsCommand();
    init_ListBucketInventoryConfigurationsCommand();
    init_ListBucketMetricsConfigurationsCommand();
    init_ListBucketsCommand();
    init_ListDirectoryBucketsCommand();
    init_ListMultipartUploadsCommand();
    init_ListObjectVersionsCommand();
    init_ListObjectsCommand();
    init_ListObjectsV2Command();
    init_ListPartsCommand();
    init_PutBucketAccelerateConfigurationCommand();
    init_PutBucketAclCommand();
    init_PutBucketAnalyticsConfigurationCommand();
    init_PutBucketCorsCommand();
    init_PutBucketEncryptionCommand();
    init_PutBucketIntelligentTieringConfigurationCommand();
    init_PutBucketInventoryConfigurationCommand();
    init_PutBucketLifecycleConfigurationCommand();
    init_PutBucketLoggingCommand();
    init_PutBucketMetricsConfigurationCommand();
    init_PutBucketNotificationConfigurationCommand();
    init_PutBucketOwnershipControlsCommand();
    init_PutBucketPolicyCommand();
    init_PutBucketReplicationCommand();
    init_PutBucketRequestPaymentCommand();
    init_PutBucketTaggingCommand();
    init_PutBucketVersioningCommand();
    init_PutBucketWebsiteCommand();
    init_PutObjectAclCommand();
    init_PutObjectCommand();
    init_PutObjectLegalHoldCommand();
    init_PutObjectLockConfigurationCommand();
    init_PutObjectRetentionCommand();
    init_PutObjectTaggingCommand();
    init_PutPublicAccessBlockCommand();
    init_RestoreObjectCommand();
    init_SelectObjectContentCommand();
    init_UploadPartCommand();
    init_UploadPartCopyCommand();
    init_WriteGetObjectResponseCommand();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/pagination/Interfaces.js
var init_Interfaces2 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/pagination/Interfaces.js"() {
    init_import_meta_url();
  }
});
var init_ListBucketsPaginator = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/pagination/ListBucketsPaginator.js"() {
    init_import_meta_url();
    init_dist_es16();
    init_ListBucketsCommand();
    init_S3Client();
  }
});
var init_ListDirectoryBucketsPaginator = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/pagination/ListDirectoryBucketsPaginator.js"() {
    init_import_meta_url();
    init_dist_es16();
    init_ListDirectoryBucketsCommand();
    init_S3Client();
  }
});
var init_ListObjectsV2Paginator = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/pagination/ListObjectsV2Paginator.js"() {
    init_import_meta_url();
    init_dist_es16();
    init_ListObjectsV2Command();
    init_S3Client();
  }
});
var init_ListPartsPaginator = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/pagination/ListPartsPaginator.js"() {
    init_import_meta_url();
    init_dist_es16();
    init_ListPartsCommand();
    init_S3Client();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/pagination/index.js
var init_pagination4 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/pagination/index.js"() {
    init_import_meta_url();
    init_Interfaces2();
    init_ListBucketsPaginator();
    init_ListDirectoryBucketsPaginator();
    init_ListObjectsV2Paginator();
    init_ListPartsPaginator();
  }
});

// ../../node_modules/.pnpm/@smithy+util-waiter@3.2.0/node_modules/@smithy/util-waiter/dist-es/utils/sleep.js
var init_sleep = __esm({
  "../../node_modules/.pnpm/@smithy+util-waiter@3.2.0/node_modules/@smithy/util-waiter/dist-es/utils/sleep.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+util-waiter@3.2.0/node_modules/@smithy/util-waiter/dist-es/waiter.js
var WaiterState;
var init_waiter2 = __esm({
  "../../node_modules/.pnpm/@smithy+util-waiter@3.2.0/node_modules/@smithy/util-waiter/dist-es/waiter.js"() {
    init_import_meta_url();
    (function(WaiterState2) {
      WaiterState2["ABORTED"] = "ABORTED";
      WaiterState2["FAILURE"] = "FAILURE";
      WaiterState2["SUCCESS"] = "SUCCESS";
      WaiterState2["RETRY"] = "RETRY";
      WaiterState2["TIMEOUT"] = "TIMEOUT";
    })(WaiterState || (WaiterState = {}));
  }
});

// ../../node_modules/.pnpm/@smithy+util-waiter@3.2.0/node_modules/@smithy/util-waiter/dist-es/poller.js
var init_poller = __esm({
  "../../node_modules/.pnpm/@smithy+util-waiter@3.2.0/node_modules/@smithy/util-waiter/dist-es/poller.js"() {
    init_import_meta_url();
    init_sleep();
    init_waiter2();
  }
});

// ../../node_modules/.pnpm/@smithy+util-waiter@3.2.0/node_modules/@smithy/util-waiter/dist-es/utils/validate.js
var init_validate4 = __esm({
  "../../node_modules/.pnpm/@smithy+util-waiter@3.2.0/node_modules/@smithy/util-waiter/dist-es/utils/validate.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/@smithy+util-waiter@3.2.0/node_modules/@smithy/util-waiter/dist-es/utils/index.js
var init_utils16 = __esm({
  "../../node_modules/.pnpm/@smithy+util-waiter@3.2.0/node_modules/@smithy/util-waiter/dist-es/utils/index.js"() {
    init_import_meta_url();
    init_sleep();
    init_validate4();
  }
});

// ../../node_modules/.pnpm/@smithy+util-waiter@3.2.0/node_modules/@smithy/util-waiter/dist-es/createWaiter.js
var init_createWaiter = __esm({
  "../../node_modules/.pnpm/@smithy+util-waiter@3.2.0/node_modules/@smithy/util-waiter/dist-es/createWaiter.js"() {
    init_import_meta_url();
    init_poller();
    init_utils16();
    init_waiter2();
  }
});

// ../../node_modules/.pnpm/@smithy+util-waiter@3.2.0/node_modules/@smithy/util-waiter/dist-es/index.js
var init_dist_es72 = __esm({
  "../../node_modules/.pnpm/@smithy+util-waiter@3.2.0/node_modules/@smithy/util-waiter/dist-es/index.js"() {
    init_import_meta_url();
    init_createWaiter();
    init_waiter2();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/waiters/waitForBucketExists.js
var init_waitForBucketExists = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/waiters/waitForBucketExists.js"() {
    init_import_meta_url();
    init_dist_es72();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/waiters/waitForBucketNotExists.js
var init_waitForBucketNotExists = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/waiters/waitForBucketNotExists.js"() {
    init_import_meta_url();
    init_dist_es72();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/waiters/waitForObjectExists.js
var init_waitForObjectExists = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/waiters/waitForObjectExists.js"() {
    init_import_meta_url();
    init_dist_es72();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/waiters/waitForObjectNotExists.js
var init_waitForObjectNotExists = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/waiters/waitForObjectNotExists.js"() {
    init_import_meta_url();
    init_dist_es72();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/waiters/index.js
var init_waiters = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/waiters/index.js"() {
    init_import_meta_url();
    init_waitForBucketExists();
    init_waitForBucketNotExists();
    init_waitForObjectExists();
    init_waitForObjectNotExists();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/models/index.js
var init_models5 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/models/index.js"() {
    init_import_meta_url();
    init_models_0();
    init_models_1();
  }
});

// ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/index.js
var init_dist_es73 = __esm({
  "../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/index.js"() {
    init_import_meta_url();
    init_S3Client();
    init_S3();
    init_commands8();
    init_pagination4();
    init_waiters();
    init_models5();
  }
});
async function listPipelines(config, params) {
  const accountId = await requireAuth(config);
  const searchParams = new Url.URLSearchParams();
  if (params?.page) {
    searchParams.set("page", params.page.toString());
  }
  if (params?.per_page) {
    searchParams.set("per_page", params.per_page.toString());
  }
  const response = await fetchResult(
    config,
    `/accounts/${accountId}/pipelines/v1/pipelines`,
    {
      method: "GET"
    },
    searchParams
  );
  return response;
}
async function listStreams(config, params) {
  const accountId = await requireAuth(config);
  const searchParams = new Url.URLSearchParams();
  if (params?.page) {
    searchParams.set("page", params.page.toString());
  }
  if (params?.per_page) {
    searchParams.set("per_page", params.per_page.toString());
  }
  if (params?.pipeline_id) {
    searchParams.set("pipeline_id", params.pipeline_id);
  }
  const response = await fetchResult(
    config,
    `/accounts/${accountId}/pipelines/v1/streams`,
    {
      method: "GET"
    },
    searchParams
  );
  return response;
}
async function listSinks(config, params) {
  const accountId = await requireAuth(config);
  const searchParams = new Url.URLSearchParams();
  if (params?.page) {
    searchParams.set("page", params.page.toString());
  }
  if (params?.per_page) {
    searchParams.set("per_page", params.per_page.toString());
  }
  if (params?.pipeline_id) {
    searchParams.set("pipeline_id", params.pipeline_id);
  }
  const response = await fetchResult(
    config,
    `/accounts/${accountId}/pipelines/v1/sinks`,
    {
      method: "GET"
    },
    searchParams
  );
  return response;
}
async function createStream(config, streamConfig) {
  const accountId = await requireAuth(config);
  const response = await fetchResult(
    config,
    `/accounts/${accountId}/pipelines/v1/streams`,
    {
      method: "POST",
      headers: {
        "Content-Type": "application/json"
      },
      body: JSON.stringify(streamConfig)
    }
  );
  return response;
}
async function getStream2(config, streamId) {
  const accountId = await requireAuth(config);
  const response = await fetchResult(
    config,
    `/accounts/${accountId}/pipelines/v1/streams/${streamId}`,
    {
      method: "GET"
    }
  );
  return response;
}
async function deleteStream(config, streamId) {
  const accountId = await requireAuth(config);
  await fetchResult(
    config,
    `/accounts/${accountId}/pipelines/v1/streams/${streamId}`,
    {
      method: "DELETE"
    }
  );
}
async function getSink(config, sinkId) {
  const accountId = await requireAuth(config);
  const response = await fetchResult(
    config,
    `/accounts/${accountId}/pipelines/v1/sinks/${sinkId}`,
    {
      method: "GET"
    }
  );
  return response;
}
async function deleteSink(config, sinkId) {
  const accountId = await requireAuth(config);
  await fetchResult(
    config,
    `/accounts/${accountId}/pipelines/v1/sinks/${sinkId}`,
    {
      method: "DELETE"
    }
  );
}
async function createSink(config, sinkConfig) {
  const accountId = await requireAuth(config);
  const response = await fetchResult(
    config,
    `/accounts/${accountId}/pipelines/v1/sinks`,
    {
      method: "POST",
      headers: {
        "Content-Type": "application/json"
      },
      body: JSON.stringify(sinkConfig)
    }
  );
  return response;
}
async function getPipeline(config, pipelineId) {
  const accountId = await requireAuth(config);
  const response = await fetchResult(
    config,
    `/accounts/${accountId}/pipelines/v1/pipelines/${pipelineId}`,
    {
      method: "GET"
    }
  );
  return response;
}
async function deletePipeline(config, pipelineId) {
  const accountId = await requireAuth(config);
  await fetchResult(
    config,
    `/accounts/${accountId}/pipelines/v1/pipelines/${pipelineId}`,
    {
      method: "DELETE"
    }
  );
}
async function createPipeline(config, pipelineConfig) {
  const accountId = await requireAuth(config);
  const response = await fetchResult(
    config,
    `/accounts/${accountId}/pipelines/v1/pipelines`,
    {
      method: "POST",
      headers: {
        "Content-Type": "application/json"
      },
      body: JSON.stringify(pipelineConfig)
    }
  );
  return response;
}
async function validateSql(config, sqlRequest) {
  const accountId = await requireAuth(config);
  const response = await fetchResult(
    config,
    `/accounts/${accountId}/pipelines/v1/validate_sql`,
    {
      method: "POST",
      headers: {
        "Content-Type": "application/json"
      },
      body: JSON.stringify(sqlRequest)
    }
  );
  return response;
}
async function generateR2ServiceToken(accountId, bucketName, pipelineName) {
  const controller = new AbortController();
  const signal = controller.signal;
  const timeoutPromise = promises.setTimeout(12e4, "timeout", { signal });
  const serverPromise = new Promise((resolve32, reject) => {
    const server = http__namespace.default.createServer(async (request4, response) => {
      assert53__default.default(request4.url, "This request doesn't have a URL");
      if (request4.method !== "GET") {
        response.writeHead(405);
        response.end("Method not allowed.");
        return;
      }
      const { pathname, searchParams } = new URL(
        request4.url,
        `http://${request4.headers.host}`
      );
      if (pathname !== "/") {
        response.writeHead(404);
        response.end("Not found.");
        return;
      }
      const accessKeyId = searchParams.get("access-key-id");
      const secretAccessKey = searchParams.get("secret-access-key");
      if (!accessKeyId || !secretAccessKey) {
        reject(new UserError("Missing required URL parameters"));
        return;
      }
      resolve32({ accessKeyId, secretAccessKey });
      response.writeHead(307, {
        Location: "https://welcome.developers.workers.dev/wrangler-oauth-consent-granted"
      });
      response.end();
    });
    signal.addEventListener("abort", () => {
      server.close();
    });
    server.listen(8976, "localhost");
  });
  const env6 = getCloudflareApiEnvironmentFromEnv();
  const oauthDomain = env6 === "staging" ? "oauth.pipelines-staging.cloudflare.com" : "oauth.pipelines.cloudflare.com";
  const urlToOpen = `https://${oauthDomain}/oauth/login?accountId=${accountId}&bucketName=${bucketName}&pipelineName=${pipelineName}`;
  logger.log(`Opening a link in your default browser: ${urlToOpen}`);
  await openInBrowser(urlToOpen);
  const result = await Promise.race([timeoutPromise, serverPromise]);
  controller.abort();
  if (result === "timeout") {
    throw new UserError(
      "Timed out waiting for authorization code, please try again."
    );
  }
  return result;
}
async function getR2Bucket2(complianceConfig, accountId, name2) {
  return await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/r2/buckets/${name2}`
  );
}
var init_client10 = __esm({
  "src/pipelines/client.ts"() {
    init_import_meta_url();
    init_dist();
    init_cfetch();
    init_logger();
    init_open_in_browser();
    init_user3();
    __name(listPipelines, "listPipelines");
    __name(listStreams, "listStreams");
    __name(listSinks, "listSinks");
    __name(createStream, "createStream");
    __name(getStream2, "getStream");
    __name(deleteStream, "deleteStream");
    __name(getSink, "getSink");
    __name(deleteSink, "deleteSink");
    __name(createSink, "createSink");
    __name(getPipeline, "getPipeline");
    __name(deletePipeline, "deletePipeline");
    __name(createPipeline, "createPipeline");
    __name(validateSql, "validateSql");
    __name(generateR2ServiceToken, "generateR2ServiceToken");
    __name(getR2Bucket2, "getR2Bucket");
  }
});
async function verifyBucketAccess(r22, bucketName) {
  const MAX_ATTEMPTS2 = 10;
  const DELAY_MS = 1e3;
  const checkCredentials = /* @__PURE__ */ __name(async () => {
    logger.debug(`Checking if credentials are active`);
    await r22.send(new HeadBucketCommand({ Bucket: bucketName }));
  }, "checkCredentials");
  for (let attempt = 1; attempt <= MAX_ATTEMPTS2; attempt++) {
    try {
      logger.debug(`Attempt ${attempt} of ${MAX_ATTEMPTS2}`);
      await checkCredentials();
      return;
    } catch (error2) {
      logger.debug("HeadBucket request failed", error2);
      if (attempt === MAX_ATTEMPTS2) {
        throw error2;
      }
      await promises.setTimeout(DELAY_MS);
    }
  }
}
async function verifyR2Credentials(accountId, bucketName, accessKeyId, secretAccessKey) {
  if (__testSkipCredentialValidationFlag) {
    return;
  }
  const endpoint = getAccountR2Endpoint(accountId);
  const r22 = new S3Client({
    region: "auto",
    credentials: {
      accessKeyId,
      secretAccessKey
    },
    endpoint
  });
  await r22.send(new ListObjectsV2Command({ Bucket: bucketName, MaxKeys: 1 }));
}
async function authorizeR2Bucket(complianceConfig, pipelineName, accountId, bucketName, options = {}) {
  const { quiet = false } = options;
  try {
    await getR2Bucket2(complianceConfig, accountId, bucketName);
  } catch (err) {
    if (err instanceof APIError) {
      if (err.code == 10006) {
        throw new FatalError(`The R2 bucket [${bucketName}] doesn't exist`);
      }
    }
    throw err;
  }
  if (!quiet) {
    logger.log(`\u{1F300} Authorizing R2 bucket "${bucketName}"`);
  }
  const serviceToken = await generateR2ServiceToken(
    accountId,
    bucketName,
    pipelineName
  );
  if (__testSkipDelaysFlag) {
    return serviceToken;
  }
  const endpoint = getAccountR2Endpoint(accountId);
  logger.debug(`Using R2 Endpoint ${endpoint}`);
  const r22 = new S3Client({
    region: "auto",
    credentials: {
      accessKeyId: serviceToken.accessKeyId,
      secretAccessKey: serviceToken.secretAccessKey
    },
    endpoint
  });
  if (!quiet) {
    logger.log(`\u{1F300} Checking access to R2 bucket "${bucketName}"`);
  }
  await verifyBucketAccess(r22, bucketName);
  return serviceToken;
}
function getAccountR2Endpoint(accountId) {
  const env6 = getCloudflareApiEnvironmentFromEnv();
  if (env6 === "staging") {
    return `https://${accountId}.r2-staging.cloudflarestorage.com`;
  }
  return `https://${accountId}.r2.cloudflarestorage.com`;
}
var BYTES_PER_MB, __testSkipDelaysFlag, __testSkipCredentialValidationFlag, pipelinesNamespace;
var init_pipelines2 = __esm({
  "src/pipelines/index.ts"() {
    init_import_meta_url();
    init_dist_es73();
    init_dist();
    init_create_command();
    init_logger();
    init_client10();
    BYTES_PER_MB = 1e3 * 1e3;
    __testSkipDelaysFlag = false;
    __testSkipCredentialValidationFlag = false;
    __name(verifyBucketAccess, "verifyBucketAccess");
    __name(verifyR2Credentials, "verifyR2Credentials");
    __name(authorizeR2Bucket, "authorizeR2Bucket");
    __name(getAccountR2Endpoint, "getAccountR2Endpoint");
    pipelinesNamespace = createNamespace({
      metadata: {
        description: "\u{1F6B0} Manage Cloudflare Pipelines",
        owner: "Product: Pipelines",
        status: "open beta",
        category: "Storage & databases"
      }
    });
  }
});

// src/pipelines/cli/streams/utils.ts
function formatSchemaFieldsForTable(fields, indent = 0) {
  const result = [];
  const indentStr = "  ".repeat(indent);
  for (const field of fields) {
    let unitItems = "";
    if (field.unit) {
      unitItems = field.unit;
    }
    if (field.type === "list" && field.items) {
      unitItems = field.items.type;
    }
    const row = {
      "Field Name": `${indentStr}${field.name}`,
      Type: field.type,
      "Unit/Items": unitItems,
      Required: field.required ? "Yes" : "No"
    };
    result.push(row);
    if (field.type === "struct" && field.fields) {
      result.push(...formatSchemaFieldsForTable(field.fields, indent + 1));
    }
    if (field.type === "list" && field.items && field.items.type === "struct" && field.items.fields) {
      result.push(
        ...formatSchemaFieldsForTable(field.items.fields, indent + 1)
      );
    }
  }
  return result;
}
function displayStreamConfiguration(stream2, title = "Configuration", options = {}) {
  const { includeTimestamps = true } = options;
  if (title) {
    logger.log(`
${title}:`);
  }
  const general = {
    Name: stream2.name
  };
  if (includeTimestamps) {
    general["Created At"] = new Date(stream2.created_at).toLocaleString();
    general["Modified At"] = new Date(stream2.modified_at).toLocaleString();
  }
  const httpIngest = {
    Enabled: stream2.http.enabled ? "Yes" : "No"
  };
  if (stream2.http.enabled) {
    httpIngest.Authentication = stream2.http.authentication ? "Yes" : "No";
    httpIngest.Endpoint = stream2.endpoint;
    if (stream2.http.cors && stream2.http.cors.origins && stream2.http.cors.origins.length > 0) {
      httpIngest["CORS Origins"] = stream2.http.cors.origins.join(", ");
    } else {
      httpIngest["CORS Origins"] = "None";
    }
  }
  logger.log("General:");
  logger.log(formatLabelledValues(general, { indentationCount: 2 }));
  logger.log("\nHTTP Ingest:");
  logger.log(formatLabelledValues(httpIngest, { indentationCount: 2 }));
  if (stream2.schema && stream2.schema.fields.length > 0) {
    logger.log("\nInput Schema:");
    const schemaRows = formatSchemaFieldsForTable(stream2.schema.fields);
    logger.table(schemaRows);
  } else {
    logger.log("\nInput Schema: Unstructured JSON (single 'value' column)");
  }
}
function generateStreamBindingName(streamName) {
  const upperName = streamName.toUpperCase().replace(/[^A-Z0-9]/g, "_");
  return upperName.endsWith("_STREAM") ? upperName : upperName + "_STREAM";
}
function generateSampleValue(field) {
  switch (field.type) {
    case "bool":
      return true;
    case "int32":
      return 42;
    case "int64":
      return "9223372036854775807";
    // Large numbers as strings to avoid JS precision issues
    case "float32":
    case "float64":
      return 3.14;
    case "json":
      return { example: "json_value" };
    case "bytes":
      return "base64_encoded_bytes";
    case "string":
      return `sample_${field.name}`;
    case "timestamp":
      if (field.unit === "second") {
        return Math.floor(Date.now() / 1e3);
      } else if (field.unit === "millisecond") {
        return Date.now();
      } else if (field.unit === "microsecond") {
        return Date.now() * 1e3;
      } else if (field.unit === "nanosecond") {
        return Date.now() * 1e6;
      }
      return Date.now();
    // Default to milliseconds
    case "list":
      if (field.items) {
        return [
          generateSampleValue(field.items),
          generateSampleValue(field.items)
        ];
      }
      return [];
    case "struct":
      if (field.fields) {
        const structObj = {};
        field.fields.forEach((subField) => {
          structObj[subField.name] = generateSampleValue(subField);
        });
        return structObj;
      }
      return {};
    default:
      return null;
  }
}
function generateExampleData(stream2) {
  if (stream2.schema && stream2.schema.fields && stream2.schema.fields.length > 0) {
    const exampleObject = {};
    stream2.schema.fields.forEach((field) => {
      exampleObject[field.name] = generateSampleValue(field);
    });
    return JSON.stringify(exampleObject, null, 2);
  } else {
    return JSON.stringify(
      {
        user_id: "sample_user_id",
        event_name: "sample_event_name",
        timestamp: Date.now()
      },
      null,
      2
    );
  }
}
async function displayUsageExamples(stream2, config, args) {
  const bindingName = generateStreamBindingName(stream2.name);
  const exampleData = generateExampleData(stream2);
  const compactData = JSON.stringify(JSON.parse(exampleData));
  await createdResourceConfig(
    "pipelines",
    (customBindingName) => ({
      pipeline: stream2.id,
      binding: customBindingName ?? bindingName
    }),
    config.configPath,
    args.env,
    { updateConfig: false }
  );
  logger.log("\nThen send events:\n");
  logger.log(`  await env.${bindingName}.send([${compactData}]);
`);
  if (stream2.http.enabled) {
    logger.log("Or via HTTP:\n");
    const curlCommand2 = [
      `curl -X POST ${stream2.endpoint}`,
      stream2.http.authentication ? `-H "Authorization: Bearer YOUR_API_TOKEN"` : null,
      `-H "Content-Type: application/json"`,
      `-d '[${compactData}]'`
    ].filter(Boolean).join(" \\\n     ");
    logger.log(`  ${curlCommand2}
`);
    if (stream2.http.authentication) {
      logger.log(
        source_default.dim("  (Replace YOUR_API_TOKEN with your Cloudflare API token)")
      );
    }
  }
  logger.log(source_default.dim("Docs: https://developers.cloudflare.com/pipelines/\n"));
}
var init_utils17 = __esm({
  "src/pipelines/cli/streams/utils.ts"() {
    init_import_meta_url();
    init_source();
    init_logger();
    init_add_created_resource_config();
    init_render_labelled_values();
    __name(formatSchemaFieldsForTable, "formatSchemaFieldsForTable");
    __name(displayStreamConfiguration, "displayStreamConfiguration");
    __name(generateStreamBindingName, "generateStreamBindingName");
    __name(generateSampleValue, "generateSampleValue");
    __name(generateExampleData, "generateExampleData");
    __name(displayUsageExamples, "displayUsageExamples");
  }
});
var pipelinesCreateCommand;
var init_create9 = __esm({
  "src/pipelines/cli/create.ts"() {
    init_import_meta_url();
    init_dist();
    init_create_command();
    init_logger();
    init_user3();
    init_client10();
    init_utils17();
    pipelinesCreateCommand = createCommand({
      metadata: {
        description: "Create a new pipeline",
        owner: "Product: Pipelines",
        status: "open beta"
      },
      args: {
        pipeline: {
          describe: "The name of the pipeline to create",
          type: "string",
          demandOption: true
        },
        sql: {
          describe: "Inline SQL query for the pipeline",
          type: "string",
          conflicts: "sql-file"
        },
        "sql-file": {
          describe: "Path to file containing SQL query for the pipeline",
          type: "string",
          conflicts: "sql"
        }
      },
      positionalArgs: ["pipeline"],
      async handler(args, { config }) {
        await requireAuth(config);
        const pipelineName = args.pipeline;
        let sql;
        if (args.sql) {
          sql = args.sql;
        } else if (args.sqlFile) {
          try {
            sql = fs29.readFileSync(args.sqlFile, "utf-8").trim();
          } catch (error2) {
            throw new UserError(
              `Failed to read SQL file '${args.sqlFile}': ${error2 instanceof Error ? error2.message : String(error2)}`
            );
          }
        } else {
          throw new UserError("Either --sql or --sql-file must be provided");
        }
        if (!sql) {
          throw new UserError("SQL query cannot be empty");
        }
        logger.log("\u{1F300} Validating SQL...");
        try {
          const validationResult = await validateSql(config, { sql });
          if (validationResult.tables && Object.keys(validationResult.tables).length > 0) {
            const tableNames = Object.keys(validationResult.tables);
            logger.log(
              `\u2705 SQL validated successfully. References tables: ${tableNames.join(", ")}`
            );
          } else {
            logger.log("\u2705 SQL validated successfully.");
          }
        } catch (error2) {
          let errorMessage = "Unknown validation error";
          if (error2 && typeof error2 === "object") {
            const errorObj = error2;
            if (errorObj.notes && Array.isArray(errorObj.notes) && errorObj.notes[0]?.text) {
              errorMessage = errorObj.notes[0].text;
            } else if (error2 instanceof Error) {
              errorMessage = error2.message;
            }
          }
          throw new UserError(`SQL validation failed: ${errorMessage}`);
        }
        const pipelineConfig = {
          name: pipelineName,
          sql
        };
        logger.log(`\u{1F300} Creating pipeline '${pipelineName}'...`);
        let pipeline;
        try {
          pipeline = await createPipeline(config, pipelineConfig);
        } catch (error2) {
          if (error2 instanceof APIError && error2.code === 1e4) {
            throw new UserError(
              `Your account does not have access to the new Pipelines API. To use the legacy Pipelines API, please run:

npx wrangler@4.36.0 pipelines create ${pipelineName}

This will use an older version of Wrangler that supports the legacy API.`
            );
          }
          throw error2;
        }
        logger.log(
          `\u2728 Successfully created pipeline '${pipeline.name}' with id '${pipeline.id}'.`
        );
        try {
          const fullPipeline = await getPipeline(config, pipeline.id);
          const streamTable = fullPipeline.tables?.find(
            (table) => table.type === "stream"
          );
          if (streamTable) {
            const stream2 = await getStream2(config, streamTable.id);
            await displayUsageExamples(stream2, config, args);
          } else {
            logger.log(
              `
Run 'wrangler pipelines get ${pipeline.id}' to view full details.`
            );
          }
        } catch {
          logger.warn("Could not fetch pipeline details for usage examples.");
          logger.log(
            `
Run 'wrangler pipelines get ${pipeline.id}' to view full details.`
          );
        }
      }
    });
  }
});
async function getPipeline2(complianceConfig, accountId, name2) {
  return await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/pipelines/${name2}`,
    {
      method: "GET"
    }
  );
}
async function updatePipeline(complianceConfig, accountId, name2, pipelineConfig) {
  return await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/pipelines/${name2}`,
    {
      method: "PUT",
      headers: API_HEADERS,
      body: JSON.stringify(pipelineConfig)
    }
  );
}
async function listPipelines2(complianceConfig, accountId) {
  return await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/pipelines`,
    {
      method: "GET"
    }
  );
}
async function deletePipeline2(complianceConfig, accountId, name2) {
  return await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/pipelines/${name2}`,
    {
      method: "DELETE",
      headers: API_HEADERS
    }
  );
}
function formatPipelinePretty(pipeline) {
  let buffer = "";
  const formatTypeLabels = {
    json: "JSON"
  };
  buffer += `${formatLabelledValues({
    Id: pipeline.id,
    Name: pipeline.name
  })}
`;
  buffer += "Sources:\n";
  const httpSource = pipeline.source.find((s7) => s7.type === "http");
  if (httpSource) {
    const httpInfo = {
      Endpoint: pipeline.endpoint,
      Authentication: httpSource.authentication === true ? "on" : "off",
      ...httpSource?.cors?.origins && {
        "CORS Origins": httpSource.cors.origins.join(", ")
      },
      Format: formatTypeLabels[httpSource.format]
    };
    buffer += "  HTTP:\n";
    buffer += `${formatLabelledValues(httpInfo, { indentationCount: 4 })}
`;
  }
  const bindingSource = pipeline.source.find((s7) => s7.type === "binding");
  if (bindingSource) {
    const bindingInfo = {
      Format: formatTypeLabels[bindingSource.format]
    };
    buffer += "  Worker:\n";
    buffer += `${formatLabelledValues(bindingInfo, { indentationCount: 4 })}
`;
  }
  const destinationInfo = {
    Type: pipeline.destination.type.toUpperCase(),
    Bucket: pipeline.destination.path.bucket,
    Format: "newline-delimited JSON",
    // TODO: Make dynamic once we support more output formats
    ...pipeline.destination.path.prefix && {
      Prefix: pipeline.destination.path.prefix
    },
    ...pipeline.destination.compression.type && {
      Compression: pipeline.destination.compression.type.toUpperCase()
    }
  };
  buffer += "Destination:\n";
  buffer += `${formatLabelledValues(destinationInfo, { indentationCount: 2 })}
`;
  const batchHints = {
    ...pipeline.destination.batch.max_bytes && {
      "Max bytes": prettyBytes(pipeline.destination.batch.max_bytes)
    },
    ...pipeline.destination.batch.max_duration_s && {
      "Max duration": `${pipeline.destination.batch.max_duration_s?.toLocaleString()} seconds`
    },
    ...pipeline.destination.batch.max_rows && {
      "Max records": pipeline.destination.batch.max_rows?.toLocaleString()
    }
  };
  if (Object.keys(batchHints).length > 0) {
    buffer += "  Batch hints:\n";
    buffer += `${formatLabelledValues(batchHints, { indentationCount: 4 })}
`;
  }
  return buffer;
}
var API_HEADERS;
var init_legacy_client = __esm({
  "src/pipelines/legacy-client.ts"() {
    init_import_meta_url();
    init_pretty_bytes();
    init_cfetch();
    init_render_labelled_values();
    API_HEADERS = {
      "Content-Type": "application/json"
    };
    __name(getPipeline2, "getPipeline");
    __name(updatePipeline, "updatePipeline");
    __name(listPipelines2, "listPipelines");
    __name(deletePipeline2, "deletePipeline");
    __name(formatPipelinePretty, "formatPipelinePretty");
  }
});

// src/pipelines/validate.ts
function validateEntityName(label, name2) {
  if (!name2.match(/^[a-zA-Z0-9_]+$/)) {
    throw new CommandLineArgsError(
      `${label} name must contain only letters, numbers, and underscores`
    );
  }
}
function validateName2(label, name2) {
  if (!name2.match(/^[a-zA-Z0-9-]+$/)) {
    throw new UserError(`Must provide a valid ${label}`);
  }
}
function validateCorsOrigins(values) {
  if (!values || !values.length) {
    return values;
  }
  if (values.includes("none")) {
    if (values.length > 1) {
      throw new UserError(
        "When specifying 'none', only one value is permitted."
      );
    }
    return [];
  }
  if (values.includes("*")) {
    if (values.length > 1) {
      throw new UserError("When specifying '*', only one value is permitted.");
    }
    return values;
  }
  for (const value of values) {
    if (!value.match(/^https?:\/\/[^/]+$/i)) {
      throw new UserError(
        `Provided value ${value} is not a valid CORS origin.`
      );
    }
  }
  return values;
}
function validateInRange(name2, min, max) {
  return (val2) => {
    if (val2 < min || val2 > max) {
      throw new UserError(`${name2} must be between ${min} and ${max}`);
    }
    return val2;
  };
}
var init_validate5 = __esm({
  "src/pipelines/validate.ts"() {
    init_import_meta_url();
    init_dist();
    __name(validateEntityName, "validateEntityName");
    __name(validateName2, "validateName");
    __name(validateCorsOrigins, "validateCorsOrigins");
    __name(validateInRange, "validateInRange");
  }
});

// src/pipelines/cli/legacy-helpers.ts
async function getLegacyPipeline(config, accountId, name2, format11) {
  validateName2("pipeline name", name2);
  const pipeline = await getPipeline2(config, accountId, name2);
  switch (format11) {
    case "json":
      logger.log(JSON.stringify(pipeline, null, 2));
      break;
    case "pretty":
      logger.warn(
        "\u26A0\uFE0F  This is a legacy pipeline. Consider creating a new pipeline by running 'wrangler pipelines setup'."
      );
      logger.log(formatPipelinePretty(pipeline));
      break;
  }
}
async function tryGetLegacyPipeline(config, accountId, name2, format11) {
  try {
    await getLegacyPipeline(config, accountId, name2, format11);
    return true;
  } catch (error2) {
    if (error2 instanceof APIError && error2.code === 1e3) {
      return false;
    }
    throw error2;
  }
}
async function tryListLegacyPipelines(config, accountId) {
  try {
    const pipelines = await listPipelines2(config, accountId);
    return pipelines;
  } catch {
    return [];
  }
}
async function tryDeleteLegacyPipeline(config, accountId, name2, force = false) {
  try {
    await getPipeline2(config, accountId, name2);
    if (!force) {
      const confirmedDelete = await confirm(
        `Are you sure you want to delete the legacy pipeline '${name2}'?`
      );
      if (!confirmedDelete) {
        logger.log("Delete cancelled.");
        return true;
      }
    }
    await deletePipeline2(config, accountId, name2);
    logger.log(`\u2728 Successfully deleted legacy pipeline '${name2}'.`);
    return true;
  } catch (error2) {
    if (error2 instanceof APIError && (error2.code === 1e3 || error2.code === 2)) {
      return false;
    }
    throw error2;
  }
}
async function updateLegacyPipeline(config, accountId, args) {
  const name2 = args.pipeline;
  const pipelineConfig = await getPipeline2(config, accountId, name2);
  logger.warn(
    "\u26A0\uFE0F  Updating legacy pipeline. Consider recreating with 'wrangler pipelines setup'."
  );
  if (args.compression) {
    pipelineConfig.destination.compression.type = args.compression;
  }
  if (args.batchMaxMb) {
    pipelineConfig.destination.batch.max_bytes = args.batchMaxMb * BYTES_PER_MB;
  }
  if (args.batchMaxSeconds) {
    pipelineConfig.destination.batch.max_duration_s = args.batchMaxSeconds;
  }
  if (args.batchMaxRows) {
    pipelineConfig.destination.batch.max_rows = args.batchMaxRows;
  }
  const bucket = args.r2Bucket;
  const accessKeyId = args.r2AccessKeyId;
  const secretAccessKey = args.r2SecretAccessKey;
  if (bucket || accessKeyId || secretAccessKey) {
    const destination = pipelineConfig.destination;
    if (bucket) {
      pipelineConfig.destination.path.bucket = bucket;
    }
    destination.credentials = {
      endpoint: getAccountR2Endpoint(accountId),
      access_key_id: accessKeyId || "",
      secret_access_key: secretAccessKey || ""
    };
    if (!accessKeyId && !secretAccessKey) {
      const auth = await authorizeR2Bucket(
        config,
        name2,
        accountId,
        destination.path.bucket
      );
      destination.credentials.access_key_id = auth.accessKeyId;
      destination.credentials.secret_access_key = auth.secretAccessKey;
    }
    if (!destination.credentials.access_key_id) {
      throw new FatalError("Requires a r2 access key id");
    }
    if (!destination.credentials.secret_access_key) {
      throw new FatalError("Requires a r2 secret access key");
    }
  }
  if (args.source && args.source.length > 0) {
    const existingSources = pipelineConfig.source;
    pipelineConfig.source = [];
    const sourceHandlers = {
      http: /* @__PURE__ */ __name(() => {
        const existing = existingSources.find((s7) => s7.type === "http");
        return {
          ...existing,
          // Copy over existing properties for forwards compatibility
          type: "http",
          format: "json",
          ...args.requireHttpAuth && {
            authentication: args.requireHttpAuth
          }
          // Include only if defined
        };
      }, "http"),
      worker: /* @__PURE__ */ __name(() => {
        const existing = existingSources.find(
          (s7) => s7.type === "binding"
        );
        return {
          ...existing,
          // Copy over existing properties for forwards compatibility
          type: "binding",
          format: "json"
        };
      }, "worker")
    };
    for (const source of args.source) {
      const handler = sourceHandlers[source];
      if (handler) {
        pipelineConfig.source.push(handler());
      }
    }
  }
  if (pipelineConfig.source.length === 0) {
    throw new UserError(
      "No sources have been enabled. At least one source (HTTP or Worker Binding) should be enabled"
    );
  }
  pipelineConfig.transforms = [];
  if (args.r2Prefix) {
    pipelineConfig.destination.path.prefix = args.r2Prefix;
  }
  if (args.shardCount) {
    pipelineConfig.metadata.shards = args.shardCount;
  }
  const httpSource = pipelineConfig.source.find(
    (s7) => s7.type === "http"
  );
  if (httpSource) {
    if (args.requireHttpAuth) {
      httpSource.authentication = args.requireHttpAuth;
    }
    if (args.corsOrigins) {
      httpSource.cors = { origins: args.corsOrigins };
    }
  }
  logger.log(`\u{1F300} Updating pipeline "${name2}"`);
  const pipeline = await updatePipeline(
    config,
    accountId,
    name2,
    pipelineConfig
  );
  logger.log(
    `\u2728 Successfully updated pipeline "${pipeline.name}" with ID ${pipeline.id}
`
  );
}
var init_legacy_helpers = __esm({
  "src/pipelines/cli/legacy-helpers.ts"() {
    init_import_meta_url();
    init_dist();
    init_dialogs();
    init_logger();
    init_pipelines2();
    init_legacy_client();
    init_validate5();
    __name(getLegacyPipeline, "getLegacyPipeline");
    __name(tryGetLegacyPipeline, "tryGetLegacyPipeline");
    __name(tryListLegacyPipelines, "tryListLegacyPipelines");
    __name(tryDeleteLegacyPipeline, "tryDeleteLegacyPipeline");
    __name(updateLegacyPipeline, "updateLegacyPipeline");
  }
});

// src/pipelines/cli/delete.ts
var pipelinesDeleteCommand;
var init_delete8 = __esm({
  "src/pipelines/cli/delete.ts"() {
    init_import_meta_url();
    init_dist();
    init_create_command();
    init_dialogs();
    init_logger();
    init_user3();
    init_client10();
    init_legacy_helpers();
    pipelinesDeleteCommand = createCommand({
      metadata: {
        description: "Delete a pipeline",
        owner: "Product: Pipelines",
        status: "open beta"
      },
      args: {
        pipeline: {
          type: "string",
          describe: "The ID or name of the pipeline to delete",
          demandOption: true
        },
        force: {
          describe: "Skip confirmation",
          type: "boolean",
          alias: "y",
          default: false
        }
      },
      positionalArgs: ["pipeline"],
      async handler(args, { config }) {
        const accountId = await requireAuth(config);
        const pipelineId = args.pipeline;
        try {
          const pipeline = await getPipeline(config, pipelineId);
          if (!args.force) {
            const confirmedDelete = await confirm(
              `Are you sure you want to delete the pipeline '${pipeline.name}' (${pipelineId})?`,
              { fallbackValue: false }
            );
            if (!confirmedDelete) {
              logger.log("Delete cancelled.");
              return;
            }
          }
          await deletePipeline(config, pipelineId);
          logger.log(
            `\u2728 Successfully deleted pipeline '${pipeline.name}' with id '${pipeline.id}'.`
          );
        } catch (error2) {
          if (error2 instanceof APIError && (error2.code === 1e3 || error2.code === 2)) {
            const deletedFromLegacy = await tryDeleteLegacyPipeline(
              config,
              accountId,
              pipelineId,
              args.force
            );
            if (deletedFromLegacy) {
              return;
            }
          }
          throw error2;
        }
      }
    });
  }
});

// src/pipelines/cli/get.ts
var pipelinesGetCommand;
var init_get5 = __esm({
  "src/pipelines/cli/get.ts"() {
    init_import_meta_url();
    init_dist();
    init_create_command();
    init_logger();
    init_user3();
    init_render_labelled_values();
    init_client10();
    init_legacy_helpers();
    pipelinesGetCommand = createCommand({
      metadata: {
        description: "Get details about a specific pipeline",
        owner: "Product: Pipelines",
        status: "open beta"
      },
      behaviour: {
        printBanner: /* @__PURE__ */ __name((args) => !args.json, "printBanner")
      },
      args: {
        pipeline: {
          type: "string",
          describe: "The ID of the pipeline to retrieve",
          demandOption: true
        },
        json: {
          describe: "Output in JSON format",
          type: "boolean",
          default: false
        }
      },
      positionalArgs: ["pipeline"],
      async handler(args, { config }) {
        const accountId = await requireAuth(config);
        const pipelineId = args.pipeline;
        let pipeline;
        try {
          pipeline = await getPipeline(config, pipelineId);
        } catch (error2) {
          if (error2 instanceof APIError && (error2.code === 1e3 || error2.code === 2)) {
            const foundInLegacy = await tryGetLegacyPipeline(
              config,
              accountId,
              pipelineId,
              args.json ? "json" : "pretty"
            );
            if (foundInLegacy) {
              return;
            }
          }
          throw error2;
        }
        if (args.json) {
          logger.json(pipeline);
          return;
        }
        const general = {
          ID: pipeline.id,
          Name: pipeline.name,
          "Created At": new Date(pipeline.created_at).toLocaleString(),
          "Modified At": new Date(pipeline.modified_at).toLocaleString()
        };
        logger.log("General:");
        logger.log(formatLabelledValues(general, { indentationCount: 2 }));
        logger.log("\nPipeline SQL:");
        logger.log(pipeline.sql);
        if (pipeline.tables && pipeline.tables.length > 0) {
          const streams = pipeline.tables.filter(
            (table) => table.type === "stream"
          );
          const sinks = pipeline.tables.filter((table) => table.type === "sink");
          if (streams.length > 0) {
            logger.log("\nConnected Streams:");
            logger.table(
              streams.map((stream2) => ({
                Name: stream2.name,
                ID: stream2.id
              }))
            );
          }
          if (sinks.length > 0) {
            logger.log("\nConnected Sinks:");
            logger.table(
              sinks.map((sink) => ({
                Name: sink.name,
                ID: sink.id
              }))
            );
          }
        } else {
          logger.log("\nConnected Streams: None");
          logger.log("Connected Sinks: None");
        }
      }
    });
  }
});

// src/pipelines/cli/list.ts
var pipelinesListCommand;
var init_list12 = __esm({
  "src/pipelines/cli/list.ts"() {
    init_import_meta_url();
    init_create_command();
    init_logger();
    init_user3();
    init_client10();
    init_legacy_helpers();
    pipelinesListCommand = createCommand({
      metadata: {
        description: "List all pipelines",
        owner: "Product: Pipelines",
        status: "open beta"
      },
      behaviour: {
        printBanner: /* @__PURE__ */ __name((args) => !args.json, "printBanner")
      },
      args: {
        page: {
          describe: "Page number for pagination",
          type: "number",
          default: 1
        },
        "per-page": {
          describe: "Number of pipelines per page",
          type: "number",
          default: 20
        },
        json: {
          describe: "Output in JSON format",
          type: "boolean",
          default: false
        }
      },
      async handler(args, { config }) {
        const accountId = await requireAuth(config);
        const [newPipelines, legacyPipelines] = await Promise.all([
          listPipelines(config, {
            page: args.page,
            per_page: args.perPage
          }),
          tryListLegacyPipelines(config, accountId)
        ]);
        if (args.json) {
          const hasLegacyPipelines2 = legacyPipelines && legacyPipelines.length > 0;
          const result = hasLegacyPipelines2 ? {
            pipelines: newPipelines || [],
            legacyPipelines
          } : newPipelines || [];
          logger.json(result);
          return;
        }
        const hasLegacyPipelines = legacyPipelines && legacyPipelines.length > 0;
        const hasNewPipelines = newPipelines && newPipelines.length > 0;
        if (!hasNewPipelines && !hasLegacyPipelines) {
          logger.log("No pipelines found.");
          return;
        }
        if (hasLegacyPipelines) {
          const tableData = [
            ...(newPipelines || []).map((pipeline) => ({
              Name: pipeline.name,
              ID: pipeline.id,
              Created: new Date(pipeline.created_at).toLocaleDateString(),
              Modified: new Date(pipeline.modified_at).toLocaleDateString(),
              Type: ""
            })),
            ...legacyPipelines.map((pipeline) => ({
              Name: pipeline.name,
              ID: pipeline.id,
              Created: "N/A",
              Modified: "N/A",
              Type: "Legacy"
            }))
          ];
          logger.table(tableData);
        } else {
          const tableData = (newPipelines || []).map((pipeline) => ({
            Name: pipeline.name,
            ID: pipeline.id,
            Created: new Date(pipeline.created_at).toLocaleDateString(),
            Modified: new Date(pipeline.modified_at).toLocaleDateString()
          }));
          logger.table(tableData);
        }
        if (hasLegacyPipelines) {
          logger.warn(
            "\u26A0\uFE0F  You have legacy pipelines. Consider creating new pipelines by running 'wrangler pipelines setup'."
          );
        }
      }
    });
  }
});

// src/r2/helpers/catalog.ts
async function getR2Catalog(complianceConfig, accountId, bucketName) {
  return await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/r2-catalog/${bucketName}`,
    {
      method: "GET"
    }
  );
}
async function enableR2Catalog(complianceConfig, accountId, bucketName) {
  return await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/r2-catalog/${bucketName}/enable`,
    {
      method: "POST"
    }
  );
}
async function disableR2Catalog(complianceConfig, accountId, bucketName) {
  return await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/r2-catalog/${bucketName}/disable`,
    {
      method: "POST"
    }
  );
}
async function enableR2CatalogCompaction(complianceConfig, accountId, bucketName, targetSizeMb) {
  const config = {
    state: "enabled",
    targetSizeMb
  };
  return await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/r2-catalog/${bucketName}/maintenance-configs`,
    {
      method: "POST",
      body: JSON.stringify({
        compaction: config
      }),
      headers: {
        "Content-Type": "application/json"
      }
    }
  );
}
async function enableR2CatalogSnapshotExpiration(complianceConfig, accountId, bucketName, olderThanDays, retainLast) {
  const config = {
    state: "enabled",
    max_snapshot_age: `${olderThanDays ?? 30}d`,
    min_snapshots_to_keep: retainLast ?? 5
  };
  return await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/r2-catalog/${bucketName}/maintenance-configs`,
    {
      method: "POST",
      body: JSON.stringify({
        snapshot_expiration: config
      }),
      headers: {
        "Content-Type": "application/json"
      }
    }
  );
}
async function disableR2CatalogCompaction(complianceConfig, accountId, bucketName) {
  const config = {
    state: "disabled"
  };
  return await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/r2-catalog/${bucketName}/maintenance-configs`,
    {
      method: "POST",
      body: JSON.stringify({
        compaction: config
      }),
      headers: {
        "Content-Type": "application/json"
      }
    }
  );
}
async function disableR2CatalogSnapshotExpiration(complianceConfig, accountId, bucketName) {
  const config = {
    state: "disabled"
  };
  return await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/r2-catalog/${bucketName}/maintenance-configs`,
    {
      method: "POST",
      body: JSON.stringify({
        snapshot_expiration: config
      }),
      headers: {
        "Content-Type": "application/json"
      }
    }
  );
}
async function upsertR2CatalogCredential(complianceConfig, accountId, bucketName, token) {
  return await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/r2-catalog/${bucketName}/credential`,
    {
      method: "POST",
      body: JSON.stringify({
        token
      }),
      headers: {
        "Content-Type": "application/json"
      }
    }
  );
}
async function enableR2CatalogTableCompaction(complianceConfig, accountId, bucketName, namespace, tableName, targetSizeMb) {
  const body = {
    compaction: {
      state: "enabled"
    }
  };
  if (targetSizeMb !== void 0) {
    body.compaction.target_size_mb = targetSizeMb;
  }
  return await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/r2-catalog/${bucketName}/namespaces/${namespace}/tables/${tableName}/maintenance-configs`,
    {
      method: "POST",
      body: JSON.stringify(body),
      headers: {
        "Content-Type": "application/json"
      }
    }
  );
}
async function disableR2CatalogTableCompaction(complianceConfig, accountId, bucketName, namespace, tableName) {
  return await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/r2-catalog/${bucketName}/namespaces/${namespace}/tables/${tableName}/maintenance-configs`,
    {
      method: "POST",
      body: JSON.stringify({
        compaction: {
          state: "disabled"
        }
      }),
      headers: {
        "Content-Type": "application/json"
      }
    }
  );
}
async function enableR2CatalogTableSnapshotExpiration(complianceConfig, accountId, bucketName, namespace, tableName, olderThanDays, retainLast) {
  const body = {
    snapshot_expiration: {
      state: "enabled",
      older_than_days: olderThanDays ?? 30,
      retain_last: retainLast ?? 5
    }
  };
  return await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/r2-catalog/${bucketName}/namespaces/${namespace}/tables/${tableName}/maintenance-configs`,
    {
      method: "POST",
      body: JSON.stringify(body),
      headers: {
        "Content-Type": "application/json"
      }
    }
  );
}
async function disableR2CatalogTableSnapshotExpiration(complianceConfig, accountId, bucketName, namespace, tableName) {
  return await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/r2-catalog/${bucketName}/namespaces/${namespace}/tables/${tableName}/maintenance-configs`,
    {
      method: "POST",
      body: JSON.stringify({
        snapshot_expiration: {
          state: "disabled"
        }
      }),
      headers: {
        "Content-Type": "application/json"
      }
    }
  );
}
var init_catalog = __esm({
  "src/r2/helpers/catalog.ts"() {
    init_import_meta_url();
    init_cfetch();
    __name(getR2Catalog, "getR2Catalog");
    __name(enableR2Catalog, "enableR2Catalog");
    __name(disableR2Catalog, "disableR2Catalog");
    __name(enableR2CatalogCompaction, "enableR2CatalogCompaction");
    __name(enableR2CatalogSnapshotExpiration, "enableR2CatalogSnapshotExpiration");
    __name(disableR2CatalogCompaction, "disableR2CatalogCompaction");
    __name(disableR2CatalogSnapshotExpiration, "disableR2CatalogSnapshotExpiration");
    __name(upsertR2CatalogCredential, "upsertR2CatalogCredential");
    __name(enableR2CatalogTableCompaction, "enableR2CatalogTableCompaction");
    __name(disableR2CatalogTableCompaction, "disableR2CatalogTableCompaction");
    __name(enableR2CatalogTableSnapshotExpiration, "enableR2CatalogTableSnapshotExpiration");
    __name(disableR2CatalogTableSnapshotExpiration, "disableR2CatalogTableSnapshotExpiration");
  }
});

// src/pipelines/defaults.ts
function applyDefaultsToSink(sink) {
  const withDefaults = {
    ...sink,
    format: { ...sink.format },
    config: { ...sink.config }
  };
  if (withDefaults.format.type === "parquet") {
    if (!withDefaults.format.compression) {
      withDefaults.format.compression = SINK_DEFAULTS.format.compression;
    }
    if (!withDefaults.format.row_group_bytes) {
      withDefaults.format.row_group_bytes = SINK_DEFAULTS.format.row_group_bytes;
    }
  }
  if (!withDefaults.config.rolling_policy) {
    withDefaults.config.rolling_policy = {
      interval_seconds: SINK_DEFAULTS.rolling_policy.interval_seconds
    };
    if (SINK_DEFAULTS.rolling_policy.file_size_bytes !== void 0) {
      withDefaults.config.rolling_policy.file_size_bytes = SINK_DEFAULTS.rolling_policy.file_size_bytes;
    }
  } else {
    if (!withDefaults.config.rolling_policy.file_size_bytes && SINK_DEFAULTS.rolling_policy.file_size_bytes !== void 0) {
      withDefaults.config.rolling_policy.file_size_bytes = SINK_DEFAULTS.rolling_policy.file_size_bytes;
    }
    if (!withDefaults.config.rolling_policy.interval_seconds) {
      withDefaults.config.rolling_policy.interval_seconds = SINK_DEFAULTS.rolling_policy.interval_seconds;
    }
  }
  if (withDefaults.type === "r2") {
    if (!withDefaults.config.path) {
      withDefaults.config.path = SINK_DEFAULTS.r2.path;
    }
    if (!withDefaults.config.partitioning) {
      withDefaults.config.partitioning = SINK_DEFAULTS.r2.partitioning;
    }
  }
  return withDefaults;
}
var SINK_DEFAULTS;
var init_defaults = __esm({
  "src/pipelines/defaults.ts"() {
    init_import_meta_url();
    SINK_DEFAULTS = {
      format: {
        type: "parquet",
        compression: "zstd",
        row_group_bytes: 1024 * 1024 * 1024
      },
      rolling_policy: {
        file_size_bytes: void 0,
        interval_seconds: 300
      },
      r2: {
        path: "",
        partitioning: {
          time_pattern: "year=%Y/month=%m/day=%d"
        }
      },
      r2_data_catalog: {}
    };
    __name(applyDefaultsToSink, "applyDefaultsToSink");
  }
});
function getErrorMessage2(error2, fallback) {
  if (error2 instanceof APIError && error2.notes.length > 0) {
    return error2.notes[0].text;
  }
  if (error2 instanceof Error) {
    return error2.message;
  }
  return fallback;
}
async function promptWithRetry(getMessage, getValue, validate3) {
  while (true) {
    const value = await getValue();
    try {
      validate3(value);
      return value;
    } catch (error2) {
      const message = error2 instanceof Error ? error2.message : "Validation failed";
      logger.error(message);
      const retry2 = await confirm("Would you like to try again?", {
        defaultValue: true
      });
      if (!retry2) {
        throw new UserError(`${getMessage()} - cancelled`);
      }
    }
  }
}
async function ensureBucketExists(config, accountId, bucketName) {
  try {
    await getR2Bucket(config, accountId, bucketName);
    logger.log(`  Using existing bucket "${bucketName}"`);
    return false;
  } catch (err) {
    if (err instanceof APIError && err.code === 10006) ; else {
      throw err;
    }
  }
  process.stdout.write(`  Creating bucket "${bucketName}"...`);
  await createR2Bucket(config, accountId, bucketName);
  logger.log(source_default.green(" done"));
  return true;
}
function validateBucketName(name2) {
  if (!name2) {
    throw new UserError("Bucket name is required");
  }
  if (!isValidR2BucketName(name2)) {
    throw new UserError(
      `The bucket name "${name2}" is invalid. ${bucketFormatMessage}`
    );
  }
}
async function promptBucketName() {
  return promptWithRetry(
    () => "R2 bucket name",
    () => prompt("R2 bucket name (will be created if it doesn't exist):"),
    validateBucketName
  );
}
async function ensureCatalogEnabled(config, accountId, bucketName) {
  let catalogEnabled = false;
  try {
    const catalog = await getR2Catalog(config, accountId, bucketName);
    catalogEnabled = catalog.status === "active";
  } catch (err) {
    if (err instanceof APIError && err.code === 40401) ; else {
      throw err;
    }
  }
  if (catalogEnabled) {
    logger.log("  Data Catalog already enabled");
  } else {
    process.stdout.write("  Enabling Data Catalog...");
    await enableR2Catalog(config, accountId, bucketName);
    logger.log(source_default.green(" done"));
  }
}
function displayCatalogTokenInstructions(accountId) {
  logger.log(source_default.dim("\n  To create a Catalog API token:"));
  logger.log(
    source_default.dim(
      `  Visit https://dash.cloudflare.com/${accountId}/r2/api-tokens/create?type=account`
    )
  );
  logger.log(
    source_default.dim('  Create token with "Admin Read & Write" permissions\n')
  );
}
function displayR2CredentialsInstructions(accountId) {
  logger.log(source_default.dim("\n  To create R2 API credentials:"));
  logger.log(
    source_default.dim(
      `  Visit https://dash.cloudflare.com/${accountId}/r2/api-tokens/create?type=account`
    )
  );
  logger.log(
    source_default.dim('  Create token with "Object Read & Write" permissions\n')
  );
}
async function promptCompression() {
  return select("Compression:", {
    choices: [...COMPRESSION_CHOICES],
    defaultOption: 3,
    // zstd
    fallbackOption: 3
  });
}
async function promptRollingPolicy() {
  const fileSizeMB = await promptWithRetry(
    () => "File size",
    () => prompt("Roll file when size reaches (MB, minimum 5):", {
      defaultValue: "100"
    }),
    (value) => {
      const num = parseInt(value, 10);
      if (isNaN(num) || num < 5) {
        throw new UserError("File size must be a number >= 5");
      }
    }
  );
  const intervalSeconds = await promptWithRetry(
    () => "Interval",
    () => prompt("Roll file when time reaches (seconds, minimum 10):", {
      defaultValue: String(SINK_DEFAULTS.rolling_policy.interval_seconds)
    }),
    (value) => {
      const num = parseInt(value, 10);
      if (isNaN(num) || num < 10) {
        throw new UserError("Interval must be a number >= 10");
      }
    }
  );
  return {
    fileSizeBytes: parseInt(fileSizeMB) * 1024 * 1024,
    intervalSeconds: parseInt(intervalSeconds)
  };
}
async function promptCatalogToken(config, accountId, bucketName) {
  while (true) {
    const token = await prompt("Catalog API token:", { isSecret: true });
    if (!token) {
      logger.error("Catalog API token is required");
      const retry2 = await confirm("Would you like to try again?", {
        defaultValue: true
      });
      if (!retry2) {
        throw new UserError("Catalog API token - cancelled");
      }
      continue;
    }
    process.stdout.write("  Validating token...");
    try {
      await upsertR2CatalogCredential(config, accountId, bucketName, token);
      logger.log(source_default.green(" done"));
      return token;
    } catch {
      logger.log(source_default.red(" failed"));
      logger.log(
        source_default.dim(
          '  Token invalid or missing permissions. Ensure it has "Admin Read & Write" access.'
        )
      );
      const retry2 = await confirm("Would you like to try again?", {
        defaultValue: true
      });
      if (!retry2) {
        throw new UserError("Catalog API token validation failed");
      }
    }
  }
}
async function promptR2Credentials(accountId, bucketName) {
  while (true) {
    const accessKeyId = await prompt("R2 Access Key ID:");
    if (!accessKeyId) {
      logger.error("R2 Access Key ID is required");
      const retry2 = await confirm("Would you like to try again?", {
        defaultValue: true
      });
      if (!retry2) {
        throw new UserError("R2 Access Key ID - cancelled");
      }
      continue;
    }
    const secretAccessKey = await prompt("R2 Secret Access Key:", {
      isSecret: true
    });
    if (!secretAccessKey) {
      logger.error("R2 Secret Access Key is required");
      const retry2 = await confirm("Would you like to try again?", {
        defaultValue: true
      });
      if (!retry2) {
        throw new UserError("R2 Secret Access Key - cancelled");
      }
      continue;
    }
    process.stdout.write("  Validating credentials...");
    try {
      await verifyR2Credentials(
        accountId,
        bucketName,
        accessKeyId,
        secretAccessKey
      );
      logger.log(source_default.green(" done"));
      return {
        access_key_id: accessKeyId,
        secret_access_key: secretAccessKey
      };
    } catch {
      logger.log(source_default.red(" failed"));
      logger.log(
        source_default.dim(
          '  Credentials invalid or missing permissions. Ensure token has "Object Read & Write" access.'
        )
      );
      const retry2 = await confirm("Would you like to try again?", {
        defaultValue: true
      });
      if (!retry2) {
        throw new UserError("R2 credentials validation failed");
      }
    }
  }
}
async function setupPipelineNaming(providedName) {
  const pipelineName = providedName ? providedName : await promptWithRetry(
    () => "Pipeline name",
    () => prompt("What would you like to name your pipeline?"),
    (name2) => {
      if (!name2) {
        throw new UserError("Pipeline name is required");
      }
      validateEntityName("pipeline", name2);
    }
  );
  if (providedName) {
    validateEntityName("pipeline", providedName);
  }
  const streamName = `${pipelineName}_stream`;
  const sinkName = `${pipelineName}_sink`;
  return {
    pipelineName,
    streamName,
    sinkName,
    streamConfig: {
      name: streamName,
      http: { enabled: true, authentication: false },
      worker_binding: { enabled: true }
    },
    sinkConfig: {
      name: sinkName,
      type: "r2",
      config: { bucket: "" }
    }
  };
}
async function setupStreamConfiguration(setupConfig) {
  logger.log("\nSTREAM\n");
  const httpEnabled = await confirm("Enable HTTP endpoint for sending data?", {
    defaultValue: true
  });
  let httpAuth = false;
  if (httpEnabled) {
    httpAuth = await confirm("Require authentication for HTTP endpoint?", {
      defaultValue: false
    });
  }
  let corsOrigins;
  if (httpEnabled) {
    const customCors = await confirm("Configure custom CORS origins?", {
      defaultValue: false
    });
    if (customCors) {
      const origins = await prompt(
        "CORS origins (comma-separated, or * for all):"
      );
      corsOrigins = origins === "*" ? ["*"] : origins.split(",").map((o7) => o7.trim());
    }
  }
  const schema = await setupSchemaConfiguration();
  setupConfig.streamConfig = {
    name: setupConfig.streamName,
    format: { type: "json", ...!schema && { unstructured: true } },
    http: {
      enabled: httpEnabled,
      authentication: httpAuth,
      ...httpEnabled && corsOrigins && { cors: { origins: corsOrigins } }
    },
    worker_binding: { enabled: true },
    ...schema && { schema: { fields: schema } }
  };
}
async function setupSchemaConfiguration() {
  const schemaMethod = await select(
    "How would you like to define the schema for incoming events?",
    {
      choices: [
        { title: "Build interactively", value: "interactive" },
        { title: "Load from file", value: "file" },
        { title: "Skip (unstructured)", value: "skip" }
      ],
      defaultOption: 0,
      fallbackOption: 2
    }
  );
  switch (schemaMethod) {
    case "interactive":
      return buildSchemaInteractively();
    case "file":
      return loadSchemaFromFile();
    case "skip":
      return void 0;
    default:
      return void 0;
  }
}
async function buildSchemaInteractively() {
  const fields = [];
  logger.log("");
  let fieldNumber = 1;
  while (true) {
    fields.push(await buildField(fieldNumber));
    const addAnother = await confirm(`Add field #${fieldNumber + 1}?`, {
      defaultValue: fieldNumber < 3
    });
    if (!addAnother) {
      break;
    }
    fieldNumber++;
  }
  return fields;
}
async function buildField(fieldNumber, depth = 0) {
  const indent = "  ".repeat(depth);
  logger.log(`${indent}Field #${fieldNumber}:`);
  const name2 = await promptWithRetry(
    () => "Field name",
    () => prompt(`${indent}  Name:`),
    (value) => {
      if (!value) {
        throw new UserError("Field name is required");
      }
    }
  );
  const typeChoices = [
    { title: "string", value: "string" },
    { title: "int32", value: "int32" },
    { title: "int64", value: "int64" },
    { title: "float32", value: "float32" },
    { title: "float64", value: "float64" },
    { title: "bool", value: "bool" },
    { title: "timestamp", value: "timestamp" },
    { title: "json", value: "json" },
    { title: "bytes", value: "bytes" }
  ];
  if (depth < 2) {
    typeChoices.push(
      { title: "struct (nested object)", value: "struct" },
      { title: "list (array)", value: "list" }
    );
  }
  const type = await select(`${indent}  Type:`, {
    choices: typeChoices,
    defaultOption: 0,
    fallbackOption: 0
  });
  const required = await confirm(`${indent}  Required?`, {
    defaultValue: true
  });
  const field = {
    name: name2,
    type,
    required
  };
  if (type === "timestamp") {
    const unit = await select(`${indent}  Unit:`, {
      choices: [
        { title: "millisecond", value: "millisecond" },
        { title: "second", value: "second" },
        { title: "microsecond", value: "microsecond" },
        { title: "nanosecond", value: "nanosecond" }
      ],
      defaultOption: 0,
      fallbackOption: 0
    });
    field.unit = unit;
  } else if (type === "struct" && depth < 2) {
    logger.log(`
Define nested fields for struct '${name2}':`);
    field.fields = [];
    let structFieldNumber = 1;
    while (true) {
      field.fields.push(await buildField(structFieldNumber, depth + 1));
      const addAnother = await confirm(
        `${indent}Add another field to struct '${name2}'?`,
        { defaultValue: false }
      );
      if (!addAnother) {
        break;
      }
      structFieldNumber++;
    }
  } else if (type === "list" && depth < 2) {
    logger.log(`
Define item type for list '${name2}':`);
    field.items = await buildField(1, depth + 1);
  }
  return field;
}
async function loadSchemaFromFile() {
  const filePath = await prompt("Schema file path:");
  try {
    const schemaContent = fs29.readFileSync(filePath, "utf-8");
    const parsedSchema = parseJSON(schemaContent, filePath);
    if (!parsedSchema || !Array.isArray(parsedSchema.fields)) {
      throw new UserError("Schema file must contain a 'fields' array");
    }
    return parsedSchema.fields;
  } catch (error2) {
    logger.error(
      `Failed to read schema file: ${error2 instanceof Error ? error2.message : String(error2)}`
    );
    const retry2 = await confirm("Would you like to try again?", {
      defaultValue: true
    });
    if (retry2) {
      return loadSchemaFromFile();
    } else {
      throw new UserError("Schema file loading cancelled");
    }
  }
}
async function loadSqlFromFile() {
  const filePath = await prompt("SQL file path:");
  try {
    const sql = fs29.readFileSync(filePath, "utf-8").trim();
    if (!sql) {
      throw new UserError("SQL file is empty");
    }
    return sql;
  } catch (error2) {
    logger.error(
      `Failed to read SQL file: ${error2 instanceof Error ? error2.message : String(error2)}`
    );
    const retry2 = await confirm("Would you like to try again?", {
      defaultValue: true
    });
    if (retry2) {
      return loadSqlFromFile();
    } else {
      throw new UserError("SQL file loading cancelled");
    }
  }
}
async function setupSinkConfiguration(config, setupConfig) {
  logger.log("\nSINK\n");
  const sinkType = await select("Destination type:", {
    choices: [
      { title: "R2 Bucket", value: "r2" },
      { title: "Data Catalog (Iceberg)", value: "r2_data_catalog" }
    ],
    defaultOption: 0,
    fallbackOption: 0
  });
  const simpleDescription = sinkType === "r2" ? "parquet + zstd, 100MB file rolls, auto-generated credentials" : "parquet + zstd, 100MB file rolls";
  const setupMode = await select("Setup mode:", {
    choices: [
      {
        title: "Simple (recommended defaults)",
        description: simpleDescription,
        value: "simple"
      },
      {
        title: "Advanced (configure all options)",
        description: "format, compression, rolling policy, credentials, etc.",
        value: "advanced"
      }
    ],
    defaultOption: 0,
    fallbackOption: 0
  });
  const accountId = await requireAuth(config);
  if (setupMode === "simple") {
    if (sinkType === "r2") {
      await setupSimpleR2Sink(config, accountId, setupConfig);
    } else {
      await setupSimpleDataCatalogSink(config, accountId, setupConfig);
    }
  } else {
    if (sinkType === "r2") {
      await setupR2Sink(config, accountId, setupConfig);
    } else {
      await setupDataCatalogSink(config, accountId, setupConfig);
    }
  }
}
async function setupSimpleR2Sink(config, accountId, setupConfig) {
  const bucket = await promptBucketName();
  await ensureBucketExists(config, accountId, bucket);
  process.stdout.write("  Generating credentials...");
  const cleanedSinkName = setupConfig.sinkName.replace(/_/g, "-");
  const auth = await authorizeR2Bucket(
    config,
    cleanedSinkName,
    accountId,
    bucket,
    { quiet: true }
  );
  logger.log(source_default.green(" done"));
  setupConfig.sinkConfig = {
    name: setupConfig.sinkName,
    type: "r2",
    format: {
      type: "parquet",
      compression: "zstd"
    },
    config: {
      bucket,
      partitioning: {
        time_pattern: "year=%Y/month=%m/day=%d"
      },
      credentials: {
        access_key_id: auth.accessKeyId,
        secret_access_key: auth.secretAccessKey
      },
      rolling_policy: {
        file_size_bytes: 100 * 1024 * 1024,
        interval_seconds: SINK_DEFAULTS.rolling_policy.interval_seconds
      }
    }
  };
}
async function setupSimpleDataCatalogSink(config, accountId, setupConfig) {
  const bucket = await promptBucketName();
  await ensureBucketExists(config, accountId, bucket);
  await ensureCatalogEnabled(config, accountId, bucket);
  const tableName = await promptWithRetry(
    () => "Table name",
    () => prompt("Table name (e.g. events, user_activity):"),
    (value) => {
      if (!value) {
        throw new UserError("Table name is required");
      }
    }
  );
  displayCatalogTokenInstructions(accountId);
  const token = await promptCatalogToken(config, accountId, bucket);
  setupConfig.sinkConfig = {
    name: setupConfig.sinkName,
    type: "r2_data_catalog",
    format: {
      type: "parquet",
      compression: "zstd"
    },
    config: {
      bucket,
      namespace: "default",
      table_name: tableName,
      token,
      rolling_policy: {
        file_size_bytes: 100 * 1024 * 1024,
        interval_seconds: SINK_DEFAULTS.rolling_policy.interval_seconds
      }
    }
  };
}
async function setupR2Sink(config, accountId, setupConfig) {
  const bucket = await promptBucketName();
  await ensureBucketExists(config, accountId, bucket);
  const path84 = await prompt(
    "The base prefix in your bucket where data will be written (optional):",
    {
      defaultValue: ""
    }
  );
  const timePartitionPattern = await prompt(
    "Time partition pattern (optional):",
    {
      defaultValue: "year=%Y/month=%m/day=%d"
    }
  );
  const format11 = await select("Output format:", {
    choices: [
      { title: "Parquet (recommended for analytics)", value: "parquet" },
      { title: "JSON", value: "json" }
    ],
    defaultOption: 0,
    fallbackOption: 0
  });
  const compression = format11 === "parquet" ? await promptCompression() : void 0;
  const rollingPolicy = await promptRollingPolicy();
  const useOAuth = await confirm(
    "Automatically generate credentials needed to write to your R2 bucket?",
    {
      defaultValue: true
    }
  );
  let credentials;
  if (useOAuth) {
    process.stdout.write("  Generating credentials...");
    const cleanedSinkName = setupConfig.sinkName.replace(/_/g, "-");
    const auth = await authorizeR2Bucket(
      config,
      cleanedSinkName,
      accountId,
      bucket,
      { quiet: true }
    );
    logger.log(source_default.green(" done"));
    credentials = {
      access_key_id: auth.accessKeyId,
      secret_access_key: auth.secretAccessKey
    };
  } else {
    displayR2CredentialsInstructions(accountId);
    credentials = await promptR2Credentials(accountId, bucket);
  }
  let formatConfig;
  if (format11 === "json") {
    formatConfig = { type: "json" };
  } else {
    formatConfig = {
      type: "parquet",
      ...compression && {
        compression
      }
    };
  }
  setupConfig.sinkConfig = {
    name: setupConfig.sinkName,
    type: "r2",
    format: formatConfig,
    config: {
      bucket,
      ...path84 && { path: path84 },
      ...timePartitionPattern && {
        partitioning: {
          time_pattern: timePartitionPattern
        }
      },
      credentials,
      rolling_policy: {
        file_size_bytes: rollingPolicy.fileSizeBytes,
        interval_seconds: rollingPolicy.intervalSeconds
      }
    }
  };
}
async function setupDataCatalogSink(config, accountId, setupConfig) {
  const bucket = await promptBucketName();
  await ensureBucketExists(config, accountId, bucket);
  await ensureCatalogEnabled(config, accountId, bucket);
  const namespace = await promptWithRetry(
    () => "Namespace",
    () => prompt("Namespace:", { defaultValue: "default" }),
    (value) => {
      if (!value) {
        throw new UserError("Namespace is required");
      }
    }
  );
  const tableName = await promptWithRetry(
    () => "Table name",
    () => prompt("Table name:"),
    (value) => {
      if (!value) {
        throw new UserError("Table name is required");
      }
    }
  );
  displayCatalogTokenInstructions(accountId);
  const token = await promptCatalogToken(config, accountId, bucket);
  const compression = await promptCompression();
  const rollingPolicy = await promptRollingPolicy();
  setupConfig.sinkConfig = {
    name: setupConfig.sinkName,
    type: "r2_data_catalog",
    format: {
      type: "parquet",
      compression
    },
    config: {
      bucket,
      namespace,
      table_name: tableName,
      token,
      rolling_policy: {
        file_size_bytes: rollingPolicy.fileSizeBytes,
        interval_seconds: rollingPolicy.intervalSeconds
      }
    }
  };
}
async function setupSQLTransformationWithValidation(config, setupConfig) {
  logger.log("\nSQL\n");
  logger.log("  Available tables:");
  logger.log(`    ${setupConfig.streamName} (source)`);
  logger.log(`    ${setupConfig.sinkName} (sink)
`);
  if (setupConfig.streamConfig.schema?.fields) {
    logger.log("  Schema:");
    const schemaRows = formatSchemaFieldsForTable(
      setupConfig.streamConfig.schema.fields
    );
    logger.table(schemaRows);
  }
  const sqlMethod = await select("Query:", {
    choices: [
      {
        title: "Simple ingestion (SELECT * FROM stream)",
        value: "simple"
      },
      { title: "Write custom SQL", value: "interactive" },
      { title: "Load from file", value: "file" }
    ],
    defaultOption: 0,
    fallbackOption: 0
  });
  let sql;
  if (sqlMethod === "simple") {
    sql = `INSERT INTO ${setupConfig.sinkName} SELECT * FROM ${setupConfig.streamName};`;
    logger.log(source_default.dim(`
  ${sql}
`));
  } else if (sqlMethod === "interactive") {
    logger.log(
      source_default.dim(
        `
  Example: INSERT INTO ${setupConfig.sinkName} SELECT * FROM ${setupConfig.streamName};
`
      )
    );
    sql = await promptMultiline("Enter SQL query:", "SQL");
  } else {
    sql = await loadSqlFromFile();
  }
  if (!sql) {
    throw new UserError("SQL query cannot be empty");
  }
  process.stdout.write("  Validating...");
  try {
    const validationResult = await validateSql(config, { sql });
    if (!validationResult.tables || Object.keys(validationResult.tables).length === 0) {
      logger.log(source_default.yellow(" warning"));
      logger.warn(
        "  SQL validation returned no tables - this might indicate an issue with the query"
      );
    } else {
      logger.log(source_default.green(" done"));
    }
    setupConfig.pipelineConfig = {
      name: setupConfig.pipelineName,
      sql
    };
  } catch (error2) {
    logger.log(source_default.red(" failed"));
    let errorMessage = "SQL validation failed";
    if (error2 && typeof error2 === "object") {
      const errorObj = error2;
      if (errorObj.notes && Array.isArray(errorObj.notes) && errorObj.notes[0]?.text) {
        errorMessage = errorObj.notes[0].text;
      }
    }
    const retry2 = await confirm(
      `  ${errorMessage}

  Retry with different SQL?`,
      { defaultValue: true }
    );
    if (retry2) {
      return setupSQLTransformationWithValidation(config, setupConfig);
    } else {
      throw new UserError(
        "SQL validation failed and setup cannot continue without valid pipeline SQL"
      );
    }
  }
}
async function promptMultiline(message, promptPrefix = "INPUT") {
  logger.log(message);
  logger.log("(Press Enter to finish each line, empty line to complete)\n");
  const lines = [];
  let line;
  do {
    line = await prompt(lines.length === 0 ? `${promptPrefix}> ` : `...> `);
    if (line.trim()) {
      lines.push(line);
    }
  } while (line.trim() !== "");
  return lines.join(" ");
}
async function reviewAndCreateStreamSink(config, setupConfig) {
  logger.log("\nSUMMARY\n");
  const httpStatus = setupConfig.streamConfig.http.enabled ? setupConfig.streamConfig.http.authentication ? "enabled (auth required)" : "enabled" : "disabled";
  const schemaStatus = setupConfig.streamConfig.schema?.fields ? `${setupConfig.streamConfig.schema.fields.length} field${setupConfig.streamConfig.schema.fields.length === 1 ? "" : "s"}` : "unstructured";
  logger.log(`  Stream    ${setupConfig.streamName}`);
  logger.log(source_default.dim(`            HTTP ${httpStatus}, ${schemaStatus}
`));
  if (setupConfig.sinkConfig.type === "r2") {
    const format11 = setupConfig.sinkConfig.format?.type || "parquet";
    const compression = setupConfig.sinkConfig.format?.type === "parquet" ? setupConfig.sinkConfig.format.compression || "" : "";
    logger.log(`  Sink      ${setupConfig.sinkName}`);
    logger.log(
      source_default.dim(
        `            R2 \u2192 ${setupConfig.sinkConfig.config.bucket}, ${format11}${compression ? ` + ${compression}` : ""}
`
      )
    );
  } else {
    logger.log(`  Sink      ${setupConfig.sinkName}`);
    logger.log(
      source_default.dim(
        `            Data Catalog \u2192 ${setupConfig.sinkConfig.config.namespace}/${setupConfig.sinkConfig.config.table_name}
`
      )
    );
  }
  const proceed = await confirm("Create resources?", {
    defaultValue: true
  });
  if (!proceed) {
    throw new UserError("Setup cancelled");
  }
  const created = {};
  while (!created.stream) {
    try {
      process.stdout.write("\n  Creating stream...");
      created.stream = await createStream(config, setupConfig.streamConfig);
      logger.log(source_default.green(" done"));
    } catch (error2) {
      logger.log(source_default.red(" failed"));
      logger.log(
        source_default.dim(`  ${getErrorMessage2(error2, "Stream creation failed")}`)
      );
      const retry2 = await confirm("  Retry?", {
        defaultValue: true
      });
      if (!retry2) {
        throw new UserError("Stream creation cancelled");
      }
    }
  }
  while (!created.sink) {
    try {
      process.stdout.write("  Creating sink...");
      created.sink = await createSink(config, setupConfig.sinkConfig);
      logger.log(source_default.green(" done"));
    } catch (error2) {
      logger.log(source_default.red(" failed"));
      logger.log(
        source_default.dim(`  ${getErrorMessage2(error2, "Sink creation failed")}`)
      );
      const retry2 = await confirm(
        "  Retry? (stream was created successfully)",
        {
          defaultValue: true
        }
      );
      if (!retry2) {
        process.stdout.write("  Cleaning up stream...");
        try {
          await deleteStream(config, created.stream.id);
          logger.log(source_default.green(" done"));
        } catch (cleanupError) {
          logger.log(source_default.red(" failed"));
          logger.warn(
            `  ${cleanupError instanceof Error ? cleanupError.message : String(cleanupError)}`
          );
        }
        throw new UserError("Sink creation cancelled");
      }
    }
  }
  return created;
}
async function createPipelineIfNeeded(config, setupConfig, created, args) {
  if (!setupConfig.pipelineConfig) {
    throw new UserError("Pipeline configuration is missing");
  }
  while (true) {
    try {
      process.stdout.write("  Creating pipeline...");
      await createPipeline(config, setupConfig.pipelineConfig);
      logger.log(source_default.green(" done"));
      logger.log(source_default.green("\n\u2713 Setup complete\n"));
      if (created.stream) {
        await displayUsageExamples(created.stream, config, args);
      }
      return;
    } catch (error2) {
      logger.log(source_default.red(" failed"));
      logger.log(
        source_default.dim(`  ${getErrorMessage2(error2, "Pipeline creation failed")}`)
      );
      logger.log(
        source_default.dim(
          "\n  Stream and sink were created, but pipeline creation failed."
        )
      );
      const retry2 = await confirm("  Try again with different SQL?", {
        defaultValue: true
      });
      if (!retry2) {
        logger.log(
          source_default.dim(
            "\n  You can create the pipeline later with: wrangler pipelines create"
          )
        );
        logger.log(
          source_default.dim(
            `  Your stream "${setupConfig.streamName}" and sink "${setupConfig.sinkName}" are ready.`
          )
        );
        return;
      }
      await setupSQLTransformationWithValidation(config, setupConfig);
    }
  }
}
var COMPRESSION_CHOICES, pipelinesSetupCommand;
var init_setup = __esm({
  "src/pipelines/cli/setup.ts"() {
    init_import_meta_url();
    init_dist();
    init_source();
    init_create_command();
    init_dialogs();
    init_logger();
    init_bucket();
    init_catalog();
    init_user3();
    init_client10();
    init_defaults();
    init_pipelines2();
    init_validate5();
    init_utils17();
    __name(getErrorMessage2, "getErrorMessage");
    __name(promptWithRetry, "promptWithRetry");
    __name(ensureBucketExists, "ensureBucketExists");
    __name(validateBucketName, "validateBucketName");
    __name(promptBucketName, "promptBucketName");
    __name(ensureCatalogEnabled, "ensureCatalogEnabled");
    __name(displayCatalogTokenInstructions, "displayCatalogTokenInstructions");
    __name(displayR2CredentialsInstructions, "displayR2CredentialsInstructions");
    COMPRESSION_CHOICES = [
      { title: "uncompressed", value: "uncompressed" },
      { title: "snappy", value: "snappy" },
      { title: "gzip", value: "gzip" },
      { title: "zstd", value: "zstd" },
      { title: "lz4", value: "lz4" }
    ];
    __name(promptCompression, "promptCompression");
    __name(promptRollingPolicy, "promptRollingPolicy");
    __name(promptCatalogToken, "promptCatalogToken");
    __name(promptR2Credentials, "promptR2Credentials");
    pipelinesSetupCommand = createCommand({
      metadata: {
        description: "Interactive setup for a complete pipeline",
        owner: "Product: Pipelines",
        status: "open beta"
      },
      args: {
        name: {
          describe: "Pipeline name",
          type: "string"
        }
      },
      async handler(args, { config }) {
        await requireAuth(config);
        logger.log("Cloudflare Pipelines Setup\n");
        try {
          const setupConfig = await setupPipelineNaming(args.name);
          await setupStreamConfiguration(setupConfig);
          await setupSinkConfiguration(config, setupConfig);
          const created = await reviewAndCreateStreamSink(config, setupConfig);
          await setupSQLTransformationWithValidation(config, setupConfig);
          await createPipelineIfNeeded(config, setupConfig, created, args);
        } catch (error2) {
          if (error2 instanceof UserError) {
            throw error2;
          }
          throw new UserError(
            `Setup failed: ${error2 instanceof Error ? error2.message : String(error2)}`
          );
        }
      }
    });
    __name(setupPipelineNaming, "setupPipelineNaming");
    __name(setupStreamConfiguration, "setupStreamConfiguration");
    __name(setupSchemaConfiguration, "setupSchemaConfiguration");
    __name(buildSchemaInteractively, "buildSchemaInteractively");
    __name(buildField, "buildField");
    __name(loadSchemaFromFile, "loadSchemaFromFile");
    __name(loadSqlFromFile, "loadSqlFromFile");
    __name(setupSinkConfiguration, "setupSinkConfiguration");
    __name(setupSimpleR2Sink, "setupSimpleR2Sink");
    __name(setupSimpleDataCatalogSink, "setupSimpleDataCatalogSink");
    __name(setupR2Sink, "setupR2Sink");
    __name(setupDataCatalogSink, "setupDataCatalogSink");
    __name(setupSQLTransformationWithValidation, "setupSQLTransformationWithValidation");
    __name(promptMultiline, "promptMultiline");
    __name(reviewAndCreateStreamSink, "reviewAndCreateStreamSink");
    __name(createPipelineIfNeeded, "createPipelineIfNeeded");
  }
});

// src/pipelines/cli/sinks/index.ts
var pipelinesSinksNamespace;
var init_sinks = __esm({
  "src/pipelines/cli/sinks/index.ts"() {
    init_import_meta_url();
    init_create_command();
    pipelinesSinksNamespace = createNamespace({
      metadata: {
        description: "Manage sinks for pipelines",
        owner: "Product: Pipelines",
        status: "open beta"
      }
    });
  }
});

// src/pipelines/cli/sinks/utils.ts
function displaySinkConfiguration(sink, title = "Configuration", options = {}) {
  const { includeTimestamps = true } = options;
  if (title) {
    logger.log(`
${title}:`);
  }
  const general = {
    Type: sink.type === "r2" ? "R2" : "R2 Data Catalog"
  };
  if (includeTimestamps) {
    if (sink.created_at) {
      general["Created At"] = new Date(sink.created_at).toLocaleString();
    }
    if (sink.modified_at) {
      general["Modified At"] = new Date(sink.modified_at).toLocaleString();
    }
  }
  const destination = {
    Bucket: sink.config.bucket
  };
  if (sink.type === "r2") {
    destination.Path = sink.config.path || "(root)";
    destination.Partitioning = sink.config.partitioning?.time_pattern || SINK_DEFAULTS.r2.partitioning.time_pattern;
  }
  if (sink.type === "r2_data_catalog" && sink.config.namespace && sink.config.table_name) {
    destination.Table = `${sink.config.namespace}.${sink.config.table_name}`;
  }
  const fileSizeBytes = sink.config.rolling_policy?.file_size_bytes ?? SINK_DEFAULTS.rolling_policy.file_size_bytes;
  const intervalSeconds = sink.config.rolling_policy?.interval_seconds ?? SINK_DEFAULTS.rolling_policy.interval_seconds;
  const batching = {
    "File Size": fileSizeBytes === void 0 || fileSizeBytes === 0 ? "none" : `${Math.round(fileSizeBytes / (1024 * 1024))}MB`,
    "Time Interval": `${intervalSeconds}s`
  };
  const format11 = {
    Type: sink.format.type
  };
  if (sink.format.type === "parquet") {
    const defaultParquet = SINK_DEFAULTS.format.type === "parquet" ? SINK_DEFAULTS.format : null;
    if (defaultParquet) {
      const compression = sink.format.compression || defaultParquet.compression;
      if (compression) {
        format11.Compression = compression;
      }
      const rowGroupBytes = sink.format.row_group_bytes ?? defaultParquet.row_group_bytes;
      if (rowGroupBytes !== void 0) {
        format11["Target Row Group Size"] = `${Math.round(rowGroupBytes / (1024 * 1024))}MB`;
      }
    } else {
      if (sink.format.compression) {
        format11.Compression = sink.format.compression;
      }
      if (sink.format.row_group_bytes !== void 0) {
        format11["Target Row Group Size"] = `${Math.round(sink.format.row_group_bytes / (1024 * 1024))}MB`;
      }
    }
  }
  logger.log("General:");
  logger.log(formatLabelledValues(general, { indentationCount: 2 }));
  logger.log("\nDestination:");
  logger.log(formatLabelledValues(destination, { indentationCount: 2 }));
  logger.log("\nBatching:");
  logger.log(formatLabelledValues(batching, { indentationCount: 2 }));
  logger.log("\nFormat:");
  logger.log(formatLabelledValues(format11, { indentationCount: 2 }));
}
var init_utils18 = __esm({
  "src/pipelines/cli/sinks/utils.ts"() {
    init_import_meta_url();
    init_logger();
    init_render_labelled_values();
    init_defaults();
    __name(displaySinkConfiguration, "displaySinkConfiguration");
  }
});

// src/pipelines/cli/sinks/create.ts
function parseSinkType(type) {
  if (type === "r2" || type === "r2-data-catalog") {
    return type === "r2-data-catalog" ? "r2_data_catalog" : "r2";
  }
  throw new UserError(
    `Invalid sink type: ${type}. Must be 'r2' or 'r2-data-catalog'`
  );
}
var pipelinesSinksCreateCommand;
var init_create10 = __esm({
  "src/pipelines/cli/sinks/create.ts"() {
    init_import_meta_url();
    init_dist();
    init_create_command();
    init_logger();
    init_user3();
    init_client10();
    init_defaults();
    init_pipelines2();
    init_validate5();
    init_utils18();
    __name(parseSinkType, "parseSinkType");
    pipelinesSinksCreateCommand = createCommand({
      metadata: {
        description: "Create a new sink",
        owner: "Product: Pipelines",
        status: "open beta"
      },
      positionalArgs: ["sink"],
      args: {
        sink: {
          describe: "The name of the sink to create",
          type: "string",
          demandOption: true
        },
        type: {
          describe: "The type of sink to create",
          type: "string",
          choices: ["r2", "r2-data-catalog"],
          demandOption: true
        },
        bucket: {
          describe: "R2 bucket name",
          type: "string",
          demandOption: true
        },
        format: {
          describe: "Output format",
          type: "string",
          choices: ["json", "parquet"],
          default: SINK_DEFAULTS.format.type
        },
        compression: {
          describe: "Compression method (parquet only)",
          type: "string",
          choices: ["uncompressed", "snappy", "gzip", "zstd", "lz4"],
          default: SINK_DEFAULTS.format.compression
        },
        "target-row-group-size": {
          describe: "Target row group size for parquet format",
          type: "string"
        },
        path: {
          describe: "The base prefix in your bucket where data will be written",
          type: "string"
        },
        partitioning: {
          describe: "Time partition pattern (r2 sinks only)",
          type: "string"
        },
        "roll-size": {
          describe: "Roll file size in MB",
          type: "number"
        },
        "roll-interval": {
          describe: "Roll file interval in seconds",
          type: "number",
          default: SINK_DEFAULTS.rolling_policy.interval_seconds
        },
        "access-key-id": {
          describe: "R2 access key ID (leave empty for R2 credentials to be automatically created)",
          type: "string",
          implies: "secret-access-key"
        },
        "secret-access-key": {
          describe: "R2 secret access key (leave empty for R2 credentials to be automatically created)",
          type: "string",
          implies: "access-key-id"
        },
        namespace: {
          describe: "Data catalog namespace (required for r2-data-catalog)",
          type: "string"
        },
        table: {
          describe: "Table name within namespace (required for r2-data-catalog)",
          type: "string"
        },
        "catalog-token": {
          describe: "Authentication token for data catalog (required for r2-data-catalog)",
          type: "string"
        }
      },
      validateArgs: /* @__PURE__ */ __name((args) => {
        validateEntityName("sink", args.sink);
        const sinkType = parseSinkType(args.type);
        if (!isValidR2BucketName(args.bucket)) {
          throw new CommandLineArgsError(
            `The bucket name "${args.bucket}" is invalid. ${bucketFormatMessage}`
          );
        }
        if (sinkType === "r2_data_catalog") {
          if (!args.namespace) {
            throw new CommandLineArgsError(
              "--namespace is required for r2-data-catalog sinks"
            );
          }
          if (!args.table) {
            throw new CommandLineArgsError(
              "--table is required for r2-data-catalog sinks"
            );
          }
          if (!args.catalogToken) {
            throw new CommandLineArgsError(
              "--catalog-token is required for r2-data-catalog sinks"
            );
          }
          if (args.format === "json") {
            throw new CommandLineArgsError(
              "r2-data-catalog sinks only support parquet format, not JSON"
            );
          }
        }
      }, "validateArgs"),
      async handler(args, { config }) {
        const accountId = await requireAuth(config);
        const sinkName = args.sink;
        const sinkType = parseSinkType(args.type);
        const sinkConfig = {
          name: sinkName,
          type: sinkType,
          config: {
            bucket: args.bucket
          }
        };
        if (args.format || args.compression || args.targetRowGroupSize) {
          let formatConfig;
          if (args.format === "json") {
            formatConfig = { type: "json" };
          } else {
            formatConfig = {
              type: "parquet",
              ...args.compression && {
                compression: args.compression
              },
              ...args.targetRowGroupSize && {
                row_group_bytes: parseInt(args.targetRowGroupSize.replace(/MB$/i, "")) * 1024 * 1024
              }
            };
          }
          sinkConfig.format = formatConfig;
        }
        if (args.path) {
          sinkConfig.config.path = args.path;
        }
        if (args.partitioning && sinkType === "r2") {
          sinkConfig.config.partitioning = {
            time_pattern: args.partitioning
          };
        }
        if (args.rollSize || args.rollInterval) {
          let file_size_bytes = SINK_DEFAULTS.rolling_policy.file_size_bytes;
          let interval_seconds = SINK_DEFAULTS.rolling_policy.interval_seconds;
          if (args.rollSize) {
            file_size_bytes = args.rollSize * 1024 * 1024;
          }
          if (args.rollInterval) {
            interval_seconds = args.rollInterval;
          }
          sinkConfig.config.rolling_policy = {
            ...file_size_bytes !== void 0 && { file_size_bytes },
            interval_seconds
          };
        }
        if (sinkType === "r2") {
          if (args.accessKeyId && args.secretAccessKey) {
            sinkConfig.config.credentials = {
              access_key_id: args.accessKeyId,
              secret_access_key: args.secretAccessKey
            };
          } else {
            const auth = await authorizeR2Bucket(
              config,
              sinkName,
              accountId,
              args.bucket
            );
            sinkConfig.config.credentials = {
              access_key_id: auth.accessKeyId,
              secret_access_key: auth.secretAccessKey
            };
          }
        }
        if (sinkType === "r2_data_catalog") {
          sinkConfig.config.namespace = args.namespace;
          sinkConfig.config.table_name = args.table;
          sinkConfig.config.token = args.catalogToken;
        }
        logger.log(`\u{1F300} Creating sink '${sinkName}'...`);
        let sink;
        try {
          sink = await createSink(config, sinkConfig);
        } catch (error2) {
          let errorMessage = "Unknown error occurred";
          if (error2 && typeof error2 === "object") {
            const errorObj = error2;
            if (errorObj.notes && Array.isArray(errorObj.notes) && errorObj.notes[0]?.text) {
              errorMessage = errorObj.notes[0].text;
            } else if (error2 instanceof Error) {
              errorMessage = error2.message;
            }
          }
          throw new UserError(
            `Failed to create sink '${sinkName}': ${errorMessage}`
          );
        }
        logger.log(
          `\u2728 Successfully created sink '${sink.name}' with id '${sink.id}'.`
        );
        const sinkWithDefaults = applyDefaultsToSink(sink);
        displaySinkConfiguration(sinkWithDefaults, "Creation Summary", {
          includeTimestamps: false
        });
      }
    });
  }
});

// src/pipelines/cli/sinks/delete.ts
var pipelinesSinksDeleteCommand;
var init_delete9 = __esm({
  "src/pipelines/cli/sinks/delete.ts"() {
    init_import_meta_url();
    init_create_command();
    init_dialogs();
    init_logger();
    init_user3();
    init_client10();
    pipelinesSinksDeleteCommand = createCommand({
      metadata: {
        description: "Delete a sink",
        owner: "Product: Pipelines",
        status: "open beta"
      },
      positionalArgs: ["sink"],
      args: {
        sink: {
          describe: "The ID of the sink to delete",
          type: "string",
          demandOption: true
        },
        force: {
          describe: "Skip confirmation",
          type: "boolean",
          alias: "y",
          default: false
        }
      },
      async handler(args, { config }) {
        await requireAuth(config);
        const sink = await getSink(config, args.sink);
        if (!args.force) {
          const confirmedDelete = await confirm(
            `Are you sure you want to delete the sink '${sink.name}' (${args.sink})?`,
            { fallbackValue: false }
          );
          if (!confirmedDelete) {
            logger.log("Delete cancelled.");
            return;
          }
        }
        await deleteSink(config, args.sink);
        logger.log(
          `\u2728 Successfully deleted sink '${sink.name}' with id '${sink.id}'.`
        );
      }
    });
  }
});

// src/pipelines/cli/sinks/get.ts
var pipelinesSinksGetCommand;
var init_get6 = __esm({
  "src/pipelines/cli/sinks/get.ts"() {
    init_import_meta_url();
    init_create_command();
    init_logger();
    init_user3();
    init_render_labelled_values();
    init_client10();
    init_defaults();
    init_utils18();
    pipelinesSinksGetCommand = createCommand({
      metadata: {
        description: "Get details about a specific sink",
        owner: "Product: Pipelines",
        status: "open beta"
      },
      behaviour: {
        printBanner: /* @__PURE__ */ __name((args) => !args.json, "printBanner")
      },
      positionalArgs: ["sink"],
      args: {
        sink: {
          describe: "The ID of the sink to retrieve",
          type: "string",
          demandOption: true
        },
        json: {
          describe: "Output in JSON format",
          type: "boolean",
          default: false
        }
      },
      async handler(args, { config }) {
        await requireAuth(config);
        const rawSink = await getSink(config, args.sink);
        if (args.json) {
          logger.json(rawSink);
          return;
        }
        const sink = applyDefaultsToSink(rawSink);
        logger.log(
          formatLabelledValues({
            ID: sink.id,
            Name: sink.name
          })
        );
        displaySinkConfiguration(sink, "", { includeTimestamps: true });
      }
    });
  }
});

// src/pipelines/cli/sinks/list.ts
var pipelinesSinksListCommand;
var init_list13 = __esm({
  "src/pipelines/cli/sinks/list.ts"() {
    init_import_meta_url();
    init_create_command();
    init_logger();
    init_user3();
    init_client10();
    pipelinesSinksListCommand = createCommand({
      metadata: {
        description: "List all sinks",
        owner: "Product: Pipelines",
        status: "open beta"
      },
      behaviour: {
        printBanner: /* @__PURE__ */ __name((args) => !args.json, "printBanner")
      },
      args: {
        page: {
          describe: "Page number for pagination",
          type: "number",
          default: 1
        },
        "per-page": {
          describe: "Number of sinks per page",
          type: "number",
          default: 20
        },
        "pipeline-id": {
          describe: "Filter sinks by pipeline ID",
          type: "string"
        },
        json: {
          describe: "Output in JSON format",
          type: "boolean",
          default: false
        }
      },
      async handler(args, { config }) {
        await requireAuth(config);
        const sinks = await listSinks(config, {
          page: args.page,
          per_page: args.perPage,
          pipeline_id: args.pipelineId
        });
        if (args.json) {
          logger.log(sinks);
          return;
        }
        if (!sinks || sinks.length === 0) {
          logger.log("No sinks found.");
          return;
        }
        logger.table(
          sinks.map((sink) => ({
            Name: sink.name,
            ID: sink.id,
            Type: sink.type === "r2" ? "R2" : "R2 Data Catalog",
            Destination: sink.type === "r2" ? sink.config.bucket : `${sink.config.namespace}.${sink.config.table_name}`,
            Created: sink.created_at ? new Date(sink.created_at).toLocaleDateString() : "N/A"
          }))
        );
      }
    });
  }
});

// src/pipelines/cli/streams/index.ts
var pipelinesStreamsNamespace;
var init_streams2 = __esm({
  "src/pipelines/cli/streams/index.ts"() {
    init_import_meta_url();
    init_create_command();
    pipelinesStreamsNamespace = createNamespace({
      metadata: {
        description: "Manage streams for pipelines",
        owner: "Product: Pipelines",
        status: "open beta"
      }
    });
  }
});
var pipelinesStreamsCreateCommand;
var init_create11 = __esm({
  "src/pipelines/cli/streams/create.ts"() {
    init_import_meta_url();
    init_dist();
    init_create_command();
    init_dialogs();
    init_logger();
    init_user3();
    init_client10();
    init_validate5();
    init_utils17();
    pipelinesStreamsCreateCommand = createCommand({
      metadata: {
        description: "Create a new stream",
        owner: "Product: Pipelines",
        status: "open beta"
      },
      positionalArgs: ["stream"],
      args: {
        stream: {
          describe: "The name of the stream to create",
          type: "string",
          demandOption: true
        },
        "schema-file": {
          describe: "Path to JSON file containing stream schema",
          type: "string"
        },
        "http-enabled": {
          describe: "Enable HTTP endpoint",
          type: "boolean",
          default: true
        },
        "http-auth": {
          describe: "Require authentication for HTTP endpoint",
          type: "boolean",
          default: true
        },
        "cors-origin": {
          describe: "CORS origin",
          type: "string",
          array: true
        }
      },
      validateArgs: /* @__PURE__ */ __name((args) => {
        validateEntityName("stream", args.stream);
      }, "validateArgs"),
      async handler(args, { config }) {
        await requireAuth(config);
        const streamName = args.stream;
        const corsOrigins = args.corsOrigin;
        let schema;
        if (args.schemaFile) {
          let schemaContent;
          let parsedSchema;
          try {
            schemaContent = fs29.readFileSync(args.schemaFile, "utf-8");
          } catch (error2) {
            throw new UserError(
              `Failed to read schema file '${args.schemaFile}': ${error2 instanceof Error ? error2.message : String(error2)}`
            );
          }
          try {
            parsedSchema = parseJSON(schemaContent, args.schemaFile);
          } catch (error2) {
            throw new UserError(
              `Failed to parse schema file '${args.schemaFile}': ${error2 instanceof Error ? error2.message : String(error2)}`
            );
          }
          if (!parsedSchema || !Array.isArray(parsedSchema.fields)) {
            throw new UserError("Schema file must contain a 'fields' array");
          }
          schema = parsedSchema;
        } else {
          const confirmNoSchema = await confirm(
            "No schema file provided. Do you want to create stream without a schema (unstructured JSON)?",
            { defaultValue: false }
          );
          if (!confirmNoSchema) {
            throw new UserError(
              "Stream creation cancelled. Please provide a schema file using --schema-file"
            );
          }
        }
        const streamConfig = {
          name: streamName,
          format: { type: "json", ...!schema && { unstructured: true } },
          http: {
            enabled: args.httpEnabled,
            authentication: args.httpAuth,
            ...args.httpEnabled && corsOrigins && corsOrigins.length > 0 && { cors: { origins: corsOrigins } }
          },
          worker_binding: {
            enabled: true
          },
          ...schema && { schema }
        };
        logger.log(`\u{1F300} Creating stream '${streamName}'...`);
        const stream2 = await createStream(config, streamConfig);
        logger.log(
          `\u2728 Successfully created stream '${stream2.name}' with id '${stream2.id}'.`
        );
        displayStreamConfiguration(stream2, "Creation Summary", {
          includeTimestamps: false
        });
      }
    });
  }
});

// src/pipelines/cli/streams/delete.ts
var pipelinesStreamsDeleteCommand;
var init_delete10 = __esm({
  "src/pipelines/cli/streams/delete.ts"() {
    init_import_meta_url();
    init_create_command();
    init_dialogs();
    init_logger();
    init_user3();
    init_client10();
    pipelinesStreamsDeleteCommand = createCommand({
      metadata: {
        description: "Delete a stream",
        owner: "Product: Pipelines",
        status: "open beta"
      },
      positionalArgs: ["stream"],
      args: {
        stream: {
          describe: "The ID of the stream to delete",
          type: "string",
          demandOption: true
        },
        force: {
          describe: "Skip confirmation",
          type: "boolean",
          alias: "y",
          default: false
        }
      },
      async handler(args, { config }) {
        await requireAuth(config);
        const stream2 = await getStream2(config, args.stream);
        if (!args.force) {
          const confirmedDelete = await confirm(
            `Are you sure you want to delete the stream '${stream2.name}' (${args.stream})?`,
            { fallbackValue: false }
          );
          if (!confirmedDelete) {
            logger.log("Delete cancelled.");
            return;
          }
        }
        await deleteStream(config, args.stream);
        logger.log(
          `\u2728 Successfully deleted stream '${stream2.name}' with id '${stream2.id}'.`
        );
      }
    });
  }
});

// src/pipelines/cli/streams/get.ts
var pipelinesStreamsGetCommand;
var init_get7 = __esm({
  "src/pipelines/cli/streams/get.ts"() {
    init_import_meta_url();
    init_create_command();
    init_logger();
    init_user3();
    init_client10();
    init_utils17();
    pipelinesStreamsGetCommand = createCommand({
      metadata: {
        description: "Get details about a specific stream",
        owner: "Product: Pipelines",
        status: "open beta"
      },
      behaviour: {
        printBanner: /* @__PURE__ */ __name((args) => !args.json, "printBanner")
      },
      positionalArgs: ["stream"],
      args: {
        stream: {
          describe: "The ID of the stream to retrieve",
          type: "string",
          demandOption: true
        },
        json: {
          describe: "Output in JSON format",
          type: "boolean",
          default: false
        }
      },
      async handler(args, { config }) {
        await requireAuth(config);
        const stream2 = await getStream2(config, args.stream);
        if (args.json) {
          logger.json(stream2);
          return;
        }
        logger.log(`Stream ID: ${stream2.id}`);
        displayStreamConfiguration(stream2, void 0, {
          includeTimestamps: true
        });
      }
    });
  }
});

// src/pipelines/cli/streams/list.ts
var pipelinesStreamsListCommand;
var init_list14 = __esm({
  "src/pipelines/cli/streams/list.ts"() {
    init_import_meta_url();
    init_create_command();
    init_logger();
    init_user3();
    init_client10();
    pipelinesStreamsListCommand = createCommand({
      metadata: {
        description: "List all streams",
        owner: "Product: Pipelines",
        status: "open beta"
      },
      behaviour: {
        printBanner: /* @__PURE__ */ __name((args) => !args.json, "printBanner")
      },
      args: {
        page: {
          describe: "Page number for pagination",
          type: "number",
          default: 1
        },
        "per-page": {
          describe: "Number of streams per page",
          type: "number",
          default: 20
        },
        "pipeline-id": {
          describe: "Filter streams by pipeline ID",
          type: "string"
        },
        json: {
          describe: "Output in JSON format",
          type: "boolean",
          default: false
        }
      },
      async handler(args, { config }) {
        await requireAuth(config);
        const streams = await listStreams(config, {
          page: args.page,
          per_page: args.perPage,
          pipeline_id: args.pipelineId
        });
        if (args.json) {
          logger.json(streams);
          return;
        }
        if (!streams || streams.length === 0) {
          logger.log("No streams found.");
          return;
        }
        logger.table(
          streams.map((stream2) => ({
            Name: stream2.name,
            ID: stream2.id,
            HTTP: stream2.http.enabled ? stream2.http.authentication ? "Yes (authenticated)" : "Yes (unauthenticated)" : "No",
            Created: new Date(stream2.created_at).toLocaleDateString()
          }))
        );
      }
    });
  }
});

// src/pipelines/cli/update.ts
var pipelinesUpdateCommand;
var init_update4 = __esm({
  "src/pipelines/cli/update.ts"() {
    init_import_meta_url();
    init_dist();
    init_create_command();
    init_user3();
    init_client10();
    init_validate5();
    init_legacy_helpers();
    pipelinesUpdateCommand = createCommand({
      metadata: {
        description: "Update a pipeline configuration (legacy pipelines only)",
        owner: "Product: Pipelines",
        status: "open beta"
      },
      positionalArgs: ["pipeline"],
      args: {
        pipeline: {
          describe: "The name of the legacy pipeline to update",
          type: "string",
          demandOption: true
        },
        source: {
          type: "array",
          describe: "Space separated list of allowed sources. Options are 'http' or 'worker'",
          group: "Source settings"
        },
        "require-http-auth": {
          type: "boolean",
          describe: "Require Cloudflare API Token for HTTPS endpoint authentication",
          group: "Source settings"
        },
        "cors-origins": {
          type: "array",
          describe: "CORS origin allowlist for HTTP endpoint (use * for any origin). Defaults to an empty array",
          demandOption: false,
          coerce: validateCorsOrigins,
          group: "Source settings"
        },
        "batch-max-mb": {
          type: "number",
          describe: "Maximum batch size in megabytes before flushing. Defaults to 100 MB if unset. Minimum: 1, Maximum: 100",
          demandOption: false,
          coerce: validateInRange("batch-max-mb", 1, 100),
          group: "Batch hints"
        },
        "batch-max-rows": {
          type: "number",
          describe: "Maximum number of rows per batch before flushing. Defaults to 10,000,000 if unset. Minimum: 100, Maximum: 10,000,000",
          demandOption: false,
          coerce: validateInRange("batch-max-rows", 100, 1e7),
          group: "Batch hints"
        },
        "batch-max-seconds": {
          type: "number",
          describe: "Maximum age of batch in seconds before flushing. Defaults to 300 if unset. Minimum: 1, Maximum: 300",
          demandOption: false,
          coerce: validateInRange("batch-max-seconds", 1, 300),
          group: "Batch hints"
        },
        "r2-bucket": {
          type: "string",
          describe: "Destination R2 bucket name",
          group: "Destination settings"
        },
        "r2-access-key-id": {
          type: "string",
          describe: "R2 service Access Key ID for authentication. Leave empty for OAuth confirmation.",
          demandOption: false,
          group: "Destination settings",
          implies: "r2-secret-access-key"
        },
        "r2-secret-access-key": {
          type: "string",
          describe: "R2 service Secret Access Key for authentication. Leave empty for OAuth confirmation.",
          demandOption: false,
          group: "Destination settings",
          implies: "r2-access-key-id"
        },
        "r2-prefix": {
          type: "string",
          describe: "Prefix for storing files in the destination bucket. Default is no prefix",
          demandOption: false,
          group: "Destination settings"
        },
        compression: {
          type: "string",
          describe: "Compression format for output files",
          choices: ["none", "gzip", "deflate"],
          demandOption: false,
          group: "Destination settings"
        },
        // Pipeline settings
        "shard-count": {
          type: "number",
          describe: "Number of shards for the pipeline. More shards handle higher request volume; fewer shards produce larger output files. Defaults to 2 if unset. Minimum: 1, Maximum: 15",
          demandOption: false,
          group: "Pipeline settings"
        }
      },
      async handler(args, { config }) {
        const accountId = await requireAuth(config);
        const pipelineId = args.pipeline;
        try {
          await getPipeline(config, pipelineId);
          throw new UserError(
            "Pipelines created with the V1 API cannot be updated. To modify your pipeline, delete and recreate it with your new SQL."
          );
        } catch (error2) {
          if (error2 instanceof APIError && (error2.code === 1e3 || error2.code === 2)) {
            try {
              return await updateLegacyPipeline(config, accountId, args);
            } catch (legacyError) {
              if (legacyError instanceof APIError && legacyError.code === 1e3) {
                throw new UserError(
                  `Pipeline "${pipelineId}" not found. The update command only works with legacy pipelines. Pipelines created with the V1 API cannot be updated and must be recreated to modify.`
                );
              }
              throw legacyError;
            }
          }
          if (!(error2 instanceof UserError)) {
            throw error2;
          }
          throw error2;
        }
      }
    });
  }
});

// src/deployment-bundle/esbuild-plugins/log-build-output.ts
function logBuildOutput(nodejsCompatMode, onStart, updateBundle) {
  let bundled = false;
  return {
    name: "log-build-output",
    setup(build5) {
      build5.onStart(() => {
        onStart?.();
      });
      build5.onEnd(async ({ errors, warnings }) => {
        if (!bundled) {
          bundled = true;
          if (warnings.length > 0) {
            logBuildWarnings(warnings);
          }
        } else {
          if (errors.length > 0) {
            logBuildFailure(errors, warnings);
            return;
          }
          if (warnings.length > 0) {
            logBuildWarnings(warnings);
          }
          await updateBundle?.();
        }
      });
    }
  };
}
var init_log_build_output = __esm({
  "src/deployment-bundle/esbuild-plugins/log-build-output.ts"() {
    init_import_meta_url();
    init_logger();
    __name(logBuildOutput, "logBuildOutput");
  }
});

// src/utils/box.ts
function stripAnsi4(str) {
  return str.replace(/\x1b\[[0-9;]*m/g, "");
}
function visibleLength(str) {
  return stripAnsi4(str).length;
}
function padToVisibleWidth(str, width) {
  const visible = visibleLength(str);
  return str + " ".repeat(Math.max(0, width - visible));
}
function drawBox(contentLines, options = {}) {
  const lines = [...contentLines, ...options.footerLines ?? []];
  const maxContentWidth = Math.max(...lines.map((line) => visibleLength(line)));
  const boxWidth = maxContentWidth + 4;
  const horizontalLine = BOX.horizontal.repeat(boxWidth - 2);
  const topBorder = `${BOX.topLeft}${horizontalLine}${BOX.topRight}`;
  const bottomBorder = options.connectToChild ? `${BOX.bottomLeft}${BOX.horizontal}${BOX.bottomLeftWithConnector}${BOX.horizontal.repeat(boxWidth - 4)}${BOX.bottomRight}` : `${BOX.bottomLeft}${horizontalLine}${BOX.bottomRight}`;
  const paddedLines = lines.map((line) => {
    const paddedContent = padToVisibleWidth(line, maxContentWidth);
    return `${BOX.vertical} ${paddedContent} ${BOX.vertical}`;
  });
  return [topBorder, ...paddedLines, bottomBorder].join("\n");
}
function drawConnectedChildBox(contentLines, options = {}) {
  const indent = options.indent ?? "  ";
  const lines = [...contentLines, ...options.footerLines ?? []];
  const maxContentWidth = Math.max(...lines.map((line) => visibleLength(line)));
  const boxWidth = maxContentWidth + 4;
  const horizontalLine = BOX.horizontal.repeat(boxWidth - 2);
  const topBorder = `${BOX.topLeft}${horizontalLine}${BOX.topRight}`;
  const bottomBorder = `${BOX.bottomLeft}${horizontalLine}${BOX.bottomRight}`;
  const paddedLines = lines.map((line) => {
    const paddedContent = padToVisibleWidth(line, maxContentWidth);
    return `${BOX.vertical} ${paddedContent} ${BOX.vertical}`;
  });
  const connectorIndex = options.connectorLineIndex ?? Math.floor(paddedLines.length / 2);
  const result = [];
  result.push(`${indent}${BOX.vertical}`);
  result.push(`${indent}${BOX.vertical} ${topBorder}`);
  paddedLines.forEach((line, index) => {
    if (index === connectorIndex) {
      result.push(
        `${indent}${BOX.bottomLeft}${BOX.horizontal}${BOX.connectorRight}${line.slice(1)}`
      );
    } else if (index < connectorIndex) {
      result.push(`${indent}${BOX.vertical} ${line}`);
    } else {
      result.push(`${indent}  ${line}`);
    }
  });
  result.push(`${indent}  ${bottomBorder}`);
  return result.join("\n");
}
var BOX;
var init_box = __esm({
  "src/utils/box.ts"() {
    init_import_meta_url();
    BOX = {
      topLeft: "\u256D",
      topRight: "\u256E",
      bottomLeft: "\u2570",
      bottomRight: "\u256F",
      horizontal: "\u2500",
      vertical: "\u2502",
      bottomLeftWithConnector: "\u252C",
      connectorRight: "\u2524"
    };
    __name(stripAnsi4, "stripAnsi");
    __name(visibleLength, "visibleLength");
    __name(padToVisibleWidth, "padToVisibleWidth");
    __name(drawBox, "drawBox");
    __name(drawConnectedChildBox, "drawConnectedChildBox");
  }
});

// src/preview/api.ts
async function getPreview(config, accountId, workerName, previewIdentifier) {
  return fetchResult(
    config,
    `/accounts/${accountId}/workers/workers/${workerName}/previews/${encodeURIComponent(
      previewIdentifier
    )}`
  );
}
async function createPreview(config, accountId, workerName, request4, options) {
  const queryParams = options?.ignoreDefaults ? new URLSearchParams({ ignore_defaults: "true" }) : void 0;
  return fetchResult(
    config,
    `/accounts/${accountId}/workers/workers/${workerName}/previews`,
    {
      method: "POST",
      headers: { "Content-Type": "application/json" },
      body: JSON.stringify(request4)
    },
    queryParams
  );
}
async function editPreview(config, accountId, workerName, previewIdentifier, request4, options) {
  const queryParams = options?.ignoreDefaults ? new URLSearchParams({ ignore_defaults: "true" }) : void 0;
  return fetchResult(
    config,
    `/accounts/${accountId}/workers/workers/${workerName}/previews/${encodeURIComponent(
      previewIdentifier
    )}`,
    {
      method: "PATCH",
      headers: { "Content-Type": "application/json" },
      body: JSON.stringify(request4)
    },
    queryParams
  );
}
async function deletePreview(config, accountId, workerName, previewIdentifier) {
  await fetchResult(
    config,
    `/accounts/${accountId}/workers/workers/${workerName}/previews/${encodeURIComponent(
      previewIdentifier
    )}`,
    {
      method: "DELETE"
    }
  );
}
async function getPreviewDeployment(config, accountId, workerName, previewIdentifier, deploymentIdentifier) {
  return fetchResult(
    config,
    `/accounts/${accountId}/workers/workers/${workerName}/previews/${encodeURIComponent(
      previewIdentifier
    )}/deployments/${encodeURIComponent(deploymentIdentifier)}`
  );
}
async function createPreviewDeployment(config, accountId, workerName, previewIdentifier, request4, options) {
  const queryParams = options?.ignoreDefaults ? new URLSearchParams({ ignore_defaults: "true" }) : void 0;
  return fetchResult(
    config,
    `/accounts/${accountId}/workers/workers/${workerName}/previews/${encodeURIComponent(
      previewIdentifier
    )}/deployments`,
    {
      method: "POST",
      headers: { "Content-Type": "application/json" },
      body: JSON.stringify(request4)
    },
    queryParams
  );
}
async function getWorkerPreviewDefaults(config, accountId, workerName) {
  const worker = await fetchResult(
    config,
    `/accounts/${accountId}/workers/workers/${workerName}`
  );
  return worker.preview_defaults ?? {};
}
async function editWorkerPreviewDefaults(config, accountId, workerName, previewDefaults) {
  const worker = await fetchResult(
    config,
    `/accounts/${accountId}/workers/workers/${workerName}`,
    {
      method: "PATCH",
      headers: { "Content-Type": "application/json" },
      body: JSON.stringify({ preview_defaults: previewDefaults })
    }
  );
  return worker.preview_defaults ?? {};
}
var init_api3 = __esm({
  "src/preview/api.ts"() {
    init_import_meta_url();
    init_cfetch();
    __name(getPreview, "getPreview");
    __name(createPreview, "createPreview");
    __name(editPreview, "editPreview");
    __name(deletePreview, "deletePreview");
    __name(getPreviewDeployment, "getPreviewDeployment");
    __name(createPreviewDeployment, "createPreviewDeployment");
    __name(getWorkerPreviewDefaults, "getWorkerPreviewDefaults");
    __name(editWorkerPreviewDefaults, "editWorkerPreviewDefaults");
  }
});
function getBranchName() {
  const workersCIBranch = getWorkersCIBranchName();
  if (workersCIBranch) {
    return workersCIBranch;
  }
  const githubBranch = process.env.GITHUB_HEAD_REF || process.env.GITHUB_REF_NAME;
  if (githubBranch) {
    return githubBranch;
  }
  const gitlabBranch = process.env.CI_COMMIT_REF_NAME;
  if (gitlabBranch) {
    return gitlabBranch;
  }
  try {
    childProcess.execSync(`git rev-parse --is-inside-work-tree`, { stdio: "ignore" });
    return childProcess.execSync(`git rev-parse --abbrev-ref HEAD`).toString().trim();
  } catch {
    return void 0;
  }
}
function shouldUseCIMetadataFallback() {
  return process.env.CI === "1" || process.env.CI === "true";
}
function getHeadCommitRef() {
  try {
    childProcess.execSync(`git rev-parse --is-inside-work-tree`, { stdio: "ignore" });
    return childProcess.execSync(`git rev-parse --short HEAD`).toString().trim();
  } catch {
    return void 0;
  }
}
function getHeadCommitMessage() {
  try {
    childProcess.execSync(`git rev-parse --is-inside-work-tree`, { stdio: "ignore" });
    return childProcess.execSync(`git log -1 --format=%B`).toString().trim();
  } catch {
    return void 0;
  }
}
function resolveWorkerName(args, config) {
  const workerName = args.workerName ?? args["worker-name"] ?? config.name;
  if (!workerName) {
    throw new UserError(
      `Required Worker name missing. Please specify the Worker name in your ${configFileName(
        config.configPath
      )} file, or pass it with --worker-name <worker-name>.`
    );
  }
  return workerName;
}
function getBindingValue(binding) {
  switch (binding.type) {
    case "plain_text":
      return `"${binding.text}"`;
    case "secret_text":
      return "********";
    case "kv_namespace":
      return String(binding.namespace_id ?? "");
    case "d1":
      return binding.database_name ?? String(binding.database_id ?? "");
    case "r2_bucket":
      return String(binding.bucket_name ?? "");
    case "service":
      return binding.entrypoint ? `${binding.service}#${binding.entrypoint}` : String(binding.service ?? "");
    case "durable_object_namespace":
      return binding.script_name ? `${binding.class_name} (${binding.script_name})` : String(binding.class_name ?? "");
    case "workflow":
      return binding.workflow_name ?? String(binding.class_name ?? "");
    case "queue":
      return String(binding.queue_name ?? "");
    case "vectorize":
      return String(binding.index_name ?? "");
    case "hyperdrive":
      return String(binding.id ?? "");
    case "analytics_engine":
      return String(binding.dataset ?? "");
    case "dispatch_namespace":
      return String(binding.namespace ?? "");
    case "mtls_certificate":
      return String(binding.certificate_id ?? "");
    case "pipelines":
      return String(binding.pipeline ?? "");
    case "secrets_store_secret":
      return binding.secret_name ? `${binding.store_id}/${binding.secret_name}` : String(binding.store_id ?? "");
    case "ratelimit":
      return String(binding.namespace_id ?? "");
    case "vpc_service":
      return String(binding.service_id ?? "");
    case "send_email":
      return String(binding.destination_address ?? "");
    default:
      return "";
  }
}
function extractConfigBindings(config) {
  const previews = config.previews;
  const env6 = {};
  const vars = previews?.vars ?? {};
  for (const [name2, value] of Object.entries(vars)) {
    env6[name2] = {
      type: "plain_text",
      text: typeof value === "string" ? value : JSON.stringify(value)
    };
  }
  for (const kv of previews?.kv_namespaces ?? []) {
    env6[kv.binding] = { type: "kv_namespace", namespace_id: kv.id };
  }
  for (const d1 of previews?.d1_databases ?? []) {
    env6[d1.binding] = {
      type: "d1",
      database_id: d1.database_id,
      database_name: d1.database_name
    };
  }
  for (const r22 of previews?.r2_buckets ?? []) {
    env6[r22.binding] = { type: "r2_bucket", bucket_name: r22.bucket_name };
  }
  for (const service of previews?.services ?? []) {
    env6[service.binding] = {
      type: "service",
      service: service.service,
      entrypoint: service.entrypoint
    };
  }
  for (const doBinding of previews?.durable_objects?.bindings ?? []) {
    env6[doBinding.name] = {
      type: "durable_object_namespace",
      class_name: doBinding.class_name,
      script_name: doBinding.script_name
    };
  }
  for (const workflow of previews?.workflows ?? []) {
    env6[workflow.binding] = {
      type: "workflow",
      workflow_name: workflow.name,
      class_name: workflow.class_name,
      script_name: workflow.script_name
    };
  }
  for (const email of previews?.send_email ?? []) {
    env6[email.name] = {
      type: "send_email",
      destination_address: email.destination_address,
      allowed_destination_addresses: email.allowed_destination_addresses,
      allowed_sender_addresses: email.allowed_sender_addresses
    };
  }
  for (const queue of previews?.queues?.producers ?? []) {
    env6[queue.binding] = {
      type: "queue",
      queue_name: queue.queue,
      delivery_delay: queue.delivery_delay
    };
  }
  for (const vectorize of previews?.vectorize ?? []) {
    env6[vectorize.binding] = {
      type: "vectorize",
      index_name: vectorize.index_name
    };
  }
  for (const hyperdrive of previews?.hyperdrive ?? []) {
    env6[hyperdrive.binding] = { type: "hyperdrive", id: hyperdrive.id };
  }
  for (const dataset of previews?.analytics_engine_datasets ?? []) {
    env6[dataset.binding] = {
      type: "analytics_engine",
      dataset: dataset.dataset
    };
  }
  for (const dispatch of previews?.dispatch_namespaces ?? []) {
    env6[dispatch.binding] = {
      type: "dispatch_namespace",
      namespace: dispatch.namespace,
      ...dispatch.outbound && {
        outbound: {
          worker: {
            service: dispatch.outbound.service,
            environment: dispatch.outbound.environment
          },
          params: dispatch.outbound.parameters?.map((parameter) => ({
            name: parameter
          }))
        }
      }
    };
  }
  for (const certificate of previews?.mtls_certificates ?? []) {
    env6[certificate.binding] = {
      type: "mtls_certificate",
      certificate_id: certificate.certificate_id
    };
  }
  for (const pipeline of previews?.pipelines ?? []) {
    env6[pipeline.binding] = { type: "pipelines", pipeline: pipeline.pipeline };
  }
  for (const secret of previews?.secrets_store_secrets ?? []) {
    env6[secret.binding] = {
      type: "secrets_store_secret",
      store_id: secret.store_id,
      secret_name: secret.secret_name
    };
  }
  for (const ratelimit of previews?.ratelimits ?? []) {
    env6[ratelimit.name] = {
      type: "ratelimit",
      namespace_id: ratelimit.namespace_id,
      simple: ratelimit.simple
    };
  }
  for (const loader of previews?.worker_loaders ?? []) {
    env6[loader.binding] = { type: "worker_loader" };
  }
  for (const vpc of previews?.vpc_services ?? []) {
    env6[vpc.binding] = { type: "vpc_service", service_id: vpc.service_id };
  }
  if (previews?.browser) {
    env6[previews.browser.binding] = { type: "browser" };
  }
  if (previews?.ai) {
    env6[previews.ai.binding] = { type: "ai", staging: previews.ai.staging };
  }
  if (previews?.images) {
    env6[previews.images.binding] = { type: "images" };
  }
  if (previews?.stream) {
    env6[previews.stream.binding] = { type: "stream" };
  }
  if (previews?.media) {
    env6[previews.media.binding] = { type: "media" };
  }
  if (previews?.version_metadata) {
    env6[previews.version_metadata.binding] = { type: "version_metadata" };
  }
  return env6;
}
function assemblePreviewScriptSettings(config) {
  const previews = config.previews;
  const result = {};
  const observability = previews?.observability ?? config.observability;
  if (observability !== void 0) {
    result.observability = observability;
  }
  const logpush = previews?.logpush ?? config.logpush;
  if (logpush !== void 0) {
    result.logpush = logpush;
  }
  if (previews?.tail_consumers !== void 0) {
    result.tail_consumers = previews.tail_consumers.map((tc) => ({
      name: tc.service
    }));
  }
  return result;
}
function assemblePreviewDefaults(config) {
  const previews = config.previews;
  const previewDefaults = {
    ...assemblePreviewScriptSettings(config)
  };
  const previewEnv = extractConfigBindings(config);
  if (Object.keys(previewEnv).length > 0) {
    previewDefaults.env = previewEnv;
  }
  if (previews?.limits || config.limits) {
    previewDefaults.limits = previews?.limits ?? config.limits;
  }
  if (config.placement) {
    previewDefaults.placement = parseConfigPlacement(config);
  }
  return previewDefaults;
}
var init_shared6 = __esm({
  "src/preview/shared.ts"() {
    init_import_meta_url();
    init_dist();
    init_placement();
    __name(getBranchName, "getBranchName");
    __name(shouldUseCIMetadataFallback, "shouldUseCIMetadataFallback");
    __name(getHeadCommitRef, "getHeadCommitRef");
    __name(getHeadCommitMessage, "getHeadCommitMessage");
    __name(resolveWorkerName, "resolveWorkerName");
    __name(getBindingValue, "getBindingValue");
    __name(extractConfigBindings, "extractConfigBindings");
    __name(assemblePreviewScriptSettings, "assemblePreviewScriptSettings");
    __name(assemblePreviewDefaults, "assemblePreviewDefaults");
  }
});
function toBase642(content) {
  return Buffer.from(content).toString("base64");
}
function getPreviewMigrationsToUpload(workerName, config, currentMigrationTag) {
  if (config.migrations.length === 0) {
    return void 0;
  }
  if (currentMigrationTag) {
    const foundIndex = config.migrations.findIndex(
      (migration) => migration.tag === currentMigrationTag
    );
    if (foundIndex === -1) {
      logger.warn(
        `The published preview for ${workerName} has a migration tag "${currentMigrationTag}", which was not found in your ${configFileName(
          config.configPath
        )} file. You may have already deleted it. Applying all available migrations to the preview...`
      );
      return {
        old_tag: currentMigrationTag,
        new_tag: config.migrations[config.migrations.length - 1].tag,
        steps: config.migrations.map(({ tag: _tag, ...rest }) => rest)
      };
    }
    if (foundIndex !== config.migrations.length - 1) {
      return {
        old_tag: currentMigrationTag,
        new_tag: config.migrations[config.migrations.length - 1].tag,
        steps: config.migrations.slice(foundIndex + 1).map(({ tag: _tag, ...rest }) => rest)
      };
    }
    return void 0;
  }
  return {
    new_tag: config.migrations[config.migrations.length - 1].tag,
    steps: config.migrations.map(({ tag: _tag, ...rest }) => rest)
  };
}
async function getDeploymentModules(config, scriptPath4, assetFiles) {
  const entry = await getEntry({ script: scriptPath4 }, config, "deploy");
  const entryDirectory = path3__namespace.default.dirname(entry.file);
  const moduleCollector = createModuleCollector({
    wrangler1xLegacyModuleReferences: getWrangler1xLegacyModuleReferences(
      entryDirectory,
      entry.file
    ),
    entry,
    findAdditionalModules: config.find_additional_modules ?? false,
    rules: getRules(config),
    preserveFileNames: config.preserve_file_names ?? false
  });
  const compatibilityDate = config.compatibility_date;
  const compatibilityFlags = config.compatibility_flags;
  const nodejsCompatMode = validateNodeCompatMode(
    compatibilityDate,
    compatibilityFlags,
    { noBundle: config.no_bundle }
  );
  const destination = path3__namespace.default.join(os11.tmpdir(), `wrangler-preview-${Date.now()}`);
  const bundleResult = config.no_bundle ? await noBundleWorker(
    entry,
    getRules(config),
    destination,
    config.python_modules.exclude
  ) : await bundleWorker(entry, destination, {
    bundle: true,
    additionalModules: [],
    moduleCollector,
    doBindings: config.previews?.durable_objects?.bindings ?? [],
    workflowBindings: config.previews?.workflows ?? [],
    jsxFactory: config.jsx_factory,
    jsxFragment: config.jsx_fragment,
    tsconfig: config.tsconfig,
    minify: config.minify,
    keepNames: config.keep_names ?? true,
    sourcemap: config.upload_source_maps ?? false,
    nodejsCompatMode,
    compatibilityDate,
    compatibilityFlags,
    alias: config.alias,
    define: config.previews?.define ?? {},
    checkFetch: false,
    targetConsumer: "deploy",
    watch: void 0,
    testScheduled: void 0,
    inject: void 0,
    plugins: [logBuildOutput()],
    isOutfile: void 0,
    local: false,
    projectRoot: config.userConfigPath !== void 0 ? path3__namespace.default.dirname(config.userConfigPath) : void 0,
    defineNavigatorUserAgent: isNavigatorDefined(
      compatibilityDate,
      compatibilityFlags
    ),
    external: void 0,
    entryName: void 0,
    metafile: void 0
  });
  const { modules, resolvedEntryPointPath, bundleType } = bundleResult;
  const mainModuleName = path3__namespace.default.basename(resolvedEntryPointPath);
  const mainModuleContent = fs29.readFileSync(resolvedEntryPointPath, "utf-8");
  const mainModule = {
    name: mainModuleName,
    filePath: resolvedEntryPointPath,
    content: mainModuleContent,
    type: bundleType
  };
  const mainContentType = moduleTypeMimeType[bundleType] ?? "application/octet-stream";
  const deploymentModules = [
    {
      name: mainModule.name,
      content_type: mainContentType,
      content_base64: toBase642(mainModule.content)
    },
    ...modules.map((mod) => {
      const contentType = moduleTypeMimeType[mod.type ?? "text"] ?? "application/octet-stream";
      return {
        name: mod.name,
        content_type: contentType,
        content_base64: toBase642(mod.content)
      };
    })
  ];
  if (config.upload_source_maps) {
    deploymentModules.push(
      ...loadSourceMaps(mainModule, modules, bundleResult).map((sourceMap) => ({
        name: sourceMap.name,
        content_type: "application/source-map",
        content_base64: toBase642(sourceMap.content)
      }))
    );
  }
  if (assetFiles?._headers !== void 0) {
    deploymentModules.push({
      name: "_headers",
      content_type: "text/plain",
      content_base64: toBase642(assetFiles._headers)
    });
  }
  if (assetFiles?._redirects !== void 0) {
    deploymentModules.push({
      name: "_redirects",
      content_type: "text/plain",
      content_base64: toBase642(assetFiles._redirects)
    });
  }
  return { main_module: mainModuleName, modules: deploymentModules };
}
async function assemblePreviewDeploymentSettings(config, scriptPath4, accountId, workerName, previewIdentifier, options) {
  const previews = config.previews;
  const request4 = {};
  const assetsOptions = getAssetsOptions(
    { assets: void 0, script: scriptPath4 },
    config
  );
  const deploymentModules = await getDeploymentModules(config, scriptPath4, {
    _headers: assetsOptions?._headers,
    _redirects: assetsOptions?._redirects
  });
  request4.main_module = deploymentModules.main_module;
  request4.modules = deploymentModules.modules;
  if (assetsOptions) {
    const assetsJwt = await syncAssets(
      config,
      accountId,
      assetsOptions.directory,
      workerName
    );
    request4.assets = {
      jwt: assetsJwt,
      config: {
        html_handling: assetsOptions.assetConfig.html_handling,
        not_found_handling: assetsOptions.assetConfig.not_found_handling,
        run_worker_first: assetsOptions.run_worker_first
      }
    };
  }
  if (config.compatibility_date) {
    request4.compatibility_date = config.compatibility_date;
  }
  if (config.compatibility_flags && config.compatibility_flags.length > 0) {
    request4.compatibility_flags = config.compatibility_flags;
  }
  if (options.message || options.tag) {
    request4.annotations = {
      ...options.message && { "workers/message": options.message },
      ...options.tag && { "workers/tag": options.tag }
    };
  }
  if (config.migrations.length > 0) {
    let latestDeploymentMigrationTag;
    try {
      const latestDeployment = await getPreviewDeployment(
        config,
        accountId,
        workerName,
        previewIdentifier,
        "latest"
      );
      latestDeploymentMigrationTag = latestDeployment.migration_tag;
    } catch (error2) {
      if (!(typeof error2 === "object" && error2 !== null && ("status" in error2 && error2.status === 404 || "code" in error2 && (error2.code === 10025 || error2.code === 10222)))) {
        throw error2;
      }
    }
    const migrations = getPreviewMigrationsToUpload(
      workerName,
      config,
      latestDeploymentMigrationTag
    );
    if (migrations) {
      request4.migrations = migrations;
    }
  }
  if (previews?.limits !== void 0) {
    request4.limits = previews.limits;
  } else if (config.limits !== void 0) {
    request4.limits = config.limits;
  }
  if (config.placement) {
    request4.placement = parseConfigPlacement(config);
  }
  const env6 = extractConfigBindings(config);
  if (Object.keys(env6).length > 0) {
    request4.env = env6;
  }
  return request4;
}
function buildMergedScriptLevel(config, preview) {
  const previews = config.previews;
  const result = {};
  const configHasObservability = previews?.observability !== void 0 || config.observability !== void 0;
  const configHasLogpush = previews?.logpush !== void 0 || config.logpush !== void 0;
  if (preview.observability !== void 0) {
    result.observability = {
      enabled: preview.observability.enabled,
      head_sampling_rate: preview.observability.head_sampling_rate,
      fromConfig: configHasObservability
    };
  }
  if (preview.logpush !== void 0) {
    result.logpush = {
      value: preview.logpush,
      fromConfig: configHasLogpush
    };
  }
  if (preview.tail_consumers && preview.tail_consumers.length > 0) {
    result.tail_consumers = preview.tail_consumers;
  }
  return result;
}
function buildMergedVersionLevel(config, deployment) {
  const previews = config.previews;
  const configBindingNames = new Set(
    Object.keys(extractConfigBindings(config))
  );
  const result = { env: {} };
  if (deployment.compatibility_date) {
    result.compatibility_date = {
      value: deployment.compatibility_date,
      fromConfig: !!config.compatibility_date
    };
  }
  if (deployment.compatibility_flags && deployment.compatibility_flags.length > 0) {
    result.compatibility_flags = {
      value: deployment.compatibility_flags,
      fromConfig: !!(config.compatibility_flags && config.compatibility_flags.length > 0)
    };
  }
  if (deployment.limits?.cpu_ms !== void 0 || deployment.limits?.subrequests !== void 0) {
    result.limits = {
      value: {
        ...deployment.limits?.cpu_ms !== void 0 && {
          cpu_ms: deployment.limits.cpu_ms
        },
        ...deployment.limits?.subrequests !== void 0 && {
          subrequests: deployment.limits.subrequests
        }
      },
      fromConfig: !!(previews?.limits !== void 0 || config.limits !== void 0)
    };
  }
  if (deployment.placement?.mode) {
    result.placement = {
      value: { mode: deployment.placement.mode },
      fromConfig: !!config.placement?.mode
    };
  }
  if (config.assets) {
    result.assets = {
      value: {
        directory: config.assets.directory,
        binding: config.assets.binding,
        html_handling: config.assets.html_handling,
        not_found_handling: config.assets.not_found_handling,
        run_worker_first: config.assets.run_worker_first
      },
      fromConfig: true
    };
  }
  for (const [name2, binding] of Object.entries(deployment.env ?? {})) {
    result.env[name2] = { ...binding, fromConfig: configBindingNames.has(name2) };
  }
  return result;
}
function getFriendlyBindingType(bindingType) {
  return getBindingTypeFriendlyName(
    bindingType
  );
}
function formatAlignedRows(rows, indent = "  ") {
  const labelWidth = Math.max(...rows.map(([label]) => label.length));
  const valueWidth = Math.max(...rows.map(([, value]) => value.length));
  return rows.map(([label, value, fromConfig]) => {
    const marker = fromConfig ? CONFIG_MARKER : " ";
    const coloredLabel = source_default.cyan(padToVisibleWidth(label, labelWidth));
    return `${indent}${coloredLabel}   ${padToVisibleWidth(
      value,
      valueWidth
    )}  ${marker}`;
  });
}
function formatBindings(env6, indent = "  ", options = {}) {
  const showSourceMarker = options.showSourceMarker ?? true;
  const entries2 = Object.entries(env6);
  if (entries2.length === 0) {
    return [`${indent}${source_default.dim("(none)")}`];
  }
  const nameWidth = Math.max(...entries2.map(([name2]) => name2.length));
  const typeWidth = Math.max(
    ...entries2.map(
      ([, binding]) => visibleLength(getFriendlyBindingType(binding.type))
    )
  );
  const valueWidth = Math.max(
    ...entries2.map(([, binding]) => getBindingValue(binding).length)
  );
  return entries2.map(([name2, binding]) => {
    const value = getBindingValue(binding);
    const friendlyType = getFriendlyBindingType(binding.type);
    const coloredName = source_default.cyan(padToVisibleWidth(name2, nameWidth));
    const dimType = source_default.dim(padToVisibleWidth(friendlyType, typeWidth));
    if (showSourceMarker) {
      const marker = binding.fromConfig ? CONFIG_MARKER : " ";
      return `${indent}${coloredName}   ${dimType}   ${padToVisibleWidth(
        value,
        valueWidth
      )}  ${marker}`;
    }
    return `${indent}${coloredName}   ${dimType}   ${padToVisibleWidth(
      value,
      valueWidth
    )}`;
  });
}
function formatPreviewResource(preview, scriptLevel, isNew, configName) {
  const statusLabel = isNew ? source_default.green("(new)") : source_default.dim("(updated)");
  const obsEnabled = scriptLevel.observability?.enabled ?? false;
  const obsRate = scriptLevel.observability?.head_sampling_rate;
  const formattedRate = obsRate !== void 0 ? obsRate.toFixed(1) : void 0;
  const obsValue = obsEnabled ? `enabled${formattedRate !== void 0 ? `, ${formattedRate} sampling` : ""}` : "disabled";
  const lines = [
    `${source_default.bold("Preview:")} ${preview.name} ${statusLabel}`,
    "",
    ...(preview.urls ?? []).map((url4) => `  ${source_default.bold.underline(url4)}`)
  ];
  const settingsRows = [];
  if (scriptLevel.observability !== void 0) {
    settingsRows.push([
      "observability",
      obsValue,
      scriptLevel.observability.fromConfig
    ]);
  }
  if (scriptLevel.logpush !== void 0) {
    settingsRows.push([
      "logpush",
      scriptLevel.logpush.value ? "enabled" : "disabled",
      scriptLevel.logpush.fromConfig
    ]);
  }
  if (scriptLevel.tail_consumers && scriptLevel.tail_consumers.length > 0) {
    settingsRows.push([
      "tail_consumers",
      scriptLevel.tail_consumers.map((tc) => tc.name).join(", "),
      false
    ]);
  }
  if (settingsRows.length > 0) {
    lines.push("");
    lines.push(...formatAlignedRows(settingsRows));
  }
  const hasConfigValues = settingsRows.some(([, , fromConfig]) => fromConfig);
  const footerLines = hasConfigValues ? ["", source_default.hex("#FFA500")(`\u25C6 from ${configName}`)] : void 0;
  return drawBox(lines, { footerLines, connectToChild: true });
}
function formatDeploymentResource(deployment, versionLevel, configName) {
  const lines = [
    `${source_default.bold("Deployment:")} ${deployment.id}`,
    "",
    ...(deployment.urls ?? []).map((url4) => `  ${source_default.bold.underline(url4)}`)
  ];
  const settingsRows = [];
  if (versionLevel.compatibility_date) {
    settingsRows.push([
      "compatibility_date",
      versionLevel.compatibility_date.value,
      versionLevel.compatibility_date.fromConfig
    ]);
  }
  if (versionLevel.compatibility_flags) {
    settingsRows.push([
      "compatibility_flags",
      versionLevel.compatibility_flags.value.join(", "),
      versionLevel.compatibility_flags.fromConfig
    ]);
  }
  if (versionLevel.limits?.value?.cpu_ms !== void 0 || versionLevel.limits?.value?.subrequests !== void 0) {
    const limitParts = [
      versionLevel.limits?.value?.cpu_ms !== void 0 ? `cpu_ms: ${versionLevel.limits.value.cpu_ms}` : void 0,
      versionLevel.limits?.value?.subrequests !== void 0 ? `subrequests: ${versionLevel.limits.value.subrequests}` : void 0
    ].filter((value) => value !== void 0);
    settingsRows.push([
      "limits",
      limitParts.join(", "),
      versionLevel.limits.fromConfig
    ]);
  }
  if (versionLevel.placement) {
    settingsRows.push([
      "placement",
      versionLevel.placement.value.mode,
      versionLevel.placement.fromConfig
    ]);
  }
  if (settingsRows.length > 0) {
    lines.push("");
    lines.push(...formatAlignedRows(settingsRows));
  }
  if (versionLevel.assets) {
    lines.push("");
    lines.push(source_default.bold("  Assets"));
    const assetsRows = [];
    const assets = versionLevel.assets.value;
    const fromConfig = versionLevel.assets.fromConfig;
    if (assets.directory) {
      assetsRows.push(["directory", assets.directory, fromConfig]);
    }
    if (assets.binding) {
      assetsRows.push(["binding", assets.binding, fromConfig]);
    }
    if (assets.html_handling) {
      assetsRows.push(["html_handling", assets.html_handling, fromConfig]);
    }
    if (assets.not_found_handling) {
      assetsRows.push([
        "not_found_handling",
        assets.not_found_handling,
        fromConfig
      ]);
    }
    if (assets.run_worker_first !== void 0) {
      const value = typeof assets.run_worker_first === "boolean" ? String(assets.run_worker_first) : assets.run_worker_first.join(", ");
      assetsRows.push(["run_worker_first", value, fromConfig]);
    }
    lines.push(...formatAlignedRows(assetsRows, "  "));
  }
  lines.push("");
  lines.push(source_default.bold("  Bindings"));
  lines.push(...formatBindings(versionLevel.env));
  const hasConfigValues = settingsRows.some(([, , fromConfig]) => fromConfig) || versionLevel.assets?.fromConfig || Object.values(versionLevel.env).some((binding) => binding.fromConfig);
  const footerLines = hasConfigValues ? ["", source_default.hex("#FFA500")(`\u25C6 from ${configName}`)] : void 0;
  return drawConnectedChildBox(lines, { footerLines, indent: "  " });
}
function logMissingPreviewsBindingsWarning(topLevelBindings, remotePreviewDefaultBindings, localPreviewBindings) {
  const availableBindingNames = /* @__PURE__ */ new Set([
    ...Object.keys(remotePreviewDefaultBindings ?? {}),
    ...Object.keys(localPreviewBindings)
  ]);
  const missingBindings = Object.fromEntries(
    Object.entries(topLevelBindings ?? {}).filter(
      ([name2]) => !availableBindingNames.has(name2)
    )
  );
  if (Object.keys(missingBindings).length === 0) {
    return;
  }
  logger.warn(`Your configuration has diverged.
The following bindings are configured at the top level of your Wrangler config file, but are missing from the Previews settings of your Worker.

${Object.entries(missingBindings).map(
    ([name2, binding]) => `  ${source_default.cyan(name2)}  ${source_default.dim(getBindingTypeFriendlyName(binding.type))}`
  ).join("\n")}

Either include these bindings in the ${source_default.cyan(`"previews"`)} field of your Wrangler config or update the Previews settings of your Worker in the Cloudflare dashboard.`);
}
async function handlePreviewCommand(args, { config }) {
  const workerName = resolveWorkerName(args, config);
  let previewName = args.name;
  if (!previewName) {
    previewName = getBranchName();
    if (!previewName) {
      throw new UserError(
        "Could not determine Preview name. No git branch detected. Please provide a Preview name using --name <preview-name>."
      );
    }
  }
  const previewIdentifier = previewName;
  const ignoreDefaults = args.ignoreDefaults;
  const fallbackTag = !args.tag && shouldUseCIMetadataFallback() ? getHeadCommitRef() : void 0;
  const fallbackMessage = !args.message && shouldUseCIMetadataFallback() ? getHeadCommitMessage() : void 0;
  const accountId = await requireAuth(config);
  let existingPreview = null;
  try {
    existingPreview = await getPreview(
      config,
      accountId,
      workerName,
      previewIdentifier
    );
  } catch (e10) {
    if (!(e10 instanceof Error && "code" in e10 && e10.code === 10025)) {
      throw e10;
    }
  }
  const isNewPreview = !existingPreview;
  let preview;
  if (isNewPreview) {
    preview = await createPreview(
      config,
      accountId,
      workerName,
      { name: previewName, ...assemblePreviewScriptSettings(config) },
      { ignoreDefaults }
    );
  } else {
    const previewRequest = assemblePreviewScriptSettings(config);
    if (Object.keys(previewRequest).length > 0) {
      preview = await editPreview(
        config,
        accountId,
        workerName,
        previewIdentifier,
        previewRequest,
        { ignoreDefaults }
      );
    } else {
      preview = existingPreview;
    }
  }
  const deploymentRequest = await assemblePreviewDeploymentSettings(
    config,
    args.script,
    accountId,
    workerName,
    preview.id,
    { message: args.message ?? fallbackMessage, tag: args.tag ?? fallbackTag }
  );
  const deployment = await createPreviewDeployment(
    config,
    accountId,
    workerName,
    preview.id,
    deploymentRequest,
    { ignoreDefaults }
  );
  writeOutput({
    type: "preview",
    version: 1,
    worker_name: workerName,
    preview_id: preview.id,
    preview_name: preview.name,
    preview_slug: preview.slug,
    preview_urls: preview.urls,
    deployment_id: deployment.id,
    deployment_urls: deployment.urls
  });
  if (args.json) {
    logger.log(JSON.stringify({ preview, deployment }, null, 2));
    return;
  }
  const scriptLevel = buildMergedScriptLevel(config, preview);
  const versionLevel = buildMergedVersionLevel(config, deployment);
  const configName = configFileName(config.configPath);
  logger.log(
    formatPreviewResource(preview, scriptLevel, isNewPreview, configName)
  );
  logger.log(formatDeploymentResource(deployment, versionLevel, configName));
  const topLevelBindings = getBindings(config);
  if (Object.keys(topLevelBindings).length > 0) {
    const previewDefaults = await getWorkerPreviewDefaults(
      config,
      accountId,
      workerName
    );
    logMissingPreviewsBindingsWarning(
      topLevelBindings,
      previewDefaults.env,
      extractConfigBindings(config)
    );
  }
}
async function handlePreviewDeleteCommand(args, { config }) {
  const workerName = resolveWorkerName(args, config);
  let previewName = args.name;
  if (!previewName) {
    previewName = getBranchName();
    if (!previewName) {
      throw new UserError(
        "Could not determine Preview name. No git branch detected. Please provide a Preview name using --name <preview-name>."
      );
    }
    logger.log(`Using git branch "${previewName}" as Preview name.`);
  }
  if (!args.skipConfirmation) {
    const confirmed = await confirm(
      `Are you sure you want to delete the Preview "${previewName}" for Worker "${workerName}"?
This will delete all deployments associated with this Preview.`
    );
    if (!confirmed) {
      logger.log("Aborted.");
      return;
    }
  }
  const accountId = await requireAuth(config);
  await deletePreview(config, accountId, workerName, previewName);
  logger.log(`
\u2728 Preview "${previewName}" deleted successfully.`);
}
var CONFIG_MARKER;
var init_preview2 = __esm({
  "src/preview/preview.ts"() {
    init_import_meta_url();
    init_dist();
    init_source();
    init_assets5();
    init_bindings2();
    init_bundle();
    init_create_worker_upload_form();
    init_entry();
    init_log_build_output();
    init_module_collection();
    init_no_bundle_worker();
    init_node_compat();
    init_source_maps();
    init_dialogs();
    init_logger();
    init_navigator_user_agent();
    init_output();
    init_user3();
    init_box();
    init_getRules();
    init_placement();
    init_api3();
    init_shared6();
    __name(toBase642, "toBase64");
    __name(getPreviewMigrationsToUpload, "getPreviewMigrationsToUpload");
    __name(getDeploymentModules, "getDeploymentModules");
    __name(assemblePreviewDeploymentSettings, "assemblePreviewDeploymentSettings");
    __name(buildMergedScriptLevel, "buildMergedScriptLevel");
    __name(buildMergedVersionLevel, "buildMergedVersionLevel");
    CONFIG_MARKER = source_default.hex("#FFA500")("\u25C6");
    __name(getFriendlyBindingType, "getFriendlyBindingType");
    __name(formatAlignedRows, "formatAlignedRows");
    __name(formatBindings, "formatBindings");
    __name(formatPreviewResource, "formatPreviewResource");
    __name(formatDeploymentResource, "formatDeploymentResource");
    __name(logMissingPreviewsBindingsWarning, "logMissingPreviewsBindingsWarning");
    __name(handlePreviewCommand, "handlePreviewCommand");
    __name(handlePreviewDeleteCommand, "handlePreviewDeleteCommand");
  }
});

// src/preview/secret.ts
function isSecretBinding(binding) {
  return binding.type === "secret_text";
}
function toSecretBindingsPatch(secrets) {
  return Object.fromEntries(
    Object.entries(secrets).map(([name2, text]) => [
      name2,
      { type: "secret_text", text }
    ])
  );
}
function extractSecretSummaries(env6) {
  return Object.entries(env6 ?? {}).filter(([, binding]) => binding !== null && isSecretBinding(binding)).map(([name2]) => ({ name: name2, type: "secret_text" }));
}
function formatPreviewSecrets(workerName, env6) {
  const secrets = Object.entries(env6 ?? {}).filter(
    ([, binding]) => binding !== null && isSecretBinding(binding)
  );
  const lines = [];
  lines.push(`${source_default.bold.hex("#FFA500")("Worker:")} ${workerName}`);
  lines.push("");
  lines.push(`  ${source_default.bold.underline("Previews settings")}`);
  lines.push("");
  lines.push(source_default.bold("  Secrets"));
  if (secrets.length === 0) {
    lines.push(`  ${source_default.dim("(none)")}`);
    lines.push("");
    return drawBox(lines);
  }
  const typeLabel = getBindingTypeFriendlyName("secret_text");
  const nameWidth = Math.max(...secrets.map(([name2]) => name2.length));
  const typeWidth = visibleLength(typeLabel);
  const valueWidth = Math.max(
    ...secrets.map(([, binding]) => getBindingValue(binding).length)
  );
  for (const [name2, binding] of secrets) {
    lines.push(
      `  ${source_default.cyan(padToVisibleWidth(name2, nameWidth))}   ${source_default.dim(padToVisibleWidth(typeLabel, typeWidth))}   ${padToVisibleWidth(getBindingValue(binding), valueWidth)}`
    );
  }
  lines.push("");
  return drawBox(lines);
}
async function handlePreviewSecretPutCommand(args, { config }) {
  const workerName = resolveWorkerName(args, config);
  const accountId = await requireAuth(config);
  const secretValue = trimTrailingWhitespace(
    process.stdin.isTTY ? await prompt("Enter a secret value:", { isSecret: true }) : await readFromStdin()
  );
  const updatedPreviewDefaults = await editWorkerPreviewDefaults(
    config,
    accountId,
    workerName,
    {
      env: toSecretBindingsPatch({ [args.key]: secretValue })
    }
  );
  logger.log(
    `
\u2728 Secret "${args.key}" added to Previews settings for Worker ${source_default.bold.cyan(workerName)}.`
  );
  logger.log(formatPreviewSecrets(workerName, updatedPreviewDefaults.env));
}
async function handlePreviewSecretDeleteCommand(args, { config }) {
  const workerName = resolveWorkerName(args, config);
  const accountId = await requireAuth(config);
  if (!args.skipConfirmation) {
    const confirmed = await confirm(
      `Are you sure you want to delete the secret "${args.key}" from Previews settings for Worker ${source_default.bold.cyan(workerName)}?`
    );
    if (!confirmed) {
      logger.log("Aborted.");
      return;
    }
  }
  const updatedPreviewDefaults = await editWorkerPreviewDefaults(
    config,
    accountId,
    workerName,
    {
      env: {
        [args.key]: null
      }
    }
  );
  logger.log(
    `
\u2728 Secret "${args.key}" deleted from Previews settings for Worker ${source_default.bold.cyan(workerName)}.`
  );
  logger.log(formatPreviewSecrets(workerName, updatedPreviewDefaults.env));
}
async function handlePreviewSecretListCommand(args, { config }) {
  const workerName = resolveWorkerName(args, config);
  const accountId = await requireAuth(config);
  const previewDefaults = await getWorkerPreviewDefaults(
    config,
    accountId,
    workerName
  );
  const secrets = extractSecretSummaries(previewDefaults.env);
  if (args.json) {
    logger.log(JSON.stringify(secrets, null, 2));
    return;
  }
  logger.log(formatPreviewSecrets(workerName, previewDefaults.env));
}
async function handlePreviewSecretBulkCommand(args, { config }) {
  const workerName = resolveWorkerName(args, config);
  const accountId = await requireAuth(config);
  const result = await parseBulkInputToObject(args.file);
  if (!result) {
    logger.error("No content found in file, or piped input.");
    return;
  }
  const { content } = result;
  const secretCount = Object.keys(content).length;
  const source = args.file ? `file "${args.file}"` : "stdin";
  const updatedPreviewDefaults = await editWorkerPreviewDefaults(
    config,
    accountId,
    workerName,
    {
      env: toSecretBindingsPatch(content)
    }
  );
  logger.log(
    `
\u2728 Uploaded ${secretCount} secrets from ${source} to Previews settings for Worker ${source_default.bold.cyan(workerName)}.`
  );
  logger.log(formatPreviewSecrets(workerName, updatedPreviewDefaults.env));
}
var init_secret3 = __esm({
  "src/preview/secret.ts"() {
    init_import_meta_url();
    init_dist();
    init_source();
    init_dialogs();
    init_logger();
    init_secret();
    init_user3();
    init_box();
    init_std();
    init_api3();
    init_shared6();
    __name(isSecretBinding, "isSecretBinding");
    __name(toSecretBindingsPatch, "toSecretBindingsPatch");
    __name(extractSecretSummaries, "extractSecretSummaries");
    __name(formatPreviewSecrets, "formatPreviewSecrets");
    __name(handlePreviewSecretPutCommand, "handlePreviewSecretPutCommand");
    __name(handlePreviewSecretDeleteCommand, "handlePreviewSecretDeleteCommand");
    __name(handlePreviewSecretListCommand, "handlePreviewSecretListCommand");
    __name(handlePreviewSecretBulkCommand, "handlePreviewSecretBulkCommand");
  }
});

// ../../node_modules/.pnpm/heap@0.2.7/node_modules/heap/lib/heap.js
var require_heap = __commonJS({
  "../../node_modules/.pnpm/heap@0.2.7/node_modules/heap/lib/heap.js"(exports, module2) {
    init_import_meta_url();
    (function() {
      var Heap, defaultCmp, floor, heapify, heappop, heappush, heappushpop, heapreplace, insort, min, nlargest, nsmallest, updateItem, _siftdown, _siftup;
      floor = Math.floor, min = Math.min;
      defaultCmp = /* @__PURE__ */ __name(function(x7, y5) {
        if (x7 < y5) {
          return -1;
        }
        if (x7 > y5) {
          return 1;
        }
        return 0;
      }, "defaultCmp");
      insort = /* @__PURE__ */ __name(function(a7, x7, lo, hi, cmp) {
        var mid;
        if (lo == null) {
          lo = 0;
        }
        if (cmp == null) {
          cmp = defaultCmp;
        }
        if (lo < 0) {
          throw new Error("lo must be non-negative");
        }
        if (hi == null) {
          hi = a7.length;
        }
        while (lo < hi) {
          mid = floor((lo + hi) / 2);
          if (cmp(x7, a7[mid]) < 0) {
            hi = mid;
          } else {
            lo = mid + 1;
          }
        }
        return [].splice.apply(a7, [lo, lo - lo].concat(x7)), x7;
      }, "insort");
      heappush = /* @__PURE__ */ __name(function(array, item, cmp) {
        if (cmp == null) {
          cmp = defaultCmp;
        }
        array.push(item);
        return _siftdown(array, 0, array.length - 1, cmp);
      }, "heappush");
      heappop = /* @__PURE__ */ __name(function(array, cmp) {
        var lastelt, returnitem;
        if (cmp == null) {
          cmp = defaultCmp;
        }
        lastelt = array.pop();
        if (array.length) {
          returnitem = array[0];
          array[0] = lastelt;
          _siftup(array, 0, cmp);
        } else {
          returnitem = lastelt;
        }
        return returnitem;
      }, "heappop");
      heapreplace = /* @__PURE__ */ __name(function(array, item, cmp) {
        var returnitem;
        if (cmp == null) {
          cmp = defaultCmp;
        }
        returnitem = array[0];
        array[0] = item;
        _siftup(array, 0, cmp);
        return returnitem;
      }, "heapreplace");
      heappushpop = /* @__PURE__ */ __name(function(array, item, cmp) {
        var _ref;
        if (cmp == null) {
          cmp = defaultCmp;
        }
        if (array.length && cmp(array[0], item) < 0) {
          _ref = [array[0], item], item = _ref[0], array[0] = _ref[1];
          _siftup(array, 0, cmp);
        }
        return item;
      }, "heappushpop");
      heapify = /* @__PURE__ */ __name(function(array, cmp) {
        var i7, _i2, _len, _ref1, _results, _results1;
        if (cmp == null) {
          cmp = defaultCmp;
        }
        _ref1 = function() {
          _results1 = [];
          for (var _j2 = 0, _ref2 = floor(array.length / 2); 0 <= _ref2 ? _j2 < _ref2 : _j2 > _ref2; 0 <= _ref2 ? _j2++ : _j2--) {
            _results1.push(_j2);
          }
          return _results1;
        }.apply(this).reverse();
        _results = [];
        for (_i2 = 0, _len = _ref1.length; _i2 < _len; _i2++) {
          i7 = _ref1[_i2];
          _results.push(_siftup(array, i7, cmp));
        }
        return _results;
      }, "heapify");
      updateItem = /* @__PURE__ */ __name(function(array, item, cmp) {
        var pos;
        if (cmp == null) {
          cmp = defaultCmp;
        }
        pos = array.indexOf(item);
        if (pos === -1) {
          return;
        }
        _siftdown(array, 0, pos, cmp);
        return _siftup(array, pos, cmp);
      }, "updateItem");
      nlargest = /* @__PURE__ */ __name(function(array, n9, cmp) {
        var elem, result, _i2, _len, _ref;
        if (cmp == null) {
          cmp = defaultCmp;
        }
        result = array.slice(0, n9);
        if (!result.length) {
          return result;
        }
        heapify(result, cmp);
        _ref = array.slice(n9);
        for (_i2 = 0, _len = _ref.length; _i2 < _len; _i2++) {
          elem = _ref[_i2];
          heappushpop(result, elem, cmp);
        }
        return result.sort(cmp).reverse();
      }, "nlargest");
      nsmallest = /* @__PURE__ */ __name(function(array, n9, cmp) {
        var elem, los, result, _i2, _j, _len, _ref, _ref1, _results;
        if (cmp == null) {
          cmp = defaultCmp;
        }
        if (n9 * 10 <= array.length) {
          result = array.slice(0, n9).sort(cmp);
          if (!result.length) {
            return result;
          }
          los = result[result.length - 1];
          _ref = array.slice(n9);
          for (_i2 = 0, _len = _ref.length; _i2 < _len; _i2++) {
            elem = _ref[_i2];
            if (cmp(elem, los) < 0) {
              insort(result, elem, 0, null, cmp);
              result.pop();
              los = result[result.length - 1];
            }
          }
          return result;
        }
        heapify(array, cmp);
        _results = [];
        for (_j = 0, _ref1 = min(n9, array.length); 0 <= _ref1 ? _j < _ref1 : _j > _ref1; 0 <= _ref1 ? ++_j : --_j) {
          _results.push(heappop(array, cmp));
        }
        return _results;
      }, "nsmallest");
      _siftdown = /* @__PURE__ */ __name(function(array, startpos, pos, cmp) {
        var newitem, parent, parentpos;
        if (cmp == null) {
          cmp = defaultCmp;
        }
        newitem = array[pos];
        while (pos > startpos) {
          parentpos = pos - 1 >> 1;
          parent = array[parentpos];
          if (cmp(newitem, parent) < 0) {
            array[pos] = parent;
            pos = parentpos;
            continue;
          }
          break;
        }
        return array[pos] = newitem;
      }, "_siftdown");
      _siftup = /* @__PURE__ */ __name(function(array, pos, cmp) {
        var childpos, endpos, newitem, rightpos, startpos;
        if (cmp == null) {
          cmp = defaultCmp;
        }
        endpos = array.length;
        startpos = pos;
        newitem = array[pos];
        childpos = 2 * pos + 1;
        while (childpos < endpos) {
          rightpos = childpos + 1;
          if (rightpos < endpos && !(cmp(array[childpos], array[rightpos]) < 0)) {
            childpos = rightpos;
          }
          array[pos] = array[childpos];
          pos = childpos;
          childpos = 2 * pos + 1;
        }
        array[pos] = newitem;
        return _siftdown(array, startpos, pos, cmp);
      }, "_siftup");
      Heap = function() {
        Heap2.push = heappush;
        Heap2.pop = heappop;
        Heap2.replace = heapreplace;
        Heap2.pushpop = heappushpop;
        Heap2.heapify = heapify;
        Heap2.updateItem = updateItem;
        Heap2.nlargest = nlargest;
        Heap2.nsmallest = nsmallest;
        function Heap2(cmp) {
          this.cmp = cmp != null ? cmp : defaultCmp;
          this.nodes = [];
        }
        __name(Heap2, "Heap");
        Heap2.prototype.push = function(x7) {
          return heappush(this.nodes, x7, this.cmp);
        };
        Heap2.prototype.pop = function() {
          return heappop(this.nodes, this.cmp);
        };
        Heap2.prototype.peek = function() {
          return this.nodes[0];
        };
        Heap2.prototype.contains = function(x7) {
          return this.nodes.indexOf(x7) !== -1;
        };
        Heap2.prototype.replace = function(x7) {
          return heapreplace(this.nodes, x7, this.cmp);
        };
        Heap2.prototype.pushpop = function(x7) {
          return heappushpop(this.nodes, x7, this.cmp);
        };
        Heap2.prototype.heapify = function() {
          return heapify(this.nodes, this.cmp);
        };
        Heap2.prototype.updateItem = function(x7) {
          return updateItem(this.nodes, x7, this.cmp);
        };
        Heap2.prototype.clear = function() {
          return this.nodes = [];
        };
        Heap2.prototype.empty = function() {
          return this.nodes.length === 0;
        };
        Heap2.prototype.size = function() {
          return this.nodes.length;
        };
        Heap2.prototype.clone = function() {
          var heap;
          heap = new Heap2();
          heap.nodes = this.nodes.slice(0);
          return heap;
        };
        Heap2.prototype.toArray = function() {
          return this.nodes.slice(0);
        };
        Heap2.prototype.insert = Heap2.prototype.push;
        Heap2.prototype.top = Heap2.prototype.peek;
        Heap2.prototype.front = Heap2.prototype.peek;
        Heap2.prototype.has = Heap2.prototype.contains;
        Heap2.prototype.copy = Heap2.prototype.clone;
        return Heap2;
      }();
      (function(root, factory) {
        if (typeof define === "function" && define.amd) {
          return define([], factory);
        } else if (typeof exports === "object") {
          return module2.exports = factory();
        } else {
          return root.Heap = factory();
        }
      })(this, function() {
        return Heap;
      });
    }).call(exports);
  }
});

// ../../node_modules/.pnpm/heap@0.2.7/node_modules/heap/index.js
var require_heap2 = __commonJS({
  "../../node_modules/.pnpm/heap@0.2.7/node_modules/heap/index.js"(exports, module2) {
    init_import_meta_url();
    module2.exports = require_heap();
  }
});

// ../../node_modules/.pnpm/@ewoudenberg+difflib@0.1.0/node_modules/@ewoudenberg/difflib/lib/difflib.js
var require_difflib = __commonJS({
  "../../node_modules/.pnpm/@ewoudenberg+difflib@0.1.0/node_modules/@ewoudenberg/difflib/lib/difflib.js"(exports) {
    init_import_meta_url();
    (function() {
      var Differ, Heap, IS_CHARACTER_JUNK, IS_LINE_JUNK, SequenceMatcher, _any, _arrayCmp, _calculateRatio, _countLeading, _formatRangeContext, _formatRangeUnified, _has, assert61, contextDiff, floor, getCloseMatches, max, min, ndiff, restore, unifiedDiff, indexOf = [].indexOf;
      ({ floor, max, min } = Math);
      Heap = require_heap2();
      assert61 = __require("assert");
      _calculateRatio = /* @__PURE__ */ __name(function(matches, length) {
        if (length) {
          return 2 * matches / length;
        } else {
          return 1;
        }
      }, "_calculateRatio");
      _arrayCmp = /* @__PURE__ */ __name(function(a7, b11) {
        var i7, l8, la, lb, ref;
        [la, lb] = [a7.length, b11.length];
        for (i7 = l8 = 0, ref = min(la, lb); 0 <= ref ? l8 < ref : l8 > ref; i7 = 0 <= ref ? ++l8 : --l8) {
          if (a7[i7] < b11[i7]) {
            return -1;
          }
          if (a7[i7] > b11[i7]) {
            return 1;
          }
        }
        return la - lb;
      }, "_arrayCmp");
      _has = /* @__PURE__ */ __name(function(obj, key) {
        return Object.prototype.hasOwnProperty.call(obj, key);
      }, "_has");
      _any = /* @__PURE__ */ __name(function(items) {
        var item, l8, len;
        for (l8 = 0, len = items.length; l8 < len; l8++) {
          item = items[l8];
          if (item) {
            return true;
          }
        }
        return false;
      }, "_any");
      SequenceMatcher = class SequenceMatcher {
        static {
          __name(this, "SequenceMatcher");
        }
        /*
            SequenceMatcher is a flexible class for comparing pairs of sequences of
            any type, so long as the sequence elements are hashable.  The basic
            algorithm predates, and is a little fancier than, an algorithm
            published in the late 1980's by Ratcliff and Obershelp under the
            hyperbolic name "gestalt pattern matching".  The basic idea is to find
            the longest contiguous matching subsequence that contains no "junk"
            elements (R-O doesn't address junk).  The same idea is then applied
            recursively to the pieces of the sequences to the left and to the right
            of the matching subsequence.  This does not yield minimal edit
            sequences, but does tend to yield matches that "look right" to people.
        
            SequenceMatcher tries to compute a "human-friendly diff" between two
            sequences.  Unlike e.g. UNIX(tm) diff, the fundamental notion is the
            longest *contiguous* & junk-free matching subsequence.  That's what
            catches peoples' eyes.  The Windows(tm) windiff has another interesting
            notion, pairing up elements that appear uniquely in each sequence.
            That, and the method here, appear to yield more intuitive difference
            reports than does diff.  This method appears to be the least vulnerable
            to synching up on blocks of "junk lines", though (like blank lines in
            ordinary text files, or maybe "<P>" lines in HTML files).  That may be
            because this is the only method of the 3 that has a *concept* of
            "junk" <wink>.
        
            Example, comparing two strings, and considering blanks to be "junk":
        
            >>> isjunk = (c) -> c is ' '
            >>> s = new SequenceMatcher(isjunk,
                                        'private Thread currentThread;',
                                        'private volatile Thread currentThread;')
        
            .ratio() returns a float in [0, 1], measuring the "similarity" of the
            sequences.  As a rule of thumb, a .ratio() value over 0.6 means the
            sequences are close matches:
        
            >>> s.ratio().toPrecision(3)
            '0.866'
        
            If you're only interested in where the sequences match,
            .getMatchingBlocks() is handy:
        
            >>> for [a, b, size] in s.getMatchingBlocks()
            ...   console.log("a[#{a}] and b[#{b}] match for #{size} elements");
            a[0] and b[0] match for 8 elements
            a[8] and b[17] match for 21 elements
            a[29] and b[38] match for 0 elements
        
            Note that the last tuple returned by .get_matching_blocks() is always a
            dummy, (len(a), len(b), 0), and this is the only case in which the last
            tuple element (number of elements matched) is 0.
        
            If you want to know how to change the first sequence into the second,
            use .get_opcodes():
        
            >>> for [op, a1, a2, b1, b2] in s.getOpcodes()
            ...   console.log "#{op} a[#{a1}:#{a2}] b[#{b1}:#{b2}]"
            equal a[0:8] b[0:8]
            insert a[8:8] b[8:17]
            equal a[8:29] b[17:38]
        
            See the Differ class for a fancy human-friendly file differencer, which
            uses SequenceMatcher both to compare sequences of lines, and to compare
            sequences of characters within similar (near-matching) lines.
        
            See also function getCloseMatches() in this module, which shows how
            simple code building on SequenceMatcher can be used to do useful work.
        
            Timing:  Basic R-O is cubic time worst case and quadratic time expected
            case.  SequenceMatcher is quadratic time for the worst case and has
            expected-case behavior dependent in a complicated way on how many
            elements the sequences have in common; best case time is linear.
        
            Methods:
        
            constructor(isjunk=null, a='', b='')
                Construct a SequenceMatcher.
        
            setSeqs(a, b)
                Set the two sequences to be compared.
        
            setSeq1(a)
                Set the first sequence to be compared.
        
            setSeq2(b)
                Set the second sequence to be compared.
        
            findLongestMatch(alo, ahi, blo, bhi)
                Find longest matching block in a[alo:ahi] and b[blo:bhi].
        
            getMatchingBlocks()
                Return list of triples describing matching subsequences.
        
            getOpcodes()
                Return list of 5-tuples describing how to turn a into b.
        
            ratio()
                Return a measure of the sequences' similarity (float in [0,1]).
        
            quickRatio()
                Return an upper bound on .ratio() relatively quickly.
        
            realQuickRatio()
                Return an upper bound on ratio() very quickly.
            */
        constructor(isjunk1, a7 = "", b11 = "", autojunk = true) {
          this.isjunk = isjunk1;
          this.autojunk = autojunk;
          this.a = this.b = null;
          this.setSeqs(a7, b11);
        }
        setSeqs(a7, b11) {
          this.setSeq1(a7);
          return this.setSeq2(b11);
        }
        setSeq1(a7) {
          if (a7 === this.a) {
            return;
          }
          this.a = a7;
          return this.matchingBlocks = this.opcodes = null;
        }
        setSeq2(b11) {
          if (b11 === this.b) {
            return;
          }
          this.b = b11;
          this.matchingBlocks = this.opcodes = null;
          this.fullbcount = null;
          return this._chainB();
        }
        // For each element x in b, set b2j[x] to a list of the indices in
        // b where x appears; the indices are in increasing order; note that
        // the number of times x appears in b is b2j[x].length ...
        // when @isjunk is defined, junk elements don't show up in this
        // map at all, which stops the central findLongestMatch method
        // from starting any matching block at a junk element ...
        // also creates the fast isbjunk function ...
        // b2j also does not contain entries for "popular" elements, meaning
        // elements that account for more than 1 + 1% of the total elements, and
        // when the sequence is reasonably large (>= 200 elements); this can
        // be viewed as an adaptive notion of semi-junk, and yields an enormous
        // speedup when, e.g., comparing program files with hundreds of
        // instances of "return null;" ...
        // note that this is only called when b changes; so for cross-product
        // kinds of matches, it's best to call setSeq2 once, then setSeq1
        // repeatedly
        _chainB() {
          var b11, b2j, elt, i7, indices, isjunk, junk, l8, len, n9, ntest, popular;
          b11 = this.b;
          this.b2j = b2j = /* @__PURE__ */ new Map();
          for (i7 = l8 = 0, len = b11.length; l8 < len; i7 = ++l8) {
            elt = b11[i7];
            if (!b2j.has(elt)) {
              b2j.set(elt, []);
            }
            indices = b2j.get(elt);
            indices.push(i7);
          }
          junk = /* @__PURE__ */ new Map();
          isjunk = this.isjunk;
          if (isjunk) {
            b2j.forEach(function(idxs, elt2) {
              if (isjunk(elt2)) {
                junk.set(elt2, true);
                return b2j.delete(elt2);
              }
            });
          }
          popular = /* @__PURE__ */ new Map();
          n9 = b11.length;
          if (this.autojunk && n9 >= 200) {
            ntest = floor(n9 / 100) + 1;
            b2j.forEach(function(idxs, elt2) {
              if (idxs.length > ntest) {
                popular.set(elt2, true);
                return b2j.delete(elt2);
              }
            });
          }
          this.isbjunk = function(b12) {
            return junk.has(b12);
          };
          return this.isbpopular = function(b12) {
            return popular.has(b12);
          };
        }
        findLongestMatch(alo, ahi, blo, bhi) {
          var a7, b11, b2j, besti, bestj, bestsize, i7, isbjunk, j7, j2len, jlist, k7, l8, len, m7, newj2len, ref, ref1;
          [a7, b11, b2j, isbjunk] = [this.a, this.b, this.b2j, this.isbjunk];
          [besti, bestj, bestsize] = [alo, blo, 0];
          j2len = {};
          for (i7 = l8 = ref = alo, ref1 = ahi; ref <= ref1 ? l8 < ref1 : l8 > ref1; i7 = ref <= ref1 ? ++l8 : --l8) {
            newj2len = {};
            jlist = [];
            if (b2j.has(a7[i7])) {
              jlist = b2j.get(a7[i7]);
            }
            for (m7 = 0, len = jlist.length; m7 < len; m7++) {
              j7 = jlist[m7];
              if (j7 < blo) {
                continue;
              }
              if (j7 >= bhi) {
                break;
              }
              k7 = newj2len[j7] = (j2len[j7 - 1] || 0) + 1;
              if (k7 > bestsize) {
                [besti, bestj, bestsize] = [i7 - k7 + 1, j7 - k7 + 1, k7];
              }
            }
            j2len = newj2len;
          }
          while (besti > alo && bestj > blo && !isbjunk(b11[bestj - 1]) && a7[besti - 1] === b11[bestj - 1]) {
            [besti, bestj, bestsize] = [besti - 1, bestj - 1, bestsize + 1];
          }
          while (besti + bestsize < ahi && bestj + bestsize < bhi && !isbjunk(b11[bestj + bestsize]) && a7[besti + bestsize] === b11[bestj + bestsize]) {
            bestsize++;
          }
          while (besti > alo && bestj > blo && isbjunk(b11[bestj - 1]) && a7[besti - 1] === b11[bestj - 1]) {
            [besti, bestj, bestsize] = [besti - 1, bestj - 1, bestsize + 1];
          }
          while (besti + bestsize < ahi && bestj + bestsize < bhi && isbjunk(b11[bestj + bestsize]) && a7[besti + bestsize] === b11[bestj + bestsize]) {
            bestsize++;
          }
          return [besti, bestj, bestsize];
        }
        getMatchingBlocks() {
          var ahi, alo, bhi, blo, i7, i1, i22, j7, j1, j22, k7, k1, k22, l8, la, lb, len, matchingBlocks, nonAdjacent, queue, x7;
          if (this.matchingBlocks) {
            return this.matchingBlocks;
          }
          [la, lb] = [this.a.length, this.b.length];
          queue = [[0, la, 0, lb]];
          matchingBlocks = [];
          while (queue.length) {
            [alo, ahi, blo, bhi] = queue.pop();
            [i7, j7, k7] = x7 = this.findLongestMatch(alo, ahi, blo, bhi);
            if (k7) {
              matchingBlocks.push(x7);
              if (alo < i7 && blo < j7) {
                queue.push([alo, i7, blo, j7]);
              }
              if (i7 + k7 < ahi && j7 + k7 < bhi) {
                queue.push([i7 + k7, ahi, j7 + k7, bhi]);
              }
            }
          }
          matchingBlocks.sort(_arrayCmp);
          i1 = j1 = k1 = 0;
          nonAdjacent = [];
          for (l8 = 0, len = matchingBlocks.length; l8 < len; l8++) {
            [i22, j22, k22] = matchingBlocks[l8];
            if (i1 + k1 === i22 && j1 + k1 === j22) {
              k1 += k22;
            } else {
              if (k1) {
                nonAdjacent.push([i1, j1, k1]);
              }
              [i1, j1, k1] = [i22, j22, k22];
            }
          }
          if (k1) {
            nonAdjacent.push([i1, j1, k1]);
          }
          nonAdjacent.push([la, lb, 0]);
          return this.matchingBlocks = nonAdjacent;
        }
        getOpcodes() {
          var ai2, answer, bj2, i7, j7, l8, len, ref, size, tag;
          if (this.opcodes) {
            return this.opcodes;
          }
          i7 = j7 = 0;
          this.opcodes = answer = [];
          ref = this.getMatchingBlocks();
          for (l8 = 0, len = ref.length; l8 < len; l8++) {
            [ai2, bj2, size] = ref[l8];
            tag = "";
            if (i7 < ai2 && j7 < bj2) {
              tag = "replace";
            } else if (i7 < ai2) {
              tag = "delete";
            } else if (j7 < bj2) {
              tag = "insert";
            }
            if (tag) {
              answer.push([tag, i7, ai2, j7, bj2]);
            }
            [i7, j7] = [ai2 + size, bj2 + size];
            if (size) {
              answer.push(["equal", ai2, i7, bj2, j7]);
            }
          }
          return answer;
        }
        getGroupedOpcodes(n9 = 3) {
          var codes, group, groups, i1, i22, j1, j22, l8, len, nn, tag;
          codes = this.getOpcodes();
          if (!codes.length) {
            codes = [["equal", 0, 1, 0, 1]];
          }
          if (codes[0][0] === "equal") {
            [tag, i1, i22, j1, j22] = codes[0];
            codes[0] = [tag, max(i1, i22 - n9), i22, max(j1, j22 - n9), j22];
          }
          if (codes[codes.length - 1][0] === "equal") {
            [tag, i1, i22, j1, j22] = codes[codes.length - 1];
            codes[codes.length - 1] = [tag, i1, min(i22, i1 + n9), j1, min(j22, j1 + n9)];
          }
          nn = n9 + n9;
          groups = [];
          group = [];
          for (l8 = 0, len = codes.length; l8 < len; l8++) {
            [tag, i1, i22, j1, j22] = codes[l8];
            if (tag === "equal" && i22 - i1 > nn) {
              group.push([tag, i1, min(i22, i1 + n9), j1, min(j22, j1 + n9)]);
              groups.push(group);
              group = [];
              [i1, j1] = [max(i1, i22 - n9), max(j1, j22 - n9)];
            }
            group.push([tag, i1, i22, j1, j22]);
          }
          if (group.length && !(group.length === 1 && group[0][0] === "equal")) {
            groups.push(group);
          }
          return groups;
        }
        ratio() {
          var l8, len, match3, matches, ref;
          matches = 0;
          ref = this.getMatchingBlocks();
          for (l8 = 0, len = ref.length; l8 < len; l8++) {
            match3 = ref[l8];
            matches += match3[2];
          }
          return _calculateRatio(matches, this.a.length + this.b.length);
        }
        quickRatio() {
          var avail, elt, fullbcount, l8, len, len1, m7, matches, numb, ref, ref1;
          if (!this.fullbcount) {
            this.fullbcount = fullbcount = {};
            ref = this.b;
            for (l8 = 0, len = ref.length; l8 < len; l8++) {
              elt = ref[l8];
              fullbcount[elt] = (fullbcount[elt] || 0) + 1;
            }
          }
          fullbcount = this.fullbcount;
          avail = {};
          matches = 0;
          ref1 = this.a;
          for (m7 = 0, len1 = ref1.length; m7 < len1; m7++) {
            elt = ref1[m7];
            if (_has(avail, elt)) {
              numb = avail[elt];
            } else {
              numb = fullbcount[elt] || 0;
            }
            avail[elt] = numb - 1;
            if (numb > 0) {
              matches++;
            }
          }
          return _calculateRatio(matches, this.a.length + this.b.length);
        }
        realQuickRatio() {
          var la, lb;
          [la, lb] = [this.a.length, this.b.length];
          return _calculateRatio(min(la, lb), la + lb);
        }
      };
      getCloseMatches = /* @__PURE__ */ __name(function(word, possibilities, n9 = 3, cutoff = 0.6) {
        var l8, len, len1, m7, result, results, s7, score, x7;
        if (!(n9 > 0)) {
          throw new Error(`n must be > 0: (${n9})`);
        }
        if (!(0 <= cutoff && cutoff <= 1)) {
          throw new Error(`cutoff must be in [0.0, 1.0]: (${cutoff})`);
        }
        result = [];
        s7 = new SequenceMatcher();
        s7.setSeq2(word);
        for (l8 = 0, len = possibilities.length; l8 < len; l8++) {
          x7 = possibilities[l8];
          s7.setSeq1(x7);
          if (s7.realQuickRatio() >= cutoff && s7.quickRatio() >= cutoff && s7.ratio() >= cutoff) {
            result.push([s7.ratio(), x7]);
          }
        }
        result = Heap.nlargest(result, n9, _arrayCmp);
        results = [];
        for (m7 = 0, len1 = result.length; m7 < len1; m7++) {
          [score, x7] = result[m7];
          results.push(x7);
        }
        return results;
      }, "getCloseMatches");
      _countLeading = /* @__PURE__ */ __name(function(line, ch2) {
        var i7, n9;
        [i7, n9] = [0, line.length];
        while (i7 < n9 && line[i7] === ch2) {
          i7++;
        }
        return i7;
      }, "_countLeading");
      Differ = class Differ {
        static {
          __name(this, "Differ");
        }
        /*
            Differ is a class for comparing sequences of lines of text, and
            producing human-readable differences or deltas.  Differ uses
            SequenceMatcher both to compare sequences of lines, and to compare
            sequences of characters within similar (near-matching) lines.
        
            Each line of a Differ delta begins with a two-letter code:
        
                '- '    line unique to sequence 1
                '+ '    line unique to sequence 2
                '  '    line common to both sequences
                '? '    line not present in either input sequence
        
            Lines beginning with '? ' attempt to guide the eye to intraline
            differences, and were not present in either input sequence.  These lines
            can be confusing if the sequences contain tab characters.
        
            Note that Differ makes no claim to produce a *minimal* diff.  To the
            contrary, minimal diffs are often counter-intuitive, because they synch
            up anywhere possible, sometimes accidental matches 100 pages apart.
            Restricting synch points to contiguous matches preserves some notion of
            locality, at the occasional cost of producing a longer diff.
        
            Example: Comparing two texts.
        
            >>> text1 = ['1. Beautiful is better than ugly.\n',
            ...   '2. Explicit is better than implicit.\n',
            ...   '3. Simple is better than complex.\n',
            ...   '4. Complex is better than complicated.\n']
            >>> text1.length
            4
            >>> text2 = ['1. Beautiful is better than ugly.\n',
            ...   '3.   Simple is better than complex.\n',
            ...   '4. Complicated is better than complex.\n',
            ...   '5. Flat is better than nested.\n']
        
            Next we instantiate a Differ object:
        
            >>> d = new Differ()
        
            Note that when instantiating a Differ object we may pass functions to
            filter out line and character 'junk'.
        
            Finally, we compare the two:
        
            >>> result = d.compare(text1, text2)
            [ '  1. Beautiful is better than ugly.\n',
              '- 2. Explicit is better than implicit.\n',
              '- 3. Simple is better than complex.\n',
              '+ 3.   Simple is better than complex.\n',
              '?   ++\n',
              '- 4. Complex is better than complicated.\n',
              '?          ^                     ---- ^\n',
              '+ 4. Complicated is better than complex.\n',
              '?         ++++ ^                      ^\n',
              '+ 5. Flat is better than nested.\n' ]
        
            Methods:
        
            constructor(linejunk=null, charjunk=null)
                Construct a text differencer, with optional filters.
            compare(a, b)
                Compare two sequences of lines; generate the resulting delta.
            */
        constructor(linejunk1, charjunk1) {
          this.linejunk = linejunk1;
          this.charjunk = charjunk1;
        }
        /*
            Construct a text differencer, with optional filters.
        
            The two optional keyword parameters are for filter functions:
        
            - `linejunk`: A function that should accept a single string argument,
              and return true iff the string is junk. The module-level function
              `IS_LINE_JUNK` may be used to filter out lines without visible
              characters, except for at most one splat ('#').  It is recommended
              to leave linejunk null. 
        
            - `charjunk`: A function that should accept a string of length 1. The
              module-level function `IS_CHARACTER_JUNK` may be used to filter out
              whitespace characters (a blank or tab; **note**: bad idea to include
              newline in this!).  Use of IS_CHARACTER_JUNK is recommended.
            */
        compare(a7, b11) {
          var ahi, alo, bhi, blo, cruncher, g7, l8, len, len1, line, lines, m7, ref, tag;
          cruncher = new SequenceMatcher(this.linejunk, a7, b11);
          lines = [];
          ref = cruncher.getOpcodes();
          for (l8 = 0, len = ref.length; l8 < len; l8++) {
            [tag, alo, ahi, blo, bhi] = ref[l8];
            switch (tag) {
              case "replace":
                g7 = this._fancyReplace(a7, alo, ahi, b11, blo, bhi);
                break;
              case "delete":
                g7 = this._dump("-", a7, alo, ahi);
                break;
              case "insert":
                g7 = this._dump("+", b11, blo, bhi);
                break;
              case "equal":
                g7 = this._dump(" ", a7, alo, ahi);
                break;
              default:
                throw new Error(`unknow tag (${tag})`);
            }
            for (m7 = 0, len1 = g7.length; m7 < len1; m7++) {
              line = g7[m7];
              lines.push(line);
            }
          }
          return lines;
        }
        _dump(tag, x7, lo, hi) {
          var i7, l8, ref, ref1, results;
          results = [];
          for (i7 = l8 = ref = lo, ref1 = hi; ref <= ref1 ? l8 < ref1 : l8 > ref1; i7 = ref <= ref1 ? ++l8 : --l8) {
            results.push(`${tag} ${x7[i7]}`);
          }
          return results;
        }
        _plainReplace(a7, alo, ahi, b11, blo, bhi) {
          var first, g7, l8, len, len1, line, lines, m7, ref, second;
          assert61(alo < ahi && blo < bhi);
          if (bhi - blo < ahi - alo) {
            first = this._dump("+", b11, blo, bhi);
            second = this._dump("-", a7, alo, ahi);
          } else {
            first = this._dump("-", a7, alo, ahi);
            second = this._dump("+", b11, blo, bhi);
          }
          lines = [];
          ref = [first, second];
          for (l8 = 0, len = ref.length; l8 < len; l8++) {
            g7 = ref[l8];
            for (m7 = 0, len1 = g7.length; m7 < len1; m7++) {
              line = g7[m7];
              lines.push(line);
            }
          }
          return lines;
        }
        _fancyReplace(a7, alo, ahi, b11, blo, bhi) {
          var aelt, ai2, ai1, ai22, atags, belt, bestRatio, besti, bestj, bj2, bj1, bj22, btags, cruncher, cutoff, eqi, eqj, i7, j7, l8, la, lb, len, len1, len2, len3, len4, line, lines, m7, o7, p7, q7, r10, ref, ref1, ref2, ref3, ref4, ref5, ref6, ref7, ref8, t13, tag;
          [bestRatio, cutoff] = [0.74, 0.75];
          cruncher = new SequenceMatcher(this.charjunk);
          [eqi, eqj] = [
            null,
            null
            // 1st indices of equal lines (if any)
          ];
          lines = [];
          for (j7 = l8 = ref = blo, ref1 = bhi; ref <= ref1 ? l8 < ref1 : l8 > ref1; j7 = ref <= ref1 ? ++l8 : --l8) {
            bj2 = b11[j7];
            cruncher.setSeq2(bj2);
            for (i7 = m7 = ref2 = alo, ref3 = ahi; ref2 <= ref3 ? m7 < ref3 : m7 > ref3; i7 = ref2 <= ref3 ? ++m7 : --m7) {
              ai2 = a7[i7];
              if (ai2 === bj2) {
                if (eqi === null) {
                  [eqi, eqj] = [i7, j7];
                }
                continue;
              }
              cruncher.setSeq1(ai2);
              if (cruncher.realQuickRatio() > bestRatio && cruncher.quickRatio() > bestRatio && cruncher.ratio() > bestRatio) {
                [bestRatio, besti, bestj] = [cruncher.ratio(), i7, j7];
              }
            }
          }
          if (bestRatio < cutoff) {
            if (eqi === null) {
              ref4 = this._plainReplace(a7, alo, ahi, b11, blo, bhi);
              for (o7 = 0, len = ref4.length; o7 < len; o7++) {
                line = ref4[o7];
                lines.push(line);
              }
              return lines;
            }
            [besti, bestj, bestRatio] = [eqi, eqj, 1];
          } else {
            eqi = null;
          }
          ref5 = this._fancyHelper(a7, alo, besti, b11, blo, bestj);
          for (p7 = 0, len1 = ref5.length; p7 < len1; p7++) {
            line = ref5[p7];
            lines.push(line);
          }
          [aelt, belt] = [a7[besti], b11[bestj]];
          if (eqi === null) {
            atags = btags = "";
            cruncher.setSeqs(aelt, belt);
            ref6 = cruncher.getOpcodes();
            for (q7 = 0, len2 = ref6.length; q7 < len2; q7++) {
              [tag, ai1, ai22, bj1, bj22] = ref6[q7];
              [la, lb] = [ai22 - ai1, bj22 - bj1];
              switch (tag) {
                case "replace":
                  atags += Array(la + 1).join("^");
                  btags += Array(lb + 1).join("^");
                  break;
                case "delete":
                  atags += Array(la + 1).join("-");
                  break;
                case "insert":
                  btags += Array(lb + 1).join("+");
                  break;
                case "equal":
                  atags += Array(la + 1).join(" ");
                  btags += Array(lb + 1).join(" ");
                  break;
                default:
                  throw new Error(`unknow tag (${tag})`);
              }
            }
            ref7 = this._qformat(aelt, belt, atags, btags);
            for (r10 = 0, len3 = ref7.length; r10 < len3; r10++) {
              line = ref7[r10];
              lines.push(line);
            }
          } else {
            lines.push("  " + aelt);
          }
          ref8 = this._fancyHelper(a7, besti + 1, ahi, b11, bestj + 1, bhi);
          for (t13 = 0, len4 = ref8.length; t13 < len4; t13++) {
            line = ref8[t13];
            lines.push(line);
          }
          return lines;
        }
        _fancyHelper(a7, alo, ahi, b11, blo, bhi) {
          var g7;
          g7 = [];
          if (alo < ahi) {
            if (blo < bhi) {
              g7 = this._fancyReplace(a7, alo, ahi, b11, blo, bhi);
            } else {
              g7 = this._dump("-", a7, alo, ahi);
            }
          } else if (blo < bhi) {
            g7 = this._dump("+", b11, blo, bhi);
          }
          return g7;
        }
        _qformat(aline, bline, atags, btags) {
          var common, lines;
          lines = [];
          common = min(_countLeading(aline, "	"), _countLeading(bline, "	"));
          common = min(common, _countLeading(atags.slice(0, common), " "));
          common = min(common, _countLeading(btags.slice(0, common), " "));
          atags = atags.slice(common).replace(/\s+$/, "");
          btags = btags.slice(common).replace(/\s+$/, "");
          lines.push("- " + aline);
          if (atags.length) {
            lines.push(`? ${Array(common + 1).join("	")}${atags}
`);
          }
          lines.push("+ " + bline);
          if (btags.length) {
            lines.push(`? ${Array(common + 1).join("	")}${btags}
`);
          }
          return lines;
        }
      };
      IS_LINE_JUNK = /* @__PURE__ */ __name(function(line, pat = /^\s*#?\s*$/) {
        return pat.test(line);
      }, "IS_LINE_JUNK");
      IS_CHARACTER_JUNK = /* @__PURE__ */ __name(function(ch2, ws = " 	") {
        return indexOf.call(ws, ch2) >= 0;
      }, "IS_CHARACTER_JUNK");
      _formatRangeUnified = /* @__PURE__ */ __name(function(start, stop) {
        var beginning, length;
        beginning = start + 1;
        length = stop - start;
        if (length === 1) {
          return `${beginning}`;
        }
        if (!length) {
          beginning--;
        }
        return `${beginning},${length}`;
      }, "_formatRangeUnified");
      unifiedDiff = /* @__PURE__ */ __name(function(a7, b11, { fromfile, tofile, fromfiledate, tofiledate, n: n9, lineterm } = {}) {
        var file1Range, file2Range, first, fromdate, group, i1, i22, j1, j22, l8, last, len, len1, len2, len3, len4, line, lines, m7, o7, p7, q7, ref, ref1, ref2, ref3, started, tag, todate;
        if (fromfile == null) {
          fromfile = "";
        }
        if (tofile == null) {
          tofile = "";
        }
        if (fromfiledate == null) {
          fromfiledate = "";
        }
        if (tofiledate == null) {
          tofiledate = "";
        }
        if (n9 == null) {
          n9 = 3;
        }
        if (lineterm == null) {
          lineterm = "\n";
        }
        lines = [];
        started = false;
        ref = new SequenceMatcher(null, a7, b11).getGroupedOpcodes();
        for (l8 = 0, len = ref.length; l8 < len; l8++) {
          group = ref[l8];
          if (!started) {
            started = true;
            fromdate = fromfiledate ? `	${fromfiledate}` : "";
            todate = tofiledate ? `	${tofiledate}` : "";
            lines.push(`--- ${fromfile}${fromdate}${lineterm}`);
            lines.push(`+++ ${tofile}${todate}${lineterm}`);
          }
          [first, last] = [group[0], group[group.length - 1]];
          file1Range = _formatRangeUnified(first[1], last[2]);
          file2Range = _formatRangeUnified(first[3], last[4]);
          lines.push(`@@ -${file1Range} +${file2Range} @@${lineterm}`);
          for (m7 = 0, len1 = group.length; m7 < len1; m7++) {
            [tag, i1, i22, j1, j22] = group[m7];
            if (tag === "equal") {
              ref1 = a7.slice(i1, i22);
              for (o7 = 0, len2 = ref1.length; o7 < len2; o7++) {
                line = ref1[o7];
                lines.push(" " + line);
              }
              continue;
            }
            if (tag === "replace" || tag === "delete") {
              ref2 = a7.slice(i1, i22);
              for (p7 = 0, len3 = ref2.length; p7 < len3; p7++) {
                line = ref2[p7];
                lines.push("-" + line);
              }
            }
            if (tag === "replace" || tag === "insert") {
              ref3 = b11.slice(j1, j22);
              for (q7 = 0, len4 = ref3.length; q7 < len4; q7++) {
                line = ref3[q7];
                lines.push("+" + line);
              }
            }
          }
        }
        return lines;
      }, "unifiedDiff");
      _formatRangeContext = /* @__PURE__ */ __name(function(start, stop) {
        var beginning, length;
        beginning = start + 1;
        length = stop - start;
        if (!length) {
          beginning--;
        }
        if (length <= 1) {
          return `${beginning}`;
        }
        return `${beginning},${beginning + length - 1}`;
      }, "_formatRangeContext");
      contextDiff = /* @__PURE__ */ __name(function(a7, b11, { fromfile, tofile, fromfiledate, tofiledate, n: n9, lineterm } = {}) {
        var _5, file1Range, file2Range, first, fromdate, group, i1, i22, j1, j22, l8, last, len, len1, len2, len3, len4, line, lines, m7, o7, p7, prefix, q7, ref, ref1, ref2, started, tag, todate;
        if (fromfile == null) {
          fromfile = "";
        }
        if (tofile == null) {
          tofile = "";
        }
        if (fromfiledate == null) {
          fromfiledate = "";
        }
        if (tofiledate == null) {
          tofiledate = "";
        }
        if (n9 == null) {
          n9 = 3;
        }
        if (lineterm == null) {
          lineterm = "\n";
        }
        prefix = {
          insert: "+ ",
          delete: "- ",
          replace: "! ",
          equal: "  "
        };
        started = false;
        lines = [];
        ref = new SequenceMatcher(null, a7, b11).getGroupedOpcodes();
        for (l8 = 0, len = ref.length; l8 < len; l8++) {
          group = ref[l8];
          if (!started) {
            started = true;
            fromdate = fromfiledate ? `	${fromfiledate}` : "";
            todate = tofiledate ? `	${tofiledate}` : "";
            lines.push(`*** ${fromfile}${fromdate}${lineterm}`);
            lines.push(`--- ${tofile}${todate}${lineterm}`);
            [first, last] = [group[0], group[group.length - 1]];
            lines.push("***************" + lineterm);
            file1Range = _formatRangeContext(first[1], last[2]);
            lines.push(`*** ${file1Range} ****${lineterm}`);
            if (_any(function() {
              var len12, m8, results;
              results = [];
              for (m8 = 0, len12 = group.length; m8 < len12; m8++) {
                [tag, _5, _5, _5, _5] = group[m8];
                results.push(tag === "replace" || tag === "delete");
              }
              return results;
            }())) {
              for (m7 = 0, len1 = group.length; m7 < len1; m7++) {
                [tag, i1, i22, _5, _5] = group[m7];
                if (tag !== "insert") {
                  ref1 = a7.slice(i1, i22);
                  for (o7 = 0, len2 = ref1.length; o7 < len2; o7++) {
                    line = ref1[o7];
                    lines.push(prefix[tag] + line);
                  }
                }
              }
            }
            file2Range = _formatRangeContext(first[3], last[4]);
            lines.push(`--- ${file2Range} ----${lineterm}`);
            if (_any(function() {
              var len32, p8, results;
              results = [];
              for (p8 = 0, len32 = group.length; p8 < len32; p8++) {
                [tag, _5, _5, _5, _5] = group[p8];
                results.push(tag === "replace" || tag === "insert");
              }
              return results;
            }())) {
              for (p7 = 0, len3 = group.length; p7 < len3; p7++) {
                [tag, _5, _5, j1, j22] = group[p7];
                if (tag !== "delete") {
                  ref2 = b11.slice(j1, j22);
                  for (q7 = 0, len4 = ref2.length; q7 < len4; q7++) {
                    line = ref2[q7];
                    lines.push(prefix[tag] + line);
                  }
                }
              }
            }
          }
        }
        return lines;
      }, "contextDiff");
      ndiff = /* @__PURE__ */ __name(function(a7, b11, linejunk, charjunk = IS_CHARACTER_JUNK) {
        return new Differ(linejunk, charjunk).compare(a7, b11);
      }, "ndiff");
      restore = /* @__PURE__ */ __name(function(delta, which) {
        var l8, len, line, lines, prefixes, ref, tag;
        tag = {
          1: "- ",
          2: "+ "
        }[which];
        if (!tag) {
          throw new Error(`unknow delta choice (must be 1 or 2): ${which}`);
        }
        prefixes = ["  ", tag];
        lines = [];
        for (l8 = 0, len = delta.length; l8 < len; l8++) {
          line = delta[l8];
          if (ref = line.slice(0, 2), indexOf.call(prefixes, ref) >= 0) {
            lines.push(line.slice(2));
          }
        }
        return lines;
      }, "restore");
      exports._arrayCmp = _arrayCmp;
      exports.SequenceMatcher = SequenceMatcher;
      exports.getCloseMatches = getCloseMatches;
      exports._countLeading = _countLeading;
      exports.Differ = Differ;
      exports.IS_LINE_JUNK = IS_LINE_JUNK;
      exports.IS_CHARACTER_JUNK = IS_CHARACTER_JUNK;
      exports._formatRangeUnified = _formatRangeUnified;
      exports.unifiedDiff = unifiedDiff;
      exports._formatRangeContext = _formatRangeContext;
      exports.contextDiff = contextDiff;
      exports.ndiff = ndiff;
      exports.restore = restore;
    }).call(exports);
  }
});

// ../../node_modules/.pnpm/@ewoudenberg+difflib@0.1.0/node_modules/@ewoudenberg/difflib/index.js
var require_difflib2 = __commonJS({
  "../../node_modules/.pnpm/@ewoudenberg+difflib@0.1.0/node_modules/@ewoudenberg/difflib/index.js"(exports, module2) {
    init_import_meta_url();
    module2.exports = require_difflib();
  }
});

// ../../node_modules/.pnpm/json-diff@1.0.6/node_modules/json-diff/lib/util.js
var require_util12 = __commonJS({
  "../../node_modules/.pnpm/json-diff@1.0.6/node_modules/json-diff/lib/util.js"(exports, module2) {
    init_import_meta_url();
    var extendedTypeOf3 = /* @__PURE__ */ __name(function(obj) {
      const result = typeof obj;
      if (obj == null) {
        return "null";
      } else if (result === "object" && obj.constructor === Array) {
        return "array";
      } else if (result === "object" && obj instanceof Date) {
        return "date";
      } else {
        return result;
      }
    }, "extendedTypeOf");
    var roundObj = /* @__PURE__ */ __name(function(data, precision) {
      const type = typeof data;
      if (type === "array") {
        return data.map((x7) => roundObj(x7, precision));
      } else if (type === "object") {
        for (const key in data) {
          data[key] = roundObj(data[key], precision);
        }
        return data;
      } else if (type === "number" && Number.isFinite(data) && !Number.isInteger(data)) {
        return +data.toFixed(precision);
      } else {
        return data;
      }
    }, "roundObj");
    module2.exports = { extendedTypeOf: extendedTypeOf3, roundObj };
  }
});

// ../../node_modules/.pnpm/colors@1.4.0/node_modules/colors/lib/styles.js
var require_styles2 = __commonJS({
  "../../node_modules/.pnpm/colors@1.4.0/node_modules/colors/lib/styles.js"(exports, module2) {
    init_import_meta_url();
    var styles4 = {};
    module2["exports"] = styles4;
    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 val2 = codes[key];
      var style = styles4[key] = [];
      style.open = "\x1B[" + val2[0] + "m";
      style.close = "\x1B[" + val2[1] + "m";
    });
  }
});

// ../../node_modules/.pnpm/colors@1.4.0/node_modules/colors/lib/system/has-flag.js
var require_has_flag2 = __commonJS({
  "../../node_modules/.pnpm/colors@1.4.0/node_modules/colors/lib/system/has-flag.js"(exports, module2) {
    init_import_meta_url();
    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);
    };
  }
});

// ../../node_modules/.pnpm/colors@1.4.0/node_modules/colors/lib/system/supports-colors.js
var require_supports_colors2 = __commonJS({
  "../../node_modules/.pnpm/colors@1.4.0/node_modules/colors/lib/system/supports-colors.js"(exports, module2) {
    init_import_meta_url();
    var os13 = __require("os");
    var hasFlag3 = require_has_flag2();
    var env6 = process.env;
    var forceColor = void 0;
    if (hasFlag3("no-color") || hasFlag3("no-colors") || hasFlag3("color=false")) {
      forceColor = false;
    } else if (hasFlag3("color") || hasFlag3("colors") || hasFlag3("color=true") || hasFlag3("color=always")) {
      forceColor = true;
    }
    if ("FORCE_COLOR" in env6) {
      forceColor = env6.FORCE_COLOR.length === 0 || parseInt(env6.FORCE_COLOR, 10) !== 0;
    }
    function translateLevel3(level) {
      if (level === 0) {
        return false;
      }
      return {
        level,
        hasBasic: true,
        has256: level >= 2,
        has16m: level >= 3
      };
    }
    __name(translateLevel3, "translateLevel");
    function supportsColor3(stream2) {
      if (forceColor === false) {
        return 0;
      }
      if (hasFlag3("color=16m") || hasFlag3("color=full") || hasFlag3("color=truecolor")) {
        return 3;
      }
      if (hasFlag3("color=256")) {
        return 2;
      }
      if (stream2 && !stream2.isTTY && forceColor !== true) {
        return 0;
      }
      var min = forceColor ? 1 : 0;
      if (process.platform === "win32") {
        var osRelease = os13.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 env6) {
        if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI"].some(function(sign) {
          return sign in env6;
        }) || env6.CI_NAME === "codeship") {
          return 1;
        }
        return min;
      }
      if ("TEAMCITY_VERSION" in env6) {
        return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env6.TEAMCITY_VERSION) ? 1 : 0;
      }
      if ("TERM_PROGRAM" in env6) {
        var version5 = parseInt((env6.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
        switch (env6.TERM_PROGRAM) {
          case "iTerm.app":
            return version5 >= 3 ? 3 : 2;
          case "Hyper":
            return 3;
          case "Apple_Terminal":
            return 2;
        }
      }
      if (/-256(color)?$/i.test(env6.TERM)) {
        return 2;
      }
      if (/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(env6.TERM)) {
        return 1;
      }
      if ("COLORTERM" in env6) {
        return 1;
      }
      if (env6.TERM === "dumb") {
        return min;
      }
      return min;
    }
    __name(supportsColor3, "supportsColor");
    function getSupportLevel(stream2) {
      var level = supportsColor3(stream2);
      return translateLevel3(level);
    }
    __name(getSupportLevel, "getSupportLevel");
    module2.exports = {
      supportsColor: getSupportLevel,
      stdout: getSupportLevel(process.stdout),
      stderr: getSupportLevel(process.stderr)
    };
  }
});

// ../../node_modules/.pnpm/colors@1.4.0/node_modules/colors/lib/custom/trap.js
var require_trap2 = __commonJS({
  "../../node_modules/.pnpm/colors@1.4.0/node_modules/colors/lib/custom/trap.js"(exports, module2) {
    init_import_meta_url();
    module2["exports"] = /* @__PURE__ */ __name(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(c8) {
        c8 = c8.toLowerCase();
        var chars = trap[c8] || [" "];
        var rand = Math.floor(Math.random() * chars.length);
        if (typeof trap[c8] !== "undefined") {
          result += trap[c8][rand];
        } else {
          result += c8;
        }
      });
      return result;
    }, "runTheTrap");
  }
});

// ../../node_modules/.pnpm/colors@1.4.0/node_modules/colors/lib/custom/zalgo.js
var require_zalgo2 = __commonJS({
  "../../node_modules/.pnpm/colors@1.4.0/node_modules/colors/lib/custom/zalgo.js"(exports, module2) {
    init_import_meta_url();
    module2["exports"] = /* @__PURE__ */ __name(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 all3 = [].concat(soul.up, soul.down, soul.mid);
      function randomNumber(range) {
        var r10 = Math.floor(Math.random() * range);
        return r10;
      }
      __name(randomNumber, "randomNumber");
      function isChar(character) {
        var bool = false;
        all3.filter(function(i7) {
          bool = i7 === character;
        });
        return bool;
      }
      __name(isChar, "isChar");
      function heComes(text2, options2) {
        var result = "";
        var counts;
        var l8;
        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 (l8 in text2) {
          if (isChar(l8)) {
            continue;
          }
          result = result + text2[l8];
          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 d8 in arr) {
            var index = arr[d8];
            for (var i7 = 0; i7 <= counts[index]; i7++) {
              if (options2[index]) {
                result = result + soul[index][randomNumber(soul[index].length)];
              }
            }
          }
        }
        return result;
      }
      __name(heComes, "heComes");
      return heComes(text, options);
    }, "zalgo");
  }
});

// ../../node_modules/.pnpm/colors@1.4.0/node_modules/colors/lib/maps/america.js
var require_america2 = __commonJS({
  "../../node_modules/.pnpm/colors@1.4.0/node_modules/colors/lib/maps/america.js"(exports, module2) {
    init_import_meta_url();
    module2["exports"] = function(colors) {
      return function(letter, i7, exploded) {
        if (letter === " ") return letter;
        switch (i7 % 3) {
          case 0:
            return colors.red(letter);
          case 1:
            return colors.white(letter);
          case 2:
            return colors.blue(letter);
        }
      };
    };
  }
});

// ../../node_modules/.pnpm/colors@1.4.0/node_modules/colors/lib/maps/zebra.js
var require_zebra2 = __commonJS({
  "../../node_modules/.pnpm/colors@1.4.0/node_modules/colors/lib/maps/zebra.js"(exports, module2) {
    init_import_meta_url();
    module2["exports"] = function(colors) {
      return function(letter, i7, exploded) {
        return i7 % 2 === 0 ? letter : colors.inverse(letter);
      };
    };
  }
});

// ../../node_modules/.pnpm/colors@1.4.0/node_modules/colors/lib/maps/rainbow.js
var require_rainbow2 = __commonJS({
  "../../node_modules/.pnpm/colors@1.4.0/node_modules/colors/lib/maps/rainbow.js"(exports, module2) {
    init_import_meta_url();
    module2["exports"] = function(colors) {
      var rainbowColors = ["red", "yellow", "green", "blue", "magenta"];
      return function(letter, i7, exploded) {
        if (letter === " ") {
          return letter;
        } else {
          return colors[rainbowColors[i7++ % rainbowColors.length]](letter);
        }
      };
    };
  }
});

// ../../node_modules/.pnpm/colors@1.4.0/node_modules/colors/lib/maps/random.js
var require_random2 = __commonJS({
  "../../node_modules/.pnpm/colors@1.4.0/node_modules/colors/lib/maps/random.js"(exports, module2) {
    init_import_meta_url();
    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, i7, exploded) {
        return letter === " " ? letter : colors[available[Math.round(Math.random() * (available.length - 2))]](letter);
      };
    };
  }
});

// ../../node_modules/.pnpm/colors@1.4.0/node_modules/colors/lib/colors.js
var require_colors2 = __commonJS({
  "../../node_modules/.pnpm/colors@1.4.0/node_modules/colors/lib/colors.js"(exports, module2) {
    init_import_meta_url();
    var colors = {};
    module2["exports"] = colors;
    colors.themes = {};
    var util5 = __require("util");
    var ansiStyles3 = colors.styles = require_styles2();
    var defineProps = Object.defineProperties;
    var newLineRegex = new RegExp(/[\r\n]+/g);
    colors.supportsColor = require_supports_colors2().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 = /* @__PURE__ */ __name(function stylize2(str, style) {
      if (!colors.enabled) {
        return str + "";
      }
      var styleMap = ansiStyles3[style];
      if (!styleMap && style in colors) {
        return colors[style](str);
      }
      return styleMap.open + str + styleMap.close;
    }, "stylize");
    var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g;
    var escapeStringRegexp = /* @__PURE__ */ __name(function(str) {
      if (typeof str !== "string") {
        throw new TypeError("Expected a string");
      }
      return str.replace(matchOperatorsRe, "\\$&");
    }, "escapeStringRegexp");
    function build5(_styles) {
      var builder = /* @__PURE__ */ __name(function builder2() {
        return applyStyle2.apply(builder2, arguments);
      }, "builder");
      builder._styles = _styles;
      builder.__proto__ = proto2;
      return builder;
    }
    __name(build5, "build");
    var styles4 = function() {
      var ret = {};
      ansiStyles3.grey = ansiStyles3.gray;
      Object.keys(ansiStyles3).forEach(function(key) {
        ansiStyles3[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles3[key].close), "g");
        ret[key] = {
          get: /* @__PURE__ */ __name(function() {
            return build5(this._styles.concat(key));
          }, "get")
        };
      });
      return ret;
    }();
    var proto2 = defineProps(/* @__PURE__ */ __name(function colors2() {
    }, "colors"), styles4);
    function applyStyle2() {
      var args = Array.prototype.slice.call(arguments);
      var str = args.map(function(arg) {
        if (arg != null && arg.constructor === String) {
          return arg;
        } else {
          return util5.inspect(arg);
        }
      }).join(" ");
      if (!colors.enabled || !str) {
        return str;
      }
      var newLinesPresent = str.indexOf("\n") != -1;
      var nestedStyles = this._styles;
      var i7 = nestedStyles.length;
      while (i7--) {
        var code = ansiStyles3[nestedStyles[i7]];
        str = code.open + str.replace(code.closeRe, code.open) + code.close;
        if (newLinesPresent) {
          str = str.replace(newLineRegex, function(match3) {
            return code.close + match3 + code.open;
          });
        }
      }
      return str;
    }
    __name(applyStyle2, "applyStyle");
    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 i7 in theme[style2]) {
                out = colors[theme[style2][i7]](out);
              }
              return out;
            }
            return colors[theme[style2]](str);
          };
        })(style);
      }
    };
    function init4() {
      var ret = {};
      Object.keys(styles4).forEach(function(name2) {
        ret[name2] = {
          get: /* @__PURE__ */ __name(function() {
            return build5([name2]);
          }, "get")
        };
      });
      return ret;
    }
    __name(init4, "init");
    var sequencer = /* @__PURE__ */ __name(function sequencer2(map3, str) {
      var exploded = str.split("");
      exploded = exploded.map(map3);
      return exploded.join("");
    }, "sequencer");
    colors.trap = require_trap2();
    colors.zalgo = require_zalgo2();
    colors.maps = {};
    colors.maps.america = require_america2()(colors);
    colors.maps.zebra = require_zebra2()(colors);
    colors.maps.rainbow = require_rainbow2()(colors);
    colors.maps.random = require_random2()(colors);
    for (map2 in colors.maps) {
      (function(map3) {
        colors[map3] = function(str) {
          return sequencer(colors.maps[map3], str);
        };
      })(map2);
    }
    var map2;
    defineProps(colors, init4());
  }
});

// ../../node_modules/.pnpm/colors@1.4.0/node_modules/colors/safe.js
var require_safe2 = __commonJS({
  "../../node_modules/.pnpm/colors@1.4.0/node_modules/colors/safe.js"(exports, module2) {
    init_import_meta_url();
    var colors = require_colors2();
    module2["exports"] = colors;
  }
});

// ../../node_modules/.pnpm/json-diff@1.0.6/node_modules/json-diff/lib/colorize.js
var require_colorize = __commonJS({
  "../../node_modules/.pnpm/json-diff@1.0.6/node_modules/json-diff/lib/colorize.js"(exports, module2) {
    init_import_meta_url();
    var color = require_safe2();
    var { extendedTypeOf: extendedTypeOf3 } = require_util12();
    var Theme = {
      " "(s7) {
        return s7;
      },
      "+": color.green,
      "-": color.red
    };
    var subcolorizeToCallback = /* @__PURE__ */ __name(function(options, key, diff, output, color2, indent) {
      let subvalue;
      const prefix = key ? `${key}: ` : "";
      const subindent = indent + "  ";
      const outputElisions = /* @__PURE__ */ __name((n9) => {
        const maxElisions = options.maxElisions === void 0 ? Infinity : options.maxElisions;
        if (n9 < maxElisions) {
          for (let i7 = 0; i7 < n9; i7++) {
            output(" ", subindent + "...");
          }
        } else {
          output(" ", subindent + `... (${n9} entries)`);
        }
      }, "outputElisions");
      switch (extendedTypeOf3(diff)) {
        case "object":
          if ("__old" in diff && "__new" in diff && Object.keys(diff).length === 2) {
            subcolorizeToCallback(options, key, diff.__old, output, "-", indent);
            return subcolorizeToCallback(options, key, diff.__new, output, "+", indent);
          } else {
            output(color2, `${indent}${prefix}{`);
            for (const subkey of Object.keys(diff)) {
              let m7;
              subvalue = diff[subkey];
              if (m7 = subkey.match(/^(.*)__deleted$/)) {
                subcolorizeToCallback(options, m7[1], subvalue, output, "-", subindent);
              } else if (m7 = subkey.match(/^(.*)__added$/)) {
                subcolorizeToCallback(options, m7[1], subvalue, output, "+", subindent);
              } else {
                subcolorizeToCallback(options, subkey, subvalue, output, color2, subindent);
              }
            }
            return output(color2, `${indent}}`);
          }
        case "array": {
          output(color2, `${indent}${prefix}[`);
          let looksLikeDiff = true;
          for (const item of diff) {
            if (extendedTypeOf3(item) !== "array" || !(item.length === 2 || item.length === 1 && item[0] === " ") || !(typeof item[0] === "string") || item[0].length !== 1 || ![" ", "-", "+", "~"].includes(item[0])) {
              looksLikeDiff = false;
            }
          }
          if (looksLikeDiff) {
            let op;
            let elisionCount = 0;
            for ([op, subvalue] of diff) {
              if (op === " " && subvalue == null) {
                elisionCount++;
              } else {
                if (elisionCount > 0) {
                  outputElisions(elisionCount);
                }
                elisionCount = 0;
                if (![" ", "~", "+", "-"].includes(op)) {
                  throw new Error(`Unexpected op '${op}' in ${JSON.stringify(diff, null, 2)}`);
                }
                if (op === "~") {
                  op = " ";
                }
                subcolorizeToCallback(options, "", subvalue, output, op, subindent);
              }
            }
            if (elisionCount > 0) {
              outputElisions(elisionCount);
            }
          } else {
            for (subvalue of diff) {
              subcolorizeToCallback(options, "", subvalue, output, color2, subindent);
            }
          }
          return output(color2, `${indent}]`);
        }
        default:
          if (diff === 0 || diff === null || diff === false || diff === "" || diff) {
            return output(color2, indent + prefix + JSON.stringify(diff));
          }
      }
    }, "subcolorizeToCallback");
    var colorizeToCallback = /* @__PURE__ */ __name((diff, options, output) => subcolorizeToCallback(options, "", diff, output, " ", ""), "colorizeToCallback");
    var colorizeToArray = /* @__PURE__ */ __name(function(diff, options = {}) {
      const output = [];
      colorizeToCallback(diff, options, (color2, line) => output.push(`${color2}${line}`));
      return output;
    }, "colorizeToArray");
    var colorize = /* @__PURE__ */ __name(function(diff, options = {}) {
      const output = [];
      colorizeToCallback(diff, options, function(color2, line) {
        if (options.color != null ? options.color : true) {
          return output.push(((options.theme != null ? options.theme[color2] : void 0) != null ? options.theme != null ? options.theme[color2] : void 0 : Theme[color2])(`${color2}${line}`) + "\n");
        } else {
          return output.push(`${color2}${line}
`);
        }
      });
      return output.join("");
    }, "colorize");
    module2.exports = { colorize, colorizeToArray, colorizeToCallback };
  }
});

// ../../node_modules/.pnpm/json-diff@1.0.6/node_modules/json-diff/lib/index.js
var require_lib5 = __commonJS({
  "../../node_modules/.pnpm/json-diff@1.0.6/node_modules/json-diff/lib/index.js"(exports, module2) {
    init_import_meta_url();
    var { SequenceMatcher } = require_difflib2();
    var { extendedTypeOf: extendedTypeOf3, roundObj } = require_util12();
    var { colorize, colorizeToCallback } = require_colorize();
    var JsonDiff = class {
      static {
        __name(this, "JsonDiff");
      }
      constructor(options) {
        options.outputKeys = options.outputKeys || [];
        options.excludeKeys = options.excludeKeys || [];
        this.options = options;
      }
      isScalar(obj) {
        return typeof obj !== "object" || obj === null;
      }
      objectDiff(obj1, obj2) {
        let result = {};
        let score = 0;
        let equal = true;
        for (const [key, value] of Object.entries(obj1)) {
          if (!this.options.outputNewOnly) {
            const postfix = "__deleted";
            if (!(key in obj2) && !this.options.excludeKeys.includes(key)) {
              result[`${key}${postfix}`] = value;
              score -= 30;
              equal = false;
            }
          }
        }
        for (const [key, value] of Object.entries(obj2)) {
          const postfix = !this.options.outputNewOnly ? "__added" : "";
          if (!(key in obj1) && !this.options.excludeKeys.includes(key)) {
            result[`${key}${postfix}`] = value;
            score -= 30;
            equal = false;
          }
        }
        for (const [key, value1] of Object.entries(obj1)) {
          if (key in obj2) {
            if (this.options.excludeKeys.includes(key)) {
              continue;
            }
            score += 20;
            const value2 = obj2[key];
            const change = this.diff(value1, value2);
            if (!change.equal) {
              result[key] = change.result;
              equal = false;
            } else if (this.options.full || this.options.outputKeys.includes(key)) {
              result[key] = value1;
            }
            score += Math.min(20, Math.max(-10, change.score / 5));
          }
        }
        if (equal) {
          score = 100 * Math.max(Object.keys(obj1).length, 0.5);
          if (!this.options.full) {
            result = void 0;
          }
        } else {
          score = Math.max(0, score);
        }
        return { score, result, equal };
      }
      findMatchingObject(item, index, fuzzyOriginals) {
        let bestMatch = null;
        for (const [key, { item: candidate, index: matchIndex }] of Object.entries(fuzzyOriginals)) {
          if (key !== "__next") {
            const indexDistance = Math.abs(matchIndex - index);
            if (extendedTypeOf3(item) === extendedTypeOf3(candidate)) {
              const { score } = this.diff(item, candidate);
              if (!bestMatch || score > bestMatch.score || score === bestMatch.score && indexDistance < bestMatch.indexDistance) {
                bestMatch = { score, key, indexDistance };
              }
            }
          }
        }
        return bestMatch;
      }
      scalarize(array, originals, fuzzyOriginals) {
        const fuzzyMatches = [];
        if (fuzzyOriginals) {
          const keyScores = {};
          for (let index = 0; index < array.length; index++) {
            const item = array[index];
            if (this.isScalar(item)) {
              continue;
            }
            const bestMatch = this.findMatchingObject(item, index, fuzzyOriginals);
            if (bestMatch && (!keyScores[bestMatch.key] || bestMatch.score > keyScores[bestMatch.key].score)) {
              keyScores[bestMatch.key] = { score: bestMatch.score, index };
            }
          }
          for (const [key, match3] of Object.entries(keyScores)) {
            fuzzyMatches[match3.index] = key;
          }
        }
        const result = [];
        for (let index = 0; index < array.length; index++) {
          const item = array[index];
          if (this.isScalar(item)) {
            result.push(item);
          } else {
            const key = fuzzyMatches[index] || "__$!SCALAR" + originals.__next++;
            originals[key] = { item, index };
            result.push(key);
          }
        }
        return result;
      }
      isScalarized(item, originals) {
        return typeof item === "string" && item in originals;
      }
      descalarize(item, originals) {
        if (this.isScalarized(item, originals)) {
          return originals[item].item;
        } else {
          return item;
        }
      }
      arrayDiff(obj1, obj2) {
        const originals1 = { __next: 1 };
        const seq1 = this.scalarize(obj1, originals1);
        const originals2 = { __next: originals1.__next };
        const seq2 = this.scalarize(obj2, originals2, originals1);
        if (this.options.sort) {
          seq1.sort();
          seq2.sort();
        }
        const opcodes = new SequenceMatcher(null, seq1, seq2).getOpcodes();
        let result = [];
        let score = 0;
        let equal = true;
        for (const [op, i1, i22, j1, j22] of opcodes) {
          let i7, j7;
          let asc, end;
          let asc1, end1;
          let asc2, end2;
          if (!(op === "equal" || this.options.keysOnly && op === "replace")) {
            equal = false;
          }
          switch (op) {
            case "equal":
              for (i7 = i1, end = i22, asc = i1 <= end; asc ? i7 < end : i7 > end; asc ? i7++ : i7--) {
                const item = seq1[i7];
                if (this.isScalarized(item, originals1)) {
                  if (!this.isScalarized(item, originals2)) {
                    throw new Error(
                      `internal bug: isScalarized(item, originals1) != isScalarized(item, originals2) for item ${JSON.stringify(
                        item
                      )}`
                    );
                  }
                  const item1 = this.descalarize(item, originals1);
                  const item2 = this.descalarize(item, originals2);
                  const change = this.diff(item1, item2);
                  if (!change.equal) {
                    result.push(["~", change.result]);
                    equal = false;
                  } else {
                    if (this.options.full || this.options.keepUnchangedValues) {
                      result.push([" ", item1]);
                    } else {
                      result.push([" "]);
                    }
                  }
                } else {
                  if (this.options.full || this.options.keepUnchangedValues) {
                    result.push([" ", item]);
                  } else {
                    result.push([" "]);
                  }
                }
                score += 10;
              }
              break;
            case "delete":
              for (i7 = i1, end1 = i22, asc1 = i1 <= end1; asc1 ? i7 < end1 : i7 > end1; asc1 ? i7++ : i7--) {
                result.push(["-", this.descalarize(seq1[i7], originals1)]);
                score -= 5;
              }
              break;
            case "insert":
              for (j7 = j1, end2 = j22, asc2 = j1 <= end2; asc2 ? j7 < end2 : j7 > end2; asc2 ? j7++ : j7--) {
                result.push(["+", this.descalarize(seq2[j7], originals2)]);
                score -= 5;
              }
              break;
            case "replace":
              if (!this.options.keysOnly) {
                let asc3, end3;
                let asc4, end4;
                for (i7 = i1, end3 = i22, asc3 = i1 <= end3; asc3 ? i7 < end3 : i7 > end3; asc3 ? i7++ : i7--) {
                  result.push(["-", this.descalarize(seq1[i7], originals1)]);
                  score -= 5;
                }
                for (j7 = j1, end4 = j22, asc4 = j1 <= end4; asc4 ? j7 < end4 : j7 > end4; asc4 ? j7++ : j7--) {
                  result.push(["+", this.descalarize(seq2[j7], originals2)]);
                  score -= 5;
                }
              } else {
                let asc5, end5;
                for (i7 = i1, end5 = i22, asc5 = i1 <= end5; asc5 ? i7 < end5 : i7 > end5; asc5 ? i7++ : i7--) {
                  const change = this.diff(
                    this.descalarize(seq1[i7], originals1),
                    this.descalarize(seq2[i7 - i1 + j1], originals2)
                  );
                  if (!change.equal) {
                    result.push(["~", change.result]);
                    equal = false;
                  } else {
                    result.push([" "]);
                  }
                }
              }
              break;
          }
        }
        if (equal || opcodes.length === 0) {
          if (!this.options.full) {
            result = void 0;
          } else {
            result = obj1;
          }
          score = 100;
        } else {
          score = Math.max(0, score);
        }
        return { score, result, equal };
      }
      diff(obj1, obj2) {
        const type1 = extendedTypeOf3(obj1);
        const type2 = extendedTypeOf3(obj2);
        if (type1 === type2) {
          switch (type1) {
            case "object":
              return this.objectDiff(obj1, obj2);
            case "array":
              return this.arrayDiff(obj1, obj2);
          }
        }
        let score = 100;
        let result = obj1;
        let equal;
        if (!this.options.keysOnly) {
          if (type1 === "date" && type2 === "date") {
            equal = obj1.getTime() === obj2.getTime();
          } else {
            equal = obj1 === obj2;
          }
          if (!equal) {
            score = 0;
            if (this.options.outputNewOnly) {
              result = obj2;
            } else {
              result = { __old: obj1, __new: obj2 };
            }
          } else if (!this.options.full) {
            result = void 0;
          }
        } else {
          equal = true;
          result = void 0;
        }
        return { score, result, equal };
      }
    };
    function diff(obj1, obj2, options = {}) {
      if (options.precision !== void 0) {
        obj1 = roundObj(obj1, options.precision);
        obj2 = roundObj(obj2, options.precision);
      }
      return new JsonDiff(options).diff(obj1, obj2).result;
    }
    __name(diff, "diff");
    function diffString(obj1, obj2, options = {}) {
      return colorize(diff(obj1, obj2, options), options);
    }
    __name(diffString, "diffString");
    module2.exports = { diff, diffString, colorize, colorizeToCallback };
  }
});

// src/utils/diff-json.ts
function diffJsonObjects(jsonObjA, jsonObjB) {
  const result = import_json_diff.default.diff(jsonObjA, jsonObjB);
  if (result) {
    result.toString = () => import_json_diff.default.diffString(jsonObjA, jsonObjB);
    return result;
  } else {
    return null;
  }
}
function isNonDestructive(diff) {
  if (diff === null || typeof diff !== "object") {
    return true;
  }
  if (Object.keys(diff).some(
    (key) => key === "__old" || key.endsWith("__deleted")
  )) {
    return false;
  }
  if (Array.isArray(diff)) {
    for (const element of diff) {
      if (Array.isArray(element) && element.length === 2) {
        if (element[0] === "-") {
          return false;
        } else if (element[0] === "~") {
          return false;
        } else if (element[0] !== "+") {
          continue;
        }
        for (const innerElement of element) {
          if (!isNonDestructive(innerElement)) {
            return false;
          }
        }
      } else if (!isNonDestructive(element)) {
        return false;
      }
    }
  } else {
    for (const field in diff) {
      if (!isNonDestructive(diff[field])) {
        return false;
      }
    }
  }
  return true;
}
function isModifiedDiffValue(value) {
  return !!(value && typeof value === "object" && Object.keys(value).length === 2 && "__old" in value && "__new" in value);
}
var import_json_diff;
var init_diff_json = __esm({
  "src/utils/diff-json.ts"() {
    init_import_meta_url();
    import_json_diff = __toESM(require_lib5());
    __name(diffJsonObjects, "diffJsonObjects");
    __name(isNonDestructive, "isNonDestructive");
    __name(isModifiedDiffValue, "isModifiedDiffValue");
  }
});

// src/utils/merge-deep.ts
function mergeDeep4(target, source) {
  if (typeof target !== "object" || target === null) {
    return source;
  }
  if (typeof source !== "object" || source === null) {
    return target;
  }
  const result = { ...target };
  for (const key of Object.keys(source)) {
    const srcVal = source[key];
    const tgtVal = target[key];
    if (isObject4(tgtVal) && isObject4(srcVal)) {
      result[key] = mergeDeep4(tgtVal, srcVal);
    } else {
      result[key] = srcVal;
    }
  }
  return result;
}
function isObject4(value) {
  return typeof value === "object" && value !== null && !Array.isArray(value);
}
var init_merge_deep = __esm({
  "src/utils/merge-deep.ts"() {
    init_import_meta_url();
    __name(mergeDeep4, "mergeDeep");
    __name(isObject4, "isObject");
  }
});

// src/preview/settings.ts
function formatBindings2(env6) {
  const entries2 = Object.entries(env6);
  if (entries2.length === 0) {
    return ["  (none)"];
  }
  const nameWidth = Math.max(...entries2.map(([name2]) => name2.length));
  const typeWidth = Math.max(
    ...entries2.map(
      ([, binding]) => visibleLength(
        getBindingTypeFriendlyName(
          binding.type
        )
      )
    )
  );
  const valueWidth = Math.max(
    ...entries2.map(([, binding]) => getBindingValue(binding).length)
  );
  return entries2.map(([name2, binding]) => {
    const friendlyType = getBindingTypeFriendlyName(
      binding.type
    );
    return `  ${source_default.cyan(padToVisibleWidth(name2, nameWidth))}   ${source_default.dim(
      padToVisibleWidth(friendlyType, typeWidth)
    )}   ${padToVisibleWidth(getBindingValue(binding), valueWidth)}`;
  });
}
function formatPreviewsSettings(workerName, previewDefaults) {
  const lines = [];
  lines.push(`${source_default.bold.hex("#FFA500")("Worker:")} ${workerName}`);
  lines.push("");
  lines.push(`  ${source_default.bold.underline("Previews settings")}`);
  lines.push("");
  const settingsRows = [];
  if (previewDefaults.observability && typeof previewDefaults.observability === "object") {
    const enabledLabel = previewDefaults.observability.enabled ? "enabled" : "disabled";
    const sampling = typeof previewDefaults.observability.head_sampling_rate === "number" ? `, ${previewDefaults.observability.head_sampling_rate.toFixed(
      1
    )} sampling` : "";
    settingsRows.push(["observability", `${enabledLabel}${sampling}`]);
  }
  if (typeof previewDefaults.logpush === "boolean") {
    settingsRows.push([
      "logpush",
      previewDefaults.logpush ? "enabled" : "disabled"
    ]);
  }
  if (typeof previewDefaults.limits?.cpu_ms === "number" || typeof previewDefaults.limits?.subrequests === "number") {
    const limitParts = [
      typeof previewDefaults.limits?.cpu_ms === "number" ? `cpu_ms: ${previewDefaults.limits.cpu_ms}` : void 0,
      typeof previewDefaults.limits?.subrequests === "number" ? `subrequests: ${previewDefaults.limits.subrequests}` : void 0
    ].filter((value) => value !== void 0);
    settingsRows.push(["limits", limitParts.join(", ")]);
  }
  if (typeof previewDefaults.placement?.mode === "string") {
    settingsRows.push(["placement", previewDefaults.placement.mode]);
  }
  if (settingsRows.length > 0) {
    const labelWidth = Math.max(...settingsRows.map(([label]) => label.length));
    for (const [label, value] of settingsRows) {
      lines.push(
        `  ${source_default.cyan(padToVisibleWidth(label, labelWidth))}   ${value}`
      );
    }
  }
  lines.push("");
  lines.push(source_default.bold("  Bindings"));
  const env6 = Object.fromEntries(
    Object.entries(previewDefaults.env ?? {}).map(([name2, binding]) => [
      name2,
      { ...binding, fromConfig: false }
    ])
  );
  lines.push(...formatBindings2(env6));
  lines.push("");
  return drawBox(lines);
}
async function handlePreviewSettingsUpdateCommand(args, { config }) {
  const workerName = resolveWorkerName(args, config);
  const accountId = await requireAuth(config);
  const currentPreviewDefaults = await getWorkerPreviewDefaults(
    config,
    accountId,
    workerName
  );
  const resolvedConfigFileSettings = assemblePreviewDefaults(config);
  const requestPayloadPreviewDefaults = mergeDeep4(
    currentPreviewDefaults,
    resolvedConfigFileSettings
  );
  if (currentPreviewDefaults.env !== void 0 || resolvedConfigFileSettings.env !== void 0) {
    requestPayloadPreviewDefaults.env = {
      ...currentPreviewDefaults.env,
      ...resolvedConfigFileSettings.env
    };
  }
  const diff = diffJsonObjects(
    currentPreviewDefaults,
    requestPayloadPreviewDefaults
  );
  if (!diff) {
    logger.log(
      `
\u2728 Previews settings for Worker ${source_default.bold.cyan(
        workerName
      )} are already up to date.`
    );
    return;
  }
  logger.log(`${diff}`);
  if (!args.skipConfirmation) {
    const shouldProceed = await confirm(
      `Apply these updates to the Previews settings of Worker ${source_default.bold.cyan(
        workerName
      )}?`
    );
    if (!shouldProceed) {
      logger.log("Aborted.");
      return;
    }
  }
  const updatedPreviewDefaults = await editWorkerPreviewDefaults(
    config,
    accountId,
    workerName,
    requestPayloadPreviewDefaults
  );
  logger.log(
    `
\u2728 Updated Previews settings for Worker ${source_default.bold.cyan(workerName)}.`
  );
  logger.log(formatPreviewsSettings(workerName, updatedPreviewDefaults));
}
async function handlePreviewSettingsCommand(args, { config }) {
  const workerName = resolveWorkerName(args, config);
  const accountId = await requireAuth(config);
  const previewDefaults = await getWorkerPreviewDefaults(
    config,
    accountId,
    workerName
  );
  if (args.json) {
    logger.log(JSON.stringify(previewDefaults, null, 2));
    return;
  }
  logger.log(formatPreviewsSettings(workerName, previewDefaults));
}
var init_settings19 = __esm({
  "src/preview/settings.ts"() {
    init_import_meta_url();
    init_dist();
    init_source();
    init_dialogs();
    init_logger();
    init_user3();
    init_box();
    init_diff_json();
    init_merge_deep();
    init_api3();
    init_shared6();
    __name(formatBindings2, "formatBindings");
    __name(formatPreviewsSettings, "formatPreviewsSettings");
    __name(handlePreviewSettingsUpdateCommand, "handlePreviewSettingsUpdateCommand");
    __name(handlePreviewSettingsCommand, "handlePreviewSettingsCommand");
  }
});

// src/preview/index.ts
var previewCommand, previewDeleteCommand, previewSettingsUpdateCommand, previewSettingsCommand, previewSecretNamespace, previewSecretPutCommand, previewSecretDeleteCommand, previewSecretListCommand, previewSecretBulkCommand;
var init_preview3 = __esm({
  "src/preview/index.ts"() {
    init_import_meta_url();
    init_create_command();
    init_preview2();
    init_secret3();
    init_settings19();
    previewCommand = createCommand({
      metadata: {
        description: "\u{1F440} Create a Preview deployment of the current Worker",
        owner: "Workers: Deploy and Config",
        category: "Compute & AI",
        status: "private beta"
      },
      positionalArgs: ["script"],
      args: {
        script: {
          describe: "The path to an entry point for your Worker",
          type: "string",
          requiresArg: true
        },
        name: {
          describe: "Name of the Preview (defaults to current git branch)",
          type: "string",
          requiresArg: true
        },
        tag: {
          describe: "A tag for this Preview deployment",
          type: "string",
          requiresArg: true
        },
        message: {
          describe: "A descriptive message for this Preview deployment",
          type: "string",
          requiresArg: true
        },
        json: {
          describe: "Return output as JSON",
          type: "boolean",
          default: false
        },
        "ignore-defaults": {
          describe: "Only use settings from your config file, ignoring any Previews settings configured in the Cloudflare dashboard",
          type: "boolean",
          default: false
        },
        "worker-name": {
          describe: "Name of the Worker to target (defaults to the name in your local config file)",
          type: "string",
          requiresArg: true
        }
      },
      behaviour: {
        useConfigRedirectIfAvailable: true,
        printBanner: /* @__PURE__ */ __name((args) => args.json !== true, "printBanner")
      },
      handler: handlePreviewCommand
    });
    previewDeleteCommand = createCommand({
      metadata: {
        description: "Delete a Preview and all its deployments",
        owner: "Workers: Deploy and Config",
        category: "Compute & AI",
        status: "private beta"
      },
      args: {
        name: {
          describe: "Name of the Preview to delete (defaults to current git branch)",
          type: "string",
          requiresArg: true
        },
        "skip-confirmation": {
          describe: "Skip the confirmation prompt",
          type: "boolean",
          default: false,
          alias: "y"
        },
        "worker-name": {
          describe: "Name of the Worker to target (defaults to the name in your local config file)",
          type: "string",
          requiresArg: true
        }
      },
      handler: handlePreviewDeleteCommand
    });
    previewSettingsUpdateCommand = createCommand({
      metadata: {
        description: "Update the Worker's Previews settings using the contents of the Wrangler config file",
        owner: "Workers: Deploy and Config",
        category: "Compute & AI",
        status: "private beta"
      },
      args: {
        "worker-name": {
          describe: "Name of the Worker to target (defaults to the name in your local config file)",
          type: "string",
          requiresArg: true
        },
        "skip-confirmation": {
          describe: "Skip the confirmation prompt",
          type: "boolean",
          default: false,
          alias: "y"
        }
      },
      handler: handlePreviewSettingsUpdateCommand
    });
    previewSettingsCommand = createCommand({
      metadata: {
        description: "Show the current Previews settings for a Worker",
        owner: "Workers: Deploy and Config",
        category: "Compute & AI",
        status: "private beta"
      },
      args: {
        "worker-name": {
          describe: "Name of the Worker to target (defaults to the name in your local config file)",
          type: "string",
          requiresArg: true
        },
        json: {
          describe: "Return output as JSON",
          type: "boolean",
          default: false
        }
      },
      behaviour: {
        printBanner: /* @__PURE__ */ __name((args) => args.json !== true, "printBanner")
      },
      handler: handlePreviewSettingsCommand
    });
    previewSecretNamespace = createNamespace({
      metadata: {
        description: "Manage secrets for Worker Previews",
        owner: "Workers: Deploy and Config",
        category: "Compute & AI",
        status: "private beta"
      }
    });
    previewSecretPutCommand = createCommand({
      metadata: {
        description: "Create or update a secret in the Worker's Previews settings",
        owner: "Workers: Deploy and Config",
        category: "Compute & AI",
        status: "private beta"
      },
      positionalArgs: ["key"],
      args: {
        key: {
          describe: "The secret name to be accessible in the Worker",
          type: "string",
          demandOption: true
        },
        "worker-name": {
          describe: "Name of the Worker to target (defaults to the name in your local config file)",
          type: "string",
          requiresArg: true
        }
      },
      handler: handlePreviewSecretPutCommand
    });
    previewSecretDeleteCommand = createCommand({
      metadata: {
        description: "Delete a secret from the Worker's Previews settings",
        owner: "Workers: Deploy and Config",
        category: "Compute & AI",
        status: "private beta"
      },
      positionalArgs: ["key"],
      args: {
        key: {
          describe: "The secret name to delete",
          type: "string",
          demandOption: true
        },
        "skip-confirmation": {
          describe: "Skip the confirmation prompt",
          type: "boolean",
          default: false,
          alias: "y"
        },
        "worker-name": {
          describe: "Name of the Worker to target (defaults to the name in your local config file)",
          type: "string",
          requiresArg: true
        }
      },
      handler: handlePreviewSecretDeleteCommand
    });
    previewSecretListCommand = createCommand({
      metadata: {
        description: "List all secrets in the Worker's Previews settings",
        owner: "Workers: Deploy and Config",
        category: "Compute & AI",
        status: "private beta"
      },
      args: {
        json: {
          describe: "Return output as JSON",
          type: "boolean",
          default: false
        },
        "worker-name": {
          describe: "Name of the Worker to target (defaults to the name in your local config file)",
          type: "string",
          requiresArg: true
        }
      },
      behaviour: {
        printBanner: /* @__PURE__ */ __name((args) => args.json !== true, "printBanner")
      },
      handler: handlePreviewSecretListCommand
    });
    previewSecretBulkCommand = createCommand({
      metadata: {
        description: "Upload multiple secrets to the Worker's Previews settings",
        owner: "Workers: Deploy and Config",
        category: "Compute & AI",
        status: "private beta"
      },
      positionalArgs: ["file"],
      args: {
        file: {
          describe: "The file of key-value pairs to upload, as JSON or .env format",
          type: "string"
        },
        "worker-name": {
          describe: "Name of the Worker to target (defaults to the name in your local config file)",
          type: "string",
          requiresArg: true
        }
      },
      handler: handlePreviewSecretBulkCommand
    });
  }
});

// src/queues/cli/commands/index.ts
var queuesNamespace;
var init_commands9 = __esm({
  "src/queues/cli/commands/index.ts"() {
    init_import_meta_url();
    init_create_command();
    queuesNamespace = createNamespace({
      metadata: {
        description: "\u{1F4EC} Manage Workers Queues",
        owner: "Product: Queues",
        status: "stable",
        category: "Compute & AI"
      }
    });
  }
});

// src/queues/cli/commands/consumer/index.ts
var queuesConsumerNamespace;
var init_consumer = __esm({
  "src/queues/cli/commands/consumer/index.ts"() {
    init_import_meta_url();
    init_create_command();
    queuesConsumerNamespace = createNamespace({
      metadata: {
        description: "Configure queue consumers",
        owner: "Product: Queues",
        status: "stable"
      }
    });
  }
});

// src/queues/cli/commands/consumer/http-pull/index.ts
var queuesConsumerHttpNamespace;
var init_http_pull = __esm({
  "src/queues/cli/commands/consumer/http-pull/index.ts"() {
    init_import_meta_url();
    init_create_command();
    queuesConsumerHttpNamespace = createNamespace({
      metadata: {
        description: "Configure Queue HTTP Pull Consumers",
        owner: "Product: Queues",
        status: "stable"
      }
    });
  }
});
async function createQueue(config, body) {
  const accountId = await requireAuth(config);
  return fetchResult(config, queuesUrl(accountId), {
    method: "POST",
    body: JSON.stringify(body)
  });
}
async function updateQueue(config, body, queue_id) {
  const accountId = await requireAuth(config);
  return fetchResult(config, queuesUrl(accountId, queue_id), {
    method: "PATCH",
    body: JSON.stringify(body)
  });
}
async function deleteQueue(config, queueName) {
  const queue = await getQueue(config, queueName);
  return deleteQueueById(config, queue.queue_id);
}
async function deleteQueueById(config, queueId) {
  const accountId = await requireAuth(config);
  return fetchResult(config, queuesUrl(accountId, queueId), {
    method: "DELETE"
  });
}
async function listQueues(config, page, name2) {
  page = page ?? 1;
  const accountId = await requireAuth(config);
  const params = new Url.URLSearchParams({ page: page.toString() });
  if (name2) {
    params.append("name", name2);
  }
  return fetchResult(config, queuesUrl(accountId), {}, params);
}
async function listAllQueues(config, queueNames) {
  const accountId = await requireAuth(config);
  const params = new Url.URLSearchParams();
  queueNames.forEach((e10) => {
    params.append("name", e10);
  });
  return fetchPagedListResult(config, queuesUrl(accountId), {}, params);
}
async function getQueue(config, queueName) {
  const queues = await listQueues(config, 1, queueName);
  if (queues.length === 0) {
    throw new UserError(
      `Queue "${queueName}" does not exist. To create it, run: wrangler queues create ${queueName}`
    );
  }
  return queues[0];
}
async function ensureQueuesExistByConfig(config) {
  const producers = (config.queues.producers || []).map(
    (producer) => producer.queue
  );
  const consumers = (config.queues.consumers || []).map(
    (consumer) => consumer.queue
  );
  const queueNames = producers.concat(consumers);
  await ensureQueuesExist(config, queueNames);
}
async function ensureQueuesExist(config, queueNames) {
  if (queueNames.length > 0) {
    const existingQueues = (await listAllQueues(config, queueNames)).map(
      (q7) => q7.queue_name
    );
    if (queueNames.length !== existingQueues.length) {
      const queueSet = new Set(existingQueues);
      for (const queue of queueNames) {
        if (!queueSet.has(queue)) {
          throw new UserError(
            `Queue "${queue}" does not exist. To create it, run: wrangler queues create ${queue}`
          );
        }
      }
    }
  }
}
async function getQueueById(config, accountId, queueId) {
  return fetchResult(config, queuesUrl(accountId, queueId), {});
}
async function postConsumer(config, queueName, body) {
  const queue = await getQueue(config, queueName);
  return postConsumerById(config, queue.queue_id, body);
}
async function postConsumerById(config, queueId, body) {
  const accountId = await requireAuth(config);
  return fetchResult(config, queueConsumersUrl(accountId, queueId), {
    method: "POST",
    body: JSON.stringify(body)
  });
}
async function putConsumerById(config, queueId, consumerId, body) {
  const accountId = await requireAuth(config);
  return fetchResult(
    config,
    queueConsumersUrl(accountId, queueId, consumerId),
    {
      method: "PUT",
      body: JSON.stringify(body)
    }
  );
}
async function putConsumer(config, queueName, scriptName, envName, body) {
  const queue = await getQueue(config, queueName);
  const targetConsumer = await resolveWorkerConsumerByName(
    config,
    scriptName,
    envName,
    queue
  );
  return putConsumerById(
    config,
    queue.queue_id,
    targetConsumer.consumer_id,
    body
  );
}
async function resolveWorkerConsumerByName(config, consumerName, envName, queue) {
  const queueName = queue.queue_name;
  const consumers = queue.consumers.filter(
    (c8) => c8.type === "worker" && (c8.script === consumerName || c8.service === consumerName)
  );
  if (consumers.length === 0) {
    throw new UserError(
      `No worker consumer '${consumerName}' exists for queue ${queue.queue_name}`
    );
  }
  if (consumers.length > 1) {
    const targetEnv = envName ?? await getDefaultService(config, consumerName);
    const targetConsumers = consumers.filter(
      (c8) => c8.environment === targetEnv
    );
    if (targetConsumers.length === 0) {
      throw new UserError(
        `No worker consumer '${consumerName}' exists for queue ${queueName}`
      );
    }
    return consumers[0];
  }
  if (consumers[0].service) {
    const targetEnv = envName ?? await getDefaultService(config, consumerName);
    if (targetEnv != consumers[0].environment) {
      throw new UserError(
        `No worker consumer '${consumerName}' exists for queue ${queueName}`
      );
    }
  }
  return consumers[0];
}
async function deleteConsumerById(config, queueId, consumerId) {
  const accountId = await requireAuth(config);
  return fetchResult(
    config,
    queueConsumersUrl(accountId, queueId, consumerId),
    {
      method: "DELETE"
    }
  );
}
async function deletePullConsumer(config, queueName) {
  const queue = await getQueue(config, queueName);
  const consumer = queue.consumers[0];
  if (consumer?.type !== "http_pull") {
    throw new UserError(`No http_pull consumer exists for queue ${queueName}`);
  }
  return deleteConsumerById(config, queue.queue_id, consumer.consumer_id);
}
async function getDefaultService(config, serviceName) {
  const accountId = await requireAuth(config);
  const service = await fetchResult(
    config,
    `/accounts/${accountId}/workers/services/${serviceName}`,
    {
      method: "GET"
    }
  );
  logger.info(service);
  return service.default_environment.environment;
}
async function deleteWorkerConsumer(config, queueName, scriptName, envName) {
  const queue = await getQueue(config, queueName);
  const targetConsumer = await resolveWorkerConsumerByName(
    config,
    scriptName,
    envName,
    queue
  );
  return deleteConsumerById(config, queue.queue_id, targetConsumer.consumer_id);
}
async function purgeQueue(config, queueName) {
  const accountId = await requireAuth(config);
  const queue = await getQueue(config, queueName);
  const purgeURL = `${queuesUrl(accountId, queue.queue_id)}/purge`;
  const body = { delete_messages_permanently: true };
  return fetchResult(config, purgeURL, {
    method: "POST",
    body: JSON.stringify(body)
  });
}
async function createEventSubscription(config, queueName, request4) {
  const accountId = await requireAuth(config);
  const queue = await getQueue(config, queueName);
  const body = {
    ...request4,
    destination: {
      type: "queues.queue",
      queue_id: queue.queue_id
    }
  };
  return fetchResult(
    config,
    `/accounts/${accountId}/event_subscriptions/subscriptions`,
    {
      method: "POST",
      body: JSON.stringify(body)
    }
  );
}
async function listEventSubscriptions(config, queueName, options) {
  const accountId = await requireAuth(config);
  const queue = await getQueue(config, queueName);
  const params = new Url.URLSearchParams({
    queue_id: queue.queue_id,
    page: (options?.page || 1).toString(),
    per_page: (options?.per_page || 20).toString()
  });
  return fetchResult(
    config,
    `/accounts/${accountId}/event_subscriptions/subscriptions`,
    {},
    params
  );
}
async function getEventSubscription(config, subscriptionId) {
  const accountId = await requireAuth(config);
  return fetchResult(
    config,
    `/accounts/${accountId}/event_subscriptions/subscriptions/${subscriptionId}`
  );
}
async function updateEventSubscription(config, subscriptionId, request4) {
  const accountId = await requireAuth(config);
  return fetchResult(
    config,
    `/accounts/${accountId}/event_subscriptions/subscriptions/${subscriptionId}`,
    {
      method: "PATCH",
      body: JSON.stringify(request4)
    }
  );
}
async function deleteEventSubscription(config, subscriptionId) {
  const accountId = await requireAuth(config);
  return fetchResult(
    config,
    `/accounts/${accountId}/event_subscriptions/subscriptions/${subscriptionId}`,
    {
      method: "DELETE"
    }
  );
}
async function getEventSubscriptionForQueue(config, queueName, subscriptionId) {
  const subscription = await getEventSubscription(config, subscriptionId);
  const queue = await getQueue(config, queueName);
  if (subscription.destination.queue_id !== queue.queue_id) {
    throw new UserError(
      `Subscription '${subscriptionId}' does not belong to queue '${queueName}'. This subscription is configured for a different queue.`
    );
  }
  return subscription;
}
var queuesUrl, queueConsumersUrl;
var init_client11 = __esm({
  "src/queues/client.ts"() {
    init_import_meta_url();
    init_dist();
    init_cfetch();
    init_logger();
    init_user3();
    queuesUrl = /* @__PURE__ */ __name((accountId, queueId) => {
      let url4 = `/accounts/${accountId}/queues`;
      if (queueId) {
        url4 += `/${queueId}`;
      }
      return url4;
    }, "queuesUrl");
    queueConsumersUrl = /* @__PURE__ */ __name((accountId, queueId, consumerId) => {
      let url4 = `${queuesUrl(accountId, queueId)}/consumers`;
      if (consumerId) {
        url4 += `/${consumerId}`;
      }
      return url4;
    }, "queueConsumersUrl");
    __name(createQueue, "createQueue");
    __name(updateQueue, "updateQueue");
    __name(deleteQueue, "deleteQueue");
    __name(deleteQueueById, "deleteQueueById");
    __name(listQueues, "listQueues");
    __name(listAllQueues, "listAllQueues");
    __name(getQueue, "getQueue");
    __name(ensureQueuesExistByConfig, "ensureQueuesExistByConfig");
    __name(ensureQueuesExist, "ensureQueuesExist");
    __name(getQueueById, "getQueueById");
    __name(postConsumer, "postConsumer");
    __name(postConsumerById, "postConsumerById");
    __name(putConsumerById, "putConsumerById");
    __name(putConsumer, "putConsumer");
    __name(resolveWorkerConsumerByName, "resolveWorkerConsumerByName");
    __name(deleteConsumerById, "deleteConsumerById");
    __name(deletePullConsumer, "deletePullConsumer");
    __name(getDefaultService, "getDefaultService");
    __name(deleteWorkerConsumer, "deleteWorkerConsumer");
    __name(purgeQueue, "purgeQueue");
    __name(createEventSubscription, "createEventSubscription");
    __name(listEventSubscriptions, "listEventSubscriptions");
    __name(getEventSubscription, "getEventSubscription");
    __name(updateEventSubscription, "updateEventSubscription");
    __name(deleteEventSubscription, "deleteEventSubscription");
    __name(getEventSubscriptionForQueue, "getEventSubscriptionForQueue");
  }
});

// src/queues/cli/commands/consumer/http-pull/add.ts
var queuesConsumerHttpAddCommand;
var init_add = __esm({
  "src/queues/cli/commands/consumer/http-pull/add.ts"() {
    init_import_meta_url();
    init_dist();
    init_create_command();
    init_logger();
    init_client11();
    queuesConsumerHttpAddCommand = createCommand({
      metadata: {
        description: "Add a Queue HTTP Pull Consumer",
        owner: "Product: Queues",
        status: "stable"
      },
      args: {
        "queue-name": {
          type: "string",
          demandOption: true,
          description: "Name of the queue for the consumer"
        },
        "batch-size": {
          type: "number",
          description: "Maximum number of messages per batch"
        },
        "message-retries": {
          type: "number",
          description: "Maximum number of retries for each message"
        },
        "dead-letter-queue": {
          type: "string",
          description: "Queue to send messages that failed to be consumed"
        },
        "visibility-timeout-secs": {
          type: "number",
          description: "The number of seconds a message will wait for an acknowledgement before being returned to the queue."
        },
        "retry-delay-secs": {
          type: "number",
          description: "The number of seconds to wait before retrying a message"
        }
      },
      positionalArgs: ["queue-name"],
      async handler(args, { config }) {
        if (Array.isArray(args.retryDelaySecs)) {
          throw new CommandLineArgsError(
            `Cannot specify --retry-delay-secs multiple times`
          );
        }
        const body = {
          type: "http_pull",
          settings: {
            batch_size: args.batchSize,
            max_retries: args.messageRetries,
            visibility_timeout_ms: args.visibilityTimeoutSecs ? args.visibilityTimeoutSecs * 1e3 : void 0,
            retry_delay: args.retryDelaySecs
          },
          dead_letter_queue: args.deadLetterQueue
        };
        logger.log(`Adding consumer to queue ${args.queueName}.`);
        await postConsumer(config, args.queueName, body);
        logger.log(`Added consumer to queue ${args.queueName}.`);
      }
    });
  }
});

// src/queues/cli/commands/consumer/http-pull/remove.ts
var queuesConsumerHttpRemoveCommand;
var init_remove = __esm({
  "src/queues/cli/commands/consumer/http-pull/remove.ts"() {
    init_import_meta_url();
    init_create_command();
    init_logger();
    init_client11();
    queuesConsumerHttpRemoveCommand = createCommand({
      metadata: {
        description: "Remove a Queue HTTP Pull Consumer",
        owner: "Product: Queues",
        status: "stable"
      },
      args: {
        "queue-name": {
          type: "string",
          demandOption: true,
          description: "Name of the queue for the consumer"
        }
      },
      positionalArgs: ["queue-name"],
      async handler(args, { config }) {
        logger.log(`Removing consumer from queue ${args.queueName}.`);
        await deletePullConsumer(config, args.queueName);
        logger.log(`Removed consumer from queue ${args.queueName}.`);
      }
    });
  }
});

// src/queues/cli/commands/consumer/worker/index.ts
var queuesConsumerWorkerNamespace;
var init_worker2 = __esm({
  "src/queues/cli/commands/consumer/worker/index.ts"() {
    init_import_meta_url();
    init_create_command();
    queuesConsumerWorkerNamespace = createNamespace({
      metadata: {
        description: "Configure Queue Worker Consumers",
        owner: "Product: Queues",
        status: "stable"
      }
    });
  }
});

// src/queues/cli/commands/consumer/worker/add.ts
var queuesConsumerAddCommand;
var init_add2 = __esm({
  "src/queues/cli/commands/consumer/worker/add.ts"() {
    init_import_meta_url();
    init_dist();
    init_create_command();
    init_logger();
    init_client11();
    queuesConsumerAddCommand = createCommand({
      metadata: {
        description: "Add a Queue Worker Consumer",
        owner: "Product: Queues",
        status: "stable"
      },
      args: {
        "queue-name": {
          type: "string",
          demandOption: true,
          description: "Name of the queue to configure"
        },
        "script-name": {
          type: "string",
          demandOption: true,
          description: "Name of the consumer script"
        },
        "batch-size": {
          type: "number",
          describe: "Maximum number of messages per batch"
        },
        "batch-timeout": {
          type: "number",
          describe: "Maximum number of seconds to wait to fill a batch with messages"
        },
        "message-retries": {
          type: "number",
          describe: "Maximum number of retries for each message"
        },
        "dead-letter-queue": {
          type: "string",
          describe: "Queue to send messages that failed to be consumed"
        },
        "max-concurrency": {
          type: "number",
          describe: "The maximum number of concurrent consumer Worker invocations. Must be a positive integer"
        },
        "retry-delay-secs": {
          type: "number",
          describe: "The number of seconds to wait before retrying a message"
        }
      },
      positionalArgs: ["queue-name", "script-name"],
      async handler(args, { config }) {
        if (Array.isArray(args.retryDelaySecs)) {
          throw new CommandLineArgsError(
            `Cannot specify --retry-delay-secs multiple times`
          );
        }
        const body = {
          script_name: args.scriptName,
          // TODO(soon) is this still the correct usage of the environment?
          environment_name: args.env ?? "",
          // API expects empty string as default
          type: "worker",
          settings: {
            batch_size: args.batchSize,
            max_retries: args.messageRetries,
            max_wait_time_ms: args.batchTimeout !== void 0 ? 1e3 * args.batchTimeout : void 0,
            max_concurrency: args.maxConcurrency,
            retry_delay: args.retryDelaySecs
          },
          dead_letter_queue: args.deadLetterQueue
        };
        logger.log(`Adding consumer to queue ${args.queueName}.`);
        await postConsumer(config, args.queueName, body);
        logger.log(`Added consumer to queue ${args.queueName}.`);
      }
    });
  }
});

// src/queues/cli/commands/consumer/worker/remove.ts
var queuesConsumerRemoveCommand;
var init_remove2 = __esm({
  "src/queues/cli/commands/consumer/worker/remove.ts"() {
    init_import_meta_url();
    init_create_command();
    init_logger();
    init_client11();
    queuesConsumerRemoveCommand = createCommand({
      metadata: {
        description: "Remove a Queue Worker Consumer",
        owner: "Product: Queues",
        status: "stable"
      },
      args: {
        "queue-name": {
          type: "string",
          demandOption: true,
          description: "Name of the queue to configure"
        },
        "script-name": {
          type: "string",
          demandOption: true,
          description: "Name of the consumer script"
        }
      },
      positionalArgs: ["queue-name", "script-name"],
      async handler(args, { config }) {
        logger.log(`Removing consumer from queue ${args.queueName}.`);
        await deleteWorkerConsumer(
          config,
          args.queueName,
          args.scriptName,
          args.env
        );
        logger.log(`Removed consumer from queue ${args.queueName}.`);
      }
    });
  }
});

// src/queues/constants.ts
var INVALID_CONSUMER_SETTINGS_ERROR, INVALID_QUEUE_SETTINGS_ERROR, MIN_DELIVERY_DELAY_SECS, MAX_DELIVERY_DELAY_SECS, MIN_MESSAGE_RETENTION_PERIOD_SECS, MAX_MESSAGE_RETENTION_PERIOD_SECS;
var init_constants18 = __esm({
  "src/queues/constants.ts"() {
    init_import_meta_url();
    INVALID_CONSUMER_SETTINGS_ERROR = 100127;
    INVALID_QUEUE_SETTINGS_ERROR = 100128;
    MIN_DELIVERY_DELAY_SECS = 0;
    MAX_DELIVERY_DELAY_SECS = 86400;
    MIN_MESSAGE_RETENTION_PERIOD_SECS = 60;
    MAX_MESSAGE_RETENTION_PERIOD_SECS = 1209600;
  }
});

// src/queues/utils.ts
function handleFetchError(e10) {
  if (e10.code === INVALID_CONSUMER_SETTINGS_ERROR) {
    throw new UserError(`The specified consumer settings are invalid.`);
  }
  if (e10.code === INVALID_QUEUE_SETTINGS_ERROR) {
    throw new UserError(`The specified queue settings are invalid.`);
  }
  throw e10;
}
var init_utils19 = __esm({
  "src/queues/utils.ts"() {
    init_import_meta_url();
    init_dist();
    init_constants18();
    __name(handleFetchError, "handleFetchError");
  }
});

// src/queues/cli/commands/create.ts
function createBody(args) {
  const body = {
    queue_name: args.name
  };
  body.settings = {};
  if (args.deliveryDelaySecs != void 0) {
    if (args.deliveryDelaySecs < MIN_DELIVERY_DELAY_SECS || args.deliveryDelaySecs > MAX_DELIVERY_DELAY_SECS) {
      throw new CommandLineArgsError(
        `Invalid --delivery-delay-secs value: ${args.deliveryDelaySecs}. Must be between ${MIN_DELIVERY_DELAY_SECS} and ${MAX_DELIVERY_DELAY_SECS}`
      );
    }
    body.settings.delivery_delay = args.deliveryDelaySecs;
  }
  if (args.messageRetentionPeriodSecs != void 0) {
    if (args.messageRetentionPeriodSecs < MIN_MESSAGE_RETENTION_PERIOD_SECS || args.messageRetentionPeriodSecs > MAX_MESSAGE_RETENTION_PERIOD_SECS) {
      throw new CommandLineArgsError(
        `Invalid --message-retention-period-secs value: ${args.messageRetentionPeriodSecs}. Must be between ${MIN_MESSAGE_RETENTION_PERIOD_SECS} and ${MAX_MESSAGE_RETENTION_PERIOD_SECS}`
      );
    }
    body.settings.message_retention_period = args.messageRetentionPeriodSecs;
  }
  if (Object.keys(body.settings).length === 0) {
    body.settings = void 0;
  }
  return body;
}
var queuesCreateCommand;
var init_create12 = __esm({
  "src/queues/cli/commands/create.ts"() {
    init_import_meta_url();
    init_dist();
    init_esm2();
    init_create_command();
    init_logger();
    init_getValidBindingName();
    init_client11();
    init_constants18();
    init_utils19();
    queuesCreateCommand = createCommand({
      metadata: {
        description: "Create a queue",
        owner: "Product: Queues",
        status: "stable"
      },
      args: {
        name: {
          type: "string",
          demandOption: true,
          description: "The name of the queue"
        },
        "delivery-delay-secs": {
          type: "number",
          describe: `How long a published message should be delayed for, in seconds. Must be between ${MIN_DELIVERY_DELAY_SECS} and ${MAX_DELIVERY_DELAY_SECS}`
        },
        "message-retention-period-secs": {
          type: "number",
          describe: "How long to retain a message in the queue, in seconds. Must be between 60 and 86400 if on free tier, otherwise must be between 60 and 1209600"
        }
      },
      positionalArgs: ["name"],
      async handler(args, { config }) {
        const body = createBody(args);
        try {
          logger.log(`\u{1F300} Creating queue '${args.name}'`);
          await createQueue(config, body);
          logger.log(esm_default3`
			✅ Created queue '${args.name}'

			Configure your Worker to send messages to this queue:

			${formatConfigSnippet(
            {
              queues: {
                producers: [
                  {
                    queue: args.name,
                    binding: getValidBindingName(args.name, "queue")
                  }
                ]
              }
            },
            config.configPath
          )}
			Configure your Worker to consume messages from this queue:

			${formatConfigSnippet(
            {
              queues: {
                consumers: [
                  {
                    queue: args.name
                  }
                ]
              }
            },
            config.configPath
          )}`);
        } catch (e10) {
          handleFetchError(e10);
        }
      }
    });
    __name(createBody, "createBody");
  }
});

// src/queues/cli/commands/delete.ts
var queuesDeleteCommand;
var init_delete11 = __esm({
  "src/queues/cli/commands/delete.ts"() {
    init_import_meta_url();
    init_create_command();
    init_logger();
    init_client11();
    queuesDeleteCommand = createCommand({
      metadata: {
        description: "Delete a queue",
        owner: "Product: Queues",
        status: "stable"
      },
      args: {
        name: {
          type: "string",
          demandOption: true,
          description: "The name of the queue"
        }
      },
      positionalArgs: ["name"],
      async handler(args, { config }) {
        logger.log(`Deleting queue ${args.name}.`);
        await deleteQueue(config, args.name);
        logger.log(`Deleted queue ${args.name}.`);
      }
    });
  }
});

// src/queues/cli/commands/info.ts
var queuesInfoCommand;
var init_info3 = __esm({
  "src/queues/cli/commands/info.ts"() {
    init_import_meta_url();
    init_create_command();
    init_logger();
    init_user3();
    init_client11();
    queuesInfoCommand = createCommand({
      metadata: {
        description: "Get queue information",
        owner: "Product: Queues",
        status: "stable"
      },
      args: {
        name: {
          type: "string",
          demandOption: true,
          description: "The name of the queue"
        }
      },
      positionalArgs: ["name"],
      async handler(args, { config }) {
        const queue = await getQueue(config, args.name);
        const accountId = await requireAuth(config);
        logger.log(`Queue Name: ${queue.queue_name}`);
        logger.log(`Queue ID: ${queue.queue_id}`);
        logger.log(`Created On: ${queue.created_on}`);
        logger.log(`Last Modified: ${queue.modified_on}`);
        logger.log(`Number of Producers: ${queue.producers_total_count}`);
        if (queue.producers_total_count > 0) {
          logger.log(
            `Producers:${queue.producers.map((p7) => p7.type === "r2_bucket" ? ` ${p7.type}:${p7.bucket_name}` : ` ${p7.type}:${p7.script}`).toString()}`
          );
        }
        logger.log(`Number of Consumers: ${queue.consumers_total_count}`);
        if (queue.consumers_total_count > 0) {
          logger.log(
            `Consumers: ${queue.consumers.map((c8) => {
              if (c8.type === "r2_bucket") {
                return `${c8.type}:${c8.bucket_name}`;
              }
              if (c8.type === "http_pull") {
                return `HTTP Pull Consumer.
Pull messages using:
curl "https://api.cloudflare.com/client/v4/accounts/${accountId || "<add your account id here>"}/queues/${queue.queue_id || "<add your queue id here>"}/messages/pull" \\
	--header "Authorization: Bearer <add your api key here>" \\
	--header "Content-Type: application/json" \\
	--data '{ "visibility_timeout": 10000, "batch_size": 2 }'`;
              }
              return `${c8.type}:${c8.script}`;
            }).toString()}`
          );
        }
      }
    });
  }
});

// src/queues/cli/commands/list.ts
var queuesListCommand;
var init_list15 = __esm({
  "src/queues/cli/commands/list.ts"() {
    init_import_meta_url();
    init_create_command();
    init_logger();
    init_client11();
    queuesListCommand = createCommand({
      metadata: {
        description: "List queues",
        status: "stable",
        owner: "Product: Queues"
      },
      args: {
        page: {
          type: "number",
          describe: "Page number for pagination"
        }
      },
      async handler(args, { config }) {
        const queues = await listQueues(config, args.page);
        logger.table(
          queues.map((queue) => ({
            id: queue.queue_id,
            name: queue.queue_name,
            created_on: queue.created_on,
            modified_on: queue.modified_on,
            producers: queue.producers_total_count.toString(),
            consumers: queue.consumers_total_count.toString()
          }))
        );
      }
    });
  }
});

// src/queues/cli/commands/pause-resume.ts
async function toggleDeliveryPaused(args, config, paused) {
  const body = {
    queue_name: args.name,
    settings: {
      delivery_paused: paused
    }
  };
  try {
    const currentQueue = await getQueue(config, args.name);
    let msg = paused ? "Pausing" : "Resuming";
    logger.log(`${msg} message delivery for queue ${args.name}.`);
    await updateQueue(config, body, currentQueue.queue_id);
    msg = paused ? "Paused" : "Resumed";
    logger.log(`${msg} message delivery for queue ${args.name}.`);
  } catch (e10) {
    handleFetchError(e10);
  }
}
var queuesPauseCommand, queuesResumeCommand;
var init_pause_resume = __esm({
  "src/queues/cli/commands/pause-resume.ts"() {
    init_import_meta_url();
    init_create_command();
    init_logger();
    init_client11();
    init_utils19();
    queuesPauseCommand = createCommand({
      metadata: {
        description: "Pause message delivery for a queue",
        owner: "Product: Queues",
        status: "stable"
      },
      args: {
        name: {
          type: "string",
          demandOption: true,
          description: "The name of the queue"
        }
      },
      positionalArgs: ["name"],
      async handler(args, { config }) {
        await toggleDeliveryPaused(args, config, true);
      }
    });
    queuesResumeCommand = createCommand({
      metadata: {
        description: "Resume message delivery for a queue",
        owner: "Product: Queues",
        status: "stable"
      },
      args: {
        name: {
          type: "string",
          demandOption: true,
          description: "The name of the queue"
        }
      },
      positionalArgs: ["name"],
      async handler(args, { config }) {
        await toggleDeliveryPaused(args, config, false);
      }
    });
    __name(toggleDeliveryPaused, "toggleDeliveryPaused");
  }
});

// src/queues/cli/commands/purge.ts
var queuesPurgeCommand;
var init_purge2 = __esm({
  "src/queues/cli/commands/purge.ts"() {
    init_import_meta_url();
    init_dist();
    init_create_command();
    init_dialogs();
    init_is_interactive();
    init_logger();
    init_client11();
    queuesPurgeCommand = createCommand({
      metadata: {
        description: "Purge messages from a queue",
        owner: "Product: Queues",
        status: "stable"
      },
      args: {
        name: {
          type: "string",
          demandOption: true,
          description: "The name of the queue"
        },
        force: {
          describe: "Skip the confirmation dialog and forcefully purge the Queue",
          type: "boolean"
        }
      },
      positionalArgs: ["name"],
      async handler(args, { config }) {
        if (!args.force && !isInteractive3()) {
          throw new FatalError(
            "The --force flag is required to purge a Queue in non-interactive mode"
          );
        }
        if (!args.force && isInteractive3()) {
          const result = await prompt(
            `This operation will permanently delete all the messages in Queue ${args.name}. Type ${args.name} to proceed.`
          );
          if (result !== args.name) {
            throw new FatalError(
              "Incorrect queue name provided. Skipping purge operation"
            );
          }
        }
        await purgeQueue(config, args.name);
        logger.log(`Purged Queue '${args.name}'`);
      }
    });
  }
});

// src/queues/cli/commands/subscription/index.ts
var queuesSubscriptionNamespace;
var init_subscription = __esm({
  "src/queues/cli/commands/subscription/index.ts"() {
    init_import_meta_url();
    init_create_command();
    queuesSubscriptionNamespace = createNamespace({
      metadata: {
        description: "Manage event subscriptions for a queue",
        owner: "Product: Queues",
        status: "stable"
      }
    });
  }
});

// src/queues/subscription-types.ts
var EventSourceType, EVENT_SOURCE_TYPES;
var init_subscription_types = __esm({
  "src/queues/subscription-types.ts"() {
    init_import_meta_url();
    EventSourceType = /* @__PURE__ */ ((EventSourceType2) => {
      EventSourceType2["KV"] = "kv";
      EventSourceType2["R2"] = "r2";
      EventSourceType2["SUPER_SLURPER"] = "superSlurper";
      EventSourceType2["VECTORIZE"] = "vectorize";
      EventSourceType2["WORKERS_AI_MODEL"] = "workersAi.model";
      EventSourceType2["WORKERS_BUILDS_WORKER"] = "workersBuilds.worker";
      EventSourceType2["WORKFLOWS_WORKFLOW"] = "workflows.workflow";
      return EventSourceType2;
    })(EventSourceType || {});
    EVENT_SOURCE_TYPES = Object.values(EventSourceType);
  }
});

// src/queues/cli/commands/subscription/create.ts
function parseSourceArgument(source, args) {
  switch (source) {
    case "kv" /* KV */:
      return { type: "kv" /* KV */ };
    case "r2" /* R2 */:
      return { type: "r2" /* R2 */ };
    case "superSlurper" /* SUPER_SLURPER */:
      return { type: "superSlurper" /* SUPER_SLURPER */ };
    case "vectorize" /* VECTORIZE */:
      return { type: "vectorize" /* VECTORIZE */ };
    case "workersAi.model" /* WORKERS_AI_MODEL */:
      if (!args.modelName) {
        throw new UserError(
          `--model-name is required when using source '${"workersAi.model" /* WORKERS_AI_MODEL */}'`
        );
      }
      return {
        type: "workersAi.model" /* WORKERS_AI_MODEL */,
        model_name: args.modelName
      };
    case "workersBuilds.worker" /* WORKERS_BUILDS_WORKER */:
      if (!args.workerName) {
        throw new UserError(
          `--worker-name is required when using source '${"workersBuilds.worker" /* WORKERS_BUILDS_WORKER */}'`
        );
      }
      return {
        type: "workersBuilds.worker" /* WORKERS_BUILDS_WORKER */,
        worker_name: args.workerName
      };
    case "workflows.workflow" /* WORKFLOWS_WORKFLOW */:
      if (!args.workflowName) {
        throw new UserError(
          `--workflow-name is required when using source '${"workflows.workflow" /* WORKFLOWS_WORKFLOW */}'`
        );
      }
      return {
        type: "workflows.workflow" /* WORKFLOWS_WORKFLOW */,
        workflow_name: args.workflowName
      };
    default:
      throw new UserError(
        `Unknown source type: ${source}. Supported sources: ${EVENT_SOURCE_TYPES.join(", ")}`
      );
  }
}
var queuesSubscriptionCreateCommand;
var init_create13 = __esm({
  "src/queues/cli/commands/subscription/create.ts"() {
    init_import_meta_url();
    init_dist();
    init_create_command();
    init_logger();
    init_client11();
    init_subscription_types();
    __name(parseSourceArgument, "parseSourceArgument");
    queuesSubscriptionCreateCommand = createCommand({
      metadata: {
        description: "Create a new event subscription for a queue",
        owner: "Product: Queues",
        status: "stable"
      },
      positionalArgs: ["queue"],
      args: {
        queue: {
          describe: "The name of the queue to create the subscription for",
          type: "string",
          demandOption: true
        },
        source: {
          describe: "The event source type",
          type: "string",
          demandOption: true,
          choices: EVENT_SOURCE_TYPES
        },
        events: {
          describe: "Comma-separated list of event types to subscribe to",
          type: "string",
          demandOption: true
        },
        name: {
          describe: "Name for the subscription (auto-generated if not provided)",
          type: "string"
        },
        enabled: {
          describe: "Whether the subscription should be active",
          type: "boolean",
          default: true
        },
        "model-name": {
          describe: "Workers AI model name (required for workersAi.model source)",
          type: "string"
        },
        "worker-name": {
          describe: "Worker name (required for workersBuilds.worker source)",
          type: "string"
        },
        "workflow-name": {
          describe: "Workflow name (required for workflows.workflow source)",
          type: "string"
        }
      },
      async handler(args, { config }) {
        const source = parseSourceArgument(args.source, {
          modelName: args.modelName,
          workerName: args.workerName,
          workflowName: args.workflowName
        });
        const events6 = args.events.split(",").map((event) => event.trim()).filter(Boolean);
        if (events6.length === 0) {
          throw new UserError(
            "No events specified. Use --events to provide a comma-separated list of event types to subscribe to. For a complete list of sources and corresponding events, please refer to: https://developers.cloudflare.com/queues/event-subscriptions/events-schemas/"
          );
        }
        const request4 = {
          name: args.name || `${args.queue} ${args.source}`,
          enabled: args.enabled,
          source,
          destination: {
            type: "queues.queue",
            queue_id: ""
          },
          events: events6
        };
        logger.log(`Creating event subscription for queue '${args.queue}'...`);
        const subscription = await createEventSubscription(
          config,
          args.queue,
          request4
        );
        logger.log(
          `\u2728 Successfully created event subscription '${subscription.name}' with id '${subscription.id}'.`
        );
      }
    });
  }
});

// src/queues/cli/commands/subscription/delete.ts
var queuesSubscriptionDeleteCommand;
var init_delete12 = __esm({
  "src/queues/cli/commands/subscription/delete.ts"() {
    init_import_meta_url();
    init_create_command();
    init_dialogs();
    init_logger();
    init_client11();
    queuesSubscriptionDeleteCommand = createCommand({
      metadata: {
        description: "Delete an event subscription from a queue",
        owner: "Product: Queues",
        status: "stable"
      },
      positionalArgs: ["queue"],
      args: {
        queue: {
          describe: "The name of the queue",
          type: "string",
          demandOption: true
        },
        id: {
          describe: "The ID of the subscription to delete",
          type: "string",
          demandOption: true
        },
        force: {
          describe: "Skip confirmation",
          type: "boolean",
          alias: "y",
          default: false
        }
      },
      async handler(args, { config }) {
        const subscription = await getEventSubscriptionForQueue(
          config,
          args.queue,
          args.id
        );
        if (!args.force) {
          const confirmedDelete = await confirm(
            `Are you sure you want to delete the event subscription '${subscription.name}' (${args.id})?`
          );
          if (!confirmedDelete) {
            logger.log("Delete cancelled.");
            return;
          }
        }
        await deleteEventSubscription(config, args.id);
        logger.log(
          `\u2728 Successfully deleted event subscription '${subscription.name}' with id '${subscription.id}'.`
        );
      }
    });
  }
});

// src/queues/cli/commands/subscription/utils.ts
function getSourceType(source) {
  return source.type;
}
function getSourceResource(source) {
  switch (source.type) {
    case "workersAi.model" /* WORKERS_AI_MODEL */:
      return source.model_name;
    case "workersBuilds.worker" /* WORKERS_BUILDS_WORKER */:
      return source.worker_name;
    case "workflows.workflow" /* WORKFLOWS_WORKFLOW */:
      return source.workflow_name;
    default:
      return "";
  }
}
var init_utils20 = __esm({
  "src/queues/cli/commands/subscription/utils.ts"() {
    init_import_meta_url();
    init_subscription_types();
    __name(getSourceType, "getSourceType");
    __name(getSourceResource, "getSourceResource");
  }
});

// src/queues/cli/commands/subscription/get.ts
var queuesSubscriptionGetCommand;
var init_get8 = __esm({
  "src/queues/cli/commands/subscription/get.ts"() {
    init_import_meta_url();
    init_create_command();
    init_logger();
    init_render_labelled_values();
    init_client11();
    init_utils20();
    queuesSubscriptionGetCommand = createCommand({
      metadata: {
        description: "Get details about a specific event subscription",
        owner: "Product: Queues",
        status: "stable"
      },
      behaviour: {
        printBanner: /* @__PURE__ */ __name((args) => !args.json, "printBanner")
      },
      positionalArgs: ["queue"],
      args: {
        queue: {
          describe: "The name of the queue",
          type: "string",
          demandOption: true
        },
        id: {
          describe: "The ID of the subscription to retrieve",
          type: "string",
          demandOption: true
        },
        json: {
          describe: "Output in JSON format",
          type: "boolean",
          default: false
        }
      },
      async handler(args, { config }) {
        const subscription = await getEventSubscriptionForQueue(
          config,
          args.queue,
          args.id
        );
        if (args.json) {
          logger.log(JSON.stringify(subscription, null, 2));
          return;
        }
        const resource = getSourceResource(subscription.source);
        const output = {
          ID: subscription.id,
          Name: subscription.name,
          Source: getSourceType(subscription.source),
          ...resource && { Resource: resource },
          "Queue ID": subscription.destination.queue_id,
          Events: subscription.events.join(", "),
          Enabled: subscription.enabled ? "Yes" : "No",
          "Created At": new Date(subscription.created_at).toLocaleString(),
          "Modified At": new Date(subscription.modified_at).toLocaleString()
        };
        logger.log(formatLabelledValues(output));
      }
    });
  }
});

// src/queues/cli/commands/subscription/list.ts
var queuesSubscriptionListCommand;
var init_list16 = __esm({
  "src/queues/cli/commands/subscription/list.ts"() {
    init_import_meta_url();
    init_create_command();
    init_logger();
    init_client11();
    init_utils20();
    queuesSubscriptionListCommand = createCommand({
      metadata: {
        description: "List event subscriptions for a queue",
        owner: "Product: Queues",
        status: "stable"
      },
      behaviour: {
        printBanner: /* @__PURE__ */ __name((args) => !args.json, "printBanner")
      },
      positionalArgs: ["queue"],
      args: {
        queue: {
          describe: "The name of the queue to list subscriptions for",
          type: "string",
          demandOption: true
        },
        page: {
          describe: "Page number for pagination",
          type: "number",
          default: 1
        },
        "per-page": {
          describe: "Number of subscriptions per page",
          type: "number",
          default: 20
        },
        json: {
          describe: "Output in JSON format",
          type: "boolean",
          default: false
        }
      },
      async handler(args, { config }) {
        const subscriptions = await listEventSubscriptions(config, args.queue, {
          page: args.page,
          per_page: args.perPage
        });
        if (args.json) {
          logger.log(JSON.stringify(subscriptions, null, 2));
          return;
        }
        if (!subscriptions || subscriptions.length === 0) {
          logger.log(`No event subscriptions found for queue '${args.queue}'.`);
          return;
        }
        logger.log(`Event subscriptions for queue '${args.queue}':`);
        logger.table(
          subscriptions.map((subscription) => ({
            ID: subscription.id,
            Name: subscription.name,
            Source: getSourceType(subscription.source),
            Events: subscription.events.join(", "),
            Resource: getSourceResource(subscription.source),
            Enabled: subscription.enabled ? "Yes" : "No"
          }))
        );
      }
    });
  }
});

// src/queues/cli/commands/subscription/update.ts
var queuesSubscriptionUpdateCommand;
var init_update5 = __esm({
  "src/queues/cli/commands/subscription/update.ts"() {
    init_import_meta_url();
    init_dist();
    init_create_command();
    init_logger();
    init_client11();
    queuesSubscriptionUpdateCommand = createCommand({
      metadata: {
        description: "Update an existing event subscription",
        owner: "Product: Queues",
        status: "stable"
      },
      behaviour: {
        printBanner: /* @__PURE__ */ __name((args) => !args.json, "printBanner")
      },
      positionalArgs: ["queue"],
      args: {
        queue: {
          describe: "The name of the queue",
          type: "string",
          demandOption: true
        },
        id: {
          describe: "The ID of the subscription to update",
          type: "string",
          demandOption: true
        },
        name: {
          describe: "New name for the subscription",
          type: "string"
        },
        events: {
          describe: "Comma-separated list of event types to subscribe to",
          type: "string"
        },
        enabled: {
          describe: "Whether the subscription should be active",
          type: "boolean"
        },
        json: {
          describe: "Output in JSON format",
          type: "boolean",
          default: false
        }
      },
      async handler(args, { config }) {
        const updateRequest = {};
        if (args.name !== void 0) {
          updateRequest.name = args.name;
        }
        if (args.events !== void 0) {
          const events6 = args.events.split(",").map((event) => event.trim()).filter(Boolean);
          if (events6.length === 0) {
            throw new UserError(
              "No events specified. Use --events to provide a comma-separated list of event types to subscribe to. For a complete list of sources and corresponding events, please refer to: https://developers.cloudflare.com/queues/event-subscriptions/events-schemas/"
            );
          }
          updateRequest.events = events6;
        }
        if (args.enabled !== void 0) {
          updateRequest.enabled = args.enabled;
        }
        if (Object.keys(updateRequest).length === 0) {
          throw new UserError(
            "No fields specified for update. Provide at least one of --name, --events, or --enabled to update the subscription."
          );
        }
        await getEventSubscriptionForQueue(config, args.queue, args.id);
        logger.log("Updating event subscription...");
        const updatedSubscription = await updateEventSubscription(
          config,
          args.id,
          updateRequest
        );
        if (args.json) {
          logger.log(JSON.stringify(updatedSubscription, null, 2));
          return;
        }
        logger.log(
          `\u2728 Successfully updated event subscription '${updatedSubscription.name}' with id '${args.id}'.`
        );
      }
    });
  }
});

// src/queues/cli/commands/update.ts
function updateBody(args, currentSettings) {
  const body = {
    queue_name: args.name
  };
  if (Array.isArray(args.deliveryDelaySecs)) {
    throw new CommandLineArgsError(
      "Cannot specify --delivery-delay-secs multiple times"
    );
  }
  if (Array.isArray(args.messageRetentionPeriodSecs)) {
    throw new CommandLineArgsError(
      "Cannot specify --message-retention-period-secs multiple times"
    );
  }
  body.settings = {};
  if (args.deliveryDelaySecs != void 0) {
    if (args.deliveryDelaySecs < MIN_DELIVERY_DELAY_SECS || args.deliveryDelaySecs > MAX_DELIVERY_DELAY_SECS) {
      throw new CommandLineArgsError(
        `Invalid --delivery-delay-secs value: ${args.deliveryDelaySecs}. Must be between ${MIN_DELIVERY_DELAY_SECS} and ${MAX_DELIVERY_DELAY_SECS}`
      );
    }
    body.settings.delivery_delay = args.deliveryDelaySecs;
  } else if (currentSettings?.delivery_delay != void 0) {
    body.settings.delivery_delay = currentSettings.delivery_delay;
  }
  if (args.messageRetentionPeriodSecs != void 0) {
    if (args.messageRetentionPeriodSecs < MIN_MESSAGE_RETENTION_PERIOD_SECS || args.messageRetentionPeriodSecs > MAX_MESSAGE_RETENTION_PERIOD_SECS) {
      throw new CommandLineArgsError(
        `Invalid --message-retention-period-secs value: ${args.messageRetentionPeriodSecs}. Must be between ${MIN_MESSAGE_RETENTION_PERIOD_SECS} and ${MAX_MESSAGE_RETENTION_PERIOD_SECS}`
      );
    }
    body.settings.message_retention_period = args.messageRetentionPeriodSecs;
  } else if (currentSettings?.message_retention_period != void 0) {
    body.settings.message_retention_period = currentSettings.message_retention_period;
  }
  if (Object.keys(body.settings).length === 0) {
    body.settings = void 0;
  }
  return body;
}
var queuesUpdateCommand;
var init_update6 = __esm({
  "src/queues/cli/commands/update.ts"() {
    init_import_meta_url();
    init_dist();
    init_create_command();
    init_logger();
    init_client11();
    init_constants18();
    init_utils19();
    queuesUpdateCommand = createCommand({
      metadata: {
        description: "Update a queue",
        owner: "Product: Queues",
        status: "stable"
      },
      args: {
        name: {
          type: "string",
          demandOption: true,
          description: "The name of the queue"
        },
        "delivery-delay-secs": {
          type: "number",
          describe: `How long a published message should be delayed for, in seconds. Must be between ${MIN_DELIVERY_DELAY_SECS} and ${MAX_DELIVERY_DELAY_SECS}`
        },
        "message-retention-period-secs": {
          type: "number",
          describe: "How long to retain a message in the queue, in seconds. Must be between 60 and 86400 if on free tier, otherwise must be between 60 and 1209600"
        }
      },
      positionalArgs: ["name"],
      async handler(args, { config }) {
        try {
          const currentQueue = await getQueue(config, args.name);
          const body = updateBody(args, currentQueue.settings);
          logger.log(`Updating queue ${args.name}.`);
          await updateQueue(config, body, currentQueue.queue_id);
          logger.log(`Updated queue ${args.name}.`);
        } catch (e10) {
          handleFetchError(e10);
        }
      }
    });
    __name(updateBody, "updateBody");
  }
});

// src/r2/index.ts
var r2Namespace;
var init_r22 = __esm({
  "src/r2/index.ts"() {
    init_import_meta_url();
    init_create_command();
    r2Namespace = createNamespace({
      metadata: {
        description: "\u{1F4E6} Manage R2 buckets & objects",
        status: "stable",
        owner: "Product: R2",
        category: "Storage & databases"
      }
    });
  }
});

// src/r2/constants.ts
var MAX_UPLOAD_SIZE_BYTES, LOCATION_CHOICES2;
var init_constants19 = __esm({
  "src/r2/constants.ts"() {
    init_import_meta_url();
    MAX_UPLOAD_SIZE_BYTES = 300 * 1024 * 1024;
    LOCATION_CHOICES2 = ["weur", "eeur", "apac", "wnam", "enam", "oc"];
  }
});

// src/r2/bucket.ts
var r2BucketNamespace, r2BucketCreateCommand, r2BucketUpdateNamespace, r2BucketUpdateStorageClassCommand, r2BucketListCommand, r2BucketInfoCommand, r2BucketDeleteCommand;
var init_bucket2 = __esm({
  "src/r2/bucket.ts"() {
    init_import_meta_url();
    init_dist();
    init_esm2();
    init_create_command();
    init_logger();
    init_metrics();
    init_user3();
    init_add_created_resource_config();
    init_getValidBindingName();
    init_render_labelled_values();
    init_constants19();
    init_bucket();
    r2BucketNamespace = createNamespace({
      metadata: {
        description: "Manage R2 buckets",
        status: "stable",
        owner: "Product: R2"
      }
    });
    r2BucketCreateCommand = createCommand({
      metadata: {
        description: "Create a new R2 bucket",
        status: "stable",
        owner: "Product: R2"
      },
      positionalArgs: ["name"],
      args: {
        name: {
          describe: "The name of the new bucket",
          type: "string",
          demandOption: true
        },
        location: {
          describe: "The optional location hint that determines geographic placement of the R2 bucket",
          choices: LOCATION_CHOICES2,
          requiresArg: true,
          type: "string"
        },
        "storage-class": {
          describe: "The default storage class for objects uploaded to this bucket",
          alias: "s",
          requiresArg: false,
          type: "string"
        },
        jurisdiction: {
          describe: "The jurisdiction where the new bucket will be created",
          alias: "J",
          requiresArg: true,
          type: "string"
        },
        ...sharedResourceCreationArgs
      },
      async handler(args, { config }) {
        const accountId = await requireAuth(config);
        const { name: name2, location, storageClass, jurisdiction } = args;
        if (!isValidR2BucketName(name2)) {
          throw new UserError(
            `The bucket name "${name2}" is invalid. ${bucketFormatMessage}`
          );
        }
        if (jurisdiction && location) {
          throw new UserError(
            "Provide either a jurisdiction or location hint - not both."
          );
        }
        let fullBucketName = `${name2}`;
        if (jurisdiction !== void 0) {
          fullBucketName += ` (${jurisdiction})`;
        }
        logger.log(`Creating bucket '${fullBucketName}'...`);
        await createR2Bucket(
          config,
          accountId,
          name2,
          location,
          jurisdiction,
          storageClass
        );
        logger.log(esm_default3`
			✅ Created bucket '${fullBucketName}' with${location ? ` location hint ${location} and` : ``} default storage class of ${storageClass ? storageClass : `Standard`}.`);
        await createdResourceConfig(
          "r2_buckets",
          (bindingName) => ({
            bucket_name: args.name,
            binding: getValidBindingName(bindingName ?? args.name, "r2")
          }),
          config.configPath,
          args.env,
          args
        );
        sendMetricsEvent("create r2 bucket", {
          sendMetrics: config.send_metrics
        });
      }
    });
    r2BucketUpdateNamespace = createNamespace({
      metadata: {
        description: "Update bucket state",
        status: "stable",
        owner: "Product: R2"
      }
    });
    r2BucketUpdateStorageClassCommand = createCommand({
      metadata: {
        description: "Update the default storage class of an existing R2 bucket",
        status: "stable",
        owner: "Product: R2"
      },
      positionalArgs: ["name"],
      args: {
        name: {
          describe: "The name of the existing bucket",
          type: "string",
          demandOption: true
        },
        jurisdiction: {
          describe: "The jurisdiction of the bucket to be updated",
          alias: "J",
          requiresArg: true,
          type: "string"
        },
        "storage-class": {
          describe: "The new default storage class for this bucket",
          alias: "s",
          demandOption: true,
          requiresArg: true,
          type: "string"
        }
      },
      async handler(args, { config }) {
        const accountId = await requireAuth(config);
        let fullBucketName = `${args.name}`;
        if (args.jurisdiction !== void 0) {
          fullBucketName += ` (${args.jurisdiction})`;
        }
        logger.log(
          `Updating bucket ${fullBucketName} to ${args.storageClass} default storage class.`
        );
        await updateR2BucketStorageClass(
          config,
          accountId,
          args.name,
          args.storageClass,
          args.jurisdiction
        );
        logger.log(
          `Updated bucket ${fullBucketName} to ${args.storageClass} default storage class.`
        );
      }
    });
    r2BucketListCommand = createCommand({
      metadata: {
        description: "List R2 buckets",
        status: "stable",
        owner: "Product: R2"
      },
      args: {
        jurisdiction: {
          describe: "The jurisdiction to list",
          alias: "J",
          requiresArg: true,
          type: "string"
        }
      },
      async handler(args, { config }) {
        const accountId = await requireAuth(config);
        logger.log(`Listing buckets...`);
        const buckets = await listR2Buckets(config, accountId, args.jurisdiction);
        const tableOutput = tableFromR2BucketsListResponse(buckets);
        logger.log(tableOutput.map((x7) => formatLabelledValues(x7)).join("\n\n"));
      }
    });
    r2BucketInfoCommand = createCommand({
      metadata: {
        description: "Get information about an R2 bucket",
        status: "stable",
        owner: "Product: R2"
      },
      positionalArgs: ["bucket"],
      args: {
        bucket: {
          describe: "The name of the bucket to retrieve info for",
          type: "string",
          demandOption: true
        },
        jurisdiction: {
          describe: "The jurisdiction where the bucket exists",
          alias: "J",
          requiresArg: true,
          type: "string"
        },
        json: {
          describe: "Return the bucket information as JSON",
          type: "boolean",
          default: false
        }
      },
      behaviour: {
        printBanner: /* @__PURE__ */ __name((args) => !args.json, "printBanner")
      },
      async handler(args, { config }) {
        const accountId = await requireAuth(config);
        if (!args.json) {
          logger.log(`Getting info for '${args.bucket}'...`);
        }
        const bucketInfo = await getR2Bucket(
          config,
          accountId,
          args.bucket,
          args.jurisdiction
        );
        const bucketMetrics = await getR2BucketMetrics(
          config,
          accountId,
          args.bucket,
          args.jurisdiction
        );
        const output = {
          name: bucketInfo.name,
          created: bucketInfo.creation_date,
          location: bucketInfo.location || "(unknown)",
          default_storage_class: bucketInfo.storage_class || "(unknown)",
          object_count: bucketMetrics.objectCount.toLocaleString(),
          bucket_size: bucketMetrics.totalSize
        };
        if (args.json) {
          logger.json(output);
        } else {
          logger.log(formatLabelledValues(output));
        }
      }
    });
    r2BucketDeleteCommand = createCommand({
      metadata: {
        description: "Delete an R2 bucket",
        status: "stable",
        owner: "Product: R2"
      },
      positionalArgs: ["bucket"],
      args: {
        bucket: {
          describe: "The name of the bucket to delete",
          type: "string",
          demandOption: true
        },
        jurisdiction: {
          describe: "The jurisdiction where the bucket exists",
          alias: "J",
          requiresArg: true,
          type: "string"
        }
      },
      async handler(args, { config }) {
        const accountId = await requireAuth(config);
        let fullBucketName = `${args.bucket}`;
        if (args.jurisdiction !== void 0) {
          fullBucketName += ` (${args.jurisdiction})`;
        }
        logger.log(`Deleting bucket ${fullBucketName}.`);
        await deleteR2Bucket(config, accountId, args.bucket, args.jurisdiction);
        logger.log(`Deleted bucket ${fullBucketName}.`);
        sendMetricsEvent("delete r2 bucket", {
          sendMetrics: config.send_metrics
        });
      }
    });
  }
});

// src/r2/catalog.ts
var r2BucketCatalogNamespace, r2BucketCatalogEnableCommand, r2BucketCatalogDisableCommand, r2BucketCatalogGetCommand, r2BucketCatalogCompactionNamespace, r2BucketCatalogCompactionEnableCommand, r2BucketCatalogCompactionDisableCommand, r2BucketCatalogSnapshotExpirationNamespace, r2BucketCatalogSnapshotExpirationEnableCommand, r2BucketCatalogSnapshotExpirationDisableCommand;
var init_catalog2 = __esm({
  "src/r2/catalog.ts"() {
    init_import_meta_url();
    init_dist();
    init_create_command();
    init_dialogs();
    init_logger();
    init_user3();
    init_render_labelled_values();
    init_catalog();
    r2BucketCatalogNamespace = createNamespace({
      metadata: {
        description: "Manage the data catalog for your R2 buckets - provides an Iceberg REST interface for query engines like Spark and PyIceberg",
        status: "open beta",
        owner: "Product: R2 Data Catalog"
      }
    });
    r2BucketCatalogEnableCommand = createCommand({
      metadata: {
        description: "Enable the data catalog on an R2 bucket",
        status: "open beta",
        owner: "Product: R2 Data Catalog"
      },
      positionalArgs: ["bucket"],
      args: {
        bucket: {
          describe: "The name of the bucket to enable",
          type: "string",
          demandOption: true
        }
      },
      async handler(args, { config }) {
        const accountId = await requireAuth(config);
        const response = await enableR2Catalog(config, accountId, args.bucket);
        let catalogHost;
        const env6 = getCloudflareApiEnvironmentFromEnv();
        const path84 = response.name.replace("_", "/");
        if (env6 === "staging") {
          catalogHost = `https://catalog-staging.cloudflarestorage.com/${path84}`;
        } else {
          catalogHost = `https://catalog.cloudflarestorage.com/${path84}`;
        }
        logger.log(
          `\u2728 Successfully enabled data catalog on bucket '${args.bucket}'.

Catalog URI: '${catalogHost}'
Warehouse: '${response.name}'

Use this Catalog URI with Iceberg-compatible query engines (Spark, PyIceberg etc.) to query data as tables.
Note: You will need a Cloudflare API token with 'R2 Data Catalog' permission to authenticate your client with this catalog.
For more details, refer to: https://developers.cloudflare.com/r2/api/s3/tokens/`
        );
      }
    });
    r2BucketCatalogDisableCommand = createCommand({
      metadata: {
        description: "Disable the data catalog for an R2 bucket",
        status: "open beta",
        owner: "Product: R2 Data Catalog"
      },
      positionalArgs: ["bucket"],
      args: {
        bucket: {
          describe: "The name of the bucket to disable the data catalog for",
          type: "string",
          demandOption: true
        }
      },
      async handler(args, { config }) {
        const accountId = await requireAuth(config);
        const confirmedDisable = await confirm(
          `Are you sure you want to disable the data catalog for bucket '${args.bucket}'?`
        );
        if (!confirmedDisable) {
          logger.log("Disable cancelled.");
          return;
        }
        try {
          await disableR2Catalog(config, accountId, args.bucket);
          logger.log(
            `Successfully disabled the data catalog on bucket '${args.bucket}'.`
          );
        } catch (e10) {
          if (e10 instanceof APIError && e10.code == 40401) {
            logger.log(
              `Data catalog is not enabled for bucket '${args.bucket}'. Please use 'wrangler r2 bucket catalog enable ${args.bucket}' to first enable the data catalog on this bucket.`
            );
          } else {
            throw e10;
          }
        }
      }
    });
    r2BucketCatalogGetCommand = createCommand({
      metadata: {
        description: "Get the status of the data catalog for an R2 bucket",
        status: "open beta",
        owner: "Product: R2 Data Catalog"
      },
      positionalArgs: ["bucket"],
      args: {
        bucket: {
          describe: "The name of the R2 bucket whose data catalog status to retrieve",
          type: "string",
          demandOption: true
        }
      },
      async handler(args, { config }) {
        const accountId = await requireAuth(config);
        logger.log(`Getting data catalog status for '${args.bucket}'...
`);
        try {
          const catalog = await getR2Catalog(config, accountId, args.bucket);
          const env6 = getCloudflareApiEnvironmentFromEnv();
          let catalogHost;
          const path84 = catalog.name.replace("_", "/");
          if (env6 === "staging") {
            catalogHost = `https://catalog-staging.cloudflarestorage.com/${path84}`;
          } else {
            catalogHost = `https://catalog.cloudflarestorage.com/${path84}`;
          }
          const output = {
            "Catalog URI": catalogHost,
            Warehouse: catalog.name,
            Status: catalog.status
          };
          logger.log(formatLabelledValues(output));
        } catch (e10) {
          if (e10 instanceof APIError && e10.code == 40401) {
            logger.log(
              `Data catalog is not enabled for bucket '${args.bucket}'. Please use 'wrangler r2 bucket catalog enable ${args.bucket}' to first enable the data catalog on this bucket.`
            );
          } else {
            throw e10;
          }
        }
      }
    });
    r2BucketCatalogCompactionNamespace = createNamespace({
      metadata: {
        description: "Control settings for automatic file compaction maintenance jobs for your R2 data catalog",
        status: "open beta",
        owner: "Product: R2 Data Catalog"
      }
    });
    r2BucketCatalogCompactionEnableCommand = createCommand({
      metadata: {
        description: "Enable automatic file compaction for your R2 data catalog or a specific table",
        status: "open beta",
        owner: "Product: R2 Data Catalog"
      },
      positionalArgs: ["bucket", "namespace", "table"],
      args: {
        bucket: {
          describe: "The name of the bucket which contains the catalog",
          type: "string",
          demandOption: true
        },
        namespace: {
          describe: "The namespace containing the table (optional, for table-level compaction)",
          type: "string",
          demandOption: false
        },
        table: {
          describe: "The name of the table (optional, for table-level compaction)",
          type: "string",
          demandOption: false
        },
        "target-size": {
          describe: "The target size for compacted files in MB (allowed values: 64, 128, 256, 512)",
          type: "number",
          demandOption: false,
          default: 128
        },
        token: {
          describe: "A cloudflare api token with access to R2 and R2 Data Catalog (required for catalog-level compaction settings only)",
          demandOption: false,
          type: "string"
        }
      },
      async handler(args, { config }) {
        const accountId = await requireAuth(config);
        if (args.namespace && !args.table) {
          throw new UserError("Table name is required when namespace is specified");
        }
        if (!args.namespace && args.table) {
          throw new UserError("Namespace is required when table is specified");
        }
        if (args.namespace && args.table) {
          await enableR2CatalogTableCompaction(
            config,
            accountId,
            args.bucket,
            args.namespace,
            args.table,
            args.targetSize !== 128 ? args.targetSize : void 0
          );
          logger.log(
            `\u2728 Successfully enabled file compaction for table '${args.namespace}.${args.table}' in bucket '${args.bucket}'.`
          );
        } else {
          if (!args.token) {
            throw new UserError(
              "Token is required for catalog-level compaction. Use --token flag to provide a Cloudflare API token."
            );
          }
          await upsertR2CatalogCredential(
            config,
            accountId,
            args.bucket,
            args.token
          );
          await enableR2CatalogCompaction(
            config,
            accountId,
            args.bucket,
            args.targetSize
          );
          logger.log(
            `\u2728 Successfully enabled file compaction for the data catalog for bucket '${args.bucket}'.

Compaction will automatically combine small files into larger ones to improve query performance.
For more details, refer to: https://developers.cloudflare.com/r2/data-catalog/about-compaction/`
          );
        }
      }
    });
    r2BucketCatalogCompactionDisableCommand = createCommand({
      metadata: {
        description: "Disable automatic file compaction for your R2 data catalog or a specific table",
        status: "open beta",
        owner: "Product: R2 Data Catalog"
      },
      positionalArgs: ["bucket", "namespace", "table"],
      args: {
        bucket: {
          describe: "The name of the bucket which contains the catalog",
          type: "string",
          demandOption: true
        },
        namespace: {
          describe: "The namespace containing the table (optional, for table-level compaction)",
          type: "string",
          demandOption: false
        },
        table: {
          describe: "The name of the table (optional, for table-level compaction)",
          type: "string",
          demandOption: false
        }
      },
      async handler(args, { config }) {
        const accountId = await requireAuth(config);
        if (args.namespace && !args.table) {
          throw new UserError("Table name is required when namespace is specified");
        }
        if (!args.namespace && args.table) {
          throw new UserError("Namespace is required when table is specified");
        }
        if (args.namespace && args.table) {
          const confirmedDisable = await confirm(
            `Are you sure you want to disable file compaction for table '${args.namespace}.${args.table}' in bucket '${args.bucket}'?`
          );
          if (!confirmedDisable) {
            logger.log("Disable cancelled.");
            return;
          }
          await disableR2CatalogTableCompaction(
            config,
            accountId,
            args.bucket,
            args.namespace,
            args.table
          );
          logger.log(
            `Successfully disabled file compaction for table '${args.namespace}.${args.table}' in bucket '${args.bucket}'.`
          );
        } else {
          const confirmedDisable = await confirm(
            `Are you sure you want to disable file compaction for the data catalog for bucket '${args.bucket}'?`
          );
          if (!confirmedDisable) {
            logger.log("Disable cancelled.");
            return;
          }
          await disableR2CatalogCompaction(config, accountId, args.bucket);
          logger.log(
            `Successfully disabled file compaction for the data catalog for bucket '${args.bucket}'.`
          );
        }
      }
    });
    r2BucketCatalogSnapshotExpirationNamespace = createNamespace({
      metadata: {
        description: "Control settings for automatic snapshot expiration maintenance jobs for your R2 data catalog",
        status: "open beta",
        owner: "Product: R2 Data Catalog"
      }
    });
    r2BucketCatalogSnapshotExpirationEnableCommand = createCommand({
      metadata: {
        description: "Enable automatic snapshot expiration for your R2 data catalog or a specific table",
        status: "open beta",
        owner: "Product: R2 Data Catalog"
      },
      positionalArgs: ["bucket", "namespace", "table"],
      args: {
        bucket: {
          describe: "The name of the bucket which contains the catalog",
          type: "string",
          demandOption: true
        },
        namespace: {
          describe: "The namespace containing the table (optional, for table-level snapshot expiration)",
          type: "string",
          demandOption: false
        },
        table: {
          describe: "The name of the table (optional, for table-level snapshot expiration)",
          type: "string",
          demandOption: false
        },
        "older-than-days": {
          describe: "Delete snapshots older than this many days, defaults to 30",
          type: "number",
          demandOption: false
        },
        "retain-last": {
          describe: "The minimum number of snapshots to retain, defaults to 5",
          type: "number",
          demandOption: false
        },
        token: {
          describe: "A cloudflare api token with access to R2 and R2 Data Catalog (required for catalog-level snapshot expiration settings only)",
          demandOption: false,
          type: "string"
        }
      },
      async handler(args, { config }) {
        const accountId = await requireAuth(config);
        if (args.namespace && !args.table) {
          throw new UserError("Table name is required when namespace is specified");
        }
        if (!args.namespace && args.table) {
          throw new UserError("Namespace is required when table is specified");
        }
        if (args.namespace && args.table) {
          await enableR2CatalogTableSnapshotExpiration(
            config,
            accountId,
            args.bucket,
            args.namespace,
            args.table,
            args.olderThanDays,
            args.retainLast
          );
          logger.log(
            `\u2728 Successfully enabled snapshot expiration for table '${args.namespace}.${args.table}' in bucket '${args.bucket}'.`
          );
        } else {
          if (!args.token) {
            throw new UserError(
              "Token is required for catalog-level snapshot expiration. Use --token flag to provide a Cloudflare API token."
            );
          }
          await upsertR2CatalogCredential(
            config,
            accountId,
            args.bucket,
            args.token
          );
          await enableR2CatalogSnapshotExpiration(
            config,
            accountId,
            args.bucket,
            args.olderThanDays,
            args.retainLast
          );
          logger.log(
            `\u2728 Successfully enabled snapshot expiration for the data catalog for bucket '${args.bucket}'.

Snapshot expiration will automatically delete old table snapshots to save storage costs.
For more details, refer to: https://developers.cloudflare.com/r2/data-catalog/`
          );
        }
      }
    });
    r2BucketCatalogSnapshotExpirationDisableCommand = createCommand({
      metadata: {
        description: "Disable automatic snapshot expiration for your R2 data catalog or a specific table",
        status: "open beta",
        owner: "Product: R2 Data Catalog"
      },
      positionalArgs: ["bucket", "namespace", "table"],
      args: {
        bucket: {
          describe: "The name of the bucket which contains the catalog",
          type: "string",
          demandOption: true
        },
        namespace: {
          describe: "The namespace containing the table (optional, for table-level snapshot expiration)",
          type: "string",
          demandOption: false
        },
        table: {
          describe: "The name of the table (optional, for table-level snapshot expiration)",
          type: "string",
          demandOption: false
        },
        force: {
          describe: "Skip confirmation prompt",
          type: "boolean",
          default: false
        }
      },
      async handler(args, { config }) {
        const accountId = await requireAuth(config);
        if (args.namespace && !args.table) {
          throw new UserError("Table name is required when namespace is specified");
        }
        if (!args.namespace && args.table) {
          throw new UserError("Namespace is required when table is specified");
        }
        if (args.namespace && args.table) {
          if (!args.force) {
            const confirmedDisable = await confirm(
              `Are you sure you want to disable snapshot expiration for table '${args.namespace}.${args.table}' in bucket '${args.bucket}'?`
            );
            if (!confirmedDisable) {
              logger.log("Disable cancelled.");
              return;
            }
          }
          await disableR2CatalogTableSnapshotExpiration(
            config,
            accountId,
            args.bucket,
            args.namespace,
            args.table
          );
          logger.log(
            `Successfully disabled snapshot expiration for table '${args.namespace}.${args.table}' in bucket '${args.bucket}'.`
          );
        } else {
          if (!args.force) {
            const confirmedDisable = await confirm(
              `Are you sure you want to disable snapshot expiration for the data catalog for bucket '${args.bucket}'?`
            );
            if (!confirmedDisable) {
              logger.log("Disable cancelled.");
              return;
            }
          }
          await disableR2CatalogSnapshotExpiration(config, accountId, args.bucket);
          logger.log(
            `Successfully disabled snapshot expiration for the data catalog for bucket '${args.bucket}'.`
          );
        }
      }
    });
  }
});
var r2BucketCORSNamespace, r2BucketCORSListCommand, r2BucketCORSSetCommand, r2BucketCORSDeleteCommand;
var init_cors2 = __esm({
  "src/r2/cors.ts"() {
    init_import_meta_url();
    init_dist();
    init_create_command();
    init_dialogs();
    init_logger();
    init_user3();
    init_render_labelled_values();
    init_bucket();
    r2BucketCORSNamespace = createNamespace({
      metadata: {
        description: "Manage CORS configuration for an R2 bucket",
        status: "stable",
        owner: "Product: R2"
      }
    });
    r2BucketCORSListCommand = createCommand({
      metadata: {
        description: "List the CORS rules for an R2 bucket",
        status: "stable",
        owner: "Product: R2"
      },
      positionalArgs: ["bucket"],
      args: {
        bucket: {
          describe: "The name of the R2 bucket to list the CORS rules for",
          type: "string",
          demandOption: true
        },
        jurisdiction: {
          describe: "The jurisdiction where the bucket exists",
          alias: "J",
          requiresArg: true,
          type: "string"
        }
      },
      async handler({ bucket, jurisdiction }, { config }) {
        const accountId = await requireAuth(config);
        logger.log(`Listing CORS rules for bucket '${bucket}'...`);
        const corsPolicy = await getCORSPolicy(
          config,
          accountId,
          bucket,
          jurisdiction
        );
        if (corsPolicy.length === 0) {
          logger.log(
            `There is no CORS configuration defined for bucket '${bucket}'.`
          );
        } else {
          const tableOutput = tableFromCORSPolicyResponse(corsPolicy);
          logger.log(tableOutput.map((x7) => formatLabelledValues(x7)).join("\n\n"));
        }
      }
    });
    r2BucketCORSSetCommand = createCommand({
      metadata: {
        description: "Set the CORS configuration for an R2 bucket from a JSON file",
        status: "stable",
        owner: "Product: R2"
      },
      positionalArgs: ["bucket"],
      args: {
        bucket: {
          describe: "The name of the R2 bucket to set the CORS configuration for",
          type: "string",
          demandOption: true
        },
        file: {
          describe: "Path to the JSON file containing the CORS configuration",
          type: "string",
          demandOption: true,
          requiresArg: true
        },
        jurisdiction: {
          describe: "The jurisdiction where the bucket exists",
          alias: "J",
          requiresArg: true,
          type: "string"
        },
        force: {
          describe: "Skip confirmation",
          type: "boolean",
          alias: "y",
          default: false
        }
      },
      async handler({ bucket, file: file3, jurisdiction, force }, { config }) {
        const accountId = await requireAuth(config);
        const jsonFilePath = path3__namespace.default.resolve(file3);
        const corsConfig = parseJSON(readFileSync(jsonFilePath), jsonFilePath);
        if (!corsConfig.rules || !Array.isArray(corsConfig.rules)) {
          throw new UserError(
            `The CORS configuration file must contain a 'rules' array as expected by the request body of the CORS API: https://developers.cloudflare.com/api/operations/r2-put-bucket-cors-policy`
          );
        }
        if (!force) {
          const confirmedRemoval = await confirm(
            `Are you sure you want to overwrite the existing CORS configuration for bucket '${bucket}'?`
          );
          if (!confirmedRemoval) {
            logger.log("Set cancelled.");
            return;
          }
        }
        logger.log(
          `Setting CORS configuration (${corsConfig.rules.length} rules) for bucket '${bucket}'...`
        );
        await putCORSPolicy(
          config,
          accountId,
          bucket,
          corsConfig.rules,
          jurisdiction
        );
        logger.log(`\u2728 Set CORS configuration for bucket '${bucket}'.`);
      }
    });
    r2BucketCORSDeleteCommand = createCommand({
      metadata: {
        description: "Clear the CORS configuration for an R2 bucket",
        status: "stable",
        owner: "Product: R2"
      },
      positionalArgs: ["bucket"],
      args: {
        bucket: {
          describe: "The name of the R2 bucket to delete the CORS configuration for",
          type: "string",
          demandOption: true
        },
        jurisdiction: {
          describe: "The jurisdiction where the bucket exists",
          alias: "J",
          requiresArg: true,
          type: "string"
        },
        force: {
          describe: "Skip confirmation",
          type: "boolean",
          alias: "y",
          default: false
        }
      },
      async handler({ bucket, jurisdiction, force }, { config }) {
        const accountId = await requireAuth(config);
        if (!force) {
          const confirmedRemoval = await confirm(
            `Are you sure you want to clear the existing CORS configuration for bucket '${bucket}'?`
          );
          if (!confirmedRemoval) {
            logger.log("Set cancelled.");
            return;
          }
        }
        logger.log(`Deleting the CORS configuration for bucket '${bucket}'...`);
        await deleteCORSPolicy(config, accountId, bucket, jurisdiction);
        logger.log(`CORS configuration deleted for bucket '${bucket}'.`);
      }
    });
  }
});

// src/r2/helpers/domain.ts
async function getCustomDomain(complianceConfig, accountId, bucketName, domainName, jurisdiction) {
  const headers = {};
  if (jurisdiction) {
    headers["cf-r2-jurisdiction"] = jurisdiction;
  }
  const result = await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/r2/buckets/${bucketName}/domains/custom/${domainName}`,
    {
      method: "GET",
      headers
    }
  );
  return result;
}
async function attachCustomDomainToBucket(complianceConfig, accountId, bucketName, domainConfig, jurisdiction) {
  const headers = {
    "Content-Type": "application/json"
  };
  if (jurisdiction) {
    headers["cf-r2-jurisdiction"] = jurisdiction;
  }
  await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/r2/buckets/${bucketName}/domains/custom`,
    {
      method: "POST",
      headers,
      body: JSON.stringify({
        ...domainConfig,
        enabled: true
      })
    }
  );
}
async function removeCustomDomainFromBucket(complianceConfig, accountId, bucketName, domainName, jurisdiction) {
  const headers = {};
  if (jurisdiction) {
    headers["cf-r2-jurisdiction"] = jurisdiction;
  }
  await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/r2/buckets/${bucketName}/domains/custom/${domainName}`,
    {
      method: "DELETE",
      headers
    }
  );
}
function tableFromCustomDomainListResponse(domains) {
  const rows = [];
  for (const domainInfo of domains) {
    rows.push({
      domain: domainInfo.domain,
      enabled: domainInfo.enabled ? "Yes" : "No",
      ownership_status: domainInfo.status.ownership || "(unknown)",
      ssl_status: domainInfo.status.ssl || "(unknown)",
      min_tls_version: domainInfo.minTLS || "1.0",
      zone_id: domainInfo.zoneId || "(none)",
      zone_name: domainInfo.zoneName || "(none)"
    });
  }
  return rows;
}
async function listCustomDomainsOfBucket(complianceConfig, accountId, bucketName, jurisdiction) {
  const headers = {};
  if (jurisdiction) {
    headers["cf-r2-jurisdiction"] = jurisdiction;
  }
  const result = await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/r2/buckets/${bucketName}/domains/custom`,
    {
      method: "GET",
      headers
    }
  );
  return result.domains;
}
async function configureCustomDomainSettings(complianceConfig, accountId, bucketName, domainName, domainConfig, jurisdiction) {
  const headers = {
    "Content-Type": "application/json"
  };
  if (jurisdiction) {
    headers["cf-r2-jurisdiction"] = jurisdiction;
  }
  await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/r2/buckets/${bucketName}/domains/custom/${domainName}`,
    {
      method: "PUT",
      headers,
      body: JSON.stringify(domainConfig)
    }
  );
}
async function getR2DevDomain(complianceConfig, accountId, bucketName, jurisdiction) {
  const headers = {};
  if (jurisdiction) {
    headers["cf-r2-jurisdiction"] = jurisdiction;
  }
  const result = await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/r2/buckets/${bucketName}/domains/managed`,
    {
      method: "GET",
      headers
    }
  );
  return result;
}
async function updateR2DevDomain(complianceConfig, accountId, bucketName, enabled, jurisdiction) {
  const headers = {
    "Content-Type": "application/json"
  };
  if (jurisdiction) {
    headers["cf-r2-jurisdiction"] = jurisdiction;
  }
  const result = await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/r2/buckets/${bucketName}/domains/managed`,
    {
      method: "PUT",
      headers,
      body: JSON.stringify({ enabled })
    }
  );
  return result;
}
var init_domain3 = __esm({
  "src/r2/helpers/domain.ts"() {
    init_import_meta_url();
    init_cfetch();
    __name(getCustomDomain, "getCustomDomain");
    __name(attachCustomDomainToBucket, "attachCustomDomainToBucket");
    __name(removeCustomDomainFromBucket, "removeCustomDomainFromBucket");
    __name(tableFromCustomDomainListResponse, "tableFromCustomDomainListResponse");
    __name(listCustomDomainsOfBucket, "listCustomDomainsOfBucket");
    __name(configureCustomDomainSettings, "configureCustomDomainSettings");
    __name(getR2DevDomain, "getR2DevDomain");
    __name(updateR2DevDomain, "updateR2DevDomain");
  }
});

// src/r2/domain.ts
var r2BucketDomainNamespace, r2BucketDomainGetCommand, r2BucketDomainListCommand, r2BucketDomainAddCommand, r2BucketDomainRemoveCommand, r2BucketDomainUpdateCommand;
var init_domain4 = __esm({
  "src/r2/domain.ts"() {
    init_import_meta_url();
    init_create_command();
    init_dialogs();
    init_logger();
    init_user3();
    init_render_labelled_values();
    init_domain3();
    r2BucketDomainNamespace = createNamespace({
      metadata: {
        description: "Manage custom domains for an R2 bucket",
        status: "stable",
        owner: "Product: R2"
      }
    });
    r2BucketDomainGetCommand = createCommand({
      metadata: {
        description: "Get custom domain connected to an R2 bucket",
        status: "stable",
        owner: "Product: R2"
      },
      positionalArgs: ["bucket"],
      args: {
        bucket: {
          describe: "The name of the R2 bucket whose custom domain to retrieve",
          type: "string",
          demandOption: true
        },
        domain: {
          describe: "The custom domain to get information for",
          type: "string",
          demandOption: true
        },
        jurisdiction: {
          describe: "The jurisdiction where the bucket exists",
          alias: "J",
          requiresArg: true,
          type: "string"
        }
      },
      async handler({ bucket, domain: domain2, jurisdiction }, { config }) {
        const accountId = await requireAuth(config);
        logger.log(
          `Retrieving custom domain '${domain2}' connected to bucket '${bucket}'...`
        );
        const domainResponse = await getCustomDomain(
          config,
          accountId,
          bucket,
          domain2,
          jurisdiction
        );
        const tableOutput = tableFromCustomDomainListResponse([domainResponse]);
        logger.log(tableOutput.map((x7) => formatLabelledValues(x7)).join("\n\n"));
      }
    });
    r2BucketDomainListCommand = createCommand({
      metadata: {
        description: "List custom domains for an R2 bucket",
        status: "stable",
        owner: "Product: R2"
      },
      positionalArgs: ["bucket"],
      args: {
        bucket: {
          describe: "The name of the R2 bucket whose connected custom domains will be listed",
          type: "string",
          demandOption: true
        },
        jurisdiction: {
          describe: "The jurisdiction where the bucket exists",
          alias: "J",
          requiresArg: true,
          type: "string"
        }
      },
      async handler(args, { config }) {
        const accountId = await requireAuth(config);
        const { bucket, jurisdiction } = args;
        logger.log(`Listing custom domains connected to bucket '${bucket}'...`);
        const domains = await listCustomDomainsOfBucket(
          config,
          accountId,
          bucket,
          jurisdiction
        );
        if (domains.length === 0) {
          logger.log("There are no custom domains connected to this bucket.");
        } else {
          const tableOutput = tableFromCustomDomainListResponse(domains);
          logger.log(tableOutput.map((x7) => formatLabelledValues(x7)).join("\n\n"));
        }
      }
    });
    r2BucketDomainAddCommand = createCommand({
      metadata: {
        description: "Connect a custom domain to an R2 bucket",
        status: "stable",
        owner: "Product: R2"
      },
      positionalArgs: ["bucket"],
      args: {
        bucket: {
          describe: "The name of the R2 bucket to connect a custom domain to",
          type: "string",
          demandOption: true
        },
        domain: {
          describe: "The custom domain to connect to the R2 bucket",
          type: "string",
          demandOption: true
        },
        "zone-id": {
          describe: "The zone ID associated with the custom domain",
          type: "string",
          demandOption: true
        },
        "min-tls": {
          describe: "Set the minimum TLS version for the custom domain (defaults to 1.0 if not set)",
          choices: ["1.0", "1.1", "1.2", "1.3"],
          type: "string"
        },
        jurisdiction: {
          describe: "The jurisdiction where the bucket exists",
          alias: "J",
          requiresArg: true,
          type: "string"
        },
        force: {
          describe: "Skip confirmation",
          type: "boolean",
          alias: "y",
          default: false
        }
      },
      async handler(args, { config }) {
        const accountId = await requireAuth(config);
        const {
          bucket,
          domain: domain2,
          zoneId,
          minTls = "1.0",
          jurisdiction,
          force
        } = args;
        if (!force) {
          const confirmedAdd = await confirm(
            `Are you sure you want to add the custom domain '${domain2}' to bucket '${bucket}'? The contents of your bucket will be made publicly available at 'https://${domain2}'`
          );
          if (!confirmedAdd) {
            logger.log("Add cancelled.");
            return;
          }
        }
        logger.log(`Connecting custom domain '${domain2}' to bucket '${bucket}'...`);
        await attachCustomDomainToBucket(
          config,
          accountId,
          bucket,
          {
            domain: domain2,
            zoneId,
            minTLS: minTls
          },
          jurisdiction
        );
        logger.log(`\u2728 Custom domain '${domain2}' connected successfully.`);
      }
    });
    r2BucketDomainRemoveCommand = createCommand({
      metadata: {
        description: "Remove a custom domain from an R2 bucket",
        status: "stable",
        owner: "Product: R2"
      },
      positionalArgs: ["bucket"],
      args: {
        bucket: {
          describe: "The name of the R2 bucket to remove the custom domain from",
          type: "string",
          demandOption: true
        },
        domain: {
          describe: "The custom domain to remove from the R2 bucket",
          type: "string",
          demandOption: true
        },
        jurisdiction: {
          describe: "The jurisdiction where the bucket exists",
          alias: "J",
          requiresArg: true,
          type: "string"
        },
        force: {
          describe: "Skip confirmation",
          type: "boolean",
          alias: "y",
          default: false
        }
      },
      async handler(args, { config }) {
        const accountId = await requireAuth(config);
        const { bucket, domain: domain2, jurisdiction, force } = args;
        if (!force) {
          const confirmedRemoval = await confirm(
            `Are you sure you want to remove the custom domain '${domain2}' from bucket '${bucket}'? Your bucket will no longer be available from 'https://${domain2}'`
          );
          if (!confirmedRemoval) {
            logger.log("Removal cancelled.");
            return;
          }
        }
        logger.log(`Removing custom domain '${domain2}' from bucket '${bucket}'...`);
        await removeCustomDomainFromBucket(
          config,
          accountId,
          bucket,
          domain2,
          jurisdiction
        );
        logger.log(`Custom domain '${domain2}' removed successfully.`);
      }
    });
    r2BucketDomainUpdateCommand = createCommand({
      metadata: {
        description: "Update settings for a custom domain connected to an R2 bucket",
        status: "stable",
        owner: "Product: R2"
      },
      positionalArgs: ["bucket"],
      args: {
        bucket: {
          describe: "The name of the R2 bucket associated with the custom domain to update",
          type: "string",
          demandOption: true
        },
        domain: {
          describe: "The custom domain whose settings will be updated",
          type: "string",
          demandOption: true
        },
        "min-tls": {
          describe: "Update the minimum TLS version for the custom domain",
          choices: ["1.0", "1.1", "1.2", "1.3"],
          type: "string"
        },
        jurisdiction: {
          describe: "The jurisdiction where the bucket exists",
          alias: "J",
          requiresArg: true,
          type: "string"
        }
      },
      async handler(args, { config }) {
        const accountId = await requireAuth(config);
        const { bucket, domain: domain2, minTls, jurisdiction } = args;
        logger.log(`Updating custom domain '${domain2}' for bucket '${bucket}'...`);
        await configureCustomDomainSettings(
          config,
          accountId,
          bucket,
          domain2,
          {
            domain: domain2,
            minTLS: minTls
          },
          jurisdiction
        );
        logger.log(`\u2728 Custom domain '${domain2}' updated successfully.`);
      }
    });
  }
});

// src/r2/helpers/misc.ts
function formatActionDescription(action) {
  switch (action) {
    case "expire":
      return "expire objects";
    case "transition":
      return "transition to Infrequent Access storage class";
    case "abort-multipart":
      return "abort incomplete multipart uploads";
    default:
      return action;
  }
}
function isValidDate(dateString) {
  const regex2 = /^\d{4}-\d{2}-\d{2}$/;
  if (!regex2.test(dateString)) {
    return false;
  }
  const date = /* @__PURE__ */ new Date(`${dateString}T00:00:00.000Z`);
  const timestamp = date.getTime();
  if (isNaN(timestamp)) {
    return false;
  }
  const [year, month, day] = dateString.split("-").map(Number);
  return date.getUTCFullYear() === year && date.getUTCMonth() + 1 === month && date.getUTCDate() === day;
}
function isNonNegativeNumber(str) {
  if (str === "") {
    return false;
  }
  const num = Number(str);
  return num >= 0;
}
function isDataCatalogConflict(error2) {
  return error2 instanceof APIError && error2.code === 10081;
}
var init_misc2 = __esm({
  "src/r2/helpers/misc.ts"() {
    init_import_meta_url();
    init_dist();
    __name(formatActionDescription, "formatActionDescription");
    __name(isValidDate, "isValidDate");
    __name(isNonNegativeNumber, "isNonNegativeNumber");
    __name(isDataCatalogConflict, "isDataCatalogConflict");
  }
});

// src/r2/lifecycle.ts
var r2BucketLifecycleNamespace, r2BucketLifecycleListCommand, r2BucketLifecycleAddCommand, r2BucketLifecycleRemoveCommand, r2BucketLifecycleSetCommand;
var init_lifecycle2 = __esm({
  "src/r2/lifecycle.ts"() {
    init_import_meta_url();
    init_dist();
    init_create_command();
    init_dialogs();
    init_is_interactive();
    init_logger();
    init_user3();
    init_render_labelled_values();
    init_bucket();
    init_misc2();
    r2BucketLifecycleNamespace = createNamespace({
      metadata: {
        description: "Manage lifecycle rules for an R2 bucket",
        status: "stable",
        owner: "Product: R2"
      }
    });
    r2BucketLifecycleListCommand = createCommand({
      metadata: {
        description: "List lifecycle rules for an R2 bucket",
        status: "stable",
        owner: "Product: R2"
      },
      positionalArgs: ["bucket"],
      args: {
        bucket: {
          describe: "The name of the R2 bucket to list lifecycle rules for",
          type: "string",
          demandOption: true
        },
        jurisdiction: {
          describe: "The jurisdiction where the bucket exists",
          alias: "J",
          requiresArg: true,
          type: "string"
        }
      },
      async handler(args, { config }) {
        const accountId = await requireAuth(config);
        const { bucket, jurisdiction } = args;
        logger.log(`Listing lifecycle rules for bucket '${bucket}'...`);
        const lifecycleRules = await getLifecycleRules(
          config,
          accountId,
          bucket,
          jurisdiction
        );
        if (lifecycleRules.length === 0) {
          logger.log(`There are no lifecycle rules for bucket '${bucket}'.`);
        } else {
          const tableOutput = tableFromLifecycleRulesResponse(lifecycleRules);
          logger.log(tableOutput.map((x7) => formatLabelledValues(x7)).join("\n\n"));
        }
      }
    });
    r2BucketLifecycleAddCommand = createCommand({
      metadata: {
        description: "Add a lifecycle rule to an R2 bucket",
        status: "stable",
        owner: "Product: R2"
      },
      positionalArgs: ["bucket", "name", "prefix"],
      args: {
        bucket: {
          describe: "The name of the R2 bucket to add a lifecycle rule to",
          type: "string",
          demandOption: true
        },
        name: {
          describe: "A unique name for the lifecycle rule, used to identify and manage it.",
          alias: "id",
          type: "string",
          requiresArg: true
        },
        prefix: {
          describe: "Prefix condition for the lifecycle rule (leave empty for all prefixes)",
          type: "string",
          requiresArg: true
        },
        "expire-days": {
          describe: "Number of days after which objects expire",
          type: "number",
          requiresArg: true
        },
        "expire-date": {
          describe: "Date after which objects expire (YYYY-MM-DD)",
          type: "string",
          requiresArg: true
        },
        "ia-transition-days": {
          describe: "Number of days after which objects transition to Infrequent Access storage",
          type: "number",
          requiresArg: true
        },
        "ia-transition-date": {
          describe: "Date after which objects transition to Infrequent Access storage (YYYY-MM-DD)",
          type: "string",
          requiresArg: true
        },
        "abort-multipart-days": {
          describe: "Number of days after which incomplete multipart uploads are aborted",
          type: "number",
          requiresArg: true
        },
        jurisdiction: {
          describe: "The jurisdiction where the bucket exists",
          alias: "J",
          requiresArg: true,
          type: "string"
        },
        force: {
          describe: "Skip confirmation and data catalog validation prompt",
          type: "boolean",
          alias: "y",
          default: false
        }
      },
      async handler({
        bucket,
        expireDays,
        expireDate,
        iaTransitionDays,
        iaTransitionDate,
        abortMultipartDays,
        jurisdiction,
        force,
        name: name2,
        prefix
      }, { config }) {
        const accountId = await requireAuth(config);
        const lifecycleRules = await getLifecycleRules(
          config,
          accountId,
          bucket,
          jurisdiction
        );
        if (!name2 && isInteractive3()) {
          name2 = await prompt("Enter a unique name for the lifecycle rule");
        }
        if (!name2) {
          throw new UserError("Must specify a rule name.");
        }
        const newRule = {
          id: name2,
          enabled: true,
          conditions: {}
        };
        let selectedActions = [];
        if (expireDays !== void 0 || expireDate !== void 0) {
          selectedActions.push("expire");
        }
        if (iaTransitionDays !== void 0 || iaTransitionDate !== void 0) {
          selectedActions.push("transition");
        }
        if (abortMultipartDays !== void 0) {
          selectedActions.push("abort-multipart");
        }
        if (selectedActions.length === 0 && isInteractive3()) {
          if (prefix === void 0) {
            prefix = await prompt(
              "Enter a prefix for the lifecycle rule (leave empty for all prefixes)"
            );
          }
          const actionChoices = [
            { title: "Expire objects", value: "expire" },
            {
              title: "Transition to Infrequent Access storage class",
              value: "transition"
            },
            {
              title: "Abort incomplete multipart uploads",
              value: "abort-multipart"
            }
          ];
          selectedActions = await multiselect("Select the actions to apply", {
            choices: actionChoices
          });
        }
        if (selectedActions.length === 0) {
          throw new UserError("Must specify at least one action.");
        }
        for (const action of selectedActions) {
          let conditionType;
          let conditionValue;
          if (action === "abort-multipart") {
            if (abortMultipartDays !== void 0) {
              conditionValue = abortMultipartDays;
            } else {
              conditionValue = await prompt(
                `Enter the number of days after which to ${formatActionDescription(action)}`
              );
            }
            if (!isNonNegativeNumber(String(conditionValue))) {
              throw new UserError("Must be a positive number.");
            }
            conditionType = "Age";
            conditionValue = Number(conditionValue) * 86400;
            newRule.abortMultipartUploadsTransition = {
              condition: {
                maxAge: conditionValue,
                type: conditionType
              }
            };
          } else {
            if (expireDays !== void 0) {
              conditionType = "Age";
              conditionValue = expireDays;
            } else if (iaTransitionDays !== void 0) {
              conditionType = "Age";
              conditionValue = iaTransitionDays;
            } else if (expireDate !== void 0) {
              conditionType = "Date";
              conditionValue = expireDate;
            } else if (iaTransitionDate !== void 0) {
              conditionType = "Date";
              conditionValue = iaTransitionDate;
            } else {
              conditionValue = await prompt(
                `Enter the number of days or a date (YYYY-MM-DD) after which to ${formatActionDescription(action)}`
              );
              if (!isNonNegativeNumber(String(conditionValue)) && !isValidDate(String(conditionValue))) {
                throw new UserError(
                  "Must be a positive number or a valid date in the YYYY-MM-DD format."
                );
              }
            }
            if (isNonNegativeNumber(String(conditionValue))) {
              conditionType = "Age";
              conditionValue = Number(conditionValue) * 86400;
            } else if (isValidDate(String(conditionValue))) {
              conditionType = "Date";
              const date = /* @__PURE__ */ new Date(`${conditionValue}T00:00:00.000Z`);
              conditionValue = date.toISOString();
            } else {
              throw new UserError("Invalid condition input.");
            }
            if (action === "expire") {
              newRule.deleteObjectsTransition = {
                condition: {
                  [conditionType === "Age" ? "maxAge" : "date"]: conditionValue,
                  type: conditionType
                }
              };
            } else if (action === "transition") {
              newRule.storageClassTransitions = [
                {
                  condition: {
                    [conditionType === "Age" ? "maxAge" : "date"]: conditionValue,
                    type: conditionType
                  },
                  storageClass: "InfrequentAccess"
                }
              ];
            }
          }
        }
        if (!prefix && !force) {
          const confirmedAdd = await confirm(
            `Are you sure you want to add lifecycle rule '${name2}' to bucket '${bucket}' without a prefix? The lifecycle rule will apply to all objects in your bucket.`
          );
          if (!confirmedAdd) {
            logger.log("Add cancelled.");
            return;
          }
        }
        if (prefix) {
          newRule.conditions.prefix = prefix;
        }
        lifecycleRules.push(newRule);
        logger.log(`Adding lifecycle rule '${name2}' to bucket '${bucket}'...`);
        try {
          await putLifecycleRules(
            config,
            accountId,
            bucket,
            lifecycleRules,
            force,
            jurisdiction
          );
        } catch (error2) {
          if (!force && isDataCatalogConflict(error2)) {
            const confirmed = await confirm(
              "Data catalog is enabled for this bucket. Proceeding may leave the data catalog in an invalid state. Continue?",
              { defaultValue: false, fallbackValue: true }
            );
            if (!confirmed) {
              logger.log("Operation cancelled.");
              return;
            }
            await putLifecycleRules(
              config,
              accountId,
              bucket,
              lifecycleRules,
              true,
              jurisdiction
            );
          } else {
            throw error2;
          }
        }
        logger.log(`\u2728 Added lifecycle rule '${name2}' to bucket '${bucket}'.`);
      }
    });
    r2BucketLifecycleRemoveCommand = createCommand({
      metadata: {
        description: "Remove a lifecycle rule from an R2 bucket",
        status: "stable",
        owner: "Product: R2"
      },
      positionalArgs: ["bucket"],
      args: {
        bucket: {
          describe: "The name of the R2 bucket to remove a lifecycle rule from",
          type: "string",
          demandOption: true
        },
        name: {
          describe: "The unique name of the lifecycle rule to remove",
          alias: "id",
          type: "string",
          demandOption: true,
          requiresArg: true
        },
        jurisdiction: {
          describe: "The jurisdiction where the bucket exists",
          alias: "J",
          requiresArg: true,
          type: "string"
        }
      },
      async handler(args, { config }) {
        const accountId = await requireAuth(config);
        const { bucket, name: name2, jurisdiction } = args;
        const lifecycleRules = await getLifecycleRules(
          config,
          accountId,
          bucket,
          jurisdiction
        );
        const index = lifecycleRules.findIndex((rule) => rule.id === name2);
        if (index === -1) {
          throw new UserError(
            `Lifecycle rule with ID '${name2}' not found in configuration for '${bucket}'.`
          );
        }
        lifecycleRules.splice(index, 1);
        logger.log(`Removing lifecycle rule '${name2}' from bucket '${bucket}'...`);
        await putLifecycleRules(
          config,
          accountId,
          bucket,
          lifecycleRules,
          true,
          // Always bypass validation
          jurisdiction
        );
        logger.log(`Lifecycle rule '${name2}' removed from bucket '${bucket}'.`);
      }
    });
    r2BucketLifecycleSetCommand = createCommand({
      metadata: {
        description: "Set the lifecycle configuration for an R2 bucket from a JSON file",
        status: "stable",
        owner: "Product: R2"
      },
      positionalArgs: ["bucket"],
      args: {
        bucket: {
          describe: "The name of the R2 bucket to set lifecycle configuration for",
          type: "string",
          demandOption: true
        },
        file: {
          describe: "Path to the JSON file containing lifecycle configuration",
          type: "string",
          demandOption: true,
          requiresArg: true
        },
        jurisdiction: {
          describe: "The jurisdiction where the bucket exists",
          alias: "J",
          requiresArg: true,
          type: "string"
        },
        force: {
          describe: "Skip confirmation and data catalog validation prompt",
          type: "boolean",
          alias: "y",
          default: false
        }
      },
      async handler(args, { config }) {
        const accountId = await requireAuth(config);
        const { bucket, file: file3, jurisdiction, force } = args;
        let lifecyclePolicy;
        try {
          lifecyclePolicy = JSON.parse(readFileSync(file3));
        } catch (e10) {
          if (e10 instanceof Error) {
            throw new UserError(
              `Failed to read or parse the lifecycle configuration config file: '${e10.message}'`
            );
          } else {
            throw e10;
          }
        }
        if (!lifecyclePolicy.rules || !Array.isArray(lifecyclePolicy.rules)) {
          throw new UserError(
            "The lifecycle configuration file must contain a 'rules' array."
          );
        }
        if (!force) {
          const confirmedRemoval = await confirm(
            `Are you sure you want to overwrite all existing lifecycle rules for bucket '${bucket}'?`
          );
          if (!confirmedRemoval) {
            logger.log("Set cancelled.");
            return;
          }
        }
        logger.log(
          `Setting lifecycle configuration (${lifecyclePolicy.rules.length} rules) for bucket '${bucket}'...`
        );
        try {
          await putLifecycleRules(
            config,
            accountId,
            bucket,
            lifecyclePolicy.rules,
            force,
            jurisdiction
          );
        } catch (error2) {
          if (!force && isDataCatalogConflict(error2)) {
            const confirmed = await confirm(
              "Data catalog is enabled for this bucket. Proceeding may leave the data catalog in an invalid state. Continue?",
              { defaultValue: false, fallbackValue: true }
            );
            if (!confirmed) {
              logger.log("Operation cancelled.");
              return;
            }
            await putLifecycleRules(
              config,
              accountId,
              bucket,
              lifecyclePolicy.rules,
              true,
              jurisdiction
            );
          } else {
            throw error2;
          }
        }
        logger.log(`\u2728 Set lifecycle configuration for bucket '${bucket}'.`);
      }
    });
  }
});

// src/r2/helpers/local-uploads.ts
async function getR2LocalUploadsConfig(complianceConfig, accountId, bucketName) {
  return await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/r2/buckets/${bucketName}/local-uploads`,
    {
      method: "GET"
    }
  );
}
async function setR2LocalUploadsConfig(complianceConfig, accountId, bucketName, enabled) {
  return await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/r2/buckets/${bucketName}/local-uploads`,
    {
      method: "PUT",
      headers: {
        "Content-Type": "application/json"
      },
      body: JSON.stringify({ enabled })
    }
  );
}
var init_local_uploads = __esm({
  "src/r2/helpers/local-uploads.ts"() {
    init_import_meta_url();
    init_cfetch();
    __name(getR2LocalUploadsConfig, "getR2LocalUploadsConfig");
    __name(setR2LocalUploadsConfig, "setR2LocalUploadsConfig");
  }
});

// src/r2/local-uploads.ts
var r2BucketLocalUploadsNamespace, r2BucketLocalUploadsGetConfigCommand, r2BucketLocalUploadsEnableCommand, r2BucketLocalUploadsDisableCommand;
var init_local_uploads2 = __esm({
  "src/r2/local-uploads.ts"() {
    init_import_meta_url();
    init_create_command();
    init_dialogs();
    init_logger();
    init_user3();
    init_local_uploads();
    r2BucketLocalUploadsNamespace = createNamespace({
      metadata: {
        description: "Manage local uploads configuration for an R2 bucket",
        status: "stable",
        owner: "Product: R2"
      }
    });
    r2BucketLocalUploadsGetConfigCommand = createCommand({
      metadata: {
        description: "Get the local uploads configuration for an R2 bucket",
        status: "stable",
        owner: "Product: R2"
      },
      positionalArgs: ["bucket"],
      args: {
        bucket: {
          describe: "The name of the R2 bucket whose local uploads configuration to retrieve",
          type: "string",
          demandOption: true
        }
      },
      async handler(args, { config }) {
        const accountId = await requireAuth(config);
        const { bucket } = args;
        const localUploads = await getR2LocalUploadsConfig(
          config,
          accountId,
          bucket
        );
        if (localUploads.enabled) {
          logger.log(
            `Local uploads are enabled for bucket '${bucket}'. Object data is written to the nearest region first, then asynchronously replicated to the bucket's primary region.`
          );
        } else {
          logger.log(
            `Local uploads are disabled for bucket '${bucket}'. Object data is written directly to the bucket's primary region.`
          );
        }
      }
    });
    r2BucketLocalUploadsEnableCommand = createCommand({
      metadata: {
        description: "Enable local uploads for an R2 bucket",
        status: "stable",
        owner: "Product: R2"
      },
      positionalArgs: ["bucket"],
      args: {
        bucket: {
          describe: "The name of the R2 bucket to enable local uploads",
          type: "string",
          demandOption: true
        },
        force: {
          describe: "Skip confirmation",
          type: "boolean",
          alias: "y",
          default: false
        }
      },
      async handler(args, { config }) {
        const accountId = await requireAuth(config);
        const { bucket, force } = args;
        if (!force) {
          const confirmedEnable = await confirm(
            `Are you sure you want to enable local uploads for bucket '${bucket}'? Object data will be written to the nearest region first, then asynchronously replicated to the bucket's primary region.`
          );
          if (!confirmedEnable) {
            logger.log("Enable cancelled.");
            return;
          }
        }
        logger.log(`Enabling local uploads for bucket '${bucket}'...`);
        await setR2LocalUploadsConfig(config, accountId, bucket, true);
        logger.log(`\u2728 Local uploads enabled for bucket '${bucket}'.`);
      }
    });
    r2BucketLocalUploadsDisableCommand = createCommand({
      metadata: {
        description: "Disable local uploads for an R2 bucket",
        status: "stable",
        owner: "Product: R2"
      },
      positionalArgs: ["bucket"],
      args: {
        bucket: {
          describe: "The name of the R2 bucket to disable local uploads",
          type: "string",
          demandOption: true
        },
        force: {
          describe: "Skip confirmation",
          type: "boolean",
          alias: "y",
          default: false
        }
      },
      async handler(args, { config }) {
        const accountId = await requireAuth(config);
        const { bucket, force } = args;
        if (!force) {
          const confirmedDisable = await confirm(
            `Are you sure you want to disable local uploads for bucket '${bucket}'? Object data will be written directly to the bucket's primary region.`
          );
          if (!confirmedDisable) {
            logger.log("Disable cancelled.");
            return;
          }
        }
        logger.log(`Disabling local uploads for bucket '${bucket}'...`);
        await setR2LocalUploadsConfig(config, accountId, bucket, false);
        logger.log(`Local uploads disabled for bucket '${bucket}'.`);
      }
    });
  }
});

// src/r2/lock.ts
var r2BucketLockNamespace, r2BucketLockListCommand, r2BucketLockAddCommand, r2BucketLockRemoveCommand, r2BucketLockSetCommand;
var init_lock = __esm({
  "src/r2/lock.ts"() {
    init_import_meta_url();
    init_dist();
    init_create_command();
    init_dialogs();
    init_is_interactive();
    init_logger();
    init_user3();
    init_render_labelled_values();
    init_bucket();
    init_misc2();
    r2BucketLockNamespace = createNamespace({
      metadata: {
        description: "Manage lock rules for an R2 bucket",
        status: "stable",
        owner: "Product: R2"
      }
    });
    r2BucketLockListCommand = createCommand({
      metadata: {
        description: "List lock rules for an R2 bucket",
        status: "stable",
        owner: "Product: R2"
      },
      positionalArgs: ["bucket"],
      args: {
        bucket: {
          describe: "The name of the R2 bucket to list lock rules for",
          type: "string",
          demandOption: true
        },
        jurisdiction: {
          describe: "The jurisdiction where the bucket exists",
          alias: "J",
          requiresArg: true,
          type: "string"
        }
      },
      async handler(args, { config }) {
        const accountId = await requireAuth(config);
        const { bucket, jurisdiction } = args;
        logger.log(`Listing lock rules for bucket '${bucket}'...`);
        const rules = await getBucketLockRules(
          config,
          accountId,
          bucket,
          jurisdiction
        );
        if (rules.length === 0) {
          logger.log(`There are no lock rules for bucket '${bucket}'.`);
        } else {
          const tableOutput = tableFromBucketLockRulesResponse(rules);
          logger.log(tableOutput.map((x7) => formatLabelledValues(x7)).join("\n\n"));
        }
      }
    });
    r2BucketLockAddCommand = createCommand({
      metadata: {
        description: "Add a lock rule to an R2 bucket",
        status: "stable",
        owner: "Product: R2"
      },
      positionalArgs: ["bucket", "name", "prefix"],
      args: {
        bucket: {
          describe: "The name of the R2 bucket to add a bucket lock rule to",
          type: "string",
          demandOption: true
        },
        name: {
          describe: "A unique name for the bucket lock rule, used to identify and manage it.",
          alias: "id",
          type: "string",
          requiresArg: true
        },
        prefix: {
          describe: 'Prefix condition for the bucket lock rule (set to "" for all prefixes)',
          type: "string",
          requiresArg: true
        },
        "retention-days": {
          describe: "Number of days which objects will be retained for",
          type: "number",
          conflicts: ["retention-date", "retention-indefinite"]
        },
        "retention-date": {
          describe: "Date after which objects will be retained until (YYYY-MM-DD)",
          type: "string",
          conflicts: ["retention-days", "retention-indefinite"]
        },
        "retention-indefinite": {
          describe: "Retain objects indefinitely",
          type: "boolean",
          conflicts: ["retention-date", "retention-days"]
        },
        jurisdiction: {
          describe: "The jurisdiction where the bucket exists",
          alias: "J",
          requiresArg: true,
          type: "string"
        },
        force: {
          describe: "Skip confirmation",
          type: "boolean",
          alias: "y",
          default: false
        }
      },
      async handler({
        bucket,
        retentionDays,
        retentionDate,
        retentionIndefinite,
        jurisdiction,
        force,
        name: name2,
        prefix
      }, { config }) {
        const accountId = await requireAuth(config);
        const rules = await getBucketLockRules(
          config,
          accountId,
          bucket,
          jurisdiction
        );
        if (!name2 && !isNonInteractiveOrCI() && !force) {
          name2 = await prompt("Enter a unique name for the lock rule");
        }
        if (!name2) {
          throw new UserError("Must specify a rule name.", {
            telemetryMessage: true
          });
        }
        const newRule = {
          id: name2,
          enabled: true,
          condition: { type: "Indefinite" }
        };
        if (prefix === void 0 && !force) {
          prefix = await prompt(
            'Enter a prefix for the bucket lock rule (set to "" for all prefixes)',
            { defaultValue: "" }
          );
          if (prefix === "") {
            const confirmedAdd = await confirm(
              `Are you sure you want to add lock rule '${name2}' to bucket '${bucket}' without a prefix? The lock rule will apply to all objects in your bucket.`,
              { defaultValue: false }
            );
            if (!confirmedAdd) {
              logger.log("Add cancelled.");
              return;
            }
          }
        }
        if (prefix) {
          newRule.prefix = prefix;
        }
        if (retentionDays === void 0 && retentionDate === void 0 && retentionIndefinite === void 0 && !force) {
          retentionIndefinite = await confirm(
            `Are you sure you want to add lock rule '${name2}' to bucket '${bucket}' without retention? The lock rule will apply to all matching objects indefinitely.`,
            { defaultValue: false }
          );
          if (retentionIndefinite !== true) {
            logger.log("Add cancelled.");
            return;
          }
        }
        if (retentionDays !== void 0) {
          if (!isNaN(retentionDays)) {
            if (retentionDays > 0) {
              const conditionDaysValue = Number(retentionDays) * 86400;
              newRule.condition = {
                type: "Age",
                maxAgeSeconds: conditionDaysValue
              };
            } else {
              throw new UserError(
                `Days must be a positive number: ${retentionDays}`,
                {
                  telemetryMessage: "Retention days not a positive number."
                }
              );
            }
          } else {
            throw new UserError(`Days must be a number.`, {
              telemetryMessage: "Retention days not a positive number."
            });
          }
        } else if (retentionDate !== void 0) {
          if (isValidDate(retentionDate)) {
            const date = /* @__PURE__ */ new Date(`${retentionDate}T00:00:00.000Z`);
            const conditionDateValue = date.toISOString();
            newRule.condition = {
              type: "Date",
              date: conditionDateValue
            };
          } else {
            throw new UserError(
              `Date must be a valid date in the YYYY-MM-DD format: ${String(retentionDate)}`,
              {
                telemetryMessage: "Retention date not a valid date in the YYYY-MM-DD format."
              }
            );
          }
        } else if (retentionIndefinite !== void 0 && retentionIndefinite === true) {
          newRule.condition = {
            type: "Indefinite"
          };
        } else {
          throw new UserError(`Retention must be specified.`, {
            telemetryMessage: "Lock retention not specified."
          });
        }
        rules.push(newRule);
        logger.log(`Adding lock rule '${name2}' to bucket '${bucket}'...`);
        await putBucketLockRules(config, accountId, bucket, rules, jurisdiction);
        logger.log(`\u2728 Added lock rule '${name2}' to bucket '${bucket}'.`);
      }
    });
    r2BucketLockRemoveCommand = createCommand({
      metadata: {
        description: "Remove a bucket lock rule from an R2 bucket",
        status: "stable",
        owner: "Product: R2"
      },
      positionalArgs: ["bucket"],
      args: {
        bucket: {
          describe: "The name of the R2 bucket to remove a bucket lock rule from",
          type: "string",
          demandOption: true
        },
        name: {
          describe: "The unique name of the bucket lock rule to remove",
          alias: "id",
          type: "string",
          demandOption: true,
          requiresArg: true
        },
        jurisdiction: {
          describe: "The jurisdiction where the bucket exists",
          alias: "J",
          requiresArg: true,
          type: "string"
        }
      },
      async handler(args, { config }) {
        const accountId = await requireAuth(config);
        const { bucket, name: name2, jurisdiction } = args;
        const lockPolicies = await getBucketLockRules(
          config,
          accountId,
          bucket,
          jurisdiction
        );
        const index = lockPolicies.findIndex((policy) => policy.id === name2);
        if (index === -1) {
          throw new UserError(
            `Lock rule with ID '${name2}' not found in configuration for '${bucket}'.`,
            {
              telemetryMessage: "Lock rule with name not found in configuration for bucket."
            }
          );
        }
        lockPolicies.splice(index, 1);
        logger.log(`Removing lock rule '${name2}' from bucket '${bucket}'...`);
        await putBucketLockRules(
          config,
          accountId,
          bucket,
          lockPolicies,
          jurisdiction
        );
        logger.log(`Lock rule '${name2}' removed from bucket '${bucket}'.`);
      }
    });
    r2BucketLockSetCommand = createCommand({
      metadata: {
        description: "Set the lock configuration for an R2 bucket from a JSON file",
        status: "stable",
        owner: "Product: R2"
      },
      positionalArgs: ["bucket"],
      args: {
        bucket: {
          describe: "The name of the R2 bucket to set lock configuration for",
          type: "string",
          demandOption: true
        },
        file: {
          describe: "Path to the JSON file containing lock configuration",
          type: "string",
          demandOption: true,
          requiresArg: true
        },
        jurisdiction: {
          describe: "The jurisdiction where the bucket exists",
          alias: "J",
          requiresArg: true,
          type: "string"
        },
        force: {
          describe: "Skip confirmation",
          type: "boolean",
          alias: "y",
          default: false
        }
      },
      async handler(args, { config }) {
        const accountId = await requireAuth(config);
        const { bucket, file: file3, jurisdiction, force } = args;
        let lockRule;
        try {
          lockRule = JSON.parse(readFileSync(file3));
        } catch (e10) {
          if (e10 instanceof Error) {
            throw new ParseError({
              text: `Failed to read or parse the lock configuration config file: '${e10.message}'`,
              telemetryMessage: "Failed to read or parse the lock configuration config file."
            });
          } else {
            throw e10;
          }
        }
        if (!lockRule.rules || !Array.isArray(lockRule.rules)) {
          throw new UserError(
            "The lock configuration file must contain a 'rules' array.",
            { telemetryMessage: true }
          );
        }
        if (!force) {
          const confirmedRemoval = await confirm(
            `Are you sure you want to overwrite all existing lock rules for bucket '${bucket}'?`,
            { defaultValue: true }
          );
          if (!confirmedRemoval) {
            logger.log("Set cancelled.");
            return;
          }
        }
        logger.log(
          `Setting lock configuration (${lockRule.rules.length} rules) for bucket '${bucket}'...`
        );
        await putBucketLockRules(
          config,
          accountId,
          bucket,
          lockRule.rules,
          jurisdiction
        );
        logger.log(`\u2728 Set lock configuration for bucket '${bucket}'.`);
      }
    });
  }
});

// src/r2/helpers/notification.ts
function eventNotificationHeaders(apiCredentials, jurisdiction) {
  const headers = {
    "Content-Type": "application/json"
  };
  if ("apiToken" in apiCredentials) {
    headers["Authorization"] = `Bearer ${apiCredentials.apiToken}`;
  } else {
    headers["X-Auth-Key"] = apiCredentials.authKey;
    headers["X-Auth-Email"] = apiCredentials.authEmail;
  }
  if (jurisdiction !== "") {
    headers["cf-r2-jurisdiction"] = jurisdiction;
  }
  return headers;
}
function tableFromNotificationGetResponse(response) {
  const rows = [];
  for (const entry of response.queues) {
    for (const {
      prefix = "",
      suffix = "",
      actions,
      ruleId,
      createdAt = ""
    } of entry.rules) {
      rows.push({
        rule_id: ruleId,
        created_at: createdAt,
        queue_name: entry.queueName,
        prefix: prefix || "(all prefixes)",
        suffix: suffix || "(all suffixes)",
        event_type: actions.join(",")
      });
    }
  }
  return rows;
}
async function listEventNotificationConfig(config, apiCredentials, accountId, bucketName, jurisdiction) {
  const headers = eventNotificationHeaders(apiCredentials, jurisdiction);
  logger.log(`Fetching notification rules for bucket ${bucketName}...`);
  const res = await fetchResult(
    config,
    `/accounts/${accountId}/event_notifications/r2/${bucketName}/configuration`,
    { method: "GET", headers }
  );
  if ("bucketName" in res && "queues" in res) {
    return res;
  }
  const oldResult = res;
  const [oldBucketName, oldDetail] = Object.entries(oldResult)[0];
  const newResult = {
    bucketName: oldBucketName,
    queues: await Promise.all(
      Object.values(oldDetail).map(async (oldQueue) => {
        const newQueue = {
          queueId: oldQueue.queue,
          queueName: (await getQueueById(config, accountId, oldQueue.queue)).queue_name,
          rules: oldQueue.rules.map((oldRule) => {
            const newRule = {
              ruleId: "",
              prefix: oldRule.prefix,
              suffix: oldRule.suffix,
              actions: oldRule.actions
            };
            return newRule;
          })
        };
        return newQueue;
      })
    )
  };
  return newResult;
}
async function putEventNotificationConfig(config, apiCredentials, accountId, bucketName, jurisdiction, queueName, eventTypes, prefix, suffix, description) {
  const queue = await getQueue(config, queueName);
  const headers = eventNotificationHeaders(apiCredentials, jurisdiction);
  let actions = [];
  for (const et2 of eventTypes) {
    actions = actions.concat(actionsForEventCategories[et2]);
  }
  const body = description === void 0 ? {
    rules: [{ prefix, suffix, actions }]
  } : {
    rules: [{ prefix, suffix, actions, description }]
  };
  const ruleFor = eventTypes.map(
    (et2) => et2 === "object-create" ? "creation" : "deletion"
  );
  logger.log(
    `Creating event notification rule for object ${ruleFor.join(
      " and "
    )} (${actions.join(",")})`
  );
  return await fetchResult(
    config,
    `/accounts/${accountId}/event_notifications/r2/${bucketName}/configuration/queues/${queue.queue_id}`,
    { method: "PUT", body: JSON.stringify(body), headers }
  );
}
async function deleteEventNotificationConfig(config, apiCredentials, accountId, bucketName, jurisdiction, queueName, ruleId) {
  const queue = await getQueue(config, queueName);
  const headers = eventNotificationHeaders(apiCredentials, jurisdiction);
  if (ruleId !== void 0) {
    logger.log(`Deleting event notifications rule "${ruleId}"...`);
    const body = ruleId !== void 0 ? {
      ruleIds: [ruleId]
    } : {};
    return await fetchResult(
      config,
      `/accounts/${accountId}/event_notifications/r2/${bucketName}/configuration/queues/${queue.queue_id}`,
      { method: "DELETE", body: JSON.stringify(body), headers }
    );
  } else {
    logger.log(
      `Deleting event notification rules associated with queue ${queueName}...`
    );
    return await fetchResult(
      config,
      `/accounts/${accountId}/event_notifications/r2/${bucketName}/configuration/queues/${queue.queue_id}`,
      { method: "DELETE", headers }
    );
  }
}
var actionsForEventCategories;
var init_notification = __esm({
  "src/r2/helpers/notification.ts"() {
    init_import_meta_url();
    init_cfetch();
    init_logger();
    init_client11();
    actionsForEventCategories = {
      "object-create": ["PutObject", "CompleteMultipartUpload", "CopyObject"],
      "object-delete": ["DeleteObject", "LifecycleDeletion"]
    };
    __name(eventNotificationHeaders, "eventNotificationHeaders");
    __name(tableFromNotificationGetResponse, "tableFromNotificationGetResponse");
    __name(listEventNotificationConfig, "listEventNotificationConfig");
    __name(putEventNotificationConfig, "putEventNotificationConfig");
    __name(deleteEventNotificationConfig, "deleteEventNotificationConfig");
  }
});

// src/r2/notification.ts
var r2BucketNotificationNamespace, r2BucketNotificationGetAlias, r2BucketNotificationListCommand, r2BucketNotificationCreateCommand, r2BucketNotificationDeleteCommand;
var init_notification2 = __esm({
  "src/r2/notification.ts"() {
    init_import_meta_url();
    init_create_command();
    init_logger();
    init_user3();
    init_render_labelled_values();
    init_notification();
    r2BucketNotificationNamespace = createNamespace({
      metadata: {
        description: "Manage event notification rules for an R2 bucket",
        status: "stable",
        owner: "Product: R2"
      }
    });
    r2BucketNotificationGetAlias = createAlias({
      aliasOf: "wrangler r2 bucket notification list"
    });
    r2BucketNotificationListCommand = createCommand({
      metadata: {
        description: "List event notification rules for an R2 bucket",
        status: "stable",
        owner: "Product: R2"
      },
      positionalArgs: ["bucket"],
      args: {
        bucket: {
          describe: "The name of the R2 bucket to get event notification rules for",
          type: "string",
          demandOption: true
        },
        jurisdiction: {
          describe: "The jurisdiction where the bucket exists",
          alias: "J",
          requiresArg: true,
          type: "string"
        }
      },
      async handler(args, { config }) {
        if (args._[3] === "get") {
          logger.warn(
            "`wrangler r2 bucket notification get` is deprecated and will be removed in an upcoming release.\nPlease use `wrangler r2 bucket notification list` instead."
          );
        }
        const accountId = await requireAuth(config);
        const apiCreds = requireApiToken();
        const { bucket, jurisdiction = "" } = args;
        const resp = await listEventNotificationConfig(
          config,
          apiCreds,
          accountId,
          bucket,
          jurisdiction
        );
        const tableOutput = tableFromNotificationGetResponse(resp);
        logger.log(tableOutput.map((x7) => formatLabelledValues(x7)).join("\n\n"));
      }
    });
    r2BucketNotificationCreateCommand = createCommand({
      metadata: {
        description: "Create an event notification rule for an R2 bucket",
        status: "stable",
        owner: "Product: R2"
      },
      positionalArgs: ["bucket"],
      args: {
        bucket: {
          describe: "The name of the R2 bucket to create an event notification rule for",
          type: "string",
          demandOption: true
        },
        "event-types": {
          describe: "The type of event(s) that will emit event notifications",
          alias: "event-type",
          choices: Object.keys(actionsForEventCategories),
          demandOption: true,
          requiresArg: true,
          array: true
        },
        prefix: {
          describe: "The prefix that an object must match to emit event notifications (note: regular expressions not supported)",
          requiresArg: false,
          type: "string"
        },
        suffix: {
          describe: "The suffix that an object must match to emit event notifications (note: regular expressions not supported)",
          type: "string"
        },
        queue: {
          describe: "The name of the queue that will receive event notification messages",
          demandOption: true,
          requiresArg: true,
          type: "string"
        },
        jurisdiction: {
          describe: "The jurisdiction where the bucket exists",
          alias: "J",
          requiresArg: true,
          type: "string"
        },
        description: {
          describe: "A description that can be used to identify the event notification rule after creation",
          type: "string"
        }
      },
      async handler(args, { config }) {
        const accountId = await requireAuth(config);
        const apiCreds = requireApiToken();
        const {
          bucket,
          queue,
          eventTypes,
          prefix = "",
          suffix = "",
          jurisdiction = "",
          description
        } = args;
        await putEventNotificationConfig(
          config,
          apiCreds,
          accountId,
          bucket,
          jurisdiction,
          queue,
          eventTypes,
          prefix,
          suffix,
          description
        );
        logger.log("Event notification rule created successfully!");
      }
    });
    r2BucketNotificationDeleteCommand = createCommand({
      metadata: {
        description: "Delete an event notification rule from an R2 bucket",
        status: "stable",
        owner: "Product: R2"
      },
      positionalArgs: ["bucket"],
      args: {
        bucket: {
          describe: "The name of the R2 bucket to delete an event notification rule for",
          type: "string",
          demandOption: true
        },
        queue: {
          describe: "The name of the queue that corresponds to the event notification rule. If no rule is provided, all event notification rules associated with the bucket and queue will be deleted",
          demandOption: true,
          requiresArg: true,
          type: "string"
        },
        rule: {
          describe: "The ID of the event notification rule to delete",
          requiresArg: false,
          type: "string"
        },
        jurisdiction: {
          describe: "The jurisdiction where the bucket exists",
          alias: "J",
          requiresArg: true,
          type: "string"
        }
      },
      async handler(args, { config }) {
        const accountId = await requireAuth(config);
        const apiCreds = requireApiToken();
        const { bucket, queue, rule, jurisdiction = "" } = args;
        await deleteEventNotificationConfig(
          config,
          apiCreds,
          accountId,
          bucket,
          jurisdiction,
          queue,
          rule
        );
        logger.log("Event notification rule deleted successfully!");
      }
    });
  }
});
function validateBulkPutFile(filename) {
  if (!fs29__namespace.default.existsSync(filename)) {
    throw new UserError(`The file "${filename}" does not exist.`);
  }
  let fileContent;
  try {
    fileContent = readFileSync(filename);
  } catch {
    throw new UserError(`The file "${filename}" is not readable.`);
  }
  let entries2;
  try {
    entries2 = JSON.parse(fileContent);
  } catch {
    throw new UserError(`The file "${filename}" is not a valid JSON.`);
  }
  if (!Array.isArray(entries2)) {
    throw new UserError(
      `The file "${filename}" must contain an array of entries.`
    );
  }
  for (const entry of entries2) {
    if (entry === null || typeof entry !== "object" || !isRequiredProperty(entry, "key", "string") || !isRequiredProperty(entry, "file", "string")) {
      throw new UserError(
        `Each entry in the file "${filename}" must be an object with "key" and "file" string properties.`
      );
    }
    if (!fs29__namespace.default.existsSync(entry.file)) {
      throw new UserError(`The file "${entry.file}" does not exist.`);
    }
    const stat9 = fs29__namespace.default.statSync(entry.file, { throwIfNoEntry: false });
    if (!stat9?.isFile()) {
      throw new UserError(`The path "${entry.file}" is not a file.`);
    }
    if (stat9.size > MAX_UPLOAD_SIZE_BYTES) {
      throw new UserError(
        `The file "${entry.file}" exceeds the maximum upload size of ${prettyBytes(
          MAX_UPLOAD_SIZE_BYTES,
          { binary: true }
        )}.`
      );
    }
    entry.size = stat9.size;
  }
  return entries2;
}
function logBulkProgress2(label, index, total) {
  logger.log(
    `${label} ${Math.floor(
      100 * index / total
    )}% (${formatNumber2(index)} out of ${formatNumber2(total)})`
  );
}
var formatNumber2;
var init_bulk = __esm({
  "src/r2/helpers/bulk.ts"() {
    init_import_meta_url();
    init_dist();
    init_pretty_bytes();
    init_logger();
    init_constants19();
    __name(validateBulkPutFile, "validateBulkPutFile");
    formatNumber2 = new Intl.NumberFormat("en-US", {
      notation: "standard"
    }).format;
    __name(logBulkProgress2, "logBulkProgress");
  }
});
async function getR2Object(complianceConfig, accountId, bucketName, objectName, jurisdiction) {
  const headers = {};
  if (jurisdiction !== void 0) {
    headers["cf-r2-jurisdiction"] = jurisdiction;
  }
  const response = await fetchR2Objects(
    complianceConfig,
    `/accounts/${accountId}/r2/buckets/${bucketName}/objects/${objectName}`,
    {
      method: "GET",
      headers
    }
  );
  return response === null ? null : response.body;
}
function validateUploadSize(key, sizeBytes) {
  if (sizeBytes > MAX_UPLOAD_SIZE_BYTES) {
    throw new FatalError(
      `Error: Wrangler only supports uploading files up to ${prettyBytes(
        MAX_UPLOAD_SIZE_BYTES,
        { binary: true }
      )} in size
${key} is ${prettyBytes(sizeBytes, {
        binary: true
      })} in size`,
      1
    );
  }
}
async function putRemoteObject(complianceConfig, accountId, bucketName, objectName, object, options, force, jurisdiction, storageClass) {
  const headers = {};
  for (const key of putHeaderKeys) {
    const value = options[key] || "";
    if (value && typeof value === "string") {
      headers[key] = value;
    }
  }
  if (jurisdiction !== void 0) {
    headers["cf-r2-jurisdiction"] = jurisdiction;
  }
  if (storageClass !== void 0) {
    headers["cf-r2-storage-class"] = storageClass;
  }
  if (!force) {
    headers["cf-r2-data-catalog-check"] = "true";
  }
  const result = await fetchR2Objects(
    complianceConfig,
    `/accounts/${accountId}/r2/buckets/${bucketName}/objects/${objectName}`,
    {
      body: object,
      headers,
      method: "PUT",
      duplex: "half"
    }
  );
  if (result === null) {
    throw new UserError("The specified bucket does not exist.");
  }
}
async function deleteR2Object(complianceConfig, accountId, bucketName, objectName, force, jurisdiction) {
  const headers = {};
  if (jurisdiction !== void 0) {
    headers["cf-r2-jurisdiction"] = jurisdiction;
  }
  if (!force) {
    headers["cf-r2-data-catalog-check"] = "true";
  }
  await fetchR2Objects(
    complianceConfig,
    `/accounts/${accountId}/r2/buckets/${bucketName}/objects/${objectName}`,
    { method: "DELETE", headers }
  );
}
async function usingLocalBucket(persistTo, config, bucketName, closure) {
  const persist = getLocalPersistencePath(persistTo, config);
  const defaultPersistRoot = getDefaultPersistRoot(persist);
  const mf = new miniflare.Miniflare({
    modules: true,
    // TODO(soon): import `reduceError()` from `miniflare:shared`
    script: `
    function reduceError(e) {
      return {
        name: e?.name,
        message: e?.message ?? String(e),
        stack: e?.stack,
        cause: e?.cause === undefined ? undefined : reduceError(e.cause),
      };
    }
    export default {
      async fetch(request, env, ctx) {
        try {
          if (request.method !== "PUT") return new Response(null, { status: 405 });
          const url = new URL(request.url);
          const key = url.pathname.substring(1);
          const optsHeader = request.headers.get("Wrangler-R2-Put-Options");
          const opts = JSON.parse(optsHeader);
          await env.BUCKET.put(key, request.body, opts);
          return new Response(null, { status: 204 });
        } catch (e) {
          const error = reduceError(e);
          return Response.json(error, {
            status: 500,
            headers: { "MF-Experimental-Error-Stack": "true" },
          });
        }
      }
    }`,
    defaultPersistRoot,
    r2Buckets: { BUCKET: bucketName }
  });
  const bucket = await mf.getR2Bucket("BUCKET");
  try {
    return await closure(bucket, mf);
  } finally {
    await mf.dispose();
  }
}
function validateAndReturnBucketAndKey(objectPath) {
  const match3 = /^(?<bucket>[^/]+)\/(?<key>.*)/.exec(objectPath);
  if (match3 === null || !match3.groups) {
    throw new UserError(
      `The object path must be in the form of {bucket}/{key} you provided ${objectPath}`
    );
  }
  const { bucket, key } = match3.groups;
  if (!isValidR2BucketName(bucket)) {
    throw new UserError(
      `The bucket name "${bucket}" is invalid. ${bucketFormatMessage}`
    );
  }
  return { bucket, key };
}
var putHeaderKeys;
var init_object2 = __esm({
  "src/r2/helpers/object.ts"() {
    init_import_meta_url();
    init_dist();
    init_pretty_bytes();
    init_internal();
    init_get_local_persistence_path();
    init_miniflare();
    init_constants19();
    __name(getR2Object, "getR2Object");
    __name(validateUploadSize, "validateUploadSize");
    putHeaderKeys = [
      "cache-control",
      "content-disposition",
      "content-encoding",
      "content-language",
      "content-length",
      "content-type",
      "expires"
    ];
    __name(putRemoteObject, "putRemoteObject");
    __name(deleteR2Object, "deleteR2Object");
    __name(usingLocalBucket, "usingLocalBucket");
    __name(validateAndReturnBucketAndKey, "validateAndReturnBucketAndKey");
  }
});
var r2ObjectNamespace, r2BulkNamespace, r2ObjectGetCommand, commonPutArguments, r2ObjectPutCommand, r2ObjectDeleteCommand, r2BulkPutCommand;
var init_object3 = __esm({
  "src/r2/object.ts"() {
    init_import_meta_url();
    init_dist();
    init_dist6();
    init_config();
    init_create_command();
    init_dialogs();
    init_logger();
    init_user3();
    init_is_local();
    init_bulk();
    init_misc2();
    init_object2();
    r2ObjectNamespace = createNamespace({
      metadata: {
        description: `Manage R2 objects`,
        status: "stable",
        owner: "Product: R2"
      }
    });
    r2BulkNamespace = createNamespace({
      metadata: {
        description: `Interact with multiple R2 objects at once`,
        status: "experimental",
        owner: "Product: R2",
        hidden: true
      }
    });
    r2ObjectGetCommand = createCommand({
      metadata: {
        description: "Fetch an object from an R2 bucket",
        status: "stable",
        owner: "Product: R2"
      },
      args: {
        objectPath: {
          describe: "The source object path in the form of {bucket}/{key}",
          type: "string",
          demandOption: true
        },
        file: {
          describe: "The destination file to create",
          alias: "f",
          conflicts: "pipe",
          requiresArg: true,
          type: "string"
        },
        pipe: {
          describe: "Enables the file to be piped to a destination, rather than specified with the --file option",
          alias: "p",
          conflicts: "file",
          type: "boolean"
        },
        local: {
          type: "boolean",
          describe: "Interact with local storage"
        },
        remote: {
          type: "boolean",
          describe: "Interact with remote storage",
          conflicts: "local"
        },
        "persist-to": {
          type: "string",
          describe: "Directory for local persistence"
        },
        jurisdiction: {
          describe: "The jurisdiction where the object exists",
          alias: "J",
          requiresArg: true,
          type: "string"
        }
      },
      behaviour: {
        printBanner({ pipe }) {
          return !pipe;
        },
        printResourceLocation(args) {
          return !args?.pipe;
        }
      },
      positionalArgs: ["objectPath"],
      async handler(objectGetYargs, { config }) {
        const localMode = isLocal(objectGetYargs);
        const { objectPath, pipe, jurisdiction } = objectGetYargs;
        const { bucket, key } = validateAndReturnBucketAndKey(objectPath);
        let fullBucketName = bucket;
        if (jurisdiction !== void 0) {
          fullBucketName += ` (${jurisdiction})`;
        }
        let file3 = objectGetYargs.file;
        if (!file3 && !pipe) {
          file3 = key;
        }
        if (!pipe) {
          logger.log(`Downloading "${key}" from "${fullBucketName}".`);
        }
        let output;
        if (file3) {
          fs29__namespace.mkdirSync(path3__namespace.dirname(file3), { recursive: true });
          output = fs29__namespace.createWriteStream(file3);
        } else {
          output = process.stdout;
        }
        if (localMode) {
          await usingLocalBucket(
            objectGetYargs.persistTo,
            config,
            bucket,
            async (r2Bucket) => {
              const object = await r2Bucket.get(key);
              if (object === null) {
                throw new UserError("The specified key does not exist.");
              }
              await Stream__namespace.promises.pipeline(object.body, output);
            }
          );
        } else {
          const accountId = await requireAuth(config);
          const input = await getR2Object(
            config,
            accountId,
            bucket,
            key,
            jurisdiction
          );
          if (input === null) {
            throw new UserError("The specified key does not exist.");
          }
          await Stream__namespace.promises.pipeline(input, output);
        }
        if (!pipe) {
          logger.log("Download complete.");
        }
      }
    });
    commonPutArguments = {
      "content-type": {
        describe: "A standard MIME type describing the format of the object data",
        alias: "ct",
        requiresArg: true,
        type: "string"
      },
      "content-disposition": {
        describe: "Specifies presentational information for the object",
        alias: "cd",
        requiresArg: true,
        type: "string"
      },
      "content-encoding": {
        describe: "Specifies what content encodings have been applied to the object and thus what decoding mechanisms must be applied to obtain the media-type referenced by the Content-Type header field",
        alias: "ce",
        requiresArg: true,
        type: "string"
      },
      "content-language": {
        describe: "The language the content is in",
        alias: "cl",
        requiresArg: true,
        type: "string"
      },
      "cache-control": {
        describe: "Specifies caching behavior along the request/reply chain",
        alias: "cc",
        requiresArg: true,
        type: "string"
      },
      expires: {
        describe: "The date and time at which the object is no longer cacheable",
        requiresArg: true,
        type: "string"
      },
      local: {
        type: "boolean",
        describe: "Interact with local storage"
      },
      remote: {
        type: "boolean",
        describe: "Interact with remote storage",
        conflicts: "local"
      },
      "persist-to": {
        type: "string",
        describe: "Directory for local persistence"
      },
      jurisdiction: {
        describe: "The jurisdiction where the object will be created",
        alias: "J",
        requiresArg: true,
        type: "string"
      },
      "storage-class": {
        describe: "The storage class of the object to be created",
        alias: "s",
        requiresArg: false,
        type: "string"
      },
      force: {
        describe: "Skip data catalog validation prompt",
        type: "boolean",
        alias: "y",
        default: false
      }
    };
    r2ObjectPutCommand = createCommand({
      metadata: {
        description: "Create an object in an R2 bucket",
        status: "stable",
        owner: "Product: R2"
      },
      positionalArgs: ["objectPath"],
      args: {
        objectPath: {
          describe: "The destination object path in the form of {bucket}/{key}",
          type: "string",
          demandOption: true
        },
        ...commonPutArguments,
        file: {
          describe: "The path of the file to upload",
          alias: "f",
          conflicts: "pipe",
          requiresArg: true,
          type: "string"
        },
        pipe: {
          describe: "Enables the file to be piped in, rather than specified with the --file option",
          alias: "p",
          conflicts: "file",
          type: "boolean"
        }
      },
      behaviour: {
        printResourceLocation(args) {
          return !args?.pipe;
        }
      },
      async handler(yArgs, { config }) {
        const { file: file3, pipe } = yArgs;
        if (!file3 && !pipe) {
          throw new CommandLineArgsError(
            "Either the --file or --pipe options are required."
          );
        }
        const { bucket, key } = validateAndReturnBucketAndKey(yArgs.objectPath);
        let objectStream;
        let sizeBytes;
        let objectBlob;
        if (file3) {
          try {
            const stats = fs29__namespace.statSync(file3, { throwIfNoEntry: false });
            if (!stats) {
              throw new UserError(`The file "${file3}" does not exist.`);
            }
            sizeBytes = stats.size;
            objectStream = Stream__namespace.Readable.toWeb(fs29__namespace.createReadStream(file3));
          } catch (err) {
            if (err instanceof UserError) {
              throw err;
            }
            throw new UserError(
              `An error occurred while trying to read the file "${file3}": ${err.message}`,
              { cause: err }
            );
          }
        } else {
          const buffer$1 = await new Promise((resolve32, reject) => {
            const stdin = process.stdin;
            const chunks = Array();
            stdin.on("data", (chunk) => chunks.push(chunk));
            stdin.on("end", () => resolve32(Buffer.concat(chunks)));
            stdin.on(
              "error",
              (err) => reject(
                new CommandLineArgsError(`Could not pipe. Reason: "${err.message}"`)
              )
            );
          });
          objectBlob = new buffer.Blob([buffer$1]);
          objectStream = objectBlob.stream();
          sizeBytes = objectBlob.size;
        }
        let fullBucketName = bucket;
        if (yArgs.jurisdiction !== void 0) {
          fullBucketName += ` (${yArgs.jurisdiction})`;
        }
        let storageClassLog = ``;
        if (yArgs.storageClass !== void 0) {
          storageClassLog = ` with ${yArgs.storageClass} storage class`;
        }
        logger.log(
          `Creating object "${key}"${storageClassLog} in bucket "${fullBucketName}".`
        );
        const isLocalMode = isLocal(yArgs);
        if (isLocalMode) {
          await usingLocalBucket(
            yArgs.persistTo,
            config,
            bucket,
            async (_bucket, mf) => {
              const putOptions = {
                httpMetadata: {
                  contentType: yArgs.contentType,
                  contentDisposition: yArgs.contentDisposition,
                  contentEncoding: yArgs.contentEncoding,
                  contentLanguage: yArgs.contentLanguage,
                  cacheControl: yArgs.cacheControl,
                  // @ts-expect-error `@cloudflare/workers-types` is wrong
                  //  here, `number`'s are allowed for `Date`s
                  // TODO(now): fix
                  cacheExpiry: yArgs.expires === void 0 ? void 0 : parseInt(yArgs.expires)
                }
              };
              await mf.dispatchFetch(`http://localhost/${key}`, {
                method: "PUT",
                body: objectStream,
                duplex: "half",
                headers: {
                  "Content-Length": String(sizeBytes),
                  "Wrangler-R2-Put-Options": JSON.stringify(putOptions)
                }
              });
            }
          );
        } else {
          validateUploadSize(key, sizeBytes);
          const accountId = await requireAuth(config);
          const putHeaders = {
            "content-type": yArgs.contentType,
            "content-disposition": yArgs.contentDisposition,
            "content-encoding": yArgs.contentEncoding,
            "content-language": yArgs.contentLanguage,
            "cache-control": yArgs.cacheControl,
            "content-length": String(sizeBytes),
            expires: yArgs.expires
          };
          try {
            await putRemoteObject(
              config,
              accountId,
              bucket,
              key,
              objectStream,
              putHeaders,
              yArgs.force,
              yArgs.jurisdiction,
              yArgs.storageClass
            );
          } catch (error2) {
            if (!yArgs.force && isDataCatalogConflict(error2)) {
              const confirmed = await confirm(
                "Data catalog is enabled for this bucket. Proceeding may leave the data catalog in an invalid state. Continue?",
                { defaultValue: false, fallbackValue: true }
              );
              if (!confirmed) {
                logger.log("Operation cancelled.");
                return;
              }
              let retryStream;
              if (file3) {
                retryStream = Stream__namespace.Readable.toWeb(fs29__namespace.createReadStream(file3));
              } else if (objectBlob) {
                retryStream = objectBlob.stream();
              } else {
                throw error2;
              }
              await putRemoteObject(
                config,
                accountId,
                bucket,
                key,
                retryStream,
                putHeaders,
                true,
                // force=true on retry (skip header)
                yArgs.jurisdiction,
                yArgs.storageClass
              );
            } else {
              throw error2;
            }
          }
        }
        logger.log("Upload complete.");
      }
    });
    r2ObjectDeleteCommand = createCommand({
      metadata: {
        description: "Delete an object in an R2 bucket",
        status: "stable",
        owner: "Product: R2"
      },
      positionalArgs: ["objectPath"],
      args: {
        objectPath: {
          describe: "The destination object path in the form of {bucket}/{key}",
          type: "string",
          demandOption: true
        },
        local: {
          type: "boolean",
          describe: "Interact with local storage"
        },
        remote: {
          type: "boolean",
          describe: "Interact with remote storage",
          conflicts: "local"
        },
        "persist-to": {
          type: "string",
          describe: "Directory for local persistence"
        },
        jurisdiction: {
          describe: "The jurisdiction where the object exists",
          alias: "J",
          requiresArg: true,
          type: "string"
        },
        force: {
          describe: "Skip data catalog validation prompt",
          type: "boolean",
          alias: "y",
          default: false
        }
      },
      behaviour: {
        printResourceLocation: true
      },
      async handler(args) {
        const localMode = isLocal(args);
        const { objectPath, jurisdiction } = args;
        const config = readConfig(args);
        const { bucket, key } = validateAndReturnBucketAndKey(objectPath);
        let fullBucketName = bucket;
        if (jurisdiction !== void 0) {
          fullBucketName += ` (${jurisdiction})`;
        }
        logger.log(`Deleting object "${key}" from bucket "${fullBucketName}".`);
        if (localMode) {
          await usingLocalBucket(
            args.persistTo,
            config,
            bucket,
            (r2Bucket) => r2Bucket.delete(key)
          );
        } else {
          const accountId = await requireAuth(config);
          try {
            await deleteR2Object(
              config,
              accountId,
              bucket,
              key,
              args.force,
              jurisdiction
            );
          } catch (error2) {
            if (!args.force && isDataCatalogConflict(error2)) {
              const confirmed = await confirm(
                "Data catalog is enabled for this bucket. Proceeding may leave the data catalog in an invalid state. Continue?",
                { defaultValue: false, fallbackValue: true }
              );
              if (!confirmed) {
                logger.log("Operation cancelled.");
                return;
              }
              await deleteR2Object(
                config,
                accountId,
                bucket,
                key,
                true,
                jurisdiction
              );
            } else {
              throw error2;
            }
          }
        }
        logger.log("Delete complete.");
      }
    });
    r2BulkPutCommand = createCommand({
      metadata: {
        description: "Create objects in an R2 bucket",
        status: "experimental",
        owner: "Product: R2",
        hidden: true
      },
      positionalArgs: ["bucket"],
      args: {
        bucket: {
          describe: "The name of the new bucket",
          type: "string",
          demandOption: true
        },
        ...commonPutArguments,
        // TODO: add a mutually exclusive option to specify a directory to upload
        filename: {
          describe: "The file containing the key/file pairs to write",
          alias: "f",
          requiresArg: true,
          type: "string"
        },
        concurrency: {
          describe: "The number of concurrent uploads to perform",
          type: "number",
          default: 20
        }
      },
      behaviour: {
        printResourceLocation: true
      },
      async handler(yArgs, { config }) {
        if (!isValidR2BucketName(yArgs.bucket)) {
          throw new UserError(
            `The bucket name "${yArgs.bucket}" is invalid. ${bucketFormatMessage}`
          );
        }
        if (!yArgs.filename) {
          throw new UserError(
            "The --filename argument is required for bulk put operations."
          );
        }
        const entries2 = validateBulkPutFile(yArgs.filename);
        const isLocalMode = isLocal(yArgs);
        let fullBucketName = yArgs.bucket;
        if (yArgs.jurisdiction !== void 0) {
          fullBucketName += ` (${yArgs.jurisdiction})`;
        }
        let storageClassLog = ``;
        if (yArgs.storageClass !== void 0) {
          storageClassLog = ` with ${yArgs.storageClass} storage class`;
        }
        const concurrency = Math.max(1, yArgs.concurrency);
        logger.log(
          `Starting bulk upload of ${entries2.length} objects to bucket ${fullBucketName}${storageClassLog} using a concurrency of ${concurrency}`
        );
        if (isLocalMode) {
          await usingLocalBucket(
            yArgs.persistTo,
            config,
            yArgs.bucket,
            async (_bucket, mf) => {
              const putOptions = {
                httpMetadata: {
                  contentType: yArgs.contentType,
                  contentDisposition: yArgs.contentDisposition,
                  contentEncoding: yArgs.contentEncoding,
                  contentLanguage: yArgs.contentLanguage,
                  cacheControl: yArgs.cacheControl,
                  // @ts-expect-error `@cloudflare/workers-types` is wrong
                  //  here, `number`'s are allowed for `Date`s
                  // TODO(now): fix
                  cacheExpiry: yArgs.expires === void 0 ? void 0 : parseInt(yArgs.expires)
                }
              };
              const queue = new PQueue({ concurrency });
              const jsonPutOptions = JSON.stringify(putOptions);
              await queue.addAll(
                entries2.map((entry, index) => async () => {
                  if ((index + 1) % 100 === 0 || index + 1 === entries2.length) {
                    logBulkProgress2("Uploaded", index + 1, entries2.length);
                  }
                  await mf.dispatchFetch(`http://localhost/${entry.key}`, {
                    method: "PUT",
                    body: Stream__namespace.Readable.toWeb(fs29__namespace.createReadStream(entry.file)),
                    duplex: "half",
                    headers: {
                      "Content-Length": String(entry.size),
                      "Wrangler-R2-Put-Options": jsonPutOptions
                    }
                  });
                })
              );
              try {
                await Promise.race([queue.onError(), queue.onIdle()]);
              } catch (error2) {
                queue.pause();
                throw new FatalError(`R2 bulk upload failed
${error2}`);
              }
            }
          );
        } else {
          const API_RATE_LIMIT_WINDOWS_MS = 5 * 60 * 1e3;
          const API_RATE_LIMIT_REQUESTS = 1200 - 100;
          const accountId = await requireAuth(config);
          let forceBulk = yArgs.force;
          if (!forceBulk) {
            const confirmed = await confirm(
              "Bulk upload may overwrite existing objects. If this bucket has data catalog enabled, this operation could leave the catalog in an invalid state. Continue?",
              { defaultValue: false, fallbackValue: true }
            );
            if (!confirmed) {
              logger.log("Bulk upload cancelled.");
              return;
            }
            forceBulk = true;
          }
          const queue = new PQueue({
            concurrency,
            interval: API_RATE_LIMIT_WINDOWS_MS,
            intervalCap: API_RATE_LIMIT_REQUESTS
          });
          await queue.addAll(
            entries2.map((entry, index) => async () => {
              try {
                if ((index + 1) % 10 === 0 || index + 1 === entries2.length) {
                  logBulkProgress2("Uploaded", index + 1, entries2.length);
                }
                await putRemoteObject(
                  config,
                  accountId,
                  yArgs.bucket,
                  entry.key,
                  Stream__namespace.Readable.toWeb(fs29__namespace.createReadStream(entry.file)),
                  {
                    "cache-control": yArgs.cacheControl,
                    "content-disposition": yArgs.contentDisposition,
                    "content-encoding": yArgs.contentEncoding,
                    "content-language": yArgs.contentLanguage,
                    "content-type": yArgs.contentType,
                    "content-length": String(entry.size),
                    expires: yArgs.expires
                  },
                  forceBulk,
                  // Always true after prompt (no header sent)
                  yArgs.jurisdiction,
                  yArgs.storageClass
                );
              } catch (e10) {
                throw new FatalError(`Error uploading "${entry.file}"
${e10}`);
              }
            })
          );
          try {
            await Promise.race([queue.onError(), queue.onIdle()]);
          } catch (error2) {
            queue.pause();
            throw new FatalError(`R2 bulk upload failed
${error2}`);
          }
        }
      }
    });
  }
});

// src/r2/public-dev-url.ts
var r2BucketDevUrlNamespace, r2BucketDevUrlGetCommand, r2BucketDevUrlEnableCommand, r2BucketDevUrlDisableCommand;
var init_public_dev_url = __esm({
  "src/r2/public-dev-url.ts"() {
    init_import_meta_url();
    init_create_command();
    init_dialogs();
    init_logger();
    init_user3();
    init_domain3();
    r2BucketDevUrlNamespace = createNamespace({
      metadata: {
        description: "Manage public access via the r2.dev URL for an R2 bucket",
        status: "stable",
        owner: "Product: R2"
      }
    });
    r2BucketDevUrlGetCommand = createCommand({
      metadata: {
        description: "Get the r2.dev URL and status for an R2 bucket",
        status: "stable",
        owner: "Product: R2"
      },
      positionalArgs: ["bucket"],
      args: {
        bucket: {
          describe: "The name of the R2 bucket whose r2.dev URL status to retrieve",
          type: "string",
          demandOption: true
        },
        jurisdiction: {
          describe: "The jurisdiction where the bucket exists",
          alias: "J",
          requiresArg: true,
          type: "string"
        }
      },
      async handler(args, { config }) {
        const accountId = await requireAuth(config);
        const { bucket, jurisdiction } = args;
        const devDomain = await getR2DevDomain(
          config,
          accountId,
          bucket,
          jurisdiction
        );
        if (devDomain.enabled) {
          logger.log(`Public access is enabled at 'https://${devDomain.domain}'.`);
        } else {
          logger.log(`Public access via the r2.dev URL is disabled.`);
        }
      }
    });
    r2BucketDevUrlEnableCommand = createCommand({
      metadata: {
        description: "Enable public access via the r2.dev URL for an R2 bucket",
        status: "stable",
        owner: "Product: R2"
      },
      positionalArgs: ["bucket"],
      args: {
        bucket: {
          describe: "The name of the R2 bucket to enable public access via its r2.dev URL",
          type: "string",
          demandOption: true
        },
        jurisdiction: {
          describe: "The jurisdiction where the bucket exists",
          alias: "J",
          requiresArg: true,
          type: "string"
        },
        force: {
          describe: "Skip confirmation",
          type: "boolean",
          alias: "y",
          default: false
        }
      },
      async handler(args, { config }) {
        const accountId = await requireAuth(config);
        const { bucket, jurisdiction, force } = args;
        if (!force) {
          const confirmedAdd = await confirm(
            `Are you sure you enable public access for bucket '${bucket}'? The contents of your bucket will be made publicly available at its r2.dev URL`
          );
          if (!confirmedAdd) {
            logger.log("Enable cancelled.");
            return;
          }
        }
        logger.log(`Enabling public access for bucket '${bucket}'...`);
        const devDomain = await updateR2DevDomain(
          config,
          accountId,
          bucket,
          true,
          jurisdiction
        );
        logger.log(`\u2728 Public access enabled at 'https://${devDomain.domain}'.`);
      }
    });
    r2BucketDevUrlDisableCommand = createCommand({
      metadata: {
        description: "Disable public access via the r2.dev URL for an R2 bucket",
        status: "stable",
        owner: "Product: R2"
      },
      positionalArgs: ["bucket"],
      args: {
        bucket: {
          describe: "The name of the R2 bucket to disable public access via its r2.dev URL",
          type: "string",
          demandOption: true
        },
        jurisdiction: {
          describe: "The jurisdiction where the bucket exists",
          alias: "J",
          requiresArg: true,
          type: "string"
        },
        force: {
          describe: "Skip confirmation",
          type: "boolean",
          alias: "y",
          default: false
        }
      },
      async handler(args, { config }) {
        const accountId = await requireAuth(config);
        const { bucket, jurisdiction, force } = args;
        if (!force) {
          const confirmedAdd = await confirm(
            `Are you sure you disable public access for bucket '${bucket}'? The contents of your bucket will no longer be publicly available at its r2.dev URL`
          );
          if (!confirmedAdd) {
            logger.log("Disable cancelled.");
            return;
          }
        }
        logger.log(`Disabling public access for bucket '${bucket}'...`);
        const devDomain = await updateR2DevDomain(
          config,
          accountId,
          bucket,
          false,
          jurisdiction
        );
        logger.log(`Public access disabled at 'https://${devDomain.domain}'.`);
      }
    });
  }
});

// src/r2/helpers/sippy.ts
async function getR2Sippy(complianceConfig, accountId, bucketName, jurisdiction) {
  const headers = {};
  if (jurisdiction !== void 0) {
    headers["cf-r2-jurisdiction"] = jurisdiction;
  }
  return await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/r2/buckets/${bucketName}/sippy`,
    { method: "GET", headers }
  );
}
async function deleteR2Sippy(complianceConfig, accountId, bucketName, jurisdiction) {
  const headers = {};
  if (jurisdiction !== void 0) {
    headers["cf-r2-jurisdiction"] = jurisdiction;
  }
  return await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/r2/buckets/${bucketName}/sippy`,
    { method: "DELETE", headers }
  );
}
async function putR2Sippy(complianceConfig, accountId, bucketName, params, jurisdiction) {
  const headers = {
    "Content-Type": "application/json"
  };
  if (jurisdiction !== void 0) {
    headers["cf-r2-jurisdiction"] = jurisdiction;
  }
  return await fetchResult(
    complianceConfig,
    `/accounts/${accountId}/r2/buckets/${bucketName}/sippy`,
    { method: "PUT", body: JSON.stringify(params), headers }
  );
}
var init_sippy2 = __esm({
  "src/r2/helpers/sippy.ts"() {
    init_import_meta_url();
    init_cfetch();
    __name(getR2Sippy, "getR2Sippy");
    __name(deleteR2Sippy, "deleteR2Sippy");
    __name(putR2Sippy, "putR2Sippy");
  }
});

// src/r2/sippy.ts
var NO_SUCH_OBJECT_KEY, SIPPY_PROVIDER_CHOICES, r2BucketSippyNamespace, r2BucketSippyEnableCommand, r2BucketSippyDisableCommand, r2BucketSippyGetCommand;
var init_sippy3 = __esm({
  "src/r2/sippy.ts"() {
    init_import_meta_url();
    init_dist();
    init_create_command();
    init_dialogs();
    init_logger();
    init_user3();
    init_sippy2();
    NO_SUCH_OBJECT_KEY = 10007;
    SIPPY_PROVIDER_CHOICES = ["AWS", "GCS"];
    r2BucketSippyNamespace = createNamespace({
      metadata: {
        description: "Manage Sippy incremental migration on an R2 bucket",
        status: "stable",
        owner: "Product: R2"
      }
    });
    r2BucketSippyEnableCommand = createCommand({
      metadata: {
        description: "Enable Sippy on an R2 bucket",
        status: "stable",
        owner: "Product: R2"
      },
      positionalArgs: ["name"],
      args: {
        name: {
          describe: "The name of the bucket",
          type: "string",
          demandOption: true
        },
        jurisdiction: {
          describe: "The jurisdiction where the bucket exists",
          alias: "J",
          requiresArg: true,
          type: "string"
        },
        provider: {
          choices: SIPPY_PROVIDER_CHOICES
        },
        bucket: {
          description: "The name of the upstream bucket",
          type: "string"
        },
        region: {
          description: "(AWS provider only) The region of the upstream bucket",
          type: "string"
        },
        "access-key-id": {
          description: "(AWS provider only) The secret access key id for the upstream bucket",
          type: "string"
        },
        "secret-access-key": {
          description: "(AWS provider only) The secret access key for the upstream bucket",
          type: "string"
        },
        "service-account-key-file": {
          description: "(GCS provider only) The path to your Google Cloud service account key JSON file",
          type: "string"
        },
        "client-email": {
          description: "(GCS provider only) The client email for your Google Cloud service account key",
          type: "string"
        },
        "private-key": {
          description: "(GCS provider only) The private key for your Google Cloud service account key",
          type: "string"
        },
        "r2-access-key-id": {
          description: "The secret access key id for this R2 bucket",
          type: "string"
        },
        "r2-secret-access-key": {
          description: "The secret access key for this R2 bucket",
          type: "string"
        }
      },
      async handler(args, { config }) {
        const isInteractive4 = process.stdin.isTTY;
        const accountId = await requireAuth(config);
        if (isInteractive4) {
          args.provider ??= await prompt(
            "Enter the cloud storage provider of your bucket (AWS or GCS):"
          );
          if (!args.provider) {
            throw new UserError("Must specify a cloud storage provider.");
          }
          if (!SIPPY_PROVIDER_CHOICES.includes(args.provider)) {
            throw new UserError("Cloud storage provider must be: AWS or GCS");
          }
          args.bucket ??= await prompt(
            `Enter the name of your ${args.provider} bucket:`
          );
          if (!args.bucket) {
            throw new UserError(`Must specify ${args.provider} bucket name.`);
          }
          if (args.provider === "AWS") {
            args.region ??= await prompt(
              "Enter the AWS region where your S3 bucket is located (example: us-west-2):"
            );
            if (!args.region) {
              throw new UserError("Must specify an AWS Region.");
            }
            args.accessKeyId ??= await prompt(
              "Enter your AWS Access Key ID (requires read and list access):"
            );
            if (!args.accessKeyId) {
              throw new UserError("Must specify an AWS Access Key ID.");
            }
            args.secretAccessKey ??= await prompt(
              "Enter your AWS Secret Access Key:"
            );
            if (!args.secretAccessKey) {
              throw new UserError("Must specify an AWS Secret Access Key.");
            }
          } else if (args.provider === "GCS") {
            if (!(args.clientEmail && args.privateKey) && !args.serviceAccountKeyFile) {
              args.serviceAccountKeyFile = await prompt(
                "Enter the path to your Google Cloud service account key JSON file:"
              );
              if (!args.serviceAccountKeyFile) {
                throw new UserError(
                  "Must specify the path to a service account key JSON file."
                );
              }
            }
          }
          args.r2AccessKeyId ??= await prompt(
            "Enter your R2 Access Key ID (requires read and write access):"
          );
          if (!args.r2AccessKeyId) {
            throw new UserError("Must specify an R2 Access Key ID.");
          }
          args.r2SecretAccessKey ??= await prompt(
            "Enter your R2 Secret Access Key:"
          );
          if (!args.r2SecretAccessKey) {
            throw new UserError("Must specify an R2 Secret Access Key.");
          }
        }
        let sippyConfig;
        if (args.provider === "AWS") {
          if (!args.region) {
            throw new UserError("Error: must provide --region.");
          }
          if (!args.bucket) {
            throw new UserError("Error: must provide --bucket.");
          }
          if (!args.accessKeyId) {
            throw new UserError("Error: must provide --access-key-id.");
          }
          if (!args.secretAccessKey) {
            throw new UserError("Error: must provide --secret-access-key.");
          }
          if (!args.r2AccessKeyId) {
            throw new UserError("Error: must provide --r2-access-key-id.");
          }
          if (!args.r2SecretAccessKey) {
            throw new UserError("Error: must provide --r2-secret-access-key.");
          }
          sippyConfig = {
            source: {
              provider: "aws",
              region: args.region,
              bucket: args.bucket,
              accessKeyId: args.accessKeyId,
              secretAccessKey: args.secretAccessKey
            },
            destination: {
              provider: "r2",
              accessKeyId: args.r2AccessKeyId,
              secretAccessKey: args.r2SecretAccessKey
            }
          };
        } else if (args.provider === "GCS") {
          if (args.serviceAccountKeyFile) {
            const serviceAccount = JSON.parse(
              readFileSync(args.serviceAccountKeyFile)
            );
            if ("client_email" in serviceAccount && "private_key" in serviceAccount) {
              args.clientEmail = serviceAccount.client_email;
              args.privateKey = serviceAccount.private_key;
            }
          }
          if (!args.bucket) {
            throw new UserError("Error: must provide --bucket.");
          }
          if (!args.clientEmail) {
            throw new UserError(
              "Error: must provide --service-account-key-file or --client-email."
            );
          }
          if (!args.privateKey) {
            throw new UserError(
              "Error: must provide --service-account-key-file or --private-key."
            );
          }
          args.privateKey = args.privateKey.replace(/\\n/g, "\n");
          if (!args.r2AccessKeyId) {
            throw new UserError("Error: must provide --r2-access-key-id.");
          }
          if (!args.r2SecretAccessKey) {
            throw new UserError("Error: must provide --r2-secret-access-key.");
          }
          sippyConfig = {
            source: {
              provider: "gcs",
              bucket: args.bucket,
              clientEmail: args.clientEmail,
              privateKey: args.privateKey
            },
            destination: {
              provider: "r2",
              accessKeyId: args.r2AccessKeyId,
              secretAccessKey: args.r2SecretAccessKey
            }
          };
        } else {
          throw new UserError(
            "Error: unrecognized provider. Possible options are AWS & GCS."
          );
        }
        await putR2Sippy(
          config,
          accountId,
          args.name,
          sippyConfig,
          args.jurisdiction
        );
        logger.log(`\u2728 Successfully enabled Sippy on the '${args.name}' bucket.`);
      }
    });
    r2BucketSippyDisableCommand = createCommand({
      metadata: {
        description: "Disable Sippy on an R2 bucket",
        status: "stable",
        owner: "Product: R2"
      },
      positionalArgs: ["name"],
      args: {
        name: {
          describe: "The name of the bucket",
          type: "string",
          demandOption: true
        },
        jurisdiction: {
          describe: "The jurisdiction where the bucket exists",
          alias: "J",
          requiresArg: true,
          type: "string"
        }
      },
      async handler(args, { config }) {
        const accountId = await requireAuth(config);
        await deleteR2Sippy(config, accountId, args.name, args.jurisdiction);
        logger.log(`\u2728 Successfully disabled Sippy on the '${args.name}' bucket.`);
      }
    });
    r2BucketSippyGetCommand = createCommand({
      metadata: {
        description: "Check the status of Sippy on an R2 bucket",
        status: "stable",
        owner: "Product: R2"
      },
      positionalArgs: ["name"],
      args: {
        name: {
          describe: "The name of the bucket",
          type: "string",
          demandOption: true
        },
        jurisdiction: {
          describe: "The jurisdiction where the bucket exists",
          alias: "J",
          requiresArg: true,
          type: "string"
        }
      },
      async handler(args, { config }) {
        const accountId = await requireAuth(config);
        try {
          const sippyConfig = await getR2Sippy(
            config,
            accountId,
            args.name,
            args.jurisdiction
          );
          logger.log("Sippy configuration:", sippyConfig);
        } catch (e10) {
          if (e10 instanceof APIError && "code" in e10 && e10.code === NO_SUCH_OBJECT_KEY) {
            logger.log(
              `No Sippy configuration found for the '${args.name}' bucket.`
            );
          } else {
            throw e10;
          }
        }
      }
    });
  }
});

// src/r2/sql.ts
function formatSqlResults(data, duration) {
  if (!data?.result?.rows || data.result.rows.length === 0) {
    logger.log("Query executed successfully with no results");
    return;
  }
  const { schema, rows, metrics } = data.result;
  const column_order = schema.map((field) => field.name);
  logger.table(
    rows.map(
      (row) => Object.fromEntries(
        column_order.map((column) => {
          const value = row[column];
          if (value === null || value === void 0) {
            return [column, ""];
          }
          if (typeof value === "object") {
            return [
              column,
              JSON.stringify(value, (_k, v8) => v8 === null ? "" : v8)
            ];
          }
          return [column, String(value)];
        })
      )
    ),
    { wordWrap: true, head: column_order }
  );
  logger.log(
    `Read ${prettyBytes(metrics.bytes_scanned)} across ${metrics.files_scanned} files from R2`
  );
  if (duration > 0) {
    const bytesPerSecond = metrics.bytes_scanned / duration * 1e3;
    logger.log(`On average, ${prettyBytes(bytesPerSecond)} / s`);
  }
}
var import_undici19, r2SqlNamespace, r2SqlQueryCommand;
var init_sql = __esm({
  "src/r2/sql.ts"() {
    init_import_meta_url();
    init_interactive();
    init_dist();
    init_pretty_bytes();
    import_undici19 = __toESM(require_undici());
    init_internal();
    init_create_command();
    init_logger();
    init_auth_variables();
    __name(formatSqlResults, "formatSqlResults");
    r2SqlNamespace = createNamespace({
      metadata: {
        description: "Send queries and manage R2 SQL",
        status: "open beta",
        owner: "Product: R2 SQL"
      }
    });
    r2SqlQueryCommand = createCommand({
      metadata: {
        description: "Execute SQL query against R2 Data Catalog",
        status: "open beta",
        owner: "Product: R2"
      },
      positionalArgs: ["warehouse", "query"],
      args: {
        warehouse: {
          describe: "R2 Data Catalog warehouse name",
          type: "string",
          demandOption: true
        },
        query: {
          describe: "The SQL query to execute",
          type: "string",
          demandOption: true
        }
      },
      async handler({ warehouse, query }) {
        let token = getWranglerR2SqlAuthToken();
        if (!token) {
          token = getCloudflareAPITokenFromEnv();
          if (!token) {
            throw new UserError(
              "Missing WRANGLER_R2_SQL_AUTH_TOKEN environment variable. Tried to fallback to CLOUDFLARE_API_TOKEN, didn't find it either. Please follow instructions in https://developers.cloudflare.com/r2/sql/platform/troubleshooting/ to create a token. Once done, you can prefix the command with the variable definition like so: `WRANGLER_R2_SQL_AUTH_TOKEN=... wrangler r2 sql query ...`. There also other ways to provide the value of this variable, see https://developers.cloudflare.com/workers/wrangler/system-environment-variables/ for more details."
            );
          } else {
            logger.warn(
              "Missing WRANGLER_R2_SQL_AUTH_TOKEN environment variable, falling back to CLOUDFLARE_API_TOKEN"
            );
          }
        }
        const splitIndex = warehouse.indexOf("_");
        if (splitIndex === -1) {
          throw new UserError("Warehouse name has invalid format");
        }
        const [accountId, bucketName] = [
          warehouse.slice(0, splitIndex),
          warehouse.slice(splitIndex + 1)
        ];
        const s7 = spinner();
        s7.start("Query in progress");
        const apiUrl = `https://api.sql.cloudflarestorage.com/api/v1/accounts/${accountId}/r2-sql/query/${bucketName}`;
        let responseStatus = null;
        let statusText = null;
        let text = null;
        let duration = null;
        try {
          const start = Date.now();
          const response = await (0, import_undici19.fetch)(apiUrl, {
            method: "POST",
            headers: {
              Authorization: `Bearer ${token}`,
              "Content-Type": "application/json"
            },
            body: JSON.stringify({
              warehouse,
              query
            })
          });
          responseStatus = response.status;
          statusText = response.statusText;
          text = await response.text();
          duration = Date.now() - start;
        } catch (error2) {
          throw new APIError({
            text: `Failed to connect to R2 SQL API: ${error2 instanceof Error ? error2.message : String(error2)}`
          });
        }
        if (responseStatus === 403) {
          logger.error(
            "Please check that token in WRANGLER_R2_SQL_AUTH_TOKEN or CLOUDFLARE_API_TOKEN has the correct permissions. See https://developers.cloudflare.com/r2/sql/platform/troubleshooting/ for more details."
          );
        }
        let parsed = null;
        try {
          parsed = parseJSON(text);
        } catch {
          throw new APIError({
            text: "Received a malformed response from the API",
            notes: [
              {
                text: truncate(text, 100)
              },
              {
                text: `POST ${apiUrl} -> ${responseStatus} ${statusText}`
              }
            ],
            status: responseStatus
          });
        }
        s7.stop();
        if (parsed.success) {
          formatSqlResults(parsed, duration);
        } else {
          let errors = "";
          for (const { code, message } of parsed.errors) {
            errors += `
* ${code}: ${message}`;
          }
          logger.error(`Query failed because of the following errors:${errors}`);
        }
      }
    });
  }
});

// src/secrets-store/index.ts
var secretsStoreNamespace, secretsStoreStoreNamespace, secretsStoreSecretNamespace;
var init_secrets_store2 = __esm({
  "src/secrets-store/index.ts"() {
    init_import_meta_url();
    init_create_command();
    secretsStoreNamespace = createNamespace({
      metadata: {
        description: `\u{1F510} Manage the Secrets Store`,
        status: "open beta",
        owner: "Product: SSL",
        category: "Storage & databases"
      }
    });
    secretsStoreStoreNamespace = createNamespace({
      metadata: {
        description: "\u{1F510} Manage Stores within the Secrets Store",
        status: "open beta",
        owner: "Product: SSL"
      }
    });
    secretsStoreSecretNamespace = createNamespace({
      metadata: {
        description: "\u{1F510} Manage Secrets within the Secrets Store",
        status: "open beta",
        owner: "Product: SSL"
      }
    });
  }
});

// src/setup.ts
var setupCommand;
var init_setup2 = __esm({
  "src/setup.ts"() {
    init_import_meta_url();
    init_colors();
    init_details2();
    init_run();
    init_telemetry_utils();
    init_create_command();
    init_logger();
    init_output();
    init_package_manager();
    setupCommand = createCommand({
      metadata: {
        description: "\u{1FA84} Setup a project to work on Cloudflare",
        owner: "Workers: Authoring and Testing",
        status: "stable",
        category: "Compute & AI"
      },
      args: {
        yes: {
          describe: 'Answer "yes" to any prompts for configuring your project',
          type: "boolean",
          alias: "y",
          default: false
        },
        build: {
          describe: "Run your project's build command once it has been configured",
          type: "boolean",
          default: false
        },
        "dry-run": {
          describe: "Runs the command without applying any filesystem modifications",
          type: "boolean"
        },
        "completion-message": {
          describe: "Display a message with deployment details after `wrangler setup` is complete",
          type: "boolean",
          default: true,
          hidden: true
        },
        "install-wrangler": {
          describe: "Install Wrangler during project setup",
          type: "boolean",
          default: true,
          hidden: true
        }
      },
      async handler(args, { config }) {
        sendAutoConfigProcessStartedMetricsEvent({
          command: "wrangler setup",
          dryRun: !!args.dryRun
        });
        const details = await getDetailsForAutoConfig({
          wranglerConfig: config
        });
        function logCompletionMessage(message) {
          if (args.completionMessage) {
            logger.log(message);
          }
        }
        __name(logCompletionMessage, "logCompletionMessage");
        if (!details.configured) {
          const autoConfigSummary = await runAutoConfig(details, {
            runBuild: args.build,
            skipConfirmations: args.yes,
            dryRun: args.dryRun,
            enableWranglerInstallation: args.installWrangler
          }).catch((error2) => {
            sendAutoConfigProcessEndedMetricsEvent({
              command: "wrangler setup",
              dryRun: !!args.dryRun,
              success: false,
              error: error2
            });
            throw error2;
          });
          writeOutput({
            type: "autoconfig",
            version: 1,
            command: "setup",
            summary: autoConfigSummary
          });
          if (!args.dryRun) {
            logCompletionMessage(
              "\u{1F389} Your project is now setup to deploy to Cloudflare"
            );
          }
        } else {
          logCompletionMessage(
            "\u{1F389} Your project is already setup to deploy to Cloudflare"
          );
        }
        sendAutoConfigProcessEndedMetricsEvent({
          command: "wrangler setup",
          dryRun: !!args.dryRun,
          success: true
        });
        if (!args.dryRun) {
          const { type } = await getPackageManager();
          logCompletionMessage(
            `You can now deploy with ${brandColor(
              details.packageJson ? `${type} run deploy` : "wrangler deploy"
            )}`
          );
        }
      }
    });
  }
});

// src/zones.ts
function getHostFromRoute(route) {
  let host;
  if (typeof route === "string") {
    host = getHostFromUrl(route);
  } else if (typeof route === "object") {
    host = getHostFromUrl(route.pattern);
    if (host === void 0 && "zone_name" in route) {
      host = getHostFromUrl(route.zone_name);
    }
  }
  return host;
}
async function getZoneForRoute(complianceConfig, from, zoneIdCache = /* @__PURE__ */ new Map()) {
  const { route, accountId } = from;
  const host = getHostFromRoute(route);
  let id;
  if (typeof route === "object" && "zone_id" in route) {
    id = route.zone_id;
  } else if (typeof route === "object" && "zone_name" in route) {
    id = await getZoneIdFromHost(
      complianceConfig,
      {
        host: route.zone_name,
        accountId
      },
      zoneIdCache
    );
  } else if (host) {
    id = await getZoneIdFromHost(
      complianceConfig,
      { host, accountId },
      zoneIdCache
    );
  }
  return id && host ? { id, host } : void 0;
}
function getHostFromUrl(urlLike) {
  if (urlLike.startsWith("*/") || urlLike.startsWith("http://*/") || urlLike.startsWith("https://*/")) {
    return void 0;
  }
  urlLike = urlLike.replace(/\*(\.)?/g, "");
  if (!(urlLike.startsWith("http://") || urlLike.startsWith("https://"))) {
    urlLike = "http://" + urlLike;
  }
  try {
    return new URL(urlLike).host;
  } catch {
    return void 0;
  }
}
async function getZoneIdForPreview(complianceConfig, from) {
  const zoneIdCache = /* @__PURE__ */ new Map();
  const { host, routes, accountId } = from;
  let zoneId;
  if (host) {
    zoneId = await getZoneIdFromHost(
      complianceConfig,
      { host, accountId },
      zoneIdCache
    );
  }
  if (!zoneId && routes) {
    const firstRoute = routes[0];
    const zone = await getZoneForRoute(
      complianceConfig,
      {
        route: firstRoute,
        accountId
      },
      zoneIdCache
    );
    if (zone) {
      zoneId = zone.id;
    }
  }
  return zoneId;
}
async function getZoneIdFromHost(complianceConfig, from, zoneIdCache) {
  const hostPieces = from.host.split(".");
  while (hostPieces.length > 1) {
    const cacheKey = `${from.accountId}:${hostPieces.join(".")}`;
    if (!zoneIdCache.has(cacheKey)) {
      zoneIdCache.set(
        cacheKey,
        retryOnAPIFailure(
          () => fetchListResult(
            complianceConfig,
            `/zones`,
            {},
            new URLSearchParams({
              name: hostPieces.join("."),
              "account.id": from.accountId
            })
          )
        ).then((zones) => zones[0]?.id ?? null)
      );
    }
    const cachedZone = await zoneIdCache.get(cacheKey);
    if (cachedZone) {
      return cachedZone;
    }
    hostPieces.shift();
  }
  throw new UserError(
    `Could not find zone for \`${from.host}\`. Make sure the domain is set up to be proxied by Cloudflare.
For more details, refer to https://developers.cloudflare.com/workers/configuration/routing/routes/#set-up-a-route`
  );
}
async function getRoutesForZone(complianceConfig, zone) {
  const routes = await fetchListResult(
    complianceConfig,
    `/zones/${zone}/workers/routes`
  );
  return routes;
}
function distanceBetween(a7, b11, cache5 = /* @__PURE__ */ new Map()) {
  if (cache5.has(`${a7}|${b11}`)) {
    return cache5.get(`${a7}|${b11}`);
  }
  let result;
  if (b11 == "") {
    result = a7.length;
  } else if (a7 == "") {
    result = b11.length;
  } else if (a7[0] === b11[0]) {
    result = distanceBetween(a7.slice(1), b11.slice(1), cache5);
  } else {
    result = 1 + Math.min(
      distanceBetween(a7.slice(1), b11, cache5),
      distanceBetween(a7, b11.slice(1), cache5),
      distanceBetween(a7.slice(1), b11.slice(1), cache5)
    );
  }
  cache5.set(`${a7}|${b11}`, result);
  return result;
}
function findClosestRoute(providedRoute, assignedRoutes) {
  return assignedRoutes.sort((a7, b11) => {
    const distanceA = distanceBetween(providedRoute, a7.pattern);
    const distanceB = distanceBetween(providedRoute, b11.pattern);
    return distanceA - distanceB;
  });
}
async function getWorkerForZone(complianceConfig, from, configPath) {
  const { worker, accountId } = from;
  const zone = await getZoneForRoute(complianceConfig, {
    route: worker,
    accountId
  });
  if (!zone) {
    throw new UserError(
      `The route '${worker}' is not part of one of your zones. Either add this zone from the Cloudflare dashboard, or try using a route within one of your existing zones.`
    );
  }
  const routes = await getRoutesForZone(complianceConfig, zone.id);
  const scriptName = routes.find((route) => route.pattern === worker)?.script;
  if (!scriptName) {
    const closestRoute = findClosestRoute(worker, routes)?.[0];
    if (!closestRoute) {
      throw new UserError(
        `The route '${worker}' has no workers assigned. You can assign a worker to it from your ${configFileName(configPath)} file or the Cloudflare dashboard`
      );
    } else {
      throw new UserError(
        `The route '${worker}' has no workers assigned. Did you mean to tail the route '${closestRoute.pattern}'?`
      );
    }
  }
  return scriptName;
}
var init_zones3 = __esm({
  "src/zones.ts"() {
    init_import_meta_url();
    init_dist();
    init_cfetch();
    init_retry();
    __name(getHostFromRoute, "getHostFromRoute");
    __name(getZoneForRoute, "getZoneForRoute");
    __name(getHostFromUrl, "getHostFromUrl");
    __name(getZoneIdForPreview, "getZoneIdForPreview");
    __name(getZoneIdFromHost, "getZoneIdFromHost");
    __name(getRoutesForZone, "getRoutesForZone");
    __name(distanceBetween, "distanceBetween");
    __name(findClosestRoute, "findClosestRoute");
    __name(getWorkerForZone, "getWorkerForZone");
  }
});
var import_signal_exit6, tailCommand;
var init_tail2 = __esm({
  "src/tail/index.ts"() {
    init_import_meta_url();
    init_dist();
    import_signal_exit6 = __toESM(require_signal_exit());
    init_create_command();
    init_logger();
    init_metrics();
    init_user3();
    init_getLegacyScriptName();
    init_useServiceEnvironments();
    init_wrangler_banner();
    init_zones3();
    init_createTail();
    tailCommand = createCommand({
      metadata: {
        description: "\u{1F99A} Start a log tailing session for a Worker",
        status: "stable",
        owner: "Workers: Workers Observability",
        category: "Compute & AI"
      },
      positionalArgs: ["worker"],
      args: {
        worker: {
          describe: "Name or route of the worker to tail",
          type: "string"
        },
        format: {
          choices: ["json", "pretty"],
          describe: "The format of log entries"
        },
        status: {
          choices: ["ok", "error", "canceled"],
          describe: "Filter by invocation status",
          array: true
        },
        header: {
          type: "string",
          requiresArg: true,
          describe: "Filter by HTTP header"
        },
        method: {
          type: "string",
          requiresArg: true,
          describe: "Filter by HTTP method",
          array: true
        },
        "sampling-rate": {
          type: "number",
          describe: "Adds a percentage of requests to log sampling rate"
        },
        search: {
          type: "string",
          requiresArg: true,
          describe: "Filter by a text match in console.log messages"
        },
        ip: {
          type: "string",
          requiresArg: true,
          describe: 'Filter by the IP address the request originates from. Use "self" to filter for your own IP',
          array: true
        },
        "version-id": {
          type: "string",
          requiresArg: true,
          describe: "Filter by Worker version"
        },
        debug: {
          type: "boolean",
          hidden: true,
          default: false,
          describe: "If a log would have been filtered out, send it through anyway alongside the filter which would have blocked it."
        },
        "legacy-env": {
          type: "boolean",
          describe: "Use legacy environments",
          hidden: true
        }
      },
      behaviour: {
        printBanner: false
      },
      async handler(args, { config }) {
        args.format ??= process.stdout.isTTY ? "pretty" : "json";
        if (args.format === "pretty") {
          await printWranglerBanner();
        }
        if (config.pages_build_output_dir) {
          throw new UserError(
            "It looks like you've run a Workers-specific command in a Pages project.\nFor Pages, please run `wrangler pages deployment tail` instead."
          );
        }
        sendMetricsEvent("begin log stream", {
          sendMetrics: config.send_metrics
        });
        let scriptName;
        const accountId = await requireAuth(config);
        if (args.worker?.includes(".")) {
          scriptName = await getWorkerForZone(
            config,
            {
              worker: args.worker,
              accountId
            },
            config.configPath
          );
          if (args.format === "pretty") {
            logger.log(
              `Connecting to worker ${scriptName} at route ${args.worker}`
            );
          }
        } else {
          scriptName = getLegacyScriptName({ name: args.worker, ...args }, config);
        }
        if (!scriptName) {
          throw new UserError(
            `Required Worker name missing. Please specify the Worker name in your ${configFileName(config.configPath)} file, or pass it as an argument with \`wrangler tail <worker-name>\``
          );
        }
        const cliFilters = {
          status: args.status,
          header: args.header,
          method: args.method,
          samplingRate: args.samplingRate,
          search: args.search,
          clientIp: args.ip,
          versionId: args.versionId
        };
        const filters = translateCLICommandToFilterMessage(cliFilters);
        const { tail, expiration, deleteTail } = await createTail(
          config,
          accountId,
          scriptName,
          filters,
          args.debug,
          useServiceEnvironments(config) ? args.env : void 0
        );
        const scriptDisplayName = `${scriptName}${useServiceEnvironments(config) && args.env ? ` (${args.env})` : ""}`;
        if (args.format === "pretty") {
          logger.log(
            `Successfully created tail, expires at ${expiration.toLocaleString()}`
          );
        }
        const printLog = args.format === "pretty" ? prettyPrintLogs : jsonPrintLogs;
        tail.on("message", printLog);
        while (tail.readyState !== tail.OPEN) {
          switch (tail.readyState) {
            case tail.CONNECTING:
              await promises.setTimeout(100);
              break;
            case tail.CLOSING:
              await promises.setTimeout(100);
              break;
            case tail.CLOSED:
              sendMetricsEvent("end log stream", {
                sendMetrics: config.send_metrics
              });
              throw new Error(
                `Connection to ${scriptDisplayName} closed unexpectedly.`
              );
          }
        }
        if (args.format === "pretty") {
          logger.log(`Connected to ${scriptDisplayName}, waiting for logs...`);
        }
        const cancelPing = startWebSocketPing();
        tail.on("close", exit4);
        (0, import_signal_exit6.default)(exit4);
        async function exit4() {
          cancelPing();
          tail.terminate();
          await deleteTail();
          sendMetricsEvent("end log stream", {
            sendMetrics: config.send_metrics
          });
        }
        __name(exit4, "exit");
        function startWebSocketPing() {
          const PING_MESSAGE = Buffer.from("wrangler tail ping");
          const PING_INTERVAL = 1e4;
          let waitingForPong = false;
          const pingInterval = setInterval(() => {
            if (waitingForPong) {
              throw createFatalError(
                "Tail disconnected, exiting.",
                args.format === "json",
                1,
                { telemetryMessage: true }
              );
            }
            waitingForPong = true;
            tail.ping(PING_MESSAGE);
          }, PING_INTERVAL);
          tail.on("pong", (data) => {
            if (data.equals(PING_MESSAGE)) {
              waitingForPong = false;
            }
          });
          return () => clearInterval(pingInterval);
        }
        __name(startWebSocketPing, "startWebSocketPing");
      }
    });
  }
});

// src/routes.ts
async function getWorkersDevSubdomain(complianceConfig, accountId, configPath, apiToken, abortSignal) {
  try {
    const { subdomain } = await fetchResult(
      complianceConfig,
      `/accounts/${accountId}/workers/subdomain`,
      void 0,
      void 0,
      abortSignal,
      apiToken
    );
    return `${subdomain}${getComplianceRegionSubdomain(complianceConfig)}.workers.dev`;
  } catch (e10) {
    const error2 = e10;
    if (typeof error2 === "object" && !!error2 && error2.code === 10007) {
      logger.warn(
        "You need to register a workers.dev subdomain before publishing to workers.dev"
      );
      const wantsToRegister = await confirm(
        "Would you like to register a workers.dev subdomain now?",
        { fallbackValue: false }
      );
      if (!wantsToRegister) {
        const solutionMessage = `You can either deploy your worker to one or more routes by specifying them in your ${configFileName(configPath)} file, or register a workers.dev subdomain here:`;
        const onboardingLink = `https://dash.cloudflare.com/${accountId}/workers/onboarding`;
        throw new UserError(`${solutionMessage}
${onboardingLink}`);
      }
      return await registerSubdomain(complianceConfig, accountId, configPath);
    } else {
      throw e10;
    }
  }
}
async function registerSubdomain(complianceConfig, accountId, configPath) {
  let subdomain;
  while (subdomain === void 0) {
    const potentialName = await prompt(
      "What would you like your workers.dev subdomain to be? It will be accessible at https://<subdomain>.workers.dev"
    );
    if (!/^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/.test(potentialName)) {
      logger.warn(
        `${potentialName} is invalid, please choose another subdomain.`
      );
      continue;
    }
    try {
      await fetchResult(
        complianceConfig,
        `/accounts/${accountId}/workers/subdomains/${potentialName}`
      );
    } catch (err) {
      const subdomainAvailabilityCheckError = err;
      if (typeof subdomainAvailabilityCheckError === "object" && !!subdomainAvailabilityCheckError) {
        if (subdomainAvailabilityCheckError.code === 10032) ; else if (subdomainAvailabilityCheckError.code === 10031) {
          logger.error(
            "Subdomain is unavailable, please try a different subdomain"
          );
          continue;
        } else {
          logger.error("An unexpected error occurred, please try again.");
          continue;
        }
      }
    }
    const ok = await confirm(
      `Creating a workers.dev subdomain for your account at ${source_default.blue(
        source_default.underline(
          `https://${potentialName}${getComplianceRegionSubdomain(complianceConfig)}.workers.dev`
        )
      )}. Ok to proceed?`
    );
    if (!ok) {
      const solutionMessage = `You can either deploy your worker to one or more routes by specifying them in your ${configFileName(configPath)} file, or register a workers.dev subdomain here:`;
      const onboardingLink = `https://dash.cloudflare.com/${accountId}/workers/onboarding`;
      throw new UserError(`${solutionMessage}
${onboardingLink}`);
    }
    try {
      const result = await fetchResult(
        complianceConfig,
        `/accounts/${accountId}/workers/subdomain`,
        {
          method: "PUT",
          body: JSON.stringify({ subdomain: potentialName })
        }
      );
      subdomain = result.subdomain;
    } catch (err) {
      const subdomainCreationError = err;
      if (typeof subdomainCreationError === "object" && !!subdomainCreationError && subdomainCreationError.code !== void 0) {
        switch (subdomainCreationError.code) {
          case 10031:
            logger.error(
              "Subdomain is unavailable, please try a different subdomain."
            );
            break;
          default:
            logger.error("An unexpected error occurred, please try again.");
            break;
        }
      }
    }
  }
  logger.log("Success! It may take a few minutes for DNS records to update.");
  logger.log(
    `Visit ${source_default.blue(
      source_default.underline(
        `https://dash.cloudflare.com/${accountId}/workers/subdomain`
      )
    )} to edit your workers.dev subdomain`
  );
  return `${subdomain}${getComplianceRegionSubdomain(complianceConfig)}.workers.dev`;
}
var init_routes6 = __esm({
  "src/routes.ts"() {
    init_import_meta_url();
    init_dist();
    init_source();
    init_cfetch();
    init_dialogs();
    init_logger();
    __name(getWorkersDevSubdomain, "getWorkersDevSubdomain");
    __name(registerSubdomain, "registerSubdomain");
  }
});

// src/triggers/deploy.ts
async function triggersDeploy(props) {
  const { config, accountId, name: scriptName } = props;
  const schedules = props.triggers || config.triggers?.crons;
  const routes = props.routes ?? config.routes ?? (config.route ? [config.route] : []) ?? [];
  const routesOnly = [];
  const customDomainsOnly = [];
  validateRoutes3(routes, props.assetsOptions);
  for (const route of routes) {
    if (typeof route !== "string" && route.custom_domain) {
      customDomainsOnly.push(route);
    } else {
      routesOnly.push(route);
    }
  }
  if (!scriptName) {
    throw new UserError(
      'You need to provide a name when uploading a Worker Version. Either pass it as a cli arg with `--name <name>` or in your config file as `name = "<name>"`',
      { telemetryMessage: true }
    );
  }
  const envName = props.env ?? "production";
  const start = Date.now();
  const useServiceEnvironments2 = Boolean(
    props.useServiceEnvironments && props.env
  );
  const workerName = useServiceEnvironments2 ? `${scriptName} (${envName})` : scriptName;
  const workerUrl = useServiceEnvironments2 ? `/accounts/${accountId}/workers/services/${scriptName}/environments/${envName}` : `/accounts/${accountId}/workers/scripts/${scriptName}`;
  if (!props.dryRun) {
    await ensureQueuesExistByConfig(config);
  }
  if (props.dryRun) {
    logger.log(`--dry-run: exiting now.`);
    return;
  }
  if (!accountId) {
    throw new UserError("Missing accountId", { telemetryMessage: true });
  }
  const uploadMs = Date.now() - start;
  const deployments = [];
  const { wantWorkersDev, workersDevInSync } = await subdomainDeploy(
    props,
    accountId,
    scriptName,
    envName,
    workerUrl,
    routes,
    deployments,
    props.firstDeploy
  );
  if (!wantWorkersDev && workersDevInSync && routes.length !== 0) {
    const routesWithOtherBindings = {};
    const queue = new PQueue({ concurrency: 10 });
    const queuePromises = [];
    const zoneRoutesCache = /* @__PURE__ */ new Map();
    const zoneIdCache = /* @__PURE__ */ new Map();
    for (const route of routes) {
      queuePromises.push(
        queue.add(async () => {
          const zone = await getZoneForRoute(
            config,
            { route, accountId },
            zoneIdCache
          );
          if (!zone) {
            return;
          }
          const routePattern = typeof route === "string" ? route : route.pattern;
          let routesInZone = zoneRoutesCache.get(zone.id);
          if (!routesInZone) {
            routesInZone = retryOnAPIFailure(
              () => fetchListResult(config, `/zones/${zone.id}/workers/routes`)
            );
            zoneRoutesCache.set(zone.id, routesInZone);
          }
          (await routesInZone).forEach(({ script, pattern }) => {
            if (pattern === routePattern && script !== scriptName) {
              if (!(script in routesWithOtherBindings)) {
                routesWithOtherBindings[script] = [];
              }
              routesWithOtherBindings[script].push(pattern);
            }
          });
        })
      );
    }
    await Promise.all(queuePromises);
    if (Object.keys(routesWithOtherBindings).length > 0) {
      let errorMessage = "Can't deploy routes that are assigned to another worker.\n";
      for (const worker in routesWithOtherBindings) {
        const assignedRoutes = routesWithOtherBindings[worker];
        errorMessage += `"${worker}" is already assigned to routes:
${assignedRoutes.map(
          (r10) => `  - ${source_default.underline(r10)}
`
        )}`;
      }
      const resolution = "Unassign other workers from the routes you want to deploy to, and then try again.";
      const dashHref = source_default.blue.underline(
        `https://dash.cloudflare.com/${accountId}/workers/overview`
      );
      const dashLink = `Visit ${dashHref} to unassign a worker from a route.`;
      throw new UserError(`${errorMessage}
${resolution}
${dashLink}`);
    }
  }
  if (routesOnly.length > 0) {
    deployments.push(
      publishRoutes(config, routesOnly, {
        workerUrl,
        scriptName,
        useServiceEnvironments: useServiceEnvironments2,
        accountId
      }).then(() => {
        if (routesOnly.length > 10) {
          return routesOnly.slice(0, 9).map((route) => renderRoute(route)).concat([`...and ${routesOnly.length - 10} more routes`]);
        }
        return routesOnly.map((route) => renderRoute(route));
      })
    );
  }
  if (customDomainsOnly.length > 0) {
    deployments.push(
      publishCustomDomains(config, workerUrl, accountId, customDomainsOnly)
    );
  }
  if (schedules) {
    deployments.push(
      fetchResult(config, `${workerUrl}/schedules`, {
        // Note: PUT will override previous schedules on this script.
        method: "PUT",
        body: JSON.stringify(schedules.map((cron) => ({ cron }))),
        headers: {
          "Content-Type": "application/json"
        }
      }).then(() => schedules.map((trigger) => `schedule: ${trigger}`))
    );
  }
  if (config.queues.producers && config.queues.producers.length) {
    deployments.push(
      ...config.queues.producers.map(
        (producer) => Promise.resolve([`Producer for ${producer.queue}`])
      )
    );
  }
  if (config.queues.consumers && config.queues.consumers.length) {
    const updateConsumers = await updateQueueConsumers(scriptName, config);
    deployments.push(...updateConsumers);
  }
  if (config.workflows?.length) {
    for (const workflow of config.workflows) {
      if (workflow.script_name !== void 0 && workflow.script_name !== scriptName) {
        if (workflow.limits) {
          throw new UserError(
            `Workflow "${workflow.name}" has "limits" configured but references external script "${workflow.script_name}". Configure limits on the worker that defines the workflow.`
          );
        }
        continue;
      }
      deployments.push(
        fetchResult(
          config,
          `/accounts/${accountId}/workflows/${workflow.name}`,
          {
            method: "PUT",
            body: JSON.stringify({
              script_name: scriptName,
              class_name: workflow.class_name,
              ...workflow.limits && { limits: workflow.limits }
            }),
            headers: {
              "Content-Type": "application/json"
            }
          }
        ).then(() => [`workflow: ${workflow.name}`])
      );
    }
  }
  const targets = await Promise.all(deployments);
  const deployMs = Date.now() - start - uploadMs;
  if (deployments.length > 0) {
    logger.log(`Deployed ${workerName} triggers`, formatTime2(deployMs));
    const flatTargets = targets.flat().map(
      // Append protocol only on workers.dev domains
      (target) => (target.endsWith("workers.dev") ? "https://" : "") + target
    );
    for (const target of flatTargets) {
      logger.log(" ", target);
    }
    return flatTargets;
  } else {
    logger.log("No deploy targets for", workerName, formatTime2(deployMs));
  }
}
function getSubdomainValues(config_workers_dev, config_preview_urls, routes) {
  const defaultWorkersDev = routes.length === 0;
  const workers_dev = config_workers_dev ?? defaultWorkersDev;
  const defaultPreviewUrls = void 0;
  const preview_urls = config_preview_urls ?? defaultPreviewUrls;
  return {
    workers_dev,
    preview_urls
  };
}
function getSubdomainValuesAPIMock(config_workers_dev, config_preview_urls, routes) {
  const defaultWorkersDev = routes.length === 0;
  const workers_dev = config_workers_dev ?? defaultWorkersDev;
  const defaultPreviewUrls = defaultWorkersDev;
  const preview_urls = config_preview_urls ?? defaultPreviewUrls;
  return {
    workers_dev,
    preview_urls
  };
}
async function validateSubdomainMixedState(props, accountId, scriptName, before, after, firstDeploy) {
  const { config } = props;
  const changed = after.workers_dev !== before.workers_dev || after.preview_urls !== before.preview_urls;
  if (!changed) {
    return after;
  }
  if (getSubdomainMixedStateCheckDisabled()) {
    return after;
  }
  if (isNonInteractiveOrCI()) {
    return after;
  }
  if (firstDeploy) {
    return after;
  }
  if (after.workers_dev === after.preview_urls) {
    return after;
  }
  const userSubdomain = await getWorkersDevSubdomain(
    config,
    accountId,
    config.configPath
  );
  const previewUrl = `https://<VERSION_PREFIX>-${scriptName}.${userSubdomain}`;
  if (!after.workers_dev && after.preview_urls) {
    logger.warn(
      [
        "You are disabling the 'workers.dev' subdomain for this Worker, but Preview URLs are still enabled.",
        "Preview URLs will automatically generate a unique, shareable link for each new version which will be accessible at:",
        `  ${previewUrl}`,
        "",
        "To prevent this Worker from being unintentionally public, you may want to disable the Preview URLs as well by setting `preview_urls = false` in your Wrangler config file."
      ].join("\n")
    );
  }
  if (after.workers_dev && !after.preview_urls) {
    logger.warn(
      [
        "You are enabling the 'workers.dev' subdomain for this Worker, but Preview URLs are still disabled.",
        "Preview URLs will automatically generate a unique, shareable link for each new version which will be accessible at:",
        `  ${previewUrl}`,
        "",
        "You may want to enable the Preview URLs as well by setting `preview_urls = true` in your Wrangler config file."
      ].join("\n")
    );
  }
  return after;
}
async function subdomainDeploy(props, accountId, scriptName, envName, workerUrl, routes, deployments, firstDeploy) {
  const { config } = props;
  const { workers_dev: wantWorkersDev, preview_urls: wantPreviews } = getSubdomainValues(config.workers_dev, config.preview_urls, routes);
  let workersDevURL;
  if (wantWorkersDev) {
    const userSubdomain = await getWorkersDevSubdomain(
      config,
      accountId,
      config.configPath
    );
    workersDevURL = !props.useServiceEnvironments || !props.env ? `${scriptName}.${userSubdomain}` : `${envName}.${scriptName}.${userSubdomain}`;
  }
  const before = await fetchResult(config, `${workerUrl}/subdomain`);
  const after = await retryOnAPIFailure(
    async () => fetchResult(config, `${workerUrl}/subdomain`, {
      method: "POST",
      body: JSON.stringify({
        enabled: wantWorkersDev,
        previews_enabled: wantPreviews
      }),
      headers: {
        "Content-Type": "application/json",
        "Cloudflare-Workers-Script-Api-Date": "2025-08-01"
      }
    })
  );
  if (!firstDeploy && config.workers_dev == void 0 && after.enabled !== before.enabled) {
    const status2 = /* @__PURE__ */ __name((enabled, past) => {
      if (past) {
        return enabled ? "enabled" : "disabled";
      } else {
        return enabled ? "enable" : "disable";
      }
    }, "status");
    logger.warn(
      [
        `Because 'workers_dev' is not in your Wrangler file, it will be ${status2(after.enabled, true)} for this deployment by default.`,
        `To override this setting, you can ${status2(before.enabled, false)} workers.dev by explicitly setting 'workers_dev = ${before.enabled}' in your Wrangler file.`
      ].join("\n")
    );
  }
  if (!firstDeploy && config.preview_urls == void 0 && after.previews_enabled !== before.previews_enabled) {
    const status2 = /* @__PURE__ */ __name((enabled, past) => {
      if (past) {
        return enabled ? "enabled" : "disabled";
      } else {
        return enabled ? "enable" : "disable";
      }
    }, "status");
    logger.warn(
      [
        `Because your 'workers.dev' route is ${status2(after.enabled, true)} and your 'preview_urls' setting is not in your Wrangler file, Preview URLs will be ${status2(after.previews_enabled, true)} for this deployment by default.`,
        `To override this setting, you can ${status2(before.previews_enabled, false)} Preview URLs by explicitly setting 'preview_urls = ${before.previews_enabled}' in your Wrangler file.`
      ].join("\n")
    );
  }
  await validateSubdomainMixedState(
    props,
    accountId,
    scriptName,
    { workers_dev: before.enabled, preview_urls: before.previews_enabled },
    { workers_dev: after.enabled, preview_urls: after.previews_enabled },
    firstDeploy
  );
  if (workersDevURL) {
    deployments.push(Promise.resolve([workersDevURL]));
  }
  return {
    wantWorkersDev,
    wantPreviews,
    workersDevInSync: before.enabled === after.enabled,
    previewsInSync: before.previews_enabled === after.previews_enabled
  };
}
var init_deploy5 = __esm({
  "src/triggers/deploy.ts"() {
    init_import_meta_url();
    init_dist();
    init_source();
    init_dist6();
    init_cfetch();
    init_deploy7();
    init_is_interactive();
    init_logger();
    init_client11();
    init_routes6();
    init_retry();
    init_zones3();
    __name(triggersDeploy, "triggersDeploy");
    __name(getSubdomainValues, "getSubdomainValues");
    __name(getSubdomainValuesAPIMock, "getSubdomainValuesAPIMock");
    __name(validateSubdomainMixedState, "validateSubdomainMixedState");
    __name(subdomainDeploy, "subdomainDeploy");
  }
});

// src/triggers/index.ts
var triggersNamespace, triggersDeployCommand;
var init_triggers = __esm({
  "src/triggers/index.ts"() {
    init_import_meta_url();
    init_assets5();
    init_create_command();
    init_metrics();
    init_user3();
    init_getScriptName();
    init_useServiceEnvironments();
    init_deploy5();
    triggersNamespace = createNamespace({
      metadata: {
        description: "\u{1F3AF} Updates the triggers of your current deployment",
        status: "experimental",
        owner: "Workers: Authoring and Testing",
        category: "Compute & AI"
      }
    });
    triggersDeployCommand = createCommand({
      metadata: {
        description: "Apply changes to triggers (Routes or domains and Cron Triggers) when using `wrangler versions upload`",
        status: "experimental",
        owner: "Workers: Authoring and Testing"
      },
      args: {
        name: {
          describe: "Name of the worker",
          type: "string",
          requiresArg: true
        },
        triggers: {
          describe: "cron schedules to attach",
          alias: ["schedule", "schedules"],
          type: "string",
          requiresArg: true,
          array: true
        },
        routes: {
          describe: "Routes to upload",
          alias: "route",
          type: "string",
          requiresArg: true,
          array: true
        },
        "dry-run": {
          describe: "Don't actually deploy",
          type: "boolean"
        },
        "legacy-env": {
          type: "boolean",
          describe: "Use legacy environments",
          hidden: true
        }
      },
      behaviour: {
        warnIfMultipleEnvsConfiguredButNoneSpecified: true
      },
      async handler(args, { config }) {
        const assetsOptions = getAssetsOptions({ assets: void 0 }, config);
        sendMetricsEvent("deploy worker triggers", {
          sendMetrics: config.send_metrics
        });
        const accountId = args.dryRun ? void 0 : await requireAuth(config);
        await triggersDeploy({
          config,
          accountId,
          name: getScriptName(args, config),
          env: args.env,
          triggers: args.triggers,
          routes: args.routes,
          useServiceEnvironments: useServiceEnvironments(config),
          dryRun: args.dryRun,
          assetsOptions,
          firstDeploy: false
          // at this point the Worker should already exist.
        });
      }
    });
  }
});

// src/tunnel/client.ts
function isTunnelPermissionError(error2) {
  if (error2 instanceof Cloudflare.APIError) {
    if (error2.status === 403 || error2.status === 401) {
      return true;
    }
  }
  return false;
}
async function withTunnelErrorHandling(operation) {
  try {
    return await operation();
  } catch (error2) {
    if (isTunnelPermissionError(error2)) {
      throw new UserError(TUNNEL_PERMISSION_ERROR_MESSAGE);
    }
    if (error2 instanceof Cloudflare.APIError) {
      throw new UserError(error2.message, { cause: error2 });
    }
    throw error2;
  }
}
async function createTunnel(sdk, accountId, name2) {
  return withTunnelErrorHandling(async () => {
    const response = await sdk.zeroTrust.tunnels.cloudflared.create({
      account_id: accountId,
      name: name2,
      config_src: "cloudflare"
    });
    return normalizeTunnelResponse(response);
  });
}
async function getTunnel(sdk, accountId, tunnelId) {
  return withTunnelErrorHandling(async () => {
    const response = await sdk.zeroTrust.tunnels.cloudflared.get(tunnelId, {
      account_id: accountId
    });
    return normalizeTunnelResponse(response);
  });
}
async function listTunnels(sdk, accountId) {
  return withTunnelErrorHandling(async () => {
    const tunnels = [];
    for await (const tunnel of sdk.zeroTrust.tunnels.cloudflared.list({
      account_id: accountId
    })) {
      tunnels.push(normalizeTunnelResponse(tunnel));
    }
    return tunnels;
  });
}
async function deleteTunnel(sdk, accountId, tunnelId) {
  return withTunnelErrorHandling(async () => {
    await sdk.zeroTrust.tunnels.cloudflared.delete(tunnelId, {
      account_id: accountId
    });
  });
}
async function getTunnelToken(sdk, accountId, tunnelId) {
  return withTunnelErrorHandling(async () => {
    const response = await sdk.zeroTrust.tunnels.cloudflared.token.get(
      tunnelId,
      {
        account_id: accountId
      }
    );
    return String(response);
  });
}
function normalizeTunnelResponse(response) {
  return response;
}
function isTunnelId(input) {
  return TUNNEL_ID_REGEX.test(input);
}
async function resolveTunnelId(sdk, accountId, input) {
  if (isTunnelId(input)) {
    return input;
  }
  const tunnels = await withTunnelErrorHandling(async () => {
    const results = [];
    for await (const tunnel of sdk.zeroTrust.tunnels.cloudflared.list({
      account_id: accountId,
      name: input,
      is_deleted: false
    })) {
      results.push(normalizeTunnelResponse(tunnel));
    }
    return results;
  });
  if (tunnels.length === 0) {
    throw new UserError(
      `"${input}" is neither the ID nor the name of any of your tunnels`
    );
  }
  if (tunnels.length > 1) {
    throw new UserError(
      `Found multiple tunnels named "${input}". Please use the tunnel ID instead.`
    );
  }
  const tunnelId = tunnels[0].id;
  if (!tunnelId) {
    throw new UserError(
      `Tunnel "${input}" was found but has no ID. This is unexpected \u2014 please try again or use the tunnel ID directly.`
    );
  }
  return tunnelId;
}
var TUNNEL_PERMISSION_ERROR_MESSAGE, TUNNEL_ID_REGEX;
var init_client12 = __esm({
  "src/tunnel/client.ts"() {
    init_import_meta_url();
    init_dist();
    init_cloudflare();
    TUNNEL_PERMISSION_ERROR_MESSAGE = `
Cloudflare Tunnel commands require API token authentication with tunnel permissions.

OAuth login (via 'wrangler login') does not currently include tunnel permissions.
To use tunnel commands, please authenticate using an API token:

1. Create an API token at https://dash.cloudflare.com/profile/api-tokens
2. Create a custom token with:
   - Account > Cloudflare Tunnel > Edit
3. Set the token and account ID as environment variables:
   export CLOUDFLARE_API_TOKEN=<your-token>
   export CLOUDFLARE_ACCOUNT_ID=<your-account-id>

Then run your tunnel command again.
`.trim();
    __name(isTunnelPermissionError, "isTunnelPermissionError");
    __name(withTunnelErrorHandling, "withTunnelErrorHandling");
    __name(createTunnel, "createTunnel");
    __name(getTunnel, "getTunnel");
    __name(listTunnels, "listTunnels");
    __name(deleteTunnel, "deleteTunnel");
    __name(getTunnelToken, "getTunnelToken");
    __name(normalizeTunnelResponse, "normalizeTunnelResponse");
    TUNNEL_ID_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
    __name(isTunnelId, "isTunnelId");
    __name(resolveTunnelId, "resolveTunnelId");
  }
});

// src/tunnel/create.ts
var tunnelCreateCommand;
var init_create14 = __esm({
  "src/tunnel/create.ts"() {
    init_import_meta_url();
    init_create_command();
    init_user3();
    init_client12();
    tunnelCreateCommand = createCommand({
      metadata: {
        description: "Create a new Cloudflare Tunnel",
        status: "experimental",
        owner: "Product: Tunnels"
      },
      args: {
        name: {
          type: "string",
          demandOption: true,
          description: "The name of the tunnel"
        }
      },
      positionalArgs: ["name"],
      async handler(args, { config, sdk, logger: logger4 }) {
        const accountId = await requireAuth(config);
        logger4.log(`Creating tunnel "${args.name}"`);
        const tunnel = await createTunnel(sdk, accountId, args.name);
        logger4.log(`Created tunnel.`);
        logger4.log(`ID: ${tunnel.id}`);
        logger4.log(`Name: ${tunnel.name}`);
        logger4.log(
          `
To run this tunnel, configure its ingress rules in the Cloudflare dashboard, then run:`
        );
        logger4.log(`   wrangler tunnel run ${tunnel.id}`);
      }
    });
  }
});

// src/tunnel/delete.ts
var tunnelDeleteCommand;
var init_delete13 = __esm({
  "src/tunnel/delete.ts"() {
    init_import_meta_url();
    init_create_command();
    init_dialogs();
    init_user3();
    init_client12();
    tunnelDeleteCommand = createCommand({
      metadata: {
        description: "Delete a Cloudflare Tunnel",
        status: "experimental",
        owner: "Product: Tunnels"
      },
      args: {
        tunnel: {
          type: "string",
          demandOption: true,
          description: "The name or UUID of the tunnel"
        },
        force: {
          alias: "y",
          type: "boolean",
          description: "Skip confirmation"
        }
      },
      positionalArgs: ["tunnel"],
      async handler(args, { config, logger: logger4, sdk }) {
        const accountId = await requireAuth(config);
        if (!args.force) {
          const confirmed = await confirm(
            `Are you sure you want to delete tunnel "${args.tunnel}"? This action cannot be undone.`
          );
          if (!confirmed) {
            logger4.log("Deletion cancelled.");
            return;
          }
        }
        logger4.log(`Deleting tunnel "${args.tunnel}"`);
        const tunnelId = await resolveTunnelId(sdk, accountId, args.tunnel);
        await deleteTunnel(sdk, accountId, tunnelId);
        logger4.log(`Tunnel deleted.`);
      }
    });
  }
});

// src/tunnel/index.ts
var tunnelNamespace;
var init_tunnel = __esm({
  "src/tunnel/index.ts"() {
    init_import_meta_url();
    init_create_command();
    tunnelNamespace = createNamespace({
      metadata: {
        description: "\u{1F687} Manage Cloudflare Tunnels",
        status: "experimental",
        owner: "Product: Tunnels",
        category: "Networking & security"
      }
    });
  }
});

// src/tunnel/info.ts
var tunnelInfoCommand;
var init_info4 = __esm({
  "src/tunnel/info.ts"() {
    init_import_meta_url();
    init_create_command();
    init_user3();
    init_client12();
    tunnelInfoCommand = createCommand({
      metadata: {
        description: "Display details about a Cloudflare Tunnel",
        status: "experimental",
        owner: "Product: Tunnels"
      },
      args: {
        tunnel: {
          type: "string",
          demandOption: true,
          description: "The name or UUID of the tunnel"
        }
      },
      positionalArgs: ["tunnel"],
      async handler(args, { config, logger: logger4, sdk }) {
        const accountId = await requireAuth(config);
        const tunnelId = await resolveTunnelId(sdk, accountId, args.tunnel);
        logger4.log(`Getting tunnel details for "${args.tunnel}"`);
        const tunnel = await getTunnel(sdk, accountId, tunnelId);
        logger4.log(`
Tunnel Information:`);
        logger4.log(`  ID: ${tunnel.id}`);
        logger4.log(`  Name: ${tunnel.name}`);
        logger4.log(`  Status: ${tunnel.status ?? "unknown"}`);
        logger4.log(`  Type: ${tunnel.tun_type ?? "cfd_tunnel"}`);
        if (tunnel.created_at) {
          logger4.log(`  Created: ${new Date(tunnel.created_at).toLocaleString()}`);
        }
        if (tunnel.conns_active_at) {
          logger4.log(
            `  Last Active: ${new Date(tunnel.conns_active_at).toLocaleString()}`
          );
        }
      }
    });
  }
});

// src/tunnel/list.ts
var tunnelListCommand;
var init_list17 = __esm({
  "src/tunnel/list.ts"() {
    init_import_meta_url();
    init_create_command();
    init_user3();
    init_client12();
    tunnelListCommand = createCommand({
      metadata: {
        description: "List all Cloudflare Tunnels in your account",
        status: "experimental",
        owner: "Product: Tunnels"
      },
      args: {},
      behaviour: { printBanner: false, printResourceLocation: false },
      async handler(args, { config, logger: logger4, sdk }) {
        const accountId = await requireAuth(config);
        logger4.log(`Listing Cloudflare Tunnels`);
        const tunnels = await listTunnels(sdk, accountId);
        if (tunnels.length === 0) {
          logger4.log("No tunnels found.");
          return;
        }
        logger4.table(
          tunnels.map((tunnel) => ({
            id: tunnel.id ?? "",
            name: tunnel.name ?? "",
            status: tunnel.status ?? "unknown",
            created_at: tunnel.created_at ? new Date(tunnel.created_at).toLocaleString() : "",
            tun_type: tunnel.tun_type ?? "cfd_tunnel"
          }))
        );
      }
    });
  }
});
function sha256Hex(buffer) {
  return crypto2.createHash("sha256").update(buffer).digest("hex");
}
function getGoArch() {
  const nodeArch = os11.arch();
  switch (nodeArch) {
    case "x64":
      return "amd64";
    case "arm64":
      return "arm64";
    case "arm":
      return "arm";
    default:
      throw new UserError(
        `Unsupported architecture for cloudflared: ${nodeArch}

cloudflared supports: x64 (amd64), arm64, arm

You can manually install cloudflared and set the CLOUDFLARED_PATH environment variable.
Download instructions: https://developers.cloudflare.com/cloudflare-one/networks/connectors/cloudflare-tunnel/downloads/`
      );
  }
}
function getGoOS() {
  switch (process.platform) {
    case "darwin":
      return "darwin";
    case "linux":
      return "linux";
    case "win32":
      return "windows";
    default:
      throw new UserError(
        `Unsupported platform for cloudflared: ${process.platform}

cloudflared supports: darwin (macOS), linux, win32 (Windows)

You can manually install cloudflared and set the CLOUDFLARED_PATH environment variable.
Download instructions: https://developers.cloudflare.com/cloudflare-one/networks/connectors/cloudflare-tunnel/downloads/`
      );
  }
}
function getAssetFilename(goOS, goArch) {
  if (goOS === "windows") {
    return `cloudflared-${goOS}-${goArch}.exe`;
  }
  if (goOS === "darwin") {
    return `cloudflared-${goOS}-${goArch}.tgz`;
  }
  return `cloudflared-${goOS}-${goArch}`;
}
async function queryUpdateService(goOS, goArch) {
  const url4 = new URL(UPDATE_SERVICE_URL);
  url4.searchParams.set("os", goOS);
  url4.searchParams.set("arch", goArch);
  logger.debug(`Checking for latest cloudflared: ${url4.toString()}`);
  let response;
  try {
    response = await (0, import_undici20.fetch)(url4.toString(), {
      headers: { "User-Agent": "wrangler" }
    });
  } catch (e10) {
    logger.debug(
      `Failed to reach update service: ${e10 instanceof Error ? e10.message : String(e10)}`
    );
    return null;
  }
  if (!response.ok) {
    logger.debug(
      `Update service returned ${response.status} for ${goOS}/${goArch}`
    );
    return null;
  }
  let data;
  try {
    data = await response.json();
  } catch (e10) {
    logger.debug(
      `Update service returned non-JSON response: ${e10 instanceof Error ? e10.message : String(e10)}`
    );
    return null;
  }
  if (data.error || !data.url || !data.version) {
    return data.version ? data : null;
  }
  return data;
}
async function getLatestVersionInfo() {
  const goOS = getGoOS();
  const goArch = getGoArch();
  const primary = await queryUpdateService(goOS, goArch);
  if (primary && primary.url && primary.version) {
    return primary;
  }
  logger.debug(
    `Update worker had no result for ${goOS}/${goArch}, falling back to GitHub release URL`
  );
  const fallback = await queryUpdateService("linux", "amd64");
  if (!fallback?.version) {
    throw new UserError(
      `[cloudflared] Failed to determine the latest cloudflared version.

The update service did not return results for ${goOS}/${goArch},
and the fallback query also failed.

You can manually install cloudflared from:
https://developers.cloudflare.com/cloudflare-one/networks/connectors/cloudflare-tunnel/downloads/`
    );
  }
  const version5 = fallback.version;
  const filename = getAssetFilename(goOS, goArch);
  const url4 = `${GITHUB_RELEASE_BASE}/${version5}/${filename}`;
  const compressed = filename.endsWith(".tgz");
  return {
    url: url4,
    version: version5,
    checksum: "",
    // no checksum available for fallback URLs
    compressed,
    shouldUpdate: true,
    userMessage: "",
    error: ""
  };
}
function getCacheDir(version5) {
  return path3.join(getGlobalWranglerConfigPath(), "cloudflared", version5);
}
function getCloudflaredBinPath(version5) {
  const binName = process.platform === "win32" ? "cloudflared.exe" : "cloudflared";
  return path3.join(getCacheDir(version5), binName);
}
function isBinaryExecutable(binPath) {
  try {
    fs29.accessSync(binPath, fs29.constants.X_OK);
    return true;
  } catch {
    return false;
  }
}
function validateBinary(binPath) {
  try {
    const output = childProcess.execFileSync(binPath, ["--version"], {
      stdio: ["pipe", "pipe", "pipe"],
      timeout: 1e4,
      encoding: "utf8"
    }).trim();
    logger.debug(`cloudflared version: ${output}`);
  } catch {
    let errorMessage = `[cloudflared] Failed to validate cloudflared binary at ${binPath}

`;
    errorMessage += `This usually means:
`;
    errorMessage += `  - The binary is corrupted or incomplete
`;
    errorMessage += `  - You're missing required system libraries
`;
    if (process.platform === "linux") {
      errorMessage += `
On Linux, make sure you have the required dependencies:
`;
      errorMessage += `  - glibc (GNU C Library)
`;
      errorMessage += `  - For Debian/Ubuntu: sudo apt-get install libc6
`;
    }
    const cacheDir = path3.join(getGlobalWranglerConfigPath(), "cloudflared");
    errorMessage += `
You can try:
`;
    errorMessage += `  1. Deleting the cache directory: rm -rf ${cacheDir}
`;
    errorMessage += `  2. Running the command again to re-download
`;
    errorMessage += `  3. Manually installing cloudflared: https://developers.cloudflare.com/cloudflare-one/networks/connectors/cloudflare-tunnel/downloads/
`;
    errorMessage += `  4. Setting CLOUDFLARED_PATH to point to your cloudflared binary`;
    throw new UserError(errorMessage);
  }
}
function redactCloudflaredArgsForLogging(args) {
  const redacted = [...args];
  for (let i7 = 0; i7 < redacted.length; i7++) {
    const arg = redacted[i7];
    if (arg === "--token" && i7 + 1 < redacted.length) {
      redacted[i7 + 1] = "[REDACTED]";
    }
    if (arg.startsWith("--token=")) {
      redacted[i7] = "--token=[REDACTED]";
    }
  }
  return redacted;
}
function tryGetCloudflaredFromPath() {
  if (!(0, import_command_exists2.sync)("cloudflared")) {
    return null;
  }
  try {
    validateBinary("cloudflared");
    return "cloudflared";
  } catch (e10) {
    logger.debug("cloudflared found in PATH but failed validation", e10);
    return null;
  }
}
function getInstalledVersion(binPath) {
  try {
    const output = childProcess.execFileSync(binPath, ["--version"], {
      stdio: ["pipe", "pipe", "pipe"],
      timeout: 1e4,
      encoding: "utf8"
    });
    const match3 = output.match(/(\d+\.\d+\.\d+)/);
    return match3 ? match3[1] : null;
  } catch {
    return null;
  }
}
function isVersionOutdated(installed, latest) {
  const parse17 = /* @__PURE__ */ __name((v8) => v8.split(".").map(Number), "parse");
  const [iYear, iMonth, iPatch] = parse17(installed);
  const [lYear, lMonth, lPatch] = parse17(latest);
  if (iYear !== lYear) {
    return iYear < lYear;
  }
  if (iMonth !== lMonth) {
    return iMonth < lMonth;
  }
  return iPatch < lPatch;
}
async function warnIfOutdated(binPath) {
  try {
    const installed = getInstalledVersion(binPath);
    if (!installed) {
      return;
    }
    const latest = await queryUpdateService(getGoOS(), getGoArch()) ?? await queryUpdateService("linux", "amd64");
    const latestVersion = latest?.version;
    if (!latestVersion) {
      return;
    }
    if (isVersionOutdated(installed, latestVersion)) {
      logger.warn(
        `Your cloudflared (${installed}) is outdated. Latest version is ${latestVersion}.
Update: https://developers.cloudflare.com/cloudflare-one/networks/connectors/cloudflare-tunnel/downloads/`
      );
    }
  } catch (e10) {
    logger.debug("Failed to check cloudflared version", e10);
  }
}
function writeFileAtomic(filePath, contents) {
  const dir2 = path3.dirname(filePath);
  const tmpPath = path3.join(
    dir2,
    `.tmp-${process.pid}-${Date.now()}-${Math.random().toString(16).slice(2)}`
  );
  try {
    fs29.writeFileSync(tmpPath, contents);
    fs29.renameSync(tmpPath, filePath);
  } finally {
    try {
      if (fs29.existsSync(tmpPath)) {
        fs29.unlinkSync(tmpPath);
      }
    } catch {
    }
  }
}
async function downloadCloudflared(versionInfo, binPath) {
  const { url: url4, version: version5, checksum, compressed } = versionInfo;
  logger.log(`Downloading cloudflared ${version5}...`);
  logger.debug(`Download URL: ${url4}`);
  const cacheDir = path3.dirname(binPath);
  fs29.mkdirSync(cacheDir, { recursive: true });
  let response;
  try {
    response = await (0, import_undici20.fetch)(url4, {
      headers: { "User-Agent": "wrangler" }
    });
  } catch (e10) {
    throw new UserError(
      `[cloudflared] Failed to download cloudflared from ${url4}

Network error: ${e10 instanceof Error ? e10.message : String(e10)}

Please check your internet connection and try again.
If you're behind a proxy, make sure it's configured correctly.`
    );
  }
  if (!response.ok) {
    throw new UserError(
      `[cloudflared] Failed to download cloudflared from ${url4}

HTTP ${response.status}: ${response.statusText}

You can manually download cloudflared from:
https://developers.cloudflare.com/cloudflare-one/networks/connectors/cloudflare-tunnel/downloads/`
    );
  }
  try {
    if (compressed) {
      await downloadAndExtractTarball(response, checksum, binPath, cacheDir);
    } else {
      await downloadBinary(response, checksum, binPath);
    }
  } catch (e10) {
    try {
      if (fs29.existsSync(binPath)) {
        fs29.unlinkSync(binPath);
      }
    } catch {
    }
    if (e10 instanceof UserError) {
      throw e10;
    }
    throw new UserError(
      `[cloudflared] Failed to save cloudflared binary

Error: ${e10 instanceof Error ? e10.message : String(e10)}

Please ensure you have write permissions to: ${cacheDir}`
    );
  }
  if (process.platform !== "win32") {
    fs29.chmodSync(binPath, 493);
  }
  logger.log(`cloudflared ${version5} installed`);
  logger.debug(`Binary location: ${binPath}`);
}
async function downloadAndExtractTarball(response, expectedChecksum, binPath, cacheDir) {
  const tempTarPath = path3.join(cacheDir, "cloudflared.tgz");
  const buffer = Buffer.from(await response.arrayBuffer());
  if (expectedChecksum) {
    const actualSha256 = sha256Hex(buffer);
    if (actualSha256 !== expectedChecksum) {
      throw new UserError(
        `[cloudflared] SHA256 mismatch for downloaded cloudflared tarball.

Expected: ${expectedChecksum}
Actual:   ${actualSha256}`
      );
    }
  }
  fs29.writeFileSync(tempTarPath, buffer);
  try {
    childProcess.execFileSync("tar", ["-xzf", tempTarPath, "-C", cacheDir], {
      stdio: "ignore"
    });
    const extractedPath = path3.join(cacheDir, "cloudflared");
    if (extractedPath !== binPath && fs29.existsSync(extractedPath)) {
      fs29.renameSync(extractedPath, binPath);
    }
  } finally {
    try {
      if (fs29.existsSync(tempTarPath)) {
        fs29.unlinkSync(tempTarPath);
      }
    } catch {
    }
  }
}
async function downloadBinary(response, expectedChecksum, binPath) {
  const buffer = Buffer.from(await response.arrayBuffer());
  if (expectedChecksum) {
    const actualSha256 = sha256Hex(buffer);
    if (actualSha256 !== expectedChecksum) {
      throw new UserError(
        `[cloudflared] SHA256 mismatch for downloaded cloudflared binary.

Expected: ${expectedChecksum}
Actual:   ${actualSha256}`
      );
    }
  }
  writeFileAtomic(binPath, buffer);
}
async function getCloudflaredPath() {
  const envPath = getCloudflaredPathFromEnv();
  if (envPath) {
    if (!fs29.existsSync(envPath)) {
      throw new UserError(
        `CLOUDFLARED_PATH is set to "${envPath}" but the file does not exist.

Please ensure the path points to a valid cloudflared binary.`
      );
    }
    logger.debug(`Using cloudflared from CLOUDFLARED_PATH: ${envPath}`);
    return envPath;
  }
  const pathBin = tryGetCloudflaredFromPath();
  if (pathBin) {
    logger.debug("Using cloudflared from PATH");
    await warnIfOutdated(pathBin);
    return pathBin;
  }
  const versionInfo = await getLatestVersionInfo();
  const binPath = getCloudflaredBinPath(versionInfo.version);
  let needsDownload = !isBinaryExecutable(binPath);
  if (!needsDownload) {
    try {
      validateBinary(binPath);
      logger.debug(
        `Using cached cloudflared ${versionInfo.version}: ${binPath}`
      );
      return binPath;
    } catch (e10) {
      logger.debug("Cached cloudflared failed validation; re-downloading", e10);
      needsDownload = true;
    }
  }
  const shouldDownload = await confirm(
    `cloudflared (${versionInfo.version}) is needed but not installed. Download to ${binPath}?`,
    { defaultValue: true, fallbackValue: true }
  );
  if (!shouldDownload) {
    throw new UserError(
      `cloudflared is required to run this command.

You can install it manually from:
https://developers.cloudflare.com/cloudflare-one/networks/connectors/cloudflare-tunnel/downloads/

Then either add it to your PATH or set CLOUDFLARED_PATH.`
    );
  }
  if (fs29.existsSync(binPath)) {
    removeCloudflaredCache(versionInfo.version);
  }
  await downloadCloudflared(versionInfo, binPath);
  validateBinary(binPath);
  return binPath;
}
async function spawnCloudflared(args, options) {
  const binPath = await getCloudflaredPath();
  logger.debug(
    `Spawning cloudflared: ${binPath} ${redactCloudflaredArgsForLogging(args).join(" ")}`
  );
  const cloudflared = childProcess.spawn(binPath, args, {
    stdio: options?.stdio ?? "inherit",
    env: options?.env ? { ...process.env, ...options.env } : void 0
  });
  return cloudflared;
}
function removeCloudflaredCache(version5) {
  const cacheDir = version5 ? getCacheDir(version5) : path3.join(getGlobalWranglerConfigPath(), "cloudflared");
  if (fs29.existsSync(cacheDir)) {
    removeDirSync(cacheDir);
    logger.log(`Removed cloudflared cache: ${cacheDir}`);
  }
}
var import_command_exists2, import_undici20, UPDATE_SERVICE_URL, GITHUB_RELEASE_BASE;
var init_cloudflared2 = __esm({
  "src/tunnel/cloudflared.ts"() {
    init_import_meta_url();
    init_dist();
    import_command_exists2 = __toESM(require_command_exists2());
    import_undici20 = __toESM(require_undici());
    init_dialogs();
    init_logger();
    UPDATE_SERVICE_URL = "https://update.argotunnel.com";
    __name(sha256Hex, "sha256Hex");
    __name(getGoArch, "getGoArch");
    __name(getGoOS, "getGoOS");
    GITHUB_RELEASE_BASE = "https://github.com/cloudflare/cloudflared/releases/download";
    __name(getAssetFilename, "getAssetFilename");
    __name(queryUpdateService, "queryUpdateService");
    __name(getLatestVersionInfo, "getLatestVersionInfo");
    __name(getCacheDir, "getCacheDir");
    __name(getCloudflaredBinPath, "getCloudflaredBinPath");
    __name(isBinaryExecutable, "isBinaryExecutable");
    __name(validateBinary, "validateBinary");
    __name(redactCloudflaredArgsForLogging, "redactCloudflaredArgsForLogging");
    __name(tryGetCloudflaredFromPath, "tryGetCloudflaredFromPath");
    __name(getInstalledVersion, "getInstalledVersion");
    __name(isVersionOutdated, "isVersionOutdated");
    __name(warnIfOutdated, "warnIfOutdated");
    __name(writeFileAtomic, "writeFileAtomic");
    __name(downloadCloudflared, "downloadCloudflared");
    __name(downloadAndExtractTarball, "downloadAndExtractTarball");
    __name(downloadBinary, "downloadBinary");
    __name(getCloudflaredPath, "getCloudflaredPath");
    __name(spawnCloudflared, "spawnCloudflared");
    __name(removeCloudflaredCache, "removeCloudflaredCache");
  }
});
var tunnelQuickStartCommand;
var init_quick_start = __esm({
  "src/tunnel/quick-start.ts"() {
    init_import_meta_url();
    init_dist();
    init_create_command();
    init_cloudflared2();
    tunnelQuickStartCommand = createCommand({
      metadata: {
        description: "Start a free, temporary tunnel without an account (https://try.cloudflare.com)",
        status: "experimental",
        owner: "Product: Tunnels"
      },
      args: {
        url: {
          type: "string",
          demandOption: true,
          description: "The local URL to expose (e.g., http://localhost:3000)"
        },
        "log-level": {
          type: "string",
          default: "info",
          choices: ["debug", "info", "warn", "error", "fatal"],
          description: "Log level for cloudflared (does not affect Wrangler logs, which are controlled by WRANGLER_LOG)"
        }
      },
      positionalArgs: ["url"],
      async handler(args, { logger: logger4 }) {
        logger4.log(`Starting Quick Tunnel (https://try.cloudflare.com)`);
        logger4.log(`Local URL: ${args.url}`);
        const cloudflaredArgs = [
          "tunnel",
          "--no-autoupdate",
          "--url",
          args.url,
          "--loglevel",
          args.logLevel || "info"
        ];
        logger4.log(`
Starting cloudflared...`);
        logger4.log(`   No account required - this is a free, temporary tunnel.`);
        logger4.log(`   You'll get a random *.trycloudflare.com URL to share.`);
        logger4.log(`   The tunnel will stop when you press Ctrl+C.
`);
        const cloudflared = await spawnCloudflared(cloudflaredArgs);
        let isShuttingDown = false;
        const shutdownHandler = /* @__PURE__ */ __name(() => {
          if (isShuttingDown) {
            return;
          }
          isShuttingDown = true;
          logger4.log("\n\nShutting down tunnel...");
          cloudflared.kill("SIGTERM");
          const forceKillTimer = setTimeout(() => {
            if (!cloudflared.killed) {
              logger4.debug("Force killing cloudflared...");
              cloudflared.kill("SIGKILL");
            }
          }, 5e3);
          forceKillTimer.unref();
        }, "shutdownHandler");
        process.on("SIGINT", shutdownHandler);
        process.on("SIGTERM", shutdownHandler);
        const cleanup = /* @__PURE__ */ __name(() => {
          process.removeListener("SIGINT", shutdownHandler);
          process.removeListener("SIGTERM", shutdownHandler);
        }, "cleanup");
        if (cloudflared.stderr) {
          cloudflared.stderr.on("data", (data) => {
            process.stderr.write(data.toString());
          });
        }
        return new Promise((resolve32, reject) => {
          cloudflared.on("error", (error2) => {
            cleanup();
            if (isShuttingDown) {
              resolve32();
              return;
            }
            let message = `Failed to run cloudflared: ${error2.message}`;
            if (error2.message.includes("ENOENT")) {
              message += `

The cloudflared binary could not be executed.
This might be a permissions issue or the binary is corrupted.

Try removing the cache and running again:
  rm -rf ${path3.join(getGlobalWranglerConfigPath(), "cloudflared")}
  wrangler tunnel quick-start ${args.url}`;
            }
            reject(new UserError(message));
          });
          cloudflared.on("exit", (code, signal) => {
            cleanup();
            if (isShuttingDown) {
              logger4.log("Tunnel stopped.");
              resolve32();
              return;
            }
            if (signal) {
              logger4.log(`
cloudflared terminated by signal: ${signal}`);
              resolve32();
              return;
            }
            if (code !== 0 && code !== null) {
              let message = `cloudflared exited with code ${code}`;
              if (code === 1) {
                message += `

This might indicate:
  - The local URL "${args.url}" is not reachable
  - Network connectivity issues
  - Port already in use

Make sure your local service is running at ${args.url}
Try running with --log-level debug for more information.`;
              }
              reject(new UserError(message));
              return;
            }
            resolve32();
          });
        });
      }
    });
  }
});
var tunnelRunCommand;
var init_run2 = __esm({
  "src/tunnel/run.ts"() {
    init_import_meta_url();
    init_dist();
    init_create_command();
    init_user3();
    init_client12();
    init_cloudflared2();
    tunnelRunCommand = createCommand({
      metadata: {
        description: "Run a Cloudflare Tunnel using cloudflared",
        status: "experimental",
        owner: "Product: Tunnels"
      },
      args: {
        tunnel: {
          type: "string",
          description: "The name or UUID of the tunnel to run (required unless --token is provided)"
        },
        token: {
          type: "string",
          description: "The tunnel token to use (skips API auth, useful for running on remote machines)"
        },
        "log-level": {
          type: "string",
          default: "info",
          choices: ["debug", "info", "warn", "error", "fatal"],
          description: "Log level for cloudflared (does not affect Wrangler logs, which are controlled by WRANGLER_LOG)"
        }
      },
      positionalArgs: ["tunnel"],
      async handler(args, { config, logger: logger4, sdk }) {
        let tokenStr = args.token;
        let tunnelId;
        if (!tokenStr) {
          if (!args.tunnel) {
            throw new UserError(
              `Either a tunnel name/UUID or --token must be provided.

Usage:
  wrangler tunnel run <tunnel>            # Fetch token via API
  wrangler tunnel run --token <token>     # Use provided token`
            );
          }
          const accountId = await requireAuth(config);
          tunnelId = await resolveTunnelId(sdk, accountId, args.tunnel);
          logger4.log(`Running tunnel "${args.tunnel}"`);
          logger4.log(`Fetching tunnel credentials...`);
          try {
            tokenStr = await getTunnelToken(sdk, accountId, tunnelId);
          } catch (e10) {
            if (e10 instanceof UserError) {
              throw e10;
            }
            throw new UserError(
              `Failed to get tunnel token for "${args.tunnel}".

This could mean:
  - The tunnel doesn't exist
  - You don't have permission to access this tunnel
  - The tunnel has been deleted

Use "wrangler tunnel list" to see available tunnels.

Original error: ${e10 instanceof Error ? e10.message : String(e10)}`
            );
          }
          if (!tokenStr) {
            throw new UserError(
              `Failed to get tunnel token for "${args.tunnel}".

The API returned an empty token. Please ensure the tunnel exists and is properly configured.`
            );
          }
        } else {
          logger4.log(`Running tunnel with provided token`);
        }
        const cloudflaredArgs = [
          "tunnel",
          "--no-autoupdate",
          "--loglevel",
          args.logLevel || "info",
          "run"
        ];
        logger4.log(`
Starting cloudflared...`);
        if (tunnelId) {
          logger4.log(`   Tunnel ID: ${tunnelId}`);
        }
        logger4.log(`
Press Ctrl+C to stop the tunnel.
`);
        const cloudflared = await spawnCloudflared(cloudflaredArgs, {
          env: { TUNNEL_TOKEN: tokenStr }
        });
        let isShuttingDown = false;
        const shutdownHandler = /* @__PURE__ */ __name(() => {
          if (isShuttingDown) {
            return;
          }
          isShuttingDown = true;
          logger4.log("\n\nShutting down tunnel...");
          cloudflared.kill("SIGTERM");
          const forceKillTimer = setTimeout(() => {
            if (!cloudflared.killed) {
              logger4.debug("Force killing cloudflared...");
              cloudflared.kill("SIGKILL");
            }
          }, 5e3);
          forceKillTimer.unref();
        }, "shutdownHandler");
        process.on("SIGINT", shutdownHandler);
        process.on("SIGTERM", shutdownHandler);
        const cleanup = /* @__PURE__ */ __name(() => {
          process.removeListener("SIGINT", shutdownHandler);
          process.removeListener("SIGTERM", shutdownHandler);
        }, "cleanup");
        if (cloudflared.stderr) {
          cloudflared.stderr.on("data", (data) => {
            process.stderr.write(data.toString());
          });
        }
        return new Promise((resolve32, reject) => {
          cloudflared.on("error", (error2) => {
            cleanup();
            if (isShuttingDown) {
              resolve32();
              return;
            }
            let message = `Failed to run cloudflared: ${error2.message}`;
            if (error2.message.includes("ENOENT")) {
              message += `

The cloudflared binary could not be executed.
This might be a permissions issue or the binary is corrupted.

Try removing the cache and running again:
  rm -rf ${path3.join(getGlobalWranglerConfigPath(), "cloudflared")}
  wrangler tunnel run ${tunnelId || "--token <token>"}`;
            }
            reject(new UserError(message));
          });
          cloudflared.on("exit", (code, signal) => {
            cleanup();
            if (isShuttingDown) {
              logger4.log("Tunnel stopped.");
              resolve32();
              return;
            }
            if (signal) {
              logger4.log(`
cloudflared terminated by signal: ${signal}`);
              resolve32();
              return;
            }
            if (code !== 0 && code !== null) {
              let message = `cloudflared exited with code ${code}`;
              if (code === 1) {
                message += `

This might indicate:
  - Invalid tunnel configuration
  - Network connectivity issues
  - Authentication problems

Try running with --log-level debug for more information.`;
              }
              reject(new UserError(message));
              return;
            }
            resolve32();
          });
        });
      }
    });
  }
});
function getVarsForDev(configPath, envFiles, vars, env6, silent = false, secrets) {
  const result = {};
  for (const [key, value] of Object.entries(vars)) {
    result[key] = toVarBinding(value);
  }
  const configDir = path3__namespace.resolve(configPath ? path3__namespace.dirname(configPath) : ".");
  let loadedSecrets;
  if (!envFiles?.length) {
    const devVarsPath = path3__namespace.resolve(configDir, ".dev.vars");
    const loaded = loadDotDevDotVars(devVarsPath, env6);
    if (loaded !== void 0) {
      const devVarsRelativePath = path3__namespace.relative(process.cwd(), loaded.path);
      if (!silent) {
        logger.log(`Using secrets defined in ${devVarsRelativePath}`);
      }
      loadedSecrets = loaded.parsed;
    }
  }
  if (loadedSecrets === void 0 && getCloudflareLoadDevVarsFromDotEnv()) {
    const resolvedEnvFilePaths = (envFiles ?? getDefaultEnvFiles(env6)).map(
      (p7) => path3__namespace.resolve(configDir, p7)
    );
    loadedSecrets = loadDotEnv(resolvedEnvFilePaths, {
      // When secrets is defined, always include `process.env`.
      // Otherwise, respect the CLOUDFLARE_INCLUDE_PROCESS_ENV env var.
      includeProcessEnv: !!secrets || getCloudflareIncludeProcessEnvFromEnv(),
      silent
    });
  }
  if (secrets) {
    const requiredSecrets = secrets.required ?? [];
    for (const key of requiredSecrets) {
      if (loadedSecrets !== void 0 && key in loadedSecrets) {
        result[key] = { type: "secret_text", value: loadedSecrets[key] };
      }
    }
    if (!silent) {
      const missing = requiredSecrets.filter(
        (key) => loadedSecrets === void 0 || !(key in loadedSecrets)
      );
      if (missing.length > 0) {
        logger.warn(
          `Missing required secrets: ${missing.join(", ")}. Add them to .dev.vars, .env, or set as environment variables.`
        );
      }
    }
  } else if (loadedSecrets !== void 0) {
    for (const [key, value] of Object.entries(loadedSecrets)) {
      result[key] = { type: "secret_text", value };
    }
  }
  return result;
}
function toVarBinding(value) {
  if (typeof value === "string") {
    return { type: "plain_text", value };
  }
  return { type: "json", value };
}
function tryLoadDotDevDotVars(basePath) {
  try {
    const contents = maybeGetFile(basePath);
    if (contents === void 0) {
      logger.debug(
        `local dev variables file not found at "${path3__namespace.relative(".", basePath)}". Continuing... For more details, refer to https://developers.cloudflare.com/workers/wrangler/system-environment-variables/`
      );
      return;
    }
    const parsed = import_dotenv3.default.parse(contents);
    return { path: basePath, parsed };
  } catch (e10) {
    throw new Error(
      `Failed to load local dev variables file "${path3__namespace.relative(".", basePath)}":`,
      { cause: e10 }
    );
  }
}
function loadDotDevDotVars(envPath, env6) {
  return env6 !== void 0 && tryLoadDotDevDotVars(`${envPath}.${env6}`) || tryLoadDotDevDotVars(envPath);
}
var import_dotenv3;
var init_dev_vars = __esm({
  "src/dev/dev-vars.ts"() {
    init_import_meta_url();
    init_workers_shared();
    init_dist();
    import_dotenv3 = __toESM(require_main());
    init_dot_env();
    init_logger();
    __name(getVarsForDev, "getVarsForDev");
    __name(toVarBinding, "toVarBinding");
    __name(tryLoadDotDevDotVars, "tryLoadDotDevDotVars");
    __name(loadDotDevDotVars, "loadDotDevDotVars");
  }
});

// src/process-env.ts
function isProcessEnvPopulated(compatibility_date, compatibility_flags = []) {
  if (compatibility_flags.includes("nodejs_compat_populate_process_env") && compatibility_flags.includes("nodejs_compat_do_not_populate_process_env")) {
    throw new UserError("Can't both enable and disable a flag");
  }
  if (compatibility_flags.includes("nodejs_compat_populate_process_env") && compatibility_flags.includes("nodejs_compat")) {
    return true;
  }
  if (compatibility_flags.includes("nodejs_compat_do_not_populate_process_env")) {
    return false;
  }
  return compatibility_flags.includes("nodejs_compat") && !!compatibility_date && compatibility_date >= "2025-04-01";
}
var init_process_env = __esm({
  "src/process-env.ts"() {
    init_import_meta_url();
    init_dist();
    __name(isProcessEnvPopulated, "isProcessEnvPopulated");
  }
});
async function generateRuntimeTypes({
  config: { compatibility_date, compatibility_flags = [] },
  outFile = DEFAULT_OUTFILE_RELATIVE_PATH
}) {
  if (!compatibility_date) {
    throw new Error("Config must have a compatibility date.");
  }
  const header = getRuntimeHeader(
    workerd.version,
    compatibility_date,
    compatibility_flags
  );
  try {
    const lines = (await fs9.readFile(outFile, "utf8")).split("\n");
    const existingHeader = lines.find(
      (line) => line.startsWith(RUNTIME_HEADER_COMMENT_PREFIX)
    );
    const existingTypesStart = lines.findIndex(
      (line) => line === "// Begin runtime types"
    );
    if (existingHeader === header && existingTypesStart !== -1) {
      logger.debug("Using cached runtime types: ", header);
      return {
        runtimeHeader: header,
        runtimeTypes: lines.slice(existingTypesStart + 1).join("\n")
      };
    }
  } catch (e10) {
    if (e10.code !== "ENOENT") {
      throw e10;
    }
  }
  const types13 = await generate({
    compatibilityDate: compatibility_date,
    // Ignore nodejs compat flags as there is currently no mechanism to generate these dynamically.
    compatibilityFlags: compatibility_flags.filter(
      (flag) => !flag.includes("nodejs_compat")
    )
  });
  return { runtimeHeader: header, runtimeTypes: types13 };
}
async function generate({
  compatibilityDate,
  compatibilityFlags = []
}) {
  const worker = fs29.readFileSync(__require.resolve("workerd/worker.mjs")).toString();
  const mf = new miniflare.Miniflare({
    compatibilityDate: "2024-01-01",
    compatibilityFlags: ["nodejs_compat", "rtti_api"],
    modules: true,
    script: worker
  });
  const flagsString = compatibilityFlags.length ? `+${compatibilityFlags.join("+")}` : "";
  const path84 = `http://dummy.com/${compatibilityDate}${flagsString}`;
  try {
    const res = await mf.dispatchFetch(path84);
    const text = await res.text();
    if (!res.ok) {
      throw new Error(text);
    }
    return text;
  } finally {
    await mf.dispose();
  }
}
var DEFAULT_OUTFILE_RELATIVE_PATH;
var init_runtime3 = __esm({
  "src/type-generation/runtime/index.ts"() {
    init_import_meta_url();
    init_logger();
    init_helpers7();
    DEFAULT_OUTFILE_RELATIVE_PATH = "worker-configuration.d.ts";
    __name(generateRuntimeTypes, "generateRuntimeTypes");
    __name(generate, "generate");
  }
});
var DEFAULT_WORKERS_TYPES_FILE_NAME, DEFAULT_WORKERS_TYPES_FILE_PATH, ENV_HEADER_COMMENT_PREFIX, RUNTIME_HEADER_COMMENT_PREFIX, TOP_LEVEL_ENV_NAME, throwMissingBindingError, getEnvHeader, getRuntimeHeader, unsafeParseBooleanString, checkTypesUpToDate, checkTypesDiff, toPascalCase, toEnvInterfaceName, RESERVED_INTERFACE_NAMES, validateEnvInterfaceNames;
var init_helpers7 = __esm({
  "src/type-generation/helpers.ts"() {
    init_import_meta_url();
    init_dist();
    init_yargs();
    init_entry();
    init_logger();
    init_runtime3();
    init_type_generation();
    DEFAULT_WORKERS_TYPES_FILE_NAME = "worker-configuration.d.ts";
    DEFAULT_WORKERS_TYPES_FILE_PATH = `./${DEFAULT_WORKERS_TYPES_FILE_NAME}`;
    ENV_HEADER_COMMENT_PREFIX = "// Generated by Wrangler by running";
    RUNTIME_HEADER_COMMENT_PREFIX = "// Runtime types generated with workerd@";
    TOP_LEVEL_ENV_NAME = "$top-level";
    throwMissingBindingError = /* @__PURE__ */ __name(({
      binding,
      bindingType,
      configPath,
      envName,
      fieldName,
      index
    }) => {
      const isArrayBinding = index !== void 0;
      const bindingPath = isArrayBinding ? `${bindingType}[${index}]` : bindingType;
      const isTopLevel = envName === TOP_LEVEL_ENV_NAME;
      const field = isTopLevel ? bindingPath : `env.${envName}.${bindingPath}`;
      const bindingError = `"${field}" bindings should have a string "${fieldName}" field but got ${JSON.stringify(binding)}.`;
      const configFile = configFileName(configPath);
      if (isTopLevel) {
        throw new UserError(
          `Processing ${configFile} configuration:
  - ${bindingError}`
        );
      }
      throw new UserError(
        `Processing ${configFile} configuration:
  - "env.${envName}" environment configuration
    - ${bindingError}`
      );
    }, "throwMissingBindingError");
    getEnvHeader = /* @__PURE__ */ __name((hash, command2) => {
      const wranglerCommand = command2 ?? ["wrangler", ...process.argv.slice(2)].join(" ");
      return `${ENV_HEADER_COMMENT_PREFIX} \`${wranglerCommand}\` (hash: ${hash})`;
    }, "getEnvHeader");
    getRuntimeHeader = /* @__PURE__ */ __name((workerdVersion, compatibilityDate, compatibilityFlags = []) => {
      return `${RUNTIME_HEADER_COMMENT_PREFIX}${workerdVersion} ${compatibilityDate} ${compatibilityFlags.sort().join(",")}`;
    }, "getRuntimeHeader");
    unsafeParseBooleanString = /* @__PURE__ */ __name((value) => {
      if (typeof value !== "string") {
        throw new ParseError({
          text: `Invalid value: ${value}`,
          kind: "error"
        });
      }
      if (value.toLowerCase() === "true") {
        return true;
      }
      if (value.toLowerCase() === "false") {
        return false;
      }
      throw new ParseError({
        text: `Invalid value: ${value}`,
        kind: "error"
      });
    }, "unsafeParseBooleanString");
    checkTypesUpToDate = /* @__PURE__ */ __name(async (primaryConfig, typesPath = DEFAULT_WORKERS_TYPES_FILE_PATH) => {
      let typesFileLines = new Array();
      try {
        typesFileLines = fs29.readFileSync(typesPath, "utf-8").split("\n");
      } catch (e10) {
        if (e10.code === "ENOENT") {
          throw new UserError(`Types file not found at ${typesPath}.`);
        }
        throw e10;
      }
      const existingEnvHeader = typesFileLines.find(
        (line) => line.startsWith(ENV_HEADER_COMMENT_PREFIX)
      );
      const existingRuntimeHeader = typesFileLines.find(
        (line) => line.startsWith(RUNTIME_HEADER_COMMENT_PREFIX)
      );
      if (!existingEnvHeader && !existingRuntimeHeader) {
        throw new UserError(`No generated types found in ${typesPath}.`);
      }
      const { command: wranglerCommand = "", hash: maybeExistingHash } = existingEnvHeader?.match(
        /\/\/ Generated by Wrangler by running `(?<command>.*)` \(hash: (?<hash>[a-zA-Z0-9]+)\)/
      )?.groups ?? {};
      const rawArgs = yargs_default(wranglerCommand).parseSync();
      const args = {
        includeEnv: existingEnvHeader ? unsafeParseBooleanString(rawArgs.includeEnv ?? "true") : false,
        includeRuntime: existingRuntimeHeader ? unsafeParseBooleanString(rawArgs.includeRuntime ?? "true") : false,
        envInterface: rawArgs.envInterface ?? "Env",
        strictVars: unsafeParseBooleanString(rawArgs.strictVars ?? "true")
      };
      const configContainsEntrypoint = primaryConfig.main !== void 0 || !!primaryConfig.site?.["entry-point"];
      const entrypoint = configContainsEntrypoint ? await getEntry({}, primaryConfig, "types").catch(() => void 0) : void 0;
      let envOutOfDate = false;
      let runtimeOutOfDate = false;
      if (args.includeEnv) {
        try {
          const { envHeader } = await generateEnvTypes(
            primaryConfig,
            { strictVars: args.strictVars },
            args.envInterface,
            typesPath,
            entrypoint,
            /* @__PURE__ */ new Map(),
            false
            // don't log anything
          );
          const newHash = envHeader?.match(/hash: (?<hash>.*)\)/)?.groups?.hash;
          envOutOfDate = maybeExistingHash !== newHash;
        } catch {
          envOutOfDate = true;
        }
      }
      if (args.includeRuntime) {
        if (!primaryConfig.compatibility_date) {
          runtimeOutOfDate = true;
        } else {
          const newRuntimeHeader = getRuntimeHeader(
            workerd.version,
            primaryConfig.compatibility_date,
            primaryConfig.compatibility_flags
          );
          runtimeOutOfDate = existingRuntimeHeader !== newRuntimeHeader;
        }
      }
      return envOutOfDate || runtimeOutOfDate;
    }, "checkTypesUpToDate");
    checkTypesDiff = /* @__PURE__ */ __name(async (config, entry) => {
      if (!entry.file.endsWith(".ts")) {
        return;
      }
      let maybeExistingTypesFileLines;
      try {
        maybeExistingTypesFileLines = fs29.readFileSync(
          DEFAULT_WORKERS_TYPES_FILE_PATH,
          "utf-8"
        ).split("\n");
      } catch {
        return;
      }
      const existingEnvHeader = maybeExistingTypesFileLines.find(
        (line) => line.startsWith(ENV_HEADER_COMMENT_PREFIX)
      );
      const maybeExistingHash = existingEnvHeader?.match(/hash: (?<hash>.*)\)/)?.groups?.hash;
      const previousStrictVars = existingEnvHeader?.match(
        /--strict-vars(=|\s)(?<result>true|false)/
      )?.groups?.result;
      const previousEnvInterface = existingEnvHeader?.match(
        /--env-interface(=|\s)(?<result>[a-zA-Z][a-zA-Z0-9_]*)/
      )?.groups?.result;
      let newEnvHeader;
      let newEnvTypes;
      try {
        const { envHeader, envTypes } = await generateEnvTypes(
          config,
          { strictVars: previousStrictVars === "false" ? false : true },
          previousEnvInterface ?? "Env",
          DEFAULT_WORKERS_TYPES_FILE_NAME,
          entry,
          /* @__PURE__ */ new Map(),
          // don't log anything
          false
        );
        newEnvHeader = envHeader;
        newEnvTypes = envTypes;
      } catch (e10) {
        logger.error(e10);
      }
      const newHash = newEnvHeader?.match(/hash: (?<hash>.*)\)/)?.groups?.hash;
      const existingRuntimeHeader = maybeExistingTypesFileLines.find(
        (line) => line.startsWith("// Runtime types generated with")
      );
      const newRuntimeHeader = getRuntimeHeader(
        workerd.version,
        config.compatibility_date ?? "",
        config.compatibility_flags ?? []
      );
      const envOutOfDate = existingEnvHeader && maybeExistingHash !== newHash;
      const runtimeOutOfDate = existingRuntimeHeader && existingRuntimeHeader !== newRuntimeHeader;
      const changed = envOutOfDate || runtimeOutOfDate;
      if (!changed) {
        return false;
      }
      if (!config.dev.generate_types) {
        logger.log(
          "\u2753 Your types might be out of date. Re-run `wrangler types` to ensure your types are correct."
        );
        return true;
      }
      const { runtimeHeader, runtimeTypes } = await generateRuntimeTypes({
        config,
        outFile: DEFAULT_WORKERS_TYPES_FILE_PATH
      });
      const newTypesFile = [
        newEnvHeader,
        runtimeHeader,
        newEnvTypes,
        runtimeTypes
      ].join("\n");
      try {
        fs29.writeFileSync(DEFAULT_WORKERS_TYPES_FILE_PATH, newTypesFile);
        logger.log(
          `\u2753 Your types looked out of date. We've re-run \`wrangler types\` for you and updated ${DEFAULT_WORKERS_TYPES_FILE_PATH}`
        );
      } catch (e10) {
        logger.error(e10);
      }
      return true;
    }, "checkTypesDiff");
    toPascalCase = /* @__PURE__ */ __name((str) => str.split(/[-_]/).map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join(""), "toPascalCase");
    toEnvInterfaceName = /* @__PURE__ */ __name((envName) => {
      const pascalCase = toPascalCase(envName);
      if (pascalCase.endsWith("Env")) {
        return pascalCase;
      }
      return `${pascalCase}Env`;
    }, "toEnvInterfaceName");
    RESERVED_INTERFACE_NAMES = /* @__PURE__ */ new Set(["Env"]);
    validateEnvInterfaceNames = /* @__PURE__ */ __name((envNames) => {
      const interfaceNames = /* @__PURE__ */ new Map();
      for (const reserved of RESERVED_INTERFACE_NAMES) {
        interfaceNames.set(reserved, `(reserved)`);
      }
      for (const envName of envNames) {
        const interfaceName = toEnvInterfaceName(envName);
        const existingEnv = interfaceNames.get(interfaceName);
        if (existingEnv) {
          if (existingEnv === "(reserved)") {
            throw new UserError(
              `Environment name "${envName}" converts to reserved interface name "${interfaceName}". Please rename this environment to avoid conflicts.`
            );
          }
          throw new UserError(
            `Environment names "${existingEnv}" and "${envName}" both convert to interface name "${interfaceName}". Please rename one of these environments to avoid conflicts.`
          );
        }
        interfaceNames.set(interfaceName, envName);
      }
    }, "validateEnvInterfaceNames");
  }
});

// src/type-generation/pipeline-schema.ts
function schemaFieldTypeToTypeScript(field, depth = 0) {
  if (depth > MAX_NESTING_DEPTH) {
    logger.warn(
      `Schema nesting depth exceeded ${MAX_NESTING_DEPTH} for field '${field.name}', using unknown type`
    );
    return "unknown";
  }
  switch (field.type) {
    case "string":
      return "string";
    case "bool":
      return "boolean";
    case "int32":
    case "int64":
    case "uint32":
    case "uint64":
    case "float32":
    case "float64":
    case "decimal128":
      return "number";
    case "timestamp":
      return "string | number";
    case "json":
      return "Record<string, unknown>";
    case "bytes":
      return "string";
    case "list":
      if (field.items) {
        const itemType = schemaFieldTypeToTypeScript(field.items, depth + 1);
        return `Array<${itemType}>`;
      }
      return "unknown[]";
    case "struct":
      if (field.fields && Array.isArray(field.fields) && field.fields.length > 0) {
        return schemaFieldsToTypeScript(field.fields, depth + 1);
      }
      return "Record<string, unknown>";
    default:
      return "unknown";
  }
}
function schemaFieldsToTypeScript(fields, depth = 0) {
  if (fields.length === 0) {
    return "Record<string, unknown>";
  }
  const properties = fields.map((field) => {
    const optional = field.required ? "" : "?";
    const fieldType = schemaFieldTypeToTypeScript(field, depth);
    const fieldName = isValidIdentifier2(field.name) ? field.name : `"${escapeTypeScriptString(field.name)}"`;
    return `${fieldName}${optional}: ${fieldType}`;
  });
  return `{ ${properties.join("; ")} }`;
}
function streamNameToTypeName(streamName) {
  const pascalCase = toPascalCase(streamName);
  return `${pascalCase}Record`;
}
function generatePipelineTypeFromSchema(schema, streamName) {
  if (!schema || !Array.isArray(schema.fields) || schema.fields.length === 0) {
    return {
      typeReference: GENERIC_PIPELINE_TYPE,
      typeDefinition: null,
      typeName: null
    };
  }
  const recordType4 = schemaFieldsToTypeScript(schema.fields);
  const typeName = streamName ? streamNameToTypeName(streamName) : null;
  if (typeName) {
    return {
      typeReference: `import("cloudflare:pipelines").Pipeline<Cloudflare.${typeName}>`,
      typeDefinition: `type ${typeName} = ${recordType4};`,
      typeName
    };
  }
  return {
    typeReference: `import("cloudflare:pipelines").Pipeline<${recordType4}>`,
    typeDefinition: null,
    typeName: null
  };
}
async function fetchStream(config, streamId) {
  try {
    return await getStream2(config, streamId);
  } catch (error2) {
    const errorMessage = error2 instanceof Error ? error2.message : String(error2);
    logger.debug(
      `Failed to fetch stream '${streamId}': ${errorMessage}. Using generic type.`
    );
    return null;
  }
}
function hasApiToken() {
  return getAPIToken() !== void 0;
}
async function fetchPipelineTypes(config, pipelines) {
  if (pipelines.length === 0) {
    return [];
  }
  if (!hasApiToken()) {
    logger.warn(
      "Not authenticated - using generic types for pipeline bindings. Run `wrangler login` to enable typed pipeline bindings."
    );
    return pipelines.map((p7) => ({
      binding: p7.binding,
      type: GENERIC_PIPELINE_TYPE,
      typeDefinition: null,
      typeName: null
    }));
  }
  const streams = await Promise.all(
    pipelines.map((p7) => fetchStream(config, p7.pipeline))
  );
  const results = pipelines.map((pipeline, i7) => {
    const stream2 = streams[i7];
    if (stream2) {
      const schemaResult = generatePipelineTypeFromSchema(
        stream2.schema,
        stream2.name
      );
      return {
        binding: pipeline.binding,
        type: schemaResult.typeReference,
        typeDefinition: schemaResult.typeDefinition,
        typeName: schemaResult.typeName
      };
    }
    return {
      binding: pipeline.binding,
      type: GENERIC_PIPELINE_TYPE,
      typeDefinition: null,
      typeName: null
    };
  });
  const fetchedCount = streams.filter(Boolean).length;
  if (fetchedCount > 0) {
    logger.debug(`Fetched schemas for ${fetchedCount} pipeline binding(s)`);
  }
  if (fetchedCount < pipelines.length) {
    logger.warn(
      `Could not fetch schemas for ${pipelines.length - fetchedCount} pipeline binding(s) - using generic types`
    );
  }
  return results;
}
var MAX_NESTING_DEPTH, GENERIC_PIPELINE_TYPE;
var init_pipeline_schema = __esm({
  "src/type-generation/pipeline-schema.ts"() {
    init_import_meta_url();
    init_logger();
    init_client10();
    init_user3();
    init_helpers7();
    init_type_generation();
    MAX_NESTING_DEPTH = 10;
    GENERIC_PIPELINE_TYPE = 'import("cloudflare:pipelines").Pipeline<import("cloudflare:pipelines").PipelineRecord>';
    __name(schemaFieldTypeToTypeScript, "schemaFieldTypeToTypeScript");
    __name(schemaFieldsToTypeScript, "schemaFieldsToTypeScript");
    __name(streamNameToTypeName, "streamNameToTypeName");
    __name(generatePipelineTypeFromSchema, "generatePipelineTypeFromSchema");
    __name(fetchStream, "fetchStream");
    __name(hasApiToken, "hasApiToken");
    __name(fetchPipelineTypes, "fetchPipelineTypes");
  }
});
function logRuntimeTypesMessage(tsconfigTypes, isNodeCompat = false) {
  const isWorkersTypesInstalled = tsconfigTypes.find(
    (type) => type.startsWith("@cloudflare/workers-types")
  );
  const maybeHasOldRuntimeFile = fs29.existsSync("./.wrangler/types/runtime.d.ts");
  if (maybeHasOldRuntimeFile) {
    logAction("Remove the old runtime.d.ts file");
    logger.log(
      source_default.dim(
        "`wrangler types` now outputs runtime and Env types in one file.\nYou can now delete the ./.wrangler/types/runtime.d.ts and update your tsconfig.json`"
      )
    );
    logger.log("");
  }
  if (isWorkersTypesInstalled) {
    logAction(
      "Migrate from @cloudflare/workers-types to generated runtime types"
    );
    logger.log(
      source_default.dim(
        "`wrangler types` now generates runtime types and supersedes @cloudflare/workers-types.\nYou should now uninstall @cloudflare/workers-types and remove it from your tsconfig.json."
      )
    );
    logger.log("");
  }
  let isNodeTypesInstalled = Boolean(
    tsconfigTypes.find((type) => type === "node")
  );
  if (!isNodeTypesInstalled && isNodeCompat) {
    const nodeModules = dir("node_modules/@types/node");
    if (nodeModules) {
      isNodeTypesInstalled = true;
    }
  }
  if (isNodeCompat && !isNodeTypesInstalled) {
    logAction("Install @types/node");
    logger.log(
      source_default.dim(
        `Since you have the \`nodejs_compat\` flag, you should install Node.js types by running "npm i --save-dev @types/node".`
      )
    );
    logger.log("");
  }
  logger.log(
    `\u{1F4D6} Read about runtime types
${source_default.dim("https://developers.cloudflare.com/workers/languages/typescript/#generate-types")}`
  );
}
var logAction;
var init_log_runtime_types_message = __esm({
  "src/type-generation/runtime/log-runtime-types-message.ts"() {
    init_import_meta_url();
    init_source();
    init_find();
    init_logger();
    __name(logRuntimeTypesMessage, "logRuntimeTypesMessage");
    logAction = /* @__PURE__ */ __name((msg) => {
      logger.log(source_default.hex("#BD5B08").bold("Action required"), msg);
    }, "logAction");
  }
});
function isValidIdentifier2(key) {
  return /^[a-zA-Z_$][\w$]*$/.test(key);
}
function escapeTypeScriptString(str) {
  return JSON.stringify(str).slice(1, -1);
}
function constructTypeKey(key) {
  if (isValidIdentifier2(key)) {
    return `${key}`;
  }
  return `"${escapeTypeScriptString(key)}"`;
}
function constructTSModuleGlob(glob) {
  if (!glob.includes("*")) {
    return glob;
  } else if (glob.includes(".")) {
    return `*.${glob.split(".").at(-1)}`;
  } else {
    return glob.replace("**/*", "*").replace("**/", "*/").replace("/**", "/*");
  }
}
function generateImportSpecifier(from, to) {
  const relativePath = path3.relative(path3.dirname(from), path3.dirname(to)).replace(/\\/g, "/");
  const filename = path3.basename(to, path3.extname(to));
  if (!relativePath) {
    return `./${filename}`;
  } else if (relativePath.startsWith("..")) {
    return `${relativePath}/${filename}`;
  } else {
    return `./${relativePath}/${filename}`;
  }
}
function hasConfigSecrets(rawConfig) {
  if (rawConfig.secrets !== void 0) {
    return true;
  }
  return Object.values(rawConfig.env ?? {}).some(
    (env6) => env6.secrets !== void 0
  );
}
async function generateEnvTypes(config, args, envInterface, outputPath, entrypoint, serviceEntries, log2 = true) {
  const collectionArgs = {
    ...args,
    config: config.configPath
  };
  const { rawConfig } = exports.experimental_readRawConfig(collectionArgs);
  let secrets = {};
  let perEnvSecrets;
  const useConfigSecrets = hasConfigSecrets(rawConfig);
  if (useConfigSecrets) {
    perEnvSecrets = /* @__PURE__ */ new Map();
    const topLevelKeys = {};
    for (const key of rawConfig.secrets?.required ?? []) {
      topLevelKeys[key] = "";
    }
    perEnvSecrets.set(TOP_LEVEL_ENV_NAME, topLevelKeys);
    for (const [envName, envConfig] of Object.entries(rawConfig.env ?? {})) {
      const envKeys = {};
      for (const key of envConfig.secrets?.required ?? []) {
        envKeys[key] = "";
      }
      perEnvSecrets.set(envName, envKeys);
    }
    secrets = perEnvSecrets.get(args.env ?? TOP_LEVEL_ENV_NAME) ?? {};
  } else {
    const secretBindings = getVarsForDev(
      config.userConfigPath,
      args.envFile,
      {},
      args.env,
      true
    );
    for (const key of Object.keys(secretBindings)) {
      secrets[key] = "";
    }
  }
  const entrypointFormat = entrypoint?.format ?? "modules";
  const userProvidedEnvInterface = envInterface !== "Env";
  if (userProvidedEnvInterface && entrypointFormat === "service-worker") {
    throw new UserError(
      "An env-interface value has been provided but the worker uses the incompatible Service Worker syntax"
    );
  }
  const hasEnvironments = !!rawConfig.env && Object.keys(rawConfig.env).length > 0;
  const shouldGeneratePerEnvTypes = hasEnvironments && !args.env;
  if (shouldGeneratePerEnvTypes) {
    return generatePerEnvironmentTypes(
      config,
      collectionArgs,
      envInterface,
      outputPath,
      entrypoint,
      serviceEntries,
      secrets,
      perEnvSecrets,
      log2
    );
  }
  return generateSimpleEnvTypes(
    config,
    collectionArgs,
    envInterface,
    outputPath,
    entrypoint,
    serviceEntries,
    secrets,
    log2
  );
}
async function generateSimpleEnvTypes(config, collectionArgs, envInterface, outputPath, entrypoint, serviceEntries, secrets = {}, log2 = true) {
  const stringKeys = new Array();
  const collectedBindings = collectCoreBindings(collectionArgs);
  const collectedDurableObjects = collectAllDurableObjects(collectionArgs);
  const collectedServices = collectAllServices(collectionArgs);
  const collectedUnsafeBindings = collectAllUnsafeBindings(collectionArgs);
  const collectedVars = collectAllVars(collectionArgs);
  const collectedWorkflows = collectAllWorkflows(collectionArgs);
  const collectedPipelines = collectAllPipelines(collectionArgs);
  const entrypointFormat = entrypoint?.format ?? "modules";
  const fullOutputPath = path3.resolve(outputPath);
  const envTypeStructure = new Array();
  for (const binding of collectedBindings) {
    envTypeStructure.push({
      key: constructTypeKey(binding.name),
      type: binding.type
    });
  }
  const typeDefinitions = [];
  if (collectedPipelines.length > 0) {
    const pipelineTypes = await fetchPipelineTypes(config, collectedPipelines);
    for (const pipelineType4 of pipelineTypes) {
      const typeRef = entrypointFormat === "service-worker" ? pipelineType4.type.replace("Cloudflare.", "") : pipelineType4.type;
      envTypeStructure.push({
        key: constructTypeKey(pipelineType4.binding),
        type: typeRef
      });
      if (pipelineType4.typeDefinition) {
        typeDefinitions.push(pipelineType4.typeDefinition);
      }
    }
  }
  if (collectedVars) {
    const vars = Object.entries(collectedVars).filter(
      ([key]) => !(key in secrets)
    );
    for (const [varName, varValues] of vars) {
      envTypeStructure.push({
        key: constructTypeKey(varName),
        type: varValues.length === 1 ? varValues[0] : varValues.join(" | ")
      });
      stringKeys.push(varName);
    }
  }
  for (const secretName in secrets) {
    envTypeStructure.push({
      key: constructTypeKey(secretName),
      type: "string"
    });
    stringKeys.push(secretName);
  }
  for (const durableObject of collectedDurableObjects) {
    const doEntrypoint = durableObject.script_name ? serviceEntries?.get(durableObject.script_name) : entrypoint;
    const importPath = doEntrypoint ? generateImportSpecifier(fullOutputPath, doEntrypoint.file) : void 0;
    const exportExists = doEntrypoint?.exports?.some(
      (e10) => e10 === durableObject.class_name
    );
    const key = constructTypeKey(durableObject.name);
    if (importPath && exportExists) {
      envTypeStructure.push({
        key,
        type: `DurableObjectNamespace<import("${importPath}").${durableObject.class_name}>`
      });
      continue;
    }
    if (durableObject.script_name) {
      envTypeStructure.push({
        key,
        type: `DurableObjectNamespace /* ${durableObject.class_name} from ${durableObject.script_name} */`
      });
      continue;
    }
    envTypeStructure.push({
      key,
      type: `DurableObjectNamespace /* ${durableObject.class_name} */`
    });
  }
  for (const service of collectedServices) {
    const serviceEntry = service.service !== entrypoint?.name ? serviceEntries?.get(service.service) : entrypoint;
    const importPath = serviceEntry ? generateImportSpecifier(fullOutputPath, serviceEntry.file) : void 0;
    const exportExists = serviceEntry?.exports?.some(
      (e10) => e10 === (service.entrypoint ?? "default")
    );
    const key = constructTypeKey(service.binding);
    if (importPath && exportExists) {
      envTypeStructure.push({
        key,
        type: `Service<typeof import("${importPath}").${service.entrypoint ?? "default"}>`
      });
      continue;
    }
    if (service.entrypoint) {
      envTypeStructure.push({
        key,
        type: `Service /* entrypoint ${service.entrypoint} from ${service.service} */`
      });
      continue;
    }
    envTypeStructure.push({
      key,
      type: `Fetcher /* ${service.service} */`
    });
  }
  for (const workflow of collectedWorkflows) {
    const workflowEntrypoint = workflow.script_name ? serviceEntries?.get(workflow.script_name) : entrypoint;
    const importPath = workflowEntrypoint ? generateImportSpecifier(fullOutputPath, workflowEntrypoint.file) : void 0;
    const exportExists = workflowEntrypoint?.exports?.some(
      (e10) => e10 === workflow.class_name
    );
    const key = constructTypeKey(workflow.binding);
    if (importPath && exportExists) {
      envTypeStructure.push({
        key,
        type: `Workflow<Parameters<import("${importPath}").${workflow.class_name}['run']>[0]['payload']>`
      });
      continue;
    }
    if (workflow.script_name) {
      envTypeStructure.push({
        key,
        type: `Workflow /* ${workflow.class_name} from ${workflow.script_name} */`
      });
      continue;
    }
    envTypeStructure.push({
      key,
      type: `Workflow /* ${workflow.class_name} */`
    });
  }
  for (const unsafe of collectedUnsafeBindings) {
    if (unsafe.type === "ratelimit") {
      envTypeStructure.push({
        key: constructTypeKey(unsafe.name),
        type: "RateLimit"
      });
      continue;
    }
    envTypeStructure.push({
      key: constructTypeKey(unsafe.name),
      type: "any"
    });
  }
  if (config.data_blobs) {
    for (const dataBlobs in config.data_blobs) {
      envTypeStructure.push({
        key: constructTypeKey(dataBlobs),
        type: "ArrayBuffer"
      });
    }
  }
  if (config.text_blobs) {
    for (const textBlobs in config.text_blobs) {
      envTypeStructure.push({
        key: constructTypeKey(textBlobs),
        type: "string"
      });
    }
  }
  const modulesTypeStructure = new Array();
  if (config.rules) {
    const moduleTypeMap = {
      CompiledWasm: "WebAssembly.Module",
      Data: "ArrayBuffer",
      Text: "string"
    };
    for (const ruleObject of config.rules) {
      const typeScriptType = moduleTypeMap[ruleObject.type];
      if (typeScriptType === void 0) {
        continue;
      }
      for (const glob of ruleObject.globs) {
        modulesTypeStructure.push(`declare module "${constructTSModuleGlob(glob)}" {
	const value: ${typeScriptType};
	export default value;
}`);
      }
    }
  }
  const typesHaveBeenFound = envTypeStructure.length > 0 || modulesTypeStructure.length > 0;
  if (entrypointFormat === "modules" || typesHaveBeenFound) {
    const { consoleOutput, fileContent } = generateTypeStrings(
      entrypointFormat,
      envInterface,
      envTypeStructure.map(({ key, type }) => `${key}: ${type};`),
      modulesTypeStructure,
      stringKeys,
      config.compatibility_date,
      config.compatibility_flags,
      entrypoint ? generateImportSpecifier(fullOutputPath, entrypoint.file) : void 0,
      [...getDurableObjectClassNameToUseSQLiteMap(config.migrations).keys()],
      typeDefinitions
    );
    const hash = crypto2.createHash("sha256").update(consoleOutput).digest("hex").slice(0, 32);
    if (log2) {
      logger.log(source_default.dim(consoleOutput));
    }
    return {
      envHeader: getEnvHeader(hash),
      envTypes: fileContent
    };
  } else {
    if (log2) {
      logger.log(source_default.dim("No project types to add.\n"));
    }
    return {
      envHeader: void 0,
      envTypes: void 0
    };
  }
}
async function generatePerEnvironmentTypes(config, collectionArgs, envInterface, outputPath, entrypoint, serviceEntries, secrets = {}, perEnvSecrets, log2 = true) {
  const { rawConfig } = exports.experimental_readRawConfig(collectionArgs);
  const envNames = Object.keys(rawConfig.env ?? {});
  validateEnvInterfaceNames(envNames);
  const entrypointFormat = entrypoint?.format ?? "modules";
  const fullOutputPath = path3.resolve(outputPath);
  const bindingsPerEnv = collectCoreBindingsPerEnvironment(collectionArgs);
  const varsPerEnv = collectVarsPerEnvironment(collectionArgs);
  const durableObjectsPerEnv = collectDurableObjectsPerEnvironment(collectionArgs);
  const servicesPerEnv = collectServicesPerEnvironment(collectionArgs);
  const workflowsPerEnv = collectWorkflowsPerEnvironment(collectionArgs);
  const unsafePerEnv = collectUnsafeBindingsPerEnvironment(collectionArgs);
  const pipelinesPerEnv = collectPipelinesPerEnvironment(collectionArgs);
  const aggregatedBindings = /* @__PURE__ */ new Map();
  const bindingPresence = /* @__PURE__ */ new Map();
  const allEnvNames = [TOP_LEVEL_ENV_NAME, ...envNames];
  function trackBinding(name2, type, envName) {
    let types13 = aggregatedBindings.get(name2);
    let presence = bindingPresence.get(name2);
    if (!types13) {
      types13 = /* @__PURE__ */ new Set();
      aggregatedBindings.set(name2, types13);
    }
    if (!presence) {
      presence = /* @__PURE__ */ new Set();
      bindingPresence.set(name2, presence);
    }
    types13.add(type);
    presence.add(envName);
  }
  __name(trackBinding, "trackBinding");
  function getDurableObjectType(durableObject) {
    const doEntrypoint = durableObject.script_name ? serviceEntries?.get(durableObject.script_name) : entrypoint;
    const importPath = doEntrypoint ? generateImportSpecifier(fullOutputPath, doEntrypoint.file) : void 0;
    const exportExists = doEntrypoint?.exports?.some(
      (e10) => e10 === durableObject.class_name
    );
    if (importPath && exportExists) {
      return `DurableObjectNamespace<import("${importPath}").${durableObject.class_name}>`;
    }
    if (durableObject.script_name) {
      return `DurableObjectNamespace /* ${durableObject.class_name} from ${durableObject.script_name} */`;
    }
    return `DurableObjectNamespace /* ${durableObject.class_name} */`;
  }
  __name(getDurableObjectType, "getDurableObjectType");
  function getServiceType(service) {
    const serviceEntry = service.service !== entrypoint?.name ? serviceEntries?.get(service.service) : entrypoint;
    const importPath = serviceEntry ? generateImportSpecifier(fullOutputPath, serviceEntry.file) : void 0;
    const exportExists = serviceEntry?.exports?.some(
      (e10) => e10 === (service.entrypoint ?? "default")
    );
    if (importPath && exportExists) {
      return `Service<typeof import("${importPath}").${service.entrypoint ?? "default"}>`;
    }
    if (service.entrypoint) {
      return `Service /* entrypoint ${service.entrypoint} from ${service.service} */`;
    }
    return `Fetcher /* ${service.service} */`;
  }
  __name(getServiceType, "getServiceType");
  function getWorkflowType(workflow) {
    const workflowEntrypoint = workflow.script_name ? serviceEntries?.get(workflow.script_name) : entrypoint;
    const importPath = workflowEntrypoint ? generateImportSpecifier(fullOutputPath, workflowEntrypoint.file) : void 0;
    const exportExists = workflowEntrypoint?.exports?.some(
      (e10) => e10 === workflow.class_name
    );
    if (importPath && exportExists) {
      return `Workflow<Parameters<import("${importPath}").${workflow.class_name}['run']>[0]['payload']>`;
    }
    if (workflow.script_name) {
      return `Workflow /* ${workflow.class_name} from ${workflow.script_name} */`;
    }
    return `Workflow /* ${workflow.class_name} */`;
  }
  __name(getWorkflowType, "getWorkflowType");
  const perEnvInterfaces = new Array();
  const stringKeys = new Array();
  const typeDefinitions = /* @__PURE__ */ new Set();
  for (const envName of envNames) {
    const interfaceName = toEnvInterfaceName(envName);
    const envBindings = new Array();
    const envSecrets = perEnvSecrets?.get(envName) ?? secrets;
    const bindings = bindingsPerEnv.get(envName) ?? [];
    for (const binding of bindings) {
      envBindings.push({
        key: constructTypeKey(binding.name),
        value: binding.type
      });
      trackBinding(binding.name, binding.type, envName);
    }
    const vars = varsPerEnv.get(envName) ?? {};
    for (const [varName, varValues] of Object.entries(vars)) {
      if (varName in envSecrets) {
        continue;
      }
      const varType = varValues.length === 1 ? varValues[0] : varValues.join(" | ");
      envBindings.push({ key: constructTypeKey(varName), value: varType });
      trackBinding(varName, varType, envName);
      if (!stringKeys.includes(varName)) {
        stringKeys.push(varName);
      }
    }
    for (const secretName in envSecrets) {
      envBindings.push({ key: constructTypeKey(secretName), value: "string" });
      trackBinding(secretName, "string", envName);
      if (!stringKeys.includes(secretName)) {
        stringKeys.push(secretName);
      }
    }
    const durableObjects = durableObjectsPerEnv.get(envName) ?? [];
    for (const durableObject of durableObjects) {
      const type = getDurableObjectType(durableObject);
      envBindings.push({
        key: constructTypeKey(durableObject.name),
        value: type
      });
      trackBinding(durableObject.name, type, envName);
    }
    const services = servicesPerEnv.get(envName) ?? [];
    for (const service of services) {
      const type = getServiceType(service);
      envBindings.push({ key: constructTypeKey(service.binding), value: type });
      trackBinding(service.binding, type, envName);
    }
    const workflows = workflowsPerEnv.get(envName) ?? [];
    for (const workflow of workflows) {
      const type = getWorkflowType(workflow);
      envBindings.push({
        key: constructTypeKey(workflow.binding),
        value: type
      });
      trackBinding(workflow.binding, type, envName);
    }
    const unsafeBindings = unsafePerEnv.get(envName) ?? [];
    for (const unsafe of unsafeBindings) {
      const type = unsafe.type === "ratelimit" ? "RateLimit" : "any";
      envBindings.push({ key: constructTypeKey(unsafe.name), value: type });
      trackBinding(unsafe.name, type, envName);
    }
    const envPipelines = pipelinesPerEnv.get(envName) ?? [];
    if (envPipelines.length > 0) {
      const pipelineTypes = await fetchPipelineTypes(config, envPipelines);
      for (const pipelineType4 of pipelineTypes) {
        const typeRef = entrypointFormat === "service-worker" ? pipelineType4.type.replace("Cloudflare.", "") : pipelineType4.type;
        envBindings.push({
          key: constructTypeKey(pipelineType4.binding),
          value: typeRef
        });
        trackBinding(pipelineType4.binding, typeRef, envName);
        if (pipelineType4.typeDefinition) {
          typeDefinitions.add(pipelineType4.typeDefinition);
        }
      }
    }
    if (envBindings.length > 0) {
      const bindingLines = envBindings.map(({ key, value }) => `		${key}: ${value};`).join("\n");
      perEnvInterfaces.push(
        `	interface ${interfaceName} {
${bindingLines}
	}`
      );
    } else {
      perEnvInterfaces.push(`	interface ${interfaceName} {}`);
    }
  }
  const topLevelBindings = bindingsPerEnv.get(TOP_LEVEL_ENV_NAME) ?? [];
  for (const binding of topLevelBindings) {
    trackBinding(binding.name, binding.type, TOP_LEVEL_ENV_NAME);
  }
  const topLevelSecrets = perEnvSecrets?.get(TOP_LEVEL_ENV_NAME) ?? secrets;
  const topLevelVars = varsPerEnv.get(TOP_LEVEL_ENV_NAME) ?? {};
  for (const [varName, varValues] of Object.entries(topLevelVars)) {
    if (varName in topLevelSecrets) {
      continue;
    }
    const varType = varValues.length === 1 ? varValues[0] : varValues.join(" | ");
    trackBinding(varName, varType, TOP_LEVEL_ENV_NAME);
    if (!stringKeys.includes(varName)) {
      stringKeys.push(varName);
    }
  }
  for (const secretName in topLevelSecrets) {
    trackBinding(secretName, "string", TOP_LEVEL_ENV_NAME);
    if (!stringKeys.includes(secretName)) {
      stringKeys.push(secretName);
    }
  }
  const topLevelDOs = durableObjectsPerEnv.get(TOP_LEVEL_ENV_NAME) ?? [];
  for (const durableObject of topLevelDOs) {
    const type = getDurableObjectType(durableObject);
    trackBinding(durableObject.name, type, TOP_LEVEL_ENV_NAME);
  }
  const topLevelServices = servicesPerEnv.get(TOP_LEVEL_ENV_NAME) ?? [];
  for (const service of topLevelServices) {
    const type = getServiceType(service);
    trackBinding(service.binding, type, TOP_LEVEL_ENV_NAME);
  }
  const topLevelWorkflows = workflowsPerEnv.get(TOP_LEVEL_ENV_NAME) ?? [];
  for (const workflow of topLevelWorkflows) {
    const type = getWorkflowType(workflow);
    trackBinding(workflow.binding, type, TOP_LEVEL_ENV_NAME);
  }
  const topLevelUnsafe = unsafePerEnv.get(TOP_LEVEL_ENV_NAME) ?? [];
  for (const unsafe of topLevelUnsafe) {
    const type = unsafe.type === "ratelimit" ? "RateLimit" : "any";
    trackBinding(unsafe.name, type, TOP_LEVEL_ENV_NAME);
  }
  const topLevelPipelines = pipelinesPerEnv.get(TOP_LEVEL_ENV_NAME) ?? [];
  if (topLevelPipelines.length > 0) {
    const pipelineTypes = await fetchPipelineTypes(config, topLevelPipelines);
    for (const pipelineType4 of pipelineTypes) {
      const typeRef = entrypointFormat === "service-worker" ? pipelineType4.type.replace("Cloudflare.", "") : pipelineType4.type;
      trackBinding(pipelineType4.binding, typeRef, TOP_LEVEL_ENV_NAME);
      if (pipelineType4.typeDefinition) {
        typeDefinitions.add(pipelineType4.typeDefinition);
      }
    }
  }
  const aggregatedEnvBindings = new Array();
  for (const [name2, types13] of aggregatedBindings.entries()) {
    const typeArray = Array.from(types13);
    const unionType4 = typeArray.length === 1 ? typeArray[0] : typeArray.join(" | ");
    const presence = bindingPresence.get(name2);
    const isRequired = presence ? allEnvNames.every((env6) => presence.has(env6)) : false;
    aggregatedEnvBindings.push({
      key: constructTypeKey(name2),
      required: isRequired,
      type: unionType4
    });
  }
  if (config.data_blobs) {
    for (const dataBlobs in config.data_blobs) {
      aggregatedEnvBindings.push({
        key: constructTypeKey(dataBlobs),
        required: true,
        type: "ArrayBuffer"
      });
    }
  }
  if (config.text_blobs) {
    for (const textBlobs in config.text_blobs) {
      aggregatedEnvBindings.push({
        key: constructTypeKey(textBlobs),
        required: true,
        type: "string"
      });
    }
  }
  const modulesTypeStructure = new Array();
  if (config.rules) {
    const moduleTypeMap = {
      CompiledWasm: "WebAssembly.Module",
      Data: "ArrayBuffer",
      Text: "string"
    };
    for (const ruleObject of config.rules) {
      const typeScriptType = moduleTypeMap[ruleObject.type];
      if (typeScriptType !== void 0) {
        for (const glob of ruleObject.globs) {
          modulesTypeStructure.push(`declare module "${constructTSModuleGlob(glob)}" {
	const value: ${typeScriptType};
	export default value;
	}`);
        }
      }
    }
  }
  const { consoleOutput, fileContent } = generatePerEnvTypeStrings(
    entrypointFormat,
    envInterface,
    perEnvInterfaces,
    aggregatedEnvBindings,
    modulesTypeStructure,
    stringKeys,
    config.compatibility_date,
    config.compatibility_flags,
    entrypoint ? generateImportSpecifier(fullOutputPath, entrypoint.file) : void 0,
    [...getDurableObjectClassNameToUseSQLiteMap(config.migrations).keys()],
    [...typeDefinitions]
  );
  const hash = crypto2.createHash("sha256").update(consoleOutput).digest("hex").slice(0, 32);
  if (log2) {
    logger.log(source_default.dim(consoleOutput));
  }
  return {
    envHeader: getEnvHeader(hash),
    envTypes: fileContent
  };
}
function generatePerEnvTypeStrings(formatType, envInterface, perEnvInterfaces, aggregatedEnvBindings, modulesTypeStructure, stringKeys, compatibilityDate, compatibilityFlags, entrypointModule, configuredDurableObjects, typeDefinitions = []) {
  let baseContent = "";
  let processEnv = "";
  const typeDefsContent = typeDefinitions.length > 0 ? typeDefinitions.map((def) => `	${def}`).join("\n") : "";
  if (formatType === "modules") {
    if (isProcessEnvPopulated(compatibilityDate, compatibilityFlags) && stringKeys.length > 0) {
      processEnv = `
type StringifyValues<EnvType extends Record<string, unknown>> = {
	[Binding in keyof EnvType]: EnvType[Binding] extends string ? EnvType[Binding] : string;
};
declare namespace NodeJS {
	interface ProcessEnv extends StringifyValues<Pick<Cloudflare.Env, ${stringKeys.map((k7) => `"${k7}"`).join(" | ")}>> {}
}`;
    }
    const perEnvContent = perEnvInterfaces.join("\n");
    const envBindingLines = aggregatedEnvBindings.map((b11) => `		${b11.key}${b11.required ? "" : "?"}: ${b11.type};`).join("\n");
    const globalPropsContent = entrypointModule ? `
	interface GlobalProps {
		mainModule: typeof import("${entrypointModule}");${configuredDurableObjects.length > 0 ? `
		durableNamespaces: ${configuredDurableObjects.map((d8) => `"${d8}"`).join(" | ")};` : ""}
	}` : "";
    baseContent = `declare namespace Cloudflare {${globalPropsContent}${typeDefsContent ? `
${typeDefsContent}` : ""}
${perEnvContent}
	interface Env {
${envBindingLines}
	}
}
interface ${envInterface} extends Cloudflare.Env {}${processEnv}`;
  } else {
    const globalTypeDefsContent = typeDefinitions.length > 0 ? typeDefinitions.join("\n") + "\n" : "";
    const envBindingLines = aggregatedEnvBindings.map(({ key, type }) => `	const ${key}: ${type};`).join("\n");
    baseContent = `${globalTypeDefsContent}export {};
declare global {
${envBindingLines}
}`;
  }
  const modulesContent = modulesTypeStructure.join("\n");
  return {
    consoleOutput: `${baseContent}
${modulesContent}`,
    fileContent: `${baseContent}
${modulesContent}`
  };
}
function generateTypeStrings(formatType, envInterface, envTypeStructure, modulesTypeStructure, stringKeys, compatibilityDate, compatibilityFlags, entrypointModule, configuredDurableObjects, typeDefinitions = []) {
  let baseContent = "";
  let processEnv = "";
  const typeDefsContent = typeDefinitions.length > 0 ? typeDefinitions.map((def) => `	${def}`).join("\n") : "";
  if (formatType === "modules") {
    if (isProcessEnvPopulated(compatibilityDate, compatibilityFlags) && stringKeys.length > 0) {
      processEnv = `
type StringifyValues<EnvType extends Record<string, unknown>> = {
	[Binding in keyof EnvType]: EnvType[Binding] extends string ? EnvType[Binding] : string;
};
declare namespace NodeJS {
	interface ProcessEnv extends StringifyValues<Pick<Cloudflare.Env, ${stringKeys.map((k7) => `"${k7}"`).join(" | ")}>> {}
}`;
    }
    baseContent = `declare namespace Cloudflare {${entrypointModule ? `
	interface GlobalProps {
		mainModule: typeof import("${entrypointModule}");${configuredDurableObjects.length > 0 ? `
		durableNamespaces: ${configuredDurableObjects.map((d8) => `"${d8}"`).join(" | ")};` : ""}
	}` : ""}${typeDefsContent ? `
${typeDefsContent}` : ""}
	interface Env {${envTypeStructure.map((value) => `
		${value}`).join("")}
	}
}
interface ${envInterface} extends Cloudflare.Env {}${processEnv}`;
  } else {
    const globalTypeDefsContent = typeDefinitions.length > 0 ? typeDefinitions.join("\n") + "\n" : "";
    baseContent = `${globalTypeDefsContent}export {};
declare global {
${envTypeStructure.map((value) => `	const ${value}`).join("\n")}
}`;
  }
  const modulesContent = modulesTypeStructure.join("\n");
  return {
    fileContent: `${baseContent}
${modulesContent}`,
    consoleOutput: `${baseContent}
${modulesContent}`
  };
}
function readTsconfigTypes(tsconfigPath) {
  if (!fs29__namespace.existsSync(tsconfigPath)) {
    return [];
  }
  try {
    const tsconfig = parseJSONC(
      fs29__namespace.readFileSync(tsconfigPath, "utf-8")
    );
    return tsconfig.compilerOptions?.types || [];
  } catch {
    return [];
  }
}
function getEnvConfig(environmentName, rawConfig) {
  const envConfig = rawConfig.env?.[environmentName];
  if (!envConfig) {
    const availableEnvs = Object.keys(rawConfig.env ?? {});
    const envList = availableEnvs.length > 0 ? `Available environments: ${availableEnvs.join(", ")}` : "No environments are defined in the configuration file.";
    throw new UserError(
      `Environment "${environmentName}" not found in configuration.
${envList}`
    );
  }
  return envConfig;
}
function collectAllVars(args) {
  const varsInfo = {};
  function collectEnvironmentVars(vars) {
    Object.entries(vars ?? {}).forEach(([key, value]) => {
      varsInfo[key] ??= /* @__PURE__ */ new Set();
      if (!args.strictVars) {
        varsInfo[key].add(
          Array.isArray(value) ? typeofArray(value) : typeof value
        );
        return;
      }
      if (typeof value === "string" || typeof value === "number" || typeof value === "boolean" || typeof value === "object") {
        varsInfo[key].add(JSON.stringify(value));
        return;
      }
      varsInfo[key].add("unknown");
    });
  }
  __name(collectEnvironmentVars, "collectEnvironmentVars");
  const { rawConfig } = exports.experimental_readRawConfig(args);
  if (args.env) {
    const envConfig = getEnvConfig(args.env, rawConfig);
    collectEnvironmentVars(envConfig.vars);
  } else {
    collectEnvironmentVars(rawConfig.vars);
    for (const env6 of Object.values(rawConfig.env ?? {})) {
      collectEnvironmentVars(env6.vars);
    }
  }
  return Object.fromEntries(
    Object.entries(varsInfo).map(([key, value]) => [key, [...value]])
  );
}
function typeofArray(array) {
  const typesInArray = [...new Set(array.map((item) => typeof item))].sort();
  if (typesInArray.length === 1) {
    return `${typesInArray[0]}[]`;
  }
  return `(${typesInArray.join("|")})[]`;
}
function collectCoreBindings(args) {
  const bindingsMap = /* @__PURE__ */ new Map();
  function addBinding(name2, type, bindingCategory, envName) {
    const existing = bindingsMap.get(name2);
    if (existing) {
      if (existing.bindingCategory !== bindingCategory) {
        throw new UserError(
          `Binding "${name2}" has conflicting types across environments: "${existing.bindingCategory}" vs "${bindingCategory}" (in ${envName}). Please use unique binding names for different binding types.`
        );
      }
      return;
    }
    bindingsMap.set(name2, { name: name2, type, bindingCategory });
  }
  __name(addBinding, "addBinding");
  function collectEnvironmentBindings(env6, envName) {
    if (!env6) {
      return;
    }
    for (const [index, kv] of (env6.kv_namespaces ?? []).entries()) {
      if (!kv.binding) {
        throwMissingBindingError({
          binding: kv,
          bindingType: "kv_namespaces",
          configPath: args.config,
          envName,
          fieldName: "binding",
          index
        });
      }
      addBinding(kv.binding, "KVNamespace", "kv_namespaces", envName);
    }
    for (const [index, r22] of (env6.r2_buckets ?? []).entries()) {
      if (!r22.binding) {
        throwMissingBindingError({
          binding: r22,
          bindingType: "r2_buckets",
          configPath: args.config,
          envName,
          fieldName: "binding",
          index
        });
      }
      addBinding(r22.binding, "R2Bucket", "r2_buckets", envName);
    }
    for (const [index, d1] of (env6.d1_databases ?? []).entries()) {
      if (!d1.binding) {
        throwMissingBindingError({
          binding: d1,
          bindingType: "d1_databases",
          configPath: args.config,
          envName,
          fieldName: "binding",
          index
        });
      }
      addBinding(d1.binding, "D1Database", "d1_databases", envName);
    }
    for (const [index, vectorize] of (env6.vectorize ?? []).entries()) {
      if (!vectorize.binding) {
        throwMissingBindingError({
          binding: vectorize,
          bindingType: "vectorize",
          configPath: args.config,
          envName,
          fieldName: "binding",
          index
        });
      }
      addBinding(vectorize.binding, "VectorizeIndex", "vectorize", envName);
    }
    for (const [index, hyperdrive] of (env6.hyperdrive ?? []).entries()) {
      if (!hyperdrive.binding) {
        throwMissingBindingError({
          binding: hyperdrive,
          bindingType: "hyperdrive",
          configPath: args.config,
          envName,
          fieldName: "binding",
          index
        });
      }
      addBinding(hyperdrive.binding, "Hyperdrive", "hyperdrive", envName);
    }
    for (const [index, sendEmail2] of (env6.send_email ?? []).entries()) {
      if (!sendEmail2.name) {
        throwMissingBindingError({
          binding: sendEmail2,
          bindingType: "send_email",
          configPath: args.config,
          envName,
          fieldName: "name",
          index
        });
      }
      addBinding(sendEmail2.name, "SendEmail", "send_email", envName);
    }
    for (const [index, ae3] of (env6.analytics_engine_datasets ?? []).entries()) {
      if (!ae3.binding) {
        throwMissingBindingError({
          binding: ae3,
          bindingType: "analytics_engine_datasets",
          configPath: args.config,
          envName,
          fieldName: "binding",
          index
        });
      }
      addBinding(
        ae3.binding,
        "AnalyticsEngineDataset",
        "analytics_engine_datasets",
        envName
      );
    }
    for (const [index, dispatch] of (env6.dispatch_namespaces ?? []).entries()) {
      if (!dispatch.binding) {
        throwMissingBindingError({
          binding: dispatch,
          bindingType: "dispatch_namespaces",
          configPath: args.config,
          envName,
          fieldName: "binding",
          index
        });
      }
      addBinding(
        dispatch.binding,
        "DispatchNamespace",
        "dispatch_namespaces",
        envName
      );
    }
    for (const [index, mtls] of (env6.mtls_certificates ?? []).entries()) {
      if (!mtls.binding) {
        throwMissingBindingError({
          binding: mtls,
          bindingType: "mtls_certificates",
          configPath: args.config,
          envName,
          fieldName: "binding",
          index
        });
      }
      addBinding(mtls.binding, "Fetcher", "mtls_certificates", envName);
    }
    for (const [index, queue] of (env6.queues?.producers ?? []).entries()) {
      if (!queue.binding) {
        throwMissingBindingError({
          binding: queue,
          bindingType: "queues.producers",
          configPath: args.config,
          envName,
          fieldName: "binding",
          index
        });
      }
      addBinding(queue.binding, "Queue", "queues_producers", envName);
    }
    for (const [index, secret] of (env6.secrets_store_secrets ?? []).entries()) {
      if (!secret.binding) {
        throwMissingBindingError({
          binding: secret,
          bindingType: "secrets_store_secrets",
          configPath: args.config,
          envName,
          fieldName: "binding",
          index
        });
      }
      addBinding(
        secret.binding,
        "SecretsStoreSecret",
        "secrets_store_secrets",
        envName
      );
    }
    for (const [index, helloWorld] of (env6.unsafe_hello_world ?? []).entries()) {
      if (!helloWorld.binding) {
        throwMissingBindingError({
          binding: helloWorld,
          bindingType: "unsafe_hello_world",
          configPath: args.config,
          envName,
          fieldName: "binding",
          index
        });
      }
      addBinding(
        helloWorld.binding,
        "HelloWorldBinding",
        "unsafe_hello_world",
        envName
      );
    }
    for (const [index, flagshipBinding] of (env6.flagship ?? []).entries()) {
      if (!flagshipBinding.binding) {
        throwMissingBindingError({
          binding: flagshipBinding,
          bindingType: "flagship",
          configPath: args.config,
          envName,
          fieldName: "binding",
          index
        });
      }
      addBinding(flagshipBinding.binding, "Flagship", "flagship", envName);
    }
    for (const [index, ratelimit] of (env6.ratelimits ?? []).entries()) {
      if (!ratelimit.name) {
        throwMissingBindingError({
          binding: ratelimit,
          bindingType: "ratelimits",
          configPath: args.config,
          envName,
          fieldName: "name",
          index
        });
      }
      addBinding(ratelimit.name, "RateLimit", "ratelimits", envName);
    }
    for (const [index, workerLoader] of (env6.worker_loaders ?? []).entries()) {
      if (!workerLoader.binding) {
        throwMissingBindingError({
          binding: workerLoader,
          bindingType: "worker_loaders",
          configPath: args.config,
          envName,
          fieldName: "binding",
          index
        });
      }
      addBinding(
        workerLoader.binding,
        "WorkerLoader",
        "worker_loaders",
        envName
      );
    }
    for (const [index, vpcService] of (env6.vpc_services ?? []).entries()) {
      if (!vpcService.binding) {
        throwMissingBindingError({
          binding: vpcService,
          bindingType: "vpc_services",
          configPath: args.config,
          envName,
          fieldName: "binding",
          index
        });
      }
      addBinding(vpcService.binding, "Fetcher", "vpc_services", envName);
    }
    for (const [index, vpcNetwork] of (env6.vpc_networks ?? []).entries()) {
      if (!vpcNetwork.binding) {
        throwMissingBindingError({
          binding: vpcNetwork,
          bindingType: "vpc_networks",
          configPath: args.config,
          envName,
          fieldName: "binding",
          index
        });
      }
      addBinding(vpcNetwork.binding, "Fetcher", "vpc_networks", envName);
    }
    for (const [index, aiSearchNamespace2] of (env6.ai_search_namespaces ?? []).entries()) {
      if (!aiSearchNamespace2.binding) {
        throwMissingBindingError({
          binding: aiSearchNamespace2,
          bindingType: "ai_search_namespaces",
          configPath: args.config,
          envName,
          fieldName: "binding",
          index
        });
      }
      addBinding(
        aiSearchNamespace2.binding,
        "AiSearchNamespace",
        "ai_search_namespaces",
        envName
      );
    }
    for (const [index, aiSearch] of (env6.ai_search ?? []).entries()) {
      if (!aiSearch.binding) {
        throwMissingBindingError({
          binding: aiSearch,
          bindingType: "ai_search",
          configPath: args.config,
          envName,
          fieldName: "binding",
          index
        });
      }
      addBinding(aiSearch.binding, "AiSearchInstance", "ai_search", envName);
    }
    if (env6.logfwdr?.bindings?.length) {
      addBinding("LOGFWDR_SCHEMA", "any", "logfwdr", envName);
    }
    if (env6.browser) {
      if (!env6.browser.binding) {
        throwMissingBindingError({
          binding: env6.browser,
          bindingType: "browser",
          configPath: args.config,
          envName,
          fieldName: "binding"
        });
      } else {
        addBinding(env6.browser.binding, "Fetcher", "browser", envName);
      }
    }
    if (env6.ai) {
      if (!env6.ai.binding) {
        throwMissingBindingError({
          binding: env6.ai,
          bindingType: "ai",
          configPath: args.config,
          envName,
          fieldName: "binding"
        });
      } else {
        addBinding(env6.ai.binding, "Ai", "ai", envName);
      }
    }
    if (env6.images) {
      if (!env6.images.binding) {
        throwMissingBindingError({
          binding: env6.images,
          bindingType: "images",
          configPath: args.config,
          envName,
          fieldName: "binding"
        });
      } else {
        addBinding(env6.images.binding, "ImagesBinding", "images", envName);
      }
    }
    if (env6.stream) {
      if (!env6.stream.binding) {
        throwMissingBindingError({
          binding: env6.stream,
          bindingType: "stream",
          configPath: args.config,
          envName,
          fieldName: "binding"
        });
      } else {
        addBinding(env6.stream.binding, "StreamBinding", "stream", envName);
      }
    }
    if (env6.media) {
      if (!env6.media.binding) {
        throwMissingBindingError({
          binding: env6.media,
          bindingType: "media",
          configPath: args.config,
          envName,
          fieldName: "binding"
        });
      } else {
        addBinding(env6.media.binding, "MediaBinding", "media", envName);
      }
    }
    if (env6.version_metadata) {
      if (!env6.version_metadata.binding) {
        throwMissingBindingError({
          binding: env6.version_metadata,
          bindingType: "version_metadata",
          configPath: args.config,
          envName,
          fieldName: "binding"
        });
      } else {
        addBinding(
          env6.version_metadata.binding,
          "WorkerVersionMetadata",
          "version_metadata",
          envName
        );
      }
    }
    if (env6.assets?.binding) {
      addBinding(env6.assets.binding, "Fetcher", "assets", envName);
    }
  }
  __name(collectEnvironmentBindings, "collectEnvironmentBindings");
  const { rawConfig } = exports.experimental_readRawConfig(args);
  if (args.env) {
    const envConfig = getEnvConfig(args.env, rawConfig);
    collectEnvironmentBindings(envConfig, args.env);
  } else {
    collectEnvironmentBindings(rawConfig, TOP_LEVEL_ENV_NAME);
    for (const [envName, env6] of Object.entries(rawConfig.env ?? {})) {
      collectEnvironmentBindings(env6, envName);
    }
  }
  return Array.from(bindingsMap.values());
}
function collectAllDurableObjects(args) {
  const durableObjectsMap = /* @__PURE__ */ new Map();
  function collectEnvironmentDOs(env6, envName) {
    if (!env6?.durable_objects?.bindings) {
      return;
    }
    for (const [index, doBinding] of env6.durable_objects.bindings.entries()) {
      if (!doBinding.name) {
        throwMissingBindingError({
          binding: doBinding,
          bindingType: "durable_objects.bindings",
          configPath: args.config,
          envName,
          fieldName: "name",
          index
        });
      }
      if (durableObjectsMap.has(doBinding.name)) {
        continue;
      }
      durableObjectsMap.set(doBinding.name, {
        class_name: doBinding.class_name,
        name: doBinding.name,
        script_name: doBinding.script_name
      });
    }
  }
  __name(collectEnvironmentDOs, "collectEnvironmentDOs");
  const { rawConfig } = exports.experimental_readRawConfig(args);
  if (args.env) {
    const envConfig = getEnvConfig(args.env, rawConfig);
    collectEnvironmentDOs(envConfig, args.env);
  } else {
    collectEnvironmentDOs(rawConfig, TOP_LEVEL_ENV_NAME);
    for (const [envName, env6] of Object.entries(rawConfig.env ?? {})) {
      collectEnvironmentDOs(env6, envName);
    }
  }
  return Array.from(durableObjectsMap.values());
}
function collectAllServices(args) {
  const servicesMap = /* @__PURE__ */ new Map();
  function collectEnvironmentServices(env6, envName) {
    if (!env6?.services) {
      return;
    }
    for (const [index, service] of env6.services.entries()) {
      if (!service.binding) {
        throwMissingBindingError({
          binding: service,
          bindingType: "services",
          configPath: args.config,
          envName,
          fieldName: "binding",
          index
        });
      }
      if (servicesMap.has(service.binding)) {
        continue;
      }
      servicesMap.set(service.binding, {
        binding: service.binding,
        entrypoint: service.entrypoint,
        service: service.service
      });
    }
  }
  __name(collectEnvironmentServices, "collectEnvironmentServices");
  const { rawConfig } = exports.experimental_readRawConfig(args);
  if (args.env) {
    const envConfig = getEnvConfig(args.env, rawConfig);
    collectEnvironmentServices(envConfig, args.env);
  } else {
    collectEnvironmentServices(rawConfig, TOP_LEVEL_ENV_NAME);
    for (const [envName, env6] of Object.entries(rawConfig.env ?? {})) {
      collectEnvironmentServices(env6, envName);
    }
  }
  return Array.from(servicesMap.values());
}
function collectAllWorkflows(args) {
  const workflowsMap = /* @__PURE__ */ new Map();
  function collectEnvironmentWorkflows(env6, envName) {
    if (!env6?.workflows) {
      return;
    }
    for (const [index, workflow] of env6.workflows.entries()) {
      if (!workflow.binding) {
        throwMissingBindingError({
          binding: workflow,
          bindingType: "workflows",
          configPath: args.config,
          envName,
          fieldName: "binding",
          index
        });
      }
      if (workflowsMap.has(workflow.binding)) {
        continue;
      }
      workflowsMap.set(workflow.binding, {
        binding: workflow.binding,
        name: workflow.name,
        class_name: workflow.class_name,
        script_name: workflow.script_name
      });
    }
  }
  __name(collectEnvironmentWorkflows, "collectEnvironmentWorkflows");
  const { rawConfig } = exports.experimental_readRawConfig(args);
  if (args.env) {
    const envConfig = getEnvConfig(args.env, rawConfig);
    collectEnvironmentWorkflows(envConfig, args.env);
  } else {
    collectEnvironmentWorkflows(rawConfig, TOP_LEVEL_ENV_NAME);
    for (const [envName, env6] of Object.entries(rawConfig.env ?? {})) {
      collectEnvironmentWorkflows(env6, envName);
    }
  }
  return Array.from(workflowsMap.values());
}
function collectAllUnsafeBindings(args) {
  const unsafeMap = /* @__PURE__ */ new Map();
  function collectEnvironmentUnsafe(env6, envName) {
    if (!env6?.unsafe?.bindings) {
      return;
    }
    for (const [index, binding] of env6.unsafe.bindings.entries()) {
      if (!binding.name) {
        throwMissingBindingError({
          binding,
          bindingType: "unsafe.bindings",
          configPath: args.config,
          envName,
          fieldName: "name",
          index
        });
      }
      if (unsafeMap.has(binding.name)) {
        continue;
      }
      unsafeMap.set(binding.name, {
        name: binding.name,
        type: binding.type
      });
    }
  }
  __name(collectEnvironmentUnsafe, "collectEnvironmentUnsafe");
  const { rawConfig } = exports.experimental_readRawConfig(args);
  if (args.env) {
    const envConfig = getEnvConfig(args.env, rawConfig);
    collectEnvironmentUnsafe(envConfig, args.env);
  } else {
    collectEnvironmentUnsafe(rawConfig, TOP_LEVEL_ENV_NAME);
    for (const [envName, env6] of Object.entries(rawConfig.env ?? {})) {
      collectEnvironmentUnsafe(env6, envName);
    }
  }
  return Array.from(unsafeMap.values());
}
function collectAllPipelines(args) {
  const pipelinesMap = /* @__PURE__ */ new Map();
  function collectEnvironmentPipelines(env6, envName) {
    if (!env6?.pipelines) {
      return;
    }
    for (const [index, pipeline] of env6.pipelines.entries()) {
      if (!pipeline.binding) {
        throwMissingBindingError({
          binding: pipeline,
          bindingType: "pipelines",
          configPath: args.config,
          envName,
          fieldName: "binding",
          index
        });
      }
      if (!pipeline.pipeline) {
        throwMissingBindingError({
          binding: pipeline,
          bindingType: "pipelines",
          configPath: args.config,
          envName,
          fieldName: "pipeline",
          index
        });
      }
      if (pipelinesMap.has(pipeline.binding)) {
        continue;
      }
      pipelinesMap.set(pipeline.binding, {
        binding: pipeline.binding,
        pipeline: pipeline.pipeline
      });
    }
  }
  __name(collectEnvironmentPipelines, "collectEnvironmentPipelines");
  const { rawConfig } = exports.experimental_readRawConfig(args);
  if (args.env) {
    const envConfig = getEnvConfig(args.env, rawConfig);
    collectEnvironmentPipelines(envConfig, args.env);
  } else {
    collectEnvironmentPipelines(rawConfig, TOP_LEVEL_ENV_NAME);
    for (const [envName, env6] of Object.entries(rawConfig.env ?? {})) {
      collectEnvironmentPipelines(env6, envName);
    }
  }
  return Array.from(pipelinesMap.values());
}
function collectVarsPerEnvironment(args) {
  const result = /* @__PURE__ */ new Map();
  function collectVars(vars) {
    const varsInfo = {};
    Object.entries(vars ?? {}).forEach(([key, value]) => {
      varsInfo[key] ??= /* @__PURE__ */ new Set();
      if (!args.strictVars) {
        varsInfo[key].add(
          Array.isArray(value) ? typeofArray(value) : typeof value
        );
        return;
      }
      if (typeof value === "string" || typeof value === "number" || typeof value === "boolean" || typeof value === "object") {
        varsInfo[key].add(JSON.stringify(value));
        return;
      }
      varsInfo[key].add("unknown");
    });
    return Object.fromEntries(
      Object.entries(varsInfo).map(([key, value]) => [key, [...value]])
    );
  }
  __name(collectVars, "collectVars");
  const { rawConfig } = exports.experimental_readRawConfig(args);
  const topLevelVars = collectVars(rawConfig.vars);
  if (Object.keys(topLevelVars).length > 0) {
    result.set(TOP_LEVEL_ENV_NAME, topLevelVars);
  }
  for (const [envName, env6] of Object.entries(rawConfig.env ?? {})) {
    const envVars = collectVars(env6.vars);
    if (Object.keys(envVars).length > 0) {
      result.set(envName, envVars);
    }
  }
  return result;
}
function collectCoreBindingsPerEnvironment(args) {
  const result = /* @__PURE__ */ new Map();
  function collectEnvironmentBindings(env6, envName) {
    if (!env6) {
      return [];
    }
    const bindings = new Array();
    for (const [index, kv] of (env6.kv_namespaces ?? []).entries()) {
      if (!kv.binding) {
        throwMissingBindingError({
          binding: kv,
          bindingType: "kv_namespaces",
          configPath: args.config,
          envName,
          fieldName: "binding",
          index
        });
      }
      bindings.push({
        bindingCategory: "kv_namespaces",
        name: kv.binding,
        type: "KVNamespace"
      });
    }
    for (const [index, r22] of (env6.r2_buckets ?? []).entries()) {
      if (!r22.binding) {
        throwMissingBindingError({
          binding: r22,
          bindingType: "r2_buckets",
          configPath: args.config,
          envName,
          fieldName: "binding",
          index
        });
      }
      bindings.push({
        bindingCategory: "r2_buckets",
        name: r22.binding,
        type: "R2Bucket"
      });
    }
    for (const [index, d1] of (env6.d1_databases ?? []).entries()) {
      if (!d1.binding) {
        throwMissingBindingError({
          binding: d1,
          bindingType: "d1_databases",
          configPath: args.config,
          envName,
          fieldName: "binding",
          index
        });
      }
      bindings.push({
        bindingCategory: "d1_databases",
        name: d1.binding,
        type: "D1Database"
      });
    }
    for (const [index, vectorize] of (env6.vectorize ?? []).entries()) {
      if (!vectorize.binding) {
        throwMissingBindingError({
          binding: vectorize,
          bindingType: "vectorize",
          configPath: args.config,
          envName,
          fieldName: "binding",
          index
        });
      }
      bindings.push({
        bindingCategory: "vectorize",
        name: vectorize.binding,
        type: "VectorizeIndex"
      });
    }
    for (const [index, hyperdrive] of (env6.hyperdrive ?? []).entries()) {
      if (!hyperdrive.binding) {
        throwMissingBindingError({
          binding: hyperdrive,
          bindingType: "hyperdrive",
          configPath: args.config,
          envName,
          fieldName: "binding",
          index
        });
      }
      bindings.push({
        bindingCategory: "hyperdrive",
        name: hyperdrive.binding,
        type: "Hyperdrive"
      });
    }
    for (const [index, sendEmail2] of (env6.send_email ?? []).entries()) {
      if (!sendEmail2.name) {
        throwMissingBindingError({
          binding: sendEmail2,
          bindingType: "send_email",
          configPath: args.config,
          envName,
          fieldName: "name",
          index
        });
      }
      bindings.push({
        bindingCategory: "send_email",
        name: sendEmail2.name,
        type: "SendEmail"
      });
    }
    for (const [index, ae3] of (env6.analytics_engine_datasets ?? []).entries()) {
      if (!ae3.binding) {
        throwMissingBindingError({
          binding: ae3,
          bindingType: "analytics_engine_datasets",
          configPath: args.config,
          envName,
          fieldName: "binding",
          index
        });
      }
      bindings.push({
        bindingCategory: "analytics_engine_datasets",
        name: ae3.binding,
        type: "AnalyticsEngineDataset"
      });
    }
    for (const [index, dispatch] of (env6.dispatch_namespaces ?? []).entries()) {
      if (!dispatch.binding) {
        throwMissingBindingError({
          binding: dispatch,
          bindingType: "dispatch_namespaces",
          configPath: args.config,
          envName,
          fieldName: "binding",
          index
        });
      }
      bindings.push({
        bindingCategory: "dispatch_namespaces",
        name: dispatch.binding,
        type: "DispatchNamespace"
      });
    }
    for (const [index, mtls] of (env6.mtls_certificates ?? []).entries()) {
      if (!mtls.binding) {
        throwMissingBindingError({
          binding: mtls,
          bindingType: "mtls_certificates",
          configPath: args.config,
          envName,
          fieldName: "binding",
          index
        });
      }
      bindings.push({
        bindingCategory: "mtls_certificates",
        name: mtls.binding,
        type: "Fetcher"
      });
    }
    for (const [index, queue] of (env6.queues?.producers ?? []).entries()) {
      if (!queue.binding) {
        throwMissingBindingError({
          binding: queue,
          bindingType: "queues.producers",
          configPath: args.config,
          envName,
          fieldName: "binding",
          index
        });
      }
      bindings.push({
        bindingCategory: "queues_producers",
        name: queue.binding,
        type: "Queue"
      });
    }
    for (const [index, secret] of (env6.secrets_store_secrets ?? []).entries()) {
      if (!secret.binding) {
        throwMissingBindingError({
          binding: secret,
          bindingType: "secrets_store_secrets",
          configPath: args.config,
          envName,
          fieldName: "binding",
          index
        });
      }
      bindings.push({
        bindingCategory: "secrets_store_secrets",
        name: secret.binding,
        type: "SecretsStoreSecret"
      });
    }
    for (const [index, helloWorld] of (env6.unsafe_hello_world ?? []).entries()) {
      if (!helloWorld.binding) {
        throwMissingBindingError({
          binding: helloWorld,
          bindingType: "unsafe_hello_world",
          configPath: args.config,
          envName,
          fieldName: "binding",
          index
        });
      }
      bindings.push({
        bindingCategory: "unsafe_hello_world",
        name: helloWorld.binding,
        type: "HelloWorldBinding"
      });
    }
    for (const [index, flagshipBinding] of (env6.flagship ?? []).entries()) {
      if (!flagshipBinding.binding) {
        throwMissingBindingError({
          binding: flagshipBinding,
          bindingType: "flagship",
          configPath: args.config,
          envName,
          fieldName: "binding",
          index
        });
      }
      bindings.push({
        bindingCategory: "flagship",
        name: flagshipBinding.binding,
        type: "Flagship"
      });
    }
    for (const [index, ratelimit] of (env6.ratelimits ?? []).entries()) {
      if (!ratelimit.name) {
        throwMissingBindingError({
          binding: ratelimit,
          bindingType: "ratelimits",
          configPath: args.config,
          envName,
          fieldName: "name",
          index
        });
      }
      bindings.push({
        bindingCategory: "ratelimits",
        name: ratelimit.name,
        type: "RateLimit"
      });
    }
    for (const [index, workerLoader] of (env6.worker_loaders ?? []).entries()) {
      if (!workerLoader.binding) {
        throwMissingBindingError({
          binding: workerLoader,
          bindingType: "worker_loaders",
          configPath: args.config,
          envName,
          fieldName: "binding",
          index
        });
      }
      bindings.push({
        bindingCategory: "worker_loaders",
        name: workerLoader.binding,
        type: "WorkerLoader"
      });
    }
    for (const [index, vpcService] of (env6.vpc_services ?? []).entries()) {
      if (!vpcService.binding) {
        throwMissingBindingError({
          binding: vpcService,
          bindingType: "vpc_services",
          configPath: args.config,
          envName,
          fieldName: "binding",
          index
        });
      }
      bindings.push({
        bindingCategory: "vpc_services",
        name: vpcService.binding,
        type: "Fetcher"
      });
    }
    for (const [index, vpcNetwork] of (env6.vpc_networks ?? []).entries()) {
      if (!vpcNetwork.binding) {
        throwMissingBindingError({
          binding: vpcNetwork,
          bindingType: "vpc_networks",
          configPath: args.config,
          envName,
          fieldName: "binding",
          index
        });
      }
      bindings.push({
        bindingCategory: "vpc_networks",
        name: vpcNetwork.binding,
        type: "Fetcher"
      });
    }
    if (env6.logfwdr?.bindings?.length) {
      bindings.push({
        bindingCategory: "logfwdr",
        name: "LOGFWDR_SCHEMA",
        type: "any"
      });
    }
    if (env6.browser) {
      if (!env6.browser.binding) {
        throwMissingBindingError({
          binding: env6.browser,
          bindingType: "browser",
          configPath: args.config,
          envName,
          fieldName: "binding"
        });
      } else {
        bindings.push({
          bindingCategory: "browser",
          name: env6.browser.binding,
          type: "Fetcher"
        });
      }
    }
    if (env6.ai) {
      if (!env6.ai.binding) {
        throwMissingBindingError({
          binding: env6.ai,
          bindingType: "ai",
          configPath: args.config,
          envName,
          fieldName: "binding"
        });
      } else {
        bindings.push({
          bindingCategory: "ai",
          name: env6.ai.binding,
          type: "Ai"
        });
      }
    }
    if (env6.images) {
      if (!env6.images.binding) {
        throwMissingBindingError({
          binding: env6.images,
          bindingType: "images",
          configPath: args.config,
          envName,
          fieldName: "binding"
        });
      } else {
        bindings.push({
          bindingCategory: "images",
          name: env6.images.binding,
          type: "ImagesBinding"
        });
      }
    }
    if (env6.stream) {
      if (!env6.stream.binding) {
        throwMissingBindingError({
          binding: env6.stream,
          bindingType: "stream",
          configPath: args.config,
          envName,
          fieldName: "binding"
        });
      } else {
        bindings.push({
          bindingCategory: "stream",
          name: env6.stream.binding,
          type: "StreamBinding"
        });
      }
    }
    if (env6.media) {
      if (!env6.media.binding) {
        throwMissingBindingError({
          binding: env6.media,
          bindingType: "media",
          configPath: args.config,
          envName,
          fieldName: "binding"
        });
      } else {
        bindings.push({
          bindingCategory: "media",
          name: env6.media.binding,
          type: "MediaBinding"
        });
      }
    }
    if (env6.version_metadata) {
      if (!env6.version_metadata.binding) {
        throwMissingBindingError({
          binding: env6.version_metadata,
          bindingType: "version_metadata",
          configPath: args.config,
          envName,
          fieldName: "binding"
        });
      } else {
        bindings.push({
          bindingCategory: "version_metadata",
          name: env6.version_metadata.binding,
          type: "WorkerVersionMetadata"
        });
      }
    }
    if (env6.assets?.binding) {
      bindings.push({
        bindingCategory: "assets",
        name: env6.assets.binding,
        type: "Fetcher"
      });
    }
    for (const [index, aiSearchNamespace2] of (env6.ai_search_namespaces ?? []).entries()) {
      if (!aiSearchNamespace2.binding) {
        throwMissingBindingError({
          binding: aiSearchNamespace2,
          bindingType: "ai_search_namespaces",
          configPath: args.config,
          envName,
          fieldName: "binding",
          index
        });
      }
      bindings.push({
        bindingCategory: "ai_search_namespaces",
        name: aiSearchNamespace2.binding,
        type: "AiSearchNamespace"
      });
    }
    for (const [index, aiSearch] of (env6.ai_search ?? []).entries()) {
      if (!aiSearch.binding) {
        throwMissingBindingError({
          binding: aiSearch,
          bindingType: "ai_search",
          configPath: args.config,
          envName,
          fieldName: "binding",
          index
        });
      }
      bindings.push({
        bindingCategory: "ai_search",
        name: aiSearch.binding,
        type: "AiSearchInstance"
      });
    }
    return bindings;
  }
  __name(collectEnvironmentBindings, "collectEnvironmentBindings");
  const { rawConfig } = exports.experimental_readRawConfig(args);
  const topLevelInheritableBindings = [];
  for (const inheritableDef of INHERITABLE_BINDINGS) {
    const bindingName = inheritableDef.getBindingName(rawConfig);
    if (!bindingName) {
      continue;
    }
    topLevelInheritableBindings.push({
      binding: {
        bindingCategory: inheritableDef.bindingCategory,
        name: bindingName,
        type: inheritableDef.type
      },
      definition: inheritableDef
    });
  }
  const topLevelBindings = collectEnvironmentBindings(
    rawConfig,
    TOP_LEVEL_ENV_NAME
  );
  if (topLevelBindings.length > 0) {
    result.set(TOP_LEVEL_ENV_NAME, topLevelBindings);
  }
  for (const [envName, env6] of Object.entries(rawConfig.env ?? {})) {
    const envBindings = collectEnvironmentBindings(env6, envName);
    for (const inheritable3 of topLevelInheritableBindings) {
      const alreadyHasBinding = envBindings.some(
        (b11) => b11.bindingCategory === inheritable3.binding.bindingCategory
      );
      if (alreadyHasBinding) {
        continue;
      }
      if (inheritable3.definition.hasProperty(env6)) {
        continue;
      }
      envBindings.push(inheritable3.binding);
    }
    if (envBindings.length > 0) {
      result.set(envName, envBindings);
    }
  }
  return result;
}
function collectDurableObjectsPerEnvironment(args) {
  const result = /* @__PURE__ */ new Map();
  function collectEnvironmentDOs(env6, envName) {
    const durableObjects = new Array();
    if (!env6?.durable_objects?.bindings) {
      return durableObjects;
    }
    for (const [index, doBinding] of env6.durable_objects.bindings.entries()) {
      if (!doBinding.name) {
        throwMissingBindingError({
          binding: doBinding,
          bindingType: "durable_objects.bindings",
          configPath: args.config,
          envName,
          fieldName: "name",
          index
        });
      }
      durableObjects.push({
        class_name: doBinding.class_name,
        name: doBinding.name,
        script_name: doBinding.script_name
      });
    }
    return durableObjects;
  }
  __name(collectEnvironmentDOs, "collectEnvironmentDOs");
  const { rawConfig } = exports.experimental_readRawConfig(args);
  const topLevelDOs = collectEnvironmentDOs(rawConfig, TOP_LEVEL_ENV_NAME);
  if (topLevelDOs.length > 0) {
    result.set(TOP_LEVEL_ENV_NAME, topLevelDOs);
  }
  for (const [envName, env6] of Object.entries(rawConfig.env ?? {})) {
    const envDOs = collectEnvironmentDOs(env6, envName);
    if (envDOs.length > 0) {
      result.set(envName, envDOs);
    }
  }
  return result;
}
function collectServicesPerEnvironment(args) {
  const result = /* @__PURE__ */ new Map();
  function collectEnvironmentServices(env6, envName) {
    const services = new Array();
    if (!env6?.services) {
      return services;
    }
    for (const [index, service] of env6.services.entries()) {
      if (!service.binding) {
        throwMissingBindingError({
          binding: service,
          bindingType: "services",
          configPath: args.config,
          envName,
          fieldName: "binding",
          index
        });
      }
      services.push({
        binding: service.binding,
        entrypoint: service.entrypoint,
        service: service.service
      });
    }
    return services;
  }
  __name(collectEnvironmentServices, "collectEnvironmentServices");
  const { rawConfig } = exports.experimental_readRawConfig(args);
  const topLevelServices = collectEnvironmentServices(
    rawConfig,
    TOP_LEVEL_ENV_NAME
  );
  if (topLevelServices.length > 0) {
    result.set(TOP_LEVEL_ENV_NAME, topLevelServices);
  }
  for (const [envName, env6] of Object.entries(rawConfig.env ?? {})) {
    const envServices = collectEnvironmentServices(env6, envName);
    if (envServices.length > 0) {
      result.set(envName, envServices);
    }
  }
  return result;
}
function collectWorkflowsPerEnvironment(args) {
  const result = /* @__PURE__ */ new Map();
  function collectEnvironmentWorkflows(env6, envName) {
    const workflows = new Array();
    if (!env6?.workflows) {
      return workflows;
    }
    for (const [index, workflow] of env6.workflows.entries()) {
      if (!workflow.binding) {
        throwMissingBindingError({
          binding: workflow,
          bindingType: "workflows",
          configPath: args.config,
          envName,
          fieldName: "binding",
          index
        });
      }
      workflows.push({
        binding: workflow.binding,
        class_name: workflow.class_name,
        name: workflow.name,
        script_name: workflow.script_name
      });
    }
    return workflows;
  }
  __name(collectEnvironmentWorkflows, "collectEnvironmentWorkflows");
  const { rawConfig } = exports.experimental_readRawConfig(args);
  const topLevelWorkflows = collectEnvironmentWorkflows(
    rawConfig,
    TOP_LEVEL_ENV_NAME
  );
  if (topLevelWorkflows.length > 0) {
    result.set(TOP_LEVEL_ENV_NAME, topLevelWorkflows);
  }
  for (const [envName, env6] of Object.entries(rawConfig.env ?? {})) {
    const envWorkflows = collectEnvironmentWorkflows(env6, envName);
    if (envWorkflows.length > 0) {
      result.set(envName, envWorkflows);
    }
  }
  return result;
}
function collectUnsafeBindingsPerEnvironment(args) {
  const result = /* @__PURE__ */ new Map();
  function collectEnvironmentUnsafe(env6, envName) {
    const unsafeBindings = new Array();
    if (!env6?.unsafe?.bindings) {
      return unsafeBindings;
    }
    for (const [index, binding] of env6.unsafe.bindings.entries()) {
      if (!binding.name) {
        throwMissingBindingError({
          binding,
          bindingType: "unsafe.bindings",
          configPath: args.config,
          envName,
          fieldName: "name",
          index
        });
      }
      unsafeBindings.push({
        name: binding.name,
        type: binding.type
      });
    }
    return unsafeBindings;
  }
  __name(collectEnvironmentUnsafe, "collectEnvironmentUnsafe");
  const { rawConfig } = exports.experimental_readRawConfig(args);
  const topLevelUnsafe = collectEnvironmentUnsafe(
    rawConfig,
    TOP_LEVEL_ENV_NAME
  );
  if (topLevelUnsafe.length > 0) {
    result.set(TOP_LEVEL_ENV_NAME, topLevelUnsafe);
  }
  for (const [envName, env6] of Object.entries(rawConfig.env ?? {})) {
    const envUnsafe = collectEnvironmentUnsafe(env6, envName);
    if (envUnsafe.length > 0) {
      result.set(envName, envUnsafe);
    }
  }
  return result;
}
function collectPipelinesPerEnvironment(args) {
  const result = /* @__PURE__ */ new Map();
  function collectEnvironmentPipelines(env6, envName) {
    const pipelines = new Array();
    if (!env6?.pipelines) {
      return pipelines;
    }
    for (const [index, pipeline] of env6.pipelines.entries()) {
      if (!pipeline.binding) {
        throwMissingBindingError({
          binding: pipeline,
          bindingType: "pipelines",
          configPath: args.config,
          envName,
          fieldName: "binding",
          index
        });
      }
      if (!pipeline.pipeline) {
        throwMissingBindingError({
          binding: pipeline,
          bindingType: "pipelines",
          configPath: args.config,
          envName,
          fieldName: "pipeline",
          index
        });
      }
      pipelines.push({
        binding: pipeline.binding,
        pipeline: pipeline.pipeline
      });
    }
    return pipelines;
  }
  __name(collectEnvironmentPipelines, "collectEnvironmentPipelines");
  const { rawConfig } = exports.experimental_readRawConfig(args);
  const topLevelPipelines = collectEnvironmentPipelines(
    rawConfig,
    TOP_LEVEL_ENV_NAME
  );
  if (topLevelPipelines.length > 0) {
    result.set(TOP_LEVEL_ENV_NAME, topLevelPipelines);
  }
  for (const [envName, env6] of Object.entries(rawConfig.env ?? {})) {
    const envPipelines = collectEnvironmentPipelines(env6, envName);
    if (envPipelines.length > 0) {
      result.set(envName, envPipelines);
    }
  }
  return result;
}
var typesCommand, validateTypesFile, logHorizontalRule, INHERITABLE_BINDINGS;
var init_type_generation = __esm({
  "src/type-generation/index.ts"() {
    init_import_meta_url();
    init_dist();
    init_source();
    init_find();
    init_config();
    init_create_command();
    init_entry();
    init_class_names_sqlite();
    init_dev_vars();
    init_logger();
    init_process_env();
    init_helpers7();
    init_pipeline_schema();
    init_runtime3();
    init_log_runtime_types_message();
    typesCommand = createCommand({
      metadata: {
        description: "\u{1F4DD} Generate types from your Worker configuration\n",
        status: "stable",
        owner: "Workers: Authoring and Testing",
        epilogue: "\u{1F4D6} Learn more at https://developers.cloudflare.com/workers/languages/typescript/#generate-types",
        category: "Compute & AI"
      },
      behaviour: {
        provideConfig: false
      },
      positionalArgs: ["path"],
      args: {
        path: {
          describe: "The path to the declaration file for the generated types",
          type: "string",
          default: DEFAULT_WORKERS_TYPES_FILE_NAME,
          demandOption: false
        },
        "env-interface": {
          type: "string",
          default: "Env",
          describe: "The name of the generated environment interface",
          requiresArg: true
        },
        "include-runtime": {
          type: "boolean",
          default: true,
          describe: "Include runtime types in the generated types"
        },
        "include-env": {
          type: "boolean",
          default: true,
          describe: "Include Env types in the generated types"
        },
        "strict-vars": {
          type: "boolean",
          default: true,
          describe: "Generate literal and union types for variables"
        },
        "experimental-include-runtime": {
          alias: "x-include-runtime",
          type: "string",
          describe: "The path of the generated runtime types file",
          demandOption: false,
          hidden: true,
          deprecated: true
        },
        check: {
          demandOption: false,
          describe: "Check if the types at the provided path are up to date without regenerating them",
          type: "boolean"
        }
      },
      validateArgs(args) {
        if (typeof args.experimentalIncludeRuntime === "string") {
          throw new CommandLineArgsError(
            "You no longer need to use --experimental-include-runtime.\n`wrangler types` will now generate runtime types in the same file as the Env types.\nYou should delete the old runtime types file, and remove it from your tsconfig.json.\nThen rerun `wrangler types`.",
            { telemetryMessage: true }
          );
        }
        const validInterfaceRegex = /^[a-zA-Z][a-zA-Z0-9_]*$/;
        if (!validInterfaceRegex.test(args.envInterface)) {
          throw new CommandLineArgsError(
            `The provided env-interface value ("${args.envInterface}") does not satisfy the validation regex: ${validInterfaceRegex}`,
            {
              telemetryMessage: "The provided env-interface value does not satisfy the validation regex"
            }
          );
        }
        if (!args.path.endsWith(".d.ts")) {
          throw new CommandLineArgsError(
            `The provided output path '${args.path}' does not point to a declaration file - please use the '.d.ts' extension`,
            {
              telemetryMessage: "The provided path does not point to a declaration file"
            }
          );
        }
        validateTypesFile(args.path);
        if (!args.includeEnv && !args.includeRuntime) {
          throw new CommandLineArgsError(
            `You cannot run this command without including either Env or Runtime types`,
            {
              telemetryMessage: true
            }
          );
        }
      },
      async handler(args) {
        let config;
        const secondaryConfigs = [];
        if (Array.isArray(args.config)) {
          config = readConfig({ ...args, config: args.config[0] });
          for (const configPath of args.config.slice(1)) {
            secondaryConfigs.push(readConfig({ config: configPath }));
          }
        } else {
          config = readConfig(args);
        }
        const { envInterface, path: outputPath } = args;
        if (config.configPath == null || (fs29__namespace.statSync(config.configPath, { throwIfNoEntry: false })?.isDirectory() ?? true)) {
          throw new UserError(
            `No config file detected${args.config ? ` (at ${args.config})` : ""}. This command requires a Wrangler configuration file.`,
            { telemetryMessage: "No config file detected" }
          );
        }
        if (args.check) {
          const outOfDate = await checkTypesUpToDate(config, outputPath);
          if (outOfDate) {
            throw new FatalError(
              `Types at ${outputPath} are out of date. Run \`wrangler types\` to regenerate.`,
              1
            );
          }
          logger.log(`\u2728 Types at ${outputPath} are up to date.
`);
          return;
        }
        const secondaryEntries = /* @__PURE__ */ new Map();
        if (secondaryConfigs.length > 0) {
          for (const secondaryConfig of secondaryConfigs) {
            const serviceEntry = await getEntry({}, secondaryConfig, "types");
            if (serviceEntry.name) {
              const key = serviceEntry.name;
              if (secondaryEntries.has(key)) {
                logger.warn(
                  `Configuration file for Worker '${key}' has been passed in more than once using \`--config\`. To remove this warning, only pass each unique Worker config file once.`
                );
              }
              secondaryEntries.set(key, serviceEntry);
              logger.log(
                source_default.dim(
                  `- Found Worker '${key}' at '${path3.relative(process.cwd(), serviceEntry.file)}' (${secondaryConfig.configPath})`
                )
              );
              const { rawConfig } = exports.experimental_readRawConfig({
                config: secondaryConfig.configPath
              });
              for (const envName of Object.keys(rawConfig.env ?? {})) {
                const envConfig = readConfig({
                  config: secondaryConfig.configPath,
                  env: envName
                });
                const envKey = envConfig.name;
                if (envKey && envKey !== key && !secondaryEntries.has(envKey)) {
                  secondaryEntries.set(envKey, serviceEntry);
                }
              }
            } else {
              throw new UserError(
                `Could not resolve entry point for service config '${secondaryConfig}'.`
              );
            }
          }
        }
        const configContainsEntrypoint = config.main !== void 0 || !!config.site?.["entry-point"];
        let entrypoint;
        if (configContainsEntrypoint) {
          try {
            entrypoint = await getEntry({}, config, "types");
          } catch {
            entrypoint = void 0;
          }
        }
        const entrypointFormat = entrypoint?.format ?? "modules";
        const header = ["/* eslint-disable */"];
        const content = [];
        if (args.includeEnv) {
          logger.log(`Generating project types...
`);
          const { envHeader, envTypes } = await generateEnvTypes(
            config,
            args,
            envInterface,
            outputPath,
            entrypoint,
            secondaryEntries
          );
          if (envHeader && envTypes) {
            header.push(envHeader);
            content.push(envTypes);
          }
        }
        if (args.includeRuntime) {
          logger.log("Generating runtime types...\n");
          const { runtimeHeader, runtimeTypes } = await generateRuntimeTypes({
            config,
            outFile: outputPath || void 0
          });
          header.push(runtimeHeader);
          content.push(`// Begin runtime types
${runtimeTypes}`);
          logger.log(source_default.dim("Runtime types generated.\n"));
        }
        logHorizontalRule();
        if (header.length && content.length || entrypointFormat === "modules") {
          fs29__namespace.writeFileSync(
            outputPath,
            `${header.join("\n")}
${content.join("\n")}`,
            "utf-8"
          );
          logger.log(`\u2728 Types written to ${outputPath}
`);
        }
        const tsconfigPath = config.tsconfig ?? path3.join(path3.dirname(config.configPath), "tsconfig.json");
        const tsconfigTypes = readTsconfigTypes(tsconfigPath);
        const { mode } = miniflare.getNodeCompat(
          config.compatibility_date,
          config.compatibility_flags
        );
        if (args.includeRuntime) {
          logRuntimeTypesMessage(tsconfigTypes, mode !== null);
        }
        logger.log(
          `\u{1F4E3} Remember to rerun 'wrangler types' after you change your ${configFileName(config.configPath)} file.
`
        );
      }
    });
    __name(isValidIdentifier2, "isValidIdentifier");
    __name(escapeTypeScriptString, "escapeTypeScriptString");
    __name(constructTypeKey, "constructTypeKey");
    __name(constructTSModuleGlob, "constructTSModuleGlob");
    __name(generateImportSpecifier, "generateImportSpecifier");
    __name(hasConfigSecrets, "hasConfigSecrets");
    __name(generateEnvTypes, "generateEnvTypes");
    __name(generateSimpleEnvTypes, "generateSimpleEnvTypes");
    __name(generatePerEnvironmentTypes, "generatePerEnvironmentTypes");
    __name(generatePerEnvTypeStrings, "generatePerEnvTypeStrings");
    validateTypesFile = /* @__PURE__ */ __name((path84) => {
      const wranglerOverrideDTSPath = file2(path84);
      if (wranglerOverrideDTSPath === void 0) {
        return;
      }
      try {
        const fileContent = fs29__namespace.readFileSync(wranglerOverrideDTSPath, "utf8");
        if (!fileContent.includes("Generated by Wrangler") && !fileContent.includes("Runtime types generated with workerd")) {
          throw new UserError(
            `A non-Wrangler ${path3.basename(path84)} already exists, please rename and try again.`,
            { telemetryMessage: "A non-Wrangler .d.ts file already exists" }
          );
        }
      } catch (error2) {
        if (error2 instanceof Error && !error2.message.includes("not found")) {
          throw error2;
        }
      }
    }, "validateTypesFile");
    __name(generateTypeStrings, "generateTypeStrings");
    __name(readTsconfigTypes, "readTsconfigTypes");
    __name(getEnvConfig, "getEnvConfig");
    __name(collectAllVars, "collectAllVars");
    __name(typeofArray, "typeofArray");
    __name(collectCoreBindings, "collectCoreBindings");
    __name(collectAllDurableObjects, "collectAllDurableObjects");
    __name(collectAllServices, "collectAllServices");
    __name(collectAllWorkflows, "collectAllWorkflows");
    __name(collectAllUnsafeBindings, "collectAllUnsafeBindings");
    __name(collectAllPipelines, "collectAllPipelines");
    logHorizontalRule = /* @__PURE__ */ __name(() => {
      const screenWidth = process.stdout.columns;
      logger.log(source_default.dim("\u2500".repeat(Math.min(screenWidth, 60))));
    }, "logHorizontalRule");
    INHERITABLE_BINDINGS = [
      {
        bindingCategory: "assets",
        getBindingName: /* @__PURE__ */ __name((env6) => env6?.assets?.binding, "getBindingName"),
        hasProperty: /* @__PURE__ */ __name((env6) => env6?.assets !== void 0, "hasProperty"),
        type: "Fetcher"
      }
    ];
    __name(collectVarsPerEnvironment, "collectVarsPerEnvironment");
    __name(collectCoreBindingsPerEnvironment, "collectCoreBindingsPerEnvironment");
    __name(collectDurableObjectsPerEnvironment, "collectDurableObjectsPerEnvironment");
    __name(collectServicesPerEnvironment, "collectServicesPerEnvironment");
    __name(collectWorkflowsPerEnvironment, "collectWorkflowsPerEnvironment");
    __name(collectUnsafeBindingsPerEnvironment, "collectUnsafeBindingsPerEnvironment");
    __name(collectPipelinesPerEnvironment, "collectPipelinesPerEnvironment");
  }
});

// src/user/membership.ts
async function fetchMembershipRoles(complianceConfig, accountTag) {
  const allMemberships = await fetchPagedListResult(
    complianceConfig,
    "/memberships"
  );
  const membership = allMemberships.find((m7) => m7.account.id === accountTag);
  return membership?.roles;
}
var init_membership = __esm({
  "src/user/membership.ts"() {
    init_import_meta_url();
    init_cfetch();
    __name(fetchMembershipRoles, "fetchMembershipRoles");
  }
});

// src/user/whoami.ts
async function whoami(complianceConfig, accountFilter, configAccountId, json) {
  if (json) {
    const user2 = await getUserInfo(complianceConfig);
    if (!user2) {
      throw createFatalError({ loggedIn: false }, true);
    }
    const result = {
      loggedIn: true,
      authType: user2.authType,
      email: user2.email,
      accounts: user2.accounts,
      tokenPermissions: user2.tokenPermissions
    };
    logger.json(result);
    return;
  }
  logger.log("Getting User settings...");
  const user = await getUserInfo(complianceConfig);
  if (!user) {
    logger.log("You are not authenticated. Please run `wrangler login`.");
    return;
  }
  printUserEmail(user);
  if (user.authType === "User API Token" || user.authType === "Account API Token") {
    logger.log(
      "\u2139\uFE0F  The API Token is read from the CLOUDFLARE_API_TOKEN environment variable."
    );
  }
  printComplianceRegion(complianceConfig);
  printAccountList(user);
  printAccountIdMismatchWarning(user, accountFilter, configAccountId);
  printTokenPermissions(user);
  await printMembershipInfo(complianceConfig, user, accountFilter);
}
function printComplianceRegion(complianceConfig) {
  const complianceRegion = getCloudflareComplianceRegion(complianceConfig);
  if (complianceRegion !== "public") {
    const complianceRegionSource = complianceConfig?.compliance_region ? "Wrangler configuration" : "`CLOUDFLARE_COMPLIANCE_REGION` environment variable";
    logger.log(
      `\u{1F30D} The compliance region is set to "${source_default.blue(complianceRegion)}" via the ${complianceRegionSource}.`
    );
  }
}
function printUserEmail(user) {
  if (user.authType === "Account API Token") {
    const accountName = user.accounts[0].name;
    return void logger.log(
      `\u{1F44B} You are logged in with an ${user.authType}, associated with the account ${source_default.blue(accountName)}.`
    );
  }
  if (!user.email) {
    return void logger.log(
      `\u{1F44B} You are logged in with an ${user.authType}. Unable to retrieve email for this user. Are you missing the \`User->User Details->Read\` permission?`
    );
  }
  logger.log(
    `\u{1F44B} You are logged in with an ${user.authType}, associated with the email ${source_default.blue(user.email)}.`
  );
}
function printAccountList(user) {
  logger.table(
    user.accounts.map((account) => ({
      "Account Name": account.name,
      "Account ID": account.id
    }))
  );
}
function printAccountIdMismatchWarning(user, accountFilter, configAccountId) {
  if (!accountFilter || !configAccountId) {
    return;
  }
  if (accountFilter !== configAccountId) {
    return;
  }
  const accountInUserAccounts = user.accounts.some(
    (account) => account.id === accountFilter
  );
  if (!accountInUserAccounts) {
    logger.log(
      formatMessage({
        text: `The \`account_id\` in your Wrangler configuration (${source_default.blue(configAccountId)}) does not match any of your authenticated accounts.`,
        kind: "warning",
        notes: [
          {
            text: "This may be causing the authentication error. Check your Wrangler configuration file and ensure the `account_id` is correct for your account."
          }
        ]
      })
    );
  }
}
function printTokenPermissions(user) {
  const permissions = user.tokenPermissions?.map((scope) => scope.split(":")) ?? [];
  if (user.authType !== "OAuth Token") {
    return void logger.log(
      `\u{1F513} To see token permissions visit https://dash.cloudflare.com/${user.authType === "User API Token" ? "profile" : user.accounts[0].id}/api-tokens.`
    );
  }
  logger.log(`\u{1F513} Token Permissions:`);
  logger.log(`Scope (Access)`);
  const expectedScopes = new Set(DefaultScopeKeys);
  for (const [scope, access4] of permissions) {
    expectedScopes.delete(`${scope}:${access4}`);
    logger.log(`- ${scope} ${access4 ? `(${access4})` : ``}`);
  }
  if (expectedScopes.size > 0) {
    logger.log("");
    logger.log(
      formatMessage({
        text: "Wrangler is missing some expected Oauth scopes. To fix this, run `wrangler login` to refresh your token. The missing scopes are:",
        kind: "warning",
        notes: [...expectedScopes.values()].map((s7) => ({ text: `- ${s7}` }))
      })
    );
  }
}
async function printMembershipInfo(complianceConfig, user, accountFilter) {
  try {
    if (!accountFilter) {
      return;
    }
    const eq = /* @__PURE__ */ __name((a7, b11) => a7.localeCompare(b11, void 0, { sensitivity: "base" }) == 0, "eq");
    const selectedAccount = user.accounts.find(
      (a7) => eq(a7.id, accountFilter) || eq(a7.name, accountFilter)
    );
    if (!selectedAccount) {
      return;
    }
    const membershipRoles = await fetchMembershipRoles(
      complianceConfig,
      selectedAccount.id
    );
    if (!membershipRoles) {
      return;
    }
    logger.log(
      `\u{1F3A2} Membership roles in "${selectedAccount.name}": Contact account super admin to change your permissions.`
    );
    for (const role of membershipRoles) {
      logger.log(`- ${role}`);
    }
  } catch (e10) {
    if (isAuthenticationError(e10)) {
      logger.log(
        `\u{1F3A2} Unable to get membership roles. Make sure you have permissions to read the account. Are you missing the \`User->Memberships->Read\` permission?`
      );
      return;
    } else {
      throw e10;
    }
  }
}
async function getUserInfo(complianceConfig) {
  const apiToken = getAPIToken();
  if (!apiToken) {
    return;
  }
  const authType = await getAuthType(complianceConfig, apiToken);
  const tokenPermissions = await getTokenPermissions();
  return {
    apiToken: "authKey" in apiToken ? apiToken.authKey : apiToken.apiToken,
    authType,
    email: "authEmail" in apiToken ? apiToken.authEmail : await getEmail(complianceConfig),
    accounts: await getAccounts(complianceConfig),
    tokenPermissions
  };
}
async function getAuthType(complianceConfig, credentials) {
  if ("authKey" in credentials) {
    return "Global API Key";
  }
  const usingEnvAuth = !!getAuthFromEnv();
  if (!usingEnvAuth) {
    return "OAuth Token";
  }
  const tokenType = await getTokenType(complianceConfig);
  if (tokenType === "account") {
    return "Account API Token";
  } else {
    return "User API Token";
  }
}
async function getTokenType(complianceConfig) {
  try {
    await fetchResult(complianceConfig, "/user/tokens/verify");
    return "user";
  } catch (e10) {
    if (e10.code === 1e3) {
      return "account";
    }
    throw e10;
  }
}
async function getEmail(complianceConfig) {
  try {
    const { email } = await fetchResult(
      complianceConfig,
      "/user"
    );
    return email;
  } catch (e10) {
    const unauthorizedAccess = 9109;
    if (e10.code === unauthorizedAccess) {
      return void 0;
    } else {
      throw e10;
    }
  }
}
async function getAccounts(complianceConfig) {
  return await fetchPagedListResult(complianceConfig, "/accounts");
}
async function getTokenPermissions() {
  return getScopes();
}
var init_whoami = __esm({
  "src/user/whoami.ts"() {
    init_import_meta_url();
    init_dist();
    init_source();
    init_cfetch();
    init_handle_errors();
    init_logger();
    init_format_message();
    init_membership();
    init_user3();
    __name(whoami, "whoami");
    __name(printComplianceRegion, "printComplianceRegion");
    __name(printUserEmail, "printUserEmail");
    __name(printAccountList, "printAccountList");
    __name(printAccountIdMismatchWarning, "printAccountIdMismatchWarning");
    __name(printTokenPermissions, "printTokenPermissions");
    __name(printMembershipInfo, "printMembershipInfo");
    __name(getUserInfo, "getUserInfo");
    __name(getAuthType, "getAuthType");
    __name(getTokenType, "getTokenType");
    __name(getEmail, "getEmail");
    __name(getAccounts, "getAccounts");
    __name(getTokenPermissions, "getTokenPermissions");
  }
});

// src/user/commands.ts
var loginCommand, logoutCommand, whoamiCommand, authNamespace, authTokenCommand;
var init_commands10 = __esm({
  "src/user/commands.ts"() {
    init_import_meta_url();
    init_dist();
    init_config();
    init_create_command();
    init_logger();
    init_metrics();
    init_user2();
    init_whoami();
    loginCommand = createCommand({
      metadata: {
        description: "\u{1F513} Login to Cloudflare",
        owner: "Workers: Authoring and Testing",
        status: "stable",
        category: "Account"
      },
      behaviour: {
        printConfigWarnings: false
      },
      args: {
        "scopes-list": {
          describe: "List all the available OAuth scopes with descriptions"
        },
        browser: {
          default: true,
          type: "boolean",
          describe: "Automatically open the OAuth link in a browser"
        },
        scopes: {
          describe: "Pick the set of applicable OAuth scopes when logging in",
          array: true,
          type: "string",
          requiresArg: true
        },
        "callback-host": {
          describe: "Use the ip or host address for the temporary login callback server.",
          type: "string",
          requiresArg: false,
          default: "localhost"
        },
        "callback-port": {
          describe: "Use the port for the temporary login callback server.",
          type: "number",
          requiresArg: false,
          default: 8976
        }
      },
      async handler(args, { config }) {
        if (args.scopesList) {
          listScopes();
          return;
        }
        if (args.scopes) {
          if (args.scopes.length === 0) {
            listScopes();
            return;
          }
          if (!validateScopeKeys(args.scopes)) {
            throw new CommandLineArgsError(
              `One of ${args.scopes} is not a valid authentication scope. Run "wrangler login --scopes-list" to see the valid scopes.`
            );
          }
          await login(config, {
            scopes: args.scopes,
            browser: args.browser,
            callbackHost: args.callbackHost,
            callbackPort: args.callbackPort
          });
          return;
        }
        await login(config, {
          browser: args.browser,
          callbackHost: args.callbackHost,
          callbackPort: args.callbackPort
        });
        sendMetricsEvent("login user", {
          sendMetrics: config.send_metrics
        });
      }
    });
    logoutCommand = createCommand({
      metadata: {
        description: "\u{1F6AA} Logout from Cloudflare",
        owner: "Workers: Authoring and Testing",
        status: "stable",
        category: "Account"
      },
      behaviour: {
        printConfigWarnings: false,
        provideConfig: false
      },
      async handler() {
        await logout();
        try {
          const config = readConfig({}, { hideWarnings: true });
          sendMetricsEvent("logout user", {
            sendMetrics: config.send_metrics
          });
        } catch (e10) {
          logger.debug("Could not read config to send logout metrics.", e10);
        }
      }
    });
    whoamiCommand = createCommand({
      metadata: {
        description: "\u{1F575}\uFE0F Retrieve your user information",
        owner: "Workers: Authoring and Testing",
        status: "stable",
        category: "Account"
      },
      behaviour: {
        printBanner: /* @__PURE__ */ __name((args) => !args.json, "printBanner"),
        printConfigWarnings: false
      },
      args: {
        account: {
          type: "string",
          describe: "Show membership information for the given account (id or name)."
        },
        json: {
          type: "boolean",
          describe: "Return user information as JSON. Exits with a non-zero status if not authenticated.",
          default: false
        }
      },
      async handler(args, { config }) {
        await whoami(config, args.account, void 0, args.json);
        sendMetricsEvent("view accounts", {
          sendMetrics: config.send_metrics
        });
      }
    });
    authNamespace = createNamespace({
      metadata: {
        description: "\u{1F510} Manage authentication",
        owner: "Workers: Authoring and Testing",
        status: "stable",
        category: "Account"
      }
    });
    authTokenCommand = createCommand({
      metadata: {
        description: "\u{1F511} Retrieve the current authentication token or credentials",
        owner: "Workers: Authoring and Testing",
        status: "stable"
      },
      behaviour: {
        printBanner: /* @__PURE__ */ __name((args) => !args.json, "printBanner"),
        printConfigWarnings: false
      },
      args: {
        json: {
          type: "boolean",
          description: "Return output as JSON with token type information",
          default: false
        }
      },
      async handler({ json }, { config }) {
        const authFromEnv = getAuthFromEnv();
        let result;
        if (authFromEnv) {
          if ("apiToken" in authFromEnv) {
            result = { type: "api_token", token: authFromEnv.apiToken };
          } else {
            result = {
              type: "api_key",
              key: authFromEnv.authKey,
              email: authFromEnv.authEmail
            };
          }
        } else {
          const token = await getOAuthTokenFromLocalState();
          if (!token) {
            throw new UserError(
              "Not logged in. Please run `wrangler login` to authenticate."
            );
          }
          result = { type: "oauth", token };
        }
        if (json) {
          logger.log(JSON.stringify(result, null, 2));
        } else {
          if (result.type === "api_key") {
            throw new UserError(
              "Cannot output a single token when using CLOUDFLARE_API_KEY and CLOUDFLARE_EMAIL.\nUse --json to get both key and email, or use CLOUDFLARE_API_TOKEN instead."
            );
          }
          logger.log(result.token);
        }
        sendMetricsEvent("retrieve auth token", {
          sendMetrics: config.send_metrics
        });
      }
    });
  }
});

// src/vectorize/client.ts
async function createIndex(config, body, deprecatedV1) {
  const accountId = await requireAuth(config);
  const versionParam = deprecatedV1 ? `` : `/v2`;
  return await fetchResult(
    config,
    `/accounts/${accountId}/vectorize${versionParam}/indexes`,
    {
      method: "POST",
      headers: {
        "content-type": jsonContentType2
      },
      body: JSON.stringify(body)
    }
  );
}
async function deleteIndex(config, indexName, deprecatedV1) {
  const accountId = await requireAuth(config);
  const versionParam = deprecatedV1 ? `` : `/v2`;
  return await fetchResult(
    config,
    `/accounts/${accountId}/vectorize${versionParam}/indexes/${indexName}`,
    {
      method: "DELETE"
    }
  );
}
async function getIndex(config, indexName, deprecatedV1) {
  const accountId = await requireAuth(config);
  const versionParam = deprecatedV1 ? `` : `/v2`;
  return await fetchResult(
    config,
    `/accounts/${accountId}/vectorize${versionParam}/indexes/${indexName}`,
    {
      method: "GET"
    }
  );
}
async function listIndexes(config, deprecatedV1) {
  const accountId = await requireAuth(config);
  const versionParam = deprecatedV1 ? `` : `/v2`;
  return await fetchListResult(
    config,
    `/accounts/${accountId}/vectorize${versionParam}/indexes`,
    {
      method: "GET"
    }
  );
}
async function insertIntoIndexV1(config, indexName, body) {
  const accountId = await requireAuth(config);
  return await fetchResult(
    config,
    `/accounts/${accountId}/vectorize/indexes/${indexName}/insert`,
    {
      method: "POST",
      body
    }
  );
}
async function insertIntoIndex(config, indexName, body) {
  const accountId = await requireAuth(config);
  return await fetchResult(
    config,
    `/accounts/${accountId}/vectorize/v2/indexes/${indexName}/insert`,
    {
      method: "POST",
      body
    }
  );
}
async function upsertIntoIndex(config, indexName, body) {
  const accountId = await requireAuth(config);
  return await fetchResult(
    config,
    `/accounts/${accountId}/vectorize/v2/indexes/${indexName}/upsert`,
    {
      method: "POST",
      body
    }
  );
}
async function queryIndexByVector(config, indexName, vector, options) {
  const accountId = await requireAuth(config);
  return await fetchResult(
    config,
    `/accounts/${accountId}/vectorize/v2/indexes/${indexName}/query`,
    {
      method: "POST",
      headers: {
        "content-type": jsonContentType2
      },
      body: JSON.stringify({
        ...options,
        vector: Array.isArray(vector) ? vector : Array.from(vector)
      })
    }
  );
}
async function queryIndexByVectorId(config, indexName, vectorId, options) {
  const accountId = await requireAuth(config);
  return await fetchResult(
    config,
    `/accounts/${accountId}/vectorize/v2/indexes/${indexName}/query`,
    {
      method: "POST",
      headers: {
        "content-type": jsonContentType2
      },
      body: JSON.stringify({
        ...options,
        vectorId
      })
    }
  );
}
async function getByIds(config, indexName, ids) {
  const accountId = await requireAuth(config);
  return await fetchResult(
    config,
    `/accounts/${accountId}/vectorize/v2/indexes/${indexName}/get_by_ids`,
    {
      method: "POST",
      headers: {
        "content-type": jsonContentType2
      },
      body: JSON.stringify(ids)
    }
  );
}
async function deleteByIds(config, indexName, ids) {
  const accountId = await requireAuth(config);
  return await fetchResult(
    config,
    `/accounts/${accountId}/vectorize/v2/indexes/${indexName}/delete_by_ids`,
    {
      method: "POST",
      headers: {
        "content-type": jsonContentType2
      },
      body: JSON.stringify(ids)
    }
  );
}
async function indexInfo(config, indexName) {
  const accountId = await requireAuth(config);
  return await fetchResult(
    config,
    `/accounts/${accountId}/vectorize/v2/indexes/${indexName}/info`,
    {
      method: "GET"
    }
  );
}
async function createMetadataIndex(config, indexName, payload) {
  const accountId = await requireAuth(config);
  return await fetchResult(
    config,
    `/accounts/${accountId}/vectorize/v2/indexes/${indexName}/metadata_index/create`,
    {
      method: "POST",
      headers: {
        "content-type": jsonContentType2
      },
      body: JSON.stringify(payload)
    }
  );
}
async function listMetadataIndex(config, indexName) {
  const accountId = await requireAuth(config);
  return await fetchResult(
    config,
    `/accounts/${accountId}/vectorize/v2/indexes/${indexName}/metadata_index/list`,
    {
      method: "GET"
    }
  );
}
async function deleteMetadataIndex(config, indexName, payload) {
  const accountId = await requireAuth(config);
  return await fetchResult(
    config,
    `/accounts/${accountId}/vectorize/v2/indexes/${indexName}/metadata_index/delete`,
    {
      method: "POST",
      headers: {
        "content-type": jsonContentType2
      },
      body: JSON.stringify(payload)
    }
  );
}
async function listVectors(config, indexName, options) {
  const accountId = await requireAuth(config);
  const searchParams = new URLSearchParams();
  if (options?.count !== void 0) {
    searchParams.set("count", options.count.toString());
  }
  if (options?.cursor !== void 0) {
    searchParams.set("cursor", options.cursor);
  }
  const queryString = searchParams.toString();
  const url4 = `/accounts/${accountId}/vectorize/v2/indexes/${indexName}/list${queryString ? `?${queryString}` : ""}`;
  return await fetchResult(config, url4, {
    method: "GET"
  });
}
var jsonContentType2;
var init_client13 = __esm({
  "src/vectorize/client.ts"() {
    init_import_meta_url();
    init_cfetch();
    init_user3();
    jsonContentType2 = "application/json; charset=utf-8;";
    __name(createIndex, "createIndex");
    __name(deleteIndex, "deleteIndex");
    __name(getIndex, "getIndex");
    __name(listIndexes, "listIndexes");
    __name(insertIntoIndexV1, "insertIntoIndexV1");
    __name(insertIntoIndex, "insertIntoIndex");
    __name(upsertIntoIndex, "upsertIntoIndex");
    __name(queryIndexByVector, "queryIndexByVector");
    __name(queryIndexByVectorId, "queryIndexByVectorId");
    __name(getByIds, "getByIds");
    __name(deleteByIds, "deleteByIds");
    __name(indexInfo, "indexInfo");
    __name(createMetadataIndex, "createMetadataIndex");
    __name(listMetadataIndex, "listMetadataIndex");
    __name(deleteMetadataIndex, "deleteMetadataIndex");
    __name(listVectors, "listVectors");
  }
});
async function isValidFile(path84) {
  try {
    await fs9.access(path84, fs9.constants.R_OK);
    const fileStat = await fs9.stat(path84);
    return fileStat.isFile() && fileStat.size > 0;
  } catch {
    return false;
  }
}
async function* getBatchFromFile(rl, batchSize = VECTORIZE_MAX_BATCH_SIZE) {
  const batch = [];
  try {
    for await (const line of rl) {
      batch.push(line);
      if (batch.length >= batchSize) {
        yield batch.splice(0, batchSize);
      }
    }
    if (batch.length > 0) {
      yield batch;
    }
  } catch {
    logger.error(
      `\u{1F6A8} Encountered an error while reading batches from the file.`
    );
    return;
  }
}
var deprecatedV1DefaultFlag, VECTORIZE_V1_MAX_BATCH_SIZE, VECTORIZE_MAX_BATCH_SIZE, VECTORIZE_UPSERT_BATCH_SIZE, VECTORIZE_MAX_UPSERT_VECTOR_RECORDS;
var init_common3 = __esm({
  "src/vectorize/common.ts"() {
    init_import_meta_url();
    init_logger();
    deprecatedV1DefaultFlag = false;
    VECTORIZE_V1_MAX_BATCH_SIZE = 1e3;
    VECTORIZE_MAX_BATCH_SIZE = 5e3;
    VECTORIZE_UPSERT_BATCH_SIZE = VECTORIZE_V1_MAX_BATCH_SIZE;
    VECTORIZE_MAX_UPSERT_VECTOR_RECORDS = 1e5;
    __name(isValidFile, "isValidFile");
    __name(getBatchFromFile, "getBatchFromFile");
  }
});

// src/vectorize/create.ts
var vectorizeCreateCommand;
var init_create15 = __esm({
  "src/vectorize/create.ts"() {
    init_import_meta_url();
    init_dist();
    init_create_command();
    init_logger();
    init_add_created_resource_config();
    init_getValidBindingName();
    init_client13();
    init_common3();
    vectorizeCreateCommand = createCommand({
      metadata: {
        description: "Create a Vectorize index",
        status: "stable",
        owner: "Product: Vectorize"
      },
      behaviour: {
        printBanner: /* @__PURE__ */ __name((args) => !args.json, "printBanner")
      },
      args: {
        name: {
          type: "string",
          demandOption: true,
          description: "The name of the Vectorize index to create (must be unique)."
        },
        dimensions: {
          type: "number",
          description: "The dimension size to configure this index for, based on the output dimensions of your ML model."
        },
        metric: {
          type: "string",
          choices: ["euclidean", "cosine", "dot-product"],
          description: "The distance metric to use for searching within the index."
        },
        preset: {
          type: "string",
          choices: [
            "@cf/baai/bge-small-en-v1.5",
            "@cf/baai/bge-base-en-v1.5",
            "@cf/baai/bge-large-en-v1.5",
            "openai/text-embedding-ada-002",
            "cohere/embed-multilingual-v2.0"
          ],
          description: "The name of an preset representing an embeddings model: Vectorize will configure the dimensions and distance metric for you when provided."
        },
        description: {
          type: "string",
          description: "An optional description for this index."
        },
        json: {
          type: "boolean",
          default: false,
          description: "Return output as JSON"
        },
        "deprecated-v1": {
          type: "boolean",
          deprecated: true,
          default: deprecatedV1DefaultFlag,
          description: "Create a deprecated Vectorize V1 index. This is not recommended and indexes created with this option need all other Vectorize operations to have this option enabled."
        },
        ...sharedResourceCreationArgs
      },
      positionalArgs: ["name"],
      async handler(args, { config }) {
        let indexConfig;
        if (args.preset) {
          indexConfig = { preset: args.preset };
          if (!args.json) {
            logger.log(
              `Configuring index based for the embedding model ${args.preset}.`
            );
          }
        } else if (args.dimensions && args.metric) {
          indexConfig = {
            metric: args.metric,
            dimensions: args.dimensions
          };
        } else {
          throw new UserError(
            "\u{1F6A8} You must provide both dimensions and a metric, or a known model preset when creating an index."
          );
        }
        if (args.deprecatedV1 && !args.json) {
          logger.warn(
            "Creation of legacy Vectorize indexes will be blocked by December 2024"
          );
        }
        const index = {
          name: args.name,
          description: args.description,
          config: indexConfig
        };
        if (!args.json) {
          logger.log(`\u{1F6A7} Creating index: '${args.name}'`);
        }
        const indexResult = await createIndex(config, index, args.deprecatedV1);
        let bindingName;
        if (args.deprecatedV1) {
          bindingName = "VECTORIZE_INDEX";
        } else {
          bindingName = "VECTORIZE";
        }
        if (args.json) {
          logger.log(JSON.stringify(indexResult, null, 2));
          return;
        }
        logger.log(
          `\u2705 Successfully created a new Vectorize index: '${indexResult.name}'`
        );
        await createdResourceConfig(
          "vectorize",
          (name2) => ({
            binding: getValidBindingName(name2 ?? bindingName, bindingName),
            index_name: indexResult.name
          }),
          config.configPath,
          args.env,
          args
        );
      }
    });
  }
});

// src/vectorize/createMetadataIndex.ts
var vectorizeCreateMetadataIndexCommand;
var init_createMetadataIndex = __esm({
  "src/vectorize/createMetadataIndex.ts"() {
    init_import_meta_url();
    init_create_command();
    init_logger();
    init_client13();
    vectorizeCreateMetadataIndexCommand = createCommand({
      metadata: {
        description: "Enable metadata filtering on the specified property",
        owner: "Product: Vectorize",
        status: "stable"
      },
      args: {
        name: {
          type: "string",
          demandOption: true,
          description: "The name of the Vectorize index."
        },
        propertyName: {
          type: "string",
          demandOption: true,
          description: "The name of the metadata property to index."
        },
        type: {
          type: "string",
          demandOption: true,
          choices: ["string", "number", "boolean"],
          description: "The type of metadata property to index. Valid types are 'string', 'number' and 'boolean'."
        }
      },
      positionalArgs: ["name"],
      async handler(args, { config }) {
        const reqOptions = {
          propertyName: args.propertyName,
          indexType: args.type
        };
        logger.log(`\u{1F4CB} Creating metadata index...`);
        const mutation = await createMetadataIndex(config, args.name, reqOptions);
        logger.log(
          `\u2705 Successfully enqueued metadata index creation request. Mutation changeset identifier: ${mutation.mutationId}.`
        );
      }
    });
  }
});

// src/vectorize/delete.ts
var vectorizeDeleteCommand;
var init_delete14 = __esm({
  "src/vectorize/delete.ts"() {
    init_import_meta_url();
    init_create_command();
    init_dialogs();
    init_logger();
    init_client13();
    init_common3();
    vectorizeDeleteCommand = createCommand({
      metadata: {
        description: "Delete a Vectorize index",
        status: "stable",
        owner: "Product: Vectorize"
      },
      behaviour: {
        printBanner: true,
        provideConfig: true
      },
      args: {
        name: {
          type: "string",
          demandOption: true,
          description: "The name of the Vectorize index"
        },
        force: {
          type: "boolean",
          alias: "y",
          default: false,
          description: "Skip confirmation"
        },
        "deprecated-v1": {
          type: "boolean",
          default: deprecatedV1DefaultFlag,
          description: "Delete a deprecated Vectorize V1 index."
        }
      },
      positionalArgs: ["name"],
      async handler({ name: name2, force, deprecatedV1 }, { config }) {
        logger.log(`Deleting Vectorize index ${name2}`);
        if (!force) {
          const confirmedDeletion = await confirm(
            `OK to delete the index '${name2}'?`
          );
          if (!confirmedDeletion) {
            logger.log("Deletion cancelled.");
            return;
          }
        }
        await deleteIndex(config, name2, deprecatedV1);
        logger.log(`\u2705 Deleted index ${name2}`);
      }
    });
  }
});

// src/vectorize/deleteByIds.ts
var vectorizeDeleteVectorsCommand;
var init_deleteByIds = __esm({
  "src/vectorize/deleteByIds.ts"() {
    init_import_meta_url();
    init_dist();
    init_create_command();
    init_logger();
    init_client13();
    vectorizeDeleteVectorsCommand = createCommand({
      metadata: {
        description: "Delete vectors in a Vectorize index",
        owner: "Product: Vectorize",
        status: "stable"
      },
      args: {
        name: {
          type: "string",
          demandOption: true,
          description: "The name of the Vectorize index."
        },
        ids: {
          type: "string",
          array: true,
          demandOption: true,
          describe: "Vector identifiers to be deleted from the Vectorize Index.  Example: `--ids a 'b' 1 '2'`"
        }
      },
      positionalArgs: ["name"],
      async handler(args, { config }) {
        if (args.ids.length === 0) {
          throw new UserError(
            "\u{1F6A8} Please provide valid vector identifiers for deletion."
          );
        }
        logger.log(`\u{1F4CB} Deleting vectors...`);
        const ids = {
          ids: args.ids
        };
        const mutation = await deleteByIds(config, args.name, ids);
        logger.log(
          `\u2705 Successfully enqueued ${args.ids.length} vectors into index '${args.name}' for deletion. Mutation changeset identifier: ${mutation.mutationId}.`
        );
      }
    });
  }
});

// src/vectorize/deleteMetadataIndex.ts
var vectorizeDeleteMetadataIndexCommand;
var init_deleteMetadataIndex = __esm({
  "src/vectorize/deleteMetadataIndex.ts"() {
    init_import_meta_url();
    init_create_command();
    init_logger();
    init_client13();
    vectorizeDeleteMetadataIndexCommand = createCommand({
      metadata: {
        description: "Delete metadata indexes",
        owner: "Product: Vectorize",
        status: "stable"
      },
      args: {
        name: {
          type: "string",
          demandOption: true,
          description: "The name of the Vectorize index."
        },
        propertyName: {
          type: "string",
          demandOption: true,
          description: "The name of the metadata property to index."
        }
      },
      positionalArgs: ["name"],
      async handler(args, { config }) {
        const reqOptions = {
          propertyName: args.propertyName
        };
        logger.log(`\u{1F4CB} Deleting metadata index...`);
        const mutation = await deleteMetadataIndex(config, args.name, reqOptions);
        logger.log(
          `\u2705 Successfully enqueued metadata index deletion request. Mutation changeset identifier: ${mutation.mutationId}.`
        );
      }
    });
  }
});

// src/vectorize/get.ts
var vectorizeGetCommand;
var init_get9 = __esm({
  "src/vectorize/get.ts"() {
    init_import_meta_url();
    init_create_command();
    init_logger();
    init_client13();
    init_common3();
    vectorizeGetCommand = createCommand({
      metadata: {
        description: "Get a Vectorize index by name",
        status: "stable",
        owner: "Product: Vectorize"
      },
      behaviour: {
        printBanner: /* @__PURE__ */ __name((args) => !args.json, "printBanner")
      },
      args: {
        name: {
          type: "string",
          demandOption: true,
          description: "The name of the Vectorize index."
        },
        json: {
          type: "boolean",
          default: false,
          description: "Return output as JSON"
        },
        "deprecated-v1": {
          type: "boolean",
          default: deprecatedV1DefaultFlag,
          description: "Fetch a deprecated V1 Vectorize index. This must be enabled if the index was created with V1 option."
        }
      },
      positionalArgs: ["name"],
      async handler({ name: name2, json, deprecatedV1 }, { config }) {
        const index = await getIndex(config, name2, deprecatedV1);
        if (json) {
          logger.log(JSON.stringify(index, null, 2));
          return;
        }
        logger.table([
          {
            name: index.name,
            dimensions: index.config?.dimensions.toString(),
            metric: index.config?.metric,
            description: index.description || "",
            created: index.created_on,
            modified: index.modified_on
          }
        ]);
      }
    });
  }
});

// src/vectorize/getByIds.ts
var vectorizeGetVectorsCommand;
var init_getByIds = __esm({
  "src/vectorize/getByIds.ts"() {
    init_import_meta_url();
    init_dist();
    init_create_command();
    init_logger();
    init_client13();
    vectorizeGetVectorsCommand = createCommand({
      metadata: {
        description: "Get vectors from a Vectorize index",
        owner: "Product: Vectorize",
        status: "stable"
      },
      args: {
        name: {
          type: "string",
          demandOption: true,
          description: "The name of the Vectorize index."
        },
        ids: {
          type: "string",
          array: true,
          demandOption: true,
          describe: "Vector identifiers to be fetched from the Vectorize Index. Example: `--ids a 'b' 1 '2'`"
        }
      },
      positionalArgs: ["name"],
      async handler(args, { config }) {
        if (args.ids.length === 0) {
          throw new UserError("\u{1F6A8} Please provide valid vector identifiers.");
        }
        logger.log(`\u{1F4CB} Fetching vectors...`);
        const ids = {
          ids: args.ids
        };
        const vectors = await getByIds(config, args.name, ids);
        if (vectors.length === 0) {
          logger.warn(
            `The index does not contain vectors corresponding to the provided identifiers`
          );
          return;
        }
        logger.log(JSON.stringify(vectors, null, 2));
      }
    });
  }
});

// src/vectorize/index.ts
var vectorizeNamespace;
var init_vectorize2 = __esm({
  "src/vectorize/index.ts"() {
    init_import_meta_url();
    init_create_command();
    vectorizeNamespace = createNamespace({
      metadata: {
        description: "\u{1F9EE} Manage Vectorize indexes",
        status: "stable",
        owner: "Product: Vectorize",
        category: "Storage & databases"
      }
    });
  }
});

// src/vectorize/info.ts
var vectorizeInfoCommand;
var init_info5 = __esm({
  "src/vectorize/info.ts"() {
    init_import_meta_url();
    init_create_command();
    init_logger();
    init_client13();
    vectorizeInfoCommand = createCommand({
      metadata: {
        description: "Get additional details about the index",
        owner: "Product: Vectorize",
        status: "stable"
      },
      behaviour: {
        printBanner: /* @__PURE__ */ __name((args) => !args.json, "printBanner")
      },
      args: {
        name: {
          type: "string",
          demandOption: true,
          description: "The name of the Vectorize index."
        },
        json: {
          describe: "return output as JSON",
          type: "boolean",
          default: false
        }
      },
      positionalArgs: ["name"],
      async handler(args, { config }) {
        if (!args.json) {
          logger.log(`\u{1F4CB} Fetching index info...`);
        }
        const info = await indexInfo(config, args.name);
        if (args.json) {
          logger.log(JSON.stringify(info, null, 2));
          return;
        }
        logger.table([
          {
            dimensions: info.dimensions.toString(),
            vectorCount: info.vectorCount.toString(),
            processedUpToMutation: info.processedUpToMutation,
            processedUpToDatetime: info.processedUpToDatetime
          }
        ]);
      }
    });
  }
});
var import_undici21, vectorizeInsertCommand;
var init_insert = __esm({
  "src/vectorize/insert.ts"() {
    init_import_meta_url();
    init_dist();
    import_undici21 = __toESM(require_undici());
    init_create_command();
    init_logger();
    init_client13();
    init_common3();
    vectorizeInsertCommand = createCommand({
      metadata: {
        description: "Insert vectors into a Vectorize index",
        owner: "Product: Vectorize",
        status: "stable"
      },
      behaviour: {
        printBanner: /* @__PURE__ */ __name((args) => !args.json, "printBanner")
      },
      args: {
        name: {
          type: "string",
          demandOption: true,
          description: "The name of the Vectorize index."
        },
        file: {
          describe: "A file containing line separated json (ndjson) vector objects.",
          demandOption: true,
          type: "string"
        },
        "batch-size": {
          describe: "Number of vector records to include when sending to the Cloudflare API.",
          type: "number",
          default: VECTORIZE_UPSERT_BATCH_SIZE
        },
        json: {
          describe: "return output as JSON",
          type: "boolean",
          default: false
        },
        "deprecated-v1": {
          type: "boolean",
          default: deprecatedV1DefaultFlag,
          describe: "Insert into a deprecated V1 Vectorize index. This must be enabled if the index was created with the V1 option."
        }
      },
      positionalArgs: ["name"],
      async handler(args, { config }) {
        if (!await isValidFile(args.file)) {
          throw new UserError(
            `\u{1F6A8} Cannot read invalid or empty file: ${args.file}.`
          );
        }
        const rl = S.createInterface({ input: fs29.createReadStream(args.file) });
        if (args.deprecatedV1 && Number(args.batchSize) > VECTORIZE_V1_MAX_BATCH_SIZE) {
          throw new UserError(
            `\u{1F6A8} Vectorize currently limits upload batches to ${VECTORIZE_V1_MAX_BATCH_SIZE} records at a time.`
          );
        } else if (!args.deprecatedV1 && Number(args.batchSize) > VECTORIZE_MAX_BATCH_SIZE) {
          throw new UserError(
            `\u{1F6A8} The global rate limit for the Cloudflare API is 1200 requests per five minutes. Vectorize V2 indexes currently limit upload batches to ${VECTORIZE_MAX_BATCH_SIZE} records at a time to stay within the service limits.`
          );
        }
        let vectorInsertCount = 0;
        for await (const batch of getBatchFromFile(rl, args.batchSize)) {
          const formData = new import_undici21.FormData();
          formData.append(
            "vectors",
            new File([batch.join(`
`)], "vectors.ndjson", {
              type: "application/x-ndjson"
            })
          );
          if (args.deprecatedV1) {
            if (!args.json) {
              logger.log(`\u2728 Uploading vector batch (${batch.length} vectors)`);
            }
            const idxPart = await insertIntoIndexV1(config, args.name, formData);
            vectorInsertCount += idxPart.count;
          } else {
            const mutation = await insertIntoIndex(config, args.name, formData);
            vectorInsertCount += batch.length;
            if (!args.json) {
              logger.log(
                `\u2728 Enqueued ${batch.length} vectors into index '${args.name}' for insertion. Mutation changeset identifier: ${mutation.mutationId}`
              );
            }
          }
          if (vectorInsertCount > VECTORIZE_MAX_UPSERT_VECTOR_RECORDS) {
            if (!args.json) {
              logger.warn(
                `\u{1F6A7} While Vectorize is in beta, we've limited uploads to 100k vectors per run. You may run this again with another batch to upload further`
              );
            }
            break;
          }
        }
        if (args.json) {
          logger.log(
            JSON.stringify({ index: args.name, count: vectorInsertCount }, null, 2)
          );
          return;
        }
        if (args.deprecatedV1) {
          logger.log(
            `\u2705 Successfully inserted ${vectorInsertCount} vectors into index '${args.name}'`
          );
        } else {
          logger.log(
            `\u2705 Successfully enqueued ${vectorInsertCount} vectors into index '${args.name}' for insertion.`
          );
        }
      }
    });
  }
});

// src/vectorize/list.ts
var vectorizeListCommand;
var init_list18 = __esm({
  "src/vectorize/list.ts"() {
    init_import_meta_url();
    init_create_command();
    init_logger();
    init_client13();
    init_common3();
    vectorizeListCommand = createCommand({
      metadata: {
        description: "List your Vectorize indexes",
        status: "stable",
        owner: "Product: Vectorize"
      },
      behaviour: {
        printBanner: /* @__PURE__ */ __name((args) => !args.json, "printBanner")
      },
      args: {
        json: {
          type: "boolean",
          default: false,
          description: "Return output as JSON"
        },
        "deprecated-v1": {
          type: "boolean",
          default: deprecatedV1DefaultFlag,
          description: "List deprecated Vectorize V1 indexes for your account."
        }
      },
      async handler(args, { config }) {
        if (!args.json) {
          logger.log(`\u{1F4CB} Listing Vectorize indexes...`);
        }
        const indexes = await listIndexes(config, args.deprecatedV1);
        if (args.json) {
          logger.log(JSON.stringify(indexes, null, 2));
          return;
        }
        if (indexes.length === 0) {
          logger.warn(`
You haven't created any indexes on this account.

Use 'wrangler vectorize create <name>' to create one, or visit
https://developers.cloudflare.com/vectorize/ to get started.
			`);
          return;
        }
        logger.table(
          indexes.map((index) => ({
            name: index.name,
            dimensions: index.config?.dimensions.toString(),
            metric: index.config?.metric,
            description: index.description ?? "",
            created: index.created_on,
            modified: index.modified_on
          }))
        );
      }
    });
  }
});

// src/vectorize/listMetadataIndex.ts
var vectorizeListMetadataIndexCommand;
var init_listMetadataIndex = __esm({
  "src/vectorize/listMetadataIndex.ts"() {
    init_import_meta_url();
    init_create_command();
    init_logger();
    init_client13();
    vectorizeListMetadataIndexCommand = createCommand({
      metadata: {
        description: "List metadata properties on which metadata filtering is enabled",
        owner: "Product: Vectorize",
        status: "stable"
      },
      behaviour: {
        printBanner: /* @__PURE__ */ __name((args) => !args.json, "printBanner")
      },
      args: {
        name: {
          type: "string",
          demandOption: true,
          description: "The name of the Vectorize index."
        },
        json: {
          describe: "return output as JSON",
          type: "boolean",
          default: false
        }
      },
      positionalArgs: ["name"],
      async handler(args, { config }) {
        if (!args.json) {
          logger.log(`\u{1F4CB} Fetching metadata indexes...`);
        }
        const res = await listMetadataIndex(config, args.name);
        if (args.json) {
          logger.log(JSON.stringify(res.metadataIndexes, null, 2));
          return;
        }
        if (res.metadataIndexes.length === 0) {
          logger.warn(`
You haven't created any metadata indexes on this account.

Use 'wrangler vectorize create-metadata-index <name>' to create one, or visit
https://developers.cloudflare.com/vectorize/ to get started.
		`);
          return;
        }
        logger.table(
          res.metadataIndexes.map((index) => ({
            propertyName: index.propertyName,
            type: index.indexType
          }))
        );
      }
    });
  }
});

// src/vectorize/listVectors.ts
var vectorizeListVectorsCommand;
var init_listVectors = __esm({
  "src/vectorize/listVectors.ts"() {
    init_import_meta_url();
    init_create_command();
    init_logger();
    init_client13();
    vectorizeListVectorsCommand = createCommand({
      metadata: {
        description: "List vector identifiers in a Vectorize index",
        status: "stable",
        owner: "Product: Vectorize",
        examples: [
          {
            command: "wrangler vectorize list-vectors my-index",
            description: "List vector identifiers in the index 'my-index'"
          },
          {
            command: "wrangler vectorize list-vectors my-index --count 50",
            description: "List up to 50 vector identifiers"
          },
          {
            command: "wrangler vectorize list-vectors my-index --cursor abc123",
            description: "Continue listing from a specific cursor position"
          }
        ]
      },
      behaviour: {
        printBanner: /* @__PURE__ */ __name((args) => !args.json, "printBanner")
      },
      args: {
        name: {
          type: "string",
          demandOption: true,
          description: "The name of the Vectorize index"
        },
        count: {
          type: "number",
          description: "Maximum number of vectors to return (1-1000)"
        },
        cursor: {
          type: "string",
          description: "Cursor for pagination to get the next page of results"
        },
        json: {
          type: "boolean",
          default: false,
          description: "Return output as JSON"
        }
      },
      positionalArgs: ["name"],
      async handler(args, { config }) {
        if (!args.json) {
          logger.log(`\u{1F4CB} Listing vectors in index '${args.name}'...`);
        }
        const options = {};
        if (args.count !== void 0) {
          options.count = args.count;
        }
        if (args.cursor) {
          options.cursor = args.cursor;
        }
        const result = await listVectors(config, args.name, options);
        if (args.json) {
          logger.log(JSON.stringify(result, null, 2));
          return;
        }
        if (result.vectors.length === 0) {
          logger.warn("No vectors found in this index.");
          return;
        }
        logger.table(
          result.vectors.map((vector, index) => ({
            "#": (index + 1).toString(),
            "Vector ID": vector.id
          }))
        );
        logger.log(
          `
Showing ${result.count} of ${result.totalCount} total vectors`
        );
        if (result.isTruncated && result.nextCursor) {
          logger.log(`
\u{1F4A1} To get the next page, run:`);
          logger.log(
            `   wrangler vectorize list-vectors ${args.name} --cursor ${result.nextCursor}`
          );
        }
      }
    });
  }
});

// src/vectorize/query.ts
function validateQueryFilterInnerValue(innerValue) {
  return ["string", "number", "boolean"].includes(typeof innerValue);
}
function validateQueryFilter(input) {
  try {
    const parsedObj = input;
    if (typeof parsedObj !== "object" || parsedObj === null || Array.isArray(parsedObj)) {
      return null;
    }
    const result = {};
    for (const field in parsedObj) {
      if (Object.prototype.hasOwnProperty.call(parsedObj, field)) {
        const value = parsedObj[field];
        if (Array.isArray(value)) {
          continue;
        }
        if (typeof value === "object" && value !== null) {
          const innerObj = {};
          let validInnerObj = true;
          for (const op in value) {
            if (Object.prototype.hasOwnProperty.call(value, op)) {
              const innerValue = value[op];
              if (["$eq", "$ne", "$lt", "$lte", "$gt", "gte"].includes(op)) {
                if (!validateQueryFilterInnerValue(innerValue)) {
                  validInnerObj = false;
                }
              } else if (["$in", "$nin"].includes(op)) {
                if (!Array.isArray(innerValue)) {
                  validInnerObj = false;
                } else {
                  if (!innerValue.every(validateQueryFilterInnerValue)) {
                    validInnerObj = false;
                  }
                }
              } else {
                validInnerObj = false;
              }
              innerObj[op] = innerValue;
            }
          }
          if (validInnerObj && Object.keys(innerObj).length > 0) {
            result[field] = innerObj;
          } else if (validInnerObj) {
          }
        } else {
          result[field] = value;
        }
      }
    }
    if (Object.keys(result).length > 0) {
      return result;
    } else {
      return null;
    }
  } catch {
    return null;
  }
}
var vectorizeQueryCommand;
var init_query = __esm({
  "src/vectorize/query.ts"() {
    init_import_meta_url();
    init_dist();
    init_create_command();
    init_logger();
    init_client13();
    vectorizeQueryCommand = createCommand({
      metadata: {
        description: "Query a Vectorize index",
        status: "stable",
        owner: "Product: Vectorize",
        examples: [
          {
            command: `wrangler vectorize query --vector 1 2 3 0.5 1.25 6`,
            description: "Query the Vectorize Index by vector"
          },
          {
            command: `wrangler vectorize query --vector $(jq -r '.[]' data.json | xargs)`,
            description: "Query the Vectorize Index by vector from a json file that contains data in the format [1, 2, 3]."
          },
          {
            command: "wrangler vectorize query --filter '{ 'p1': 'abc', 'p2': { '$ne': true }, 'p3': 10, 'p4': false, 'nested.p5': 'abcd' }'",
            description: "Filter the query results."
          }
        ]
      },
      args: {
        name: {
          type: "string",
          demandOption: true,
          description: "The name of the Vectorize index"
        },
        vector: {
          type: "number",
          array: true,
          description: "Vector to query the Vectorize Index",
          coerce: /* @__PURE__ */ __name((arg) => arg.filter(
            (value) => typeof value === "number" && !isNaN(value)
          ), "coerce")
        },
        "vector-id": {
          type: "string",
          description: "Identifier for a vector in the index against which the index should be queried"
        },
        "top-k": {
          type: "number",
          default: 5,
          description: "The number of results (nearest neighbors) to return"
        },
        "return-values": {
          type: "boolean",
          default: false,
          description: "Specify if the vector values should be included in the results"
        },
        "return-metadata": {
          type: "string",
          choices: ["all", "indexed", "none"],
          default: "none",
          description: "Specify if the vector metadata should be included in the results"
        },
        namespace: {
          type: "string",
          description: "Filter the query results based on this namespace"
        },
        filter: {
          type: "string",
          description: "Filter the query results based on this metadata filter.",
          coerce: /* @__PURE__ */ __name((jsonStr) => {
            try {
              return JSON.parse(jsonStr);
            } catch {
              logger.warn(
                "\u{1F6A8} Invalid query filter. Please use the recommended format."
              );
            }
          }, "coerce")
        }
      },
      positionalArgs: ["name"],
      async handler(args, { config }) {
        const queryOptions = {
          topK: args.topK,
          returnValues: args.returnValues,
          returnMetadata: args.returnMetadata
        };
        if (args.namespace) {
          queryOptions.namespace = args.namespace;
        }
        if (args.filter) {
          const parsedFilter = validateQueryFilter(args.filter);
          if (!parsedFilter) {
            logger.warn(
              "\u{1F6A8} Could not parse the provided query filter. Please use the recommended format."
            );
          } else {
            queryOptions.filter = parsedFilter;
          }
        }
        if (args.vector === void 0 && args.vectorId === void 0 || args.vector !== void 0 && args.vectorId !== void 0) {
          throw new UserError(
            "\u{1F6A8} Either vector or vector-id parameter must be provided, but not both."
          );
        }
        logger.log(`\u{1F4CB} Searching for relevant vectors...`);
        let res;
        if (args.vector !== void 0) {
          res = await queryIndexByVector(
            config,
            args.name,
            args.vector,
            queryOptions
          );
        } else if (args.vectorId !== void 0) {
          res = await queryIndexByVectorId(
            config,
            args.name,
            args.vectorId,
            queryOptions
          );
        }
        if (res === void 0 || res.count === 0) {
          logger.warn(`Could not find any relevant vectors`);
          return;
        }
        logger.log(JSON.stringify(res, null, 2));
      }
    });
    __name(validateQueryFilterInnerValue, "validateQueryFilterInnerValue");
    __name(validateQueryFilter, "validateQueryFilter");
  }
});
var import_undici22, vectorizeUpsertCommand;
var init_upsert = __esm({
  "src/vectorize/upsert.ts"() {
    init_import_meta_url();
    init_dist();
    import_undici22 = __toESM(require_undici());
    init_create_command();
    init_logger();
    init_client13();
    init_common3();
    vectorizeUpsertCommand = createCommand({
      metadata: {
        description: "Upsert vectors into a Vectorize index",
        status: "stable",
        owner: "Product: Vectorize"
      },
      behaviour: {
        printBanner: /* @__PURE__ */ __name((args) => !args.json, "printBanner")
      },
      args: {
        name: {
          type: "string",
          demandOption: true,
          description: "The name of the Vectorize index."
        },
        file: {
          describe: "A file containing line separated json (ndjson) vector objects.",
          demandOption: true,
          type: "string"
        },
        "batch-size": {
          describe: "Number of vector records to include in a single upsert batch when sending to the Cloudflare API.",
          type: "number",
          default: VECTORIZE_MAX_BATCH_SIZE
        },
        json: {
          describe: "return output as JSON",
          type: "boolean",
          default: false
        }
      },
      positionalArgs: ["name"],
      async handler(args, { config }) {
        if (!await isValidFile(args.file)) {
          throw new UserError(
            `\u{1F6A8} Cannot read invalid or empty file: ${args.file}.`
          );
        }
        const rl = S.createInterface({ input: fs29.createReadStream(args.file) });
        if (Number(args.batchSize) > VECTORIZE_MAX_BATCH_SIZE) {
          throw new UserError(
            `\u{1F6A8} The global rate limit for the Cloudflare API is 1200 requests per five minutes. Vectorize indexes currently limit upload batches to ${VECTORIZE_MAX_BATCH_SIZE} records at a time to stay within the service limits.`
          );
        }
        let vectorUpsertCount = 0;
        for await (const batch of getBatchFromFile(rl, args.batchSize)) {
          const formData = new import_undici22.FormData();
          formData.append(
            "vectors",
            new File([batch.join(`
`)], "vectors.ndjson", {
              type: "application/x-ndjson"
            })
          );
          {
            const mutation = await upsertIntoIndex(config, args.name, formData);
            vectorUpsertCount += batch.length;
            if (!args.json) {
              logger.log(
                `\u2728 Enqueued ${batch.length} vectors into index '${args.name}' for upsertion. Mutation changeset identifier: ${mutation.mutationId}`
              );
            }
          }
          if (vectorUpsertCount > VECTORIZE_MAX_UPSERT_VECTOR_RECORDS) {
            if (!args.json) {
              logger.warn(
                `\u{1F6A7} While Vectorize is in beta, we've limited uploads to 100k vectors per run. You may run this again with another batch to upload further`
              );
            }
            break;
          }
        }
        if (args.json) {
          logger.log(
            JSON.stringify({ index: args.name, count: vectorUpsertCount }, null, 2)
          );
          return;
        }
        {
          logger.log(
            `\u2705 Successfully enqueued ${vectorUpsertCount} vectors into index '${args.name}' for upsertion.`
          );
        }
      }
    });
  }
});

// src/versions/index.ts
var versionsNamespace;
var init_versions7 = __esm({
  "src/versions/index.ts"() {
    init_import_meta_url();
    init_create_command();
    versionsNamespace = createNamespace({
      metadata: {
        description: "\u{1FAE7} List, view, upload and deploy Versions of your Worker to Cloudflare",
        status: "stable",
        owner: "Workers: Authoring and Testing",
        category: "Compute & AI"
      }
    });
  }
});
async function confirmLatestDeploymentOverwrite(config, accountId, scriptName) {
  try {
    const latest = await fetchLatestDeployment(config, accountId, scriptName);
    if (latest && latest.versions.length >= 2) {
      const versionCache = /* @__PURE__ */ new Map();
      warn(
        `Your last deployment has multiple versions. To progress that deployment use "wrangler versions deploy" instead.`,
        { shape: shapes.corners.tl, newlineBefore: false }
      );
      newline();
      await printDeployment(
        config,
        accountId,
        scriptName,
        latest,
        "last",
        versionCache
      );
      return inputPrompt({
        type: "confirm",
        question: `"wrangler deploy" will upload a new version and deploy it globally immediately.
Are you sure you want to continue?`,
        label: "",
        defaultValue: isNonInteractiveOrCI(),
        // defaults to true in CI for back-compat
        acceptDefault: isNonInteractiveOrCI()
      });
    }
  } catch (e10) {
    if (!isWorkerNotFoundError(e10)) {
      throw e10;
    }
  }
  return true;
}
async function printLatestDeployment(config, accountId, workerName, versionCache) {
  const latestDeployment = await spinnerWhile({
    startMessage: "Fetching latest deployment",
    async promise() {
      return fetchLatestDeployment(config, accountId, workerName);
    }
  });
  await printDeployment(
    config,
    accountId,
    workerName,
    latestDeployment,
    "current",
    versionCache
  );
}
async function printDeployment(config, accountId, workerName, deployment, adjective, versionCache) {
  const [versions2, traffic] = await fetchDeploymentVersions(
    config,
    accountId,
    workerName,
    deployment,
    versionCache
  );
  logRaw(
    `${leftT} Your ${adjective} deployment has ${versions2.length} version(s):`
  );
  printVersions(versions2, traffic);
}
function printVersions(versions2, traffic) {
  newline();
  log(formatVersions(versions2, traffic));
  newline();
}
function formatVersions(versions2, traffic) {
  return versions2.map((version5) => {
    const trafficString = brandColor(`(${traffic.get(version5.id)}%)`);
    const versionIdString = white(version5.id);
    return gray(`${trafficString} ${versionIdString}
      Created:  ${version5.metadata.created_on}
          Tag:  ${version5.annotations?.["workers/tag"] ?? BLANK_INPUT}
      Message:  ${version5.annotations?.["workers/message"] ?? BLANK_INPUT}`);
  }).join("\n\n");
}
async function promptVersionsToDeploy(complianceConfig, accountId, workerName, defaultSelectedVersionIds, versionCache, yesFlag) {
  const skipDeployableVersionsFetch = yesFlag && defaultSelectedVersionIds.length > 0;
  await spinnerWhile({
    startMessage: "Fetching versions",
    async promise() {
      if (!skipDeployableVersionsFetch) {
        await fetchDeployableVersions(
          complianceConfig,
          accountId,
          workerName,
          versionCache
        );
      }
      await fetchVersions(
        complianceConfig,
        accountId,
        workerName,
        versionCache,
        ...defaultSelectedVersionIds
      );
    }
  });
  const selectableVersions = Array.from(versionCache.values()).sort(
    (a7, b11) => b11.metadata.created_on.localeCompare(a7.metadata.created_on)
    // String#localeCompare should work because they are ISO strings
  );
  const question = "Which version(s) do you want to deploy?";
  const result = await inputPrompt({
    type: "multiselect",
    question,
    options: selectableVersions.map((version5) => ({
      value: version5.id,
      label: version5.id,
      sublabel: gray(`
${ZERO_WIDTH_SPACE}       Created:  ${version5.metadata.created_on}
${ZERO_WIDTH_SPACE}           Tag:  ${version5.annotations?.["workers/tag"] ?? BLANK_INPUT}
${ZERO_WIDTH_SPACE}       Message:  ${version5.annotations?.["workers/message"] ?? BLANK_INPUT}
            `)
    })),
    label: "",
    helpText: "Use SPACE to select/unselect version(s) and ENTER to submit.",
    defaultValue: defaultSelectedVersionIds,
    acceptDefault: yesFlag,
    validate(versionIds) {
      if (versionIds === void 0) {
        return `You must select at least 1 version to deploy.`;
      }
    },
    renderers: {
      submit({ value: versionIds }) {
        assert53__default.default(Array.isArray(versionIds));
        const label = brandColor(
          `${versionIds.length} Worker Version(s) selected`
        );
        const versions2 = versionIds?.map((versionId, i7) => {
          const version5 = versionCache.get(versionId);
          assert53__default.default(version5);
          return `${grayBar}
${leftT} ${white(`    Worker Version ${i7 + 1}: `, version5.id)}
${grayBar} ${gray("             Created: ", version5.metadata.created_on)}
${grayBar} ${gray(
            "                 Tag: ",
            version5.annotations?.["workers/tag"] ?? BLANK_INPUT
          )}
${grayBar} ${gray(
            "             Message: ",
            version5.annotations?.["workers/message"] ?? BLANK_INPUT
          )}`;
        });
        return [
          `${leftT} ${question}`,
          `${leftT} ${label}`,
          ...versions2,
          grayBar
        ];
      }
    }
  });
  return result;
}
async function promptPercentages(versionIds, optionalVersionTraffic, yesFlag, confirmedVersionTraffic = /* @__PURE__ */ new Map()) {
  let n9 = 0;
  for (const versionId of versionIds) {
    n9++;
    const defaultVersionTraffic = assignAndDistributePercentages(
      versionIds,
      new Map([...optionalVersionTraffic, ...confirmedVersionTraffic])
    );
    const defaultValue = defaultVersionTraffic.get(versionId)?.toFixed(3).replace(/\.?0+$/, "");
    const question = `What percentage of traffic should Worker Version ${n9} receive?`;
    const answer = await inputPrompt({
      type: "text",
      question,
      helpText: "(0-100)",
      label: `Traffic`,
      defaultValue,
      initialValue: confirmedVersionTraffic.get(versionId)?.toString(),
      // if the user already entered a value, override the default
      acceptDefault: yesFlag,
      format: /* @__PURE__ */ __name((val2) => `${val2}%`, "format"),
      validate: /* @__PURE__ */ __name((val2) => {
        const input = val2 !== "" ? val2 : defaultValue;
        const percentage2 = parseFloat(input?.toString() ?? "");
        if (isNaN(percentage2) || percentage2 < 0 || percentage2 > 100) {
          return "Please enter a number between 0 and 100.";
        }
      }, "validate"),
      renderers: {
        submit({ value }) {
          const percentage2 = parseFloat(value?.toString() ?? "");
          return [
            leftT + space() + white(question),
            leftT + space() + brandColor(`${percentage2}%`) + gray(" of traffic"),
            leftT
          ];
        }
      }
    });
    const percentage = parseFloat(answer);
    confirmedVersionTraffic.set(versionId, percentage);
  }
  try {
    const { subtotal } = summariseVersionTraffic(
      confirmedVersionTraffic,
      versionIds
    );
    validateTrafficSubtotal(subtotal);
  } catch (err) {
    if (err instanceof UserError) {
      if (yesFlag) {
        throw err;
      }
      error(err.message, void 0, leftT);
      return promptPercentages(
        versionIds,
        optionalVersionTraffic,
        yesFlag,
        confirmedVersionTraffic
      );
    }
    throw err;
  }
  return confirmedVersionTraffic;
}
async function maybePatchSettings(config, accountId, workerName) {
  const maybeUndefinedSettings = {
    logpush: config.logpush,
    tail_consumers: config.tail_consumers,
    streaming_tail_consumers: config.streaming_tail_consumers,
    observability: config.observability
    // TODO reconcile with how regular deploy handles empty state
  };
  const definedSettings = Object.fromEntries(
    Object.entries(maybeUndefinedSettings).filter(
      ([, value]) => value !== void 0
    )
  );
  const hasZeroSettingsToSync = Object.keys(definedSettings).length === 0;
  if (hasZeroSettingsToSync) {
    log("No non-versioned settings to sync. Skipping...");
    return;
  }
  const patchedSettings = await spinnerWhile({
    startMessage: `Syncing non-versioned settings`,
    async promise() {
      return await patchNonVersionedScriptSettings(
        config,
        accountId,
        workerName,
        definedSettings
      );
    }
  });
  const observability = {};
  if (patchedSettings.observability) {
    observability["enabled"] = String(patchedSettings.observability.enabled);
    if (patchedSettings.observability.head_sampling_rate) {
      observability["head_sampling_rate"] = String(
        patchedSettings.observability.head_sampling_rate
      );
    }
  }
  const formattedSettings = formatLabelledValues(
    {
      logpush: String(patchedSettings.logpush ?? "<skipped>"),
      observability: Object.keys(observability).length > 0 ? formatLabelledValues(observability) : "<skipped>",
      tail_consumers: patchedSettings.tail_consumers?.map(
        (tc) => tc.environment ? `${tc.service} (${tc.environment})` : tc.service
      ).join("\n") ?? "<skipped>",
      streaming_tail_consumers: patchedSettings.streaming_tail_consumers?.map((stc) => stc.service).join("\n") ?? "<skipped>"
    },
    {
      labelJustification: "right",
      indentationCount: 4
    }
  );
  log("Synced non-versioned settings:\n" + formattedSettings);
}
function parseVersionSpecs(args) {
  const versionIds = [];
  const percentages = [];
  for (const spec of args.versionSpecs ?? []) {
    const [versionId, percentageString] = spec.split("@");
    const percentage = percentageString === void 0 || percentageString === "" ? null : parseFloat(percentageString);
    if (percentage !== null) {
      if (isNaN(percentage)) {
        throw new UserError(
          `Could not parse percentage value from version-spec positional arg "${spec}"`
        );
      }
      if (percentage < 0 || percentage > 100) {
        throw new UserError(
          `Percentage value (${percentage}%) parsed from version-spec positional arg "${spec}" must be between 0 and 100.`
        );
      }
    }
    versionIds.push(versionId);
    percentages.push(percentage);
  }
  const UUID_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;
  for (const versionId of args.versionId ?? []) {
    if (!UUID_REGEX.test(versionId)) {
      throw new UserError(`Version ID must be a valid UUID (${versionId}).`);
    }
    versionIds.push(versionId);
  }
  for (const percentage of args.percentage ?? []) {
    if (percentage < 0 || percentage > 100) {
      throw new UserError(
        `Percentage value (${percentage}%) must be between 0 and 100.`
      );
    }
    percentages.push(percentage);
  }
  const optionalVersionTraffic = new Map(
    versionIds.map((_5, i7) => [versionIds[i7], percentages[i7] ?? null])
  );
  return optionalVersionTraffic;
}
function assignAndDistributePercentages(versionIds, optionalVersionTraffic) {
  const { subtotal, unspecifiedCount } = summariseVersionTraffic(
    optionalVersionTraffic,
    versionIds
  );
  const unspecifiedPercentageReplacement = unspecifiedCount === 0 || subtotal > 100 ? 0 : (100 - subtotal) / unspecifiedCount;
  const versionTraffic = new Map(
    versionIds.map((versionId) => [
      versionId,
      optionalVersionTraffic.get(versionId) ?? unspecifiedPercentageReplacement
    ])
  );
  return versionTraffic;
}
function summariseVersionTraffic(optionalVersionTraffic, versionIds = Array.from(optionalVersionTraffic.keys())) {
  const versionsWithoutPercentage = versionIds.filter(
    (versionId) => optionalVersionTraffic.get(versionId) == null
  );
  const percentages = versionIds.map(
    (versionId) => optionalVersionTraffic.get(versionId) ?? null
  );
  const percentagesSubtotal = percentages.reduce(
    (sum, x7) => sum + (x7 ?? 0),
    0
  );
  return {
    subtotal: percentagesSubtotal,
    unspecifiedCount: versionsWithoutPercentage.length
  };
}
function validateTrafficSubtotal(subtotal, { max = 100, min = 100, epsilon = EPSILON } = {}) {
  const isAbove = subtotal > max + epsilon;
  const isBelow = subtotal < min - epsilon;
  if (max === min && (isAbove || isBelow)) {
    throw new UserError(
      `Sum of specified percentages (${subtotal}%) must be ${max}%`
    );
  }
  if (isAbove) {
    throw new UserError(
      `Sum of specified percentages (${subtotal}%) must be at most ${max}%`
    );
  }
  if (isBelow) {
    throw new UserError(
      `Sum of specified percentages (${subtotal}%) must be at least ${min}%`
    );
  }
}
var EPSILON, BLANK_INPUT, ZERO_WIDTH_SPACE, versionsDeployCommand;
var init_deploy6 = __esm({
  "src/versions/deploy.ts"() {
    init_import_meta_url();
    init_cli();
    init_colors();
    init_interactive();
    init_dist();
    init_cfetch();
    init_create_command();
    init_is_interactive();
    init_metrics();
    init_output();
    init_user3();
    init_render_labelled_values();
    init_worker_not_found_error();
    init_api();
    EPSILON = 1e-3;
    BLANK_INPUT = "-";
    ZERO_WIDTH_SPACE = "\u200B";
    versionsDeployCommand = createCommand({
      metadata: {
        description: "Safely roll out new Versions of your Worker by splitting traffic between multiple Versions",
        owner: "Workers: Authoring and Testing",
        status: "stable"
      },
      behaviour: {
        useConfigRedirectIfAvailable: true,
        warnIfMultipleEnvsConfiguredButNoneSpecified: true
      },
      args: {
        name: {
          describe: "Name of the worker",
          type: "string",
          requiresArg: true
        },
        "version-id": {
          describe: "Worker Version ID(s) to deploy",
          type: "string",
          array: true,
          requiresArg: true
        },
        percentage: {
          describe: "Percentage of traffic to split between Worker Version(s) (0-100)",
          array: true,
          type: "number",
          requiresArg: true
        },
        "version-specs": {
          describe: "Shorthand notation to deploy Worker Version(s) [<version-id>@<percentage>..]",
          type: "string",
          array: true
        },
        message: {
          describe: "Description of this deployment (optional)",
          type: "string",
          requiresArg: true
        },
        yes: {
          alias: "y",
          describe: "Automatically accept defaults to prompts",
          type: "boolean",
          default: false
        },
        "dry-run": {
          describe: "Don't actually deploy",
          type: "boolean",
          default: false
        },
        "max-versions": {
          hidden: true,
          // experimental, not supported long-term
          describe: "Maximum allowed versions to select",
          type: "number",
          default: 2
          // (when server-side limitation is lifted, we can update this default or just remove the option entirely)
        }
      },
      positionalArgs: ["version-specs"],
      handler: /* @__PURE__ */ __name(async function versionsDeployHandler(args, { config }) {
        sendMetricsEvent("deploy worker versions", {
          sendMetrics: config.send_metrics
        });
        const accountId = await requireAuth(config);
        const workerName = args.name ?? config.name;
        if (workerName === void 0) {
          throw new UserError(
            'You need to provide a name of your worker. Either pass it as a cli arg with `--name <name>` or in your config file as `name = "<name>"`',
            { telemetryMessage: true }
          );
        }
        const versionCache = /* @__PURE__ */ new Map();
        const optionalVersionTraffic = parseVersionSpecs(args);
        startSection(
          "Deploy Worker Versions",
          "by splitting traffic between multiple versions",
          true
        );
        await printLatestDeployment(config, accountId, workerName, versionCache);
        const confirmedVersionsToDeploy = await promptVersionsToDeploy(
          config,
          accountId,
          workerName,
          [...optionalVersionTraffic.keys()],
          versionCache,
          args.yes
        );
        if (confirmedVersionsToDeploy.length === 0) {
          throw new UserError("You must select at least 1 version to deploy.", {
            telemetryMessage: true
          });
        }
        if (confirmedVersionsToDeploy.length > args.maxVersions) {
          throw new UserError(
            `You must select at most ${args.maxVersions} versions to deploy.`,
            { telemetryMessage: "You must select at most 2 versions to deploy.`" }
          );
        }
        const confirmedVersionTraffic = await promptPercentages(
          confirmedVersionsToDeploy,
          optionalVersionTraffic,
          args.yes
        );
        const message = await inputPrompt({
          type: "text",
          label: "Deployment message",
          defaultValue: args.message,
          acceptDefault: args.yes,
          question: "Add a deployment message",
          helpText: "(optional)"
        });
        if (args.dryRun) {
          cancel("--dry-run: exiting");
          return;
        }
        const start = Date.now();
        const { id: deploymentId } = await spinnerWhile({
          startMessage: `Deploying ${confirmedVersionsToDeploy.length} version(s)`,
          promise() {
            return createDeployment(
              config,
              accountId,
              workerName,
              confirmedVersionTraffic,
              message
            );
          }
        });
        await maybePatchSettings(config, accountId, workerName);
        const elapsedMilliseconds = Date.now() - start;
        const elapsedSeconds = elapsedMilliseconds / 1e3;
        const elapsedString = `${elapsedSeconds.toFixed(2)} sec`;
        const trafficSummaryList = Array.from(confirmedVersionTraffic).map(
          ([versionId, percentage]) => `version ${versionId} at ${percentage}%`
        );
        const trafficSummaryString = new Intl.ListFormat("en-US").format(
          trafficSummaryList
        );
        success(
          `Deployed ${workerName} ${trafficSummaryString} (${elapsedString})`
        );
        let workerTag = null;
        try {
          const serviceMetaData = await fetchResult(config, `/accounts/${accountId}/workers/services/${workerName}`);
          workerTag = serviceMetaData.default_environment.script.tag;
        } catch {
        }
        writeOutput({
          type: "version-deploy",
          version: 1,
          worker_name: workerName,
          worker_tag: workerTag,
          // NOTE this deploymentId is related to the gradual rollout of the versions given in the version_traffic.
          deployment_id: deploymentId,
          version_traffic: confirmedVersionTraffic
        });
      }, "versionsDeployHandler")
    });
    __name(confirmLatestDeploymentOverwrite, "confirmLatestDeploymentOverwrite");
    __name(printLatestDeployment, "printLatestDeployment");
    __name(printDeployment, "printDeployment");
    __name(printVersions, "printVersions");
    __name(formatVersions, "formatVersions");
    __name(promptVersionsToDeploy, "promptVersionsToDeploy");
    __name(promptPercentages, "promptPercentages");
    __name(maybePatchSettings, "maybePatchSettings");
    __name(parseVersionSpecs, "parseVersionSpecs");
    __name(assignAndDistributePercentages, "assignAndDistributePercentages");
    __name(summariseVersionTraffic, "summariseVersionTraffic");
    __name(validateTrafficSubtotal, "validateTrafficSubtotal");
  }
});

// src/versions/deployments/index.ts
var deploymentsNamespace;
var init_deployments5 = __esm({
  "src/versions/deployments/index.ts"() {
    init_import_meta_url();
    init_create_command();
    deploymentsNamespace = createNamespace({
      metadata: {
        description: "\u{1F6A2} List and view the current and past deployments for your Worker",
        owner: "Workers: Authoring and Testing",
        status: "stable",
        category: "Compute & AI"
      }
    });
  }
});

// src/versions/list.ts
function getVersionSource(version5) {
  return version5.annotations?.["workers/triggered_by"] === void 0 ? formatSource(version5.metadata.source) : formatTrigger(version5.annotations["workers/triggered_by"]);
}
function formatSource(source) {
  switch (source) {
    case "api":
      return "API \u{1F4E1}";
    case "dash":
      return "Dashboard \u{1F5A5}\uFE0F";
    case "wrangler":
      return "Wrangler \u{1F920}";
    case "terraform":
      return "Terraform \u{1F3D7}\uFE0F";
    default:
      return `Other (${source})`;
  }
}
function formatTrigger(trigger) {
  switch (trigger) {
    case "upload":
      return "Upload";
    case "secret":
      return "Secret Change";
    case "rollback":
      return "Rollback";
    case "promotion":
      return "Promotion";
    default:
      return `Unknown (${trigger})`;
  }
}
var BLANK_INPUT2, versionsListCommand;
var init_list19 = __esm({
  "src/versions/list.ts"() {
    init_import_meta_url();
    init_cli();
    init_dist();
    init_create_command();
    init_metrics();
    init_user3();
    init_render_labelled_values();
    init_api();
    BLANK_INPUT2 = "-";
    versionsListCommand = createCommand({
      metadata: {
        description: "List the 10 most recent Versions of your Worker",
        owner: "Workers: Authoring and Testing",
        status: "stable"
      },
      behaviour: {
        printBanner: /* @__PURE__ */ __name((args) => !args.json, "printBanner")
      },
      args: {
        name: {
          describe: "Name of the Worker",
          type: "string",
          requiresArg: true
        },
        json: {
          describe: "Display output as JSON",
          type: "boolean",
          default: false
        }
      },
      handler: /* @__PURE__ */ __name(async function versionsListHandler(args, { config }) {
        sendMetricsEvent(
          "list worker versions",
          { json: args.json },
          {
            sendMetrics: config.send_metrics
          }
        );
        const accountId = await requireAuth(config);
        const workerName = args.name ?? config.name;
        if (workerName === void 0) {
          throw new UserError(
            'You need to provide a name of your worker. Either pass it as a cli arg with `--name <name>` or in your config file as `name = "<name>"`',
            { telemetryMessage: true }
          );
        }
        const versionCache = /* @__PURE__ */ new Map();
        const versions2 = (await fetchDeployableVersions(config, accountId, workerName, versionCache)).sort(
          (a7, b11) => a7.metadata.created_on.localeCompare(b11.metadata.created_on)
        );
        if (args.json) {
          logRaw(JSON.stringify(versions2, null, 2));
          return;
        }
        for (const version5 of versions2) {
          const formattedVersion = formatLabelledValues({
            "Version ID": version5.id,
            Created: new Date(version5.metadata["created_on"]).toISOString(),
            Author: version5.metadata.author_email,
            Source: getVersionSource(version5),
            Tag: version5.annotations?.["workers/tag"] || BLANK_INPUT2,
            Message: version5.annotations?.["workers/message"] || BLANK_INPUT2
          });
          logRaw(formattedVersion);
          logRaw(``);
        }
      }, "versionsListHandler")
    });
    __name(getVersionSource, "getVersionSource");
    __name(formatSource, "formatSource");
    __name(formatTrigger, "formatTrigger");
  }
});
function getDeploymentSource(deployment) {
  return getVersionSource({
    metadata: { source: deployment.source },
    annotations: deployment.annotations
  });
}
var BLANK_INPUT3, deploymentsListCommand;
var init_list20 = __esm({
  "src/versions/deployments/list.ts"() {
    init_import_meta_url();
    init_cli();
    init_colors();
    init_dist();
    init_create_command();
    init_metrics();
    init_user3();
    init_render_labelled_values();
    init_api();
    init_list19();
    BLANK_INPUT3 = "-";
    deploymentsListCommand = createCommand({
      metadata: {
        description: "Displays the 10 most recent deployments of your Worker",
        owner: "Workers: Authoring and Testing",
        status: "stable"
      },
      args: {
        name: {
          describe: "Name of the Worker",
          type: "string",
          requiresArg: true
        },
        json: {
          describe: "Display output as JSON",
          type: "boolean",
          default: false
        }
      },
      behaviour: {
        printBanner: /* @__PURE__ */ __name((args) => !args.json, "printBanner")
      },
      handler: /* @__PURE__ */ __name(async function versionsDeploymentsListHandler(args, { config }) {
        sendMetricsEvent(
          "list versioned deployments",
          { json: args.json },
          {
            sendMetrics: config.send_metrics
          }
        );
        const accountId = await requireAuth(config);
        const workerName = args.name ?? config.name;
        if (workerName === void 0) {
          throw new UserError(
            'You need to provide a name for your Worker. Either pass it as a cli arg with `--name <name>` or in your configuration file as `name = "<name>"`',
            { telemetryMessage: true }
          );
        }
        const deployments = (await fetchLatestDeployments(config, accountId, workerName)).sort((a7, b11) => a7.created_on.localeCompare(b11.created_on));
        if (args.json) {
          logRaw(JSON.stringify(deployments, null, 2));
          return;
        }
        const versionCache = /* @__PURE__ */ new Map();
        const versionIds = deployments.flatMap(
          (d8) => d8.versions.map((v8) => v8.version_id)
        );
        await fetchVersions(
          config,
          accountId,
          workerName,
          versionCache,
          ...versionIds
        );
        const formattedDeployments = deployments.map((deployment) => {
          const formattedVersions = deployment.versions.map((traffic) => {
            const version5 = versionCache.get(traffic.version_id);
            assert53__default.default(version5);
            const percentage = brandColor(`(${traffic.percentage}%)`);
            const details = formatLabelledValues(
              {
                Created: new Date(version5.metadata["created_on"]).toISOString(),
                Tag: version5.annotations?.["workers/tag"] || BLANK_INPUT3,
                Message: version5.annotations?.["workers/message"] || BLANK_INPUT3
              },
              {
                indentationCount: 4,
                labelJustification: "right",
                formatLabel: /* @__PURE__ */ __name((label) => gray(label + ":"), "formatLabel"),
                formatValue: /* @__PURE__ */ __name((value) => gray(value), "formatValue")
              }
            );
            return `${percentage} ${version5.id}
${details}`;
          });
          return formatLabelledValues({
            // explicitly not outputting Deployment ID
            Created: new Date(deployment.created_on).toISOString(),
            Author: deployment.author_email,
            Source: getDeploymentSource(deployment),
            Message: deployment.annotations?.["workers/message"] || BLANK_INPUT3,
            "Version(s)": formattedVersions.join("\n\n")
          });
        });
        logRaw(formattedDeployments.join("\n\n"));
      }, "versionsDeploymentsListHandler")
    });
    __name(getDeploymentSource, "getDeploymentSource");
  }
});
var BLANK_INPUT4, deploymentsStatusCommand;
var init_status3 = __esm({
  "src/versions/deployments/status.ts"() {
    init_import_meta_url();
    init_cli();
    init_colors();
    init_dist();
    init_create_command();
    init_metrics();
    init_user3();
    init_render_labelled_values();
    init_api();
    init_list20();
    BLANK_INPUT4 = "-";
    deploymentsStatusCommand = createCommand({
      metadata: {
        description: "View the current state of your production",
        owner: "Workers: Authoring and Testing",
        status: "stable"
      },
      args: {
        name: {
          describe: "Name of the Worker",
          type: "string",
          requiresArg: true
        },
        json: {
          describe: "Display output as JSON",
          type: "boolean",
          default: false
        }
      },
      behaviour: {
        printBanner: /* @__PURE__ */ __name((args) => !args.json, "printBanner")
      },
      handler: /* @__PURE__ */ __name(async function versionsDeploymentsStatusHandler(args, { config }) {
        sendMetricsEvent("view latest versioned deployment", {
          sendMetrics: config.send_metrics
        });
        const accountId = await requireAuth(config);
        const workerName = args.name ?? config.name;
        if (workerName === void 0) {
          throw new UserError(
            'You need to provide a name for your Worker. Either pass it as a cli arg with `--name <name>` or in your configuration file as `name = "<name>"`',
            { telemetryMessage: true }
          );
        }
        const latestDeployment = await fetchLatestDeployment(
          config,
          accountId,
          workerName
        );
        if (!latestDeployment) {
          throw new UserError(`The Worker ${workerName} has no deployments.`, {
            telemetryMessage: "The Worker has no deployments"
          });
        }
        if (args.json) {
          logRaw(JSON.stringify(latestDeployment, null, 2));
          return;
        }
        const versionCache = /* @__PURE__ */ new Map();
        const versionIds = latestDeployment.versions.map((v8) => v8.version_id);
        await fetchVersions(
          config,
          accountId,
          workerName,
          versionCache,
          ...versionIds
        );
        const formattedVersions = latestDeployment.versions.map((traffic) => {
          const version5 = versionCache.get(traffic.version_id);
          assert53__default.default(version5);
          const percentage = brandColor(`(${traffic.percentage}%)`);
          const details = formatLabelledValues(
            {
              Created: new Date(version5.metadata["created_on"]).toISOString(),
              Tag: version5.annotations?.["workers/tag"] || BLANK_INPUT4,
              Message: version5.annotations?.["workers/message"] || BLANK_INPUT4
            },
            {
              indentationCount: 4,
              labelJustification: "right",
              formatLabel: /* @__PURE__ */ __name((label) => gray(label + ":"), "formatLabel"),
              formatValue: /* @__PURE__ */ __name((value) => gray(value), "formatValue")
            }
          );
          return `${percentage} ${version5.id}
${details}`;
        });
        const formattedDeployment = formatLabelledValues({
          // explicitly not outputting Deployment ID
          Created: new Date(latestDeployment.created_on).toISOString(),
          Author: latestDeployment.author_email,
          Source: getDeploymentSource(latestDeployment),
          Message: latestDeployment.annotations?.["workers/message"] || BLANK_INPUT4,
          "Version(s)": formattedVersions.join("\n\n")
        });
        logRaw(formattedDeployment);
      }, "versionsDeploymentsStatusHandler")
    });
  }
});

// src/versions/deployments/view.ts
var deploymentsViewCommand;
var init_view2 = __esm({
  "src/versions/deployments/view.ts"() {
    init_import_meta_url();
    init_dist();
    init_create_command();
    deploymentsViewCommand = createCommand({
      metadata: {
        description: "View a deployment of a Worker",
        owner: "Workers: Authoring and Testing",
        status: "stable",
        hidden: true
      },
      args: {
        name: {
          describe: "Name of the Worker",
          type: "string",
          requiresArg: true
        },
        ["deployment-id"]: {
          describe: "Deprecated. Deployment ID is now referred to as Version ID. Please use `wrangler versions view [version-id]` instead.",
          type: "string",
          requiresArg: true
        }
      },
      positionalArgs: ["deployment-id"],
      handler: /* @__PURE__ */ __name(async function versionsDeploymentsViewHandler(args) {
        if (args.deploymentId === void 0) {
          throw new UserError(
            "`wrangler deployments view` has been renamed `wrangler deployments status`. Please use that command instead."
          );
        } else {
          throw new UserError(
            "`wrangler deployments view <deployment-id>` has been renamed `wrangler versions view [version-id]`. Please use that command instead."
          );
        }
      }, "versionsDeploymentsViewHandler")
    });
  }
});

// src/versions/rollback/index.ts
async function fetchDefaultRollbackVersionId(config, accountId, workerName) {
  const deployments = await fetchLatestDeployments(
    config,
    accountId,
    workerName
  );
  deployments.sort((a7, b11) => b11.created_on.localeCompare(a7.created_on));
  deployments.shift();
  for (const deployment of deployments) {
    const stableVersion = deployment.versions.find(
      ({ percentage }) => percentage === 100
    );
    if (stableVersion) {
      return stableVersion.version_id;
    }
  }
  throw new Error(
    "Could not find stable Worker Version to rollback to. Please try again with an explicit Version ID."
  );
}
var CANNOT_ROLLBACK_WITH_MODIFIED_SECERT_CODE, versionsRollbackCommand;
var init_rollback = __esm({
  "src/versions/rollback/index.ts"() {
    init_import_meta_url();
    init_cli();
    init_interactive();
    init_dist();
    init_create_command();
    init_dialogs();
    init_logger();
    init_user3();
    init_api();
    init_deploy6();
    CANNOT_ROLLBACK_WITH_MODIFIED_SECERT_CODE = 10220;
    versionsRollbackCommand = createCommand({
      args: {
        "version-id": {
          describe: "The ID of the Worker Version to rollback to",
          type: "string",
          demandOption: false
        },
        name: {
          describe: "The name of your Worker",
          type: "string"
        },
        message: {
          alias: "m",
          describe: "The reason for this rollback",
          type: "string",
          default: void 0
        },
        yes: {
          alias: "y",
          describe: "Automatically accept defaults to prompts",
          type: "boolean",
          default: false
        }
      },
      positionalArgs: ["version-id"],
      metadata: {
        description: "\u{1F519} Rollback a deployment for a Worker",
        owner: "Workers: Authoring and Testing",
        status: "stable",
        category: "Compute & AI"
      },
      handler: /* @__PURE__ */ __name(async function handleRollback(args, { config }) {
        const accountId = await requireAuth(config);
        const workerName = args.name ?? config.name;
        if (workerName === void 0) {
          throw new UserError(
            'You need to provide a name for your Worker. Either pass it as a cli arg with `--name <name>` or in your configuration file as `name = "<name>"`',
            { telemetryMessage: true }
          );
        }
        await printLatestDeployment(config, accountId, workerName, /* @__PURE__ */ new Map());
        const versionId = args.versionId ?? await spinnerWhile({
          promise: fetchDefaultRollbackVersionId(config, accountId, workerName),
          startMessage: "Finding latest stable Worker Version to rollback to",
          endMessage: ""
        });
        const message = await prompt(
          "Please provide an optional message for this rollback (120 characters max)",
          {
            defaultValue: args.message ?? "Rollback"
          }
        );
        const version5 = await fetchVersion(
          config,
          accountId,
          workerName,
          versionId
        );
        warn(
          `You are about to rollback to Worker Version ${versionId}.
This will immediately replace the current deployment and become the active deployment across all your deployed triggers.
However, your local development environment will not be affected by this rollback.
Rolling back to a previous deployment will not rollback any of the bound resources (Durable Object, D1, R2, KV, etc).`,
          { multiline: true, shape: shapes.leftT }
        );
        const rollbackTraffic = /* @__PURE__ */ new Map([[versionId, 100]]);
        printVersions([version5], rollbackTraffic);
        const confirmed = await confirm(
          "Are you sure you want to deploy this Worker Version to 100% of traffic?",
          { defaultValue: true }
        );
        if (!confirmed) {
          cancel("Aborting rollback...");
          return;
        }
        logger.log("Performing rollback...");
        try {
          await createDeployment(
            config,
            accountId,
            workerName,
            rollbackTraffic,
            message
          );
        } catch (e10) {
          if (e10 instanceof APIError && e10.code === CANNOT_ROLLBACK_WITH_MODIFIED_SECERT_CODE) {
            const errorMsg = e10.notes[0].text.replace(
              ` [code: ${CANNOT_ROLLBACK_WITH_MODIFIED_SECERT_CODE}]`,
              ""
            );
            const targetString = "The following secrets have changed:";
            const changedSecrets = errorMsg.substring(errorMsg.indexOf(targetString) + targetString.length + 1).split(", ");
            const secretConfirmation = await confirm(
              `The following secrets have changed since version ${versionId} was deployed. Please confirm you wish to continue with the rollback
` + changedSecrets.map((secret) => `  * ${secret}`).join("\n")
            );
            if (secretConfirmation) {
              await createDeployment(
                config,
                accountId,
                workerName,
                rollbackTraffic,
                message,
                true
              );
            } else {
              cancel("Aborting rollback...");
            }
          } else {
            throw e10;
          }
        }
        success(
          `Worker Version ${versionId} has been deployed to 100% of traffic.`
        );
        logger.log("\nCurrent Version ID: " + versionId);
      }, "handleRollback")
    });
    __name(fetchDefaultRollbackVersionId, "fetchDefaultRollbackVersionId");
  }
});

// src/versions/secrets/index.ts
async function copyWorkerVersionWithNewSecrets({
  config,
  accountId,
  scriptName,
  versionId,
  secrets,
  versionMessage,
  versionTag,
  sendMetrics,
  unsafeMetadata,
  overrideAllSecrets
}) {
  const versionInfo = await fetchResult(
    config,
    `/accounts/${accountId}/workers/scripts/${scriptName}/versions/${versionId}`
  );
  const { mainModule, modules, sourceMaps } = await parseModules(
    config,
    accountId,
    scriptName,
    versionId
  );
  const scriptSettings = await fetchResult(
    config,
    `/accounts/${accountId}/workers/scripts/${scriptName}/script-settings`
  );
  const bindings = Object.fromEntries(
    versionInfo.resources.bindings.filter((binding) => binding.type !== "secret_text").map((binding) => {
      return [
        binding.name,
        {
          // Inherit all of the existing bindings. This will be sent to the API as "type": "inherit"
          // We inherit rather than just sending the actual bindings to reduce the risk of
          // something going wrong in the round trip from the API to Wrangler and back
          type: "inherit"
        }
      ];
    })
  );
  for (const secret of secrets) {
    if (secret.inherit) {
      bindings[secret.name] = {
        type: "inherit"
      };
    } else {
      bindings[secret.name] = {
        type: "secret_text",
        value: secret.value
      };
    }
  }
  const keepBindings = ["secret_key"];
  if (!overrideAllSecrets) {
    keepBindings.push("secret_text");
  }
  const worker = {
    main: mainModule,
    modules,
    containers: config.containers,
    sourceMaps,
    migrations: void 0,
    compatibility_date: versionInfo.resources.script_runtime.compatibility_date,
    compatibility_flags: versionInfo.resources.script_runtime.compatibility_flags,
    keepVars: false,
    // we're re-uploading everything
    keepSecrets: false,
    // handled in keepBindings
    keepBindings,
    logpush: scriptSettings.logpush,
    placement: versionInfo.resources.script.placement_mode === "smart" ? { mode: "smart" } : void 0,
    tail_consumers: scriptSettings.tail_consumers ?? void 0,
    limits: versionInfo.resources.script_runtime.limits,
    annotations: {
      "workers/message": versionMessage,
      "workers/tag": versionTag
    },
    keep_assets: true,
    assets: void 0,
    observability: scriptSettings.observability,
    cache: versionInfo.cache_options
  };
  const body = createWorkerUploadForm(worker, bindings, {
    unsafe: { metadata: unsafeMetadata }
  });
  const result = await fetchResult(
    config,
    `/accounts/${accountId}/workers/scripts/${scriptName}/versions`,
    {
      method: "POST",
      body,
      headers: await getMetricsUsageHeaders(sendMetrics)
    },
    new URLSearchParams({
      include_subdomain_availability: "true",
      // pass excludeScript so the whole body of the
      // script doesn't get included in the response
      excludeScript: "true"
    })
  );
  return result;
}
async function parseModules(config, accountId, scriptName, versionId) {
  const contentRes = await performApiFetch(
    config,
    `/accounts/${accountId}/workers/scripts/${scriptName}/content/v2?version=${versionId}`
  );
  if (contentRes.headers.get("content-type")?.startsWith("multipart/form-data")) {
    const formData = await contentRes.formData();
    if (formData.get("__STATIC_CONTENT_MANIFEST") !== null) {
      throw new UserError(
        "Workers Sites does not support updating secrets through `wrangler versions secret put`. You must use `wrangler secret put` instead."
      );
    }
    const entrypoint = contentRes.headers.get("cf-entrypoint");
    if (entrypoint === null) {
      throw new FatalError("Got modules without cf-entrypoint header");
    }
    const entrypointPart = formData.get(entrypoint);
    if (entrypointPart === null) {
      throw new FatalError("Could not find entrypoint in form-data");
    }
    const mainModule = {
      name: entrypointPart.name,
      filePath: "",
      content: Buffer.from(await entrypointPart.arrayBuffer()),
      type: fromMimeType(entrypointPart.type)
    };
    const modules = await Promise.all(
      Array.from(formData.entries()).filter(
        ([name2, file3]) => name2 !== entrypoint && file3.type !== "application/source-map"
      ).map(
        async ([name2, file3]) => ({
          name: name2,
          filePath: "",
          content: Buffer.from(await file3.arrayBuffer()),
          type: fromMimeType(file3.type)
        })
      )
    );
    const sourceMaps = await Promise.all(
      Array.from(formData.entries()).filter(([_5, file3]) => file3.type === "application/source-map").map(
        async ([name2, file3]) => ({
          name: name2,
          content: await file3.text()
        })
      )
    );
    return { mainModule, modules, sourceMaps };
  } else {
    const contentType = contentRes.headers.get("content-type");
    if (contentType === null) {
      throw new FatalError(
        "No content-type header was provided for non-module Worker content"
      );
    }
    const content = await contentRes.text();
    const mainModule = {
      name: "index.js",
      filePath: "",
      content,
      type: fromMimeType(contentType)
    };
    return { mainModule, modules: [], sourceMaps: [] };
  }
}
var versionsSecretNamespace;
var init_secrets4 = __esm({
  "src/versions/secrets/index.ts"() {
    init_import_meta_url();
    init_dist();
    init_cfetch();
    init_internal();
    init_create_command();
    init_create_worker_upload_form();
    init_metrics();
    versionsSecretNamespace = createNamespace({
      metadata: {
        description: "Generate a secret that can be referenced in a Worker",
        status: "stable",
        owner: "Workers: Authoring and Testing"
      }
    });
    __name(copyWorkerVersionWithNewSecrets, "copyWorkerVersionWithNewSecrets");
    __name(parseModules, "parseModules");
  }
});

// src/versions/secrets/bulk.ts
var versionsSecretBulkCommand;
var init_bulk2 = __esm({
  "src/versions/secrets/bulk.ts"() {
    init_import_meta_url();
    init_dist();
    init_cfetch();
    init_create_command();
    init_logger();
    init_metrics();
    init_secret();
    init_user3();
    init_getLegacyScriptName();
    init_secrets4();
    versionsSecretBulkCommand = createCommand({
      metadata: {
        description: "Create or update a secret variable for a Worker",
        owner: "Workers: Authoring and Testing",
        status: "stable"
      },
      behaviour: {
        printConfigWarnings: false,
        warnIfMultipleEnvsConfiguredButNoneSpecified: true
      },
      args: {
        file: {
          describe: `The file of key-value pairs to upload, as JSON in form {"key": value, ...} or .dev.vars file in the form KEY=VALUE`,
          type: "string"
        },
        name: {
          describe: "Name of the Worker",
          type: "string",
          requiresArg: true
        },
        message: {
          describe: "Description of this deployment",
          type: "string",
          requiresArg: true
        },
        tag: {
          describe: "A tag for this version",
          type: "string",
          requiresArg: true
        }
      },
      positionalArgs: ["file"],
      handler: /* @__PURE__ */ __name(async function versionsSecretPutBulkHandler(args, { config }) {
        const scriptName = getLegacyScriptName(args, config);
        if (!scriptName) {
          throw new UserError(
            `Required Worker name missing. Please specify the Worker name in your ${configFileName(config.configPath)} file, or pass it as an argument with \`--name <worker-name>\``
          );
        }
        const accountId = await requireAuth(config);
        logger.log(
          `\u{1F300} Creating the secrets for the Worker "${scriptName}" ${args.env ? `(${args.env})` : ""}`
        );
        const result = await parseBulkInputToObject(args.file);
        if (!result) {
          return logger.error(`No content found in file or piped input.`);
        }
        const { content, secretSource, secretFormat } = result;
        const secrets = Object.entries(content).map(([key, value]) => ({
          name: key,
          value
        }));
        const versions2 = (await fetchResult(
          config,
          `/accounts/${accountId}/workers/scripts/${scriptName}/versions`
        )).items;
        if (versions2.length === 0) {
          throw new UserError(
            "There are currently no uploaded versions of this Worker - please upload a version before uploading a secret."
          );
        }
        const latestVersion = versions2[0];
        const newVersion = await copyWorkerVersionWithNewSecrets({
          config,
          accountId,
          scriptName,
          versionId: latestVersion.id,
          secrets,
          versionMessage: args.message ?? `Bulk updated ${secrets.length} secrets`,
          versionTag: args.tag,
          sendMetrics: config.send_metrics,
          unsafeMetadata: config.unsafe.metadata
        });
        for (const secret of secrets) {
          logger.log(`\u2728 Successfully created secret for key: ${secret.name}`);
        }
        sendMetricsEvent(
          "create encrypted variable",
          {
            secretOperation: "bulk",
            secretSource,
            secretFormat,
            hasEnvironment: Boolean(args.env)
          },
          {
            sendMetrics: config.send_metrics
          }
        );
        logger.log(
          `\u2728 Success! Created version ${newVersion.id} with ${secrets.length} secrets.
\u27A1\uFE0F  To deploy this version to production traffic use the command "wrangler versions deploy".`
        );
      }, "versionsSecretPutBulkHandler")
    });
  }
});

// src/versions/secrets/delete.ts
var versionsSecretDeleteCommand;
var init_delete15 = __esm({
  "src/versions/secrets/delete.ts"() {
    init_import_meta_url();
    init_dist();
    init_cfetch();
    init_create_command();
    init_dialogs();
    init_logger();
    init_user3();
    init_getLegacyScriptName();
    init_useServiceEnvironments();
    init_secrets4();
    versionsSecretDeleteCommand = createCommand({
      metadata: {
        description: "Delete a secret variable from a Worker",
        owner: "Workers: Authoring and Testing",
        status: "stable"
      },
      behaviour: {
        printConfigWarnings: false,
        warnIfMultipleEnvsConfiguredButNoneSpecified: true
      },
      args: {
        key: {
          describe: "The variable name to be accessible in the Worker",
          type: "string",
          requiresArg: true
        },
        name: {
          describe: "Name of the Worker",
          type: "string",
          requiresArg: true
        },
        message: {
          describe: "Description of this deployment",
          type: "string",
          requiresArg: true
        },
        tag: {
          describe: "A tag for this version",
          type: "string",
          requiresArg: true
        }
      },
      positionalArgs: ["key"],
      handler: /* @__PURE__ */ __name(async function versionsSecretDeleteHandler(args, { config }) {
        const scriptName = getLegacyScriptName(args, config);
        if (!scriptName) {
          throw new UserError(
            `Required Worker name missing. Please specify the Worker name in your ${configFileName(config.configPath)} file, or pass it as an argument with \`--name <worker-name>\``
          );
        }
        if (args.key === void 0) {
          throw new UserError(
            "Secret name is required. Please specify the name of your secret."
          );
        }
        const accountId = await requireAuth(config);
        const isServiceEnv = args.env && useServiceEnvironments(config);
        if (await confirm(
          `Are you sure you want to permanently delete the secret ${args.key} on the Worker ${scriptName}${isServiceEnv ? ` (${args.env})` : ""}?`
        )) {
          logger.log(
            `\u{1F300} Deleting the secret ${args.key} on the Worker ${scriptName}${isServiceEnv ? ` (${args.env})` : ""}`
          );
          const versions2 = (await fetchResult(
            config,
            `/accounts/${accountId}/workers/scripts/${scriptName}/versions`
          )).items;
          if (versions2.length === 0) {
            throw new UserError(
              "There are currently no uploaded versions of this Worker - please upload a version before uploading a secret."
            );
          }
          const latestVersion = versions2[0];
          const versionInfo = await fetchResult(
            config,
            `/accounts/${accountId}/workers/scripts/${scriptName}/versions/${latestVersion.id}`
          );
          const newSecrets = versionInfo.resources.bindings.filter(
            (binding) => binding.type === "secret_text" && binding.name !== args.key
          ).map((binding) => ({
            name: binding.name,
            value: "",
            inherit: true
          }));
          const newVersion = await copyWorkerVersionWithNewSecrets({
            config,
            accountId,
            scriptName,
            versionId: latestVersion.id,
            secrets: newSecrets,
            versionMessage: args.message ?? `Deleted secret "${args.key}"`,
            versionTag: args.tag,
            sendMetrics: config.send_metrics,
            overrideAllSecrets: true
          });
          logger.log(
            `\u2728 Success! Created version ${newVersion.id} with deleted secret ${args.key}.
\u27A1\uFE0F  To deploy this version without the secret ${args.key} to production traffic use the command "wrangler versions deploy".`
          );
        }
      }, "versionsSecretDeleteHandler")
    });
  }
});

// src/versions/secrets/list.ts
var versionsSecretsListCommand;
var init_list21 = __esm({
  "src/versions/secrets/list.ts"() {
    init_import_meta_url();
    init_dist();
    init_cfetch();
    init_create_command();
    init_logger();
    init_user3();
    init_getLegacyScriptName();
    init_api();
    versionsSecretsListCommand = createCommand({
      metadata: {
        description: "List the secrets currently deployed",
        owner: "Workers: Authoring and Testing",
        status: "stable"
      },
      behaviour: {
        printConfigWarnings: false
      },
      args: {
        name: {
          describe: "Name of the Worker",
          type: "string",
          requiresArg: true
        },
        "latest-version": {
          describe: "Only show the latest version",
          type: "boolean",
          default: false
        }
      },
      handler: /* @__PURE__ */ __name(async function versionsSecretListHandler(args, { config }) {
        const scriptName = getLegacyScriptName(args, config);
        if (!scriptName) {
          throw new UserError(
            `Required Worker name missing. Please specify the Worker name in your ${configFileName(config.configPath)} file, or pass it as an argument with \`--name <worker-name>\``
          );
        }
        const accountId = await requireAuth(config);
        const versionCache = /* @__PURE__ */ new Map();
        let versions2 = [];
        let rollout = /* @__PURE__ */ new Map();
        if (args.latestVersion) {
          const mostRecentVersions = (await fetchResult(
            config,
            `/accounts/${accountId}/workers/scripts/${scriptName}/versions`
          )).items;
          if (mostRecentVersions.length === 0) {
            throw new UserError(
              "There are currently no uploaded versions of this Worker - please upload a version."
            );
          }
          const latestVersion = mostRecentVersions[0];
          versions2 = [latestVersion];
          const latestDeployment = await fetchLatestDeployment(
            config,
            accountId,
            scriptName
          );
          const deploymentVersion = latestDeployment?.versions.find(
            (ver) => ver.version_id === latestVersion.id
          );
          rollout.set(latestVersion.id, deploymentVersion?.percentage ?? 0);
        } else {
          const latestDeployment = await fetchLatestDeployment(
            config,
            accountId,
            scriptName
          );
          [versions2, rollout] = await fetchDeploymentVersions(
            config,
            accountId,
            scriptName,
            latestDeployment,
            versionCache
          );
        }
        for (const version5 of versions2) {
          logger.log(
            `-- Version ${version5.id} (${rollout.get(version5.id)}%) secrets --`
          );
          const secrets = version5.resources.bindings.filter(
            (binding) => binding.type === "secret_text"
          );
          for (const secret of secrets) {
            logger.log(`Secret Name: ${secret.name}`);
          }
          logger.log();
        }
      }, "versionsSecretListHandler")
    });
  }
});

// src/versions/secrets/put.ts
var versionsSecretPutCommand;
var init_put = __esm({
  "src/versions/secrets/put.ts"() {
    init_import_meta_url();
    init_dist();
    init_cfetch();
    init_create_command();
    init_dialogs();
    init_logger();
    init_metrics();
    init_user3();
    init_getLegacyScriptName();
    init_std();
    init_secrets4();
    versionsSecretPutCommand = createCommand({
      metadata: {
        description: "Create or update a secret variable for a Worker",
        owner: "Workers: Authoring and Testing",
        status: "stable"
      },
      behaviour: {
        printConfigWarnings: false,
        warnIfMultipleEnvsConfiguredButNoneSpecified: true
      },
      args: {
        key: {
          describe: "The variable name to be accessible in the Worker",
          type: "string",
          requiresArg: true
        },
        name: {
          describe: "Name of the Worker",
          type: "string",
          requiresArg: true
        },
        message: {
          describe: "Description of this deployment",
          type: "string",
          requiresArg: true
        },
        tag: {
          describe: "A tag for this version",
          type: "string",
          requiresArg: true
        }
      },
      positionalArgs: ["key"],
      handler: /* @__PURE__ */ __name(async function versionsSecretPutHandler(args, { config }) {
        const scriptName = getLegacyScriptName(args, config);
        if (!scriptName) {
          throw new UserError(
            `Required Worker name missing. Please specify the Worker name in your ${configFileName(config.configPath)} file, or pass it as an argument with \`--name <worker-name>\``
          );
        }
        if (args.key === void 0) {
          throw new UserError(
            "Secret name is required. Please specify the name of your secret."
          );
        }
        const accountId = await requireAuth(config);
        const isInteractive4 = process.stdin.isTTY;
        const secretValue = trimTrailingWhitespace(
          isInteractive4 ? await prompt("Enter a secret value:", { isSecret: true }) : await readFromStdin()
        );
        logger.log(
          `\u{1F300} Creating the secret for the Worker "${scriptName}" ${args.env ? `(${args.env})` : ""}`
        );
        const versions2 = (await fetchResult(
          config,
          `/accounts/${accountId}/workers/scripts/${scriptName}/versions`
        )).items;
        if (versions2.length === 0) {
          throw new UserError(
            "There are currently no uploaded versions of this Worker. Please upload a version before uploading a secret."
          );
        }
        const latestVersion = versions2[0];
        const newVersion = await copyWorkerVersionWithNewSecrets({
          config,
          accountId,
          scriptName,
          versionId: latestVersion.id,
          secrets: [{ name: args.key, value: secretValue }],
          versionMessage: args.message ?? `Updated secret "${args.key}"`,
          versionTag: args.tag,
          sendMetrics: config.send_metrics,
          unsafeMetadata: config.unsafe.metadata
        });
        sendMetricsEvent(
          "create encrypted variable",
          {
            secretOperation: "single",
            secretSource: isInteractive4 ? "interactive" : "stdin",
            hasEnvironment: Boolean(args.env)
          },
          {
            sendMetrics: config.send_metrics
          }
        );
        logger.log(
          `\u2728 Success! Created version ${newVersion.id} with secret ${args.key}.
\u27A1\uFE0F  To deploy this version with secret ${args.key} to production traffic use the command "wrangler versions deploy".`
        );
      }, "versionsSecretPutHandler")
    });
  }
});
async function getSize(modules) {
  const gzipSize = zlib.gzipSync(
    await new buffer.Blob(modules.map((file3) => file3.content)).arrayBuffer()
  ).byteLength;
  const aggregateSize = new buffer.Blob(modules.map((file3) => file3.content)).size;
  return { size: aggregateSize, gzipSize };
}
async function printBundleSize(main2, modules) {
  const { size, gzipSize } = await getSize([...modules, main2]);
  const bundleReport = `${(size / ONE_KIB_BYTES).toFixed(2)} KiB / gzip: ${(gzipSize / ONE_KIB_BYTES).toFixed(2)} KiB`;
  const percentage = gzipSize / MAX_GZIP_SIZE_BYTES * 100;
  const colorizedReport = percentage > 90 ? source_default.red(bundleReport) : percentage > 70 ? source_default.yellow(bundleReport) : source_default.green(bundleReport);
  logger.log(`Total Upload: ${colorizedReport}`);
}
var ONE_KIB_BYTES, MAX_GZIP_SIZE_BYTES;
var init_bundle_reporter = __esm({
  "src/deployment-bundle/bundle-reporter.ts"() {
    init_import_meta_url();
    init_source();
    init_logger();
    ONE_KIB_BYTES = 1024;
    MAX_GZIP_SIZE_BYTES = 3 * ONE_KIB_BYTES * ONE_KIB_BYTES;
    __name(getSize, "getSize");
    __name(printBundleSize, "printBundleSize");
  }
});

// src/utils/error-codes.ts
var INVALID_INHERIT_BINDING_CODE;
var init_error_codes = __esm({
  "src/utils/error-codes.ts"() {
    init_import_meta_url();
    INVALID_INHERIT_BINDING_CODE = 10057;
  }
});

// src/deployment-bundle/secrets-validation.ts
function addRequiredSecretsInheritBindings(config, bindings, options) {
  if (!config.secrets?.required?.length) {
    return;
  }
  const inheritedSecrets = config.secrets.required.filter(
    (secretName) => !(secretName in bindings)
  );
  if (inheritedSecrets.length === 0) {
    return;
  }
  if (options.type === "deploy" && !options.workerExists) {
    throw new UserError(
      `The following required secrets have not been set: ${inheritedSecrets.join(", ")}
Use \`wrangler secret put <NAME>\` to set secrets before deploying.
See https://developers.cloudflare.com/workers/configuration/secrets/#secrets-on-deployed-workers for more information.`
    );
  }
  for (const secretName of inheritedSecrets) {
    bindings[secretName] = { type: "inherit" };
  }
}
function handleMissingSecretsError(err, config, options) {
  if (!(err instanceof APIError) || err.code !== INVALID_INHERIT_BINDING_CODE) {
    return;
  }
  const missingSecretNames = err.notes.map((note) => note.text.match(/^inherit binding '(.+?)' is invalid/)).filter((match3) => match3 !== null).map((match3) => match3[1]).filter((secretName) => config.secrets?.required?.includes(secretName));
  if (missingSecretNames.length > 0) {
    err.preventReport();
    throw new UserError(
      `The following required secrets have not been set: ${missingSecretNames.join(", ")}
Use \`wrangler ${options.type === "deploy" ? "secret put" : "versions secret put"} <NAME>\` to set secrets before ${options.type === "deploy" ? "deploying" : "uploading"}.
See https://developers.cloudflare.com/workers/configuration/secrets/#secrets-on-deployed-workers for more information.`
    );
  }
}
var init_secrets_validation = __esm({
  "src/deployment-bundle/secrets-validation.ts"() {
    init_import_meta_url();
    init_dist();
    init_error_codes();
    __name(addRequiredSecretsInheritBindings, "addRequiredSecretsInheritBindings");
    __name(handleMissingSecretsError, "handleMissingSecretsError");
  }
});
async function getMigrationsToUpload(scriptName, props) {
  const { config, accountId } = props;
  assert53__default.default(accountId, "Missing accountId");
  let migrations;
  if (config.migrations.length > 0) {
    let script;
    if (props.dispatchNamespace) {
      try {
        const scriptData = await fetchResult(
          config,
          `/accounts/${accountId}/workers/dispatch/namespaces/${props.dispatchNamespace}/scripts/${scriptName}`
        );
        script = scriptData.script;
      } catch (err) {
        suppressNotFoundError(err);
      }
    } else {
      if (props.useServiceEnvironments) {
        try {
          if (props.env) {
            const scriptData = await fetchResult(
              config,
              `/accounts/${accountId}/workers/services/${scriptName}/environments/${props.env}`
            );
            script = scriptData.script;
          } else {
            const scriptData = await fetchResult(config, `/accounts/${accountId}/workers/services/${scriptName}`);
            script = scriptData.default_environment.script;
          }
        } catch (err) {
          suppressNotFoundError(err);
        }
      } else {
        const scripts = await fetchResult(
          config,
          `/accounts/${accountId}/workers/scripts`
        );
        script = scripts.find(({ id }) => id === scriptName);
      }
    }
    if (script?.migration_tag) {
      const scriptMigrationTag = script.migration_tag;
      const foundIndex = config.migrations.findIndex(
        (migration) => migration.tag === scriptMigrationTag
      );
      if (foundIndex === -1) {
        logger.warn(
          `The published script ${scriptName} has a migration tag "${script.migration_tag}, which was not found in your ${configFileName(config.configPath)} file. You may have already deleted it. Applying all available migrations to the script...`
        );
        migrations = {
          old_tag: script.migration_tag,
          new_tag: config.migrations[config.migrations.length - 1].tag,
          steps: config.migrations.map(({ tag: _tag, ...rest }) => rest)
        };
      } else {
        if (foundIndex !== config.migrations.length - 1) {
          migrations = {
            old_tag: script.migration_tag,
            new_tag: config.migrations[config.migrations.length - 1].tag,
            steps: config.migrations.slice(foundIndex + 1).map(({ tag: _tag, ...rest }) => rest)
          };
        }
      }
    } else {
      migrations = {
        new_tag: config.migrations[config.migrations.length - 1].tag,
        steps: config.migrations.map(({ tag: _tag, ...rest }) => rest)
      };
    }
  }
  return migrations;
}
var suppressNotFoundError;
var init_durable = __esm({
  "src/durable.ts"() {
    init_import_meta_url();
    init_dist();
    init_cfetch();
    init_logger();
    init_worker_not_found_error();
    __name(getMigrationsToUpload, "getMigrationsToUpload");
    suppressNotFoundError = /* @__PURE__ */ __name((err) => {
      if (!isWorkerNotFoundError(err) && err.code !== 10092) {
        throw err;
      }
    }, "suppressNotFoundError");
  }
});

// src/environments/index.ts
function hasDefinedEnvironments(config) {
  return !useServiceEnvironments(config) && Boolean(config.definedEnvironments?.length);
}
function applyServiceAndEnvironmentTags(config, tags) {
  const env6 = config.targetEnvironment;
  const serviceName = config.topLevelName;
  const shouldApplyTags = hasDefinedEnvironments(config);
  if (shouldApplyTags && !serviceName) {
    logger.warn(
      "No top-level `name` has been defined in Wrangler configuration. Add a top-level `name` to group this Worker together with its sibling environments in the Cloudflare dashboard."
    );
  }
  const serviceTag = shouldApplyTags && serviceName ? `${SERVICE_TAG_PREFIX}${serviceName}` : null;
  const environmentTag = serviceTag && env6 ? `${ENVIRONMENT_TAG_PREFIX}${env6}` : null;
  tags = tags.filter(
    (tag) => !tag.startsWith(SERVICE_TAG_PREFIX) && !tag.startsWith(ENVIRONMENT_TAG_PREFIX)
  );
  if (serviceTag) {
    tags.push(serviceTag);
  }
  if (environmentTag) {
    tags.push(environmentTag);
  }
  return tags;
}
function warnOnErrorUpdatingServiceAndEnvironmentTags() {
  logger.warn(
    "Could not apply service and environment tags. This Worker will not appear grouped together with its sibling environments in the Cloudflare dashboard."
  );
}
function tagsAreEqual(a7, b11) {
  return a7.length === b11.length && a7.every((el, i7) => b11[i7] === el);
}
var init_environments = __esm({
  "src/environments/index.ts"() {
    init_import_meta_url();
    init_dist();
    init_logger();
    init_useServiceEnvironments();
    __name(hasDefinedEnvironments, "hasDefinedEnvironments");
    __name(applyServiceAndEnvironmentTags, "applyServiceAndEnvironmentTags");
    __name(warnOnErrorUpdatingServiceAndEnvironmentTags, "warnOnErrorUpdatingServiceAndEnvironmentTags");
    __name(tagsAreEqual, "tagsAreEqual");
  }
});
async function versionsUpload(props) {
  const { config, accountId, name: name2 } = props;
  let versionId = null;
  let workerTag = null;
  let tags = [];
  if (accountId && name2) {
    try {
      const {
        default_environment: { script }
      } = await fetchResult(
        config,
        `/accounts/${accountId}/workers/services/${name2}`
        // TODO(consider): should this be a /versions endpoint?
      );
      workerTag = script.tag;
      tags = script.tags ?? tags;
      if (script.last_deployed_from === "dash") {
        logger.warn(
          `You are about to upload a Worker Version that was last published via the Cloudflare Dashboard.
Edits that have been made via the dashboard will be overridden by your local code and config.`
        );
        if (!await confirm("Would you like to continue?")) {
          return {
            versionId,
            workerTag
          };
        }
      } else if (script.last_deployed_from === "api") {
        logger.warn(
          `You are about to upload a Workers Version that was last updated via the API.
Edits that have been made via the API will be overridden by your local code and config.`
        );
        if (!await confirm("Would you like to continue?")) {
          return {
            versionId,
            workerTag
          };
        }
      }
    } catch (e10) {
      if (!isWorkerNotFoundError(e10)) {
        throw e10;
      }
    }
  }
  const compatibilityDate = props.compatibilityDate || config.compatibility_date;
  const compatibilityFlags = props.compatibilityFlags ?? config.compatibility_flags;
  if (!compatibilityDate) {
    const compatibilityDateStr = getTodaysCompatDate();
    throw new UserError(`A compatibility_date is required when uploading a Worker Version. Add the following to your ${configFileName(config.configPath)} file:
    \`\`\`
	${formatConfigSnippet({ compatibility_date: compatibilityDateStr }, config.configPath), false}
    \`\`\`
    Or you could pass it in your terminal as \`--compatibility-date ${compatibilityDateStr}\`
See https://developers.cloudflare.com/workers/platform/compatibility-dates for more information.`);
  }
  const jsxFactory = props.jsxFactory || config.jsx_factory;
  const jsxFragment = props.jsxFragment || config.jsx_fragment;
  const minify = props.minify ?? config.minify;
  const nodejsCompatMode = validateNodeCompatMode(
    compatibilityDate,
    compatibilityFlags,
    {
      noBundle: props.noBundle ?? config.no_bundle
    }
  );
  if (props.noBundle && minify) {
    logger.warn(
      "`--minify` and `--no-bundle` can't be used together. If you want to minify your Worker and disable Wrangler's bundling, please minify as part of your own bundling process."
    );
  }
  const scriptName = props.name;
  if (config.site && !config.site.bucket) {
    throw new UserError(
      "A [site] definition requires a `bucket` field with a path to the site's assets directory."
    );
  }
  if (props.outDir) {
    fs29.mkdirSync(props.outDir, { recursive: true });
    const readmePath = path3__namespace.default.join(props.outDir, "README.md");
    fs29.writeFileSync(
      readmePath,
      `This folder contains the built output assets for the worker "${scriptName}" generated at ${(/* @__PURE__ */ new Date()).toISOString()}.`
    );
  }
  const destination = props.outDir ?? getWranglerTmpDir(props.projectRoot, "deploy");
  const start = Date.now();
  const workerName = scriptName;
  const workerUrl = `/accounts/${accountId}/workers/scripts/${scriptName}`;
  const { format: format11 } = props.entry;
  if (config.wasm_modules && format11 === "modules") {
    throw new UserError(
      "You cannot configure [wasm_modules] with an ES module worker. Instead, import the .wasm module directly in your code"
    );
  }
  if (config.text_blobs && format11 === "modules") {
    throw new UserError(
      `You cannot configure [text_blobs] with an ES module worker. Instead, import the file directly in your code, and optionally configure \`[rules]\` in your ${configFileName(config.configPath)} file`
    );
  }
  if (config.data_blobs && format11 === "modules") {
    throw new UserError(
      `You cannot configure [data_blobs] with an ES module worker. Instead, import the file directly in your code, and optionally configure \`[rules]\` in your ${configFileName(config.configPath)} file`
    );
  }
  let hasPreview = false;
  try {
    if (props.noBundle) {
      const destinationDir = typeof destination === "string" ? destination : destination.path;
      fs29.mkdirSync(destinationDir, { recursive: true });
      fs29.writeFileSync(
        path3__namespace.default.join(destinationDir, path3__namespace.default.basename(props.entry.file)),
        fs29.readFileSync(props.entry.file, "utf-8")
      );
    }
    const entryDirectory = path3__namespace.default.dirname(props.entry.file);
    const moduleCollector = createModuleCollector({
      wrangler1xLegacyModuleReferences: getWrangler1xLegacyModuleReferences(
        entryDirectory,
        props.entry.file
      ),
      entry: props.entry,
      // `moduleCollector` doesn't get used when `props.noBundle` is set, so
      // `findAdditionalModules` always defaults to `false`
      findAdditionalModules: config.find_additional_modules ?? false,
      rules: props.rules
    });
    const uploadSourceMaps = props.uploadSourceMaps ?? config.upload_source_maps;
    const bindings = getBindings(config);
    for (const [bindingName, value] of Object.entries(props.vars ?? {})) {
      bindings[bindingName] = {
        type: "plain_text",
        value,
        hidden: true
      };
    }
    const {
      modules,
      dependencies,
      resolvedEntryPointPath,
      bundleType,
      ...bundle
    } = props.noBundle ? await noBundleWorker(
      props.entry,
      props.rules,
      props.outDir,
      config.python_modules.exclude
    ) : await bundleWorker(
      props.entry,
      typeof destination === "string" ? destination : destination.path,
      {
        bundle: true,
        additionalModules: [],
        moduleCollector,
        doBindings: config.durable_objects.bindings,
        workflowBindings: config.workflows,
        jsxFactory,
        jsxFragment,
        tsconfig: props.tsconfig ?? config.tsconfig,
        minify,
        keepNames: config.keep_names ?? true,
        sourcemap: uploadSourceMaps,
        nodejsCompatMode,
        compatibilityDate,
        compatibilityFlags,
        define: { ...config.define, ...props.defines },
        alias: { ...config.alias, ...props.alias },
        checkFetch: false,
        // We want to know if the build is for development or publishing
        // This could potentially cause issues as we no longer have identical behaviour between dev and deploy?
        targetConsumer: "deploy",
        local: false,
        projectRoot: props.projectRoot,
        defineNavigatorUserAgent: isNavigatorDefined(
          compatibilityDate,
          compatibilityFlags
        ),
        plugins: [logBuildOutput(nodejsCompatMode)],
        // Pages specific options used by wrangler pages commands
        entryName: void 0,
        inject: void 0,
        isOutfile: void 0,
        external: void 0,
        // These options are dev-only
        testScheduled: void 0,
        watch: void 0,
        metafile: void 0
      }
    );
    for (const module2 of modules) {
      const modulePath = module2.filePath === void 0 ? module2.name : path3__namespace.default.relative("", module2.filePath);
      const bytesInOutput = typeof module2.content === "string" ? Buffer.byteLength(module2.content) : module2.content.byteLength;
      dependencies[modulePath] = { bytesInOutput };
    }
    const content = fs29.readFileSync(resolvedEntryPointPath, {
      encoding: "utf-8"
    });
    const migrations = !props.dryRun ? await getMigrationsToUpload(scriptName, {
      accountId,
      config,
      useServiceEnvironments: props.useServiceEnvironments,
      env: props.env,
      dispatchNamespace: void 0
    }) : void 0;
    const assetsJwt = props.assetsOptions && !props.dryRun ? await syncAssets(
      config,
      accountId,
      props.assetsOptions.directory,
      scriptName
    ) : void 0;
    if (props.secretsFile) {
      const secretsResult = await parseBulkInputToObject(props.secretsFile);
      if (secretsResult) {
        for (const [secretName, secretValue] of Object.entries(
          secretsResult.content
        )) {
          bindings[secretName] = {
            type: "secret_text",
            value: secretValue
          };
        }
      }
    }
    addRequiredSecretsInheritBindings(config, bindings, { type: "upload" });
    const placement = parseConfigPlacement(config);
    const entryPointName = path3__namespace.default.basename(resolvedEntryPointPath);
    const main2 = {
      name: entryPointName,
      filePath: resolvedEntryPointPath,
      content,
      type: bundleType
    };
    const worker = {
      name: scriptName,
      main: main2,
      migrations,
      modules,
      containers: config.containers,
      sourceMaps: uploadSourceMaps ? loadSourceMaps(main2, modules, bundle) : void 0,
      compatibility_date: compatibilityDate,
      compatibility_flags: compatibilityFlags,
      keepVars: props.keepVars ?? false,
      // we never delete secret bindings when uploading, even if we are setting secrets from a file
      // so inherit all unchanged secrets from the previous Worker Version
      keepSecrets: true,
      placement,
      tail_consumers: config.tail_consumers,
      limits: config.limits,
      annotations: {
        "workers/message": props.message,
        "workers/tag": props.tag,
        "workers/alias": props.previewAlias
      },
      assets: props.assetsOptions && assetsJwt ? {
        jwt: assetsJwt,
        routerConfig: props.assetsOptions.routerConfig,
        assetConfig: props.assetsOptions.assetConfig,
        _redirects: props.assetsOptions._redirects,
        _headers: props.assetsOptions._headers,
        run_worker_first: props.assetsOptions.run_worker_first
      } : void 0,
      logpush: void 0,
      // logpush and observability are non-versioned settings
      observability: void 0,
      cache: config.cache
      // cache is a versioned setting
    };
    if (config.containers && config.containers.length > 0) {
      logger.warn(
        `Your Worker has Containers configured. Container configuration changes (such as image, max_instances, etc.) will not be gradually rolled out with versions. These changes will only take effect after running \`wrangler deploy\`.`
      );
    }
    await printBundleSize(
      { name: path3__namespace.default.basename(resolvedEntryPointPath), content },
      modules
    );
    let workerBundle;
    if (props.dryRun) {
      workerBundle = createWorkerUploadForm(worker, bindings, {
        dryRun: true,
        unsafe: config.unsafe
      });
      printBindings(
        bindings,
        config.tail_consumers,
        config.streaming_tail_consumers,
        void 0,
        { unsafeMetadata: config.unsafe?.metadata }
      );
    } else {
      assert53__default.default(accountId, "Missing accountId");
      if (getFlag("RESOURCES_PROVISION")) {
        await provisionBindings(
          bindings,
          accountId,
          scriptName,
          props.experimentalAutoCreate,
          props.config
        );
      }
      workerBundle = createWorkerUploadForm(worker, bindings, {
        unsafe: config.unsafe
      });
      await ensureQueuesExistByConfig(config);
      let bindingsPrinted = false;
      try {
        const result = await retryOnAPIFailure(
          async () => fetchResult(
            config,
            `${workerUrl}/versions`,
            {
              method: "POST",
              body: workerBundle,
              headers: await getMetricsUsageHeaders(config.send_metrics)
            },
            new URLSearchParams({ bindings_inherit: "strict" })
          )
        );
        logger.log("Worker Startup Time:", result.startup_time_ms, "ms");
        bindingsPrinted = true;
        printBindings(
          bindings,
          config.tail_consumers,
          config.streaming_tail_consumers,
          void 0,
          { unsafeMetadata: config.unsafe?.metadata }
        );
        versionId = result.id;
        hasPreview = result.metadata.has_preview;
      } catch (err) {
        if (!bindingsPrinted) {
          printBindings(
            bindings,
            config.tail_consumers,
            config.streaming_tail_consumers,
            void 0,
            { unsafeMetadata: config.unsafe?.metadata }
          );
        }
        const message = await helpIfErrorIsSizeOrScriptStartup(
          err,
          dependencies,
          workerBundle,
          props.projectRoot
        );
        if (message) {
          logger.error(message);
        }
        handleMissingSecretsError(err, config, { type: "upload" });
        if (err instanceof ParseError && "code" in err && err.code === 10021 && err.notes.length > 0) {
          const maybeNameToFilePath = /* @__PURE__ */ __name((moduleName) => {
            if (bundleType === "commonjs") {
              return resolvedEntryPointPath;
            }
            if (moduleName === entryPointName) {
              return resolvedEntryPointPath;
            }
            for (const module2 of modules) {
              if (moduleName === module2.name) {
                return module2.filePath;
              }
            }
          }, "maybeNameToFilePath");
          const retrieveSourceMap = /* @__PURE__ */ __name((moduleName) => maybeRetrieveFileSourceMap(maybeNameToFilePath(moduleName)), "retrieveSourceMap");
          err.notes[0].text = getSourceMappedString(
            err.notes[0].text,
            retrieveSourceMap
          );
        }
        throw err;
      }
      const nextTags = applyServiceAndEnvironmentTags(config, tags);
      if (!tagsAreEqual(tags, nextTags)) {
        try {
          await patchNonVersionedScriptSettings(config, accountId, scriptName, {
            tags: nextTags
          });
        } catch {
          warnOnErrorUpdatingServiceAndEnvironmentTags();
        }
      }
    }
    if (props.outFile) {
      fs29.mkdirSync(path3__namespace.default.dirname(props.outFile), { recursive: true });
      const serializedFormData = await new import_undici23.Response(workerBundle).arrayBuffer();
      fs29.writeFileSync(props.outFile, Buffer.from(serializedFormData));
    }
  } finally {
    if (typeof destination !== "string") {
      destination.remove();
    }
  }
  if (props.dryRun) {
    logger.log(`--dry-run: exiting now.`);
    return { versionId, workerTag };
  }
  if (!accountId) {
    throw new UserError("Missing accountId");
  }
  const uploadMs = Date.now() - start;
  logger.log("Uploaded", workerName, formatTime3(uploadMs));
  logger.log("Worker Version ID:", versionId);
  let versionPreviewUrl = void 0;
  let versionPreviewAliasUrl = void 0;
  if (versionId && hasPreview) {
    const { previews_enabled: previews_available_on_subdomain } = await fetchResult(config, `${workerUrl}/subdomain`);
    if (previews_available_on_subdomain) {
      const userSubdomain = await getWorkersDevSubdomain(
        config,
        accountId,
        config.configPath
      );
      const shortVersion = versionId.slice(0, 8);
      versionPreviewUrl = `https://${shortVersion}-${workerName}.${userSubdomain}`;
      logger.log(`Version Preview URL: ${versionPreviewUrl}`);
      if (props.previewAlias) {
        versionPreviewAliasUrl = `https://${props.previewAlias}-${workerName}.${userSubdomain}`;
        logger.log(`Version Preview Alias URL: ${versionPreviewAliasUrl}`);
      }
    }
  }
  const cmdVersionsDeploy = blue("wrangler versions deploy");
  const cmdTriggersDeploy = blue("wrangler triggers deploy");
  logger.info(
    gray(`
To deploy this version to production traffic use the command ${cmdVersionsDeploy}

Changes to non-versioned settings (config properties 'logpush' or 'tail_consumers') take effect after your next deployment using the command ${cmdVersionsDeploy}

Changes to triggers (routes, custom domains, cron schedules, etc) must be applied with the command ${cmdTriggersDeploy}
`)
  );
  return { versionId, workerTag, versionPreviewUrl, versionPreviewAliasUrl };
}
function formatTime3(duration) {
  return `(${(duration / 1e3).toFixed(2)} sec)`;
}
function sanitizeBranchName(branchName) {
  return branchName.replace(/[^a-zA-Z0-9-]/g, "-").replace(/-+/g, "-").replace(/^-+|-+$/g, "").toLowerCase();
}
function getBranchName2() {
  const ciBranchName = getWorkersCIBranchName();
  if (ciBranchName) {
    return ciBranchName;
  }
  try {
    childProcess.execSync(`git rev-parse --is-inside-work-tree`, { stdio: "ignore" });
    return childProcess.execSync(`git rev-parse --abbrev-ref HEAD`).toString().trim();
  } catch {
    return void 0;
  }
}
function createTruncatedAlias(branchName, sanitizedAlias, availableSpace) {
  const spaceForHash = HASH_LENGTH + 1;
  const maxPrefixLength = availableSpace - spaceForHash;
  if (maxPrefixLength < 1) {
    return void 0;
  }
  const hash = crypto2.createHash("sha256").update(branchName).digest("hex").slice(0, HASH_LENGTH);
  const truncatedPrefix = sanitizedAlias.slice(0, maxPrefixLength);
  return `${truncatedPrefix}-${hash}`;
}
function generatePreviewAlias(scriptName) {
  const warnAndExit = /* @__PURE__ */ __name(() => {
    logger.warn(
      `Preview alias generation requested, but could not be autogenerated.`
    );
    return void 0;
  }, "warnAndExit");
  const branchName = getBranchName2();
  if (!branchName) {
    return warnAndExit();
  }
  const sanitizedAlias = sanitizeBranchName(branchName);
  if (!ALIAS_VALIDATION_REGEX.test(sanitizedAlias)) {
    return warnAndExit();
  }
  const availableSpace = MAX_DNS_LABEL_LENGTH - scriptName.length - 1;
  if (sanitizedAlias.length <= availableSpace) {
    return sanitizedAlias;
  }
  const truncatedAlias = createTruncatedAlias(
    branchName,
    sanitizedAlias,
    availableSpace
  );
  return truncatedAlias || warnAndExit();
}
var import_undici23, versionsUploadCommand, MAX_DNS_LABEL_LENGTH, HASH_LENGTH, ALIAS_VALIDATION_REGEX;
var init_upload5 = __esm({
  "src/versions/upload.ts"() {
    init_import_meta_url();
    init_colors();
    init_dist();
    import_undici23 = __toESM(require_undici());
    init_assets5();
    init_cfetch();
    init_create_command();
    init_bindings2();
    init_bundle();
    init_bundle_reporter();
    init_create_worker_upload_form();
    init_entry();
    init_log_build_output();
    init_module_collection();
    init_no_bundle_worker();
    init_node_compat();
    init_secrets_validation();
    init_source_maps();
    init_dialogs();
    init_durable();
    init_environments();
    init_experimental_flags();
    init_logger();
    init_match_tag();
    init_metrics();
    init_metrics();
    init_navigator_user_agent();
    init_output();
    init_paths();
    init_client11();
    init_routes6();
    init_secret();
    init_sourcemap();
    init_user3();
    init_collectKeyValues();
    init_friendly_validator_errors();
    init_getRules();
    init_getScriptName();
    init_placement();
    init_print_bindings();
    init_retry();
    init_useServiceEnvironments();
    init_worker_not_found_error();
    init_api();
    versionsUploadCommand = createCommand({
      metadata: {
        description: "Uploads your Worker code and config as a new Version",
        owner: "Workers: Authoring and Testing",
        status: "stable"
      },
      positionalArgs: ["script"],
      args: {
        script: {
          describe: "The path to an entry point for your Worker",
          type: "string",
          requiresArg: true
        },
        name: {
          describe: "Name of the Worker",
          type: "string",
          requiresArg: true
        },
        tag: {
          describe: "A tag for this Worker Gradual Rollouts Version",
          type: "string",
          requiresArg: true
        },
        message: {
          describe: "A descriptive message for this Worker Gradual Rollouts Version",
          type: "string",
          requiresArg: true
        },
        "preview-alias": {
          describe: "Name of an alias for this Worker version",
          type: "string",
          requiresArg: true
        },
        bundle: {
          describe: "Run Wrangler's compilation step before publishing",
          type: "boolean",
          hidden: true
        },
        "no-bundle": {
          describe: "Skip internal build steps and directly upload Worker",
          type: "boolean",
          default: false
        },
        outdir: {
          describe: "Output directory for the bundled Worker",
          type: "string",
          requiresArg: true
        },
        outfile: {
          describe: "Output file for the bundled worker",
          type: "string",
          requiresArg: true
        },
        "compatibility-date": {
          describe: "Date to use for compatibility checks",
          type: "string",
          requiresArg: true
        },
        "compatibility-flags": {
          describe: "Flags to use for compatibility checks",
          alias: "compatibility-flag",
          type: "string",
          requiresArg: true,
          array: true
        },
        latest: {
          describe: "Use the latest version of the Worker runtime",
          type: "boolean",
          default: false
        },
        assets: {
          describe: "Static assets to be served. Replaces Workers Sites.",
          type: "string",
          requiresArg: true
        },
        site: {
          describe: "Root folder of static assets for Workers Sites",
          type: "string",
          requiresArg: true,
          hidden: true,
          deprecated: true
        },
        "site-include": {
          describe: "Array of .gitignore-style patterns that match file or directory names from the sites directory. Only matched items will be uploaded.",
          type: "string",
          requiresArg: true,
          array: true,
          hidden: true,
          deprecated: true
        },
        "site-exclude": {
          describe: "Array of .gitignore-style patterns that match file or directory names from the sites directory. Matched items will not be uploaded.",
          type: "string",
          requiresArg: true,
          array: true,
          hidden: true,
          deprecated: true
        },
        var: {
          describe: "A key-value pair to be injected into the script as a variable",
          type: "string",
          requiresArg: true,
          array: true
        },
        define: {
          describe: "A key-value pair to be substituted in the script",
          type: "string",
          requiresArg: true,
          array: true
        },
        alias: {
          describe: "A module pair to be substituted in the script",
          type: "string",
          requiresArg: true,
          array: true
        },
        "jsx-factory": {
          describe: "The function that is called for each JSX element",
          type: "string",
          requiresArg: true
        },
        "jsx-fragment": {
          describe: "The function that is called for each JSX fragment",
          type: "string",
          requiresArg: true
        },
        tsconfig: {
          describe: "Path to a custom tsconfig.json file",
          type: "string",
          requiresArg: true
        },
        minify: {
          describe: "Minify the Worker",
          type: "boolean"
        },
        "upload-source-maps": {
          describe: "Include source maps when uploading this Worker Gradual Rollouts Version.",
          type: "boolean"
        },
        "node-compat": {
          describe: "Enable Node.js compatibility",
          type: "boolean",
          hidden: true,
          deprecated: true
        },
        "dry-run": {
          describe: "Compile a project without actually uploading the version.",
          type: "boolean"
        },
        "experimental-auto-create": {
          describe: "Automatically provision draft bindings with new resources",
          type: "boolean",
          default: true,
          hidden: true,
          alias: "x-auto-create"
        },
        "secrets-file": {
          describe: "Path to a file containing secrets to upload with the version (JSON or .env format). Secrets from previous deployments will not be deleted - see `--keep-secrets`",
          type: "string",
          requiresArg: true
        }
      },
      behaviour: {
        useConfigRedirectIfAvailable: true,
        overrideExperimentalFlags: /* @__PURE__ */ __name((args) => ({
          MULTIWORKER: false,
          RESOURCES_PROVISION: args.experimentalProvision ?? false,
          AUTOCREATE_RESOURCES: args.experimentalAutoCreate
        }), "overrideExperimentalFlags"),
        warnIfMultipleEnvsConfiguredButNoneSpecified: true
      },
      handler: /* @__PURE__ */ __name(async function versionsUploadHandler(args, { config }) {
        const entry = await getEntry(args, config, "versions upload");
        sendMetricsEvent(
          "upload worker version",
          {
            usesTypeScript: /\.tsx?$/.test(entry.file)
          },
          {
            sendMetrics: config.send_metrics
          }
        );
        if (args.nodeCompat) {
          throw new UserError(
            `The --node-compat flag is no longer supported as of Wrangler v4. Instead, use the \`nodejs_compat\` compatibility flag. This includes the functionality from legacy \`node_compat\` polyfills and natively implemented Node.js APIs. See https://developers.cloudflare.com/workers/runtime-apis/nodejs for more information.`
          );
        }
        if (args.site || config.site) {
          throw new UserError(
            "Workers Sites does not support uploading versions through `wrangler versions upload`. You must use `wrangler deploy` instead.",
            { telemetryMessage: true }
          );
        }
        validateAssetsArgsAndConfig(
          {
            site: void 0,
            assets: args.assets,
            script: args.script
          },
          config
        );
        const assetsOptions = getAssetsOptions(args, config);
        if (args.latest) {
          logger.warn(
            `Using the latest version of the Workers runtime. To silence this warning, please choose a specific version of the runtime with --compatibility-date, or add a compatibility_date to your ${configFileName(config.configPath)} file.
`
          );
        }
        const cliVars = collectKeyValues(args.var);
        const cliDefines = collectKeyValues(args.define);
        const cliAlias = collectKeyValues(args.alias);
        const accountId = args.dryRun ? void 0 : await requireAuth(config);
        let name2 = getScriptName(args, config);
        const ciOverrideName = getCIOverrideName();
        let workerNameOverridden = false;
        if (ciOverrideName !== void 0 && ciOverrideName !== name2) {
          logger.warn(
            `Failed to match Worker name. Your config file is using the Worker name "${name2}", but the CI system expected "${ciOverrideName}". Overriding using the CI provided Worker name. Workers Builds connected builds will attempt to open a pull request to resolve this config name mismatch.`
          );
          name2 = ciOverrideName;
          workerNameOverridden = true;
        }
        if (!name2) {
          throw new UserError(
            'You need to provide a name of your worker. Either pass it as a cli arg with `--name <name>` or in your config file as `name = "<name>"`',
            { telemetryMessage: true }
          );
        }
        const previewAlias = args.previewAlias ?? (getCIGeneratePreviewAlias() === "true" ? generatePreviewAlias(name2) : void 0);
        if (!args.dryRun) {
          assert53__default.default(accountId, "Missing account ID");
          await verifyWorkerMatchesCITag(
            config,
            accountId,
            name2,
            config.configPath
          );
        }
        const { versionId, workerTag, versionPreviewUrl, versionPreviewAliasUrl } = await versionsUpload({
          config,
          accountId,
          name: name2,
          rules: getRules(config),
          entry,
          useServiceEnvironments: useServiceEnvironments(config),
          env: args.env,
          compatibilityDate: args.latest ? getTodaysCompatDate() : args.compatibilityDate,
          compatibilityFlags: args.compatibilityFlags,
          vars: cliVars,
          defines: cliDefines,
          alias: cliAlias,
          jsxFactory: args.jsxFactory,
          jsxFragment: args.jsxFragment,
          tsconfig: args.tsconfig,
          assetsOptions,
          minify: args.minify,
          uploadSourceMaps: args.uploadSourceMaps,
          isWorkersSite: Boolean(args.site || config.site),
          outDir: args.outdir,
          dryRun: args.dryRun,
          noBundle: !(args.bundle ?? !config.no_bundle),
          keepVars: config.keep_vars,
          projectRoot: entry.projectRoot,
          tag: args.tag,
          message: args.message,
          previewAlias,
          experimentalAutoCreate: args.experimentalAutoCreate,
          outFile: args.outfile,
          secretsFile: args.secretsFile
        });
        writeOutput({
          type: "version-upload",
          version: 1,
          worker_name: name2 ?? null,
          worker_tag: workerTag,
          version_id: versionId,
          preview_url: versionPreviewUrl,
          preview_alias_url: versionPreviewAliasUrl,
          wrangler_environment: args.env,
          worker_name_overridden: workerNameOverridden
        });
      }, "versionsUploadHandler")
    });
    __name(versionsUpload, "versionsUpload");
    __name(formatTime3, "formatTime");
    MAX_DNS_LABEL_LENGTH = 63;
    HASH_LENGTH = 4;
    ALIAS_VALIDATION_REGEX = /^[a-z](?:[a-z0-9-]*[a-z0-9])?$/i;
    __name(sanitizeBranchName, "sanitizeBranchName");
    __name(getBranchName2, "getBranchName");
    __name(createTruncatedAlias, "createTruncatedAlias");
    __name(generatePreviewAlias, "generatePreviewAlias");
  }
});

// src/versions/view.ts
var BLANK_INPUT5, versionsViewCommand;
var init_view3 = __esm({
  "src/versions/view.ts"() {
    init_import_meta_url();
    init_cli();
    init_dist();
    init_utils2();
    init_create_command();
    init_metrics();
    init_user3();
    init_print_bindings();
    init_render_labelled_values();
    init_api();
    init_list19();
    BLANK_INPUT5 = "-";
    versionsViewCommand = createCommand({
      metadata: {
        description: "View the details of a specific version of your Worker",
        owner: "Workers: Authoring and Testing",
        status: "stable"
      },
      behaviour: {
        printBanner: /* @__PURE__ */ __name((args) => !args.json, "printBanner")
      },
      args: {
        "version-id": {
          describe: "The Worker Version ID to view",
          type: "string",
          requiresArg: true,
          demandOption: true
        },
        name: {
          describe: "Name of the worker",
          type: "string",
          requiresArg: true
        },
        json: {
          describe: "Display output as JSON",
          type: "boolean",
          default: false
        }
      },
      positionalArgs: ["version-id"],
      async handler(args, { config }) {
        sendMetricsEvent("view worker version", {
          sendMetrics: config.send_metrics
        });
        const accountId = await requireAuth(config);
        const workerName = args.name ?? config.name;
        if (workerName === void 0) {
          throw new UserError(
            'You need to provide a name of your worker. Either pass it as a cli arg with `--name <name>` or in your config file as `name = "<name>"`',
            { telemetryMessage: true }
          );
        }
        const version5 = await fetchVersion(
          config,
          accountId,
          workerName,
          args.versionId
        );
        if (args.json) {
          logRaw(JSON.stringify(version5, null, 2));
          return;
        }
        logRaw(
          formatLabelledValues({
            "Version ID": version5.id,
            Created: new Date(version5.metadata["created_on"]).toISOString(),
            Author: version5.metadata.author_email,
            Source: getVersionSource(version5),
            Tag: version5.annotations?.["workers/tag"] || BLANK_INPUT5,
            Message: version5.annotations?.["workers/message"] || BLANK_INPUT5
          })
        );
        const scriptInfo = {};
        if (version5.resources.script.handlers) {
          scriptInfo.Handlers = version5.resources.script.handlers.join(", ");
        }
        if (version5.resources.script_runtime.compatibility_date) {
          scriptInfo["Compatibility Date"] = version5.resources.script_runtime.compatibility_date;
        }
        if (version5.resources.script_runtime.compatibility_flags) {
          scriptInfo["Compatibility Flags"] = version5.resources.script_runtime.compatibility_flags.join(", ");
        }
        if (Object.keys(scriptInfo).length > 0) {
          logRaw("");
          logRaw(formatLabelledValues(scriptInfo));
        }
        const secrets = version5.resources.bindings.filter(
          (binding) => binding.type === "secret_text"
        );
        if (secrets.length > 0) {
          logRaw("Secrets:");
          for (const secret of secrets) {
            logRaw(
              formatLabelledValues({
                "Secret Name": secret.name
              })
            );
          }
        }
        const bindings = version5.resources.bindings.filter(
          (binding) => binding.type !== "secret_text"
        );
        if (bindings.length > 0) {
          printBindings(convertWorkerMetadataBindingsToFlatBindings(bindings));
        }
      }
    });
  }
});

// src/vpc/client.ts
async function createService(config, body) {
  const accountId = await requireAuth(config);
  return await fetchResult(
    config,
    `/accounts/${accountId}/connectivity/directory/services`,
    {
      method: "POST",
      headers: {
        "Content-Type": "application/json"
      },
      body: JSON.stringify(body)
    }
  );
}
async function deleteService(config, serviceId) {
  const accountId = await requireAuth(config);
  return await fetchResult(
    config,
    `/accounts/${accountId}/connectivity/directory/services/${serviceId}`,
    {
      method: "DELETE"
    }
  );
}
async function getService(config, serviceId) {
  const accountId = await requireAuth(config);
  return await fetchResult(
    config,
    `/accounts/${accountId}/connectivity/directory/services/${serviceId}`,
    {
      method: "GET"
    }
  );
}
async function listServices(config) {
  const accountId = await requireAuth(config);
  return await fetchPagedListResult(
    config,
    `/accounts/${accountId}/connectivity/directory/services`,
    {
      method: "GET"
    }
  );
}
async function updateService(config, serviceId, body) {
  const accountId = await requireAuth(config);
  return await fetchResult(
    config,
    `/accounts/${accountId}/connectivity/directory/services/${serviceId}`,
    {
      method: "PUT",
      headers: {
        "Content-Type": "application/json"
      },
      body: JSON.stringify(body)
    }
  );
}
var init_client14 = __esm({
  "src/vpc/client.ts"() {
    init_import_meta_url();
    init_cfetch();
    init_user3();
    __name(createService, "createService");
    __name(deleteService, "deleteService");
    __name(getService, "getService");
    __name(listServices, "listServices");
    __name(updateService, "updateService");
  }
});

// src/vpc/index.ts
var vpcNamespace, vpcServiceNamespace, serviceOptions;
var init_vpc = __esm({
  "src/vpc/index.ts"() {
    init_import_meta_url();
    init_create_command();
    vpcNamespace = createNamespace({
      metadata: {
        description: "\u{1F310} Manage VPC",
        status: "open beta",
        owner: "Product: WVPC",
        category: "Compute & AI"
      }
    });
    vpcServiceNamespace = createNamespace({
      metadata: {
        description: "\u{1F517} Manage VPC services",
        status: "stable",
        owner: "Product: WVPC"
      }
    });
    serviceOptions = {
      name: {
        type: "string",
        demandOption: true,
        group: "Required Configuration",
        description: "The name of the VPC service"
      },
      type: {
        type: "string",
        demandOption: true,
        choices: ["tcp", "http"],
        group: "Required Configuration",
        description: "The type of the VPC service"
      },
      "tcp-port": {
        type: "number",
        conflicts: ["http-port", "https-port"],
        description: "TCP port number",
        group: "TCP Options"
      },
      "app-protocol": {
        type: "string",
        choices: ["postgresql", "mysql"],
        conflicts: ["http-port", "https-port"],
        description: "Application protocol for the TCP service",
        group: "TCP Options"
      },
      "http-port": {
        type: "number",
        conflicts: ["tcp-port"],
        description: "HTTP port (default: 80)",
        group: "Port Configuration"
      },
      "https-port": {
        type: "number",
        conflicts: ["tcp-port"],
        description: "HTTPS port number (default: 443)",
        group: "Port Configuration"
      },
      ipv4: {
        type: "string",
        description: "IPv4 address for the host [conflicts with --ipv6]",
        conflicts: ["hostname", "resolver-ips", "ipv6"],
        group: "IP Configuration [conflicts with --hostname, --resolver-ips]"
      },
      ipv6: {
        type: "string",
        description: "IPv6 address for the host [conflicts with --ipv4]",
        conflicts: ["hostname", "resolver-ips", "ipv4"],
        group: "IP Configuration [conflicts with --hostname, --resolver-ips]"
      },
      hostname: {
        type: "string",
        description: "Hostname for the host",
        conflicts: ["ipv4", "ipv6"],
        group: "Hostname Configuration [conflicts with --ipv4, --ipv6]"
      },
      "resolver-ips": {
        type: "string",
        description: "Comma-separated list of resolver IPs",
        implies: ["hostname"],
        conflicts: ["ipv4", "ipv6"],
        group: "Hostname Configuration [conflicts with --ipv4, --ipv6]"
      },
      "tunnel-id": {
        type: "string",
        demandOption: true,
        group: "Required Configuration",
        description: "UUID of the Cloudflare tunnel"
      },
      "cert-verification-mode": {
        type: "string",
        choices: ["verify_full", "verify_ca", "disabled"],
        description: "TLS certificate verification mode for the connection to the origin",
        group: "TLS Options"
      }
    };
  }
});

// src/vpc/shared.ts
function displayServiceDetails(service) {
  logger.log(`   Name: ${service.name}`);
  logger.log(`   Type: ${service.type}`);
  if (service.type === "tcp" /* Tcp */) {
    if (service.tcp_port) {
      logger.log(`   TCP Port: ${service.tcp_port}`);
    }
    if (service.app_protocol) {
      logger.log(`   App Protocol: ${service.app_protocol}`);
    }
  } else if (service.type === "http" /* Http */) {
    if (service.http_port) {
      logger.log(`   HTTP Port: ${service.http_port}`);
    }
    if (service.https_port) {
      logger.log(`   HTTPS Port: ${service.https_port}`);
    }
  }
  if (service.tls_settings) {
    logger.log(
      `   Cert Verification Mode: ${service.tls_settings.cert_verification_mode}`
    );
  }
  if (service.host.ipv4) {
    logger.log(`   IPv4: ${service.host.ipv4}`);
  }
  if (service.host.ipv6) {
    logger.log(`   IPv6: ${service.host.ipv6}`);
  }
  if (service.host.hostname) {
    logger.log(`   Hostname: ${service.host.hostname}`);
  }
  if (service.host.network) {
    logger.log(`   Tunnel ID: ${service.host.network.tunnel_id}`);
  } else if (service.host.resolver_network) {
    logger.log(`   Tunnel ID: ${service.host.resolver_network.tunnel_id}`);
    if (service.host.resolver_network.resolver_ips) {
      logger.log(
        `   Resolver IPs: ${service.host.resolver_network.resolver_ips.join(", ")}`
      );
    }
  }
}
function formatServiceForTable(service) {
  let ports = "";
  if (service.type === "tcp") {
    if (service.tcp_port) {
      ports = `TCP:${service.tcp_port}`;
      if (service.app_protocol) {
        ports += ` (${service.app_protocol})`;
      }
    }
  } else if (service.type === "http") {
    const httpPorts = [];
    if (service.http_port) {
      httpPorts.push(`HTTP:${service.http_port}`);
    }
    if (service.https_port) {
      httpPorts.push(`HTTPS:${service.https_port}`);
    }
    ports = httpPorts.join(", ");
  }
  let host = "";
  if (service.host.hostname) {
    host = service.host.hostname;
  } else {
    const ips = [];
    if (service.host.ipv4) {
      ips.push(service.host.ipv4);
    }
    if (service.host.ipv6) {
      ips.push(service.host.ipv6);
    }
    host = ips.join(", ");
  }
  const tunnelId = service.host.network?.tunnel_id || service.host.resolver_network?.tunnel_id || "";
  return {
    id: service.service_id,
    name: service.name,
    type: service.type,
    ports,
    host,
    tunnel: tunnelId.substring(0, 8) + "...",
    // Truncate for table display
    created: new Date(service.created_at).toLocaleString(),
    modified: new Date(service.updated_at).toLocaleString()
  };
}
var init_shared7 = __esm({
  "src/vpc/shared.ts"() {
    init_import_meta_url();
    init_logger();
    init_vpc();
    __name(displayServiceDetails, "displayServiceDetails");
    __name(formatServiceForTable, "formatServiceForTable");
  }
});
function validateHostname(hostname2) {
  const trimmed = hostname2.trim();
  if (trimmed.length === 0) {
    throw new UserError("Hostname cannot be empty.");
  }
  const errors = [];
  if (trimmed.length > 253) {
    errors.push("Hostname is too long. Maximum length is 253 characters.");
  }
  const hasScheme = trimmed.includes("://");
  if (hasScheme) {
    errors.push(
      "Hostname must not include a URL scheme (e.g., remove 'https://')."
    );
  }
  const afterScheme = hasScheme ? trimmed.slice(trimmed.indexOf("://") + 3) : trimmed;
  if (afterScheme.includes("/")) {
    errors.push(
      "Hostname must not include a path. Provide only the hostname (e.g., 'api.example.com')."
    );
  }
  const bareValue = trimmed.replace(/^\[|\]$/g, "");
  const isIpAddress2 = net__default.default.isIPv4(trimmed) || net__default.default.isIPv6(bareValue);
  if (isIpAddress2) {
    errors.push(
      "Hostname must not be an IP address. Use --ipv4 or --ipv6 instead."
    );
  }
  if (!isIpAddress2 && !hasScheme && trimmed.includes(":")) {
    errors.push(
      "Hostname must not include a port number. Provide only the hostname and use --http-port or --https-port for ports."
    );
  }
  if (/\s/.test(trimmed)) {
    errors.push("Hostname must not contain whitespace.");
  }
  if (errors.length > 0) {
    throw new UserError(
      `Invalid hostname '${trimmed}':
${errors.map((e10) => `  - ${e10}`).join("\n")}`
    );
  }
}
function extractPortFromHostname(hostname2) {
  try {
    const url4 = new URL(`tcp://${hostname2}`);
    if (url4.port === "") {
      return { hostname: hostname2, port: void 0 };
    }
    const port = parseInt(url4.port, 10);
    if (port < 1) {
      return { hostname: hostname2, port: void 0 };
    }
    return { hostname: url4.hostname, port };
  } catch {
    return { hostname: hostname2, port: void 0 };
  }
}
function toServiceArgs(args) {
  const type = args.type;
  let { hostname: hostname2 } = args;
  let tcpPort = args.tcpPort;
  if (type === "tcp" /* Tcp */ && hostname2) {
    const extracted = extractPortFromHostname(hostname2);
    if (extracted.port !== void 0) {
      if (tcpPort && tcpPort !== extracted.port) {
        throw new UserError(
          `Conflicting TCP port: --hostname includes port ${extracted.port} but --tcp-port is ${tcpPort}. Provide the port in one place only.`
        );
      }
      hostname2 = extracted.hostname;
      tcpPort = extracted.port;
    }
  }
  return {
    name: args.name,
    type,
    tcpPort,
    appProtocol: args.appProtocol,
    httpPort: args.httpPort,
    httpsPort: args.httpsPort,
    ipv4: args.ipv4,
    ipv6: args.ipv6,
    hostname: hostname2,
    tunnelId: args.tunnelId,
    resolverIps: args.resolverIps,
    certVerificationMode: args.certVerificationMode
  };
}
function validateRequest(args) {
  const hasIpAddresses = Boolean(args.ipv4 || args.ipv6);
  const hasHostname = Boolean(args.hostname);
  if (!hasIpAddresses && !hasHostname) {
    throw new UserError(
      "Must specify either IP addresses (--ipv4/--ipv6) or hostname (--hostname)"
    );
  }
  if (args.ipv4 && !net__default.default.isIPv4(args.ipv4)) {
    throw new UserError(
      `Invalid IPv4 address: '${args.ipv4}'. Provide a valid IPv4 address (e.g., '192.168.1.1').`
    );
  }
  if (args.ipv6 && !net__default.default.isIPv6(args.ipv6)) {
    throw new UserError(
      `Invalid IPv6 address: '${args.ipv6}'. Provide a valid IPv6 address (e.g., '2001:db8::1').`
    );
  }
  if (hasHostname && args.hostname) {
    validateHostname(args.hostname);
  }
  if (args.resolverIps) {
    const ips = args.resolverIps.split(",").map((ip) => ip.trim());
    const invalidIps = ips.filter(
      (ip) => ip.length > 0 && !net__default.default.isIPv4(ip) && !net__default.default.isIPv6(ip)
    );
    if (invalidIps.length > 0) {
      throw new UserError(
        `Invalid resolver IP address(es): ${invalidIps.map((ip) => `'${ip}'`).join(", ")}. Provide valid IPv4 or IPv6 addresses.`
      );
    }
  }
  if (args.type === "tcp" /* Tcp */ && !args.tcpPort) {
    throw new UserError("TCP services require a --tcp-port to be specified");
  }
}
function buildRequest(args) {
  let resolverIpsList = void 0;
  if (args.resolverIps) {
    resolverIpsList = args.resolverIps.split(",").map((ip) => ip.trim()).filter((ip) => ip.length > 0);
  }
  const host = {
    ipv4: args.ipv4,
    ipv6: args.ipv6,
    hostname: args.hostname
  };
  if (args.hostname) {
    host.resolver_network = {
      tunnel_id: args.tunnelId,
      ...resolverIpsList && { resolver_ips: resolverIpsList }
    };
  } else {
    host.network = {
      tunnel_id: args.tunnelId
    };
  }
  const request4 = {
    name: args.name,
    type: args.type,
    host
  };
  if (args.type === "tcp" /* Tcp */) {
    request4.tcp_port = args.tcpPort;
    if (args.appProtocol) {
      request4.app_protocol = args.appProtocol;
    }
  } else if (args.type === "http" /* Http */) {
    request4.http_port = args.httpPort;
    request4.https_port = args.httpsPort;
  }
  if (args.certVerificationMode) {
    request4.tls_settings = {
      cert_verification_mode: args.certVerificationMode
    };
  }
  return request4;
}
var init_validation3 = __esm({
  "src/vpc/validation.ts"() {
    init_import_meta_url();
    init_dist();
    init_vpc();
    __name(validateHostname, "validateHostname");
    __name(extractPortFromHostname, "extractPortFromHostname");
    __name(toServiceArgs, "toServiceArgs");
    __name(validateRequest, "validateRequest");
    __name(buildRequest, "buildRequest");
  }
});

// src/vpc/create.ts
var vpcServiceCreateCommand;
var init_create16 = __esm({
  "src/vpc/create.ts"() {
    init_import_meta_url();
    init_create_command();
    init_logger();
    init_client14();
    init_shared7();
    init_validation3();
    init_vpc();
    vpcServiceCreateCommand = createCommand({
      metadata: {
        description: "Create a new VPC service",
        status: "stable",
        owner: "Product: WVPC"
      },
      args: {
        ...serviceOptions
      },
      positionalArgs: ["name"],
      validateArgs: /* @__PURE__ */ __name((args) => {
        validateRequest(toServiceArgs(args));
      }, "validateArgs"),
      async handler(args, { config }) {
        logger.log(`\u{1F6A7} Creating VPC service '${args.name}'`);
        const serviceArgs = toServiceArgs(args);
        const request4 = buildRequest(serviceArgs);
        const service = await createService(config, request4);
        logger.log(`\u2705 Created VPC service: ${service.service_id}`);
        displayServiceDetails(service);
      }
    });
  }
});

// src/vpc/delete.ts
var vpcServiceDeleteCommand;
var init_delete16 = __esm({
  "src/vpc/delete.ts"() {
    init_import_meta_url();
    init_create_command();
    init_logger();
    init_client14();
    vpcServiceDeleteCommand = createCommand({
      metadata: {
        description: "Delete a VPC service",
        status: "stable",
        owner: "Product: WVPC"
      },
      args: {
        "service-id": {
          type: "string",
          demandOption: true,
          description: "The ID of the service to delete"
        }
      },
      positionalArgs: ["service-id"],
      async handler(args, { config }) {
        logger.log(`\u{1F5D1}\uFE0F  Deleting VPC service '${args.serviceId}'`);
        await deleteService(config, args.serviceId);
        logger.log(`\u2705 Deleted VPC service: ${args.serviceId}`);
      }
    });
  }
});

// src/vpc/get.ts
var vpcServiceGetCommand;
var init_get10 = __esm({
  "src/vpc/get.ts"() {
    init_import_meta_url();
    init_create_command();
    init_logger();
    init_client14();
    init_shared7();
    vpcServiceGetCommand = createCommand({
      metadata: {
        description: "Get a VPC service",
        status: "stable",
        owner: "Product: WVPC"
      },
      args: {
        "service-id": {
          type: "string",
          demandOption: true,
          description: "The ID of the VPC service"
        }
      },
      positionalArgs: ["service-id"],
      async handler(args, { config }) {
        logger.log(`\u{1F50D} Getting VPC service '${args.serviceId}'`);
        const service = await getService(config, args.serviceId);
        logger.log(`\u2705 Retrieved VPC service: ${service.service_id}`);
        displayServiceDetails(service);
        logger.log(`   Created: ${new Date(service.created_at).toLocaleString()}`);
        logger.log(`   Modified: ${new Date(service.updated_at).toLocaleString()}`);
      }
    });
  }
});

// src/vpc/list.ts
var vpcServiceListCommand;
var init_list22 = __esm({
  "src/vpc/list.ts"() {
    init_import_meta_url();
    init_create_command();
    init_logger();
    init_client14();
    init_shared7();
    vpcServiceListCommand = createCommand({
      metadata: {
        description: "List VPC services",
        status: "stable",
        owner: "Product: WVPC"
      },
      args: {},
      async handler(args, { config }) {
        logger.log(`\u{1F4CB} Listing VPC services`);
        const services = await listServices(config);
        if (services.length === 0) {
          logger.log("No VPC services found");
          return;
        }
        logger.table(services.map(formatServiceForTable));
      }
    });
  }
});

// src/vpc/update.ts
var vpcServiceUpdateCommand;
var init_update7 = __esm({
  "src/vpc/update.ts"() {
    init_import_meta_url();
    init_create_command();
    init_logger();
    init_client14();
    init_shared7();
    init_validation3();
    init_vpc();
    vpcServiceUpdateCommand = createCommand({
      metadata: {
        description: "Update a VPC service",
        status: "stable",
        owner: "Product: WVPC"
      },
      args: {
        "service-id": {
          type: "string",
          demandOption: true,
          description: "The ID of the VPC service to update"
        },
        ...serviceOptions
      },
      positionalArgs: ["service-id"],
      validateArgs: /* @__PURE__ */ __name((args) => {
        validateRequest(toServiceArgs(args));
      }, "validateArgs"),
      async handler(args, { config }) {
        logger.log(`\u{1F6A7} Updating VPC service '${args.serviceId}'`);
        const serviceArgs = toServiceArgs(args);
        const request4 = buildRequest(serviceArgs);
        const service = await updateService(config, args.serviceId, request4);
        logger.log(`\u2705 Updated VPC service: ${service.service_id}`);
        displayServiceDetails(service);
      }
    });
  }
});

// src/workflows/index.ts
var workflowsNamespace, workflowsInstanceNamespace;
var init_workflows2 = __esm({
  "src/workflows/index.ts"() {
    init_import_meta_url();
    init_create_command();
    workflowsNamespace = createNamespace({
      metadata: {
        description: "\u{1F501} Manage Workflows",
        owner: "Product: Workflows",
        status: "stable",
        category: "Compute & AI"
      }
    });
    workflowsInstanceNamespace = createNamespace({
      metadata: {
        description: "Manage Workflow instances",
        owner: "Product: Workflows",
        status: "stable"
      }
    });
  }
});

// src/workflows/local.ts
async function fetchLocalResult(port, path84, init4) {
  const url4 = `http://localhost:${port}${LOCAL_EXPLORER_BASE_PATH}${path84}`;
  let response;
  try {
    response = await (0, import_undici24.fetch)(url4, {
      method: init4?.method ?? "GET",
      headers: init4?.headers,
      body: init4?.body
    });
  } catch (error2) {
    const message = error2 instanceof Error ? error2.message : "Unknown network error";
    throw new UserError(
      `Could not connect to local dev session on port ${port}. Make sure "wrangler dev" is running.
  ${message}`
    );
  }
  if (!response.ok) {
    const json2 = await response.json().catch(() => null);
    const errorMessage = json2?.errors?.[0]?.message ?? `HTTP ${response.status}`;
    throw new UserError(`Local API error: ${errorMessage}`);
  }
  const json = await response.json();
  if (!json.success) {
    const errorMessage = json.errors?.[0]?.message ?? "Unknown local API error";
    throw new UserError(`Local API error: ${errorMessage}`);
  }
  return json.result;
}
async function getLocalInstanceIdFromArgs(port, args) {
  let id = args.id;
  if (id === "latest") {
    const instances = await fetchLocalResult(port, `/workflows/${encodeURIComponent(args.name)}/instances`);
    if (instances.length === 0) {
      throw new UserError(`There are no instances in workflow "${args.name}"`);
    }
    const sorted = instances.sort(
      (a7, b11) => (b11.created_on ?? "").localeCompare(a7.created_on ?? "")
    );
    id = sorted[0].id;
    logger.info(`Latest instance is "${id}"`);
  }
  return id;
}
async function updateLocalInstanceStatus(port, workflowName, instanceId, action) {
  await fetchLocalResult(
    port,
    `/workflows/${encodeURIComponent(workflowName)}/instances/${encodeURIComponent(instanceId)}/status`,
    {
      method: "PATCH",
      headers: { "Content-Type": "application/json" },
      body: JSON.stringify({ action })
    }
  );
}
var import_undici24, LOCAL_EXPLORER_BASE_PATH, DEFAULT_LOCAL_PORT2, localWorkflowArgs;
var init_local = __esm({
  "src/workflows/local.ts"() {
    init_import_meta_url();
    init_dist();
    import_undici24 = __toESM(require_undici());
    init_logger();
    LOCAL_EXPLORER_BASE_PATH = "/cdn-cgi/explorer/api";
    DEFAULT_LOCAL_PORT2 = 8787;
    localWorkflowArgs = {
      local: {
        type: "boolean",
        describe: "Interact with local dev session"
      },
      port: {
        type: "number",
        describe: "Port of the local dev session (default: 8787)",
        default: DEFAULT_LOCAL_PORT2
      }
    };
    __name(fetchLocalResult, "fetchLocalResult");
    __name(getLocalInstanceIdFromArgs, "getLocalInstanceIdFromArgs");
    __name(updateLocalInstanceStatus, "updateLocalInstanceStatus");
  }
});

// src/workflows/commands/delete.ts
var workflowsDeleteCommand;
var init_delete17 = __esm({
  "src/workflows/commands/delete.ts"() {
    init_import_meta_url();
    init_cfetch();
    init_create_command();
    init_logger();
    init_user3();
    init_local();
    workflowsDeleteCommand = createCommand({
      metadata: {
        description: "Delete workflow - when deleting a workflow, it will also delete it's own instances",
        owner: "Product: Workflows",
        status: "stable"
      },
      args: {
        ...localWorkflowArgs,
        name: {
          describe: "Name of the workflow",
          type: "string",
          demandOption: true
        }
      },
      positionalArgs: ["name"],
      async handler(args, { config }) {
        if (args.local) {
          await fetchLocalResult(
            args.port,
            `/workflows/${encodeURIComponent(args.name)}`,
            { method: "DELETE" }
          );
          logger.log(
            `\u2705 Workflow "${args.name}" instances removed successfully from local dev session.`
          );
        } else {
          const accountId = await requireAuth(config);
          await fetchResult(
            config,
            `/accounts/${accountId}/workflows/${args.name}`,
            { method: "DELETE" }
          );
          logger.log(
            `\u2705 Workflow "${args.name}" removed successfully. 
 Note that running instances might take a few minutes to be properly terminated.`
          );
        }
      }
    });
  }
});

// src/workflows/commands/describe.ts
var workflowsDescribeCommand;
var init_describe = __esm({
  "src/workflows/commands/describe.ts"() {
    init_import_meta_url();
    init_cli();
    init_colors();
    init_cfetch();
    init_create_command();
    init_user3();
    init_render_labelled_values();
    init_local();
    workflowsDescribeCommand = createCommand({
      metadata: {
        description: "Describe Workflow resource",
        owner: "Product: Workflows",
        status: "stable"
      },
      args: {
        ...localWorkflowArgs,
        name: {
          describe: "Name of the workflow",
          type: "string",
          demandOption: true
        }
      },
      positionalArgs: ["name"],
      async handler(args, { config }) {
        if (args.local) {
          const workflow = await fetchLocalResult(
            args.port,
            `/workflows/${encodeURIComponent(args.name)}`
          );
          logRaw(
            formatLabelledValues({
              Name: workflow.name,
              "Script Name": workflow.script_name,
              "Class Name": workflow.class_name
            })
          );
          if (workflow.instances) {
            logRaw(white("Instance Status Counts:"));
            logRaw(
              formatLabelledValues(
                Object.fromEntries(
                  Object.entries(workflow.instances).map(([status2, count]) => [
                    status2,
                    String(count)
                  ])
                ),
                { indentationCount: 2 }
              )
            );
          }
        } else {
          const accountId = await requireAuth(config);
          const workflow = await fetchResult(
            config,
            `/accounts/${accountId}/workflows/${args.name}`
          );
          const versions2 = await fetchResult(
            config,
            `/accounts/${accountId}/workflows/${args.name}/versions`
          );
          const latestVersion = versions2[0];
          logRaw(
            formatLabelledValues({
              Name: workflow.name,
              Id: workflow.id,
              "Script Name": workflow.script_name,
              "Class Name": workflow.class_name,
              "Created On": workflow.created_on,
              "Modified On": workflow.modified_on
            })
          );
          logRaw(white("Latest Version:"));
          logRaw(
            formatLabelledValues(
              {
                Id: latestVersion.id,
                "Created On": workflow.created_on,
                "Modified On": workflow.modified_on
              },
              { indentationCount: 2 }
            )
          );
        }
      }
    });
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/constants.js
var millisecondsInMinute, minutesInYear, minutesInMonth, minutesInDay, constructFromSymbol;
var init_constants20 = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/constants.js"() {
    init_import_meta_url();
    millisecondsInMinute = 6e4;
    minutesInYear = 525600;
    minutesInMonth = 43200;
    minutesInDay = 1440;
    constructFromSymbol = Symbol.for("constructDateFrom");
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/constructFrom.js
function constructFrom(date, value) {
  if (typeof date === "function") return date(value);
  if (date && typeof date === "object" && constructFromSymbol in date)
    return date[constructFromSymbol](value);
  if (date instanceof Date) return new date.constructor(value);
  return new Date(value);
}
var init_constructFrom = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/constructFrom.js"() {
    init_import_meta_url();
    init_constants20();
    __name(constructFrom, "constructFrom");
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/toDate.js
function toDate3(argument, context2) {
  return constructFrom(context2 || argument, argument);
}
var init_toDate = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/toDate.js"() {
    init_import_meta_url();
    init_constructFrom();
    __name(toDate3, "toDate");
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/addDays.js
var init_addDays = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/addDays.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/addMonths.js
var init_addMonths = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/addMonths.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/add.js
var init_add3 = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/add.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isSaturday.js
var init_isSaturday = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isSaturday.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isSunday.js
var init_isSunday = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isSunday.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isWeekend.js
var init_isWeekend = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isWeekend.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/addBusinessDays.js
var init_addBusinessDays = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/addBusinessDays.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/addMilliseconds.js
function addMilliseconds(date, amount, options) {
  return constructFrom(options?.in || date, +toDate3(date) + amount);
}
var init_addMilliseconds = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/addMilliseconds.js"() {
    init_import_meta_url();
    init_constructFrom();
    init_toDate();
    __name(addMilliseconds, "addMilliseconds");
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/addHours.js
var init_addHours = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/addHours.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/defaultOptions.js
function getDefaultOptions() {
  return defaultOptions3;
}
var defaultOptions3;
var init_defaultOptions = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/defaultOptions.js"() {
    init_import_meta_url();
    defaultOptions3 = {};
    __name(getDefaultOptions, "getDefaultOptions");
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfWeek.js
var init_startOfWeek = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfWeek.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfISOWeek.js
var init_startOfISOWeek = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfISOWeek.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getISOWeekYear.js
var init_getISOWeekYear = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getISOWeekYear.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js
function getTimezoneOffsetInMilliseconds(date) {
  const _date = toDate3(date);
  const utcDate = new Date(
    Date.UTC(
      _date.getFullYear(),
      _date.getMonth(),
      _date.getDate(),
      _date.getHours(),
      _date.getMinutes(),
      _date.getSeconds(),
      _date.getMilliseconds()
    )
  );
  utcDate.setUTCFullYear(_date.getFullYear());
  return +date - +utcDate;
}
var init_getTimezoneOffsetInMilliseconds = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js"() {
    init_import_meta_url();
    init_toDate();
    __name(getTimezoneOffsetInMilliseconds, "getTimezoneOffsetInMilliseconds");
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/normalizeDates.js
function normalizeDates(context2, ...dates) {
  const normalize6 = constructFrom.bind(
    null,
    context2 || dates.find((date) => typeof date === "object")
  );
  return dates.map(normalize6);
}
var init_normalizeDates = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/normalizeDates.js"() {
    init_import_meta_url();
    init_constructFrom();
    __name(normalizeDates, "normalizeDates");
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfDay.js
var init_startOfDay = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfDay.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/differenceInCalendarDays.js
var init_differenceInCalendarDays = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/differenceInCalendarDays.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfISOWeekYear.js
var init_startOfISOWeekYear = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfISOWeekYear.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/setISOWeekYear.js
var init_setISOWeekYear = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/setISOWeekYear.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/addISOWeekYears.js
var init_addISOWeekYears = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/addISOWeekYears.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/addMinutes.js
var init_addMinutes = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/addMinutes.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/addQuarters.js
var init_addQuarters = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/addQuarters.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/addSeconds.js
var init_addSeconds = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/addSeconds.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/addWeeks.js
var init_addWeeks = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/addWeeks.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/addYears.js
var init_addYears = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/addYears.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/areIntervalsOverlapping.js
var init_areIntervalsOverlapping = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/areIntervalsOverlapping.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/max.js
var init_max = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/max.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/min.js
var init_min = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/min.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/clamp.js
var init_clamp = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/clamp.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/closestIndexTo.js
var init_closestIndexTo = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/closestIndexTo.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/closestTo.js
var init_closestTo = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/closestTo.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/compareAsc.js
function compareAsc(dateLeft, dateRight) {
  const diff = +toDate3(dateLeft) - +toDate3(dateRight);
  if (diff < 0) return -1;
  else if (diff > 0) return 1;
  return diff;
}
var init_compareAsc = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/compareAsc.js"() {
    init_import_meta_url();
    init_toDate();
    __name(compareAsc, "compareAsc");
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/compareDesc.js
var init_compareDesc = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/compareDesc.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/constructNow.js
function constructNow(date) {
  return constructFrom(date, Date.now());
}
var init_constructNow = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/constructNow.js"() {
    init_import_meta_url();
    init_constructFrom();
    __name(constructNow, "constructNow");
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/daysToWeeks.js
var init_daysToWeeks = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/daysToWeeks.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isSameDay.js
var init_isSameDay = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isSameDay.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isDate.js
var init_isDate = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isDate.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isValid.js
var init_isValid = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isValid.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/differenceInBusinessDays.js
var init_differenceInBusinessDays = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/differenceInBusinessDays.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/differenceInCalendarISOWeekYears.js
var init_differenceInCalendarISOWeekYears = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/differenceInCalendarISOWeekYears.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/differenceInCalendarISOWeeks.js
var init_differenceInCalendarISOWeeks = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/differenceInCalendarISOWeeks.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/differenceInCalendarMonths.js
var init_differenceInCalendarMonths = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/differenceInCalendarMonths.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getQuarter.js
var init_getQuarter = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getQuarter.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/differenceInCalendarQuarters.js
var init_differenceInCalendarQuarters = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/differenceInCalendarQuarters.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/differenceInCalendarWeeks.js
var init_differenceInCalendarWeeks = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/differenceInCalendarWeeks.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/differenceInCalendarYears.js
var init_differenceInCalendarYears = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/differenceInCalendarYears.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/differenceInDays.js
var init_differenceInDays = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/differenceInDays.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/getRoundingMethod.js
function getRoundingMethod(method) {
  return (number) => {
    const round = method ? Math[method] : Math.trunc;
    const result = round(number);
    return result === 0 ? 0 : result;
  };
}
var init_getRoundingMethod = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/getRoundingMethod.js"() {
    init_import_meta_url();
    __name(getRoundingMethod, "getRoundingMethod");
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/differenceInHours.js
var init_differenceInHours = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/differenceInHours.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/subISOWeekYears.js
var init_subISOWeekYears = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/subISOWeekYears.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/differenceInISOWeekYears.js
var init_differenceInISOWeekYears = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/differenceInISOWeekYears.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/differenceInMilliseconds.js
var init_differenceInMilliseconds = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/differenceInMilliseconds.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/differenceInMinutes.js
var init_differenceInMinutes = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/differenceInMinutes.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/endOfDay.js
var init_endOfDay = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/endOfDay.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/endOfMonth.js
var init_endOfMonth = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/endOfMonth.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isLastDayOfMonth.js
var init_isLastDayOfMonth = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isLastDayOfMonth.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/differenceInMonths.js
var init_differenceInMonths = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/differenceInMonths.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/differenceInQuarters.js
var init_differenceInQuarters = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/differenceInQuarters.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/differenceInSeconds.js
var init_differenceInSeconds = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/differenceInSeconds.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/differenceInWeeks.js
var init_differenceInWeeks = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/differenceInWeeks.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/differenceInYears.js
var init_differenceInYears = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/differenceInYears.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/eachDayOfInterval.js
var init_eachDayOfInterval = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/eachDayOfInterval.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/eachHourOfInterval.js
var init_eachHourOfInterval = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/eachHourOfInterval.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/eachMinuteOfInterval.js
var init_eachMinuteOfInterval = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/eachMinuteOfInterval.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/eachMonthOfInterval.js
var init_eachMonthOfInterval = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/eachMonthOfInterval.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfQuarter.js
var init_startOfQuarter = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfQuarter.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/eachQuarterOfInterval.js
var init_eachQuarterOfInterval = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/eachQuarterOfInterval.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/eachWeekOfInterval.js
var init_eachWeekOfInterval = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/eachWeekOfInterval.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/eachWeekendOfInterval.js
var init_eachWeekendOfInterval = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/eachWeekendOfInterval.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfMonth.js
var init_startOfMonth = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfMonth.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/eachWeekendOfMonth.js
var init_eachWeekendOfMonth = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/eachWeekendOfMonth.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/endOfYear.js
var init_endOfYear = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/endOfYear.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfYear.js
var init_startOfYear = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfYear.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/eachWeekendOfYear.js
var init_eachWeekendOfYear = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/eachWeekendOfYear.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/eachYearOfInterval.js
var init_eachYearOfInterval = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/eachYearOfInterval.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/endOfDecade.js
var init_endOfDecade = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/endOfDecade.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/endOfHour.js
var init_endOfHour = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/endOfHour.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/endOfWeek.js
var init_endOfWeek = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/endOfWeek.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/endOfISOWeek.js
var init_endOfISOWeek = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/endOfISOWeek.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/endOfISOWeekYear.js
var init_endOfISOWeekYear = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/endOfISOWeekYear.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/endOfMinute.js
var init_endOfMinute = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/endOfMinute.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/endOfQuarter.js
var init_endOfQuarter = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/endOfQuarter.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/endOfSecond.js
var init_endOfSecond = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/endOfSecond.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/endOfToday.js
var init_endOfToday = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/endOfToday.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/endOfTomorrow.js
var init_endOfTomorrow = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/endOfTomorrow.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/endOfYesterday.js
var init_endOfYesterday = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/endOfYesterday.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/en-US/_lib/formatDistance.js
var formatDistanceLocale, formatDistance;
var init_formatDistance = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/en-US/_lib/formatDistance.js"() {
    init_import_meta_url();
    formatDistanceLocale = {
      lessThanXSeconds: {
        one: "less than a second",
        other: "less than {{count}} seconds"
      },
      xSeconds: {
        one: "1 second",
        other: "{{count}} seconds"
      },
      halfAMinute: "half a minute",
      lessThanXMinutes: {
        one: "less than a minute",
        other: "less than {{count}} minutes"
      },
      xMinutes: {
        one: "1 minute",
        other: "{{count}} minutes"
      },
      aboutXHours: {
        one: "about 1 hour",
        other: "about {{count}} hours"
      },
      xHours: {
        one: "1 hour",
        other: "{{count}} hours"
      },
      xDays: {
        one: "1 day",
        other: "{{count}} days"
      },
      aboutXWeeks: {
        one: "about 1 week",
        other: "about {{count}} weeks"
      },
      xWeeks: {
        one: "1 week",
        other: "{{count}} weeks"
      },
      aboutXMonths: {
        one: "about 1 month",
        other: "about {{count}} months"
      },
      xMonths: {
        one: "1 month",
        other: "{{count}} months"
      },
      aboutXYears: {
        one: "about 1 year",
        other: "about {{count}} years"
      },
      xYears: {
        one: "1 year",
        other: "{{count}} years"
      },
      overXYears: {
        one: "over 1 year",
        other: "over {{count}} years"
      },
      almostXYears: {
        one: "almost 1 year",
        other: "almost {{count}} years"
      }
    };
    formatDistance = /* @__PURE__ */ __name((token, count, options) => {
      let result;
      const tokenValue = formatDistanceLocale[token];
      if (typeof tokenValue === "string") {
        result = tokenValue;
      } else if (count === 1) {
        result = tokenValue.one;
      } else {
        result = tokenValue.other.replace("{{count}}", count.toString());
      }
      if (options?.addSuffix) {
        if (options.comparison && options.comparison > 0) {
          return "in " + result;
        } else {
          return result + " ago";
        }
      }
      return result;
    }, "formatDistance");
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/_lib/buildFormatLongFn.js
function buildFormatLongFn(args) {
  return (options = {}) => {
    const width = options.width ? String(options.width) : args.defaultWidth;
    const format11 = args.formats[width] || args.formats[args.defaultWidth];
    return format11;
  };
}
var init_buildFormatLongFn = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/_lib/buildFormatLongFn.js"() {
    init_import_meta_url();
    __name(buildFormatLongFn, "buildFormatLongFn");
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/en-US/_lib/formatLong.js
var dateFormats, timeFormats, dateTimeFormats, formatLong;
var init_formatLong = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/en-US/_lib/formatLong.js"() {
    init_import_meta_url();
    init_buildFormatLongFn();
    dateFormats = {
      full: "EEEE, MMMM do, y",
      long: "MMMM do, y",
      medium: "MMM d, y",
      short: "MM/dd/yyyy"
    };
    timeFormats = {
      full: "h:mm:ss a zzzz",
      long: "h:mm:ss a z",
      medium: "h:mm:ss a",
      short: "h:mm a"
    };
    dateTimeFormats = {
      full: "{{date}} 'at' {{time}}",
      long: "{{date}} 'at' {{time}}",
      medium: "{{date}}, {{time}}",
      short: "{{date}}, {{time}}"
    };
    formatLong = {
      date: buildFormatLongFn({
        formats: dateFormats,
        defaultWidth: "full"
      }),
      time: buildFormatLongFn({
        formats: timeFormats,
        defaultWidth: "full"
      }),
      dateTime: buildFormatLongFn({
        formats: dateTimeFormats,
        defaultWidth: "full"
      })
    };
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/en-US/_lib/formatRelative.js
var formatRelativeLocale, formatRelative;
var init_formatRelative = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/en-US/_lib/formatRelative.js"() {
    init_import_meta_url();
    formatRelativeLocale = {
      lastWeek: "'last' eeee 'at' p",
      yesterday: "'yesterday at' p",
      today: "'today at' p",
      tomorrow: "'tomorrow at' p",
      nextWeek: "eeee 'at' p",
      other: "P"
    };
    formatRelative = /* @__PURE__ */ __name((token, _date, _baseDate, _options) => formatRelativeLocale[token], "formatRelative");
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/_lib/buildLocalizeFn.js
function buildLocalizeFn(args) {
  return (value, options) => {
    const context2 = options?.context ? String(options.context) : "standalone";
    let valuesArray;
    if (context2 === "formatting" && args.formattingValues) {
      const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
      const width = options?.width ? String(options.width) : defaultWidth;
      valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
    } else {
      const defaultWidth = args.defaultWidth;
      const width = options?.width ? String(options.width) : args.defaultWidth;
      valuesArray = args.values[width] || args.values[defaultWidth];
    }
    const index = args.argumentCallback ? args.argumentCallback(value) : value;
    return valuesArray[index];
  };
}
var init_buildLocalizeFn = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/_lib/buildLocalizeFn.js"() {
    init_import_meta_url();
    __name(buildLocalizeFn, "buildLocalizeFn");
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/en-US/_lib/localize.js
var eraValues, quarterValues, monthValues, dayValues, dayPeriodValues, formattingDayPeriodValues, ordinalNumber, localize;
var init_localize = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/en-US/_lib/localize.js"() {
    init_import_meta_url();
    init_buildLocalizeFn();
    eraValues = {
      narrow: ["B", "A"],
      abbreviated: ["BC", "AD"],
      wide: ["Before Christ", "Anno Domini"]
    };
    quarterValues = {
      narrow: ["1", "2", "3", "4"],
      abbreviated: ["Q1", "Q2", "Q3", "Q4"],
      wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
    };
    monthValues = {
      narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
      abbreviated: [
        "Jan",
        "Feb",
        "Mar",
        "Apr",
        "May",
        "Jun",
        "Jul",
        "Aug",
        "Sep",
        "Oct",
        "Nov",
        "Dec"
      ],
      wide: [
        "January",
        "February",
        "March",
        "April",
        "May",
        "June",
        "July",
        "August",
        "September",
        "October",
        "November",
        "December"
      ]
    };
    dayValues = {
      narrow: ["S", "M", "T", "W", "T", "F", "S"],
      short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
      abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
      wide: [
        "Sunday",
        "Monday",
        "Tuesday",
        "Wednesday",
        "Thursday",
        "Friday",
        "Saturday"
      ]
    };
    dayPeriodValues = {
      narrow: {
        am: "a",
        pm: "p",
        midnight: "mi",
        noon: "n",
        morning: "morning",
        afternoon: "afternoon",
        evening: "evening",
        night: "night"
      },
      abbreviated: {
        am: "AM",
        pm: "PM",
        midnight: "midnight",
        noon: "noon",
        morning: "morning",
        afternoon: "afternoon",
        evening: "evening",
        night: "night"
      },
      wide: {
        am: "a.m.",
        pm: "p.m.",
        midnight: "midnight",
        noon: "noon",
        morning: "morning",
        afternoon: "afternoon",
        evening: "evening",
        night: "night"
      }
    };
    formattingDayPeriodValues = {
      narrow: {
        am: "a",
        pm: "p",
        midnight: "mi",
        noon: "n",
        morning: "in the morning",
        afternoon: "in the afternoon",
        evening: "in the evening",
        night: "at night"
      },
      abbreviated: {
        am: "AM",
        pm: "PM",
        midnight: "midnight",
        noon: "noon",
        morning: "in the morning",
        afternoon: "in the afternoon",
        evening: "in the evening",
        night: "at night"
      },
      wide: {
        am: "a.m.",
        pm: "p.m.",
        midnight: "midnight",
        noon: "noon",
        morning: "in the morning",
        afternoon: "in the afternoon",
        evening: "in the evening",
        night: "at night"
      }
    };
    ordinalNumber = /* @__PURE__ */ __name((dirtyNumber, _options) => {
      const number = Number(dirtyNumber);
      const rem100 = number % 100;
      if (rem100 > 20 || rem100 < 10) {
        switch (rem100 % 10) {
          case 1:
            return number + "st";
          case 2:
            return number + "nd";
          case 3:
            return number + "rd";
        }
      }
      return number + "th";
    }, "ordinalNumber");
    localize = {
      ordinalNumber,
      era: buildLocalizeFn({
        values: eraValues,
        defaultWidth: "wide"
      }),
      quarter: buildLocalizeFn({
        values: quarterValues,
        defaultWidth: "wide",
        argumentCallback: /* @__PURE__ */ __name((quarter) => quarter - 1, "argumentCallback")
      }),
      month: buildLocalizeFn({
        values: monthValues,
        defaultWidth: "wide"
      }),
      day: buildLocalizeFn({
        values: dayValues,
        defaultWidth: "wide"
      }),
      dayPeriod: buildLocalizeFn({
        values: dayPeriodValues,
        defaultWidth: "wide",
        formattingValues: formattingDayPeriodValues,
        defaultFormattingWidth: "wide"
      })
    };
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/_lib/buildMatchFn.js
function buildMatchFn(args) {
  return (string, options = {}) => {
    const width = options.width;
    const matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
    const matchResult = string.match(matchPattern);
    if (!matchResult) {
      return null;
    }
    const matchedString = matchResult[0];
    const parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
    const key = Array.isArray(parsePatterns) ? findIndex2(parsePatterns, (pattern) => pattern.test(matchedString)) : (
      // [TODO] -- I challenge you to fix the type
      findKey(parsePatterns, (pattern) => pattern.test(matchedString))
    );
    let value;
    value = args.valueCallback ? args.valueCallback(key) : key;
    value = options.valueCallback ? (
      // [TODO] -- I challenge you to fix the type
      options.valueCallback(value)
    ) : value;
    const rest = string.slice(matchedString.length);
    return { value, rest };
  };
}
function findKey(object, predicate) {
  for (const key in object) {
    if (Object.prototype.hasOwnProperty.call(object, key) && predicate(object[key])) {
      return key;
    }
  }
  return void 0;
}
function findIndex2(array, predicate) {
  for (let key = 0; key < array.length; key++) {
    if (predicate(array[key])) {
      return key;
    }
  }
  return void 0;
}
var init_buildMatchFn = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/_lib/buildMatchFn.js"() {
    init_import_meta_url();
    __name(buildMatchFn, "buildMatchFn");
    __name(findKey, "findKey");
    __name(findIndex2, "findIndex");
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js
function buildMatchPatternFn(args) {
  return (string, options = {}) => {
    const matchResult = string.match(args.matchPattern);
    if (!matchResult) return null;
    const matchedString = matchResult[0];
    const parseResult = string.match(args.parsePattern);
    if (!parseResult) return null;
    let value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
    value = options.valueCallback ? options.valueCallback(value) : value;
    const rest = string.slice(matchedString.length);
    return { value, rest };
  };
}
var init_buildMatchPatternFn = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js"() {
    init_import_meta_url();
    __name(buildMatchPatternFn, "buildMatchPatternFn");
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/en-US/_lib/match.js
var matchOrdinalNumberPattern, parseOrdinalNumberPattern, matchEraPatterns, parseEraPatterns, matchQuarterPatterns, parseQuarterPatterns, matchMonthPatterns, parseMonthPatterns, matchDayPatterns, parseDayPatterns, matchDayPeriodPatterns, parseDayPeriodPatterns, match2;
var init_match = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/en-US/_lib/match.js"() {
    init_import_meta_url();
    init_buildMatchFn();
    init_buildMatchPatternFn();
    matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
    parseOrdinalNumberPattern = /\d+/i;
    matchEraPatterns = {
      narrow: /^(b|a)/i,
      abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
      wide: /^(before christ|before common era|anno domini|common era)/i
    };
    parseEraPatterns = {
      any: [/^b/i, /^(a|c)/i]
    };
    matchQuarterPatterns = {
      narrow: /^[1234]/i,
      abbreviated: /^q[1234]/i,
      wide: /^[1234](th|st|nd|rd)? quarter/i
    };
    parseQuarterPatterns = {
      any: [/1/i, /2/i, /3/i, /4/i]
    };
    matchMonthPatterns = {
      narrow: /^[jfmasond]/i,
      abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
      wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
    };
    parseMonthPatterns = {
      narrow: [
        /^j/i,
        /^f/i,
        /^m/i,
        /^a/i,
        /^m/i,
        /^j/i,
        /^j/i,
        /^a/i,
        /^s/i,
        /^o/i,
        /^n/i,
        /^d/i
      ],
      any: [
        /^ja/i,
        /^f/i,
        /^mar/i,
        /^ap/i,
        /^may/i,
        /^jun/i,
        /^jul/i,
        /^au/i,
        /^s/i,
        /^o/i,
        /^n/i,
        /^d/i
      ]
    };
    matchDayPatterns = {
      narrow: /^[smtwf]/i,
      short: /^(su|mo|tu|we|th|fr|sa)/i,
      abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
      wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
    };
    parseDayPatterns = {
      narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
      any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
    };
    matchDayPeriodPatterns = {
      narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
      any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
    };
    parseDayPeriodPatterns = {
      any: {
        am: /^a/i,
        pm: /^p/i,
        midnight: /^mi/i,
        noon: /^no/i,
        morning: /morning/i,
        afternoon: /afternoon/i,
        evening: /evening/i,
        night: /night/i
      }
    };
    match2 = {
      ordinalNumber: buildMatchPatternFn({
        matchPattern: matchOrdinalNumberPattern,
        parsePattern: parseOrdinalNumberPattern,
        valueCallback: /* @__PURE__ */ __name((value) => parseInt(value, 10), "valueCallback")
      }),
      era: buildMatchFn({
        matchPatterns: matchEraPatterns,
        defaultMatchWidth: "wide",
        parsePatterns: parseEraPatterns,
        defaultParseWidth: "any"
      }),
      quarter: buildMatchFn({
        matchPatterns: matchQuarterPatterns,
        defaultMatchWidth: "wide",
        parsePatterns: parseQuarterPatterns,
        defaultParseWidth: "any",
        valueCallback: /* @__PURE__ */ __name((index) => index + 1, "valueCallback")
      }),
      month: buildMatchFn({
        matchPatterns: matchMonthPatterns,
        defaultMatchWidth: "wide",
        parsePatterns: parseMonthPatterns,
        defaultParseWidth: "any"
      }),
      day: buildMatchFn({
        matchPatterns: matchDayPatterns,
        defaultMatchWidth: "wide",
        parsePatterns: parseDayPatterns,
        defaultParseWidth: "any"
      }),
      dayPeriod: buildMatchFn({
        matchPatterns: matchDayPeriodPatterns,
        defaultMatchWidth: "any",
        parsePatterns: parseDayPeriodPatterns,
        defaultParseWidth: "any"
      })
    };
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/en-US.js
var enUS;
var init_en_US2 = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/en-US.js"() {
    init_import_meta_url();
    init_formatDistance();
    init_formatLong();
    init_formatRelative();
    init_localize();
    init_match();
    enUS = {
      code: "en-US",
      formatDistance,
      formatLong,
      formatRelative,
      localize,
      match: match2,
      options: {
        weekStartsOn: 0,
        firstWeekContainsDate: 1
      }
    };
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/defaultLocale.js
var init_defaultLocale = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/defaultLocale.js"() {
    init_import_meta_url();
    init_en_US2();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getDayOfYear.js
var init_getDayOfYear = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getDayOfYear.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getISOWeek.js
var init_getISOWeek = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getISOWeek.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getWeekYear.js
var init_getWeekYear = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getWeekYear.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfWeekYear.js
var init_startOfWeekYear = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfWeekYear.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getWeek.js
var init_getWeek = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getWeek.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/format.js
var init_format3 = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/format.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/formatDistance.js
var init_formatDistance2 = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/formatDistance.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/formatDistanceStrict.js
function formatDistanceStrict(laterDate, earlierDate, options) {
  const defaultOptions4 = getDefaultOptions();
  const locale = options?.locale ?? defaultOptions4.locale ?? enUS;
  const comparison = compareAsc(laterDate, earlierDate);
  if (isNaN(comparison)) {
    throw new RangeError("Invalid time value");
  }
  const localizeOptions = Object.assign({}, options, {
    addSuffix: options?.addSuffix,
    comparison
  });
  const [laterDate_, earlierDate_] = normalizeDates(
    options?.in,
    ...comparison > 0 ? [earlierDate, laterDate] : [laterDate, earlierDate]
  );
  const roundingMethod = getRoundingMethod(options?.roundingMethod ?? "round");
  const milliseconds = earlierDate_.getTime() - laterDate_.getTime();
  const minutes = milliseconds / millisecondsInMinute;
  const timezoneOffset = getTimezoneOffsetInMilliseconds(earlierDate_) - getTimezoneOffsetInMilliseconds(laterDate_);
  const dstNormalizedMinutes = (milliseconds - timezoneOffset) / millisecondsInMinute;
  const defaultUnit = options?.unit;
  let unit;
  if (!defaultUnit) {
    if (minutes < 1) {
      unit = "second";
    } else if (minutes < 60) {
      unit = "minute";
    } else if (minutes < minutesInDay) {
      unit = "hour";
    } else if (dstNormalizedMinutes < minutesInMonth) {
      unit = "day";
    } else if (dstNormalizedMinutes < minutesInYear) {
      unit = "month";
    } else {
      unit = "year";
    }
  } else {
    unit = defaultUnit;
  }
  if (unit === "second") {
    const seconds = roundingMethod(milliseconds / 1e3);
    return locale.formatDistance("xSeconds", seconds, localizeOptions);
  } else if (unit === "minute") {
    const roundedMinutes = roundingMethod(minutes);
    return locale.formatDistance("xMinutes", roundedMinutes, localizeOptions);
  } else if (unit === "hour") {
    const hours = roundingMethod(minutes / 60);
    return locale.formatDistance("xHours", hours, localizeOptions);
  } else if (unit === "day") {
    const days = roundingMethod(dstNormalizedMinutes / minutesInDay);
    return locale.formatDistance("xDays", days, localizeOptions);
  } else if (unit === "month") {
    const months = roundingMethod(dstNormalizedMinutes / minutesInMonth);
    return months === 12 && defaultUnit !== "month" ? locale.formatDistance("xYears", 1, localizeOptions) : locale.formatDistance("xMonths", months, localizeOptions);
  } else {
    const years = roundingMethod(dstNormalizedMinutes / minutesInYear);
    return locale.formatDistance("xYears", years, localizeOptions);
  }
}
var init_formatDistanceStrict = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/formatDistanceStrict.js"() {
    init_import_meta_url();
    init_defaultLocale();
    init_defaultOptions();
    init_getRoundingMethod();
    init_getTimezoneOffsetInMilliseconds();
    init_normalizeDates();
    init_compareAsc();
    init_constants20();
    __name(formatDistanceStrict, "formatDistanceStrict");
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/formatDistanceToNow.js
var init_formatDistanceToNow = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/formatDistanceToNow.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/formatDistanceToNowStrict.js
function formatDistanceToNowStrict(date, options) {
  return formatDistanceStrict(date, constructNow(date), options);
}
var init_formatDistanceToNowStrict = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/formatDistanceToNowStrict.js"() {
    init_import_meta_url();
    init_constructNow();
    init_formatDistanceStrict();
    __name(formatDistanceToNowStrict, "formatDistanceToNowStrict");
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/formatDuration.js
var init_formatDuration = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/formatDuration.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/formatISO.js
var init_formatISO = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/formatISO.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/formatISO9075.js
var init_formatISO9075 = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/formatISO9075.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/formatISODuration.js
var init_formatISODuration = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/formatISODuration.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/formatRFC3339.js
var init_formatRFC3339 = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/formatRFC3339.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/formatRFC7231.js
var init_formatRFC7231 = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/formatRFC7231.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/formatRelative.js
var init_formatRelative2 = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/formatRelative.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/fromUnixTime.js
var init_fromUnixTime = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/fromUnixTime.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getDate.js
var init_getDate = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getDate.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getDay.js
var init_getDay = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getDay.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getDaysInMonth.js
var init_getDaysInMonth = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getDaysInMonth.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isLeapYear.js
var init_isLeapYear = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isLeapYear.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getDaysInYear.js
var init_getDaysInYear = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getDaysInYear.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getDecade.js
var init_getDecade = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getDecade.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getDefaultOptions.js
var init_getDefaultOptions = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getDefaultOptions.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getHours.js
var init_getHours = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getHours.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getISODay.js
var init_getISODay = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getISODay.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getISOWeeksInYear.js
var init_getISOWeeksInYear = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getISOWeeksInYear.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getMilliseconds.js
var init_getMilliseconds = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getMilliseconds.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getMinutes.js
var init_getMinutes = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getMinutes.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getMonth.js
var init_getMonth = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getMonth.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getOverlappingDaysInIntervals.js
var init_getOverlappingDaysInIntervals = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getOverlappingDaysInIntervals.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getSeconds.js
var init_getSeconds = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getSeconds.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getTime.js
var init_getTime = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getTime.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getUnixTime.js
var init_getUnixTime = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getUnixTime.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getWeekOfMonth.js
var init_getWeekOfMonth = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getWeekOfMonth.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/lastDayOfMonth.js
var init_lastDayOfMonth = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/lastDayOfMonth.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getWeeksInMonth.js
var init_getWeeksInMonth = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getWeeksInMonth.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getYear.js
var init_getYear = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getYear.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/hoursToMilliseconds.js
var init_hoursToMilliseconds = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/hoursToMilliseconds.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/hoursToMinutes.js
var init_hoursToMinutes = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/hoursToMinutes.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/hoursToSeconds.js
var init_hoursToSeconds = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/hoursToSeconds.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/interval.js
var init_interval = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/interval.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/intervalToDuration.js
var init_intervalToDuration = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/intervalToDuration.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/intlFormat.js
var init_intlFormat = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/intlFormat.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/intlFormatDistance.js
var init_intlFormatDistance = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/intlFormatDistance.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isAfter.js
var init_isAfter = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isAfter.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isBefore.js
var init_isBefore = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isBefore.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isEqual.js
var init_isEqual = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isEqual.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isExists.js
var init_isExists = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isExists.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isFirstDayOfMonth.js
var init_isFirstDayOfMonth = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isFirstDayOfMonth.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isFriday.js
var init_isFriday = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isFriday.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isFuture.js
var init_isFuture = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isFuture.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/transpose.js
var init_transpose = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/transpose.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/setWeek.js
var init_setWeek = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/setWeek.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/setISOWeek.js
var init_setISOWeek = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/setISOWeek.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/setDay.js
var init_setDay = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/setDay.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/setISODay.js
var init_setISODay = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/setISODay.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/parse.js
var init_parse3 = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/parse.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isMatch.js
var init_isMatch = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isMatch.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isMonday.js
var init_isMonday = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isMonday.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isPast.js
var init_isPast = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isPast.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfHour.js
var init_startOfHour = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfHour.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isSameHour.js
var init_isSameHour = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isSameHour.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isSameWeek.js
var init_isSameWeek = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isSameWeek.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isSameISOWeek.js
var init_isSameISOWeek = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isSameISOWeek.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isSameISOWeekYear.js
var init_isSameISOWeekYear = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isSameISOWeekYear.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfMinute.js
var init_startOfMinute = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfMinute.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isSameMinute.js
var init_isSameMinute = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isSameMinute.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isSameMonth.js
var init_isSameMonth = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isSameMonth.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isSameQuarter.js
var init_isSameQuarter = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isSameQuarter.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfSecond.js
var init_startOfSecond = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfSecond.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isSameSecond.js
var init_isSameSecond = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isSameSecond.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isSameYear.js
var init_isSameYear = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isSameYear.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isThisHour.js
var init_isThisHour = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isThisHour.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isThisISOWeek.js
var init_isThisISOWeek = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isThisISOWeek.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isThisMinute.js
var init_isThisMinute = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isThisMinute.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isThisMonth.js
var init_isThisMonth = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isThisMonth.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isThisQuarter.js
var init_isThisQuarter = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isThisQuarter.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isThisSecond.js
var init_isThisSecond = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isThisSecond.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isThisWeek.js
var init_isThisWeek = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isThisWeek.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isThisYear.js
var init_isThisYear = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isThisYear.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isThursday.js
var init_isThursday = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isThursday.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isToday.js
var init_isToday = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isToday.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isTomorrow.js
var init_isTomorrow = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isTomorrow.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isTuesday.js
var init_isTuesday = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isTuesday.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isWednesday.js
var init_isWednesday = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isWednesday.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isWithinInterval.js
var init_isWithinInterval = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isWithinInterval.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/subDays.js
var init_subDays = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/subDays.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isYesterday.js
var init_isYesterday = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isYesterday.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/lastDayOfDecade.js
var init_lastDayOfDecade = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/lastDayOfDecade.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/lastDayOfWeek.js
var init_lastDayOfWeek = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/lastDayOfWeek.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/lastDayOfISOWeek.js
var init_lastDayOfISOWeek = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/lastDayOfISOWeek.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/lastDayOfISOWeekYear.js
var init_lastDayOfISOWeekYear = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/lastDayOfISOWeekYear.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/lastDayOfQuarter.js
var init_lastDayOfQuarter = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/lastDayOfQuarter.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/lastDayOfYear.js
var init_lastDayOfYear = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/lastDayOfYear.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/lightFormat.js
var init_lightFormat = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/lightFormat.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/milliseconds.js
var init_milliseconds = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/milliseconds.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/millisecondsToHours.js
var init_millisecondsToHours = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/millisecondsToHours.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/millisecondsToMinutes.js
var init_millisecondsToMinutes = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/millisecondsToMinutes.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/millisecondsToSeconds.js
var init_millisecondsToSeconds = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/millisecondsToSeconds.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/minutesToHours.js
var init_minutesToHours = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/minutesToHours.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/minutesToMilliseconds.js
var init_minutesToMilliseconds = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/minutesToMilliseconds.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/minutesToSeconds.js
var init_minutesToSeconds = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/minutesToSeconds.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/monthsToQuarters.js
var init_monthsToQuarters = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/monthsToQuarters.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/monthsToYears.js
var init_monthsToYears = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/monthsToYears.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/nextDay.js
var init_nextDay = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/nextDay.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/nextFriday.js
var init_nextFriday = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/nextFriday.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/nextMonday.js
var init_nextMonday = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/nextMonday.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/nextSaturday.js
var init_nextSaturday = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/nextSaturday.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/nextSunday.js
var init_nextSunday = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/nextSunday.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/nextThursday.js
var init_nextThursday = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/nextThursday.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/nextTuesday.js
var init_nextTuesday = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/nextTuesday.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/nextWednesday.js
var init_nextWednesday = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/nextWednesday.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/parseISO.js
var init_parseISO = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/parseISO.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/parseJSON.js
var init_parseJSON = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/parseJSON.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/previousDay.js
var init_previousDay = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/previousDay.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/previousFriday.js
var init_previousFriday = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/previousFriday.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/previousMonday.js
var init_previousMonday = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/previousMonday.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/previousSaturday.js
var init_previousSaturday = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/previousSaturday.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/previousSunday.js
var init_previousSunday = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/previousSunday.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/previousThursday.js
var init_previousThursday = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/previousThursday.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/previousTuesday.js
var init_previousTuesday = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/previousTuesday.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/previousWednesday.js
var init_previousWednesday = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/previousWednesday.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/quartersToMonths.js
var init_quartersToMonths = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/quartersToMonths.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/quartersToYears.js
var init_quartersToYears = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/quartersToYears.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/roundToNearestHours.js
var init_roundToNearestHours = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/roundToNearestHours.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/roundToNearestMinutes.js
var init_roundToNearestMinutes = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/roundToNearestMinutes.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/secondsToHours.js
var init_secondsToHours = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/secondsToHours.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/secondsToMilliseconds.js
var init_secondsToMilliseconds = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/secondsToMilliseconds.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/secondsToMinutes.js
var init_secondsToMinutes = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/secondsToMinutes.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/setMonth.js
var init_setMonth = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/setMonth.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/set.js
var init_set = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/set.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/setDate.js
var init_setDate = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/setDate.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/setDayOfYear.js
var init_setDayOfYear = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/setDayOfYear.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/setDefaultOptions.js
var init_setDefaultOptions = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/setDefaultOptions.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/setHours.js
var init_setHours = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/setHours.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/setMilliseconds.js
var init_setMilliseconds = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/setMilliseconds.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/setMinutes.js
var init_setMinutes = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/setMinutes.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/setQuarter.js
var init_setQuarter = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/setQuarter.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/setSeconds.js
var init_setSeconds = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/setSeconds.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/setWeekYear.js
var init_setWeekYear = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/setWeekYear.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/setYear.js
var init_setYear = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/setYear.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfDecade.js
var init_startOfDecade = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfDecade.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfToday.js
var init_startOfToday = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfToday.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfTomorrow.js
var init_startOfTomorrow = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfTomorrow.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfYesterday.js
var init_startOfYesterday = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfYesterday.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/subMonths.js
var init_subMonths = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/subMonths.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/sub.js
var init_sub = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/sub.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/subBusinessDays.js
var init_subBusinessDays = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/subBusinessDays.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/subHours.js
var init_subHours = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/subHours.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/subMilliseconds.js
var init_subMilliseconds = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/subMilliseconds.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/subMinutes.js
var init_subMinutes = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/subMinutes.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/subQuarters.js
var init_subQuarters = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/subQuarters.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/subSeconds.js
var init_subSeconds = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/subSeconds.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/subWeeks.js
var init_subWeeks = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/subWeeks.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/subYears.js
var init_subYears = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/subYears.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/weeksToDays.js
var init_weeksToDays = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/weeksToDays.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/yearsToDays.js
var init_yearsToDays = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/yearsToDays.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/yearsToMonths.js
var init_yearsToMonths = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/yearsToMonths.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/yearsToQuarters.js
var init_yearsToQuarters = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/yearsToQuarters.js"() {
    init_import_meta_url();
  }
});

// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/index.js
var init_date_fns = __esm({
  "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/index.js"() {
    init_import_meta_url();
    init_add3();
    init_addBusinessDays();
    init_addDays();
    init_addHours();
    init_addISOWeekYears();
    init_addMilliseconds();
    init_addMinutes();
    init_addMonths();
    init_addQuarters();
    init_addSeconds();
    init_addWeeks();
    init_addYears();
    init_areIntervalsOverlapping();
    init_clamp();
    init_closestIndexTo();
    init_closestTo();
    init_compareAsc();
    init_compareDesc();
    init_constructFrom();
    init_constructNow();
    init_daysToWeeks();
    init_differenceInBusinessDays();
    init_differenceInCalendarDays();
    init_differenceInCalendarISOWeekYears();
    init_differenceInCalendarISOWeeks();
    init_differenceInCalendarMonths();
    init_differenceInCalendarQuarters();
    init_differenceInCalendarWeeks();
    init_differenceInCalendarYears();
    init_differenceInDays();
    init_differenceInHours();
    init_differenceInISOWeekYears();
    init_differenceInMilliseconds();
    init_differenceInMinutes();
    init_differenceInMonths();
    init_differenceInQuarters();
    init_differenceInSeconds();
    init_differenceInWeeks();
    init_differenceInYears();
    init_eachDayOfInterval();
    init_eachHourOfInterval();
    init_eachMinuteOfInterval();
    init_eachMonthOfInterval();
    init_eachQuarterOfInterval();
    init_eachWeekOfInterval();
    init_eachWeekendOfInterval();
    init_eachWeekendOfMonth();
    init_eachWeekendOfYear();
    init_eachYearOfInterval();
    init_endOfDay();
    init_endOfDecade();
    init_endOfHour();
    init_endOfISOWeek();
    init_endOfISOWeekYear();
    init_endOfMinute();
    init_endOfMonth();
    init_endOfQuarter();
    init_endOfSecond();
    init_endOfToday();
    init_endOfTomorrow();
    init_endOfWeek();
    init_endOfYear();
    init_endOfYesterday();
    init_format3();
    init_formatDistance2();
    init_formatDistanceStrict();
    init_formatDistanceToNow();
    init_formatDistanceToNowStrict();
    init_formatDuration();
    init_formatISO();
    init_formatISO9075();
    init_formatISODuration();
    init_formatRFC3339();
    init_formatRFC7231();
    init_formatRelative2();
    init_fromUnixTime();
    init_getDate();
    init_getDay();
    init_getDayOfYear();
    init_getDaysInMonth();
    init_getDaysInYear();
    init_getDecade();
    init_getDefaultOptions();
    init_getHours();
    init_getISODay();
    init_getISOWeek();
    init_getISOWeekYear();
    init_getISOWeeksInYear();
    init_getMilliseconds();
    init_getMinutes();
    init_getMonth();
    init_getOverlappingDaysInIntervals();
    init_getQuarter();
    init_getSeconds();
    init_getTime();
    init_getUnixTime();
    init_getWeek();
    init_getWeekOfMonth();
    init_getWeekYear();
    init_getWeeksInMonth();
    init_getYear();
    init_hoursToMilliseconds();
    init_hoursToMinutes();
    init_hoursToSeconds();
    init_interval();
    init_intervalToDuration();
    init_intlFormat();
    init_intlFormatDistance();
    init_isAfter();
    init_isBefore();
    init_isDate();
    init_isEqual();
    init_isExists();
    init_isFirstDayOfMonth();
    init_isFriday();
    init_isFuture();
    init_isLastDayOfMonth();
    init_isLeapYear();
    init_isMatch();
    init_isMonday();
    init_isPast();
    init_isSameDay();
    init_isSameHour();
    init_isSameISOWeek();
    init_isSameISOWeekYear();
    init_isSameMinute();
    init_isSameMonth();
    init_isSameQuarter();
    init_isSameSecond();
    init_isSameWeek();
    init_isSameYear();
    init_isSaturday();
    init_isSunday();
    init_isThisHour();
    init_isThisISOWeek();
    init_isThisMinute();
    init_isThisMonth();
    init_isThisQuarter();
    init_isThisSecond();
    init_isThisWeek();
    init_isThisYear();
    init_isThursday();
    init_isToday();
    init_isTomorrow();
    init_isTuesday();
    init_isValid();
    init_isWednesday();
    init_isWeekend();
    init_isWithinInterval();
    init_isYesterday();
    init_lastDayOfDecade();
    init_lastDayOfISOWeek();
    init_lastDayOfISOWeekYear();
    init_lastDayOfMonth();
    init_lastDayOfQuarter();
    init_lastDayOfWeek();
    init_lastDayOfYear();
    init_lightFormat();
    init_max();
    init_milliseconds();
    init_millisecondsToHours();
    init_millisecondsToMinutes();
    init_millisecondsToSeconds();
    init_min();
    init_minutesToHours();
    init_minutesToMilliseconds();
    init_minutesToSeconds();
    init_monthsToQuarters();
    init_monthsToYears();
    init_nextDay();
    init_nextFriday();
    init_nextMonday();
    init_nextSaturday();
    init_nextSunday();
    init_nextThursday();
    init_nextTuesday();
    init_nextWednesday();
    init_parse3();
    init_parseISO();
    init_parseJSON();
    init_previousDay();
    init_previousFriday();
    init_previousMonday();
    init_previousSaturday();
    init_previousSunday();
    init_previousThursday();
    init_previousTuesday();
    init_previousWednesday();
    init_quartersToMonths();
    init_quartersToYears();
    init_roundToNearestHours();
    init_roundToNearestMinutes();
    init_secondsToHours();
    init_secondsToMilliseconds();
    init_secondsToMinutes();
    init_set();
    init_setDate();
    init_setDay();
    init_setDayOfYear();
    init_setDefaultOptions();
    init_setHours();
    init_setISODay();
    init_setISOWeek();
    init_setISOWeekYear();
    init_setMilliseconds();
    init_setMinutes();
    init_setMonth();
    init_setQuarter();
    init_setSeconds();
    init_setWeek();
    init_setWeekYear();
    init_setYear();
    init_startOfDay();
    init_startOfDecade();
    init_startOfHour();
    init_startOfISOWeek();
    init_startOfISOWeekYear();
    init_startOfMinute();
    init_startOfMonth();
    init_startOfQuarter();
    init_startOfSecond();
    init_startOfToday();
    init_startOfTomorrow();
    init_startOfWeek();
    init_startOfWeekYear();
    init_startOfYear();
    init_startOfYesterday();
    init_sub();
    init_subBusinessDays();
    init_subDays();
    init_subHours();
    init_subISOWeekYears();
    init_subMilliseconds();
    init_subMinutes();
    init_subMonths();
    init_subQuarters();
    init_subSeconds();
    init_subWeeks();
    init_subYears();
    init_toDate();
    init_transpose();
    init_weeksToDays();
    init_yearsToDays();
    init_yearsToMonths();
    init_yearsToQuarters();
  }
});

// ../../node_modules/.pnpm/itty-time@1.0.6/node_modules/itty-time/index.mjs
var e9, t12, n8, r9;
var init_itty_time2 = __esm({
  "../../node_modules/.pnpm/itty-time@1.0.6/node_modules/itty-time/index.mjs"() {
    init_import_meta_url();
    e9 = 36e5;
    t12 = 24 * e9;
    n8 = { year: 315576e5, month: 30 * t12, week: 7 * t12, day: t12, hour: e9, minute: 6e4, second: 1e3, m: 1 };
    r9 = /* @__PURE__ */ __name((e10) => {
      if (+e10) return +e10;
      const [, t13, r10] = e10.match(/^([^ ]+) +(\w\w*?)s?$/) || [];
      return +t13 * (n8[r10] || 1);
    }, "r");
  }
});

// src/workflows/utils.ts
async function getInstanceIdFromArgs(accountId, args, config) {
  let id = args.id;
  if (id == "latest") {
    const instances = (await fetchResult(
      config,
      `/accounts/${accountId}/workflows/${args.name}/instances/`
    )).sort((a7, b11) => b11.created_on.localeCompare(a7.created_on));
    if (instances.length == 0) {
      throw new UserError(
        `There are no deployed instances in workflow "${args.name}"`
      );
    }
    id = instances[0].id;
  }
  return id;
}
async function updateInstanceStatus(config, accountId, workflowName, instanceId, status2) {
  await fetchResult(
    config,
    `/accounts/${accountId}/workflows/${workflowName}/instances/${instanceId}/status`,
    {
      method: "PATCH",
      headers: {
        "Content-Type": "application/json"
      },
      body: JSON.stringify({ status: status2 })
    }
  );
}
var emojifyInstanceStatus, emojifyInstanceTriggerName, emojifyStepType, validateStatus;
var init_utils21 = __esm({
  "src/workflows/utils.ts"() {
    init_import_meta_url();
    init_dist();
    init_cfetch();
    emojifyInstanceStatus = /* @__PURE__ */ __name((status2) => {
      switch (status2) {
        case "complete":
          return "\u2705 Completed";
        case "errored":
          return "\u274C Errored";
        case "unknown":
          return "\u2753 Unknown";
        case "paused":
          return "\u23F8\uFE0F Paused";
        case "queued":
          return "\u231B Queued";
        case "running":
          return "\u25B6 Running";
        case "terminated":
          return "\u{1F6AB} Terminated";
        case "waiting":
          return "\u23F0 Waiting";
        case "waitingForPause":
          return "\u23F1\uFE0F Waiting for Pause";
        default:
          return "\u2753 Unknown";
      }
    }, "emojifyInstanceStatus");
    emojifyInstanceTriggerName = /* @__PURE__ */ __name((status2) => {
      switch (status2) {
        case "api":
          return "\u{1F30E} API";
        case "binding":
          return "\u{1F517} Binding";
        case "cron":
          return "\u231B Cron";
        case "event":
          return "\u{1F4E9} Event";
        default:
          return "\u2753 Unknown";
      }
    }, "emojifyInstanceTriggerName");
    emojifyStepType = /* @__PURE__ */ __name((type) => {
      switch (type) {
        case "step":
          return "\u{1F3AF} Step";
        case "sleep":
          return "\u{1F4A4} Sleeping";
        case "termination":
          return "\u{1F6AB} Termination";
        case "waitForEvent":
          return "\u{1F440} Waiting for event";
        default:
          return "\u2753 Unknown";
      }
    }, "emojifyStepType");
    validateStatus = /* @__PURE__ */ __name((status2) => {
      switch (status2) {
        case "complete":
          return "complete";
        case "errored":
          return "errored";
        case "paused":
          return "paused";
        case "queued":
          return "queued";
        case "running":
          return "running";
        case "terminated":
          return "terminated";
        case "waiting":
          return "waiting";
        case "waitingForPause":
          return "waitingForPause";
        default:
          throw new UserError(
            `Looks like you have provided a invalid status "${status2}". Valid statuses are: queued, running, paused, errored, terminated, complete, waiting, waitingForPause`
          );
      }
    }, "validateStatus");
    __name(getInstanceIdFromArgs, "getInstanceIdFromArgs");
    __name(updateInstanceStatus, "updateInstanceStatus");
  }
});

// src/workflows/commands/instances/describe.ts
function renderInstanceDetails(args, id, instance) {
  const formattedInstance = {
    "Workflow Name": args.name,
    "Instance Id": id,
    ...instance.versionId != null ? { "Version Id": instance.versionId } : {},
    Status: emojifyInstanceStatus(instance.status)
  };
  if (instance.trigger) {
    formattedInstance.Trigger = emojifyInstanceTriggerName(
      instance.trigger.source
    );
  }
  if (instance.queued) {
    formattedInstance.Queued = new Date(instance.queued).toLocaleString();
  }
  if (instance.success != null) {
    formattedInstance.Success = instance.success ? "\u2705 Yes" : "\u274C No";
  }
  if (instance.start != void 0) {
    formattedInstance.Start = new Date(instance.start).toLocaleString();
  }
  if (instance.end != void 0) {
    formattedInstance.End = new Date(instance.end).toLocaleString();
  }
  if (instance.start != null && instance.end != null) {
    formattedInstance.Duration = formatDistanceStrict(
      new Date(instance.end),
      new Date(instance.start)
    );
  } else if (instance.start != null) {
    formattedInstance.Duration = formatDistanceStrict(
      new Date(instance.start),
      new Date((/* @__PURE__ */ new Date()).toUTCString().slice(0, -4))
    );
  }
  const lastSuccessfulStepName = getLastSuccessfulStep(instance);
  if (lastSuccessfulStepName != null) {
    formattedInstance["Last Successful Step"] = lastSuccessfulStepName;
  }
  if (instance.error != null) {
    formattedInstance.Error = red(
      `${instance.error.name}: ${instance.error.message}`
    );
  }
  logRaw("Describing latest instance:");
  logRaw(formatLabelledValues(formattedInstance));
  logRaw(white("Steps:"));
  instance.steps.forEach(logStep.bind(false, args));
}
function logStep(args, step) {
  logRaw("");
  const formattedStep = {};
  if (step.type == "sleep" || step.type == "step" || step.type == "waitForEvent") {
    formattedStep.Name = step.name;
    formattedStep.Type = emojifyStepType(step.type);
    if (step.start != void 0) {
      formattedStep.Start = new Date(step.start).toLocaleString();
    }
    if (step.end != void 0) {
      formattedStep.End = new Date(step.end).toLocaleString();
    }
    if (step.start != null && step.end != null) {
      formattedStep.Duration = formatDistanceStrict(
        new Date(step.end),
        new Date(step.start)
      );
    } else if (step.start != null) {
      formattedStep.Duration = formatDistanceStrict(
        new Date(step.start),
        new Date((/* @__PURE__ */ new Date()).toUTCString().slice(0, -4))
      );
    }
  } else if (step.type == "termination") {
    formattedStep.Type = emojifyStepType(step.type);
    formattedStep.Trigger = step.trigger.source;
  }
  if (step.type == "step") {
    if (step.success !== null) {
      formattedStep.Success = step.success ? "\u2705 Yes" : "\u274C No";
    } else {
      formattedStep.Success = "\u25B6 Running";
    }
    if (step.success === null) {
      const latestAttempt = step.attempts.at(-1);
      let delay = step.config.retries.delay;
      if (latestAttempt !== void 0 && latestAttempt.success === false) {
        const endDate = new Date(latestAttempt.end);
        if (typeof delay === "string") {
          delay = r9(delay);
        }
        const retryDate = addMilliseconds(endDate, delay);
        formattedStep["Retries At"] = `${retryDate.toLocaleString()} (in ${formatDistanceToNowStrict(retryDate)} from now)`;
      }
    }
  }
  if (step.type == "step" || step.type == "waitForEvent") {
    if (step.output !== void 0 && args.stepOutput) {
      let output;
      try {
        output = JSON.stringify(step.output);
      } catch {
        output = step.output;
      }
      formattedStep.Output = output.length > args.truncateOutputLimit ? output.substring(0, args.truncateOutputLimit) + "[...output truncated]" : output;
    }
  }
  logger.log(formatLabelledValues(formattedStep, { indentationCount: 2 }));
  if (step.type == "step") {
    const prettyAttempts = step.attempts.map((val2) => {
      const attempt = {};
      attempt.Start = new Date(val2.start).toLocaleString();
      attempt.End = val2.end == null ? "" : new Date(val2.end).toLocaleString();
      if (val2.start != null && val2.end != null) {
        attempt.Duration = formatDistanceStrict(
          new Date(val2.end),
          new Date(val2.start)
        );
      } else if (val2.start != null) {
        attempt.Duration = formatDistanceStrict(
          new Date(val2.start),
          new Date((/* @__PURE__ */ new Date()).toUTCString().slice(0, -4))
        );
      }
      attempt.State = val2.success == null ? "\u{1F504} Working" : val2.success ? "\u2705 Success" : "\u274C Error";
      if (val2.error != null) {
        attempt.Error = red(`${val2.error.name}: ${val2.error.message}`);
      }
      return attempt;
    });
    logger.table(prettyAttempts);
  }
}
function getLastSuccessfulStep(logs) {
  let lastSuccessfulStepName = null;
  for (const step of logs.steps) {
    switch (step.type) {
      case "step":
        if (step.success == true) {
          lastSuccessfulStepName = step.name;
        }
        break;
      case "sleep":
        if (step.end != null) {
          lastSuccessfulStepName = step.name;
        }
        break;
    }
  }
  return lastSuccessfulStepName;
}
var workflowsInstancesDescribeCommand;
var init_describe2 = __esm({
  "src/workflows/commands/instances/describe.ts"() {
    init_import_meta_url();
    init_cli();
    init_colors();
    init_date_fns();
    init_itty_time2();
    init_cfetch();
    init_create_command();
    init_logger();
    init_user3();
    init_render_labelled_values();
    init_local();
    init_utils21();
    workflowsInstancesDescribeCommand = createCommand({
      metadata: {
        description: "Describe a workflow instance - see its logs, retries and errors",
        owner: "Product: Workflows",
        status: "stable"
      },
      positionalArgs: ["name", "id"],
      args: {
        ...localWorkflowArgs,
        name: {
          describe: "Name of the workflow",
          type: "string",
          demandOption: true
        },
        id: {
          describe: "ID of the instance - instead of an UUID you can type 'latest' to get the latest instance and describe it",
          type: "string",
          demandOption: false,
          default: "latest"
        },
        "step-output": {
          describe: "Don't output the step output since it might clutter the terminal",
          type: "boolean",
          default: true
        },
        "truncate-output-limit": {
          describe: "Truncate step output after x characters",
          type: "number",
          default: 5e3
        }
      },
      async handler(args, { config }) {
        let id;
        let instance;
        if (args.local) {
          id = await getLocalInstanceIdFromArgs(args.port, args);
          instance = await fetchLocalResult(
            args.port,
            `/workflows/${encodeURIComponent(args.name)}/instances/${encodeURIComponent(id)}`
          );
        } else {
          const accountId = await requireAuth(config);
          id = await getInstanceIdFromArgs(accountId, args, config);
          instance = await fetchResult(
            config,
            `/accounts/${accountId}/workflows/${args.name}/instances/${id}`
          );
        }
        renderInstanceDetails(args, id, instance);
      }
    });
    __name(renderInstanceDetails, "renderInstanceDetails");
    __name(logStep, "logStep");
    __name(getLastSuccessfulStep, "getLastSuccessfulStep");
  }
});

// src/workflows/commands/instances/list.ts
var workflowsInstancesListCommand;
var init_list23 = __esm({
  "src/workflows/commands/instances/list.ts"() {
    init_import_meta_url();
    init_cfetch();
    init_create_command();
    init_logger();
    init_user3();
    init_local();
    init_utils21();
    workflowsInstancesListCommand = createCommand({
      metadata: {
        description: "Instance related commands (list, describe, terminate, pause, resume)",
        owner: "Product: Workflows",
        status: "stable"
      },
      positionalArgs: ["name"],
      args: {
        ...localWorkflowArgs,
        name: {
          describe: "Name of the workflow",
          type: "string",
          demandOption: true
        },
        reverse: {
          describe: "Reverse order of the instances table",
          type: "boolean",
          default: false
        },
        status: {
          describe: "Filters list by instance status (can be one of: queued, running, paused, errored, terminated, complete)",
          type: "string"
        },
        page: {
          describe: 'Show a sepecific page from the listing, can configure page size using "per-page"',
          type: "number",
          default: 1
        },
        "per-page": {
          describe: "Configure the maximum number of instances to show per page",
          type: "number"
        }
      },
      async handler(args, { config }) {
        if (args.local) {
          const URLParams = new URLSearchParams();
          if (args.status !== void 0) {
            const validatedStatus = validateStatus(args.status);
            URLParams.set("status", validatedStatus);
          }
          if (args.perPage !== void 0) {
            URLParams.set("per_page", args.perPage.toString());
          }
          URLParams.set("page", args.page.toString());
          const queryString = URLParams.toString();
          const path84 = `/workflows/${encodeURIComponent(args.name)}/instances${queryString ? `?${queryString}` : ""}`;
          const instances = await fetchLocalResult(args.port, path84);
          if (instances.length === 0 && args.page === 1) {
            logger.warn(
              `There are no instances in workflow "${args.name}". You can trigger it with "wrangler workflows trigger ${args.name} --local"`
            );
            return;
          }
          if (instances.length === 0 && args.page > 1) {
            logger.warn(
              `No instances found on page ${args.page}. Please try a smaller page number.`
            );
            return;
          }
          logger.info(
            `Showing ${instances.length} instance${instances.length > 1 ? "s" : ""} from page ${args.page}:`
          );
          const sortedInstances = instances.sort(
            (a7, b11) => args.reverse ? (a7.created_on ?? "").localeCompare(b11.created_on ?? "") : (b11.created_on ?? "").localeCompare(a7.created_on ?? "")
          );
          const prettierInstances = sortedInstances.map((instance) => ({
            "Instance ID": instance.id,
            Created: instance.created_on ? new Date(instance.created_on).toLocaleString() : "N/A",
            Status: instance.status ? emojifyInstanceStatus(instance.status) : "N/A"
          }));
          logger.table(prettierInstances);
        } else {
          const accountId = await requireAuth(config);
          const URLParams = new URLSearchParams();
          if (args.status !== void 0) {
            const validatedStatus = validateStatus(args.status);
            URLParams.set("status", validatedStatus);
          }
          if (args.perPage !== void 0) {
            URLParams.set("per_page", args.perPage.toString());
          }
          URLParams.set("page", args.page.toString());
          const instances = await fetchCursorPage(
            config,
            `/accounts/${accountId}/workflows/${args.name}/instances`,
            void 0,
            URLParams
          );
          if (instances.length === 0 && args.page === 1) {
            logger.warn(
              `There are no instances in workflow "${args.name}". You can trigger it with "wrangler workflows trigger ${args.name}"`
            );
            return;
          }
          if (instances.length === 0 && args.page > 1) {
            logger.warn(
              `No instances found on page ${args.page}. Please try a smaller page number.`
            );
            return;
          }
          logger.info(
            `Showing ${instances.length} instance${instances.length > 1 ? "s" : ""} from page ${args.page}:`
          );
          const prettierInstances = instances.sort(
            (a7, b11) => args.reverse ? a7.created_on.localeCompare(b11.created_on) : b11.created_on.localeCompare(a7.created_on)
          ).map((instance) => ({
            "Instance ID": instance.id,
            Version: instance.version_id,
            Created: new Date(instance.created_on).toLocaleString(),
            Modified: new Date(instance.modified_on).toLocaleString(),
            Status: emojifyInstanceStatus(instance.status)
          }));
          logger.table(prettierInstances);
        }
      }
    });
  }
});

// src/workflows/commands/instances/pause.ts
var workflowsInstancesPauseCommand;
var init_pause = __esm({
  "src/workflows/commands/instances/pause.ts"() {
    init_import_meta_url();
    init_create_command();
    init_logger();
    init_user3();
    init_local();
    init_utils21();
    workflowsInstancesPauseCommand = createCommand({
      metadata: {
        description: "Pause a workflow instance",
        owner: "Product: Workflows",
        status: "stable"
      },
      positionalArgs: ["name", "id"],
      args: {
        ...localWorkflowArgs,
        name: {
          describe: "Name of the workflow",
          type: "string",
          demandOption: true
        },
        id: {
          describe: "ID of the instance - instead of an UUID you can type 'latest' to get the latest instance and pause it",
          type: "string",
          demandOption: true
        }
      },
      async handler(args, { config }) {
        let id;
        if (args.local) {
          id = await getLocalInstanceIdFromArgs(args.port, args);
          await updateLocalInstanceStatus(args.port, args.name, id, "pause");
        } else {
          const accountId = await requireAuth(config);
          id = await getInstanceIdFromArgs(accountId, args, config);
          await updateInstanceStatus(config, accountId, args.name, id, "pause");
        }
        logger.info(
          `\u23F8\uFE0F The instance "${id}" from ${args.name} was paused successfully`
        );
      }
    });
  }
});

// src/workflows/commands/instances/restart.ts
var workflowsInstancesRestartCommand;
var init_restart = __esm({
  "src/workflows/commands/instances/restart.ts"() {
    init_import_meta_url();
    init_create_command();
    init_logger();
    init_user3();
    init_local();
    init_utils21();
    workflowsInstancesRestartCommand = createCommand({
      metadata: {
        description: "Restart a workflow instance",
        owner: "Product: Workflows",
        status: "stable"
      },
      positionalArgs: ["name", "id"],
      args: {
        ...localWorkflowArgs,
        name: {
          describe: "Name of the workflow",
          type: "string",
          demandOption: true
        },
        id: {
          describe: "ID of the instance - instead of an UUID you can type 'latest' to get the latest instance and describe it",
          type: "string",
          demandOption: true
        }
      },
      async handler(args, { config }) {
        let id;
        if (args.local) {
          id = await getLocalInstanceIdFromArgs(args.port, args);
          await updateLocalInstanceStatus(args.port, args.name, id, "restart");
        } else {
          const accountId = await requireAuth(config);
          id = await getInstanceIdFromArgs(accountId, args, config);
          await updateInstanceStatus(config, accountId, args.name, id, "restart");
        }
        logger.info(
          `\u{1F977} The instance "${id}" from ${args.name} was restarted successfully`
        );
      }
    });
  }
});

// src/workflows/commands/instances/resume.ts
var workflowsInstancesResumeCommand;
var init_resume = __esm({
  "src/workflows/commands/instances/resume.ts"() {
    init_import_meta_url();
    init_create_command();
    init_logger();
    init_user3();
    init_local();
    init_utils21();
    workflowsInstancesResumeCommand = createCommand({
      metadata: {
        description: "Resume a workflow instance",
        owner: "Product: Workflows",
        status: "stable"
      },
      positionalArgs: ["name", "id"],
      args: {
        ...localWorkflowArgs,
        name: {
          describe: "Name of the workflow",
          type: "string",
          demandOption: true
        },
        id: {
          describe: "ID of the instance - instead of an UUID you can type 'latest' to get the latest instance and resume it",
          type: "string",
          demandOption: true
        }
      },
      async handler(args, { config }) {
        let id;
        if (args.local) {
          id = await getLocalInstanceIdFromArgs(args.port, args);
          await updateLocalInstanceStatus(args.port, args.name, id, "resume");
        } else {
          const accountId = await requireAuth(config);
          id = await getInstanceIdFromArgs(accountId, args, config);
          await updateInstanceStatus(config, accountId, args.name, id, "resume");
        }
        logger.info(
          `\u{1F504} The instance "${id}" from ${args.name} was resumed successfully`
        );
      }
    });
  }
});

// src/workflows/commands/instances/send-event.ts
var workflowsInstancesSendEventCommand;
var init_send_event2 = __esm({
  "src/workflows/commands/instances/send-event.ts"() {
    init_import_meta_url();
    init_dist();
    init_cfetch();
    init_create_command();
    init_logger();
    init_user3();
    init_local();
    init_utils21();
    workflowsInstancesSendEventCommand = createCommand({
      metadata: {
        description: "Send an event to a workflow instance",
        owner: "Product: Workflows",
        status: "stable"
      },
      positionalArgs: ["name", "id"],
      args: {
        ...localWorkflowArgs,
        name: {
          describe: "Name of the workflow",
          type: "string",
          demandOption: true
        },
        id: {
          describe: "ID of the instance - instead of an UUID you can type 'latest' to get the latest instance and send an event to it",
          type: "string",
          demandOption: true
        },
        type: {
          describe: "Type of the workflow event",
          type: "string",
          demandOption: true
        },
        payload: {
          describe: `JSON string for the workflow event (e.g., '{"key": "value"}')`,
          type: "string",
          demandOption: false,
          default: "{}"
        }
      },
      async handler(args, { config }) {
        let payload;
        try {
          payload = JSON.parse(args.payload);
        } catch (e10) {
          throw new UserError(
            `Error while parsing event payload: "${args.payload}" with ${e10}' `
          );
        }
        let id;
        if (args.local) {
          id = await getLocalInstanceIdFromArgs(args.port, args);
          await fetchLocalResult(
            args.port,
            `/workflows/${encodeURIComponent(args.name)}/instances/${encodeURIComponent(id)}/events/${encodeURIComponent(args.type)}`,
            {
              method: "POST",
              headers: { "Content-Type": "application/json" },
              body: args.payload
            }
          );
        } else {
          const accountId = await requireAuth(config);
          id = await getInstanceIdFromArgs(accountId, args, config);
          await fetchResult(
            config,
            `/accounts/${accountId}/workflows/${args.name}/instances/${id}/events/${args.type}`,
            {
              method: "POST",
              headers: { "Content-Type": "application/json" },
              body: args.payload
            }
          );
        }
        const payloadInfo = Object.keys(payload).length > 0 ? ` and payload "${args.payload}"` : "";
        logger.info(
          `\u{1F4E4} The event with type "${args.type}"${payloadInfo} was sent to the instance "${id}" from ${args.name}`
        );
      }
    });
  }
});

// src/workflows/commands/instances/terminate.ts
var workflowsInstancesTerminateCommand;
var init_terminate = __esm({
  "src/workflows/commands/instances/terminate.ts"() {
    init_import_meta_url();
    init_create_command();
    init_logger();
    init_user3();
    init_local();
    init_utils21();
    workflowsInstancesTerminateCommand = createCommand({
      metadata: {
        description: "Terminate a workflow instance",
        owner: "Product: Workflows",
        status: "stable"
      },
      positionalArgs: ["name", "id"],
      args: {
        ...localWorkflowArgs,
        name: {
          describe: "Name of the workflow",
          type: "string",
          demandOption: true
        },
        id: {
          describe: "ID of the instance - instead of an UUID you can type 'latest' to get the latest instance and describe it",
          type: "string",
          demandOption: true
        }
      },
      async handler(args, { config }) {
        let id;
        if (args.local) {
          id = await getLocalInstanceIdFromArgs(args.port, args);
          await updateLocalInstanceStatus(args.port, args.name, id, "terminate");
        } else {
          const accountId = await requireAuth(config);
          id = await getInstanceIdFromArgs(accountId, args, config);
          await updateInstanceStatus(config, accountId, args.name, id, "terminate");
        }
        logger.info(
          `\u{1F977} The instance "${id}" from ${args.name} was terminated successfully`
        );
      }
    });
  }
});

// src/workflows/commands/instances/terminate-all.ts
var workflowsInstancesTerminateAllCommand;
var init_terminate_all = __esm({
  "src/workflows/commands/instances/terminate-all.ts"() {
    init_import_meta_url();
    init_dist();
    init_cfetch();
    init_create_command();
    init_logger();
    init_user3();
    workflowsInstancesTerminateAllCommand = createCommand({
      metadata: {
        description: "Terminate all workflow instances",
        owner: "Product: Workflows",
        status: "stable",
        hidden: true
      },
      positionalArgs: ["name"],
      args: {
        name: {
          describe: "Name of the workflow",
          type: "string",
          demandOption: true
        },
        status: {
          describe: "Filter instances to be terminated by status",
          type: "string"
        }
      },
      validateArgs: /* @__PURE__ */ __name((args) => {
        const validStatusToTerminate = [
          "queued",
          "running",
          "paused",
          "waitingForPause",
          "waiting"
        ];
        if (args.status !== void 0 && !validStatusToTerminate.includes(args.status)) {
          throw new CommandLineArgsError(
            `Provided status "${args.status}" is not valid, it must be one of the following: ${validStatusToTerminate.join(", ")}.`
          );
        }
      }, "validateArgs"),
      async handler(args, { config }) {
        const accountId = await requireAuth(config);
        const maybeURLQueryString = args.status !== void 0 ? new URLSearchParams({
          status: args.status
        }) : void 0;
        const result = await fetchResult(
          config,
          `/accounts/${accountId}/workflows/${args.name}/instances/terminate`,
          {
            method: "PUT"
          },
          maybeURLQueryString
        );
        if (result.status === "ok") {
          logger.info(
            `\u{1F977} A job to terminate instances from Workflow "${args.name}" ${args.status !== void 0 ? `with status "${args.status}"` : ""} has been started. It might take a few minutes to complete.`
          );
          return;
        }
        logger.info(
          `\u{1F977} A job to terminate instances from Workflow "${args.name}" ${args.status !== void 0 ? `with status "${args.status}"` : ""} is already running. It might take a few minutes to complete.`
        );
      }
    });
  }
});

// src/workflows/commands/list.ts
var workflowsListCommand;
var init_list24 = __esm({
  "src/workflows/commands/list.ts"() {
    init_import_meta_url();
    init_cfetch();
    init_create_command();
    init_logger();
    init_user3();
    init_local();
    workflowsListCommand = createCommand({
      metadata: {
        description: "List Workflows associated to account",
        owner: "Product: Workflows",
        status: "stable"
      },
      args: {
        ...localWorkflowArgs,
        page: {
          describe: 'Show a sepecific page from the listing, can configure page size using "per-page"',
          type: "number",
          default: 1
        },
        "per-page": {
          describe: "Configure the maximum number of workflows to show per page",
          type: "number"
        }
      },
      async handler(args, { config }) {
        if (args.local) {
          const workflows = await fetchLocalResult(
            args.port,
            "/workflows"
          );
          if (workflows.length === 0) {
            logger.warn("There are no Workflows in the local dev session");
            return;
          }
          logger.info(
            `Showing ${workflows.length} workflow${workflows.length > 1 ? "s" : ""} from local dev session:`
          );
          const prettierWorkflows = workflows.map((workflow) => ({
            Name: workflow.name,
            "Script name": workflow.script_name,
            "Class name": workflow.class_name
          }));
          logger.table(prettierWorkflows);
        } else {
          const accountId = await requireAuth(config);
          const URLParams = new URLSearchParams();
          if (args.perPage !== void 0) {
            URLParams.set("per_page", args.perPage.toString());
          }
          URLParams.set("page", args.page.toString());
          const workflows = await fetchResult(
            config,
            `/accounts/${accountId}/workflows`,
            void 0,
            URLParams
          );
          if (workflows.length === 0 && args.page === 1) {
            logger.warn("There are no deployed Workflows in this account");
            return;
          }
          if (workflows.length === 0 && args.page > 1) {
            logger.warn(
              `No Workflows found on page ${args.page}. Please try a smaller page number.`
            );
            return;
          }
          logger.info(
            `Showing ${workflows.length} workflow${workflows.length > 1 ? "s" : ""} from page ${args.page}:`
          );
          const prettierWorkflows = workflows.sort((a7, b11) => b11.created_on.localeCompare(a7.created_on)).map((workflow) => ({
            Name: workflow.name,
            "Script name": workflow.script_name,
            "Class name": workflow.class_name,
            Created: new Date(workflow.created_on).toLocaleString(),
            Modified: new Date(workflow.modified_on).toLocaleString()
          }));
          logger.table(prettierWorkflows);
        }
      }
    });
  }
});

// src/workflows/commands/trigger.ts
var workflowsTriggerCommand;
var init_trigger = __esm({
  "src/workflows/commands/trigger.ts"() {
    init_import_meta_url();
    init_dist();
    init_cfetch();
    init_create_command();
    init_user3();
    init_local();
    workflowsTriggerCommand = createCommand({
      metadata: {
        description: "Trigger a workflow, creating a new instance. Can optionally take a JSON string to pass a parameter into the workflow instance",
        owner: "Product: Workflows",
        status: "stable"
      },
      args: {
        ...localWorkflowArgs,
        name: {
          describe: "Name of the workflow",
          type: "string",
          demandOption: true
        },
        params: {
          describe: "Params for the workflow instance, encoded as a JSON string",
          type: "string",
          default: ""
        },
        id: {
          describe: "Custom instance ID, if not provided it will default to a random UUIDv4",
          type: "string",
          default: void 0
        }
      },
      positionalArgs: ["name", "params"],
      async handler(args, { config, logger: logger4 }) {
        if (args.params.length != 0) {
          try {
            JSON.parse(args.params);
          } catch (e10) {
            throw new UserError(
              `Error while parsing instance parameters: "${args.params}" with ${e10}' `
            );
          }
        }
        const parsedParams = args.params.length != 0 ? JSON.parse(args.params) : void 0;
        let instanceId;
        if (args.local) {
          const response = await fetchLocalResult(
            args.port,
            `/workflows/${encodeURIComponent(args.name)}/instances`,
            {
              method: "POST",
              headers: { "Content-Type": "application/json" },
              body: JSON.stringify({
                id: args.id,
                params: parsedParams
              })
            }
          );
          instanceId = response.id;
          logger4.info(
            `\u{1F680} Workflow instance "${instanceId}" has been triggered successfully`
          );
        } else {
          const accountId = await requireAuth(config);
          const response = await fetchResult(
            config,
            `/accounts/${accountId}/workflows/${args.name}/instances`,
            {
              method: "POST",
              headers: { "Content-Type": "application/json" },
              body: JSON.stringify({
                instance_id: args.id,
                params: parsedParams
              })
            }
          );
          instanceId = response.id;
          logger4.info(
            `\u{1F680} Workflow instance "${instanceId}" has been queued successfully`
          );
        }
      }
    });
  }
});
function createCLIParser(argv) {
  const globalFlags = {
    v: {
      describe: "Show version number",
      alias: "version",
      type: "boolean"
    },
    cwd: {
      describe: "Run as if Wrangler was started in the specified directory instead of the current working directory",
      type: "string",
      requiresArg: true
    },
    config: {
      alias: "c",
      describe: "Path to Wrangler configuration file",
      type: "string",
      requiresArg: true
    },
    env: {
      alias: "e",
      describe: "Environment to use for operations, and for selecting .env and .dev.vars files",
      type: "string",
      requiresArg: true
    },
    "env-file": {
      describe: "Path to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files",
      type: "string",
      array: true,
      requiresArg: true
    },
    "experimental-provision": {
      describe: `Experimental: Enable automatic resource provisioning`,
      type: "boolean",
      default: true,
      hidden: true,
      alias: ["x-provision"]
    },
    "experimental-auto-create": {
      describe: "Automatically provision draft bindings with new resources",
      type: "boolean",
      default: true,
      hidden: true,
      alias: "x-auto-create"
    }
  };
  const wrangler = yargs_default(argv).strict().showHelpOnFail(false).fail((msg, error2) => {
    if (!error2 || error2.name === "YError") {
      error2 = new CommandLineArgsError(msg, {
        telemetryMessage: "yargs validation error"
      });
    }
    throw error2;
  }).scriptName("wrangler").wrap(null).locale("en_US").version(false).options(globalFlags).check(demandSingleValue("cwd")).middleware((_argv) => {
    if (_argv.cwd) {
      process.chdir(_argv.cwd);
    }
  }).check(
    demandSingleValue(
      "config",
      (configArgv) => configArgv["_"][0] === "dev" || configArgv["_"][0] === "types" || configArgv["_"][0] === "pages" && configArgv["_"][1] === "dev"
    )
  ).check(demandSingleValue("env")).check((args) => {
    const resolvedEnvFilePaths = (args["env-file"] ?? getDefaultEnvFiles(args.env)).map((p7) => path3.resolve(p7));
    process.env = loadDotEnv(resolvedEnvFilePaths, {
      includeProcessEnv: true,
      silent: true
    });
    writeOutput({
      type: "wrangler-session",
      version: 1,
      wrangler_version: version,
      command_line_args: argv,
      log_file_path: debugLogFilepath
    });
    return true;
  }).epilogue(
    `Please report any issues to ${source_default.hex("#3B818D")(
      "https://github.com/cloudflare/workers-sdk/issues/new/choose"
    )}`
  );
  wrangler.updateStrings({
    "Commands:": `${source_default.bold("COMMANDS")}`,
    "Options:": `${source_default.bold("OPTIONS")}`,
    "Positionals:": `${source_default.bold("POSITIONALS")}`,
    "Examples:": `${source_default.bold("EXAMPLES")}`
  });
  wrangler.group(
    ["config", "cwd", "env", "env-file", "help", "version"],
    `${source_default.bold("GLOBAL FLAGS")}`
  );
  const subHelp = {
    command: ["*"],
    handler: /* @__PURE__ */ __name(async (args) => {
      setImmediate(
        () => wrangler.parse([...args._.map((a7) => `${a7}`), "--help"])
      );
    }, "handler")
  };
  const registerCommand = createRegisterYargsCommand(wrangler, subHelp, argv);
  const registry = new CommandRegistry(registerCommand);
  const showHelpWithCategories = /* @__PURE__ */ __name(async () => {
    if (registry.orderedCategories.size === 0) {
      wrangler.showHelp("log");
      return;
    }
    const helpOutput = await wrangler.getHelp();
    const lines = helpOutput.split("\n");
    const commandsHeaderIndex = lines.findIndex(
      (line) => line.includes("COMMANDS")
    );
    const globalFlagsIndex = lines.findIndex(
      (line) => line.includes("GLOBAL FLAGS")
    );
    if (commandsHeaderIndex === -1 || globalFlagsIndex === -1) {
      logger.log(helpOutput);
      return;
    }
    const beforeCommands = lines.slice(0, commandsHeaderIndex + 1);
    const commandLines = lines.slice(commandsHeaderIndex + 1, globalFlagsIndex);
    const afterCommands = lines.slice(globalFlagsIndex);
    const regularCommandLines = new Array();
    const categoryCommandLines = /* @__PURE__ */ new Map();
    for (const line of commandLines) {
      const match3 = line.match(/^\s*wrangler\s+(\S+)/);
      if (match3) {
        const cmdName = match3[1];
        const [foundCategory] = Array.from(
          registry.orderedCategories.entries()
        ).find(([_5, commands5]) => commands5.includes(cmdName)) ?? [null];
        if (foundCategory) {
          const existing = categoryCommandLines.get(foundCategory) ?? [];
          existing.push(line);
          categoryCommandLines.set(foundCategory, existing);
        } else {
          regularCommandLines.push(line);
        }
      } else {
        regularCommandLines.push(line);
      }
    }
    const lastNonEmptyIndex = regularCommandLines.findLastIndex(
      (line) => line.trim() !== ""
    );
    const trimmedRegularCommandLines = regularCommandLines.slice(
      0,
      lastNonEmptyIndex + 1
    );
    const outputLines = [
      ...beforeCommands,
      ...trimmedRegularCommandLines
    ];
    for (const category of registry.orderedCategories.keys()) {
      const cmdLines = categoryCommandLines.get(category);
      if (!cmdLines || cmdLines.length <= 0) {
        continue;
      }
      outputLines.push("");
      outputLines.push(source_default.bold(category.toUpperCase()));
      const sortedCmdLines = Array.from(cmdLines).sort((a7, b11) => {
        const matchA = a7.match(/^\s*wrangler\s+(\S+)/);
        const matchB = b11.match(/^\s*wrangler\s+(\S+)/);
        const cmdA = matchA ? matchA[1] : "";
        const cmdB = matchB ? matchB[1] : "";
        return cmdA.localeCompare(cmdB);
      });
      outputLines.push(...sortedCmdLines);
    }
    if (categoryCommandLines.size > 0) {
      outputLines.push("");
    }
    outputLines.push(...afterCommands);
    logger.log(outputLines.join("\n"));
  }, "showHelpWithCategories");
  wrangler.command(
    ["*"],
    false,
    () => {
    },
    async (args) => {
      if (args._.length > 0) {
        throw new CommandLineArgsError(`Unknown command: ${args._}.`);
      } else {
        if (args.v) {
          if (process.stdout.isTTY) {
            await printWranglerBanner();
          } else {
            logger.log(version);
          }
        } else {
          await showHelpWithCategories();
        }
      }
    }
  );
  registry.define([
    {
      command: "wrangler docs",
      definition: docs
    }
  ]);
  registry.registerNamespace("docs");
  registry.define([
    {
      command: "wrangler complete",
      definition: completionsCommand
    }
  ]);
  registry.registerNamespace("complete");
  registry.define([
    {
      command: "wrangler init",
      definition: init3
    }
  ]);
  registry.registerNamespace("init");
  registry.define([
    {
      command: "wrangler dev",
      definition: dev
    }
  ]);
  registry.registerNamespace("dev");
  registry.define([
    {
      command: "wrangler deploy",
      definition: deployCommand
    }
  ]);
  registry.registerNamespace("deploy");
  registry.define([
    { command: "wrangler preview", definition: previewCommand },
    { command: "wrangler preview delete", definition: previewDeleteCommand },
    {
      command: "wrangler preview settings",
      definition: previewSettingsCommand
    },
    {
      command: "wrangler preview settings update",
      definition: previewSettingsUpdateCommand
    },
    { command: "wrangler preview secret", definition: previewSecretNamespace },
    {
      command: "wrangler preview secret put",
      definition: previewSecretPutCommand
    },
    {
      command: "wrangler preview secret delete",
      definition: previewSecretDeleteCommand
    },
    {
      command: "wrangler preview secret list",
      definition: previewSecretListCommand
    },
    {
      command: "wrangler preview secret bulk",
      definition: previewSecretBulkCommand
    }
  ]);
  registry.registerNamespace("preview");
  registry.define([
    {
      command: "wrangler setup",
      definition: setupCommand
    }
  ]);
  registry.registerNamespace("setup");
  registry.define([
    { command: "wrangler deployments", definition: deploymentsNamespace },
    {
      command: "wrangler deployments list",
      definition: deploymentsListCommand
    },
    {
      command: "wrangler deployments status",
      definition: deploymentsStatusCommand
    },
    {
      command: "wrangler deployments view",
      definition: deploymentsViewCommand
    }
  ]);
  registry.registerNamespace("deployments");
  registry.define([
    { command: "wrangler rollback", definition: versionsRollbackCommand }
  ]);
  registry.registerNamespace("rollback");
  registry.define([
    {
      command: "wrangler versions",
      definition: versionsNamespace
    },
    {
      command: "wrangler versions view",
      definition: versionsViewCommand
    },
    {
      command: "wrangler versions list",
      definition: versionsListCommand
    },
    {
      command: "wrangler versions upload",
      definition: versionsUploadCommand
    },
    {
      command: "wrangler versions deploy",
      definition: versionsDeployCommand
    },
    {
      command: "wrangler versions secret",
      definition: versionsSecretNamespace
    },
    {
      command: "wrangler versions secret put",
      definition: versionsSecretPutCommand
    },
    {
      command: "wrangler versions secret bulk",
      definition: versionsSecretBulkCommand
    },
    {
      command: "wrangler versions secret delete",
      definition: versionsSecretDeleteCommand
    },
    {
      command: "wrangler versions secret list",
      definition: versionsSecretsListCommand
    }
  ]);
  registry.registerNamespace("versions");
  registry.define([
    { command: "wrangler triggers", definition: triggersNamespace },
    { command: "wrangler triggers deploy", definition: triggersDeployCommand }
  ]);
  registry.registerNamespace("triggers");
  registry.define([{ command: "wrangler delete", definition: deleteCommand3 }]);
  registry.registerNamespace("delete");
  registry.define([{ command: "wrangler tail", definition: tailCommand }]);
  registry.registerNamespace("tail");
  registry.define([
    { command: "wrangler secret", definition: secretNamespace },
    { command: "wrangler secret put", definition: secretPutCommand },
    { command: "wrangler secret delete", definition: secretDeleteCommand },
    { command: "wrangler secret list", definition: secretListCommand },
    { command: "wrangler secret bulk", definition: secretBulkCommand }
  ]);
  registry.registerNamespace("secret");
  registry.define([{ command: "wrangler types", definition: typesCommand }]);
  registry.registerNamespace("types");
  registry.define([
    { command: "wrangler kv", definition: kvNamespace },
    { command: "wrangler kv namespace", definition: kvNamespaceNamespace },
    { command: "wrangler kv key", definition: kvKeyNamespace },
    { command: "wrangler kv bulk", definition: kvBulkNamespace },
    {
      command: "wrangler kv namespace create",
      definition: kvNamespaceCreateCommand
    },
    {
      command: "wrangler kv namespace list",
      definition: kvNamespaceListCommand
    },
    {
      command: "wrangler kv namespace delete",
      definition: kvNamespaceDeleteCommand
    },
    {
      command: "wrangler kv namespace rename",
      definition: kvNamespaceRenameCommand
    },
    { command: "wrangler kv key put", definition: kvKeyPutCommand },
    { command: "wrangler kv key list", definition: kvKeyListCommand },
    { command: "wrangler kv key get", definition: kvKeyGetCommand },
    { command: "wrangler kv key delete", definition: kvKeyDeleteCommand },
    { command: "wrangler kv bulk get", definition: kvBulkGetCommand },
    { command: "wrangler kv bulk put", definition: kvBulkPutCommand },
    { command: "wrangler kv bulk delete", definition: kvBulkDeleteCommand }
  ]);
  registry.registerNamespace("kv");
  registry.define([
    { command: "wrangler queues", definition: queuesNamespace },
    { command: "wrangler queues list", definition: queuesListCommand },
    { command: "wrangler queues create", definition: queuesCreateCommand },
    { command: "wrangler queues update", definition: queuesUpdateCommand },
    { command: "wrangler queues delete", definition: queuesDeleteCommand },
    { command: "wrangler queues info", definition: queuesInfoCommand },
    {
      command: "wrangler queues consumer",
      definition: queuesConsumerNamespace
    },
    {
      command: "wrangler queues pause-delivery",
      definition: queuesPauseCommand
    },
    {
      command: "wrangler queues resume-delivery",
      definition: queuesResumeCommand
    },
    {
      command: "wrangler queues purge",
      definition: queuesPurgeCommand
    },
    {
      command: "wrangler queues subscription",
      definition: queuesSubscriptionNamespace
    },
    {
      command: "wrangler queues subscription create",
      definition: queuesSubscriptionCreateCommand
    },
    {
      command: "wrangler queues subscription list",
      definition: queuesSubscriptionListCommand
    },
    {
      command: "wrangler queues subscription get",
      definition: queuesSubscriptionGetCommand
    },
    {
      command: "wrangler queues subscription delete",
      definition: queuesSubscriptionDeleteCommand
    },
    {
      command: "wrangler queues subscription update",
      definition: queuesSubscriptionUpdateCommand
    },
    {
      command: "wrangler queues consumer add",
      definition: queuesConsumerAddCommand
    },
    {
      command: "wrangler queues consumer remove",
      definition: queuesConsumerRemoveCommand
    },
    {
      command: "wrangler queues consumer http",
      definition: queuesConsumerHttpNamespace
    },
    {
      command: "wrangler queues consumer http add",
      definition: queuesConsumerHttpAddCommand
    },
    {
      command: "wrangler queues consumer http remove",
      definition: queuesConsumerHttpRemoveCommand
    },
    {
      command: "wrangler queues consumer worker",
      definition: queuesConsumerWorkerNamespace
    },
    {
      command: "wrangler queues consumer worker add",
      definition: queuesConsumerAddCommand
    },
    {
      command: "wrangler queues consumer worker remove",
      definition: queuesConsumerRemoveCommand
    }
  ]);
  registry.registerNamespace("queues");
  registry.define([
    { command: "wrangler r2", definition: r2Namespace },
    {
      command: "wrangler r2 object",
      definition: r2ObjectNamespace
    },
    {
      command: "wrangler r2 object get",
      definition: r2ObjectGetCommand
    },
    {
      command: "wrangler r2 object put",
      definition: r2ObjectPutCommand
    },
    {
      command: "wrangler r2 object delete",
      definition: r2ObjectDeleteCommand
    },
    {
      command: "wrangler r2 bucket",
      definition: r2BucketNamespace
    },
    {
      command: "wrangler r2 bucket create",
      definition: r2BucketCreateCommand
    },
    {
      command: "wrangler r2 bucket update",
      definition: r2BucketUpdateNamespace
    },
    {
      command: "wrangler r2 bucket update storage-class",
      definition: r2BucketUpdateStorageClassCommand
    },
    {
      command: "wrangler r2 bucket list",
      definition: r2BucketListCommand
    },
    {
      command: "wrangler r2 bucket info",
      definition: r2BucketInfoCommand
    },
    {
      command: "wrangler r2 bucket delete",
      definition: r2BucketDeleteCommand
    },
    {
      command: "wrangler r2 bucket sippy",
      definition: r2BucketSippyNamespace
    },
    {
      command: "wrangler r2 bucket sippy enable",
      definition: r2BucketSippyEnableCommand
    },
    {
      command: "wrangler r2 bucket sippy disable",
      definition: r2BucketSippyDisableCommand
    },
    {
      command: "wrangler r2 bucket sippy get",
      definition: r2BucketSippyGetCommand
    },
    {
      command: "wrangler r2 bucket catalog",
      definition: r2BucketCatalogNamespace
    },
    {
      command: "wrangler r2 bucket catalog enable",
      definition: r2BucketCatalogEnableCommand
    },
    {
      command: "wrangler r2 bucket catalog disable",
      definition: r2BucketCatalogDisableCommand
    },
    {
      command: "wrangler r2 bucket catalog get",
      definition: r2BucketCatalogGetCommand
    },
    {
      command: "wrangler r2 bucket catalog compaction",
      definition: r2BucketCatalogCompactionNamespace
    },
    {
      command: "wrangler r2 bucket catalog compaction enable",
      definition: r2BucketCatalogCompactionEnableCommand
    },
    {
      command: "wrangler r2 bucket catalog compaction disable",
      definition: r2BucketCatalogCompactionDisableCommand
    },
    {
      command: "wrangler r2 bucket catalog snapshot-expiration",
      definition: r2BucketCatalogSnapshotExpirationNamespace
    },
    {
      command: "wrangler r2 bucket catalog snapshot-expiration enable",
      definition: r2BucketCatalogSnapshotExpirationEnableCommand
    },
    {
      command: "wrangler r2 bucket catalog snapshot-expiration disable",
      definition: r2BucketCatalogSnapshotExpirationDisableCommand
    },
    {
      command: "wrangler r2 bucket notification",
      definition: r2BucketNotificationNamespace
    },
    {
      command: "wrangler r2 bucket notification get",
      definition: r2BucketNotificationGetAlias
    },
    {
      command: "wrangler r2 bucket notification list",
      definition: r2BucketNotificationListCommand
    },
    {
      command: "wrangler r2 bucket notification create",
      definition: r2BucketNotificationCreateCommand
    },
    {
      command: "wrangler r2 bucket notification delete",
      definition: r2BucketNotificationDeleteCommand
    },
    {
      command: "wrangler r2 bucket domain",
      definition: r2BucketDomainNamespace
    },
    {
      command: "wrangler r2 bucket domain list",
      definition: r2BucketDomainListCommand
    },
    {
      command: "wrangler r2 bucket domain get",
      definition: r2BucketDomainGetCommand
    },
    {
      command: "wrangler r2 bucket domain add",
      definition: r2BucketDomainAddCommand
    },
    {
      command: "wrangler r2 bucket domain remove",
      definition: r2BucketDomainRemoveCommand
    },
    {
      command: "wrangler r2 bucket domain update",
      definition: r2BucketDomainUpdateCommand
    },
    {
      command: "wrangler r2 bucket dev-url",
      definition: r2BucketDevUrlNamespace
    },
    {
      command: "wrangler r2 bucket dev-url get",
      definition: r2BucketDevUrlGetCommand
    },
    {
      command: "wrangler r2 bucket dev-url enable",
      definition: r2BucketDevUrlEnableCommand
    },
    {
      command: "wrangler r2 bucket dev-url disable",
      definition: r2BucketDevUrlDisableCommand
    },
    {
      command: "wrangler r2 bucket local-uploads",
      definition: r2BucketLocalUploadsNamespace
    },
    {
      command: "wrangler r2 bucket local-uploads get",
      definition: r2BucketLocalUploadsGetConfigCommand
    },
    {
      command: "wrangler r2 bucket local-uploads enable",
      definition: r2BucketLocalUploadsEnableCommand
    },
    {
      command: "wrangler r2 bucket local-uploads disable",
      definition: r2BucketLocalUploadsDisableCommand
    },
    {
      command: "wrangler r2 bucket lifecycle",
      definition: r2BucketLifecycleNamespace
    },
    {
      command: "wrangler r2 bucket lifecycle list",
      definition: r2BucketLifecycleListCommand
    },
    {
      command: "wrangler r2 bucket lifecycle add",
      definition: r2BucketLifecycleAddCommand
    },
    {
      command: "wrangler r2 bucket lifecycle remove",
      definition: r2BucketLifecycleRemoveCommand
    },
    {
      command: "wrangler r2 bucket lifecycle set",
      definition: r2BucketLifecycleSetCommand
    },
    {
      command: "wrangler r2 bucket cors",
      definition: r2BucketCORSNamespace
    },
    {
      command: "wrangler r2 bucket cors delete",
      definition: r2BucketCORSDeleteCommand
    },
    {
      command: "wrangler r2 bucket cors list",
      definition: r2BucketCORSListCommand
    },
    {
      command: "wrangler r2 bucket cors set",
      definition: r2BucketCORSSetCommand
    },
    {
      command: "wrangler r2 bucket lock",
      definition: r2BucketLockNamespace
    },
    {
      command: "wrangler r2 bucket lock list",
      definition: r2BucketLockListCommand
    },
    {
      command: "wrangler r2 bucket lock add",
      definition: r2BucketLockAddCommand
    },
    {
      command: "wrangler r2 bucket lock remove",
      definition: r2BucketLockRemoveCommand
    },
    {
      command: "wrangler r2 bucket lock set",
      definition: r2BucketLockSetCommand
    },
    {
      command: "wrangler r2 sql",
      definition: r2SqlNamespace
    },
    {
      command: "wrangler r2 sql query",
      definition: r2SqlQueryCommand
    },
    {
      command: "wrangler r2 bulk",
      definition: r2BulkNamespace
    },
    {
      command: "wrangler r2 bulk put",
      definition: r2BulkPutCommand
    }
  ]);
  registry.registerNamespace("r2");
  registry.define([
    { command: "wrangler d1", definition: d1Namespace },
    { command: "wrangler d1 create", definition: d1CreateCommand },
    { command: "wrangler d1 info", definition: d1InfoCommand },
    { command: "wrangler d1 list", definition: d1ListCommand },
    { command: "wrangler d1 delete", definition: d1DeleteCommand },
    { command: "wrangler d1 execute", definition: d1ExecuteCommand },
    { command: "wrangler d1 export", definition: d1ExportCommand },
    { command: "wrangler d1 time-travel", definition: d1TimeTravelNamespace },
    {
      command: "wrangler d1 time-travel info",
      definition: d1TimeTravelInfoCommand
    },
    {
      command: "wrangler d1 time-travel restore",
      definition: d1TimeTravelRestoreCommand
    },
    { command: "wrangler d1 migrations", definition: d1MigrationsNamespace },
    {
      command: "wrangler d1 migrations create",
      definition: d1MigrationsCreateCommand
    },
    {
      command: "wrangler d1 migrations list",
      definition: d1MigrationsListCommand
    },
    {
      command: "wrangler d1 migrations apply",
      definition: d1MigrationsApplyCommand
    },
    { command: "wrangler d1 insights", definition: d1InsightsCommand }
  ]);
  registry.registerNamespace("d1");
  registry.define([
    { command: "wrangler vectorize", definition: vectorizeNamespace },
    {
      command: "wrangler vectorize create",
      definition: vectorizeCreateCommand
    },
    {
      command: "wrangler vectorize delete",
      definition: vectorizeDeleteCommand
    },
    { command: "wrangler vectorize get", definition: vectorizeGetCommand },
    { command: "wrangler vectorize list", definition: vectorizeListCommand },
    {
      command: "wrangler vectorize list-vectors",
      definition: vectorizeListVectorsCommand
    },
    { command: "wrangler vectorize query", definition: vectorizeQueryCommand },
    {
      command: "wrangler vectorize insert",
      definition: vectorizeInsertCommand
    },
    {
      command: "wrangler vectorize upsert",
      definition: vectorizeUpsertCommand
    },
    {
      command: "wrangler vectorize get-vectors",
      definition: vectorizeGetVectorsCommand
    },
    {
      command: "wrangler vectorize delete-vectors",
      definition: vectorizeDeleteVectorsCommand
    },
    { command: "wrangler vectorize info", definition: vectorizeInfoCommand },
    {
      command: "wrangler vectorize create-metadata-index",
      definition: vectorizeCreateMetadataIndexCommand
    },
    {
      command: "wrangler vectorize list-metadata-index",
      definition: vectorizeListMetadataIndexCommand
    },
    {
      command: "wrangler vectorize delete-metadata-index",
      definition: vectorizeDeleteMetadataIndexCommand
    }
  ]);
  registry.registerNamespace("vectorize");
  registry.define([
    { command: "wrangler hyperdrive", definition: hyperdriveNamespace },
    {
      command: "wrangler hyperdrive create",
      definition: hyperdriveCreateCommand
    },
    {
      command: "wrangler hyperdrive delete",
      definition: hyperdriveDeleteCommand
    },
    { command: "wrangler hyperdrive get", definition: hyperdriveGetCommand },
    { command: "wrangler hyperdrive list", definition: hyperdriveListCommand },
    {
      command: "wrangler hyperdrive update",
      definition: hyperdriveUpdateCommand
    }
  ]);
  registry.registerNamespace("hyperdrive");
  registry.define([
    { command: "wrangler tunnel", definition: tunnelNamespace },
    {
      command: "wrangler tunnel create",
      definition: tunnelCreateCommand
    },
    {
      command: "wrangler tunnel delete",
      definition: tunnelDeleteCommand
    },
    { command: "wrangler tunnel info", definition: tunnelInfoCommand },
    { command: "wrangler tunnel list", definition: tunnelListCommand },
    {
      command: "wrangler tunnel run",
      definition: tunnelRunCommand
    },
    {
      command: "wrangler tunnel quick-start",
      definition: tunnelQuickStartCommand
    }
  ]);
  registry.registerNamespace("tunnel");
  registry.define([
    { command: "wrangler ai-search", definition: aiSearchNamespace },
    { command: "wrangler ai-search list", definition: aiSearchListCommand },
    {
      command: "wrangler ai-search create",
      definition: aiSearchCreateCommand
    },
    { command: "wrangler ai-search get", definition: aiSearchGetCommand },
    {
      command: "wrangler ai-search update",
      definition: aiSearchUpdateCommand
    },
    {
      command: "wrangler ai-search delete",
      definition: aiSearchDeleteCommand
    },
    { command: "wrangler ai-search stats", definition: aiSearchStatsCommand },
    {
      command: "wrangler ai-search search",
      definition: aiSearchSearchCommand
    }
  ]);
  registry.registerNamespace("ai-search");
  registry.define([
    { command: "wrangler cert", definition: certNamespace },
    { command: "wrangler cert upload", definition: certUploadNamespace },
    {
      command: "wrangler cert upload mtls-certificate",
      definition: certUploadMtlsCommand
    },
    {
      command: "wrangler cert upload certificate-authority",
      definition: certUploadCaCertCommand
    },
    { command: "wrangler cert list", definition: certListCommand },
    { command: "wrangler cert delete", definition: certDeleteCommand }
  ]);
  registry.registerNamespace("cert");
  registry.define([
    { command: "wrangler pages", definition: pagesNamespace },
    { command: "wrangler pages dev", definition: pagesDevCommand },
    {
      command: "wrangler pages functions",
      definition: pagesFunctionsNamespace
    },
    {
      command: "wrangler pages functions build",
      definition: pagesFunctionsBuildCommand
    },
    {
      command: "wrangler pages functions build-env",
      definition: pagesFunctionsBuildEnvCommand
    },
    {
      command: "wrangler pages functions optimize-routes",
      definition: pagesFunctionsOptimizeRoutesCommand
    },
    { command: "wrangler pages project", definition: pagesProjectNamespace },
    {
      command: "wrangler pages project list",
      definition: pagesProjectListCommand
    },
    {
      command: "wrangler pages project create",
      definition: pagesProjectCreateCommand
    },
    {
      command: "wrangler pages project delete",
      definition: pagesProjectDeleteCommand
    },
    {
      command: "wrangler pages project upload",
      definition: pagesProjectUploadCommand
    },
    {
      command: "wrangler pages project validate",
      definition: pagesProjectValidateCommand
    },
    {
      command: "wrangler pages deployment",
      definition: pagesDeploymentNamespace
    },
    {
      command: "wrangler pages deployment list",
      definition: pagesDeploymentListCommand
    },
    {
      command: "wrangler pages deployment create",
      definition: pagesDeploymentCreateCommand
    },
    {
      command: "wrangler pages deployment tail",
      definition: pagesDeploymentTailCommand
    },
    {
      command: "wrangler pages deployment delete",
      definition: pagesDeploymentDeleteCommand
    },
    { command: "wrangler pages deploy", definition: pagesDeployCommand },
    { command: "wrangler pages publish", definition: pagesPublishCommand },
    { command: "wrangler pages secret", definition: pagesSecretNamespace },
    { command: "wrangler pages download", definition: pagesDownloadNamespace },
    {
      command: "wrangler pages download config",
      definition: pagesDownloadConfigCommand
    },
    { command: "wrangler pages secret put", definition: pagesSecretPutCommand },
    {
      command: "wrangler pages secret bulk",
      definition: pagesSecretBulkCommand
    },
    {
      command: "wrangler pages secret delete",
      definition: pagesSecretDeleteCommand
    },
    {
      command: "wrangler pages secret list",
      definition: pagesSecretListCommand
    }
  ]);
  registry.registerNamespace("pages");
  registry.define([
    {
      command: "wrangler mtls-certificate",
      definition: mTlsCertificateNamespace
    },
    {
      command: "wrangler mtls-certificate upload",
      definition: mTlsCertificateUploadCommand
    },
    {
      command: "wrangler mtls-certificate list",
      definition: mTlsCertificateListCommand
    },
    {
      command: "wrangler mtls-certificate delete",
      definition: mTlsCertificateDeleteCommand
    }
  ]);
  registry.registerNamespace("mtls-certificate");
  registry.define([
    { command: "wrangler cloudchamber", definition: cloudchamberNamespace },
    {
      command: "wrangler cloudchamber list",
      definition: cloudchamberListCommand
    },
    {
      command: "wrangler cloudchamber create",
      definition: cloudchamberCreateCommand
    },
    {
      command: "wrangler cloudchamber delete",
      definition: cloudchamberDeleteCommand
    },
    {
      command: "wrangler cloudchamber modify",
      definition: cloudchamberModifyCommand
    },
    {
      command: "wrangler cloudchamber apply",
      definition: cloudchamberApplyCommand
    },
    {
      command: "wrangler cloudchamber curl",
      definition: cloudchamberCurlCommand
    },
    {
      command: "wrangler cloudchamber build",
      definition: cloudchamberBuildCommand
    },
    {
      command: "wrangler cloudchamber push",
      definition: cloudchamberPushCommand
    },
    {
      command: "wrangler cloudchamber ssh",
      definition: cloudchamberSshNamespace
    },
    {
      command: "wrangler cloudchamber ssh list",
      definition: cloudchamberSshListCommand
    },
    {
      command: "wrangler cloudchamber ssh create",
      definition: cloudchamberSshCreateCommand
    },
    {
      command: "wrangler cloudchamber registries",
      definition: cloudchamberRegistriesNamespace
    },
    {
      command: "wrangler cloudchamber registries configure",
      definition: cloudchamberRegistriesConfigureCommand
    },
    {
      command: "wrangler cloudchamber registries credentials",
      definition: cloudchamberRegistriesCredentialsCommand
    },
    {
      command: "wrangler cloudchamber registries remove",
      definition: cloudchamberRegistriesRemoveCommand
    },
    {
      command: "wrangler cloudchamber registries list",
      definition: cloudchamberRegistriesListCommand
    },
    {
      command: "wrangler cloudchamber images",
      definition: cloudchamberImagesNamespace
    },
    {
      command: "wrangler cloudchamber images list",
      definition: cloudchamberImagesListCommand
    },
    {
      command: "wrangler cloudchamber images delete",
      definition: cloudchamberImagesDeleteCommand
    }
  ]);
  registry.registerNamespace("cloudchamber");
  registry.define([
    { command: "wrangler containers", definition: containersNamespace },
    { command: "wrangler containers list", definition: containersListCommand },
    { command: "wrangler containers info", definition: containersInfoCommand },
    {
      command: "wrangler containers instances",
      definition: containersInstancesCommand
    },
    {
      command: "wrangler containers delete",
      definition: containersDeleteCommand
    },
    { command: "wrangler containers ssh", definition: containersSshCommand },
    {
      command: "wrangler containers build",
      definition: containersBuildCommand
    },
    { command: "wrangler containers push", definition: containersPushCommand },
    {
      command: "wrangler containers registries",
      definition: containersRegistriesNamespace
    },
    {
      command: "wrangler containers registries configure",
      definition: containersRegistriesConfigureCommand
    },
    {
      command: "wrangler containers registries list",
      definition: containersRegistriesListCommand
    },
    {
      command: "wrangler containers registries delete",
      definition: containersRegistriesDeleteCommand
    },
    {
      command: "wrangler containers registries credentials",
      definition: containersRegistriesCredentialsCommand
    },
    {
      command: "wrangler containers images",
      definition: containersImagesNamespace
    },
    {
      command: "wrangler containers images list",
      definition: containersImagesListCommand
    },
    {
      command: "wrangler containers images delete",
      definition: containersImagesDeleteCommand
    }
  ]);
  registry.registerNamespace("containers");
  registry.registerLegacyCommandCategory("containers", "Compute & AI");
  registry.define([
    {
      command: "wrangler dispatch-namespace",
      definition: dispatchNamespaceNamespace
    },
    {
      command: "wrangler dispatch-namespace list",
      definition: dispatchNamespaceListCommand
    },
    {
      command: "wrangler dispatch-namespace get",
      definition: dispatchNamespaceGetCommand
    },
    {
      command: "wrangler dispatch-namespace create",
      definition: dispatchNamespaceCreateCommand
    },
    {
      command: "wrangler dispatch-namespace delete",
      definition: dispatchNamespaceDeleteCommand
    },
    {
      command: "wrangler dispatch-namespace rename",
      definition: dispatchNamespaceRenameCommand
    }
  ]);
  registry.registerNamespace("dispatch-namespace");
  registry.define([
    { command: "wrangler ai", definition: aiNamespace },
    { command: "wrangler ai models", definition: aiModelsCommand },
    { command: "wrangler ai finetune", definition: aiFineTuneNamespace },
    { command: "wrangler ai finetune list", definition: aiFineTuneListCommand },
    {
      command: "wrangler ai finetune create",
      definition: aiFineTuneCreateCommand
    }
  ]);
  registry.registerNamespace("ai");
  registry.define([
    { command: "wrangler browser", definition: browserNamespace },
    { command: "wrangler browser create", definition: browserCreateCommand },
    { command: "wrangler browser close", definition: browserCloseCommand },
    { command: "wrangler browser list", definition: browserListCommand },
    { command: "wrangler browser view", definition: browserViewCommand }
  ]);
  registry.registerNamespace("browser");
  registry.define([
    { command: "wrangler secrets-store", definition: secretsStoreNamespace },
    {
      command: "wrangler secrets-store store",
      definition: secretsStoreStoreNamespace
    },
    {
      command: "wrangler secrets-store store create",
      definition: secretsStoreStoreCreateCommand
    },
    {
      command: "wrangler secrets-store store delete",
      definition: secretsStoreStoreDeleteCommand
    },
    {
      command: "wrangler secrets-store store list",
      definition: secretsStoreStoreListCommand
    },
    {
      command: "wrangler secrets-store secret",
      definition: secretsStoreSecretNamespace
    },
    {
      command: "wrangler secrets-store secret create",
      definition: secretsStoreSecretCreateCommand
    },
    {
      command: "wrangler secrets-store secret list",
      definition: secretsStoreSecretListCommand
    },
    {
      command: "wrangler secrets-store secret get",
      definition: secretsStoreSecretGetCommand
    },
    {
      command: "wrangler secrets-store secret update",
      definition: secretsStoreSecretUpdateCommand
    },
    {
      command: "wrangler secrets-store secret delete",
      definition: secretsStoreSecretDeleteCommand
    },
    {
      command: "wrangler secrets-store secret duplicate",
      definition: secretsStoreSecretDuplicateCommand
    }
  ]);
  registry.registerNamespace("secrets-store");
  registry.define([
    {
      command: "wrangler workflows",
      definition: workflowsNamespace
    },
    {
      command: "wrangler workflows list",
      definition: workflowsListCommand
    },
    {
      command: "wrangler workflows describe",
      definition: workflowsDescribeCommand
    },
    {
      command: "wrangler workflows delete",
      definition: workflowsDeleteCommand
    },
    {
      command: "wrangler workflows trigger",
      definition: workflowsTriggerCommand
    },
    {
      command: "wrangler workflows instances",
      definition: workflowsInstanceNamespace
    },
    {
      command: "wrangler workflows instances list",
      definition: workflowsInstancesListCommand
    },
    {
      command: "wrangler workflows instances describe",
      definition: workflowsInstancesDescribeCommand
    },
    {
      command: "wrangler workflows instances send-event",
      definition: workflowsInstancesSendEventCommand
    },
    {
      command: "wrangler workflows instances terminate",
      definition: workflowsInstancesTerminateCommand
    },
    {
      command: "wrangler workflows instances restart",
      definition: workflowsInstancesRestartCommand
    },
    {
      command: "wrangler workflows instances terminate-all",
      definition: workflowsInstancesTerminateAllCommand
    },
    {
      command: "wrangler workflows instances pause",
      definition: workflowsInstancesPauseCommand
    },
    {
      command: "wrangler workflows instances resume",
      definition: workflowsInstancesResumeCommand
    }
  ]);
  registry.registerNamespace("workflows");
  registry.define([
    {
      command: "wrangler pipelines",
      definition: pipelinesNamespace
    },
    {
      command: "wrangler pipelines setup",
      definition: pipelinesSetupCommand
    },
    {
      command: "wrangler pipelines create",
      definition: pipelinesCreateCommand
    },
    {
      command: "wrangler pipelines list",
      definition: pipelinesListCommand
    },
    {
      command: "wrangler pipelines get",
      definition: pipelinesGetCommand
    },
    {
      command: "wrangler pipelines update",
      definition: pipelinesUpdateCommand
    },
    {
      command: "wrangler pipelines delete",
      definition: pipelinesDeleteCommand
    },
    {
      command: "wrangler pipelines streams",
      definition: pipelinesStreamsNamespace
    },
    {
      command: "wrangler pipelines streams create",
      definition: pipelinesStreamsCreateCommand
    },
    {
      command: "wrangler pipelines streams list",
      definition: pipelinesStreamsListCommand
    },
    {
      command: "wrangler pipelines streams get",
      definition: pipelinesStreamsGetCommand
    },
    {
      command: "wrangler pipelines streams delete",
      definition: pipelinesStreamsDeleteCommand
    },
    {
      command: "wrangler pipelines sinks",
      definition: pipelinesSinksNamespace
    },
    {
      command: "wrangler pipelines sinks create",
      definition: pipelinesSinksCreateCommand
    },
    {
      command: "wrangler pipelines sinks list",
      definition: pipelinesSinksListCommand
    },
    {
      command: "wrangler pipelines sinks get",
      definition: pipelinesSinksGetCommand
    },
    {
      command: "wrangler pipelines sinks delete",
      definition: pipelinesSinksDeleteCommand
    }
  ]);
  registry.registerNamespace("pipelines");
  registry.define([
    { command: "wrangler vpc", definition: vpcNamespace },
    { command: "wrangler vpc service", definition: vpcServiceNamespace },
    {
      command: "wrangler vpc service create",
      definition: vpcServiceCreateCommand
    },
    {
      command: "wrangler vpc service delete",
      definition: vpcServiceDeleteCommand
    },
    {
      command: "wrangler vpc service get",
      definition: vpcServiceGetCommand
    },
    {
      command: "wrangler vpc service list",
      definition: vpcServiceListCommand
    },
    {
      command: "wrangler vpc service update",
      definition: vpcServiceUpdateCommand
    }
  ]);
  registry.registerNamespace("vpc");
  registry.define([
    { command: "wrangler email", definition: emailNamespace },
    { command: "wrangler email routing", definition: emailRoutingNamespace },
    {
      command: "wrangler email routing list",
      definition: emailRoutingListCommand
    },
    {
      command: "wrangler email routing settings",
      definition: emailRoutingSettingsCommand
    },
    {
      command: "wrangler email routing enable",
      definition: emailRoutingEnableCommand
    },
    {
      command: "wrangler email routing disable",
      definition: emailRoutingDisableCommand
    },
    {
      command: "wrangler email routing dns",
      definition: emailRoutingDnsNamespace
    },
    {
      command: "wrangler email routing dns get",
      definition: emailRoutingDnsGetCommand
    },
    {
      command: "wrangler email routing dns unlock",
      definition: emailRoutingDnsUnlockCommand
    },
    {
      command: "wrangler email routing rules",
      definition: emailRoutingRulesNamespace
    },
    {
      command: "wrangler email routing rules list",
      definition: emailRoutingRulesListCommand
    },
    {
      command: "wrangler email routing rules get",
      definition: emailRoutingRulesGetCommand
    },
    {
      command: "wrangler email routing rules create",
      definition: emailRoutingRulesCreateCommand
    },
    {
      command: "wrangler email routing rules update",
      definition: emailRoutingRulesUpdateCommand
    },
    {
      command: "wrangler email routing rules delete",
      definition: emailRoutingRulesDeleteCommand
    },
    {
      command: "wrangler email routing addresses",
      definition: emailRoutingAddressesNamespace
    },
    {
      command: "wrangler email routing addresses list",
      definition: emailRoutingAddressesListCommand
    },
    {
      command: "wrangler email routing addresses get",
      definition: emailRoutingAddressesGetCommand
    },
    {
      command: "wrangler email routing addresses create",
      definition: emailRoutingAddressesCreateCommand
    },
    {
      command: "wrangler email routing addresses delete",
      definition: emailRoutingAddressesDeleteCommand
    },
    { command: "wrangler email sending", definition: emailSendingNamespace },
    {
      command: "wrangler email sending list",
      definition: emailSendingListCommand
    },
    {
      command: "wrangler email sending settings",
      definition: emailSendingSettingsCommand
    },
    {
      command: "wrangler email sending enable",
      definition: emailSendingEnableCommand
    },
    {
      command: "wrangler email sending disable",
      definition: emailSendingDisableCommand
    },
    {
      command: "wrangler email sending send",
      definition: emailSendingSendCommand
    },
    {
      command: "wrangler email sending send-raw",
      definition: emailSendingSendRawCommand
    },
    {
      command: "wrangler email sending dns",
      definition: emailSendingDnsNamespace
    },
    {
      command: "wrangler email sending dns get",
      definition: emailSendingDnsGetCommand
    }
  ]);
  registry.registerNamespace("email");
  registry.define([
    { command: "wrangler hello-world", definition: helloWorldNamespace },
    {
      command: "wrangler hello-world get",
      definition: helloWorldGetCommand
    },
    {
      command: "wrangler hello-world set",
      definition: helloWorldSetCommand
    }
  ]);
  registry.registerNamespace("hello-world");
  registry.define([
    {
      command: "wrangler login",
      definition: loginCommand
    }
  ]);
  registry.registerNamespace("login");
  registry.define([
    {
      command: "wrangler logout",
      definition: logoutCommand
    }
  ]);
  registry.registerNamespace("logout");
  registry.define([
    {
      command: "wrangler whoami",
      definition: whoamiCommand
    }
  ]);
  registry.registerNamespace("whoami");
  registry.define([
    {
      command: "wrangler auth",
      definition: authNamespace
    },
    {
      command: "wrangler auth token",
      definition: authTokenCommand
    }
  ]);
  registry.registerNamespace("auth");
  registry.define([
    {
      command: "wrangler telemetry",
      definition: telemetryNamespace
    },
    {
      command: "wrangler metrics",
      definition: metricsAlias
    },
    {
      command: "wrangler telemetry disable",
      definition: telemetryDisableCommand
    },
    {
      command: "wrangler telemetry enable",
      definition: telemetryEnableCommand
    },
    {
      command: "wrangler telemetry status",
      definition: telemetryStatusCommand
    }
  ]);
  registry.registerNamespace("telemetry");
  registry.define([
    {
      command: "wrangler check",
      definition: checkNamespace
    },
    {
      command: "wrangler check startup",
      definition: checkStartupCommand
    }
  ]);
  registry.registerNamespace("check");
  registry.define([
    {
      command: "wrangler build",
      definition: buildCommand2
    }
  ]);
  registry.registerNamespace("build");
  wrangler.version(false);
  registry.registerAll();
  wrangler.help("help", "Show help").alias("h", "help");
  wrangler.exitProcess(false);
  return { wrangler, registry, globalFlags, showHelpWithCategories };
}
async function main(argv) {
  setupSentry();
  checkMacOSVersion({ shouldThrow: false });
  const hasHelpFlag = argv.includes("--help") || argv.includes("-h");
  const nonFlagArgs = argv.filter((arg) => !arg.startsWith("-"));
  const isRootHelpRequest = hasHelpFlag && nonFlagArgs.length === 0;
  const { wrangler, registry, showHelpWithCategories } = createCLIParser(argv);
  if (isRootHelpRequest) {
    await showHelpWithCategories();
    return;
  }
  const [subCommand] = nonFlagArgs;
  if (hasHelpFlag && subCommand) {
    const knownCommands = registry.topLevelCommands;
    if (!knownCommands.has(subCommand)) {
      logger.info("");
      logger.error(`Unknown argument: ${subCommand}`);
      await showHelpWithCategories();
      throw new CommandLineArgsError(`Unknown argument: ${subCommand}`);
    }
  }
  const startTime = Date.now();
  let configArgs = {};
  let dispatcher;
  wrangler.middleware(
    (args) => {
      if (Object.keys(LOGGER_LEVELS).includes(args.logLevel)) {
        logger.loggerLevel = args.logLevel;
      }
      setLogLevel(logger.loggerLevel);
      configArgs = args;
      try {
        const { rawConfig, configPath } = exports.experimental_readRawConfig(args);
        dispatcher = getMetricsDispatcher({
          sendMetrics: rawConfig.send_metrics,
          hasAssets: !!rawConfig.assets?.directory,
          configPath,
          argv
        });
      } catch (e10) {
        logger.debug("Failed to parse config for metrics. Using defaults.", e10);
        dispatcher = getMetricsDispatcher({ });
      }
    },
    /* applyBeforeValidation */
    true
  );
  let cliHandlerThrew = false;
  try {
    await wrangler.parse();
  } catch (e10) {
    cliHandlerThrew = true;
    if (e10 instanceof CommandHandledError) {
      throw e10.originalError;
    } else {
      if (dispatcher) {
        dispatchGenericCommandErrorEvent(dispatcher, startTime, e10);
      }
      await handleError(e10, configArgs, argv);
      throw e10;
    }
  } finally {
    try {
      if (typeof vitest === "undefined") {
        process.disconnect?.();
      }
      await closeSentry();
      await Promise.race([
        allMetricsDispatchesCompleted(),
        promises.setTimeout(1e3, void 0, { ref: false })
      ]);
    } catch (e10) {
      logger.error(e10);
      if (!cliHandlerThrew) {
        throw e10;
      }
    }
  }
}
function dispatchGenericCommandErrorEvent(dispatcher, startTime, error2) {
  const durationMs = Date.now() - startTime;
  const sanitizedCommand = "";
  const sanitizedArgs = {};
  dispatcher.sendCommandEvent("wrangler command started", {
    sanitizedCommand,
    sanitizedArgs,
    argsUsed: []
  });
  dispatcher.sendCommandEvent("wrangler command errored", {
    sanitizedCommand,
    sanitizedArgs,
    argsUsed: [],
    durationMs,
    ...sanitizeError(error2)
  });
}
var import_undici25;
var init_src3 = __esm({
  "src/index.ts"() {
    init_import_meta_url();
    init_cli();
    init_dist();
    init_source();
    import_undici25 = __toESM(require_undici());
    init_yargs();
    init_package();
    init_ai3();
    init_create();
    init_delete();
    init_get();
    init_ai_search();
    init_list2();
    init_search2();
    init_stats2();
    init_update();
    init_createFinetune();
    init_listCatalog();
    init_listFinetune();
    init_browser_rendering2();
    init_build4();
    init_cert();
    init_commands3();
    init_cloudchamber();
    init_complete();
    init_dot_env();
    init_containers2();
    init_core3();
    init_CommandHandledError();
    init_CommandRegistry();
    init_handle_errors();
    init_register_yargs_command();
    init_d12();
    init_create4();
    init_delete3();
    init_execute();
    init_export2();
    init_info();
    init_insights3();
    init_list5();
    init_migrations();
    init_apply2();
    init_create5();
    init_list6();
    init_timeTravel();
    init_info2();
    init_restore();
    init_delete4();
    init_deploy2();
    init_dev2();
    init_dispatch_namespace();
    init_docs();
    init_create6();
    init_delete5();
    init_get2();
    init_list7();
    init_disable();
    init_dns_get();
    init_dns_unlock();
    init_enable();
    init_email_routing2();
    init_list8();
    init_create7();
    init_delete6();
    init_get3();
    init_list9();
    init_update2();
    init_disable2();
    init_dns_get2();
    init_enable2();
    init_list10();
    init_send();
    init_send_raw();
    init_settings17();
    init_settings18();
    init_hello_world();
    init_create8();
    init_delete7();
    init_get4();
    init_hyperdrive2();
    init_list11();
    init_update3();
    init_init();
    init_kv2();
    init_logger();
    init_metrics();
    init_commands4();
    init_sanitization();
    init_cli3();
    init_output();
    init_pages4();
    init_build5();
    init_build_env();
    init_deploy4();
    init_deployment_tails();
    init_deployments4();
    init_dev();
    init_download_config();
    init_functions();
    init_projects2();
    init_secret2();
    init_upload4();
    init_validate3();
    init_pipelines2();
    init_create9();
    init_delete8();
    init_get5();
    init_list12();
    init_setup();
    init_sinks();
    init_create10();
    init_delete9();
    init_get6();
    init_list13();
    init_streams2();
    init_create11();
    init_delete10();
    init_get7();
    init_list14();
    init_update4();
    init_preview3();
    init_commands9();
    init_consumer();
    init_http_pull();
    init_add();
    init_remove();
    init_worker2();
    init_add2();
    init_remove2();
    init_create12();
    init_delete11();
    init_info3();
    init_list15();
    init_pause_resume();
    init_purge2();
    init_subscription();
    init_create13();
    init_delete12();
    init_get8();
    init_list16();
    init_update5();
    init_update6();
    init_r22();
    init_bucket2();
    init_catalog2();
    init_cors2();
    init_domain4();
    init_lifecycle2();
    init_local_uploads2();
    init_lock();
    init_notification2();
    init_object3();
    init_public_dev_url();
    init_sippy3();
    init_sql();
    init_secret();
    init_secrets_store2();
    init_commands2();
    init_sentry();
    init_setup2();
    init_tail2();
    init_triggers();
    init_create14();
    init_delete13();
    init_tunnel();
    init_info4();
    init_list17();
    init_quick_start();
    init_run2();
    init_type_generation();
    init_commands10();
    init_constants7();
    init_log_file();
    init_create15();
    init_createMetadataIndex();
    init_delete14();
    init_deleteByIds();
    init_deleteMetadataIndex();
    init_get9();
    init_getByIds();
    init_vectorize2();
    init_info5();
    init_insert();
    init_list18();
    init_listMetadataIndex();
    init_listVectors();
    init_query();
    init_upsert();
    init_versions7();
    init_deploy6();
    init_deployments5();
    init_list20();
    init_status3();
    init_view2();
    init_list19();
    init_rollback();
    init_secrets4();
    init_bulk2();
    init_delete15();
    init_list21();
    init_put();
    init_upload5();
    init_view3();
    init_create16();
    init_delete16();
    init_get10();
    init_vpc();
    init_list22();
    init_update7();
    init_workflows2();
    init_delete17();
    init_describe();
    init_describe2();
    init_list23();
    init_pause();
    init_restart();
    init_resume();
    init_send_event2();
    init_terminate();
    init_terminate_all();
    init_list24();
    init_trigger();
    init_wrangler_banner();
    if (proxy) {
      (0, import_undici25.setGlobalDispatcher)(
        new import_undici25.EnvHttpProxyAgent({ noProxy: noProxy || "localhost,127.0.0.1,::1" })
      );
      logger.warn(
        `Proxy environment variables detected. We'll use your proxy for fetch requests.`
      );
    }
    __name(createCLIParser, "createCLIParser");
    __name(main, "main");
    __name(dispatchGenericCommandErrorEvent, "dispatchGenericCommandErrorEvent");
  }
});

// src/utils/logPossibleBugMessage.ts
async function logPossibleBugMessage() {
  if (process.versions.bun) {
    logger.warn(
      `Wrangler does not support the Bun runtime. Please try this command again using Node.js via \`npm\` or \`pnpm\`. Alternatively, make sure you're not passing the \`--bun\` flag when running \`bun run wrangler ...\``
    );
    return;
  }
  logger.log(
    `${fgGreenColor}%s${resetColor}`,
    "If you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose"
  );
  const latestVersion = await updateCheck();
  if (latestVersion) {
    logger.log(
      `Note that there is a newer version of Wrangler available (${latestVersion}). Consider checking whether upgrading resolves this error.`
    );
  }
}
var init_logPossibleBugMessage = __esm({
  "src/utils/logPossibleBugMessage.ts"() {
    init_import_meta_url();
    init_logger();
    init_update_check();
    init_constants7();
    __name(logPossibleBugMessage, "logPossibleBugMessage");
  }
});
function isCertificateError(e10) {
  const message = e10 instanceof Error ? e10.message : String(e10);
  const causeMessage = e10 instanceof Error && e10.cause instanceof Error ? e10.cause.message : "";
  return SSL_CERT_ERROR_MESSAGES.some(
    (errorText) => message.includes(errorText) || causeMessage.includes(errorText)
  );
}
function isPermissionError(e10) {
  if (e10 && typeof e10 === "object" && "code" in e10 && (e10.code === "EPERM" || e10.code === "EACCES") && "message" in e10) {
    return true;
  }
  if (e10 instanceof Error && e10.cause) {
    return isPermissionError(e10.cause);
  }
  return false;
}
function isFileNotFoundError(e10) {
  if (e10 && typeof e10 === "object" && "code" in e10 && e10.code === "ENOENT" && "message" in e10) {
    return true;
  }
  if (e10 instanceof Error && e10.cause) {
    return isFileNotFoundError(e10.cause);
  }
  return false;
}
function isCloudflareAPI(text) {
  return text.includes("api.cloudflare.com") || text.includes("dash.cloudflare.com");
}
function isCloudflareAPIDNSError(e10) {
  const hasDNSErrorCode = /* @__PURE__ */ __name((obj) => {
    return obj !== null && typeof obj === "object" && "code" in obj && obj.code === "ENOTFOUND";
  }, "hasDNSErrorCode");
  if (hasDNSErrorCode(e10)) {
    const message = e10 instanceof Error ? e10.message : String(e10);
    if (isCloudflareAPI(message)) {
      return true;
    }
    if (e10 && typeof e10 === "object" && "hostname" in e10 && typeof e10.hostname === "string") {
      if (isCloudflareAPI(e10.hostname)) {
        return true;
      }
    }
  }
  if (e10 instanceof Error && e10.cause && hasDNSErrorCode(e10.cause)) {
    const causeMessage = e10.cause instanceof Error ? e10.cause.message : String(e10.cause);
    const parentMessage = e10.message;
    if (isCloudflareAPI(causeMessage) || isCloudflareAPI(parentMessage)) {
      return true;
    }
    if (typeof e10.cause === "object" && "hostname" in e10.cause && typeof e10.cause.hostname === "string") {
      if (isCloudflareAPI(e10.cause.hostname)) {
        return true;
      }
    }
  }
  return false;
}
function isCloudflareAPIConnectionTimeoutError(e10) {
  const hasTimeoutCode = /* @__PURE__ */ __name((obj) => {
    return obj !== null && typeof obj === "object" && "code" in obj && obj.code === "UND_ERR_CONNECT_TIMEOUT";
  }, "hasTimeoutCode");
  if (hasTimeoutCode(e10)) {
    const message = e10 instanceof Error ? e10.message : String(e10);
    if (isCloudflareAPI(message)) {
      return true;
    }
  }
  if (e10 instanceof Error && e10.cause && hasTimeoutCode(e10.cause)) {
    const causeMessage = e10.cause instanceof Error ? e10.cause.message : String(e10.cause);
    const parentMessage = e10.message;
    if (isCloudflareAPI(causeMessage) || isCloudflareAPI(parentMessage)) {
      return true;
    }
  }
  return false;
}
function isNetworkFetchFailedError(e10) {
  if (e10 instanceof TypeError) {
    const message = e10.message;
    if (message.includes("fetch failed")) {
      return true;
    }
  }
  return false;
}
function isContainersAuthenticationError(e10) {
  return e10 instanceof UserError && e10.cause instanceof ApiError && e10.cause.status === 403;
}
function isAuthenticationError(e10) {
  return e10 instanceof ParseError && e10.code === 1e4;
}
function getErrorType(e10) {
  if (isCloudflareAPIDNSError(e10)) {
    return "DNSError";
  }
  if (isPermissionError(e10)) {
    return "PermissionError";
  }
  if (isFileNotFoundError(e10)) {
    return "FileNotFoundError";
  }
  if (isCloudflareAPIConnectionTimeoutError(e10)) {
    return "ConnectionTimeout";
  }
  if (isAuthenticationError(e10) || isContainersAuthenticationError(e10)) {
    return "AuthenticationError";
  }
  if (isBuildFailure(e10) || isBuildFailureFromCause(e10)) {
    return "BuildFailure";
  }
  return e10 instanceof Error ? e10.constructor.name : void 0;
}
async function handleError(e10, args, subCommandParts) {
  let mayReport = true;
  let loggableException = e10;
  logger.log("");
  if (isCertificateError(e10)) {
    logger.warn(
      "Wrangler detected that a corporate proxy or VPN might be enabled on your machine, resulting in API calls failing due to a certificate mismatch. It is likely that you need to install the missing system roots provided by your corporate proxy vendor."
    );
  }
  if (isCloudflareAPIDNSError(e10)) {
    mayReport = false;
    logger.error(esm_default3`
			Unable to resolve Cloudflare's API hostname (api.cloudflare.com or dash.cloudflare.com).

			This is typically caused by:
			  - No internet connection or network connectivity issues
			  - DNS resolver not configured or not responding
			  - Firewall or VPN blocking DNS requests
			  - Corporate network with restricted DNS

			Please check your network connection and DNS settings.
		`);
    return;
  }
  if (isPermissionError(e10)) {
    mayReport = false;
    const errorMessage = e10 instanceof Error ? e10.message : String(e10);
    let path84 = null;
    if (e10 && typeof e10 === "object" && "path" in e10 && typeof e10.path === "string") {
      path84 = e10.path;
    }
    if (!path84 && e10 instanceof Error && e10.cause && typeof e10.cause === "object" && "path" in e10.cause && typeof e10.cause.path === "string") {
      path84 = e10.cause.path;
    }
    logger.debug(`Permission error: ${errorMessage}`);
    const errorDetails = path84 ? `
Affected path: ${path84}
` : `
Error: ${errorMessage}
`;
    logger.error(esm_default3`
			A permission error occurred while accessing the file system.
			${errorDetails}
			This is typically caused by:
			  - Insufficient file or directory permissions
			  - Files or directories being locked by another process
			  - Antivirus or security software blocking access

			Please check the file permissions and try again.
		`);
    return;
  }
  if (isFileNotFoundError(e10)) {
    mayReport = false;
    const errorMessage = e10 instanceof Error ? e10.message : String(e10);
    let path84 = null;
    if (e10 && typeof e10 === "object" && "path" in e10 && typeof e10.path === "string") {
      path84 = e10.path;
    }
    if (!path84 && e10 instanceof Error && e10.cause && typeof e10.cause === "object" && "path" in e10.cause && typeof e10.cause.path === "string") {
      path84 = e10.cause.path;
    }
    logger.debug(`File not found error: ${errorMessage}`);
    const errorDetails = path84 ? `
Missing file or directory: ${path84}
` : `
Error: ${errorMessage}
`;
    logger.error(esm_default3`
			A file or directory could not be found.
			${errorDetails}
			This is typically caused by:
			  - The file or directory does not exist
			  - A typo in the file path
			  - The file was moved or deleted

			Please check the file path and try again.
		`);
    return;
  }
  if (isCloudflareAPIConnectionTimeoutError(e10)) {
    mayReport = false;
    logger.error(
      "The request to Cloudflare's API timed out.\nThis is likely due to network connectivity issues or slow network speeds.\nPlease check your internet connection and try again."
    );
    return;
  }
  if (isNetworkFetchFailedError(e10)) {
    mayReport = false;
    logger.warn(esm_default3`
			A fetch request failed, likely due to a connectivity issue.

			Common causes:
			  - No internet connection or network connectivity problems
			  - Firewall or VPN blocking the request
			  - Network proxy configuration issues

			Please check your network connection and try again.
		`);
  }
  if (e10 instanceof CommandLineArgsError) {
    logger.error(e10.message);
    const nonFlagArgs = subCommandParts.filter(
      (arg) => !arg.startsWith("-") && arg !== ""
    );
    const isUnknownArgOrCommand = e10.message.includes("Unknown argument") || e10.message.includes("Unknown command");
    const unknownArgsMatch = e10.message.match(
      /Unknown (?:arguments?|command): (.+)/
    );
    const unknownArgs = unknownArgsMatch ? unknownArgsMatch[1].split(",").map((a7) => a7.trim()) : [];
    const isUnknownCommand = unknownArgs.some(
      (arg) => arg === nonFlagArgs[0] && !arg.startsWith("-")
    );
    const isRootLevelError = isUnknownArgOrCommand && isUnknownCommand;
    const { wrangler, showHelpWithCategories } = createCLIParser([
      ...isRootLevelError ? [] : nonFlagArgs,
      "--help"
    ]);
    if (isRootLevelError) {
      await showHelpWithCategories();
      return;
    }
    await wrangler.parse();
  } else if (isAuthenticationError(e10) || isContainersAuthenticationError(e10)) {
    mayReport = false;
    if (e10.cause instanceof ApiError) {
      logger.error(e10.cause);
    } else {
      assert53__default.default(isAuthenticationError(e10));
      logger.error(e10);
    }
    const envAuth = getAuthFromEnv();
    if (envAuth !== void 0 && "apiToken" in envAuth) {
      const message = "\u{1F4CE} It looks like you are authenticating Wrangler via a custom API token set in an environment variable.\nPlease ensure it has the correct permissions for this operation.\n";
      logger.log(source_default.yellow(message));
    }
    const accountTag = e10?.accountTag;
    let complianceConfig = COMPLIANCE_REGION_CONFIG_UNKNOWN;
    let configAccountId;
    try {
      const config = await readConfig(args, {
        hideWarnings: true
      });
      complianceConfig = config;
      configAccountId = config.account_id;
    } catch {
    }
    await whoami(complianceConfig, accountTag, configAccountId);
  } else if (e10 instanceof ParseError) {
    e10.notes.push({
      text: "\nIf you think this is a bug, please open an issue at: https://github.com/cloudflare/workers-sdk/issues/new/choose"
    });
    logger.error(e10);
  } else if (e10 instanceof JsonFriendlyFatalError) {
    logger.log(e10.message);
  } else if (e10 instanceof Error && e10.message.includes("Raw mode is not supported on")) {
    mayReport = false;
    const currentPlatform = process.platform;
    const thisTerminalIsUnsupported = "This terminal doesn't support raw mode.";
    const soWranglerWontWork = "Wrangler uses raw mode to read user input and write output to the terminal, and won't function correctly without it.";
    const tryRunningItIn = "Try running your previous command in a terminal that supports raw mode";
    const oneOfThese = currentPlatform === "win32" ? ", such as Command Prompt or Powershell." : currentPlatform === "darwin" ? ", such as Terminal.app or iTerm." : ".";
    logger.error(
      `${thisTerminalIsUnsupported}
${soWranglerWontWork}
${tryRunningItIn}${oneOfThese}`
    );
  } else if (isBuildFailure(e10)) {
    mayReport = false;
    logBuildFailure(e10.errors, e10.warnings);
  } else if (isBuildFailureFromCause(e10)) {
    mayReport = false;
    logBuildFailure(e10.cause.errors, e10.cause.warnings);
  } else if (e10 instanceof Cloudflare.APIError) {
    const error2 = new APIError({
      text: `A request to the Cloudflare API failed.`,
      notes: [...e10.errors.map((err) => ({ text: renderError(err) }))]
    });
    error2.notes.push({
      text: "\nIf you think this is a bug, please open an issue at: https://github.com/cloudflare/workers-sdk/issues/new/choose"
    });
    logger.error(error2);
  } else {
    if (
      // Is this a StartDevEnv error event? If so, unwrap the cause, which is usually the user-recognisable error
      e10 && typeof e10 === "object" && "type" in e10 && e10.type === "error" && "cause" in e10 && e10.cause instanceof Error
    ) {
      loggableException = e10.cause;
    }
    logger.error(
      loggableException instanceof Error ? loggableException.message : loggableException
    );
    if (loggableException instanceof Error) {
      logger.debug(loggableException.stack);
    }
    if (!(loggableException instanceof UserError)) {
      await logPossibleBugMessage();
    }
  }
  if (
    // Only report the error if we didn't just handle it
    mayReport && // ...and it's not a user error
    !(loggableException instanceof UserError) && // ...and it's not an un-reportable API error
    !(loggableException instanceof APIError && !loggableException.reportable)
  ) {
    await captureGlobalException(loggableException);
  }
}
var SSL_ERROR_SELF_SIGNED_CERT, SSL_ERROR_UNABLE_TO_VERIFY, SSL_ERROR_UNABLE_TO_GET_ISSUER, SSL_CERT_ERROR_MESSAGES;
var init_handle_errors = __esm({
  "src/core/handle-errors.ts"() {
    init_import_meta_url();
    init_containers_shared();
    init_dist();
    init_source();
    init_cloudflare();
    init_esm2();
    init_src3();
    init_cfetch();
    init_config();
    init_build_failures();
    init_logger();
    init_sentry();
    init_user3();
    init_whoami();
    init_logPossibleBugMessage();
    SSL_ERROR_SELF_SIGNED_CERT = "self-signed certificate in certificate chain";
    SSL_ERROR_UNABLE_TO_VERIFY = "unable to verify the first certificate";
    SSL_ERROR_UNABLE_TO_GET_ISSUER = "unable to get local issuer certificate";
    SSL_CERT_ERROR_MESSAGES = [
      SSL_ERROR_SELF_SIGNED_CERT,
      SSL_ERROR_UNABLE_TO_VERIFY,
      SSL_ERROR_UNABLE_TO_GET_ISSUER
    ];
    __name(isCertificateError, "isCertificateError");
    __name(isPermissionError, "isPermissionError");
    __name(isFileNotFoundError, "isFileNotFoundError");
    __name(isCloudflareAPI, "isCloudflareAPI");
    __name(isCloudflareAPIDNSError, "isCloudflareAPIDNSError");
    __name(isCloudflareAPIConnectionTimeoutError, "isCloudflareAPIConnectionTimeoutError");
    __name(isNetworkFetchFailedError, "isNetworkFetchFailedError");
    __name(isContainersAuthenticationError, "isContainersAuthenticationError");
    __name(isAuthenticationError, "isAuthenticationError");
    __name(getErrorType, "getErrorType");
    __name(handleError, "handleError");
  }
});

// src/deploy/check-remote-secrets-override.ts
async function checkRemoteSecretsOverride(config, targetEnv) {
  const envVarNames = Object.keys(config.vars ?? {});
  const bindingNames = extractBindingNames(config);
  if (envVarNames.length + bindingNames.length > 0) {
    const secretNames = /* @__PURE__ */ new Set();
    try {
      const secrets = await fetchSecrets(config, targetEnv);
      for (const secret of secrets) {
        secretNames.add(secret.name);
      }
    } catch (e10) {
      if (isWorkerNotFoundError(e10)) {
        return { override: false };
      }
      throw e10;
    }
    const envVarNamesOverridingSecrets = envVarNames.filter(
      (name2) => secretNames.has(name2)
    );
    const bindingNamesOverridingSecrets = bindingNames.filter(
      (name2) => secretNames.has(name2)
    );
    if (envVarNamesOverridingSecrets.length + bindingNamesOverridingSecrets.length === 0) {
      return { override: false };
    }
    if (envVarNamesOverridingSecrets.length && !bindingNamesOverridingSecrets.length) {
      return {
        override: true,
        deployErrorMessage: constructSingleTypeDeployErrorMessage(
          envVarNamesOverridingSecrets,
          "variable"
        )
      };
    }
    if (bindingNamesOverridingSecrets.length && !envVarNamesOverridingSecrets.length) {
      return {
        override: true,
        deployErrorMessage: constructSingleTypeDeployErrorMessage(
          bindingNamesOverridingSecrets,
          "binding"
        )
      };
    }
    const affectedSecrets = [
      ...envVarNamesOverridingSecrets,
      ...bindingNamesOverridingSecrets
    ];
    return {
      override: true,
      deployErrorMessage: `Configuration values (${listNames(affectedSecrets)}) conflict with existing remote secrets. This deployment will replace these remote secrets with the configuration values.`
    };
  }
  return { override: false };
}
function extractBindingNames(config) {
  return Object.entries(config).flatMap((entry) => {
    const key = entry[0];
    const untypedValue = entry[1];
    switch (key) {
      case "durable_objects": {
        const value = untypedValue;
        return value.bindings.map((doBinding) => doBinding.name);
      }
      case "workflows":
      case "d1_databases":
      case "kv_namespaces":
      case "r2_buckets":
      case "vectorize":
      case "ai_search_namespaces":
      case "ai_search":
      case "services":
      case "mtls_certificates":
      case "dispatch_namespaces":
      case "vpc_services":
      case "vpc_networks": {
        const value = untypedValue;
        return (value ?? []).map((workflowBinding) => workflowBinding.binding);
      }
      case "browser":
      case "ai": {
        const value = untypedValue;
        return value ? [value.binding] : [];
      }
      case "queues": {
        const value = untypedValue;
        return (value.producers ?? []).map(
          (queueProducer) => queueProducer.binding
        );
      }
      default:
        return [];
    }
  });
}
function listNames(names) {
  if (names.length <= 1) {
    return `\`${names[0]}\``;
  }
  if (names.length == 2) {
    return `\`${names[0]}\` and \`${names[1]}\``;
  }
  return `${names.slice(0, -1).map((name2) => `\`${name2}\`, `).join("")}and \`${names.at(-1)}\``;
}
function constructSingleTypeDeployErrorMessage(names, type) {
  const multiple = names.length > 1;
  const conflictMessage = `${type === "variable" ? "Environment variable" : "Binding"}${multiple ? "s" : ""} ${listNames(names)} conflict${multiple ? "" : "s"} with ${multiple ? "" : "an "}existing remote secret${multiple ? "s" : ""}.`;
  const deploymentMessage = `This deployment will replace ${multiple ? "these" : "the"} remote secret${multiple ? "s" : ""} with your ${type === "variable" ? "environment variable" : "binding"}${multiple ? "s" : ""}.`;
  return `${conflictMessage} ${deploymentMessage}`;
}
var init_check_remote_secrets_override = __esm({
  "src/deploy/check-remote-secrets-override.ts"() {
    init_import_meta_url();
    init_fetch_secrets();
    init_worker_not_found_error();
    __name(checkRemoteSecretsOverride, "checkRemoteSecretsOverride");
    __name(extractBindingNames, "extractBindingNames");
    __name(listNames, "listNames");
    __name(constructSingleTypeDeployErrorMessage, "constructSingleTypeDeployErrorMessage");
  }
});

// src/deploy/check-workflow-conflicts.ts
async function getWorkflow(config, accountId, workflowName) {
  try {
    return await fetchResult(
      config,
      `/accounts/${accountId}/workflows/${workflowName}`
    );
  } catch (e10) {
    if (e10 instanceof APIError && e10.code === WORKFLOW_NOT_FOUND_CODE) {
      return null;
    }
    throw e10;
  }
}
async function checkWorkflowConflicts(config, accountId, scriptName) {
  const workflowsToDeploy = config.workflows?.filter(
    (w7) => w7.script_name === void 0 || w7.script_name === scriptName
  );
  if (!workflowsToDeploy?.length) {
    return { hasConflicts: false };
  }
  const workflowChecks = await Promise.all(
    workflowsToDeploy.map(async (workflow) => {
      const existing = await getWorkflow(config, accountId, workflow.name);
      if (existing && existing.script_name !== scriptName) {
        return { name: workflow.name, currentOwner: existing.script_name };
      }
      return null;
    })
  );
  const conflicts = workflowChecks.filter(
    (c8) => c8 !== null
  );
  if (conflicts.length === 0) {
    return { hasConflicts: false };
  }
  const conflictList = conflicts.map((c8) => `  - "${c8.name}" (currently belongs to "${c8.currentOwner}")`).join("\n");
  const message = `The following workflow(s) already exist and belong to different workers:
${conflictList}

Deploying will reassign these workflows to "${scriptName}".`;
  return { hasConflicts: true, conflicts, message };
}
var WORKFLOW_NOT_FOUND_CODE;
var init_check_workflow_conflicts = __esm({
  "src/deploy/check-workflow-conflicts.ts"() {
    init_import_meta_url();
    init_dist();
    init_cfetch();
    WORKFLOW_NOT_FOUND_CODE = 10200;
    __name(getWorkflow, "getWorkflow");
    __name(checkWorkflowConflicts, "checkWorkflowConflicts");
  }
});
function getRemoteConfigDiff(remoteConfig, localResolvedConfig) {
  const normalizedLocalConfig = normalizeLocalResolvedConfigAsRemote(localResolvedConfig);
  const normalizedRemoteConfig = normalizeRemoteConfigAsResolvedLocal(
    remoteConfig,
    normalizedLocalConfig
  );
  const diff = diffJsonObjects(
    normalizedRemoteConfig,
    normalizedLocalConfig
  );
  return {
    diff,
    nonDestructive: isNonDestructive(diff)
  };
}
function normalizeLocalResolvedConfigAsRemote(localResolvedConfig) {
  const subdomainValues = getSubdomainValuesAPIMock(
    localResolvedConfig.workers_dev,
    localResolvedConfig.preview_urls,
    localResolvedConfig.routes ?? []
  );
  const normalizedConfig = {
    ...structuredClone(localResolvedConfig),
    workers_dev: subdomainValues.workers_dev,
    preview_urls: subdomainValues.preview_urls,
    observability: normalizeObservability(localResolvedConfig.observability)
  };
  removeRemoteConfigFieldFromBindings(normalizedConfig);
  if (normalizedConfig.assets) {
    normalizedConfig.assets = {
      binding: normalizedConfig.assets.binding
    };
  }
  return normalizedConfig;
}
function removeRemoteConfigFieldFromBindings(normalizedConfig) {
  for (const bindingField of [
    "kv_namespaces",
    "r2_buckets",
    "d1_databases"
  ]) {
    if (normalizedConfig[bindingField]?.length) {
      normalizedConfig[bindingField] = normalizedConfig[bindingField].map(
        ({ remote: _5, ...binding }) => binding
      );
    }
  }
  if (normalizedConfig.services?.length) {
    normalizedConfig.services = normalizedConfig.services.map(
      ({ remote: _5, ...binding }) => binding
    );
  }
  if (normalizedConfig.vpc_services?.length) {
    normalizedConfig.vpc_services = normalizedConfig.vpc_services.map(
      ({ remote: _5, ...binding }) => binding
    );
  }
  if (normalizedConfig.vpc_networks?.length) {
    normalizedConfig.vpc_networks = normalizedConfig.vpc_networks.map(
      ({ remote: _5, ...binding }) => binding
    );
  }
  if (normalizedConfig.workflows?.length) {
    normalizedConfig.workflows = normalizedConfig.workflows.map(
      ({ remote: _5, ...binding }) => binding
    );
  }
  if (normalizedConfig.dispatch_namespaces?.length) {
    normalizedConfig.dispatch_namespaces = normalizedConfig.dispatch_namespaces.map(
      ({ remote: _5, ...binding }) => binding
    );
  }
  if (normalizedConfig.mtls_certificates?.length) {
    normalizedConfig.mtls_certificates = normalizedConfig.mtls_certificates.map(
      ({ remote: _5, ...binding }) => binding
    );
  }
  if (normalizedConfig.pipelines?.length) {
    normalizedConfig.pipelines = normalizedConfig.pipelines.map(
      ({ remote: _5, ...binding }) => binding
    );
  }
  if (normalizedConfig.vectorize?.length) {
    normalizedConfig.vectorize = normalizedConfig.vectorize.map(
      ({ remote: _5, ...binding }) => binding
    );
  }
  if (normalizedConfig.queues?.producers?.length) {
    normalizedConfig.queues.producers = normalizedConfig.queues.producers.map(
      ({ remote: _5, ...binding }) => binding
    );
  }
  if (normalizedConfig.send_email) {
    normalizedConfig.send_email = normalizedConfig.send_email.map(
      ({ remote: _5, ...binding }) => binding
    );
  }
  if (normalizedConfig.ai_search_namespaces?.length) {
    normalizedConfig.ai_search_namespaces = normalizedConfig.ai_search_namespaces.map(
      ({ remote: _5, ...binding }) => binding
    );
  }
  if (normalizedConfig.ai_search?.length) {
    normalizedConfig.ai_search = normalizedConfig.ai_search.map(
      ({ remote: _5, ...binding }) => binding
    );
  }
  if (normalizedConfig.flagship?.length) {
    normalizedConfig.flagship = normalizedConfig.flagship.map(
      ({ remote: _5, ...binding }) => binding
    );
  }
  const singleBindingFields = [
    "browser",
    "ai",
    "images",
    "stream",
    "media"
  ];
  for (const singleBindingField of singleBindingFields) {
    if (normalizedConfig[singleBindingField] && "remote" in normalizedConfig[singleBindingField]) {
      delete normalizedConfig[singleBindingField].remote;
    }
  }
}
function normalizeObservability(obs) {
  const normalized = structuredClone(obs);
  const enabled = obs?.enabled === true ? true : false;
  const fullObservabilityDefaults = {
    enabled,
    head_sampling_rate: 1,
    logs: {
      enabled,
      head_sampling_rate: 1,
      invocation_logs: true,
      persist: true
    },
    traces: { enabled: false, persist: true, head_sampling_rate: 1 }
  };
  if (!normalized) {
    return fullObservabilityDefaults;
  }
  const fillUndefinedFields = /* @__PURE__ */ __name((target, defaults3) => {
    Object.entries(defaults3).forEach(([key, value]) => {
      if (target[key] === void 0) {
        target[key] = value;
        return;
      }
      if (typeof value === "object" && value !== null && typeof target[key] === "object" && target[key] !== null) {
        fillUndefinedFields(
          target[key],
          value
        );
      }
    });
  }, "fillUndefinedFields");
  fillUndefinedFields(
    normalized,
    fullObservabilityDefaults
  );
  return normalized;
}
function normalizeRemoteConfigAsResolvedLocal(remoteConfig, localConfig) {
  let normalizedRemote = {};
  Object.entries(localConfig).forEach(([key, value]) => {
    if (
      // We want to skip observability since it has a remote default behavior
      // different from that of wrangler
      key !== "observability" && // We want to skip assets since it is a special case, the issue being that
      // remotely assets configs only include at most the binding name and we
      // already address that in the local config normalization already
      key !== "assets"
    ) {
      normalizedRemote[key] = value;
    }
  });
  Object.entries(remoteConfig).forEach(([key, value]) => {
    if (key !== "main" && value !== void 0) {
      normalizedRemote[key] = value;
    }
  });
  normalizedRemote.observability = normalizeObservability(
    normalizedRemote.observability
  );
  normalizedRemote = orderObjectFields(
    normalizedRemote,
    localConfig
  );
  for (const [bindingKey, shouldReorder] of Object.entries(
    reorderableBindings
  )) {
    if (!shouldReorder) {
      continue;
    }
    const key = bindingKey;
    if (key === "queues") {
      if (normalizedRemote.queues?.producers && localConfig.queues?.producers) {
        normalizedRemote.queues.producers = reorderBindings(
          normalizedRemote.queues.producers,
          localConfig.queues.producers
        );
      }
      continue;
    }
    if (key === "durable_objects") {
      if (normalizedRemote.durable_objects?.bindings && localConfig.durable_objects?.bindings) {
        normalizedRemote.durable_objects.bindings = reorderBindings(
          normalizedRemote.durable_objects.bindings,
          localConfig.durable_objects.bindings
        );
      }
      continue;
    }
    if (key === "logfwdr") {
      if (normalizedRemote.logfwdr?.bindings && localConfig.logfwdr?.bindings) {
        normalizedRemote.logfwdr.bindings = reorderBindings(
          normalizedRemote.logfwdr.bindings,
          localConfig.logfwdr.bindings
        );
      }
      continue;
    }
    reorderConfigBindings(normalizedRemote, localConfig, key);
  }
  return normalizedRemote;
}
function getBindingKey2(obj) {
  return JSON.stringify(
    obj,
    (_5, v8) => v8 && typeof v8 === "object" && !Array.isArray(v8) ? Object.fromEntries(
      Object.keys(v8).sort().map((k7) => [k7, v8[k7]])
    ) : v8
  );
}
function reorderBindings(remote, local) {
  const remoteByKey = new Map(remote.map((el) => [getBindingKey2(el), el]));
  const used = /* @__PURE__ */ new Set();
  const result = [];
  for (const binding of local) {
    const key = getBindingKey2(binding);
    const remoteEl = remoteByKey.get(key);
    if (remoteEl !== void 0) {
      result.push(remoteEl);
      used.add(key);
    }
  }
  for (const binding of remote) {
    if (!used.has(getBindingKey2(binding))) {
      result.push(binding);
    }
  }
  return result;
}
function reorderConfigBindings(normalizedRemote, localConfig, key) {
  const remoteArr = normalizedRemote[key];
  const localArr = localConfig[key];
  if (Array.isArray(remoteArr) && Array.isArray(localArr)) {
    normalizedRemote[key] = reorderBindings(remoteArr, localArr);
  }
}
function orderObjectFields(source, target) {
  const targetKeysIndexesMap = Object.fromEntries(
    Object.keys(target).map((key, i7) => [key, i7])
  );
  const orderedSource = Object.fromEntries(
    Object.entries(source).sort(([keyA], [keyB]) => {
      if (keyA in target && !(keyB in target)) {
        return -1;
      }
      if (!(keyA in target) && keyB in target) {
        return 1;
      }
      if (!(keyA in target) && !(keyB in target)) {
        return 0;
      }
      return targetKeysIndexesMap[keyA] - targetKeysIndexesMap[keyB];
    })
  );
  for (const [key, value] of Object.entries(orderedSource)) {
    if (typeof value === "object" && value !== null && !Array.isArray(value) && typeof target[key] === "object" && target[key] !== null && !Array.isArray(target[key])) {
      orderedSource[key] = orderObjectFields(
        value,
        target[key]
      );
    }
  }
  return orderedSource;
}
function getConfigPatch(configDiff, targetEnvironment) {
  const patchObj = {};
  populateConfigPatch(
    configDiff,
    patchObj,
    targetEnvironment
  );
  return patchObj;
}
function populateConfigPatch(diff, patchObj, targetEnvironment) {
  if (!diff || typeof diff !== "object") {
    return;
  }
  if (Array.isArray(diff)) {
    assert53__default.default(Array.isArray(patchObj));
    return populateConfigPatchArray(diff, patchObj);
  }
  assert53__default.default(!Array.isArray(patchObj));
  return populateConfigPatchObject(diff, patchObj, targetEnvironment);
}
function populateConfigPatchArray(diff, patchArray) {
  const elementsToAppend = [];
  Object.values(diff).forEach((element) => {
    if (!Array.isArray(element)) {
      return;
    }
    if (element.length === 1 && element[0] === " ") {
      patchArray.push({});
      return;
    }
    if (element.length === 2) {
      if (element[0] === "-") {
        elementsToAppend.push(element[1]);
        return;
      }
      if (element[0] === "~" && element[1]) {
        const patchEl = {};
        populateConfigPatch(element[1], patchEl);
        patchArray.push(patchEl);
        return;
      }
    }
  });
  elementsToAppend.forEach((el) => patchArray.push(el));
}
function populateConfigPatchObject(diff, patchObj, targetEnvironment) {
  const getEnvObj = /* @__PURE__ */ __name((targetEnv) => {
    patchObj.env ??= {};
    const patchObjEnv = patchObj.env;
    patchObjEnv[targetEnv] ??= {};
    return patchObjEnv[targetEnv];
  }, "getEnvObj");
  Object.keys(diff).filter((key) => diff[key] && typeof diff[key] === "object").forEach((key) => {
    if (isModifiedDiffValue(diff[key])) {
      if (targetEnvironment) {
        getEnvObj(targetEnvironment)[key] = diff[key].__old;
      } else {
        patchObj[key] = diff[key].__old;
      }
      return;
    }
    if (targetEnvironment) {
      getEnvObj(targetEnvironment)[key] ??= Array.isArray(diff[key]) ? [] : {};
    } else {
      patchObj[key] ??= Array.isArray(diff[key]) ? [] : {};
    }
    Object.entries(diff[key]).forEach(
      ([entryKey, entryValue]) => {
        if (entryKey.endsWith("__deleted")) {
          let patchObjectToUpdate = patchObj[key];
          if (targetEnvironment) {
            const envObj = getEnvObj(targetEnvironment);
            envObj[key] ??= {};
            patchObjectToUpdate = envObj[key];
          }
          patchObjectToUpdate[entryKey.replace("__deleted", "")] = entryValue;
          return;
        }
      }
    );
    if (diff[key] && typeof diff[key] === "object") {
      populateConfigPatch(
        diff[key],
        targetEnvironment ? getEnvObj(targetEnvironment)[key] : patchObj[key]
        // Note: we are not passing the target environment since in the recursive calls
        //       we are already one level deep and dealing with the environment specific
        //       patch object
      );
      return;
    }
  });
}
var reorderableBindings;
var init_config_diffs = __esm({
  "src/deploy/config-diffs.ts"() {
    init_import_meta_url();
    init_deploy5();
    init_diff_json();
    reorderableBindings = {
      // Top-level binding arrays
      kv_namespaces: true,
      r2_buckets: true,
      d1_databases: true,
      services: true,
      send_email: true,
      vectorize: true,
      ai_search_namespaces: true,
      ai_search: true,
      hyperdrive: true,
      workflows: true,
      dispatch_namespaces: true,
      mtls_certificates: true,
      pipelines: true,
      secrets_store_secrets: true,
      ratelimits: true,
      analytics_engine_datasets: true,
      unsafe_hello_world: true,
      flagship: true,
      worker_loaders: true,
      vpc_services: true,
      vpc_networks: true,
      // Wrapper objects containing binding arrays
      durable_objects: true,
      queues: true,
      logfwdr: true,
      // Non-array bindings (nothing to reorder)
      vars: false,
      wasm_modules: false,
      text_blobs: false,
      data_blobs: false,
      browser: false,
      ai: false,
      images: false,
      stream: false,
      media: false,
      version_metadata: false,
      unsafe: false,
      assets: false
    };
    __name(getRemoteConfigDiff, "getRemoteConfigDiff");
    __name(normalizeLocalResolvedConfigAsRemote, "normalizeLocalResolvedConfigAsRemote");
    __name(removeRemoteConfigFieldFromBindings, "removeRemoteConfigFieldFromBindings");
    __name(normalizeObservability, "normalizeObservability");
    __name(normalizeRemoteConfigAsResolvedLocal, "normalizeRemoteConfigAsResolvedLocal");
    __name(getBindingKey2, "getBindingKey");
    __name(reorderBindings, "reorderBindings");
    __name(reorderConfigBindings, "reorderConfigBindings");
    __name(orderObjectFields, "orderObjectFields");
    __name(getConfigPatch, "getConfigPatch");
    __name(populateConfigPatch, "populateConfigPatch");
    __name(populateConfigPatchArray, "populateConfigPatchArray");
    __name(populateConfigPatchObject, "populateConfigPatchObject");
  }
});
function renderRoute(route) {
  let result = "";
  if (typeof route === "string") {
    result = route;
  } else {
    result = route.pattern;
    const isCustomDomain = Boolean(
      "custom_domain" in route && route.custom_domain
    );
    if (isCustomDomain && "zone_id" in route) {
      result += ` (custom domain - zone id: ${route.zone_id})`;
    } else if (isCustomDomain && "zone_name" in route) {
      result += ` (custom domain - zone name: ${route.zone_name})`;
    } else if (isCustomDomain) {
      result += ` (custom domain)`;
    } else if ("zone_id" in route) {
      result += ` (zone id: ${route.zone_id})`;
    } else if ("zone_name" in route) {
      result += ` (zone name: ${route.zone_name})`;
    }
  }
  return result;
}
async function publishCustomDomains(complianceConfig, workerUrl, accountId, domains) {
  const options = {
    override_scope: true,
    override_existing_origin: false,
    override_existing_dns_record: false
  };
  const origins = domains.map((domainRoute) => {
    return {
      hostname: domainRoute.pattern,
      zone_id: "zone_id" in domainRoute ? domainRoute.zone_id : void 0,
      zone_name: "zone_name" in domainRoute ? domainRoute.zone_name : void 0
    };
  });
  const fail = /* @__PURE__ */ __name(() => {
    return [
      domains.length > 1 ? `Publishing to ${domains.length} Custom Domains was skipped, fix conflicts and try again` : `Publishing to Custom Domain "${domains[0].pattern}" was skipped, fix conflict and try again`
    ];
  }, "fail");
  if (!process.stdout.isTTY) {
    options.override_existing_origin = true;
    options.override_existing_dns_record = true;
  } else {
    const changeset = await fetchResult(
      complianceConfig,
      `${workerUrl}/domains/changeset?replace_state=true`,
      {
        method: "POST",
        body: JSON.stringify(origins),
        headers: {
          "Content-Type": "application/json"
        }
      }
    );
    const updatesRequired = changeset.updated.filter(
      (domain2) => domain2.modified
    );
    if (updatesRequired.length > 0) {
      const existing = await Promise.all(
        updatesRequired.map(
          (domain2) => fetchResult(
            complianceConfig,
            `/accounts/${accountId}/workers/domains/records/${domain2.id}`
          )
        )
      );
      const existingRendered = existing.map(
        (domain2) => `	\u2022 ${domain2.hostname} (used as a domain for "${domain2.service}")`
      ).join("\n");
      const message = `Custom Domains already exist for these domains:
${existingRendered}
Update them to point to this script instead?`;
      if (!await confirm(message)) {
        return fail();
      }
      options.override_existing_origin = true;
    }
    if (changeset.conflicting.length > 0) {
      const conflicitingRendered = changeset.conflicting.map((domain2) => `	\u2022 ${domain2.hostname}`).join("\n");
      const message = `You already have DNS records that conflict for these Custom Domains:
${conflicitingRendered}
Update them to point to this script instead?`;
      if (!await confirm(message)) {
        return fail();
      }
      options.override_existing_dns_record = true;
    }
  }
  await fetchResult(complianceConfig, `${workerUrl}/domains/records`, {
    method: "PUT",
    body: JSON.stringify({ ...options, origins }),
    headers: {
      "Content-Type": "application/json"
    }
  });
  return domains.map((domain2) => renderRoute(domain2));
}
function addWorkersSitesBindings(bindings, namespace, manifest, format11) {
  const withSites = { ...bindings };
  if (namespace) {
    withSites["__STATIC_CONTENT"] = {
      type: "kv_namespace",
      id: namespace
    };
  }
  if (manifest && format11 === "service-worker") {
    withSites["__STATIC_CONTENT_MANIFEST"] = {
      type: "text_blob",
      source: { contents: "__STATIC_CONTENT_MANIFEST" }
    };
  }
  return withSites;
}
async function deploy(props) {
  const deployConfirm = getDeployConfirmFunction(props.strict);
  const { config, accountId, name: name2, entry } = props;
  let workerTag = null;
  let versionId = null;
  let tags = [];
  let workerExists = true;
  const domainRoutes = (props.domains || []).map((domain2) => ({
    pattern: domain2,
    custom_domain: true
  }));
  const routes = props.routes ?? config.routes ?? (config.route ? [config.route] : []);
  const allDeploymentRoutes = [...routes, ...domainRoutes];
  if (!props.dispatchNamespace && accountId) {
    try {
      const serviceMetaData = await fetchResult(config, `/accounts/${accountId}/workers/services/${name2}`);
      const {
        default_environment: { script }
      } = serviceMetaData;
      workerTag = script.tag;
      tags = script.tags ?? tags;
      if (script.last_deployed_from === "dash") {
        const remoteWorkerConfig = await downloadWorkerConfig(
          name2,
          serviceMetaData.default_environment.environment,
          entry.file,
          accountId
        );
        const configDiff = getRemoteConfigDiff(remoteWorkerConfig, {
          ...config,
          // We also want to include all the routes used for deployment
          routes: allDeploymentRoutes
        });
        if (!configDiff.nonDestructive) {
          logger.warn(
            `The local configuration being used (generated from your local configuration file) differs from the remote configuration of your Worker set via the Cloudflare Dashboard:
${configDiff.diff}

Deploying the Worker will override the remote configuration with your local one.`
          );
          if (!await deployConfirm("Would you like to continue?")) {
            if (config.userConfigPath && /\.jsonc?$/.test(config.userConfigPath)) {
              if (await confirm(
                "Would you like to update the local config file with the remote values?",
                {
                  defaultValue: true,
                  fallbackValue: true
                }
              )) {
                const patchObj = getConfigPatch(
                  configDiff.diff,
                  props.env
                );
                exports.experimental_patchConfig(
                  config.userConfigPath,
                  patchObj,
                  false
                );
              }
            }
            return { versionId, workerTag };
          }
        }
      } else if (script.last_deployed_from === "api") {
        logger.warn(
          `You are about to publish a Workers Service that was last updated via the script API.
Edits that have been made via the script API will be overridden by your local code and config.`
        );
        if (!await deployConfirm("Would you like to continue?")) {
          return { versionId, workerTag };
        }
      }
    } catch (e10) {
      if (isWorkerNotFoundError(e10)) {
        workerExists = false;
      } else {
        throw e10;
      }
    }
  }
  if (accountId && (isInteractive3() || props.strict)) {
    const remoteSecretsCheck = await checkRemoteSecretsOverride(
      config,
      props.env
    );
    if (remoteSecretsCheck?.override) {
      logger.warn(remoteSecretsCheck.deployErrorMessage);
      if (!await deployConfirm("Would you like to continue?")) {
        return { versionId, workerTag };
      }
    }
  }
  if (accountId && config.workflows?.length && (isInteractive3() || props.strict)) {
    const workflowCheck = await checkWorkflowConflicts(config, accountId, name2);
    if (workflowCheck.hasConflicts) {
      logger.warn(workflowCheck.message);
      if (!await deployConfirm("Do you want to continue?")) {
        return { versionId, workerTag };
      }
    }
  }
  const compatibilityDate = props.compatibilityDate ?? config.compatibility_date;
  const compatibilityFlags = props.compatibilityFlags ?? config.compatibility_flags;
  if (!compatibilityDate) {
    const compatibilityDateStr = getTodaysCompatDate();
    throw new UserError(
      `A compatibility_date is required when publishing. Add the following to your ${configFileName(config.configPath)} file:
    \`\`\`
    ${formatConfigSnippet({ compatibility_date: compatibilityDateStr }, config.configPath, false)}
    \`\`\`
    Or you could pass it in your terminal as \`--compatibility-date ${compatibilityDateStr}\`
See https://developers.cloudflare.com/workers/platform/compatibility-dates for more information.`,
      { telemetryMessage: "missing compatibility date when deploying" }
    );
  }
  validateRoutes3(allDeploymentRoutes, props.assetsOptions);
  const jsxFactory = props.jsxFactory || config.jsx_factory;
  const jsxFragment = props.jsxFragment || config.jsx_fragment;
  const keepVars = props.keepVars || config.keep_vars;
  const minify = props.minify ?? config.minify;
  const nodejsCompatMode = validateNodeCompatMode(
    compatibilityDate,
    compatibilityFlags,
    {
      noBundle: props.noBundle ?? config.no_bundle
    }
  );
  if (props.noBundle && minify) {
    logger.warn(
      "`--minify` and `--no-bundle` can't be used together. If you want to minify your Worker and disable Wrangler's bundling, please minify as part of your own bundling process."
    );
  }
  const scriptName = props.name;
  assert53__default.default(
    !config.site || config.site.bucket,
    "A [site] definition requires a `bucket` field with a path to the site's assets directory."
  );
  if (props.outDir) {
    fs29.mkdirSync(props.outDir, { recursive: true });
    const readmePath = path3__namespace.default.join(props.outDir, "README.md");
    fs29.writeFileSync(
      readmePath,
      `This folder contains the built output assets for the worker "${scriptName}" generated at ${(/* @__PURE__ */ new Date()).toISOString()}.`
    );
  }
  const destination = props.outDir ?? getWranglerTmpDir(props.projectRoot, "deploy");
  const envName = props.env ?? "production";
  const start = Date.now();
  const useServiceEnvironments2 = Boolean(
    props.useServiceEnvironments && props.env
  );
  const workerName = useServiceEnvironments2 ? `${scriptName} (${envName})` : scriptName;
  const workerUrl = props.dispatchNamespace ? `/accounts/${accountId}/workers/dispatch/namespaces/${props.dispatchNamespace}/scripts/${scriptName}` : useServiceEnvironments2 ? `/accounts/${accountId}/workers/services/${scriptName}/environments/${envName}` : `/accounts/${accountId}/workers/scripts/${scriptName}`;
  const { format: format11 } = props.entry;
  if (!props.dispatchNamespace && !useServiceEnvironments2 && accountId && scriptName) {
    const yes = await confirmLatestDeploymentOverwrite(
      config,
      accountId,
      scriptName
    );
    if (!yes) {
      cancel("Aborting deploy...");
      return { versionId, workerTag };
    }
  }
  if (!props.isWorkersSite && Boolean(props.legacyAssetPaths) && format11 === "service-worker") {
    throw new UserError(
      "You cannot use the service-worker format with an `assets` directory yet. For information on how to migrate to the module-worker format, see: https://developers.cloudflare.com/workers/learning/migrating-to-module-workers/",
      { telemetryMessage: true }
    );
  }
  if (config.wasm_modules && format11 === "modules") {
    throw new UserError(
      "You cannot configure [wasm_modules] with an ES module worker. Instead, import the .wasm module directly in your code",
      { telemetryMessage: true }
    );
  }
  if (config.text_blobs && format11 === "modules") {
    throw new UserError(
      `You cannot configure [text_blobs] with an ES module worker. Instead, import the file directly in your code, and optionally configure \`[rules]\` in your ${configFileName(config.configPath)} file`,
      { telemetryMessage: "[text_blobs] with an ES module worker" }
    );
  }
  if (config.data_blobs && format11 === "modules") {
    throw new UserError(
      `You cannot configure [data_blobs] with an ES module worker. Instead, import the file directly in your code, and optionally configure \`[rules]\` in your ${configFileName(config.configPath)} file`,
      { telemetryMessage: "[data_blobs] with an ES module worker" }
    );
  }
  let sourceMapSize;
  const normalisedContainerConfig = await getNormalizedContainerOptions(
    config,
    props
  );
  try {
    if (props.noBundle) {
      const destinationDir = typeof destination === "string" ? destination : destination.path;
      fs29.mkdirSync(destinationDir, { recursive: true });
      fs29.writeFileSync(
        path3__namespace.default.join(destinationDir, path3__namespace.default.basename(props.entry.file)),
        fs29.readFileSync(props.entry.file, "utf-8")
      );
    }
    const entryDirectory = path3__namespace.default.dirname(props.entry.file);
    const moduleCollector = createModuleCollector({
      wrangler1xLegacyModuleReferences: getWrangler1xLegacyModuleReferences(
        entryDirectory,
        props.entry.file
      ),
      entry: props.entry,
      // `moduleCollector` doesn't get used when `props.noBundle` is set, so
      // `findAdditionalModules` always defaults to `false`
      findAdditionalModules: config.find_additional_modules ?? false,
      rules: props.rules,
      preserveFileNames: config.preserve_file_names ?? false
    });
    const uploadSourceMaps = props.uploadSourceMaps ?? config.upload_source_maps;
    const {
      modules,
      dependencies,
      resolvedEntryPointPath,
      bundleType,
      ...bundle
    } = props.noBundle ? await noBundleWorker(
      props.entry,
      props.rules,
      props.outDir,
      config.python_modules.exclude
    ) : await bundleWorker(
      props.entry,
      typeof destination === "string" ? destination : destination.path,
      {
        metafile: props.metafile,
        bundle: true,
        additionalModules: [],
        moduleCollector,
        doBindings: config.durable_objects.bindings,
        workflowBindings: config.workflows ?? [],
        jsxFactory,
        jsxFragment,
        tsconfig: props.tsconfig ?? config.tsconfig,
        minify,
        keepNames: config.keep_names ?? true,
        sourcemap: uploadSourceMaps,
        nodejsCompatMode,
        compatibilityDate,
        compatibilityFlags,
        define: { ...config.define, ...props.defines },
        checkFetch: false,
        alias: config.alias,
        // We want to know if the build is for development or publishing
        // This could potentially cause issues as we no longer have identical behaviour between dev and deploy?
        targetConsumer: "deploy",
        local: false,
        projectRoot: props.projectRoot,
        defineNavigatorUserAgent: isNavigatorDefined(
          compatibilityDate,
          compatibilityFlags
        ),
        plugins: [logBuildOutput(nodejsCompatMode)],
        // Pages specific options used by wrangler pages commands
        entryName: void 0,
        inject: void 0,
        isOutfile: void 0,
        external: void 0,
        // These options are dev-only
        testScheduled: void 0,
        watch: void 0
      }
    );
    for (const module2 of modules) {
      const modulePath = module2.filePath === void 0 ? module2.name : path3__namespace.default.relative("", module2.filePath);
      const bytesInOutput = typeof module2.content === "string" ? Buffer.byteLength(module2.content) : module2.content.byteLength;
      dependencies[modulePath] = { bytesInOutput };
    }
    const content = fs29.readFileSync(resolvedEntryPointPath, {
      encoding: "utf-8"
    });
    const migrations = !props.dryRun ? await getMigrationsToUpload(scriptName, {
      accountId,
      config,
      useServiceEnvironments: props.useServiceEnvironments,
      env: props.env,
      dispatchNamespace: props.dispatchNamespace
    }) : void 0;
    const assetsJwt = props.assetsOptions && !props.dryRun ? await syncAssets(
      config,
      accountId,
      props.assetsOptions.directory,
      scriptName,
      props.dispatchNamespace
    ) : void 0;
    if (props.assetsOptions && props.dryRun) {
      await buildAssetManifest(props.assetsOptions.directory);
    }
    const workersSitesAssets = await syncWorkersSite(
      config,
      accountId,
      // When we're using the newer service environments, we wouldn't
      // have added the env name on to the script name. However, we must
      // include it in the kv namespace name regardless (since there's no
      // concept of service environments for kv namespaces yet).
      scriptName + (useServiceEnvironments2 ? `-${props.env}` : ""),
      props.legacyAssetPaths,
      false,
      props.dryRun,
      props.oldAssetTtl
    );
    const bindings = getBindings(config);
    for (const [bindingName, value] of Object.entries(props.vars ?? {})) {
      bindings[bindingName] = {
        type: "plain_text",
        value,
        hidden: true
      };
    }
    if (props.secretsFile) {
      const secretsResult = await parseBulkInputToObject(props.secretsFile);
      if (secretsResult) {
        for (const [secretName, secretValue] of Object.entries(
          secretsResult.content
        )) {
          bindings[secretName] = {
            type: "secret_text",
            value: secretValue
          };
        }
      }
    }
    addRequiredSecretsInheritBindings(config, bindings, {
      type: "deploy",
      workerExists
    });
    if (workersSitesAssets.manifest) {
      modules.push({
        name: "__STATIC_CONTENT_MANIFEST",
        filePath: void 0,
        content: JSON.stringify(workersSitesAssets.manifest),
        type: "text"
      });
    }
    const placement = parseConfigPlacement(config);
    const entryPointName = path3__namespace.default.basename(resolvedEntryPointPath);
    const main2 = {
      name: entryPointName,
      filePath: resolvedEntryPointPath,
      content,
      type: bundleType
    };
    const worker = {
      name: scriptName,
      main: main2,
      migrations,
      modules,
      containers: config.containers,
      sourceMaps: uploadSourceMaps ? loadSourceMaps(main2, modules, bundle) : void 0,
      compatibility_date: compatibilityDate,
      compatibility_flags: compatibilityFlags,
      keepVars,
      keepSecrets: keepVars || !!props.secretsFile,
      logpush: props.logpush !== void 0 ? props.logpush : config.logpush,
      placement,
      tail_consumers: config.tail_consumers,
      streaming_tail_consumers: config.streaming_tail_consumers,
      limits: config.limits,
      annotations: props.tag || props.message ? {
        "workers/message": props.message,
        "workers/tag": props.tag
      } : void 0,
      assets: props.assetsOptions && assetsJwt ? {
        jwt: assetsJwt,
        routerConfig: props.assetsOptions.routerConfig,
        assetConfig: props.assetsOptions.assetConfig,
        _redirects: props.assetsOptions._redirects,
        _headers: props.assetsOptions._headers,
        run_worker_first: props.assetsOptions.run_worker_first
      } : void 0,
      observability: config.observability,
      cache: config.cache
    };
    sourceMapSize = worker.sourceMaps?.reduce(
      (acc, m7) => acc + m7.content.length,
      0
    );
    await printBundleSize(
      { name: path3__namespace.default.basename(resolvedEntryPointPath), content },
      modules
    );
    const canUseNewVersionsDeploymentsApi = workerExists && props.dispatchNamespace === void 0 && !useServiceEnvironments2 && format11 === "modules" && migrations === void 0 && !config.first_party_worker && config.containers === void 0;
    let workerBundle;
    const dockerPath = getDockerPath();
    if (normalisedContainerConfig.length) {
      const hasDockerfiles = normalisedContainerConfig.some(
        (container) => "dockerfile" in container
      );
      if (hasDockerfiles) {
        await verifyDockerInstalled(dockerPath, false);
      }
    }
    if (props.dryRun) {
      if (normalisedContainerConfig.length) {
        for (const container of normalisedContainerConfig) {
          if ("dockerfile" in container) {
            await buildContainer(
              container,
              workerTag ?? "worker-tag",
              props.dryRun,
              dockerPath
            );
          }
        }
      }
      workerBundle = createWorkerUploadForm(
        worker,
        addWorkersSitesBindings(
          bindings ?? {},
          workersSitesAssets.namespace,
          workersSitesAssets.manifest,
          format11
        ),
        {
          dryRun: true,
          unsafe: config.unsafe
        }
      );
      printBindings(
        bindings,
        config.tail_consumers,
        config.streaming_tail_consumers,
        config.containers,
        { warnIfNoBindings: true, unsafeMetadata: config.unsafe?.metadata }
      );
    } else {
      assert53__default.default(accountId, "Missing accountId");
      if (getFlag("RESOURCES_PROVISION")) {
        await provisionBindings(
          bindings ?? {},
          accountId,
          scriptName,
          props.experimentalAutoCreate,
          props.config
        );
      }
      workerBundle = createWorkerUploadForm(
        worker,
        addWorkersSitesBindings(
          bindings ?? {},
          workersSitesAssets.namespace,
          workersSitesAssets.manifest,
          format11
        ),
        {
          unsafe: config.unsafe
        }
      );
      await ensureQueuesExistByConfig(config);
      let bindingsPrinted = false;
      try {
        let result;
        if (canUseNewVersionsDeploymentsApi) {
          const versionResult = await retryOnAPIFailure(
            async () => fetchResult(
              config,
              `/accounts/${accountId}/workers/scripts/${scriptName}/versions`,
              {
                method: "POST",
                body: workerBundle,
                headers: await getMetricsUsageHeaders(config.send_metrics)
              },
              new Url.URLSearchParams({ bindings_inherit: "strict" })
            )
          );
          const versionMap = /* @__PURE__ */ new Map();
          versionMap.set(versionResult.id, 100);
          await createDeployment(
            props.config,
            accountId,
            scriptName,
            versionMap,
            props.message
          );
          const nextTags = applyServiceAndEnvironmentTags(config, tags);
          try {
            await patchNonVersionedScriptSettings(
              props.config,
              accountId,
              scriptName,
              {
                tail_consumers: worker.tail_consumers,
                logpush: worker.logpush,
                // If the user hasn't specified observability assume that they want it disabled if they have it on.
                // This is a no-op in the event that they don't have observability enabled, but will remove observability
                // if it has been removed from their Wrangler configuration file
                observability: worker.observability ?? { enabled: false },
                tags: nextTags
              }
            );
          } catch {
            warnOnErrorUpdatingServiceAndEnvironmentTags();
          }
          result = {
            id: null,
            // fpw - ignore
            etag: versionResult.resources.script.etag,
            pipeline_hash: null,
            // fpw - ignore
            mutable_pipeline_id: null,
            // fpw - ignore
            deployment_id: versionResult.id,
            // version id not deployment id but easier to adapt here
            startup_time_ms: versionResult.startup_time_ms
          };
        } else {
          result = await retryOnAPIFailure(
            async () => fetchResult(
              config,
              workerUrl,
              {
                method: "PUT",
                body: workerBundle,
                headers: await getMetricsUsageHeaders(config.send_metrics)
              },
              new Url.URLSearchParams({
                // pass excludeScript so the whole body of the
                // script doesn't get included in the response
                excludeScript: "true",
                bindings_inherit: "strict"
              })
            )
          );
          const nextTags = applyServiceAndEnvironmentTags(config, tags);
          if (!tagsAreEqual(tags, nextTags)) {
            try {
              await patchNonVersionedScriptSettings(
                props.config,
                accountId,
                scriptName,
                {
                  tags: nextTags
                }
              );
            } catch {
              warnOnErrorUpdatingServiceAndEnvironmentTags();
            }
          }
        }
        if (result.startup_time_ms) {
          logger.log("Worker Startup Time:", result.startup_time_ms, "ms");
        }
        bindingsPrinted = true;
        printBindings(
          bindings,
          config.tail_consumers,
          config.streaming_tail_consumers,
          config.containers,
          { unsafeMetadata: config.unsafe?.metadata }
        );
        versionId = parseNonHyphenedUuid(result.deployment_id);
        if (config.first_party_worker) {
          if (result.id) {
            logger.log("Worker ID: ", result.id);
          }
          if (result.etag) {
            logger.log("Worker ETag: ", result.etag);
          }
          if (result.pipeline_hash) {
            logger.log("Worker PipelineHash: ", result.pipeline_hash);
          }
          if (result.mutable_pipeline_id) {
            logger.log(
              "Worker Mutable PipelineID (Development ONLY!):",
              result.mutable_pipeline_id
            );
          }
        }
      } catch (err) {
        if (!bindingsPrinted) {
          printBindings(
            bindings,
            config.tail_consumers,
            config.streaming_tail_consumers,
            config.containers,
            { unsafeMetadata: config.unsafe?.metadata }
          );
        }
        const message = await helpIfErrorIsSizeOrScriptStartup(
          err,
          dependencies,
          workerBundle,
          props.projectRoot
        );
        if (message !== null) {
          logger.error(message);
        }
        handleMissingSecretsError(err, config, {
          type: "deploy",
          workerExists
        });
        if (err instanceof APIError && "code" in err && err.code === 10021 && err.notes.length > 0) {
          err.preventReport();
          if (err.notes[0].text === "binding DB of type d1 must have a valid `id` specified [code: 10021]") {
            throw new UserError(
              "You must use a real database in the database_id configuration. You can find your databases using 'wrangler d1 list', or read how to develop locally with D1 here: https://developers.cloudflare.com/d1/configuration/local-development",
              { telemetryMessage: true }
            );
          }
          const maybeNameToFilePath = /* @__PURE__ */ __name((moduleName) => {
            if (bundleType === "commonjs") {
              return resolvedEntryPointPath;
            }
            if (moduleName === entryPointName) {
              return resolvedEntryPointPath;
            }
            for (const module2 of modules) {
              if (moduleName === module2.name) {
                return module2.filePath;
              }
            }
          }, "maybeNameToFilePath");
          const retrieveSourceMap = /* @__PURE__ */ __name((moduleName) => maybeRetrieveFileSourceMap(maybeNameToFilePath(moduleName)), "retrieveSourceMap");
          err.notes[0].text = getSourceMappedString(
            err.notes[0].text,
            retrieveSourceMap
          );
        }
        throw err;
      }
    }
    if (props.outFile) {
      fs29.mkdirSync(path3__namespace.default.dirname(props.outFile), { recursive: true });
      const serializedFormData = await new import_undici26.Response(workerBundle).arrayBuffer();
      fs29.writeFileSync(props.outFile, Buffer.from(serializedFormData));
    }
  } finally {
    if (typeof destination !== "string") {
      destination.remove();
    }
  }
  if (props.dryRun) {
    logger.log(`--dry-run: exiting now.`);
    return { versionId, workerTag };
  }
  const uploadMs = Date.now() - start;
  logger.log("Uploaded", workerName, formatTime2(uploadMs));
  if (props.dispatchNamespace !== void 0) {
    deployWfpUserWorker(props.dispatchNamespace, versionId);
    return { versionId, workerTag };
  }
  if (normalisedContainerConfig.length) {
    assert53__default.default(versionId && accountId);
    await deployContainers(config, normalisedContainerConfig, {
      versionId,
      accountId,
      scriptName
    });
  }
  const targets = await triggersDeploy({
    ...props,
    firstDeploy: !workerExists,
    routes: allDeploymentRoutes
  });
  logger.log("Current Version ID:", versionId);
  return {
    sourceMapSize,
    versionId,
    workerTag,
    targets: targets ?? []
  };
}
function deployWfpUserWorker(dispatchNamespace, versionId) {
  logger.log("  Dispatch Namespace:", dispatchNamespace);
  logger.log("Current Version ID:", versionId);
}
function formatTime2(duration) {
  return `(${(duration / 1e3).toFixed(2)} sec)`;
}
async function publishRoutes(complianceConfig, routes, {
  workerUrl,
  scriptName,
  useServiceEnvironments: useServiceEnvironments2,
  accountId
}) {
  try {
    return await fetchResult(complianceConfig, `${workerUrl}/routes`, {
      // Note: PUT will delete previous routes on this script.
      method: "PUT",
      body: JSON.stringify(
        routes.map(
          (route) => typeof route !== "object" ? { pattern: route } : route
        )
      ),
      headers: {
        "Content-Type": "application/json"
      }
    });
  } catch (e10) {
    if (isAuthenticationError(e10)) {
      return await publishRoutesFallback(complianceConfig, routes, {
        scriptName,
        useServiceEnvironments: useServiceEnvironments2,
        accountId
      });
    } else {
      throw e10;
    }
  }
}
async function publishRoutesFallback(complianceConfig, routes, {
  scriptName,
  useServiceEnvironments: useServiceEnvironments2,
  accountId
}) {
  if (useServiceEnvironments2) {
    throw new UserError(
      "Service environments combined with an API token that doesn't have 'All Zones' permissions is not supported.\nEither turn off service environments by setting `legacy_env = true`, creating an API token with 'All Zones' permissions, or logging in via OAuth",
      { telemetryMessage: true }
    );
  }
  logger.info(
    "The current authentication token does not have 'All Zones' permissions.\nFalling back to using the zone-based API endpoint to update each route individually.\nNote that there is no access to routes associated with zones that the API token does not have permission for.\nExisting routes for this Worker in such zones will not be deleted."
  );
  const deployedRoutes = [];
  const queue = new PQueue({ concurrency: 10 });
  const queuePromises = [];
  const zoneIdCache = /* @__PURE__ */ new Map();
  const activeZones = /* @__PURE__ */ new Map();
  const routesToDeploy = /* @__PURE__ */ new Map();
  for (const route of routes) {
    queuePromises.push(
      queue.add(async () => {
        const zone = await getZoneForRoute(
          complianceConfig,
          { route, accountId },
          zoneIdCache
        );
        if (zone) {
          activeZones.set(zone.id, zone.host);
          routesToDeploy.set(
            typeof route === "string" ? route : route.pattern,
            zone.id
          );
        }
      })
    );
  }
  await Promise.all(queuePromises.splice(0, queuePromises.length));
  const allRoutes = /* @__PURE__ */ new Map();
  const alreadyDeployedRoutes = /* @__PURE__ */ new Set();
  for (const [zone, host] of activeZones) {
    queuePromises.push(
      queue.add(async () => {
        try {
          for (const { pattern, script } of await fetchListResult(complianceConfig, `/zones/${zone}/workers/routes`)) {
            allRoutes.set(pattern, script);
            if (script === scriptName) {
              alreadyDeployedRoutes.add(pattern);
            }
          }
        } catch (e10) {
          if (isAuthenticationError(e10)) {
            e10.notes.push({
              text: `This could be because the API token being used does not have permission to access the zone "${host}" (${zone}).`
            });
          }
          throw e10;
        }
      })
    );
  }
  await Promise.all(queuePromises);
  for (const [routePattern, zoneId] of routesToDeploy.entries()) {
    if (allRoutes.has(routePattern)) {
      const knownScript = allRoutes.get(routePattern);
      if (knownScript === scriptName) {
        alreadyDeployedRoutes.delete(routePattern);
        continue;
      } else {
        throw new UserError(
          `The route with pattern "${routePattern}" is already associated with another worker called "${knownScript}".`,
          { telemetryMessage: "route already associated with another worker" }
        );
      }
    }
    const { pattern } = await fetchResult(
      complianceConfig,
      `/zones/${zoneId}/workers/routes`,
      {
        method: "POST",
        body: JSON.stringify({
          pattern: routePattern,
          script: scriptName
        }),
        headers: {
          "Content-Type": "application/json"
        }
      }
    );
    deployedRoutes.push(pattern);
  }
  if (alreadyDeployedRoutes.size) {
    logger.warn(
      "Previously deployed routes:\nThe following routes were already associated with this worker, and have not been deleted:\n" + [...alreadyDeployedRoutes.values()].map((route) => ` - "${route}"
`) + "If these routes are not wanted then you can remove them in the dashboard."
    );
  }
  return deployedRoutes;
}
async function updateQueueConsumers(scriptName, config) {
  const consumers = config.queues.consumers || [];
  const updateConsumers = [];
  for (const consumer of consumers) {
    const queue = await getQueue(config, consumer.queue);
    if (scriptName === void 0) {
      throw new UserError("Script name is required to update queue consumers", {
        telemetryMessage: true
      });
    }
    const body = {
      type: "worker",
      dead_letter_queue: consumer.dead_letter_queue,
      script_name: scriptName,
      settings: {
        batch_size: consumer.max_batch_size,
        max_retries: consumer.max_retries,
        max_wait_time_ms: consumer.max_batch_timeout !== void 0 ? 1e3 * consumer.max_batch_timeout : void 0,
        max_concurrency: consumer.max_concurrency,
        retry_delay: consumer.retry_delay
      }
    };
    const existingConsumer = queue.consumers.filter(
      (c8) => c8.script === scriptName || c8.service === scriptName
    ).length > 0;
    const envName = void 0;
    if (existingConsumer) {
      updateConsumers.push(
        putConsumer(config, consumer.queue, scriptName, envName, body).then(
          () => [`Consumer for ${consumer.queue}`]
        )
      );
      continue;
    }
    updateConsumers.push(
      postConsumer(config, consumer.queue, body).then(() => [
        `Consumer for ${consumer.queue}`
      ])
    );
  }
  return updateConsumers;
}
function getDeployConfirmFunction(strictMode = false) {
  const nonInteractive = isNonInteractiveOrCI();
  if (nonInteractive && strictMode) {
    return async () => {
      logger.error(
        "Aborting the deployment operation because of conflicts. To override and deploy anyway remove the `--strict` flag"
      );
      process.exitCode = 1;
      return false;
    };
  }
  return confirm;
}
var import_undici26, validateRoutes3;
var init_deploy7 = __esm({
  "src/deploy/deploy.ts"() {
    init_import_meta_url();
    init_cli();
    init_containers_shared();
    init_dist();
    init_dist6();
    import_undici26 = __toESM(require_undici());
    init_assets5();
    init_cfetch();
    init_build3();
    init_config5();
    init_deploy();
    init_handle_errors();
    init_bindings2();
    init_bundle();
    init_bundle_reporter();
    init_create_worker_upload_form();
    init_log_build_output();
    init_module_collection();
    init_no_bundle_worker();
    init_node_compat();
    init_secrets_validation();
    init_source_maps();
    init_dialogs();
    init_durable();
    init_environments();
    init_experimental_flags();
    init_is_interactive();
    init_logger();
    init_metrics();
    init_navigator_user_agent();
    init_paths();
    init_client11();
    init_secret();
    init_sites2();
    init_sourcemap();
    init_deploy5();
    init_download_worker_config();
    init_friendly_validator_errors();
    init_placement();
    init_print_bindings();
    init_retry();
    init_worker_not_found_error();
    init_api();
    init_deploy6();
    init_zones3();
    init_check_remote_secrets_override();
    init_check_workflow_conflicts();
    init_config_diffs();
    validateRoutes3 = /* @__PURE__ */ __name((routes, assets) => {
      const invalidRoutes = {};
      const mountedAssetRoutes = [];
      for (const route of routes) {
        if (typeof route !== "string" && route.custom_domain) {
          if (route.pattern.includes("*")) {
            invalidRoutes[route.pattern] ??= [];
            invalidRoutes[route.pattern].push(
              `Wildcard operators (*) are not allowed in Custom Domains`
            );
          }
          if (route.pattern.includes("/")) {
            invalidRoutes[route.pattern] ??= [];
            invalidRoutes[route.pattern].push(
              `Paths are not allowed in Custom Domains`
            );
          }
        } else if (
          // If we have Assets but we're not always hitting the Worker then validate
          assets?.directory !== void 0 && assets.routerConfig.invoke_user_worker_ahead_of_assets !== true
        ) {
          const pattern = typeof route === "string" ? route : route.pattern;
          const components = pattern.split("/");
          if (!(components.length === 2 && components[1] === "*")) {
            mountedAssetRoutes.push(pattern);
          }
        }
      }
      if (Object.keys(invalidRoutes).length > 0) {
        throw new UserError(
          `Invalid Routes:
` + Object.entries(invalidRoutes).map(([route, errors]) => `${route}:
` + errors.join("\n")).join(`

`)
        );
      }
      if (mountedAssetRoutes.length > 0 && assets?.directory !== void 0) {
        const relativeAssetsDir = path3__namespace.default.relative(process.cwd(), assets.directory);
        logger.once.warn(
          `Warning: The following routes will attempt to serve Assets on a configured path:
${mountedAssetRoutes.map((route) => {
            const routeNoScheme = route.replace(/https?:\/\//g, "");
            const assetPath = path3__namespace.default.join(
              relativeAssetsDir,
              routeNoScheme.substring(routeNoScheme.indexOf("/"))
            );
            return `  \u2022 ${route} (Will match assets: ${assetPath})`;
          }).join("\n")}` + (assets?.routerConfig.has_user_worker ? "\n\nRequests not matching an asset will be forwarded to the Worker's code." : "")
        );
      }
    }, "validateRoutes");
    __name(renderRoute, "renderRoute");
    __name(publishCustomDomains, "publishCustomDomains");
    __name(addWorkersSitesBindings, "addWorkersSitesBindings");
    __name(deploy, "deploy");
    __name(deployWfpUserWorker, "deployWfpUserWorker");
    __name(formatTime2, "formatTime");
    __name(publishRoutes, "publishRoutes");
    __name(publishRoutesFallback, "publishRoutesFallback");
    __name(updateQueueConsumers, "updateQueueConsumers");
    __name(getDeployConfirmFunction, "getDeployConfirmFunction");
  }
});
function logAssetUpload(line, diffCount) {
  const level = logger.loggerLevel;
  if (LOGGER_LEVELS[level] >= LOGGER_LEVELS.debug) {
    logger.debug(line);
  } else if (diffCount < MAX_DIFF_LINES2) {
    logger.info(line);
  } else if (diffCount === MAX_DIFF_LINES2) {
    const msg = "   (truncating changed assets log, set `WRANGLER_LOG=debug` environment variable to see full diff)";
    logger.info(source_default.dim(msg));
  }
  return ++diffCount;
}
function logAssetsUploadStatus(numberFilesToUpload, uploadedAssetsCount, uploadedAssetFiles) {
  logger.info(
    `Uploaded ${uploadedAssetsCount} of ${numberFilesToUpload} asset${numberFilesToUpload === 1 ? "" : "s"}`
  );
  uploadedAssetFiles.forEach((file3) => logger.debug(`\u2728 ${file3}`));
}
function logReadFilesFromDirectory(directory, assetFiles) {
  logger.info(
    `\u2728 Read ${assetFiles.length} file${assetFiles.length === 1 ? "" : "s"} from the assets directory ${directory}`
  );
  assetFiles.forEach((file3) => logger.debug(`/${file3}`));
}
function getAssetsBasePath(config, assetsCommandLineArg) {
  return assetsCommandLineArg ? process.cwd() : path3__namespace.resolve(path3__namespace.dirname(config.configPath ?? "wrangler.toml"));
}
function getAssetsOptions(args, config, overrides) {
  if (!overrides && !config.assets && !args.assets) {
    return;
  }
  const assets = {
    ...config.assets,
    ...args.assets && { directory: args.assets },
    ...overrides
  };
  if (assets.directory === void 0) {
    throw new UserError(
      "The `assets` property in your configuration is missing the required `directory` property.",
      { telemetryMessage: true }
    );
  }
  if (assets.directory === "") {
    throw new UserError("`The assets directory cannot be an empty string.", {
      telemetryMessage: true
    });
  }
  const assetsBasePath = getAssetsBasePath(config, args.assets);
  const directory = path3__namespace.resolve(assetsBasePath, assets.directory);
  const directoryStat = fs29.statSync(directory, { throwIfNoEntry: false });
  const sourceOfTruthMessage = args.assets ? '"--assets" command line argument' : '"assets.directory" field in your configuration file';
  if (!directoryStat) {
    throw new NonExistentAssetsDirError(
      `The directory specified by the ${sourceOfTruthMessage} does not exist:
${directory}`,
      {
        telemetryMessage: `The assets directory specified does not exist`
      }
    );
  }
  if (!directoryStat.isDirectory()) {
    throw new NonDirectoryAssetsDirError(
      `The path specified by the ${sourceOfTruthMessage} doesn't point to a directory:
${directory}`,
      {
        telemetryMessage: `The assets directory path specified is not a directory`
      }
    );
  }
  const routerConfig = {
    has_user_worker: Boolean(args.script || config.main)
  };
  if (typeof config.assets?.run_worker_first === "boolean") {
    routerConfig.invoke_user_worker_ahead_of_assets = config.assets.run_worker_first;
  } else if (Array.isArray(config.assets?.run_worker_first)) {
    routerConfig.static_routing = parseStaticRouting(
      config.assets.run_worker_first
    );
  }
  if (routerConfig.invoke_user_worker_ahead_of_assets && !config?.assets?.binding) {
    logger.warn(
      "run_worker_first=true set without an assets binding\nSetting run_worker_first to true will always invoke your Worker script.\nTo fetch your assets from your Worker, please set the [assets.binding] key in your configuration file.\n\nRead more: https://developers.cloudflare.com/workers/static-assets/binding/#binding"
    );
  }
  if (!routerConfig.has_user_worker && (routerConfig.invoke_user_worker_ahead_of_assets === true || routerConfig.static_routing)) {
    throw new UserError(
      "Cannot set run_worker_first without a Worker script.\nPlease remove run_worker_first from your configuration file, or provide a Worker script in your configuration file (`main`).",
      { telemetryMessage: true }
    );
  }
  const _redirects = maybeGetFile(path3__namespace.join(directory, REDIRECTS_FILENAME));
  const _headers = maybeGetFile(path3__namespace.join(directory, HEADERS_FILENAME));
  const assetConfig = {
    html_handling: config.assets?.html_handling,
    not_found_handling: config.assets?.not_found_handling,
    // The _redirects and _headers files are parsed in Miniflare in dev and parsing is not required for deploy
    compatibility_date: config.compatibility_date,
    compatibility_flags: config.compatibility_flags
  };
  return {
    directory,
    binding: assets.binding,
    routerConfig,
    assetConfig,
    _redirects,
    _headers,
    // raw static routing rules for upload. routerConfig.static_routing contains the rules processed for dev.
    run_worker_first: config.assets?.run_worker_first
  };
}
function validateAssetsArgsAndConfig(args, config) {
  if ("legacy" in args ? args.assets && args.legacy.site : (args.assets || config?.assets) && (args.site || config?.site)) {
    throw new UserError(
      "Cannot use assets and Workers Sites in the same Worker.\nPlease remove either the `site` or `assets` field from your configuration file.",
      { telemetryMessage: true }
    );
  }
  const noOpEntrypoint = path3__namespace.resolve(
    getBasePath(),
    "templates/no-op-worker.js"
  );
  if ("legacy" in args ? args.entrypoint === noOpEntrypoint && args.assets?.binding : !(args.script || config?.main) && config?.assets?.binding) {
    throw new UserError(
      "Cannot use assets with a binding in an assets-only Worker.\nPlease remove the asset binding from your configuration file, or provide a Worker script in your configuration file (`main`).",
      { telemetryMessage: true }
    );
  }
  if (config?.placement?.mode === "smart" && config?.assets?.run_worker_first === true) {
    logger.warn(
      "Turning on Smart Placement in a Worker that is using assets and run_worker_first set to true means that your entire Worker could be moved to run closer to your data source, and all requests will go to that Worker before serving assets.\nThis could result in poor performance as round trip times could increase when serving assets.\n\nRead more: https://developers.cloudflare.com/workers/static-assets/binding/#smart-placement"
    );
  }
}
function errorOnLegacyPagesWorkerJSAsset(file3, hasAssetsIgnoreFile) {
  if (!hasAssetsIgnoreFile) {
    const workerJsType = file3 === WORKER_JS_FILENAME ? "file" : file3.startsWith(WORKER_JS_FILENAME) ? "directory" : null;
    if (workerJsType !== null) {
      throw new UserError(
        dedent3`
			Uploading a Pages ${WORKER_JS_FILENAME} ${workerJsType} as an asset.
			This could expose your private server-side code to the public Internet. Is this intended?
			If you do not want to upload this ${workerJsType}, either remove it or add an "${CF_ASSETS_IGNORE_FILENAME}" file, to the root of your asset directory, containing "${WORKER_JS_FILENAME}" to avoid uploading.
			If you do want to upload this ${workerJsType}, you can add an empty "${CF_ASSETS_IGNORE_FILENAME}" file, to the root of your asset directory, to hide this error.
		`,
        { telemetryMessage: true }
      );
    }
  }
}
var import_undici27, BULK_UPLOAD_CONCURRENCY2, MAX_UPLOAD_ATTEMPTS2, MAX_UPLOAD_GATEWAY_ERRORS2, MAX_DIFF_LINES2, syncAssets, buildAssetManifest, NonExistentAssetsDirError, NonDirectoryAssetsDirError, WORKER_JS_FILENAME;
var init_assets5 = __esm({
  "src/assets.ts"() {
    init_import_meta_url();
    init_parseStaticRouting();
    init_constants();
    init_helpers2();
    init_dist();
    init_source();
    init_dist6();
    init_pretty_bytes();
    import_undici27 = __toESM(require_undici());
    init_cfetch();
    init_deploy7();
    init_logger();
    init_hash();
    init_upload4();
    init_paths();
    init_dedent();
    BULK_UPLOAD_CONCURRENCY2 = 3;
    MAX_UPLOAD_ATTEMPTS2 = 5;
    MAX_UPLOAD_GATEWAY_ERRORS2 = 5;
    MAX_DIFF_LINES2 = 100;
    syncAssets = /* @__PURE__ */ __name(async (complianceConfig, accountId, assetDirectory, scriptName, dispatchNamespace) => {
      assert53__default.default(accountId, "Missing accountId");
      logger.info("\u{1F300} Building list of assets...");
      const manifest = await buildAssetManifest(assetDirectory);
      const url4 = dispatchNamespace ? `/accounts/${accountId}/workers/dispatch/namespaces/${dispatchNamespace}/scripts/${scriptName}/assets-upload-session` : `/accounts/${accountId}/workers/scripts/${scriptName}/assets-upload-session`;
      logger.info("\u{1F300} Starting asset upload...");
      const initializeAssetsResponse = await fetchResult(complianceConfig, url4, {
        headers: { "Content-Type": "application/json" },
        method: "POST",
        body: JSON.stringify({ manifest })
      });
      if (!initializeAssetsResponse) {
        throw new FatalError(
          "An unexpected response has been received from the Cloudflare API for assets upload. Please try again.",
          1,
          { telemetryMessage: true }
        );
      }
      if (initializeAssetsResponse.buckets.flat().length === 0) {
        if (!initializeAssetsResponse.jwt) {
          throw new FatalError(
            "Could not find assets information to attach to deployment. Please try again.",
            1,
            { telemetryMessage: true }
          );
        }
        logger.info(
          `No updated asset files to upload. Proceeding with deployment...`
        );
        return initializeAssetsResponse.jwt;
      }
      const numberFilesToUpload = initializeAssetsResponse.buckets.flat().length;
      logger.info(
        `\u{1F300} Found ${numberFilesToUpload} new or modified static asset${numberFilesToUpload > 1 ? "s" : ""} to upload. Proceeding with upload...`
      );
      const manifestLookup = Object.entries(manifest);
      let assetLogCount = 0;
      const assetBuckets = initializeAssetsResponse.buckets.map((bucket) => {
        return bucket.map((fileHash) => {
          const manifestEntry = manifestLookup.find(
            (file3) => file3[1].hash === fileHash
          );
          if (manifestEntry === void 0) {
            throw new FatalError(
              `A file was requested that does not appear to exist.`,
              1,
              {
                telemetryMessage: "A file was requested that does not appear to exist. (asset manifest upload)"
              }
            );
          }
          assetLogCount = logAssetUpload(`+ ${manifestEntry[0]}`, assetLogCount);
          return manifestEntry;
        });
      });
      const queue = new PQueue({ concurrency: BULK_UPLOAD_CONCURRENCY2 });
      const queuePromises = [];
      let attempts = 0;
      const start = Date.now();
      let completionJwt = "";
      let uploadedAssetsCount = 0;
      for (const [bucketIndex, bucket] of assetBuckets.entries()) {
        attempts = 0;
        let gatewayErrors = 0;
        const doUpload = /* @__PURE__ */ __name(async () => {
          const payload = new import_undici27.FormData();
          const uploadedFiles = [];
          for (const manifestEntry of bucket) {
            const absFilePath = path3__namespace.join(assetDirectory, manifestEntry[0]);
            uploadedFiles.push(manifestEntry[0]);
            payload.append(
              manifestEntry[1].hash,
              new File(
                [(await fs9.readFile(absFilePath)).toString("base64")],
                manifestEntry[1].hash,
                {
                  // Most formdata body encoders (incl. undici's) will override with "application/octet-stream" if you use a falsy value here
                  // Additionally, it appears that undici doesn't support non-standard main types (e.g. "null")
                  // So, to make it easier for any other clients, we'll just parse "application/null" on the API
                  // to mean actually null (signal to not send a Content-Type header with the response)
                  type: getContentType(absFilePath) ?? "application/null"
                }
              ),
              manifestEntry[1].hash
            );
          }
          try {
            const res = await fetchResult(
              complianceConfig,
              `/accounts/${accountId}/workers/assets/upload?base64=true`,
              {
                method: "POST",
                headers: {
                  Authorization: `Bearer ${initializeAssetsResponse.jwt}`
                },
                body: payload
              }
            );
            uploadedAssetsCount += bucket.length;
            logAssetsUploadStatus(
              numberFilesToUpload,
              uploadedAssetsCount,
              uploadedFiles
            );
            return res;
          } catch (e10) {
            if (attempts < MAX_UPLOAD_ATTEMPTS2) {
              logger.info(source_default.dim(`Asset upload failed. Retrying...
`, e10));
              await new Promise(
                (resolvePromise) => setTimeout(resolvePromise, Math.pow(2, attempts) * 1e3)
              );
              if (e10 instanceof APIError && e10.isGatewayError()) {
                queue.concurrency = 1;
                await new Promise(
                  (resolvePromise) => setTimeout(resolvePromise, Math.pow(2, gatewayErrors) * 5e3)
                );
                gatewayErrors++;
                if (gatewayErrors >= MAX_UPLOAD_GATEWAY_ERRORS2) {
                  attempts++;
                }
              } else {
                attempts++;
              }
              return doUpload();
            } else if (isJwtExpired(initializeAssetsResponse.jwt)) {
              throw new FatalError(
                `Upload took too long.
Asset upload took too long on bucket ${bucketIndex + 1}/${initializeAssetsResponse.buckets.length}. Please try again.
Assets already uploaded have been saved, so the next attempt will automatically resume from this point.`,
                void 0,
                { telemetryMessage: "Asset upload took too long" }
              );
            } else {
              throw e10;
            }
          }
        }, "doUpload");
        queuePromises.push(
          queue.add(
            () => doUpload().then((res) => {
              completionJwt = res.jwt || completionJwt;
            })
          )
        );
      }
      queue.on("error", (error2) => {
        logger.error(error2.message);
        throw error2;
      });
      await Promise.all(queuePromises);
      if (!completionJwt) {
        throw new FatalError(
          "Failed to complete asset upload. Please try again.",
          1,
          { telemetryMessage: true }
        );
      }
      const uploadMs = Date.now() - start;
      const skipped = Object.keys(manifest).length - numberFilesToUpload;
      const skippedMessage = skipped > 0 ? `(${skipped} already uploaded) ` : "";
      logger.log(
        `\u2728 Success! Uploaded ${numberFilesToUpload} file${numberFilesToUpload > 1 ? "s" : ""} ${skippedMessage}${formatTime2(uploadMs)}
`
      );
      return completionJwt;
    }, "syncAssets");
    buildAssetManifest = /* @__PURE__ */ __name(async (dir2) => {
      const files = await fs9.readdir(dir2, { recursive: true });
      logReadFilesFromDirectory(dir2, files);
      const manifest = {};
      const { assetsIgnoreFunction, assetsIgnoreFilePresent } = await createAssetsIgnoreFunction(dir2);
      await Promise.all(
        files.map(async (relativeFilepath) => {
          if (assetsIgnoreFunction(relativeFilepath)) {
            logger.debug("Ignoring asset:", relativeFilepath);
            return;
          }
          const filepath = path3__namespace.join(dir2, relativeFilepath);
          const filestat = await fs9.stat(filepath);
          if (filestat.isSymbolicLink() || filestat.isDirectory()) {
            return;
          } else {
            errorOnLegacyPagesWorkerJSAsset(
              relativeFilepath,
              assetsIgnoreFilePresent
            );
            if (filestat.size > MAX_ASSET_SIZE) {
              throw new UserError(
                `Asset too large.
Cloudflare Workers supports assets with sizes of up to ${prettyBytes(
                  MAX_ASSET_SIZE,
                  {
                    binary: true
                  }
                )}. We found a file ${filepath} with a size of ${prettyBytes(
                  filestat.size,
                  {
                    binary: true
                  }
                )}.
Ensure all assets in your assets directory "${dir2}" conform with the Workers maximum size requirement.`,
                { telemetryMessage: "Asset too large" }
              );
            }
            manifest[normalizeFilePath(relativeFilepath)] = {
              hash: hashFile(filepath),
              size: filestat.size
            };
          }
        })
      );
      return manifest;
    }, "buildAssetManifest");
    __name(logAssetUpload, "logAssetUpload");
    __name(logAssetsUploadStatus, "logAssetsUploadStatus");
    __name(logReadFilesFromDirectory, "logReadFilesFromDirectory");
    __name(getAssetsBasePath, "getAssetsBasePath");
    NonExistentAssetsDirError = class extends UserError {
      static {
        __name(this, "NonExistentAssetsDirError");
      }
    };
    NonDirectoryAssetsDirError = class extends UserError {
      static {
        __name(this, "NonDirectoryAssetsDirError");
      }
    };
    __name(getAssetsOptions, "getAssetsOptions");
    __name(validateAssetsArgsAndConfig, "validateAssetsArgsAndConfig");
    WORKER_JS_FILENAME = "_worker.js";
    __name(errorOnLegacyPagesWorkerJSAsset, "errorOnLegacyPagesWorkerJSAsset");
  }
});
async function getHostAndRoutes(args, config) {
  const host = args.host || config.dev.host;
  const routes = (args.routes || config.route && [config.route] || config.routes)?.map((r10) => {
    if (typeof r10 !== "object") {
      return r10;
    }
    if ("custom_domain" in r10 || "zone_id" in r10 || "zone_name" in r10) {
      return r10;
    } else {
      return r10.pattern;
    }
  });
  if (routes) {
    const assetOptions = getAssetsOptions({ assets: args.assets }, config);
    validateRoutes3(routes, assetOptions);
  }
  return { host, routes };
}
function getInferredHost(routes, configPath) {
  if (routes?.length) {
    const firstRoute = routes[0];
    const host = getHostFromRoute(firstRoute);
    if (host === void 0) {
      throw new UserError(
        `Cannot infer host from first route: ${JSON.stringify(
          firstRoute
        )}.
You can explicitly set the \`dev.host\` configuration in your ${configFileName(configPath)} file, for example:

	\`\`\`
	${formatConfigSnippet(
          {
            dev: {
              host: "example.com"
            }
          },
          configPath
        )}
	\`\`\`
`
      );
    }
    return host;
  }
}
function applyHyperdriveEnvVars(config, local) {
  for (const hyperdrive of config.hyperdrive ?? []) {
    const prefix = `CLOUDFLARE_HYPERDRIVE_LOCAL_CONNECTION_STRING_`;
    const deprecatedPrefix = `WRANGLER_HYPERDRIVE_LOCAL_CONNECTION_STRING_`;
    let varName = `${prefix}${hyperdrive.binding}`;
    let connectionStringFromEnv = process.env[varName];
    if (!connectionStringFromEnv) {
      varName = `${deprecatedPrefix}${hyperdrive.binding}`;
      connectionStringFromEnv = process.env[varName];
    }
    if (local && connectionStringFromEnv === void 0 && hyperdrive.localConnectionString === void 0) {
      throw new UserError(
        `When developing locally, you should use a local Postgres connection string to emulate Hyperdrive functionality. Please setup Postgres locally and set the value of the '${prefix}${hyperdrive.binding}' variable or "${hyperdrive.binding}"'s "localConnectionString" to the Postgres connection string.`,
        { telemetryMessage: "no local hyperdrive connection string" }
      );
    }
    if (connectionStringFromEnv) {
      if (varName.startsWith(deprecatedPrefix)) {
        logger.once.warn(
          `Using "${deprecatedPrefix}<BINDING_NAME>" environment variable. This is deprecated. Please use "${prefix}<BINDING_NAME>" instead.`
        );
      }
      logger.log(
        `Found a non-empty ${varName} variable for binding. Hyperdrive will connect to this database during local development.`
      );
      hyperdrive.localConnectionString = connectionStringFromEnv;
    }
  }
}
function getBindings2(configParam, env6, envFiles, local, inputBindings, defaultBindings) {
  applyHyperdriveEnvVars(configParam, local);
  const bindings = convertConfigToBindings(configParam, {
    usePreviewIds: true
  });
  const vars = getVarsForDev(
    configParam.userConfigPath,
    envFiles,
    configParam.vars,
    env6,
    false,
    configParam.secrets
  );
  for (const [name2, binding] of Object.entries(vars)) {
    const existingBinding = bindings[name2];
    if (!existingBinding || existingBinding.type === "plain_text" || existingBinding.type === "json" || existingBinding.type === "secret_text") {
      bindings[name2] = binding;
    }
  }
  return { ...defaultBindings, ...bindings, ...inputBindings };
}
function getAssetChangeMessage(eventName, assetPath) {
  let message = `${assetPath} changed`;
  switch (eventName) {
    case "add":
      message = `File ${assetPath} was added`;
      break;
    case "addDir":
      message = `Directory ${assetPath} was added`;
      break;
    case "unlink":
      message = `File ${assetPath} was removed`;
      break;
    case "unlinkDir":
      message = `Directory ${assetPath} was removed`;
      break;
  }
  return message;
}
var import_env2, dev;
var init_dev2 = __esm({
  "src/dev.ts"() {
    init_import_meta_url();
    init_dist();
    import_env2 = __toESM(require_dist2());
    init_utils2();
    init_assets5();
    init_create_command();
    init_deploy7();
    init_dev_vars();
    init_start_dev();
    init_logger();
    init_zones3();
    dev = createCommand({
      behaviour: {
        provideConfig: false,
        overrideExperimentalFlags: /* @__PURE__ */ __name((args) => ({
          MULTIWORKER: Array.isArray(args.config),
          RESOURCES_PROVISION: args.experimentalProvision ?? false,
          AUTOCREATE_RESOURCES: args.experimentalAutoCreate
        }), "overrideExperimentalFlags"),
        printMetricsBanner: true
      },
      metadata: {
        description: "\u{1F442} Start a local server for developing your Worker",
        owner: "Workers: Authoring and Testing",
        status: "stable",
        category: "Compute & AI"
      },
      positionalArgs: ["script"],
      args: {
        script: {
          describe: "The path to an entry point for your Worker",
          type: "string"
        },
        name: {
          describe: "Name of the Worker",
          type: "string",
          requiresArg: true
        },
        "compatibility-date": {
          describe: "Date to use for compatibility checks",
          type: "string",
          requiresArg: true
        },
        "compatibility-flags": {
          describe: "Flags to use for compatibility checks",
          alias: "compatibility-flag",
          type: "string",
          requiresArg: true,
          array: true
        },
        latest: {
          describe: "Use the latest version of the Workers runtime",
          type: "boolean",
          default: true
        },
        assets: {
          describe: "Static assets to be served. Replaces Workers Sites.",
          type: "string",
          requiresArg: true
        },
        // We want to have a --no-bundle flag, but yargs requires that
        // we also have a --bundle flag (that it adds the --no to by itself)
        // So we make a --bundle flag, but hide it, and then add a --no-bundle flag
        // that's visible to the user but doesn't "do" anything.
        bundle: {
          describe: "Run wrangler's compilation step before publishing",
          type: "boolean",
          hidden: true
        },
        "no-bundle": {
          describe: "Skip internal build steps and directly deploy script",
          type: "boolean",
          default: false
        },
        ip: {
          describe: "IP address to listen on",
          type: "string"
        },
        port: {
          describe: "Port to listen on",
          type: "number"
        },
        "inspector-port": {
          describe: "Port for devtools to connect to",
          type: "number"
        },
        "inspector-ip": {
          describe: "IP address for devtools to connect to",
          type: "string"
        },
        routes: {
          describe: "Routes to upload",
          alias: "route",
          type: "string",
          requiresArg: true,
          array: true
        },
        host: {
          type: "string",
          requiresArg: true,
          describe: "Host to forward requests to, defaults to the zone of project"
        },
        "local-protocol": {
          describe: "Protocol to listen to requests on, defaults to http.",
          choices: ["http", "https"]
        },
        "https-key-path": {
          describe: "Path to a custom certificate key",
          type: "string",
          requiresArg: true
        },
        "https-cert-path": {
          describe: "Path to a custom certificate",
          type: "string",
          requiresArg: true
        },
        "local-upstream": {
          type: "string",
          describe: "Host to act as origin in local mode, defaults to dev.host or route"
        },
        "enable-containers": {
          type: "boolean",
          describe: "Whether to build and enable containers during development",
          hidden: true
        },
        site: {
          describe: "Root folder of static assets for Workers Sites",
          type: "string",
          requiresArg: true,
          hidden: true,
          deprecated: true
        },
        "site-include": {
          describe: "Array of .gitignore-style patterns that match file or directory names from the sites directory. Only matched items will be uploaded.",
          type: "string",
          requiresArg: true,
          array: true,
          hidden: true,
          deprecated: true
        },
        "site-exclude": {
          describe: "Array of .gitignore-style patterns that match file or directory names from the sites directory. Matched items will not be uploaded.",
          type: "string",
          requiresArg: true,
          array: true,
          hidden: true,
          deprecated: true
        },
        "upstream-protocol": {
          describe: "Protocol to forward requests to host on, defaults to https.",
          choices: ["http", "https"]
        },
        var: {
          describe: "A key-value pair to be injected into the script as a variable",
          type: "string",
          requiresArg: true,
          array: true
        },
        define: {
          describe: "A key-value pair to be substituted in the script",
          type: "string",
          requiresArg: true,
          array: true
        },
        alias: {
          describe: "A module pair to be substituted in the script",
          type: "string",
          requiresArg: true,
          array: true
        },
        "jsx-factory": {
          describe: "The function that is called for each JSX element",
          type: "string",
          requiresArg: true
        },
        "jsx-fragment": {
          describe: "The function that is called for each JSX fragment",
          type: "string",
          requiresArg: true
        },
        tsconfig: {
          describe: "Path to a custom tsconfig.json file",
          type: "string",
          requiresArg: true
        },
        remote: {
          alias: "r",
          describe: "Run on the global Cloudflare network with access to production resources",
          type: "boolean",
          default: false
        },
        local: {
          alias: "l",
          describe: "Run locally with remote bindings disabled",
          type: "boolean"
        },
        minify: {
          describe: "Minify the script",
          type: "boolean"
        },
        "node-compat": {
          describe: "Enable Node.js compatibility",
          type: "boolean",
          hidden: true,
          deprecated: true
        },
        "persist-to": {
          describe: "Specify directory to use for local persistence (defaults to .wrangler/state)",
          type: "string",
          requiresArg: true
        },
        "live-reload": {
          describe: "Auto reload HTML pages when change is detected in local mode",
          type: "boolean"
        },
        "legacy-env": {
          type: "boolean",
          describe: "Use legacy environments",
          hidden: true
        },
        "test-scheduled": {
          describe: "Test scheduled events by visiting /__scheduled in browser",
          type: "boolean",
          default: false
        },
        "log-level": {
          choices: ["debug", "info", "log", "warn", "error", "none"],
          describe: "Specify logging level"
        },
        "show-interactive-dev-session": {
          describe: "Show interactive dev session (defaults to true if the terminal supports interactivity)",
          type: "boolean"
        },
        types: {
          describe: "Generate types from your Worker configuration",
          type: "boolean"
        }
      },
      async validateArgs(args) {
        if (args.nodeCompat) {
          throw new UserError(
            `The --node-compat flag is no longer supported as of Wrangler v4. Instead, use the \`nodejs_compat\` compatibility flag. This includes the functionality from legacy \`node_compat\` polyfills and natively implemented Node.js APIs. See https://developers.cloudflare.com/workers/runtime-apis/nodejs for more information.`
          );
        }
        if (args.liveReload && args.remote) {
          throw new UserError(
            "--live-reload is only supported in local mode. Please just use one of either --remote or --live-reload."
          );
        }
        if ((0, import_env2.isWebContainer)()) {
          logger.error(
            `Oh no! \u{1F61F} You tried to run \`wrangler dev\` in a StackBlitz WebContainer. \u{1F92F}
	This is currently not supported \u{1F62D}, but we think that we'll get it to work soon... hang in there! \u{1F97A}`
          );
          process.exitCode = 1;
          return;
        }
      },
      async handler(args) {
        const devInstance = await startDev(args);
        assert53__default.default(devInstance.devEnv !== void 0);
        await events__default.default.once(devInstance.devEnv, "teardown");
        await Promise.all(devInstance.secondary.map((d8) => d8.teardown()));
        devInstance.unregisterHotKeys?.();
      }
    });
    __name(getHostAndRoutes, "getHostAndRoutes");
    __name(getInferredHost, "getInferredHost");
    __name(applyHyperdriveEnvVars, "applyHyperdriveEnvVars");
    __name(getBindings2, "getBindings");
    __name(getAssetChangeMessage, "getAssetChangeMessage");
  }
});
function runBuild({
  entry,
  destination,
  jsxFactory,
  jsxFragment,
  processEntrypoint,
  additionalModules,
  rules,
  tsconfig,
  minify,
  keepNames,
  nodejsCompatMode,
  compatibilityDate,
  compatibilityFlags,
  define: define2,
  alias,
  noBundle,
  findAdditionalModules: findAdditionalModules2,
  durableObjects,
  workflows,
  local,
  targetConsumer,
  testScheduled,
  projectRoot,
  onStart,
  defineNavigatorUserAgent,
  checkFetch,
  pythonModulesExcludes
}, setBundle, onErr) {
  let stopWatching = void 0;
  const entryDirectory = path3__namespace.default.dirname(entry.file);
  const moduleCollector = noBundle ? noopModuleCollector : createModuleCollector({
    wrangler1xLegacyModuleReferences: getWrangler1xLegacyModuleReferences(
      entryDirectory,
      entry.file
    ),
    entry,
    findAdditionalModules: findAdditionalModules2 ?? false,
    rules
  });
  async function getAdditionalModules() {
    return noBundle ? dedupeModulesByName([
      ...await findAdditionalModules(
        entry,
        rules,
        false,
        pythonModulesExcludes ?? []
      ) ?? [],
      ...additionalModules
    ]) : additionalModules;
  }
  __name(getAdditionalModules, "getAdditionalModules");
  async function updateBundle() {
    const newAdditionalModules = await getAdditionalModules();
    setBundle((previousBundle) => {
      assert53__default.default(
        previousBundle,
        "Rebuild triggered with no previous build available"
      );
      previousBundle.modules = dedupeModulesByName([
        ...moduleCollector?.modules ?? [],
        ...newAdditionalModules
      ]);
      return {
        ...previousBundle,
        entrypointSource: fs29.readFileSync(previousBundle.path, "utf8"),
        id: previousBundle.id + 1
      };
    });
  }
  __name(updateBundle, "updateBundle");
  async function build5() {
    if (!destination) {
      return;
    }
    const newAdditionalModules = await getAdditionalModules();
    const bundleResult = processEntrypoint || !noBundle ? await bundleWorker(entry, destination, {
      bundle: !noBundle,
      moduleCollector,
      additionalModules: newAdditionalModules,
      jsxFactory,
      jsxFragment,
      watch: true,
      tsconfig,
      minify,
      keepNames,
      nodejsCompatMode,
      compatibilityDate,
      compatibilityFlags,
      doBindings: durableObjects.bindings,
      workflowBindings: workflows,
      alias,
      define: define2,
      targetConsumer,
      testScheduled,
      plugins: [logBuildOutput(nodejsCompatMode, onStart, updateBundle)],
      local,
      projectRoot,
      defineNavigatorUserAgent,
      // Pages specific options used by wrangler pages commands
      entryName: void 0,
      inject: void 0,
      isOutfile: void 0,
      external: void 0,
      // sourcemap defaults to true in dev
      sourcemap: void 0,
      checkFetch,
      metafile: void 0
    }) : void 0;
    stopWatching = bundleResult?.stop;
    if (noBundle) {
      const watching = [path3__namespace.default.resolve(entry.moduleRoot)];
      const watcher = watch(watching, {
        persistent: true,
        // Ignore VCS dirs, dependencies, and the .wrangler dir (which
        // contains miniflare state/cache files written by workerd at
        // runtime — watching them causes an infinite reload loop).
        // chokidar v4 normalises paths to forward slashes before
        // matching, so a regex on path segments works cross-platform.
        ignored: /[/\\](\.git|node_modules|\.wrangler)([/\\]|$)/
      }).on("change", async (_event) => {
        await updateBundle();
      });
      stopWatching = /* @__PURE__ */ __name(() => watcher.close(), "stopWatching");
    }
    const entrypointPath = fs29.realpathSync(
      bundleResult?.resolvedEntryPointPath ?? entry.file
    );
    setBundle(() => ({
      id: 0,
      entry,
      path: entrypointPath,
      type: bundleResult?.bundleType ?? getBundleType(entry.format, entry.file),
      modules: bundleResult ? bundleResult.modules : newAdditionalModules,
      dependencies: bundleResult?.dependencies ?? {},
      sourceMapPath: bundleResult?.sourceMapPath,
      sourceMapMetadata: bundleResult?.sourceMapMetadata,
      entrypointSource: fs29.readFileSync(entrypointPath, "utf8")
    }));
  }
  __name(build5, "build");
  build5().catch((err) => {
    onErr(err);
  });
  return () => stopWatching?.();
}
var init_use_esbuild = __esm({
  "src/dev/use-esbuild.ts"() {
    init_import_meta_url();
    init_esm6();
    init_bundle();
    init_bundle_type();
    init_dedupe_modules();
    init_log_build_output();
    init_find_additional_modules();
    init_module_collection();
    __name(runBuild, "runBuild");
  }
});
var BundlerController;
var init_BundlerController = __esm({
  "src/api/startDevWorker/BundlerController.ts"() {
    init_import_meta_url();
    init_esm6();
    init_bundle();
    init_bundle_type();
    init_module_collection();
    init_no_bundle_worker();
    init_run_custom_build();
    init_dev2();
    init_use_esbuild();
    init_logger();
    init_navigator_user_agent();
    init_paths();
    init_debounce();
    init_BaseController();
    init_events();
    init_utils2();
    BundlerController = class extends Controller {
      static {
        __name(this, "BundlerController");
      }
      #currentBundle;
      #customBuildWatcher;
      // Handle aborting in-flight custom builds as new ones come in from the filesystem watcher
      #customBuildAborter = new AbortController();
      async #runCustomBuild(config, filePath) {
        this.#customBuildAborter.abort();
        this.#customBuildAborter = new AbortController();
        const buildAborter = this.#customBuildAborter;
        const relativeFile = path3__namespace.default.relative(config.projectRoot, config.entrypoint) || ".";
        logger.log(`The file ${filePath} changed, restarting build...`);
        this.emitBundleStartEvent(config);
        try {
          await runCustomBuild(
            config.entrypoint,
            relativeFile,
            {
              cwd: config.build?.custom?.workingDirectory,
              command: config.build?.custom?.command
            },
            config.config,
            "dev"
          );
          if (buildAborter.signal.aborted) {
            return;
          }
          assert53__default.default(this.#tmpDir);
          if (!config.build?.bundle) {
            const destinationDir = this.#tmpDir.path;
            fs29.writeFileSync(
              path3__namespace.default.join(destinationDir, path3__namespace.default.basename(config.entrypoint)),
              fs29.readFileSync(config.entrypoint, "utf-8")
            );
          }
          const entry = {
            file: config.entrypoint,
            projectRoot: config.projectRoot,
            configPath: config.config,
            format: config.build.format,
            moduleRoot: config.build.moduleRoot,
            exports: config.build.exports
          };
          const entryDirectory = path3__namespace.default.dirname(config.entrypoint);
          const moduleCollector = createModuleCollector({
            wrangler1xLegacyModuleReferences: getWrangler1xLegacyModuleReferences(
              entryDirectory,
              config.entrypoint
            ),
            entry,
            // `moduleCollector` doesn't get used when `noBundle` is set, so
            // `findAdditionalModules` always defaults to `false`
            findAdditionalModules: config.build.findAdditionalModules ?? false,
            rules: config.build.moduleRules
          });
          const doBindings = extractBindingsOfType(
            "durable_object_namespace",
            config.bindings
          );
          const workflowBindings = extractBindingsOfType(
            "workflow",
            config.bindings
          );
          const bundleResult = !config.build?.bundle ? await noBundleWorker(
            entry,
            config.build.moduleRules,
            this.#tmpDir.path,
            config.pythonModules?.exclude ?? []
          ) : await bundleWorker(entry, this.#tmpDir.path, {
            bundle: true,
            additionalModules: [],
            moduleCollector,
            doBindings,
            workflowBindings,
            jsxFactory: config.build.jsxFactory,
            jsxFragment: config.build.jsxFactory,
            tsconfig: config.build.tsconfig,
            minify: config.build.minify,
            keepNames: config.build.keepNames ?? true,
            nodejsCompatMode: config.build.nodejsCompatMode,
            compatibilityDate: config.compatibilityDate,
            compatibilityFlags: config.compatibilityFlags,
            define: config.build.define,
            checkFetch: shouldCheckFetch(
              config.compatibilityDate,
              config.compatibilityFlags
            ),
            alias: config.build.alias,
            // We want to know if the build is for development or publishing
            // This could potentially cause issues as we no longer have identical behaviour between dev and deploy?
            targetConsumer: "dev",
            local: !config.dev?.remote,
            projectRoot: config.projectRoot,
            defineNavigatorUserAgent: isNavigatorDefined(
              config.compatibilityDate,
              config.compatibilityFlags
            ),
            testScheduled: config.dev.testScheduled,
            plugins: void 0,
            // Pages specific options used by wrangler pages commands
            entryName: void 0,
            inject: void 0,
            isOutfile: void 0,
            external: void 0,
            // We don't use esbuild watching for custom builds
            watch: void 0,
            // sourcemap defaults to true in dev
            sourcemap: void 0,
            metafile: void 0
          });
          if (buildAborter.signal.aborted) {
            return;
          }
          const entrypointPath = fs29.realpathSync(
            bundleResult?.resolvedEntryPointPath ?? config.entrypoint
          );
          this.emitBundleCompleteEvent(config, {
            id: 0,
            entry,
            path: entrypointPath,
            type: bundleResult?.bundleType ?? getBundleType(config.build.format, config.entrypoint),
            modules: bundleResult.modules,
            dependencies: bundleResult?.dependencies ?? {},
            sourceMapPath: bundleResult?.sourceMapPath,
            sourceMapMetadata: bundleResult?.sourceMapMetadata,
            entrypointSource: fs29.readFileSync(entrypointPath, "utf8")
          });
        } catch (err) {
          this.emitErrorEvent({
            type: "error",
            reason: "Custom build failed",
            cause: castErrorCause(err),
            source: "BundlerController",
            data: { config, filePath }
          });
        }
      }
      async #startCustomBuild(config) {
        await this.#customBuildWatcher?.close();
        this.#customBuildAborter?.abort();
        if (!config.build?.custom?.command) {
          return;
        }
        const pathsToWatch = config.build.custom.watch;
        assert53__default.default(pathsToWatch, "config.build.custom.watch");
        this.#customBuildWatcher = watch(pathsToWatch, {
          persistent: true,
          // The initial custom build is always done in getEntry()
          ignoreInitial: true
        });
        this.#customBuildWatcher.on("ready", () => {
          void this.#runCustomBuild(config, String(pathsToWatch));
        });
        this.#customBuildWatcher.on(
          "all",
          (_event, filePath) => void this.#runCustomBuild(config, filePath)
        );
      }
      #bundlerCleanup;
      #bundleBuildAborter = new AbortController();
      async #startBundle(config) {
        await this.#bundlerCleanup?.();
        this.#bundleBuildAborter.abort();
        this.#bundleBuildAborter = new AbortController();
        const buildAborter = this.#bundleBuildAborter;
        if (config.build?.custom?.command) {
          return;
        }
        assert53__default.default(this.#tmpDir);
        const entry = {
          file: config.entrypoint,
          projectRoot: config.projectRoot,
          configPath: config.config,
          format: config.build.format,
          moduleRoot: config.build.moduleRoot,
          exports: config.build.exports,
          name: config.name
        };
        const durableObjects = {
          bindings: extractBindingsOfType(
            "durable_object_namespace",
            config.bindings
          )
        };
        const workflows = extractBindingsOfType("workflow", config.bindings);
        this.#bundlerCleanup = runBuild(
          {
            entry,
            destination: this.#tmpDir.path,
            jsxFactory: config.build?.jsxFactory,
            jsxFragment: config.build?.jsxFragment,
            processEntrypoint: Boolean(config.build?.processEntrypoint),
            additionalModules: config.build?.additionalModules ?? [],
            rules: config.build.moduleRules,
            tsconfig: config.build?.tsconfig,
            minify: config.build?.minify,
            keepNames: config.build?.keepNames ?? true,
            nodejsCompatMode: config.build.nodejsCompatMode,
            compatibilityDate: config.compatibilityDate,
            compatibilityFlags: config.compatibilityFlags,
            define: config.build.define,
            alias: config.build.alias,
            noBundle: !config.build?.bundle,
            findAdditionalModules: config.build?.findAdditionalModules,
            durableObjects,
            workflows,
            local: !config.dev?.remote,
            // startDevWorker only applies to "dev"
            targetConsumer: "dev",
            testScheduled: Boolean(config.dev?.testScheduled),
            projectRoot: config.projectRoot,
            onStart: /* @__PURE__ */ __name(() => {
              this.emitBundleStartEvent(config);
            }, "onStart"),
            checkFetch: shouldCheckFetch(
              config.compatibilityDate,
              config.compatibilityFlags
            ),
            defineNavigatorUserAgent: isNavigatorDefined(
              config.compatibilityDate,
              config.compatibilityFlags
            ),
            pythonModulesExcludes: config.pythonModules?.exclude ?? []
          },
          (cb2) => {
            const newBundle = cb2(this.#currentBundle);
            if (!buildAborter.signal.aborted) {
              this.emitBundleCompleteEvent(config, newBundle);
              this.#currentBundle = newBundle;
            }
          },
          (err) => {
            if (!buildAborter.signal.aborted) {
              this.emitErrorEvent({
                type: "error",
                reason: "Failed to construct initial bundle",
                cause: castErrorCause(err),
                source: "BundlerController",
                data: void 0
              });
            }
          }
        );
      }
      #assetsWatcher;
      async #ensureWatchingAssets(config) {
        await this.#assetsWatcher?.close();
        const debouncedRefreshBundle = debounce(() => {
          if (this.#currentBundle) {
            this.emitBundleCompleteEvent(config, this.#currentBundle);
          }
        });
        if (config.assets?.directory) {
          this.#assetsWatcher = watch(config.assets.directory, {
            persistent: true,
            ignoreInitial: true
          }).on("all", async (eventName, filePath) => {
            const message = getAssetChangeMessage(eventName, filePath);
            logger.debug(`\u{1F300} ${message}...`);
            debouncedRefreshBundle();
          });
        }
      }
      #tmpDir;
      onConfigUpdate(event) {
        this.#tmpDir?.remove();
        try {
          this.#tmpDir = getWranglerTmpDir(event.config.projectRoot, "dev");
        } catch (e10) {
          this.emitErrorEvent({
            type: "error",
            reason: "Failed to create temporary directory to store built files.",
            cause: castErrorCause(e10),
            source: "BundlerController",
            data: void 0
          });
        }
        void this.#startCustomBuild(event.config).catch((err) => {
          this.emitErrorEvent({
            type: "error",
            reason: "Failed to run custom build",
            cause: castErrorCause(err),
            source: "BundlerController",
            data: { config: event.config }
          });
        });
        void this.#startBundle(event.config).catch((err) => {
          this.emitErrorEvent({
            type: "error",
            reason: "Failed to start bundler",
            cause: castErrorCause(err),
            source: "BundlerController",
            data: { config: event.config }
          });
        });
        void this.#ensureWatchingAssets(event.config).catch((err) => {
          this.emitErrorEvent({
            type: "error",
            reason: "Failed to watch assets",
            cause: castErrorCause(err),
            source: "BundlerController",
            data: { config: event.config }
          });
        });
      }
      async teardown() {
        logger.debug("BundlerController teardown beginning...");
        await super.teardown();
        this.#customBuildAborter?.abort();
        this.#tmpDir?.remove();
        await Promise.all([
          this.#bundlerCleanup?.(),
          this.#customBuildWatcher?.close(),
          this.#assetsWatcher?.close()
        ]);
        logger.debug("BundlerController teardown complete");
      }
      emitBundleStartEvent(config) {
        this.bus.dispatch({ type: "bundleStart", config });
      }
      emitBundleCompleteEvent(config, bundle) {
        this.bus.dispatch({ type: "bundleComplete", config, bundle });
      }
    };
  }
});
async function getPorts(options) {
  let ports;
  let exclude = /* @__PURE__ */ new Set();
  if (options) {
    if (options.port) {
      ports = typeof options.port === "number" ? [options.port] : options.port;
    }
    if (options.exclude) {
      const excludeIterable = options.exclude;
      if (typeof excludeIterable[Symbol.iterator] !== "function") {
        throw new TypeError("The `exclude` option must be an iterable.");
      }
      for (const element of excludeIterable) {
        if (typeof element !== "number") {
          throw new TypeError("Each item in the `exclude` option must be a number corresponding to the port you want excluded.");
        }
        if (!Number.isSafeInteger(element)) {
          throw new TypeError(`Number ${element} in the exclude option is not a safe integer and can't be used`);
        }
      }
      exclude = new Set(excludeIterable);
    }
  }
  if (timeout === void 0) {
    timeout = setTimeout(() => {
      timeout = void 0;
      lockedPorts.old = lockedPorts.young;
      lockedPorts.young = /* @__PURE__ */ new Set();
    }, releaseOldLockedPortsIntervalMs);
    if (timeout.unref) {
      timeout.unref();
    }
  }
  const hosts = getLocalHosts();
  for (const port of portCheckSequence(ports)) {
    try {
      if (exclude.has(port)) {
        continue;
      }
      let availablePort = await getAvailablePort({ ...options, port }, hosts);
      while (lockedPorts.old.has(availablePort) || lockedPorts.young.has(availablePort)) {
        if (port !== 0) {
          throw new Locked(port);
        }
        availablePort = await getAvailablePort({ ...options, port }, hosts);
      }
      lockedPorts.young.add(availablePort);
      return availablePort;
    } catch (error2) {
      if (!["EADDRINUSE", "EACCES"].includes(error2.code) && !(error2 instanceof Locked)) {
        throw error2;
      }
    }
  }
  throw new Error("No available ports found");
}
function portNumbers(from, to) {
  if (!Number.isInteger(from) || !Number.isInteger(to)) {
    throw new TypeError("`from` and `to` must be integer numbers");
  }
  if (from < minPort || from > maxPort) {
    throw new RangeError(`'from' must be between ${minPort} and ${maxPort}`);
  }
  if (to < minPort || to > maxPort) {
    throw new RangeError(`'to' must be between ${minPort} and ${maxPort}`);
  }
  if (from > to) {
    throw new RangeError("`to` must be greater than or equal to `from`");
  }
  const generator = /* @__PURE__ */ __name(function* (from2, to2) {
    for (let port = from2; port <= to2; port++) {
      yield port;
    }
  }, "generator");
  return generator(from, to);
}
var Locked, lockedPorts, releaseOldLockedPortsIntervalMs, minPort, maxPort, timeout, getLocalHosts, checkAvailablePort, getAvailablePort, portCheckSequence;
var init_get_port = __esm({
  "../../node_modules/.pnpm/get-port@7.0.0/node_modules/get-port/index.js"() {
    init_import_meta_url();
    Locked = class extends Error {
      static {
        __name(this, "Locked");
      }
      constructor(port) {
        super(`${port} is locked`);
      }
    };
    lockedPorts = {
      old: /* @__PURE__ */ new Set(),
      young: /* @__PURE__ */ new Set()
    };
    releaseOldLockedPortsIntervalMs = 1e3 * 15;
    minPort = 1024;
    maxPort = 65535;
    getLocalHosts = /* @__PURE__ */ __name(() => {
      const interfaces = os11__namespace.default.networkInterfaces();
      const results = /* @__PURE__ */ new Set([void 0, "0.0.0.0"]);
      for (const _interface of Object.values(interfaces)) {
        for (const config of _interface) {
          results.add(config.address);
        }
      }
      return results;
    }, "getLocalHosts");
    checkAvailablePort = /* @__PURE__ */ __name((options) => new Promise((resolve32, reject) => {
      const server = net__default.default.createServer();
      server.unref();
      server.on("error", reject);
      server.listen(options, () => {
        const { port } = server.address();
        server.close(() => {
          resolve32(port);
        });
      });
    }), "checkAvailablePort");
    getAvailablePort = /* @__PURE__ */ __name(async (options, hosts) => {
      if (options.host || options.port === 0) {
        return checkAvailablePort(options);
      }
      for (const host of hosts) {
        try {
          await checkAvailablePort({ port: options.port, host });
        } catch (error2) {
          if (!["EADDRNOTAVAIL", "EINVAL"].includes(error2.code)) {
            throw error2;
          }
        }
      }
      return options.port;
    }, "getAvailablePort");
    portCheckSequence = /* @__PURE__ */ __name(function* (ports) {
      if (ports) {
        yield* ports;
      }
      yield 0;
    }, "portCheckSequence");
    __name(getPorts, "getPorts");
    __name(portNumbers, "portNumbers");
  }
});

// src/utils/memoizeGetPort.ts
function isNetworkBindPermissionError(e10) {
  return e10 !== null && typeof e10 === "object" && "code" in e10 && (e10.code === "EPERM" || e10.code === "EACCES") && "syscall" in e10 && (e10.syscall === "listen" || e10.syscall === "bind");
}
function memoizeGetPort(defaultPort, defaultHost) {
  let portValue;
  let cachedHost = defaultHost;
  return async (forHost = defaultHost) => {
    if (forHost !== cachedHost) {
      portValue = void 0;
      cachedHost = forHost;
    }
    try {
      portValue = portValue ?? await getPorts({
        port: portNumbers(
          defaultPort,
          defaultPort + NUM_CONSECUTIVE_PORTS_TO_PROBE
        ),
        host: forHost
      });
      return portValue;
    } catch (e10) {
      if (isNetworkBindPermissionError(e10)) {
        throw new UserError(
          `Failed to bind to ${forHost}:${defaultPort}: permission denied.
This usually means a sandbox or security policy is preventing network access.
If you are running inside a restricted environment (container, VM, AI coding agent, etc.),
configure it to allow binding to loopback addresses.`
        );
      }
      throw e10;
    }
  };
}
var import_ci_info5, NUM_CONSECUTIVE_PORTS_TO_PROBE;
var init_memoizeGetPort = __esm({
  "src/utils/memoizeGetPort.ts"() {
    init_import_meta_url();
    init_dist();
    import_ci_info5 = __toESM(require_ci_info());
    init_get_port();
    NUM_CONSECUTIVE_PORTS_TO_PROBE = import_ci_info5.default.isCI ? 0 : 10;
    __name(isNetworkBindPermissionError, "isNetworkBindPermissionError");
    __name(memoizeGetPort, "memoizeGetPort");
  }
});
async function resolveInspectorConfig(config, input) {
  if (input.dev?.inspector === false) {
    return false;
  }
  const hostname2 = input.dev?.inspector?.hostname ?? config.dev.inspector_ip ?? "127.0.0.1";
  const port = input.dev?.inspector?.port ?? config.dev.inspector_port ?? await getInspectorPort(hostname2);
  return {
    hostname: hostname2,
    port
  };
}
async function resolveDevConfig(config, input) {
  const auth = /* @__PURE__ */ __name(async () => {
    if (input.dev?.remote) {
      const isLoggedIn = await loginOrRefreshIfRequired(config);
      if (!isLoggedIn) {
        throw new UserError(
          "You must be logged in to use wrangler dev in remote mode. Try logging in, or run wrangler dev --local."
        );
      }
    }
    if (input.dev?.auth) {
      return unwrapHook(input.dev.auth, config);
    }
    return {
      accountId: await requireAuth(config),
      apiToken: requireApiToken()
    };
  }, "auth");
  const localPersistencePath = getLocalPersistencePath(
    input.dev?.persist,
    config
  );
  const { host, routes } = await getHostAndRoutes(
    {
      host: input.dev?.origin?.hostname,
      routes: input.triggers?.filter(
        (t13) => t13.type === "route"
      ),
      assets: input?.assets
    },
    config
  );
  if (input.dev?.remote) {
    const { accountId } = await auth();
    assert53__default.default(accountId, "Account ID must be provided for remote dev");
    await getZoneIdForPreview(config, { host, routes, accountId });
  }
  const initialIp = input.dev?.server?.hostname ?? config.dev.ip;
  const initialIpListenCheck = initialIp === "*" ? "0.0.0.0" : initialIp;
  const useContainers = config.dev.enable_containers && config.containers?.length;
  return {
    auth,
    remote: input.dev?.remote,
    server: {
      hostname: input.dev?.server?.hostname || config.dev.ip,
      port: input.dev?.server?.port ?? config.dev.port ?? await getLocalPort(initialIpListenCheck),
      secure: input.dev?.server?.secure ?? config.dev.local_protocol === "https",
      httpsKeyPath: input.dev?.server?.httpsKeyPath,
      httpsCertPath: input.dev?.server?.httpsCertPath
    },
    inspector: await resolveInspectorConfig(config, input),
    origin: {
      secure: input.dev?.origin?.secure ?? config.dev.upstream_protocol === "https",
      hostname: host ?? getInferredHost(routes, config.configPath)
    },
    liveReload: input.dev?.liveReload || false,
    testScheduled: input.dev?.testScheduled,
    // absolute resolved path
    persist: localPersistencePath,
    registry: input.dev?.registry,
    multiworkerPrimary: input.dev?.multiworkerPrimary,
    enableContainers: input.dev?.enableContainers ?? config.dev.enable_containers,
    dockerPath: input.dev?.dockerPath ?? getDockerPath(),
    containerEngine: useContainers ? input.dev?.containerEngine ?? config.dev.container_engine ?? resolveDockerHost(input.dev?.dockerPath ?? getDockerPath()) : void 0,
    containerBuildId: input.dev?.containerBuildId,
    generateTypes: input.dev?.generateTypes ?? config.dev.generate_types
  };
}
async function resolveBindings(config, input) {
  const bindings = getBindings2(
    config,
    input.env,
    input.envFiles,
    !input.dev?.remote,
    input.bindings,
    input.defaultBindings
  );
  const printCurrentBindings = /* @__PURE__ */ __name((registry) => {
    printBindings(
      bindings,
      input.tailConsumers ?? config.tail_consumers,
      input.streamingTailConsumers ?? config.streaming_tail_consumers,
      config.containers,
      {
        registry,
        local: !input.dev?.remote,
        remoteBindingsDisabled: input.dev?.remote === false,
        name: config.name
      }
    );
  }, "printCurrentBindings");
  printCurrentBindings(
    input.dev?.registry ? miniflare.getWorkerRegistry(input.dev.registry) : null
  );
  return {
    bindings: {
      ...input.bindings,
      ...bindings
    },
    unsafe: {
      bindings: config.unsafe.bindings,
      metadata: config.unsafe.metadata,
      capnp: config.unsafe.capnp
    },
    printCurrentBindings
  };
}
async function resolveTriggers(config, input) {
  const { routes } = await getHostAndRoutes(
    {
      host: input.dev?.origin?.hostname,
      routes: input.triggers?.filter(
        (t13) => t13.type === "route"
      ),
      assets: input?.assets
    },
    config
  );
  const devRoutes = routes?.map(
    (r10) => typeof r10 === "string" ? {
      type: "route",
      pattern: r10
    } : { type: "route", ...r10 }
  ) ?? [];
  const queueConsumers = config.queues.consumers?.map(
    (c8) => ({
      ...c8,
      type: "queue-consumer"
    })
  ) ?? [];
  const crons = config.triggers.crons?.map((c8) => ({
    cron: c8,
    type: "cron"
  })) ?? [];
  return [...devRoutes, ...queueConsumers, ...crons];
}
async function resolveConfig(config, input, previousName) {
  if (config.pages_build_output_dir && input.dev?.multiworkerPrimary === false) {
    throw new UserError(
      `You cannot use a Pages project as a service binding target.
If you are trying to develop Pages and Workers together, please use \`wrangler pages dev\`. Note the first config file specified must be for the Pages project`
    );
  }
  const legacySite = unwrapHook(input.legacy?.site, config);
  const entry = await getEntry(
    {
      script: input.entrypoint,
      moduleRoot: input.build?.moduleRoot,
      // getEntry only needs to know if assets was specified.
      // The actual value is not relevant here, which is why not passing
      // the entire Assets object is fine.
      assets: input?.assets
    },
    config,
    "dev"
  );
  const nodejsCompatMode = unwrapHook(input.build?.nodejsCompatMode, config);
  const { bindings, unsafe, printCurrentBindings } = await resolveBindings(
    config,
    input
  );
  const assetsOptions = getAssetsOptions(
    {
      assets: input?.assets,
      script: input.entrypoint
    },
    config
  );
  const resolved = {
    name: getScriptName({ name: input.name, env: input.env }, config) ?? previousName ?? crypto.randomUUID(),
    config: config.configPath,
    compatibilityDate: getDevCompatibilityDate(
      entry.projectRoot,
      config,
      input.compatibilityDate
    ),
    compatibilityFlags: input.compatibilityFlags ?? config.compatibility_flags,
    complianceRegion: input.complianceRegion ?? config.compliance_region,
    pythonModules: {
      exclude: input.pythonModules?.exclude ?? config.python_modules.exclude
    },
    entrypoint: entry.file,
    projectRoot: entry.projectRoot,
    bindings,
    migrations: input.migrations ?? config.migrations,
    sendMetrics: input.sendMetrics ?? config.send_metrics,
    triggers: await resolveTriggers(config, input),
    env: input.env,
    envFiles: input.envFiles,
    build: {
      alias: input.build?.alias ?? config.alias,
      additionalModules: input.build?.additionalModules ?? [],
      processEntrypoint: Boolean(input.build?.processEntrypoint),
      bundle: input.build?.bundle ?? !config.no_bundle,
      findAdditionalModules: input.build?.findAdditionalModules ?? config.find_additional_modules,
      moduleRoot: entry.moduleRoot,
      moduleRules: input.build?.moduleRules ?? getRules(config),
      minify: input.build?.minify ?? config.minify,
      keepNames: input.build?.keepNames ?? config.keep_names,
      define: { ...config.define, ...input.build?.define },
      custom: {
        command: input.build?.custom?.command ?? config.build?.command,
        watch: input.build?.custom?.watch ?? config.build?.watch_dir,
        workingDirectory: input.build?.custom?.workingDirectory ?? config.build?.cwd
      },
      format: entry.format,
      nodejsCompatMode: nodejsCompatMode ?? null,
      jsxFactory: input.build?.jsxFactory || config.jsx_factory,
      jsxFragment: input.build?.jsxFragment || config.jsx_fragment,
      tsconfig: input.build?.tsconfig ?? config.tsconfig,
      exports: entry.exports
    },
    containers: await getNormalizedContainerOptions(config, {}),
    dev: await resolveDevConfig(config, input),
    legacy: {
      site: legacySite,
      useServiceEnvironments: input.legacy?.useServiceEnvironments ?? useServiceEnvironments(config)
    },
    unsafe: {
      capnp: input.unsafe?.capnp ?? unsafe?.capnp,
      metadata: input.unsafe?.metadata ?? unsafe?.metadata
    },
    assets: assetsOptions,
    tailConsumers: config.tail_consumers ?? [],
    experimental: {},
    streamingTailConsumers: config.streaming_tail_consumers ?? []
  };
  if (extractBindingsOfType("analytics_engine", resolved.bindings).length && !resolved.dev.remote && resolved.build.format === "service-worker") {
    logger.once.warn(
      "Analytics Engine is not supported locally when using the service-worker format. Please migrate to the module worker format: https://developers.cloudflare.com/workers/reference/migrate-to-module-workers/"
    );
  }
  validateAssetsArgsAndConfig(resolved);
  const services = extractBindingsOfType("service", resolved.bindings);
  if (services && services.length > 0 && resolved.dev?.remote) {
    logger.once.warn(
      `This worker is bound to live services: ${services.map(
        (service) => `${service.binding} (${service.service}${service.environment ? `@${service.environment}` : ""}${service.entrypoint ? `#${service.entrypoint}` : ""})`
      ).join(", ")}`
    );
  }
  if (!resolved.dev?.origin?.secure && resolved.dev?.remote) {
    logger.once.warn(
      "Setting upstream-protocol to http is not currently supported for remote mode.\nIf this is required in your project, please add your use case to the following issue:\nhttps://github.com/cloudflare/workers-sdk/issues/583."
    );
  }
  const needsPulling = resolved.containers.some(
    (c8) => "image_uri" in c8 && c8.image_uri
  );
  if (needsPulling && !resolved.dev.remote) {
    await fillOpenAPIConfiguration(config, containersScope);
  }
  const queues = extractBindingsOfType("queue", resolved.bindings);
  if (resolved.dev.remote && (queues?.length || resolved.triggers?.some((t13) => t13.type === "queue-consumer"))) {
    logger.once.warn(
      "Queues are not yet supported in wrangler dev remote mode."
    );
  }
  if (resolved.dev.remote) {
    if (resolved.dev.enableContainers && resolved.containers && resolved.containers.length > 0) {
      logger.once.warn(
        "Containers are only supported in local mode, to suppress this warning set `dev.enable_containers` to `false` or pass `--enable-containers=false` to the `wrangler dev` command"
      );
    }
    const classNameToUseSQLite = getDurableObjectClassNameToUseSQLiteMap(
      resolved.migrations
    );
    if (resolved.dev.remote && Array.from(classNameToUseSQLite.values()).some((v8) => v8)) {
      logger.once.warn(
        "SQLite in Durable Objects is only supported in local mode."
      );
    }
  }
  await checkTypesDiff(config, entry);
  return { config: resolved, printCurrentBindings };
}
function getDevCompatibilityDate(projectPath, config, compatibilityDate = config?.compatibility_date) {
  const todaysDate = getTodaysCompatDate();
  if (config?.configPath && compatibilityDate === void 0) {
    logger.warn(
      `No compatibility_date was specified. Using today's date: ${todaysDate}.
\u276F\u276F Add one to your ${configFileName(config.configPath)} file: ${formatConfigSnippet({ compatibility_date: todaysDate }, config.configPath, false).trim()}, or
\u276F\u276F Pass it in your terminal: wrangler dev [<SCRIPT>] --compatibility-date=${todaysDate}

See https://developers.cloudflare.com/workers/platform/compatibility-dates/ for more information.`
    );
  }
  return compatibilityDate ?? todaysDate;
}
var getInspectorPort, getLocalPort, ConfigController;
var init_ConfigController = __esm({
  "src/api/startDevWorker/ConfigController.ts"() {
    init_import_meta_url();
    init_containers_shared();
    init_dist();
    init_esm6();
    init_assets5();
    init_common();
    init_config();
    init_containers2();
    init_config5();
    init_entry();
    init_dev2();
    init_class_names_sqlite();
    init_get_local_persistence_path();
    init_logger();
    init_helpers7();
    init_user3();
    init_constants7();
    init_getRules();
    init_getScriptName();
    init_memoizeGetPort();
    init_print_bindings();
    init_useServiceEnvironments();
    init_zones3();
    init_BaseController();
    init_events();
    init_utils2();
    getInspectorPort = memoizeGetPort(DEFAULT_INSPECTOR_PORT, "127.0.0.1");
    getLocalPort = memoizeGetPort(DEFAULT_LOCAL_PORT, "localhost");
    __name(resolveInspectorConfig, "resolveInspectorConfig");
    __name(resolveDevConfig, "resolveDevConfig");
    __name(resolveBindings, "resolveBindings");
    __name(resolveTriggers, "resolveTriggers");
    __name(resolveConfig, "resolveConfig");
    __name(getDevCompatibilityDate, "getDevCompatibilityDate");
    ConfigController = class extends Controller {
      static {
        __name(this, "ConfigController");
      }
      latestInput;
      latestConfig;
      #printCurrentBindings;
      #configWatcher;
      #abortController;
      async #ensureWatchingConfig(configPath) {
        await this.#configWatcher?.close();
        if (configPath) {
          this.#configWatcher = watch(configPath, {
            persistent: true,
            ignoreInitial: true
          }).on("change", async (_event) => {
            if (this.#configWatcher?.closed) {
              return;
            }
            logger.debug(`${path3__namespace.default.basename(configPath)} changed...`);
            assert53__default.default(
              this.latestInput,
              "Cannot be watching config without having first set an input"
            );
            logger.debug("config file changed", configPath);
            this.#updateConfig(this.latestInput).catch((err) => {
              this.emitErrorEvent({
                type: "error",
                reason: "Error resolving config after change",
                cause: castErrorCause(err),
                source: "ConfigController",
                data: void 0
              });
            });
          });
        }
      }
      set(input, throwErrors = false) {
        logger.debug("setting config");
        return runWithLogLevel(
          input.dev?.logLevel,
          () => this.#updateConfig(input, throwErrors)
        );
      }
      patch(input) {
        logger.debug("patching config");
        assert53__default.default(
          this.latestInput,
          "Cannot call updateConfig without previously calling setConfig"
        );
        const config = {
          ...this.latestInput,
          ...input
        };
        return runWithLogLevel(
          config.dev?.logLevel,
          () => this.#updateConfig(config)
        );
      }
      async #updateConfig(input, throwErrors = false) {
        logger.debug(
          "Updating config...",
          this.#abortController?.signal,
          this.#configWatcher?.closed
        );
        this.#abortController?.abort();
        this.#abortController = new AbortController();
        const signal = this.#abortController.signal;
        this.latestInput = input;
        try {
          const fileConfig = readConfig(
            {
              script: input.entrypoint,
              config: input.config,
              env: input.env,
              "dispatch-namespace": void 0,
              "legacy-env": !input.legacy?.useServiceEnvironments,
              remote: !!input.dev?.remote,
              upstreamProtocol: input.dev?.origin?.secure === void 0 ? void 0 : input.dev?.origin?.secure ? "https" : "http",
              localProtocol: input.dev?.server?.secure === void 0 ? void 0 : input.dev?.server?.secure ? "https" : "http",
              generateTypes: input.dev?.generateTypes
            },
            { useRedirectIfAvailable: true }
          );
          if (!getDisableConfigWatching()) {
            await this.#ensureWatchingConfig(fileConfig.configPath);
          }
          const { config: resolvedConfig, printCurrentBindings } = await resolveConfig(fileConfig, input, this.latestConfig?.name);
          if (signal.aborted) {
            return;
          }
          this.latestConfig = resolvedConfig;
          this.#printCurrentBindings = printCurrentBindings;
          this.emitConfigUpdateEvent(resolvedConfig);
          return this.latestConfig;
        } catch (err) {
          logger.debug("Error updating config", err.stack);
          if (signal.aborted) {
            logger.debug("Suppressing config error after signal aborted");
            return;
          }
          if (this.#configWatcher?.closed) {
            logger.debug("Suppressing config error after watcher closed");
            return;
          }
          if (throwErrors) {
            throw err;
          } else {
            this.emitErrorEvent({
              type: "error",
              reason: "Error resolving config",
              cause: castErrorCause(err),
              source: "ConfigController",
              data: void 0
            });
          }
        }
      }
      // ******************
      //   Event Handlers
      // ******************
      onDevRegistryUpdate(event) {
        this.#printCurrentBindings?.(event.registry);
      }
      async teardown() {
        logger.debug("ConfigController teardown beginning...");
        await super.teardown();
        this.#abortController?.abort();
        await this.#configWatcher?.close();
        logger.debug("ConfigController teardown complete");
      }
      // *********************
      //   Event Dispatchers
      // *********************
      emitConfigUpdateEvent(config) {
        this.bus.dispatch({ type: "configUpdate", config });
      }
    };
  }
});
var scriptPath, InspectorProxyWorker_default;
var init_InspectorProxyWorker = __esm({
  "embed-worker:/build/wrangler/src/workers-sdk-wrangler-4.82.2/packages/wrangler/templates/startDevWorker/InspectorProxyWorker.ts"() {
    init_import_meta_url();
    scriptPath = path3__namespace.default.resolve(__dirname, "..", "wrangler-dist/InspectorProxyWorker.js");
    InspectorProxyWorker_default = scriptPath;
  }
});
var scriptPath2, ProxyWorker_default;
var init_ProxyWorker = __esm({
  "embed-worker:/build/wrangler/src/workers-sdk-wrangler-4.82.2/packages/wrangler/templates/startDevWorker/ProxyWorker.ts"() {
    init_import_meta_url();
    scriptPath2 = path3__namespace.default.resolve(__dirname, "..", "wrangler-dist/ProxyWorker.js");
    ProxyWorker_default = scriptPath2;
  }
});
function isAllowedSourcePath(bundle, filePath) {
  const allowed = getBundleReferencedPaths(bundle);
  return allowed.sourcePaths.has(filePath);
}
function isAllowedSourceMapPath(bundle, filePath) {
  const allowed = getBundleReferencedPaths(bundle);
  return allowed.sourceMapPaths.has(filePath);
}
function getBundleReferencedPaths(bundle) {
  let allowed = bundleReferencedPathsCache.get(bundle);
  if (allowed !== void 0) {
    return allowed;
  }
  allowed = { sourcePaths: /* @__PURE__ */ new Set(), sourceMapPaths: /* @__PURE__ */ new Set() };
  bundleReferencedPathsCache.set(bundle, allowed);
  for (const sourcePath of getBundleSourcePaths(bundle)) {
    const sourceMappingURL = maybeGetSourceMappingURL(sourcePath);
    if (sourceMappingURL === void 0) {
      continue;
    }
    const sourceMappingPath = Url.fileURLToPath(sourceMappingURL);
    allowed.sourceMapPaths.add(sourceMappingPath);
    const sourceMapData = fs29__namespace.default.readFileSync(sourceMappingPath, "utf8");
    const sourceMap = JSON.parse(sourceMapData);
    const sourceRoot = sourceMap.sourceRoot ?? "";
    for (const source of sourceMap.sources) {
      const sourceURL = new URL(
        path3__namespace.default.posix.join(sourceRoot, source),
        sourceMappingURL
      );
      allowed.sourcePaths.add(Url.fileURLToPath(sourceURL));
    }
  }
  return allowed;
}
function* getBundleSourcePaths(bundle) {
  yield bundle.path;
  for (const module2 of bundle.modules) {
    if (module2.type !== "esm" && module2.type !== "commonjs") {
      continue;
    }
    if (module2.filePath === void 0) {
      continue;
    }
    yield module2.filePath;
  }
}
function maybeGetSourceMappingURL(sourcePath) {
  const source = fs29__namespace.default.readFileSync(sourcePath, "utf8");
  const sourceMappingURLIndex = source.lastIndexOf("//# sourceMappingURL=");
  if (sourceMappingURLIndex === -1) {
    return;
  }
  const sourceMappingURLMatch = source.substring(sourceMappingURLIndex).match(/^\/\/# sourceMappingURL=(.+)/);
  assert53__default.default(sourceMappingURLMatch !== null);
  const sourceMappingURLSpecifier = sourceMappingURLMatch[1];
  const sourceURL = Url.pathToFileURL(sourcePath);
  try {
    const sourceMappingURL = new URL(sourceMappingURLSpecifier, sourceURL);
    if (sourceMappingURL.protocol !== "file:") {
      return;
    }
    return sourceMappingURL;
  } catch {
  }
}
var bundleReferencedPathsCache;
var init_bundle_allowed_paths = __esm({
  "src/api/startDevWorker/bundle-allowed-paths.ts"() {
    init_import_meta_url();
    __name(isAllowedSourcePath, "isAllowedSourcePath");
    __name(isAllowedSourceMapPath, "isAllowedSourceMapPath");
    bundleReferencedPathsCache = /* @__PURE__ */ new WeakMap();
    __name(getBundleReferencedPaths, "getBundleReferencedPaths");
    __name(getBundleSourcePaths, "getBundleSourcePaths");
    __name(maybeGetSourceMappingURL, "maybeGetSourceMappingURL");
  }
});
function logConsoleMessage(evt) {
  const args = [];
  for (const ro of evt.args) {
    switch (ro.type) {
      case "string":
      case "number":
      case "boolean":
      case "undefined":
      case "symbol":
      case "bigint":
        if (typeof ro.value === "string") {
          ro.value = getSourceMappedString(ro.value);
        }
        args.push(ro.value);
        break;
      case "function":
        args.push(`[Function: ${ro.description ?? "<no-description>"}]`);
        break;
      case "object":
        if (!ro.preview) {
          args.push(
            ro.subtype === "null" ? "null" : ro.description ?? "<no-description>"
          );
        } else {
          args.push(ro.preview.description ?? "<no-description>");
          switch (ro.preview.subtype) {
            case "array":
              args.push(
                "[ " + ro.preview.properties.map(({ value }) => {
                  return value;
                }).join(", ") + (ro.preview.overflow ? "..." : "") + " ]"
              );
              break;
            case "weakmap":
            case "map":
              if (ro.preview.entries === void 0) {
                args.push("{}");
              } else {
                args.push(
                  "{\n" + ro.preview.entries.map(({ key, value }) => {
                    return `  ${key?.description ?? "<unknown>"} => ${value.description}`;
                  }).join(",\n") + (ro.preview.overflow ? "\n  ..." : "") + "\n}"
                );
              }
              break;
            case "weakset":
            case "set":
              if (ro.preview.entries === void 0) {
                args.push("{}");
              } else {
                args.push(
                  "{ " + ro.preview.entries.map(({ value }) => {
                    return `${value.description}`;
                  }).join(", ") + (ro.preview.overflow ? ", ..." : "") + " }"
                );
              }
              break;
            case "regexp":
              break;
            case "date":
              break;
            case "generator":
              args.push(ro.preview.properties[0].value || "");
              break;
            case "promise":
              if (ro.preview.properties[0].value === "pending") {
                args.push(`{<${ro.preview.properties[0].value}>}`);
              } else {
                args.push(
                  `{<${ro.preview.properties[0].value}>: ${ro.preview.properties[1].value}}`
                );
              }
              break;
            case "node":
            case "iterator":
            case "proxy":
            case "typedarray":
            case "arraybuffer":
            case "dataview":
            case "webassemblymemory":
            case "wasmvalue":
              break;
            case "error":
            default:
              args.push(
                "{\n" + ro.preview.properties.map(({ name: name2, value }) => {
                  return `  ${name2}: ${value}`;
                }).join(",\n") + (ro.preview.overflow ? "\n  ..." : "") + "\n}"
              );
          }
        }
        break;
      default:
        args.push(ro.description || ro.unserializableValue || "\u{1F98B}");
        break;
    }
  }
  const method = mapConsoleAPIMessageTypeToConsoleMethod[evt.type];
  if (method in console) {
    switch (method) {
      case "dir":
        logger.console(
          "dir",
          ...args
        );
        break;
      case "table":
        logger.table(args.map((value) => ({ value })));
        break;
      default:
        logger.console(method, ...args);
        break;
    }
  } else {
    logger.warn(`Unsupported console method: ${method}`);
    logger.warn("console event:", evt);
  }
}
function maybeHandleNetworkLoadResource(url4, bundle, tmpDir) {
  if (typeof url4 === "string") {
    url4 = new Url.URL(url4);
  }
  if (url4.protocol !== "file:") {
    return;
  }
  const filePath = Url.fileURLToPath(url4);
  if (isAllowedSourceMapPath(bundle, filePath)) {
    const sourceMap = JSON.parse(fs29.readFileSync(filePath, "utf-8"));
    sourceMap.x_google_ignoreList = sourceMap.sources.map((source, i7) => {
      if (source.includes("wrangler/templates")) {
        return i7;
      }
      if (tmpDir !== void 0 && path3__namespace.default.resolve(sourceMap?.sourceRoot ?? "", source).includes(tmpDir)) {
        return i7;
      }
    }).filter((i7) => i7 !== void 0);
    return JSON.stringify(sourceMap);
  }
  if (isAllowedSourcePath(bundle, filePath)) {
    return fs29.readFileSync(filePath, "utf-8");
  }
}
var mapConsoleAPIMessageTypeToConsoleMethod, openInspector;
var init_inspect2 = __esm({
  "src/dev/inspect.ts"() {
    init_import_meta_url();
    init_open();
    init_bundle_allowed_paths();
    init_logger();
    init_sourcemap();
    mapConsoleAPIMessageTypeToConsoleMethod = {
      log: "log",
      debug: "debug",
      info: "info",
      warning: "warn",
      error: "error",
      dir: "dir",
      dirxml: "dirxml",
      table: "table",
      trace: "trace",
      clear: "clear",
      count: "count",
      assert: "assert",
      profile: "profile",
      profileEnd: "profileEnd",
      timeEnd: "timeEnd",
      startGroup: "group",
      startGroupCollapsed: "groupCollapsed",
      endGroup: "groupEnd"
    };
    __name(logConsoleMessage, "logConsoleMessage");
    __name(maybeHandleNetworkLoadResource, "maybeHandleNetworkLoadResource");
    openInspector = /* @__PURE__ */ __name(async (inspectorPort, worker) => {
      const query = new URLSearchParams();
      query.set("theme", "systemPreferred");
      query.set("ws", `127.0.0.1:${inspectorPort}/ws`);
      if (worker) {
        query.set("domain", worker);
      }
      query.set("debugger", "true");
      const url4 = `https://devtools.devprod.cloudflare.dev/js_app?${query.toString()}`;
      const errorMessage = "Failed to open inspector.\nInspector depends on having a Chromium-based browser installed, maybe you need to install one?";
      let braveBrowser;
      switch (process.platform) {
        case "darwin":
        case "win32":
          braveBrowser = "Brave";
          break;
        default:
          braveBrowser = "brave";
      }
      const childProcess5 = await open_default(url4, {
        app: [
          {
            name: apps.chrome
          },
          {
            name: braveBrowser
          },
          {
            name: apps.edge
          },
          {
            name: apps.firefox
          }
        ]
      });
      childProcess5.on("error", () => {
        logger.warn(errorMessage);
      });
    }, "openInspector");
  }
});
function validateHttpsOptions(customHttpsKeyPath = getHttpsKeyPathFromEnv(), customHttpsCertPath = getHttpsCertPathFromEnv()) {
  if (customHttpsKeyPath !== void 0 || customHttpsCertPath !== void 0) {
    if (customHttpsKeyPath === void 0 || customHttpsCertPath === void 0) {
      throw new UserError(
        "Must specify both certificate path and key path to use a Custom Certificate."
      );
    }
    if (!fs29__namespace.existsSync(customHttpsKeyPath)) {
      throw new UserError(
        "Missing Custom Certificate Key at " + customHttpsKeyPath
      );
    }
    if (!fs29__namespace.existsSync(customHttpsCertPath)) {
      throw new UserError(
        "Missing Custom Certificate File at " + customHttpsCertPath
      );
    }
    logger.log("Using custom certificate at ", customHttpsKeyPath);
    return {
      key: fs29__namespace.readFileSync(customHttpsKeyPath, "utf8"),
      cert: fs29__namespace.readFileSync(customHttpsCertPath, "utf8")
    };
  }
}
var getHttpsKeyPathFromEnv, getHttpsCertPathFromEnv;
var init_https_options = __esm({
  "src/https-options.ts"() {
    init_import_meta_url();
    init_dist();
    init_logger();
    getHttpsKeyPathFromEnv = getEnvironmentVariableFactory({
      variableName: "WRANGLER_HTTPS_KEY_PATH"
    });
    getHttpsCertPathFromEnv = getEnvironmentVariableFactory({
      variableName: "WRANGLER_HTTPS_CERT_PATH"
    });
    __name(validateHttpsOptions, "validateHttpsOptions");
  }
});
function deepEquality(a7, b11) {
  return JSON.stringify(a7) === JSON.stringify(b11);
}
function didMiniflareOptionsChange(prev, next) {
  if (prev === void 0) {
    return false;
  }
  return !deepEquality(prev, next);
}
var ProxyController, ProxyControllerLogger;
var init_ProxyController = __esm({
  "src/api/startDevWorker/ProxyController.ts"() {
    init_import_meta_url();
    init_dist();
    init_InspectorProxyWorker();
    init_ProxyWorker();
    init_wrapper();
    init_package();
    init_inspect2();
    init_miniflare();
    init_https_options();
    init_logger();
    init_sourcemap();
    init_BaseController();
    init_events();
    init_utils2();
    ProxyController = class extends Controller {
      static {
        __name(this, "ProxyController");
      }
      ready = createDeferred();
      localServerReady = createDeferred();
      proxyWorker;
      proxyWorkerOptions;
      inspectorProxyWorkerWebSocket;
      latestConfig;
      latestBundle;
      secret = crypto2.randomUUID();
      createProxyWorker() {
        if (this._torndown) {
          return;
        }
        assert53__default.default(this.latestConfig !== void 0);
        const cert = this.latestConfig.dev?.server?.secure || this.inspectorEnabled && this.latestConfig.dev?.inspector && this.latestConfig.dev?.inspector?.secure ? validateHttpsOptions(
          this.latestConfig.dev.server?.httpsKeyPath,
          this.latestConfig.dev.server?.httpsCertPath
        ) : void 0;
        const proxyWorkerOptions = {
          host: this.latestConfig.dev?.server?.hostname,
          port: this.latestConfig.dev?.server?.port,
          https: this.latestConfig.dev?.server?.secure,
          httpsCert: cert?.cert,
          httpsKey: cert?.key,
          stripDisablePrettyError: false,
          unsafeLocalExplorer: false,
          workers: [
            {
              name: "ProxyWorker",
              compatibilityDate: "2023-12-18",
              compatibilityFlags: ["nodejs_compat"],
              modulesRoot: path3__namespace.default.dirname(ProxyWorker_default),
              modules: [{ type: "ESModule", path: ProxyWorker_default }],
              durableObjects: {
                DURABLE_OBJECT: {
                  className: "ProxyWorker",
                  unsafePreventEviction: true
                }
              },
              // Miniflare will strip CF-Connecting-IP from outgoing fetches from a Worker (to fix https://github.com/cloudflare/workers-sdk/issues/7924)
              // However, the proxy worker only makes outgoing requests to the user Worker Miniflare instance, which _should_ receive CF-Connecting-IP
              stripCfConnectingIp: false,
              serviceBindings: {
                PROXY_CONTROLLER: /* @__PURE__ */ __name(async (req) => {
                  const message = await req.json();
                  this.onProxyWorkerMessage(message);
                  return new miniflare.Response(null, { status: 204 });
                }, "PROXY_CONTROLLER")
              },
              bindings: {
                PROXY_CONTROLLER_AUTH_SECRET: this.secret
              },
              // no need to use file-system, so don't
              cache: false,
              unsafeEphemeralDurableObjects: true
            }
          ],
          verbose: logger.loggerLevel === "debug",
          // log requests into the ProxyWorker (for local + remote mode)
          log: new ProxyControllerLogger(
            castLogLevel(logger.loggerLevel),
            {
              prefix: (
                // if debugging, log requests with specic ProxyWorker prefix
                logger.loggerLevel === "debug" ? "wrangler-ProxyWorker" : "wrangler"
              )
            },
            this.localServerReady.promise
          ),
          handleStructuredLogs,
          liveReload: false
        };
        if (this.inspectorEnabled) {
          assert53__default.default(this.latestConfig.dev?.inspector);
          proxyWorkerOptions.workers.push({
            name: "InspectorProxyWorker",
            compatibilityDate: "2023-12-18",
            compatibilityFlags: [
              "nodejs_compat",
              "increase_websocket_message_size"
            ],
            modulesRoot: path3__namespace.default.dirname(InspectorProxyWorker_default),
            modules: [{ type: "ESModule", path: InspectorProxyWorker_default }],
            durableObjects: {
              DURABLE_OBJECT: {
                className: "InspectorProxyWorker",
                unsafePreventEviction: true
              }
            },
            serviceBindings: {
              PROXY_CONTROLLER: /* @__PURE__ */ __name(async (req) => {
                const body = await req.json();
                return this.onInspectorProxyWorkerRequest(body);
              }, "PROXY_CONTROLLER")
            },
            bindings: {
              PROXY_CONTROLLER_AUTH_SECRET: this.secret,
              WRANGLER_VERSION: version
            },
            unsafeDirectSockets: [
              {
                host: this.latestConfig.dev?.inspector?.hostname,
                port: this.latestConfig.dev?.inspector?.port ?? 0
              }
            ],
            // no need to use file-system, so don't
            cache: false,
            unsafeEphemeralDurableObjects: true
          });
        }
        const proxyWorkerOptionsChanged = didMiniflareOptionsChange(
          this.proxyWorkerOptions,
          proxyWorkerOptions
        );
        const willInstantiateMiniflareInstance = !this.proxyWorker || proxyWorkerOptionsChanged;
        this.proxyWorker ??= new miniflare.Miniflare(proxyWorkerOptions);
        this.proxyWorkerOptions = proxyWorkerOptions;
        if (proxyWorkerOptionsChanged) {
          logger.debug("ProxyWorker miniflare options changed, reinstantiating...");
          void this.proxyWorker.setOptions(proxyWorkerOptions).catch((error2) => {
            this.emitErrorEvent("Failed to start ProxyWorker", error2);
          });
          this.ready = createDeferred(this.ready);
        }
        const { proxyWorker } = this;
        if (willInstantiateMiniflareInstance) {
          void Promise.all([
            proxyWorker.ready,
            !this.inspectorEnabled ? Promise.resolve(void 0) : proxyWorker.unsafeGetDirectURL("InspectorProxyWorker")
          ]).then(([url4, inspectorUrl]) => {
            if (!this.inspectorEnabled) {
              return [url4, void 0];
            }
            return this.reconnectInspectorProxyWorker().then(() => [
              url4,
              inspectorUrl
            ]);
          }).then(([url4, inspectorUrl]) => {
            assert53__default.default(url4);
            this.emitReadyEvent(proxyWorker, url4, inspectorUrl);
          }).catch((error2) => {
            if (this._torndown) {
              return;
            }
            this.emitErrorEvent(
              "Failed to start ProxyWorker or InspectorProxyWorker",
              error2
            );
          });
        }
      }
      async reconnectInspectorProxyWorker() {
        if (this._torndown) {
          return;
        }
        assert53__default.default(
          this.latestConfig?.dev.inspector !== false,
          "Trying to reconnect with inspector proxy worker when inspector is disabled"
        );
        const existingWebSocket = await this.inspectorProxyWorkerWebSocket?.promise;
        if (existingWebSocket?.readyState === wrapper_default.OPEN) {
          return existingWebSocket;
        }
        this.inspectorProxyWorkerWebSocket = createDeferred();
        let webSocket = null;
        try {
          assert53__default.default(this.proxyWorker);
          const inspectorProxyWorkerUrl = await this.proxyWorker.unsafeGetDirectURL(
            "InspectorProxyWorker"
          );
          inspectorProxyWorkerUrl.pathname = "/cdn-cgi/InspectorProxyWorker/websocket";
          webSocket = new wrapper_default(inspectorProxyWorkerUrl, {
            headers: { Authorization: this.secret },
            // If compression is on, we sometimes get race conditions with MockHttpSocket closing down
            // while the deflate extension is still trying to send decompressed chunks.
            perMessageDeflate: false
          });
        } catch (cause) {
          if (this._torndown) {
            return;
          }
          const error2 = castErrorCause(cause);
          this.inspectorProxyWorkerWebSocket?.reject(error2);
          this.emitErrorEvent("Could not connect to InspectorProxyWorker", error2);
          return;
        }
        assert53__default.default(
          webSocket,
          "Expected webSocket on response from inspectorProxyWorker"
        );
        webSocket.addEventListener("message", (event) => {
          assert53__default.default(typeof event.data === "string");
          this.onInspectorProxyWorkerMessage(JSON.parse(event.data));
        });
        webSocket.addEventListener("close", () => {
        });
        webSocket.addEventListener("error", () => {
          if (this._torndown) {
            return;
          }
          if (this.latestConfig?.dev.inspector !== false) {
            void this.reconnectInspectorProxyWorker();
          }
        });
        await events__default.default.once(webSocket, "open");
        this.inspectorProxyWorkerWebSocket?.resolve(webSocket);
        return webSocket;
      }
      runtimeMessageMutex = new miniflare.Mutex();
      async sendMessageToProxyWorker(message, retries = 3) {
        if (this._torndown) {
          return;
        }
        try {
          await this.runtimeMessageMutex.runWith(async () => {
            const { proxyWorker } = await this.ready.promise;
            const ready = await proxyWorker.ready.catch(() => void 0);
            if (!ready) {
              return;
            }
            return proxyWorker.dispatchFetch(
              `http://dummy/cdn-cgi/ProxyWorker/${message.type}`,
              {
                headers: { Authorization: this.secret },
                cf: { hostMetadata: message }
              }
            );
          });
        } catch (cause) {
          if (this._torndown) {
            return;
          }
          const error2 = castErrorCause(cause);
          if (retries > 0) {
            return this.sendMessageToProxyWorker(message, retries - 1);
          }
          this.emitErrorEvent(
            `Failed to send message to ProxyWorker: ${JSON.stringify(message)}`,
            error2
          );
        }
      }
      async sendMessageToInspectorProxyWorker(message, retries = 3) {
        if (this._torndown) {
          return;
        }
        assert53__default.default(
          this.latestConfig?.dev.inspector !== false,
          "Trying to send message to inspector proxy worker when inspector is disabled"
        );
        try {
          const websocket = await this.reconnectInspectorProxyWorker();
          assert53__default.default(websocket);
          websocket.send(JSON.stringify(message));
        } catch (cause) {
          if (this._torndown) {
            return;
          }
          const error2 = castErrorCause(cause);
          if (retries > 0) {
            return this.sendMessageToInspectorProxyWorker(message, retries - 1);
          }
          this.emitErrorEvent(
            `Failed to send message to InspectorProxyWorker: ${JSON.stringify(
              message
            )}`,
            error2
          );
        }
      }
      get inspectorEnabled() {
        if (this.latestConfig?.dev.remote) {
          return false;
        }
        const inVscodeJsDebugTerminal = !!process.env.VSCODE_INSPECTOR_OPTIONS;
        return this.latestConfig?.dev.inspector !== false && !inVscodeJsDebugTerminal;
      }
      // ******************
      //   Event Handlers
      // ******************
      onConfigUpdate(data) {
        this.latestConfig = data.config;
        this.createProxyWorker();
        void this.sendMessageToProxyWorker({ type: "pause" });
      }
      onBundleStart(data) {
        this.latestConfig = data.config;
        void this.sendMessageToProxyWorker({ type: "pause" });
      }
      onReloadStart(data) {
        this.latestConfig = data.config;
        void this.sendMessageToProxyWorker({ type: "pause" });
        if (this.inspectorEnabled) {
          void this.sendMessageToInspectorProxyWorker({ type: "reloadStart" });
        }
      }
      onReloadComplete(data) {
        this.localServerReady.resolve();
        this.latestConfig = data.config;
        this.latestBundle = data.bundle;
        void this.sendMessageToProxyWorker({
          type: "play",
          proxyData: data.proxyData
        });
        if (this.inspectorEnabled) {
          void this.sendMessageToInspectorProxyWorker({
            type: "reloadComplete",
            proxyData: data.proxyData
          });
        }
      }
      onProxyWorkerMessage(message) {
        switch (message.type) {
          case "previewTokenExpired":
            this.emitPreviewTokenExpiredEvent(message.proxyData);
            break;
          case "error":
            this.emitErrorEvent("Error inside ProxyWorker", message.error);
            break;
          case "debug-log":
            logger.debug("[ProxyWorker]", ...message.args);
            break;
        }
      }
      onInspectorProxyWorkerMessage(message) {
        assert53__default.default(
          this.latestConfig?.dev.inspector !== false,
          "Trying to handle inspector message when inspector is disabled"
        );
        switch (message.method) {
          case "Runtime.consoleAPICalled": {
            if (this._torndown) {
              return;
            }
            logConsoleMessage(message.params);
            break;
          }
          case "Runtime.exceptionThrown": {
            if (this._torndown) {
              return;
            }
            const stack = getSourceMappedStack(message.params.exceptionDetails);
            logger.error(message.params.exceptionDetails.text, stack);
            break;
          }
        }
      }
      async onInspectorProxyWorkerRequest(message) {
        assert53__default.default(
          this.latestConfig?.dev.inspector !== false,
          "Trying to handle inspector request when inspector is disabled"
        );
        switch (message.type) {
          case "runtime-websocket-error":
            logger.debug(
              "[InspectorProxyWorker] 'runtime websocket' error",
              message.error
            );
            break;
          case "error":
            this.emitErrorEvent("Error inside InspectorProxyWorker", message.error);
            break;
          case "debug-log":
            if (this._torndown) {
              break;
            }
            logger.debug("[InspectorProxyWorker]", ...message.args);
            break;
          case "load-network-resource": {
            assert53__default.default(this.latestConfig !== void 0);
            assert53__default.default(this.latestBundle !== void 0);
            let maybeContents;
            if (message.url.startsWith("wrangler-file:")) {
              maybeContents = maybeHandleNetworkLoadResource(
                message.url.replace("wrangler-file:", "file:"),
                this.latestBundle,
                this.latestBundle.sourceMapMetadata?.tmpDir
              );
            }
            if (maybeContents === void 0) {
              return new miniflare.Response(null, { status: 404 });
            }
            return new miniflare.Response(maybeContents);
          }
          default:
            return new miniflare.Response(null, { status: 404 });
        }
        return new miniflare.Response(null, { status: 204 });
      }
      _torndown = false;
      async teardown() {
        await super.teardown();
        logger.debug("ProxyController teardown beginning...");
        this._torndown = true;
        const { proxyWorker } = this;
        this.proxyWorker = void 0;
        await Promise.all([
          proxyWorker?.dispose(),
          this.inspectorProxyWorkerWebSocket?.promise.then((ws) => ws.close()).catch(() => {
          })
        ]);
        logger.debug("ProxyController teardown complete");
      }
      // *********************
      //   Event Dispatchers
      // *********************
      emitReadyEvent(proxyWorker, url4, inspectorUrl) {
        const data = {
          type: "ready",
          proxyWorker,
          url: url4,
          inspectorUrl
        };
        this.ready.resolve(data);
      }
      emitPreviewTokenExpiredEvent(proxyData) {
        this.bus.dispatch({
          type: "previewTokenExpired",
          proxyData
        });
      }
      emitErrorEvent(data, cause) {
        if (typeof data === "string") {
          data = {
            type: "error",
            source: "ProxyController",
            cause: castErrorCause(cause),
            reason: data,
            data: {
              config: this.latestConfig,
              bundle: this.latestBundle
            }
          };
        }
        super.emitErrorEvent(data);
      }
    };
    ProxyControllerLogger = class extends WranglerLog {
      constructor(level, opts, localServerReady) {
        super(level, opts);
        this.localServerReady = localServerReady;
      }
      static {
        __name(this, "ProxyControllerLogger");
      }
      logReady(message) {
        this.localServerReady.then(() => super.logReady(message)).catch(() => {
        });
      }
      log(message) {
        if (message.includes("/cdn-cgi/") && this.level < miniflare.LogLevel.DEBUG) {
          return;
        }
        super.log(message);
      }
    };
    __name(deepEquality, "deepEquality");
    __name(didMiniflareOptionsChange, "didMiniflareOptionsChange");
  }
});
function withTimeout(signal) {
  return AbortSignal.any([signal, AbortSignal.timeout(PREVIEW_API_TIMEOUT_MS)]);
}
function switchHost(originalUrl, host, zonePreview) {
  const url4 = new Url.URL(originalUrl);
  url4.hostname = zonePreview ? host ?? url4.hostname : url4.hostname;
  return url4;
}
async function tryExpandToken(exchangeUrl, ctx, abortSignal) {
  try {
    const switchedExchangeUrl = switchHost(exchangeUrl, ctx.host, !!ctx.zone);
    const accessHeaders = await getAccessHeaders(switchedExchangeUrl.hostname);
    const headers = { ...accessHeaders };
    logger.debugWithSanitization(
      "-- START EXCHANGE API REQUEST:",
      ` GET ${switchedExchangeUrl.href}`
    );
    logger.debug("-- END EXCHANGE API REQUEST");
    const exchangeResponse = await (0, import_undici28.fetch)(switchedExchangeUrl, {
      signal: abortSignal,
      headers
    });
    const bodyText = await exchangeResponse.text();
    logger.debug(
      "-- START EXCHANGE API RESPONSE:",
      exchangeResponse.statusText,
      exchangeResponse.status
    );
    logger.debug("HEADERS:", JSON.stringify(exchangeResponse.headers, null, 2));
    logger.debugWithSanitization("RESPONSE:", bodyText);
    logger.debug("-- END EXCHANGE API RESPONSE");
    if (!exchangeResponse.ok) {
      return null;
    }
    const body = parseJSON(bodyText);
    if (typeof body?.token !== "string") {
      return null;
    }
    return body.token;
  } catch (e10) {
    if (e10 instanceof Error && e10.name === "AbortError") {
      throw e10;
    }
    return null;
  }
}
async function createPreviewSession(complianceConfig, account, ctx, abortSignal, name2) {
  const { accountId, apiToken } = account;
  const initUrl = ctx.zone ? `/zones/${ctx.zone}/workers/edge-preview` : `/accounts/${accountId}/workers/subdomain/edge-preview`;
  const { token, exchange_url } = await fetchResult(
    complianceConfig,
    initUrl,
    void 0,
    void 0,
    withTimeout(abortSignal),
    apiToken
  );
  const previewSessionToken = exchange_url ? await tryExpandToken(exchange_url, ctx, withTimeout(abortSignal)) ?? token : token;
  try {
    let host = ctx.host;
    if (!host) {
      const subdomain = await getWorkersDevSubdomain(
        complianceConfig,
        account.accountId,
        void 0,
        apiToken,
        withTimeout(abortSignal)
      );
      host = `${name2 ?? crypto2__default.default.randomUUID()}.${subdomain}`;
    }
    return {
      value: previewSessionToken,
      host,
      name: name2
    };
  } catch (e10) {
    if (!(e10 instanceof ParseError)) {
      throw e10;
    } else {
      throw new UserError(
        `Could not create remote preview session on ${ctx.zone ? ` host \`${ctx.host}\` on zone \`${ctx.zone}\`` : `your account`}.`
      );
    }
  }
}
async function createPreviewToken(complianceConfig, account, worker, ctx, session, abortSignal, minimal_mode) {
  const { value, host } = session;
  const { accountId } = account;
  const url4 = ctx.env && ctx.useServiceEnvironments ? `/accounts/${accountId}/workers/services/${worker.name}/environments/${ctx.env}/edge-preview` : `/accounts/${accountId}/workers/scripts/${worker.name}/edge-preview`;
  const mode = ctx.zone ? {
    routes: ctx.routes && ctx.routes.length > 0 ? (
      // extract all the route patterns
      ctx.routes.map((route) => {
        if (typeof route === "string") {
          return route;
        }
        if (route.custom_domain) {
          return `${route.pattern}/*`;
        }
        return route.pattern;
      })
    ) : (
      // if there aren't any patterns, then just match on all routes
      ["*/*"]
    ),
    minimal_mode
  } : { workers_dev: true, minimal_mode };
  const formData = createWorkerUploadForm(worker, worker.bindings);
  formData.set("wrangler-session-config", JSON.stringify(mode));
  const { preview_token, tail_url } = await fetchResult(
    complianceConfig,
    url4,
    {
      method: "POST",
      body: formData,
      headers: {
        "cf-preview-upload-config-token": value
      }
    },
    void 0,
    withTimeout(abortSignal)
  );
  return {
    value: preview_token,
    host,
    tailUrl: tail_url
  };
}
async function createWorkerPreview(complianceConfig, init4, account, ctx, session, abortSignal, minimal_mode) {
  const token = await createPreviewToken(
    complianceConfig,
    account,
    init4,
    ctx,
    session,
    abortSignal,
    minimal_mode
  );
  return token;
}
var import_undici28, PREVIEW_API_TIMEOUT_MS;
var init_create_worker_preview = __esm({
  "src/dev/create-worker-preview.ts"() {
    init_import_meta_url();
    init_dist();
    import_undici28 = __toESM(require_undici());
    init_cfetch();
    init_create_worker_upload_form();
    init_logger();
    init_routes6();
    init_access();
    PREVIEW_API_TIMEOUT_MS = 3e4;
    __name(withTimeout, "withTimeout");
    __name(switchHost, "switchHost");
    __name(tryExpandToken, "tryExpandToken");
    __name(createPreviewSession, "createPreviewSession");
    __name(createPreviewToken, "createPreviewToken");
    __name(createWorkerPreview, "createWorkerPreview");
  }
});

// src/utils/isAbortError.ts
function isAbortError(err) {
  const legacyAbortErroCheck = err.code == "ABORT_ERR";
  const abortErrorCheck = err instanceof Error && err.name == "AbortError";
  return legacyAbortErroCheck || abortErrorCheck;
}
var init_isAbortError = __esm({
  "src/utils/isAbortError.ts"() {
    init_import_meta_url();
    __name(isAbortError, "isAbortError");
  }
});
function handlePreviewSessionUploadError(err, accountId) {
  assert53__default.default(err && typeof err === "object");
  if (!isAbortError(err)) {
    if ("code" in err && err.code === 10049) {
      logger.log("Preview token expired, fetching a new one");
      return true;
    } else if (!handleUserFriendlyError(err, accountId)) {
      logger.error("Error on remote worker:", err);
    }
  }
  return false;
}
function handlePreviewSessionCreationError(err, accountId) {
  assert53__default.default(err && typeof err === "object");
  if ("code" in err && err.code === 10063) {
    logger.error(
      `You need to register a workers.dev subdomain before running the dev command in remote mode. You can either enable local mode by pressing l, or register a workers.dev subdomain here: https://dash.cloudflare.com/${accountId}/workers/onboarding`
    );
  } else if ("cause" in err && err.cause?.code === "ENOTFOUND") {
    logger.error(
      `Could not access \`${err.cause.hostname}\`. Make sure the domain is set up to be proxied by Cloudflare.
For more details, refer to https://developers.cloudflare.com/workers/configuration/routing/routes/#set-up-a-route`
    );
  } else if (err instanceof UserError) {
    logger.error(err.message);
  } else if (!isAbortError(err)) {
    logger.error("Error while creating remote dev session:", err);
  }
}
async function createRemoteWorkerInit(props) {
  const { entrypointSource: content, modules } = withSourceURLs(
    props.bundle.path,
    props.bundle.entrypointSource,
    props.modules
  );
  void printBundleSize(
    {
      name: path3__namespace.default.basename(props.bundle.path),
      content
    },
    props.modules
  );
  const workersSitesAssets = await syncWorkersSite(
    props.complianceConfig,
    props.accountId,
    // When we're using the newer service environments, we wouldn't
    // have added the env name on to the script name. However, we must
    // include it in the kv namespace name regardless (since there's no
    // concept of service environments for kv namespaces yet).
    props.name + (props.useServiceEnvironments && props.env ? `-${props.env}` : ""),
    props.isWorkersSite ? props.legacyAssetPaths : void 0,
    true,
    false,
    void 0
  );
  if (workersSitesAssets.manifest) {
    modules.push({
      name: "__STATIC_CONTENT_MANIFEST",
      filePath: void 0,
      content: JSON.stringify(workersSitesAssets.manifest),
      type: "text"
    });
  }
  const assetsJwt = props.assets ? await syncAssets(
    props.complianceConfig,
    props.accountId,
    props.assets.directory,
    props.name
  ) : void 0;
  const bindings = { ...props.bindings };
  if (workersSitesAssets.namespace) {
    bindings["__STATIC_CONTENT"] = {
      type: "kv_namespace",
      id: workersSitesAssets.namespace
    };
  }
  if (workersSitesAssets.manifest && props.format === "service-worker") {
    bindings["__STATIC_CONTENT_MANIFEST"] = {
      type: "text_blob",
      source: { contents: "__STATIC_CONTENT_MANIFEST" }
    };
  }
  const init4 = {
    name: props.name,
    main: {
      name: path3__namespace.default.basename(props.bundle.path),
      filePath: props.bundle.path,
      type: getBundleType(props.format, path3__namespace.default.basename(props.bundle.path)),
      content
    },
    modules,
    bindings,
    migrations: void 0,
    // no migrations in dev
    compatibility_date: props.compatibilityDate,
    compatibility_flags: props.compatibilityFlags,
    keepVars: true,
    keepSecrets: true,
    logpush: false,
    sourceMaps: void 0,
    containers: void 0,
    // Containers are not supported in remote dev mode
    assets: props.assets && assetsJwt ? {
      jwt: assetsJwt,
      routerConfig: props.assets.routerConfig,
      assetConfig: props.assets.assetConfig,
      _redirects: props.assets._redirects,
      _headers: props.assets._headers,
      run_worker_first: props.assets.run_worker_first
    } : void 0,
    placement: void 0,
    // no placement in dev
    tail_consumers: void 0,
    streaming_tail_consumers: void 0,
    limits: void 0,
    // no limits in preview - not supported yet but can be added
    observability: void 0,
    // no observability in dev,
    cache: void 0
    // no cache in dev
  };
  return init4;
}
async function getWorkerAccountAndContext(props) {
  const workerAccount = {
    accountId: props.accountId,
    apiToken: props.apiToken ?? requireApiToken()
  };
  const zoneId = await getZoneIdForPreview(props.complianceConfig, {
    host: props.host,
    routes: props.routes,
    accountId: props.accountId
  });
  const workerContext = {
    env: props.env,
    useServiceEnvironments: props.useServiceEnvironments,
    zone: zoneId,
    host: props.host ?? getInferredHost(props.routes, props.configPath),
    routes: props.routes,
    sendMetrics: props.sendMetrics
  };
  return { workerAccount, workerContext };
}
function handleUserFriendlyError(error2, accountId) {
  if (error2 instanceof APIError) {
    switch (error2.code) {
      // code 10021 is a validation error
      case 10021: {
        if (error2.notes[0].text === "binding DB of type d1 must have a valid `id` specified [code: 10021]") {
          logger.error(
            `You must use a real database in the preview_database_id configuration. You can find your databases using 'wrangler d1 list', or read how to develop locally with D1 here: https://developers.cloudflare.com/d1/configuration/local-development`
          );
          return true;
        }
        return false;
      }
      // for error 10063 (workers.dev subdomain required)
      case 10063: {
        const onboardingLink = accountId ? `https://dash.cloudflare.com/${accountId}/workers/onboarding` : "https://dash.cloudflare.com/?to=/:account/workers/onboarding";
        logger.error(
          `You need to register a workers.dev subdomain before running the dev command in remote mode. You can either enable local mode by pressing l, or register a workers.dev subdomain here: ${onboardingLink}`
        );
        return true;
      }
      default: {
        logger.error(error2);
        return true;
      }
    }
  }
}
var init_remote = __esm({
  "src/dev/remote.ts"() {
    init_import_meta_url();
    init_dist();
    init_assets5();
    init_bundle_reporter();
    init_bundle_type();
    init_source_url();
    init_dev2();
    init_logger();
    init_sites2();
    init_user3();
    init_isAbortError();
    init_zones3();
    __name(handlePreviewSessionUploadError, "handlePreviewSessionUploadError");
    __name(handlePreviewSessionCreationError, "handlePreviewSessionCreationError");
    __name(createRemoteWorkerInit, "createRemoteWorkerInit");
    __name(getWorkerAccountAndContext, "getWorkerAccountAndContext");
    __name(handleUserFriendlyError, "handleUserFriendlyError");
  }
});
var RemoteRuntimeController;
var init_RemoteRuntimeController = __esm({
  "src/api/startDevWorker/RemoteRuntimeController.ts"() {
    init_import_meta_url();
    init_dist();
    init_source();
    init_wrapper();
    init_package();
    init_create_worker_preview();
    init_remote();
    init_logger();
    init_createTail();
    init_printing();
    init_access();
    init_retry();
    init_BaseController();
    init_events();
    init_utils2();
    RemoteRuntimeController = class extends RuntimeController {
      static {
        __name(this, "RemoteRuntimeController");
      }
      #abortController = new AbortController();
      #currentBundleId = 0;
      #mutex = new miniflare.Mutex();
      #session;
      #activeTail;
      #latestConfig;
      #latestBundle;
      #latestRoutes;
      async #previewSession(props) {
        try {
          const { workerAccount, workerContext } = await getWorkerAccountAndContext(props);
          return await retryOnAPIFailure(
            () => createPreviewSession(
              props.complianceConfig,
              workerAccount,
              workerContext,
              this.#abortController.signal,
              props.name
            ),
            void 0,
            void 0,
            this.#abortController.signal
          );
        } catch (err) {
          if (err instanceof Error && err.name == "AbortError") {
            return;
          }
          handlePreviewSessionCreationError(err, props.accountId);
          this.emitErrorEvent({
            type: "error",
            reason: "Failed to create a preview token",
            cause: castErrorCause(err),
            source: "RemoteRuntimeController",
            data: void 0
          });
        }
      }
      async #previewToken(props) {
        if (!this.#session) {
          return;
        }
        const session = this.#session;
        try {
          if (props.bundleId !== this.#currentBundleId) {
            return;
          }
          this.#activeTail?.removeAllListeners("error");
          this.#activeTail?.on("error", () => {
          });
          this.#activeTail?.terminate();
          const { workerAccount, workerContext } = await getWorkerAccountAndContext(
            {
              complianceConfig: props.complianceConfig,
              accountId: props.accountId,
              env: props.env,
              useServiceEnvironments: props.useServiceEnvironments,
              host: props.host,
              routes: props.routes,
              sendMetrics: props.sendMetrics,
              configPath: props.configPath
            }
          );
          if (props.bundleId !== this.#currentBundleId) {
            return;
          }
          const init4 = await createRemoteWorkerInit({
            complianceConfig: props.complianceConfig,
            bundle: props.bundle,
            modules: props.modules,
            accountId: props.accountId,
            name: props.name,
            useServiceEnvironments: props.useServiceEnvironments,
            env: props.env,
            isWorkersSite: props.isWorkersSite,
            assets: props.assets,
            legacyAssetPaths: props.legacyAssetPaths,
            format: props.format,
            bindings: props.bindings,
            compatibilityDate: props.compatibilityDate,
            compatibilityFlags: props.compatibilityFlags
          });
          if (props.bundleId !== this.#currentBundleId) {
            return;
          }
          const workerPreviewToken = await retryOnAPIFailure(
            () => createWorkerPreview(
              props.complianceConfig,
              init4,
              workerAccount,
              workerContext,
              session,
              this.#abortController.signal,
              props.minimal_mode
            ),
            void 0,
            void 0,
            this.#abortController.signal
          );
          if (workerPreviewToken.tailUrl) {
            this.#activeTail = new import_websocket.default(
              workerPreviewToken.tailUrl,
              TRACE_VERSION,
              {
                headers: {
                  "Sec-WebSocket-Protocol": TRACE_VERSION,
                  // needs to be `trace-v1` to be accepted
                  "User-Agent": `wrangler/${version}`
                },
                signal: this.#abortController.signal
              }
            );
            this.#activeTail.on("message", realishPrintLogs);
          }
          return workerPreviewToken;
        } catch (err) {
          if (err instanceof Error && err.name == "AbortError") {
            return;
          }
          const shouldRestartSession = handlePreviewSessionUploadError(
            err,
            props.accountId
          );
          if (shouldRestartSession) {
            this.#session = await this.#previewSession(props);
            return this.#previewToken(props);
          }
          this.emitErrorEvent({
            type: "error",
            reason: "Failed to obtain a preview token",
            cause: castErrorCause(err),
            source: "RemoteRuntimeController",
            data: void 0
          });
        }
      }
      #getPreviewSession(config, auth, routes) {
        return this.#previewSession({
          complianceConfig: { compliance_region: config.complianceRegion },
          accountId: auth.accountId,
          apiToken: auth.apiToken,
          env: config.env,
          useServiceEnvironments: config.legacy?.useServiceEnvironments,
          host: config.dev.origin?.hostname,
          routes,
          sendMetrics: config.sendMetrics,
          configPath: config.config,
          name: config.name
        });
      }
      #extractRoutes(config) {
        return config.triggers?.filter(
          (trigger) => trigger.type === "route"
        ).map((trigger) => {
          const { type: _5, ...route } = trigger;
          if ("custom_domain" in route || "zone_id" in route || "zone_name" in route) {
            return route;
          } else {
            return route.pattern;
          }
        });
      }
      async #updatePreviewToken(config, bundle, auth, routes, bundleId) {
        if (bundleId !== this.#currentBundleId) {
          return;
        }
        const token = await this.#previewToken({
          bundle,
          modules: bundle.modules,
          accountId: auth.accountId,
          complianceConfig: { compliance_region: config.complianceRegion },
          name: config.name,
          useServiceEnvironments: config.legacy?.useServiceEnvironments,
          env: config.env,
          isWorkersSite: config.legacy?.site !== void 0,
          assets: config.assets,
          legacyAssetPaths: config.legacy?.site?.bucket ? {
            baseDirectory: config.legacy?.site?.bucket,
            assetDirectory: "",
            excludePatterns: config.legacy?.site?.exclude ?? [],
            includePatterns: config.legacy?.site?.include ?? []
          } : void 0,
          format: bundle.entry.format,
          bindings: config.bindings,
          compatibilityDate: config.compatibilityDate,
          compatibilityFlags: config.compatibilityFlags,
          routes,
          host: config.dev.origin?.hostname,
          sendMetrics: config.sendMetrics,
          configPath: config.config,
          bundleId,
          minimal_mode: config.dev.remote === "minimal"
        });
        if (bundleId !== this.#currentBundleId || !token) {
          return;
        }
        const accessHeaders = await getAccessHeaders(token.host);
        this.emitReloadCompleteEvent({
          type: "reloadComplete",
          bundle,
          config,
          proxyData: {
            userWorkerUrl: {
              protocol: "https:",
              hostname: token.host,
              port: "443"
            },
            headers: {
              "cf-workers-preview-token": token.value,
              ...accessHeaders,
              "cf-connecting-ip": ""
            },
            liveReload: config.dev.liveReload,
            proxyLogsToController: true
          }
        });
      }
      async #onBundleComplete({ config, bundle }, id) {
        logger.log(source_default.dim("\u2394 Starting remote preview..."));
        try {
          const routes = this.#extractRoutes(config);
          if (!config.dev?.auth) {
            throw new MissingConfigError("config.dev.auth");
          }
          const auth = await unwrapHook(config.dev.auth);
          this.#latestConfig = config;
          this.#latestBundle = bundle;
          this.#latestRoutes = routes;
          if (this.#session) {
            logger.log(source_default.dim("\u2394 Detected changes, restarted server."));
          }
          if (this.#session && config.name !== this.#session.name) {
            this.#session = void 0;
          }
          this.#session ??= await this.#getPreviewSession(config, auth, routes);
          await this.#updatePreviewToken(config, bundle, auth, routes, id);
        } catch (error2) {
          if (error2 instanceof Error && error2.name == "AbortError") {
            return;
          }
          this.emitErrorEvent({
            type: "error",
            reason: "Error reloading remote server",
            cause: castErrorCause(error2),
            source: "RemoteRuntimeController",
            data: void 0
          });
        }
      }
      async #refreshPreviewToken() {
        if (!this.#latestConfig || !this.#latestBundle) {
          logger.warn(
            "Cannot refresh preview token: missing config or bundle data"
          );
          return;
        }
        this.emitReloadStartEvent({
          type: "reloadStart",
          config: this.#latestConfig,
          bundle: this.#latestBundle
        });
        if (!this.#latestConfig.dev?.auth) {
          throw new MissingConfigError("config.dev.auth");
        }
        const auth = await unwrapHook(this.#latestConfig.dev.auth);
        try {
          this.#session = await this.#getPreviewSession(
            this.#latestConfig,
            auth,
            this.#latestRoutes
          );
          await this.#updatePreviewToken(
            this.#latestConfig,
            this.#latestBundle,
            auth,
            this.#latestRoutes,
            this.#currentBundleId
          );
          logger.log(source_default.green("\u2714 Preview token refreshed successfully"));
        } catch (error2) {
          if (error2 instanceof Error && error2.name == "AbortError") {
            return;
          }
          this.emitErrorEvent({
            type: "error",
            reason: "Error refreshing preview token",
            cause: castErrorCause(error2),
            source: "RemoteRuntimeController",
            data: void 0
          });
        }
      }
      // ******************
      //   Event Handlers
      // ******************
      onBundleStart(_5) {
        this.#abortController.abort();
        this.#abortController = new AbortController();
      }
      onBundleComplete(ev) {
        const id = ++this.#currentBundleId;
        if (!ev.config.dev?.remote) {
          void this.#mutex.runWith(() => this.teardown());
          return;
        }
        this.emitReloadStartEvent({
          type: "reloadStart",
          config: ev.config,
          bundle: ev.bundle
        });
        void this.#mutex.runWith(() => this.#onBundleComplete(ev, id));
      }
      onPreviewTokenExpired(_5) {
        logger.log(source_default.dim("\u2394 Preview token expired, refreshing..."));
        void this.#mutex.runWith(() => this.#refreshPreviewToken());
      }
      async teardown() {
        await super.teardown();
        if (this.#session) {
          logger.log(source_default.dim("\u2394 Shutting down remote preview..."));
        }
        logger.debug("RemoteRuntimeController teardown beginning...");
        this.#session = void 0;
        this.#abortController.abort();
        this.#activeTail?.removeAllListeners("error");
        this.#activeTail?.on("error", () => {
        });
        this.#activeTail?.terminate();
        logger.debug("RemoteRuntimeController teardown complete");
      }
      // *********************
      //   Event Dispatchers
      // *********************
      emitReloadStartEvent(data) {
        this.bus.dispatch(data);
      }
      emitReloadCompleteEvent(data) {
        this.bus.dispatch(data);
      }
    };
  }
});
function createWorkerObject(devEnv) {
  return {
    get ready() {
      return devEnv.proxy.ready.promise.then(() => void 0);
    },
    get url() {
      return devEnv.proxy.ready.promise.then((ev) => ev.url);
    },
    get inspectorUrl() {
      return devEnv.proxy.ready.promise.then((ev) => ev.inspectorUrl);
    },
    get config() {
      assert53__default.default(devEnv.config.latestConfig);
      return devEnv.config.latestConfig;
    },
    async setConfig(config, throwErrors) {
      return devEnv.config.set(config, throwErrors);
    },
    patchConfig(config) {
      return devEnv.config.patch(config);
    },
    async fetch(...args) {
      const { proxyWorker } = await devEnv.proxy.ready.promise;
      await devEnv.proxy.runtimeMessageMutex.drained();
      return proxyWorker.dispatchFetch(...args);
    },
    async queue(...args) {
      assert53__default.default(
        this.config.name,
        "Worker name must be defined to use `Worker.queue()`"
      );
      const { proxyWorker } = await devEnv.proxy.ready.promise;
      const w7 = await proxyWorker.getWorker(this.config.name);
      return w7.queue(...args);
    },
    async scheduled(...args) {
      assert53__default.default(
        this.config.name,
        "Worker name must be defined to use `Worker.scheduled()`"
      );
      const { proxyWorker } = await devEnv.proxy.ready.promise;
      const w7 = await proxyWorker.getWorker(this.config.name);
      return w7.scheduled(...args);
    },
    async dispose() {
      await devEnv.proxy.ready.promise.finally(() => devEnv.teardown());
    },
    raw: devEnv
  };
}
exports.unstable_DevEnv = void 0;
var init_DevEnv = __esm({
  "src/api/startDevWorker/DevEnv.ts"() {
    init_import_meta_url();
    init_dist();
    init_build_failures();
    init_logger();
    init_BundlerController();
    init_ConfigController();
    init_LocalRuntimeController();
    init_ProxyController();
    init_RemoteRuntimeController();
    exports.unstable_DevEnv = class extends events.EventEmitter {
      static {
        __name(this, "DevEnv");
      }
      config;
      bundler;
      runtimes;
      proxy;
      async startWorker(options) {
        const worker = createWorkerObject(this);
        try {
          await this.config.set(options, true);
        } catch (e10) {
          const error2 = new Error("An error occurred when starting the server", {
            cause: e10
          });
          this.proxy.ready.reject(error2);
          await worker.dispose();
          throw e10;
        }
        return worker;
      }
      constructor({
        configFactory = /* @__PURE__ */ __name((devEnv) => new ConfigController(devEnv), "configFactory"),
        bundlerFactory = /* @__PURE__ */ __name((devEnv) => new BundlerController(devEnv), "bundlerFactory"),
        runtimeFactories = [
          (devEnv) => new LocalRuntimeController(devEnv),
          (devEnv) => new RemoteRuntimeController(devEnv)
        ],
        proxyFactory = /* @__PURE__ */ __name((devEnv) => new ProxyController(devEnv), "proxyFactory")
      } = {}) {
        super();
        this.config = configFactory(this);
        this.bundler = bundlerFactory(this);
        this.runtimes = runtimeFactories.map((factory) => factory(this));
        this.proxy = proxyFactory(this);
        this.on("error", (event) => {
          logger.debug(`Error in ${event.source}: ${event.reason}
`, event.cause);
          logger.debug("=> Error contextual data:", event.data);
        });
      }
      /**
       * Central message bus dispatch method.
       * All events from controllers flow through here, making the event routing explicit and traceable.
       *
       * Event flow:
       * - ConfigController emits configUpdate → BundlerController, ProxyController
       * - BundlerController emits bundleStart → ProxyController, RuntimeControllers
       * - BundlerController emits bundleComplete → RuntimeControllers
       * - RuntimeController emits reloadStart → ProxyController
       * - RuntimeController emits reloadComplete → ProxyController
       * - RuntimeController emits devRegistryUpdate → ConfigController
       * - ProxyController emits previewTokenExpired → RuntimeControllers
       * - Any controller emits error → DevEnv error handler
       */
      dispatch(event) {
        switch (event.type) {
          case "error":
            this.handleErrorEvent(event);
            break;
          case "configUpdate":
            this.bundler.onConfigUpdate(event);
            this.proxy.onConfigUpdate(event);
            break;
          case "bundleStart":
            this.proxy.onBundleStart(event);
            this.runtimes.forEach((runtime) => {
              runtime.onBundleStart(event);
            });
            break;
          case "bundleComplete":
            this.runtimes.forEach((runtime) => {
              runtime.onBundleComplete(event);
            });
            break;
          case "reloadStart":
            this.proxy.onReloadStart(event);
            break;
          case "reloadComplete":
            this.proxy.onReloadComplete(event);
            break;
          case "devRegistryUpdate":
            this.config.onDevRegistryUpdate(event);
            break;
          case "previewTokenExpired":
            this.runtimes.forEach((runtime) => {
              runtime.onPreviewTokenExpired(event);
            });
            break;
          default: {
            const _exhaustive = event;
            logger.warn(
              `Unknown event type: ${_exhaustive.type}`
            );
          }
        }
      }
      handleErrorEvent(event) {
        if (event.cause instanceof miniflare.MiniflareCoreError && event.cause.isUserError()) {
          this.emit("error", new UserError(event.cause.message));
        } else if (event.source === "ProxyController" && (event.reason.startsWith("Failed to send message to") || event.reason.startsWith("Could not connect to InspectorProxyWorker"))) {
          logger.debug(`Error in ${event.source}: ${event.reason}
`, event.cause);
          logger.debug("=> Error contextual data:", event.data);
        } else if (event.source === "ConfigController" && event.cause instanceof ParseError) {
          logger.error(event.cause);
        } else if (event.source === "BundlerController") {
          if (isBuildFailure(event.cause)) {
            logBuildFailure(event.cause.errors, event.cause.warnings);
          } else if (isBuildFailureFromCause(event.cause)) {
            logBuildFailure(event.cause.cause.errors, event.cause.cause.warnings);
          } else {
            logger.error(event.cause.message);
          }
        } else {
          this.emit("error", event);
        }
      }
      async teardown() {
        await runWithLogLevel(this.config.latestInput?.dev?.logLevel, async () => {
          logger.debug("DevEnv teardown beginning...");
          await Promise.all([
            this.config.teardown(),
            this.bundler.teardown(),
            ...this.runtimes.map((runtime) => runtime.teardown()),
            this.proxy.teardown()
          ]);
          this.emit("teardown");
          logger.debug("DevEnv teardown complete");
        });
      }
    };
    __name(createWorkerObject, "createWorkerObject");
  }
});

// src/api/startDevWorker/types.ts
var init_types16 = __esm({
  "src/api/startDevWorker/types.ts"() {
    init_import_meta_url();
  }
});

// src/api/startDevWorker/index.ts
async function startWorker(options) {
  const devEnv = new exports.unstable_DevEnv();
  return devEnv.startWorker(options);
}
var init_startDevWorker = __esm({
  "src/api/startDevWorker/index.ts"() {
    init_import_meta_url();
    init_DevEnv();
    init_utils2();
    init_types16();
    init_events();
    __name(startWorker, "startWorker");
  }
});
var scriptPath3, ProxyServerWorker_default;
var init_ProxyServerWorker = __esm({
  "embed-worker:/build/wrangler/src/workers-sdk-wrangler-4.82.2/packages/wrangler/templates/remoteBindings/ProxyServerWorker.ts"() {
    init_import_meta_url();
    scriptPath3 = path3__namespace.default.resolve(__dirname, "..", "wrangler-dist/ProxyServerWorker.js");
    ProxyServerWorker_default = scriptPath3;
  }
});
async function startRemoteProxySession(bindings, options) {
  const rawBindings = Object.fromEntries(
    Object.entries(bindings ?? {}).map(([key, binding]) => [
      key,
      { ...binding, raw: true }
    ])
  );
  const proxyServerWorkerWranglerConfig = path3__namespace.default.resolve(
    getBasePath(),
    "templates/remoteBindings/wrangler.jsonc"
  );
  const worker = await startWorker({
    name: options?.workerName,
    entrypoint: ProxyServerWorker_default,
    config: proxyServerWorkerWranglerConfig,
    compatibilityDate: "2025-04-28",
    dev: {
      remote: "minimal",
      auth: options?.auth,
      server: {
        port: 0
      },
      inspector: false,
      logLevel: getStartWorkerLogLevel(logger.loggerLevel)
    },
    bindings: rawBindings
  }).catch((startWorkerError) => {
    let errorMessage = startWorkerError;
    if (startWorkerError instanceof Error) {
      if (startWorkerError.cause instanceof Error) {
        errorMessage = startWorkerError.cause.message;
      } else {
        errorMessage = startWorkerError.message;
      }
    }
    throw new Error(
      `Failed to start the remote proxy session, see the error details below:

${errorMessage}`
    );
  });
  const maybeErrorPromise = new miniflare.DeferredPromise();
  worker.raw.addListener(
    "error",
    (e10) => maybeErrorPromise.resolve({ error: e10 })
  );
  const maybeError = await Promise.race([
    maybeErrorPromise,
    worker.raw.proxy.localServerReady.promise
  ]);
  if (maybeError && maybeError.error) {
    throw new Error(
      "Failed to start the remote proxy session. There is likely additional logging output above.",
      {
        cause: maybeError.error
      }
    );
  }
  const remoteProxyConnectionString = await worker.url;
  const updateBindings = /* @__PURE__ */ __name(async (newBindings) => {
    const rawNewBindings = Object.fromEntries(
      Object.entries(newBindings ?? {}).map(([key, binding]) => [
        key,
        { ...binding, raw: true }
      ])
    );
    await worker.patchConfig({ bindings: rawNewBindings });
  }, "updateBindings");
  return {
    ready: worker.ready,
    remoteProxyConnectionString,
    updateBindings,
    dispose: worker.dispose
  };
}
function getStartWorkerLogLevel(wranglerLogLevel) {
  switch (wranglerLogLevel) {
    case "debug":
      return "debug";
    case "none":
      return "none";
    default:
      return "error";
  }
}
var init_start_remote_proxy_session = __esm({
  "src/api/remoteBindings/start-remote-proxy-session.ts"() {
    init_import_meta_url();
    init_ProxyServerWorker();
    init_logger();
    init_paths();
    init_startDevWorker();
    __name(startRemoteProxySession, "startRemoteProxySession");
    __name(getStartWorkerLogLevel, "getStartWorkerLogLevel");
  }
});

// src/api/remoteBindings/index.ts
var remoteBindings_exports = {};
__export(remoteBindings_exports, {
  maybeStartOrUpdateRemoteProxySession: () => maybeStartOrUpdateRemoteProxySession,
  pickRemoteBindings: () => pickRemoteBindings,
  startRemoteProxySession: () => startRemoteProxySession
});
function pickRemoteBindings(bindings) {
  return Object.fromEntries(
    Object.entries(bindings ?? {}).filter(([, binding]) => {
      if (binding.type === "ai" || binding.type === "media") {
        return true;
      }
      if (binding.type === "vpc_service") {
        return true;
      }
      if (binding.type === "vpc_network") {
        return true;
      }
      if (binding.type === "ai_search_namespace" || binding.type === "ai_search") {
        return true;
      }
      return "remote" in binding && binding["remote"];
    })
  );
}
async function maybeStartOrUpdateRemoteProxySession(wranglerOrWorkerConfigObject, preExistingRemoteProxySessionData, auth) {
  let config;
  if ("path" in wranglerOrWorkerConfigObject) {
    const wranglerConfigObject = wranglerOrWorkerConfigObject;
    config = readConfig({
      config: wranglerConfigObject.path,
      env: wranglerConfigObject.environment
    });
    wranglerOrWorkerConfigObject = {
      name: config.name ?? "worker",
      complianceRegion: getCloudflareComplianceRegion(config),
      bindings: convertConfigBindingsToStartWorkerBindings(config) ?? {}
    };
  }
  const workerConfigObject = wranglerOrWorkerConfigObject;
  const remoteBindings = pickRemoteBindings(workerConfigObject.bindings);
  const authSameAsBefore = deepStrictEqual(
    auth,
    preExistingRemoteProxySessionData?.auth
  );
  let remoteProxySession = preExistingRemoteProxySessionData?.session;
  if (!authSameAsBefore) {
    if (preExistingRemoteProxySessionData?.session) {
      await preExistingRemoteProxySessionData.session.dispose();
    }
    remoteProxySession = await startRemoteProxySession(remoteBindings, {
      workerName: workerConfigObject.name,
      complianceRegion: workerConfigObject.complianceRegion,
      auth: getAuthHook(
        auth,
        workerConfigObject.account_id ? {
          account_id: workerConfigObject.account_id
        } : config
      )
    });
  } else {
    const remoteBindingsAreSameAsBefore = deepStrictEqual(
      remoteBindings,
      preExistingRemoteProxySessionData?.remoteBindings
    );
    if (!remoteBindingsAreSameAsBefore) {
      if (!remoteProxySession) {
        if (Object.keys(remoteBindings).length > 0) {
          remoteProxySession = await startRemoteProxySession(remoteBindings, {
            workerName: workerConfigObject.name,
            complianceRegion: workerConfigObject.complianceRegion,
            auth: getAuthHook(
              auth,
              workerConfigObject.account_id ? {
                account_id: workerConfigObject.account_id
              } : config
            )
          });
        }
      } else {
        await remoteProxySession.updateBindings(remoteBindings);
      }
    }
  }
  await remoteProxySession?.ready;
  if (!remoteProxySession) {
    return null;
  }
  return {
    session: remoteProxySession,
    remoteBindings
  };
}
function getAuthHook(auth, config) {
  if (auth) {
    return auth;
  }
  if (config?.account_id) {
    return async () => {
      return {
        accountId: await requireAuth(config),
        apiToken: requireApiToken()
      };
    };
  }
  return void 0;
}
function deepStrictEqual(source, target) {
  try {
    assert53__default.default.deepStrictEqual(source, target);
    return true;
  } catch {
    return false;
  }
}
var init_remoteBindings = __esm({
  "src/api/remoteBindings/index.ts"() {
    init_import_meta_url();
    init_dist();
    init_config();
    init_user3();
    init_startDevWorker();
    init_start_remote_proxy_session();
    init_start_remote_proxy_session();
    __name(pickRemoteBindings, "pickRemoteBindings");
    __name(maybeStartOrUpdateRemoteProxySession, "maybeStartOrUpdateRemoteProxySession");
    __name(getAuthHook, "getAuthHook");
    __name(deepStrictEqual, "deepStrictEqual");
  }
});
async function getTextFileContents(file3) {
  if ("contents" in file3) {
    if (typeof file3.contents === "string") {
      return file3.contents;
    }
    if (file3.contents instanceof Buffer) {
      return file3.contents.toString();
    }
    return Buffer.from(file3.contents).toString();
  }
  return fs9.readFile(file3.path, "utf8");
}
function getName3(config) {
  return config.name;
}
async function convertToConfigBundle(event) {
  const bindings = { ...event.config.bindings };
  const crons = [];
  const queueConsumers = [];
  for (const trigger of event.config.triggers ?? []) {
    if (trigger.type === "cron") {
      crons.push(trigger.cron);
    } else if (trigger.type === "queue-consumer") {
      const { type: _5, ...consumer } = trigger;
      queueConsumers.push(consumer);
    }
  }
  if (event.bundle.entry.format === "service-worker") {
    for (const module2 of event.bundle.modules ?? []) {
      const identifier = getIdentifier(module2.name);
      if (module2.type === "text") {
        bindings[identifier] = {
          type: "plain_text",
          value: await getTextFileContents({
            contents: module2.content
          })
        };
      } else if (module2.type === "buffer") {
        bindings[identifier] = {
          type: "data_blob",
          source: {
            contents: await getBinaryFileContents({
              contents: module2.content
            })
          }
        };
      } else if (module2.type === "compiled-wasm") {
        bindings[identifier] = {
          type: "wasm_module",
          source: {
            contents: await getBinaryFileContents({
              contents: module2.content
            })
          }
        };
      }
    }
    event.bundle = { ...event.bundle, modules: [] };
  }
  return {
    name: event.config.name,
    bundle: event.bundle,
    format: event.bundle.entry.format,
    compatibilityDate: event.config.compatibilityDate,
    compatibilityFlags: event.config.compatibilityFlags,
    complianceRegion: event.config.complianceRegion,
    bindings,
    migrations: event.config.migrations,
    devRegistry: event.config.dev.registry,
    legacyAssetPaths: event.config.legacy?.site?.bucket ? {
      baseDirectory: event.config.legacy?.site?.bucket,
      assetDirectory: "",
      excludePatterns: event.config.legacy?.site?.exclude ?? [],
      includePatterns: event.config.legacy?.site?.include ?? []
    } : void 0,
    assets: event.config?.assets,
    initialPort: void 0,
    initialIp: "127.0.0.1",
    rules: [],
    ...event.config.dev.inspector === false ? {
      inspect: false,
      inspectorPort: void 0,
      inspectorHost: void 0
    } : {
      inspect: true,
      inspectorPort: 0,
      inspectorHost: event.config.dev.inspector?.hostname
    },
    localPersistencePath: event.config.dev.persist,
    liveReload: event.config.dev?.liveReload ?? false,
    crons,
    queueConsumers,
    localProtocol: event.config.dev?.server?.secure ? "https" : "http",
    httpsCertPath: event.config.dev?.server?.httpsCertPath,
    httpsKeyPath: event.config.dev?.server?.httpsKeyPath,
    localUpstream: event.config.dev?.origin?.hostname,
    upstreamProtocol: event.config.dev?.origin?.secure ? "https" : "http",
    testScheduled: !!event.config.dev.testScheduled,
    tails: event.config.tailConsumers,
    streamingTails: event.config.streamingTailConsumers,
    containerDOClassNames: new Set(
      event.config.containers?.map((c8) => c8.class_name)
    ),
    containerBuildId: event.config.dev?.containerBuildId,
    containerEngine: event.config.dev.containerEngine,
    enableContainers: event.config.dev.enableContainers ?? true,
    // Zone for CF-Worker header - extracted from routes/host configuration
    zone: event.config.dev?.origin?.hostname,
    sendMetrics: event.config.sendMetrics
  };
}
async function getContainerDevOptions(containersConfig, containerBuildId) {
  const containers = [];
  for (const container of containersConfig) {
    if ("image_uri" in container) {
      containers.push({
        image_uri: container.image_uri,
        class_name: container.class_name,
        image_tag: getDevContainerImageName(
          container.class_name,
          containerBuildId
        )
      });
    } else {
      containers.push({
        dockerfile: container.dockerfile,
        image_build_context: container.image_build_context,
        image_vars: container.image_vars,
        class_name: container.class_name,
        image_tag: getDevContainerImageName(
          container.class_name,
          containerBuildId
        )
      });
    }
  }
  return containers;
}
var LocalRuntimeController;
var init_LocalRuntimeController = __esm({
  "src/api/startDevWorker/LocalRuntimeController.ts"() {
    init_import_meta_url();
    init_containers_shared();
    init_dist();
    init_source();
    init_miniflare();
    init_logger();
    init_BaseController();
    init_events();
    init_utils2();
    __name(getTextFileContents, "getTextFileContents");
    __name(getName3, "getName");
    __name(convertToConfigBundle, "convertToConfigBundle");
    LocalRuntimeController = class extends RuntimeController {
      static {
        __name(this, "LocalRuntimeController");
      }
      #log = buildLog();
      #currentBundleId = 0;
      // ******************
      //   Event Handlers
      // ******************
      // This is given as a shared secret to the Proxy and User workers
      // so that the User Worker can trust aspects of HTTP requests from the Proxy Worker
      // if it provides the secret in a `MF-Proxy-Shared-Secret` header.
      #proxyToUserWorkerAuthenticationSecret = crypto2.randomUUID();
      // `buildMiniflareOptions()` is asynchronous, meaning if multiple bundle
      // updates were submitted, the second may apply before the first. Therefore,
      // wrap updates in a mutex, so they're always applied in invocation order.
      #mutex = new miniflare.Mutex();
      #mf;
      #remoteProxySessionData = null;
      // Set of container images that have been seen in the current dev session.
      // This is used to clean up containers at the end of the dev session.
      containerImageTagsSeen = /* @__PURE__ */ new Set();
      // Stored here, so it can be used in `cleanupContainers()`
      dockerPath;
      // If this doesn't match what is in config, trigger a rebuild.
      // Used for the rebuild hotkey
      #currentContainerBuildId;
      // Used to store the information and abort handle for the
      // current container that is being built
      containerBeingBuilt;
      onBundleStart(_5) {
        process.off("exit", this.cleanupContainers);
        process.on("exit", this.cleanupContainers);
      }
      async #onBundleComplete(data, id) {
        try {
          const configBundle = await convertToConfigBundle(data);
          if (data.config.dev?.remote !== false) {
            const { maybeStartOrUpdateRemoteProxySession: maybeStartOrUpdateRemoteProxySession2, pickRemoteBindings: pickRemoteBindings2 } = await Promise.resolve().then(() => (init_remoteBindings(), remoteBindings_exports));
            const remoteBindings = pickRemoteBindings2(configBundle.bindings ?? {});
            const auth = Object.keys(remoteBindings).length === 0 ? (
              // If there are no remote bindings (this is a local only session) there's no need to get auth data
              void 0
            ) : await unwrapHook(data.config.dev.auth);
            this.#remoteProxySessionData = await maybeStartOrUpdateRemoteProxySession2(
              {
                name: configBundle.name,
                complianceRegion: configBundle.complianceRegion,
                bindings: remoteBindings
              },
              this.#remoteProxySessionData ?? null,
              auth
            );
          }
          if (data.config.containers?.length && data.config.dev.enableContainers && this.#currentContainerBuildId !== data.config.dev.containerBuildId) {
            this.dockerPath = data.config.dev?.dockerPath ?? getDockerPath();
            assert53__default.default(
              data.config.dev.containerBuildId,
              "Build ID should be set if containers are enabled and defined"
            );
            const containerDevOptions = await getContainerDevOptions(
              data.config.containers,
              data.config.dev.containerBuildId
            );
            for (const container of containerDevOptions) {
              if (this.#currentContainerBuildId !== void 0) {
                runDockerCmdWithOutput(this.dockerPath, [
                  "rmi",
                  getDevContainerImageName(
                    container.class_name,
                    this.#currentContainerBuildId
                  )
                ]);
              }
              this.containerImageTagsSeen.add(container.image_tag);
            }
            logger.log(source_default.dim("\u2394 Preparing container image(s)..."));
            await prepareContainerImagesForDev({
              dockerPath: this.dockerPath,
              containerOptions: containerDevOptions,
              onContainerImagePreparationStart: /* @__PURE__ */ __name((buildStartEvent) => {
                this.containerBeingBuilt = {
                  ...buildStartEvent,
                  abortRequested: false
                };
              }, "onContainerImagePreparationStart"),
              onContainerImagePreparationEnd: /* @__PURE__ */ __name(() => {
                this.containerBeingBuilt = void 0;
              }, "onContainerImagePreparationEnd"),
              logger,
              isVite: false
            });
            if (this.containerBeingBuilt) {
              this.containerBeingBuilt.abortRequested = false;
            }
            this.#currentContainerBuildId = data.config.dev.containerBuildId;
            logger.log(source_default.dim("\u2394 Container image(s) ready"));
          }
          const options = await buildMiniflareOptions(
            this.#log,
            configBundle,
            this.#proxyToUserWorkerAuthenticationSecret,
            this.#remoteProxySessionData?.session?.remoteProxyConnectionString,
            (registry) => {
              logger.log(source_default.dim("\u2394 Connection status updated"));
              this.emitDevRegistryUpdateEvent({
                type: "devRegistryUpdate",
                registry
              });
            }
          );
          options.liveReload = false;
          if (this.#mf === void 0) {
            logger.log(source_default.dim("\u2394 Starting local server..."));
            this.#mf = new miniflare.Miniflare(options);
          } else {
            logger.log(source_default.dim("\u2394 Reloading local server..."));
            await this.#mf.setOptions(options);
            logger.log(source_default.dim("\u2394 Local server updated and ready"));
          }
          const userWorkerUrl = await this.#mf.ready;
          const userWorkerInspectorUrl = options.inspectorPort === void 0 ? void 0 : await this.#mf.getInspectorURL();
          if (id !== this.#currentBundleId) {
            return;
          }
          this.emitReloadCompleteEvent({
            type: "reloadComplete",
            config: data.config,
            bundle: data.bundle,
            proxyData: {
              userWorkerUrl: {
                protocol: userWorkerUrl.protocol,
                hostname: userWorkerUrl.hostname,
                port: userWorkerUrl.port
              },
              ...userWorkerInspectorUrl ? {
                userWorkerInspectorUrl: {
                  protocol: userWorkerInspectorUrl.protocol,
                  hostname: userWorkerInspectorUrl.hostname,
                  port: userWorkerInspectorUrl.port,
                  pathname: `/core:user:${getName3(data.config)}`
                }
              } : {},
              userWorkerInnerUrlOverrides: {
                protocol: data.config?.dev?.origin?.secure ? "https:" : "http:",
                hostname: data.config?.dev?.origin?.hostname,
                port: data.config?.dev?.origin?.hostname ? "" : void 0
              },
              headers: {
                // Passing this signature from Proxy Worker allows the User Worker to trust the request.
                "MF-Proxy-Shared-Secret": this.#proxyToUserWorkerAuthenticationSecret
              },
              liveReload: data.config.dev?.liveReload,
              proxyLogsToController: data.bundle.entry.format === "service-worker"
            }
          });
        } catch (error2) {
          if (this.containerBeingBuilt?.abortRequested && error2 instanceof Error && error2.message === "Build exited with code: 1") {
            return;
          }
          this.emitErrorEvent({
            type: "error",
            reason: "Error reloading local server",
            cause: castErrorCause(error2),
            source: "LocalRuntimeController",
            data: void 0
          });
        }
      }
      onBundleComplete(data) {
        const id = ++this.#currentBundleId;
        if (data.config.dev?.remote) {
          void this.teardown();
          return;
        }
        this.emitReloadStartEvent({
          type: "reloadStart",
          config: data.config,
          bundle: data.bundle
        });
        void this.#mutex.runWith(() => this.#onBundleComplete(data, id));
      }
      onPreviewTokenExpired(_5) {
      }
      cleanupContainers = /* @__PURE__ */ __name(() => {
        if (!this.containerImageTagsSeen.size) {
          return;
        }
        assert53__default.default(
          this.dockerPath,
          "Docker path should have been set if containers are enabled"
        );
        cleanupContainers(this.dockerPath, this.containerImageTagsSeen);
      }, "cleanupContainers");
      #teardown = /* @__PURE__ */ __name(async () => {
        logger.debug("LocalRuntimeController teardown beginning...");
        process.off("exit", this.cleanupContainers);
        this.cleanupContainers();
        if (this.#mf) {
          logger.log(source_default.dim("\u2394 Shutting down local server..."));
        }
        await this.#mf?.dispose();
        this.#mf = void 0;
        if (this.#remoteProxySessionData) {
          logger.log(source_default.dim("\u2394 Shutting down remote connection..."));
        }
        await this.#remoteProxySessionData?.session?.dispose();
        this.#remoteProxySessionData = null;
        logger.debug("LocalRuntimeController teardown complete");
      }, "#teardown");
      async teardown() {
        await super.teardown();
        return this.#mutex.runWith(this.#teardown);
      }
      // *********************
      //   Event Dispatchers
      // *********************
      emitReloadStartEvent(data) {
        this.bus.dispatch(data);
      }
      emitReloadCompleteEvent(data) {
        this.bus.dispatch(data);
      }
      emitDevRegistryUpdateEvent(data) {
        this.bus.dispatch(data);
      }
    };
    __name(getContainerDevOptions, "getContainerDevOptions");
  }
});
function ensureMatchingSql(options) {
  const sameWorkerDOSqlEnabled = /* @__PURE__ */ new Map();
  for (const worker of options.workers) {
    for (const designator of Object.values(worker.durableObjects ?? {})) {
      const isObject5 = typeof designator === "object";
      const className = isObject5 ? designator.className : designator;
      const enableSql = isObject5 ? designator.useSQLite : void 0;
      if (!isObject5 || designator.scriptName === void 0) {
        sameWorkerDOSqlEnabled.set(className, enableSql);
      }
    }
  }
  for (const worker of options.workers) {
    for (const designator of Object.values(worker.durableObjects ?? {})) {
      const isObject5 = typeof designator === "object";
      if (isObject5 && designator.scriptName !== void 0) {
        designator.useSQLite = sameWorkerDOSqlEnabled.get(designator.className);
      }
    }
  }
  return options;
}
var MultiworkerRuntimeController;
var init_MultiworkerRuntimeController = __esm({
  "src/api/startDevWorker/MultiworkerRuntimeController.ts"() {
    init_import_meta_url();
    init_containers_shared();
    init_dist();
    init_source();
    init_miniflare();
    init_logger();
    init_events();
    init_LocalRuntimeController();
    __name(ensureMatchingSql, "ensureMatchingSql");
    MultiworkerRuntimeController = class extends LocalRuntimeController {
      constructor(bus, numWorkers) {
        super(bus);
        this.numWorkers = numWorkers;
      }
      static {
        __name(this, "MultiworkerRuntimeController");
      }
      // ******************
      //   Event Handlers
      // ******************
      #log = buildLog();
      #currentBundleId = 0;
      // This is given as a shared secret to the Proxy and User workers
      // so that the User Worker can trust aspects of HTTP requests from the Proxy Worker
      // if it provides the secret in a `MF-Proxy-Shared-Secret` header.
      #proxyToUserWorkerAuthenticationSecret = crypto2.randomUUID();
      // `buildMiniflareOptions()` is asynchronous, meaning if multiple bundle
      // updates were submitted, the second may apply before the first. Therefore,
      // wrap updates in a mutex, so they're always applied in invocation order.
      #mutex = new miniflare.Mutex();
      #mf;
      #options = /* @__PURE__ */ new Map();
      #remoteProxySessionsData = /* @__PURE__ */ new Map();
      // If this doesn't match what is in config, trigger a rebuild.
      // Used for the rebuild hotkey
      #currentContainerBuildId;
      #canStartMiniflare() {
        return [...this.#options.values()].some((o7) => o7.primary) && [...this.#options.values()].length === this.numWorkers;
      }
      #mergedMfOptions() {
        const primary = [...this.#options.values()].find((o7) => o7.primary);
        assert53__default.default(primary !== void 0);
        const secondary = [...this.#options.values()].filter((o7) => !o7.primary);
        return {
          ...primary.options,
          workers: [
            ...primary.options.workers,
            ...secondary.flatMap(
              (o7) => o7.options.workers.map((w7) => {
                delete w7.ratelimits;
                return w7;
              })
            )
          ]
        };
      }
      async #onBundleComplete(data, id) {
        try {
          const configBundle = await convertToConfigBundle(data);
          if (data.config.dev?.remote !== false) {
            const { maybeStartOrUpdateRemoteProxySession: maybeStartOrUpdateRemoteProxySession2 } = await Promise.resolve().then(() => (init_remoteBindings(), remoteBindings_exports));
            const remoteProxySession = await maybeStartOrUpdateRemoteProxySession2(
              {
                name: configBundle.name,
                complianceRegion: configBundle.complianceRegion,
                bindings: configBundle.bindings ?? {}
              },
              this.#remoteProxySessionsData.get(data.config.name) ?? null
            );
            this.#remoteProxySessionsData.set(
              data.config.name,
              remoteProxySession ?? null
            );
          }
          if (data.config.containers?.length && this.#currentContainerBuildId !== data.config.dev.containerBuildId) {
            logger.log(source_default.dim("\u2394 Preparing container image(s)..."));
            assert53__default.default(
              data.config.dev.containerBuildId,
              "Build ID should be set if containers are enabled and defined"
            );
            const containerOptions = await getContainerDevOptions(
              data.config.containers,
              data.config.dev.containerBuildId
            );
            this.dockerPath = data.config.dev?.dockerPath ?? getDockerPath();
            for (const container of containerOptions ?? []) {
              this.containerImageTagsSeen.add(container.image_tag);
            }
            await prepareContainerImagesForDev({
              dockerPath: this.dockerPath,
              containerOptions,
              onContainerImagePreparationStart: /* @__PURE__ */ __name((buildStartEvent) => {
                this.containerBeingBuilt = {
                  ...buildStartEvent,
                  abortRequested: false
                };
              }, "onContainerImagePreparationStart"),
              onContainerImagePreparationEnd: /* @__PURE__ */ __name(() => {
                this.containerBeingBuilt = void 0;
              }, "onContainerImagePreparationEnd"),
              logger,
              isVite: false
            });
            if (this.containerBeingBuilt) {
              this.containerBeingBuilt.abortRequested = false;
            }
            this.#currentContainerBuildId = data.config.dev.containerBuildId;
            logger.log(source_default.dim("\u2394 Container image(s) ready"));
          }
          const options = await buildMiniflareOptions(
            this.#log,
            await convertToConfigBundle(data),
            this.#proxyToUserWorkerAuthenticationSecret,
            this.#remoteProxySessionsData.get(data.config.name)?.session?.remoteProxyConnectionString,
            (registry) => {
              this.emitDevRegistryUpdateEvent({
                type: "devRegistryUpdate",
                registry
              });
            }
          );
          this.#options.set(data.config.name, {
            options,
            primary: Boolean(data.config.dev.multiworkerPrimary)
          });
          if (this.#canStartMiniflare()) {
            const mergedMfOptions = ensureMatchingSql(this.#mergedMfOptions());
            if (this.#mf === void 0) {
              logger.log(source_default.dim("\u2394 Starting local server..."));
              this.#mf = new miniflare.Miniflare(mergedMfOptions);
            } else {
              logger.log(source_default.dim("\u2394 Reloading local server..."));
              await this.#mf.setOptions(mergedMfOptions);
              logger.log(source_default.dim("\u2394 Local server updated and ready"));
            }
            const userWorkerUrl = await this.#mf.ready;
            const userWorkerInspectorUrl = await this.#mf.getInspectorURL();
            if (id !== this.#currentBundleId) {
              return;
            }
            this.emitReloadCompleteEvent({
              type: "reloadComplete",
              config: data.config,
              bundle: data.bundle,
              proxyData: {
                userWorkerUrl: {
                  protocol: userWorkerUrl.protocol,
                  hostname: userWorkerUrl.hostname,
                  port: userWorkerUrl.port
                },
                userWorkerInspectorUrl: {
                  protocol: userWorkerInspectorUrl.protocol,
                  hostname: userWorkerInspectorUrl.hostname,
                  port: userWorkerInspectorUrl.port,
                  pathname: `/core:user:${data.config.name}`
                },
                userWorkerInnerUrlOverrides: {
                  protocol: data.config?.dev?.origin?.secure ? "https:" : "http:",
                  hostname: data.config?.dev?.origin?.hostname,
                  port: data.config?.dev?.origin?.hostname ? "" : void 0
                },
                headers: {
                  // Passing this signature from Proxy Worker allows the User Worker to trust the request.
                  "MF-Proxy-Shared-Secret": this.#proxyToUserWorkerAuthenticationSecret
                },
                liveReload: data.config.dev?.liveReload,
                proxyLogsToController: data.bundle.entry.format === "service-worker"
              }
            });
          }
        } catch (error2) {
          this.emitErrorEvent({
            type: "error",
            reason: "Error reloading local server",
            cause: castErrorCause(error2),
            source: "MultiworkerRuntimeController",
            data: void 0
          });
        }
      }
      onBundleComplete(data) {
        const id = ++this.#currentBundleId;
        if (data.config.dev?.remote) {
          this.emitErrorEvent({
            type: "error",
            reason: "--remote workers not supported with the multiworker runtime",
            cause: new Error(
              "--remote workers not supported with the multiworker runtime"
            ),
            source: "MultiworkerRuntimeController",
            data: void 0
          });
          return;
        }
        this.emitReloadStartEvent({
          type: "reloadStart",
          config: data.config,
          bundle: data.bundle
        });
        void this.#mutex.runWith(() => this.#onBundleComplete(data, id));
      }
      #teardown = /* @__PURE__ */ __name(async () => {
        logger.debug("MultiworkerRuntimeController teardown beginning...");
        if (this.#mf) {
          logger.log(source_default.dim("\u2394 Shutting down local server..."));
        }
        await this.#mf?.dispose();
        this.#mf = void 0;
        if (this.#remoteProxySessionsData.size > 0) {
          logger.log(source_default.dim("\u2394 Shutting down remote connections..."));
        }
        await Promise.all(
          [...this.#remoteProxySessionsData.values()].map(
            (remoteProxySessionData) => remoteProxySessionData?.session?.dispose()
          )
        );
        this.#remoteProxySessionsData.clear();
        logger.debug("MultiworkerRuntimeController teardown complete");
      }, "#teardown");
      async teardown() {
        await super.teardown();
        return this.#mutex.runWith(this.#teardown);
      }
    };
  }
});

// src/api/startDevWorker/NoOpProxyController.ts
var NoOpProxyController;
var init_NoOpProxyController = __esm({
  "src/api/startDevWorker/NoOpProxyController.ts"() {
    init_import_meta_url();
    init_ProxyController();
    NoOpProxyController = class extends ProxyController {
      static {
        __name(this, "NoOpProxyController");
      }
      onConfigUpdate(_data5) {
      }
      onBundleStart(_data5) {
      }
      onReloadStart(_data5) {
      }
      onReloadComplete(_data5) {
      }
    };
  }
});
function cli_hotkeys_default(options, render2 = true) {
  function formatInstructions() {
    const instructions = options.filter(
      (option) => !unwrapHook(option.disabled) && option.label !== void 0
    ).map(({ keys, label }) => `[${keys[0]}] ${dim(unwrapHook(label))}`);
    let stringifiedInstructions = instructions.join(" ");
    const length = util4.stripVTControlCharacters(stringifiedInstructions).length;
    const ADDITIONAL_CHARS = 6;
    const willWrap = length + ADDITIONAL_CHARS > process.stdout.columns;
    if (willWrap) {
      stringifiedInstructions = instructions.join("\n");
    }
    const maxLineLength = Math.max(
      ...stringifiedInstructions.split("\n").map((line) => util4.stripVTControlCharacters(line).length)
    );
    stringifiedInstructions = stringifiedInstructions.split("\n").map(
      (line) => `\u2502  ${line + " ".repeat(Math.max(0, maxLineLength - util4.stripVTControlCharacters(line).length))}  \u2502`
    ).join("\n");
    return `\u256D\u2500\u2500${"\u2500".repeat(maxLineLength)}\u2500\u2500\u256E
` + stringifiedInstructions + `
\u2570\u2500\u2500${"\u2500".repeat(maxLineLength)}\u2500\u2500\u256F`;
  }
  __name(formatInstructions, "formatInstructions");
  const unregisterKeyPress = onKeyPress(async (key) => {
    const entries2 = [];
    if (key.name) {
      entries2.push(key.name.toLowerCase());
    }
    if (key.meta) {
      entries2.unshift("meta");
    }
    if (key.ctrl) {
      entries2.unshift("ctrl");
    }
    if (key.shift) {
      entries2.unshift("shift");
    }
    const char = entries2.join("+");
    for (const { keys, handler, disabled } of options) {
      if (unwrapHook(disabled)) {
        continue;
      }
      if (keys.includes(char)) {
        try {
          await handler();
        } catch {
          logger.error(`Error while handling hotkey [${char}]`);
        }
      }
    }
  });
  function printInstructions() {
    const bottomFloat = formatInstructions();
    if (bottomFloat) {
      console.log(bottomFloat);
    }
  }
  __name(printInstructions, "printInstructions");
  if (render2) {
    printInstructions();
  }
  return () => {
    unregisterKeyPress();
  };
}
var init_cli_hotkeys = __esm({
  "src/cli-hotkeys.ts"() {
    init_import_meta_url();
    init_colors();
    init_utils2();
    init_logger();
    init_onKeyPress();
    __name(cli_hotkeys_default, "default");
  }
});
function registerDevHotKeys(devEnvs, args, render2 = true) {
  const primaryDevEnv = devEnvs[0];
  const unregisterHotKeys = cli_hotkeys_default(
    [
      {
        keys: ["b"],
        label: "open a browser",
        handler: /* @__PURE__ */ __name(async () => {
          const { url: url4 } = await primaryDevEnv.proxy.ready.promise;
          await openInBrowser(url4.href);
        }, "handler")
      },
      {
        keys: ["d"],
        label: "open devtools",
        // Don't display this hotkey if we're in a VSCode debug session
        disabled: !!process.env.VSCODE_INSPECTOR_OPTIONS || args.remote,
        handler: /* @__PURE__ */ __name(async () => {
          const { inspectorUrl } = await primaryDevEnv.proxy.ready.promise;
          if (!inspectorUrl) {
            logger.warn("DevTools is not available while in a debug terminal");
          } else {
            await openInspector(
              parseInt(inspectorUrl.port),
              primaryDevEnv.config.latestConfig?.name
            );
          }
        }, "handler")
      },
      {
        keys: ["e"],
        label: "open local explorer",
        handler: /* @__PURE__ */ __name(async () => {
          const { url: url4 } = await primaryDevEnv.proxy.ready.promise;
          const explorerUrl = new URL(miniflare.CorePaths.EXPLORER, url4);
          await openInBrowser(explorerUrl.href);
        }, "handler")
      },
      {
        keys: ["r"],
        label: "rebuild container(s)",
        disabled: /* @__PURE__ */ __name(() => {
          return devEnvs.every(
            (devEnv) => !devEnv.config.latestConfig?.dev?.enableContainers || !devEnv.config.latestConfig?.containers?.length
          );
        }, "disabled"),
        handler: debounce(async () => {
          for (const devEnv of devEnvs) {
            devEnv.runtimes.forEach((runtime) => {
              if (runtime instanceof LocalRuntimeController) {
                if (runtime.containerBeingBuilt) {
                  runtime.containerBeingBuilt.abort();
                  runtime.containerBeingBuilt.abortRequested = true;
                }
              }
            });
            devEnv.runtimes.map((runtime) => {
              if (runtime instanceof LocalRuntimeController) {
                runtime.cleanupContainers();
              }
            });
            const newContainerBuildId = generateContainerBuildId();
            await devEnv.config.patch({
              dev: {
                ...devEnv.config.latestConfig?.dev,
                containerBuildId: newContainerBuildId
              }
            });
          }
        }, 250)
      },
      {
        keys: ["l"],
        disabled: /* @__PURE__ */ __name(() => args.forceLocal ?? false, "disabled"),
        handler: /* @__PURE__ */ __name(async () => {
          await primaryDevEnv.config.patch({
            dev: {
              ...primaryDevEnv.config.latestConfig?.dev,
              remote: !primaryDevEnv.config.latestConfig?.dev?.remote
            }
          });
        }, "handler")
      },
      {
        keys: ["c"],
        label: "clear console",
        handler: /* @__PURE__ */ __name(async () => {
          const someContainerIsBeingBuilt = primaryDevEnv.runtimes.some(
            (runtime) => runtime instanceof LocalRuntimeController && runtime.containerBeingBuilt
          );
          if (!someContainerIsBeingBuilt) {
            logger.console("clear");
          }
        }, "handler")
      },
      {
        keys: ["x", "q", "ctrl+c"],
        label: "to exit",
        handler: /* @__PURE__ */ __name(async () => {
          primaryDevEnv.runtimes.forEach((runtime) => {
            if (runtime instanceof LocalRuntimeController) {
              if (runtime.containerBeingBuilt) {
                runtime.containerBeingBuilt.abort();
                runtime.containerBeingBuilt.abortRequested = true;
              }
            }
          });
          await primaryDevEnv.teardown();
        }, "handler")
      }
    ],
    render2
  );
  return unregisterHotKeys;
}
var init_hotkeys = __esm({
  "src/dev/hotkeys.ts"() {
    init_import_meta_url();
    init_containers_shared();
    init_LocalRuntimeController();
    init_cli_hotkeys();
    init_logger();
    init_open_in_browser();
    init_debounce();
    init_inspect2();
    __name(registerDevHotKeys, "registerDevHotKeys");
  }
});
function constructRedirects({
  redirects,
  redirectsFile,
  logger: logger4
}) {
  if (!redirects) {
    return {};
  }
  const num_valid = redirects.rules.length;
  const num_invalid = redirects.invalid.length;
  const redirectsRelativePath = redirectsFile ? path3.relative(process.cwd(), redirectsFile) : "";
  logger4.log(
    `\u2728 Parsed ${num_valid} valid redirect rule${num_valid === 1 ? "" : "s"}.`
  );
  if (num_invalid > 0) {
    let invalidRedirectRulesList = ``;
    for (const { line, lineNumber, message } of redirects.invalid) {
      invalidRedirectRulesList += `\u25B6\uFE0E ${message}
`;
      if (line) {
        invalidRedirectRulesList += `    at ${redirectsRelativePath}${lineNumber ? `:${lineNumber}` : ""} | ${line}

`;
      }
    }
    logger4.warn(
      `Found ${num_invalid} invalid redirect rule${num_invalid === 1 ? "" : "s"}:
${invalidRedirectRulesList}`
    );
  }
  if (num_valid === 0) {
    return {};
  }
  const staticRedirects = {};
  const dynamicRedirects = {};
  let canCreateStaticRule = true;
  for (const rule of redirects.rules) {
    if (!rule.from.match(SPLAT_REGEX) && !rule.from.match(PLACEHOLDER_REGEX)) {
      if (canCreateStaticRule) {
        staticRedirects[rule.from] = {
          status: rule.status,
          to: rule.to,
          lineNumber: rule.lineNumber
        };
        continue;
      } else {
        logger4.info(
          `The redirect rule ${rule.from} \u2192 ${rule.status} ${rule.to} could be made more performant by bringing it above any lines with splats or placeholders.`
        );
      }
    }
    dynamicRedirects[rule.from] = { status: rule.status, to: rule.to };
    canCreateStaticRule = false;
  }
  return {
    redirects: {
      version: REDIRECTS_VERSION,
      staticRules: staticRedirects,
      rules: dynamicRedirects
    }
  };
}
function constructHeaders({
  headers,
  headersFile,
  logger: logger4
}) {
  if (!headers) {
    return {};
  }
  const num_valid = headers.rules.length;
  const num_invalid = headers.invalid.length;
  const headersRelativePath = headersFile ? path3.relative(process.cwd(), headersFile) : "";
  logger4.log(
    `\u2728 Parsed ${num_valid} valid header rule${num_valid === 1 ? "" : "s"}.`
  );
  if (num_invalid > 0) {
    let invalidHeaderRulesList = ``;
    for (const { line, lineNumber, message } of headers.invalid) {
      invalidHeaderRulesList += `\u25B6\uFE0E ${message}
`;
      if (line) {
        invalidHeaderRulesList += `    at ${headersRelativePath}${lineNumber ? `:${lineNumber}` : ""} | ${line}

`;
      }
    }
    logger4.warn(
      `Found ${num_invalid} invalid header rule${num_invalid === 1 ? "" : "s"}:
${invalidHeaderRulesList}`
    );
  }
  if (num_valid === 0) {
    return {};
  }
  const rules = {};
  for (const rule of headers.rules) {
    const configuredRule = {};
    if (Object.keys(rule.headers).length) {
      configuredRule.set = rule.headers;
    }
    if (rule.unsetHeaders.length) {
      configuredRule.unset = rule.unsetHeaders;
    }
    rules[rule.path] = configuredRule;
  }
  return {
    headers: {
      version: HEADERS_VERSION,
      rules
    }
  };
}
var init_constructConfiguration = __esm({
  "../workers-shared/utils/configuration/constructConfiguration.ts"() {
    init_import_meta_url();
    init_constants2();
    __name(constructRedirects, "constructRedirects");
    __name(constructHeaders, "constructHeaders");
  }
});

// ../pages-shared/metadata-generator/constants.ts
var ANALYTICS_VERSION;
var init_constants21 = __esm({
  "../pages-shared/metadata-generator/constants.ts"() {
    init_import_meta_url();
    ANALYTICS_VERSION = 1;
  }
});

// ../pages-shared/metadata-generator/createMetadataObject.ts
function createMetadataObject({
  redirects,
  headers,
  redirectsFile,
  headersFile,
  webAnalyticsToken,
  deploymentId,
  failOpen,
  logger: logger4 = noopLogger
}) {
  return {
    ...constructRedirects({ redirects, redirectsFile, logger: logger4 }),
    ...constructHeaders({ headers, headersFile, logger: logger4 }),
    ...constructWebAnalytics({ webAnalyticsToken}),
    deploymentId,
    failOpen
  };
}
function constructWebAnalytics({
  webAnalyticsToken
}) {
  if (!webAnalyticsToken) {
    return {};
  }
  return {
    analytics: {
      version: ANALYTICS_VERSION,
      token: webAnalyticsToken
    }
  };
}
var noopLogger;
var init_createMetadataObject = __esm({
  "../pages-shared/metadata-generator/createMetadataObject.ts"() {
    init_import_meta_url();
    init_constructConfiguration();
    init_constants21();
    noopLogger = {
      debug: /* @__PURE__ */ __name((_message) => {
      }, "debug"),
      log: /* @__PURE__ */ __name((_message) => {
      }, "log"),
      info: /* @__PURE__ */ __name((_message) => {
      }, "info"),
      warn: /* @__PURE__ */ __name((_message) => {
      }, "warn"),
      error: /* @__PURE__ */ __name((_error) => {
      }, "error")
    };
    __name(createMetadataObject, "createMetadataObject");
    __name(constructWebAnalytics, "constructWebAnalytics");
  }
});

// ../pages-shared/environment-polyfills/index.ts
var polyfill;
var init_environment_polyfills = __esm({
  "../pages-shared/environment-polyfills/index.ts"() {
    init_import_meta_url();
    polyfill = /* @__PURE__ */ __name((environment) => {
      Object.entries(environment).map(([name2, value]) => {
        Object.defineProperty(globalThis, name2, {
          value,
          configurable: true,
          enumerable: true,
          writable: true
        });
      });
    }, "polyfill");
  }
});

// ../../node_modules/.pnpm/html-rewriter-wasm@0.4.1/node_modules/html-rewriter-wasm/dist/html_rewriter.js
var require_html_rewriter = __commonJS({
  "../../node_modules/.pnpm/html-rewriter-wasm@0.4.1/node_modules/html-rewriter-wasm/dist/html_rewriter.js"(exports, module2) {
    init_import_meta_url();
    var imports = {};
    imports["__wbindgen_placeholder__"] = module2.exports;
    var wasm;
    var { awaitPromise, setWasmExports, wrap: wrap4 } = __require(String.raw`./asyncify.js`);
    var { TextDecoder: TextDecoder2, TextEncoder: TextEncoder4 } = __require(String.raw`util`);
    var heap = new Array(32).fill(void 0);
    heap.push(void 0, null, true, false);
    function getObject(idx) {
      return heap[idx];
    }
    __name(getObject, "getObject");
    var heap_next = heap.length;
    function dropObject(idx) {
      if (idx < 36) return;
      heap[idx] = heap_next;
      heap_next = idx;
    }
    __name(dropObject, "dropObject");
    function takeObject(idx) {
      const ret = getObject(idx);
      dropObject(idx);
      return ret;
    }
    __name(takeObject, "takeObject");
    var cachedTextDecoder = new TextDecoder2("utf-8", { ignoreBOM: true, fatal: true });
    cachedTextDecoder.decode();
    var cachegetUint8Memory0 = null;
    function getUint8Memory0() {
      if (cachegetUint8Memory0 === null || cachegetUint8Memory0.buffer !== wasm.memory.buffer) {
        cachegetUint8Memory0 = new Uint8Array(wasm.memory.buffer);
      }
      return cachegetUint8Memory0;
    }
    __name(getUint8Memory0, "getUint8Memory0");
    function getStringFromWasm0(ptr, len) {
      return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
    }
    __name(getStringFromWasm0, "getStringFromWasm0");
    function addHeapObject(obj) {
      if (heap_next === heap.length) heap.push(heap.length + 1);
      const idx = heap_next;
      heap_next = heap[idx];
      heap[idx] = obj;
      return idx;
    }
    __name(addHeapObject, "addHeapObject");
    function debugString(val2) {
      const type = typeof val2;
      if (type == "number" || type == "boolean" || val2 == null) {
        return `${val2}`;
      }
      if (type == "string") {
        return `"${val2}"`;
      }
      if (type == "symbol") {
        const description = val2.description;
        if (description == null) {
          return "Symbol";
        } else {
          return `Symbol(${description})`;
        }
      }
      if (type == "function") {
        const name2 = val2.name;
        if (typeof name2 == "string" && name2.length > 0) {
          return `Function(${name2})`;
        } else {
          return "Function";
        }
      }
      if (Array.isArray(val2)) {
        const length = val2.length;
        let debug2 = "[";
        if (length > 0) {
          debug2 += debugString(val2[0]);
        }
        for (let i7 = 1; i7 < length; i7++) {
          debug2 += ", " + debugString(val2[i7]);
        }
        debug2 += "]";
        return debug2;
      }
      const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val2));
      let className;
      if (builtInMatches.length > 1) {
        className = builtInMatches[1];
      } else {
        return toString.call(val2);
      }
      if (className == "Object") {
        try {
          return "Object(" + JSON.stringify(val2) + ")";
        } catch (_5) {
          return "Object";
        }
      }
      if (val2 instanceof Error) {
        return `${val2.name}: ${val2.message}
${val2.stack}`;
      }
      return className;
    }
    __name(debugString, "debugString");
    var WASM_VECTOR_LEN = 0;
    var cachedTextEncoder = new TextEncoder4("utf-8");
    var encodeString = typeof cachedTextEncoder.encodeInto === "function" ? function(arg, view) {
      return cachedTextEncoder.encodeInto(arg, view);
    } : function(arg, view) {
      const buf = cachedTextEncoder.encode(arg);
      view.set(buf);
      return {
        read: arg.length,
        written: buf.length
      };
    };
    function passStringToWasm0(arg, malloc, realloc) {
      if (realloc === void 0) {
        const buf = cachedTextEncoder.encode(arg);
        const ptr2 = malloc(buf.length);
        getUint8Memory0().subarray(ptr2, ptr2 + buf.length).set(buf);
        WASM_VECTOR_LEN = buf.length;
        return ptr2;
      }
      let len = arg.length;
      let ptr = malloc(len);
      const mem = getUint8Memory0();
      let offset = 0;
      for (; offset < len; offset++) {
        const code = arg.charCodeAt(offset);
        if (code > 127) break;
        mem[ptr + offset] = code;
      }
      if (offset !== len) {
        if (offset !== 0) {
          arg = arg.slice(offset);
        }
        ptr = realloc(ptr, len, len = offset + arg.length * 3);
        const view = getUint8Memory0().subarray(ptr + offset, ptr + len);
        const ret = encodeString(arg, view);
        offset += ret.written;
      }
      WASM_VECTOR_LEN = offset;
      return ptr;
    }
    __name(passStringToWasm0, "passStringToWasm0");
    var cachegetInt32Memory0 = null;
    function getInt32Memory0() {
      if (cachegetInt32Memory0 === null || cachegetInt32Memory0.buffer !== wasm.memory.buffer) {
        cachegetInt32Memory0 = new Int32Array(wasm.memory.buffer);
      }
      return cachegetInt32Memory0;
    }
    __name(getInt32Memory0, "getInt32Memory0");
    function isLikeNone(x7) {
      return x7 === void 0 || x7 === null;
    }
    __name(isLikeNone, "isLikeNone");
    var stack_pointer = 32;
    function addBorrowedObject(obj) {
      if (stack_pointer == 1) throw new Error("out of js stack");
      heap[--stack_pointer] = obj;
      return stack_pointer;
    }
    __name(addBorrowedObject, "addBorrowedObject");
    function passArray8ToWasm0(arg, malloc) {
      const ptr = malloc(arg.length * 1);
      getUint8Memory0().set(arg, ptr / 1);
      WASM_VECTOR_LEN = arg.length;
      return ptr;
    }
    __name(passArray8ToWasm0, "passArray8ToWasm0");
    function handleError2(f8, args) {
      try {
        return f8.apply(this, args);
      } catch (e10) {
        wasm.__wbindgen_exn_store(addHeapObject(e10));
      }
    }
    __name(handleError2, "handleError");
    var Comment = class _Comment {
      static {
        __name(this, "Comment");
      }
      static __wrap(ptr) {
        const obj = Object.create(_Comment.prototype);
        obj.ptr = ptr;
        return obj;
      }
      __destroy_into_raw() {
        const ptr = this.ptr;
        this.ptr = 0;
        return ptr;
      }
      free() {
        const ptr = this.__destroy_into_raw();
        wasm.__wbg_comment_free(ptr);
      }
      /**
      * @param {string} content
      * @param {any | undefined} content_type
      */
      before(content, content_type) {
        var ptr0 = passStringToWasm0(content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
        var len0 = WASM_VECTOR_LEN;
        wasm.comment_before(this.ptr, ptr0, len0, isLikeNone(content_type) ? 0 : addHeapObject(content_type));
        return this;
      }
      /**
      * @param {string} content
      * @param {any | undefined} content_type
      */
      after(content, content_type) {
        var ptr0 = passStringToWasm0(content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
        var len0 = WASM_VECTOR_LEN;
        wasm.comment_after(this.ptr, ptr0, len0, isLikeNone(content_type) ? 0 : addHeapObject(content_type));
        return this;
      }
      /**
      * @param {string} content
      * @param {any | undefined} content_type
      */
      replace(content, content_type) {
        var ptr0 = passStringToWasm0(content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
        var len0 = WASM_VECTOR_LEN;
        wasm.comment_replace(this.ptr, ptr0, len0, isLikeNone(content_type) ? 0 : addHeapObject(content_type));
        return this;
      }
      /**
      */
      remove() {
        wasm.comment_remove(this.ptr);
        return this;
      }
      /**
      * @returns {boolean}
      */
      get removed() {
        var ret = wasm.comment_removed(this.ptr);
        return ret !== 0;
      }
      /**
      * @returns {string}
      */
      get text() {
        try {
          const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
          wasm.comment_text(retptr, this.ptr);
          var r0 = getInt32Memory0()[retptr / 4 + 0];
          var r1 = getInt32Memory0()[retptr / 4 + 1];
          return getStringFromWasm0(r0, r1);
        } finally {
          wasm.__wbindgen_add_to_stack_pointer(16);
          wasm.__wbindgen_free(r0, r1);
        }
      }
      /**
      * @param {string} text
      */
      set text(text) {
        var ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
        var len0 = WASM_VECTOR_LEN;
        wasm.comment_set_text(this.ptr, ptr0, len0);
      }
    };
    module2.exports.Comment = Comment;
    var Doctype = class _Doctype {
      static {
        __name(this, "Doctype");
      }
      static __wrap(ptr) {
        const obj = Object.create(_Doctype.prototype);
        obj.ptr = ptr;
        return obj;
      }
      __destroy_into_raw() {
        const ptr = this.ptr;
        this.ptr = 0;
        return ptr;
      }
      free() {
        const ptr = this.__destroy_into_raw();
        wasm.__wbg_doctype_free(ptr);
      }
      /**
      * @returns {any}
      */
      get name() {
        var ret = wasm.doctype_name(this.ptr);
        return takeObject(ret);
      }
      /**
      * @returns {any}
      */
      get publicId() {
        var ret = wasm.doctype_public_id(this.ptr);
        return takeObject(ret);
      }
      /**
      * @returns {any}
      */
      get systemId() {
        var ret = wasm.doctype_system_id(this.ptr);
        return takeObject(ret);
      }
    };
    module2.exports.Doctype = Doctype;
    var DocumentEnd = class _DocumentEnd {
      static {
        __name(this, "DocumentEnd");
      }
      static __wrap(ptr) {
        const obj = Object.create(_DocumentEnd.prototype);
        obj.ptr = ptr;
        return obj;
      }
      __destroy_into_raw() {
        const ptr = this.ptr;
        this.ptr = 0;
        return ptr;
      }
      free() {
        const ptr = this.__destroy_into_raw();
        wasm.__wbg_documentend_free(ptr);
      }
      /**
      * @param {string} content
      * @param {any | undefined} content_type
      */
      append(content, content_type) {
        var ptr0 = passStringToWasm0(content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
        var len0 = WASM_VECTOR_LEN;
        wasm.documentend_append(this.ptr, ptr0, len0, isLikeNone(content_type) ? 0 : addHeapObject(content_type));
        return this;
      }
    };
    module2.exports.DocumentEnd = DocumentEnd;
    var Element2 = class _Element {
      static {
        __name(this, "Element");
      }
      static __wrap(ptr) {
        const obj = Object.create(_Element.prototype);
        obj.ptr = ptr;
        return obj;
      }
      __destroy_into_raw() {
        const ptr = this.ptr;
        this.ptr = 0;
        return ptr;
      }
      free() {
        const ptr = this.__destroy_into_raw();
        wasm.__wbg_element_free(ptr);
      }
      /**
      * @param {string} content
      * @param {any | undefined} content_type
      */
      before(content, content_type) {
        var ptr0 = passStringToWasm0(content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
        var len0 = WASM_VECTOR_LEN;
        wasm.element_before(this.ptr, ptr0, len0, isLikeNone(content_type) ? 0 : addHeapObject(content_type));
        return this;
      }
      /**
      * @param {string} content
      * @param {any | undefined} content_type
      */
      after(content, content_type) {
        var ptr0 = passStringToWasm0(content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
        var len0 = WASM_VECTOR_LEN;
        wasm.element_after(this.ptr, ptr0, len0, isLikeNone(content_type) ? 0 : addHeapObject(content_type));
        return this;
      }
      /**
      * @param {string} content
      * @param {any | undefined} content_type
      */
      replace(content, content_type) {
        var ptr0 = passStringToWasm0(content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
        var len0 = WASM_VECTOR_LEN;
        wasm.element_replace(this.ptr, ptr0, len0, isLikeNone(content_type) ? 0 : addHeapObject(content_type));
        return this;
      }
      /**
      */
      remove() {
        wasm.element_remove(this.ptr);
        return this;
      }
      /**
      * @returns {boolean}
      */
      get removed() {
        var ret = wasm.element_removed(this.ptr);
        return ret !== 0;
      }
      /**
      * @returns {string}
      */
      get tagName() {
        try {
          const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
          wasm.element_tag_name(retptr, this.ptr);
          var r0 = getInt32Memory0()[retptr / 4 + 0];
          var r1 = getInt32Memory0()[retptr / 4 + 1];
          return getStringFromWasm0(r0, r1);
        } finally {
          wasm.__wbindgen_add_to_stack_pointer(16);
          wasm.__wbindgen_free(r0, r1);
        }
      }
      /**
      * @param {string} name
      */
      set tagName(name2) {
        var ptr0 = passStringToWasm0(name2, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
        var len0 = WASM_VECTOR_LEN;
        wasm.element_set_tag_name(this.ptr, ptr0, len0);
      }
      /**
      * @returns {any}
      */
      get namespaceURI() {
        var ret = wasm.element_namespace_uri(this.ptr);
        return takeObject(ret);
      }
      /**
      * @returns {any}
      */
      get attributes() {
        var ret = wasm.element_attributes(this.ptr);
        return takeObject(ret)[Symbol.iterator]();
      }
      /**
      * @param {string} name
      * @returns {any}
      */
      getAttribute(name2) {
        var ptr0 = passStringToWasm0(name2, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
        var len0 = WASM_VECTOR_LEN;
        var ret = wasm.element_getAttribute(this.ptr, ptr0, len0);
        return takeObject(ret);
      }
      /**
      * @param {string} name
      * @returns {boolean}
      */
      hasAttribute(name2) {
        var ptr0 = passStringToWasm0(name2, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
        var len0 = WASM_VECTOR_LEN;
        var ret = wasm.element_hasAttribute(this.ptr, ptr0, len0);
        return ret !== 0;
      }
      /**
      * @param {string} name
      * @param {string} value
      */
      setAttribute(name2, value) {
        var ptr0 = passStringToWasm0(name2, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
        var len0 = WASM_VECTOR_LEN;
        var ptr1 = passStringToWasm0(value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
        var len1 = WASM_VECTOR_LEN;
        wasm.element_setAttribute(this.ptr, ptr0, len0, ptr1, len1);
        return this;
      }
      /**
      * @param {string} name
      */
      removeAttribute(name2) {
        var ptr0 = passStringToWasm0(name2, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
        var len0 = WASM_VECTOR_LEN;
        wasm.element_removeAttribute(this.ptr, ptr0, len0);
        return this;
      }
      /**
      * @param {string} content
      * @param {any | undefined} content_type
      */
      prepend(content, content_type) {
        var ptr0 = passStringToWasm0(content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
        var len0 = WASM_VECTOR_LEN;
        wasm.element_prepend(this.ptr, ptr0, len0, isLikeNone(content_type) ? 0 : addHeapObject(content_type));
        return this;
      }
      /**
      * @param {string} content
      * @param {any | undefined} content_type
      */
      append(content, content_type) {
        var ptr0 = passStringToWasm0(content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
        var len0 = WASM_VECTOR_LEN;
        wasm.element_append(this.ptr, ptr0, len0, isLikeNone(content_type) ? 0 : addHeapObject(content_type));
        return this;
      }
      /**
      * @param {string} content
      * @param {any | undefined} content_type
      */
      setInnerContent(content, content_type) {
        var ptr0 = passStringToWasm0(content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
        var len0 = WASM_VECTOR_LEN;
        wasm.element_setInnerContent(this.ptr, ptr0, len0, isLikeNone(content_type) ? 0 : addHeapObject(content_type));
        return this;
      }
      /**
      */
      removeAndKeepContent() {
        wasm.element_removeAndKeepContent(this.ptr);
        return this;
      }
      /**
      * @param {any} handler
      */
      onEndTag(handler) {
        wasm.element_onEndTag(this.ptr, addHeapObject(handler.bind(this)));
      }
    };
    module2.exports.Element = Element2;
    var EndTag = class _EndTag {
      static {
        __name(this, "EndTag");
      }
      static __wrap(ptr) {
        const obj = Object.create(_EndTag.prototype);
        obj.ptr = ptr;
        return obj;
      }
      __destroy_into_raw() {
        const ptr = this.ptr;
        this.ptr = 0;
        return ptr;
      }
      free() {
        const ptr = this.__destroy_into_raw();
        wasm.__wbg_endtag_free(ptr);
      }
      /**
      * @returns {string}
      */
      get name() {
        try {
          const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
          wasm.endtag_name(retptr, this.ptr);
          var r0 = getInt32Memory0()[retptr / 4 + 0];
          var r1 = getInt32Memory0()[retptr / 4 + 1];
          return getStringFromWasm0(r0, r1);
        } finally {
          wasm.__wbindgen_add_to_stack_pointer(16);
          wasm.__wbindgen_free(r0, r1);
        }
      }
      /**
      * @param {string} name
      */
      set name(name2) {
        var ptr0 = passStringToWasm0(name2, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
        var len0 = WASM_VECTOR_LEN;
        wasm.endtag_set_name(this.ptr, ptr0, len0);
      }
      /**
      * @param {string} content
      * @param {any | undefined} content_type
      */
      before(content, content_type) {
        var ptr0 = passStringToWasm0(content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
        var len0 = WASM_VECTOR_LEN;
        wasm.endtag_before(this.ptr, ptr0, len0, isLikeNone(content_type) ? 0 : addHeapObject(content_type));
        return this;
      }
      /**
      * @param {string} content
      * @param {any | undefined} content_type
      */
      after(content, content_type) {
        var ptr0 = passStringToWasm0(content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
        var len0 = WASM_VECTOR_LEN;
        wasm.endtag_after(this.ptr, ptr0, len0, isLikeNone(content_type) ? 0 : addHeapObject(content_type));
        return this;
      }
      /**
      */
      remove() {
        wasm.endtag_remove(this.ptr);
        return this;
      }
    };
    module2.exports.EndTag = EndTag;
    var HTMLRewriter3 = class _HTMLRewriter {
      static {
        __name(this, "HTMLRewriter");
      }
      static __wrap(ptr) {
        const obj = Object.create(_HTMLRewriter.prototype);
        obj.ptr = ptr;
        return obj;
      }
      __destroy_into_raw() {
        const ptr = this.ptr;
        this.ptr = 0;
        return ptr;
      }
      free() {
        const ptr = this.__destroy_into_raw();
        wasm.__wbg_htmlrewriter_free(ptr);
      }
      /**
      * @param {any} output_sink
      * @param {any | undefined} options
      */
      constructor(output_sink, options) {
        try {
          var ret = wasm.htmlrewriter_new(addBorrowedObject(output_sink), isLikeNone(options) ? 0 : addHeapObject(options));
          return _HTMLRewriter.__wrap(ret);
        } finally {
          heap[stack_pointer++] = void 0;
        }
      }
      /**
      * @param {string} selector
      * @param {any} handlers
      */
      on(selector, handlers2) {
        var ptr0 = passStringToWasm0(selector, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
        var len0 = WASM_VECTOR_LEN;
        wasm.htmlrewriter_on(this.ptr, ptr0, len0, addHeapObject(handlers2));
        return this;
      }
      /**
      * @param {any} handlers
      */
      onDocument(handlers2) {
        wasm.htmlrewriter_onDocument(this.ptr, addHeapObject(handlers2));
        return this;
      }
      /**
      * @param {Uint8Array} chunk
      */
      async write(chunk) {
        var ptr0 = passArray8ToWasm0(chunk, wasm.__wbindgen_malloc);
        var len0 = WASM_VECTOR_LEN;
        await wrap4(this, wasm.htmlrewriter_write, this.ptr, ptr0, len0);
      }
      /**
      */
      async end() {
        await wrap4(this, wasm.htmlrewriter_end, this.ptr);
      }
      /**
      * @returns {number}
      */
      get asyncifyStackPtr() {
        var ret = wasm.htmlrewriter_asyncify_stack_ptr(this.ptr);
        return ret;
      }
    };
    module2.exports.HTMLRewriter = HTMLRewriter3;
    var TextChunk = class _TextChunk {
      static {
        __name(this, "TextChunk");
      }
      static __wrap(ptr) {
        const obj = Object.create(_TextChunk.prototype);
        obj.ptr = ptr;
        return obj;
      }
      __destroy_into_raw() {
        const ptr = this.ptr;
        this.ptr = 0;
        return ptr;
      }
      free() {
        const ptr = this.__destroy_into_raw();
        wasm.__wbg_textchunk_free(ptr);
      }
      /**
      * @param {string} content
      * @param {any | undefined} content_type
      */
      before(content, content_type) {
        var ptr0 = passStringToWasm0(content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
        var len0 = WASM_VECTOR_LEN;
        wasm.textchunk_before(this.ptr, ptr0, len0, isLikeNone(content_type) ? 0 : addHeapObject(content_type));
        return this;
      }
      /**
      * @param {string} content
      * @param {any | undefined} content_type
      */
      after(content, content_type) {
        var ptr0 = passStringToWasm0(content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
        var len0 = WASM_VECTOR_LEN;
        wasm.textchunk_after(this.ptr, ptr0, len0, isLikeNone(content_type) ? 0 : addHeapObject(content_type));
        return this;
      }
      /**
      * @param {string} content
      * @param {any | undefined} content_type
      */
      replace(content, content_type) {
        var ptr0 = passStringToWasm0(content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
        var len0 = WASM_VECTOR_LEN;
        wasm.textchunk_replace(this.ptr, ptr0, len0, isLikeNone(content_type) ? 0 : addHeapObject(content_type));
        return this;
      }
      /**
      */
      remove() {
        wasm.textchunk_remove(this.ptr);
        return this;
      }
      /**
      * @returns {boolean}
      */
      get removed() {
        var ret = wasm.textchunk_removed(this.ptr);
        return ret !== 0;
      }
      /**
      * @returns {string}
      */
      get text() {
        try {
          const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
          wasm.textchunk_text(retptr, this.ptr);
          var r0 = getInt32Memory0()[retptr / 4 + 0];
          var r1 = getInt32Memory0()[retptr / 4 + 1];
          return getStringFromWasm0(r0, r1);
        } finally {
          wasm.__wbindgen_add_to_stack_pointer(16);
          wasm.__wbindgen_free(r0, r1);
        }
      }
      /**
      * @returns {boolean}
      */
      get lastInTextNode() {
        var ret = wasm.textchunk_last_in_text_node(this.ptr);
        return ret !== 0;
      }
    };
    module2.exports.TextChunk = TextChunk;
    module2.exports.__wbindgen_object_drop_ref = function(arg0) {
      takeObject(arg0);
    };
    module2.exports.__wbg_html_cd9a0f328493678b = function(arg0) {
      var ret = getObject(arg0).html;
      return isLikeNone(ret) ? 16777215 : ret ? 1 : 0;
    };
    module2.exports.__wbindgen_string_new = function(arg0, arg1) {
      var ret = getStringFromWasm0(arg0, arg1);
      return addHeapObject(ret);
    };
    module2.exports.__wbg_documentend_new = function(arg0) {
      var ret = DocumentEnd.__wrap(arg0);
      return addHeapObject(ret);
    };
    module2.exports.__wbg_awaitPromise_39a1101fd8518869 = function(arg0, arg1) {
      awaitPromise(arg0, getObject(arg1));
    };
    module2.exports.__wbindgen_object_clone_ref = function(arg0) {
      var ret = getObject(arg0);
      return addHeapObject(ret);
    };
    module2.exports.__wbg_element_c38470ed972aea27 = function(arg0) {
      var ret = getObject(arg0).element;
      return isLikeNone(ret) ? 0 : addHeapObject(ret);
    };
    module2.exports.__wbg_comments_ba86bc03331d9378 = function(arg0) {
      var ret = getObject(arg0).comments;
      return isLikeNone(ret) ? 0 : addHeapObject(ret);
    };
    module2.exports.__wbg_text_7800bf26cb443911 = function(arg0) {
      var ret = getObject(arg0).text;
      return isLikeNone(ret) ? 0 : addHeapObject(ret);
    };
    module2.exports.__wbg_element_new = function(arg0) {
      var ret = Element2.__wrap(arg0);
      return addHeapObject(ret);
    };
    module2.exports.__wbg_comment_new = function(arg0) {
      var ret = Comment.__wrap(arg0);
      return addHeapObject(ret);
    };
    module2.exports.__wbg_textchunk_new = function(arg0) {
      var ret = TextChunk.__wrap(arg0);
      return addHeapObject(ret);
    };
    module2.exports.__wbg_doctype_ac58c0964a59b61b = function(arg0) {
      var ret = getObject(arg0).doctype;
      return isLikeNone(ret) ? 0 : addHeapObject(ret);
    };
    module2.exports.__wbg_comments_94d876f6c0502e82 = function(arg0) {
      var ret = getObject(arg0).comments;
      return isLikeNone(ret) ? 0 : addHeapObject(ret);
    };
    module2.exports.__wbg_text_4606a16c30e4ae91 = function(arg0) {
      var ret = getObject(arg0).text;
      return isLikeNone(ret) ? 0 : addHeapObject(ret);
    };
    module2.exports.__wbg_end_34efb9402eac8a4e = function(arg0) {
      var ret = getObject(arg0).end;
      return isLikeNone(ret) ? 0 : addHeapObject(ret);
    };
    module2.exports.__wbg_doctype_new = function(arg0) {
      var ret = Doctype.__wrap(arg0);
      return addHeapObject(ret);
    };
    module2.exports.__wbg_endtag_new = function(arg0) {
      var ret = EndTag.__wrap(arg0);
      return addHeapObject(ret);
    };
    module2.exports.__wbg_enableEsiTags_de6b91cc61a25874 = function(arg0) {
      var ret = getObject(arg0).enableEsiTags;
      return isLikeNone(ret) ? 16777215 : ret ? 1 : 0;
    };
    module2.exports.__wbg_String_60c4ba333b5ca1c6 = function(arg0, arg1) {
      var ret = String(getObject(arg1));
      var ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
      var len0 = WASM_VECTOR_LEN;
      getInt32Memory0()[arg0 / 4 + 1] = len0;
      getInt32Memory0()[arg0 / 4 + 0] = ptr0;
    };
    module2.exports.__wbg_new_4fee7e2900033464 = function() {
      var ret = new Array();
      return addHeapObject(ret);
    };
    module2.exports.__wbg_push_ba9b5e3c25cff8f9 = function(arg0, arg1) {
      var ret = getObject(arg0).push(getObject(arg1));
      return ret;
    };
    module2.exports.__wbg_call_6c4ea719458624eb = function() {
      return handleError2(function(arg0, arg1, arg2) {
        var ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
        return addHeapObject(ret);
      }, arguments);
    };
    module2.exports.__wbg_new_917809a3e20a4b00 = function(arg0, arg1) {
      var ret = new TypeError(getStringFromWasm0(arg0, arg1));
      return addHeapObject(ret);
    };
    module2.exports.__wbg_instanceof_Promise_c6535fc791fcc4d2 = function(arg0) {
      var obj = getObject(arg0);
      var ret = obj instanceof Promise || Object.prototype.toString.call(obj) === "[object Promise]";
      return ret;
    };
    module2.exports.__wbg_buffer_89a8560ab6a3d9c6 = function(arg0) {
      var ret = getObject(arg0).buffer;
      return addHeapObject(ret);
    };
    module2.exports.__wbg_newwithbyteoffsetandlength_e45d8b33c02dc3b5 = function(arg0, arg1, arg2) {
      var ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
      return addHeapObject(ret);
    };
    module2.exports.__wbg_new_bd2e1d010adb8a1a = function(arg0) {
      var ret = new Uint8Array(getObject(arg0));
      return addHeapObject(ret);
    };
    module2.exports.__wbindgen_debug_string = function(arg0, arg1) {
      var ret = debugString(getObject(arg1));
      var ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
      var len0 = WASM_VECTOR_LEN;
      getInt32Memory0()[arg0 / 4 + 1] = len0;
      getInt32Memory0()[arg0 / 4 + 0] = ptr0;
    };
    module2.exports.__wbindgen_throw = function(arg0, arg1) {
      throw new Error(getStringFromWasm0(arg0, arg1));
    };
    module2.exports.__wbindgen_rethrow = function(arg0) {
      throw takeObject(arg0);
    };
    module2.exports.__wbindgen_memory = function() {
      var ret = wasm.memory;
      return addHeapObject(ret);
    };
    var path84 = __require("path").join(__dirname, "html_rewriter_bg.wasm");
    var bytes = __require("fs").readFileSync(path84);
    var wasmModule = new WebAssembly.Module(bytes);
    var wasmInstance = new WebAssembly.Instance(wasmModule, imports);
    wasm = wasmInstance.exports;
    setWasmExports(wasm);
    module2.exports.__wasm = wasm;
  }
});

// ../pages-shared/environment-polyfills/html-rewriter.ts
var html_rewriter_exports = {};
__export(html_rewriter_exports, {
  HTMLRewriter: () => HTMLRewriter2
});
var HTMLRewriter2;
var init_html_rewriter = __esm({
  "../pages-shared/environment-polyfills/html-rewriter.ts"() {
    init_import_meta_url();
    HTMLRewriter2 = class {
      static {
        __name(this, "HTMLRewriter");
      }
      #elementHandlers = [];
      #documentHandlers = [];
      on(selector, handlers2) {
        this.#elementHandlers.push([selector, handlers2]);
        return this;
      }
      onDocument(handlers2) {
        this.#documentHandlers.push(handlers2);
        return this;
      }
      transform(response) {
        const body = response.body;
        if (body === null) {
          return new miniflare.Response(body, response);
        }
        response = new miniflare.Response(response.body, response);
        let rewriter;
        const transformStream = new web.TransformStream({
          start: /* @__PURE__ */ __name(async (controller) => {
            const {
              HTMLRewriter: BaseHTMLRewriter
              // eslint-disable-next-line @typescript-eslint/consistent-type-imports
            } = await Promise.resolve().then(() => __toESM(require_html_rewriter()));
            rewriter = new BaseHTMLRewriter((output) => {
              if (output.length !== 0) {
                controller.enqueue(output);
              }
            });
            for (const [selector, handlers2] of this.#elementHandlers) {
              rewriter.on(selector, handlers2);
            }
            for (const handlers2 of this.#documentHandlers) {
              rewriter.onDocument(handlers2);
            }
          }, "start"),
          // The finally() below will ensure the rewriter is always freed.
          // chunk is guaranteed to be a Uint8Array as we're using the
          // @miniflare/core Response class, which transforms to a byte stream.
          transform: /* @__PURE__ */ __name((chunk) => rewriter.write(chunk), "transform"),
          flush: /* @__PURE__ */ __name(() => rewriter.end(), "flush")
        });
        const promise = body.pipeTo(transformStream.writable);
        promise.catch(() => {
        }).finally(() => rewriter.free());
        const res = new miniflare.Response(transformStream.readable, response);
        res.headers.delete("Content-Length");
        return res;
      }
    };
  }
});

// ../pages-shared/environment-polyfills/miniflare.ts
var miniflare_exports2 = {};
__export(miniflare_exports2, {
  default: () => miniflare_default
});
var miniflare_default;
var init_miniflare2 = __esm({
  "../pages-shared/environment-polyfills/miniflare.ts"() {
    init_import_meta_url();
    init_environment_polyfills();
    miniflare_default = /* @__PURE__ */ __name(async () => {
      const { HTMLRewriter: HTMLRewriter3 } = await Promise.resolve().then(() => (init_html_rewriter(), html_rewriter_exports));
      const mf = await import('miniflare');
      polyfill({
        fetch: mf.fetch,
        Headers: mf.Headers,
        Request: mf.Request,
        Response: mf.Response,
        HTMLRewriter: HTMLRewriter3
      });
    }, "default");
  }
});

// ../workers-shared/utils/responses.ts
var init_responses2 = __esm({
  "../workers-shared/utils/responses.ts"() {
    init_import_meta_url();
  }
});

// ../workers-shared/utils/tracing.ts
var init_tracing2 = __esm({
  "../workers-shared/utils/tracing.ts"() {
    init_import_meta_url();
  }
});

// ../workers-shared/asset-worker/src/compatibility-flags.ts
var init_compatibility_flags = __esm({
  "../workers-shared/asset-worker/src/compatibility-flags.ts"() {
    init_import_meta_url();
  }
});

// ../workers-shared/asset-worker/src/constants.ts
var init_constants22 = __esm({
  "../workers-shared/asset-worker/src/constants.ts"() {
    init_import_meta_url();
  }
});

// ../workers-shared/asset-worker/src/utils/headers.ts
var init_headers = __esm({
  "../workers-shared/asset-worker/src/utils/headers.ts"() {
    init_import_meta_url();
    init_tracing2();
    init_compatibility_flags();
    init_constants22();
    init_handler2();
    init_rules_engine();
  }
});

// ../workers-shared/asset-worker/src/handler.ts
var init_handler2 = __esm({
  "../workers-shared/asset-worker/src/handler.ts"() {
    init_import_meta_url();
    init_responses2();
    init_tracing2();
    init_compatibility_flags();
    init_headers();
    init_rules_engine();
  }
});

// ../workers-shared/asset-worker/src/utils/rules-engine.ts
var ESCAPE_REGEX_CHARACTERS2, escapeRegex2, HOST_PLACEHOLDER_REGEX, PLACEHOLDER_REGEX2, replacer, generateRuleRegExp, generateRulesMatcher;
var init_rules_engine = __esm({
  "../workers-shared/asset-worker/src/utils/rules-engine.ts"() {
    init_import_meta_url();
    init_handler2();
    ESCAPE_REGEX_CHARACTERS2 = /[-/\\^$*+?.()|[\]{}]/g;
    escapeRegex2 = /* @__PURE__ */ __name((str) => {
      return str.replace(ESCAPE_REGEX_CHARACTERS2, "\\$&");
    }, "escapeRegex");
    HOST_PLACEHOLDER_REGEX = /(?<=^https:\\\/\\\/[^/]*?):([A-Za-z]\w*)(?=\\)/g;
    PLACEHOLDER_REGEX2 = /:([A-Za-z]\w*)/g;
    replacer = /* @__PURE__ */ __name((str, replacements) => {
      for (const [replacement, value] of Object.entries(replacements)) {
        str = str.replaceAll(`:${replacement}`, value);
      }
      return str;
    }, "replacer");
    generateRuleRegExp = /* @__PURE__ */ __name((rule) => {
      rule = rule.split("*").map(escapeRegex2).join("(?<splat>.*)");
      const host_matches = rule.matchAll(HOST_PLACEHOLDER_REGEX);
      for (const host_match of host_matches) {
        rule = rule.split(host_match[0]).join(`(?<${host_match[1]}>[^/.]+)`);
      }
      const path_matches = rule.matchAll(PLACEHOLDER_REGEX2);
      for (const path_match of path_matches) {
        rule = rule.split(path_match[0]).join(`(?<${path_match[1]}>[^/]+)`);
      }
      rule = "^" + rule + "$";
      return RegExp(rule);
    }, "generateRuleRegExp");
    generateRulesMatcher = /* @__PURE__ */ __name((rules, replacerFn = (match3) => match3) => {
      if (!rules) {
        return () => [];
      }
      const compiledRules = Object.entries(rules).map(([rule, match3]) => {
        const crossHost = rule.startsWith("https://");
        try {
          const regExp = generateRuleRegExp(rule);
          return [{ crossHost, regExp }, match3];
        } catch {
        }
      }).filter((value) => value !== void 0);
      return ({ request: request4 }) => {
        const { pathname, hostname: hostname2 } = new URL(request4.url);
        return compiledRules.map(([{ crossHost, regExp }, match3]) => {
          const test = crossHost ? `https://${hostname2}${pathname}` : pathname;
          const result = regExp.exec(test);
          if (result) {
            return replacerFn(match3, result.groups || {});
          }
        }).filter((value) => value !== void 0);
      };
    }, "generateRulesMatcher");
  }
});

// ../pages-shared/asset-server/responses.ts
function mergeHeaders(base, extra) {
  const baseHeaders = new Headers(base ?? {});
  const extraHeaders = new Headers(extra ?? {});
  return new Headers({
    ...Object.fromEntries(baseHeaders.entries()),
    ...Object.fromEntries(extraHeaders.entries())
  });
}
function stripLeadingDoubleSlashes(location) {
  return location.replace(/^(\/|%2F|%2f|%5C|%5c|%09|\s|\\)+(.*)/, "/$2");
}
var OkResponse2, MovedPermanentlyResponse2, FoundResponse2, NotModifiedResponse2, PermanentRedirectResponse2, NotFoundResponse2, MethodNotAllowedResponse2, NotAcceptableResponse, InternalServerErrorResponse2, SeeOtherResponse2, TemporaryRedirectResponse2;
var init_responses3 = __esm({
  "../pages-shared/asset-server/responses.ts"() {
    init_import_meta_url();
    __name(mergeHeaders, "mergeHeaders");
    __name(stripLeadingDoubleSlashes, "stripLeadingDoubleSlashes");
    OkResponse2 = class extends Response {
      static {
        __name(this, "OkResponse");
      }
      constructor(...[body, init4]) {
        super(body, {
          ...init4,
          status: 200,
          statusText: "OK"
        });
      }
    };
    MovedPermanentlyResponse2 = class extends Response {
      static {
        __name(this, "MovedPermanentlyResponse");
      }
      constructor(location, init4, {
        preventLeadingDoubleSlash = true
      } = {
        preventLeadingDoubleSlash: true
      }) {
        location = preventLeadingDoubleSlash ? stripLeadingDoubleSlashes(location) : location;
        super(`Redirecting to ${location}`, {
          ...init4,
          status: 301,
          statusText: "Moved Permanently",
          headers: mergeHeaders(init4?.headers, {
            location
          })
        });
      }
    };
    FoundResponse2 = class extends Response {
      static {
        __name(this, "FoundResponse");
      }
      constructor(location, init4, {
        preventLeadingDoubleSlash = true
      } = {
        preventLeadingDoubleSlash: true
      }) {
        location = preventLeadingDoubleSlash ? stripLeadingDoubleSlashes(location) : location;
        super(`Redirecting to ${location}`, {
          ...init4,
          status: 302,
          statusText: "Found",
          headers: mergeHeaders(init4?.headers, {
            location
          })
        });
      }
    };
    NotModifiedResponse2 = class extends Response {
      static {
        __name(this, "NotModifiedResponse");
      }
      constructor(...[_body, _init]) {
        super(void 0, {
          status: 304,
          statusText: "Not Modified"
        });
      }
    };
    PermanentRedirectResponse2 = class extends Response {
      static {
        __name(this, "PermanentRedirectResponse");
      }
      constructor(location, init4, {
        preventLeadingDoubleSlash = true
      } = {
        preventLeadingDoubleSlash: true
      }) {
        location = preventLeadingDoubleSlash ? stripLeadingDoubleSlashes(location) : location;
        super(void 0, {
          ...init4,
          status: 308,
          statusText: "Permanent Redirect",
          headers: mergeHeaders(init4?.headers, {
            location
          })
        });
      }
    };
    NotFoundResponse2 = class extends Response {
      static {
        __name(this, "NotFoundResponse");
      }
      constructor(...[body, init4]) {
        super(body, {
          ...init4,
          status: 404,
          statusText: "Not Found"
        });
      }
    };
    MethodNotAllowedResponse2 = class extends Response {
      static {
        __name(this, "MethodNotAllowedResponse");
      }
      constructor(...[body, init4]) {
        super(body, {
          ...init4,
          status: 405,
          statusText: "Method Not Allowed"
        });
      }
    };
    NotAcceptableResponse = class extends Response {
      static {
        __name(this, "NotAcceptableResponse");
      }
      constructor(...[body, init4]) {
        super(body, {
          ...init4,
          status: 406,
          statusText: "Not Acceptable"
        });
      }
    };
    InternalServerErrorResponse2 = class extends Response {
      static {
        __name(this, "InternalServerErrorResponse");
      }
      constructor(err, init4) {
        let body = void 0;
        if (globalThis.DEBUG) {
          body = `${err.message}

${err.stack}`;
        }
        super(body, {
          ...init4,
          status: 500,
          statusText: "Internal Server Error"
        });
      }
    };
    SeeOtherResponse2 = class extends Response {
      static {
        __name(this, "SeeOtherResponse");
      }
      constructor(location, init4, {
        preventLeadingDoubleSlash = true
      } = {
        preventLeadingDoubleSlash: true
      }) {
        location = preventLeadingDoubleSlash ? stripLeadingDoubleSlashes(location) : location;
        super(`Redirecting to ${location}`, {
          ...init4,
          status: 303,
          statusText: "See Other",
          headers: mergeHeaders(init4?.headers, { location })
        });
      }
    };
    TemporaryRedirectResponse2 = class extends Response {
      static {
        __name(this, "TemporaryRedirectResponse");
      }
      constructor(location, init4, {
        preventLeadingDoubleSlash = true
      } = {
        preventLeadingDoubleSlash: true
      }) {
        location = preventLeadingDoubleSlash ? stripLeadingDoubleSlashes(location) : location;
        super(`Redirecting to ${location}`, {
          ...init4,
          status: 307,
          statusText: "Temporary Redirect",
          headers: mergeHeaders(init4?.headers, { location })
        });
      }
    };
  }
});

// ../pages-shared/asset-server/handler.ts
var handler_exports = {};
__export(handler_exports, {
  ANALYTICS_VERSION: () => ANALYTICS_VERSION2,
  ASSET_PRESERVATION_CACHE: () => ASSET_PRESERVATION_CACHE,
  CACHE_CONTROL_BROWSER: () => CACHE_CONTROL_BROWSER2,
  CACHE_PRESERVATION_WRITE_FREQUENCY: () => CACHE_PRESERVATION_WRITE_FREQUENCY,
  HEADERS_VERSION: () => HEADERS_VERSION3,
  HEADERS_VERSION_V1: () => HEADERS_VERSION_V1,
  REDIRECTS_VERSION: () => REDIRECTS_VERSION3,
  generateHandler: () => generateHandler,
  isPreservationCacheResponseExpiring: () => isPreservationCacheResponseExpiring,
  normaliseHeaders: () => normaliseHeaders,
  parseQualityWeightedList: () => parseQualityWeightedList
});
function normaliseHeaders(headers) {
  if (headers.version === HEADERS_VERSION3) {
    return headers.rules;
  } else if (headers.version === HEADERS_VERSION_V1) {
    return Object.keys(headers.rules).reduce(
      (acc, key) => {
        acc[key] = {
          set: headers.rules[key]
        };
        return acc;
      },
      {}
    );
  } else {
    return {};
  }
}
function generateETagHeader(assetKey) {
  const strongETag = `"${assetKey}"`;
  const weakETag = `W/"${assetKey}"`;
  return { strongETag, weakETag };
}
function checkIfNoneMatch(request4, strongETag, weakETag) {
  const ifNoneMatch = request4.headers.get("if-none-match");
  return ifNoneMatch === weakETag || ifNoneMatch === strongETag;
}
async function generateHandler({
  request: request4,
  metadata,
  xServerEnvHeader,
  xDeploymentIdHeader,
  xWebAnalyticsHeader,
  logError,
  setMetrics,
  findAssetEntryForPath,
  getAssetKey,
  negotiateContent,
  fetchAsset,
  generateNotFoundResponse = /* @__PURE__ */ __name(async (notFoundRequest, notFoundFindAssetEntryForPath, notFoundServeAsset) => {
    let assetEntry;
    if (assetEntry = await notFoundFindAssetEntryForPath("/index.html")) {
      return notFoundServeAsset(assetEntry, { preserve: false });
    }
    return new NotFoundResponse2();
  }, "generateNotFoundResponse"),
  attachAdditionalHeaders = /* @__PURE__ */ __name(() => {
  }, "attachAdditionalHeaders"),
  caches,
  waitUntil
}) {
  const url4 = new URL(request4.url);
  const { protocol, host, search } = url4;
  let { pathname } = url4;
  const earlyHintsCache = metadata.deploymentId ? await caches?.open(`eh:${metadata.deploymentId}`) : void 0;
  const headerRules = metadata.headers ? normaliseHeaders(metadata.headers) : {};
  const staticRules = metadata.redirects?.version === REDIRECTS_VERSION3 ? metadata.redirects.staticRules || {} : {};
  const staticRedirectsMatcher2 = /* @__PURE__ */ __name(() => {
    const withHostMatch = staticRules[`https://${host}${pathname}`];
    const withoutHostMatch = staticRules[pathname];
    if (withHostMatch && withoutHostMatch) {
      if (withHostMatch.lineNumber < withoutHostMatch.lineNumber) {
        return withHostMatch;
      } else {
        return withoutHostMatch;
      }
    }
    return withHostMatch || withoutHostMatch;
  }, "staticRedirectsMatcher");
  const generateRedirectsMatcher2 = /* @__PURE__ */ __name(() => generateRulesMatcher(
    metadata.redirects?.version === REDIRECTS_VERSION3 ? metadata.redirects.rules : {},
    ({ status: status2, to }, replacements) => ({
      status: status2,
      to: replacer(to, replacements)
    })
  ), "generateRedirectsMatcher");
  let assetEntry;
  async function generateResponse() {
    const match3 = staticRedirectsMatcher2() || generateRedirectsMatcher2()({ request: request4 })[0];
    if (match3) {
      if (match3.status === 200) {
        pathname = new URL(match3.to, request4.url).pathname;
      } else {
        const { status: status2, to } = match3;
        const destination = new URL(to, request4.url);
        const location = destination.origin === new URL(request4.url).origin ? `${destination.pathname}${destination.search || search}${destination.hash}` : `${destination.href.slice(0, destination.href.length - (destination.search.length + destination.hash.length))}${destination.search ? destination.search : search}${destination.hash}`;
        switch (status2) {
          case 301:
            return new MovedPermanentlyResponse2(location, void 0, {
              preventLeadingDoubleSlash: false
            });
          case 303:
            return new SeeOtherResponse2(location, void 0, {
              preventLeadingDoubleSlash: false
            });
          case 307:
            return new TemporaryRedirectResponse2(location, void 0, {
              preventLeadingDoubleSlash: false
            });
          case 308:
            return new PermanentRedirectResponse2(location, void 0, {
              preventLeadingDoubleSlash: false
            });
          case 302:
          default:
            return new FoundResponse2(location, void 0, {
              preventLeadingDoubleSlash: false
            });
        }
      }
    }
    if (!request4.method.match(/^(get|head)$/i)) {
      return new MethodNotAllowedResponse2();
    }
    try {
      pathname = globalThis.decodeURIComponent(pathname);
    } catch {
    }
    if (pathname.endsWith("/")) {
      if (assetEntry = await findAssetEntryForPath(`${pathname}index.html`)) {
        return serveAsset(assetEntry);
      } else if (pathname.endsWith("/index/")) {
        return new PermanentRedirectResponse2(
          `/${pathname.slice(1, -"index/".length)}${search}`
        );
      } else if (assetEntry = await findAssetEntryForPath(
        `${pathname.replace(/\/$/, ".html")}`
      )) {
        return new PermanentRedirectResponse2(
          `/${pathname.slice(1, -1)}${search}`
        );
      } else {
        return notFound();
      }
    }
    if (assetEntry = await findAssetEntryForPath(pathname)) {
      if (pathname.endsWith(".html")) {
        const extensionlessPath = pathname.slice(0, -".html".length);
        if (extensionlessPath.endsWith("/index")) {
          return new PermanentRedirectResponse2(
            `${extensionlessPath.replace(/\/index$/, "/")}${search}`
          );
        } else if (await findAssetEntryForPath(extensionlessPath) || extensionlessPath === "/") {
          return serveAsset(assetEntry);
        } else {
          return new PermanentRedirectResponse2(`${extensionlessPath}${search}`);
        }
      } else {
        return serveAsset(assetEntry);
      }
    } else if (pathname.endsWith("/index")) {
      return new PermanentRedirectResponse2(
        `/${pathname.slice(1, -"index".length)}${search}`
      );
    } else if (assetEntry = await findAssetEntryForPath(`${pathname}.html`)) {
      return serveAsset(assetEntry);
    }
    if (assetEntry = await findAssetEntryForPath(`${pathname}/index.html`)) {
      return new PermanentRedirectResponse2(`${pathname}/${search}`);
    } else {
      return notFound();
    }
  }
  __name(generateResponse, "generateResponse");
  function isNullBodyStatus(status2) {
    return [101, 204, 205, 304].includes(status2);
  }
  __name(isNullBodyStatus, "isNullBodyStatus");
  async function attachHeaders(response) {
    const existingHeaders = new Headers(response.headers);
    const eTag = existingHeaders.get("eTag")?.match(/^"(.*)"$/)?.[1];
    const extraHeaders = new Headers({
      "access-control-allow-origin": "*",
      "referrer-policy": "strict-origin-when-cross-origin",
      ...existingHeaders.has("content-type") ? { "x-content-type-options": "nosniff" } : {}
    });
    const headers = new Headers({
      // But we intentionally override existing headers
      ...Object.fromEntries(existingHeaders.entries()),
      ...Object.fromEntries(extraHeaders.entries())
    });
    if (earlyHintsCache && isHTMLContentType(response.headers.get("Content-Type")) && eTag) {
      const preEarlyHintsHeaders = new Headers(headers);
      const earlyHintsCacheKey = `${protocol}//${host}/${eTag}`;
      const earlyHintsResponse = await earlyHintsCache.match(earlyHintsCacheKey);
      if (earlyHintsResponse) {
        const earlyHintsLinkHeader = earlyHintsResponse.headers.get("Link");
        if (earlyHintsLinkHeader) {
          headers.set("Link", earlyHintsLinkHeader);
          if (setMetrics) {
            setMetrics({ earlyHintsResult: "used-hit" });
          }
        } else {
          if (setMetrics) {
            setMetrics({ earlyHintsResult: "notused-hit" });
          }
        }
      } else {
        if (setMetrics) {
          setMetrics({ earlyHintsResult: "notused-miss" });
        }
        const clonedResponse = response.clone();
        if (waitUntil) {
          waitUntil(
            (async () => {
              try {
                const links = [];
                const transformedResponse = new HTMLRewriter().on(
                  "link[rel~=preconnect],link[rel~=preload],link[rel~=modulepreload]",
                  {
                    element(element) {
                      for (const [attributeName] of element.attributes) {
                        if (!ALLOWED_EARLY_HINT_LINK_ATTRIBUTES.includes(
                          attributeName.toLowerCase()
                        )) {
                          return;
                        }
                      }
                      const href = element.getAttribute("href") || void 0;
                      const rel = element.getAttribute("rel") || void 0;
                      const as2 = element.getAttribute("as") || void 0;
                      if (href && !href.startsWith("data:") && rel) {
                        links.push({ href, rel, as: as2 });
                      }
                    }
                  }
                ).transform(clonedResponse);
                await transformedResponse.text();
                links.forEach(({ href, rel, as: as2 }) => {
                  let link = `<${href}>; rel="${rel}"`;
                  if (as2) {
                    link += `; as=${as2}`;
                  }
                  preEarlyHintsHeaders.append("Link", link);
                });
                const linkHeader = preEarlyHintsHeaders.get("Link");
                const earlyHintsHeaders = new Headers({
                  "Cache-Control": "max-age=2592000"
                  // 30 days
                });
                if (linkHeader) {
                  earlyHintsHeaders.append("Link", linkHeader);
                }
                await earlyHintsCache.put(
                  earlyHintsCacheKey,
                  new Response(null, { headers: earlyHintsHeaders })
                );
              } catch {
                await earlyHintsCache.put(
                  earlyHintsCacheKey,
                  new Response(null, {
                    headers: {
                      "Cache-Control": "max-age=86400"
                      // 1 day
                    }
                  })
                );
              }
            })()
          );
        }
      }
    } else {
      if (setMetrics) {
        setMetrics({ earlyHintsResult: "disabled" });
      }
    }
    const headersMatcher = generateRulesMatcher(
      headerRules,
      ({ set = {}, unset = [] }, replacements) => {
        const replacedSet = {};
        Object.keys(set).forEach((key) => {
          replacedSet[key] = replacer(set[key], replacements);
        });
        return {
          set: replacedSet,
          unset
        };
      }
    );
    const matches = headersMatcher({ request: request4 });
    const setMap = /* @__PURE__ */ new Set();
    matches.forEach(({ set = {}, unset = [] }) => {
      unset.forEach((key) => {
        headers.delete(key);
      });
      Object.keys(set).forEach((key) => {
        if (setMap.has(key.toLowerCase())) {
          headers.append(key, set[key]);
        } else {
          headers.set(key, set[key]);
          setMap.add(key.toLowerCase());
        }
      });
    });
    return new Response(
      isNullBodyStatus(response.status) ? null : response.body,
      {
        headers,
        status: response.status,
        statusText: response.statusText
      }
    );
  }
  __name(attachHeaders, "attachHeaders");
  const responseWithoutHeaders = await generateResponse();
  if (responseWithoutHeaders.status >= 500) {
    return responseWithoutHeaders;
  }
  const responseWithHeaders = await attachHeaders(responseWithoutHeaders);
  if (responseWithHeaders.status === 404) {
    if (responseWithHeaders.headers.has("cache-control")) {
      responseWithHeaders.headers.delete("cache-control");
    }
    responseWithHeaders.headers.append("cache-control", "no-store");
  }
  return responseWithHeaders;
  async function serveAsset(servingAssetEntry, options = { preserve: true }) {
    let content;
    try {
      content = negotiateContent(request4, servingAssetEntry);
    } catch {
      return new NotAcceptableResponse();
    }
    const assetKey = getAssetKey(servingAssetEntry, content);
    const { strongETag, weakETag } = generateETagHeader(assetKey);
    const isIfNoneMatch = checkIfNoneMatch(request4, strongETag, weakETag);
    if (isIfNoneMatch) {
      return new NotModifiedResponse2();
    }
    try {
      const asset = await fetchAsset(assetKey);
      const headers = {
        etag: strongETag,
        "content-type": asset.contentType
      };
      let encodeBody = "automatic";
      if (xServerEnvHeader) {
        headers["x-server-env"] = xServerEnvHeader;
      }
      if (xDeploymentIdHeader && metadata.deploymentId) {
        headers["x-deployment-id"] = metadata.deploymentId;
      }
      if (content.encoding) {
        encodeBody = "manual";
        headers["cache-control"] = "no-transform";
        headers["content-encoding"] = content.encoding;
      }
      const response = new OkResponse2(
        request4.method === "HEAD" ? null : asset.body,
        {
          headers,
          encodeBody
        }
      );
      if (isCacheable(request4)) {
        response.headers.append("cache-control", CACHE_CONTROL_BROWSER2);
      }
      attachAdditionalHeaders(response, content, servingAssetEntry, asset);
      if (isPreview(new URL(request4.url))) {
        response.headers.set("x-robots-tag", "noindex");
      }
      if (options.preserve && waitUntil && caches) {
        waitUntil(
          (async () => {
            try {
              const assetPreservationCache = await caches.open(
                ASSET_PRESERVATION_CACHE
              );
              const match3 = await assetPreservationCache.match(request4);
              if (!match3 || assetKey !== await match3.text() || isPreservationCacheResponseExpiring(match3)) {
                const preservedResponse = new Response(assetKey, response);
                preservedResponse.headers.set(
                  "cache-control",
                  CACHE_CONTROL_PRESERVATION
                );
                preservedResponse.headers.set("x-robots-tag", "noindex");
                await assetPreservationCache.put(
                  request4.url,
                  preservedResponse
                );
              }
            } catch (err) {
              logError(err);
            }
          })()
        );
      }
      if (isHTMLContentType(asset.contentType) && metadata.analytics?.version === ANALYTICS_VERSION2) {
        if (xWebAnalyticsHeader) {
          response.headers.set("x-cf-pages-analytics", "1");
        }
        return new HTMLRewriter().on("body", {
          element(e10) {
            e10.append(
              `<!-- Cloudflare Pages Analytics --><script defer src='https://static.cloudflareinsights.com/beacon.min.js' data-cf-beacon='{"token": "${metadata.analytics?.token}"}'></script><!-- Cloudflare Pages Analytics -->`,
              { html: true }
            );
          }
        }).transform(response);
      }
      return response;
    } catch (err) {
      logError(err);
      return new InternalServerErrorResponse2(err);
    }
  }
  async function notFound() {
    if (caches) {
      try {
        const assetPreservationCache = await caches.open(
          ASSET_PRESERVATION_CACHE
        );
        const preservedResponse = await assetPreservationCache.match(
          request4.url
        );
        if (preservedResponse) {
          if (setMetrics) {
            setMetrics({ preservationCacheResult: "checked-hit" });
          }
          const assetKey = await preservedResponse.text();
          if (isNullBodyStatus(preservedResponse.status)) {
            return new Response(null, preservedResponse);
          }
          if (assetKey) {
            const { strongETag, weakETag } = generateETagHeader(assetKey);
            const isIfNoneMatch = checkIfNoneMatch(
              request4,
              strongETag,
              weakETag
            );
            if (isIfNoneMatch) {
              if (setMetrics) {
                setMetrics({ preservationCacheResult: "not-modified" });
              }
              return new NotModifiedResponse2();
            }
            const asset = await fetchAsset(assetKey);
            if (asset) {
              return new Response(asset.body, preservedResponse);
            } else {
              logError(
                new Error(
                  `preservation cache contained assetKey that does not exist in storage: ${assetKey}`
                )
              );
            }
          } else {
            logError(new Error(`cached response had no assetKey: ${assetKey}`));
          }
        } else {
          if (setMetrics) {
            setMetrics({ preservationCacheResult: "checked-miss" });
          }
        }
      } catch (err) {
        logError(err);
      }
    } else {
      if (setMetrics) {
        setMetrics({ preservationCacheResult: "disabled" });
      }
    }
    let cwd2 = pathname;
    while (cwd2) {
      cwd2 = cwd2.slice(0, cwd2.lastIndexOf("/"));
      if (assetEntry = await findAssetEntryForPath(`${cwd2}/404.html`)) {
        let content;
        try {
          content = negotiateContent(request4, assetEntry);
        } catch {
          return new NotAcceptableResponse();
        }
        const assetKey = getAssetKey(assetEntry, content);
        try {
          const { body, contentType } = await fetchAsset(assetKey);
          const response = new NotFoundResponse2(body);
          response.headers.set("content-type", contentType);
          return response;
        } catch (err) {
          logError(err);
          return new InternalServerErrorResponse2(err);
        }
      }
    }
    return await generateNotFoundResponse(
      request4,
      findAssetEntryForPath,
      serveAsset
    );
  }
}
function parseQualityWeightedList(list = "") {
  const items = {};
  list.replace(/\s/g, "").split(",").forEach((el) => {
    const [item, weight] = el.split(";q=");
    items[item] = weight ? parseFloat(weight) : 1;
  });
  return items;
}
function isCacheable(request4) {
  return !request4.headers.has("authorization") && !request4.headers.has("range");
}
function isPreview(url4) {
  if (url4.hostname.endsWith(".pages.dev")) {
    return url4.hostname.split(".").length > 3 ? true : false;
  }
  return false;
}
function isPreservationCacheResponseExpiring(response) {
  const ageHeader = response.headers.get("age");
  if (!ageHeader) {
    return false;
  }
  try {
    const age = parseInt(ageHeader);
    const jitter = Math.floor(Math.random() * 43200);
    if (age > CACHE_PRESERVATION_WRITE_FREQUENCY + jitter) {
      return true;
    }
  } catch {
    return false;
  }
  return false;
}
function isHTMLContentType(contentType) {
  return contentType?.toLowerCase().startsWith("text/html") || false;
}
var ASSET_PRESERVATION_CACHE, CACHE_CONTROL_PRESERVATION, CACHE_PRESERVATION_WRITE_FREQUENCY, CACHE_CONTROL_BROWSER2, REDIRECTS_VERSION3, HEADERS_VERSION3, HEADERS_VERSION_V1, ANALYTICS_VERSION2, ALLOWED_EARLY_HINT_LINK_ATTRIBUTES;
var init_handler3 = __esm({
  "../pages-shared/asset-server/handler.ts"() {
    init_import_meta_url();
    init_rules_engine();
    init_responses3();
    ASSET_PRESERVATION_CACHE = "assetPreservationCacheV2";
    CACHE_CONTROL_PRESERVATION = "public, s-maxage=604800";
    CACHE_PRESERVATION_WRITE_FREQUENCY = 86400;
    CACHE_CONTROL_BROWSER2 = "public, max-age=0, must-revalidate";
    REDIRECTS_VERSION3 = 1;
    HEADERS_VERSION3 = 2;
    HEADERS_VERSION_V1 = 1;
    ANALYTICS_VERSION2 = 1;
    ALLOWED_EARLY_HINT_LINK_ATTRIBUTES = ["rel", "as", "href"];
    __name(normaliseHeaders, "normaliseHeaders");
    __name(generateETagHeader, "generateETagHeader");
    __name(checkIfNoneMatch, "checkIfNoneMatch");
    __name(generateHandler, "generateHandler");
    __name(parseQualityWeightedList, "parseQualityWeightedList");
    __name(isCacheable, "isCacheable");
    __name(isPreview, "isPreview");
    __name(isPreservationCacheResponseExpiring, "isPreservationCacheResponseExpiring");
    __name(isHTMLContentType, "isHTMLContentType");
  }
});

// src/miniflare-cli/assets.ts
var assets_exports5 = {};
__export(assets_exports5, {
  default: () => generateASSETSBinding
});
async function generateASSETSBinding(options) {
  const assetsFetch = options.directory !== void 0 ? await generateAssetsFetch(
    options.directory,
    options.log,
    options.signal
  ) : invalidAssetsFetch;
  return async function(miniflareRequest) {
    if (options.proxyPort) {
      try {
        const url4 = new URL(miniflareRequest.url);
        url4.host = `localhost:${options.proxyPort}`;
        const proxyRequest = new miniflare.Request(url4, miniflareRequest);
        if (proxyRequest.headers.get("Upgrade") === "websocket") {
          proxyRequest.headers.delete("Sec-WebSocket-Accept");
          proxyRequest.headers.delete("Sec-WebSocket-Key");
        }
        return await miniflare.fetch(proxyRequest, {
          dispatcher: new ProxyDispatcher(miniflareRequest.headers.get("Host"))
        });
      } catch (thrown) {
        options.log.error(new Error(`Could not proxy request: ${thrown}`));
        return new miniflare.Response(`[wrangler] Could not proxy request: ${thrown}`, {
          status: 502
        });
      }
    } else {
      try {
        return await assetsFetch(miniflareRequest);
      } catch (thrown) {
        options.log.error(new Error(`Could not serve static asset: ${thrown}`));
        return new miniflare.Response(
          `[wrangler] Could not serve static asset: ${thrown}`,
          { status: 502 }
        );
      }
    }
  };
}
async function generateAssetsFetch(directory, log2, signal) {
  directory = path3.resolve(directory);
  const polyfill2 = (await Promise.resolve().then(() => (init_miniflare2(), miniflare_exports2))).default;
  await polyfill2();
  const { generateHandler: generateHandler2, parseQualityWeightedList: parseQualityWeightedList2 } = await Promise.resolve().then(() => (init_handler3(), handler_exports));
  const headersFile = path3.join(directory, "_headers");
  const redirectsFile = path3.join(directory, "_redirects");
  const workerFile = path3.join(directory, "_worker.js");
  const ignoredFiles = [headersFile, redirectsFile, workerFile];
  let redirects;
  if (fs29.existsSync(redirectsFile)) {
    const contents = fs29.readFileSync(redirectsFile, "utf-8");
    redirects = parseRedirects(contents, {
      htmlHandling: void 0
      // Pages dev server doesn't expose html_handling configuration in this context.
    });
  }
  let headers;
  if (fs29.existsSync(headersFile)) {
    const contents = fs29.readFileSync(headersFile, "utf-8");
    headers = parseHeaders(contents);
  }
  let metadata = createMetadataObject({
    redirects,
    headers,
    headersFile,
    redirectsFile,
    logger: log2
  });
  const watcher = watch([headersFile, redirectsFile], {
    persistent: true
  }).on("change", (path84) => {
    switch (path84) {
      case headersFile: {
        log2.log("_headers modified. Re-evaluating...");
        const contents = fs29.readFileSync(headersFile).toString();
        headers = parseHeaders(contents);
        break;
      }
      case redirectsFile: {
        log2.log("_redirects modified. Re-evaluating...");
        const contents = fs29.readFileSync(redirectsFile).toString();
        redirects = parseRedirects(contents, {
          htmlHandling: void 0
          // Pages dev server doesn't expose html_handling configuration in this context.
        });
        break;
      }
    }
    metadata = createMetadataObject({
      redirects,
      headers,
      redirectsFile,
      headersFile,
      logger: log2
    });
  });
  if (signal) {
    if (signal.aborted) {
      void watcher.close().catch(() => {
      });
    } else {
      signal.addEventListener(
        "abort",
        () => void watcher.close().catch(() => {
        }),
        { once: true }
      );
    }
  }
  const generateResponse = /* @__PURE__ */ __name(async (request4) => {
    const assetKeyEntryMap = /* @__PURE__ */ new Map();
    return await generateHandler2({
      request: request4,
      metadata,
      xServerEnvHeader: "dev",
      xWebAnalyticsHeader: false,
      logError: logger.error,
      findAssetEntryForPath: /* @__PURE__ */ __name(async (path84) => {
        const filepath = path3.resolve(path3.join(directory, path84));
        if (!filepath.startsWith(directory)) {
          return null;
        }
        if (fs29.lstatSync(filepath, { throwIfNoEntry: false })?.isFile() && !ignoredFiles.includes(filepath)) {
          const hash = hashFile(filepath);
          assetKeyEntryMap.set(hash, filepath);
          return hash;
        }
        return null;
      }, "findAssetEntryForPath"),
      getAssetKey: /* @__PURE__ */ __name((assetEntry) => {
        return assetEntry;
      }, "getAssetKey"),
      negotiateContent: /* @__PURE__ */ __name((contentRequest) => {
        let rawAcceptEncoding;
        if (contentRequest.cf && "clientAcceptEncoding" in contentRequest.cf && contentRequest.cf.clientAcceptEncoding) {
          rawAcceptEncoding = contentRequest.cf.clientAcceptEncoding;
        } else {
          rawAcceptEncoding = contentRequest.headers.get("Accept-Encoding") || void 0;
        }
        const acceptEncoding = parseQualityWeightedList2(rawAcceptEncoding);
        if (acceptEncoding["identity"] === 0 || acceptEncoding["*"] === 0 && acceptEncoding["identity"] === void 0) {
          throw new Error("No acceptable encodings available");
        }
        return { encoding: null };
      }, "negotiateContent"),
      fetchAsset: /* @__PURE__ */ __name(async (assetKey) => {
        const filepath = assetKeyEntryMap.get(assetKey);
        if (!filepath) {
          throw new Error(
            "Could not fetch asset. Please file an issue on GitHub (https://github.com/cloudflare/workers-sdk/issues/new/choose) with reproduction steps."
          );
        }
        const body = fs29.readFileSync(filepath);
        let contentType = (0, import_mime3.getType)(filepath) || "application/octet-stream";
        if (contentType.startsWith("text/") && !contentType.includes("charset")) {
          contentType = `${contentType}; charset=utf-8`;
        }
        return { body, contentType };
      }, "fetchAsset")
    });
  }, "generateResponse");
  return async (input, init4) => {
    const request4 = new miniflare.Request(input, init4);
    return await generateResponse(request4);
  };
}
var import_mime3, import_undici29, ProxyDispatcher, invalidAssetsFetch;
var init_assets6 = __esm({
  "src/miniflare-cli/assets.ts"() {
    init_import_meta_url();
    init_createMetadataObject();
    init_workers_shared();
    init_esm6();
    import_mime3 = __toESM(require_mime());
    import_undici29 = __toESM(require_undici());
    init_logger();
    init_hash();
    __name(generateASSETSBinding, "generateASSETSBinding");
    ProxyDispatcher = class _ProxyDispatcher extends import_undici29.Dispatcher {
      constructor(host) {
        super();
        this.host = host;
      }
      static {
        __name(this, "ProxyDispatcher");
      }
      dispatcher = (0, import_undici29.getGlobalDispatcher)();
      dispatch(options, handler) {
        if (this.host !== null) {
          _ProxyDispatcher.reinstateHostHeader(options.headers, this.host);
        }
        return this.dispatcher.dispatch(options, handler);
      }
      close() {
        return this.dispatcher.close();
      }
      destroy() {
        return this.dispatcher.destroy();
      }
      /**
       * Ensure that the request contains a Host header, which would have been deleted
       * by the `fetch()` function before calling `dispatcher.dispatch()`.
       */
      static reinstateHostHeader(headers, host) {
        assert53__default.default(headers, "Expected all proxy requests to contain headers.");
        assert53__default.default(
          !Array.isArray(headers),
          "Expected proxy request headers to be a hash object"
        );
        assert53__default.default(
          Object.keys(headers).every((h7) => h7.toLowerCase() !== "host"),
          "Expected Host header to have been deleted."
        );
        headers["Host"] = host;
      }
    };
    __name(generateAssetsFetch, "generateAssetsFetch");
    invalidAssetsFetch = /* @__PURE__ */ __name(() => {
      throw new Error(
        "Trying to fetch assets directly when there is no `directory` option specified."
      );
    }, "invalidAssetsFetch");
  }
});
async function startDev(args) {
  let devEnv;
  let unregisterHotKeys;
  try {
    if (args.logLevel) {
      logger.loggerLevel = args.logLevel;
    }
    const authHook = /* @__PURE__ */ __name(async (config) => {
      const hotkeysDisplayed = !!unregisterHotKeys;
      let accountId = args.accountId;
      if (!accountId) {
        unregisterHotKeys?.();
        accountId = await requireAuth(config);
        if (hotkeysDisplayed) {
          assert53__default.default(devEnv !== void 0);
          unregisterHotKeys = registerDevHotKeys(
            Array.isArray(devEnv) ? devEnv : [devEnv],
            args,
            false
          );
        }
      }
      return {
        accountId,
        apiToken: requireApiToken()
      };
    }, "authHook");
    if (args.remote) {
      logger.log(
        bold(
          esm_default3`
						Support for remote bindings in ${green("`wrangler dev`")} is now available as a replacement for ${green("`wrangler dev --remote`")}. Try it out now by running ${green("`wrangler dev`")} with the ${green("`remote`")} option enabled on your resources and let us know how it goes!
						This gives you access to remote resources in development while retaining all the usual benefits of local dev: fast iteration speed, breakpoint debugging, and more.

						Refer to https://developers.cloudflare.com/workers/development-testing/#remote-bindings for more information.`
        )
      );
    }
    if (Array.isArray(args.config)) {
      const numWorkers = args.config.length;
      const primaryDevEnv2 = new exports.unstable_DevEnv({
        runtimeFactories: [
          (d8) => new MultiworkerRuntimeController(d8, numWorkers)
        ]
      });
      devEnv = [
        await setupDevEnv(primaryDevEnv2, args.config[0], authHook, {
          ...args,
          multiworkerPrimary: true
        })
      ];
      devEnv.push(
        ...await Promise.all(
          args.config.slice(1).map((c8) => {
            const auxDevEnv = new exports.unstable_DevEnv({
              runtimeFactories: [() => primaryDevEnv2.runtimes[0]],
              proxyFactory: /* @__PURE__ */ __name((d8) => new NoOpProxyController(d8), "proxyFactory")
            });
            return setupDevEnv(auxDevEnv, c8, authHook, {
              env: args.env,
              disableDevRegistry: args.disableDevRegistry,
              multiworkerPrimary: false
            });
          })
        )
      );
      if (isInteractive3() && args.showInteractiveDevSession !== false) {
        unregisterHotKeys = registerDevHotKeys(devEnv, args);
      }
    } else {
      devEnv = new exports.unstable_DevEnv();
      await setupDevEnv(devEnv, args.config, authHook, args);
      if (isInteractive3() && args.showInteractiveDevSession !== false) {
        unregisterHotKeys = registerDevHotKeys([devEnv], args);
      }
    }
    const [primaryDevEnv, ...secondary] = Array.isArray(devEnv) ? devEnv : [devEnv];
    void primaryDevEnv.proxy.ready.promise.then(({ url: url4 }) => {
      if (args.onReady) {
        args.onReady(url4.hostname, parseInt(url4.port));
      }
      if ((args.enableIpc || !args.onReady) && process.send && typeof vitest === "undefined") {
        process.send(
          JSON.stringify({
            event: "DEV_SERVER_READY",
            ip: url4.hostname,
            port: parseInt(url4.port)
          })
        );
      }
      const allDevEnvs = [primaryDevEnv, ...secondary];
      const hasCrons = allDevEnvs.some(
        (env6) => env6.config.latestConfig?.triggers?.some((t13) => t13.type === "cron") ?? false
      );
      maybePrintScheduledWorkerWarning(hasCrons, !!args.testScheduled, url4);
    });
    return {
      devEnv: primaryDevEnv,
      secondary,
      unregisterHotKeys
    };
  } catch (e10) {
    await Promise.allSettled([
      ...Array.isArray(devEnv) ? devEnv.map((d8) => d8.teardown()) : [devEnv?.teardown()],
      (async () => {
        unregisterHotKeys?.();
      })()
    ]);
    throw e10;
  }
}
async function setupDevEnv(devEnv, configPath, auth, args) {
  await devEnv.config.set(
    {
      name: args.name,
      config: configPath,
      entrypoint: args.script,
      compatibilityDate: args.compatibilityDate,
      compatibilityFlags: args.compatibilityFlags,
      triggers: args.routes?.map((r10) => ({
        type: "route",
        pattern: r10
      })),
      env: args.env,
      envFiles: args.envFile,
      build: {
        bundle: args.bundle !== void 0 ? args.bundle : void 0,
        define: collectKeyValues(args.define),
        jsxFactory: args.jsxFactory,
        jsxFragment: args.jsxFragment,
        tsconfig: args.tsconfig,
        minify: args.minify,
        processEntrypoint: args.processEntrypoint,
        additionalModules: args.additionalModules,
        moduleRoot: args.moduleRoot,
        moduleRules: args.rules,
        nodejsCompatMode: /* @__PURE__ */ __name((parsedConfig) => validateNodeCompatMode(
          args.compatibilityDate ?? parsedConfig.compatibility_date,
          args.compatibilityFlags ?? parsedConfig.compatibility_flags ?? [],
          {
            noBundle: args.noBundle ?? parsedConfig.no_bundle
          }
        ), "nodejsCompatMode")
      },
      bindings: {
        ...await getPagesAssetsFetcher(args.enablePagesAssetsServiceBinding),
        ...collectPlainTextVars(args.var),
        ...convertStartDevOptionsToBindings(args)
      },
      defaultBindings: args.defaultBindings,
      dev: {
        auth,
        remote: args.enablePagesAssetsServiceBinding ? (
          // When running `wrangler pages dev` we want `remote` to be `undefined` since that's the
          // only supported mode for pages (note: we can't set it to `false` as that would break
          // the AI binding)
          void 0
        ) : args.remote || (args.forceLocal || args.local ? false : void 0),
        server: {
          hostname: args.ip,
          port: args.port,
          secure: args.localProtocol === void 0 ? void 0 : args.localProtocol === "https",
          httpsCertPath: args.httpsCertPath,
          httpsKeyPath: args.httpsKeyPath
        },
        inspector: {
          hostname: args.inspectorIp,
          port: args.inspectorPort
        },
        origin: {
          hostname: args.host ?? args.localUpstream,
          secure: args.upstreamProtocol === void 0 ? void 0 : args.upstreamProtocol === "https"
        },
        persist: args.persist === false ? false : args.persistTo,
        liveReload: args.liveReload,
        testScheduled: args.testScheduled,
        logLevel: args.logLevel,
        registry: args.disableDevRegistry ? void 0 : getRegistryPath(),
        multiworkerPrimary: args.multiworkerPrimary,
        enableContainers: args.enableContainers,
        dockerPath: args.dockerPath,
        // initialise with a random id
        containerBuildId: generateContainerBuildId(),
        generateTypes: args.types
      },
      legacy: {
        site: /* @__PURE__ */ __name((configParam) => {
          const legacyAssetPaths = getResolvedSiteAssetPaths(args, configParam);
          return Boolean(args.site || configParam.site) && legacyAssetPaths ? {
            bucket: path3__namespace.default.join(
              legacyAssetPaths.baseDirectory,
              legacyAssetPaths?.assetDirectory
            ),
            include: legacyAssetPaths.includePatterns,
            exclude: legacyAssetPaths.excludePatterns
          } : void 0;
        }, "site"),
        useServiceEnvironments: !(args.legacyEnv ?? true)
      },
      assets: args.assets
    },
    true
  );
  return devEnv;
}
async function getPagesAssetsFetcher(options) {
  if (options !== void 0) {
    const generateASSETSBinding2 = (init_assets6(), __toCommonJS(assets_exports5)).default;
    return {
      ASSETS: {
        type: "fetcher",
        fetcher: await generateASSETSBinding2({
          log: logger,
          ...options
        })
      }
    };
  }
}
function getResolvedSiteAssetPaths(args, configParam) {
  return getSiteAssetPaths(
    configParam,
    args.site,
    args.siteInclude,
    args.siteExclude
  );
}
function maybePrintScheduledWorkerWarning(hasCrons, testScheduled, url4) {
  if (!hasCrons || testScheduled) {
    return;
  }
  const host = url4.hostname === "0.0.0.0" || url4.hostname === "::" ? "localhost" : url4.hostname.includes(":") ? `[${url4.hostname}]` : url4.hostname;
  const port = url4.port;
  logger.once.warn(
    `Scheduled Workers are not automatically triggered during local development.
To manually trigger a scheduled event, run:
  curl "http://${host}:${port}/cdn-cgi/handler/scheduled"
For more details, see https://developers.cloudflare.com/workers/configuration/cron-triggers/#test-cron-triggers-locally`
  );
}
var init_start_dev = __esm({
  "src/dev/start-dev.ts"() {
    init_import_meta_url();
    init_colors();
    init_containers_shared();
    init_dist();
    init_esm2();
    init_api4();
    init_MultiworkerRuntimeController();
    init_NoOpProxyController();
    init_utils2();
    init_node_compat();
    init_hotkeys();
    init_is_interactive();
    init_logger();
    init_sites2();
    init_user3();
    init_collectKeyValues();
    __name(startDev, "startDev");
    __name(setupDevEnv, "setupDevEnv");
    __name(getPagesAssetsFetcher, "getPagesAssetsFetcher");
    __name(getResolvedSiteAssetPaths, "getResolvedSiteAssetPaths");
    __name(maybePrintScheduledWorkerWarning, "maybePrintScheduledWorkerWarning");
  }
});
async function unstable_dev(script, options, apiOptions) {
  const experimentalOptions = {
    // Defaults for "experimental" options
    disableDevRegistry: false,
    disableExperimentalWarning: false,
    showInteractiveDevSession: false,
    testMode: true,
    // Override all options, including overwriting with "undefined"
    ...options?.experimental
  };
  const {
    // there are two types of "experimental" options:
    // 1. options to unstable_dev that we're still testing or are unsure of
    processEntrypoint = false,
    additionalModules,
    disableDevRegistry,
    disableExperimentalWarning,
    forceLocal,
    liveReload,
    showInteractiveDevSession,
    testMode,
    testScheduled,
    // 2. options for alpha/beta products/libs
    d1Databases,
    enablePagesAssetsServiceBinding
  } = experimentalOptions;
  if (apiOptions) {
    logger.error(
      "unstable_dev's third argument (apiOptions) has been deprecated in favor of an `experimental` property within the second argument (options).\nPlease update your code from:\n`await unstable_dev('...', {...}, {...});`\nto:\n`await unstable_dev('...', {..., experimental: {...}});`"
    );
  }
  if (!disableExperimentalWarning) {
    logger.warn(
      `unstable_dev() is experimental
unstable_dev()'s behaviour will likely change in future releases`
    );
  }
  let readyResolve;
  const readyPromise = new Promise((resolve32) => {
    readyResolve = resolve32;
  });
  const defaultLogLevel = testMode ? "warn" : "log";
  const local = options?.local ?? true;
  const dockerPath = options?.experimental?.dockerPath ?? getDockerPath();
  const devOptions = {
    script,
    inspect: false,
    _: [],
    $0: "",
    remote: !local,
    local: void 0,
    d1Databases,
    disableDevRegistry,
    testScheduled: testScheduled ?? false,
    enablePagesAssetsServiceBinding,
    forceLocal,
    liveReload,
    showInteractiveDevSession,
    onReady: /* @__PURE__ */ __name((address2, port2) => {
      readyResolve({ address: address2, port: port2 });
    }, "onReady"),
    config: options?.config,
    env: options?.env,
    envFile: options?.envFiles,
    processEntrypoint,
    additionalModules,
    bundle: options?.bundle,
    compatibilityDate: options?.compatibilityDate,
    compatibilityFlags: options?.compatibilityFlags,
    ip: "127.0.0.1",
    inspectorPort: options?.inspectorPort ?? 0,
    inspectorIp: void 0,
    v: void 0,
    cwd: void 0,
    localProtocol: options?.localProtocol,
    httpsKeyPath: options?.httpsKeyPath,
    httpsCertPath: options?.httpsCertPath,
    assets: void 0,
    site: options?.site,
    // Root folder of static assets for Workers Sites
    siteInclude: options?.siteInclude,
    // Array of .gitignore-style patterns that match file or directory names from the sites directory. Only matched items will be uploaded.
    siteExclude: options?.siteExclude,
    // Array of .gitignore-style patterns that match file or directory names from the sites directory. Matched items will not be uploaded.
    persist: options?.persist,
    // Enable persistence for local mode, using default path: .wrangler/state
    persistTo: options?.persistTo,
    // Specify directory to use for local persistence (implies --persist)
    name: void 0,
    noBundle: false,
    latest: false,
    routes: void 0,
    host: void 0,
    localUpstream: void 0,
    upstreamProtocol: void 0,
    var: void 0,
    define: void 0,
    alias: void 0,
    jsxFactory: void 0,
    jsxFragment: void 0,
    tsconfig: void 0,
    minify: void 0,
    legacyEnv: void 0,
    ...options,
    logLevel: options?.logLevel ?? defaultLogLevel,
    port: options?.port ?? 0,
    experimentalProvision: void 0,
    experimentalAutoCreate: false,
    enableIpc: options?.experimental?.enableIpc,
    nodeCompat: void 0,
    enableContainers: options?.experimental?.enableContainers ?? false,
    dockerPath,
    containerEngine: options?.experimental?.containerEngine,
    types: false
  };
  const devServer = await run(
    {
      // TODO: can we make this work?
      MULTIWORKER: false,
      RESOURCES_PROVISION: false,
      AUTOCREATE_RESOURCES: false
    },
    () => startDev(devOptions)
  );
  const { port, address } = await readyPromise;
  return {
    port,
    address,
    stop: /* @__PURE__ */ __name(async () => {
      await devServer.devEnv.teardown.bind(devServer.devEnv)();
      devServer.unregisterHotKeys?.();
    }, "stop"),
    fetch: /* @__PURE__ */ __name(async (input, init4) => {
      return await (0, import_undici30.fetch)(
        ...parseRequestInput(address, port, input, init4, options?.localProtocol)
      );
    }, "fetch"),
    waitUntilExit: /* @__PURE__ */ __name(async () => {
      await events__default.default.once(devServer.devEnv, "teardown");
    }, "waitUntilExit")
  };
}
function parseRequestInput(readyAddress, readyPort, input = "/", init4, protocol = "http") {
  if (typeof input === "string") {
    input = new URL(input, "http://placeholder");
  }
  const forward = new import_undici30.Request(input, init4);
  const url4 = new URL(forward.url);
  forward.headers.set("MF-Original-URL", url4.toString());
  forward.headers.set("MF-Disable-Pretty-Error", "true");
  url4.protocol = protocol;
  url4.hostname = readyAddress;
  url4.port = readyPort.toString();
  if (forward.body !== null && forward.headers.get("Content-Length") === "0") {
    forward.headers.delete("Content-Length");
  }
  return [url4, forward];
}
var import_undici30;
var init_dev3 = __esm({
  "src/api/dev.ts"() {
    init_import_meta_url();
    init_dist();
    import_undici30 = __toESM(require_undici());
    init_start_dev();
    init_experimental_flags();
    init_logger();
    __name(unstable_dev, "unstable_dev");
    __name(parseRequestInput, "parseRequestInput");
  }
});

// src/api/pages/index.ts
exports.unstable_pages = void 0;
var init_pages5 = __esm({
  "src/api/pages/index.ts"() {
    init_import_meta_url();
    init_deploy3();
    exports.unstable_pages = {
      deploy: deploy2
    };
  }
});

// src/api/integrations/platform/caches.ts
var CacheStorage, Cache2;
var init_caches = __esm({
  "src/api/integrations/platform/caches.ts"() {
    init_import_meta_url();
    CacheStorage = class {
      static {
        __name(this, "CacheStorage");
      }
      constructor() {
        const unsupportedMethods = ["has", "delete", "keys", "match"];
        unsupportedMethods.forEach((method) => {
          Object.defineProperty(this, method, {
            enumerable: false,
            value: /* @__PURE__ */ __name(() => {
              throw new Error(
                `Failed to execute '${method}' on 'CacheStorage': the method is not implemented.`
              );
            }, "value")
          });
        });
        Object.defineProperty(this, "default", {
          enumerable: true,
          value: this.default
        });
      }
      async open(cacheName) {
        return new Cache2();
      }
      get default() {
        return new Cache2();
      }
    };
    Cache2 = class {
      static {
        __name(this, "Cache");
      }
      async delete(request4, options) {
        return false;
      }
      async match(request4, options) {
        return void 0;
      }
      async put(request4, response) {
      }
    };
  }
});

// src/api/integrations/platform/executionContext.ts
var ExecutionContext;
var init_executionContext = __esm({
  "src/api/integrations/platform/executionContext.ts"() {
    init_import_meta_url();
    ExecutionContext = class _ExecutionContext {
      static {
        __name(this, "ExecutionContext");
      }
      // eslint-disable-next-line @typescript-eslint/no-explicit-any, unused-imports/no-unused-vars
      waitUntil(promise) {
        if (!(this instanceof _ExecutionContext)) {
          throw new Error("Illegal invocation");
        }
      }
      passThroughOnException() {
        if (!(this instanceof _ExecutionContext)) {
          throw new Error("Illegal invocation");
        }
      }
      // eslint-disable-next-line @typescript-eslint/no-explicit-any
      props = {};
    };
  }
});
function unstable_getDevCompatibilityDate() {
  return getTodaysCompatDate();
}
async function getPlatformProxy(options = {}) {
  const env6 = options.environment;
  const config = readConfig({
    config: options.configPath,
    env: env6
  });
  let remoteProxySession = void 0;
  if (config.configPath && options.remoteBindings !== false) {
    remoteProxySession = (await maybeStartOrUpdateRemoteProxySession({
      path: config.configPath,
      environment: env6
    }) ?? {}).session;
  }
  const miniflareOptions = await getMiniflareOptionsFromConfig({
    config,
    options,
    remoteProxyConnectionString: remoteProxySession?.remoteProxyConnectionString
  });
  const mf = new miniflare.Miniflare(miniflareOptions);
  const bindings = await mf.getBindings();
  const cf2 = await mf.getCf();
  deepFreeze(cf2);
  return {
    env: bindings,
    cf: cf2,
    ctx: new ExecutionContext(),
    caches: new CacheStorage(),
    dispose: /* @__PURE__ */ __name(async () => {
      await remoteProxySession?.dispose();
      await mf.dispose();
    }, "dispose")
  };
}
async function getMiniflareOptionsFromConfig(args) {
  const { config, options, remoteProxyConnectionString } = args;
  const bindings = getBindings2(
    config,
    options.environment,
    options.envFiles,
    true,
    {},
    {}
  );
  if (config["durable_objects"]) {
    const { localBindings } = partitionDurableObjectBindings(config);
    if (localBindings.length > 0) {
      logger.warn(dedent3`
				You have defined bindings to the following internal Durable Objects:
				${localBindings.map((b11) => `- ${JSON.stringify(b11)}`).join("\n")}
				These will not work in local development, but they should work in production.

				If you want to develop these locally, you can define your DO in a separate Worker, with a separate configuration file.
				For detailed instructions, refer to the Durable Objects section here: https://developers.cloudflare.com/workers/wrangler/api#supported-bindings
				`);
    }
  }
  if (config.workflows?.length > 0) {
    logger.warn(dedent3`
				You have defined bindings to the following Workflows:
				${config.workflows.map((b11) => `- ${JSON.stringify(b11)}`).join("\n")}
				These are not available in local development, so you will not be able to bind to them when testing locally, but they should work in production.
				`);
    const workflowBindings = extractBindingsOfType("workflow", bindings);
    for (const workflow of workflowBindings) {
      delete bindings?.[workflow.binding];
    }
  }
  const { bindingOptions, externalWorkers } = buildMiniflareBindingOptions(
    {
      name: config.name,
      complianceRegion: config.compliance_region,
      bindings,
      queueConsumers: void 0,
      migrations: config.migrations,
      tails: [],
      streamingTails: [],
      containerDOClassNames: new Set(
        config.containers?.map((c8) => c8.class_name)
      ),
      containerBuildId: void 0,
      enableContainers: config.dev.enable_containers
    },
    remoteProxyConnectionString
  );
  let processedAssetOptions;
  if (config.assets?.directory) {
    try {
      processedAssetOptions = getAssetsOptions({ assets: void 0 }, config);
    } catch (e10) {
      const isNonExistentError = e10 instanceof NonExistentAssetsDirError;
      if (!isNonExistentError) {
        throw e10;
      }
    }
  }
  const assetOptions = processedAssetOptions ? buildAssetOptions({ assets: processedAssetOptions }) : {};
  const defaultPersistRoot = getMiniflarePersistRoot(options.persist);
  const miniflareOptions = {
    workers: [
      {
        script: "",
        modules: true,
        name: config.name,
        ...bindingOptions,
        ...assetOptions
      },
      ...externalWorkers
    ],
    defaultPersistRoot
  };
  return {
    script: "",
    modules: true,
    ...miniflareOptions,
    unsafeDevRegistryPath: getRegistryPath(),
    unsafeDevRegistryDurableObjectProxy: true
  };
}
function getMiniflarePersistRoot(persist) {
  if (persist === false) {
    return;
  }
  const defaultPersistPath = ".wrangler/state/v3";
  const persistPath = typeof persist === "object" ? persist.path : defaultPersistPath;
  return persistPath;
}
function deepFreeze(obj) {
  Object.freeze(obj);
  Object.entries(obj).forEach(([, prop]) => {
    if (prop !== null && typeof prop === "object" && !Object.isFrozen(prop)) {
      deepFreeze(prop);
    }
  });
}
function unstable_getMiniflareWorkerOptions(configOrConfigPath, env6, options) {
  const config = typeof configOrConfigPath === "string" ? readConfig({ config: configOrConfigPath, env: env6 }) : configOrConfigPath;
  const modulesRules = config.rules.concat(DEFAULT_MODULE_RULES).map((rule) => ({
    type: rule.type,
    include: rule.globs,
    fallthrough: rule.fallthrough
  }));
  const containerDOClassNames = new Set(
    config.containers?.map((c8) => c8.class_name)
  );
  const bindings = getBindings2(
    config,
    env6,
    options?.envFiles,
    true,
    void 0,
    void 0
  );
  const enableContainers = options?.overrides?.enableContainers !== void 0 ? options?.overrides?.enableContainers : config.dev.enable_containers;
  const { bindingOptions, externalWorkers } = buildMiniflareBindingOptions(
    {
      name: config.name,
      complianceRegion: config.compliance_region,
      bindings,
      queueConsumers: config.queues.consumers,
      migrations: config.migrations,
      tails: config.tail_consumers,
      streamingTails: config.streaming_tail_consumers,
      containerDOClassNames,
      containerBuildId: options?.containerBuildId,
      enableContainers
    },
    options?.remoteProxyConnectionString
  );
  const serviceBindings = extractBindingsOfType("service", bindings);
  if (serviceBindings.length > 0) {
    bindingOptions.serviceBindings = Object.fromEntries(
      serviceBindings.map((binding) => {
        const name2 = binding.service === config.name ? miniflare.kCurrentWorker : binding.service;
        if (options?.remoteProxyConnectionString && binding.remote) {
          return [
            binding.binding,
            {
              name: name2,
              entrypoint: binding.entrypoint,
              remoteProxyConnectionString: options.remoteProxyConnectionString
            }
          ];
        }
        return [binding.binding, { name: name2, entrypoint: binding.entrypoint }];
      })
    );
  }
  const durableObjectBindings = extractBindingsOfType(
    "durable_object_namespace",
    bindings
  );
  if (durableObjectBindings.length > 0) {
    const classNameToUseSQLite = getDurableObjectClassNameToUseSQLiteMap(
      config.migrations
    );
    bindingOptions.durableObjects = Object.fromEntries(
      durableObjectBindings.map((binding) => {
        const useSQLite = classNameToUseSQLite.get(binding.class_name);
        return [
          binding.name,
          {
            className: binding.class_name,
            scriptName: binding.script_name,
            useSQLite,
            container: enableContainers && config.containers?.length ? getImageNameFromDOClassName({
              doClassName: binding.class_name,
              containerDOClassNames,
              containerBuildId: options?.containerBuildId
            }) : void 0
          }
        ];
      })
    );
  }
  const sitesAssetPaths = getSiteAssetPaths(config);
  const sitesOptions = buildSitesOptions({ legacyAssetPaths: sitesAssetPaths });
  const hasAssetsDirectory = config.assets?.directory || options?.overrides?.assets?.directory;
  const processedAssetOptions = hasAssetsDirectory ? getAssetsOptions(
    { assets: void 0 },
    config,
    options?.overrides?.assets
  ) : void 0;
  const assetOptions = processedAssetOptions ? buildAssetOptions({ assets: processedAssetOptions }) : {};
  const useContainers = config.dev?.enable_containers && config.containers?.length;
  const workerOptions = {
    compatibilityDate: config.compatibility_date,
    compatibilityFlags: config.compatibility_flags,
    modulesRules,
    containerEngine: useContainers ? config.dev.container_engine ?? resolveDockerHost(getDockerPath()) : void 0,
    ...bindingOptions,
    ...sitesOptions,
    ...assetOptions
  };
  return {
    workerOptions,
    define: config.define,
    main: config.main,
    externalWorkers
  };
}
var init_platform = __esm({
  "src/api/integrations/platform/index.ts"() {
    init_import_meta_url();
    init_containers_shared();
    init_dist();
    init_assets5();
    init_config();
    init_entry();
    init_rules();
    init_dev2();
    init_class_names_sqlite();
    init_miniflare();
    init_logger();
    init_sites2();
    init_dedent();
    init_remoteBindings();
    init_utils2();
    init_caches();
    init_executionContext();
    init_dev_vars();
    init_details2();
    __name(unstable_getDevCompatibilityDate, "unstable_getDevCompatibilityDate");
    __name(getPlatformProxy, "getPlatformProxy");
    __name(getMiniflareOptionsFromConfig, "getMiniflareOptionsFromConfig");
    __name(getMiniflarePersistRoot, "getMiniflarePersistRoot");
    __name(deepFreeze, "deepFreeze");
    __name(unstable_getMiniflareWorkerOptions, "unstable_getMiniflareWorkerOptions");
  }
});

// src/api/integrations/index.ts
var init_integrations6 = __esm({
  "src/api/integrations/index.ts"() {
    init_import_meta_url();
    init_platform();
  }
});

// src/api/index.ts
var init_api4 = __esm({
  "src/api/index.ts"() {
    init_import_meta_url();
    init_dev3();
    init_pages5();
    init_mtls_certificate();
    init_utils2();
    init_DevEnv();
    init_startDevWorker();
    init_events();
    init_integrations6();
    init_remoteBindings();
  }
});

// src/cli.ts
init_import_meta_url();

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/shims/web.mjs
init_import_meta_url();
init_registry();

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/_shims/web-runtime.mjs
init_import_meta_url();
init_MultipartBody();
function getRuntime({ manuallyImported } = {}) {
  const recommendation = manuallyImported ? `You may need to use polyfills` : `Add one of these imports before your first \`import \u2026 from 'cloudflare'\`:
- \`import 'cloudflare/shims/node'\` (if you're running on Node)
- \`import 'cloudflare/shims/web'\` (otherwise)
`;
  let _fetch, _Request, _Response, _Headers;
  try {
    _fetch = fetch;
    _Request = Request;
    _Response = Response;
    _Headers = Headers;
  } catch (error2) {
    throw new Error(`this environment is missing the following Web Fetch API type: ${error2.message}. ${recommendation}`);
  }
  return {
    kind: "web",
    fetch: _fetch,
    Request: _Request,
    Response: _Response,
    Headers: _Headers,
    FormData: (
      // @ts-ignore
      typeof FormData !== "undefined" ? FormData : class FormData {
        static {
          __name(this, "FormData");
        }
        // @ts-ignore
        constructor() {
          throw new Error(`file uploads aren't supported in this environment yet as 'FormData' is undefined. ${recommendation}`);
        }
      }
    ),
    Blob: typeof Blob !== "undefined" ? Blob : class Blob {
      static {
        __name(this, "Blob");
      }
      constructor() {
        throw new Error(`file uploads aren't supported in this environment yet as 'Blob' is undefined. ${recommendation}`);
      }
    },
    File: (
      // @ts-ignore
      typeof File !== "undefined" ? File : class File {
        static {
          __name(this, "File");
        }
        // @ts-ignore
        constructor() {
          throw new Error(`file uploads aren't supported in this environment yet as 'File' is undefined. ${recommendation}`);
        }
      }
    ),
    ReadableStream: (
      // @ts-ignore
      typeof ReadableStream !== "undefined" ? ReadableStream : class ReadableStream {
        static {
          __name(this, "ReadableStream");
        }
        // @ts-ignore
        constructor() {
          throw new Error(`streaming isn't supported in this environment yet as 'ReadableStream' is undefined. ${recommendation}`);
        }
      }
    ),
    getMultipartRequestOptions: /* @__PURE__ */ __name(async (form, opts) => ({
      ...opts,
      body: new MultipartBody(form)
    }), "getMultipartRequestOptions"),
    getDefaultAgent: /* @__PURE__ */ __name((url4) => void 0, "getDefaultAgent"),
    fileFromPath: /* @__PURE__ */ __name(() => {
      throw new Error("The `fileFromPath` function is only supported in Node. See the README for more details: https://www.github.com/cloudflare/cloudflare-typescript#file-uploads");
    }, "fileFromPath"),
    isFsReadStream: /* @__PURE__ */ __name((value) => false, "isFsReadStream")
  };
}
__name(getRuntime, "getRuntime");

// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/shims/web.mjs
setShims(getRuntime({ manuallyImported: true }));

// src/cli.ts
init_dist();

// ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/helpers/helpers.mjs
init_import_meta_url();
init_apply_extends();
init_process_argv();
init_lib();
init_esm();

// src/cli.ts
init_api4();
init_src3();
init_print_bindings();
init_splitter();
init_dist();
init_dist();
init_details2();
init_run();
init_framework_class();
init_experimental_commands_api();
if (typeof vitest === "undefined" && __require.main === module) {
  main(hideBin(process7__default.default.argv)).catch((e10) => {
    const exitCode = e10 instanceof FatalError && e10.code || 1;
    process7__default.default.exit(exitCode);
  });
}
var unstable_generateASSETSBinding = (
  // eslint-disable-next-line @typescript-eslint/no-require-imports
  (init_assets6(), __toCommonJS(assets_exports5)).default
);
/*! Bundled license information:

smol-toml/dist/error.js:
  (*!
   * Copyright (c) Squirrel Chat et al., All rights reserved.
   * SPDX-License-Identifier: BSD-3-Clause
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions are met:
   *
   * 1. Redistributions of source code must retain the above copyright notice, this
   *    list of conditions and the following disclaimer.
   * 2. Redistributions in binary form must reproduce the above copyright notice,
   *    this list of conditions and the following disclaimer in the
   *    documentation and/or other materials provided with the distribution.
   * 3. Neither the name of the copyright holder nor the names of its contributors
   *    may be used to endorse or promote products derived from this software without
   *    specific prior written permission.
   *
   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
   * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
   * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   *)

smol-toml/dist/util.js:
  (*!
   * Copyright (c) Squirrel Chat et al., All rights reserved.
   * SPDX-License-Identifier: BSD-3-Clause
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions are met:
   *
   * 1. Redistributions of source code must retain the above copyright notice, this
   *    list of conditions and the following disclaimer.
   * 2. Redistributions in binary form must reproduce the above copyright notice,
   *    this list of conditions and the following disclaimer in the
   *    documentation and/or other materials provided with the distribution.
   * 3. Neither the name of the copyright holder nor the names of its contributors
   *    may be used to endorse or promote products derived from this software without
   *    specific prior written permission.
   *
   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
   * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
   * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   *)

smol-toml/dist/date.js:
  (*!
   * Copyright (c) Squirrel Chat et al., All rights reserved.
   * SPDX-License-Identifier: BSD-3-Clause
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions are met:
   *
   * 1. Redistributions of source code must retain the above copyright notice, this
   *    list of conditions and the following disclaimer.
   * 2. Redistributions in binary form must reproduce the above copyright notice,
   *    this list of conditions and the following disclaimer in the
   *    documentation and/or other materials provided with the distribution.
   * 3. Neither the name of the copyright holder nor the names of its contributors
   *    may be used to endorse or promote products derived from this software without
   *    specific prior written permission.
   *
   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
   * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
   * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   *)

smol-toml/dist/primitive.js:
  (*!
   * Copyright (c) Squirrel Chat et al., All rights reserved.
   * SPDX-License-Identifier: BSD-3-Clause
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions are met:
   *
   * 1. Redistributions of source code must retain the above copyright notice, this
   *    list of conditions and the following disclaimer.
   * 2. Redistributions in binary form must reproduce the above copyright notice,
   *    this list of conditions and the following disclaimer in the
   *    documentation and/or other materials provided with the distribution.
   * 3. Neither the name of the copyright holder nor the names of its contributors
   *    may be used to endorse or promote products derived from this software without
   *    specific prior written permission.
   *
   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
   * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
   * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   *)

smol-toml/dist/extract.js:
  (*!
   * Copyright (c) Squirrel Chat et al., All rights reserved.
   * SPDX-License-Identifier: BSD-3-Clause
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions are met:
   *
   * 1. Redistributions of source code must retain the above copyright notice, this
   *    list of conditions and the following disclaimer.
   * 2. Redistributions in binary form must reproduce the above copyright notice,
   *    this list of conditions and the following disclaimer in the
   *    documentation and/or other materials provided with the distribution.
   * 3. Neither the name of the copyright holder nor the names of its contributors
   *    may be used to endorse or promote products derived from this software without
   *    specific prior written permission.
   *
   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
   * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
   * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   *)

smol-toml/dist/struct.js:
  (*!
   * Copyright (c) Squirrel Chat et al., All rights reserved.
   * SPDX-License-Identifier: BSD-3-Clause
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions are met:
   *
   * 1. Redistributions of source code must retain the above copyright notice, this
   *    list of conditions and the following disclaimer.
   * 2. Redistributions in binary form must reproduce the above copyright notice,
   *    this list of conditions and the following disclaimer in the
   *    documentation and/or other materials provided with the distribution.
   * 3. Neither the name of the copyright holder nor the names of its contributors
   *    may be used to endorse or promote products derived from this software without
   *    specific prior written permission.
   *
   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
   * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
   * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   *)

smol-toml/dist/parse.js:
  (*!
   * Copyright (c) Squirrel Chat et al., All rights reserved.
   * SPDX-License-Identifier: BSD-3-Clause
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions are met:
   *
   * 1. Redistributions of source code must retain the above copyright notice, this
   *    list of conditions and the following disclaimer.
   * 2. Redistributions in binary form must reproduce the above copyright notice,
   *    this list of conditions and the following disclaimer in the
   *    documentation and/or other materials provided with the distribution.
   * 3. Neither the name of the copyright holder nor the names of its contributors
   *    may be used to endorse or promote products derived from this software without
   *    specific prior written permission.
   *
   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
   * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
   * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   *)

smol-toml/dist/stringify.js:
  (*!
   * Copyright (c) Squirrel Chat et al., All rights reserved.
   * SPDX-License-Identifier: BSD-3-Clause
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions are met:
   *
   * 1. Redistributions of source code must retain the above copyright notice, this
   *    list of conditions and the following disclaimer.
   * 2. Redistributions in binary form must reproduce the above copyright notice,
   *    this list of conditions and the following disclaimer in the
   *    documentation and/or other materials provided with the distribution.
   * 3. Neither the name of the copyright holder nor the names of its contributors
   *    may be used to endorse or promote products derived from this software without
   *    specific prior written permission.
   *
   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
   * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
   * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   *)

smol-toml/dist/index.js:
  (*!
   * Copyright (c) Squirrel Chat et al., All rights reserved.
   * SPDX-License-Identifier: BSD-3-Clause
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions are met:
   *
   * 1. Redistributions of source code must retain the above copyright notice, this
   *    list of conditions and the following disclaimer.
   * 2. Redistributions in binary form must reproduce the above copyright notice,
   *    this list of conditions and the following disclaimer in the
   *    documentation and/or other materials provided with the distribution.
   * 3. Neither the name of the copyright holder nor the names of its contributors
   *    may be used to endorse or promote products derived from this software without
   *    specific prior written permission.
   *
   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
   * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
   * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   *)
*/
/*!
 * Copyright (c) 2011 Felix Geisendörfer (felix@debuggable.com)
 *
 *  Permission is hereby granted, free of charge, to any person obtaining a copy
 *  of this software and associated documentation files (the "Software"), to deal
 *  in the Software without restriction, including without limitation the rights
 *  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 *  copies of the Software, and to permit persons to whom the Software is
 *  furnished to do so, subject to the following conditions:
 *
 *  The above copyright notice and this permission notice shall be included in
 *  all copies or substantial portions of the Software.
 *
 *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 *  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 *  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 *  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 *  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 *  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 *  THE SOFTWARE.
 */
/*! Bundled license information:

yargs-parser/build/lib/string-utils.js:
  (**
   * @license
   * Copyright (c) 2016, Contributors
   * SPDX-License-Identifier: ISC
   *)

yargs-parser/build/lib/tokenize-arg-string.js:
  (**
   * @license
   * Copyright (c) 2016, Contributors
   * SPDX-License-Identifier: ISC
   *)

yargs-parser/build/lib/yargs-parser-types.js:
  (**
   * @license
   * Copyright (c) 2016, Contributors
   * SPDX-License-Identifier: ISC
   *)

yargs-parser/build/lib/yargs-parser.js:
  (**
   * @license
   * Copyright (c) 2016, Contributors
   * SPDX-License-Identifier: ISC
   *)

yargs-parser/build/lib/index.js:
  (**
   * @fileoverview Main entrypoint for libraries using yargs-parser in Node.js
   * CJS and ESM environments.
   *
   * @license
   * Copyright (c) 2016, Contributors
   * SPDX-License-Identifier: ISC
   *)

undici/lib/web/fetch/body.js:
  (*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> *)

undici/lib/web/websocket/frame.js:
  (*! ws. MIT License. Einar Otto Stangvik <einaros@gmail.com> *)

deep-extend/lib/deep-extend.js:
  (*!
   * @description Recursive object extending
   * @author Viacheslav Lotsmanov <lotsmanov89@gmail.com>
   * @license MIT
   *
   * The MIT License (MIT)
   *
   * Copyright (c) 2013-2018 Viacheslav Lotsmanov
   *
   * Permission is hereby granted, free of charge, to any person obtaining a copy of
   * this software and associated documentation files (the "Software"), to deal in
   * the Software without restriction, including without limitation the rights to
   * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
   * the Software, and to permit persons to whom the Software is furnished to do so,
   * subject to the following conditions:
   *
   * The above copyright notice and this permission notice shall be included in all
   * copies or substantial portions of the Software.
   *
   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
   * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
   * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
   * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
   * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
   *)

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

smol-toml/dist/error.js:
  (*!
   * Copyright (c) Squirrel Chat et al., All rights reserved.
   * SPDX-License-Identifier: BSD-3-Clause
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions are met:
   *
   * 1. Redistributions of source code must retain the above copyright notice, this
   *    list of conditions and the following disclaimer.
   * 2. Redistributions in binary form must reproduce the above copyright notice,
   *    this list of conditions and the following disclaimer in the
   *    documentation and/or other materials provided with the distribution.
   * 3. Neither the name of the copyright holder nor the names of its contributors
   *    may be used to endorse or promote products derived from this software without
   *    specific prior written permission.
   *
   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
   * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
   * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   *)

smol-toml/dist/util.js:
  (*!
   * Copyright (c) Squirrel Chat et al., All rights reserved.
   * SPDX-License-Identifier: BSD-3-Clause
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions are met:
   *
   * 1. Redistributions of source code must retain the above copyright notice, this
   *    list of conditions and the following disclaimer.
   * 2. Redistributions in binary form must reproduce the above copyright notice,
   *    this list of conditions and the following disclaimer in the
   *    documentation and/or other materials provided with the distribution.
   * 3. Neither the name of the copyright holder nor the names of its contributors
   *    may be used to endorse or promote products derived from this software without
   *    specific prior written permission.
   *
   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
   * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
   * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   *)

smol-toml/dist/date.js:
  (*!
   * Copyright (c) Squirrel Chat et al., All rights reserved.
   * SPDX-License-Identifier: BSD-3-Clause
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions are met:
   *
   * 1. Redistributions of source code must retain the above copyright notice, this
   *    list of conditions and the following disclaimer.
   * 2. Redistributions in binary form must reproduce the above copyright notice,
   *    this list of conditions and the following disclaimer in the
   *    documentation and/or other materials provided with the distribution.
   * 3. Neither the name of the copyright holder nor the names of its contributors
   *    may be used to endorse or promote products derived from this software without
   *    specific prior written permission.
   *
   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
   * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
   * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   *)

smol-toml/dist/primitive.js:
  (*!
   * Copyright (c) Squirrel Chat et al., All rights reserved.
   * SPDX-License-Identifier: BSD-3-Clause
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions are met:
   *
   * 1. Redistributions of source code must retain the above copyright notice, this
   *    list of conditions and the following disclaimer.
   * 2. Redistributions in binary form must reproduce the above copyright notice,
   *    this list of conditions and the following disclaimer in the
   *    documentation and/or other materials provided with the distribution.
   * 3. Neither the name of the copyright holder nor the names of its contributors
   *    may be used to endorse or promote products derived from this software without
   *    specific prior written permission.
   *
   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
   * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
   * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   *)

smol-toml/dist/extract.js:
  (*!
   * Copyright (c) Squirrel Chat et al., All rights reserved.
   * SPDX-License-Identifier: BSD-3-Clause
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions are met:
   *
   * 1. Redistributions of source code must retain the above copyright notice, this
   *    list of conditions and the following disclaimer.
   * 2. Redistributions in binary form must reproduce the above copyright notice,
   *    this list of conditions and the following disclaimer in the
   *    documentation and/or other materials provided with the distribution.
   * 3. Neither the name of the copyright holder nor the names of its contributors
   *    may be used to endorse or promote products derived from this software without
   *    specific prior written permission.
   *
   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
   * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
   * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   *)

smol-toml/dist/struct.js:
  (*!
   * Copyright (c) Squirrel Chat et al., All rights reserved.
   * SPDX-License-Identifier: BSD-3-Clause
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions are met:
   *
   * 1. Redistributions of source code must retain the above copyright notice, this
   *    list of conditions and the following disclaimer.
   * 2. Redistributions in binary form must reproduce the above copyright notice,
   *    this list of conditions and the following disclaimer in the
   *    documentation and/or other materials provided with the distribution.
   * 3. Neither the name of the copyright holder nor the names of its contributors
   *    may be used to endorse or promote products derived from this software without
   *    specific prior written permission.
   *
   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
   * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
   * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   *)

smol-toml/dist/parse.js:
  (*!
   * Copyright (c) Squirrel Chat et al., All rights reserved.
   * SPDX-License-Identifier: BSD-3-Clause
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions are met:
   *
   * 1. Redistributions of source code must retain the above copyright notice, this
   *    list of conditions and the following disclaimer.
   * 2. Redistributions in binary form must reproduce the above copyright notice,
   *    this list of conditions and the following disclaimer in the
   *    documentation and/or other materials provided with the distribution.
   * 3. Neither the name of the copyright holder nor the names of its contributors
   *    may be used to endorse or promote products derived from this software without
   *    specific prior written permission.
   *
   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
   * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
   * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   *)

smol-toml/dist/stringify.js:
  (*!
   * Copyright (c) Squirrel Chat et al., All rights reserved.
   * SPDX-License-Identifier: BSD-3-Clause
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions are met:
   *
   * 1. Redistributions of source code must retain the above copyright notice, this
   *    list of conditions and the following disclaimer.
   * 2. Redistributions in binary form must reproduce the above copyright notice,
   *    this list of conditions and the following disclaimer in the
   *    documentation and/or other materials provided with the distribution.
   * 3. Neither the name of the copyright holder nor the names of its contributors
   *    may be used to endorse or promote products derived from this software without
   *    specific prior written permission.
   *
   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
   * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
   * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   *)

smol-toml/dist/index.js:
  (*!
   * Copyright (c) Squirrel Chat et al., All rights reserved.
   * SPDX-License-Identifier: BSD-3-Clause
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions are met:
   *
   * 1. Redistributions of source code must retain the above copyright notice, this
   *    list of conditions and the following disclaimer.
   * 2. Redistributions in binary form must reproduce the above copyright notice,
   *    this list of conditions and the following disclaimer in the
   *    documentation and/or other materials provided with the distribution.
   * 3. Neither the name of the copyright holder nor the names of its contributors
   *    may be used to endorse or promote products derived from this software without
   *    specific prior written permission.
   *
   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
   * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
   * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   *)

web-streams-polyfill/dist/ponyfill.mjs:
  (**
   * @license
   * web-streams-polyfill v4.0.0-beta.3
   * Copyright 2021 Mattias Buelens, Diwank Singh Tomer and other contributors.
   * This code is released under the MIT license.
   * SPDX-License-Identifier: MIT
   *)

formdata-node/lib/esm/blobHelpers.js:
  (*! Based on fetch-blob. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> & David Frank *)

formdata-node/lib/esm/Blob.js:
  (*! Based on fetch-blob. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> & David Frank *)

humanize-ms/index.js:
  (*!
   * humanize-ms - index.js
   * Copyright(c) 2014 dead_horse <dead_horse@qq.com>
   * MIT Licensed
   *)

node-domexception/index.js:
  (*! node-domexception. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> *)

@webcontainer/env/dist/index.js:
  (**
   * @license Copyright 2022 Stackblitz, Inc. All Rights Reserved.
   * Portions of this software are patent pending in USA and EU jurisdictions.
   * More info available at https://stackblitz.com/terms-of-service.
   *)
*/

exports.experimental_getDetailsForAutoConfig = getDetailsForAutoConfig;
exports.experimental_getWranglerCommands = experimental_getWranglerCommands;
exports.experimental_runAutoConfig = runAutoConfig;
exports.getPlatformProxy = getPlatformProxy;
exports.maybeStartOrUpdateRemoteProxySession = maybeStartOrUpdateRemoteProxySession;
exports.startRemoteProxySession = startRemoteProxySession;
exports.unstable_convertConfigBindingsToStartWorkerBindings = convertConfigBindingsToStartWorkerBindings;
exports.unstable_dev = unstable_dev;
exports.unstable_generateASSETSBinding = unstable_generateASSETSBinding;
exports.unstable_getDevCompatibilityDate = unstable_getDevCompatibilityDate;
exports.unstable_getDurableObjectClassNameToUseSQLiteMap = getDurableObjectClassNameToUseSQLiteMap;
exports.unstable_getMiniflareWorkerOptions = unstable_getMiniflareWorkerOptions;
exports.unstable_getVarsForDev = getVarsForDev;
exports.unstable_getWorkerNameFromProject = getWorkerNameFromProject;
exports.unstable_printBindings = printBindings;
exports.unstable_readConfig = readConfig;
exports.unstable_splitSqlQuery = splitSqlQuery;
exports.unstable_startWorker = startWorker;
//# sourceMappingURL=cli.js.map
//# sourceMappingURL=cli.js.map